hys-ui 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +111 -0
- package/README.md +3 -1
- package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
- package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +627 -0
- package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
- package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +252 -0
- package/dist/components/HysBadge/HysBadge.vue.js +2 -2
- package/dist/components/HysBadge/HysBadge2.vue.js +154 -27
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +74 -2
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +29 -28
- package/dist/components/HysCalendar/HysCalendar.vue.js +5 -92
- package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
- package/dist/components/HysCard/HysCard.vue.js +2 -2
- package/dist/components/HysCard/HysCard2.vue.js +175 -42
- package/dist/components/HysCascader/HysCascader.vue.js +5 -194
- package/dist/components/HysCascader/HysCascader2.vue.js +760 -2
- package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
- package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +3 -3
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +180 -65
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +107 -106
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +399 -392
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +268 -139
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +807 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +268 -158
- package/dist/components/HysDivider/HysDivider.vue.js +2 -2
- package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
- package/dist/components/HysFileManager/HysFileManager.vue.js +3 -3
- package/dist/components/HysFileManager/HysFileManager2.vue.js +43 -42
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +578 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -85
- package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +1369 -272
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +467 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +89 -88
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -79
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +29 -26
- package/dist/components/HysPagination/HysPagination.vue.js +1 -1
- package/dist/components/HysPagination/HysPagination2.vue.js +2 -0
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +2 -2
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +52 -51
- package/dist/components/HysRadio/HysRadio.vue.js +7 -0
- package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +2 -2
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +190 -65
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +1 -1
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +70 -69
- package/dist/components/HysSearch/HysSearch.vue.js +37 -36
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -63
- package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
- package/dist/components/HysSelect/HysSelect.vue.js +3 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +859 -185
- package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
- package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +532 -59
- package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
- package/dist/components/HysSlider/SliderTooltip2.vue.js +156 -0
- package/dist/components/HysSteps/HysSteps.vue.js +1 -1
- package/dist/components/HysSteps/HysSteps2.vue.js +110 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +232 -50
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +1473 -88
- package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
- package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
- package/dist/components/HysTabs/HysTabs.vue.js +2 -2
- package/dist/components/HysTabs/HysTabs2.vue.js +262 -68
- package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
- package/dist/components/HysTextarea/HysTextarea.vue.js +138 -77
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -223
- package/dist/components/HysTransfer/HysTransfer2.vue.js +416 -2
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +454 -0
- package/dist/components/HysTree/HysTree.vue.js +2 -3
- package/dist/components/HysTree/HysTree2.vue.js +641 -302
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -136
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +558 -2
- package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
- package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +77 -76
- package/dist/composables/autocomplete.js +50 -0
- package/dist/composables/avatar.js +57 -0
- package/dist/composables/calendar.js +96 -0
- package/dist/composables/cascader.js +79 -0
- package/dist/composables/choice.js +38 -0
- package/dist/composables/choiceModel.js +67 -0
- package/dist/composables/datePicker.js +227 -0
- package/dist/composables/formContext.js +92 -7
- package/dist/composables/formLayout.js +57 -0
- package/dist/composables/formValidation.js +240 -0
- package/dist/composables/ganttConflicts.js +143 -0
- package/dist/composables/numberInput.js +91 -0
- package/dist/composables/rating.js +16 -0
- package/dist/composables/selectOptions.js +54 -0
- package/dist/composables/table.js +150 -0
- package/dist/composables/textInput.js +34 -0
- package/dist/composables/transfer.js +63 -0
- package/dist/composables/tree.js +118 -0
- package/dist/composables/treeSelect.js +71 -0
- package/dist/composables/useCascader.js +438 -0
- package/dist/composables/useDatePicker.js +425 -0
- package/dist/composables/useFloating.js +97 -51
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useTable.js +474 -0
- package/dist/composables/useTextareaSize.js +72 -0
- package/dist/composables/useTransfer.js +257 -0
- package/dist/composables/useTree.js +439 -0
- package/dist/composables/useTreeSelect.js +361 -0
- package/dist/index.js +149 -139
- package/dist/style.css +1 -1
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
- package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +99 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +38 -10
- package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +119 -31
- package/dist/types/components/HysCard/HysCard.vue.d.ts +55 -7
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +50 -39
- package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +1 -1
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
- package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
- package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +82 -4
- package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
- package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -2
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -35
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +1 -0
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +2 -2
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +3 -3
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
- package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +34 -12
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
- package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +120 -20
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +66 -9
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +22 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +1 -1
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +64 -9
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
- package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
- package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +5 -5
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
- package/dist/types/components/HysToast/HysToast.vue.d.ts +3 -3
- package/dist/types/components/HysTour/HysTour.vue.d.ts +2 -2
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -40
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +105 -0
- package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
- package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
- package/dist/types/composables/autocomplete.d.ts +106 -0
- package/dist/types/composables/avatar.d.ts +70 -0
- package/dist/types/composables/calendar.d.ts +66 -0
- package/dist/types/composables/cascader.d.ts +192 -0
- package/dist/types/composables/choice.d.ts +110 -0
- package/dist/types/composables/choiceModel.d.ts +11 -0
- package/dist/types/composables/datePicker.d.ts +247 -0
- package/dist/types/composables/formContext.d.ts +133 -8
- package/dist/types/composables/formLayout.d.ts +11 -0
- package/dist/types/composables/formValidation.d.ts +13 -0
- package/dist/types/composables/gantt.d.ts +68 -0
- package/dist/types/composables/ganttConflicts.d.ts +30 -0
- package/dist/types/composables/numberInput.d.ts +45 -0
- package/dist/types/composables/rating.d.ts +18 -0
- package/dist/types/composables/segmented.d.ts +15 -0
- package/dist/types/composables/selectOptions.d.ts +44 -0
- package/dist/types/composables/slider.d.ts +21 -0
- package/dist/types/composables/table.d.ts +309 -0
- package/dist/types/composables/textInput.d.ts +76 -0
- package/dist/types/composables/transfer.d.ts +180 -0
- package/dist/types/composables/tree.d.ts +237 -0
- package/dist/types/composables/treeSelect.d.ts +167 -0
- package/dist/types/composables/useCascader.d.ts +162 -0
- package/dist/types/composables/useDatePicker.d.ts +79 -0
- package/dist/types/composables/useFloating.d.ts +8 -5
- package/dist/types/composables/useGanttDependencies.d.ts +83 -0
- package/dist/types/composables/useGanttHistory.d.ts +42 -0
- package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
- package/dist/types/composables/useTable.d.ts +60 -0
- package/dist/types/composables/useTextareaSize.d.ts +3 -0
- package/dist/types/composables/useTransfer.d.ts +58 -0
- package/dist/types/composables/useTree.d.ts +77 -0
- package/dist/types/composables/useTreeSelect.d.ts +117 -0
- package/dist/types/index.d.ts +33 -7
- package/package.json +2 -1
|
@@ -1,125 +1,611 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { formKey as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent as cl, ref as V, shallowRef as dl, computed as r, provide as vl, watch as Y, nextTick as G, onActivated as fl, onDeactivated as pl, onBeforeUnmount as gl, openBlock as qe, createElementBlock as Ie, mergeProps as ml, unref as bl, withModifiers as Le, createElementVNode as yl, renderSlot as _e, createCommentVNode as hl } from "vue";
|
|
2
|
+
import { formPath as T, formKey as wl, formValue as g, setFormValue as Z, focusHysField as Fl } from "../../composables/formContext.js";
|
|
3
|
+
import { useFormWidth as kl, resolveFormGrid as Ml, resolveFormCol as Ol } from "../../composables/formLayout.js";
|
|
4
|
+
import { snapshotForm as d, sameFormValue as H, nestedFormRules as ze, runFormRules as $e } from "../../composables/formValidation.js";
|
|
5
|
+
import { useHysRootAttrs as jl } from "../../config.js";
|
|
6
|
+
const Bl = ["aria-busy"], Pl = ["disabled", "inert"], Vl = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "hys-ui-ent-form-actions"
|
|
9
|
+
}, Sl = /* @__PURE__ */ cl({
|
|
5
10
|
__name: "HysForm",
|
|
6
11
|
props: {
|
|
7
12
|
model: {},
|
|
8
13
|
rules: { default: () => ({}) },
|
|
9
14
|
validate: {},
|
|
15
|
+
validateMessages: {},
|
|
16
|
+
validateOnRuleChange: { type: Boolean, default: !0 },
|
|
17
|
+
validateTrigger: { default: () => ["change", "blur"] },
|
|
18
|
+
initialValues: {},
|
|
10
19
|
loading: { type: Boolean },
|
|
11
20
|
disabled: { type: Boolean },
|
|
12
21
|
inline: { type: Boolean },
|
|
22
|
+
layout: {},
|
|
23
|
+
columns: { default: 1 },
|
|
24
|
+
gap: { default: 20 },
|
|
25
|
+
size: { default: "md" },
|
|
13
26
|
labelPosition: { default: "top" },
|
|
14
|
-
labelWidth: { default: "100px" }
|
|
27
|
+
labelWidth: { default: "100px" },
|
|
28
|
+
labelAlign: {},
|
|
29
|
+
labelWrap: { type: Boolean, default: !0 },
|
|
30
|
+
labelSuffix: { default: "" },
|
|
31
|
+
colon: { type: Boolean },
|
|
32
|
+
labelCol: {},
|
|
33
|
+
wrapperCol: {},
|
|
34
|
+
showLabel: { type: Boolean, default: !0 },
|
|
35
|
+
showFeedback: { type: Boolean, default: !0 },
|
|
36
|
+
showRequiredMark: { type: Boolean, default: !0 },
|
|
37
|
+
requiredMarkPosition: { default: "right" },
|
|
38
|
+
optionalMark: { default: "" },
|
|
39
|
+
inlineFeedback: { type: Boolean },
|
|
40
|
+
feedbackIcon: { type: Boolean },
|
|
41
|
+
validateFirst: { type: Boolean, default: !0 },
|
|
42
|
+
preserve: { type: Boolean, default: !0 },
|
|
43
|
+
scrollToError: { type: Boolean, default: !1 },
|
|
44
|
+
focusOnError: { type: Boolean, default: !0 }
|
|
15
45
|
},
|
|
16
|
-
emits: ["submit", "invalid", "reset"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
46
|
+
emits: ["submit", "invalid", "reset", "validate", "validation"],
|
|
47
|
+
setup(N, { expose: Ge, emit: He }) {
|
|
48
|
+
const a = N, D = He, Ne = jl(), ee = V(), v = V({}), f = V({}), p = V({}), M = V(!1), ce = V(!1), E = V(!1), O = V({}), j = V({}), m = dl([]), R = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), de = /* @__PURE__ */ new Set(), W = /* @__PURE__ */ new Map(), K = /* @__PURE__ */ new Map(), le = r(
|
|
49
|
+
() => Object.fromEntries(
|
|
50
|
+
Object.entries(a.rules).map(([e, l]) => [T(e), l])
|
|
51
|
+
)
|
|
52
|
+
), x = r(() => !!(a.disabled || a.loading)), ve = r(
|
|
53
|
+
() => typeof a.labelWidth == "number" ? a.labelWidth + "px" : a.labelWidth
|
|
54
|
+
), te = kl(ee), we = r(
|
|
55
|
+
() => Ml(a.columns, te.value)
|
|
56
|
+
), De = r(
|
|
57
|
+
() => a.layout === "inline" || !a.layout && a.inline
|
|
58
|
+
), ae = r(
|
|
59
|
+
() => a.layout === "vertical" ? "top" : a.layout === "horizontal" && a.labelPosition === "top" ? "right" : a.labelPosition
|
|
60
|
+
), Ke = r(
|
|
61
|
+
() => a.labelAlign ?? (ae.value === "right" ? "right" : "left")
|
|
62
|
+
), I = V({}), Fe = r(
|
|
63
|
+
() => Math.min(
|
|
64
|
+
Math.max(0, ...Object.values(I.value)),
|
|
65
|
+
te.value * 0.45 || 1 / 0
|
|
66
|
+
) + "px"
|
|
67
|
+
);
|
|
68
|
+
function Ue(e, l) {
|
|
69
|
+
if (l === void 0) {
|
|
70
|
+
if (e in I.value) {
|
|
71
|
+
const t = { ...I.value };
|
|
72
|
+
delete t[e], I.value = t;
|
|
73
|
+
}
|
|
74
|
+
} else I.value[e] !== l && (I.value = { ...I.value, [e]: l });
|
|
75
|
+
}
|
|
76
|
+
const ke = r(
|
|
77
|
+
() => ve.value === "auto" ? Fe.value : ve.value
|
|
78
|
+
), Je = r(() => {
|
|
79
|
+
const e = Ol(a.labelCol, te.value);
|
|
80
|
+
return {
|
|
81
|
+
"--hys-ui-form-label-width": ke.value,
|
|
82
|
+
"--hys-ui-form-columns": we.value,
|
|
83
|
+
"--hys-ui-form-gap": typeof a.gap == "number" ? a.gap + "px" : a.gap,
|
|
84
|
+
"--hys-ui-form-actions-offset": a.showLabel && ae.value !== "top" ? e ? "calc(" + ((e.span ?? 0) + (e.offset ?? 0)) / 24 * 100 + "% + 14px)" : "calc(" + ke.value + " + 14px)" : "0px"
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
let B = d(a.initialValues ?? a.model ?? {}), b = !0, k = 0, Me = 0, L = 0, oe = 0, _ = 0, Oe = d(a.rules), P, fe;
|
|
88
|
+
function pe() {
|
|
89
|
+
clearTimeout(fe), fe = void 0, ce.value = !1;
|
|
90
|
+
}
|
|
91
|
+
function Qe(e) {
|
|
92
|
+
if (e.button !== 0 || !(e.target instanceof Element)) return;
|
|
93
|
+
const l = e.target.closest(
|
|
94
|
+
"button,input"
|
|
95
|
+
);
|
|
96
|
+
!l || l.form !== ee.value || l.disabled || !["submit", "image"].includes(l.type) || (pe(), ce.value = !0, fe = setTimeout(pe, 0));
|
|
97
|
+
}
|
|
98
|
+
const U = (e) => ({
|
|
99
|
+
status: v.value[e] ? "error" : f.value[e] ? "warning" : "idle",
|
|
100
|
+
message: v.value[e] || "",
|
|
101
|
+
warning: f.value[e] || "",
|
|
102
|
+
validating: !1
|
|
103
|
+
}), J = (e) => m.value.find((l) => l.path.value === T(e)), Xe = () => [...m.value], je = (e) => ze(e, le.value).rules.concat(
|
|
104
|
+
m.value.filter((l) => l.path.value === e).flatMap((l) => l.rules.value)
|
|
105
|
+
);
|
|
106
|
+
function ie() {
|
|
107
|
+
return [
|
|
108
|
+
.../* @__PURE__ */ new Set([
|
|
109
|
+
...m.value.map((e) => e.path.value),
|
|
110
|
+
...Object.keys(le.value),
|
|
111
|
+
...Object.keys(v.value),
|
|
112
|
+
...Object.keys(f.value),
|
|
113
|
+
...R.keys()
|
|
114
|
+
])
|
|
115
|
+
].filter((e) => !!e && !de.has(e));
|
|
116
|
+
}
|
|
117
|
+
function $(e, l) {
|
|
118
|
+
if (e === void 0) return [...new Set(l)];
|
|
119
|
+
const t = (typeof e == "string" ? [e] : e).map(T), o = ie();
|
|
120
|
+
return [
|
|
121
|
+
...new Set(
|
|
122
|
+
t.flatMap((u) => [
|
|
123
|
+
u,
|
|
124
|
+
...o.filter((y) => y.startsWith(u + "."))
|
|
125
|
+
])
|
|
126
|
+
)
|
|
127
|
+
];
|
|
29
128
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
for (const
|
|
40
|
-
|
|
129
|
+
function ge(e) {
|
|
130
|
+
var l;
|
|
131
|
+
R.set(e, ++Me), (l = W.get(e)) == null || l.cancel(), W.delete(e), K.delete(e), p.value = { ...p.value, [e]: U(e) };
|
|
132
|
+
}
|
|
133
|
+
function Be() {
|
|
134
|
+
L++, E.value = !1, P == null || P.abort(), P = void 0;
|
|
135
|
+
}
|
|
136
|
+
function C() {
|
|
137
|
+
pe(), k++, Be(), oe++;
|
|
138
|
+
for (const e of W.values()) e.cancel();
|
|
139
|
+
W.clear(), K.clear();
|
|
140
|
+
for (const e of R.keys()) ge(e);
|
|
141
|
+
}
|
|
142
|
+
function Q(e) {
|
|
143
|
+
Be();
|
|
144
|
+
for (const l of $(e, ie()))
|
|
145
|
+
ge(l), delete v.value[l], delete f.value[l], delete O.value[l], delete j.value[l], p.value = { ...p.value, [l]: U(l) };
|
|
146
|
+
}
|
|
147
|
+
function Pe(e, l) {
|
|
148
|
+
const t = W.get(e);
|
|
149
|
+
if (l && (t != null && t.full) && !t.signal.aborted && t.epoch === k && t.version === _ && H(t.value, g(a.model, e)))
|
|
150
|
+
return t.promise;
|
|
151
|
+
t == null || t.cancel(), l || K.delete(e);
|
|
152
|
+
const o = new AbortController();
|
|
153
|
+
let u;
|
|
154
|
+
const y = new Promise(
|
|
155
|
+
(s) => {
|
|
156
|
+
u = s;
|
|
157
|
+
}
|
|
158
|
+
), n = {
|
|
159
|
+
promise: Promise.race([
|
|
160
|
+
Ye(e, l, o.signal),
|
|
161
|
+
y
|
|
162
|
+
]),
|
|
163
|
+
value: d(g(a.model, e)),
|
|
164
|
+
full: !l,
|
|
165
|
+
epoch: k,
|
|
166
|
+
version: _,
|
|
167
|
+
token: R.get(e) ?? 0,
|
|
168
|
+
signal: o.signal,
|
|
169
|
+
cancel: () => {
|
|
170
|
+
o.abort(), u({ valid: !1, cancelled: !0 });
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
return W.set(e, n), n.promise.then((s) => {
|
|
174
|
+
n.full && !s.cancelled && !n.signal.aborted && n.token === R.get(e) && K.set(e, {
|
|
175
|
+
result: s,
|
|
176
|
+
value: n.value,
|
|
177
|
+
epoch: n.epoch,
|
|
178
|
+
version: n.version,
|
|
179
|
+
token: n.token
|
|
180
|
+
}), W.get(e) === n && W.delete(e);
|
|
181
|
+
}), n.promise;
|
|
182
|
+
}
|
|
183
|
+
async function Ye(e, l, t) {
|
|
184
|
+
var X, Se, Te;
|
|
185
|
+
if (!b) return { valid: !1, cancelled: !0 };
|
|
186
|
+
const o = J(e), u = (o == null ? void 0 : o.trigger.value) ?? a.validateTrigger;
|
|
187
|
+
if (l && (![u].flat().includes(l) || x.value || M.value))
|
|
188
|
+
return { valid: !v.value[e], cancelled: !1 };
|
|
189
|
+
const y = je(e), n = y.filter(
|
|
190
|
+
(F) => !l || !F.trigger || [F.trigger].flat().includes(l)
|
|
191
|
+
);
|
|
192
|
+
if (l && y.length && !n.length)
|
|
193
|
+
return { valid: !v.value[e], cancelled: !1 };
|
|
194
|
+
const s = ++Me, q = k, z = d(a.model ?? {}), ne = g(z, e), i = (((X = o == null ? void 0 : o.dependencies) == null ? void 0 : X.value) ?? []).map((F) => ({
|
|
195
|
+
path: F,
|
|
196
|
+
value: d(g(z, F))
|
|
197
|
+
}));
|
|
198
|
+
R.set(e, s), p.value = {
|
|
199
|
+
...p.value,
|
|
200
|
+
[e]: { ...U(e), status: "validating", validating: !0 }
|
|
201
|
+
};
|
|
202
|
+
const A = () => b && !t.aborted && q === k && R.get(e) === s && H(ne, g(a.model, e)) && i.every(
|
|
203
|
+
(F) => H(F.value, g(a.model, F.path))
|
|
204
|
+
);
|
|
205
|
+
let c = "", h = "";
|
|
206
|
+
try {
|
|
207
|
+
let F = ne;
|
|
41
208
|
try {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
} catch (c) {
|
|
49
|
-
a = c instanceof Error ? c.message : s.message || "校验失败";
|
|
209
|
+
F = ze(e, le.value, z).value;
|
|
210
|
+
} catch (S) {
|
|
211
|
+
n.splice(0, n.length, {
|
|
212
|
+
validator: () => S instanceof Error ? S : String(S)
|
|
213
|
+
});
|
|
50
214
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
215
|
+
const Ce = ((Se = o == null ? void 0 : o.validateFirst) == null ? void 0 : Se.value) ?? a.validateFirst, ye = $e(
|
|
216
|
+
e,
|
|
217
|
+
F,
|
|
218
|
+
n.filter((S) => S.level !== "warning"),
|
|
219
|
+
z,
|
|
220
|
+
a.validateMessages,
|
|
221
|
+
{ path: e, signal: t },
|
|
222
|
+
Ce
|
|
223
|
+
), he = ye instanceof Promise ? await ye : ye;
|
|
224
|
+
c = he.messages[0] ?? "";
|
|
225
|
+
let ue = { messages: [], fields: {} };
|
|
226
|
+
if (!c && A()) {
|
|
227
|
+
const S = $e(
|
|
228
|
+
e,
|
|
229
|
+
F,
|
|
230
|
+
n.filter((ul) => ul.level === "warning"),
|
|
231
|
+
z,
|
|
232
|
+
a.validateMessages,
|
|
233
|
+
{ path: e, signal: t },
|
|
234
|
+
Ce
|
|
235
|
+
);
|
|
236
|
+
ue = S instanceof Promise ? await S : S, h = ue.messages[0] ?? "";
|
|
58
237
|
}
|
|
59
|
-
|
|
238
|
+
return A() ? (c ? v.value[e] !== c && (v.value = { ...v.value, [e]: c }) : delete v.value[e], h ? f.value[e] !== h && (f.value = { ...f.value, [e]: h }) : delete f.value[e], he.messages.length ? O.value[e] = he.messages : delete O.value[e], ue.messages.length ? j.value[e] = ue.messages : delete j.value[e], p.value = {
|
|
239
|
+
...p.value,
|
|
240
|
+
[e]: {
|
|
241
|
+
status: c ? "error" : h ? "warning" : "success",
|
|
242
|
+
message: c,
|
|
243
|
+
warning: h,
|
|
244
|
+
validating: !1
|
|
245
|
+
}
|
|
246
|
+
}, D("validate", e, !c, c), { valid: !c, cancelled: !1 }) : { valid: !1, cancelled: !0 };
|
|
247
|
+
} finally {
|
|
248
|
+
R.get(e) === s && ((Te = p.value[e]) != null && Te.validating) && (p.value = { ...p.value, [e]: U(e) });
|
|
249
|
+
}
|
|
60
250
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
251
|
+
async function Ve(e, l) {
|
|
252
|
+
if (typeof l == "function") {
|
|
253
|
+
const t = await re([e]);
|
|
254
|
+
return t.cancelled || await l(t.valid, t), t.valid;
|
|
255
|
+
}
|
|
256
|
+
return (await Pe(T(e), l)).valid;
|
|
65
257
|
}
|
|
66
|
-
async function
|
|
67
|
-
|
|
258
|
+
async function re(e) {
|
|
259
|
+
P == null || P.abort();
|
|
260
|
+
const l = new AbortController();
|
|
261
|
+
P = l;
|
|
262
|
+
const t = ++L, o = k, u = _, y = d(a.model ?? {}), n = $(e, ie()), s = {
|
|
263
|
+
valid: !1,
|
|
264
|
+
cancelled: !1,
|
|
265
|
+
values: y,
|
|
266
|
+
errors: {},
|
|
267
|
+
warnings: {},
|
|
268
|
+
errorMessages: {},
|
|
269
|
+
warningMessages: {}
|
|
270
|
+
};
|
|
271
|
+
if (!b)
|
|
272
|
+
return s.cancelled = !0, s;
|
|
273
|
+
E.value = !0;
|
|
68
274
|
try {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
275
|
+
const q = await Promise.all(n.map((i) => Pe(i)));
|
|
276
|
+
for (let i = 0; i < q.length; i++)
|
|
277
|
+
for (; q[i].cancelled && b && o === k && t === L && u === _; ) {
|
|
278
|
+
const A = n[i], c = W.get(A), h = K.get(A), X = g(y, A);
|
|
279
|
+
if (c != null && c.full && !c.signal.aborted && c.epoch === o && c.version === u && H(c.value, X)) {
|
|
280
|
+
q[i] = await c.promise;
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
h && h.epoch === o && h.version === u && h.token === R.get(A) && H(h.value, X) && (q[i] = h.result);
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
if (!b || o !== k || t !== L || u !== _ || q.some((i) => i.cancelled))
|
|
287
|
+
return s.cancelled = !0, s;
|
|
288
|
+
const z = Object.fromEntries(
|
|
289
|
+
n.filter((i) => v.value[i]).map((i) => [i, v.value[i]])
|
|
290
|
+
), ne = Object.fromEntries(
|
|
291
|
+
n.filter((i) => f.value[i]).map((i) => [i, f.value[i]])
|
|
292
|
+
);
|
|
293
|
+
if (s.errors = z, s.warnings = ne, s.valid = q.every((i) => i.valid), s.errorMessages = Object.fromEntries(
|
|
294
|
+
n.filter((i) => O.value[i]).map((i) => [i, [...O.value[i]]])
|
|
295
|
+
), s.warningMessages = Object.fromEntries(
|
|
296
|
+
n.filter((i) => j.value[i]).map((i) => [i, [...j.value[i]]])
|
|
297
|
+
), s.valid && e === void 0 && a.validate) {
|
|
298
|
+
let i;
|
|
299
|
+
const A = new Promise((c) => {
|
|
300
|
+
i = () => c(!1), l.signal.addEventListener("abort", i, { once: !0 }), l.signal.aborted && c(!1);
|
|
301
|
+
});
|
|
302
|
+
try {
|
|
303
|
+
s.valid = await Promise.race([
|
|
304
|
+
a.validate({ signal: l.signal }),
|
|
305
|
+
A
|
|
306
|
+
]);
|
|
307
|
+
} catch {
|
|
308
|
+
s.valid = !1;
|
|
309
|
+
} finally {
|
|
310
|
+
i && l.signal.removeEventListener("abort", i);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return !b || l.signal.aborted || o !== k || t !== L || u !== _ ? (s.valid = !1, s.cancelled = !0, s) : (D("validation", s), s);
|
|
73
314
|
} finally {
|
|
74
|
-
|
|
315
|
+
t === L && (E.value = !1), P === l && (P = void 0);
|
|
75
316
|
}
|
|
76
317
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
318
|
+
async function me(e, l) {
|
|
319
|
+
var o;
|
|
320
|
+
const t = await re(
|
|
321
|
+
typeof e == "function" ? void 0 : e
|
|
322
|
+
);
|
|
323
|
+
return t.cancelled || await ((o = typeof e == "function" ? e : l) == null ? void 0 : o(t.valid, t)), t.valid;
|
|
324
|
+
}
|
|
325
|
+
const Ze = me;
|
|
326
|
+
function Ee(e) {
|
|
327
|
+
return d(g(a.model, e));
|
|
328
|
+
}
|
|
329
|
+
function el(e) {
|
|
330
|
+
if (e === void 0)
|
|
331
|
+
return d(a.model ?? {});
|
|
332
|
+
const l = {};
|
|
333
|
+
for (const t of $(e, []))
|
|
334
|
+
Z(l, t, Ee(t));
|
|
335
|
+
return l;
|
|
336
|
+
}
|
|
337
|
+
function be(e, l) {
|
|
338
|
+
for (const t of Object.keys(l)) {
|
|
339
|
+
if (["__proto__", "prototype", "constructor"].includes(t)) continue;
|
|
340
|
+
const o = l[t];
|
|
341
|
+
o && typeof o == "object" && !Array.isArray(o) && Object.getPrototypeOf(o) === Object.prototype ? ((!e[t] || typeof e[t] != "object" || Object.getPrototypeOf(e[t]) !== Object.prototype) && (e[t] = {}), be(
|
|
342
|
+
e[t],
|
|
343
|
+
o
|
|
344
|
+
)) : e[t] = d(o);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function ll(e) {
|
|
348
|
+
a.model && (C(), M.value = !0, be(a.model, e), G(() => {
|
|
349
|
+
M.value = !1;
|
|
350
|
+
}));
|
|
351
|
+
}
|
|
352
|
+
function tl(e, l) {
|
|
353
|
+
a.model && (C(), M.value = !0, Z(a.model, e, d(l)), G(() => {
|
|
354
|
+
M.value = !1;
|
|
355
|
+
}));
|
|
356
|
+
}
|
|
357
|
+
function Re(e) {
|
|
358
|
+
const l = T(e);
|
|
359
|
+
return [
|
|
360
|
+
...O.value[l] ?? (v.value[l] ? [v.value[l]] : [])
|
|
361
|
+
];
|
|
362
|
+
}
|
|
363
|
+
function al(e) {
|
|
364
|
+
return $(e, ie()).map((l) => ({
|
|
365
|
+
name: l,
|
|
366
|
+
errors: Re(l),
|
|
367
|
+
warnings: [
|
|
368
|
+
...j.value[l] ?? (f.value[l] ? [f.value[l]] : [])
|
|
369
|
+
]
|
|
370
|
+
}));
|
|
371
|
+
}
|
|
372
|
+
function ol(e) {
|
|
373
|
+
C(), M.value = !0;
|
|
374
|
+
for (const l of e) {
|
|
375
|
+
const t = T(l.name);
|
|
376
|
+
a.model && Object.prototype.hasOwnProperty.call(l, "value") && Z(a.model, t, d(l.value)), l.errors !== void 0 && (l.errors[0] ? (v.value[t] = l.errors[0], O.value[t] = [...l.errors]) : (delete v.value[t], delete O.value[t])), l.warnings !== void 0 && (l.warnings[0] ? (f.value[t] = l.warnings[0], j.value[t] = [...l.warnings]) : (delete f.value[t], delete j.value[t])), p.value = { ...p.value, [t]: U(t) };
|
|
377
|
+
}
|
|
378
|
+
G(() => {
|
|
379
|
+
M.value = !1;
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
function il(e) {
|
|
383
|
+
be(B, e);
|
|
384
|
+
for (const [l] of w)
|
|
385
|
+
w.set(l, d(g(B, l)));
|
|
386
|
+
}
|
|
387
|
+
function rl(e, l) {
|
|
388
|
+
const t = T(e);
|
|
389
|
+
Z(B, t, d(l)), w.set(t, d(l));
|
|
390
|
+
}
|
|
391
|
+
function se(e) {
|
|
392
|
+
L++, oe++, E.value = !1, M.value = !0;
|
|
393
|
+
const l = $(
|
|
394
|
+
e,
|
|
395
|
+
m.value.length ? m.value.map((t) => t.path.value) : Object.keys(B)
|
|
396
|
+
);
|
|
397
|
+
if (a.model)
|
|
398
|
+
for (const t of l)
|
|
399
|
+
Z(
|
|
400
|
+
a.model,
|
|
401
|
+
t,
|
|
402
|
+
d(
|
|
403
|
+
w.has(t) ? w.get(t) : g(B, t)
|
|
404
|
+
)
|
|
405
|
+
);
|
|
406
|
+
Q(e), D("reset", l), G(() => {
|
|
407
|
+
M.value = !1;
|
|
87
408
|
});
|
|
88
409
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
410
|
+
function sl(e) {
|
|
411
|
+
e === void 0 && (B = d(a.model ?? {}), w.clear());
|
|
412
|
+
for (const l of $(
|
|
413
|
+
e,
|
|
414
|
+
m.value.map((t) => t.path.value)
|
|
415
|
+
))
|
|
416
|
+
w.set(l, d(g(a.model, l)));
|
|
417
|
+
}
|
|
418
|
+
function We(e, l = { block: "nearest", behavior: "auto" }) {
|
|
419
|
+
var t, o;
|
|
420
|
+
(o = (t = J(e)) == null ? void 0 : t.element.value) == null || o.scrollIntoView(l);
|
|
421
|
+
}
|
|
422
|
+
function xe(e) {
|
|
423
|
+
var l;
|
|
424
|
+
(l = J(e)) == null || l.focus();
|
|
425
|
+
}
|
|
426
|
+
async function Ae() {
|
|
427
|
+
var o;
|
|
428
|
+
if (!b || x.value || E.value) return;
|
|
429
|
+
const e = ++oe, l = k, t = await re();
|
|
430
|
+
if (!(!b || l !== k || e !== oe || t.cancelled || x.value)) {
|
|
431
|
+
if (t.valid) D("submit", t.values);
|
|
432
|
+
else {
|
|
433
|
+
D("invalid", t), await G();
|
|
434
|
+
const u = Object.keys(t.errors)[0];
|
|
435
|
+
u && a.scrollToError && We(
|
|
436
|
+
u,
|
|
437
|
+
typeof a.scrollToError == "object" ? a.scrollToError : { block: "nearest", behavior: "auto" }
|
|
438
|
+
), a.focusOnError && (u && J(u) ? xe(u) : Fl(
|
|
439
|
+
(o = ee.value) == null ? void 0 : o.querySelector('[aria-invalid="true"]')
|
|
440
|
+
));
|
|
441
|
+
}
|
|
442
|
+
return t;
|
|
443
|
+
}
|
|
92
444
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
445
|
+
function nl(e) {
|
|
446
|
+
const l = e.path.value;
|
|
447
|
+
if (de.delete(l), !w.has(l)) {
|
|
448
|
+
const t = g(B, l);
|
|
449
|
+
w.set(
|
|
450
|
+
l,
|
|
451
|
+
d(t === void 0 ? g(a.model, l) : t)
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
return m.value = [...m.value, e], () => {
|
|
455
|
+
var t;
|
|
456
|
+
if (m.value = m.value.filter((o) => o !== e), !m.value.some((o) => o.path.value === l)) {
|
|
457
|
+
if (de.add(l), Q([l]), !(((t = e.preserve) == null ? void 0 : t.value) ?? a.preserve) && a.model) {
|
|
458
|
+
const o = l.split("."), u = o.pop(), y = o.length ? g(a.model, o) : a.model;
|
|
459
|
+
y && typeof y == "object" && !["__proto__", "prototype", "constructor"].includes(u) && delete y[u];
|
|
460
|
+
}
|
|
461
|
+
g(B, l) === void 0 && w.delete(l);
|
|
462
|
+
}
|
|
97
463
|
};
|
|
98
|
-
}
|
|
464
|
+
}
|
|
465
|
+
return vl(wl, {
|
|
466
|
+
model: r(() => a.model),
|
|
467
|
+
resetting: M,
|
|
468
|
+
suppressAutoBlur: ce,
|
|
469
|
+
errors: v,
|
|
470
|
+
warnings: f,
|
|
471
|
+
errorMessages: O,
|
|
472
|
+
warningMessages: j,
|
|
473
|
+
states: p,
|
|
474
|
+
rules: le,
|
|
475
|
+
getRules: (e) => je(T(e)),
|
|
476
|
+
disabled: x,
|
|
477
|
+
size: r(() => a.size),
|
|
478
|
+
labelPosition: ae,
|
|
479
|
+
labelWidth: ve,
|
|
480
|
+
autoLabelWidth: Fe,
|
|
481
|
+
containerWidth: te,
|
|
482
|
+
columns: we,
|
|
483
|
+
labelAlign: Ke,
|
|
484
|
+
labelWrap: r(() => a.labelWrap),
|
|
485
|
+
labelSuffix: r(() => a.labelSuffix),
|
|
486
|
+
colon: r(() => a.colon),
|
|
487
|
+
labelCol: r(() => a.labelCol),
|
|
488
|
+
wrapperCol: r(() => a.wrapperCol),
|
|
489
|
+
inlineFeedback: r(() => a.inlineFeedback),
|
|
490
|
+
feedbackIcon: r(() => a.feedbackIcon),
|
|
491
|
+
optionalMark: r(() => a.optionalMark),
|
|
492
|
+
validateFirst: r(() => a.validateFirst),
|
|
493
|
+
preserve: r(() => a.preserve),
|
|
494
|
+
setLabelWidth: Ue,
|
|
495
|
+
showLabel: r(() => a.showLabel),
|
|
496
|
+
showFeedback: r(() => a.showFeedback),
|
|
497
|
+
showRequiredMark: r(() => a.showRequiredMark),
|
|
498
|
+
requiredMarkPosition: r(() => a.requiredMarkPosition),
|
|
499
|
+
validateTrigger: r(() => a.validateTrigger),
|
|
500
|
+
validateOnRuleChange: r(() => a.validateOnRuleChange),
|
|
501
|
+
validateField: Ve,
|
|
502
|
+
cancelField: (e) => ge(T(e)),
|
|
503
|
+
register: nl,
|
|
504
|
+
clearValidate: Q,
|
|
505
|
+
resetFields: se,
|
|
506
|
+
setFieldInitialValue: rl
|
|
507
|
+
}), Y(
|
|
508
|
+
() => a.model,
|
|
509
|
+
() => {
|
|
510
|
+
_++;
|
|
511
|
+
},
|
|
512
|
+
{ deep: !0, flush: "sync" }
|
|
513
|
+
), Y(
|
|
514
|
+
() => a.model,
|
|
515
|
+
() => {
|
|
516
|
+
C(), B = d(a.initialValues ?? a.model ?? {}), w.clear(), Q();
|
|
517
|
+
}
|
|
518
|
+
), Y(
|
|
519
|
+
() => a.initialValues,
|
|
520
|
+
(e) => {
|
|
521
|
+
e && (B = d(e), w.clear());
|
|
522
|
+
},
|
|
523
|
+
{ deep: !0 }
|
|
524
|
+
), Y(
|
|
525
|
+
() => a.rules,
|
|
526
|
+
() => {
|
|
527
|
+
H(a.rules, Oe) || (Oe = d(a.rules), C(), a.validateOnRuleChange && b && !x.value && G().then(() => {
|
|
528
|
+
b && !x.value && me();
|
|
529
|
+
}));
|
|
530
|
+
},
|
|
531
|
+
{ deep: !0 }
|
|
532
|
+
), Y(
|
|
533
|
+
x,
|
|
534
|
+
(e) => {
|
|
535
|
+
e && C();
|
|
536
|
+
},
|
|
537
|
+
{ flush: "sync" }
|
|
538
|
+
), fl(() => {
|
|
539
|
+
b = !0;
|
|
540
|
+
}), pl(() => {
|
|
541
|
+
b = !1, C();
|
|
542
|
+
}), gl(() => {
|
|
543
|
+
b = !1, C();
|
|
544
|
+
}), Ge({
|
|
545
|
+
validate: me,
|
|
546
|
+
validateFields: Ze,
|
|
547
|
+
validateResult: re,
|
|
548
|
+
validateField: Ve,
|
|
549
|
+
clearValidate: Q,
|
|
550
|
+
resetFields: se,
|
|
551
|
+
captureInitialValues: sl,
|
|
552
|
+
setInitialValues: il,
|
|
553
|
+
scrollToField: We,
|
|
554
|
+
focusField: xe,
|
|
555
|
+
getField: J,
|
|
556
|
+
getFields: Xe,
|
|
557
|
+
fields: m,
|
|
558
|
+
getFieldValue: Ee,
|
|
559
|
+
getFieldsValue: el,
|
|
560
|
+
setFieldValue: tl,
|
|
561
|
+
setFieldsValue: ll,
|
|
562
|
+
getFieldError: Re,
|
|
563
|
+
getFieldsError: al,
|
|
564
|
+
setFields: ol,
|
|
565
|
+
submit: Ae,
|
|
566
|
+
errors: v,
|
|
567
|
+
warnings: f,
|
|
568
|
+
errorMessages: O,
|
|
569
|
+
warningMessages: j,
|
|
570
|
+
states: p,
|
|
571
|
+
validating: E
|
|
572
|
+
}), (e, l) => (qe(), Ie("form", ml({
|
|
99
573
|
ref_key: "root",
|
|
100
|
-
ref:
|
|
101
|
-
},
|
|
102
|
-
class: ["hys-ui-ent-form", [
|
|
103
|
-
|
|
574
|
+
ref: ee
|
|
575
|
+
}, bl(Ne), {
|
|
576
|
+
class: ["hys-ui-ent-form", [
|
|
577
|
+
"hys-ui-form-" + ae.value,
|
|
578
|
+
"hys-ui-form-size-" + N.size,
|
|
579
|
+
{ "hys-ui-form-inline": De.value }
|
|
580
|
+
]],
|
|
581
|
+
style: Je.value,
|
|
104
582
|
novalidate: "",
|
|
105
|
-
|
|
106
|
-
|
|
583
|
+
"aria-busy": N.loading || E.value || void 0,
|
|
584
|
+
onMousedownCapture: Qe,
|
|
585
|
+
onSubmit: Le(Ae, ["prevent"]),
|
|
586
|
+
onReset: l[0] || (l[0] = Le((t) => se(), ["prevent"]))
|
|
107
587
|
}), [
|
|
108
|
-
|
|
109
|
-
disabled:
|
|
110
|
-
inert:
|
|
588
|
+
yl("fieldset", {
|
|
589
|
+
disabled: x.value || N.loading,
|
|
590
|
+
inert: x.value || N.loading
|
|
111
591
|
}, [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
592
|
+
_e(e.$slots, "default", {
|
|
593
|
+
errors: v.value,
|
|
594
|
+
warnings: f.value,
|
|
595
|
+
validating: E.value
|
|
596
|
+
}, void 0, !0),
|
|
597
|
+
e.$slots.actions ? (qe(), Ie("div", Vl, [
|
|
598
|
+
_e(e.$slots, "actions", {
|
|
599
|
+
validating: E.value,
|
|
600
|
+
reset: se,
|
|
601
|
+
errors: v.value,
|
|
602
|
+
warnings: f.value
|
|
117
603
|
}, void 0, !0)
|
|
118
|
-
])
|
|
119
|
-
], 8,
|
|
120
|
-
], 16));
|
|
604
|
+
])) : hl("", !0)
|
|
605
|
+
], 8, Pl)
|
|
606
|
+
], 16, Bl));
|
|
121
607
|
}
|
|
122
608
|
});
|
|
123
609
|
export {
|
|
124
|
-
|
|
610
|
+
Sl as default
|
|
125
611
|
};
|