@ibiz-template/vue3-components 0.7.27 → 0.7.28-alpha.1

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 (252) hide show
  1. package/dist/chart-4KHwhatb.js +1 -0
  2. package/dist/index-5ZDQNjel.js +4 -0
  3. package/dist/{index-0TO7mjm5.js → index-HNRMy1_g.js} +1 -1
  4. package/dist/{index-g6o3vQXo.js → index-xa8K5AHD.js} +1 -1
  5. package/dist/index.min.css +1 -1
  6. package/dist/index.system.min.js +1 -1
  7. package/dist/wang-editor-YqnK5uQU.js +1 -0
  8. package/dist/{xlsx-util-qdXxbg2A.js → xlsx-util-nDELbrGS.js} +1 -1
  9. package/es/common/action-toolbar/action-toolbar.mjs +4 -3
  10. package/es/common/custom-theme/custom-theme.mjs +3 -2
  11. package/es/common/data-import2/data-import2.mjs +2 -5
  12. package/es/common/emoji-select/components/categories/categories.mjs +2 -1
  13. package/es/common/extend-action-timeline/extend-action-timeline.mjs +3 -2
  14. package/es/common/grid-setting/grid-setting.mjs +2 -1
  15. package/es/common/index.mjs +2 -0
  16. package/es/common/pagination/pagination.mjs +2 -1
  17. package/es/common/quick-edit/quick-edit.css +1 -0
  18. package/es/common/quick-edit/quick-edit.d.ts +38 -0
  19. package/es/common/quick-edit/quick-edit.mjs +116 -0
  20. package/es/common/rawitem/rawitem.mjs +2 -1
  21. package/es/control/app-menu/app-menu.mjs +2 -2
  22. package/es/control/app-menu/custom-menu-design/custom-menu-design.mjs +2 -2
  23. package/es/control/app-menu-icon-view/app-menu-icon-view.mjs +3 -2
  24. package/es/control/calendar/calendar.mjs +2 -1
  25. package/es/control/calendar/components/calendar-daily/calendar-daily.mjs +2 -1
  26. package/es/control/calendar/components/calendar-week/calendar-week.mjs +2 -1
  27. package/es/control/calendar/components/custom-calendar/custom-calendar.mjs +3 -2
  28. package/es/control/chart/chart.mjs +8 -0
  29. package/es/control/context-menu/context-menu.mjs +4 -3
  30. package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.d.ts +0 -1
  31. package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.mjs +2 -1
  32. package/es/control/dashboard/dashboard-design/dashboard-design.mjs +5 -4
  33. package/es/control/dashboard/portlet/menu-portlet/app-menu-portlet/app-menu-portlet.mjs +3 -2
  34. package/es/control/dashboard/portlet/portlet-layout/portlet-layout.mjs +2 -1
  35. package/es/control/drtab/drtab-control.util.mjs +1 -1
  36. package/es/control/drtab/drtab.mjs +2 -1
  37. package/es/control/form/form-detail/form-button/form-button.mjs +2 -1
  38. package/es/control/form/form-detail/form-item/form-item-container/form-item-container.mjs +3 -2
  39. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.mjs +2 -2
  40. package/es/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.mjs +2 -1
  41. package/es/control/form/form-detail/form-mdctrl/mdctrl-container2/mdctrl-container2.mjs +2 -1
  42. package/es/control/grid/grid/grid-control.util.d.ts +0 -2
  43. package/es/control/grid/grid/grid-control.util.mjs +9 -72
  44. package/es/control/grid/grid/grid.css +1 -1
  45. package/es/control/grid/grid/grid.d.ts +0 -2
  46. package/es/control/grid/grid/grid.mjs +1 -7
  47. package/es/control/grid/grid/index.d.ts +0 -2
  48. package/es/control/grid/grid-column/grid-field-column/grid-field-column.mjs +3 -2
  49. package/es/control/grid/row-edit-popover/row-edit-popover.d.ts +1 -1
  50. package/es/control/kanban/kanban.mjs +2 -2
  51. package/es/control/list/list.mjs +2 -1
  52. package/es/control/report-panel/report-panel.mjs +5 -0
  53. package/es/control/search-bar/filter-tree/filter-tree.d.ts +1 -1
  54. package/es/control/search-bar/search-bar.mjs +3 -2
  55. package/es/control/search-bar/search-groups/search-groups.mjs +6 -6
  56. package/es/control/toolbar/export-excel/export-excel.mjs +3 -2
  57. package/es/control/toolbar/short-cut-button/short-cut-button.mjs +2 -4
  58. package/es/control/toolbar/toolbar.css +1 -1
  59. package/es/control/toolbar/toolbar.mjs +150 -13
  60. package/es/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.mjs +3 -2
  61. package/es/control/wizard-panel/wizard-panel.mjs +2 -1
  62. package/es/editor/array/ibiz-array/ibiz-array.d.ts +1 -0
  63. package/es/editor/array/ibiz-array/ibiz-array.mjs +12 -3
  64. package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.mjs +2 -1
  65. package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.mjs +2 -1
  66. package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +2 -1
  67. package/es/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.mjs +2 -1
  68. package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +9 -4
  69. package/es/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.d.ts +1 -1
  70. package/es/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.mjs +2 -9
  71. package/es/editor/html/html-editor.controller.d.ts +88 -0
  72. package/es/editor/html/html-editor.controller.mjs +169 -6
  73. package/es/editor/html/wang-editor/component/emoji/emoji.css +1 -0
  74. package/es/editor/html/wang-editor/component/emoji/emoji.d.ts +17 -0
  75. package/es/editor/html/wang-editor/component/emoji/emoji.mjs +42 -0
  76. package/es/editor/html/wang-editor/component/index.d.ts +1 -0
  77. package/es/editor/html/wang-editor/component/index.mjs +3 -0
  78. package/es/editor/html/wang-editor/element/emoji.d.ts +7 -0
  79. package/es/editor/html/wang-editor/element/emoji.mjs +22 -0
  80. package/es/editor/html/wang-editor/element/index.d.ts +1 -0
  81. package/es/editor/html/wang-editor/element/index.mjs +3 -0
  82. package/es/editor/html/wang-editor/index.d.ts +4 -0
  83. package/es/editor/html/wang-editor/index.mjs +11 -0
  84. package/es/editor/html/wang-editor/module/ai-module.d.ts +67 -0
  85. package/es/editor/html/wang-editor/module/ai-module.mjs +76 -0
  86. package/es/editor/html/wang-editor/module/emoji-module.d.ts +7 -0
  87. package/es/editor/html/wang-editor/module/emoji-module.mjs +125 -0
  88. package/es/editor/html/wang-editor/module/index.d.ts +2 -0
  89. package/es/editor/html/wang-editor/module/index.mjs +4 -0
  90. package/es/editor/html/wang-editor/plugin/index.d.ts +1 -0
  91. package/es/editor/html/wang-editor/plugin/index.mjs +3 -0
  92. package/es/editor/html/wang-editor/plugin/plugin.d.ts +7 -0
  93. package/es/editor/html/wang-editor/plugin/plugin.mjs +23 -0
  94. package/es/editor/html/wang-editor/wang-editor.css +1 -1
  95. package/es/editor/html/wang-editor/wang-editor.mjs +7 -7
  96. package/es/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.d.ts +1 -1
  97. package/es/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.mjs +10 -3
  98. package/es/editor/span/span/span.mjs +2 -2
  99. package/es/editor/text-box/ibiz-input-number/ibiz-input-number.d.ts +1 -1
  100. package/es/editor/text-box/ibiz-input-number/ibiz-input-number.mjs +5 -2
  101. package/es/editor/text-box/input/input.d.ts +1 -0
  102. package/es/editor/text-box/input/input.mjs +17 -4
  103. package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.mjs +2 -1
  104. package/es/index.mjs +1 -0
  105. package/es/locale/en/index.d.ts +1 -0
  106. package/es/locale/en/index.mjs +2 -1
  107. package/es/locale/zh-CN/index.d.ts +1 -0
  108. package/es/locale/zh-CN/index.mjs +2 -1
  109. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/h.mjs +89 -0
  110. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/helpers/attachto.mjs +47 -0
  111. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/hooks.mjs +1 -0
  112. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/htmldomapi.mjs +115 -0
  113. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/index.mjs +18 -0
  114. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/init.mjs +376 -0
  115. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/is.mjs +9 -0
  116. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/jsx.mjs +64 -0
  117. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/modules/attributes.mjs +59 -0
  118. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/modules/class.mjs +28 -0
  119. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/modules/dataset.mjs +42 -0
  120. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/modules/eventlisteners.mjs +85 -0
  121. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/modules/props.mjs +24 -0
  122. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/modules/style.mjs +115 -0
  123. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/thunk.mjs +52 -0
  124. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/tovnode.mjs +62 -0
  125. package/es/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/vnode.mjs +6 -0
  126. package/es/panel-component/auth-captcha/auth-captcha.mjs +2 -1
  127. package/es/panel-component/panel-button/panel-button.mjs +2 -1
  128. package/es/panel-component/short-cut/short-cut.mjs +2 -2
  129. package/es/panel-component/user-action/user-action.mjs +2 -1
  130. package/es/panel-component/user-message/async-action/async-action/async-action.mjs +2 -1
  131. package/es/panel-component/user-message/internal-message/common/internal-message-container/internal-message-container.mjs +2 -1
  132. package/es/panel-component/user-message/internal-message/internal-message-html/internal-message-html.d.ts +1 -0
  133. package/es/panel-component/user-message/internal-message/internal-message-html/internal-message-html.mjs +10 -4
  134. package/es/panel-component/user-message/internal-message/internal-message-html/internal-message-html.provider.d.ts +1 -0
  135. package/es/panel-component/user-message/user-message.mjs +3 -2
  136. package/es/util/index.d.ts +1 -0
  137. package/es/util/index.mjs +1 -0
  138. package/es/util/notification-util/notification-util.mjs +3 -1
  139. package/es/util/wang-editor-util/wang-editor-util.d.ts +11 -0
  140. package/es/util/wang-editor-util/wang-editor-util.mjs +12 -0
  141. package/lib/common/action-toolbar/action-toolbar.cjs +4 -3
  142. package/lib/common/custom-theme/custom-theme.cjs +3 -2
  143. package/lib/common/data-import2/data-import2.cjs +1 -4
  144. package/lib/common/emoji-select/components/categories/categories.cjs +2 -1
  145. package/lib/common/extend-action-timeline/extend-action-timeline.cjs +3 -2
  146. package/lib/common/grid-setting/grid-setting.cjs +2 -1
  147. package/lib/common/index.cjs +2 -0
  148. package/lib/common/pagination/pagination.cjs +2 -1
  149. package/lib/common/quick-edit/quick-edit.cjs +118 -0
  150. package/lib/common/quick-edit/quick-edit.css +1 -0
  151. package/lib/common/rawitem/rawitem.cjs +2 -1
  152. package/lib/control/app-menu/app-menu.cjs +1 -1
  153. package/lib/control/app-menu/custom-menu-design/custom-menu-design.cjs +1 -1
  154. package/lib/control/app-menu-icon-view/app-menu-icon-view.cjs +3 -2
  155. package/lib/control/calendar/calendar.cjs +2 -1
  156. package/lib/control/calendar/components/calendar-daily/calendar-daily.cjs +2 -1
  157. package/lib/control/calendar/components/calendar-week/calendar-week.cjs +2 -1
  158. package/lib/control/calendar/components/custom-calendar/custom-calendar.cjs +3 -2
  159. package/lib/control/chart/chart.cjs +8 -0
  160. package/lib/control/context-menu/context-menu.cjs +4 -3
  161. package/lib/control/dashboard/custom-dashboard-container/custom-dashboard-container.cjs +2 -1
  162. package/lib/control/dashboard/dashboard-design/dashboard-design.cjs +5 -4
  163. package/lib/control/dashboard/portlet/menu-portlet/app-menu-portlet/app-menu-portlet.cjs +3 -2
  164. package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.cjs +2 -1
  165. package/lib/control/drtab/drtab-control.util.cjs +1 -1
  166. package/lib/control/drtab/drtab.cjs +2 -1
  167. package/lib/control/form/form-detail/form-button/form-button.cjs +2 -1
  168. package/lib/control/form/form-detail/form-item/form-item-container/form-item-container.cjs +3 -2
  169. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.cjs +1 -1
  170. package/lib/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.cjs +2 -1
  171. package/lib/control/form/form-detail/form-mdctrl/mdctrl-container2/mdctrl-container2.cjs +2 -1
  172. package/lib/control/grid/grid/grid-control.util.cjs +9 -72
  173. package/lib/control/grid/grid/grid.cjs +1 -7
  174. package/lib/control/grid/grid/grid.css +1 -1
  175. package/lib/control/grid/grid-column/grid-field-column/grid-field-column.cjs +3 -2
  176. package/lib/control/kanban/kanban.cjs +1 -1
  177. package/lib/control/list/list.cjs +2 -1
  178. package/lib/control/report-panel/report-panel.cjs +5 -0
  179. package/lib/control/search-bar/search-bar.cjs +3 -2
  180. package/lib/control/search-bar/search-groups/search-groups.cjs +5 -5
  181. package/lib/control/toolbar/export-excel/export-excel.cjs +3 -2
  182. package/lib/control/toolbar/short-cut-button/short-cut-button.cjs +2 -4
  183. package/lib/control/toolbar/toolbar.cjs +150 -13
  184. package/lib/control/toolbar/toolbar.css +1 -1
  185. package/lib/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.cjs +3 -2
  186. package/lib/control/wizard-panel/wizard-panel.cjs +2 -1
  187. package/lib/editor/array/ibiz-array/ibiz-array.cjs +12 -3
  188. package/lib/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.cjs +2 -1
  189. package/lib/editor/data-picker/ibiz-mpicker/ibiz-mpicker.cjs +2 -1
  190. package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +2 -1
  191. package/lib/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.cjs +2 -1
  192. package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +9 -4
  193. package/lib/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.cjs +1 -8
  194. package/lib/editor/html/html-editor.controller.cjs +169 -6
  195. package/lib/editor/html/wang-editor/component/emoji/emoji.cjs +44 -0
  196. package/lib/editor/html/wang-editor/component/emoji/emoji.css +1 -0
  197. package/lib/editor/html/wang-editor/component/index.cjs +7 -0
  198. package/lib/editor/html/wang-editor/element/emoji.cjs +24 -0
  199. package/lib/editor/html/wang-editor/element/index.cjs +7 -0
  200. package/lib/editor/html/wang-editor/index.cjs +19 -0
  201. package/lib/editor/html/wang-editor/module/ai-module.cjs +78 -0
  202. package/lib/editor/html/wang-editor/module/emoji-module.cjs +127 -0
  203. package/lib/editor/html/wang-editor/module/index.cjs +9 -0
  204. package/lib/editor/html/wang-editor/plugin/index.cjs +7 -0
  205. package/lib/editor/html/wang-editor/plugin/plugin.cjs +25 -0
  206. package/lib/editor/html/wang-editor/wang-editor.cjs +7 -7
  207. package/lib/editor/html/wang-editor/wang-editor.css +1 -1
  208. package/lib/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.cjs +10 -3
  209. package/lib/editor/span/span/span.cjs +1 -1
  210. package/lib/editor/text-box/ibiz-input-number/ibiz-input-number.cjs +5 -2
  211. package/lib/editor/text-box/input/input.cjs +16 -3
  212. package/lib/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.cjs +2 -1
  213. package/lib/index.cjs +2 -0
  214. package/lib/locale/en/index.cjs +2 -1
  215. package/lib/locale/zh-CN/index.cjs +2 -1
  216. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/h.cjs +93 -0
  217. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/helpers/attachto.cjs +49 -0
  218. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/hooks.cjs +2 -0
  219. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/htmldomapi.cjs +117 -0
  220. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/index.cjs +42 -0
  221. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/init.cjs +378 -0
  222. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/is.cjs +12 -0
  223. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/jsx.cjs +67 -0
  224. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/modules/attributes.cjs +61 -0
  225. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/modules/class.cjs +30 -0
  226. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/modules/dataset.cjs +44 -0
  227. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/modules/eventlisteners.cjs +87 -0
  228. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/modules/props.cjs +26 -0
  229. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/modules/style.cjs +117 -0
  230. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/thunk.cjs +54 -0
  231. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/tovnode.cjs +64 -0
  232. package/lib/node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/vnode.cjs +8 -0
  233. package/lib/panel-component/auth-captcha/auth-captcha.cjs +2 -1
  234. package/lib/panel-component/panel-button/panel-button.cjs +2 -1
  235. package/lib/panel-component/short-cut/short-cut.cjs +1 -1
  236. package/lib/panel-component/user-action/user-action.cjs +2 -1
  237. package/lib/panel-component/user-message/async-action/async-action/async-action.cjs +2 -1
  238. package/lib/panel-component/user-message/internal-message/common/internal-message-container/internal-message-container.cjs +2 -1
  239. package/lib/panel-component/user-message/internal-message/internal-message-html/internal-message-html.cjs +9 -3
  240. package/lib/panel-component/user-message/user-message.cjs +3 -2
  241. package/lib/util/index.cjs +2 -0
  242. package/lib/util/notification-util/notification-util.cjs +3 -1
  243. package/lib/util/wang-editor-util/wang-editor-util.cjs +14 -0
  244. package/package.json +7 -6
  245. package/dist/chart-HuCq_rW2.js +0 -1
  246. package/dist/index-Dq21zXhV.js +0 -4
  247. package/dist/wang-editor-XpJH4SXt.js +0 -1
  248. package/es/editor/html/wang-editor/ai/ai-modules.d.ts +0 -10
  249. package/es/editor/html/wang-editor/ai/ai-modules.mjs +0 -32
  250. package/lib/editor/html/wang-editor/ai/ai-modules.cjs +0 -34
  251. /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.27_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.28-alpha.1_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
  252. /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.27_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.28-alpha.1_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
