@fibrae/semi-foundation 0.3.0 → 0.4.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/LICENSE +0 -62
- package/README.md +37 -35
- package/README.zh-CN.md +79 -0
- package/dist/base/auto-close-foundation.d.ts +21 -6
- package/dist/base/auto-close-foundation.js +28 -9
- package/dist/base/focus-handle.d.ts +42 -0
- package/dist/base/focus-handle.js +89 -0
- package/dist/base/focus-scope.js +75 -0
- package/dist/base/foundation.d.ts +57 -26
- package/dist/base/foundation.js +59 -26
- package/dist/base/list-store.js +15 -2
- package/dist/base/modal-resources.d.ts +35 -0
- package/dist/base/modal-resources.js +57 -0
- package/dist/base/popup-lifecycle.d.ts +13 -0
- package/dist/base/popup-lifecycle.js +30 -0
- package/dist/base/release-holder.js +18 -0
- package/dist/base/reset-timer.d.ts +9 -0
- package/dist/base/reset-timer.js +29 -0
- package/dist/base/static-list-wrapper.d.ts +15 -0
- package/dist/base/static-list-wrapper.js +47 -0
- package/dist/base/tokens.css +36 -36
- package/dist/components/anchor/constants.d.ts +11 -0
- package/dist/components/anchor/constants.js +18 -0
- package/dist/components/anchor/foundation.d.ts +49 -0
- package/dist/components/anchor/foundation.js +162 -0
- package/dist/components/anchor/utils.js +16 -0
- package/dist/components/anchor/variables.scss +34 -0
- package/dist/components/audio-player/audio-player.css +226 -0
- package/dist/components/audio-player/audio-player.scss +278 -0
- package/dist/components/audio-player/constants.js +27 -0
- package/dist/components/audio-player/foundation.d.ts +44 -0
- package/dist/components/audio-player/foundation.js +126 -0
- package/dist/components/audio-player/utils.js +6 -0
- package/dist/components/audio-player/variables.scss +53 -0
- package/dist/components/auto-complete/constants.js +7 -0
- package/dist/components/auto-complete/foundation.d.ts +67 -0
- package/dist/components/auto-complete/foundation.js +217 -0
- package/dist/components/auto-complete/option.css +62 -0
- package/dist/components/avatar/constants.js +13 -0
- package/dist/components/avatar/foundation.d.ts +31 -0
- package/dist/components/avatar/foundation.js +43 -0
- package/dist/components/avatar/variables.scss +112 -0
- package/dist/components/backtop/constants.js +35 -0
- package/dist/components/backtop/foundation.d.ts +26 -0
- package/dist/components/backtop/foundation.js +94 -0
- package/dist/components/badge/constants.js +4 -0
- package/dist/components/banner/constants.js +4 -0
- package/dist/components/banner/foundation.d.ts +12 -0
- package/dist/components/banner/foundation.js +12 -0
- package/dist/components/breadcrumb/breadcrumb.scss +116 -0
- package/dist/components/breadcrumb/constants.js +8 -0
- package/dist/components/breadcrumb/foundation.d.ts +47 -0
- package/dist/components/breadcrumb/foundation.js +64 -0
- package/dist/components/breadcrumb/item-foundation.d.ts +45 -0
- package/dist/components/breadcrumb/item-foundation.js +36 -0
- package/dist/components/button/constants.js +5 -0
- package/dist/components/button/split-button-group.css +19 -0
- package/dist/components/button/utils.d.ts +27 -0
- package/dist/components/button/utils.js +89 -0
- package/dist/components/button/variables.scss +169 -0
- package/dist/components/calendar/calendar.css +485 -0
- package/dist/components/calendar/calendar.scss +515 -0
- package/dist/components/calendar/constants.js +14 -0
- package/dist/components/calendar/event-util.js +193 -0
- package/dist/components/calendar/foundation.d.ts +75 -0
- package/dist/components/calendar/foundation.js +196 -0
- package/dist/components/calendar/month-foundation.d.ts +22 -0
- package/dist/components/calendar/month-foundation.js +32 -0
- package/dist/components/card/constants.js +4 -0
- package/dist/components/carousel/carousel.css +345 -0
- package/dist/components/carousel/carousel.scss +451 -0
- package/dist/components/carousel/constants.js +42 -0
- package/dist/components/carousel/foundation.d.ts +64 -0
- package/dist/components/carousel/foundation.js +217 -0
- package/dist/components/carousel/variables.scss +49 -0
- package/dist/components/cascader/cascader.scss +586 -0
- package/dist/components/cascader/constants.js +20 -0
- package/dist/components/cascader/foundation.d.ts +295 -0
- package/dist/components/cascader/foundation.js +884 -0
- package/dist/components/cascader/util.js +148 -0
- package/dist/components/checkbox/checkbox-foundation.d.ts +100 -0
- package/dist/components/checkbox/checkbox-foundation.js +74 -0
- package/dist/components/checkbox/checkbox-group-foundation.d.ts +25 -0
- package/dist/components/checkbox/checkbox-group-foundation.js +34 -0
- package/dist/components/checkbox/constants.js +15 -0
- package/dist/components/checkbox/variables.scss +72 -0
- package/dist/components/code-highlight/constants.js +4 -0
- package/dist/components/code-highlight/highlighter.js +56 -0
- package/dist/components/code-highlight/index.d.ts +26 -0
- package/dist/components/code-highlight/index.js +43 -0
- package/dist/components/code-highlight/registry.js +33 -0
- package/dist/components/collapse/collapse.scss +112 -0
- package/dist/components/collapse/constants.js +4 -0
- package/dist/components/collapse/foundation.d.ts +51 -0
- package/dist/components/collapse/foundation.js +56 -0
- package/dist/components/collapsible/constants.js +4 -0
- package/dist/components/collapsible/foundation.d.ts +69 -0
- package/dist/components/collapsible/foundation.js +132 -0
- package/dist/components/color-picker/color-choose-area-foundation.d.ts +33 -0
- package/dist/components/color-picker/color-choose-area-foundation.js +57 -0
- package/dist/components/color-picker/color-picker.scss +129 -0
- package/dist/components/color-picker/color-slider-foundation.d.ts +28 -0
- package/dist/components/color-picker/color-slider-foundation.js +45 -0
- package/dist/components/color-picker/constants.js +4 -0
- package/dist/components/color-picker/data-part-foundation.d.ts +35 -0
- package/dist/components/color-picker/data-part-foundation.js +86 -0
- package/dist/components/color-picker/foundation.d.ts +53 -0
- package/dist/components/color-picker/foundation.js +150 -0
- package/dist/components/color-picker/utils/convert.d.ts +14 -0
- package/dist/components/color-picker/utils/convert.js +148 -0
- package/dist/components/color-picker/utils/round.js +5 -0
- package/dist/components/color-picker/utils/split.js +26 -0
- package/dist/components/config-provider/breakpoint-observer.js +139 -0
- package/dist/components/config-provider/inherit-config.d.ts +24 -0
- package/dist/components/config-provider/inherit-config.js +24 -0
- package/dist/components/cropper/constants.js +37 -0
- package/dist/components/cropper/cropper.scss +129 -0
- package/dist/components/cropper/foundation.d.ts +94 -0
- package/dist/components/cropper/foundation.js +851 -0
- package/dist/components/cropper/utils.js +23 -0
- package/dist/components/date-picker/_utils/formatter.js +21 -0
- package/dist/components/date-picker/_utils/get-day-of-week.js +14 -0
- package/dist/components/date-picker/_utils/get-default-format-token.js +18 -0
- package/dist/components/date-picker/_utils/get-default-picker-date.js +35 -0
- package/dist/components/date-picker/_utils/get-full-date-offset.js +11 -0
- package/dist/components/date-picker/_utils/get-inset-input-format-token.js +33 -0
- package/dist/components/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +57 -0
- package/dist/components/date-picker/_utils/get-month-table.js +33 -0
- package/dist/components/date-picker/_utils/get-year-and-month.js +18 -0
- package/dist/components/date-picker/_utils/get-year-month-from-value.js +18 -0
- package/dist/components/date-picker/_utils/get-years.js +9 -0
- package/dist/components/date-picker/_utils/index.d.ts +9 -0
- package/dist/components/date-picker/_utils/index.js +9 -0
- package/dist/components/date-picker/_utils/is-after.js +7 -0
- package/dist/components/date-picker/_utils/is-before.js +7 -0
- package/dist/components/date-picker/_utils/is-between.js +11 -0
- package/dist/components/date-picker/_utils/is-same-day.js +7 -0
- package/dist/components/date-picker/_utils/is-timestamp.js +6 -0
- package/dist/components/date-picker/_utils/is-valid-date.js +5 -0
- package/dist/components/date-picker/_utils/parser.js +17 -0
- package/dist/components/date-picker/_utils/picker-type.js +28 -0
- package/dist/components/date-picker/_utils/to-callback-args.js +46 -0
- package/dist/components/date-picker/_utils/to-date-arg.js +13 -0
- package/dist/components/date-picker/constants.js +78 -0
- package/dist/components/date-picker/date-picker.scss +1762 -0
- package/dist/components/date-picker/foundation.d.ts +299 -0
- package/dist/components/date-picker/foundation.js +707 -0
- package/dist/components/date-picker/input-foundation.d.ts +134 -0
- package/dist/components/date-picker/input-foundation.js +212 -0
- package/dist/components/date-picker/month-foundation.d.ts +163 -0
- package/dist/components/date-picker/month-foundation.js +196 -0
- package/dist/components/date-picker/months-grid-foundation.d.ts +163 -0
- package/dist/components/date-picker/months-grid-foundation.js +614 -0
- package/dist/components/date-picker/year-and-month-foundation.d.ts +75 -0
- package/dist/components/date-picker/year-and-month-foundation.js +115 -0
- package/dist/components/descriptions/constants.js +4 -0
- package/dist/components/descriptions/foundation.d.ts +9 -0
- package/dist/components/descriptions/foundation.js +33 -0
- package/dist/components/divider/constants.js +4 -0
- package/dist/components/drag-move/foundation.d.ts +31 -0
- package/dist/components/drag-move/foundation.js +203 -0
- package/dist/components/dropdown/constants.js +12 -0
- package/dist/components/dropdown/foundation.d.ts +37 -0
- package/dist/components/dropdown/foundation.js +124 -0
- package/dist/components/dropdown/menu-foundation.d.ts +35 -0
- package/dist/components/dropdown/menu-foundation.js +83 -0
- package/dist/components/empty/constants.js +5 -0
- package/dist/components/feedback/constants.js +19 -0
- package/dist/components/feedback/feedback.scss +153 -0
- package/dist/components/feedback/foundation.d.ts +42 -0
- package/dist/components/feedback/foundation.js +70 -0
- package/dist/components/float-button/constants.js +13 -0
- package/dist/components/float-button/float-button.scss +201 -0
- package/dist/components/form/array-field-rows.d.ts +23 -0
- package/dist/components/form/array-field-rows.js +60 -0
- package/dist/components/form/constants.d.ts +15 -0
- package/dist/components/form/constants.js +47 -0
- package/dist/components/form/errors.d.ts +15 -0
- package/dist/components/form/errors.js +50 -0
- package/dist/components/form/field-store.js +28 -0
- package/dist/components/form/form-api-proxy.d.ts +14 -0
- package/dist/components/form/form-api-proxy.js +48 -0
- package/dist/components/form/form.css +250 -0
- package/dist/components/form/form.scss +319 -0
- package/dist/components/form/foundation.d.ts +71 -0
- package/dist/components/form/foundation.js +1100 -0
- package/dist/components/form/interface.d.ts +247 -0
- package/dist/components/form/json-schema.d.ts +42 -0
- package/dist/components/form/json-schema.js +208 -0
- package/dist/components/form/rtl.scss +13 -0
- package/dist/components/form/rules.d.ts +37 -0
- package/dist/components/form/rules.js +97 -0
- package/dist/components/form/utils.d.ts +119 -0
- package/dist/components/form/utils.js +154 -0
- package/dist/components/form/variables.scss +52 -0
- package/dist/components/grid/constants.js +12 -0
- package/dist/components/grid/gutter.js +39 -0
- package/dist/components/grid/utils.js +39 -0
- package/dist/components/highlight/constants.js +4 -0
- package/dist/components/highlight/foundation.js +108 -0
- package/dist/components/hot-keys/constants.js +207 -0
- package/dist/components/hot-keys/foundation.d.ts +22 -0
- package/dist/components/hot-keys/foundation.js +96 -0
- package/dist/components/image/constants.js +5 -0
- package/dist/components/image/image-foundation.d.ts +39 -0
- package/dist/components/image/image-foundation.js +60 -0
- package/dist/components/image/image.scss +272 -0
- package/dist/components/image/preview-footer-foundation.d.ts +25 -0
- package/dist/components/image/preview-footer-foundation.js +30 -0
- package/dist/components/image/preview-foundation.d.ts +54 -0
- package/dist/components/image/preview-foundation.js +79 -0
- package/dist/components/image/preview-image-foundation.d.ts +63 -0
- package/dist/components/image/preview-image-foundation.js +238 -0
- package/dist/components/image/preview-inner-foundation.d.ts +92 -0
- package/dist/components/image/preview-inner-foundation.js +290 -0
- package/dist/components/image/utils.js +66 -0
- package/dist/components/input/constants.d.ts +8 -0
- package/dist/components/input/constants.js +13 -0
- package/dist/components/input/foundation.d.ts +51 -0
- package/dist/components/input/foundation.js +81 -0
- package/dist/components/input/input.css +619 -0
- package/dist/components/input/input.scss +746 -0
- package/dist/components/input/text-entry-foundation.d.ts +60 -0
- package/dist/components/input/text-entry-foundation.js +105 -0
- package/dist/components/input/textarea-foundation.d.ts +63 -0
- package/dist/components/input/textarea-foundation.js +138 -0
- package/dist/components/input/textarea.css +260 -0
- package/dist/components/input/textarea.scss +320 -0
- package/dist/components/input/util/line-number.js +42 -0
- package/dist/components/input/util/truncate-value.js +14 -0
- package/dist/components/input/variables.scss +107 -0
- package/dist/components/input-number/caret.js +20 -0
- package/dist/components/input-number/constants.d.ts +14 -0
- package/dist/components/input-number/constants.js +13 -0
- package/dist/components/input-number/foundation.d.ts +104 -0
- package/dist/components/input-number/foundation.js +555 -0
- package/dist/components/json-viewer/constants.js +4 -0
- package/dist/components/json-viewer/foundation.d.ts +53 -0
- package/dist/components/json-viewer/foundation.js +161 -0
- package/dist/components/json-viewer/json-viewer.scss +224 -0
- package/dist/components/layout/constants.js +4 -0
- package/dist/components/list/constants.js +4 -0
- package/dist/components/list/list.scss +162 -0
- package/dist/components/lottie/constants.js +4 -0
- package/dist/components/lottie/foundation.d.ts +31 -0
- package/dist/components/lottie/foundation.js +65 -0
- package/dist/components/markdown-render/constants.js +4 -0
- package/dist/components/markdown-render/foundation.d.ts +54 -0
- package/dist/components/markdown-render/foundation.js +118 -0
- package/dist/components/modal/confirm-registry.d.ts +10 -0
- package/dist/components/modal/confirm-registry.js +21 -0
- package/dist/components/modal/confirm.js +34 -0
- package/dist/components/modal/constants.js +4 -0
- package/dist/components/modal/modal-content-foundation.d.ts +38 -0
- package/dist/components/modal/modal-content-foundation.js +73 -0
- package/dist/components/modal/modal-foundation.d.ts +92 -0
- package/dist/components/modal/modal-foundation.js +115 -0
- package/dist/components/navigation/constants.js +20 -0
- package/dist/components/navigation/foundation.d.ts +81 -0
- package/dist/components/navigation/foundation.js +180 -0
- package/dist/components/navigation/item-foundation.d.ts +44 -0
- package/dist/components/navigation/item-foundation.js +42 -0
- package/dist/components/navigation/navigation.scss +764 -0
- package/dist/components/navigation/sub-nav-foundation.d.ts +30 -0
- package/dist/components/navigation/sub-nav-foundation.js +54 -0
- package/dist/components/navigation/variables.scss +120 -0
- package/dist/components/notification/constants.js +32 -0
- package/dist/components/notification/notification-api-foundation.d.ts +29 -0
- package/dist/components/notification/notification-api-foundation.js +58 -0
- package/dist/components/notification/notification-foundation.d.ts +40 -0
- package/dist/components/notification/notification-foundation.js +12 -0
- package/dist/components/notification/notification-list-foundation.d.ts +73 -0
- package/dist/components/notification/notification-list-foundation.js +94 -0
- package/dist/components/overflow-list/constants.d.ts +21 -0
- package/dist/components/overflow-list/constants.js +22 -0
- package/dist/components/overflow-list/foundation.d.ts +78 -0
- package/dist/components/overflow-list/foundation.js +195 -0
- package/dist/components/pagination/constants.js +14 -0
- package/dist/components/pagination/foundation.d.ts +54 -0
- package/dist/components/pagination/foundation.js +185 -0
- package/dist/components/pagination/pagination.scss +189 -0
- package/dist/components/pincode/constants.js +4 -0
- package/dist/components/pincode/foundation.d.ts +38 -0
- package/dist/components/pincode/foundation.js +92 -0
- package/dist/components/popconfirm/constants.d.ts +4 -0
- package/dist/components/popconfirm/constants.js +7 -0
- package/dist/components/popconfirm/popconfirm-foundation.d.ts +47 -0
- package/dist/components/popconfirm/popconfirm-foundation.js +85 -0
- package/dist/components/popover/constants.js +47 -0
- package/dist/components/progress/constants.js +8 -0
- package/dist/components/progress/generates.js +24 -0
- package/dist/components/progress/utils.js +45 -0
- package/dist/components/radio/constants.js +19 -0
- package/dist/components/radio/radio-foundation.d.ts +76 -0
- package/dist/components/radio/radio-foundation.js +92 -0
- package/dist/components/radio/radio-group-foundation.d.ts +19 -0
- package/dist/components/radio/radio-group-foundation.js +31 -0
- package/dist/components/radio/variables.scss +107 -0
- package/dist/components/rating/constants.js +5 -0
- package/dist/components/rating/foundation.d.ts +101 -0
- package/dist/components/rating/foundation.js +166 -0
- package/dist/components/rating/variables.scss +19 -0
- package/dist/components/resizable/constants.js +4 -0
- package/dist/components/resizable/foundation.d.ts +3 -0
- package/dist/components/resizable/group/index.d.ts +60 -0
- package/dist/components/resizable/group/index.js +351 -0
- package/dist/components/resizable/resizable.scss +146 -0
- package/dist/components/resizable/single/index.d.ts +86 -0
- package/dist/components/resizable/single/index.js +444 -0
- package/dist/components/resizable/types.js +18 -0
- package/dist/components/resizable/utils.js +53 -0
- package/dist/components/scroll-list/constants.js +11 -0
- package/dist/components/scroll-list/item-foundation.d.ts +57 -0
- package/dist/components/scroll-list/item-foundation.js +331 -0
- package/dist/components/scroll-list/scroll-list.scss +198 -0
- package/dist/components/scroll-list/scroll-to.js +15 -0
- package/dist/components/select/combobox-name.js +21 -0
- package/dist/components/select/constants.js +22 -0
- package/dist/components/select/foundation.d.ts +135 -0
- package/dist/components/select/foundation.js +752 -0
- package/dist/components/select/option-foundation.js +35 -0
- package/dist/components/select/option.css +67 -0
- package/dist/components/select/select.scss +554 -0
- package/dist/components/side-sheet/constants.js +5 -0
- package/dist/components/side-sheet/side-sheet-foundation.d.ts +80 -0
- package/dist/components/side-sheet/side-sheet-foundation.js +109 -0
- package/dist/components/skeleton/constants.js +4 -0
- package/dist/components/slider/constants.js +12 -0
- package/dist/components/slider/foundation.d.ts +163 -0
- package/dist/components/slider/foundation.js +444 -0
- package/dist/components/slider/variables.scss +63 -0
- package/dist/components/sortable/accessibility.d.ts +14 -0
- package/dist/components/sortable/accessibility.js +49 -0
- package/dist/components/space/constants.js +9 -0
- package/dist/components/spin/constants.js +3 -0
- package/dist/components/spin/foundation.d.ts +22 -0
- package/dist/components/spin/foundation.js +46 -0
- package/dist/components/spin/spin.scss +111 -0
- package/dist/components/steps/bacis-steps.css +234 -0
- package/dist/components/steps/constants.js +8 -0
- package/dist/components/steps/fill-steps.css +141 -0
- package/dist/components/steps/nav-steps.css +48 -0
- package/dist/components/steps/steps.scss +17 -0
- package/dist/components/steps/utils.js +15 -0
- package/dist/components/switch/constants.js +16 -0
- package/dist/components/switch/foundation.d.ts +23 -0
- package/dist/components/switch/foundation.js +20 -0
- package/dist/components/switch/variables.scss +71 -0
- package/dist/components/table/constants.d.ts +76 -0
- package/dist/components/table/constants.js +111 -0
- package/dist/components/table/foundation.d.ts +356 -0
- package/dist/components/table/foundation.js +1001 -0
- package/dist/components/table/operation-panel.css +29 -0
- package/dist/components/table/table.css +636 -0
- package/dist/components/table/table.scss +788 -0
- package/dist/components/table/utils.d.ts +216 -0
- package/dist/components/table/utils.js +516 -0
- package/dist/components/table/variables.scss +81 -0
- package/dist/components/tabs/constants.d.ts +32 -0
- package/dist/components/tabs/constants.js +39 -0
- package/dist/components/tabs/foundation.d.ts +87 -0
- package/dist/components/tabs/foundation.js +190 -0
- package/dist/components/tabs/tabs.scss +933 -0
- package/dist/components/tabs/variables.scss +155 -0
- package/dist/components/tag/constants.js +35 -0
- package/dist/components/tag/focus.js +22 -0
- package/dist/components/tag/mixin.scss +19 -0
- package/dist/components/tag/tag-key.js +18 -0
- package/dist/components/tag/tag.css +537 -0
- package/dist/components/tag/variables.scss +85 -0
- package/dist/components/tag-input/constants.js +9 -0
- package/dist/components/tag-input/foundation.d.ts +94 -0
- package/dist/components/tag-input/foundation.js +247 -0
- package/dist/components/tag-input/tag-input.scss +357 -0
- package/dist/components/tag-input/utils/get-splited-array.js +16 -0
- package/dist/components/tag-input/utils/tag-focus.js +14 -0
- package/dist/components/time-picker/combox-foundation.d.ts +64 -0
- package/dist/components/time-picker/combox-foundation.js +96 -0
- package/dist/components/time-picker/constants.js +23 -0
- package/dist/components/time-picker/foundation.d.ts +91 -0
- package/dist/components/time-picker/foundation.js +272 -0
- package/dist/components/time-picker/input-foundation.d.ts +18 -0
- package/dist/components/time-picker/input-foundation.js +35 -0
- package/dist/components/time-picker/utils/index.js +57 -0
- package/dist/components/timeline/constants.js +7 -0
- package/dist/components/timeline/timeline.scss +190 -0
- package/dist/components/timeline/utils.js +10 -0
- package/dist/components/toast/constants.js +34 -0
- package/dist/components/toast/toast-api-foundation.d.ts +26 -0
- package/dist/components/toast/toast-api-foundation.js +49 -0
- package/dist/components/toast/toast-foundation.d.ts +37 -0
- package/dist/components/toast/toast-foundation.js +5 -0
- package/dist/components/toast/toast-list-foundation.d.ts +31 -0
- package/dist/components/toast/toast-list-foundation.js +76 -0
- package/dist/components/tooltip/adjust-position.js +202 -0
- package/dist/components/tooltip/arrow.css +1 -0
- package/dist/components/tooltip/constants.d.ts +53 -0
- package/dist/components/tooltip/constants.js +99 -0
- package/dist/components/tooltip/foundation.d.ts +116 -0
- package/dist/components/tooltip/foundation.js +750 -0
- package/dist/components/tooltip/position.css +10 -0
- package/dist/components/tooltip/tooltip.scss +72 -0
- package/dist/components/transfer/constants.js +10 -0
- package/dist/components/transfer/foundation.d.ts +130 -0
- package/dist/components/transfer/foundation.js +241 -0
- package/dist/components/transfer/transfer-utils.js +45 -0
- package/dist/components/transfer/transfer.scss +260 -0
- package/dist/components/tree/constants.js +8 -0
- package/dist/components/tree/foundation.d.ts +283 -0
- package/dist/components/tree/foundation.js +341 -0
- package/dist/components/tree/shared.d.ts +208 -0
- package/dist/components/tree/shared.js +564 -0
- package/dist/components/tree/tree-util.d.ts +100 -0
- package/dist/components/tree/tree-util.js +447 -0
- package/dist/components/tree/tree.scss +439 -0
- package/dist/components/tree-select/constants.js +19 -0
- package/dist/components/tree-select/foundation.d.ts +161 -0
- package/dist/components/tree-select/foundation.js +427 -0
- package/dist/components/tree-select/tree-select.scss +467 -0
- package/dist/components/typography/constants.js +50 -0
- package/dist/components/typography/ellipsis.js +154 -0
- package/dist/components/typography/format-numeral.js +99 -0
- package/dist/components/typography/typography.scss +383 -0
- package/dist/components/upload/constants.d.ts +24 -0
- package/dist/components/upload/constants.js +39 -0
- package/dist/components/upload/foundation.d.ts +180 -0
- package/dist/components/upload/foundation.js +763 -0
- package/dist/components/upload/upload.scss +640 -0
- package/dist/components/upload/utils.d.ts +25 -0
- package/dist/components/upload/utils.js +102 -0
- package/dist/components/user-guide/constants.js +12 -0
- package/dist/components/user-guide/foundation.d.ts +72 -0
- package/dist/components/user-guide/foundation.js +121 -0
- package/dist/components/video-player/constants.js +48 -0
- package/dist/components/video-player/foundation.d.ts +89 -0
- package/dist/components/video-player/foundation.js +316 -0
- package/dist/components/video-player/progress-foundation.d.ts +48 -0
- package/dist/components/video-player/progress-foundation.js +91 -0
- package/dist/components/video-player/seek-foundation.d.ts +49 -0
- package/dist/components/video-player/seek-foundation.js +52 -0
- package/dist/components/video-player/utils.js +58 -0
- package/dist/components/video-player/video-player.scss +344 -0
- package/dist/locale/format.d.ts +5 -0
- package/dist/locale/format.js +9 -0
- package/dist/locale/interface.d.ts +18 -0
- package/dist/locale/source/ar.js +19 -1
- package/dist/locale/source/az.js +19 -1
- package/dist/locale/source/bg.js +19 -1
- package/dist/locale/source/bn_IN.js +19 -1
- package/dist/locale/source/ca.js +19 -1
- package/dist/locale/source/ceb_PH.js +19 -1
- package/dist/locale/source/cs_CZ.js +19 -1
- package/dist/locale/source/da.js +19 -1
- package/dist/locale/source/de.js +19 -1
- package/dist/locale/source/el_GR.js +19 -1
- package/dist/locale/source/en_GB.js +19 -1
- package/dist/locale/source/en_US.js +19 -1
- package/dist/locale/source/es.js +19 -1
- package/dist/locale/source/es_419.js +19 -1
- package/dist/locale/source/et.js +19 -1
- package/dist/locale/source/fa_IR.js +19 -1
- package/dist/locale/source/fi_FI.js +19 -1
- package/dist/locale/source/fil_PH.js +19 -1
- package/dist/locale/source/fr.js +19 -1
- package/dist/locale/source/fr_CA.js +19 -1
- package/dist/locale/source/ga.js +19 -1
- package/dist/locale/source/he_IL.js +19 -1
- package/dist/locale/source/hi_IN.js +19 -1
- package/dist/locale/source/hr.js +19 -1
- package/dist/locale/source/hu_HU.js +19 -1
- package/dist/locale/source/id_ID.js +19 -1
- package/dist/locale/source/is.js +19 -1
- package/dist/locale/source/it.js +19 -1
- package/dist/locale/source/ja_JP.js +19 -1
- package/dist/locale/source/jv_ID.js +19 -1
- package/dist/locale/source/kk.js +19 -1
- package/dist/locale/source/km_KH.js +19 -1
- package/dist/locale/source/ko_KR.js +19 -1
- package/dist/locale/source/lt.js +19 -1
- package/dist/locale/source/lv.js +19 -1
- package/dist/locale/source/ms_MY.js +19 -1
- package/dist/locale/source/my_MM.js +19 -1
- package/dist/locale/source/nb.js +19 -1
- package/dist/locale/source/nl_NL.js +19 -1
- package/dist/locale/source/pl_PL.js +19 -1
- package/dist/locale/source/pt.js +19 -1
- package/dist/locale/source/pt_BR.js +19 -1
- package/dist/locale/source/ro.js +19 -1
- package/dist/locale/source/ru_RU.js +19 -1
- package/dist/locale/source/sk.js +19 -1
- package/dist/locale/source/sl.js +19 -1
- package/dist/locale/source/sq.js +19 -1
- package/dist/locale/source/sv_SE.js +19 -1
- package/dist/locale/source/sw.js +19 -1
- package/dist/locale/source/th_TH.js +19 -1
- package/dist/locale/source/tr_TR.js +19 -1
- package/dist/locale/source/uk_UA.js +19 -1
- package/dist/locale/source/ur.js +19 -1
- package/dist/locale/source/uz.js +19 -1
- package/dist/locale/source/vi_VN.js +19 -1
- package/dist/locale/source/zh_CN.js +19 -1
- package/dist/locale/source/zh_TW.js +19 -1
- package/dist/theme/global.scss +36 -36
- package/dist/utils/a11y.d.ts +11 -3
- package/dist/utils/a11y.js +25 -5
- package/dist/utils/date-fns-extra.d.ts +3 -1
- package/dist/utils/date-fns-extra.js +8 -3
- package/dist/utils/dom.d.ts +0 -2
- package/dist/utils/dom.js +1 -4
- package/dist/utils/focus-handover.js +1 -1
- package/package.json +2 -3
- package/dist/anchor/constants.d.ts +0 -9
- package/dist/anchor/constants.js +0 -14
- package/dist/anchor/foundation.d.ts +0 -46
- package/dist/anchor/foundation.js +0 -142
- package/dist/anchor/utils.js +0 -16
- package/dist/anchor/variables.scss +0 -34
- package/dist/audio-player/audio-player.css +0 -226
- package/dist/audio-player/audio-player.scss +0 -278
- package/dist/audio-player/constants.js +0 -27
- package/dist/audio-player/foundation.d.ts +0 -43
- package/dist/audio-player/foundation.js +0 -115
- package/dist/audio-player/utils.js +0 -6
- package/dist/audio-player/variables.scss +0 -53
- package/dist/auto-complete/constants.js +0 -7
- package/dist/auto-complete/foundation.d.ts +0 -75
- package/dist/auto-complete/foundation.js +0 -218
- package/dist/avatar/constants.js +0 -13
- package/dist/avatar/foundation.d.ts +0 -28
- package/dist/avatar/foundation.js +0 -31
- package/dist/avatar/variables.scss +0 -112
- package/dist/backtop/constants.js +0 -35
- package/dist/backtop/foundation.d.ts +0 -23
- package/dist/backtop/foundation.js +0 -68
- package/dist/badge/constants.js +0 -4
- package/dist/banner/constants.js +0 -4
- package/dist/banner/foundation.d.ts +0 -9
- package/dist/banner/foundation.js +0 -9
- package/dist/breadcrumb/breadcrumb.scss +0 -116
- package/dist/breadcrumb/constants.js +0 -8
- package/dist/breadcrumb/foundation.d.ts +0 -37
- package/dist/breadcrumb/foundation.js +0 -60
- package/dist/breadcrumb/item-foundation.d.ts +0 -45
- package/dist/breadcrumb/item-foundation.js +0 -36
- package/dist/button/constants.js +0 -5
- package/dist/button/utils.d.ts +0 -27
- package/dist/button/utils.js +0 -89
- package/dist/button/variables.scss +0 -169
- package/dist/calendar/calendar.css +0 -486
- package/dist/calendar/calendar.scss +0 -518
- package/dist/calendar/constants.js +0 -14
- package/dist/calendar/event-util.js +0 -193
- package/dist/calendar/foundation.d.ts +0 -75
- package/dist/calendar/foundation.js +0 -194
- package/dist/calendar/month-foundation.d.ts +0 -10
- package/dist/calendar/month-foundation.js +0 -12
- package/dist/card/constants.js +0 -4
- package/dist/carousel/carousel.css +0 -345
- package/dist/carousel/carousel.scss +0 -451
- package/dist/carousel/constants.js +0 -42
- package/dist/carousel/foundation.d.ts +0 -59
- package/dist/carousel/foundation.js +0 -204
- package/dist/carousel/variables.scss +0 -49
- package/dist/cascader/cascader.scss +0 -586
- package/dist/cascader/constants.js +0 -20
- package/dist/cascader/foundation.d.ts +0 -304
- package/dist/cascader/foundation.js +0 -906
- package/dist/cascader/util.js +0 -148
- package/dist/checkbox/checkbox-foundation.d.ts +0 -93
- package/dist/checkbox/checkbox-foundation.js +0 -63
- package/dist/checkbox/checkbox-group-foundation.d.ts +0 -20
- package/dist/checkbox/checkbox-group-foundation.js +0 -28
- package/dist/checkbox/constants.js +0 -15
- package/dist/checkbox/variables.scss +0 -72
- package/dist/code-highlight/constants.js +0 -4
- package/dist/code-highlight/highlighter.js +0 -56
- package/dist/code-highlight/index.d.ts +0 -24
- package/dist/code-highlight/index.js +0 -19
- package/dist/code-highlight/registry.js +0 -33
- package/dist/collapse/collapse.scss +0 -112
- package/dist/collapse/constants.js +0 -4
- package/dist/collapse/foundation.d.ts +0 -47
- package/dist/collapse/foundation.js +0 -44
- package/dist/collapsible/constants.js +0 -4
- package/dist/collapsible/foundation.d.ts +0 -68
- package/dist/collapsible/foundation.js +0 -123
- package/dist/color-picker/alpha-slider-foundation.d.ts +0 -27
- package/dist/color-picker/alpha-slider-foundation.js +0 -41
- package/dist/color-picker/color-choose-area-foundation.d.ts +0 -33
- package/dist/color-picker/color-choose-area-foundation.js +0 -57
- package/dist/color-picker/color-picker.scss +0 -129
- package/dist/color-picker/color-slider-foundation.d.ts +0 -27
- package/dist/color-picker/color-slider-foundation.js +0 -41
- package/dist/color-picker/constants.js +0 -4
- package/dist/color-picker/data-part-foundation.d.ts +0 -28
- package/dist/color-picker/data-part-foundation.js +0 -76
- package/dist/color-picker/foundation.d.ts +0 -56
- package/dist/color-picker/foundation.js +0 -149
- package/dist/color-picker/utils/convert.d.ts +0 -16
- package/dist/color-picker/utils/convert.js +0 -150
- package/dist/color-picker/utils/round.js +0 -5
- package/dist/color-picker/utils/split.js +0 -26
- package/dist/config-provider/breakpoint-observer.js +0 -139
- package/dist/config-provider/inherit-config.d.ts +0 -24
- package/dist/config-provider/inherit-config.js +0 -24
- package/dist/cropper/constants.js +0 -37
- package/dist/cropper/cropper.scss +0 -129
- package/dist/cropper/foundation.d.ts +0 -90
- package/dist/cropper/foundation.js +0 -806
- package/dist/cropper/utils.js +0 -23
- package/dist/date-picker/_utils/formatter.js +0 -21
- package/dist/date-picker/_utils/get-day-of-week.js +0 -14
- package/dist/date-picker/_utils/get-default-format-token.js +0 -18
- package/dist/date-picker/_utils/get-default-picker-date.js +0 -35
- package/dist/date-picker/_utils/get-full-date-offset.js +0 -11
- package/dist/date-picker/_utils/get-inset-input-format-token.js +0 -33
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +0 -57
- package/dist/date-picker/_utils/get-month-table.js +0 -33
- package/dist/date-picker/_utils/get-year-and-month.js +0 -18
- package/dist/date-picker/_utils/get-year-month-from-value.js +0 -18
- package/dist/date-picker/_utils/get-years.js +0 -9
- package/dist/date-picker/_utils/index.d.ts +0 -11
- package/dist/date-picker/_utils/index.js +0 -11
- package/dist/date-picker/_utils/is-after.js +0 -7
- package/dist/date-picker/_utils/is-before.js +0 -7
- package/dist/date-picker/_utils/is-between.js +0 -11
- package/dist/date-picker/_utils/is-same-day.js +0 -7
- package/dist/date-picker/_utils/is-timestamp.js +0 -6
- package/dist/date-picker/_utils/is-valid-date.js +0 -5
- package/dist/date-picker/_utils/parser.js +0 -17
- package/dist/date-picker/_utils/picker-type.js +0 -28
- package/dist/date-picker/_utils/to-callback-args.js +0 -46
- package/dist/date-picker/_utils/to-date-arg.js +0 -13
- package/dist/date-picker/constants.js +0 -78
- package/dist/date-picker/date-picker.scss +0 -1762
- package/dist/date-picker/foundation.d.ts +0 -317
- package/dist/date-picker/foundation.js +0 -709
- package/dist/date-picker/input-foundation.d.ts +0 -138
- package/dist/date-picker/input-foundation.js +0 -212
- package/dist/date-picker/month-foundation.d.ts +0 -154
- package/dist/date-picker/month-foundation.js +0 -186
- package/dist/date-picker/months-grid-foundation.d.ts +0 -171
- package/dist/date-picker/months-grid-foundation.js +0 -547
- package/dist/date-picker/year-and-month-foundation.d.ts +0 -75
- package/dist/date-picker/year-and-month-foundation.js +0 -115
- package/dist/descriptions/constants.js +0 -4
- package/dist/descriptions/foundation.d.ts +0 -12
- package/dist/descriptions/foundation.js +0 -36
- package/dist/divider/constants.js +0 -4
- package/dist/drag-move/foundation.d.ts +0 -30
- package/dist/drag-move/foundation.js +0 -180
- package/dist/dropdown/constants.js +0 -12
- package/dist/dropdown/foundation.d.ts +0 -38
- package/dist/dropdown/foundation.js +0 -124
- package/dist/dropdown/menu-foundation.d.ts +0 -35
- package/dist/dropdown/menu-foundation.js +0 -82
- package/dist/empty/constants.js +0 -5
- package/dist/feedback/constants.js +0 -19
- package/dist/feedback/feedback.scss +0 -153
- package/dist/feedback/foundation.d.ts +0 -42
- package/dist/feedback/foundation.js +0 -72
- package/dist/float-button/constants.js +0 -13
- package/dist/float-button/float-button.scss +0 -201
- package/dist/form/constants.d.ts +0 -7
- package/dist/form/constants.js +0 -8
- package/dist/form/field-store.js +0 -28
- package/dist/form/form-api-proxy.d.ts +0 -14
- package/dist/form/form-api-proxy.js +0 -48
- package/dist/form/form.css +0 -229
- package/dist/form/form.scss +0 -295
- package/dist/form/foundation.d.ts +0 -65
- package/dist/form/foundation.js +0 -820
- package/dist/form/interface.d.ts +0 -158
- package/dist/form/rtl.scss +0 -13
- package/dist/form/utils.d.ts +0 -81
- package/dist/form/utils.js +0 -108
- package/dist/form/variables.scss +0 -50
- package/dist/grid/constants.js +0 -12
- package/dist/grid/gutter.js +0 -39
- package/dist/grid/utils.js +0 -39
- package/dist/highlight/constants.js +0 -4
- package/dist/highlight/foundation.js +0 -108
- package/dist/hot-keys/constants.js +0 -207
- package/dist/hot-keys/foundation.d.ts +0 -18
- package/dist/hot-keys/foundation.js +0 -92
- package/dist/image/constants.js +0 -5
- package/dist/image/image-foundation.d.ts +0 -28
- package/dist/image/image-foundation.js +0 -40
- package/dist/image/image.scss +0 -272
- package/dist/image/preview-footer-foundation.d.ts +0 -25
- package/dist/image/preview-footer-foundation.js +0 -30
- package/dist/image/preview-foundation.d.ts +0 -48
- package/dist/image/preview-foundation.js +0 -71
- package/dist/image/preview-image-foundation.d.ts +0 -67
- package/dist/image/preview-image-foundation.js +0 -226
- package/dist/image/preview-inner-foundation.d.ts +0 -86
- package/dist/image/preview-inner-foundation.js +0 -238
- package/dist/image/utils.js +0 -66
- package/dist/input/constants.d.ts +0 -9
- package/dist/input/constants.js +0 -14
- package/dist/input/foundation.d.ts +0 -50
- package/dist/input/foundation.js +0 -77
- package/dist/input/input.css +0 -616
- package/dist/input/input.scss +0 -738
- package/dist/input/text-entry-foundation.d.ts +0 -53
- package/dist/input/text-entry-foundation.js +0 -92
- package/dist/input/textarea-foundation.d.ts +0 -60
- package/dist/input/textarea-foundation.js +0 -130
- package/dist/input/textarea.css +0 -257
- package/dist/input/textarea.scss +0 -313
- package/dist/input/util/line-number.js +0 -42
- package/dist/input/util/truncate-value.js +0 -14
- package/dist/input/variables.scss +0 -107
- package/dist/input-number/caret.js +0 -20
- package/dist/input-number/constants.d.ts +0 -15
- package/dist/input-number/constants.js +0 -13
- package/dist/input-number/foundation.d.ts +0 -107
- package/dist/input-number/foundation.js +0 -553
- package/dist/json-viewer/constants.js +0 -4
- package/dist/json-viewer/foundation.d.ts +0 -40
- package/dist/json-viewer/foundation.js +0 -123
- package/dist/json-viewer/json-viewer.scss +0 -224
- package/dist/layout/constants.js +0 -4
- package/dist/list/constants.js +0 -4
- package/dist/list/list.scss +0 -162
- package/dist/lottie/constants.js +0 -4
- package/dist/lottie/foundation.d.ts +0 -24
- package/dist/lottie/foundation.js +0 -62
- package/dist/markdown-render/constants.js +0 -4
- package/dist/markdown-render/foundation.d.ts +0 -45
- package/dist/markdown-render/foundation.js +0 -97
- package/dist/modal/confirm.js +0 -34
- package/dist/modal/constants.js +0 -4
- package/dist/modal/modal-content-foundation.d.ts +0 -40
- package/dist/modal/modal-content-foundation.js +0 -48
- package/dist/modal/modal-foundation.d.ts +0 -85
- package/dist/modal/modal-foundation.js +0 -74
- package/dist/navigation/constants.js +0 -20
- package/dist/navigation/foundation.d.ts +0 -68
- package/dist/navigation/foundation.js +0 -152
- package/dist/navigation/item-foundation.d.ts +0 -44
- package/dist/navigation/item-foundation.js +0 -42
- package/dist/navigation/navigation.scss +0 -764
- package/dist/navigation/sub-nav-foundation.d.ts +0 -30
- package/dist/navigation/sub-nav-foundation.js +0 -54
- package/dist/navigation/variables.scss +0 -120
- package/dist/notification/constants.js +0 -32
- package/dist/notification/notification-foundation.d.ts +0 -33
- package/dist/notification/notification-foundation.js +0 -5
- package/dist/notification/notification-list-foundation.d.ts +0 -55
- package/dist/notification/notification-list-foundation.js +0 -48
- package/dist/overflow-list/constants.d.ts +0 -17
- package/dist/overflow-list/constants.js +0 -16
- package/dist/overflow-list/foundation.d.ts +0 -76
- package/dist/overflow-list/foundation.js +0 -188
- package/dist/pagination/constants.js +0 -14
- package/dist/pagination/foundation.d.ts +0 -59
- package/dist/pagination/foundation.js +0 -175
- package/dist/pagination/pagination.scss +0 -189
- package/dist/pincode/constants.js +0 -4
- package/dist/pincode/foundation.d.ts +0 -36
- package/dist/pincode/foundation.js +0 -83
- package/dist/popconfirm/constants.d.ts +0 -7
- package/dist/popconfirm/constants.js +0 -8
- package/dist/popconfirm/popconfirm-foundation.d.ts +0 -36
- package/dist/popconfirm/popconfirm-foundation.js +0 -57
- package/dist/popover/constants.js +0 -47
- package/dist/progress/constants.js +0 -8
- package/dist/progress/generates.js +0 -24
- package/dist/progress/utils.js +0 -45
- package/dist/radio/constants.js +0 -19
- package/dist/radio/radio-foundation.d.ts +0 -74
- package/dist/radio/radio-foundation.js +0 -93
- package/dist/radio/radio-group-foundation.d.ts +0 -17
- package/dist/radio/radio-group-foundation.js +0 -27
- package/dist/radio/variables.scss +0 -107
- package/dist/rating/constants.js +0 -5
- package/dist/rating/foundation.d.ts +0 -104
- package/dist/rating/foundation.js +0 -164
- package/dist/rating/variables.scss +0 -19
- package/dist/resizable/constants.js +0 -4
- package/dist/resizable/foundation.d.ts +0 -3
- package/dist/resizable/group/index.d.ts +0 -51
- package/dist/resizable/group/index.js +0 -309
- package/dist/resizable/resizable.scss +0 -146
- package/dist/resizable/single/index.d.ts +0 -86
- package/dist/resizable/single/index.js +0 -426
- package/dist/resizable/types.js +0 -18
- package/dist/resizable/utils.js +0 -53
- package/dist/scroll-list/constants.js +0 -11
- package/dist/scroll-list/item-foundation.d.ts +0 -54
- package/dist/scroll-list/item-foundation.js +0 -335
- package/dist/scroll-list/scroll-list.scss +0 -198
- package/dist/scroll-list/scroll-to.js +0 -15
- package/dist/select/combobox-name.js +0 -21
- package/dist/select/constants.js +0 -22
- package/dist/select/foundation.d.ts +0 -125
- package/dist/select/foundation.js +0 -710
- package/dist/select/option-foundation.js +0 -35
- package/dist/select/select.scss +0 -554
- package/dist/side-sheet/constants.js +0 -5
- package/dist/side-sheet/side-sheet-foundation.d.ts +0 -64
- package/dist/side-sheet/side-sheet-foundation.js +0 -50
- package/dist/skeleton/constants.js +0 -4
- package/dist/slider/constants.js +0 -12
- package/dist/slider/foundation.d.ts +0 -156
- package/dist/slider/foundation.js +0 -429
- package/dist/slider/variables.scss +0 -63
- package/dist/sortable/accessibility.d.ts +0 -14
- package/dist/sortable/accessibility.js +0 -45
- package/dist/space/constants.js +0 -9
- package/dist/spin/constants.js +0 -3
- package/dist/spin/foundation.d.ts +0 -18
- package/dist/spin/foundation.js +0 -42
- package/dist/spin/spin.scss +0 -111
- package/dist/steps/constants.js +0 -8
- package/dist/steps/steps.scss +0 -17
- package/dist/steps/utils.js +0 -15
- package/dist/switch/constants.js +0 -16
- package/dist/switch/foundation.d.ts +0 -23
- package/dist/switch/foundation.js +0 -19
- package/dist/switch/variables.scss +0 -71
- package/dist/table/constants.d.ts +0 -62
- package/dist/table/constants.js +0 -97
- package/dist/table/foundation.d.ts +0 -345
- package/dist/table/foundation.js +0 -906
- package/dist/table/table.css +0 -636
- package/dist/table/table.scss +0 -788
- package/dist/table/utils.d.ts +0 -179
- package/dist/table/utils.js +0 -469
- package/dist/table/variables.scss +0 -81
- package/dist/tabs/constants.d.ts +0 -28
- package/dist/tabs/constants.js +0 -37
- package/dist/tabs/foundation.d.ts +0 -82
- package/dist/tabs/foundation.js +0 -185
- package/dist/tabs/tabs.scss +0 -933
- package/dist/tabs/variables.scss +0 -155
- package/dist/tag/constants.js +0 -35
- package/dist/tag/focus.js +0 -22
- package/dist/tag/mixin.scss +0 -18
- package/dist/tag/tag-key.js +0 -18
- package/dist/tag/tag.css +0 -537
- package/dist/tag/variables.scss +0 -85
- package/dist/tag-input/constants.js +0 -9
- package/dist/tag-input/foundation.d.ts +0 -89
- package/dist/tag-input/foundation.js +0 -221
- package/dist/tag-input/tag-input.scss +0 -357
- package/dist/tag-input/utils/get-splited-array.js +0 -16
- package/dist/tag-input/utils/tag-focus.js +0 -14
- package/dist/time-picker/combox-foundation.d.ts +0 -71
- package/dist/time-picker/combox-foundation.js +0 -96
- package/dist/time-picker/constants.js +0 -23
- package/dist/time-picker/foundation.d.ts +0 -98
- package/dist/time-picker/foundation.js +0 -245
- package/dist/time-picker/input-foundation.d.ts +0 -15
- package/dist/time-picker/input-foundation.js +0 -33
- package/dist/time-picker/utils/index.js +0 -57
- package/dist/timeline/constants.js +0 -7
- package/dist/timeline/timeline.scss +0 -190
- package/dist/timeline/utils.js +0 -10
- package/dist/toast/constants.js +0 -34
- package/dist/toast/toast-foundation.d.ts +0 -37
- package/dist/toast/toast-foundation.js +0 -5
- package/dist/toast/toast-list-foundation.d.ts +0 -25
- package/dist/toast/toast-list-foundation.js +0 -54
- package/dist/tooltip/adjust-position.js +0 -202
- package/dist/tooltip/constants.d.ts +0 -47
- package/dist/tooltip/constants.js +0 -93
- package/dist/tooltip/foundation.d.ts +0 -102
- package/dist/tooltip/foundation.js +0 -654
- package/dist/tooltip/tooltip.scss +0 -72
- package/dist/transfer/constants.js +0 -10
- package/dist/transfer/foundation.d.ts +0 -121
- package/dist/transfer/foundation.js +0 -193
- package/dist/transfer/transfer-utils.js +0 -45
- package/dist/transfer/transfer.scss +0 -260
- package/dist/tree/constants.js +0 -8
- package/dist/tree/foundation.d.ts +0 -294
- package/dist/tree/foundation.js +0 -538
- package/dist/tree/shared.d.ts +0 -126
- package/dist/tree/shared.js +0 -306
- package/dist/tree/tree-util.d.ts +0 -100
- package/dist/tree/tree-util.js +0 -450
- package/dist/tree/tree.scss +0 -439
- package/dist/tree-select/constants.js +0 -19
- package/dist/tree-select/foundation.d.ts +0 -180
- package/dist/tree-select/foundation.js +0 -615
- package/dist/tree-select/tree-select.scss +0 -467
- package/dist/typography/constants.js +0 -50
- package/dist/typography/ellipsis.js +0 -154
- package/dist/typography/format-numeral.js +0 -99
- package/dist/typography/typography.scss +0 -383
- package/dist/upload/constants.d.ts +0 -24
- package/dist/upload/constants.js +0 -39
- package/dist/upload/foundation.d.ts +0 -181
- package/dist/upload/foundation.js +0 -752
- package/dist/upload/upload.scss +0 -640
- package/dist/upload/utils.d.ts +0 -20
- package/dist/upload/utils.js +0 -93
- package/dist/user-guide/constants.js +0 -12
- package/dist/user-guide/foundation.d.ts +0 -45
- package/dist/user-guide/foundation.js +0 -73
- package/dist/utils/focus-handle.d.ts +0 -43
- package/dist/utils/focus-handle.js +0 -91
- package/dist/utils/focus-scope.js +0 -77
- package/dist/utils/release-holder.js +0 -18
- package/dist/video-player/constants.js +0 -48
- package/dist/video-player/foundation.d.ts +0 -94
- package/dist/video-player/foundation.js +0 -287
- package/dist/video-player/progress-foundation.d.ts +0 -79
- package/dist/video-player/progress-foundation.js +0 -116
- package/dist/video-player/utils.js +0 -50
- package/dist/video-player/video-player.scss +0 -344
- /package/dist/{utils → base}/focus-scope.d.ts +0 -0
- /package/dist/{utils → base}/release-holder.d.ts +0 -0
- /package/dist/{anchor → components/anchor}/anchor.css +0 -0
- /package/dist/{anchor → components/anchor}/anchor.scss +0 -0
- /package/dist/{anchor → components/anchor}/animation.scss +0 -0
- /package/dist/{anchor → components/anchor}/rtl.scss +0 -0
- /package/dist/{anchor → components/anchor}/utils.d.ts +0 -0
- /package/dist/{audio-player → components/audio-player}/constants.d.ts +0 -0
- /package/dist/{audio-player → components/audio-player}/utils.d.ts +0 -0
- /package/dist/{auto-complete → components/auto-complete}/animation.scss +0 -0
- /package/dist/{auto-complete → components/auto-complete}/auto-complete.css +0 -0
- /package/dist/{auto-complete → components/auto-complete}/auto-complete.scss +0 -0
- /package/dist/{auto-complete → components/auto-complete}/constants.d.ts +0 -0
- /package/dist/{auto-complete → components/auto-complete}/option.scss +0 -0
- /package/dist/{auto-complete → components/auto-complete}/rtl.scss +0 -0
- /package/dist/{auto-complete → components/auto-complete}/variables.scss +0 -0
- /package/dist/{avatar → components/avatar}/animation.scss +0 -0
- /package/dist/{avatar → components/avatar}/avatar.css +0 -0
- /package/dist/{avatar → components/avatar}/avatar.scss +0 -0
- /package/dist/{avatar → components/avatar}/constants.d.ts +0 -0
- /package/dist/{avatar → components/avatar}/mixin.scss +0 -0
- /package/dist/{avatar → components/avatar}/rtl.scss +0 -0
- /package/dist/{backtop → components/backtop}/backtop.css +0 -0
- /package/dist/{backtop → components/backtop}/backtop.scss +0 -0
- /package/dist/{backtop → components/backtop}/constants.d.ts +0 -0
- /package/dist/{backtop → components/backtop}/rtl.scss +0 -0
- /package/dist/{backtop → components/backtop}/variables.scss +0 -0
- /package/dist/{badge → components/badge}/badge.css +0 -0
- /package/dist/{badge → components/badge}/badge.scss +0 -0
- /package/dist/{badge → components/badge}/constants.d.ts +0 -0
- /package/dist/{badge → components/badge}/rtl.scss +0 -0
- /package/dist/{badge → components/badge}/variables.scss +0 -0
- /package/dist/{banner → components/banner}/banner.css +0 -0
- /package/dist/{banner → components/banner}/banner.scss +0 -0
- /package/dist/{banner → components/banner}/constants.d.ts +0 -0
- /package/dist/{banner → components/banner}/rtl.scss +0 -0
- /package/dist/{banner → components/banner}/variables.scss +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/animation.scss +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/breadcrumb.css +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/constants.d.ts +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/rtl.scss +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/variables.scss +0 -0
- /package/dist/{button → components/button}/animation.scss +0 -0
- /package/dist/{button → components/button}/button.css +0 -0
- /package/dist/{button → components/button}/button.scss +0 -0
- /package/dist/{button → components/button}/constants.d.ts +0 -0
- /package/dist/{button → components/button}/icon-button.css +0 -0
- /package/dist/{button → components/button}/icon-button.scss +0 -0
- /package/dist/{button → components/button}/rtl.scss +0 -0
- /package/dist/{button → components/button}/split-button-group.scss +0 -0
- /package/dist/{calendar → components/calendar}/constants.d.ts +0 -0
- /package/dist/{calendar → components/calendar}/event-util.d.ts +0 -0
- /package/dist/{calendar → components/calendar}/rtl.scss +0 -0
- /package/dist/{calendar → components/calendar}/variables.scss +0 -0
- /package/dist/{card → components/card}/card.css +0 -0
- /package/dist/{card → components/card}/card.scss +0 -0
- /package/dist/{card → components/card}/constants.d.ts +0 -0
- /package/dist/{card → components/card}/rtl.scss +0 -0
- /package/dist/{card → components/card}/variables.scss +0 -0
- /package/dist/{carousel → components/carousel}/animation.scss +0 -0
- /package/dist/{carousel → components/carousel}/constants.d.ts +0 -0
- /package/dist/{carousel → components/carousel}/rtl.scss +0 -0
- /package/dist/{cascader → components/cascader}/animation.scss +0 -0
- /package/dist/{cascader → components/cascader}/cascader.css +0 -0
- /package/dist/{cascader → components/cascader}/constants.d.ts +0 -0
- /package/dist/{cascader → components/cascader}/rtl.scss +0 -0
- /package/dist/{cascader → components/cascader}/util.d.ts +0 -0
- /package/dist/{cascader → components/cascader}/variables.scss +0 -0
- /package/dist/{checkbox → components/checkbox}/animation.scss +0 -0
- /package/dist/{checkbox → components/checkbox}/checkbox.css +0 -0
- /package/dist/{checkbox → components/checkbox}/checkbox.scss +0 -0
- /package/dist/{checkbox → components/checkbox}/constants.d.ts +0 -0
- /package/dist/{checkbox → components/checkbox}/mixin.scss +0 -0
- /package/dist/{checkbox → components/checkbox}/rtl.scss +0 -0
- /package/dist/{code-highlight → components/code-highlight}/code-highlight.css +0 -0
- /package/dist/{code-highlight → components/code-highlight}/code-highlight.scss +0 -0
- /package/dist/{code-highlight → components/code-highlight}/constants.d.ts +0 -0
- /package/dist/{code-highlight → components/code-highlight}/highlighter.d.ts +0 -0
- /package/dist/{code-highlight → components/code-highlight}/registry.d.ts +0 -0
- /package/dist/{code-highlight → components/code-highlight}/variables.scss +0 -0
- /package/dist/{collapse → components/collapse}/collapse.css +0 -0
- /package/dist/{collapse → components/collapse}/constants.d.ts +0 -0
- /package/dist/{collapse → components/collapse}/rtl.scss +0 -0
- /package/dist/{collapse → components/collapse}/variables.scss +0 -0
- /package/dist/{collapsible → components/collapsible}/animation.scss +0 -0
- /package/dist/{collapsible → components/collapsible}/collapsible.css +0 -0
- /package/dist/{collapsible → components/collapsible}/collapsible.scss +0 -0
- /package/dist/{collapsible → components/collapsible}/constants.d.ts +0 -0
- /package/dist/{collapsible → components/collapsible}/variables.scss +0 -0
- /package/dist/{color-picker → components/color-picker}/color-picker.css +0 -0
- /package/dist/{color-picker → components/color-picker}/constants.d.ts +0 -0
- /package/dist/{color-picker → components/color-picker}/interface.d.ts +0 -0
- /package/dist/{color-picker → components/color-picker}/interface.js +0 -0
- /package/dist/{color-picker → components/color-picker}/utils/round.d.ts +0 -0
- /package/dist/{color-picker → components/color-picker}/utils/split.d.ts +0 -0
- /package/dist/{color-picker → components/color-picker}/variables.scss +0 -0
- /package/dist/{config-provider → components/config-provider}/breakpoint-observer.d.ts +0 -0
- /package/dist/{config-provider → components/config-provider}/responsive-types.d.ts +0 -0
- /package/dist/{config-provider → components/config-provider}/responsive-types.js +0 -0
- /package/dist/{cropper → components/cropper}/constants.d.ts +0 -0
- /package/dist/{cropper → components/cropper}/cropper.css +0 -0
- /package/dist/{cropper → components/cropper}/utils.d.ts +0 -0
- /package/dist/{cropper → components/cropper}/variables.scss +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/formatter.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-day-of-week.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-default-format-token.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-default-picker-date.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-full-date-offset.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-inset-input-format-token.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-inset-input-value-from-inset-input-str.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-month-table.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-year-and-month.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-year-month-from-value.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-years.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-after.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-before.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-between.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-same-day.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-timestamp.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-valid-date.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/parser.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/picker-type.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/to-callback-args.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/to-date-arg.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/animation.scss +0 -0
- /package/dist/{date-picker → components/date-picker}/constants.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/date-picker.css +0 -0
- /package/dist/{date-picker → components/date-picker}/rtl.scss +0 -0
- /package/dist/{date-picker → components/date-picker}/variables.scss +0 -0
- /package/dist/{descriptions → components/descriptions}/constants.d.ts +0 -0
- /package/dist/{descriptions → components/descriptions}/descriptions.css +0 -0
- /package/dist/{descriptions → components/descriptions}/descriptions.scss +0 -0
- /package/dist/{descriptions → components/descriptions}/rtl.scss +0 -0
- /package/dist/{descriptions → components/descriptions}/variables.scss +0 -0
- /package/dist/{divider → components/divider}/constants.d.ts +0 -0
- /package/dist/{divider → components/divider}/divider.css +0 -0
- /package/dist/{divider → components/divider}/divider.scss +0 -0
- /package/dist/{divider → components/divider}/variables.scss +0 -0
- /package/dist/{dropdown → components/dropdown}/animation.scss +0 -0
- /package/dist/{dropdown → components/dropdown}/constants.d.ts +0 -0
- /package/dist/{dropdown → components/dropdown}/dropdown.css +0 -0
- /package/dist/{dropdown → components/dropdown}/dropdown.scss +0 -0
- /package/dist/{dropdown → components/dropdown}/rtl.scss +0 -0
- /package/dist/{dropdown → components/dropdown}/variables.scss +0 -0
- /package/dist/{empty → components/empty}/constants.d.ts +0 -0
- /package/dist/{empty → components/empty}/empty.css +0 -0
- /package/dist/{empty → components/empty}/empty.scss +0 -0
- /package/dist/{empty → components/empty}/rtl.scss +0 -0
- /package/dist/{empty → components/empty}/variables.scss +0 -0
- /package/dist/{feedback → components/feedback}/constants.d.ts +0 -0
- /package/dist/{feedback → components/feedback}/feedback.css +0 -0
- /package/dist/{feedback → components/feedback}/variables.scss +0 -0
- /package/dist/{float-button → components/float-button}/constants.d.ts +0 -0
- /package/dist/{float-button → components/float-button}/float-button.css +0 -0
- /package/dist/{float-button → components/float-button}/rtl.scss +0 -0
- /package/dist/{float-button → components/float-button}/variables.scss +0 -0
- /package/dist/{form → components/form}/field-store.d.ts +0 -0
- /package/dist/{form → components/form}/interface.js +0 -0
- /package/dist/{grid → components/grid}/constants.d.ts +0 -0
- /package/dist/{grid → components/grid}/grid.css +0 -0
- /package/dist/{grid → components/grid}/grid.scss +0 -0
- /package/dist/{grid → components/grid}/gutter.d.ts +0 -0
- /package/dist/{grid → components/grid}/mixin.scss +0 -0
- /package/dist/{grid → components/grid}/rtl.scss +0 -0
- /package/dist/{grid → components/grid}/utils.d.ts +0 -0
- /package/dist/{grid → components/grid}/variables.scss +0 -0
- /package/dist/{highlight → components/highlight}/constants.d.ts +0 -0
- /package/dist/{highlight → components/highlight}/foundation.d.ts +0 -0
- /package/dist/{highlight → components/highlight}/highlight.css +0 -0
- /package/dist/{highlight → components/highlight}/highlight.scss +0 -0
- /package/dist/{highlight → components/highlight}/variables.scss +0 -0
- /package/dist/{hot-keys → components/hot-keys}/constants.d.ts +0 -0
- /package/dist/{hot-keys → components/hot-keys}/hot-keys.css +0 -0
- /package/dist/{hot-keys → components/hot-keys}/hot-keys.scss +0 -0
- /package/dist/{hot-keys → components/hot-keys}/variables.scss +0 -0
- /package/dist/{image → components/image}/animation.scss +0 -0
- /package/dist/{image → components/image}/constants.d.ts +0 -0
- /package/dist/{image → components/image}/image.css +0 -0
- /package/dist/{image → components/image}/rtl.scss +0 -0
- /package/dist/{image → components/image}/utils.d.ts +0 -0
- /package/dist/{image → components/image}/variables.scss +0 -0
- /package/dist/{input → components/input}/animation.scss +0 -0
- /package/dist/{input → components/input}/rtl.scss +0 -0
- /package/dist/{input → components/input}/util/line-number.d.ts +0 -0
- /package/dist/{input → components/input}/util/truncate-value.d.ts +0 -0
- /package/dist/{input-number → components/input-number}/animation.scss +0 -0
- /package/dist/{input-number → components/input-number}/caret.d.ts +0 -0
- /package/dist/{input-number → components/input-number}/input-number.css +0 -0
- /package/dist/{input-number → components/input-number}/input-number.scss +0 -0
- /package/dist/{input-number → components/input-number}/rtl.scss +0 -0
- /package/dist/{input-number → components/input-number}/variables.scss +0 -0
- /package/dist/{json-viewer → components/json-viewer}/constants.d.ts +0 -0
- /package/dist/{json-viewer → components/json-viewer}/json-viewer.css +0 -0
- /package/dist/{json-viewer → components/json-viewer}/variables.scss +0 -0
- /package/dist/{layout → components/layout}/constants.d.ts +0 -0
- /package/dist/{layout → components/layout}/layout.css +0 -0
- /package/dist/{layout → components/layout}/layout.scss +0 -0
- /package/dist/{layout → components/layout}/rtl.scss +0 -0
- /package/dist/{list → components/list}/constants.d.ts +0 -0
- /package/dist/{list → components/list}/list.css +0 -0
- /package/dist/{list → components/list}/rtl.scss +0 -0
- /package/dist/{list → components/list}/variables.scss +0 -0
- /package/dist/{lottie → components/lottie}/constants.d.ts +0 -0
- /package/dist/{markdown-render → components/markdown-render}/constants.d.ts +0 -0
- /package/dist/{markdown-render → components/markdown-render}/markdown-render.css +0 -0
- /package/dist/{markdown-render → components/markdown-render}/markdown-render.scss +0 -0
- /package/dist/{markdown-render → components/markdown-render}/variables.scss +0 -0
- /package/dist/{modal → components/modal}/animation.scss +0 -0
- /package/dist/{modal → components/modal}/confirm.d.ts +0 -0
- /package/dist/{modal → components/modal}/constants.d.ts +0 -0
- /package/dist/{modal → components/modal}/modal.css +0 -0
- /package/dist/{modal → components/modal}/modal.scss +0 -0
- /package/dist/{modal → components/modal}/rtl.scss +0 -0
- /package/dist/{modal → components/modal}/variables.scss +0 -0
- /package/dist/{navigation → components/navigation}/animation.scss +0 -0
- /package/dist/{navigation → components/navigation}/constants.d.ts +0 -0
- /package/dist/{navigation → components/navigation}/mixin.scss +0 -0
- /package/dist/{navigation → components/navigation}/navigation.css +0 -0
- /package/dist/{navigation → components/navigation}/rtl.scss +0 -0
- /package/dist/{notification → components/notification}/animation.scss +0 -0
- /package/dist/{notification → components/notification}/constants.d.ts +0 -0
- /package/dist/{notification → components/notification}/notification.css +0 -0
- /package/dist/{notification → components/notification}/notification.scss +0 -0
- /package/dist/{notification → components/notification}/rtl.scss +0 -0
- /package/dist/{notification → components/notification}/variables.scss +0 -0
- /package/dist/{overflow-list → components/overflow-list}/overflow-list.css +0 -0
- /package/dist/{overflow-list → components/overflow-list}/overflow-list.scss +0 -0
- /package/dist/{overflow-list → components/overflow-list}/rtl.scss +0 -0
- /package/dist/{pagination → components/pagination}/animation.scss +0 -0
- /package/dist/{pagination → components/pagination}/constants.d.ts +0 -0
- /package/dist/{pagination → components/pagination}/pagination.css +0 -0
- /package/dist/{pagination → components/pagination}/rtl.scss +0 -0
- /package/dist/{pagination → components/pagination}/variables.scss +0 -0
- /package/dist/{pincode → components/pincode}/constants.d.ts +0 -0
- /package/dist/{pincode → components/pincode}/pincode.css +0 -0
- /package/dist/{pincode → components/pincode}/pincode.scss +0 -0
- /package/dist/{pincode → components/pincode}/variables.scss +0 -0
- /package/dist/{popconfirm → components/popconfirm}/popconfirm.css +0 -0
- /package/dist/{popconfirm → components/popconfirm}/popconfirm.scss +0 -0
- /package/dist/{popconfirm → components/popconfirm}/rtl.scss +0 -0
- /package/dist/{popconfirm → components/popconfirm}/variables.scss +0 -0
- /package/dist/{popover → components/popover}/animation.scss +0 -0
- /package/dist/{popover → components/popover}/constants.d.ts +0 -0
- /package/dist/{popover → components/popover}/popover.css +0 -0
- /package/dist/{popover → components/popover}/popover.scss +0 -0
- /package/dist/{popover → components/popover}/rtl.scss +0 -0
- /package/dist/{popover → components/popover}/variables.scss +0 -0
- /package/dist/{_portal → components/portal}/portal.css +0 -0
- /package/dist/{_portal → components/portal}/portal.scss +0 -0
- /package/dist/{progress → components/progress}/constants.d.ts +0 -0
- /package/dist/{progress → components/progress}/generates.d.ts +0 -0
- /package/dist/{progress → components/progress}/progress.css +0 -0
- /package/dist/{progress → components/progress}/progress.scss +0 -0
- /package/dist/{progress → components/progress}/rtl.scss +0 -0
- /package/dist/{progress → components/progress}/utils.d.ts +0 -0
- /package/dist/{progress → components/progress}/variables.scss +0 -0
- /package/dist/{radio → components/radio}/animation.scss +0 -0
- /package/dist/{radio → components/radio}/constants.d.ts +0 -0
- /package/dist/{radio → components/radio}/mixin.scss +0 -0
- /package/dist/{radio → components/radio}/radio.css +0 -0
- /package/dist/{radio → components/radio}/radio.scss +0 -0
- /package/dist/{radio → components/radio}/rtl.scss +0 -0
- /package/dist/{rating → components/rating}/animation.scss +0 -0
- /package/dist/{rating → components/rating}/constants.d.ts +0 -0
- /package/dist/{rating → components/rating}/rating.css +0 -0
- /package/dist/{rating → components/rating}/rating.scss +0 -0
- /package/dist/{rating → components/rating}/rtl.scss +0 -0
- /package/dist/{resizable → components/resizable}/constants.d.ts +0 -0
- /package/dist/{resizable → components/resizable}/foundation.js +0 -0
- /package/dist/{resizable → components/resizable}/resizable.css +0 -0
- /package/dist/{resizable → components/resizable}/types.d.ts +0 -0
- /package/dist/{resizable → components/resizable}/utils.d.ts +0 -0
- /package/dist/{resizable → components/resizable}/variables.scss +0 -0
- /package/dist/{scroll-list → components/scroll-list}/animation.scss +0 -0
- /package/dist/{scroll-list → components/scroll-list}/constants.d.ts +0 -0
- /package/dist/{scroll-list → components/scroll-list}/rtl.scss +0 -0
- /package/dist/{scroll-list → components/scroll-list}/scroll-list.css +0 -0
- /package/dist/{scroll-list → components/scroll-list}/scroll-to.d.ts +0 -0
- /package/dist/{scroll-list → components/scroll-list}/variables.scss +0 -0
- /package/dist/{select → components/select}/animation.scss +0 -0
- /package/dist/{select → components/select}/combobox-name.d.ts +0 -0
- /package/dist/{select → components/select}/constants.d.ts +0 -0
- /package/dist/{select → components/select}/mixin.scss +0 -0
- /package/dist/{select → components/select}/option-foundation.d.ts +0 -0
- /package/dist/{select → components/select}/option.scss +0 -0
- /package/dist/{select → components/select}/rtl.scss +0 -0
- /package/dist/{select → components/select}/select.css +0 -0
- /package/dist/{select → components/select}/variables.scss +0 -0
- /package/dist/{side-sheet → components/side-sheet}/animation.scss +0 -0
- /package/dist/{side-sheet → components/side-sheet}/constants.d.ts +0 -0
- /package/dist/{side-sheet → components/side-sheet}/rtl.scss +0 -0
- /package/dist/{side-sheet → components/side-sheet}/side-sheet.css +0 -0
- /package/dist/{side-sheet → components/side-sheet}/side-sheet.scss +0 -0
- /package/dist/{side-sheet → components/side-sheet}/variables.scss +0 -0
- /package/dist/{skeleton → components/skeleton}/animation.scss +0 -0
- /package/dist/{skeleton → components/skeleton}/constants.d.ts +0 -0
- /package/dist/{skeleton → components/skeleton}/rtl.scss +0 -0
- /package/dist/{skeleton → components/skeleton}/skeleton.css +0 -0
- /package/dist/{skeleton → components/skeleton}/skeleton.scss +0 -0
- /package/dist/{skeleton → components/skeleton}/variables.scss +0 -0
- /package/dist/{slider → components/slider}/animation.scss +0 -0
- /package/dist/{slider → components/slider}/constants.d.ts +0 -0
- /package/dist/{slider → components/slider}/rtl.scss +0 -0
- /package/dist/{slider → components/slider}/slider.css +0 -0
- /package/dist/{slider → components/slider}/slider.scss +0 -0
- /package/dist/{space → components/space}/constants.d.ts +0 -0
- /package/dist/{space → components/space}/rtl.scss +0 -0
- /package/dist/{space → components/space}/space.css +0 -0
- /package/dist/{space → components/space}/space.scss +0 -0
- /package/dist/{space → components/space}/variables.scss +0 -0
- /package/dist/{spin → components/spin}/animation.scss +0 -0
- /package/dist/{spin → components/spin}/constants.d.ts +0 -0
- /package/dist/{spin → components/spin}/mixin.scss +0 -0
- /package/dist/{spin → components/spin}/rtl.scss +0 -0
- /package/dist/{spin → components/spin}/spin.css +0 -0
- /package/dist/{spin → components/spin}/variables.scss +0 -0
- /package/dist/{steps → components/steps}/animation.scss +0 -0
- /package/dist/{steps → components/steps}/bacis-steps.scss +0 -0
- /package/dist/{steps → components/steps}/constants.d.ts +0 -0
- /package/dist/{steps → components/steps}/fill-steps.scss +0 -0
- /package/dist/{steps → components/steps}/mixin.scss +0 -0
- /package/dist/{steps → components/steps}/nav-steps.scss +0 -0
- /package/dist/{steps → components/steps}/rtl.scss +0 -0
- /package/dist/{steps → components/steps}/steps.css +0 -0
- /package/dist/{steps → components/steps}/utils.d.ts +0 -0
- /package/dist/{steps → components/steps}/variables.scss +0 -0
- /package/dist/{switch → components/switch}/animation.scss +0 -0
- /package/dist/{switch → components/switch}/constants.d.ts +0 -0
- /package/dist/{switch → components/switch}/rtl.scss +0 -0
- /package/dist/{switch → components/switch}/switch.css +0 -0
- /package/dist/{switch → components/switch}/switch.scss +0 -0
- /package/dist/{table → components/table}/animation.scss +0 -0
- /package/dist/{table → components/table}/mixin.scss +0 -0
- /package/dist/{table → components/table}/operation-panel.scss +0 -0
- /package/dist/{table → components/table}/rtl.scss +0 -0
- /package/dist/{tabs → components/tabs}/animation.scss +0 -0
- /package/dist/{tabs → components/tabs}/rtl.scss +0 -0
- /package/dist/{tabs → components/tabs}/tabs.css +0 -0
- /package/dist/{tag → components/tag}/constants.d.ts +0 -0
- /package/dist/{tag → components/tag}/focus.d.ts +0 -0
- /package/dist/{tag → components/tag}/rtl.scss +0 -0
- /package/dist/{tag → components/tag}/tag-key.d.ts +0 -0
- /package/dist/{tag → components/tag}/tag.scss +0 -0
- /package/dist/{tag-input → components/tag-input}/animation.scss +0 -0
- /package/dist/{tag-input → components/tag-input}/constants.d.ts +0 -0
- /package/dist/{tag-input → components/tag-input}/rtl.scss +0 -0
- /package/dist/{tag-input → components/tag-input}/tag-input.css +0 -0
- /package/dist/{tag-input → components/tag-input}/utils/get-splited-array.d.ts +0 -0
- /package/dist/{tag-input → components/tag-input}/utils/tag-focus.d.ts +0 -0
- /package/dist/{tag-input → components/tag-input}/variables.scss +0 -0
- /package/dist/{time-picker → components/time-picker}/constants.d.ts +0 -0
- /package/dist/{time-picker → components/time-picker}/rtl.scss +0 -0
- /package/dist/{time-picker → components/time-picker}/time-picker.css +0 -0
- /package/dist/{time-picker → components/time-picker}/time-picker.scss +0 -0
- /package/dist/{time-picker → components/time-picker}/utils/index.d.ts +0 -0
- /package/dist/{time-picker → components/time-picker}/variables.scss +0 -0
- /package/dist/{timeline → components/timeline}/constants.d.ts +0 -0
- /package/dist/{timeline → components/timeline}/rtl.scss +0 -0
- /package/dist/{timeline → components/timeline}/timeline.css +0 -0
- /package/dist/{timeline → components/timeline}/utils.d.ts +0 -0
- /package/dist/{timeline → components/timeline}/variables.scss +0 -0
- /package/dist/{toast → components/toast}/animation.scss +0 -0
- /package/dist/{toast → components/toast}/constants.d.ts +0 -0
- /package/dist/{toast → components/toast}/rtl.scss +0 -0
- /package/dist/{toast → components/toast}/toast.css +0 -0
- /package/dist/{toast → components/toast}/toast.scss +0 -0
- /package/dist/{toast → components/toast}/variables.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/adjust-position.d.ts +0 -0
- /package/dist/{tooltip → components/tooltip}/animation.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/arrow.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/position.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/rtl.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/tooltip.css +0 -0
- /package/dist/{tooltip → components/tooltip}/variables.scss +0 -0
- /package/dist/{transfer → components/transfer}/animation.scss +0 -0
- /package/dist/{transfer → components/transfer}/constants.d.ts +0 -0
- /package/dist/{transfer → components/transfer}/rtl.scss +0 -0
- /package/dist/{transfer → components/transfer}/transfer-utils.d.ts +0 -0
- /package/dist/{transfer → components/transfer}/transfer.css +0 -0
- /package/dist/{transfer → components/transfer}/variables.scss +0 -0
- /package/dist/{tree → components/tree}/animation.scss +0 -0
- /package/dist/{tree → components/tree}/constants.d.ts +0 -0
- /package/dist/{tree → components/tree}/rtl.scss +0 -0
- /package/dist/{tree → components/tree}/tree.css +0 -0
- /package/dist/{tree → components/tree}/variables.scss +0 -0
- /package/dist/{tree-select → components/tree-select}/constants.d.ts +0 -0
- /package/dist/{tree-select → components/tree-select}/rtl.scss +0 -0
- /package/dist/{tree-select → components/tree-select}/tree-select.css +0 -0
- /package/dist/{tree-select → components/tree-select}/variables.scss +0 -0
- /package/dist/{typography → components/typography}/constants.d.ts +0 -0
- /package/dist/{typography → components/typography}/ellipsis.d.ts +0 -0
- /package/dist/{typography → components/typography}/format-numeral.d.ts +0 -0
- /package/dist/{typography → components/typography}/rtl.scss +0 -0
- /package/dist/{typography → components/typography}/typography.css +0 -0
- /package/dist/{typography → components/typography}/variables.scss +0 -0
- /package/dist/{upload → components/upload}/rtl.scss +0 -0
- /package/dist/{upload → components/upload}/upload.css +0 -0
- /package/dist/{upload → components/upload}/variables.scss +0 -0
- /package/dist/{user-guide → components/user-guide}/animation.scss +0 -0
- /package/dist/{user-guide → components/user-guide}/constants.d.ts +0 -0
- /package/dist/{user-guide → components/user-guide}/user-guide.css +0 -0
- /package/dist/{user-guide → components/user-guide}/user-guide.scss +0 -0
- /package/dist/{user-guide → components/user-guide}/variables.scss +0 -0
- /package/dist/{video-player → components/video-player}/animation.scss +0 -0
- /package/dist/{video-player → components/video-player}/constants.d.ts +0 -0
- /package/dist/{video-player → components/video-player}/utils.d.ts +0 -0
- /package/dist/{video-player → components/video-player}/variables.scss +0 -0
- /package/dist/{video-player → components/video-player}/video-player.css +0 -0
|
@@ -0,0 +1,1100 @@
|
|
|
1
|
+
import BaseFoundation from "../../base/foundation.js";
|
|
2
|
+
import warning from "../../utils/warning.js";
|
|
3
|
+
import isPromise from "../../utils/is-promise.js";
|
|
4
|
+
import { get as get$1, has as has$1, isEmpty, remove, set as set$1 } from "../../utils/object.js";
|
|
5
|
+
import { cssClasses } from "./constants.js";
|
|
6
|
+
import { hasErrors, isErrorLeaf, normalizeFieldError, normalizeFormErrors } from "./errors.js";
|
|
7
|
+
import { validateRules } from "./rules.js";
|
|
8
|
+
import { isValid, nextUpdateKey, pickFormProps, schemaIssuePath, validationSchema } from "./utils.js";
|
|
9
|
+
import { getFormApiProxyInternals } from "./form-api-proxy.js";
|
|
10
|
+
import { isEqual, isPlainObject } from "es-toolkit";
|
|
11
|
+
import { toPath } from "es-toolkit/compat";
|
|
12
|
+
import scrollIntoView from "scroll-into-view-if-needed";
|
|
13
|
+
// src/components/form/foundation.ts
|
|
14
|
+
const SILENT = {
|
|
15
|
+
skipNotify: true,
|
|
16
|
+
skipRender: true
|
|
17
|
+
};
|
|
18
|
+
const prefix = cssClasses.PREFIX;
|
|
19
|
+
const ERROR_SELECTOR = `.${prefix}-field-error-message`;
|
|
20
|
+
const errorField = (errorDOM) => errorDOM.closest(`.${prefix}-field, .${prefix}-field-group`);
|
|
21
|
+
const scrollIntoView$1 = scrollIntoView;
|
|
22
|
+
function isFormValidatorPassed(result) {
|
|
23
|
+
if (!result) return true;
|
|
24
|
+
return isPlainObject(result) && !hasErrors(normalizeFormErrors(result));
|
|
25
|
+
}
|
|
26
|
+
function isStandardSchema(value) {
|
|
27
|
+
return value !== null && (typeof value === "object" || typeof value === "function") && "~standard" in value;
|
|
28
|
+
}
|
|
29
|
+
function issueMessages(issues, first) {
|
|
30
|
+
const messages = issues.map((issue) => issue.message);
|
|
31
|
+
return first ? messages.slice(0, 1) : messages;
|
|
32
|
+
}
|
|
33
|
+
function moveItem(items, from, to) {
|
|
34
|
+
const moved = items.slice();
|
|
35
|
+
moved.length = Math.max(moved.length, from + 1, to + 1);
|
|
36
|
+
const [item] = moved.splice(from, 1);
|
|
37
|
+
moved.splice(to, 0, item);
|
|
38
|
+
return moved;
|
|
39
|
+
}
|
|
40
|
+
/** Whether `path` is `ancestor` or a path under it, compared by segment: `a[1]` is under `a`, `ab` is not */
|
|
41
|
+
function isPathWithin(path, ancestor) {
|
|
42
|
+
const segments = toPath(path);
|
|
43
|
+
return toPath(ancestor).every((segment, i) => segment === segments[i]);
|
|
44
|
+
}
|
|
45
|
+
var FormFoundation = class extends BaseFoundation {
|
|
46
|
+
#data;
|
|
47
|
+
#batchDepth = 0;
|
|
48
|
+
#pendingFields = /* @__PURE__ */ new Set();
|
|
49
|
+
#fields;
|
|
50
|
+
#registered;
|
|
51
|
+
#registeredArrayField;
|
|
52
|
+
#validations = /* @__PURE__ */ new Map();
|
|
53
|
+
#debounceTimer;
|
|
54
|
+
#debouncedFields = /* @__PURE__ */ new Set();
|
|
55
|
+
#destroyed = false;
|
|
56
|
+
#epoch = 0;
|
|
57
|
+
#formValidation = 0;
|
|
58
|
+
#settleScheduled = false;
|
|
59
|
+
#unregistered = [];
|
|
60
|
+
#mountedArrayFields = [];
|
|
61
|
+
#pendingSchemaRun;
|
|
62
|
+
#latestSchemaRun;
|
|
63
|
+
#detachedErrorPaths = [];
|
|
64
|
+
constructor(adapter) {
|
|
65
|
+
super(adapter);
|
|
66
|
+
let { initValues } = this.adapter.getProps();
|
|
67
|
+
initValues = this.adapter.cloneDeep(initValues);
|
|
68
|
+
this.#data = {
|
|
69
|
+
values: initValues ?? {},
|
|
70
|
+
errors: {},
|
|
71
|
+
touched: {}
|
|
72
|
+
};
|
|
73
|
+
this.#fields = /* @__PURE__ */ new Map();
|
|
74
|
+
this.#registered = {};
|
|
75
|
+
this.#registeredArrayField = /* @__PURE__ */ new Map();
|
|
76
|
+
}
|
|
77
|
+
#forceUpdate(callback) {
|
|
78
|
+
const formState = this.getFormState();
|
|
79
|
+
this.setState({ formState }, callback);
|
|
80
|
+
getFormApiProxyInternals(this.getProp("form"))?.updateState(formState);
|
|
81
|
+
}
|
|
82
|
+
#scheduleSettle() {
|
|
83
|
+
if (!this.#settleScheduled) {
|
|
84
|
+
this.#settleScheduled = true;
|
|
85
|
+
this.setState({}, this.#settle);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
#settle = () => {
|
|
89
|
+
this.#settleScheduled = false;
|
|
90
|
+
if (this.#destroyed) return;
|
|
91
|
+
this.#mountedArrayFields = [];
|
|
92
|
+
const unregistered = this.#unregistered.splice(0);
|
|
93
|
+
if (!unregistered.length) return;
|
|
94
|
+
unregistered.forEach(({ field, keepState }) => {
|
|
95
|
+
if (!keepState && !this.#fields.has(field)) this.#data = {
|
|
96
|
+
values: remove(this.#data.values, field),
|
|
97
|
+
errors: remove(this.#data.errors, field),
|
|
98
|
+
touched: remove(this.#data.touched, field)
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
this.adapter.notifyChange(this.#data);
|
|
102
|
+
this.#forceUpdate();
|
|
103
|
+
};
|
|
104
|
+
#updateField(store, snapshot) {
|
|
105
|
+
if (!store.update(snapshot)) return;
|
|
106
|
+
if (this.#batchDepth) this.#pendingFields.add(store);
|
|
107
|
+
else store.notify();
|
|
108
|
+
}
|
|
109
|
+
#batch(run) {
|
|
110
|
+
this.#batchDepth += 1;
|
|
111
|
+
try {
|
|
112
|
+
run();
|
|
113
|
+
} finally {
|
|
114
|
+
this.#batchDepth -= 1;
|
|
115
|
+
if (!this.#batchDepth) {
|
|
116
|
+
const pending = [...this.#pendingFields];
|
|
117
|
+
this.#pendingFields.clear();
|
|
118
|
+
pending.forEach((store) => store.notify());
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
#clearFormErrors() {
|
|
123
|
+
const prevErrors = this.#data.errors;
|
|
124
|
+
this.#data = {
|
|
125
|
+
...this.#data,
|
|
126
|
+
errors: {}
|
|
127
|
+
};
|
|
128
|
+
this.#injectErrorToField({});
|
|
129
|
+
this.adapter.notifyChange(this.#data);
|
|
130
|
+
this.#notifyErrorChange(prevErrors, this.#fields.keys());
|
|
131
|
+
this.#forceUpdate();
|
|
132
|
+
}
|
|
133
|
+
#setFormErrors(formErrors) {
|
|
134
|
+
const prevErrors = this.#data.errors;
|
|
135
|
+
this.#data = {
|
|
136
|
+
...this.#data,
|
|
137
|
+
errors: formErrors
|
|
138
|
+
};
|
|
139
|
+
this.#injectErrorToField(formErrors);
|
|
140
|
+
this.adapter.notifyChange(this.#data);
|
|
141
|
+
this.#notifyErrorChange(prevErrors, this.#fields.keys());
|
|
142
|
+
this.#forceUpdate(() => this.#autoScroll());
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Reports the errors a batch operation changed in one onErrorChange: the operation writes each field's error with
|
|
146
|
+
* skipNotify, then compares those fields' errors with the ones before it
|
|
147
|
+
*/
|
|
148
|
+
#notifyErrorChange(prevErrors, fieldPaths) {
|
|
149
|
+
const changedError = {};
|
|
150
|
+
for (const path of fieldPaths) {
|
|
151
|
+
const error = get$1(this.#data.errors, path);
|
|
152
|
+
if (!isEqual(error, get$1(prevErrors, path))) changedError[path] = error;
|
|
153
|
+
}
|
|
154
|
+
if (Object.keys(changedError).length) this.adapter.notifyErrorChange(this.#data.errors, changedError);
|
|
155
|
+
}
|
|
156
|
+
#isCancelled(epoch) {
|
|
157
|
+
return this.#destroyed || epoch !== this.#epoch;
|
|
158
|
+
}
|
|
159
|
+
#cancelError() {
|
|
160
|
+
return /* @__PURE__ */ new Error(this.#destroyed ? "[Semi Form] the Form unmounted before the validation settled" : "[Semi Form] the Form was reset before the validation settled");
|
|
161
|
+
}
|
|
162
|
+
#formValidate(silent = false) {
|
|
163
|
+
const { validator } = this.getProps();
|
|
164
|
+
const epoch = this.#epoch;
|
|
165
|
+
const validation = silent ? void 0 : ++this.#formValidation;
|
|
166
|
+
const writes = () => validation === this.#formValidation;
|
|
167
|
+
return new Promise((resolve, reject) => {
|
|
168
|
+
const pass = () => {
|
|
169
|
+
resolve(this.adapter.cloneDeep(this.#data.values));
|
|
170
|
+
if (writes()) this.#clearFormErrors();
|
|
171
|
+
};
|
|
172
|
+
const fail = (errors) => {
|
|
173
|
+
const formErrors = isPlainObject(errors) ? normalizeFormErrors(errors) : void 0;
|
|
174
|
+
if (writes()) this.#setFormErrors(formErrors ?? {});
|
|
175
|
+
reject(formErrors ?? errors);
|
|
176
|
+
};
|
|
177
|
+
let maybePromisedErrors;
|
|
178
|
+
try {
|
|
179
|
+
maybePromisedErrors = validator(this.#data.values);
|
|
180
|
+
} catch (errors) {
|
|
181
|
+
maybePromisedErrors = errors;
|
|
182
|
+
}
|
|
183
|
+
if (isFormValidatorPassed(maybePromisedErrors)) pass();
|
|
184
|
+
else if (isPromise(maybePromisedErrors)) maybePromisedErrors.then((result) => {
|
|
185
|
+
if (this.#isCancelled(epoch)) reject(this.#cancelError());
|
|
186
|
+
else if (isFormValidatorPassed(result)) pass();
|
|
187
|
+
else fail(result);
|
|
188
|
+
}, (errors) => {
|
|
189
|
+
if (this.#isCancelled(epoch)) {
|
|
190
|
+
reject(this.#cancelError());
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (writes()) this.#autoScroll();
|
|
194
|
+
reject(errors);
|
|
195
|
+
});
|
|
196
|
+
else fail(maybePromisedErrors);
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/** A schema hides field-level validation */
|
|
200
|
+
#getSchema() {
|
|
201
|
+
return validationSchema(this.getProps());
|
|
202
|
+
}
|
|
203
|
+
#mapSchemaIssues(issues) {
|
|
204
|
+
const pathKey = (segments) => segments.join("\0");
|
|
205
|
+
const fields = new Map([...this.#fields.values()].map((registration) => [pathKey(toPath(registration.field)), registration]));
|
|
206
|
+
const targets = /* @__PURE__ */ new Map();
|
|
207
|
+
issues.map((issue) => {
|
|
208
|
+
const path = schemaIssuePath(issue);
|
|
209
|
+
return {
|
|
210
|
+
message: issue.message,
|
|
211
|
+
path,
|
|
212
|
+
segments: toPath(path)
|
|
213
|
+
};
|
|
214
|
+
}).toSorted((a, b) => a.segments.length - b.segments.length).forEach(({ message, path, segments }) => {
|
|
215
|
+
let registration;
|
|
216
|
+
for (let i = segments.length; i > 0 && !registration; i--) registration = fields.get(pathKey(segments.slice(0, i)));
|
|
217
|
+
const target = registration?.field ?? path;
|
|
218
|
+
const entry = targets.get(target) ?? {
|
|
219
|
+
registration,
|
|
220
|
+
messages: []
|
|
221
|
+
};
|
|
222
|
+
entry.messages.push(message);
|
|
223
|
+
targets.set(target, entry);
|
|
224
|
+
});
|
|
225
|
+
const fieldErrors = /* @__PURE__ */ new Map();
|
|
226
|
+
const detachedErrors = /* @__PURE__ */ new Map();
|
|
227
|
+
targets.forEach(({ registration, messages }, target) => {
|
|
228
|
+
const { stopValidateWithError } = registration ? registration.getValidateOptions() : this.getProps();
|
|
229
|
+
(registration ? fieldErrors : detachedErrors).set(target, stopValidateWithError ? messages.slice(0, 1) : messages);
|
|
230
|
+
});
|
|
231
|
+
return {
|
|
232
|
+
fieldErrors,
|
|
233
|
+
detachedErrors
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Validations requested in one tick share a run: the fields of a batch validation, or those mounting together with
|
|
238
|
+
* trigger="mount", must not call an async schema once each. It reads the values when it starts.
|
|
239
|
+
*/
|
|
240
|
+
#requestSchemaRun(schema, silent) {
|
|
241
|
+
this.#pendingSchemaRun ??= Promise.resolve().then(async () => {
|
|
242
|
+
this.#pendingSchemaRun = void 0;
|
|
243
|
+
const result = await schema["~standard"].validate(this.#data.values);
|
|
244
|
+
return {
|
|
245
|
+
result,
|
|
246
|
+
...this.#mapSchemaIssues(result.issues ?? [])
|
|
247
|
+
};
|
|
248
|
+
});
|
|
249
|
+
if (!silent) this.#latestSchemaRun = this.#pendingSchemaRun;
|
|
250
|
+
return this.#pendingSchemaRun;
|
|
251
|
+
}
|
|
252
|
+
#validateSchema(registration, schema, opts) {
|
|
253
|
+
const epoch = this.#epoch;
|
|
254
|
+
const silent = Boolean(opts.silent);
|
|
255
|
+
const run = this.#requestSchemaRun(schema, silent);
|
|
256
|
+
const validation = new Promise((resolve, reject) => {
|
|
257
|
+
run.then((schemaRun) => {
|
|
258
|
+
if (this.#isSuperseded(registration, validation, epoch, silent, resolve)) return;
|
|
259
|
+
if (!silent && run !== this.#latestSchemaRun) {
|
|
260
|
+
resolve(this.#latestSchemaRun.then(({ fieldErrors }) => fieldErrors.get(registration.field)));
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const error = schemaRun.fieldErrors.get(registration.field);
|
|
264
|
+
this.#setFieldError(registration, error, {
|
|
265
|
+
...opts,
|
|
266
|
+
status: error === void 0 ? "success" : "error"
|
|
267
|
+
});
|
|
268
|
+
if (!opts.skipNotify) this.#refreshTouchedFields(schemaRun, registration);
|
|
269
|
+
resolve(error);
|
|
270
|
+
}, reject);
|
|
271
|
+
});
|
|
272
|
+
if (!silent) this.#validations.set(registration.field, validation);
|
|
273
|
+
return validation;
|
|
274
|
+
}
|
|
275
|
+
/** One field's value can fail another (a refine on two fields), so the fields the user already left follow the run */
|
|
276
|
+
#refreshTouchedFields({ fieldErrors }, changed) {
|
|
277
|
+
const prevErrors = this.#data.errors;
|
|
278
|
+
const refreshed = [];
|
|
279
|
+
this.#batch(() => {
|
|
280
|
+
this.#fields.forEach((registration) => {
|
|
281
|
+
const { touched, error: prevError } = registration.store.getSnapshot();
|
|
282
|
+
const error = fieldErrors.get(registration.field);
|
|
283
|
+
if (registration !== changed && touched && !isEqual(error, prevError)) {
|
|
284
|
+
this.#setFieldError(registration, error, {
|
|
285
|
+
...SILENT,
|
|
286
|
+
status: error === void 0 ? "success" : "error"
|
|
287
|
+
});
|
|
288
|
+
refreshed.push(registration.field);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
if (refreshed.length) {
|
|
293
|
+
this.adapter.notifyChange(this.#data);
|
|
294
|
+
this.#notifyErrorChange(prevErrors, refreshed);
|
|
295
|
+
this.#forceUpdate();
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Writes the issues no field holds. Validating everything replaces the errors as a whole, so an error kept for an
|
|
300
|
+
* unmounted field cannot outlive the run; validating some paths only touches those without a field under them.
|
|
301
|
+
*/
|
|
302
|
+
#writeDetachedErrors(detached, fieldPaths, validatedPaths) {
|
|
303
|
+
const current = this.#data.errors;
|
|
304
|
+
let errors = fieldPaths ? current : {};
|
|
305
|
+
fieldPaths?.forEach((path) => {
|
|
306
|
+
if (!this.#getNestedField(path).size) errors = remove(errors, path);
|
|
307
|
+
});
|
|
308
|
+
detached.forEach(([path, error]) => {
|
|
309
|
+
errors = set$1(errors, path, error);
|
|
310
|
+
});
|
|
311
|
+
if (!fieldPaths) validatedPaths.forEach((path) => {
|
|
312
|
+
const error = get$1(current, path);
|
|
313
|
+
if (error !== void 0) errors = set$1(errors, path, error);
|
|
314
|
+
});
|
|
315
|
+
this.#data = {
|
|
316
|
+
...this.#data,
|
|
317
|
+
errors
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
#fieldsValidate(fieldPaths, silent = false) {
|
|
321
|
+
return new Promise((resolve, reject) => {
|
|
322
|
+
let promiseSet = [];
|
|
323
|
+
const targetFields = this.#getOperateFieldMap(fieldPaths);
|
|
324
|
+
const paths = [...targetFields.keys()];
|
|
325
|
+
const epoch = this.#epoch;
|
|
326
|
+
const prevErrors = this.#data.errors;
|
|
327
|
+
const schema = this.#getSchema();
|
|
328
|
+
const schemaRun = schema && this.#requestSchemaRun(schema, silent);
|
|
329
|
+
targetFields.forEach((field, fieldPath) => {
|
|
330
|
+
const fieldValue = this.#getValue(fieldPath);
|
|
331
|
+
const opts = {
|
|
332
|
+
skipNotify: true,
|
|
333
|
+
skipRender: true,
|
|
334
|
+
silent
|
|
335
|
+
};
|
|
336
|
+
const validateResult = this.#validateField(field, fieldValue, opts);
|
|
337
|
+
promiseSet.push(validateResult);
|
|
338
|
+
if (!silent) this.#setFieldTouched(field, true, {
|
|
339
|
+
skipNotify: true,
|
|
340
|
+
skipRender: true
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
Promise.all([schemaRun, Promise.all(promiseSet)]).then(([settledRun, results]) => {
|
|
344
|
+
if (this.#isCancelled(epoch)) {
|
|
345
|
+
reject(this.#cancelError());
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
const detached = [...settledRun?.detachedErrors ?? []].filter(([path]) => !fieldPaths || fieldPaths.some((target) => isPathWithin(path, target)));
|
|
349
|
+
if (settledRun && !silent) this.#writeDetachedErrors(detached, fieldPaths, paths);
|
|
350
|
+
let errors = this.#getError();
|
|
351
|
+
let valid = !detached.length && paths.every((path, i) => results[i] === null ? isValid(get$1(errors, path)) : results[i] === void 0);
|
|
352
|
+
if (silent) {
|
|
353
|
+
errors = {};
|
|
354
|
+
detached.forEach(([path, error]) => {
|
|
355
|
+
errors = set$1(errors, path, error);
|
|
356
|
+
});
|
|
357
|
+
paths.forEach((fieldPath, i) => {
|
|
358
|
+
if (results[i] != null) errors = set$1(errors, fieldPath, results[i]);
|
|
359
|
+
});
|
|
360
|
+
valid = isEmpty(errors);
|
|
361
|
+
}
|
|
362
|
+
if (!silent) {
|
|
363
|
+
const detachedPaths = detached.map(([path]) => path);
|
|
364
|
+
this.adapter.notifyChange(this.#data);
|
|
365
|
+
this.#notifyErrorChange(prevErrors, [
|
|
366
|
+
...paths,
|
|
367
|
+
...detachedPaths,
|
|
368
|
+
...this.#detachedErrorPaths
|
|
369
|
+
]);
|
|
370
|
+
this.#detachedErrorPaths = detachedPaths;
|
|
371
|
+
this.#forceUpdate(valid ? void 0 : () => this.#autoScroll());
|
|
372
|
+
}
|
|
373
|
+
if (valid) {
|
|
374
|
+
const output = !fieldPaths && settledRun && !settledRun.result.issues ? settledRun.result.value : this.#data.values;
|
|
375
|
+
resolve(this.adapter.cloneDeep(output));
|
|
376
|
+
} else reject(errors);
|
|
377
|
+
}, reject);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
#getNestedField(path) {
|
|
381
|
+
const allRegisterField = this.#fields;
|
|
382
|
+
const allFieldPath = [...allRegisterField].map((item) => item[0]);
|
|
383
|
+
let nestedFieldPath = /* @__PURE__ */ new Map();
|
|
384
|
+
allFieldPath.forEach((item) => {
|
|
385
|
+
let itemPath = toPath(item);
|
|
386
|
+
let targetPath = toPath(path);
|
|
387
|
+
if (targetPath.every((_path, i) => targetPath[i] === itemPath[i])) {
|
|
388
|
+
const realField = allRegisterField.get(item);
|
|
389
|
+
nestedFieldPath.set(item, realField);
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
return nestedFieldPath;
|
|
393
|
+
}
|
|
394
|
+
#getOperateFieldMap(fieldPaths) {
|
|
395
|
+
let targetFields = /* @__PURE__ */ new Map();
|
|
396
|
+
if (fieldPaths !== void 0) fieldPaths.forEach((path) => {
|
|
397
|
+
const field = this.#fields.get(path);
|
|
398
|
+
if (field === void 0) {
|
|
399
|
+
const nestedFields = this.#getNestedField(path);
|
|
400
|
+
targetFields = new Map([...targetFields, ...nestedFields]);
|
|
401
|
+
} else targetFields.set(path, field);
|
|
402
|
+
});
|
|
403
|
+
else targetFields = this.#fields;
|
|
404
|
+
return targetFields;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* An ArrayField has no single Field entity: restore its value in formState from the initial value, and renew its
|
|
408
|
+
* updateKey so it renders again. reset(fields) restores only the ArrayFields at or under one of the paths.
|
|
409
|
+
*/
|
|
410
|
+
#resetArrayField(fieldPaths) {
|
|
411
|
+
const arrayFieldPaths = [...this.#registeredArrayField.keys()].filter((path) => fieldPaths === void 0 || fieldPaths.some((target) => isPathWithin(path, target)));
|
|
412
|
+
arrayFieldPaths.forEach((path) => {
|
|
413
|
+
const arrayFieldState = this.#registeredArrayField.get(path);
|
|
414
|
+
const arrayFieldInitValue = this.adapter.cloneDeep(arrayFieldState.initValue);
|
|
415
|
+
this.#updateStateValue(path, arrayFieldInitValue, {
|
|
416
|
+
skipNotify: true,
|
|
417
|
+
skipRender: true
|
|
418
|
+
});
|
|
419
|
+
this.#updateArrayField(path, { updateKey: nextUpdateKey() });
|
|
420
|
+
});
|
|
421
|
+
this.#batch(() => {
|
|
422
|
+
this.#fields.forEach((registration) => {
|
|
423
|
+
if (arrayFieldPaths.some((path) => isPathWithin(registration.field, path))) this.#updateField(registration.store, { value: get$1(this.#data.values, registration.field) });
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
#autoScroll() {
|
|
428
|
+
const { autoScrollToError } = this.getFormProps();
|
|
429
|
+
if (!autoScrollToError) return;
|
|
430
|
+
const scrollOpts = typeof autoScrollToError === "object" ? autoScrollToError : {
|
|
431
|
+
behavior: "smooth",
|
|
432
|
+
block: "start"
|
|
433
|
+
};
|
|
434
|
+
const [fieldDOM] = this.#getErrorFieldDOMs();
|
|
435
|
+
if (fieldDOM) scrollIntoView$1(fieldDOM, scrollOpts);
|
|
436
|
+
}
|
|
437
|
+
#getField = (field) => this.#fields.get(field);
|
|
438
|
+
/**
|
|
439
|
+
* Settles an outdated validation without writing its result. It follows the newest one, as the Form waits on every
|
|
440
|
+
* field's promise and one that never settles would hang validate() and submit (a promise must not resolve with
|
|
441
|
+
* itself, hence the identity check). A silent validation is never the newest one: it writes nothing, so it must
|
|
442
|
+
* not keep a normal one from writing. One started before a reset of the whole Form or of its field, before
|
|
443
|
+
* setValue or setValues wrote its field, or whose field component has unmounted since, settles with undefined.
|
|
444
|
+
*/
|
|
445
|
+
#isSuperseded(registration, validation, epoch, silent, resolve) {
|
|
446
|
+
if (epoch !== this.#epoch) {
|
|
447
|
+
resolve(void 0);
|
|
448
|
+
return true;
|
|
449
|
+
}
|
|
450
|
+
const latest = this.#validations.get(registration.field);
|
|
451
|
+
if (!silent && latest !== validation) {
|
|
452
|
+
resolve(latest);
|
|
453
|
+
return true;
|
|
454
|
+
}
|
|
455
|
+
if (this.#fields.get(registration.field)?.id !== registration.id) {
|
|
456
|
+
resolve(void 0);
|
|
457
|
+
return true;
|
|
458
|
+
}
|
|
459
|
+
return false;
|
|
460
|
+
}
|
|
461
|
+
/** Resolves with the field's errors, undefined when valid; a rule that throws (a bad transform) rejects */
|
|
462
|
+
#validateRules(registration, value, opts) {
|
|
463
|
+
const { field } = registration;
|
|
464
|
+
const { rules, stopValidateWithError } = registration.getValidateOptions();
|
|
465
|
+
const epoch = this.#epoch;
|
|
466
|
+
const silent = Boolean(opts.silent);
|
|
467
|
+
const validation = new Promise((resolve, reject) => {
|
|
468
|
+
validateRules(rules, value, this.#getValue(), {
|
|
469
|
+
messages: this.adapter.getLocale(),
|
|
470
|
+
first: stopValidateWithError
|
|
471
|
+
}).then((error) => {
|
|
472
|
+
if (this.#isSuperseded(registration, validation, epoch, silent, resolve)) return;
|
|
473
|
+
this.#setFieldError(registration, error, {
|
|
474
|
+
...opts,
|
|
475
|
+
status: error ? "error" : "success"
|
|
476
|
+
});
|
|
477
|
+
resolve(error);
|
|
478
|
+
}, reject);
|
|
479
|
+
});
|
|
480
|
+
if (!silent) this.#validations.set(field, validation);
|
|
481
|
+
return validation;
|
|
482
|
+
}
|
|
483
|
+
#runFieldValidator(registration, value) {
|
|
484
|
+
const { validate, stopValidateWithError } = registration.getValidateOptions();
|
|
485
|
+
if (isStandardSchema(validate)) {
|
|
486
|
+
const toError = (result) => result.issues ? issueMessages(result.issues, Boolean(stopValidateWithError)) : void 0;
|
|
487
|
+
const result = validate["~standard"].validate(value);
|
|
488
|
+
return isPromise(result) ? result.then(toError) : toError(result);
|
|
489
|
+
}
|
|
490
|
+
return validate(value, this.#getValue());
|
|
491
|
+
}
|
|
492
|
+
#validateCustom(registration, value, opts) {
|
|
493
|
+
const epoch = this.#epoch;
|
|
494
|
+
const silent = Boolean(opts.silent);
|
|
495
|
+
const validation = new Promise((resolve) => {
|
|
496
|
+
let maybePromisedErrors;
|
|
497
|
+
try {
|
|
498
|
+
maybePromisedErrors = this.#runFieldValidator(registration, value);
|
|
499
|
+
} catch (err) {
|
|
500
|
+
maybePromisedErrors = err;
|
|
501
|
+
}
|
|
502
|
+
const settle = (result) => {
|
|
503
|
+
const error = normalizeFieldError(result);
|
|
504
|
+
this.#setFieldError(registration, error, opts);
|
|
505
|
+
resolve(error);
|
|
506
|
+
};
|
|
507
|
+
if (isPromise(maybePromisedErrors)) {
|
|
508
|
+
const settleLatest = (result) => {
|
|
509
|
+
if (!this.#isSuperseded(registration, validation, epoch, silent, resolve)) settle(result);
|
|
510
|
+
};
|
|
511
|
+
maybePromisedErrors.then(settleLatest, settleLatest);
|
|
512
|
+
} else settle(maybePromisedErrors);
|
|
513
|
+
});
|
|
514
|
+
if (!silent) this.#validations.set(registration.field, validation);
|
|
515
|
+
return validation;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* The field passes its own registration: a wrapped component may report a change from its mount effect, which runs
|
|
519
|
+
* before the field registers. The Form's `schema` excludes field-level validation; without it `validate` wins over
|
|
520
|
+
* `rules` (the two are exclusive, #register warns), and a field with neither has nothing to validate.
|
|
521
|
+
*/
|
|
522
|
+
#validateField = (registration, value, opts = {}) => {
|
|
523
|
+
const schema = this.#getSchema();
|
|
524
|
+
if (schema) return this.#validateSchema(registration, schema, opts);
|
|
525
|
+
const { rules, validate, transform } = registration.getValidateOptions();
|
|
526
|
+
const finalValue = transform ? transform(value) : value;
|
|
527
|
+
if (validate) return this.#validateCustom(registration, finalValue, opts);
|
|
528
|
+
return rules ? this.#validateRules(registration, finalValue, opts) : null;
|
|
529
|
+
};
|
|
530
|
+
/**
|
|
531
|
+
* Commits a value the user entered. onChange must already see it through the form api, yet a throwing onChange
|
|
532
|
+
* must leave the form state untouched: the value is written silently first and committed with notify and update
|
|
533
|
+
* once onChange returns; a throw rolls it back and propagates.
|
|
534
|
+
*/
|
|
535
|
+
#changeFieldValue = (registration, value, opts) => {
|
|
536
|
+
const { field, valuePath } = registration;
|
|
537
|
+
const { allowEmpty, allowEmptyString, emptyValue, convert } = registration.getChangeOptions();
|
|
538
|
+
let nextValue = valuePath ? get$1(value, valuePath) : value;
|
|
539
|
+
if (typeof convert === "function") nextValue = convert(nextValue);
|
|
540
|
+
if (!allowEmptyString && !allowEmpty && nextValue === emptyValue) nextValue = void 0;
|
|
541
|
+
this.#batch(() => {
|
|
542
|
+
const prevValue = this.#getValue(field, { needClone: true });
|
|
543
|
+
try {
|
|
544
|
+
this.#setFieldValue(registration, nextValue, SILENT);
|
|
545
|
+
opts.onChange(this.#getValue());
|
|
546
|
+
this.#setFieldTouched(registration, true, SILENT);
|
|
547
|
+
this.#updateStateValue(field, nextValue, { allowEmpty });
|
|
548
|
+
if (registration.getValidateOptions().trigger?.includes("change")) this.#validateOnChange(registration, nextValue);
|
|
549
|
+
} catch (err) {
|
|
550
|
+
this.#setFieldValue(registration, prevValue, SILENT);
|
|
551
|
+
throw err;
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
};
|
|
555
|
+
#blurField = (registration) => {
|
|
556
|
+
if (!registration.store.getSnapshot().touched) this.#setFieldTouched(registration, true);
|
|
557
|
+
if (registration.getValidateOptions().trigger?.includes("blur")) this.#validateField(registration, registration.store.getSnapshot().value);
|
|
558
|
+
};
|
|
559
|
+
/**
|
|
560
|
+
* With `schemaDebounce`, change validations against the schema wait until the user pauses: each run validates the
|
|
561
|
+
* whole form. No promise exists until the timer fires, so nothing waits on a cancelled one.
|
|
562
|
+
*/
|
|
563
|
+
#validateOnChange(registration, value) {
|
|
564
|
+
const { schemaDebounce } = this.getProps();
|
|
565
|
+
if (!(schemaDebounce > 0) || !this.#getSchema()) {
|
|
566
|
+
this.#validateField(registration, value);
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
this.#debouncedFields.add(registration.field);
|
|
570
|
+
clearTimeout(this.#debounceTimer);
|
|
571
|
+
this.#debounceTimer = setTimeout(() => {
|
|
572
|
+
const fields = [...this.#debouncedFields];
|
|
573
|
+
this.#cancelDebouncedValidation();
|
|
574
|
+
fields.forEach((field) => {
|
|
575
|
+
const current = this.#fields.get(field);
|
|
576
|
+
if (current) this.#validateField(current, this.#getValue(field));
|
|
577
|
+
});
|
|
578
|
+
}, schemaDebounce);
|
|
579
|
+
}
|
|
580
|
+
#cancelDebouncedValidation() {
|
|
581
|
+
clearTimeout(this.#debounceTimer);
|
|
582
|
+
this.#debounceTimer = void 0;
|
|
583
|
+
this.#debouncedFields.clear();
|
|
584
|
+
}
|
|
585
|
+
#register = (field, registration) => {
|
|
586
|
+
const fieldState = registration.store.getSnapshot();
|
|
587
|
+
const registered = this.#registered[field];
|
|
588
|
+
this.#registered[field] = true;
|
|
589
|
+
const { rules, validate } = registration.getValidateOptions();
|
|
590
|
+
warning(!registered && Boolean(this.#getSchema()) && Boolean(rules || validate), `[Semi Form] <Form schema> excludes field-level validation; the rules and validator of field "${field}" will be ignored`);
|
|
591
|
+
warning(!registered && Boolean(rules && validate), `[Semi Form] the rules and validator of field "${field}" are exclusive; validator is used`);
|
|
592
|
+
this.#fields.set(field, registration);
|
|
593
|
+
const allowEmpty = registration.allowEmpty ?? false;
|
|
594
|
+
const opts = {
|
|
595
|
+
skipNotify: true,
|
|
596
|
+
skipRender: false,
|
|
597
|
+
allowEmpty
|
|
598
|
+
};
|
|
599
|
+
let fieldValue = fieldState.value;
|
|
600
|
+
if (!allowEmpty && fieldValue === "") fieldValue = void 0;
|
|
601
|
+
if (!(registration.keepState && registered && !registration.inArrayField)) {
|
|
602
|
+
this.#updateStateValue(field, fieldValue, opts);
|
|
603
|
+
if (fieldState.error) this.#updateStateError(field, fieldState.error, opts);
|
|
604
|
+
else if (!registered || registration.keepState) {
|
|
605
|
+
const parentError = get$1(this.#data.errors, toPath(field).slice(0, -1));
|
|
606
|
+
const error = isErrorLeaf(parentError) ? void 0 : get$1(this.#data.errors, field);
|
|
607
|
+
if (isErrorLeaf(error)) this.#setFieldError(registration, error, {
|
|
608
|
+
...opts,
|
|
609
|
+
skipRender: true
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
if (fieldState.touched) this.#updateStateTouched(field, fieldState.touched, opts);
|
|
613
|
+
else if (registration.keepState && get$1(this.#data.touched, field) === true) this.#setFieldTouched(registration, true, {
|
|
614
|
+
...opts,
|
|
615
|
+
skipRender: true
|
|
616
|
+
});
|
|
617
|
+
this.#addToMountedArrayFields(field, allowEmpty);
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
if (has$1(this.#data.values, field)) {
|
|
621
|
+
const savedValue = get$1(this.#data.values, field);
|
|
622
|
+
this.#updateStateValue(field, savedValue, opts);
|
|
623
|
+
this.#setFieldValue(registration, savedValue, {
|
|
624
|
+
...opts,
|
|
625
|
+
skipRender: true
|
|
626
|
+
});
|
|
627
|
+
} else this.#updateStateValue(field, fieldValue, opts);
|
|
628
|
+
if (has$1(this.#data.errors, field)) {
|
|
629
|
+
const savedError = get$1(this.#data.errors, field);
|
|
630
|
+
this.#updateStateError(field, savedError, opts);
|
|
631
|
+
this.#setFieldError(registration, savedError, {
|
|
632
|
+
...opts,
|
|
633
|
+
skipRender: true
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
if (has$1(this.#data.touched, field)) {
|
|
637
|
+
const savedTouched = get$1(this.#data.touched, field);
|
|
638
|
+
this.#updateStateTouched(field, savedTouched, opts);
|
|
639
|
+
this.#setFieldTouched(registration, savedTouched, {
|
|
640
|
+
...opts,
|
|
641
|
+
skipRender: true
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
/**
|
|
646
|
+
* A renamed field (a shifted ArrayField row) may register its new path before or after the field there leaves
|
|
647
|
+
* it, so the state goes and onChange reports once the commit settles, with every row in place
|
|
648
|
+
*/
|
|
649
|
+
#unRegister = ({ id, field }) => {
|
|
650
|
+
const current = this.#fields.get(field);
|
|
651
|
+
if (current?.id !== id) return;
|
|
652
|
+
this.#fields.delete(field);
|
|
653
|
+
if (this.#destroyed) return;
|
|
654
|
+
this.#unregistered.push({
|
|
655
|
+
field,
|
|
656
|
+
keepState: current.keepState
|
|
657
|
+
});
|
|
658
|
+
this.#scheduleSettle();
|
|
659
|
+
};
|
|
660
|
+
#registerArrayField = (arrayFieldPath, val) => {
|
|
661
|
+
this.#updateArrayField(arrayFieldPath, {
|
|
662
|
+
updateKey: nextUpdateKey(),
|
|
663
|
+
initValue: val
|
|
664
|
+
});
|
|
665
|
+
};
|
|
666
|
+
/**
|
|
667
|
+
* Registers a mounting ArrayField and writes its initial value. Rows that registered before it have written their
|
|
668
|
+
* own values already, so the values of the fields and ArrayFields registered under it are laid over the array
|
|
669
|
+
* again, outer paths first; rows registering after it, until the commit settles, write theirs over the array
|
|
670
|
+
* themselves and add them to what reset() restores.
|
|
671
|
+
*/
|
|
672
|
+
#mountArrayField = (arrayFieldPath, val) => {
|
|
673
|
+
const target = toPath(arrayFieldPath);
|
|
674
|
+
const isNested = (path) => {
|
|
675
|
+
const nested = toPath(path);
|
|
676
|
+
return nested.length > target.length && target.every((key, i) => key === nested[i]);
|
|
677
|
+
};
|
|
678
|
+
const nestedArrayFields = [...this.#registeredArrayField.keys()].filter(isNested).toSorted((a, b) => toPath(a).length - toPath(b).length).map((path) => ({
|
|
679
|
+
path,
|
|
680
|
+
allowEmpty: false
|
|
681
|
+
}));
|
|
682
|
+
const nestedFields = [...this.#fields.values()].filter((registration) => isNested(registration.field)).map((registration) => ({
|
|
683
|
+
path: registration.field,
|
|
684
|
+
allowEmpty: registration.allowEmpty
|
|
685
|
+
}));
|
|
686
|
+
const nestedValues = [...nestedArrayFields, ...nestedFields].map((item) => ({
|
|
687
|
+
...item,
|
|
688
|
+
value: this.#getValue(item.path)
|
|
689
|
+
}));
|
|
690
|
+
const kept = this.#registeredArrayField.get(arrayFieldPath);
|
|
691
|
+
if (kept) this.#updateArrayField(arrayFieldPath, { updateKey: nextUpdateKey() });
|
|
692
|
+
else this.#registerArrayField(arrayFieldPath, val);
|
|
693
|
+
this.#updateStateValue(arrayFieldPath, this.adapter.cloneDeep(val), SILENT);
|
|
694
|
+
nestedValues.forEach(({ path, allowEmpty, value }) => {
|
|
695
|
+
this.#updateStateValue(path, value, {
|
|
696
|
+
...SILENT,
|
|
697
|
+
allowEmpty
|
|
698
|
+
});
|
|
699
|
+
});
|
|
700
|
+
this.#addToMountedArrayFields(arrayFieldPath, false);
|
|
701
|
+
if (!kept) {
|
|
702
|
+
this.#updateArrayField(arrayFieldPath, { initValue: this.adapter.cloneDeep(this.#getValue(arrayFieldPath)) });
|
|
703
|
+
this.#mountedArrayFields.push(arrayFieldPath);
|
|
704
|
+
this.#scheduleSettle();
|
|
705
|
+
}
|
|
706
|
+
this.#forceUpdate();
|
|
707
|
+
};
|
|
708
|
+
/**
|
|
709
|
+
* Applies one row edit to the ArrayField's values, and to its errors and touched where they hold rows: an error
|
|
710
|
+
* leaf at the array path (a schema's minItems) belongs to the array itself and stays.
|
|
711
|
+
*/
|
|
712
|
+
#editRows(arrayFieldPath, edit, valueOpts) {
|
|
713
|
+
const errors = this.#getError(arrayFieldPath);
|
|
714
|
+
if (Array.isArray(errors) && !isErrorLeaf(errors)) this.#updateStateError(arrayFieldPath, edit(errors), SILENT);
|
|
715
|
+
const touched = this.#getTouched(arrayFieldPath);
|
|
716
|
+
if (Array.isArray(touched)) this.#updateStateTouched(arrayFieldPath, edit(touched), SILENT);
|
|
717
|
+
const values = this.#getValue(arrayFieldPath);
|
|
718
|
+
if (Array.isArray(values)) this.#updateStateValue(arrayFieldPath, edit(values), valueOpts);
|
|
719
|
+
}
|
|
720
|
+
/** Inserts an empty row before `index`, or appends one without it; returns the ArrayField's new updateKey */
|
|
721
|
+
#addArrayFieldRow = (arrayFieldPath, index) => {
|
|
722
|
+
if (typeof index === "number") this.#editRows(arrayFieldPath, (rows) => rows.toSpliced(index, 0, void 0), SILENT);
|
|
723
|
+
const updateKey = nextUpdateKey();
|
|
724
|
+
this.#updateArrayField(arrayFieldPath, { updateKey });
|
|
725
|
+
this.#forceUpdate();
|
|
726
|
+
return updateKey;
|
|
727
|
+
};
|
|
728
|
+
#addArrayFieldRowWithValue = (arrayFieldPath, rowValue, index) => {
|
|
729
|
+
const values = this.#getValue(arrayFieldPath);
|
|
730
|
+
const rows = values ? values.slice() : [];
|
|
731
|
+
const rowIndex = typeof index === "number" ? Math.max(0, Math.min(index, rows.length)) : rows.length;
|
|
732
|
+
rows.splice(rowIndex, 0, this.adapter.cloneDeep(rowValue));
|
|
733
|
+
const updateKey = nextUpdateKey();
|
|
734
|
+
this.#updateArrayField(arrayFieldPath, { updateKey });
|
|
735
|
+
this.#updateStateValue(arrayFieldPath, rows, {});
|
|
736
|
+
return {
|
|
737
|
+
index: rowIndex,
|
|
738
|
+
updateKey
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
/** Every key of the row is removed too: some keys are set only in initValue and never taken over by a field */
|
|
742
|
+
#removeArrayFieldRow = (arrayFieldPath, index) => {
|
|
743
|
+
this.#editRows(arrayFieldPath, (rows) => rows.toSpliced(index, 1), {});
|
|
744
|
+
};
|
|
745
|
+
#moveArrayFieldRow = (arrayFieldPath, from, to) => {
|
|
746
|
+
this.#editRows(arrayFieldPath, (rows) => moveItem(rows, from, to), {});
|
|
747
|
+
const updateKey = nextUpdateKey();
|
|
748
|
+
this.#updateArrayField(arrayFieldPath, { updateKey });
|
|
749
|
+
return updateKey;
|
|
750
|
+
};
|
|
751
|
+
/**
|
|
752
|
+
* A row or nested ArrayField registering after its ArrayField mounted in this commit: reset() restores the value it
|
|
753
|
+
* registered with too
|
|
754
|
+
*/
|
|
755
|
+
#addToMountedArrayFields(field, allowEmpty) {
|
|
756
|
+
this.#mountedArrayFields.forEach((arrayFieldPath) => {
|
|
757
|
+
const arrayField = this.#registeredArrayField.get(arrayFieldPath);
|
|
758
|
+
if (arrayField && field !== arrayFieldPath && isPathWithin(field, arrayFieldPath)) {
|
|
759
|
+
const values = set$1(set$1({}, arrayFieldPath, arrayField.initValue), field, this.adapter.cloneDeep(this.#getValue(field)), allowEmpty);
|
|
760
|
+
this.#updateArrayField(arrayFieldPath, { initValue: get$1(values, arrayFieldPath) });
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
#unRegisterArrayField = (arrayField, keepState) => {
|
|
765
|
+
if (keepState) return;
|
|
766
|
+
this.#registeredArrayField.delete(arrayField);
|
|
767
|
+
this.#data = {
|
|
768
|
+
values: remove(this.#data.values, arrayField),
|
|
769
|
+
errors: remove(this.#data.errors, arrayField),
|
|
770
|
+
touched: remove(this.#data.touched, arrayField)
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
#getArrayField = (arrayField) => this.#registeredArrayField.get(arrayField);
|
|
774
|
+
#updateArrayField(arrayField, updateValue) {
|
|
775
|
+
const mergeVal = {
|
|
776
|
+
...this.#registeredArrayField.get(arrayField),
|
|
777
|
+
...updateValue
|
|
778
|
+
};
|
|
779
|
+
this.#registeredArrayField.set(arrayField, mergeVal);
|
|
780
|
+
}
|
|
781
|
+
#validate(fieldPaths) {
|
|
782
|
+
const { validator } = this.getProps();
|
|
783
|
+
let fields;
|
|
784
|
+
let silent = false;
|
|
785
|
+
if (fieldPaths && !Array.isArray(fieldPaths)) {
|
|
786
|
+
const options = fieldPaths;
|
|
787
|
+
fields = options.fields;
|
|
788
|
+
silent = options.silent ?? false;
|
|
789
|
+
} else fields = fieldPaths;
|
|
790
|
+
if (typeof validator === "function") return this.#formValidate(silent);
|
|
791
|
+
else return this.#fieldsValidate(fields, silent);
|
|
792
|
+
}
|
|
793
|
+
#injectErrorToField(errors) {
|
|
794
|
+
this.#fields.forEach((field) => {
|
|
795
|
+
const fieldError = get$1(errors, field.field);
|
|
796
|
+
this.#setFieldError(field, fieldError, {
|
|
797
|
+
skipNotify: true,
|
|
798
|
+
skipRender: true
|
|
799
|
+
});
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
#getValue = (field, opts) => {
|
|
803
|
+
const value = typeof field === "undefined" ? { ...this.#data.values } : get$1(this.#data.values, field);
|
|
804
|
+
return opts?.needClone ? this.adapter.cloneDeep(value) : value;
|
|
805
|
+
};
|
|
806
|
+
#setValues(values, { isOverride = false }) {
|
|
807
|
+
const _values = this.adapter.cloneDeep(values);
|
|
808
|
+
this.#fields.forEach((field) => {
|
|
809
|
+
const value = get$1(_values, field.field);
|
|
810
|
+
const opts = {
|
|
811
|
+
skipNotify: true,
|
|
812
|
+
skipRender: true
|
|
813
|
+
};
|
|
814
|
+
this.#validations.delete(field.field);
|
|
815
|
+
this.#setFieldValue(field, value, opts);
|
|
816
|
+
});
|
|
817
|
+
if (this.#registeredArrayField.size) [...this.#registeredArrayField.keys()].forEach((path) => {
|
|
818
|
+
this.#updateArrayField(path, { updateKey: nextUpdateKey() });
|
|
819
|
+
});
|
|
820
|
+
if (isOverride) this.#data = {
|
|
821
|
+
...this.#data,
|
|
822
|
+
values: _values
|
|
823
|
+
};
|
|
824
|
+
this.adapter.notifyChange(this.#data);
|
|
825
|
+
this.adapter.notifyValueChange(this.#data.values, { ...values });
|
|
826
|
+
this.#forceUpdate();
|
|
827
|
+
}
|
|
828
|
+
#updateStateValue = (field, value, opts, callback) => {
|
|
829
|
+
const skipNotify = opts?.skipNotify;
|
|
830
|
+
const skipRender = opts?.skipRender;
|
|
831
|
+
const allowEmpty = opts?.allowEmpty || this.getProp("allowEmpty");
|
|
832
|
+
this.#data = {
|
|
833
|
+
...this.#data,
|
|
834
|
+
values: set$1(this.#data.values, field, value, allowEmpty)
|
|
835
|
+
};
|
|
836
|
+
if (!skipNotify) {
|
|
837
|
+
this.adapter.notifyChange(this.#data);
|
|
838
|
+
this.adapter.notifyValueChange(this.#data.values, { [field]: value });
|
|
839
|
+
}
|
|
840
|
+
if (!skipRender) this.#forceUpdate(callback);
|
|
841
|
+
};
|
|
842
|
+
#getTouched = (field) => {
|
|
843
|
+
if (typeof field === "undefined") return this.#data.touched;
|
|
844
|
+
return get$1(this.#data.touched, field);
|
|
845
|
+
};
|
|
846
|
+
#updateStateTouched = (field, isTouched, opts, callback) => {
|
|
847
|
+
const skipNotify = opts?.skipNotify;
|
|
848
|
+
const skipRender = opts?.skipRender;
|
|
849
|
+
this.#data = {
|
|
850
|
+
...this.#data,
|
|
851
|
+
touched: set$1(this.#data.touched, field, isTouched)
|
|
852
|
+
};
|
|
853
|
+
if (!skipNotify) this.adapter.notifyChange(this.#data);
|
|
854
|
+
if (!skipRender) this.#forceUpdate(callback);
|
|
855
|
+
};
|
|
856
|
+
#getError = (field) => {
|
|
857
|
+
if (typeof field === "undefined") return this.#data.errors;
|
|
858
|
+
return get$1(this.#data.errors, field);
|
|
859
|
+
};
|
|
860
|
+
#updateStateError = (field, error, opts, callback) => {
|
|
861
|
+
const skipNotify = opts?.skipNotify;
|
|
862
|
+
const skipRender = opts?.skipRender;
|
|
863
|
+
this.#data = {
|
|
864
|
+
...this.#data,
|
|
865
|
+
errors: set$1(this.#data.errors, field, error)
|
|
866
|
+
};
|
|
867
|
+
if (!skipNotify) {
|
|
868
|
+
this.adapter.notifyChange(this.#data);
|
|
869
|
+
this.adapter.notifyErrorChange(this.#data.errors, { [field]: error });
|
|
870
|
+
}
|
|
871
|
+
if (!skipRender) this.#forceUpdate(callback);
|
|
872
|
+
};
|
|
873
|
+
#setFieldError = ({ store, field }, error, opts) => {
|
|
874
|
+
if (opts?.silent) return;
|
|
875
|
+
this.#batch(() => {
|
|
876
|
+
if (opts?.status) this.#updateField(store, { status: opts.status });
|
|
877
|
+
if (isEqual(error, store.getSnapshot().error)) return;
|
|
878
|
+
this.#updateField(store, {
|
|
879
|
+
error,
|
|
880
|
+
status: opts?.status ?? (isValid(error) ? "success" : "error")
|
|
881
|
+
});
|
|
882
|
+
this.#updateStateError(field, error, opts);
|
|
883
|
+
});
|
|
884
|
+
};
|
|
885
|
+
#setFieldValue(registration, value, opts) {
|
|
886
|
+
this.#batch(() => {
|
|
887
|
+
this.#updateField(registration.store, { value });
|
|
888
|
+
this.#updateStateValue(registration.field, value, {
|
|
889
|
+
...opts,
|
|
890
|
+
allowEmpty: registration.getChangeOptions().allowEmpty
|
|
891
|
+
});
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
#setFieldTouched = (registration, touched, opts) => {
|
|
895
|
+
this.#batch(() => {
|
|
896
|
+
this.#updateField(registration.store, { touched });
|
|
897
|
+
this.#updateStateTouched(registration.field, touched, opts);
|
|
898
|
+
});
|
|
899
|
+
};
|
|
900
|
+
/**
|
|
901
|
+
* formApi.setValue / setError / setTouched. A path with a Field updates its snapshot. A path without
|
|
902
|
+
* one, such as an ArrayField's value as a whole (each element has a Field), is written to formState first, then the
|
|
903
|
+
* Fields nested under it take their part: setValue('peoples', [2, 3]) with an Input Field per element.
|
|
904
|
+
*/
|
|
905
|
+
#setByPath(kind, field, value, opts) {
|
|
906
|
+
const setter = {
|
|
907
|
+
values: (registration, value, options) => this.#setFieldValue(registration, value, options),
|
|
908
|
+
errors: this.#setFieldError,
|
|
909
|
+
touched: this.#setFieldTouched
|
|
910
|
+
}[kind];
|
|
911
|
+
const updateState = {
|
|
912
|
+
values: this.#updateStateValue,
|
|
913
|
+
errors: this.#updateStateError,
|
|
914
|
+
touched: this.#updateStateTouched
|
|
915
|
+
}[kind];
|
|
916
|
+
const registration = this.#fields.get(field);
|
|
917
|
+
if (registration) {
|
|
918
|
+
setter(registration, value, opts);
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
updateState(field, value, opts, () => {
|
|
922
|
+
this.#getNestedField(field).forEach((nested) => {
|
|
923
|
+
const nestedValue = get$1(this.#data[kind], nested.field);
|
|
924
|
+
setter(nested, nestedValue, {
|
|
925
|
+
skipNotify: true,
|
|
926
|
+
skipRender: true
|
|
927
|
+
});
|
|
928
|
+
});
|
|
929
|
+
});
|
|
930
|
+
if (this.#getArrayField(field)) this.#updateArrayField(field, { updateKey: nextUpdateKey() });
|
|
931
|
+
}
|
|
932
|
+
#getFieldSetterApi() {
|
|
933
|
+
return {
|
|
934
|
+
setValue: (field, value, opts) => {
|
|
935
|
+
this.#getOperateFieldMap([field]).forEach((_, path) => this.#validations.delete(path));
|
|
936
|
+
this.#setByPath("values", field, this.adapter.cloneDeep(value), opts);
|
|
937
|
+
},
|
|
938
|
+
setError: (field, error, opts) => {
|
|
939
|
+
const nested = !this.#fields.has(field) && (isPlainObject(error) || Array.isArray(error) && error.length > 0 && !isErrorLeaf(error));
|
|
940
|
+
const tree = nested ? normalizeFormErrors(error) : void 0;
|
|
941
|
+
const normalized = nested ? hasErrors(tree) ? tree : void 0 : normalizeFieldError(error);
|
|
942
|
+
this.#setByPath("errors", field, normalized, opts);
|
|
943
|
+
},
|
|
944
|
+
setTouched: (field, isTouched, opts) => this.#setByPath("touched", field, isTouched, opts)
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
#getFieldExist(field) {
|
|
948
|
+
return Boolean(this.#fields.has(field));
|
|
949
|
+
}
|
|
950
|
+
#getFieldDOM(field) {
|
|
951
|
+
return this.adapter.getFormElement()?.querySelector(`.${prefix}-field[x-field-id="${CSS.escape(field)}"]`) ?? null;
|
|
952
|
+
}
|
|
953
|
+
/** The root elements of the fields showing an error message, in document order */
|
|
954
|
+
#getErrorFieldDOMs() {
|
|
955
|
+
const errorDOMs = this.adapter.getFormElement()?.querySelectorAll(ERROR_SELECTOR) ?? [];
|
|
956
|
+
return Array.from(errorDOMs, errorField).filter((fieldDOM) => fieldDOM !== null);
|
|
957
|
+
}
|
|
958
|
+
#getErrorFieldDOM(field) {
|
|
959
|
+
const errorDOM = this.#getFieldDOM(field)?.querySelector(ERROR_SELECTOR);
|
|
960
|
+
return errorDOM && errorField(errorDOM);
|
|
961
|
+
}
|
|
962
|
+
#scrollToField(field, scrollOpts = {
|
|
963
|
+
behavior: "smooth",
|
|
964
|
+
block: "start"
|
|
965
|
+
}) {
|
|
966
|
+
const fieldDOM = this.#getFieldExist(field) ? this.#getFieldDOM(field) : null;
|
|
967
|
+
if (fieldDOM) scrollIntoView$1(fieldDOM, scrollOpts);
|
|
968
|
+
}
|
|
969
|
+
#scrollToError(config) {
|
|
970
|
+
const { field, index, scrollOpts = {
|
|
971
|
+
behavior: "smooth",
|
|
972
|
+
block: "start"
|
|
973
|
+
} } = config ?? {};
|
|
974
|
+
let fieldDOM;
|
|
975
|
+
if (typeof index === "number") fieldDOM = this.#getErrorFieldDOMs()[index];
|
|
976
|
+
else if (field) fieldDOM = this.#getErrorFieldDOM(field);
|
|
977
|
+
else if (typeof field === "undefined") fieldDOM = this.#getErrorFieldDOMs()[0];
|
|
978
|
+
if (fieldDOM) scrollIntoView$1(fieldDOM, scrollOpts);
|
|
979
|
+
}
|
|
980
|
+
getInitValues() {
|
|
981
|
+
return this.getProp("initValues");
|
|
982
|
+
}
|
|
983
|
+
getInitValue(field) {
|
|
984
|
+
if (typeof field === "undefined") return this.getInitValues();
|
|
985
|
+
return get$1(this.getInitValues(), field);
|
|
986
|
+
}
|
|
987
|
+
getFormProps(keys) {
|
|
988
|
+
return pickFormProps(this.getProps(), keys);
|
|
989
|
+
}
|
|
990
|
+
initOnce() {
|
|
991
|
+
const { schema, validator } = this.getProps();
|
|
992
|
+
warning(Boolean(schema) && typeof validator === "function", "[Semi Form] You should not use <Form schema> and <Form validator> at the same time; <Form schema> will be ignored");
|
|
993
|
+
}
|
|
994
|
+
/** The rendered form state starts from the initValues as given; the foundation's own copy is a clone */
|
|
995
|
+
static getInitialState(props) {
|
|
996
|
+
return { formState: {
|
|
997
|
+
values: props.initValues ?? {},
|
|
998
|
+
errors: {},
|
|
999
|
+
touched: {}
|
|
1000
|
+
} };
|
|
1001
|
+
}
|
|
1002
|
+
init() {
|
|
1003
|
+
this.#destroyed = false;
|
|
1004
|
+
}
|
|
1005
|
+
destroy() {
|
|
1006
|
+
this.#destroyed = true;
|
|
1007
|
+
this.#cancelDebouncedValidation();
|
|
1008
|
+
this.#unregistered = [];
|
|
1009
|
+
}
|
|
1010
|
+
submit = (e) => {
|
|
1011
|
+
const epoch = this.#epoch;
|
|
1012
|
+
this.#validate().then((resolveValues) => {
|
|
1013
|
+
if (this.#isCancelled(epoch)) return;
|
|
1014
|
+
const _values = this.adapter.cloneDeep(resolveValues);
|
|
1015
|
+
this.adapter.notifySubmit(_values, e);
|
|
1016
|
+
}, (errors) => {
|
|
1017
|
+
if (this.#isCancelled(epoch)) return;
|
|
1018
|
+
const _errors = this.adapter.cloneDeep(errors);
|
|
1019
|
+
const _values = this.adapter.cloneDeep(this.#data.values);
|
|
1020
|
+
this.adapter.notifySubmitFail(_errors, _values, e);
|
|
1021
|
+
});
|
|
1022
|
+
};
|
|
1023
|
+
reset = (fieldPaths) => {
|
|
1024
|
+
const targetFields = this.#getOperateFieldMap(fieldPaths);
|
|
1025
|
+
if (fieldPaths === void 0) {
|
|
1026
|
+
this.#epoch += 1;
|
|
1027
|
+
this.#cancelDebouncedValidation();
|
|
1028
|
+
} else targetFields.forEach((_, path) => this.#validations.delete(path));
|
|
1029
|
+
const prevErrors = this.#data.errors;
|
|
1030
|
+
this.#batch(() => {
|
|
1031
|
+
targetFields.forEach((field) => {
|
|
1032
|
+
this.#setFieldValue(field, field.initValue !== null ? this.adapter.cloneDeep(field.initValue) : void 0, SILENT);
|
|
1033
|
+
this.#setFieldError(field, void 0, SILENT);
|
|
1034
|
+
this.#setFieldTouched(field, void 0, SILENT);
|
|
1035
|
+
this.#updateField(field.store, { status: "default" });
|
|
1036
|
+
});
|
|
1037
|
+
});
|
|
1038
|
+
if (fieldPaths === void 0) {
|
|
1039
|
+
this.#data = {
|
|
1040
|
+
...this.#data,
|
|
1041
|
+
errors: {}
|
|
1042
|
+
};
|
|
1043
|
+
this.#detachedErrorPaths = [];
|
|
1044
|
+
}
|
|
1045
|
+
if (this.#registeredArrayField.size) this.#resetArrayField(fieldPaths);
|
|
1046
|
+
this.adapter.notifyChange(this.#data);
|
|
1047
|
+
this.#notifyErrorChange(prevErrors, targetFields.keys());
|
|
1048
|
+
this.#forceUpdate();
|
|
1049
|
+
this.adapter.notifyReset();
|
|
1050
|
+
};
|
|
1051
|
+
getFieldBridge = () => {
|
|
1052
|
+
return {
|
|
1053
|
+
register: this.#register,
|
|
1054
|
+
unRegister: this.#unRegister,
|
|
1055
|
+
validateField: this.#validateField,
|
|
1056
|
+
changeFieldValue: this.#changeFieldValue,
|
|
1057
|
+
blurField: this.#blurField,
|
|
1058
|
+
getValue: this.#getValue,
|
|
1059
|
+
getError: this.#getError,
|
|
1060
|
+
getTouched: this.#getTouched,
|
|
1061
|
+
getInitValues: () => this.getInitValues(),
|
|
1062
|
+
getInitValue: (field) => this.getInitValue(field),
|
|
1063
|
+
getFormProps: (keys) => this.getFormProps(keys),
|
|
1064
|
+
getField: this.#getField,
|
|
1065
|
+
registerArrayField: this.#registerArrayField,
|
|
1066
|
+
mountArrayField: this.#mountArrayField,
|
|
1067
|
+
unRegisterArrayField: this.#unRegisterArrayField,
|
|
1068
|
+
getArrayField: this.#getArrayField,
|
|
1069
|
+
addArrayFieldRow: this.#addArrayFieldRow,
|
|
1070
|
+
addArrayFieldRowWithValue: this.#addArrayFieldRowWithValue,
|
|
1071
|
+
removeArrayFieldRow: this.#removeArrayFieldRow,
|
|
1072
|
+
moveArrayFieldRow: this.#moveArrayFieldRow
|
|
1073
|
+
};
|
|
1074
|
+
};
|
|
1075
|
+
getFormApi = () => {
|
|
1076
|
+
return {
|
|
1077
|
+
...this.#getFieldSetterApi(),
|
|
1078
|
+
reset: (fields) => this.reset(fields),
|
|
1079
|
+
validate: (fields) => this.#validate(fields),
|
|
1080
|
+
getValue: (field) => this.#getValue(field, { needClone: true }),
|
|
1081
|
+
getValues: () => this.#getValue(void 0, { needClone: true }),
|
|
1082
|
+
getFormState: () => this.getFormState(true),
|
|
1083
|
+
getFormProps: (props) => this.getFormProps(props),
|
|
1084
|
+
getInitValue: (field) => this.getInitValue(field),
|
|
1085
|
+
getInitValues: () => this.getInitValues(),
|
|
1086
|
+
getTouched: (field) => this.#getTouched(field),
|
|
1087
|
+
getError: (field) => this.#getError(field),
|
|
1088
|
+
setValues: (values, opts) => this.#setValues(values, opts ?? { isOverride: false }),
|
|
1089
|
+
submitForm: () => this.submit(),
|
|
1090
|
+
getFieldExist: (field) => this.#getFieldExist(field),
|
|
1091
|
+
scrollToField: (field, scrollOpts) => this.#scrollToField(field, scrollOpts),
|
|
1092
|
+
scrollToError: (opts) => this.#scrollToError(opts)
|
|
1093
|
+
};
|
|
1094
|
+
};
|
|
1095
|
+
getFormState = (needClone = false) => {
|
|
1096
|
+
if (!needClone) return { ...this.#data };
|
|
1097
|
+
else return this.adapter.cloneDeep(this.#data);
|
|
1098
|
+
};
|
|
1099
|
+
};
|
|
1100
|
+
export { FormFoundation as default };
|