@elaraai/e3-ui 1.0.94 → 1.0.95
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/allocation/adapters.d.ts +159 -0
- package/dist/src/allocation/adapters.d.ts.map +1 -0
- package/dist/src/allocation/adapters.js +241 -0
- package/dist/src/allocation/adapters.js.map +1 -0
- package/dist/src/allocation/functions.d.ts +664 -0
- package/dist/src/allocation/functions.d.ts.map +1 -0
- package/dist/src/allocation/functions.js +782 -0
- package/dist/src/allocation/functions.js.map +1 -0
- package/dist/src/allocation/index.d.ts +2985 -0
- package/dist/src/allocation/index.d.ts.map +1 -0
- package/dist/src/allocation/index.js +499 -0
- package/dist/src/allocation/index.js.map +1 -0
- package/dist/src/allocation/types.d.ts +832 -0
- package/dist/src/allocation/types.d.ts.map +1 -0
- package/dist/src/allocation/types.js +360 -0
- package/dist/src/allocation/types.js.map +1 -0
- package/dist/src/bind/func.d.ts +14 -0
- package/dist/src/bind/func.d.ts.map +1 -1
- package/dist/src/bind/func.js +22 -1
- package/dist/src/bind/func.js.map +1 -1
- package/dist/src/calendar/index.d.ts +510 -1639
- package/dist/src/calendar/index.d.ts.map +1 -1
- package/dist/src/calendar/index.js +56 -29
- package/dist/src/calendar/index.js.map +1 -1
- package/dist/src/flowchart/canvas.d.ts +9 -21
- package/dist/src/flowchart/canvas.d.ts.map +1 -1
- package/dist/src/flowchart/canvas.js +10 -22
- package/dist/src/flowchart/canvas.js.map +1 -1
- package/dist/src/flowchart/flowchart.d.ts +19 -13
- package/dist/src/flowchart/flowchart.d.ts.map +1 -1
- package/dist/src/flowchart/flowchart.js.map +1 -1
- package/dist/src/flowchart/index.d.ts +44 -21
- package/dist/src/flowchart/index.d.ts.map +1 -1
- package/dist/src/flowchart/index.js +43 -20
- package/dist/src/flowchart/index.js.map +1 -1
- package/dist/src/flowchart/library.d.ts +166 -81
- package/dist/src/flowchart/library.d.ts.map +1 -1
- package/dist/src/flowchart/library.js +232 -105
- package/dist/src/flowchart/library.js.map +1 -1
- package/dist/src/flowchart/over.d.ts +9 -16
- package/dist/src/flowchart/over.d.ts.map +1 -1
- package/dist/src/flowchart/over.js +9 -16
- package/dist/src/flowchart/over.js.map +1 -1
- package/dist/src/flowchart/payload.d.ts +710 -508
- package/dist/src/flowchart/payload.d.ts.map +1 -1
- package/dist/src/flowchart/payload.js +128 -74
- package/dist/src/flowchart/payload.js.map +1 -1
- package/dist/src/flowchart/window.d.ts +132 -347
- package/dist/src/flowchart/window.d.ts.map +1 -1
- package/dist/src/flowchart/window.js +48 -55
- package/dist/src/flowchart/window.js.map +1 -1
- package/dist/src/index.d.ts +11 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +14 -6
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +18 -7
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +28 -9
- package/dist/src/internal.js.map +1 -1
- package/dist/src/plan/event-rows.d.ts +26 -10
- package/dist/src/plan/event-rows.d.ts.map +1 -1
- package/dist/src/plan/event-rows.js +39 -13
- package/dist/src/plan/event-rows.js.map +1 -1
- package/dist/src/plan/ir.d.ts +244 -815
- package/dist/src/plan/ir.d.ts.map +1 -1
- package/dist/src/plan/ir.js +8 -6
- package/dist/src/plan/ir.js.map +1 -1
- package/dist/src/plan/library.d.ts +3 -0
- package/dist/src/plan/library.d.ts.map +1 -1
- package/dist/src/plan/library.js +1 -1
- package/dist/src/plan/library.js.map +1 -1
- package/dist/src/plan/ordered-source.d.ts +1 -0
- package/dist/src/plan/ordered-source.d.ts.map +1 -1
- package/dist/src/plan/plan.d.ts +559 -1667
- package/dist/src/plan/plan.d.ts.map +1 -1
- package/dist/src/plan/plan.js +123 -45
- package/dist/src/plan/plan.js.map +1 -1
- package/dist/src/plan/root.d.ts +16 -20
- package/dist/src/plan/root.d.ts.map +1 -1
- package/dist/src/plan/root.js +23 -33
- package/dist/src/plan/root.js.map +1 -1
- package/dist/src/roster/coverage.d.ts +17 -231
- package/dist/src/roster/coverage.d.ts.map +1 -1
- package/dist/src/roster/coverage.js +94 -90
- package/dist/src/roster/coverage.js.map +1 -1
- package/dist/src/roster/fit.d.ts +59 -0
- package/dist/src/roster/fit.d.ts.map +1 -0
- package/dist/src/roster/fit.js +155 -0
- package/dist/src/roster/fit.js.map +1 -0
- package/dist/src/roster/index.d.ts +2862 -3662
- package/dist/src/roster/index.d.ts.map +1 -1
- package/dist/src/roster/index.js +383 -81
- package/dist/src/roster/index.js.map +1 -1
- package/dist/src/roster/library.d.ts +37 -92
- package/dist/src/roster/library.d.ts.map +1 -1
- package/dist/src/roster/library.js +25 -64
- package/dist/src/roster/library.js.map +1 -1
- package/dist/src/roster/lists.d.ts +195 -0
- package/dist/src/roster/lists.d.ts.map +1 -0
- package/dist/src/roster/lists.js +233 -0
- package/dist/src/roster/lists.js.map +1 -0
- package/dist/src/roster/rules.d.ts +17 -260
- package/dist/src/roster/rules.d.ts.map +1 -1
- package/dist/src/roster/rules.js +135 -132
- package/dist/src/roster/rules.js.map +1 -1
- package/dist/src/roster/targets.d.ts +115 -0
- package/dist/src/roster/targets.d.ts.map +1 -0
- package/dist/src/roster/targets.js +213 -0
- package/dist/src/roster/targets.js.map +1 -0
- package/dist/src/roster/times.d.ts +251 -0
- package/dist/src/roster/times.d.ts.map +1 -0
- package/dist/src/roster/times.js +174 -0
- package/dist/src/roster/times.js.map +1 -0
- package/dist/src/roster/types.d.ts +828 -183
- package/dist/src/roster/types.d.ts.map +1 -1
- package/dist/src/roster/types.js +224 -97
- package/dist/src/roster/types.js.map +1 -1
- package/dist/src/schedule/accessor.d.ts +28 -0
- package/dist/src/schedule/accessor.d.ts.map +1 -0
- package/dist/src/schedule/accessor.js +39 -0
- package/dist/src/schedule/accessor.js.map +1 -0
- package/dist/src/schedule/events.d.ts +170 -42
- package/dist/src/schedule/events.d.ts.map +1 -1
- package/dist/src/schedule/events.js +431 -171
- package/dist/src/schedule/events.js.map +1 -1
- package/dist/src/schedule/index.d.ts +41 -4
- package/dist/src/schedule/index.d.ts.map +1 -1
- package/dist/src/schedule/index.js +35 -3
- package/dist/src/schedule/index.js.map +1 -1
- package/dist/src/schedule/library.d.ts +13 -3
- package/dist/src/schedule/library.d.ts.map +1 -1
- package/dist/src/schedule/library.js +11 -4
- package/dist/src/schedule/library.js.map +1 -1
- package/dist/src/schedule/periods.d.ts +115 -0
- package/dist/src/schedule/periods.d.ts.map +1 -0
- package/dist/src/schedule/periods.js +215 -0
- package/dist/src/schedule/periods.js.map +1 -0
- package/dist/src/schedule/record-window.d.ts +25 -3
- package/dist/src/schedule/record-window.d.ts.map +1 -1
- package/dist/src/schedule/record-window.js +31 -18
- package/dist/src/schedule/record-window.js.map +1 -1
- package/dist/src/schedule/resources.d.ts +82 -4
- package/dist/src/schedule/resources.d.ts.map +1 -1
- package/dist/src/schedule/resources.js +44 -14
- package/dist/src/schedule/resources.js.map +1 -1
- package/dist/src/schedule/session.d.ts +69 -0
- package/dist/src/schedule/session.d.ts.map +1 -0
- package/dist/src/schedule/session.js +121 -0
- package/dist/src/schedule/session.js.map +1 -0
- package/dist/src/schedule/templates.d.ts +14 -2
- package/dist/src/schedule/templates.d.ts.map +1 -1
- package/dist/src/schedule/templates.js +5 -3
- package/dist/src/schedule/templates.js.map +1 -1
- package/dist/src/schedule/types.d.ts +1671 -37
- package/dist/src/schedule/types.d.ts.map +1 -1
- package/dist/src/schedule/types.js +196 -5
- package/dist/src/schedule/types.js.map +1 -1
- package/dist/src/schedule/window.d.ts +14 -0
- package/dist/src/schedule/window.d.ts.map +1 -1
- package/dist/src/schedule/window.js +14 -4
- package/dist/src/schedule/window.js.map +1 -1
- package/dist/src/schedule/words.d.ts +22 -0
- package/dist/src/schedule/words.d.ts.map +1 -0
- package/dist/src/schedule/words.js +25 -0
- package/dist/src/schedule/words.js.map +1 -0
- package/dist/src/sheet/index.d.ts +61 -27
- package/dist/src/sheet/index.d.ts.map +1 -1
- package/dist/src/sheet/index.js +59 -25
- package/dist/src/sheet/index.js.map +1 -1
- package/dist/src/sheet/library.d.ts +21 -3
- package/dist/src/sheet/library.d.ts.map +1 -1
- package/dist/src/sheet/library.js +23 -6
- package/dist/src/sheet/library.js.map +1 -1
- package/dist/src/sheet/registers.d.ts +100 -85
- package/dist/src/sheet/registers.d.ts.map +1 -1
- package/dist/src/sheet/registers.js +100 -85
- package/dist/src/sheet/registers.js.map +1 -1
- package/dist/src/sheet/root.d.ts +8 -12
- package/dist/src/sheet/root.d.ts.map +1 -1
- package/dist/src/sheet/root.js +6 -40
- package/dist/src/sheet/root.js.map +1 -1
- package/dist/src/sheet/sheet.d.ts +598 -2349
- package/dist/src/sheet/sheet.d.ts.map +1 -1
- package/dist/src/sheet/sheet.js +124 -37
- package/dist/src/sheet/sheet.js.map +1 -1
- package/dist/src/sheet/sub-rows.d.ts +74 -28
- package/dist/src/sheet/sub-rows.d.ts.map +1 -1
- package/dist/src/sheet/sub-rows.js +74 -28
- package/dist/src/sheet/sub-rows.js.map +1 -1
- package/dist/src/sheet/templates.d.ts +98 -34
- package/dist/src/sheet/templates.d.ts.map +1 -1
- package/dist/src/sheet/templates.js +102 -58
- package/dist/src/sheet/templates.js.map +1 -1
- package/dist/src/sheet/types.d.ts +289 -1359
- package/dist/src/sheet/types.d.ts.map +1 -1
- package/dist/src/sheet/types.js +20 -26
- package/dist/src/sheet/types.js.map +1 -1
- package/dist/src/sheet/views.d.ts +10 -11
- package/dist/src/sheet/views.d.ts.map +1 -1
- package/dist/src/sheet/views.js +15 -20
- package/dist/src/sheet/views.js.map +1 -1
- package/dist/src/{roster/visibility.d.ts → utils/key-visibility.d.ts} +42 -7
- package/dist/src/utils/key-visibility.d.ts.map +1 -0
- package/dist/src/utils/key-visibility.js +36 -0
- package/dist/src/utils/key-visibility.js.map +1 -0
- package/dist/src/utils/ordered-source.d.ts +1 -0
- package/dist/src/utils/ordered-source.d.ts.map +1 -1
- package/dist/src/utils/ordered-source.js +8 -3
- package/dist/src/utils/ordered-source.js.map +1 -1
- package/dist/src/utils/record-sources.d.ts +107 -0
- package/dist/src/utils/record-sources.d.ts.map +1 -0
- package/dist/src/utils/record-sources.js +132 -0
- package/dist/src/utils/record-sources.js.map +1 -0
- package/dist/test/allocation/allocation.examples.d.ts +2902 -0
- package/dist/test/allocation/allocation.examples.d.ts.map +1 -0
- package/dist/test/allocation/allocation.examples.js +643 -0
- package/dist/test/allocation/allocation.examples.js.map +1 -0
- package/dist/test/allocation/fit.examples.d.ts +546 -0
- package/dist/test/allocation/fit.examples.d.ts.map +1 -0
- package/dist/test/allocation/fit.examples.js +171 -0
- package/dist/test/allocation/fit.examples.js.map +1 -0
- package/dist/test/allocation/kiln-yard.d.ts +181 -0
- package/dist/test/allocation/kiln-yard.d.ts.map +1 -0
- package/dist/test/allocation/kiln-yard.js +228 -0
- package/dist/test/allocation/kiln-yard.js.map +1 -0
- package/dist/test/bind/data/data.examples.d.ts +651 -1
- package/dist/test/bind/data/data.examples.d.ts.map +1 -1
- package/dist/test/bind/data/data.examples.js +140 -2
- package/dist/test/bind/data/data.examples.js.map +1 -1
- package/dist/test/bind/func/func.examples.d.ts +10 -1
- package/dist/test/bind/func/func.examples.d.ts.map +1 -1
- package/dist/test/bind/func/func.examples.js +8 -1
- package/dist/test/bind/func/func.examples.js.map +1 -1
- package/dist/test/bind/record/record.examples.d.ts +633 -1
- package/dist/test/bind/record/record.examples.d.ts.map +1 -1
- package/dist/test/bind/record/record.examples.js +26 -2
- package/dist/test/bind/record/record.examples.js.map +1 -1
- package/dist/test/calendar/calendar-records.examples.d.ts.map +1 -1
- package/dist/test/calendar/calendar-records.examples.js +18 -14
- package/dist/test/calendar/calendar-records.examples.js.map +1 -1
- package/dist/test/calendar/calendar.examples.d.ts +521 -16
- package/dist/test/calendar/calendar.examples.d.ts.map +1 -1
- package/dist/test/calendar/calendar.examples.js +182 -135
- package/dist/test/calendar/calendar.examples.js.map +1 -1
- package/dist/test/examples-package.d.ts +75 -0
- package/dist/test/examples-package.d.ts.map +1 -0
- package/dist/test/examples-package.js +263 -0
- package/dist/test/examples-package.js.map +1 -0
- package/dist/test/flowchart/flowchart.examples.d.ts +211 -19
- package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -1
- package/dist/test/flowchart/flowchart.examples.js +102 -75
- package/dist/test/flowchart/flowchart.examples.js.map +1 -1
- package/dist/test/plan/plan-events.examples.d.ts +1439 -209
- package/dist/test/plan/plan-events.examples.d.ts.map +1 -1
- package/dist/test/plan/plan-events.examples.js +199 -59
- package/dist/test/plan/plan-events.examples.js.map +1 -1
- package/dist/test/plan/plan-records.examples.d.ts +420 -0
- package/dist/test/plan/plan-records.examples.d.ts.map +1 -1
- package/dist/test/plan/plan-records.examples.js +70 -19
- package/dist/test/plan/plan-records.examples.js.map +1 -1
- package/dist/test/plan/plan-windows.examples.d.ts +636 -55
- package/dist/test/plan/plan-windows.examples.d.ts.map +1 -1
- package/dist/test/plan/plan-windows.examples.js +69 -33
- package/dist/test/plan/plan-windows.examples.js.map +1 -1
- package/dist/test/plan/plan.examples.d.ts +153 -31
- package/dist/test/plan/plan.examples.d.ts.map +1 -1
- package/dist/test/plan/plan.examples.js +178 -101
- package/dist/test/plan/plan.examples.js.map +1 -1
- package/dist/test/roster/domain.examples.d.ts +467 -250
- package/dist/test/roster/domain.examples.d.ts.map +1 -1
- package/dist/test/roster/domain.examples.js +92 -29
- package/dist/test/roster/domain.examples.js.map +1 -1
- package/dist/test/roster/roster-records.examples.d.ts +430 -586
- package/dist/test/roster/roster-records.examples.d.ts.map +1 -1
- package/dist/test/roster/roster-records.examples.js +102 -43
- package/dist/test/roster/roster-records.examples.js.map +1 -1
- package/dist/test/roster/roster.examples.d.ts +2319 -606
- package/dist/test/roster/roster.examples.d.ts.map +1 -1
- package/dist/test/roster/roster.examples.js +456 -148
- package/dist/test/roster/roster.examples.js.map +1 -1
- package/dist/test/roster/warehouse.d.ts +172 -63
- package/dist/test/roster/warehouse.d.ts.map +1 -1
- package/dist/test/roster/warehouse.js +172 -39
- package/dist/test/roster/warehouse.js.map +1 -1
- package/dist/test/schedule/schedule.examples.d.ts +3499 -0
- package/dist/test/schedule/schedule.examples.d.ts.map +1 -0
- package/dist/test/schedule/schedule.examples.js +192 -0
- package/dist/test/schedule/schedule.examples.js.map +1 -0
- package/dist/test/sheet/sheet-records.examples.d.ts.map +1 -1
- package/dist/test/sheet/sheet-records.examples.js +22 -18
- package/dist/test/sheet/sheet-records.examples.js.map +1 -1
- package/dist/test/sheet/sheet.examples.d.ts +715 -26
- package/dist/test/sheet/sheet.examples.d.ts.map +1 -1
- package/dist/test/sheet/sheet.examples.js +204 -130
- package/dist/test/sheet/sheet.examples.js.map +1 -1
- package/package.json +17 -10
- package/dist/src/roster/people.d.ts +0 -50
- package/dist/src/roster/people.d.ts.map +0 -1
- package/dist/src/roster/people.js +0 -32
- package/dist/src/roster/people.js.map +0 -1
- package/dist/src/roster/visibility.d.ts.map +0 -1
- package/dist/src/roster/visibility.js +0 -25
- package/dist/src/roster/visibility.js.map +0 -1
|
@@ -29,8 +29,8 @@ import { SheetFacetType, SheetSubRowType } from "./types.js";
|
|
|
29
29
|
* ```tsx
|
|
30
30
|
* // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
|
|
31
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";
|
|
32
|
+
* import { Box, Reactive, Slice, UIComponentType } from "@elaraai/east-ui";
|
|
33
|
+
* import { Data, Record, Sheet } from "@elaraai/e3-ui";
|
|
34
34
|
* import e3 from "@elaraai/e3";
|
|
35
35
|
*
|
|
36
36
|
* export const BatchPart = StructType({ id: StringType, code: StringType, name: StringType, materials: ArrayType(StringType), station: OptionType(StringType) });
|
|
@@ -63,16 +63,38 @@ import { SheetFacetType, SheetSubRowType } from "./types.js";
|
|
|
63
63
|
* ] }],
|
|
64
64
|
* ]));
|
|
65
65
|
* export const sheetBatchDaysPatch = e3.mutation.patch(sheetBatchDays);
|
|
66
|
+
* export const BatchStepTemplate = StructType({ name: StringType, group: StringType, task: StringType });
|
|
67
|
+
* export const sheetBatchStepTemplates = e3.record("sheet_batch_step_templates", DictType(StringType, BatchStepTemplate), new Map([
|
|
68
|
+
* ["sand", { name: "Sand", group: "Steps", task: "Sand" }],
|
|
69
|
+
* ["seal", { name: "Seal", group: "Steps", task: "Seal" }],
|
|
70
|
+
* ]));
|
|
71
|
+
* export const sheetBatchStepTemplatesByGroup = e3.recordIndex("sheet_batch_step_templates_by_group", sheetBatchStepTemplates, { on: ["group"] });
|
|
72
|
+
* export const BatchTemplate = StructType({ name: StringType, group: StringType, batch: StringType, steps: ArrayType(BatchStep) });
|
|
73
|
+
* export const sheetBatchTemplates = e3.record("sheet_batch_templates", DictType(StringType, BatchTemplate), new Map([
|
|
74
|
+
* ["finishing", { name: "Finishing batch", group: "Batches", batch: "Finishing", steps: [
|
|
75
|
+
* { task: "Sand", qty: none, parts: [], bookings: [] },
|
|
76
|
+
* { task: "Seal", qty: none, parts: [], bookings: [] },
|
|
77
|
+
* { task: "Spray", qty: none, parts: [], bookings: [] },
|
|
78
|
+
* ] }],
|
|
79
|
+
* ]));
|
|
80
|
+
* export const sheetBatchTemplatesByGroup = e3.recordIndex("sheet_batch_templates_by_group", sheetBatchTemplates, { on: ["group"] });
|
|
66
81
|
*
|
|
67
82
|
* const sheet = East.function([], UIComponentType, (_$) => (
|
|
68
83
|
* <Reactive>{$ => {
|
|
69
84
|
* const days = $.let(Record.bind(sheetBatchDays, [sheetBatchDaysPatch]));
|
|
70
|
-
*
|
|
71
|
-
* const
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
85
|
+
* const stepTemplates = $.let(Data.bind(sheetBatchStepTemplates));
|
|
86
|
+
* const batchTemplates = $.let(Data.bind(sheetBatchTemplates));
|
|
87
|
+
* // One rail over the templates records, each its own source: they narrow the Rows tab's cards.
|
|
88
|
+
* const slice = $.let(Slice.bindRecords("sheet.batches", {
|
|
89
|
+
* rowTemplates: {
|
|
90
|
+
* source: Data.bindPaged(sheetBatchStepTemplates, { indexes: [sheetBatchStepTemplatesByGroup] }),
|
|
91
|
+
* label: "Step templates", fields: { group: { label: "Group", hints: ["Steps"] } },
|
|
92
|
+
* },
|
|
93
|
+
* groupTemplates: {
|
|
94
|
+
* source: Data.bindPaged(sheetBatchTemplates, { indexes: [sheetBatchTemplatesByGroup] }),
|
|
95
|
+
* label: "Batch templates", fields: { group: { label: "Group", hints: ["Batches"] } },
|
|
96
|
+
* },
|
|
97
|
+
* }));
|
|
76
98
|
* // A batch needs a name before Save.
|
|
77
99
|
* const readyBatch = $.const(East.function([Sheet.Types.DraftGroup(Batch, "steps")], Sheet.Types.Readiness, ($, batch) => {
|
|
78
100
|
* $.if(batch.name.hasTag("value").and(() => batch.name.unwrap("value").length().equal(0n)), $ => {
|
|
@@ -109,12 +131,13 @@ import { SheetFacetType, SheetSubRowType } from "./types.js";
|
|
|
109
131
|
* // The sub rows show a step's parts and bookings; the inspector's form leaves them out.
|
|
110
132
|
* inspector
|
|
111
133
|
* fields={{ parts: Sheet.field.hidden(), bookings: Sheet.field.hidden() }}
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
134
|
+
* slice={{ slice }}
|
|
135
|
+
* templates={[
|
|
136
|
+
* Sheet.templates(stepTemplates.read(), { name: t => t.name, group: t => some(t.group),
|
|
137
|
+
* values: t => Sheet.patch(BatchStep, { task: t.task, qty: none }), source: "rowTemplates" }),
|
|
138
|
+
* Sheet.templates(batchTemplates.read(), { name: t => t.name, group: t => some(t.group),
|
|
139
|
+
* values: t => Sheet.patch(Batch, { name: t.batch, steps: t.steps }), source: "groupTemplates" }),
|
|
140
|
+
* ]}
|
|
118
141
|
* library={[Sheet.library.rows(), Sheet.library.columns()]}
|
|
119
142
|
* ready={{ group: readyBatch }}
|
|
120
143
|
* newRow={newStep}
|
|
@@ -159,8 +182,8 @@ function textOrBlank(v) {
|
|
|
159
182
|
* ```tsx
|
|
160
183
|
* // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
|
|
161
184
|
* 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";
|
|
185
|
+
* import { Box, Reactive, Slice, UIComponentType } from "@elaraai/east-ui";
|
|
186
|
+
* import { Data, Record, Sheet } from "@elaraai/e3-ui";
|
|
164
187
|
* import e3 from "@elaraai/e3";
|
|
165
188
|
*
|
|
166
189
|
* export const BatchPart = StructType({ id: StringType, code: StringType, name: StringType, materials: ArrayType(StringType), station: OptionType(StringType) });
|
|
@@ -193,16 +216,38 @@ function textOrBlank(v) {
|
|
|
193
216
|
* ] }],
|
|
194
217
|
* ]));
|
|
195
218
|
* export const sheetBatchDaysPatch = e3.mutation.patch(sheetBatchDays);
|
|
219
|
+
* export const BatchStepTemplate = StructType({ name: StringType, group: StringType, task: StringType });
|
|
220
|
+
* export const sheetBatchStepTemplates = e3.record("sheet_batch_step_templates", DictType(StringType, BatchStepTemplate), new Map([
|
|
221
|
+
* ["sand", { name: "Sand", group: "Steps", task: "Sand" }],
|
|
222
|
+
* ["seal", { name: "Seal", group: "Steps", task: "Seal" }],
|
|
223
|
+
* ]));
|
|
224
|
+
* export const sheetBatchStepTemplatesByGroup = e3.recordIndex("sheet_batch_step_templates_by_group", sheetBatchStepTemplates, { on: ["group"] });
|
|
225
|
+
* export const BatchTemplate = StructType({ name: StringType, group: StringType, batch: StringType, steps: ArrayType(BatchStep) });
|
|
226
|
+
* export const sheetBatchTemplates = e3.record("sheet_batch_templates", DictType(StringType, BatchTemplate), new Map([
|
|
227
|
+
* ["finishing", { name: "Finishing batch", group: "Batches", batch: "Finishing", steps: [
|
|
228
|
+
* { task: "Sand", qty: none, parts: [], bookings: [] },
|
|
229
|
+
* { task: "Seal", qty: none, parts: [], bookings: [] },
|
|
230
|
+
* { task: "Spray", qty: none, parts: [], bookings: [] },
|
|
231
|
+
* ] }],
|
|
232
|
+
* ]));
|
|
233
|
+
* export const sheetBatchTemplatesByGroup = e3.recordIndex("sheet_batch_templates_by_group", sheetBatchTemplates, { on: ["group"] });
|
|
196
234
|
*
|
|
197
235
|
* const sheet = East.function([], UIComponentType, (_$) => (
|
|
198
236
|
* <Reactive>{$ => {
|
|
199
237
|
* const days = $.let(Record.bind(sheetBatchDays, [sheetBatchDaysPatch]));
|
|
200
|
-
*
|
|
201
|
-
* const
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
238
|
+
* const stepTemplates = $.let(Data.bind(sheetBatchStepTemplates));
|
|
239
|
+
* const batchTemplates = $.let(Data.bind(sheetBatchTemplates));
|
|
240
|
+
* // One rail over the templates records, each its own source: they narrow the Rows tab's cards.
|
|
241
|
+
* const slice = $.let(Slice.bindRecords("sheet.batches", {
|
|
242
|
+
* rowTemplates: {
|
|
243
|
+
* source: Data.bindPaged(sheetBatchStepTemplates, { indexes: [sheetBatchStepTemplatesByGroup] }),
|
|
244
|
+
* label: "Step templates", fields: { group: { label: "Group", hints: ["Steps"] } },
|
|
245
|
+
* },
|
|
246
|
+
* groupTemplates: {
|
|
247
|
+
* source: Data.bindPaged(sheetBatchTemplates, { indexes: [sheetBatchTemplatesByGroup] }),
|
|
248
|
+
* label: "Batch templates", fields: { group: { label: "Group", hints: ["Batches"] } },
|
|
249
|
+
* },
|
|
250
|
+
* }));
|
|
206
251
|
* // A batch needs a name before Save.
|
|
207
252
|
* const readyBatch = $.const(East.function([Sheet.Types.DraftGroup(Batch, "steps")], Sheet.Types.Readiness, ($, batch) => {
|
|
208
253
|
* $.if(batch.name.hasTag("value").and(() => batch.name.unwrap("value").length().equal(0n)), $ => {
|
|
@@ -239,12 +284,13 @@ function textOrBlank(v) {
|
|
|
239
284
|
* // The sub rows show a step's parts and bookings; the inspector's form leaves them out.
|
|
240
285
|
* inspector
|
|
241
286
|
* fields={{ parts: Sheet.field.hidden(), bookings: Sheet.field.hidden() }}
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
287
|
+
* slice={{ slice }}
|
|
288
|
+
* templates={[
|
|
289
|
+
* Sheet.templates(stepTemplates.read(), { name: t => t.name, group: t => some(t.group),
|
|
290
|
+
* values: t => Sheet.patch(BatchStep, { task: t.task, qty: none }), source: "rowTemplates" }),
|
|
291
|
+
* Sheet.templates(batchTemplates.read(), { name: t => t.name, group: t => some(t.group),
|
|
292
|
+
* values: t => Sheet.patch(Batch, { name: t.batch, steps: t.steps }), source: "groupTemplates" }),
|
|
293
|
+
* ]}
|
|
248
294
|
* library={[Sheet.library.rows(), Sheet.library.columns()]}
|
|
249
295
|
* ready={{ group: readyBatch }}
|
|
250
296
|
* newRow={newStep}
|
|
@@ -1 +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
|
|
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,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;QACzF,EAAE,EAAM,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;KAChC,EAAE,eAAe,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -3,51 +3,109 @@
|
|
|
3
3
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* `<Sheet>`'s templates (#1183, `Sheet Builder Spec.md` §4.2, SB9):
|
|
7
|
-
* Rows tab's cards.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
6
|
+
* `<Sheet>`'s templates (#1183, #1345, `Sheet Builder Spec.md` §4.2, SB9):
|
|
7
|
+
* the Rows tab's cards. Templates are records (#1340): `Sheet.templates(rows,
|
|
8
|
+
* { name, group?, values, source })` reads one templates record — its rows the
|
|
9
|
+
* templates, its keys theirs — and names the source of the sheet's
|
|
10
|
+
* `Slice.bindRecords` that narrows the Rows tab's cards of it. A grouped
|
|
11
|
+
* sheet's row templates and group templates are two records, each its own
|
|
12
|
+
* source.
|
|
13
|
+
*
|
|
14
|
+
* A template is a row template — over the row type, a grouped sheet's line
|
|
15
|
+
* type — or a group template, over the group type with its lines, as its
|
|
16
|
+
* `values` patch's type says, as an author's tab's `drop` does. Each carries
|
|
17
|
+
* a seed built by the code that builds `newRow`'s and `newGroup`'s: the
|
|
18
|
+
* constructor's defaults first, the template's set fields over them. The
|
|
19
|
+
* cells its card shows are the template's own fields, through the columns'
|
|
20
|
+
* projection.
|
|
13
21
|
*
|
|
14
22
|
* @packageDocumentation
|
|
15
23
|
*/
|
|
16
|
-
import { ArrayType, DictType, FunctionType, OptionType, StringType, StructType, VariantType, type ExprType, type SubtypeExprOrValue } from "@elaraai/east";
|
|
24
|
+
import { ArrayType, DictType, FunctionType, OptionType, StringType, StructType, VariantType, type EastType, type ExprType, type SubtypeExprOrValue } from "@elaraai/east";
|
|
17
25
|
import { type SheetPatchOf } from "./types.js";
|
|
18
26
|
import { type SheetBridge } from "./bridge.js";
|
|
27
|
+
/** Identifies a templates list, as `Sheet.templates` declares one. */
|
|
28
|
+
export declare const SHEET_TEMPLATES: unique symbol;
|
|
19
29
|
/**
|
|
20
|
-
*
|
|
30
|
+
* The accessors over one row of a templates record, each given the row and
|
|
31
|
+
* its key — `Sheet.templates(rows, { name, group?, values, source })`.
|
|
21
32
|
*
|
|
22
|
-
* @typeParam R - The
|
|
33
|
+
* @typeParam R - The templates record's row type
|
|
34
|
+
* @typeParam P - The patch `values` returns: `Sheet.Types.Patch` of the row type (a grouped sheet's line type), or of the group type
|
|
23
35
|
*/
|
|
24
|
-
export interface
|
|
25
|
-
/** Its key — unique among the sheet's templates, rows and groups alike. */
|
|
26
|
-
key: string;
|
|
36
|
+
export interface SheetTemplatesConfig<R extends EastType, P extends EastType> {
|
|
27
37
|
/** The card's name. */
|
|
28
|
-
name:
|
|
29
|
-
/** The Rows tab's group the card sits under. */
|
|
30
|
-
group?:
|
|
31
|
-
/**
|
|
32
|
-
|
|
38
|
+
name: (row: ExprType<R>, key: ExprType<StringType>) => SubtypeExprOrValue<StringType>;
|
|
39
|
+
/** The Rows tab's group the card sits under; none, it sits under no group. */
|
|
40
|
+
group?: (row: ExprType<R>, key: ExprType<StringType>) => SubtypeExprOrValue<OptionType<StringType>>;
|
|
41
|
+
/**
|
|
42
|
+
* The fields the template sets — `Sheet.patch(RowType, …)` for a row
|
|
43
|
+
* template (a grouped sheet's line type), `Sheet.patch(GroupType, …)` for
|
|
44
|
+
* a group template with its lines. A field it leaves unset takes
|
|
45
|
+
* `newRow`'s (or `newGroup`'s) default, or starts missing.
|
|
46
|
+
*/
|
|
47
|
+
values: (row: ExprType<R>, key: ExprType<StringType>) => ExprType<P>;
|
|
48
|
+
/**
|
|
49
|
+
* The source of the sheet's `Slice.bindRecords` whose shown keys narrow
|
|
50
|
+
* these cards: the templates record's own source, its keys these
|
|
51
|
+
* templates' keys. A templates list must name one.
|
|
52
|
+
*/
|
|
53
|
+
source?: string;
|
|
33
54
|
}
|
|
34
55
|
/**
|
|
35
|
-
*
|
|
56
|
+
* One templates list — what `Sheet.templates` returns, and `<Sheet
|
|
57
|
+
* templates>` takes, alone or several in an array.
|
|
58
|
+
*
|
|
59
|
+
* @typeParam P - The patch its `values` returns
|
|
60
|
+
*/
|
|
61
|
+
export interface SheetTemplates<P extends EastType = EastType> {
|
|
62
|
+
/** Identifies the declaration. */
|
|
63
|
+
readonly [SHEET_TEMPLATES]: true;
|
|
64
|
+
/** The templates record's rows, keyed by String: its `read()`. */
|
|
65
|
+
readonly rows: ExprType<DictType<StringType, EastType>>;
|
|
66
|
+
/** The accessors, read once when the sheet is built. */
|
|
67
|
+
readonly config: SheetTemplatesConfig<EastType, P>;
|
|
68
|
+
/** The source it names, if any. */
|
|
69
|
+
readonly source: string | undefined;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* What `<Sheet templates>` takes: one templates list, or several — a grouped
|
|
73
|
+
* sheet's row templates and group templates are two.
|
|
36
74
|
*
|
|
37
75
|
* @typeParam L - The row type (a grouped sheet's line type)
|
|
38
76
|
* @typeParam G - The group type, on a grouped sheet
|
|
39
77
|
*/
|
|
40
|
-
export
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
78
|
+
export type SheetTemplatesProp<L extends StructType, G extends StructType = never> = SheetTemplates<SheetPatchOf<L>> | ([G] extends [never] ? never : SheetTemplates<SheetPatchOf<G>>) | readonly (SheetTemplates<SheetPatchOf<L>> | ([G] extends [never] ? never : SheetTemplates<SheetPatchOf<G>>))[];
|
|
79
|
+
/**
|
|
80
|
+
* Reads a templates record — `Sheet.templates(rows, { name, group?, values,
|
|
81
|
+
* source })`, usually over a bound record's `read()`: one card per row, in
|
|
82
|
+
* the record's key order, its key the row's key. `source` names the sheet's
|
|
83
|
+
* `Slice.bindRecords` source over the same record, which narrows these cards
|
|
84
|
+
* as it narrows anything of that record's (#1340, #1345). Each accessor is
|
|
85
|
+
* reified once, when the sheet is built.
|
|
86
|
+
*
|
|
87
|
+
* @typeParam R - The templates record's row type
|
|
88
|
+
* @typeParam P - The patch `values` returns
|
|
89
|
+
* @param rows - The templates record's rows, keyed by String
|
|
90
|
+
* @param config - The accessors, and the source that narrows the cards
|
|
91
|
+
* @returns The templates list
|
|
92
|
+
* @throws {Error} When the rows are not a Dict keyed by String
|
|
93
|
+
*/
|
|
94
|
+
export declare function sheetTemplates<R extends EastType, P extends EastType>(rows: SubtypeExprOrValue<DictType<StringType, R>>, config: SheetTemplatesConfig<R, P>): SheetTemplates<P>;
|
|
95
|
+
/**
|
|
96
|
+
* Whether a value is a templates list `Sheet.templates` declared.
|
|
97
|
+
*
|
|
98
|
+
* @param input - Anything `templates` was given
|
|
99
|
+
* @returns Whether it is one
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
export declare function isSheetTemplates(input: unknown): input is SheetTemplates;
|
|
46
103
|
/**
|
|
47
104
|
* One template on the wire: its card, and its seed — the draft and the row it
|
|
48
105
|
* drops, as `newRow`'s and `newGroup`'s constructors make them.
|
|
49
106
|
*
|
|
50
|
-
* @property key - The template's key
|
|
107
|
+
* @property key - The template's key: its row's key in its templates record
|
|
108
|
+
* @property source - The source of the sheet's slice its list follows: its key, one of that source's keys
|
|
51
109
|
* @property name - The card's name
|
|
52
110
|
* @property group - The Rows tab's group the card sits under
|
|
53
111
|
* @property cells - What the card shows: the template's own fields, through the columns' projection
|
|
@@ -55,6 +113,7 @@ export interface SheetTemplatesInput<L extends StructType, G extends StructType
|
|
|
55
113
|
*/
|
|
56
114
|
export declare const SheetTemplateWireType: StructType<{
|
|
57
115
|
readonly key: StringType;
|
|
116
|
+
readonly source: StringType;
|
|
58
117
|
readonly name: StringType;
|
|
59
118
|
readonly group: OptionType<StringType>;
|
|
60
119
|
readonly cells: DictType<StringType, VariantType<{
|
|
@@ -144,18 +203,23 @@ export interface SheetConstructors {
|
|
|
144
203
|
/** `newGroup`: the new group's context to its defaults. */
|
|
145
204
|
newGroup?: unknown;
|
|
146
205
|
}
|
|
206
|
+
/** A templates list, its source checked against the sheet's slice. */
|
|
207
|
+
export interface SheetTemplatesList {
|
|
208
|
+
/** The list. */
|
|
209
|
+
templates: SheetTemplates;
|
|
210
|
+
/** The source it follows, one of the slice's. */
|
|
211
|
+
source: string;
|
|
212
|
+
}
|
|
147
213
|
/**
|
|
148
|
-
* Builds the sheet's templates on the wire (SB9)
|
|
214
|
+
* Builds the sheet's templates on the wire (SB9): each list's, in the order
|
|
215
|
+
* the lists are given, each in its record's key order.
|
|
149
216
|
*
|
|
150
|
-
* @param
|
|
217
|
+
* @param lists - The templates lists, each with the source it follows, checked against the sheet's slice
|
|
151
218
|
* @param bridge - The sheet's bridge, as its root compiled it
|
|
152
219
|
* @param constructors - The sheet's `newRow` and `newGroup`, as its root checked them
|
|
153
|
-
* @returns The templates on the wire
|
|
154
|
-
* @throws Error naming the
|
|
220
|
+
* @returns The templates on the wire
|
|
221
|
+
* @throws Error naming the source: a list whose `values` set neither the row type (a grouped sheet's line type) nor the group type
|
|
155
222
|
* @internal
|
|
156
223
|
*/
|
|
157
|
-
export declare function buildTemplates(
|
|
158
|
-
rows?: SheetTemplate<StructType>[];
|
|
159
|
-
groups?: SheetTemplate<StructType>[];
|
|
160
|
-
} | undefined, bridge: SheetBridge, constructors: SheetConstructors): ExprType<ArrayType<SheetTemplateWireType>>;
|
|
224
|
+
export declare function buildTemplates(lists: readonly SheetTemplatesList[], bridge: SheetBridge, constructors: SheetConstructors): ExprType<ArrayType<SheetTemplateWireType>>;
|
|
161
225
|
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/sheet/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/sheet/templates.ts"],"names":[],"mapp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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;AAED,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IAC/B,gBAAgB;IAChB,SAAS,EAAE,cAAc,CAAC;IAC1B,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;CAClB;AA4ED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC1B,KAAK,EAAE,SAAS,kBAAkB,EAAE,EACpC,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,iBAAiB,GAChC,QAAQ,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAI5C"}
|
|
@@ -3,27 +3,71 @@
|
|
|
3
3
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* `<Sheet>`'s templates (#1183, `Sheet Builder Spec.md` §4.2, SB9):
|
|
7
|
-
* Rows tab's cards.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
6
|
+
* `<Sheet>`'s templates (#1183, #1345, `Sheet Builder Spec.md` §4.2, SB9):
|
|
7
|
+
* the Rows tab's cards. Templates are records (#1340): `Sheet.templates(rows,
|
|
8
|
+
* { name, group?, values, source })` reads one templates record — its rows the
|
|
9
|
+
* templates, its keys theirs — and names the source of the sheet's
|
|
10
|
+
* `Slice.bindRecords` that narrows the Rows tab's cards of it. A grouped
|
|
11
|
+
* sheet's row templates and group templates are two records, each its own
|
|
12
|
+
* source.
|
|
13
|
+
*
|
|
14
|
+
* A template is a row template — over the row type, a grouped sheet's line
|
|
15
|
+
* type — or a group template, over the group type with its lines, as its
|
|
16
|
+
* `values` patch's type says, as an author's tab's `drop` does. Each carries
|
|
17
|
+
* a seed built by the code that builds `newRow`'s and `newGroup`'s: the
|
|
18
|
+
* constructor's defaults first, the template's set fields over them. The
|
|
19
|
+
* cells its card shows are the template's own fields, through the columns'
|
|
20
|
+
* projection.
|
|
13
21
|
*
|
|
14
22
|
* @packageDocumentation
|
|
15
23
|
*/
|
|
16
|
-
import { ArrayType, DictType, East, Expr, FunctionType, OptionType, StringType, StructType, VariantType, isTypeEqual, none,
|
|
24
|
+
import { ArrayType, DictType, East, Expr, FunctionType, OptionType, StringType, StructType, VariantType, isTypeEqual, none, printType, variant, } from "@elaraai/east";
|
|
17
25
|
import { SheetCellType, SheetPatchTypeFor } from "./types.js";
|
|
18
26
|
import { SheetNewGroupType, SheetNewRowType } from "./transactions.js";
|
|
19
27
|
import { SheetSeedType } from "./editing-types.js";
|
|
20
28
|
import { buildSheetSeed } from "./seed-bridge.js";
|
|
21
29
|
import { buildPatchCells } from "./bridge.js";
|
|
30
|
+
/** Identifies a templates list, as `Sheet.templates` declares one. */
|
|
31
|
+
export const SHEET_TEMPLATES = Symbol("Sheet.templates");
|
|
32
|
+
/**
|
|
33
|
+
* Reads a templates record — `Sheet.templates(rows, { name, group?, values,
|
|
34
|
+
* source })`, usually over a bound record's `read()`: one card per row, in
|
|
35
|
+
* the record's key order, its key the row's key. `source` names the sheet's
|
|
36
|
+
* `Slice.bindRecords` source over the same record, which narrows these cards
|
|
37
|
+
* as it narrows anything of that record's (#1340, #1345). Each accessor is
|
|
38
|
+
* reified once, when the sheet is built.
|
|
39
|
+
*
|
|
40
|
+
* @typeParam R - The templates record's row type
|
|
41
|
+
* @typeParam P - The patch `values` returns
|
|
42
|
+
* @param rows - The templates record's rows, keyed by String
|
|
43
|
+
* @param config - The accessors, and the source that narrows the cards
|
|
44
|
+
* @returns The templates list
|
|
45
|
+
* @throws {Error} When the rows are not a Dict keyed by String
|
|
46
|
+
*/
|
|
47
|
+
export function sheetTemplates(rows, config) {
|
|
48
|
+
const source = East.value(rows);
|
|
49
|
+
const type = Expr.type(source);
|
|
50
|
+
if (type.type !== "Dict" || type.key.type !== "String") {
|
|
51
|
+
throw new Error(`Sheet.templates: rows must be a Dict keyed by String — a templates record's read(), its keys the templates' keys — and these are ${printType(type)}`);
|
|
52
|
+
}
|
|
53
|
+
return { [SHEET_TEMPLATES]: true, rows: source, config: config, source: config.source };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Whether a value is a templates list `Sheet.templates` declared.
|
|
57
|
+
*
|
|
58
|
+
* @param input - Anything `templates` was given
|
|
59
|
+
* @returns Whether it is one
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export function isSheetTemplates(input) {
|
|
63
|
+
return typeof input === "object" && input !== null && input[SHEET_TEMPLATES] === true;
|
|
64
|
+
}
|
|
22
65
|
/**
|
|
23
66
|
* One template on the wire: its card, and its seed — the draft and the row it
|
|
24
67
|
* drops, as `newRow`'s and `newGroup`'s constructors make them.
|
|
25
68
|
*
|
|
26
|
-
* @property key - The template's key
|
|
69
|
+
* @property key - The template's key: its row's key in its templates record
|
|
70
|
+
* @property source - The source of the sheet's slice its list follows: its key, one of that source's keys
|
|
27
71
|
* @property name - The card's name
|
|
28
72
|
* @property group - The Rows tab's group the card sits under
|
|
29
73
|
* @property cells - What the card shows: the template's own fields, through the columns' projection
|
|
@@ -31,6 +75,7 @@ import { buildPatchCells } from "./bridge.js";
|
|
|
31
75
|
*/
|
|
32
76
|
export const SheetTemplateWireType = StructType({
|
|
33
77
|
key: StringType,
|
|
78
|
+
source: StringType,
|
|
34
79
|
name: StringType,
|
|
35
80
|
group: OptionType(StringType),
|
|
36
81
|
cells: DictType(StringType, SheetCellType),
|
|
@@ -61,62 +106,61 @@ function overDefaults(contextType, rowType, values, defaults) {
|
|
|
61
106
|
return Object.fromEntries(fields.map((f) => [f, set[f].hasTag("some").ifElse(() => set[f], () => base[f])]));
|
|
62
107
|
});
|
|
63
108
|
}
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
109
|
+
/**
|
|
110
|
+
* One templates list on the wire: a card per row of its record, in key order,
|
|
111
|
+
* each a row template or a group template as the list's `values` say.
|
|
112
|
+
*/
|
|
113
|
+
function buildList(list, bridge, constructors) {
|
|
114
|
+
const { templates, source } = list;
|
|
115
|
+
const rowsType = Expr.type(templates.rows);
|
|
116
|
+
const rowType = rowsType.value;
|
|
117
|
+
const cfg = templates.config;
|
|
118
|
+
// The accessors, reified once: what each row's card is made by.
|
|
119
|
+
const values = East.function([rowType, StringType], undefined, (_$, row, key) => cfg.values(row, key));
|
|
120
|
+
const valuesType = Expr.type(values).output;
|
|
121
|
+
const groupHalf = bridge.group;
|
|
122
|
+
const kind = isTypeEqual(valuesType, SheetPatchTypeFor(bridge.lineType)) ? "row"
|
|
123
|
+
: groupHalf !== undefined && isTypeEqual(valuesType, SheetPatchTypeFor(groupHalf.groupType)) ? "group" : undefined;
|
|
124
|
+
if (kind === undefined) {
|
|
125
|
+
throw new Error(`Sheet: the templates of source '${source}' set ${printType(valuesType)} — build their values with Sheet.patch(RowType, …) over the sheet's row type (a grouped sheet: its line type)${groupHalf !== undefined ? ", or Sheet.patch(GroupType, …) for group templates" : ""}`);
|
|
71
126
|
}
|
|
72
|
-
|
|
127
|
+
// A row template's cells and seed are a row's; a group template's, its group's with its lines.
|
|
128
|
+
const rowKind = kind === "row";
|
|
129
|
+
const patchType = SheetPatchTypeFor(rowKind ? bridge.lineType : groupHalf.groupType);
|
|
130
|
+
const cellsOf = rowKind ? bridge.seedCells : buildPatchCells(groupHalf.groupType, groupHalf.cellMetas, {}, false);
|
|
131
|
+
const seedOf = (set) => (rowKind
|
|
132
|
+
? variant("row", buildSheetSeed(SheetNewRowType, bridge.lineType, overDefaults(SheetNewRowType, bridge.lineType, set, constructors.newRow), bridge.seedCells))
|
|
133
|
+
: variant("group", buildSheetSeed(SheetNewGroupType, groupHalf.groupType, overDefaults(SheetNewGroupType, groupHalf.groupType, set, constructors.newGroup), cellsOf, { field: groupHalf.linesField, project: bridge.projectRow })));
|
|
134
|
+
const named = East.function([rowType, StringType], StringType, (_$, row, key) => cfg.name(row, key));
|
|
135
|
+
const grouped = East.function([rowType, StringType], OptionType(StringType), (_$, row, key) => cfg.group === undefined ? East.value(none, OptionType(StringType)) : cfg.group(row, key));
|
|
136
|
+
const describe = East.function([rowType, StringType], SheetTemplateWireType, ($, row, key) => {
|
|
137
|
+
const valuesOf = $.const(values);
|
|
138
|
+
const set = $.const(valuesOf(row, key), patchType);
|
|
139
|
+
const nameOf = $.const(named);
|
|
140
|
+
const groupOf = $.const(grouped);
|
|
141
|
+
const cells = $.const(cellsOf);
|
|
142
|
+
return { key, source, name: nameOf(row, key), group: groupOf(row, key), cells: cells(set), seed: seedOf(set) };
|
|
143
|
+
});
|
|
144
|
+
return templates.rows.toArray(($, row, key) => {
|
|
145
|
+
const card = $.const(describe);
|
|
146
|
+
return card(row, key);
|
|
147
|
+
});
|
|
73
148
|
}
|
|
74
149
|
/**
|
|
75
|
-
* Builds the sheet's templates on the wire (SB9)
|
|
150
|
+
* Builds the sheet's templates on the wire (SB9): each list's, in the order
|
|
151
|
+
* the lists are given, each in its record's key order.
|
|
76
152
|
*
|
|
77
|
-
* @param
|
|
153
|
+
* @param lists - The templates lists, each with the source it follows, checked against the sheet's slice
|
|
78
154
|
* @param bridge - The sheet's bridge, as its root compiled it
|
|
79
155
|
* @param constructors - The sheet's `newRow` and `newGroup`, as its root checked them
|
|
80
|
-
* @returns The templates on the wire
|
|
81
|
-
* @throws Error naming the
|
|
156
|
+
* @returns The templates on the wire
|
|
157
|
+
* @throws Error naming the source: a list whose `values` set neither the row type (a grouped sheet's line type) nor the group type
|
|
82
158
|
* @internal
|
|
83
159
|
*/
|
|
84
|
-
export function buildTemplates(
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
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));
|
|
160
|
+
export function buildTemplates(lists, bridge, constructors) {
|
|
161
|
+
let out = East.value([], ArrayType(SheetTemplateWireType));
|
|
162
|
+
for (const list of lists)
|
|
163
|
+
out = out.concat(buildList(list, bridge, constructors));
|
|
164
|
+
return out;
|
|
121
165
|
}
|
|
122
166
|
//# sourceMappingURL=templates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/sheet/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/sheet/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;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,SAAS,EACT,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;AAEhE,sEAAsE;AACtE,MAAM,CAAC,MAAM,eAAe,GAAkB,MAAM,CAAC,iBAAiB,CAAC,CAAC;AA0DxE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,cAAc,CAC1B,IAAiD,EACjD,MAAkC;IAElC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAwD,CAAC;IACvF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAyB,CAAa,CAAC;IAC9D,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAK,IAAI,CAAC,GAAgB,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