@hbdlzy/ui-core 0.1.5 → 0.1.7

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 (57) hide show
  1. package/README.md +4 -0
  2. package/components.manifest.json +37 -1
  3. package/dist/components/BaseTable/BaseTable.types.d.ts +17 -2
  4. package/dist/components/BaseTable/BaseTable.vue.d.ts +4 -4
  5. package/dist/components/BaseTable/index.d.ts +1 -1
  6. package/dist/components/OutlinedCascader/OutlinedCascader.types.d.ts +3 -0
  7. package/dist/components/OutlinedCascader/OutlinedCascader.vue.d.ts +9 -0
  8. package/dist/components/OutlinedDatePicker/OutlinedDatePicker.types.d.ts +3 -0
  9. package/dist/components/OutlinedDatePicker/OutlinedDatePicker.vue.d.ts +9 -0
  10. package/dist/components/OutlinedDateTimePicker/OutlinedDateTimePicker.types.d.ts +3 -0
  11. package/dist/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue.d.ts +9 -0
  12. package/dist/components/OutlinedInput/OutlinedInput.types.d.ts +3 -0
  13. package/dist/components/OutlinedInput/OutlinedInput.vue.d.ts +9 -0
  14. package/dist/components/OutlinedSelect/OutlinedSelect.types.d.ts +3 -0
  15. package/dist/components/OutlinedSelect/OutlinedSelect.vue.d.ts +9 -0
  16. package/dist/components/OutlinedTimePicker/OutlinedTimePicker.types.d.ts +3 -0
  17. package/dist/components/OutlinedTimePicker/OutlinedTimePicker.vue.d.ts +9 -0
  18. package/dist/components/OutlinedTreeSelect/OutlinedTreeSelect.types.d.ts +3 -0
  19. package/dist/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +9 -0
  20. package/dist/components/SvgIcon/SvgIcon.types.d.ts +6 -0
  21. package/dist/components/SvgIcon/SvgIcon.vue.d.ts +32 -0
  22. package/dist/components/SvgIcon/index.d.ts +3 -0
  23. package/dist/index.cjs +5 -5
  24. package/dist/index.d.ts +2 -0
  25. package/dist/index.js +1114 -241
  26. package/dist/style.css +1 -1
  27. package/package.json +1 -1
  28. package/src/components/BaseTable/BaseTable.types.ts +19 -2
  29. package/src/components/BaseTable/BaseTable.vue +1089 -105
  30. package/src/components/BaseTable/README.md +88 -5
  31. package/src/components/BaseTable/index.ts +5 -0
  32. package/src/components/OutlinedCascader/OutlinedCascader.types.ts +3 -0
  33. package/src/components/OutlinedCascader/OutlinedCascader.vue +71 -6
  34. package/src/components/OutlinedCascader/README.md +3 -0
  35. package/src/components/OutlinedDatePicker/OutlinedDatePicker.types.ts +3 -0
  36. package/src/components/OutlinedDatePicker/OutlinedDatePicker.vue +71 -6
  37. package/src/components/OutlinedDatePicker/README.md +3 -0
  38. package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.types.ts +3 -0
  39. package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue +144 -64
  40. package/src/components/OutlinedDateTimePicker/README.md +3 -0
  41. package/src/components/OutlinedInput/OutlinedInput.types.ts +3 -0
  42. package/src/components/OutlinedInput/OutlinedInput.vue +87 -8
  43. package/src/components/OutlinedInput/README.md +3 -0
  44. package/src/components/OutlinedSelect/OutlinedSelect.types.ts +3 -0
  45. package/src/components/OutlinedSelect/OutlinedSelect.vue +72 -6
  46. package/src/components/OutlinedSelect/README.md +3 -0
  47. package/src/components/OutlinedTimePicker/OutlinedTimePicker.types.ts +3 -0
  48. package/src/components/OutlinedTimePicker/OutlinedTimePicker.vue +75 -8
  49. package/src/components/OutlinedTimePicker/README.md +3 -0
  50. package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.types.ts +3 -0
  51. package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.vue +72 -6
  52. package/src/components/OutlinedTreeSelect/README.md +3 -0
  53. package/src/components/SvgIcon/README.md +53 -0
  54. package/src/components/SvgIcon/SvgIcon.types.ts +6 -0
  55. package/src/components/SvgIcon/SvgIcon.vue +68 -0
  56. package/src/components/SvgIcon/index.ts +5 -0
  57. package/src/index.ts +2 -0
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as echarts from "echarts";
2
2
  export { echarts };
3
- import { defineComponent, useSlots, computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, renderSlot, toDisplayString, ref, reactive, watch, onMounted, resolveComponent, resolveDirective, createVNode, withDirectives, createBlock, withCtx, Fragment, renderList, createSlots, createTextVNode, mergeProps, withModifiers, withKeys, normalizeClass, shallowRef, nextTick, onUnmounted, useAttrs, normalizeProps, guardReactiveProps } from "vue";
3
+ import { defineComponent, useSlots, computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, renderSlot, toDisplayString, normalizeClass, ref, reactive, watch, onMounted, onBeforeUnmount, resolveComponent, resolveDirective, createVNode, withDirectives, createBlock, withCtx, Fragment, renderList, createSlots, createTextVNode, mergeProps, unref, withModifiers, Teleport, withKeys, shallowRef, nextTick, onUnmounted, useAttrs, normalizeProps, guardReactiveProps } from "vue";
4
4
  import { ElMessage } from "element-plus";
5
5
  import ExcelJS from "exceljs";
6
6
  import { saveAs } from "file-saver";
@@ -179,20 +179,20 @@ var _export_sfc = (sfc, props) => {
179
179
  }
180
180
  return target;
181
181
  };
