@nanahoshi/mona-ui 0.27.1 → 0.28.0

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 (359) hide show
  1. package/docs/api/auto-complete.md +67 -0
  2. package/docs/api/avatar.md +31 -0
  3. package/docs/api/breadcrumb.md +74 -0
  4. package/docs/api/button-group.md +71 -0
  5. package/docs/api/button.md +84 -0
  6. package/docs/api/calendar.md +123 -0
  7. package/docs/api/card.md +97 -0
  8. package/docs/api/chart.md +4380 -0
  9. package/docs/api/check-box.md +70 -0
  10. package/docs/api/chip.md +55 -0
  11. package/docs/api/circular-progress-bar.md +71 -0
  12. package/docs/api/collapsible.md +71 -0
  13. package/docs/api/color-gradient.md +54 -0
  14. package/docs/api/color-palette.md +52 -0
  15. package/docs/api/color-picker.md +89 -0
  16. package/docs/api/combo-box.md +69 -0
  17. package/docs/api/command.md +282 -0
  18. package/docs/api/common.md +599 -0
  19. package/docs/api/contextmenu.md +239 -0
  20. package/docs/api/date-input.md +119 -0
  21. package/docs/api/date-picker.md +67 -0
  22. package/docs/api/datetime-picker.md +72 -0
  23. package/docs/api/dialog.md +291 -0
  24. package/docs/api/dropdown-button.md +248 -0
  25. package/docs/api/dropdown-list.md +72 -0
  26. package/docs/api/dropdowns.md +172 -0
  27. package/docs/api/editor.md +117 -0
  28. package/docs/api/expansion-panel.md +85 -0
  29. package/docs/api/fieldset.md +33 -0
  30. package/docs/api/filter.md +116 -0
  31. package/docs/api/grid.md +1445 -0
  32. package/docs/api/i18n.md +1699 -0
  33. package/docs/api/label.md +58 -0
  34. package/docs/api/list-box.md +301 -0
  35. package/docs/api/list-view.md +294 -0
  36. package/docs/api/list.md +119 -0
  37. package/docs/api/locales.md +134 -0
  38. package/docs/api/menubar.md +275 -0
  39. package/docs/api/multi-select.md +92 -0
  40. package/docs/api/notification.md +164 -0
  41. package/docs/api/numeric-text-box.md +130 -0
  42. package/docs/api/otp-input.md +100 -0
  43. package/docs/api/pager.md +371 -0
  44. package/docs/api/placeholder.md +18 -0
  45. package/docs/api/popover.md +170 -0
  46. package/docs/api/popup-menu.md +328 -0
  47. package/docs/api/popup.md +299 -0
  48. package/docs/api/progress-bar.md +79 -0
  49. package/docs/api/query.md +367 -0
  50. package/docs/api/radio-button.md +113 -0
  51. package/docs/api/rating.md +187 -0
  52. package/docs/api/scroll-view.md +93 -0
  53. package/docs/api/segmented.md +114 -0
  54. package/docs/api/sheet.md +65 -0
  55. package/docs/api/sidebar.md +583 -0
  56. package/docs/api/skeleton.md +26 -0
  57. package/docs/api/slider.md +173 -0
  58. package/docs/api/spinner.md +132 -0
  59. package/docs/api/split-button.md +261 -0
  60. package/docs/api/splitter.md +57 -0
  61. package/docs/api/stepper.md +148 -0
  62. package/docs/api/switch.md +78 -0
  63. package/docs/api/tabs.md +139 -0
  64. package/docs/api/text-area.md +20 -0
  65. package/docs/api/text-box.md +106 -0
  66. package/docs/api/theme.md +627 -0
  67. package/docs/api/time-picker.md +69 -0
  68. package/docs/api/time-selector.md +54 -0
  69. package/docs/api/tooltip.md +112 -0
  70. package/docs/api/tree-view.md +631 -0
  71. package/docs/api/window.md +245 -0
  72. package/docs/auto-complete.md +28 -329
  73. package/docs/avatar.md +4 -24
  74. package/docs/breadcrumb.md +10 -65
  75. package/docs/button-group.md +7 -60
  76. package/docs/button.md +8 -67
  77. package/docs/calendar.md +16 -121
  78. package/docs/card.md +16 -79
  79. package/docs/chart-bar.md +16 -234
  80. package/docs/chart-financial.md +10 -121
  81. package/docs/chart-funnel.md +13 -176
  82. package/docs/chart-heatmap.md +15 -131
  83. package/docs/chart-line-area.md +12 -137
  84. package/docs/chart-pie.md +17 -221
  85. package/docs/chart-radar.md +13 -129
  86. package/docs/chart-radial.md +13 -211
  87. package/docs/chart-scatter.md +6 -74
  88. package/docs/chart-treemap.md +14 -196
  89. package/docs/chart.md +168 -1892
  90. package/docs/checkbox.md +5 -61
  91. package/docs/chip.md +7 -42
  92. package/docs/circular-progress-bar.md +9 -61
  93. package/docs/collapsible.md +5 -87
  94. package/docs/color-gradient.md +8 -81
  95. package/docs/color-palette.md +7 -69
  96. package/docs/color-picker.md +9 -105
  97. package/docs/combo-box.md +28 -331
  98. package/docs/command.md +25 -236
  99. package/docs/contextmenu.md +15 -140
  100. package/docs/date-picker.md +7 -110
  101. package/docs/datetime-picker.md +7 -129
  102. package/docs/decimal-textbox.md +6 -69
  103. package/docs/dialog.md +23 -263
  104. package/docs/dropdown-button.md +15 -146
  105. package/docs/dropdown-list.md +29 -332
  106. package/docs/editor.md +10 -164
  107. package/docs/expansion-panel.md +7 -69
  108. package/docs/fieldset.md +5 -24
  109. package/docs/grid-columns.md +12 -92
  110. package/docs/grid-editing.md +29 -291
  111. package/docs/grid-grouping.md +11 -50
  112. package/docs/grid-rows.md +10 -74
  113. package/docs/grid-selection.md +7 -36
  114. package/docs/grid-server.md +8 -293
  115. package/docs/grid-sorting-filtering.md +10 -333
  116. package/docs/grid-state-export.md +17 -228
  117. package/docs/grid.md +23 -216
  118. package/docs/input.md +7 -19
  119. package/docs/installation.md +147 -15
  120. package/docs/introduction.md +37 -15
  121. package/docs/label.md +8 -39
  122. package/docs/list-box.md +21 -253
  123. package/docs/list-view.md +25 -232
  124. package/docs/menubar.md +21 -167
  125. package/docs/multi-select.md +31 -350
  126. package/docs/notification.md +17 -116
  127. package/docs/numeric-textbox.md +9 -78
  128. package/docs/otp-input.md +9 -95
  129. package/docs/pager.md +19 -239
  130. package/docs/placeholder.md +5 -18
  131. package/docs/popover.md +13 -123
  132. package/docs/popup-menu.md +22 -243
  133. package/docs/popup.md +24 -248
  134. package/docs/progress-bar.md +10 -75
  135. package/docs/radio-button.md +8 -96
  136. package/docs/range-slider.md +9 -82
  137. package/docs/rating.md +15 -163
  138. package/docs/scroll-view.md +9 -86
  139. package/docs/segmented.md +8 -90
  140. package/docs/sheet.md +10 -74
  141. package/docs/sidebar-menus.md +20 -155
  142. package/docs/sidebar-state.md +16 -134
  143. package/docs/sidebar.md +18 -218
  144. package/docs/skeleton.md +5 -26
  145. package/docs/slider.md +9 -97
  146. package/docs/spinner.md +15 -95
  147. package/docs/split-button.md +21 -166
  148. package/docs/splitter.md +9 -56
  149. package/docs/stepper.md +13 -127
  150. package/docs/switch.md +8 -58
  151. package/docs/tabs.md +13 -111
  152. package/docs/textarea.md +4 -13
  153. package/docs/textbox.md +10 -77
  154. package/docs/theming-built-in-themes.md +67 -0
  155. package/docs/theming-custom-colors.md +274 -0
  156. package/docs/theming-custom-themes.md +168 -0
  157. package/docs/theming.md +164 -248
  158. package/docs/time-picker.md +7 -112
  159. package/docs/tooltip-directive.md +12 -96
  160. package/docs/tooltip.md +12 -96
  161. package/docs/tree-view.md +42 -495
  162. package/docs/window.md +19 -230
  163. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
  164. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
  165. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
  166. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
  167. package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
  168. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
  169. package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
  170. package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
  171. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
  172. package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
  173. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
  174. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -389
  175. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
  176. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
  177. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
  178. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
  179. package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
  180. package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -740
  181. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
  182. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -254
  183. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
  184. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
  185. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
  186. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
  187. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
  188. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -729
  189. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
  190. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
  191. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
  192. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
  193. package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
  194. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
  195. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
  196. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
  197. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
  198. package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
  199. package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
  200. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
  201. package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5068
  202. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
  203. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
  204. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
  205. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
  206. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
  207. package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
  208. package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
  209. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
  210. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
  211. package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
  212. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
  213. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
  214. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
  215. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
  216. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
  217. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
  218. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
  219. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
  220. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
  221. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
  222. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
  223. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
  224. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
  225. package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
  226. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
  227. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
  228. package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
  229. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
  230. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
  231. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
  232. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
  233. package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
  234. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
  235. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
  236. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
  237. package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
  238. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
  239. package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
  240. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
  241. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
  242. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
  243. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
  244. package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
  245. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
  246. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
  247. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
  248. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
  249. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
  250. package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
  251. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
  252. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
  253. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
  254. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
  255. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
  256. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
  257. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
  258. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
  259. package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
  260. package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
  261. package/llms.txt +80 -2
  262. package/package.json +62 -23
  263. package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
  264. package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
  265. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
  266. package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
  267. package/types/nanahoshi-mona-ui-button.d.ts +227 -166
  268. package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
  269. package/types/nanahoshi-mona-ui-card.d.ts +125 -111
  270. package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
  271. package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
  272. package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
  273. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
  274. package/types/nanahoshi-mona-ui-collapsible.d.ts +105 -87
  275. package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
  276. package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
  277. package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
  278. package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
  279. package/types/nanahoshi-mona-ui-command.d.ts +279 -191
  280. package/types/nanahoshi-mona-ui-common.d.ts +360 -385
  281. package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
  282. package/types/nanahoshi-mona-ui-date-input.d.ts +97 -97
  283. package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
  284. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
  285. package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
  286. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
  287. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
  288. package/types/nanahoshi-mona-ui-dropdowns.d.ts +255 -235
  289. package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
  290. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
  291. package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
  292. package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
  293. package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
  294. package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
  295. package/types/nanahoshi-mona-ui-i18n.d.ts +999 -1052
  296. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
  297. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
  298. package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
  299. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
  300. package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
  301. package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
  302. package/types/nanahoshi-mona-ui-label.d.ts +108 -78
  303. package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
  304. package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
  305. package/types/nanahoshi-mona-ui-list.d.ts +2 -1
  306. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
  307. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
  308. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
  309. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
  310. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
  311. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
  312. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
  313. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
  314. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
  315. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
  316. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
  317. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
  318. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
  319. package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
  320. package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
  321. package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
  322. package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
  323. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
  324. package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
  325. package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
  326. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
  327. package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
  328. package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
  329. package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
  330. package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
  331. package/types/nanahoshi-mona-ui-query.d.ts +82 -88
  332. package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
  333. package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
  334. package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
  335. package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
  336. package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
  337. package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
  338. package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
  339. package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
  340. package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
  341. package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
  342. package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
  343. package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
  344. package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
  345. package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
  346. package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
  347. package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
  348. package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
  349. package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
  350. package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
  351. package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
  352. package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
  353. package/types/nanahoshi-mona-ui-window.d.ts +494 -399
  354. package/types/nanahoshi-mona-ui.d.ts +1 -2
  355. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
  356. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
  357. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
  358. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
  359. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
