juxscript 1.1.239 → 1.1.243

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 (297) hide show
  1. package/index.js +7 -137
  2. package/lib/components/dataframe.ts +0 -569
  3. package/lib/components/tag.ts +68 -0
  4. package/lib/styles/shadcn.css +20 -7
  5. package/lib/utils/idgen.ts +6 -0
  6. package/package.json +5 -6
  7. package/index.d.ts +0 -239
  8. package/index.d.ts.map +0 -1
  9. package/lib/components/alert.d.ts +0 -36
  10. package/lib/components/alert.d.ts.map +0 -1
  11. package/lib/components/alert.js +0 -172
  12. package/lib/components/alert.ts +0 -219
  13. package/lib/components/app.d.ts +0 -89
  14. package/lib/components/app.d.ts.map +0 -1
  15. package/lib/components/app.js +0 -175
  16. package/lib/components/app.ts +0 -247
  17. package/lib/components/badge.d.ts +0 -26
  18. package/lib/components/badge.d.ts.map +0 -1
  19. package/lib/components/badge.js +0 -91
  20. package/lib/components/badge.ts +0 -118
  21. package/lib/components/base/Animations.d.ts +0 -36
  22. package/lib/components/base/Animations.d.ts.map +0 -1
  23. package/lib/components/base/Animations.js +0 -70
  24. package/lib/components/base/Animations.ts +0 -112
  25. package/lib/components/base/BaseComponent.d.ts +0 -294
  26. package/lib/components/base/BaseComponent.d.ts.map +0 -1
  27. package/lib/components/base/BaseComponent.js +0 -735
  28. package/lib/components/base/BaseComponent.ts +0 -884
  29. package/lib/components/base/FormInput.d.ts +0 -77
  30. package/lib/components/base/FormInput.d.ts.map +0 -1
  31. package/lib/components/base/FormInput.js +0 -171
  32. package/lib/components/base/FormInput.ts +0 -237
  33. package/lib/components/blueprint.d.ts +0 -40
  34. package/lib/components/blueprint.d.ts.map +0 -1
  35. package/lib/components/blueprint.js +0 -327
  36. package/lib/components/button.d.ts +0 -70
  37. package/lib/components/button.d.ts.map +0 -1
  38. package/lib/components/button.js +0 -177
  39. package/lib/components/button.ts +0 -237
  40. package/lib/components/card.d.ts +0 -35
  41. package/lib/components/card.d.ts.map +0 -1
  42. package/lib/components/card.js +0 -130
  43. package/lib/components/card.ts +0 -177
  44. package/lib/components/chart.d.ts +0 -49
  45. package/lib/components/chart.d.ts.map +0 -1
  46. package/lib/components/chart.js +0 -205
  47. package/lib/components/chart.ts +0 -254
  48. package/lib/components/checkbox.d.ts +0 -33
  49. package/lib/components/checkbox.d.ts.map +0 -1
  50. package/lib/components/checkbox.js +0 -202
  51. package/lib/components/checkbox.ts +0 -260
  52. package/lib/components/code.d.ts +0 -52
  53. package/lib/components/code.d.ts.map +0 -1
  54. package/lib/components/code.js +0 -201
  55. package/lib/components/code.ts +0 -260
  56. package/lib/components/container.d.ts +0 -60
  57. package/lib/components/container.d.ts.map +0 -1
  58. package/lib/components/container.js +0 -195
  59. package/lib/components/container.ts +0 -259
  60. package/lib/components/data.d.ts +0 -36
  61. package/lib/components/data.d.ts.map +0 -1
  62. package/lib/components/data.js +0 -110
  63. package/lib/components/data.ts +0 -135
  64. package/lib/components/dataframe/DataFrameSource.d.ts +0 -118
  65. package/lib/components/dataframe/DataFrameSource.d.ts.map +0 -1
  66. package/lib/components/dataframe/DataFrameSource.js +0 -421
  67. package/lib/components/dataframe/DataFrameSource.ts +0 -532
  68. package/lib/components/dataframe/ImportSettingsModal.d.ts +0 -60
  69. package/lib/components/dataframe/ImportSettingsModal.d.ts.map +0 -1
  70. package/lib/components/dataframe/ImportSettingsModal.js +0 -442
  71. package/lib/components/dataframe/ImportSettingsModal.ts +0 -531
  72. package/lib/components/dataframe.d.ts +0 -110
  73. package/lib/components/dataframe.d.ts.map +0 -1
  74. package/lib/components/dataframe.js +0 -470
  75. package/lib/components/datepicker.d.ts +0 -40
  76. package/lib/components/datepicker.d.ts.map +0 -1
  77. package/lib/components/datepicker.js +0 -193
  78. package/lib/components/datepicker.ts +0 -251
  79. package/lib/components/dialog.d.ts +0 -39
  80. package/lib/components/dialog.d.ts.map +0 -1
  81. package/lib/components/dialog.js +0 -131
  82. package/lib/components/dialog.ts +0 -178
  83. package/lib/components/divider.d.ts +0 -31
  84. package/lib/components/divider.d.ts.map +0 -1
  85. package/lib/components/divider.js +0 -72
  86. package/lib/components/divider.ts +0 -104
  87. package/lib/components/dropdown-menu.d.ts +0 -42
  88. package/lib/components/dropdown-menu.d.ts.map +0 -1
  89. package/lib/components/dropdown-menu.js +0 -177
  90. package/lib/components/dropdown-menu.ts +0 -214
  91. package/lib/components/dropdown.d.ts +0 -41
  92. package/lib/components/dropdown.d.ts.map +0 -1
  93. package/lib/components/dropdown.js +0 -136
  94. package/lib/components/dropdown.ts +0 -188
  95. package/lib/components/element.d.ts +0 -51
  96. package/lib/components/element.d.ts.map +0 -1
  97. package/lib/components/element.js +0 -209
  98. package/lib/components/element.ts +0 -271
  99. package/lib/components/event-chain.d.ts +0 -9
  100. package/lib/components/event-chain.d.ts.map +0 -1
  101. package/lib/components/event-chain.js +0 -33
  102. package/lib/components/fileupload.d.ts +0 -98
  103. package/lib/components/fileupload.d.ts.map +0 -1
  104. package/lib/components/fileupload.js +0 -351
  105. package/lib/components/fileupload.ts +0 -449
  106. package/lib/components/grid.d.ts +0 -88
  107. package/lib/components/grid.d.ts.map +0 -1
  108. package/lib/components/grid.js +0 -208
  109. package/lib/components/grid.ts +0 -295
  110. package/lib/components/heading.d.ts +0 -25
  111. package/lib/components/heading.d.ts.map +0 -1
  112. package/lib/components/heading.js +0 -83
  113. package/lib/components/heading.ts +0 -113
  114. package/lib/components/helpers.d.ts +0 -9
  115. package/lib/components/helpers.d.ts.map +0 -1
  116. package/lib/components/helpers.js +0 -30
  117. package/lib/components/helpers.ts +0 -41
  118. package/lib/components/hero.d.ts +0 -60
  119. package/lib/components/hero.d.ts.map +0 -1
  120. package/lib/components/hero.js +0 -239
  121. package/lib/components/hero.ts +0 -302
  122. package/lib/components/history/StateHistory.d.ts +0 -91
  123. package/lib/components/history/StateHistory.d.ts.map +0 -1
  124. package/lib/components/history/StateHistory.js +0 -154
  125. package/lib/components/history/StateHistory.ts +0 -200
  126. package/lib/components/icon.d.ts +0 -36
  127. package/lib/components/icon.d.ts.map +0 -1
  128. package/lib/components/icon.js +0 -135
  129. package/lib/components/icon.ts +0 -182
  130. package/lib/components/icons.d.ts +0 -25
  131. package/lib/components/icons.d.ts.map +0 -1
  132. package/lib/components/icons.js +0 -440
  133. package/lib/components/icons.ts +0 -464
  134. package/lib/components/image.d.ts +0 -42
  135. package/lib/components/image.d.ts.map +0 -1
  136. package/lib/components/image.js +0 -204
  137. package/lib/components/image.ts +0 -260
  138. package/lib/components/include.d.ts +0 -86
  139. package/lib/components/include.d.ts.map +0 -1
  140. package/lib/components/include.js +0 -238
  141. package/lib/components/include.ts +0 -281
  142. package/lib/components/input.d.ts +0 -85
  143. package/lib/components/input.d.ts.map +0 -1
  144. package/lib/components/input.js +0 -362
  145. package/lib/components/input.ts +0 -473
  146. package/lib/components/layer.d.ts +0 -72
  147. package/lib/components/layer.d.ts.map +0 -1
  148. package/lib/components/layer.js +0 -219
  149. package/lib/components/layer.ts +0 -304
  150. package/lib/components/link.d.ts +0 -41
  151. package/lib/components/link.d.ts.map +0 -1
  152. package/lib/components/link.js +0 -216
  153. package/lib/components/link.ts +0 -268
  154. package/lib/components/list.d.ts +0 -83
  155. package/lib/components/list.d.ts.map +0 -1
  156. package/lib/components/list.js +0 -314
  157. package/lib/components/list.ts +0 -423
  158. package/lib/components/loading.d.ts +0 -25
  159. package/lib/components/loading.d.ts.map +0 -1
  160. package/lib/components/loading.js +0 -76
  161. package/lib/components/loading.ts +0 -104
  162. package/lib/components/menu.d.ts +0 -38
  163. package/lib/components/menu.d.ts.map +0 -1
  164. package/lib/components/menu.js +0 -205
  165. package/lib/components/menu.ts +0 -279
  166. package/lib/components/modal.d.ts +0 -97
  167. package/lib/components/modal.d.ts.map +0 -1
  168. package/lib/components/modal.js +0 -463
  169. package/lib/components/modal.ts +0 -576
  170. package/lib/components/nav.d.ts +0 -46
  171. package/lib/components/nav.d.ts.map +0 -1
  172. package/lib/components/nav.js +0 -193
  173. package/lib/components/nav.ts +0 -261
  174. package/lib/components/paragraph.d.ts +0 -30
  175. package/lib/components/paragraph.d.ts.map +0 -1
  176. package/lib/components/paragraph.js +0 -93
  177. package/lib/components/paragraph.ts +0 -123
  178. package/lib/components/pen.d.ts +0 -125
  179. package/lib/components/pen.d.ts.map +0 -1
  180. package/lib/components/pen.js +0 -443
  181. package/lib/components/pen.ts +0 -567
  182. package/lib/components/progress.d.ts +0 -40
  183. package/lib/components/progress.d.ts.map +0 -1
  184. package/lib/components/progress.js +0 -116
  185. package/lib/components/progress.ts +0 -163
  186. package/lib/components/radio.d.ts +0 -43
  187. package/lib/components/radio.d.ts.map +0 -1
  188. package/lib/components/radio.js +0 -226
  189. package/lib/components/radio.ts +0 -303
  190. package/lib/components/registry.d.ts +0 -34
  191. package/lib/components/registry.d.ts.map +0 -1
  192. package/lib/components/registry.js +0 -163
  193. package/lib/components/registry.ts +0 -193
  194. package/lib/components/req.d.ts +0 -155
  195. package/lib/components/req.d.ts.map +0 -1
  196. package/lib/components/req.js +0 -253
  197. package/lib/components/req.ts +0 -303
  198. package/lib/components/script.d.ts +0 -14
  199. package/lib/components/script.d.ts.map +0 -1
  200. package/lib/components/script.js +0 -33
  201. package/lib/components/script.ts +0 -41
  202. package/lib/components/select.d.ts +0 -42
  203. package/lib/components/select.d.ts.map +0 -1
  204. package/lib/components/select.js +0 -209
  205. package/lib/components/select.ts +0 -281
  206. package/lib/components/sidebar.d.ts +0 -59
  207. package/lib/components/sidebar.d.ts.map +0 -1
  208. package/lib/components/sidebar.js +0 -298
  209. package/lib/components/sidebar.ts +0 -395
  210. package/lib/components/stack/BaseStack.d.ts +0 -65
  211. package/lib/components/stack/BaseStack.d.ts.map +0 -1
  212. package/lib/components/stack/BaseStack.js +0 -274
  213. package/lib/components/stack/BaseStack.ts +0 -328
  214. package/lib/components/stack/HStack.d.ts +0 -18
  215. package/lib/components/stack/HStack.d.ts.map +0 -1
  216. package/lib/components/stack/HStack.js +0 -22
  217. package/lib/components/stack/HStack.ts +0 -25
  218. package/lib/components/stack/VStack.d.ts +0 -19
  219. package/lib/components/stack/VStack.d.ts.map +0 -1
  220. package/lib/components/stack/VStack.js +0 -23
  221. package/lib/components/stack/VStack.ts +0 -26
  222. package/lib/components/stack/ZStack.d.ts +0 -18
  223. package/lib/components/stack/ZStack.d.ts.map +0 -1
  224. package/lib/components/stack/ZStack.js +0 -22
  225. package/lib/components/stack/ZStack.ts +0 -25
  226. package/lib/components/style.d.ts +0 -14
  227. package/lib/components/style.d.ts.map +0 -1
  228. package/lib/components/style.js +0 -33
  229. package/lib/components/style.ts +0 -41
  230. package/lib/components/switch.d.ts +0 -34
  231. package/lib/components/switch.d.ts.map +0 -1
  232. package/lib/components/switch.js +0 -209
  233. package/lib/components/switch.ts +0 -272
  234. package/lib/components/table.d.ts +0 -137
  235. package/lib/components/table.d.ts.map +0 -1
  236. package/lib/components/table.js +0 -1019
  237. package/lib/components/table.ts +0 -1225
  238. package/lib/components/tabs.d.ts +0 -53
  239. package/lib/components/tabs.d.ts.map +0 -1
  240. package/lib/components/tabs.js +0 -275
  241. package/lib/components/tabs.ts +0 -349
  242. package/lib/components/theme-toggle.d.ts +0 -45
  243. package/lib/components/theme-toggle.d.ts.map +0 -1
  244. package/lib/components/theme-toggle.js +0 -218
  245. package/lib/components/theme-toggle.ts +0 -297
  246. package/lib/components/tooltip.d.ts +0 -31
  247. package/lib/components/tooltip.d.ts.map +0 -1
  248. package/lib/components/tooltip.js +0 -112
  249. package/lib/components/tooltip.ts +0 -148
  250. package/lib/components/watcher.d.ts +0 -195
  251. package/lib/components/watcher.d.ts.map +0 -1
  252. package/lib/components/watcher.js +0 -241
  253. package/lib/components/watcher.ts +0 -261
  254. package/lib/components/write.d.ts +0 -107
  255. package/lib/components/write.d.ts.map +0 -1
  256. package/lib/components/write.js +0 -222
  257. package/lib/components/write.ts +0 -272
  258. package/lib/data/DataPipeline.d.ts +0 -113
  259. package/lib/data/DataPipeline.d.ts.map +0 -1
  260. package/lib/data/DataPipeline.js +0 -359
  261. package/lib/data/DataPipeline.ts +0 -452
  262. package/lib/facades/dataframe.jux +0 -0
  263. package/lib/globals.d.ts +0 -21
  264. package/lib/reactivity/state.d.ts +0 -36
  265. package/lib/reactivity/state.d.ts.map +0 -1
  266. package/lib/reactivity/state.js +0 -67
  267. package/lib/reactivity/state.ts +0 -78
  268. package/lib/storage/DataFrame.d.ts +0 -284
  269. package/lib/storage/DataFrame.d.ts.map +0 -1
  270. package/lib/storage/DataFrame.js +0 -1022
  271. package/lib/storage/DataFrame.ts +0 -1195
  272. package/lib/storage/DataFrameSource.d.ts +0 -158
  273. package/lib/storage/DataFrameSource.d.ts.map +0 -1
  274. package/lib/storage/DataFrameSource.js +0 -409
  275. package/lib/storage/DataFrameSource.ts +0 -556
  276. package/lib/storage/FileStorage.d.ts +0 -53
  277. package/lib/storage/FileStorage.d.ts.map +0 -1
  278. package/lib/storage/FileStorage.js +0 -80
  279. package/lib/storage/FileStorage.ts +0 -95
  280. package/lib/storage/IndexedDBDriver.d.ts +0 -75
  281. package/lib/storage/IndexedDBDriver.d.ts.map +0 -1
  282. package/lib/storage/IndexedDBDriver.js +0 -177
  283. package/lib/storage/IndexedDBDriver.ts +0 -226
  284. package/lib/storage/TabularDriver.d.ts +0 -118
  285. package/lib/storage/TabularDriver.d.ts.map +0 -1
  286. package/lib/storage/TabularDriver.js +0 -731
  287. package/lib/storage/TabularDriver.ts +0 -874
  288. package/lib/utils/codeparser.d.ts +0 -29
  289. package/lib/utils/codeparser.d.ts.map +0 -1
  290. package/lib/utils/codeparser.js +0 -409
  291. package/lib/utils/fetch.d.ts +0 -176
  292. package/lib/utils/fetch.d.ts.map +0 -1
  293. package/lib/utils/fetch.js +0 -427
  294. package/lib/utils/formatId.d.ts +0 -16
  295. package/lib/utils/formatId.d.ts.map +0 -1
  296. package/lib/utils/formatId.js +0 -27
  297. package/lib/utils/path-resolver.js +0 -23
