native-document 1.0.165 → 1.0.166

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 (398) hide show
  1. package/components.d.ts +2 -0
  2. package/devtools/widget.js +1 -1
  3. package/dist/native-document.components.min.js +11074 -2735
  4. package/dist/native-document.dev.js +2269 -392
  5. package/dist/native-document.dev.js.map +1 -1
  6. package/dist/native-document.min.js +1 -1
  7. package/eslint.config.js +28 -33
  8. package/i18n.js +1 -1
  9. package/i18n.ts +2 -0
  10. package/index.js +3 -0
  11. package/package.json +3 -2
  12. package/src/components/$traits/has-draggable/HasDraggable.d.ts +4 -0
  13. package/src/components/$traits/has-draggable/HasDraggable.js +13 -0
  14. package/src/components/$traits/has-items/HasItems.d.ts +9 -0
  15. package/src/components/$traits/has-items/HasItems.js +6 -6
  16. package/src/components/$traits/has-position/HasFullPosition.d.ts +14 -0
  17. package/src/components/$traits/has-position/HasFullPosition.js +44 -0
  18. package/src/components/$traits/has-position/HasPosition.d.ts +7 -0
  19. package/src/components/$traits/has-position/HasPosition.js +23 -1
  20. package/src/components/$traits/has-resizable/HasResizable.d.ts +13 -0
  21. package/src/components/$traits/has-resizable/HasResizable.js +9 -0
  22. package/src/components/$traits/has-validation/HasValidation.d.ts +17 -0
  23. package/src/components/$traits/has-validation/HasValidation.js +54 -7
  24. package/src/components/BaseComponent.d.ts +32 -0
  25. package/src/components/BaseComponent.js +65 -9
  26. package/src/components/accordion/Accordion.js +39 -14
  27. package/src/components/accordion/AccordionItem.js +45 -14
  28. package/src/components/accordion/index.js +2 -2
  29. package/src/components/accordion/types/Accordion.d.ts +47 -0
  30. package/src/components/accordion/types/AccordionItem.d.ts +48 -0
  31. package/src/components/alert/Alert.js +70 -38
  32. package/src/components/alert/index.js +2 -2
  33. package/src/components/alert/types/Alert.d.ts +62 -0
  34. package/src/components/avatar/Avatar.js +49 -12
  35. package/src/components/avatar/AvatarGroup.js +50 -2
  36. package/src/components/avatar/index.js +2 -2
  37. package/src/components/avatar/types/Avatar.d.ts +74 -0
  38. package/src/components/avatar/types/AvatarGroup.d.ts +32 -0
  39. package/src/components/badge/Badge.js +125 -5
  40. package/src/components/badge/index.js +2 -2
  41. package/src/components/badge/types/Badge.d.ts +51 -0
  42. package/src/components/breadcrumb/BreadCrumb.js +61 -5
  43. package/src/components/breadcrumb/index.js +2 -2
  44. package/src/components/breadcrumb/types/BreadCrumb.d.ts +42 -0
  45. package/src/components/button/Button.js +164 -9
  46. package/src/components/button/index.js +1 -1
  47. package/src/components/button/types/Button.d.ts +62 -0
  48. package/src/components/card/Card.js +128 -10
  49. package/src/components/card/index.js +3 -3
  50. package/src/components/card/types/Card.d.ts +42 -0
  51. package/src/components/context-menu/ContextMenu.js +49 -5
  52. package/src/components/context-menu/ContextMenuGroup.js +15 -2
  53. package/src/components/context-menu/ContextMenuItem.js +14 -2
  54. package/src/components/context-menu/index.js +5 -5
  55. package/src/components/context-menu/types/ContextMenu.d.ts +30 -0
  56. package/src/components/context-menu/types/ContextMenuGroup.d.ts +18 -0
  57. package/src/components/context-menu/types/ContextMenuItem.d.ts +18 -0
  58. package/src/components/divider/Divider.js +120 -4
  59. package/src/components/divider/index.js +3 -3
  60. package/src/components/divider/types/Divider.d.ts +55 -0
  61. package/src/components/dropdown/Dropdown.js +239 -16
  62. package/src/components/dropdown/DropdownDivider.js +22 -2
  63. package/src/components/dropdown/DropdownGroup.js +44 -5
  64. package/src/components/dropdown/DropdownItem.js +76 -3
  65. package/src/components/dropdown/DropdownTrigger.js +49 -20
  66. package/src/components/dropdown/helpers.js +1 -1
  67. package/src/components/dropdown/index.js +6 -6
  68. package/src/components/dropdown/types/Dropdown.d.ts +88 -0
  69. package/src/components/dropdown/types/DropdownDivider.d.ts +20 -0
  70. package/src/components/dropdown/types/DropdownGroup.d.ts +25 -0
  71. package/src/components/dropdown/types/DropdownItem.d.ts +41 -0
  72. package/src/components/dropdown/types/DropdownTrigger.d.ts +32 -0
  73. package/src/components/form/FormControl.js +156 -13
  74. package/src/components/form/field/Field.js +172 -9
  75. package/src/components/form/field/FieldCollection.js +116 -12
  76. package/src/components/form/field/types/AutocompleteField.js +92 -2
  77. package/src/components/form/field/types/CheckboxField.js +43 -2
  78. package/src/components/form/field/types/CheckboxGroupField.js +83 -6
  79. package/src/components/form/field/types/ColorField.js +56 -3
  80. package/src/components/form/field/types/DateField.js +155 -4
  81. package/src/components/form/field/types/EmailField.js +54 -4
  82. package/src/components/form/field/types/FileField.js +140 -6
  83. package/src/components/form/field/types/HiddenField.js +27 -1
  84. package/src/components/form/field/types/ImageField.js +82 -3
  85. package/src/components/form/field/types/NumberField.js +97 -4
  86. package/src/components/form/field/types/PasswordField.js +103 -7
  87. package/src/components/form/field/types/RadioField.js +75 -4
  88. package/src/components/form/field/types/RangeField.js +67 -1
  89. package/src/components/form/field/types/SearchField.js +41 -2
  90. package/src/components/form/field/types/SelectField.js +133 -4
  91. package/src/components/form/field/types/StringField.js +91 -2
  92. package/src/components/form/field/types/TelField.js +55 -4
  93. package/src/components/form/field/types/TextAreaField.js +76 -2
  94. package/src/components/form/field/types/TimeField.js +120 -5
  95. package/src/components/form/field/types/UrlField.js +59 -4
  96. package/src/components/form/field/types/file-field-mode/FileAvatarMode.js +83 -4
  97. package/src/components/form/field/types/file-field-mode/FileDropzoneMode.js +61 -3
  98. package/src/components/form/field/types/file-field-mode/FileItemPreview.js +79 -3
  99. package/src/components/form/field/types/file-field-mode/FileNativeMode.js +24 -2
  100. package/src/components/form/field/types/file-field-mode/FileUploadButtonMode.js +64 -3
  101. package/src/components/form/field/types/file-field-mode/FileWallMode.js +56 -3
  102. package/src/components/form/index.js +28 -28
  103. package/src/components/form/types/Field.d.ts +73 -0
  104. package/src/components/form/types/FieldCollection.d.ts +53 -0
  105. package/src/components/form/types/FormControl.d.ts +64 -0
  106. package/src/components/form/types/fields/AutocompleteField.d.ts +48 -0
  107. package/src/components/form/types/fields/CheckboxField.d.ts +33 -0
  108. package/src/components/form/types/fields/CheckboxGroupField.d.ts +49 -0
  109. package/src/components/form/types/fields/ColorField.d.ts +37 -0
  110. package/src/components/form/types/fields/DateField.d.ts +70 -0
  111. package/src/components/form/types/fields/EmailField.d.ts +35 -0
  112. package/src/components/form/types/fields/FileAvatarMode.d.ts +46 -0
  113. package/src/components/form/types/fields/FileDropzoneMode.d.ts +28 -0
  114. package/src/components/form/types/fields/FileField.d.ts +56 -0
  115. package/src/components/form/types/fields/FileItemPreview.d.ts +35 -0
  116. package/src/components/form/types/fields/FileNativeMode.d.ts +21 -0
  117. package/src/components/form/types/fields/FileUploadButtonMode.d.ts +34 -0
  118. package/src/components/form/types/fields/FileWallMode.d.ts +32 -0
  119. package/src/components/form/types/fields/HiddenField.d.ts +26 -0
  120. package/src/components/form/types/fields/ImageField.d.ts +45 -0
  121. package/src/components/form/types/fields/NumberField.d.ts +48 -0
  122. package/src/components/form/types/fields/PasswordField.d.ts +46 -0
  123. package/src/components/form/types/fields/RadioField.d.ts +48 -0
  124. package/src/components/form/types/fields/RangeField.d.ts +44 -0
  125. package/src/components/form/types/fields/SearchField.d.ts +34 -0
  126. package/src/components/form/types/fields/SelectField.d.ts +71 -0
  127. package/src/components/form/types/fields/StringField.d.ts +48 -0
  128. package/src/components/form/types/fields/TelField.d.ts +37 -0
  129. package/src/components/form/types/fields/TextAreaField.d.ts +44 -0
  130. package/src/components/form/types/fields/TimeField.d.ts +51 -0
  131. package/src/components/form/types/fields/UrlField.d.ts +35 -0
  132. package/src/components/form/validation/Validation.js +54 -54
  133. package/src/components/index.d.ts +160 -0
  134. package/src/components/list/List.js +99 -15
  135. package/src/components/list/ListGroup.js +58 -8
  136. package/src/components/list/ListItem.js +79 -18
  137. package/src/components/list/index.js +5 -5
  138. package/src/components/list/types/List.d.ts +43 -0
  139. package/src/components/list/types/ListGroup.d.ts +37 -0
  140. package/src/components/list/types/ListItem.d.ts +42 -0
  141. package/src/components/menu/HasMenuItem.js +55 -6
  142. package/src/components/menu/Menu.js +113 -22
  143. package/src/components/menu/MenuDivider.js +18 -2
  144. package/src/components/menu/MenuGroup.js +61 -6
  145. package/src/components/menu/MenuItem.js +95 -11
  146. package/src/components/menu/MenuLink.js +27 -2
  147. package/src/components/menu/index.js +6 -6
  148. package/src/components/menu/types/Menu.d.ts +60 -0
  149. package/src/components/menu/types/MenuDivider.d.ts +19 -0
  150. package/src/components/menu/types/MenuGroup.d.ts +44 -0
  151. package/src/components/menu/types/MenuItem.d.ts +46 -0
  152. package/src/components/menu/types/MenuLink.d.ts +16 -0
  153. package/src/components/modal/Modal.js +258 -17
  154. package/src/components/modal/index.js +3 -3
  155. package/src/components/modal/types/Modal.d.ts +94 -0
  156. package/src/components/pagination/Pagination.js +155 -7
  157. package/src/components/pagination/index.js +3 -3
  158. package/src/components/pagination/types/Pagination.d.ts +68 -0
  159. package/src/components/popover/Popover.js +198 -11
  160. package/src/components/popover/PopoverFooter.js +33 -9
  161. package/src/components/popover/PopoverHeader.js +33 -8
  162. package/src/components/popover/index.js +4 -4
  163. package/src/components/popover/types/Popover.d.ts +83 -0
  164. package/src/components/popover/types/PopoverFooter.d.ts +24 -0
  165. package/src/components/popover/types/PopoverHeader.d.ts +26 -0
  166. package/src/components/progress/Progress.js +182 -13
  167. package/src/components/progress/index.js +3 -3
  168. package/src/components/progress/types/Progress.d.ts +77 -0
  169. package/src/components/skeleton/Skeleton.js +117 -49
  170. package/src/components/skeleton/index.js +3 -3
  171. package/src/components/skeleton/types/Skeleton.d.ts +55 -0
  172. package/src/components/slider/Slider.js +207 -10
  173. package/src/components/slider/index.js +2 -2
  174. package/src/components/slider/types/Slider.d.ts +82 -0
  175. package/src/components/spacer/Spacer.js +11 -2
  176. package/src/components/spacer/index.js +2 -2
  177. package/src/components/spacer/types/Spacer.d.ts +19 -0
  178. package/src/components/spinner/Spinner.js +180 -9
  179. package/src/components/spinner/index.js +3 -3
  180. package/src/components/spinner/types/Spinner.d.ts +71 -0
  181. package/src/components/splitter/Splitter.js +76 -13
  182. package/src/components/splitter/SplitterGutter.js +67 -5
  183. package/src/components/splitter/SplitterPanel.js +69 -2
  184. package/src/components/splitter/index.js +5 -5
  185. package/src/components/splitter/types/Splitter.d.ts +38 -0
  186. package/src/components/splitter/types/SplitterGutter.d.ts +38 -0
  187. package/src/components/splitter/types/SplitterPanel.d.ts +41 -0
  188. package/src/components/stacks/AbsoluteStack.js +23 -3
  189. package/src/components/stacks/FixedStack.js +23 -3
  190. package/src/components/stacks/HStack.js +24 -3
  191. package/src/components/stacks/PositionStack.js +111 -3
  192. package/src/components/stacks/RelativeStack.js +23 -3
  193. package/src/components/stacks/Stack.js +73 -2
  194. package/src/components/stacks/VStack.js +24 -4
  195. package/src/components/stacks/index.js +7 -7
  196. package/src/components/stacks/types/AbsoluteStack.d.ts +16 -0
  197. package/src/components/stacks/types/FixedStack.d.ts +16 -0
  198. package/src/components/stacks/types/HStack.d.ts +16 -0
  199. package/src/components/stacks/types/PositionStack.d.ts +54 -0
  200. package/src/components/stacks/types/RelativeStack.d.ts +17 -0
  201. package/src/components/stacks/types/Stack.d.ts +39 -0
  202. package/src/components/stacks/types/VStack.d.ts +16 -0
  203. package/src/components/stepper/Stepper.js +152 -12
  204. package/src/components/stepper/StepperStep.js +104 -3
  205. package/src/components/stepper/index.js +4 -4
  206. package/src/components/stepper/types/Stepper.d.ts +68 -0
  207. package/src/components/stepper/types/StepperStep.d.ts +54 -0
  208. package/src/components/switch/Switch.js +143 -6
  209. package/src/components/switch/index.js +1 -1
  210. package/src/components/switch/types/Switch.d.ts +55 -0
  211. package/src/components/table/Column.js +105 -6
  212. package/src/components/table/ColumnGroup.js +48 -3
  213. package/src/components/table/DataTable.js +256 -19
  214. package/src/components/table/SimpleTable.js +58 -4
  215. package/src/components/table/index.js +2 -2
  216. package/src/components/table/types/Column.d.ts +49 -0
  217. package/src/components/table/types/ColumnGroup.d.ts +28 -0
  218. package/src/components/table/types/DataTable.d.ts +97 -0
  219. package/src/components/table/types/SimpleTable.d.ts +40 -0
  220. package/src/components/tabs/Tabs.js +192 -5
  221. package/src/components/tabs/index.js +3 -3
  222. package/src/components/tabs/types/Tabs.d.ts +78 -0
  223. package/src/components/toast/Toast.js +133 -5
  224. package/src/components/toast/index.js +3 -3
  225. package/src/components/toast/types/Toast.d.ts +57 -0
  226. package/src/components/toast/types/ToastError.d.ts +7 -0
  227. package/src/components/toast/types/ToastInfo.d.ts +7 -0
  228. package/src/components/toast/types/ToastSuccess.d.ts +7 -0
  229. package/src/components/toast/types/ToastWarning.d.ts +7 -0
  230. package/src/components/tooltip/Tooltip.js +157 -13
  231. package/src/components/tooltip/index.js +2 -2
  232. package/src/components/tooltip/prototypes.js +1 -1
  233. package/src/components/tooltip/types/Tooltip.d.ts +65 -0
  234. package/src/core/data/MemoryManager.js +2 -2
  235. package/src/core/data/Observable.js +15 -18
  236. package/src/core/data/ObservableArray.js +118 -46
  237. package/src/core/data/ObservableChecker.js +2 -2
  238. package/src/core/data/ObservableItem.js +135 -21
  239. package/src/core/data/ObservableObject.js +126 -35
  240. package/src/core/data/ObservableResource.js +113 -3
  241. package/src/core/data/Store.js +142 -26
  242. package/src/core/data/observable-helpers/observable.is-to.js +196 -1
  243. package/src/core/data/observable-helpers/observable.prototypes.js +33 -8
  244. package/src/core/elements/anchor/anchor-with-sentinel.js +23 -2
  245. package/src/core/elements/anchor/anchor.js +16 -7
  246. package/src/core/elements/anchor/one-child-anchor-overwriting.js +2 -2
  247. package/src/core/elements/content-formatter.js +1 -1
  248. package/src/core/elements/control/for-each-array.js +9 -9
  249. package/src/core/elements/control/for-each.js +14 -14
  250. package/src/core/elements/control/show-if.js +11 -11
  251. package/src/core/elements/control/show-when.js +5 -5
  252. package/src/core/elements/control/switch.js +14 -14
  253. package/src/core/elements/description-list.js +1 -1
  254. package/src/core/elements/form.js +2 -2
  255. package/src/core/elements/fragment.js +1 -1
  256. package/src/core/elements/html5-semantics.js +1 -1
  257. package/src/core/elements/img.js +3 -3
  258. package/src/core/elements/interactive.js +1 -1
  259. package/src/core/elements/list.js +1 -1
  260. package/src/core/elements/medias.js +1 -1
  261. package/src/core/elements/meta-data.js +1 -1
  262. package/src/core/elements/svg.js +1 -1
  263. package/src/core/elements/table.js +1 -1
  264. package/src/core/errors/ArgTypesError.js +1 -1
  265. package/src/core/utils/HasEventEmitter.js +36 -2
  266. package/src/core/utils/args-types.js +9 -9
  267. package/src/core/utils/cache.js +1 -1
  268. package/src/core/utils/callback-handler.js +29 -0
  269. package/src/core/utils/debug-manager.js +6 -6
  270. package/src/core/utils/events.js +139 -139
  271. package/src/core/utils/filters/date.js +84 -3
  272. package/src/core/utils/filters/standard.js +136 -11
  273. package/src/core/utils/filters/strings.js +34 -2
  274. package/src/core/utils/filters/utils.js +40 -4
  275. package/src/core/utils/formatters.js +4 -4
  276. package/src/core/utils/helpers.js +39 -7
  277. package/src/core/utils/localstorage.js +11 -11
  278. package/src/core/utils/memoize.js +56 -3
  279. package/src/core/utils/plugins-manager.js +3 -3
  280. package/src/core/utils/property-accumulator.js +6 -6
  281. package/src/core/utils/prototypes.js +26 -1
  282. package/src/core/utils/shortcut-manager.js +2 -2
  283. package/src/core/utils/validator.js +8 -8
  284. package/src/core/wrappers/AttributesWrapper.js +32 -22
  285. package/src/core/wrappers/DocumentObserver.js +3 -3
  286. package/src/core/wrappers/ElementCreator.js +5 -5
  287. package/src/core/wrappers/HtmlElementWrapper.js +38 -12
  288. package/src/core/wrappers/NDElement.js +328 -22
  289. package/src/core/wrappers/NdPrototype.js +60 -16
  290. package/src/core/wrappers/SingletonView.js +50 -2
  291. package/src/core/wrappers/SvgElementWrapper.js +1 -1
  292. package/src/core/wrappers/constants.js +35 -2
  293. package/src/core/wrappers/prototypes/attributes-extensions.js +7 -7
  294. package/src/core/wrappers/prototypes/nd-element-extensions.js +72 -6
  295. package/src/core/wrappers/prototypes/nd-element.transition.extensions.js +42 -2
  296. package/src/core/wrappers/template-cloner/NodeCloner.js +53 -8
  297. package/src/core/wrappers/template-cloner/TemplateCloner.js +75 -6
  298. package/src/core/wrappers/template-cloner/attributes-hydrator.js +58 -2
  299. package/src/core/wrappers/template-cloner/utils.js +42 -6
  300. package/src/fetch/NativeFetch.js +3 -3
  301. package/src/i18n/bin/scan.js +6 -6
  302. package/src/i18n/index.d.ts +2 -0
  303. package/src/i18n/service/I18nService.d.ts +27 -0
  304. package/src/i18n/service/I18nService.js +5 -5
  305. package/src/i18n/service/functions.d.ts +22 -0
  306. package/src/i18n/service/functions.js +2 -2
  307. package/src/router/Route.js +3 -3
  308. package/src/router/RouteGroupHelper.js +2 -2
  309. package/src/router/Router.js +15 -15
  310. package/src/router/RouterComponent.js +33 -7
  311. package/src/router/link.js +4 -4
  312. package/src/router/modes/HashRouter.js +2 -2
  313. package/src/router/modes/HistoryRouter.js +2 -2
  314. package/src/router/modes/MemoryRouter.js +1 -1
  315. package/src/ui/components/accordion/AccordionItemRender.js +3 -3
  316. package/src/ui/components/accordion/AccordionRender.js +1 -1
  317. package/src/ui/components/alert/AlertRender.js +10 -10
  318. package/src/ui/components/avatar/avata-group/AvatarGroupRender.js +1 -1
  319. package/src/ui/components/avatar/avatar/AvatarRender.js +1 -1
  320. package/src/ui/components/breadcrumb/BreadcrumbRender.js +2 -2
  321. package/src/ui/components/button/ButtonRender.js +1 -1
  322. package/src/ui/components/contextmenu/ContextmenuRender.js +5 -5
  323. package/src/ui/components/dropdown/DropdownRender.js +8 -8
  324. package/src/ui/components/dropdown/group/DropdownGroupRender.js +2 -2
  325. package/src/ui/components/dropdown/item/DropdownItemRender.js +1 -1
  326. package/src/ui/components/form/FieldCollectionRender.js +2 -2
  327. package/src/ui/components/form/FormControlRender.js +5 -5
  328. package/src/ui/components/form/fields/AutocompleteFieldRender.js +3 -3
  329. package/src/ui/components/form/fields/CheckboxFieldRender.js +1 -1
  330. package/src/ui/components/form/fields/CheckboxGroupFieldRender.js +1 -1
  331. package/src/ui/components/form/fields/DateFieldRender.js +7 -7
  332. package/src/ui/components/form/fields/EmailFieldRender.js +1 -1
  333. package/src/ui/components/form/fields/FieldRender.js +4 -4
  334. package/src/ui/components/form/fields/FileFieldRender.js +1 -1
  335. package/src/ui/components/form/fields/PasswordFieldRender.js +2 -2
  336. package/src/ui/components/form/fields/RadioFieldRender.js +1 -1
  337. package/src/ui/components/form/fields/RangeFieldRender.js +1 -1
  338. package/src/ui/components/form/fields/SelectFieldRender.js +2 -2
  339. package/src/ui/components/form/fields/SliderFieldRender.js +6 -6
  340. package/src/ui/components/form/fields/StringFieldRender.js +1 -1
  341. package/src/ui/components/form/fields/TelFieldRender.js +1 -1
  342. package/src/ui/components/form/fields/TextAreaFieldRender.js +1 -1
  343. package/src/ui/components/form/fields/TimeFieldRender.js +3 -3
  344. package/src/ui/components/form/fields/UrlFieldRender.js +1 -1
  345. package/src/ui/components/form/file-upload-mode/FileAvatarModeRender.js +1 -1
  346. package/src/ui/components/form/file-upload-mode/FileDropzoneModeRender.js +2 -2
  347. package/src/ui/components/form/file-upload-mode/FileUploadButtonModeRender.js +2 -2
  348. package/src/ui/components/form/file-upload-mode/FileWallModeRender.js +1 -1
  349. package/src/ui/components/form/helpers.js +8 -8
  350. package/src/ui/components/form/index.js +27 -27
  351. package/src/ui/components/menu/MenuDividerRender.js +1 -1
  352. package/src/ui/components/menu/MenuGroupRender.js +3 -3
  353. package/src/ui/components/menu/MenuItemRender.js +2 -2
  354. package/src/ui/components/menu/MenuLinkRender.js +3 -3
  355. package/src/ui/components/menu/helpers.js +4 -4
  356. package/src/ui/components/modal/ModalRender.js +4 -4
  357. package/src/ui/components/pagination/PaginationRender.js +9 -9
  358. package/src/ui/components/popover/PopoverRender.js +7 -7
  359. package/src/ui/components/progress/ProgressRender.js +12 -12
  360. package/src/ui/components/skeleton/SkeletonRender.js +56 -0
  361. package/src/ui/components/splitter/SplitterGutterRender.js +1 -1
  362. package/src/ui/components/splitter/SplitterPanelRender.js +2 -2
  363. package/src/ui/components/stacks/PositionStackRender.js +1 -1
  364. package/src/ui/components/stacks/StackRender.js +1 -1
  365. package/src/ui/components/stacks/absolute-stack/AbsoluteStackRender.js +1 -1
  366. package/src/ui/components/stacks/fixed-stack/FixedStackRender.js +1 -1
  367. package/src/ui/components/stacks/h-stack/HStackRender.js +1 -1
  368. package/src/ui/components/stacks/index.js +5 -5
  369. package/src/ui/components/stacks/relative-stack/RelativeStackRender.js +1 -1
  370. package/src/ui/components/stacks/v-stack/VStackRender.js +1 -1
  371. package/src/ui/components/stepper/StepperRender.js +2 -2
  372. package/src/ui/components/stepper/StepperStepRender.js +4 -4
  373. package/src/ui/components/switch/SwitchRender.js +4 -4
  374. package/src/ui/components/table/data-table/DataTableRender.js +5 -5
  375. package/src/ui/components/table/data-table/bulk-actions.js +7 -7
  376. package/src/ui/components/table/data-table/pagination.js +6 -6
  377. package/src/ui/components/table/data-table/tables.js +25 -25
  378. package/src/ui/components/table/data-table/toolbar.js +3 -3
  379. package/src/ui/components/table/simple-table/SimpleTableRender.js +8 -8
  380. package/src/ui/components/tabs/TabsRender.js +11 -11
  381. package/src/ui/components/toast/ToastRender.js +3 -3
  382. package/src/ui/components/tooltip/TooltipRender.js +1 -1
  383. package/src/ui/index.js +36 -36
  384. package/types/elements.d.ts +163 -1037
  385. package/types/forms.d.ts +16 -20
  386. package/types/globals.d.ts +543 -0
  387. package/types/images.d.ts +2 -2
  388. package/types/observable-resource.d.ts +3 -0
  389. package/types/property-accumulator.d.ts +4 -4
  390. package/types/store.d.ts +26 -2
  391. package/types/validator.ts +3 -3
  392. package/ui.js +1 -0
  393. package/src/components/form/field/DefaultRender.js +0 -77
  394. package/src/components/form/field/FieldFactory.js +0 -107
  395. package/src/components/skeleton/SkeletonCard.js +0 -0
  396. package/src/components/skeleton/SkeletonList.js +0 -0
  397. package/src/components/skeleton/SkeletonParagraph.js +0 -0
  398. package/src/components/skeleton/SkeletonTable.js +0 -0
