tyrell-components 1.0.0-TC7

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 (330) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +221 -0
  3. package/css/tyrell.css +1783 -0
  4. package/dist/tyrell.css +1783 -0
  5. package/dist/tyrell.js +2 -0
  6. package/lib/base/ty-component.d.ts +133 -0
  7. package/lib/base/ty-component.d.ts.map +1 -0
  8. package/lib/base/ty-component.js +297 -0
  9. package/lib/base/ty-component.js.map +1 -0
  10. package/lib/components/button.d.ts +126 -0
  11. package/lib/components/button.d.ts.map +1 -0
  12. package/lib/components/button.js +244 -0
  13. package/lib/components/button.js.map +1 -0
  14. package/lib/components/calendar-month.d.ts +132 -0
  15. package/lib/components/calendar-month.d.ts.map +1 -0
  16. package/lib/components/calendar-month.js +440 -0
  17. package/lib/components/calendar-month.js.map +1 -0
  18. package/lib/components/calendar-navigation.d.ts +137 -0
  19. package/lib/components/calendar-navigation.d.ts.map +1 -0
  20. package/lib/components/calendar-navigation.js +366 -0
  21. package/lib/components/calendar-navigation.js.map +1 -0
  22. package/lib/components/calendar.d.ts +166 -0
  23. package/lib/components/calendar.d.ts.map +1 -0
  24. package/lib/components/calendar.js +774 -0
  25. package/lib/components/calendar.js.map +1 -0
  26. package/lib/components/checkbox.d.ts +189 -0
  27. package/lib/components/checkbox.d.ts.map +1 -0
  28. package/lib/components/checkbox.js +400 -0
  29. package/lib/components/checkbox.js.map +1 -0
  30. package/lib/components/copy.d.ts +180 -0
  31. package/lib/components/copy.d.ts.map +1 -0
  32. package/lib/components/copy.js +393 -0
  33. package/lib/components/copy.js.map +1 -0
  34. package/lib/components/date-picker.d.ts +379 -0
  35. package/lib/components/date-picker.d.ts.map +1 -0
  36. package/lib/components/date-picker.js +1586 -0
  37. package/lib/components/date-picker.js.map +1 -0
  38. package/lib/components/dropdown.d.ts +402 -0
  39. package/lib/components/dropdown.d.ts.map +1 -0
  40. package/lib/components/dropdown.js +1564 -0
  41. package/lib/components/dropdown.js.map +1 -0
  42. package/lib/components/icon.d.ts +107 -0
  43. package/lib/components/icon.d.ts.map +1 -0
  44. package/lib/components/icon.js +230 -0
  45. package/lib/components/icon.js.map +1 -0
  46. package/lib/components/input.d.ts +270 -0
  47. package/lib/components/input.d.ts.map +1 -0
  48. package/lib/components/input.js +721 -0
  49. package/lib/components/input.js.map +1 -0
  50. package/lib/components/modal.d.ts +58 -0
  51. package/lib/components/modal.d.ts.map +1 -0
  52. package/lib/components/modal.js +473 -0
  53. package/lib/components/modal.js.map +1 -0
  54. package/lib/components/multiselect.d.ts +397 -0
  55. package/lib/components/multiselect.d.ts.map +1 -0
  56. package/lib/components/multiselect.js +1580 -0
  57. package/lib/components/multiselect.js.map +1 -0
  58. package/lib/components/option.d.ts +66 -0
  59. package/lib/components/option.d.ts.map +1 -0
  60. package/lib/components/option.js +314 -0
  61. package/lib/components/option.js.map +1 -0
  62. package/lib/components/popup.d.ts +43 -0
  63. package/lib/components/popup.d.ts.map +1 -0
  64. package/lib/components/popup.js +380 -0
  65. package/lib/components/popup.js.map +1 -0
  66. package/lib/components/radio.d.ts +198 -0
  67. package/lib/components/radio.d.ts.map +1 -0
  68. package/lib/components/radio.js +437 -0
  69. package/lib/components/radio.js.map +1 -0
  70. package/lib/components/resize-observer.d.ts +48 -0
  71. package/lib/components/resize-observer.d.ts.map +1 -0
  72. package/lib/components/resize-observer.js +108 -0
  73. package/lib/components/resize-observer.js.map +1 -0
  74. package/lib/components/scroll-container.d.ts +51 -0
  75. package/lib/components/scroll-container.d.ts.map +1 -0
  76. package/lib/components/scroll-container.js +239 -0
  77. package/lib/components/scroll-container.js.map +1 -0
  78. package/lib/components/step.d.ts +26 -0
  79. package/lib/components/step.d.ts.map +1 -0
  80. package/lib/components/step.js +75 -0
  81. package/lib/components/step.js.map +1 -0
  82. package/lib/components/switch.d.ts +111 -0
  83. package/lib/components/switch.d.ts.map +1 -0
  84. package/lib/components/switch.js +240 -0
  85. package/lib/components/switch.js.map +1 -0
  86. package/lib/components/tab.d.ts +23 -0
  87. package/lib/components/tab.d.ts.map +1 -0
  88. package/lib/components/tab.js +76 -0
  89. package/lib/components/tab.js.map +1 -0
  90. package/lib/components/tabs.d.ts +93 -0
  91. package/lib/components/tabs.d.ts.map +1 -0
  92. package/lib/components/tabs.js +653 -0
  93. package/lib/components/tabs.js.map +1 -0
  94. package/lib/components/tag.d.ts +144 -0
  95. package/lib/components/tag.d.ts.map +1 -0
  96. package/lib/components/tag.js +314 -0
  97. package/lib/components/tag.js.map +1 -0
  98. package/lib/components/textarea.d.ts +241 -0
  99. package/lib/components/textarea.d.ts.map +1 -0
  100. package/lib/components/textarea.js +585 -0
  101. package/lib/components/textarea.js.map +1 -0
  102. package/lib/components/tooltip.d.ts +40 -0
  103. package/lib/components/tooltip.d.ts.map +1 -0
  104. package/lib/components/tooltip.js +439 -0
  105. package/lib/components/tooltip.js.map +1 -0
  106. package/lib/components/wizard.d.ts +86 -0
  107. package/lib/components/wizard.d.ts.map +1 -0
  108. package/lib/components/wizard.js +636 -0
  109. package/lib/components/wizard.js.map +1 -0
  110. package/lib/icons/fontawesome/brands.d.ts +557 -0
  111. package/lib/icons/fontawesome/brands.d.ts.map +1 -0
  112. package/lib/icons/fontawesome/brands.js +557 -0
  113. package/lib/icons/fontawesome/brands.js.map +1 -0
  114. package/lib/icons/fontawesome/regular.d.ts +281 -0
  115. package/lib/icons/fontawesome/regular.d.ts.map +1 -0
  116. package/lib/icons/fontawesome/regular.js +281 -0
  117. package/lib/icons/fontawesome/regular.js.map +1 -0
  118. package/lib/icons/fontawesome/solid.d.ts +1992 -0
  119. package/lib/icons/fontawesome/solid.d.ts.map +1 -0
  120. package/lib/icons/fontawesome/solid.js +1992 -0
  121. package/lib/icons/fontawesome/solid.js.map +1 -0
  122. package/lib/icons/heroicons/micro.d.ts +324 -0
  123. package/lib/icons/heroicons/micro.d.ts.map +1 -0
  124. package/lib/icons/heroicons/micro.js +1032 -0
  125. package/lib/icons/heroicons/micro.js.map +1 -0
  126. package/lib/icons/heroicons/mini.d.ts +332 -0
  127. package/lib/icons/heroicons/mini.d.ts.map +1 -0
  128. package/lib/icons/heroicons/mini.js +1038 -0
  129. package/lib/icons/heroicons/mini.js.map +1 -0
  130. package/lib/icons/heroicons/outline.d.ts +332 -0
  131. package/lib/icons/heroicons/outline.d.ts.map +1 -0
  132. package/lib/icons/heroicons/outline.js +993 -0
  133. package/lib/icons/heroicons/outline.js.map +1 -0
  134. package/lib/icons/heroicons/solid.d.ts +332 -0
  135. package/lib/icons/heroicons/solid.d.ts.map +1 -0
  136. package/lib/icons/heroicons/solid.js +1063 -0
  137. package/lib/icons/heroicons/solid.js.map +1 -0
  138. package/lib/icons/lucide.d.ts +1872 -0
  139. package/lib/icons/lucide.d.ts.map +1 -0
  140. package/lib/icons/lucide.js +28212 -0
  141. package/lib/icons/lucide.js.map +1 -0
  142. package/lib/icons/material/filled.d.ts +2180 -0
  143. package/lib/icons/material/filled.d.ts.map +1 -0
  144. package/lib/icons/material/filled.js +14003 -0
  145. package/lib/icons/material/filled.js.map +1 -0
  146. package/lib/icons/material/outlined.d.ts +2142 -0
  147. package/lib/icons/material/outlined.d.ts.map +1 -0
  148. package/lib/icons/material/outlined.js +14545 -0
  149. package/lib/icons/material/outlined.js.map +1 -0
  150. package/lib/icons/material/round.d.ts +2147 -0
  151. package/lib/icons/material/round.d.ts.map +1 -0
  152. package/lib/icons/material/round.js +14779 -0
  153. package/lib/icons/material/round.js.map +1 -0
  154. package/lib/icons/material/sharp.d.ts +2147 -0
  155. package/lib/icons/material/sharp.d.ts.map +1 -0
  156. package/lib/icons/material/sharp.js +14189 -0
  157. package/lib/icons/material/sharp.js.map +1 -0
  158. package/lib/icons/material/two-tone.d.ts +2185 -0
  159. package/lib/icons/material/two-tone.d.ts.map +1 -0
  160. package/lib/icons/material/two-tone.js +17152 -0
  161. package/lib/icons/material/two-tone.js.map +1 -0
  162. package/lib/index.d.ts +78 -0
  163. package/lib/index.d.ts.map +1 -0
  164. package/lib/index.js +71 -0
  165. package/lib/index.js.map +1 -0
  166. package/lib/styles/button.d.ts +14 -0
  167. package/lib/styles/button.d.ts.map +1 -0
  168. package/lib/styles/button.js +457 -0
  169. package/lib/styles/button.js.map +1 -0
  170. package/lib/styles/calendar-month.d.ts +6 -0
  171. package/lib/styles/calendar-month.d.ts.map +1 -0
  172. package/lib/styles/calendar-month.js +229 -0
  173. package/lib/styles/calendar-month.js.map +1 -0
  174. package/lib/styles/calendar-navigation.d.ts +6 -0
  175. package/lib/styles/calendar-navigation.d.ts.map +1 -0
  176. package/lib/styles/calendar-navigation.js +125 -0
  177. package/lib/styles/calendar-navigation.js.map +1 -0
  178. package/lib/styles/calendar.d.ts +6 -0
  179. package/lib/styles/calendar.d.ts.map +1 -0
  180. package/lib/styles/calendar.js +28 -0
  181. package/lib/styles/calendar.js.map +1 -0
  182. package/lib/styles/checkbox.d.ts +9 -0
  183. package/lib/styles/checkbox.d.ts.map +1 -0
  184. package/lib/styles/checkbox.js +19 -0
  185. package/lib/styles/checkbox.js.map +1 -0
  186. package/lib/styles/copy.d.ts +7 -0
  187. package/lib/styles/copy.d.ts.map +1 -0
  188. package/lib/styles/copy.js +94 -0
  189. package/lib/styles/copy.js.map +1 -0
  190. package/lib/styles/custom-scrollbar.d.ts +6 -0
  191. package/lib/styles/custom-scrollbar.d.ts.map +1 -0
  192. package/lib/styles/custom-scrollbar.js +157 -0
  193. package/lib/styles/custom-scrollbar.js.map +1 -0
  194. package/lib/styles/date-picker.d.ts +6 -0
  195. package/lib/styles/date-picker.d.ts.map +1 -0
  196. package/lib/styles/date-picker.js +400 -0
  197. package/lib/styles/date-picker.js.map +1 -0
  198. package/lib/styles/dropdown.d.ts +12 -0
  199. package/lib/styles/dropdown.d.ts.map +1 -0
  200. package/lib/styles/dropdown.js +983 -0
  201. package/lib/styles/dropdown.js.map +1 -0
  202. package/lib/styles/icon.d.ts +6 -0
  203. package/lib/styles/icon.d.ts.map +1 -0
  204. package/lib/styles/icon.js +231 -0
  205. package/lib/styles/icon.js.map +1 -0
  206. package/lib/styles/input.d.ts +7 -0
  207. package/lib/styles/input.d.ts.map +1 -0
  208. package/lib/styles/input.js +685 -0
  209. package/lib/styles/input.js.map +1 -0
  210. package/lib/styles/modal.d.ts +8 -0
  211. package/lib/styles/modal.d.ts.map +1 -0
  212. package/lib/styles/modal.js +134 -0
  213. package/lib/styles/modal.js.map +1 -0
  214. package/lib/styles/multiselect.d.ts +6 -0
  215. package/lib/styles/multiselect.d.ts.map +1 -0
  216. package/lib/styles/multiselect.js +774 -0
  217. package/lib/styles/multiselect.js.map +1 -0
  218. package/lib/styles/option.d.ts +6 -0
  219. package/lib/styles/option.d.ts.map +1 -0
  220. package/lib/styles/option.js +116 -0
  221. package/lib/styles/option.js.map +1 -0
  222. package/lib/styles/popup.d.ts +8 -0
  223. package/lib/styles/popup.d.ts.map +1 -0
  224. package/lib/styles/popup.js +95 -0
  225. package/lib/styles/popup.js.map +1 -0
  226. package/lib/styles/radio.d.ts +8 -0
  227. package/lib/styles/radio.d.ts.map +1 -0
  228. package/lib/styles/radio.js +160 -0
  229. package/lib/styles/radio.js.map +1 -0
  230. package/lib/styles/resize-observer.d.ts +6 -0
  231. package/lib/styles/resize-observer.d.ts.map +1 -0
  232. package/lib/styles/resize-observer.js +18 -0
  233. package/lib/styles/resize-observer.js.map +1 -0
  234. package/lib/styles/scroll-container.d.ts +6 -0
  235. package/lib/styles/scroll-container.d.ts.map +1 -0
  236. package/lib/styles/scroll-container.js +198 -0
  237. package/lib/styles/scroll-container.js.map +1 -0
  238. package/lib/styles/step.d.ts +5 -0
  239. package/lib/styles/step.d.ts.map +1 -0
  240. package/lib/styles/step.js +50 -0
  241. package/lib/styles/step.js.map +1 -0
  242. package/lib/styles/switch.d.ts +9 -0
  243. package/lib/styles/switch.d.ts.map +1 -0
  244. package/lib/styles/switch.js +100 -0
  245. package/lib/styles/switch.js.map +1 -0
  246. package/lib/styles/tab.d.ts +5 -0
  247. package/lib/styles/tab.d.ts.map +1 -0
  248. package/lib/styles/tab.js +51 -0
  249. package/lib/styles/tab.js.map +1 -0
  250. package/lib/styles/tabs.d.ts +13 -0
  251. package/lib/styles/tabs.d.ts.map +1 -0
  252. package/lib/styles/tabs.js +184 -0
  253. package/lib/styles/tabs.js.map +1 -0
  254. package/lib/styles/tag.d.ts +6 -0
  255. package/lib/styles/tag.d.ts.map +1 -0
  256. package/lib/styles/tag.js +415 -0
  257. package/lib/styles/tag.js.map +1 -0
  258. package/lib/styles/textarea.d.ts +6 -0
  259. package/lib/styles/textarea.d.ts.map +1 -0
  260. package/lib/styles/textarea.js +350 -0
  261. package/lib/styles/textarea.js.map +1 -0
  262. package/lib/styles/tooltip.d.ts +9 -0
  263. package/lib/styles/tooltip.d.ts.map +1 -0
  264. package/lib/styles/tooltip.js +136 -0
  265. package/lib/styles/tooltip.js.map +1 -0
  266. package/lib/styles/wizard.d.ts +25 -0
  267. package/lib/styles/wizard.d.ts.map +1 -0
  268. package/lib/styles/wizard.js +325 -0
  269. package/lib/styles/wizard.js.map +1 -0
  270. package/lib/types/common.d.ts +143 -0
  271. package/lib/types/common.d.ts.map +1 -0
  272. package/lib/types/common.js +5 -0
  273. package/lib/types/common.js.map +1 -0
  274. package/lib/utils/calendar-utils.d.ts +176 -0
  275. package/lib/utils/calendar-utils.d.ts.map +1 -0
  276. package/lib/utils/calendar-utils.js +370 -0
  277. package/lib/utils/calendar-utils.js.map +1 -0
  278. package/lib/utils/custom-scrollbar.d.ts +82 -0
  279. package/lib/utils/custom-scrollbar.d.ts.map +1 -0
  280. package/lib/utils/custom-scrollbar.js +320 -0
  281. package/lib/utils/custom-scrollbar.js.map +1 -0
  282. package/lib/utils/icon-registry.d.ts +78 -0
  283. package/lib/utils/icon-registry.d.ts.map +1 -0
  284. package/lib/utils/icon-registry.js +304 -0
  285. package/lib/utils/icon-registry.js.map +1 -0
  286. package/lib/utils/locale.d.ts +136 -0
  287. package/lib/utils/locale.d.ts.map +1 -0
  288. package/lib/utils/locale.js +213 -0
  289. package/lib/utils/locale.js.map +1 -0
  290. package/lib/utils/mobile.d.ts +14 -0
  291. package/lib/utils/mobile.d.ts.map +1 -0
  292. package/lib/utils/mobile.js +21 -0
  293. package/lib/utils/mobile.js.map +1 -0
  294. package/lib/utils/number-format.d.ts +83 -0
  295. package/lib/utils/number-format.d.ts.map +1 -0
  296. package/lib/utils/number-format.js +143 -0
  297. package/lib/utils/number-format.js.map +1 -0
  298. package/lib/utils/parse-boolean.d.ts +39 -0
  299. package/lib/utils/parse-boolean.d.ts.map +1 -0
  300. package/lib/utils/parse-boolean.js +58 -0
  301. package/lib/utils/parse-boolean.js.map +1 -0
  302. package/lib/utils/positioning.d.ts +143 -0
  303. package/lib/utils/positioning.d.ts.map +1 -0
  304. package/lib/utils/positioning.js +308 -0
  305. package/lib/utils/positioning.js.map +1 -0
  306. package/lib/utils/property-capture.d.ts +132 -0
  307. package/lib/utils/property-capture.d.ts.map +1 -0
  308. package/lib/utils/property-capture.js +152 -0
  309. package/lib/utils/property-capture.js.map +1 -0
  310. package/lib/utils/property-manager.d.ts +90 -0
  311. package/lib/utils/property-manager.d.ts.map +1 -0
  312. package/lib/utils/property-manager.js +197 -0
  313. package/lib/utils/property-manager.js.map +1 -0
  314. package/lib/utils/resize-observer.d.ts +42 -0
  315. package/lib/utils/resize-observer.d.ts.map +1 -0
  316. package/lib/utils/resize-observer.js +71 -0
  317. package/lib/utils/resize-observer.js.map +1 -0
  318. package/lib/utils/scroll-lock.d.ts +79 -0
  319. package/lib/utils/scroll-lock.d.ts.map +1 -0
  320. package/lib/utils/scroll-lock.js +197 -0
  321. package/lib/utils/scroll-lock.js.map +1 -0
  322. package/lib/utils/styles.d.ts +27 -0
  323. package/lib/utils/styles.d.ts.map +1 -0
  324. package/lib/utils/styles.js +53 -0
  325. package/lib/utils/styles.js.map +1 -0
  326. package/lib/version.d.ts +8 -0
  327. package/lib/version.d.ts.map +1 -0
  328. package/lib/version.js +11 -0
  329. package/lib/version.js.map +1 -0
  330. package/package.json +159 -0
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Property Manager - Unified property lifecycle for web components
3
+ *
4
+ * Handles property/attribute synchronization, validation, coercion, and change tracking.
5
+ * All property updates flow through a single code path for consistency.
6
+ */
7
+ /**
8
+ * Configuration for a single property
9
+ */
10
+ export interface PropertyConfig {
11
+ type: 'string' | 'boolean' | 'number' | 'object' | 'array';
12
+ visual?: boolean;
13
+ formValue?: boolean;
14
+ emitChange?: boolean;
15
+ default?: any;
16
+ validate?: (value: any) => boolean;
17
+ coerce?: (value: any) => any;
18
+ aliases?: Record<string, any>;
19
+ }
20
+ /**
21
+ * Represents a property change
22
+ */
23
+ export interface PropertyChange {
24
+ name: string;
25
+ oldValue: any;
26
+ newValue: any;
27
+ source: 'attribute' | 'property' | 'internal';
28
+ }
29
+ /**
30
+ * Manages component properties with unified lifecycle
31
+ */
32
+ export declare class PropertyManager<T = any> {
33
+ private _props;
34
+ private _config;
35
+ constructor(config: Record<string, PropertyConfig>);
36
+ /**
37
+ * Initialize properties with default values
38
+ */
39
+ private _initializeDefaults;
40
+ /**
41
+ * Check if a property name exists in the configuration
42
+ */
43
+ hasConfig(name: string): boolean;
44
+ /**
45
+ * Update a property value
46
+ * Returns PropertyChange if value changed, null otherwise
47
+ */
48
+ updateProperty(name: string, value: any, source?: 'attribute' | 'property' | 'internal'): PropertyChange | null;
49
+ /**
50
+ * Coerce value to the correct type
51
+ */
52
+ private _coerceValue;
53
+ /**
54
+ * Validate a property value
55
+ */
56
+ private _validateValue;
57
+ /**
58
+ * Check if two values are equal
59
+ */
60
+ private _valuesEqual;
61
+ /**
62
+ * Get a property value
63
+ */
64
+ get(name: string): any;
65
+ /**
66
+ * Get all properties as an object
67
+ */
68
+ getAll(): Record<string, any>;
69
+ /**
70
+ * Get property configuration
71
+ */
72
+ getConfig(name: string): PropertyConfig | undefined;
73
+ /**
74
+ * Check if a property is visual (requires render)
75
+ */
76
+ isVisual(name: string): boolean;
77
+ /**
78
+ * Check if a property affects form value
79
+ */
80
+ isFormValue(name: string): boolean;
81
+ /**
82
+ * Check if a property should emit change events
83
+ */
84
+ shouldEmitChange(name: string): boolean;
85
+ /**
86
+ * Handle property aliases (e.g., not-searchable → searchable: false)
87
+ */
88
+ handleAlias(aliasName: string, value: any): PropertyChange | null;
89
+ }
90
+ //# sourceMappingURL=property-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-manager.d.ts","sourceRoot":"","sources":["../../src/utils/property-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAE7B,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;IAG1D,MAAM,CAAC,EAAE,OAAO,CAAA;IAGhB,SAAS,CAAC,EAAE,OAAO,CAAA;IAGnB,UAAU,CAAC,EAAE,OAAO,CAAA;IAGpB,OAAO,CAAC,EAAE,GAAG,CAAA;IAGb,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAA;IAGlC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAA;IAG5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,GAAG,CAAA;IACb,QAAQ,EAAE,GAAG,CAAA;IACb,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAAA;CAC9C;AAED;;GAEG;AACH,qBAAa,eAAe,CAAC,CAAC,GAAG,GAAG;IAClC,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,OAAO,CAAgC;gBAEnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC;IAKlD;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAQ3B;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIhC;;;OAGG;IACH,cAAc,CACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,GAAG,EACV,MAAM,GAAE,WAAW,GAAG,UAAU,GAAG,UAAuB,GACzD,cAAc,GAAG,IAAI;IAsCxB;;OAEG;IACH,OAAO,CAAC,YAAY;IAoDpB;;OAEG;IACH,OAAO,CAAC,cAAc;IAOtB;;OAEG;IACH,OAAO,CAAC,YAAY;IAoBpB;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG;IAItB;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAI7B;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAInD;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI/B;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIlC;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIvC;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,cAAc,GAAG,IAAI;CAUlE"}
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Property Manager - Unified property lifecycle for web components
3
+ *
4
+ * Handles property/attribute synchronization, validation, coercion, and change tracking.
5
+ * All property updates flow through a single code path for consistency.
6
+ */
7
+ /**
8
+ * Manages component properties with unified lifecycle
9
+ */
10
+ export class PropertyManager {
11
+ constructor(config) {
12
+ this._props = new Map();
13
+ this._config = config;
14
+ this._initializeDefaults();
15
+ }
16
+ /**
17
+ * Initialize properties with default values
18
+ */
19
+ _initializeDefaults() {
20
+ for (const [name, config] of Object.entries(this._config)) {
21
+ if (config.default !== undefined) {
22
+ this._props.set(name, config.default);
23
+ }
24
+ }
25
+ }
26
+ /**
27
+ * Check if a property name exists in the configuration
28
+ */
29
+ hasConfig(name) {
30
+ return name in this._config;
31
+ }
32
+ /**
33
+ * Update a property value
34
+ * Returns PropertyChange if value changed, null otherwise
35
+ */
36
+ updateProperty(name, value, source = 'property') {
37
+ const config = this._config[name];
38
+ if (!config) {
39
+ console.warn(`[PropertyManager] Unknown property: ${name}`);
40
+ return null;
41
+ }
42
+ // Get old value
43
+ const oldValue = this._props.get(name);
44
+ // Coerce value to correct type
45
+ const coercedValue = this._coerceValue(name, value, config);
46
+ // Validate value
47
+ if (!this._validateValue(name, coercedValue, config)) {
48
+ console.warn(`[PropertyManager] Invalid value for ${name}:`, coercedValue);
49
+ return null;
50
+ }
51
+ // Check if value actually changed
52
+ if (this._valuesEqual(oldValue, coercedValue)) {
53
+ return null;
54
+ }
55
+ // Update internal map
56
+ this._props.set(name, coercedValue);
57
+ // Create change object
58
+ const change = {
59
+ name,
60
+ oldValue,
61
+ newValue: coercedValue,
62
+ source
63
+ };
64
+ return change;
65
+ }
66
+ /**
67
+ * Coerce value to the correct type
68
+ */
69
+ _coerceValue(name, value, config) {
70
+ // Custom coercion
71
+ if (config.coerce) {
72
+ return config.coerce(value);
73
+ }
74
+ // Null/undefined handling
75
+ if (value === null || value === undefined) {
76
+ return config.default ?? null;
77
+ }
78
+ // Type coercion
79
+ switch (config.type) {
80
+ case 'boolean':
81
+ // HTML Standard: attribute present (even empty) = true, absent = false
82
+ // String handling:
83
+ if (typeof value === 'string') {
84
+ // Empty string = true (HTML boolean attribute: <input checked>)
85
+ if (value === '')
86
+ return true;
87
+ // Explicit false values
88
+ const normalized = value.toLowerCase().trim();
89
+ if (normalized === 'false' || normalized === '0')
90
+ return false;
91
+ // Everything else is truthy
92
+ return true;
93
+ }
94
+ // Non-string: standard truthy/falsy
95
+ return Boolean(value);
96
+ case 'number':
97
+ const num = Number(value);
98
+ return isNaN(num) ? (config.default ?? 0) : num;
99
+ case 'string':
100
+ return String(value);
101
+ case 'object':
102
+ case 'array':
103
+ if (typeof value === 'string') {
104
+ try {
105
+ return JSON.parse(value);
106
+ }
107
+ catch {
108
+ console.warn(`[PropertyManager] Failed to parse ${name}:`, value);
109
+ return config.default ?? (config.type === 'array' ? [] : {});
110
+ }
111
+ }
112
+ return value;
113
+ default:
114
+ return value;
115
+ }
116
+ }
117
+ /**
118
+ * Validate a property value
119
+ */
120
+ _validateValue(name, value, config) {
121
+ if (config.validate) {
122
+ return config.validate(value);
123
+ }
124
+ return true;
125
+ }
126
+ /**
127
+ * Check if two values are equal
128
+ */
129
+ _valuesEqual(a, b) {
130
+ // Simple equality for primitives
131
+ if (typeof a !== 'object' || typeof b !== 'object') {
132
+ return a === b;
133
+ }
134
+ // Null checks
135
+ if (a === null || b === null) {
136
+ return a === b;
137
+ }
138
+ // Deep equality for objects/arrays (simple implementation)
139
+ // For production, consider using a proper deep equality library
140
+ try {
141
+ return JSON.stringify(a) === JSON.stringify(b);
142
+ }
143
+ catch {
144
+ return false;
145
+ }
146
+ }
147
+ /**
148
+ * Get a property value
149
+ */
150
+ get(name) {
151
+ return this._props.get(name);
152
+ }
153
+ /**
154
+ * Get all properties as an object
155
+ */
156
+ getAll() {
157
+ return Object.fromEntries(this._props);
158
+ }
159
+ /**
160
+ * Get property configuration
161
+ */
162
+ getConfig(name) {
163
+ return this._config[name];
164
+ }
165
+ /**
166
+ * Check if a property is visual (requires render)
167
+ */
168
+ isVisual(name) {
169
+ return this._config[name]?.visual ?? false;
170
+ }
171
+ /**
172
+ * Check if a property affects form value
173
+ */
174
+ isFormValue(name) {
175
+ return this._config[name]?.formValue ?? false;
176
+ }
177
+ /**
178
+ * Check if a property should emit change events
179
+ */
180
+ shouldEmitChange(name) {
181
+ return this._config[name]?.emitChange ?? false;
182
+ }
183
+ /**
184
+ * Handle property aliases (e.g., not-searchable → searchable: false)
185
+ */
186
+ handleAlias(aliasName, value) {
187
+ // Find property with this alias
188
+ for (const [propName, config] of Object.entries(this._config)) {
189
+ if (config.aliases && aliasName in config.aliases) {
190
+ const aliasedValue = config.aliases[aliasName];
191
+ return this.updateProperty(propName, aliasedValue, 'attribute');
192
+ }
193
+ }
194
+ return null;
195
+ }
196
+ }
197
+ //# sourceMappingURL=property-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-manager.js","sourceRoot":"","sources":["../../src/utils/property-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyCH;;GAEG;AACH,MAAM,OAAO,eAAe;IAI1B,YAAY,MAAsC;QAH1C,WAAM,GAAG,IAAI,GAAG,EAAe,CAAA;QAIrC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,IAAI,CAAC,mBAAmB,EAAE,CAAA;IAC5B,CAAC;IAED;;OAEG;IACK,mBAAmB;QACzB,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1D,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;gBACjC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;YACvC,CAAC;QACH,CAAC;IACH,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,IAAY;QACpB,OAAO,IAAI,IAAI,IAAI,CAAC,OAAO,CAAA;IAC7B,CAAC;IAED;;;OAGG;IACH,cAAc,CACZ,IAAY,EACZ,KAAU,EACV,SAAgD,UAAU;QAE1D,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACjC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,CAAC,uCAAuC,IAAI,EAAE,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;QACb,CAAC;QAED,gBAAgB;QAChB,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,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AC,IAAI,CAAC,EAAE,UAAU,IAAI,KAAK,CAAA;IAChD,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,SAAiB,EAAE,KAAU;QACvC,gCAAgC;QAChC,KAAK,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9D,IAAI,MAAM,CAAC,OAAO,IAAI,SAAS,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClD,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;gBAC9C,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,YAAY,EAAE,WAAW,CAAC,CAAA;YACjE,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Resize Observer Registry & Callbacks
3
+ *
4
+ * Provides global registry for element sizes and optional callback subscriptions.
5
+ */
6
+ export interface ElementSize {
7
+ width: number;
8
+ height: number;
9
+ }
10
+ export type ResizeCallback = (size: ElementSize) => void;
11
+ /**
12
+ * Get current size for element by ID (sync query)
13
+ *
14
+ * @example
15
+ * const size = getSize('parent-container')
16
+ * if (size) console.log(`Width: ${size.width}px`)
17
+ */
18
+ export declare function getSize(id: string): ElementSize | undefined;
19
+ /**
20
+ * Subscribe to size changes for element by ID
21
+ * Returns unsubscribe function
22
+ *
23
+ * @example
24
+ * const unsubscribe = onResize('parent', ({ width, height }) => {
25
+ * console.log(`Resized to ${width}x${height}`)
26
+ * })
27
+ * // Later: unsubscribe()
28
+ */
29
+ export declare function onResize(id: string, callback: ResizeCallback): () => void;
30
+ /**
31
+ * Get all registered sizes (for debugging/window API)
32
+ */
33
+ export declare function getAllSizes(): Record<string, ElementSize>;
34
+ /**
35
+ * Internal: Update size in registry and notify callbacks
36
+ */
37
+ export declare function updateSize(id: string, width: number, height: number): void;
38
+ /**
39
+ * Internal: Remove size from registry and cleanup callbacks
40
+ */
41
+ export declare function removeSize(id: string): void;
42
+ //# sourceMappingURL=resize-observer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-observer.d.ts","sourceRoot":"","sources":["../../src/utils/resize-observer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAA;AAMxD;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAE3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI,CAiBzE;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAEzD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAS1E;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAG3C"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Resize Observer Registry & Callbacks
3
+ *
4
+ * Provides global registry for element sizes and optional callback subscriptions.
5
+ */
6
+ // Global registry (Map-based storage)
7
+ const sizes = new Map();
8
+ const callbacks = new Map();
9
+ /**
10
+ * Get current size for element by ID (sync query)
11
+ *
12
+ * @example
13
+ * const size = getSize('parent-container')
14
+ * if (size) console.log(`Width: ${size.width}px`)
15
+ */
16
+ export function getSize(id) {
17
+ return sizes.get(id);
18
+ }
19
+ /**
20
+ * Subscribe to size changes for element by ID
21
+ * Returns unsubscribe function
22
+ *
23
+ * @example
24
+ * const unsubscribe = onResize('parent', ({ width, height }) => {
25
+ * console.log(`Resized to ${width}x${height}`)
26
+ * })
27
+ * // Later: unsubscribe()
28
+ */
29
+ export function onResize(id, callback) {
30
+ if (!callbacks.has(id)) {
31
+ callbacks.set(id, new Set());
32
+ }
33
+ callbacks.get(id).add(callback);
34
+ // Call immediately with current size if available
35
+ const current = sizes.get(id);
36
+ if (current)
37
+ callback(current);
38
+ // Return unsubscribe function
39
+ return () => {
40
+ callbacks.get(id)?.delete(callback);
41
+ if (callbacks.get(id)?.size === 0) {
42
+ callbacks.delete(id);
43
+ }
44
+ };
45
+ }
46
+ /**
47
+ * Get all registered sizes (for debugging/window API)
48
+ */
49
+ export function getAllSizes() {
50
+ return Object.fromEntries(sizes);
51
+ }
52
+ /**
53
+ * Internal: Update size in registry and notify callbacks
54
+ */
55
+ export function updateSize(id, width, height) {
56
+ sizes.set(id, { width, height });
57
+ // Notify all subscribers
58
+ const cbs = callbacks.get(id);
59
+ if (cbs) {
60
+ const size = { width, height };
61
+ cbs.forEach(cb => cb(size));
62
+ }
63
+ }
64
+ /**
65
+ * Internal: Remove size from registry and cleanup callbacks
66
+ */
67
+ export function removeSize(id) {
68
+ sizes.delete(id);
69
+ callbacks.delete(id);
70
+ }
71
+ //# sourceMappingURL=resize-observer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-observer.js","sourceRoot":"","sources":["../../src/utils/resize-observer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,sCAAsC;AACtC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAuB,CAAA;AAC5C,MAAM,SAAS,GAAG,IAAI,GAAG,EAA+B,CAAA;AAExD;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,EAAU;IAChC,OAAO,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AACtB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAU,EAAE,QAAwB;IAC3D,IAAI,CAA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U;IACnC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAChB,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AACtB,CAAC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * CSS-based scroll prevention using position: fixed.
3
+ *
4
+ * Prevents body/page scrolling by temporarily fixing the body position
5
+ * while preserving scroll position. Much more reliable than event prevention.
6
+ *
7
+ * Key benefits:
8
+ * - No event manipulation complexity
9
+ * - No interference with component keyboard navigation
10
+ * - Preserves scroll position perfectly
11
+ * - Standard industry technique
12
+ * - Multiple component support with proper cleanup
13
+ */
14
+ declare global {
15
+ interface Window {
16
+ tyScrollDebug?: boolean;
17
+ }
18
+ }
19
+ /**
20
+ * Lock scrolling for a specific component.
21
+ *
22
+ * Multiple components can lock scrolling simultaneously.
23
+ * Scroll remains locked until ALL components unlock.
24
+ *
25
+ * @param componentId - Unique identifier for the component
26
+ */
27
+ export declare function lockScroll(componentId: string): void;
28
+ /**
29
+ * Unlock scrolling for a specific component.
30
+ *
31
+ * Scroll remains locked if other components still have locks active.
32
+ *
33
+ * @param componentId - Unique identifier for the component
34
+ */
35
+ export declare function unlockScroll(componentId: string): void;
36
+ /**
37
+ * Emergency unlock - removes all scroll locks immediately.
38
+ *
39
+ * Use this for cleanup or error recovery scenarios.
40
+ */
41
+ export declare function forceUnlockAll(): void;
42
+ /**
43
+ * Enable scroll lock debugging - useful for testing and development
44
+ */
45
+ export declare function enableDebug(): void;
46
+ /**
47
+ * Disable scroll lock debugging
48
+ */
49
+ export declare function disableDebug(): void;
50
+ /**
51
+ * Get the set of currently active component locks.
52
+ *
53
+ * @returns Set of component IDs that currently have scroll locked
54
+ */
55
+ export declare function getActiveLocks(): Set<string>;
56
+ /**
57
+ * Check if scrolling is currently locked.
58
+ *
59
+ * @returns true if any component has scroll locked
60
+ */
61
+ export declare function isLocked(): boolean;
62
+ /**
63
+ * Check if scrolling is locked by a specific component.
64
+ *
65
+ * @param componentId - Component identifier to check
66
+ * @returns true if this specific component has scroll locked
67
+ */
68
+ export declare function isLockedBy(componentId: string): boolean;
69
+ /**
70
+ * Get the complete lock state for debugging.
71
+ *
72
+ * @returns Current state including scroll position and active locks
73
+ */
74
+ export declare function getLockState(): Readonly<{
75
+ locked: boolean;
76
+ scrollY: number;
77
+ activeLocks: string[];
78
+ }>;
79
+ //# sourceMappingURL=scroll-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-lock.d.ts","sourceRoot":"","sources":["../../src/utils/scroll-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAuBH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB;CACF;AA4FD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAUpD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAWtD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAGrC;AAMD;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAGlC;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAGnC;AAMD;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,GAAG,CAAC,MAAM,CAAC,CAE5C;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,QAAQ,CAAC;IACvC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC,CAMD"}