@shwfed/config 2.12.4 → 2.12.6

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 (250) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +5 -0
  3. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/runtime.vue +9 -2
  4. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.d.ts +8 -2
  5. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.js +3 -3
  6. package/dist/runtime/components/actions/components/group.vue +3 -1
  7. package/dist/runtime/components/actions/schema.d.ts +16 -4
  8. package/dist/runtime/components/actions/schema.js +5 -5
  9. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +68 -68
  10. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +68 -68
  11. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +68 -68
  12. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +68 -68
  13. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +34 -34
  14. package/dist/runtime/components/config/footer.d.vue.ts +4 -0
  15. package/dist/runtime/components/config/footer.vue +25 -12
  16. package/dist/runtime/components/config/footer.vue.d.ts +4 -0
  17. package/dist/runtime/components/config/history-picker.d.vue.ts +15 -0
  18. package/dist/runtime/components/config/history-picker.vue +155 -0
  19. package/dist/runtime/components/config/history-picker.vue.d.ts +15 -0
  20. package/dist/runtime/components/config/index.d.vue.ts +4 -0
  21. package/dist/runtime/components/config/index.vue +31 -4
  22. package/dist/runtime/components/config/index.vue.d.ts +4 -0
  23. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/runtime.vue +5 -3
  24. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.d.ts +8 -2
  25. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.js +2 -2
  26. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/runtime.vue +5 -3
  27. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.d.ts +8 -2
  28. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.js +2 -2
  29. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/runtime.vue +4 -3
  30. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/schema.d.ts +8 -2
  31. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/schema.js +1 -1
  32. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/runtime.vue +5 -3
  33. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.d.ts +8 -2
  34. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.js +2 -2
  35. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +6 -6
  36. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +6 -6
  37. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/runtime.vue +5 -3
  38. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.d.ts +8 -2
  39. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.js +2 -2
  40. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +2 -2
  41. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +2 -2
  42. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/runtime.vue +5 -3
  43. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.d.ts +8 -2
  44. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.js +2 -2
  45. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +8 -8
  46. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +8 -8
  47. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/runtime.vue +5 -3
  48. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.d.ts +8 -2
  49. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.js +2 -2
  50. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.d.vue.ts +2 -2
  51. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue.d.ts +2 -2
  52. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/runtime.vue +5 -3
  53. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.d.ts +8 -2
  54. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.js +2 -2
  55. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +4 -4
  56. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +4 -4
  57. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/runtime.vue +5 -3
  58. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.d.ts +8 -2
  59. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.js +2 -2
  60. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +2 -2
  61. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +2 -2
  62. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/runtime.vue +5 -3
  63. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.d.ts +8 -2
  64. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.js +2 -2
  65. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +2 -2
  66. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +2 -2
  67. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/runtime.vue +5 -3
  68. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.d.ts +8 -2
  69. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.js +2 -2
  70. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/runtime.vue +5 -3
  71. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.d.ts +8 -2
  72. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.js +2 -2
  73. package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/runtime.vue +4 -3
  74. package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/schema.d.ts +8 -2
  75. package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/schema.js +1 -1
  76. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/runtime.vue +5 -3
  77. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/schema.d.ts +8 -2
  78. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/schema.js +1 -1
  79. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/runtime.vue +4 -3
  80. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.d.ts +8 -2
  81. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.js +1 -1
  82. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.d.vue.ts +2 -2
  83. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue.d.ts +2 -2
  84. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/runtime.vue +5 -3
  85. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +9 -3
  86. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.js +2 -2
  87. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/runtime.vue +4 -3
  88. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.d.ts +8 -2
  89. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.js +1 -1
  90. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.vue +4 -3
  91. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.d.ts +8 -2
  92. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.js +1 -1
  93. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/runtime.vue +5 -3
  94. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts +8 -2
  95. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.js +2 -1
  96. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +18 -18
  97. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +18 -18
  98. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue +4 -3
  99. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.d.ts +8 -2
  100. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.js +1 -1
  101. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/runtime.vue +5 -3
  102. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.d.ts +8 -2
  103. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.js +2 -2
  104. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +6 -6
  105. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +6 -6
  106. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/runtime.vue +5 -3
  107. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.d.ts +8 -2
  108. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.js +2 -2
  109. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.vue +4 -3
  110. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.d.ts +8 -2
  111. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.js +1 -1
  112. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +18 -18
  113. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +18 -18
  114. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/runtime.vue +4 -3
  115. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +8 -2
  116. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/schema.js +1 -1
  117. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +18 -18
  118. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +18 -18
  119. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/runtime.vue +4 -3
  120. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/schema.d.ts +8 -2
  121. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/schema.js +1 -1
  122. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +4 -3
  123. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.d.ts +8 -2
  124. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.js +1 -1
  125. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +4 -3
  126. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.d.ts +8 -2
  127. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.js +1 -1
  128. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +18 -18
  129. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +18 -18
  130. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +4 -3
  131. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +8 -2
  132. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.js +1 -1
  133. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +18 -18
  134. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +18 -18
  135. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +4 -3
  136. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.d.ts +8 -2
  137. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.js +1 -1
  138. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +18 -18
  139. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +18 -18
  140. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +4 -3
  141. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.d.ts +8 -2
  142. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.js +1 -1
  143. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +18 -18
  144. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +18 -18
  145. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +4 -3
  146. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.d.ts +8 -2
  147. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.js +1 -1
  148. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/runtime.vue +5 -3
  149. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.d.ts +8 -2
  150. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.js +1 -1
  151. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/runtime.vue +5 -3
  152. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.d.ts +8 -2
  153. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.js +1 -1
  154. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/runtime.vue +4 -3
  155. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.d.ts +8 -2
  156. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.js +1 -1
  157. package/dist/runtime/components/sidebar/index.d.vue.ts +22 -3
  158. package/dist/runtime/components/sidebar/index.vue +66 -5
  159. package/dist/runtime/components/sidebar/index.vue.d.ts +22 -3
  160. package/dist/runtime/components/sidebar/node.d.vue.ts +1 -1
  161. package/dist/runtime/components/sidebar/node.vue +33 -13
  162. package/dist/runtime/components/sidebar/node.vue.d.ts +1 -1
  163. package/dist/runtime/components/sidebar/tree.vue +113 -83
  164. package/dist/runtime/components/sidebar/types.d.ts +8 -0
  165. package/dist/runtime/components/sidebar/types.js +1 -0
  166. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
  167. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
  168. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
  169. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
  170. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
  171. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
  172. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
  173. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
  174. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -2
  175. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -2
  176. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -2
  177. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -2
  178. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  179. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  180. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  181. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  182. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
  183. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
  184. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
  185. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
  186. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  187. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  188. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  189. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  190. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
  191. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue +224 -133
  192. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
  193. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
  194. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue +224 -133
  195. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
  196. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  197. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  198. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  199. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  200. package/dist/runtime/components/table/customization.d.vue.ts +15 -0
  201. package/dist/runtime/components/table/customization.vue +633 -0
  202. package/dist/runtime/components/table/customization.vue.d.ts +15 -0
  203. package/dist/runtime/components/table/index.vue +69 -6
  204. package/dist/runtime/components/table/schema.d.ts +68 -68
  205. package/dist/runtime/components/table/utils/customization.d.ts +158 -0
  206. package/dist/runtime/components/table/utils/customization.js +315 -0
  207. package/dist/runtime/components/table/utils/row-reorder.d.ts +3 -2
  208. package/dist/runtime/components/table/utils/row-reorder.js +1 -12
  209. package/dist/runtime/components/tabs/index.d.vue.ts +9 -0
  210. package/dist/runtime/components/tabs/index.vue +92 -0
  211. package/dist/runtime/components/tabs/index.vue.d.ts +9 -0
  212. package/dist/runtime/components/tabs/tab.d.vue.ts +22 -0
  213. package/dist/runtime/components/tabs/tab.vue +85 -0
  214. package/dist/runtime/components/tabs/tab.vue.d.ts +22 -0
  215. package/dist/runtime/components/tabs/types.d.ts +19 -0
  216. package/dist/runtime/components/tabs/types.js +0 -0
  217. package/dist/runtime/components/tabs/use-reorder.d.ts +10 -0
  218. package/dist/runtime/components/tabs/use-reorder.js +90 -0
  219. package/dist/runtime/components/tabs/use-tabs.d.ts +46 -0
  220. package/dist/runtime/components/tabs/use-tabs.js +101 -0
  221. package/dist/runtime/components/ui/date-picker/DatePickerInput.d.vue.ts +1 -1
  222. package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +1 -1
  223. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +1 -1
  224. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +1 -1
  225. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +1 -1
  226. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +1 -1
  227. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
  228. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
  229. package/dist/runtime/components/ui/sidebar/SidebarMenuAction.vue +1 -1
  230. package/dist/runtime/components/ui/sidebar/index.js +2 -2
  231. package/dist/runtime/share/reorder.d.ts +2 -0
  232. package/dist/runtime/share/reorder.js +12 -0
  233. package/dist/runtime/utils/nav-registry.d.ts +19 -0
  234. package/dist/runtime/utils/nav-registry.js +14 -0
  235. package/dist/runtime/utils/page-title-registry.d.ts +3 -0
  236. package/dist/runtime/utils/page-title-registry.js +11 -0
  237. package/dist/runtime/vendor/cel-js/CLAUDE.md +6 -5
  238. package/dist/runtime/vendor/cel-js/PROMPT.md +97 -19
  239. package/dist/runtime/vendor/cel-js/lib/decimal.d.ts +4 -0
  240. package/dist/runtime/vendor/cel-js/lib/decimal.js +35 -0
  241. package/dist/runtime/vendor/cel-js/lib/evaluator.js +2 -0
  242. package/dist/runtime/vendor/cel-js/lib/functions.js +107 -134
  243. package/dist/runtime/vendor/cel-js/lib/macros.js +125 -16
  244. package/dist/runtime/vendor/cel-js/lib/math-builtins.d.ts +2 -0
  245. package/dist/runtime/vendor/cel-js/lib/math-builtins.js +39 -0
  246. package/dist/runtime/vendor/cel-js/lib/optional.d.ts +4 -0
  247. package/dist/runtime/vendor/cel-js/lib/optional.js +73 -21
  248. package/dist/runtime/vendor/cel-js/lib/parser.js +2 -6
  249. package/dist/runtime/vendor/cel-js/lib/registry.js +2 -2
  250. package/package.json +1 -1
