fast-element-plus 1.0.2 → 1.0.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.
Files changed (92) hide show
  1. package/dist/index.full.js +159 -104
  2. package/dist/index.full.js.map +1 -1
  3. package/dist/index.full.min.js +1 -1
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +1 -1
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +159 -104
  8. package/dist/index.full.mjs.map +1 -1
  9. package/dist/styles/index.css +1 -1
  10. package/es/components/avatar/src/avatar.d.ts +10 -9
  11. package/es/components/avatar/src/avatar.mjs +1 -1
  12. package/es/components/avatar/src/avatar.mjs.map +1 -1
  13. package/es/components/button/src/button.d.ts +4 -4
  14. package/es/components/carNumber/src/carNumber.d.ts +3 -3
  15. package/es/components/dialog/src/dialog.mjs +1 -1
  16. package/es/components/dialog/src/dialog.mjs.map +1 -1
  17. package/es/components/drawer/src/drawer.mjs +1 -1
  18. package/es/components/drawer/src/drawer.mjs.map +1 -1
  19. package/es/components/form/src/formItem.d.ts +18 -4
  20. package/es/components/image/src/image.d.ts +7 -0
  21. package/es/components/image/src/image.mjs +1 -1
  22. package/es/components/image/src/image.mjs.map +1 -1
  23. package/es/components/index.mjs +1 -1
  24. package/es/components/table/index.d.ts +2 -2
  25. package/es/components/table/index.mjs +1 -1
  26. package/es/components/table/index.mjs.map +1 -1
  27. package/es/components/table/src/table.d.ts +45 -11
  28. package/es/components/table/src/table.mjs +1 -1
  29. package/es/components/table/src/table.mjs.map +1 -1
  30. package/es/components/table/src/table.state.d.ts +0 -4
  31. package/es/components/table/src/table.type.d.ts +3 -62
  32. package/es/components/table/src/table.type.mjs.map +1 -1
  33. package/es/components/table/src/tableColumn.d.ts +9 -0
  34. package/es/components/table/src/tableColumn.mjs +1 -1
  35. package/es/components/table/src/tableColumn.mjs.map +1 -1
  36. package/es/components/table/src/tableColumnSettingDialog.d.ts +3 -3
  37. package/es/components/table/src/tableColumnSettingDialog.mjs +1 -1
  38. package/es/components/table/src/tableColumnSettingDialog.mjs.map +1 -1
  39. package/es/components/table/src/useTable.mjs +1 -1
  40. package/es/components/table/src/useTable.mjs.map +1 -1
  41. package/es/components/table/utils/table.mjs +1 -1
  42. package/es/components/table/utils/table.mjs.map +1 -1
  43. package/es/components/upload/src/upload.d.ts +4 -4
  44. package/es/components/uploadImage/src/uploadImage.d.ts +4 -4
  45. package/es/components/uploadImages/src/uploadImages.d.ts +4 -4
  46. package/es/index.mjs +1 -1
  47. package/es/index.mjs.map +1 -1
  48. package/es/version.d.ts +1 -1
  49. package/es/version.mjs +1 -1
  50. package/es/version.mjs.map +1 -1
  51. package/lib/components/avatar/src/avatar.d.ts +10 -9
  52. package/lib/components/avatar/src/avatar.js +1 -1
  53. package/lib/components/avatar/src/avatar.js.map +1 -1
  54. package/lib/components/button/src/button.d.ts +4 -4
  55. package/lib/components/carNumber/src/carNumber.d.ts +3 -3
  56. package/lib/components/dialog/src/dialog.js +1 -1
  57. package/lib/components/dialog/src/dialog.js.map +1 -1
  58. package/lib/components/drawer/src/drawer.js +1 -1
  59. package/lib/components/drawer/src/drawer.js.map +1 -1
  60. package/lib/components/form/src/formItem.d.ts +18 -4
  61. package/lib/components/image/src/image.d.ts +7 -0
  62. package/lib/components/image/src/image.js +1 -1
  63. package/lib/components/image/src/image.js.map +1 -1
  64. package/lib/components/index.js +1 -1
  65. package/lib/components/table/index.d.ts +2 -2
  66. package/lib/components/table/index.js +1 -1
  67. package/lib/components/table/index.js.map +1 -1
  68. package/lib/components/table/src/table.d.ts +45 -11
  69. package/lib/components/table/src/table.js +1 -1
  70. package/lib/components/table/src/table.js.map +1 -1
  71. package/lib/components/table/src/table.state.d.ts +0 -4
  72. package/lib/components/table/src/table.type.d.ts +3 -62
  73. package/lib/components/table/src/table.type.js.map +1 -1
  74. package/lib/components/table/src/tableColumn.d.ts +9 -0
  75. package/lib/components/table/src/tableColumn.js +1 -1
  76. package/lib/components/table/src/tableColumn.js.map +1 -1
  77. package/lib/components/table/src/tableColumnSettingDialog.d.ts +3 -3
  78. package/lib/components/table/src/tableColumnSettingDialog.js +1 -1
  79. package/lib/components/table/src/tableColumnSettingDialog.js.map +1 -1
  80. package/lib/components/table/src/useTable.js +1 -1
  81. package/lib/components/table/src/useTable.js.map +1 -1
  82. package/lib/components/table/utils/table.js +1 -1
  83. package/lib/components/table/utils/table.js.map +1 -1
  84. package/lib/components/upload/src/upload.d.ts +4 -4
  85. package/lib/components/uploadImage/src/uploadImage.d.ts +4 -4
  86. package/lib/components/uploadImages/src/uploadImages.d.ts +4 -4
  87. package/lib/index.js +1 -1
  88. package/lib/version.d.ts +1 -1
  89. package/lib/version.js +1 -1
  90. package/lib/version.js.map +1 -1
  91. package/package.json +5 -5
  92. package/styles/components/table.scss +1 -1
