vue-devui 1.0.0-rc.3 → 1.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/vue-devui.es.js CHANGED
@@ -206,13 +206,13 @@ var AlertInstall = {
206
206
  app.component(Alert.name, Alert);
207
207
  }
208
208
  };
209
- const defaultFormatter = (item2) => {
210
- if (typeof item2 === "string") {
211
- return item2;
209
+ const defaultFormatter = (item) => {
210
+ if (typeof item === "string") {
211
+ return item;
212
212
  }
213
- return item2 !== null ? item2.label || item2.toString() : "";
213
+ return item !== null ? item.label || item.toString() : "";
214
214
  };
215
- const defaultValueParse = (item2) => item2;
215
+ const defaultValueParse = (item) => item;
216
216
  const autoCompleteProps = {
217
217
  modelValue: {
218
218
  type: String,
@@ -305,8 +305,8 @@ const autoCompleteProps = {
305
305
  };
306
306
  const DropdownPropsKey = Symbol("DropdownPropsKey");
307
307
  function useCustomTemplate(ctx2, modelValue) {
308
- const itemTemplate = (item2, index) => {
309
- const arr = { item: item2, index };
308
+ const itemTemplate = (item, index) => {
309
+ const arr = { item, index };
310
310
  if (ctx2.slots.item) {
311
311
  return ctx2.slots.item(arr);
312
312
  }
@@ -344,11 +344,11 @@ function useSearchFn(ctx2, allowEmptyValueSearch, source, searchFn, formatter) {
344
344
  const showNoResultItemTemplate = ref(false);
345
345
  const defaultSearchFn = (term) => {
346
346
  const arr = [];
347
- source.value.forEach((item2) => {
348
- let cur = formatter.value(item2);
347
+ source.value.forEach((item) => {
348
+ let cur = formatter.value(item);
349
349
  cur = cur.toLowerCase();
350
350
  if (cur.startsWith(term)) {
351
- arr.push(item2);
351
+ arr.push(item);
352
352
  }
353
353
  });
354
354
  return arr;
@@ -455,21 +455,21 @@ function useSelectHandle(ctx2, searchList, selectValue, handleSearch, formatter,
455
455
  return 0;
456
456
  }
457
457
  let ind = 0;
458
- searchList.value.forEach((item2, index) => {
459
- if (typeof item2 === "string") {
460
- if (item2 === cur) {
458
+ searchList.value.forEach((item, index) => {
459
+ if (typeof item === "string") {
460
+ if (item === cur) {
461
461
  ind = index;
462
462
  }
463
463
  } else {
464
- if (String(item2.label) === cur) {
464
+ if (String(item.label) === cur) {
465
465
  ind = index;
466
466
  }
467
467
  }
468
468
  });
469
469
  return ind === -1 ? 0 : ind;
470
470
  };
471
- const selectOptionClick = async (item2) => {
472
- const cur = formatter.value(item2);
471
+ const selectOptionClick = async (item) => {
472
+ const cur = formatter.value(item);
473
473
  ctx2.emit("update:modelValue", cur);
474
474
  handleClose();
475
475
  await handleSearch(cur);
@@ -561,14 +561,13 @@ function useKeyBoardHandle(dropDownRef, visible, searchList, selectedIndex, sear
561
561
  handlekeyDown
562
562
  };
563
563
  }
564
- var autoComplete = "";
565
564
  class View {
566
565
  constructor() {
567
566
  __publicField(this, "top", "50%");
568
567
  __publicField(this, "left", "50%");
569
568
  }
570
569
  }
571
- const componentProps = {
570
+ const loadingProps = {
572
571
  message: String,
573
572
  backdrop: Boolean,
574
573
  view: {
@@ -581,7 +580,7 @@ const componentProps = {
581
580
  default: false
582
581
  }
583
582
  };
584
- class LoadingProps {
583
+ class LoadingOptions {
585
584
  constructor() {
586
585
  __publicField(this, "target");
587
586
  __publicField(this, "message");
@@ -596,7 +595,7 @@ var loading$1 = "";
596
595
  var Loading = defineComponent({
597
596
  name: "DLoading",
598
597
  inheritAttrs: false,
599
- props: componentProps,
598
+ props: loadingProps,
600
599
  setup(props) {
601
600
  const style = {
602
601
  top: props.view.top,
@@ -668,14 +667,18 @@ function unmountComponent(ComponnetInstance) {
668
667
  const loadingConstructor$1 = defineComponent(Loading);
669
668
  const cacheInstance = /* @__PURE__ */ new WeakSet();
670
669
  const isEmpty = (val) => {
671
- if (!val)
670
+ if (!val) {
672
671
  return true;
673
- if (Array.isArray(val))
672
+ }
673
+ if (Array.isArray(val)) {
674
674
  return val.length === 0;
675
- if (val instanceof Set || val instanceof Map)
675
+ }
676
+ if (val instanceof Set || val instanceof Map) {
676
677
  return val.size === 0;
677
- if (val instanceof Promise)
678
+ }
679
+ if (val instanceof Promise) {
678
680
  return false;
681
+ }
679
682
  if (typeof val === "object") {
680
683
  try {
681
684
  return Object.keys(val).length === 0;
@@ -709,11 +712,13 @@ const unmount = (el) => {
709
712
  unmountComponent(el.instance);
710
713
  };
711
714
  const toggleLoading = (el, binding) => {
715
+ var _a, _b, _c;
712
716
  if (binding.value) {
713
717
  const vals = isPromise(binding.value);
714
- if (vals === "error")
718
+ if (vals === "error") {
715
719
  return;
716
- el.instance.proxy.open();
720
+ }
721
+ (_c = (_b = (_a = el == null ? void 0 : el.instance) == null ? void 0 : _a.proxy) == null ? void 0 : _b.open) == null ? void 0 : _c.call(_b);
717
722
  el.appendChild(el.mask);
718
723
  cacheInstance.add(el);
719
724
  if (vals) {
@@ -737,7 +742,7 @@ const removeAttribute = (el) => {
737
742
  };
738
743
  const handleProps = (el, vprops) => {
739
744
  var _a;
740
- const props = __spreadValues(__spreadValues({}, new LoadingProps()), vprops);
745
+ const props = __spreadValues(__spreadValues({}, new LoadingOptions()), vprops);
741
746
  const loadingTemplateRef = props.loadingTemplateRef;
742
747
  const loadingInstance = createComponent$1(loadingConstructor$1, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
743
748
  el.style.position = props.positionType;
@@ -752,8 +757,9 @@ const loadingDirective = {
752
757
  !isEmpty(binding.value) && toggleLoading(el, binding);
753
758
  },
754
759
  updated: function(el, binding, vnode) {
755
- if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el))
760
+ if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el)) {
756
761
  return;
762
+ }
757
763
  !cacheInstance.has(el) && handleProps(el, vnode.props);
758
764
  removeAttribute(el);
759
765
  toggleLoading(el, binding);
@@ -788,12 +794,12 @@ var DAutoCompleteDropdown = defineComponent({
788
794
  disabledKey,
789
795
  isSearching
790
796
  } = propsData.props;
791
- const onSelect = (item2) => {
792
- item2 = valueParser.value(item2);
793
- if (typeof item2 === "object" && item2[disabledKey]) {
797
+ const onSelect = (item) => {
798
+ item = valueParser.value(item);
799
+ if (typeof item === "object" && item[disabledKey]) {
794
800
  return;
795
801
  }
796
- selectOptionClick(item2);
802
+ selectOptionClick(item);
797
803
  };
798
804
  return () => {
799
805
  return withDirectives(createVNode("div", {
@@ -811,17 +817,17 @@ var DAutoCompleteDropdown = defineComponent({
811
817
  "class": "devui-no-data-tip"
812
818
  }, [ctx2.slots.searchingTemplate()])]), latestSource.value && !modelValue.value && createVNode("li", {
813
819
  "class": "devui-popup-tips"
814
- }, [createTextVNode("\u6700\u8FD1\u8F93\u5165")]), !showNoResultItemTemplate.value && !(searchStatus == null ? void 0 : searchStatus.value) && searchList != null && searchList.value.length > 0 && searchList.value.map((item2, index) => {
820
+ }, [createTextVNode("\u6700\u8FD1\u8F93\u5165")]), !showNoResultItemTemplate.value && !(searchStatus == null ? void 0 : searchStatus.value) && searchList != null && searchList.value.length > 0 && searchList.value.map((item, index) => {
815
821
  return createVNode("li", {
816
- "onClick": () => onSelect(item2),
822
+ "onClick": () => onSelect(item),
817
823
  "class": ["devui-dropdown-item", selectedIndex.value === index && "selected", {
818
- "disabled": disabledKey && typeof item2 === "object" && item2[disabledKey]
824
+ "disabled": disabledKey && typeof item === "object" && item[disabledKey]
819
825
  }, {
820
826
  "devui-dropdown-bg": hoverIndex.value === index
821
827
  }],
822
- "title": formatter(item2),
823
- "key": formatter(item2)
824
- }, [ctx2.slots.itemTemplate ? ctx2.slots.itemTemplate(item2, index) : formatter(item2)]);
828
+ "title": formatter(item),
829
+ "key": formatter(item)
830
+ }, [ctx2.slots.itemTemplate ? ctx2.slots.itemTemplate(item, index) : formatter(item)]);
825
831
  }), !(searchStatus == null ? void 0 : searchStatus.value) && searchList.value.length === 0 && ctx2.slots.noResultItemTemplate && showNoResultItemTemplate.value && createVNode("li", {
826
832
  "class": "devui-no-result-template"
827
833
  }, [createVNode("div", {
@@ -1048,6 +1054,7 @@ const FlexibleOverlay = defineComponent({
1048
1054
  };
1049
1055
  }
1050
1056
  });
1057
+ var autoComplete = "";
1051
1058
  function _isSlot$3(s) {
1052
1059
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
1053
1060
  }
@@ -1705,7 +1712,7 @@ var button = "";
1705
1712
  var Button = defineComponent({
1706
1713
  name: "DButton",
1707
1714
  directives: {
1708
- devLoading: loadingDirective
1715
+ dLoading: loadingDirective
1709
1716
  },
1710
1717
  props: buttonProps,
1711
1718
  emits: ["click"],
@@ -2070,13 +2077,13 @@ var CheckboxGroup = defineComponent({
2070
2077
  const toggleGroupVal = (val) => {
2071
2078
  let index = -1;
2072
2079
  if (typeof valList.value[0] === "string") {
2073
- index = valList.value.findIndex((item2) => item2 === val);
2080
+ index = valList.value.findIndex((item) => item === val);
2074
2081
  } else if (typeof valList.value[0] === "object") {
2075
- index = valList.value.findIndex((item2) => item2.value === val);
2082
+ index = valList.value.findIndex((item) => item.value === val);
2076
2083
  }
2077
2084
  if (index === -1) {
2078
2085
  if (typeof props.options[0] === "object") {
2079
- const newOne = props.options.find((item2) => item2.value === val);
2086
+ const newOne = props.options.find((item) => item.value === val);
2080
2087
  const res2 = [...valList.value, newOne];
2081
2088
  ctx2.emit("update:modelValue", res2);
2082
2089
  ctx2.emit("change", res2);
@@ -2095,7 +2102,7 @@ var CheckboxGroup = defineComponent({
2095
2102
  if (typeof valList.value[0] === "string") {
2096
2103
  return valList.value.includes(itemVal);
2097
2104
  } else if (typeof valList.value[0] === "object") {
2098
- return valList.value.some((item2) => item2.value === itemVal);
2105
+ return valList.value.some((item) => item.value === itemVal);
2099
2106
  }
2100
2107
  };
2101
2108
  provide(checkboxGroupInjectionKey, {
@@ -2210,9 +2217,10 @@ var Comment = defineComponent({
2210
2217
  "src": avatar2,
2211
2218
  "alt": "comment-avatar"
2212
2219
  }, null) : avatar2]);
2220
+ const actionsList = Array.isArray(actions) ? actions : [actions];
2213
2221
  const actionDom = actions ? createVNode("ul", {
2214
2222
  "class": `devui-comment-actions`
2215
- }, [getAction(Array.isArray(actions) ? actions : [actions])]) : null;
2223
+ }, [getAction(actionsList)]) : null;
2216
2224
  return createVNode("div", {
2217
2225
  "class": "devui-comment"
2218
2226
  }, [avatarDom, createVNode("div", {
@@ -2935,7 +2943,7 @@ function useSize(colSizes) {
2935
2943
  total = `${setSpace(total)}${CLASS_PREFIX$1}-${key}-span-${colSizes[key]}`;
2936
2944
  } else if (valueType === "object") {
2937
2945
  const colSizesKeys = Object.keys(colSizes[key]);
2938
- const sum = colSizesKeys.filter((item2) => item2 in colPropsBaseClass).reduce((tot, k) => {
2946
+ const sum = colSizesKeys.filter((item) => item in colPropsBaseClass).reduce((tot, k) => {
2939
2947
  if (typeof colSizes[key][k] !== "number") {
2940
2948
  return "";
2941
2949
  } else {
@@ -3528,7 +3536,7 @@ function unmountedPreviewImages() {
3528
3536
  ImagePreviewService.close();
3529
3537
  }
3530
3538
  function getImgByEl(el) {
3531
- const urlList = [...el.querySelectorAll("img")].map((item2) => item2.getAttribute("src"));
3539
+ const urlList = [...el.querySelectorAll("img")].map((item) => item.getAttribute("src"));
3532
3540
  return urlList;
3533
3541
  }
3534
3542
  function handleImg(e) {
@@ -3801,7 +3809,7 @@ var Layout = defineComponent({
3801
3809
  return () => {
3802
3810
  var _a;
3803
3811
  const slotDefault = (_a = slots.default) == null ? void 0 : _a.call(slots);
3804
- const isAside = slotDefault.some((item2) => item2.name === "DAside");
3812
+ const isAside = slotDefault.some((item) => item.name === "DAside");
3805
3813
  const classNames = `${isAside ? "devui-layout-aside " : ""}devui-layout`;
3806
3814
  return createVNode("div", {
3807
3815
  "class": classNames
@@ -3858,7 +3866,9 @@ var Aside = defineComponent({
3858
3866
  }) {
3859
3867
  return () => {
3860
3868
  var _a;
3861
- return createVNode("div", null, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
3869
+ return createVNode("div", {
3870
+ "class": "devui-aside"
3871
+ }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
3862
3872
  };
3863
3873
  }
3864
3874
  });
@@ -3887,7 +3897,7 @@ const loading = {
3887
3897
  parent.style.position = options.positionType;
3888
3898
  }
3889
3899
  const isFull = document.body === parent;
3890
- options = __spreadValues(__spreadValues({}, new LoadingProps()), options);
3900
+ options = __spreadValues(__spreadValues({}, new LoadingOptions()), options);
3891
3901
  const instance = createComponent$1(loadingConstructor, __spreadProps(__spreadValues({}, options), {
3892
3902
  isFull
3893
3903
  }), options.loadingTemplateRef ? () => options.loadingTemplateRef : null);
@@ -4307,6 +4317,105 @@ var Close = defineComponent({
4307
4317
  }, null)]);
4308
4318
  }
4309
4319
  });
4320
+ function SuccessIcon$1() {
4321
+ return createVNode("svg", {
4322
+ "width": "16px",
4323
+ "height": "16px",
4324
+ "viewBox": "0 0 16 16",
4325
+ "version": "1.1",
4326
+ "xmlns": "http://www.w3.org/2000/svg",
4327
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
4328
+ }, [createVNode("defs", null, [createVNode("polygon", {
4329
+ "id": "path-s",
4330
+ "points": "6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"
4331
+ }, null)]), createVNode("g", {
4332
+ "id": "correct",
4333
+ "stroke": "none",
4334
+ "stroke-width": "1",
4335
+ "fill": "none",
4336
+ "fill-rule": "evenodd"
4337
+ }, [createVNode("mask", {
4338
+ "id": "mask-2",
4339
+ "fill": "white"
4340
+ }, [createVNode("use", {
4341
+ "xlink:href": "#path-s"
4342
+ }, null)]), createVNode("use", {
4343
+ "id": "Mask",
4344
+ "class": "devui-notification-image-success-path",
4345
+ "xlink:href": "#path-s"
4346
+ }, null)])]);
4347
+ }
4348
+ function WarningIcon$1() {
4349
+ return createVNode("svg", {
4350
+ "width": "16px",
4351
+ "height": "16px",
4352
+ "viewBox": "0 0 16 16",
4353
+ "version": "1.1",
4354
+ "xmlns": "http://www.w3.org/2000/svg",
4355
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
4356
+ }, [createVNode("g", {
4357
+ "stroke": "none",
4358
+ "stroke-width": "1",
4359
+ "fill": "none",
4360
+ "fill-rule": "evenodd"
4361
+ }, [createVNode("path", {
4362
+ "class": "devui-icon-warning-outer",
4363
+ "d": "M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"
4364
+ }, null), createVNode("path", {
4365
+ "class": "devui-icon-warning-inner",
4366
+ "stroke-width": "0.3",
4367
+ "fill-rule": "nonzero",
4368
+ "d": "M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"
4369
+ }, null)])]);
4370
+ }
4371
+ function InfoIcon$1() {
4372
+ return createVNode("svg", {
4373
+ "width": "16px",
4374
+ "height": "16px",
4375
+ "viewBox": "0 0 16 16",
4376
+ "version": "1.1",
4377
+ "xmlns": "http://www.w3.org/2000/svg",
4378
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
4379
+ }, [createVNode("g", {
4380
+ "id": "info",
4381
+ "stroke": "none",
4382
+ "stroke-width": "1",
4383
+ "fill": "none",
4384
+ "fill-rule": "evenodd"
4385
+ }, [createVNode("path", {
4386
+ "class": "devui-notification-image-info-path",
4387
+ "d": "M7,13 L7,6 L9,6 L9,13 L7,13 Z M7,5 L7,3 L9,3 L9,5 L7,5 Z",
4388
+ "id": "info"
4389
+ }, null)])]);
4390
+ }
4391
+ function ErrorIcon$1() {
4392
+ return createVNode("svg", {
4393
+ "width": "16px",
4394
+ "height": "16px",
4395
+ "viewBox": "0 0 16 16",
4396
+ "version": "1.1",
4397
+ "xmlns": "http://www.w3.org/2000/svg",
4398
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
4399
+ }, [createVNode("defs", null, [createVNode("polygon", {
4400
+ "id": "path-e",
4401
+ "points": "8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"
4402
+ }, null)]), createVNode("g", {
4403
+ "id": "error",
4404
+ "stroke": "none",
4405
+ "stroke-width": "1",
4406
+ "fill": "none",
4407
+ "fill-rule": "evenodd"
4408
+ }, [createVNode("mask", {
4409
+ "id": "mask-2",
4410
+ "fill": "white"
4411
+ }, [createVNode("use", {
4412
+ "xlink:href": "#path-e"
4413
+ }, null)]), createVNode("use", {
4414
+ "id": "Mask",
4415
+ "class": "devui-notification-image-error-path",
4416
+ "xlink:href": "#path-e"
4417
+ }, null)])]);
4418
+ }
4310
4419
  var TypeIcon = defineComponent({
4311
4420
  props: {
4312
4421
  type: {
@@ -4322,18 +4431,9 @@ var TypeIcon = defineComponent({
4322
4431
  "devui-notification-image": true,
4323
4432
  [`devui-notification-image-${type.value}`]: true
4324
4433
  }));
4325
- const severityIconMap = {
4326
- info: "info-o",
4327
- success: "right-o",
4328
- warning: "warning-o",
4329
- error: "error-o"
4330
- };
4331
4434
  return () => createVNode("span", {
4332
4435
  "class": classes.value
4333
- }, [type.value !== "normal" && createVNode(DIcon, {
4334
- "name": severityIconMap[type.value],
4335
- "size": "16px"
4336
- }, null)]);
4436
+ }, [type.value && type.value !== "normal" && (type.value === "success" && createVNode(SuccessIcon$1, null, null) || type.value === "info" && createVNode(InfoIcon$1, null, null) || type.value === "warning" && createVNode(WarningIcon$1, null, null) || type.value === "error" && createVNode(ErrorIcon$1, null, null))]);
4337
4437
  }
4338
4438
  });
4339
4439
  function useNotification(props) {
@@ -11296,12 +11396,12 @@ var RadioGroup = defineComponent({
11296
11396
  if (defaultSlot) {
11297
11397
  return defaultSlot();
11298
11398
  } else if (Array.isArray(values)) {
11299
- return values.map((item2) => {
11399
+ return values.map((item) => {
11300
11400
  return createVNode(Radio, {
11301
- "key": item2,
11302
- "value": item2
11303
- }, _isSlot(item2) ? item2 : {
11304
- default: () => [item2]
11401
+ "key": item,
11402
+ "value": item
11403
+ }, _isSlot(item) ? item : {
11404
+ default: () => [item]
11305
11405
  });
11306
11406
  });
11307
11407
  } else {
@@ -11463,7 +11563,7 @@ var Rate = defineComponent({
11463
11563
  return createVNode("div", {
11464
11564
  "class": "devui-star-container",
11465
11565
  "onMouseleave": (e) => hoverToggle(e, chooseValue, true)
11466
- }, [totalLevelArray.map((item2, index) => createVNode("div", {
11566
+ }, [totalLevelArray.map((item, index) => createVNode("div", {
11467
11567
  "class": `devui-star-align devui-pointer ${read ? "devui-only-read" : ""}`,
11468
11568
  "key": index,
11469
11569
  "onMouseover": (e) => hoverToggle(e, index),
@@ -11496,7 +11596,7 @@ var Rate = defineComponent({
11496
11596
  }, null)])])])]), icon && !character && createVNode("span", {
11497
11597
  "class": `devui-star-color-active devui-active-star devui-star-color-${type}`,
11498
11598
  "style": {
11499
- width: item2.width
11599
+ width: item.width
11500
11600
  }
11501
11601
  }, [createVNode(resolveComponent("d-icon"), {
11502
11602
  "name": icon,
@@ -11505,13 +11605,13 @@ var Rate = defineComponent({
11505
11605
  "class": `devui-star-color-active devui-active-star devui-star-color-${type}`,
11506
11606
  "style": {
11507
11607
  color,
11508
- width: item2.width
11608
+ width: item.width
11509
11609
  }
11510
11610
  }, [character]), !character && !icon && createVNode("span", {
11511
11611
  "class": `devui-star-color-active devui-active-star devui-star-color-${type}`,
11512
11612
  "style": {
11513
11613
  color,
11514
- width: item2.width
11614
+ width: item.width
11515
11615
  }
11516
11616
  }, [createVNode("svg", {
11517
11617
  "width": "16px",
@@ -11576,7 +11676,8 @@ var TipsTemplate = defineComponent({
11576
11676
  return deviationConstant;
11577
11677
  };
11578
11678
  onMounted(() => {
11579
- const domBounding = document.querySelector(query).getBoundingClientRect();
11679
+ var _a, _b;
11680
+ const domBounding = (_a = document.querySelector(query)) == null ? void 0 : _a.getBoundingClientRect();
11580
11681
  const {
11581
11682
  width,
11582
11683
  height
@@ -11586,7 +11687,7 @@ var TipsTemplate = defineComponent({
11586
11687
  const heightDeviation = deviation(height);
11587
11688
  const widthDeviation = deviation(width);
11588
11689
  let positionLeft = 0;
11589
- const targetDom = document.querySelector(".read-tip-container").getBoundingClientRect();
11690
+ const targetDom = (_b = document.querySelector(".read-tip-container")) == null ? void 0 : _b.getBoundingClientRect();
11590
11691
  if (rule.appendToBody) {
11591
11692
  positionTop = domBounding.y + document.documentElement.scrollTop;
11592
11693
  positionLeft = domBounding.x;
@@ -11615,14 +11716,14 @@ var TipsTemplate = defineComponent({
11615
11716
  "to": rule.appendToBody ? "body" : query
11616
11717
  }, {
11617
11718
  default: () => {
11618
- var _a;
11719
+ var _a, _b;
11619
11720
  return [createVNode("div", {
11620
11721
  "ref": temp,
11621
11722
  "class": ["read-tip-container", rule.position, rule.overlayClassName],
11622
11723
  "style": styles
11623
11724
  }, [createVNode("span", {
11624
11725
  "class": "after"
11625
- }, null), rule.contentTemplate ? (_a = ctx2.slots) == null ? void 0 : _a.default() : createVNode(Fragment, null, [createVNode("div", {
11726
+ }, null), rule.contentTemplate ? (_b = (_a = ctx2.slots) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a) : createVNode(Fragment, null, [createVNode("div", {
11626
11727
  "class": "title"
11627
11728
  }, [rule.title]), createVNode("div", {
11628
11729
  "class": "content"
@@ -11632,6 +11733,19 @@ var TipsTemplate = defineComponent({
11632
11733
  };
11633
11734
  }
11634
11735
  });
11736
+ const rules = (ruleList) => {
11737
+ if (ruleList === null) {
11738
+ return [];
11739
+ }
11740
+ if (typeof ruleList === "object" && !Array.isArray(ruleList)) {
11741
+ ruleList = [ruleList];
11742
+ }
11743
+ ruleList = [...ruleList];
11744
+ Array.isArray(ruleList) && ruleList.map((rule) => {
11745
+ rule.status = false;
11746
+ });
11747
+ return ruleList;
11748
+ };
11635
11749
  var ReadTip = defineComponent({
11636
11750
  name: "DReadTip",
11637
11751
  props: readTipProps,
@@ -11651,6 +11765,7 @@ var ReadTip = defineComponent({
11651
11765
  };
11652
11766
  const options = __spreadValues(__spreadValues({}, defaultOptions2), props.readTipOptions);
11653
11767
  const defaultSlot = ref(null);
11768
+ const refRules = reactive(rules(options.rules));
11654
11769
  const onMouseenter = (rule) => () => {
11655
11770
  setTimeout(() => {
11656
11771
  if (rule.id) {
@@ -11669,8 +11784,9 @@ var ReadTip = defineComponent({
11669
11784
  rule.status = false;
11670
11785
  }, rule.mouseleaveTime || options.mouseleaveTime);
11671
11786
  };
11672
- const init = (rules2, trigger = "hover") => {
11673
- rules2.map((rule) => {
11787
+ const init = (ruleList, trigger = "hover") => {
11788
+ ruleList.map((rule) => {
11789
+ var _a;
11674
11790
  rule.status = false;
11675
11791
  trigger = rule.trigger || trigger;
11676
11792
  rule.overlayClassName = rule.overlayClassName || options.overlayClassName;
@@ -11679,7 +11795,7 @@ var ReadTip = defineComponent({
11679
11795
  if (!("appendToBody" in rule)) {
11680
11796
  rule.appendToBody = options.appendToBody;
11681
11797
  }
11682
- const doms = defaultSlot.value.querySelectorAll(rule.selector);
11798
+ const doms = (_a = defaultSlot.value) == null ? void 0 : _a.querySelectorAll(rule.selector);
11683
11799
  [...doms].map((dom, index) => {
11684
11800
  if (rule.appendToBody === false) {
11685
11801
  dom.style.position = "relative";
@@ -11692,7 +11808,7 @@ var ReadTip = defineComponent({
11692
11808
  newRule = __spreadValues({}, rule);
11693
11809
  dom.id = id;
11694
11810
  newRule.id = id;
11695
- rules2.push(newRule);
11811
+ ruleList.push(newRule);
11696
11812
  }
11697
11813
  if (trigger === "hover") {
11698
11814
  dom.addEventListener("mouseenter", onMouseenter(newRule.id ? newRule : rule));
@@ -11700,25 +11816,11 @@ var ReadTip = defineComponent({
11700
11816
  }
11701
11817
  });
11702
11818
  });
11703
- return rules2;
11819
+ return ruleList;
11704
11820
  };
11705
- function show(dom, rule) {
11821
+ function show(_, rule) {
11706
11822
  rule.status = true;
11707
11823
  }
11708
- const rules = (rules2) => {
11709
- if (rules2 === null) {
11710
- return;
11711
- }
11712
- if (typeof rules2 === "object" && !Array.isArray(rules2)) {
11713
- rules2 = [rules2];
11714
- }
11715
- rules2 = [...rules2];
11716
- Array.isArray(rules2) && rules2.map((rule) => {
11717
- rule.status = false;
11718
- });
11719
- return rules2;
11720
- };
11721
- const refRules = reactive(rules(options.rules));
11722
11824
  const clickFn = () => {
11723
11825
  refRules.forEach((element) => {
11724
11826
  element.status = false;
@@ -11732,8 +11834,9 @@ var ReadTip = defineComponent({
11732
11834
  document.removeEventListener("click", clickFn);
11733
11835
  });
11734
11836
  const onClick = (e) => {
11837
+ var _a;
11735
11838
  for (const rule of refRules) {
11736
- const doms = defaultSlot.value.querySelectorAll(rule.selector);
11839
+ const doms = (_a = defaultSlot.value) == null ? void 0 : _a.querySelectorAll(rule.selector);
11737
11840
  for (const dom of doms) {
11738
11841
  if (doms.length > 1) {
11739
11842
  if (dom === e.target && rule.id) {
@@ -11753,20 +11856,20 @@ var ReadTip = defineComponent({
11753
11856
  }
11754
11857
  };
11755
11858
  return () => {
11756
- var _a;
11859
+ var _a, _b;
11757
11860
  return createVNode("div", {
11758
11861
  "class": "devui-read-tip"
11759
11862
  }, [createVNode("div", {
11760
11863
  "ref": defaultSlot,
11761
11864
  "onClick": onClick
11762
- }, [(_a = ctx2.slots) == null ? void 0 : _a.default()]), refRules.map((rule) => createVNode("div", {
11865
+ }, [(_b = (_a = ctx2.slots) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a)]), refRules.map((rule) => createVNode("div", {
11763
11866
  "data-test": "todo"
11764
11867
  }, [rule.status && createVNode(TipsTemplate, {
11765
11868
  "defaultTemplateProps": __spreadValues({}, rule)
11766
11869
  }, {
11767
11870
  default: () => {
11768
- var _a2;
11769
- return [rule.contentTemplate && ((_a2 = ctx2.slots) == null ? void 0 : _a2.contentTemplate())];
11871
+ var _a2, _b2;
11872
+ return [rule.contentTemplate && ((_b2 = (_a2 = ctx2.slots) == null ? void 0 : _a2.contentTemplate) == null ? void 0 : _b2.call(_a2))];
11770
11873
  }
11771
11874
  })]))]);
11772
11875
  };
@@ -12182,7 +12285,6 @@ var SearchInstall = {
12182
12285
  app.component(Search.name, Search);
12183
12286
  }
12184
12287
  };
12185
- var skeleton = "";
12186
12288
  const skeletonProps = {
12187
12289
  row: {
12188
12290
  type: Number,
@@ -12229,6 +12331,7 @@ const skeletonProps = {
12229
12331
  default: ["100%"]
12230
12332
  }
12231
12333
  };
12334
+ var skeleton = "";
12232
12335
  var Skeleton = defineComponent({
12233
12336
  name: "DSkeleton",
12234
12337
  props: skeletonProps,
@@ -12285,10 +12388,10 @@ var Skeleton = defineComponent({
12285
12388
  })();
12286
12389
  return withDirectives(createVNode("div", {
12287
12390
  "class": "devui-skeleton__paragraph"
12288
- }, [arr.map((item2) => {
12391
+ }, [arr.map((item) => {
12289
12392
  return createVNode("div", {
12290
12393
  "class": "devui-skeleton__item",
12291
- "style": round ? "border-radius: 1em;" : `width: ${item2.width}`
12394
+ "style": round ? "border-radius: 1em;" : `width: ${item.width}`
12292
12395
  }, null);
12293
12396
  })]), [[vShow, isShown]]);
12294
12397
  }
@@ -12344,7 +12447,6 @@ var Skeleton = defineComponent({
12344
12447
  };
12345
12448
  }
12346
12449
  });
12347
- var item = "";
12348
12450
  const itemProps = {
12349
12451
  row: {
12350
12452
  type: Number,
@@ -12378,6 +12480,7 @@ const itemProps = {
12378
12480
  type: String
12379
12481
  }
12380
12482
  };
12483
+ var skeletonItem = "";
12381
12484
  var SkeletonItem = defineComponent({
12382
12485
  name: "DSkeletonItem",
12383
12486
  props: itemProps,
@@ -12431,10 +12534,10 @@ var SkeletonItem = defineComponent({
12431
12534
  })();
12432
12535
  return createVNode("div", mergeProps({
12433
12536
  "class": `devui-skeleton__shape__paragraph ${renderAnimate(props.animate)}`
12434
- }, ctx2.attrs), [arr.map((item2) => {
12537
+ }, ctx2.attrs), [arr.map((item) => {
12435
12538
  return createVNode("div", {
12436
12539
  "class": "devui-skeleton__shape__paragraph__item",
12437
- "style": round ? "border-radius: 1em;" : `width: ${item2.width}`
12540
+ "style": round ? "border-radius: 1em;" : `width: ${item.width}`
12438
12541
  }, null);
12439
12542
  })]);
12440
12543
  }
@@ -12658,9 +12761,6 @@ var Slider = defineComponent({
12658
12761
  }, [props.max]), renderShowInput()]);
12659
12762
  }
12660
12763
  });
12661
- Slider.install = function(app) {
12662
- app.component(Slider.name, Slider);
12663
- };
12664
12764
  var SliderInstall = {
12665
12765
  title: "Slider \u6ED1\u5757",
12666
12766
  category: "\u6570\u636E\u5F55\u5165",
@@ -13761,7 +13861,7 @@ var StatusInstall = {
13761
13861
  const switchProps = {
13762
13862
  size: {
13763
13863
  type: String,
13764
- default: "middle"
13864
+ default: "md"
13765
13865
  },
13766
13866
  color: {
13767
13867
  type: String,
@@ -14083,15 +14183,15 @@ var TagInput = defineComponent({
14083
14183
  tagInputVal.value = v.trim();
14084
14184
  };
14085
14185
  const mergedSuggestions = computed(() => {
14086
- let suggestions = props.suggestionList.map((item2, index) => {
14186
+ let suggestions = props.suggestionList.map((item, index) => {
14087
14187
  return __spreadValues({
14088
14188
  __index: index
14089
- }, item2);
14189
+ }, item);
14090
14190
  });
14091
14191
  if (tagInputVal.value === "") {
14092
14192
  return suggestions;
14093
14193
  }
14094
- return suggestions = props.caseSensitivity ? suggestions.filter((item2) => item2[props.displayProperty].indexOf(tagInputVal.value) !== -1) : suggestions.filter((item2) => item2[props.displayProperty].toLowerCase().indexOf(tagInputVal.value.toLowerCase()) !== -1);
14194
+ return suggestions = props.caseSensitivity ? suggestions.filter((item) => item[props.displayProperty].indexOf(tagInputVal.value) !== -1) : suggestions.filter((item) => item[props.displayProperty].toLowerCase().indexOf(tagInputVal.value.toLowerCase()) !== -1);
14095
14195
  });
14096
14196
  const selectIndex = ref(0);
14097
14197
  watch(mergedSuggestions, () => {
@@ -14119,7 +14219,7 @@ var TagInput = defineComponent({
14119
14219
  if (tagInputVal.value === "" && mergedSuggestions.value.length === 0) {
14120
14220
  return false;
14121
14221
  }
14122
- if (props.tags.findIndex((item2) => item2[props.displayProperty] === tagInputVal.value) > -1) {
14222
+ if (props.tags.findIndex((item) => item[props.displayProperty] === tagInputVal.value) > -1) {
14123
14223
  tagInputVal.value = "";
14124
14224
  return false;
14125
14225
  }
@@ -14268,7 +14368,7 @@ var TagInput = defineComponent({
14268
14368
  "class": "devui-tags-autocomplete devui-dropdown-menu"
14269
14369
  }, [createVNode("ul", {
14270
14370
  "class": "devui-suggestion-list"
14271
- }, [mergedSuggestions.length === 0 ? noDataTpl : mergedSuggestions.map((item2, index) => {
14371
+ }, [mergedSuggestions.length === 0 ? noDataTpl : mergedSuggestions.map((item, index) => {
14272
14372
  return createVNode("li", {
14273
14373
  "class": {
14274
14374
  "devui-suggestion-item": true,
@@ -14277,7 +14377,7 @@ var TagInput = defineComponent({
14277
14377
  "onMousedown": ($event) => {
14278
14378
  onSuggestionItemClick($event, index);
14279
14379
  }
14280
- }, [item2[displayProperty]]);
14380
+ }, [item[displayProperty]]);
14281
14381
  })])])]);
14282
14382
  }
14283
14383
  });
@@ -14509,7 +14609,7 @@ var TimelineItem = defineComponent({
14509
14609
  color: props.dotColor
14510
14610
  },
14511
14611
  "class": `${itemClass}-dot`
14512
- }, [createTextVNode(" "), (_b = (_a = ctx2.slots).dot) == null ? void 0 : _b.call(_a)]);
14612
+ }, [" ", (_b = (_a = ctx2.slots).dot) == null ? void 0 : _b.call(_a)]);
14513
14613
  } else {
14514
14614
  return createVNode("div", {
14515
14615
  "class": `${itemClass}-dot ${itemClass}-type-${props.type}`,
@@ -14578,10 +14678,10 @@ var Timeline = defineComponent({
14578
14678
  setStyle2();
14579
14679
  });
14580
14680
  return () => {
14581
- const renderItemPosition = (item2, position) => {
14582
- return position ? createVNode(item2, {
14681
+ const renderItemPosition = (item, position) => {
14682
+ return position ? createVNode(item, {
14583
14683
  "position": position
14584
- }, null) : createVNode(item2, null, null);
14684
+ }, null) : createVNode(item, null, null);
14585
14685
  };
14586
14686
  const renderItem = () => {
14587
14687
  var _a, _b, _c;
@@ -14592,37 +14692,37 @@ var Timeline = defineComponent({
14592
14692
  } else {
14593
14693
  children = slots;
14594
14694
  }
14595
- return children.map((item2, index) => {
14695
+ return children.map((item, index) => {
14596
14696
  var _a2, _b2, _c2, _d, _e, _f, _g, _h;
14597
14697
  if (index + 1 === children.length) {
14598
- if (!((_a2 = item2.props) == null ? void 0 : _a2.lineStyle) && !((_b2 = item2.props) == null ? void 0 : _b2["line-style"])) {
14599
- item2 = createVNode(item2, {
14698
+ if (!((_a2 = item.props) == null ? void 0 : _a2.lineStyle) && !((_b2 = item.props) == null ? void 0 : _b2["line-style"])) {
14699
+ item = createVNode(item, {
14600
14700
  "line-style": "none"
14601
14701
  }, null);
14602
14702
  }
14603
14703
  }
14604
- if (!((_c2 = item2.props) == null ? void 0 : _c2.timePosition) && !((_d = item2.props) == null ? void 0 : _d["time-position"])) {
14605
- item2 = createVNode(item2, {
14704
+ if (!((_c2 = item.props) == null ? void 0 : _c2.timePosition) && !((_d = item.props) == null ? void 0 : _d["time-position"])) {
14705
+ item = createVNode(item, {
14606
14706
  "time-position": props.timePosition ? props.timePosition : "left"
14607
14707
  }, null);
14608
14708
  }
14609
14709
  if (props.direction === "horizontal") {
14610
- if (((_e = item2.props) == null ? void 0 : _e.position) === "top" || ((_f = item2.props) == null ? void 0 : _f.position) === "bottom") {
14611
- return item2;
14710
+ if (((_e = item.props) == null ? void 0 : _e.position) === "top" || ((_f = item.props) == null ? void 0 : _f.position) === "bottom") {
14711
+ return item;
14612
14712
  }
14613
14713
  if (props.mode === "alternative") {
14614
- return renderItemPosition(item2, index % 2 === 0 ? "bottom" : "top");
14714
+ return renderItemPosition(item, index % 2 === 0 ? "bottom" : "top");
14615
14715
  } else {
14616
- return renderItemPosition(item2, "bottom");
14716
+ return renderItemPosition(item, "bottom");
14617
14717
  }
14618
14718
  } else {
14619
- if (((_g = item2.props) == null ? void 0 : _g.position) === "left" || ((_h = item2.props) == null ? void 0 : _h.position) === "right") {
14620
- return item2;
14719
+ if (((_g = item.props) == null ? void 0 : _g.position) === "left" || ((_h = item.props) == null ? void 0 : _h.position) === "right") {
14720
+ return item;
14621
14721
  }
14622
14722
  if (props.mode === "alternative") {
14623
- return renderItemPosition(item2, index % 2 === 0 ? "left" : "right");
14723
+ return renderItemPosition(item, index % 2 === 0 ? "left" : "right");
14624
14724
  } else {
14625
- return renderItemPosition(item2, "right");
14725
+ return renderItemPosition(item, "right");
14626
14726
  }
14627
14727
  }
14628
14728
  });