@@ -1,787 +1,616 @@
1
- import * as i0 from '@angular/core';
2
- import { Pipe, linkedSignal, computed, signal, untracked } from '@angular/core';
3
- import { any, contains, all, firstOrDefault, ImmutableDictionary } from '@mirei/ts-collections';
4
-
5
- class PreventableEvent {
6
- #event;
7
- #type;
8
- #defaultPrevented = false;
9
- constructor(type, event) {
10
- this.#type = type;
11
- this.#event = event;
12
- }
13
- /** Whether `preventDefault()` was called. */
14
- isDefaultPrevented() {
15
- return this.#defaultPrevented;
16
- }
17
- /** Cancels what the event announces, such as opening or closing a popup, or closing a dialog. */
18
- preventDefault() {
19
- this.#defaultPrevented = true;
20
- }
21
- /** The DOM event that caused this one, when there is one. */
22
- get originalEvent() {
23
- return this.#event;
24
- }
25
- /** A name for the kind of event, when the component that emits it sets one. */
26
- get type() {
27
- return this.#type;
28
- }
29
- }
30
-
31
- class FilterChangeEvent extends PreventableEvent {
32
- #filter;
33
- constructor(filterText) {
34
- super("filterInputChange");
35
- this.#filter = filterText;
36
- }
37
- get filter() {
38
- return this.#filter;
39
- }
40
- }
41
-
42
- class AnyPipe {
43
- transform(sequence, predicate) {
44
- if (sequence == null) {
45
- return false;
46
- }
47
- if (!predicate) {
48
- return any(sequence);
49
- }
50
- return any(sequence, predicate);
51
- }
52
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AnyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
53
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: AnyPipe, isStandalone: true, name: "monaAny" }); }
54
- }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AnyPipe, decorators: [{
56
- type: Pipe,
57
- args: [{
58
- name: "monaAny"
59
- }]
60
- }] });
61
-
62
- class ContainsPipe {
63
- transform(sequence, value) {
64
- if (sequence == null) {
65
- return false;
66
- }
67
- if (typeof value === "string") {
68
- return contains(sequence, value);
69
- }
70
- if (Symbol.iterator in Object(value)) {
71
- return all(value, item => contains(sequence, item));
72
- }
73
- return contains(sequence, value);
74
- }
75
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContainsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
76
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: ContainsPipe, isStandalone: true, name: "monaContains" }); }
77
- }
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ContainsPipe, decorators: [{
79
- type: Pipe,
80
- args: [{
81
- name: "monaContains"
82
- }]
83
- }] });
84
-
85
- class SlicePipe {
86
- /**
87
- * Returns the elements from `start` up to, but not including, `end`, with the semantics of `Array.prototype.slice`:
88
- * negative indices count from the end, and an omitted `end` slices to the end. Returns an empty array for
89
- * `null` or `undefined`, such as the first value of the `async` pipe.
90
- */
91
- transform(value, start, end) {
92
- if (value == null) {
93
- return [];
94
- }
95
- return Array.from(value).slice(start, end);
96
- }
97
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SlicePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
98
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: SlicePipe, isStandalone: true, name: "monaSlice" }); }
99
- }
100
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SlicePipe, decorators: [{
101
- type: Pipe,
102
- args: [{
103
- name: "monaSlice"
104
- }]
105
- }] });
106
-
107
- class TakeFirstPipe {
108
- transform(value) {
109
- if (value == null) {
110
- return null;
111
- }
112
- return firstOrDefault(value);
113
- }
114
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TakeFirstPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
115
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: TakeFirstPipe, isStandalone: true, name: "monaTakeFirst" }); }
116
- }
117
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TakeFirstPipe, decorators: [{
118
- type: Pipe,
119
- args: [{
120
- name: "monaTakeFirst"
121
- }]
122
- }] });
123
-
1
+ import * as i0 from "@angular/core";
2
+ import { Pipe, computed, linkedSignal, signal, untracked } from "@angular/core";
3
+ import { ImmutableDictionary, all, any, contains, firstOrDefault } from "@mirei/ts-collections";
4
+ var PreventableEvent = class {
5
+ #event;
6
+ #type;
7
+ #defaultPrevented = false;
8
+ constructor(type, event) {
9
+ this.#type = type;
10
+ this.#event = event;
11
+ }
12
+ isDefaultPrevented() {
13
+ return this.#defaultPrevented;
14
+ }
15
+ preventDefault() {
16
+ this.#defaultPrevented = true;
17
+ }
18
+ get originalEvent() {
19
+ return this.#event;
20
+ }
21
+ get type() {
22
+ return this.#type;
23
+ }
24
+ };
25
+ var FilterChangeEvent = class extends PreventableEvent {
26
+ #filter;
27
+ constructor(filterText) {
28
+ super("filterInputChange");
29
+ this.#filter = filterText;
30
+ }
31
+ get filter() {
32
+ return this.#filter;
33
+ }
34
+ };
35
+ var AnyPipe = class AnyPipe {
36
+ transform(sequence, predicate) {
37
+ if (sequence == null) return false;
38
+ if (!predicate) return any(sequence);
39
+ return any(sequence, predicate);
40
+ }
41
+ static {
42
+ this.ɵfac = i0.ɵɵngDeclareFactory({
43
+ minVersion: "12.0.0",
44
+ version: "22.2.6",
45
+ ngImport: i0,
46
+ type: AnyPipe,
47
+ deps: [],
48
+ target: i0.ɵɵFactoryTarget.Pipe
49
+ });
50
+ }
51
+ static {
52
+ this.ɵpipe = i0.ɵɵngDeclarePipe({
53
+ minVersion: "14.0.0",
54
+ version: "22.2.6",
55
+ ngImport: i0,
56
+ type: AnyPipe,
57
+ isStandalone: true,
58
+ name: "monaAny"
59
+ });
60
+ }
61
+ };
62
+ i0.ɵɵngDeclareClassMetadata({
63
+ minVersion: "12.0.0",
64
+ version: "22.2.6",
65
+ ngImport: i0,
66
+ type: AnyPipe,
67
+ decorators: [{
68
+ type: Pipe,
69
+ args: [{ name: "monaAny" }]
70
+ }]
71
+ });
72
+ var ContainsPipe = class ContainsPipe {
73
+ transform(sequence, value) {
74
+ if (sequence == null) return false;
75
+ if (typeof value === "string") return contains(sequence, value);
76
+ if (Symbol.iterator in Object(value)) return all(value, (item) => contains(sequence, item));
77
+ return contains(sequence, value);
78
+ }
79
+ static {
80
+ this.ɵfac = i0.ɵɵngDeclareFactory({
81
+ minVersion: "12.0.0",
82
+ version: "22.2.6",
83
+ ngImport: i0,
84
+ type: ContainsPipe,
85
+ deps: [],
86
+ target: i0.ɵɵFactoryTarget.Pipe
87
+ });
88
+ }
89
+ static {
90
+ this.ɵpipe = i0.ɵɵngDeclarePipe({
91
+ minVersion: "14.0.0",
92
+ version: "22.2.6",
93
+ ngImport: i0,
94
+ type: ContainsPipe,
95
+ isStandalone: true,
96
+ name: "monaContains"
97
+ });
98
+ }
99
+ };
100
+ i0.ɵɵngDeclareClassMetadata({
101
+ minVersion: "12.0.0",
102
+ version: "22.2.6",
103
+ ngImport: i0,
104
+ type: ContainsPipe,
105
+ decorators: [{
106
+ type: Pipe,
107
+ args: [{ name: "monaContains" }]
108
+ }]
109
+ });
110
+ var SlicePipe = class SlicePipe {
111
+ transform(value, start, end) {
112
+ if (value == null) return [];
113
+ return Array.from(value).slice(start, end);
114
+ }
115
+ static {
116
+ this.ɵfac = i0.ɵɵngDeclareFactory({
117
+ minVersion: "12.0.0",
118
+ version: "22.2.6",
119
+ ngImport: i0,
120
+ type: SlicePipe,
121
+ deps: [],
122
+ target: i0.ɵɵFactoryTarget.Pipe
123
+ });
124
+ }
125
+ static {
126
+ this.ɵpipe = i0.ɵɵngDeclarePipe({
127
+ minVersion: "14.0.0",
128
+ version: "22.2.6",
129
+ ngImport: i0,
130
+ type: SlicePipe,
131
+ isStandalone: true,
132
+ name: "monaSlice"
133
+ });
134
+ }
135
+ };
136
+ i0.ɵɵngDeclareClassMetadata({
137
+ minVersion: "12.0.0",
138
+ version: "22.2.6",
139
+ ngImport: i0,
140
+ type: SlicePipe,
141
+ decorators: [{
142
+ type: Pipe,
143
+ args: [{ name: "monaSlice" }]
144
+ }]
145
+ });
146
+ var TakeFirstPipe = class TakeFirstPipe {
147
+ transform(value) {
148
+ if (value == null) return null;
149
+ return firstOrDefault(value);
150
+ }
151
+ static {
152
+ this.ɵfac = i0.ɵɵngDeclareFactory({
153
+ minVersion: "12.0.0",
154
+ version: "22.2.6",
155
+ ngImport: i0,
156
+ type: TakeFirstPipe,
157
+ deps: [],
158
+ target: i0.ɵɵFactoryTarget.Pipe
159
+ });
160
+ }
161
+ static {
162
+ this.ɵpipe = i0.ɵɵngDeclarePipe({
163
+ minVersion: "14.0.0",
164
+ version: "22.2.6",
165
+ ngImport: i0,
166
+ type: TakeFirstPipe,
167
+ isStandalone: true,
168
+ name: "monaTakeFirst"
169
+ });
170
+ }
171
+ };
172
+ i0.ɵɵngDeclareClassMetadata({
173
+ minVersion: "12.0.0",
174
+ version: "22.2.6",
175
+ ngImport: i0,
176
+ type: TakeFirstPipe,
177
+ decorators: [{
178
+ type: Pipe,
179
+ args: [{ name: "monaTakeFirst" }]
180
+ }]
181
+ });
124
182
  const defaultOptions = { arrayStrategy: { kind: "replace" } };
