@omegagrid/core 0.10.2 → 0.10.4

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 (317) hide show
  1. package/dist/common/actions.d.ts +16 -0
  2. package/dist/common/actions.d.ts.map +1 -0
  3. package/dist/common/actions.js +14 -0
  4. package/dist/common/actions.js.map +1 -0
  5. package/dist/common/colors.d.ts +39 -0
  6. package/dist/common/colors.d.ts.map +1 -0
  7. package/dist/common/colors.js +59 -0
  8. package/dist/common/colors.js.map +1 -0
  9. package/dist/common/csv.d.ts +23 -0
  10. package/dist/common/csv.d.ts.map +1 -0
  11. package/dist/common/csv.js +93 -0
  12. package/dist/common/csv.js.map +1 -0
  13. package/dist/common/dates.d.ts +32 -0
  14. package/dist/common/dates.d.ts.map +1 -0
  15. package/dist/common/dates.js +172 -0
  16. package/dist/common/dates.js.map +1 -0
  17. package/dist/common/device.d.ts +2 -0
  18. package/dist/common/device.d.ts.map +1 -0
  19. package/dist/common/device.js +13 -0
  20. package/dist/common/device.js.map +1 -0
  21. package/dist/common/dom.d.ts +90 -0
  22. package/dist/common/dom.d.ts.map +1 -0
  23. package/dist/common/dom.js +308 -0
  24. package/dist/common/dom.js.map +1 -0
  25. package/dist/common/events.d.ts +15 -0
  26. package/dist/common/events.d.ts.map +1 -0
  27. package/dist/common/events.js +33 -0
  28. package/dist/common/events.js.map +1 -0
  29. package/dist/common/html.d.ts +3 -0
  30. package/dist/common/html.d.ts.map +1 -0
  31. package/dist/common/html.js +25 -0
  32. package/dist/common/html.js.map +1 -0
  33. package/dist/common/index.d.ts +19 -0
  34. package/dist/common/index.d.ts.map +1 -0
  35. package/dist/common/index.js +19 -0
  36. package/dist/common/index.js.map +1 -0
  37. package/dist/common/linkedList.d.ts +24 -0
  38. package/dist/common/linkedList.d.ts.map +1 -0
  39. package/dist/common/linkedList.js +65 -0
  40. package/dist/common/linkedList.js.map +1 -0
  41. package/dist/common/loaders.d.ts +17 -0
  42. package/dist/common/loaders.d.ts.map +1 -0
  43. package/dist/common/loaders.js +54 -0
  44. package/dist/common/loaders.js.map +1 -0
  45. package/dist/common/logger.d.ts +25 -0
  46. package/dist/common/logger.d.ts.map +1 -0
  47. package/dist/common/logger.js +57 -0
  48. package/dist/common/logger.js.map +1 -0
  49. package/dist/common/matrix.d.ts +6 -0
  50. package/dist/common/matrix.d.ts.map +1 -0
  51. package/dist/common/matrix.js +17 -0
  52. package/dist/common/matrix.js.map +1 -0
  53. package/dist/common/numbers.d.ts +26 -0
  54. package/dist/common/numbers.d.ts.map +1 -0
  55. package/dist/common/numbers.js +239 -0
  56. package/dist/common/numbers.js.map +1 -0
  57. package/dist/common/options.d.ts +17 -0
  58. package/dist/common/options.d.ts.map +1 -0
  59. package/dist/common/options.js +29 -0
  60. package/dist/common/options.js.map +1 -0
  61. package/dist/common/paper.d.ts +8 -0
  62. package/dist/common/paper.d.ts.map +1 -0
  63. package/dist/common/paper.js +17 -0
  64. package/dist/common/paper.js.map +1 -0
  65. package/dist/common/shortcutManager.d.ts +17 -0
  66. package/dist/common/shortcutManager.d.ts.map +1 -0
  67. package/dist/common/shortcutManager.js +49 -0
  68. package/dist/common/shortcutManager.js.map +1 -0
  69. package/dist/common/tree.d.ts +87 -0
  70. package/dist/common/tree.d.ts.map +1 -0
  71. package/dist/common/tree.js +204 -0
  72. package/dist/common/tree.js.map +1 -0
  73. package/dist/common/utils.d.ts +30 -0
  74. package/dist/common/utils.d.ts.map +1 -0
  75. package/dist/common/utils.js +136 -0
  76. package/dist/common/utils.js.map +1 -0
  77. package/dist/constants.d.ts +48 -0
  78. package/dist/constants.d.ts.map +1 -0
  79. package/dist/constants.js +24 -0
  80. package/dist/constants.js.map +1 -0
  81. package/dist/index.d.ts +8 -0
  82. package/dist/index.d.ts.map +1 -0
  83. package/dist/index.js +8 -0
  84. package/dist/index.js.map +1 -0
  85. package/dist/model/adapter.d.ts +8 -0
  86. package/dist/model/adapter.d.ts.map +1 -0
  87. package/dist/model/adapter.js +13 -0
  88. package/dist/model/adapter.js.map +1 -0
  89. package/dist/model/component.d.ts +19 -0
  90. package/dist/model/component.d.ts.map +1 -0
  91. package/dist/model/component.js +84 -0
  92. package/dist/model/component.js.map +1 -0
  93. package/dist/model/componentSlice.d.ts +8 -0
  94. package/dist/model/componentSlice.d.ts.map +1 -0
  95. package/dist/model/componentSlice.js +10 -0
  96. package/dist/model/componentSlice.js.map +1 -0
  97. package/dist/model/componentStore.d.ts +12 -0
  98. package/dist/model/componentStore.d.ts.map +1 -0
  99. package/dist/model/componentStore.js +26 -0
  100. package/dist/model/componentStore.js.map +1 -0
  101. package/dist/model/index.d.ts +6 -0
  102. package/dist/model/index.d.ts.map +1 -0
  103. package/dist/model/index.js +6 -0
  104. package/dist/model/index.js.map +1 -0
  105. package/dist/model/plugins.d.ts +13 -0
  106. package/dist/model/plugins.d.ts.map +1 -0
  107. package/dist/model/plugins.js +27 -0
  108. package/dist/model/plugins.js.map +1 -0
  109. package/dist/themes/definitions/tmDark.d.ts +4 -0
  110. package/dist/themes/definitions/tmDark.d.ts.map +1 -0
  111. package/dist/themes/definitions/tmDark.js +83 -0
  112. package/dist/themes/definitions/tmDark.js.map +1 -0
  113. package/dist/themes/definitions/tmLight.d.ts +4 -0
  114. package/dist/themes/definitions/tmLight.d.ts.map +1 -0
  115. package/dist/themes/definitions/tmLight.js +83 -0
  116. package/dist/themes/definitions/tmLight.js.map +1 -0
  117. package/dist/themes/helpers.d.ts +7 -0
  118. package/dist/themes/helpers.d.ts.map +1 -0
  119. package/dist/themes/helpers.js +34 -0
  120. package/dist/themes/helpers.js.map +1 -0
  121. package/dist/themes/index.d.ts +18 -0
  122. package/dist/themes/index.d.ts.map +1 -0
  123. package/dist/themes/index.js +48 -0
  124. package/dist/themes/index.js.map +1 -0
  125. package/dist/themes/mixins.d.ts +10 -0
  126. package/dist/themes/mixins.d.ts.map +1 -0
  127. package/dist/themes/mixins.js +39 -0
  128. package/dist/themes/mixins.js.map +1 -0
  129. package/dist/themes/transformations.d.ts +9 -0
  130. package/dist/themes/transformations.d.ts.map +1 -0
  131. package/dist/themes/transformations.js +48 -0
  132. package/dist/themes/transformations.js.map +1 -0
  133. package/dist/types.d.ts +130 -0
  134. package/dist/types.d.ts.map +1 -0
  135. package/dist/types.js +12 -0
  136. package/dist/types.js.map +1 -0
  137. package/dist/ui/accordion.d.ts +16 -0
  138. package/dist/ui/accordion.d.ts.map +1 -0
  139. package/dist/ui/accordion.js +209 -0
  140. package/dist/ui/accordion.js.map +1 -0
  141. package/dist/ui/alert.d.ts +15 -0
  142. package/dist/ui/alert.d.ts.map +1 -0
  143. package/dist/ui/alert.js +101 -0
  144. package/dist/ui/alert.js.map +1 -0
  145. package/dist/ui/baseElement.d.ts +7 -0
  146. package/dist/ui/baseElement.d.ts.map +1 -0
  147. package/dist/ui/baseElement.js +10 -0
  148. package/dist/ui/baseElement.js.map +1 -0
  149. package/dist/ui/button.d.ts +21 -0
  150. package/dist/ui/button.d.ts.map +1 -0
  151. package/dist/ui/button.js +100 -0
  152. package/dist/ui/button.js.map +1 -0
  153. package/dist/ui/button.style.d.ts +2 -0
  154. package/dist/ui/button.style.d.ts.map +1 -0
  155. package/dist/ui/button.style.js +60 -0
  156. package/dist/ui/button.style.js.map +1 -0
  157. package/dist/ui/checkbox.d.ts +14 -0
  158. package/dist/ui/checkbox.d.ts.map +1 -0
  159. package/dist/ui/checkbox.js +47 -0
  160. package/dist/ui/checkbox.js.map +1 -0
  161. package/dist/ui/close.d.ts +6 -0
  162. package/dist/ui/close.d.ts.map +1 -0
  163. package/dist/ui/close.js +33 -0
  164. package/dist/ui/close.js.map +1 -0
  165. package/dist/ui/colorpicker.d.ts +24 -0
  166. package/dist/ui/colorpicker.d.ts.map +1 -0
  167. package/dist/ui/colorpicker.js +228 -0
  168. package/dist/ui/colorpicker.js.map +1 -0
  169. package/dist/ui/container.d.ts +39 -0
  170. package/dist/ui/container.d.ts.map +1 -0
  171. package/dist/ui/container.js +313 -0
  172. package/dist/ui/container.js.map +1 -0
  173. package/dist/ui/dropdown.d.ts +48 -0
  174. package/dist/ui/dropdown.d.ts.map +1 -0
  175. package/dist/ui/dropdown.js +300 -0
  176. package/dist/ui/dropdown.js.map +1 -0
  177. package/dist/ui/dropdownColorPicker.d.ts +12 -0
  178. package/dist/ui/dropdownColorPicker.d.ts.map +1 -0
  179. package/dist/ui/dropdownColorPicker.js +60 -0
  180. package/dist/ui/dropdownColorPicker.js.map +1 -0
  181. package/dist/ui/dropdownList.d.ts +8 -0
  182. package/dist/ui/dropdownList.d.ts.map +1 -0
  183. package/dist/ui/dropdownList.js +48 -0
  184. package/dist/ui/dropdownList.js.map +1 -0
  185. package/dist/ui/dropdownMenu.d.ts +11 -0
  186. package/dist/ui/dropdownMenu.d.ts.map +1 -0
  187. package/dist/ui/dropdownMenu.js +61 -0
  188. package/dist/ui/dropdownMenu.js.map +1 -0
  189. package/dist/ui/expander.d.ts +28 -0
  190. package/dist/ui/expander.d.ts.map +1 -0
  191. package/dist/ui/expander.js +144 -0
  192. package/dist/ui/expander.js.map +1 -0
  193. package/dist/ui/fileInput.d.ts +24 -0
  194. package/dist/ui/fileInput.d.ts.map +1 -0
  195. package/dist/ui/fileInput.js +130 -0
  196. package/dist/ui/fileInput.js.map +1 -0
  197. package/dist/ui/fileInput.style.d.ts +2 -0
  198. package/dist/ui/fileInput.style.d.ts.map +1 -0
  199. package/dist/ui/fileInput.style.js +73 -0
  200. package/dist/ui/fileInput.style.js.map +1 -0
  201. package/dist/ui/floatingWindow.d.ts +19 -0
  202. package/dist/ui/floatingWindow.d.ts.map +1 -0
  203. package/dist/ui/floatingWindow.js +87 -0
  204. package/dist/ui/floatingWindow.js.map +1 -0
  205. package/dist/ui/icon.d.ts +46 -0
  206. package/dist/ui/icon.d.ts.map +1 -0
  207. package/dist/ui/icon.js +189 -0
  208. package/dist/ui/icon.js.map +1 -0
  209. package/dist/ui/icon.style.d.ts +2 -0
  210. package/dist/ui/icon.style.d.ts.map +1 -0
  211. package/dist/ui/icon.style.js +556 -0
  212. package/dist/ui/icon.style.js.map +1 -0
  213. package/dist/ui/images.d.ts +2 -0
  214. package/dist/ui/images.d.ts.map +1 -0
  215. package/dist/ui/images.js +14 -0
  216. package/dist/ui/images.js.map +1 -0
  217. package/dist/ui/index.d.ts +32 -0
  218. package/dist/ui/index.d.ts.map +1 -0
  219. package/dist/ui/index.js +32 -0
  220. package/dist/ui/index.js.map +1 -0
  221. package/dist/ui/input.d.ts +12 -0
  222. package/dist/ui/input.d.ts.map +1 -0
  223. package/dist/ui/input.js +45 -0
  224. package/dist/ui/input.js.map +1 -0
  225. package/dist/ui/input.style.d.ts +2 -0
  226. package/dist/ui/input.style.d.ts.map +1 -0
  227. package/dist/ui/input.style.js +36 -0
  228. package/dist/ui/input.style.js.map +1 -0
  229. package/dist/ui/label.d.ts +16 -0
  230. package/dist/ui/label.d.ts.map +1 -0
  231. package/dist/ui/label.js +90 -0
  232. package/dist/ui/label.js.map +1 -0
  233. package/dist/ui/list.d.ts +87 -0
  234. package/dist/ui/list.d.ts.map +1 -0
  235. package/dist/ui/list.js +427 -0
  236. package/dist/ui/list.js.map +1 -0
  237. package/dist/ui/list.style.d.ts +2 -0
  238. package/dist/ui/list.style.d.ts.map +1 -0
  239. package/dist/ui/list.style.js +35 -0
  240. package/dist/ui/list.style.js.map +1 -0
  241. package/dist/ui/loader.d.ts +6 -0
  242. package/dist/ui/loader.d.ts.map +1 -0
  243. package/dist/ui/loader.js +25 -0
  244. package/dist/ui/loader.js.map +1 -0
  245. package/dist/ui/menu.d.ts +41 -0
  246. package/dist/ui/menu.d.ts.map +1 -0
  247. package/dist/ui/menu.js +154 -0
  248. package/dist/ui/menu.js.map +1 -0
  249. package/dist/ui/menu.style.d.ts +3 -0
  250. package/dist/ui/menu.style.d.ts.map +1 -0
  251. package/dist/ui/menu.style.js +50 -0
  252. package/dist/ui/menu.style.js.map +1 -0
  253. package/dist/ui/numericInput.d.ts +37 -0
  254. package/dist/ui/numericInput.d.ts.map +1 -0
  255. package/dist/ui/numericInput.js +175 -0
  256. package/dist/ui/numericInput.js.map +1 -0
  257. package/dist/ui/numericInput.style.d.ts +2 -0
  258. package/dist/ui/numericInput.style.d.ts.map +1 -0
  259. package/dist/ui/numericInput.style.js +29 -0
  260. package/dist/ui/numericInput.style.js.map +1 -0
  261. package/dist/ui/overlay.d.ts +17 -0
  262. package/dist/ui/overlay.d.ts.map +1 -0
  263. package/dist/ui/overlay.js +87 -0
  264. package/dist/ui/overlay.js.map +1 -0
  265. package/dist/ui/overlay.style.d.ts +2 -0
  266. package/dist/ui/overlay.style.d.ts.map +1 -0
  267. package/dist/ui/overlay.style.js +46 -0
  268. package/dist/ui/overlay.style.js.map +1 -0
  269. package/dist/ui/panel.d.ts +25 -0
  270. package/dist/ui/panel.d.ts.map +1 -0
  271. package/dist/ui/panel.js +151 -0
  272. package/dist/ui/panel.js.map +1 -0
  273. package/dist/ui/panel.style.d.ts +2 -0
  274. package/dist/ui/panel.style.d.ts.map +1 -0
  275. package/dist/ui/panel.style.js +73 -0
  276. package/dist/ui/panel.style.js.map +1 -0
  277. package/dist/ui/sizer.d.ts +53 -0
  278. package/dist/ui/sizer.d.ts.map +1 -0
  279. package/dist/ui/sizer.js +203 -0
  280. package/dist/ui/sizer.js.map +1 -0
  281. package/dist/ui/slider.d.ts +52 -0
  282. package/dist/ui/slider.d.ts.map +1 -0
  283. package/dist/ui/slider.js +213 -0
  284. package/dist/ui/slider.js.map +1 -0
  285. package/dist/ui/slider.style.d.ts +2 -0
  286. package/dist/ui/slider.style.d.ts.map +1 -0
  287. package/dist/ui/slider.style.js +61 -0
  288. package/dist/ui/slider.style.js.map +1 -0
  289. package/dist/ui/sortableList.d.ts +39 -0
  290. package/dist/ui/sortableList.d.ts.map +1 -0
  291. package/dist/ui/sortableList.js +167 -0
  292. package/dist/ui/sortableList.js.map +1 -0
  293. package/dist/ui/splitContainer.d.ts +52 -0
  294. package/dist/ui/splitContainer.d.ts.map +1 -0
  295. package/dist/ui/splitContainer.js +252 -0
  296. package/dist/ui/splitContainer.js.map +1 -0
  297. package/dist/ui/splitContainer.style.d.ts +2 -0
  298. package/dist/ui/splitContainer.style.d.ts.map +1 -0
  299. package/dist/ui/splitContainer.style.js +62 -0
  300. package/dist/ui/splitContainer.style.js.map +1 -0
  301. package/dist/ui/switch.d.ts +22 -0
  302. package/dist/ui/switch.d.ts.map +1 -0
  303. package/dist/ui/switch.js +83 -0
  304. package/dist/ui/switch.js.map +1 -0
  305. package/dist/ui/switch.style.d.ts +2 -0
  306. package/dist/ui/switch.style.d.ts.map +1 -0
  307. package/dist/ui/switch.style.js +149 -0
  308. package/dist/ui/switch.style.js.map +1 -0
  309. package/dist/ui/tooltip.d.ts +24 -0
  310. package/dist/ui/tooltip.d.ts.map +1 -0
  311. package/dist/ui/tooltip.js +143 -0
  312. package/dist/ui/tooltip.js.map +1 -0
  313. package/dist/ui/tooltip.style.d.ts +2 -0
  314. package/dist/ui/tooltip.style.d.ts.map +1 -0
  315. package/dist/ui/tooltip.style.js +112 -0
  316. package/dist/ui/tooltip.style.js.map +1 -0
  317. package/package.json +2 -2