@@ -27,9 +27,9 @@
27
27
  type: utils.definePropType([String, Object, Function]),
28
28
  default: () => ElementPlusIconsVue.Picture
29
29
  },
30
- /**
31
- * @description 原图
32
- */
30
+ /** @description Base64图片 */
31
+ base64: Boolean,
32
+ /** @description 原图 */
33
33
  original: Boolean,
34
34
  /** @description 标准 */
35
35
  normal: Boolean,
@@ -54,20 +54,20 @@
54
54
  }) {
55
55
  const state = vue.reactive({
56
56
  src: vue.computed(() => {
57
- if (props.src) {
58
- if (props.original) {
59
- return props.src;
60
- } else if (props.normal) {
61
- return `${props.src}@!normal`;
62
- } else if (props.small) {
63
- return `${props.src}@!small`;
64
- } else if (props.thumb) {
65
- return `${props.src}@!thumb`;
66
- } else {
67
- return `${props.src}@!thumb`;
68
- }
57
+ if (!props.src) return void 0;
58
+ if (props.base64) {
59
+ return `data:image/png;base64,${props.src}`;
60
+ } else if (props.original) {
61
+ return props.src;
62
+ } else if (props.normal) {
63
+ return `${props.src}@!normal`;
64
+ } else if (props.small) {
65
+ return `${props.src}@!small`;
66
+ } else if (props.thumb) {
67
+ return `${props.src}@!thumb`;
68
+ } else {
69
+ return `${props.src}@!thumb`;
69
70
  }
70
- return void 0;
71
71
  })
72
72
  });
73
73
  const elAvatarProps = utils.useProps(props, ElementPlus.avatarProps, ["src"]);
@@ -6994,7 +6994,7 @@
6994
6994
  const isIOS = /* @__PURE__ */ getIsIOS();
6995
6995
  function getIsIOS() {
6996
6996
  var _window, _window2, _window3;
6997
- return isClient && ((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.navigator) === null || _window2 === void 0 ? void 0 : _window2.maxTouchPoints) > 2 && /iPad|Macintosh/.test((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.navigator.userAgent));
6997
+ return isClient && !!((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.navigator) === null || _window2 === void 0 ? void 0 : _window2.maxTouchPoints) > 2 && /iPad|Macintosh/.test((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.navigator.userAgent));
6998
6998
  }
6999
6999
  function toRef(...args) {
7000
7000
  if (args.length !== 1) return vue.toRef(...args);
@@ -8334,11 +8334,6 @@
8334
8334
  return (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;
8335
8335
  }
8336
8336
  function useEventListener(...args) {
8337
- const cleanups = [];
8338
- const cleanup = () => {
8339
- cleanups.forEach((fn) => fn());
8340
- cleanups.length = 0;
8341
- };
8342
8337
  const register = (el, event, listener, options) => {
8343
8338
  el.addEventListener(event, listener, options);
8344
8339
  return () => el.removeEventListener(event, listener, options);
@@ -8347,7 +8342,7 @@
8347
8342
  const test = toArray(vue.toValue(args[0])).filter((e) => e != null);
8348
8343
  return test.every((e) => typeof e !== "string") ? test : void 0;
8349
8344
  });
8350
- const stopWatch = watchImmediate(() => {
8345
+ return watchImmediate(() => {
8351
8346
  var _firstParamTargets$va, _firstParamTargets$va2;
8352
8347
  return [
8353
8348
  (_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),
@@ -8355,18 +8350,14 @@
8355
8350
  toArray(vue.unref(firstParamTargets.value ? args[2] : args[1])),
8356
8351
  vue.toValue(firstParamTargets.value ? args[3] : args[2])
8357
8352
  ];
8358
- }, ([raw_targets, raw_events, raw_listeners, raw_options]) => {
8359
- cleanup();
8353
+ }, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {
8360
8354
  if (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;
8361
8355
  const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
8362
- cleanups.push(...raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone)))));
8356
+ const cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));
8357
+ onCleanup(() => {
8358
+ cleanups.forEach((fn) => fn());
8359
+ });
8363
8360
  }, { flush: "post" });
