@supersoniks/concorde 2.0.7 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-infos.json +1 -0
- package/index.html +44 -0
- package/notes de migration.md +21 -0
- package/package.json +23 -290
- package/scripts/prebuild.mjs +22 -0
- package/{components.js → src/components.ts} +5 -2
- package/src/concorde-loaded.ts +3 -0
- package/src/core/_types/types.ts +55 -0
- package/src/core/components/functional/date/date.md +290 -0
- package/src/core/components/functional/date/date.ts +206 -0
- package/src/core/components/functional/example/example.ts +11 -0
- package/src/core/components/functional/fetch/fetch.md +117 -0
- package/{core/components/functional/fetch/fetch.js → src/core/components/functional/fetch/fetch.ts} +33 -37
- package/src/core/components/functional/if/if.md +16 -0
- package/src/core/components/functional/if/if.test.ts +40 -0
- package/src/core/components/functional/if/if.ts +23 -0
- package/src/core/components/functional/list/list.md +194 -0
- package/src/core/components/functional/list/list.ts +236 -0
- package/src/core/components/functional/mix/mix.md +41 -0
- package/src/core/components/functional/mix/mix.ts +95 -0
- package/src/core/components/functional/queue/queue.md +87 -0
- package/src/core/components/functional/queue/queue.ts +279 -0
- package/src/core/components/functional/router/redirect.ts +44 -0
- package/src/core/components/functional/router/router.md +112 -0
- package/src/core/components/functional/router/router.ts +108 -0
- package/src/core/components/functional/sdui/SDUIDescriptorTransformer.ts +229 -0
- package/{core → src/core}/components/functional/sdui/default-library.json +13 -13
- package/src/core/components/functional/sdui/example.json +99 -0
- package/src/core/components/functional/sdui/sdui-utils.ts +62 -0
- package/src/core/components/functional/sdui/sdui.md +356 -0
- package/src/core/components/functional/sdui/sdui.ts +230 -0
- package/src/core/components/functional/sdui/types.ts +34 -0
- package/src/core/components/functional/sonic-scope/sonic-scope.ts +13 -0
- package/src/core/components/functional/states/states.md +87 -0
- package/src/core/components/functional/states/states.ts +121 -0
- package/src/core/components/functional/submit/submit.md +48 -0
- package/src/core/components/functional/submit/submit.ts +265 -0
- package/src/core/components/functional/subscriber/subscriber.md +91 -0
- package/src/core/components/functional/subscriber/subscriber.ts +28 -0
- package/src/core/components/functional/value/value.md +35 -0
- package/src/core/components/functional/value/value.ts +18 -0
- package/{core/components/ui/_css/scroll.js → src/core/components/ui/_css/scroll.ts} +3 -2
- package/{core/components/ui/_css/size.js → src/core/components/ui/_css/size.ts} +5 -2
- package/{core/components/ui/_css/type.js → src/core/components/ui/_css/type.ts} +5 -3
- package/src/core/components/ui/alert/alert.md +121 -0
- package/src/core/components/ui/alert/alert.ts +177 -0
- package/src/core/components/ui/badge/badge.md +102 -0
- package/{core/components/ui/badge/badge.js → src/core/components/ui/badge/badge.ts} +36 -51
- package/src/core/components/ui/button/button.md +184 -0
- package/{core/components/ui/button/button.js → src/core/components/ui/button/button.ts} +258 -302
- package/src/core/components/ui/captcha/captcha.md +12 -0
- package/src/core/components/ui/captcha/captcha.ts +88 -0
- package/src/core/components/ui/card/card-footer.ts +19 -0
- package/src/core/components/ui/card/card-header-descripton.ts +24 -0
- package/{core/components/ui/card/card-header.js → src/core/components/ui/card/card-header.ts} +28 -38
- package/src/core/components/ui/card/card-main.ts +24 -0
- package/src/core/components/ui/card/card.md +96 -0
- package/{core/components/ui/card/card.js → src/core/components/ui/card/card.ts} +23 -34
- package/src/core/components/ui/divider/divider.md +35 -0
- package/{core/components/ui/divider/divider.js → src/core/components/ui/divider/divider.ts} +35 -65
- package/src/core/components/ui/form/checkbox/checkbox.md +96 -0
- package/{core/components/ui/form/checkbox/checkbox.js → src/core/components/ui/form/checkbox/checkbox.ts} +79 -98
- package/{core/components/ui/form/css/form-control.js → src/core/components/ui/form/css/form-control.ts} +9 -5
- package/src/core/components/ui/form/fieldset/fieldset.md +129 -0
- package/src/core/components/ui/form/fieldset/fieldset.ts +96 -0
- package/src/core/components/ui/form/fieldset/legend-description.ts +23 -0
- package/src/core/components/ui/form/fieldset/legend.ts +90 -0
- package/src/core/components/ui/form/form-actions/form-actions.md +77 -0
- package/src/core/components/ui/form/form-actions/form-actions.ts +32 -0
- package/src/core/components/ui/form/form-layout/form-layout.md +43 -0
- package/src/core/components/ui/form/form-layout/form-layout.ts +71 -0
- package/src/core/components/ui/form/input/input.md +168 -0
- package/src/core/components/ui/form/input/input.ts +227 -0
- package/src/core/components/ui/form/input/password-helper.ts +68 -0
- package/src/core/components/ui/form/input/same-value-helper.ts +48 -0
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +130 -0
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.ts +285 -0
- package/src/core/components/ui/form/radio/radio.md +86 -0
- package/src/core/components/ui/form/radio/radio.ts +44 -0
- package/src/core/components/ui/form/select/select.md +99 -0
- package/src/core/components/ui/form/select/select.ts +310 -0
- package/src/core/components/ui/form/textarea/textarea.md +66 -0
- package/src/core/components/ui/form/textarea/textarea.ts +119 -0
- package/src/core/components/ui/group/group.md +75 -0
- package/src/core/components/ui/group/group.ts +101 -0
- package/src/core/components/ui/icon/icon.md +125 -0
- package/src/core/components/ui/icon/icon.stories.ts +100 -0
- package/src/core/components/ui/icon/icon.ts +106 -0
- package/src/core/components/ui/icon/icons.json +1 -0
- package/src/core/components/ui/icon/icons.ts +130 -0
- package/src/core/components/ui/icon/svgs/cancel.svg +3 -0
- package/src/core/components/ui/icon/svgs/check-circled-outline.svg +4 -0
- package/src/core/components/ui/icon/svgs/check.svg +3 -0
- package/src/core/components/ui/icon/svgs/emoji-puzzled.svg +1 -0
- package/src/core/components/ui/icon/svgs/info-empty.svg +5 -0
- package/src/core/components/ui/icon/svgs/loader.svg +1 -0
- package/src/core/components/ui/icon/svgs/minus-small.svg +3 -0
- package/src/core/components/ui/icon/svgs/more-horiz.svg +5 -0
- package/src/core/components/ui/icon/svgs/more-vert.svg +5 -0
- package/src/core/components/ui/icon/svgs/nav-arrow-down.svg +3 -0
- package/src/core/components/ui/icon/svgs/warning-circled-outline.svg +5 -0
- package/src/core/components/ui/image/image.md +107 -0
- package/src/core/components/ui/image/image.ts +117 -0
- package/src/core/components/ui/link/link.md +43 -0
- package/src/core/components/ui/link/link.ts +108 -0
- package/src/core/components/ui/loader/loader.md +37 -0
- package/src/core/components/ui/loader/loader.stories.ts +25 -0
- package/src/core/components/ui/loader/loader.ts +81 -0
- package/{core/components/ui/loader/styles/fixed.js → src/core/components/ui/loader/styles/fixed.ts} +2 -1
- package/{core/components/ui/loader/styles/inline.js → src/core/components/ui/loader/styles/inline.ts} +3 -2
- package/src/core/components/ui/menu/menu-item.ts +30 -0
- package/src/core/components/ui/menu/menu.md +288 -0
- package/src/core/components/ui/menu/menu.ts +292 -0
- package/src/core/components/ui/modal/modal-actions.ts +35 -0
- package/src/core/components/ui/modal/modal-close.ts +36 -0
- package/src/core/components/ui/modal/modal-content.ts +19 -0
- package/src/core/components/ui/modal/modal-subtitle.ts +23 -0
- package/src/core/components/ui/modal/modal-title.ts +22 -0
- package/src/core/components/ui/modal/modal.md +123 -0
- package/src/core/components/ui/modal/modal.stories.ts +140 -0
- package/src/core/components/ui/modal/modal.ts +386 -0
- package/src/core/components/ui/pop/pop.md +79 -0
- package/src/core/components/ui/pop/pop.ts +291 -0
- package/src/core/components/ui/progress/progress.md +65 -0
- package/{core/components/ui/progress/progress.js → src/core/components/ui/progress/progress.ts} +31 -50
- package/src/core/components/ui/table/table-caption.ts +21 -0
- package/src/core/components/ui/table/table-tbody.ts +32 -0
- package/src/core/components/ui/table/table-td.ts +47 -0
- package/src/core/components/ui/table/table-tfoot.ts +20 -0
- package/src/core/components/ui/table/table-th.ts +56 -0
- package/src/core/components/ui/table/table-thead.ts +18 -0
- package/src/core/components/ui/table/table-tr.ts +48 -0
- package/src/core/components/ui/table/table.md +467 -0
- package/{core/components/ui/table/table.js → src/core/components/ui/table/table.ts} +32 -53
- package/{core/components/ui/theme/theme-collection/core-variables.js → src/core/components/ui/theme/theme-collection/core-variables.ts} +3 -2
- package/{core/components/ui/theme/theme-collection/dark.js → src/core/components/ui/theme/theme-collection/dark.ts} +5 -3
- package/{core/components/ui/theme/theme-collection/light.js → src/core/components/ui/theme/theme-collection/light.ts} +3 -2
- package/src/core/components/ui/theme/theme.ts +118 -0
- package/src/core/components/ui/toast/message-subscriber.stories.ts +43 -0
- package/src/core/components/ui/toast/message-subscriber.ts +37 -0
- package/{core/components/ui/toast/toast-item.js → src/core/components/ui/toast/toast-item.ts} +86 -113
- package/src/core/components/ui/toast/toast.ts +237 -0
- package/src/core/components/ui/toast/types.ts +14 -0
- package/src/core/components/ui/tooltip/tooltip.md +37 -0
- package/{core/components/ui/tooltip/tooltip.js → src/core/components/ui/tooltip/tooltip.ts} +26 -47
- package/{core/components/ui/ui.js → src/core/components/ui/ui.ts} +2 -0
- package/src/core/core.ts +22 -0
- package/src/core/decorators/Subscriber.ts +187 -0
- package/src/core/directives/DataProvider.ts +113 -0
- package/src/core/directives/Wording.ts +220 -0
- package/src/core/mixins/Fetcher.ts +258 -0
- package/src/core/mixins/FormCheckable.ts +287 -0
- package/src/core/mixins/FormElement.ts +275 -0
- package/src/core/mixins/FormInput.ts +135 -0
- package/src/core/mixins/Subscriber.ts +352 -0
- package/src/core/mixins/TemplatesContainer.ts +70 -0
- package/{core/mixins/mixins.d.ts → src/core/mixins/mixins.ts} +1 -1
- package/src/core/utils/Arrays.ts +161 -0
- package/src/core/utils/DataBindObserver.ts +286 -0
- package/src/core/utils/Electron.ts +15 -0
- package/src/core/utils/Format.ts +58 -0
- package/src/core/utils/HTML.ts +126 -0
- package/src/core/utils/LocationHandler.ts +139 -0
- package/src/core/utils/Objects.ts +103 -0
- package/src/core/utils/PublisherProxy.ts +786 -0
- package/src/core/utils/Utils.ts +12 -0
- package/src/core/utils/api.ts +456 -0
- package/{core/utils/url-pattern.d.ts → src/core/utils/url-pattern.ts} +1 -0
- package/{decorators.js → src/decorators.ts} +6 -2
- package/{directives.js → src/directives.ts} +11 -6
- package/src/docs/_core-concept/overview.md +57 -0
- package/src/docs/_core-concept/subscriber.md +76 -0
- package/src/docs/_getting-started/concorde-outside.md +141 -0
- package/src/docs/_getting-started/create-a-component.md +137 -0
- package/src/docs/_getting-started/pubsub.md +150 -0
- package/src/docs/_getting-started/start.md +37 -0
- package/src/docs/_getting-started/theming.md +91 -0
- package/src/docs/code.ts +281 -0
- package/src/docs/docs.ts +6 -0
- package/src/docs/example/users.ts +64 -0
- package/src/docs/navigation/navigation.ts +101 -0
- package/src/docs/prism/index.ts +6 -0
- package/src/docs/prism/prism.css +158 -0
- package/src/docs/prism/prism.js +1022 -0
- package/src/docs/search/docs-search.json +3767 -0
- package/src/docs/search/markdown-renderer.ts +40 -0
- package/src/docs/search/page.ts +40 -0
- package/src/docs/search/search.ts +184 -0
- package/src/docs.ts +2 -0
- package/src/index.ts +7 -0
- package/{mixins.js → src/mixins.ts} +10 -6
- package/src/tag-list.json +1 -0
- package/src/test-utils/TestUtils.ts +13 -0
- package/src/tsconfig.json +113 -0
- package/{utils.js → src/utils.ts} +15 -11
- package/test-utils/TestUtils.ts +13 -0
- package/vite/config.js +136 -0
- package/vite.config.mts +87 -0
- package/README.md +0 -27
- package/cli.js +0 -75
- package/components.d.ts +0 -4
- package/concorde-core.bundle.js +0 -3427
- package/concorde-core.es.js +0 -14372
- package/core/_types/types.d.ts +0 -28
- package/core/_types/types.js +0 -2
- package/core/components/functional/date/date.d.ts +0 -45
- package/core/components/functional/date/date.js +0 -243
- package/core/components/functional/example/example.d.ts +0 -7
- package/core/components/functional/example/example.js +0 -26
- package/core/components/functional/fetch/fetch.d.ts +0 -93
- package/core/components/functional/functional.js +0 -15
- package/core/components/functional/if/if.d.ts +0 -12
- package/core/components/functional/if/if.js +0 -38
- package/core/components/functional/if/if.test.d.ts +0 -1
- package/core/components/functional/if/if.test.js +0 -35
- package/core/components/functional/list/list.d.ts +0 -117
- package/core/components/functional/list/list.js +0 -214
- package/core/components/functional/mix/mix.d.ts +0 -22
- package/core/components/functional/mix/mix.js +0 -102
- package/core/components/functional/queue/queue.d.ts +0 -67
- package/core/components/functional/queue/queue.js +0 -310
- package/core/components/functional/router/redirect.d.ts +0 -18
- package/core/components/functional/router/redirect.js +0 -53
- package/core/components/functional/router/router.d.ts +0 -27
- package/core/components/functional/router/router.js +0 -119
- package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +0 -58
- package/core/components/functional/sdui/SDUIDescriptorTransformer.js +0 -215
- package/core/components/functional/sdui/sdui-utils.d.ts +0 -5
- package/core/components/functional/sdui/sdui-utils.js +0 -63
- package/core/components/functional/sdui/sdui.d.ts +0 -136
- package/core/components/functional/sdui/sdui.js +0 -254
- package/core/components/functional/sdui/types.d.ts +0 -37
- package/core/components/functional/sdui/types.js +0 -1
- package/core/components/functional/sonic-scope/sonic-scope.d.ts +0 -5
- package/core/components/functional/sonic-scope/sonic-scope.js +0 -21
- package/core/components/functional/states/states.d.ts +0 -29
- package/core/components/functional/states/states.js +0 -134
- package/core/components/functional/submit/submit.d.ts +0 -30
- package/core/components/functional/submit/submit.js +0 -236
- package/core/components/functional/subscriber/subscriber.d.ts +0 -12
- package/core/components/functional/subscriber/subscriber.js +0 -38
- package/core/components/functional/value/value.d.ts +0 -7
- package/core/components/functional/value/value.js +0 -27
- package/core/components/ui/_css/scroll.d.ts +0 -1
- package/core/components/ui/_css/size.d.ts +0 -2
- package/core/components/ui/_css/type.d.ts +0 -2
- package/core/components/ui/alert/alert.d.ts +0 -34
- package/core/components/ui/alert/alert.js +0 -202
- package/core/components/ui/badge/badge.d.ts +0 -26
- package/core/components/ui/button/button.d.ts +0 -171
- package/core/components/ui/captcha/captcha.d.ts +0 -30
- package/core/components/ui/captcha/captcha.js +0 -93
- package/core/components/ui/card/card-footer.d.ts +0 -4
- package/core/components/ui/card/card-footer.js +0 -24
- package/core/components/ui/card/card-header-descripton.d.ts +0 -5
- package/core/components/ui/card/card-header-descripton.js +0 -32
- package/core/components/ui/card/card-header.d.ts +0 -8
- package/core/components/ui/card/card-main.d.ts +0 -4
- package/core/components/ui/card/card-main.js +0 -28
- package/core/components/ui/card/card.d.ts +0 -12
- package/core/components/ui/divider/divider.d.ts +0 -15
- package/core/components/ui/form/checkbox/checkbox.d.ts +0 -181
- package/core/components/ui/form/css/form-control.d.ts +0 -4
- package/core/components/ui/form/fieldset/fieldset.d.ts +0 -23
- package/core/components/ui/form/fieldset/fieldset.js +0 -118
- package/core/components/ui/form/fieldset/legend-description.d.ts +0 -5
- package/core/components/ui/form/fieldset/legend-description.js +0 -30
- package/core/components/ui/form/fieldset/legend.d.ts +0 -16
- package/core/components/ui/form/fieldset/legend.js +0 -112
- package/core/components/ui/form/form-actions/form-actions.d.ts +0 -7
- package/core/components/ui/form/form-actions/form-actions.js +0 -46
- package/core/components/ui/form/form-layout/form-layout.d.ts +0 -12
- package/core/components/ui/form/form-layout/form-layout.js +0 -83
- package/core/components/ui/form/input/input.d.ts +0 -106
- package/core/components/ui/form/input/input.js +0 -268
- package/core/components/ui/form/input/password-helper.d.ts +0 -25
- package/core/components/ui/form/input/password-helper.js +0 -119
- package/core/components/ui/form/input/same-value-helper.d.ts +0 -16
- package/core/components/ui/form/input/same-value-helper.js +0 -77
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +0 -136
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +0 -296
- package/core/components/ui/form/radio/radio.d.ts +0 -12
- package/core/components/ui/form/radio/radio.js +0 -50
- package/core/components/ui/form/select/select.d.ts +0 -58
- package/core/components/ui/form/select/select.js +0 -298
- package/core/components/ui/form/textarea/textarea.d.ts +0 -84
- package/core/components/ui/form/textarea/textarea.js +0 -150
- package/core/components/ui/group/group.d.ts +0 -16
- package/core/components/ui/group/group.js +0 -118
- package/core/components/ui/icon/icon.d.ts +0 -26
- package/core/components/ui/icon/icon.js +0 -113
- package/core/components/ui/icon/icons.d.ts +0 -10
- package/core/components/ui/icon/icons.js +0 -126
- package/core/components/ui/icon/icons.json +0 -1
- package/core/components/ui/image/image.d.ts +0 -15
- package/core/components/ui/image/image.js +0 -153
- package/core/components/ui/link/link.d.ts +0 -29
- package/core/components/ui/link/link.js +0 -124
- package/core/components/ui/loader/loader.d.ts +0 -23
- package/core/components/ui/loader/loader.js +0 -97
- package/core/components/ui/loader/styles/fixed.d.ts +0 -1
- package/core/components/ui/loader/styles/inline.d.ts +0 -1
- package/core/components/ui/menu/menu-item.d.ts +0 -5
- package/core/components/ui/menu/menu-item.js +0 -34
- package/core/components/ui/menu/menu.d.ts +0 -41
- package/core/components/ui/menu/menu.js +0 -313
- package/core/components/ui/modal/modal-actions.d.ts +0 -7
- package/core/components/ui/modal/modal-actions.js +0 -42
- package/core/components/ui/modal/modal-close.d.ts +0 -7
- package/core/components/ui/modal/modal-close.js +0 -43
- package/core/components/ui/modal/modal-content.d.ts +0 -5
- package/core/components/ui/modal/modal-content.js +0 -26
- package/core/components/ui/modal/modal-subtitle.d.ts +0 -5
- package/core/components/ui/modal/modal-subtitle.js +0 -30
- package/core/components/ui/modal/modal-title.d.ts +0 -5
- package/core/components/ui/modal/modal-title.js +0 -29
- package/core/components/ui/modal/modal.d.ts +0 -58
- package/core/components/ui/modal/modal.js +0 -401
- package/core/components/ui/pop/pop.d.ts +0 -37
- package/core/components/ui/pop/pop.js +0 -299
- package/core/components/ui/progress/progress.d.ts +0 -10
- package/core/components/ui/table/table-caption.d.ts +0 -5
- package/core/components/ui/table/table-caption.js +0 -28
- package/core/components/ui/table/table-tbody.d.ts +0 -5
- package/core/components/ui/table/table-tbody.js +0 -39
- package/core/components/ui/table/table-td.d.ts +0 -12
- package/core/components/ui/table/table-td.js +0 -68
- package/core/components/ui/table/table-tfoot.d.ts +0 -5
- package/core/components/ui/table/table-tfoot.js +0 -27
- package/core/components/ui/table/table-th.d.ts +0 -11
- package/core/components/ui/table/table-th.js +0 -73
- package/core/components/ui/table/table-thead.d.ts +0 -5
- package/core/components/ui/table/table-thead.js +0 -25
- package/core/components/ui/table/table-tr.d.ts +0 -13
- package/core/components/ui/table/table-tr.js +0 -66
- package/core/components/ui/table/table.d.ts +0 -17
- package/core/components/ui/theme/theme-collection/core-variables.d.ts +0 -1
- package/core/components/ui/theme/theme-collection/dark.d.ts +0 -1
- package/core/components/ui/theme/theme-collection/light.d.ts +0 -1
- package/core/components/ui/theme/theme.d.ts +0 -19
- package/core/components/ui/theme/theme.js +0 -124
- package/core/components/ui/toast/message-subscriber.d.ts +0 -18
- package/core/components/ui/toast/message-subscriber.js +0 -40
- package/core/components/ui/toast/toast-item.d.ts +0 -19
- package/core/components/ui/toast/toast.d.ts +0 -25
- package/core/components/ui/toast/toast.js +0 -226
- package/core/components/ui/toast/types.d.ts +0 -11
- package/core/components/ui/toast/types.js +0 -1
- package/core/components/ui/tooltip/tooltip.d.ts +0 -10
- package/core/components/ui/ui.d.ts +0 -32
- package/core/core.d.ts +0 -4
- package/core/core.js +0 -19
- package/core/decorators/Subscriber.d.ts +0 -4
- package/core/decorators/Subscriber.js +0 -166
- package/core/directives/DataProvider.d.ts +0 -23
- package/core/directives/DataProvider.js +0 -102
- package/core/directives/Wording.d.ts +0 -42
- package/core/directives/Wording.js +0 -202
- package/core/mixins/Fetcher.d.ts +0 -90
- package/core/mixins/Fetcher.js +0 -242
- package/core/mixins/FormCheckable.d.ts +0 -88
- package/core/mixins/FormCheckable.js +0 -306
- package/core/mixins/FormElement.d.ts +0 -32
- package/core/mixins/FormElement.js +0 -272
- package/core/mixins/FormInput.d.ts +0 -70
- package/core/mixins/FormInput.js +0 -81
- package/core/mixins/Subscriber.d.ts +0 -36
- package/core/mixins/Subscriber.js +0 -333
- package/core/mixins/TemplatesContainer.d.ts +0 -13
- package/core/mixins/TemplatesContainer.js +0 -69
- package/core/mixins/mixins.js +0 -6
- package/core/utils/Arrays.d.ts +0 -97
- package/core/utils/Arrays.js +0 -140
- package/core/utils/DataBindObserver.d.ts +0 -83
- package/core/utils/DataBindObserver.js +0 -264
- package/core/utils/Electron.d.ts +0 -7
- package/core/utils/Electron.js +0 -11
- package/core/utils/Format.d.ts +0 -12
- package/core/utils/Format.js +0 -38
- package/core/utils/HTML.d.ts +0 -42
- package/core/utils/HTML.js +0 -119
- package/core/utils/LocationHandler.d.ts +0 -46
- package/core/utils/LocationHandler.js +0 -133
- package/core/utils/Objects.d.ts +0 -28
- package/core/utils/Objects.js +0 -102
- package/core/utils/PublisherProxy.d.ts +0 -176
- package/core/utils/PublisherProxy.js +0 -709
- package/core/utils/Utils.d.ts +0 -4
- package/core/utils/Utils.js +0 -12
- package/core/utils/api.d.ts +0 -139
- package/core/utils/api.js +0 -391
- package/core/utils/url-pattern.js +0 -2
- package/decorators.d.ts +0 -3
- package/directives.d.ts +0 -40
- package/img/concorde-logo.svg +0 -1
- package/img/concorde.png +0 -0
- package/img/concorde_def.png +0 -0
- package/mixins.d.ts +0 -181
- package/svg/regular/plane.svg +0 -1
- package/svg/solid/plane.svg +0 -1
- package/test-utils/TestUtils.d.ts +0 -4
- package/test-utils/TestUtils.js +0 -12
- package/utils.d.ts +0 -20
- /package/{core/components/functional/functional.d.ts → src/core/components/functional/functional.ts} +0 -0
- /package/{core → src/core}/components/ui/theme/css/tailwind.css +0 -0
- /package/{core → src/core}/components/ui/theme/css/tailwind.d.ts +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {html, LitElement, css} from "lit";
|
|
2
|
+
import {customElement, property} from "lit/decorators.js";
|
|
3
|
+
import {styleMap} from "lit/directives/style-map.js";
|
|
4
|
+
|
|
5
|
+
const tagName = "sonic-form-actions";
|
|
6
|
+
|
|
7
|
+
@customElement(tagName)
|
|
8
|
+
export class FormActions extends LitElement {
|
|
9
|
+
static styles = [
|
|
10
|
+
css`
|
|
11
|
+
:host {
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
slot {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
gap: 0.3rem;
|
|
18
|
+
}
|
|
19
|
+
`,
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
@property({type: String}) direction = "row";
|
|
23
|
+
@property({type: String}) justify = "flex-start";
|
|
24
|
+
|
|
25
|
+
render() {
|
|
26
|
+
const styles = {
|
|
27
|
+
flexDirection: this.direction,
|
|
28
|
+
justifyContent: this.justify,
|
|
29
|
+
};
|
|
30
|
+
return html`<slot style=${styleMap(styles)}></slot>`;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Form-layout
|
|
2
|
+
|
|
3
|
+
<sonic-code>
|
|
4
|
+
<template>
|
|
5
|
+
<form>
|
|
6
|
+
<sonic-form-layout>
|
|
7
|
+
<sonic-input autocomplete="family-name" label="Nom" name="nom"></sonic-input>
|
|
8
|
+
<sonic-input autocomplete="given-name" label="Prénom" name="prenom"></sonic-input>
|
|
9
|
+
<sonic-select autocomplete="sex" label="Sexe" name="sexe">
|
|
10
|
+
<option value="" selected="selected">- Sélectionner -</option>
|
|
11
|
+
<option value="-">Je préfère ne pas le dire</option>
|
|
12
|
+
<option value="Homme">Homme</option>
|
|
13
|
+
<option value="Femme">Femme</option>
|
|
14
|
+
</sonic-select>
|
|
15
|
+
<sonic-input autocomplete="bday" label="Date de naissance" name="date_naissance" type="date"></sonic-input>
|
|
16
|
+
<sonic-divider></sonic-divider>
|
|
17
|
+
<sonic-input autocomplete="email" label="e-mail" name="email" type="email"></sonic-input>
|
|
18
|
+
<sonic-input
|
|
19
|
+
autocomplete="email"
|
|
20
|
+
label="Confirmer votre e-mail"
|
|
21
|
+
name="email_confirmation"
|
|
22
|
+
type="email"
|
|
23
|
+
></sonic-input>
|
|
24
|
+
<sonic-input autocomplete="new-password" label="Mot de passe" name="password" type="password"></sonic-input>
|
|
25
|
+
<sonic-input
|
|
26
|
+
autocomplete="new-password"
|
|
27
|
+
label="Confirmer votre mot de passe"
|
|
28
|
+
name="password_confirmation"
|
|
29
|
+
type="password"
|
|
30
|
+
></sonic-input>
|
|
31
|
+
<sonic-divider></sonic-divider>
|
|
32
|
+
<sonic-textarea label="Message" rows="5">
|
|
33
|
+
</sonic-textarea>
|
|
34
|
+
<sonic-checkbox>Inscription à la newsletter</sonic-checkbox>
|
|
35
|
+
<sonic-checkbox>J'ai lu et accepte les <sonic-link href="#" class="underline">Conditions générales de ventes</sonic-link></sonic-checkbox>
|
|
36
|
+
<sonic-form-actions>
|
|
37
|
+
<sonic-button type="success">Valider</sonic-button>
|
|
38
|
+
</sonic-form-actions>
|
|
39
|
+
</sonic-form-layout>
|
|
40
|
+
</form >
|
|
41
|
+
</template>
|
|
42
|
+
</sonic-code>
|
|
43
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {html, LitElement, css} from "lit";
|
|
2
|
+
import {customElement, property, queryAssignedElements} from "lit/decorators.js";
|
|
3
|
+
import {ResizeController} from "@lit-labs/observers/resize-controller.js";
|
|
4
|
+
import {classMap} from "lit/directives/class-map.js";
|
|
5
|
+
|
|
6
|
+
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
7
|
+
|
|
8
|
+
const tagName = "sonic-form-layout";
|
|
9
|
+
|
|
10
|
+
@customElement(tagName)
|
|
11
|
+
export class FormLayout extends Subscriber(LitElement) {
|
|
12
|
+
static styles = [
|
|
13
|
+
css`
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
div {
|
|
19
|
+
display: grid;
|
|
20
|
+
grid-gap: 1.5rem;
|
|
21
|
+
align-items: flex-start;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.cq--md {
|
|
25
|
+
grid-gap: 1.75rem;
|
|
26
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
27
|
+
}
|
|
28
|
+
.one-form-element {
|
|
29
|
+
grid-template-columns: 1fr;
|
|
30
|
+
}
|
|
31
|
+
/*::slotted(sonic-radio),
|
|
32
|
+
::slotted(sonic-checkbox),
|
|
33
|
+
::slotted(sonic-form-actions),
|
|
34
|
+
::slotted(sonic-divider),
|
|
35
|
+
::slotted(sonic-textarea) {
|
|
36
|
+
grid-column: 1 / -1;
|
|
37
|
+
}*/
|
|
38
|
+
::slotted(sonic-submit) {
|
|
39
|
+
display: contents;
|
|
40
|
+
}
|
|
41
|
+
::slotted(:not(sonic-input):not(sonic-select):not(sonic-input-autocomplete):not(.form-item-container)) {
|
|
42
|
+
grid-column: 1 / -1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
::slotted(sonic-divider) {
|
|
46
|
+
--sc-divider-my: 0;
|
|
47
|
+
}
|
|
48
|
+
`,
|
|
49
|
+
];
|
|
50
|
+
_resizeController = new ResizeController(this, {});
|
|
51
|
+
|
|
52
|
+
@queryAssignedElements({flatten: true}) slottedElements!: HTMLElement[];
|
|
53
|
+
@property({type: Boolean}) oneFormElement = false;
|
|
54
|
+
|
|
55
|
+
onSlotChange() {
|
|
56
|
+
let elements = this.slottedElements;
|
|
57
|
+
const formElementColumns = ["sonic-input", "sonic-select", "sonic-input-autocomplete", ".form-item-container"];
|
|
58
|
+
// keep only form elements
|
|
59
|
+
elements = elements.filter((elt) => formElementColumns.includes(elt.nodeName.toLowerCase()));
|
|
60
|
+
this.oneFormElement = elements.length == 1;
|
|
61
|
+
}
|
|
62
|
+
render() {
|
|
63
|
+
const classes = {
|
|
64
|
+
"cq--md": this.offsetWidth > 440,
|
|
65
|
+
"one-form-element": this.oneFormElement,
|
|
66
|
+
};
|
|
67
|
+
return html`<div class=${classMap(classes)}>
|
|
68
|
+
<slot @slotchange=${this.onSlotChange}></slot>
|
|
69
|
+
</div>`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Input
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<sonic-button type="info" size="sm" target="_blank" href="https://www.w3schools.com/tags/tag_input.asp#midcontentadcontainer">
|
|
5
|
+
<sonic-icon library="iconoir" name="open-new-window" slot="prefix" ></sonic-icon>
|
|
6
|
+
Native attibutes list
|
|
7
|
+
</sonic-button>
|
|
8
|
+
|
|
9
|
+
## Label
|
|
10
|
+
<sonic-code>
|
|
11
|
+
<template>
|
|
12
|
+
<sonic-input label="Label"></sonic-input>
|
|
13
|
+
</template>
|
|
14
|
+
</sonic-code>
|
|
15
|
+
|
|
16
|
+
## Placeholder
|
|
17
|
+
<sonic-code>
|
|
18
|
+
<template>
|
|
19
|
+
<sonic-input placeholder="placeholder"></sonic-input>
|
|
20
|
+
</template>
|
|
21
|
+
</sonic-code>
|
|
22
|
+
|
|
23
|
+
## Value
|
|
24
|
+
<sonic-code>
|
|
25
|
+
<template>
|
|
26
|
+
<sonic-input value="value"></sonic-input>
|
|
27
|
+
</template>
|
|
28
|
+
</sonic-code>
|
|
29
|
+
|
|
30
|
+
## Required
|
|
31
|
+
<sonic-code>
|
|
32
|
+
<template>
|
|
33
|
+
<sonic-input required type="email" placeholder="you@email.com" label="Feedback on blur"></sonic-input>
|
|
34
|
+
</template>
|
|
35
|
+
</sonic-code>
|
|
36
|
+
|
|
37
|
+
## Description
|
|
38
|
+
<sonic-code>
|
|
39
|
+
<template>
|
|
40
|
+
<sonic-input description="Description goes here" ></sonic-input>
|
|
41
|
+
</template>
|
|
42
|
+
</sonic-code>
|
|
43
|
+
|
|
44
|
+
## Type
|
|
45
|
+
<sonic-button size="2xs" type="info" target="_blank" href="https://www.w3schools.com/html/html_form_input_types.asp">Liste des types</sonic-button>
|
|
46
|
+
|
|
47
|
+
<sonic-code>
|
|
48
|
+
<template>
|
|
49
|
+
<div class="grid gap-3">
|
|
50
|
+
<sonic-input type="text" label="Text">Text</sonic-input>
|
|
51
|
+
<sonic-input type="email" label="Email" placeholder="plop@kiki.com"></sonic-input>
|
|
52
|
+
<sonic-input type="password" label="Password"></sonic-input>
|
|
53
|
+
<sonic-input type="date" label="Date"></sonic-input>
|
|
54
|
+
<sonic-input type="number" label="Number"></sonic-input>
|
|
55
|
+
<sonic-input type="color" label="Color" value="#ffff00"></sonic-input>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
</sonic-code>
|
|
59
|
+
|
|
60
|
+
## Size
|
|
61
|
+
<sonic-code>
|
|
62
|
+
<template>
|
|
63
|
+
<div class="grid gap-3">
|
|
64
|
+
<sonic-input size="2xs" value="2xs"></sonic-input>
|
|
65
|
+
<sonic-input size="xs" value="xs"></sonic-input>
|
|
66
|
+
<sonic-input size="sm" value="sm"></sonic-input>
|
|
67
|
+
<sonic-input size="md" value="md"></sonic-input>
|
|
68
|
+
<sonic-input value="default"></sonic-input>
|
|
69
|
+
<sonic-input size="lg" value="lg"></sonic-input>
|
|
70
|
+
<sonic-input size="xl" value="xl"></sonic-input>
|
|
71
|
+
<sonic-input size="2xl" value="2xl"></sonic-input>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
</sonic-code>
|
|
75
|
+
|
|
76
|
+
## List
|
|
77
|
+
<sonic-alert status="error" label="Non fonctionnel" class="mb-4"></sonic-alert>
|
|
78
|
+
|
|
79
|
+
<sonic-code>
|
|
80
|
+
<template>
|
|
81
|
+
<sonic-input list="browsers"></sonic-input>
|
|
82
|
+
<datalist id="browsers">
|
|
83
|
+
<option value="Internet Explorer">
|
|
84
|
+
<option value="Firefox">
|
|
85
|
+
<option value="Google Chrome">
|
|
86
|
+
<option value="Opera">
|
|
87
|
+
<option value="Safari">
|
|
88
|
+
</datalist>
|
|
89
|
+
</template>
|
|
90
|
+
</sonic-code>
|
|
91
|
+
|
|
92
|
+
## Prefix & suffix
|
|
93
|
+
|
|
94
|
+
<sonic-code>
|
|
95
|
+
<template>
|
|
96
|
+
<div class="grid grid-cols-2 gap-3">
|
|
97
|
+
<sonic-input type="search" label="Search" placeholder="Search plane">
|
|
98
|
+
<sonic-icon library="iconoir" name="search" slot="prefix"></sonic-icon>
|
|
99
|
+
</sonic-input>
|
|
100
|
+
<sonic-input type="number" label="Amount" placeholder="0">
|
|
101
|
+
<sonic-icon library="iconoir" name="euro" slot="suffix"></sonic-icon>
|
|
102
|
+
</sonic-input>
|
|
103
|
+
</div>
|
|
104
|
+
</template>
|
|
105
|
+
</sonic-code>
|
|
106
|
+
|
|
107
|
+
## InlineContent
|
|
108
|
+
|
|
109
|
+
<sonic-code>
|
|
110
|
+
<template>
|
|
111
|
+
<div class="grid grid-cols-4 gap-3">
|
|
112
|
+
<sonic-input inlineContent type="search" label="Search icon in input" placeholder="Search plane">
|
|
113
|
+
<sonic-icon library="iconoir" name="search" slot="prefix"></sonic-icon>
|
|
114
|
+
</sonic-input>
|
|
115
|
+
<sonic-input inlineContent type="number" label="Number of seats" placeholder="0">
|
|
116
|
+
<div slot="suffix" class="flex gap-2 items-center">
|
|
117
|
+
<sonic-badge type="danger" size="sm">4 max</sonic-badge>
|
|
118
|
+
<sonic-icon library="iconoir" name="euro" ></sonic-icon>
|
|
119
|
+
</div>
|
|
120
|
+
</sonic-input>
|
|
121
|
+
</div>
|
|
122
|
+
</template>
|
|
123
|
+
</sonic-code>
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
## Example of use
|
|
128
|
+
<sonic-code>
|
|
129
|
+
<template>
|
|
130
|
+
<sonic-theme color background theme=${theme} class="p-8">
|
|
131
|
+
<sonic-input
|
|
132
|
+
formDataProvider="input-filter"
|
|
133
|
+
name="contains"
|
|
134
|
+
value="chien"
|
|
135
|
+
></sonic-input>
|
|
136
|
+
<sonic-subscriber dataProvider="input-filter" class="text-xl my-4 block font-bold">
|
|
137
|
+
Blagues trouvées pour "<span data-bind ::inner-html="$contains"></span>" :
|
|
138
|
+
</sonic-subscriber>
|
|
139
|
+
<sonic-queue
|
|
140
|
+
lazyload
|
|
141
|
+
dataProviderExpression="joke/Any?amount=10&lang=fr"
|
|
142
|
+
dataFilterProvider="input-filter"
|
|
143
|
+
serviceURL="https://v2.jokeapi.dev"
|
|
144
|
+
key="jokes"
|
|
145
|
+
>
|
|
146
|
+
<template>
|
|
147
|
+
<div class="border-0 border-b-[1px] border-b-neutral-300 border-dotted py-3">
|
|
148
|
+
<div data-bind ::inner-html="$joke"></div>
|
|
149
|
+
<div data-bind ::inner-html="$setup"></div>
|
|
150
|
+
<div data-bind ::inner-html="$delivery"></div>
|
|
151
|
+
</div>
|
|
152
|
+
</template>
|
|
153
|
+
</sonic-queue>
|
|
154
|
+
</sonic-theme>
|
|
155
|
+
</template>
|
|
156
|
+
</sonic-code>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
<sonic-code>
|
|
160
|
+
<template>
|
|
161
|
+
<sonic-input type="search" placeholder="Search plane" class="inline-block">
|
|
162
|
+
</sonic-input>
|
|
163
|
+
<sonic-button type="danger" label="Amount" placeholder="0">azdazd
|
|
164
|
+
</sonic-button>
|
|
165
|
+
</template>
|
|
166
|
+
</sonic-code>
|
|
167
|
+
|
|
168
|
+
<!-- <sonic-input type="password" inlineContent size="2xl"><span slot="suffix">PLOP</span></sonic-input> -->
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import {html, LitElement, PropertyValues, css, nothing} from "lit";
|
|
2
|
+
import {customElement, property, queryAssignedNodes, state} from "lit/decorators.js";
|
|
3
|
+
import {query} from "lit/decorators/query.js";
|
|
4
|
+
import {ifDefined} from "lit/directives/if-defined.js";
|
|
5
|
+
import {formControl, label, description, passwordToggle} from "@supersoniks/concorde/core/components/ui/form/css/form-control";
|
|
6
|
+
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
7
|
+
import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
8
|
+
import FormInput from "@supersoniks/concorde/core/mixins/FormInput";
|
|
9
|
+
import {classMap} from "lit/directives/class-map.js";
|
|
10
|
+
import {fontSize} from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
11
|
+
import {unsafeHTML} from "lit/directives/unsafe-html.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* ### Le composent sonic-input étend les mixins FormInput, FormElement et Subscriber
|
|
15
|
+
* **FormElement :**
|
|
16
|
+
* * La propriété value est remplie automatiquement a l'aide de l'attribut name renseigné, ceci en prenant la valeur de la propriété du même nom dans les données du dataprovider associé.
|
|
17
|
+
* * Par défault lorsque l'on édite l'input, la valeur est également mise à jour via le même dataprovider
|
|
18
|
+
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
19
|
+
* * Par conséquent on peut par exemple le lier à un composant *queue* (via sa propriété *dataFilterProvider*) de manière à appeller en auto une api avec des filtres.
|
|
20
|
+
* **FormInput :**
|
|
21
|
+
* Uniquement des propriétés classiques d'un input HTML.
|
|
22
|
+
*/
|
|
23
|
+
const tagName = "sonic-input";
|
|
24
|
+
|
|
25
|
+
@customElement(tagName)
|
|
26
|
+
export class Input extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
27
|
+
static styles = [
|
|
28
|
+
fontSize,
|
|
29
|
+
formControl,
|
|
30
|
+
label,
|
|
31
|
+
description,
|
|
32
|
+
passwordToggle,
|
|
33
|
+
css`
|
|
34
|
+
:host([type="hidden"]) {
|
|
35
|
+
appearance: none !important;
|
|
36
|
+
display: none !important;
|
|
37
|
+
}
|
|
38
|
+
:host > .form-control {
|
|
39
|
+
position: relative;
|
|
40
|
+
}
|
|
41
|
+
`,
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Taille du composant, implique notamment des modifications de typo et de marge interne
|
|
46
|
+
*/
|
|
47
|
+
@property({type: String, reflect: true}) size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
48
|
+
@property({type: String}) list?: string;
|
|
49
|
+
@property({type: String}) placeholder?: string;
|
|
50
|
+
@property({type: String}) pattern?: string;
|
|
51
|
+
@property({type: String}) min?: string;
|
|
52
|
+
@property({type: String}) max?: string;
|
|
53
|
+
@property({type: Boolean}) readonly = false;
|
|
54
|
+
@property({type: Number}) step?: number;
|
|
55
|
+
@property({type: Number}) minlength?: number;
|
|
56
|
+
@property({type: Number}) maxlength?: number;
|
|
57
|
+
@property({type: String}) src?: string;
|
|
58
|
+
|
|
59
|
+
@property({type: Boolean, reflect: true}) inlineContent = false;
|
|
60
|
+
@property({type: Boolean}) disableInlineContentFocus = false;
|
|
61
|
+
@property({type: Boolean}) showPasswordToggle = false;
|
|
62
|
+
|
|
63
|
+
@queryAssignedNodes({slot: "label", flatten: true})
|
|
64
|
+
slotLabelNodes!: Array<Node>;
|
|
65
|
+
|
|
66
|
+
@queryAssignedNodes({slot: "description", flatten: true})
|
|
67
|
+
slotDescriptionNodes!: Array<Node>;
|
|
68
|
+
|
|
69
|
+
@queryAssignedNodes({slot: "suffix", flatten: true})
|
|
70
|
+
slotSuffixNodes!: Array<Node>;
|
|
71
|
+
|
|
72
|
+
@queryAssignedNodes({slot: "prefix", flatten: true})
|
|
73
|
+
slotPrefixNodes!: Array<Node>;
|
|
74
|
+
|
|
75
|
+
@query("input") input!: HTMLInputElement;
|
|
76
|
+
|
|
77
|
+
@state() hasDescription = false;
|
|
78
|
+
@state() hasLabel = false;
|
|
79
|
+
@state() hasSuffix = false;
|
|
80
|
+
@state() hasPrefix = false;
|
|
81
|
+
@state() isPassword = false;
|
|
82
|
+
|
|
83
|
+
sameValueAsHandle?: (v: string) => void;
|
|
84
|
+
sameValueAsName?: string;
|
|
85
|
+
|
|
86
|
+
connectedCallback() {
|
|
87
|
+
super.connectedCallback();
|
|
88
|
+
this.hasSlotOrProps();
|
|
89
|
+
if (this.hasAttribute("sameValueAs")) {
|
|
90
|
+
this.sameValueAsName = this.getAttribute("sameValueAs");
|
|
91
|
+
this.sameValueAsHandle = (v: string) => (this.pattern = this.escapeRegExp(v));
|
|
92
|
+
const formPublisher = this.getFormPublisher();
|
|
93
|
+
if (!formPublisher) return;
|
|
94
|
+
formPublisher[this.sameValueAsName].onAssign(this.sameValueAsHandle);
|
|
95
|
+
}
|
|
96
|
+
if (this.type == "password") {
|
|
97
|
+
this.isPassword = true;
|
|
98
|
+
this.showPasswordToggle = true;
|
|
99
|
+
this.inlineContent = true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
disconnectedCallback() {
|
|
103
|
+
super.disconnectedCallback();
|
|
104
|
+
if (this.hasAttribute("sameValueAs") && this.sameValueAsName) {
|
|
105
|
+
const formPublisher = this.getFormPublisher();
|
|
106
|
+
if (!formPublisher) return;
|
|
107
|
+
formPublisher[this.sameValueAsName].offAssign(this.sameValueAsHandle);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
escapeRegExp(string: string) {
|
|
112
|
+
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
willUpdate(changedProperties: PropertyValues) {
|
|
116
|
+
this.hasSlotOrProps();
|
|
117
|
+
super.willUpdate(changedProperties);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
setSelectionRange(start: number, end: number) {
|
|
121
|
+
this.input.setSelectionRange(start, end);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
hasSlotOrProps() {
|
|
125
|
+
this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false;
|
|
126
|
+
this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false;
|
|
127
|
+
this.hasSuffix = this.slotSuffixNodes?.length ? true : false;
|
|
128
|
+
this.hasPrefix = this.slotPrefixNodes?.length ? true : false;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
inlineContentFocus() {
|
|
132
|
+
if (!this.inlineContent || this.disableInlineContentFocus) return;
|
|
133
|
+
this.input?.focus();
|
|
134
|
+
}
|
|
135
|
+
changeTimeoutId?: ReturnType<typeof setTimeout>;
|
|
136
|
+
|
|
137
|
+
handleChange(e?: Event) {
|
|
138
|
+
if (!this.hasAttribute("inputDelayMs")) {
|
|
139
|
+
super.handleChange(e);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (this.changeTimeoutId) clearTimeout(this.changeTimeoutId);
|
|
143
|
+
this.changeTimeoutId = setTimeout(() => super.handleChange(e), parseInt(this.getAttribute("inputDelayMs")));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// toggle password visibility
|
|
147
|
+
togglePasswordVisibility() {
|
|
148
|
+
this.isPassword = !this.isPassword;
|
|
149
|
+
this._type = this.isPassword ? "password" : "text";
|
|
150
|
+
// this.type = this.isPassword ? "password" : "text";
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
render() {
|
|
154
|
+
const slotClasses = {
|
|
155
|
+
"has-prefix": this.hasPrefix,
|
|
156
|
+
"has-suffix": this.hasSuffix,
|
|
157
|
+
"no-suffix": !this.hasSuffix,
|
|
158
|
+
"no-prefix": !this.hasPrefix,
|
|
159
|
+
};
|
|
160
|
+
//let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
|
|
161
|
+
return html`
|
|
162
|
+
<label for="${this.id || "form-element"}" class="${this.hasLabel ? "form-label" : "hidden"}"
|
|
163
|
+
>${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}<slot
|
|
164
|
+
name="label"
|
|
165
|
+
@slotchange=${this.hasSlotOrProps}
|
|
166
|
+
></slot
|
|
167
|
+
></label>
|
|
168
|
+
|
|
169
|
+
<div @click=${this.inlineContentFocus} class="form-control ${classMap(slotClasses)}">
|
|
170
|
+
<div part="content" class="${this.inlineContent ? "form-element form-element-wrapper" : "contents"}">
|
|
171
|
+
<slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
172
|
+
<input
|
|
173
|
+
part="input"
|
|
174
|
+
id=${ifDefined(this.id || "form-element")}
|
|
175
|
+
part="input"
|
|
176
|
+
class="form-element input"
|
|
177
|
+
@input=${this.handleChange}
|
|
178
|
+
@blur=${this.handleBlur}
|
|
179
|
+
type=${this.type}
|
|
180
|
+
disabled=${ifDefined(this.disabled)}
|
|
181
|
+
?readonly=${this.readonly}
|
|
182
|
+
?autofocus=${this.autofocus}
|
|
183
|
+
list=${ifDefined(this.list)}
|
|
184
|
+
tabindex=${ifDefined(this.tabindex)}
|
|
185
|
+
pattern=${ifDefined(this.pattern)}
|
|
186
|
+
min=${ifDefined(this.min)}
|
|
187
|
+
max=${ifDefined(this.max)}
|
|
188
|
+
step=${ifDefined(this.step)}
|
|
189
|
+
src=${ifDefined(this.src)}
|
|
190
|
+
minlength=${ifDefined(this.minlength)}
|
|
191
|
+
maxlength=${ifDefined(this.maxlength)}
|
|
192
|
+
placeholder=${ifDefined(this.placeholder)}
|
|
193
|
+
required=${ifDefined(this.required)}
|
|
194
|
+
autocomplete=${ifDefined(this.autocomplete)}
|
|
195
|
+
aria-label=${ifDefined(this.ariaLabel)}
|
|
196
|
+
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
197
|
+
.name=${this.name}
|
|
198
|
+
.value=${this.value}
|
|
199
|
+
/>
|
|
200
|
+
${
|
|
201
|
+
this.showPasswordToggle
|
|
202
|
+
? html`<sonic-button
|
|
203
|
+
shape="circle"
|
|
204
|
+
class="password-toggle"
|
|
205
|
+
@click=${this.togglePasswordVisibility}
|
|
206
|
+
aria-label="Toggle password visibility"
|
|
207
|
+
variant="unstyled"
|
|
208
|
+
>
|
|
209
|
+
<sonic-icon library="heroicons" name=${this.isPassword ? "eye" : "eye-slash"}></sonic-icon>
|
|
210
|
+
</sonic-button>`
|
|
211
|
+
: ""
|
|
212
|
+
}
|
|
213
|
+
<slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<!-- le slot ne doit pas avoir d'espace-->
|
|
218
|
+
<slot
|
|
219
|
+
name="description"
|
|
220
|
+
@slotchange=${this.hasSlotOrProps}
|
|
221
|
+
class="${this.hasDescription ? "form-description" : "hidden"}"
|
|
222
|
+
>${this.description ? html`${unsafeHTML(this.description)}` : nothing}</slot>
|
|
223
|
+
<slot name="list"></slot>
|
|
224
|
+
</div>
|
|
225
|
+
`;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {html, LitElement, nothing} from "lit";
|
|
2
|
+
import {customElement, property, state} from "lit/decorators.js";
|
|
3
|
+
import {Subscriber} from "@supersoniks/concorde/mixins";
|
|
4
|
+
import {PublisherManager} from "@supersoniks/concorde/utils";
|
|
5
|
+
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
6
|
+
const tagName = "sonic-password-helper"; // For Astro.build
|
|
7
|
+
@customElement(tagName)
|
|
8
|
+
export class SonicComponent extends Subscriber(LitElement) {
|
|
9
|
+
@property() name?: string;
|
|
10
|
+
@property() minChars = 8;
|
|
11
|
+
@state() hasNoChar = true;
|
|
12
|
+
@state() hasEnoughChars = false;
|
|
13
|
+
@state() hasMinuscule = false;
|
|
14
|
+
@state() hasMajuscule = false;
|
|
15
|
+
@state() hasNumber = false;
|
|
16
|
+
@state() hasSpecialChar = false;
|
|
17
|
+
|
|
18
|
+
@property() wording_password_helper_decription = "Le mot de passe doit contenir au moins :";
|
|
19
|
+
@property() wording_password_helper_min_length = "8 caractères";
|
|
20
|
+
@property() wording_password_helper_lower_case = "1 minuscule";
|
|
21
|
+
@property() wording_password_helper_upper_case = "1 majuscule";
|
|
22
|
+
@property() wording_password_helper_number = "1 chiffre";
|
|
23
|
+
@property() wording_password_helper_special_char = "1 caractère spécial";
|
|
24
|
+
|
|
25
|
+
checkValue?: (v: string) => void;
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
super.connectedCallback();
|
|
28
|
+
if (this.name) {
|
|
29
|
+
this.checkValue = (v) => {
|
|
30
|
+
if (v) {
|
|
31
|
+
this.hasNoChar = v.length == 0;
|
|
32
|
+
this.hasEnoughChars = v.length > this.minChars;
|
|
33
|
+
} else {
|
|
34
|
+
this.hasNoChar = true;
|
|
35
|
+
this.hasEnoughChars = false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
this.hasMinuscule = /[a-z]/.test(v);
|
|
39
|
+
this.hasMajuscule = /[A-Z]/.test(v);
|
|
40
|
+
this.hasNumber = /[0-9]/.test(v);
|
|
41
|
+
this.hasSpecialChar = /[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/.test(v);
|
|
42
|
+
};
|
|
43
|
+
PublisherManager.get(this.getAncestorAttributeValue("formDataProvider"))[this.name].onAssign(this.checkValue);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
disconnectedCallback(): void {
|
|
47
|
+
if (this.checkValue && this.name) {
|
|
48
|
+
PublisherManager.get(this.getAncestorAttributeValue("formDataProvider"))[this.name].offAssign(this.checkValue);
|
|
49
|
+
}
|
|
50
|
+
super.disconnectedCallback();
|
|
51
|
+
}
|
|
52
|
+
getIcon(test: boolean) {
|
|
53
|
+
return test
|
|
54
|
+
? html`<sonic-icon library="heroicons" name="face-smile"></sonic-icon>`
|
|
55
|
+
: html`<sonic-icon library="heroicons" name="x-mark"></sonic-icon>`;
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
if (this.hasNoChar) return nothing;
|
|
59
|
+
return html`
|
|
60
|
+
<div>${this.wording_password_helper_decription}</div>
|
|
61
|
+
<div>${this.getIcon(this.hasEnoughChars)} ${this.wording_password_helper_min_length}</div>
|
|
62
|
+
<div>${this.getIcon(this.hasMinuscule)} ${this.wording_password_helper_lower_case}</div>
|
|
63
|
+
<div>${this.getIcon(this.hasMajuscule)} ${this.wording_password_helper_upper_case}</div>
|
|
64
|
+
<div>${this.getIcon(this.hasNumber)} ${this.wording_password_helper_number}</div>
|
|
65
|
+
<div>${this.getIcon(this.hasSpecialChar)} ${this.wording_password_helper_special_char}</div>
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {html, LitElement, nothing} from "lit";
|
|
2
|
+
import {customElement, property, state} from "lit/decorators.js";
|
|
3
|
+
import {Subscriber} from "@supersoniks/concorde/mixins";
|
|
4
|
+
import {PublisherManager} from "@supersoniks/concorde/utils";
|
|
5
|
+
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
6
|
+
import {unsafeHTML} from "lit/directives/unsafe-html.js";
|
|
7
|
+
const tagName = "sonic-same-value-helper"; // For Astro.build
|
|
8
|
+
@customElement(tagName)
|
|
9
|
+
export class SonicComponent extends Subscriber(LitElement) {
|
|
10
|
+
@property() name?: string;
|
|
11
|
+
@property() sameValueAs?: string;
|
|
12
|
+
@property() descriptionWhenEqual = "Correspondance : oui";
|
|
13
|
+
@property() descriptionWhenNotEqual = "Correspondance : non";
|
|
14
|
+
@state() areEqual = false;
|
|
15
|
+
@state() hasNoChar = true;
|
|
16
|
+
|
|
17
|
+
checkValue?: (v: string) => void;
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
super.connectedCallback();
|
|
20
|
+
const formDataProvider = PublisherManager.get(this.getAncestorAttributeValue("formDataProvider"));
|
|
21
|
+
if (this.name && this.sameValueAs) {
|
|
22
|
+
this.checkValue = (v) => {
|
|
23
|
+
if (v) this.hasNoChar = v.length == 0;
|
|
24
|
+
else this.hasNoChar = true;
|
|
25
|
+
if (this.name && this.sameValueAs) {
|
|
26
|
+
this.areEqual = formDataProvider[this.name].get() == formDataProvider[this.sameValueAs].get();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
formDataProvider[this.name].onAssign(this.checkValue);
|
|
30
|
+
formDataProvider[this.sameValueAs].onAssign(this.checkValue);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
disconnectedCallback(): void {
|
|
34
|
+
if (this.checkValue && this.name && this.sameValueAs) {
|
|
35
|
+
const formDataProvider = PublisherManager.get(this.getAncestorAttributeValue("formDataProvider"));
|
|
36
|
+
formDataProvider[this.name].offAssign(this.checkValue);
|
|
37
|
+
formDataProvider[this.sameValueAs].offAssign(this.checkValue);
|
|
38
|
+
}
|
|
39
|
+
super.disconnectedCallback();
|
|
40
|
+
}
|
|
41
|
+
//TODO Multilangue
|
|
42
|
+
render() {
|
|
43
|
+
if (this.hasNoChar) return nothing;
|
|
44
|
+
return html`
|
|
45
|
+
<span> ${this.areEqual ? unsafeHTML(this.descriptionWhenEqual) : unsafeHTML(this.descriptionWhenNotEqual)} </span>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
}
|