125
183
  const isEmptyObject = (obj) => {
126
- return Object.keys(obj).length === 0;
184
+ return Object.keys(obj).length === 0;
127
185
  };
128
186
  const isPlainObject = (v) => {
129
- return !!v && typeof v === "object" && Object.getPrototypeOf(v) === Object.prototype;
187
+ return !!v && typeof v === "object" && Object.getPrototypeOf(v) === Object.prototype;
130
188
  };
131
189
  function deepMerge(base, patch, options = defaultOptions, path = []) {
132
- if (!isPlainObject(patch)) {
133
- return base;
134
- }
135
- const out = isPlainObject(base) ? { ...base } : {};
136
- const keys = Object.keys(patch);
137
- for (const key of keys) {
138
- if (key === "__proto__") {
139
- continue;
140
- }
141
- const patchValue = patch[key];
142
- if (patchValue === undefined) {
143
- if (options.undefinedValues === "assign") {
144
- out[key] = undefined;
145
- }
146
- continue;
147
- }
148
- const baseValue = out[key];
149
- const currentPath = [...path, key];
150
- if (Array.isArray(patchValue)) {
151
- const rawStrategy = options.arrayStrategy ?? defaultOptions.arrayStrategy;
152
- const strategy = typeof rawStrategy === "function" ? rawStrategy(key, currentPath) : rawStrategy;
153
- if (strategy.kind === "replace" || !Array.isArray(baseValue)) {
154
- out[key] = patchValue;
155
- }
156
- else if (strategy.kind === "concat") {
157
- out[key] = [
158
- ...baseValue,
159
- ...patchValue
160
- ];
161
- }
162
- else {
163
- // unionBy strategy: a patch item is merged into the base item with the same key; items without a
164
- // key are kept as they are.
165
- const identify = createUnionIdentifier(strategy.key);
166
- const items = [];
167
- const indexById = new Map();
168
- const add = (item, merge) => {
169
- const id = identify(item);
170
- const index = id === undefined ? undefined : indexById.get(id);
171
- if (index === undefined) {
172
- if (id !== undefined) {
173
- indexById.set(id, items.length);
174
- }
175
- items.push(item);
176
- return;
177
- }
178
- const existing = items[index];
179
- items[index] = !merge
180
- ? item
181
- : isPlainObject(item) && isPlainObject(existing)
182
- ? deepMerge(existing, item, options, currentPath)
183
- : { ...existing, ...item };
184
- };
185
- for (const item of baseValue) {
186
- add(item, false);
187
- }
188
- for (const item of patchValue) {
189
- add(item, true);
190
- }
191
- out[key] = items;
192
- }
193
- continue;
194
- }
195
- if (isPlainObject(patchValue) && isPlainObject(baseValue)) {
196
- out[key] = deepMerge(baseValue, patchValue, options, currentPath);
197
- continue;
198
- }
199
- out[key] = patchValue;
200
- }
201
- return out;
190
+ if (!isPlainObject(patch)) return base;
191
+ const out = isPlainObject(base) ? { ...base } : {};
192
+ const keys = Object.keys(patch);
193
+ for (const key of keys) {
194
+ if (key === "__proto__") continue;
195
+ const patchValue = patch[key];
196
+ if (patchValue === void 0) {
197
+ if (options.undefinedValues === "assign") out[key] = void 0;
198
+ continue;
199
+ }
200
+ const baseValue = out[key];
201
+ const currentPath = [...path, key];
202
+ if (Array.isArray(patchValue)) {
203
+ const rawStrategy = options.arrayStrategy ?? defaultOptions.arrayStrategy;
204
+ const strategy = typeof rawStrategy === "function" ? rawStrategy(key, currentPath) : rawStrategy;
205
+ if (strategy.kind === "replace" || !Array.isArray(baseValue)) out[key] = patchValue;
206
+ else if (strategy.kind === "concat") out[key] = [...baseValue, ...patchValue];
207
+ else {
208
+ const identify = createUnionIdentifier(strategy.key);
209
+ const items = [];
210
+ const indexById = /* @__PURE__ */ new Map();
211
+ const add = (item, merge) => {
212
+ const id = identify(item);
213
+ const index = id === void 0 ? void 0 : indexById.get(id);
214
+ if (index === void 0) {
215
+ if (id !== void 0) indexById.set(id, items.length);
216
+ items.push(item);
217
+ return;
218
+ }
219
+ const existing = items[index];
220
+ items[index] = !merge ? item : isPlainObject(item) && isPlainObject(existing) ? deepMerge(existing, item, options, currentPath) : {
221
+ ...existing,
222
+ ...item
223
+ };
224
+ };
225
+ for (const item of baseValue) add(item, false);
226
+ for (const item of patchValue) add(item, true);
227
+ out[key] = items;
228
+ }
229
+ continue;
230
+ }
231
+ if (isPlainObject(patchValue) && isPlainObject(baseValue)) {
232
+ out[key] = deepMerge(baseValue, patchValue, options, currentPath);
233
+ continue;
234
+ }
235
+ out[key] = patchValue;
236
+ }
237
+ return out;
202
238
  }
