@supersoniks/concorde 2.0.6 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-infos.json +1 -0
- package/index.html +44 -0
- package/notes de migration.md +21 -0
- package/package.json +23 -287
- package/scripts/prebuild.mjs +22 -0
- package/{components.js → src/components.ts} +5 -2
- package/src/concorde-loaded.ts +3 -0
- package/src/core/_types/types.ts +55 -0
- package/src/core/components/functional/date/date.md +290 -0
- package/src/core/components/functional/date/date.ts +206 -0
- package/src/core/components/functional/example/example.ts +11 -0
- package/src/core/components/functional/fetch/fetch.md +117 -0
- package/{core/components/functional/fetch/fetch.js → src/core/components/functional/fetch/fetch.ts} +33 -37
- package/src/core/components/functional/if/if.md +16 -0
- package/src/core/components/functional/if/if.test.ts +40 -0
- package/src/core/components/functional/if/if.ts +23 -0
- package/src/core/components/functional/list/list.md +194 -0
- package/src/core/components/functional/list/list.ts +236 -0
- package/src/core/components/functional/mix/mix.md +41 -0
- package/src/core/components/functional/mix/mix.ts +95 -0
- package/src/core/components/functional/queue/queue.md +87 -0
- package/src/core/components/functional/queue/queue.ts +279 -0
- package/src/core/components/functional/router/redirect.ts +44 -0
- package/src/core/components/functional/router/router.md +112 -0
- package/src/core/components/functional/router/router.ts +108 -0
- package/src/core/components/functional/sdui/SDUIDescriptorTransformer.ts +229 -0
- package/{core → src/core}/components/functional/sdui/default-library.json +13 -13
- package/src/core/components/functional/sdui/example.json +99 -0
- package/src/core/components/functional/sdui/sdui-utils.ts +62 -0
- package/src/core/components/functional/sdui/sdui.md +356 -0
- package/src/core/components/functional/sdui/sdui.ts +230 -0
- package/src/core/components/functional/sdui/types.ts +34 -0
- package/src/core/components/functional/sonic-scope/sonic-scope.ts +13 -0
- package/src/core/components/functional/states/states.md +87 -0
- package/src/core/components/functional/states/states.ts +121 -0
- package/src/core/components/functional/submit/submit.md +48 -0
- package/src/core/components/functional/submit/submit.ts +265 -0
- package/src/core/components/functional/subscriber/subscriber.md +91 -0
- package/src/core/components/functional/subscriber/subscriber.ts +28 -0
- package/src/core/components/functional/value/value.md +35 -0
- package/src/core/components/functional/value/value.ts +18 -0
- package/{core/components/ui/_css/scroll.js → src/core/components/ui/_css/scroll.ts} +3 -2
- package/{core/components/ui/_css/size.js → src/core/components/ui/_css/size.ts} +5 -2
- package/{core/components/ui/_css/type.js → src/core/components/ui/_css/type.ts} +5 -3
- package/src/core/components/ui/alert/alert.md +121 -0
- package/src/core/components/ui/alert/alert.ts +177 -0
- package/src/core/components/ui/badge/badge.md +102 -0
- package/{core/components/ui/badge/badge.js → src/core/components/ui/badge/badge.ts} +36 -51
- package/src/core/components/ui/button/button.md +184 -0
- package/{core/components/ui/button/button.js → src/core/components/ui/button/button.ts} +258 -302
- package/src/core/components/ui/captcha/captcha.md +12 -0
- package/src/core/components/ui/captcha/captcha.ts +88 -0
- package/src/core/components/ui/card/card-footer.ts +19 -0
- package/src/core/components/ui/card/card-header-descripton.ts +24 -0
- package/{core/components/ui/card/card-header.js → src/core/components/ui/card/card-header.ts} +28 -38
- package/src/core/components/ui/card/card-main.ts +24 -0
- package/src/core/components/ui/card/card.md +96 -0
- package/{core/components/ui/card/card.js → src/core/components/ui/card/card.ts} +23 -34
- package/src/core/components/ui/divider/divider.md +35 -0
- package/{core/components/ui/divider/divider.js → src/core/components/ui/divider/divider.ts} +35 -65
- package/src/core/components/ui/form/checkbox/checkbox.md +96 -0
- package/{core/components/ui/form/checkbox/checkbox.js → src/core/components/ui/form/checkbox/checkbox.ts} +79 -98
- package/{core/components/ui/form/css/form-control.js → src/core/components/ui/form/css/form-control.ts} +9 -5
- package/src/core/components/ui/form/fieldset/fieldset.md +129 -0
- package/src/core/components/ui/form/fieldset/fieldset.ts +96 -0
- package/src/core/components/ui/form/fieldset/legend-description.ts +23 -0
- package/src/core/components/ui/form/fieldset/legend.ts +90 -0
- package/src/core/components/ui/form/form-actions/form-actions.md +77 -0
- package/src/core/components/ui/form/form-actions/form-actions.ts +32 -0
- package/src/core/components/ui/form/form-layout/form-layout.md +43 -0
- package/src/core/components/ui/form/form-layout/form-layout.ts +71 -0
- package/src/core/components/ui/form/input/input.md +168 -0
- package/src/core/components/ui/form/input/input.ts +227 -0
- package/src/core/components/ui/form/input/password-helper.ts +68 -0
- package/src/core/components/ui/form/input/same-value-helper.ts +48 -0
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +130 -0
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.ts +285 -0
- package/src/core/components/ui/form/radio/radio.md +86 -0
- package/src/core/components/ui/form/radio/radio.ts +44 -0
- package/src/core/components/ui/form/select/select.md +99 -0
- package/src/core/components/ui/form/select/select.ts +310 -0
- package/src/core/components/ui/form/textarea/textarea.md +66 -0
- package/src/core/components/ui/form/textarea/textarea.ts +119 -0
- package/src/core/components/ui/group/group.md +75 -0
- package/src/core/components/ui/group/group.ts +101 -0
- package/src/core/components/ui/icon/icon.md +125 -0
- package/src/core/components/ui/icon/icon.stories.ts +100 -0
- package/src/core/components/ui/icon/icon.ts +106 -0
- package/src/core/components/ui/icon/icons.json +1 -0
- package/src/core/components/ui/icon/icons.ts +130 -0
- package/src/core/components/ui/icon/svgs/cancel.svg +3 -0
- package/src/core/components/ui/icon/svgs/check-circled-outline.svg +4 -0
- package/src/core/components/ui/icon/svgs/check.svg +3 -0
- package/src/core/components/ui/icon/svgs/emoji-puzzled.svg +1 -0
- package/src/core/components/ui/icon/svgs/info-empty.svg +5 -0
- package/src/core/components/ui/icon/svgs/loader.svg +1 -0
- package/src/core/components/ui/icon/svgs/minus-small.svg +3 -0
- package/src/core/components/ui/icon/svgs/more-horiz.svg +5 -0
- package/src/core/components/ui/icon/svgs/more-vert.svg +5 -0
- package/src/core/components/ui/icon/svgs/nav-arrow-down.svg +3 -0
- package/src/core/components/ui/icon/svgs/warning-circled-outline.svg +5 -0
- package/src/core/components/ui/image/image.md +107 -0
- package/src/core/components/ui/image/image.ts +117 -0
- package/src/core/components/ui/link/link.md +43 -0
- package/src/core/components/ui/link/link.ts +108 -0
- package/src/core/components/ui/loader/loader.md +37 -0
- package/src/core/components/ui/loader/loader.stories.ts +25 -0
- package/src/core/components/ui/loader/loader.ts +81 -0
- package/{core/components/ui/loader/styles/fixed.js → src/core/components/ui/loader/styles/fixed.ts} +2 -1
- package/{core/components/ui/loader/styles/inline.js → src/core/components/ui/loader/styles/inline.ts} +3 -2
- package/src/core/components/ui/menu/menu-item.ts +30 -0
- package/src/core/components/ui/menu/menu.md +288 -0
- package/src/core/components/ui/menu/menu.ts +292 -0
- package/src/core/components/ui/modal/modal-actions.ts +35 -0
- package/src/core/components/ui/modal/modal-close.ts +36 -0
- package/src/core/components/ui/modal/modal-content.ts +19 -0
- package/src/core/components/ui/modal/modal-subtitle.ts +23 -0
- package/src/core/components/ui/modal/modal-title.ts +22 -0
- package/src/core/components/ui/modal/modal.md +123 -0
- package/src/core/components/ui/modal/modal.stories.ts +140 -0
- package/src/core/components/ui/modal/modal.ts +386 -0
- package/src/core/components/ui/pop/pop.md +79 -0
- package/src/core/components/ui/pop/pop.ts +291 -0
- package/src/core/components/ui/progress/progress.md +65 -0
- package/{core/components/ui/progress/progress.js → src/core/components/ui/progress/progress.ts} +31 -50
- package/src/core/components/ui/table/table-caption.ts +21 -0
- package/src/core/components/ui/table/table-tbody.ts +32 -0
- package/src/core/components/ui/table/table-td.ts +47 -0
- package/src/core/components/ui/table/table-tfoot.ts +20 -0
- package/src/core/components/ui/table/table-th.ts +56 -0
- package/src/core/components/ui/table/table-thead.ts +18 -0
- package/src/core/components/ui/table/table-tr.ts +48 -0
- package/src/core/components/ui/table/table.md +467 -0
- package/{core/components/ui/table/table.js → src/core/components/ui/table/table.ts} +32 -53
- package/{core/components/ui/theme/theme-collection/core-variables.js → src/core/components/ui/theme/theme-collection/core-variables.ts} +3 -2
- package/{core/components/ui/theme/theme-collection/dark.js → src/core/components/ui/theme/theme-collection/dark.ts} +5 -3
- package/{core/components/ui/theme/theme-collection/light.js → src/core/components/ui/theme/theme-collection/light.ts} +3 -2
- package/src/core/components/ui/theme/theme.ts +118 -0
- package/src/core/components/ui/toast/message-subscriber.stories.ts +43 -0
- package/src/core/components/ui/toast/message-subscriber.ts +37 -0
- package/{core/components/ui/toast/toast-item.js → src/core/components/ui/toast/toast-item.ts} +86 -113
- package/src/core/components/ui/toast/toast.ts +237 -0
- package/src/core/components/ui/toast/types.ts +14 -0
- package/src/core/components/ui/tooltip/tooltip.md +37 -0
- package/{core/components/ui/tooltip/tooltip.js → src/core/components/ui/tooltip/tooltip.ts} +26 -47
- package/{core/components/ui/ui.js → src/core/components/ui/ui.ts} +2 -0
- package/src/core/core.ts +22 -0
- package/src/core/decorators/Subscriber.ts +187 -0
- package/src/core/directives/DataProvider.ts +113 -0
- package/src/core/directives/Wording.ts +220 -0
- package/src/core/mixins/Fetcher.ts +258 -0
- package/src/core/mixins/FormCheckable.ts +287 -0
- package/src/core/mixins/FormElement.ts +275 -0
- package/src/core/mixins/FormInput.ts +135 -0
- package/src/core/mixins/Subscriber.ts +352 -0
- package/src/core/mixins/TemplatesContainer.ts +70 -0
- package/{core/mixins/mixins.d.ts → src/core/mixins/mixins.ts} +1 -1
- package/src/core/utils/Arrays.ts +161 -0
- package/src/core/utils/DataBindObserver.ts +286 -0
- package/src/core/utils/Electron.ts +15 -0
- package/src/core/utils/Format.ts +58 -0
- package/src/core/utils/HTML.ts +126 -0
- package/src/core/utils/LocationHandler.ts +139 -0
- package/src/core/utils/Objects.ts +103 -0
- package/src/core/utils/PublisherProxy.ts +786 -0
- package/src/core/utils/Utils.ts +12 -0
- package/src/core/utils/api.ts +456 -0
- package/{core/utils/url-pattern.d.ts → src/core/utils/url-pattern.ts} +1 -0
- package/{decorators.js → src/decorators.ts} +6 -2
- package/{directives.js → src/directives.ts} +11 -6
- package/src/docs/_core-concept/overview.md +57 -0
- package/src/docs/_core-concept/subscriber.md +76 -0
- package/src/docs/_getting-started/concorde-outside.md +141 -0
- package/src/docs/_getting-started/create-a-component.md +137 -0
- package/src/docs/_getting-started/pubsub.md +150 -0
- package/src/docs/_getting-started/start.md +37 -0
- package/src/docs/_getting-started/theming.md +91 -0
- package/src/docs/code.ts +281 -0
- package/src/docs/docs.ts +6 -0
- package/src/docs/example/users.ts +64 -0
- package/src/docs/navigation/navigation.ts +101 -0
- package/src/docs/prism/index.ts +6 -0
- package/src/docs/prism/prism.css +158 -0
- package/src/docs/prism/prism.js +1022 -0
- package/src/docs/search/docs-search.json +3767 -0
- package/src/docs/search/markdown-renderer.ts +40 -0
- package/src/docs/search/page.ts +40 -0
- package/src/docs/search/search.ts +184 -0
- package/src/docs.ts +2 -0
- package/src/index.ts +7 -0
- package/{mixins.js → src/mixins.ts} +10 -6
- package/src/tag-list.json +1 -0
- package/src/test-utils/TestUtils.ts +13 -0
- package/src/tsconfig.json +113 -0
- package/{utils.js → src/utils.ts} +15 -11
- package/test-utils/TestUtils.ts +13 -0
- package/vite/config.js +136 -0
- package/vite.config.mts +87 -0
- package/README.md +0 -27
- package/cli.js +0 -74
- package/components.d.ts +0 -4
- package/concorde-core.bundle.js +0 -3427
- package/concorde-core.es.js +0 -14199
- package/core/_types/types.d.ts +0 -28
- package/core/_types/types.js +0 -2
- package/core/components/functional/date/date.d.ts +0 -45
- package/core/components/functional/date/date.js +0 -243
- package/core/components/functional/example/example.d.ts +0 -7
- package/core/components/functional/example/example.js +0 -26
- package/core/components/functional/fetch/fetch.d.ts +0 -93
- package/core/components/functional/functional.js +0 -15
- package/core/components/functional/if/if.d.ts +0 -12
- package/core/components/functional/if/if.js +0 -38
- package/core/components/functional/if/if.test.d.ts +0 -1
- package/core/components/functional/if/if.test.js +0 -35
- package/core/components/functional/list/list.d.ts +0 -117
- package/core/components/functional/list/list.js +0 -214
- package/core/components/functional/mix/mix.d.ts +0 -22
- package/core/components/functional/mix/mix.js +0 -102
- package/core/components/functional/queue/queue.d.ts +0 -67
- package/core/components/functional/queue/queue.js +0 -310
- package/core/components/functional/router/redirect.d.ts +0 -18
- package/core/components/functional/router/redirect.js +0 -53
- package/core/components/functional/router/router.d.ts +0 -27
- package/core/components/functional/router/router.js +0 -119
- package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +0 -58
- package/core/components/functional/sdui/SDUIDescriptorTransformer.js +0 -215
- package/core/components/functional/sdui/sdui-utils.d.ts +0 -5
- package/core/components/functional/sdui/sdui-utils.js +0 -63
- package/core/components/functional/sdui/sdui.d.ts +0 -136
- package/core/components/functional/sdui/sdui.js +0 -254
- package/core/components/functional/sdui/types.d.ts +0 -37
- package/core/components/functional/sdui/types.js +0 -1
- package/core/components/functional/sonic-scope/sonic-scope.d.ts +0 -5
- package/core/components/functional/sonic-scope/sonic-scope.js +0 -21
- package/core/components/functional/states/states.d.ts +0 -29
- package/core/components/functional/states/states.js +0 -134
- package/core/components/functional/submit/submit.d.ts +0 -30
- package/core/components/functional/submit/submit.js +0 -236
- package/core/components/functional/subscriber/subscriber.d.ts +0 -12
- package/core/components/functional/subscriber/subscriber.js +0 -38
- package/core/components/functional/value/value.d.ts +0 -7
- package/core/components/functional/value/value.js +0 -27
- package/core/components/ui/_css/scroll.d.ts +0 -1
- package/core/components/ui/_css/size.d.ts +0 -2
- package/core/components/ui/_css/type.d.ts +0 -2
- package/core/components/ui/alert/alert.d.ts +0 -34
- package/core/components/ui/alert/alert.js +0 -202
- package/core/components/ui/badge/badge.d.ts +0 -26
- package/core/components/ui/button/button.d.ts +0 -171
- package/core/components/ui/captcha/captcha.d.ts +0 -30
- package/core/components/ui/captcha/captcha.js +0 -93
- package/core/components/ui/card/card-footer.d.ts +0 -4
- package/core/components/ui/card/card-footer.js +0 -24
- package/core/components/ui/card/card-header-descripton.d.ts +0 -5
- package/core/components/ui/card/card-header-descripton.js +0 -32
- package/core/components/ui/card/card-header.d.ts +0 -8
- package/core/components/ui/card/card-main.d.ts +0 -4
- package/core/components/ui/card/card-main.js +0 -28
- package/core/components/ui/card/card.d.ts +0 -12
- package/core/components/ui/divider/divider.d.ts +0 -15
- package/core/components/ui/form/checkbox/checkbox.d.ts +0 -181
- package/core/components/ui/form/css/form-control.d.ts +0 -4
- package/core/components/ui/form/fieldset/fieldset.d.ts +0 -23
- package/core/components/ui/form/fieldset/fieldset.js +0 -118
- package/core/components/ui/form/fieldset/legend-description.d.ts +0 -5
- package/core/components/ui/form/fieldset/legend-description.js +0 -30
- package/core/components/ui/form/fieldset/legend.d.ts +0 -16
- package/core/components/ui/form/fieldset/legend.js +0 -112
- package/core/components/ui/form/form-actions/form-actions.d.ts +0 -7
- package/core/components/ui/form/form-actions/form-actions.js +0 -46
- package/core/components/ui/form/form-layout/form-layout.d.ts +0 -12
- package/core/components/ui/form/form-layout/form-layout.js +0 -83
- package/core/components/ui/form/input/input.d.ts +0 -106
- package/core/components/ui/form/input/input.js +0 -268
- package/core/components/ui/form/input/password-helper.d.ts +0 -25
- package/core/components/ui/form/input/password-helper.js +0 -119
- package/core/components/ui/form/input/same-value-helper.d.ts +0 -16
- package/core/components/ui/form/input/same-value-helper.js +0 -77
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +0 -136
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +0 -296
- package/core/components/ui/form/radio/radio.d.ts +0 -12
- package/core/components/ui/form/radio/radio.js +0 -50
- package/core/components/ui/form/select/select.d.ts +0 -58
- package/core/components/ui/form/select/select.js +0 -298
- package/core/components/ui/form/textarea/textarea.d.ts +0 -84
- package/core/components/ui/form/textarea/textarea.js +0 -150
- package/core/components/ui/group/group.d.ts +0 -16
- package/core/components/ui/group/group.js +0 -118
- package/core/components/ui/icon/icon.d.ts +0 -26
- package/core/components/ui/icon/icon.js +0 -113
- package/core/components/ui/icon/icons.d.ts +0 -10
- package/core/components/ui/icon/icons.js +0 -126
- package/core/components/ui/icon/icons.json +0 -1
- package/core/components/ui/image/image.d.ts +0 -15
- package/core/components/ui/image/image.js +0 -153
- package/core/components/ui/link/link.d.ts +0 -29
- package/core/components/ui/link/link.js +0 -124
- package/core/components/ui/loader/loader.d.ts +0 -23
- package/core/components/ui/loader/loader.js +0 -97
- package/core/components/ui/loader/styles/fixed.d.ts +0 -1
- package/core/components/ui/loader/styles/inline.d.ts +0 -1
- package/core/components/ui/menu/menu-item.d.ts +0 -5
- package/core/components/ui/menu/menu-item.js +0 -34
- package/core/components/ui/menu/menu.d.ts +0 -41
- package/core/components/ui/menu/menu.js +0 -313
- package/core/components/ui/modal/modal-actions.d.ts +0 -7
- package/core/components/ui/modal/modal-actions.js +0 -42
- package/core/components/ui/modal/modal-close.d.ts +0 -7
- package/core/components/ui/modal/modal-close.js +0 -43
- package/core/components/ui/modal/modal-content.d.ts +0 -5
- package/core/components/ui/modal/modal-content.js +0 -26
- package/core/components/ui/modal/modal-subtitle.d.ts +0 -5
- package/core/components/ui/modal/modal-subtitle.js +0 -30
- package/core/components/ui/modal/modal-title.d.ts +0 -5
- package/core/components/ui/modal/modal-title.js +0 -29
- package/core/components/ui/modal/modal.d.ts +0 -58
- package/core/components/ui/modal/modal.js +0 -401
- package/core/components/ui/pop/pop.d.ts +0 -37
- package/core/components/ui/pop/pop.js +0 -299
- package/core/components/ui/progress/progress.d.ts +0 -10
- package/core/components/ui/table/table-caption.d.ts +0 -5
- package/core/components/ui/table/table-caption.js +0 -28
- package/core/components/ui/table/table-tbody.d.ts +0 -5
- package/core/components/ui/table/table-tbody.js +0 -39
- package/core/components/ui/table/table-td.d.ts +0 -12
- package/core/components/ui/table/table-td.js +0 -68
- package/core/components/ui/table/table-tfoot.d.ts +0 -5
- package/core/components/ui/table/table-tfoot.js +0 -27
- package/core/components/ui/table/table-th.d.ts +0 -11
- package/core/components/ui/table/table-th.js +0 -73
- package/core/components/ui/table/table-thead.d.ts +0 -5
- package/core/components/ui/table/table-thead.js +0 -25
- package/core/components/ui/table/table-tr.d.ts +0 -13
- package/core/components/ui/table/table-tr.js +0 -66
- package/core/components/ui/table/table.d.ts +0 -17
- package/core/components/ui/theme/theme-collection/core-variables.d.ts +0 -1
- package/core/components/ui/theme/theme-collection/dark.d.ts +0 -1
- package/core/components/ui/theme/theme-collection/light.d.ts +0 -1
- package/core/components/ui/theme/theme.d.ts +0 -19
- package/core/components/ui/theme/theme.js +0 -124
- package/core/components/ui/toast/message-subscriber.d.ts +0 -18
- package/core/components/ui/toast/message-subscriber.js +0 -40
- package/core/components/ui/toast/toast-item.d.ts +0 -19
- package/core/components/ui/toast/toast.d.ts +0 -25
- package/core/components/ui/toast/toast.js +0 -226
- package/core/components/ui/toast/types.d.ts +0 -11
- package/core/components/ui/toast/types.js +0 -1
- package/core/components/ui/tooltip/tooltip.d.ts +0 -10
- package/core/components/ui/ui.d.ts +0 -32
- package/core/core.d.ts +0 -4
- package/core/core.js +0 -19
- package/core/decorators/Subscriber.d.ts +0 -4
- package/core/decorators/Subscriber.js +0 -166
- package/core/directives/DataProvider.d.ts +0 -23
- package/core/directives/DataProvider.js +0 -102
- package/core/directives/Wording.d.ts +0 -42
- package/core/directives/Wording.js +0 -202
- package/core/mixins/Fetcher.d.ts +0 -90
- package/core/mixins/Fetcher.js +0 -242
- package/core/mixins/FormCheckable.d.ts +0 -88
- package/core/mixins/FormCheckable.js +0 -306
- package/core/mixins/FormElement.d.ts +0 -32
- package/core/mixins/FormElement.js +0 -272
- package/core/mixins/FormInput.d.ts +0 -70
- package/core/mixins/FormInput.js +0 -81
- package/core/mixins/Subscriber.d.ts +0 -36
- package/core/mixins/Subscriber.js +0 -333
- package/core/mixins/TemplatesContainer.d.ts +0 -13
- package/core/mixins/TemplatesContainer.js +0 -69
- package/core/mixins/mixins.js +0 -6
- package/core/utils/Arrays.d.ts +0 -97
- package/core/utils/Arrays.js +0 -140
- package/core/utils/DataBindObserver.d.ts +0 -83
- package/core/utils/DataBindObserver.js +0 -264
- package/core/utils/Electron.d.ts +0 -7
- package/core/utils/Electron.js +0 -11
- package/core/utils/Format.d.ts +0 -12
- package/core/utils/Format.js +0 -38
- package/core/utils/HTML.d.ts +0 -42
- package/core/utils/HTML.js +0 -119
- package/core/utils/LocationHandler.d.ts +0 -46
- package/core/utils/LocationHandler.js +0 -133
- package/core/utils/Objects.d.ts +0 -28
- package/core/utils/Objects.js +0 -102
- package/core/utils/PublisherProxy.d.ts +0 -176
- package/core/utils/PublisherProxy.js +0 -709
- package/core/utils/Utils.d.ts +0 -4
- package/core/utils/Utils.js +0 -12
- package/core/utils/api.d.ts +0 -139
- package/core/utils/api.js +0 -391
- package/core/utils/url-pattern.js +0 -2
- package/decorators.d.ts +0 -3
- package/directives.d.ts +0 -40
- package/img/concorde-logo.svg +0 -1
- package/img/concorde.png +0 -0
- package/img/concorde_def.png +0 -0
- package/mixins.d.ts +0 -181
- package/svg/regular/plane.svg +0 -1
- package/svg/solid/plane.svg +0 -1
- package/test-utils/TestUtils.d.ts +0 -4
- package/test-utils/TestUtils.js +0 -12
- package/utils.d.ts +0 -20
- /package/{core/components/functional/functional.d.ts → src/core/components/functional/functional.ts} +0 -0
- /package/{core → src/core}/components/ui/theme/css/tailwind.css +0 -0
- /package/{core → src/core}/components/ui/theme/css/tailwind.d.ts +0 -0
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { LitElement, nothing } from "lit";
|
|
3
|
-
import "@supersoniks/concorde/core/components/ui/loader/loader";
|
|
4
|
-
import "@supersoniks/concorde/core/components/functional/subscriber/subscriber";
|
|
5
|
-
import { DirectiveResult } from "lit/directive";
|
|
6
|
-
import { TemplateContentDirective } from "lit/directives/template-content.js";
|
|
7
|
-
import { TemplateResult } from "lit";
|
|
8
|
-
import { LoaderMode } from "@supersoniks/concorde/core/components/ui/loader/loader";
|
|
9
|
-
/**
|
|
10
|
-
* ### List boucle sur sa propriété "props" et crée des éléments a partir des données en bouclant également sur ses templates.
|
|
11
|
-
*
|
|
12
|
-
* Extends mixins : Fetcher, [Subscriber](./?path=/docs/miscallenous-🔔-subscriber--page)
|
|
13
|
-
*
|
|
14
|
-
* * Si le composant possède un attribut *fetch*, il charge un contenu via un appel d'api web.<br>
|
|
15
|
-
* Voir [fetcher](./?path=/docs/core-components-functional-fetch--basic) pour la configuration des autres attributs.
|
|
16
|
-
* * Chaque élément créé est englobé dans un objet [Subscriber](./?path=/docs/miscallenous-🔔-subscriber--page).<br>
|
|
17
|
-
* Un dataProvider y est associé a l'adresse suivante *dataProvider-de-la-liste$/*index-de-la-ligne-courante*
|
|
18
|
-
* Les données de la ligne sont donc disponible pour les élements internes (subscribers, data-binding)
|
|
19
|
-
* * Lors du chargement un objet loader inline est affiché.
|
|
20
|
-
* * Si le résultat de la requête est un objet, il est imbriqué dans un tableau pour garantir le fonctionnement.<br>
|
|
21
|
-
* Cependant, si l'attribut `extractValues` est présent, les valeurs des propriétés de l'objet sont mises dans dans un tableau pour le rendu.
|
|
22
|
-
* * La propriété _metadata_ est ajoutés à la donnée de chaque item. Elle contient les informations suivantes :
|
|
23
|
-
* * key : l'index de l'item dans la liste
|
|
24
|
-
* * even : true si l'index est pair
|
|
25
|
-
* * odd : true si l'index est impair
|
|
26
|
-
* * onlyChild : true si la liste ne contient qu'un seul item
|
|
27
|
-
* * firstChild : true si l'item est le premier de la liste
|
|
28
|
-
* * lastChild : true si l'item est le dernier de la liste
|
|
29
|
-
* * Si la liste ne contient aucun item, le template "no-item" est utilisé si il est défini.
|
|
30
|
-
* * On peut appler la methode invalidate() sur son publishe pour declencher le rechargement des données
|
|
31
|
-
* *
|
|
32
|
-
*/
|
|
33
|
-
export type ListItemMetadata = {
|
|
34
|
-
key?: string;
|
|
35
|
-
even?: boolean;
|
|
36
|
-
odd?: boolean;
|
|
37
|
-
onlyChild?: boolean;
|
|
38
|
-
firstChild?: boolean;
|
|
39
|
-
lastChild?: boolean;
|
|
40
|
-
};
|
|
41
|
-
declare const List_base: {
|
|
42
|
-
new (...args: any[]): {
|
|
43
|
-
api: import("../../../utils/api").default | null;
|
|
44
|
-
key: string;
|
|
45
|
-
isFirstLoad: boolean;
|
|
46
|
-
isLoading: boolean;
|
|
47
|
-
lazyLoad?: boolean | undefined;
|
|
48
|
-
iObserver: IntersectionObserver | null;
|
|
49
|
-
isFetchEnabled: boolean;
|
|
50
|
-
fetchedData: any;
|
|
51
|
-
_endPoint: string;
|
|
52
|
-
props: import("../../../utils/api").ResultTypeInterface | null;
|
|
53
|
-
endPoint: string;
|
|
54
|
-
requestId: number;
|
|
55
|
-
refetchEveryMs: number;
|
|
56
|
-
refetchTimeOutId?: NodeJS.Timeout | undefined;
|
|
57
|
-
_fetchData(): Promise<void>;
|
|
58
|
-
onInvalidate?: (() => void) | undefined;
|
|
59
|
-
disconnectedCallback(): void;
|
|
60
|
-
connectedCallback(): void;
|
|
61
|
-
lazyLoadSpan?: HTMLSpanElement | undefined;
|
|
62
|
-
handleLazyLoad(): void;
|
|
63
|
-
onIntersection(entries: IntersectionObserverEntry[]): void;
|
|
64
|
-
propertyMap: object;
|
|
65
|
-
isConnected: boolean;
|
|
66
|
-
children: HTMLCollection;
|
|
67
|
-
appendChild(node: Node): Node;
|
|
68
|
-
getAncestorAttributeValue(attributeName: string): string;
|
|
69
|
-
hasAncestorAttribute(attributeName: string): boolean;
|
|
70
|
-
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
71
|
-
publisher: any;
|
|
72
|
-
dataProvider: string | null;
|
|
73
|
-
noShadowDom: string | null;
|
|
74
|
-
debug: HTMLElement | null;
|
|
75
|
-
defferedDebug: boolean | null;
|
|
76
|
-
displayContents: boolean;
|
|
77
|
-
shadowRoot?: ShadowRoot | undefined;
|
|
78
|
-
dispatchEvent(event: Event): void;
|
|
79
|
-
setAttribute(name: string, value: string): void;
|
|
80
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
81
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
82
|
-
removeAttribute(name: string): void;
|
|
83
|
-
initPublisher(): void;
|
|
84
|
-
getApiConfiguration(): import("../../../utils/api").APIConfiguration;
|
|
85
|
-
requestUpdate(): void;
|
|
86
|
-
getAttribute(name: string): string;
|
|
87
|
-
hasAttribute(attributeName: string): boolean;
|
|
88
|
-
getBoundingClientRect(): DOMRect;
|
|
89
|
-
};
|
|
90
|
-
} & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<import("../../../_types/types").CoreJSType>) & (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/TemplatesContainer").TemplatesContainerInterface) & typeof LitElement;
|
|
91
|
-
export declare class List extends List_base {
|
|
92
|
-
itemPropertyMap?: object;
|
|
93
|
-
/**
|
|
94
|
-
* La propriété templateKey contient le nom de la propriété qui sera utilisé pour identifier le template à utiliser dans la donnée de la ligne.
|
|
95
|
-
* Par exemple si templateIdentifier = "name" et que la donnée de la ligne est {name: "myTemplate" ... }, alors le template possédant l'attribut data-value="myTemplate" sera utilisé.
|
|
96
|
-
*/
|
|
97
|
-
templateKey: string;
|
|
98
|
-
/**
|
|
99
|
-
* La propriété idKey est utilisé repérer les lignes de manière unique si pour les item de la liste item[this.idKey] n'existe pas, alors l'index est utilisé
|
|
100
|
-
*/
|
|
101
|
-
idKey: string;
|
|
102
|
-
loader?: LoaderMode | true | "";
|
|
103
|
-
limit: number;
|
|
104
|
-
offset: number;
|
|
105
|
-
connectedCallback(): void;
|
|
106
|
-
disconnectedCallback(): void;
|
|
107
|
-
renderLoader(): TemplateResult<1> | typeof nothing;
|
|
108
|
-
renderSkeleton(): DirectiveResult<import("lit-html/directive").DirectiveClass>;
|
|
109
|
-
renderLoadingState(): DirectiveResult<typeof TemplateContentDirective> | TemplateResult;
|
|
110
|
-
renderNoResultState(): TemplateResult<1>;
|
|
111
|
-
formatProps(): (import("../../../_types/types").CoreJSType[] & {
|
|
112
|
-
_sonic_http_response_?: Response | undefined;
|
|
113
|
-
text?: string | undefined;
|
|
114
|
-
}) | null;
|
|
115
|
-
render(): DirectiveResult<typeof TemplateContentDirective>;
|
|
116
|
-
}
|
|
117
|
-
export {};
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { html, LitElement, nothing } from "lit";
|
|
8
|
-
import { customElement, property } from "lit/decorators.js";
|
|
9
|
-
import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
10
|
-
import Fetcher from "@supersoniks/concorde/core/mixins/Fetcher";
|
|
11
|
-
import { templateContent } from "lit/directives/template-content.js";
|
|
12
|
-
import "@supersoniks/concorde/core/components/ui/loader/loader";
|
|
13
|
-
import "@supersoniks/concorde/core/components/functional/subscriber/subscriber";
|
|
14
|
-
import Objects from "@supersoniks/concorde/core/utils/Objects";
|
|
15
|
-
import TemplatesContainer from "@supersoniks/concorde/core/mixins/TemplatesContainer";
|
|
16
|
-
const tagName = "sonic-list";
|
|
17
|
-
let List = class List extends Fetcher(Subscriber(TemplatesContainer(LitElement))) {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
/**
|
|
21
|
-
* La propriété templateKey contient le nom de la propriété qui sera utilisé pour identifier le template à utiliser dans la donnée de la ligne.
|
|
22
|
-
* Par exemple si templateIdentifier = "name" et que la donnée de la ligne est {name: "myTemplate" ... }, alors le template possédant l'attribut data-value="myTemplate" sera utilisé.
|
|
23
|
-
*/
|
|
24
|
-
this.templateKey = "template";
|
|
25
|
-
/**
|
|
26
|
-
* La propriété idKey est utilisé repérer les lignes de manière unique si pour les item de la liste item[this.idKey] n'existe pas, alors l'index est utilisé
|
|
27
|
-
*/
|
|
28
|
-
this.idKey = "id";
|
|
29
|
-
this.limit = Number.POSITIVE_INFINITY;
|
|
30
|
-
this.offset = 0;
|
|
31
|
-
}
|
|
32
|
-
connectedCallback() {
|
|
33
|
-
this.noShadowDom = "";
|
|
34
|
-
this.defferedDebug = this.hasAttribute("debug") || null;
|
|
35
|
-
this.isFetchEnabled = this.hasAttribute("fetch");
|
|
36
|
-
if (this.isFetchEnabled)
|
|
37
|
-
this.isLoading = true;
|
|
38
|
-
super.connectedCallback();
|
|
39
|
-
}
|
|
40
|
-
disconnectedCallback() {
|
|
41
|
-
super.disconnectedCallback();
|
|
42
|
-
}
|
|
43
|
-
renderLoader() {
|
|
44
|
-
if (!(this.isLoading && this.loader !== undefined))
|
|
45
|
-
return nothing;
|
|
46
|
-
const template = this.templateParts["skeleton"];
|
|
47
|
-
if (template)
|
|
48
|
-
return nothing;
|
|
49
|
-
const loader = this.loader === true || this.loader === "" ? "fixed" : this.loader;
|
|
50
|
-
return html `<sonic-loader mode=${loader}></sonic-loader>`;
|
|
51
|
-
}
|
|
52
|
-
renderSkeleton() {
|
|
53
|
-
const template = this.templateParts["skeleton"];
|
|
54
|
-
if (!(this.isLoading && template))
|
|
55
|
-
return nothing;
|
|
56
|
-
return templateContent(template);
|
|
57
|
-
}
|
|
58
|
-
renderLoadingState() {
|
|
59
|
-
return html `${this.renderSkeleton()} ${this.renderLoader()}`;
|
|
60
|
-
}
|
|
61
|
-
renderNoResultState() {
|
|
62
|
-
return html ` <div
|
|
63
|
-
style="color: var(--sc-base-400);
|
|
64
|
-
font-size: 1.5em;
|
|
65
|
-
margin: 4rem 0;
|
|
66
|
-
display: flex;
|
|
67
|
-
gap: 0.5rem;"
|
|
68
|
-
>
|
|
69
|
-
<sonic-icon name="emoji-puzzled" size="lg"></sonic-icon
|
|
70
|
-
><span class="sonic-no-result-text">${typeof this.props === "string" && this.props == "" ? "Aucun résultat" : this.props}</span>
|
|
71
|
-
</div>`;
|
|
72
|
-
}
|
|
73
|
-
formatProps() {
|
|
74
|
-
let props = this.props;
|
|
75
|
-
if (props == null) {
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
const response = props._sonic_http_response_;
|
|
79
|
-
const extractValues = this.hasAttribute("extractValues");
|
|
80
|
-
//si props n'est pas un tableau on l'adapte
|
|
81
|
-
if (!Array.isArray(props)) {
|
|
82
|
-
if (extractValues) {
|
|
83
|
-
props = Object.entries(props).map(([k, v]) => ({ key: k, value: v }));
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
if (Objects.isObject(props) && Object.keys(props).length > 0 && (!response || response.ok))
|
|
87
|
-
props = [props];
|
|
88
|
-
else {
|
|
89
|
-
props = [];
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
props = props.filter((e) => e != null);
|
|
94
|
-
if (response)
|
|
95
|
-
props._sonic_http_response_ = response;
|
|
96
|
-
return props;
|
|
97
|
-
}
|
|
98
|
-
render() {
|
|
99
|
-
/**
|
|
100
|
-
* Loading
|
|
101
|
-
*/
|
|
102
|
-
const isLoadingState = this.isLoading && !Array.isArray(this.props);
|
|
103
|
-
if (isLoadingState)
|
|
104
|
-
return this.renderLoadingState();
|
|
105
|
-
/**
|
|
106
|
-
* Si props est une string on considère qu'il n'y a pas de résultats
|
|
107
|
-
*/
|
|
108
|
-
const isString = typeof this.props === "string";
|
|
109
|
-
if (isString)
|
|
110
|
-
return this.renderNoResultState();
|
|
111
|
-
/**
|
|
112
|
-
* si props mal formé ou null on retourne une div vide (nécessaire pour le lazyload)
|
|
113
|
-
*/
|
|
114
|
-
const propsIsBaddlyFormatted = !Objects.isObject(this.props);
|
|
115
|
-
if (propsIsBaddlyFormatted)
|
|
116
|
-
return html `<div></div>`;
|
|
117
|
-
/**
|
|
118
|
-
* On format les props pour les rendre compatibles avec le fonctionnement du rendu en fonction du paramétrage du composant (cf : "extractValues" )
|
|
119
|
-
*/
|
|
120
|
-
const props = this.formatProps();
|
|
121
|
-
/**
|
|
122
|
-
* On peut définir un template spécifique si le résultat est un tableau vide
|
|
123
|
-
*/
|
|
124
|
-
if ((props?.length || 0) == 0 && this.templateParts["no-item"]) {
|
|
125
|
-
return templateContent(this.templateParts["no-item"]);
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Rendu des lignes
|
|
129
|
-
* */
|
|
130
|
-
const templateCount = this.templateList.length;
|
|
131
|
-
let counter = -1;
|
|
132
|
-
const extractValues = this.hasAttribute("extractValues");
|
|
133
|
-
const separator = this.templateParts["separator"];
|
|
134
|
-
const length = props?.length || 0;
|
|
135
|
-
const items = props?.slice(this.offset, this.offset + this.limit);
|
|
136
|
-
return html `
|
|
137
|
-
${items?.map((item, index) => {
|
|
138
|
-
if (item == null)
|
|
139
|
-
return nothing;
|
|
140
|
-
let templatePart = null;
|
|
141
|
-
let key = index;
|
|
142
|
-
if (typeof item == "object" && !Array.isArray(item)) {
|
|
143
|
-
const templatePartName = item[this.templateKey];
|
|
144
|
-
if (templatePartName && typeof templatePartName == "string") {
|
|
145
|
-
templatePart = this.templateParts[templatePartName];
|
|
146
|
-
}
|
|
147
|
-
if (extractValues)
|
|
148
|
-
key = item?.["key"];
|
|
149
|
-
}
|
|
150
|
-
if (key == "_sonic_http_response_")
|
|
151
|
-
return nothing;
|
|
152
|
-
if (typeof key != "string" && typeof key != "number")
|
|
153
|
-
return nothing;
|
|
154
|
-
const isLastChild = index >= length - 1;
|
|
155
|
-
const indexMod2 = index % 2;
|
|
156
|
-
const childPublisher = this.publisher[key];
|
|
157
|
-
/**
|
|
158
|
-
* Ajout de metatdonnées au publisher de l'enfant
|
|
159
|
-
*/
|
|
160
|
-
//La prop key est gardée pour le moment pour compatibilité
|
|
161
|
-
//TODO : supprimer la prop key cquand c'est ok côté covoit.
|
|
162
|
-
childPublisher._key_ = key + "";
|
|
163
|
-
childPublisher._metadata_ = {
|
|
164
|
-
...childPublisher._metadata_.get(),
|
|
165
|
-
key: key,
|
|
166
|
-
even: indexMod2 == 0,
|
|
167
|
-
odd: indexMod2 == 1,
|
|
168
|
-
onlyChild: length == 1,
|
|
169
|
-
firstChild: index == 0,
|
|
170
|
-
lastChild: isLastChild,
|
|
171
|
-
};
|
|
172
|
-
counter++;
|
|
173
|
-
if (templatePart)
|
|
174
|
-
counter = -1;
|
|
175
|
-
return (item &&
|
|
176
|
-
html `
|
|
177
|
-
<sonic-subscriber
|
|
178
|
-
?debug=${this.defferedDebug === true}
|
|
179
|
-
.bindPublisher=${function () {
|
|
180
|
-
return childPublisher;
|
|
181
|
-
}}
|
|
182
|
-
.propertyMap?=${this.itemPropertyMap}
|
|
183
|
-
dataProvider="${this.dataProvider}/list-item/${key}"
|
|
184
|
-
>
|
|
185
|
-
${templatePart ? templateContent(templatePart) : templateContent(this.templateList[counter % templateCount])}
|
|
186
|
-
</sonic-subscriber>
|
|
187
|
-
${separator && !isLastChild ? templateContent(separator) : nothing}
|
|
188
|
-
`);
|
|
189
|
-
})}
|
|
190
|
-
`;
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
__decorate([
|
|
194
|
-
property({ type: Object })
|
|
195
|
-
], List.prototype, "itemPropertyMap", void 0);
|
|
196
|
-
__decorate([
|
|
197
|
-
property({ type: String })
|
|
198
|
-
], List.prototype, "templateKey", void 0);
|
|
199
|
-
__decorate([
|
|
200
|
-
property({ type: String })
|
|
201
|
-
], List.prototype, "idKey", void 0);
|
|
202
|
-
__decorate([
|
|
203
|
-
property()
|
|
204
|
-
], List.prototype, "loader", void 0);
|
|
205
|
-
__decorate([
|
|
206
|
-
property()
|
|
207
|
-
], List.prototype, "limit", void 0);
|
|
208
|
-
__decorate([
|
|
209
|
-
property()
|
|
210
|
-
], List.prototype, "offset", void 0);
|
|
211
|
-
List = __decorate([
|
|
212
|
-
customElement(tagName)
|
|
213
|
-
], List);
|
|
214
|
-
export { List };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
2
|
-
import { PublisherInterface, PublisherContentType } from "@supersoniks/concorde/core/_types/types";
|
|
3
|
-
type Composition = Record<string, object | string>;
|
|
4
|
-
type Listener = {
|
|
5
|
-
publisher: PublisherInterface;
|
|
6
|
-
subscriber: <T>(v: T) => void;
|
|
7
|
-
};
|
|
8
|
-
declare const SonicMix_base: (new (...args: any[]) => import("../../../mixins/Subscriber").SubscriberInterface<import("@supersoniks/concorde/core/_types/types").CoreJSType>) & typeof LitElement;
|
|
9
|
-
export default class SonicMix extends SonicMix_base {
|
|
10
|
-
static styles: import("lit").CSSResult[];
|
|
11
|
-
private _composition;
|
|
12
|
-
get composition(): Composition;
|
|
13
|
-
set composition(value: Composition);
|
|
14
|
-
connectedCallback(): void;
|
|
15
|
-
disconnectedCallback(): void;
|
|
16
|
-
updateComposition(): void;
|
|
17
|
-
listeners: Listener[];
|
|
18
|
-
removePublisherListeners(): void;
|
|
19
|
-
parseComposition<T extends PublisherContentType = PublisherContentType>(composition: Composition, publisher: PublisherInterface<T>): void;
|
|
20
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { PublisherProxy } from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
8
|
-
import { Subscriber } from "@supersoniks/concorde/mixins";
|
|
9
|
-
import { Objects, PublisherManager } from "@supersoniks/concorde/utils";
|
|
10
|
-
import { LitElement, html, css } from "lit";
|
|
11
|
-
import { customElement, property } from "lit/decorators.js";
|
|
12
|
-
let SonicMix = class SonicMix extends Subscriber(LitElement) {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this._composition = {};
|
|
16
|
-
this.listeners = [];
|
|
17
|
-
}
|
|
18
|
-
get composition() {
|
|
19
|
-
return this._composition;
|
|
20
|
-
}
|
|
21
|
-
set composition(value) {
|
|
22
|
-
this._composition = value;
|
|
23
|
-
this.updateComposition();
|
|
24
|
-
}
|
|
25
|
-
connectedCallback() {
|
|
26
|
-
super.connectedCallback();
|
|
27
|
-
this.updateComposition();
|
|
28
|
-
}
|
|
29
|
-
disconnectedCallback() {
|
|
30
|
-
this.removePublisherListeners();
|
|
31
|
-
super.disconnectedCallback();
|
|
32
|
-
}
|
|
33
|
-
updateComposition() {
|
|
34
|
-
this.removePublisherListeners();
|
|
35
|
-
if (!this.publisher)
|
|
36
|
-
return;
|
|
37
|
-
this.publisher.set({});
|
|
38
|
-
this.parseComposition(this.composition, this.publisher);
|
|
39
|
-
}
|
|
40
|
-
removePublisherListeners() {
|
|
41
|
-
const listeners = this.listeners;
|
|
42
|
-
this.listeners = [];
|
|
43
|
-
listeners.forEach((listener) => {
|
|
44
|
-
this.publisher.offAssign(listener.subscriber);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
parseComposition(composition, publisher) {
|
|
48
|
-
if (!composition)
|
|
49
|
-
return;
|
|
50
|
-
for (const z in composition) {
|
|
51
|
-
const value = composition[z];
|
|
52
|
-
if (typeof value === "string") {
|
|
53
|
-
const split = value.split(".");
|
|
54
|
-
const first = split.shift();
|
|
55
|
-
if (!first)
|
|
56
|
-
continue;
|
|
57
|
-
let publisherSource = PublisherManager.get(first);
|
|
58
|
-
publisherSource = Objects.traverse(publisherSource, split);
|
|
59
|
-
const publisherSubscriber = {
|
|
60
|
-
publisher: publisherSource,
|
|
61
|
-
subscriber: (v) => {
|
|
62
|
-
publisher[z] = v;
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
this.listeners.push(publisherSubscriber);
|
|
66
|
-
publisherSource.onAssign(publisherSubscriber.subscriber);
|
|
67
|
-
publisher._proxies_.set(z, publisherSource);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
this.publisher[z] = {};
|
|
71
|
-
const newPublisher = new PublisherProxy({}, publisher);
|
|
72
|
-
publisher._proxies_.set(z, newPublisher);
|
|
73
|
-
const publisherSubscriber = {
|
|
74
|
-
publisher: newPublisher,
|
|
75
|
-
subscriber: (v) => {
|
|
76
|
-
publisher[z] = v;
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
this.listeners.push(publisherSubscriber);
|
|
80
|
-
newPublisher.onAssign(publisherSubscriber.subscriber);
|
|
81
|
-
this.parseComposition(value, newPublisher);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
render() {
|
|
86
|
-
return html `<slot></slot>`;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
SonicMix.styles = [
|
|
90
|
-
css `
|
|
91
|
-
:host {
|
|
92
|
-
display: contents;
|
|
93
|
-
}
|
|
94
|
-
`,
|
|
95
|
-
];
|
|
96
|
-
__decorate([
|
|
97
|
-
property({ type: Object })
|
|
98
|
-
], SonicMix.prototype, "composition", null);
|
|
99
|
-
SonicMix = __decorate([
|
|
100
|
-
customElement("sonic-mix")
|
|
101
|
-
], SonicMix);
|
|
102
|
-
export default SonicMix;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { LitElement, nothing } from "lit";
|
|
2
|
-
import "@supersoniks/concorde/core/components/functional/list/list";
|
|
3
|
-
import { PublisherProxy } from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
4
|
-
type QueueItem = {
|
|
5
|
-
id: string;
|
|
6
|
-
endPoint: string;
|
|
7
|
-
dataProvider: string;
|
|
8
|
-
offset: number;
|
|
9
|
-
limit: number;
|
|
10
|
-
};
|
|
11
|
-
type QueueProps = QueueItem[] & {
|
|
12
|
-
resultCount?: number;
|
|
13
|
-
lastFetchedData?: unknown;
|
|
14
|
-
};
|
|
15
|
-
declare const Queue_base: (new (...args: any[]) => import("@supersoniks/concorde/core/mixins/Subscriber").SubscriberInterface<QueueProps>) & typeof LitElement;
|
|
16
|
-
/**
|
|
17
|
-
*### Une Queue charge du contenu par lot selon l'expression renseignée dans l'attribut *dataProviderExpression*.
|
|
18
|
-
* * Chaque lot est chargé par un composant [List](./?path=/docs/core-components-functional-list-list--basic) dont le dataProvider créé à partir de l'attribut dataProviderExpression
|
|
19
|
-
* * A l'initialisation elle regarde l'attribut dataFilterProvider qui donne l'adresse d'un publisher
|
|
20
|
-
* Si cet attribut est touvé, Queue écoute le publisher fourni et se réinitialise à chaque modification du contenu de celui-ci.
|
|
21
|
-
* Les valeurs renseignées dans ce publisher sont ajoutées en get à chaque requête
|
|
22
|
-
* * la proriété *key* peut être utilisé pour cibler une propriété particulière du retour de l'api.
|
|
23
|
-
*/
|
|
24
|
-
export default class Queue extends Queue_base {
|
|
25
|
-
templates: Array<HTMLTemplateElement> | null;
|
|
26
|
-
lastRequestTime: number;
|
|
27
|
-
key: string;
|
|
28
|
-
itemPropertyMap: object | null;
|
|
29
|
-
/**
|
|
30
|
-
* Durée cible en ms d'une requête pour afficher 1 lot.
|
|
31
|
-
*/
|
|
32
|
-
cache: RequestCache;
|
|
33
|
-
targetRequestDuration: number;
|
|
34
|
-
limit: number;
|
|
35
|
-
lazyBoundsRatio: number;
|
|
36
|
-
offset: number;
|
|
37
|
-
resultCount: number;
|
|
38
|
-
noLazyload: boolean;
|
|
39
|
-
filteredFields: string;
|
|
40
|
-
disconnectedCallback(): void;
|
|
41
|
-
static instanceCounter: number;
|
|
42
|
-
instanceId: number;
|
|
43
|
-
localStorage: string;
|
|
44
|
-
connectedCallback(): Promise<void>;
|
|
45
|
-
filterPublisher: PublisherProxy | null;
|
|
46
|
-
configFilter(): void;
|
|
47
|
-
filterTimeoutId?: ReturnType<typeof setTimeout>;
|
|
48
|
-
filterTimeoutMs: number;
|
|
49
|
-
searchHash: string;
|
|
50
|
-
requestId: number;
|
|
51
|
-
isFirstRequest: boolean;
|
|
52
|
-
updateFilteredContent: () => void;
|
|
53
|
-
/**
|
|
54
|
-
* Cette expression est utilisée comme modèle par le composant Queue pour renseigngner le dataProvider de la [liste](./?path=/docs/core-components-functional-list-list--basic) créée.
|
|
55
|
-
* * l'expression *$offset* est alors remplacée par le numéro de l'élément à partir duquel démarrer
|
|
56
|
-
* * l'expression *$limit* est remplacée par la valeur représentant le nombre d'éléments à charger
|
|
57
|
-
* * Si pas d'expression *$offset* le composant se comporte un peu comme une liste, il ne va pas essayer de charger les éléments suivants
|
|
58
|
-
*/
|
|
59
|
-
dataProviderExpression: string;
|
|
60
|
-
idKey: string;
|
|
61
|
-
resetDuration(): void;
|
|
62
|
-
listDataProviders: string[];
|
|
63
|
-
nextHadEvent: boolean;
|
|
64
|
-
next(e?: CustomEvent): void;
|
|
65
|
-
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
66
|
-
}
|
|
67
|
-
export {};
|