typecomposer 0.1.26 → 0.1.27

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 (384) hide show
  1. package/core/app/Validate.d.ts +61 -0
  2. package/core/app/Validate.js +2 -0
  3. package/core/app/Validate.js.map +1 -0
  4. package/core/app/index.d.ts +39 -0
  5. package/core/app/index.js +174 -0
  6. package/core/app/index.js.map +1 -0
  7. package/core/components/AlertPanel.d.ts +31 -0
  8. package/core/components/AlertPanel.js +74 -0
  9. package/core/components/AlertPanel.js.map +1 -0
  10. package/core/components/AvatarPanel.d.ts +20 -0
  11. package/core/components/AvatarPanel.js +62 -0
  12. package/core/components/AvatarPanel.js.map +1 -0
  13. package/core/components/BorderPanel.d.ts +27 -0
  14. package/core/components/BorderPanel.js +89 -0
  15. package/core/components/BorderPanel.js.map +1 -0
  16. package/core/components/CardPanel.d.ts +4 -0
  17. package/core/components/CardPanel.js +10 -0
  18. package/core/components/CardPanel.js.map +1 -0
  19. package/core/components/CheckBox.d.ts +34 -0
  20. package/core/components/CheckBox.js +107 -0
  21. package/core/components/CheckBox.js.map +1 -0
  22. package/core/components/ColorPicker.d.ts +9 -0
  23. package/core/components/ColorPicker.js +32 -0
  24. package/core/components/ColorPicker.js.map +1 -0
  25. package/core/components/ContextMenu.d.ts +14 -0
  26. package/core/components/ContextMenu.js +62 -0
  27. package/core/components/ContextMenu.js.map +1 -0
  28. package/core/components/DialogPanel.d.ts +14 -0
  29. package/core/components/DialogPanel.js +62 -0
  30. package/core/components/DialogPanel.js.map +1 -0
  31. package/core/components/DropDown.d.ts +51 -0
  32. package/core/components/DropDown.js +213 -0
  33. package/core/components/DropDown.js.map +1 -0
  34. package/core/components/FlowPanel.d.ts +10 -0
  35. package/core/components/FlowPanel.js +39 -0
  36. package/core/components/FlowPanel.js.map +1 -0
  37. package/core/components/ForEach.d.ts +10 -0
  38. package/core/components/ForEach.js +86 -0
  39. package/core/components/ForEach.js.map +1 -0
  40. package/core/components/GridPanel.d.ts +9 -0
  41. package/core/components/GridPanel.js +29 -0
  42. package/core/components/GridPanel.js.map +1 -0
  43. package/core/components/HBox.d.ts +4 -0
  44. package/core/components/HBox.js +9 -0
  45. package/core/components/HBox.js.map +1 -0
  46. package/core/components/LazyLoading.d.ts +18 -0
  47. package/core/components/LazyLoading.js +35 -0
  48. package/core/components/LazyLoading.js.map +1 -0
  49. package/core/components/ListPanel.d.ts +26 -0
  50. package/core/components/ListPanel.js +152 -0
  51. package/core/components/ListPanel.js.map +1 -0
  52. package/core/components/PopUpButton.d.ts +17 -0
  53. package/core/components/PopUpButton.js +54 -0
  54. package/core/components/PopUpButton.js.map +1 -0
  55. package/core/components/ScrollPanel.d.ts +13 -0
  56. package/core/components/ScrollPanel.js +34 -0
  57. package/core/components/ScrollPanel.js.map +1 -0
  58. package/core/components/StackPanel.d.ts +4 -0
  59. package/core/components/StackPanel.js +9 -0
  60. package/core/components/StackPanel.js.map +1 -0
  61. package/core/components/TabItem.d.ts +18 -0
  62. package/core/components/TabItem.js +81 -0
  63. package/core/components/TabItem.js.map +1 -0
  64. package/core/components/TabPanel.d.ts +24 -0
  65. package/core/components/TabPanel.js +95 -0
  66. package/core/components/TabPanel.js.map +1 -0
  67. package/core/components/TablePanel.d.ts +32 -0
  68. package/core/components/TablePanel.js +125 -0
  69. package/core/components/TablePanel.js.map +1 -0
  70. package/core/components/TextEdit.d.ts +31 -0
  71. package/core/components/TextEdit.js +172 -0
  72. package/core/components/TextEdit.js.map +1 -0
  73. package/core/components/TextField.d.ts +32 -0
  74. package/core/components/TextField.js +147 -0
  75. package/core/components/TextField.js.map +1 -0
  76. package/core/components/ToggleButton.d.ts +6 -0
  77. package/core/components/ToggleButton.js +19 -0
  78. package/core/components/ToggleButton.js.map +1 -0
  79. package/core/components/VBox.d.ts +4 -0
  80. package/core/components/VBox.js +9 -0
  81. package/core/components/VBox.js.map +1 -0
  82. package/core/components/VirtualScroll copy 2.d.ts +24 -0
  83. package/core/components/VirtualScroll copy 2.js +98 -0
  84. package/core/components/VirtualScroll copy 2.js.map +1 -0
  85. package/core/components/VirtualScroll.d.ts +19 -0
  86. package/core/components/VirtualScroll.js +46 -0
  87. package/core/components/VirtualScroll.js.map +1 -0
  88. package/core/components/index.d.ts +26 -0
  89. package/core/components/index.js +28 -0
  90. package/core/components/index.js.map +1 -0
  91. package/core/decorators/RegisterComponent.d.ts +8 -0
  92. package/core/decorators/RegisterComponent.js +5 -0
  93. package/core/decorators/RegisterComponent.js.map +1 -0
  94. package/core/decorators/StyleLink.d.ts +1 -0
  95. package/core/decorators/StyleLink.js +13 -0
  96. package/core/decorators/StyleLink.js.map +1 -0
  97. package/core/decorators/index.d.ts +4 -0
  98. package/core/decorators/index.js +6 -0
  99. package/core/decorators/index.js.map +1 -0
  100. package/core/element/AbbreviationElement.d.ts +6 -0
  101. package/core/element/AbbreviationElement.js +11 -0
  102. package/core/element/AbbreviationElement.js.map +1 -0
  103. package/core/element/AnchorElement.d.ts +23 -0
  104. package/core/element/AnchorElement.js +29 -0
  105. package/core/element/AnchorElement.js.map +1 -0
  106. package/core/element/AreaElement.d.ts +17 -0
  107. package/core/element/AreaElement.js +10 -0
  108. package/core/element/AreaElement.js.map +1 -0
  109. package/core/element/ArticleElement.d.ts +4 -0
  110. package/core/element/ArticleElement.js +11 -0
  111. package/core/element/ArticleElement.js.map +1 -0
  112. package/core/element/AudioElement.d.ts +11 -0
  113. package/core/element/AudioElement.js +9 -0
  114. package/core/element/AudioElement.js.map +1 -0
  115. package/core/element/BaseElement.d.ts +7 -0
  116. package/core/element/BaseElement.js +10 -0
  117. package/core/element/BaseElement.js.map +1 -0
  118. package/core/element/BodyElement.d.ts +4 -0
  119. package/core/element/BodyElement.js +10 -0
  120. package/core/element/BodyElement.js.map +1 -0
  121. package/core/element/BoldElement.d.ts +4 -0
  122. package/core/element/BoldElement.js +9 -0
  123. package/core/element/BoldElement.js.map +1 -0
  124. package/core/element/BreakElement.d.ts +4 -0
  125. package/core/element/BreakElement.js +9 -0
  126. package/core/element/BreakElement.js.map +1 -0
  127. package/core/element/ButtonElement.d.ts +25 -0
  128. package/core/element/ButtonElement.js +46 -0
  129. package/core/element/ButtonElement.js.map +1 -0
  130. package/core/element/CanvasElement.d.ts +4 -0
  131. package/core/element/CanvasElement.js +13 -0
  132. package/core/element/CanvasElement.js.map +1 -0
  133. package/core/element/CaptionElement.d.ts +4 -0
  134. package/core/element/CaptionElement.js +12 -0
  135. package/core/element/CaptionElement.js.map +1 -0
  136. package/core/element/CiteElement.d.ts +4 -0
  137. package/core/element/CiteElement.js +10 -0
  138. package/core/element/CiteElement.js.map +1 -0
  139. package/core/element/CodeElement.d.ts +6 -0
  140. package/core/element/CodeElement.js +12 -0
  141. package/core/element/CodeElement.js.map +1 -0
  142. package/core/element/DataListElement.d.ts +4 -0
  143. package/core/element/DataListElement.js +12 -0
  144. package/core/element/DataListElement.js.map +1 -0
  145. package/core/element/DefinitionDescriptionElement.d.ts +4 -0
  146. package/core/element/DefinitionDescriptionElement.js +12 -0
  147. package/core/element/DefinitionDescriptionElement.js.map +1 -0
  148. package/core/element/DefinitionElement.d.ts +4 -0
  149. package/core/element/DefinitionElement.js +12 -0
  150. package/core/element/DefinitionElement.js.map +1 -0
  151. package/core/element/DeletedTextElement.d.ts +6 -0
  152. package/core/element/DeletedTextElement.js +14 -0
  153. package/core/element/DeletedTextElement.js.map +1 -0
  154. package/core/element/DetailsElement.d.ts +8 -0
  155. package/core/element/DetailsElement.js +27 -0
  156. package/core/element/DetailsElement.js.map +1 -0
  157. package/core/element/DialogElement.d.ts +6 -0
  158. package/core/element/DialogElement.js +13 -0
  159. package/core/element/DialogElement.js.map +1 -0
  160. package/core/element/DivElement.d.ts +4 -0
  161. package/core/element/DivElement.js +9 -0
  162. package/core/element/DivElement.js.map +1 -0
  163. package/core/element/EmElement.d.ts +4 -0
  164. package/core/element/EmElement.js +9 -0
  165. package/core/element/EmElement.js.map +1 -0
  166. package/core/element/EmbedElement.d.ts +9 -0
  167. package/core/element/EmbedElement.js +18 -0
  168. package/core/element/EmbedElement.js.map +1 -0
  169. package/core/element/FieldSetElement.d.ts +8 -0
  170. package/core/element/FieldSetElement.js +33 -0
  171. package/core/element/FieldSetElement.js.map +1 -0
  172. package/core/element/FooterElement.d.ts +4 -0
  173. package/core/element/FooterElement.js +12 -0
  174. package/core/element/FooterElement.js.map +1 -0
  175. package/core/element/FormElement.d.ts +13 -0
  176. package/core/element/FormElement.js +9 -0
  177. package/core/element/FormElement.js.map +1 -0
  178. package/core/element/Fragment.d.ts +33 -0
  179. package/core/element/Fragment.js +146 -0
  180. package/core/element/Fragment.js.map +1 -0
  181. package/core/element/H1Element.d.ts +4 -0
  182. package/core/element/H1Element.js +9 -0
  183. package/core/element/H1Element.js.map +1 -0
  184. package/core/element/H2Element.d.ts +4 -0
  185. package/core/element/H2Element.js +9 -0
  186. package/core/element/H2Element.js.map +1 -0
  187. package/core/element/H3Element.d.ts +4 -0
  188. package/core/element/H3Element.js +9 -0
  189. package/core/element/H3Element.js.map +1 -0
  190. package/core/element/H4Element.d.ts +4 -0
  191. package/core/element/H4Element.js +9 -0
  192. package/core/element/H4Element.js.map +1 -0
  193. package/core/element/H5Element.d.ts +4 -0
  194. package/core/element/H5Element.js +9 -0
  195. package/core/element/H5Element.js.map +1 -0
  196. package/core/element/H6Element.d.ts +4 -0
  197. package/core/element/H6Element.js +9 -0
  198. package/core/element/H6Element.js.map +1 -0
  199. package/core/element/HeadElement.d.ts +4 -0
  200. package/core/element/HeadElement.js +10 -0
  201. package/core/element/HeadElement.js.map +1 -0
  202. package/core/element/HeaderElement.d.ts +4 -0
  203. package/core/element/HeaderElement.js +12 -0
  204. package/core/element/HeaderElement.js.map +1 -0
  205. package/core/element/HorizontalRuleElement.d.ts +4 -0
  206. package/core/element/HorizontalRuleElement.js +12 -0
  207. package/core/element/HorizontalRuleElement.js.map +1 -0
  208. package/core/element/HtmlElement.d.ts +8 -0
  209. package/core/element/HtmlElement.js +18 -0
  210. package/core/element/HtmlElement.js.map +1 -0
  211. package/core/element/IFrameElement.d.ts +27 -0
  212. package/core/element/IFrameElement.js +66 -0
  213. package/core/element/IFrameElement.js.map +1 -0
  214. package/core/element/ILayout.d.ts +4 -0
  215. package/core/element/ILayout.js +8 -0
  216. package/core/element/ILayout.js.map +1 -0
  217. package/core/element/IconElement.d.ts +13 -0
  218. package/core/element/IconElement.js +31 -0
  219. package/core/element/IconElement.js.map +1 -0
  220. package/core/element/ImageElement.d.ts +18 -0
  221. package/core/element/ImageElement.js +16 -0
  222. package/core/element/ImageElement.js.map +1 -0
  223. package/core/element/InputElement.d.ts +37 -0
  224. package/core/element/InputElement.js +81 -0
  225. package/core/element/InputElement.js.map +1 -0
  226. package/core/element/LabelElement.d.ts +7 -0
  227. package/core/element/LabelElement.js +9 -0
  228. package/core/element/LabelElement.js.map +1 -0
  229. package/core/element/LegendElement.d.ts +6 -0
  230. package/core/element/LegendElement.js +14 -0
  231. package/core/element/LegendElement.js.map +1 -0
  232. package/core/element/ListItemElement.d.ts +11 -0
  233. package/core/element/ListItemElement.js +27 -0
  234. package/core/element/ListItemElement.js.map +1 -0
  235. package/core/element/MainElement.d.ts +4 -0
  236. package/core/element/MainElement.js +9 -0
  237. package/core/element/MainElement.js.map +1 -0
  238. package/core/element/NavElement.d.ts +4 -0
  239. package/core/element/NavElement.js +9 -0
  240. package/core/element/NavElement.js.map +1 -0
  241. package/core/element/OrderedListElement.d.ts +4 -0
  242. package/core/element/OrderedListElement.js +9 -0
  243. package/core/element/OrderedListElement.js.map +1 -0
  244. package/core/element/ParagraphElement.d.ts +4 -0
  245. package/core/element/ParagraphElement.js +9 -0
  246. package/core/element/ParagraphElement.js.map +1 -0
  247. package/core/element/PreElement.d.ts +4 -0
  248. package/core/element/PreElement.js +9 -0
  249. package/core/element/PreElement.js.map +1 -0
  250. package/core/element/SectionElement.d.ts +4 -0
  251. package/core/element/SectionElement.js +11 -0
  252. package/core/element/SectionElement.js.map +1 -0
  253. package/core/element/SelectElement.d.ts +4 -0
  254. package/core/element/SelectElement.js +11 -0
  255. package/core/element/SelectElement.js.map +1 -0
  256. package/core/element/SourceElement.d.ts +7 -0
  257. package/core/element/SourceElement.js +13 -0
  258. package/core/element/SourceElement.js.map +1 -0
  259. package/core/element/SpanElement.d.ts +4 -0
  260. package/core/element/SpanElement.js +9 -0
  261. package/core/element/SpanElement.js.map +1 -0
  262. package/core/element/StrongElement.d.ts +4 -0
  263. package/core/element/StrongElement.js +11 -0
  264. package/core/element/StrongElement.js.map +1 -0
  265. package/core/element/StyleElement.d.ts +4 -0
  266. package/core/element/StyleElement.js +9 -0
  267. package/core/element/StyleElement.js.map +1 -0
  268. package/core/element/SummaryElement.d.ts +4 -0
  269. package/core/element/SummaryElement.js +11 -0
  270. package/core/element/SummaryElement.js.map +1 -0
  271. package/core/element/SvgElement.d.ts +17 -0
  272. package/core/element/SvgElement.js +149 -0
  273. package/core/element/SvgElement.js.map +1 -0
  274. package/core/element/TableBodyElement.d.ts +4 -0
  275. package/core/element/TableBodyElement.js +9 -0
  276. package/core/element/TableBodyElement.js.map +1 -0
  277. package/core/element/TableCellElement.d.ts +9 -0
  278. package/core/element/TableCellElement.js +24 -0
  279. package/core/element/TableCellElement.js.map +1 -0
  280. package/core/element/TableColElement.d.ts +6 -0
  281. package/core/element/TableColElement.js +12 -0
  282. package/core/element/TableColElement.js.map +1 -0
  283. package/core/element/TableColGroupElement.d.ts +6 -0
  284. package/core/element/TableColGroupElement.js +14 -0
  285. package/core/element/TableColGroupElement.js.map +1 -0
  286. package/core/element/TableElement.d.ts +44 -0
  287. package/core/element/TableElement.js +227 -0
  288. package/core/element/TableElement.js.map +1 -0
  289. package/core/element/TableFootElement.d.ts +4 -0
  290. package/core/element/TableFootElement.js +9 -0
  291. package/core/element/TableFootElement.js.map +1 -0
  292. package/core/element/TableFootRowElement.d.ts +8 -0
  293. package/core/element/TableFootRowElement.js +22 -0
  294. package/core/element/TableFootRowElement.js.map +1 -0
  295. package/core/element/TableHeadCellElement.d.ts +9 -0
  296. package/core/element/TableHeadCellElement.js +23 -0
  297. package/core/element/TableHeadCellElement.js.map +1 -0
  298. package/core/element/TableHeadElement.d.ts +4 -0
  299. package/core/element/TableHeadElement.js +9 -0
  300. package/core/element/TableHeadElement.js.map +1 -0
  301. package/core/element/TableHeadRowElement.d.ts +10 -0
  302. package/core/element/TableHeadRowElement.js +28 -0
  303. package/core/element/TableHeadRowElement.js.map +1 -0
  304. package/core/element/TableRowElement.d.ts +10 -0
  305. package/core/element/TableRowElement.js +28 -0
  306. package/core/element/TableRowElement.js.map +1 -0
  307. package/core/element/TextAreaElement.d.ts +6 -0
  308. package/core/element/TextAreaElement.js +9 -0
  309. package/core/element/TextAreaElement.js.map +1 -0
  310. package/core/element/UListElement.d.ts +4 -0
  311. package/core/element/UListElement.js +9 -0
  312. package/core/element/UListElement.js.map +1 -0
  313. package/core/element/VideoElement.d.ts +12 -0
  314. package/core/element/VideoElement.js +15 -0
  315. package/core/element/VideoElement.js.map +1 -0
  316. package/core/element/index.d.ts +71 -0
  317. package/core/element/index.js +72 -0
  318. package/core/element/index.js.map +1 -0
  319. package/core/event/index.d.ts +16 -0
  320. package/core/event/index.js +75 -0
  321. package/core/event/index.js.map +1 -0
  322. package/core/index.d.ts +9 -0
  323. package/core/index.js +10 -0
  324. package/core/index.js.map +1 -0
  325. package/core/ref/RefBoolean.d.ts +26 -0
  326. package/core/ref/RefBoolean.js +58 -0
  327. package/core/ref/RefBoolean.js.map +1 -0
  328. package/core/ref/RefContainer.d.ts +25 -0
  329. package/core/ref/RefContainer.js +105 -0
  330. package/core/ref/RefContainer.js.map +1 -0
  331. package/core/ref/RefList.d.ts +51 -0
  332. package/core/ref/RefList.js +155 -0
  333. package/core/ref/RefList.js.map +1 -0
  334. package/core/ref/RefMap.d.ts +25 -0
  335. package/core/ref/RefMap.js +71 -0
  336. package/core/ref/RefMap.js.map +1 -0
  337. package/core/ref/RefNumber.d.ts +30 -0
  338. package/core/ref/RefNumber.js +69 -0
  339. package/core/ref/RefNumber.js.map +1 -0
  340. package/core/ref/RefObject.d.ts +30 -0
  341. package/core/ref/RefObject.js +211 -0
  342. package/core/ref/RefObject.js.map +1 -0
  343. package/core/ref/RefProperty.d.ts +3 -0
  344. package/core/ref/RefProperty.js +46 -0
  345. package/core/ref/RefProperty.js.map +1 -0
  346. package/core/ref/RefSet.d.ts +25 -0
  347. package/core/ref/RefSet.js +72 -0
  348. package/core/ref/RefSet.js.map +1 -0
  349. package/core/ref/RefState.d.ts +23 -0
  350. package/core/ref/RefState.js +79 -0
  351. package/core/ref/RefState.js.map +1 -0
  352. package/core/ref/RefString.d.ts +75 -0
  353. package/core/ref/RefString.js +202 -0
  354. package/core/ref/RefString.js.map +1 -0
  355. package/core/ref/index.d.ts +21 -0
  356. package/core/ref/index.js +64 -0
  357. package/core/ref/index.js.map +1 -0
  358. package/core/router/RouteView.d.ts +19 -0
  359. package/core/router/RouteView.js +75 -0
  360. package/core/router/RouteView.js.map +1 -0
  361. package/core/router/Router.d.ts +70 -0
  362. package/core/router/Router.js +287 -0
  363. package/core/router/Router.js.map +1 -0
  364. package/core/router/RouterEvent.d.ts +36 -0
  365. package/core/router/RouterEvent.js +43 -0
  366. package/core/router/RouterEvent.js.map +1 -0
  367. package/core/router/RouterGuard.d.ts +12 -0
  368. package/core/router/RouterGuard.js +3 -0
  369. package/core/router/RouterGuard.js.map +1 -0
  370. package/core/router/index.d.ts +4 -0
  371. package/core/router/index.js +5 -0
  372. package/core/router/index.js.map +1 -0
  373. package/core/styles/index.d.ts +97 -0
  374. package/core/styles/index.js +36 -0
  375. package/core/styles/index.js.map +1 -0
  376. package/global/index.d.ts +79 -0
  377. package/global/index.js +931 -0
  378. package/global/index.js.map +1 -0
  379. package/global/safari-polyfill.d.ts +0 -0
  380. package/global/safari-polyfill.js +234 -0
  381. package/global/safari-polyfill.js.map +1 -0
  382. package/index.d.ts +3 -0
  383. package/index.js.map +1 -0
  384. package/package.json +7 -3