8364
- const stop = () => {
8365
- stopWatch();
8366
- cleanup();
8367
- };
8368
- tryOnScopeDispose(cleanup);
8369
- return stop;
8370
8361
  }
8371
8362
  let _iOSWorkaround = false;
8372
8363
  function onClickOutside(target, handler, options = {}) {
@@ -9030,6 +9021,7 @@
9030
9021
  }
9031
9022
  updateResult(promiseState.rejected, e);
9032
9023
  onError();
9024
+ if (activeIndex.value === tasks.length - 1) onFinished();
9033
9025
  return e;
9034
9026
  });
9035
9027
  }, Promise.resolve());
@@ -9621,6 +9613,7 @@
9621
9613
  ta.value = value;
9622
9614
  ta.style.position = "absolute";
9623
9615
  ta.style.opacity = "0";
9616
+ ta.setAttribute("readonly", "");
9624
9617
  document.body.appendChild(ta);
9625
9618
  ta.select();
9626
9619
  document.execCommand("copy");
@@ -10578,6 +10571,7 @@
10578
10571
  return types.every((type) => dataTypes.some((allowedType) => type.includes(allowedType)));
10579
10572
  };
10580
10573
  const checkValidity = (items) => {
10574
+ if (_options.checkValidity) return _options.checkValidity(items);
10581
10575
  const dataTypesValid = checkDataTypes(Array.from(items !== null && items !== void 0 ? items : []).map((item) => item.type));
10582
10576
  const multipleFilesValid = multiple || items.length <= 1;
10583
10577
  return dataTypesValid && multipleFilesValid;
@@ -10864,8 +10858,8 @@
10864
10858
  };
10865
10859
  }
10866
10860
  function useElementVisibility(element, options = {}) {
10867
- const { window: window$1 = defaultWindow, scrollTarget, threshold = 0, rootMargin, once: once2 = false } = options;
10868
- const elementIsVisible = vue.shallowRef(false);
10861
+ const { window: window$1 = defaultWindow, scrollTarget, threshold = 0, rootMargin, once: once2 = false, initialValue = false } = options;
10862
+ const elementIsVisible = vue.shallowRef(initialValue);
10869
10863
  const { stop } = useIntersectionObserver(element, (intersectionObserverEntries) => {
10870
10864
  let isIntersecting = elementIsVisible.value;
10871
10865
  let latestTime = 0;
@@ -11974,7 +11968,7 @@
11974
11968
  var _document2;
11975
11969
  if (!window$1) return;
11976
11970
  const el = (target === null || target === void 0 || (_document2 = target.document) === null || _document2 === void 0 ? void 0 : _document2.documentElement) || (target === null || target === void 0 ? void 0 : target.documentElement) || unrefElement(target);
11977
- const { display, flexDirection, direction } = getComputedStyle(el);
11971
+ const { display, flexDirection, direction } = window$1.getComputedStyle(el);
11978
11972
  const directionMultipler = direction === "rtl" ? -1 : 1;
11979
11973
  const scrollLeft = el.scrollLeft;
11980
11974
  directions.left = scrollLeft < internalX.value;
@@ -12060,9 +12054,13 @@
12060
12054
  return resolveElement(vue.toValue(element));
12061
12055
  });
12062
12056
  const isElementVisible = useElementVisibility(observedElement);
12057
+ const canLoad = vue.computed(() => {
12058
+ if (!observedElement.value) return false;
12059
+ return canLoadMore(observedElement.value);
12060
+ });
12063
12061
  function checkAndLoad() {
12064
12062
  state.measure();
12065
- if (!observedElement.value || !isElementVisible.value || !canLoadMore(observedElement.value)) return;
12063
+ if (!observedElement.value || !isElementVisible.value || !canLoad.value) return;
12066
12064
  const { scrollHeight, clientHeight, scrollWidth, clientWidth } = observedElement.value;
12067
12065
  const isNarrower = direction === "bottom" || direction === "top" ? scrollHeight <= clientHeight : scrollWidth <= clientWidth;
12068
12066
  if (state.arrivedState[direction] || isNarrower) {
@@ -12072,7 +12070,11 @@
12072
12070
  });
12073
12071
  }
