@synetics/ui 0.7.0-alpha
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/.env +3 -0
- package/.eslintrc.cjs +83 -0
- package/.eslintrc.json +53 -0
- package/.github/workflows/deploy.yml +7 -0
- package/.turbo/turbo-build.log +3 -0
- package/CONTRIBUTING.md +47 -0
- package/FIXES-IMPLEMENTATION-LOG.md +180 -0
- package/LICENSE +21 -0
- package/README.md +414 -0
- package/ROADMAP.md +112 -0
- package/TEST-DOCUMENTATION.md +67 -0
- package/TEST-FAILURE-ANALYSIS.md +326 -0
- package/console-mirror.html +79 -0
- package/control-flow-transformed.js +10129 -0
- package/daily-push.log +9 -0
- package/debug-router.html +54 -0
- package/debug-screenshot.png +0 -0
- package/dev-error.log +84 -0
- package/dev-output.log +10689 -0
- package/docs/README.md +527 -0
- package/e2e-results.txt +0 -0
- package/error-boundary-output.js +353 -0
- package/final-test.txt +2816 -0
- package/index.html +41 -0
- package/latest-test.txt +2900 -0
- package/package.json +68 -0
- package/parse-debug.txt +10 -0
- package/ping.txt +1 -0
- package/playwright.config.ts +25 -0
- package/postcss.config.js +6 -0
- package/pre-validation-code.js +25 -0
- package/reactivity-output.txt +0 -0
- package/reactivity-page.html +0 -0
- package/return-parse-test.txt +139 -0
- package/run-psr-test.ps1 +65 -0
- package/src/README.md +138 -0
- package/src/components/app-footer.syn +17 -0
- package/src/components/app-header.syn +43 -0
- package/src/components/atoms/avatar/avatar-simple.syn +25 -0
- package/src/components/atoms/avatar/avatar.syn +86 -0
- package/src/components/atoms/avatar/avatar.type.ts +39 -0
- package/src/components/atoms/avatar/index.ts +7 -0
- package/src/components/atoms/checkbox/checkbox.syn +72 -0
- package/src/components/atoms/checkbox/checkbox.type.ts +25 -0
- package/src/components/atoms/checkbox/index.ts +6 -0
- package/src/components/atoms/container/container.syn +53 -0
- package/src/components/atoms/container/container.type.ts +32 -0
- package/src/components/atoms/container/index.ts +7 -0
- package/src/components/atoms/divider/divider.syn +45 -0
- package/src/components/atoms/divider/divider.type.ts +24 -0
- package/src/components/atoms/divider/index.ts +7 -0
- package/src/components/atoms/grid/grid.syn +56 -0
- package/src/components/atoms/grid/grid.type.ts +44 -0
- package/src/components/atoms/grid/index.ts +7 -0
- package/src/components/atoms/icon/icon.syn +0 -0
- package/src/components/atoms/icon/icon.type.ts +5 -0
- package/src/components/atoms/input/index.ts +6 -0
- package/src/components/atoms/input/input.syn +75 -0
- package/src/components/atoms/input/input.type.ts +29 -0
- package/src/components/atoms/progress/index.ts +7 -0
- package/src/components/atoms/progress/progress.syn +68 -0
- package/src/components/atoms/progress/progress.type.ts +48 -0
- package/src/components/atoms/radio/index.ts +6 -0
- package/src/components/atoms/radio/radio.syn +72 -0
- package/src/components/atoms/radio/radio.type.ts +31 -0
- package/src/components/atoms/rating/index.ts +6 -0
- package/src/components/atoms/rating/rating.syn +119 -0
- package/src/components/atoms/rating/rating.type.ts +53 -0
- package/src/components/atoms/skeleton/index.ts +6 -0
- package/src/components/atoms/skeleton/skeleton.syn +31 -0
- package/src/components/atoms/skeleton/skeleton.type.ts +12 -0
- package/src/components/atoms/slider/index.ts +6 -0
- package/src/components/atoms/slider/slider.syn +101 -0
- package/src/components/atoms/slider/slider.type.ts +54 -0
- package/src/components/atoms/spinner/index.ts +6 -0
- package/src/components/atoms/spinner/spinner.syn +39 -0
- package/src/components/atoms/spinner/spinner.type.ts +40 -0
- package/src/components/atoms/stack/index.ts +7 -0
- package/src/components/atoms/stack/stack.syn +79 -0
- package/src/components/atoms/stack/stack.type.ts +42 -0
- package/src/components/atoms/textarea/index.ts +6 -0
- package/src/components/atoms/textarea/textarea.syn +78 -0
- package/src/components/atoms/textarea/textarea.type.ts +28 -0
- package/src/components/atoms/toggle/index.ts +6 -0
- package/src/components/atoms/toggle/toggle.syn +69 -0
- package/src/components/atoms/toggle/toggle.type.ts +27 -0
- package/src/components/atoms/tooltip/index.ts +5 -0
- package/src/components/atoms/tooltip/tooltip.syn +83 -0
- package/src/components/atoms/tooltip/tooltip.type.ts +36 -0
- package/src/components/atoms/typography/index.ts +6 -0
- package/src/components/atoms/typography/typography.syn +113 -0
- package/src/components/atoms/typography/typography.type.ts +36 -0
- package/src/components/enums/alert-variant.type.ts +5 -0
- package/src/components/enums/avatar-size.type.ts +5 -0
- package/src/components/enums/button-type.type.ts +5 -0
- package/src/components/enums/container-max-width.type.ts +5 -0
- package/src/components/enums/container-padding.type.ts +5 -0
- package/src/components/enums/divider-orientation.type.ts +5 -0
- package/src/components/enums/drawer-placement.type.ts +5 -0
- package/src/components/enums/drawer-size.type.ts +5 -0
- package/src/components/enums/icon-position.type.ts +5 -0
- package/src/components/enums/index.ts +27 -0
- package/src/components/enums/input-type.type.ts +5 -0
- package/src/components/enums/modal-size.type.ts +5 -0
- package/src/components/enums/popover-placement.type.ts +5 -0
- package/src/components/enums/popover-trigger.type.ts +5 -0
- package/src/components/enums/progress-size.type.ts +5 -0
- package/src/components/enums/progress-variant.type.ts +5 -0
- package/src/components/enums/readme.md +1 -0
- package/src/components/enums/spacing.type.ts +5 -0
- package/src/components/enums/stack-align.type.ts +5 -0
- package/src/components/enums/stack-justify.type.ts +11 -0
- package/src/components/enums/toast-position.type.ts +11 -0
- package/src/components/enums/toast-variant.type.ts +5 -0
- package/src/components/enums/tooltip-placement.type.ts +5 -0
- package/src/components/enums/typography-tag.type.ts +5 -0
- package/src/components/enums/typography-variant.type.ts +5 -0
- package/src/components/formular/components/debug/form-data-display.syn +155 -0
- package/src/components/formular/components/examples/advanced-text-field.syn +211 -0
- package/src/components/formular/components/form-context/form-context.ts +15 -0
- package/src/components/formular/components/form-context/index.ts +6 -0
- package/src/components/formular/components/form-context/use-form-context.ts +31 -0
- package/src/components/formular/components/form-provider/form-provider.syn +182 -0
- package/src/components/formular/components/form-provider/index.ts +5 -0
- package/src/components/formular/components/index.ts +20 -0
- package/src/components/formular/components/integrated/checkbox-field.syn +50 -0
- package/src/components/formular/components/integrated/checkbox.syn +53 -0
- package/src/components/formular/components/integrated/index.ts +21 -0
- package/src/components/formular/components/integrated/input-field.syn +51 -0
- package/src/components/formular/components/integrated/radio-group-field.syn +68 -0
- package/src/components/formular/components/integrated/radio-group.syn +63 -0
- package/src/components/formular/components/integrated/select-field.syn +51 -0
- package/src/components/formular/components/integrated/select-input.syn +73 -0
- package/src/components/formular/components/integrated/text-field.syn +49 -0
- package/src/components/formular/components/integrated/textarea-field.syn +51 -0
- package/src/components/formular/components/integrated/textarea-input.syn +73 -0
- package/src/components/formular/components/integrated/toggle-field.syn +50 -0
- package/src/components/formular/components/integrated/toggle.syn +53 -0
- package/src/components/formular/components/modal/error-message.syn +21 -0
- package/src/components/formular/components/modal/form-modale.syn +44 -0
- package/src/components/formular/components/modal/form-validation-results.syn +46 -0
- package/src/components/formular/components/modal/guide-message.syn +21 -0
- package/src/components/formular/components/modal/index.ts +10 -0
- package/src/components/formular/components/modal/use-modale.ts +82 -0
- package/src/components/formular/components/modal/validation-results.syn +63 -0
- package/src/components/formular/components/primitives/f-checkbox-field.syn +50 -0
- package/src/components/formular/components/primitives/f-input-field.syn +77 -0
- package/src/components/formular/components/primitives/f-radio-button.syn +64 -0
- package/src/components/formular/components/primitives/f-select-field.syn +61 -0
- package/src/components/formular/components/primitives/f-textarea-field.syn +53 -0
- package/src/components/formular/components/primitives/f-toggle-field.syn +50 -0
- package/src/components/formular/components/primitives/field-label.syn +49 -0
- package/src/components/formular/components/primitives/helper-text.syn +32 -0
- package/src/components/formular/components/primitives/index.ts +32 -0
- package/src/components/formular/components/primitives/validation-results.syn +76 -0
- package/src/components/formular/hooks/bindings/field-bindings.type.ts +58 -0
- package/src/components/formular/hooks/bindings/index.ts +16 -0
- package/src/components/formular/hooks/bindings/use-checkbox-bind.ts +31 -0
- package/src/components/formular/hooks/bindings/use-input-bind.ts +31 -0
- package/src/components/formular/hooks/bindings/use-radio-bind.ts +39 -0
- package/src/components/formular/hooks/bindings/use-select-bind.ts +32 -0
- package/src/components/formular/hooks/bindings/use-textarea-bind.ts +31 -0
- package/src/components/formular/hooks/bindings/use-toggle-bind.ts +31 -0
- package/src/components/formular/hooks/index.ts +28 -0
- package/src/components/formular/hooks/use-field-validation.ts +42 -0
- package/src/components/formular/hooks/use-field.ts +282 -0
- package/src/components/formular/hooks/use-formular-signal.ts +29 -0
- package/src/components/formular/index.ts +3 -0
- package/src/components/formular/types/field-component.type.ts +78 -0
- package/src/components/formular/types/field-descriptor-config.type.ts +79 -0
- package/src/components/formular/types/form-context.type.ts +67 -0
- package/src/components/formular/types/form-provider.type.ts +67 -0
- package/src/components/formular/types/formular.types.ts +49 -0
- package/src/components/formular/types/index.ts +78 -0
- package/src/components/formular/types/portal.type.ts +36 -0
- package/src/components/formular/utils/dev-logger.ts +44 -0
- package/src/components/formular/utils/index.ts +23 -0
- package/src/components/formular/utils/use-field-descriptors.ts +75 -0
- package/src/components/formular/utils/use-formular-manager.ts +37 -0
- package/src/components/hooks/use-drawer-position.ts +91 -0
- package/src/components/interfaces/component-config-internal.interface.ts +10 -0
- package/src/components/interfaces/component-config.interface.ts +57 -0
- package/src/components/interfaces/component-config.ts +151 -0
- package/src/components/interfaces/index.ts +7 -0
- package/src/components/interfaces/prototype/active.ts +13 -0
- package/src/components/interfaces/prototype/border.ts +13 -0
- package/src/components/interfaces/prototype/build.ts +31 -0
- package/src/components/interfaces/prototype/class-name.ts +13 -0
- package/src/components/interfaces/prototype/disabled.ts +13 -0
- package/src/components/interfaces/prototype/focus.ts +13 -0
- package/src/components/interfaces/prototype/full-width.ts +13 -0
- package/src/components/interfaces/prototype/hover.ts +13 -0
- package/src/components/interfaces/prototype/loading.ts +13 -0
- package/src/components/interfaces/prototype/rounded.ts +13 -0
- package/src/components/interfaces/prototype/shadow.ts +13 -0
- package/src/components/interfaces/prototype/size.ts +14 -0
- package/src/components/interfaces/prototype/transition-duration.ts +13 -0
- package/src/components/interfaces/prototype/transition.ts +13 -0
- package/src/components/interfaces/prototype/variant.ts +14 -0
- package/src/components/interfaces/readme.md +1 -0
- package/src/components/molecules/accordion/accordion-item.syn +80 -0
- package/src/components/molecules/accordion/accordion-item.type.ts +28 -0
- package/src/components/molecules/accordion/accordion.syn +92 -0
- package/src/components/molecules/accordion/accordion.type.ts +29 -0
- package/src/components/molecules/accordion/index.ts +8 -0
- package/src/components/molecules/alert/alert-description.syn +23 -0
- package/src/components/molecules/alert/alert-description.type.ts +9 -0
- package/src/components/molecules/alert/alert-icon.syn +19 -0
- package/src/components/molecules/alert/alert-icon.type.ts +9 -0
- package/src/components/molecules/alert/alert-title.syn +19 -0
- package/src/components/molecules/alert/alert-title.type.ts +9 -0
- package/src/components/molecules/alert/alert.syn +76 -0
- package/src/components/molecules/alert/alert.type.ts +17 -0
- package/src/components/molecules/alert/index.ts +12 -0
- package/src/components/molecules/badge/badge.syn +66 -0
- package/src/components/molecules/badge/badge.type.ts +25 -0
- package/src/components/molecules/badge/index.ts +6 -0
- package/src/components/molecules/breadcrumbs/breadcrumb-item.type.ts +23 -0
- package/src/components/molecules/breadcrumbs/breadcrumbs.syn +60 -0
- package/src/components/molecules/breadcrumbs/breadcrumbs.type.ts +18 -0
- package/src/components/molecules/breadcrumbs/index.ts +8 -0
- package/src/components/molecules/button/button.syn +124 -0
- package/src/components/molecules/button/button.type.ts +24 -0
- package/src/components/molecules/button/index.ts +9 -0
- package/src/components/molecules/dropdown/dropdown-item.syn +30 -0
- package/src/components/molecules/dropdown/dropdown-item.type.ts +11 -0
- package/src/components/molecules/dropdown/dropdown.syn +135 -0
- package/src/components/molecules/dropdown/dropdown.type.ts +12 -0
- package/src/components/molecules/dropdown/index.ts +8 -0
- package/src/components/molecules/label/index.ts +6 -0
- package/src/components/molecules/label/label.syn +72 -0
- package/src/components/molecules/label/label.type.ts +28 -0
- package/src/components/molecules/list/index.ts +8 -0
- package/src/components/molecules/list/list-item.syn +33 -0
- package/src/components/molecules/list/list-item.type.ts +10 -0
- package/src/components/molecules/list/list.syn +54 -0
- package/src/components/molecules/list/list.type.ts +17 -0
- package/src/components/molecules/menu/index.ts +10 -0
- package/src/components/molecules/menu/menu-divider.syn +21 -0
- package/src/components/molecules/menu/menu-divider.type.ts +8 -0
- package/src/components/molecules/menu/menu-item.syn +56 -0
- package/src/components/molecules/menu/menu-item.type.ts +12 -0
- package/src/components/molecules/menu/menu.syn +78 -0
- package/src/components/molecules/menu/menu.type.ts +14 -0
- package/src/components/molecules/option/index.ts +6 -0
- package/src/components/molecules/option/option.syn +41 -0
- package/src/components/molecules/option/option.type.ts +23 -0
- package/src/components/molecules/pagination/index.ts +7 -0
- package/src/components/molecules/pagination/pagination.syn +123 -0
- package/src/components/molecules/pagination/pagination.type.ts +34 -0
- package/src/components/molecules/popover/index.ts +6 -0
- package/src/components/molecules/popover/popover.syn +88 -0
- package/src/components/molecules/popover/popover.type.ts +20 -0
- package/src/components/molecules/radio-group/index.ts +7 -0
- package/src/components/molecules/radio-group/radio-group.syn +79 -0
- package/src/components/molecules/radio-group/radio-group.type.ts +29 -0
- package/src/components/molecules/radio-group/radio-option.type.ts +9 -0
- package/src/components/molecules/tabs/index.ts +14 -0
- package/src/components/molecules/tabs/tab-list.syn +70 -0
- package/src/components/molecules/tabs/tab-list.type.ts +9 -0
- package/src/components/molecules/tabs/tab-panel.syn +34 -0
- package/src/components/molecules/tabs/tab-panel.type.ts +11 -0
- package/src/components/molecules/tabs/tab-panels.syn +40 -0
- package/src/components/molecules/tabs/tab-panels.type.ts +9 -0
- package/src/components/molecules/tabs/tab.syn +52 -0
- package/src/components/molecules/tabs/tab.type.ts +13 -0
- package/src/components/molecules/tabs/tabs.syn +74 -0
- package/src/components/molecules/tabs/tabs.type.ts +17 -0
- package/src/components/organisms/card/card.syn +64 -0
- package/src/components/organisms/card/card.type.ts +25 -0
- package/src/components/organisms/card/index.ts +6 -0
- package/src/components/organisms/commands/commands.syn +0 -0
- package/src/components/organisms/commands/commands.type.ts +1 -0
- package/src/components/organisms/date-picker/components/date-picker.body.days.syn +98 -0
- package/src/components/organisms/date-picker/components/date-picker.body.months.syn +77 -0
- package/src/components/organisms/date-picker/components/date-picker.body.years.syn +86 -0
- package/src/components/organisms/date-picker/components/date-picker.cell.syn +104 -0
- package/src/components/organisms/date-picker/components/date-picker.context.ts +36 -0
- package/src/components/organisms/date-picker/components/date-picker.drawer.content.ui.syn +93 -0
- package/src/components/organisms/date-picker/components/date-picker.header.syn +130 -0
- package/src/components/organisms/date-picker/components/date-picker.switch.syn +27 -0
- package/src/components/organisms/date-picker/core/computed/compute-days-grid.ts +46 -0
- package/src/components/organisms/date-picker/core/computed/compute-months-grid.ts +43 -0
- package/src/components/organisms/date-picker/core/computed/compute-range.ts +36 -0
- package/src/components/organisms/date-picker/core/computed/compute-years-grid.ts +56 -0
- package/src/components/organisms/date-picker/core/constructors/create-cell.ts +37 -0
- package/src/components/organisms/date-picker/core/date-picker.types.ts +41 -0
- package/src/components/organisms/date-picker/core/getters/get-current-month-days.ts +35 -0
- package/src/components/organisms/date-picker/core/getters/get-next-date.ts +32 -0
- package/src/components/organisms/date-picker/core/getters/get-next-month-days.ts +23 -0
- package/src/components/organisms/date-picker/core/getters/get-previous-date.ts +32 -0
- package/src/components/organisms/date-picker/core/getters/get-previous-month-days.ts +32 -0
- package/src/components/organisms/date-picker/core/models/date-picker.models.constructors.ts +36 -0
- package/src/components/organisms/date-picker/core/models/date-picker.models.ts +46 -0
- package/src/components/organisms/date-picker/core/system/get-local-system-separator.ts +5 -0
- package/src/components/organisms/date-picker/date-picker.css +426 -0
- package/src/components/organisms/date-picker/date-picker.drawer.content.syn +238 -0
- package/src/components/organisms/date-picker/date-picker.stories.syn +275 -0
- package/src/components/organisms/date-picker/date-picker.syn +298 -0
- package/src/components/organisms/date-picker/examples.syn +197 -0
- package/src/components/organisms/date-picker/hooks/use-object-ref.ts +18 -0
- package/src/components/organisms/date-picker/index.ts +23 -0
- package/src/components/organisms/date-picker/internal-components/button.syn +36 -0
- package/src/components/organisms/date-picker/internal-components/icons.syn +76 -0
- package/src/components/organisms/date-picker/internal-components/portal.syn +62 -0
- package/src/components/organisms/date-picker/toggleable/toggleable.context.hook.ts +14 -0
- package/src/components/organisms/date-picker/toggleable/toggleable.context.ts +6 -0
- package/src/components/organisms/date-picker/toggleable/toggleable.syn +37 -0
- package/src/components/organisms/date-picker/utils/class-utils.ts +25 -0
- package/src/components/organisms/date-picker/utils/date-object.ts +42 -0
- package/src/components/organisms/date-picker/utils/date-utils.ts +112 -0
- package/src/components/organisms/drawer/drawer.syn +112 -0
- package/src/components/organisms/drawer/drawer.type.ts +53 -0
- package/src/components/organisms/drawer/index.ts +6 -0
- package/src/components/organisms/footer/footer.syn +53 -0
- package/src/components/organisms/footer/footer.type.ts +20 -0
- package/src/components/organisms/footer/index.ts +6 -0
- package/src/components/organisms/header/header.syn +52 -0
- package/src/components/organisms/header/header.type.ts +24 -0
- package/src/components/organisms/header/index.ts +6 -0
- package/src/components/organisms/modal/index.ts +12 -0
- package/src/components/organisms/modal/modal-body.syn +19 -0
- package/src/components/organisms/modal/modal-body.type.ts +9 -0
- package/src/components/organisms/modal/modal-footer.syn +25 -0
- package/src/components/organisms/modal/modal-footer.type.ts +9 -0
- package/src/components/organisms/modal/modal-header.syn +25 -0
- package/src/components/organisms/modal/modal-header.type.ts +9 -0
- package/src/components/organisms/modal/modal-parts.syn +21 -0
- package/src/components/organisms/modal/modal.syn +104 -0
- package/src/components/organisms/modal/modal.type.ts +15 -0
- package/src/components/organisms/retractable-panel/retractable-panel.syn +141 -0
- package/src/components/organisms/retractable-panel/retractable-panel.type.ts +52 -0
- package/src/components/organisms/select/index.ts +7 -0
- package/src/components/organisms/select/select-option.type.ts +9 -0
- package/src/components/organisms/select/select.syn +92 -0
- package/src/components/organisms/select/select.type.ts +31 -0
- package/src/components/organisms/stepper/INTEGRATION_GUIDE.md +230 -0
- package/src/components/organisms/stepper/PACKAGE_STATUS.md +180 -0
- package/src/components/organisms/stepper/README.md +293 -0
- package/src/components/organisms/stepper/Step.syn +61 -0
- package/src/components/organisms/stepper/Stepper.syn +605 -0
- package/src/components/organisms/stepper/StepperSummary.syn +36 -0
- package/src/components/organisms/stepper/adapters/atomosFormAdapter.ts +163 -0
- package/src/components/organisms/stepper/adapters/index.ts +7 -0
- package/src/components/organisms/stepper/adapters/rhfAdapter.ts +54 -0
- package/src/components/organisms/stepper/components/StepperDebug.syn +454 -0
- package/src/components/organisms/stepper/components/StepperFooter.syn +144 -0
- package/src/components/organisms/stepper/components/StepperHeader.syn +66 -0
- package/src/components/organisms/stepper/components/StepperTab.syn +118 -0
- package/src/components/organisms/stepper/components/stepperDebug.css +72 -0
- package/src/components/organisms/stepper/components/stepperFooter.css +28 -0
- package/src/components/organisms/stepper/components/stepperHeader.css +49 -0
- package/src/components/organisms/stepper/components/stepperTab.css +97 -0
- package/src/components/organisms/stepper/copy-to-atomos.ps1 +78 -0
- package/src/components/organisms/stepper/core/actions.ts +25 -0
- package/src/components/organisms/stepper/core/formAdapter.ts +66 -0
- package/src/components/organisms/stepper/core/helpers.ts +216 -0
- package/src/components/organisms/stepper/core/models.ts +220 -0
- package/src/components/organisms/stepper/core/reducer/addCustomValidators.ts +14 -0
- package/src/components/organisms/stepper/core/reducer/addError.ts +10 -0
- package/src/components/organisms/stepper/core/reducer/addStep.ts +7 -0
- package/src/components/organisms/stepper/core/reducer/computeSiblingStatus.ts +45 -0
- package/src/components/organisms/stepper/core/reducer/computeValidation.ts +61 -0
- package/src/components/organisms/stepper/core/reducer/goToStep.ts +143 -0
- package/src/components/organisms/stepper/core/reducer/init.ts +7 -0
- package/src/components/organisms/stepper/core/reducer/navigationRequest.ts +16 -0
- package/src/components/organisms/stepper/core/reducer/removeAllErrors.ts +26 -0
- package/src/components/organisms/stepper/core/reducer/removeError.ts +12 -0
- package/src/components/organisms/stepper/core/reducer/reset.ts +44 -0
- package/src/components/organisms/stepper/core/reducer/setData.ts +12 -0
- package/src/components/organisms/stepper/core/reducer/setFieldDefaultValue.ts +39 -0
- package/src/components/organisms/stepper/core/reducer/setFields.ts +41 -0
- package/src/components/organisms/stepper/core/reducer/setStepperDefaultValue.ts +33 -0
- package/src/components/organisms/stepper/core/reducer/setSubmittedTimes.ts +9 -0
- package/src/components/organisms/stepper/core/reducer/setVisible.ts +26 -0
- package/src/components/organisms/stepper/core/reducer/submitRequest.ts +19 -0
- package/src/components/organisms/stepper/core/reducer/updateFormCommon.ts +82 -0
- package/src/components/organisms/stepper/core/state.ts +106 -0
- package/src/components/organisms/stepper/index.ts +34 -0
- package/src/components/organisms/stepper/step.css +66 -0
- package/src/components/organisms/stepper/stepper.css +32 -0
- package/src/components/organisms/stepper/stepper.stories.tsx.disabled +329 -0
- package/src/components/organisms/table/index.ts +14 -0
- package/src/components/organisms/table/table-body.syn +43 -0
- package/src/components/organisms/table/table-body.type.ts +9 -0
- package/src/components/organisms/table/table-cell.syn +35 -0
- package/src/components/organisms/table/table-cell.type.ts +10 -0
- package/src/components/organisms/table/table-header.syn +23 -0
- package/src/components/organisms/table/table-header.type.ts +9 -0
- package/src/components/organisms/table/table-row.syn +35 -0
- package/src/components/organisms/table/table-row.type.ts +9 -0
- package/src/components/organisms/table/table.syn +71 -0
- package/src/components/organisms/table/table.type.ts +17 -0
- package/src/components/organisms/toast/index.ts +10 -0
- package/src/components/organisms/toast/toast-container.syn +108 -0
- package/src/components/organisms/toast/toast-container.type.ts +11 -0
- package/src/components/organisms/toast/toast-options.type.ts +11 -0
- package/src/components/organisms/toast/toast.syn +82 -0
- package/src/components/organisms/toast/toast.type.ts +14 -0
- package/src/components/organisms/toast/use-toast.ts +62 -0
- package/src/components/sidebar-nav.syn +107 -0
- package/src/components/utils/component-config-builder/component-config-builder.ts +49 -0
- package/src/components/utils/component-config-builder/component-config-builder.type.ts +27 -0
- package/src/components/utils/component-config-builder/component-config.type.ts +36 -0
- package/src/components/utils/component-config-builder/index.ts +7 -0
- package/src/components/utils/component-config-builder/prototype/active.ts +10 -0
- package/src/components/utils/component-config-builder/prototype/border.ts +10 -0
- package/src/components/utils/component-config-builder/prototype/build.ts +10 -0
- package/src/components/utils/component-config-builder/prototype/class-name.ts +10 -0
- package/src/components/utils/component-config-builder/prototype/color.ts +11 -0
- package/src/components/utils/component-config-builder/prototype/disabled.ts +10 -0
- package/src/components/utils/component-config-builder/prototype/focus.ts +10 -0
- package/src/components/utils/component-config-builder/prototype/full-width.ts +10 -0
- package/src/components/utils/component-config-builder/prototype/hover.ts +10 -0
- package/src/components/utils/component-config-builder/prototype/loading.ts +10 -0
- package/src/components/utils/component-config-builder/prototype/rounded.ts +11 -0
- package/src/components/utils/component-config-builder/prototype/shadow.ts +11 -0
- package/src/components/utils/component-config-builder/prototype/size.ts +11 -0
- package/src/components/utils/component-config-builder/prototype/transition-duration.ts +11 -0
- package/src/components/utils/component-config-builder/prototype/transition.ts +10 -0
- package/src/components/utils/component-config-builder/prototype/variant.ts +11 -0
- package/src/components/utils/component-styling-builder/component-styling-builder.ts +45 -0
- package/src/components/utils/component-styling-builder/component-styling-builder.type.ts +26 -0
- package/src/components/utils/component-styling-builder/component-styling.type.ts +21 -0
- package/src/components/utils/component-styling-builder/index.ts +7 -0
- package/src/components/utils/component-styling-builder/prototype/active.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/background.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/base.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/border.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/build.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/custom.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/disabled.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/focus.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/hover.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/loading.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/read-only.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/rounded.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/shadow.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/size.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/transition.ts +10 -0
- package/src/components/utils/component-styling-builder/prototype/variant.ts +10 -0
- package/src/components/utils/index.ts +6 -0
- package/src/components/utils/readme.md +1 -0
- package/src/css.d.ts +14 -0
- package/src/debug-tokens.syn +11 -0
- package/src/design/sizes/index.ts +6 -0
- package/src/design/utility/class-names.ts +6 -0
- package/src/design/utility/index.ts +6 -0
- package/src/design/utility/rounded-classes.ts +6 -0
- package/src/docs/EXAMPLES.md +319 -0
- package/src/docs/EXAMPLES.ts.md +188 -0
- package/src/docs/IMPLEMENTATION_COMPLETE.md +232 -0
- package/src/docs/IMPLEMENTATION_PATTERN.md +319 -0
- package/src/docs/copilot-implementation-rules.md +328 -0
- package/src/index.ts +23 -0
- package/src/jsx.d.ts +8 -0
- package/src/lab/counter.syn +76 -0
- package/src/lab/transformer/README.md +115 -0
- package/src/lab/transformer/async-lazy-loading/2026-02-11-14-20-async-lazy-loading.syn +242 -0
- package/src/lab/transformer/batch-updates/2026-02-11-14-20-batch-updates.syn +228 -0
- package/src/lab/transformer/catcher-error-handlers/2026-02-11-14-20-catcher-error-handlers.syn +211 -0
- package/src/lab/transformer/complex-jsx-expressions/2026-02-11-14-20-complex-jsx-expressions.syn +49 -0
- package/src/lab/transformer/complex-jsx-expressions/2026-02-11-15-01-complex-jsx-expressions.syn +227 -0
- package/src/lab/transformer/concurrent-rendering/2026-02-11-14-20-concurrent-rendering.syn +291 -0
- package/src/lab/transformer/create-context-providers/2026-02-11-14-20-create-context-providers.syn +240 -0
- package/src/lab/transformer/create-effect-side-effects/2026-02-11-14-20-create-effect-side-effects.syn +339 -0
- package/src/lab/transformer/create-resource/2026-02-11-14-20-create-resource.syn +80 -0
- package/src/lab/transformer/dynamic-components/2026-02-11-14-20-dynamic-components.syn +78 -0
- package/src/lab/transformer/dynamic-components/2026-02-11-15-09-dynamic-components.syn +468 -0
- package/src/lab/transformer/for-iteration/2026-02-11-14-20-for-iteration.syn +62 -0
- package/src/lab/transformer/for-iteration-components/2026-02-11-15-07-for-iteration-components.syn +489 -0
- package/src/lab/transformer/generic-type-arguments/2026-02-11-14-20-generic-type-arguments.syn +53 -0
- package/src/lab/transformer/generic-type-arguments/2026-02-11-15-02-generic-type-arguments.syn +140 -0
- package/src/lab/transformer/memo-optimization/2026-02-11-14-20-memo-optimization.syn +275 -0
- package/src/lab/transformer/on-cleanup-patterns/2026-02-11-14-20-on-cleanup-patterns.syn +375 -0
- package/src/lab/transformer/on-mount-lifecycle/2026-02-11-14-20-on-mount-lifecycle.syn +347 -0
- package/src/lab/transformer/portal-transformation/2026-02-11-14-20-portal-transformation.syn +141 -0
- package/src/lab/transformer/render-effect-timing/2026-02-11-14-20-render-effect-timing.syn +334 -0
- package/src/lab/transformer/resource-dependency-tracking/2026-02-11-14-20-resource-dependency-tracking.syn +153 -0
- package/src/lab/transformer/resource-loading-states/2026-02-11-14-20-resource-loading-states.syn +382 -0
- package/src/lab/transformer/resource-mutations/2026-02-11-14-20-resource-mutations.syn +399 -0
- package/src/lab/transformer/resource-parallel-fetching/2026-02-11-14-20-resource-parallel-fetching.syn +446 -0
- package/src/lab/transformer/resource-pre-resolution/2026-02-11-14-20-resource-pre-resolution.syn +405 -0
- package/src/lab/transformer/resource-refetch-patterns/2026-02-11-14-20-resource-refetch-patterns.syn +120 -0
- package/src/lab/transformer/resource-state-handling/2026-02-11-14-20-resource-state-handling.syn +104 -0
- package/src/lab/transformer/server-side-rendering/2026-02-11-14-20-server-side-rendering.syn +234 -0
- package/src/lab/transformer/show-components/2026-02-11-14-20-show-components.syn +57 -0
- package/src/lab/transformer/show-when-components/2026-02-11-15-03-show-when-components.syn +202 -0
- package/src/lab/transformer/template-literals/2026-02-11-14-20-template-literals.syn +34 -0
- package/src/lab/transformer/template-literals/2026-02-11-15-00-template-literals.syn +146 -0
- package/src/lab/transformer/tryer-error-boundaries/2026-02-11-14-20-tryer-error-boundaries.syn +111 -0
- package/src/lab/transformer/type-inference-system/2026-02-11-14-20-type-inference-system.syn +50 -0
- package/src/lab/transformer/type-inference-system/2026-02-11-15-05-type-inference-system.syn +353 -0
- package/src/lab/transformer/untrack-isolation/2026-02-11-14-20-untrack-isolation.syn +326 -0
- package/src/lab/transformer/waiting-suspense/2026-02-11-14-20-waiting-suspense.syn +78 -0
- package/src/main-simple.syn +23 -0
- package/src/main.syn +101 -0
- package/src/main.ts +57 -0
- package/src/showcase/__tests__/e2e/context-structure.spec.ts +46 -0
- package/src/showcase/__tests__/e2e/context-ui.spec.ts +137 -0
- package/src/showcase/__tests__/e2e/control-flow-ui.spec.ts +149 -0
- package/src/showcase/__tests__/e2e/debug-compiled.spec.ts +13 -0
- package/src/showcase/__tests__/e2e/debug-screenshot.png +0 -0
- package/src/showcase/__tests__/e2e/debug.spec.ts +20 -0
- package/src/showcase/__tests__/e2e/deep-debug.spec.ts +130 -0
- package/src/showcase/__tests__/e2e/error-boundary-ui.spec.ts +113 -0
- package/src/showcase/__tests__/e2e/main-transformed.js +0 -0
- package/src/showcase/__tests__/e2e/portal-ui.spec.ts +135 -0
- package/src/showcase/__tests__/e2e/reactivity-ui.spec.ts +81 -0
- package/src/showcase/__tests__/e2e/resource-debug.spec.ts +37 -0
- package/src/showcase/__tests__/e2e/visual-debug.spec.ts +147 -0
- package/src/showcase/__tests__/integration/context-provider-consumer.test.ts +114 -0
- package/src/showcase/__tests__/integration/context-ui.test.ts +150 -0
- package/src/showcase/__tests__/integration/error-boundary-reactivity.test.ts +164 -0
- package/src/showcase/__tests__/integration/reactivity-control-flow.test.ts +226 -0
- package/src/showcase/__tests__/integration/reactivity-cross-component.test.ts +103 -0
- package/src/showcase/__tests__/integration/showcase-navigation.test.ts +159 -0
- package/src/showcase/__tests__/setup.ts +37 -0
- package/src/showcase/__tests__/unit/context.test.ts +122 -0
- package/src/showcase/__tests__/unit/control-flow.test.ts +167 -0
- package/src/showcase/__tests__/unit/error-boundary.test.ts +116 -0
- package/src/showcase/__tests__/unit/portal.test.ts +122 -0
- package/src/showcase/__tests__/unit/reactivity.test.ts +152 -0
- package/src/showcase/about/about.syn +59 -0
- package/src/showcase/about/components/details-section.syn +29 -0
- package/src/showcase/about/components/feature-list.syn +23 -0
- package/src/showcase/about/components/index.ts +7 -0
- package/src/showcase/about/components/route-info.syn +29 -0
- package/src/showcase/bootstrap/bootstrap-test.syn +152 -0
- package/src/showcase/bootstrap/components/config-service-error-view.syn +41 -0
- package/src/showcase/bootstrap/components/config-service-resolved-view.syn +69 -0
- package/src/showcase/bootstrap/demos/basic-demo.syn +26 -0
- package/src/showcase/bootstrap/demos/di-demo-interactive.syn +94 -0
- package/src/showcase/bootstrap/demos/di-demo.syn +64 -0
- package/src/showcase/bootstrap/demos/lifecycle-demo.syn +74 -0
- package/src/showcase/bootstrap/demos/return-value-demo.syn +95 -0
- package/src/showcase/bootstrap/types/config-service.types.ts +9 -0
- package/src/showcase/common/components/code-block.syn +24 -0
- package/src/showcase/common/components/console-log-viewer.syn +133 -0
- package/src/showcase/common/components/demo-button.syn +42 -0
- package/src/showcase/common/components/demo-section.syn +29 -0
- package/src/showcase/common/components/index.ts +13 -0
- package/src/showcase/common/components/isolated-demo.syn +95 -0
- package/src/showcase/common/components/modal.syn +58 -0
- package/src/showcase/common/components/page-header.syn +29 -0
- package/src/showcase/common/components/status-indicator.syn +34 -0
- package/src/showcase/common/examples/logging-example.syn +67 -0
- package/src/showcase/common/hooks/use-logger.ts +60 -0
- package/src/showcase/context/components/index.ts +12 -0
- package/src/showcase/context/components/multi-context-dashboard.syn +135 -0
- package/src/showcase/context/components/settings-provider.syn +35 -0
- package/src/showcase/context/components/theme-controls.syn +51 -0
- package/src/showcase/context/components/theme-provider.syn +25 -0
- package/src/showcase/context/components/themed-box.syn +20 -0
- package/src/showcase/context/components/user-controls.syn +38 -0
- package/src/showcase/context/components/user-profile.syn +26 -0
- package/src/showcase/context/components/user-provider.syn +34 -0
- package/src/showcase/context/context-test.syn +66 -0
- package/src/showcase/control-flow/components/for-demo.syn +67 -0
- package/src/showcase/control-flow/components/index-demo.syn +41 -0
- package/src/showcase/control-flow/components/index.ts +8 -0
- package/src/showcase/control-flow/components/show-demo.syn +53 -0
- package/src/showcase/control-flow/control-flow-test.syn +104 -0
- package/src/showcase/di/components/circular-dependency-demo.syn +113 -0
- package/src/showcase/di/components/hierarchical-di-demo.syn +81 -0
- package/src/showcase/di/components/index.ts +6 -0
- package/src/showcase/di/components/lifetime-card.syn +30 -0
- package/src/showcase/di/components/registered-services-list.syn +29 -0
- package/src/showcase/di/components/resolution-result.syn +34 -0
- package/src/showcase/di/components/service-button.syn +26 -0
- package/src/showcase/di/components/service-lifetime-demo.syn +135 -0
- package/src/showcase/di/components/service-registration-demo.syn +85 -0
- package/src/showcase/di/components/service-resolution-demo.syn +145 -0
- package/src/showcase/di/di-test.syn +121 -0
- package/src/showcase/di/services/demo-services.ts +128 -0
- package/src/showcase/drag-drop/components/drag-drop-zone-demo.syn +75 -0
- package/src/showcase/drag-drop/components/index.ts +7 -0
- package/src/showcase/drag-drop/components/kanban-board-demo.syn +76 -0
- package/src/showcase/drag-drop/components/sortable-list-demo.syn +71 -0
- package/src/showcase/drag-drop/drag-drop-test.syn +44 -0
- package/src/showcase/error-boundary/components/basic-boundary-demo.syn +54 -0
- package/src/showcase/error-boundary/components/boundary-section.syn +47 -0
- package/src/showcase/error-boundary/components/cleanup-demo.syn +88 -0
- package/src/showcase/error-boundary/components/control-button-group.syn +48 -0
- package/src/showcase/error-boundary/components/error-boundary-control-panel.syn +76 -0
- package/src/showcase/error-boundary/components/error-boundary-status-summary.syn +46 -0
- package/src/showcase/error-boundary/components/error-component.syn +15 -0
- package/src/showcase/error-boundary/components/error-display.syn +27 -0
- package/src/showcase/error-boundary/components/index.ts +14 -0
- package/src/showcase/error-boundary/components/reset-flow-demo.syn +107 -0
- package/src/showcase/error-boundary/components/retry-counter-demo.syn +97 -0
- package/src/showcase/error-boundary/components/safe-component.syn +12 -0
- package/src/showcase/error-boundary/components/visual-boundary-wrapper.syn +78 -0
- package/src/showcase/error-boundary/error-boundary-mega.syn +180 -0
- package/src/showcase/error-boundary/error-boundary-simple.syn +88 -0
- package/src/showcase/error-boundary/error-boundary-test.syn +77 -0
- package/src/showcase/forms/components/async-validation-demo.syn +101 -0
- package/src/showcase/forms/components/basic-form-demo.syn +42 -0
- package/src/showcase/forms/components/field-state-demo.syn +70 -0
- package/src/showcase/forms/components/index.ts +9 -0
- package/src/showcase/forms/components/submission-demo.syn +78 -0
- package/src/showcase/forms/components/validation-demo.syn +59 -0
- package/src/showcase/forms/forms-test.syn +179 -0
- package/src/showcase/forms/pages/cross-validation-page.syn +181 -0
- package/src/showcase/forms/pages/dependent-fields-page.syn +122 -0
- package/src/showcase/forms/pages/dynamic-fields-page.syn +245 -0
- package/src/showcase/forms/pages/edit-form-page.syn +163 -0
- package/src/showcase/forms/pages/index.ts +10 -0
- package/src/showcase/forms/pages/select-controls-page.syn +112 -0
- package/src/showcase/forms/pages/wizard-page.syn +253 -0
- package/src/showcase/home/home.syn +22 -0
- package/src/showcase/http/components/abort-demo.syn +87 -0
- package/src/showcase/http/components/basic-requests-demo.syn +88 -0
- package/src/showcase/http/components/index.ts +8 -0
- package/src/showcase/http/components/interceptors-demo.syn +90 -0
- package/src/showcase/http/components/retry-demo.syn +84 -0
- package/src/showcase/http/http-test.syn +88 -0
- package/src/showcase/index.ts +46 -0
- package/src/showcase/jsx/components/event-handlers-demo.syn +78 -0
- package/src/showcase/jsx/components/index.ts +7 -0
- package/src/showcase/jsx/components/reactive-attributes-demo.syn +69 -0
- package/src/showcase/jsx/components/style-objects-demo.syn +40 -0
- package/src/showcase/jsx/jsx-test.syn +81 -0
- package/src/showcase/pages/__tests__/about.test.ts +120 -0
- package/src/showcase/pages/__tests__/assignment-test.test.ts +68 -0
- package/src/showcase/pages/__tests__/context-test.test.ts +218 -0
- package/src/showcase/pages/__tests__/control-flow-test.test.ts +184 -0
- package/src/showcase/pages/__tests__/error-boundary-test.test.ts +220 -0
- package/src/showcase/pages/__tests__/home.test.ts +54 -0
- package/src/showcase/pages/__tests__/jsx-test.test.ts +182 -0
- package/src/showcase/pages/__tests__/reactivity-test.test.ts +177 -0
- package/src/showcase/pages/__tests__/resource-test.test.ts +215 -0
- package/src/showcase/pages/error-boundary-mega-demo.syn +0 -0
- package/src/showcase/portal/components/basic-portal-demo.syn +41 -0
- package/src/showcase/portal/components/index.ts +7 -0
- package/src/showcase/portal/components/modal-portal-demo.syn +84 -0
- package/src/showcase/portal/components/tooltip-portal-demo.syn +56 -0
- package/src/showcase/portal/portal-test.syn +44 -0
- package/src/showcase/reactivity/components/batch-demo.syn +43 -0
- package/src/showcase/reactivity/components/effect-demo.syn +19 -0
- package/src/showcase/reactivity/components/index.ts +11 -0
- package/src/showcase/reactivity/components/memo-demo.syn +29 -0
- package/src/showcase/reactivity/components/render-effect-demo.syn +78 -0
- package/src/showcase/reactivity/components/signal-demo.syn +45 -0
- package/src/showcase/reactivity/components/untrack-demo.syn +67 -0
- package/src/showcase/reactivity/components/use-sync-demo.syn +96 -0
- package/src/showcase/reactivity/reactivity-test.syn +170 -0
- package/src/showcase/resource/components/cache-demo.syn +141 -0
- package/src/showcase/resource/components/coordination-demo.syn +136 -0
- package/src/showcase/resource/components/deduplication-demo.syn +33 -0
- package/src/showcase/resource/components/error-resource-demo.syn +93 -0
- package/src/showcase/resource/components/image-card.syn +53 -0
- package/src/showcase/resource/components/image-gallery-demo.syn +56 -0
- package/src/showcase/resource/components/index.ts +15 -0
- package/src/showcase/resource/components/mock-api.ts +67 -0
- package/src/showcase/resource/components/refetch-clear-demo.syn +99 -0
- package/src/showcase/resource/components/suspend-control-demo.syn +62 -0
- package/src/showcase/resource/components/suspense-skeleton.syn +24 -0
- package/src/showcase/resource/components/user-card.syn +57 -0
- package/src/showcase/resource/components/waiting-demo.syn +118 -0
- package/src/showcase/resource/resource-test.syn +193 -0
- package/src/showcase/routing/components/guard-demo.syn +75 -0
- package/src/showcase/routing/components/index.ts +9 -0
- package/src/showcase/routing/components/navigation-demo.syn +47 -0
- package/src/showcase/routing/components/nested-outlet-demo.syn +73 -0
- package/src/showcase/routing/components/params-demo.syn +54 -0
- package/src/showcase/routing/components/query-demo.syn +63 -0
- package/src/showcase/routing/routing-test.syn +102 -0
- package/src/showcase/ssr/components/escape-demo.syn +80 -0
- package/src/showcase/ssr/components/hydrate-demo.syn +142 -0
- package/src/showcase/ssr/components/hydration-script-demo.syn +104 -0
- package/src/showcase/ssr/components/index.ts +8 -0
- package/src/showcase/ssr/components/render-to-string-demo.syn +71 -0
- package/src/showcase/ssr/ssr-test.syn +88 -0
- package/src/showcase/svg-canvas/board/components/canvas-badge-list.syn +59 -0
- package/src/showcase/svg-canvas/board/components/canvas-draw-preview.syn +75 -0
- package/src/showcase/svg-canvas/board/components/canvas-toolbar.syn +59 -0
- package/src/showcase/svg-canvas/board/components/line-canvas.syn +673 -0
- package/src/showcase/svg-canvas/board/components/side-toolbox.syn +51 -0
- package/src/showcase/svg-canvas/board/components/svg/canvas-dot-grid.syn +18 -0
- package/src/showcase/svg-canvas/board/model/i-board.ts +20 -0
- package/src/showcase/svg-canvas/board/store/canvas-board.slice.ts +51 -0
- package/src/showcase/svg-canvas/index.ts +2 -0
- package/src/showcase/svg-canvas/line/components/canvas-line-item.syn +85 -0
- package/src/showcase/svg-canvas/line/components/svg/svg-endpoint-handle.syn +29 -0
- package/src/showcase/svg-canvas/line/components/svg/svg-line-label.syn +33 -0
- package/src/showcase/svg-canvas/line/entity/canvas-line.ts +42 -0
- package/src/showcase/svg-canvas/line/entity/create-canvas-line.ts +24 -0
- package/src/showcase/svg-canvas/line/model/i-canvas-line.ts +42 -0
- package/src/showcase/svg-canvas/line/store/canvas-line.slice.ts +38 -0
- package/src/showcase/svg-canvas/modal/components/canvas-settings-modal.syn +118 -0
- package/src/showcase/svg-canvas/modal/model/i-canvas-modal.ts +10 -0
- package/src/showcase/svg-canvas/modal/store/canvas-modal.slice.ts +36 -0
- package/src/showcase/svg-canvas/shape/components/canvas-anchor-group.syn +33 -0
- package/src/showcase/svg-canvas/shape/components/canvas-diamond-body.syn +48 -0
- package/src/showcase/svg-canvas/shape/components/canvas-entity-card.syn +89 -0
- package/src/showcase/svg-canvas/shape/components/canvas-rect-body.syn +37 -0
- package/src/showcase/svg-canvas/shape/components/canvas-shape-item.syn +110 -0
- package/src/showcase/svg-canvas/shape/components/card-header.syn +45 -0
- package/src/showcase/svg-canvas/shape/components/property-row.syn +29 -0
- package/src/showcase/svg-canvas/shape/components/svg/svg-anchor-circle.syn +44 -0
- package/src/showcase/svg-canvas/shape/entity/canvas-diamond.ts +102 -0
- package/src/showcase/svg-canvas/shape/entity/canvas-entity.ts +19 -0
- package/src/showcase/svg-canvas/shape/entity/canvas-rectangle.ts +53 -0
- package/src/showcase/svg-canvas/shape/entity/canvas-square.ts +72 -0
- package/src/showcase/svg-canvas/shape/entity/create-shape.ts +69 -0
- package/src/showcase/svg-canvas/shape/model/i-shape.ts +37 -0
- package/src/showcase/svg-canvas/shape/store/canvas-shape.slice.ts +38 -0
- package/src/showcase/svg-canvas/shared/atoms/canvas-badge.syn +34 -0
- package/src/showcase/svg-canvas/shared/atoms/canvas-icon-btn.syn +32 -0
- package/src/showcase/svg-canvas/shared/atoms/canvas-text-input.syn +27 -0
- package/src/showcase/svg-canvas/shared/helpers/canvas-dom-ops.ts +187 -0
- package/src/showcase/svg-canvas/shared/helpers/canvas-helpers.ts +112 -0
- package/src/showcase/svg-canvas/shared/helpers/route-orthogonal.ts +176 -0
- package/src/showcase/svg-canvas/shared/model/i-drag.ts +84 -0
- package/src/showcase/svg-canvas/shared/model/i-entity.ts +71 -0
- package/src/showcase/svg-canvas/store/canvas-store.ts +60 -0
- package/src/showcase/svg-canvas/svg-canvas-page.syn +28 -0
- package/src/showcase/tests/assignment-test.syn +37 -0
- package/src/showcase/tests/minimal-export-test.syn +7 -0
- package/src/showcase/tests/object-literal-test.syn +26 -0
- package/src/showcase/tests/simple-codegen-test.syn +12 -0
- package/src/showcase/tests/simple-test.syn +51 -0
- package/src/showcase/tests/template-literal-demo.syn +138 -0
- package/src/showcase-styles.css +96 -0
- package/src/styles/design-system.css +275 -0
- package/src/styles/motion.css +121 -0
- package/src/styles/showcase-base.css +522 -0
- package/src/styles/showcase.css +653 -0
- package/src/styles/state-layers.css +55 -0
- package/src/styles/touch-targets.css +41 -0
- package/src/styles/transitions.css +617 -0
- package/src/styles/utilities.css +115 -0
- package/src/styles.css +23 -0
- package/src/test-keywords.syn +15 -0
- package/src/test-loop.syn +29 -0
- package/src/test-minimal.syn +9 -0
- package/src/test-object-literal.syn +19 -0
- package/src/test-simple.syn +12 -0
- package/src/types/psr-modules.d.ts +6 -0
- package/src/types.ts +37 -0
- package/tailwind.config.js +354 -0
- package/test-results/.last-run.json +4 -0
- package/test-signal-debug.syn +9 -0
- package/test-transformation.ts +35 -0
- package/tsconfig.build.json +31 -0
- package/tsconfig.json +44 -0
- package/tsconfig.stories.json +10 -0
- package/vite.config.ts +47 -0
- package/vitest.config.ts +41 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form Adapter Interface
|
|
3
|
+
* Provides a generic abstraction layer for any form library (RHF, Formik, etc.)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Generic form state structure
|
|
10
|
+
*/
|
|
11
|
+
export interface FormState {
|
|
12
|
+
/** Field errors keyed by field name */
|
|
13
|
+
errors: { [x: string]: any }
|
|
14
|
+
/** Fields that have been touched/interacted with */
|
|
15
|
+
touchedFields: { [x: string]: any }
|
|
16
|
+
/** Fields that have been modified from default values */
|
|
17
|
+
dirtyFields: { [x: string]: any }
|
|
18
|
+
/** Whether form is currently validating */
|
|
19
|
+
isValidating: boolean
|
|
20
|
+
/** Default/initial form values */
|
|
21
|
+
defaultValues?: any
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Options for setValue operation
|
|
26
|
+
*/
|
|
27
|
+
export interface SetValueOptions {
|
|
28
|
+
shouldDirty?: boolean
|
|
29
|
+
shouldTouch?: boolean
|
|
30
|
+
shouldValidate?: boolean
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Form Adapter Interface
|
|
35
|
+
* Any form library must implement this interface to work with Stepper
|
|
36
|
+
*/
|
|
37
|
+
export interface FormAdapter {
|
|
38
|
+
// State Access
|
|
39
|
+
/** Get current form state (errors, touched, dirty, validating, defaults) */
|
|
40
|
+
getFormState: () => FormState
|
|
41
|
+
|
|
42
|
+
// Validation
|
|
43
|
+
/** Trigger validation for specific fields or all fields */
|
|
44
|
+
trigger: (fields?: string[]) => Promise<boolean>
|
|
45
|
+
|
|
46
|
+
// Value Operations
|
|
47
|
+
/** Get form values - all values, single field, or multiple fields */
|
|
48
|
+
getValues: (name?: string | string[]) => any
|
|
49
|
+
|
|
50
|
+
/** Set a field value with optional behavior flags */
|
|
51
|
+
setValue: (name: string, value: any, options?: SetValueOptions) => void
|
|
52
|
+
|
|
53
|
+
// Field Operations
|
|
54
|
+
/** Reset a single field to its default value */
|
|
55
|
+
resetField: (name: string) => void
|
|
56
|
+
|
|
57
|
+
/** Clear errors for specific fields or all fields */
|
|
58
|
+
clearErrors: (name?: string | string[]) => void
|
|
59
|
+
|
|
60
|
+
// Form Operations
|
|
61
|
+
/** Reset entire form to default values */
|
|
62
|
+
reset: (values?: any) => void
|
|
63
|
+
|
|
64
|
+
/** Set focus to a specific field (optional) */
|
|
65
|
+
setFocus?: (name: string) => void
|
|
66
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/**
|
|
3
|
+
* Stepper helpers
|
|
4
|
+
*/
|
|
5
|
+
import { StepperActionsKind } from './actions'
|
|
6
|
+
import { FormAdapter } from './formAdapter'
|
|
7
|
+
import {
|
|
8
|
+
Action,
|
|
9
|
+
CustomValidation,
|
|
10
|
+
IStepAvailabilityTriggeredBy,
|
|
11
|
+
ITrigger,
|
|
12
|
+
Payload,
|
|
13
|
+
PayloadValueTypes,
|
|
14
|
+
SiblingFinderResult,
|
|
15
|
+
StepperState
|
|
16
|
+
} from './models'
|
|
17
|
+
|
|
18
|
+
/** tobe used with dispatch from useReducer in order to provide a payload for the action */
|
|
19
|
+
export const newStepAction = (
|
|
20
|
+
action: StepperActionsKind,
|
|
21
|
+
id: number | number[],
|
|
22
|
+
value: PayloadValueTypes
|
|
23
|
+
): Action => {
|
|
24
|
+
return {
|
|
25
|
+
type: action,
|
|
26
|
+
payload: {
|
|
27
|
+
stepId: id,
|
|
28
|
+
value: value
|
|
29
|
+
} as Payload
|
|
30
|
+
} as Action
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** To be implemented later */
|
|
34
|
+
export const newCustomValidation = (
|
|
35
|
+
stepId: number,
|
|
36
|
+
name: string,
|
|
37
|
+
method: () => void
|
|
38
|
+
): CustomValidation => {
|
|
39
|
+
return {
|
|
40
|
+
stepId,
|
|
41
|
+
name,
|
|
42
|
+
method
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// abstractes IStepAvailabilityTriggeredBy object creation
|
|
47
|
+
export const newVisibilitySkipPattern = (id: number, triggeredBy: ITrigger[]) => {
|
|
48
|
+
return {
|
|
49
|
+
id: id,
|
|
50
|
+
triggeredBy: triggeredBy
|
|
51
|
+
} as IStepAvailabilityTriggeredBy
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// gets the ids list of steps that can be processed.
|
|
55
|
+
// if shouldSkip is found in association with altered fields and expected (to be skip) values then the id is skiped
|
|
56
|
+
export const getAllowedIds = (
|
|
57
|
+
ids: number[],
|
|
58
|
+
dirtyFields: string[],
|
|
59
|
+
shouldSkip: IStepAvailabilityTriggeredBy[],
|
|
60
|
+
getValues: FormAdapter['getValues']
|
|
61
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
62
|
+
) => {
|
|
63
|
+
if (dirtyFields.length === 0 || shouldSkip.length === 0) return ids
|
|
64
|
+
|
|
65
|
+
const output: number[] = []
|
|
66
|
+
|
|
67
|
+
for (const _id of ids) {
|
|
68
|
+
// find the patterns matching to ID
|
|
69
|
+
const _patterns = shouldSkip.filter((o) => o.id === _id)
|
|
70
|
+
if (_patterns.length === 0) {
|
|
71
|
+
output.push(_id)
|
|
72
|
+
continue
|
|
73
|
+
}
|
|
74
|
+
// verify if some dirty fields were found for
|
|
75
|
+
for (const _pt of _patterns) {
|
|
76
|
+
const outValue = []
|
|
77
|
+
// check if any triggered field has any value
|
|
78
|
+
for (const triggerField of _pt.triggeredBy) {
|
|
79
|
+
const value = getValues(triggerField.name)
|
|
80
|
+
if (
|
|
81
|
+
/// if value is has a value and skipIfValues is not waiting 'undefined'
|
|
82
|
+
(!value && triggerField.skipIfValue !== undefined) ||
|
|
83
|
+
value === triggerField.skipIfValue
|
|
84
|
+
)
|
|
85
|
+
continue
|
|
86
|
+
// if the value matches the skipIfValue and is not null or undefined
|
|
87
|
+
outValue.push(value)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (outValue.length < _pt.triggeredBy.length) {
|
|
91
|
+
continue
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (!output?.includes(_id)) {
|
|
95
|
+
output.push(_id)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return output
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** extracts the error object to an ErrorCollection array */
|
|
104
|
+
export const errorToList = (errorObject: { [s: string]: unknown | any }): Error[] => {
|
|
105
|
+
const errorFields: Error[] = []
|
|
106
|
+
|
|
107
|
+
// loop each RHF Error object childs
|
|
108
|
+
Object.entries(errorObject).forEach((error) => {
|
|
109
|
+
// get the field name
|
|
110
|
+
errorFields.push({ name: error[0], message: error[1] ? (error[1]['type'] as string) : '' })
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
return errorFields
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* It's used by the computeSiblings
|
|
118
|
+
* this helps to figureout the next available step that should satisfy some rules:
|
|
119
|
+
* the next step must be available (visible)
|
|
120
|
+
* the next step must be reachable (not locked)
|
|
121
|
+
* the current step must be valid in order to move
|
|
122
|
+
* if not it offsets to the next reachable step which meets the expectations.
|
|
123
|
+
* @param state the current state
|
|
124
|
+
* @param fromId the starting point ID
|
|
125
|
+
* @returns the computed sibling
|
|
126
|
+
*/
|
|
127
|
+
export const findNextAvailableSibling = (
|
|
128
|
+
state: StepperState,
|
|
129
|
+
fromId: number
|
|
130
|
+
): SiblingFinderResult | undefined => {
|
|
131
|
+
if (!state || !state.steps || state.steps.length === 0) return undefined
|
|
132
|
+
|
|
133
|
+
const output: SiblingFinderResult = {
|
|
134
|
+
// define starting point
|
|
135
|
+
stepId: fromId,
|
|
136
|
+
step: state.steps.find((o) => o.id === fromId + 1),
|
|
137
|
+
// navigate from currentState
|
|
138
|
+
canGo: fromId + 1 <= state.steps.length,
|
|
139
|
+
// currentState
|
|
140
|
+
isFirst: false,
|
|
141
|
+
// currentState
|
|
142
|
+
isLast: fromId + 1 > state.steps.length
|
|
143
|
+
}
|
|
144
|
+
// return last if from id + 1 overflows collection length
|
|
145
|
+
if (!output.canGo) return output
|
|
146
|
+
|
|
147
|
+
// reset cango status so it can be recalculated
|
|
148
|
+
output.canGo = false
|
|
149
|
+
|
|
150
|
+
while (!output.canGo) {
|
|
151
|
+
output.stepId = output.stepId + 1
|
|
152
|
+
output.step = state.steps.find((o) => o.id === output.stepId)
|
|
153
|
+
output.canGo =
|
|
154
|
+
output.stepId <= state.steps.length &&
|
|
155
|
+
output.step !== undefined &&
|
|
156
|
+
!output.step.isLocked &&
|
|
157
|
+
output.step.isVisible
|
|
158
|
+
output.isLast = output.stepId > state.steps.length
|
|
159
|
+
|
|
160
|
+
// should never happend
|
|
161
|
+
if (output.stepId > state.steps.length) return output
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return output
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* It's used by the computeSiblings
|
|
169
|
+
* this helps to figureout the previous available step that should satisfy some rules:
|
|
170
|
+
* the previous step must be available (visible)
|
|
171
|
+
* the previous step must be reachable (not locked)
|
|
172
|
+
* the current step must be valid in order to move
|
|
173
|
+
* if not it offsets to the previous reachable step which meets the expectations.
|
|
174
|
+
* @param state the current state
|
|
175
|
+
* @param fromId the starting point ID
|
|
176
|
+
* @returns the computed sibling
|
|
177
|
+
*/
|
|
178
|
+
export const findPreviousAvailableSibling = (
|
|
179
|
+
state: StepperState,
|
|
180
|
+
fromId: number
|
|
181
|
+
): SiblingFinderResult | undefined => {
|
|
182
|
+
if (!state || !state.steps || state.steps.length === 0) return undefined
|
|
183
|
+
|
|
184
|
+
const output: SiblingFinderResult = {
|
|
185
|
+
// define starting point
|
|
186
|
+
stepId: fromId,
|
|
187
|
+
step: state.steps.find((o) => o.id === fromId - 1),
|
|
188
|
+
// navigate from currentState
|
|
189
|
+
canGo: fromId - 1 >= 0,
|
|
190
|
+
// currentState
|
|
191
|
+
isLast: false,
|
|
192
|
+
// currentState
|
|
193
|
+
isFirst: fromId - 1 < 0
|
|
194
|
+
}
|
|
195
|
+
// return last if from id + 1 overflows collection length
|
|
196
|
+
if (!output.canGo) return output
|
|
197
|
+
|
|
198
|
+
// reset cango status so it can be recalculated
|
|
199
|
+
output.canGo = false
|
|
200
|
+
|
|
201
|
+
while (!output.canGo) {
|
|
202
|
+
output.stepId = output.stepId - 1
|
|
203
|
+
output.step = state.steps.find((o) => o.id === output.stepId)
|
|
204
|
+
output.canGo =
|
|
205
|
+
output.stepId >= 0 &&
|
|
206
|
+
output.step !== undefined &&
|
|
207
|
+
!output.step.isLocked &&
|
|
208
|
+
output.step.isVisible
|
|
209
|
+
output.isFirst = output.stepId < 0
|
|
210
|
+
|
|
211
|
+
// should never happend
|
|
212
|
+
if (output.stepId < 0) return output
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return output
|
|
216
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { StepperActionsKind } from './actions'
|
|
3
|
+
|
|
4
|
+
/** the stepper base configuration options */
|
|
5
|
+
export interface StepperOptions {
|
|
6
|
+
enableFooterNavigation?: boolean
|
|
7
|
+
debug?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Generic form state metadata
|
|
12
|
+
* Replaces RHFCommon - now form library agnostic
|
|
13
|
+
*/
|
|
14
|
+
export interface FormCommon {
|
|
15
|
+
errors: { [x: string]: any }
|
|
16
|
+
touchedFields: { [x: string]: any }
|
|
17
|
+
dirtyFields: { [x: string]: any }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* when default is selected it will validate only from first step to the current one.
|
|
22
|
+
* when field is selected: KEY MUST BE A STRING
|
|
23
|
+
* when all is selected: KEY IS OMMITED
|
|
24
|
+
* when step is selected: KEY MUST BE A NUMBER
|
|
25
|
+
* */
|
|
26
|
+
export type ValidationMode = 'default' | 'field' | 'all' | 'step'
|
|
27
|
+
|
|
28
|
+
export type StepperNavigationRequest = 'back' | 'next' | 'goto' | 'unset'
|
|
29
|
+
|
|
30
|
+
/** the possible payload values types */
|
|
31
|
+
export type PayloadValueTypes =
|
|
32
|
+
| string
|
|
33
|
+
| number
|
|
34
|
+
| number
|
|
35
|
+
| boolean
|
|
36
|
+
| undefined
|
|
37
|
+
| Error[]
|
|
38
|
+
| { [x: string]: any }
|
|
39
|
+
| StepperDefaultValue
|
|
40
|
+
| FormCommon
|
|
41
|
+
| StepperNavigationRequest
|
|
42
|
+
| StepperError
|
|
43
|
+
| StepperError[]
|
|
44
|
+
| StepperState
|
|
45
|
+
| StepperSibling
|
|
46
|
+
| StepItem
|
|
47
|
+
| StepItem[]
|
|
48
|
+
| StepBulkUpdate
|
|
49
|
+
| StepField
|
|
50
|
+
| StepField[]
|
|
51
|
+
| CustomValidation
|
|
52
|
+
| CustomValidation[]
|
|
53
|
+
| StepsVisibility
|
|
54
|
+
|
|
55
|
+
/** the Stepper sibling
|
|
56
|
+
* this is used as navigation cursor metadata.
|
|
57
|
+
* it tells stepper about state of sibling steps.
|
|
58
|
+
* whith it the stepper can let move forward /backward or jump to a step
|
|
59
|
+
*/
|
|
60
|
+
export interface StepperSibling {
|
|
61
|
+
previousStep?: StepItem
|
|
62
|
+
currentStep?: StepItem
|
|
63
|
+
nextStep?: StepItem
|
|
64
|
+
canGoBack: boolean
|
|
65
|
+
canGoNext: boolean
|
|
66
|
+
isLast: boolean
|
|
67
|
+
isFirst: boolean
|
|
68
|
+
// to be implemented later
|
|
69
|
+
direction: 'forward' | 'backward'
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** wrapper error object
|
|
73
|
+
* with this item we can define in which step the error occurs.
|
|
74
|
+
*/
|
|
75
|
+
export interface StepperError {
|
|
76
|
+
stepId: number
|
|
77
|
+
fieldName: string
|
|
78
|
+
error: Error
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** this is the model to encapsulate all steps that should be set visible or not */
|
|
82
|
+
export interface StepsVisibility {
|
|
83
|
+
ids: number[]
|
|
84
|
+
visible: boolean
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** this is the core stepper state */
|
|
88
|
+
export interface StepperState {
|
|
89
|
+
// the steps should be registered only once when the form is rendered. this is handled by the Step.tsx component
|
|
90
|
+
steps: StepItem[]
|
|
91
|
+
// the current sibling states. Is computed each navigation / validation / jump
|
|
92
|
+
sibling?: StepperSibling
|
|
93
|
+
// to be implemented later (can be needed to combine fields)
|
|
94
|
+
customValidators?: CustomValidation[]
|
|
95
|
+
// stepper errors (combines validtion and navigation issues)
|
|
96
|
+
errors: StepperError[]
|
|
97
|
+
// to be implemented when Backend API will be ready. This will be the output data as is defined by the Bckend Api Contract
|
|
98
|
+
data: string
|
|
99
|
+
// count how many times the stepper has been submitted. <=> RHF feature
|
|
100
|
+
submissionTimes: number
|
|
101
|
+
// keeps the previous navigated step.
|
|
102
|
+
previousStepId?: number
|
|
103
|
+
// this is the current CURSOR navigation ID (StepId)
|
|
104
|
+
currentStepId?: number
|
|
105
|
+
// this is RHF Touched Fields
|
|
106
|
+
touchedFields: string[]
|
|
107
|
+
// this is RHF Dirty Fields
|
|
108
|
+
dirtyFields: string[]
|
|
109
|
+
// the navigation Request next => previous <= goto (number navigationRequestGoto Step Id)
|
|
110
|
+
navigationRequest: StepperNavigationRequest
|
|
111
|
+
// if the navigation request is set to goto then this property must be set
|
|
112
|
+
navigationRequestGoto?: number
|
|
113
|
+
// tells if the stepper has been loaded (to be implemented if needed itherwise will be removed)
|
|
114
|
+
loaded: boolean
|
|
115
|
+
// tells if the stepper is in valid state, this is a deductive notion from validation and Errors
|
|
116
|
+
isValid: boolean
|
|
117
|
+
// default commonm value
|
|
118
|
+
defaultValue: StepperDefaultValue[]
|
|
119
|
+
// tells if the submit button has been pushed
|
|
120
|
+
submitRequest: boolean
|
|
121
|
+
// tells if the stepper is ready (steps and fields available)
|
|
122
|
+
ready: boolean
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** the Step FIELD artifact will register all the fields that's belong to a step (handled by the person who implements the final form in the custom FORM it self) */
|
|
126
|
+
export interface StepField {
|
|
127
|
+
name: string
|
|
128
|
+
// Only when it's needed! This is used when we want to force a component to use a User Friendly Clear Value (i.e. Label than the ID)
|
|
129
|
+
// please ensure you can set a defaultValue to the targeted component.
|
|
130
|
+
// In general components uses their default display value and manages their ID's internally.
|
|
131
|
+
// Be carefull, do not use it as common default value storage. this is for special cases only
|
|
132
|
+
defaultValue?: string
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface StepperDefaultValue {
|
|
136
|
+
name: string
|
|
137
|
+
value: any
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** The step core state item */
|
|
141
|
+
export interface StepItem {
|
|
142
|
+
// the UNIQUE id that's must be provided in the Stepper Form definition and also provided to the Custom sub Form => <Step id={YourUniqueID} ><YourCustomForm id={YourUniqueID} ...
|
|
143
|
+
id: number
|
|
144
|
+
// this is the Lokalized Step label. Will be used for the breadcrumb step tab AND gathered by the sub Custom form as form TITLE !
|
|
145
|
+
label: string
|
|
146
|
+
// tells if the step is valid (computed by validation process)
|
|
147
|
+
isValid?: boolean
|
|
148
|
+
// tells if the step is applicable or NOT APPLICABLE at TIME "T" whit the current set of provided data. display a cross icon if N/A.
|
|
149
|
+
// In other words that means that the step has not relevant inpus for the sense of user input data.
|
|
150
|
+
isVisible: boolean
|
|
151
|
+
// tells if the step is REACHABLE or not REACHABLE
|
|
152
|
+
isLocked: boolean
|
|
153
|
+
// tells tha's the CURRENT DISPLAYED STEP ON SCREEN
|
|
154
|
+
isActive: boolean
|
|
155
|
+
// any field has got the focus (RHF)
|
|
156
|
+
isTouched: boolean
|
|
157
|
+
// any field has been filled (RHF)
|
|
158
|
+
isDirty: boolean
|
|
159
|
+
// the step has been visited at least once and validated (the stepper process needs this in order to know if the fields of the current step should be shown not validated at first sight.)
|
|
160
|
+
hasBeenValidated: boolean
|
|
161
|
+
// the fields collection
|
|
162
|
+
fields: StepField[]
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** the reducer action payload structure */
|
|
166
|
+
export interface Payload {
|
|
167
|
+
stepId: number | number[]
|
|
168
|
+
value?: PayloadValueTypes
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** upload data for a STEP that's nearly the same that the step structure with a few more flexibility */
|
|
172
|
+
export interface StepBulkUpdate {
|
|
173
|
+
id?: number
|
|
174
|
+
label?: string
|
|
175
|
+
isValid?: boolean
|
|
176
|
+
isVisible?: boolean
|
|
177
|
+
isLocked?: boolean
|
|
178
|
+
isActive?: boolean
|
|
179
|
+
fields: StepField[]
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** the action structure */
|
|
183
|
+
export interface Action {
|
|
184
|
+
type: StepperActionsKind
|
|
185
|
+
payload: Payload
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** the summary data structure */
|
|
189
|
+
export interface Summary {
|
|
190
|
+
name: string
|
|
191
|
+
value: string
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** to be implemented if needed
|
|
195
|
+
* this will heps to centralize complex validation instead to let user do this in the custom forms itself (can be aborted if not needed.)
|
|
196
|
+
*/
|
|
197
|
+
export interface CustomValidation {
|
|
198
|
+
stepId: number
|
|
199
|
+
name: string
|
|
200
|
+
method: () => void
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** used by the computeSibling process. this is the structure of findNext or findPrevious step... */
|
|
204
|
+
export interface SiblingFinderResult {
|
|
205
|
+
step?: StepItem
|
|
206
|
+
isLast: boolean
|
|
207
|
+
isFirst: boolean
|
|
208
|
+
canGo: boolean
|
|
209
|
+
stepId: number
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface ITrigger {
|
|
213
|
+
name: string
|
|
214
|
+
skipIfValue: any
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface IStepAvailabilityTriggeredBy {
|
|
218
|
+
id: number
|
|
219
|
+
triggeredBy: ITrigger[]
|
|
220
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CustomValidation, Payload, StepperState } from '../models'
|
|
2
|
+
|
|
3
|
+
/** OCCURS When we add errors to the stepper */
|
|
4
|
+
export const addCustomValidators = (
|
|
5
|
+
state: StepperState,
|
|
6
|
+
payload: Payload
|
|
7
|
+
): StepperState | undefined => {
|
|
8
|
+
const newValidators = payload.value as CustomValidation[]
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
...state,
|
|
12
|
+
customValidators: [...newValidators]
|
|
13
|
+
} as StepperState
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Payload, StepperError, StepperState } from '../models'
|
|
2
|
+
|
|
3
|
+
/** OCCURS When we add errors to the stepper */
|
|
4
|
+
export const addError = (state: StepperState, payload: Payload): StepperState | undefined => {
|
|
5
|
+
const newError = payload.value as StepperError
|
|
6
|
+
return { ...state, errors: [
|
|
7
|
+
...state.errors.filter(o =>
|
|
8
|
+
o.stepId !== newError.stepId &&
|
|
9
|
+
o.fieldName !== newError.fieldName), newError] } as StepperState
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Payload, StepItem, StepperState } from '../models'
|
|
2
|
+
|
|
3
|
+
/** OCCURS When we add a step */
|
|
4
|
+
export const addStep = (state: StepperState, payload: Payload): StepperState | undefined => {
|
|
5
|
+
const steps = [...state.steps.filter((o) => o.id !== payload.stepId), payload.value as StepItem]
|
|
6
|
+
return { ...state, steps: steps } as StepperState
|
|
7
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { findNextAvailableSibling, findPreviousAvailableSibling } from '../helpers'
|
|
2
|
+
import { StepperSibling, StepperState } from '../models'
|
|
3
|
+
|
|
4
|
+
/** OCCURS When we recompute the sibling status. */
|
|
5
|
+
export const computeSiblingStatus = (state: StepperState): StepperState | undefined => {
|
|
6
|
+
if (!state || !state.steps || state.steps.length === 0) return state as StepperState
|
|
7
|
+
const currentId = state.currentStepId !== undefined ? state.currentStepId : 0
|
|
8
|
+
|
|
9
|
+
const currentStep = state.steps.find((o) => o.id === currentId)
|
|
10
|
+
// we do not want to recalculate sibling if current step is invalid
|
|
11
|
+
if (!currentStep) return state as StepperState
|
|
12
|
+
// start point animation
|
|
13
|
+
const pastId = state.sibling && state.sibling.currentStep ? state.sibling?.currentStep?.id : 0
|
|
14
|
+
// animatio direction
|
|
15
|
+
const upcommingId = currentStep ? currentStep.id : 0
|
|
16
|
+
|
|
17
|
+
// find available previous and next
|
|
18
|
+
const findPrevious = findPreviousAvailableSibling(state, currentId)
|
|
19
|
+
const findNext = findNextAvailableSibling(state, currentId)
|
|
20
|
+
|
|
21
|
+
const previousStep = findPrevious?.step
|
|
22
|
+
const nextStep = findNext?.step
|
|
23
|
+
|
|
24
|
+
const canGoBack = findPrevious?.canGo
|
|
25
|
+
const canGoNext = findNext?.canGo
|
|
26
|
+
|
|
27
|
+
const isFirst = findPrevious?.isFirst
|
|
28
|
+
const isLast = findNext?.isLast
|
|
29
|
+
|
|
30
|
+
const sibling = {
|
|
31
|
+
canGoBack,
|
|
32
|
+
canGoNext,
|
|
33
|
+
currentStep,
|
|
34
|
+
nextStep,
|
|
35
|
+
previousStep,
|
|
36
|
+
isLast,
|
|
37
|
+
isFirst,
|
|
38
|
+
direction: pastId < upcommingId ? 'forward' : 'backward'
|
|
39
|
+
} as StepperSibling
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
...state,
|
|
43
|
+
sibling: sibling
|
|
44
|
+
} as StepperState
|
|
45
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* eslint-disable sonarjs/cognitive-complexity */
|
|
2
|
+
import { StepItem, StepperState } from '../models'
|
|
3
|
+
|
|
4
|
+
/** OCCURS When we recompute the validation */
|
|
5
|
+
export const computeValidation = (state: StepperState): StepperState | undefined => {
|
|
6
|
+
if (!state || state.currentStepId === undefined || !state.steps) return state
|
|
7
|
+
|
|
8
|
+
// siblings state
|
|
9
|
+
const newStepsVersion: StepItem[] = [...state.steps]
|
|
10
|
+
|
|
11
|
+
const currentStepId = state.currentStepId
|
|
12
|
+
if (currentStepId === undefined) return state
|
|
13
|
+
|
|
14
|
+
const currentStep = newStepsVersion.find((o) => o.id === currentStepId)
|
|
15
|
+
if (currentStep === undefined) return state
|
|
16
|
+
|
|
17
|
+
let requestedStepId = state.navigationRequestGoto
|
|
18
|
+
|
|
19
|
+
currentStep.isValid =
|
|
20
|
+
currentStep.isTouched &&
|
|
21
|
+
currentStep.isDirty &&
|
|
22
|
+
state.errors.filter((o) => o.stepId === currentStepId).length === 0
|
|
23
|
+
? true
|
|
24
|
+
: false
|
|
25
|
+
|
|
26
|
+
if (
|
|
27
|
+
requestedStepId !== undefined &&
|
|
28
|
+
(currentStep.id < requestedStepId || currentStep.id > requestedStepId)
|
|
29
|
+
) {
|
|
30
|
+
currentStep.hasBeenValidated = true
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// do validation
|
|
34
|
+
newStepsVersion.forEach((s: StepItem) => {
|
|
35
|
+
const touched = s.isTouched
|
|
36
|
+
const dirty = s.isDirty
|
|
37
|
+
// if requested navigation is located after any step having issues or not filled then set navigation ID to this one instead
|
|
38
|
+
if (
|
|
39
|
+
s.isVisible &&
|
|
40
|
+
requestedStepId !== undefined &&
|
|
41
|
+
s.id < requestedStepId &&
|
|
42
|
+
!(dirty && touched)
|
|
43
|
+
) {
|
|
44
|
+
// should take care of this step before moving forward
|
|
45
|
+
requestedStepId = s.id
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const formIsValid = newStepsVersion.filter((o) => o.isVisible).every((o) => o.isValid === true)
|
|
50
|
+
const sortedNewStepsVersion = [...newStepsVersion].sort((a, b) =>
|
|
51
|
+
a && b ? a.id - b.id : 1 + 2
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
...state,
|
|
56
|
+
navigationRequestGoto: requestedStepId,
|
|
57
|
+
steps: sortedNewStepsVersion,
|
|
58
|
+
isValid: formIsValid,
|
|
59
|
+
submitRequest: state.submitRequest ? formIsValid : false
|
|
60
|
+
} as StepperState
|
|
61
|
+
}
|