@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,130 @@
|
|
|
1
|
+
import { Button } from '../internal-components/button';
|
|
2
|
+
import {
|
|
3
|
+
CalendarCancelIcon,
|
|
4
|
+
CalendarIcon,
|
|
5
|
+
CalendarSearchIcon,
|
|
6
|
+
ClearIcon,
|
|
7
|
+
} from '../internal-components/icons';
|
|
8
|
+
import { PortalSlot } from '../internal-components/portal';
|
|
9
|
+
import { useToggleableContext } from '../toggleable/toggleable.context.hook';
|
|
10
|
+
import { useDatePickerContext } from './date-picker.context';
|
|
11
|
+
import DatePickerSwitch from './date-picker.switch';
|
|
12
|
+
|
|
13
|
+
interface IDatePickerDrawerHeaderProps {
|
|
14
|
+
id: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The `DatePickerDrawerHeader` component renders the header section of a date picker drawer.
|
|
19
|
+
*/
|
|
20
|
+
const DatePickerDrawerHeader = ({ id }: IDatePickerDrawerHeaderProps) => {
|
|
21
|
+
const { internalDate, updateGridMode, jumpToNow, jumpToSelection, selectedCells, clear, close } =
|
|
22
|
+
useDatePickerContext();
|
|
23
|
+
|
|
24
|
+
const { toggleState } = useToggleableContext();
|
|
25
|
+
|
|
26
|
+
const yearSelection = (e: MouseEvent) => {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
updateGridMode('YEAR');
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const monthSelection = (e: MouseEvent) => {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
updateGridMode('MONTH');
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const daySelection = (e: MouseEvent) => {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
updateGridMode('DAY');
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className="date-picker-header">
|
|
46
|
+
<div className="date-picker-header-top">
|
|
47
|
+
<div className="selected">
|
|
48
|
+
<Button
|
|
49
|
+
disabled={selectedCells().length === 0}
|
|
50
|
+
id="dp-selected"
|
|
51
|
+
title="go to selected (s)"
|
|
52
|
+
onClick={jumpToSelection}
|
|
53
|
+
>
|
|
54
|
+
<span className="mr-1">Selected</span>
|
|
55
|
+
<CalendarSearchIcon />
|
|
56
|
+
</Button>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div className="ml-1 now">
|
|
60
|
+
<Button id="dp-now" title="go to now (n)" onClick={jumpToNow}>
|
|
61
|
+
<span className="mr-1">Now</span>
|
|
62
|
+
<CalendarIcon />
|
|
63
|
+
</Button>
|
|
64
|
+
</div>
|
|
65
|
+
<div className="ml-1 clear">
|
|
66
|
+
<Button
|
|
67
|
+
disabled={selectedCells().length === 0}
|
|
68
|
+
id="dp-clear"
|
|
69
|
+
title="clear selection (c)"
|
|
70
|
+
onClick={clear}
|
|
71
|
+
>
|
|
72
|
+
<CalendarCancelIcon />
|
|
73
|
+
</Button>
|
|
74
|
+
</div>
|
|
75
|
+
<div className="ml-1 close">
|
|
76
|
+
<Button id="dp-close" title="close (Escape)" onClick={close}>
|
|
77
|
+
<ClearIcon />
|
|
78
|
+
</Button>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div className="date-picker-header-separator" />
|
|
82
|
+
<div className="date-picker-header-bottom">
|
|
83
|
+
<PortalSlot slotName="previous" />
|
|
84
|
+
|
|
85
|
+
<div className="date-picker-date-parts">
|
|
86
|
+
<div className="year">
|
|
87
|
+
<Button id="dp-year" title="year selection (y)" onClick={yearSelection}>
|
|
88
|
+
{internalDate()?.getFullYear()}
|
|
89
|
+
</Button>
|
|
90
|
+
</div>
|
|
91
|
+
<div className="month mx-1">
|
|
92
|
+
<Button id="dp-month" title="month selection (m)" onClick={monthSelection}>
|
|
93
|
+
{(internalDate()?.getMonth() || internalDate()?.getMonth() === 0
|
|
94
|
+
? internalDate()?.getMonth() + 1
|
|
95
|
+
: 0
|
|
96
|
+
)
|
|
97
|
+
?.toString()
|
|
98
|
+
?.padStart(2, '0')}
|
|
99
|
+
</Button>
|
|
100
|
+
</div>
|
|
101
|
+
<div className="day">
|
|
102
|
+
<Button id="dp-day" title="day selection (d)" onClick={daySelection}>
|
|
103
|
+
{internalDate()?.getDate?.()?.toString()?.padStart(2, '0')}
|
|
104
|
+
</Button>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
<PortalSlot slotName="next" />
|
|
108
|
+
</div>
|
|
109
|
+
<div className="date-picker-header-grid-mode">
|
|
110
|
+
<DatePickerSwitch
|
|
111
|
+
day={
|
|
112
|
+
<>
|
|
113
|
+
<div>Mon</div>
|
|
114
|
+
<div>Tue</div>
|
|
115
|
+
<div>Wed</div>
|
|
116
|
+
<div>Thu</div>
|
|
117
|
+
<div>Fri</div>
|
|
118
|
+
<div>Sat</div>
|
|
119
|
+
<div>Sun</div>
|
|
120
|
+
</>
|
|
121
|
+
}
|
|
122
|
+
month={<div>Month</div>}
|
|
123
|
+
year={<div>Years</div>}
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export default DatePickerDrawerHeader;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DatePickerDisplayType } from '../core/date-picker.types';
|
|
2
|
+
import { useDatePickerContext } from './date-picker.context';
|
|
3
|
+
|
|
4
|
+
interface IDatePickerSwitch {
|
|
5
|
+
day: HTMLElement;
|
|
6
|
+
month: HTMLElement;
|
|
7
|
+
year: HTMLElement;
|
|
8
|
+
definedGridMode?: DatePickerDisplayType;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A functional component that renders different content based on the current grid mode.
|
|
13
|
+
* The grid mode determines whether the day, month, or year is displayed.
|
|
14
|
+
*/
|
|
15
|
+
const DatePickerSwitch = ({ day, month, year, definedGridMode }: IDatePickerSwitch) => {
|
|
16
|
+
const { gridMode } = useDatePickerContext();
|
|
17
|
+
const _gridMode = definedGridMode ?? gridMode();
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
{_gridMode === 'DAY' && <>{day}</>}
|
|
21
|
+
{_gridMode === 'YEAR' && <>{year}</>}
|
|
22
|
+
{_gridMode === 'MONTH' && <>{month}</>}
|
|
23
|
+
</>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default DatePickerSwitch;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { getCurrentMonthDays } from '../getters/get-current-month-days'
|
|
2
|
+
import { getNextMonthDays } from '../getters/get-next-month-days'
|
|
3
|
+
import { getPreviousMonthDays } from '../getters/get-previous-month-days'
|
|
4
|
+
import { IDatePickerRow } from '../models/date-picker.models'
|
|
5
|
+
import { newCellsRow } from '../models/date-picker.models.constructors'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Computes a grid of days for a date picker, organized into rows of weeks.
|
|
9
|
+
* The grid includes days from the previous month, the current month, and the next month
|
|
10
|
+
* to ensure all weeks are fully populated.
|
|
11
|
+
*
|
|
12
|
+
* @param dte - The date for which the days grid is computed. The month and year of this date
|
|
13
|
+
* determine the current month in the grid.
|
|
14
|
+
* @returns An array of rows, where each row represents a week and contains the days
|
|
15
|
+
* (including previous and next month's days) as part of the grid.
|
|
16
|
+
*/
|
|
17
|
+
export const computeDaysGrid = (dte: Date): IDatePickerRow[] => {
|
|
18
|
+
const year = dte.getFullYear()
|
|
19
|
+
const currentMonth = dte.getMonth()
|
|
20
|
+
const daysArray = [1, 2, 3, 4, 5, 6, 0]
|
|
21
|
+
|
|
22
|
+
const firstDay = new Date(year, currentMonth, 1).getDay()
|
|
23
|
+
const nextMonthFirstDay = new Date(year, currentMonth + 1, 1).getDay()
|
|
24
|
+
const output: IDatePickerRow[] = []
|
|
25
|
+
|
|
26
|
+
// let's find out how many days previews the first day to complete a weekrow with previous month
|
|
27
|
+
const previousDaysRemaining = daysArray.indexOf(firstDay)
|
|
28
|
+
// let's find out how many days remains the last day to complete a weekrow with next months
|
|
29
|
+
const nextMonthDaysRemaining = Math.abs(daysArray.indexOf(nextMonthFirstDay) - daysArray.length)
|
|
30
|
+
// gets the previous month's days
|
|
31
|
+
const previousDays = getPreviousMonthDays(previousDaysRemaining, currentMonth, year)
|
|
32
|
+
// gets the month's days
|
|
33
|
+
const currentDays = getCurrentMonthDays(currentMonth, year)
|
|
34
|
+
// gets the next month's days
|
|
35
|
+
const nextMonthDays = getNextMonthDays(nextMonthDaysRemaining, currentMonth, year)
|
|
36
|
+
// build full grid data combining the three above collections
|
|
37
|
+
const fullGridData = [...previousDays, ...currentDays, ...nextMonthDays]
|
|
38
|
+
// split week rows
|
|
39
|
+
for (let row = 1; row < 7; row++) {
|
|
40
|
+
const weekDays = fullGridData.splice(0, 7)
|
|
41
|
+
const newRow = newCellsRow(row, weekDays)
|
|
42
|
+
output.push(newRow)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return output
|
|
46
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createCell } from '../constructors/create-cell'
|
|
2
|
+
import { IDatePickerCell, IDatePickerRow } from '../models/date-picker.models'
|
|
3
|
+
import { newCellsRow } from '../models/date-picker.models.constructors'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Computes a grid of months for a date picker, organizing months into rows of three.
|
|
7
|
+
*
|
|
8
|
+
* @param date - The reference date used to determine the year and day for the grid.
|
|
9
|
+
* @returns An array of rows, where each row contains cells representing months.
|
|
10
|
+
*
|
|
11
|
+
* Each cell in the grid represents a month and includes metadata such as whether
|
|
12
|
+
* it belongs to the current scope (year). The grid is structured into 4 rows, with
|
|
13
|
+
* each row containing 3 months (total 12 months):
|
|
14
|
+
* Row 1: 1, 2, 3
|
|
15
|
+
* Row 2: 4, 5, 6
|
|
16
|
+
* Row 3: 7, 8, 9
|
|
17
|
+
* Row 4: 10, 11, 12
|
|
18
|
+
*/
|
|
19
|
+
export const computeMonthsGrid = (date: Date) => {
|
|
20
|
+
const output: IDatePickerRow[] = []
|
|
21
|
+
let rowData: IDatePickerCell[] = []
|
|
22
|
+
|
|
23
|
+
const currentYear = date.getFullYear()
|
|
24
|
+
const currentDay = date.getDate()
|
|
25
|
+
|
|
26
|
+
let rowNumber: number = 1
|
|
27
|
+
for (let month = 0; month < 12; month++) {
|
|
28
|
+
const cell = createCell(currentDay, month, currentYear, {
|
|
29
|
+
isCurrentScope: true,
|
|
30
|
+
})
|
|
31
|
+
rowData.push(cell)
|
|
32
|
+
|
|
33
|
+
// Push row every 3 months (or at the end)
|
|
34
|
+
if ((month + 1) % 3 === 0 || month === 11) {
|
|
35
|
+
const newRow = newCellsRow(rowNumber, rowData)
|
|
36
|
+
output.push(newRow)
|
|
37
|
+
rowData = []
|
|
38
|
+
rowNumber++
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return output
|
|
43
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getTs } from '../../utils/date-object'
|
|
2
|
+
import { createCell } from '../constructors/create-cell'
|
|
3
|
+
import { IDatePickerCell } from '../models/date-picker.models'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Computes a range of date picker cells between two selected dates.
|
|
7
|
+
*
|
|
8
|
+
* @param selection - An array of `IDatePickerCell` objects representing the selected dates.
|
|
9
|
+
* The array should contain at least two elements: the start date and the end date.
|
|
10
|
+
* @returns An array of `IDatePickerCell` objects representing the range of dates between the start and end dates.
|
|
11
|
+
* If the selection is invalid or the dates cannot be computed, an empty array is returned.
|
|
12
|
+
*/
|
|
13
|
+
export const computeRange = (selection: IDatePickerCell[]): IDatePickerCell[] => {
|
|
14
|
+
const output: IDatePickerCell[] = []
|
|
15
|
+
if (selection.length < 2) return output
|
|
16
|
+
|
|
17
|
+
const startDateObject = selection[0]
|
|
18
|
+
const endDateObject = selection[1]
|
|
19
|
+
|
|
20
|
+
const _sd = startDateObject.item?.date.toDate?.()
|
|
21
|
+
const _ed = endDateObject.item?.date.toDate?.()
|
|
22
|
+
|
|
23
|
+
if (!_sd || !_ed) return output
|
|
24
|
+
|
|
25
|
+
let newDate = new Date(_sd.getFullYear(), _sd.getMonth(), _sd.getDate())
|
|
26
|
+
|
|
27
|
+
while (getTs(newDate) !== getTs(_ed)) {
|
|
28
|
+
newDate = new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate() + 1)
|
|
29
|
+
const cell = createCell(newDate.getDate(), newDate.getMonth(), newDate.getFullYear(), {
|
|
30
|
+
isRangeDays: true,
|
|
31
|
+
})
|
|
32
|
+
output.push(cell)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return output
|
|
36
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createCell } from '../constructors/create-cell'
|
|
2
|
+
import { IDatePickerCell, IDatePickerRow } from '../models/date-picker.models'
|
|
3
|
+
import { newCellsRow } from '../models/date-picker.models.constructors'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Computes a grid of years centered around the given date's year.
|
|
7
|
+
* The grid includes the current year, a range of previous years, and a range of next years.
|
|
8
|
+
* The years are organized into rows, each containing a fixed number of columns.
|
|
9
|
+
*
|
|
10
|
+
* @param date - The reference date used to determine the current year.
|
|
11
|
+
* @returns An array of rows, where each row contains cells representing years.
|
|
12
|
+
* Each cell includes metadata indicating whether the year belongs to the
|
|
13
|
+
* previous, current, or next scope.
|
|
14
|
+
*/
|
|
15
|
+
export const computeYearsGrid = (date: Date) => {
|
|
16
|
+
let previousYears: number[] = []
|
|
17
|
+
let nextYears: number[] = []
|
|
18
|
+
|
|
19
|
+
const currentMonth = date.getMonth()
|
|
20
|
+
const currentDay = date.getDate()
|
|
21
|
+
const currentYear = date.getFullYear()
|
|
22
|
+
for (let p = currentYear - 1; p > currentYear - 13; p--) {
|
|
23
|
+
previousYears.push(p)
|
|
24
|
+
}
|
|
25
|
+
for (let n = currentYear + 1; n < currentYear + 13; n++) {
|
|
26
|
+
nextYears.push(n)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
previousYears = previousYears.sort((a, b) => a - b)
|
|
30
|
+
nextYears = nextYears.sort((a, b) => a - b)
|
|
31
|
+
|
|
32
|
+
const allYears = [...previousYears, currentYear, ...nextYears].sort((a, b) => a - b)
|
|
33
|
+
|
|
34
|
+
const output: IDatePickerRow[] = []
|
|
35
|
+
let rowData: IDatePickerCell[] = []
|
|
36
|
+
let colNumber: number = 0
|
|
37
|
+
let rowNumber: number = 0
|
|
38
|
+
for (const y of allYears) {
|
|
39
|
+
colNumber++
|
|
40
|
+
const cell = createCell(currentDay, currentMonth, y, {
|
|
41
|
+
isPreviousScope: previousYears[0] === y,
|
|
42
|
+
isCurrentScope: y === currentYear,
|
|
43
|
+
isNextScope: nextYears[nextYears.length - 1] === y
|
|
44
|
+
})
|
|
45
|
+
rowData.push(cell)
|
|
46
|
+
if (colNumber === 5) {
|
|
47
|
+
rowNumber++
|
|
48
|
+
colNumber = 0
|
|
49
|
+
const newRow = newCellsRow(rowNumber, rowData)
|
|
50
|
+
rowData = []
|
|
51
|
+
output.push(newRow)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return output
|
|
56
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DateObject } from '../../utils/date-object'
|
|
2
|
+
import { IDatePickerCell, IDatePickerOptions } from '../models/date-picker.models'
|
|
3
|
+
import { newCell, newDatePickerItem } from '../models/date-picker.models.constructors'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates a date picker cell with the specified parameters.
|
|
7
|
+
*
|
|
8
|
+
* @param day - The day of the month for the cell.
|
|
9
|
+
* @param month - The month of the year for the cell (0-based, where 0 = January).
|
|
10
|
+
* @param year - The year for the cell.
|
|
11
|
+
* @param options - Partial options for configuring the date picker cell.
|
|
12
|
+
* @param defineWeekEnds - Optional flag to determine if weekends should be identified.
|
|
13
|
+
* @returns An object representing the date picker cell.
|
|
14
|
+
*/
|
|
15
|
+
export const createCell = (
|
|
16
|
+
day: number,
|
|
17
|
+
month: number,
|
|
18
|
+
year: number,
|
|
19
|
+
options: Partial<IDatePickerOptions>,
|
|
20
|
+
defineWeekEnds?: boolean
|
|
21
|
+
): IDatePickerCell => {
|
|
22
|
+
const key = `${month}${day}`
|
|
23
|
+
const cDate = new Date(year, month, day)
|
|
24
|
+
const isWeekEnd = defineWeekEnds ? [6, 0].includes(cDate.getDay()) : false
|
|
25
|
+
const nowDate = new Date()?.toLocaleString(undefined, {
|
|
26
|
+
dateStyle: 'short',
|
|
27
|
+
})
|
|
28
|
+
const currentCellDate = cDate.toLocaleDateString(undefined, {
|
|
29
|
+
dateStyle: 'short',
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const isNow = nowDate === currentCellDate
|
|
33
|
+
|
|
34
|
+
const dateObjectInstance = new DateObject(cDate, key)
|
|
35
|
+
const dpItem = newDatePickerItem(key, dateObjectInstance, { ...options, isWeekEnd, isNow })
|
|
36
|
+
return newCell(day, dpItem)
|
|
37
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DateFormatsEnum } from '../utils/date-utils'
|
|
2
|
+
|
|
3
|
+
// Utility type to extract values from enum
|
|
4
|
+
type ValueOfType<T> = T[keyof T]
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Explanation:
|
|
8
|
+
([0-2][0-9]|3[0-1]): Matches days 01 to 31.
|
|
9
|
+
([-/]): Captures the separator (- or /) and ensures consistency.
|
|
10
|
+
([0][1-9]|1[0-2]): Matches months 01 to 12.
|
|
11
|
+
\2: Ensures the same separator is used.
|
|
12
|
+
(\d{4}): Matches a 4-digit year.
|
|
13
|
+
*/
|
|
14
|
+
export const ddMMYYYYRegex = /^([0-2][0-9]|3[0-1])([-/])([0][1-9]|1[0-2])\2(\d{4})$/
|
|
15
|
+
|
|
16
|
+
/**Explanation:
|
|
17
|
+
([0][1-9]|1[0-2]): Matches months 01 to 12.
|
|
18
|
+
([-/]): Captures the separator (- or /) and ensures consistency.
|
|
19
|
+
([0-2][0-9]|3[0-1]): Matches days 01 to 31.
|
|
20
|
+
\2: Ensures the same separator is used.
|
|
21
|
+
(\d{4}): Matches a 4-digit year.
|
|
22
|
+
*/
|
|
23
|
+
export const MMddYYYYRegex = /^([0][1-9]|1[0-2])([-/])([0-2][0-9]|3[0-1])\2(\d{4})$/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Explanation:
|
|
27
|
+
(\d{4}): Matches a 4-digit year.
|
|
28
|
+
([-/]): Captures the separator (- or /) and ensures consistency.
|
|
29
|
+
([0][1-9]|1[0-2]): Matches months 01 to 12.
|
|
30
|
+
\2: Ensures the same separator is used.
|
|
31
|
+
([0-2][0-9]|3[0-1]): Matches days 01 to 31.
|
|
32
|
+
*/
|
|
33
|
+
export const yyyyMMDDRegex = /^(\d{4})([-/])([0][1-9]|1[0-2])\2([0-2][0-9]|3[0-1])$/
|
|
34
|
+
|
|
35
|
+
export type DatePickerFormatType = ValueOfType<DateFormatsEnum>
|
|
36
|
+
export const DatePickerFormatArray: string[] = Object.values(DateFormatsEnum)
|
|
37
|
+
/** indicates */
|
|
38
|
+
export type DatePickerGridModeType = 'YEAR' | 'MONTH' | 'DAY'
|
|
39
|
+
export type DatePickerDisplayType = 'DAY' | 'MONTH' | 'YEAR'
|
|
40
|
+
|
|
41
|
+
export type DatePickerSelectionModeType = 'range' | 'single'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createCell } from '../constructors/create-cell'
|
|
2
|
+
import { IDatePickerCell } from '../models/date-picker.models'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Generates an array of date picker cells representing all the days in a given month and year.
|
|
6
|
+
*
|
|
7
|
+
* @param month - The zero-based month index (0 for January, 11 for December).
|
|
8
|
+
* @param year - The full year (e.g., 2023).
|
|
9
|
+
* @returns An array of `IDatePickerCell` objects, each representing a day in the specified month.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* - The function calculates the number of days in the specified month and year.
|
|
13
|
+
* - Each day is represented as an `IDatePickerCell` object created using the `createCell` function.
|
|
14
|
+
* - The `isCurrentScope` property of each cell is set to `true`.
|
|
15
|
+
*/
|
|
16
|
+
export const getCurrentMonthDays = (month: number, year: number) => {
|
|
17
|
+
//If you provide 0 as the dayValue in Date.setFullYear you get the last day of the previous month:
|
|
18
|
+
const lastDay = new Date(year, month + 1, 0).getDate()
|
|
19
|
+
const output: IDatePickerCell[] = []
|
|
20
|
+
for (let i = 1; i < lastDay + 1; i++) {
|
|
21
|
+
const cell = createCell(
|
|
22
|
+
i,
|
|
23
|
+
month,
|
|
24
|
+
year,
|
|
25
|
+
{
|
|
26
|
+
isCurrentScope: true
|
|
27
|
+
},
|
|
28
|
+
true
|
|
29
|
+
)
|
|
30
|
+
output.push(cell)
|
|
31
|
+
// const cDate = new Date(year, month, i)
|
|
32
|
+
// output.push(newCell(i, `${month + 1}-${i}`, cDate.getDay(), null))
|
|
33
|
+
}
|
|
34
|
+
return output
|
|
35
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DatePickerGridModeType } from '../date-picker.types'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Calculates the next date based on the provided grid mode and current date.
|
|
5
|
+
*
|
|
6
|
+
* @param gridMode - The mode of the date picker grid, which determines the unit of increment.
|
|
7
|
+
* Can be one of the following:
|
|
8
|
+
* - 'YEAR': Increments the year by 1.
|
|
9
|
+
* - 'MONTH': Increments the month by 1.
|
|
10
|
+
* - 'DAY': Increments the day by 1 (default behavior).
|
|
11
|
+
* @param currentDate - The current date from which the next date will be calculated.
|
|
12
|
+
* @returns A new `Date` object representing the next date based on the specified grid mode.
|
|
13
|
+
*/
|
|
14
|
+
export const getNextDate = (gridMode: DatePickerGridModeType, currentDate: Date) => {
|
|
15
|
+
let _year = currentDate.getFullYear()
|
|
16
|
+
let _month = currentDate.getMonth()
|
|
17
|
+
let _day = currentDate.getDate()
|
|
18
|
+
|
|
19
|
+
switch (gridMode) {
|
|
20
|
+
case 'YEAR':
|
|
21
|
+
_year = _year + 1
|
|
22
|
+
break
|
|
23
|
+
case 'MONTH':
|
|
24
|
+
_month = _month + 1
|
|
25
|
+
break
|
|
26
|
+
case 'DAY':
|
|
27
|
+
default:
|
|
28
|
+
_day = _day + 1
|
|
29
|
+
break
|
|
30
|
+
}
|
|
31
|
+
return new Date(_year, _month, _day)
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createCell } from '../constructors/create-cell'
|
|
2
|
+
import { IDatePickerCell } from '../models/date-picker.models'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Generates an array of date picker cells representing the days of the next month.
|
|
6
|
+
*
|
|
7
|
+
* @param remainingDays - The number of days remaining to fill in the current month's calendar view.
|
|
8
|
+
* @param currentMonth - The current month (0-based, where 0 = January, 11 = December).
|
|
9
|
+
* @param year - The year for which the next month's days are being calculated.
|
|
10
|
+
* @returns An array of `IDatePickerCell` objects representing the days of the next month.
|
|
11
|
+
*/
|
|
12
|
+
export const getNextMonthDays = (remainingDays: number, currentMonth: number, year: number) => {
|
|
13
|
+
const output: IDatePickerCell[] = []
|
|
14
|
+
for (let i = 1; i <= remainingDays + 14; i++) {
|
|
15
|
+
const cell = createCell(i, currentMonth + 1, year, {
|
|
16
|
+
isNextScope: true
|
|
17
|
+
})
|
|
18
|
+
output.push(cell)
|
|
19
|
+
// const cDate = new Date(year, nextMonth, i)
|
|
20
|
+
// output.push(newCell(i, `${nextMonth + 1}-${i}`, cDate.getDay(), null))
|
|
21
|
+
}
|
|
22
|
+
return output
|
|
23
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DatePickerGridModeType } from '../date-picker.types'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Calculates the previous date based on the specified grid mode and the current date.
|
|
5
|
+
*
|
|
6
|
+
* @param gridMode - The mode of the date picker grid, which determines the unit to decrement.
|
|
7
|
+
* Can be one of the following:
|
|
8
|
+
* - 'YEAR': Decrements the year by 1.
|
|
9
|
+
* - 'MONTH': Decrements the month by 1.
|
|
10
|
+
* - 'DAY': Decrements the day by 1 (default behavior).
|
|
11
|
+
* @param currentDate - The current date from which the previous date is calculated.
|
|
12
|
+
* @returns A new `Date` object representing the previous date based on the specified grid mode.
|
|
13
|
+
*/
|
|
14
|
+
export const getPreviousDate = (gridMode: DatePickerGridModeType, currentDate: Date) => {
|
|
15
|
+
let _year = currentDate.getFullYear()
|
|
16
|
+
let _month = currentDate.getMonth()
|
|
17
|
+
let _day = currentDate.getDate()
|
|
18
|
+
|
|
19
|
+
switch (gridMode) {
|
|
20
|
+
case 'YEAR':
|
|
21
|
+
_year = _year - 1
|
|
22
|
+
break
|
|
23
|
+
case 'MONTH':
|
|
24
|
+
_month = _month - 1
|
|
25
|
+
break
|
|
26
|
+
case 'DAY':
|
|
27
|
+
default:
|
|
28
|
+
_day = _day - 1
|
|
29
|
+
break
|
|
30
|
+
}
|
|
31
|
+
return new Date(_year, _month, _day)
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createCell } from '../constructors/create-cell'
|
|
2
|
+
import { IDatePickerCell } from '../models/date-picker.models'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Generates an array of date picker cells representing the remaining days
|
|
6
|
+
* from the previous month to fill a calendar grid.
|
|
7
|
+
*
|
|
8
|
+
* @param remainingDays - The number of days needed from the previous month.
|
|
9
|
+
* @param currentMonth - The current month (1-based, where January is 1 and December is 12).
|
|
10
|
+
* @param year - The year of the current month.
|
|
11
|
+
* @returns An array of `IDatePickerCell` objects representing the days from the previous month.
|
|
12
|
+
*
|
|
13
|
+
* The function calculates the last day of the previous month and iterates backward
|
|
14
|
+
* to create date picker cells. It stops once the required number of days (`remainingDays`)
|
|
15
|
+
* is reached. The resulting array is sorted by the `id` property of the cells in ascending order.
|
|
16
|
+
*/
|
|
17
|
+
export const getPreviousMonthDays = (remainingDays: number, currentMonth: number, year: number) => {
|
|
18
|
+
const lastDay = new Date(year, currentMonth, 0).getDate()
|
|
19
|
+
const output: IDatePickerCell[] = []
|
|
20
|
+
if (remainingDays === 0) return output
|
|
21
|
+
for (let i = lastDay; i > 0; i--) {
|
|
22
|
+
const cell = createCell(i, currentMonth, year, {
|
|
23
|
+
isPreviousScope: true
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
output.push(cell)
|
|
27
|
+
if (output.length === remainingDays) {
|
|
28
|
+
break
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return output.sort((a, b) => a.id - b.id)
|
|
32
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IDateObject } from '../../utils/date-object'
|
|
2
|
+
import { IDatePickerCell, IDatePickerItem, IDatePickerOptions } from './date-picker.models'
|
|
3
|
+
|
|
4
|
+
export const newDatePickerItem = (
|
|
5
|
+
id: string,
|
|
6
|
+
date: IDateObject,
|
|
7
|
+
option: Partial<IDatePickerOptions>
|
|
8
|
+
) => {
|
|
9
|
+
return {
|
|
10
|
+
id,
|
|
11
|
+
date,
|
|
12
|
+
selected: option.selected ?? false,
|
|
13
|
+
active: option.active ?? false,
|
|
14
|
+
isNextScope: option.isNextScope ?? false,
|
|
15
|
+
isPreviousScope: option.isPreviousScope ?? false,
|
|
16
|
+
isCurrentScope: option.isCurrentScope ?? false,
|
|
17
|
+
isRangeDays: option.isRangeDays ?? false,
|
|
18
|
+
isWeekEnd: option.isWeekEnd ?? false,
|
|
19
|
+
isNow: option.isNow ?? false,
|
|
20
|
+
displayType: option.displayType ?? 'DAY',
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const newCell = (id: number, item: IDatePickerItem | null): IDatePickerCell => {
|
|
25
|
+
const dtePrint = `${item?.date.year}${item?.date.month.toString().padStart(2, '0')}${item?.date.day.toString().padStart(2, '0')}`
|
|
26
|
+
return {
|
|
27
|
+
id,
|
|
28
|
+
code: dtePrint,
|
|
29
|
+
ts: parseInt(dtePrint),
|
|
30
|
+
item,
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const newCellsRow = (id: number, cells: IDatePickerCell[]) => {
|
|
35
|
+
return { id, cells }
|
|
36
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IDateObject } from '../../utils/date-object'
|
|
2
|
+
import { DatePickerDisplayType } from '../date-picker.types'
|
|
3
|
+
|
|
4
|
+
export interface ICursorPosition {
|
|
5
|
+
currentID: number
|
|
6
|
+
x: number
|
|
7
|
+
y: number
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface IDatePickerItem {
|
|
11
|
+
id: string
|
|
12
|
+
date: IDateObject
|
|
13
|
+
selected: boolean
|
|
14
|
+
active: boolean
|
|
15
|
+
isNextScope: boolean
|
|
16
|
+
isPreviousScope: boolean
|
|
17
|
+
isCurrentScope: boolean
|
|
18
|
+
isRangeDays: boolean
|
|
19
|
+
isWeekEnd: boolean
|
|
20
|
+
isNow: boolean
|
|
21
|
+
displayType: DatePickerDisplayType
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface IDatePickerOptions {
|
|
25
|
+
selected: boolean
|
|
26
|
+
active: boolean
|
|
27
|
+
isNextScope: boolean
|
|
28
|
+
isPreviousScope: boolean
|
|
29
|
+
isCurrentScope: boolean
|
|
30
|
+
isRangeDays: boolean
|
|
31
|
+
isWeekEnd: boolean
|
|
32
|
+
isNow: boolean
|
|
33
|
+
displayType: DatePickerDisplayType
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface IDatePickerCell {
|
|
37
|
+
id: number
|
|
38
|
+
code: string | undefined
|
|
39
|
+
ts: number
|
|
40
|
+
item: IDatePickerItem | null
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface IDatePickerRow {
|
|
44
|
+
id: number
|
|
45
|
+
cells: IDatePickerCell[]
|
|
46
|
+
}
|