12074
12072
  }
12075
- tryOnUnmounted(vue.watch(() => [state.arrivedState[direction], isElementVisible.value], checkAndLoad, { immediate: true }));
12073
+ tryOnUnmounted(vue.watch(() => [
12074
+ state.arrivedState[direction],
12075
+ isElementVisible.value,
12076
+ canLoad.value
12077
+ ], checkAndLoad, { immediate: true }));
12076
12078
  return {
12077
12079
  isLoading,
12078
12080
  reset() {
@@ -12162,6 +12164,7 @@
12162
12164
  var _e$key, _e$code;
12163
12165
  const key = (_e$key = e.key) === null || _e$key === void 0 ? void 0 : _e$key.toLowerCase();
12164
12166
  const values2 = [(_e$code = e.code) === null || _e$code === void 0 ? void 0 : _e$code.toLowerCase(), key].filter(Boolean);
12167
+ if (key === "") return;
12165
12168
  if (key) if (value) current.add(key);
12166
12169
  else current.delete(key);
12167
12170
  for (const key$1 of values2) {
@@ -12539,17 +12542,20 @@
12539
12542
  if (!window$1) return;
12540
12543
  const el = unrefElement(targetRef);
12541
12544
  if (!el || !(el instanceof Element)) return;
12542
- const { left, top, width, height } = el.getBoundingClientRect();
12543
- elementPositionX.value = left + (type === "page" ? window$1.pageXOffset : 0);
12544
- elementPositionY.value = top + (type === "page" ? window$1.pageYOffset : 0);
12545
- elementHeight.value = height;
12546
- elementWidth.value = width;
12547
- const elX = x.value - elementPositionX.value;
12548
- const elY = y.value - elementPositionY.value;
12549
- isOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;
12550
- if (handleOutside || !isOutside.value) {
12551
- elementX.value = elX;
12552
- elementY.value = elY;
12545
+ for (const rect of el.getClientRects()) {
12546
+ const { left, top, width, height } = rect;
12547
+ elementPositionX.value = left + (type === "page" ? window$1.pageXOffset : 0);
12548
+ elementPositionY.value = top + (type === "page" ? window$1.pageYOffset : 0);
12549
+ elementHeight.value = height;
12550
+ elementWidth.value = width;
12551
+ const elX = x.value - elementPositionX.value;
12552
+ const elY = y.value - elementPositionY.value;
12553
+ isOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;
12554
+ if (handleOutside || !isOutside.value) {
12555
+ elementX.value = elX;
12556
+ elementY.value = elY;
12557
+ }
12558
+ if (!isOutside.value) break;
12553
12559
  }
12554
12560
  }
12555
12561
  const stopFnList = [];
@@ -13400,8 +13406,12 @@
13400
13406
  };
13401
13407
  vue.watch(isListening, (newValue, oldValue) => {
13402
13408
  if (newValue === oldValue) return;
13403
- if (newValue) recognition.start();
13404
- else recognition.stop();
13409
+ try {
13410
+ if (newValue) recognition.start();
13411
+ else recognition.stop();
13412
+ } catch (err) {
13413
+ error.value = err;
13414
+ }
13405
13415
  });
13406
13416
  }
13407
13417
  tryOnScopeDispose(() => {
@@ -14004,18 +14014,20 @@
14004
14014
  });
14005
14015
  }
