litos-ui 0.23.0 → 0.24.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/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/lib/base.d.ts +3 -2
- package/lib/base.js +11 -8
- package/lib/button/index.d.ts +21 -5
- package/lib/button/index.js +115 -62
- package/lib/button/index.less_inline.js +2 -3
- package/lib/button/style.js +1 -2
- package/lib/calendar/index.d.ts +1 -0
- package/lib/calendar/index.js +19 -17
- package/lib/calendar/index.less_inline.js +1 -2
- package/lib/calendar/langs.js +21 -11
- package/lib/card/index.js +8 -9
- package/lib/card/index.less_inline.js +1 -2
- package/lib/carousel/index.js +10 -11
- package/lib/carousel/index.less_inline.js +1 -2
- package/lib/carousel/item.js +1 -2
- package/lib/carousel/item.less_inline.js +1 -2
- package/lib/carousel/timer.js +1 -2
- package/lib/check/check.d.ts +40 -8
- package/lib/check/check.js +200 -65
- package/lib/check/check.less_inline.js +2 -3
- package/lib/check/checkbox.js +2 -3
- package/lib/check/checkbox.less_inline.js +2 -3
- package/lib/check/checkbox_group.js +1 -2
- package/lib/check/index.d.ts +28 -8
- package/lib/check/index.js +151 -46
- package/lib/check/index.less_inline.js +1 -2
- package/lib/check/radio.js +2 -3
- package/lib/check/radio.less_inline.js +1 -2
- package/lib/check/radio_group.js +2 -3
- package/lib/collapse/index.d.ts +12 -4
- package/lib/collapse/index.js +80 -46
- package/lib/collapse/index.less_inline.js +2 -3
- package/lib/collapse/item.d.ts +35 -9
- package/lib/collapse/item.js +219 -57
- package/lib/collapse/item.less_inline.js +2 -3
- package/lib/collapse/types.d.ts +17 -3
- package/lib/color_picker/index.d.ts +4 -2
- package/lib/color_picker/index.js +26 -17
- package/lib/color_picker/index.less_inline.js +1 -2
- package/lib/date_picker/index.d.ts +5 -1
- package/lib/date_picker/index.js +39 -23
- package/lib/date_picker/index.less_inline.js +1 -2
- package/lib/date_picker_ori/index.d.ts +7 -2
- package/lib/date_picker_ori/index.js +123 -47
- package/lib/date_picker_ori/index.less_inline.js +1 -2
- package/lib/description_panel/index.js +2 -10
- package/lib/description_panel/index.less_inline.js +1 -2
- package/lib/dialog/dialog_box.js +28 -29
- package/lib/dialog/dialog_container.css_inline.js +1 -2
- package/lib/dialog/dialog_container.js +13 -14
- package/lib/dialog/dialog_container_style.js +1 -2
- package/lib/dialog/index.d.ts +2 -0
- package/lib/dialog/index.js +11 -9
- package/lib/dropdown/index.d.ts +39 -0
- package/lib/dropdown/index.js +98 -0
- package/lib/entries/base.js +1 -2
- package/lib/entries/button.js +5 -6
- package/lib/entries/calendar.js +5 -6
- package/lib/entries/card.js +5 -6
- package/lib/entries/carousel-item.js +5 -6
- package/lib/entries/carousel.js +5 -6
- package/lib/entries/checkbox-group.js +5 -6
- package/lib/entries/checkbox.js +5 -6
- package/lib/entries/collapse-item.d.ts +0 -1
- package/lib/entries/collapse-item.js +6 -6
- package/lib/entries/collapse.d.ts +0 -1
- package/lib/entries/collapse.js +11 -6
- package/lib/entries/color-picker.js +5 -6
- package/lib/entries/date-picker-ori.js +5 -6
- package/lib/entries/date-picker.js +5 -6
- package/lib/entries/description-panel.js +5 -6
- package/lib/entries/dialog-box.js +1 -2
- package/lib/entries/dialog-container.js +5 -6
- package/lib/entries/dialog.js +1 -2
- package/lib/entries/dropdown.d.ts +2 -0
- package/lib/entries/dropdown.js +1 -0
- package/lib/entries/form-item.js +5 -6
- package/lib/entries/form.js +5 -6
- package/lib/entries/icon-arrow-down.js +5 -6
- package/lib/entries/icon-arrow-left.js +5 -6
- package/lib/entries/icon-arrow-right.js +5 -6
- package/lib/entries/icon-arrow-up.js +5 -6
- package/lib/entries/icon-base.js +5 -6
- package/lib/entries/icon-calendar.js +5 -6
- package/lib/entries/icon-caret-bottom.js +5 -6
- package/lib/entries/icon-caret-top.js +5 -6
- package/lib/entries/icon-close-filled.js +5 -6
- package/lib/entries/icon-close.js +5 -6
- package/lib/entries/icon-copy.js +5 -6
- package/lib/entries/icon-d-arrow-left.js +5 -6
- package/lib/entries/icon-d-arrow-right.js +5 -6
- package/lib/entries/icon-delete.js +5 -6
- package/lib/entries/icon-eye-outline.js +5 -6
- package/lib/entries/icon-font-icon.js +5 -6
- package/lib/entries/icon-info.js +5 -6
- package/lib/entries/icon-loading.js +5 -6
- package/lib/entries/icon-minus.js +5 -6
- package/lib/entries/icon-moon.js +5 -6
- package/lib/entries/icon-more.js +5 -6
- package/lib/entries/icon-picture.js +5 -6
- package/lib/entries/icon-plus.js +5 -6
- package/lib/entries/icon-reduction.js +5 -6
- package/lib/entries/icon-refresh-left.js +5 -6
- package/lib/entries/icon-refresh-right.js +5 -6
- package/lib/entries/icon-refresh.js +5 -6
- package/lib/entries/icon-search.js +5 -6
- package/lib/entries/icon-select.js +5 -6
- package/lib/entries/icon-sort.js +5 -6
- package/lib/entries/icon-success.js +5 -6
- package/lib/entries/icon-sun.js +5 -6
- package/lib/entries/icon-theme-default.js +5 -6
- package/lib/entries/icon-warn.js +5 -6
- package/lib/entries/icon-zoom-in.js +5 -6
- package/lib/entries/icon-zoom-out.js +5 -6
- package/lib/entries/image-preview.js +5 -6
- package/lib/entries/image.js +5 -6
- package/lib/entries/input-number.js +5 -6
- package/lib/entries/input.js +5 -6
- package/lib/entries/list.js +5 -6
- package/lib/entries/loading.js +1 -2
- package/lib/entries/mask.js +5 -6
- package/lib/entries/md-input.js +5 -6
- package/lib/entries/menu.js +5 -6
- package/lib/entries/message.js +1 -2
- package/lib/entries/modal-box.js +1 -2
- package/lib/entries/modal.js +5 -6
- package/lib/entries/notification-box.js +1 -2
- package/lib/entries/notification.js +1 -2
- package/lib/entries/page-header.js +5 -6
- package/lib/entries/pagination.js +5 -6
- package/lib/entries/polygon.js +5 -6
- package/lib/entries/popconfirm.js +1 -2
- package/lib/entries/popover.js +1 -2
- package/lib/entries/qrcode.js +5 -6
- package/lib/entries/radio-group.js +5 -6
- package/lib/entries/radio.js +5 -6
- package/lib/entries/select-ori.js +5 -6
- package/lib/entries/select.js +5 -6
- package/lib/entries/space.js +5 -6
- package/lib/entries/switch.js +5 -6
- package/lib/entries/tabbar-item.js +5 -6
- package/lib/entries/tabbar.js +5 -6
- package/lib/entries/table.js +5 -6
- package/lib/entries/tabs.js +1 -2
- package/lib/entries/tag.js +5 -6
- package/lib/entries/theme-color.js +5 -6
- package/lib/entries/theme.js +5 -6
- package/lib/entries/transition.js +1 -2
- package/lib/entries/upload.js +5 -6
- package/lib/entries/utils.js +1 -2
- package/lib/form/accessibility.d.ts +15 -0
- package/lib/form/accessibility.js +56 -0
- package/lib/form/autocomplete.d.ts +21 -0
- package/lib/form/autocomplete.js +59 -0
- package/lib/form/context.d.ts +157 -0
- package/lib/form/context.js +88 -0
- package/lib/form/form_inner.d.ts +99 -24
- package/lib/form/form_inner.js +424 -72
- package/lib/form/form_item.d.ts +35 -11
- package/lib/form/form_item.js +210 -78
- package/lib/form/form_item.less_inline.js +2 -3
- package/lib/form/form_item_style.d.ts +3 -0
- package/lib/form/form_item_style.js +7 -0
- package/lib/form/index.d.ts +69 -15
- package/lib/form/index.js +501 -101
- package/lib/form/index.less_inline.js +1 -2
- package/lib/form/owner.d.ts +78 -0
- package/lib/form/owner.js +138 -0
- package/lib/form/style.d.ts +3 -0
- package/lib/form/style.js +7 -0
- package/lib/icon/arrow_down.js +1 -2
- package/lib/icon/arrow_left.js +1 -2
- package/lib/icon/arrow_right.js +1 -2
- package/lib/icon/arrow_up.js +1 -2
- package/lib/icon/base.js +1 -2
- package/lib/icon/calendar.js +1 -2
- package/lib/icon/caret_bottom.js +1 -2
- package/lib/icon/caret_top.js +1 -2
- package/lib/icon/close.js +1 -2
- package/lib/icon/close_filled.js +1 -2
- package/lib/icon/copy.js +1 -2
- package/lib/icon/d_arrow_left.js +1 -2
- package/lib/icon/d_arrow_right.js +1 -2
- package/lib/icon/delete.js +1 -2
- package/lib/icon/eye_outline.js +1 -2
- package/lib/icon/font_icon.js +1 -2
- package/lib/icon/icon_style.js +1 -2
- package/lib/icon/index.less_inline.js +1 -2
- package/lib/icon/info.js +1 -2
- package/lib/icon/loading.js +1 -2
- package/lib/icon/minus.js +1 -2
- package/lib/icon/moon.js +1 -2
- package/lib/icon/more.js +1 -2
- package/lib/icon/picture.js +1 -2
- package/lib/icon/plus.js +1 -2
- package/lib/icon/reduction.js +1 -2
- package/lib/icon/refresh.js +1 -2
- package/lib/icon/refresh_left.js +1 -2
- package/lib/icon/refresh_right.js +1 -2
- package/lib/icon/search.js +1 -2
- package/lib/icon/select.js +1 -2
- package/lib/icon/sort.js +1 -2
- package/lib/icon/success.js +1 -2
- package/lib/icon/sun.js +1 -2
- package/lib/icon/theme_default.js +1 -2
- package/lib/icon/warn.js +1 -2
- package/lib/icon/zoom_in.js +1 -2
- package/lib/icon/zoom_out.js +1 -2
- package/lib/image/image_preview.js +1 -2
- package/lib/image/image_preview.less_inline.js +1 -2
- package/lib/image/index.js +1 -2
- package/lib/image/index.less_inline.js +1 -2
- package/lib/index.d.ts +2 -1
- package/lib/index.js +88 -87
- package/lib/input/index.d.ts +18 -1
- package/lib/input/index.js +151 -48
- package/lib/input/index.less_inline.js +2 -3
- package/lib/input/input_inner.less_inline.js +1 -2
- package/lib/input/style.d.ts +3 -0
- package/lib/input/style.js +7 -0
- package/lib/input_number/index.d.ts +7 -0
- package/lib/input_number/index.js +70 -48
- package/lib/input_number/index.less_inline.js +1 -2
- package/lib/input_number/style.js +1 -2
- package/lib/list/index.js +4 -5
- package/lib/list/index.less_inline.js +1 -2
- package/lib/loading/index.js +1 -2
- package/lib/mask/index.js +2 -7
- package/lib/mask/index.less_inline.js +1 -2
- package/lib/md_input/index.d.ts +11 -2
- package/lib/md_input/index.js +63 -27
- package/lib/md_input/index.less_inline.js +2 -3
- package/lib/menu/index.js +2 -7
- package/lib/menu/index.less_inline.js +1 -2
- package/lib/message/index.js +1 -2
- package/lib/modal/index.js +15 -16
- package/lib/modal/index.less_inline.js +1 -2
- package/lib/modal/modal_box.js +24 -25
- package/lib/notification/index.js +15 -29
- package/lib/notification/index.less_inline.js +1 -2
- package/lib/notification/notification_box.js +2 -3
- package/lib/notification/placement.js +1 -2
- package/lib/notification/style.js +1 -2
- package/lib/page_header/index.js +1 -2
- package/lib/page_header/index.less_inline.js +1 -2
- package/lib/pagination/index.js +26 -25
- package/lib/pagination/index.less_inline.js +2 -3
- package/lib/polygon/index.js +1 -2
- package/lib/polygon/index.less_inline.js +1 -2
- package/lib/qrcode/index.js +1 -2
- package/lib/qrcode/index.less_inline.js +1 -2
- package/lib/select/index.d.ts +21 -2
- package/lib/select/index.js +138 -77
- package/lib/select/index.less_inline.js +1 -2
- package/lib/select_ori/index.d.ts +9 -1
- package/lib/select_ori/index.js +36 -24
- package/lib/select_ori/index.less_inline.js +1 -2
- package/lib/space/index.js +1 -2
- package/lib/space/index.less_inline.js +1 -2
- package/lib/styles/animation/index.css_inline.js +1 -2
- package/lib/styles/animation/index.js +1 -2
- package/lib/styles/mask/index.css_inline.js +1 -2
- package/lib/styles/mask/index.js +1 -2
- package/lib/switch/index.d.ts +6 -0
- package/lib/switch/index.js +31 -16
- package/lib/switch/index.less_inline.js +1 -2
- package/lib/tabbar/index.js +1 -2
- package/lib/tabbar/index.less_inline.js +1 -2
- package/lib/tabbar/item.js +1 -2
- package/lib/tabbar/item.less_inline.js +1 -2
- package/lib/table/index.d.ts +2 -0
- package/lib/table/index.js +12 -4
- package/lib/table/index.less_inline.js +1 -2
- package/lib/tabs/index.js +1 -2
- package/lib/tag/index.d.ts +11 -3
- package/lib/tag/index.js +25 -24
- package/lib/tag/index.less_inline.js +2 -3
- package/lib/theme/appearance.d.ts +5 -0
- package/lib/theme/appearance.js +34 -0
- package/lib/theme/index.js +83 -39
- package/lib/theme/index.less_inline.js +1 -2
- package/lib/theme/theme_color.js +1 -2
- package/lib/upload/index.js +28 -41
- package/lib/upload/index.less_inline.js +2 -3
- package/lib/upload/style.js +1 -2
- package/lib/utils/clickoutside.js +1 -2
- package/lib/utils/event.js +1 -2
- package/lib/utils/index.d.ts +27 -5
- package/lib/utils/index.js +43 -22
- package/lib/utils/popover.js +7 -16
- package/lib/utils/transition.js +1 -2
- package/package.json +16 -13
- package/styles/dark.css +10 -2
- package/styles/dropdown.css +46 -0
- package/styles/reset.css +0 -1
- package/styles/select.css +5 -0
- package/styles/themes/apple.css +47 -0
- package/styles/{theme-coral.css → themes/coral.css} +5 -3
- package/styles/themes/deep-sea-blue.css +12 -0
- package/styles/themes/gamboge.css +15 -0
- package/styles/{theme-jade.css → themes/jade.css} +5 -3
- package/styles/themes/lotus-seed.css +12 -0
- package/styles/{theme-tangerine.css → themes/tangerine.css} +5 -3
- package/styles/themes.css +8 -0
- package/styles/vars.css +8 -2
- package/types/preact.d.ts +43 -0
- package/lib/form/types.d.ts +0 -7
- package/lib/utils/context_provide.d.ts +0 -10
- package/lib/utils/context_provide.js +0 -22
- package/lib/utils/signal_types.d.ts +0 -5
package/lib/form/form_inner.js
CHANGED
|
@@ -1,124 +1,476 @@
|
|
|
1
1
|
import e from "../base.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { FieldAccessibility as t, fieldControlSelector as n, referenceElements as r, referenceText as i } from "./accessibility.js";
|
|
3
|
+
import { FORM_CONTEXT_EVENTS as a, readFormBooleanAttribute as o, requestFormContext as s, resolveFieldContext as c } from "./context.js";
|
|
4
|
+
// src/components/form/form_inner.ts
|
|
5
|
+
var l = class extends e {
|
|
6
|
+
static formAssociated = !0;
|
|
7
|
+
internals;
|
|
7
8
|
_disabled = !1;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
#e = void 0;
|
|
10
|
+
dirtyValue = !1;
|
|
11
|
+
applyingDefault = !1;
|
|
12
|
+
applyingFormReset = !1;
|
|
13
|
+
valueInitialized = !1;
|
|
14
|
+
ownDisabled = !1;
|
|
15
|
+
nativeDisabled = !1;
|
|
16
|
+
contextDisabled = !1;
|
|
17
|
+
contextRequired = !1;
|
|
18
|
+
explicitName;
|
|
19
|
+
effectiveName;
|
|
20
|
+
syncedNameAttribute = null;
|
|
21
|
+
reflectingDisabled = !1;
|
|
22
|
+
connecting = !1;
|
|
23
|
+
unregister = [];
|
|
24
|
+
groupContext;
|
|
13
25
|
formContext;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
itemContext;
|
|
27
|
+
manualValidity = {};
|
|
28
|
+
manualMessage = "";
|
|
29
|
+
businessMessage;
|
|
30
|
+
nativeValidity;
|
|
31
|
+
displayedValidityMessage;
|
|
32
|
+
itemPresentation;
|
|
33
|
+
accessibilityControl;
|
|
34
|
+
fieldAccessibility;
|
|
35
|
+
accessibilityObserver;
|
|
36
|
+
contextField = {
|
|
37
|
+
target: this,
|
|
38
|
+
getSnapshot: () => ({
|
|
39
|
+
name: this.name,
|
|
40
|
+
value: this.getValue(),
|
|
41
|
+
disabled: this.isDisabled()
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
constructor(e = !0) {
|
|
45
|
+
if (super(!0, { delegatesFocus: e }), typeof this.attachInternals != "function") throw Error("Litos UI:原生表单需要 iOS/iPadOS 16.4+ 或具备 ElementInternals 的浏览器。");
|
|
46
|
+
this.internals = this.attachInternals();
|
|
47
|
+
}
|
|
48
|
+
get nativeValueEnabled() {
|
|
49
|
+
return !0;
|
|
50
|
+
}
|
|
51
|
+
get grouped() {
|
|
52
|
+
return !1;
|
|
53
|
+
}
|
|
54
|
+
get valueSnapshot() {
|
|
55
|
+
return this.getValue();
|
|
56
|
+
}
|
|
57
|
+
get requiredSelection() {}
|
|
58
|
+
get form() {
|
|
59
|
+
return this.internals.form;
|
|
60
|
+
}
|
|
61
|
+
get labels() {
|
|
62
|
+
return this.internals.labels;
|
|
63
|
+
}
|
|
64
|
+
get validity() {
|
|
65
|
+
return this.syncNativeValidity(), this.internals.validity;
|
|
66
|
+
}
|
|
67
|
+
get validationMessage() {
|
|
68
|
+
return this.syncNativeValidity(), this.internals.validationMessage;
|
|
69
|
+
}
|
|
70
|
+
get constraintValidationMessage() {
|
|
71
|
+
return this.nativeValidity?.constraintMessage;
|
|
72
|
+
}
|
|
73
|
+
get willValidate() {
|
|
74
|
+
return this.internals.willValidate;
|
|
75
|
+
}
|
|
76
|
+
checkValidity() {
|
|
77
|
+
return this.syncNativeValidity(), this.internals.checkValidity();
|
|
78
|
+
}
|
|
79
|
+
reportValidity() {
|
|
80
|
+
return this.syncNativeValidity(), this.internals.reportValidity();
|
|
81
|
+
}
|
|
82
|
+
setValidity(e = {}, t, n) {
|
|
83
|
+
this.internals.setValidity(e, t, n), this.manualValidity = { ...e }, this.manualMessage = t ?? "", this.syncNativeValidity(n);
|
|
22
84
|
}
|
|
23
85
|
get name() {
|
|
24
|
-
return this.
|
|
86
|
+
return this.effectiveName ?? this.explicitName;
|
|
25
87
|
}
|
|
26
88
|
set name(e) {
|
|
27
|
-
this.
|
|
89
|
+
this.syncedNameAttribute = this.getAttribute("name"), this.explicitName = e == null ? void 0 : String(e), this.refreshConfiguration();
|
|
90
|
+
}
|
|
91
|
+
get autocomplete() {
|
|
92
|
+
return this.getAttribute("autocomplete") ?? "";
|
|
93
|
+
}
|
|
94
|
+
set autocomplete(e) {
|
|
95
|
+
e == null || e === "" ? this.removeAttribute("autocomplete") : this.setAttribute("autocomplete", e);
|
|
28
96
|
}
|
|
29
97
|
get value() {
|
|
30
|
-
return this
|
|
98
|
+
return this.#e;
|
|
31
99
|
}
|
|
32
100
|
set value(e) {
|
|
33
101
|
this.setValue(e);
|
|
34
102
|
}
|
|
35
103
|
setValue(e) {
|
|
36
|
-
|
|
104
|
+
let t = !Object.is(this.#e, e);
|
|
105
|
+
this.#e = e, this.applyingDefault || (this.dirtyValue = !0), t && this.notifyFieldValueChanged(), this.syncNativeValue();
|
|
106
|
+
}
|
|
107
|
+
notifyFieldValueChanged() {
|
|
108
|
+
this.applyingFormReset || this.formContext?.fieldValueChanged?.(this.contextField);
|
|
37
109
|
}
|
|
38
110
|
getValue() {
|
|
39
|
-
return this
|
|
111
|
+
return this.#e;
|
|
112
|
+
}
|
|
113
|
+
get defaultValue() {
|
|
114
|
+
return this.copyValue(this.parseDefaultValue(this.getAttribute("value")));
|
|
115
|
+
}
|
|
116
|
+
set defaultValue(e) {
|
|
117
|
+
this.setAttribute("value", this.formatDefaultValue(e));
|
|
118
|
+
}
|
|
119
|
+
get intrinsicDefaultValue() {
|
|
120
|
+
return "";
|
|
121
|
+
}
|
|
122
|
+
parseDefaultValue(e) {
|
|
123
|
+
return e === null ? this.intrinsicDefaultValue : e;
|
|
124
|
+
}
|
|
125
|
+
formatDefaultValue(e) {
|
|
126
|
+
return String(e ?? "");
|
|
127
|
+
}
|
|
128
|
+
applyDefaultValue() {
|
|
129
|
+
if (!this.dirtyValue) {
|
|
130
|
+
this.applyingDefault = !0;
|
|
131
|
+
try {
|
|
132
|
+
this.value = this.copyValue(this.defaultValue);
|
|
133
|
+
} finally {
|
|
134
|
+
this.applyingDefault = !1;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
copyValue(e) {
|
|
139
|
+
return Array.isArray(e) ? e.map((e) => this.copyValue(e)) : e && Object.getPrototypeOf(e) === Object.prototype ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, this.copyValue(t)])) : e;
|
|
40
140
|
}
|
|
41
141
|
static get observedAttributes() {
|
|
42
142
|
return [
|
|
43
143
|
"disabled",
|
|
144
|
+
"autocomplete",
|
|
44
145
|
"value",
|
|
45
146
|
"name",
|
|
46
|
-
"
|
|
147
|
+
"form",
|
|
148
|
+
"inner-block",
|
|
149
|
+
"required",
|
|
150
|
+
"pattern",
|
|
151
|
+
"minlength",
|
|
152
|
+
"maxlength",
|
|
153
|
+
"min",
|
|
154
|
+
"max",
|
|
155
|
+
"step",
|
|
156
|
+
"readonly",
|
|
157
|
+
"id",
|
|
158
|
+
"aria-label",
|
|
159
|
+
"aria-labelledby",
|
|
160
|
+
"aria-describedby",
|
|
161
|
+
"aria-invalid"
|
|
47
162
|
];
|
|
48
163
|
}
|
|
49
|
-
attributeChanged(e,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.setDisabled(t(r, !1, e));
|
|
57
|
-
break;
|
|
58
|
-
case "inner-block":
|
|
59
|
-
let i = t(r, !1, e);
|
|
60
|
-
this.innerBlockChange(i);
|
|
61
|
-
break;
|
|
62
|
-
default: this.attributeChange(e, n, r);
|
|
63
|
-
}
|
|
164
|
+
attributeChanged(e, t, n) {
|
|
165
|
+
if (e === "value") this.applyDefaultValue();
|
|
166
|
+
else if (e === "name") {
|
|
167
|
+
if (this.getAttribute("name") === this.syncedNameAttribute) return;
|
|
168
|
+
this.refreshConfiguration();
|
|
169
|
+
} else e === "disabled" ? this.reflectingDisabled || this.setDisabled(o(n) ?? !1) : e === "inner-block" || e === "required" ? this.refreshConfiguration() : e === "id" || e.startsWith("aria-") ? this.syncFieldAccessibility() : (this.attributeChange(e, t, n), e === "form" && this.isConnected && this.bindContexts());
|
|
170
|
+
this.syncNativeValue();
|
|
64
171
|
}
|
|
65
172
|
attributeChange(e, t, n) {}
|
|
66
173
|
connectedCallback() {
|
|
67
|
-
this.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
this
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
174
|
+
this.connecting = !0;
|
|
175
|
+
for (let e of [
|
|
176
|
+
"value",
|
|
177
|
+
"name",
|
|
178
|
+
"disabled",
|
|
179
|
+
"defaultValue",
|
|
180
|
+
"autocomplete",
|
|
181
|
+
"htmlType"
|
|
182
|
+
]) if (Object.prototype.hasOwnProperty.call(this, e)) {
|
|
183
|
+
let t = this[e];
|
|
184
|
+
delete this[e], this[e] = t;
|
|
185
|
+
}
|
|
186
|
+
this.valueInitialized ||= (this.applyDefaultValue(), !0), this.addEventListener(a.configuration, this.configurationChanged), this.addEventListener(a.validity, this.validityChanged), this.bindContexts(), super.connectedCallback(), this.connecting = !1, this.addEventListener("focusin", this.syncFieldAccessibility), this.refreshConfiguration(), this.syncNativeValue();
|
|
80
187
|
}
|
|
81
188
|
disconnectedCallback() {
|
|
82
|
-
|
|
189
|
+
this.removeEventListener("focusin", this.syncFieldAccessibility), this.accessibilityObserver?.disconnect(), this.fieldAccessibility?.clear(this.root), this.accessibilityControl = void 0, this.fieldAccessibility = void 0, this.itemPresentation = void 0, this.displayedValidityMessage = void 0, this.nativeValidity = void 0, this.unbindContexts(), this.removeEventListener(a.configuration, this.configurationChanged), this.removeEventListener(a.validity, this.validityChanged), super.disconnectedCallback();
|
|
190
|
+
}
|
|
191
|
+
unbindContexts() {
|
|
192
|
+
this.unregister.forEach((e) => e()), this.unregister = [], this.formContext = void 0, this.itemContext = void 0, this.groupContext = void 0, this.applyBusinessValidity();
|
|
193
|
+
}
|
|
194
|
+
refreshFormContext() {
|
|
195
|
+
this.bindContexts();
|
|
196
|
+
}
|
|
197
|
+
validateInput() {
|
|
198
|
+
this.formContext?.validateInput?.(this.contextField);
|
|
199
|
+
}
|
|
200
|
+
bindContexts() {
|
|
201
|
+
if (this.unbindContexts(), this.isConnected) {
|
|
202
|
+
this.formContext = s(this, "form"), this.itemContext = s(this, "item"), this.groupContext = s(this, "group");
|
|
203
|
+
for (let e of /* @__PURE__ */ new Set([
|
|
204
|
+
this.formContext,
|
|
205
|
+
this.itemContext,
|
|
206
|
+
this.groupContext
|
|
207
|
+
])) e && this.unregister.push(e.registerField(this.contextField));
|
|
208
|
+
this.refreshConfiguration();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
configurationChanged = () => {
|
|
212
|
+
this.refreshConfiguration();
|
|
213
|
+
};
|
|
214
|
+
validityChanged = (e) => {
|
|
215
|
+
let t = e.detail;
|
|
216
|
+
this.validResult(t.valid ? void 0 : t.message || "校验失败");
|
|
217
|
+
};
|
|
218
|
+
applyBusinessValidity(e) {
|
|
219
|
+
this.businessMessage !== e && (this.businessMessage = e, this.syncNativeValidity());
|
|
220
|
+
}
|
|
221
|
+
refreshConfiguration() {
|
|
222
|
+
let e = this.getAttribute("name");
|
|
223
|
+
e !== this.syncedNameAttribute && (this.explicitName = e ?? void 0);
|
|
224
|
+
let t = c({
|
|
225
|
+
name: this.explicitName,
|
|
226
|
+
disabled: this.ownDisabled,
|
|
227
|
+
innerBlock: o(this.getAttribute("inner-block")),
|
|
228
|
+
required: o(this.getAttribute("required"))
|
|
229
|
+
}, {
|
|
230
|
+
form: this.formContext?.getSnapshot(),
|
|
231
|
+
item: this.itemContext?.getSnapshot(),
|
|
232
|
+
group: this.groupContext?.getSnapshot()
|
|
233
|
+
}), n = this.effectiveName, r = n !== t.name;
|
|
234
|
+
this.effectiveName = t.name, this.syncedNameAttribute = t.name ?? null, e !== this.syncedNameAttribute && (t.name === void 0 ? this.removeAttribute("name") : this.setAttribute("name", t.name)), this.contextDisabled = !!(this.formContext?.getSnapshot().disabled || this.itemContext?.getSnapshot().disabled || this.groupContext?.getSnapshot().disabled), this.contextRequired = t.required, this.configurationApplied(), this.syncFieldAccessibility(), this.innerBlockChange(t.innerBlock), this.applyDisabled(), this.syncNativeValue(), r && this.formContext?.fieldNameChanged?.(this.contextField, t.name, n);
|
|
83
235
|
}
|
|
84
236
|
isDisabled() {
|
|
85
237
|
return this._disabled;
|
|
86
238
|
}
|
|
87
239
|
get disabled() {
|
|
88
|
-
return this.
|
|
240
|
+
return this.ownDisabled;
|
|
89
241
|
}
|
|
90
242
|
set disabled(e) {
|
|
91
|
-
this.setDisabled(e);
|
|
243
|
+
this.setDisabled(!!e);
|
|
92
244
|
}
|
|
93
245
|
setDisabled(e) {
|
|
94
|
-
this.
|
|
246
|
+
this.ownDisabled = !!e, this.reflectingDisabled = !0;
|
|
247
|
+
try {
|
|
248
|
+
this.ownDisabled ? this.getAttribute("disabled") !== "" && this.setAttribute("disabled", "") : this.hasAttribute("disabled") && this.removeAttribute("disabled");
|
|
249
|
+
} finally {
|
|
250
|
+
this.reflectingDisabled = !1;
|
|
251
|
+
}
|
|
252
|
+
this.applyDisabled();
|
|
253
|
+
}
|
|
254
|
+
applyDisabled() {
|
|
255
|
+
this._disabled = this.ownDisabled || this.nativeDisabled || this.contextDisabled, this.rendered && !this.connecting && this.disabledChange(), this.syncNativeValue();
|
|
95
256
|
}
|
|
96
257
|
getName() {
|
|
97
258
|
return this.name;
|
|
98
259
|
}
|
|
260
|
+
configurationApplied() {}
|
|
99
261
|
disabledChange() {}
|
|
100
262
|
innerBlockChange(e) {}
|
|
101
|
-
validResult(e) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
263
|
+
validResult(e) {
|
|
264
|
+
this.displayedValidityMessage = e, this.syncFieldAccessibility();
|
|
265
|
+
}
|
|
266
|
+
get formItemControl() {
|
|
267
|
+
let e = this.root?.querySelectorAll(n);
|
|
268
|
+
return e?.length === 1 ? e[0] : void 0;
|
|
269
|
+
}
|
|
270
|
+
setFormItemPresentation(e, t, n, r) {
|
|
271
|
+
if (t === void 0 && n === void 0 && r === void 0) {
|
|
272
|
+
if (this.itemPresentation?.owner !== e) return;
|
|
273
|
+
this.itemPresentation = void 0;
|
|
274
|
+
} else {
|
|
275
|
+
let i = this.itemPresentation;
|
|
276
|
+
if (i?.owner === e && i.label === t && i.error === n && i.groupError === r) return;
|
|
277
|
+
this.itemPresentation = {
|
|
278
|
+
owner: e,
|
|
279
|
+
label: t,
|
|
280
|
+
error: n,
|
|
281
|
+
groupError: r
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
this.syncFieldAccessibility();
|
|
285
|
+
}
|
|
286
|
+
get fallbackAccessibleName() {}
|
|
287
|
+
syncFieldAccessibility = () => {
|
|
288
|
+
if (!this.isConnected || !this.rendered) return;
|
|
289
|
+
let e = this.formItemControl;
|
|
290
|
+
e !== this.accessibilityControl && (this.fieldAccessibility?.clear(this.root), this.accessibilityControl = e, this.fieldAccessibility = e && new t(e));
|
|
291
|
+
let n = this.fieldAccessibility;
|
|
292
|
+
if (!e || !n) return;
|
|
293
|
+
let a = r(this, "aria-labelledby"), o = Array.from(this.labels ?? []), s = this.getAttribute("aria-label"), c = (a.length ? i(a) : s) ?? (i(o) || n.authoredValue("aria-label") || i(r(e, "aria-labelledby")) || i(e.labels ?? []) || this.getAttribute("label") || this.fallbackAccessibleName || this.itemPresentation?.label);
|
|
294
|
+
n.attribute("aria-label", c || void 0), n.attribute("aria-required", String(this.contextRequired));
|
|
295
|
+
let l = r(this, "aria-describedby"), u = this.itemPresentation?.error ?? this.displayedValidityMessage, d = !!(u || this.displayedValidityMessage), f = u === this.itemPresentation?.groupError ? void 0 : u, p = Array.from(new Set([i(l), f].filter(Boolean))).join(" ");
|
|
296
|
+
n.attribute("aria-invalid", d ? "true" : this.getAttribute("aria-invalid") ?? "false"), n.describe(this.root, p), this.accessibilityObserver?.disconnect(), this.accessibilityObserver ??= new MutationObserver(this.syncFieldAccessibility), this.accessibilityObserver.observe(this.parentElement ?? this, {
|
|
297
|
+
childList: !0,
|
|
298
|
+
subtree: !0,
|
|
299
|
+
characterData: !0,
|
|
300
|
+
attributes: !0,
|
|
301
|
+
attributeFilter: [
|
|
302
|
+
"for",
|
|
303
|
+
"id",
|
|
304
|
+
"label",
|
|
305
|
+
"slot",
|
|
306
|
+
"aria-hidden",
|
|
307
|
+
"hidden"
|
|
308
|
+
]
|
|
309
|
+
});
|
|
310
|
+
for (let e of [
|
|
311
|
+
...a,
|
|
312
|
+
...o,
|
|
313
|
+
...l
|
|
314
|
+
]) this.accessibilityObserver.observe(e, {
|
|
315
|
+
childList: !0,
|
|
316
|
+
subtree: !0,
|
|
317
|
+
characterData: !0,
|
|
318
|
+
attributes: !0,
|
|
319
|
+
attributeFilter: [
|
|
320
|
+
"id",
|
|
321
|
+
"aria-hidden",
|
|
322
|
+
"hidden"
|
|
323
|
+
]
|
|
324
|
+
});
|
|
107
325
|
};
|
|
108
|
-
|
|
109
|
-
this.
|
|
326
|
+
formAssociatedCallback(e) {
|
|
327
|
+
this.isConnected && this.bindContexts(), this.syncNativeValue();
|
|
328
|
+
}
|
|
329
|
+
formDisabledCallback(e) {
|
|
330
|
+
this.nativeDisabled = e, this.applyDisabled();
|
|
331
|
+
}
|
|
332
|
+
serializeFormValue() {
|
|
333
|
+
return String(this.getValue() ?? "");
|
|
334
|
+
}
|
|
335
|
+
get formStateRestorationEnabled() {
|
|
336
|
+
return !0;
|
|
337
|
+
}
|
|
338
|
+
get acceptsAutocompleteText() {
|
|
339
|
+
return !1;
|
|
340
|
+
}
|
|
341
|
+
serializeFormState() {
|
|
342
|
+
return this.formStateRestorationEnabled ? JSON.stringify({
|
|
343
|
+
version: 1,
|
|
344
|
+
value: this.getValue() ?? ""
|
|
345
|
+
}) : null;
|
|
346
|
+
}
|
|
347
|
+
syncNativeValue() {
|
|
348
|
+
if (!this.internals || !this.nativeValueEnabled) return;
|
|
349
|
+
this.syncAutocomplete();
|
|
350
|
+
let e = this.isDisabled() ? null : this.serializeFormValue();
|
|
351
|
+
this.internals.setFormValue(e ?? new FormData(), this.serializeFormState());
|
|
352
|
+
let t = this.root?.querySelector("input,textarea,select");
|
|
353
|
+
t && (t.disabled = this.isDisabled(), "readOnly" in t && (t.readOnly = o(this.getAttribute("readonly")) ?? !1)), this.syncNativeValidity();
|
|
354
|
+
}
|
|
355
|
+
syncAutocomplete() {
|
|
356
|
+
let e = this.getAttribute("autocomplete") ?? this.formContext?.getSnapshot().autocomplete;
|
|
357
|
+
for (let t of this.root?.querySelectorAll("input,textarea,select") ?? []) e === void 0 ? t.removeAttribute("autocomplete") : t.getAttribute("autocomplete") !== e && t.setAttribute("autocomplete", e);
|
|
358
|
+
}
|
|
359
|
+
formResetCallback() {
|
|
360
|
+
this.applyingFormReset = !0;
|
|
361
|
+
try {
|
|
362
|
+
this.reset();
|
|
363
|
+
} finally {
|
|
364
|
+
this.applyingFormReset = !1;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
formStateRestoreCallback(e, t) {
|
|
368
|
+
if (typeof e != "string" || t !== "autocomplete" && !this.formStateRestorationEnabled) return;
|
|
369
|
+
let n;
|
|
370
|
+
try {
|
|
371
|
+
let r = JSON.parse(e);
|
|
372
|
+
if (r?.version === 1 && Object.hasOwn(r, "value")) n = r.value;
|
|
373
|
+
else if (t === "autocomplete" && this.acceptsAutocompleteText) n = e;
|
|
374
|
+
else return;
|
|
375
|
+
} catch {
|
|
376
|
+
if (t !== "autocomplete" || !this.acceptsAutocompleteText) return;
|
|
377
|
+
n = e;
|
|
378
|
+
}
|
|
379
|
+
try {
|
|
380
|
+
this.value = n, this.manualValidity = {}, this.manualMessage = "", this.validResult(), this.formContext?.fieldValidityCleared?.(this.contextField), this.syncNativeValue();
|
|
381
|
+
} catch {}
|
|
382
|
+
}
|
|
383
|
+
get nativeBadInput() {
|
|
384
|
+
return !1;
|
|
385
|
+
}
|
|
386
|
+
get nativeValueMissing() {}
|
|
387
|
+
get nativeSubmissionError() {}
|
|
388
|
+
get nativeConstraintValues() {
|
|
389
|
+
return [this.getValue()];
|
|
390
|
+
}
|
|
391
|
+
syncNativeValidity(e) {
|
|
392
|
+
if (!this.internals || !this.ownerDocument) return;
|
|
393
|
+
let t = this.root?.querySelector("input,textarea,select,button,[tabindex]") ?? void 0, n = {}, r = "", i = o(this.getAttribute("readonly")) ?? !1, s = !this.isDisabled() && !i && !this.grouped;
|
|
394
|
+
if (s) {
|
|
395
|
+
let e = this.ownerDocument.createElement("input"), i = this.getAttribute("type") ?? (t instanceof HTMLInputElement ? t.type : "text");
|
|
396
|
+
e.type = this.constructor.baseName === "input-number" ? "number" : [
|
|
397
|
+
"checkbox",
|
|
398
|
+
"radio",
|
|
399
|
+
"file",
|
|
400
|
+
"hidden",
|
|
401
|
+
"submit",
|
|
402
|
+
"button",
|
|
403
|
+
"reset"
|
|
404
|
+
].includes(i) ? "text" : i;
|
|
405
|
+
for (let t of [
|
|
406
|
+
"pattern",
|
|
407
|
+
"min",
|
|
408
|
+
"max",
|
|
409
|
+
"step",
|
|
410
|
+
"minlength",
|
|
411
|
+
"maxlength"
|
|
412
|
+
]) {
|
|
413
|
+
let n = this.getAttribute(t);
|
|
414
|
+
n !== null && e.setAttribute(t, n);
|
|
415
|
+
}
|
|
416
|
+
for (let t of this.nativeConstraintValues) {
|
|
417
|
+
e.value = Array.isArray(t) ? t.join(",") : String(t ?? ""), e.required = this.contextRequired;
|
|
418
|
+
for (let t of [
|
|
419
|
+
"valueMissing",
|
|
420
|
+
"typeMismatch",
|
|
421
|
+
"patternMismatch",
|
|
422
|
+
"rangeUnderflow",
|
|
423
|
+
"rangeOverflow",
|
|
424
|
+
"stepMismatch",
|
|
425
|
+
"badInput"
|
|
426
|
+
]) e.validity[t] && (n[t] = !0);
|
|
427
|
+
this.contextRequired && (t === !1 || Array.isArray(t) && !t.length) && (n.valueMissing = !0), e.required && this.nativeValueMissing !== void 0 && (this.nativeValueMissing ? n.valueMissing = !0 : delete n.valueMissing);
|
|
428
|
+
let i = Number(this.getAttribute("minlength")), a = Number(this.getAttribute("maxlength"));
|
|
429
|
+
[
|
|
430
|
+
"text",
|
|
431
|
+
"search",
|
|
432
|
+
"url",
|
|
433
|
+
"tel",
|
|
434
|
+
"email",
|
|
435
|
+
"password"
|
|
436
|
+
].includes(e.type) && e.value && this.hasAttribute("minlength") && i >= 0 && e.value.length < i && (n.tooShort = !0), [
|
|
437
|
+
"text",
|
|
438
|
+
"search",
|
|
439
|
+
"url",
|
|
440
|
+
"tel",
|
|
441
|
+
"email",
|
|
442
|
+
"password"
|
|
443
|
+
].includes(e.type) && this.hasAttribute("maxlength") && a >= 0 && e.value.length > a && (n.tooLong = !0), r = e.validationMessage || (n.tooShort ? "输入长度不足" : n.tooLong ? "输入长度超出限制" : "");
|
|
444
|
+
}
|
|
445
|
+
this.nativeBadInput && (n.badInput = !0, r = "请输入有效值");
|
|
446
|
+
let a = this.nativeSubmissionError;
|
|
447
|
+
a && (n.customError = !0, r = a);
|
|
448
|
+
for (let e of Object.keys(this.manualValidity)) this.manualValidity[e] && (n[e] = !0);
|
|
449
|
+
}
|
|
450
|
+
let c = s && Object.values(this.manualValidity).some(Boolean);
|
|
451
|
+
c && (r = this.manualMessage);
|
|
452
|
+
let l = Object.values(n).some(Boolean) ? r || "请检查字段值" : void 0, u = s ? this.businessMessage : void 0;
|
|
453
|
+
u && (n.customError = !0);
|
|
454
|
+
let d = (c ? l : u) ?? l;
|
|
455
|
+
this.internals.setValidity(n, d ?? "", e ?? t);
|
|
456
|
+
let f = {
|
|
457
|
+
valid: this.internals.validity.valid,
|
|
458
|
+
message: d,
|
|
459
|
+
flags: n,
|
|
460
|
+
constraintMessage: l,
|
|
461
|
+
willValidate: this.internals.willValidate
|
|
462
|
+
}, p = this.nativeValidity;
|
|
463
|
+
this.nativeValidity = f, this.isConnected && this.rendered && (p && p.valid === f.valid && p.message === f.message && p.constraintMessage === f.constraintMessage && p.willValidate === f.willValidate && Object.keys(p.flags).length === Object.keys(n).length && Object.keys(n).every((e) => p.flags[e]) || this.dispatchEvent(new CustomEvent(a.nativeValidity, {
|
|
110
464
|
bubbles: !0,
|
|
111
|
-
composed: !0,
|
|
112
465
|
detail: {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
466
|
+
...f,
|
|
467
|
+
flags: { ...n },
|
|
468
|
+
duringReset: this.applyingFormReset
|
|
116
469
|
}
|
|
117
|
-
})
|
|
470
|
+
})));
|
|
118
471
|
}
|
|
119
472
|
reset() {
|
|
120
|
-
this.
|
|
473
|
+
this.dirtyValue = !1, this.applyDefaultValue(), this.applyBusinessValidity(), this.validResult(), this.formContext?.fieldValidityCleared?.(this.contextField), this.syncNativeValue();
|
|
121
474
|
}
|
|
122
475
|
};
|
|
123
|
-
|
|
124
|
-
export { a as default };
|
|
476
|
+
export { l as default };
|
package/lib/form/form_item.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type { Signal } from "../utils/signal_types";
|
|
2
1
|
import type { RuleType } from "utilane";
|
|
3
|
-
import
|
|
4
|
-
import type { FormItemSignal } from "./types";
|
|
2
|
+
import BaseComponent from "../base";
|
|
5
3
|
type FormItemState = {
|
|
6
4
|
/** 标签文本 */
|
|
7
5
|
label?: string;
|
|
8
|
-
labelPosition
|
|
6
|
+
labelPosition: "left" | "right" | "top";
|
|
7
|
+
/** 显式错误;undefined 表示使用校验错误,空字符串表示显式隐藏。 */
|
|
9
8
|
error?: string;
|
|
10
|
-
|
|
9
|
+
innerBlock?: boolean;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
11
12
|
/** 内置验证规则 */
|
|
12
13
|
verify?: string;
|
|
13
14
|
/** 正则表达式 */
|
|
@@ -18,15 +19,29 @@ type FormItemState = {
|
|
|
18
19
|
labelWidth?: string;
|
|
19
20
|
labelHeight?: string;
|
|
20
21
|
};
|
|
21
|
-
export default class FormItem extends
|
|
22
|
+
export default class FormItem extends BaseComponent<FormItemState> {
|
|
22
23
|
static baseName: string;
|
|
23
|
-
|
|
24
|
-
private
|
|
24
|
+
private readonly itemContext;
|
|
25
|
+
private disposeContext?;
|
|
26
|
+
private formContext?;
|
|
27
|
+
private unregisterForm?;
|
|
28
|
+
private programRules?;
|
|
29
|
+
private validationError?;
|
|
30
|
+
private accessibilityObserver?;
|
|
31
|
+
private accessibilityScheduled;
|
|
32
|
+
private readonly connectedFields;
|
|
33
|
+
private readonly nativePresentation;
|
|
34
|
+
private readonly itemProvider;
|
|
35
|
+
private readonly formField;
|
|
25
36
|
constructor();
|
|
26
37
|
static get observedAttributes(): string[];
|
|
27
|
-
protected attributeChanged(name: string,
|
|
38
|
+
protected attributeChanged(name: string, _oldValue: string, newValue: string | null): void;
|
|
39
|
+
private updateContext;
|
|
40
|
+
/** @internal 处理先于 Form 升级的表单项。 */
|
|
41
|
+
refreshFormContext: () => void;
|
|
42
|
+
private receiveValidity;
|
|
28
43
|
protected updateDOM(changedProps: Set<string>): void;
|
|
29
|
-
|
|
44
|
+
afterInit(): void;
|
|
30
45
|
beforeDestroy(): void;
|
|
31
46
|
setRules(rules: {
|
|
32
47
|
required?: boolean;
|
|
@@ -35,13 +50,22 @@ export default class FormItem extends ContextProvide<FormItemSignal, FormItemSta
|
|
|
35
50
|
}): void;
|
|
36
51
|
render_v2(): {
|
|
37
52
|
template: DocumentFragment;
|
|
38
|
-
|
|
53
|
+
styleSheets: CSSStyleSheet[];
|
|
39
54
|
};
|
|
55
|
+
private get errorMessage();
|
|
56
|
+
private updateLabelPosition;
|
|
40
57
|
render(): DocumentFragment;
|
|
41
58
|
private _updateRequired;
|
|
42
59
|
private _parseSchema;
|
|
43
60
|
private _updateError;
|
|
44
61
|
private _updateLabel;
|
|
62
|
+
private createLabel;
|
|
63
|
+
private setLabelText;
|
|
64
|
+
private itemFields;
|
|
65
|
+
private focusFieldFromLabel;
|
|
66
|
+
private scheduleAccessibility;
|
|
67
|
+
private clearFieldPresentation;
|
|
68
|
+
private updateAccessibility;
|
|
45
69
|
private _updateRules;
|
|
46
70
|
}
|
|
47
71
|
export {};
|