203
239
  function mergeInto(base, patch, options) {
204
- return deepMerge(base, patch, options);
240
+ return deepMerge(base, patch, options);
205
241
  }
206
242
  function mergePatchInto(base, patch, options) {
207
- return deepMerge(base, patch, options);
243
+ return deepMerge(base, patch, options);
208
244
  }
209
- /**
210
- * Builds a patch that sets `leaf` at `keys`. When `current` (the value the patch will be merged into) holds an
211
- * array along the path, the patch carries a copy of that array with the one element replaced, since arrays are
212
- * replaced rather than merged. Without `current`, every level is an object.
213
- */
214
245
  function buildNested(keys, leaf, current) {
215
- if (keys.length === 0) {
216
- return {};
217
- }
218
- return buildLevel(keys, leaf, current, false);
246
+ if (keys.length === 0) return {};
247
+ return buildLevel(keys, leaf, current, false);
219
248
  }
220
249
  function patchAt(path, value, current) {
221
- const keys = path;
222
- const nested = buildNested(keys, value, current);
223
- return nested;
250
+ return buildNested(path, value, current);
224
251
  }
225
252
  function setAt(obj, path, value, options) {
226
- return deepMerge(obj, patchAt(path, value, obj), options);
253
+ return deepMerge(obj, patchAt(path, value, obj), options);
227
254
  }
228
255
  function prunePatch(base, patch) {
229
- if (patch === null || typeof patch !== "object" || base === null || typeof base !== "object") {
230
- return base === patch ? undefined : patch;
231
- }
232
- const baseObj = base;
233
- const patchObj = patch;
234
- const result = { ...patchObj };
235
- for (const key of Object.keys(patchObj)) {
236
- if (key === "__proto__") {
237
- delete result[key];
238
- continue;
239
- }
240
- if (!(key in baseObj)) {
241
- // An undefined field the base doesn't have is no change.
242
- if (patchObj[key] === undefined) {
243
- delete result[key];
244
- }
245
- continue;
246
- }
247
- const baseValue = baseObj[key];
248
- const patchValue = patchObj[key];
249
- if (isPlainObject(patchValue) && isPlainObject(baseValue)) {
250
- const pruned = prunePatch(baseValue, patchValue);
251
- if (pruned === undefined || (typeof pruned === "object" && Object.keys(pruned).length === 0)) {
252
- delete result[key];
253
- }
254
- else {
255
- result[key] = pruned;
256
- }
257
- }
258
- else if (deepEquals(baseValue, patchValue)) {
259
- delete result[key];
260
- }
261
- }
262
- return Object.keys(result).length === 0 ? undefined : result;
256
+ if (patch === null || typeof patch !== "object" || base === null || typeof base !== "object") return base === patch ? void 0 : patch;
257
+ const baseObj = base;
258
+ const patchObj = patch;
259
+ const result = { ...patchObj };
260
+ for (const key of Object.keys(patchObj)) {
261
+ if (key === "__proto__") {
262
+ delete result[key];
263
+ continue;
264
+ }
265
+ if (!(key in baseObj)) {
266
+ if (patchObj[key] === void 0) delete result[key];
267
+ continue;
268
+ }
269
+ const baseValue = baseObj[key];
270
+ const patchValue = patchObj[key];
271
+ if (isPlainObject(patchValue) && isPlainObject(baseValue)) {
272
+ const pruned = prunePatch(baseValue, patchValue);
273
+ if (pruned === void 0 || typeof pruned === "object" && Object.keys(pruned).length === 0) delete result[key];
274
+ else result[key] = pruned;
275
+ } else if (deepEquals(baseValue, patchValue)) delete result[key];
276
+ }
277
+ return Object.keys(result).length === 0 ? void 0 : result;
263
278
  }
264
- /**
265
- * Structural equality for plain objects, arrays, `Date`, `RegExp`, `Map` and `Set`. Primitives are equal when
266
- * `===` says so, and `NaN` equals `NaN`. Dates are equal when they hold the same time (two invalid dates are
267
- * equal). Map keys and set members are matched by `SameValueZero`, like `Map.prototype.has`. Cyclic values are
268
- * supported.
269
- */
270
279
  function deepEquals(o1, o2) {
271
- return valuesEqual(o1, o2, new Map());
280
+ return valuesEqual(o1, o2, /* @__PURE__ */ new Map());
272
281
  }
273
282
  function valuesEqual(o1, o2, visited) {
274
- if (o1 === o2 || (Number.isNaN(o1) && Number.isNaN(o2))) {
275
- return true;
276
- }
277
- if (o1 === null || o2 === null || typeof o1 !== "object" || typeof o2 !== "object") {
278
- return false;
279
- }
280
- if (o1 instanceof Date || o2 instanceof Date) {
281
- return o1 instanceof Date && o2 instanceof Date && Object.is(o1.getTime(), o2.getTime());
282
- }
283
- if (o1 instanceof RegExp || o2 instanceof RegExp) {
284
- return o1 instanceof RegExp && o2 instanceof RegExp && o1.source === o2.source && o1.flags === o2.flags;
285
- }
286
- // A pair already being compared further up is assumed equal; any difference shows up there.
287
- let seen = visited.get(o1);
288
- if (seen?.has(o2)) {
289
- return true;
290
- }
291
- if (!seen) {
292
- seen = new Set();
293
- visited.set(o1, seen);
294
- }
295
- seen.add(o2);
296
- if (o1 instanceof Map || o2 instanceof Map) {
297
- return o1 instanceof Map && o2 instanceof Map && mapsEqual(o1, o2, visited);
298
- }
299
- if (o1 instanceof Set || o2 instanceof Set) {
300
- return o1 instanceof Set && o2 instanceof Set && setsEqual(o1, o2);
301
- }
302
- if (Array.isArray(o1) || Array.isArray(o2)) {
303
- return (Array.isArray(o1) &&
304
- Array.isArray(o2) &&
305
- o1.length === o2.length &&
306
- o1.every((value, index) => valuesEqual(value, o2[index], visited)));
307
- }
308
- const keys1 = Object.keys(o1);
309
- if (keys1.length !== Object.keys(o2).length) {
310
- return false;
311
- }
312
- const record1 = o1;
313
- const record2 = o2;
314
- return keys1.every(key => Object.hasOwn(record2, key) && valuesEqual(record1[key], record2[key], visited));
283
+ if (o1 === o2 || Number.isNaN(o1) && Number.isNaN(o2)) return true;
284
+ if (o1 === null || o2 === null || typeof o1 !== "object" || typeof o2 !== "object") return false;
285
+ if (o1 instanceof Date || o2 instanceof Date) return o1 instanceof Date && o2 instanceof Date && Object.is(o1.getTime(), o2.getTime());
286
+ if (o1 instanceof RegExp || o2 instanceof RegExp) return o1 instanceof RegExp && o2 instanceof RegExp && o1.source === o2.source && o1.flags === o2.flags;
287
+ let seen = visited.get(o1);
288
+ if (seen?.has(o2)) return true;
289
+ if (!seen) {
290
+ seen = /* @__PURE__ */ new Set();
291
+ visited.set(o1, seen);
292
+ }
293
+ seen.add(o2);
294
+ if (o1 instanceof Map || o2 instanceof Map) return o1 instanceof Map && o2 instanceof Map && mapsEqual(o1, o2, visited);
295
+ if (o1 instanceof Set || o2 instanceof Set) return o1 instanceof Set && o2 instanceof Set && setsEqual(o1, o2);
296
+ if (Array.isArray(o1) || Array.isArray(o2)) return Array.isArray(o1) && Array.isArray(o2) && o1.length === o2.length && o1.every((value, index) => valuesEqual(value, o2[index], visited));
297
+ const keys1 = Object.keys(o1);
298
+ if (keys1.length !== Object.keys(o2).length) return false;
299
+ const record1 = o1;
300
+ const record2 = o2;
301
+ return keys1.every((key) => Object.hasOwn(record2, key) && valuesEqual(record1[key], record2[key], visited));
315
302
  }