14006
14016
  function getTimeAgoIntlResult(from, options = {}, now2 = Date.now()) {
14017
+ var _options$units;
14007
14018
  const { locale, relativeTimeFormatOptions = { numeric: "auto" } } = options;
14008
14019
  const rtf = new Intl.RelativeTimeFormat(locale, relativeTimeFormatOptions);
14009
14020
  const { locale: resolvedLocale } = rtf.resolvedOptions();
14010
14021
  const diff = +from - +now2;
14011
14022
  const absDiff = Math.abs(diff);
14012
- for (const { name, ms } of UNITS) if (absDiff >= ms) return {
14023
+ const units = (_options$units = options.units) !== null && _options$units !== void 0 ? _options$units : UNITS;
14024
+ for (const { name, ms } of units) if (absDiff >= ms) return {
14013
14025
  resolvedLocale,
14014
14026
  parts: rtf.formatToParts(Math.round(diff / ms), name)
14015
14027
  };
14016
14028
  return {
14017
14029
  resolvedLocale,
14018
- parts: rtf.formatToParts(0, "second")
14030
+ parts: rtf.formatToParts(0, units[units.length - 1].name)
14019
14031
  };
14020
14032
  }
14021
14033
  function formatTimeAgoIntlParts(parts, options = {}) {
@@ -14892,7 +14904,8 @@
14892
14904
  const { retries = -1, delay: delay2 = 1e3, onFailed } = resolveNestedOptions(options.autoReconnect);
14893
14905
  if ((typeof retries === "function" ? retries : () => typeof retries === "number" && (retries < 0 || retried < retries))(retried)) {
14894
14906
  retried += 1;
14895
- retryTimeout = setTimeout(_init, delay2);
14907
+ const delayTime = typeof delay2 === "function" ? delay2(retried) : delay2;
14908
+ retryTimeout = setTimeout(_init, delayTime);
14896
14909
  } else onFailed === null || onFailed === void 0 || onFailed();
14897
14910
  }
14898
14911
  };
@@ -15420,7 +15433,7 @@
15420
15433
  "class": ["fa-dialog__header-icon", state.loading ? "fa__click__disabled fa__click__disabled__cursor " : "fa__hover__twinkle"],
15421
15434
  "onClick": handleFullscreen