@@ -1,155 +0,0 @@
1
- /**
2
- * Request information and utilities
3
- * Provides access to URL, query params, path, referrer, etc.
4
- */
5
- export interface RequestInfo {
6
- url: string;
7
- path: string;
8
- query: Record<string, string>;
9
- params: Record<string, string>;
10
- hash: string;
11
- referrer: string;
12
- method: string;
13
- headers: Record<string, string>;
14
- }
15
- export declare class Req {
16
- private static _instance;
17
- private _info;
18
- private constructor();
19
- /**
20
- * Singleton instance
21
- */
22
- static get instance(): Req;
23
- /**
24
- * Parse current request information
25
- */
26
- private _parseRequest;
27
- /**
28
- * Get full URL
29
- */
30
- get url(): string;
31
- /**
32
- * Get current path (e.g., "/examples/sample/dashboards")
33
- */
34
- get path(): string;
35
- /**
36
- * Get query string parameters
37
- */
38
- get query(): Record<string, string>;
39
- /**
40
- * Get path parameters
41
- */
42
- get params(): Record<string, string>;
43
- /**
44
- * Get URL hash (without #)
45
- */
46
- get hash(): string;
47
- /**
48
- * Get referrer URL
49
- */
50
- get referrer(): string;
51
- /**
52
- * Get request method (always GET for browser)
53
- */
54
- get method(): string;
55
- /**
56
- * Get request headers
57
- */
58
- get headers(): Record<string, string>;
59
- /**
60
- * Check if current path matches a pattern
61
- * @param pattern - Path pattern (supports wildcards)
62
- *
63
- * Examples:
64
- * req.matches('/examples/sample/*')
65
- * req.matches('/examples/sample/dashboards')
66
- * req.matches('/examples/*\/dashboards')
67
- */
68
- matches(pattern: string): boolean;
69
- /**
70
- * Check if current path starts with prefix
71
- */
72
- startsWith(prefix: string): boolean;
73
- /**
74
- * Check if current path ends with suffix
75
- */
76
- endsWith(suffix: string): boolean;
77
- /**
78
- * Get query parameter value
79
- */
80
- getQuery(key: string, defaultValue?: string): string | undefined;
81
- /**
82
- * Get path parameter value
83
- */
84
- getParam(key: string, defaultValue?: string): string | undefined;
85
- /**
86
- * Check if query parameter exists
87
- */
88
- hasQuery(key: string): boolean;
89
- /**
90
- * Get all query parameters as URLSearchParams
91
- */
92
- getSearchParams(): URLSearchParams;
93
- /**
94
- * Refresh request info (call after navigation)
95
- */
96
- refresh(): void;
97
- /**
98
- * Set active state on nav items based on current path
99
- * @param items - Nav items to update
100
- * @returns Updated nav items with active state set
101
- */
102
- setActiveNavItems(items: Array<{
103
- href: string;
104
- active?: boolean;
105
- }>): Array<{
106
- href: string;
107
- active: boolean;
108
- }>;
109
- /**
110
- * Check if a nav item should be active based on current path
111
- * @param href - The nav item's href
112
- */
113
- isActiveNavItem(href: string): boolean;
114
- /**
115
- * Get breadcrumbs from current path
116
- * @returns Array of breadcrumb objects with label and href
117
- */
118
- getBreadcrumbs(): Array<{
119
- label: string;
120
- href: string;
121
- }>;
122
- /**
123
- * Format segment into readable breadcrumb label
124
- */
125
- private _formatBreadcrumbLabel;
126
- /**
127
- * Check if this is the home/root path
128
- */
129
- get isHome(): boolean;
130
- /**
131
- * Get current domain
132
- */
133
- get domain(): string;
134
- /**
135
- * Get current port
136
- */
137
- get port(): string;
138
- /**
139
- * Get current protocol
140
- */
141
- get protocol(): string;
142
- /**
143
- * Check if HTTPS
144
- */
145
- get isSecure(): boolean;
146
- }
147
- /**
148
- * Global request instance
149
- */
150
- export declare const req: Req;
151
- /**
152
- * Factory function (returns singleton)
153
- */
154
- export declare function request(): Req;
155
- //# sourceMappingURL=req.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"req.d.ts","sourceRoot":"","sources":["req.ts"],"names":[],"mappings":"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"}
@@ -1,253 +0,0 @@
1
- /**
2
- * Request information and utilities
3
- * Provides access to URL, query params, path, referrer, etc.
4
- */
5
- export class Req {
6
- constructor() {
7
- this._info = this._parseRequest();
8
- }
9
- /**
10
- * Singleton instance
11
- */
12
- static get instance() {
13
- if (!Req._instance) {
14
- Req._instance = new Req();
15
- }
16
- return Req._instance;
17
- }
18
- /**
19
- * Parse current request information
20
- */
21
- _parseRequest() {
22
- const url = new URL(window.location.href);
23
- // Parse query string
24
- const query = {};
25
- url.searchParams.forEach((value, key) => {
26
- query[key] = value;
27
- });
28
- // Parse path segments as params (basic routing)
29
- const pathSegments = url.pathname.split('/').filter(s => s);
30
- const params = {};
31
- pathSegments.forEach((segment, index) => {
32
- params[`${index}`] = segment;
33
- });
34
- return {
35
- url: url.href,
36
- path: url.pathname,
37
- query,
38
- params,
39
- hash: url.hash.slice(1), // Remove leading #
40
- referrer: document.referrer,
41
- method: 'GET', // Browser requests are always GET initially
42
- headers: {
43
- 'user-agent': navigator.userAgent,
44
- 'accept-language': navigator.language
45
- }
46
- };
47
- }
48
- /**
49
- * Get full URL
50
- */
51
- get url() {
52
- return this._info.url;
53
- }
54
- /**
55
- * Get current path (e.g., "/examples/sample/dashboards")
56
- */
57
- get path() {
58
- // Always get fresh path from current URL
59
- return window.location.pathname;
60
- }
61
- /**
62
- * Get query string parameters
63
- */
64
- get query() {
65
- return { ...this._info.query };
66
- }
67
- /**
68
- * Get path parameters
69
- */
70
- get params() {
71
- return { ...this._info.params };
72
- }
73
- /**
74
- * Get URL hash (without #)
75
- */
76
- get hash() {
77
- return this._info.hash;
78
- }
79
- /**
80
- * Get referrer URL
81
- */
82
- get referrer() {
83
- return this._info.referrer;
84
- }
85
- /**
86
- * Get request method (always GET for browser)
87
- */
88
- get method() {
89
- return this._info.method;
90
- }
91
- /**
92
- * Get request headers
93
- */
94
- get headers() {
95
- return { ...this._info.headers };
96
- }
97
- /**
98
- * Check if current path matches a pattern
99
- * @param pattern - Path pattern (supports wildcards)
100
- *
101
- * Examples:
102
- * req.matches('/examples/sample/*')
103
- * req.matches('/examples/sample/dashboards')
104
- * req.matches('/examples/*\/dashboards')
105
- */
106
- matches(pattern) {
107
- const regexPattern = pattern
108
- .replace(/\*/g, '.*')
109
- .replace(/\//g, '\\/');
110
- const regex = new RegExp(`^${regexPattern}$`);
111
- return regex.test(this.path);
112
- }
113
- /**
114
- * Check if current path starts with prefix
115
- */
116
- startsWith(prefix) {
117
- return this.path.startsWith(prefix);
118
- }
119
- /**
120
- * Check if current path ends with suffix
121
- */
122
- endsWith(suffix) {
123
- return this.path.endsWith(suffix);
124
- }
125
- /**
126
- * Get query parameter value
127
- */
128
- getQuery(key, defaultValue) {
129
- return this.query[key] ?? defaultValue;
130
- }
131
- /**
132
- * Get path parameter value
133
- */
134
- getParam(key, defaultValue) {
135
- return this.params[key] ?? defaultValue;
136
- }
137
- /**
138
- * Check if query parameter exists
139
- */
140
- hasQuery(key) {
141
- return key in this.query;
142
- }
143
- /**
144
- * Get all query parameters as URLSearchParams
145
- */
146
- getSearchParams() {
147
- return new URLSearchParams(this.query);
148
- }
149
- /**
150
- * Refresh request info (call after navigation)
151
- */
152
- refresh() {
153
- this._info = this._parseRequest();
154
- }
155
- /**
156
- * Set active state on nav items based on current path
157
- * @param items - Nav items to update
158
- * @returns Updated nav items with active state set
159
- */
160
- setActiveNavItems(items) {
161
- return items.map(item => ({
162
- ...item,
163
- active: this.isActiveNavItem(item.href)
164
- }));
165
- }
166
- /**
167
- * Check if a nav item should be active based on current path
168
- * @param href - The nav item's href
169
- */
170
- isActiveNavItem(href) {
171
- // Exact match
172
- if (href === this.path) {
173
- return true;
174
- }
175
- // Starts with match (for parent routes)
176
- // Must be followed by a path separator or end of string
177
- // e.g., "/examples/sample" matches "/examples/sample/dashboards"
178
- // but "/examples/sam" does NOT match "/examples/sample/dashboards"
179
- if (href !== '/' && (this.path === href || this.path.startsWith(href + '/'))) {
180
- return true;
181
- }
182
- return false;
183
- }
184
- /**
185
- * Get breadcrumbs from current path
186
- * @returns Array of breadcrumb objects with label and href
187
- */
188
- getBreadcrumbs() {
189
- const segments = this.path.split('/').filter(s => s);
190
- const breadcrumbs = [
191
- { label: 'Home', href: '/' }
192
- ];
193
- let currentPath = '';
194
- segments.forEach(segment => {
195
- currentPath += `/${segment}`;
196
- breadcrumbs.push({
197
- label: this._formatBreadcrumbLabel(segment),
198
- href: currentPath
199
- });
200
- });
201
- return breadcrumbs;
202
- }
203
- /**
204
- * Format segment into readable breadcrumb label
205
- */
206
- _formatBreadcrumbLabel(segment) {
207
- return segment
208
- .split('-')
209
- .map(word => word.charAt(0).toUpperCase() + word.slice(1))
210
- .join(' ');
211
- }
212
- /**
213
- * Check if this is the home/root path
214
- */
215
- get isHome() {
216
- return this.path === '/' || this.path === '';
217
- }
218
- /**
219
- * Get current domain
220
- */
221
- get domain() {
222
- return window.location.hostname;
223
- }
224
- /**
225
- * Get current port
226
- */
227
- get port() {
228
- return window.location.port;
229
- }
230
- /**
231
- * Get current protocol
232
- */
233
- get protocol() {
234
- return window.location.protocol.replace(':', '');
235
- }
236
- /**
237
- * Check if HTTPS
238
- */
239
- get isSecure() {
240
- return this.protocol === 'https';
241
- }
242
- }
243
- Req._instance = null;
244
- /**
245
- * Global request instance
246
- */
247
- export const req = Req.instance;
248
- /**
249
- * Factory function (returns singleton)
250
- */
251
- export function request() {
252
- return Req.instance;
253
- }
@@ -1,303 +0,0 @@
1
- /**
2
- * Request information and utilities
3
- * Provides access to URL, query params, path, referrer, etc.
4
- */
5
-
6
- export interface RequestInfo {
7
- url: string;
8
- path: string;
9
- query: Record<string, string>;
10
- params: Record<string, string>;
11
- hash: string;
12
- referrer: string;
13
- method: string;
14
- headers: Record<string, string>;
15
- }
16
-
17
- export class Req {
18
- private static _instance: Req | null = null;
19
- private _info: RequestInfo;
20
-
21
- private constructor() {
22
- this._info = this._parseRequest();
23
- }
24
-
25
- /**
26
- * Singleton instance
27
- */
28
- static get instance(): Req {
29
- if (!Req._instance) {
30
- Req._instance = new Req();
31
- }
32
- return Req._instance;
33
- }
34
-
35
- /**
36
- * Parse current request information
37
- */
38
- private _parseRequest(): RequestInfo {
39
- const url = new URL(window.location.href);
40
-
41
- // Parse query string
42
- const query: Record<string, string> = {};
43
- url.searchParams.forEach((value, key) => {
44
- query[key] = value;
45
- });
46
-
47
- // Parse path segments as params (basic routing)
48
- const pathSegments = url.pathname.split('/').filter(s => s);
49
- const params: Record<string, string> = {};
50
- pathSegments.forEach((segment, index) => {
51
- params[`${index}`] = segment;
52
- });
53
-
54
- return {
55
- url: url.href,
56
- path: url.pathname,
57
- query,
58
- params,
59
- hash: url.hash.slice(1), // Remove leading #
60
- referrer: document.referrer,
61
- method: 'GET', // Browser requests are always GET initially
62
- headers: {
63
- 'user-agent': navigator.userAgent,
64
- 'accept-language': navigator.language
65
- }
66
- };
67
- }
68
-
69
- /**
70
- * Get full URL
71
- */
72
- get url(): string {
73
- return this._info.url;
74
- }
75
-
76
- /**
77
- * Get current path (e.g., "/examples/sample/dashboards")
78
- */
79
- get path(): string {
80
- // Always get fresh path from current URL
81
- return window.location.pathname;
82
- }
83
-
84
- /**
85
- * Get query string parameters
86
- */
87
- get query(): Record<string, string> {
88
- return { ...this._info.query };
89
- }
90
-
91
- /**
92
- * Get path parameters
93
- */
94
- get params(): Record<string, string> {
95
- return { ...this._info.params };
96
- }
97
-
98
- /**
99
- * Get URL hash (without #)
100
- */
101
- get hash(): string {
102
- return this._info.hash;
103
- }
104
-
105
- /**
106
- * Get referrer URL
107
- */
108
- get referrer(): string {
109
- return this._info.referrer;
110
- }
111
-
112
- /**
113
- * Get request method (always GET for browser)
114
- */
115
- get method(): string {
116
- return this._info.method;
117
- }
118
-
119
- /**
120
- * Get request headers
121
- */
122
- get headers(): Record<string, string> {
123
- return { ...this._info.headers };
124
- }
125
-
126
- /**
127
- * Check if current path matches a pattern
128
- * @param pattern - Path pattern (supports wildcards)
129
- *
130
- * Examples:
131
- * req.matches('/examples/sample/*')
132
- * req.matches('/examples/sample/dashboards')
133
- * req.matches('/examples/*\/dashboards')
134
- */
135
- matches(pattern: string): boolean {
136
- const regexPattern = pattern
137
- .replace(/\*/g, '.*')
138
- .replace(/\//g, '\\/');
139
- const regex = new RegExp(`^${regexPattern}$`);
140
- return regex.test(this.path);
141
- }
142
-
143
- /**
144
- * Check if current path starts with prefix
145
- */
146
- startsWith(prefix: string): boolean {
147
- return this.path.startsWith(prefix);
148
- }
149
-
150
- /**
151
- * Check if current path ends with suffix
152
- */
153
- endsWith(suffix: string): boolean {
154
- return this.path.endsWith(suffix);
155
- }
156
-
157
- /**
158
- * Get query parameter value
159
- */
160
- getQuery(key: string, defaultValue?: string): string | undefined {
161
- return this.query[key] ?? defaultValue;
162
- }
163
-
164
- /**
165
- * Get path parameter value
166
- */
167
- getParam(key: string, defaultValue?: string): string | undefined {
168
- return this.params[key] ?? defaultValue;
169
- }
170
-
171
- /**
172
- * Check if query parameter exists
173
- */
174
- hasQuery(key: string): boolean {
175
- return key in this.query;
176
- }
177
-
178
- /**
179
- * Get all query parameters as URLSearchParams
180
- */
181
- getSearchParams(): URLSearchParams {
182
- return new URLSearchParams(this.query);
183
- }
184
-
185
- /**
186
- * Refresh request info (call after navigation)
187
- */
188
- refresh(): void {
189
- this._info = this._parseRequest();
190
- }
191
-
192
- /**
193
- * Set active state on nav items based on current path
194
- * @param items - Nav items to update
195
- * @returns Updated nav items with active state set
196
- */
197
- setActiveNavItems(items: Array<{ href: string; active?: boolean }>): Array<{ href: string; active: boolean }> {
198
- return items.map(item => ({
199
- ...item,
200
- active: this.isActiveNavItem(item.href)
201
- }));
202
- }
203
-
204
- /**
205
- * Check if a nav item should be active based on current path
206
- * @param href - The nav item's href
207
- */
208
- isActiveNavItem(href: string): boolean {
209
- // Exact match
210
- if (href === this.path) {
211
- return true;
212
- }
213
-
214
- // Starts with match (for parent routes)
215
- // Must be followed by a path separator or end of string
216
- // e.g., "/examples/sample" matches "/examples/sample/dashboards"
217
- // but "/examples/sam" does NOT match "/examples/sample/dashboards"
218
- if (href !== '/' && (this.path === href || this.path.startsWith(href + '/'))) {
219
- return true;
220
- }
221
-
222
- return false;
223
- }
224
-
225
- /**
226
- * Get breadcrumbs from current path
227
- * @returns Array of breadcrumb objects with label and href
228
- */
229
- getBreadcrumbs(): Array<{ label: string; href: string }> {
230
- const segments = this.path.split('/').filter(s => s);
231
- const breadcrumbs: Array<{ label: string; href: string }> = [
232
- { label: 'Home', href: '/' }
233
- ];
234
-
235
- let currentPath = '';
236
- segments.forEach(segment => {
237
- currentPath += `/${segment}`;
238
- breadcrumbs.push({
239
- label: this._formatBreadcrumbLabel(segment),
240
- href: currentPath
241
- });
242
- });
243
-
244
- return breadcrumbs;
245
- }
246
-
247
- /**
248
- * Format segment into readable breadcrumb label
249
- */
250
- private _formatBreadcrumbLabel(segment: string): string {
251
- return segment
252
- .split('-')
253
- .map(word => word.charAt(0).toUpperCase() + word.slice(1))
254
- .join(' ');
255
- }
256
-
257
- /**
258
- * Check if this is the home/root path
259
- */
260
- get isHome(): boolean {
261
- return this.path === '/' || this.path === '';
262
- }
263
-
264
- /**
265
- * Get current domain
266
- */
267
- get domain(): string {
268
- return window.location.hostname;
269
- }
270
-
271
- /**
272
- * Get current port
273
- */
274
- get port(): string {
275
- return window.location.port;
276
- }
277
-
278
- /**
279
- * Get current protocol
280
- */
281
- get protocol(): string {
282
- return window.location.protocol.replace(':', '');
283
- }
284
-
285
- /**
286
- * Check if HTTPS
287
- */
288
- get isSecure(): boolean {
289
- return this.protocol === 'https';
290
- }
291
- }
292
-
293
- /**
294
- * Global request instance
295
- */
296
- export const req = Req.instance;
297
-
298
- /**
299
- * Factory function (returns singleton)
300
- */
301
- export function request(): Req {
302
- return Req.instance;
303
- }