tdesign-mobile-vue
Version:
tdesign-mobile-vue
110 lines (106 loc) • 4.47 kB
JavaScript
/**
* tdesign v1.7.0
* (c) 2024 TDesign Group
* @license MIT
*/
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
import { defineComponent, ref, provide, createVNode } from 'vue';
import config from '../config.js';
import props from './props.js';
import '../shared/index.js';
import { useTNodeJSX } from '../hooks/tnode.js';
import { usePrefixClass } from '../hooks/useClass.js';
import { useDefault } from '../shared/useDefault/index.js';
import '../shared/functions.js';
import '../shared/util.js';
import 'lodash/isNumber';
import '../shared/component.js';
import '../shared/constants.js';
import '../shared/render.js';
import '@babel/runtime/helpers/typeof';
import 'lodash/camelCase';
import '../shared/dom.js';
import 'lodash/isFunction';
import 'lodash/isString';
import '../shared/render-tnode.js';
import '../shared/useToggle/index.js';
import '../shared/useCountDown/index.js';
import '@babel/runtime/helpers/asyncToGenerator';
import '@babel/runtime/regenerator';
import '@vueuse/core';
import '../shared/useCountDown/utils.js';
import '../shared/useChildSlots/index.js';
import '@babel/runtime/helpers/toConsumableArray';
import '../shared/useVModel/index.js';
import 'lodash/kebabCase';
import '../shared/useTouch/index.js';
import '../shared/useScrollParent/index.js';
import '../shared/useExpose/index.js';
import '../shared/useTest/index.js';
import '../shared/useClickAway/index.js';
import 'lodash/isArray';
import '../shared/useGesture/index.js';
import '@use-gesture/vanilla';
import '../shared/hover.js';
import '../hooks/render-tnode.js';
import 'lodash/isEmpty';
import 'lodash/isObject';
import '../config-provider/useConfig.js';
import 'lodash/cloneDeep';
import '../config-provider/context.js';
import 'lodash/mergeWith';
import 'lodash/merge';
import '../_common/js/global-config/mobile/default-config.js';
import '../_common/js/global-config/mobile/locale/zh_CN.js';
import '../_chunks/dep-6c582337.js';
import '../_chunks/dep-38637d40.js';
import 'dayjs';
import '../_chunks/dep-959cdc59.js';
import '../config-provider/type.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 prefix = config.prefix;
var _SideBar = defineComponent({
name: "".concat(prefix, "-side-bar"),
props: props,
emits: ["update:value", "update:modelValue", "change"],
setup: function setup(props2, context) {
var renderTNodeJSX = useTNodeJSX();
var sideBarClass = usePrefixClass("side-bar");
var _useDefault = useDefault(props2, context.emit, "value", "change"),
_useDefault2 = _slicedToArray(_useDefault, 2),
currentValue = _useDefault2[0],
setCurrentValue = _useDefault2[1];
var children = ref([]);
var relation = function relation(child) {
child && children.value.push(child);
};
var removeRelation = function removeRelation(child) {
children.value = children.value.filter(function (item) {
return item !== child;
});
};
var onClickItem = function onClickItem(cur, label) {
var _props2$onClick;
setCurrentValue(cur);
(_props2$onClick = props2.onClick) === null || _props2$onClick === void 0 || _props2$onClick.call(props2, cur, label);
};
provide("sideBarProvide", _objectSpread(_objectSpread({}, props2), {}, {
children: children,
currentValue: currentValue,
relation: relation,
removeRelation: removeRelation,
onClickItem: onClickItem
}));
return function () {
return createVNode("div", {
"class": "".concat(sideBarClass.value)
}, [renderTNodeJSX("default"), createVNode("div", {
"class": "".concat(sideBarClass.value, "__padding")
}, null)]);
};
}
});
export { _SideBar as default };
//# sourceMappingURL=side-bar.js.map