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,423 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- import { renderIcon } from './icons.js';
3
-
4
- // Event definitions
5
- const TRIGGER_EVENTS = [] as const;
6
- const CALLBACK_EVENTS = ['itemClick', 'itemDoubleClick', 'selectionChange'] as const;
7
-
8
- export interface ListItem {
9
- id?: string;
10
- icon?: string;
11
- title?: string;
12
- body?: string;
13
- type?: 'success' | 'warning' | 'error' | 'info' | 'default' | string;
14
- metadata?: string;
15
- itemClass?: string;
16
- disabled?: boolean;
17
- selected?: boolean;
18
- data?: any; // Arbitrary data attached to item
19
- }
20
-
21
- export interface ListOptions {
22
- items?: (ListItem | string)[]; // ✅ Allow string or ListItem
23
- header?: string;
24
- gap?: string;
25
- direction?: 'vertical' | 'horizontal';
26
- selectable?: boolean;
27
- multiSelect?: boolean;
28
- selectedIndex?: number | null;
29
- selectedIndices?: number[];
30
- onItemClick?: (item: ListItem, index: number, e: Event) => void;
31
- onItemDoubleClick?: (item: ListItem, index: number, e: Event) => void;
32
- onSelectionChange?: (selectedItems: ListItem[], selectedIndices: number[]) => void;
33
- ordered?: boolean;
34
- striped?: boolean;
35
- hoverable?: boolean;
36
- bordered?: boolean;
37
- style?: string;
38
- class?: string;
39
- }
40
-
41
- type ListState = {
42
- items: ListItem[];
43
- header: string;
44
- gap: string;
45
- direction: string;
46
- selectable: boolean;
47
- multiSelect: boolean;
48
- selectedIndex: number | null;
49
- selectedIndices: number[];
50
- ordered: boolean;
51
- striped: boolean;
52
- hoverable: boolean;
53
- bordered: boolean;
54
- style: string;
55
- class: string;
56
- };
57
-
58
- export class List extends BaseComponent<ListState> {
59
- private _onItemClick: ((item: ListItem, index: number, e: Event) => void) | null = null;
60
- private _onItemDoubleClick: ((item: ListItem, index: number, e: Event) => void) | null = null;
61
- private _onSelectionChange: ((selectedItems: ListItem[], selectedIndices: number[]) => void) | null = null;
62
- private _listElement: HTMLElement | null = null;
63
-
64
- constructor(id: string, options: ListOptions = {}) {
65
- // ✅ Normalize items - convert strings to ListItem objects
66
- const normalizedItems = (options.items ?? []).map(item =>
67
- typeof item === 'string' ? { title: item } : item
68
- );
69
-
70
- super(id, {
71
- items: normalizedItems,
72
- header: options.header ?? '',
73
- gap: options.gap ?? '0.5rem',
74
- direction: options.direction ?? 'vertical',
75
- selectable: options.selectable ?? false,
76
- multiSelect: options.multiSelect ?? false,
77
- selectedIndex: options.selectedIndex ?? null,
78
- selectedIndices: options.selectedIndices ?? [],
79
- ordered: options.ordered ?? false,
80
- striped: options.striped ?? false,
81
- hoverable: options.hoverable ?? true,
82
- bordered: options.bordered ?? false,
83
- style: options.style ?? '',
84
- class: options.class ?? ''
85
- });
86
-
87
- this._onItemClick = options.onItemClick ?? null;
88
- this._onItemDoubleClick = options.onItemDoubleClick ?? null;
89
- this._onSelectionChange = options.onSelectionChange ?? null;
90
- }
91
-
92
- protected getTriggerEvents(): readonly string[] {
93
- return TRIGGER_EVENTS;
94
- }
95
-
96
- protected getCallbackEvents(): readonly string[] {
97
- return CALLBACK_EVENTS;
98
- }
99
-
100
- /* ═════════════════════════════════════════════════════════════════
101
- * FLUENT API
102
- * ═════════════════════════════════════════════════════════════════ */
103
-
104
- // ✅ Inherited from BaseComponent
105
-
106
- items(value: (ListItem | string)[]): this {
107
- // ✅ Normalize items when setting via fluent API
108
- this.state.items = value.map(item =>
109
- typeof item === 'string' ? { title: item } : item
110
- );
111
- this._updateList();
112
- return this;
113
- }
114
-
115
- addItem(value: ListItem | string): this {
116
- // ✅ Normalize single item
117
- const normalizedItem = typeof value === 'string' ? { title: value } : value;
118
- this.state.items = [...this.state.items, normalizedItem];
119
- this._updateList();
120
- return this;
121
- }
122
-
123
- removeItem(index: number): this {
124
- this.state.items = this.state.items.filter((_, i) => i !== index);
125
- this._updateList();
126
- return this;
127
- }
128
-
129
- updateItem(index: number, updates: Partial<ListItem>): this {
130
- this.state.items = this.state.items.map((item, i) =>
131
- i === index ? { ...item, ...updates } : item
132
- );
133
- this._updateList();
134
- return this;
135
- }
136
-
137
- clearItems(): this {
138
- this.state.items = [];
139
- this._updateList();
140
- return this;
141
- }
142
-
143
- itemClass(className: string): this {
144
- this.state.items = this.state.items.map(item => ({
145
- ...item,
146
- itemClass: className
147
- }));
148
- this._updateList();
149
- return this;
150
- }
151
-
152
- ordered(value: boolean): this {
153
- this.state.ordered = value;
154
- return this;
155
- }
156
-
157
- selectable(value: boolean): this {
158
- this.state.selectable = value;
159
- return this;
160
- }
161
-
162
- multiSelect(value: boolean): this {
163
- this.state.multiSelect = value;
164
- return this;
165
- }
166
-
167
- striped(value: boolean): this {
168
- this.state.striped = value;
169
- return this;
170
- }
171
-
172
- hoverable(value: boolean): this {
173
- this.state.hoverable = value;
174
- return this;
175
- }
176
-
177
- bordered(value: boolean): this {
178
- this.state.bordered = value;
179
- return this;
180
- }
181
-
182
- selectItem(index: number): this {
183
- if (!this.state.selectable) return this;
184
-
185
- if (this.state.multiSelect) {
186
- if (!this.state.selectedIndices.includes(index)) {
187
- this.state.selectedIndices = [...this.state.selectedIndices, index];
188
- }
189
- } else {
190
- this.state.selectedIndex = index;
191
- this.state.selectedIndices = [index];
192
- }
193
-
194
- this._updateSelection();
195
- this._triggerSelectionChange();
196
- return this;
197
- }
198
-
199
- deselectItem(index: number): this {
200
- if (!this.state.selectable) return this;
201
-
202
- if (this.state.multiSelect) {
203
- this.state.selectedIndices = this.state.selectedIndices.filter(i => i !== index);
204
- } else {
205
- this.state.selectedIndex = null;
206
- this.state.selectedIndices = [];
207
- }
208
-
209
- this._updateSelection();
210
- this._triggerSelectionChange();
211
- return this;
212
- }
213
-
214
- clearSelection(): this {
215
- this.state.selectedIndex = null;
216
- this.state.selectedIndices = [];
217
- this._updateSelection();
218
- this._triggerSelectionChange();
219
- return this;
220
- }
221
-
222
- getSelectedItems(): ListItem[] {
223
- return this.state.selectedIndices.map(i => this.state.items[i]).filter(Boolean);
224
- }
225
-
226
- getSelectedIndices(): number[] {
227
- return this.state.selectedIndices;
228
- }
229
-
230
- /* ═════════════════════════════════════════════════════════════════
231
- * PRIVATE HELPERS
232
- * ═════════════════════════════════════════════════════════════════ */
233
-
234
- private _updateList(): void {
235
- if (!this._listElement) return;
236
- this._listElement.innerHTML = '';
237
- this._renderItems(this._listElement);
238
- }
239
-
240
- private _updateSelection(): void {
241
- if (!this._listElement) return;
242
- const items = this._listElement.querySelectorAll('.jux-list-item');
243
- items.forEach((el, index) => {
244
- const isSelected = this.state.selectedIndices.includes(index);
245
- el.classList.toggle('jux-list-item-selected', isSelected);
246
- });
247
- }
248
-
249
- private _triggerSelectionChange(): void {
250
- const selectedItems = this.getSelectedItems();
251
- const selectedIndices = this.getSelectedIndices();
252
-
253
- if (this._onSelectionChange) {
254
- this._onSelectionChange(selectedItems, selectedIndices);
255
- }
256
-
257
- // 🎯 Fire the selectionChange callback event
258
- this._triggerCallback('selectionChange', { items: selectedItems, indices: selectedIndices });
259
- }
260
-
261
- private _renderItems(list: HTMLElement): void {
262
- const { items, selectable, hoverable, striped, bordered } = this.state;
263
-
264
- items.forEach((item, index) => {
265
- const li = document.createElement('li');
266
- li.className = 'jux-list-item';
267
-
268
- if (item.itemClass) li.className += ` ${item.itemClass}`;
269
- if (item.type && item.type !== 'default') li.classList.add(`jux-list-item-${item.type}`);
270
- if (item.disabled) li.classList.add('jux-list-item-disabled');
271
- if (this.state.selectedIndices.includes(index)) li.classList.add('jux-list-item-selected');
272
- if (hoverable && !item.disabled) li.classList.add('jux-list-item-hoverable');
273
- if (striped && index % 2 === 1) li.classList.add('jux-list-item-striped');
274
- if (bordered) li.classList.add('jux-list-item-bordered');
275
-
276
- // Content container
277
- const content = document.createElement('div');
278
- content.className = 'jux-list-item-content';
279
-
280
- // Icon
281
- if (item.icon) {
282
- const iconEl = document.createElement('span');
283
- iconEl.className = 'jux-list-item-icon';
284
- iconEl.appendChild(renderIcon(item.icon));
285
- content.appendChild(iconEl);
286
- }
287
-
288
- // Text content
289
- const textContainer = document.createElement('div');
290
- textContainer.className = 'jux-list-item-text';
291
-
292
- if (item.title) {
293
- const titleEl = document.createElement('div');
294
- titleEl.className = 'jux-list-item-title';
295
- titleEl.textContent = item.title;
296
- textContainer.appendChild(titleEl);
297
- }
298
-
299
- if (item.body) {
300
- const bodyEl = document.createElement('div');
301
- bodyEl.className = 'jux-list-item-body';
302
- bodyEl.textContent = item.body;
303
- textContainer.appendChild(bodyEl);
304
- }
305
-
306
- content.appendChild(textContainer);
307
-
308
- // Metadata
309
- if (item.metadata) {
310
- const metaEl = document.createElement('div');
311
- metaEl.className = 'jux-list-item-metadata';
312
- metaEl.textContent = item.metadata;
313
- content.appendChild(metaEl);
314
- }
315
-
316
- li.appendChild(content);
317
-
318
- // Click handlers
319
- if (!item.disabled) {
320
- li.addEventListener('click', (e) => {
321
- if (selectable) {
322
- if (this.state.selectedIndices.includes(index)) {
323
- this.deselectItem(index);
324
- } else {
325
- if (!this.state.multiSelect) {
326
- this.clearSelection();
327
- }
328
- this.selectItem(index);
329
- }
330
- }
331
-
332
- if (this._onItemClick) {
333
- this._onItemClick(item, index, e);
334
- }
335
-
336
- // 🎯 Fire the itemClick callback event
337
- this._triggerCallback('itemClick', { item, index, event: e });
338
- });
339
-
340
- li.addEventListener('dblclick', (e) => {
341
- if (this._onItemDoubleClick) {
342
- this._onItemDoubleClick(item, index, e);
343
- }
344
-
345
- // 🎯 Fire the itemDoubleClick callback event
346
- this._triggerCallback('itemDoubleClick', { item, index, event: e });
347
- });
348
- }
349
-
350
- list.appendChild(li);
351
- });
352
- }
353
-
354
- /* ═════════════════════════════════════════════════════════════════
355
- * RENDER
356
- * ═════════════════════════════════════════════════════════════════ */
357
-
358
- render(targetId?: string | HTMLElement | BaseComponent<any>): this {
359
- const container = this._setupContainer(targetId);
360
-
361
- const { header, ordered, style, class: className } = this.state;
362
-
363
- const wrapper = document.createElement('div');
364
- wrapper.className = 'jux-list-wrapper';
365
- wrapper.id = `${this._id}-wrapper`;
366
-
367
- // Header
368
- if (header) {
369
- const headerEl = document.createElement('div');
370
- headerEl.className = 'jux-list-header';
371
- headerEl.textContent = header;
372
- wrapper.appendChild(headerEl);
373
- }
374
-
375
- // List
376
- const list = document.createElement(ordered ? 'ol' : 'ul') as HTMLOListElement | HTMLUListElement;
377
- list.className = `jux-list ${ordered ? 'jux-list-ordered' : 'jux-list-unordered'}`;
378
- list.id = this._id;
379
- if (className) list.className += ` ${className}`;
380
- if (style) list.setAttribute('style', style);
381
-
382
- this._listElement = list;
383
- this._renderItems(list);
384
-
385
- wrapper.appendChild(list);
386
-
387
- this._wireStandardEvents(list);
388
-
389
- // Wire sync bindings
390
- this._syncBindings.forEach(({ property, stateObj, toState, toComponent }) => {
391
- if (property === 'items') {
392
- const transform = toComponent || ((v: any) => v);
393
-
394
- stateObj.subscribe((val: any) => {
395
- const transformed = transform(val);
396
- this.state.items = transformed;
397
- this._updateList();
398
- });
399
- }
400
- else if (property === 'selectedIndices') {
401
- const transform = toComponent || ((v: any) => v);
402
-
403
- stateObj.subscribe((val: any) => {
404
- const transformed = transform(val);
405
- this.state.selectedIndices = transformed;
406
- this._updateSelection();
407
- });
408
- }
409
- });
410
-
411
- container.appendChild(wrapper);
412
-
413
- return this;
414
- }
415
-
416
- update(prop: string, value: any): void {
417
- // No reactive updates needed
418
- }
419
- }
420
-
421
- export function list(id: string, options: ListOptions = {}): List {
422
- return new List(id, options);
423
- }
@@ -1,25 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- export interface LoadingOptions {
3
- variant?: 'spinner' | 'dots' | 'pulse';
4
- size?: 'sm' | 'md' | 'lg';
5
- style?: string;
6
- class?: string;
7
- }
8
- type LoadingState = {
9
- variant: string;
10
- size: string;
11
- style: string;
12
- class: string;
13
- };
14
- export declare class Loading extends BaseComponent<LoadingState> {
15
- constructor(id: string, options?: LoadingOptions);
16
- protected getTriggerEvents(): readonly string[];
17
- protected getCallbackEvents(): readonly string[];
18
- update(prop: string, value: any): void;
19
- variant(value: 'spinner' | 'dots' | 'pulse'): this;
20
- size(value: 'sm' | 'md' | 'lg'): this;
21
- render(targetId?: string | HTMLElement | BaseComponent<any>): this;
22
- }
23
- export declare function loading(id: string, options?: LoadingOptions): Loading;
24
- export {};
25
- //# sourceMappingURL=loading.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["loading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAMxD,MAAM,WAAW,cAAc;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IACvC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,YAAY,GAAG;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,OAAQ,SAAQ,aAAa,CAAC,YAAY,CAAC;gBACxC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB;IASpD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAIhD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAatC,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI;IAKlD,IAAI,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;IASrC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;CAkCrE;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAEzE"}
@@ -1,76 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- // Event definitions
3
- const TRIGGER_EVENTS = [];
4
- const CALLBACK_EVENTS = [];
5
- export class Loading extends BaseComponent {
6
- constructor(id, options = {}) {
7
- super(id, {
8
- variant: options.variant ?? 'spinner',
9
- size: options.size ?? 'md',
10
- style: options.style ?? '',
11
- class: options.class ?? ''
12
- });
13
- }
14
- getTriggerEvents() {
15
- return TRIGGER_EVENTS;
16
- }
17
- getCallbackEvents() {
18
- return CALLBACK_EVENTS;
19
- }
20
- update(prop, value) {
21
- // No reactive updates needed
22
- }
23
- /* ═════════════════════════════════════════════════════════════════
24
- * FLUENT API
25
- * ═════════════════════════════════════════════════════════════════ */
26
- // ✅ Inherited from BaseComponent:
27
- // - style(), class()
28
- // - bind(), sync(), renderTo()
29
- // - visible(), show(), hide()
30
- variant(value) {
31
- this.state.variant = value;
32
- return this;
33
- }
34
- size(value) {
35
- this.state.size = value;
36
- return this;
37
- }
38
- /* ═════════════════════════════════════════════════════════════════
39
- * RENDER
40
- * ═════════════════════════════════════════════════════════════════ */
41
- render(targetId) {
42
- const container = this._setupContainer(targetId);
43
- const { variant, size, style, class: className } = this.state;
44
- const loading = document.createElement('div');
45
- loading.className = `jux-loading jux-loading-${variant} jux-loading-${size}`;
46
- loading.id = this._id;
47
- if (className)
48
- loading.className += ` ${className}`;
49
- if (style)
50
- loading.setAttribute('style', style);
51
- // Build variant-specific content
52
- if (variant === 'spinner') {
53
- const spinner = document.createElement('div');
54
- spinner.className = 'jux-loading-spinner';
55
- loading.appendChild(spinner);
56
- }
57
- else if (variant === 'dots') {
58
- for (let i = 0; i < 3; i++) {
59
- const dot = document.createElement('div');
60
- dot.className = 'jux-loading-dot';
61
- loading.appendChild(dot);
62
- }
63
- }
64
- else if (variant === 'pulse') {
65
- const pulse = document.createElement('div');
66
- pulse.className = 'jux-loading-pulse';
67
- loading.appendChild(pulse);
68
- }
69
- this._wireStandardEvents(loading);
70
- container.appendChild(loading);
71
- return this;
72
- }
73
- }
74
- export function loading(id, options = {}) {
75
- return new Loading(id, options);
76
- }
@@ -1,104 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
-
3
- // Event definitions
4
- const TRIGGER_EVENTS = [] as const;
5
- const CALLBACK_EVENTS = [] as const;
6
-
7
- export interface LoadingOptions {
8
- variant?: 'spinner' | 'dots' | 'pulse';
9
- size?: 'sm' | 'md' | 'lg';
10
- style?: string;
11
- class?: string;
12
- }
13
-
14
- type LoadingState = {
15
- variant: string;
16
- size: string;
17
- style: string;
18
- class: string;
19
- };
20
-
21
- export class Loading extends BaseComponent<LoadingState> {
22
- constructor(id: string, options: LoadingOptions = {}) {
23
- super(id, {
24
- variant: options.variant ?? 'spinner',
25
- size: options.size ?? 'md',
26
- style: options.style ?? '',
27
- class: options.class ?? ''
28
- });
29
- }
30
-
31
- protected getTriggerEvents(): readonly string[] {
32
- return TRIGGER_EVENTS;
33
- }
34
-
35
- protected getCallbackEvents(): readonly string[] {
36
- return CALLBACK_EVENTS;
37
- }
38
-
39
- update(prop: string, value: any): void {
40
- // No reactive updates needed
41
- }
42
-
43
- /* ═════════════════════════════════════════════════════════════════
44
- * FLUENT API
45
- * ═════════════════════════════════════════════════════════════════ */
46
-
47
- // ✅ Inherited from BaseComponent:
48
- // - style(), class()
49
- // - bind(), sync(), renderTo()
50
- // - visible(), show(), hide()
51
-
52
- variant(value: 'spinner' | 'dots' | 'pulse'): this {
53
- this.state.variant = value;
54
- return this;
55
- }
56
-
57
- size(value: 'sm' | 'md' | 'lg'): this {
58
- this.state.size = value;
59
- return this;
60
- }
61
-
62
- /* ═════════════════════════════════════════════════════════════════
63
- * RENDER
64
- * ═════════════════════════════════════════════════════════════════ */
65
-
66
- render(targetId?: string | HTMLElement | BaseComponent<any>): this {
67
- const container = this._setupContainer(targetId);
68
-
69
- const { variant, size, style, class: className } = this.state;
70
-
71
- const loading = document.createElement('div');
72
- loading.className = `jux-loading jux-loading-${variant} jux-loading-${size}`;
73
- loading.id = this._id;
74
- if (className) loading.className += ` ${className}`;
75
- if (style) loading.setAttribute('style', style);
76
-
77
- // Build variant-specific content
78
- if (variant === 'spinner') {
79
- const spinner = document.createElement('div');
80
- spinner.className = 'jux-loading-spinner';
81
- loading.appendChild(spinner);
82
- } else if (variant === 'dots') {
83
- for (let i = 0; i < 3; i++) {
84
- const dot = document.createElement('div');
85
- dot.className = 'jux-loading-dot';
86
- loading.appendChild(dot);
87
- }
88
- } else if (variant === 'pulse') {
89
- const pulse = document.createElement('div');
90
- pulse.className = 'jux-loading-pulse';
91
- loading.appendChild(pulse);
92
- }
93
-
94
- this._wireStandardEvents(loading);
95
-
96
- container.appendChild(loading);
97
-
98
- return this;
99
- }
100
- }
101
-
102
- export function loading(id: string, options: LoadingOptions = {}): Loading {
103
- return new Loading(id, options);
104
- }
@@ -1,38 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- export interface MenuItem {
3
- label: string;
4
- href?: string;
5
- click?: () => void;
6
- icon?: string;
7
- items?: MenuItem[];
8
- active?: boolean;
9
- itemClass?: string;
10
- }
11
- export interface MenuOptions {
12
- items?: MenuItem[];
13
- orientation?: 'vertical' | 'horizontal';
14
- style?: string;
15
- class?: string;
16
- }
17
- type MenuState = {
18
- items: MenuItem[];
19
- orientation: string;
20
- style: string;
21
- class: string;
22
- };
23
- export declare class Menu extends BaseComponent<MenuState> {
24
- constructor(id: string, options?: MenuOptions);
25
- protected getTriggerEvents(): readonly string[];
26
- protected getCallbackEvents(): readonly string[];
27
- private _setActiveStates;
28
- items(value: MenuItem[]): this;
29
- addItem(item: MenuItem): this;
30
- itemClass(className: string): this;
31
- orientation(value: 'vertical' | 'horizontal'): this;
32
- update(prop: string, value: any): void;
33
- private _renderMenuItem;
34
- render(targetId?: string | HTMLElement | BaseComponent<any>): this;
35
- }
36
- export declare function menu(id: string, options?: MenuOptions): Menu;
37
- export {};
38
- //# sourceMappingURL=menu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAQxD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,qBAAa,IAAK,SAAQ,aAAa,CAAC,SAAS,CAAC;gBACpC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB;IAWjD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAIhD,OAAO,CAAC,gBAAgB;IAiBxB,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI;IAM9B,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAM7B,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAYlC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI;IAKnD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAQtC,OAAO,CAAC,eAAe;IAmGvB,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;CAqEnE;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,IAAI,CAEhE"}