@@ -1,7 +1,7 @@
1
- import Validator from "./validator";
1
+ import Validator from './validator';
2
2
 
3
3
  export const cssPropertyAccumulator = function(initialValue = {}) {
4
- let data = Validator.isString(initialValue) ? initialValue.split(';').filter(Boolean) : initialValue;
4
+ const data = Validator.isString(initialValue) ? initialValue.split(';').filter(Boolean) : initialValue;
5
5
 
6
6
  return {
7
7
  add(key, value) {
@@ -25,10 +25,10 @@ export const cssPropertyAccumulator = function(initialValue = {}) {
25
25
  return { ...data };
26
26
  },
27
27
  };
28
- }
28
+ };
29
29
 
30
30
  export const classPropertyAccumulator = function(initialValue = []) {
31
- let data = Validator.isString(initialValue) ? initialValue.split(" ").filter(Boolean) : initialValue;
31
+ let data = Validator.isString(initialValue) ? initialValue.split(' ').filter(Boolean) : initialValue;
32
32
 
33
33
  return {
34
34
  add(key, value = true) {
@@ -48,7 +48,7 @@ export const classPropertyAccumulator = function(initialValue = []) {
48
48
  }, {});
49
49
  }
50
50
  if(key.__$Observable) {
51
- const uniqueId = `obs-${Math.random().toString(36).substr(2, 9)}`
51
+ const uniqueId = `obs-${Math.random().toString(36).substr(2, 9)}`;
52
52
  data[uniqueId] = key;
53
53
  }
54
54
  else {
@@ -69,4 +69,4 @@ export const classPropertyAccumulator = function(initialValue = []) {
69
69
  return { ...data };
70
70
  },
71
71
  };
72
- }
72
+ };
@@ -1,12 +1,37 @@
1
- import {withValidation} from "./args-types.js";
1
+ import {withValidation} from './args-types.js';
2
2
 
