@shwfed/config 2.12.3 → 2.12.5
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.
- package/dist/module.json +1 -1
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/runtime.vue +9 -2
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.d.ts +8 -2
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.js +3 -3
- package/dist/runtime/components/actions/components/group.vue +3 -1
- package/dist/runtime/components/actions/schema.d.ts +16 -4
- package/dist/runtime/components/actions/schema.js +5 -5
- package/dist/runtime/components/config/footer.d.vue.ts +4 -0
- package/dist/runtime/components/config/footer.vue +25 -12
- package/dist/runtime/components/config/footer.vue.d.ts +4 -0
- package/dist/runtime/components/config/history-picker.d.vue.ts +15 -0
- package/dist/runtime/components/config/history-picker.vue +155 -0
- package/dist/runtime/components/config/history-picker.vue.d.ts +15 -0
- package/dist/runtime/components/config/index.d.vue.ts +4 -0
- package/dist/runtime/components/config/index.vue +8 -1
- package/dist/runtime/components/config/index.vue.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +24 -24
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +24 -24
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +18 -18
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +18 -18
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +26 -26
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +26 -26
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue.d.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +30 -30
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +30 -30
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +8 -8
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +8 -8
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue.d.ts +2 -2
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.vue +6 -1
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +9 -3
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +24 -24
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +24 -24
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/runtime.vue +5 -3
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.d.ts +8 -2
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.js +1 -1
- package/dist/runtime/components/form/index.vue +5 -1
- package/dist/runtime/components/form/utils/derived.d.ts +9 -0
- package/dist/runtime/components/form/utils/derived.js +1 -1
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +6 -6
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +6 -6
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +6 -6
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +6 -6
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +10 -10
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +10 -10
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +10 -10
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +10 -10
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue +224 -133
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue +224 -133
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +10 -10
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +10 -10
- package/dist/runtime/components/table/customization.d.vue.ts +15 -0
- package/dist/runtime/components/table/customization.vue +633 -0
- package/dist/runtime/components/table/customization.vue.d.ts +15 -0
- package/dist/runtime/components/table/index.vue +69 -6
- package/dist/runtime/components/table/utils/customization.d.ts +158 -0
- package/dist/runtime/components/table/utils/customization.js +315 -0
- package/dist/runtime/components/ui/date-picker/DatePickerInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
- package/dist/runtime/vendor/cel-js/CLAUDE.md +6 -5
- package/dist/runtime/vendor/cel-js/PROMPT.md +97 -19
- package/dist/runtime/vendor/cel-js/lib/decimal.d.ts +4 -0
- package/dist/runtime/vendor/cel-js/lib/decimal.js +35 -0
- package/dist/runtime/vendor/cel-js/lib/evaluator.js +2 -0
- package/dist/runtime/vendor/cel-js/lib/functions.js +107 -134
- package/dist/runtime/vendor/cel-js/lib/macros.js +125 -16
- package/dist/runtime/vendor/cel-js/lib/math-builtins.d.ts +2 -0
- package/dist/runtime/vendor/cel-js/lib/math-builtins.js +39 -0
- package/dist/runtime/vendor/cel-js/lib/optional.d.ts +4 -0
- package/dist/runtime/vendor/cel-js/lib/optional.js +73 -21
- package/dist/runtime/vendor/cel-js/lib/parser.js +2 -6
- package/dist/runtime/vendor/cel-js/lib/registry.js +2 -2
- package/package.json +1 -1
|
@@ -29,8 +29,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
29
29
|
"onUpdate:endValue"?: ((args_0: Date | undefined) => any) | undefined;
|
|
30
30
|
}>, {
|
|
31
31
|
size: "sm" | "md" | "lg";
|
|
32
|
-
clearIcon: string;
|
|
33
32
|
clearable: boolean;
|
|
33
|
+
clearIcon: string;
|
|
34
34
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const _default: typeof __VLS_export;
|
|
36
36
|
export default _default;
|
|
@@ -26,9 +26,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
26
26
|
size: "sm" | "md" | "lg";
|
|
27
27
|
granularity: "hour" | "minute" | "second";
|
|
28
28
|
hourCycle: 12 | 24;
|
|
29
|
-
rangeSeparatorIcon: string;
|
|
30
|
-
clearIcon: string;
|
|
31
29
|
clearable: boolean;
|
|
30
|
+
clearIcon: string;
|
|
31
|
+
rangeSeparatorIcon: string;
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
34
34
|
export default _default;
|
|
@@ -26,9 +26,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
26
26
|
size: "sm" | "md" | "lg";
|
|
27
27
|
granularity: "hour" | "minute" | "second";
|
|
28
28
|
hourCycle: 12 | 24;
|
|
29
|
-
rangeSeparatorIcon: string;
|
|
30
|
-
clearIcon: string;
|
|
31
29
|
clearable: boolean;
|
|
30
|
+
clearIcon: string;
|
|
31
|
+
rangeSeparatorIcon: string;
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
34
34
|
export default _default;
|
|
@@ -8,11 +8,11 @@ When modifying this library, keep both `CLAUDE.md` and `PROMPT.md` in sync with
|
|
|
8
8
|
|
|
9
9
|
## Key Modifications
|
|
10
10
|
|
|
11
|
-
`int` and `uint` types have been removed in favor of a unified `number` type backed by `Decimal` (arbitrary-precision arithmetic via BigInt). All numeric literals, arithmetic results, and size/index returns are `Decimal` instances. The `int()`, `uint()`, and `double()` conversion functions
|
|
11
|
+
`int` and `uint` types have been removed in favor of a unified `number` type backed by `Decimal` (arbitrary-precision arithmetic via BigInt). All numeric literals, arithmetic results, and size/index returns are `Decimal` instances. The `int()`, `uint()`, and `double()` conversion functions have been **removed entirely** (calling them is an unknown-function error), the CEL `u`/`U` uint-literal suffix (`123u`, `0xFFu`) is a parse error, and the protobufjs field mapping emits `number` for all numeric/enum fields. Explicit rounding lives in the `math` namespace (`math-builtins.ts`, registered like `JSON`): `math.trunc` / `math.floor` / `math.ceil` / `math.round` (ties away from zero, cel-go style) / `math.abs`, plus `math.min` / `math.max` in `(number, number)` and `(list<number>)` overloads (empty list throws). All are exact — implemented on `Decimal`'s BigInt representation (`decimal.ts` `toInteger`), never via a float round-trip.
|
|
12
12
|
|
|
13
|
-
`google.protobuf.Timestamp` and `google.protobuf.Duration` have been removed. Replaced with a `Date` type backed by `TZDate` from `@date-fns/tz`, constructed via `date(string)` or `date(number)` (a Unix timestamp — the seconds-vs-milliseconds unit is auto-detected by magnitude: values `< 1e11` are read as seconds, the rest as milliseconds).
|
|
13
|
+
`google.protobuf.Timestamp` and `google.protobuf.Duration` have been removed. Replaced with a `Date` type backed by `TZDate` from `@date-fns/tz`, constructed via `date(string)` or `date(number)` (a Unix timestamp — the seconds-vs-milliseconds unit is auto-detected by magnitude: values `< 1e11` are read as seconds, the rest as milliseconds). Two-argument forms `date(string, tz)` / `date(number, tz)` anchor an explicit zone (IANA name or fixed offset, validated eagerly via `Intl`): an offset-less wall-clock string (`"2024-06-15T09:00"`, matched by `WALL_CLOCK_STRING`) is interpreted *in that zone* through the TZDate component constructor — NOT via `new TZDate(string, tz)`, whose string path parses machine-local and uses the zone for rendering only — while strings with an explicit offset keep their instant. `Date.tz(string)` re-renders the same instant in another zone. Date manipulation uses date-fns functions, all table-driven through a shared `pickUnit` lookup with a uniform trailing-`s` plural tolerance: `startOf` / `endOf` (`minute` / `hour` / `day` / `week` / `month` / `year`), `offset` and `diff` (`millisecond` … `year`), `set` and the `Date.get(string): number` accessor (`millisecond` … `year`, `month` 1-based, plus `weekday` on `get`, ISO 1 = Monday … 7 = Sunday), and `format`. `Date.diff(Date, string): number` returns the signed, truncated-toward-zero distance between two dates — the receiver is the minuend (`a.diff(b, unit)` = `a − b`, mirroring date-fns `differenceInX(left, right)`); there is no `Date − Date` operator and no duration type, so this is the way to measure elapsed time. Conversions: `number(Date)` is the epoch-millisecond timestamp (round-trips through `date(number)`), `string(Date)` is ISO 8601 rendered with the date's own zone offset.
|
|
14
14
|
|
|
15
|
-
A `range()` built-in has been added (not from upstream) — `range(number, number)`, `range(number, number, number)` and `range(Date, Date, string)`. It builds an end-exclusive list; the direction follows the operands (counts down when `start > end`); `step` is a positive magnitude; the date unit is `
|
|
15
|
+
A `range()` built-in has been added (not from upstream) — `range(number, number)`, `range(number, number, number)` and `range(Date, Date, string)`. It builds an end-exclusive list; the direction follows the operands (counts down when `start > end`); `step` is a positive magnitude; the date unit is `second` / `minute` / `hour` / `day` / `week` / `month` / `year` (plural tolerated). Output length is capped at 100000.
|
|
16
16
|
|
|
17
17
|
A `list.enumerate(): list<map<string, dyn>>` receiver method has been added (not from upstream, in `functions.ts` beside `list.size()`) — pairs each element with its 0-based index as a plain `{index, value}` record (CEL has no tuple type). It is a plain function, not a macro (no variable binding); the index is a `Decimal` so it stays a CEL `number` for downstream arithmetic. Receiver `list` resolves to `list<dyn>`, so it matches any list.
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ A `string.replace(string, string): string` / `string.replace(string, string, num
|
|
|
24
24
|
|
|
25
25
|
The `homogeneousAggregateLiterals` and `enableOptionalTypes` environment options have been removed. Aggregate data structures (lists, maps) are always heterogeneous — mixed-type literals are inferred as `list<dyn>` or `map<dyn, dyn>`. Optional types (`.?`, `[?]`, `optional.*` helpers) are always enabled.
|
|
26
26
|
|
|
27
|
-
The custom `Optional` class has been replaced with Effect's `Option` type (`import { Option } from 'effect'`). Internal helpers `optionalOf(value)` and `optionalValue(opt)` in `optional.js` handle the CEL-specific semantics (treating `undefined` as `None`, throwing `EvaluationError` on missing value access). The optional surface is `optional.of(A): optional<A>` (the lift / `pure`), `optional.none()`, `optional.hasValue()`, `optional.value()`, `optional.or(optional)`, `optional.orValue(value)`, plus `optional<A>.flatMap(var, body): optional<B>` (monadic bind)
|
|
27
|
+
The custom `Optional` class has been replaced with Effect's `Option` type (`import { Option } from 'effect'`). Internal helpers `optionalOf(value)` and `optionalValue(opt)` in `optional.js` handle the CEL-specific semantics (treating `undefined` as `None`, throwing `EvaluationError` on missing value access). The optional surface is `optional.of(A): optional<A>` (the lift / `pure` — `of(null)` is `Some(null)`), `optional.ofNullable(A): optional<A>` (the null-tolerant lift, Java-style — `null` becomes `None`), `optional.none()`, `optional.hasValue()`, `optional.value()`, `optional.or(optional)`, `optional.orValue(value)`, plus `optional<A>.flatMap(var, body): optional<B>` (monadic bind), `optional<A>.map(var, body): optional<B>` (the Functor `fmap`), `optional<A>.zip(other, x, y, body): optional<C>` (the applicative `liftA2` / `zipWith`), `optional<A>.filter(var, predicate): optional<A>` (Rust `Option::filter` / Haskell `mfilter`), and the folds `optional<A>.exists(var, predicate): bool` (predicate on `Some`, `false` on `None` — Rust `is_some_and`) and `optional<A>.all(var, predicate): bool` (predicate on `Some`, vacuously `true` on `None` — Scala `forall`) — all local additions (not from upstream). All are variable-binding macros (registered with `ast` arg types so the unbound args stay unevaluated): on `Some` they bind the value(s) and evaluate `body`; on `None` they short-circuit without touching `body`. `flatMap`'s body must itself yield an `optional`; `map`'s body is a plain value that gets re-wrapped in `Some`; `filter` / `exists` / `all` predicates must be `bool` (enforced at type-check when static, at runtime via `invalid_condition_type` otherwise). `map` is the derived `o.flatMap(v, optional.of(body))` promoted to a first-class macro. `zip` is the flattened `a.flatMap(x, b.map(y, body))`: it type-checks `other` in the outer ctx, binds `x` then `y` under two chained overlays, re-wraps the plain body in `Some`, and short-circuits to `None` if either side is `None` (a `None` receiver skips evaluating `other`). Because CEL has no tuple type the transform is fused (there is no useful `optional<pair>` to return), so `zip` is `zipWith`, not Rust/Scala's pair-building `Option.zip`. The short-circuit makes `zip` observationally monadic — harmless for `optional` (a `None` carries no payload) but it would not generalise to an error-accumulating applicative. An `optional.none()` receiver/argument carries a `param` element type; the shared `bindOptionalValueType` helper (exported from `optional.ts`) binds it as `dyn` so a boolean body still type-checks — every binding macro (`map` / `flatMap` / `zip` / `filter` / `exists` / `all`) goes through it (leaking the `param` into the iteration variable was a real bug in `map` / `flatMap`, regression-tested in `optional-extras.test.ts`). `zip` lives in `optional.ts` beside `flatMap`; the two-variable binding is why it is not folded into the shared `map` expander. NOTE: `map`, `filter`, `all`, and `exists` are **registered in `macros.ts`**, not here — the parser resolves a macro by name before types are known, so the optional variants and the list-comprehension variants must share one expander per name that dispatches on the receiver type at type-check (an `optional` receiver → optional semantics; `list`/`map` → comprehension; a `dyn` receiver is deferred to a runtime `Option.isOption` check). `exists_one` and `find` stay list-only.
|
|
28
28
|
|
|
29
29
|
An `http` built-in has been added (`http-builtins.ts`, `http-builder.ts`) — not from upstream. It registers the `http` constant and the `http` / `HttpRequest` types on `globalRegistry`, so `http.get(url).header(...).body(...)` expressions type-check and evaluate in every `Environment`. A CEL expression only builds an `HttpRequestBuilder` — a pure description of a request; it never issues one. The terminal methods `.json()`, `.file()`, and `.fileOrJson()` are dispatched by the host on the returned builder (none is a CEL method), so expression evaluation stays free of IO. `.fileOrJson()` branches on the response `Content-Type`: a JSON media type (`application/json` or a `+json` suffix) is parsed and returned as `{ _tag: 'json', json }`; anything else is returned as `{ _tag: 'file', file }`. Note the `Fetch` service itself `ensureOk`s (both `FetchLive` and the mock layer), so a non-2xx fails at `Fetch.fetch` before the branch and this only ever distinguishes 2xx bodies — i.e. the HTTP-200-with-error-envelope case. The download operation uses it so a backend that answers a download with a JSON error envelope (commonly `{ code: -1 }` on a 200) is classified rather than saved as the file. Endpoints must be absolute URLs — there is no base-URL resolution. Depends on `fx-fetch`. The host can register process-wide default headers via `HttpRequestBuilder.setDefaultHeader(name, valueOrGetter)` / `clearDefaultHeader(name)`; they are merged in at `#buildRequest()` time, with case-insensitive precedence to an explicit `.header(...)` on the builder. A getter that returns `null` / `undefined` / `''` skips the header for that request, so the host can source values from live refs (e.g. the active i18n locale for `Accept-Language`) without baking in stale snapshots. `.query` accepts `(string, string)` / `(string, number)`, the optional-valued `(string, optional<string>)` / `(string, optional<number>)` (a `None`, e.g. an absent `.?` field, drops the param rather than emitting `key=`; `Some` appends it via the string/number coercion), and the record-splat `(dyn)`.
|
|
30
30
|
|
|
@@ -47,11 +47,12 @@ lib/
|
|
|
47
47
|
├── operators.ts — Binary/unary operator implementations
|
|
48
48
|
├── overloads.ts — Operator overload definitions
|
|
49
49
|
├── functions.ts — Built-in functions + Date type (TZDate)
|
|
50
|
-
├── macros.ts — map (list comprehension
|
|
50
|
+
├── macros.ts — map / filter / all / exists (each dispatching list comprehension vs optional receiver), exists_one, find, has, cel.bind
|
|
51
51
|
├── http-builtins.ts — `http` constant + http/HttpRequest types (local addition)
|
|
52
52
|
├── http-builder.ts — `HttpRequestBuilder` — what an http.* expression returns
|
|
53
53
|
├── json-builtins.ts — `JSON` constant + `JSON.parse` / `JSON.stringify` (local addition)
|
|
54
54
|
├── form-builtins.ts — `form(map): FormData` global + `FormData` type (local addition)
|
|
55
|
+
├── math-builtins.ts — `math` namespace: trunc / floor / ceil / round / abs / min / max (local addition)
|
|
55
56
|
├── decimal.ts — Decimal class (arbitrary precision)
|
|
56
57
|
├── optional.ts — Optional type support (uses Effect Option)
|
|
57
58
|
├── serialize.ts — AST back to CEL string
|
|
@@ -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
|
-
//
|
|
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") //
|
|
228
|
-
d.
|
|
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(
|
|
237
|
-
|
|
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
|
-
|
|
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
|
|
249
|
-
d.set("
|
|
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:
|
|
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)
|
|
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 `
|
|
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;
|