@supersoniks/concorde 4.7.4 → 4.9.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/.github/workflows/ci.yml +21 -0
- package/.github-export-ignore +30 -0
- package/.gitlab-ci.yml +13 -0
- package/CONTRIBUTING.md +59 -0
- package/DEV.md +54 -0
- package/LICENSE +21 -0
- package/OPEN_SOURCE_CHECKPOINT.md +133 -0
- package/README.md +30 -16
- package/ai/cursor/rules/concorde.mdc +1 -1
- package/ai/skills/concorde-scope/SKILL.md +2 -2
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +214 -214
- package/concorde-core.es.js +4517 -4133
- package/dist/concorde-core.bundle.js +214 -214
- package/dist/concorde-core.es.js +4517 -4133
- package/dist/docs-mock-api-sw.js +19 -0
- package/dist/docs-mock-api-sw.js.map +2 -2
- package/dist/js/components.js +12 -0
- package/dist/js/components.js.map +1 -0
- package/dist/js/concorde-loaded.js +5 -0
- package/dist/js/concorde-loaded.js.map +1 -0
- package/dist/js/core/_types/endpoint.js +5 -0
- package/dist/js/core/_types/endpoint.js.map +1 -0
- package/dist/js/core/_types/key.js +2 -0
- package/dist/js/core/_types/key.js.map +1 -0
- package/dist/js/core/_types/types.js +3 -0
- package/dist/js/core/_types/types.js.map +1 -0
- package/dist/js/core/components/functional/date/date.js +272 -0
- package/dist/js/core/components/functional/date/date.js.map +1 -0
- package/dist/js/core/components/functional/example/example.js +44 -0
- package/dist/js/core/components/functional/example/example.js.map +1 -0
- package/dist/js/core/components/functional/fetch/fetch.js +79 -0
- package/dist/js/core/components/functional/fetch/fetch.js.map +1 -0
- package/dist/js/core/components/functional/functional.js +17 -0
- package/dist/js/core/components/functional/functional.js.map +1 -0
- package/dist/js/core/components/functional/if/if.js +39 -0
- package/dist/js/core/components/functional/if/if.js.map +1 -0
- package/dist/js/core/components/functional/list/list.js +341 -0
- package/dist/js/core/components/functional/list/list.js.map +1 -0
- package/dist/js/core/components/functional/mix/mix.js +103 -0
- package/dist/js/core/components/functional/mix/mix.js.map +1 -0
- package/dist/js/core/components/functional/queue/queue.js +386 -0
- package/dist/js/core/components/functional/queue/queue.js.map +1 -0
- package/dist/js/core/components/functional/router/redirect.js +54 -0
- package/dist/js/core/components/functional/router/redirect.js.map +1 -0
- package/dist/js/core/components/functional/router/router.js +179 -0
- package/dist/js/core/components/functional/router/router.js.map +1 -0
- package/dist/js/core/components/functional/sdui/SDUIDescriptorTransformer.js +216 -0
- package/dist/js/core/components/functional/sdui/SDUIDescriptorTransformer.js.map +1 -0
- package/dist/js/core/components/functional/sdui/default-library.json +108 -0
- package/dist/js/core/components/functional/sdui/sdui-utils.js +64 -0
- package/dist/js/core/components/functional/sdui/sdui-utils.js.map +1 -0
- package/dist/js/core/components/functional/sdui/sdui.js +266 -0
- package/dist/js/core/components/functional/sdui/sdui.js.map +1 -0
- package/dist/js/core/components/functional/sdui/types.js +2 -0
- package/dist/js/core/components/functional/sdui/types.js.map +1 -0
- package/dist/js/core/components/functional/sonic-scope/sonic-scope.js +22 -0
- package/dist/js/core/components/functional/sonic-scope/sonic-scope.js.map +1 -0
- package/dist/js/core/components/functional/states/states.js +172 -0
- package/dist/js/core/components/functional/states/states.js.map +1 -0
- package/dist/js/core/components/functional/submit/submit.js +284 -0
- package/dist/js/core/components/functional/submit/submit.js.map +1 -0
- package/dist/js/core/components/functional/subscriber/subscriber.js +39 -0
- package/dist/js/core/components/functional/subscriber/subscriber.js.map +1 -0
- package/dist/js/core/components/functional/translation/translation.js +28 -0
- package/dist/js/core/components/functional/translation/translation.js.map +1 -0
- package/dist/js/core/components/functional/value/value.js +28 -0
- package/dist/js/core/components/functional/value/value.js.map +1 -0
- package/dist/js/core/components/ui/_css/scroll.js +25 -0
- package/dist/js/core/components/ui/_css/scroll.js.map +1 -0
- package/dist/js/core/components/ui/_css/shadow.js +22 -0
- package/dist/js/core/components/ui/_css/shadow.js.map +1 -0
- package/dist/js/core/components/ui/_css/size.js +36 -0
- package/dist/js/core/components/ui/_css/size.js.map +1 -0
- package/dist/js/core/components/ui/_css/type.js +92 -0
- package/dist/js/core/components/ui/_css/type.js.map +1 -0
- package/dist/js/core/components/ui/alert/alert.js +213 -0
- package/dist/js/core/components/ui/alert/alert.js.map +1 -0
- package/dist/js/core/components/ui/alert-messages/alert-messages.js +68 -0
- package/dist/js/core/components/ui/alert-messages/alert-messages.js.map +1 -0
- package/dist/js/core/components/ui/badge/badge.js +199 -0
- package/dist/js/core/components/ui/badge/badge.js.map +1 -0
- package/dist/js/core/components/ui/button/button.js +697 -0
- package/dist/js/core/components/ui/button/button.js.map +1 -0
- package/dist/js/core/components/ui/captcha/altchaStyles.js +226 -0
- package/dist/js/core/components/ui/captcha/altchaStyles.js.map +1 -0
- package/dist/js/core/components/ui/captcha/captcha.js +167 -0
- package/dist/js/core/components/ui/captcha/captcha.js.map +1 -0
- package/dist/js/core/components/ui/card/card-footer.js +26 -0
- package/dist/js/core/components/ui/card/card-footer.js.map +1 -0
- package/dist/js/core/components/ui/card/card-header-descripton.js +30 -0
- package/dist/js/core/components/ui/card/card-header-descripton.js.map +1 -0
- package/dist/js/core/components/ui/card/card-header.js +79 -0
- package/dist/js/core/components/ui/card/card-header.js.map +1 -0
- package/dist/js/core/components/ui/card/card-main.js +26 -0
- package/dist/js/core/components/ui/card/card-main.js.map +1 -0
- package/dist/js/core/components/ui/card/card.js +67 -0
- package/dist/js/core/components/ui/card/card.js.map +1 -0
- package/dist/js/core/components/ui/divider/divider.js +200 -0
- package/dist/js/core/components/ui/divider/divider.js.map +1 -0
- package/dist/js/core/components/ui/form/checkbox/checkbox.js +257 -0
- package/dist/js/core/components/ui/form/checkbox/checkbox.js.map +1 -0
- package/dist/js/core/components/ui/form/css/form-control.js +393 -0
- package/dist/js/core/components/ui/form/css/form-control.js.map +1 -0
- package/dist/js/core/components/ui/form/fieldset/fieldset.js +124 -0
- package/dist/js/core/components/ui/form/fieldset/fieldset.js.map +1 -0
- package/dist/js/core/components/ui/form/fieldset/legend-description.js +38 -0
- package/dist/js/core/components/ui/form/fieldset/legend-description.js.map +1 -0
- package/dist/js/core/components/ui/form/fieldset/legend.js +130 -0
- package/dist/js/core/components/ui/form/fieldset/legend.js.map +1 -0
- package/dist/js/core/components/ui/form/form-actions/form-actions.js +47 -0
- package/dist/js/core/components/ui/form/form-actions/form-actions.js.map +1 -0
- package/dist/js/core/components/ui/form/form-layout/form-layout.js +84 -0
- package/dist/js/core/components/ui/form/form-layout/form-layout.js.map +1 -0
- package/dist/js/core/components/ui/form/input/input.js +316 -0
- package/dist/js/core/components/ui/form/input/input.js.map +1 -0
- package/dist/js/core/components/ui/form/input/password-helper.js +134 -0
- package/dist/js/core/components/ui/form/input/password-helper.js.map +1 -0
- package/dist/js/core/components/ui/form/input/same-value-helper.js +85 -0
- package/dist/js/core/components/ui/form/input/same-value-helper.js.map +1 -0
- package/dist/js/core/components/ui/form/input-autocomplete/input-autocomplete.js +405 -0
- package/dist/js/core/components/ui/form/input-autocomplete/input-autocomplete.js.map +1 -0
- package/dist/js/core/components/ui/form/radio/radio.js +63 -0
- package/dist/js/core/components/ui/form/radio/radio.js.map +1 -0
- package/dist/js/core/components/ui/form/select/select.js +323 -0
- package/dist/js/core/components/ui/form/select/select.js.map +1 -0
- package/dist/js/core/components/ui/form/switch/switch.js +90 -0
- package/dist/js/core/components/ui/form/switch/switch.js.map +1 -0
- package/dist/js/core/components/ui/form/textarea/textarea.js +162 -0
- package/dist/js/core/components/ui/form/textarea/textarea.js.map +1 -0
- package/dist/js/core/components/ui/group/group.js +128 -0
- package/dist/js/core/components/ui/group/group.js.map +1 -0
- package/dist/js/core/components/ui/icon/icon.js +129 -0
- package/dist/js/core/components/ui/icon/icon.js.map +1 -0
- package/dist/js/core/components/ui/icon/icons.js +163 -0
- package/dist/js/core/components/ui/icon/icons.js.map +1 -0
- package/dist/js/core/components/ui/icon/icons.json +1 -0
- package/dist/js/core/components/ui/image/image.js +160 -0
- package/dist/js/core/components/ui/image/image.js.map +1 -0
- package/dist/js/core/components/ui/link/link.js +125 -0
- package/dist/js/core/components/ui/link/link.js.map +1 -0
- package/dist/js/core/components/ui/loader/loader.js +106 -0
- package/dist/js/core/components/ui/loader/loader.js.map +1 -0
- package/dist/js/core/components/ui/loader/styles/fixed.js +56 -0
- package/dist/js/core/components/ui/loader/styles/fixed.js.map +1 -0
- package/dist/js/core/components/ui/loader/styles/inline.js +70 -0
- package/dist/js/core/components/ui/loader/styles/inline.js.map +1 -0
- package/dist/js/core/components/ui/menu/menu-item.js +35 -0
- package/dist/js/core/components/ui/menu/menu-item.js.map +1 -0
- package/dist/js/core/components/ui/menu/menu.js +436 -0
- package/dist/js/core/components/ui/menu/menu.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal-actions.js +44 -0
- package/dist/js/core/components/ui/modal/modal-actions.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal-close.js +56 -0
- package/dist/js/core/components/ui/modal/modal-close.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal-content.js +27 -0
- package/dist/js/core/components/ui/modal/modal-content.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal-subtitle.js +34 -0
- package/dist/js/core/components/ui/modal/modal-subtitle.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal-title.js +35 -0
- package/dist/js/core/components/ui/modal/modal-title.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal-utils.js +32 -0
- package/dist/js/core/components/ui/modal/modal-utils.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal.js +568 -0
- package/dist/js/core/components/ui/modal/modal.js.map +1 -0
- package/dist/js/core/components/ui/pop/pop.js +337 -0
- package/dist/js/core/components/ui/pop/pop.js.map +1 -0
- package/dist/js/core/components/ui/progress/progress.js +164 -0
- package/dist/js/core/components/ui/progress/progress.js.map +1 -0
- package/dist/js/core/components/ui/table/table-caption.js +29 -0
- package/dist/js/core/components/ui/table/table-caption.js.map +1 -0
- package/dist/js/core/components/ui/table/table-tbody.js +41 -0
- package/dist/js/core/components/ui/table/table-tbody.js.map +1 -0
- package/dist/js/core/components/ui/table/table-td.js +69 -0
- package/dist/js/core/components/ui/table/table-td.js.map +1 -0
- package/dist/js/core/components/ui/table/table-tfoot.js +28 -0
- package/dist/js/core/components/ui/table/table-tfoot.js.map +1 -0
- package/dist/js/core/components/ui/table/table-th.js +80 -0
- package/dist/js/core/components/ui/table/table-th.js.map +1 -0
- package/dist/js/core/components/ui/table/table-thead.js +26 -0
- package/dist/js/core/components/ui/table/table-thead.js.map +1 -0
- package/dist/js/core/components/ui/table/table-tr.js +67 -0
- package/dist/js/core/components/ui/table/table-tr.js.map +1 -0
- package/dist/js/core/components/ui/table/table.js +106 -0
- package/dist/js/core/components/ui/table/table.js.map +1 -0
- package/dist/js/core/components/ui/theme/theme-collection/core-variables.js +74 -0
- package/dist/js/core/components/ui/theme/theme-collection/core-variables.js.map +1 -0
- package/dist/js/core/components/ui/theme/theme-collection/dark.js +39 -0
- package/dist/js/core/components/ui/theme/theme-collection/dark.js.map +1 -0
- package/dist/js/core/components/ui/theme/theme-collection/light.js +32 -0
- package/dist/js/core/components/ui/theme/theme-collection/light.js.map +1 -0
- package/dist/js/core/components/ui/theme/theme.js +150 -0
- package/dist/js/core/components/ui/theme/theme.js.map +1 -0
- package/dist/js/core/components/ui/toast/message-subscriber.js +41 -0
- package/dist/js/core/components/ui/toast/message-subscriber.js.map +1 -0
- package/dist/js/core/components/ui/toast/toast-item.js +379 -0
- package/dist/js/core/components/ui/toast/toast-item.js.map +1 -0
- package/dist/js/core/components/ui/toast/toast.js +269 -0
- package/dist/js/core/components/ui/toast/toast.js.map +1 -0
- package/dist/js/core/components/ui/toast/types.js +2 -0
- package/dist/js/core/components/ui/toast/types.js.map +1 -0
- package/dist/js/core/components/ui/tooltip/tooltip.js +219 -0
- package/dist/js/core/components/ui/tooltip/tooltip.js.map +1 -0
- package/dist/js/core/components/ui/ui.js +41 -0
- package/dist/js/core/components/ui/ui.js.map +1 -0
- package/dist/js/core/core.js +14 -0
- package/dist/js/core/core.js.map +1 -0
- package/dist/js/core/decorators/Subscriber.js +9 -0
- package/dist/js/core/decorators/Subscriber.js.map +1 -0
- package/dist/js/core/decorators/api.js +559 -0
- package/dist/js/core/decorators/api.js.map +1 -0
- package/dist/js/core/decorators/lifecycle.js +67 -0
- package/dist/js/core/decorators/lifecycle.js.map +1 -0
- package/dist/js/core/decorators/subscriber/ancestorAttribute.js +27 -0
- package/dist/js/core/decorators/subscriber/ancestorAttribute.js.map +1 -0
- package/dist/js/core/decorators/subscriber/autoFill.js +26 -0
- package/dist/js/core/decorators/subscriber/autoFill.js.map +1 -0
- package/dist/js/core/decorators/subscriber/autoSubscribe.js +46 -0
- package/dist/js/core/decorators/subscriber/autoSubscribe.js.map +1 -0
- package/dist/js/core/decorators/subscriber/bind.js +150 -0
- package/dist/js/core/decorators/subscriber/bind.js.map +1 -0
- package/dist/js/core/decorators/subscriber/common.js +44 -0
- package/dist/js/core/decorators/subscriber/common.js.map +1 -0
- package/dist/js/core/decorators/subscriber/dynamicPath.js +75 -0
- package/dist/js/core/decorators/subscriber/dynamicPath.js.map +1 -0
- package/dist/js/core/decorators/subscriber/dynamicPropertyWatch.js +138 -0
- package/dist/js/core/decorators/subscriber/dynamicPropertyWatch.js.map +1 -0
- package/dist/js/core/decorators/subscriber/handle.js +22 -0
- package/dist/js/core/decorators/subscriber/handle.js.map +1 -0
- package/dist/js/core/decorators/subscriber/onAssign.js +199 -0
- package/dist/js/core/decorators/subscriber/onAssign.js.map +1 -0
- package/dist/js/core/decorators/subscriber/publish.js +108 -0
- package/dist/js/core/decorators/subscriber/publish.js.map +1 -0
- package/dist/js/core/decorators/subscriber/publisherPath.js +16 -0
- package/dist/js/core/decorators/subscriber/publisherPath.js.map +1 -0
- package/dist/js/core/decorators/subscriber/subscribe.js +20 -0
- package/dist/js/core/decorators/subscriber/subscribe.js.map +1 -0
- package/dist/js/core/directives/DataProvider.js +127 -0
- package/dist/js/core/directives/DataProvider.js.map +1 -0
- package/dist/js/core/directives/Wording.js +221 -0
- package/dist/js/core/directives/Wording.js.map +1 -0
- package/dist/js/core/mixins/Fetcher.js +325 -0
- package/dist/js/core/mixins/Fetcher.js.map +1 -0
- package/dist/js/core/mixins/FormCheckable.js +313 -0
- package/dist/js/core/mixins/FormCheckable.js.map +1 -0
- package/dist/js/core/mixins/FormElement.js +304 -0
- package/dist/js/core/mixins/FormElement.js.map +1 -0
- package/dist/js/core/mixins/FormInput.js +82 -0
- package/dist/js/core/mixins/FormInput.js.map +1 -0
- package/dist/js/core/mixins/Subscriber.js +354 -0
- package/dist/js/core/mixins/Subscriber.js.map +1 -0
- package/dist/js/core/mixins/TemplatesContainer.js +70 -0
- package/dist/js/core/mixins/TemplatesContainer.js.map +1 -0
- package/dist/js/core/mixins/mixins.js +7 -0
- package/dist/js/core/mixins/mixins.js.map +1 -0
- package/dist/js/core/utils/AncestorAttributeObserver.js +140 -0
- package/dist/js/core/utils/AncestorAttributeObserver.js.map +1 -0
- package/dist/js/core/utils/Arrays.js +141 -0
- package/dist/js/core/utils/Arrays.js.map +1 -0
- package/dist/js/core/utils/DataBindObserver.js +265 -0
- package/dist/js/core/utils/DataBindObserver.js.map +1 -0
- package/dist/js/core/utils/Electron.js +14 -0
- package/dist/js/core/utils/Electron.js.map +1 -0
- package/dist/js/core/utils/Format.js +43 -0
- package/dist/js/core/utils/Format.js.map +1 -0
- package/dist/js/core/utils/HTML.js +248 -0
- package/dist/js/core/utils/HTML.js.map +1 -0
- package/dist/js/core/utils/LocationHandler.js +143 -0
- package/dist/js/core/utils/LocationHandler.js.map +1 -0
- package/dist/js/core/utils/Objects.js +111 -0
- package/dist/js/core/utils/Objects.js.map +1 -0
- package/dist/js/core/utils/PublisherProxy.js +946 -0
- package/dist/js/core/utils/PublisherProxy.js.map +1 -0
- package/dist/js/core/utils/Utils.js +19 -0
- package/dist/js/core/utils/Utils.js.map +1 -0
- package/dist/js/core/utils/aesCrypto.js +98 -0
- package/dist/js/core/utils/aesCrypto.js.map +1 -0
- package/dist/js/core/utils/api.js +574 -0
- package/dist/js/core/utils/api.js.map +1 -0
- package/dist/js/core/utils/dataProviderKey.js +64 -0
- package/dist/js/core/utils/dataProviderKey.js.map +1 -0
- package/dist/js/core/utils/endpoint.js +74 -0
- package/dist/js/core/utils/endpoint.js.map +1 -0
- package/dist/js/core/utils/route.js +149 -0
- package/dist/js/core/utils/route.js.map +1 -0
- package/dist/js/core/utils/url-pattern.js +3 -0
- package/dist/js/core/utils/url-pattern.js.map +1 -0
- package/dist/js/dataprovider.js +2 -0
- package/dist/js/dataprovider.js.map +1 -0
- package/dist/js/decorators.js +39 -0
- package/dist/js/decorators.js.map +1 -0
- package/dist/js/directives.js +30 -0
- package/dist/js/directives.js.map +1 -0
- package/dist/js/index.js +8 -0
- package/dist/js/index.js.map +1 -0
- package/dist/js/mixins.js +23 -0
- package/dist/js/mixins.js.map +1 -0
- package/dist/js/test-utils/TestUtils.js +10 -0
- package/dist/js/test-utils/TestUtils.js.map +1 -0
- package/dist/js/utils.js +41 -0
- package/dist/js/utils.js.map +1 -0
- package/dist/types/components.d.ts +5 -0
- package/dist/types/components.d.ts.map +1 -0
- package/dist/types/concorde-loaded.d.ts +2 -0
- package/dist/types/concorde-loaded.d.ts.map +1 -0
- package/dist/types/core/_types/endpoint.d.ts +5 -0
- package/dist/types/core/_types/endpoint.d.ts.map +1 -0
- package/dist/types/core/_types/key.d.ts +2 -0
- package/dist/types/core/_types/key.d.ts.map +1 -0
- package/dist/types/core/_types/types.d.ts +28 -0
- package/dist/types/core/_types/types.d.ts.map +1 -0
- package/dist/types/core/components/functional/date/date.d.ts +52 -0
- package/dist/types/core/components/functional/date/date.d.ts.map +1 -0
- package/dist/types/core/components/functional/example/example.d.ts +15 -0
- package/dist/types/core/components/functional/example/example.d.ts.map +1 -0
- package/dist/types/core/components/functional/fetch/fetch.d.ts +102 -0
- package/dist/types/core/components/functional/fetch/fetch.d.ts.map +1 -0
- package/dist/types/core/components/functional/functional.d.ts +17 -0
- package/dist/types/core/components/functional/functional.d.ts.map +1 -0
- package/dist/types/core/components/functional/if/if.d.ts +13 -0
- package/dist/types/core/components/functional/if/if.d.ts.map +1 -0
- package/dist/types/core/components/functional/list/list.d.ts +149 -0
- package/dist/types/core/components/functional/list/list.d.ts.map +1 -0
- package/dist/types/core/components/functional/mix/mix.d.ts +23 -0
- package/dist/types/core/components/functional/mix/mix.d.ts.map +1 -0
- package/dist/types/core/components/functional/queue/queue.d.ts +79 -0
- package/dist/types/core/components/functional/queue/queue.d.ts.map +1 -0
- package/dist/types/core/components/functional/router/redirect.d.ts +19 -0
- package/dist/types/core/components/functional/router/redirect.d.ts.map +1 -0
- package/dist/types/core/components/functional/router/router.d.ts +46 -0
- package/dist/types/core/components/functional/router/router.d.ts.map +1 -0
- package/dist/types/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +59 -0
- package/dist/types/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts.map +1 -0
- package/dist/types/core/components/functional/sdui/sdui-utils.d.ts +6 -0
- package/dist/types/core/components/functional/sdui/sdui-utils.d.ts.map +1 -0
- package/dist/types/core/components/functional/sdui/sdui.d.ts +145 -0
- package/dist/types/core/components/functional/sdui/sdui.d.ts.map +1 -0
- package/dist/types/core/components/functional/sdui/types.d.ts +38 -0
- package/dist/types/core/components/functional/sdui/types.d.ts.map +1 -0
- package/dist/types/core/components/functional/sonic-scope/sonic-scope.d.ts +6 -0
- package/dist/types/core/components/functional/sonic-scope/sonic-scope.d.ts.map +1 -0
- package/dist/types/core/components/functional/states/states.d.ts +42 -0
- package/dist/types/core/components/functional/states/states.d.ts.map +1 -0
- package/dist/types/core/components/functional/submit/submit.d.ts +37 -0
- package/dist/types/core/components/functional/submit/submit.d.ts.map +1 -0
- package/dist/types/core/components/functional/subscriber/subscriber.d.ts +13 -0
- package/dist/types/core/components/functional/subscriber/subscriber.d.ts.map +1 -0
- package/dist/types/core/components/functional/translation/translation.d.ts +7 -0
- package/dist/types/core/components/functional/translation/translation.d.ts.map +1 -0
- package/dist/types/core/components/functional/value/value.d.ts +8 -0
- package/dist/types/core/components/functional/value/value.d.ts.map +1 -0
- package/dist/types/core/components/ui/_css/scroll.d.ts +2 -0
- package/dist/types/core/components/ui/_css/scroll.d.ts.map +1 -0
- package/dist/types/core/components/ui/_css/shadow.d.ts +3 -0
- package/dist/types/core/components/ui/_css/shadow.d.ts.map +1 -0
- package/dist/types/core/components/ui/_css/size.d.ts +3 -0
- package/dist/types/core/components/ui/_css/size.d.ts.map +1 -0
- package/dist/types/core/components/ui/_css/type.d.ts +3 -0
- package/dist/types/core/components/ui/_css/type.d.ts.map +1 -0
- package/dist/types/core/components/ui/alert/alert.d.ts +37 -0
- package/dist/types/core/components/ui/alert/alert.d.ts.map +1 -0
- package/dist/types/core/components/ui/alert-messages/alert-messages.d.ts +15 -0
- package/dist/types/core/components/ui/alert-messages/alert-messages.d.ts.map +1 -0
- package/dist/types/core/components/ui/badge/badge.d.ts +27 -0
- package/dist/types/core/components/ui/badge/badge.d.ts.map +1 -0
- package/dist/types/core/components/ui/button/button.d.ts +180 -0
- package/dist/types/core/components/ui/button/button.d.ts.map +1 -0
- package/dist/types/core/components/ui/captcha/altchaStyles.d.ts +2 -0
- package/dist/types/core/components/ui/captcha/altchaStyles.d.ts.map +1 -0
- package/dist/types/core/components/ui/captcha/captcha.d.ts +30 -0
- package/dist/types/core/components/ui/captcha/captcha.d.ts.map +1 -0
- package/dist/types/core/components/ui/card/card-footer.d.ts +6 -0
- package/dist/types/core/components/ui/card/card-footer.d.ts.map +1 -0
- package/dist/types/core/components/ui/card/card-header-descripton.d.ts +6 -0
- package/dist/types/core/components/ui/card/card-header-descripton.d.ts.map +1 -0
- package/dist/types/core/components/ui/card/card-header.d.ts +9 -0
- package/dist/types/core/components/ui/card/card-header.d.ts.map +1 -0
- package/dist/types/core/components/ui/card/card-main.d.ts +6 -0
- package/dist/types/core/components/ui/card/card-main.d.ts.map +1 -0
- package/dist/types/core/components/ui/card/card.d.ts +13 -0
- package/dist/types/core/components/ui/card/card.d.ts.map +1 -0
- package/dist/types/core/components/ui/divider/divider.d.ts +16 -0
- package/dist/types/core/components/ui/divider/divider.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/checkbox/checkbox.d.ts +176 -0
- package/dist/types/core/components/ui/form/checkbox/checkbox.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/css/form-control.d.ts +5 -0
- package/dist/types/core/components/ui/form/css/form-control.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/fieldset/fieldset.d.ts +24 -0
- package/dist/types/core/components/ui/form/fieldset/fieldset.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/fieldset/legend-description.d.ts +6 -0
- package/dist/types/core/components/ui/form/fieldset/legend-description.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/fieldset/legend.d.ts +17 -0
- package/dist/types/core/components/ui/form/fieldset/legend.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/form-actions/form-actions.d.ts +8 -0
- package/dist/types/core/components/ui/form/form-actions/form-actions.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/form-layout/form-layout.d.ts +13 -0
- package/dist/types/core/components/ui/form/form-layout/form-layout.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/input/input.d.ts +123 -0
- package/dist/types/core/components/ui/form/input/input.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/input/password-helper.d.ts +26 -0
- package/dist/types/core/components/ui/form/input/password-helper.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/input/same-value-helper.d.ts +17 -0
- package/dist/types/core/components/ui/form/input/same-value-helper.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +155 -0
- package/dist/types/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/radio/radio.d.ts +15 -0
- package/dist/types/core/components/ui/form/radio/radio.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/select/select.d.ts +59 -0
- package/dist/types/core/components/ui/form/select/select.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/switch/switch.d.ts +6 -0
- package/dist/types/core/components/ui/form/switch/switch.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/textarea/textarea.d.ts +94 -0
- package/dist/types/core/components/ui/form/textarea/textarea.d.ts.map +1 -0
- package/dist/types/core/components/ui/group/group.d.ts +17 -0
- package/dist/types/core/components/ui/group/group.d.ts.map +1 -0
- package/dist/types/core/components/ui/icon/icon.d.ts +28 -0
- package/dist/types/core/components/ui/icon/icon.d.ts.map +1 -0
- package/dist/types/core/components/ui/icon/icons.d.ts +11 -0
- package/dist/types/core/components/ui/icon/icons.d.ts.map +1 -0
- package/dist/types/core/components/ui/image/image.d.ts +16 -0
- package/dist/types/core/components/ui/image/image.d.ts.map +1 -0
- package/dist/types/core/components/ui/link/link.d.ts +30 -0
- package/dist/types/core/components/ui/link/link.d.ts.map +1 -0
- package/dist/types/core/components/ui/loader/loader.d.ts +24 -0
- package/dist/types/core/components/ui/loader/loader.d.ts.map +1 -0
- package/dist/types/core/components/ui/loader/styles/fixed.d.ts +2 -0
- package/dist/types/core/components/ui/loader/styles/fixed.d.ts.map +1 -0
- package/dist/types/core/components/ui/loader/styles/inline.d.ts +2 -0
- package/dist/types/core/components/ui/loader/styles/inline.d.ts.map +1 -0
- package/dist/types/core/components/ui/menu/menu-item.d.ts +6 -0
- package/dist/types/core/components/ui/menu/menu-item.d.ts.map +1 -0
- package/dist/types/core/components/ui/menu/menu.d.ts +52 -0
- package/dist/types/core/components/ui/menu/menu.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal-actions.d.ts +9 -0
- package/dist/types/core/components/ui/modal/modal-actions.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal-close.d.ts +11 -0
- package/dist/types/core/components/ui/modal/modal-close.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal-content.d.ts +6 -0
- package/dist/types/core/components/ui/modal/modal-content.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal-subtitle.d.ts +6 -0
- package/dist/types/core/components/ui/modal/modal-subtitle.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal-title.d.ts +6 -0
- package/dist/types/core/components/ui/modal/modal-title.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal-utils.d.ts +4 -0
- package/dist/types/core/components/ui/modal/modal-utils.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal.d.ts +79 -0
- package/dist/types/core/components/ui/modal/modal.d.ts.map +1 -0
- package/dist/types/core/components/ui/pop/pop.d.ts +42 -0
- package/dist/types/core/components/ui/pop/pop.d.ts.map +1 -0
- package/dist/types/core/components/ui/progress/progress.d.ts +12 -0
- package/dist/types/core/components/ui/progress/progress.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-caption.d.ts +6 -0
- package/dist/types/core/components/ui/table/table-caption.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-tbody.d.ts +6 -0
- package/dist/types/core/components/ui/table/table-tbody.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-td.d.ts +13 -0
- package/dist/types/core/components/ui/table/table-td.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-tfoot.d.ts +6 -0
- package/dist/types/core/components/ui/table/table-tfoot.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-th.d.ts +12 -0
- package/dist/types/core/components/ui/table/table-th.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-thead.d.ts +6 -0
- package/dist/types/core/components/ui/table/table-thead.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-tr.d.ts +14 -0
- package/dist/types/core/components/ui/table/table-tr.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table.d.ts +18 -0
- package/dist/types/core/components/ui/table/table.d.ts.map +1 -0
- package/dist/types/core/components/ui/theme/theme-collection/core-variables.d.ts +2 -0
- package/dist/types/core/components/ui/theme/theme-collection/core-variables.d.ts.map +1 -0
- package/dist/types/core/components/ui/theme/theme-collection/dark.d.ts +2 -0
- package/dist/types/core/components/ui/theme/theme-collection/dark.d.ts.map +1 -0
- package/dist/types/core/components/ui/theme/theme-collection/light.d.ts +2 -0
- package/dist/types/core/components/ui/theme/theme-collection/light.d.ts.map +1 -0
- package/dist/types/core/components/ui/theme/theme.d.ts +20 -0
- package/dist/types/core/components/ui/theme/theme.d.ts.map +1 -0
- package/dist/types/core/components/ui/toast/message-subscriber.d.ts +19 -0
- package/dist/types/core/components/ui/toast/message-subscriber.d.ts.map +1 -0
- package/dist/types/core/components/ui/toast/toast-item.d.ts +41 -0
- package/dist/types/core/components/ui/toast/toast-item.d.ts.map +1 -0
- package/dist/types/core/components/ui/toast/toast.d.ts +28 -0
- package/dist/types/core/components/ui/toast/toast.d.ts.map +1 -0
- package/dist/types/core/components/ui/toast/types.d.ts +12 -0
- package/dist/types/core/components/ui/toast/types.d.ts.map +1 -0
- package/dist/types/core/components/ui/tooltip/tooltip.d.ts +21 -0
- package/dist/types/core/components/ui/tooltip/tooltip.d.ts.map +1 -0
- package/dist/types/core/components/ui/ui.d.ts +35 -0
- package/dist/types/core/components/ui/ui.d.ts.map +1 -0
- package/dist/types/core/core.d.ts +5 -0
- package/dist/types/core/core.d.ts.map +1 -0
- package/dist/types/core/decorators/Subscriber.d.ts +11 -0
- package/dist/types/core/decorators/Subscriber.d.ts.map +1 -0
- package/dist/types/core/decorators/api.d.ts +106 -0
- package/dist/types/core/decorators/api.d.ts.map +1 -0
- package/dist/types/core/decorators/lifecycle.d.ts +19 -0
- package/dist/types/core/decorators/lifecycle.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/ancestorAttribute.d.ts +11 -0
- package/dist/types/core/decorators/subscriber/ancestorAttribute.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/autoFill.d.ts +2 -0
- package/dist/types/core/decorators/subscriber/autoFill.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/autoSubscribe.d.ts +2 -0
- package/dist/types/core/decorators/subscriber/autoSubscribe.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/bind.d.ts +28 -0
- package/dist/types/core/decorators/subscriber/bind.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/common.d.ts +14 -0
- package/dist/types/core/decorators/subscriber/common.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/dynamicPath.d.ts +23 -0
- package/dist/types/core/decorators/subscriber/dynamicPath.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/dynamicPropertyWatch.d.ts +42 -0
- package/dist/types/core/decorators/subscriber/dynamicPropertyWatch.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/handle.d.ts +74 -0
- package/dist/types/core/decorators/subscriber/handle.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/onAssign.d.ts +53 -0
- package/dist/types/core/decorators/subscriber/onAssign.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/publish.d.ts +23 -0
- package/dist/types/core/decorators/subscriber/publish.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/publisherPath.d.ts +3 -0
- package/dist/types/core/decorators/subscriber/publisherPath.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/subscribe.d.ts +20 -0
- package/dist/types/core/decorators/subscriber/subscribe.d.ts.map +1 -0
- package/dist/types/core/directives/DataProvider.d.ts +45 -0
- package/dist/types/core/directives/DataProvider.d.ts.map +1 -0
- package/dist/types/core/directives/Wording.d.ts +44 -0
- package/dist/types/core/directives/Wording.d.ts.map +1 -0
- package/dist/types/core/mixins/Fetcher.d.ts +108 -0
- package/dist/types/core/mixins/Fetcher.d.ts.map +1 -0
- package/dist/types/core/mixins/FormCheckable.d.ts +95 -0
- package/dist/types/core/mixins/FormCheckable.d.ts.map +1 -0
- package/dist/types/core/mixins/FormElement.d.ts +37 -0
- package/dist/types/core/mixins/FormElement.d.ts.map +1 -0
- package/dist/types/core/mixins/FormInput.d.ts +79 -0
- package/dist/types/core/mixins/FormInput.d.ts.map +1 -0
- package/dist/types/core/mixins/Subscriber.d.ts +38 -0
- package/dist/types/core/mixins/Subscriber.d.ts.map +1 -0
- package/dist/types/core/mixins/TemplatesContainer.d.ts +14 -0
- package/dist/types/core/mixins/TemplatesContainer.d.ts.map +1 -0
- package/dist/types/core/mixins/mixins.d.ts +7 -0
- package/dist/types/core/mixins/mixins.d.ts.map +1 -0
- package/dist/types/core/utils/AncestorAttributeObserver.d.ts +38 -0
- package/dist/types/core/utils/AncestorAttributeObserver.d.ts.map +1 -0
- package/dist/types/core/utils/Arrays.d.ts +98 -0
- package/dist/types/core/utils/Arrays.d.ts.map +1 -0
- package/dist/types/core/utils/DataBindObserver.d.ts +84 -0
- package/dist/types/core/utils/DataBindObserver.d.ts.map +1 -0
- package/dist/types/core/utils/Electron.d.ts +8 -0
- package/dist/types/core/utils/Electron.d.ts.map +1 -0
- package/dist/types/core/utils/Format.d.ts +13 -0
- package/dist/types/core/utils/Format.d.ts.map +1 -0
- package/dist/types/core/utils/HTML.d.ts +64 -0
- package/dist/types/core/utils/HTML.d.ts.map +1 -0
- package/dist/types/core/utils/LocationHandler.d.ts +48 -0
- package/dist/types/core/utils/LocationHandler.d.ts.map +1 -0
- package/dist/types/core/utils/Objects.d.ts +31 -0
- package/dist/types/core/utils/Objects.d.ts.map +1 -0
- package/dist/types/core/utils/PublisherProxy.d.ts +230 -0
- package/dist/types/core/utils/PublisherProxy.d.ts.map +1 -0
- package/dist/types/core/utils/Utils.d.ts +6 -0
- package/dist/types/core/utils/Utils.d.ts.map +1 -0
- package/dist/types/core/utils/aesCrypto.d.ts +53 -0
- package/dist/types/core/utils/aesCrypto.d.ts.map +1 -0
- package/dist/types/core/utils/api.d.ts +173 -0
- package/dist/types/core/utils/api.d.ts.map +1 -0
- package/dist/types/core/utils/dataProviderKey.d.ts +56 -0
- package/dist/types/core/utils/dataProviderKey.d.ts.map +1 -0
- package/dist/types/core/utils/endpoint.d.ts +37 -0
- package/dist/types/core/utils/endpoint.d.ts.map +1 -0
- package/dist/types/core/utils/route.d.ts +41 -0
- package/dist/types/core/utils/route.d.ts.map +1 -0
- package/dist/types/core/utils/url-pattern.d.ts +3 -0
- package/dist/types/core/utils/url-pattern.d.ts.map +1 -0
- package/dist/types/dataprovider.d.ts +2 -0
- package/dist/types/dataprovider.d.ts.map +1 -0
- package/dist/types/decorators.d.ts +28 -0
- package/dist/types/decorators.d.ts.map +1 -0
- package/dist/types/directives.d.ts +21 -0
- package/dist/types/directives.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/mixins.d.ts +204 -0
- package/dist/types/mixins.d.ts.map +1 -0
- package/dist/types/test-utils/TestUtils.d.ts +4 -0
- package/dist/types/test-utils/TestUtils.d.ts.map +1 -0
- package/dist/types/utils.d.ts +17 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/docs/assets/index-BEgZEIbv.js +11196 -0
- package/docs/docs-mock-api-sw.js +19 -0
- package/docs/docs-mock-api-sw.js.map +2 -2
- package/docs/index.html +1 -1
- package/docs/src/docs/_core-concept/dataFlow.md +9 -3
- package/docs/src/docs/_decorators/bind.md +2 -2
- package/docs/src/docs/_decorators/get.md +13 -4
- package/docs/src/docs/_decorators/handle.md +5 -1
- package/docs/src/docs/_decorators/on-assign.md +2 -0
- package/docs/src/docs/_decorators/patch.md +45 -0
- package/docs/src/docs/_decorators/post.md +93 -0
- package/docs/src/docs/_decorators/publish.md +1 -1
- package/docs/src/docs/_decorators/put.md +43 -0
- package/docs/src/docs/_decorators/subscribe.md +4 -1
- package/docs/src/docs/_directives/sub.md +1 -1
- package/docs/src/docs/_getting-started/my-first-component.md +1 -1
- package/docs/src/docs/_misc/api-configuration.md +3 -1
- package/docs/src/docs/_misc/dataProviderKey.md +2 -2
- package/docs/src/docs/_misc/dynamic-path.md +71 -0
- package/docs/src/docs/_misc/endpoint.md +5 -3
- package/docs/src/docs/search/docs-search.json +540 -15
- package/docs/src/tsconfig.json +377 -353
- package/gitlab/job_github_mirror.sh +39 -0
- package/index.html +0 -1
- package/package.json +1084 -356
- package/public/docs-mock-api-sw.js +19 -0
- package/public/docs-mock-api-sw.js.map +2 -2
- package/scripts/github-export.mjs +150 -0
- package/scripts/post-build.mjs +43 -0
- package/scripts/pre-build.mjs +32 -4
- package/scripts/pre-publish.mjs +2 -0
- package/src/core/components/functional/example/example.ts +3 -3
- package/src/core/components/functional/queue/queue.ts +2 -2
- package/src/core/components/ui/icon/icon.ts +17 -2
- package/src/core/components/ui/menu/menu.ts +12 -3
- package/src/core/components/ui/modal/modal.ts +1 -1
- package/src/core/decorators/Subscriber.ts +1 -0
- package/src/core/decorators/api.post.spec.ts +293 -0
- package/src/core/decorators/api.spec.ts +6 -6
- package/src/core/decorators/api.ts +641 -12
- package/src/core/decorators/subscriber/ancestorAttribute.spec.ts +197 -0
- package/src/core/decorators/subscriber/ancestorAttribute.ts +40 -7
- package/src/core/decorators/subscriber/autoSubscribe.ts +7 -3
- package/src/core/decorators/subscriber/bind.ts +13 -5
- package/src/core/decorators/subscriber/dynamicPath.spec.ts +53 -0
- package/src/core/decorators/subscriber/dynamicPath.ts +23 -1
- package/src/core/decorators/subscriber/handle.ts +3 -1
- package/src/core/decorators/subscriber/onAssign.ts +10 -2
- package/src/core/decorators/subscriber/publish.ts +12 -2
- package/src/core/mixins/Fetcher.ts +12 -6
- package/src/core/utils/AncestorAttributeObserver.ts +199 -0
- package/src/core/utils/HTML.ts +3 -11
- package/src/core/utils/PublisherProxy.ts +123 -48
- package/src/core/utils/api.ts +82 -13
- package/src/core/utils/dpOptions.spec.ts +56 -0
- package/src/core/utils/endpoint.ts +3 -3
- package/src/css.d.ts +19 -0
- package/src/decorators.ts +17 -1
- package/src/directives.ts +3 -2
- package/src/docs/_core-concept/dataFlow.md +9 -3
- package/src/docs/_decorators/ancestor-attribute.md +56 -8
- package/src/docs/_decorators/bind.md +2 -2
- package/src/docs/_decorators/get.md +13 -4
- package/src/docs/_decorators/handle.md +5 -1
- package/src/docs/_decorators/on-assign.md +2 -0
- package/src/docs/_decorators/patch.md +45 -0
- package/src/docs/_decorators/post.md +93 -0
- package/src/docs/_decorators/publish.md +1 -1
- package/src/docs/_decorators/put.md +43 -0
- package/src/docs/_decorators/subscribe.md +4 -1
- package/src/docs/_directives/sub.md +1 -1
- package/src/docs/_getting-started/my-first-component.md +1 -1
- package/src/docs/_misc/api-configuration.md +3 -1
- package/src/docs/_misc/dataProviderKey.md +2 -2
- package/src/docs/_misc/dynamic-path.md +71 -0
- package/src/docs/_misc/endpoint.md +5 -3
- package/src/docs/components/docs-demo-sources.ts +115 -4
- package/src/docs/components/docs-lit-demo-raw.ts +2 -26
- package/src/docs/components/docs-lit-demo.ts +9 -42
- package/src/docs/components/docs-source-excerpt.ts +53 -0
- package/src/docs/components/docs-source-link.ts +24 -8
- package/src/docs/components/docs-source-raw.ts +34 -0
- package/src/docs/example/decorators-demo-geo.ts +2 -2
- package/src/docs/example/decorators-demo-post.ts +249 -0
- package/src/docs/example/decorators-demo-subscribe-publish-get-demos.ts +5 -5
- package/src/docs/example/decorators-demo.ts +165 -8
- package/src/docs/example/docs-api-config-demos.ts +5 -5
- package/src/docs/mock-api/router.ts +20 -0
- package/src/docs/navigation/navigation.ts +16 -0
- package/src/docs/search/docs-search.json +602 -17
- package/src/tsconfig.declarations.json +22 -0
- package/src/tsconfig.emit.json +23 -0
- package/src/tsconfig.json +3 -261
- package/src/tsconfig.tsbuildinfo +1 -1
- package/vite.config.mts +1 -1
- package/docs/assets/index-CwtPzTFq.js +0 -7508
|
@@ -8,11 +8,12 @@ import HTML, {
|
|
|
8
8
|
} from "@supersoniks/concorde/core/utils/HTML";
|
|
9
9
|
import API, {
|
|
10
10
|
APIConfiguration,
|
|
11
|
-
type
|
|
11
|
+
type ApiResult,
|
|
12
12
|
} from "@supersoniks/concorde/core/utils/api";
|
|
13
13
|
import DataProvider from "../utils/PublisherProxy";
|
|
14
14
|
import { ConnectedComponent, setSubscribable } from "./subscriber/common";
|
|
15
15
|
import {
|
|
16
|
+
type DynamicPathOptions,
|
|
16
17
|
extractDynamicDependencies,
|
|
17
18
|
resolveDynamicPath,
|
|
18
19
|
} from "./subscriber/dynamicPath";
|
|
@@ -77,6 +78,22 @@ function isLitHost(component: unknown): component is LitHost {
|
|
|
77
78
|
);
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Regroupe plusieurs déclencheurs synchrones (mutations `onInternalMutation`,
|
|
83
|
+
* `rebindAll`, etc.) en un seul appel par frame — même principe que
|
|
84
|
+
* `dynamicPropertyWatch.ts` (`scheduleObservedPropertyChanges`).
|
|
85
|
+
*/
|
|
86
|
+
function createAnimationFrameCoalescedRunner(run: () => void): () => void {
|
|
87
|
+
let frameId: number | null = null;
|
|
88
|
+
return () => {
|
|
89
|
+
if (frameId !== null) return;
|
|
90
|
+
frameId = requestAnimationFrame(() => {
|
|
91
|
+
frameId = null;
|
|
92
|
+
run();
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
80
97
|
function scheduleAfterHostReady(
|
|
81
98
|
component: unknown,
|
|
82
99
|
callback: () => void,
|
|
@@ -163,7 +180,7 @@ function detachConfigPublisher(state: ApiGetState): void {
|
|
|
163
180
|
|
|
164
181
|
/**
|
|
165
182
|
* Décorateur **`@get`** : charge des données via `API.getDetailed` et assigne un
|
|
166
|
-
* `
|
|
183
|
+
* `ApiResult<T>` (`request`, `response`, `result` typé `T`) ou `null`.
|
|
167
184
|
* Le path est un `Endpoint<T, Ue>` ; les placeholders `${nomPropriété}` sont résolus sur l'instance (`Ue` contraint l’hôte).
|
|
168
185
|
*
|
|
169
186
|
* **Scoped (défaut)** : `HTML.getApiConfiguration(host)` avec `host` = l’élément connecté
|
|
@@ -176,19 +193,19 @@ function detachConfigPublisher(state: ApiGetState): void {
|
|
|
176
193
|
*
|
|
177
194
|
* @example
|
|
178
195
|
* @get(new Endpoint<User, { userId: string }>("users/${userId}"))
|
|
179
|
-
* payload?:
|
|
196
|
+
* payload?: ApiResult<User>;
|
|
180
197
|
*
|
|
181
198
|
* @example
|
|
182
199
|
* const apiConf = new DataProviderKey<APIConfiguration>("myApiConf");
|
|
183
200
|
* PublisherManager.get("myApiConf").set({ serviceURL: "...", token: null, ... });
|
|
184
201
|
* @get(new Endpoint<Thing, { id: string }>("things/${id}"), apiConf)
|
|
185
|
-
* payload?:
|
|
202
|
+
* payload?: ApiResult<Thing>;
|
|
186
203
|
*/
|
|
187
204
|
export function get<T, Ue = any>(
|
|
188
205
|
endpoint: Endpoint<T, Ue>,
|
|
189
206
|
): <K extends string>(
|
|
190
207
|
target: DataProviderKeyHost<Ue> & {
|
|
191
|
-
[P in K]?:
|
|
208
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
192
209
|
},
|
|
193
210
|
propertyKey: K,
|
|
194
211
|
) => void;
|
|
@@ -198,18 +215,50 @@ export function get<T, Ue = any, Uk = any>(
|
|
|
198
215
|
): <K extends string>(
|
|
199
216
|
target: DataProviderKeyHost<Ue> &
|
|
200
217
|
DataProviderKeyHost<Uk> & {
|
|
201
|
-
[P in K]?:
|
|
218
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
202
219
|
},
|
|
203
220
|
propertyKey: K,
|
|
204
221
|
) => void;
|
|
205
222
|
export function get<T, Ue = any, Uk = any>(
|
|
206
223
|
endpoint: Endpoint<T, Ue>,
|
|
207
|
-
|
|
224
|
+
options: GetOptions,
|
|
208
225
|
): <K extends string>(
|
|
209
|
-
target:
|
|
226
|
+
target: DataProviderKeyHost<Ue> & {
|
|
227
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
228
|
+
},
|
|
229
|
+
propertyKey: K,
|
|
230
|
+
) => void;
|
|
231
|
+
export function get<T, Ue = any, Uk = any, Ut = any>(
|
|
232
|
+
endpoint: Endpoint<T, Ue>,
|
|
233
|
+
configurationKey: DataProviderKey<APIConfiguration, Uk>,
|
|
234
|
+
options: GetOptions,
|
|
235
|
+
): <K extends string>(
|
|
236
|
+
target: DataProviderKeyHost<Ue> &
|
|
237
|
+
DataProviderKeyHost<Uk> & {
|
|
238
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
239
|
+
},
|
|
240
|
+
propertyKey: K,
|
|
241
|
+
) => void;
|
|
242
|
+
export function get<T, Ue = any, Uk = any, _Ut = any>(
|
|
243
|
+
endpoint: Endpoint<T, Ue>,
|
|
244
|
+
configurationKeyOrOptions?:
|
|
245
|
+
| DataProviderKey<APIConfiguration, Uk>
|
|
246
|
+
| GetOptions,
|
|
247
|
+
maybeOptions?: GetOptions,
|
|
248
|
+
): <K extends string>(
|
|
249
|
+
target: object & { [P in K]?: ApiResult<T> | null | undefined },
|
|
210
250
|
propertyKey: K,
|
|
211
251
|
) => void {
|
|
212
252
|
const pathTemplate = endpoint.path;
|
|
253
|
+
const configurationKey = isGetOptions(configurationKeyOrOptions)
|
|
254
|
+
? undefined
|
|
255
|
+
: configurationKeyOrOptions;
|
|
256
|
+
const options = isGetOptions(configurationKeyOrOptions)
|
|
257
|
+
? configurationKeyOrOptions
|
|
258
|
+
: maybeOptions;
|
|
259
|
+
const pathOptions: DynamicPathOptions = {
|
|
260
|
+
skipEmptyPlaceholder: options?.skipEmptyPlaceholder,
|
|
261
|
+
};
|
|
213
262
|
const configurationKeyPath = configurationKey?.path;
|
|
214
263
|
const endpointDynamicDependencies = extractDynamicDependencies(pathTemplate);
|
|
215
264
|
const configKeyDynamicDependencies = configurationKeyPath
|
|
@@ -249,7 +298,7 @@ export function get<T, Ue = any, Uk = any>(
|
|
|
249
298
|
|
|
250
299
|
const runFetch = () => {
|
|
251
300
|
const resolution = isDynamicPath
|
|
252
|
-
? resolveDynamicPath(component, pathTemplate)
|
|
301
|
+
? resolveDynamicPath(component, pathTemplate, pathOptions)
|
|
253
302
|
: { ready: true, path: pathTemplate };
|
|
254
303
|
if (!resolution.ready || !resolution.path) {
|
|
255
304
|
comp[propertyKey] = undefined;
|
|
@@ -257,7 +306,11 @@ export function get<T, Ue = any, Uk = any>(
|
|
|
257
306
|
}
|
|
258
307
|
let config: APIConfiguration | null = null;
|
|
259
308
|
if (usesPublisherConfig && configurationKeyPath) {
|
|
260
|
-
const configRes = resolveDynamicPath(
|
|
309
|
+
const configRes = resolveDynamicPath(
|
|
310
|
+
component,
|
|
311
|
+
configurationKeyPath,
|
|
312
|
+
pathOptions,
|
|
313
|
+
);
|
|
261
314
|
if (!configRes.ready || !configRes.path) {
|
|
262
315
|
comp[propertyKey] = undefined;
|
|
263
316
|
return;
|
|
@@ -282,7 +335,7 @@ export function get<T, Ue = any, Uk = any>(
|
|
|
282
335
|
const api = new API(config);
|
|
283
336
|
void api
|
|
284
337
|
.getDetailed<T>(resolution.path)
|
|
285
|
-
.then((payload?:
|
|
338
|
+
.then((payload?: ApiResult<T>) => {
|
|
286
339
|
if (generation !== state.requestGeneration) return;
|
|
287
340
|
comp[propertyKey] = payload;
|
|
288
341
|
});
|
|
@@ -291,7 +344,11 @@ export function get<T, Ue = any, Uk = any>(
|
|
|
291
344
|
const rebindPublisherConfig = () => {
|
|
292
345
|
if (!usesPublisherConfig || !configurationKeyPath) return;
|
|
293
346
|
detachConfigPublisher(state);
|
|
294
|
-
const configRes = resolveDynamicPath(
|
|
347
|
+
const configRes = resolveDynamicPath(
|
|
348
|
+
component,
|
|
349
|
+
configurationKeyPath,
|
|
350
|
+
pathOptions,
|
|
351
|
+
);
|
|
295
352
|
if (!configRes.ready || !configRes.path) {
|
|
296
353
|
comp[propertyKey] = undefined;
|
|
297
354
|
return;
|
|
@@ -355,3 +412,575 @@ export function get<T, Ue = any, Uk = any>(
|
|
|
355
412
|
});
|
|
356
413
|
};
|
|
357
414
|
}
|
|
415
|
+
|
|
416
|
+
export type GetOptions = DynamicPathOptions;
|
|
417
|
+
|
|
418
|
+
export type ApiSendOptions<Uk = any> = DynamicPathOptions & {
|
|
419
|
+
/** Intervalle de renvoi automatique (ms). 0 ou absent = pas de polling. */
|
|
420
|
+
refetchEveryMs?: number;
|
|
421
|
+
/** Ne pas envoyer si le body publisher est null/undefined (défaut: true). */
|
|
422
|
+
skipIfBodyMissing?: boolean;
|
|
423
|
+
/**
|
|
424
|
+
* Relancer l'envoi quand le body publisher mute (défaut: true).
|
|
425
|
+
* `false` : le body est lu au moment de l'envoi ; déclencher via `triggerKey.invalidate()`.
|
|
426
|
+
*/
|
|
427
|
+
autoPostOnBodyMutation?: boolean;
|
|
428
|
+
/** Publisher dont `invalidate()` relance l'envoi (relit le body courant). */
|
|
429
|
+
triggerKey?: DataProviderKey<unknown, Uk>;
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
/** @deprecated Alias — préférer `ApiSendOptions`. */
|
|
433
|
+
export type PostOptions<Uk = any> = ApiSendOptions<Uk>;
|
|
434
|
+
export type PutOptions<Uk = any> = ApiSendOptions<Uk>;
|
|
435
|
+
export type PatchOptions<Uk = any> = ApiSendOptions<Uk>;
|
|
436
|
+
|
|
437
|
+
function isGetOptions(value: unknown): value is GetOptions {
|
|
438
|
+
if (!value || typeof value !== "object") return false;
|
|
439
|
+
return "skipEmptyPlaceholder" in value;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function isApiSendOptions(value: unknown): value is ApiSendOptions {
|
|
443
|
+
if (!value || typeof value !== "object") return false;
|
|
444
|
+
return (
|
|
445
|
+
"refetchEveryMs" in value ||
|
|
446
|
+
"skipIfBodyMissing" in value ||
|
|
447
|
+
"autoPostOnBodyMutation" in value ||
|
|
448
|
+
"skipEmptyPlaceholder" in value ||
|
|
449
|
+
"triggerKey" in value
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
type ApiSendState = ApiGetState & {
|
|
454
|
+
bodyPublisher: DataProvider | null;
|
|
455
|
+
bodyMutationHandler: (() => void) | null;
|
|
456
|
+
triggerPublisher: DataProvider | null;
|
|
457
|
+
triggerInvalidateHandler: (() => void) | null;
|
|
458
|
+
refetchTimeoutId: ReturnType<typeof setTimeout> | null;
|
|
459
|
+
refetchEveryMs: number;
|
|
460
|
+
skipIfBodyMissing: boolean;
|
|
461
|
+
autoPostOnBodyMutation: boolean;
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
function detachBodyPublisher(state: ApiSendState): void {
|
|
465
|
+
if (state.bodyPublisher && state.bodyMutationHandler) {
|
|
466
|
+
state.bodyPublisher.offInternalMutation(state.bodyMutationHandler);
|
|
467
|
+
}
|
|
468
|
+
state.bodyPublisher = null;
|
|
469
|
+
state.bodyMutationHandler = null;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
function detachTriggerPublisher(state: ApiSendState): void {
|
|
473
|
+
if (state.triggerPublisher && state.triggerInvalidateHandler) {
|
|
474
|
+
state.triggerPublisher.offInvalidate(state.triggerInvalidateHandler);
|
|
475
|
+
}
|
|
476
|
+
state.triggerPublisher = null;
|
|
477
|
+
state.triggerInvalidateHandler = null;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
function clearSendRefetch(state: ApiSendState): void {
|
|
481
|
+
if (state.refetchTimeoutId) {
|
|
482
|
+
clearTimeout(state.refetchTimeoutId);
|
|
483
|
+
state.refetchTimeoutId = null;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function readBodyFromPublisher(publisher: DataProvider | null): unknown {
|
|
488
|
+
if (!publisher || typeof publisher.get !== "function") return undefined;
|
|
489
|
+
return publisher.get();
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
type ApiSendMethod = "POST" | "PUT" | "PATCH";
|
|
493
|
+
|
|
494
|
+
type ApiSendDetailedCaller = (
|
|
495
|
+
api: API,
|
|
496
|
+
path: string,
|
|
497
|
+
body: unknown,
|
|
498
|
+
) => Promise<ApiResult<unknown> | undefined>;
|
|
499
|
+
|
|
500
|
+
function createApiSendDecorator<T, B, Ue = any, Uk = any, Ut = any>(
|
|
501
|
+
method: ApiSendMethod,
|
|
502
|
+
callDetailed: ApiSendDetailedCaller,
|
|
503
|
+
) {
|
|
504
|
+
return function (
|
|
505
|
+
endpoint: Endpoint<T, Ue>,
|
|
506
|
+
bodyKey: DataProviderKey<B>,
|
|
507
|
+
configurationKeyOrOptions?:
|
|
508
|
+
| DataProviderKey<APIConfiguration, Uk>
|
|
509
|
+
| ApiSendOptions<Ut>,
|
|
510
|
+
maybeOptions?: ApiSendOptions<Ut>,
|
|
511
|
+
): <K extends string>(
|
|
512
|
+
target: object & { [P in K]?: ApiResult<T> | null | undefined },
|
|
513
|
+
propertyKey: K,
|
|
514
|
+
) => void {
|
|
515
|
+
const pathTemplate = endpoint.path;
|
|
516
|
+
const bodyKeyPath = bodyKey.path;
|
|
517
|
+
const configurationKey = isApiSendOptions(configurationKeyOrOptions)
|
|
518
|
+
? undefined
|
|
519
|
+
: configurationKeyOrOptions;
|
|
520
|
+
const options = isApiSendOptions(configurationKeyOrOptions)
|
|
521
|
+
? configurationKeyOrOptions
|
|
522
|
+
: maybeOptions;
|
|
523
|
+
const configurationKeyPath = configurationKey?.path;
|
|
524
|
+
const triggerKeyPath = options?.triggerKey?.path;
|
|
525
|
+
const endpointDynamicDependencies =
|
|
526
|
+
extractDynamicDependencies(pathTemplate);
|
|
527
|
+
const bodyKeyDynamicDependencies = extractDynamicDependencies(bodyKeyPath);
|
|
528
|
+
const configKeyDynamicDependencies = configurationKeyPath
|
|
529
|
+
? extractDynamicDependencies(configurationKeyPath)
|
|
530
|
+
: [];
|
|
531
|
+
const triggerKeyDynamicDependencies = triggerKeyPath
|
|
532
|
+
? extractDynamicDependencies(triggerKeyPath)
|
|
533
|
+
: [];
|
|
534
|
+
const mergedDynamicDependencies = [
|
|
535
|
+
...new Set([
|
|
536
|
+
...endpointDynamicDependencies,
|
|
537
|
+
...bodyKeyDynamicDependencies,
|
|
538
|
+
...configKeyDynamicDependencies,
|
|
539
|
+
...triggerKeyDynamicDependencies,
|
|
540
|
+
]),
|
|
541
|
+
];
|
|
542
|
+
const isDynamicPath = endpointDynamicDependencies.length > 0;
|
|
543
|
+
const usesPublisherConfig = Boolean(configurationKeyPath);
|
|
544
|
+
const refetchEveryMs = options?.refetchEveryMs ?? 0;
|
|
545
|
+
const skipIfBodyMissing = options?.skipIfBodyMissing ?? true;
|
|
546
|
+
const autoPostOnBodyMutation = options?.autoPostOnBodyMutation ?? true;
|
|
547
|
+
const pathOptions: DynamicPathOptions = {
|
|
548
|
+
skipEmptyPlaceholder: options?.skipEmptyPlaceholder,
|
|
549
|
+
};
|
|
550
|
+
const stateKeyPrefix = `__${method.toLowerCase()}_state_`;
|
|
551
|
+
|
|
552
|
+
return function (target: object, propertyKey: string) {
|
|
553
|
+
if (!target) return;
|
|
554
|
+
setSubscribable(target);
|
|
555
|
+
const stateKey = `${stateKeyPrefix}${propertyKey}`;
|
|
556
|
+
|
|
557
|
+
(target as ConnectedComponent).__onConnected__((component) => {
|
|
558
|
+
const comp = component as Record<string, unknown>;
|
|
559
|
+
let state = comp[stateKey] as ApiSendState | undefined;
|
|
560
|
+
if (!state) {
|
|
561
|
+
state = {
|
|
562
|
+
cleanupWatchers: [],
|
|
563
|
+
requestGeneration: 0,
|
|
564
|
+
configPublisher: null,
|
|
565
|
+
configMutationHandler: null,
|
|
566
|
+
scopeWatchCleanup: null,
|
|
567
|
+
bodyPublisher: null,
|
|
568
|
+
bodyMutationHandler: null,
|
|
569
|
+
triggerPublisher: null,
|
|
570
|
+
triggerInvalidateHandler: null,
|
|
571
|
+
refetchTimeoutId: null,
|
|
572
|
+
refetchEveryMs,
|
|
573
|
+
skipIfBodyMissing,
|
|
574
|
+
autoPostOnBodyMutation,
|
|
575
|
+
};
|
|
576
|
+
comp[stateKey] = state;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
state.cleanupWatchers.forEach((cleanup) => cleanup());
|
|
580
|
+
state.cleanupWatchers = [];
|
|
581
|
+
state.requestGeneration++;
|
|
582
|
+
state.refetchEveryMs = refetchEveryMs;
|
|
583
|
+
state.skipIfBodyMissing = skipIfBodyMissing;
|
|
584
|
+
state.autoPostOnBodyMutation = autoPostOnBodyMutation;
|
|
585
|
+
clearSendRefetch(state);
|
|
586
|
+
|
|
587
|
+
const scheduleRefetch = () => {
|
|
588
|
+
clearSendRefetch(state);
|
|
589
|
+
if (!state.refetchEveryMs || state.refetchEveryMs <= 0) return;
|
|
590
|
+
state.refetchTimeoutId = setTimeout(() => {
|
|
591
|
+
state.refetchTimeoutId = null;
|
|
592
|
+
runSend();
|
|
593
|
+
}, state.refetchEveryMs);
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
const runSend = () => {
|
|
597
|
+
const resolution = isDynamicPath
|
|
598
|
+
? resolveDynamicPath(component, pathTemplate, pathOptions)
|
|
599
|
+
: { ready: true, path: pathTemplate };
|
|
600
|
+
if (!resolution.ready || !resolution.path) {
|
|
601
|
+
comp[propertyKey] = undefined;
|
|
602
|
+
scheduleRefetch();
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
const bodyResolution = resolveDynamicPath(
|
|
607
|
+
component,
|
|
608
|
+
bodyKeyPath,
|
|
609
|
+
pathOptions,
|
|
610
|
+
);
|
|
611
|
+
if (!bodyResolution.ready || !bodyResolution.path) {
|
|
612
|
+
comp[propertyKey] = undefined;
|
|
613
|
+
scheduleRefetch();
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
const bodyPublisher = getPublisherFromPath(bodyResolution.path);
|
|
618
|
+
const body = readBodyFromPublisher(bodyPublisher);
|
|
619
|
+
if (
|
|
620
|
+
state.skipIfBodyMissing &&
|
|
621
|
+
(body === null || body === undefined)
|
|
622
|
+
) {
|
|
623
|
+
scheduleRefetch();
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
let config: APIConfiguration | null = null;
|
|
628
|
+
if (usesPublisherConfig && configurationKeyPath) {
|
|
629
|
+
const configRes = resolveDynamicPath(
|
|
630
|
+
component,
|
|
631
|
+
configurationKeyPath,
|
|
632
|
+
pathOptions,
|
|
633
|
+
);
|
|
634
|
+
if (!configRes.ready || !configRes.path) {
|
|
635
|
+
comp[propertyKey] = undefined;
|
|
636
|
+
scheduleRefetch();
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
const configPublisher = getPublisherFromPath(configRes.path);
|
|
640
|
+
config = readApiConfigurationFromPublisher(configPublisher);
|
|
641
|
+
} else {
|
|
642
|
+
config = resolveScopedConfiguration(component);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
if (!isScopedConfigurationReady(config)) {
|
|
646
|
+
if (!usesPublisherConfig && !state.scopeWatchCleanup) {
|
|
647
|
+
const scopeWatch = watchScopedConfiguration(component, runSend);
|
|
648
|
+
state.scopeWatchCleanup = scopeWatch;
|
|
649
|
+
state.cleanupWatchers.push(() => {
|
|
650
|
+
scopeWatch();
|
|
651
|
+
state.scopeWatchCleanup = null;
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
scheduleRefetch();
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
const generation = ++state.requestGeneration;
|
|
659
|
+
const api = new API(config);
|
|
660
|
+
void callDetailed(api, resolution.path, body).then(
|
|
661
|
+
(payload?: ApiResult<unknown>) => {
|
|
662
|
+
if (generation !== state.requestGeneration) return;
|
|
663
|
+
comp[propertyKey] = payload;
|
|
664
|
+
scheduleRefetch();
|
|
665
|
+
},
|
|
666
|
+
);
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
const scheduleSend = createAnimationFrameCoalescedRunner(runSend);
|
|
670
|
+
|
|
671
|
+
const rebindBodyPublisher = () => {
|
|
672
|
+
detachBodyPublisher(state);
|
|
673
|
+
if (!state.autoPostOnBodyMutation) {
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
const bodyResolution = resolveDynamicPath(
|
|
677
|
+
component,
|
|
678
|
+
bodyKeyPath,
|
|
679
|
+
pathOptions,
|
|
680
|
+
);
|
|
681
|
+
if (!bodyResolution.ready || !bodyResolution.path) {
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
const publisher = getPublisherFromPath(bodyResolution.path);
|
|
685
|
+
if (!publisher) return;
|
|
686
|
+
const mutationHandler = () => scheduleSend();
|
|
687
|
+
publisher.onInternalMutation(mutationHandler);
|
|
688
|
+
state.bodyPublisher = publisher;
|
|
689
|
+
state.bodyMutationHandler = mutationHandler;
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
const rebindTriggerPublisher = () => {
|
|
693
|
+
detachTriggerPublisher(state);
|
|
694
|
+
if (!triggerKeyPath) return;
|
|
695
|
+
const triggerResolution = resolveDynamicPath(
|
|
696
|
+
component,
|
|
697
|
+
triggerKeyPath,
|
|
698
|
+
pathOptions,
|
|
699
|
+
);
|
|
700
|
+
if (!triggerResolution.ready || !triggerResolution.path) {
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
const publisher = getPublisherFromPath(triggerResolution.path);
|
|
704
|
+
if (!publisher) return;
|
|
705
|
+
const invalidateHandler = () => scheduleSend();
|
|
706
|
+
publisher.onInvalidate(invalidateHandler);
|
|
707
|
+
state.triggerPublisher = publisher;
|
|
708
|
+
state.triggerInvalidateHandler = invalidateHandler;
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
const rebindPublisherConfig = () => {
|
|
712
|
+
if (!usesPublisherConfig || !configurationKeyPath) return;
|
|
713
|
+
detachConfigPublisher(state);
|
|
714
|
+
const configRes = resolveDynamicPath(
|
|
715
|
+
component,
|
|
716
|
+
configurationKeyPath,
|
|
717
|
+
pathOptions,
|
|
718
|
+
);
|
|
719
|
+
if (!configRes.ready || !configRes.path) {
|
|
720
|
+
comp[propertyKey] = undefined;
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
const publisher = getPublisherFromPath(configRes.path);
|
|
724
|
+
if (!publisher) {
|
|
725
|
+
comp[propertyKey] = undefined;
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
const mutationHandler = () => scheduleSend();
|
|
729
|
+
publisher.onInternalMutation(mutationHandler);
|
|
730
|
+
state.configPublisher = publisher;
|
|
731
|
+
state.configMutationHandler = mutationHandler;
|
|
732
|
+
};
|
|
733
|
+
|
|
734
|
+
const rebindAll = () => {
|
|
735
|
+
rebindBodyPublisher();
|
|
736
|
+
rebindTriggerPublisher();
|
|
737
|
+
rebindPublisherConfig();
|
|
738
|
+
if (state.autoPostOnBodyMutation) {
|
|
739
|
+
scheduleSend();
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
if (
|
|
744
|
+
usesPublisherConfig ||
|
|
745
|
+
bodyKeyDynamicDependencies.length ||
|
|
746
|
+
triggerKeyDynamicDependencies.length
|
|
747
|
+
) {
|
|
748
|
+
for (const dependency of mergedDynamicDependencies) {
|
|
749
|
+
const unsubscribe = observeDynamicProperty(
|
|
750
|
+
getDynamicWatchKeys.watcherStore,
|
|
751
|
+
getDynamicWatchKeys.hooked,
|
|
752
|
+
component,
|
|
753
|
+
dependency,
|
|
754
|
+
() => rebindAll(),
|
|
755
|
+
);
|
|
756
|
+
state.cleanupWatchers.push(unsubscribe);
|
|
757
|
+
}
|
|
758
|
+
rebindAll();
|
|
759
|
+
} else {
|
|
760
|
+
const startScopedSend = () => {
|
|
761
|
+
if (isDynamicPath) {
|
|
762
|
+
for (const dependency of endpointDynamicDependencies) {
|
|
763
|
+
const unsubscribe = observeDynamicProperty(
|
|
764
|
+
getDynamicWatchKeys.watcherStore,
|
|
765
|
+
getDynamicWatchKeys.hooked,
|
|
766
|
+
component,
|
|
767
|
+
dependency,
|
|
768
|
+
() => scheduleSend(),
|
|
769
|
+
);
|
|
770
|
+
state.cleanupWatchers.push(unsubscribe);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
rebindBodyPublisher();
|
|
774
|
+
rebindTriggerPublisher();
|
|
775
|
+
if (state.autoPostOnBodyMutation) {
|
|
776
|
+
scheduleSend();
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
state.cleanupWatchers.push(
|
|
780
|
+
scheduleAfterHostReady(component, startScopedSend),
|
|
781
|
+
);
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
|
|
785
|
+
(target as ConnectedComponent).__onDisconnected__((component) => {
|
|
786
|
+
const comp = component as Record<string, unknown>;
|
|
787
|
+
const state = comp[stateKey] as ApiSendState | undefined;
|
|
788
|
+
if (!state) return;
|
|
789
|
+
detachConfigPublisher(state);
|
|
790
|
+
detachBodyPublisher(state);
|
|
791
|
+
detachTriggerPublisher(state);
|
|
792
|
+
clearSendRefetch(state);
|
|
793
|
+
state.cleanupWatchers.forEach((cleanup) => cleanup());
|
|
794
|
+
state.cleanupWatchers = [];
|
|
795
|
+
state.requestGeneration++;
|
|
796
|
+
comp[propertyKey] = undefined;
|
|
797
|
+
});
|
|
798
|
+
};
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* Décorateur **`@post`** : envoie des données via `API.postDetailed` et assigne un
|
|
804
|
+
* `ApiResult<T>` (`request`, `response`, `result` typé `T`).
|
|
805
|
+
*
|
|
806
|
+
* Le body est lu depuis un `DataProviderKey` (mutations et assignations relancent le POST).
|
|
807
|
+
*
|
|
808
|
+
* @example
|
|
809
|
+
* @post(new Endpoint<SyncResult, { sessionId: string }>("sessions/${sessionId}/sync"), syncRequestKey)
|
|
810
|
+
* payload?: ApiResult<SyncResult>;
|
|
811
|
+
*/
|
|
812
|
+
export function post<T, B, Ue = any>(
|
|
813
|
+
endpoint: Endpoint<T, Ue>,
|
|
814
|
+
bodyKey: DataProviderKey<B>,
|
|
815
|
+
): <K extends string>(
|
|
816
|
+
target: DataProviderKeyHost<Ue> & {
|
|
817
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
818
|
+
},
|
|
819
|
+
propertyKey: K,
|
|
820
|
+
) => void;
|
|
821
|
+
export function post<T, B, Ue = any, Uk = any>(
|
|
822
|
+
endpoint: Endpoint<T, Ue>,
|
|
823
|
+
bodyKey: DataProviderKey<B>,
|
|
824
|
+
configurationKey: DataProviderKey<APIConfiguration, Uk>,
|
|
825
|
+
): <K extends string>(
|
|
826
|
+
target: DataProviderKeyHost<Ue> &
|
|
827
|
+
DataProviderKeyHost<Uk> & {
|
|
828
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
829
|
+
},
|
|
830
|
+
propertyKey: K,
|
|
831
|
+
) => void;
|
|
832
|
+
export function post<T, B, Ue = any, Uk = any>(
|
|
833
|
+
endpoint: Endpoint<T, Ue>,
|
|
834
|
+
bodyKey: DataProviderKey<B>,
|
|
835
|
+
options: PostOptions<Uk>,
|
|
836
|
+
): <K extends string>(
|
|
837
|
+
target: DataProviderKeyHost<Ue> & {
|
|
838
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
839
|
+
},
|
|
840
|
+
propertyKey: K,
|
|
841
|
+
) => void;
|
|
842
|
+
export function post<T, B, Ue = any, Uk = any, Ut = any>(
|
|
843
|
+
endpoint: Endpoint<T, Ue>,
|
|
844
|
+
bodyKey: DataProviderKey<B>,
|
|
845
|
+
configurationKey: DataProviderKey<APIConfiguration, Uk>,
|
|
846
|
+
options: PostOptions<Ut>,
|
|
847
|
+
): <K extends string>(
|
|
848
|
+
target: DataProviderKeyHost<Ue> &
|
|
849
|
+
DataProviderKeyHost<Uk> & {
|
|
850
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
851
|
+
},
|
|
852
|
+
propertyKey: K,
|
|
853
|
+
) => void;
|
|
854
|
+
export function post<T, B, Ue = any, Uk = any, Ut = any>(
|
|
855
|
+
endpoint: Endpoint<T, Ue>,
|
|
856
|
+
bodyKey: DataProviderKey<B>,
|
|
857
|
+
configurationKeyOrOptions?:
|
|
858
|
+
| DataProviderKey<APIConfiguration, Uk>
|
|
859
|
+
| PostOptions<Ut>,
|
|
860
|
+
maybeOptions?: PostOptions<Ut>,
|
|
861
|
+
): <K extends string>(
|
|
862
|
+
target: object & { [P in K]?: ApiResult<T> | null | undefined },
|
|
863
|
+
propertyKey: K,
|
|
864
|
+
) => void {
|
|
865
|
+
return createApiSendDecorator<T, B, Ue, Uk, Ut>("POST", (api, path, body) =>
|
|
866
|
+
api.postDetailed<T, B>(path, body as B),
|
|
867
|
+
)(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions);
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/** `@put` — même modèle que `@post` via `API.putDetailed`. */
|
|
871
|
+
export function put<T, B, Ue = any>(
|
|
872
|
+
endpoint: Endpoint<T, Ue>,
|
|
873
|
+
bodyKey: DataProviderKey<B>,
|
|
874
|
+
): <K extends string>(
|
|
875
|
+
target: DataProviderKeyHost<Ue> & {
|
|
876
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
877
|
+
},
|
|
878
|
+
propertyKey: K,
|
|
879
|
+
) => void;
|
|
880
|
+
export function put<T, B, Ue = any, Uk = any>(
|
|
881
|
+
endpoint: Endpoint<T, Ue>,
|
|
882
|
+
bodyKey: DataProviderKey<B>,
|
|
883
|
+
configurationKey: DataProviderKey<APIConfiguration, Uk>,
|
|
884
|
+
): <K extends string>(
|
|
885
|
+
target: DataProviderKeyHost<Ue> &
|
|
886
|
+
DataProviderKeyHost<Uk> & {
|
|
887
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
888
|
+
},
|
|
889
|
+
propertyKey: K,
|
|
890
|
+
) => void;
|
|
891
|
+
export function put<T, B, Ue = any, Uk = any>(
|
|
892
|
+
endpoint: Endpoint<T, Ue>,
|
|
893
|
+
bodyKey: DataProviderKey<B>,
|
|
894
|
+
options: PutOptions<Uk>,
|
|
895
|
+
): <K extends string>(
|
|
896
|
+
target: DataProviderKeyHost<Ue> & {
|
|
897
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
898
|
+
},
|
|
899
|
+
propertyKey: K,
|
|
900
|
+
) => void;
|
|
901
|
+
export function put<T, B, Ue = any, Uk = any, Ut = any>(
|
|
902
|
+
endpoint: Endpoint<T, Ue>,
|
|
903
|
+
bodyKey: DataProviderKey<B>,
|
|
904
|
+
configurationKey: DataProviderKey<APIConfiguration, Uk>,
|
|
905
|
+
options: PutOptions<Ut>,
|
|
906
|
+
): <K extends string>(
|
|
907
|
+
target: DataProviderKeyHost<Ue> &
|
|
908
|
+
DataProviderKeyHost<Uk> & {
|
|
909
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
910
|
+
},
|
|
911
|
+
propertyKey: K,
|
|
912
|
+
) => void;
|
|
913
|
+
export function put<T, B, Ue = any, Uk = any, Ut = any>(
|
|
914
|
+
endpoint: Endpoint<T, Ue>,
|
|
915
|
+
bodyKey: DataProviderKey<B>,
|
|
916
|
+
configurationKeyOrOptions?:
|
|
917
|
+
| DataProviderKey<APIConfiguration, Uk>
|
|
918
|
+
| PutOptions<Ut>,
|
|
919
|
+
maybeOptions?: PutOptions<Ut>,
|
|
920
|
+
): <K extends string>(
|
|
921
|
+
target: object & { [P in K]?: ApiResult<T> | null | undefined },
|
|
922
|
+
propertyKey: K,
|
|
923
|
+
) => void {
|
|
924
|
+
return createApiSendDecorator<T, B, Ue, Uk, Ut>("PUT", (api, path, body) =>
|
|
925
|
+
api.putDetailed<T, B>(path, body as B),
|
|
926
|
+
)(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/** `@patch` — même modèle que `@post` via `API.patchDetailed`. */
|
|
930
|
+
export function patch<T, B, Ue = any>(
|
|
931
|
+
endpoint: Endpoint<T, Ue>,
|
|
932
|
+
bodyKey: DataProviderKey<B>,
|
|
933
|
+
): <K extends string>(
|
|
934
|
+
target: DataProviderKeyHost<Ue> & {
|
|
935
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
936
|
+
},
|
|
937
|
+
propertyKey: K,
|
|
938
|
+
) => void;
|
|
939
|
+
export function patch<T, B, Ue = any, Uk = any>(
|
|
940
|
+
endpoint: Endpoint<T, Ue>,
|
|
941
|
+
bodyKey: DataProviderKey<B>,
|
|
942
|
+
configurationKey: DataProviderKey<APIConfiguration, Uk>,
|
|
943
|
+
): <K extends string>(
|
|
944
|
+
target: DataProviderKeyHost<Ue> &
|
|
945
|
+
DataProviderKeyHost<Uk> & {
|
|
946
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
947
|
+
},
|
|
948
|
+
propertyKey: K,
|
|
949
|
+
) => void;
|
|
950
|
+
export function patch<T, B, Ue = any, Uk = any>(
|
|
951
|
+
endpoint: Endpoint<T, Ue>,
|
|
952
|
+
bodyKey: DataProviderKey<B>,
|
|
953
|
+
options: PatchOptions<Uk>,
|
|
954
|
+
): <K extends string>(
|
|
955
|
+
target: DataProviderKeyHost<Ue> & {
|
|
956
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
957
|
+
},
|
|
958
|
+
propertyKey: K,
|
|
959
|
+
) => void;
|
|
960
|
+
export function patch<T, B, Ue = any, Uk = any, Ut = any>(
|
|
961
|
+
endpoint: Endpoint<T, Ue>,
|
|
962
|
+
bodyKey: DataProviderKey<B>,
|
|
963
|
+
configurationKey: DataProviderKey<APIConfiguration, Uk>,
|
|
964
|
+
options: PatchOptions<Ut>,
|
|
965
|
+
): <K extends string>(
|
|
966
|
+
target: DataProviderKeyHost<Ue> &
|
|
967
|
+
DataProviderKeyHost<Uk> & {
|
|
968
|
+
[P in K]?: ApiResult<T> | null | undefined;
|
|
969
|
+
},
|
|
970
|
+
propertyKey: K,
|
|
971
|
+
) => void;
|
|
972
|
+
export function patch<T, B, Ue = any, Uk = any, Ut = any>(
|
|
973
|
+
endpoint: Endpoint<T, Ue>,
|
|
974
|
+
bodyKey: DataProviderKey<B>,
|
|
975
|
+
configurationKeyOrOptions?:
|
|
976
|
+
| DataProviderKey<APIConfiguration, Uk>
|
|
977
|
+
| PatchOptions<Ut>,
|
|
978
|
+
maybeOptions?: PatchOptions<Ut>,
|
|
979
|
+
): <K extends string>(
|
|
980
|
+
target: object & { [P in K]?: ApiResult<T> | null | undefined },
|
|
981
|
+
propertyKey: K,
|
|
982
|
+
) => void {
|
|
983
|
+
return createApiSendDecorator<T, B, Ue, Uk, Ut>("PATCH", (api, path, body) =>
|
|
984
|
+
api.patchDetailed<T, B>(path, body as B),
|
|
985
|
+
)(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions);
|
|
986
|
+
}
|