@@ -8,7 +8,7 @@ CEL has these types:
8
8
 
9
9
  | Type | Examples | Notes |
10
10
  |------|----------|-------|
11
- | `number` | `42`, `3.14`, `0xFF` | All numbers are arbitrary-precision decimals. There is no `int`, `uint`, or `float` distinction — just `number`. `0.1 + 0.2 == 0.3` is `true`. |
11
+ | `number` | `42`, `3.14`, `0xFF` | All numbers are arbitrary-precision decimals. There is no `int`, `uint`, or `float` distinction — just `number`. `0.1 + 0.2 == 0.3` is `true`. Division keeps 20 significant digits, so `10 / 3 * 3 == 10` is `false` — compare against a rounded value instead. |
12
12
  | `string` | `"hello"`, `'world'` | Single or double quotes. Triple-quoted for multiline: `"""text"""`. Raw strings: `r"no\escapes"`. |
13
13
  | `bool` | `true`, `false` | |
14
14
  | `bytes` | `b"data"`, `b'\xff'` | Binary data. |
@@ -101,16 +101,33 @@ obj[?0] // optional index access (returns optional)
101
101
  ```cel
102
102
  number("42") // parse string to number
103
103
  number(true) // 1 (false gives 0)
104
+ number(d) // Date → epoch-millisecond timestamp
104
105
  string(42) // "42"
105
106
  string(true) // "true"
107
+ string(d) // Date → ISO 8601 string
106
108
  bool("true") // true (also accepts "t", "1", "TRUE", "True")
107
109
  bool("false") // false (also accepts "f", "0", "FALSE", "False")
108
110
  bytes("text") // UTF-8 encode to bytes
109
- int(3.7) // 3 (truncates to integer)
110
- double("3.14") // alias for number()
111
111
  type(x) // returns the type of x
112
112
  dyn(x) // identity, marks as dynamic type
113
113
  ```