@@ -0,0 +1,136 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ /* eslint-disable no-prototype-builtins */
3
+ export function isBool(value) {
4
+ return typeof value === 'boolean';
5
+ }
6
+ export function isObject(value) {
7
+ return (value && typeof value === 'object' && !Array.isArray(value));
8
+ }
9
+ export function isFunction(value) {
10
+ return (value && typeof value === 'function');
11
+ }
12
+ export function isString(value) {
13
+ return typeof value == 'string';
14
+ }
15
+ export function isNumericString(value) {
16
+ let decimalSeparators = 0;
17
+ for (let i = 0; i < value.length; i++) {
18
+ const char = value.charAt(i);
19
+ if (char === '.' || char === ',') {
20
+ if (++decimalSeparators > 1)
21
+ return false;
22
+ }
23
+ else if (char < '0' || char > '9') {
24
+ return false;
25
+ }
26
+ }
27
+ return true;
28
+ }
29
+ export function strToNum(str) {
30
+ return parseFloat(str.replace ? str.replace(',', '.') : str);
31
+ }
32
+ export function isNumber(value) {
33
+ return typeof value === 'number';
34
+ }
35
+ export function isCharLetter(char) {
36
+ return char.toLowerCase() !== char.toUpperCase();
37
+ }
38
+ export function ifNull(value, def) {
39
+ return value == null ? def : value;
40
+ }
41
+ export function mergeDeep(...sources) {
42
+ const result = {};
43
+ sources.forEach(source => {
44
+ for (const key in source) {
45
+ if (source.hasOwnProperty(key)) {
46
+ const sourceValue = source[key];
47
+ const resultValue = result[key];
48
+ if (Array.isArray(sourceValue)) {
49
+ result[key] = [...sourceValue];
50
+ }
51
+ else if (typeof sourceValue === 'object' && sourceValue !== null) {
52
+ result[key] = mergeDeep(resultValue || {}, sourceValue);
53
+ }
54
+ else {
55
+ result[key] = sourceValue;
56
+ }
57
+ }
58
+ }
59
+ });
60
+ return result;
61
+ }
62
+ export function cloneDeep(obj) {
63
+ return mergeDeep({}, obj);
64
+ }
65
+ export function clone(obj) {
66
+ return Object.assign({}, obj);
67
+ }
68
+ export function trim(value, char) {
69
+ if (char === ']')
70
+ char = '\\]';
71
+ if (char === '^')
72
+ char = '\\^';
73
+ if (char === '\\')
74
+ char = '\\\\';
75
+ return value.replace(new RegExp('^[' + char + ']+|[' + char + ']+$', 'g'), '');
76
+ }
77
+ export function minmax(values) {
78
+ let min = null, max = null;
79
+ values.forEach(v => {
80
+ if (!isNaN(v) && v != null) {
81
+ min = Math.min(min == null ? Number.MAX_SAFE_INTEGER : min, v);
82
+ max = Math.max(max == null ? Number.MIN_SAFE_INTEGER : max, v);
83
+ }
84
+ });
85
+ return [min, max];
86
+ }
87
+ export function minmax2d(...values) {
88
+ let min = null, max = null;
89
+ values.forEach(matrice => matrice.forEach(row => row.forEach(v => {
90
+ if (!isNaN(v) && v != null) {
91
+ min = Math.min(min == null ? Number.MAX_SAFE_INTEGER : min, v);
92
+ max = Math.max(max == null ? Number.MIN_SAFE_INTEGER : max, v);
93
+ }
94
+ })));
95
+ return [min, max];
96
+ }
97
+ export function removeAccents(str) {
98
+ return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
99
+ }
100
+ const controlCharacters = ["Shift", "Escape", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter"];
101
+ export function isControlCharacter(charCode) {
102
+ return controlCharacters.includes(charCode);
103
+ }
104
+ export function escapeRegExp(value) {
105
+ return value.replace(/[.*+?^${}()|[\]\\]/gi, '\\$&');
106
+ }
107
+ export function intersect(arr1, arr2) {
108
+ return arr1.filter(element => arr2.includes(element));
109
+ }
110
+ export function rectIntersect(r1, r2) {
111
+ if (r1.x >= r2.x + r2.w || r2.x >= r1.x + r1.w || r1.y >= r2.y + r2.h || r2.y >= r1.y + r1.h) {
112
+ return null;
113
+ }
114
+ return {
115
+ x: Math.max(r1.x, r2.x),
116
+ y: Math.max(r1.y, r2.y),
117
+ w: Math.min(r1.x + r1.w, r2.x + r2.w) - Math.max(r1.x, r2.x),
118
+ h: Math.min(r1.y + r1.h, r2.y + r2.h) - Math.max(r1.y, r2.y)
119
+ };
120
+ }
121
+ /**
122
+ * Binds a method to a context and optionally executes a callback with the result.
123
+ * @param {any} context - The context to bind the method to.
124
+ * @param {Function} method - The method to bind.
125
+ * @param {Function} [callback] - Optional callback to execute with the result of the method.
126
+ * @returns {Function} A new function that, when called, will execute the method with the bound context.
127
+ */
128
+ export function bind(context, method, callback) {
129
+ return function (...args) {
130
+ const result = method.apply(context, args);
131
+ if (typeof callback === 'function')
132
+ callback(result, ...args);
133
+ return result;
134
+ };
135
+ }
136
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/common/utils.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,0CAA0C;AAI1C,MAAM,UAAU,MAAM,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACtC,OAAO,CAAC,KAAK,I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C;QAC9D,OAAO,MAAM,CAAC;IACf,CAAC,CAAC;AACH,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-prototype-builtins */\n\nimport { Matrix, Rect } from \"../types\";\n\nexport function isBool(value: unknown) {\n\treturn typeof value === 'boolean';\n}\n\nexport function isObject(value: unknown) {\n\treturn (value && typeof value === 'object' && !Array.isArray(value));\n}\n\nexport function isFunction(value: unknown) {\n\treturn (value && typeof value === 'function');\n}\n\nexport function isString(value: unknown) {\n\treturn typeof value == 'string';\n}\n\nexport function isNumericString(value: string) {\n\tlet decimalSeparators = 0;\n\tfor (let i = 0; i < value.length; i++) {\n\t\tconst char = value.charAt(i);\n\t\tif (char === '.' || char === ',') {\n\t\t\tif (++decimalSeparators > 1) return false;\n\t\t} else if (char < '0' || char > '9') {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function strToNum(str: string) {\n\treturn parseFloat(str.replace ? str.replace(',', '.') : str);\n}\n\nexport function isNumber(value: unknown) {\n\treturn typeof value === 'number';\n}\n \nexport function isCharLetter(char: string) {\n\treturn char.toLowerCase() !== char.toUpperCase();\n}\n\nexport function ifNull<T>(value: T|null, def: T) {\n\treturn value == null ? def: value;\n}\n\nexport function mergeDeep<T>(...sources: Partial<T>[]): T {\n\tconst result: any = {};\n\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\tif (source.hasOwnProperty(key)) {\n\t\t\t\tconst sourceValue = (source as any)[key];\n\t\t\t\tconst resultValue = result[key];\n\n\t\t\t\tif (Array.isArray(sourceValue)) {\n\t\t\t\t\tresult[key] = [...sourceValue];\n\t\t\t\t} else if (typeof sourceValue === 'object' && sourceValue !== null) {\n\t\t\t\t\tresult[key] = mergeDeep(resultValue || {}, sourceValue);\n\t\t\t\t} else {\n\t\t\t\t\tresult[key] = sourceValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\treturn result as T;\n}\n\nexport function cloneDeep<T>(obj: T) {\n\treturn mergeDeep<T>({}, obj);\n}\n\nexport function clone(obj: any) {\n\treturn Object.assign({}, obj);\n}\n\nexport function trim(value: string, char: string) {\n\tif (char === ']') char = '\\\\]';\n\tif (char === '^') char = '\\\\^';\n\tif (char === '\\\\') char = '\\\\\\\\';\n\treturn value.replace(new RegExp('^[' + char + ']+|[' + char + ']+$', 'g'), '');\n}\n\nexport function minmax(values: number[]) : [number, number] {\n\tlet min: number = null, max: number = null;\n\tvalues.forEach(v => {\n\t\tif (!isNaN(v) && v != null) {\n\t\t\tmin = Math.min(min == null ? Number.MAX_SAFE_INTEGER : min, v);\n\t\t\tmax = Math.max(max == null ? Number.MIN_SAFE_INTEGER : max, v);\n\t\t}\n\t});\n\treturn [min, max];\n}\n\nexport function minmax2d(...values: Matrix<number>[]) : [number, number] {\n\tlet min: number = null, max: number = null;\n\tvalues.forEach(matrice => matrice.forEach(row => row.forEach(v => {\n\t\tif (!isNaN(v) && v != null) {\n\t\t\tmin = Math.min(min == null ? Number.MAX_SAFE_INTEGER : min, v);\n\t\t\tmax = Math.max(max == null ? Number.MIN_SAFE_INTEGER : max, v);\n\t\t}\n\t})));\n\treturn [min, max];\n}\n\nexport function removeAccents(str: string) {\n\treturn str.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\");\n}\n\n\nconst controlCharacters = [\"Shift\", \"Escape\", \"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\", \"Enter\"];\n\nexport function isControlCharacter(charCode: string) {\n\treturn controlCharacters.includes(charCode);\n}\n\nexport function escapeRegExp(value: string) {\n\treturn value.replace(/[.*+?^${}()|[\\]\\\\]/gi, '\\\\$&');\n}\n\nexport function intersect<T>(arr1: T[], arr2: T[]): T[] {\n\treturn arr1.filter(element => arr2.includes(element));\n}\n\nexport function rectIntersect(r1: Rect, r2: Rect): Rect {\n\tif (r1.x >= r2.x + r2.w || r2.x >= r1.x + r1.w || r1.y >= r2.y + r2.h || r2.y >= r1.y + r1.h) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tx: Math.max(r1.x, r2.x),\n\t\ty: Math.max(r1.y, r2.y),\n\t\tw: Math.min(r1.x + r1.w, r2.x + r2.w) - Math.max(r1.x, r2.x),\n\t\th: Math.min(r1.y + r1.h, r2.y + r2.h) - Math.max(r1.y, r2.y)\n\t};\n}\n\n/**\n * Binds a method to a context and optionally executes a callback with the result.\n * @param {any} context - The context to bind the method to.\n * @param {Function} method - The method to bind.\n * @param {Function} [callback] - Optional callback to execute with the result of the method.\n * @returns {Function} A new function that, when called, will execute the method with the bound context.\n */\nexport function bind<T extends (...args: any[]) => any>(\n\tcontext: any,\n\tmethod: T,\n\tcallback?: (result: ReturnType<T>, ...args: Parameters<T>) => void\n): (...args: Parameters<T>) => ReturnType<T> {\n\treturn function (...args: Parameters<T>): ReturnType<T> {\n\t\tconst result = method.apply(context, args);\n\t\tif (typeof callback === 'function') callback(result, ...args);\n\t\treturn result;\n\t};\n}\n"]}
@@ -0,0 +1,48 @@
1
+ import Color from 'color';
2
+ declare const _default: {
3
+ PREFIX: string;
4
+ DEFAULT_ACCENT_COLOR: string;
5
+ DEFAULT_ACCENT_COLOR_2: Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | Color<string | number | /*elided*/ any | ArrayLike<number> | {
6
+ [key: string]: any;
7
+ }> | ArrayLike<number> | {
8
+ [key: string]: any;
9
+ }> | ArrayLike<number> | {
10
+ [key: string]: any;
11
+ }> | ArrayLike<number> | {
12
+ [key: string]: any;
13
+ }> | ArrayLike<number> | {
14
+ [key: string]: any;
15
+ }> | ArrayLike<number> | {
16
+ [key: string]: any;
17
+ }> | ArrayLike<number> | {
18
+ [key: string]: any;
19
+ }> | ArrayLike<number> | {
20
+ [key: string]: any;
21
+ }> | ArrayLike<number> | {
22
+ [key: string]: any;
23
+ }> | ArrayLike<number> | {
24
+ [key: string]: any;
25
+ }> | ArrayLike<number> | {
26
+ [key: string]: any;
27
+ }> | ArrayLike<number> | {
28
+ [key: string]: any;
29
+ }>;
30
+ SIZER_SIZE: number;
31
+ SLIDER_SIZE: number;
32
+ SLIDER_MIN_LENGTH: number;
33
+ EXPANDER_SIZE: number;
34
+ LIST_ITEM_HEIGHT: number;
35
+ LIST_RENDERING_TRESHOLD: number;
36
+ LIST_AUTOSCROLL_TRESHOLD: number;
37
+ LIST_AUTOSCROLL_DELAY: number;
38
+ DEFAULT_TEXT_HIGHLIGHT_COLOR: string;
39
+ TOOLTIP_MARGIN: number;
40
+ MENU_ITEM_HEIGHT: number;
41
+ COLORPICKER_COLOR_SIZE: number;
42
+ DEFAULT_NUMBER_FORMAT: string;
43
+ BUTTON_HEIGHT: number;
44
+ FONT_SIZE: number;
45
+ FLOATING_WINDOW_MAX_WIDTH: number;
46
+ };
47
+ export default _default;
48
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAI1B,wBAoBC"}
@@ -0,0 +1,24 @@
1
+ import Color from 'color';
2
+ const DEFAULT_ACCENT_COLOR = '#00955d';
3
+ export default {
4
+ PREFIX: 'og',
5
+ DEFAULT_ACCENT_COLOR: DEFAULT_ACCENT_COLOR,
6
+ DEFAULT_ACCENT_COLOR_2: Color(DEFAULT_ACCENT_COLOR).darken(0.6),
7
+ SIZER_SIZE: 5,
8
+ SLIDER_SIZE: 10,
9
+ SLIDER_MIN_LENGTH: 30,
10
+ EXPANDER_SIZE: 13,
11
+ LIST_ITEM_HEIGHT: 22,
12
+ LIST_RENDERING_TRESHOLD: 30,
13
+ LIST_AUTOSCROLL_TRESHOLD: 30,
14
+ LIST_AUTOSCROLL_DELAY: 100,
15
+ DEFAULT_TEXT_HIGHLIGHT_COLOR: 'var(--og-text-highlight-color)',
16
+ TOOLTIP_MARGIN: 8,
17
+ MENU_ITEM_HEIGHT: 25,
18
+ COLORPICKER_COLOR_SIZE: 16,
19
+ DEFAULT_NUMBER_FORMAT: '#,0.#####',
20
+ BUTTON_HEIGHT: 22,
21
+ FONT_SIZE: 12,
22
+ FLOATING_WINDOW_MAX_WIDTH: 500
23
+ };
24
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAEvC,eAAe;IACd,MAAM,EAAE,IAAI;IACZ,oBAAoB,EAAE,oBAAoB;IAC1C,sBAAsB,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IAC/D,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,EAAE;IACf,iBAAiB,EAAE,EAAE;IACrB,aAAa,EAAE,EAAE;IACjB,gBAAgB,EAAE,EAAE;IACpB,uBAAuB,EAAE,EAAE;IAC3B,wBAAwB,EAAE,EAAE;IAC5B,qBAAqB,EAAE,GAAG;IAC1B,4BAA4B,EAAE,gCAAgC;IAC9D,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,EAAE;IACpB,sBAAsB,EAAE,EAAE;IAC1B,qBAAqB,EAAE,WAAW;IAClC,aAAa,EAAE,EAAE;IACjB,SAAS,EAAE,EAAE;IACb,yBAAyB,EAAE,GAAG;CAC9B,CAAA","sourcesContent":["import Color from 'color';\n\nconst DEFAULT_ACCENT_COLOR = '#00955d';\n\nexport default {\n\tPREFIX: 'og',\n\tDEFAULT_ACCENT_COLOR: DEFAULT_ACCENT_COLOR,\n\tDEFAULT_ACCENT_COLOR_2: Color(DEFAULT_ACCENT_COLOR).darken(0.6),\n\tSIZER_SIZE: 5,\n\tSLIDER_SIZE: 10,\n\tSLIDER_MIN_LENGTH: 30,\n\tEXPANDER_SIZE: 13,\n\tLIST_ITEM_HEIGHT: 22,\n\tLIST_RENDERING_TRESHOLD: 30,\n\tLIST_AUTOSCROLL_TRESHOLD: 30,\n\tLIST_AUTOSCROLL_DELAY: 100,\n\tDEFAULT_TEXT_HIGHLIGHT_COLOR: 'var(--og-text-highlight-color)',\n\tTOOLTIP_MARGIN: 8,\n\tMENU_ITEM_HEIGHT: 25,\n\tCOLORPICKER_COLOR_SIZE: 16,\n\tDEFAULT_NUMBER_FORMAT: '#,0.#####',\n\tBUTTON_HEIGHT: 22,\n\tFONT_SIZE: 12,\n\tFLOATING_WINDOW_MAX_WIDTH: 500\n}"]}
@@ -0,0 +1,8 @@
1
+ export * from './common';
2
+ export { default as constants } from './constants';
3
+ export { Options as CommonOptions, initOptions as initCommonOptions, getDefaultOptions } from './common/options';
4
+ export * from './ui';
5
+ export * from './types';
6
+ export * from './themes';
7
+ export * from './model';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,WAAW,IAAI,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACjH,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ export * from './common';
2
+ export { default as constants } from './constants';
3
+ export { initOptions as initCommonOptions, getDefaultOptions } from './common/options';
4
+ export * from './ui';
5
+ export * from './types';
6
+ export * from './themes';
7
+ export * from './model';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAA4B,WAAW,IAAI,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACjH,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC","sourcesContent":["export * from './common';\nexport { default as constants } from './constants';\nexport { Options as CommonOptions, initOptions as initCommonOptions, getDefaultOptions } from './common/options';\nexport * from './ui';\nexport * from './types';\nexport * from './themes';\nexport * from './model';\n"]}
@@ -0,0 +1,8 @@
1
+ export declare abstract class ComponentAdapter<TComponent extends HTMLElement = HTMLElement> {
2
+ private _component;
3
+ readonly customProperties?: Record<string, unknown>;
4
+ get component(): TComponent;
5
+ protected attached(_component: TComponent): void;
6
+ attach(component: TComponent): void;
7
+ }
8
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/model/adapter.ts"],"names":[],"mappings":"AAEA,8BAAsB,gBAAgB,CAAC,UAAU,SAAS,WAAW,GAAG,WAAW;IAElF,OAAO,CAAC,UAAU,CAAa;IAC/B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;IAEzD,IAAI,SAAS,eAA6B;IAE1C,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU;IAEzC,MAAM,CAAC,SAAS,EAAE,UAAU;CAK5B"}
@@ -0,0 +1,13 @@
1
+ /* eslint-disable @typescript-eslint/no-empty-function */
2
+ export class ComponentAdapter {
3
+ constructor() {
4
+ this.customProperties = {};
5
+ }
6
+ get component() { return this._component; }
7
+ attached(_component) { }
8
+ attach(component) {
9
+ this._component = component;
10
+ this.attached(component);
11
+ }
12
+ }
13
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/model/adapter.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,MAAM,OAAgB,gBAAgB;IAAtC;QAGU,qBAAgB,GAA6B,EAAE,CAAC;IAW1D,CAAC;IATA,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,UAAU,CAAA,CAAC,CAAC;IAEhC,QAAQ,CAAC,UAAsB,IAAI,CAAC;IAE9C,MAAM,CAAC,SAAqB;QAC3B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;CAED","sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\n\nexport abstract class ComponentAdapter<TComponent extends HTMLElement = HTMLElement> {\n\n\tprivate _component: TComponent;\n\treadonly customProperties?: Record<string, unknown> = {};\n\n\tget component() { return this._component }\n\n\tprotected attached(_component: TComponent) { }\n\n\tattach(component: TComponent) {\n\t\tthis._component = component;\n\t\tthis.attached(component);\n\t}\n\n}"]}
@@ -0,0 +1,19 @@
1
+ import { CSSResultGroup, LitElement } from "lit";
2
+ import { ComponentState, Statefull } from "../types";
3
+ export declare abstract class OmegaComponent<TState extends ComponentState = ComponentState> extends LitElement implements Statefull, Disposable {
4
+ #private;
5
+ static styles: CSSResultGroup;
6
+ get parentComponent(): LitElement;
7
+ get parentOmegaComponent(): OmegaComponent;
8
+ private _state;
9
+ get state(): TState;
10
+ set state(val: TState);
11
+ getState(): TState;
12
+ setState(state: TState): void;
13
+ updateState(state: Partial<TState>, updateComponent?: boolean): void;
14
+ connectedCallback(): void;
15
+ disconnectedCallback(): void;
16
+ dispatchStateEvent(): void;
17
+ [Symbol.dispose](): void;
18
+ }
19
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/model/component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAO,MAAM,KAAK,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAKrD,8BAAsB,cAAc,CAAC,MAAM,SAAS,cAAc,GAAG,cAAc,CAAE,SAAQ,UAC5F,YAAW,SAAS,EAAE,UAAU;;IAEhC,MAAM,CAAC,MAAM,EAAE,cAAc,CAU3B;IAEF,IAAI,eAAe,IAC8D,UAAU,CAC1F;IAED,IAAI,oBAAoB,IAC6D,cAAc,CAClG;IAED,OAAO,CAAC,MAAM,CAAS;IACvB,IACI,KAAK,IAIM,MAAM,CAFpB;IAED,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,EAIpB;IAED,QAAQ,IAAI,MAAM;IAIlB,QAAQ,CAAC,KAAK,EAAE,MAAM;IAItB,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,eAAe,UAAQ,GAAG,IAAI;IAUlE,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAS5B,kBAAkB;IAIlB,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAIxB"}
@@ -0,0 +1,84 @@
1
+ /* eslint-disable @typescript-eslint/no-this-alias */
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _OmegaComponent_debounceDispatchStateEvent;
14
+ import { LitElement, css } from "lit";
15
+ import { debounce } from "ts-debounce";
16
+ import { dom, utils } from "../common";
17
+ import { property } from "lit/decorators.js";
18
+ export class OmegaComponent extends LitElement {
19
+ constructor() {
20
+ super(...arguments);
21
+ _OmegaComponent_debounceDispatchStateEvent.set(this, debounce(() => {
22
+ this.dispatchEvent(new Event('state', { bubbles: true, composed: true }));
23
+ }));
24
+ }
25
+ get parentComponent() {
26
+ return dom.findParent(this, (elm) => elm instanceof LitElement);
27
+ }
28
+ get parentOmegaComponent() {
29
+ return dom.findParent(this, (elm) => elm instanceof OmegaComponent);
30
+ }
31
+ get state() {
32
+ return this._state;
33
+ }
34
+ set state(val) {
35
+ const oldState = this._state;
36
+ this._state = val;
37
+ this.requestUpdate('state', oldState);
38
+ }
39
+ getState() {
40
+ return this._state;
41
+ }
42
+ setState(state) {
43
+ this._state = state;
44
+ }
45
+ updateState(state, updateComponent = false) {
46
+ const newState = utils.mergeDeep(this._state, state);
47
+ if (updateComponent) {
48
+ this.state = newState;
49
+ }
50
+ else {
51
+ this._state = newState;
52
+ }
53
+ __classPrivateFieldGet(this, _OmegaComponent_debounceDispatchStateEvent, "f").call(this);
54
+ }
55
+ connectedCallback() {
56
+ super.connectedCallback();
57
+ this.dispatchEvent(new Event('connected'));
58
+ }
59
+ disconnectedCallback() {
60
+ super.disconnectedCallback();
61
+ this.dispatchEvent(new Event('disconnected'));
62
+ }
63
+ dispatchStateEvent() {
64
+ __classPrivateFieldGet(this, _OmegaComponent_debounceDispatchStateEvent, "f").call(this);
65
+ }
66
+ [(_OmegaComponent_debounceDispatchStateEvent = new WeakMap(), Symbol.dispose)]() {
67
+ this.dispatchEvent(new Event('dispose'));
68
+ }
69
+ }
70
+ OmegaComponent.styles = css `
71
+ * {
72
+ box-sizing: border-box;
73
+ }
74
+
75
+ :host {
76
+ display: block;
77
+ font-size: var(--og-font-size);
78
+ font-family: var(--og-font-family);
79
+ }
80
+ `;
81
+ __decorate([
82
+ property({ type: Object, noAccessor: true })
83
+ ], OmegaComponent.prototype, "state", null);
84
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/model/component.ts"],"names":[],"mappings":"AAAA,qDAAqD;;;;;;;;;;;;;AAErD,OAAO,EAAkB,UAAU,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,OAAgB,cAA+D,SAAQ,UAAU;IAAvG;;QA+DC,qDAA8B,QAAQ,CAAC,GAAG,EAAE;YAC3C,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;QACzE,CAAC,CAAC,EAAC;IAUJ,CAAC;IA5DA,IAAI,eAAe;QAClB,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,GAAgB,EAAE,EAAE,CAAC,GAAG,YAAY,UAAU,CAAe,CAAC;IAC5F,CAAC;IAED,IAAI,oBAAoB;QACvB,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,GAAgB,EAAE,EAAE,CAAC,GAAG,YAAY,cAAc,CAAmB,CAAC;IACpG,CAAC;IAID,IAAI,KAAK;QACR,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED,IAAI,KAAK,CAAC,GAAW;QACpB,MAAM,QAAQ,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EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;2CAG1C","sourcesContent":["/* eslint-disable @typescript-eslint/no-this-alias */\n\nimport { CSSResultGroup, LitElement, css } from \"lit\";\nimport { ComponentState, Statefull } from \"../types\";\nimport { debounce } from \"ts-debounce\";\nimport { dom, utils } from \"../common\";\nimport { property } from \"lit/decorators.js\";\n\nexport abstract class OmegaComponent<TState extends ComponentState = ComponentState> extends LitElement \n\timplements Statefull, Disposable {\n\n\tstatic styles: CSSResultGroup = css`\n\t\t* {\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t\tfont-size: var(--og-font-size);\n\t\t\tfont-family: var(--og-font-family);\n\t\t}\n\t`;\n\n\tget parentComponent() {\n\t\treturn dom.findParent(this, (elm: HTMLElement) => elm instanceof LitElement) as LitElement;\n\t}\n\n\tget parentOmegaComponent() {\n\t\treturn dom.findParent(this, (elm: HTMLElement) => elm instanceof OmegaComponent) as OmegaComponent;\n\t}\n\n\tprivate _state: TState;\n\t@property({type: Object, noAccessor: true})\n\tget state() {\n\t\treturn this._state;\n\t}\n\n\tset state(val: TState) {\n\t\tconst oldState = this._state;\n\t\tthis._state = val;\n\t\tthis.requestUpdate('state', oldState);\n\t}\n\n\tgetState(): TState {\n\t\treturn this._state;\n\t}\n\n\tsetState(state: TState) {\n\t\tthis._state = state;\n\t}\n\n\tupdateState(state: Partial<TState>, updateComponent = false): void {\n\t\tconst newState = utils.mergeDeep(this._state, state);\n\t\tif (updateComponent) {\n\t\t\tthis.state = newState;\n\t\t} else {\n\t\t\tthis._state = newState;\n\t\t}\n\t\tthis.#debounceDispatchStateEvent();\n\t}\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t\tthis.dispatchEvent(new Event('connected'));\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback();\n\t\tthis.dispatchEvent(new Event('disconnected'));\n\t}\n\n\t#debounceDispatchStateEvent = debounce(() => {\n\t\tthis.dispatchEvent(new Event('state', {bubbles: true, composed: true}));\n\t});\n\t\n\tdispatchStateEvent() {\n\t\tthis.#debounceDispatchStateEvent();\n\t}\n\n\t[Symbol.dispose](): void {\n\t\tthis.dispatchEvent(new Event('dispose'));\n\t}\n\n}"]}
@@ -0,0 +1,8 @@
1
+ import { OmegaComponent } from "./component";
2
+ export declare class ComponentSlice<T extends OmegaComponent> {
3
+ readonly component: T;
4
+ constructor(component: T);
5
+ connectedCallback(): void;
6
+ disconnectedCallback(): void;
7
+ }
8
+ //# sourceMappingURL=componentSlice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentSlice.d.ts","sourceRoot":"","sources":["../../src/model/componentSlice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,qBAAa,cAAc,CAAC,CAAC,SAAS,cAAc;aAEvB,SAAS,EAAE,CAAC;gBAAZ,SAAS,EAAE,CAAC;IAKxC,iBAAiB,IAAK,IAAI;IAE1B,oBAAoB,IAAK,IAAI;CAE7B"}
@@ -0,0 +1,10 @@
1
+ export class ComponentSlice {
2
+ constructor(component) {
3
+ this.component = component;
4
+ component.addEventListener('connected', this.connectedCallback.bind(this));
5
+ component.addEventListener('disconnected', this.disconnectedCallback.bind(this));
6
+ }
7
+ connectedCallback() { }
8
+ disconnectedCallback() { }
9
+ }
10
+ //# sourceMappingURL=componentSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentSlice.js","sourceRoot":"","sources":["../../src/model/componentSlice.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,cAAc;IAE1B,YAA4B,SAAY;QAAZ,cAAS,GAAT,SAAS,CAAG;QACvC,SAAS,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3E,SAAS,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,iBAAiB,KAAY,CAAC;IAE9B,oBAAoB,KAAY,CAAC;CAEjC","sourcesContent":["import { OmegaComponent } from \"./component\";\n\nexport class ComponentSlice<T extends OmegaComponent> {\n\n\tconstructor(public readonly component: T) {\n\t\tcomponent.addEventListener('connected', this.connectedCallback.bind(this));\n\t\tcomponent.addEventListener('disconnected', this.disconnectedCallback.bind(this));\n\t}\n\n\tconnectedCallback() : void { }\n\n\tdisconnectedCallback() : void { }\n\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { ComponentFactory, ComponentId } from "../types";
2
+ export declare class ComponentStore<T extends HTMLElement = HTMLElement> {
3
+ readonly factory: ComponentFactory<T>;
4
+ readonly items: Map<ComponentId, T>;
5
+ constructor(factory: ComponentFactory<T>);
6
+ get(id: ComponentId): Promise<T>;
7
+ remove(id: ComponentId): this;
8
+ has(id: ComponentId): boolean;
9
+ clear(): void;
10
+ forEach(callback: (item: T, id: ComponentId) => void): this;
11
+ }
12
+ //# sourceMappingURL=componentStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentStore.d.ts","sourceRoot":"","sources":["../../src/model/componentStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEzD,qBAAa,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW;aAIlC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAFxD,SAAgB,KAAK,sBAA6B;gBAEtB,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAElD,GAAG,CAAC,EAAE,EAAE,WAAW;IAKzB,MAAM,CAAC,EAAE,EAAE,WAAW;IAKtB,GAAG,CAAC,EAAE,EAAE,WAAW;IAInB,KAAK;IAIL,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,KAAK,IAAI;CAKpD"}
@@ -0,0 +1,26 @@
1
+ export class ComponentStore {
2
+ constructor(factory) {
3
+ this.factory = factory;
4
+ this.items = new Map();
5
+ }
6
+ async get(id) {
7
+ if (!this.items.has(id))
8
+ this.items.set(id, await this.factory(id));
9
+ return this.items.get(id);
10
+ }
11
+ remove(id) {
12
+ this.items.delete(id);
13
+ return this;
14
+ }
15
+ has(id) {
16
+ return this.items.has(id);
17
+ }
18
+ clear() {
19
+ this.items.clear();
20
+ }
21
+ forEach(callback) {
22
+ this.items.forEach(callback);
23
+ return this;
24
+ }
25
+ }
26
+ //# sourceMappingURL=componentStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentStore.js","sourceRoot":"","sources":["../../src/model/componentStore.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,cAAc;IAI1B,YAA4B,OAA4B;QAA5B,YAAO,GAAP,OAAO,CAAqB;QAFxC,UAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEU,CAAC;IAE7D,KAAK,CAAC,GAAG,CAAC,EAAe;QACxB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,EAAe;QACrB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,GAAG,CAAC,EAAe;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;IAED,OAAO,CAAC,QAA4C;QACnD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;IACb,CAAC;CAED","sourcesContent":["import { ComponentFactory, ComponentId } from \"../types\";\n\nexport class ComponentStore<T extends HTMLElement = HTMLElement> {\n\n\tpublic readonly items = new Map<ComponentId, T>();\n\n\tconstructor(public readonly factory: ComponentFactory<T>) { }\n\n\tasync get(id: ComponentId) {\n\t\tif (!this.items.has(id)) this.items.set(id, await this.factory(id));\n\t\treturn this.items.get(id);\n\t}\n\n\tremove(id: ComponentId) {\n\t\tthis.items.delete(id);\n\t\treturn this;\n\t}\n\n\thas(id: ComponentId) {\n\t\treturn this.items.has(id);\n\t}\n\n\tclear() {\n\t\tthis.items.clear();\n\t}\n\n\tforEach(callback: (item: T, id: ComponentId) => void) {\n\t\tthis.items.forEach(callback);\n\t\treturn this;\n\t}\n\t\n}"]}
@@ -0,0 +1,6 @@
1
+ export * from './adapter';
2
+ export * from './component';
3
+ export * from './componentStore';
4
+ export * from './componentSlice';
5
+ export * from './plugins';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './adapter';
2
+ export * from './component';
3
+ export * from './componentStore';
4
+ export * from './componentSlice';
5
+ export * from './plugins';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC","sourcesContent":["export * from './adapter';\nexport * from './component';\nexport * from './componentStore';\nexport * from './componentSlice';\nexport * from './plugins';\n"]}
@@ -0,0 +1,13 @@
1
+ export declare abstract class Plugin<T extends HTMLElement> {
2
+ static pluginName: string;
3
+ protected component: T;
4
+ init(component: T): void;
5
+ }
6
+ export declare class Plugins<T extends HTMLElement> {
7
+ readonly component: T;
8
+ readonly plugins: Map<string, Plugin<T>>;
9
+ constructor(component: T);
10
+ get(name: string): Plugin<T>;
11
+ register(plugin: Plugin<T>): this;
12
+ }
13
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/model/plugins.ts"],"names":[],"mappings":"AAEA,8BAAsB,MAAM,CAAC,CAAC,SAAS,WAAW;IAEjD,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC;IAE1B,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC;IAEvB,IAAI,CAAC,SAAS,EAAE,CAAC;CAIjB;AAED,qBAAa,OAAO,CAAC,CAAC,SAAS,WAAW;aAIb,SAAS,EAAE,CAAC;IAFxC,SAAgB,OAAO,yBAAgC;gBAE3B,SAAS,EAAE,CAAC;IAExC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;IAI5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAU1B"}
@@ -0,0 +1,27 @@
1
+ import { getLogger } from "../common/logger";
2
+ export class Plugin {
3
+ init(component) {
4
+ this.component = component;
5
+ }
6
+ }
7
+ export class Plugins {
8
+ constructor(component) {
9
+ this.component = component;
10
+ this.plugins = new Map();
11
+ }
12
+ get(name) {
13
+ return this.plugins.get(name);
14
+ }
15
+ register(plugin) {
16
+ const name = (Object.getPrototypeOf(plugin)).constructor.pluginName;
17
+ if (!name)
18
+ throw new Error('invalid plugin name');
19
+ if (this.plugins.has(name))
20
+ throw new Error('plugin already registered');
21
+ this.plugins.set(name, plugin);
22
+ plugin.init(this.component);
23
+ getLogger('Ωplugins').info(`plugin ${name} registered`);
24
+ return this;
25
+ }
26
+ }
27
+ //# sourceMappingURL=plugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/model/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,OAAgB,MAAM;IAM3B,IAAI,CAAC,SAAY;QAChB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;CAED;AAED,MAAM,OAAO,OAAO;IAInB,YAA4B,SAAY;QAAZ,cAAS,GAAT,SAAS,CAAG;QAFxB,YAAO,GAAG,IAAI,GAAG,EAAqB,CAAC;IAEZ,CAAC;IAE5C,GAAG,CAAC,IAAY;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAc,CAAC;IAC5C,CAAC;IAED,QAAQ,CAAC,MAAiB;QACzB,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC;QACpE,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAClD,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACzE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5B,SAAS,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,aAAa,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACb,CAAC;CAED","sourcesContent":["import { getLogger } from \"../common/logger\";\n\nexport abstract class Plugin<T extends HTMLElement> {\n\n\tstatic pluginName: string;\n\n\tprotected component: T;\n\n\tinit(component: T) {\n\t\tthis.component = component;\n\t}\n\n}\n\nexport class Plugins<T extends HTMLElement> {\n\n\tpublic readonly plugins = new Map<string, Plugin<T>>();\n\n\tconstructor(public readonly component: T) {}\n\n\tget(name: string): Plugin<T> {\n\t\treturn this.plugins.get(name) as Plugin<T>;\n\t}\n\n\tregister(plugin: Plugin<T>) {\n\t\tconst name = (Object.getPrototypeOf(plugin)).constructor.pluginName;\n\t\tif (!name) throw new Error('invalid plugin name');\n\t\tif (this.plugins.has(name)) throw new Error('plugin already registered');\n\t\tthis.plugins.set(name, plugin);\n\t\tplugin.init(this.component);\n\t\tgetLogger('Ωplugins').info(`plugin ${name} registered`);\n\t\treturn this;\n\t}\n\n}"]}
@@ -0,0 +1,4 @@
1
+ import { Theme } from '../../types';
2
+ declare const _default: Theme;
3
+ export default _default;
4
+ //# sourceMappingURL=tmDark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tmDark.d.ts","sourceRoot":"","sources":["../../../src/themes/definitions/tmDark.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;wBA6F/B,KAAK;AA3FV,wBA2FW"}