@supersoniks/concorde 2.0.6 → 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 -287
- 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 -74
- package/components.d.ts +0 -4
- package/concorde-core.bundle.js +0 -3427
- package/concorde-core.es.js +0 -14199
- 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
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { html, LitElement, css } from "lit";
|
|
8
|
-
import { customElement, property, queryAssignedNodes, state } from "lit/decorators.js";
|
|
9
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
10
|
-
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
|
-
import { repeat } from "lit/directives/repeat.js";
|
|
12
|
-
import { formControl, label, description } from "@supersoniks/concorde/core/components/ui/form/css/form-control";
|
|
13
|
-
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
14
|
-
import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
15
|
-
import "@supersoniks/concorde/core/components/ui/icon/icon";
|
|
16
|
-
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
17
|
-
import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
18
|
-
const tagName = "sonic-select";
|
|
19
|
-
/**
|
|
20
|
-
* #### FormElement :
|
|
21
|
-
* * 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é.
|
|
22
|
-
* * Par défault lorsque l'on édite l'input, la valeur est également mise à jour via le même dataprovider
|
|
23
|
-
* * On peut cependant décider de mettre à jour la donnée à une autre adresse en renseigne l'attribut *formDataProvider*.
|
|
24
|
-
* * 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.
|
|
25
|
-
*/
|
|
26
|
-
let Select = class Select extends FormElement(Subscriber(LitElement)) {
|
|
27
|
-
constructor() {
|
|
28
|
-
super(...arguments);
|
|
29
|
-
this.valueKey = "value";
|
|
30
|
-
this.wordingKey = "wording";
|
|
31
|
-
this.multiple = false;
|
|
32
|
-
this.status = "default";
|
|
33
|
-
this._options = [];
|
|
34
|
-
this.hasDoneFirstUpdate = false;
|
|
35
|
-
this._value = "";
|
|
36
|
-
this.updateOptions = () => {
|
|
37
|
-
const options = this.querySelectorAll("option");
|
|
38
|
-
if (options.length > 0) {
|
|
39
|
-
this.options = Array.from(options).map((option) => {
|
|
40
|
-
return {
|
|
41
|
-
value: option.value,
|
|
42
|
-
wording: option.text,
|
|
43
|
-
selected: option.hasAttribute("selected"),
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
/*
|
|
49
|
-
* TODO
|
|
50
|
-
* Mutualiser avec le composant textarea / input
|
|
51
|
-
*/
|
|
52
|
-
this.forceAutoFill = false;
|
|
53
|
-
this.hasDescription = false;
|
|
54
|
-
this.hasLabel = false;
|
|
55
|
-
this.hasSuffix = false;
|
|
56
|
-
this.hasPrefix = false;
|
|
57
|
-
}
|
|
58
|
-
set options(options) {
|
|
59
|
-
this._options = options;
|
|
60
|
-
for (const option of options) {
|
|
61
|
-
if (option.selected) {
|
|
62
|
-
this.value = option.value || "";
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const value = this.value || this.getAttribute("value");
|
|
66
|
-
if (!value && this._options.length > 0) {
|
|
67
|
-
this.value = this._options[0][this.valueKey];
|
|
68
|
-
}
|
|
69
|
-
this.requestUpdate();
|
|
70
|
-
}
|
|
71
|
-
get options() {
|
|
72
|
-
return this._options;
|
|
73
|
-
}
|
|
74
|
-
firstUpdated(changedProperties) {
|
|
75
|
-
this.hasDoneFirstUpdate = true;
|
|
76
|
-
super.firstUpdated(changedProperties);
|
|
77
|
-
}
|
|
78
|
-
set value(value) {
|
|
79
|
-
if (value == null && !this.hasDoneFirstUpdate)
|
|
80
|
-
return;
|
|
81
|
-
if (!value)
|
|
82
|
-
value = "";
|
|
83
|
-
if (this._value == value)
|
|
84
|
-
return;
|
|
85
|
-
this._value = value;
|
|
86
|
-
this.updateFormPublisherValue();
|
|
87
|
-
this.requestUpdate();
|
|
88
|
-
}
|
|
89
|
-
get value() {
|
|
90
|
-
return this._value;
|
|
91
|
-
}
|
|
92
|
-
updateFormPublisherValue() {
|
|
93
|
-
const formPublisher = this.getFormPublisher();
|
|
94
|
-
if (formPublisher) {
|
|
95
|
-
formPublisher[this.name] = this.value;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
connectedCallback() {
|
|
99
|
-
super.connectedCallback();
|
|
100
|
-
this.hasSlotOrProps();
|
|
101
|
-
this.updateOptions();
|
|
102
|
-
}
|
|
103
|
-
get description() {
|
|
104
|
-
return this._description;
|
|
105
|
-
}
|
|
106
|
-
set description(value) {
|
|
107
|
-
if (this.hasAttribute("description") && !this.forceAutoFill)
|
|
108
|
-
value = this.getAttribute("description");
|
|
109
|
-
this._description = value;
|
|
110
|
-
this.requestUpdate();
|
|
111
|
-
}
|
|
112
|
-
get label() {
|
|
113
|
-
return this._label;
|
|
114
|
-
}
|
|
115
|
-
set label(value) {
|
|
116
|
-
if (this.hasAttribute("label") && !this.forceAutoFill)
|
|
117
|
-
value = this.getAttribute("label");
|
|
118
|
-
this._label = value;
|
|
119
|
-
this.requestUpdate();
|
|
120
|
-
}
|
|
121
|
-
willUpdate(changedProperties) {
|
|
122
|
-
this.hasSlotOrProps();
|
|
123
|
-
super.willUpdate(changedProperties);
|
|
124
|
-
}
|
|
125
|
-
hasSlotOrProps() {
|
|
126
|
-
this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false;
|
|
127
|
-
this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false;
|
|
128
|
-
this.hasSuffix = this.slotSuffixNodes?.length ? true : false;
|
|
129
|
-
this.hasPrefix = this.slotPrefixNodes?.length ? true : false;
|
|
130
|
-
}
|
|
131
|
-
validateFormElement() {
|
|
132
|
-
const select = this.shadowRoot?.querySelector("select");
|
|
133
|
-
if (!select || select.checkValidity())
|
|
134
|
-
return;
|
|
135
|
-
const formPublisher = this.getFormPublisher();
|
|
136
|
-
if (formPublisher) {
|
|
137
|
-
formPublisher.isFormValid = false;
|
|
138
|
-
}
|
|
139
|
-
select.reportValidity();
|
|
140
|
-
}
|
|
141
|
-
render() {
|
|
142
|
-
const slotClasses = {
|
|
143
|
-
"has-prefix": this.hasPrefix,
|
|
144
|
-
"has-suffix": this.hasSuffix,
|
|
145
|
-
};
|
|
146
|
-
//let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
|
|
147
|
-
return html `
|
|
148
|
-
<label for="form-element" class="${this.hasLabel ? "form-label" : "hidden"}"
|
|
149
|
-
>${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}<slot name="label" @slotchange=${this.hasSlotOrProps}></slot
|
|
150
|
-
></label>
|
|
151
|
-
|
|
152
|
-
<div class="form-control ${classMap(slotClasses)}">
|
|
153
|
-
<slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
154
|
-
<div class="form-select-wrapper">
|
|
155
|
-
<select
|
|
156
|
-
id="form-element"
|
|
157
|
-
@change=${this.handleChange}
|
|
158
|
-
@blur=${this.handleBlur}
|
|
159
|
-
?disabled=${this.disabled}
|
|
160
|
-
?required=${this.required}
|
|
161
|
-
?multiple=${this.multiple}
|
|
162
|
-
size=${ifDefined(this.selectSize)}
|
|
163
|
-
?autofocus=${this.autofocus}
|
|
164
|
-
.value="${this.value}"
|
|
165
|
-
class="form-element"
|
|
166
|
-
aria-label=${ifDefined(this.ariaLabel)}
|
|
167
|
-
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
168
|
-
>
|
|
169
|
-
${repeat(this.options, (option) => option[this.valueKey], (option) => {
|
|
170
|
-
const isSelected = this.value == option[this.valueKey] ? true : false;
|
|
171
|
-
return html `<option ?selected=${isSelected} value="${option[this.valueKey]}">${option[this.wordingKey]}</option>`;
|
|
172
|
-
})}
|
|
173
|
-
<slot></slot>
|
|
174
|
-
</select>
|
|
175
|
-
<sonic-icon class="select-chevron" name="nav-arrow-down" .size=${this.size}></sonic-icon>
|
|
176
|
-
</div>
|
|
177
|
-
<slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
178
|
-
</div>
|
|
179
|
-
|
|
180
|
-
<slot name="description" @slotchange=${this.hasSlotOrProps} class="${this.hasDescription ? "form-description" : "hidden"}"
|
|
181
|
-
>${this.description ? html `${unsafeHTML(this.description)}` : ""}</slot
|
|
182
|
-
>
|
|
183
|
-
`;
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
Select.styles = [
|
|
187
|
-
fontSize,
|
|
188
|
-
formControl,
|
|
189
|
-
label,
|
|
190
|
-
description,
|
|
191
|
-
css `
|
|
192
|
-
.form-element {
|
|
193
|
-
appearance: none;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
:host([disabled]) sonic-icon {
|
|
197
|
-
opacity: 0;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
@supports selector(:has(*)) {
|
|
201
|
-
:host(:not([disabled])) .form-element:not(:has(option:only-child)) {
|
|
202
|
-
padding-right: max(1.275em, calc(1.5 * var(--sc-input-px)));
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
/*Firefox etc.*/
|
|
206
|
-
@supports not selector(:has(*)) {
|
|
207
|
-
:host(:not([disabled])) .form-element {
|
|
208
|
-
padding-right: max(1.275em, calc(1.5 * var(--sc-input-px)));
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.form-select-wrapper {
|
|
213
|
-
position: relative;
|
|
214
|
-
width: 100%;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
sonic-icon {
|
|
218
|
-
position: absolute;
|
|
219
|
-
right: calc(0.8 * var(--sc-input-px));
|
|
220
|
-
top: 50%;
|
|
221
|
-
pointer-events: none;
|
|
222
|
-
transform: translateY(-50%);
|
|
223
|
-
color: var(--sc-input-c);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
option {
|
|
227
|
-
padding: 0.1rem var(--sc-input-px);
|
|
228
|
-
color: var(--sc-base-content);
|
|
229
|
-
background: var(--sc-base);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
select[multiple] option {
|
|
233
|
-
background: transparent;
|
|
234
|
-
padding: 0;
|
|
235
|
-
}
|
|
236
|
-
`,
|
|
237
|
-
];
|
|
238
|
-
__decorate([
|
|
239
|
-
property({ type: String })
|
|
240
|
-
], Select.prototype, "valueKey", void 0);
|
|
241
|
-
__decorate([
|
|
242
|
-
property({ type: String })
|
|
243
|
-
], Select.prototype, "wordingKey", void 0);
|
|
244
|
-
__decorate([
|
|
245
|
-
property({ type: Boolean })
|
|
246
|
-
], Select.prototype, "multiple", void 0);
|
|
247
|
-
__decorate([
|
|
248
|
-
property({ type: String, reflect: true })
|
|
249
|
-
], Select.prototype, "size", void 0);
|
|
250
|
-
__decorate([
|
|
251
|
-
property({ type: Number })
|
|
252
|
-
], Select.prototype, "selectSize", void 0);
|
|
253
|
-
__decorate([
|
|
254
|
-
property({ type: String, reflect: true })
|
|
255
|
-
], Select.prototype, "status", void 0);
|
|
256
|
-
__decorate([
|
|
257
|
-
property({ type: Array })
|
|
258
|
-
], Select.prototype, "options", null);
|
|
259
|
-
__decorate([
|
|
260
|
-
property({ reflect: true })
|
|
261
|
-
], Select.prototype, "value", null);
|
|
262
|
-
__decorate([
|
|
263
|
-
property({ type: Boolean })
|
|
264
|
-
], Select.prototype, "forceAutoFill", void 0);
|
|
265
|
-
__decorate([
|
|
266
|
-
property()
|
|
267
|
-
], Select.prototype, "description", null);
|
|
268
|
-
__decorate([
|
|
269
|
-
property()
|
|
270
|
-
], Select.prototype, "label", null);
|
|
271
|
-
__decorate([
|
|
272
|
-
queryAssignedNodes({ slot: "label", flatten: true })
|
|
273
|
-
], Select.prototype, "slotLabelNodes", void 0);
|
|
274
|
-
__decorate([
|
|
275
|
-
queryAssignedNodes({ slot: "description", flatten: true })
|
|
276
|
-
], Select.prototype, "slotDescriptionNodes", void 0);
|
|
277
|
-
__decorate([
|
|
278
|
-
queryAssignedNodes({ slot: "suffix", flatten: true })
|
|
279
|
-
], Select.prototype, "slotSuffixNodes", void 0);
|
|
280
|
-
__decorate([
|
|
281
|
-
queryAssignedNodes({ slot: "prefix", flatten: true })
|
|
282
|
-
], Select.prototype, "slotPrefixNodes", void 0);
|
|
283
|
-
__decorate([
|
|
284
|
-
state()
|
|
285
|
-
], Select.prototype, "hasDescription", void 0);
|
|
286
|
-
__decorate([
|
|
287
|
-
state()
|
|
288
|
-
], Select.prototype, "hasLabel", void 0);
|
|
289
|
-
__decorate([
|
|
290
|
-
state()
|
|
291
|
-
], Select.prototype, "hasSuffix", void 0);
|
|
292
|
-
__decorate([
|
|
293
|
-
state()
|
|
294
|
-
], Select.prototype, "hasPrefix", void 0);
|
|
295
|
-
Select = __decorate([
|
|
296
|
-
customElement(tagName)
|
|
297
|
-
], Select);
|
|
298
|
-
export { Select };
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { LitElement, PropertyValues } from "lit";
|
|
2
|
-
declare const Textarea_base: {
|
|
3
|
-
new (...args: any[]): {
|
|
4
|
-
validateFormElement(): void;
|
|
5
|
-
forceAutoFill: boolean;
|
|
6
|
-
_type: "number" | "search" | "time" | "file" | "button" | "url" | "color" | "hidden" | "image" | "text" | "reset" | "submit" | "email" | "tel" | "month" | "week" | "checkbox" | "radio" | "range" | "date" | "datetime-local" | "password";
|
|
7
|
-
type: "number" | "search" | "time" | "file" | "button" | "url" | "color" | "hidden" | "image" | "text" | "reset" | "submit" | "email" | "tel" | "month" | "week" | "checkbox" | "radio" | "range" | "date" | "datetime-local" | "password";
|
|
8
|
-
_description?: string | undefined;
|
|
9
|
-
description: string | undefined;
|
|
10
|
-
_label?: string | undefined;
|
|
11
|
-
label: string | undefined;
|
|
12
|
-
status: "error" | "default" | "success" | "warning" | "info";
|
|
13
|
-
tabindex?: number | undefined;
|
|
14
|
-
autocomplete?: "url" | "name" | "off" | "on" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday-day" | "bday-month" | "bday-year" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "new-password" | "one-time-code" | "organization" | "postal-code" | "street-address" | "transaction-amount" | "transaction-currency" | "username" | "email" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "language" | "nickname" | "organization-title" | "cc-additional-name" | "bday" | "sex" | "impp" | "photo" | undefined;
|
|
15
|
-
getFormPublisher(): any;
|
|
16
|
-
updateDataValue(): void;
|
|
17
|
-
handleChange(e?: Event | undefined): void;
|
|
18
|
-
handleBlur(e?: Event | undefined): void;
|
|
19
|
-
getValueForFormPublisher(): string | object | string[] | null | undefined;
|
|
20
|
-
setValueFromPublisher(value: string | object | string[] | null | undefined): void;
|
|
21
|
-
focus?: (() => void) | undefined;
|
|
22
|
-
shadowRoot?: ShadowRoot | undefined;
|
|
23
|
-
error: boolean;
|
|
24
|
-
autofocus: boolean;
|
|
25
|
-
required: boolean;
|
|
26
|
-
disabled: true | null;
|
|
27
|
-
formDataProvider: string;
|
|
28
|
-
ariaLabelledby?: string | undefined;
|
|
29
|
-
ariaLabel?: string | undefined;
|
|
30
|
-
_value: string | object | string[] | null | undefined;
|
|
31
|
-
value: string | object | string[] | null | undefined;
|
|
32
|
-
_name: string;
|
|
33
|
-
name: string;
|
|
34
|
-
props: import("../../../../_types/types").CoreJSType;
|
|
35
|
-
propertyMap: object;
|
|
36
|
-
isConnected: boolean;
|
|
37
|
-
children: HTMLCollection;
|
|
38
|
-
appendChild(node: Node): Node;
|
|
39
|
-
getAncestorAttributeValue(attributeName: string): string;
|
|
40
|
-
hasAncestorAttribute(attributeName: string): boolean;
|
|
41
|
-
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
42
|
-
publisher: any;
|
|
43
|
-
dataProvider: string | null;
|
|
44
|
-
noShadowDom: string | null;
|
|
45
|
-
debug: HTMLElement | null;
|
|
46
|
-
defferedDebug: boolean | null;
|
|
47
|
-
displayContents: boolean;
|
|
48
|
-
dispatchEvent(event: Event): void;
|
|
49
|
-
setAttribute(name: string, value: string): void;
|
|
50
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
51
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
52
|
-
removeAttribute(name: string): void;
|
|
53
|
-
initPublisher(): void;
|
|
54
|
-
getApiConfiguration(): import("../../../../utils/api").APIConfiguration;
|
|
55
|
-
connectedCallback(): void;
|
|
56
|
-
requestUpdate(): void;
|
|
57
|
-
getAttribute(name: string): string;
|
|
58
|
-
hasAttribute(attributeName: string): boolean;
|
|
59
|
-
disconnectedCallback(): void;
|
|
60
|
-
getBoundingClientRect(): DOMRect;
|
|
61
|
-
};
|
|
62
|
-
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/FormElement").FormElementInterface) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../../_types/types").CoreJSType>) & typeof LitElement;
|
|
63
|
-
export declare class Textarea extends Textarea_base {
|
|
64
|
-
static styles: import("lit").CSSResult[];
|
|
65
|
-
size: "" | "xs" | "sm" | "lg";
|
|
66
|
-
rows?: number;
|
|
67
|
-
cols?: number;
|
|
68
|
-
maxlength?: number;
|
|
69
|
-
minlength?: number;
|
|
70
|
-
wrap?: "hard" | "soft";
|
|
71
|
-
readonly: boolean;
|
|
72
|
-
placeholder?: string;
|
|
73
|
-
resize?: "none" | "both" | "horizontal" | "vertical" | "block" | "inline";
|
|
74
|
-
slotLabelNodes: Array<Node>;
|
|
75
|
-
slotDescriptionNodes: Array<Node>;
|
|
76
|
-
hasDescription: boolean;
|
|
77
|
-
hasLabel: boolean;
|
|
78
|
-
connectedCallback(): void;
|
|
79
|
-
willUpdate(changedProperties: PropertyValues): void;
|
|
80
|
-
hasSlotOrProps(): void;
|
|
81
|
-
validateFormElement(): void;
|
|
82
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
83
|
-
}
|
|
84
|
-
export {};
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { css, html, LitElement } from "lit";
|
|
8
|
-
import { customElement, property, queryAssignedNodes, state } from "lit/decorators.js";
|
|
9
|
-
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
|
-
import { description, formControl, label } from "@supersoniks/concorde/core/components/ui/form/css/form-control";
|
|
11
|
-
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
12
|
-
import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
13
|
-
import FormInput from "@supersoniks/concorde/core/mixins/FormInput";
|
|
14
|
-
import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
|
|
15
|
-
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
16
|
-
import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
17
|
-
import { styleMap } from "lit/directives/style-map.js";
|
|
18
|
-
const tagName = "sonic-textarea";
|
|
19
|
-
let Textarea = class Textarea extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
20
|
-
constructor() {
|
|
21
|
-
super(...arguments);
|
|
22
|
-
// @property({ type: String })
|
|
23
|
-
// type: "" | "primary" | "warning" | "danger" | "success" | "info" = "";
|
|
24
|
-
// @property({ type: String }) variant: "" | "ghost" | "outline" = "";
|
|
25
|
-
this.size = "";
|
|
26
|
-
this.readonly = false;
|
|
27
|
-
this.hasDescription = false;
|
|
28
|
-
this.hasLabel = false;
|
|
29
|
-
}
|
|
30
|
-
connectedCallback() {
|
|
31
|
-
super.connectedCallback();
|
|
32
|
-
this.hasSlotOrProps();
|
|
33
|
-
}
|
|
34
|
-
willUpdate(changedProperties) {
|
|
35
|
-
this.hasSlotOrProps();
|
|
36
|
-
super.willUpdate(changedProperties);
|
|
37
|
-
}
|
|
38
|
-
hasSlotOrProps() {
|
|
39
|
-
this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false;
|
|
40
|
-
this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false;
|
|
41
|
-
}
|
|
42
|
-
validateFormElement() {
|
|
43
|
-
const textarea = this.shadowRoot?.querySelector("textarea");
|
|
44
|
-
if (!textarea || textarea.checkValidity())
|
|
45
|
-
return;
|
|
46
|
-
const formPublisher = this.getFormPublisher();
|
|
47
|
-
if (formPublisher) {
|
|
48
|
-
formPublisher.isFormValid = false;
|
|
49
|
-
}
|
|
50
|
-
textarea.reportValidity();
|
|
51
|
-
}
|
|
52
|
-
render() {
|
|
53
|
-
const textAreaStyle = {
|
|
54
|
-
resize: this.resize,
|
|
55
|
-
};
|
|
56
|
-
// let labelStarSuffix = this.label && this.required && this.label.indexOf("*") == -1 ? " *" : "";
|
|
57
|
-
return html `
|
|
58
|
-
<label for="${this.id || "form-element"}" class="${this.hasLabel ? "form-label" : "hidden"}"
|
|
59
|
-
>${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}<slot name="label" @slotchange=${this.hasSlotOrProps}></slot
|
|
60
|
-
></label>
|
|
61
|
-
|
|
62
|
-
<div class="form-control">
|
|
63
|
-
<textarea
|
|
64
|
-
id="${this.id || "form-element"}"
|
|
65
|
-
@input=${this.handleChange}
|
|
66
|
-
@blur=${this.handleBlur}
|
|
67
|
-
disabled=${ifDefined(this.disabled)}
|
|
68
|
-
?required=${this.required}
|
|
69
|
-
?autofocus=${this.autofocus}
|
|
70
|
-
rows=${ifDefined(this.rows)}
|
|
71
|
-
cols=${ifDefined(this.cols)}
|
|
72
|
-
maxlength=${ifDefined(this.maxlength)}
|
|
73
|
-
minlength=${ifDefined(this.minlength)}
|
|
74
|
-
?readonly=${this.readonly}
|
|
75
|
-
spellcheck=${ifDefined(this.spellcheck)}
|
|
76
|
-
autocomplete=${ifDefined(this.autocomplete)}
|
|
77
|
-
tabindex=${ifDefined(this.tabindex)}
|
|
78
|
-
wrap=${ifDefined(this.wrap)}
|
|
79
|
-
placeholder="${this.placeholder}"
|
|
80
|
-
class="form-element textarea custom-scroll"
|
|
81
|
-
aria-label=${ifDefined(this.ariaLabel)}
|
|
82
|
-
aria-labelledby=${ifDefined(this.ariaLabelledby)}
|
|
83
|
-
style=${styleMap(textAreaStyle)}
|
|
84
|
-
>
|
|
85
|
-
${this.value}</textarea
|
|
86
|
-
>
|
|
87
|
-
</div>
|
|
88
|
-
|
|
89
|
-
<slot name="description" @slotchange=${this.hasSlotOrProps} class="${this.hasDescription ? "form-description" : "hidden"}"
|
|
90
|
-
>${this.description ? html `${unsafeHTML(this.description)}` : ""}</slot
|
|
91
|
-
>
|
|
92
|
-
`;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
Textarea.styles = [
|
|
96
|
-
fontSize,
|
|
97
|
-
formControl,
|
|
98
|
-
label,
|
|
99
|
-
description,
|
|
100
|
-
customScroll,
|
|
101
|
-
css `
|
|
102
|
-
textarea {
|
|
103
|
-
overflow-y: auto !important;
|
|
104
|
-
font-size: inherit;
|
|
105
|
-
}
|
|
106
|
-
`,
|
|
107
|
-
];
|
|
108
|
-
__decorate([
|
|
109
|
-
property({ type: String })
|
|
110
|
-
], Textarea.prototype, "size", void 0);
|
|
111
|
-
__decorate([
|
|
112
|
-
property({ type: Number })
|
|
113
|
-
], Textarea.prototype, "rows", void 0);
|
|
114
|
-
__decorate([
|
|
115
|
-
property({ type: Number })
|
|
116
|
-
], Textarea.prototype, "cols", void 0);
|
|
117
|
-
__decorate([
|
|
118
|
-
property({ type: Number })
|
|
119
|
-
], Textarea.prototype, "maxlength", void 0);
|
|
120
|
-
__decorate([
|
|
121
|
-
property({ type: Number })
|
|
122
|
-
], Textarea.prototype, "minlength", void 0);
|
|
123
|
-
__decorate([
|
|
124
|
-
property({ type: String })
|
|
125
|
-
], Textarea.prototype, "wrap", void 0);
|
|
126
|
-
__decorate([
|
|
127
|
-
property({ type: Boolean })
|
|
128
|
-
], Textarea.prototype, "readonly", void 0);
|
|
129
|
-
__decorate([
|
|
130
|
-
property({ type: String })
|
|
131
|
-
], Textarea.prototype, "placeholder", void 0);
|
|
132
|
-
__decorate([
|
|
133
|
-
property({ type: String })
|
|
134
|
-
], Textarea.prototype, "resize", void 0);
|
|
135
|
-
__decorate([
|
|
136
|
-
queryAssignedNodes({ slot: "label", flatten: true })
|
|
137
|
-
], Textarea.prototype, "slotLabelNodes", void 0);
|
|
138
|
-
__decorate([
|
|
139
|
-
queryAssignedNodes({ slot: "description", flatten: true })
|
|
140
|
-
], Textarea.prototype, "slotDescriptionNodes", void 0);
|
|
141
|
-
__decorate([
|
|
142
|
-
state()
|
|
143
|
-
], Textarea.prototype, "hasDescription", void 0);
|
|
144
|
-
__decorate([
|
|
145
|
-
state()
|
|
146
|
-
], Textarea.prototype, "hasLabel", void 0);
|
|
147
|
-
Textarea = __decorate([
|
|
148
|
-
customElement(tagName)
|
|
149
|
-
], Textarea);
|
|
150
|
-
export { Textarea };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LitElement, PropertyValues } from "lit";
|
|
2
|
-
export declare class Group extends LitElement {
|
|
3
|
-
alignItems: string;
|
|
4
|
-
label?: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
slotLabelNodes: Array<Node>;
|
|
7
|
-
slotDescriptionNodes: Array<Node>;
|
|
8
|
-
hasDescription: boolean;
|
|
9
|
-
hasLabel: boolean;
|
|
10
|
-
static styles: import("lit").CSSResult[];
|
|
11
|
-
updated(): void;
|
|
12
|
-
connectedCallback(): void;
|
|
13
|
-
willUpdate(changedProperties: PropertyValues): void;
|
|
14
|
-
hasSlotOrProps(): void;
|
|
15
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { html, LitElement, css } from "lit";
|
|
8
|
-
import { styleMap } from "lit/directives/style-map.js";
|
|
9
|
-
import { customElement, property, state, queryAssignedNodes } from "lit/decorators.js";
|
|
10
|
-
import { label, description } from "@supersoniks/concorde/core/components/ui/form/css/form-control";
|
|
11
|
-
import { fontSize } from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
12
|
-
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
13
|
-
const tagName = "sonic-group";
|
|
14
|
-
let Group = class Group extends LitElement {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
this.alignItems = "center";
|
|
18
|
-
this.hasDescription = false;
|
|
19
|
-
this.hasLabel = false;
|
|
20
|
-
}
|
|
21
|
-
updated() {
|
|
22
|
-
const children = this.querySelectorAll("sonic-input, sonic-button, sonic-select");
|
|
23
|
-
const nbChildren = children.length;
|
|
24
|
-
if (nbChildren > 1) {
|
|
25
|
-
children.forEach((item, index) => {
|
|
26
|
-
const htmlElement = item;
|
|
27
|
-
if (index === 0) {
|
|
28
|
-
htmlElement.style.setProperty("--sc-item-rounded-tr", "0");
|
|
29
|
-
htmlElement.style.setProperty("--sc-item-rounded-br", "0");
|
|
30
|
-
}
|
|
31
|
-
else if (index === nbChildren - 1) {
|
|
32
|
-
htmlElement.style.setProperty("--sc-item-rounded-tl", "0");
|
|
33
|
-
htmlElement.style.setProperty("--sc-item-rounded-bl", "0");
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
htmlElement.style.setProperty("--sc-item-rounded-tr", "0");
|
|
37
|
-
htmlElement.style.setProperty("--sc-item-rounded-br", "0");
|
|
38
|
-
htmlElement.style.setProperty("--sc-item-rounded-tl", "0");
|
|
39
|
-
htmlElement.style.setProperty("--sc-item-rounded-bl", "0");
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
connectedCallback() {
|
|
45
|
-
super.connectedCallback();
|
|
46
|
-
this.hasSlotOrProps();
|
|
47
|
-
}
|
|
48
|
-
willUpdate(changedProperties) {
|
|
49
|
-
this.hasSlotOrProps();
|
|
50
|
-
super.willUpdate(changedProperties);
|
|
51
|
-
}
|
|
52
|
-
hasSlotOrProps() {
|
|
53
|
-
this.hasLabel = this.label || this.slotLabelNodes?.length ? true : false;
|
|
54
|
-
this.hasDescription = this.description || this.slotDescriptionNodes?.length ? true : false;
|
|
55
|
-
}
|
|
56
|
-
render() {
|
|
57
|
-
const slotStyle = {
|
|
58
|
-
alignItems: this.alignItems,
|
|
59
|
-
};
|
|
60
|
-
return html `<span class="${this.hasLabel ? "form-label" : "hidden"}"
|
|
61
|
-
>${this.label ? unsafeHTML(this.label /*+ labelStarSuffix*/) : ""}<slot name="label" @slotchange=${this.hasSlotOrProps}></slot
|
|
62
|
-
></span>
|
|
63
|
-
<slot class="main-slot" style=${styleMap(slotStyle)}></slot>
|
|
64
|
-
<slot name="description" @slotchange=${this.hasSlotOrProps} class="${this.hasDescription ? "form-description" : "hidden"}">
|
|
65
|
-
${this.description ? html `${unsafeHTML(this.description)}` : ""}
|
|
66
|
-
</slot>`;
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
Group.styles = [
|
|
70
|
-
fontSize,
|
|
71
|
-
label,
|
|
72
|
-
description,
|
|
73
|
-
css `
|
|
74
|
-
:host {
|
|
75
|
-
display: inline-block;
|
|
76
|
-
vertical-align: middle;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.main-slot {
|
|
80
|
-
width: 100%;
|
|
81
|
-
display: flex;
|
|
82
|
-
}
|
|
83
|
-
.hidden {
|
|
84
|
-
display: none;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
::slotted(sonic-button),
|
|
88
|
-
::slotted(sonic-input),
|
|
89
|
-
::slotted(sonic-select) {
|
|
90
|
-
flex-grow: 1;
|
|
91
|
-
}
|
|
92
|
-
`,
|
|
93
|
-
];
|
|
94
|
-
__decorate([
|
|
95
|
-
property({ type: String })
|
|
96
|
-
], Group.prototype, "alignItems", void 0);
|
|
97
|
-
__decorate([
|
|
98
|
-
property({ type: String })
|
|
99
|
-
], Group.prototype, "label", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
property({ type: String })
|
|
102
|
-
], Group.prototype, "description", void 0);
|
|
103
|
-
__decorate([
|
|
104
|
-
queryAssignedNodes({ slot: "label", flatten: true })
|
|
105
|
-
], Group.prototype, "slotLabelNodes", void 0);
|
|
106
|
-
__decorate([
|
|
107
|
-
queryAssignedNodes({ slot: "description", flatten: true })
|
|
108
|
-
], Group.prototype, "slotDescriptionNodes", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
state()
|
|
111
|
-
], Group.prototype, "hasDescription", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
state()
|
|
114
|
-
], Group.prototype, "hasLabel", void 0);
|
|
115
|
-
Group = __decorate([
|
|
116
|
-
customElement(tagName)
|
|
117
|
-
], Group);
|
|
118
|
-
export { Group };
|