316
- /** Maps are equal when they have the same keys (by `SameValueZero`) and deeply equal values. */
317
303
  function mapsEqual(m1, m2, visited) {
318
- if (m1.size !== m2.size) {
319
- return false;
320
- }
321
- for (const [key, value] of m1) {
322
- if (!m2.has(key) || !valuesEqual(value, m2.get(key), visited)) {
323
- return false;
324
- }
325
- }
326
- return true;
304
+ if (m1.size !== m2.size) return false;
305
+ for (const [key, value] of m1) if (!m2.has(key) || !valuesEqual(value, m2.get(key), visited)) return false;
306
+ return true;
327
307
  }
328
- /** Sets are equal when they have the same members (by `SameValueZero`). */
329
308
  function setsEqual(s1, s2) {
330
- if (s1.size !== s2.size) {
331
- return false;
332
- }
333
- for (const value of s1) {
334
- if (!s2.has(value)) {
335
- return false;
336
- }
337
- }
338
- return true;
309
+ if (s1.size !== s2.size) return false;
310
+ for (const value of s1) if (!s2.has(value)) return false;
311
+ return true;
339
312
  }
340
- /**
341
- * One level of `buildNested`. Inside an array (`whole`), each level must be the whole value, since the array
342
- * element replaces the old one; outside, a level holds only the key on the path.
343
- */
344
313
  function buildLevel(keys, leaf, current, whole) {
345
- const [head, ...rest] = keys;
346
- const isArray = Array.isArray(current);
347
- const child = current != null && typeof current === "object"
348
- ? current[head]
349
- : undefined;
350
- const value = rest.length === 0 ? leaf : buildLevel(rest, leaf, child, whole || isArray);
351
- if (isArray) {
352
- const copy = [...current];
353
- copy[Number(head)] = value;
354
- return copy;
355
- }
356
- if (whole && isPlainObject(current)) {
357
- return { ...current, [head]: value };
358
- }
359
- return { [head]: value };
314
+ const [head, ...rest] = keys;
315
+ const isArray = Array.isArray(current);
316
+ const child = current != null && typeof current === "object" ? current[head] : void 0;
317
+ const value = rest.length === 0 ? leaf : buildLevel(rest, leaf, child, whole || isArray);
318
+ if (isArray) {
319
+ const copy = [...current];
320
+ copy[Number(head)] = value;
321
+ return copy;
322
+ }
323
+ if (whole && isPlainObject(current)) return {
324
+ ...current,
325
+ [head]: value
326
+ };
327
+ return { [head]: value };
360
328
  }
361
- /**
362
- * Returns a function that tells `unionBy` items apart by the values of their key fields, or returns `undefined` for
363
- * an item that lacks one. Values keep their type (`1` and `"1"` differ), and composite keys can't collide.
364
- */
365
329
  function createUnionIdentifier(by) {
366
- const keys = Array.isArray(by) ? by : [by];
367
- return item => {
368
- const values = keys.map(key => item != null && typeof item === "object" ? item[key] : undefined);
369
- return values.some(value => value == null) ? undefined : JSON.stringify(values, unionKeyReplacer);
370
- };
330
+ const keys = Array.isArray(by) ? by : [by];
331
+ return (item) => {
332
+ const values = keys.map((key) => item != null && typeof item === "object" ? item[key] : void 0);
333
+ return values.some((value) => value == null) ? void 0 : JSON.stringify(values, unionKeyReplacer);
334
+ };
371
335
  }
372
336
  function unionKeyReplacer(_key, value) {
373
- return typeof value === "bigint" ? { bigint: String(value) } : value;
337
+ return typeof value === "bigint" ? { bigint: String(value) } : value;
374
338
  }
375
-
376
- /**
377
- * Drafts hold final values: an `undefined` in a patch clears the field, and the draft is applied over the base
378
- * with `replace`, so an array strategy only ever applies once, to the patch that introduced it.
379
- */
380
339
  const STORE_MERGE_OPTIONS = { undefinedValues: "assign" };