@@ -0,0 +1,117 @@
1
+ 'use strict';
2
+
3
+ function createElement(tagName, options) {
4
+ return document.createElement(tagName, options);
5
+ }
6
+ function createElementNS(namespaceURI, qualifiedName, options) {
7
+ return document.createElementNS(namespaceURI, qualifiedName, options);
8
+ }
9
+ function createDocumentFragment() {
10
+ return parseFragment(document.createDocumentFragment());
11
+ }
12
+ function createTextNode(text) {
13
+ return document.createTextNode(text);
14
+ }
15
+ function createComment(text) {
16
+ return document.createComment(text);
17
+ }
18
+ function insertBefore(parentNode, newNode, referenceNode) {
19
+ if (isDocumentFragment(parentNode)) {
20
+ let node = parentNode;
21
+ while (node && isDocumentFragment(node)) {
22
+ const fragment = parseFragment(node);
23
+ node = fragment.parent;
24
+ }
25
+ parentNode = node !== null && node !== void 0 ? node : parentNode;
26
+ }
27
+ if (isDocumentFragment(newNode)) {
28
+ newNode = parseFragment(newNode, parentNode);
29
+ }
30
+ if (referenceNode && isDocumentFragment(referenceNode)) {
31
+ referenceNode = parseFragment(referenceNode).firstChildNode;
32
+ }
33
+ parentNode.insertBefore(newNode, referenceNode);
34
+ }
35
+ function removeChild(node, child) {
36
+ node.removeChild(child);
37
+ }
38
+ function appendChild(node, child) {
39
+ if (isDocumentFragment(child)) {
40
+ child = parseFragment(child, node);
41
+ }
42
+ node.appendChild(child);
43
+ }
44
+ function parentNode(node) {
45
+ if (isDocumentFragment(node)) {
46
+ while (node && isDocumentFragment(node)) {
47
+ const fragment = parseFragment(node);
48
+ node = fragment.parent;
49
+ }
50
+ return node !== null && node !== void 0 ? node : null;
51
+ }
52
+ return node.parentNode;
53
+ }
54
+ function nextSibling(node) {
55
+ var _a;
56
+ if (isDocumentFragment(node)) {
57
+ const fragment = parseFragment(node);
58
+ const parent = parentNode(fragment);
59
+ if (parent && fragment.lastChildNode) {
60
+ const children = Array.from(parent.childNodes);
61
+ const index = children.indexOf(fragment.lastChildNode);
62
+ return (_a = children[index + 1]) !== null && _a !== void 0 ? _a : null;
63
+ }
64
+ return null;
65
+ }
66
+ return node.nextSibling;
67
+ }
68
+ function tagName(elm) {
69
+ return elm.tagName;
70
+ }
71
+ function setTextContent(node, text) {
72
+ node.textContent = text;
73
+ }
74
+ function getTextContent(node) {
75
+ return node.textContent;
76
+ }
77
+ function isElement(node) {
78
+ return node.nodeType === 1;
79
+ }
80
+ function isText(node) {
81
+ return node.nodeType === 3;
82
+ }
83
+ function isComment(node) {
84
+ return node.nodeType === 8;
85
+ }
86
+ function isDocumentFragment(node) {
87
+ return node.nodeType === 11;
88
+ }
89
+ function parseFragment(fragmentNode, parentNode) {
90
+ var _a, _b, _c;
91
+ const fragment = fragmentNode;
92
+ (_a = fragment.parent) !== null && _a !== void 0 ? _a : (fragment.parent = parentNode !== null && parentNode !== void 0 ? parentNode : null);
93
+ (_b = fragment.firstChildNode) !== null && _b !== void 0 ? _b : (fragment.firstChildNode = fragmentNode.firstChild);
94
+ (_c = fragment.lastChildNode) !== null && _c !== void 0 ? _c : (fragment.lastChildNode = fragmentNode.lastChild);
95
+ return fragment;
96
+ }
97
+ const htmlDomApi = {
98
+ createElement,
99
+ createElementNS,
100
+ createTextNode,
101
+ createDocumentFragment,
102
+ createComment,
103
+ insertBefore,
104
+ removeChild,
105
+ appendChild,
106
+ parentNode,
107
+ nextSibling,
108
+ tagName,
109
+ setTextContent,
110
+ getTextContent,
111
+ isElement,
112
+ isText,
113
+ isComment,
114
+ isDocumentFragment,
115
+ };
116
+
117
+ exports.htmlDomApi = htmlDomApi;
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ var htmldomapi = require('./htmldomapi.cjs');
4
+ var init = require('./init.cjs');
5
+ var thunk = require('./thunk.cjs');
6
+ var vnode = require('./vnode.cjs');
7
+ var attachto = require('./helpers/attachto.cjs');
8
+ var is = require('./is.cjs');
9
+ var tovnode = require('./tovnode.cjs');
10
+ var h = require('./h.cjs');
11
+ require('./hooks.cjs');
12
+ var attributes = require('./modules/attributes.cjs');
13
+ var _class = require('./modules/class.cjs');
14
+ var dataset = require('./modules/dataset.cjs');
15
+ var eventlisteners = require('./modules/eventlisteners.cjs');
16
+ var props = require('./modules/props.cjs');
17
+ var style = require('./modules/style.cjs');
18
+ var jsx = require('./jsx.cjs');
19
+
20
+ // core
21
+
22
+ exports.htmlDomApi = htmldomapi.htmlDomApi;
23
+ exports.init = init.init;
24
+ exports.thunk = thunk.thunk;
25
+ exports.vnode = vnode.vnode;
26
+ exports.attachTo = attachto.attachTo;
27
+ exports.array = is.array;
28
+ exports.primitive = is.primitive;
29
+ exports.toVNode = tovnode.toVNode;
30
+ exports.fragment = h.fragment;
31
+ exports.h = h.h;
32
+ exports.attributesModule = attributes.attributesModule;
33
+ exports.classModule = _class.classModule;
34
+ exports.datasetModule = dataset.datasetModule;
35
+ exports.eventListenersModule = eventlisteners.eventListenersModule;
36
+ exports.propsModule = props.propsModule;
37
+ exports.styleModule = style.styleModule;
38
+ exports.Fragment = jsx.Fragment;
39
+ Object.defineProperty(exports, "jsx", {
40
+ enumerable: true,
41
+ get: function () { return jsx.jsx; }
42
+ });
@@ -0,0 +1,378 @@
1
+ 'use strict';
2
+
3
+ var vnode = require('./vnode.cjs');
4
+ var is = require('./is.cjs');
5
+ var htmldomapi = require('./htmldomapi.cjs');
6
+
7
+ function isUndef(s) {
8
+ return s === undefined;
9
+ }
10
+ function isDef(s) {
11
+ return s !== undefined;
12
+ }
13
+ const emptyNode = vnode.vnode("", {}, [], undefined, undefined);
14
+ function sameVnode(vnode1, vnode2) {
15
+ var _a, _b;
16
+ const isSameKey = vnode1.key === vnode2.key;
17
+ const isSameIs = ((_a = vnode1.data) === null || _a === void 0 ? void 0 : _a.is) === ((_b = vnode2.data) === null || _b === void 0 ? void 0 : _b.is);
18
+ const isSameSel = vnode1.sel === vnode2.sel;
19
+ const isSameTextOrFragment = !vnode1.sel && vnode1.sel === vnode2.sel
20
+ ? typeof vnode1.text === typeof vnode2.text
21
+ : true;
22
+ return isSameSel && isSameKey && isSameIs && isSameTextOrFragment;
23
+ }
24
+ /**
25
+ * @todo Remove this function when the document fragment is considered stable.
26
+ */
27
+ function documentFragmentIsNotSupported() {
28
+ throw new Error("The document fragment is not supported on this platform.");
29
+ }
30
+ function isElement(api, vnode) {
31
+ return api.isElement(vnode);
32
+ }
33
+ function isDocumentFragment(api, vnode) {
34
+ return api.isDocumentFragment(vnode);
35
+ }
36
+ function createKeyToOldIdx(children, beginIdx, endIdx) {
37
+ var _a;
38
+ const map = {};
39
+ for (let i = beginIdx; i <= endIdx; ++i) {
40
+ const key = (_a = children[i]) === null || _a === void 0 ? void 0 : _a.key;
41
+ if (key !== undefined) {
42
+ map[key] = i;
43
+ }
44
+ }
45
+ return map;
46
+ }
47
+ const hooks = [
48
+ "create",
49
+ "update",
50
+ "remove",
51
+ "destroy",
52
+ "pre",
53
+ "post",
54
+ ];
55
+ function init(modules, domApi, options) {
56
+ const cbs = {
57
+ create: [],
58
+ update: [],
59
+ remove: [],
60
+ destroy: [],
61
+ pre: [],
62
+ post: [],
63
+ };
64
+ const api = domApi !== undefined ? domApi : htmldomapi.htmlDomApi;
65
+ for (const hook of hooks) {
66
+ for (const module of modules) {
67
+ const currentHook = module[hook];
68
+ if (currentHook !== undefined) {
69
+ cbs[hook].push(currentHook);
70
+ }
71
+ }
72
+ }
73
+ function emptyNodeAt(elm) {
74
+ const id = elm.id ? "#" + elm.id : "";
75
+ // elm.className doesn't return a string when elm is an SVG element inside a shadowRoot.
76
+ // https://stackoverflow.com/questions/29454340/detecting-classname-of-svganimatedstring
77
+ const classes = elm.getAttribute("class");
78
+ const c = classes ? "." + classes.split(" ").join(".") : "";
79
+ return vnode.vnode(api.tagName(elm).toLowerCase() + id + c, {}, [], undefined, elm);
80
+ }
81
+ function emptyDocumentFragmentAt(frag) {
82
+ return vnode.vnode(undefined, {}, [], undefined, frag);
83
+ }
84
+ function createRmCb(childElm, listeners) {
85
+ return function rmCb() {
86
+ if (--listeners === 0) {
87
+ const parent = api.parentNode(childElm);
88
+ api.removeChild(parent, childElm);
89
+ }
90
+ };
91
+ }
92
+ function createElm(vnode, insertedVnodeQueue) {
93
+ var _a, _b, _c, _d;
94
+ let i;
95
+ let data = vnode.data;
96
+ if (data !== undefined) {
97
+ const init = (_a = data.hook) === null || _a === void 0 ? void 0 : _a.init;
98
+ if (isDef(init)) {
99
+ init(vnode);
100
+ data = vnode.data;
101
+ }
102
+ }
103
+ const children = vnode.children;
104
+ const sel = vnode.sel;
105
+ if (sel === "!") {
106
+ if (isUndef(vnode.text)) {
107
+ vnode.text = "";
108
+ }
109
+ vnode.elm = api.createComment(vnode.text);
110
+ }
111
+ else if (sel !== undefined) {
112
+ // Parse selector
113
+ const hashIdx = sel.indexOf("#");
114
+ const dotIdx = sel.indexOf(".", hashIdx);
115
+ const hash = hashIdx > 0 ? hashIdx : sel.length;
116
+ const dot = dotIdx > 0 ? dotIdx : sel.length;
117
+ const tag = hashIdx !== -1 || dotIdx !== -1
118
+ ? sel.slice(0, Math.min(hash, dot))
119
+ : sel;
120
+ const elm = (vnode.elm =
121
+ isDef(data) && isDef((i = data.ns))
122
+ ? api.createElementNS(i, tag, data)
123
+ : api.createElement(tag, data));
124
+ if (hash < dot)
125
+ elm.setAttribute("id", sel.slice(hash + 1, dot));
126
+ if (dotIdx > 0)
127
+ elm.setAttribute("class", sel.slice(dot + 1).replace(/\./g, " "));
128
+ for (i = 0; i < cbs.create.length; ++i)
129
+ cbs.create[i](emptyNode, vnode);
130
+ if (is.array(children)) {
131
+ for (i = 0; i < children.length; ++i) {
132
+ const ch = children[i];
133
+ if (ch != null) {
134
+ api.appendChild(elm, createElm(ch, insertedVnodeQueue));
135
+ }
136
+ }
137
+ }
138
+ else if (is.primitive(vnode.text)) {
139
+ api.appendChild(elm, api.createTextNode(vnode.text));
140
+ }
141
+ const hook = vnode.data.hook;
142
+ if (isDef(hook)) {
143
+ (_b = hook.create) === null || _b === void 0 ? void 0 : _b.call(hook, emptyNode, vnode);
144
+ if (hook.insert) {
145
+ insertedVnodeQueue.push(vnode);
146
+ }
147
+ }
148
+ }
149
+ else if (((_c = options === null || options === void 0 ? void 0 : options.experimental) === null || _c === void 0 ? void 0 : _c.fragments) && vnode.children) {
150
+ vnode.elm = ((_d = api.createDocumentFragment) !== null && _d !== void 0 ? _d : documentFragmentIsNotSupported)();
151
+ for (i = 0; i < cbs.create.length; ++i)
152
+ cbs.create[i](emptyNode, vnode);
153
+ for (i = 0; i < vnode.children.length; ++i) {
154
+ const ch = vnode.children[i];
155
+ if (ch != null) {
156
+ api.appendChild(vnode.elm, createElm(ch, insertedVnodeQueue));
157
+ }
158
+ }
159
+ }
160
+ else {
161
+ vnode.elm = api.createTextNode(vnode.text);
162
+ }
163
+ return vnode.elm;
164
+ }
165
+ function addVnodes(parentElm, before, vnodes, startIdx, endIdx, insertedVnodeQueue) {
166
+ for (; startIdx <= endIdx; ++startIdx) {
167
+ const ch = vnodes[startIdx];
168
+ if (ch != null) {
169
+ api.insertBefore(parentElm, createElm(ch, insertedVnodeQueue), before);
170
+ }
171
+ }
172
+ }
173
+ function invokeDestroyHook(vnode) {
174
+ var _a, _b;
175
+ const data = vnode.data;
176
+ if (data !== undefined) {
177
+ (_b = (_a = data === null || data === void 0 ? void 0 : data.hook) === null || _a === void 0 ? void 0 : _a.destroy) === null || _b === void 0 ? void 0 : _b.call(_a, vnode);
178
+ for (let i = 0; i < cbs.destroy.length; ++i)
179
+ cbs.destroy[i](vnode);
180
+ if (vnode.children !== undefined) {
181
+ for (let j = 0; j < vnode.children.length; ++j) {
182
+ const child = vnode.children[j];
183
+ if (child != null && typeof child !== "string") {
184
+ invokeDestroyHook(child);
185
+ }
186
+ }
187
+ }
188
+ }
189
+ }
190
+ function removeVnodes(parentElm, vnodes, startIdx, endIdx) {
191
+ var _a, _b;
192
+ for (; startIdx <= endIdx; ++startIdx) {
193
+ let listeners;
194
+ let rm;
195
+ const ch = vnodes[startIdx];
196
+ if (ch != null) {
197
+ if (isDef(ch.sel)) {
198
+ invokeDestroyHook(ch);
199
+ listeners = cbs.remove.length + 1;
200
+ rm = createRmCb(ch.elm, listeners);
201
+ for (let i = 0; i < cbs.remove.length; ++i)
202
+ cbs.remove[i](ch, rm);
203
+ const removeHook = (_b = (_a = ch === null || ch === void 0 ? void 0 : ch.data) === null || _a === void 0 ? void 0 : _a.hook) === null || _b === void 0 ? void 0 : _b.remove;
204
+ if (isDef(removeHook)) {
205
+ removeHook(ch, rm);
206
+ }
207
+ else {
208
+ rm();
209
+ }
210
+ }
211
+ else if (ch.children) {
212
+ // Fragment node
213
+ invokeDestroyHook(ch);
214
+ removeVnodes(parentElm, ch.children, 0, ch.children.length - 1);
215
+ }
216
+ else {
217
+ // Text node
218
+ api.removeChild(parentElm, ch.elm);
219
+ }
220
+ }
221
+ }
222
+ }
223
+ function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue) {
224
+ let oldStartIdx = 0;
225
+ let newStartIdx = 0;
226
+ let oldEndIdx = oldCh.length - 1;
227
+ let oldStartVnode = oldCh[0];
228
+ let oldEndVnode = oldCh[oldEndIdx];
229
+ let newEndIdx = newCh.length - 1;
230
+ let newStartVnode = newCh[0];
231
+ let newEndVnode = newCh[newEndIdx];
232
+ let oldKeyToIdx;
233
+ let idxInOld;
234
+ let elmToMove;
235
+ let before;
236
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
237
+ if (oldStartVnode == null) {
238
+ oldStartVnode = oldCh[++oldStartIdx]; // Vnode might have been moved left
239
+ }
240
+ else if (oldEndVnode == null) {
241
+ oldEndVnode = oldCh[--oldEndIdx];
242
+ }
243
+ else if (newStartVnode == null) {
244
+ newStartVnode = newCh[++newStartIdx];
245
+ }
246
+ else if (newEndVnode == null) {
247
+ newEndVnode = newCh[--newEndIdx];
248
+ }
249
+ else if (sameVnode(oldStartVnode, newStartVnode)) {
250
+ patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
251
+ oldStartVnode = oldCh[++oldStartIdx];
252
+ newStartVnode = newCh[++newStartIdx];
253
+ }
254
+ else if (sameVnode(oldEndVnode, newEndVnode)) {
255
+ patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
256
+ oldEndVnode = oldCh[--oldEndIdx];
257
+ newEndVnode = newCh[--newEndIdx];
258
+ }
259
+ else if (sameVnode(oldStartVnode, newEndVnode)) {
260
+ // Vnode moved right
261
+ patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
262
+ api.insertBefore(parentElm, oldStartVnode.elm, api.nextSibling(oldEndVnode.elm));
263
+ oldStartVnode = oldCh[++oldStartIdx];
264
+ newEndVnode = newCh[--newEndIdx];
265
+ }
266
+ else if (sameVnode(oldEndVnode, newStartVnode)) {
267
+ // Vnode moved left
268
+ patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
269
+ api.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
270
+ oldEndVnode = oldCh[--oldEndIdx];
271
+ newStartVnode = newCh[++newStartIdx];
272
+ }
273
+ else {
274
+ if (oldKeyToIdx === undefined) {
275
+ oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
276
+ }
277
+ idxInOld = oldKeyToIdx[newStartVnode.key];
278
+ if (isUndef(idxInOld)) {
279
+ // New element
280
+ api.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
281
+ }
282
+ else {
283
+ elmToMove = oldCh[idxInOld];
284
+ if (elmToMove.sel !== newStartVnode.sel) {
285
+ api.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
286
+ }
287
+ else {
288
+ patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
289
+ oldCh[idxInOld] = undefined;
290
+ api.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm);
291
+ }
292
+ }
293
+ newStartVnode = newCh[++newStartIdx];
294
+ }
295
+ }
296
+ if (newStartIdx <= newEndIdx) {
297
+ before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm;
298
+ addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
299
+ }
300
+ if (oldStartIdx <= oldEndIdx) {
301
+ removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
302
+ }
303
+ }
304
+ function patchVnode(oldVnode, vnode, insertedVnodeQueue) {
305
+ var _a, _b, _c, _d, _e, _f, _g, _h;
306
+ const hook = (_a = vnode.data) === null || _a === void 0 ? void 0 : _a.hook;
307
+ (_b = hook === null || hook === void 0 ? void 0 : hook.prepatch) === null || _b === void 0 ? void 0 : _b.call(hook, oldVnode, vnode);
308
+ const elm = (vnode.elm = oldVnode.elm);
309
+ if (oldVnode === vnode)
310
+ return;
311
+ if (vnode.data !== undefined ||
312
+ (isDef(vnode.text) && vnode.text !== oldVnode.text)) {
313
+ (_c = vnode.data) !== null && _c !== void 0 ? _c : (vnode.data = {});
314
+ (_d = oldVnode.data) !== null && _d !== void 0 ? _d : (oldVnode.data = {});
315
+ for (let i = 0; i < cbs.update.length; ++i)
316
+ cbs.update[i](oldVnode, vnode);
317
+ (_g = (_f = (_e = vnode.data) === null || _e === void 0 ? void 0 : _e.hook) === null || _f === void 0 ? void 0 : _f.update) === null || _g === void 0 ? void 0 : _g.call(_f, oldVnode, vnode);
318
+ }
319
+ const oldCh = oldVnode.children;
320
+ const ch = vnode.children;
321
+ if (isUndef(vnode.text)) {
322
+ if (isDef(oldCh) && isDef(ch)) {
323
+ if (oldCh !== ch)
324
+ updateChildren(elm, oldCh, ch, insertedVnodeQueue);
325
+ }
326
+ else if (isDef(ch)) {
327
+ if (isDef(oldVnode.text))
328
+ api.setTextContent(elm, "");
329
+ addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
330
+ }
331
+ else if (isDef(oldCh)) {
332
+ removeVnodes(elm, oldCh, 0, oldCh.length - 1);
333
+ }
334
+ else if (isDef(oldVnode.text)) {
335
+ api.setTextContent(elm, "");
336
+ }
337
+ }
338
+ else if (oldVnode.text !== vnode.text) {
339
+ if (isDef(oldCh)) {
340
+ removeVnodes(elm, oldCh, 0, oldCh.length - 1);
341
+ }
342
+ api.setTextContent(elm, vnode.text);
343
+ }
344
+ (_h = hook === null || hook === void 0 ? void 0 : hook.postpatch) === null || _h === void 0 ? void 0 : _h.call(hook, oldVnode, vnode);
345
+ }
346
+ return function patch(oldVnode, vnode) {
347
+ let i, elm, parent;
348
+ const insertedVnodeQueue = [];
349
+ for (i = 0; i < cbs.pre.length; ++i)
350
+ cbs.pre[i]();
351
+ if (isElement(api, oldVnode)) {
352
+ oldVnode = emptyNodeAt(oldVnode);
353
+ }
354
+ else if (isDocumentFragment(api, oldVnode)) {
355
+ oldVnode = emptyDocumentFragmentAt(oldVnode);
356
+ }
357
+ if (sameVnode(oldVnode, vnode)) {
358
+ patchVnode(oldVnode, vnode, insertedVnodeQueue);
359
+ }
360
+ else {
361
+ elm = oldVnode.elm;
362
+ parent = api.parentNode(elm);
363
+ createElm(vnode, insertedVnodeQueue);
364
+ if (parent !== null) {
365
+ api.insertBefore(parent, vnode.elm, api.nextSibling(elm));
366
+ removeVnodes(parent, [oldVnode], 0, 0);
367
+ }
368
+ }
369
+ for (i = 0; i < insertedVnodeQueue.length; ++i) {
370
+ insertedVnodeQueue[i].data.hook.insert(insertedVnodeQueue[i]);
371
+ }
372
+ for (i = 0; i < cbs.post.length; ++i)
373
+ cbs.post[i]();
374
+ return vnode;
375
+ };
376
+ }
377
+
378
+ exports.init = init;
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const array = Array.isArray;
4
+ function primitive(s) {
5
+ return (typeof s === "string" ||
6
+ typeof s === "number" ||
7
+ s instanceof String ||
8
+ s instanceof Number);
9
+ }
10
+
11
+ exports.array = array;
12
+ exports.primitive = primitive;
@@ -0,0 +1,67 @@
1
+ 'use strict';
2
+
3
+ var vnode = require('./vnode.cjs');
4
+ var h = require('./h.cjs');
5
+
6
+ /* eslint-disable @typescript-eslint/no-namespace, import/export */
7
+ function Fragment(data, ...children) {
8
+ const flatChildren = flattenAndFilter(children, []);
9
+ if (flatChildren.length === 1 &&
10
+ !flatChildren[0].sel &&
11
+ flatChildren[0].text) {
12
+ // only child is a simple text node, pass as text for a simpler vtree
13
+ return vnode.vnode(undefined, undefined, undefined, flatChildren[0].text, undefined);
14
+ }
15
+ else {
16
+ return vnode.vnode(undefined, data !== null && data !== void 0 ? data : {}, flatChildren, undefined, undefined);
17
+ }
18
+ }
19
+ function flattenAndFilter(children, flattened) {
20
+ for (const child of children) {
21
+ // filter out falsey children, except 0 since zero can be a valid value e.g inside a chart
22
+ if (child !== undefined &&
23
+ child !== null &&
24
+ child !== false &&
25
+ child !== "") {
26
+ if (Array.isArray(child)) {
27
+ flattenAndFilter(child, flattened);
28
+ }
29
+ else if (typeof child === "string" ||
30
+ typeof child === "number" ||
31
+ typeof child === "boolean") {
32
+ flattened.push(vnode.vnode(undefined, undefined, undefined, String(child), undefined));
33
+ }
34
+ else {
35
+ flattened.push(child);
36
+ }
37
+ }
38
+ }
39
+ return flattened;
40
+ }
41
+ /**
42
+ * jsx/tsx compatible factory function
43
+ * see: https://www.typescriptlang.org/docs/handbook/jsx.html#factory-functions
44
+ */
45
+ function jsx(tag, data, ...children) {
46
+ const flatChildren = flattenAndFilter(children, []);
47
+ if (typeof tag === "function") {
48
+ // tag is a function component
49
+ return tag(data, flatChildren);
50
+ }
51
+ else {
52
+ if (flatChildren.length === 1 &&
53
+ !flatChildren[0].sel &&
54
+ flatChildren[0].text) {
55
+ // only child is a simple text node, pass as text for a simpler vtree
56
+ return h.h(tag, data, flatChildren[0].text);
57
+ }
58
+ else {
59
+ return h.h(tag, data, flatChildren);
60
+ }
61
+ }
62
+ }
63
+ (function (jsx) {
64
+ })(jsx || (jsx = {}));
65
+
66
+ exports.Fragment = Fragment;
67
+ exports.jsx = jsx;
@@ -0,0 +1,61 @@
1
+ 'use strict';
2
+
3
+ const xlinkNS = "http://www.w3.org/1999/xlink";
4
+ const xmlNS = "http://www.w3.org/XML/1998/namespace";
5
+ const colonChar = 58;
6
+ const xChar = 120;
7
+ function updateAttrs(oldVnode, vnode) {
8
+ let key;
9
+ const elm = vnode.elm;
10
+ let oldAttrs = oldVnode.data.attrs;
11
+ let attrs = vnode.data.attrs;
12
+ if (!oldAttrs && !attrs)
13
+ return;
14
+ if (oldAttrs === attrs)
15
+ return;
16
+ oldAttrs = oldAttrs || {};
17
+ attrs = attrs || {};
18
+ // update modified attributes, add new attributes
19
+ for (key in attrs) {
20
+ const cur = attrs[key];
21
+ const old = oldAttrs[key];
22
+ if (old !== cur) {
23
+ if (cur === true) {
24
+ elm.setAttribute(key, "");
25
+ }
26
+ else if (cur === false) {
27
+ elm.removeAttribute(key);
28
+ }
29
+ else {
30
+ if (key.charCodeAt(0) !== xChar) {
31
+ elm.setAttribute(key, cur);
32
+ }
33
+ else if (key.charCodeAt(3) === colonChar) {
34
+ // Assume xml namespace
35
+ elm.setAttributeNS(xmlNS, key, cur);
36
+ }
37
+ else if (key.charCodeAt(5) === colonChar) {
38
+ // Assume xlink namespace
39
+ elm.setAttributeNS(xlinkNS, key, cur);
40
+ }
41
+ else {
42
+ elm.setAttribute(key, cur);
43
+ }
44
+ }
45
+ }
46
+ }
47
+ // remove removed attributes
48
+ // use `in` operator since the previous `for` iteration uses it (.i.e. add even attributes with undefined value)
49
+ // the other option is to remove all attributes with value == undefined
50
+ for (key in oldAttrs) {
51
+ if (!(key in attrs)) {
52
+ elm.removeAttribute(key);
53
+ }
54
+ }
55
+ }
56
+ const attributesModule = {
57
+ create: updateAttrs,
58
+ update: updateAttrs,
59
+ };
60
+
61
+ exports.attributesModule = attributesModule;