182
- const _hoisted_1$3 = {
182
+ const _hoisted_1$9 = {
183
183
  key: 0,
184
184
  class: "base-card__header"
185
185
  };
186
- const _hoisted_2$1 = { class: "base-card__header-left" };
187
- const _hoisted_3$1 = {
186
+ const _hoisted_2$9 = { class: "base-card__header-left" };
187
+ const _hoisted_3$4 = {
188
188
  key: 0,
189
189
  class: "base-card__title-wrap"
190
190
  };
191
- const _hoisted_4$1 = {
191
+ const _hoisted_4$2 = {
192
192
  key: 0,
193
193
  class: "base-card__title-marker"
194
194
  };
195
- const _hoisted_5$1 = {
195
+ const _hoisted_5$2 = {
196
196
  key: 2,
197
197
  class: "base-card__title"
198
198
  };
@@ -211,7 +211,7 @@ const _hoisted_10$1 = {
211
211
  class: "base-card__tip"
212
212
  };
213
213
  const _hoisted_11$1 = { class: "base-card__content" };
214
- const _sfc_main$a = defineComponent({
214
+ const _sfc_main$b = defineComponent({
215
215
  ...{
216
216
  name: "BaseCard"
217
217
  },
@@ -307,11 +307,11 @@ const _sfc_main$a = defineComponent({
307
307
  class: "base-card",
308
308
  style: normalizeStyle(cardStyles.value)
309
309
  }, [
310
- shouldRenderHeader.value ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
311
- createElementVNode("div", _hoisted_2$1, [
312
- hasTitleBlock.value ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
313
- __props.showTitleMarker ? (openBlock(), createElementBlock("span", _hoisted_4$1)) : createCommentVNode("", true),
314
- _ctx.$slots["title-label"] ? renderSlot(_ctx.$slots, "title-label", { key: 1 }, void 0, true) : (openBlock(), createElementBlock("h4", _hoisted_5$1, toDisplayString(__props.title), 1))
310
+ shouldRenderHeader.value ? (openBlock(), createElementBlock("div", _hoisted_1$9, [
311
+ createElementVNode("div", _hoisted_2$9, [
312
+ hasTitleBlock.value ? (openBlock(), createElementBlock("div", _hoisted_3$4, [
313
+ __props.showTitleMarker ? (openBlock(), createElementBlock("span", _hoisted_4$2)) : createCommentVNode("", true),
314
+ _ctx.$slots["title-label"] ? renderSlot(_ctx.$slots, "title-label", { key: 1 }, void 0, true) : (openBlock(), createElementBlock("h4", _hoisted_5$2, toDisplayString(__props.title), 1))
315
315
  ])) : createCommentVNode("", true),
316
316
  renderSlot(_ctx.$slots, "title", {}, void 0, true)
317
317
  ]),
@@ -339,34 +339,137 @@ const _sfc_main$a = defineComponent({
339
339
  };
340
340
  }
341
341
  });
342
- var BaseCard = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-6bfddf1c"]]);
342
+ var BaseCard = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-6bfddf1c"]]);
343
+ var SvgIcon_vue_vue_type_style_index_0_scoped_true_lang = "";
344
+ const _hoisted_1$8 = ["aria-hidden", "aria-label"];
345
+ const _hoisted_2$8 = ["aria-hidden", "aria-label"];
346
+ const _hoisted_3$3 = ["href", "xlink:href"];
347
+ const _sfc_main$a = defineComponent({
348
+ ...{
349
+ name: "SvgIcon"
350
+ },
351
+ __name: "SvgIcon",
352
+ props: {
353
+ iconClass: {},
354
+ className: { default: "" },
355
+ prefix: { default: "icon" },
356
+ ariaLabel: { default: "" }
357
+ },
358
+ setup(__props) {
359
+ const props = __props;
360
+ const normalizedIconClass = computed(() => props.iconClass.trim());
361
+ const normalizedPrefix = computed(() => props.prefix.trim() || "icon");
362
+ const isExternal = computed(() => /^(https?:|mailto:|tel:|data:|blob:)/.test(normalizedIconClass.value));
363
+ const iconName = computed(() => `#${normalizedPrefix.value}-${normalizedIconClass.value}`);
364
+ const ariaHidden = computed(() => props.ariaLabel ? void 0 : "true");
365
+ const externalIconStyle = computed(() => ({
366
+ mask: `url(${normalizedIconClass.value}) no-repeat 50% 50%`,
367
+ WebkitMask: `url(${normalizedIconClass.value}) no-repeat 50% 50%`
368
+ }));
369
+ return (_ctx, _cache) => {
370
+ return isExternal.value ? (openBlock(), createElementBlock("span", {
371
+ key: 0,
372
+ class: normalizeClass(["svg-external-icon svg-icon", __props.className]),
373
+ style: normalizeStyle(externalIconStyle.value),
374
+ "aria-hidden": ariaHidden.value,
375
+ "aria-label": __props.ariaLabel,
376
+ role: "img"
377
+ }, null, 14, _hoisted_1$8)) : (openBlock(), createElementBlock("svg", {
378
+ key: 1,
379
+ class: normalizeClass(["svg-icon", __props.className]),
380
+ "aria-hidden": ariaHidden.value,
381
+ "aria-label": __props.ariaLabel,
382
+ role: "img"
383
+ }, [
384
+ createElementVNode("use", {
385
+ href: iconName.value,
386
+ "xlink:href": iconName.value
387
+ }, null, 8, _hoisted_3$3)
388
+ ], 10, _hoisted_2$8));
389
+ };
390
+ }
391
+ });
392
+ var SvgIcon = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-318312b1"]]);
343
393
  var BaseTable_vue_vue_type_style_index_0_scoped_true_lang = "";
344
- const _hoisted_1$2 = { class: "base-table" };
345
- const _hoisted_2 = {
394
+ const _hoisted_1$7 = { class: "base-table" };
395
+ const _hoisted_2$7 = {
396
+ class: "base-table__svg-sprite",
397
+ "aria-hidden": "true",
398
+ focusable: "false"
399
+ };
400
+ const _hoisted_3$2 = ["id"];
401
+ const _hoisted_4$1 = ["id"];
402
+ const _hoisted_5$1 = ["id"];
403
+ const _hoisted_6 = ["id"];
404
+ const _hoisted_7 = ["id"];
405
+ const _hoisted_8 = ["id"];
406
+ const _hoisted_9 = ["id"];
407
+ const _hoisted_10 = {
346
408
  key: 0,
347
409
  class: "base-table__toolbar"
348
410
  };
349
- const _hoisted_3 = { class: "base-table__toolbar-left" };
350
- const _hoisted_4 = {
411
+ const _hoisted_11 = { class: "base-table__toolbar-left" };
412
+ const _hoisted_12 = {
351
413
  key: 0,
352
414
  class: "base-table__toolbar-right"
353
415
  };
354
- const _hoisted_5 = { class: "base-table__header" };
355
- const _hoisted_6 = { class: "base-table__header-label" };
356
- const _hoisted_7 = { class: "base-table__header-actions" };
357
- const _hoisted_8 = { class: "base-table__header-search-footer" };
358
- const _hoisted_9 = {
416
+ const _hoisted_13 = { class: "base-table__header-main" };
417
+ const _hoisted_14 = { class: "base-table__header-label" };
418
+ const _hoisted_15 = {
419
+ key: 0,
420
+ class: "base-table__header-actions"
421
+ };
422
+ const _hoisted_16 = ["onClick"];
423
+ const _hoisted_17 = {
424
+ key: 0,
425
+ class: "base-table__header-select"
426
+ };
427
+ const _hoisted_18 = ["onClick"];
428
+ const _hoisted_19 = {
429
+ key: 0,
430
+ class: "base-table__header-select-tags"
431
+ };
432
+ const _hoisted_20 = {
433
+ key: 0,
434
+ class: "base-table__header-select-tag base-table__header-select-tag--count"
435
+ };
436
+ const _hoisted_21 = {
437
+ key: 0,
438
+ class: "base-table__header-select-options"
439
+ };
440
+ const _hoisted_22 = ["onClick"];
441
+ const _hoisted_23 = ["disabled", "onClick"];
442
+ const _hoisted_24 = { class: "base-table__header-select-option-label" };
443
+ const _hoisted_25 = {
444
+ key: 1,
445
+ class: "base-table__header-cascader"
446
+ };
447
+ const _hoisted_26 = ["onClick"];
448
+ const _hoisted_27 = {
449
+ key: 0,
450
+ class: "base-table__header-cascader-panel"
451
+ };
452
+ const _hoisted_28 = ["disabled", "onClick"];
453
+ const _hoisted_29 = { class: "base-table__header-cascader-label" };
454
+ const _hoisted_30 = {
455
+ key: 0,
456
+ class: "base-table__header-cascader-arrow",
457
+ "aria-hidden": "true"
458
+ };
459
+ const _hoisted_31 = ["value", "placeholder", "onInput", "onKeyup"];
460
+ const _hoisted_32 = { class: "base-table__header-search-footer" };
461
+ const _hoisted_33 = {
359
462
  key: 0,
360
463
  class: "base-table__actions"
361
464
  };
362
- const _hoisted_10 = {
465
+ const _hoisted_34 = {
363
466
  key: 2,
364
467
  class: "base-table__tags"
365
468
  };
366
- const _hoisted_11 = { key: 1 };
367
- const _hoisted_12 = ["innerHTML"];
368
- const _hoisted_13 = ["onClick"];
369
- const _hoisted_14 = {
469
+ const _hoisted_35 = { key: 1 };
470
+ const _hoisted_36 = ["innerHTML"];
471
+ const _hoisted_37 = ["onClick"];
472
+ const _hoisted_38 = {
370
473
  key: 6,
371
474
  class: "base-table__text"
372
475
  };
@@ -416,6 +519,7 @@ const _sfc_main$9 = defineComponent({
416
519
  emits: ["selection-change", "sort-change", "row-action", "cell-click", "cell-input", "page-change", "size-change", "update:pagination", "loaded", "request-error"],
417
520
  setup(__props, { expose: __expose, emit: __emit }) {
418
521
  var _a, _b;
522
+ let baseTableIconSeed = 0;
419
523
  const props = __props;
420
524
  const emit = __emit;
421
525
  const slots = useSlots();
@@ -425,7 +529,13 @@ const _sfc_main$9 = defineComponent({
425
529
  const rows = ref(normalizeRows(props.data));
426
530
  const selectionRows = ref([]);
427
531
  const headerSearchValues = reactive({});
428
- const headerSearchDropdownRefs = ref({});
532
+ const headerSearchVisible = reactive({});
533
+ const headerSearchSelectOpen = reactive({});
534
+ const headerSearchCascaderActivePaths = reactive({});
535
+ const headerSearchTriggerRects = reactive({});
536
+ const headerSearchTriggerRefs = ref({});
537
+ const baseTableIconPrefix = `base-table-icon-${++baseTableIconSeed}`;
538
+ let headerSearchPositionFrame = 0;
429
539
  const sortState = reactive({
430
540
  prop: (_a = props.defaultSort) == null ? void 0 : _a.prop,
431
541
  order: ((_b = props.defaultSort) == null ? void 0 : _b.order) || null
@@ -483,6 +593,8 @@ const _sfc_main$9 = defineComponent({
483
593
  { deep: true }
484
594
  );
485
595
  onMounted(() => {
596
+ window.addEventListener("scroll", scheduleHeaderSearchPositionUpdate, true);
597
+ window.addEventListener("resize", scheduleHeaderSearchPositionUpdate);
486
598
  if (props.request && props.autoLoad) {
487
599
  void load();
488
600
  return;
@@ -491,6 +603,14 @@ const _sfc_main$9 = defineComponent({
491
603
  setData(props.data || []);
492
604
  }
493
605
  });
606
+ onBeforeUnmount(() => {
607
+ window.removeEventListener("scroll", scheduleHeaderSearchPositionUpdate, true);
608
+ window.removeEventListener("resize", scheduleHeaderSearchPositionUpdate);
609
+ if (headerSearchPositionFrame) {
610
+ window.cancelAnimationFrame(headerSearchPositionFrame);
611
+ headerSearchPositionFrame = 0;
612
+ }
613
+ });
494
614
  function syncPagination(value) {
495
615
  const nextPageSizes = value == null ? void 0 : value.pageSizes;
496
616
  paginationState.currentPage = Number((value == null ? void 0 : value.currentPage) || paginationState.currentPage || 1);
@@ -630,8 +750,11 @@ const _sfc_main$9 = defineComponent({
630
750
  value
631
751
  });
632
752
  }
753
+ function resolveHeaderContentAlign(column) {
754
+ return column.headerAlign || column.align || "left";
755
+ }
633
756
  function shouldRenderBuiltInHeader(column) {
634
- return hasHeaderSearch(column);
757
+ return hasHeaderSearch(column) || isHeaderSortable(column);
635
758
  }
636
759
  function hasHeaderSearch(column) {
637
760
  return Boolean(getHeaderSearchConfig(column));
@@ -648,36 +771,154 @@ const _sfc_main$9 = defineComponent({
648
771
  function getHeaderSearchStateKey(column) {
649
772
  return resolveHeaderSearchParamKey(column) || getColumnProp(column) || getColumnKey(column);
650
773
  }
651
- function setHeaderSearchDropdownRef(instance, column) {
774
+ function resolveHeaderSearchParamKey(column) {
775
+ const config = getHeaderSearchConfig(column);
776
+ const legacyParamKey = column.otherProps;
777
+ return (config == null ? void 0 : config.paramKey) || legacyParamKey || getColumnProp(column) || "";
778
+ }
779
+ function setHeaderSearchTriggerRef(instance, column) {
652
780
  const stateKey = getHeaderSearchStateKey(column);
653
- if (!instance) {
654
- delete headerSearchDropdownRefs.value[stateKey];
781
+ if (!(instance instanceof HTMLElement)) {
782
+ delete headerSearchTriggerRefs.value[stateKey];
655
783
  return;
656
784
  }
657
- headerSearchDropdownRefs.value[stateKey] = instance;
785
+ headerSearchTriggerRefs.value[stateKey] = instance;
658
786
  }
659
- function bindHeaderSearchDropdown(column) {
787
+ function bindHeaderSearchTrigger(column) {
660
788
  return (instance) => {
661
- setHeaderSearchDropdownRef(instance, column);
789
+ setHeaderSearchTriggerRef(instance, column);
662
790
  };
663
791
  }
664
- function resolveHeaderSearchParamKey(column) {
665
- const config = getHeaderSearchConfig(column);
666
- const legacyParamKey = column.otherProps;
667
- return (config == null ? void 0 : config.paramKey) || legacyParamKey || getColumnProp(column) || "";
792
+ function isHeaderSearchVisible(column) {
793
+ return Boolean(headerSearchVisible[getHeaderSearchStateKey(column)]);
794
+ }
795
+ function toggleHeaderSearch(column) {
796
+ const stateKey = getHeaderSearchStateKey(column);
797
+ const nextVisible = !headerSearchVisible[stateKey];
798
+ if (nextVisible) {
799
+ closeAllHeaderSearch();
800
+ updateHeaderSearchTriggerRect(column);
801
+ syncHeaderSearchCascaderActivePath(column);
802
+ }
803
+ headerSearchVisible[stateKey] = nextVisible;
804
+ headerSearchSelectOpen[stateKey] = false;
805
+ }
806
+ function closeAllHeaderSearch() {
807
+ Object.keys(headerSearchVisible).forEach((key) => {
808
+ headerSearchVisible[key] = false;
809
+ headerSearchSelectOpen[key] = false;
810
+ });
811
+ }
812
+ function updateHeaderSearchTriggerRect(column) {
813
+ var _a2;
814
+ const stateKey = getHeaderSearchStateKey(column);
815
+ const rect = (_a2 = headerSearchTriggerRefs.value[stateKey]) == null ? void 0 : _a2.getBoundingClientRect();
816
+ if (rect) {
817
+ headerSearchTriggerRects[stateKey] = rect;
818
+ }
819
+ }
820
+ function updateVisibleHeaderSearchPosition() {
821
+ props.columns.forEach((column) => {
822
+ if (hasHeaderSearch(column) && isHeaderSearchVisible(column)) {
823
+ updateHeaderSearchTriggerRect(column);
824
+ }
825
+ });
826
+ }
827
+ function scheduleHeaderSearchPositionUpdate() {
828
+ if (headerSearchPositionFrame) {
829
+ return;
830
+ }
831
+ headerSearchPositionFrame = window.requestAnimationFrame(() => {
832
+ headerSearchPositionFrame = 0;
833
+ updateVisibleHeaderSearchPosition();
834
+ });
835
+ }
836
+ function getHeaderSearchPanelStyle(column) {
837
+ const stateKey = getHeaderSearchStateKey(column);
838
+ const triggerRect = headerSearchTriggerRects[stateKey];
839
+ const width = toCssValue(getHeaderSearchWidth(column)) || "280px";
840
+ if (!triggerRect) {
841
+ return {
842
+ width
843
+ };
844
+ }
845
+ const panelWidth = Number.parseFloat(String(getHeaderSearchWidth(column))) || 280;
846
+ const maxLeft = Math.max(8, window.innerWidth - panelWidth - 8);
847
+ const left = Math.min(maxLeft, Math.max(8, triggerRect.right - panelWidth));
848
+ const top = triggerRect.bottom + 8;
849
+ return {
850
+ width,
851
+ left: `${left}px`,
852
+ top: `${top}px`
853
+ };
668
854
  }
669
855
  function getHeaderSearchValue(column) {
670
- return headerSearchValues[getHeaderSearchStateKey(column)] || "";
856
+ const stateKey = getHeaderSearchStateKey(column);
857
+ const value = headerSearchValues[stateKey];
858
+ if (value !== void 0) {
859
+ return value;
860
+ }
861
+ return getHeaderSearchEmptyValue(column);
862
+ }
863
+ function getHeaderSearchInputValue(column) {
864
+ const value = getHeaderSearchValue(column);
865
+ return Array.isArray(value) ? value.join(" ") : String(value);
671
866
  }
672
867
  function hasHeaderSearchValue(column) {
673
- return Boolean(getHeaderSearchValue(column).trim());
868
+ return isHeaderSearchValueFilled(getHeaderSearchValue(column));
674
869
  }
675
870
  function updateHeaderSearchValue(column, value) {
676
- headerSearchValues[getHeaderSearchStateKey(column)] = normalizeHeaderSearchValue(value);
871
+ headerSearchValues[getHeaderSearchStateKey(column)] = normalizeHeaderSearchValue(column, value);
872
+ }
873
+ function handleHeaderSearchInput(column, event) {
874
+ var _a2;
875
+ updateHeaderSearchValue(column, ((_a2 = event.target) == null ? void 0 : _a2.value) || "");
876
+ }
877
+ function isHeaderSearchSelect(column) {
878
+ var _a2;
879
+ return ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.type) === "select";
880
+ }
881
+ function isHeaderSearchCascader(column) {
882
+ var _a2;
883
+ return ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.type) === "cascader";
884
+ }
885
+ function isHeaderSearchChoice(column) {
886
+ return isHeaderSearchSelect(column) || isHeaderSearchCascader(column);
887
+ }
888
+ function isHeaderSearchMultiple(column) {
889
+ var _a2;
890
+ return isHeaderSearchSelect(column) && ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.multiple) === true;
891
+ }
892
+ function getHeaderSearchIconName(column) {
893
+ const iconName = isHeaderSearchChoice(column) ? "select" : "search";
894
+ return hasHeaderSearchValue(column) ? `${iconName}-y` : iconName;
895
+ }
896
+ function isHeaderSortable(column) {
897
+ return Boolean(resolveColumnSortable(column));
898
+ }
899
+ function isHeaderSortActive(column) {
900
+ return String(sortState.prop || "") === String(getColumnProp(column) || "") && Boolean(sortState.order);
901
+ }
902
+ function getHeaderSortIconName(column) {
903
+ if (!isHeaderSortActive(column)) {
904
+ return "sort-none";
905
+ }
906
+ return sortState.order === "ascending" ? "sort-up" : "sort-down";
907
+ }
908
+ function isHeaderSearchSelectOpen(column) {
909
+ return Boolean(headerSearchSelectOpen[getHeaderSearchStateKey(column)]);
910
+ }
911
+ function toggleHeaderSearchSelect(column) {
912
+ const stateKey = getHeaderSearchStateKey(column);
913
+ const nextOpen = !headerSearchSelectOpen[stateKey];
914
+ if (nextOpen) {
915
+ syncHeaderSearchCascaderActivePath(column);
916
+ }
917
+ headerSearchSelectOpen[stateKey] = nextOpen;
677
918
  }
678
919
  function getHeaderSearchPlaceholder(column) {
679
920
  var _a2;
680
- return ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.placeholder) || "\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9";
921
+ return ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.placeholder) || (isHeaderSearchChoice(column) ? "\u8BF7\u9009\u62E9" : "\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9");
681
922
  }
682
923
  function getHeaderSearchWidth(column) {
683
924
  var _a2;
@@ -691,6 +932,156 @@ const _sfc_main$9 = defineComponent({
691
932
  var _a2;
692
933
  return ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.resetText) || "\u91CD\u7F6E";
693
934
  }
935
+ function getHeaderSearchOptions(column) {
936
+ var _a2;
937
+ return ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.options) || column.options || [];
938
+ }
939
+ function getHeaderSearchOptionValue(option, column) {
940
+ var _a2;
941
+ const valueKey = ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.optionValueKey) || column.optionValueKey || "value";
942
+ return normalizeHeaderSearchPrimitiveValue(option[valueKey]);
943
+ }
944
+ function getHeaderSearchOptionLabel(option, column) {
945
+ var _a2;
946
+ const labelKey = ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.optionLabelKey) || column.optionLabelKey || "label";
947
+ const label = option[labelKey];
948
+ return label === void 0 || label === null ? "" : String(label);
949
+ }
950
+ function isHeaderSearchOptionDisabled(option, column) {
951
+ var _a2;
952
+ const disabledKey = ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.optionDisabledKey) || "disabled";
953
+ return Boolean(option[disabledKey]);
954
+ }
955
+ function getHeaderSearchOptionChildren(option, column) {
956
+ var _a2;
957
+ const childrenKey = ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.optionChildrenKey) || "children";
958
+ const children = option[childrenKey];
959
+ return Array.isArray(children) ? children : [];
960
+ }
961
+ function hasHeaderSearchOptionChildren(option, column) {
962
+ return getHeaderSearchOptionChildren(option, column).length > 0;
963
+ }
964
+ function getHeaderSearchSelectLabel(column) {
965
+ const selectedLabels = getHeaderSearchSelectedLabels(column);
966
+ if (!selectedLabels.length) {
967
+ return getHeaderSearchPlaceholder(column);
968
+ }
969
+ return selectedLabels.join("\u3001");
970
+ }
971
+ function getHeaderSearchSelectedLabels(column) {
972
+ const selectedValues = toComparableValues(getHeaderSearchValue(column));
973
+ return selectedValues.map((selectedValue) => {
974
+ const matchedOption = getHeaderSearchOptions(column).find((option) => {
975
+ return String(getHeaderSearchOptionValue(option, column)) === selectedValue;
976
+ });
977
+ return matchedOption ? getHeaderSearchOptionLabel(matchedOption, column) : selectedValue;
978
+ });
979
+ }
980
+ function isHeaderSearchOptionSelected(option, column) {
981
+ const optionValue = String(getHeaderSearchOptionValue(option, column));
982
+ return toComparableValues(getHeaderSearchValue(column)).includes(optionValue);
983
+ }
984
+ function handleHeaderSearchSelectEmpty(column) {
985
+ updateHeaderSearchValue(column, getHeaderSearchEmptyValue(column));
986
+ headerSearchSelectOpen[getHeaderSearchStateKey(column)] = false;
987
+ }
988
+ function handleHeaderSearchSelectValue(column, optionValue) {
989
+ if (!isHeaderSearchMultiple(column)) {
990
+ updateHeaderSearchValue(column, optionValue);
991
+ headerSearchSelectOpen[getHeaderSearchStateKey(column)] = false;
992
+ return;
993
+ }
994
+ const currentValues = Array.isArray(getHeaderSearchValue(column)) ? [...getHeaderSearchValue(column)] : [];
995
+ const comparableValue = String(optionValue);
996
+ const matchedIndex = currentValues.findIndex((item) => String(item) === comparableValue);
997
+ if (matchedIndex >= 0) {
998
+ currentValues.splice(matchedIndex, 1);
999
+ } else {
1000
+ currentValues.push(optionValue);
1001
+ }
1002
+ updateHeaderSearchValue(column, currentValues);
1003
+ }
1004
+ function getHeaderSearchCascaderValue(column) {
1005
+ return normalizeHeaderSearchPathValue(getHeaderSearchValue(column));
1006
+ }
1007
+ function syncHeaderSearchCascaderActivePath(column) {
1008
+ if (!isHeaderSearchCascader(column)) {
1009
+ return;
1010
+ }
1011
+ const stateKey = getHeaderSearchStateKey(column);
1012
+ headerSearchCascaderActivePaths[stateKey] = getHeaderSearchCascaderValue(column);
1013
+ }
1014
+ function getHeaderSearchCascaderActivePath(column) {
1015
+ const stateKey = getHeaderSearchStateKey(column);
1016
+ const activePath = headerSearchCascaderActivePaths[stateKey];
1017
+ if (activePath) {
1018
+ return activePath;
1019
+ }
1020
+ return getHeaderSearchCascaderValue(column);
1021
+ }
1022
+ function getHeaderSearchCascaderColumns(column) {
1023
+ const columns = [];
1024
+ let levelOptions = getHeaderSearchOptions(column);
1025
+ const activePath = getHeaderSearchCascaderActivePath(column);
1026
+ let levelIndex = 0;
1027
+ while (levelOptions.length) {
1028
+ columns.push(levelOptions);
1029
+ const activeValue = activePath[levelIndex];
1030
+ const activeOption = levelOptions.find((option) => {
1031
+ return String(getHeaderSearchOptionValue(option, column)) === String(activeValue);
1032
+ });
1033
+ if (!activeOption) {
1034
+ break;
1035
+ }
1036
+ levelOptions = getHeaderSearchOptionChildren(activeOption, column);
1037
+ levelIndex += 1;
1038
+ }
1039
+ return columns;
1040
+ }
1041
+ function getHeaderSearchCascaderLabel(column) {
1042
+ const path = getHeaderSearchCascaderValue(column);
1043
+ if (!path.length) {
1044
+ return getHeaderSearchPlaceholder(column);
1045
+ }
1046
+ return getHeaderSearchCascaderPathLabels(column, path).join(" / ");
1047
+ }
1048
+ function getHeaderSearchCascaderPathLabels(column, path = getHeaderSearchCascaderValue(column)) {
1049
+ const labels = [];
1050
+ let levelOptions = getHeaderSearchOptions(column);
1051
+ path.forEach((value) => {
1052
+ const matchedOption = levelOptions.find((option) => {
1053
+ return String(getHeaderSearchOptionValue(option, column)) === String(value);
1054
+ });
1055
+ if (!matchedOption) {
1056
+ labels.push(String(value));
1057
+ levelOptions = [];
1058
+ return;
1059
+ }
1060
+ labels.push(getHeaderSearchOptionLabel(matchedOption, column));
1061
+ levelOptions = getHeaderSearchOptionChildren(matchedOption, column);
1062
+ });
1063
+ return labels;
1064
+ }
1065
+ function isHeaderSearchCascaderOptionActive(column, option, levelIndex) {
1066
+ const activePath = getHeaderSearchCascaderActivePath(column);
1067
+ return String(activePath[levelIndex]) === String(getHeaderSearchOptionValue(option, column));
1068
+ }
1069
+ function isHeaderSearchCascaderOptionSelected(column, option, levelIndex) {
1070
+ const selectedPath = getHeaderSearchCascaderValue(column);
1071
+ return String(selectedPath[levelIndex]) === String(getHeaderSearchOptionValue(option, column));
1072
+ }
1073
+ function handleHeaderSearchCascaderOption(column, option, levelIndex) {
1074
+ const stateKey = getHeaderSearchStateKey(column);
1075
+ const optionValue = getHeaderSearchOptionValue(option, column);
1076
+ const nextPath = [
1077
+ ...getHeaderSearchCascaderActivePath(column).slice(0, levelIndex),
1078
+ optionValue
1079
+ ];
1080
+ headerSearchCascaderActivePaths[stateKey] = nextPath;
1081
+ if (!hasHeaderSearchOptionChildren(option, column)) {
1082
+ updateHeaderSearchValue(column, nextPath);
1083
+ }
1084
+ }
694
1085
  async function handleHeaderSearch(column) {
695
1086
  closeHeaderSearch(column);
696
1087
  paginationState.currentPage = 1;
@@ -702,7 +1093,7 @@ const _sfc_main$9 = defineComponent({
702
1093
  applyLocalRows();
703
1094
  }
704
1095
  async function handleHeaderSearchReset(column) {
705
- updateHeaderSearchValue(column, "");
1096
+ updateHeaderSearchValue(column, getHeaderSearchEmptyValue(column));
706
1097
  closeHeaderSearch(column);
707
1098
  paginationState.currentPage = 1;
708
1099
  emitPagination();
@@ -713,8 +1104,9 @@ const _sfc_main$9 = defineComponent({
713
1104
  applyLocalRows();
714
1105
  }
715
1106
  function closeHeaderSearch(column) {
716
- var _a2, _b2;
717
- (_b2 = (_a2 = headerSearchDropdownRefs.value[getHeaderSearchStateKey(column)]) == null ? void 0 : _a2.handleClose) == null ? void 0 : _b2.call(_a2);
1107
+ const stateKey = getHeaderSearchStateKey(column);
1108
+ headerSearchVisible[stateKey] = false;
1109
+ headerSearchSelectOpen[stateKey] = false;
718
1110
  }
719
1111
  function buildHeaderSearchParams() {
720
1112
  return props.columns.reduce((result, column) => {
@@ -722,11 +1114,11 @@ const _sfc_main$9 = defineComponent({
722
1114
  return result;
723
1115
  }
724
1116
  const paramKey = resolveHeaderSearchParamKey(column);
725
- const value = getHeaderSearchValue(column).trim();
726
- if (!paramKey || !value) {
1117
+ const value = getHeaderSearchValue(column);
1118
+ if (!paramKey || !isHeaderSearchValueFilled(value)) {
727
1119
  return result;
728
1120
  }
729
- result[paramKey] = value;
1121
+ result[paramKey] = normalizeHeaderSearchRequestValue(column, value);
730
1122
  return result;
731
1123
  }, {});
732
1124
  }
@@ -739,27 +1131,107 @@ const _sfc_main$9 = defineComponent({
739
1131
  function filterLocalRows(data) {
740
1132
  const activeColumns = props.columns.filter((column) => hasHeaderSearch(column) && hasHeaderSearchValue(column)).map((column) => ({
741
1133
  column,
742
- keyword: getHeaderSearchValue(column).trim().toLowerCase()
1134
+ value: getHeaderSearchValue(column)
743
1135
  }));
744
1136
  if (!activeColumns.length) {
745
1137
  return normalizeRows(data);
746
1138
  }
747
1139
  return normalizeRows(data).filter((row) => {
748
- return activeColumns.every(({ column, keyword }) => {
1140
+ return activeColumns.every(({ column, value: searchValue }) => {
749
1141
  const columnProp = getColumnProp(column);
750
1142
  if (!columnProp) {
751
1143
  return true;
752
1144
  }
753
1145
  const value = getCellValue2(row, column);
754
- return toSearchableText(value).includes(keyword);
1146
+ if (isHeaderSearchSelect(column)) {
1147
+ return matchesHeaderSearchSelectValue(value, searchValue);
1148
+ }
1149
+ if (isHeaderSearchCascader(column)) {
1150
+ return matchesHeaderSearchCascaderValue(value, searchValue);
1151
+ }
1152
+ return toSearchableText(value).includes(toHeaderSearchKeyword(searchValue));
755
1153
  });
756
1154
  });
757
1155
  }
758
- function normalizeHeaderSearchValue(value) {
1156
+ function getHeaderSearchEmptyValue(column) {
1157
+ return isHeaderSearchMultiple(column) || isHeaderSearchCascader(column) ? [] : "";
1158
+ }
1159
+ function normalizeHeaderSearchValue(column, value) {
1160
+ if (isHeaderSearchCascader(column)) {
1161
+ return normalizeHeaderSearchPathValue(value);
1162
+ }
1163
+ if (!isHeaderSearchSelect(column)) {
1164
+ if (value === void 0 || value === null) {
1165
+ return "";
1166
+ }
1167
+ return String(value);
1168
+ }
1169
+ if (isHeaderSearchMultiple(column)) {
1170
+ const values = Array.isArray(value) ? value : [value];
1171
+ return values.filter((item) => isHeaderSearchValueFilled(item)).map((item) => normalizeHeaderSearchPrimitiveValue(item));
1172
+ }
1173
+ if (Array.isArray(value)) {
1174
+ const firstFilledValue = value.find((item) => isHeaderSearchValueFilled(item));
1175
+ return firstFilledValue === void 0 ? "" : normalizeHeaderSearchPrimitiveValue(firstFilledValue);
1176
+ }
759
1177
  if (value === void 0 || value === null) {
760
1178
  return "";
761
1179
  }
762
- return String(value);
1180
+ return normalizeHeaderSearchPrimitiveValue(value);
1181
+ }
1182
+ function normalizeHeaderSearchPrimitiveValue(value) {
1183
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
1184
+ return value;
1185
+ }
1186
+ return String(value != null ? value : "");
1187
+ }
1188
+ function normalizeHeaderSearchPathValue(value) {
1189
+ const values = Array.isArray(value) ? value : [value];
1190
+ return values.filter((item) => !Array.isArray(item) && isHeaderSearchValueFilled(item)).map((item) => normalizeHeaderSearchPrimitiveValue(item));
1191
+ }
1192
+ function normalizeHeaderSearchRequestValue(column, value) {
1193
+ if (Array.isArray(value)) {
1194
+ return [...value];
1195
+ }
1196
+ if (isHeaderSearchSelect(column)) {
1197
+ return value;
1198
+ }
1199
+ return String(value).trim();
1200
+ }
1201
+ function isHeaderSearchValueFilled(value) {
1202
+ if (Array.isArray(value)) {
1203
+ return value.some((item) => isHeaderSearchValueFilled(item));
1204
+ }
1205
+ return value !== void 0 && value !== null && String(value).trim() !== "";
1206
+ }
1207
+ function toHeaderSearchKeyword(value) {
1208
+ if (Array.isArray(value)) {
1209
+ return value.map((item) => String(item).trim()).join(" ").toLowerCase();
1210
+ }
1211
+ return String(value).trim().toLowerCase();
1212
+ }
1213
+ function matchesHeaderSearchSelectValue(rowValue, searchValue) {
1214
+ const selectedValues = toComparableValues(searchValue);
1215
+ if (!selectedValues.length) {
1216
+ return true;
1217
+ }
1218
+ const rowValues = toComparableValues(rowValue);
1219
+ return rowValues.some((item) => selectedValues.includes(item));
1220
+ }
1221
+ function matchesHeaderSearchCascaderValue(rowValue, searchValue) {
1222
+ const selectedPath = normalizeHeaderSearchPathValue(searchValue);
1223
+ if (!selectedPath.length) {
1224
+ return true;
1225
+ }
1226
+ const rowPath = normalizeHeaderSearchPathValue(rowValue);
1227
+ if (!rowPath.length) {
1228
+ return false;
1229
+ }
1230
+ return selectedPath.every((item, index) => String(rowPath[index]) === String(item));
1231
+ }
1232
+ function toComparableValues(value) {
1233
+ const values = Array.isArray(value) ? value : [value];
1234
+ return values.filter((item) => isHeaderSearchValueFilled(item)).map((item) => String(item));
763
1235
  }
764
1236
  function toSearchableText(value) {
765
1237
  if (value === void 0 || value === null) {
@@ -989,7 +1461,7 @@ const _sfc_main$9 = defineComponent({
989
1461
  async function setHeaderSearchValue(key, value, shouldReload = true) {
990
1462
  const matchedColumn = findHeaderSearchColumn(key);
991
1463
  const stateKey = matchedColumn ? getHeaderSearchStateKey(matchedColumn) : key;
992
- headerSearchValues[stateKey] = normalizeHeaderSearchValue(value);
1464
+ headerSearchValues[stateKey] = matchedColumn ? normalizeHeaderSearchValue(matchedColumn, value) : value;
993
1465
  if (!shouldReload) {
994
1466
  return;
995
1467
  }
@@ -1017,9 +1489,11 @@ const _sfc_main$9 = defineComponent({
1017
1489
  Object.keys(headerSearchValues).forEach((stateKey) => {
1018
1490
  delete headerSearchValues[stateKey];
1019
1491
  });
1020
- Object.keys(headerSearchDropdownRefs.value).forEach((stateKey) => {
1021
- var _a2, _b2;
1022
- (_b2 = (_a2 = headerSearchDropdownRefs.value[stateKey]) == null ? void 0 : _a2.handleClose) == null ? void 0 : _b2.call(_a2);
1492
+ Object.keys(headerSearchVisible).forEach((stateKey) => {
1493
+ headerSearchVisible[stateKey] = false;
1494
+ });
1495
+ Object.keys(headerSearchSelectOpen).forEach((stateKey) => {
1496
+ headerSearchSelectOpen[stateKey] = false;
1023
1497
  });
1024
1498
  }
1025
1499
  paginationState.currentPage = 1;
@@ -1050,20 +1524,109 @@ const _sfc_main$9 = defineComponent({
1050
1524
  const _component_el_pagination = resolveComponent("el-pagination");
1051
1525
  const _component_el_empty = resolveComponent("el-empty");
1052
1526
  const _component_el_table_column = resolveComponent("el-table-column");
1053
- const _component_el_input = resolveComponent("el-input");
1054
1527
  const _component_el_button = resolveComponent("el-button");
1055
- const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
1056
- const _component_el_dropdown = resolveComponent("el-dropdown");
1057
1528
  const _component_el_image = resolveComponent("el-image");
1058
1529
  const _component_el_tag = resolveComponent("el-tag");
1530
+ const _component_el_input = resolveComponent("el-input");
1059
1531
  const _component_el_table = resolveComponent("el-table");
1060
1532
  const _directive_loading = resolveDirective("loading");
1061
- return openBlock(), createElementBlock("div", _hoisted_1$2, [
1062
- shouldRenderToolbar.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
1063
- createElementVNode("div", _hoisted_3, [
1533
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [
1534
+ (openBlock(), createElementBlock("svg", _hoisted_2$7, [
1535
+ createElementVNode("symbol", {
1536
+ id: `${baseTableIconPrefix}-search`,
1537
+ viewBox: "0 0 17.814 14.035"
1538
+ }, [..._cache[2] || (_cache[2] = [
1539
+ createElementVNode("path", {
1540
+ fill: "currentColor",
1541
+ d: "M172.218,201.2a5.254,5.254,0,1,0-1.057.786l2.85,3.721a.659.659,0,0,0,1.047-.8l-2.841-3.709Zm-7.7-3.8a4.056,4.056,0,1,1,4.055,4.044,4.054,4.054,0,0,1-4.055-4.044Zm-2.554-3.968h-3.954a.657.657,0,1,1,0-1.313h3.952a.657.657,0,1,1,0,1.313Zm-.159,8.751h-3.8a.656.656,0,1,1,0-1.312h3.793a.656.656,0,1,1,0,1.312Zm-.78-3.958h-3.016a.659.659,0,1,1,0-1.319h3.015a.659.659,0,1,1,0,1.319Zm4.246,7.929h-7.261a.659.659,0,0,1,0-1.319h7.261a.659.659,0,1,1,0,1.319Z",
1542
+ transform: "translate(-157.354 -192.113)"
1543
+ }, null, -1)
1544
+ ])], 8, _hoisted_3$2),
1545
+ createElementVNode("symbol", {
1546
+ id: `${baseTableIconPrefix}-search-y`,
1547
+ viewBox: "0 0 17.814 14.035"
1548
+ }, [..._cache[3] || (_cache[3] = [
1549
+ createElementVNode("path", {
1550
+ fill: "#0938f7",
1551
+ d: "M172.218,201.2a5.254,5.254,0,1,0-1.057.786l2.85,3.721a.659.659,0,0,0,1.047-.8l-2.841-3.709Zm-7.7-3.8a4.056,4.056,0,1,1,4.055,4.044,4.054,4.054,0,0,1-4.055-4.044Zm-2.554-3.968h-3.954a.657.657,0,1,1,0-1.313h3.952a.657.657,0,1,1,0,1.313Zm-.159,8.751h-3.8a.656.656,0,1,1,0-1.312h3.793a.656.656,0,1,1,0,1.312Zm-.78-3.958h-3.016a.659.659,0,1,1,0-1.319h3.015a.659.659,0,1,1,0,1.319Zm4.246,7.929h-7.261a.659.659,0,0,1,0-1.319h7.261a.659.659,0,1,1,0,1.319Z",
1552
+ transform: "translate(-157.354 -192.113)"
1553
+ }, null, -1)
1554
+ ])], 8, _hoisted_4$1),
1555
+ createElementVNode("symbol", {
1556
+ id: `${baseTableIconPrefix}-select`,
1557
+ viewBox: "0 0 16.04 12.653"
1558
+ }, [..._cache[4] || (_cache[4] = [
1559
+ createElementVNode("path", {
1560
+ fill: "currentColor",
1561
+ d: "M0,12.653V11.248H11.792v1.406ZM9.328,4.429H16.04l-3.356,3.8ZM0,7.029V5.624H7.823V7.029ZM0,1.406V0H14.5V1.406Z"
1562
+ }, null, -1)
1563
+ ])], 8, _hoisted_5$1),
1564
+ createElementVNode("symbol", {
1565
+ id: `${baseTableIconPrefix}-select-y`,
1566
+ viewBox: "0 0 16.04 12.653"
1567
+ }, [..._cache[5] || (_cache[5] = [
1568
+ createElementVNode("path", {
1569
+ fill: "#0938f7",
1570
+ d: "M0,12.653V11.248H11.792v1.406ZM9.328,4.429H16.04l-3.356,3.8ZM0,7.029V5.624H7.823V7.029ZM0,1.406V0H14.5V1.406Z"
1571
+ }, null, -1)
1572
+ ])], 8, _hoisted_6),
1573
+ createElementVNode("symbol", {
1574
+ id: `${baseTableIconPrefix}-sort-none`,
1575
+ viewBox: "0 0 15.351 16.031"
1576
+ }, [..._cache[6] || (_cache[6] = [
1577
+ createElementVNode("g", { transform: "translate(-1299.19 -185.182)" }, [
1578
+ createElementVNode("path", {
1579
+ fill: "currentColor",
1580
+ d: "M100.721,140.352l-3.679,3.679-3.679-3.679h2.944v-8.831h1.472v8.831h2.944Z",
1581
+ transform: "translate(1213.82 57.182)"
1582
+ }),
1583
+ createElementVNode("path", {
1584
+ fill: "currentColor",
1585
+ d: "M92.692,131.679H89.749v8.831H88.277v-8.831H85.333L89.013,128l3.679,3.679Z",
1586
+ transform: "translate(1213.856 57.182)"
1587
+ })
1588
+ ], -1)
1589
+ ])], 8, _hoisted_7),
1590
+ createElementVNode("symbol", {
1591
+ id: `${baseTableIconPrefix}-sort-up`,
1592
+ viewBox: "0 0 15.351 16.031"
1593
+ }, [..._cache[7] || (_cache[7] = [
1594
+ createElementVNode("g", { transform: "translate(-1299.19 -185.182)" }, [
1595
+ createElementVNode("path", {
1596
+ fill: "#8c8c8c",
1597
+ d: "M100.721,140.352l-3.679,3.679-3.679-3.679h2.944v-8.831h1.472v8.831h2.944Z",
1598
+ transform: "translate(1213.82 57.182)"
1599
+ }),
1600
+ createElementVNode("path", {
1601
+ fill: "#0938f7",
1602
+ d: "M92.692,131.679H89.749v8.831H88.277v-8.831H85.333L89.013,128l3.679,3.679Z",
1603
+ transform: "translate(1213.856 57.182)"
1604
+ })
1605
+ ], -1)
1606
+ ])], 8, _hoisted_8),
1607
+ createElementVNode("symbol", {
1608
+ id: `${baseTableIconPrefix}-sort-down`,
1609
+ viewBox: "0 0 15.351 16.031"
1610
+ }, [..._cache[8] || (_cache[8] = [
1611
+ createElementVNode("g", { transform: "translate(-1299.19 -185.182)" }, [
1612
+ createElementVNode("path", {
1613
+ fill: "#0938f7",
1614
+ d: "M100.721,140.352l-3.679,3.679-3.679-3.679h2.944v-8.831h1.472v8.831h2.944Z",
1615
+ transform: "translate(1213.82 57.182)"
1616
+ }),
1617
+ createElementVNode("path", {
1618
+ fill: "#8c8c8c",
1619
+ d: "M92.692,131.679H89.749v8.831H88.277v-8.831H85.333L89.013,128l3.679,3.679Z",
1620
+ transform: "translate(1213.856 57.182)"
1621
+ })
1622
+ ], -1)
1623
+ ])], 8, _hoisted_9)
1624
+ ])),
1625
+ shouldRenderToolbar.value ? (openBlock(), createElementBlock("div", _hoisted_10, [
1626
+ createElementVNode("div", _hoisted_11, [
1064
1627
  renderSlot(_ctx.$slots, "toolbar", {}, void 0, true)
1065
1628
  ]),
1066
- __props.showPagination ? (openBlock(), createElementBlock("div", _hoisted_4, [
1629
+ __props.showPagination ? (openBlock(), createElementBlock("div", _hoisted_12, [
1067
1630
  createVNode(_component_el_pagination, {
1068
1631
  small: "",
1069
1632
  background: "",
@@ -1135,7 +1698,7 @@ const _sfc_main$9 = defineComponent({
1135
1698
  columnIndex: scope.$index,
1136
1699
  value: getCellValue2(scope.row, column)
1137
1700
  }, void 0, true) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1138
- isActionColumn(column) ? (openBlock(), createElementBlock("div", _hoisted_9, [
1701
+ isActionColumn(column) ? (openBlock(), createElementBlock("div", _hoisted_33, [
1139
1702
  (openBlock(true), createElementBlock(Fragment, null, renderList(getVisibleActions(column, scope.row), (action) => {
1140
1703
  return openBlock(), createBlock(_component_el_button, {
1141
1704
  key: `${action.type}-${action.label}`,
@@ -1157,7 +1720,7 @@ const _sfc_main$9 = defineComponent({
1157
1720
  src: toImageSrc(getCellValue2(scope.row, column)),
1158
1721
  "preview-src-list": getPreviewSrcList(scope.row, column),
1159
1722
  fit: column.imageFit || "cover"
1160
- }, null, 8, ["style", "src", "preview-src-list", "fit"])) : column.kind === "tag" ? (openBlock(), createElementBlock("div", _hoisted_10, [
1723
+ }, null, 8, ["style", "src", "preview-src-list", "fit"])) : column.kind === "tag" ? (openBlock(), createElementBlock("div", _hoisted_34, [
1161
1724
  getMatchedOptions(scope.row, column).length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(getMatchedOptions(scope.row, column), (option) => {
1162
1725
  return openBlock(), createBlock(_component_el_tag, {
1163
1726
  key: String(option.value),
@@ -1170,11 +1733,11 @@ const _sfc_main$9 = defineComponent({
1170
1733
  ]),
1171
1734
  _: 2
1172
1735
  }, 1032, ["type", "style"]);
1173
- }), 128)) : (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString(resolveEmptyText(column)), 1))
1736
+ }), 128)) : (openBlock(), createElementBlock("span", _hoisted_35, toDisplayString(resolveEmptyText(column)), 1))
1174
1737
  ])) : column.kind === "html" ? (openBlock(), createElementBlock("div", {
1175
1738
  key: 3,
1176
1739
  innerHTML: getHtmlContent(scope.row, column)
1177
- }, null, 8, _hoisted_12)) : column.kind === "input" ? (openBlock(), createBlock(_component_el_input, {
1740
+ }, null, 8, _hoisted_36)) : column.kind === "input" ? (openBlock(), createBlock(_component_el_input, {
1178
1741
  key: 4,
1179
1742
  "model-value": toDisplayValue(getCellValue2(scope.row, column), ""),
1180
1743
  type: column.inputType || "text",
@@ -1184,7 +1747,7 @@ const _sfc_main$9 = defineComponent({
1184
1747
  class: "base-table__link",
1185
1748
  type: "button",
1186
1749
  onClick: ($event) => handleCellClick(scope.row, column)
1187
- }, toDisplayString(formatCellDisplay(scope.row, column)), 9, _hoisted_13)) : (openBlock(), createElementBlock("div", _hoisted_14, toDisplayString(formatCellDisplay(scope.row, column)), 1))
1750
+ }, toDisplayString(formatCellDisplay(scope.row, column)), 9, _hoisted_37)) : (openBlock(), createElementBlock("div", _hoisted_38, toDisplayString(formatCellDisplay(scope.row, column)), 1))
1188
1751
  ], 64))
1189
1752
  ]),
1190
1753
  _: 2
@@ -1198,75 +1761,167 @@ const _sfc_main$9 = defineComponent({
1198
1761
  } : shouldRenderBuiltInHeader(column) ? {
1199
1762
  name: "header",
1200
1763
  fn: withCtx(() => [
1201
- createElementVNode("div", _hoisted_5, [
1202
- createElementVNode("span", _hoisted_6, toDisplayString(column.label), 1),
1203
- createElementVNode("div", _hoisted_7, [
1204
- createVNode(_component_el_dropdown, {
1764
+ createElementVNode("div", {
1765
+ class: normalizeClass(["base-table__header", [
1766
+ `base-table__header--${resolveHeaderContentAlign(column)}`,
1767
+ {
1768
+ "base-table__header--has-actions": hasHeaderSearch(column),
1769
+ "base-table__header--has-sort": isHeaderSortable(column)
1770
+ }
1771
+ ]])
1772
+ }, [
1773
+ createElementVNode("span", _hoisted_13, [
1774
+ createElementVNode("span", _hoisted_14, toDisplayString(column.label), 1),
1775
+ isHeaderSortable(column) ? (openBlock(), createElementBlock("span", {
1776
+ key: 0,
1777
+ class: normalizeClass(["base-table__header-sort", { "is-active": isHeaderSortActive(column) }]),
1778
+ "aria-hidden": "true"
1779
+ }, [
1780
+ createVNode(unref(SvgIcon), {
1781
+ prefix: baseTableIconPrefix,
1782
+ "icon-class": getHeaderSortIconName(column),
1783
+ "class-name": "base-table__header-sort-icon"
1784
+ }, null, 8, ["icon-class"])
1785
+ ], 2)) : createCommentVNode("", true)
1786
+ ]),
1787
+ hasHeaderSearch(column) ? (openBlock(), createElementBlock("div", _hoisted_15, [
1788
+ createElementVNode("button", {
1205
1789
  ref_for: true,
1206
- ref: bindHeaderSearchDropdown(column),
1207
- class: "base-table__header-dropdown",
1208
- trigger: "click",
1209
- "hide-on-click": false,
1210
- placement: "bottom",
1211
- "popper-class": "base-table__header-search-dropdown"
1212
- }, {
1213
- dropdown: withCtx(() => [
1214
- createVNode(_component_el_dropdown_menu, { class: "base-table__header-search-menu" }, {
1215
- default: withCtx(() => [
1216
- createElementVNode("div", {
1217
- class: "base-table__header-search-panel",
1218
- style: normalizeStyle({ width: toCssValue(getHeaderSearchWidth(column)) || "280px" }),
1219
- onClick: _cache[0] || (_cache[0] = withModifiers(() => {
1220
- }, ["stop"]))
1221
- }, [
1222
- createVNode(_component_el_input, {
1223
- "model-value": getHeaderSearchValue(column),
1224
- placeholder: getHeaderSearchPlaceholder(column),
1225
- clearable: "",
1226
- "onUpdate:modelValue": ($event) => updateHeaderSearchValue(column, $event),
1227
- onKeyup: withKeys(($event) => handleHeaderSearch(column), ["enter"])
1228
- }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue", "onKeyup"]),
1229
- createElementVNode("div", _hoisted_8, [
1230
- createVNode(_component_el_button, {
1231
- link: "",
1232
- type: "primary",
1233
- onClick: ($event) => handleHeaderSearch(column)
1234
- }, {
1235
- default: withCtx(() => [
1236
- createTextVNode(toDisplayString(getHeaderSearchSearchText(column)), 1)
1237
- ]),
1238
- _: 2
1239
- }, 1032, ["onClick"]),
1240
- createVNode(_component_el_button, {
1241
- link: "",
1242
- onClick: ($event) => handleHeaderSearchReset(column)
1243
- }, {
1244
- default: withCtx(() => [
1245
- createTextVNode(toDisplayString(getHeaderSearchResetText(column)), 1)
1246
- ]),
1247
- _: 2
1248
- }, 1032, ["onClick"])
1249
- ])
1250
- ], 4)
1251
- ]),
1252
- _: 2
1253
- }, 1024)
1254
- ]),
1255
- default: withCtx(() => [
1256
- createElementVNode("button", {
1257
- class: normalizeClass(["base-table__header-icon", { "is-active": hasHeaderSearchValue(column) }]),
1258
- type: "button"
1259
- }, [..._cache[1] || (_cache[1] = [
1260
- createElementVNode("span", {
1261
- class: "base-table__header-icon-mark",
1262
- "aria-hidden": "true"
1263
- }, null, -1)
1264
- ])], 2)
1265
- ]),
1266
- _: 2
1267
- }, 1536)
1268
- ])
1269
- ])
1790
+ ref: bindHeaderSearchTrigger(column),
1791
+ class: normalizeClass(["base-table__header-icon", { "is-active": hasHeaderSearchValue(column) }]),
1792
+ type: "button",
1793
+ onClick: withModifiers(($event) => toggleHeaderSearch(column), ["stop"])
1794
+ }, [
1795
+ createVNode(unref(SvgIcon), {
1796
+ prefix: baseTableIconPrefix,
1797
+ "icon-class": getHeaderSearchIconName(column),
1798
+ "class-name": "base-table__header-search-icon"
1799
+ }, null, 8, ["icon-class"])
1800
+ ], 10, _hoisted_16),
1801
+ (openBlock(), createBlock(Teleport, { to: "body" }, [
1802
+ isHeaderSearchVisible(column) ? (openBlock(), createElementBlock("div", {
1803
+ key: getHeaderSearchStateKey(column),
1804
+ class: "base-table__header-search-panel",
1805
+ style: normalizeStyle(getHeaderSearchPanelStyle(column)),
1806
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
1807
+ }, ["stop"])),
1808
+ onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {
1809
+ }, ["stop"]))
1810
+ }, [
1811
+ isHeaderSearchSelect(column) ? (openBlock(), createElementBlock("div", _hoisted_17, [
1812
+ createElementVNode("button", {
1813
+ class: "base-table__header-select-trigger",
1814
+ type: "button",
1815
+ onClick: ($event) => toggleHeaderSearchSelect(column)
1816
+ }, [
1817
+ isHeaderSearchMultiple(column) && getHeaderSearchSelectedLabels(column).length ? (openBlock(), createElementBlock("span", _hoisted_19, [
1818
+ (openBlock(true), createElementBlock(Fragment, null, renderList(getHeaderSearchSelectedLabels(column).slice(0, 2), (label) => {
1819
+ return openBlock(), createElementBlock("span", {
1820
+ key: label,
1821
+ class: "base-table__header-select-tag"
1822
+ }, toDisplayString(label), 1);
1823
+ }), 128)),
1824
+ getHeaderSearchSelectedLabels(column).length > 2 ? (openBlock(), createElementBlock("span", _hoisted_20, " +" + toDisplayString(getHeaderSearchSelectedLabels(column).length - 2), 1)) : createCommentVNode("", true)
1825
+ ])) : (openBlock(), createElementBlock("span", {
1826
+ key: 1,
1827
+ class: normalizeClass(["base-table__header-select-text", { "is-placeholder": !hasHeaderSearchValue(column) }])
1828
+ }, toDisplayString(getHeaderSearchSelectLabel(column)), 3)),
1829
+ createElementVNode("span", {
1830
+ class: normalizeClass(["base-table__header-select-arrow", { "is-open": isHeaderSearchSelectOpen(column) }]),
1831
+ "aria-hidden": "true"
1832
+ }, null, 2)
1833
+ ], 8, _hoisted_18),
1834
+ isHeaderSearchSelectOpen(column) ? (openBlock(), createElementBlock("div", _hoisted_21, [
1835
+ !isHeaderSearchMultiple(column) ? (openBlock(), createElementBlock("button", {
1836
+ key: 0,
1837
+ class: normalizeClass(["base-table__header-select-option", { "is-selected": !hasHeaderSearchValue(column) }]),
1838
+ type: "button",
1839
+ onClick: ($event) => handleHeaderSearchSelectEmpty(column)
1840
+ }, toDisplayString(getHeaderSearchPlaceholder(column)), 11, _hoisted_22)) : createCommentVNode("", true),
1841
+ (openBlock(true), createElementBlock(Fragment, null, renderList(getHeaderSearchOptions(column), (option) => {
1842
+ return openBlock(), createElementBlock("button", {
1843
+ key: String(getHeaderSearchOptionValue(option, column)),
1844
+ class: normalizeClass(["base-table__header-select-option", { "is-selected": isHeaderSearchOptionSelected(option, column) }]),
1845
+ type: "button",
1846
+ disabled: isHeaderSearchOptionDisabled(option, column),
1847
+ onClick: ($event) => handleHeaderSearchSelectValue(column, getHeaderSearchOptionValue(option, column))
1848
+ }, [
1849
+ createElementVNode("span", _hoisted_24, toDisplayString(getHeaderSearchOptionLabel(option, column)), 1)
1850
+ ], 10, _hoisted_23);
1851
+ }), 128))
1852
+ ])) : createCommentVNode("", true)
1853
+ ])) : isHeaderSearchCascader(column) ? (openBlock(), createElementBlock("div", _hoisted_25, [
1854
+ createElementVNode("button", {
1855
+ class: "base-table__header-select-trigger",
1856
+ type: "button",
1857
+ onClick: ($event) => toggleHeaderSearchSelect(column)
1858
+ }, [
1859
+ createElementVNode("span", {
1860
+ class: normalizeClass(["base-table__header-select-text", { "is-placeholder": !hasHeaderSearchValue(column) }])
1861
+ }, toDisplayString(getHeaderSearchCascaderLabel(column)), 3),
1862
+ createElementVNode("span", {
1863
+ class: normalizeClass(["base-table__header-select-arrow", { "is-open": isHeaderSearchSelectOpen(column) }]),
1864
+ "aria-hidden": "true"
1865
+ }, null, 2)
1866
+ ], 8, _hoisted_26),
1867
+ isHeaderSearchSelectOpen(column) ? (openBlock(), createElementBlock("div", _hoisted_27, [
1868
+ (openBlock(true), createElementBlock(Fragment, null, renderList(getHeaderSearchCascaderColumns(column), (levelOptions, levelIndex) => {
1869
+ return openBlock(), createElementBlock("div", {
1870
+ key: levelIndex,
1871
+ class: "base-table__header-cascader-menu"
1872
+ }, [
1873
+ (openBlock(true), createElementBlock(Fragment, null, renderList(levelOptions, (option) => {
1874
+ return openBlock(), createElementBlock("button", {
1875
+ key: `${levelIndex}-${String(getHeaderSearchOptionValue(option, column))}`,
1876
+ class: normalizeClass(["base-table__header-cascader-option", {
1877
+ "is-active": isHeaderSearchCascaderOptionActive(column, option, levelIndex),
1878
+ "is-selected": isHeaderSearchCascaderOptionSelected(column, option, levelIndex)
1879
+ }]),
1880
+ type: "button",
1881
+ disabled: isHeaderSearchOptionDisabled(option, column),
1882
+ onClick: ($event) => handleHeaderSearchCascaderOption(column, option, levelIndex)
1883
+ }, [
1884
+ createElementVNode("span", _hoisted_29, toDisplayString(getHeaderSearchOptionLabel(option, column)), 1),
1885
+ hasHeaderSearchOptionChildren(option, column) ? (openBlock(), createElementBlock("span", _hoisted_30)) : createCommentVNode("", true)
1886
+ ], 10, _hoisted_28);
1887
+ }), 128))
1888
+ ]);
1889
+ }), 128))
1890
+ ])) : createCommentVNode("", true)
1891
+ ])) : (openBlock(), createElementBlock("input", {
1892
+ key: 2,
1893
+ class: "base-table__header-search-input",
1894
+ type: "text",
1895
+ value: getHeaderSearchInputValue(column),
1896
+ placeholder: getHeaderSearchPlaceholder(column),
1897
+ onInput: ($event) => handleHeaderSearchInput(column, $event),
1898
+ onKeyup: withKeys(($event) => handleHeaderSearch(column), ["enter"])
1899
+ }, null, 40, _hoisted_31)),
1900
+ createElementVNode("div", _hoisted_32, [
1901
+ createVNode(_component_el_button, {
1902
+ link: "",
1903
+ type: "primary",
1904
+ onClick: ($event) => handleHeaderSearch(column)
1905
+ }, {
1906
+ default: withCtx(() => [
1907
+ createTextVNode(toDisplayString(getHeaderSearchSearchText(column)), 1)
1908
+ ]),
1909
+ _: 2
1910
+ }, 1032, ["onClick"]),
1911
+ createVNode(_component_el_button, {
1912
+ link: "",
1913
+ onClick: ($event) => handleHeaderSearchReset(column)
1914
+ }, {
1915
+ default: withCtx(() => [
1916
+ createTextVNode(toDisplayString(getHeaderSearchResetText(column)), 1)
1917
+ ]),
1918
+ _: 2
1919
+ }, 1032, ["onClick"])
1920
+ ])
1921
+ ], 36)) : createCommentVNode("", true)
1922
+ ]))
1923
+ ])) : createCommentVNode("", true)
1924
+ ], 2)
1270
1925
  ]),
1271
1926
  key: "1"
1272
1927
  } : void 0
@@ -1281,7 +1936,7 @@ const _sfc_main$9 = defineComponent({
1281
1936
  };
1282
1937
  }
1283
1938
  });
1284
- var BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-7ae8d382"]]);
1939
+ var BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-20fa814c"]]);
1285
1940
  var BaseEChart_vue_vue_type_style_index_0_scoped_true_lang = "";
1286
1941
  const _sfc_main$8 = defineComponent({
1287
1942
  __name: "BaseEChart",
@@ -1877,7 +2532,15 @@ const _sfc_main$7 = defineComponent({
1877
2532
  }
1878
2533
  });
1879
2534
  var OutlinedInput_vue_vue_type_style_index_0_scoped_true_lang = "";
1880
- const _hoisted_1$1 = { class: "outlined-input__suffix-text" };
2535
+ const _hoisted_1$6 = { class: "outlined-input__suffix-text" };
2536
+ const _hoisted_2$6 = {
2537
+ key: 0,
2538
+ class: "outlined-input__required"
2539
+ };
2540
+ const _hoisted_3$1 = {
2541
+ key: 1,
2542
+ class: "outlined-input__error"
2543
+ };
1881
2544
  const _sfc_main$6 = defineComponent({
1882
2545
  ...{
1883
2546
  name: "OutlinedInput",
@@ -1902,7 +2565,10 @@ const _sfc_main$6 = defineComponent({
1902
2565
  clearable: { type: Boolean, default: false },
1903
2566
  showWordLimit: { type: Boolean, default: true },
1904
2567
  marginBottom: { default: 20 },
1905
- paddingTop: { default: 20 }
2568
+ paddingTop: { default: 20 },
2569
+ required: { type: Boolean, default: false },
2570
+ error: { type: Boolean, default: false },
2571
+ errorMessage: { default: "" }
1906
2572
  },
1907
2573
  emits: ["input", "update:value", "warning", "focus", "blur", "change", "clear"],
1908
2574
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -1934,6 +2600,7 @@ const _sfc_main$6 = defineComponent({
1934
2600
  });
1935
2601
  const containerClasses = computed(() => ({
1936
2602
  "outlined-input--bordered": props.isBorder,
2603
+ "outlined-input--error": hasError.value,
1937
2604
  "outlined-input--textarea-default": resolvedType.value === "textarea" && !hasTextareaAutosize.value
1938
2605
  }));
1939
2606
  const containerStyle = computed(() => ({
@@ -1949,6 +2616,9 @@ const _sfc_main$6 = defineComponent({
1949
2616
  };
1950
2617
  });
1951
2618
  const floatingLabel = computed(() => props.label || props.placeholder || "");
2619
+ const controlPlaceholder = computed(() => addRequiredMark(props.placeholder));
2620
+ const hasError = computed(() => Boolean(props.error));
2621
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
1952
2622
  const hasContent = computed(() => hasFilledValue(inputValue.value));
1953
2623
  const labelClasses = computed(() => ({
1954
2624
  "outlined-input__label--floating": focused.value || hasContent.value,
@@ -2006,6 +2676,15 @@ const _sfc_main$6 = defineComponent({
2006
2676
  }
2007
2677
  return value;
2008
2678
  }
2679
+ function addRequiredMark(value) {
2680
+ if (!props.required || !value || value.startsWith("*")) {
2681
+ return value;
2682
+ }
2683
+ return `*${value}`;
2684
+ }
2685
+ function createRequiredMessage(label) {
2686
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
2687
+ }
2009
2688
  __expose({
2010
2689
  focus: () => {
2011
2690
  var _a2;
@@ -2037,7 +2716,7 @@ const _sfc_main$6 = defineComponent({
2037
2716
  }, inputAttrs.value, {
2038
2717
  "model-value": inputValue.value,
2039
2718
  type: resolvedType.value,
2040
- placeholder: __props.placeholder,
2719
+ placeholder: controlPlaceholder.value,
2041
2720
  disabled: __props.disabled,
2042
2721
  maxlength: __props.maxlength,
2043
2722
  max: __props.max,
@@ -2046,6 +2725,7 @@ const _sfc_main$6 = defineComponent({
2046
2725
  "show-word-limit": __props.showWordLimit,
2047
2726
  clearable: __props.clearable,
2048
2727
  style: inputStyle.value,
2728
+ "aria-invalid": hasError.value ? "true" : void 0,
2049
2729
  "onUpdate:modelValue": handleModelValueUpdate,
2050
2730
  onFocus: handleFocus,
2051
2731
  onBlur: handleBlur,
@@ -2077,22 +2757,34 @@ const _sfc_main$6 = defineComponent({
2077
2757
  name: "suffix",
2078
2758
  fn: withCtx(() => [
2079
2759
  renderSlot(_ctx.$slots, "suffix", {}, () => [
2080
- createElementVNode("span", _hoisted_1$1, toDisplayString(__props.suffixText), 1)
2760
+ createElementVNode("span", _hoisted_1$6, toDisplayString(__props.suffixText), 1)
2081
2761
  ], true)
2082
2762
  ]),
2083
2763
  key: "3"
2084
2764
  } : void 0
2085
- ]), 1040, ["model-value", "type", "placeholder", "disabled", "maxlength", "max", "min", "show-password", "show-word-limit", "clearable", "style"]),
2765
+ ]), 1040, ["model-value", "type", "placeholder", "disabled", "maxlength", "max", "min", "show-password", "show-word-limit", "clearable", "style", "aria-invalid"]),
2086
2766
  floatingLabel.value ? (openBlock(), createElementBlock("div", {
2087
2767
  key: 0,
2088
2768
  class: normalizeClass(["outlined-input__label", labelClasses.value])
2089
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
2769
+ }, [
2770
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_2$6, "*")) : createCommentVNode("", true),
2771
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
2772
+ ], 2)) : createCommentVNode("", true),
2773
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_3$1, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
2090
2774
  ], 6);
2091
2775
  };
2092
2776
  }
2093
2777
  });
2094
- var OutlinedInput = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-2bf89ccd"]]);
2778
+ var OutlinedInput = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-3c232c9a"]]);
2095
2779
  var OutlinedSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
2780
+ const _hoisted_1$5 = {
2781
+ key: 0,
2782
+ class: "outlined-select__required"
2783
+ };
2784
+ const _hoisted_2$5 = {
2785
+ key: 1,
2786
+ class: "outlined-select__error"
2787
+ };
2096
2788
  const _sfc_main$5 = defineComponent({
2097
2789
  ...{
2098
2790
  name: "OutlinedSelect",
@@ -2119,7 +2811,10 @@ const _sfc_main$5 = defineComponent({
2119
2811
  noCheck: { type: Boolean, default: false },
2120
2812
  maxCollapseTags: { default: 5 },
2121
2813
  marginBottom: { default: 20 },
2122
- paddingTop: { default: 20 }
2814
+ paddingTop: { default: 20 },
2815
+ required: { type: Boolean, default: false },
2816
+ error: { type: Boolean, default: false },
2817
+ errorMessage: { default: "" }
2123
2818
  },
2124
2819
  emits: ["input", "update:value", "change", "focus", "blur", "visible-change", "clear"],
2125
2820
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -2146,7 +2841,8 @@ const _sfc_main$5 = defineComponent({
2146
2841
  return rest;
2147
2842
  });
2148
2843
  const containerClasses = computed(() => ({
2149
- "outlined-select--bordered": props.isBorder
2844
+ "outlined-select--bordered": props.isBorder,
2845
+ "outlined-select--error": hasError.value
2150
2846
  }));
2151
2847
  const containerStyle = computed(() => ({
2152
2848
  marginBottom: toCssValue(props.marginBottom),
@@ -2157,6 +2853,9 @@ const _sfc_main$5 = defineComponent({
2157
2853
  height: props.multiple ? "auto" : `${props.inputHeight}px`
2158
2854
  }));
2159
2855
  const floatingLabel = computed(() => props.label || props.placeholder || "");
2856
+ const controlPlaceholder = computed(() => addRequiredMark(props.placeholder));
2857
+ const hasError = computed(() => Boolean(props.error));
2858
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
2160
2859
  const hasCustomOptionsSlot = computed(() => Boolean(slots.default));
2161
2860
  const hasContent = computed(() => {
2162
2861
  if (props.multiple) {
@@ -2240,6 +2939,15 @@ const _sfc_main$5 = defineComponent({
2240
2939
  }
2241
2940
  return value;
2242
2941
  }
2942
+ function addRequiredMark(value) {
2943
+ if (!props.required || !value || value.startsWith("*")) {
2944
+ return value;
2945
+ }
2946
+ return `*${value}`;
2947
+ }
2948
+ function createRequiredMessage(label) {
2949
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
2950
+ }
2243
2951
  __expose({
2244
2952
  focus: () => {
2245
2953
  var _a, _b;
@@ -2283,7 +2991,7 @@ const _sfc_main$5 = defineComponent({
2283
2991
  }, selectAttrs.value, {
2284
2992
  class: "outlined-select__control",
2285
2993
  "model-value": selectValue.value,
2286
- placeholder: __props.placeholder,
2994
+ placeholder: controlPlaceholder.value,
2287
2995
  disabled: __props.disabled,
2288
2996
  multiple: __props.multiple,
2289
2997
  filterable: __props.filterable,
@@ -2292,6 +3000,7 @@ const _sfc_main$5 = defineComponent({
2292
3000
  "collapse-tags-tooltip": __props.collapseTagsTooltip,
2293
3001
  "max-collapse-tags": __props.maxCollapseTags,
2294
3002
  style: selectStyle.value,
3003
+ "aria-invalid": hasError.value ? "true" : void 0,
2295
3004
  "onUpdate:modelValue": handleModelValueUpdate,
2296
3005
  onFocus: handleFocus,
2297
3006
  onBlur: handleBlur,
@@ -2322,17 +3031,29 @@ const _sfc_main$5 = defineComponent({
2322
3031
  }), 128))
2323
3032
  ]),
2324
3033
  _: 3
2325
- }, 16, ["model-value", "placeholder", "disabled", "multiple", "filterable", "clearable", "collapse-tags", "collapse-tags-tooltip", "max-collapse-tags", "style"]),
3034
+ }, 16, ["model-value", "placeholder", "disabled", "multiple", "filterable", "clearable", "collapse-tags", "collapse-tags-tooltip", "max-collapse-tags", "style", "aria-invalid"]),
2326
3035
  floatingLabel.value ? (openBlock(), createElementBlock("div", {
2327
3036
  key: 0,
2328
3037
  class: normalizeClass(["outlined-select__label", labelClasses.value])
2329
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
3038
+ }, [
3039
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_1$5, "*")) : createCommentVNode("", true),
3040
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
3041
+ ], 2)) : createCommentVNode("", true),
3042
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_2$5, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
2330
3043
  ], 6);
2331
3044
  };
2332
3045
  }
2333
3046
  });
2334
- var OutlinedSelect = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-7bd2b5f2"]]);
3047
+ var OutlinedSelect = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-2a354461"]]);
2335
3048
  var OutlinedDatePicker_vue_vue_type_style_index_0_scoped_true_lang = "";
3049
+ const _hoisted_1$4 = {
3050
+ key: 0,
3051
+ class: "outlined-date-picker__required"
3052
+ };
3053
+ const _hoisted_2$4 = {
3054
+ key: 1,
3055
+ class: "outlined-date-picker__error"
3056
+ };
2336
3057
  const _sfc_main$4 = defineComponent({
2337
3058
  ...{
2338
3059
  name: "OutlinedDatePicker",
@@ -2354,7 +3075,10 @@ const _sfc_main$4 = defineComponent({
2354
3075
  isBorder: { type: Boolean, default: false },
2355
3076
  disabledDate: { type: [String, Number, Date, Function], default: void 0 },
2356
3077
  marginBottom: { default: 20 },
2357
- paddingTop: { default: 20 }
3078
+ paddingTop: { default: 20 },
3079
+ required: { type: Boolean, default: false },
3080
+ error: { type: Boolean, default: false },
3081
+ errorMessage: { default: "" }
2358
3082
  },
2359
3083
  emits: ["input", "update:value", "change", "focus", "blur", "visible-change"],
2360
3084
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -2428,7 +3152,8 @@ const _sfc_main$4 = defineComponent({
2428
3152
  };
2429
3153
  });
2430
3154
  const containerClasses = computed(() => ({
2431
- "outlined-date-picker--bordered": props.isBorder
3155
+ "outlined-date-picker--bordered": props.isBorder,
3156
+ "outlined-date-picker--error": hasError.value
2432
3157
  }));
2433
3158
  const containerStyle = computed(() => ({
2434
3159
  marginBottom: toCssValue(props.marginBottom),
@@ -2438,6 +3163,9 @@ const _sfc_main$4 = defineComponent({
2438
3163
  height: `${props.inputHeight}px`
2439
3164
  }));
2440
3165
  const floatingLabel = computed(() => props.label || props.placeholder || "");
3166
+ const controlPlaceholder = computed(() => addRequiredMark(props.placeholder));
3167
+ const hasError = computed(() => Boolean(props.error));
3168
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
2441
3169
  const hasContent = computed(() => hasFilledValue(pickerValue.value));
2442
3170
  const labelClasses = computed(() => ({
2443
3171
  "outlined-date-picker__label--floating": focused.value || hasContent.value,
@@ -2518,6 +3246,15 @@ const _sfc_main$4 = defineComponent({
2518
3246
  }
2519
3247
  return value;
2520
3248
  }
3249
+ function addRequiredMark(value) {
3250
+ if (!props.required || !value || value.startsWith("*")) {
3251
+ return value;
3252
+ }
3253
+ return `*${value}`;
3254
+ }
3255
+ function createRequiredMessage(label) {
3256
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
3257
+ }
2521
3258
  __expose({
2522
3259
  focus: () => {
2523
3260
  var _a2, _b;
@@ -2552,24 +3289,29 @@ const _sfc_main$4 = defineComponent({
2552
3289
  type: __props.typeDate,
2553
3290
  format: __props.format,
2554
3291
  "value-format": resolvedValueFormat.value,
2555
- placeholder: __props.placeholder,
3292
+ placeholder: controlPlaceholder.value,
2556
3293
  disabled: __props.disabled,
2557
3294
  style: pickerStyle.value,
3295
+ "aria-invalid": hasError.value ? "true" : void 0,
2558
3296
  "onUpdate:modelValue": handleModelValueUpdate,
2559
3297
  onFocus: handleFocus,
2560
3298
  onBlur: handleBlur,
2561
3299
  onChange: handleChange,
2562
3300
  onVisibleChange: handleVisibleChange
2563
- }), null, 16, ["model-value", "type", "format", "value-format", "placeholder", "disabled", "style"]),
3301
+ }), null, 16, ["model-value", "type", "format", "value-format", "placeholder", "disabled", "style", "aria-invalid"]),
2564
3302
  floatingLabel.value ? (openBlock(), createElementBlock("div", {
2565
3303
  key: 0,
2566
3304
  class: normalizeClass(["outlined-date-picker__label", labelClasses.value])
2567
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
3305
+ }, [
3306
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_1$4, "*")) : createCommentVNode("", true),
3307
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
3308
+ ], 2)) : createCommentVNode("", true),
3309
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_2$4, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
2568
3310
  ], 6);
2569
3311
  };
2570
3312
  }
2571
3313
  });
2572
- var OutlinedDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-c95a293c"]]);
3314
+ var OutlinedDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-47219caf"]]);
2573
3315
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
2574
3316
  var dayjs_min = { exports: {} };
2575
3317
  (function(module, exports) {
@@ -2863,7 +3605,20 @@ var dayjs_min = { exports: {} };
2863
3605
  })(dayjs_min);
2864
3606
  var dayjs = dayjs_min.exports;
2865
3607
  var OutlinedDateTimePicker_vue_vue_type_style_index_0_scoped_true_lang = "";
2866
- const _hoisted_1 = { class: "outlined-date-time-picker__separator" };
3608
+ const _hoisted_1$3 = { class: "outlined-date-time-picker__inner" };
3609
+ const _hoisted_2$3 = {
3610
+ key: 0,
3611
+ class: "outlined-date-time-picker__required"
3612
+ };
3613
+ const _hoisted_3 = { class: "outlined-date-time-picker__separator" };
3614
+ const _hoisted_4 = {
3615
+ key: 0,
3616
+ class: "outlined-date-time-picker__required"
3617
+ };
3618
+ const _hoisted_5 = {
3619
+ key: 0,
3620
+ class: "outlined-date-time-picker__error"
3621
+ };
2867
3622
  const _sfc_main$3 = defineComponent({
2868
3623
  ...{
2869
3624
  name: "OutlinedDateTimePicker",
@@ -2881,7 +3636,10 @@ const _sfc_main$3 = defineComponent({
2881
3636
  timePlaceholder: { default: "\u65F6\u95F4" },
2882
3637
  clearable: { type: Boolean, default: false },
2883
3638
  marginBottom: { default: 20 },
2884
- paddingTop: { default: 20 }
3639
+ paddingTop: { default: 20 },
3640
+ required: { type: Boolean, default: false },
3641
+ error: { type: Boolean, default: false },
3642
+ errorMessage: { default: "" }
2885
3643
  },
2886
3644
  emits: ["input", "update:value", "change", "focus", "blur", "visible-change"],
2887
3645
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -2908,16 +3666,24 @@ const _sfc_main$3 = defineComponent({
2908
3666
  const rootClass = computed(() => attrs.class);
2909
3667
  const rootStyle = computed(() => attrs.style);
2910
3668
  const floatingLabel = computed(() => props.label || props.placeholder || "");
2911
- const fieldClasses = computed(() => ({
2912
- "outlined-date-time-picker__field--bordered": props.isBorder
3669
+ const containerClasses = computed(() => ({
3670
+ "outlined-date-time-picker--error": hasError.value
2913
3671
  }));
2914
- const fieldStyle = computed(() => ({
3672
+ const containerStyle = computed(() => ({
2915
3673
  marginBottom: toCssValue(props.marginBottom),
2916
3674
  paddingTop: toCssValue(props.paddingTop)
2917
3675
  }));
3676
+ const fieldClasses = computed(() => ({
3677
+ "outlined-date-time-picker__field--bordered": props.isBorder,
3678
+ "outlined-date-time-picker__field--error": hasError.value
3679
+ }));
2918
3680
  const controlStyle = computed(() => ({
2919
3681
  height: `${props.inputHeight}px`
2920
3682
  }));
3683
+ const datePlaceholder = computed(() => addRequiredMark(props.placeholder));
3684
+ const timeControlPlaceholder = computed(() => addRequiredMark(props.timePlaceholder));
3685
+ const hasError = computed(() => Boolean(props.error));
3686
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
2921
3687
  const resolvedDisabledDate = computed(() => createDisabledDateHandler(props.disabledDate));
2922
3688
  const resolvedDisabledHours = computed(() => {
2923
3689
  if (!shouldLimitCurrentTime()) {
@@ -3051,6 +3817,15 @@ const _sfc_main$3 = defineComponent({
3051
3817
  }
3052
3818
  return value;
3053
3819
  }
3820
+ function addRequiredMark(value) {
3821
+ if (!props.required || !value || value.startsWith("*")) {
3822
+ return value;
3823
+ }
3824
+ return `*${value}`;
3825
+ }
3826
+ function createRequiredMessage(label) {
3827
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
3828
+ }
3054
3829
  __expose({
3055
3830
  focusDate: () => {
3056
3831
  var _a, _b;
@@ -3083,70 +3858,87 @@ const _sfc_main$3 = defineComponent({
3083
3858
  const _component_el_date_picker = resolveComponent("el-date-picker");
3084
3859
  const _component_el_time_picker = resolveComponent("el-time-picker");
3085
3860
  return openBlock(), createElementBlock("div", {
3086
- class: normalizeClass(["outlined-date-time-picker", [rootClass.value]]),
3087
- style: normalizeStyle(rootStyle.value)
3861
+ class: normalizeClass(["outlined-date-time-picker", [containerClasses.value, rootClass.value]]),
3862
+ style: normalizeStyle([containerStyle.value, rootStyle.value])
3088
3863
  }, [
3089
- createElementVNode("div", {
3090
- class: normalizeClass(["outlined-date-time-picker__field", fieldClasses.value]),
3091
- style: normalizeStyle(fieldStyle.value)
3092
- }, [
3093
- createVNode(_component_el_date_picker, {
3094
- ref_key: "datePickerRef",
3095
- ref: datePickerRef,
3096
- class: "outlined-date-time-picker__control",
3097
- "model-value": dateValue.value,
3098
- type: "date",
3099
- format: "YYYY-MM-DD",
3100
- "value-format": "YYYY-MM-DD",
3101
- placeholder: __props.placeholder,
3102
- clearable: __props.clearable,
3103
- "disabled-date": resolvedDisabledDate.value,
3104
- style: normalizeStyle(controlStyle.value),
3105
- "onUpdate:modelValue": handleDateUpdate,
3106
- onFocus: _cache[0] || (_cache[0] = ($event) => handleFocus("date")),
3107
- onBlur: _cache[1] || (_cache[1] = ($event) => handleBlur("date", $event)),
3108
- onChange: handleDateChange,
3109
- onVisibleChange: _cache[2] || (_cache[2] = ($event) => handleVisibleChange("date", $event))
3110
- }, null, 8, ["model-value", "placeholder", "clearable", "disabled-date", "style"]),
3111
- floatingLabel.value ? (openBlock(), createElementBlock("div", {
3112
- key: 0,
3113
- class: normalizeClass(["outlined-date-time-picker__label", dateLabelClasses.value])
3114
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
3115
- ], 6),
3116
- createElementVNode("span", _hoisted_1, toDisplayString(__props.separatorText), 1),
3117
- createElementVNode("div", {
3118
- class: normalizeClass(["outlined-date-time-picker__field", fieldClasses.value]),
3119
- style: normalizeStyle(fieldStyle.value)
3120
- }, [
3121
- createVNode(_component_el_time_picker, {
3122
- ref_key: "timePickerRef",
3123
- ref: timePickerRef,
3124
- class: "outlined-date-time-picker__control",
3125
- "model-value": timeValue.value,
3126
- format: "HH:mm",
3127
- "value-format": "HH:mm",
3128
- placeholder: __props.timePlaceholder,
3129
- clearable: __props.clearable,
3130
- disabled: !dateValue.value,
3131
- "disabled-hours": resolvedDisabledHours.value,
3132
- "disabled-minutes": resolvedDisabledMinutes.value,
3133
- style: normalizeStyle(controlStyle.value),
3134
- "onUpdate:modelValue": handleTimeUpdate,
3135
- onFocus: _cache[3] || (_cache[3] = ($event) => handleFocus("time")),
3136
- onBlur: _cache[4] || (_cache[4] = ($event) => handleBlur("time", $event)),
3137
- onChange: handleTimeChange,
3138
- onVisibleChange: _cache[5] || (_cache[5] = ($event) => handleVisibleChange("time", $event))
3139
- }, null, 8, ["model-value", "placeholder", "clearable", "disabled", "disabled-hours", "disabled-minutes", "style"]),
3864
+ createElementVNode("div", _hoisted_1$3, [
3140
3865
  createElementVNode("div", {
3141
- class: normalizeClass(["outlined-date-time-picker__label", timeLabelClasses.value])
3142
- }, toDisplayString(__props.timePlaceholder), 3)
3143
- ], 6)
3866
+ class: normalizeClass(["outlined-date-time-picker__field", fieldClasses.value])
3867
+ }, [
3868
+ createVNode(_component_el_date_picker, {
3869
+ ref_key: "datePickerRef",
3870
+ ref: datePickerRef,
3871
+ class: "outlined-date-time-picker__control",
3872
+ "model-value": dateValue.value,
3873
+ type: "date",
3874
+ format: "YYYY-MM-DD",
3875
+ "value-format": "YYYY-MM-DD",
3876
+ placeholder: datePlaceholder.value,
3877
+ clearable: __props.clearable,
3878
+ "disabled-date": resolvedDisabledDate.value,
3879
+ style: normalizeStyle(controlStyle.value),
3880
+ "aria-invalid": hasError.value ? "true" : void 0,
3881
+ "onUpdate:modelValue": handleDateUpdate,
3882
+ onFocus: _cache[0] || (_cache[0] = ($event) => handleFocus("date")),
3883
+ onBlur: _cache[1] || (_cache[1] = ($event) => handleBlur("date", $event)),
3884
+ onChange: handleDateChange,
3885
+ onVisibleChange: _cache[2] || (_cache[2] = ($event) => handleVisibleChange("date", $event))
3886
+ }, null, 8, ["model-value", "placeholder", "clearable", "disabled-date", "style", "aria-invalid"]),
3887
+ floatingLabel.value ? (openBlock(), createElementBlock("div", {
3888
+ key: 0,
3889
+ class: normalizeClass(["outlined-date-time-picker__label", dateLabelClasses.value])
3890
+ }, [
3891
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_2$3, "*")) : createCommentVNode("", true),
3892
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
3893
+ ], 2)) : createCommentVNode("", true)
3894
+ ], 2),
3895
+ createElementVNode("span", _hoisted_3, toDisplayString(__props.separatorText), 1),
3896
+ createElementVNode("div", {
3897
+ class: normalizeClass(["outlined-date-time-picker__field", fieldClasses.value])
3898
+ }, [
3899
+ createVNode(_component_el_time_picker, {
3900
+ ref_key: "timePickerRef",
3901
+ ref: timePickerRef,
3902
+ class: "outlined-date-time-picker__control",
3903
+ "model-value": timeValue.value,
3904
+ format: "HH:mm",
3905
+ "value-format": "HH:mm",
3906
+ placeholder: timeControlPlaceholder.value,
3907
+ clearable: __props.clearable,
3908
+ disabled: !dateValue.value,
3909
+ "disabled-hours": resolvedDisabledHours.value,
3910
+ "disabled-minutes": resolvedDisabledMinutes.value,
3911
+ style: normalizeStyle(controlStyle.value),
3912
+ "aria-invalid": hasError.value ? "true" : void 0,
3913
+ "onUpdate:modelValue": handleTimeUpdate,
3914
+ onFocus: _cache[3] || (_cache[3] = ($event) => handleFocus("time")),
3915
+ onBlur: _cache[4] || (_cache[4] = ($event) => handleBlur("time", $event)),
3916
+ onChange: handleTimeChange,
3917
+ onVisibleChange: _cache[5] || (_cache[5] = ($event) => handleVisibleChange("time", $event))
3918
+ }, null, 8, ["model-value", "placeholder", "clearable", "disabled", "disabled-hours", "disabled-minutes", "style", "aria-invalid"]),
3919
+ createElementVNode("div", {
3920
+ class: normalizeClass(["outlined-date-time-picker__label", timeLabelClasses.value])
3921
+ }, [
3922
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_4, "*")) : createCommentVNode("", true),
3923
+ createElementVNode("span", null, toDisplayString(__props.timePlaceholder), 1)
3924
+ ], 2)
3925
+ ], 2)
3926
+ ]),
3927
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_5, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
3144
3928
  ], 6);
3145
3929
  };
3146
3930
  }
3147
3931
  });
3148
- var OutlinedDateTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-f2fefd22"]]);
3932
+ var OutlinedDateTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-ee2ef524"]]);
3149
3933
  var OutlinedTimePicker_vue_vue_type_style_index_0_scoped_true_lang = "";
3934
+ const _hoisted_1$2 = {
3935
+ key: 0,
3936
+ class: "outlined-time-picker__required"
3937
+ };
3938
+ const _hoisted_2$2 = {
3939
+ key: 1,
3940
+ class: "outlined-time-picker__error"
3941
+ };
3150
3942
  const _sfc_main$2 = defineComponent({
3151
3943
  ...{
3152
3944
  name: "OutlinedTimePicker",
@@ -3169,7 +3961,10 @@ const _sfc_main$2 = defineComponent({
3169
3961
  inputHeight: { default: 40 },
3170
3962
  isBorder: { type: Boolean, default: false },
3171
3963
  marginBottom: { default: 20 },
3172
- paddingTop: { default: 20 }
3964
+ paddingTop: { default: 20 },
3965
+ required: { type: Boolean, default: false },
3966
+ error: { type: Boolean, default: false },
3967
+ errorMessage: { default: "" }
3173
3968
  },
3174
3969
  emits: ["input", "update:value", "change", "focus", "blur", "visible-change", "clear"],
3175
3970
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -3196,7 +3991,8 @@ const _sfc_main$2 = defineComponent({
3196
3991
  return rest;
3197
3992
  });
3198
3993
  const containerClasses = computed(() => ({
3199
- "outlined-time-picker--bordered": props.isBorder
3994
+ "outlined-time-picker--bordered": props.isBorder,
3995
+ "outlined-time-picker--error": hasError.value
3200
3996
  }));
3201
3997
  const containerStyle = computed(() => ({
3202
3998
  marginBottom: toCssValue(props.marginBottom),
@@ -3206,6 +4002,11 @@ const _sfc_main$2 = defineComponent({
3206
4002
  height: `${props.inputHeight}px`
3207
4003
  }));
3208
4004
  const floatingLabel = computed(() => props.label || props.placeholder || "");
4005
+ const controlPlaceholder = computed(() => addRequiredMark(props.placeholder));
4006
+ const controlStartPlaceholder = computed(() => addRequiredMark(props.startPlaceholder));
4007
+ const controlEndPlaceholder = computed(() => addRequiredMark(props.endPlaceholder));
4008
+ const hasError = computed(() => Boolean(props.error));
4009
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
3209
4010
  const hasContent = computed(() => {
3210
4011
  if (Array.isArray(pickerValue.value)) {
3211
4012
  return pickerValue.value.length > 0;
@@ -3275,6 +4076,15 @@ const _sfc_main$2 = defineComponent({
3275
4076
  }
3276
4077
  return value;
3277
4078
  }
4079
+ function addRequiredMark(value) {
4080
+ if (!props.required || !value || value.startsWith("*")) {
4081
+ return value;
4082
+ }
4083
+ return `*${value}`;
4084
+ }
4085
+ function createRequiredMessage(label) {
4086
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
4087
+ }
3278
4088
  __expose({
3279
4089
  focus: () => {
3280
4090
  var _a, _b;
@@ -3316,31 +4126,44 @@ const _sfc_main$2 = defineComponent({
3316
4126
  "is-range": __props.isRange,
3317
4127
  format: __props.format,
3318
4128
  "value-format": resolvedValueFormat.value,
3319
- placeholder: __props.placeholder,
3320
- "start-placeholder": __props.startPlaceholder,
3321
- "end-placeholder": __props.endPlaceholder,
4129
+ placeholder: controlPlaceholder.value,
4130
+ "start-placeholder": controlStartPlaceholder.value,
4131
+ "end-placeholder": controlEndPlaceholder.value,
3322
4132
  "range-separator": __props.rangeSeparator,
3323
4133
  disabled: __props.disabled,
3324
4134
  clearable: __props.clearable,
3325
4135
  "arrow-control": __props.arrowControl,
3326
4136
  style: pickerStyle.value,
4137
+ "aria-invalid": hasError.value ? "true" : void 0,
3327
4138
  "onUpdate:modelValue": handleModelValueUpdate,
3328
4139
  onFocus: handleFocus,
3329
4140
  onBlur: handleBlur,
3330
4141
  onChange: handleChange,
3331
4142
  onVisibleChange: handleVisibleChange,
3332
4143
  onClear: handleClear
3333
- }), null, 16, ["model-value", "is-range", "format", "value-format", "placeholder", "start-placeholder", "end-placeholder", "range-separator", "disabled", "clearable", "arrow-control", "style"]),
4144
+ }), null, 16, ["model-value", "is-range", "format", "value-format", "placeholder", "start-placeholder", "end-placeholder", "range-separator", "disabled", "clearable", "arrow-control", "style", "aria-invalid"]),
3334
4145
  floatingLabel.value ? (openBlock(), createElementBlock("div", {
3335
4146
  key: 0,
3336
4147
  class: normalizeClass(["outlined-time-picker__label", labelClasses.value])
3337
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
4148
+ }, [
4149
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_1$2, "*")) : createCommentVNode("", true),
4150
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
4151
+ ], 2)) : createCommentVNode("", true),
4152
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_2$2, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
3338
4153
  ], 6);
3339
4154
  };
3340
4155
  }
3341
4156
  });
3342
- var OutlinedTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-6a467b88"]]);
4157
+ var OutlinedTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-0257087e"]]);
3343
4158
  var OutlinedCascader_vue_vue_type_style_index_0_scoped_true_lang = "";
4159
+ const _hoisted_1$1 = {
4160
+ key: 0,
4161
+ class: "outlined-cascader__required"
4162
+ };
4163
+ const _hoisted_2$1 = {
4164
+ key: 1,
4165
+ class: "outlined-cascader__error"
4166
+ };
3344
4167
  const _sfc_main$1 = defineComponent({
3345
4168
  ...{
3346
4169
  name: "OutlinedCascader",
@@ -3361,7 +4184,10 @@ const _sfc_main$1 = defineComponent({
3361
4184
  filterable: { type: Boolean, default: true },
3362
4185
  levels: { type: Boolean, default: true },
3363
4186
  marginBottom: { default: 20 },
3364
- paddingTop: { default: 20 }
4187
+ paddingTop: { default: 20 },
4188
+ required: { type: Boolean, default: false },
4189
+ error: { type: Boolean, default: false },
4190
+ errorMessage: { default: "" }
3365
4191
  },
3366
4192
  emits: ["input", "update:value", "change", "focus", "blur", "visible-change"],
3367
4193
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -3387,7 +4213,8 @@ const _sfc_main$1 = defineComponent({
3387
4213
  return rest;
3388
4214
  });
3389
4215
  const containerClasses = computed(() => ({
3390
- "outlined-cascader--bordered": props.isBorder
4216
+ "outlined-cascader--bordered": props.isBorder,
4217
+ "outlined-cascader--error": hasError.value
3391
4218
  }));
3392
4219
  const containerStyle = computed(() => ({
3393
4220
  marginBottom: toCssValue(props.marginBottom),
@@ -3398,6 +4225,9 @@ const _sfc_main$1 = defineComponent({
3398
4225
  height: `${props.inputHeight}px`
3399
4226
  }));
3400
4227
  const floatingLabel = computed(() => props.label || props.placeholder || "");
4228
+ const controlPlaceholder = computed(() => addRequiredMark(props.placeholder));
4229
+ const hasError = computed(() => Boolean(props.error));
4230
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
3401
4231
  const hasContent = computed(() => cascaderValue.value.length > 0);
3402
4232
  const labelClasses = computed(() => ({
3403
4233
  "outlined-cascader__label--floating": focused.value || hasContent.value,
@@ -3447,6 +4277,15 @@ const _sfc_main$1 = defineComponent({
3447
4277
  }
3448
4278
  return value;
3449
4279
  }
4280
+ function addRequiredMark(value) {
4281
+ if (!props.required || !value || value.startsWith("*")) {
4282
+ return value;
4283
+ }
4284
+ return `*${value}`;
4285
+ }
4286
+ function createRequiredMessage(label) {
4287
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
4288
+ }
3450
4289
  __expose({
3451
4290
  focus: () => {
3452
4291
  var _a, _b;
@@ -3482,28 +4321,41 @@ const _sfc_main$1 = defineComponent({
3482
4321
  options: __props.options,
3483
4322
  props: __props.propsValue,
3484
4323
  clearable: __props.clearable,
3485
- placeholder: __props.placeholder,
4324
+ placeholder: controlPlaceholder.value,
3486
4325
  filterable: __props.filterable,
3487
4326
  "show-all-levels": __props.levels,
3488
4327
  disabled: __props.disabled,
3489
4328
  "popper-class": __props.popperClass,
3490
4329
  style: cascaderStyle.value,
4330
+ "aria-invalid": hasError.value ? "true" : void 0,
3491
4331
  "onUpdate:modelValue": handleModelValueUpdate,
3492
4332
  onFocus: handleFocus,
3493
4333
  onBlur: handleBlur,
3494
4334
  onChange: handleChange,
3495
4335
  onVisibleChange: handleVisibleChange
3496
- }), null, 16, ["model-value", "options", "props", "clearable", "placeholder", "filterable", "show-all-levels", "disabled", "popper-class", "style"]),
4336
+ }), null, 16, ["model-value", "options", "props", "clearable", "placeholder", "filterable", "show-all-levels", "disabled", "popper-class", "style", "aria-invalid"]),
3497
4337
  floatingLabel.value ? (openBlock(), createElementBlock("div", {
3498
4338
  key: 0,
3499
4339
  class: normalizeClass(["outlined-cascader__label", labelClasses.value])
3500
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
4340
+ }, [
4341
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_1$1, "*")) : createCommentVNode("", true),
4342
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
4343
+ ], 2)) : createCommentVNode("", true),
4344
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_2$1, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
3501
4345
  ], 6);
3502
4346
  };
3503
4347
  }
3504
4348
  });
3505
- var OutlinedCascader = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-2c93c0e4"]]);
4349
+ var OutlinedCascader = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-033e3fab"]]);
3506
4350
  var OutlinedTreeSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
4351
+ const _hoisted_1 = {
4352
+ key: 0,
4353
+ class: "outlined-tree-select__required"
4354
+ };
4355
+ const _hoisted_2 = {
4356
+ key: 1,
4357
+ class: "outlined-tree-select__error"
4358
+ };
3507
4359
  const _sfc_main = defineComponent({
3508
4360
  ...{
3509
4361
  name: "OutlinedTreeSelect",
@@ -3538,7 +4390,10 @@ const _sfc_main = defineComponent({
3538
4390
  inputHeight: { default: 40 },
3539
4391
  isBorder: { type: Boolean, default: false },
3540
4392
  marginBottom: { default: 20 },
3541
- paddingTop: { default: 20 }
4393
+ paddingTop: { default: 20 },
4394
+ required: { type: Boolean, default: false },
4395
+ error: { type: Boolean, default: false },
4396
+ errorMessage: { default: "" }
3542
4397
  },
3543
4398
  emits: ["input", "update:value", "change", "focus", "blur", "visible-change", "clear"],
3544
4399
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -3564,7 +4419,8 @@ const _sfc_main = defineComponent({
3564
4419
  return rest;
3565
4420
  });
3566
4421
  const containerClasses = computed(() => ({
3567
- "outlined-tree-select--bordered": props.isBorder
4422
+ "outlined-tree-select--bordered": props.isBorder,
4423
+ "outlined-tree-select--error": hasError.value
3568
4424
  }));
3569
4425
  const containerStyle = computed(() => ({
3570
4426
  marginBottom: toCssValue(props.marginBottom),
@@ -3586,6 +4442,9 @@ const _sfc_main = defineComponent({
3586
4442
  };
3587
4443
  });
3588
4444
  const floatingLabel = computed(() => props.label || props.placeholder || "");
4445
+ const controlPlaceholder = computed(() => addRequiredMark(props.placeholder));
4446
+ const hasError = computed(() => Boolean(props.error));
4447
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
3589
4448
  const hasContent = computed(() => {
3590
4449
  if (isArrayMode()) {
3591
4450
  return Array.isArray(treeSelectValue.value) && treeSelectValue.value.length > 0;
@@ -3658,6 +4517,15 @@ const _sfc_main = defineComponent({
3658
4517
  }
3659
4518
  return value;
3660
4519
  }
4520
+ function addRequiredMark(value) {
4521
+ if (!props.required || !value || value.startsWith("*")) {
4522
+ return value;
4523
+ }
4524
+ return `*${value}`;
4525
+ }
4526
+ function createRequiredMessage(label) {
4527
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
4528
+ }
3661
4529
  __expose({
3662
4530
  focus: () => {
3663
4531
  var _a, _b;
@@ -3696,7 +4564,7 @@ const _sfc_main = defineComponent({
3696
4564
  "model-value": treeSelectValue.value,
3697
4565
  data: __props.data,
3698
4566
  props: resolvedTreeProps.value,
3699
- placeholder: __props.placeholder,
4567
+ placeholder: controlPlaceholder.value,
3700
4568
  disabled: __props.disabled,
3701
4569
  clearable: __props.clearable,
3702
4570
  filterable: __props.filterable,
@@ -3713,6 +4581,7 @@ const _sfc_main = defineComponent({
3713
4581
  "popper-class": __props.popperClass,
3714
4582
  "node-key": __props.nodeKey,
3715
4583
  style: treeSelectStyle.value,
4584
+ "aria-invalid": hasError.value ? "true" : void 0,
3716
4585
  "onUpdate:modelValue": handleModelValueUpdate,
3717
4586
  onFocus: handleFocus,
3718
4587
  onBlur: handleBlur,
@@ -3730,15 +4599,19 @@ const _sfc_main = defineComponent({
3730
4599
  renderSlot(_ctx.$slots, "footer", {}, void 0, true)
3731
4600
  ]),
3732
4601
  _: 3
3733
- }, 16, ["model-value", "data", "props", "placeholder", "disabled", "clearable", "filterable", "multiple", "show-checkbox", "check-strictly", "check-on-click-node", "default-expand-all", "expand-on-click-node", "render-after-expand", "collapse-tags", "collapse-tags-tooltip", "max-collapse-tags", "popper-class", "node-key", "style"]),
4602
+ }, 16, ["model-value", "data", "props", "placeholder", "disabled", "clearable", "filterable", "multiple", "show-checkbox", "check-strictly", "check-on-click-node", "default-expand-all", "expand-on-click-node", "render-after-expand", "collapse-tags", "collapse-tags-tooltip", "max-collapse-tags", "popper-class", "node-key", "style", "aria-invalid"]),
3734
4603
  floatingLabel.value ? (openBlock(), createElementBlock("div", {
3735
4604
  key: 0,
3736
4605
  class: normalizeClass(["outlined-tree-select__label", labelClasses.value])
3737
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
4606
+ }, [
4607
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_1, "*")) : createCommentVNode("", true),
4608
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
4609
+ ], 2)) : createCommentVNode("", true),
4610
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
3738
4611
  ], 6);
3739
4612
  };
3740
4613
  }
3741
4614
  });
3742
- var OutlinedTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8403e6ea"]]);
4615
+ var OutlinedTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-30d7dee0"]]);
3743
4616
  installRipple();
3744
- export { BaseCard, BaseEChart, _sfc_main$7 as BaseExportButton, BaseTable, OutlinedCascader, OutlinedDatePicker, OutlinedDateTimePicker, OutlinedInput, OutlinedSelect, OutlinedTimePicker, OutlinedTreeSelect, downloadExportResponse, exportExcel, extractFileNameFromDisposition, installRipple, normalizeExportFileName, uninstallRipple };
4617
+ export { BaseCard, BaseEChart, _sfc_main$7 as BaseExportButton, BaseTable, OutlinedCascader, OutlinedDatePicker, OutlinedDateTimePicker, OutlinedInput, OutlinedSelect, OutlinedTimePicker, OutlinedTreeSelect, SvgIcon, downloadExportResponse, exportExcel, extractFileNameFromDisposition, installRipple, normalizeExportFileName, uninstallRipple };