381
- /**
382
- * Applies `patch` to the view of `base` with `draft`, and returns the fields that still differ from `base`.
383
- */
384
340
  function applyPatch(base, draft, patch, options) {
385
- const currentView = deepMerge(base, draft, STORE_MERGE_OPTIONS);
386
- const nextView = deepMerge(currentView, patch, { ...STORE_MERGE_OPTIONS, ...options });
387
- return prunePatch(base, nextView) ?? {};
388
- }
389
- class ObjectPatchStore {
390
- #base;
391
- #committed;
392
- #draft;
393
- #options;
394
- constructor(options) {
395
- this.#draft = linkedSignal({ ...(ngDevMode ? { debugName: "#draft" } : /* istanbul ignore next */ {}), source: () => this.#base(),
396
- computation: (newBase, previous) => {
397
- const strategy = this.#options.baseChangeStrategy ?? "wipe";
398
- if (!previous) {
399
- // First computation; the constructor then sets the initial draft.
400
- return {};
401
- }
402
- switch (strategy) {
403
- case "preserve":
404
- return previous.value;
405
- case "rebase":
406
- return prunePatch(newBase, previous.value) ?? {};
407
- case "wipe":
408
- default:
409
- return {};
410
- }
411
- } });
412
- this.changes = computed(() => {
413
- const draft = this.#draft();
414
- return isEmptyObject(draft) ? undefined : draft;
415
- }, /* @ts-ignore */
416
- ...(ngDevMode ? [{ debugName: "changes" }] : /* istanbul ignore next */ []));
417
- this.pristine = computed(() => {
418
- const base = this.#base();
419
- const draft = this.#draft();
420
- const committed = this.#committed();
421
- const prunedDraft = prunePatch(base, draft) ?? {};
422
- const prunedCommitted = prunePatch(base, committed) ?? {};
423
- return deepEquals(prunedDraft, prunedCommitted);
424
- }, /* @ts-ignore */
425
- ...(ngDevMode ? [{ debugName: "pristine" }] : /* istanbul ignore next */ []));
426
- this.view = computed(() => deepMerge(this.#base(), this.#draft(), STORE_MERGE_OPTIONS), /* @ts-ignore */
427
- ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
428
- this.#options = options;
429
- this.#base = options.source();
430
- const initial = options.initial?.() ?? {};
431
- this.#committed = signal(initial, /* @ts-ignore */
432
- ...(ngDevMode ? [{ debugName: "#committed" }] : /* istanbul ignore next */ []));
433
- // Sync initial draft; linkedSignal computation handles subsequent base changes.
434
- this.#draft.set(initial);
435
- }
436
- clear() {
437
- this.#draft.set({});
438
- }
439
- commit() {
440
- this.#committed.set(this.#draft());
441
- }
442
- getCommitted() {
443
- return this.#committed();
444
- }
445
- hasDraft() {
446
- return !isEmptyObject(this.#draft());
447
- }
448
- patch(patch, options) {
449
- const effectiveOptions = options ?? this.#options.mergeOptions;
450
- this.#draft.update(currentDraft => applyPatch(this.#base(), currentDraft, patch, effectiveOptions));
451
- }
452
- patchPath(path, value, options) {
453
- // Arrays along the path are copied from the current view (see buildNested).
454
- const patch = buildNested(path, value, untracked(this.view));
455
- this.patch(patch, options);
456
- }
457
- reset() {
458
- this.#draft.set({});
459
- this.#committed.set({});
460
- }
461
- select(projector, equal = deepEquals) {
462
- return computed(() => projector(this.view()), { equal });
463
- }
464
- setDraft(patch) {
465
- this.#draft.set(patch);
466
- }
467
- setPath(path, value, options) {
468
- this.patchPath(path, value, options);
469
- }
470
- }
471
- class IterablePatchStore {
472
- #base;
473
- /**
474
- * O(1) lookup map derived from the base signal. Rebuilt only when the
475
- * base iterable emits a new value, not on every patch operation.
476
- */
477
- #baseMap;
478
- #committed;
479
- #drafts;
480
- #options;
481
- /**
482
- * Memoisation cache for the `view` computed. Keyed by item id; each
483
- * entry stores the base item and draft references that produced the merged
484
- * result, so we can skip deepMerge when neither of them changed. Rebuilt on
485
- * every computation, so ids that leave the base or lose their draft drop out.
486
- */
487
- #viewCache;
488
- constructor(options) {
489
- /**
490
- * O(1) lookup map derived from the base signal. Rebuilt only when the
491
- * base iterable emits a new value, not on every patch operation.
492
- */
493
- this.#baseMap = computed(() => new Map(Array.from(this.#base()).map(item => [this.#options.idOf(item), item])), /* @ts-ignore */
494
- ...(ngDevMode ? [{ debugName: "#baseMap" }] : /* istanbul ignore next */ []));
495
- this.#drafts = linkedSignal({ ...(ngDevMode ? { debugName: "#drafts" } : /* istanbul ignore next */ {}), source: () => this.#base(),
496
- computation: (newBase, previous) => {
497
- const strategy = this.#options.baseChangeStrategy ?? "wipe";
498
- if (!previous) {
499
- return ImmutableDictionary.create();
500
- }
501
- switch (strategy) {
502
- case "preserve":
503
- return previous.value;
504
- case "rebase": {
505
- const baseMap = new Map(Array.from(newBase, item => [this.#options.idOf(item), item]));
506
- let rebased = ImmutableDictionary.create();
507
- for (const [id, draft] of previous.value.entries()) {
508
- const baseItem = baseMap.get(id);
509
- if (!baseItem) {
510
- // Item no longer exists in base — drop the draft.
511
- continue;
512
- }
513
- const pruned = prunePatch(baseItem, draft);
514
- if (pruned && !isEmptyObject(pruned)) {
515
- rebased = rebased.put(id, pruned);
516
- }
517
- }
518
- return rebased;
519
- }
520
- case "wipe":
521
- default:
522
- return ImmutableDictionary.create();
523
- }
524
- } });
525
- /**
526
- * Memoisation cache for the `view` computed. Keyed by item id; each
527
- * entry stores the base item and draft references that produced the merged
528
- * result, so we can skip deepMerge when neither of them changed. Rebuilt on
529
- * every computation, so ids that leave the base or lose their draft drop out.
530
- */
531
- this.#viewCache = new Map();
532
- this.changes = computed(() => {
533
- const drafts = this.#drafts();
534
- const changes = [];
535
- for (const b of this.#base()) {
536
- const draft = drafts.get(this.#options.idOf(b));
537
- if (draft != null && !isEmptyObject(draft)) {
538
- changes.push(deepMerge(b, draft, STORE_MERGE_OPTIONS));
539
- }
540
- }
541
- return changes;
542
- }, /* @ts-ignore */
543
- ...(ngDevMode ? [{ debugName: "changes" }] : /* istanbul ignore next */ []));
544
- this.pristine = computed(() => {
545
- const baseMap = this.#baseMap();
546
- const drafts = this.#drafts();
547
- const committed = this.#committed();
548
- const allIds = new Set([...drafts.keys(), ...committed.keys()]);
549
- for (const id of allIds) {
550
- const draft = drafts.get(id) ?? {};
551
- const committedDraft = committed.get(id) ?? {};
552
- const originalItem = baseMap.get(id);
553
- const prunedDraft = originalItem ? (prunePatch(originalItem, draft) ?? {}) : draft;
554
- const prunedCommitted = originalItem
555
- ? (prunePatch(originalItem, committedDraft) ?? {})
556
- : committedDraft;
557
- if (!deepEquals(prunedDraft, prunedCommitted)) {
558
- return false;
559
- }
560
- }
561
- return true;
562
- }, /* @ts-ignore */
563
- ...(ngDevMode ? [{ debugName: "pristine" }] : /* istanbul ignore next */ []));
564
- this.view = computed(() => {
565
- const drafts = this.#drafts();
566
- const previousCache = this.#viewCache;
567
- const nextCache = new Map();
568
- const view = Array.from(this.#base()).map(b => {
569
- const id = this.#options.idOf(b);
570
- const patch = drafts.get(id);
571
- if (!patch || isEmptyObject(patch)) {
572
- // No draft — return base item directly.
573
- return b;
574
- }
575
- const cached = previousCache.get(id);
576
- // Reuse the merged value only when neither the base item nor its
577
- // draft changed, to avoid an unnecessary deepMerge and allocation.
578
- const merged = cached && cached.baseRef === b && cached.patchRef === patch
579
- ? cached.merged
580
- : deepMerge(b, patch, STORE_MERGE_OPTIONS);
581
- nextCache.set(id, { baseRef: b, merged, patchRef: patch });
582
- return merged;
583
- });
584
- this.#viewCache = nextCache;
585
- return view;
586
- }, /* @ts-ignore */
587
- ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
588
- this.#options = options;
589
- this.#base = options.source();
590
- const initialValue = options.initial?.();
591
- const initial = initialValue instanceof ImmutableDictionary
592
- ? initialValue
593
- : ImmutableDictionary.create(initialValue ?? []);
594
- this.#committed = signal(initial, /* @ts-ignore */
595
- ...(ngDevMode ? [{ debugName: "#committed" }] : /* istanbul ignore next */ []));
596
- if (initialValue) {
597
- this.#drafts.set(initial);
598
- }
599
- }
600
- clear(id) {
601
- this.#drafts.update(drafts => {
602
- if (!drafts.containsKey(id))
603
- return drafts;
604
- return drafts.remove(id);
605
- });
606
- }
607
- clearAll() {
608
- this.#drafts.set(ImmutableDictionary.create());
609
- }
610
- commit() {
611
- this.#committed.set(ImmutableDictionary.create(this.#drafts()));
612
- }
613
- dirtyCount() {
614
- let count = 0;
615
- for (const patch of this.#drafts().values()) {
616
- if (typeof patch === "object" && patch != null && !isEmptyObject(patch)) {
617
- ++count;
618
- }
619
- }
620
- return count;
621
- }
622
- getCommitted() {
623
- return this.#committed();
624
- }
625
- hasDraft(id) {
626
- const patch = this.#drafts().get(id);
627
- return patch != null && !isEmptyObject(patch);
628
- }
629
- patch(id, patch, options = this.#options.mergeOptions) {
630
- this.#drafts.update(drafts => {
631
- const prev = drafts.get(id) ?? {};
632
- const originalItem = this.#baseMap().get(id);
633
- const next = originalItem
634
- ? applyPatch(originalItem, prev, patch, options)
635
- : deepMerge(prev, patch, { ...STORE_MERGE_OPTIONS, ...options });
636
- return isEmptyObject(next) ? drafts.remove(id) : drafts.put(id, next);
637
- });
638
- }
639
- patchMany(patchTuple, options = this.#options.mergeOptions) {
640
- const baseMap = this.#baseMap();
641
- this.#drafts.update(drafts => {
642
- // Each put on an ImmutableDictionary copies it, so collect the drafts in a Map and build one dictionary.
643
- const nextDrafts = new Map(drafts.entries());
644
- for (const [id, value] of patchTuple) {
645
- const prev = nextDrafts.get(id) ?? {};
646
- const originalItem = baseMap.get(id);
647
- const next = originalItem
648
- ? applyPatch(originalItem, prev, value, options)
649
- : deepMerge(prev, value, { ...STORE_MERGE_OPTIONS, ...options });
650
- if (isEmptyObject(next)) {
651
- nextDrafts.delete(id);
652
- }
653
- else {
654
- nextDrafts.set(id, next);
655
- }
656
- }
657
- return ImmutableDictionary.create(nextDrafts);
658
- });
659
- }
660
- patchPath(id, path, value, options) {
661
- // Arrays along the path are copied from the item's current view (see buildNested).
662
- const current = untracked(() => {
663
- const baseItem = this.#baseMap().get(id);
664
- const draft = this.#drafts().get(id);
665
- return baseItem !== undefined && draft
666
- ? deepMerge(baseItem, draft, STORE_MERGE_OPTIONS)
667
- : (baseItem ?? draft);
668
- });
669
- const patch = buildNested(path, value, current);
670
- this.patch(id, patch, options);
671
- }
672
- reset() {
673
- const empty = ImmutableDictionary.create();
674
- this.#drafts.set(empty);
675
- this.#committed.set(empty);
676
- }
677
- select(projector, equal = deepEquals) {
678
- return computed(() => projector(this.view()), { equal });
679
- }
680
- setDraft(id, patch) {
681
- this.#drafts.update(drafts => isEmptyObject(patch) ? drafts.remove(id) : drafts.put(id, patch));
682
- }
683
- setPath(id, path, value, options) {
684
- this.patchPath(id, path, value, options);
685
- }
341
+ return prunePatch(base, deepMerge(deepMerge(base, draft, STORE_MERGE_OPTIONS), patch, {
342
+ ...STORE_MERGE_OPTIONS,
343
+ ...options
344
+ })) ?? {};
686
345
  }
