@elaraai/e3-ui 1.0.85 → 1.0.87
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/src/bind/data-indexed.d.ts +159 -0
- package/dist/src/bind/data-indexed.d.ts.map +1 -0
- package/dist/src/bind/data-indexed.js +105 -0
- package/dist/src/bind/data-indexed.js.map +1 -0
- package/dist/src/bind/data.d.ts +5 -3
- package/dist/src/bind/data.d.ts.map +1 -1
- package/dist/src/bind/data.js +6 -0
- package/dist/src/bind/data.js.map +1 -1
- package/dist/src/bind/record.d.ts +34 -23
- package/dist/src/bind/record.d.ts.map +1 -1
- package/dist/src/bind/record.js +46 -19
- package/dist/src/bind/record.js.map +1 -1
- package/dist/src/calendar/index.d.ts +2923 -0
- package/dist/src/calendar/index.d.ts.map +1 -0
- package/dist/src/calendar/index.js +135 -0
- package/dist/src/calendar/index.js.map +1 -0
- package/dist/src/decision/queue.d.ts +3 -3
- package/dist/src/decision/queue.d.ts.map +1 -1
- package/dist/src/decision/queue.js +2 -2
- package/dist/src/decision/queue.js.map +1 -1
- package/dist/src/decision/types.d.ts +4 -0
- package/dist/src/decision/types.d.ts.map +1 -1
- package/dist/src/decision/types.js +4 -0
- package/dist/src/decision/types.js.map +1 -1
- package/dist/src/flowchart/canvas.d.ts +114 -0
- package/dist/src/flowchart/canvas.d.ts.map +1 -0
- package/dist/src/flowchart/canvas.js +84 -0
- package/dist/src/flowchart/canvas.js.map +1 -0
- package/dist/src/flowchart/flowchart.d.ts +79 -0
- package/dist/src/flowchart/flowchart.d.ts.map +1 -0
- package/dist/src/flowchart/flowchart.js +9 -0
- package/dist/src/flowchart/flowchart.js.map +1 -0
- package/dist/src/flowchart/index.d.ts +305 -0
- package/dist/src/flowchart/index.d.ts.map +1 -0
- package/dist/src/flowchart/index.js +267 -0
- package/dist/src/flowchart/index.js.map +1 -0
- package/dist/src/flowchart/library.d.ts +720 -0
- package/dist/src/flowchart/library.d.ts.map +1 -0
- package/dist/src/flowchart/library.js +611 -0
- package/dist/src/flowchart/library.js.map +1 -0
- package/dist/src/flowchart/over.d.ts +234 -0
- package/dist/src/flowchart/over.d.ts.map +1 -0
- package/dist/src/flowchart/over.js +220 -0
- package/dist/src/flowchart/over.js.map +1 -0
- package/dist/src/flowchart/patch.d.ts +64 -0
- package/dist/src/flowchart/patch.d.ts.map +1 -0
- package/dist/src/flowchart/patch.js +67 -0
- package/dist/src/flowchart/patch.js.map +1 -0
- package/dist/src/flowchart/payload.d.ts +8220 -0
- package/dist/src/flowchart/payload.d.ts.map +1 -0
- package/dist/src/flowchart/payload.js +521 -0
- package/dist/src/flowchart/payload.js.map +1 -0
- package/dist/src/flowchart/types.d.ts +393 -0
- package/dist/src/flowchart/types.d.ts.map +1 -0
- package/dist/src/flowchart/types.js +216 -0
- package/dist/src/flowchart/types.js.map +1 -0
- package/dist/src/flowchart/values.d.ts +267 -0
- package/dist/src/flowchart/values.d.ts.map +1 -0
- package/dist/src/flowchart/values.js +216 -0
- package/dist/src/flowchart/values.js.map +1 -0
- package/dist/src/flowchart/window.d.ts +521 -0
- package/dist/src/flowchart/window.d.ts.map +1 -0
- package/dist/src/flowchart/window.js +69 -0
- package/dist/src/flowchart/window.js.map +1 -0
- package/dist/src/index.d.ts +25 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +48 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +35 -3
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +72 -3
- package/dist/src/internal.js.map +1 -1
- package/dist/src/plan/assemble.d.ts +2224 -0
- package/dist/src/plan/assemble.d.ts.map +1 -0
- package/dist/src/plan/assemble.js +210 -0
- package/dist/src/plan/assemble.js.map +1 -0
- package/dist/src/plan/builders.d.ts +790 -0
- package/dist/src/plan/builders.d.ts.map +1 -0
- package/dist/src/plan/builders.js +749 -0
- package/dist/src/plan/builders.js.map +1 -0
- package/dist/src/plan/event-rows.d.ts +2565 -0
- package/dist/src/plan/event-rows.d.ts.map +1 -0
- package/dist/src/plan/event-rows.js +689 -0
- package/dist/src/plan/event-rows.js.map +1 -0
- package/dist/src/plan/factories.d.ts +458 -0
- package/dist/src/plan/factories.d.ts.map +1 -0
- package/dist/src/plan/factories.js +484 -0
- package/dist/src/plan/factories.js.map +1 -0
- package/dist/src/plan/index.d.ts +672 -0
- package/dist/src/plan/index.d.ts.map +1 -0
- package/dist/src/plan/index.js +532 -0
- package/dist/src/plan/index.js.map +1 -0
- package/dist/src/plan/ir.d.ts +2594 -0
- package/dist/src/plan/ir.d.ts.map +1 -0
- package/dist/src/plan/ir.js +78 -0
- package/dist/src/plan/ir.js.map +1 -0
- package/dist/src/plan/library.d.ts +772 -0
- package/dist/src/plan/library.d.ts.map +1 -0
- package/dist/src/plan/library.js +424 -0
- package/dist/src/plan/library.js.map +1 -0
- package/dist/src/plan/ordered-source.d.ts +27 -0
- package/dist/src/plan/ordered-source.d.ts.map +1 -0
- package/dist/src/plan/ordered-source.js +48 -0
- package/dist/src/plan/ordered-source.js.map +1 -0
- package/dist/src/plan/over.d.ts +247 -0
- package/dist/src/plan/over.d.ts.map +1 -0
- package/dist/src/plan/over.js +266 -0
- package/dist/src/plan/over.js.map +1 -0
- package/dist/src/plan/pick.d.ts +78 -0
- package/dist/src/plan/pick.d.ts.map +1 -0
- package/dist/src/plan/pick.js +146 -0
- package/dist/src/plan/pick.js.map +1 -0
- package/dist/src/plan/plan.d.ts +11611 -0
- package/dist/src/plan/plan.d.ts.map +1 -0
- package/dist/src/plan/plan.js +428 -0
- package/dist/src/plan/plan.js.map +1 -0
- package/dist/src/plan/refs.d.ts +218 -0
- package/dist/src/plan/refs.d.ts.map +1 -0
- package/dist/src/plan/refs.js +226 -0
- package/dist/src/plan/refs.js.map +1 -0
- package/dist/src/plan/root.d.ts +290 -0
- package/dist/src/plan/root.d.ts.map +1 -0
- package/dist/src/plan/root.js +463 -0
- package/dist/src/plan/root.js.map +1 -0
- package/dist/src/plan/series.d.ts +13554 -0
- package/dist/src/plan/series.d.ts.map +1 -0
- package/dist/src/plan/series.js +1921 -0
- package/dist/src/plan/series.js.map +1 -0
- package/dist/src/plan/types.d.ts +12400 -0
- package/dist/src/plan/types.d.ts.map +1 -0
- package/dist/src/plan/types.js +1335 -0
- package/dist/src/plan/types.js.map +1 -0
- package/dist/src/roster/coverage.d.ts +240 -0
- package/dist/src/roster/coverage.d.ts.map +1 -0
- package/dist/src/roster/coverage.js +109 -0
- package/dist/src/roster/coverage.js.map +1 -0
- package/dist/src/roster/index.d.ts +4028 -0
- package/dist/src/roster/index.d.ts.map +1 -0
- package/dist/src/roster/index.js +115 -0
- package/dist/src/roster/index.js.map +1 -0
- package/dist/src/roster/library.d.ts +106 -0
- package/dist/src/roster/library.d.ts.map +1 -0
- package/dist/src/roster/library.js +78 -0
- package/dist/src/roster/library.js.map +1 -0
- package/dist/src/roster/people.d.ts +50 -0
- package/dist/src/roster/people.d.ts.map +1 -0
- package/dist/src/roster/people.js +32 -0
- package/dist/src/roster/people.js.map +1 -0
- package/dist/src/roster/rules.d.ts +275 -0
- package/dist/src/roster/rules.d.ts.map +1 -0
- package/dist/src/roster/rules.js +162 -0
- package/dist/src/roster/rules.js.map +1 -0
- package/dist/src/roster/types.d.ts +672 -0
- package/dist/src/roster/types.d.ts.map +1 -0
- package/dist/src/roster/types.js +248 -0
- package/dist/src/roster/types.js.map +1 -0
- package/dist/src/roster/visibility.d.ts +66 -0
- package/dist/src/roster/visibility.d.ts.map +1 -0
- package/dist/src/roster/visibility.js +25 -0
- package/dist/src/roster/visibility.js.map +1 -0
- package/dist/src/schedule/days.d.ts +54 -0
- package/dist/src/schedule/days.d.ts.map +1 -0
- package/dist/src/schedule/days.js +68 -0
- package/dist/src/schedule/days.js.map +1 -0
- package/dist/src/schedule/events.d.ts +433 -0
- package/dist/src/schedule/events.d.ts.map +1 -0
- package/dist/src/schedule/events.js +851 -0
- package/dist/src/schedule/events.js.map +1 -0
- package/dist/src/schedule/index.d.ts +150 -0
- package/dist/src/schedule/index.d.ts.map +1 -0
- package/dist/src/schedule/index.js +132 -0
- package/dist/src/schedule/index.js.map +1 -0
- package/dist/src/schedule/library.d.ts +70 -0
- package/dist/src/schedule/library.d.ts.map +1 -0
- package/dist/src/schedule/library.js +102 -0
- package/dist/src/schedule/library.js.map +1 -0
- package/dist/src/schedule/patch.d.ts +74 -0
- package/dist/src/schedule/patch.d.ts.map +1 -0
- package/dist/src/schedule/patch.js +68 -0
- package/dist/src/schedule/patch.js.map +1 -0
- package/dist/src/schedule/record-window.d.ts +189 -0
- package/dist/src/schedule/record-window.d.ts.map +1 -0
- package/dist/src/schedule/record-window.js +95 -0
- package/dist/src/schedule/record-window.js.map +1 -0
- package/dist/src/schedule/resources.d.ts +165 -0
- package/dist/src/schedule/resources.d.ts.map +1 -0
- package/dist/src/schedule/resources.js +234 -0
- package/dist/src/schedule/resources.js.map +1 -0
- package/dist/src/schedule/templates.d.ts +47 -0
- package/dist/src/schedule/templates.d.ts.map +1 -0
- package/dist/src/schedule/templates.js +61 -0
- package/dist/src/schedule/templates.js.map +1 -0
- package/dist/src/schedule/types.d.ts +1677 -0
- package/dist/src/schedule/types.d.ts.map +1 -0
- package/dist/src/schedule/types.js +374 -0
- package/dist/src/schedule/types.js.map +1 -0
- package/dist/src/schedule/window.d.ts +154 -0
- package/dist/src/schedule/window.d.ts.map +1 -0
- package/dist/src/schedule/window.js +363 -0
- package/dist/src/schedule/window.js.map +1 -0
- package/dist/src/sheet/bridge.d.ts +385 -0
- package/dist/src/sheet/bridge.d.ts.map +1 -0
- package/dist/src/sheet/bridge.js +809 -0
- package/dist/src/sheet/bridge.js.map +1 -0
- package/dist/src/sheet/columns.d.ts +410 -0
- package/dist/src/sheet/columns.d.ts.map +1 -0
- package/dist/src/sheet/columns.js +99 -0
- package/dist/src/sheet/columns.js.map +1 -0
- package/dist/src/sheet/context-bridge.d.ts +48 -0
- package/dist/src/sheet/context-bridge.d.ts.map +1 -0
- package/dist/src/sheet/context-bridge.js +216 -0
- package/dist/src/sheet/context-bridge.js.map +1 -0
- package/dist/src/sheet/draft-bridge.d.ts +37 -0
- package/dist/src/sheet/draft-bridge.d.ts.map +1 -0
- package/dist/src/sheet/draft-bridge.js +153 -0
- package/dist/src/sheet/draft-bridge.js.map +1 -0
- package/dist/src/sheet/drafts.d.ts +14 -0
- package/dist/src/sheet/drafts.d.ts.map +1 -0
- package/dist/src/sheet/drafts.js +14 -0
- package/dist/src/sheet/drafts.js.map +1 -0
- package/dist/src/sheet/editing-bridge.d.ts +40 -0
- package/dist/src/sheet/editing-bridge.d.ts.map +1 -0
- package/dist/src/sheet/editing-bridge.js +231 -0
- package/dist/src/sheet/editing-bridge.js.map +1 -0
- package/dist/src/sheet/editing-types.d.ts +268 -0
- package/dist/src/sheet/editing-types.d.ts.map +1 -0
- package/dist/src/sheet/editing-types.js +34 -0
- package/dist/src/sheet/editing-types.js.map +1 -0
- package/dist/src/sheet/edits.d.ts +37 -0
- package/dist/src/sheet/edits.d.ts.map +1 -0
- package/dist/src/sheet/edits.js +31 -0
- package/dist/src/sheet/edits.js.map +1 -0
- package/dist/src/sheet/fields.d.ts +693 -0
- package/dist/src/sheet/fields.d.ts.map +1 -0
- package/dist/src/sheet/fields.js +280 -0
- package/dist/src/sheet/fields.js.map +1 -0
- package/dist/src/sheet/group.d.ts +165 -0
- package/dist/src/sheet/group.d.ts.map +1 -0
- package/dist/src/sheet/group.js +52 -0
- package/dist/src/sheet/group.js.map +1 -0
- package/dist/src/sheet/index.d.ts +542 -0
- package/dist/src/sheet/index.d.ts.map +1 -0
- package/dist/src/sheet/index.js +387 -0
- package/dist/src/sheet/index.js.map +1 -0
- package/dist/src/sheet/library.d.ts +284 -0
- package/dist/src/sheet/library.d.ts.map +1 -0
- package/dist/src/sheet/library.js +259 -0
- package/dist/src/sheet/library.js.map +1 -0
- package/dist/src/sheet/link.d.ts +398 -0
- package/dist/src/sheet/link.d.ts.map +1 -0
- package/dist/src/sheet/link.js +228 -0
- package/dist/src/sheet/link.js.map +1 -0
- package/dist/src/sheet/record.d.ts +75 -0
- package/dist/src/sheet/record.d.ts.map +1 -0
- package/dist/src/sheet/record.js +128 -0
- package/dist/src/sheet/record.js.map +1 -0
- package/dist/src/sheet/registers.d.ts +681 -0
- package/dist/src/sheet/registers.d.ts.map +1 -0
- package/dist/src/sheet/registers.js +671 -0
- package/dist/src/sheet/registers.js.map +1 -0
- package/dist/src/sheet/root.d.ts +329 -0
- package/dist/src/sheet/root.d.ts.map +1 -0
- package/dist/src/sheet/root.js +511 -0
- package/dist/src/sheet/root.js.map +1 -0
- package/dist/src/sheet/seed-bridge.d.ts +14 -0
- package/dist/src/sheet/seed-bridge.d.ts.map +1 -0
- package/dist/src/sheet/seed-bridge.js +51 -0
- package/dist/src/sheet/seed-bridge.js.map +1 -0
- package/dist/src/sheet/sheet.d.ts +11819 -0
- package/dist/src/sheet/sheet.d.ts.map +1 -0
- package/dist/src/sheet/sheet.js +236 -0
- package/dist/src/sheet/sheet.js.map +1 -0
- package/dist/src/sheet/sub-rows.d.ts +299 -0
- package/dist/src/sheet/sub-rows.d.ts.map +1 -0
- package/dist/src/sheet/sub-rows.js +272 -0
- package/dist/src/sheet/sub-rows.js.map +1 -0
- package/dist/src/sheet/templates.d.ts +161 -0
- package/dist/src/sheet/templates.d.ts.map +1 -0
- package/dist/src/sheet/templates.js +122 -0
- package/dist/src/sheet/templates.js.map +1 -0
- package/dist/src/sheet/transactions.d.ts +76 -0
- package/dist/src/sheet/transactions.d.ts.map +1 -0
- package/dist/src/sheet/transactions.js +40 -0
- package/dist/src/sheet/transactions.js.map +1 -0
- package/dist/src/sheet/types.d.ts +15226 -0
- package/dist/src/sheet/types.d.ts.map +1 -0
- package/dist/src/sheet/types.js +1070 -0
- package/dist/src/sheet/types.js.map +1 -0
- package/dist/src/sheet/views.d.ts +29 -0
- package/dist/src/sheet/views.d.ts.map +1 -0
- package/dist/src/sheet/views.js +43 -0
- package/dist/src/sheet/views.js.map +1 -0
- package/dist/src/studio/component.d.ts.map +1 -1
- package/dist/src/studio/component.js +11 -8
- package/dist/src/studio/component.js.map +1 -1
- package/dist/src/utils/derive.d.ts +134 -8
- package/dist/src/utils/derive.d.ts.map +1 -1
- package/dist/src/utils/derive.js +409 -7
- package/dist/src/utils/derive.js.map +1 -1
- package/dist/src/utils/ordered-source.d.ts +38 -0
- package/dist/src/utils/ordered-source.d.ts.map +1 -0
- package/dist/src/utils/ordered-source.js +45 -0
- package/dist/src/utils/ordered-source.js.map +1 -0
- package/dist/src/utils/row-inspector.d.ts +36 -0
- package/dist/src/utils/row-inspector.d.ts.map +1 -0
- package/dist/src/utils/row-inspector.js +49 -0
- package/dist/src/utils/row-inspector.js.map +1 -0
- package/dist/test/bind/data/data.examples.d.ts +21 -19
- package/dist/test/bind/data/data.examples.d.ts.map +1 -1
- package/dist/test/bind/data/data.examples.js +122 -122
- package/dist/test/bind/data/data.examples.js.map +1 -1
- package/dist/test/bind/record/record.examples.d.ts.map +1 -1
- package/dist/test/bind/record/record.examples.js +9 -9
- package/dist/test/bind/record/record.examples.js.map +1 -1
- package/dist/test/calendar/calendar-records.examples.d.ts +228 -0
- package/dist/test/calendar/calendar-records.examples.d.ts.map +1 -0
- package/dist/test/calendar/calendar-records.examples.js +91 -0
- package/dist/test/calendar/calendar-records.examples.js.map +1 -0
- package/dist/test/calendar/calendar.examples.d.ts +776 -0
- package/dist/test/calendar/calendar.examples.d.ts.map +1 -0
- package/dist/test/calendar/calendar.examples.js +336 -0
- package/dist/test/calendar/calendar.examples.js.map +1 -0
- package/dist/test/decision/journal.examples.d.ts +28 -28
- package/dist/test/decision/journal.examples.d.ts.map +1 -1
- package/dist/test/decision/journal.examples.js +4 -4
- package/dist/test/decision/journal.examples.js.map +1 -1
- package/dist/test/decision/queue.examples.d.ts.map +1 -1
- package/dist/test/decision/queue.examples.js +5 -7
- package/dist/test/decision/queue.examples.js.map +1 -1
- package/dist/test/flowchart/flowchart.examples.d.ts +3713 -0
- package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -0
- package/dist/test/flowchart/flowchart.examples.js +465 -0
- package/dist/test/flowchart/flowchart.examples.js.map +1 -0
- package/dist/test/plan/plan-events.examples.d.ts +3666 -0
- package/dist/test/plan/plan-events.examples.d.ts.map +1 -0
- package/dist/test/plan/plan-events.examples.js +773 -0
- package/dist/test/plan/plan-events.examples.js.map +1 -0
- package/dist/test/plan/plan-records.examples.d.ts +3 -0
- package/dist/test/plan/plan-records.examples.d.ts.map +1 -0
- package/dist/test/plan/plan-records.examples.js +45 -0
- package/dist/test/plan/plan-records.examples.js.map +1 -0
- package/dist/test/plan/plan-windows.examples.d.ts +588 -0
- package/dist/test/plan/plan-windows.examples.d.ts.map +1 -0
- package/dist/test/plan/plan-windows.examples.js +170 -0
- package/dist/test/plan/plan-windows.examples.js.map +1 -0
- package/dist/test/plan/plan.examples.d.ts +8095 -0
- package/dist/test/plan/plan.examples.d.ts.map +1 -0
- package/dist/test/plan/plan.examples.js +2500 -0
- package/dist/test/plan/plan.examples.js.map +1 -0
- package/dist/test/roster/domain.examples.d.ts +367 -0
- package/dist/test/roster/domain.examples.d.ts.map +1 -0
- package/dist/test/roster/domain.examples.js +72 -0
- package/dist/test/roster/domain.examples.js.map +1 -0
- package/dist/test/roster/roster-records.examples.d.ts +729 -0
- package/dist/test/roster/roster-records.examples.d.ts.map +1 -0
- package/dist/test/roster/roster-records.examples.js +86 -0
- package/dist/test/roster/roster-records.examples.js.map +1 -0
- package/dist/test/roster/roster.examples.d.ts +750 -0
- package/dist/test/roster/roster.examples.d.ts.map +1 -0
- package/dist/test/roster/roster.examples.js +198 -0
- package/dist/test/roster/roster.examples.js.map +1 -0
- package/dist/test/roster/warehouse.d.ts +87 -0
- package/dist/test/roster/warehouse.d.ts.map +1 -0
- package/dist/test/roster/warehouse.js +883 -0
- package/dist/test/roster/warehouse.js.map +1 -0
- package/dist/test/sheet/sheet-link.examples.d.ts +7 -0
- package/dist/test/sheet/sheet-link.examples.d.ts.map +1 -0
- package/dist/test/sheet/sheet-link.examples.js +41 -0
- package/dist/test/sheet/sheet-link.examples.js.map +1 -0
- package/dist/test/sheet/sheet-records.examples.d.ts +421 -0
- package/dist/test/sheet/sheet-records.examples.d.ts.map +1 -0
- package/dist/test/sheet/sheet-records.examples.js +79 -0
- package/dist/test/sheet/sheet-records.examples.js.map +1 -0
- package/dist/test/sheet/sheet-transactions.examples.d.ts +7 -0
- package/dist/test/sheet/sheet-transactions.examples.d.ts.map +1 -0
- package/dist/test/sheet/sheet-transactions.examples.js +58 -0
- package/dist/test/sheet/sheet-transactions.examples.js.map +1 -0
- package/dist/test/sheet/sheet.examples.d.ts +5562 -0
- package/dist/test/sheet/sheet.examples.d.ts.map +1 -0
- package/dist/test/sheet/sheet.examples.js +1178 -0
- package/dist/test/sheet/sheet.examples.js.map +1 -0
- package/dist/test/studio/studio.examples.d.ts.map +1 -1
- package/dist/test/studio/studio.examples.js +11 -11
- package/dist/test/studio/studio.examples.js.map +1 -1
- package/package.json +12 -9
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* `Sheet.subRows` and `Sheet.subRow` — sub rows (#844,
|
|
7
|
+
* `libs/east-ui/docs/proposals/Sheet Sub Rows - DX Proposal.md`): read-only
|
|
8
|
+
* rows under a line (or a flat row) that share none of the sheet's columns.
|
|
9
|
+
*
|
|
10
|
+
* `Sheet.subRows(R, { field: (item, row) => Sheet.subRow({ … }) })` is keyed
|
|
11
|
+
* like `columns`: each key names an `Array<T>` field of the type the columns
|
|
12
|
+
* are built over, and its mapper turns one element into a sub row. Key order
|
|
13
|
+
* is display order. The builder only CAPTURES; the root compiles each mapper
|
|
14
|
+
* once and the bridge calls it inside the row projection (`bridge.ts`).
|
|
15
|
+
*
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
*/
|
|
18
|
+
import { East, Expr, ArrayType, OptionType, StringType, some, none, } from "@elaraai/east";
|
|
19
|
+
import { SheetFacetType, SheetSubRowType } from "./types.js";
|
|
20
|
+
/**
|
|
21
|
+
* Declares where a sheet's sub rows come from — `Sheet.subRows(R, { … })`.
|
|
22
|
+
*
|
|
23
|
+
* @typeParam R - The type the columns are built over (a grouped sheet: the line type)
|
|
24
|
+
* @param rowType - The row type value
|
|
25
|
+
* @param sources - Array field → mapper to a sub row, in display order
|
|
26
|
+
* @returns The declaration the `subRows` prop takes
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
|
|
31
|
+
* import { ArrayType, DictType, East, FloatType, IntegerType, OptionType, StringType, StructType, VariantType, none, some, variant } from "@elaraai/east";
|
|
32
|
+
* import { Box, Reactive, UIComponentType } from "@elaraai/east-ui";
|
|
33
|
+
* import { Record, Sheet } from "@elaraai/e3-ui";
|
|
34
|
+
* import e3 from "@elaraai/e3";
|
|
35
|
+
*
|
|
36
|
+
* export const BatchPart = StructType({ id: StringType, code: StringType, name: StringType, materials: ArrayType(StringType), station: OptionType(StringType) });
|
|
37
|
+
* export const BatchBooking = VariantType({
|
|
38
|
+
* labour: StructType({ team: StringType, people: IntegerType, hours: FloatType }),
|
|
39
|
+
* equipment: StructType({ resource: StringType }),
|
|
40
|
+
* });
|
|
41
|
+
* export const BatchStep = StructType({ task: StringType, qty: OptionType(FloatType), parts: ArrayType(BatchPart), bookings: ArrayType(BatchBooking) });
|
|
42
|
+
* export const Batch = StructType({ id: StringType, name: StringType, steps: ArrayType(BatchStep) });
|
|
43
|
+
* export const BatchDay = StructType({ batches: ArrayType(Batch) });
|
|
44
|
+
* export const sheetBatchDays = e3.record("sheet_batch_days", DictType(StringType, BatchDay), new Map([
|
|
45
|
+
* ["2026-10-12", { batches: [
|
|
46
|
+
* { id: "B-101", name: "Doors, oak", steps: [
|
|
47
|
+
* { task: "Cut doors", qty: some(12.0), parts: [
|
|
48
|
+
* { id: "B-101-1", code: "CUT", name: "Cut the door blanks", materials: ["Oak veneered board × 6"], station: some("S101") },
|
|
49
|
+
* ], bookings: [variant("labour", { team: "Cutting", people: 1n, hours: 3.0 })] },
|
|
50
|
+
* { task: "Band doors", qty: some(48.0), parts: [], bookings: [variant("equipment", { resource: "Edge bander E201" })] },
|
|
51
|
+
* { task: "Spray doors", qty: some(12.0), parts: [
|
|
52
|
+
* { id: "B-101-3", code: "SPR", name: "Seal and lacquer", materials: ["Sealer", "Matt lacquer"], station: none },
|
|
53
|
+
* ], bookings: [] },
|
|
54
|
+
* ] },
|
|
55
|
+
* { id: "B-102", name: "Carcasses, birch", steps: [
|
|
56
|
+
* { task: "Cut carcasses", qty: some(8.0), parts: [], bookings: [] },
|
|
57
|
+
* { task: "Drill carcasses", qty: some(8.0), parts: [], bookings: [variant("labour", { team: "Machining", people: 2n, hours: 2.5 })] },
|
|
58
|
+
* ] },
|
|
59
|
+
* { id: "B-103", name: "Shelves, ash", steps: [
|
|
60
|
+
* { task: "Cut shelves", qty: some(20.0), parts: [], bookings: [] },
|
|
61
|
+
* { task: "Sand shelves", qty: some(20.0), parts: [], bookings: [] },
|
|
62
|
+
* ] },
|
|
63
|
+
* ] }],
|
|
64
|
+
* ]));
|
|
65
|
+
* export const sheetBatchDaysPatch = e3.mutation.patch(sheetBatchDays);
|
|
66
|
+
*
|
|
67
|
+
* const sheet = East.function([], UIComponentType, (_$) => (
|
|
68
|
+
* <Reactive>{$ => {
|
|
69
|
+
* const days = $.let(Record.bind(sheetBatchDays, [sheetBatchDaysPatch]));
|
|
70
|
+
* // The steps a finishing batch starts with: the batch template's lines.
|
|
71
|
+
* const finishing = $.let([
|
|
72
|
+
* { task: "Sand", qty: none, parts: [], bookings: [] },
|
|
73
|
+
* { task: "Seal", qty: none, parts: [], bookings: [] },
|
|
74
|
+
* { task: "Spray", qty: none, parts: [], bookings: [] },
|
|
75
|
+
* ], ArrayType(BatchStep));
|
|
76
|
+
* // A batch needs a name before Save.
|
|
77
|
+
* const readyBatch = $.const(East.function([Sheet.Types.DraftGroup(Batch, "steps")], Sheet.Types.Readiness, ($, batch) => {
|
|
78
|
+
* $.if(batch.name.hasTag("value").and(() => batch.name.unwrap("value").length().equal(0n)), $ => {
|
|
79
|
+
* $.return(East.value(variant("incomplete", [{ field: "name", message: "Name the batch" }]), Sheet.Types.Readiness));
|
|
80
|
+
* });
|
|
81
|
+
* return East.value(variant("ready", null), Sheet.Types.Readiness);
|
|
82
|
+
* }));
|
|
83
|
+
* const newStep = $.const(East.function([Sheet.Types.NewRow], Sheet.Types.Patch(BatchStep), () => Sheet.patch(BatchStep, { qty: none, parts: [], bookings: [] })));
|
|
84
|
+
* const newBatch = $.const(East.function([Sheet.Types.NewGroup], Sheet.Types.Patch(Batch), () => Sheet.patch(Batch, { steps: [] })));
|
|
85
|
+
* return (
|
|
86
|
+
* <Box height="560px">
|
|
87
|
+
* <Sheet
|
|
88
|
+
* record={days}
|
|
89
|
+
* entry={{ key: "2026-10-12", rows: "batches", id: "id" }}
|
|
90
|
+
* group={Sheet.group(Batch, "steps", { title: "name", noun: { singular: "batch", plural: "batches" } })}
|
|
91
|
+
* name="batches"
|
|
92
|
+
* columns={{
|
|
93
|
+
* task: Sheet.column.text(BatchStep, { header: "Step", width: "240px" }),
|
|
94
|
+
* qty: Sheet.column.quantity(BatchStep, { header: "Qty", width: "96px" }),
|
|
95
|
+
* }}
|
|
96
|
+
* subRows={Sheet.subRows(BatchStep, {
|
|
97
|
+
* parts: (p) => Sheet.subRow({
|
|
98
|
+
* code: p.code,
|
|
99
|
+
* name: p.name,
|
|
100
|
+
* chips: p.materials,
|
|
101
|
+
* facets: { station: p.station }, // a none drops out
|
|
102
|
+
* id: p.id,
|
|
103
|
+
* }),
|
|
104
|
+
* bookings: (b) => b.match({
|
|
105
|
+
* labour: (_$2, l) => Sheet.subRow({ code: "LABOUR", name: East.str`${l.team} · ${l.people} people · ${l.hours} hours` }),
|
|
106
|
+
* equipment: (_$2, e) => Sheet.subRow({ code: "EQUIPMENT", name: e.resource }),
|
|
107
|
+
* }),
|
|
108
|
+
* })}
|
|
109
|
+
* // The sub rows show a step's parts and bookings; the inspector's form leaves them out.
|
|
110
|
+
* inspector
|
|
111
|
+
* fields={{ parts: Sheet.field.hidden(), bookings: Sheet.field.hidden() }}
|
|
112
|
+
* templates={{
|
|
113
|
+
* groups: [{ key: "finishing", name: "Finishing batch", group: "Batches",
|
|
114
|
+
* values: Sheet.patch(Batch, { name: "Finishing", steps: finishing }) }],
|
|
115
|
+
* rows: [{ key: "sand", name: "Sand", group: "Steps", values: Sheet.patch(BatchStep, { task: "Sand", qty: none }) },
|
|
116
|
+
* { key: "seal", name: "Seal", group: "Steps", values: Sheet.patch(BatchStep, { task: "Seal", qty: none }) }],
|
|
117
|
+
* }}
|
|
118
|
+
* library={[Sheet.library.rows(), Sheet.library.columns()]}
|
|
119
|
+
* ready={{ group: readyBatch }}
|
|
120
|
+
* newRow={newStep}
|
|
121
|
+
* newGroup={newBatch}
|
|
122
|
+
* />
|
|
123
|
+
* </Box>
|
|
124
|
+
* );
|
|
125
|
+
* }}</Reactive>
|
|
126
|
+
* ));
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
export function createSubRows(rowType, sources) {
|
|
130
|
+
return { rowType, sources };
|
|
131
|
+
}
|
|
132
|
+
/** A `String` or `Option<String>` input as an `Option<String>` expression, its shape read once at build time. */
|
|
133
|
+
function optionalText(v) {
|
|
134
|
+
if (typeof v === "string")
|
|
135
|
+
return East.value(some(v), OptionType(StringType));
|
|
136
|
+
if (v instanceof Expr) {
|
|
137
|
+
if (Expr.type(v) === StringType) {
|
|
138
|
+
return East.value(some(v), OptionType(StringType));
|
|
139
|
+
}
|
|
140
|
+
return v;
|
|
141
|
+
}
|
|
142
|
+
return East.value(v, OptionType(StringType));
|
|
143
|
+
}
|
|
144
|
+
/** A `String` or `Option<String>` input as display text, `""` for none. */
|
|
145
|
+
function textOrBlank(v) {
|
|
146
|
+
if (v === undefined)
|
|
147
|
+
return East.value("", StringType);
|
|
148
|
+
return optionalText(v).match({ some: (_$, s) => s, none: (_$) => "" });
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Builds one sub row — `Sheet.subRow({ code?, name, chips?, facets?, id? })`.
|
|
152
|
+
* What is left out is filled in: `code` and `id` become `""`, `chips` and
|
|
153
|
+
* `facets` `[]`; a facet whose value is `none` drops out.
|
|
154
|
+
*
|
|
155
|
+
* @param input - The sub row's fields ({@link SheetSubRowInput})
|
|
156
|
+
* @returns An expression of `Sheet.Types.SubRow`
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```tsx
|
|
160
|
+
* // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
|
|
161
|
+
* import { ArrayType, DictType, East, FloatType, IntegerType, OptionType, StringType, StructType, VariantType, none, some, variant } from "@elaraai/east";
|
|
162
|
+
* import { Box, Reactive, UIComponentType } from "@elaraai/east-ui";
|
|
163
|
+
* import { Record, Sheet } from "@elaraai/e3-ui";
|
|
164
|
+
* import e3 from "@elaraai/e3";
|
|
165
|
+
*
|
|
166
|
+
* export const BatchPart = StructType({ id: StringType, code: StringType, name: StringType, materials: ArrayType(StringType), station: OptionType(StringType) });
|
|
167
|
+
* export const BatchBooking = VariantType({
|
|
168
|
+
* labour: StructType({ team: StringType, people: IntegerType, hours: FloatType }),
|
|
169
|
+
* equipment: StructType({ resource: StringType }),
|
|
170
|
+
* });
|
|
171
|
+
* export const BatchStep = StructType({ task: StringType, qty: OptionType(FloatType), parts: ArrayType(BatchPart), bookings: ArrayType(BatchBooking) });
|
|
172
|
+
* export const Batch = StructType({ id: StringType, name: StringType, steps: ArrayType(BatchStep) });
|
|
173
|
+
* export const BatchDay = StructType({ batches: ArrayType(Batch) });
|
|
174
|
+
* export const sheetBatchDays = e3.record("sheet_batch_days", DictType(StringType, BatchDay), new Map([
|
|
175
|
+
* ["2026-10-12", { batches: [
|
|
176
|
+
* { id: "B-101", name: "Doors, oak", steps: [
|
|
177
|
+
* { task: "Cut doors", qty: some(12.0), parts: [
|
|
178
|
+
* { id: "B-101-1", code: "CUT", name: "Cut the door blanks", materials: ["Oak veneered board × 6"], station: some("S101") },
|
|
179
|
+
* ], bookings: [variant("labour", { team: "Cutting", people: 1n, hours: 3.0 })] },
|
|
180
|
+
* { task: "Band doors", qty: some(48.0), parts: [], bookings: [variant("equipment", { resource: "Edge bander E201" })] },
|
|
181
|
+
* { task: "Spray doors", qty: some(12.0), parts: [
|
|
182
|
+
* { id: "B-101-3", code: "SPR", name: "Seal and lacquer", materials: ["Sealer", "Matt lacquer"], station: none },
|
|
183
|
+
* ], bookings: [] },
|
|
184
|
+
* ] },
|
|
185
|
+
* { id: "B-102", name: "Carcasses, birch", steps: [
|
|
186
|
+
* { task: "Cut carcasses", qty: some(8.0), parts: [], bookings: [] },
|
|
187
|
+
* { task: "Drill carcasses", qty: some(8.0), parts: [], bookings: [variant("labour", { team: "Machining", people: 2n, hours: 2.5 })] },
|
|
188
|
+
* ] },
|
|
189
|
+
* { id: "B-103", name: "Shelves, ash", steps: [
|
|
190
|
+
* { task: "Cut shelves", qty: some(20.0), parts: [], bookings: [] },
|
|
191
|
+
* { task: "Sand shelves", qty: some(20.0), parts: [], bookings: [] },
|
|
192
|
+
* ] },
|
|
193
|
+
* ] }],
|
|
194
|
+
* ]));
|
|
195
|
+
* export const sheetBatchDaysPatch = e3.mutation.patch(sheetBatchDays);
|
|
196
|
+
*
|
|
197
|
+
* const sheet = East.function([], UIComponentType, (_$) => (
|
|
198
|
+
* <Reactive>{$ => {
|
|
199
|
+
* const days = $.let(Record.bind(sheetBatchDays, [sheetBatchDaysPatch]));
|
|
200
|
+
* // The steps a finishing batch starts with: the batch template's lines.
|
|
201
|
+
* const finishing = $.let([
|
|
202
|
+
* { task: "Sand", qty: none, parts: [], bookings: [] },
|
|
203
|
+
* { task: "Seal", qty: none, parts: [], bookings: [] },
|
|
204
|
+
* { task: "Spray", qty: none, parts: [], bookings: [] },
|
|
205
|
+
* ], ArrayType(BatchStep));
|
|
206
|
+
* // A batch needs a name before Save.
|
|
207
|
+
* const readyBatch = $.const(East.function([Sheet.Types.DraftGroup(Batch, "steps")], Sheet.Types.Readiness, ($, batch) => {
|
|
208
|
+
* $.if(batch.name.hasTag("value").and(() => batch.name.unwrap("value").length().equal(0n)), $ => {
|
|
209
|
+
* $.return(East.value(variant("incomplete", [{ field: "name", message: "Name the batch" }]), Sheet.Types.Readiness));
|
|
210
|
+
* });
|
|
211
|
+
* return East.value(variant("ready", null), Sheet.Types.Readiness);
|
|
212
|
+
* }));
|
|
213
|
+
* const newStep = $.const(East.function([Sheet.Types.NewRow], Sheet.Types.Patch(BatchStep), () => Sheet.patch(BatchStep, { qty: none, parts: [], bookings: [] })));
|
|
214
|
+
* const newBatch = $.const(East.function([Sheet.Types.NewGroup], Sheet.Types.Patch(Batch), () => Sheet.patch(Batch, { steps: [] })));
|
|
215
|
+
* return (
|
|
216
|
+
* <Box height="560px">
|
|
217
|
+
* <Sheet
|
|
218
|
+
* record={days}
|
|
219
|
+
* entry={{ key: "2026-10-12", rows: "batches", id: "id" }}
|
|
220
|
+
* group={Sheet.group(Batch, "steps", { title: "name", noun: { singular: "batch", plural: "batches" } })}
|
|
221
|
+
* name="batches"
|
|
222
|
+
* columns={{
|
|
223
|
+
* task: Sheet.column.text(BatchStep, { header: "Step", width: "240px" }),
|
|
224
|
+
* qty: Sheet.column.quantity(BatchStep, { header: "Qty", width: "96px" }),
|
|
225
|
+
* }}
|
|
226
|
+
* subRows={Sheet.subRows(BatchStep, {
|
|
227
|
+
* parts: (p) => Sheet.subRow({
|
|
228
|
+
* code: p.code,
|
|
229
|
+
* name: p.name,
|
|
230
|
+
* chips: p.materials,
|
|
231
|
+
* facets: { station: p.station }, // a none drops out
|
|
232
|
+
* id: p.id,
|
|
233
|
+
* }),
|
|
234
|
+
* bookings: (b) => b.match({
|
|
235
|
+
* labour: (_$2, l) => Sheet.subRow({ code: "LABOUR", name: East.str`${l.team} · ${l.people} people · ${l.hours} hours` }),
|
|
236
|
+
* equipment: (_$2, e) => Sheet.subRow({ code: "EQUIPMENT", name: e.resource }),
|
|
237
|
+
* }),
|
|
238
|
+
* })}
|
|
239
|
+
* // The sub rows show a step's parts and bookings; the inspector's form leaves them out.
|
|
240
|
+
* inspector
|
|
241
|
+
* fields={{ parts: Sheet.field.hidden(), bookings: Sheet.field.hidden() }}
|
|
242
|
+
* templates={{
|
|
243
|
+
* groups: [{ key: "finishing", name: "Finishing batch", group: "Batches",
|
|
244
|
+
* values: Sheet.patch(Batch, { name: "Finishing", steps: finishing }) }],
|
|
245
|
+
* rows: [{ key: "sand", name: "Sand", group: "Steps", values: Sheet.patch(BatchStep, { task: "Sand", qty: none }) },
|
|
246
|
+
* { key: "seal", name: "Seal", group: "Steps", values: Sheet.patch(BatchStep, { task: "Seal", qty: none }) }],
|
|
247
|
+
* }}
|
|
248
|
+
* library={[Sheet.library.rows(), Sheet.library.columns()]}
|
|
249
|
+
* ready={{ group: readyBatch }}
|
|
250
|
+
* newRow={newStep}
|
|
251
|
+
* newGroup={newBatch}
|
|
252
|
+
* />
|
|
253
|
+
* </Box>
|
|
254
|
+
* );
|
|
255
|
+
* }}</Reactive>
|
|
256
|
+
* ));
|
|
257
|
+
* ```
|
|
258
|
+
*/
|
|
259
|
+
export function createSubRow(input) {
|
|
260
|
+
const facets = Object.entries(input.facets ?? {}).map(([label, value]) => optionalText(value).match({
|
|
261
|
+
some: (_$, v) => East.value(some({ label, value: v }), OptionType(SheetFacetType)),
|
|
262
|
+
none: (_$) => East.value(none, OptionType(SheetFacetType)),
|
|
263
|
+
}));
|
|
264
|
+
return East.value({
|
|
265
|
+
code: textOrBlank(input.code),
|
|
266
|
+
name: input.name,
|
|
267
|
+
chips: input.chips ?? East.value([], ArrayType(StringType)),
|
|
268
|
+
facets: East.value(facets, ArrayType(OptionType(SheetFacetType))).filterMap((_$, f) => f),
|
|
269
|
+
id: textOrBlank(input.id),
|
|
270
|
+
}, SheetSubRowType);
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=sub-rows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sub-rows.js","sourceRoot":"","sources":["../../../src/sheet/sub-rows.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,EAIH,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,UAAU,EACV,UAAU,EAEV,IAAI,EACJ,IAAI,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA6C7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4GG;AACH,MAAM,UAAU,aAAa,CAAuB,OAAU,EAAE,OAA8B;IAC1F,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAChC,CAAC;AAwBD,iHAAiH;AACjH,SAAS,YAAY,CAAC,CAA0D;IAC5E,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAC9E,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;QACpB,IAAI,IAAI,CAAC,IAAI,CAAC,CAAmB,CAAC,KAAK,UAAU,EAAE,CAAC;YAChD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAyB,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;QAC/E,CAAC;QACD,OAAO,CAAqC,CAAC;IACjD,CAAC;IACD,OAAO,IAAI,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AAK,CAAC,IAAI;QAClB,KAAK,EAAG,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;QAC5D,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACzF,EAAE,EAAM,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;KAChC,EAAE,eAAe,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* `<Sheet>`'s templates (#1183, `Sheet Builder Spec.md` §4.2, SB9): the
|
|
7
|
+
* Rows tab's cards. A row template is over the row type (a grouped sheet's
|
|
8
|
+
* line type), a group template over the group type with its lines. Each is
|
|
9
|
+
* checked against its type, and each carries a seed built by the code that
|
|
10
|
+
* builds `newRow`'s and `newGroup`'s: the constructor's defaults first, the
|
|
11
|
+
* template's set fields over them. The cells its card shows are the
|
|
12
|
+
* template's own fields, through the columns' projection.
|
|
13
|
+
*
|
|
14
|
+
* @packageDocumentation
|
|
15
|
+
*/
|
|
16
|
+
import { ArrayType, DictType, FunctionType, OptionType, StringType, StructType, VariantType, type ExprType, type SubtypeExprOrValue } from "@elaraai/east";
|
|
17
|
+
import { type SheetPatchOf } from "./types.js";
|
|
18
|
+
import { type SheetBridge } from "./bridge.js";
|
|
19
|
+
/**
|
|
20
|
+
* One card of the library's Rows tab: a preset a planner drops into the sheet.
|
|
21
|
+
*
|
|
22
|
+
* @typeParam R - The type it sets: the row type (a grouped sheet's line type), or the group type
|
|
23
|
+
*/
|
|
24
|
+
export interface SheetTemplate<R extends StructType> {
|
|
25
|
+
/** Its key — unique among the sheet's templates, rows and groups alike. */
|
|
26
|
+
key: string;
|
|
27
|
+
/** The card's name. */
|
|
28
|
+
name: string;
|
|
29
|
+
/** The Rows tab's group the card sits under. */
|
|
30
|
+
group?: string;
|
|
31
|
+
/** The fields it sets — `Sheet.patch(R, { … })`. A field it leaves unset takes `newRow`'s (or `newGroup`'s) default, or starts missing. */
|
|
32
|
+
values: SubtypeExprOrValue<SheetPatchOf<R>>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The sheet's templates.
|
|
36
|
+
*
|
|
37
|
+
* @typeParam L - The row type (a grouped sheet's line type)
|
|
38
|
+
* @typeParam G - The group type, on a grouped sheet
|
|
39
|
+
*/
|
|
40
|
+
export interface SheetTemplatesInput<L extends StructType, G extends StructType = never> {
|
|
41
|
+
/** Row templates — on a grouped sheet, lines dropped into a group. */
|
|
42
|
+
rows?: SheetTemplate<L>[];
|
|
43
|
+
/** Group templates, each with its lines — a grouped sheet's only. */
|
|
44
|
+
groups?: [G] extends [never] ? never : SheetTemplate<G>[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* One template on the wire: its card, and its seed — the draft and the row it
|
|
48
|
+
* drops, as `newRow`'s and `newGroup`'s constructors make them.
|
|
49
|
+
*
|
|
50
|
+
* @property key - The template's key
|
|
51
|
+
* @property name - The card's name
|
|
52
|
+
* @property group - The Rows tab's group the card sits under
|
|
53
|
+
* @property cells - What the card shows: the template's own fields, through the columns' projection
|
|
54
|
+
* @property seed - A row template's seed, over the new row's context; or a group template's, over the new group's
|
|
55
|
+
*/
|
|
56
|
+
export declare const SheetTemplateWireType: StructType<{
|
|
57
|
+
readonly key: StringType;
|
|
58
|
+
readonly name: StringType;
|
|
59
|
+
readonly group: OptionType<StringType>;
|
|
60
|
+
readonly cells: DictType<StringType, VariantType<{
|
|
61
|
+
readonly Invalid: StringType;
|
|
62
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
63
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
64
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
65
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
66
|
+
readonly String: StringType;
|
|
67
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
68
|
+
readonly Link: StructType<{
|
|
69
|
+
readonly from: ArrayType<VariantType<{
|
|
70
|
+
readonly identified: StructType<{
|
|
71
|
+
readonly key: StringType;
|
|
72
|
+
}>;
|
|
73
|
+
readonly range: StructType<{
|
|
74
|
+
readonly from: StringType;
|
|
75
|
+
readonly to: StringType;
|
|
76
|
+
}>;
|
|
77
|
+
readonly counted: StructType<{
|
|
78
|
+
readonly n: import("@elaraai/east").IntegerType;
|
|
79
|
+
readonly key: StringType;
|
|
80
|
+
}>;
|
|
81
|
+
readonly placeholder: import("@elaraai/east").NullType;
|
|
82
|
+
readonly text: StringType;
|
|
83
|
+
}>>;
|
|
84
|
+
readonly to: ArrayType<VariantType<{
|
|
85
|
+
readonly identified: StructType<{
|
|
86
|
+
readonly key: StringType;
|
|
87
|
+
}>;
|
|
88
|
+
readonly range: StructType<{
|
|
89
|
+
readonly from: StringType;
|
|
90
|
+
readonly to: StringType;
|
|
91
|
+
}>;
|
|
92
|
+
readonly counted: StructType<{
|
|
93
|
+
readonly n: import("@elaraai/east").IntegerType;
|
|
94
|
+
readonly key: StringType;
|
|
95
|
+
}>;
|
|
96
|
+
readonly placeholder: import("@elaraai/east").NullType;
|
|
97
|
+
readonly text: StringType;
|
|
98
|
+
}>>;
|
|
99
|
+
}>;
|
|
100
|
+
}>>;
|
|
101
|
+
readonly seed: VariantType<{
|
|
102
|
+
readonly row: FunctionType<[StructType<{
|
|
103
|
+
readonly destination: VariantType<{
|
|
104
|
+
readonly entry: VariantType<{
|
|
105
|
+
readonly ordered: VariantType<{
|
|
106
|
+
readonly start: import("@elaraai/east").NullType;
|
|
107
|
+
readonly end: import("@elaraai/east").NullType;
|
|
108
|
+
readonly before: StringType;
|
|
109
|
+
readonly after: StringType;
|
|
110
|
+
}>;
|
|
111
|
+
readonly keyOrder: import("@elaraai/east").NullType;
|
|
112
|
+
}>;
|
|
113
|
+
readonly child: StructType<{
|
|
114
|
+
readonly group: StringType;
|
|
115
|
+
readonly index: import("@elaraai/east").IntegerType;
|
|
116
|
+
}>;
|
|
117
|
+
}>;
|
|
118
|
+
}>], StructType<{
|
|
119
|
+
readonly draft: import("@elaraai/east").BlobType;
|
|
120
|
+
readonly row: import("@elaraai/east").BlobType;
|
|
121
|
+
}>>;
|
|
122
|
+
readonly group: FunctionType<[StructType<{
|
|
123
|
+
readonly place: VariantType<{
|
|
124
|
+
readonly ordered: VariantType<{
|
|
125
|
+
readonly start: import("@elaraai/east").NullType;
|
|
126
|
+
readonly end: import("@elaraai/east").NullType;
|
|
127
|
+
readonly before: StringType;
|
|
128
|
+
readonly after: StringType;
|
|
129
|
+
}>;
|
|
130
|
+
readonly keyOrder: import("@elaraai/east").NullType;
|
|
131
|
+
}>;
|
|
132
|
+
}>], StructType<{
|
|
133
|
+
readonly draft: import("@elaraai/east").BlobType;
|
|
134
|
+
readonly row: import("@elaraai/east").BlobType;
|
|
135
|
+
}>>;
|
|
136
|
+
}>;
|
|
137
|
+
}>;
|
|
138
|
+
/** Type representing {@link SheetTemplateWireType}. */
|
|
139
|
+
export type SheetTemplateWireType = typeof SheetTemplateWireType;
|
|
140
|
+
/** The constructors a sheet declares, already checked by its root: `newRow` and `newGroup`. */
|
|
141
|
+
export interface SheetConstructors {
|
|
142
|
+
/** `newRow`: the new row's context to its defaults. */
|
|
143
|
+
newRow?: unknown;
|
|
144
|
+
/** `newGroup`: the new group's context to its defaults. */
|
|
145
|
+
newGroup?: unknown;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Builds the sheet's templates on the wire (SB9).
|
|
149
|
+
*
|
|
150
|
+
* @param input - The templates, by kind
|
|
151
|
+
* @param bridge - The sheet's bridge, as its root compiled it
|
|
152
|
+
* @param constructors - The sheet's `newRow` and `newGroup`, as its root checked them
|
|
153
|
+
* @returns The templates on the wire, rows first, each in the order declared
|
|
154
|
+
* @throws Error naming the template: a template over another type, a key that repeats, or a group template on a flat sheet
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
export declare function buildTemplates(input: {
|
|
158
|
+
rows?: SheetTemplate<StructType>[];
|
|
159
|
+
groups?: SheetTemplate<StructType>[];
|
|
160
|
+
} | undefined, bridge: SheetBridge, constructors: SheetConstructors): ExprType<ArrayType<SheetTemplateWireType>>;
|
|
161
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/sheet/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EACH,SAAS,EACT,QAAQ,EAGR,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EAMX,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAIjF,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,UAAU;IAC/C,2EAA2E;IAC3E,GAAG,EAAE,MAAM,CAAC;IACZ,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2IAA2I;IAC3I,MAAM,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/C;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,UAAU,GAAG,KAAK;IACnF,sEAAsE;IACtE,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1B,qEAAqE;IACrE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;CAC7D;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAShC,CAAC;AAEH,uDAAuD;AACvD,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAC;AAEjE,+FAA+F;AAC/F,MAAM,WAAW,iBAAiB;IAC9B,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAwCD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC1B,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,CAAA;CAAE,GAAG,SAAS,EAC/F,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,iBAAiB,GAChC,QAAQ,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAqC5C"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* `<Sheet>`'s templates (#1183, `Sheet Builder Spec.md` §4.2, SB9): the
|
|
7
|
+
* Rows tab's cards. A row template is over the row type (a grouped sheet's
|
|
8
|
+
* line type), a group template over the group type with its lines. Each is
|
|
9
|
+
* checked against its type, and each carries a seed built by the code that
|
|
10
|
+
* builds `newRow`'s and `newGroup`'s: the constructor's defaults first, the
|
|
11
|
+
* template's set fields over them. The cells its card shows are the
|
|
12
|
+
* template's own fields, through the columns' projection.
|
|
13
|
+
*
|
|
14
|
+
* @packageDocumentation
|
|
15
|
+
*/
|
|
16
|
+
import { ArrayType, DictType, East, Expr, FunctionType, OptionType, StringType, StructType, VariantType, isTypeEqual, none, some, variant, } from "@elaraai/east";
|
|
17
|
+
import { SheetCellType, SheetPatchTypeFor } from "./types.js";
|
|
18
|
+
import { SheetNewGroupType, SheetNewRowType } from "./transactions.js";
|
|
19
|
+
import { SheetSeedType } from "./editing-types.js";
|
|
20
|
+
import { buildSheetSeed } from "./seed-bridge.js";
|
|
21
|
+
import { buildPatchCells } from "./bridge.js";
|
|
22
|
+
/**
|
|
23
|
+
* One template on the wire: its card, and its seed — the draft and the row it
|
|
24
|
+
* drops, as `newRow`'s and `newGroup`'s constructors make them.
|
|
25
|
+
*
|
|
26
|
+
* @property key - The template's key
|
|
27
|
+
* @property name - The card's name
|
|
28
|
+
* @property group - The Rows tab's group the card sits under
|
|
29
|
+
* @property cells - What the card shows: the template's own fields, through the columns' projection
|
|
30
|
+
* @property seed - A row template's seed, over the new row's context; or a group template's, over the new group's
|
|
31
|
+
*/
|
|
32
|
+
export const SheetTemplateWireType = StructType({
|
|
33
|
+
key: StringType,
|
|
34
|
+
name: StringType,
|
|
35
|
+
group: OptionType(StringType),
|
|
36
|
+
cells: DictType(StringType, SheetCellType),
|
|
37
|
+
seed: VariantType({
|
|
38
|
+
row: FunctionType([SheetNewRowType], SheetSeedType),
|
|
39
|
+
group: FunctionType([SheetNewGroupType], SheetSeedType),
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* A constructor whose defaults the template's set fields override: each field
|
|
44
|
+
* the template sets, else the constructor's default, else unset.
|
|
45
|
+
*/
|
|
46
|
+
function overDefaults(contextType, rowType, values, defaults) {
|
|
47
|
+
const patchType = SheetPatchTypeFor(rowType);
|
|
48
|
+
const fields = Object.keys(rowType.fields);
|
|
49
|
+
const unset = East.value(Object.fromEntries(fields.map((f) => [f, none])), patchType);
|
|
50
|
+
const construct = defaults === undefined ? undefined
|
|
51
|
+
: East.value(defaults);
|
|
52
|
+
return East.function([contextType], patchType, ($, context) => {
|
|
53
|
+
const set = $.const(values, patchType);
|
|
54
|
+
let base;
|
|
55
|
+
if (construct === undefined)
|
|
56
|
+
base = $.const(unset, patchType);
|
|
57
|
+
else {
|
|
58
|
+
const make = $.const(construct);
|
|
59
|
+
base = $.const(make(context), patchType);
|
|
60
|
+
}
|
|
61
|
+
return Object.fromEntries(fields.map((f) => [f, set[f].hasTag("some").ifElse(() => set[f], () => base[f])]));
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/** A template's values, checked against the type it must set. */
|
|
65
|
+
function valuesOf(template, rowType, what) {
|
|
66
|
+
const values = East.value(template.values);
|
|
67
|
+
if (!isTypeEqual(Expr.type(values), SheetPatchTypeFor(rowType))) {
|
|
68
|
+
throw new Error(what === "row"
|
|
69
|
+
? `Sheet: row template "${template.key}" was built over another type — build its values with Sheet.patch(RowType, …) over the sheet's row type (a grouped sheet: its line type)`
|
|
70
|
+
: `Sheet: group template "${template.key}" was built over another type — build its values with Sheet.patch(GroupType, …) over the sheet's group type`);
|
|
71
|
+
}
|
|
72
|
+
return values;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Builds the sheet's templates on the wire (SB9).
|
|
76
|
+
*
|
|
77
|
+
* @param input - The templates, by kind
|
|
78
|
+
* @param bridge - The sheet's bridge, as its root compiled it
|
|
79
|
+
* @param constructors - The sheet's `newRow` and `newGroup`, as its root checked them
|
|
80
|
+
* @returns The templates on the wire, rows first, each in the order declared
|
|
81
|
+
* @throws Error naming the template: a template over another type, a key that repeats, or a group template on a flat sheet
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
export function buildTemplates(input, bridge, constructors) {
|
|
85
|
+
const rows = input?.rows ?? [];
|
|
86
|
+
const groups = input?.groups ?? [];
|
|
87
|
+
const seen = new Set();
|
|
88
|
+
for (const t of [...rows, ...groups]) {
|
|
89
|
+
if (seen.has(t.key))
|
|
90
|
+
throw new Error(`Sheet: template key "${t.key}" repeats — each template's key is unique among the sheet's templates, rows and groups alike`);
|
|
91
|
+
seen.add(t.key);
|
|
92
|
+
}
|
|
93
|
+
const groupHalf = bridge.group;
|
|
94
|
+
if (groups.length > 0 && groupHalf === undefined) {
|
|
95
|
+
throw new Error("Sheet: `templates.groups` needs a grouped sheet — declare `group={Sheet.group(GroupType, \"lines\", …)}`, or drop the group templates");
|
|
96
|
+
}
|
|
97
|
+
const wires = [];
|
|
98
|
+
for (const t of rows) {
|
|
99
|
+
const values = valuesOf(t, bridge.lineType, "row");
|
|
100
|
+
const seed = buildSheetSeed(SheetNewRowType, bridge.lineType, overDefaults(SheetNewRowType, bridge.lineType, values, constructors.newRow), bridge.seedCells);
|
|
101
|
+
wires.push(East.value({
|
|
102
|
+
key: t.key, name: t.name, group: t.group === undefined ? none : some(t.group),
|
|
103
|
+
cells: bridge.seedCells(values),
|
|
104
|
+
seed: variant("row", seed),
|
|
105
|
+
}, SheetTemplateWireType));
|
|
106
|
+
}
|
|
107
|
+
if (groupHalf !== undefined) {
|
|
108
|
+
const groupType = groupHalf.groupType;
|
|
109
|
+
const groupCells = buildPatchCells(groupType, groupHalf.cellMetas, {}, false);
|
|
110
|
+
for (const t of groups) {
|
|
111
|
+
const values = valuesOf(t, groupType, "group");
|
|
112
|
+
const seed = buildSheetSeed(SheetNewGroupType, groupType, overDefaults(SheetNewGroupType, groupType, values, constructors.newGroup), groupCells, { field: groupHalf.linesField, project: bridge.projectRow });
|
|
113
|
+
wires.push(East.value({
|
|
114
|
+
key: t.key, name: t.name, group: t.group === undefined ? none : some(t.group),
|
|
115
|
+
cells: groupCells(values),
|
|
116
|
+
seed: variant("group", seed),
|
|
117
|
+
}, SheetTemplateWireType));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return East.value(wires, ArrayType(SheetTemplateWireType));
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/sheet/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EACH,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,OAAO,GAIV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAqB,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAoB,MAAM,aAAa,CAAC;AA+BhE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;IAC5C,GAAG,EAAE,UAAU;IACf,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC;IAC7B,KAAK,EAAE,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IAC1C,IAAI,EAAE,WAAW,CAAC;QACd,GAAG,EAAE,YAAY,CAAC,CAAC,eAAe,CAAC,EAAE,aAAa,CAAC;QACnD,KAAK,EAAE,YAAY,CAAC,CAAC,iBAAiB,CAAC,EAAE,aAAa,CAAC;KAC1D,CAAC;CACL,CAAC,CAAC;AAaH;;;GAGG;AACH,SAAS,YAAY,CACjB,WAAuB,EACvB,OAAmB,EACnB,MAA0B,EAC1B,QAAiB;IAEjB,MAAM,S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,CAAC,iBAAiB,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,EAAE,UAAU,EAC3I,EAAE,KAAK,EAAE,SAAS,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YACjE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;gBAClB,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;gBAC7E,KAAK,EAAE,UAAU,CAAC,MAA8B,CAAC;gBACjD,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;aAC/B,EAAE,qBAAqB,CAAC,CAAC,CAAC;QAC/B,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The Sheet's names for the shared editing contract (`contracts/editing.ts`,
|
|
7
|
+
* #879) — each one the `Editing` namespace's own value (`Sheet.apply` is
|
|
8
|
+
* `Editing.apply`, `Sheet.Types.ChangeSet` is `Editing.Types.ChangeSet`) — and
|
|
9
|
+
* the transaction types only a sheet has: a new row's destination among a
|
|
10
|
+
* group's children, and the `newRow` / `newGroup` contexts.
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
import { IntegerType, StringType, StructType, VariantType } from "@elaraai/east";
|
|
15
|
+
export { EditingPositionType as SheetPositionType, EditingPlacementType as SheetEntryPlacementType, EditingFieldIssueType as SheetFieldIssueType, EditingReadinessType as SheetReadinessType, EditingIssueType as SheetIssueType, EditingBatchReadinessType as SheetBatchReadinessType, EditingOriginType as SheetOriginType, EditingApplyResultType as SheetApplyResultType, EditingDraftFieldType as SheetDraftFieldType, EditingDraftTypeFor as SheetDraftTypeFor, EditingBaseTypeFor as SheetBaseTypeFor, EditingChangeTypeFor as SheetChangeTypeFor, EditingChangeSetTypeFor as SheetChangeSetTypeFor, EditingAppliedTypeFor as SheetAppliedTypeFor, applyEditing as applySheet, type EditingDraftOf as SheetDraftOf, } from "@elaraai/east-ui/internal";
|
|
16
|
+
/**
|
|
17
|
+
* A new row's destination: a top-level entry's placement, or a position among
|
|
18
|
+
* a group's children.
|
|
19
|
+
*
|
|
20
|
+
* @property entry - A top-level entry, at its placement
|
|
21
|
+
* @property child - A child row of the group with this id, at this index
|
|
22
|
+
*/
|
|
23
|
+
export declare const SheetRowDestinationType: VariantType<{
|
|
24
|
+
readonly entry: VariantType<{
|
|
25
|
+
readonly ordered: VariantType<{
|
|
26
|
+
readonly start: import("@elaraai/east").NullType;
|
|
27
|
+
readonly end: import("@elaraai/east").NullType;
|
|
28
|
+
readonly before: StringType;
|
|
29
|
+
readonly after: StringType;
|
|
30
|
+
}>;
|
|
31
|
+
readonly keyOrder: import("@elaraai/east").NullType;
|
|
32
|
+
}>;
|
|
33
|
+
readonly child: StructType<{
|
|
34
|
+
readonly group: StringType;
|
|
35
|
+
readonly index: IntegerType;
|
|
36
|
+
}>;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* What a `newRow` constructor is told.
|
|
40
|
+
*
|
|
41
|
+
* @property destination - Where the new row goes
|
|
42
|
+
*/
|
|
43
|
+
export declare const SheetNewRowType: StructType<{
|
|
44
|
+
readonly destination: VariantType<{
|
|
45
|
+
readonly entry: VariantType<{
|
|
46
|
+
readonly ordered: VariantType<{
|
|
47
|
+
readonly start: import("@elaraai/east").NullType;
|
|
48
|
+
readonly end: import("@elaraai/east").NullType;
|
|
49
|
+
readonly before: StringType;
|
|
50
|
+
readonly after: StringType;
|
|
51
|
+
}>;
|
|
52
|
+
readonly keyOrder: import("@elaraai/east").NullType;
|
|
53
|
+
}>;
|
|
54
|
+
readonly child: StructType<{
|
|
55
|
+
readonly group: StringType;
|
|
56
|
+
readonly index: IntegerType;
|
|
57
|
+
}>;
|
|
58
|
+
}>;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* What a `newGroup` constructor is told.
|
|
62
|
+
*
|
|
63
|
+
* @property place - Where the new group goes
|
|
64
|
+
*/
|
|
65
|
+
export declare const SheetNewGroupType: StructType<{
|
|
66
|
+
readonly place: VariantType<{
|
|
67
|
+
readonly ordered: VariantType<{
|
|
68
|
+
readonly start: import("@elaraai/east").NullType;
|
|
69
|
+
readonly end: import("@elaraai/east").NullType;
|
|
70
|
+
readonly before: StringType;
|
|
71
|
+
readonly after: StringType;
|
|
72
|
+
}>;
|
|
73
|
+
readonly keyOrder: import("@elaraai/east").NullType;
|
|
74
|
+
}>;
|
|
75
|
+
}>;
|
|
76
|
+
//# sourceMappingURL=transactions.d.ts.map
|