@fibrae/semi-foundation 0.0.0-stage → 0.1.1
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 +84 -0
- package/README.md +76 -2
- package/dist/_portal/portal.css +12 -0
- package/dist/_portal/portal.scss +18 -0
- package/dist/anchor/anchor.css +118 -0
- package/dist/anchor/anchor.scss +148 -0
- package/dist/anchor/animation.scss +7 -0
- package/dist/anchor/constants.d.ts +9 -0
- package/dist/anchor/constants.js +14 -0
- package/dist/anchor/foundation.d.ts +49 -0
- package/dist/anchor/foundation.js +143 -0
- package/dist/anchor/rtl.scss +9 -0
- package/dist/anchor/utils.d.ts +6 -0
- package/dist/anchor/utils.js +16 -0
- package/dist/anchor/variables.scss +34 -0
- package/dist/audio-player/audio-player.css +226 -0
- package/dist/audio-player/audio-player.scss +278 -0
- package/dist/audio-player/constants.d.ts +11 -0
- package/dist/audio-player/constants.js +27 -0
- package/dist/audio-player/foundation.d.ts +46 -0
- package/dist/audio-player/foundation.js +116 -0
- package/dist/audio-player/utils.d.ts +2 -0
- package/dist/audio-player/utils.js +6 -0
- package/dist/audio-player/variables.scss +53 -0
- package/dist/auto-complete/animation.scss +5 -0
- package/dist/auto-complete/auto-complete.css +99 -0
- package/dist/auto-complete/auto-complete.scss +36 -0
- package/dist/auto-complete/constants.d.ts +4 -0
- package/dist/auto-complete/constants.js +7 -0
- package/dist/auto-complete/foundation.d.ts +77 -0
- package/dist/auto-complete/foundation.js +219 -0
- package/dist/auto-complete/option.scss +78 -0
- package/dist/auto-complete/rtl.scss +9 -0
- package/dist/auto-complete/variables.scss +23 -0
- package/dist/avatar/animation.scss +13 -0
- package/dist/avatar/avatar.css +652 -0
- package/dist/avatar/avatar.scss +540 -0
- package/dist/avatar/constants.d.ts +6 -0
- package/dist/avatar/constants.js +13 -0
- package/dist/avatar/foundation.d.ts +29 -0
- package/dist/avatar/foundation.js +31 -0
- package/dist/avatar/mixin.scss +7 -0
- package/dist/avatar/rtl.scss +11 -0
- package/dist/avatar/variables.scss +113 -0
- package/dist/backtop/backtop.css +9 -0
- package/dist/backtop/backtop.scss +15 -0
- package/dist/backtop/constants.d.ts +6 -0
- package/dist/backtop/constants.js +35 -0
- package/dist/backtop/foundation.d.ts +26 -0
- package/dist/backtop/foundation.js +69 -0
- package/dist/backtop/rtl.scss +8 -0
- package/dist/backtop/variables.scss +4 -0
- package/dist/badge/badge.css +131 -0
- package/dist/badge/badge.scss +158 -0
- package/dist/badge/constants.d.ts +3 -0
- package/dist/badge/constants.js +4 -0
- package/dist/badge/rtl.scss +8 -0
- package/dist/badge/variables.scss +46 -0
- package/dist/banner/banner.css +75 -0
- package/dist/banner/banner.scss +107 -0
- package/dist/banner/constants.d.ts +3 -0
- package/dist/banner/constants.js +4 -0
- package/dist/banner/foundation.d.ts +9 -0
- package/dist/banner/foundation.js +9 -0
- package/dist/banner/rtl.scss +8 -0
- package/dist/banner/variables.scss +29 -0
- package/dist/base/auto-close-foundation.d.ts +30 -0
- package/dist/base/auto-close-foundation.js +61 -0
- package/dist/base/base.scss +36 -0
- package/dist/base/constants.d.ts +11 -0
- package/dist/base/constants.js +23 -0
- package/dist/base/env.d.ts +1 -0
- package/dist/base/env.js +3 -0
- package/dist/base/foundation.d.ts +75 -0
- package/dist/base/foundation.js +79 -0
- package/dist/base/list-store.d.ts +26 -0
- package/dist/base/list-store.js +80 -0
- package/dist/base/mixin.scss +61 -0
- package/dist/base/tokens.css +799 -0
- package/dist/base/tokens.scss +3 -0
- package/dist/breadcrumb/animation.scss +7 -0
- package/dist/breadcrumb/breadcrumb.css +91 -0
- package/dist/breadcrumb/breadcrumb.scss +116 -0
- package/dist/breadcrumb/constants.d.ts +7 -0
- package/dist/breadcrumb/constants.js +8 -0
- package/dist/breadcrumb/foundation.d.ts +37 -0
- package/dist/breadcrumb/foundation.js +61 -0
- package/dist/breadcrumb/item-foundation.d.ts +45 -0
- package/dist/breadcrumb/item-foundation.js +36 -0
- package/dist/breadcrumb/rtl.scss +9 -0
- package/dist/breadcrumb/variables.scss +23 -0
- package/dist/button/animation.scss +63 -0
- package/dist/button/button.css +406 -0
- package/dist/button/button.scss +513 -0
- package/dist/button/constants.d.ts +6 -0
- package/dist/button/constants.js +5 -0
- package/dist/button/icon-button.css +65 -0
- package/dist/button/icon-button.scss +76 -0
- package/dist/button/rtl.scss +18 -0
- package/dist/button/split-button-group.scss +36 -0
- package/dist/button/utils.d.ts +27 -0
- package/dist/button/utils.js +89 -0
- package/dist/button/variables.scss +169 -0
- package/dist/calendar/calendar.css +486 -0
- package/dist/calendar/calendar.scss +518 -0
- package/dist/calendar/constants.d.ts +10 -0
- package/dist/calendar/constants.js +14 -0
- package/dist/calendar/event-util.d.ts +74 -0
- package/dist/calendar/event-util.js +203 -0
- package/dist/calendar/foundation.d.ts +80 -0
- package/dist/calendar/foundation.js +198 -0
- package/dist/calendar/month-foundation.d.ts +11 -0
- package/dist/calendar/month-foundation.js +13 -0
- package/dist/calendar/rtl.scss +10 -0
- package/dist/calendar/variables.scss +95 -0
- package/dist/card/card.css +124 -0
- package/dist/card/card.scss +149 -0
- package/dist/card/constants.d.ts +3 -0
- package/dist/card/constants.js +4 -0
- package/dist/card/rtl.scss +18 -0
- package/dist/card/variables.scss +32 -0
- package/dist/carousel/animation.scss +9 -0
- package/dist/carousel/carousel.css +345 -0
- package/dist/carousel/carousel.scss +451 -0
- package/dist/carousel/constants.d.ts +27 -0
- package/dist/carousel/constants.js +42 -0
- package/dist/carousel/foundation.d.ts +61 -0
- package/dist/carousel/foundation.js +204 -0
- package/dist/carousel/rtl.scss +14 -0
- package/dist/carousel/variables.scss +49 -0
- package/dist/cascader/animation.scss +5 -0
- package/dist/cascader/cascader.css +488 -0
- package/dist/cascader/cascader.scss +586 -0
- package/dist/cascader/constants.d.ts +19 -0
- package/dist/cascader/constants.js +20 -0
- package/dist/cascader/foundation.d.ts +300 -0
- package/dist/cascader/foundation.js +893 -0
- package/dist/cascader/rtl.scss +14 -0
- package/dist/cascader/util.d.ts +37 -0
- package/dist/cascader/util.js +155 -0
- package/dist/cascader/variables.scss +134 -0
- package/dist/checkbox/animation.scss +11 -0
- package/dist/checkbox/checkbox-foundation.d.ts +97 -0
- package/dist/checkbox/checkbox-foundation.js +65 -0
- package/dist/checkbox/checkbox-group-foundation.d.ts +21 -0
- package/dist/checkbox/checkbox-group-foundation.js +28 -0
- package/dist/checkbox/checkbox.css +301 -0
- package/dist/checkbox/checkbox.scss +415 -0
- package/dist/checkbox/constants.d.ts +14 -0
- package/dist/checkbox/constants.js +15 -0
- package/dist/checkbox/mixin.scss +3 -0
- package/dist/checkbox/rtl.scss +11 -0
- package/dist/checkbox/variables.scss +72 -0
- package/dist/code-highlight/code-highlight.css +54 -0
- package/dist/code-highlight/code-highlight.scss +65 -0
- package/dist/code-highlight/constants.d.ts +3 -0
- package/dist/code-highlight/constants.js +4 -0
- package/dist/code-highlight/highlighter.d.ts +3 -0
- package/dist/code-highlight/highlighter.js +56 -0
- package/dist/code-highlight/index.d.ts +25 -0
- package/dist/code-highlight/index.js +19 -0
- package/dist/code-highlight/registry.d.ts +23 -0
- package/dist/code-highlight/registry.js +33 -0
- package/dist/code-highlight/variables.scss +1 -0
- package/dist/collapse/collapse.css +101 -0
- package/dist/collapse/collapse.scss +112 -0
- package/dist/collapse/constants.d.ts +3 -0
- package/dist/collapse/constants.js +4 -0
- package/dist/collapse/foundation.d.ts +47 -0
- package/dist/collapse/foundation.js +44 -0
- package/dist/collapse/rtl.scss +8 -0
- package/dist/collapse/variables.scss +25 -0
- package/dist/collapsible/animation.scss +9 -0
- package/dist/collapsible/collapsible.css +17 -0
- package/dist/collapsible/collapsible.scss +28 -0
- package/dist/collapsible/constants.d.ts +3 -0
- package/dist/collapsible/constants.js +4 -0
- package/dist/collapsible/foundation.d.ts +68 -0
- package/dist/collapsible/foundation.js +123 -0
- package/dist/collapsible/variables.scss +1 -0
- package/dist/color-picker/alpha-slider-foundation.d.ts +29 -0
- package/dist/color-picker/alpha-slider-foundation.js +41 -0
- package/dist/color-picker/color-choose-area-foundation.d.ts +36 -0
- package/dist/color-picker/color-choose-area-foundation.js +57 -0
- package/dist/color-picker/color-picker.css +104 -0
- package/dist/color-picker/color-picker.scss +131 -0
- package/dist/color-picker/color-slider-foundation.d.ts +29 -0
- package/dist/color-picker/color-slider-foundation.js +41 -0
- package/dist/color-picker/constants.d.ts +3 -0
- package/dist/color-picker/constants.js +4 -0
- package/dist/color-picker/data-part-foundation.d.ts +28 -0
- package/dist/color-picker/data-part-foundation.js +76 -0
- package/dist/color-picker/foundation.d.ts +56 -0
- package/dist/color-picker/foundation.js +149 -0
- package/dist/color-picker/interface.d.ts +32 -0
- package/dist/color-picker/interface.js +0 -0
- package/dist/color-picker/utils/convert.d.ts +16 -0
- package/dist/color-picker/utils/convert.js +150 -0
- package/dist/color-picker/utils/round.d.ts +1 -0
- package/dist/color-picker/utils/round.js +5 -0
- package/dist/color-picker/utils/split.d.ts +5 -0
- package/dist/color-picker/utils/split.js +26 -0
- package/dist/color-picker/variables.scss +26 -0
- package/dist/config-provider/breakpoint-observer.d.ts +23 -0
- package/dist/config-provider/breakpoint-observer.js +139 -0
- package/dist/config-provider/inherit-config.d.ts +24 -0
- package/dist/config-provider/inherit-config.js +24 -0
- package/dist/config-provider/responsive-types.d.ts +39 -0
- package/dist/config-provider/responsive-types.js +0 -0
- package/dist/cropper/constants.d.ts +21 -0
- package/dist/cropper/constants.js +37 -0
- package/dist/cropper/cropper.css +101 -0
- package/dist/cropper/cropper.scss +129 -0
- package/dist/cropper/foundation.d.ts +91 -0
- package/dist/cropper/foundation.js +804 -0
- package/dist/cropper/utils.d.ts +20 -0
- package/dist/cropper/utils.js +23 -0
- package/dist/cropper/variables.scss +8 -0
- package/dist/date-picker/_utils/formatter.d.ts +6 -0
- package/dist/date-picker/_utils/formatter.js +21 -0
- package/dist/date-picker/_utils/get-day-of-week.d.ts +5 -0
- package/dist/date-picker/_utils/get-day-of-week.js +14 -0
- package/dist/date-picker/_utils/get-default-format-token.d.ts +10 -0
- package/dist/date-picker/_utils/get-default-format-token.js +18 -0
- package/dist/date-picker/_utils/get-default-picker-date.d.ts +15 -0
- package/dist/date-picker/_utils/get-default-picker-date.js +38 -0
- package/dist/date-picker/_utils/get-full-date-offset.d.ts +3 -0
- package/dist/date-picker/_utils/get-full-date-offset.js +11 -0
- package/dist/date-picker/_utils/get-inset-input-format-token.d.ts +20 -0
- package/dist/date-picker/_utils/get-inset-input-format-token.js +35 -0
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.d.ts +30 -0
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +59 -0
- package/dist/date-picker/_utils/get-month-table.d.ts +15 -0
- package/dist/date-picker/_utils/get-month-table.js +33 -0
- package/dist/date-picker/_utils/get-year-and-month.d.ts +16 -0
- package/dist/date-picker/_utils/get-year-and-month.js +18 -0
- package/dist/date-picker/_utils/get-year-month-from-value.d.ts +12 -0
- package/dist/date-picker/_utils/get-year-month-from-value.js +18 -0
- package/dist/date-picker/_utils/get-years.d.ts +1 -0
- package/dist/date-picker/_utils/get-years.js +9 -0
- package/dist/date-picker/_utils/index.d.ts +11 -0
- package/dist/date-picker/_utils/index.js +11 -0
- package/dist/date-picker/_utils/is-after.d.ts +1 -0
- package/dist/date-picker/_utils/is-after.js +7 -0
- package/dist/date-picker/_utils/is-before.d.ts +1 -0
- package/dist/date-picker/_utils/is-before.js +7 -0
- package/dist/date-picker/_utils/is-between.d.ts +8 -0
- package/dist/date-picker/_utils/is-between.js +11 -0
- package/dist/date-picker/_utils/is-same-day.d.ts +1 -0
- package/dist/date-picker/_utils/is-same-day.js +7 -0
- package/dist/date-picker/_utils/is-timestamp.d.ts +1 -0
- package/dist/date-picker/_utils/is-timestamp.js +6 -0
- package/dist/date-picker/_utils/is-valid-date.d.ts +1 -0
- package/dist/date-picker/_utils/is-valid-date.js +5 -0
- package/dist/date-picker/_utils/parser.d.ts +5 -0
- package/dist/date-picker/_utils/parser.js +24 -0
- package/dist/date-picker/_utils/picker-type.d.ts +20 -0
- package/dist/date-picker/_utils/picker-type.js +30 -0
- package/dist/date-picker/_utils/to-callback-args.d.ts +18 -0
- package/dist/date-picker/_utils/to-callback-args.js +47 -0
- package/dist/date-picker/_utils/to-date-arg.d.ts +6 -0
- package/dist/date-picker/_utils/to-date-arg.js +13 -0
- package/dist/date-picker/animation.scss +1 -0
- package/dist/date-picker/constants.d.ts +53 -0
- package/dist/date-picker/constants.js +78 -0
- package/dist/date-picker/date-picker.css +1285 -0
- package/dist/date-picker/date-picker.scss +1765 -0
- package/dist/date-picker/foundation.d.ts +336 -0
- package/dist/date-picker/foundation.js +736 -0
- package/dist/date-picker/input-foundation.d.ts +144 -0
- package/dist/date-picker/input-foundation.js +214 -0
- package/dist/date-picker/month-foundation.d.ts +157 -0
- package/dist/date-picker/month-foundation.js +188 -0
- package/dist/date-picker/months-grid-foundation.d.ts +180 -0
- package/dist/date-picker/months-grid-foundation.js +557 -0
- package/dist/date-picker/rtl.scss +28 -0
- package/dist/date-picker/variables.scss +237 -0
- package/dist/date-picker/year-and-month-foundation.d.ts +75 -0
- package/dist/date-picker/year-and-month-foundation.js +115 -0
- package/dist/descriptions/constants.d.ts +3 -0
- package/dist/descriptions/constants.js +4 -0
- package/dist/descriptions/descriptions.css +138 -0
- package/dist/descriptions/descriptions.scss +182 -0
- package/dist/descriptions/foundation.d.ts +12 -0
- package/dist/descriptions/foundation.js +36 -0
- package/dist/descriptions/rtl.scss +8 -0
- package/dist/descriptions/variables.scss +26 -0
- package/dist/divider/constants.d.ts +3 -0
- package/dist/divider/constants.js +4 -0
- package/dist/divider/divider.css +60 -0
- package/dist/divider/divider.scss +83 -0
- package/dist/divider/variables.scss +24 -0
- package/dist/drag-move/foundation.d.ts +31 -0
- package/dist/drag-move/foundation.js +178 -0
- package/dist/dropdown/animation.scss +5 -0
- package/dist/dropdown/constants.d.ts +11 -0
- package/dist/dropdown/constants.js +12 -0
- package/dist/dropdown/dropdown.css +154 -0
- package/dist/dropdown/dropdown.scss +128 -0
- package/dist/dropdown/foundation.d.ts +37 -0
- package/dist/dropdown/foundation.js +120 -0
- package/dist/dropdown/menu-foundation.d.ts +36 -0
- package/dist/dropdown/menu-foundation.js +82 -0
- package/dist/dropdown/rtl.scss +9 -0
- package/dist/dropdown/variables.scss +42 -0
- package/dist/empty/constants.d.ts +6 -0
- package/dist/empty/constants.js +5 -0
- package/dist/empty/empty.css +41 -0
- package/dist/empty/empty.scss +56 -0
- package/dist/empty/rtl.scss +8 -0
- package/dist/empty/variables.scss +10 -0
- package/dist/feedback/constants.d.ts +12 -0
- package/dist/feedback/constants.js +19 -0
- package/dist/feedback/feedback.css +110 -0
- package/dist/feedback/feedback.scss +153 -0
- package/dist/feedback/foundation.d.ts +43 -0
- package/dist/feedback/foundation.js +72 -0
- package/dist/feedback/variables.scss +26 -0
- package/dist/float-button/constants.d.ts +10 -0
- package/dist/float-button/constants.js +13 -0
- package/dist/float-button/float-button.css +159 -0
- package/dist/float-button/float-button.scss +203 -0
- package/dist/float-button/rtl.scss +2 -0
- package/dist/float-button/variables.scss +47 -0
- package/dist/form/constants.d.ts +7 -0
- package/dist/form/constants.js +8 -0
- package/dist/form/field-store.d.ts +10 -0
- package/dist/form/field-store.js +28 -0
- package/dist/form/form-api-proxy.d.ts +13 -0
- package/dist/form/form-api-proxy.js +48 -0
- package/dist/form/form.css +229 -0
- package/dist/form/form.scss +307 -0
- package/dist/form/foundation.d.ts +65 -0
- package/dist/form/foundation.js +836 -0
- package/dist/form/interface.d.ts +171 -0
- package/dist/form/interface.js +0 -0
- package/dist/form/rtl.scss +13 -0
- package/dist/form/utils.d.ts +89 -0
- package/dist/form/utils.js +115 -0
- package/dist/form/variables.scss +53 -0
- package/dist/grid/constants.d.ts +6 -0
- package/dist/grid/constants.js +12 -0
- package/dist/grid/grid.css +4206 -0
- package/dist/grid/grid.scss +101 -0
- package/dist/grid/gutter.d.ts +12 -0
- package/dist/grid/gutter.js +39 -0
- package/dist/grid/mixin.scss +119 -0
- package/dist/grid/rtl.scss +10 -0
- package/dist/grid/utils.d.ts +22 -0
- package/dist/grid/utils.js +39 -0
- package/dist/grid/variables.scss +29 -0
- package/dist/highlight/constants.d.ts +3 -0
- package/dist/highlight/constants.js +4 -0
- package/dist/highlight/foundation.d.ts +59 -0
- package/dist/highlight/foundation.js +110 -0
- package/dist/highlight/highlight.css +5 -0
- package/dist/highlight/highlight.scss +11 -0
- package/dist/highlight/variables.scss +6 -0
- package/dist/hot-keys/constants.d.ts +105 -0
- package/dist/hot-keys/constants.js +207 -0
- package/dist/hot-keys/foundation.d.ts +19 -0
- package/dist/hot-keys/foundation.js +92 -0
- package/dist/hot-keys/hot-keys.css +29 -0
- package/dist/hot-keys/hot-keys.scss +30 -0
- package/dist/hot-keys/variables.scss +12 -0
- package/dist/image/animation.scss +9 -0
- package/dist/image/constants.d.ts +6 -0
- package/dist/image/constants.js +5 -0
- package/dist/image/image-foundation.d.ts +30 -0
- package/dist/image/image-foundation.js +40 -0
- package/dist/image/image.css +250 -0
- package/dist/image/image.scss +272 -0
- package/dist/image/preview-footer-foundation.d.ts +26 -0
- package/dist/image/preview-footer-foundation.js +30 -0
- package/dist/image/preview-foundation.d.ts +51 -0
- package/dist/image/preview-foundation.js +70 -0
- package/dist/image/preview-image-foundation.d.ts +70 -0
- package/dist/image/preview-image-foundation.js +226 -0
- package/dist/image/preview-inner-foundation.d.ts +87 -0
- package/dist/image/preview-inner-foundation.js +238 -0
- package/dist/image/rtl.scss +28 -0
- package/dist/image/utils.d.ts +4 -0
- package/dist/image/utils.js +66 -0
- package/dist/image/variables.scss +44 -0
- package/dist/input/animation.scss +11 -0
- package/dist/input/constants.d.ts +9 -0
- package/dist/input/constants.js +14 -0
- package/dist/input/foundation.d.ts +51 -0
- package/dist/input/foundation.js +79 -0
- package/dist/input/input.css +616 -0
- package/dist/input/input.scss +738 -0
- package/dist/input/rtl.scss +11 -0
- package/dist/input/text-entry-foundation.d.ts +55 -0
- package/dist/input/text-entry-foundation.js +93 -0
- package/dist/input/textarea-foundation.d.ts +61 -0
- package/dist/input/textarea-foundation.js +130 -0
- package/dist/input/textarea.css +257 -0
- package/dist/input/textarea.scss +313 -0
- package/dist/input/util/line-number.d.ts +2 -0
- package/dist/input/util/line-number.js +42 -0
- package/dist/input/util/truncate-value.d.ts +5 -0
- package/dist/input/util/truncate-value.js +14 -0
- package/dist/input/variables.scss +107 -0
- package/dist/input-number/animation.scss +11 -0
- package/dist/input-number/caret.d.ts +4 -0
- package/dist/input-number/caret.js +21 -0
- package/dist/input-number/constants.d.ts +15 -0
- package/dist/input-number/constants.js +13 -0
- package/dist/input-number/foundation.d.ts +110 -0
- package/dist/input-number/foundation.js +557 -0
- package/dist/input-number/input-number.css +84 -0
- package/dist/input-number/input-number.scss +124 -0
- package/dist/input-number/rtl.scss +9 -0
- package/dist/input-number/variables.scss +26 -0
- package/dist/json-viewer/constants.d.ts +3 -0
- package/dist/json-viewer/constants.js +4 -0
- package/dist/json-viewer/foundation.d.ts +42 -0
- package/dist/json-viewer/foundation.js +124 -0
- package/dist/json-viewer/json-viewer.css +183 -0
- package/dist/json-viewer/json-viewer.scss +224 -0
- package/dist/json-viewer/variables.scss +18 -0
- package/dist/layout/constants.d.ts +3 -0
- package/dist/layout/constants.js +4 -0
- package/dist/layout/layout.css +36 -0
- package/dist/layout/layout.scss +51 -0
- package/dist/layout/rtl.scss +7 -0
- package/dist/list/constants.d.ts +3 -0
- package/dist/list/constants.js +4 -0
- package/dist/list/list.css +123 -0
- package/dist/list/list.scss +162 -0
- package/dist/list/rtl.scss +9 -0
- package/dist/list/variables.scss +18 -0
- package/dist/locale/interface.d.ts +663 -0
- package/dist/locale/interface.js +0 -0
- package/dist/locale/resolve-locale.d.ts +6 -0
- package/dist/locale/resolve-locale.js +17 -0
- package/dist/locale/source/ar.d.ts +3 -0
- package/dist/locale/source/ar.js +502 -0
- package/dist/locale/source/az.d.ts +3 -0
- package/dist/locale/source/az.js +502 -0
- package/dist/locale/source/bg.d.ts +3 -0
- package/dist/locale/source/bg.js +502 -0
- package/dist/locale/source/bn_IN.d.ts +3 -0
- package/dist/locale/source/bn_IN.js +502 -0
- package/dist/locale/source/ca.d.ts +3 -0
- package/dist/locale/source/ca.js +502 -0
- package/dist/locale/source/ceb_PH.d.ts +3 -0
- package/dist/locale/source/ceb_PH.js +502 -0
- package/dist/locale/source/cs_CZ.d.ts +3 -0
- package/dist/locale/source/cs_CZ.js +502 -0
- package/dist/locale/source/da.d.ts +3 -0
- package/dist/locale/source/da.js +502 -0
- package/dist/locale/source/de.d.ts +3 -0
- package/dist/locale/source/de.js +502 -0
- package/dist/locale/source/el_GR.d.ts +3 -0
- package/dist/locale/source/el_GR.js +502 -0
- package/dist/locale/source/en_GB.d.ts +3 -0
- package/dist/locale/source/en_GB.js +502 -0
- package/dist/locale/source/en_US.d.ts +3 -0
- package/dist/locale/source/en_US.js +502 -0
- package/dist/locale/source/es.d.ts +3 -0
- package/dist/locale/source/es.js +502 -0
- package/dist/locale/source/es_419.d.ts +3 -0
- package/dist/locale/source/es_419.js +502 -0
- package/dist/locale/source/et.d.ts +3 -0
- package/dist/locale/source/et.js +502 -0
- package/dist/locale/source/fa_IR.d.ts +3 -0
- package/dist/locale/source/fa_IR.js +502 -0
- package/dist/locale/source/fi_FI.d.ts +3 -0
- package/dist/locale/source/fi_FI.js +502 -0
- package/dist/locale/source/fil_PH.d.ts +3 -0
- package/dist/locale/source/fil_PH.js +502 -0
- package/dist/locale/source/fr.d.ts +3 -0
- package/dist/locale/source/fr.js +502 -0
- package/dist/locale/source/fr_CA.d.ts +3 -0
- package/dist/locale/source/fr_CA.js +502 -0
- package/dist/locale/source/ga.d.ts +3 -0
- package/dist/locale/source/ga.js +502 -0
- package/dist/locale/source/he_IL.d.ts +3 -0
- package/dist/locale/source/he_IL.js +502 -0
- package/dist/locale/source/hi_IN.d.ts +3 -0
- package/dist/locale/source/hi_IN.js +502 -0
- package/dist/locale/source/hr.d.ts +3 -0
- package/dist/locale/source/hr.js +502 -0
- package/dist/locale/source/hu_HU.d.ts +3 -0
- package/dist/locale/source/hu_HU.js +502 -0
- package/dist/locale/source/id_ID.d.ts +3 -0
- package/dist/locale/source/id_ID.js +502 -0
- package/dist/locale/source/is.d.ts +3 -0
- package/dist/locale/source/is.js +502 -0
- package/dist/locale/source/it.d.ts +3 -0
- package/dist/locale/source/it.js +502 -0
- package/dist/locale/source/ja_JP.d.ts +3 -0
- package/dist/locale/source/ja_JP.js +502 -0
- package/dist/locale/source/jv_ID.d.ts +3 -0
- package/dist/locale/source/jv_ID.js +502 -0
- package/dist/locale/source/kk.d.ts +3 -0
- package/dist/locale/source/kk.js +502 -0
- package/dist/locale/source/km_KH.d.ts +3 -0
- package/dist/locale/source/km_KH.js +502 -0
- package/dist/locale/source/ko_KR.d.ts +3 -0
- package/dist/locale/source/ko_KR.js +502 -0
- package/dist/locale/source/lt.d.ts +3 -0
- package/dist/locale/source/lt.js +502 -0
- package/dist/locale/source/lv.d.ts +3 -0
- package/dist/locale/source/lv.js +502 -0
- package/dist/locale/source/ms_MY.d.ts +3 -0
- package/dist/locale/source/ms_MY.js +502 -0
- package/dist/locale/source/my_MM.d.ts +3 -0
- package/dist/locale/source/my_MM.js +502 -0
- package/dist/locale/source/nb.d.ts +3 -0
- package/dist/locale/source/nb.js +502 -0
- package/dist/locale/source/nl_NL.d.ts +3 -0
- package/dist/locale/source/nl_NL.js +502 -0
- package/dist/locale/source/pl_PL.d.ts +3 -0
- package/dist/locale/source/pl_PL.js +502 -0
- package/dist/locale/source/pt.d.ts +3 -0
- package/dist/locale/source/pt.js +502 -0
- package/dist/locale/source/pt_BR.d.ts +3 -0
- package/dist/locale/source/pt_BR.js +502 -0
- package/dist/locale/source/ro.d.ts +3 -0
- package/dist/locale/source/ro.js +502 -0
- package/dist/locale/source/ru_RU.d.ts +3 -0
- package/dist/locale/source/ru_RU.js +502 -0
- package/dist/locale/source/sk.d.ts +3 -0
- package/dist/locale/source/sk.js +502 -0
- package/dist/locale/source/sl.d.ts +3 -0
- package/dist/locale/source/sl.js +502 -0
- package/dist/locale/source/sq.d.ts +3 -0
- package/dist/locale/source/sq.js +502 -0
- package/dist/locale/source/sv_SE.d.ts +3 -0
- package/dist/locale/source/sv_SE.js +502 -0
- package/dist/locale/source/sw.d.ts +3 -0
- package/dist/locale/source/sw.js +502 -0
- package/dist/locale/source/th_TH.d.ts +3 -0
- package/dist/locale/source/th_TH.js +502 -0
- package/dist/locale/source/tr_TR.d.ts +3 -0
- package/dist/locale/source/tr_TR.js +502 -0
- package/dist/locale/source/uk_UA.d.ts +3 -0
- package/dist/locale/source/uk_UA.js +502 -0
- package/dist/locale/source/ur.d.ts +3 -0
- package/dist/locale/source/ur.js +502 -0
- package/dist/locale/source/uz.d.ts +3 -0
- package/dist/locale/source/uz.js +502 -0
- package/dist/locale/source/vi_VN.d.ts +3 -0
- package/dist/locale/source/vi_VN.js +502 -0
- package/dist/locale/source/zh_CN.d.ts +3 -0
- package/dist/locale/source/zh_CN.js +502 -0
- package/dist/locale/source/zh_TW.d.ts +3 -0
- package/dist/locale/source/zh_TW.js +502 -0
- package/dist/lottie/constants.d.ts +3 -0
- package/dist/lottie/constants.js +4 -0
- package/dist/lottie/foundation.d.ts +24 -0
- package/dist/lottie/foundation.js +62 -0
- package/dist/markdown-render/constants.d.ts +3 -0
- package/dist/markdown-render/constants.js +4 -0
- package/dist/markdown-render/foundation.d.ts +50 -0
- package/dist/markdown-render/foundation.js +101 -0
- package/dist/markdown-render/markdown-render.css +59 -0
- package/dist/markdown-render/markdown-render.scss +79 -0
- package/dist/markdown-render/variables.scss +31 -0
- package/dist/modal/animation.scss +25 -0
- package/dist/modal/confirm.d.ts +13 -0
- package/dist/modal/confirm.js +34 -0
- package/dist/modal/constants.d.ts +3 -0
- package/dist/modal/constants.js +4 -0
- package/dist/modal/modal-content-foundation.d.ts +40 -0
- package/dist/modal/modal-content-foundation.js +48 -0
- package/dist/modal/modal-foundation.d.ts +85 -0
- package/dist/modal/modal-foundation.js +74 -0
- package/dist/modal/modal.css +235 -0
- package/dist/modal/modal.scss +285 -0
- package/dist/modal/rtl.scss +10 -0
- package/dist/modal/variables.scss +70 -0
- package/dist/navigation/animation.scss +5 -0
- package/dist/navigation/constants.d.ts +17 -0
- package/dist/navigation/constants.js +20 -0
- package/dist/navigation/foundation.d.ts +75 -0
- package/dist/navigation/foundation.js +158 -0
- package/dist/navigation/item-foundation.d.ts +44 -0
- package/dist/navigation/item-foundation.js +42 -0
- package/dist/navigation/mixin.scss +100 -0
- package/dist/navigation/navigation.css +779 -0
- package/dist/navigation/navigation.scss +764 -0
- package/dist/navigation/rtl.scss +17 -0
- package/dist/navigation/sub-nav-foundation.d.ts +31 -0
- package/dist/navigation/sub-nav-foundation.js +54 -0
- package/dist/navigation/variables.scss +120 -0
- package/dist/notification/animation.scss +12 -0
- package/dist/notification/constants.d.ts +19 -0
- package/dist/notification/constants.js +32 -0
- package/dist/notification/notification-foundation.d.ts +33 -0
- package/dist/notification/notification-foundation.js +5 -0
- package/dist/notification/notification-list-foundation.d.ts +56 -0
- package/dist/notification/notification-list-foundation.js +49 -0
- package/dist/notification/notification.css +398 -0
- package/dist/notification/notification.scss +428 -0
- package/dist/notification/rtl.scss +9 -0
- package/dist/notification/variables.scss +41 -0
- package/dist/overflow-list/constants.d.ts +17 -0
- package/dist/overflow-list/constants.js +16 -0
- package/dist/overflow-list/foundation.d.ts +78 -0
- package/dist/overflow-list/foundation.js +189 -0
- package/dist/overflow-list/overflow-list.css +19 -0
- package/dist/overflow-list/overflow-list.scss +24 -0
- package/dist/overflow-list/rtl.scss +7 -0
- package/dist/pagination/animation.scss +11 -0
- package/dist/pagination/constants.d.ts +8 -0
- package/dist/pagination/constants.js +14 -0
- package/dist/pagination/foundation.d.ts +61 -0
- package/dist/pagination/foundation.js +175 -0
- package/dist/pagination/pagination.css +192 -0
- package/dist/pagination/pagination.scss +189 -0
- package/dist/pagination/rtl.scss +14 -0
- package/dist/pagination/variables.scss +45 -0
- package/dist/pincode/constants.d.ts +3 -0
- package/dist/pincode/constants.js +4 -0
- package/dist/pincode/foundation.d.ts +39 -0
- package/dist/pincode/foundation.js +86 -0
- package/dist/pincode/pincode.css +30 -0
- package/dist/pincode/pincode.scss +47 -0
- package/dist/pincode/variables.scss +9 -0
- package/dist/popconfirm/constants.d.ts +7 -0
- package/dist/popconfirm/constants.js +8 -0
- package/dist/popconfirm/popconfirm-foundation.d.ts +38 -0
- package/dist/popconfirm/popconfirm-foundation.js +57 -0
- package/dist/popconfirm/popconfirm.css +69 -0
- package/dist/popconfirm/popconfirm.scss +84 -0
- package/dist/popconfirm/rtl.scss +12 -0
- package/dist/popconfirm/variables.scss +26 -0
- package/dist/popover/animation.scss +5 -0
- package/dist/popover/constants.d.ts +21 -0
- package/dist/popover/constants.js +47 -0
- package/dist/popover/popover.css +212 -0
- package/dist/popover/popover.scss +64 -0
- package/dist/popover/rtl.scss +9 -0
- package/dist/popover/variables.scss +25 -0
- package/dist/progress/constants.d.ts +7 -0
- package/dist/progress/constants.js +8 -0
- package/dist/progress/generates.d.ts +11 -0
- package/dist/progress/generates.js +27 -0
- package/dist/progress/progress.css +142 -0
- package/dist/progress/progress.scss +170 -0
- package/dist/progress/rtl.scss +13 -0
- package/dist/progress/utils.d.ts +18 -0
- package/dist/progress/utils.js +45 -0
- package/dist/progress/variables.scss +26 -0
- package/dist/radio/animation.scss +9 -0
- package/dist/radio/constants.d.ts +16 -0
- package/dist/radio/constants.js +19 -0
- package/dist/radio/mixin.scss +3 -0
- package/dist/radio/radio-foundation.d.ts +78 -0
- package/dist/radio/radio-foundation.js +94 -0
- package/dist/radio/radio-group-foundation.d.ts +18 -0
- package/dist/radio/radio-group-foundation.js +27 -0
- package/dist/radio/radio.css +332 -0
- package/dist/radio/radio.scss +457 -0
- package/dist/radio/rtl.scss +11 -0
- package/dist/radio/variables.scss +107 -0
- package/dist/rating/animation.scss +7 -0
- package/dist/rating/constants.d.ts +6 -0
- package/dist/rating/constants.js +5 -0
- package/dist/rating/foundation.d.ts +109 -0
- package/dist/rating/foundation.js +167 -0
- package/dist/rating/rating.css +89 -0
- package/dist/rating/rating.scss +119 -0
- package/dist/rating/rtl.scss +9 -0
- package/dist/rating/variables.scss +19 -0
- package/dist/resizable/constants.d.ts +3 -0
- package/dist/resizable/constants.js +4 -0
- package/dist/resizable/foundation.d.ts +3 -0
- package/dist/resizable/foundation.js +3 -0
- package/dist/resizable/group/index.d.ts +55 -0
- package/dist/resizable/group/index.js +313 -0
- package/dist/resizable/resizable.css +125 -0
- package/dist/resizable/resizable.scss +147 -0
- package/dist/resizable/single/index.d.ts +90 -0
- package/dist/resizable/single/index.js +429 -0
- package/dist/resizable/types.d.ts +43 -0
- package/dist/resizable/types.js +18 -0
- package/dist/resizable/utils.d.ts +23 -0
- package/dist/resizable/utils.js +53 -0
- package/dist/resizable/variables.scss +10 -0
- package/dist/scroll-list/animation.scss +5 -0
- package/dist/scroll-list/constants.d.ts +8 -0
- package/dist/scroll-list/constants.js +11 -0
- package/dist/scroll-list/item-foundation.d.ts +56 -0
- package/dist/scroll-list/item-foundation.js +336 -0
- package/dist/scroll-list/rtl.scss +9 -0
- package/dist/scroll-list/scroll-list.css +178 -0
- package/dist/scroll-list/scroll-list.scss +198 -0
- package/dist/scroll-list/scroll-to.d.ts +2 -0
- package/dist/scroll-list/scroll-to.js +15 -0
- package/dist/scroll-list/variables.scss +50 -0
- package/dist/select/animation.scss +16 -0
- package/dist/select/combobox-name.d.ts +10 -0
- package/dist/select/combobox-name.js +21 -0
- package/dist/select/constants.d.ts +15 -0
- package/dist/select/constants.js +22 -0
- package/dist/select/foundation.d.ts +140 -0
- package/dist/select/foundation.js +775 -0
- package/dist/select/mixin.scss +8 -0
- package/dist/select/option-foundation.d.ts +51 -0
- package/dist/select/option-foundation.js +44 -0
- package/dist/select/option.scss +86 -0
- package/dist/select/rtl.scss +10 -0
- package/dist/select/select.css +533 -0
- package/dist/select/select.scss +554 -0
- package/dist/select/variables.scss +128 -0
- package/dist/side-sheet/animation.scss +17 -0
- package/dist/side-sheet/constants.d.ts +6 -0
- package/dist/side-sheet/constants.js +5 -0
- package/dist/side-sheet/rtl.scss +9 -0
- package/dist/side-sheet/side-sheet-foundation.d.ts +69 -0
- package/dist/side-sheet/side-sheet-foundation.js +54 -0
- package/dist/side-sheet/side-sheet.css +285 -0
- package/dist/side-sheet/side-sheet.scss +356 -0
- package/dist/side-sheet/variables.scss +27 -0
- package/dist/skeleton/animation.scss +4 -0
- package/dist/skeleton/constants.d.ts +3 -0
- package/dist/skeleton/constants.js +4 -0
- package/dist/skeleton/rtl.scss +9 -0
- package/dist/skeleton/skeleton.css +84 -0
- package/dist/skeleton/skeleton.scss +115 -0
- package/dist/skeleton/variables.scss +21 -0
- package/dist/slider/animation.scss +7 -0
- package/dist/slider/constants.d.ts +9 -0
- package/dist/slider/constants.js +12 -0
- package/dist/slider/foundation.d.ts +167 -0
- package/dist/slider/foundation.js +441 -0
- package/dist/slider/rtl.scss +23 -0
- package/dist/slider/slider.css +239 -0
- package/dist/slider/slider.scss +269 -0
- package/dist/slider/variables.scss +67 -0
- package/dist/sortable/accessibility.d.ts +14 -0
- package/dist/sortable/accessibility.js +45 -0
- package/dist/space/constants.d.ts +8 -0
- package/dist/space/constants.js +9 -0
- package/dist/space/rtl.scss +8 -0
- package/dist/space/space.css +46 -0
- package/dist/space/space.scss +65 -0
- package/dist/space/variables.scss +5 -0
- package/dist/spin/animation.scss +4 -0
- package/dist/spin/constants.d.ts +3 -0
- package/dist/spin/constants.js +3 -0
- package/dist/spin/foundation.d.ts +20 -0
- package/dist/spin/foundation.js +43 -0
- package/dist/spin/mixin.scss +7 -0
- package/dist/spin/rtl.scss +11 -0
- package/dist/spin/spin.css +97 -0
- package/dist/spin/spin.scss +111 -0
- package/dist/spin/variables.scss +11 -0
- package/dist/steps/animation.scss +15 -0
- package/dist/steps/bacis-steps.scss +338 -0
- package/dist/steps/constants.d.ts +5 -0
- package/dist/steps/constants.js +8 -0
- package/dist/steps/fill-steps.scss +179 -0
- package/dist/steps/mixin.scss +3 -0
- package/dist/steps/nav-steps.scss +66 -0
- package/dist/steps/rtl.scss +14 -0
- package/dist/steps/steps.css +523 -0
- package/dist/steps/steps.scss +17 -0
- package/dist/steps/utils.d.ts +10 -0
- package/dist/steps/utils.js +15 -0
- package/dist/steps/variables.scss +95 -0
- package/dist/switch/animation.scss +5 -0
- package/dist/switch/constants.d.ts +13 -0
- package/dist/switch/constants.js +16 -0
- package/dist/switch/foundation.d.ts +24 -0
- package/dist/switch/foundation.js +19 -0
- package/dist/switch/rtl.scss +98 -0
- package/dist/switch/switch.css +293 -0
- package/dist/switch/switch.scss +317 -0
- package/dist/switch/variables.scss +75 -0
- package/dist/table/animation.scss +7 -0
- package/dist/table/constants.d.ts +62 -0
- package/dist/table/constants.js +97 -0
- package/dist/table/foundation.d.ts +354 -0
- package/dist/table/foundation.js +870 -0
- package/dist/table/mixin.scss +12 -0
- package/dist/table/operation-panel.scss +42 -0
- package/dist/table/rtl.scss +24 -0
- package/dist/table/table.css +636 -0
- package/dist/table/table.scss +789 -0
- package/dist/table/utils.d.ts +187 -0
- package/dist/table/utils.js +482 -0
- package/dist/table/variables.scss +85 -0
- package/dist/tabs/animation.scss +30 -0
- package/dist/tabs/constants.d.ts +28 -0
- package/dist/tabs/constants.js +37 -0
- package/dist/tabs/foundation.d.ts +91 -0
- package/dist/tabs/foundation.js +189 -0
- package/dist/tabs/rtl.scss +16 -0
- package/dist/tabs/tabs.css +699 -0
- package/dist/tabs/tabs.scss +933 -0
- package/dist/tabs/variables.scss +155 -0
- package/dist/tag/constants.d.ts +8 -0
- package/dist/tag/constants.js +35 -0
- package/dist/tag/focus.d.ts +6 -0
- package/dist/tag/focus.js +23 -0
- package/dist/tag/mixin.scss +18 -0
- package/dist/tag/rtl.scss +12 -0
- package/dist/tag/tag-key.d.ts +9 -0
- package/dist/tag/tag-key.js +18 -0
- package/dist/tag/tag.css +537 -0
- package/dist/tag/tag.scss +359 -0
- package/dist/tag/variables.scss +85 -0
- package/dist/tag-input/animation.scss +9 -0
- package/dist/tag-input/constants.d.ts +6 -0
- package/dist/tag-input/constants.js +9 -0
- package/dist/tag-input/foundation.d.ts +91 -0
- package/dist/tag-input/foundation.js +222 -0
- package/dist/tag-input/rtl.scss +9 -0
- package/dist/tag-input/tag-input.css +297 -0
- package/dist/tag-input/tag-input.scss +358 -0
- package/dist/tag-input/utils/get-splited-array.d.ts +4 -0
- package/dist/tag-input/utils/get-splited-array.js +16 -0
- package/dist/tag-input/utils/tag-focus.d.ts +3 -0
- package/dist/tag-input/utils/tag-focus.js +15 -0
- package/dist/tag-input/variables.scss +57 -0
- package/dist/theme/_font.scss +49 -0
- package/dist/theme/_palette.scss +474 -0
- package/dist/theme/animation.scss +40 -0
- package/dist/theme/global.scss +287 -0
- package/dist/theme/index.scss +3 -0
- package/dist/theme/mixin.scss +66 -0
- package/dist/theme/variables.scss +56 -0
- package/dist/time-picker/combox-foundation.d.ts +79 -0
- package/dist/time-picker/combox-foundation.js +103 -0
- package/dist/time-picker/constants.d.ts +18 -0
- package/dist/time-picker/constants.js +23 -0
- package/dist/time-picker/foundation.d.ts +108 -0
- package/dist/time-picker/foundation.js +254 -0
- package/dist/time-picker/input-foundation.d.ts +15 -0
- package/dist/time-picker/input-foundation.js +33 -0
- package/dist/time-picker/rtl.scss +10 -0
- package/dist/time-picker/time-picker.css +82 -0
- package/dist/time-picker/time-picker.scss +128 -0
- package/dist/time-picker/utils/index.d.ts +18 -0
- package/dist/time-picker/utils/index.js +68 -0
- package/dist/time-picker/variables.scss +19 -0
- package/dist/timeline/constants.d.ts +4 -0
- package/dist/timeline/constants.js +7 -0
- package/dist/timeline/rtl.scss +13 -0
- package/dist/timeline/timeline.css +137 -0
- package/dist/timeline/timeline.scss +190 -0
- package/dist/timeline/utils.d.ts +3 -0
- package/dist/timeline/utils.js +10 -0
- package/dist/timeline/variables.scss +48 -0
- package/dist/toast/animation.scss +16 -0
- package/dist/toast/constants.d.ts +25 -0
- package/dist/toast/constants.js +34 -0
- package/dist/toast/rtl.scss +9 -0
- package/dist/toast/toast-foundation.d.ts +37 -0
- package/dist/toast/toast-foundation.js +5 -0
- package/dist/toast/toast-list-foundation.d.ts +25 -0
- package/dist/toast/toast-list-foundation.js +54 -0
- package/dist/toast/toast.css +174 -0
- package/dist/toast/toast.scss +238 -0
- package/dist/toast/variables.scss +45 -0
- package/dist/tooltip/adjust-position.d.ts +41 -0
- package/dist/tooltip/adjust-position.js +202 -0
- package/dist/tooltip/animation.scss +4 -0
- package/dist/tooltip/arrow.scss +178 -0
- package/dist/tooltip/constants.d.ts +50 -0
- package/dist/tooltip/constants.js +96 -0
- package/dist/tooltip/foundation.d.ts +105 -0
- package/dist/tooltip/foundation.js +650 -0
- package/dist/tooltip/position.scss +63 -0
- package/dist/tooltip/rtl.scss +9 -0
- package/dist/tooltip/tooltip.css +229 -0
- package/dist/tooltip/tooltip.scss +72 -0
- package/dist/tooltip/variables.scss +34 -0
- package/dist/transfer/animation.scss +5 -0
- package/dist/transfer/constants.d.ts +11 -0
- package/dist/transfer/constants.js +10 -0
- package/dist/transfer/foundation.d.ts +112 -0
- package/dist/transfer/foundation.js +179 -0
- package/dist/transfer/rtl.scss +9 -0
- package/dist/transfer/transfer-utils.d.ts +5 -0
- package/dist/transfer/transfer-utils.js +45 -0
- package/dist/transfer/transfer.css +237 -0
- package/dist/transfer/transfer.scss +260 -0
- package/dist/transfer/variables.scss +50 -0
- package/dist/tree/animation.scss +7 -0
- package/dist/tree/constants.d.ts +7 -0
- package/dist/tree/constants.js +8 -0
- package/dist/tree/foundation.d.ts +296 -0
- package/dist/tree/foundation.js +539 -0
- package/dist/tree/rtl.scss +16 -0
- package/dist/tree/shared.d.ts +128 -0
- package/dist/tree/shared.js +308 -0
- package/dist/tree/tree-util.d.ts +105 -0
- package/dist/tree/tree-util.js +455 -0
- package/dist/tree/tree.css +387 -0
- package/dist/tree/tree.scss +439 -0
- package/dist/tree/variables.scss +39 -0
- package/dist/tree-select/constants.d.ts +11 -0
- package/dist/tree-select/constants.js +19 -0
- package/dist/tree-select/foundation.d.ts +176 -0
- package/dist/tree-select/foundation.js +610 -0
- package/dist/tree-select/rtl.scss +9 -0
- package/dist/tree-select/tree-select.css +376 -0
- package/dist/tree-select/tree-select.scss +467 -0
- package/dist/tree-select/variables.scss +90 -0
- package/dist/typography/constants.d.ts +12 -0
- package/dist/typography/constants.js +50 -0
- package/dist/typography/ellipsis.d.ts +36 -0
- package/dist/typography/ellipsis.js +156 -0
- package/dist/typography/format-numeral.d.ts +10 -0
- package/dist/typography/format-numeral.js +99 -0
- package/dist/typography/rtl.scss +13 -0
- package/dist/typography/typography.css +380 -0
- package/dist/typography/typography.scss +384 -0
- package/dist/typography/variables.scss +94 -0
- package/dist/upload/constants.d.ts +24 -0
- package/dist/upload/constants.js +39 -0
- package/dist/upload/foundation.d.ts +187 -0
- package/dist/upload/foundation.js +762 -0
- package/dist/upload/rtl.scss +13 -0
- package/dist/upload/upload.css +599 -0
- package/dist/upload/upload.scss +640 -0
- package/dist/upload/utils.d.ts +25 -0
- package/dist/upload/utils.js +98 -0
- package/dist/upload/variables.scss +89 -0
- package/dist/user-guide/animation.scss +4 -0
- package/dist/user-guide/constants.d.ts +9 -0
- package/dist/user-guide/constants.js +12 -0
- package/dist/user-guide/foundation.d.ts +47 -0
- package/dist/user-guide/foundation.js +73 -0
- package/dist/user-guide/user-guide.css +120 -0
- package/dist/user-guide/user-guide.scss +151 -0
- package/dist/user-guide/variables.scss +40 -0
- package/dist/utils/a11y.d.ts +99 -0
- package/dist/utils/a11y.js +168 -0
- package/dist/utils/animated-height.d.ts +8 -0
- package/dist/utils/animated-height.js +28 -0
- package/dist/utils/announcer.d.ts +35 -0
- package/dist/utils/announcer.js +54 -0
- package/dist/utils/array-move.d.ts +1 -0
- package/dist/utils/array-move.js +5 -0
- package/dist/utils/array.d.ts +10 -0
- package/dist/utils/array.js +21 -0
- package/dist/utils/classnames.d.ts +2 -0
- package/dist/utils/classnames.js +10 -0
- package/dist/utils/clipboard.d.ts +1 -0
- package/dist/utils/clipboard.js +5 -0
- package/dist/utils/date-fns-extra.d.ts +38 -0
- package/dist/utils/date-fns-extra.js +105 -0
- package/dist/utils/dom.d.ts +31 -0
- package/dist/utils/dom.js +53 -0
- package/dist/utils/escape-html.d.ts +9 -0
- package/dist/utils/escape-html.js +67 -0
- package/dist/utils/event.d.ts +9 -0
- package/dist/utils/event.js +36 -0
- package/dist/utils/field-sizing.d.ts +15 -0
- package/dist/utils/field-sizing.js +52 -0
- package/dist/utils/focus-handle.d.ts +44 -0
- package/dist/utils/focus-handle.js +93 -0
- package/dist/utils/focus-handover.d.ts +11 -0
- package/dist/utils/focus-handover.js +22 -0
- package/dist/utils/focus-scope.d.ts +25 -0
- package/dist/utils/focus-scope.js +78 -0
- package/dist/utils/function.d.ts +1 -0
- package/dist/utils/function.js +3 -0
- package/dist/utils/get-data-attr.d.ts +3 -0
- package/dist/utils/get-data-attr.js +5 -0
- package/dist/utils/is-element.d.ts +1 -0
- package/dist/utils/is-element.js +5 -0
- package/dist/utils/is-enter-press.d.ts +3 -0
- package/dist/utils/is-enter-press.js +6 -0
- package/dist/utils/is-object.d.ts +1 -0
- package/dist/utils/is-object.js +5 -0
- package/dist/utils/is-promise.d.ts +1 -0
- package/dist/utils/is-promise.js +6 -0
- package/dist/utils/is-valid-time-zone.d.ts +1 -0
- package/dist/utils/is-valid-time-zone.js +5 -0
- package/dist/utils/key-code.d.ts +12 -0
- package/dist/utils/key-code.js +11 -0
- package/dist/utils/layer.d.ts +25 -0
- package/dist/utils/layer.js +73 -0
- package/dist/utils/object.d.ts +10 -0
- package/dist/utils/object.js +66 -0
- package/dist/utils/pointer.d.ts +1 -0
- package/dist/utils/pointer.js +5 -0
- package/dist/utils/release-holder.d.ts +9 -0
- package/dist/utils/release-holder.js +18 -0
- package/dist/utils/scroll-lock.d.ts +7 -0
- package/dist/utils/scroll-lock.js +38 -0
- package/dist/utils/shallow-equal-objects.d.ts +5 -0
- package/dist/utils/shallow-equal-objects.js +8 -0
- package/dist/utils/supports.d.ts +18 -0
- package/dist/utils/supports.js +93 -0
- package/dist/utils/tween.d.ts +14 -0
- package/dist/utils/tween.js +16 -0
- package/dist/utils/type.d.ts +2 -0
- package/dist/utils/type.js +0 -0
- package/dist/utils/uuid.d.ts +2 -0
- package/dist/utils/uuid.js +7 -0
- package/dist/utils/warning.d.ts +8 -0
- package/dist/utils/warning.js +14 -0
- package/dist/video-player/animation.scss +7 -0
- package/dist/video-player/constants.d.ts +27 -0
- package/dist/video-player/constants.js +48 -0
- package/dist/video-player/foundation.d.ts +94 -0
- package/dist/video-player/foundation.js +287 -0
- package/dist/video-player/progress-foundation.d.ts +80 -0
- package/dist/video-player/progress-foundation.js +117 -0
- package/dist/video-player/utils.d.ts +24 -0
- package/dist/video-player/utils.js +50 -0
- package/dist/video-player/variables.scss +69 -0
- package/dist/video-player/video-player.css +282 -0
- package/dist/video-player/video-player.scss +344 -0
- package/package.json +53 -3
|
@@ -0,0 +1,836 @@
|
|
|
1
|
+
import BaseFoundation from "../base/foundation.js";
|
|
2
|
+
import isPromise from "../utils/is-promise.js";
|
|
3
|
+
import { cssClasses } from "./constants.js";
|
|
4
|
+
import { get as get$1, has as has$1, isEmpty, remove, set as set$1 } from "../utils/object.js";
|
|
5
|
+
import { generateValidatesFromRules, isValid, nextUpdateKey } from "./utils.js";
|
|
6
|
+
import { isPlainObject } from "es-toolkit";
|
|
7
|
+
import scrollIntoView from "scroll-into-view-if-needed";
|
|
8
|
+
import { toPath } from "es-toolkit/compat";
|
|
9
|
+
// src/form/foundation.ts
|
|
10
|
+
const SILENT = {
|
|
11
|
+
skipNotify: true,
|
|
12
|
+
skipRender: true
|
|
13
|
+
};
|
|
14
|
+
const prefix = cssClasses.PREFIX;
|
|
15
|
+
const ERROR_SELECTOR = `.${prefix}-field-error-message`;
|
|
16
|
+
const errorField = (errorDOM) => errorDOM.closest(`.${prefix}-field, .${prefix}-field-group`);
|
|
17
|
+
const scrollIntoView$1 = scrollIntoView;
|
|
18
|
+
function isFormValidatorPassed(result) {
|
|
19
|
+
if (!result) return true;
|
|
20
|
+
return Object.getPrototypeOf(result) === Object.prototype && Object.keys(result).length === 0;
|
|
21
|
+
}
|
|
22
|
+
/** Whether `path` is `ancestor` or a path under it, compared by segment: `a[1]` is under `a`, `ab` is not */
|
|
23
|
+
function isPathWithin(path, ancestor) {
|
|
24
|
+
const segments = toPath(path);
|
|
25
|
+
return toPath(ancestor).every((segment, i) => segment === segments[i]);
|
|
26
|
+
}
|
|
27
|
+
var FormFoundation = class extends BaseFoundation {
|
|
28
|
+
#data;
|
|
29
|
+
#batchDepth = 0;
|
|
30
|
+
#pendingFields = /* @__PURE__ */ new Set();
|
|
31
|
+
#fields;
|
|
32
|
+
#registered;
|
|
33
|
+
#registeredArrayField;
|
|
34
|
+
#validations = /* @__PURE__ */ new Map();
|
|
35
|
+
#destroyed = false;
|
|
36
|
+
#epoch = 0;
|
|
37
|
+
#formValidation = 0;
|
|
38
|
+
#unregisterNotifyPending = false;
|
|
39
|
+
constructor(adapter) {
|
|
40
|
+
super(adapter);
|
|
41
|
+
let { initValues } = this._adapter.getProps();
|
|
42
|
+
initValues = this._adapter.cloneDeep(initValues);
|
|
43
|
+
this.#data = {
|
|
44
|
+
values: initValues ? initValues : {},
|
|
45
|
+
errors: {},
|
|
46
|
+
touched: {}
|
|
47
|
+
};
|
|
48
|
+
this.#fields = /* @__PURE__ */ new Map();
|
|
49
|
+
this.#registered = {};
|
|
50
|
+
this.#registeredArrayField = /* @__PURE__ */ new Map();
|
|
51
|
+
}
|
|
52
|
+
#forceUpdate(callback) {
|
|
53
|
+
this._adapter.forceUpdate(this.getFormState(), callback);
|
|
54
|
+
}
|
|
55
|
+
#updateField(store, snapshot) {
|
|
56
|
+
if (!store.update(snapshot)) return;
|
|
57
|
+
if (this.#batchDepth) this.#pendingFields.add(store);
|
|
58
|
+
else store.notify();
|
|
59
|
+
}
|
|
60
|
+
#batch(run) {
|
|
61
|
+
this.#batchDepth += 1;
|
|
62
|
+
try {
|
|
63
|
+
run();
|
|
64
|
+
} finally {
|
|
65
|
+
this.#batchDepth -= 1;
|
|
66
|
+
if (!this.#batchDepth) {
|
|
67
|
+
const pending = [...this.#pendingFields];
|
|
68
|
+
this.#pendingFields.clear();
|
|
69
|
+
pending.forEach((store) => store.notify());
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
#clearFormErrors() {
|
|
74
|
+
const prevErrors = this.#data.errors;
|
|
75
|
+
this.#data = {
|
|
76
|
+
...this.#data,
|
|
77
|
+
errors: {}
|
|
78
|
+
};
|
|
79
|
+
this.#injectErrorToField({});
|
|
80
|
+
this._adapter.notifyChange(this.#data);
|
|
81
|
+
this.#notifyErrorChange(prevErrors, this.#fields.keys());
|
|
82
|
+
this.#forceUpdate();
|
|
83
|
+
}
|
|
84
|
+
#setFormErrors(errors) {
|
|
85
|
+
const formErrors = isPlainObject(errors) ? errors : {};
|
|
86
|
+
const prevErrors = this.#data.errors;
|
|
87
|
+
this.#data = {
|
|
88
|
+
...this.#data,
|
|
89
|
+
errors: formErrors
|
|
90
|
+
};
|
|
91
|
+
this.#injectErrorToField(formErrors);
|
|
92
|
+
this._adapter.notifyChange(this.#data);
|
|
93
|
+
this.#notifyErrorChange(prevErrors, this.#fields.keys());
|
|
94
|
+
this.#forceUpdate(() => this.#autoScroll());
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Reports the errors a batch operation changed in one onErrorChange: the operation writes each field's error with
|
|
98
|
+
* skipNotify, then compares those fields' errors with the ones before it
|
|
99
|
+
*/
|
|
100
|
+
#notifyErrorChange(prevErrors, fieldPaths) {
|
|
101
|
+
const changedError = {};
|
|
102
|
+
for (const path of fieldPaths) {
|
|
103
|
+
const error = get$1(this.#data.errors, path);
|
|
104
|
+
if (error !== get$1(prevErrors, path)) changedError[path] = error;
|
|
105
|
+
}
|
|
106
|
+
if (Object.keys(changedError).length) this._adapter.notifyErrorChange(this.#data.errors, changedError);
|
|
107
|
+
}
|
|
108
|
+
#isCancelled(epoch) {
|
|
109
|
+
return this.#destroyed || epoch !== this.#epoch;
|
|
110
|
+
}
|
|
111
|
+
#cancelError() {
|
|
112
|
+
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");
|
|
113
|
+
}
|
|
114
|
+
#formValidate(silent = false) {
|
|
115
|
+
const { validator } = this.getProps();
|
|
116
|
+
const epoch = this.#epoch;
|
|
117
|
+
const validation = silent ? void 0 : ++this.#formValidation;
|
|
118
|
+
const writes = () => validation === this.#formValidation;
|
|
119
|
+
return new Promise((resolve, reject) => {
|
|
120
|
+
const pass = () => {
|
|
121
|
+
resolve(this._adapter.cloneDeep(this.#data.values));
|
|
122
|
+
if (writes()) this.#clearFormErrors();
|
|
123
|
+
};
|
|
124
|
+
const fail = (errors) => {
|
|
125
|
+
if (writes()) this.#setFormErrors(errors);
|
|
126
|
+
reject(errors);
|
|
127
|
+
};
|
|
128
|
+
let maybePromisedErrors;
|
|
129
|
+
try {
|
|
130
|
+
maybePromisedErrors = validator(this.#data.values);
|
|
131
|
+
} catch (errors) {
|
|
132
|
+
maybePromisedErrors = errors;
|
|
133
|
+
}
|
|
134
|
+
if (isFormValidatorPassed(maybePromisedErrors)) pass();
|
|
135
|
+
else if (isPromise(maybePromisedErrors)) maybePromisedErrors.then((result) => {
|
|
136
|
+
if (this.#isCancelled(epoch)) reject(this.#cancelError());
|
|
137
|
+
else if (isFormValidatorPassed(result)) pass();
|
|
138
|
+
else fail(result);
|
|
139
|
+
}, (errors) => {
|
|
140
|
+
if (this.#isCancelled(epoch)) {
|
|
141
|
+
reject(this.#cancelError());
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (writes()) this.#autoScroll();
|
|
145
|
+
reject(errors);
|
|
146
|
+
});
|
|
147
|
+
else fail(maybePromisedErrors);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
#fieldsValidate(fieldPaths, silent = false) {
|
|
151
|
+
return new Promise((resolve, reject) => {
|
|
152
|
+
let promiseSet = [];
|
|
153
|
+
const targetFields = this.#getOperateFieldMap(fieldPaths);
|
|
154
|
+
const paths = [...targetFields.keys()];
|
|
155
|
+
const epoch = this.#epoch;
|
|
156
|
+
const prevErrors = this.#data.errors;
|
|
157
|
+
targetFields.forEach((field, fieldPath) => {
|
|
158
|
+
const fieldValue = this.#getValue(fieldPath);
|
|
159
|
+
const opts = {
|
|
160
|
+
skipNotify: true,
|
|
161
|
+
skipRender: true,
|
|
162
|
+
silent
|
|
163
|
+
};
|
|
164
|
+
const validateResult = this.#validateField(field, fieldValue, opts);
|
|
165
|
+
promiseSet.push(validateResult);
|
|
166
|
+
if (!silent) this.#setFieldTouched(field, true, {
|
|
167
|
+
skipNotify: true,
|
|
168
|
+
skipRender: true
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
Promise.all(promiseSet).then((results) => {
|
|
172
|
+
if (this.#isCancelled(epoch)) {
|
|
173
|
+
reject(this.#cancelError());
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
let errors = this.#getError();
|
|
177
|
+
let valid = paths.every((path, i) => results[i] === null ? isValid(get$1(errors, path)) : results[i] === void 0);
|
|
178
|
+
if (silent) {
|
|
179
|
+
errors = {};
|
|
180
|
+
paths.forEach((fieldPath, i) => {
|
|
181
|
+
if (results[i] != null) errors = set$1(errors, fieldPath, results[i]);
|
|
182
|
+
});
|
|
183
|
+
valid = isEmpty(errors);
|
|
184
|
+
}
|
|
185
|
+
if (!silent) {
|
|
186
|
+
this._adapter.notifyChange(this.#data);
|
|
187
|
+
this.#notifyErrorChange(prevErrors, paths);
|
|
188
|
+
this.#forceUpdate(valid ? void 0 : () => this.#autoScroll());
|
|
189
|
+
}
|
|
190
|
+
if (valid) resolve(this._adapter.cloneDeep(this.#data.values));
|
|
191
|
+
else reject(errors);
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Case A:
|
|
197
|
+
* All fields: a[0]、a[1]、b.type、b.name[2]、b.name[0]
|
|
198
|
+
* input => output:
|
|
199
|
+
* a => a[0]、a[1]
|
|
200
|
+
* b => b.type、b.name[0]、b.name[2]
|
|
201
|
+
*
|
|
202
|
+
* Case B:
|
|
203
|
+
* All fields: activity.a[0]、activity.a[1]、activity.c、activity.d、other
|
|
204
|
+
* input => output:
|
|
205
|
+
* activity.a => activity.a[0]、activity.a[1]
|
|
206
|
+
*
|
|
207
|
+
*/
|
|
208
|
+
#getNestedField(path) {
|
|
209
|
+
const allRegisterField = this.#fields;
|
|
210
|
+
const allFieldPath = [...allRegisterField].map((item) => item[0]);
|
|
211
|
+
let nestedFieldPath = /* @__PURE__ */ new Map();
|
|
212
|
+
allFieldPath.forEach((item) => {
|
|
213
|
+
let itemPath = toPath(item);
|
|
214
|
+
let targetPath = toPath(path);
|
|
215
|
+
if (targetPath.every((_path, i) => targetPath[i] === itemPath[i])) {
|
|
216
|
+
const realField = allRegisterField.get(item);
|
|
217
|
+
nestedFieldPath.set(item, realField);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
return nestedFieldPath;
|
|
221
|
+
}
|
|
222
|
+
#getOperateFieldMap(fieldPaths) {
|
|
223
|
+
let targetFields = /* @__PURE__ */ new Map();
|
|
224
|
+
if (fieldPaths !== void 0) fieldPaths.forEach((path) => {
|
|
225
|
+
const field = this.#fields.get(path);
|
|
226
|
+
if (field === void 0) {
|
|
227
|
+
const nestedFields = this.#getNestedField(path);
|
|
228
|
+
targetFields = new Map([...targetFields, ...nestedFields]);
|
|
229
|
+
} else targetFields.set(path, field);
|
|
230
|
+
});
|
|
231
|
+
else targetFields = this.#fields;
|
|
232
|
+
return targetFields;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* An ArrayField has no single Field entity: restore its value in formState from the initial value, and renew its
|
|
236
|
+
* updateKey so it renders again. reset(fields) restores only the ArrayFields at or under one of the paths.
|
|
237
|
+
*/
|
|
238
|
+
#resetArrayField(fieldPaths) {
|
|
239
|
+
const arrayFieldPaths = [...this.#registeredArrayField.keys()].filter((path) => fieldPaths === void 0 || fieldPaths.some((target) => isPathWithin(path, target)));
|
|
240
|
+
arrayFieldPaths.forEach((path) => {
|
|
241
|
+
const arrayFieldState = this.#registeredArrayField.get(path);
|
|
242
|
+
const arrayFieldInitValue = this._adapter.cloneDeep(arrayFieldState.initValue);
|
|
243
|
+
this.#updateStateValue(path, arrayFieldInitValue, {
|
|
244
|
+
skipNotify: true,
|
|
245
|
+
skipRender: true
|
|
246
|
+
});
|
|
247
|
+
this.#updateArrayField(path, { updateKey: nextUpdateKey() });
|
|
248
|
+
});
|
|
249
|
+
this.#batch(() => {
|
|
250
|
+
this.#fields.forEach((registration) => {
|
|
251
|
+
if (arrayFieldPaths.some((path) => isPathWithin(registration.field, path))) this.#updateField(registration.store, { value: get$1(this.#data.values, registration.field) });
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
#autoScroll() {
|
|
256
|
+
const { autoScrollToError } = this.getFormProps();
|
|
257
|
+
if (!autoScrollToError) return;
|
|
258
|
+
const scrollOpts = typeof autoScrollToError === "object" ? autoScrollToError : {
|
|
259
|
+
behavior: "smooth",
|
|
260
|
+
block: "start"
|
|
261
|
+
};
|
|
262
|
+
const [fieldDOM] = this.#getErrorFieldDOMs();
|
|
263
|
+
if (fieldDOM) scrollIntoView$1(fieldDOM, scrollOpts);
|
|
264
|
+
}
|
|
265
|
+
#getField = (field) => {
|
|
266
|
+
return this.#fields.get(field);
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Settles an outdated validation without writing its result. It follows the newest one, as the Form waits on every
|
|
270
|
+
* field's promise and one that never settles would hang validate() and submit (a promise must not resolve with
|
|
271
|
+
* itself, hence the identity check). A silent validation is never the newest one: it writes nothing, so it must
|
|
272
|
+
* not keep a normal one from writing. One started before a reset of the whole Form or of its field, before
|
|
273
|
+
* setValue or setValues wrote its field, or whose field component has unmounted since, settles with undefined.
|
|
274
|
+
*/
|
|
275
|
+
#isSuperseded(registration, validation, epoch, silent, resolve) {
|
|
276
|
+
if (epoch !== this.#epoch) {
|
|
277
|
+
resolve(void 0);
|
|
278
|
+
return true;
|
|
279
|
+
}
|
|
280
|
+
const latest = this.#validations.get(registration.field);
|
|
281
|
+
if (!silent && latest !== validation) {
|
|
282
|
+
resolve(latest);
|
|
283
|
+
return true;
|
|
284
|
+
}
|
|
285
|
+
if (this.#fields.get(registration.field)?.id !== registration.id) {
|
|
286
|
+
resolve(void 0);
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
/** Resolves with the field's error value, undefined when valid */
|
|
292
|
+
#validateRules(registration, value, opts) {
|
|
293
|
+
const { field } = registration;
|
|
294
|
+
const { rules, stopValidateWithError } = registration.getValidateOptions();
|
|
295
|
+
const validator = generateValidatesFromRules(field, rules);
|
|
296
|
+
const epoch = this.#epoch;
|
|
297
|
+
const silent = Boolean(opts.silent);
|
|
298
|
+
const validation = new Promise((resolve) => {
|
|
299
|
+
validator.validate({ [field]: value }, { first: stopValidateWithError }, () => {}).then(() => {
|
|
300
|
+
if (this.#isSuperseded(registration, validation, epoch, silent, resolve)) return;
|
|
301
|
+
this.#setFieldError(registration, void 0, {
|
|
302
|
+
...opts,
|
|
303
|
+
status: "success"
|
|
304
|
+
});
|
|
305
|
+
resolve(void 0);
|
|
306
|
+
}).catch((err) => {
|
|
307
|
+
if (this.#isSuperseded(registration, validation, epoch, silent, resolve)) return;
|
|
308
|
+
const { errors, fields } = err;
|
|
309
|
+
if (errors && fields) {
|
|
310
|
+
let messages = errors.map((e) => e.message);
|
|
311
|
+
if (messages.length === 1) messages = messages[0];
|
|
312
|
+
if (Array.isArray(errors) && errors.length > 0) {
|
|
313
|
+
this.#setFieldError(registration, messages, {
|
|
314
|
+
...opts,
|
|
315
|
+
status: "error"
|
|
316
|
+
});
|
|
317
|
+
resolve(messages);
|
|
318
|
+
}
|
|
319
|
+
} else {
|
|
320
|
+
this.#setFieldError(registration, err.message, {
|
|
321
|
+
...opts,
|
|
322
|
+
status: "error"
|
|
323
|
+
});
|
|
324
|
+
resolve(err.message);
|
|
325
|
+
throw err;
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
if (!silent) this.#validations.set(field, validation);
|
|
330
|
+
return validation;
|
|
331
|
+
}
|
|
332
|
+
/** Resolves with the field's error value, undefined when valid */
|
|
333
|
+
#validateCustom(registration, value, opts) {
|
|
334
|
+
const { validate } = registration.getValidateOptions();
|
|
335
|
+
const epoch = this.#epoch;
|
|
336
|
+
const silent = Boolean(opts.silent);
|
|
337
|
+
const validation = new Promise((resolve) => {
|
|
338
|
+
let maybePromisedErrors;
|
|
339
|
+
try {
|
|
340
|
+
maybePromisedErrors = validate(value, this.#getValue());
|
|
341
|
+
} catch (err) {
|
|
342
|
+
maybePromisedErrors = err;
|
|
343
|
+
}
|
|
344
|
+
const settle = (result) => {
|
|
345
|
+
const error = isValid(result) ? void 0 : result;
|
|
346
|
+
this.#setFieldError(registration, error, opts);
|
|
347
|
+
resolve(error);
|
|
348
|
+
};
|
|
349
|
+
if (isPromise(maybePromisedErrors)) {
|
|
350
|
+
const settleLatest = (result) => {
|
|
351
|
+
if (!this.#isSuperseded(registration, validation, epoch, silent, resolve)) settle(result);
|
|
352
|
+
};
|
|
353
|
+
maybePromisedErrors.then(settleLatest, settleLatest);
|
|
354
|
+
} else settle(maybePromisedErrors);
|
|
355
|
+
});
|
|
356
|
+
if (!silent) this.#validations.set(registration.field, validation);
|
|
357
|
+
return validation;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* The field passes its own registration: a wrapped component may report a change from its mount effect, which runs
|
|
361
|
+
* before the field registers. A field-level `validate` wins over `rules`; a field with neither has nothing to
|
|
362
|
+
* validate.
|
|
363
|
+
*/
|
|
364
|
+
#validateField = (registration, value, opts = {}) => {
|
|
365
|
+
const { rules, validate, transform } = registration.getValidateOptions();
|
|
366
|
+
const finalValue = transform ? transform(value) : value;
|
|
367
|
+
if (validate) return this.#validateCustom(registration, finalValue, opts);
|
|
368
|
+
if (rules) return this.#validateRules(registration, finalValue, opts);
|
|
369
|
+
return null;
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* Commits a value the user entered. onChange must already see it through the form api, yet a throwing onChange
|
|
373
|
+
* must leave the form state untouched: the value is written silently first and committed with notify and update
|
|
374
|
+
* once onChange returns; a throw rolls it back and propagates.
|
|
375
|
+
*/
|
|
376
|
+
#changeFieldValue = (registration, value, opts) => {
|
|
377
|
+
const { field, valuePath } = registration;
|
|
378
|
+
const { allowEmptyString, emptyValue, convert } = registration.getChangeOptions();
|
|
379
|
+
const { allowEmpty } = opts;
|
|
380
|
+
let nextValue = valuePath ? get$1(value, valuePath) : value;
|
|
381
|
+
if (typeof convert === "function") nextValue = convert(nextValue);
|
|
382
|
+
if (!allowEmptyString && !allowEmpty && nextValue === emptyValue) nextValue = void 0;
|
|
383
|
+
this.#batch(() => {
|
|
384
|
+
const prevValue = this.#getValue(field, { needClone: true });
|
|
385
|
+
try {
|
|
386
|
+
this.#setFieldValue(registration, nextValue, SILENT);
|
|
387
|
+
opts.onChange(this.#getValue());
|
|
388
|
+
this.#setFieldTouched(registration, true, SILENT);
|
|
389
|
+
this.#updateStateValue(field, nextValue, { allowEmpty });
|
|
390
|
+
if (opts.validate) this.#validateField(registration, nextValue);
|
|
391
|
+
} catch (err) {
|
|
392
|
+
this.#setFieldValue(registration, prevValue, SILENT);
|
|
393
|
+
throw err;
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
};
|
|
397
|
+
#register = (field, registration) => {
|
|
398
|
+
const fieldState = registration.store.getSnapshot();
|
|
399
|
+
const registered = this.#registered[field];
|
|
400
|
+
this.#registered[field] = true;
|
|
401
|
+
this.#fields.set(field, registration);
|
|
402
|
+
const allowEmpty = registration.allowEmpty || false;
|
|
403
|
+
const opts = {
|
|
404
|
+
skipNotify: true,
|
|
405
|
+
skipRender: false,
|
|
406
|
+
allowEmpty
|
|
407
|
+
};
|
|
408
|
+
let fieldValue = fieldState.value;
|
|
409
|
+
if (!allowEmpty && fieldValue === "") fieldValue = void 0;
|
|
410
|
+
if (!(registration.keepState && registered)) {
|
|
411
|
+
this.#updateStateValue(field, fieldValue, opts);
|
|
412
|
+
if (fieldState.error) this.#updateStateError(field, fieldState.error, opts);
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
if (has$1(this.#data.values, field)) {
|
|
416
|
+
const savedValue = get$1(this.#data.values, field);
|
|
417
|
+
this.#updateStateValue(field, savedValue, opts);
|
|
418
|
+
this.#setFieldValue(registration, savedValue, {
|
|
419
|
+
...opts,
|
|
420
|
+
skipRender: true
|
|
421
|
+
});
|
|
422
|
+
} else this.#updateStateValue(field, fieldValue, opts);
|
|
423
|
+
if (has$1(this.#data.errors, field)) {
|
|
424
|
+
const savedError = get$1(this.#data.errors, field);
|
|
425
|
+
this.#updateStateError(field, savedError, opts);
|
|
426
|
+
this.#setFieldError(registration, savedError, {
|
|
427
|
+
...opts,
|
|
428
|
+
skipRender: true
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
if (has$1(this.#data.touched, field)) {
|
|
432
|
+
const savedTouched = get$1(this.#data.touched, field);
|
|
433
|
+
this.#updateStateTouched(field, savedTouched, opts);
|
|
434
|
+
this.#setFieldTouched(registration, savedTouched, {
|
|
435
|
+
...opts,
|
|
436
|
+
skipRender: true
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
#unRegister = (field) => {
|
|
441
|
+
if (!this.#fields.get(field).keepState) this.#data = {
|
|
442
|
+
values: remove(this.#data.values, field),
|
|
443
|
+
errors: remove(this.#data.errors, field),
|
|
444
|
+
touched: remove(this.#data.touched, field)
|
|
445
|
+
};
|
|
446
|
+
this.#fields.delete(field);
|
|
447
|
+
if (this.#destroyed) return;
|
|
448
|
+
if (this.#unregisterNotifyPending) {
|
|
449
|
+
this.#forceUpdate();
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
this.#unregisterNotifyPending = true;
|
|
453
|
+
this.#forceUpdate(() => {
|
|
454
|
+
this.#unregisterNotifyPending = false;
|
|
455
|
+
this._adapter.notifyChange(this.#data);
|
|
456
|
+
});
|
|
457
|
+
};
|
|
458
|
+
#registerArrayField = (arrayFieldPath, val) => {
|
|
459
|
+
this.#updateArrayField(arrayFieldPath, {
|
|
460
|
+
updateKey: nextUpdateKey(),
|
|
461
|
+
initValue: val
|
|
462
|
+
});
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* Registers a mounting ArrayField and writes its initial value. Its rows register first (React runs a child's
|
|
466
|
+
* layout effects before its parent's) and have written their own values already, so the values of the fields and
|
|
467
|
+
* ArrayFields registered under it are laid over the array again, outer paths first.
|
|
468
|
+
*/
|
|
469
|
+
#mountArrayField = (arrayFieldPath, val) => {
|
|
470
|
+
const target = toPath(arrayFieldPath);
|
|
471
|
+
const isNested = (path) => {
|
|
472
|
+
const nested = toPath(path);
|
|
473
|
+
return nested.length > target.length && target.every((key, i) => key === nested[i]);
|
|
474
|
+
};
|
|
475
|
+
const nestedArrayFields = [...this.#registeredArrayField.keys()].filter(isNested).sort((a, b) => toPath(a).length - toPath(b).length).map((path) => ({
|
|
476
|
+
path,
|
|
477
|
+
allowEmpty: false
|
|
478
|
+
}));
|
|
479
|
+
const nestedFields = [...this.#fields.values()].filter((registration) => isNested(registration.field)).map((registration) => ({
|
|
480
|
+
path: registration.field,
|
|
481
|
+
allowEmpty: registration.allowEmpty
|
|
482
|
+
}));
|
|
483
|
+
const nestedValues = [...nestedArrayFields, ...nestedFields].map((item) => ({
|
|
484
|
+
...item,
|
|
485
|
+
value: this.#getValue(item.path)
|
|
486
|
+
}));
|
|
487
|
+
this.#registerArrayField(arrayFieldPath, val);
|
|
488
|
+
this.#updateStateValue(arrayFieldPath, this._adapter.cloneDeep(val), SILENT);
|
|
489
|
+
nestedValues.forEach(({ path, allowEmpty, value }) => {
|
|
490
|
+
this.#updateStateValue(path, value, {
|
|
491
|
+
...SILENT,
|
|
492
|
+
allowEmpty
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
this.#updateArrayField(arrayFieldPath, { initValue: this._adapter.cloneDeep(this.#getValue(arrayFieldPath)) });
|
|
496
|
+
this.#forceUpdate();
|
|
497
|
+
};
|
|
498
|
+
/** Inserts an empty row before `index`, or appends one without it; returns the ArrayField's new updateKey */
|
|
499
|
+
#addArrayFieldRow = (arrayFieldPath, index) => {
|
|
500
|
+
if (typeof index === "number") {
|
|
501
|
+
const values = this.#getValue(arrayFieldPath);
|
|
502
|
+
if (Array.isArray(values)) this.#updateStateValue(arrayFieldPath, values.toSpliced(index, 0, void 0), SILENT);
|
|
503
|
+
const errors = this.#getError(arrayFieldPath);
|
|
504
|
+
if (Array.isArray(errors)) this.#updateStateError(arrayFieldPath, errors.toSpliced(index, 0, void 0), SILENT);
|
|
505
|
+
}
|
|
506
|
+
const updateKey = nextUpdateKey();
|
|
507
|
+
this.#updateArrayField(arrayFieldPath, { updateKey });
|
|
508
|
+
this.#forceUpdate();
|
|
509
|
+
return updateKey;
|
|
510
|
+
};
|
|
511
|
+
/** Inserts a row holding `rowValue` before `index`, or appends it without one */
|
|
512
|
+
#addArrayFieldRowWithValue = (arrayFieldPath, rowValue, index) => {
|
|
513
|
+
const values = this.#getValue(arrayFieldPath);
|
|
514
|
+
const rows = values ? values.slice() : [];
|
|
515
|
+
const rowIndex = typeof index === "number" ? Math.max(0, Math.min(index, rows.length)) : rows.length;
|
|
516
|
+
rows.splice(rowIndex, 0, this._adapter.cloneDeep(rowValue));
|
|
517
|
+
const updateKey = nextUpdateKey();
|
|
518
|
+
this.#updateArrayField(arrayFieldPath, { updateKey });
|
|
519
|
+
this.#updateStateValue(arrayFieldPath, rows, {});
|
|
520
|
+
return {
|
|
521
|
+
index: rowIndex,
|
|
522
|
+
updateKey
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
/** Every key of the row is removed too: some keys are set only in initValue and never taken over by a field */
|
|
526
|
+
#removeArrayFieldRow = (arrayFieldPath, index) => {
|
|
527
|
+
const errors = this.#getError(arrayFieldPath);
|
|
528
|
+
if (Array.isArray(errors)) this.#updateStateError(arrayFieldPath, errors.toSpliced(index, 1), SILENT);
|
|
529
|
+
const values = this.#getValue(arrayFieldPath);
|
|
530
|
+
if (Array.isArray(values)) this.#updateStateValue(arrayFieldPath, values.toSpliced(index, 1), {});
|
|
531
|
+
};
|
|
532
|
+
#unRegisterArrayField = (arrayField) => {
|
|
533
|
+
this.#registeredArrayField.delete(arrayField);
|
|
534
|
+
};
|
|
535
|
+
#getArrayField = (arrayField) => {
|
|
536
|
+
return this.#registeredArrayField.get(arrayField);
|
|
537
|
+
};
|
|
538
|
+
#updateArrayField = (arrayField, updateValue) => {
|
|
539
|
+
const mergeVal = {
|
|
540
|
+
...this.#registeredArrayField.get(arrayField),
|
|
541
|
+
...updateValue
|
|
542
|
+
};
|
|
543
|
+
this.#registeredArrayField.set(arrayField, mergeVal);
|
|
544
|
+
};
|
|
545
|
+
#validate(fieldPaths) {
|
|
546
|
+
const { validator } = this.getProps();
|
|
547
|
+
let fields;
|
|
548
|
+
let silent = false;
|
|
549
|
+
if (fieldPaths && !Array.isArray(fieldPaths)) {
|
|
550
|
+
const options = fieldPaths;
|
|
551
|
+
fields = options.fields;
|
|
552
|
+
silent = options.silent || false;
|
|
553
|
+
} else fields = fieldPaths;
|
|
554
|
+
if (typeof validator === "function") return this.#formValidate(silent);
|
|
555
|
+
else return this.#fieldsValidate(fields, silent);
|
|
556
|
+
}
|
|
557
|
+
#injectErrorToField(errors) {
|
|
558
|
+
this.#fields.forEach((field) => {
|
|
559
|
+
const fieldError = get$1(errors, field.field);
|
|
560
|
+
this.#setFieldError(field, fieldError, {
|
|
561
|
+
skipNotify: true,
|
|
562
|
+
skipRender: true
|
|
563
|
+
});
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
#getValue = (field, opts) => {
|
|
567
|
+
const value = typeof field === "undefined" ? { ...this.#data.values } : get$1(this.#data.values, field);
|
|
568
|
+
return opts?.needClone ? this._adapter.cloneDeep(value) : value;
|
|
569
|
+
};
|
|
570
|
+
#setValues = (values, { isOverride = false }) => {
|
|
571
|
+
const _values = this._adapter.cloneDeep(values);
|
|
572
|
+
this.#fields.forEach((field) => {
|
|
573
|
+
const value = get$1(_values, field.field);
|
|
574
|
+
const opts = {
|
|
575
|
+
skipNotify: true,
|
|
576
|
+
skipRender: true
|
|
577
|
+
};
|
|
578
|
+
this.#validations.delete(field.field);
|
|
579
|
+
this.#setFieldValue(field, value, opts);
|
|
580
|
+
});
|
|
581
|
+
if (this.#registeredArrayField.size) [...this.#registeredArrayField.keys()].forEach((path) => {
|
|
582
|
+
this.#updateArrayField(path, { updateKey: nextUpdateKey() });
|
|
583
|
+
});
|
|
584
|
+
if (isOverride) this.#data = {
|
|
585
|
+
...this.#data,
|
|
586
|
+
values: _values
|
|
587
|
+
};
|
|
588
|
+
this._adapter.notifyChange(this.#data);
|
|
589
|
+
this._adapter.notifyValueChange(this.#data.values, { ...values });
|
|
590
|
+
this.#forceUpdate();
|
|
591
|
+
};
|
|
592
|
+
#updateStateValue = (field, value, opts, callback) => {
|
|
593
|
+
const skipNotify = opts && opts.skipNotify;
|
|
594
|
+
const skipRender = opts && opts.skipRender;
|
|
595
|
+
const allowEmpty = opts && opts.allowEmpty || this.getProp("allowEmpty");
|
|
596
|
+
this.#data = {
|
|
597
|
+
...this.#data,
|
|
598
|
+
values: set$1(this.#data.values, field, value, allowEmpty)
|
|
599
|
+
};
|
|
600
|
+
if (!skipNotify) {
|
|
601
|
+
this._adapter.notifyChange(this.#data);
|
|
602
|
+
this._adapter.notifyValueChange(this.#data.values, { [field]: value });
|
|
603
|
+
}
|
|
604
|
+
if (!skipRender) this.#forceUpdate(callback);
|
|
605
|
+
};
|
|
606
|
+
#getTouched = (field) => {
|
|
607
|
+
if (typeof field === "undefined") return this.#data.touched;
|
|
608
|
+
return get$1(this.#data.touched, field);
|
|
609
|
+
};
|
|
610
|
+
#updateStateTouched = (field, isTouched, opts, callback) => {
|
|
611
|
+
const skipNotify = opts && opts.skipNotify;
|
|
612
|
+
const skipRender = opts && opts.skipRender;
|
|
613
|
+
this.#data = {
|
|
614
|
+
...this.#data,
|
|
615
|
+
touched: set$1(this.#data.touched, field, isTouched)
|
|
616
|
+
};
|
|
617
|
+
if (!skipNotify) this._adapter.notifyChange(this.#data);
|
|
618
|
+
if (!skipRender) this.#forceUpdate(callback);
|
|
619
|
+
};
|
|
620
|
+
#getError = (field) => {
|
|
621
|
+
if (typeof field === "undefined") return this.#data.errors;
|
|
622
|
+
return get$1(this.#data.errors, field);
|
|
623
|
+
};
|
|
624
|
+
#updateStateError = (field, error, opts, callback) => {
|
|
625
|
+
const skipNotify = opts && opts.skipNotify;
|
|
626
|
+
const skipRender = opts && opts.skipRender;
|
|
627
|
+
this.#data = {
|
|
628
|
+
...this.#data,
|
|
629
|
+
errors: set$1(this.#data.errors, field, error)
|
|
630
|
+
};
|
|
631
|
+
if (!skipNotify) {
|
|
632
|
+
this._adapter.notifyChange(this.#data);
|
|
633
|
+
this._adapter.notifyErrorChange(this.#data.errors, { [field]: error });
|
|
634
|
+
}
|
|
635
|
+
if (!skipRender) this.#forceUpdate(callback);
|
|
636
|
+
};
|
|
637
|
+
#setFieldError = (registration, error, opts) => {
|
|
638
|
+
if (opts?.silent) return;
|
|
639
|
+
const { store, field } = registration;
|
|
640
|
+
this.#batch(() => {
|
|
641
|
+
if (opts?.status) this.#updateField(store, { status: opts.status });
|
|
642
|
+
if (error === store.getSnapshot().error) return;
|
|
643
|
+
this.#updateField(store, {
|
|
644
|
+
error,
|
|
645
|
+
status: opts?.status ?? (isValid(error) ? "success" : "error")
|
|
646
|
+
});
|
|
647
|
+
this.#updateStateError(field, error, opts);
|
|
648
|
+
});
|
|
649
|
+
};
|
|
650
|
+
#setFieldValue(registration, value, opts) {
|
|
651
|
+
this.#batch(() => {
|
|
652
|
+
this.#updateField(registration.store, { value });
|
|
653
|
+
this.#updateStateValue(registration.field, value, {
|
|
654
|
+
...opts,
|
|
655
|
+
allowEmpty: registration.getChangeOptions().allowEmpty
|
|
656
|
+
});
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
#setFieldTouched = (registration, touched, opts) => {
|
|
660
|
+
this.#batch(() => {
|
|
661
|
+
this.#updateField(registration.store, { touched });
|
|
662
|
+
this.#updateStateTouched(registration.field, touched, opts);
|
|
663
|
+
});
|
|
664
|
+
};
|
|
665
|
+
/**
|
|
666
|
+
* formApi.setValue / setError / setTouched. A path with a Field updates its snapshot. A path without
|
|
667
|
+
* one, such as an ArrayField's value as a whole (each element has a Field), is written to formState first, then the
|
|
668
|
+
* Fields nested under it take their part: setValue('peoples', [2, 3]) with an Input Field per element.
|
|
669
|
+
*/
|
|
670
|
+
#setByPath(kind, field, value, opts) {
|
|
671
|
+
const setter = {
|
|
672
|
+
values: (registration, value, options) => this.#setFieldValue(registration, value, options),
|
|
673
|
+
errors: this.#setFieldError,
|
|
674
|
+
touched: this.#setFieldTouched
|
|
675
|
+
}[kind];
|
|
676
|
+
const updateState = {
|
|
677
|
+
values: this.#updateStateValue,
|
|
678
|
+
errors: this.#updateStateError,
|
|
679
|
+
touched: this.#updateStateTouched
|
|
680
|
+
}[kind];
|
|
681
|
+
const registration = this.#fields.get(field);
|
|
682
|
+
if (registration) {
|
|
683
|
+
setter(registration, value, opts);
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
updateState(field, value, opts, () => {
|
|
687
|
+
this.#getNestedField(field).forEach((nested) => {
|
|
688
|
+
const nestedValue = get$1(this.#data[kind], nested.field);
|
|
689
|
+
setter(nested, nestedValue, {
|
|
690
|
+
skipNotify: true,
|
|
691
|
+
skipRender: true
|
|
692
|
+
});
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
if (this.#getArrayField(field)) this.#updateArrayField(field, { updateKey: nextUpdateKey() });
|
|
696
|
+
}
|
|
697
|
+
#getFieldSetterApi() {
|
|
698
|
+
return {
|
|
699
|
+
setValue: (field, value, opts) => {
|
|
700
|
+
this.#getOperateFieldMap([field]).forEach((_, path) => this.#validations.delete(path));
|
|
701
|
+
this.#setByPath("values", field, this._adapter.cloneDeep(value), opts);
|
|
702
|
+
},
|
|
703
|
+
setError: (field, error, opts) => this.#setByPath("errors", field, this._adapter.cloneDeep(error), opts),
|
|
704
|
+
setTouched: (field, isTouched, opts) => this.#setByPath("touched", field, isTouched, opts)
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
#getFieldExist = (field) => {
|
|
708
|
+
return Boolean(this.#fields.has(field));
|
|
709
|
+
};
|
|
710
|
+
#getFieldDOM(field) {
|
|
711
|
+
return this._adapter.getFormElement()?.querySelector(`.${prefix}-field[x-field-id="${CSS.escape(field)}"]`) ?? null;
|
|
712
|
+
}
|
|
713
|
+
/** The root elements of the fields showing an error message, in document order */
|
|
714
|
+
#getErrorFieldDOMs() {
|
|
715
|
+
const errorDOMs = this._adapter.getFormElement()?.querySelectorAll(ERROR_SELECTOR) ?? [];
|
|
716
|
+
return Array.from(errorDOMs, errorField).filter((fieldDOM) => fieldDOM !== null);
|
|
717
|
+
}
|
|
718
|
+
#getErrorFieldDOM(field) {
|
|
719
|
+
const errorDOM = this.#getFieldDOM(field)?.querySelector(ERROR_SELECTOR);
|
|
720
|
+
return errorDOM && errorField(errorDOM);
|
|
721
|
+
}
|
|
722
|
+
#scrollToField = (field, scrollOpts = {
|
|
723
|
+
behavior: "smooth",
|
|
724
|
+
block: "start"
|
|
725
|
+
}) => {
|
|
726
|
+
const fieldDOM = this.#getFieldExist(field) ? this.#getFieldDOM(field) : null;
|
|
727
|
+
if (fieldDOM) scrollIntoView$1(fieldDOM, scrollOpts);
|
|
728
|
+
};
|
|
729
|
+
#scrollToError = (config) => {
|
|
730
|
+
const { field, index, scrollOpts = {
|
|
731
|
+
behavior: "smooth",
|
|
732
|
+
block: "start"
|
|
733
|
+
} } = config ?? {};
|
|
734
|
+
let fieldDOM;
|
|
735
|
+
if (typeof index === "number") fieldDOM = this.#getErrorFieldDOMs()[index];
|
|
736
|
+
else if (field) fieldDOM = this.#getErrorFieldDOM(field);
|
|
737
|
+
else if (typeof field === "undefined") fieldDOM = this.#getErrorFieldDOMs()[0];
|
|
738
|
+
if (fieldDOM) scrollIntoView$1(fieldDOM, scrollOpts);
|
|
739
|
+
};
|
|
740
|
+
getInitValues() {
|
|
741
|
+
return this._adapter.getInitValues();
|
|
742
|
+
}
|
|
743
|
+
getInitValue(field) {
|
|
744
|
+
if (typeof field === "undefined") return this._adapter.getInitValues();
|
|
745
|
+
return get$1(this._adapter.getInitValues(), field);
|
|
746
|
+
}
|
|
747
|
+
getFormProps(keys) {
|
|
748
|
+
return this._adapter.getFormProps(keys);
|
|
749
|
+
}
|
|
750
|
+
init() {
|
|
751
|
+
this.#destroyed = false;
|
|
752
|
+
}
|
|
753
|
+
destroy() {
|
|
754
|
+
this.#destroyed = true;
|
|
755
|
+
}
|
|
756
|
+
submit(e) {
|
|
757
|
+
const epoch = this.#epoch;
|
|
758
|
+
this.#validate().then((resolveValues) => {
|
|
759
|
+
if (this.#isCancelled(epoch)) return;
|
|
760
|
+
const _values = this._adapter.cloneDeep(resolveValues);
|
|
761
|
+
this._adapter.notifySubmit(_values, e);
|
|
762
|
+
}, (errors) => {
|
|
763
|
+
if (this.#isCancelled(epoch)) return;
|
|
764
|
+
const _errors = this._adapter.cloneDeep(errors);
|
|
765
|
+
const _values = this._adapter.cloneDeep(this.#data.values);
|
|
766
|
+
this._adapter.notifySubmitFail(_errors, _values, e);
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
reset(fieldPaths) {
|
|
770
|
+
const targetFields = this.#getOperateFieldMap(fieldPaths);
|
|
771
|
+
if (fieldPaths === void 0) this.#epoch += 1;
|
|
772
|
+
else targetFields.forEach((_, path) => this.#validations.delete(path));
|
|
773
|
+
const prevErrors = this.#data.errors;
|
|
774
|
+
this.#batch(() => {
|
|
775
|
+
targetFields.forEach((field) => {
|
|
776
|
+
this.#setFieldValue(field, field.initValue !== null ? this._adapter.cloneDeep(field.initValue) : void 0, SILENT);
|
|
777
|
+
this.#setFieldError(field, void 0, SILENT);
|
|
778
|
+
this.#setFieldTouched(field, void 0, SILENT);
|
|
779
|
+
this.#updateField(field.store, { status: "default" });
|
|
780
|
+
});
|
|
781
|
+
});
|
|
782
|
+
if (this.#registeredArrayField.size) this.#resetArrayField(fieldPaths);
|
|
783
|
+
this._adapter.notifyChange(this.#data);
|
|
784
|
+
this.#notifyErrorChange(prevErrors, targetFields.keys());
|
|
785
|
+
this.#forceUpdate();
|
|
786
|
+
this._adapter.notifyReset();
|
|
787
|
+
}
|
|
788
|
+
getFieldBridge() {
|
|
789
|
+
return {
|
|
790
|
+
register: this.#register,
|
|
791
|
+
unRegister: this.#unRegister,
|
|
792
|
+
setFieldTouched: this.#setFieldTouched,
|
|
793
|
+
validateField: this.#validateField,
|
|
794
|
+
changeFieldValue: this.#changeFieldValue,
|
|
795
|
+
getValue: this.#getValue,
|
|
796
|
+
getError: this.#getError,
|
|
797
|
+
getTouched: this.#getTouched,
|
|
798
|
+
getInitValues: () => this.getInitValues(),
|
|
799
|
+
getInitValue: (field) => this.getInitValue(field),
|
|
800
|
+
getFormProps: (keys) => this.getFormProps(keys),
|
|
801
|
+
getField: this.#getField,
|
|
802
|
+
registerArrayField: this.#registerArrayField,
|
|
803
|
+
mountArrayField: this.#mountArrayField,
|
|
804
|
+
unRegisterArrayField: this.#unRegisterArrayField,
|
|
805
|
+
getArrayField: this.#getArrayField,
|
|
806
|
+
addArrayFieldRow: this.#addArrayFieldRow,
|
|
807
|
+
addArrayFieldRowWithValue: this.#addArrayFieldRowWithValue,
|
|
808
|
+
removeArrayFieldRow: this.#removeArrayFieldRow
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
getFormApi() {
|
|
812
|
+
return {
|
|
813
|
+
...this.#getFieldSetterApi(),
|
|
814
|
+
reset: (fields) => this.reset(fields),
|
|
815
|
+
validate: (fields) => this.#validate(fields),
|
|
816
|
+
getValue: (field) => this.#getValue(field, { needClone: true }),
|
|
817
|
+
getValues: () => this.#getValue(void 0, { needClone: true }),
|
|
818
|
+
getFormState: () => this.getFormState(true),
|
|
819
|
+
getFormProps: (props) => this.getFormProps(props),
|
|
820
|
+
getInitValue: (field) => this.getInitValue(field),
|
|
821
|
+
getInitValues: () => this.getInitValues(),
|
|
822
|
+
getTouched: (field) => this.#getTouched(field),
|
|
823
|
+
getError: (field) => this.#getError(field),
|
|
824
|
+
setValues: (values, opts) => this.#setValues(values, opts || { isOverride: false }),
|
|
825
|
+
submitForm: () => this.submit(),
|
|
826
|
+
getFieldExist: (field) => this.#getFieldExist(field),
|
|
827
|
+
scrollToField: (field, scrollOpts) => this.#scrollToField(field, scrollOpts),
|
|
828
|
+
scrollToError: (opts) => this.#scrollToError(opts)
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
getFormState = (needClone = false) => {
|
|
832
|
+
if (!needClone) return { ...this.#data };
|
|
833
|
+
else return this._adapter.cloneDeep(this.#data);
|
|
834
|
+
};
|
|
835
|
+
};
|
|
836
|
+
export { FormFoundation as default };
|