@supersoniks/concorde 3.1.14 → 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.
Files changed (74) hide show
  1. package/build-infos.json +1 -1
  2. package/concorde-core.bundle.js +109 -113
  3. package/concorde-core.es.js +736 -726
  4. package/dist/concorde-core.bundle.js +109 -113
  5. package/dist/concorde-core.es.js +736 -726
  6. package/docs/assets/index--bDsd7qW.css +1 -0
  7. package/docs/assets/index-Ce3mr_lI.js +4040 -0
  8. package/docs/css/docs.css +0 -0
  9. package/docs/img/concorde-logo.svg +1 -0
  10. package/docs/img/concorde.png +0 -0
  11. package/docs/img/concorde_def.png +0 -0
  12. package/docs/index.html +132 -0
  13. package/docs/src/core/components/functional/date/date.md +290 -0
  14. package/docs/src/core/components/functional/fetch/fetch.md +117 -0
  15. package/docs/src/core/components/functional/if/if.md +16 -0
  16. package/docs/src/core/components/functional/list/list.md +194 -0
  17. package/docs/src/core/components/functional/mix/mix.md +41 -0
  18. package/docs/src/core/components/functional/queue/queue.md +87 -0
  19. package/docs/src/core/components/functional/router/router.md +112 -0
  20. package/docs/src/core/components/functional/sdui/default-library.json +108 -0
  21. package/docs/src/core/components/functional/sdui/example.json +99 -0
  22. package/docs/src/core/components/functional/sdui/sdui.md +356 -0
  23. package/docs/src/core/components/functional/states/states.md +87 -0
  24. package/docs/src/core/components/functional/submit/submit.md +48 -0
  25. package/docs/src/core/components/functional/subscriber/subscriber.md +91 -0
  26. package/docs/src/core/components/functional/value/value.md +35 -0
  27. package/docs/src/core/components/ui/alert/alert.md +121 -0
  28. package/docs/src/core/components/ui/badge/badge.md +102 -0
  29. package/docs/src/core/components/ui/button/button.md +184 -0
  30. package/docs/src/core/components/ui/captcha/captcha.md +12 -0
  31. package/docs/src/core/components/ui/card/card.md +96 -0
  32. package/docs/src/core/components/ui/divider/divider.md +35 -0
  33. package/docs/src/core/components/ui/form/checkbox/checkbox.md +96 -0
  34. package/docs/src/core/components/ui/form/fieldset/fieldset.md +129 -0
  35. package/docs/src/core/components/ui/form/form-actions/form-actions.md +77 -0
  36. package/docs/src/core/components/ui/form/form-layout/form-layout.md +43 -0
  37. package/docs/src/core/components/ui/form/input/input.md +168 -0
  38. package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +130 -0
  39. package/docs/src/core/components/ui/form/radio/radio.md +86 -0
  40. package/docs/src/core/components/ui/form/select/select.md +99 -0
  41. package/docs/src/core/components/ui/form/textarea/textarea.md +66 -0
  42. package/docs/src/core/components/ui/group/group.md +75 -0
  43. package/docs/src/core/components/ui/icon/icon.md +125 -0
  44. package/docs/src/core/components/ui/icon/icons.json +1 -0
  45. package/docs/src/core/components/ui/image/image.md +107 -0
  46. package/docs/src/core/components/ui/link/link.md +43 -0
  47. package/docs/src/core/components/ui/loader/loader.md +37 -0
  48. package/docs/src/core/components/ui/menu/menu.md +288 -0
  49. package/docs/src/core/components/ui/modal/modal.md +123 -0
  50. package/docs/src/core/components/ui/pop/pop.md +79 -0
  51. package/docs/src/core/components/ui/progress/progress.md +65 -0
  52. package/docs/src/core/components/ui/table/table.md +467 -0
  53. package/docs/src/core/components/ui/tooltip/tooltip.md +37 -0
  54. package/docs/src/docs/_core-concept/overview.md +57 -0
  55. package/docs/src/docs/_core-concept/subscriber.md +76 -0
  56. package/docs/src/docs/_getting-started/concorde-outside.md +141 -0
  57. package/docs/src/docs/_getting-started/create-a-component.md +137 -0
  58. package/docs/src/docs/_getting-started/pubsub.md +150 -0
  59. package/docs/src/docs/_getting-started/start.md +37 -0
  60. package/docs/src/docs/_getting-started/theming.md +91 -0
  61. package/docs/src/docs/search/docs-search.json +3737 -0
  62. package/docs/src/tag-list.json +1 -0
  63. package/docs/src/tsconfig.json +113 -0
  64. package/docs/svg/regular/plane.svg +1 -0
  65. package/docs/svg/solid/plane.svg +1 -0
  66. package/package.json +259 -3
  67. package/postcss.config.cjs +0 -0
  68. package/scripts/pre-build.mjs +109 -0
  69. package/src/core/core.ts +1 -0
  70. package/src/core/utils/route.ts +149 -0
  71. package/src/docs/tailwind/index.ts +0 -0
  72. package/src/tsconfig-model.json +19 -0
  73. package/src/tsconfig.json +794 -109
  74. package/vite/config.js +145 -21
@@ -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
@@ -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
+ }