@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
package/core/utils/Utils.d.ts
DELETED
package/core/utils/Utils.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export default class Utils {
|
|
2
|
-
static async queueTaskPromise() {
|
|
3
|
-
return new Promise((resolve) => {
|
|
4
|
-
window.queueMicrotask(() => resolve(null));
|
|
5
|
-
});
|
|
6
|
-
}
|
|
7
|
-
static async delayPromise(timeoutMs) {
|
|
8
|
-
return new Promise((resolve) => {
|
|
9
|
-
setTimeout(resolve, timeoutMs);
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
}
|
package/core/utils/api.d.ts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { CoreJSType } from "@supersoniks/concorde/core/_types/types";
|
|
2
|
-
export type APIConfiguration = {
|
|
3
|
-
serviceURL: string | null;
|
|
4
|
-
/** un flag pour indiquer de bloquer les appels suivant au même serviceurl tant que celuis-ci n'a pas terminé */
|
|
5
|
-
blockUntilDone?: boolean;
|
|
6
|
-
token: string | null;
|
|
7
|
-
userName: string | null;
|
|
8
|
-
password: string | null;
|
|
9
|
-
authToken: string | null;
|
|
10
|
-
tokenProvider: string | null;
|
|
11
|
-
addHTTPResponse?: boolean;
|
|
12
|
-
credentials?: RequestCredentials;
|
|
13
|
-
cache?: RequestCache;
|
|
14
|
-
};
|
|
15
|
-
export type CallState = "loading" | "done" | "error" | undefined;
|
|
16
|
-
export type ResultTypeInterface = CoreJSType & {
|
|
17
|
-
_sonic_http_response_?: Response;
|
|
18
|
-
text?: string;
|
|
19
|
-
};
|
|
20
|
-
export type APICall = {
|
|
21
|
-
apiMethod: "get" | "send" | "submitFormData";
|
|
22
|
-
path: string;
|
|
23
|
-
additionalHeaders: HeadersInit | undefined;
|
|
24
|
-
method?: string | undefined;
|
|
25
|
-
data?: unknown;
|
|
26
|
-
cache?: RequestCache;
|
|
27
|
-
};
|
|
28
|
-
declare class API {
|
|
29
|
-
/**
|
|
30
|
-
* Ce tableau static permet de ne pas appeler plusieurs fois le même service lors d'appel concurrents en GET.
|
|
31
|
-
*/
|
|
32
|
-
static loadingGetPromises: Map<string, Promise<unknown>>;
|
|
33
|
-
/**
|
|
34
|
-
* L'url de base du service sans endpoint
|
|
35
|
-
*/
|
|
36
|
-
serviceURL: string | null;
|
|
37
|
-
/**
|
|
38
|
-
* le nom de l'utilisateur si basic auth est utilisé
|
|
39
|
-
*/
|
|
40
|
-
userName: string | null;
|
|
41
|
-
/**
|
|
42
|
-
* le password de l'utilisateur si basic auth est utilisé
|
|
43
|
-
*/
|
|
44
|
-
password: string | null;
|
|
45
|
-
/**
|
|
46
|
-
* le bearer token a passer pour les appels REST
|
|
47
|
-
*/
|
|
48
|
-
private _token;
|
|
49
|
-
set token(token: string | null | undefined);
|
|
50
|
-
get token(): string | null | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* Le endPoint pour obtenir le bearer token qui sera concaténé à l'url du service
|
|
53
|
-
*/
|
|
54
|
-
tokenProvider: string | null;
|
|
55
|
-
/**
|
|
56
|
-
* le bearer token à passer pour un éventuel renouvellement de token automatique
|
|
57
|
-
*/
|
|
58
|
-
authToken: string | null;
|
|
59
|
-
/**
|
|
60
|
-
* credentials
|
|
61
|
-
*/
|
|
62
|
-
credentials?: RequestCredentials;
|
|
63
|
-
/**
|
|
64
|
-
* Tableau static des tokens stokés en memoire vive (comportement à revoir à l'occasion)
|
|
65
|
-
*/
|
|
66
|
-
static tokens: Map<string | null, string | null | undefined>;
|
|
67
|
-
/**
|
|
68
|
-
* Tableau stockant l'ensemble des tokens invalides
|
|
69
|
-
*/
|
|
70
|
-
static invalidTokens: (string | null | undefined)[];
|
|
71
|
-
handleInvalidToken(token: string | null | undefined): void;
|
|
72
|
-
/**
|
|
73
|
-
* Tableau static des tentatives échouées de récupération auto du token
|
|
74
|
-
*/
|
|
75
|
-
static failledTokenUpdates: Map<string | null, true>;
|
|
76
|
-
/**
|
|
77
|
-
* Tableau static des flags pour savoir si le premier appel a été fait pour chaque serviceURL
|
|
78
|
-
*/
|
|
79
|
-
static firstCallDoneFlags: Map<string | null, CallState>;
|
|
80
|
-
/**
|
|
81
|
-
* Le endPoint pour obtenir le bearer token qui sera concaténé à l'url du service
|
|
82
|
-
*/
|
|
83
|
-
addHTTPResponse: boolean;
|
|
84
|
-
cache: RequestCache;
|
|
85
|
-
lastResult?: Response;
|
|
86
|
-
isServiceSimulated: boolean;
|
|
87
|
-
blockUntilDone: boolean;
|
|
88
|
-
constructor(config: APIConfiguration);
|
|
89
|
-
handleResult(fetchResult: Response, lastCall: APICall): Promise<ResultTypeInterface>;
|
|
90
|
-
/**
|
|
91
|
-
* Basic auth
|
|
92
|
-
*/
|
|
93
|
-
auth(): Promise<void>;
|
|
94
|
-
/**
|
|
95
|
-
* avec localget, on ne passe pas par le système de token
|
|
96
|
-
* on recupère path sans les searchparams nommée pathWithoutSearchParams
|
|
97
|
-
* on cherche dans PublisherManager.get(pathWithoutSearchParams).get() les données qui matchent les searchparams présents dans path
|
|
98
|
-
* on retourne les données selon le même format que le retour de get
|
|
99
|
-
*
|
|
100
|
-
* @todo netttoyer
|
|
101
|
-
*/
|
|
102
|
-
localGet<T>(dataProvider: string, searchString: string): Promise<T & ResultTypeInterface>;
|
|
103
|
-
/**
|
|
104
|
-
* firstCallDone is a function that returns a promise that is resolved when the first call to the API is done for each serviceURL whatever api instance is used
|
|
105
|
-
*/
|
|
106
|
-
firstCallDone(): Promise<unknown>;
|
|
107
|
-
get<T>(path: string, additionalHeaders?: HeadersInit): Promise<T & ResultTypeInterface>;
|
|
108
|
-
/**
|
|
109
|
-
* Création du header, avec authentification si besoin
|
|
110
|
-
* ajout du language via le header accept-language qui contient le langue du navigateur
|
|
111
|
-
*/
|
|
112
|
-
createHeaders(additionalHeaders?: HeadersInit): Promise<Record<string, string>>;
|
|
113
|
-
/**
|
|
114
|
-
* Concatène le serviceURL et le endpoint donné en paramètre
|
|
115
|
-
*/
|
|
116
|
-
computeURL(path: string, query?: Record<string, string>): string;
|
|
117
|
-
send<T, SendType = CoreJSType>(path: string, data: SendType, method?: string, additionalHeaders?: HeadersInit): Promise<T & ResultTypeInterface>;
|
|
118
|
-
/**
|
|
119
|
-
* Agit comme une soumission de formulaire, mais attends un json en réponse
|
|
120
|
-
*/
|
|
121
|
-
submitFormData<T, SendType = CoreJSType>(path: string, data: SendType, method?: string, additionalHeaders?: HeadersInit): Promise<T & ResultTypeInterface>;
|
|
122
|
-
/**
|
|
123
|
-
* Appel send en utilisant le méthode PUT
|
|
124
|
-
*/
|
|
125
|
-
put<T, SendType = CoreJSType>(path: string, data: SendType, additionalHeaders?: HeadersInit): Promise<T & ResultTypeInterface>;
|
|
126
|
-
/**
|
|
127
|
-
* Appel send en utilisant le méthode POST
|
|
128
|
-
*/
|
|
129
|
-
post<T, SendType = CoreJSType>(path: string, data: SendType, additionalHeaders?: HeadersInit): Promise<T & ResultTypeInterface>;
|
|
130
|
-
/**
|
|
131
|
-
* Appel send en utilisant le méthode PATCH
|
|
132
|
-
*/
|
|
133
|
-
patch<T, SendType = CoreJSType>(path: string, data: SendType, additionalHeaders?: HeadersInit): Promise<T & ResultTypeInterface>;
|
|
134
|
-
/**
|
|
135
|
-
* Appel send en utilisant le méthode delete
|
|
136
|
-
*/
|
|
137
|
-
delete<T, SendType = CoreJSType>(path: string, data: SendType, additionalHeaders?: HeadersInit): Promise<T & ResultTypeInterface>;
|
|
138
|
-
}
|
|
139
|
-
export default API;
|
package/core/utils/api.js
DELETED
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
// on désactive une regle eslint pour ce fichier
|
|
2
|
-
/* eslint no-async-promise-executor: 0 */ // --> OFF
|
|
3
|
-
import HTML from "@supersoniks/concorde/core/utils/HTML";
|
|
4
|
-
import Objects from "@supersoniks/concorde/core/utils/Objects";
|
|
5
|
-
import { PublisherManager } from "./PublisherProxy";
|
|
6
|
-
class API {
|
|
7
|
-
set token(token) {
|
|
8
|
-
this._token = token;
|
|
9
|
-
if (!token) {
|
|
10
|
-
API.tokens.delete(this.serviceURL);
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
if (API.invalidTokens.includes(token))
|
|
14
|
-
return;
|
|
15
|
-
API.tokens.set(this.serviceURL, token);
|
|
16
|
-
}
|
|
17
|
-
get token() {
|
|
18
|
-
// si le token est marqué invalide, on utilise utilise la dernière version valide connue du token pour ce serviceURL
|
|
19
|
-
return API.invalidTokens.includes(this._token) ? API.tokens.get(this.serviceURL) : this._token;
|
|
20
|
-
}
|
|
21
|
-
handleInvalidToken(token) {
|
|
22
|
-
if (!token)
|
|
23
|
-
return;
|
|
24
|
-
if (API.invalidTokens.includes(token))
|
|
25
|
-
return;
|
|
26
|
-
API.invalidTokens.push(token);
|
|
27
|
-
this.token = null;
|
|
28
|
-
}
|
|
29
|
-
constructor(config) {
|
|
30
|
-
/**
|
|
31
|
-
* Le endPoint pour obtenir le bearer token qui sera concaténé à l'url du service
|
|
32
|
-
*/
|
|
33
|
-
this.addHTTPResponse = false;
|
|
34
|
-
this.cache = "default";
|
|
35
|
-
this.isServiceSimulated = false;
|
|
36
|
-
this.blockUntilDone = false;
|
|
37
|
-
this.serviceURL = config.serviceURL;
|
|
38
|
-
this.blockUntilDone = config.blockUntilDone || false;
|
|
39
|
-
if (this.serviceURL == "publisher://") {
|
|
40
|
-
this.isServiceSimulated = true;
|
|
41
|
-
}
|
|
42
|
-
if (!this.serviceURL)
|
|
43
|
-
this.serviceURL = document.location.origin;
|
|
44
|
-
this.userName = config.userName;
|
|
45
|
-
this.password = config.password;
|
|
46
|
-
if (config.token)
|
|
47
|
-
this.token = config.token;
|
|
48
|
-
this.tokenProvider = config.tokenProvider;
|
|
49
|
-
this.authToken = config.authToken;
|
|
50
|
-
this.addHTTPResponse = config.addHTTPResponse || false;
|
|
51
|
-
this.credentials = config.credentials;
|
|
52
|
-
this.cache = config.cache || "default";
|
|
53
|
-
}
|
|
54
|
-
async handleResult(fetchResult, lastCall) {
|
|
55
|
-
API.firstCallDoneFlags.set(this.serviceURL, "done");
|
|
56
|
-
this.lastResult = fetchResult;
|
|
57
|
-
const contentType = fetchResult.headers.get("content-type")?.toLowerCase();
|
|
58
|
-
const httpCode = fetchResult.status;
|
|
59
|
-
let result = {};
|
|
60
|
-
if (!contentType || contentType.indexOf("text/") == 0) {
|
|
61
|
-
const str = await fetchResult.text();
|
|
62
|
-
result = { text: str };
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
try {
|
|
66
|
-
result = await fetchResult.json();
|
|
67
|
-
}
|
|
68
|
-
catch (e) {
|
|
69
|
-
result = {};
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (this.addHTTPResponse && Objects.isObject(result)) {
|
|
73
|
-
result._sonic_http_response_ = fetchResult;
|
|
74
|
-
}
|
|
75
|
-
if (httpCode === 498 && !API.failledTokenUpdates.has(this.serviceURL)) {
|
|
76
|
-
this.handleInvalidToken(this.token);
|
|
77
|
-
if (lastCall.apiMethod === "get") {
|
|
78
|
-
result = await this[lastCall.apiMethod](lastCall.path, lastCall.additionalHeaders);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
result = await this[lastCall.apiMethod](lastCall.path, lastCall.data, lastCall.method, lastCall.additionalHeaders);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Basic auth
|
|
88
|
-
*/
|
|
89
|
-
async auth() {
|
|
90
|
-
if (this.token)
|
|
91
|
-
return;
|
|
92
|
-
if (API.tokens.has(this.serviceURL)) {
|
|
93
|
-
this.token = API.tokens.get(this.serviceURL);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
if (!this.tokenProvider)
|
|
97
|
-
return;
|
|
98
|
-
let headers = {};
|
|
99
|
-
if (this.userName && this.password) {
|
|
100
|
-
headers = {
|
|
101
|
-
Authorization: "Basic " + window.btoa(unescape(encodeURIComponent(this.userName + ":" + this.password))),
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
else if (this.authToken) {
|
|
105
|
-
headers = {
|
|
106
|
-
Authorization: "Bearer " + this.authToken,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
const serviceURL = new URL(this.serviceURL);
|
|
110
|
-
const serviceHost = serviceURL.protocol + "//" + serviceURL.host;
|
|
111
|
-
const result = await fetch(this.computeURL(this.tokenProvider, { serviceHost: serviceHost }), {
|
|
112
|
-
headers: headers,
|
|
113
|
-
credentials: this.credentials,
|
|
114
|
-
});
|
|
115
|
-
try {
|
|
116
|
-
const json = await result.json();
|
|
117
|
-
const newToken = json.token;
|
|
118
|
-
if (newToken) {
|
|
119
|
-
this.token = json.token;
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
API.failledTokenUpdates.set(this.serviceURL, true);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
catch (e) {
|
|
126
|
-
API.failledTokenUpdates.set(this.serviceURL, true);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* avec localget, on ne passe pas par le système de token
|
|
131
|
-
* on recupère path sans les searchparams nommée pathWithoutSearchParams
|
|
132
|
-
* on cherche dans PublisherManager.get(pathWithoutSearchParams).get() les données qui matchent les searchparams présents dans path
|
|
133
|
-
* on retourne les données selon le même format que le retour de get
|
|
134
|
-
*
|
|
135
|
-
* @todo netttoyer
|
|
136
|
-
*/
|
|
137
|
-
async localGet(dataProvider, searchString) {
|
|
138
|
-
const publisher = PublisherManager.get(dataProvider);
|
|
139
|
-
console.log(publisher);
|
|
140
|
-
const searchParams = new URLSearchParams(searchString.split("?")[1] || "");
|
|
141
|
-
const dataObject = publisher.get();
|
|
142
|
-
let data = [];
|
|
143
|
-
if (!Array.isArray(dataObject)) {
|
|
144
|
-
data = [dataObject];
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
data = dataObject;
|
|
148
|
-
}
|
|
149
|
-
const result = [];
|
|
150
|
-
let limit = Number.POSITIVE_INFINITY;
|
|
151
|
-
let offset = 0;
|
|
152
|
-
let limitOffsetparams = 0;
|
|
153
|
-
if (searchParams.has("limit")) {
|
|
154
|
-
limit = parseInt(searchParams.get("limit") || "0");
|
|
155
|
-
limitOffsetparams++;
|
|
156
|
-
}
|
|
157
|
-
if (searchParams.has("offset")) {
|
|
158
|
-
offset = parseInt(searchParams.get("offset") || "0");
|
|
159
|
-
limitOffsetparams++;
|
|
160
|
-
}
|
|
161
|
-
if (limitOffsetparams > 0) {
|
|
162
|
-
searchParams.delete("limit");
|
|
163
|
-
searchParams.delete("offset");
|
|
164
|
-
}
|
|
165
|
-
if (searchParams.size === 0)
|
|
166
|
-
return data.slice(offset, offset + limit);
|
|
167
|
-
for (const [key, value] of searchParams.entries()) {
|
|
168
|
-
const values = value.split(",").map((s) => s.trim());
|
|
169
|
-
for (const v of values) {
|
|
170
|
-
for (const item of data) {
|
|
171
|
-
//si l'item est une valeur primitive on regarde si vaue correspond à item simplement
|
|
172
|
-
if (typeof item !== "object") {
|
|
173
|
-
if (!isNaN(+value)) {
|
|
174
|
-
if (item == value) {
|
|
175
|
-
result.push(item);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
else if (item.toString().includes(value)) {
|
|
179
|
-
result.push(item);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
const record = item;
|
|
184
|
-
//si l'item est un objet
|
|
185
|
-
//faire un comparaison de la version string de la même clef dans item pour voir si elle contient value
|
|
186
|
-
if (!record[key])
|
|
187
|
-
continue;
|
|
188
|
-
//si la valeur est un nombre, on compare les valeurs directement
|
|
189
|
-
if (!isNaN(+v)) {
|
|
190
|
-
if (record[key] == v) {
|
|
191
|
-
result.push(item);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
if (record[key]?.toString().toLowerCase().includes(v.toLowerCase())) {
|
|
196
|
-
result.push(item);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
return result.slice(offset, offset + limit);
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* firstCallDone is a function that returns a promise that is resolved when the first call to the API is done for each serviceURL whatever api instance is used
|
|
207
|
-
*/
|
|
208
|
-
firstCallDone() {
|
|
209
|
-
return new Promise((resolve) => {
|
|
210
|
-
if (!API.firstCallDoneFlags.has(this.serviceURL)) {
|
|
211
|
-
API.firstCallDoneFlags.set(this.serviceURL, "loading");
|
|
212
|
-
resolve(true);
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
const loop = () => {
|
|
216
|
-
if (![undefined, "loading"].includes(API.firstCallDoneFlags.get(this.serviceURL))) {
|
|
217
|
-
resolve(true);
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
window.requestAnimationFrame(loop);
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
loop();
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
async get(path, additionalHeaders) {
|
|
228
|
-
await this.firstCallDone();
|
|
229
|
-
if (this.blockUntilDone) {
|
|
230
|
-
API.firstCallDoneFlags.set(this.serviceURL, "loading");
|
|
231
|
-
}
|
|
232
|
-
const regExp = /dataProvider\((.*?)\)(.*?)$/;
|
|
233
|
-
if (regExp.test(path)) {
|
|
234
|
-
const match = path.match(regExp);
|
|
235
|
-
if (!match)
|
|
236
|
-
throw new Error("dataProvider path is not valid");
|
|
237
|
-
return await this.localGet(match[1], match[2]);
|
|
238
|
-
}
|
|
239
|
-
const lastCall = {
|
|
240
|
-
apiMethod: "get",
|
|
241
|
-
path: path,
|
|
242
|
-
additionalHeaders: additionalHeaders,
|
|
243
|
-
};
|
|
244
|
-
const headers = await this.createHeaders(additionalHeaders);
|
|
245
|
-
const url = this.computeURL(path);
|
|
246
|
-
const mapKey = JSON.stringify({
|
|
247
|
-
url: url,
|
|
248
|
-
headers: headers,
|
|
249
|
-
});
|
|
250
|
-
if (!API.loadingGetPromises.has(mapKey)) {
|
|
251
|
-
const promise = new Promise(async (resolve) => {
|
|
252
|
-
try {
|
|
253
|
-
const result = await fetch(url, { headers: headers, credentials: this.credentials, cache: this.cache });
|
|
254
|
-
const handledResult = await this.handleResult(result, lastCall);
|
|
255
|
-
resolve(handledResult);
|
|
256
|
-
}
|
|
257
|
-
catch (e) {
|
|
258
|
-
resolve(null);
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
API.loadingGetPromises.set(mapKey, promise);
|
|
262
|
-
}
|
|
263
|
-
const result = (await API.loadingGetPromises.get(mapKey));
|
|
264
|
-
API.loadingGetPromises.delete(mapKey);
|
|
265
|
-
return result;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Création du header, avec authentification si besoin
|
|
269
|
-
* ajout du language via le header accept-language qui contient le langue du navigateur
|
|
270
|
-
*/
|
|
271
|
-
async createHeaders(additionalHeaders) {
|
|
272
|
-
await this.auth();
|
|
273
|
-
const headers = {};
|
|
274
|
-
if (this.token)
|
|
275
|
-
headers.Authorization = "Bearer " + this.token;
|
|
276
|
-
headers["Accept-Language"] = HTML.getLanguage();
|
|
277
|
-
if (additionalHeaders) {
|
|
278
|
-
Object.assign(headers, additionalHeaders);
|
|
279
|
-
}
|
|
280
|
-
return headers;
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Concatène le serviceURL et le endpoint donné en paramètre
|
|
284
|
-
*/
|
|
285
|
-
computeURL(path, query = {}) {
|
|
286
|
-
let url = "";
|
|
287
|
-
if (path.startsWith("http"))
|
|
288
|
-
url = path;
|
|
289
|
-
else
|
|
290
|
-
url = this.serviceURL + "/" + path;
|
|
291
|
-
if (!url.startsWith("http"))
|
|
292
|
-
url = window.location.origin + url;
|
|
293
|
-
const computedUrl = new URL(url);
|
|
294
|
-
for (const key in query) {
|
|
295
|
-
computedUrl.searchParams.set(key, query[key]);
|
|
296
|
-
}
|
|
297
|
-
return computedUrl.toString().replace(/([^(https?:)])\/{2,}/g, "$1/");
|
|
298
|
-
}
|
|
299
|
-
/*
|
|
300
|
-
* Envoie des données au endPoint passé en paramètre. par défaut en POST
|
|
301
|
-
*/
|
|
302
|
-
async send(path, data, method = "POST", additionalHeaders) {
|
|
303
|
-
const lastCall = {
|
|
304
|
-
apiMethod: "send",
|
|
305
|
-
path: path,
|
|
306
|
-
additionalHeaders: additionalHeaders,
|
|
307
|
-
method: method,
|
|
308
|
-
data: data,
|
|
309
|
-
};
|
|
310
|
-
const headers = await this.createHeaders(additionalHeaders);
|
|
311
|
-
headers["Accept"] = "application/json";
|
|
312
|
-
headers["Content-Type"] = "application/json";
|
|
313
|
-
const result = await fetch(this.computeURL(path), {
|
|
314
|
-
headers: headers,
|
|
315
|
-
credentials: this.credentials,
|
|
316
|
-
method: method,
|
|
317
|
-
body: JSON.stringify(data),
|
|
318
|
-
});
|
|
319
|
-
return (await this.handleResult(result, lastCall));
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Agit comme une soumission de formulaire, mais attends un json en réponse
|
|
323
|
-
*/
|
|
324
|
-
async submitFormData(path, data, method = "POST", additionalHeaders) {
|
|
325
|
-
const lastCall = {
|
|
326
|
-
apiMethod: "submitFormData",
|
|
327
|
-
path: path,
|
|
328
|
-
additionalHeaders: additionalHeaders,
|
|
329
|
-
method: method,
|
|
330
|
-
data: data,
|
|
331
|
-
};
|
|
332
|
-
const headers = await this.createHeaders(additionalHeaders);
|
|
333
|
-
headers["Accept"] = "application/json";
|
|
334
|
-
const formData = new FormData();
|
|
335
|
-
const dynamicData = data;
|
|
336
|
-
for (const z in dynamicData)
|
|
337
|
-
formData.set(z, dynamicData[z]);
|
|
338
|
-
const result = await fetch(this.computeURL(path), {
|
|
339
|
-
headers: headers,
|
|
340
|
-
credentials: this.credentials,
|
|
341
|
-
method: method,
|
|
342
|
-
body: formData,
|
|
343
|
-
});
|
|
344
|
-
return (await this.handleResult(result, lastCall));
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Appel send en utilisant le méthode PUT
|
|
348
|
-
*/
|
|
349
|
-
async put(path, data, additionalHeaders) {
|
|
350
|
-
return this.send(path, data, "PUT", additionalHeaders);
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* Appel send en utilisant le méthode POST
|
|
354
|
-
*/
|
|
355
|
-
async post(path, data, additionalHeaders) {
|
|
356
|
-
return this.send(path, data, "POST", additionalHeaders);
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Appel send en utilisant le méthode PATCH
|
|
360
|
-
*/
|
|
361
|
-
async patch(path, data, additionalHeaders) {
|
|
362
|
-
return this.send(path, data, "PATCH", additionalHeaders);
|
|
363
|
-
}
|
|
364
|
-
/**
|
|
365
|
-
* Appel send en utilisant le méthode delete
|
|
366
|
-
*/
|
|
367
|
-
async delete(path, data, additionalHeaders) {
|
|
368
|
-
return this.send(path, data, "delete", additionalHeaders);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* Ce tableau static permet de ne pas appeler plusieurs fois le même service lors d'appel concurrents en GET.
|
|
373
|
-
*/
|
|
374
|
-
API.loadingGetPromises = new Map();
|
|
375
|
-
/**
|
|
376
|
-
* Tableau static des tokens stokés en memoire vive (comportement à revoir à l'occasion)
|
|
377
|
-
*/
|
|
378
|
-
API.tokens = new Map();
|
|
379
|
-
/**
|
|
380
|
-
* Tableau stockant l'ensemble des tokens invalides
|
|
381
|
-
*/
|
|
382
|
-
API.invalidTokens = [];
|
|
383
|
-
/**
|
|
384
|
-
* Tableau static des tentatives échouées de récupération auto du token
|
|
385
|
-
*/
|
|
386
|
-
API.failledTokenUpdates = new Map();
|
|
387
|
-
/**
|
|
388
|
-
* Tableau static des flags pour savoir si le premier appel a été fait pour chaque serviceURL
|
|
389
|
-
*/
|
|
390
|
-
API.firstCallDoneFlags = new Map();
|
|
391
|
-
export default API;
|
package/decorators.d.ts
DELETED
package/directives.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export declare const dp: (id: string | import("./core/utils/PublisherProxy").PublisherProxy<any> | (() => unknown), defaultValue?: any) => any;
|
|
2
|
-
export declare const dataProvider: (id: string | import("./core/utils/PublisherProxy").PublisherProxy<any> | (() => unknown), defaultValue?: any) => any;
|
|
3
|
-
export declare const subscribe: (observable: string | import("./core/utils/PublisherProxy").PublisherProxy<any> | (() => unknown)) => import("lit-html/directive").DirectiveResult<{
|
|
4
|
-
new (partInfo: any): {
|
|
5
|
-
observables: Set<import("./core/utils/PublisherProxy").PublisherProxy<any>>;
|
|
6
|
-
unsubscribe(): void;
|
|
7
|
-
observable?: (string | import("./core/utils/PublisherProxy").PublisherProxy<any> | (() => unknown)) | undefined;
|
|
8
|
-
node?: import("./core/utils/HTML").SearchableDomElement | undefined;
|
|
9
|
-
render(observable: string | import("./core/utils/PublisherProxy").PublisherProxy<any> | (() => unknown)): symbol;
|
|
10
|
-
onAssign: (v: unknown) => void;
|
|
11
|
-
subscribe(observable: string | import("./core/utils/PublisherProxy").PublisherProxy<any> | (() => unknown)): void;
|
|
12
|
-
disconnected(): void;
|
|
13
|
-
reconnected(): void;
|
|
14
|
-
isConnected: boolean;
|
|
15
|
-
_$initialize(part: import("lit-html").Part, parent: import("lit-html").Disconnectable, attributeIndex: number | undefined): void;
|
|
16
|
-
setValue(value: unknown): void;
|
|
17
|
-
readonly _$isConnected: boolean;
|
|
18
|
-
update(_part: import("lit-html").Part, props: unknown[]): unknown;
|
|
19
|
-
};
|
|
20
|
-
}>;
|
|
21
|
-
export declare const sub: (observable: string | import("./core/utils/PublisherProxy").PublisherProxy<any> | (() => unknown)) => import("lit-html/directive").DirectiveResult<{
|
|
22
|
-
new (partInfo: any): {
|
|
23
|
-
observables: Set<import("./core/utils/PublisherProxy").PublisherProxy<any>>;
|
|
24
|
-
unsubscribe(): void;
|
|
25
|
-
observable?: (string | import("./core/utils/PublisherProxy").PublisherProxy<any> | (() => unknown)) | undefined;
|
|
26
|
-
node?: import("./core/utils/HTML").SearchableDomElement | undefined;
|
|
27
|
-
render(observable: string | import("./core/utils/PublisherProxy").PublisherProxy<any> | (() => unknown)): symbol;
|
|
28
|
-
onAssign: (v: unknown) => void;
|
|
29
|
-
subscribe(observable: string | import("./core/utils/PublisherProxy").PublisherProxy<any> | (() => unknown)): void;
|
|
30
|
-
disconnected(): void;
|
|
31
|
-
reconnected(): void;
|
|
32
|
-
isConnected: boolean;
|
|
33
|
-
_$initialize(part: import("lit-html").Part, parent: import("lit-html").Disconnectable, attributeIndex: number | undefined): void;
|
|
34
|
-
setValue(value: unknown): void;
|
|
35
|
-
readonly _$isConnected: boolean;
|
|
36
|
-
update(_part: import("lit-html").Part, props: unknown[]): unknown;
|
|
37
|
-
};
|
|
38
|
-
}>;
|
|
39
|
-
export declare const get: (id: string | import("./core/utils/PublisherProxy").PublisherProxy<any> | (() => unknown)) => any;
|
|
40
|
-
export declare const set: (id: string | import("./core/utils/PublisherProxy").PublisherProxy<any> | (() => unknown), value: unknown) => void;
|
package/img/concorde-logo.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="222.442" height="47.558" viewBox="0 0 222.442 47.558"><g transform="translate(-51.885 -25)"><path d="M11.045.384A9.984,9.984,0,0,1,5.862-.9,8.546,8.546,0,0,1,2.538-4.474,11.519,11.519,0,0,1,1.381-9.741a11.462,11.462,0,0,1,1.17-5.3,8.651,8.651,0,0,1,3.33-3.567,9.872,9.872,0,0,1,5.139-1.285,10.228,10.228,0,0,1,4.5.933,7.522,7.522,0,0,1,3.055,2.621,7.7,7.7,0,0,1,1.24,3.963H14.676a4.017,4.017,0,0,0-1.144-2.371,3.328,3.328,0,0,0-2.423-.9,3.647,3.647,0,0,0-2.205.684A4.416,4.416,0,0,0,7.44-12.976a8.472,8.472,0,0,0-.524,3.158,8.75,8.75,0,0,0,.518,3.2A4.393,4.393,0,0,0,8.9-4.615a3.651,3.651,0,0,0,2.212.69,3.63,3.63,0,0,0,1.681-.384,3.279,3.279,0,0,0,1.24-1.119A4.261,4.261,0,0,0,14.676-7.2h5.139a8.049,8.049,0,0,1-1.221,3.957A7.443,7.443,0,0,1,15.584-.575,10.038,10.038,0,0,1,11.045.384Zm19.7,0A9.985,9.985,0,0,1,25.6-.888a8.6,8.6,0,0,1-3.343-3.554,11.411,11.411,0,0,1-1.176-5.3,11.469,11.469,0,0,1,1.176-5.325A8.6,8.6,0,0,1,25.6-18.62a9.985,9.985,0,0,1,5.146-1.272A9.985,9.985,0,0,1,35.9-18.62a8.6,8.6,0,0,1,3.343,3.554,11.469,11.469,0,0,1,1.176,5.325,11.411,11.411,0,0,1-1.176,5.3A8.6,8.6,0,0,1,35.9-.888,9.985,9.985,0,0,1,30.75.384Zm.026-4.219a3.367,3.367,0,0,0,2.263-.773,4.757,4.757,0,0,0,1.374-2.116A9.279,9.279,0,0,0,34.88-9.78a9.279,9.279,0,0,0-.467-3.055,4.8,4.8,0,0,0-1.374-2.122,3.35,3.35,0,0,0-2.263-.78,3.443,3.443,0,0,0-2.295.78,4.726,4.726,0,0,0-1.393,2.122,9.279,9.279,0,0,0-.467,3.055,9.279,9.279,0,0,0,.467,3.055,4.681,4.681,0,0,0,1.393,2.116A3.461,3.461,0,0,0,30.776-3.835Zm17.2-7.517V0H42.529V-19.636h5.19v3.464h.23a5.512,5.512,0,0,1,2.186-2.717,6.647,6.647,0,0,1,3.72-1A6.906,6.906,0,0,1,57.423-19a6.091,6.091,0,0,1,2.365,2.55,8.589,8.589,0,0,1,.844,3.944V0H55.185V-11.531a3.968,3.968,0,0,0-.92-2.819,3.315,3.315,0,0,0-2.57-1.016,3.87,3.87,0,0,0-1.937.473,3.253,3.253,0,0,0-1.3,1.374A4.769,4.769,0,0,0,47.975-11.352ZM72.346.384A9.985,9.985,0,0,1,67.162-.9a8.546,8.546,0,0,1-3.324-3.573,11.519,11.519,0,0,1-1.157-5.267,11.462,11.462,0,0,1,1.17-5.3,8.651,8.651,0,0,1,3.33-3.567,9.872,9.872,0,0,1,5.139-1.285,10.228,10.228,0,0,1,4.5.933,7.522,7.522,0,0,1,3.055,2.621,7.7,7.7,0,0,1,1.24,3.963H75.977a4.017,4.017,0,0,0-1.144-2.371,3.328,3.328,0,0,0-2.423-.9,3.647,3.647,0,0,0-2.205.684,4.416,4.416,0,0,0-1.464,1.988,8.472,8.472,0,0,0-.524,3.158,8.75,8.75,0,0,0,.518,3.2A4.393,4.393,0,0,0,70.2-4.615a3.651,3.651,0,0,0,2.212.69,3.63,3.63,0,0,0,1.681-.384,3.279,3.279,0,0,0,1.24-1.119A4.261,4.261,0,0,0,75.977-7.2h5.139A8.049,8.049,0,0,1,79.9-3.241,7.443,7.443,0,0,1,76.885-.575,10.038,10.038,0,0,1,72.346.384Zm19.7,0A9.985,9.985,0,0,1,86.905-.888a8.6,8.6,0,0,1-3.343-3.554,11.411,11.411,0,0,1-1.176-5.3,11.469,11.469,0,0,1,1.176-5.325,8.6,8.6,0,0,1,3.343-3.554,9.985,9.985,0,0,1,5.146-1.272A9.985,9.985,0,0,1,97.2-18.62a8.6,8.6,0,0,1,3.343,3.554,11.469,11.469,0,0,1,1.176,5.325,11.411,11.411,0,0,1-1.176,5.3A8.6,8.6,0,0,1,97.2-.888,9.985,9.985,0,0,1,92.051.384Zm.026-4.219a3.367,3.367,0,0,0,2.263-.773,4.757,4.757,0,0,0,1.374-2.116A9.279,9.279,0,0,0,96.18-9.78a9.279,9.279,0,0,0-.467-3.055,4.8,4.8,0,0,0-1.374-2.122,3.35,3.35,0,0,0-2.263-.78,3.443,3.443,0,0,0-2.295.78,4.726,4.726,0,0,0-1.393,2.122,9.278,9.278,0,0,0-.467,3.055,9.278,9.278,0,0,0,.467,3.055,4.681,4.681,0,0,0,1.393,2.116A3.461,3.461,0,0,0,92.077-3.835ZM103.83,0V-19.636h5.28v3.426h.2a5.1,5.1,0,0,1,1.8-2.768,4.76,4.76,0,0,1,2.915-.94,8.238,8.238,0,0,1,.882.051,6.212,6.212,0,0,1,.831.141v4.832a7.115,7.115,0,0,0-1.061-.2,9.532,9.532,0,0,0-1.24-.089,4.363,4.363,0,0,0-2.141.518,3.847,3.847,0,0,0-1.483,1.438,4.1,4.1,0,0,0-.543,2.122V0Zm19.59.32a7.351,7.351,0,0,1-4.046-1.157,7.876,7.876,0,0,1-2.864-3.413,13.041,13.041,0,0,1-1.055-5.542,12.858,12.858,0,0,1,1.087-5.619,7.829,7.829,0,0,1,2.9-3.362,7.4,7.4,0,0,1,3.969-1.119,6.1,6.1,0,0,1,2.755.556,5.484,5.484,0,0,1,1.79,1.381,7.22,7.22,0,0,1,1.042,1.617h.166v-9.844h5.433V0h-5.369V-3.145h-.23a7,7,0,0,1-1.08,1.617,5.443,5.443,0,0,1-1.8,1.323A6.249,6.249,0,0,1,123.42.32Zm1.726-4.334a3.487,3.487,0,0,0,2.231-.722,4.56,4.56,0,0,0,1.406-2.026,8.637,8.637,0,0,0,.492-3.055,8.632,8.632,0,0,0-.486-3.043,4.367,4.367,0,0,0-1.406-1.994,3.577,3.577,0,0,0-2.237-.7,3.532,3.532,0,0,0-2.263.729,4.456,4.456,0,0,0-1.393,2.02,8.677,8.677,0,0,0-.473,2.991,8.776,8.776,0,0,0,.479,3.023,4.56,4.56,0,0,0,1.393,2.045A3.485,3.485,0,0,0,125.146-4.014Zm21.418,4.4a10.412,10.412,0,0,1-5.21-1.234A8.345,8.345,0,0,1,138-4.353a11.538,11.538,0,0,1-1.176-5.376A11.479,11.479,0,0,1,138-15.047a8.681,8.681,0,0,1,3.317-3.567,9.628,9.628,0,0,1,5.031-1.278,10.393,10.393,0,0,1,3.624.62,8.169,8.169,0,0,1,2.94,1.86,8.473,8.473,0,0,1,1.962,3.113,12.434,12.434,0,0,1,.7,4.379v1.5H139V-11.8H150.45a4.172,4.172,0,0,0-.511-2.084,3.721,3.721,0,0,0-1.413-1.425,4.122,4.122,0,0,0-2.09-.518,4.193,4.193,0,0,0-2.192.569,4.08,4.08,0,0,0-1.489,1.521,4.333,4.333,0,0,0-.55,2.116v3.209a5.462,5.462,0,0,0,.543,2.518,3.889,3.889,0,0,0,1.54,1.636,4.653,4.653,0,0,0,2.365.575,5.15,5.15,0,0,0,1.662-.256,3.449,3.449,0,0,0,1.291-.767,3.335,3.335,0,0,0,.818-1.253l5.037.332A6.866,6.866,0,0,1,153.9-2.461a7.868,7.868,0,0,1-3.043,2.1A11.435,11.435,0,0,1,146.563.384Zm14.31-.051a2.954,2.954,0,0,1-2.167-.9,2.954,2.954,0,0,1-.9-2.167,2.919,2.919,0,0,1,.9-2.148,2.965,2.965,0,0,1,2.167-.895,2.985,2.985,0,0,1,2.148.895,2.889,2.889,0,0,1,.92,2.148,2.884,2.884,0,0,1-.428,1.54,3.286,3.286,0,0,1-1.119,1.112A2.9,2.9,0,0,1,160.873.332Z" transform="translate(110.385 62)" fill="#2a282d"/><g transform="translate(51.885 25)"><g transform="translate(2.6 2.209)"><path d="M52.661,65.423h-1.4l-.091-.468h-.208l-.078.351-.078.065H49.646l-.065-.169-.091-.338h-.221v.208l-.118.065-3.859-.326L44.5,64.4v-.871a7.436,7.436,0,0,1,.156-1.079c.182-.883.546-1.962,2.833-5.224s3.08-4.481,4.665-10.3l.078-.324c.468-1.975.806-3.132.936-3.547V34.524a25.625,25.625,0,0,1,.312-2.82h0c.143-.923.312-1.754.468-2.4a21.623,21.623,0,0,0,.195,43.218,41.171,41.171,0,0,1-.845-6.8.668.668,0,0,0-.637-.3Z" transform="translate(-33.181 -29.3)" fill="#2a282d"/><path d="M34.658,65.423h1.4l.091-.468h.209l.078.351.078.065h1.157l.065-.169.091-.338h.221v.208l.118.065,3.857-.326.793-.416v-.871a7.436,7.436,0,0,0-.156-1.079c-.182-.883-.546-1.962-2.833-5.224s-3.08-4.481-4.665-10.3l-.078-.324c-.468-1.975-.806-3.132-.936-3.547V34.524a25.63,25.63,0,0,0-.312-2.82h0c-.143-.923-.312-1.754-.468-2.4a21.623,21.623,0,0,1-.195,43.218,41.171,41.171,0,0,0,.845-6.8.668.668,0,0,1,.637-.3Z" transform="translate(-11.738 -29.3)" fill="#2a282d"/></g><path d="M23.779,1.169a22.61,22.61,0,1,0,22.61,22.61,22.61,22.61,0,0,0-22.61-22.61m0-1.169A23.779,23.779,0,1,1,0,23.779,23.779,23.779,0,0,1,23.779,0Z" transform="translate(0 0)" fill="#2a282d"/></g></g></svg>
|
package/img/concorde.png
DELETED
|
Binary file
|
package/img/concorde_def.png
DELETED
|
Binary file
|