tdesign-mobile-vue
Version:
tdesign-mobile-vue
134 lines (130 loc) • 3.71 kB
JavaScript
/**
* tdesign v1.9.3
* (c) 2025 TDesign Group
* @license MIT
*/
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var COMMON_COMP_MAP = {
Avatar: ["AvatarGroup"],
BackTop: [],
Badge: [],
Button: [],
Calendar: [],
Cascader: [],
Checkbox: ["CheckboxGroup"],
Collapse: ["CollapsePanel"],
ConfigProvider: [],
Dialog: ["DialogPlugin"],
Divider: [],
Drawer: ["DrawerPlugin"],
Empty: [],
Guide: [],
Form: ["FormItem", "FormList"],
Icon: [],
Image: [],
ImageViewer: [],
Input: [],
Link: [],
List: ["ListItem"],
Loading: ["LoadingPlugin"],
Popup: ["PopupPlugin"],
Progress: [],
Table: [],
Tabs: ["TabPanel"],
Tag: ["CheckTag", "CheckTagGroup"],
Textarea: [],
Toast: [],
Radio: ["RadioGroup"],
Rate: [],
Slider: [],
Skeleton: [],
Steps: ["StepItem"],
Switch: [],
TreeSelect: [],
Overlay: [],
Upload: []
};
var WEB_COMP_MAP = {
Affix: [],
Anchor: ["AnchorItem"],
Alert: [],
AutoComplete: [],
Breadcrumb: ["BreadcrumbItem"],
Card: [],
ColorPicker: ["ColorPickerPanel"],
Comment: [],
DatePicker: ["DateRangePicker", "DatePickerPanel", "DateRangePickerPanel"],
Descriptions: ["DescriptionsItem"],
Dropdown: ["DropdownItem"],
Grid: ["Col", "Row"],
InputAdornment: [],
InputNumber: [],
Layout: ["Header", "Aside", "Content", "Footer"],
Menu: ["HeadMenu", "Submenu", "MenuItem"],
Message: [],
Notification: ["NotificationPlugin"],
Pagination: ["PaginationMini"],
Popconfirm: [],
RangeInput: [],
Select: [],
SelectInput: [],
Statistic: [],
StickyTool: [],
Space: [],
Swiper: ["SwiperNavigation"],
TagInput: [],
Timeline: [],
TimePicker: ["TimeRangePicker", "TimePickerPanel"],
Tooltip: ["TooltipLite"],
Transfer: [],
Tree: [],
Typography: ["Text", "Title", "Paragraph"],
Watermark: []
};
var MOBILE_COMP_MAP = {
ActionSheet: [],
Cell: ["CellGroup"],
ColorPicker: [],
CountDown: [],
DateTimePicker: [],
DropdownMenu: ["DropdownItem"],
Grid: ["GridItem"],
Fab: [],
Footer: [],
Layout: ["Col", "Row"],
Message: ["MessageItem"],
Navbar: [],
NoticeBar: [],
Indexes: ["IndexesAnchor"],
Picker: [],
Popover: [],
PullDownRefresh: [],
Result: [],
ScrollView: [],
Search: [],
Slider: [],
SideBar: ["SideBarItem"],
Stepper: [],
Sticky: [],
Swiper: ["SwiperNav"],
SwipeCell: [],
TabBar: ["TabBarItem"],
Transition: []
};
var mapToParentName = function mapToParentName(name, platform) {
var isWeb = platform === "web";
var mergedMap = _objectSpread(_objectSpread({}, COMMON_COMP_MAP), isWeb ? WEB_COMP_MAP : MOBILE_COMP_MAP);
var found = Object.entries(mergedMap).find(function (_ref) {
var _ref2 = _slicedToArray(_ref, 2),
key = _ref2[0],
values = _ref2[1];
return key === name || values.includes(name);
});
if (found) return found[0];
return null;
};
export { mapToParentName };
//# sourceMappingURL=components.js.map