15422
15435
  }, [vue.createVNode(ElementPlus.ElIcon, null, {
15423
- default: () => [state.fullscreen ? vue.createVNode(FastElementPlusIconsVue.FullScreenExit, null, null) : vue.createVNode(ElementPlusIconsVue.FullScreen, null, null)]
15436
+ default: () => [state.fullscreen ? vue.createVNode(FastElementPlusIconsVue.FullScreenExit, null, null) : vue.createVNode(FastElementPlusIconsVue.FullScreen, null, null)]
15424
15437
  })]), props.showClose && vue.createVNode("div", {
15425
15438
  "title": "关闭",
15426
15439
  "class": ["fa-dialog__header-icon", state.loading ? "fa__click__disabled fa__click__disabled__cursor " : "fa__hover__twinkle"],
@@ -15686,7 +15699,7 @@
15686
15699
  "class": ["fa-drawer__header-icon", state.loading ? "fa__click__disabled fa__click__disabled__cursor " : "fa__hover__twinkle"],
15687
15700
  "onClick": handleFullscreen
15688
15701
  }, [vue.createVNode(ElementPlus.ElIcon, null, {
15689
- default: () => [state.fullscreen ? vue.createVNode(FastElementPlusIconsVue.FullScreenExit, null, null) : vue.createVNode(ElementPlusIconsVue.FullScreen, null, null)]
15702
+ default: () => [state.fullscreen ? vue.createVNode(FastElementPlusIconsVue.FullScreenExit, null, null) : vue.createVNode(FastElementPlusIconsVue.FullScreen, null, null)]
15690
15703
  })]), props.showClose && vue.createVNode("div", {
15691
15704
  "title": "关闭",
15692
15705
  "class": ["fa-drawer__header-icon", state.loading ? "fa__click__disabled fa__click__disabled__cursor " : "fa__hover__twinkle"],
@@ -16610,6 +16623,8 @@
16610
16623
  type: Boolean,
16611
16624
  default: true
16612
16625
  },
16626
+ /** @description Base64图片 */
16627
+ base64: Boolean,
16613
16628
  /** @description 原图 */
16614
16629
  original: Boolean,
16615
16630
  /** @description 标准 */
@@ -16636,7 +16651,9 @@
16636
16651
  const state = vue.reactive({
16637
16652
  src: vue.computed(() => {
16638
16653
  if (!props.src) return void 0;
16639
- if (props.original) {
16654
+ if (props.base64) {
16655
+ return `data:image/png;base64,${props.src}`;
16656
+ } else if (props.original) {
16640
16657
  return props.src;
16641
16658
  } else if (props.normal) {
16642
16659
  return `${props.src}@!normal`;
@@ -16648,7 +16665,7 @@
16648
16665
  return `${props.src}@!thumb`;
16649
16666
  }
16650
16667
  }),
16651
- previewList: vue.computed(() => props.preview ? [props.src] : [])
16668
+ previewList: vue.computed(() => props.preview ? [props.base64 ? `data:image/png;base64,${props.src}` : props.src] : [])
16652
16669
  });
16653
16670
  const bindProps = utils.useProps(props, ElementPlus.imageProps, ["src", "previewSrcList"]);
16654
16671
  utils.useRender(() => vue.createVNode(ElementPlus.ElImage, vue.mergeProps(bindProps.value, {
@@ -18304,7 +18321,7 @@
18304
18321
  filterData = enumData.find((item) => item[value] === callValue);
18305
18322
  }
18306
18323
  if (type === "tag") {
18307
- return filterData?.type ?? "primary";
18324
+ return filterData?.type ?? "info";
18308
18325
  }
18309
18326
  return filterData ? filterData[label] : null;
18310
18327
  },
@@ -18440,7 +18457,6 @@
18440
18457
  searchParam: {},
18441
18458
  searchValueUpdate: "",
18442
18459
  searchForm: props.searchForm,
18443
- hideImage: vue.computed(() => props.hideImage),
18444
18460
  selected: false,
18445
18461
  selectedList: [],
18446
18462
  selectedListIds: vue.computed(() => state.selectedList.map((item) => isFunction(props.rowKey) ? props.rowKey(item) : item[props.rowKey])),
@@ -18600,7 +18616,7 @@
18600
18616
  handleTableColumnAutoWidth();
18601
18617
  };
18602
18618
  const loadTableColumns = () => {
18603
- let columns = props.columns;
18619
+ let columns = props.columns ? props.columns : [];
18604
18620
  columns.forEach((col) => {
18605
18621
  if (col.pureSearch || col.search) {
18606
18622
  col.search.key ??= col.prop;
@@ -18942,6 +18958,8 @@
18942
18958
  _children: {
18943
18959
  type: utils.definePropType(Array)
18944
18960
  },
18961
+ /** @description 隐藏图片 */
18962
+ hideImage: Boolean,
18945
18963
  /** @description 复制 */
18946
18964
  copy: Boolean,
18947
18965
  /** @description 是否为 Link Button */
@@ -19278,7 +19296,7 @@
19278
19296
  }),
19279
19297
  default: ({
19280
19298
  row
19281
- }) => row[props.prop] ? tableState.hideImage ? vue.createVNode(ElementPlus.ElImage, {
19299
+ }) => row[props.prop] ? props.hideImage ? vue.createVNode(ElementPlus.ElImage, {
19282
19300
  "class": "fa-image",
19283
19301
  "lazy": true,
19284
19302
  "src": artwork,
@@ -19310,7 +19328,11 @@
19310
19328
  header: ({
19311
19329
  column,
19312
19330
  $index
19313
- }) => headerRender({
19331
+ }) => slots.header ? slots.header({
19332
+ column: columnCtx.value,
19333
+ $index,
19334
+ ...getTableDefaultSlots(tableState)
19335
+ }) : headerRender({
19314
19336
  column,
19315
19337
  $index
19316
19338
  }),
@@ -19318,10 +19340,27 @@
19318
19340
  row,
19319
19341
  column,
19320
19342
  $index
19321
- }) => defaultRender({
19343
+ }) => slots.default ? slots.default({
19344
+ row,
19345
+ column: columnCtx.value,
19346
+ $index,
19347
+ ...getTableDefaultSlots(tableState)
19348
+ }) : defaultRender({
19322
19349
  row,
19323
19350
  column,
19324
19351
  $index
19352
+ }),
19353
+ filterIcon: ({
19354
+ filterOpened
19355
+ }) => slots.filterIcon && slots.filterIcon({
19356
+ filterOpened,
19357
+ ...getTableDefaultSlots(tableState)
19358
+ }),
19359
+ expand: ({
19360
+ expanded
19361
+ }) => slots.expand && slots.expand({
19362
+ expanded,
19363
+ ...getTableDefaultSlots(tableState)
19325
19364
  })
19326
19365
  })
19327
19366
  )
@@ -22138,28 +22177,10 @@
22138
22177
  });
22139
22178
  };