114
+ There is no `int()`, `uint()`, or `double()` — `number` is the only numeric
115
+ type. To produce an integer, round explicitly with `math.trunc` / `math.floor`
116
+ / `math.ceil` / `math.round`.
117
+
118
+ ### Math
119
+ ```cel
120
+ math.trunc(3.7) // 3 — drop the fraction (toward zero)
121
+ math.floor(3.7) // 3 — toward negative infinity (math.floor(-3.1) == -4)
122
+ math.ceil(3.1) // 4 — toward positive infinity
123
+ math.round(2.5) // 3 — nearest; ties away from zero (math.round(-2.5) == -3)
124
+ math.abs(-3.5) // 3.5
125
+ math.min(3, 7) // 3
126
+ math.max(3, 7) // 7
127
+ math.min([5, 2, 9]) // 2 — also accepts a list<number> (errors on [])
128
+ math.max(items.map(i, number(i.price))) // largest mapped value
129
+ ```
130
+ All math operations are exact decimal arithmetic — no float rounding error.
114
131
 
115
132
  ### Size
116
133
  ```cel
@@ -213,44 +230,60 @@ Value coercion is flat (same rules as `.query(...)`):
213
230
  on the value if you need a structured field)
214
231
 
215
232
  ### Dates
233
+ Unit and field names accept singular or plural ("day" == "days") everywhere.
234
+
216
235
  ```cel
217
236
  date("2023-06-15") // create a Date
218
237
  date("2023-06-15T10:30:00Z") // with time component
219
238
  date(1718409600) // from a Unix timestamp — seconds...
220
239
  date(1718409600000) // ...or milliseconds (unit auto-detected by magnitude)
221
240
 
222
- // Comparisons:
241
+ // Time zones (IANA name or fixed offset):
242
+ date("2024-06-15T09:00", "Asia/Shanghai") // 09:00 *in Shanghai* (wall-clock reading)
243
+ date(1718409600, "UTC") // timestamp, rendered in UTC
244
+ d.tz("America/New_York") // same instant, rendered in another zone
245
+ // format / get / startOf / set all work in the date's own zone.
246
+
247
+ // Comparisons (instant-based, zone-independent):
223
248
  date("2023-01-01") < date("2024-01-01") // true
224
249
  date("2023-01-01") == date("2023-01-01") // true
225
250
 
251
+ // Read calendar fields (numbers; month is 1-based):
252
+ d.get("year") // 2023
253
+ d.get("month") // 6 — June
254
+ d.get("day") // day of month
255
+ d.get("hour") // 0–23
256
+ d.get("minute") d.get("second") d.get("millisecond")
257
+ d.get("weekday") // ISO: 1 = Monday … 7 = Sunday
258
+
226
259
  // Start/end of period:
