@elaraai/e3-ui 1.0.86 → 1.0.88
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,247 @@
|
|
|
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
|
+
* `Plan.over(data, [series…])` (#1191, `Plan Builder Spec.md` PB9): series
|
|
7
|
+
* over a dataset, read only, for a Plan's `rows` — a dataset's rows beside the
|
|
8
|
+
* event kinds, laid out as `data` and `series` lay a canvas out.
|
|
9
|
+
*
|
|
10
|
+
* A Plan's edits go through its event kinds' records, so a series here that
|
|
11
|
+
* declares `edit` is refused.
|
|
12
|
+
*
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
*/
|
|
15
|
+
import { type DictType, type EastType, type ExprType, type SubtypeExprOrValue } from "@elaraai/east";
|
|
16
|
+
import { PlanBlocksType, type PlanAxisKindLiteral, type PlanKinded } from "./types.js";
|
|
17
|
+
import { type PlanSeriesFacts, type PlanSeriesValue } from "./series.js";
|
|
18
|
+
import type { PlanBindHandle } from "./root.js";
|
|
19
|
+
/**
|
|
20
|
+
* One series a `Plan.over` was given: what it is, and the keys its rows carry.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export interface PlanOverSeries {
|
|
25
|
+
/** Its facts: kind, key and title. */
|
|
26
|
+
readonly facts: PlanSeriesFacts;
|
|
27
|
+
/** The keys of its rows: its own, and every series' nested in it. */
|
|
28
|
+
readonly keys: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The series a `Plan.over` was given, in order — what a Plan's library lists
|
|
32
|
+
* in its Series tab, an eye apiece, and what hiding each hides (#1195).
|
|
33
|
+
*
|
|
34
|
+
* @param rows - One of a Plan's `rows`
|
|
35
|
+
* @returns The series; `undefined` for anything `Plan.over` did not return
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export declare function overSeries(rows: unknown): readonly PlanOverSeries[] | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The keys of the series a `Plan.over` laid out — what a Plan holds the keys
|
|
41
|
+
* it gives its own rows apart from (#1192).
|
|
42
|
+
*
|
|
43
|
+
* @param rows - One of a Plan's `rows`
|
|
44
|
+
* @returns Its series' keys, the series nested in them included; `undefined` for anything `Plan.over` did not return
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
export declare function overSeriesKeys(rows: unknown): readonly string[] | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The blocks `Plan.over` makes: series over a dataset, read only, for a Plan's
|
|
50
|
+
* `rows` — branded with the axis kind its series ride.
|
|
51
|
+
*
|
|
52
|
+
* @typeParam K - The axis kind the series ride
|
|
53
|
+
*/
|
|
54
|
+
export type PlanOverRows<K extends PlanAxisKindLiteral = never> = PlanKinded<ExprType<PlanBlocksType>, K>;
|
|
55
|
+
/**
|
|
56
|
+
* Lays series out over a dataset, read only, for a Plan's `rows`.
|
|
57
|
+
*
|
|
58
|
+
* @typeParam K - The axis kind the series ride
|
|
59
|
+
* @param data - The dataset: a keyed collection (`Data.bind(d).read()`), or a bind handle over one
|
|
60
|
+
* @param series - The `Plan.series.*` values over its entries, written in place — the list is the layout
|
|
61
|
+
* @returns The blocks, for a Plan's `rows`
|
|
62
|
+
* @throws {Error} When `data` is not a keyed collection; no series is given; a series is not a `Plan.series.*` value
|
|
63
|
+
* written in place, is built over entries of another type, or declares `edit`; or two series share a key
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
|
|
68
|
+
* import { ArrayType, DateTimeType, DictType, East, FloatType, NullType, OptionType, StringType, StructType, VariantType, some, variant } from "@elaraai/east";
|
|
69
|
+
* import { EventStateType, Format, Reactive, UIComponentType } from "@elaraai/east-ui";
|
|
70
|
+
* import { Data, Plan, Record, Schedule } from "@elaraai/e3-ui";
|
|
71
|
+
* import e3 from "@elaraai/e3";
|
|
72
|
+
*
|
|
73
|
+
* export const PrintPress = StructType({ name: StringType, hall: StringType, sheets_per_hour: FloatType });
|
|
74
|
+
* export const PrintJob = StructType({
|
|
75
|
+
* title: StringType,
|
|
76
|
+
* start: OptionType(DateTimeType),
|
|
77
|
+
* end: OptionType(DateTimeType),
|
|
78
|
+
* press: OptionType(StringType),
|
|
79
|
+
* state: EventStateType,
|
|
80
|
+
* sheets: FloatType,
|
|
81
|
+
* customer: StringType,
|
|
82
|
+
* stock: VariantType({ coated: NullType, uncoated: NullType, board: NullType }),
|
|
83
|
+
* due: OptionType(DateTimeType),
|
|
84
|
+
* });
|
|
85
|
+
* export const PrintStock = StructType({ name: StringType, weekly: ArrayType(FloatType) });
|
|
86
|
+
* export const PrintCentre = StructType({ name: StringType });
|
|
87
|
+
* export const PrintPlates = StructType({ title: StringType, at: DateTimeType, setter: StringType });
|
|
88
|
+
* export const PrintBinding = StructType({ title: StringType, start: DateTimeType, end: DateTimeType, line: StringType, state: EventStateType });
|
|
89
|
+
* export const PrintDelivery = StructType({ title: StringType, at: DateTimeType, bay: StringType });
|
|
90
|
+
* export const planPrintPresses = e3.record("plan_print_presses", DictType(StringType, PrintPress), new Map([
|
|
91
|
+
* ["a1", { name: "Press A1", hall: "Hall A", sheets_per_hour: 12000.0 }],
|
|
92
|
+
* ["a2", { name: "Press A2", hall: "Hall A", sheets_per_hour: 10000.0 }],
|
|
93
|
+
* ["a3", { name: "Press A3", hall: "Hall A", sheets_per_hour: 8000.0 }],
|
|
94
|
+
* ["b1", { name: "Press B1", hall: "Hall B", sheets_per_hour: 15000.0 }],
|
|
95
|
+
* ["b2", { name: "Press B2", hall: "Hall B", sheets_per_hour: 12000.0 }],
|
|
96
|
+
* ["b3", { name: "Press B3", hall: "Hall B", sheets_per_hour: 6000.0 }],
|
|
97
|
+
* ]));
|
|
98
|
+
* export const planLinkStock = e3.input("plan_link_stock", DictType(StringType, PrintStock), variant("value", new Map([
|
|
99
|
+
* ["board", { name: "Board", weekly: [40.0, 22.0, 31.0, 18.0] }],
|
|
100
|
+
* ["coated", { name: "Coated", weekly: [520.0, 410.0, 460.0, 380.0] }],
|
|
101
|
+
* ["uncoated", { name: "Uncoated", weekly: [300.0, 260.0, 280.0, 240.0] }],
|
|
102
|
+
* ])));
|
|
103
|
+
* export const planLinkSetters = e3.record("plan_link_setters", DictType(StringType, PrintCentre), new Map([
|
|
104
|
+
* ["ps", { name: "Platesetter" }],
|
|
105
|
+
* ]));
|
|
106
|
+
* export const planLinkLines = e3.record("plan_link_lines", DictType(StringType, PrintCentre), new Map([
|
|
107
|
+
* ["fold", { name: "Folder" }],
|
|
108
|
+
* ["bind", { name: "Binder" }],
|
|
109
|
+
* ]));
|
|
110
|
+
* export const planLinkBays = e3.record("plan_link_bays", DictType(StringType, PrintCentre), new Map([
|
|
111
|
+
* ["bay", { name: "Dispatch bay" }],
|
|
112
|
+
* ]));
|
|
113
|
+
* export const planLinkPlates = e3.record("plan_link_plates", DictType(StringType, PrintPlates), new Map([
|
|
114
|
+
* ["P-01", { title: "Catalogue plates", at: new Date("2026-10-05T12:00:00Z"), setter: "ps" }],
|
|
115
|
+
* ]));
|
|
116
|
+
* export const planLinkPlatesPatch = e3.mutation.patch(planLinkPlates);
|
|
117
|
+
* export const planLinkCaseJobs = e3.record("plan_link_case_jobs", DictType(StringType, PrintJob), new Map([
|
|
118
|
+
* ["J-2001", { title: "Catalogue covers", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 12000.0, customer: "Larkspur Home", stock: variant("board", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
119
|
+
* ["J-2002", { title: "Shop posters", start: some(new Date("2026-10-10T06:00:00Z")), end: some(new Date("2026-10-11T06:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 24000.0, customer: "Orchard Street Market", stock: variant("uncoated", null), due: some(new Date("2026-10-20T00:00:00Z")) }],
|
|
120
|
+
* ["J-2003", { title: "Catalogue inserts", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-17T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
|
|
121
|
+
* ["J-2004", { title: "Price lists", start: some(new Date("2026-10-07T12:00:00Z")), end: some(new Date("2026-10-08T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 16000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
122
|
+
* ["J-2005", { title: "Menu cards", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-11T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-13T00:00:00Z")) }],
|
|
123
|
+
* ["J-2006", { title: "Gift tags", start: some(new Date("2026-10-25T06:00:00Z")), end: some(new Date("2026-10-25T18:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 20000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-28T00:00:00Z")) }],
|
|
124
|
+
* ["J-2007", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T14:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
125
|
+
* ["J-2008", { title: "Proof run", start: some(new Date("2026-10-02T06:00:00Z")), end: some(new Date("2026-10-05T18:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
|
|
126
|
+
* ["J-2009", { title: "Annual report", start: some(new Date("2026-10-19T18:00:00Z")), end: some(new Date("2026-10-21T06:00:00Z")), press: some("a3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
127
|
+
* ["J-2010", { title: "Desk calendars", start: some(new Date("2026-10-28T06:00:00Z")), end: some(new Date("2026-10-29T06:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
128
|
+
* ["J-2011", { title: "Calendar pads", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T18:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
129
|
+
* ["J-2012", { title: "Proof sheets", start: some(new Date("2026-09-28T06:00:00Z")), end: some(new Date("2026-09-30T18:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 8000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-01T00:00:00Z")) }],
|
|
130
|
+
* ["J-2013", { title: "Catalogue", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-13T18:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
131
|
+
* ["J-2014", { title: "Seed catalogue", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-23T12:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 100000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
|
|
132
|
+
* ["J-2015", { title: "Night run", start: some(new Date("2026-10-05T00:00:00Z")), end: some(new Date("2026-10-05T08:00:00Z")), press: some("b2"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
|
|
133
|
+
* ["J-2016", { title: "Store flyers", start: some(new Date("2026-10-16T06:00:00Z")), end: some(new Date("2026-10-16T20:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("uncoated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
|
|
134
|
+
* ["J-2017", { title: "Seed packets", start: some(new Date("2026-10-23T06:00:00Z")), end: some(new Date("2026-10-24T06:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-10-27T00:00:00Z")) }],
|
|
135
|
+
* ["J-2018", { title: "Exhibition book", start: some(new Date("2026-10-26T06:00:00Z")), end: some(new Date("2026-10-27T18:00:00Z")), press: some("b2"), state: variant("proposed", variant("recommended", null)), sheets: 54000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
136
|
+
* ["J-2019", { title: "Ticket books", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T06:00:00Z")), press: some("b2"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
137
|
+
* ["J-2020", { title: "Card stock", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("b3"), state: variant("actual", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
|
|
138
|
+
* ["J-2021", { title: "Book sections", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-12T12:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 84000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-14T00:00:00Z")) }],
|
|
139
|
+
* ["J-2022", { title: "Report covers", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-20T18:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("board", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
|
|
140
|
+
* ["J-2023", { title: "Spring brochure", start: some(new Date("2026-11-03T06:00:00Z")), end: some(new Date("2026-11-04T18:00:00Z")), press: some("b3"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("coated", null), due: some(new Date("2026-11-09T00:00:00Z")) }],
|
|
141
|
+
* ]));
|
|
142
|
+
* export const planLinkCaseJobsPatch = e3.mutation.patch(planLinkCaseJobs);
|
|
143
|
+
* export const planLinkBindings = e3.record("plan_link_bindings", DictType(StringType, PrintBinding), new Map([
|
|
144
|
+
* ["B-01", { title: "Fold sections", start: new Date("2026-10-15T06:00:00Z"), end: new Date("2026-10-16T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
145
|
+
* ["B-02", { title: "Fold sections", start: new Date("2026-10-17T06:00:00Z"), end: new Date("2026-10-18T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
146
|
+
* ["B-03", { title: "Bind books", start: new Date("2026-10-20T18:00:00Z"), end: new Date("2026-10-21T18:00:00Z"), line: "bind", state: variant("confirmed", null) }],
|
|
147
|
+
* ["B-04", { title: "Bind exhibition book", start: new Date("2026-10-25T06:00:00Z"), end: new Date("2026-10-26T06:00:00Z"), line: "bind", state: variant("proposed", variant("recommended", null)) }],
|
|
148
|
+
* ]));
|
|
149
|
+
* export const planLinkBindingsPatch = e3.mutation.patch(planLinkBindings);
|
|
150
|
+
* export const planLinkDeliveries = e3.record("plan_link_deliveries", DictType(StringType, PrintDelivery), new Map([
|
|
151
|
+
* ["D-01", { title: "Books", at: new Date("2026-10-28T10:00:00Z"), bay: "bay" }],
|
|
152
|
+
* ["D-02", { title: "Posters", at: new Date("2026-10-20T10:00:00Z"), bay: "bay" }],
|
|
153
|
+
* ]));
|
|
154
|
+
* export const planLinkDeliveriesPatch = e3.mutation.patch(planLinkDeliveries);
|
|
155
|
+
*
|
|
156
|
+
* const planEventLinks = East.function([], UIComponentType, (_$) => (
|
|
157
|
+
* <Reactive>{$ => {
|
|
158
|
+
* const setters = $.let(Record.bind(planLinkSetters, []));
|
|
159
|
+
* const presses = $.let(Record.bind(planPrintPresses, []));
|
|
160
|
+
* const lines = $.let(Record.bind(planLinkLines, []));
|
|
161
|
+
* const bays = $.let(Record.bind(planLinkBays, []));
|
|
162
|
+
* const plates = $.let(Record.bind(planLinkPlates, [planLinkPlatesPatch]));
|
|
163
|
+
* const jobs = $.let(Record.bind(planLinkCaseJobs, [planLinkCaseJobsPatch]));
|
|
164
|
+
* const bindings = $.let(Record.bind(planLinkBindings, [planLinkBindingsPatch]));
|
|
165
|
+
* const deliveries = $.let(Record.bind(planLinkDeliveries, [planLinkDeliveriesPatch]));
|
|
166
|
+
* const stock = $.let(Data.bind(planLinkStock));
|
|
167
|
+
* // The window's first Monday: each stock reading runs from it, a week apiece.
|
|
168
|
+
* const first = $.const(new Date("2026-10-05T00:00:00Z"), DateTimeType);
|
|
169
|
+
* const StockWeek = StructType({ at: DateTimeType, value: OptionType(FloatType) });
|
|
170
|
+
* const weekly = $.const(East.function([ArrayType(FloatType)], ArrayType(StockWeek), (_$2, readings) =>
|
|
171
|
+
* East.Array.generate(readings.size(), StockWeek, (_$3, i) => ({ at: first.addWeeks(i), value: some(readings.get(i)) }))));
|
|
172
|
+
* const axis = $.let(Plan.axis({
|
|
173
|
+
* window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
|
|
174
|
+
* resolution: "week", now: new Date("2026-10-14T09:00:00Z"),
|
|
175
|
+
* }));
|
|
176
|
+
* return (
|
|
177
|
+
* <Plan
|
|
178
|
+
* axis={axis}
|
|
179
|
+
* resources={{
|
|
180
|
+
* setters: Schedule.resources(setters.read(), { name: "Plate room", icon: "layer-group", label: s => s.name }),
|
|
181
|
+
* presses: Schedule.resources(presses.read(), { name: "Presses", icon: "print", label: p => p.name, group: p => p.hall }),
|
|
182
|
+
* lines: Schedule.resources(lines.read(), { name: "Bindery", icon: "book", label: l => l.name }),
|
|
183
|
+
* bays: Schedule.resources(bays.read(), { name: "Dispatch", icon: "warehouse", label: b => b.name }),
|
|
184
|
+
* }}
|
|
185
|
+
* events={{
|
|
186
|
+
* plate: Schedule.events(plates, {
|
|
187
|
+
* name: "Plates", icon: "clone",
|
|
188
|
+
* title: "title", at: "at",
|
|
189
|
+
* resource: { field: "setter", of: "setters" },
|
|
190
|
+
* }),
|
|
191
|
+
* job: Schedule.events(jobs, {
|
|
192
|
+
* name: "Print job", icon: "file-lines",
|
|
193
|
+
* title: "title", start: "start", end: "end",
|
|
194
|
+
* resource: { field: "press", of: "presses" },
|
|
195
|
+
* state: "state", quantity: { field: "sheets", unit: "sheets" },
|
|
196
|
+
* }),
|
|
197
|
+
* binding: Schedule.events(bindings, {
|
|
198
|
+
* name: "Bindery job", icon: "book-open", draw: "cards",
|
|
199
|
+
* title: "title", start: "start", end: "end",
|
|
200
|
+
* resource: { field: "line", of: "lines" }, state: "state",
|
|
201
|
+
* }),
|
|
202
|
+
* delivery: Schedule.events(deliveries, {
|
|
203
|
+
* name: "Delivery", icon: "truck", draw: "buckets",
|
|
204
|
+
* title: "title", at: "at",
|
|
205
|
+
* resource: { field: "bay", of: "bays" },
|
|
206
|
+
* }),
|
|
207
|
+
* }}
|
|
208
|
+
* // The paper in stock: a table over a dataset, read only.
|
|
209
|
+
* rows={[
|
|
210
|
+
* Plan.over(stock, [
|
|
211
|
+
* Plan.series.table(PrintStock, {
|
|
212
|
+
* key: "stock", title: "Paper stock", label: s => s.name,
|
|
213
|
+
* cells: s => Plan.tableCells(weekly(s.weekly)),
|
|
214
|
+
* format: Format.Number({ maximumFractionDigits: 0n }),
|
|
215
|
+
* }),
|
|
216
|
+
* ]),
|
|
217
|
+
* ]}
|
|
218
|
+
* // Each quantity in thousands of sheets, its third of the family's largest setting the link's
|
|
219
|
+
* // weight; the plates' link carries none.
|
|
220
|
+
* links={[
|
|
221
|
+
* Plan.link({ key: "plates", from: Plan.eventRef("plate", "P-01"), to: Plan.eventRef("job", "J-2001") }),
|
|
222
|
+
* Plan.link({ key: "covers", from: Plan.eventRef("job", "J-2001"), to: Plan.eventRef("job", "J-2013"), quantity: Plan.quantity(12, { unit: "k sheets" }) }),
|
|
223
|
+
* Plan.link({ key: "card", from: Plan.eventRef("job", "J-2020"), to: Plan.eventRef("job", "J-2005"), quantity: Plan.quantity(30, { unit: "k sheets" }) }),
|
|
224
|
+
* Plan.link({ key: "inserts", from: Plan.eventRef("job", "J-2003"), to: Plan.eventRef("job", "J-2016"), quantity: Plan.quantity(96, { unit: "k sheets" }) }),
|
|
225
|
+
* Plan.link({ key: "report-covers", from: Plan.eventRef("job", "J-2022"), to: Plan.eventRef("job", "J-2009"), quantity: Plan.quantity(48, { unit: "k sheets" }) }),
|
|
226
|
+
* Plan.link({ key: "seed-prints", from: Plan.eventRef("job", "J-2014"), to: Plan.eventRef("job", "J-2017"), quantity: Plan.quantity(72, { unit: "k sheets" }) }),
|
|
227
|
+
* Plan.link({ key: "tags", from: Plan.eventRef("job", "J-2006"), to: Plan.eventRef("job", "J-2007"), quantity: Plan.quantity(20, { unit: "k sheets" }) }),
|
|
228
|
+
* Plan.link({ key: "pads", from: Plan.eventRef("job", "J-2010"), to: Plan.eventRef("job", "J-2011"), quantity: Plan.quantity(36, { unit: "k sheets" }) }),
|
|
229
|
+
* Plan.link({ key: "proofs", from: Plan.eventRef("job", "J-2008"), to: Plan.eventRef("job", "J-2015"), quantity: Plan.quantity(16, { unit: "k sheets" }) }),
|
|
230
|
+
* Plan.link({ key: "proof-sheets", from: Plan.eventRef("job", "J-2012"), to: Plan.eventRef("job", "J-2004"), quantity: Plan.quantity(8, { unit: "k sheets" }) }),
|
|
231
|
+
* Plan.link({ key: "tickets", from: Plan.eventRef("job", "J-2019"), to: Plan.eventRef("job", "J-2023"), quantity: Plan.quantity(60, { unit: "k sheets" }) }),
|
|
232
|
+
* Plan.link({ key: "sections", from: Plan.eventRef("job", "J-2021"), to: Plan.eventRef("binding", "B-01"), quantity: Plan.quantity(40, { unit: "k sheets" }) }),
|
|
233
|
+
* Plan.link({ key: "sections-more", from: Plan.eventRef("job", "J-2021"), to: Plan.eventRef("binding", "B-02"), quantity: Plan.quantity(44, { unit: "k sheets" }) }),
|
|
234
|
+
* Plan.link({ key: "folded", from: Plan.eventRef("binding", "B-02"), to: Plan.eventRef("binding", "B-03"), quantity: Plan.quantity(40, { unit: "k sheets" }) }),
|
|
235
|
+
* Plan.link({ key: "books", from: Plan.eventRef("binding", "B-03"), to: Plan.eventRef("delivery", "D-01"), quantity: Plan.quantity(36, { unit: "k sheets" }) }),
|
|
236
|
+
* Plan.link({ key: "posters", from: Plan.eventRef("job", "J-2002"), to: Plan.eventRef("delivery", "D-02"), quantity: Plan.quantity(24, { unit: "k sheets" }) }),
|
|
237
|
+
* Plan.link({ key: "book-blocks", from: Plan.eventRef("job", "J-2018"), to: Plan.eventRef("binding", "B-04"), quantity: Plan.quantity(54, { unit: "k sheets" }) }),
|
|
238
|
+
* ]}
|
|
239
|
+
* style={{ height: "400px" }}
|
|
240
|
+
* />
|
|
241
|
+
* );
|
|
242
|
+
* }}</Reactive>
|
|
243
|
+
* ));
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
export declare function createOver<K extends PlanAxisKindLiteral = never>(data: SubtypeExprOrValue<DictType<EastType, EastType>> | PlanBindHandle, series: PlanSeriesValue<K>[]): PlanOverRows<K>;
|
|
247
|
+
//# sourceMappingURL=over.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"over.d.ts","sourceRoot":"","sources":["../../../src/plan/over.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,OAAO,EAAyB,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,EAA6D,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AACpI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC3B,sCAAsC;IACtC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAKD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,cAAc,EAAE,GAAG,SAAS,CAE/E;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAE3E;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,mBAAmB,GAAG,KAAK,IAAI,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8LG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,mBAAmB,GAAG,KAAK,EAC5D,IAAI,EAAE,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,GAAG,cAAc,EACvE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,GAC7B,YAAY,CAAC,CAAC,CAAC,CA6BjB"}
|
|
@@ -0,0 +1,266 @@
|
|
|
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
|
+
* `Plan.over(data, [series…])` (#1191, `Plan Builder Spec.md` PB9): series
|
|
7
|
+
* over a dataset, read only, for a Plan's `rows` — a dataset's rows beside the
|
|
8
|
+
* event kinds, laid out as `data` and `series` lay a canvas out.
|
|
9
|
+
*
|
|
10
|
+
* A Plan's edits go through its event kinds' records, so a series here that
|
|
11
|
+
* declares `edit` is refused.
|
|
12
|
+
*
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
*/
|
|
15
|
+
import { East, Expr, printType } from "@elaraai/east";
|
|
16
|
+
import { PlanBlocksType } from "./types.js";
|
|
17
|
+
import { applySeries, checkSeries, planSeriesFacts, planSeriesKeys } from "./series.js";
|
|
18
|
+
/** The keys of the series each `Plan.over` laid out, by the blocks it returned. */
|
|
19
|
+
const OVER_KEYS = new WeakMap();
|
|
20
|
+
/** The series each `Plan.over` was given, in order, by the blocks it returned. */
|
|
21
|
+
const OVER_SERIES = new WeakMap();
|
|
22
|
+
/**
|
|
23
|
+
* The series a `Plan.over` was given, in order — what a Plan's library lists
|
|
24
|
+
* in its Series tab, an eye apiece, and what hiding each hides (#1195).
|
|
25
|
+
*
|
|
26
|
+
* @param rows - One of a Plan's `rows`
|
|
27
|
+
* @returns The series; `undefined` for anything `Plan.over` did not return
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export function overSeries(rows) {
|
|
31
|
+
return typeof rows === "object" && rows !== null ? OVER_SERIES.get(rows) : undefined;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The keys of the series a `Plan.over` laid out — what a Plan holds the keys
|
|
35
|
+
* it gives its own rows apart from (#1192).
|
|
36
|
+
*
|
|
37
|
+
* @param rows - One of a Plan's `rows`
|
|
38
|
+
* @returns Its series' keys, the series nested in them included; `undefined` for anything `Plan.over` did not return
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export function overSeriesKeys(rows) {
|
|
42
|
+
return typeof rows === "object" && rows !== null ? OVER_KEYS.get(rows) : undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Lays series out over a dataset, read only, for a Plan's `rows`.
|
|
46
|
+
*
|
|
47
|
+
* @typeParam K - The axis kind the series ride
|
|
48
|
+
* @param data - The dataset: a keyed collection (`Data.bind(d).read()`), or a bind handle over one
|
|
49
|
+
* @param series - The `Plan.series.*` values over its entries, written in place — the list is the layout
|
|
50
|
+
* @returns The blocks, for a Plan's `rows`
|
|
51
|
+
* @throws {Error} When `data` is not a keyed collection; no series is given; a series is not a `Plan.series.*` value
|
|
52
|
+
* written in place, is built over entries of another type, or declares `edit`; or two series share a key
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
|
|
57
|
+
* import { ArrayType, DateTimeType, DictType, East, FloatType, NullType, OptionType, StringType, StructType, VariantType, some, variant } from "@elaraai/east";
|
|
58
|
+
* import { EventStateType, Format, Reactive, UIComponentType } from "@elaraai/east-ui";
|
|
59
|
+
* import { Data, Plan, Record, Schedule } from "@elaraai/e3-ui";
|
|
60
|
+
* import e3 from "@elaraai/e3";
|
|
61
|
+
*
|
|
62
|
+
* export const PrintPress = StructType({ name: StringType, hall: StringType, sheets_per_hour: FloatType });
|
|
63
|
+
* export const PrintJob = StructType({
|
|
64
|
+
* title: StringType,
|
|
65
|
+
* start: OptionType(DateTimeType),
|
|
66
|
+
* end: OptionType(DateTimeType),
|
|
67
|
+
* press: OptionType(StringType),
|
|
68
|
+
* state: EventStateType,
|
|
69
|
+
* sheets: FloatType,
|
|
70
|
+
* customer: StringType,
|
|
71
|
+
* stock: VariantType({ coated: NullType, uncoated: NullType, board: NullType }),
|
|
72
|
+
* due: OptionType(DateTimeType),
|
|
73
|
+
* });
|
|
74
|
+
* export const PrintStock = StructType({ name: StringType, weekly: ArrayType(FloatType) });
|
|
75
|
+
* export const PrintCentre = StructType({ name: StringType });
|
|
76
|
+
* export const PrintPlates = StructType({ title: StringType, at: DateTimeType, setter: StringType });
|
|
77
|
+
* export const PrintBinding = StructType({ title: StringType, start: DateTimeType, end: DateTimeType, line: StringType, state: EventStateType });
|
|
78
|
+
* export const PrintDelivery = StructType({ title: StringType, at: DateTimeType, bay: StringType });
|
|
79
|
+
* export const planPrintPresses = e3.record("plan_print_presses", DictType(StringType, PrintPress), new Map([
|
|
80
|
+
* ["a1", { name: "Press A1", hall: "Hall A", sheets_per_hour: 12000.0 }],
|
|
81
|
+
* ["a2", { name: "Press A2", hall: "Hall A", sheets_per_hour: 10000.0 }],
|
|
82
|
+
* ["a3", { name: "Press A3", hall: "Hall A", sheets_per_hour: 8000.0 }],
|
|
83
|
+
* ["b1", { name: "Press B1", hall: "Hall B", sheets_per_hour: 15000.0 }],
|
|
84
|
+
* ["b2", { name: "Press B2", hall: "Hall B", sheets_per_hour: 12000.0 }],
|
|
85
|
+
* ["b3", { name: "Press B3", hall: "Hall B", sheets_per_hour: 6000.0 }],
|
|
86
|
+
* ]));
|
|
87
|
+
* export const planLinkStock = e3.input("plan_link_stock", DictType(StringType, PrintStock), variant("value", new Map([
|
|
88
|
+
* ["board", { name: "Board", weekly: [40.0, 22.0, 31.0, 18.0] }],
|
|
89
|
+
* ["coated", { name: "Coated", weekly: [520.0, 410.0, 460.0, 380.0] }],
|
|
90
|
+
* ["uncoated", { name: "Uncoated", weekly: [300.0, 260.0, 280.0, 240.0] }],
|
|
91
|
+
* ])));
|
|
92
|
+
* export const planLinkSetters = e3.record("plan_link_setters", DictType(StringType, PrintCentre), new Map([
|
|
93
|
+
* ["ps", { name: "Platesetter" }],
|
|
94
|
+
* ]));
|
|
95
|
+
* export const planLinkLines = e3.record("plan_link_lines", DictType(StringType, PrintCentre), new Map([
|
|
96
|
+
* ["fold", { name: "Folder" }],
|
|
97
|
+
* ["bind", { name: "Binder" }],
|
|
98
|
+
* ]));
|
|
99
|
+
* export const planLinkBays = e3.record("plan_link_bays", DictType(StringType, PrintCentre), new Map([
|
|
100
|
+
* ["bay", { name: "Dispatch bay" }],
|
|
101
|
+
* ]));
|
|
102
|
+
* export const planLinkPlates = e3.record("plan_link_plates", DictType(StringType, PrintPlates), new Map([
|
|
103
|
+
* ["P-01", { title: "Catalogue plates", at: new Date("2026-10-05T12:00:00Z"), setter: "ps" }],
|
|
104
|
+
* ]));
|
|
105
|
+
* export const planLinkPlatesPatch = e3.mutation.patch(planLinkPlates);
|
|
106
|
+
* export const planLinkCaseJobs = e3.record("plan_link_case_jobs", DictType(StringType, PrintJob), new Map([
|
|
107
|
+
* ["J-2001", { title: "Catalogue covers", start: some(new Date("2026-10-08T06:00:00Z")), end: some(new Date("2026-10-08T08:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 12000.0, customer: "Larkspur Home", stock: variant("board", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
108
|
+
* ["J-2002", { title: "Shop posters", start: some(new Date("2026-10-10T06:00:00Z")), end: some(new Date("2026-10-11T06:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 24000.0, customer: "Orchard Street Market", stock: variant("uncoated", null), due: some(new Date("2026-10-20T00:00:00Z")) }],
|
|
109
|
+
* ["J-2003", { title: "Catalogue inserts", start: some(new Date("2026-10-15T06:00:00Z")), end: some(new Date("2026-10-17T18:00:00Z")), press: some("a1"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
|
|
110
|
+
* ["J-2004", { title: "Price lists", start: some(new Date("2026-10-07T12:00:00Z")), end: some(new Date("2026-10-08T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 16000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-09T00:00:00Z")) }],
|
|
111
|
+
* ["J-2005", { title: "Menu cards", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-11T18:00:00Z")), press: some("a2"), state: variant("confirmed", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-13T00:00:00Z")) }],
|
|
112
|
+
* ["J-2006", { title: "Gift tags", start: some(new Date("2026-10-25T06:00:00Z")), end: some(new Date("2026-10-25T18:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 20000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-28T00:00:00Z")) }],
|
|
113
|
+
* ["J-2007", { title: "Gift boxes", start: some(new Date("2026-10-27T06:00:00Z")), end: some(new Date("2026-10-27T14:00:00Z")), press: some("a2"), state: variant("proposed", variant("recommended", null)), sheets: 48000.0, customer: "Juniper Toys", stock: variant("board", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
114
|
+
* ["J-2008", { title: "Proof run", start: some(new Date("2026-10-02T06:00:00Z")), end: some(new Date("2026-10-05T18:00:00Z")), press: some("a3"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
|
|
115
|
+
* ["J-2009", { title: "Annual report", start: some(new Date("2026-10-19T18:00:00Z")), end: some(new Date("2026-10-21T06:00:00Z")), press: some("a3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("coated", null), due: some(new Date("2026-10-23T00:00:00Z")) }],
|
|
116
|
+
* ["J-2010", { title: "Desk calendars", start: some(new Date("2026-10-28T06:00:00Z")), end: some(new Date("2026-10-29T06:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 36000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
117
|
+
* ["J-2011", { title: "Calendar pads", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T18:00:00Z")), press: some("a3"), state: variant("proposed", variant("added", null)), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
118
|
+
* ["J-2012", { title: "Proof sheets", start: some(new Date("2026-09-28T06:00:00Z")), end: some(new Date("2026-09-30T18:00:00Z")), press: some("b1"), state: variant("actual", null), sheets: 8000.0, customer: "Northwind Outfitters", stock: variant("uncoated", null), due: some(new Date("2026-10-01T00:00:00Z")) }],
|
|
119
|
+
* ["J-2013", { title: "Catalogue", start: some(new Date("2026-10-12T06:00:00Z")), end: some(new Date("2026-10-13T18:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 144000.0, customer: "Larkspur Home", stock: variant("coated", null), due: some(new Date("2026-10-16T00:00:00Z")) }],
|
|
120
|
+
* ["J-2014", { title: "Seed catalogue", start: some(new Date("2026-10-22T06:00:00Z")), end: some(new Date("2026-10-23T12:00:00Z")), press: some("b1"), state: variant("confirmed", null), sheets: 100000.0, customer: "Foxglove Gardens", stock: variant("coated", null), due: some(new Date("2026-10-26T00:00:00Z")) }],
|
|
121
|
+
* ["J-2015", { title: "Night run", start: some(new Date("2026-10-05T00:00:00Z")), end: some(new Date("2026-10-05T08:00:00Z")), press: some("b2"), state: variant("actual", null), sheets: 16000.0, customer: "Meridian Monthly", stock: variant("coated", null), due: some(new Date("2026-10-06T00:00:00Z")) }],
|
|
122
|
+
* ["J-2016", { title: "Store flyers", start: some(new Date("2026-10-16T06:00:00Z")), end: some(new Date("2026-10-16T20:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 96000.0, customer: "Larkspur Home", stock: variant("uncoated", null), due: some(new Date("2026-10-19T00:00:00Z")) }],
|
|
123
|
+
* ["J-2017", { title: "Seed packets", start: some(new Date("2026-10-23T06:00:00Z")), end: some(new Date("2026-10-24T06:00:00Z")), press: some("b2"), state: variant("confirmed", null), sheets: 72000.0, customer: "Foxglove Gardens", stock: variant("board", null), due: some(new Date("2026-10-27T00:00:00Z")) }],
|
|
124
|
+
* ["J-2018", { title: "Exhibition book", start: some(new Date("2026-10-26T06:00:00Z")), end: some(new Date("2026-10-27T18:00:00Z")), press: some("b2"), state: variant("proposed", variant("recommended", null)), sheets: 54000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-30T00:00:00Z")) }],
|
|
125
|
+
* ["J-2019", { title: "Ticket books", start: some(new Date("2026-10-29T06:00:00Z")), end: some(new Date("2026-10-30T06:00:00Z")), press: some("b2"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("uncoated", null), due: some(new Date("2026-11-02T00:00:00Z")) }],
|
|
126
|
+
* ["J-2020", { title: "Card stock", start: some(new Date("2026-10-06T06:00:00Z")), end: some(new Date("2026-10-06T14:00:00Z")), press: some("b3"), state: variant("actual", null), sheets: 30000.0, customer: "Copperleaf Cafe", stock: variant("board", null), due: some(new Date("2026-10-08T00:00:00Z")) }],
|
|
127
|
+
* ["J-2021", { title: "Book sections", start: some(new Date("2026-10-11T06:00:00Z")), end: some(new Date("2026-10-12T12:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 84000.0, customer: "Driftwood Museum", stock: variant("coated", null), due: some(new Date("2026-10-14T00:00:00Z")) }],
|
|
128
|
+
* ["J-2022", { title: "Report covers", start: some(new Date("2026-10-19T06:00:00Z")), end: some(new Date("2026-10-20T18:00:00Z")), press: some("b3"), state: variant("confirmed", null), sheets: 48000.0, customer: "Harbour Arts Society", stock: variant("board", null), due: some(new Date("2026-10-21T00:00:00Z")) }],
|
|
129
|
+
* ["J-2023", { title: "Spring brochure", start: some(new Date("2026-11-03T06:00:00Z")), end: some(new Date("2026-11-04T18:00:00Z")), press: some("b3"), state: variant("estimated", null), sheets: 60000.0, customer: "Heathfield Theatre", stock: variant("coated", null), due: some(new Date("2026-11-09T00:00:00Z")) }],
|
|
130
|
+
* ]));
|
|
131
|
+
* export const planLinkCaseJobsPatch = e3.mutation.patch(planLinkCaseJobs);
|
|
132
|
+
* export const planLinkBindings = e3.record("plan_link_bindings", DictType(StringType, PrintBinding), new Map([
|
|
133
|
+
* ["B-01", { title: "Fold sections", start: new Date("2026-10-15T06:00:00Z"), end: new Date("2026-10-16T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
134
|
+
* ["B-02", { title: "Fold sections", start: new Date("2026-10-17T06:00:00Z"), end: new Date("2026-10-18T06:00:00Z"), line: "fold", state: variant("confirmed", null) }],
|
|
135
|
+
* ["B-03", { title: "Bind books", start: new Date("2026-10-20T18:00:00Z"), end: new Date("2026-10-21T18:00:00Z"), line: "bind", state: variant("confirmed", null) }],
|
|
136
|
+
* ["B-04", { title: "Bind exhibition book", start: new Date("2026-10-25T06:00:00Z"), end: new Date("2026-10-26T06:00:00Z"), line: "bind", state: variant("proposed", variant("recommended", null)) }],
|
|
137
|
+
* ]));
|
|
138
|
+
* export const planLinkBindingsPatch = e3.mutation.patch(planLinkBindings);
|
|
139
|
+
* export const planLinkDeliveries = e3.record("plan_link_deliveries", DictType(StringType, PrintDelivery), new Map([
|
|
140
|
+
* ["D-01", { title: "Books", at: new Date("2026-10-28T10:00:00Z"), bay: "bay" }],
|
|
141
|
+
* ["D-02", { title: "Posters", at: new Date("2026-10-20T10:00:00Z"), bay: "bay" }],
|
|
142
|
+
* ]));
|
|
143
|
+
* export const planLinkDeliveriesPatch = e3.mutation.patch(planLinkDeliveries);
|
|
144
|
+
*
|
|
145
|
+
* const planEventLinks = East.function([], UIComponentType, (_$) => (
|
|
146
|
+
* <Reactive>{$ => {
|
|
147
|
+
* const setters = $.let(Record.bind(planLinkSetters, []));
|
|
148
|
+
* const presses = $.let(Record.bind(planPrintPresses, []));
|
|
149
|
+
* const lines = $.let(Record.bind(planLinkLines, []));
|
|
150
|
+
* const bays = $.let(Record.bind(planLinkBays, []));
|
|
151
|
+
* const plates = $.let(Record.bind(planLinkPlates, [planLinkPlatesPatch]));
|
|
152
|
+
* const jobs = $.let(Record.bind(planLinkCaseJobs, [planLinkCaseJobsPatch]));
|
|
153
|
+
* const bindings = $.let(Record.bind(planLinkBindings, [planLinkBindingsPatch]));
|
|
154
|
+
* const deliveries = $.let(Record.bind(planLinkDeliveries, [planLinkDeliveriesPatch]));
|
|
155
|
+
* const stock = $.let(Data.bind(planLinkStock));
|
|
156
|
+
* // The window's first Monday: each stock reading runs from it, a week apiece.
|
|
157
|
+
* const first = $.const(new Date("2026-10-05T00:00:00Z"), DateTimeType);
|
|
158
|
+
* const StockWeek = StructType({ at: DateTimeType, value: OptionType(FloatType) });
|
|
159
|
+
* const weekly = $.const(East.function([ArrayType(FloatType)], ArrayType(StockWeek), (_$2, readings) =>
|
|
160
|
+
* East.Array.generate(readings.size(), StockWeek, (_$3, i) => ({ at: first.addWeeks(i), value: some(readings.get(i)) }))));
|
|
161
|
+
* const axis = $.let(Plan.axis({
|
|
162
|
+
* window: { min: new Date("2026-10-05T00:00:00Z"), max: new Date("2026-11-02T00:00:00Z") },
|
|
163
|
+
* resolution: "week", now: new Date("2026-10-14T09:00:00Z"),
|
|
164
|
+
* }));
|
|
165
|
+
* return (
|
|
166
|
+
* <Plan
|
|
167
|
+
* axis={axis}
|
|
168
|
+
* resources={{
|
|
169
|
+
* setters: Schedule.resources(setters.read(), { name: "Plate room", icon: "layer-group", label: s => s.name }),
|
|
170
|
+
* presses: Schedule.resources(presses.read(), { name: "Presses", icon: "print", label: p => p.name, group: p => p.hall }),
|
|
171
|
+
* lines: Schedule.resources(lines.read(), { name: "Bindery", icon: "book", label: l => l.name }),
|
|
172
|
+
* bays: Schedule.resources(bays.read(), { name: "Dispatch", icon: "warehouse", label: b => b.name }),
|
|
173
|
+
* }}
|
|
174
|
+
* events={{
|
|
175
|
+
* plate: Schedule.events(plates, {
|
|
176
|
+
* name: "Plates", icon: "clone",
|
|
177
|
+
* title: "title", at: "at",
|
|
178
|
+
* resource: { field: "setter", of: "setters" },
|
|
179
|
+
* }),
|
|
180
|
+
* job: Schedule.events(jobs, {
|
|
181
|
+
* name: "Print job", icon: "file-lines",
|
|
182
|
+
* title: "title", start: "start", end: "end",
|
|
183
|
+
* resource: { field: "press", of: "presses" },
|
|
184
|
+
* state: "state", quantity: { field: "sheets", unit: "sheets" },
|
|
185
|
+
* }),
|
|
186
|
+
* binding: Schedule.events(bindings, {
|
|
187
|
+
* name: "Bindery job", icon: "book-open", draw: "cards",
|
|
188
|
+
* title: "title", start: "start", end: "end",
|
|
189
|
+
* resource: { field: "line", of: "lines" }, state: "state",
|
|
190
|
+
* }),
|
|
191
|
+
* delivery: Schedule.events(deliveries, {
|
|
192
|
+
* name: "Delivery", icon: "truck", draw: "buckets",
|
|
193
|
+
* title: "title", at: "at",
|
|
194
|
+
* resource: { field: "bay", of: "bays" },
|
|
195
|
+
* }),
|
|
196
|
+
* }}
|
|
197
|
+
* // The paper in stock: a table over a dataset, read only.
|
|
198
|
+
* rows={[
|
|
199
|
+
* Plan.over(stock, [
|
|
200
|
+
* Plan.series.table(PrintStock, {
|
|
201
|
+
* key: "stock", title: "Paper stock", label: s => s.name,
|
|
202
|
+
* cells: s => Plan.tableCells(weekly(s.weekly)),
|
|
203
|
+
* format: Format.Number({ maximumFractionDigits: 0n }),
|
|
204
|
+
* }),
|
|
205
|
+
* ]),
|
|
206
|
+
* ]}
|
|
207
|
+
* // Each quantity in thousands of sheets, its third of the family's largest setting the link's
|
|
208
|
+
* // weight; the plates' link carries none.
|
|
209
|
+
* links={[
|
|
210
|
+
* Plan.link({ key: "plates", from: Plan.eventRef("plate", "P-01"), to: Plan.eventRef("job", "J-2001") }),
|
|
211
|
+
* Plan.link({ key: "covers", from: Plan.eventRef("job", "J-2001"), to: Plan.eventRef("job", "J-2013"), quantity: Plan.quantity(12, { unit: "k sheets" }) }),
|
|
212
|
+
* Plan.link({ key: "card", from: Plan.eventRef("job", "J-2020"), to: Plan.eventRef("job", "J-2005"), quantity: Plan.quantity(30, { unit: "k sheets" }) }),
|
|
213
|
+
* Plan.link({ key: "inserts", from: Plan.eventRef("job", "J-2003"), to: Plan.eventRef("job", "J-2016"), quantity: Plan.quantity(96, { unit: "k sheets" }) }),
|
|
214
|
+
* Plan.link({ key: "report-covers", from: Plan.eventRef("job", "J-2022"), to: Plan.eventRef("job", "J-2009"), quantity: Plan.quantity(48, { unit: "k sheets" }) }),
|
|
215
|
+
* Plan.link({ key: "seed-prints", from: Plan.eventRef("job", "J-2014"), to: Plan.eventRef("job", "J-2017"), quantity: Plan.quantity(72, { unit: "k sheets" }) }),
|
|
216
|
+
* Plan.link({ key: "tags", from: Plan.eventRef("job", "J-2006"), to: Plan.eventRef("job", "J-2007"), quantity: Plan.quantity(20, { unit: "k sheets" }) }),
|
|
217
|
+
* Plan.link({ key: "pads", from: Plan.eventRef("job", "J-2010"), to: Plan.eventRef("job", "J-2011"), quantity: Plan.quantity(36, { unit: "k sheets" }) }),
|
|
218
|
+
* Plan.link({ key: "proofs", from: Plan.eventRef("job", "J-2008"), to: Plan.eventRef("job", "J-2015"), quantity: Plan.quantity(16, { unit: "k sheets" }) }),
|
|
219
|
+
* Plan.link({ key: "proof-sheets", from: Plan.eventRef("job", "J-2012"), to: Plan.eventRef("job", "J-2004"), quantity: Plan.quantity(8, { unit: "k sheets" }) }),
|
|
220
|
+
* Plan.link({ key: "tickets", from: Plan.eventRef("job", "J-2019"), to: Plan.eventRef("job", "J-2023"), quantity: Plan.quantity(60, { unit: "k sheets" }) }),
|
|
221
|
+
* Plan.link({ key: "sections", from: Plan.eventRef("job", "J-2021"), to: Plan.eventRef("binding", "B-01"), quantity: Plan.quantity(40, { unit: "k sheets" }) }),
|
|
222
|
+
* Plan.link({ key: "sections-more", from: Plan.eventRef("job", "J-2021"), to: Plan.eventRef("binding", "B-02"), quantity: Plan.quantity(44, { unit: "k sheets" }) }),
|
|
223
|
+
* Plan.link({ key: "folded", from: Plan.eventRef("binding", "B-02"), to: Plan.eventRef("binding", "B-03"), quantity: Plan.quantity(40, { unit: "k sheets" }) }),
|
|
224
|
+
* Plan.link({ key: "books", from: Plan.eventRef("binding", "B-03"), to: Plan.eventRef("delivery", "D-01"), quantity: Plan.quantity(36, { unit: "k sheets" }) }),
|
|
225
|
+
* Plan.link({ key: "posters", from: Plan.eventRef("job", "J-2002"), to: Plan.eventRef("delivery", "D-02"), quantity: Plan.quantity(24, { unit: "k sheets" }) }),
|
|
226
|
+
* Plan.link({ key: "book-blocks", from: Plan.eventRef("job", "J-2018"), to: Plan.eventRef("binding", "B-04"), quantity: Plan.quantity(54, { unit: "k sheets" }) }),
|
|
227
|
+
* ]}
|
|
228
|
+
* style={{ height: "400px" }}
|
|
229
|
+
* />
|
|
230
|
+
* );
|
|
231
|
+
* }}</Reactive>
|
|
232
|
+
* ));
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
export function createOver(data, series) {
|
|
236
|
+
const value = East.value(data);
|
|
237
|
+
const valueType = Expr.type(value);
|
|
238
|
+
const read = valueType.type === "Struct" ? valueType.fields["read"] : undefined;
|
|
239
|
+
const source = read !== undefined && read.type === "Function" ? value.read() : value;
|
|
240
|
+
const type = Expr.type(source);
|
|
241
|
+
if (type.type !== "Dict") {
|
|
242
|
+
throw new Error(`Plan.over: \`data\` is a keyed collection — a Dict, or a bind handle over one (Data.bind) — and this one is ${printType(type)}`);
|
|
243
|
+
}
|
|
244
|
+
if (series.length === 0) {
|
|
245
|
+
throw new Error("Plan.over: lays series over the dataset — give at least one `Plan.series.*`");
|
|
246
|
+
}
|
|
247
|
+
const given = series.map((one, i) => {
|
|
248
|
+
const facts = planSeriesFacts(one, type, `Plan.over › series[${i}]`);
|
|
249
|
+
if (facts === undefined) {
|
|
250
|
+
throw new Error(`Plan.over: series[${i}] is a Plan.series.* value written in place — a series bound or stored elsewhere cannot be checked to be read only`);
|
|
251
|
+
}
|
|
252
|
+
if (facts.writes) {
|
|
253
|
+
throw new Error(`Plan.over: series[${i}], ${facts.arm} "${facts.title}", declares \`edit\` — a Plan's rows over a dataset are read only, and its edits go through its event kinds (Schedule.events)`);
|
|
254
|
+
}
|
|
255
|
+
// Written in place, so its keys are known: its own and its nested series'.
|
|
256
|
+
return { facts, keys: planSeriesKeys([one]) ?? [facts.key] };
|
|
257
|
+
});
|
|
258
|
+
checkSeries(series, "Plan.over");
|
|
259
|
+
const blocks = applySeries(series, source);
|
|
260
|
+
const keys = planSeriesKeys(series);
|
|
261
|
+
if (keys !== undefined)
|
|
262
|
+
OVER_KEYS.set(blocks, keys);
|
|
263
|
+
OVER_SERIES.set(blocks, given);
|
|
264
|
+
return blocks;
|
|
265
|
+
}
|
|
266
|
+
//# sourceMappingURL=over.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"over.js","sourceRoot":"","sources":["../../../src/plan/over.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAwE,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAE,cAAc,EAA6C,MAAM,YAAY,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAA8C,MAAM,aAAa,CAAC;AAGpI,mFAAmF;AACnF,MAAM,SAAS,GAAG,IAAI,OAAO,EAA6B,CAAC;AAc3D,kFAAkF;AAClF,MAAM,WAAW,GAAG,IAAI,OAAO,EAAqC,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,IAAa;IACpC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACzF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,IAAa;IACxC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvF,CAAC;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8LG;AACH,MAAM,UAAU,UAAU,CACtB,IAAuE,EACvE,MAA4B;IAE5B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAoC,CAAuB,CAAC;IACrF,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAwB,CAAa,CAAC;IAClE,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,SAAS,CAAC,MAAmC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9G,MAAM,MAAM,GAAG,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAE,KAAmC,CAAC,IAAI,EAAmC,CAAC,CAAC,CAAC,KAAK,CAAC;IACrJ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAyB,CAAa,CAAC;IAC9D,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,+GAA+G,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtJ,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;IACnG,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAkB,EAAE;QAChD,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,EAAE,IAAI,EAAE,sBAAsB,CAAC,GAAG,CAAC,CAAC;QACrE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,oHAAoH,CAAC,CAAC;QAChK,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,KAAK,+HAA+H,CAAC,CAAC;QAC1M,CAAC;QACD,2EAA2E;QAC3E,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;IACjE,CAAC,CAAC,CAAC;IACH,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAA+B,CAAC;IACzE,MAAM,IAAI,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,IAAI,KAAK,SAAS;QAAE,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACpD,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AAClB,CAAC"}
|