346
+ var ObjectPatchStore = class {
347
+ #base;
348
+ #committed;
349
+ #draft;
350
+ #options;
351
+ constructor(options) {
352
+ this.#draft = linkedSignal({
353
+ ...ngDevMode ? { debugName: "#draft" } : /* istanbul ignore next */ {},
354
+ source: () => this.#base(),
355
+ computation: (newBase, previous) => {
356
+ const strategy = this.#options.baseChangeStrategy ?? "wipe";
357
+ if (!previous) return {};
358
+ switch (strategy) {
359
+ case "preserve": return previous.value;
360
+ case "rebase": return prunePatch(newBase, previous.value) ?? {};
361
+ default: return {};
362
+ }
363
+ }
364
+ });
365
+ this.changes = computed(() => {
366
+ const draft = this.#draft();
367
+ return isEmptyObject(draft) ? void 0 : draft;
368
+ }, ...ngDevMode ? [{ debugName: "changes" }] : /* istanbul ignore next */ []);
369
+ this.pristine = computed(() => {
370
+ const base = this.#base();
371
+ const draft = this.#draft();
372
+ const committed = this.#committed();
373
+ return deepEquals(prunePatch(base, draft) ?? {}, prunePatch(base, committed) ?? {});
374
+ }, ...ngDevMode ? [{ debugName: "pristine" }] : /* istanbul ignore next */ []);
375
+ this.view = computed(() => deepMerge(this.#base(), this.#draft(), STORE_MERGE_OPTIONS), ...ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []);
376
+ this.#options = options;
377
+ this.#base = options.source();
378
+ const initial = options.initial?.() ?? {};
379
+ this.#committed = signal(initial, ...ngDevMode ? [{ debugName: "#committed" }] : /* istanbul ignore next */ []);
380
+ this.#draft.set(initial);
381
+ }
382
+ clear() {
383
+ this.#draft.set({});
384
+ }
385
+ commit() {
386
+ this.#committed.set(this.#draft());
387
+ }
388
+ getCommitted() {
389
+ return this.#committed();
390
+ }
391
+ hasDraft() {
392
+ return !isEmptyObject(this.#draft());
393
+ }
394
+ patch(patch, options) {
395
+ const effectiveOptions = options ?? this.#options.mergeOptions;
396
+ this.#draft.update((currentDraft) => applyPatch(this.#base(), currentDraft, patch, effectiveOptions));
397
+ }
398
+ patchPath(path, value, options) {
399
+ const patch = buildNested(path, value, untracked(this.view));
400
+ this.patch(patch, options);
401
+ }
402
+ reset() {
403
+ this.#draft.set({});
404
+ this.#committed.set({});
405
+ }
406
+ select(projector, equal = deepEquals) {
407
+ return computed(() => projector(this.view()), { equal });
408
+ }
409
+ setDraft(patch) {
410
+ this.#draft.set(patch);
411
+ }
412
+ setPath(path, value, options) {
413
+ this.patchPath(path, value, options);
414
+ }
415
+ };
416
+ var IterablePatchStore = class {
417
+ #base;
418
+ #baseMap;
419
+ #committed;
420
+ #drafts;
421
+ #options;
422
+ #viewCache;
423
+ constructor(options) {
424
+ this.#baseMap = computed(() => new Map(Array.from(this.#base()).map((item) => [this.#options.idOf(item), item])), ...ngDevMode ? [{ debugName: "#baseMap" }] : /* istanbul ignore next */ []);
425
+ this.#drafts = linkedSignal({
426
+ ...ngDevMode ? { debugName: "#drafts" } : /* istanbul ignore next */ {},
427
+ source: () => this.#base(),
428
+ computation: (newBase, previous) => {
429
+ const strategy = this.#options.baseChangeStrategy ?? "wipe";
430
+ if (!previous) return ImmutableDictionary.create();
431
+ switch (strategy) {
432
+ case "preserve": return previous.value;
433
+ case "rebase": {
434
+ const baseMap = new Map(Array.from(newBase, (item) => [this.#options.idOf(item), item]));
435
+ let rebased = ImmutableDictionary.create();
436
+ for (const [id, draft] of previous.value.entries()) {
437
+ const baseItem = baseMap.get(id);
438
+ if (!baseItem) continue;
439
+ const pruned = prunePatch(baseItem, draft);
440
+ if (pruned && !isEmptyObject(pruned)) rebased = rebased.put(id, pruned);
441
+ }
442
+ return rebased;
443
+ }
444
+ default: return ImmutableDictionary.create();
445
+ }
446
+ }
447
+ });
448
+ this.#viewCache = /* @__PURE__ */ new Map();
449
+ this.changes = computed(() => {
450
+ const drafts = this.#drafts();
451
+ const changes = [];
452
+ for (const b of this.#base()) {
453
+ const draft = drafts.get(this.#options.idOf(b));
454
+ if (draft != null && !isEmptyObject(draft)) changes.push(deepMerge(b, draft, STORE_MERGE_OPTIONS));
455
+ }
456
+ return changes;
457
+ }, ...ngDevMode ? [{ debugName: "changes" }] : /* istanbul ignore next */ []);
458
+ this.pristine = computed(() => {
459
+ const baseMap = this.#baseMap();
460
+ const drafts = this.#drafts();
461
+ const committed = this.#committed();
462
+ const allIds = /* @__PURE__ */ new Set([...drafts.keys(), ...committed.keys()]);
463
+ for (const id of allIds) {
464
+ const draft = drafts.get(id) ?? {};
465
+ const committedDraft = committed.get(id) ?? {};
466
+ const originalItem = baseMap.get(id);
467
+ if (!deepEquals(originalItem ? prunePatch(originalItem, draft) ?? {} : draft, originalItem ? prunePatch(originalItem, committedDraft) ?? {} : committedDraft)) return false;
468
+ }
469
+ return true;
470
+ }, ...ngDevMode ? [{ debugName: "pristine" }] : /* istanbul ignore next */ []);
471
+ this.view = computed(() => {
472
+ const drafts = this.#drafts();
473
+ const previousCache = this.#viewCache;
474
+ const nextCache = /* @__PURE__ */ new Map();
475
+ const view = Array.from(this.#base()).map((b) => {
476
+ const id = this.#options.idOf(b);
477
+ const patch = drafts.get(id);
478
+ if (!patch || isEmptyObject(patch)) return b;
479
+ const cached = previousCache.get(id);
480
+ const merged = cached && cached.baseRef === b && cached.patchRef === patch ? cached.merged : deepMerge(b, patch, STORE_MERGE_OPTIONS);
481
+ nextCache.set(id, {
482
+ baseRef: b,
483
+ merged,
484
+ patchRef: patch
485
+ });
486
+ return merged;
487
+ });
488
+ this.#viewCache = nextCache;
489
+ return view;
490
+ }, ...ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []);
491
+ this.#options = options;
492
+ this.#base = options.source();
493
+ const initialValue = options.initial?.();
494
+ const initial = initialValue instanceof ImmutableDictionary ? initialValue : ImmutableDictionary.create(initialValue ?? []);
495
+ this.#committed = signal(initial, ...ngDevMode ? [{ debugName: "#committed" }] : /* istanbul ignore next */ []);
496
+ if (initialValue) this.#drafts.set(initial);
497
+ }
498
+ clear(id) {
499
+ this.#drafts.update((drafts) => {
500
+ if (!drafts.containsKey(id)) return drafts;
501
+ return drafts.remove(id);
502
+ });
503
+ }
504
+ clearAll() {
505
+ this.#drafts.set(ImmutableDictionary.create());
506
+ }
507
+ commit() {
508
+ this.#committed.set(ImmutableDictionary.create(this.#drafts()));
509
+ }
510
+ dirtyCount() {
511
+ let count = 0;
512
+ for (const patch of this.#drafts().values()) if (typeof patch === "object" && patch != null && !isEmptyObject(patch)) ++count;
513
+ return count;
514
+ }
515
+ getCommitted() {
516
+ return this.#committed();
517
+ }
518
+ hasDraft(id) {
519
+ const patch = this.#drafts().get(id);
520
+ return patch != null && !isEmptyObject(patch);
521
+ }
522
+ patch(id, patch, options = this.#options.mergeOptions) {
523
+ this.#drafts.update((drafts) => {
524
+ const prev = drafts.get(id) ?? {};
525
+ const originalItem = this.#baseMap().get(id);
526
+ const next = originalItem ? applyPatch(originalItem, prev, patch, options) : deepMerge(prev, patch, {
527
+ ...STORE_MERGE_OPTIONS,
528
+ ...options
529
+ });
530
+ return isEmptyObject(next) ? drafts.remove(id) : drafts.put(id, next);
531
+ });
532
+ }
533
+ patchMany(patchTuple, options = this.#options.mergeOptions) {
534
+ const baseMap = this.#baseMap();
535
+ this.#drafts.update((drafts) => {
536
+ const nextDrafts = new Map(drafts.entries());
537
+ for (const [id, value] of patchTuple) {
538
+ const prev = nextDrafts.get(id) ?? {};
539
+ const originalItem = baseMap.get(id);
540
+ const next = originalItem ? applyPatch(originalItem, prev, value, options) : deepMerge(prev, value, {
541
+ ...STORE_MERGE_OPTIONS,
542
+ ...options
543
+ });
544
+ if (isEmptyObject(next)) nextDrafts.delete(id);
545
+ else nextDrafts.set(id, next);
546
+ }
547
+ return ImmutableDictionary.create(nextDrafts);
548
+ });
549
+ }
550
+ patchPath(id, path, value, options) {
551
+ const patch = buildNested(path, value, untracked(() => {
552
+ const baseItem = this.#baseMap().get(id);
553
+ const draft = this.#drafts().get(id);
554
+ return baseItem !== void 0 && draft ? deepMerge(baseItem, draft, STORE_MERGE_OPTIONS) : baseItem ?? draft;
555
+ }));
556
+ this.patch(id, patch, options);
557
+ }
558
+ reset() {
559
+ const empty = ImmutableDictionary.create();
560
+ this.#drafts.set(empty);
561
+ this.#committed.set(empty);
562
+ }
563
+ select(projector, equal = deepEquals) {
564
+ return computed(() => projector(this.view()), { equal });
565
+ }
566
+ setDraft(id, patch) {
567
+ this.#drafts.update((drafts) => isEmptyObject(patch) ? drafts.remove(id) : drafts.put(id, patch));
568
+ }
569
+ setPath(id, path, value, options) {
570
+ this.patchPath(id, path, value, options);
571
+ }
572
+ };
687
573
  const createIterablePatchStore = (options) => new IterablePatchStore(options);