227
- d.startOf("day") // start of day
228
- d.startOf("week") // start of week
229
- d.startOf("month") // start of month
230
- d.startOf("year") // start of year
231
- d.endOf("month") // end of month
260
+ d.startOf("day") // also: minute / hour / week / month / year
261
+ d.endOf("month") // same units as startOf
232
262
 
233
263
  // Offset (positive or negative):
234
264
  d.offset(3, "days") // 3 days later
235
265
  d.offset(-1, "month") // 1 month earlier
236
- d.offset(2, "weeks") // 2 weeks later
237
- d.offset(1, "year") // 1 year later
266
+ d.offset(90, "minutes") // sub-day units work too
267
+ // units: millisecond / second / minute / hour / day / week / month / year
238
268
 
239
269
  // Difference between two dates (signed, truncated toward zero):
240
270
  // receiver is the minuend, so `a.diff(b, unit)` == a − b
241
271
  d.diff(other, "day") // whole days from other to d (negative if d is earlier)
242
272
  d.diff(other, "hour") // whole hours
243
- d.diff(other, "minute") // whole minutes
244
- // units: millisecond / second / minute / hour / day / week / month / year (plural ok)
273
+ // units: millisecond / second / minute / hour / day / week / month / year
245
274
 
246
- // Set specific fields:
275
+ // Set specific fields (month is 1-based):
247
276
  d.set("day", 15) // set day of month to 15
248
- d.set("month", 6) // set to June (1-based)
249
- d.set("year", 2025) // set year to 2025
277
+ d.set("month", 6) // set to June
278
+ d.set("hour", 9) // also: minute / second / millisecond / year
250
279
 
251
280
  // Format:
252
281
  d.format("yyyy-MM-dd") // "2023-06-15"
253
282
  d.format("MMMM d, yyyy") // "June 15, 2023"
283
+
284
+ // Convert:
285
+ number(d) // epoch-millisecond timestamp
286
+ string(d) // ISO 8601 in the date's own zone
254
287
  ```
255
288
 
256
289
  ### Ranges
@@ -262,7 +295,7 @@ range(0, 10, 2) // [0, 2, 4, 6, 8] — with a step
262
295
  range(5, 0) // [5, 4, 3, 2, 1] — counts down
263
296
  range(date("2024-01-01"), date("2024-04-01"), "month")
264
297
  // [2024-01-01, 2024-02-01, 2024-03-01]
265
- // Date unit is one of: "year", "month", "day", "hour", "minute".
298
+ // Date unit is one of: second / minute / hour / day / week / month / year (plural ok).
266
299
  ```
267
300
 
268
301
  ### URL
@@ -336,10 +369,13 @@ http.post("https://api.example.com/users")
336
369
 
337
370
  An `optional<T>` is either present (`Some`) or absent (`None`). They come from
338
371
  `.?` / `[?]` access, `find`, and `URL.query`. Build them with `optional.of(x)`
339
- (the lift — wraps a value as present) and `optional.none()`.
372
+ (the lift — wraps a value as present), `optional.ofNullable(x)` (like `of`, but
373
+ `null` lifts to absent), and `optional.none()`.
340
374
 
