tdesign-mobile-vue
Version:
tdesign-mobile-vue
158 lines (154 loc) • 5.34 kB
JavaScript
/**
* tdesign v1.9.3
* (c) 2025 TDesign Group
* @license MIT
*/
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import { ref, createApp, nextTick } from 'vue';
import ActionSheetVue from './action-sheet.js';
import '../shared/index.js';
import './style';
import './type.js';
import { isBrowser } from '../shared/util.js';
import '@babel/runtime/helpers/slicedToArray';
import './action-sheet-grid.js';
import '../grid/index.js';
import '../grid/grid.js';
import '../config.js';
import '../grid/props.js';
import '../hooks/useClass.js';
import '../config-provider/useConfig.js';
import 'lodash-es';
import '../config-provider/context.js';
import '../_common/js/global-config/mobile/default-config.js';
import '../_common/js/global-config/mobile/locale/zh_CN.js';
import '../_chunks/dep-fe4ae270.js';
import '@babel/runtime/helpers/typeof';
import '../_chunks/dep-a8acd638.js';
import 'dayjs';
import '../_chunks/dep-2200259b.js';
import '../config-provider/type.js';
import '../grid/grid-item.js';
import '../grid/grid-item-props.js';
import '../hooks/tnode.js';
import '../hooks/render-tnode.js';
import '../_common/js/utils/general.js';
import '../image/index.js';
import '../image/image.js';
import '@vueuse/core';
import 'tdesign-icons-vue-next';
import '../loading/index.js';
import '../loading/loading.js';
import '../loading/icon/gradient.js';
import '../_common/js/loading/circle-adapter.js';
import '../_common/js/utils/setStyle.js';
import '../_common/js/utils/helper.js';
import '@babel/runtime/helpers/toConsumableArray';
import '@babel/runtime/helpers/objectWithoutProperties';
import '../loading/icon/spinner.js';
import '../loading/props.js';
import '../shared/dom.js';
import '../loading/style';
import '../loading/type.js';
import '../loading/plugin.js';
import '../shared/component.js';
import '../image/props.js';
import '../image/style';
import '../image/type.js';
import '../shared/functions.js';
import '../shared/render.js';
import '../shared/render-tnode.js';
import '../shared/useCountDown/index.js';
import '@babel/runtime/helpers/asyncToGenerator';
import '@babel/runtime/regenerator';
import '../shared/useCountDown/utils.js';
import '../shared/useTouch/index.js';
import '../shared/useScrollParent/index.js';
import '../shared/useTest/index.js';
import '../shared/useClickAway/index.js';
import '../shared/hover.js';
import '../badge/index.js';
import '../badge/badge.js';
import '../badge/props.js';
import '../badge/style';
import '../badge/type.js';
import '../grid/style';
import '../grid/type.js';
import '../swiper/index.js';
import '../swiper/swiper.js';
import '../swipe-cell/useSwipe.js';
import '../swiper/props.js';
import '../hooks/useVModel.js';
import '../swiper/swiper-item.js';
import '../swiper/style';
import '../swiper/type.js';
import './action-sheet-list.js';
import '../button/index.js';
import '../button/button.js';
import '../button/props.js';
import '../form/hooks.js';
import '../button/style';
import '../button/type.js';
import '../popup/index.js';
import '../popup/popup.js';
import '../popup/props.js';
import '../overlay/index.js';
import '../overlay/overlay.js';
import '../overlay/props.js';
import '../overlay/style';
import '../hooks/useLockScroll.js';
import '../_util/useTouch.js';
import '../_util/getScrollParent.js';
import '../hooks/useTeleport.js';
import '../popup/style';
import '../popup/type.js';
import './props.js';
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 instance = null;
var app;
function create(props) {
if (!isBrowser) return;
var root = document.createElement("div");
document.body.appendChild(root);
var visible = ref(false);
var propsObject = _objectSpread({
visible: visible
}, props);
if (instance) {
instance.clear();
}
instance = ActionSheetVue;
instance.clear = function (trigger) {
app.unmount();
root.remove();
if (propsObject.onClose && trigger && trigger.trigger !== "overlay") {
propsObject.onClose(trigger);
}
instance = null;
};
app = createApp(instance, _objectSpread({}, propsObject));
app.mount(root);
nextTick(function () {
visible.value = true;
});
return instance;
}
function ActionSheet(props) {
create(props);
}
ActionSheet.close = function (trigger) {
if (instance) {
instance.clear(trigger);
}
};
ActionSheet.show = function (props) {
create(props);
};
ActionSheet.install = function (app2) {
var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
app2.component(name || ActionSheetVue.name, ActionSheetVue);
};
var _ActionSheet = ActionSheet;
export { _ActionSheet, _ActionSheet as default };
//# sourceMappingURL=index.js.map