688
574
  const createObjectPatchStore = (options) => new ObjectPatchStore(options);
689
-
690
575
  const classInputToClass = (input) => {
691
- if (input == null) {
692
- return "";
693
- }
694
- if (typeof input === "string") {
695
- return input;
696
- }
697
- if (Array.isArray(input)) {
698
- return input.filter(Boolean).join(" ");
699
- }
700
- if (typeof input === "object") {
701
- return Object.entries(input)
702
- .filter(([, value]) => value)
703
- .map(([key]) => key)
704
- .join(" ");
705
- }
706
- return "";
576
+ if (input == null) return "";
577
+ if (typeof input === "string") return input;
578
+ if (Array.isArray(input)) return input.filter(Boolean).join(" ");
579
+ if (typeof input === "object") return Object.entries(input).filter(([, value]) => value).map(([key]) => key).join(" ");
580
+ return "";
707
581
  };
708
-
709
- /**
710
- * Calculates the percentage of a value within a given range, rounded to the specified precision.
711
- * @param value The current value.
712
- * @param min The minimum value.
713
- * @param max The maximum value.
714
- * @param precision The number of decimal places to round the percentage to, clamped to 0–100.
715
- * @default 2
716
- * @returns The percentage of the value within the range, rounded to the specified precision, or 0 when the range
717
- * or the value is not finite.
718
- */
719
582
  const getPercentage = (value, min, max, precision = 2) => {
720
- if (!isFinite(value) || !isFinite(min) || !isFinite(max) || max <= min) {
721
- return 0;
722
- }
723
- const raw = ((value - min) / (max - min)) * 100;
724
- const digits = Math.min(100, Math.max(0, Math.trunc(precision) || 0));
725
- return Number(Math.min(100, Math.max(0, raw)).toFixed(digits));
583
+ if (!isFinite(value) || !isFinite(min) || !isFinite(max) || max <= min) return 0;
584
+ const raw = (value - min) / (max - min) * 100;
585
+ const digits = Math.min(100, Math.max(0, Math.trunc(precision) || 0));
586
+ return Number(Math.min(100, Math.max(0, raw)).toFixed(digits));
726
587
  };
727
-
728
- /**
729
- * Gives the values a progress indicator can report: `value` clamped into the range, with a non-finite `value` read as
730
- * `min`, the same place `getPercentage` draws it.
731
- * @param value The current value.
732
- * @param min The minimum value.
733
- * @param max The maximum value.
734
- * @returns The range and the value within it, or `null` when the range itself is invalid, because `min` or `max` isn't
735
- * finite or `max` isn't above `min`.
736
- */
737
588
  const normalizeProgressRange = (value, min, max) => {
738
- if (!Number.isFinite(min) || !Number.isFinite(max) || max <= min) {
739
- return null;
740
- }
741
- const now = Number.isFinite(value) ? Math.min(max, Math.max(min, value)) : min;
742
- return { max, min, now };
589
+ if (!Number.isFinite(min) || !Number.isFinite(max) || max <= min) return null;
590
+ return {
591
+ max,
592
+ min,
593
+ now: Number.isFinite(value) ? Math.min(max, Math.max(min, value)) : min
594
+ };
743
595
  };
744
-
745
- /**
746
- * Moves the items at `indices` by `offset` positions, keeping their relative order. Returns a copy of the array
747
- * unchanged when the offset is 0 or not an integer, or when any index is not an integer, is out of bounds, or would
748
- * move out of bounds. Duplicate indices count once.
749
- */
750
596
  function moveIndices(array, indices, offset) {
751
- if (offset === 0 || indices.length === 0 || !Number.isInteger(offset)) {
752
- return [...array];
753
- }
754
- indices = [...new Set(indices)];
755
- // Validate indices are integers within bounds
756
- if (indices.some(i => !Number.isInteger(i) || i < 0 || i >= array.length)) {
757
- return [...array];
758
- }
759
- // Check if any index would go out of bounds after the move
760
- for (const index of indices) {
761
- const newIndex = index + offset;
762
- if (newIndex < 0 || newIndex >= array.length) {
763
- return [...array];
764
- }
765
- }
766
- // Create a copy of the array
767
- const result = [...array];
768
- // Sort indices based on movement direction to avoid conflicts
769
- const sortedIndices = [...indices].sort((a, b) => (offset > 0 ? b - a : a - b));
770
- // Move each item to its new position
771
- for (const index of sortedIndices) {
772
- const item = result[index];
773
- const newIndex = index + offset;
774
- // Remove item from current position
775
- result.splice(index, 1);
776
- // Insert at new position
777
- result.splice(newIndex, 0, item);
778
- }
779
- return result;
597
+ if (offset === 0 || indices.length === 0 || !Number.isInteger(offset)) return [...array];
598
+ indices = [...new Set(indices)];
599
+ if (indices.some((i) => !Number.isInteger(i) || i < 0 || i >= array.length)) return [...array];
600
+ for (const index of indices) {
601
+ const newIndex = index + offset;
602
+ if (newIndex < 0 || newIndex >= array.length) return [...array];
603
+ }
604
+ const result = [...array];
605
+ const sortedIndices = [...indices].sort((a, b) => offset > 0 ? b - a : a - b);
606
+ for (const index of sortedIndices) {
607
+ const item = result[index];
608
+ const newIndex = index + offset;
609
+ result.splice(index, 1);
610
+ result.splice(newIndex, 0, item);
611
+ }
612
+ return result;
780
613
  }
781
-
782
- /**
783
- * Generated bundle index. Do not edit.
784
- */
785
-
786
614
  export { AnyPipe, ContainsPipe, FilterChangeEvent, IterablePatchStore, ObjectPatchStore, PreventableEvent, SlicePipe, TakeFirstPipe, buildNested, classInputToClass, createIterablePatchStore, createObjectPatchStore, deepEquals, deepMerge, getPercentage, isEmptyObject, isPlainObject, mergeInto, mergePatchInto, moveIndices, normalizeProgressRange, patchAt, prunePatch, setAt };
787
- //# sourceMappingURL=nanahoshi-mona-ui-common.mjs.map
615
+
616
+ //# sourceMappingURL=nanahoshi-mona-ui-common.mjs.map