3
3
 
4
4
  DocumentFragment.prototype.__IS_FRAGMENT = true;
5
5
 
6
+ /**
7
+ * Wraps a function with argument validation based on an ArgTypes schema.
8
+ * Throws an ArgTypesError if the arguments don't match the schema.
9
+ *
10
+ * @param {...ArgType} args - ArgType descriptors defining expected argument types
11
+ * @returns {Function} Wrapped function that validates its arguments before executing
12
+ * @example
13
+ * function greet(name, age) { ... }
14
+ * const safeGreet = greet.args(ArgTypes.string('name'), ArgTypes.number('age'));
15
+ * safeGreet('John', 25); // OK
16
+ * safeGreet('John', 'old'); // throws ArgTypesError
17
+ */
6
18
  Function.prototype.args = function(...args) {
7
19
  return withValidation(this, args);
8
20
  };
9
21
 
22
+
23
+ /**
24
+ * Wraps a function with a try/catch error boundary.
25
+ * If the function throws, the callback is called with the error and context instead.
26
+ *
27
+ * @param {(error: Error, context: { caller: Function, args: any[] }) => *} callback - Error handler
28
+ * @returns {Function} Wrapped function with error boundary
29
+ * @example
30
+ * const safeRender = render.errorBoundary((err, { args }) => {
31
+ * console.error('Render failed:', err.message);
32
+ * return Div({}, 'Error');
33
+ * });
34
+ */
10
35
  Function.prototype.errorBoundary = function(callback) {
11
36
  const handler = (...args) => {
12
37
  try {
@@ -121,7 +121,7 @@ const displayOnWindows = (shortcut) => {
121
121
  parts.push(parsed.key);
122
122
 
123
123
  return parts.join('+');
124
- }
124
+ };
125
125
 
126
126
  /**
127
127
  * Display a shortcut string for the current OS.
@@ -154,7 +154,7 @@ const ShortcutManager = {
154
154
  if($registry.has(mapKey) && !options.force) {
155
155
  const existing = $registry.get(mapKey);
156
156
  DebugManager.warn(
157
- `ShortcutManager: "${shortcut}" is already registered by "${existing.source}" in context "${context}". Use { force: true } to override.`
157
+ `ShortcutManager: "${shortcut}" is already registered by "${existing.source}" in context "${context}". Use { force: true } to override.`,
158
158
  );
159
159
  return this;
160
160
  }
@@ -1,12 +1,12 @@
1
- import DebugManager from "./debug-manager";
2
- import NativeDocumentError from "../errors/NativeDocumentError";
1
+ import DebugManager from './debug-manager';
2
+ import NativeDocumentError from '../errors/NativeDocumentError';
3
3
 
4
4
  const COMMON_NODE_TYPES = {
5
5
  ELEMENT: 1,
6
6
  TEXT: 3,
7
7
  COMMENT: 8,
8
8
  DOCUMENT: 9,
9
- DOCUMENT_FRAGMENT: 11
9
+ DOCUMENT_FRAGMENT: 11,
10
10
  };
11
11
 
12
12
  export const VALID_TYPES = [];
@@ -29,13 +29,13 @@ const Validator = {
29
29
  return value?.__$isObservableArray;
30
30
  },
31
31
  isProxy(value) {
32
- return value?.__isProxy__
32
+ return value?.__isProxy__;
33
33
  },
34
34
  isObservableOrProxy(value) {
35
- return Validator.isObservable(value) || Validator.isProxy(value);
35
+ return value?.__$Observable;
36
36
  },
37
37
  isAnchor(value) {
38
- return value?.__Anchor__
38
+ return value?.__Anchor__;
39
39
  },
40
40
  isObservableChecker(value) {
41
41
  return value?.__$isObservableChecker;
@@ -62,7 +62,7 @@ const Validator = {
62
62
  return typeof value === 'object' && value !== null;
63
63
  },
64
64
  isJson(value) {
65
- return !(typeof value !== 'object' || value === null || Array.isArray(value) || value.constructor.name !== 'Object')
65
+ return !(typeof value !== 'object' || value === null || Array.isArray(value) || value.constructor.name !== 'Object');
66
66
  },
67
67
  isElement(value) {
68
68
  return value && VALID_TYPES[value.nodeType];
@@ -135,7 +135,7 @@ const Validator = {
135
135
  if (typeof callback !== 'function') {
136
136
  throw new NativeDocumentError('Event callback must be a function');
137
137
  }
138
- }
138
+ },
139
139
  };
140
140
  if(process.env.NODE_ENV === 'development') {
141
141
  Validator.validateAttributes = function(attributes) {
@@ -1,12 +1,15 @@
1
- import Validator from "../utils/validator";
2
- import NativeDocumentError from "../errors/NativeDocumentError";
3
- import {BOOLEAN_ATTRIBUTES} from "./constants.js";
4
- import {Observable} from "../data/Observable";
1
+ import Validator from '../utils/validator';
2
+ import NativeDocumentError from '../errors/NativeDocumentError';
3
+ import {BOOL_ATTRIBUTES_NAME, BOOLEAN_ATTRIBUTES} from './constants.js';
4
+ import {Observable} from '../data/Observable';
5
5
 
6
6
  /**
7
+ * Applies a reactive class map to an HTMLElement.
8
+ * Each key is a CSS class name; each value is a boolean or ObservableItem<boolean>.
9
+ * If the value is an ObservableChecker emitting a string, toggles the class name dynamically.
7
10
  *
8
- * @param {HTMLElement} element
9
- * @param {Object} data
11
+ * @param {HTMLElement} element - Target element
12
+ * @param {Record<string, boolean|ObservableItem<boolean>|ObservableChecker<boolean|string>>} data - Class map
10
13
  */
11
14
  export const bindClassAttribute = (element, data) => {
12
15
  for(const className in data) {
@@ -14,7 +17,7 @@ export const bindClassAttribute = (element, data) => {
14
17
  if(value.__$Observable) {
15
18
  if(value.__$isObservableChecker) {
16
19
  let lastClass = value.val();
17
- if(typeof lastClass === "string") {
20
+ if(typeof lastClass === 'string') {
18
21
  element.classes.toggle(lastClass, true);
19
22
  value.subscribe((currentValue) => {
20
23
  element.classes.remove(lastClass);
@@ -32,14 +35,18 @@ export const bindClassAttribute = (element, data) => {
32
35
  value.$hydrate(element, className);
33
36
  continue;
34
37
  }
35
- element.classes.toggle(className, value)
38
+ element.classes.toggle(className, value);
36
39
  }
37
- }
40
+ };
38
41
 
39
42
  /**
43
+ * Applies a reactive style map to an HTMLElement.
44
+ * Each key is a CSS property name (camelCase or CSS custom property `--var`);
45
+ * each value is a string or ObservableItem<string>.
46
+ * CSS custom properties are set via element.style.setProperty().
40
47
  *
41
- * @param {HTMLElement} element
42
- * @param {Object} data
48
+ * @param {HTMLElement} element - Target element
49
+ * @param {Record<string, string|ObservableItem<string>>} data - Style map
43
50
  */
44
51
  export const bindStyleAttribute = (element, data) => {
45
52
  for(const styleName in data) {
@@ -54,7 +61,7 @@ export const bindStyleAttribute = (element, data) => {
54
61
  element.style.removeProperty(styleName);
55
62
  return;
56
63
  }
57
- element.style.setProperty(styleName, newValue)
64
+ element.style.setProperty(styleName, newValue);
58
65
  });
59
66
  } else {
60
67
  element.style[styleName] = value.val();
@@ -63,7 +70,7 @@ export const bindStyleAttribute = (element, data) => {
63
70
  element.style.removeProperty(styleName);
64
71
  return;
65
72
  }
66
- element.style[styleName] = newValue
73
+ element.style[styleName] = newValue;
67
74
  });
68
75
  }
69
76
  continue;
@@ -87,24 +94,27 @@ export const bindStyleAttribute = (element, data) => {
87
94
  export const bindBooleanAttribute = (element, attributeName, value) => {
88
95
  const isObservable = value.__$isObservable;
89
96
  const defaultValue = isObservable? value.val() : value;
97
+
98
+ const attributeRealName = BOOL_ATTRIBUTES_NAME[attributeName];
99
+
90
100
  if(Validator.isBoolean(defaultValue)) {
91
- element[attributeName] = defaultValue;
101
+ element[attributeRealName] = defaultValue;
92
102
  }
93
103
  else {
94
- element[attributeName] = defaultValue === element.value;
104
+ element[attributeRealName] = defaultValue === element.value;
95
105
  }
96
106
  if(isObservable) {
97
107
  if(attributeName === 'checked') {
98
108
  if(typeof defaultValue === 'boolean') {
99
- element.addEventListener('input', () => value.set(element[attributeName]));
109
+ element.addEventListener('input', () => value.set(element[attributeRealName]));
100
110
  }
101
111
  else {
102
112
  element.addEventListener('input', () => value.set(element.value));
103
113
  }
104
- value.subscribe((newValue) => element[attributeName] = newValue);
114
+ value.subscribe((newValue) => element[attributeRealName] = newValue);
105
115
  return;
106
116
  }
107
- value.subscribe((newValue) => element[attributeName] = (newValue === element.value));
117
+ value.subscribe((newValue) => element[attributeRealName] = (newValue === element.value));
108
118
  }
109
119
  };
110
120
 
@@ -125,7 +135,7 @@ export const bindAttributeWithObservable = (element, attributeName, value) => {
125
135
  return;
126
136
  }
127
137
  element.setAttribute(attributeName, value.val());
128
- }
138
+ };
129
139
 
130
140
  /**
131
141
  *
@@ -140,12 +150,12 @@ const AttributesWrapper = (element, attributes) => {
140
150
 
141
151
  for(const originalAttributeName in attributes) {
142
152
  const attributeName = originalAttributeName.toLowerCase();
143
- let value = attributes[originalAttributeName];
153
+ const value = attributes[originalAttributeName];
144
154
  if(value == null) {
145
155
  continue;
146
156
  }
147
157
  if(value.handleNdAttribute) {
148
- value.handleNdAttribute(element, attributeName, value)
158
+ value.handleNdAttribute(element, attributeName, value);
149
159
  continue;
150
160
  }
151
161
  if(typeof value === 'object') {
@@ -166,6 +176,6 @@ const AttributesWrapper = (element, attributes) => {
166
176
  element.setAttribute(attributeName, value);
167
177
  }
168
178
  return element;
169
- }
179
+ };
170
180
 
171
181
  export default AttributesWrapper;
@@ -116,7 +116,7 @@ const DocumentObserver = {
116
116
  DocumentObserver.unmountedSupposedSize--;
117
117
  }
118
118
  data = null;
119
- }
119
+ },
120
120
  };
121
121
 
122
122
  const addListener = (type, callback) => {
@@ -174,9 +174,9 @@ const DocumentObserver = {
174
174
 
175
175
  off: (type, callback) => {
176
176
  removeListener(type, callback);
177
- }
177
+ },
178
178
  };
179
- }
179
+ },
180
180
  };
181
181
 
182
182
  export default DocumentObserver;
@@ -1,6 +1,6 @@
1
- import Validator from "../utils/validator";
2
- import AttributesWrapper, { bindClassAttribute, bindStyleAttribute } from "./AttributesWrapper";
3
- import PluginsManager from "../utils/plugins-manager";
1
+ import Validator from '../utils/validator';
2
+ import AttributesWrapper, { bindClassAttribute, bindStyleAttribute } from './AttributesWrapper';
3
+ import PluginsManager from '../utils/plugins-manager';
4
4
 
5
5
  let $textNodeCache = null;
6
6
 
@@ -44,7 +44,7 @@ export const ElementCreator = {
44
44
  * @returns {Text}
45
45
  */
46
46
  createStaticTextNode: (parent, value) => {
47
- let text = ElementCreator.createTextNode();
47
+ const text = ElementCreator.createTextNode();
48
48
  text.nodeValue = value;
49
49
  parent && parent.appendChild(text);
50
50
  return text;
@@ -76,7 +76,7 @@ export const ElementCreator = {
76
76
  if(process.env.NODE_ENV === 'development') {
77
77
  PluginsManager.emit('BeforeProcessChildren', parent);
78
78
  }
79
- let child = ElementCreator.getChild(children);
79
+ const child = ElementCreator.getChild(children);
80
80
  if(child) {
81
81
  parent.appendChild(child);
82
82
  }
@@ -1,6 +1,6 @@
1
- import Anchor from "../elements/anchor/anchor";
2
- import {ElementCreator} from "./ElementCreator";
3
- import {normalizeComponentArgs} from "../utils/args-types";
1
+ import Anchor from '../elements/anchor/anchor';
2
+ import {ElementCreator} from './ElementCreator';
3
+ import {normalizeComponentArgs} from '../utils/args-types';
4
4
  import './NdPrototype';
5
5
 
6
6
  import './NdPrototype';
@@ -10,10 +10,14 @@ import '../wrappers/prototypes/bind-class-extensions';
10
10
  import '../wrappers/prototypes/nd-element.transition.extensions';
11
11
  import '../wrappers/prototypes/attributes-extensions';
12
12
 
13
+
13
14
  /**
15
+ * Creates a reactive or static text node from the given value.
16
+ * If the value has a .toNdElement() method, delegates to it.
17
+ * Otherwise creates an empty text node.
14
18
  *
15
- * @param {*} value
16
- * @returns {Text}
19
+ * @param {string|number|ObservableItem|*} value - Value to convert to a text node
20
+ * @returns {Text} Text node, reactive if value is an ObservableItem
17
21
  */
18
22
  export const createTextNode = (value) => {
19
23
  if(value) {
@@ -23,19 +27,41 @@ export const createTextNode = (value) => {
23
27
  };
24
28
 
25
29
 
30
+ /**
31
+ * Applies attributes and children to an existing HTMLElement.
32
+ * Used internally by HtmlElementWrapper on each cloned node.
33
+ *
34
+ * @internal
35
+ * @param {HTMLElement} element - Element to configure
36
+ * @param {Object|null} _attributes - Attributes object or children if no attrs provided
37
+ * @param {ValidChild|null} [_children=null] - Children to append
38
+ * @returns {HTMLElement} The configured element
39
+ */
26
40
  export const createHtmlElement = (element, _attributes, _children = null) => {
27
- let { props: attributes, children = null } = normalizeComponentArgs(_attributes, _children);
41
+ const { props: attributes, children = null } = normalizeComponentArgs(_attributes, _children);
28
42
 
29
43
  ElementCreator.processAttributes(element, attributes);
30
44
  ElementCreator.processChildren(children, element);
31
45
  return element;
32
- }
46
+ };
33
47
 
34
48
  /**
49
+ * Creates a reusable element factory function for the given HTML tag.
50
+ * The factory clones a cached template node on each call for performance.
51
+ * Optionally wraps the created element with a custom wrapper function.
52
+ *
53
+ * @param {string} name - HTML tag name (e.g. 'div', 'button', 'input'). Pass empty string to create a Fragment.
54
+ * @param {((element: HTMLElement) => HTMLElement)|null} [customWrapper=null] - Optional function to augment the element before returning
55
+ * @returns {(attr?: Object, children?: ValidChild) => HTMLElement} Element factory function
56
+ * @example
57
+ * const Div = HtmlElementWrapper('div');
58
+ * Div({ class: 'container' }, 'Hello');
35
59
  *
36
- * @param {string} name
37
- * @param {?Function=} customWrapper
38
- * @returns {Function}
60
+ * // With custom wrapper
61
+ * const Form = HtmlElementWrapper('form', (el) => {
62
+ * el.submit = (action) => { ... };
63
+ * return el;
64
+ * });
39
65
  */
40
66
  export default function HtmlElementWrapper(name, customWrapper = null) {
41
67
  if(name) {
@@ -49,7 +75,7 @@ export default function HtmlElementWrapper(name, customWrapper = null) {
49
75
  return createHtmlElement(customWrapper(node.cloneNode()), attr, children);;
50
76
  };
51
77
 
52
- return (attr, children) => createElement(attr, children)
78
+ return (attr, children) => createElement(attr, children);
53
79
  }
54
80
 
55
81
  let node = null;
@@ -61,7 +87,7 @@ export default function HtmlElementWrapper(name, customWrapper = null) {
61
87
  return createHtmlElement(node.cloneNode(), attr, children);
62
88
  };
63
89
 
64
- return (attr, children) => createElement(attr, children)
90
+ return (attr, children) => createElement(attr, children);
65
91
  }
66
92
  return (children, name = '') => {
67
93
  const anchor = Anchor(name);