22140
22179
  const handleChange = async () => {
22141
- if (props.change) {
22142
- if (state.change) {
22143
- await props.change(tableState.orgColumns.map((m) => ({
22144
- columnID: m.columnID,
22145
- label: m.label,
22146
- fixed: m.fixed,
22147
- width: m.width,
22148
- smallWidth: m.smallWidth,
22149
- order: m.order,
22150
- sortable: m.sortable,
22151
- copy: m.copy,
22152
- autoWidth: m.autoWidth,
22153
- show: m.show,
22154
- search: {
22155
- label: m.search?.label,
22156
- order: m.search?.order
22157
- }
22158
- })));
22159
- ElementPlus.ElMessage.success("保存列配置成功");
22160
- } else {
22161
- ElementPlus.ElMessage.info("列配置未发生变化");
22162
- }
22180
+ if (state.change) {
22181
+ props.change && await props.change(tableState.orgColumns);
22182
+ } else {
22183
+ ElementPlus.ElMessage.info("列配置未发生变化");
22163
22184
  }
22164
22185
  };
22165
22186
  const handleConfirmClick = () => {
@@ -23149,7 +23170,7 @@
23149
23170
  /** @description 列配置 */
23150
23171
  columns: {
23151
23172
  type: utils.definePropType([Array, Boolean]),
23152
- default: () => []
23173
+ default: () => false
23153
23174
  },
23154
23175
  /** @description 表格列改变 */
23155
23176
  columnsChange: {
@@ -23166,6 +23187,16 @@
23166
23187
  xl: 6
23167
23188
  })
23168
23189
  },
23190
+ /** @description 折叠搜素 */
23191
+ collapsedSearch: {
23192
+ type: Boolean,
23193
+ default: true
23194
+ },
23195
+ /** @description 高级搜素抽屉 */
23196
+ advancedSearchDrawer: {
23197
+ type: Boolean,
23198
+ default: false
23199
+ },
23169
23200
  /** @description 搜索表单 */
23170
23201
  searchForm: {
23171
23202
  type: Boolean,
@@ -23561,12 +23592,17 @@
23561
23592
  };
