@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,22 @@
|
|
|
1
|
+
import {html, LitElement, css} from "lit";
|
|
2
|
+
import {customElement} from "lit/decorators.js";
|
|
3
|
+
const tagName = "sonic-modal-title";
|
|
4
|
+
|
|
5
|
+
@customElement(tagName)
|
|
6
|
+
export class ModalTitle extends LitElement {
|
|
7
|
+
static styles = [
|
|
8
|
+
css`
|
|
9
|
+
:host {
|
|
10
|
+
font-weight: bold;
|
|
11
|
+
font-size: 1.5rem;
|
|
12
|
+
display: block;
|
|
13
|
+
line-height: var(--sc-headings-line-height);
|
|
14
|
+
font-family: var(--sc-headings-font-family);
|
|
15
|
+
}
|
|
16
|
+
`,
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
render() {
|
|
20
|
+
return html`<slot></slot>`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
## Modal
|
|
2
|
+
|
|
3
|
+
<sonic-code>
|
|
4
|
+
<template>
|
|
5
|
+
<sonic-button onclick="document.getElementById('modalExample').show()">
|
|
6
|
+
Simple modal
|
|
7
|
+
</sonic-button>
|
|
8
|
+
<sonic-modal id="modalExample">
|
|
9
|
+
<sonic-modal-close></sonic-modal-close>
|
|
10
|
+
<sonic-modal-title
|
|
11
|
+
>Lorem ipsum dolor sit amet <sonic-badge type="danger" size="sm">+33</sonic-badge></sonic-modal-title
|
|
12
|
+
>
|
|
13
|
+
<sonic-modal-subtitle>Donec sed vestibulum augue.</sonic-modal-subtitle>
|
|
14
|
+
<sonic-modal-content>
|
|
15
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget quam eu mi luctus faucibus.
|
|
16
|
+
</sonic-modal-content>
|
|
17
|
+
<sonic-modal-actions formDataProvider="youpla">
|
|
18
|
+
<sonic-button FormCheckable hideModal="false" minWidth="8rem" value="true" name="click">
|
|
19
|
+
Click don't close
|
|
20
|
+
</sonic-button>
|
|
21
|
+
<sonic-button minWidth="8rem" type="success">Confirm</sonic-button>
|
|
22
|
+
</sonic-modal-actions>
|
|
23
|
+
</sonic-modal>
|
|
24
|
+
</template>
|
|
25
|
+
</sonic-code>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## Long text
|
|
29
|
+
|
|
30
|
+
<sonic-code>
|
|
31
|
+
<template>
|
|
32
|
+
<sonic-button onclick="document.getElementById('modalText').show()"> Long text </sonic-button>
|
|
33
|
+
<sonic-modal align="left" id="modalText">
|
|
34
|
+
<sonic-modal-close></sonic-modal-close>
|
|
35
|
+
<sonic-modal-title>Infos et tarifs </sonic-modal-title>
|
|
36
|
+
<sonic-modal-content>
|
|
37
|
+
<div class="prose">
|
|
38
|
+
<p>
|
|
39
|
+
<strong>Horaires d’ouverture </strong><br />
|
|
40
|
+
Du mercredi au samedi de 13h30 à 19h et le dimanche de 13h30 à 18h<br />
|
|
41
|
+
+ horaires spécifiques pour événements ou festivals
|
|
42
|
+
</p>
|
|
43
|
+
<p>
|
|
44
|
+
<strong> Billetterie <br /></strong>
|
|
45
|
+
La participation à certains événements et activités est soumise à un système de billetterie avec achats ou
|
|
46
|
+
réservations disponibles en ligne ou au guichet. <strong><br /></strong>
|
|
47
|
+
</p>
|
|
48
|
+
<p>
|
|
49
|
+
Les tarifs (Tarif plein / Tarif Réduit / Tarif Spécifique) sont indiqués pour chaque événement et peuvent
|
|
50
|
+
varier selon la nature de l’événement. Les tarifs sont identiques en ligne et au guichet. Il est néanmoins
|
|
51
|
+
conseillé de réserver les billets en avance pour s’assurer une place.
|
|
52
|
+
</p>
|
|
53
|
+
<p>
|
|
54
|
+
L’accès au Skatepark, Fablab et Halle C sont soumis à adhésions. Les adhésions sont gratuites et
|
|
55
|
+
nominatives. Elle donnent accès aux espaces dans la limite des places disponibles.
|
|
56
|
+
</p>
|
|
57
|
+
<p>
|
|
58
|
+
<strong>+ d’infos <br /></strong>billetterie@laconditionpublique.com <br />+33 (0)328334833
|
|
59
|
+
</p>
|
|
60
|
+
<br />
|
|
61
|
+
<p>
|
|
62
|
+
<strong>Accès <br /></strong>14, place Faidherbe <br />59100 Roubaix <br />Métro / Tram : Arrêt
|
|
63
|
+
Eurotéléport, Ligne 2 <br />Bus / V’Lille : Arrêt Condition Publique
|
|
64
|
+
</p>
|
|
65
|
+
<p>
|
|
66
|
+
Accès handicapés : nous contacter avant votre venue au 03 28 33 48 33 ou par mail
|
|
67
|
+
billetterie@laconditionpublique.com
|
|
68
|
+
</p>
|
|
69
|
+
</div>
|
|
70
|
+
</sonic-modal-content>
|
|
71
|
+
</sonic-modal>
|
|
72
|
+
</template>
|
|
73
|
+
</sonic-code>
|
|
74
|
+
|
|
75
|
+
## Force action
|
|
76
|
+
|
|
77
|
+
<sonic-code>
|
|
78
|
+
<template>
|
|
79
|
+
<sonic-button onclick="document.getElementById('force').show()"> Action obligatoire </sonic-button>
|
|
80
|
+
<sonic-modal forceAction id="force">
|
|
81
|
+
<sonic-modal-title>Voulez-vous accepter les cookies ? </sonic-modal-title>
|
|
82
|
+
<sonic-modal-content>
|
|
83
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget quam eu mi luctus faucibus.
|
|
84
|
+
</sonic-modal-content>
|
|
85
|
+
<sonic-modal-actions formDataProvider="youpla">
|
|
86
|
+
<sonic-button> Nope </sonic-button>
|
|
87
|
+
<sonic-button minWidth="8rem" type="success">Carrément</sonic-button>
|
|
88
|
+
</sonic-modal-actions>
|
|
89
|
+
</sonic-modal>
|
|
90
|
+
</sonic-modal>
|
|
91
|
+
</template>
|
|
92
|
+
</sonic-code>
|
|
93
|
+
|
|
94
|
+
## Custom dimensions
|
|
95
|
+
|
|
96
|
+
<sonic-code>
|
|
97
|
+
<template>
|
|
98
|
+
<sonic-button onclick="document.getElementById('CustomWidth').show()"> Custom width </sonic-button>
|
|
99
|
+
<sonic-modal maxHeight="50vh" maxWidth="90vw" width="100%" height="100%" id="CustomWidth">
|
|
100
|
+
<sonic-modal-close></sonic-modal-close>
|
|
101
|
+
<sonic-image
|
|
102
|
+
cover
|
|
103
|
+
objectPosition="center 20%"
|
|
104
|
+
src="https://thegoodlife.thegoodhub.com/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
105
|
+
></sonic-image>
|
|
106
|
+
</sonic-modal>
|
|
107
|
+
</template>
|
|
108
|
+
</sonic-code>
|
|
109
|
+
|
|
110
|
+
## Fullscreen
|
|
111
|
+
|
|
112
|
+
<sonic-code>
|
|
113
|
+
<template>
|
|
114
|
+
<sonic-button onclick="document.getElementById('Fullscreen').show()"> Fullscreen </sonic-button>
|
|
115
|
+
<sonic-modal fullscreen id="Fullscreen">
|
|
116
|
+
<sonic-modal-close></sonic-modal-close>
|
|
117
|
+
<sonic-image
|
|
118
|
+
cover
|
|
119
|
+
src="https://thegoodlife.thegoodhub.com/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
120
|
+
></sonic-image>
|
|
121
|
+
</sonic-modal>
|
|
122
|
+
</template>
|
|
123
|
+
</sonic-code>
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import "./modal";
|
|
2
|
+
import "./modal-actions";
|
|
3
|
+
import "./modal-close";
|
|
4
|
+
import "./modal-content";
|
|
5
|
+
import "./modal-subtitle";
|
|
6
|
+
import "./modal-title";
|
|
7
|
+
import "../button/button";
|
|
8
|
+
import { html } from "lit";
|
|
9
|
+
|
|
10
|
+
// More on default export: https://storybook.js.org/docs/web-components/writing-stories/introduction#default-export
|
|
11
|
+
export default {
|
|
12
|
+
component: "sonic-modal",
|
|
13
|
+
title: "core/components/ui/Modal",
|
|
14
|
+
argTypes: {
|
|
15
|
+
styles: { table: { category: "Internals or others" } },
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const Template: any = ({}: any) => {
|
|
20
|
+
return html`
|
|
21
|
+
<sonic-button
|
|
22
|
+
onclick="
|
|
23
|
+
document.getElementById('modalExample').show()
|
|
24
|
+
"
|
|
25
|
+
>
|
|
26
|
+
Simple modal
|
|
27
|
+
</sonic-button>
|
|
28
|
+
|
|
29
|
+
<sonic-modal id="modalExample">
|
|
30
|
+
<sonic-modal-close></sonic-modal-close>
|
|
31
|
+
<sonic-modal-title
|
|
32
|
+
>Lorem ipsum dolor sit amet <sonic-badge type="danger" size="sm">+33</sonic-badge></sonic-modal-title
|
|
33
|
+
>
|
|
34
|
+
<sonic-modal-subtitle>Donec sed vestibulum augue.</sonic-modal-subtitle>
|
|
35
|
+
<sonic-modal-content>
|
|
36
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget quam eu mi luctus faucibus.
|
|
37
|
+
</sonic-modal-content>
|
|
38
|
+
<sonic-modal-actions formDataProvider="youpla">
|
|
39
|
+
<sonic-button FormCheckable hideModal="false" minWidth="8rem" value="true" name="click">
|
|
40
|
+
Click don't close
|
|
41
|
+
</sonic-button>
|
|
42
|
+
<sonic-button minWidth="8rem" type="success">Confirmer</sonic-button>
|
|
43
|
+
</sonic-modal-actions>
|
|
44
|
+
</sonic-modal>
|
|
45
|
+
`;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const Example = Template.bind({});
|
|
49
|
+
|
|
50
|
+
const modalLongSize: any = () => {
|
|
51
|
+
return html`
|
|
52
|
+
<sonic-button onclick="document.getElementById('modalText').show()"> Long text </sonic-button>
|
|
53
|
+
<sonic-modal align="left" id="modalText">
|
|
54
|
+
<sonic-modal-close></sonic-modal-close>
|
|
55
|
+
<sonic-modal-title>Infos et tarifs </sonic-modal-title>
|
|
56
|
+
<sonic-modal-content>
|
|
57
|
+
<div class="prose">
|
|
58
|
+
<p>
|
|
59
|
+
<strong>Horaires d’ouverture </strong><br />
|
|
60
|
+
Du mercredi au samedi de 13h30 à 19h et le dimanche de 13h30 à 18h<br />
|
|
61
|
+
+ horaires spécifiques pour événements ou festivals
|
|
62
|
+
</p>
|
|
63
|
+
<p>
|
|
64
|
+
<strong> Billetterie <br /></strong>
|
|
65
|
+
La participation à certains événements et activités est soumise à un système de billetterie avec achats ou
|
|
66
|
+
réservations disponibles en ligne ou au guichet. <strong><br /></strong>
|
|
67
|
+
</p>
|
|
68
|
+
<p>
|
|
69
|
+
Les tarifs (Tarif plein / Tarif Réduit / Tarif Spécifique) sont indiqués pour chaque événement et peuvent
|
|
70
|
+
varier selon la nature de l’événement. Les tarifs sont identiques en ligne et au guichet. Il est néanmoins
|
|
71
|
+
conseillé de réserver les billets en avance pour s’assurer une place.
|
|
72
|
+
</p>
|
|
73
|
+
<p>
|
|
74
|
+
L’accès au Skatepark, Fablab et Halle C sont soumis à adhésions. Les adhésions sont gratuites et
|
|
75
|
+
nominatives. Elle donnent accès aux espaces dans la limite des places disponibles.
|
|
76
|
+
</p>
|
|
77
|
+
<p>
|
|
78
|
+
<strong>+ d’infos <br /></strong>billetterie@laconditionpublique.com <br />+33 (0)328334833
|
|
79
|
+
</p>
|
|
80
|
+
<br />
|
|
81
|
+
<p>
|
|
82
|
+
<strong>Accès <br /></strong>14, place Faidherbe <br />59100 Roubaix <br />Métro / Tram : Arrêt
|
|
83
|
+
Eurotéléport, Ligne 2 <br />Bus / V’Lille : Arrêt Condition Publique
|
|
84
|
+
</p>
|
|
85
|
+
<p>
|
|
86
|
+
Accès handicapés : nous contacter avant votre venue au 03 28 33 48 33 ou par mail
|
|
87
|
+
billetterie@laconditionpublique.com
|
|
88
|
+
</p>
|
|
89
|
+
</div>
|
|
90
|
+
</sonic-modal-content>
|
|
91
|
+
</sonic-modal>
|
|
92
|
+
`;
|
|
93
|
+
};
|
|
94
|
+
export const LongTextScrollable = modalLongSize.bind({});
|
|
95
|
+
|
|
96
|
+
const modalForceAction: any = () => {
|
|
97
|
+
return html`
|
|
98
|
+
<sonic-button onclick="document.getElementById('force').show()"> Action obligatoire </sonic-button>
|
|
99
|
+
<sonic-modal .hideOnOverlayClick=${false} .hideOnEscape=${false} id="force">
|
|
100
|
+
<sonic-modal-title>Voulez-vous accepter les cookies ? </sonic-modal-title>
|
|
101
|
+
<sonic-modal-content>
|
|
102
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget quam eu mi luctus faucibus.
|
|
103
|
+
</sonic-modal-content>
|
|
104
|
+
<sonic-modal-actions formDataProvider="youpla">
|
|
105
|
+
<sonic-button> Nope </sonic-button>
|
|
106
|
+
<sonic-button minWidth="8rem" type="success">Carrément</sonic-button>
|
|
107
|
+
</sonic-modal-actions>
|
|
108
|
+
</sonic-modal>
|
|
109
|
+
`;
|
|
110
|
+
};
|
|
111
|
+
export const ForceAction = modalForceAction.bind({});
|
|
112
|
+
|
|
113
|
+
const customWidthModal: any = () => {
|
|
114
|
+
return html`
|
|
115
|
+
<sonic-button onclick="document.getElementById('CustomWidth').show()"> Custom width </sonic-button>
|
|
116
|
+
<sonic-modal maxHeight="50vh" maxWidth="90vw" width="100%" height="100%" id="CustomWidth">
|
|
117
|
+
<sonic-modal-close></sonic-modal-close>
|
|
118
|
+
<sonic-image
|
|
119
|
+
cover
|
|
120
|
+
objectPosition="center 20%"
|
|
121
|
+
src="https://thegoodlife.thegoodhub.com/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
122
|
+
></sonic-image>
|
|
123
|
+
</sonic-modal>
|
|
124
|
+
`;
|
|
125
|
+
};
|
|
126
|
+
export const customWidth = customWidthModal.bind({});
|
|
127
|
+
|
|
128
|
+
const modalFullscreen: any = () => {
|
|
129
|
+
return html`
|
|
130
|
+
<sonic-button onclick="document.getElementById('Fullscreen').show()"> Fullscreen </sonic-button>
|
|
131
|
+
<sonic-modal fullscreen id="Fullscreen">
|
|
132
|
+
<sonic-modal-close></sonic-modal-close>
|
|
133
|
+
<sonic-image
|
|
134
|
+
cover
|
|
135
|
+
src="https://thegoodlife.thegoodhub.com/wp-content/uploads/sites/2/2022/03/compagnies-aeriennes-nostalgie-coeur-insert-03-dr.jpg"
|
|
136
|
+
></sonic-image>
|
|
137
|
+
</sonic-modal>
|
|
138
|
+
`;
|
|
139
|
+
};
|
|
140
|
+
export const Fullscreen = modalFullscreen.bind({});
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import {animate, fadeIn, fadeOut} from "@lit-labs/motion";
|
|
2
|
+
import {customScroll} from "@supersoniks/concorde/core/components/ui/_css/scroll";
|
|
3
|
+
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
4
|
+
import {css, html, LitElement, nothing, PropertyValues} from "lit";
|
|
5
|
+
import {customElement, property, query, queryAssignedElements} from "lit/decorators.js";
|
|
6
|
+
import {styleMap} from "lit/directives/style-map.js";
|
|
7
|
+
|
|
8
|
+
import "@supersoniks/concorde/core/components/ui/modal/modal-actions";
|
|
9
|
+
import "@supersoniks/concorde/core/components/ui/modal/modal-close";
|
|
10
|
+
import "@supersoniks/concorde/core/components/ui/modal/modal-content";
|
|
11
|
+
import "@supersoniks/concorde/core/components/ui/modal/modal-subtitle";
|
|
12
|
+
import "@supersoniks/concorde/core/components/ui/modal/modal-title";
|
|
13
|
+
import {PublisherManager} from "@supersoniks/concorde/utils";
|
|
14
|
+
import {ConcordeWindow} from "@supersoniks/concorde/core/_types/types";
|
|
15
|
+
import {Theme} from "@supersoniks/concorde/core/components/ui/theme/theme";
|
|
16
|
+
import {PrimitiveType} from "@supersoniks/concorde/core/_types/types";
|
|
17
|
+
import {DirectiveResult} from "lit/directive.js";
|
|
18
|
+
|
|
19
|
+
import {unsafeHTML} from "lit/directives/unsafe-html.js";
|
|
20
|
+
|
|
21
|
+
declare const window: ConcordeWindow;
|
|
22
|
+
declare type ModalCreateOptions = {
|
|
23
|
+
title?: string | DirectiveResult;
|
|
24
|
+
subtitle?: string | DirectiveResult;
|
|
25
|
+
content?: string | DirectiveResult;
|
|
26
|
+
actions?: string | DirectiveResult;
|
|
27
|
+
zIndex?: string;
|
|
28
|
+
paddingX?: string;
|
|
29
|
+
paddingY?: string;
|
|
30
|
+
width?: string;
|
|
31
|
+
maxWidth?: string;
|
|
32
|
+
height?: string;
|
|
33
|
+
maxHeight?: string;
|
|
34
|
+
removeOnHide?: boolean;
|
|
35
|
+
forceAction?: boolean;
|
|
36
|
+
removeHashOnHide?: boolean;
|
|
37
|
+
};
|
|
38
|
+
const tagName = "sonic-modal";
|
|
39
|
+
|
|
40
|
+
@customElement(tagName)
|
|
41
|
+
export class Modal extends Subscriber(LitElement) {
|
|
42
|
+
static styles = [
|
|
43
|
+
customScroll,
|
|
44
|
+
css`
|
|
45
|
+
:host {
|
|
46
|
+
--sc-modal-py: 2.5rem;
|
|
47
|
+
--sc-modal-px: 1.5rem;
|
|
48
|
+
--sc-modal-max-w: min(100vw, 40rem);
|
|
49
|
+
--sc-modal-max-h: 85vh;
|
|
50
|
+
--sc-modal-rounded: var(--sc-rounded-lg);
|
|
51
|
+
--sc-modal-z-index: 990;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
* {
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.modal-wrapper {
|
|
59
|
+
position: fixed;
|
|
60
|
+
bottom: 0;
|
|
61
|
+
left: 0;
|
|
62
|
+
width: 100%;
|
|
63
|
+
z-index: calc(var(--sc-modal-z-index) + 1);
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
display: flex;
|
|
68
|
+
pointer-events: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.modal-content {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
min-height: 10rem;
|
|
75
|
+
line-height: 1.25;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.modal {
|
|
79
|
+
background: var(--sc-base);
|
|
80
|
+
color: var(--sc-base-content);
|
|
81
|
+
width: 100%;
|
|
82
|
+
box-shadow: var(--sc-shadow-lg);
|
|
83
|
+
border-radius: var(--sc-modal-rounded) var(--sc-modal-rounded) 0 0;
|
|
84
|
+
pointer-events: auto;
|
|
85
|
+
/*overflow: hidden;*/
|
|
86
|
+
transform: translateZ(0);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.overlay {
|
|
90
|
+
background: var(--sc-modal-overlay-bg, var(--sc-base-200));
|
|
91
|
+
left: 0;
|
|
92
|
+
top: 0;
|
|
93
|
+
right: 0;
|
|
94
|
+
bottom: 0;
|
|
95
|
+
z-index: var(--sc-modal-z-index);
|
|
96
|
+
opacity: 0.8;
|
|
97
|
+
position: fixed;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
::slotted(sonic-modal-title) {
|
|
101
|
+
margin-bottom: 1.25rem;
|
|
102
|
+
}
|
|
103
|
+
:host([align="left"]) ::slotted(sonic-modal-title) {
|
|
104
|
+
padding-right: 1em;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
::slotted(sonic-modal-subtitle) {
|
|
108
|
+
margin-top: -0.9rem;
|
|
109
|
+
margin-bottom: 1.25rem;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@media (max-width: 767.5px) {
|
|
113
|
+
.modal-wrapper,
|
|
114
|
+
.modal {
|
|
115
|
+
max-width: none !important;
|
|
116
|
+
width: 100% !important;
|
|
117
|
+
border-radius: var(--sc-modal-rounded) var(--sc-modal-rounded) 0 0 !important;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@media (min-width: 768px) {
|
|
122
|
+
.modal-wrapper {
|
|
123
|
+
top: 50%;
|
|
124
|
+
left: 50%;
|
|
125
|
+
bottom: auto;
|
|
126
|
+
right: auto;
|
|
127
|
+
transform: translateX(-50%) translateY(-50%);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.modal {
|
|
131
|
+
top: 50%;
|
|
132
|
+
bottom: auto;
|
|
133
|
+
right: auto;
|
|
134
|
+
border-radius: var(--sc-modal-rounded);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host([align="left"]) .modal-content {
|
|
139
|
+
text-align: left;
|
|
140
|
+
align-items: flex-start;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:host([align="center"]) .modal-content {
|
|
144
|
+
text-align: center;
|
|
145
|
+
align-items: center;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:host([align="right"]) .modal-content {
|
|
149
|
+
text-align: right;
|
|
150
|
+
align-items: flex-end;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Border radius */
|
|
154
|
+
:host([rounded="none"]) modal {
|
|
155
|
+
--sc-img-radius: 0 !important;
|
|
156
|
+
}
|
|
157
|
+
`,
|
|
158
|
+
];
|
|
159
|
+
static modals: Array<Modal> = [];
|
|
160
|
+
|
|
161
|
+
@property({type: Boolean}) forceAction = false;
|
|
162
|
+
@property({type: Boolean}) removeOnHide = false;
|
|
163
|
+
@property({type: Boolean}) removeHashOnHide = false;
|
|
164
|
+
@property({type: String, reflect: true}) align: "center" | "right" | "left" = "left";
|
|
165
|
+
|
|
166
|
+
@property({type: String}) padding = "var(--sc-modal-py) var(--sc-modal-px)";
|
|
167
|
+
@property({type: String}) maxWidth = "var(--sc-modal-max-w) ";
|
|
168
|
+
@property({type: String}) maxHeight = "var(--sc-modal-max-h) ";
|
|
169
|
+
@property({type: String}) width = "100%";
|
|
170
|
+
@property({type: String}) height = "auto";
|
|
171
|
+
@property({type: String}) zIndex = "var(--sc-modal-z-index)";
|
|
172
|
+
@property({type: Object}) options?: ModalCreateOptions;
|
|
173
|
+
@property({type: Boolean, reflect: true}) fullScreen = false;
|
|
174
|
+
@property({type: Boolean, reflect: true}) visible = false;
|
|
175
|
+
|
|
176
|
+
@query(".modal-wrapper") modalWrapper!: HTMLDivElement;
|
|
177
|
+
@query(".modal") modalElement!: HTMLDivElement;
|
|
178
|
+
|
|
179
|
+
@queryAssignedElements({selector: "sonic-modal-close"})
|
|
180
|
+
closeBtn!: Array<HTMLElement>;
|
|
181
|
+
static create(options: ModalCreateOptions): Modal {
|
|
182
|
+
const modal = document.createElement(tagName) as Modal;
|
|
183
|
+
// modal styles
|
|
184
|
+
modal.options = options;
|
|
185
|
+
|
|
186
|
+
if (options.removeHashOnHide === true) modal.setAttribute("removeHashOnHide", "true");
|
|
187
|
+
if (options.removeOnHide === true) modal.setAttribute("removeOnHide", "true");
|
|
188
|
+
|
|
189
|
+
if (options.maxWidth) modal.maxWidth = options?.maxWidth;
|
|
190
|
+
if (options.width) modal.width = options?.width;
|
|
191
|
+
if (options.maxHeight) modal.maxHeight = options?.maxHeight;
|
|
192
|
+
if (options.height) modal.height = options?.height;
|
|
193
|
+
if (options.forceAction) modal.forceAction = true;
|
|
194
|
+
|
|
195
|
+
if (options.paddingX) modal.style.setProperty("--sc-modal-px", options?.paddingX);
|
|
196
|
+
if (options.paddingY) modal.style.setProperty("--sc-modal-py", options?.paddingY);
|
|
197
|
+
if (options.zIndex) modal.style.setProperty("--sc-modal-z-index", options?.zIndex);
|
|
198
|
+
|
|
199
|
+
const container = Theme.getPopContainer();
|
|
200
|
+
container.appendChild(modal);
|
|
201
|
+
modal.show();
|
|
202
|
+
return modal;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
connectedCallback(): void {
|
|
206
|
+
Modal.modals.push(this);
|
|
207
|
+
super.connectedCallback();
|
|
208
|
+
this.handleFullsceen();
|
|
209
|
+
}
|
|
210
|
+
disconnectedCallback(): void {
|
|
211
|
+
Modal.modals.splice(Modal.modals.indexOf(this), 1);
|
|
212
|
+
super.disconnectedCallback();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
updated(): void {
|
|
216
|
+
const currentModal = this as Modal;
|
|
217
|
+
|
|
218
|
+
document.addEventListener("keydown", this.handleEscape);
|
|
219
|
+
|
|
220
|
+
currentModal.closeBtn.forEach((closeBtn) => {
|
|
221
|
+
closeBtn.addEventListener(
|
|
222
|
+
"click",
|
|
223
|
+
function () {
|
|
224
|
+
currentModal.hide();
|
|
225
|
+
},
|
|
226
|
+
{once: true}
|
|
227
|
+
);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
willUpdate(_changedProperties: PropertyValues): void {
|
|
232
|
+
if (_changedProperties.has("fullScreen")) {
|
|
233
|
+
this.handleFullsceen();
|
|
234
|
+
}
|
|
235
|
+
super.willUpdate(_changedProperties);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
render() {
|
|
239
|
+
if (this.visible == false) return nothing;
|
|
240
|
+
|
|
241
|
+
const modalStyles = {
|
|
242
|
+
padding: this.padding,
|
|
243
|
+
maxWidth: this.maxWidth,
|
|
244
|
+
maxHeight: this.maxHeight,
|
|
245
|
+
width: this.width,
|
|
246
|
+
height: this.height,
|
|
247
|
+
zIndex: this.zIndex,
|
|
248
|
+
borderRadius: this.fullScreen ? "0" : "var(--sc-modal-rounded)",
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const modalWrapperStyles = {
|
|
252
|
+
maxWidth: this.maxWidth,
|
|
253
|
+
maxHeight: this.maxHeight,
|
|
254
|
+
width: this.width,
|
|
255
|
+
height: this.height,
|
|
256
|
+
borderRadius: this.fullScreen ? "0" : "var(--sc-modal-rounded)",
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
return html`<div
|
|
260
|
+
class="modal-wrapper"
|
|
261
|
+
style=${styleMap(modalWrapperStyles)}
|
|
262
|
+
${animate({
|
|
263
|
+
out: fadeOut,
|
|
264
|
+
})}
|
|
265
|
+
tabindex="0"
|
|
266
|
+
>
|
|
267
|
+
<div
|
|
268
|
+
part="modal"
|
|
269
|
+
class="modal custom-scroll"
|
|
270
|
+
style=${styleMap(modalStyles)}
|
|
271
|
+
${animate({
|
|
272
|
+
keyframeOptions: {
|
|
273
|
+
duration: 400,
|
|
274
|
+
easing: `cubic-bezier(0.250, 0.250, 0.420, 1.225)`,
|
|
275
|
+
},
|
|
276
|
+
in: [{transform: "translateY(25%) scale(1)", boxShadow: "0 0 0 rgba(0,0,0,0)", opacity: 0}],
|
|
277
|
+
out: [{transform: "translateY(20%) scale(1)", boxShadow: "0 0 0 rgba(0,0,0,0)", opacity: 0}],
|
|
278
|
+
})}
|
|
279
|
+
>
|
|
280
|
+
<div class="modal-content">
|
|
281
|
+
${!this.options?.forceAction ? html`<sonic-modal-close></sonic-modal-close>` : nothing} ${this.modalFragment("title")}
|
|
282
|
+
${this.modalFragment("subtitle")} ${this.modalFragment("content")} ${this.modalFragment("actions")}
|
|
283
|
+
|
|
284
|
+
<slot></slot>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
<div
|
|
289
|
+
class="overlay"
|
|
290
|
+
@click="${!this.forceAction ? this.hide : null}"
|
|
291
|
+
${animate({
|
|
292
|
+
keyframeOptions: {
|
|
293
|
+
duration: 500,
|
|
294
|
+
},
|
|
295
|
+
in: fadeIn,
|
|
296
|
+
out: [{opacity: 0, pointerEvents: "none"}],
|
|
297
|
+
})}
|
|
298
|
+
></div>`;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
modalFragment(optionKey: keyof ModalCreateOptions) {
|
|
302
|
+
const optionValue: Object | PrimitiveType = this.options?.[optionKey];
|
|
303
|
+
if (!optionValue) return nothing;
|
|
304
|
+
let output;
|
|
305
|
+
|
|
306
|
+
// si object c'est une template Result
|
|
307
|
+
//@todo, faire mieux...
|
|
308
|
+
if (optionValue instanceof Object) {
|
|
309
|
+
output = optionValue;
|
|
310
|
+
} else {
|
|
311
|
+
output = unsafeHTML(optionValue as string);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
switch (optionKey) {
|
|
315
|
+
case "title":
|
|
316
|
+
return html`<sonic-modal-title>${output}</sonic-modal-title>`;
|
|
317
|
+
case "subtitle":
|
|
318
|
+
return html`<sonic-modal-subtitle>${output}</sonic-modal-subtitle>`;
|
|
319
|
+
case "content":
|
|
320
|
+
return html`<sonic-modal-content>${output}</sonic-modal-content>`;
|
|
321
|
+
case "actions":
|
|
322
|
+
return html`<sonic-modal-actions>${output}</sonic-modal-actions>`;
|
|
323
|
+
default:
|
|
324
|
+
return nothing;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
show(): void {
|
|
329
|
+
this.visible = true;
|
|
330
|
+
this.modalElement?.setAttribute("tabindex", "0");
|
|
331
|
+
this.modalElement?.focus();
|
|
332
|
+
this.dispatchEvent(new CustomEvent("show"));
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
hide(): void {
|
|
336
|
+
this.visible = false;
|
|
337
|
+
this.modalElement?.setAttribute("tabindex", "-1");
|
|
338
|
+
this.dispatchEvent(new CustomEvent("hide"));
|
|
339
|
+
if (this.hasAttribute("resetDataProviderOnHide")) {
|
|
340
|
+
PublisherManager.get(this.getAttribute("resetDataProviderOnHide")).set({});
|
|
341
|
+
}
|
|
342
|
+
if (this.removeOnHide) {
|
|
343
|
+
this.remove();
|
|
344
|
+
}
|
|
345
|
+
setTimeout(() => {
|
|
346
|
+
this.dispatchEvent(new CustomEvent("hidden"));
|
|
347
|
+
if (this.removeHashOnHide) {
|
|
348
|
+
window.history.replaceState({}, "", window.location.pathname);
|
|
349
|
+
}
|
|
350
|
+
}, 480);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
dispose() {
|
|
354
|
+
this.hide();
|
|
355
|
+
this.remove();
|
|
356
|
+
}
|
|
357
|
+
static disposeAll() {
|
|
358
|
+
Modal.modals.forEach((modal) => {
|
|
359
|
+
modal.dispose();
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
handleEscape(e: KeyboardEvent): void {
|
|
364
|
+
if (e.key === "Escape") {
|
|
365
|
+
Modal.modals.forEach((modal: Modal) => {
|
|
366
|
+
if (!modal.forceAction) {
|
|
367
|
+
modal.hide();
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
handleFullsceen(): void {
|
|
374
|
+
// set fullscreen
|
|
375
|
+
if (this.fullScreen) {
|
|
376
|
+
this.width = "100%";
|
|
377
|
+
this.height = "100%";
|
|
378
|
+
this.maxWidth = "none";
|
|
379
|
+
this.maxHeight = "none";
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
if (typeof window !== "undefined") {
|
|
385
|
+
window.SonicModal = Modal;
|
|
386
|
+
}
|