@supersoniks/concorde 3.1.13 → 3.1.15
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 -1
- package/concorde-core.bundle.js +121 -121
- package/concorde-core.es.js +986 -969
- package/dist/concorde-core.bundle.js +121 -121
- package/dist/concorde-core.es.js +986 -969
- package/dist/css/docs.css +0 -0
- package/dist/fonts/ClashGrotesk-Bold.eot +0 -0
- package/dist/fonts/ClashGrotesk-Bold.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Bold.woff +0 -0
- package/dist/fonts/ClashGrotesk-Bold.woff2 +0 -0
- package/dist/fonts/ClashGrotesk-Extralight.eot +0 -0
- package/dist/fonts/ClashGrotesk-Extralight.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Extralight.woff +0 -0
- package/dist/fonts/ClashGrotesk-Extralight.woff2 +0 -0
- package/dist/fonts/ClashGrotesk-Light.eot +0 -0
- package/dist/fonts/ClashGrotesk-Light.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Light.woff +0 -0
- package/dist/fonts/ClashGrotesk-Light.woff2 +0 -0
- package/dist/fonts/ClashGrotesk-Medium.eot +0 -0
- package/dist/fonts/ClashGrotesk-Medium.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Medium.woff +0 -0
- package/dist/fonts/ClashGrotesk-Medium.woff2 +0 -0
- package/dist/fonts/ClashGrotesk-Regular.eot +0 -0
- package/dist/fonts/ClashGrotesk-Regular.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Regular.woff +0 -0
- package/dist/fonts/ClashGrotesk-Regular.woff2 +0 -0
- package/dist/fonts/ClashGrotesk-Semibold.eot +0 -0
- package/dist/fonts/ClashGrotesk-Semibold.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Semibold.woff +0 -0
- package/dist/fonts/ClashGrotesk-Semibold.woff2 +0 -0
- package/dist/fonts/ClashGrotesk-Variable.eot +0 -0
- package/dist/fonts/ClashGrotesk-Variable.ttf +0 -0
- package/dist/fonts/ClashGrotesk-Variable.woff +0 -0
- package/dist/fonts/ClashGrotesk-Variable.woff2 +0 -0
- package/dist/img/concorde-icon.svg +0 -0
- package/dist/img/concorde-logo.svg +0 -0
- package/dist/img/concorde.png +0 -0
- package/dist/img/concorde_def.png +0 -0
- package/dist/img/concorde_seuil.png.webp +0 -0
- package/dist/img/concorde_seuil_invert.png +0 -0
- package/dist/img/paul_metrand.jpg +0 -0
- package/dist/img/paul_metrand_xs.jpg +0 -0
- package/dist/svg/regular/plane.svg +0 -0
- package/dist/svg/solid/plane.svg +0 -0
- package/docs/assets/index--bDsd7qW.css +1 -0
- package/docs/assets/index-Ce3mr_lI.js +4040 -0
- package/docs/css/docs.css +0 -0
- package/docs/img/concorde-logo.svg +1 -0
- package/docs/img/concorde.png +0 -0
- package/docs/img/concorde_def.png +0 -0
- package/docs/index.html +132 -0
- package/docs/src/core/components/functional/date/date.md +290 -0
- package/docs/src/core/components/functional/fetch/fetch.md +117 -0
- package/docs/src/core/components/functional/if/if.md +16 -0
- package/docs/src/core/components/functional/list/list.md +194 -0
- package/docs/src/core/components/functional/mix/mix.md +41 -0
- package/docs/src/core/components/functional/queue/queue.md +87 -0
- package/docs/src/core/components/functional/router/router.md +112 -0
- package/docs/src/core/components/functional/sdui/default-library.json +108 -0
- package/docs/src/core/components/functional/sdui/example.json +99 -0
- package/docs/src/core/components/functional/sdui/sdui.md +356 -0
- package/docs/src/core/components/functional/states/states.md +87 -0
- package/docs/src/core/components/functional/submit/submit.md +48 -0
- package/docs/src/core/components/functional/subscriber/subscriber.md +91 -0
- package/docs/src/core/components/functional/value/value.md +35 -0
- package/docs/src/core/components/ui/alert/alert.md +121 -0
- package/docs/src/core/components/ui/badge/badge.md +102 -0
- package/docs/src/core/components/ui/button/button.md +184 -0
- package/docs/src/core/components/ui/captcha/captcha.md +12 -0
- package/docs/src/core/components/ui/card/card.md +96 -0
- package/docs/src/core/components/ui/divider/divider.md +35 -0
- package/docs/src/core/components/ui/form/checkbox/checkbox.md +96 -0
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +129 -0
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +77 -0
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +43 -0
- package/docs/src/core/components/ui/form/input/input.md +168 -0
- package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +130 -0
- package/docs/src/core/components/ui/form/radio/radio.md +86 -0
- package/docs/src/core/components/ui/form/select/select.md +99 -0
- package/docs/src/core/components/ui/form/textarea/textarea.md +66 -0
- package/docs/src/core/components/ui/group/group.md +75 -0
- package/docs/src/core/components/ui/icon/icon.md +125 -0
- package/docs/src/core/components/ui/icon/icons.json +1 -0
- package/docs/src/core/components/ui/image/image.md +107 -0
- package/docs/src/core/components/ui/link/link.md +43 -0
- package/docs/src/core/components/ui/loader/loader.md +37 -0
- package/docs/src/core/components/ui/menu/menu.md +288 -0
- package/docs/src/core/components/ui/modal/modal.md +123 -0
- package/docs/src/core/components/ui/pop/pop.md +79 -0
- package/docs/src/core/components/ui/progress/progress.md +65 -0
- package/docs/src/core/components/ui/table/table.md +467 -0
- package/docs/src/core/components/ui/tooltip/tooltip.md +37 -0
- package/docs/src/docs/_core-concept/overview.md +57 -0
- package/docs/src/docs/_core-concept/subscriber.md +76 -0
- package/docs/src/docs/_getting-started/concorde-outside.md +141 -0
- package/docs/src/docs/_getting-started/create-a-component.md +137 -0
- package/docs/src/docs/_getting-started/pubsub.md +150 -0
- package/docs/src/docs/_getting-started/start.md +37 -0
- package/docs/src/docs/_getting-started/theming.md +91 -0
- package/docs/src/docs/search/docs-search.json +3737 -0
- package/docs/src/tag-list.json +1 -0
- package/docs/src/tsconfig.json +113 -0
- package/docs/svg/regular/plane.svg +1 -0
- package/docs/svg/solid/plane.svg +1 -0
- package/index.html +0 -0
- package/notes de migration.md +0 -0
- package/package.json +258 -2
- package/postcss.config.cjs +0 -0
- package/public/css/docs.css +0 -0
- package/public/fonts/ClashGrotesk-Bold.eot +0 -0
- package/public/fonts/ClashGrotesk-Bold.ttf +0 -0
- package/public/fonts/ClashGrotesk-Bold.woff +0 -0
- package/public/fonts/ClashGrotesk-Bold.woff2 +0 -0
- package/public/fonts/ClashGrotesk-Extralight.eot +0 -0
- package/public/fonts/ClashGrotesk-Extralight.ttf +0 -0
- package/public/fonts/ClashGrotesk-Extralight.woff +0 -0
- package/public/fonts/ClashGrotesk-Extralight.woff2 +0 -0
- package/public/fonts/ClashGrotesk-Light.eot +0 -0
- package/public/fonts/ClashGrotesk-Light.ttf +0 -0
- package/public/fonts/ClashGrotesk-Light.woff +0 -0
- package/public/fonts/ClashGrotesk-Light.woff2 +0 -0
- package/public/fonts/ClashGrotesk-Medium.eot +0 -0
- package/public/fonts/ClashGrotesk-Medium.ttf +0 -0
- package/public/fonts/ClashGrotesk-Medium.woff +0 -0
- package/public/fonts/ClashGrotesk-Medium.woff2 +0 -0
- package/public/fonts/ClashGrotesk-Regular.eot +0 -0
- package/public/fonts/ClashGrotesk-Regular.ttf +0 -0
- package/public/fonts/ClashGrotesk-Regular.woff +0 -0
- package/public/fonts/ClashGrotesk-Regular.woff2 +0 -0
- package/public/fonts/ClashGrotesk-Semibold.eot +0 -0
- package/public/fonts/ClashGrotesk-Semibold.ttf +0 -0
- package/public/fonts/ClashGrotesk-Semibold.woff +0 -0
- package/public/fonts/ClashGrotesk-Semibold.woff2 +0 -0
- package/public/fonts/ClashGrotesk-Variable.eot +0 -0
- package/public/fonts/ClashGrotesk-Variable.ttf +0 -0
- package/public/fonts/ClashGrotesk-Variable.woff +0 -0
- package/public/fonts/ClashGrotesk-Variable.woff2 +0 -0
- package/public/img/concorde-icon.svg +0 -0
- package/public/img/concorde-logo.svg +0 -0
- package/public/img/concorde.png +0 -0
- package/public/img/concorde_def.png +0 -0
- package/public/img/concorde_seuil.png.webp +0 -0
- package/public/img/concorde_seuil_invert.png +0 -0
- package/public/img/paul_metrand.jpg +0 -0
- package/public/img/paul_metrand_xs.jpg +0 -0
- package/public/svg/regular/plane.svg +0 -0
- package/public/svg/solid/plane.svg +0 -0
- package/scripts/create-search.js +0 -0
- package/scripts/post-build-docs.js +0 -0
- package/scripts/post-build.mjs +0 -0
- package/scripts/pre-build.mjs +109 -0
- package/src/components.ts +0 -0
- package/src/concorde-loaded.ts +0 -0
- package/src/core/_types/types.ts +0 -0
- package/src/core/components/functional/date/date.md +0 -0
- package/src/core/components/functional/date/date.ts +0 -0
- package/src/core/components/functional/example/example.ts +0 -0
- package/src/core/components/functional/fetch/fetch.md +0 -0
- package/src/core/components/functional/fetch/fetch.ts +0 -0
- package/src/core/components/functional/functional.ts +0 -0
- package/src/core/components/functional/if/if.md +0 -0
- package/src/core/components/functional/if/if.test.ts +0 -0
- package/src/core/components/functional/if/if.ts +0 -0
- package/src/core/components/functional/list/list.md +0 -0
- package/src/core/components/functional/list/list.ts +0 -0
- package/src/core/components/functional/mix/mix.md +0 -0
- package/src/core/components/functional/mix/mix.ts +0 -0
- package/src/core/components/functional/queue/queue.md +0 -0
- package/src/core/components/functional/queue/queue.ts +0 -0
- package/src/core/components/functional/router/redirect.ts +0 -0
- package/src/core/components/functional/router/router.md +0 -0
- package/src/core/components/functional/router/router.ts +0 -0
- package/src/core/components/functional/sdui/SDUIDescriptorTransformer.ts +0 -0
- package/src/core/components/functional/sdui/default-library.json +0 -0
- package/src/core/components/functional/sdui/example.json +0 -0
- package/src/core/components/functional/sdui/sdui-utils.ts +0 -0
- package/src/core/components/functional/sdui/sdui.md +0 -0
- package/src/core/components/functional/sdui/sdui.ts +0 -0
- package/src/core/components/functional/sdui/types.ts +0 -0
- package/src/core/components/functional/sonic-scope/sonic-scope.ts +0 -0
- package/src/core/components/functional/states/states.md +0 -0
- package/src/core/components/functional/states/states.ts +0 -0
- package/src/core/components/functional/submit/submit.md +0 -0
- package/src/core/components/functional/submit/submit.ts +3 -0
- package/src/core/components/functional/subscriber/subscriber.md +0 -0
- package/src/core/components/functional/subscriber/subscriber.ts +0 -0
- package/src/core/components/functional/value/value.md +0 -0
- package/src/core/components/functional/value/value.ts +0 -0
- package/src/core/components/ui/_css/scroll.ts +0 -0
- package/src/core/components/ui/_css/size.ts +0 -0
- package/src/core/components/ui/_css/type.ts +0 -0
- package/src/core/components/ui/alert/alert.md +0 -0
- package/src/core/components/ui/alert/alert.ts +0 -0
- package/src/core/components/ui/badge/badge.md +0 -0
- package/src/core/components/ui/badge/badge.ts +0 -0
- package/src/core/components/ui/button/button.md +0 -0
- package/src/core/components/ui/button/button.ts +0 -0
- package/src/core/components/ui/captcha/captcha.md +0 -0
- package/src/core/components/ui/captcha/captcha.ts +0 -0
- package/src/core/components/ui/card/card-footer.ts +0 -0
- package/src/core/components/ui/card/card-header-descripton.ts +0 -0
- package/src/core/components/ui/card/card-header.ts +0 -0
- package/src/core/components/ui/card/card-main.ts +0 -0
- package/src/core/components/ui/card/card.md +0 -0
- package/src/core/components/ui/card/card.ts +0 -0
- package/src/core/components/ui/divider/divider.md +0 -0
- package/src/core/components/ui/divider/divider.ts +0 -0
- package/src/core/components/ui/form/checkbox/checkbox.md +0 -0
- package/src/core/components/ui/form/checkbox/checkbox.ts +0 -0
- package/src/core/components/ui/form/css/form-control.ts +0 -0
- package/src/core/components/ui/form/fieldset/fieldset.md +0 -0
- package/src/core/components/ui/form/fieldset/fieldset.ts +0 -0
- package/src/core/components/ui/form/fieldset/legend-description.ts +0 -0
- package/src/core/components/ui/form/fieldset/legend.ts +0 -0
- package/src/core/components/ui/form/form-actions/form-actions.md +0 -0
- package/src/core/components/ui/form/form-actions/form-actions.ts +0 -0
- package/src/core/components/ui/form/form-layout/form-layout.md +0 -0
- package/src/core/components/ui/form/form-layout/form-layout.ts +0 -0
- package/src/core/components/ui/form/input/input.md +0 -0
- package/src/core/components/ui/form/input/input.ts +0 -0
- package/src/core/components/ui/form/input/password-helper.ts +0 -0
- package/src/core/components/ui/form/input/same-value-helper.ts +0 -0
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -0
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.ts +0 -0
- package/src/core/components/ui/form/radio/radio.md +0 -0
- package/src/core/components/ui/form/radio/radio.ts +0 -0
- package/src/core/components/ui/form/select/select.md +0 -0
- package/src/core/components/ui/form/select/select.ts +0 -0
- package/src/core/components/ui/form/textarea/textarea.md +0 -0
- package/src/core/components/ui/form/textarea/textarea.ts +0 -0
- package/src/core/components/ui/group/group.md +0 -0
- package/src/core/components/ui/group/group.ts +0 -0
- package/src/core/components/ui/icon/icon.md +0 -0
- package/src/core/components/ui/icon/icon.stories.ts +0 -0
- package/src/core/components/ui/icon/icon.ts +0 -0
- package/src/core/components/ui/icon/icons.json +0 -0
- package/src/core/components/ui/icon/icons.ts +0 -0
- package/src/core/components/ui/icon/svgs/cancel.svg +0 -0
- package/src/core/components/ui/icon/svgs/check-circled-outline.svg +0 -0
- package/src/core/components/ui/icon/svgs/check.svg +0 -0
- package/src/core/components/ui/icon/svgs/emoji-puzzled.svg +0 -0
- package/src/core/components/ui/icon/svgs/info-empty.svg +0 -0
- package/src/core/components/ui/icon/svgs/loader.svg +0 -0
- package/src/core/components/ui/icon/svgs/minus-small.svg +0 -0
- package/src/core/components/ui/icon/svgs/more-horiz.svg +0 -0
- package/src/core/components/ui/icon/svgs/more-vert.svg +0 -0
- package/src/core/components/ui/icon/svgs/nav-arrow-down.svg +0 -0
- package/src/core/components/ui/icon/svgs/warning-circled-outline.svg +0 -0
- package/src/core/components/ui/image/image.md +0 -0
- package/src/core/components/ui/image/image.ts +0 -0
- package/src/core/components/ui/link/link.md +0 -0
- package/src/core/components/ui/link/link.ts +0 -0
- package/src/core/components/ui/loader/loader.md +0 -0
- package/src/core/components/ui/loader/loader.stories.ts +0 -0
- package/src/core/components/ui/loader/loader.ts +0 -0
- package/src/core/components/ui/loader/styles/fixed.ts +0 -0
- package/src/core/components/ui/loader/styles/inline.ts +0 -0
- package/src/core/components/ui/menu/menu-item.ts +0 -0
- package/src/core/components/ui/menu/menu.md +0 -0
- package/src/core/components/ui/menu/menu.ts +0 -0
- package/src/core/components/ui/modal/modal-actions.ts +0 -0
- package/src/core/components/ui/modal/modal-close.ts +0 -0
- package/src/core/components/ui/modal/modal-content.ts +0 -0
- package/src/core/components/ui/modal/modal-subtitle.ts +0 -0
- package/src/core/components/ui/modal/modal-title.ts +0 -0
- package/src/core/components/ui/modal/modal.md +0 -0
- package/src/core/components/ui/modal/modal.stories.ts +0 -0
- package/src/core/components/ui/modal/modal.ts +0 -0
- package/src/core/components/ui/pop/pop.md +0 -0
- package/src/core/components/ui/pop/pop.ts +0 -0
- package/src/core/components/ui/progress/progress.md +0 -0
- package/src/core/components/ui/progress/progress.ts +0 -0
- package/src/core/components/ui/table/table-caption.ts +0 -0
- package/src/core/components/ui/table/table-tbody.ts +0 -0
- package/src/core/components/ui/table/table-td.ts +0 -0
- package/src/core/components/ui/table/table-tfoot.ts +0 -0
- package/src/core/components/ui/table/table-th.ts +0 -0
- package/src/core/components/ui/table/table-thead.ts +0 -0
- package/src/core/components/ui/table/table-tr.ts +0 -0
- package/src/core/components/ui/table/table.md +0 -0
- package/src/core/components/ui/table/table.ts +0 -0
- package/src/core/components/ui/theme/theme-collection/core-variables.ts +0 -0
- package/src/core/components/ui/theme/theme-collection/dark.ts +0 -0
- package/src/core/components/ui/theme/theme-collection/light.ts +0 -0
- package/src/core/components/ui/theme/theme.ts +0 -0
- package/src/core/components/ui/toast/message-subscriber.stories.ts +0 -0
- package/src/core/components/ui/toast/message-subscriber.ts +0 -0
- package/src/core/components/ui/toast/toast-item.ts +0 -0
- package/src/core/components/ui/toast/toast.ts +1 -1
- package/src/core/components/ui/toast/types.ts +0 -0
- package/src/core/components/ui/tooltip/tooltip.md +0 -0
- package/src/core/components/ui/tooltip/tooltip.ts +0 -0
- package/src/core/components/ui/ui.ts +0 -0
- package/src/core/core.ts +1 -0
- package/src/core/decorators/Subscriber.ts +0 -0
- package/src/core/directives/DataProvider.ts +0 -0
- package/src/core/directives/Wording.ts +0 -0
- package/src/core/mixins/Fetcher.ts +0 -0
- package/src/core/mixins/FormCheckable.ts +0 -0
- package/src/core/mixins/FormElement.ts +0 -0
- package/src/core/mixins/FormInput.ts +0 -0
- package/src/core/mixins/Subscriber.ts +0 -0
- package/src/core/mixins/TemplatesContainer.ts +0 -0
- package/src/core/mixins/mixins.ts +0 -0
- package/src/core/utils/Arrays.ts +0 -0
- package/src/core/utils/DataBindObserver.ts +0 -0
- package/src/core/utils/Electron.ts +0 -0
- package/src/core/utils/Format.ts +0 -0
- package/src/core/utils/HTML.ts +0 -0
- package/src/core/utils/LocationHandler.ts +0 -0
- package/src/core/utils/Objects.ts +0 -0
- package/src/core/utils/PublisherProxy.ts +0 -0
- package/src/core/utils/Utils.ts +0 -0
- package/src/core/utils/api.ts +0 -0
- package/src/core/utils/route.ts +149 -0
- package/src/core/utils/url-pattern.ts +0 -0
- package/src/decorators.ts +0 -0
- package/src/directives.ts +0 -0
- package/src/docs/_core-concept/overview.md +0 -0
- package/src/docs/_core-concept/subscriber.md +0 -0
- package/src/docs/_getting-started/concorde-outside.md +0 -0
- package/src/docs/_getting-started/create-a-component.md +0 -0
- package/src/docs/_getting-started/my-first-subscriber.md +0 -0
- package/src/docs/_getting-started/pubsub.md +0 -0
- package/src/docs/_getting-started/start.md +0 -0
- package/src/docs/_getting-started/theming.md +0 -0
- package/src/docs/code.ts +0 -0
- package/src/docs/docs.ts +0 -0
- package/src/docs/example/users.ts +0 -0
- package/src/docs/header/header.ts +0 -0
- package/src/docs/navigation/navigation.ts +0 -0
- package/src/docs/prism/index.ts +0 -0
- package/src/docs/prism/prism.css +0 -0
- package/src/docs/prism/prism.js +0 -0
- package/src/docs/search/docs-search.json +0 -0
- package/src/docs/search/markdown-renderer.ts +0 -0
- package/src/docs/search/page.ts +0 -0
- package/src/docs/search/search.ts +0 -0
- package/src/docs/tailwind/css/tailwind.css +0 -0
- package/src/docs/tailwind/css/tailwind.d.ts +0 -0
- package/src/docs/tailwind/index.ts +0 -0
- package/src/docs.ts +0 -0
- package/src/index.ts +0 -0
- package/src/mixins.ts +0 -0
- package/src/tag-list.json +0 -0
- package/src/test-utils/TestUtils.ts +0 -0
- package/src/tsconfig-model.json +19 -0
- package/src/tsconfig.json +794 -109
- package/src/utils.ts +0 -0
- package/tailwind.config.js +0 -0
- package/test-utils/TestUtils.ts +0 -0
- package/vite/config.js +145 -21
- package/vite.config.mts +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { URLPattern } from "@supersoniks/concorde/utils";
|
|
2
|
+
|
|
3
|
+
export type RouteArgs = {
|
|
4
|
+
propertyMap?: object;
|
|
5
|
+
query?: object;
|
|
6
|
+
hash?: string;
|
|
7
|
+
};
|
|
8
|
+
export class Route<RoutesData = any> {
|
|
9
|
+
private route: string = "";
|
|
10
|
+
constructor(name?: keyof RoutesData) {
|
|
11
|
+
if (!name) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
this.route = Routes.get(name);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
extract() {
|
|
18
|
+
const pattern = new URLPattern("(/)*" + this.route + "*");
|
|
19
|
+
const currentUrl = window.location.href.replace(window.location.origin, "");
|
|
20
|
+
const matches = pattern.match(currentUrl);
|
|
21
|
+
return matches;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
matchesLocation() {
|
|
25
|
+
return this.extract() !== null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
fill(properties: Object) {
|
|
29
|
+
this.route = new URLPattern(this.route).stringify(properties);
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
query(query: Object) {
|
|
33
|
+
const url = new URL(this.route, window.location.origin);
|
|
34
|
+
Object.entries(query).forEach(([key, value]) => {
|
|
35
|
+
url.searchParams.set(key, value);
|
|
36
|
+
});
|
|
37
|
+
this.route = url.href.replace(window.location.origin, "");
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
hash(hash: string) {
|
|
41
|
+
const url = new URL(this.route, window.location.origin);
|
|
42
|
+
url.hash = hash;
|
|
43
|
+
this.route = url.href.replace(window.location.origin, "");
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
appendPath(pathname?: string) {
|
|
47
|
+
if (!pathname) {
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
const url = new URL(this.route, window.location.origin);
|
|
51
|
+
url.pathname = url.pathname.replace(/\/$/, "");
|
|
52
|
+
if (!pathname.startsWith("/")) {
|
|
53
|
+
pathname = "/" + pathname;
|
|
54
|
+
}
|
|
55
|
+
url.pathname += pathname;
|
|
56
|
+
this.route = url.href.replace(window.location.origin, "");
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
toString() {
|
|
60
|
+
return this.route;
|
|
61
|
+
}
|
|
62
|
+
valueOf() {
|
|
63
|
+
return this.route;
|
|
64
|
+
}
|
|
65
|
+
hasHash() {
|
|
66
|
+
const url = new URL(this.route, window.location.origin);
|
|
67
|
+
return url.hash !== "";
|
|
68
|
+
}
|
|
69
|
+
getHash() {
|
|
70
|
+
const url = new URL(this.route, window.location.origin);
|
|
71
|
+
return url.hash;
|
|
72
|
+
}
|
|
73
|
+
hasSameBaseAs(route?: Route) {
|
|
74
|
+
if (!route) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
const url = new URL(this.route, window.location.origin);
|
|
78
|
+
const url2 = new URL(route.route, window.location.origin);
|
|
79
|
+
return url.origin + url.pathname === url2.origin + url2.pathname;
|
|
80
|
+
}
|
|
81
|
+
goTo() {
|
|
82
|
+
window.location.href = this.route;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export class Routes {
|
|
87
|
+
private static routes = {};
|
|
88
|
+
|
|
89
|
+
static register<RouteData = any>(
|
|
90
|
+
routes: Partial<RouteData>,
|
|
91
|
+
baseUrlOrOpt: { baseUrl?: string; prefix?: string } | string = "",
|
|
92
|
+
prefix = ""
|
|
93
|
+
) {
|
|
94
|
+
const newRoutes: Partial<RouteData> = {};
|
|
95
|
+
Object.keys(routes).forEach((key) => {
|
|
96
|
+
const name = key as keyof RouteData & string;
|
|
97
|
+
let route = routes[name] as string;
|
|
98
|
+
let baseUrl = "";
|
|
99
|
+
if (baseUrlOrOpt) {
|
|
100
|
+
if (typeof baseUrlOrOpt === "string") {
|
|
101
|
+
baseUrl = baseUrlOrOpt;
|
|
102
|
+
} else {
|
|
103
|
+
baseUrl = baseUrlOrOpt.baseUrl || "";
|
|
104
|
+
prefix = prefix || baseUrlOrOpt.prefix || "";
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (baseUrl && !route.includes(baseUrl)) {
|
|
108
|
+
route = baseUrl + "/" + route;
|
|
109
|
+
route = route?.replace(/\/+/g, "/");
|
|
110
|
+
route = route?.replace(/\/#/g, "#");
|
|
111
|
+
}
|
|
112
|
+
newRoutes[(prefix + name) as keyof RouteData] =
|
|
113
|
+
route as RouteData[keyof RouteData];
|
|
114
|
+
});
|
|
115
|
+
Routes.routes = { ...Routes.routes, ...newRoutes } as Partial<RouteData>;
|
|
116
|
+
}
|
|
117
|
+
static get<RouteData extends Record<keyof RouteData, string | undefined>>(
|
|
118
|
+
name: keyof RouteData,
|
|
119
|
+
args?: RouteArgs
|
|
120
|
+
) {
|
|
121
|
+
const routes = Routes.routes as Partial<RouteData>;
|
|
122
|
+
let route = routes[name] || "";
|
|
123
|
+
if (args?.propertyMap) {
|
|
124
|
+
route = new URLPattern(route).stringify(args.propertyMap);
|
|
125
|
+
}
|
|
126
|
+
const url = new URL(
|
|
127
|
+
route,
|
|
128
|
+
route.startsWith("#") ? window.location.href : window.location.origin
|
|
129
|
+
);
|
|
130
|
+
if (args?.query) {
|
|
131
|
+
Object.entries(args.query).forEach(([key, value]) => {
|
|
132
|
+
url.searchParams.set(key, value);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
if (args?.hash) {
|
|
136
|
+
url.hash = args.hash;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return url.href.replace(window.location.origin, "");
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
static fillURLPattern(route: string, properties: Object) {
|
|
143
|
+
return new URLPattern(route).stringify(properties);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export const route = <RouteData>(name?: keyof RouteData) => {
|
|
148
|
+
return new Route<RouteData>(name);
|
|
149
|
+
};
|
|
File without changes
|
package/src/decorators.ts
CHANGED
|
File without changes
|
package/src/directives.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/docs/code.ts
CHANGED
|
File without changes
|
package/src/docs/docs.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/docs/prism/index.ts
CHANGED
|
File without changes
|
package/src/docs/prism/prism.css
CHANGED
|
File without changes
|
package/src/docs/prism/prism.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/docs/search/page.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/docs.ts
CHANGED
|
File without changes
|
package/src/index.ts
CHANGED
|
File without changes
|
package/src/mixins.ts
CHANGED
|
File without changes
|
package/src/tag-list.json
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"exclude": ["node_modules/**/*", "dist/**/*", "vite.config.mts", "docs.ts", "docs/*"],
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "es2021",
|
|
5
|
+
"experimentalDecorators": true,
|
|
6
|
+
"useDefineForClassFields": false,
|
|
7
|
+
"module": "esnext",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"paths": {
|
|
10
|
+
"@supersoniks/concorde/*":["./*"]
|
|
11
|
+
},
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"forceConsistentCasingInFileNames": true,
|
|
16
|
+
"strict": true,
|
|
17
|
+
"skipLibCheck": true
|
|
18
|
+
}
|
|
19
|
+
}
|