@hbdlzy/ui-core 0.1.5 → 0.1.6

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 (40) hide show
  1. package/components.manifest.json +21 -0
  2. package/dist/components/OutlinedCascader/OutlinedCascader.types.d.ts +3 -0
  3. package/dist/components/OutlinedCascader/OutlinedCascader.vue.d.ts +9 -0
  4. package/dist/components/OutlinedDatePicker/OutlinedDatePicker.types.d.ts +3 -0
  5. package/dist/components/OutlinedDatePicker/OutlinedDatePicker.vue.d.ts +9 -0
  6. package/dist/components/OutlinedDateTimePicker/OutlinedDateTimePicker.types.d.ts +3 -0
  7. package/dist/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue.d.ts +9 -0
  8. package/dist/components/OutlinedInput/OutlinedInput.types.d.ts +3 -0
  9. package/dist/components/OutlinedInput/OutlinedInput.vue.d.ts +9 -0
  10. package/dist/components/OutlinedSelect/OutlinedSelect.types.d.ts +3 -0
  11. package/dist/components/OutlinedSelect/OutlinedSelect.vue.d.ts +9 -0
  12. package/dist/components/OutlinedTimePicker/OutlinedTimePicker.types.d.ts +3 -0
  13. package/dist/components/OutlinedTimePicker/OutlinedTimePicker.vue.d.ts +9 -0
  14. package/dist/components/OutlinedTreeSelect/OutlinedTreeSelect.types.d.ts +3 -0
  15. package/dist/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +9 -0
  16. package/dist/index.cjs +5 -5
  17. package/dist/index.js +339 -121
  18. package/dist/style.css +1 -1
  19. package/package.json +1 -1
  20. package/src/components/OutlinedCascader/OutlinedCascader.types.ts +3 -0
  21. package/src/components/OutlinedCascader/OutlinedCascader.vue +71 -6
  22. package/src/components/OutlinedCascader/README.md +3 -0
  23. package/src/components/OutlinedDatePicker/OutlinedDatePicker.types.ts +3 -0
  24. package/src/components/OutlinedDatePicker/OutlinedDatePicker.vue +71 -6
  25. package/src/components/OutlinedDatePicker/README.md +3 -0
  26. package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.types.ts +3 -0
  27. package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue +144 -64
  28. package/src/components/OutlinedDateTimePicker/README.md +3 -0
  29. package/src/components/OutlinedInput/OutlinedInput.types.ts +3 -0
  30. package/src/components/OutlinedInput/OutlinedInput.vue +87 -8
  31. package/src/components/OutlinedInput/README.md +3 -0
  32. package/src/components/OutlinedSelect/OutlinedSelect.types.ts +3 -0
  33. package/src/components/OutlinedSelect/OutlinedSelect.vue +72 -6
  34. package/src/components/OutlinedSelect/README.md +3 -0
  35. package/src/components/OutlinedTimePicker/OutlinedTimePicker.types.ts +3 -0
  36. package/src/components/OutlinedTimePicker/OutlinedTimePicker.vue +75 -8
  37. package/src/components/OutlinedTimePicker/README.md +3 -0
  38. package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.types.ts +3 -0
  39. package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.vue +72 -6
  40. package/src/components/OutlinedTreeSelect/README.md +3 -0