23562
23593
  vue.onMounted(async () => {
23563
23594
  state.initParam = props.initParam;
23564
- loadTableColumns();
23565
23595
  defaultSearchTime();
23566
23596
  Object.keys(props.initParam ?? {}).forEach((key) => {
23567
23597
  state.searchParam[key] = props.initParam[key];
23568
23598
  });
23569
23599
  await tableSearch();
23600
+ vue.watch(() => props.columns, async () => {
23601
+ loadTableColumns();
23602
+ }, {
23603
+ deep: true,
23604
+ immediate: true
23605
+ });
23570
23606
  vue.watch(() => props.initParam, () => {
23571
23607
  Object.keys(props.initParam ?? {}).forEach((key) => {
23572
23608
  state.searchParam[key] = props.initParam[key];
@@ -23610,7 +23646,7 @@
23610
23646
  });
23611
23647
  const searchFormSlotNames = vue.computed(() => state.searchColumns.filter((f) => f.search.slot).map((m) => m.search.slot));
23612
23648
  const tableColumnSlotNames = vue.computed(() => state.tableColumns.filter((f) => f.slot).map((m) => m.slot));
23613
- const tableColumnOmitNames = ["multiOrder", "columnID", "order", "sortableField", "disabledSortable", "spanProp", "pureSearch", "search"];
23649
+ const tableColumnOmitNames = ["multiOrder", "columnId", "order", "sortableField", "disabledSortable", "spanProp", "pureSearch", "search"];
23614
23650
  const elTableProps = utils.useProps(props, tableProps, ["data", "spanMethod", "headerCellClassName", "cellClassName"]);
23615
23651
  utils.useRender(() => vue.createVNode("div", {
23616
23652
  "ref": elementRef,
@@ -23623,6 +23659,8 @@
23623
23659
  }
23624
23660
  }, [vue.createVNode(TableSearchForm, {
23625
23661
  "show": props.searchForm && state.searchForm,
23662
+ "collapsedSearch": props.collapsedSearch,
23663
+ "advancedSearchDrawer": props.advancedSearchDrawer,
23626
23664
  "cols": props.searchFormCols,
23627
23665
  "search": tableSearch,
23628
23666
  "reset": tableReset
@@ -23683,12 +23721,7 @@
23683
23721
  "teleported": false,
23684
23722
  "unlinkPanels": true,
23685
23723
  "onChange": () => tableSearch()
23686
- }, null), slots.toolButton && slots.toolButton({
23687
- ...{
23688
- search: tableSearch
23689
- },
23690
- ...getTableDefaultSlots(state)
23691
- }), props.refreshBtn && vue.createVNode(ElementPlus.ElButton, {
23724
+ }, null), props.refreshBtn && vue.createVNode(ElementPlus.ElButton, {
23692
23725
  "loading": state.loading,
23693
23726
  "loadingIcon": ElementPlusIconsVue.Eleme,
23694
23727
  "title": "刷新",
@@ -23702,14 +23735,31 @@
23702
23735
  "circle": true,
23703
23736
  "icon": ElementPlusIconsVue.Search,
23704
23737
  "onClick": () => state.searchForm = !state.searchForm
23705
- }, null), props.columnSettingBtn && !props.columns && vue.createVNode(ElementPlus.ElButton, {
23706
- "loading": state.loading,
23707
- "loadingIcon": ElementPlusIconsVue.Eleme,
23738
+ }, null), props.columnSettingBtn && props.columns && vue.createVNode(ElementPlus.ElDropdown, {
23708
23739
  "title": "表格列配置",
23709
- "circle": true,
23710
- "icon": ElementPlusIconsVue.Setting,
23711
- "onClick": () => columnSettingRef.value.open()
23712
- }, null), slots.toolButtonAdv && vue.createVNode(ElementPlus.ElDropdown, {
23740
+ "trigger": "click"
23741
+ }, {
23742
+ default: () => vue.createVNode(ElementPlus.ElButton, {
23743
+ "loading": state.loading,
23744
+ "loadingIcon": ElementPlusIconsVue.Eleme,
23745
+ "circle": true,
23746
+ "icon": ElementPlusIconsVue.Setting
23747
+ }, null),
23748
+ dropdown: () => vue.createVNode(ElementPlus.ElDropdownMenu, null, {
23749
+ default: () => [slots.columnSetting && slots.columnSetting(), vue.createVNode(ElementPlus.ElDropdownItem, {
23750
+ "title": "表格列配置",
23751
+ "divided": true,
23752
+ "onClick": () => columnSettingRef.value.open()
23753
+ }, {
23754
+ default: () => [vue.createTextVNode("表格列配置")]
23755
+ })]
23756
+ })
23757
+ }), slots.toolButton && slots.toolButton({
23758
+ ...{
23759
+ search: tableSearch
23760
+ },
23761
+ ...getTableDefaultSlots(state)
23762
+ }), slots.toolButtonAdv && vue.createVNode(ElementPlus.ElDropdown, {
23713
23763
  "title": "高级操作",
23714
23764
  "trigger": "click"
23715
23765
  }, {
@@ -23832,6 +23882,7 @@
23832
23882
  ...getTableDefaultSlots(state)
23833
23883
  })])
23834
23884
  }) : col.prop && vue.createVNode(TableColumn, vue.mergeProps(omit(col, tableColumnOmitNames), {
23885
+ "hideImage": props.hideImage,
23835
23886
  "resizable": true,
23836
23887
  "onImagePreview": handleImagePreview,
23837
23888
  "onCustomCellClick": handleCustomCellClick
@@ -23865,9 +23916,9 @@
23865
23916
  "teleported": true,
23866
23917
  "onClose": () => state.imagePreview = false,
23867
23918
  "urlList": state.previewList
23868
- }, null), vue.createVNode(TableColumnsSettingDialog, {
23919
+ }, null), props.columnSettingBtn && vue.createVNode(TableColumnsSettingDialog, {
23869
23920
  "ref": columnSettingRef,
23870
- "save": props.columnsChange
23921
+ "change": props.columnsChange
23871
23922
  }, null)]));
23872
23923
  return utils.useExpose(expose, {
23873
23924
  /** @description 用于多选表格,清空用户的选择 */
@@ -28256,7 +28307,7 @@
28256
28307
  }
28257
28308
  app.use(ElementPlus);
28258
28309
  };
28259
- const version$1 = "1.0.2";
28310
+ const version$1 = "1.0.4";
28260
28311
  const INSTALLED_KEY = Symbol("INSTALLED_KEY");
28261
28312
  const makeInstaller = () => {
28262
28313
  const install2 = (app) => {
@@ -28319,6 +28370,8 @@
28319
28370
  faSelectPageProps,
28320
28371
  faSelectProps,
28321
28372
  faSelectV2Props,
28373
+ faTableEmits,
28374
+ faTableProps,
28322
28375
  faTreeEmits,
28323
28376
  faTreeProps,
28324
28377
  faTreeSelectEmits,
@@ -28385,6 +28438,8 @@
28385
28438
  exports2.faSelectPageProps = faSelectPageProps;
28386
28439
  exports2.faSelectProps = faSelectProps;
28387
28440
  exports2.faSelectV2Props = faSelectV2Props;
28441
+ exports2.faTableEmits = faTableEmits;
28442
+ exports2.faTableProps = faTableProps;
28388
28443
  exports2.faTreeEmits = faTreeEmits;
28389
28444
  exports2.faTreeProps = faTreeProps;
28390
28445
  exports2.faTreeSelectEmits = faTreeSelectEmits;