@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,130 @@
|
|
|
1
|
+
# Input-autocomplete
|
|
2
|
+
|
|
3
|
+
The input-autocomplete component brings input and queue together in order to create a suggest behavior. This is why this component is partially configured as a form [input](#core/components/ui/form/input/input.md/input) and as a [queue](#core/components/functional/queue/queue.md/queue).
|
|
4
|
+
|
|
5
|
+
Please note that only basic text input params and methods are implemented at this time. You should also be sure to understand the behavior of a [queue](#core/components/functional/queue/queue.md/queue) in order to take full advantage of the input-autocomplete component.
|
|
6
|
+
|
|
7
|
+
Here are some of the features of the input-autocomplete component:
|
|
8
|
+
|
|
9
|
+
* It provides a suggest behavior, where the user can type a few letters and the component will suggest possible matches.
|
|
10
|
+
* It can be used with a variety of data providers, such as an API.
|
|
11
|
+
* It is fully customizable, so you can change the look and feel of the component to match your needs.
|
|
12
|
+
|
|
13
|
+
If you are looking for a component to provide a suggest behavior, the input-autocomplete component is a good option.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Simple Example
|
|
18
|
+
|
|
19
|
+
In this example, the input will use its name as the search parameter when calling the service responsible for autocompletion.
|
|
20
|
+
|
|
21
|
+
The template is used to render the list items of results.
|
|
22
|
+
The list items are responsible for making a selection.
|
|
23
|
+
|
|
24
|
+
This time, we added buttons with the same name as the input while keeping the same data provider.
|
|
25
|
+
The result is that when you select an item, the input takes the value of the selected item, completing the classic suggest behavior.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
<sonic-code>
|
|
29
|
+
<template>
|
|
30
|
+
<sonic-input-autocomplete
|
|
31
|
+
class="w-64"
|
|
32
|
+
label="A french city name"
|
|
33
|
+
formDataProvider="autoComplete-example-base"
|
|
34
|
+
name="nom"
|
|
35
|
+
placeholder="Paris, Lyon, Tours, ..."
|
|
36
|
+
serviceurl="https://geo.api.gouv.fr"
|
|
37
|
+
dataproviderexpression="communes?limit=5&boost=population"
|
|
38
|
+
>
|
|
39
|
+
<template>
|
|
40
|
+
<sonic-menu-item debug radio name="nom" data-bind ::inner-html="$nom" ::value="$nom"></sonic-menu-item>
|
|
41
|
+
</template>
|
|
42
|
+
</sonic-input-autocomplete>
|
|
43
|
+
</template>
|
|
44
|
+
</sonic-code>
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Value different from search parameter
|
|
48
|
+
|
|
49
|
+
In this example, the search parameter is separated from the name of the input. This means that the input will use the name "nom" as the search parameter, but the form data provider will be filled with the data named "siren" from the selected list item.
|
|
50
|
+
|
|
51
|
+
To do this, we need to use the `searchParam` attribute on the input element. This attribute specifies the name of the search parameter that will be used.
|
|
52
|
+
|
|
53
|
+
We also need to use the `name` and `value` attribute on the list items. This attribute specifies the value of the data provider that will be used for the selected list item.
|
|
54
|
+
|
|
55
|
+
By using these attributes, we can separate the search parameter from the name of the input and still fill the form data provider with the data from the selected list item.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
<sonic-code>
|
|
59
|
+
<template>
|
|
60
|
+
<sonic-input-autocomplete
|
|
61
|
+
class="w-64"
|
|
62
|
+
label="A french city name"
|
|
63
|
+
formDataProvider="autoComplete-example"
|
|
64
|
+
name="siren"
|
|
65
|
+
value="212703771"
|
|
66
|
+
placeholder="Paris, Lyon, Tours, ..."
|
|
67
|
+
serviceurl="https://geo.api.gouv.fr"
|
|
68
|
+
dataproviderexpression="communes?limit=5&boost=population"
|
|
69
|
+
searchParameter="nom"
|
|
70
|
+
>
|
|
71
|
+
<template>
|
|
72
|
+
<sonic-menu-item debug radio name="siren" data-bind ::inner-html="$nom" ::value="$siren"></sonic-menu-item>
|
|
73
|
+
</template>
|
|
74
|
+
</sonic-input-autocomplete>
|
|
75
|
+
</template>
|
|
76
|
+
</sonic-code>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## Select autocomplete / value different from search parameter
|
|
80
|
+
|
|
81
|
+
This example is the same as the previous one, except that the `select` attribute is used. This attribute changes the look and feel of the component slightly.
|
|
82
|
+
|
|
83
|
+
Now the text is less free because, you must select either something from the list given by the service, or nothing else.
|
|
84
|
+
|
|
85
|
+
The following code shows how to use the `select` attribute in an autocomplete input:
|
|
86
|
+
|
|
87
|
+
<sonic-code>
|
|
88
|
+
<template>
|
|
89
|
+
<sonic-input-autocomplete
|
|
90
|
+
select
|
|
91
|
+
class="w-64"
|
|
92
|
+
label="A french city name"
|
|
93
|
+
formDataProvider="autoComplete-example2"
|
|
94
|
+
name="siren"
|
|
95
|
+
value="212703771"
|
|
96
|
+
placeholder="Paris, Lyon, Tours, ..."
|
|
97
|
+
serviceurl="https://geo.api.gouv.fr"
|
|
98
|
+
dataproviderexpression="communes?limit=5&boost=population"
|
|
99
|
+
searchParameter="nom"
|
|
100
|
+
>
|
|
101
|
+
<template>
|
|
102
|
+
<sonic-menu-item debug radio name="siren" data-bind ::inner-html="$nom" ::value="$siren"></sonic-menu-item>
|
|
103
|
+
</template>
|
|
104
|
+
</sonic-input-autocomplete>
|
|
105
|
+
</template>
|
|
106
|
+
</sonic-code>
|
|
107
|
+
|
|
108
|
+
## keyboard navigation
|
|
109
|
+
|
|
110
|
+
At the moment you can enable keyboard up/down by adding an attribut "data-keyboard-nav" on the component and its listItems
|
|
111
|
+
|
|
112
|
+
<sonic-code>
|
|
113
|
+
<template>
|
|
114
|
+
<sonic-input-autocomplete
|
|
115
|
+
class="w-64"
|
|
116
|
+
label="A french city name"
|
|
117
|
+
formDataProvider="autoComplete-example-keyboard"
|
|
118
|
+
name="nom"
|
|
119
|
+
data-keyboard-nav="nav-autocomplete"
|
|
120
|
+
placeholder="Paris, Lyon, Tours, ..."
|
|
121
|
+
serviceurl="https://geo.api.gouv.fr"
|
|
122
|
+
dataproviderexpression="communes?limit=60&boost=population"
|
|
123
|
+
>
|
|
124
|
+
<template>
|
|
125
|
+
<sonic-menu-item debug radio name="nom" data-keyboard-nav="nav-autocomplete" data-bind ::inner-html="$nom" ::value="$nom"></sonic-menu-item>
|
|
126
|
+
</template>
|
|
127
|
+
</sonic-input-autocomplete>
|
|
128
|
+
</template>
|
|
129
|
+
</sonic-code>
|
|
130
|
+
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import {html, LitElement, css, nothing} from "lit";
|
|
2
|
+
import {customElement, property, queryAssignedNodes, state} from "lit/decorators.js";
|
|
3
|
+
import {FormInput, FormElement, Subscriber, TemplatesContainer} from "@supersoniks/concorde/mixins";
|
|
4
|
+
import "@supersoniks/concorde/core/components/ui/form/input/input";
|
|
5
|
+
import "@supersoniks/concorde/core/components/ui/pop/pop";
|
|
6
|
+
import "@supersoniks/concorde/core/components/functional/queue/queue";
|
|
7
|
+
import "@supersoniks/concorde/core/components/ui/menu/menu-item";
|
|
8
|
+
import {ifDefined} from "lit/directives/if-defined.js";
|
|
9
|
+
import {PublisherManager} from "@supersoniks/concorde/utils";
|
|
10
|
+
import {PublisherProxy} from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
11
|
+
import {Size} from "../../_css/size";
|
|
12
|
+
import {Input} from "@supersoniks/concorde/core/components/ui/form/input/input";
|
|
13
|
+
import {customScroll} from "@supersoniks/concorde/core/components/ui/_css/scroll";
|
|
14
|
+
import {ResizeController} from "@lit-labs/observers/resize-controller.js";
|
|
15
|
+
|
|
16
|
+
type ListItem = Record<string, string>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Input avec autocomplete. Propose des valeurs à partir d'un sonic-queue.
|
|
20
|
+
* L'input permet de filtrer les choix de valeurs dans le sonic-pop.
|
|
21
|
+
* La valeur de cet input est ensuite retransmit au premier via un dataProvider.
|
|
22
|
+
*/
|
|
23
|
+
@customElement("sonic-input-autocomplete")
|
|
24
|
+
export class InputAutocomplete extends TemplatesContainer(FormInput(FormElement(Subscriber(LitElement)))) {
|
|
25
|
+
static styles = [
|
|
26
|
+
customScroll,
|
|
27
|
+
css`
|
|
28
|
+
:host {
|
|
29
|
+
display: block;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
sonic-menu {
|
|
33
|
+
display: block;
|
|
34
|
+
max-height: clamp(12rem, 20vh, 20rem);
|
|
35
|
+
min-width: 14rem;
|
|
36
|
+
width: 100%;
|
|
37
|
+
}
|
|
38
|
+
`,
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Possibles mutualisation avec text
|
|
43
|
+
*/
|
|
44
|
+
@property({type: String}) size: Size = "md";
|
|
45
|
+
@property({type: String}) placeholder = "";
|
|
46
|
+
@property() filteredFields = "";
|
|
47
|
+
@property({type: Boolean}) readonly: boolean | null = null;
|
|
48
|
+
|
|
49
|
+
@property({type: String}) dataProviderExpression = "";
|
|
50
|
+
@property({type: Boolean}) select?: boolean;
|
|
51
|
+
@property({type: String}) key = "";
|
|
52
|
+
/** The parameter name to use in dataProviderExpression route */
|
|
53
|
+
@property({type: String}) searchParameter = "";
|
|
54
|
+
/** The property name to search in the dataProviderExpression result, use "_self" if result is a string list */
|
|
55
|
+
@property({type: String}) propertyName = "";
|
|
56
|
+
|
|
57
|
+
@queryAssignedNodes({slot: "prefix", flatten: true})
|
|
58
|
+
slotInputPrefixNodes!: Array<Node>;
|
|
59
|
+
|
|
60
|
+
@state() hasInputPrefix = false;
|
|
61
|
+
_resizeController = new ResizeController(this, {});
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Les dataProviders
|
|
65
|
+
*/
|
|
66
|
+
private searchDataProvider = "";
|
|
67
|
+
private initSearchDataProvider = "";
|
|
68
|
+
private queueDataProvider = "";
|
|
69
|
+
private initQueueDataProvider = "";
|
|
70
|
+
private lastValidSearch: ListItem | string = "";
|
|
71
|
+
private searchPublisher?: PublisherProxy;
|
|
72
|
+
private countPublisher?: PublisherProxy;
|
|
73
|
+
private initCountPublisher?: PublisherProxy;
|
|
74
|
+
private formValuePublisher?: PublisherProxy;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Les fonctions de gestion
|
|
78
|
+
*/
|
|
79
|
+
hasSlotOrProps() {
|
|
80
|
+
this.hasInputPrefix = !!this.slotInputPrefixNodes?.length;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Run when the formDataProvider's field is updated
|
|
85
|
+
*
|
|
86
|
+
* @param value
|
|
87
|
+
*/
|
|
88
|
+
private updateSearchParameter = (value: string) => {
|
|
89
|
+
if (value == "") {
|
|
90
|
+
this.lastValidSearch = "";
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const found = this.queryQueueListItem(this.queueDataProvider, this.findSelection, this.setSearchFromSelection);
|
|
94
|
+
// Si la liste de this.queueDataProvider est bien initialisée, mais qu'aucun item ne correspond à la recherche
|
|
95
|
+
// On affiche quand même la valeur dans le champ de recherche, car il provient directement du formDataProvider
|
|
96
|
+
if (found === false) {
|
|
97
|
+
this.lastValidSearch = value;
|
|
98
|
+
this.searchPublisher?.set(this.lastValidSearch);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
private initSearchParameter = () => {
|
|
103
|
+
this.queryQueueListItem(this.initQueueDataProvider, this.findSelection, this.setSearchFromSelection);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
private selectListItem = (listItem: ListItem) => {
|
|
107
|
+
const value = this.propertyName === "_self" ? listItem : listItem[this.propertyName || this.name];
|
|
108
|
+
this.formValuePublisher?.set(value);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
private findSearchedItem = (listItem: ListItem) => {
|
|
112
|
+
const value = this.propertyName === "_self" ? listItem : listItem[this.propertyName || this.searchParameter || this.name];
|
|
113
|
+
return value == this.searchPublisher?.get();
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
private findSelection = (listItem: ListItem) => {
|
|
117
|
+
const value = this.propertyName === "_self" ? listItem : listItem[this.propertyName || this.name];
|
|
118
|
+
return value == this.value;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
private setSearchFromSelection = (listItem: ListItem) => {
|
|
122
|
+
this.lastValidSearch = this.propertyName === "_self" ? listItem : listItem[this.propertyName || this.searchParameter || this.name];
|
|
123
|
+
this.searchPublisher?.set(this.lastValidSearch);
|
|
124
|
+
};
|
|
125
|
+
private updateActiveSelection = () => {
|
|
126
|
+
this.queryQueueListItem(this.queueDataProvider, this.findSearchedItem, this.selectListItem);
|
|
127
|
+
if (!this.select && this.lastValidSearch && this.lastValidSearch != this.searchPublisher?.get() && this.formValuePublisher?.get()) {
|
|
128
|
+
this.formValuePublisher?.set("");
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
connectedCallback() {
|
|
133
|
+
super.connectedCallback();
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Nom de la valeur de recherche
|
|
137
|
+
* Si non défini, on utilise name
|
|
138
|
+
**/
|
|
139
|
+
const searchParameter = this.searchParameter || this.name;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Nommage des différents dataProviders utilisés
|
|
143
|
+
*/
|
|
144
|
+
const formDataProvider = this.getAncestorAttributeValue("formDataProvider");
|
|
145
|
+
// Create unique provider name with formProvider name + input name
|
|
146
|
+
const dpPrefix = formDataProvider + "__" + this.name + "__autocomplete";
|
|
147
|
+
this.initSearchDataProvider = `${dpPrefix}_init_search__`;
|
|
148
|
+
this.initQueueDataProvider = `${dpPrefix}_init_queue__`;
|
|
149
|
+
this.searchDataProvider = `${dpPrefix}_search__`;
|
|
150
|
+
this.queueDataProvider = `${dpPrefix}_queue__`;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Les publishers utilisés plusieurs fois dans la classe son miss en propriétés privées de la classe
|
|
154
|
+
*/
|
|
155
|
+
const getPublisher = PublisherManager.get;
|
|
156
|
+
this.searchPublisher = getPublisher(this.searchDataProvider)[searchParameter];
|
|
157
|
+
this.formValuePublisher = getPublisher(formDataProvider)[this.name];
|
|
158
|
+
this.countPublisher = getPublisher(this.queueDataProvider).resultCount;
|
|
159
|
+
this.initCountPublisher = getPublisher(this.initQueueDataProvider).resultCount;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Si une valeur est fourrnie a l'initialisation, un queue spécifique appelle le service avec le name founi en paramètre
|
|
163
|
+
* Pour récupérer la valeur de searchParameter correspondante et renseigner l'input
|
|
164
|
+
**/
|
|
165
|
+
if (this.value) {
|
|
166
|
+
PublisherManager.get(this.initSearchDataProvider)[this.name] = this.value;
|
|
167
|
+
}
|
|
168
|
+
this.initCountPublisher?.onAssign(this.initSearchParameter);
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Lorsque la sélection change, on met à jour la valeur de recherche
|
|
172
|
+
*/
|
|
173
|
+
this.formValuePublisher?.onAssign(this.updateSearchParameter);
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Lorsque La valeur de recherche change, que le composant n'est pas en mode select
|
|
177
|
+
* et qu'elle est différente de la derniere recherche valide on désactive la selection
|
|
178
|
+
*/
|
|
179
|
+
this.countPublisher?.onAssign(this.updateActiveSelection);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
disconnectedCallback() {
|
|
183
|
+
super.disconnectedCallback();
|
|
184
|
+
this.initCountPublisher?.offAssign(this.initSearchParameter);
|
|
185
|
+
this.formValuePublisher?.offAssign(this.updateSearchParameter);
|
|
186
|
+
this.countPublisher?.offAssign(this.updateActiveSelection);
|
|
187
|
+
const getPublisher = PublisherManager.get;
|
|
188
|
+
getPublisher(this.initSearchDataProvider).delete();
|
|
189
|
+
getPublisher(this.initQueueDataProvider).delete();
|
|
190
|
+
getPublisher(this.searchDataProvider).delete();
|
|
191
|
+
getPublisher(this.queueDataProvider).delete();
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @param queueDataProvider
|
|
196
|
+
* @param itemFinder
|
|
197
|
+
* @param itemMutator
|
|
198
|
+
*
|
|
199
|
+
* @return bool|undefined True if item found, false otherwise, undefined if result is not a list
|
|
200
|
+
*/
|
|
201
|
+
queryQueueListItem(queueDataProvider: string, itemFinder: (listItem: ListItem) => boolean, itemMutator: (listItem: ListItem) => void) {
|
|
202
|
+
const queuePublisher = PublisherManager.get(queueDataProvider);
|
|
203
|
+
let listItem: ListItem | undefined;
|
|
204
|
+
const listsDescriptors = queuePublisher.get();
|
|
205
|
+
if (!Array.isArray(listsDescriptors)) return;
|
|
206
|
+
for (const listDescriptor of listsDescriptors) {
|
|
207
|
+
const list = PublisherManager.get(listDescriptor.dataProvider).get();
|
|
208
|
+
if (!Array.isArray(list)) continue;
|
|
209
|
+
listItem = list.find(itemFinder);
|
|
210
|
+
if (listItem) {
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (listItem) {
|
|
215
|
+
itemMutator(listItem);
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
setSelectionRange(start: number, end: number) {
|
|
222
|
+
(this.querySelector("sonic-input") as Input)?.setSelectionRange(start, end);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
handleHide(): void {
|
|
226
|
+
if (!this.select) return;
|
|
227
|
+
if (this.searchPublisher?.get() == "") {
|
|
228
|
+
this.lastValidSearch = "";
|
|
229
|
+
this.formValuePublisher?.set("");
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
this.searchPublisher?.set(this.lastValidSearch);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
render() {
|
|
236
|
+
return html`
|
|
237
|
+
<sonic-pop noToggle style="display:block;" @hide=${this.handleHide}>
|
|
238
|
+
<sonic-input
|
|
239
|
+
dataProvider="${this.initSearchDataProvider + Math.random()}"
|
|
240
|
+
formDataProvider="${this.searchDataProvider}"
|
|
241
|
+
type="search"
|
|
242
|
+
data-keyboard-nav="${this.getAttribute("data-keyboard-nav") || ""}"
|
|
243
|
+
label="${ifDefined(this.label)}"
|
|
244
|
+
description="${ifDefined(this.description)}"
|
|
245
|
+
name="${ifDefined(this.searchParameter || this.name)}"
|
|
246
|
+
placeholder="${ifDefined(this.placeholder)}"
|
|
247
|
+
?readonly="${this.readonly}"
|
|
248
|
+
autocomplete="off"
|
|
249
|
+
clearable
|
|
250
|
+
inlineContent
|
|
251
|
+
size=${this.size}
|
|
252
|
+
>
|
|
253
|
+
<slot name="prefix" slot="prefix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
254
|
+
|
|
255
|
+
${this.select
|
|
256
|
+
? html` <sonic-icon slot="suffix" class="select-chevron" name="nav-arrow-down" .size=${this.size}></sonic-icon> `
|
|
257
|
+
: nothing}
|
|
258
|
+
</sonic-input>
|
|
259
|
+
<sonic-menu slot="content" class="custom-scroll" style="${this.offsetWidth ? `width: ${this.offsetWidth}px` : ""}">
|
|
260
|
+
<sonic-queue
|
|
261
|
+
dataProvider="${this.queueDataProvider}"
|
|
262
|
+
filteredFields=${this.filteredFields}
|
|
263
|
+
dataProviderExpression="${this.dataProviderExpression}"
|
|
264
|
+
dataFilterProvider="${this.searchDataProvider}"
|
|
265
|
+
key="${this.key}"
|
|
266
|
+
.templates=${this.templateList}
|
|
267
|
+
displayContents
|
|
268
|
+
>
|
|
269
|
+
</sonic-queue>
|
|
270
|
+
<sonic-queue
|
|
271
|
+
noLazyload
|
|
272
|
+
noLoader
|
|
273
|
+
dataProvider="${this.initQueueDataProvider}"
|
|
274
|
+
filteredFields=${this.filteredFields}
|
|
275
|
+
dataProviderExpression="${this.dataProviderExpression}"
|
|
276
|
+
dataFilterProvider="${this.initSearchDataProvider}"
|
|
277
|
+
key="${this.key}"
|
|
278
|
+
displayContents
|
|
279
|
+
>
|
|
280
|
+
</sonic-queue>
|
|
281
|
+
</sonic-menu>
|
|
282
|
+
</sonic-pop>
|
|
283
|
+
`;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Radio
|
|
2
|
+
|
|
3
|
+
## Size
|
|
4
|
+
<sonic-code>
|
|
5
|
+
<template>
|
|
6
|
+
<div class="grid gap-2" formDataProvider="radioSizeExemple">
|
|
7
|
+
<sonic-radio name="size" value="2xs" size="2xs">2xs radio</sonic-radio>
|
|
8
|
+
<sonic-radio name="size" value="xs" size="xs">xs radio</sonic-radio>
|
|
9
|
+
<sonic-radio name="size" value="sm" size="sm">sm radio</sonic-radio>
|
|
10
|
+
<sonic-radio name="size" value="default" >default radio</sonic-radio>
|
|
11
|
+
<sonic-radio name="size" value="lg" size="lg">lg radio</sonic-radio>
|
|
12
|
+
<sonic-radio name="size" value="xl" size="xl">xl radio</sonic-radio>
|
|
13
|
+
<sonic-radio name="size" value="2xl" size="2xl">2xl radio</sonic-radio>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
</sonic-code>
|
|
17
|
+
|
|
18
|
+
## Checked
|
|
19
|
+
<sonic-code>
|
|
20
|
+
<template>
|
|
21
|
+
<sonic-radio checked
|
|
22
|
+
>Already checked radio
|
|
23
|
+
</sonic-radio>
|
|
24
|
+
</template>
|
|
25
|
+
</sonic-code>
|
|
26
|
+
|
|
27
|
+
## Disabled
|
|
28
|
+
<sonic-code>
|
|
29
|
+
<template>
|
|
30
|
+
<sonic-radio disabled
|
|
31
|
+
>Disabled radio
|
|
32
|
+
</sonic-radio>
|
|
33
|
+
</template>
|
|
34
|
+
</sonic-code>
|
|
35
|
+
|
|
36
|
+
## Disabled and checked
|
|
37
|
+
<sonic-code>
|
|
38
|
+
<template>
|
|
39
|
+
<sonic-radio disabled checked
|
|
40
|
+
>Disabled but already checked radio
|
|
41
|
+
</sonic-radio>
|
|
42
|
+
</template>
|
|
43
|
+
</sonic-code>
|
|
44
|
+
|
|
45
|
+
## radio with link
|
|
46
|
+
<sonic-code>
|
|
47
|
+
<template>
|
|
48
|
+
<sonic-radio name="link" value="link">radio with <sonic-link href="#" class="underline text-info">link</sonic-link>
|
|
49
|
+
</template>
|
|
50
|
+
</sonic-code>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## Example of use
|
|
54
|
+
<sonic-code>
|
|
55
|
+
<template>
|
|
56
|
+
<sonic-theme color background theme=${theme} class="p-8">
|
|
57
|
+
<sonic-subscriber dataProvider="jokeFilterRadio" class="text-xl my-4 block font-bold">
|
|
58
|
+
Remove following jokes :
|
|
59
|
+
<sonic-value key="blacklistFlags" class="block text-sm"></sonic-value>
|
|
60
|
+
</sonic-subscriber>
|
|
61
|
+
<div formDataProvider="jokeFilterRadio" class="grid grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-2 mt-2 mb-3">
|
|
62
|
+
<sonic-radio name="blacklistFlags" value="nsfw">nsfw</sonic-radio>
|
|
63
|
+
<sonic-radio name="blacklistFlags" value="religious">religious</sonic-radio>
|
|
64
|
+
<sonic-radio name="blacklistFlags" value="political">political</sonic-radio>
|
|
65
|
+
<sonic-radio name="blacklistFlags" value="racist" checked >racist</sonic-radio>
|
|
66
|
+
<sonic-radio name="blacklistFlags" value="sexist" >sexist</sonic-radio>
|
|
67
|
+
<sonic-radio name="blacklistFlags" value="explicit">explicit</sonic-radio>
|
|
68
|
+
</div>
|
|
69
|
+
<sonic-queue
|
|
70
|
+
lazyload
|
|
71
|
+
dataProviderExpression="joke/Any?amount=10&lang=en"
|
|
72
|
+
dataFilterProvider="jokeFilterRadio"
|
|
73
|
+
serviceURL="https://v2.jokeapi.dev"
|
|
74
|
+
key="jokes"
|
|
75
|
+
>
|
|
76
|
+
<template>
|
|
77
|
+
<div class="border-0 border-b-[1px] border-b-neutral-300 py-3 leading-tight">
|
|
78
|
+
<sonic-value key="joke"></sonic-value>
|
|
79
|
+
<sonic-value key="setup" class="font-bold"></sonic-value><br>
|
|
80
|
+
<sonic-value key="delivery"></sonic-value>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
83
|
+
</sonic-queue>
|
|
84
|
+
</sonic-theme>
|
|
85
|
+
</template>
|
|
86
|
+
</sonic-code>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {css} from "lit";
|
|
2
|
+
import {customElement} from "lit/decorators.js";
|
|
3
|
+
import {Checkbox} from "@supersoniks/concorde/core/components/ui/form/checkbox/checkbox";
|
|
4
|
+
|
|
5
|
+
const tagName = "sonic-radio";
|
|
6
|
+
/**
|
|
7
|
+
* ### Le composant sonic-radio étend sonic-checkbox en assignant sa propriété radio à true.
|
|
8
|
+
*
|
|
9
|
+
* * Le type d'input html utilisé passe également de checkbox à radio.
|
|
10
|
+
* * Le comportement est donc similaire à un bouton radio classique mais avec les fonctionnalités de sonic-checkbox (ie : Subscriber / FormElement / FormCheckable).
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
@customElement(tagName)
|
|
14
|
+
export class Radio extends Checkbox {
|
|
15
|
+
static styles = [
|
|
16
|
+
Checkbox.styles,
|
|
17
|
+
css`
|
|
18
|
+
:host input {
|
|
19
|
+
border-radius: 50%;
|
|
20
|
+
}
|
|
21
|
+
:host sonic-icon {
|
|
22
|
+
border-radius: 50%;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
background-color: var(--sc-primary-content);
|
|
25
|
+
line-height: 0;
|
|
26
|
+
display: block;
|
|
27
|
+
font-size: 1em;
|
|
28
|
+
height: 0.6em;
|
|
29
|
+
width: 0.6em;
|
|
30
|
+
}
|
|
31
|
+
`,
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
this.radio = true;
|
|
37
|
+
}
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
// this.iconName = "circle-small";
|
|
40
|
+
// this.iconPrefix = "solid";
|
|
41
|
+
super.connectedCallback();
|
|
42
|
+
this.type = "radio";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
## Options
|
|
4
|
+
<sonic-code>
|
|
5
|
+
<template>
|
|
6
|
+
<div class="grid gap-3">
|
|
7
|
+
<sonic-select>
|
|
8
|
+
<option value="">No Selection</option>
|
|
9
|
+
<option value="1">One</option>
|
|
10
|
+
<option value="2" selected>Two (set by "tag")</option>
|
|
11
|
+
<option value="3">Three</option>
|
|
12
|
+
</sonic-select>
|
|
13
|
+
<sonic-select options='[{"value":"", "wording":"Set options via \"attribute\""},
|
|
14
|
+
{"value":"dark", "wording":"dark (set by \"attribute\")", "selected" : "true"}, {"value":"auto", "wording":"auto"}
|
|
15
|
+
]'>
|
|
16
|
+
</sonic-select>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
</sonic-code>
|
|
20
|
+
|
|
21
|
+
## Size
|
|
22
|
+
<sonic-code>
|
|
23
|
+
<template>
|
|
24
|
+
<div class="grid gap-3">
|
|
25
|
+
<sonic-select size="2xs"><option>2xs</option></sonic-select>
|
|
26
|
+
<sonic-select size="xs"><option>xs</option></sonic-select>
|
|
27
|
+
<sonic-select size="sm"><option>sm</option></sonic-select>
|
|
28
|
+
<sonic-select size="md"><option>md</option></sonic-select>
|
|
29
|
+
<sonic-select size="default"><option>default</option></sonic-select>
|
|
30
|
+
<sonic-select size="lg"><option>lg</option></sonic-select>
|
|
31
|
+
<sonic-select size="xl"><option>xl</option></sonic-select>
|
|
32
|
+
<sonic-select size="2xl"><option>2xl</option></sonic-select>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
</sonic-code>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Multiple
|
|
39
|
+
<sonic-code>
|
|
40
|
+
<template>
|
|
41
|
+
<div class="grid gap-3">
|
|
42
|
+
<sonic-select multiple>
|
|
43
|
+
<option value="">Choose a number</option>
|
|
44
|
+
<option value="1">One</option>
|
|
45
|
+
<option value="2">Two</option>
|
|
46
|
+
<option value="3">Three</option>
|
|
47
|
+
</sonic-select>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
</sonic-code>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## Disabled
|
|
54
|
+
<sonic-code>
|
|
55
|
+
<template>
|
|
56
|
+
<div class="grid gap-3">
|
|
57
|
+
<sonic-select disabled>
|
|
58
|
+
<option value="">Choose a number</option>
|
|
59
|
+
<option value="1">One</option>
|
|
60
|
+
<option value="2">Two</option>
|
|
61
|
+
<option value="3">Three</option>
|
|
62
|
+
</sonic-select>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
</sonic-code>
|
|
66
|
+
|
|
67
|
+
## Example of use
|
|
68
|
+
<sonic-code>
|
|
69
|
+
<template>
|
|
70
|
+
<sonic-theme color background theme=${theme} class="p-8">
|
|
71
|
+
<sonic-select
|
|
72
|
+
formDataProvider="select-filter"
|
|
73
|
+
name="lang"
|
|
74
|
+
value="fr"
|
|
75
|
+
>
|
|
76
|
+
<option value="fr">fr<option>
|
|
77
|
+
<optionn value="en">en<option>
|
|
78
|
+
</sonic-select>
|
|
79
|
+
<sonic-subscriber dataProvider="select-filter" class="text-xl my-4 block font-bold">
|
|
80
|
+
Blagues trouvées pour le code de langue"<span data-bind ::inner-html="$lang"></span>" :
|
|
81
|
+
</sonic-subscriber>
|
|
82
|
+
<sonic-queue
|
|
83
|
+
lazyload
|
|
84
|
+
dataProviderExpression="joke/Any?amount=10"
|
|
85
|
+
dataFilterProvider="select-filter"
|
|
86
|
+
serviceURL="https://v2.jokeapi.dev"
|
|
87
|
+
key="jokes"
|
|
88
|
+
>
|
|
89
|
+
<template>
|
|
90
|
+
<div class="border-0 border-b-[1px] border-b-neutral-300 border-dotted py-3">
|
|
91
|
+
<div data-bind ::inner-html="$joke"></div>
|
|
92
|
+
<div data-bind ::inner-html="$setup"></div>
|
|
93
|
+
<div data-bind ::inner-html="$delivery"></div>
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
96
|
+
</sonic-queue>
|
|
97
|
+
</sonic-theme>
|
|
98
|
+
</template>
|
|
99
|
+
</sonic-code>
|