juxscript 1.1.240 → 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 +17 -5
  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,14 +0,0 @@
1
- /**
2
- * Script - Inject inline JavaScript into the document
3
- * For external scripts, use Import component instead
4
- * Auto-renders when created or modified
5
- */
6
- export declare class Script {
7
- private _id;
8
- private code;
9
- constructor(code: string, id?: string);
10
- render(): this;
11
- remove(): void;
12
- }
13
- export declare function script(code: string, id?: string): Script;
14
- //# sourceMappingURL=script.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"script.d.ts","sourceRoot":"","sources":["script.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,IAAI,CAAS;gBAET,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM;IAMrC,MAAM,IAAI,IAAI;IAcd,MAAM,IAAI,IAAI;CAMf;AAGD,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAExD"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Script - Inject inline JavaScript into the document
3
- * For external scripts, use Import component instead
4
- * Auto-renders when created or modified
5
- */
6
- export class Script {
7
- constructor(code, id) {
8
- // ID only for deduplication, auto-generate if not provided
9
- this._id = id || `jux-script-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
10
- this.code = code;
11
- }
12
- render() {
13
- // Check if script with this ID already exists
14
- if (document.getElementById(this._id)) {
15
- return this;
16
- }
17
- const script = document.createElement('script');
18
- script.id = this._id;
19
- script.textContent = this.code;
20
- document.head.appendChild(script);
21
- return this;
22
- }
23
- remove() {
24
- const existing = document.getElementById(this._id);
25
- if (existing) {
26
- existing.remove();
27
- }
28
- }
29
- }
30
- // ✅ ID is optional
31
- export function script(code, id) {
32
- return new Script(code, id);
33
- }
@@ -1,41 +0,0 @@
1
- /**
2
- * Script - Inject inline JavaScript into the document
3
- * For external scripts, use Import component instead
4
- * Auto-renders when created or modified
5
- */
6
- export class Script {
7
- private _id: string;
8
- private code: string;
9
-
10
- constructor(code: string, id?: string) {
11
- // ID only for deduplication, auto-generate if not provided
12
- this._id = id || `jux-script-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
13
- this.code = code;
14
- }
15
-
16
- render(): this {
17
- // Check if script with this ID already exists
18
- if (document.getElementById(this._id)) {
19
- return this;
20
- }
21
-
22
- const script = document.createElement('script');
23
- script.id = this._id;
24
- script.textContent = this.code;
25
- document.head.appendChild(script);
26
-
27
- return this;
28
- }
29
-
30
- remove(): void {
31
- const existing = document.getElementById(this._id);
32
- if (existing) {
33
- existing.remove();
34
- }
35
- }
36
- }
37
-
38
- // ✅ ID is optional
39
- export function script(code: string, id?: string): Script {
40
- return new Script(code, id);
41
- }
@@ -1,42 +0,0 @@
1
- import { BaseComponent, BaseState } from './base/BaseComponent.js';
2
- export interface SelectOption {
3
- label: string;
4
- value: string;
5
- disabled?: boolean;
6
- }
7
- export interface SelectOptions {
8
- options?: SelectOption[];
9
- value?: string;
10
- label?: string;
11
- placeholder?: string;
12
- required?: boolean;
13
- disabled?: boolean;
14
- name?: string;
15
- style?: string;
16
- class?: string;
17
- onValidate?: (value: string) => boolean | string;
18
- }
19
- interface SelectState extends BaseState {
20
- options: SelectOption[];
21
- value: string;
22
- placeholder: string;
23
- }
24
- export declare class Select extends BaseComponent<SelectState> {
25
- constructor(id: string, options?: SelectOptions);
26
- protected getTriggerEvents(): readonly string[];
27
- protected getCallbackEvents(): readonly string[];
28
- options(value: SelectOption[]): this;
29
- value(value: string): this;
30
- placeholder(value: string): this;
31
- addOption(option: SelectOption): this;
32
- getValue(): string;
33
- setValue(value: string): this;
34
- validate(): boolean;
35
- isValid(): boolean;
36
- protected _validateValue(value: string): boolean | string;
37
- protected _buildInputElement(): HTMLElement;
38
- render(targetId?: string | HTMLElement | BaseComponent<any>): this;
39
- }
40
- export declare function select(id: string, options?: SelectOptions): Select;
41
- export {};
42
- //# sourceMappingURL=select.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAOnE,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC1B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,CAAC;CACpD;AAED,UAAU,WAAY,SAAQ,SAAS;IACnC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,qBAAa,MAAO,SAAQ,aAAa,CAAC,WAAW,CAAC;gBACtC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB;IAsBnD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAehD,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,IAAI;IAKpC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI1B,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKhC,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IASrC,QAAQ,IAAI,MAAM;IAIlB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAU7B,QAAQ,IAAI,OAAO;IAcnB,OAAO,IAAI,OAAO;IAKlB,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM;IAsBzD,SAAS,CAAC,kBAAkB,IAAI,WAAW;IAqC3C,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;CAuFrE;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAEtE"}
@@ -1,209 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- import { formatIdAsLabel } from '../utils/formatId.js'; // ✅ Import
3
- // Event definitions
4
- const TRIGGER_EVENTS = [];
5
- const CALLBACK_EVENTS = ['change'];
6
- export class Select extends BaseComponent {
7
- constructor(id, options = {}) {
8
- super(id, {
9
- visible: true,
10
- disabled: options.disabled ?? false,
11
- loading: false,
12
- class: options.class ?? '',
13
- style: options.style ?? '',
14
- attributes: {},
15
- label: options.label ?? formatIdAsLabel(id), // ✅ Auto-generate
16
- required: options.required ?? false,
17
- name: options.name ?? id,
18
- errorMessage: undefined,
19
- options: options.options ?? [],
20
- value: options.value ?? '',
21
- placeholder: options.placeholder ?? 'Select an option'
22
- });
23
- if (options.onValidate) {
24
- this._onValidate = options.onValidate;
25
- }
26
- }
27
- getTriggerEvents() {
28
- return TRIGGER_EVENTS;
29
- }
30
- getCallbackEvents() {
31
- return CALLBACK_EVENTS;
32
- }
33
- /* ═════════════════════════════════════════════════════════════════
34
- * FLUENT API
35
- * ═════════════════════════════════════════════════════════════════ */
36
- // BaseComponent:
37
- // - label(), required(), name(), onValidate()
38
- // - validate(), isValid()
39
- // - style(), class()
40
- // - bind(), sync(), renderTo()
41
- // - disabled(), enable(), disable()
42
- options(value) {
43
- this.state.options = value;
44
- return this;
45
- }
46
- value(value) {
47
- return this.setValue(value);
48
- }
49
- placeholder(value) {
50
- this.state.placeholder = value;
51
- return this;
52
- }
53
- addOption(option) {
54
- this.state.options = [...this.state.options, option];
55
- return this;
56
- }
57
- /* ═════════════════════════════════════════════════════════════════
58
- * FORM INPUT IMPLEMENTATION
59
- * ═════════════════════════════════════════════════════════════════ */
60
- getValue() {
61
- return this.state.value;
62
- }
63
- setValue(value) {
64
- this.state.value = value;
65
- if (this._inputElement) {
66
- this._inputElement.value = value;
67
- }
68
- return this;
69
- }
70
- validate() {
71
- this._hasBeenValidated = true;
72
- const value = this.getValue();
73
- const result = this._validateValue(value);
74
- if (result === true) {
75
- this._clearError();
76
- return true;
77
- }
78
- else {
79
- this._showError(result);
80
- return false;
81
- }
82
- }
83
- isValid() {
84
- const value = this.getValue();
85
- return this._validateValue(value) === true;
86
- }
87
- _validateValue(value) {
88
- const { required, options } = this.state;
89
- if (required && !value) {
90
- return 'Please select an option';
91
- }
92
- // Validate that value is one of the options
93
- if (value && !options.some(opt => opt.value === value)) {
94
- return 'Invalid option selected';
95
- }
96
- if (this._onValidate) {
97
- const result = this._onValidate(value);
98
- if (result !== true) {
99
- return result || 'Invalid value';
100
- }
101
- }
102
- return true;
103
- }
104
- _buildInputElement() {
105
- const { options, value, placeholder, required, disabled, name } = this.state;
106
- const select = document.createElement('select');
107
- select.className = 'jux-input-element jux-select-element';
108
- select.id = `${this._id}-input`;
109
- select.name = name;
110
- select.required = required;
111
- select.disabled = disabled;
112
- // Placeholder option
113
- if (placeholder) {
114
- const placeholderOption = document.createElement('option');
115
- placeholderOption.value = '';
116
- placeholderOption.textContent = placeholder;
117
- placeholderOption.disabled = true;
118
- placeholderOption.selected = !value;
119
- select.appendChild(placeholderOption);
120
- }
121
- // Options
122
- options.forEach(option => {
123
- const optionEl = document.createElement('option');
124
- optionEl.value = option.value;
125
- optionEl.textContent = option.label;
126
- optionEl.disabled = option.disabled || false;
127
- optionEl.selected = option.value === value;
128
- select.appendChild(optionEl);
129
- });
130
- return select;
131
- }
132
- /* ═════════════════════════════════════════════════════════════════
133
- * RENDER
134
- * ═════════════════════════════════════════════════════════════════ */
135
- render(targetId) {
136
- const container = this._setupContainer(targetId);
137
- const { style, class: className } = this.state;
138
- // Build wrapper
139
- const wrapper = document.createElement('div');
140
- wrapper.className = 'jux-input jux-select';
141
- wrapper.id = this._id;
142
- if (className)
143
- wrapper.className += ` ${className}`;
144
- if (style)
145
- wrapper.setAttribute('style', style);
146
- // Label
147
- if (this.state.label) {
148
- wrapper.appendChild(this._renderLabel());
149
- }
150
- // Select container
151
- const selectContainer = document.createElement('div');
152
- selectContainer.className = 'jux-input-container jux-select-container';
153
- // Select element
154
- const selectEl = this._buildInputElement();
155
- this._inputElement = selectEl;
156
- selectContainer.appendChild(selectEl);
157
- wrapper.appendChild(selectContainer);
158
- // Error element
159
- wrapper.appendChild(this._renderError());
160
- // Wire change callback with (value, event, component)
161
- selectEl.addEventListener('change', (e) => {
162
- this.state.value = selectEl.value;
163
- this._triggerCallback('change', selectEl.value, e, this);
164
- });
165
- // Wire events
166
- this._wireStandardEvents(wrapper);
167
- this._wireFormSync(selectEl, 'change');
168
- // Sync label changes
169
- const labelSync = this._syncBindings.find(b => b.property === 'label');
170
- if (labelSync) {
171
- const transform = labelSync.toComponent || ((v) => String(v));
172
- labelSync.stateObj.subscribe((val) => {
173
- this.label(transform(val));
174
- });
175
- }
176
- // Sync options changes
177
- const optionsSync = this._syncBindings.find(b => b.property === 'options');
178
- if (optionsSync) {
179
- const transform = optionsSync.toComponent || ((v) => v);
180
- optionsSync.stateObj.subscribe((val) => {
181
- const transformed = transform(val);
182
- this.state.options = transformed;
183
- // Rebuild select options
184
- selectEl.innerHTML = '';
185
- if (this.state.placeholder) {
186
- const placeholderOption = document.createElement('option');
187
- placeholderOption.value = '';
188
- placeholderOption.textContent = this.state.placeholder;
189
- placeholderOption.disabled = true;
190
- placeholderOption.selected = !this.state.value;
191
- selectEl.appendChild(placeholderOption);
192
- }
193
- transformed.forEach((option) => {
194
- const optionEl = document.createElement('option');
195
- optionEl.value = option.value;
196
- optionEl.textContent = option.label;
197
- optionEl.disabled = option.disabled || false;
198
- optionEl.selected = option.value === this.state.value;
199
- selectEl.appendChild(optionEl);
200
- });
201
- });
202
- }
203
- container.appendChild(wrapper);
204
- return this;
205
- }
206
- }
207
- export function select(id, options = {}) {
208
- return new Select(id, options);
209
- }
@@ -1,281 +0,0 @@
1
- import { BaseComponent, BaseState } from './base/BaseComponent.js';
2
- import { formatIdAsLabel } from '../utils/formatId.js'; // ✅ Import
3
-
4
- // Event definitions
5
- const TRIGGER_EVENTS = [] as const;
6
- const CALLBACK_EVENTS = ['change'] as const;
7
-
8
- export interface SelectOption {
9
- label: string;
10
- value: string;
11
- disabled?: boolean;
12
- }
13
-
14
- export interface SelectOptions {
15
- options?: SelectOption[];
16
- value?: string;
17
- label?: string;
18
- placeholder?: string;
19
- required?: boolean;
20
- disabled?: boolean;
21
- name?: string;
22
- style?: string;
23
- class?: string;
24
- onValidate?: (value: string) => boolean | string;
25
- }
26
-
27
- interface SelectState extends BaseState {
28
- options: SelectOption[];
29
- value: string;
30
- placeholder: string;
31
- }
32
-
33
- export class Select extends BaseComponent<SelectState> {
34
- constructor(id: string, options: SelectOptions = {}) {
35
- super(id, {
36
- visible: true,
37
- disabled: options.disabled ?? false,
38
- loading: false,
39
- class: options.class ?? '',
40
- style: options.style ?? '',
41
- attributes: {},
42
- label: options.label ?? formatIdAsLabel(id), // ✅ Auto-generate
43
- required: options.required ?? false,
44
- name: options.name ?? id,
45
- errorMessage: undefined,
46
- options: options.options ?? [],
47
- value: options.value ?? '',
48
- placeholder: options.placeholder ?? 'Select an option'
49
- });
50
-
51
- if (options.onValidate) {
52
- this._onValidate = options.onValidate;
53
- }
54
- }
55
-
56
- protected getTriggerEvents(): readonly string[] {
57
- return TRIGGER_EVENTS;
58
- }
59
-
60
- protected getCallbackEvents(): readonly string[] {
61
- return CALLBACK_EVENTS;
62
- }
63
-
64
- /* ═════════════════════════════════════════════════════════════════
65
- * FLUENT API
66
- * ═════════════════════════════════════════════════════════════════ */
67
-
68
- // BaseComponent:
69
- // - label(), required(), name(), onValidate()
70
- // - validate(), isValid()
71
- // - style(), class()
72
- // - bind(), sync(), renderTo()
73
- // - disabled(), enable(), disable()
74
-
75
- options(value: SelectOption[]): this {
76
- this.state.options = value;
77
- return this;
78
- }
79
-
80
- value(value: string): this {
81
- return this.setValue(value);
82
- }
83
-
84
- placeholder(value: string): this {
85
- this.state.placeholder = value;
86
- return this;
87
- }
88
-
89
- addOption(option: SelectOption): this {
90
- this.state.options = [...this.state.options, option];
91
- return this;
92
- }
93
-
94
- /* ═════════════════════════════════════════════════════════════════
95
- * FORM INPUT IMPLEMENTATION
96
- * ═════════════════════════════════════════════════════════════════ */
97
-
98
- getValue(): string {
99
- return this.state.value;
100
- }
101
-
102
- setValue(value: string): this {
103
- this.state.value = value;
104
-
105
- if (this._inputElement) {
106
- (this._inputElement as HTMLSelectElement).value = value;
107
- }
108
-
109
- return this;
110
- }
111
-
112
- validate(): boolean {
113
- this._hasBeenValidated = true;
114
- const value = this.getValue();
115
- const result = this._validateValue(value);
116
-
117
- if (result === true) {
118
- this._clearError();
119
- return true;
120
- } else {
121
- this._showError(result as string);
122
- return false;
123
- }
124
- }
125
-
126
- isValid(): boolean {
127
- const value = this.getValue();
128
- return this._validateValue(value) === true;
129
- }
130
-
131
- protected _validateValue(value: string): boolean | string {
132
- const { required, options } = this.state;
133
-
134
- if (required && !value) {
135
- return 'Please select an option';
136
- }
137
-
138
- // Validate that value is one of the options
139
- if (value && !options.some(opt => opt.value === value)) {
140
- return 'Invalid option selected';
141
- }
142
-
143
- if (this._onValidate) {
144
- const result = this._onValidate(value);
145
- if (result !== true) {
146
- return result || 'Invalid value';
147
- }
148
- }
149
-
150
- return true;
151
- }
152
-
153
- protected _buildInputElement(): HTMLElement {
154
- const { options, value, placeholder, required, disabled, name } = this.state;
155
-
156
- const select = document.createElement('select');
157
- select.className = 'jux-input-element jux-select-element';
158
- select.id = `${this._id}-input`;
159
- select.name = name!;
160
- select.required = required!;
161
- select.disabled = disabled!;
162
-
163
- // Placeholder option
164
- if (placeholder) {
165
- const placeholderOption = document.createElement('option');
166
- placeholderOption.value = '';
167
- placeholderOption.textContent = placeholder;
168
- placeholderOption.disabled = true;
169
- placeholderOption.selected = !value;
170
- select.appendChild(placeholderOption);
171
- }
172
-
173
- // Options
174
- options.forEach(option => {
175
- const optionEl = document.createElement('option');
176
- optionEl.value = option.value;
177
- optionEl.textContent = option.label;
178
- optionEl.disabled = option.disabled || false;
179
- optionEl.selected = option.value === value;
180
- select.appendChild(optionEl);
181
- });
182
-
183
- return select;
184
- }
185
-
186
- /* ═════════════════════════════════════════════════════════════════
187
- * RENDER
188
- * ═════════════════════════════════════════════════════════════════ */
189
-
190
- render(targetId?: string | HTMLElement | BaseComponent<any>): this {
191
- const container = this._setupContainer(targetId);
192
-
193
- const { style, class: className } = this.state;
194
-
195
- // Build wrapper
196
- const wrapper = document.createElement('div');
197
- wrapper.className = 'jux-input jux-select';
198
- wrapper.id = this._id;
199
- if (className) wrapper.className += ` ${className}`;
200
- if (style) wrapper.setAttribute('style', style);
201
-
202
- // Label
203
- if (this.state.label) {
204
- wrapper.appendChild(this._renderLabel());
205
- }
206
-
207
- // Select container
208
- const selectContainer = document.createElement('div');
209
- selectContainer.className = 'jux-input-container jux-select-container';
210
-
211
- // Select element
212
- const selectEl = this._buildInputElement() as HTMLSelectElement;
213
- this._inputElement = selectEl;
214
- selectContainer.appendChild(selectEl);
215
- wrapper.appendChild(selectContainer);
216
-
217
- // Error element
218
- wrapper.appendChild(this._renderError());
219
-
220
- // Wire change callback with (value, event, component)
221
- selectEl.addEventListener('change', (e) => {
222
- this.state.value = selectEl.value;
223
- this._triggerCallback('change', selectEl.value, e, this);
224
- });
225
-
226
- // Wire events
227
- this._wireStandardEvents(wrapper);
228
- this._wireFormSync(selectEl, 'change');
229
-
230
- // Sync label changes
231
- const labelSync = this._syncBindings.find(b => b.property === 'label');
232
- if (labelSync) {
233
- const transform = labelSync.toComponent || ((v: any) => String(v));
234
- labelSync.stateObj.subscribe((val: any) => {
235
- this.label(transform(val));
236
- });
237
- }
238
-
239
- // Sync options changes
240
- const optionsSync = this._syncBindings.find(b => b.property === 'options');
241
- if (optionsSync) {
242
- const transform = optionsSync.toComponent || ((v: any) => v);
243
- optionsSync.stateObj.subscribe((val: any) => {
244
- const transformed = transform(val);
245
- this.state.options = transformed;
246
-
247
- // Rebuild select options
248
- selectEl.innerHTML = '';
249
-
250
- if (this.state.placeholder) {
251
- const placeholderOption = document.createElement('option');
252
- placeholderOption.value = '';
253
- placeholderOption.textContent = this.state.placeholder;
254
- placeholderOption.disabled = true;
255
- placeholderOption.selected = !this.state.value;
256
- selectEl.appendChild(placeholderOption);
257
- }
258
-
259
- transformed.forEach((option: SelectOption) => {
260
- const optionEl = document.createElement('option');
261
- optionEl.value = option.value;
262
- optionEl.textContent = option.label;
263
- optionEl.disabled = option.disabled || false;
264
- optionEl.selected = option.value === this.state.value;
265
- selectEl.appendChild(optionEl);
266
- });
267
- });
268
- }
269
-
270
- container.appendChild(wrapper);
271
-
272
-
273
- return this;
274
- }
275
-
276
-
277
- }
278
-
279
- export function select(id: string, options: SelectOptions = {}): Select {
280
- return new Select(id, options);
281
- }
@@ -1,59 +0,0 @@
1
- import { BaseComponent, BaseState } from './base/BaseComponent.js';
2
- export interface SidebarItem {
3
- label: string;
4
- href?: string;
5
- click?: () => void;
6
- icon?: string;
7
- items?: SidebarItem[];
8
- active?: boolean;
9
- itemClass?: string;
10
- }
11
- export interface SidebarOptions {
12
- position?: 'left' | 'right';
13
- width?: string;
14
- collapsible?: boolean;
15
- showToggle?: boolean;
16
- expandOnHover?: boolean;
17
- collapsed?: boolean;
18
- items?: SidebarItem[];
19
- header?: string;
20
- footer?: string;
21
- style?: string;
22
- class?: string;
23
- }
24
- type SidebarState = BaseState & {
25
- position: 'left' | 'right';
26
- width: string;
27
- collapsible: boolean;
28
- showToggle: boolean;
29
- expandOnHover: boolean;
30
- collapsed: boolean;
31
- items: SidebarItem[];
32
- header: string;
33
- footer: string;
34
- };
35
- export declare class Sidebar extends BaseComponent<SidebarState> {
36
- private _sidebar;
37
- constructor(id: string, options?: SidebarOptions);
38
- protected getTriggerEvents(): readonly string[];
39
- protected getCallbackEvents(): readonly string[];
40
- private _setActiveStates;
41
- private _renderItem;
42
- update(prop: string, value: any): void;
43
- width(value: string): this;
44
- position(value: 'left' | 'right'): this;
45
- collapsible(value: boolean): this;
46
- showToggle(value: boolean): this;
47
- expandOnHover(value: boolean): this;
48
- collapsed(value: boolean): this;
49
- items(value: SidebarItem[]): this;
50
- addItem(item: SidebarItem): this;
51
- header(value: string): this;
52
- footer(value: string): this;
53
- toggle(): void;
54
- refreshActiveStates(): this;
55
- render(targetId?: string | HTMLElement | BaseComponent<any>): this;
56
- }
57
- export declare function sidebar(id: string, options?: SidebarOptions): Sidebar;
58
- export {};
59
- //# sourceMappingURL=sidebar.d.ts.map