package/dist/index.js CHANGED
@@ -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$8 = {
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$8 = { class: "base-card__header-left" };
187
+ const _hoisted_3$3 = {
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
  };
@@ -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$8, [
311
+ createElementVNode("div", _hoisted_2$8, [
312
+ hasTitleBlock.value ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
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
  ]),
@@ -341,17 +341,17 @@ const _sfc_main$a = defineComponent({
341
341
  });
342
342
  var BaseCard = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-6bfddf1c"]]);
343
343
  var BaseTable_vue_vue_type_style_index_0_scoped_true_lang = "";
344
- const _hoisted_1$2 = { class: "base-table" };
345
- const _hoisted_2 = {
344
+ const _hoisted_1$7 = { class: "base-table" };
345
+ const _hoisted_2$7 = {
346
346
  key: 0,
347
347
  class: "base-table__toolbar"
348
348
  };
349
- const _hoisted_3 = { class: "base-table__toolbar-left" };
350
- const _hoisted_4 = {
349
+ const _hoisted_3$2 = { class: "base-table__toolbar-left" };
350
+ const _hoisted_4$1 = {
351
351
  key: 0,
352
352
  class: "base-table__toolbar-right"
353
353
  };
354
- const _hoisted_5 = { class: "base-table__header" };
354
+ const _hoisted_5$1 = { class: "base-table__header" };
355
355
  const _hoisted_6 = { class: "base-table__header-label" };
356
356
  const _hoisted_7 = { class: "base-table__header-actions" };
357
357
  const _hoisted_8 = { class: "base-table__header-search-footer" };
@@ -1058,12 +1058,12 @@ const _sfc_main$9 = defineComponent({
1058
1058
  const _component_el_tag = resolveComponent("el-tag");
1059
1059
  const _component_el_table = resolveComponent("el-table");
1060
1060
  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, [
1061
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [
1062
+ shouldRenderToolbar.value ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
1063
+ createElementVNode("div", _hoisted_3$2, [
1064
1064
  renderSlot(_ctx.$slots, "toolbar", {}, void 0, true)
1065
1065
  ]),
1066
- __props.showPagination ? (openBlock(), createElementBlock("div", _hoisted_4, [
1066
+ __props.showPagination ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
1067
1067
  createVNode(_component_el_pagination, {
1068
1068
  small: "",
1069
1069
  background: "",
@@ -1198,7 +1198,7 @@ const _sfc_main$9 = defineComponent({
1198
1198
  } : shouldRenderBuiltInHeader(column) ? {
1199
1199
  name: "header",
1200
1200
  fn: withCtx(() => [
1201
- createElementVNode("div", _hoisted_5, [
1201
+ createElementVNode("div", _hoisted_5$1, [
1202
1202
  createElementVNode("span", _hoisted_6, toDisplayString(column.label), 1),
1203
1203
  createElementVNode("div", _hoisted_7, [
1204
1204
  createVNode(_component_el_dropdown, {
@@ -1877,7 +1877,15 @@ const _sfc_main$7 = defineComponent({
1877
1877
  }
1878
1878
  });
1879
1879
  var OutlinedInput_vue_vue_type_style_index_0_scoped_true_lang = "";
1880
- const _hoisted_1$1 = { class: "outlined-input__suffix-text" };
1880
+ const _hoisted_1$6 = { class: "outlined-input__suffix-text" };
1881
+ const _hoisted_2$6 = {
1882
+ key: 0,
1883
+ class: "outlined-input__required"
1884
+ };
1885
+ const _hoisted_3$1 = {
1886
+ key: 1,
1887
+ class: "outlined-input__error"
1888
+ };
1881
1889
  const _sfc_main$6 = defineComponent({
1882
1890
  ...{
1883
1891
  name: "OutlinedInput",
@@ -1902,7 +1910,10 @@ const _sfc_main$6 = defineComponent({
1902
1910
  clearable: { type: Boolean, default: false },
1903
1911
  showWordLimit: { type: Boolean, default: true },
1904
1912
  marginBottom: { default: 20 },
1905
- paddingTop: { default: 20 }
1913
+ paddingTop: { default: 20 },
1914
+ required: { type: Boolean, default: false },
1915
+ error: { type: Boolean, default: false },
1916
+ errorMessage: { default: "" }
1906
1917
  },
1907
1918
  emits: ["input", "update:value", "warning", "focus", "blur", "change", "clear"],
1908
1919
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -1934,6 +1945,7 @@ const _sfc_main$6 = defineComponent({
1934
1945
  });
1935
1946
  const containerClasses = computed(() => ({
1936
1947
  "outlined-input--bordered": props.isBorder,
1948
+ "outlined-input--error": hasError.value,
1937
1949
  "outlined-input--textarea-default": resolvedType.value === "textarea" && !hasTextareaAutosize.value
1938
1950
  }));
1939
1951
  const containerStyle = computed(() => ({
@@ -1949,6 +1961,9 @@ const _sfc_main$6 = defineComponent({
1949
1961
  };
1950
1962
  });
1951
1963
  const floatingLabel = computed(() => props.label || props.placeholder || "");
1964
+ const controlPlaceholder = computed(() => addRequiredMark(props.placeholder));
1965
+ const hasError = computed(() => Boolean(props.error));
1966
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
1952
1967
  const hasContent = computed(() => hasFilledValue(inputValue.value));
1953
1968
  const labelClasses = computed(() => ({
1954
1969
  "outlined-input__label--floating": focused.value || hasContent.value,
@@ -2006,6 +2021,15 @@ const _sfc_main$6 = defineComponent({
2006
2021
  }
2007
2022
  return value;
2008
2023
  }
2024
+ function addRequiredMark(value) {
2025
+ if (!props.required || !value || value.startsWith("*")) {
2026
+ return value;
2027
+ }
2028
+ return `*${value}`;
2029
+ }
2030
+ function createRequiredMessage(label) {
2031
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
2032
+ }
2009
2033
  __expose({
2010
2034
  focus: () => {
2011
2035
  var _a2;
@@ -2037,7 +2061,7 @@ const _sfc_main$6 = defineComponent({
2037
2061
  }, inputAttrs.value, {
2038
2062
  "model-value": inputValue.value,
2039
2063
  type: resolvedType.value,
2040
- placeholder: __props.placeholder,
2064
+ placeholder: controlPlaceholder.value,
2041
2065
  disabled: __props.disabled,
2042
2066
  maxlength: __props.maxlength,
2043
2067
  max: __props.max,
@@ -2046,6 +2070,7 @@ const _sfc_main$6 = defineComponent({
2046
2070
  "show-word-limit": __props.showWordLimit,
2047
2071
  clearable: __props.clearable,
2048
2072
  style: inputStyle.value,
2073
+ "aria-invalid": hasError.value ? "true" : void 0,
2049
2074
  "onUpdate:modelValue": handleModelValueUpdate,
2050
2075
  onFocus: handleFocus,
2051
2076
  onBlur: handleBlur,
@@ -2077,22 +2102,34 @@ const _sfc_main$6 = defineComponent({
2077
2102
  name: "suffix",
2078
2103
  fn: withCtx(() => [
2079
2104
  renderSlot(_ctx.$slots, "suffix", {}, () => [
2080
- createElementVNode("span", _hoisted_1$1, toDisplayString(__props.suffixText), 1)
2105
+ createElementVNode("span", _hoisted_1$6, toDisplayString(__props.suffixText), 1)
2081
2106
  ], true)
2082
2107
  ]),
2083
2108
  key: "3"
2084
2109
  } : void 0
2085
- ]), 1040, ["model-value", "type", "placeholder", "disabled", "maxlength", "max", "min", "show-password", "show-word-limit", "clearable", "style"]),
2110
+ ]), 1040, ["model-value", "type", "placeholder", "disabled", "maxlength", "max", "min", "show-password", "show-word-limit", "clearable", "style", "aria-invalid"]),
2086
2111
  floatingLabel.value ? (openBlock(), createElementBlock("div", {
2087
2112
  key: 0,
2088
2113
  class: normalizeClass(["outlined-input__label", labelClasses.value])
2089
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
2114
+ }, [
2115
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_2$6, "*")) : createCommentVNode("", true),
2116
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
2117
+ ], 2)) : createCommentVNode("", true),
2118
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_3$1, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
2090
2119
  ], 6);
2091
2120
  };
2092
2121
  }
2093
2122
  });
2094
- var OutlinedInput = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-2bf89ccd"]]);
2123
+ var OutlinedInput = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-3c232c9a"]]);
2095
2124
  var OutlinedSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
2125
+ const _hoisted_1$5 = {
2126
+ key: 0,
2127
+ class: "outlined-select__required"
2128
+ };
2129
+ const _hoisted_2$5 = {
2130
+ key: 1,
2131
+ class: "outlined-select__error"
2132
+ };
2096
2133
  const _sfc_main$5 = defineComponent({
2097
2134
  ...{
2098
2135
  name: "OutlinedSelect",
@@ -2119,7 +2156,10 @@ const _sfc_main$5 = defineComponent({
2119
2156
  noCheck: { type: Boolean, default: false },
2120
2157
  maxCollapseTags: { default: 5 },
2121
2158
  marginBottom: { default: 20 },
2122
- paddingTop: { default: 20 }
2159
+ paddingTop: { default: 20 },
2160
+ required: { type: Boolean, default: false },
2161
+ error: { type: Boolean, default: false },
2162
+ errorMessage: { default: "" }
2123
2163
  },
2124
2164
  emits: ["input", "update:value", "change", "focus", "blur", "visible-change", "clear"],
2125
2165
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -2146,7 +2186,8 @@ const _sfc_main$5 = defineComponent({
2146
2186
  return rest;
2147
2187
  });
2148
2188
  const containerClasses = computed(() => ({
2149
- "outlined-select--bordered": props.isBorder
2189
+ "outlined-select--bordered": props.isBorder,
2190
+ "outlined-select--error": hasError.value
2150
2191
  }));
2151
2192
  const containerStyle = computed(() => ({
2152
2193
  marginBottom: toCssValue(props.marginBottom),
@@ -2157,6 +2198,9 @@ const _sfc_main$5 = defineComponent({
2157
2198
  height: props.multiple ? "auto" : `${props.inputHeight}px`
2158
2199
  }));
2159
2200
  const floatingLabel = computed(() => props.label || props.placeholder || "");
2201
+ const controlPlaceholder = computed(() => addRequiredMark(props.placeholder));
2202
+ const hasError = computed(() => Boolean(props.error));
2203
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
2160
2204
  const hasCustomOptionsSlot = computed(() => Boolean(slots.default));
2161
2205
  const hasContent = computed(() => {
2162
2206
  if (props.multiple) {
@@ -2240,6 +2284,15 @@ const _sfc_main$5 = defineComponent({
2240
2284
  }
2241
2285
  return value;
2242
2286
  }
2287
+ function addRequiredMark(value) {
2288
+ if (!props.required || !value || value.startsWith("*")) {
2289
+ return value;
2290
+ }
2291
+ return `*${value}`;
2292
+ }
2293
+ function createRequiredMessage(label) {
2294
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
2295
+ }
2243
2296
  __expose({
2244
2297
  focus: () => {
2245
2298
  var _a, _b;
@@ -2283,7 +2336,7 @@ const _sfc_main$5 = defineComponent({
2283
2336
  }, selectAttrs.value, {
2284
2337
  class: "outlined-select__control",
2285
2338
  "model-value": selectValue.value,
2286
- placeholder: __props.placeholder,
2339
+ placeholder: controlPlaceholder.value,
2287
2340
  disabled: __props.disabled,
2288
2341
  multiple: __props.multiple,
2289
2342
  filterable: __props.filterable,
@@ -2292,6 +2345,7 @@ const _sfc_main$5 = defineComponent({
2292
2345
  "collapse-tags-tooltip": __props.collapseTagsTooltip,
2293
2346
  "max-collapse-tags": __props.maxCollapseTags,
2294
2347
  style: selectStyle.value,
2348
+ "aria-invalid": hasError.value ? "true" : void 0,
2295
2349
  "onUpdate:modelValue": handleModelValueUpdate,
2296
2350
  onFocus: handleFocus,
2297
2351
  onBlur: handleBlur,
@@ -2322,17 +2376,29 @@ const _sfc_main$5 = defineComponent({
2322
2376
  }), 128))
2323
2377
  ]),
2324
2378
  _: 3
2325
- }, 16, ["model-value", "placeholder", "disabled", "multiple", "filterable", "clearable", "collapse-tags", "collapse-tags-tooltip", "max-collapse-tags", "style"]),
2379
+ }, 16, ["model-value", "placeholder", "disabled", "multiple", "filterable", "clearable", "collapse-tags", "collapse-tags-tooltip", "max-collapse-tags", "style", "aria-invalid"]),
2326
2380
  floatingLabel.value ? (openBlock(), createElementBlock("div", {
2327
2381
  key: 0,
2328
2382
  class: normalizeClass(["outlined-select__label", labelClasses.value])
2329
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
2383
+ }, [
2384
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_1$5, "*")) : createCommentVNode("", true),
2385
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
2386
+ ], 2)) : createCommentVNode("", true),
2387
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_2$5, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
2330
2388
  ], 6);
2331
2389
  };
2332
2390
  }
2333
2391
  });
2334
- var OutlinedSelect = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-7bd2b5f2"]]);
2392
+ var OutlinedSelect = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-2a354461"]]);
2335
2393
  var OutlinedDatePicker_vue_vue_type_style_index_0_scoped_true_lang = "";
2394
+ const _hoisted_1$4 = {
2395
+ key: 0,
2396
+ class: "outlined-date-picker__required"
2397
+ };
2398
+ const _hoisted_2$4 = {
2399
+ key: 1,
2400
+ class: "outlined-date-picker__error"
2401
+ };
2336
2402
  const _sfc_main$4 = defineComponent({
2337
2403
  ...{
2338
2404
  name: "OutlinedDatePicker",
@@ -2354,7 +2420,10 @@ const _sfc_main$4 = defineComponent({
2354
2420
  isBorder: { type: Boolean, default: false },
2355
2421
  disabledDate: { type: [String, Number, Date, Function], default: void 0 },
2356
2422
  marginBottom: { default: 20 },
2357
- paddingTop: { default: 20 }
2423
+ paddingTop: { default: 20 },
2424
+ required: { type: Boolean, default: false },
2425
+ error: { type: Boolean, default: false },
2426
+ errorMessage: { default: "" }
2358
2427
  },
2359
2428
  emits: ["input", "update:value", "change", "focus", "blur", "visible-change"],
2360
2429
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -2428,7 +2497,8 @@ const _sfc_main$4 = defineComponent({
2428
2497
  };
2429
2498
  });
2430
2499
  const containerClasses = computed(() => ({
2431
- "outlined-date-picker--bordered": props.isBorder
2500
+ "outlined-date-picker--bordered": props.isBorder,
2501
+ "outlined-date-picker--error": hasError.value
2432
2502
  }));
2433
2503
  const containerStyle = computed(() => ({
2434
2504
  marginBottom: toCssValue(props.marginBottom),
@@ -2438,6 +2508,9 @@ const _sfc_main$4 = defineComponent({
2438
2508
  height: `${props.inputHeight}px`
2439
2509
  }));
2440
2510
  const floatingLabel = computed(() => props.label || props.placeholder || "");
2511
+ const controlPlaceholder = computed(() => addRequiredMark(props.placeholder));
2512
+ const hasError = computed(() => Boolean(props.error));
2513
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
2441
2514
  const hasContent = computed(() => hasFilledValue(pickerValue.value));
2442
2515
  const labelClasses = computed(() => ({
2443
2516
  "outlined-date-picker__label--floating": focused.value || hasContent.value,
@@ -2518,6 +2591,15 @@ const _sfc_main$4 = defineComponent({
2518
2591
  }
2519
2592
  return value;
2520
2593
  }
2594
+ function addRequiredMark(value) {
2595
+ if (!props.required || !value || value.startsWith("*")) {
2596
+ return value;
2597
+ }
2598
+ return `*${value}`;
2599
+ }
2600
+ function createRequiredMessage(label) {
2601
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
2602
+ }
2521
2603
  __expose({
2522
2604
  focus: () => {
2523
2605
  var _a2, _b;
@@ -2552,24 +2634,29 @@ const _sfc_main$4 = defineComponent({
2552
2634
  type: __props.typeDate,
2553
2635
  format: __props.format,
2554
2636
  "value-format": resolvedValueFormat.value,
2555
- placeholder: __props.placeholder,
2637
+ placeholder: controlPlaceholder.value,
2556
2638
  disabled: __props.disabled,
2557
2639
  style: pickerStyle.value,
2640
+ "aria-invalid": hasError.value ? "true" : void 0,
2558
2641
  "onUpdate:modelValue": handleModelValueUpdate,
2559
2642
  onFocus: handleFocus,
2560
2643
  onBlur: handleBlur,
2561
2644
  onChange: handleChange,
2562
2645
  onVisibleChange: handleVisibleChange
2563
- }), null, 16, ["model-value", "type", "format", "value-format", "placeholder", "disabled", "style"]),
2646
+ }), null, 16, ["model-value", "type", "format", "value-format", "placeholder", "disabled", "style", "aria-invalid"]),
2564
2647
  floatingLabel.value ? (openBlock(), createElementBlock("div", {
2565
2648
  key: 0,
2566
2649
  class: normalizeClass(["outlined-date-picker__label", labelClasses.value])
2567
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
2650
+ }, [
2651
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_1$4, "*")) : createCommentVNode("", true),
2652
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
2653
+ ], 2)) : createCommentVNode("", true),
2654
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_2$4, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
2568
2655
  ], 6);
2569
2656
  };
2570
2657
  }
2571
2658
  });
2572
- var OutlinedDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-c95a293c"]]);
2659
+ var OutlinedDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-47219caf"]]);
2573
2660
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
2574
2661
  var dayjs_min = { exports: {} };
2575
2662
  (function(module, exports) {
@@ -2863,7 +2950,20 @@ var dayjs_min = { exports: {} };
2863
2950
  })(dayjs_min);
2864
2951
  var dayjs = dayjs_min.exports;
2865
2952
  var OutlinedDateTimePicker_vue_vue_type_style_index_0_scoped_true_lang = "";
2866
- const _hoisted_1 = { class: "outlined-date-time-picker__separator" };
2953
+ const _hoisted_1$3 = { class: "outlined-date-time-picker__inner" };
2954
+ const _hoisted_2$3 = {
2955
+ key: 0,
2956
+ class: "outlined-date-time-picker__required"
2957
+ };
2958
+ const _hoisted_3 = { class: "outlined-date-time-picker__separator" };
2959
+ const _hoisted_4 = {
2960
+ key: 0,
2961
+ class: "outlined-date-time-picker__required"
2962
+ };
2963
+ const _hoisted_5 = {
2964
+ key: 0,
2965
+ class: "outlined-date-time-picker__error"
2966
+ };
2867
2967
  const _sfc_main$3 = defineComponent({
2868
2968
  ...{
2869
2969
  name: "OutlinedDateTimePicker",
@@ -2881,7 +2981,10 @@ const _sfc_main$3 = defineComponent({
2881
2981
  timePlaceholder: { default: "\u65F6\u95F4" },
2882
2982
  clearable: { type: Boolean, default: false },
2883
2983
  marginBottom: { default: 20 },
2884
- paddingTop: { default: 20 }
2984
+ paddingTop: { default: 20 },
2985
+ required: { type: Boolean, default: false },
2986
+ error: { type: Boolean, default: false },
2987
+ errorMessage: { default: "" }
2885
2988
  },
2886
2989
  emits: ["input", "update:value", "change", "focus", "blur", "visible-change"],
2887
2990
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -2908,16 +3011,24 @@ const _sfc_main$3 = defineComponent({
2908
3011
  const rootClass = computed(() => attrs.class);
2909
3012
  const rootStyle = computed(() => attrs.style);
2910
3013
  const floatingLabel = computed(() => props.label || props.placeholder || "");
2911
- const fieldClasses = computed(() => ({
2912
- "outlined-date-time-picker__field--bordered": props.isBorder
3014
+ const containerClasses = computed(() => ({
3015
+ "outlined-date-time-picker--error": hasError.value
2913
3016
  }));
2914
- const fieldStyle = computed(() => ({
3017
+ const containerStyle = computed(() => ({
2915
3018
  marginBottom: toCssValue(props.marginBottom),
2916
3019
  paddingTop: toCssValue(props.paddingTop)
2917
3020
  }));
3021
+ const fieldClasses = computed(() => ({
3022
+ "outlined-date-time-picker__field--bordered": props.isBorder,
3023
+ "outlined-date-time-picker__field--error": hasError.value
3024
+ }));
2918
3025
  const controlStyle = computed(() => ({
2919
3026
  height: `${props.inputHeight}px`
2920
3027
  }));
3028
+ const datePlaceholder = computed(() => addRequiredMark(props.placeholder));
3029
+ const timeControlPlaceholder = computed(() => addRequiredMark(props.timePlaceholder));
3030
+ const hasError = computed(() => Boolean(props.error));
3031
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
2921
3032
  const resolvedDisabledDate = computed(() => createDisabledDateHandler(props.disabledDate));
2922
3033
  const resolvedDisabledHours = computed(() => {
2923
3034
  if (!shouldLimitCurrentTime()) {
@@ -3051,6 +3162,15 @@ const _sfc_main$3 = defineComponent({
3051
3162
  }
3052
3163
  return value;
3053
3164
  }
3165
+ function addRequiredMark(value) {
3166
+ if (!props.required || !value || value.startsWith("*")) {
3167
+ return value;
3168
+ }
3169
+ return `*${value}`;
3170
+ }
3171
+ function createRequiredMessage(label) {
3172
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
3173
+ }
3054
3174
  __expose({
3055
3175
  focusDate: () => {
3056
3176
  var _a, _b;
@@ -3083,70 +3203,87 @@ const _sfc_main$3 = defineComponent({
3083
3203
  const _component_el_date_picker = resolveComponent("el-date-picker");
3084
3204
  const _component_el_time_picker = resolveComponent("el-time-picker");
3085
3205
  return openBlock(), createElementBlock("div", {
3086
- class: normalizeClass(["outlined-date-time-picker", [rootClass.value]]),
3087
- style: normalizeStyle(rootStyle.value)
3206
+ class: normalizeClass(["outlined-date-time-picker", [containerClasses.value, rootClass.value]]),
3207
+ style: normalizeStyle([containerStyle.value, rootStyle.value])
3088
3208
  }, [
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"]),
3209
+ createElementVNode("div", _hoisted_1$3, [
3210
+ createElementVNode("div", {
3211
+ class: normalizeClass(["outlined-date-time-picker__field", fieldClasses.value])
3212
+ }, [
3213
+ createVNode(_component_el_date_picker, {
3214
+ ref_key: "datePickerRef",
3215
+ ref: datePickerRef,
3216
+ class: "outlined-date-time-picker__control",
3217
+ "model-value": dateValue.value,
3218
+ type: "date",
3219
+ format: "YYYY-MM-DD",
3220
+ "value-format": "YYYY-MM-DD",
3221
+ placeholder: datePlaceholder.value,
3222
+ clearable: __props.clearable,
3223
+ "disabled-date": resolvedDisabledDate.value,
3224
+ style: normalizeStyle(controlStyle.value),
3225
+ "aria-invalid": hasError.value ? "true" : void 0,
3226
+ "onUpdate:modelValue": handleDateUpdate,
3227
+ onFocus: _cache[0] || (_cache[0] = ($event) => handleFocus("date")),
3228
+ onBlur: _cache[1] || (_cache[1] = ($event) => handleBlur("date", $event)),
3229
+ onChange: handleDateChange,
3230
+ onVisibleChange: _cache[2] || (_cache[2] = ($event) => handleVisibleChange("date", $event))
3231
+ }, null, 8, ["model-value", "placeholder", "clearable", "disabled-date", "style", "aria-invalid"]),
3232
+ floatingLabel.value ? (openBlock(), createElementBlock("div", {
3233
+ key: 0,
3234
+ class: normalizeClass(["outlined-date-time-picker__label", dateLabelClasses.value])
3235
+ }, [
3236
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_2$3, "*")) : createCommentVNode("", true),
3237
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
3238
+ ], 2)) : createCommentVNode("", true)
3239
+ ], 2),
3240
+ createElementVNode("span", _hoisted_3, toDisplayString(__props.separatorText), 1),
3140
3241
  createElementVNode("div", {
3141
- class: normalizeClass(["outlined-date-time-picker__label", timeLabelClasses.value])
3142
- }, toDisplayString(__props.timePlaceholder), 3)
3143
- ], 6)
3242
+ class: normalizeClass(["outlined-date-time-picker__field", fieldClasses.value])
3243
+ }, [
3244
+ createVNode(_component_el_time_picker, {
3245
+ ref_key: "timePickerRef",
3246
+ ref: timePickerRef,
3247
+ class: "outlined-date-time-picker__control",
3248
+ "model-value": timeValue.value,
3249
+ format: "HH:mm",
3250
+ "value-format": "HH:mm",
3251
+ placeholder: timeControlPlaceholder.value,
3252
+ clearable: __props.clearable,
3253
+ disabled: !dateValue.value,
3254
+ "disabled-hours": resolvedDisabledHours.value,
3255
+ "disabled-minutes": resolvedDisabledMinutes.value,
3256
+ style: normalizeStyle(controlStyle.value),
3257
+ "aria-invalid": hasError.value ? "true" : void 0,
3258
+ "onUpdate:modelValue": handleTimeUpdate,
3259
+ onFocus: _cache[3] || (_cache[3] = ($event) => handleFocus("time")),
3260
+ onBlur: _cache[4] || (_cache[4] = ($event) => handleBlur("time", $event)),
3261
+ onChange: handleTimeChange,
3262
+ onVisibleChange: _cache[5] || (_cache[5] = ($event) => handleVisibleChange("time", $event))
3263
+ }, null, 8, ["model-value", "placeholder", "clearable", "disabled", "disabled-hours", "disabled-minutes", "style", "aria-invalid"]),
3264
+ createElementVNode("div", {
3265
+ class: normalizeClass(["outlined-date-time-picker__label", timeLabelClasses.value])
3266
+ }, [
3267
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_4, "*")) : createCommentVNode("", true),
3268
+ createElementVNode("span", null, toDisplayString(__props.timePlaceholder), 1)
3269
+ ], 2)
3270
+ ], 2)
3271
+ ]),
3272
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_5, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
3144
3273
  ], 6);
3145
3274
  };
3146
3275
  }
3147
3276
  });
3148
- var OutlinedDateTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-f2fefd22"]]);
3277
+ var OutlinedDateTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-ee2ef524"]]);
3149
3278
  var OutlinedTimePicker_vue_vue_type_style_index_0_scoped_true_lang = "";
3279
+ const _hoisted_1$2 = {
3280
+ key: 0,
3281
+ class: "outlined-time-picker__required"
3282
+ };
3283
+ const _hoisted_2$2 = {
3284
+ key: 1,
3285
+ class: "outlined-time-picker__error"
3286
+ };
3150
3287
  const _sfc_main$2 = defineComponent({
3151
3288
  ...{
3152
3289
  name: "OutlinedTimePicker",
@@ -3169,7 +3306,10 @@ const _sfc_main$2 = defineComponent({
3169
3306
  inputHeight: { default: 40 },
3170
3307
  isBorder: { type: Boolean, default: false },
3171
3308
  marginBottom: { default: 20 },
3172
- paddingTop: { default: 20 }
3309
+ paddingTop: { default: 20 },
3310
+ required: { type: Boolean, default: false },
3311
+ error: { type: Boolean, default: false },
3312
+ errorMessage: { default: "" }
3173
3313
  },
3174
3314
  emits: ["input", "update:value", "change", "focus", "blur", "visible-change", "clear"],
3175
3315
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -3196,7 +3336,8 @@ const _sfc_main$2 = defineComponent({
3196
3336
  return rest;
3197
3337
  });
3198
3338
  const containerClasses = computed(() => ({
3199
- "outlined-time-picker--bordered": props.isBorder
3339
+ "outlined-time-picker--bordered": props.isBorder,
3340
+ "outlined-time-picker--error": hasError.value
3200
3341
  }));
3201
3342
  const containerStyle = computed(() => ({
3202
3343
  marginBottom: toCssValue(props.marginBottom),
@@ -3206,6 +3347,11 @@ const _sfc_main$2 = defineComponent({
3206
3347
  height: `${props.inputHeight}px`
3207
3348
  }));
3208
3349
  const floatingLabel = computed(() => props.label || props.placeholder || "");
3350
+ const controlPlaceholder = computed(() => addRequiredMark(props.placeholder));
3351
+ const controlStartPlaceholder = computed(() => addRequiredMark(props.startPlaceholder));
3352
+ const controlEndPlaceholder = computed(() => addRequiredMark(props.endPlaceholder));
3353
+ const hasError = computed(() => Boolean(props.error));
3354
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
3209
3355
  const hasContent = computed(() => {
3210
3356
  if (Array.isArray(pickerValue.value)) {
3211
3357
  return pickerValue.value.length > 0;
@@ -3275,6 +3421,15 @@ const _sfc_main$2 = defineComponent({
3275
3421
  }
3276
3422
  return value;
3277
3423
  }
3424
+ function addRequiredMark(value) {
3425
+ if (!props.required || !value || value.startsWith("*")) {
3426
+ return value;
3427
+ }
3428
+ return `*${value}`;
3429
+ }
3430
+ function createRequiredMessage(label) {
3431
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
3432
+ }
3278
3433
  __expose({
3279
3434
  focus: () => {
3280
3435
  var _a, _b;
@@ -3316,31 +3471,44 @@ const _sfc_main$2 = defineComponent({
3316
3471
  "is-range": __props.isRange,
3317
3472
  format: __props.format,
3318
3473
  "value-format": resolvedValueFormat.value,
3319
- placeholder: __props.placeholder,
3320
- "start-placeholder": __props.startPlaceholder,
3321
- "end-placeholder": __props.endPlaceholder,
3474
+ placeholder: controlPlaceholder.value,
3475
+ "start-placeholder": controlStartPlaceholder.value,
3476
+ "end-placeholder": controlEndPlaceholder.value,
3322
3477
  "range-separator": __props.rangeSeparator,
3323
3478
  disabled: __props.disabled,
3324
3479
  clearable: __props.clearable,
3325
3480
  "arrow-control": __props.arrowControl,
3326
3481
  style: pickerStyle.value,
3482
+ "aria-invalid": hasError.value ? "true" : void 0,
3327
3483
  "onUpdate:modelValue": handleModelValueUpdate,
3328
3484
  onFocus: handleFocus,
3329
3485
  onBlur: handleBlur,
3330
3486
  onChange: handleChange,
3331
3487
  onVisibleChange: handleVisibleChange,
3332
3488
  onClear: handleClear
3333
- }), null, 16, ["model-value", "is-range", "format", "value-format", "placeholder", "start-placeholder", "end-placeholder", "range-separator", "disabled", "clearable", "arrow-control", "style"]),
3489
+ }), null, 16, ["model-value", "is-range", "format", "value-format", "placeholder", "start-placeholder", "end-placeholder", "range-separator", "disabled", "clearable", "arrow-control", "style", "aria-invalid"]),
3334
3490
  floatingLabel.value ? (openBlock(), createElementBlock("div", {
3335
3491
  key: 0,
3336
3492
  class: normalizeClass(["outlined-time-picker__label", labelClasses.value])
3337
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
3493
+ }, [
3494
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_1$2, "*")) : createCommentVNode("", true),
3495
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
3496
+ ], 2)) : createCommentVNode("", true),
3497
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_2$2, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
3338
3498
  ], 6);
3339
3499
  };
3340
3500
  }
3341
3501
  });
3342
- var OutlinedTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-6a467b88"]]);
3502
+ var OutlinedTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-0257087e"]]);
3343
3503
  var OutlinedCascader_vue_vue_type_style_index_0_scoped_true_lang = "";
3504
+ const _hoisted_1$1 = {
3505
+ key: 0,
3506
+ class: "outlined-cascader__required"
3507
+ };
3508
+ const _hoisted_2$1 = {
3509
+ key: 1,
3510
+ class: "outlined-cascader__error"
3511
+ };
3344
3512
  const _sfc_main$1 = defineComponent({
3345
3513
  ...{
3346
3514
  name: "OutlinedCascader",
@@ -3361,7 +3529,10 @@ const _sfc_main$1 = defineComponent({
3361
3529
  filterable: { type: Boolean, default: true },
3362
3530
  levels: { type: Boolean, default: true },
3363
3531
  marginBottom: { default: 20 },
3364
- paddingTop: { default: 20 }
3532
+ paddingTop: { default: 20 },
3533
+ required: { type: Boolean, default: false },
3534
+ error: { type: Boolean, default: false },
3535
+ errorMessage: { default: "" }
3365
3536
  },
3366
3537
  emits: ["input", "update:value", "change", "focus", "blur", "visible-change"],
3367
3538
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -3387,7 +3558,8 @@ const _sfc_main$1 = defineComponent({
3387
3558
  return rest;
3388
3559
  });
3389
3560
  const containerClasses = computed(() => ({
3390
- "outlined-cascader--bordered": props.isBorder
3561
+ "outlined-cascader--bordered": props.isBorder,
3562
+ "outlined-cascader--error": hasError.value
3391
3563
  }));
3392
3564
  const containerStyle = computed(() => ({
3393
3565
  marginBottom: toCssValue(props.marginBottom),
@@ -3398,6 +3570,9 @@ const _sfc_main$1 = defineComponent({
3398
3570
  height: `${props.inputHeight}px`
3399
3571
  }));
3400
3572
  const floatingLabel = computed(() => props.label || props.placeholder || "");
3573
+ const controlPlaceholder = computed(() => addRequiredMark(props.placeholder));
3574
+ const hasError = computed(() => Boolean(props.error));
3575
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
3401
3576
  const hasContent = computed(() => cascaderValue.value.length > 0);
3402
3577
  const labelClasses = computed(() => ({
3403
3578
  "outlined-cascader__label--floating": focused.value || hasContent.value,
@@ -3447,6 +3622,15 @@ const _sfc_main$1 = defineComponent({
3447
3622
  }
3448
3623
  return value;
3449
3624
  }
3625
+ function addRequiredMark(value) {
3626
+ if (!props.required || !value || value.startsWith("*")) {
3627
+ return value;
3628
+ }
3629
+ return `*${value}`;
3630
+ }
3631
+ function createRequiredMessage(label) {
3632
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
3633
+ }
3450
3634
  __expose({
3451
3635
  focus: () => {
3452
3636
  var _a, _b;
@@ -3482,28 +3666,41 @@ const _sfc_main$1 = defineComponent({
3482
3666
  options: __props.options,
3483
3667
  props: __props.propsValue,
3484
3668
  clearable: __props.clearable,
3485
- placeholder: __props.placeholder,
3669
+ placeholder: controlPlaceholder.value,
3486
3670
  filterable: __props.filterable,
3487
3671
  "show-all-levels": __props.levels,
3488
3672
  disabled: __props.disabled,
3489
3673
  "popper-class": __props.popperClass,
3490
3674
  style: cascaderStyle.value,
3675
+ "aria-invalid": hasError.value ? "true" : void 0,
3491
3676
  "onUpdate:modelValue": handleModelValueUpdate,
3492
3677
  onFocus: handleFocus,
3493
3678
  onBlur: handleBlur,
3494
3679
  onChange: handleChange,
3495
3680
  onVisibleChange: handleVisibleChange
3496
- }), null, 16, ["model-value", "options", "props", "clearable", "placeholder", "filterable", "show-all-levels", "disabled", "popper-class", "style"]),
3681
+ }), null, 16, ["model-value", "options", "props", "clearable", "placeholder", "filterable", "show-all-levels", "disabled", "popper-class", "style", "aria-invalid"]),
3497
3682
  floatingLabel.value ? (openBlock(), createElementBlock("div", {
3498
3683
  key: 0,
3499
3684
  class: normalizeClass(["outlined-cascader__label", labelClasses.value])
3500
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
3685
+ }, [
3686
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_1$1, "*")) : createCommentVNode("", true),
3687
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
3688
+ ], 2)) : createCommentVNode("", true),
3689
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_2$1, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
3501
3690
  ], 6);
3502
3691
  };
3503
3692
  }
3504
3693
  });
3505
- var OutlinedCascader = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-2c93c0e4"]]);
3694
+ var OutlinedCascader = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-033e3fab"]]);
3506
3695
  var OutlinedTreeSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
3696
+ const _hoisted_1 = {
3697
+ key: 0,
3698
+ class: "outlined-tree-select__required"
3699
+ };
3700
+ const _hoisted_2 = {
3701
+ key: 1,
3702
+ class: "outlined-tree-select__error"
3703
+ };
3507
3704
  const _sfc_main = defineComponent({
3508
3705
  ...{
3509
3706
  name: "OutlinedTreeSelect",
@@ -3538,7 +3735,10 @@ const _sfc_main = defineComponent({
3538
3735
  inputHeight: { default: 40 },
3539
3736
  isBorder: { type: Boolean, default: false },
3540
3737
  marginBottom: { default: 20 },
3541
- paddingTop: { default: 20 }
3738
+ paddingTop: { default: 20 },
3739
+ required: { type: Boolean, default: false },
3740
+ error: { type: Boolean, default: false },
3741
+ errorMessage: { default: "" }
3542
3742
  },
3543
3743
  emits: ["input", "update:value", "change", "focus", "blur", "visible-change", "clear"],
3544
3744
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -3564,7 +3764,8 @@ const _sfc_main = defineComponent({
3564
3764
  return rest;
3565
3765
  });
3566
3766
  const containerClasses = computed(() => ({
3567
- "outlined-tree-select--bordered": props.isBorder
3767
+ "outlined-tree-select--bordered": props.isBorder,
3768
+ "outlined-tree-select--error": hasError.value
3568
3769
  }));
3569
3770
  const containerStyle = computed(() => ({
3570
3771
  marginBottom: toCssValue(props.marginBottom),
@@ -3586,6 +3787,9 @@ const _sfc_main = defineComponent({
3586
3787
  };
3587
3788
  });
3588
3789
  const floatingLabel = computed(() => props.label || props.placeholder || "");
3790
+ const controlPlaceholder = computed(() => addRequiredMark(props.placeholder));
3791
+ const hasError = computed(() => Boolean(props.error));
3792
+ const resolvedErrorMessage = computed(() => props.errorMessage || createRequiredMessage(floatingLabel.value));
3589
3793
  const hasContent = computed(() => {
3590
3794
  if (isArrayMode()) {
3591
3795
  return Array.isArray(treeSelectValue.value) && treeSelectValue.value.length > 0;
@@ -3658,6 +3862,15 @@ const _sfc_main = defineComponent({
3658
3862
  }
3659
3863
  return value;
3660
3864
  }
3865
+ function addRequiredMark(value) {
3866
+ if (!props.required || !value || value.startsWith("*")) {
3867
+ return value;
3868
+ }
3869
+ return `*${value}`;
3870
+ }
3871
+ function createRequiredMessage(label) {
3872
+ return label ? `${label}\u4E3A\u5FC5\u586B\u9879` : "\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879";
3873
+ }
3661
3874
  __expose({
3662
3875
  focus: () => {
3663
3876
  var _a, _b;
@@ -3696,7 +3909,7 @@ const _sfc_main = defineComponent({
3696
3909
  "model-value": treeSelectValue.value,
3697
3910
  data: __props.data,
3698
3911
  props: resolvedTreeProps.value,
3699
- placeholder: __props.placeholder,
3912
+ placeholder: controlPlaceholder.value,
3700
3913
  disabled: __props.disabled,
3701
3914
  clearable: __props.clearable,
3702
3915
  filterable: __props.filterable,
@@ -3713,6 +3926,7 @@ const _sfc_main = defineComponent({
3713
3926
  "popper-class": __props.popperClass,
3714
3927
  "node-key": __props.nodeKey,
3715
3928
  style: treeSelectStyle.value,
3929
+ "aria-invalid": hasError.value ? "true" : void 0,
3716
3930
  "onUpdate:modelValue": handleModelValueUpdate,
3717
3931
  onFocus: handleFocus,
3718
3932
  onBlur: handleBlur,
@@ -3730,15 +3944,19 @@ const _sfc_main = defineComponent({
3730
3944
  renderSlot(_ctx.$slots, "footer", {}, void 0, true)
3731
3945
  ]),
3732
3946
  _: 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"]),
3947
+ }, 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
3948
  floatingLabel.value ? (openBlock(), createElementBlock("div", {
3735
3949
  key: 0,
3736
3950
  class: normalizeClass(["outlined-tree-select__label", labelClasses.value])
3737
- }, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
3951
+ }, [
3952
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_1, "*")) : createCommentVNode("", true),
3953
+ createElementVNode("span", null, toDisplayString(floatingLabel.value), 1)
3954
+ ], 2)) : createCommentVNode("", true),
3955
+ hasError.value ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(resolvedErrorMessage.value), 1)) : createCommentVNode("", true)
3738
3956
  ], 6);
3739
3957
  };
3740
3958
  }
3741
3959
  });
3742
- var OutlinedTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8403e6ea"]]);
3960
+ var OutlinedTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-30d7dee0"]]);
3743
3961
  installRipple();
3744
3962
  export { BaseCard, BaseEChart, _sfc_main$7 as BaseExportButton, BaseTable, OutlinedCascader, OutlinedDatePicker, OutlinedDateTimePicker, OutlinedInput, OutlinedSelect, OutlinedTimePicker, OutlinedTreeSelect, downloadExportResponse, exportExcel, extractFileNameFromDisposition, installRipple, normalizeExportFileName, uninstallRipple };