@@ -0,0 +1,287 @@
1
+ import { App } from "../../";
2
+ function getRoutePairs(routes, basePath = '', parentRouters = []) {
3
+ let result = [];
4
+ for (const route of routes) {
5
+ const fullPath = `${basePath}/${route.path}`.replace(/\/+/g, '/');
6
+ const routers = [...parentRouters];
7
+ if (route.component || route.redirect) {
8
+ // @ts-ignore
9
+ routers.push({ component: route.component, path: route.path, id: route.id, guard: route.guard, redirect: route.redirect, title: route.title });
10
+ }
11
+ result.push({ path: fullPath, routers });
12
+ if (route.children) {
13
+ result = result.concat(getRoutePairs(route.children, fullPath, routers));
14
+ }
15
+ }
16
+ return result;
17
+ }
18
+ function matchRoute(url, routes) {
19
+ let bestMatch = null;
20
+ for (const route of routes) {
21
+ const routeRegex = new RegExp(`^${route.path
22
+ .replace(/\*\*/g, '.*')
23
+ .replace(/\*/g, '[^/]+')
24
+ .replace(/:[^\s/]+/g, '([^/]+)')}$`);
25
+ const match = url.match(routeRegex);
26
+ if (match || route.path === `/${Router.PATH_WILDCARD}`) {
27
+ const params = {};
28
+ const paramKeys = route.path.match(/:[^\s/]+/g);
29
+ if (paramKeys) {
30
+ paramKeys.forEach((key, index) => {
31
+ params[key.replace(':', '')] = match[index + 1];
32
+ });
33
+ }
34
+ if (!bestMatch || route.path.length > bestMatch.path.length) {
35
+ bestMatch = {
36
+ path: route.path,
37
+ // @ts-ignore
38
+ routers: route.routers.map((route) => {
39
+ // @ts-ignore
40
+ return { component: route.component, path: route.path, id: route.id, guard: route.guard, title: route.title, redirect: route.redirect, build: undefined };
41
+ }),
42
+ params,
43
+ };
44
+ }
45
+ }
46
+ }
47
+ if (bestMatch)
48
+ bestMatch.url = url;
49
+ return bestMatch;
50
+ }
51
+ function pageNotFound() {
52
+ const body = document.createElement("div");
53
+ body.style.width = "100vw";
54
+ body.style.height = "100vh";
55
+ body.style.display = "flex";
56
+ body.style.flexDirection = "column";
57
+ body.style.justifyContent = "center";
58
+ body.style.alignItems = "center";
59
+ body.style.overflow = "hidden";
60
+ body.style.position = "fixed";
61
+ body.innerHTML =
62
+ "<div style='text-align: center;'>" +
63
+ "<h1 style='text-shadow: 0 3px 0px $color-base, 0 6px 0px #333; color: #f54f59; font-size: 6em; font-weight: 700; line-height: 0.6em;'>404</h1>" +
64
+ "<h1 style='text-shadow: 0 3px 0px $color-base, 0 6px 0px #333; color: #f54f59; font-size: 10; font-weight: 15; line-height: 0.6em;'>Page not found</h1>" +
65
+ "</div>";
66
+ return body;
67
+ }
68
+ export class Router {
69
+ static #router;
70
+ #history;
71
+ #props = {};
72
+ routes = [];
73
+ url = window.location.pathname;
74
+ urlValid = "";
75
+ pageNotFound;
76
+ match = null;
77
+ /**
78
+ * @param data - An array of route objects.
79
+ * @param history - The type of history to use. Can be either "hash" or "history".
80
+ */
81
+ static SEGMENT_WILDCARD = "*";
82
+ /**
83
+ * @param data - An array of route objects.
84
+ * @param history - The type of history to use. Can be either "hash" or "history".
85
+ * @returns {void}
86
+ */
87
+ static PATH_WILDCARD = "**";
88
+ beforeEach = () => { };
89
+ constructor(data, history, pageNotFound) {
90
+ if (Router.#router)
91
+ throw new Error("Router already exists");
92
+ Router.#router = this;
93
+ this.#history = history;
94
+ if (this.#history === "hash") {
95
+ if (!window.location.pathname.startsWith("/#/")) {
96
+ if (window.location.pathname === "/") {
97
+ window.history.replaceState({}, "", "/#/");
98
+ }
99
+ else {
100
+ window.history.replaceState({}, "", "/#" + window.location.pathname);
101
+ }
102
+ }
103
+ }
104
+ this.pageNotFound = pageNotFound;
105
+ this.createAutoId(data, 0);
106
+ this.routes = getRoutePairs(data);
107
+ window.addEventListener(history == "history" ? "popstate" : "hashchange", () => this.handleRoute());
108
+ this.handleRoute();
109
+ }
110
+ createAutoId(routes = [], id) {
111
+ for (const route of routes) {
112
+ route["id"] = `${route.path}_${++id}`;
113
+ if (route.children) {
114
+ id = this.createAutoId(route.children, id);
115
+ }
116
+ }
117
+ return id;
118
+ }
119
+ getQueryParams(url) {
120
+ const queryParams = {};
121
+ const queryString = url.split('?')[1];
122
+ if (queryString) {
123
+ const pairs = queryString.split('&');
124
+ for (const pair of pairs) {
125
+ const [key, value] = pair.split('=');
126
+ queryParams[decodeURIComponent(key)] = decodeURIComponent(value || '');
127
+ }
128
+ }
129
+ return queryParams;
130
+ }
131
+ handleRoute() {
132
+ const url = this.#history === "hash" ? window.location.hash : window.location.pathname || "/";
133
+ this.url = url;
134
+ if (this.#history === "hash")
135
+ this.url = this.url.replace(/^#\//, "/");
136
+ this.#props = this.getQueryParams(this.url);
137
+ this.buildRoutePage(matchRoute(this.url.split('?')[0], this.routes));
138
+ }
139
+ async buildRoutePage(match) {
140
+ let title = "";
141
+ if (!match || !match.routers.length) {
142
+ App.setPage(this.pageNotFound ? new this.pageNotFound() : pageNotFound());
143
+ this.match = null;
144
+ }
145
+ else {
146
+ if (!await this.checkGuard(match))
147
+ return;
148
+ if (this.match) {
149
+ for (let i = 0; i < match.routers.length; i++) {
150
+ if (!this.match?.routers[i]?.id)
151
+ break;
152
+ const route = match.routers[i];
153
+ if (route.id == this.match?.routers[i]?.id) {
154
+ route.build = this.match.routers[i].build;
155
+ }
156
+ }
157
+ }
158
+ for (let i = 0; i < match.routers.length; i++) {
159
+ const route = match.routers[i];
160
+ if (route.redirect) {
161
+ this.match = null;
162
+ Router.go(route.redirect);
163
+ return;
164
+ }
165
+ if (route.title)
166
+ title = route.title;
167
+ route.parent = i == 0 ? undefined : match.routers[i - 1];
168
+ }
169
+ const buildRoot = match.routers[0];
170
+ this.match = match;
171
+ if (!buildRoot.build) {
172
+ buildRoot.build = App.setPage(new buildRoot.component);
173
+ }
174
+ }
175
+ if (title)
176
+ document.title = title;
177
+ this.beforeEach(match);
178
+ document.body.emitEvent("router:watch", { url: this.url, props: this.#props });
179
+ }
180
+ async checkGuard(match) {
181
+ const guards = match.routers.map((route) => route.guard).filter(Boolean);
182
+ let result = true;
183
+ for await (const guard of guards) {
184
+ const primose = new Promise((resolve) => {
185
+ const response = {
186
+ path: match.url,
187
+ params: match.params,
188
+ query: this.#props,
189
+ redirect: (path) => {
190
+ resolve(path);
191
+ },
192
+ resolve: () => {
193
+ resolve(true);
194
+ },
195
+ break: () => {
196
+ resolve(false);
197
+ },
198
+ reject: () => {
199
+ resolve(false);
200
+ }
201
+ };
202
+ guard.beforeEach(response);
203
+ });
204
+ result = await primose;
205
+ if (typeof result === "string") {
206
+ Router.go(result);
207
+ return false;
208
+ }
209
+ }
210
+ if (result)
211
+ this.urlValid = match.url;
212
+ else
213
+ Router.go(Router.#router?.urlValid);
214
+ return result === true;
215
+ }
216
+ static create(data) {
217
+ Router.#router = new Router(data.routes, data.history || "history", data.pageNotFound);
218
+ }
219
+ static reload() {
220
+ if (Router.#router) {
221
+ Router.#router.match = null;
222
+ Router.#router.handleRoute();
223
+ }
224
+ else
225
+ window.location.reload();
226
+ }
227
+ static get props() {
228
+ if (window.location.hash) {
229
+ const hashParts = window.location.hash.split('?');
230
+ if (hashParts.length > 1) {
231
+ const hashParams = new URLSearchParams(hashParts[1]);
232
+ const props = {};
233
+ for (const [key, value] of hashParams) {
234
+ props[key] = value;
235
+ }
236
+ return props;
237
+ }
238
+ }
239
+ else {
240
+ const searchParams = new URLSearchParams(window.location.search);
241
+ const props = {};
242
+ for (const [key, value] of searchParams) {
243
+ props[key] = value;
244
+ }
245
+ return props;
246
+ }
247
+ return {};
248
+ }
249
+ static get history() {
250
+ return Router.#router.#history;
251
+ }
252
+ static buildURL(baseUrl, parametros) {
253
+ const queryString = Object.keys(parametros)
254
+ .map((key) => encodeURIComponent(key) + "=" + encodeURIComponent(parametros[key]))
255
+ .join("&");
256
+ return baseUrl + (queryString ? "?" + queryString : "");
257
+ }
258
+ static async go(url, props) {
259
+ if (!url)
260
+ return;
261
+ if (!url.startsWith("/"))
262
+ url = "/" + url;
263
+ const newUrl = Router.buildURL(url, props || {});
264
+ if (Router.#router.#history === "history")
265
+ history.pushState(props || {}, "", newUrl);
266
+ else
267
+ window.location.hash = newUrl;
268
+ Router.#router?.handleRoute();
269
+ }
270
+ static back() {
271
+ window.history.back();
272
+ }
273
+ static forward() {
274
+ window.history.forward();
275
+ }
276
+ static getRouteViewFree(routeView) {
277
+ if (!Router.#router || !Router.#router.match)
278
+ return undefined;
279
+ const { routers } = Router.#router.match;
280
+ const route = routers.find((route) => (!route.routeView || route.routeView === routeView) && route.parent);
281
+ if (!route)
282
+ return undefined;
283
+ route.routeView = routeView;
284
+ return route;
285
+ }
286
+ }
287
+ //# sourceMappingURL=Router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Router.js","sourceRoot":"","sources":["../../../src/core/router/Router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAyB,MAAM,QAAQ,CAAC;AA0BpD,SAAS,aAAa,CACpB,MAAmB,EACnB,QAAQ,GAAG,EAAE,EACb,gBAAyE,EAAE;IAE3E,IAAI,MAAM,GAAkB,EAAE,CAAC;IAE/B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,GAAG,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAElE,MAAM,OAAO,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC;QACnC,IAAI,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACtC,aAAa;YACb,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QACjJ,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QAEzC,IAAI,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AAE,MAAM,CAAC,CAAC;;YACjF,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,MAAM,CAAC;QACnC,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE,CAAC;IAChC,CAAC;IAEM,MAAM,CAAC,IAAI;QAChB,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;IAEM,MAAM,CAAC,OAAO;QACnB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAEO,MAAM,CAAC,gBAAgB,CAAC,SAAoB;QAClD,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAC/D,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QACzC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;QAC3G,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAC7B,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;QAC5B,OAAO,KAAK,CAAC;IACf,CAAC"}
@@ -0,0 +1,36 @@
1
+ export declare class RouterEvent {
2
+ /**
3
+ * This event is triggered before leaving the current route. It is useful for
4
+ * carrying out specific checks or actions before allowing the user to leave
5
+ * the current page.
6
+ * @param to
7
+ * @param from
8
+ * @param next
9
+ */
10
+ beforeRouteLeave(to: any, from: any, next: any): void;
11
+ /**
12
+ * This event is triggered before entering the new route. It is useful for carrying
13
+ * out data uploads or other necessary tasks before fully entering the new route
14
+ * @param to
15
+ * @param from
16
+ * @param next
17
+ */
18
+ beforeRouteEnter(to: any, from: any, next: any): void;
19
+ /**
20
+ * This event is triggered when the route is about to be updated, but the current
21
+ * route still remains active. It is useful for carrying out specific actions when
22
+ * the route is changing but the component is still in use.
23
+ * @param to
24
+ * @param from
25
+ * @param next
26
+ * @returns
27
+ */
28
+ beforeRouteUpdate(to: any, from: any, next: any): void;
29
+ /**
30
+ * This event is triggered after the route has been updated. It is useful for
31
+ * carrying out specific actions after the route has been updated.
32
+ * @param to
33
+ * @param from
34
+ */
35
+ afterEach(to: any, from: any): void;
36
+ }
@@ -0,0 +1,43 @@
1
+ export class RouterEvent {
2
+ /**
3
+ * This event is triggered before leaving the current route. It is useful for
4
+ * carrying out specific checks or actions before allowing the user to leave
5
+ * the current page.
6
+ * @param to
7
+ * @param from
8
+ * @param next
9
+ */
10
+ beforeRouteLeave(to, from, next) {
11
+ next();
12
+ }
13
+ /**
14
+ * This event is triggered before entering the new route. It is useful for carrying
15
+ * out data uploads or other necessary tasks before fully entering the new route
16
+ * @param to
17
+ * @param from
18
+ * @param next
19
+ */
20
+ beforeRouteEnter(to, from, next) {
21
+ next();
22
+ }
23
+ /**
24
+ * This event is triggered when the route is about to be updated, but the current
25
+ * route still remains active. It is useful for carrying out specific actions when
26
+ * the route is changing but the component is still in use.
27
+ * @param to
28
+ * @param from
29
+ * @param next
30
+ * @returns
31
+ */
32
+ beforeRouteUpdate(to, from, next) {
33
+ next();
34
+ }
35
+ /**
36
+ * This event is triggered after the route has been updated. It is useful for
37
+ * carrying out specific actions after the route has been updated.
38
+ * @param to
39
+ * @param from
40
+ */
41
+ afterEach(to, from) { }
42
+ }
43
+ //# sourceMappingURL=RouterEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouterEvent.js","sourceRoot":"","sources":["../../../src/core/router/RouterEvent.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAW;IACtB;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAO,EAAE,IAAS,EAAE,IAAS;QAC5C,IAAI,EAAE,CAAC;IACT,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAO,EAAE,IAAS,EAAE,IAAS;QAC5C,IAAI,EAAE,CAAC;IACT,CAAC;IAED;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAO,EAAE,IAAS,EAAE,IAAS;QAC7C,IAAI,EAAE,CAAC;IACT,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,EAAO,EAAE,IAAS,IAAG,CAAC;CACjC"}
@@ -0,0 +1,12 @@
1
+ export interface GuardResponse {
2
+ redirect(path: string): void;
3
+ resolve(): void;
4
+ break(): void;
5
+ reject(): void;
6
+ readonly path: string;
7
+ readonly params: Record<string, string>;
8
+ readonly query: Record<string, string>;
9
+ }
10
+ export declare abstract class RouterGuard {
11
+ abstract beforeEach(response: GuardResponse): void;
12
+ }
@@ -0,0 +1,3 @@
1
+ export class RouterGuard {
2
+ }
3
+ //# sourceMappingURL=RouterGuard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouterGuard.js","sourceRoot":"","sources":["../../../src/core/router/RouterGuard.ts"],"names":[],"mappings":"AAWA,MAAM,OAAgB,WAAW;CAIhC"}
@@ -0,0 +1,4 @@
1
+ export { RouteView } from "./RouteView";
2
+ export { Router } from "./Router";
3
+ export { RouterGuard, type GuardResponse } from "./RouterGuard";
4
+ export { RouterEvent } from "./RouterEvent";
@@ -0,0 +1,5 @@
1
+ export { RouteView } from "./RouteView";
2
+ export { Router } from "./Router";
3
+ export { RouterGuard } from "./RouterGuard";
4
+ export { RouterEvent } from "./RouterEvent";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAsB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,97 @@
1
+ import { ref, refBoolean, refNumber, refString } from "../";
2
+ import type * as CSS from "csstype";
3
+ export type Variant = "default" | "outline" | "solo" | "standard" | "underlined";
4
+ export type StyleProperties = {
5
+ [K in keyof CSS.Properties]?: CSS.Properties[K] | ref<CSS.Properties[K]> | ref<string>;
6
+ } & {
7
+ [K in keyof CSS.PropertiesHyphen]?: CSS.PropertiesHyphen[K] | ref<CSS.PropertiesHyphen[K]> | ref<string>;
8
+ };
9
+ interface ComponentPropsMethods {
10
+ id?: refString;
11
+ title?: refString;
12
+ className?: refString;
13
+ text?: refString | refNumber | refBoolean;
14
+ html?: refString | refNumber | refBoolean;
15
+ readOnly?: refBoolean;
16
+ hidden?: refBoolean;
17
+ variant?: refString;
18
+ itemLoading?: boolean;
19
+ disabled?: refBoolean;
20
+ children?: (IComponent | null | undefined)[];
21
+ innerHTML?: refString | refNumber | refBoolean | IComponent;
22
+ innerText?: refString | refNumber | refBoolean | IComponent;
23
+ onclick?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
24
+ onchange?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
25
+ oninput?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
26
+ onfocus?: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
27
+ onblur?: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
28
+ onmouseover?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
29
+ onmouseout?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
30
+ onmouseenter?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
31
+ onmouseleave?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
32
+ onmousedown?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
33
+ onmouseup?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
34
+ onkeydown?: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
35
+ onkeyup?: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
36
+ onkeypress?: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
37
+ ondblclick?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
38
+ oncontextmenu?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
39
+ oncopy?: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
40
+ oncut?: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
41
+ onpaste?: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
42
+ onabort?: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
43
+ onauxclick?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
44
+ onbeforeinput?: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
45
+ oncanplay?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
46
+ oncanplaythrough?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
47
+ oncuechange?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
48
+ ondurationchange?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
49
+ onemptied?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
50
+ onended?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
51
+ onerror?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
52
+ onformdata?: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
53
+ onload?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
54
+ onloadeddata?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
55
+ onloadedmetadata?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
56
+ onloadstart?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
57
+ onpause?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
58
+ onplay?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
59
+ onplaying?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
60
+ onprogress?: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
61
+ onratechange?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
62
+ onreset?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
63
+ onresize?: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
64
+ onscroll?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
65
+ onsecuritypolicyviolation?: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
66
+ onstalled?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
67
+ onsuspend?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
68
+ ontimeupdate?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
69
+ ontoggle?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
70
+ onvolumechange?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
71
+ onwaiting?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
72
+ onwheel?: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
73
+ ondrag?: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
74
+ ondragend?: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
75
+ ondragenter?: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
76
+ ondragleave?: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
77
+ ondragover?: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
78
+ ondragstart?: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
79
+ ondrop?: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
80
+ }
81
+ export type ComponentProps = StyleProperties & ComponentPropsMethods;
82
+ interface StylePropertiesMethods {
83
+ /** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyPriority) */
84
+ getPropertyPriority(property: string): refString;
85
+ /** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyValue) */
86
+ getPropertyValue(property: string): refString;
87
+ /** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/item) */
88
+ item(index: number): refString;
89
+ /** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/removeProperty) */
90
+ removeProperty(property: string): refString;
91
+ /** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/setProperty) */
92
+ setProperty(property: string, value: refString | null, priority?: string): void;
93
+ [index: number]: refString;
94
+ hasOwnProperty(key: string): boolean;
95
+ }
96
+ export type CSSStyleDeclarationRef = StyleProperties & StylePropertiesMethods;
97
+ export {};
@@ -0,0 +1,36 @@
1
+ import { Component, ref } from "../";
2
+ const removePropertyOriginal = CSSStyleDeclaration.prototype.removeProperty;
3
+ Object.defineProperty(CSSStyleDeclaration.prototype, "removeProperty", {
4
+ value: function (property) {
5
+ removePropertyOriginal.call(this, property);
6
+ },
7
+ writable: true,
8
+ configurable: true,
9
+ });
10
+ const setPropertyOriginal = CSSStyleDeclaration.prototype.setProperty;
11
+ Object.defineProperty(CSSStyleDeclaration.prototype, "setProperty", {
12
+ value: function (property, value, priority) {
13
+ if (value instanceof ref)
14
+ value.subscribe(this, property);
15
+ else
16
+ setPropertyOriginal.call(this, property, value, priority);
17
+ },
18
+ writable: true,
19
+ configurable: true,
20
+ });
21
+ Object.defineProperty(CSSStyleDeclaration.prototype, "hasOwnProperty", {
22
+ value: function (key) {
23
+ return Object.prototype.hasOwnProperty.call(this, key);
24
+ },
25
+ writable: true,
26
+ configurable: true,
27
+ });
28
+ const originalCreateElement = Document.prototype.createElement;
29
+ Object.defineProperty(Document.prototype, "createElement", {
30
+ value: function (tagName) {
31
+ const element = originalCreateElement.call(this, tagName);
32
+ Component.applyProps(element, {});
33
+ return element;
34
+ },
35
+ });
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/styles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAoC,MAAM,KAAK,CAAC;AA0GvE,MAA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CAAC,IAAI,EAAE,OAAO,CAAgB,CAAC;QACzE,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { ComponentProps, ref, StyleProperties } from "../";
2
+ export declare class Component extends HTMLElement implements IComponent {
3
+ constructor(props?: ComponentProps);
4
+ static applyProps<T extends HTMLElement>(element: T, props?: ComponentProps): Promise<void>;
5
+ static createElement(html: string): HTMLElement;
6
+ }
7
+ export interface HTMLComponent {
8
+ style?: StyleProperties;
9
+ ref?: HTMLElement;
10
+ children?: HTMLElement[];
11
+ className?: string | ref<string>;
12
+ onabort?: (event: UIEvent) => void;
13
+ onauxclick?: (event: MouseEvent) => void;
14
+ onbeforeinput?: (event: InputEvent) => void;
15
+ onblur?: (event: FocusEvent) => void;
16
+ oncanplay?: (event: Event) => void;
17
+ oncanplaythrough?: (event: Event) => void;
18
+ onchange?: (event: Event) => void;
19
+ onclick?: (event: MouseEvent) => void;
20
+ onclose?: (event: Event) => void;
21
+ oncontextmenu?: (event: MouseEvent) => void;
22
+ oncopy?: (event: ClipboardEvent) => void;
23
+ oncuechange?: (event: Event) => void;
24
+ oncut?: (event: ClipboardEvent) => void;
25
+ ondblclick?: (event: MouseEvent) => void;
26
+ ondrag?: (event: DragEvent) => void;
27
+ ondragend?: (event: DragEvent) => void;
28
+ ondragenter?: (event: DragEvent) => void;
29
+ ondragleave?: (event: DragEvent) => void;
30
+ ondragover?: (event: DragEvent) => void;
31
+ ondragstart?: (event: DragEvent) => void;
32
+ ondrop?: (event: DragEvent) => void;
33
+ ondurationchange?: (event: Event) => void;
34
+ onemptied?: (event: Event) => void;
35
+ onended?: (event: Event) => void;
36
+ onerror?: (event: Event) => void;
37
+ onfocus?: (event: FocusEvent) => void;
38
+ onformdata?: (event: FormDataEvent) => void;
39
+ oninput?: (event: InputEvent) => void;
40
+ oninvalid?: (event: Event) => void;
41
+ onkeydown?: (event: KeyboardEvent) => void;
42
+ onkeypress?: (event: KeyboardEvent) => void;
43
+ onkeyup?: (event: KeyboardEvent) => void;
44
+ onload?: (event: Event) => void;
45
+ onloadeddata?: (event: Event) => void;
46
+ onloadedmetadata?: (event: Event) => void;
47
+ onloadstart?: (event: Event) => void;
48
+ onmousedown?: (event: MouseEvent) => void;
49
+ onmouseenter?: (event: MouseEvent) => void;
50
+ onmouseleave?: (event: MouseEvent) => void;
51
+ onmousemove?: (event: MouseEvent) => void;
52
+ onmouseout?: (event: MouseEvent) => void;
53
+ onmouseover?: (event: MouseEvent) => void;
54
+ onmouseup?: (event: MouseEvent) => void;
55
+ onpaste?: (event: ClipboardEvent) => void;
56
+ onpause?: (event: Event) => void;
57
+ onplay?: (event: Event) => void;
58
+ onplaying?: (event: Event) => void;
59
+ onprogress?: (event: ProgressEvent) => void;
60
+ onratechange?: (event: Event) => void;
61
+ onreset?: (event: Event) => void;
62
+ onresize?: (event: UIEvent) => void;
63
+ onscroll?: (event: Event) => void;
64
+ onsecuritypolicyviolation?: (event: SecurityPolicyViolationEvent) => void;
65
+ onseeked?: (event: Event) => void;
66
+ onseeking?: (event: Event) => void;
67
+ onselect?: (event: Event) => void;
68
+ onslotchange?: (event: Event) => void;
69
+ onstalled?: (event: Event) => void;
70
+ onsubmit?: (event: SubmitEvent) => void;
71
+ onsuspend?: (event: Event) => void;
72
+ ontimeupdate?: (event: Event) => void;
73
+ ontoggle?: (event: Event) => void;
74
+ onvolumechange?: (event: Event) => void;
75
+ onwaiting?: (event: Event) => void;
76
+ onwheel?: (event: WheelEvent) => void;
77
+ [key: string]: any;
78
+ }
79
+ export {};