UNPKG

tdesign-mobile-vue

Version:
101 lines (97 loc) 4.06 kB
/** * tdesign v1.7.0 * (c) 2024 TDesign Group * @license MIT */ import { _ as _defineProperty } from '../../_chunks/dep-219bb5a7.mjs'; import { _ as _typeof } from '../../_chunks/dep-620d73f7.mjs'; import { toRefs, ref, watch, onMounted } from 'vue'; import '../../shared/index.mjs'; import { useChildSlots } from '../../shared/useChildSlots/index.mjs'; import '../../shared/functions.mjs'; import '../../shared/util.mjs'; import '../../_chunks/dep-cd74809c.mjs'; import '../../_chunks/dep-8d37dbf8.mjs'; import '../../_chunks/dep-52fdc8e1.mjs'; import '../../_chunks/dep-8bf3054e.mjs'; import '../../_chunks/dep-3d249f65.mjs'; import '../../_chunks/dep-9b2de386.mjs'; import '../../config.mjs'; import '../../shared/component.mjs'; import '../../shared/constants.mjs'; import '../../shared/render.mjs'; import '../../_chunks/dep-60cadef8.mjs'; import '../../_chunks/dep-8140c29b.mjs'; import '../../_chunks/dep-0d52e58f.mjs'; import '../../_chunks/dep-019e292f.mjs'; import '../../_chunks/dep-32364550.mjs'; import '../../_chunks/dep-a836a38c.mjs'; import '../../_chunks/dep-0ea7bbde.mjs'; import '../../_chunks/dep-b437ef0b.mjs'; import '../../shared/dom.mjs'; import '../../_chunks/dep-91d696ea.mjs'; import '../../_chunks/dep-e6c129ab.mjs'; import '../../_chunks/dep-6303c50c.mjs'; import '../../shared/render-tnode.mjs'; import '../../shared/useToggle/index.mjs'; import '../../shared/useCountDown/index.mjs'; import '../../_chunks/dep-80e4de18.mjs'; import '@vueuse/core'; import '../../shared/useCountDown/utils.mjs'; import '../../shared/useDefault/index.mjs'; import '../../shared/useVModel/index.mjs'; import '../../_chunks/dep-6917b9bc.mjs'; import '../../shared/useTouch/index.mjs'; import '../../shared/useScrollParent/index.mjs'; import '../../shared/useExpose/index.mjs'; import '../../shared/useTest/index.mjs'; import '../../shared/useClickAway/index.mjs'; import '../../_chunks/dep-f0f403be.mjs'; import '../../shared/useGesture/index.mjs'; import '@use-gesture/vanilla'; import '../../shared/hover.mjs'; 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 getOptionListBySlots = function getOptionListBySlots(nodes) { var arr = []; nodes === null || nodes === void 0 || nodes.forEach(function (node) { var option = node.props; if ((option === null || option === void 0 ? void 0 : option["check-all"]) === "" || (option === null || option === void 0 ? void 0 : option["check-all"]) === true) { option.checkAll = true; } option && arr.push(option); }); return arr; }; var getOptions = function getOptions(props, slots) { var _toRefs = toRefs(props), options = _toRefs.options; var optionList = ref([]); watch(options, function (options2) { if (!options2) return []; optionList.value = options2.map(function (item) { var r = {}; if (_typeof(item) !== "object") { r = { label: String(item), value: item }; } else { r = _objectSpread({}, item); r.disabled = r.disabled === void 0 ? props.disabled : r.disabled; } return r; }); }, { immediate: true }); onMounted(function () { var nodes = slots.default && slots.default(); if (nodes !== void 0) { optionList.value = getOptionListBySlots(useChildSlots("t-checkbox")); } }); return optionList; }; export { getOptionListBySlots, getOptions }; //# sourceMappingURL=getOptions.mjs.map