341
375
  ```cel
342
376
  optional.of(5) // present, holds 5
377
+ optional.of(null) // present, holds null (of never inspects the value)
378
+ optional.ofNullable(row.middleName) // absent when the field is null
343
379
  optional.none() // absent
344
380
 
345
381
  o.hasValue() // bool — is it present?
@@ -370,6 +406,48 @@ optional.of(2).flatMap(v, optional.none()).hasValue() // false — body collap
370
406
  Together with `optional.of`, `flatMap` is a lawful monad and `map` its derived
371
407
  Functor (`o.map(v, body)` == `o.flatMap(v, optional.of(body))`).
372
408
 
409
+ ### filter — keep a present value only if it qualifies
410
+ `o.filter(v, predicate)` keeps a present value when the predicate holds and
411
+ collapses it to `None` otherwise; an absent `o` stays `None` and the predicate
412
+ is never evaluated. The value is unchanged — `filter` never transforms.
413
+ ```cel
414
+ loc.query("tab").filter(v, v != "").orValue("home")
415
+ // drop a present-but-empty ?tab= and fall back to "home"
416
+
417
+ optional.of(5).filter(v, v > 10).hasValue() // false — value didn't qualify
418
+ ```
419
+
420
+ ### exists / all — test a present value without unwrapping
421
+ `o.exists(v, predicate)` is the predicate when present, `false` when absent.
422
+ `o.all(v, predicate)` is the predicate when present, `true` when absent
423
+ (vacuous truth — "no value violates it"). Both return plain `bool`, so they
424
+ slot directly into conditions.
425
+ ```cel
426
+ query.?channel.exists(c, c == "web") // false when the field is absent
427
+ query.?limit.all(l, l <= 100) // absent limit is fine; a present one must qualify
428
+ ```
429
+
430
+ ### zip — combine two optionals
431
+ `a.zip(b, x, y, body)` binds the present value of `a` to `x`, the present value
432
+ of `b` to `y`, evaluates `body` (a plain value), and re-wraps the result as
433
+ present — but only when **both** are present; if either is absent the result is
434
+ `None` and `body` is never evaluated. It is the flattened form of
435
+ `a.flatMap(x, b.map(y, body))` — use it to apply a two-argument operation
436
+ (logical `&&`/`||`, string concatenation, arithmetic) across two optionals
437
+ without nesting.
438
+ ```cel
439
+ // logical AND of two optional booleans
440
+ enabled.zip(allowed, e, a, e && a).orValue(false)
441
+
442
+ // concatenate two optional strings, with a fallback
443
+ first.zip(last, f, l, f + " " + l).orValue("N/A")
444
+ ```
445
+ Note this is applicative, not three-valued: `optional.of(false).zip(none, a, b, a && b)`
446
+ is `None`, not `Some(false)` — a determined operand does not rescue an absent one.
447
+ Only reach for `zip` when **both** operands are optional; if just one is, plain
448
+ `map` suffices (`a.map(x, x && plainBool)`). For three or more, chain it:
449
+ `a.zip(b, x, y, x && y).zip(c, r, z, r && z)`.
450
+
373
451
  ## Macros
374
452
 
375
453
  Macros are special forms — they look like method calls but have special evaluation semantics.
@@ -463,7 +541,7 @@ values.all(v, v >= 0 && v <= 100)
463
541
  - **No function definitions** — You can only call built-in or registered functions.
464
542
  - **No statements** — No `if`/`else` blocks, `for`, `while`, `return`. Use the ternary `? :` for conditionals.
465
543
  - **No mutation** — You cannot modify values. Every operation produces a new value.
466
- - **No `int` or `uint` type** — All numbers are just `number`. Write `42`, not `int(42)`. You do not need to worry about integer vs float precision — `0.1 + 0.2 == 0.3` works correctly.
544
+ - **No `int`, `uint`, or `double`** — All numbers are just `number`, and the `int()` / `uint()` / `double()` conversions do not exist (calling them is an error, and a `123u` literal is a parse error). You do not need to worry about integer vs float precision — `0.1 + 0.2 == 0.3` works correctly. To force an integer, round explicitly: `math.trunc(x)`, `math.floor(x)`, `math.ceil(x)`, or `math.round(x)`.
467
545
  - **No imports or modules** — Everything available is already in scope.
468
546
 
469
547
  ## Error Cases to Avoid
@@ -6,6 +6,10 @@ export declare class Decimal {
6
6
  constructor(sign: 1 | -1, coeff: bigint, exp: number);
7
7
  static from(v: DecimalInput): Decimal;
8
8
  isZero(): boolean;
9
+ trunc(): Decimal;
10
+ floor(): Decimal;
11
+ ceil(): Decimal;
12
+ round(): Decimal;
9
13
  isInteger(): boolean;
10
14
  neg(): Decimal;
11
15
  abs(): Decimal;
@@ -15,6 +15,29 @@ function normalize(sign, coeff, exp) {
15
15
  }
16
16
  return new Decimal(sign, coeff, exp);
17
17
  }
18
+ function toInteger(d, mode) {
19
+ if (d.exp >= 0) return d;
20
+ const scale = pow10(-d.exp);
21
+ const q = d.coeff / scale;
22
+ const r = d.coeff % scale;
23
+ let up = false;
24
+ switch (mode) {
25
+ case "trunc":
26
+ break;
27
+ case "floor":
28
+ up = d.sign === -1 && r !== ZERO;
29
+ break;
30
+ case "ceil":
31
+ up = d.sign === 1 && r !== ZERO;
32
+ break;
33
+ case "round":
34
+ up = r * 2n >= scale;
35
+ break;
36
+ }
37
+ const coeff = up ? q + ONE : q;
38
+ if (coeff === ZERO) return new Decimal(1, ZERO, 0);
39
+ return normalize(d.sign, coeff, 0);
40
+ }
18
41
  function alignExp(a, b) {
19
42
  const diff = a.exp - b.exp;
20
43
  if (diff === 0) return [a.coeff, b.coeff, a.exp];
@@ -90,6 +113,18 @@ export class Decimal {
90
113
  isZero() {
91
114
  return this.coeff === ZERO;
92
115
  }
116
+ trunc() {
117
+ return toInteger(this, "trunc");
118
+ }
119
+ floor() {
120
+ return toInteger(this, "floor");
121
+ }
122
+ ceil() {
123
+ return toInteger(this, "ceil");
124
+ }
125
+ round() {
126
+ return toInteger(this, "round");
127
+ }
93
128
  isInteger() {
94
129
  return this.exp >= 0;
95
130
  }
@@ -5,6 +5,7 @@ import { registerFunctions } from "./functions.js";
5
5
  import { registerHttpBuiltins } from "./http-builtins.js";
6
6
  import { registerJSONBuiltins } from "./json-builtins.js";
7
7
  import { registerFormBuiltins } from "./form-builtins.js";
8
+ import { registerMathBuiltins } from "./math-builtins.js";
8
9
  import { registerMacros } from "./macros.js";
9
10
  import { registerOverloads } from "./overloads.js";
10
11
  import { TypeChecker } from "./type-checker.js";
@@ -18,6 +19,7 @@ registerMacros(globalRegistry);
18
19
  registerHttpBuiltins(globalRegistry);
19
20
  registerJSONBuiltins(globalRegistry);
20
21
  registerFormBuiltins(globalRegistry);
22
+ registerMathBuiltins(globalRegistry);
21
23
  class Environment {
22
24
  #registry;
23
25
  #evaluator;
@@ -4,7 +4,7 @@ import { TYPES, Type } from "./registry.js";
4
4
  import { register as registerOptional, optionalOf } from "./optional.js";
5
5
  import { objKeys, arrayFrom } from "./globals.js";
6
6
  import { TZDate } from "@date-fns/tz";
7
- import { startOfDay, startOfWeek, startOfMonth, startOfYear, endOfDay, endOfWeek, endOfMonth, endOfYear, addDays, addWeeks, addMonths, addYears, addHours, addMinutes, setDate as setDayOfMonth, setMonth, setYear, format as formatDate, differenceInMilliseconds, differenceInSeconds, differenceInMinutes, differenceInHours, differenceInDays, differenceInWeeks, differenceInMonths, differenceInYears } from "date-fns";
7
+ import { startOfMinute, startOfHour, startOfDay, startOfWeek, startOfMonth, startOfYear, endOfMinute, endOfHour, endOfDay, endOfWeek, endOfMonth, endOfYear, addMilliseconds, addSeconds, addMinutes, addHours, addDays, addWeeks, addMonths, addYears, setMilliseconds, setSeconds, setMinutes, setHours, setDate as setDayOfMonth, setMonth, setYear, format as formatDate, differenceInMilliseconds, differenceInSeconds, differenceInMinutes, differenceInHours, differenceInDays, differenceInWeeks, differenceInMonths, differenceInYears } from "date-fns";
8
8
  function toNum(v) {
9
9
  if (v instanceof Decimal) return v.toNumber();
10
10
  if (typeof v === "bigint") return Number(v);
@@ -82,53 +82,6 @@ export function registerFunctions(registry) {
82
82
  }
83
83
  });
84
84
  functionOverload("number(bool): number", (v) => Decimal.from(v ? 1 : 0));
85
- functionOverload("int(number): number", (v) => {
86
- const d = Decimal.from(v);
87
- if (d.isInteger()) return d;
88
- const n = d.toNumber();
89
- if (!Number.isFinite(n)) throw evaluationError("numeric_overflow", "int() type error: integer overflow");
90
- return Decimal.from(BigInt(Math.trunc(n)));
91
- });
92
- functionOverload("int(string): number", (v) => {
93
- const s = v;
94
- if (s !== s.trim() || s.length > 20 || s.includes("0x")) {
95
- throw evaluationError("int_conversion_error", "int() type error: cannot convert to int");
96
- }
97
- try {
98
- return Decimal.from(s);
99
- } catch {
100
- throw evaluationError("int_conversion_error", "int() type error: cannot convert to int");
101
- }
102
- });
103
- functionOverload("double(number): number", (v) => Decimal.from(v));
104
- functionOverload("double(string): number", (v) => {
105
- const s = v;
106
- if (!s || s !== s.trim())
107
- throw evaluationError(
108
- "double_conversion_error",
109
- "double() type error: cannot convert to double"
110
- );
111
- try {
112
- return Decimal.from(s);
113
- } catch {
114
- throw evaluationError(
115
- "double_conversion_error",
116
- "double() type error: cannot convert to double"
117
- );
118
- }
119
- });
120
- functionOverload("uint(number): number", (v) => Decimal.from(v));
121
- functionOverload("uint(string): number", (v) => {
122
- const s = v;
123
- if (s !== s.trim() || s.length > 20 || s.includes("0x")) {
124
- throw evaluationError("uint_conversion_error", "uint() type error: cannot convert to uint");
125
- }
126
- try {
127
- return Decimal.from(s);
128
- } catch {
129
- throw evaluationError("uint_conversion_error", "uint() type error: cannot convert to uint");
130
- }
131
- });
132
85
  functionOverload("string(string): string", identity);
133
86
  functionOverload("string(bool): string", (v) => `${v}`);
134
87
  functionOverload("string(number): string", (v) => Decimal.from(v).toString());
@@ -284,23 +237,55 @@ export function registerFunctions(registry) {
284
237
  return new TZDate(result.getTime(), source.timeZone);
285
238
  }
286
239
  registry.registerType("Date", TZDate);
287
- functionOverload("date(string): Date", (v) => {
288
- const d = new TZDate(v);
240
+ const singularUnit = (unit) => unit.replace(/s$/, "");
241
+ function pickUnit(table, unit, method) {
242
+ const fn = table[singularUnit(unit)];
243
+ if (fn) return fn;
244
+ throw evaluationError("invalid_unit", `${method}(): unknown unit "${unit}" (expected ${objKeys(table).join(" / ")})`);
245
+ }
246
+ function checkTimeZone(tz) {
247
+ try {
248
+ new Intl.DateTimeFormat("en-US", { timeZone: tz });
249
+ return tz;
250
+ } catch {
251
+ throw evaluationError("invalid_timezone", `Unknown time zone "${tz}" (expected an IANA name like "Asia/Shanghai" or an offset like "+08:00")`);
252
+ }
253
+ }
254
+ const WALL_CLOCK_STRING = /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?)?$/;
255
+ function dateFromString(v, tz) {
256
+ const s = v;
257
+ let d;
258
+ const m = tz === void 0 ? null : WALL_CLOCK_STRING.exec(s);
259
+ if (tz === void 0) {
260
+ d = new TZDate(s);
261
+ } else if (m) {
262
+ const ms = +(m[7] ?? "0").padEnd(3, "0").slice(0, 3);
263
+ d = new TZDate(+m[1], +m[2] - 1, +m[3], +(m[4] ?? "0"), +(m[5] ?? "0"), +(m[6] ?? "0"), ms, tz);
264
+ } else {
265
+ d = new TZDate(s, tz);
266
+ }
289
267
  if (Number.isNaN(d.getTime())) throw evaluationError("invalid_date", `date() requires a valid date string, got "${v}"`);
290
268
  return d;
291
- });
292
- functionOverload("date(number): Date", (v) => {
269
+ }
270
+ function dateFromTimestamp(v, tz) {
293
271
  const n = toNum(v);
294
272
  if (!Number.isFinite(n)) {
295
273
  throw evaluationError("invalid_date", `date() requires a finite timestamp, got ${v}`);
296
274
  }
297
275
  const ms = Math.abs(n) < 1e11 ? n * 1e3 : n;
298
- const d = new TZDate(ms);
276
+ const d = tz === void 0 ? new TZDate(ms) : new TZDate(ms, tz);
299
277
  if (Number.isNaN(d.getTime())) {
300
278
  throw evaluationError("invalid_date", `date() got an out-of-range timestamp: ${v}`);
301
279
  }
302
280
  return d;
303
- });
281
+ }
282
+ functionOverload("date(string): Date", (v) => dateFromString(v));
283
+ functionOverload("date(number): Date", (v) => dateFromTimestamp(v));
284
+ functionOverload("date(string, string): Date", (v, tz) => dateFromString(v, checkTimeZone(tz)));
285
+ functionOverload("date(number, string): Date", (v, tz) => dateFromTimestamp(v, checkTimeZone(tz)));
286
+ functionOverload("Date.tz(string): Date", (d, tz) => new TZDate(d.getTime(), checkTimeZone(tz)));
287
+ functionOverload("number(Date): number", (v) => Decimal.from(v.getTime()));
288
+ functionOverload("string(Date): string", (v) => v.toISOString());
304
289
  const RANGE_LIMIT = 1e5;
305
290
  function numericRange(startD, endD, stepD) {
306
291
  const step = stepD.toNumber();
@@ -324,18 +309,17 @@ export function registerFunctions(registry) {
324
309
  functionOverload("range(number, number): list<dyn>", (start, end) => numericRange(start, end, Decimal.from(1)));
325
310
  functionOverload("range(number, number, number): list<dyn>", (start, end, step) => numericRange(start, end, step));
326
311
  const rangeSteppers = {
327
- year: addYears,
328
- month: addMonths,
329
- day: addDays,
312
+ second: addSeconds,
313
+ minute: addMinutes,
330
314
  hour: addHours,
331
- minute: addMinutes
315
+ day: addDays,
316
+ week: addWeeks,
317
+ month: addMonths,
318
+ year: addYears
332
319
  };
333
320
  functionOverload("range(Date, Date, string): list<dyn>", (startV, endV, unitV) => {
334
321
  const start = startV;
335
- const stepFn = rangeSteppers[unitV];
336
- if (!stepFn) {
337
- throw evaluationError("invalid_unit", `range(): unknown unit "${unitV}" (expected year / month / day / hour / minute)`);
338
- }
322
+ const stepFn = pickUnit(rangeSteppers, unitV, "range");
339
323
  const endMs = endV.getTime();
340
324
  const ascending = start.getTime() < endMs;
341
325
  const out = [];
@@ -349,90 +333,79 @@ export function registerFunctions(registry) {
349
333
  }
350
334
  return out;
351
335
  });
336
+ const startOfFns = {
337
+ minute: startOfMinute,
338
+ hour: startOfHour,
339
+ day: startOfDay,
340
+ week: startOfWeek,
341
+ month: startOfMonth,
342
+ year: startOfYear
343
+ };
344
+ const endOfFns = {
345
+ minute: endOfMinute,
346
+ hour: endOfHour,
347
+ day: endOfDay,
348
+ week: endOfWeek,
349
+ month: endOfMonth,
350
+ year: endOfYear
351
+ };
352
+ const offsetFns = {
353
+ millisecond: addMilliseconds,
354
+ second: addSeconds,
355
+ minute: addMinutes,
356
+ hour: addHours,
357
+ day: addDays,
358
+ week: addWeeks,
359
+ month: addMonths,
360
+ year: addYears
361
+ };
362
+ const setFns = {
363
+ millisecond: setMilliseconds,
364
+ second: setSeconds,
365
+ minute: setMinutes,
366
+ hour: setHours,
367
+ day: setDayOfMonth,
368
+ month: (d, v) => setMonth(d, v - 1),
369
+ year: setYear
370
+ };
371
+ const diffFns = {
372
+ millisecond: differenceInMilliseconds,
373
+ second: differenceInSeconds,
374
+ minute: differenceInMinutes,
375
+ hour: differenceInHours,
376
+ day: differenceInDays,
377
+ week: differenceInWeeks,
378
+ month: differenceInMonths,
379
+ year: differenceInYears
380
+ };
381
+ const getFns = {
382
+ millisecond: (d) => d.getMilliseconds(),
383
+ second: (d) => d.getSeconds(),
384
+ minute: (d) => d.getMinutes(),
385
+ hour: (d) => d.getHours(),
386
+ day: (d) => d.getDate(),
387
+ weekday: (d) => (d.getDay() + 6) % 7 + 1,
388
+ month: (d) => d.getMonth() + 1,
389
+ year: (d) => d.getFullYear()
390
+ };
352
391
  functionOverload("Date.startOf(string): Date", (d, unit) => {
353
392
  const date = d;
354
- switch (unit) {
355
- case "day":
356
- return wrapTZ(startOfDay(date), date);
357
- case "week":
358
- return wrapTZ(startOfWeek(date), date);
359
- case "month":
360
- return wrapTZ(startOfMonth(date), date);
361
- case "year":
362
- return wrapTZ(startOfYear(date), date);
363
- default:
364
- throw evaluationError("invalid_unit", `startOf(): unknown unit "${unit}"`);
365
- }
393
+ return wrapTZ(pickUnit(startOfFns, unit, "startOf")(date), date);
366
394
  });
367
395
  functionOverload("Date.endOf(string): Date", (d, unit) => {
368
396
  const date = d;
369
- switch (unit) {
370
- case "day":
371
- return wrapTZ(endOfDay(date), date);
372
- case "week":
373
- return wrapTZ(endOfWeek(date), date);
374
- case "month":
375
- return wrapTZ(endOfMonth(date), date);
376
- case "year":
377
- return wrapTZ(endOfYear(date), date);
378
- default:
379
- throw evaluationError("invalid_unit", `endOf(): unknown unit "${unit}"`);
380
- }
397
+ return wrapTZ(pickUnit(endOfFns, unit, "endOf")(date), date);
381
398
  });
382
399
  functionOverload("Date.offset(number, string): Date", (d, n, unit) => {
383
400
  const date = d;
384
- const num = toNum(n);
385
- switch (unit.replace(/s$/, "")) {
386
- case "day":
387
- return wrapTZ(addDays(date, num), date);
388
- case "week":
389
- return wrapTZ(addWeeks(date, num), date);
390
- case "month":
391
- return wrapTZ(addMonths(date, num), date);
392
- case "year":
393
- return wrapTZ(addYears(date, num), date);
394
- default:
395
- throw evaluationError("invalid_unit", `offset(): unknown unit "${unit}"`);
396
- }
397
- });
398
- functionOverload("Date.diff(Date, string): number", (d, other, unit) => {
399
- const left = d;
400
- const right = other;
401
- switch (unit.replace(/s$/, "")) {
402
- case "millisecond":
403
- return Decimal.from(differenceInMilliseconds(left, right));
404
- case "second":
405
- return Decimal.from(differenceInSeconds(left, right));
406
- case "minute":
407
- return Decimal.from(differenceInMinutes(left, right));
408
- case "hour":
409
- return Decimal.from(differenceInHours(left, right));
410
- case "day":
411
- return Decimal.from(differenceInDays(left, right));
412
- case "week":
413
- return Decimal.from(differenceInWeeks(left, right));
414
- case "month":
415
- return Decimal.from(differenceInMonths(left, right));
416
- case "year":
417
- return Decimal.from(differenceInYears(left, right));
418
- default:
419
- throw evaluationError("invalid_unit", `diff(): unknown unit "${unit}"`);
420
- }
401
+ return wrapTZ(pickUnit(offsetFns, unit, "offset")(date, toNum(n)), date);
421
402
  });
403
+ functionOverload("Date.diff(Date, string): number", (d, other, unit) => Decimal.from(pickUnit(diffFns, unit, "diff")(d, other)));
422
404
  functionOverload("Date.set(string, number): Date", (d, field, value) => {
423
405
  const date = d;
424
- const val = toNum(value);
425
- switch (field) {
426
- case "day":
427
- return wrapTZ(setDayOfMonth(date, val), date);
428
- case "month":
429
- return wrapTZ(setMonth(date, val - 1), date);
430
- case "year":
431
- return wrapTZ(setYear(date, val), date);
432
- default:
433
- throw evaluationError("invalid_field", `set(): unknown field "${field}"`);
434
- }
406
+ return wrapTZ(pickUnit(setFns, field, "set")(date, toNum(value)), date);
435
407
  });
408
+ functionOverload("Date.get(string): number", (d, field) => Decimal.from(pickUnit(getFns, field, "get")(d)));
436
409
  functionOverload("Date.format(string): string", (d, fmt) => formatDate(d, fmt));
437
410
  registry.registerType("File", File);
438
411
  registry.registerType("URL", URL);