@elaraai/east-ui 1.0.80 → 1.0.82
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/charts/chart/index.d.ts +4 -0
- package/dist/src/charts/chart/index.d.ts.map +1 -1
- package/dist/src/charts/spec/index.d.ts +8 -0
- package/dist/src/charts/spec/index.d.ts.map +1 -1
- package/dist/src/collections/deck/index.d.ts +8 -0
- package/dist/src/collections/deck/index.d.ts.map +1 -1
- package/dist/src/collections/index.d.ts +2 -2
- package/dist/src/collections/index.d.ts.map +1 -1
- package/dist/src/collections/index.js.map +1 -1
- package/dist/src/collections/library/index.d.ts +4 -0
- package/dist/src/collections/library/index.d.ts.map +1 -1
- package/dist/src/collections/library/types.d.ts +4 -0
- package/dist/src/collections/library/types.d.ts.map +1 -1
- package/dist/src/collections/matrix/index.d.ts +56 -19
- package/dist/src/collections/matrix/index.d.ts.map +1 -1
- package/dist/src/collections/matrix/index.js +38 -24
- package/dist/src/collections/matrix/index.js.map +1 -1
- package/dist/src/collections/plan/assemble.d.ts +655 -2113
- package/dist/src/collections/plan/assemble.d.ts.map +1 -1
- package/dist/src/collections/plan/assemble.js +159 -136
- package/dist/src/collections/plan/assemble.js.map +1 -1
- package/dist/src/collections/plan/builders.d.ts +193 -40
- package/dist/src/collections/plan/builders.d.ts.map +1 -1
- package/dist/src/collections/plan/builders.js +162 -32
- package/dist/src/collections/plan/builders.js.map +1 -1
- package/dist/src/collections/plan/factories.d.ts +290 -116
- package/dist/src/collections/plan/factories.d.ts.map +1 -1
- package/dist/src/collections/plan/factories.js +281 -156
- package/dist/src/collections/plan/factories.js.map +1 -1
- package/dist/src/collections/plan/index.d.ts +111 -58
- package/dist/src/collections/plan/index.d.ts.map +1 -1
- package/dist/src/collections/plan/index.js +62 -31
- package/dist/src/collections/plan/index.js.map +1 -1
- package/dist/src/collections/plan/ir.d.ts +759 -1769
- package/dist/src/collections/plan/ir.d.ts.map +1 -1
- package/dist/src/collections/plan/ir.js +51 -27
- package/dist/src/collections/plan/ir.js.map +1 -1
- package/dist/src/collections/plan/pick.d.ts +89 -71
- package/dist/src/collections/plan/pick.d.ts.map +1 -1
- package/dist/src/collections/plan/pick.js +101 -86
- package/dist/src/collections/plan/pick.js.map +1 -1
- package/dist/src/collections/plan/root.d.ts +164 -77
- package/dist/src/collections/plan/root.d.ts.map +1 -1
- package/dist/src/collections/plan/root.js +350 -42
- package/dist/src/collections/plan/root.js.map +1 -1
- package/dist/src/collections/plan/series.d.ts +12524 -10527
- package/dist/src/collections/plan/series.d.ts.map +1 -1
- package/dist/src/collections/plan/series.js +1596 -298
- package/dist/src/collections/plan/series.js.map +1 -1
- package/dist/src/collections/plan/types.d.ts +6115 -2802
- package/dist/src/collections/plan/types.d.ts.map +1 -1
- package/dist/src/collections/plan/types.js +575 -170
- package/dist/src/collections/plan/types.js.map +1 -1
- package/dist/src/collections/sheet/bridge.d.ts +154 -43
- package/dist/src/collections/sheet/bridge.d.ts.map +1 -1
- package/dist/src/collections/sheet/bridge.js +383 -240
- package/dist/src/collections/sheet/bridge.js.map +1 -1
- package/dist/src/collections/sheet/columns.d.ts +66 -16
- package/dist/src/collections/sheet/columns.d.ts.map +1 -1
- package/dist/src/collections/sheet/columns.js +25 -25
- package/dist/src/collections/sheet/columns.js.map +1 -1
- package/dist/src/collections/sheet/context-bridge.d.ts +48 -0
- package/dist/src/collections/sheet/context-bridge.d.ts.map +1 -0
- package/dist/src/collections/sheet/context-bridge.js +216 -0
- package/dist/src/collections/sheet/context-bridge.js.map +1 -0
- package/dist/src/collections/sheet/draft-bridge.d.ts +37 -0
- package/dist/src/collections/sheet/draft-bridge.d.ts.map +1 -0
- package/dist/src/collections/sheet/draft-bridge.js +153 -0
- package/dist/src/collections/sheet/draft-bridge.js.map +1 -0
- package/dist/src/collections/sheet/drafts.d.ts +14 -0
- package/dist/src/collections/sheet/drafts.d.ts.map +1 -0
- package/dist/src/collections/sheet/drafts.js +14 -0
- package/dist/src/collections/sheet/drafts.js.map +1 -0
- package/dist/src/collections/sheet/editing-bridge.d.ts +36 -0
- package/dist/src/collections/sheet/editing-bridge.d.ts.map +1 -0
- package/dist/src/collections/sheet/editing-bridge.js +196 -0
- package/dist/src/collections/sheet/editing-bridge.js.map +1 -0
- package/dist/src/collections/sheet/editing-types.d.ts +268 -0
- package/dist/src/collections/sheet/editing-types.d.ts.map +1 -0
- package/dist/src/collections/sheet/editing-types.js +34 -0
- package/dist/src/collections/sheet/editing-types.js.map +1 -0
- package/dist/src/collections/sheet/edits.d.ts +37 -0
- package/dist/src/collections/sheet/edits.d.ts.map +1 -0
- package/dist/src/collections/sheet/edits.js +31 -0
- package/dist/src/collections/sheet/edits.js.map +1 -0
- package/dist/src/collections/sheet/group.d.ts +165 -0
- package/dist/src/collections/sheet/group.d.ts.map +1 -0
- package/dist/src/collections/sheet/group.js +52 -0
- package/dist/src/collections/sheet/group.js.map +1 -0
- package/dist/src/collections/sheet/index.d.ts +171 -27
- package/dist/src/collections/sheet/index.d.ts.map +1 -1
- package/dist/src/collections/sheet/index.js +99 -17
- package/dist/src/collections/sheet/index.js.map +1 -1
- package/dist/src/collections/sheet/link.d.ts +22 -16
- package/dist/src/collections/sheet/link.d.ts.map +1 -1
- package/dist/src/collections/sheet/link.js +18 -12
- package/dist/src/collections/sheet/link.js.map +1 -1
- package/dist/src/collections/sheet/registers.d.ts +152 -5
- package/dist/src/collections/sheet/registers.d.ts.map +1 -1
- package/dist/src/collections/sheet/registers.js +154 -5
- package/dist/src/collections/sheet/registers.js.map +1 -1
- package/dist/src/collections/sheet/root.d.ts +175 -26
- package/dist/src/collections/sheet/root.d.ts.map +1 -1
- package/dist/src/collections/sheet/root.js +150 -26
- package/dist/src/collections/sheet/root.js.map +1 -1
- package/dist/src/collections/sheet/seed-bridge.d.ts +14 -0
- package/dist/src/collections/sheet/seed-bridge.d.ts.map +1 -0
- package/dist/src/collections/sheet/seed-bridge.js +51 -0
- package/dist/src/collections/sheet/seed-bridge.js.map +1 -0
- package/dist/src/collections/sheet/sub-rows.d.ts +249 -0
- package/dist/src/collections/sheet/sub-rows.d.ts.map +1 -0
- package/dist/src/collections/sheet/sub-rows.js +222 -0
- package/dist/src/collections/sheet/sub-rows.js.map +1 -0
- package/dist/src/collections/sheet/transactions.d.ts +76 -0
- package/dist/src/collections/sheet/transactions.d.ts.map +1 -0
- package/dist/src/collections/sheet/transactions.js +40 -0
- package/dist/src/collections/sheet/transactions.js.map +1 -0
- package/dist/src/collections/sheet/types.d.ts +12034 -3651
- package/dist/src/collections/sheet/types.d.ts.map +1 -1
- package/dist/src/collections/sheet/types.js +365 -48
- package/dist/src/collections/sheet/types.js.map +1 -1
- package/dist/src/collections/table/index.d.ts +98 -123
- package/dist/src/collections/table/index.d.ts.map +1 -1
- package/dist/src/collections/table/index.js +97 -111
- package/dist/src/collections/table/index.js.map +1 -1
- package/dist/src/collections/table/types.d.ts +87 -31
- package/dist/src/collections/table/types.d.ts.map +1 -1
- package/dist/src/collections/table/types.js +51 -26
- package/dist/src/collections/table/types.js.map +1 -1
- package/dist/src/collections/value-tree/flatten.d.ts.map +1 -1
- package/dist/src/collections/value-tree/flatten.js +4 -1
- package/dist/src/collections/value-tree/flatten.js.map +1 -1
- package/dist/src/component.d.ts +5075 -4079
- package/dist/src/component.d.ts.map +1 -1
- package/dist/src/component.js +46 -46
- package/dist/src/component.js.map +1 -1
- package/dist/src/contracts/approval.d.ts +10 -8
- package/dist/src/contracts/approval.d.ts.map +1 -1
- package/dist/src/contracts/approval.js +10 -8
- package/dist/src/contracts/approval.js.map +1 -1
- package/dist/src/contracts/drag.d.ts +11 -9
- package/dist/src/contracts/drag.d.ts.map +1 -1
- package/dist/src/contracts/drag.js +28 -21
- package/dist/src/contracts/drag.js.map +1 -1
- package/dist/src/contracts/editing.d.ts +1283 -0
- package/dist/src/contracts/editing.d.ts.map +1 -0
- package/dist/src/contracts/editing.js +711 -0
- package/dist/src/contracts/editing.js.map +1 -0
- package/dist/src/contracts/index.d.ts +2 -1
- package/dist/src/contracts/index.d.ts.map +1 -1
- package/dist/src/contracts/index.js +2 -1
- package/dist/src/contracts/index.js.map +1 -1
- package/dist/src/contracts/pick.d.ts +6 -7
- package/dist/src/contracts/pick.d.ts.map +1 -1
- package/dist/src/contracts/pick.js +6 -7
- package/dist/src/contracts/pick.js.map +1 -1
- package/dist/src/contracts/review.d.ts +3 -1
- package/dist/src/contracts/review.d.ts.map +1 -1
- package/dist/src/contracts/review.js +3 -1
- package/dist/src/contracts/review.js.map +1 -1
- package/dist/src/contracts/source.d.ts +270 -80
- package/dist/src/contracts/source.d.ts.map +1 -1
- package/dist/src/contracts/source.js +357 -58
- package/dist/src/contracts/source.js.map +1 -1
- package/dist/src/display/chip-rail/index.d.ts.map +1 -1
- package/dist/src/display/chip-rail/index.js +10 -10
- package/dist/src/display/chip-rail/index.js.map +1 -1
- package/dist/src/extension.d.ts +2 -1
- package/dist/src/extension.d.ts.map +1 -1
- package/dist/src/extension.js +2 -1
- package/dist/src/extension.js.map +1 -1
- package/dist/src/format/index.d.ts +1 -154
- package/dist/src/format/index.d.ts.map +1 -1
- package/dist/src/format/types.d.ts +35 -23
- package/dist/src/format/types.d.ts.map +1 -1
- package/dist/src/format/types.js +16 -14
- package/dist/src/format/types.js.map +1 -1
- package/dist/src/forms/field/index.js +4 -4
- package/dist/src/forms/field/index.js.map +1 -1
- package/dist/src/forms/file-upload/index.js +16 -16
- package/dist/src/forms/file-upload/index.js.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +8 -3
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +11 -3
- package/dist/src/internal.js.map +1 -1
- package/dist/src/layout/box/index.d.ts.map +1 -1
- package/dist/src/layout/box/index.js +47 -47
- package/dist/src/layout/box/index.js.map +1 -1
- package/dist/src/layout/flex/index.d.ts.map +1 -1
- package/dist/src/layout/flex/index.js +47 -47
- package/dist/src/layout/flex/index.js.map +1 -1
- package/dist/src/layout/grid/index.js +11 -11
- package/dist/src/layout/grid/index.js.map +1 -1
- package/dist/src/layout/scroll-area/index.d.ts.map +1 -1
- package/dist/src/layout/scroll-area/index.js +8 -8
- package/dist/src/layout/scroll-area/index.js.map +1 -1
- package/dist/src/layout/separator/index.d.ts.map +1 -1
- package/dist/src/layout/separator/index.js +6 -6
- package/dist/src/layout/separator/index.js.map +1 -1
- package/dist/src/layout/stack/index.d.ts.map +1 -1
- package/dist/src/layout/stack/index.js +46 -46
- package/dist/src/layout/stack/index.js.map +1 -1
- package/dist/src/layout/sticky/index.d.ts.map +1 -1
- package/dist/src/layout/sticky/index.js +8 -8
- package/dist/src/layout/sticky/index.js.map +1 -1
- package/dist/src/overlays/action-bar/index.d.ts.map +1 -1
- package/dist/src/overlays/action-bar/index.js +8 -8
- package/dist/src/overlays/action-bar/index.js.map +1 -1
- package/dist/src/platform/index.d.ts +1 -1
- package/dist/src/platform/index.d.ts.map +1 -1
- package/dist/src/platform/index.js +1 -1
- package/dist/src/platform/index.js.map +1 -1
- package/dist/src/platform/slice/impl.d.ts +62 -51
- package/dist/src/platform/slice/impl.d.ts.map +1 -1
- package/dist/src/platform/slice/impl.js +155 -72
- package/dist/src/platform/slice/impl.js.map +1 -1
- package/dist/src/platform/slice/index.d.ts +3744 -2226
- package/dist/src/platform/slice/index.d.ts.map +1 -1
- package/dist/src/platform/slice/index.js +43 -1
- package/dist/src/platform/slice/index.js.map +1 -1
- package/dist/src/runtime/collections/deck.d.ts +4 -0
- package/dist/src/runtime/collections/deck.d.ts.map +1 -1
- package/dist/src/runtime/collections/matrix.d.ts +10 -9
- package/dist/src/runtime/collections/matrix.d.ts.map +1 -1
- package/dist/src/runtime/collections/matrix.js +11 -6
- package/dist/src/runtime/collections/matrix.js.map +1 -1
- package/dist/src/runtime/collections/plan.d.ts +148 -65
- package/dist/src/runtime/collections/plan.d.ts.map +1 -1
- package/dist/src/runtime/collections/plan.js +155 -67
- package/dist/src/runtime/collections/plan.js.map +1 -1
- package/dist/src/runtime/collections/sheet.d.ts +56 -23
- package/dist/src/runtime/collections/sheet.d.ts.map +1 -1
- package/dist/src/runtime/collections/sheet.js +30 -22
- package/dist/src/runtime/collections/sheet.js.map +1 -1
- package/dist/src/runtime/collections/table.d.ts +18 -11
- package/dist/src/runtime/collections/table.d.ts.map +1 -1
- package/dist/src/runtime/collections/table.js +7 -4
- package/dist/src/runtime/collections/table.js.map +1 -1
- package/dist/src/shared/reify.d.ts +4 -46
- package/dist/src/shared/reify.d.ts.map +1 -1
- package/dist/src/shared/reify.js +4 -61
- package/dist/src/shared/reify.js.map +1 -1
- package/dist/src/shared/tree.d.ts +88 -0
- package/dist/src/shared/tree.d.ts.map +1 -0
- package/dist/src/shared/tree.js +134 -0
- package/dist/src/shared/tree.js.map +1 -0
- package/dist/src/slice/breakdown/index.d.ts +4 -0
- package/dist/src/slice/breakdown/index.d.ts.map +1 -1
- package/dist/src/slice/breakdown/types.d.ts +4 -0
- package/dist/src/slice/breakdown/types.d.ts.map +1 -1
- package/dist/src/slice/cohort/index.d.ts +24 -4
- package/dist/src/slice/cohort/index.d.ts.map +1 -1
- package/dist/src/slice/cohort/index.js +8 -4
- package/dist/src/slice/cohort/index.js.map +1 -1
- package/dist/src/slice/cohort/types.d.ts +11 -0
- package/dist/src/slice/cohort/types.d.ts.map +1 -1
- package/dist/src/slice/cohort/types.js +7 -0
- package/dist/src/slice/cohort/types.js.map +1 -1
- package/dist/src/slice/filter/index.d.ts +4 -0
- package/dist/src/slice/filter/index.d.ts.map +1 -1
- package/dist/src/slice/filter/types.d.ts +4 -0
- package/dist/src/slice/filter/types.d.ts.map +1 -1
- package/dist/src/slice/index.d.ts +736 -0
- package/dist/src/slice/index.d.ts.map +1 -1
- package/dist/src/slice/legend/index.d.ts +4 -0
- package/dist/src/slice/legend/index.d.ts.map +1 -1
- package/dist/src/slice/legend/types.d.ts +4 -0
- package/dist/src/slice/legend/types.d.ts.map +1 -1
- package/dist/src/slice/rail/index.d.ts +8 -4
- package/dist/src/slice/rail/index.d.ts.map +1 -1
- package/dist/src/slice/rail/index.js.map +1 -1
- package/dist/src/slice/range/index.d.ts +4 -0
- package/dist/src/slice/range/index.d.ts.map +1 -1
- package/dist/src/slice/range/types.d.ts +4 -0
- package/dist/src/slice/range/types.d.ts.map +1 -1
- package/dist/src/slice/search/index.d.ts +4 -0
- package/dist/src/slice/search/index.d.ts.map +1 -1
- package/dist/src/slice/search/types.d.ts +4 -0
- package/dist/src/slice/search/types.d.ts.map +1 -1
- package/dist/src/slice/summary/index.d.ts +4 -0
- package/dist/src/slice/summary/index.d.ts.map +1 -1
- package/dist/src/slice/summary/types.d.ts +4 -0
- package/dist/src/slice/summary/types.d.ts.map +1 -1
- package/dist/src/typography/code/index.js +1 -1
- package/dist/src/typography/code/index.js.map +1 -1
- package/dist/src/typography/code-block/index.js +7 -7
- package/dist/src/typography/code-block/index.js.map +1 -1
- package/dist/src/typography/heading/index.js +2 -2
- package/dist/src/typography/heading/index.js.map +1 -1
- package/dist/src/typography/list/index.js +1 -1
- package/dist/src/typography/list/index.js.map +1 -1
- package/dist/src/typography/mark/index.js +1 -1
- package/dist/src/typography/mark/index.js.map +1 -1
- package/dist/src/typography/note/index.js +1 -1
- package/dist/src/typography/note/index.js.map +1 -1
- package/dist/src/typography/numeric/index.d.ts +3 -308
- package/dist/src/typography/numeric/index.d.ts.map +1 -1
- package/dist/src/typography/numeric/index.js +4 -4
- package/dist/src/typography/numeric/index.js.map +1 -1
- package/dist/src/typography/numeric/types.d.ts +1 -154
- package/dist/src/typography/numeric/types.d.ts.map +1 -1
- package/dist/src/typography/text/index.js +1 -1
- package/dist/src/typography/text/index.js.map +1 -1
- package/dist/test/collections/matrix.examples.d.ts +7 -3
- package/dist/test/collections/matrix.examples.d.ts.map +1 -1
- package/dist/test/collections/matrix.examples.js +55 -24
- package/dist/test/collections/matrix.examples.js.map +1 -1
- package/dist/test/collections/paged-source.examples.d.ts +4 -0
- package/dist/test/collections/paged-source.examples.d.ts.map +1 -1
- package/dist/test/collections/paged-source.examples.js +98 -13
- package/dist/test/collections/paged-source.examples.js.map +1 -1
- package/dist/test/collections/plan.examples.d.ts +101 -26
- package/dist/test/collections/plan.examples.d.ts.map +1 -1
- package/dist/test/collections/plan.examples.js +1481 -755
- package/dist/test/collections/plan.examples.js.map +1 -1
- package/dist/test/collections/sheet-link.examples.d.ts +7 -0
- package/dist/test/collections/sheet-link.examples.d.ts.map +1 -0
- package/dist/test/collections/sheet-link.examples.js +41 -0
- package/dist/test/collections/sheet-link.examples.js.map +1 -0
- package/dist/test/collections/sheet-transactions.examples.d.ts +7 -0
- package/dist/test/collections/sheet-transactions.examples.d.ts.map +1 -0
- package/dist/test/collections/sheet-transactions.examples.js +58 -0
- package/dist/test/collections/sheet-transactions.examples.js.map +1 -0
- package/dist/test/collections/sheet.examples.d.ts +52 -5
- package/dist/test/collections/sheet.examples.d.ts.map +1 -1
- package/dist/test/collections/sheet.examples.js +500 -158
- package/dist/test/collections/sheet.examples.js.map +1 -1
- package/dist/test/collections/table.examples.d.ts +31 -3
- package/dist/test/collections/table.examples.d.ts.map +1 -1
- package/dist/test/collections/table.examples.js +188 -28
- package/dist/test/collections/table.examples.js.map +1 -1
- package/dist/test/contracts/editing.examples.d.ts +7 -0
- package/dist/test/contracts/editing.examples.d.ts.map +1 -0
- package/dist/test/contracts/editing.examples.js +58 -0
- package/dist/test/contracts/editing.examples.js.map +1 -0
- package/dist/test/layout/splitter.examples.d.ts.map +1 -1
- package/dist/test/layout/splitter.examples.js +3 -1
- package/dist/test/layout/splitter.examples.js.map +1 -1
- package/dist/test/platform/slice.examples.d.ts.map +1 -1
- package/dist/test/platform/slice.examples.js +1 -0
- package/dist/test/platform/slice.examples.js.map +1 -1
- package/dist/test/slice/slice.examples.d.ts.map +1 -1
- package/dist/test/slice/slice.examples.js +5 -2
- package/dist/test/slice/slice.examples.js.map +1 -1
- package/package.json +4 -3
- package/dist/src/collections/plan/data-forms.d.ts +0 -332
- package/dist/src/collections/plan/data-forms.d.ts.map +0 -1
- package/dist/src/collections/plan/data-forms.js +0 -212
- package/dist/src/collections/plan/data-forms.js.map +0 -1
|
@@ -41,13 +41,88 @@ const dedupeMembers = East.function([SheetRegisterMembersType], SheetRegisterMem
|
|
|
41
41
|
* @returns The members, as an expression
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
*
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // .tsx file with the `@jsxImportSource @elaraai/east-ui` pragma
|
|
46
|
+
* import { ArrayType, DateTimeType, DictType, East, FloatType, IntegerType, OptionType, StringType, StructType, none, some, variant } from "@elaraai/east";
|
|
47
|
+
* import { Reactive, Sheet, State, UIComponentType } from "@elaraai/east-ui";
|
|
48
|
+
*
|
|
49
|
+
* const sheet = East.function([], UIComponentType, (_$) => (
|
|
50
|
+
* <Reactive>{$ => {
|
|
51
|
+
* const JobType = StructType({
|
|
52
|
+
* id: StringType, activity: StringType, start: OptionType(DateTimeType), end: OptionType(DateTimeType),
|
|
53
|
+
* qty: OptionType(FloatType), machines: Sheet.Types.Link,
|
|
54
|
+
* });
|
|
55
|
+
* const ActivityType = StructType({ name: StringType, uom: StringType, days: IntegerType });
|
|
56
|
+
* const MachineType = StructType({ code: StringType, family: StringType, line: StringType });
|
|
57
|
+
* const LineType = StructType({ name: StringType, aliases: ArrayType(StringType) });
|
|
58
|
+
* const activities = $.const([
|
|
59
|
+
* { name: "Machining", uom: "pcs", days: 4n },
|
|
60
|
+
* { name: "Inspection", uom: "lots", days: 1n },
|
|
61
|
+
* ], ArrayType(ActivityType));
|
|
62
|
+
* const machines = $.const([
|
|
63
|
+
* { code: "M2140", family: "CNC lathe", line: "L2" },
|
|
64
|
+
* { code: "M2141", family: "CNC lathe", line: "L2" },
|
|
65
|
+
* { code: "M3210", family: "5-axis mill", line: "L3" },
|
|
66
|
+
* ], ArrayType(MachineType));
|
|
67
|
+
* const lines = $.const(new Map([
|
|
68
|
+
* ["L2", { name: "Line 2", aliases: ["l2", "line 2"] }],
|
|
69
|
+
* ["L3", { name: "Line 3", aliases: ["l3", "line 3"] }],
|
|
70
|
+
* ]), DictType(StringType, LineType));
|
|
71
|
+
* const jobs = $.let(State.bind([ArrayType(JobType)], "sheet_registers_jobs", [
|
|
72
|
+
* { id: "j1", activity: "Machining", start: some(new Date("2026-02-16T00:00:00Z")), end: none, qty: some(1200.0),
|
|
73
|
+
* machines: { from: [], to: [variant("counted", { n: 2n, key: "CNC lathe" })] } },
|
|
74
|
+
* ]));
|
|
75
|
+
* // The driver's row reaches a fill typed: End = Start + the activity's days.
|
|
76
|
+
* const DateFill = OptionType(Sheet.Types.Fill(DateTimeType));
|
|
77
|
+
* const endFromStart = $.const(East.function([Sheet.Types.DraftContext(JobType, ActivityType)], DateFill, ($, ctx) => {
|
|
78
|
+
* const noFill = $.const(none, DateFill);
|
|
79
|
+
* return ctx.row.start.match({
|
|
80
|
+
* value: (_$, supplied) => supplied.match({
|
|
81
|
+
* none: () => noFill,
|
|
82
|
+
* some: (_$, start) => ctx.driver.match({
|
|
83
|
+
* none: () => noFill,
|
|
84
|
+
* some: (_$, d) => some({ value: start.addDays(d.days), meta: East.str`+${d.days}d · ${d.name}` }),
|
|
85
|
+
* }),
|
|
86
|
+
* }),
|
|
87
|
+
* }, () => noFill);
|
|
88
|
+
* }));
|
|
89
|
+
* const newJob = $.const(East.function([Sheet.Types.NewRow], Sheet.Types.Patch(JobType), () => Sheet.patch(JobType, { machines: { from: [], to: [] } })));
|
|
90
|
+
* return (
|
|
91
|
+
* <Sheet
|
|
92
|
+
* data={jobs}
|
|
93
|
+
* id="id"
|
|
94
|
+
* driver={Sheet.driver("activity", activities, { key: a => a.name, label: a => a.name, meta: a => some(a.uom) })}
|
|
95
|
+
* registers={{
|
|
96
|
+
* machines: Sheet.register.concat([
|
|
97
|
+
* Sheet.register.members(machines, { kind: "machine", key: m => m.code, label: m => m.code,
|
|
98
|
+
* meta: m => some(m.family), parent: m => some(m.line) }),
|
|
99
|
+
* // A Dict's key rides as the accessors' second argument.
|
|
100
|
+
* Sheet.register.members(lines, { kind: "line", key: (_l, code) => code, label: l => l.name, aliases: l => l.aliases }),
|
|
101
|
+
* // Both lathes name one family — duplicate keys fold, the first wins.
|
|
102
|
+
* Sheet.register.members(machines, { kind: "family", key: m => m.family, label: m => m.family, meta: _m => some("family") }),
|
|
103
|
+
* ]),
|
|
104
|
+
* }}
|
|
105
|
+
* columns={{
|
|
106
|
+
* activity: Sheet.column.lookup(JobType, { header: "Activity", width: "140px" }),
|
|
107
|
+
* start: Sheet.column.date(JobType, { header: "Start", width: "96px" }),
|
|
108
|
+
* end: Sheet.column.date(JobType, { header: "End", sub: "start + days", width: "96px", base: "start", fill: [endFromStart] }),
|
|
109
|
+
* qty: Sheet.column.quantity(JobType, ActivityType, { header: "Qty", sub: "uom per activity", width: "112px", uom: d => d.uom }),
|
|
110
|
+
* machines: Sheet.column.set(JobType, "machines", { header: "Machines", sub: "M2140 · 2 x lathe · line 2", width: "240px",
|
|
111
|
+
* members: [{ kind: "machine", identified: true }, { kind: "line", countable: true, resolvesTo: "machine" },
|
|
112
|
+
* { kind: "family", countable: true, resolvesTo: "machine" }] }),
|
|
113
|
+
* }}
|
|
114
|
+
* newRow={newJob}
|
|
115
|
+
* onUpdate={jobs.write}
|
|
116
|
+
* />
|
|
117
|
+
* );
|
|
118
|
+
* }}</Reactive>
|
|
119
|
+
* ));
|
|
47
120
|
* ```
|
|
48
121
|
*/
|
|
49
122
|
export function createMembers(data, config) {
|
|
50
123
|
const expr = East.value(data);
|
|
124
|
+
// The data is an Array or a Dict whatever the cast above says: widen to
|
|
125
|
+
// read its real East type.
|
|
51
126
|
const t = Expr.type(expr);
|
|
52
127
|
if (t.type !== "Array" && t.type !== "Dict") {
|
|
53
128
|
throw new Error(`Sheet.register.members: data must be an Array or a Dict<String, T> — got a ${t.type}`);
|
|
@@ -94,8 +169,82 @@ export function concatMembers(parts) {
|
|
|
94
169
|
* @returns The driver declaration the `driver` prop takes
|
|
95
170
|
*
|
|
96
171
|
* @example
|
|
97
|
-
* ```
|
|
98
|
-
*
|
|
172
|
+
* ```tsx
|
|
173
|
+
* // .tsx file with the `@jsxImportSource @elaraai/east-ui` pragma
|
|
174
|
+
* import { ArrayType, DateTimeType, DictType, East, FloatType, IntegerType, OptionType, StringType, StructType, none, some, variant } from "@elaraai/east";
|
|
175
|
+
* import { Reactive, Sheet, State, UIComponentType } from "@elaraai/east-ui";
|
|
176
|
+
*
|
|
177
|
+
* const sheet = East.function([], UIComponentType, (_$) => (
|
|
178
|
+
* <Reactive>{$ => {
|
|
179
|
+
* const JobType = StructType({
|
|
180
|
+
* id: StringType, activity: StringType, start: OptionType(DateTimeType), end: OptionType(DateTimeType),
|
|
181
|
+
* qty: OptionType(FloatType), machines: Sheet.Types.Link,
|
|
182
|
+
* });
|
|
183
|
+
* const ActivityType = StructType({ name: StringType, uom: StringType, days: IntegerType });
|
|
184
|
+
* const MachineType = StructType({ code: StringType, family: StringType, line: StringType });
|
|
185
|
+
* const LineType = StructType({ name: StringType, aliases: ArrayType(StringType) });
|
|
186
|
+
* const activities = $.const([
|
|
187
|
+
* { name: "Machining", uom: "pcs", days: 4n },
|
|
188
|
+
* { name: "Inspection", uom: "lots", days: 1n },
|
|
189
|
+
* ], ArrayType(ActivityType));
|
|
190
|
+
* const machines = $.const([
|
|
191
|
+
* { code: "M2140", family: "CNC lathe", line: "L2" },
|
|
192
|
+
* { code: "M2141", family: "CNC lathe", line: "L2" },
|
|
193
|
+
* { code: "M3210", family: "5-axis mill", line: "L3" },
|
|
194
|
+
* ], ArrayType(MachineType));
|
|
195
|
+
* const lines = $.const(new Map([
|
|
196
|
+
* ["L2", { name: "Line 2", aliases: ["l2", "line 2"] }],
|
|
197
|
+
* ["L3", { name: "Line 3", aliases: ["l3", "line 3"] }],
|
|
198
|
+
* ]), DictType(StringType, LineType));
|
|
199
|
+
* const jobs = $.let(State.bind([ArrayType(JobType)], "sheet_registers_jobs", [
|
|
200
|
+
* { id: "j1", activity: "Machining", start: some(new Date("2026-02-16T00:00:00Z")), end: none, qty: some(1200.0),
|
|
201
|
+
* machines: { from: [], to: [variant("counted", { n: 2n, key: "CNC lathe" })] } },
|
|
202
|
+
* ]));
|
|
203
|
+
* // The driver's row reaches a fill typed: End = Start + the activity's days.
|
|
204
|
+
* const DateFill = OptionType(Sheet.Types.Fill(DateTimeType));
|
|
205
|
+
* const endFromStart = $.const(East.function([Sheet.Types.DraftContext(JobType, ActivityType)], DateFill, ($, ctx) => {
|
|
206
|
+
* const noFill = $.const(none, DateFill);
|
|
207
|
+
* return ctx.row.start.match({
|
|
208
|
+
* value: (_$, supplied) => supplied.match({
|
|
209
|
+
* none: () => noFill,
|
|
210
|
+
* some: (_$, start) => ctx.driver.match({
|
|
211
|
+
* none: () => noFill,
|
|
212
|
+
* some: (_$, d) => some({ value: start.addDays(d.days), meta: East.str`+${d.days}d · ${d.name}` }),
|
|
213
|
+
* }),
|
|
214
|
+
* }),
|
|
215
|
+
* }, () => noFill);
|
|
216
|
+
* }));
|
|
217
|
+
* const newJob = $.const(East.function([Sheet.Types.NewRow], Sheet.Types.Patch(JobType), () => Sheet.patch(JobType, { machines: { from: [], to: [] } })));
|
|
218
|
+
* return (
|
|
219
|
+
* <Sheet
|
|
220
|
+
* data={jobs}
|
|
221
|
+
* id="id"
|
|
222
|
+
* driver={Sheet.driver("activity", activities, { key: a => a.name, label: a => a.name, meta: a => some(a.uom) })}
|
|
223
|
+
* registers={{
|
|
224
|
+
* machines: Sheet.register.concat([
|
|
225
|
+
* Sheet.register.members(machines, { kind: "machine", key: m => m.code, label: m => m.code,
|
|
226
|
+
* meta: m => some(m.family), parent: m => some(m.line) }),
|
|
227
|
+
* // A Dict's key rides as the accessors' second argument.
|
|
228
|
+
* Sheet.register.members(lines, { kind: "line", key: (_l, code) => code, label: l => l.name, aliases: l => l.aliases }),
|
|
229
|
+
* // Both lathes name one family — duplicate keys fold, the first wins.
|
|
230
|
+
* Sheet.register.members(machines, { kind: "family", key: m => m.family, label: m => m.family, meta: _m => some("family") }),
|
|
231
|
+
* ]),
|
|
232
|
+
* }}
|
|
233
|
+
* columns={{
|
|
234
|
+
* activity: Sheet.column.lookup(JobType, { header: "Activity", width: "140px" }),
|
|
235
|
+
* start: Sheet.column.date(JobType, { header: "Start", width: "96px" }),
|
|
236
|
+
* end: Sheet.column.date(JobType, { header: "End", sub: "start + days", width: "96px", base: "start", fill: [endFromStart] }),
|
|
237
|
+
* qty: Sheet.column.quantity(JobType, ActivityType, { header: "Qty", sub: "uom per activity", width: "112px", uom: d => d.uom }),
|
|
238
|
+
* machines: Sheet.column.set(JobType, "machines", { header: "Machines", sub: "M2140 · 2 x lathe · line 2", width: "240px",
|
|
239
|
+
* members: [{ kind: "machine", identified: true }, { kind: "line", countable: true, resolvesTo: "machine" },
|
|
240
|
+
* { kind: "family", countable: true, resolvesTo: "machine" }] }),
|
|
241
|
+
* }}
|
|
242
|
+
* newRow={newJob}
|
|
243
|
+
* onUpdate={jobs.write}
|
|
244
|
+
* />
|
|
245
|
+
* );
|
|
246
|
+
* }}</Reactive>
|
|
247
|
+
* ));
|
|
99
248
|
* ```
|
|
100
249
|
*/
|
|
101
250
|
export function createDriver(column, data, config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registers.js","sourceRoot":"","sources":["../../../../src/collections/sheet/registers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EAIH,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,OAAO,EACP,UAAU,EACV,UAAU,EACV,IAAI,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,uBAAuB,E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AAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzF,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
* `component.ts` (`Sheet Spec.md` §4.6): resolves the row source (both
|
|
8
8
|
* arms), describes every column against the row type, compiles the typed
|
|
9
9
|
* bridge (§4.8), builds each column's wire value, compiles `onUpdate` into
|
|
10
|
-
* the
|
|
10
|
+
* the checked batch adapter (§4.7), and refuses every mistake naming the
|
|
11
11
|
* column and the remedy.
|
|
12
12
|
*
|
|
13
13
|
* @packageDocumentation
|
|
14
14
|
*/
|
|
15
|
-
import { type ExprType, type SubtypeExprOrValue, ArrayType, AsyncFunctionType, BooleanType, DictType, FunctionType, IntegerType, NullType, OptionType, StringType, StructType } from "@elaraai/east";
|
|
15
|
+
import { type EastType, type ExprType, type SubtypeExprOrValue, ArrayType, AsyncFunctionType, BooleanType, DictType, FunctionType, IntegerType, NullType, OptionType, StringType, StructType } from "@elaraai/east";
|
|
16
16
|
import { UIComponentType } from "../../component.js";
|
|
17
17
|
import { SliceBindType } from "../../platform/slice/index.js";
|
|
18
18
|
import { type SliceAffordanceLiteral } from "../../contracts/slice-affordances.js";
|
|
@@ -20,9 +20,14 @@ import { DensityType, type DensityLiteral } from "../../style/interaction.js";
|
|
|
20
20
|
import { StatusValueType, type StatusValueLiteral } from "../../feedback/status/types.js";
|
|
21
21
|
import { type PagedSource } from "../../contracts/source.js";
|
|
22
22
|
import type { DataRowType } from "../table/index.js";
|
|
23
|
-
import { SheetViewType, SheetSelectionType, type
|
|
23
|
+
import { SheetViewType, SheetSelectionType, type SheetAnyContextOf, type SheetProposalOf, type SheetPatchOf, type SheetLinesField, type SheetLineOf, type SheetEntryOf } from "./types.js";
|
|
24
24
|
import type { SheetColumnSpec, SheetFieldKey } from "./columns.js";
|
|
25
25
|
import type { SheetDriverValue, SheetRegisterValue } from "./registers.js";
|
|
26
|
+
import type { SheetGroupValue } from "./group.js";
|
|
27
|
+
import type { SheetSubRowsValue } from "./sub-rows.js";
|
|
28
|
+
import type { SheetEditsInput } from "./edits.js";
|
|
29
|
+
import { SheetApplyResultType, SheetNewRowType, SheetNewGroupType, SheetReadinessType, type SheetDraftOf, type SheetChangeSetTypeFor } from "./transactions.js";
|
|
30
|
+
import type { SheetPatchEventTypeFor, SheetDraftEntryOf } from "./drafts.js";
|
|
26
31
|
/** The keys of a row struct whose field is a `String` — what `id` may name. */
|
|
27
32
|
export type SheetStringField<R extends StructType> = {
|
|
28
33
|
[K in SheetFieldKey<R>]: R["fields"][K] extends StringType ? K : never;
|
|
@@ -32,9 +37,9 @@ export type SheetStringField<R extends StructType> = {
|
|
|
32
37
|
* `Sheet.Types.Context(R, D)` to `Array<Sheet.Types.Proposal(R)>` (§3.6).
|
|
33
38
|
* The driver type is checked at build time against the sheet's driver.
|
|
34
39
|
*
|
|
35
|
-
* @typeParam R - The host's row type
|
|
40
|
+
* @typeParam R - The host's row type (a grouped sheet: the line type)
|
|
36
41
|
*/
|
|
37
|
-
export type SheetProposerInput<R extends StructType> = SubtypeExprOrValue<FunctionType<[
|
|
42
|
+
export type SheetProposerInput<R extends StructType> = SubtypeExprOrValue<FunctionType<[SheetAnyContextOf<R>], ArrayType<SheetProposalOf<R>>>> | SubtypeExprOrValue<AsyncFunctionType<[SheetAnyContextOf<R>], ArrayType<SheetProposalOf<R>>>>;
|
|
38
43
|
/**
|
|
39
44
|
* The copilot's row-proposal declaration (B§5.2).
|
|
40
45
|
*
|
|
@@ -54,6 +59,21 @@ export interface SheetSuggestInput<R extends StructType> {
|
|
|
54
59
|
/** The proposers; the first that returns rows wins. */
|
|
55
60
|
propose: SheetProposerInput<R>[];
|
|
56
61
|
}
|
|
62
|
+
/** Business readiness checks add requirements without bypassing structural validity.
|
|
63
|
+
* @typeParam R - The row struct (a grouped sheet's child struct)
|
|
64
|
+
* @typeParam G - The group draft schema, when grouping is enabled
|
|
65
|
+
*/
|
|
66
|
+
export interface SheetReadyInput<R extends StructType, G extends EastType = never> {
|
|
67
|
+
/**
|
|
68
|
+
* Check a row draft and its current draft-aware context. Every check of
|
|
69
|
+
* one evaluation runs in one call over the same `rows` (#882): read
|
|
70
|
+
* them, never sort or edit them in place, or the checks after it see the
|
|
71
|
+
* change. A check that throws marks its own row invalid.
|
|
72
|
+
*/
|
|
73
|
+
row?: SubtypeExprOrValue<FunctionType<[SheetDraftOf<R>, SheetAnyContextOf<R>], typeof SheetReadinessType>>;
|
|
74
|
+
/** Check the group's own draft fields; child issues are checked separately. */
|
|
75
|
+
group?: [G] extends [never] ? never : SubtypeExprOrValue<FunctionType<[G], typeof SheetReadinessType>>;
|
|
76
|
+
}
|
|
57
77
|
/**
|
|
58
78
|
* The options of `Sheet.Root` / the `<Sheet>` tag's props beside `data` and
|
|
59
79
|
* `columns` (§3).
|
|
@@ -70,10 +90,11 @@ export interface SheetSuggestInput<R extends StructType> {
|
|
|
70
90
|
* @property activeView - The active view's id
|
|
71
91
|
* @property onViewsChange - Views changed
|
|
72
92
|
* @property onUpdate - The whole collection with the edit applied (inline arm only)
|
|
73
|
-
* @property onEdit - The raw edit event, typed over the row (either arm)
|
|
74
93
|
* @property onSelect - The ring moved
|
|
75
94
|
* @property selection - Controlled selection (§3.14)
|
|
76
95
|
* @property newRowId - Overrides the renderer's id minting for inserted rows
|
|
96
|
+
* @property group - Never on a flat sheet — grouped rows take {@link SheetGroupedOptions}
|
|
97
|
+
* @property subRows - Read-only sub rows under each row, from its array fields (`Sheet.subRows`, #844)
|
|
77
98
|
* @property readOnly - The whole sheet is read-only
|
|
78
99
|
* @property blanks - Padding rows below the last real one (default 18)
|
|
79
100
|
* @property density - Row rhythm
|
|
@@ -81,6 +102,8 @@ export interface SheetSuggestInput<R extends StructType> {
|
|
|
81
102
|
* @property style - Sizing and the gutter width
|
|
82
103
|
*/
|
|
83
104
|
export interface SheetOptions<R extends StructType> {
|
|
105
|
+
/** Structural capabilities; defaults depend on grouping and source ordering. */
|
|
106
|
+
edits?: SheetEditsInput;
|
|
84
107
|
/** The `String` field that identifies a row. */
|
|
85
108
|
id?: SheetStringField<R>;
|
|
86
109
|
/** Rows the upstream system owns — an accessor. */
|
|
@@ -103,14 +126,26 @@ export interface SheetOptions<R extends StructType> {
|
|
|
103
126
|
onViewsChange?: SubtypeExprOrValue<FunctionType<[ArrayType<SheetViewType>], NullType>>;
|
|
104
127
|
/** The whole collection with the edit applied (inline arm only). */
|
|
105
128
|
onUpdate?: SubtypeExprOrValue<FunctionType<[ArrayType<R>], NullType>>;
|
|
106
|
-
/**
|
|
107
|
-
|
|
129
|
+
/** Observe one gesture's draft and domain patches; this does not authorize writes. */
|
|
130
|
+
onPatch?: SubtypeExprOrValue<FunctionType<[ReturnType<typeof SheetPatchEventTypeFor<R>>], NullType>>;
|
|
131
|
+
/** Submit one checked, idempotent batch to the authoritative source. */
|
|
132
|
+
onApply?: SubtypeExprOrValue<FunctionType<[ReturnType<typeof SheetChangeSetTypeFor<R>>], typeof SheetApplyResultType>> | SubtypeExprOrValue<AsyncFunctionType<[ReturnType<typeof SheetChangeSetTypeFor<R>>], typeof SheetApplyResultType>>;
|
|
133
|
+
/** Batch by default; auto submits complete gestures through the same checked protocol. */
|
|
134
|
+
applyMode?: "batch" | "auto";
|
|
108
135
|
/** The ring moved. */
|
|
109
136
|
onSelect?: SubtypeExprOrValue<FunctionType<[SheetSelectionType], NullType>>;
|
|
110
137
|
/** Controlled selection. */
|
|
111
138
|
selection?: SubtypeExprOrValue<OptionType<SheetSelectionType>>;
|
|
139
|
+
/** Additional author requirements; structural completeness always remains mandatory. */
|
|
140
|
+
ready?: SheetReadyInput<R>;
|
|
141
|
+
/** Explicit defaults for new rows, including required fields without columns. */
|
|
142
|
+
newRow?: SubtypeExprOrValue<FunctionType<[typeof SheetNewRowType], SheetPatchOf<R>>>;
|
|
112
143
|
/** Overrides the renderer's id minting for inserted rows. */
|
|
113
144
|
newRowId?: SubtypeExprOrValue<FunctionType<[], StringType>>;
|
|
145
|
+
/** Never on a flat sheet — grouped rows take {@link SheetGroupedOptions}. */
|
|
146
|
+
group?: never;
|
|
147
|
+
/** Read-only sub rows under each row, from its array fields. */
|
|
148
|
+
subRows?: SheetSubRowsValue<R>;
|
|
114
149
|
/** The whole sheet is read-only. */
|
|
115
150
|
readOnly?: SubtypeExprOrValue<BooleanType> | boolean;
|
|
116
151
|
/** Padding rows below the last real one. */
|
|
@@ -134,8 +169,64 @@ export interface SheetOptions<R extends StructType> {
|
|
|
134
169
|
gutterWidth?: SubtypeExprOrValue<StringType>;
|
|
135
170
|
};
|
|
136
171
|
}
|
|
137
|
-
/**
|
|
138
|
-
|
|
172
|
+
/**
|
|
173
|
+
* The options of a GROUPED sheet (#740) — `Sheet.Root(plans, lineColumns,
|
|
174
|
+
* { group: Sheet.group(P, "lines", …), … })`: the group `P` is the row,
|
|
175
|
+
* `columns` are declared over the line type its lines field holds, and the
|
|
176
|
+
* edit channel addresses lines within their group.
|
|
177
|
+
*
|
|
178
|
+
* @typeParam P - The group's row type
|
|
179
|
+
* @typeParam F - The lines field
|
|
180
|
+
* @property group - The group declaration (`Sheet.group`)
|
|
181
|
+
* @property suggest - The row-proposal declaration, over the LINE type
|
|
182
|
+
* @property onUpdate - The whole collection of groups with the edit applied (inline arm only)
|
|
183
|
+
* @property subRows - Read-only sub rows under each LINE, declared over the line type (#844)
|
|
184
|
+
*/
|
|
185
|
+
export interface SheetGroupedOptions<P extends StructType, F extends SheetLinesField<P>> extends Omit<SheetOptions<P>, "group" | "suggest" | "onPatch" | "newRow" | "ready" | "subRows"> {
|
|
186
|
+
/** Additional row and group requirements over complete field drafts. */
|
|
187
|
+
ready?: SheetReadyInput<SheetLineOf<P, F>, SheetDraftEntryOf<P, F>>;
|
|
188
|
+
/** Explicit defaults for each new child row. */
|
|
189
|
+
newRow?: SubtypeExprOrValue<FunctionType<[typeof SheetNewRowType], SheetPatchOf<SheetLineOf<P, F>>>>;
|
|
190
|
+
/** Explicit defaults for a new group. */
|
|
191
|
+
newGroup?: SubtypeExprOrValue<FunctionType<[typeof SheetNewGroupType], SheetPatchOf<P>>>;
|
|
192
|
+
/** The group declaration. */
|
|
193
|
+
group: SheetGroupValue<P, F>;
|
|
194
|
+
/** The row-proposal declaration, over the line type. */
|
|
195
|
+
suggest?: SheetSuggestInput<SheetLineOf<P, F>>;
|
|
196
|
+
/** Observe a gesture with drafts over this group's child array. */
|
|
197
|
+
onPatch?: SubtypeExprOrValue<FunctionType<[ReturnType<typeof SheetPatchEventTypeFor<P, F>>], NullType>>;
|
|
198
|
+
/** Read-only sub rows under each line, declared over the line type. */
|
|
199
|
+
subRows?: SheetSubRowsValue<SheetLineOf<P, F>>;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* The options of a sheet with LOOSE rows between its groups (#846) —
|
|
203
|
+
* `Sheet.Root(entries, lineColumns, { group: Sheet.group(P, "lines", …), … })`
|
|
204
|
+
* over entries `Sheet.Types.Entry(P, "lines")`: each entry a group, or a row
|
|
205
|
+
* of the line type standing between the groups. Everything a grouped sheet
|
|
206
|
+
* takes, with `id`, `owned` and the write-back over the entry.
|
|
207
|
+
*
|
|
208
|
+
* @typeParam P - The group's row type
|
|
209
|
+
* @typeParam F - The lines field
|
|
210
|
+
* @property id - The `String` field that identifies an entry — a field of both the group type and the line type (a keyed paged source needs none: its key is the id)
|
|
211
|
+
* @property owned - Entries the upstream system owns — an accessor over the entry
|
|
212
|
+
* @property onUpdate - The whole collection of entries with the batch applied (inline arm only)
|
|
213
|
+
* @property onPatch - Observe one gesture's draft and domain patches over the entries
|
|
214
|
+
* @property onApply - Submit one checked, idempotent batch of entries
|
|
215
|
+
*/
|
|
216
|
+
export interface SheetEntriesOptions<P extends StructType, F extends SheetLinesField<P>> extends Omit<SheetGroupedOptions<P, F>, "id" | "owned" | "onUpdate" | "onPatch" | "onApply"> {
|
|
217
|
+
/** The `String` field that identifies an entry — a field of both the group type and the line type. */
|
|
218
|
+
id?: SheetStringField<P> & SheetStringField<SheetLineOf<P, F>>;
|
|
219
|
+
/** Entries the upstream system owns — an accessor over the entry. */
|
|
220
|
+
owned?: (entry: ExprType<SheetEntryOf<P, F>>) => SubtypeExprOrValue<BooleanType>;
|
|
221
|
+
/** The whole collection of entries with the batch applied (inline arm only). */
|
|
222
|
+
onUpdate?: SubtypeExprOrValue<FunctionType<[ArrayType<SheetEntryOf<P, F>>], NullType>>;
|
|
223
|
+
/** Observe one gesture's draft and domain patches over the entries; this does not authorize writes. */
|
|
224
|
+
onPatch?: SubtypeExprOrValue<FunctionType<[ReturnType<typeof SheetPatchEventTypeFor<SheetEntryOf<P, F>>>], NullType>>;
|
|
225
|
+
/** Submit one checked, idempotent batch of entries to the authoritative source. */
|
|
226
|
+
onApply?: SubtypeExprOrValue<FunctionType<[ReturnType<typeof SheetChangeSetTypeFor<SheetEntryOf<P, F>>>], typeof SheetApplyResultType>> | SubtypeExprOrValue<AsyncFunctionType<[ReturnType<typeof SheetChangeSetTypeFor<SheetEntryOf<P, F>>>], typeof SheetApplyResultType>>;
|
|
227
|
+
}
|
|
228
|
+
/** A whole-value bind handle (`State.bind` / `Data.bind`) over `Array<R>` — accepted as `data`; `R` a row struct, or an entry `Sheet.Types.Entry(P, "lines")` (#846). */
|
|
229
|
+
export interface SheetBindHandle<R extends EastType> {
|
|
139
230
|
/** The handle's read. */
|
|
140
231
|
read: (...args: never[]) => ExprType<ArrayType<R>>;
|
|
141
232
|
}
|
|
@@ -150,29 +241,87 @@ export interface SheetBindHandle<R extends StructType> {
|
|
|
150
241
|
*
|
|
151
242
|
* @remarks
|
|
152
243
|
* `id` is required on a positional source. `onUpdate` is refused on the
|
|
153
|
-
* paged arm
|
|
154
|
-
*
|
|
244
|
+
* paged arm; edit paged rows with onApply over a pinned source — one that names
|
|
245
|
+
* its snapshot (`Data.bindPaged`, `Paged.pinned`). A `Dict` inline is refused: a sorted map would
|
|
155
246
|
* sit rows in key order, not the planner's.
|
|
156
247
|
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
248
|
+
* With `group` (#740) the rows are GROUPS: `columns` are declared over the
|
|
249
|
+
* line type the group's lines field holds, `onUpdate` rebuilds the groups
|
|
250
|
+
* with their lines inside. onPatch observes one gesture; onApply confirms
|
|
251
|
+
* an atomic checked batch. Rows of the line type may stand between the
|
|
252
|
+
* groups (#846): pass entries `Sheet.Types.Entry(GroupType, "lines")` — a
|
|
253
|
+
* group, or a LOOSE row, drawn as a plain row numbered in the groups'
|
|
254
|
+
* sequence — with an `id` that both types carry.
|
|
255
|
+
*
|
|
256
|
+
* In a `.tsx` file the `<Sheet>` tag calls this, with `data`, `columns` and
|
|
257
|
+
* the options as its props — as the example does for a grouped sheet whose
|
|
258
|
+
* rows are work packages.
|
|
161
259
|
*
|
|
162
|
-
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```tsx
|
|
262
|
+
* // .tsx file with the `@jsxImportSource @elaraai/east-ui` pragma
|
|
263
|
+
* import { ArrayType, East, FloatType, OptionType, StringType, StructType, some, variant } from "@elaraai/east";
|
|
264
|
+
* import { Reactive, Sheet, State, Text, UIComponentType, VStack } from "@elaraai/east-ui";
|
|
163
265
|
*
|
|
164
|
-
* const
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* }
|
|
266
|
+
* const sheet = East.function([], UIComponentType, (_$) => (
|
|
267
|
+
* <Reactive>{$ => {
|
|
268
|
+
* const JobType = StructType({ task: StringType, qty: OptionType(FloatType), notes: StringType, createdBy: StringType });
|
|
269
|
+
* const PackageType = StructType({ id: StringType, name: StringType, owner: StringType, jobs: ArrayType(JobType) });
|
|
270
|
+
* const packages = $.let(State.bind([ArrayType(PackageType)], "sheet_grouped_packages", [
|
|
271
|
+
* { id: "roughing", name: "P-40 · Roughing", owner: "planner", jobs: [
|
|
272
|
+
* { task: "Machine blanks", qty: some(1200.0), notes: "Four CNC lathes", createdBy: "planner" },
|
|
273
|
+
* { task: "Inspect lots", qty: some(4.0), notes: "Check before finishing", createdBy: "planner" },
|
|
274
|
+
* ] },
|
|
275
|
+
* { id: "finishing", name: "P-40 · Finishing", owner: "planner", jobs: [
|
|
276
|
+
* { task: "Finish housings", qty: some(1200.0), notes: "After inspection", createdBy: "planner" },
|
|
277
|
+
* { task: "Pack for assembly", qty: some(100.0), notes: "Twelve per carton", createdBy: "planner" },
|
|
278
|
+
* ] },
|
|
279
|
+
* ]));
|
|
280
|
+
* const applied = $.let(packages.read());
|
|
281
|
+
* return (
|
|
282
|
+
* <VStack gap="3" align="stretch">
|
|
283
|
+
* <Text textStyle="caption" color="fg.muted">Edit a package name or task. Use the gutter + to insert a task, or the stacked-rows + button to create a package at a group boundary. Apply changes saves the batch; Undo and Redo retain each gesture.</Text>
|
|
284
|
+
* <Sheet
|
|
285
|
+
* data={packages}
|
|
286
|
+
* id="id"
|
|
287
|
+
* group={Sheet.group(PackageType, "jobs", { title: "name" })}
|
|
288
|
+
* ready={{ group: East.function([Sheet.Types.DraftGroup(PackageType, "jobs")], Sheet.Types.Readiness, ($, group) => {
|
|
289
|
+
* $.if(group.name.hasTag("value").and(() => group.name.unwrap("value").length().equal(0n)), $ => {
|
|
290
|
+
* $.return(East.value(variant("incomplete", [{ field: "name", message: "Name the work package" }]), Sheet.Types.Readiness));
|
|
291
|
+
* });
|
|
292
|
+
* return East.value(variant("ready", null), Sheet.Types.Readiness);
|
|
293
|
+
* }) }}
|
|
294
|
+
* columns={{
|
|
295
|
+
* task: Sheet.column.text(JobType, { header: "Task", width: "240px" }),
|
|
296
|
+
* qty: Sheet.column.quantity(JobType, { header: "Qty", width: "112px" }),
|
|
297
|
+
* notes: Sheet.column.text(JobType, { header: "Notes", width: "300px" }),
|
|
298
|
+
* }}
|
|
299
|
+
* newRow={East.function([Sheet.Types.NewRow], Sheet.Types.Patch(JobType), () => Sheet.patch(JobType, {
|
|
300
|
+
* notes: "", createdBy: "planner",
|
|
301
|
+
* }))}
|
|
302
|
+
* newGroup={East.function([Sheet.Types.NewGroup], Sheet.Types.Patch(PackageType), () => Sheet.patch(PackageType, {
|
|
303
|
+
* owner: "planner", jobs: [],
|
|
304
|
+
* }))}
|
|
305
|
+
* onUpdate={packages.write}
|
|
306
|
+
* style={{ height: "440px" }}
|
|
307
|
+
* />
|
|
308
|
+
* <Text.MonoLabel>{East.str`SAVED · ${applied.length()} packages · ${applied.map((_$, p) => p.jobs.length()).sum()} tasks`}</Text.MonoLabel>
|
|
309
|
+
* </VStack>
|
|
310
|
+
* );
|
|
311
|
+
* }}</Reactive>
|
|
312
|
+
* ));
|
|
172
313
|
* ```
|
|
173
314
|
*/
|
|
315
|
+
export declare function createSheet<P extends StructType, F extends SheetLinesField<P>>(data: NoInfer<SubtypeExprOrValue<ArrayType<SheetEntryOf<P, F>>> | SheetBindHandle<SheetEntryOf<P, F>> | PagedSource<ArrayType<SheetEntryOf<P, F>>> | PagedSource<DictType<StringType, SheetEntryOf<P, F>>>>, columns: SheetColumnSpec<SheetLineOf<P, F>>, options: SheetEntriesOptions<P, F>): ExprType<UIComponentType>;
|
|
316
|
+
/** GROUPED rows — an `Array<P>` value or expression of groups. */
|
|
317
|
+
export declare function createSheet<T extends SubtypeExprOrValue<ArrayType<StructType>>, F extends SheetLinesField<DataRowType<T>>>(data: T, columns: SheetColumnSpec<SheetLineOf<DataRowType<T>, F>>, options: SheetGroupedOptions<DataRowType<T>, F>): ExprType<UIComponentType>;
|
|
318
|
+
/** GROUPED rows over a whole-value bind handle of groups. */
|
|
319
|
+
export declare function createSheet<P extends StructType, F extends SheetLinesField<P>>(data: SheetBindHandle<P>, columns: SheetColumnSpec<SheetLineOf<P, F>>, options: SheetGroupedOptions<P, F>): ExprType<UIComponentType>;
|
|
320
|
+
/** GROUPED rows over a paged source of groups. */
|
|
321
|
+
export declare function createSheet<P extends StructType, F extends SheetLinesField<P>>(data: PagedSource<ArrayType<P>> | PagedSource<DictType<StringType, P>>, columns: SheetColumnSpec<SheetLineOf<P, F>>, options: SheetGroupedOptions<P, F>): ExprType<UIComponentType>;
|
|
322
|
+
/** The inline arm — an `Array<R>` value or expression. */
|
|
174
323
|
export declare function createSheet<T extends SubtypeExprOrValue<ArrayType<StructType>>>(data: T, columns: SheetColumnSpec<DataRowType<T>>, options: SheetOptions<DataRowType<T>>): ExprType<UIComponentType>;
|
|
175
|
-
/**
|
|
324
|
+
/** A whole-value bind handle retains its live reader for atomic onUpdate. */
|
|
176
325
|
export declare function createSheet<R extends StructType>(data: SheetBindHandle<R>, columns: SheetColumnSpec<R>, options: SheetOptions<R>): ExprType<UIComponentType>;
|
|
177
326
|
/** The PAGED arm — positional (`Array<R>` windows) or keyed (`Dict<String, R>` windows, the key is the id). */
|
|
178
327
|
export declare function createSheet<R extends StructType>(data: PagedSource<ArrayType<R>> | PagedSource<DictType<StringType, R>>, columns: SheetColumnSpec<R>, options?: SheetOptions<R>): ExprType<UIComponentType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../../../src/collections/sheet/root.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../../../src/collections/sheet/root.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAGvB,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EAMb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,O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