@elaraai/east-ui 1.0.67 → 1.0.69
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/README.md +2 -2
- package/dist/src/charts/chart/index.d.ts +39 -4
- package/dist/src/charts/chart/index.d.ts.map +1 -1
- package/dist/src/charts/chart/index.js +3 -3
- package/dist/src/charts/chart/index.js.map +1 -1
- package/dist/src/charts/spec/index.d.ts +61 -3
- package/dist/src/charts/spec/index.d.ts.map +1 -1
- package/dist/src/charts/spec/types.d.ts +1 -1
- package/dist/src/charts/spec/types.js +1 -1
- package/dist/src/collections/blend/index.d.ts +1 -1
- package/dist/src/collections/blend/index.d.ts.map +1 -1
- package/dist/src/collections/blend/index.js +1 -1
- package/dist/src/collections/blend/index.js.map +1 -1
- package/dist/src/collections/blend/types.js +1 -1
- package/dist/src/collections/blend/types.js.map +1 -1
- package/dist/src/collections/board/index.d.ts +4 -4
- package/dist/src/collections/board/index.d.ts.map +1 -1
- package/dist/src/collections/board/index.js +1 -1
- package/dist/src/collections/board/index.js.map +1 -1
- package/dist/src/collections/board/types.js +1 -1
- package/dist/src/collections/board/types.js.map +1 -1
- package/dist/src/collections/calendar/index.d.ts +1 -1
- package/dist/src/collections/calendar/index.d.ts.map +1 -1
- package/dist/src/collections/deck/index.d.ts +58 -0
- package/dist/src/collections/deck/index.d.ts.map +1 -1
- package/dist/src/collections/index.d.ts +1 -2
- package/dist/src/collections/index.d.ts.map +1 -1
- package/dist/src/collections/index.js +1 -2
- package/dist/src/collections/index.js.map +1 -1
- package/dist/src/collections/library/index.d.ts +29 -0
- package/dist/src/collections/library/index.d.ts.map +1 -1
- package/dist/src/collections/library/types.d.ts +29 -0
- package/dist/src/collections/library/types.d.ts.map +1 -1
- package/dist/src/collections/matrix/index.d.ts +1 -1
- package/dist/src/collections/matrix/index.d.ts.map +1 -1
- package/dist/src/collections/plan/assemble.d.ts +3732 -0
- package/dist/src/collections/plan/assemble.d.ts.map +1 -0
- package/dist/src/collections/plan/assemble.js +187 -0
- package/dist/src/collections/plan/assemble.js.map +1 -0
- package/dist/src/collections/plan/builders.d.ts +612 -0
- package/dist/src/collections/plan/builders.d.ts.map +1 -0
- package/dist/src/collections/plan/builders.js +543 -0
- package/dist/src/collections/plan/builders.js.map +1 -0
- package/dist/src/collections/plan/data-forms.d.ts +332 -0
- package/dist/src/collections/plan/data-forms.d.ts.map +1 -0
- package/dist/src/collections/plan/data-forms.js +212 -0
- package/dist/src/collections/plan/data-forms.js.map +1 -0
- package/dist/src/collections/plan/factories.d.ts +338 -0
- package/dist/src/collections/plan/factories.d.ts.map +1 -0
- package/dist/src/collections/plan/factories.js +414 -0
- package/dist/src/collections/plan/factories.js.map +1 -0
- package/dist/src/collections/plan/index.d.ts +271 -0
- package/dist/src/collections/plan/index.d.ts.map +1 -0
- package/dist/src/collections/plan/index.js +162 -0
- package/dist/src/collections/plan/index.js.map +1 -0
- package/dist/src/collections/plan/ir.d.ts +3496 -0
- package/dist/src/collections/plan/ir.d.ts.map +1 -0
- package/dist/src/collections/plan/ir.js +83 -0
- package/dist/src/collections/plan/ir.js.map +1 -0
- package/dist/src/collections/plan/pick.d.ts +115 -0
- package/dist/src/collections/plan/pick.d.ts.map +1 -0
- package/dist/src/collections/plan/pick.js +193 -0
- package/dist/src/collections/plan/pick.js.map +1 -0
- package/dist/src/collections/plan/root.d.ts +210 -0
- package/dist/src/collections/plan/root.d.ts.map +1 -0
- package/dist/src/collections/plan/root.js +146 -0
- package/dist/src/collections/plan/root.js.map +1 -0
- package/dist/src/collections/plan/series.d.ts +11890 -0
- package/dist/src/collections/plan/series.d.ts.map +1 -0
- package/dist/src/collections/plan/series.js +412 -0
- package/dist/src/collections/plan/series.js.map +1 -0
- package/dist/src/collections/plan/types.d.ts +9291 -0
- package/dist/src/collections/plan/types.d.ts.map +1 -0
- package/dist/src/collections/plan/types.js +940 -0
- package/dist/src/collections/plan/types.js.map +1 -0
- package/dist/src/collections/roster/index.d.ts +4 -4
- package/dist/src/collections/roster/index.d.ts.map +1 -1
- package/dist/src/collections/roster/index.js +1 -1
- package/dist/src/collections/roster/index.js.map +1 -1
- package/dist/src/collections/roster/types.d.ts +1 -1
- package/dist/src/collections/roster/types.d.ts.map +1 -1
- package/dist/src/collections/roster/types.js +4 -3
- package/dist/src/collections/roster/types.js.map +1 -1
- package/dist/src/collections/table/index.d.ts +70 -2
- package/dist/src/collections/table/index.d.ts.map +1 -1
- package/dist/src/collections/table/index.js +55 -11
- package/dist/src/collections/table/index.js.map +1 -1
- package/dist/src/collections/table/types.d.ts +1 -1
- package/dist/src/collections/table/types.d.ts.map +1 -1
- package/dist/src/component.d.ts +3898 -1339
- package/dist/src/component.d.ts.map +1 -1
- package/dist/src/component.js +83 -146
- package/dist/src/component.js.map +1 -1
- package/dist/src/container/card/types.d.ts +1 -1
- package/dist/src/container/card/types.d.ts.map +1 -1
- package/dist/src/contracts/approval.d.ts +117 -0
- package/dist/src/contracts/approval.d.ts.map +1 -0
- package/dist/src/contracts/approval.js +105 -0
- package/dist/src/contracts/approval.js.map +1 -0
- package/dist/src/contracts/drag.d.ts +3 -3
- package/dist/src/contracts/drag.d.ts.map +1 -1
- package/dist/src/contracts/drag.js +23 -10
- package/dist/src/contracts/drag.js.map +1 -1
- package/dist/src/contracts/index.d.ts +4 -1
- package/dist/src/contracts/index.d.ts.map +1 -1
- package/dist/src/contracts/index.js +4 -1
- package/dist/src/contracts/index.js.map +1 -1
- package/dist/src/contracts/pick.d.ts +705 -0
- package/dist/src/contracts/pick.d.ts.map +1 -0
- package/dist/src/contracts/pick.js +360 -0
- package/dist/src/contracts/pick.js.map +1 -0
- package/dist/src/contracts/review.d.ts +7 -99
- package/dist/src/contracts/review.d.ts.map +1 -1
- package/dist/src/contracts/review.js +11 -85
- package/dist/src/contracts/review.js.map +1 -1
- package/dist/src/contracts/slice-affordances.d.ts +13 -4
- package/dist/src/contracts/slice-affordances.d.ts.map +1 -1
- package/dist/src/contracts/slice-affordances.js +13 -3
- package/dist/src/contracts/slice-affordances.js.map +1 -1
- package/dist/src/contracts/source.d.ts +432 -0
- package/dist/src/contracts/source.d.ts.map +1 -0
- package/dist/src/contracts/source.js +505 -0
- package/dist/src/contracts/source.js.map +1 -0
- package/dist/src/contracts/states.d.ts +130 -0
- package/dist/src/contracts/states.d.ts.map +1 -1
- package/dist/src/contracts/states.js +122 -0
- package/dist/src/contracts/states.js.map +1 -1
- package/dist/src/contracts/time.d.ts +76 -0
- package/dist/src/contracts/time.d.ts.map +1 -0
- package/dist/src/contracts/time.js +78 -0
- package/dist/src/contracts/time.js.map +1 -0
- package/dist/src/display/trace/types.d.ts +1 -1
- package/dist/src/display/trace/types.d.ts.map +1 -1
- package/dist/src/index.d.ts +10 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +22 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +5 -3
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +4 -3
- package/dist/src/internal.js.map +1 -1
- package/dist/src/layout/dock/index.d.ts +1 -1
- package/dist/src/layout/dock/index.js +1 -1
- package/dist/src/layout/index.d.ts +0 -1
- package/dist/src/layout/index.d.ts.map +1 -1
- package/dist/src/layout/index.js +0 -1
- package/dist/src/layout/index.js.map +1 -1
- package/dist/src/overlays/drawer/types.d.ts +1 -1
- package/dist/src/overlays/drawer/types.d.ts.map +1 -1
- package/dist/src/pick/index.d.ts +443 -0
- package/dist/src/pick/index.d.ts.map +1 -0
- package/dist/src/pick/index.js +64 -0
- package/dist/src/pick/index.js.map +1 -0
- package/dist/src/pick/panel/index.d.ts +64 -0
- package/dist/src/pick/panel/index.d.ts.map +1 -0
- package/dist/src/pick/panel/index.js +61 -0
- package/dist/src/pick/panel/index.js.map +1 -0
- package/dist/src/platform/slice/index.d.ts +291 -0
- package/dist/src/platform/slice/index.d.ts.map +1 -1
- package/dist/src/platform/slice/index.js +16 -0
- package/dist/src/platform/slice/index.js.map +1 -1
- package/dist/src/runtime/collections/deck.d.ts +29 -0
- package/dist/src/runtime/collections/deck.d.ts.map +1 -1
- package/dist/src/runtime/collections/index.d.ts +1 -2
- package/dist/src/runtime/collections/index.d.ts.map +1 -1
- package/dist/src/runtime/collections/index.js +1 -2
- package/dist/src/runtime/collections/index.js.map +1 -1
- package/dist/src/runtime/collections/library.d.ts +1 -1
- package/dist/src/runtime/collections/library.js +1 -1
- package/dist/src/runtime/collections/plan.d.ts +98 -0
- package/dist/src/runtime/collections/plan.d.ts.map +1 -0
- package/dist/src/runtime/collections/plan.js +98 -0
- package/dist/src/runtime/collections/plan.js.map +1 -0
- package/dist/src/runtime/collections/schematic.d.ts +1 -1
- package/dist/src/runtime/collections/schematic.js +1 -1
- package/dist/src/runtime/collections/table.d.ts +9 -1
- package/dist/src/runtime/collections/table.d.ts.map +1 -1
- package/dist/src/runtime/collections/table.js +1 -7
- package/dist/src/runtime/collections/table.js.map +1 -1
- package/dist/src/runtime/layout/dock.d.ts +2 -2
- package/dist/src/runtime/layout/dock.js +2 -2
- package/dist/src/runtime/layout/index.d.ts +0 -1
- package/dist/src/runtime/layout/index.d.ts.map +1 -1
- package/dist/src/runtime/layout/index.js +0 -1
- package/dist/src/runtime/layout/index.js.map +1 -1
- package/dist/src/shared/plot-gutter.d.ts +6 -23
- package/dist/src/shared/plot-gutter.d.ts.map +1 -1
- package/dist/src/shared/plot-gutter.js +6 -19
- package/dist/src/shared/plot-gutter.js.map +1 -1
- package/dist/src/shared/reify.d.ts +47 -4
- package/dist/src/shared/reify.d.ts.map +1 -1
- package/dist/src/shared/reify.js +62 -4
- package/dist/src/shared/reify.js.map +1 -1
- package/dist/src/slice/breakdown/index.d.ts +27 -0
- package/dist/src/slice/breakdown/index.d.ts.map +1 -1
- package/dist/src/slice/breakdown/types.d.ts +27 -0
- package/dist/src/slice/breakdown/types.d.ts.map +1 -1
- package/dist/src/slice/cohort/index.d.ts +54 -0
- package/dist/src/slice/cohort/index.d.ts.map +1 -1
- package/dist/src/slice/cohort/types.d.ts +27 -0
- package/dist/src/slice/cohort/types.d.ts.map +1 -1
- package/dist/src/slice/filter/index.d.ts +27 -0
- package/dist/src/slice/filter/index.d.ts.map +1 -1
- package/dist/src/slice/filter/types.d.ts +27 -0
- package/dist/src/slice/filter/types.d.ts.map +1 -1
- package/dist/src/slice/index.d.ts +405 -0
- package/dist/src/slice/index.d.ts.map +1 -1
- package/dist/src/slice/legend/index.d.ts +27 -0
- package/dist/src/slice/legend/index.d.ts.map +1 -1
- package/dist/src/slice/legend/types.d.ts +27 -0
- package/dist/src/slice/legend/types.d.ts.map +1 -1
- package/dist/src/slice/range/index.d.ts +60 -18
- package/dist/src/slice/range/index.d.ts.map +1 -1
- package/dist/src/slice/range/index.js +9 -1
- package/dist/src/slice/range/index.js.map +1 -1
- package/dist/src/slice/range/types.d.ts +63 -22
- package/dist/src/slice/range/types.d.ts.map +1 -1
- package/dist/src/slice/range/types.js +12 -5
- package/dist/src/slice/range/types.js.map +1 -1
- package/dist/src/slice/search/index.d.ts +27 -0
- package/dist/src/slice/search/index.d.ts.map +1 -1
- package/dist/src/slice/search/types.d.ts +27 -0
- package/dist/src/slice/search/types.d.ts.map +1 -1
- package/dist/src/slice/summary/index.d.ts +27 -0
- package/dist/src/slice/summary/index.d.ts.map +1 -1
- package/dist/src/slice/summary/types.d.ts +27 -0
- package/dist/src/slice/summary/types.d.ts.map +1 -1
- package/dist/src/style/content.d.ts +4 -6
- package/dist/src/style/content.d.ts.map +1 -1
- package/dist/src/style/content.js +4 -6
- package/dist/src/style/content.js.map +1 -1
- package/dist/src/style/scheme.js +1 -1
- package/dist/src/style/scheme.js.map +1 -1
- package/dist/test/collections/index.d.ts +2 -2
- package/dist/test/collections/index.d.ts.map +1 -1
- package/dist/test/collections/index.js +2 -2
- package/dist/test/collections/index.js.map +1 -1
- package/dist/test/collections/paged-source.examples.d.ts +9 -0
- package/dist/test/collections/paged-source.examples.d.ts.map +1 -0
- package/dist/test/collections/paged-source.examples.js +136 -0
- package/dist/test/collections/paged-source.examples.js.map +1 -0
- package/dist/test/collections/plan.examples.d.ts +125 -0
- package/dist/test/collections/plan.examples.d.ts.map +1 -0
- package/dist/test/collections/plan.examples.js +2939 -0
- package/dist/test/collections/plan.examples.js.map +1 -0
- package/dist/test/contracts/pick.examples.d.ts +6 -0
- package/dist/test/contracts/pick.examples.d.ts.map +1 -0
- package/dist/test/contracts/pick.examples.js +89 -0
- package/dist/test/contracts/pick.examples.js.map +1 -0
- package/dist/test/layout/dock.examples.d.ts +4 -4
- package/dist/test/layout/dock.examples.d.ts.map +1 -1
- package/dist/test/layout/dock.examples.js +34 -16
- package/dist/test/layout/dock.examples.js.map +1 -1
- package/dist/test/slice/slice.examples.d.ts +2 -1
- package/dist/test/slice/slice.examples.d.ts.map +1 -1
- package/dist/test/slice/slice.examples.js +67 -9
- package/dist/test/slice/slice.examples.js.map +1 -1
- package/package.json +3 -3
- package/dist/src/collections/gantt/index.d.ts +0 -377
- package/dist/src/collections/gantt/index.d.ts.map +0 -1
- package/dist/src/collections/gantt/index.js +0 -896
- package/dist/src/collections/gantt/index.js.map +0 -1
- package/dist/src/collections/gantt/types.d.ts +0 -353
- package/dist/src/collections/gantt/types.d.ts.map +0 -1
- package/dist/src/collections/gantt/types.js +0 -207
- package/dist/src/collections/gantt/types.js.map +0 -1
- package/dist/src/collections/planner/index.d.ts +0 -624
- package/dist/src/collections/planner/index.d.ts.map +0 -1
- package/dist/src/collections/planner/index.js +0 -941
- package/dist/src/collections/planner/index.js.map +0 -1
- package/dist/src/collections/planner/types.d.ts +0 -615
- package/dist/src/collections/planner/types.d.ts.map +0 -1
- package/dist/src/collections/planner/types.js +0 -423
- package/dist/src/collections/planner/types.js.map +0 -1
- package/dist/src/layout/aligned-stack/index.d.ts +0 -101
- package/dist/src/layout/aligned-stack/index.d.ts.map +0 -1
- package/dist/src/layout/aligned-stack/index.js +0 -105
- package/dist/src/layout/aligned-stack/index.js.map +0 -1
- package/dist/src/layout/aligned-stack/types.d.ts +0 -50
- package/dist/src/layout/aligned-stack/types.d.ts.map +0 -1
- package/dist/src/layout/aligned-stack/types.js +0 -24
- package/dist/src/layout/aligned-stack/types.js.map +0 -1
- package/dist/src/runtime/collections/gantt.d.ts +0 -67
- package/dist/src/runtime/collections/gantt.d.ts.map +0 -1
- package/dist/src/runtime/collections/gantt.js +0 -58
- package/dist/src/runtime/collections/gantt.js.map +0 -1
- package/dist/src/runtime/collections/planner.d.ts +0 -80
- package/dist/src/runtime/collections/planner.d.ts.map +0 -1
- package/dist/src/runtime/collections/planner.js +0 -76
- package/dist/src/runtime/collections/planner.js.map +0 -1
- package/dist/src/runtime/layout/aligned-stack.d.ts +0 -38
- package/dist/src/runtime/layout/aligned-stack.d.ts.map +0 -1
- package/dist/src/runtime/layout/aligned-stack.js +0 -36
- package/dist/src/runtime/layout/aligned-stack.js.map +0 -1
- package/dist/test/collections/gantt.examples.d.ts +0 -33
- package/dist/test/collections/gantt.examples.d.ts.map +0 -1
- package/dist/test/collections/gantt.examples.js +0 -359
- package/dist/test/collections/gantt.examples.js.map +0 -1
- package/dist/test/collections/planner.examples.d.ts +0 -47
- package/dist/test/collections/planner.examples.d.ts.map +0 -1
- package/dist/test/collections/planner.examples.js +0 -546
- package/dist/test/collections/planner.examples.js.map +0 -1
- package/dist/test/layout/aligned-stack.examples.d.ts +0 -25
- package/dist/test/layout/aligned-stack.examples.d.ts.map +0 -1
- package/dist/test/layout/aligned-stack.examples.js +0 -294
- package/dist/test/layout/aligned-stack.examples.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pick.d.ts","sourceRoot":"","sources":["../../../src/contracts/pick.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,SAAS,EACT,WAAW,EA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
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The PICK contract (#590) — which of a component's declared things are shown.
|
|
7
|
+
*
|
|
8
|
+
* A Plan picks row series, a Table would pick columns, a Chart layers. The
|
|
9
|
+
* operation is the same one every time: a library of identified things, some
|
|
10
|
+
* switched off, the survivors fed back to the component. This module is the one
|
|
11
|
+
* place that vocabulary is spelled; `Pick.Panel` renders it and never imports a
|
|
12
|
+
* component, exactly as `Slice.Rail` mounts anywhere.
|
|
13
|
+
*
|
|
14
|
+
* # Why it splits in two
|
|
15
|
+
*
|
|
16
|
+
* A `UIComponentType` arm must be a CLOSED East type, so the panel cannot ride
|
|
17
|
+
* a generic. That is not a stylistic call — it is why {@link SliceLegendType}
|
|
18
|
+
* carries `SliceBindType` and not `SliceBindType<T>`. Pick therefore splits at
|
|
19
|
+
* exactly the point where the item type stops mattering:
|
|
20
|
+
*
|
|
21
|
+
* - {@link PickBindType} is NON-GENERIC — a key, a state binding, and a list of
|
|
22
|
+
* plain-data descriptors. It is the only part that enters the IR, so ONE
|
|
23
|
+
* panel arm serves every component that ever adopts this.
|
|
24
|
+
* - {@link PickHandleType} is the AUTHOR's handle, and never enters the IR.
|
|
25
|
+
* `I` rides STRUCTURALLY (in `all` and `id`), the way `C` rides in
|
|
26
|
+
* {@link PagedSourceType}'s `page` signature, so a handle bound to one item
|
|
27
|
+
* type is a compile error against a component expecting another.
|
|
28
|
+
*
|
|
29
|
+
* # Why no platform function
|
|
30
|
+
*
|
|
31
|
+
* `state` is literally {@link State.bind}'s `{read, write, has}` pinned at
|
|
32
|
+
* {@link PickStateType}. Pick declares nothing of its own, so it needs neither
|
|
33
|
+
* of the two re-export hops in `east-ui-components` nor the two hard-coded
|
|
34
|
+
* arrays in `e3-ui-components` — the documented "ships broken while tests pass"
|
|
35
|
+
* trap. It also means {@link Pick.active} is provable in a plain `describeEast`
|
|
36
|
+
* spec rather than only in a browser.
|
|
37
|
+
*
|
|
38
|
+
* # Why the state is what is HIDDEN
|
|
39
|
+
*
|
|
40
|
+
* Storing the active list looks equivalent and is not: a thing the author adds
|
|
41
|
+
* in a later release is absent from every user's persisted state, so it
|
|
42
|
+
* silently never appears. Storing what is switched OFF means new arrivals show
|
|
43
|
+
* by default and only explicit removals persist — the same reason `Slice`
|
|
44
|
+
* stores `visible: Option<Set>` with `none` meaning all, minus the `Option`,
|
|
45
|
+
* because an empty HIDDEN list is unambiguous where an empty VISIBLE set is not.
|
|
46
|
+
*
|
|
47
|
+
* # What this contract deliberately does NOT do
|
|
48
|
+
*
|
|
49
|
+
* It does not ORDER. On a key-ordered surface there is nothing for an order to
|
|
50
|
+
* order: a Plan's rows sit in canonical KEY order (`PlanRowsCollectionType` is
|
|
51
|
+
* a `Dict`, and `applySeries` unions with LAST_WINS), so a series' position in
|
|
52
|
+
* the list resolves key collisions and never row position. The panel's own list
|
|
53
|
+
* order is already `all`'s array order. Ordering becomes real for an adopter
|
|
54
|
+
* whose collection is positional — a Table's columns — and belongs to that
|
|
55
|
+
* adopter, not here.
|
|
56
|
+
*
|
|
57
|
+
* @packageDocumentation
|
|
58
|
+
*/
|
|
59
|
+
import { ArrayType, BooleanType, East, Expr, FunctionType, IntegerType, NullType, OptionType, SetType, StringType, StructType, none, } from "@elaraai/east";
|
|
60
|
+
import { IconType } from "../display/icon/types.js";
|
|
61
|
+
import { State } from "../platform/state.js";
|
|
62
|
+
// ============================================================================
|
|
63
|
+
// The state — what the user switched off
|
|
64
|
+
// ============================================================================
|
|
65
|
+
/**
|
|
66
|
+
* The pick state — the ids switched OFF. An empty list shows everything.
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* Deliberately the hidden ids rather than the active ones, and deliberately a
|
|
70
|
+
* bare `Array<String>` rather than a struct: there is exactly one fact to
|
|
71
|
+
* store. See this module's overview for why hidden beats active.
|
|
72
|
+
*
|
|
73
|
+
* Duplicates are harmless ({@link Pick.active} tests membership through a set)
|
|
74
|
+
* and an id that no longer names anything is ignored, so persisted state
|
|
75
|
+
* survives an author renaming or removing an item.
|
|
76
|
+
*/
|
|
77
|
+
export const PickStateType = ArrayType(StringType);
|
|
78
|
+
/**
|
|
79
|
+
* One pickable thing as the PANEL sees it — plain data, no item type.
|
|
80
|
+
*
|
|
81
|
+
* @remarks
|
|
82
|
+
* This is the whole of what a panel can render, which is what keeps the panel
|
|
83
|
+
* component-agnostic: it never learns what a "series" or a "column" is.
|
|
84
|
+
*
|
|
85
|
+
* @property id - Stable identity — what the state addresses and what `id` returns; must be unique across the list
|
|
86
|
+
* @property title - The name a user reads (`"Machine jobs"`)
|
|
87
|
+
* @property subtitle - The muted role line (`"one row per machine"`); `none` ⇒ one-line row
|
|
88
|
+
* @property icon - The leading glyph; `none` ⇒ the panel prints no icon
|
|
89
|
+
* @property count - How many things this yields (`"24 rs"`); `none` ⇒ no count printed, which is what a paged source must say
|
|
90
|
+
* @property narrowed - `true` ⇒ the count is a NARROWED count, printed in the brand with a dot
|
|
91
|
+
*/
|
|
92
|
+
export const PickItemType = StructType({
|
|
93
|
+
id: StringType,
|
|
94
|
+
title: StringType,
|
|
95
|
+
subtitle: OptionType(StringType),
|
|
96
|
+
icon: OptionType(IconType),
|
|
97
|
+
count: OptionType(IntegerType),
|
|
98
|
+
narrowed: BooleanType,
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* The state binding a pick carries — EXACTLY {@link State.bind}'s return type,
|
|
102
|
+
* pinned at {@link PickStateType}.
|
|
103
|
+
*
|
|
104
|
+
* @remarks
|
|
105
|
+
* Field order matters and is `read` / `write` / `has`, because East struct
|
|
106
|
+
* subtyping is exact — same arity, same names, same order. Declaring it here
|
|
107
|
+
* rather than re-deriving it means a change to `State.bind`'s shape fails this
|
|
108
|
+
* file's build rather than something downstream.
|
|
109
|
+
*
|
|
110
|
+
* Nothing bespoke is introduced: per #106 a bind handle's methods are
|
|
111
|
+
* IR-bearing East functions over plain-data primitives, so a pick handle is
|
|
112
|
+
* ordinary serializable East data and `decodeBeast2For({ platform })` re-binds
|
|
113
|
+
* it to the decoder's store.
|
|
114
|
+
*
|
|
115
|
+
* @property read - The current state; TRACKS the key, so it belongs in a reactive evaluation
|
|
116
|
+
* @property write - Replace the state
|
|
117
|
+
* @property has - Whether the key is set
|
|
118
|
+
*/
|
|
119
|
+
export const PickStateHandleType = StructType({
|
|
120
|
+
read: FunctionType([], PickStateType),
|
|
121
|
+
write: FunctionType([PickStateType], NullType),
|
|
122
|
+
has: FunctionType([], BooleanType),
|
|
123
|
+
});
|
|
124
|
+
// ============================================================================
|
|
125
|
+
// The contract — non-generic, the only part that rides in IR
|
|
126
|
+
// ============================================================================
|
|
127
|
+
/**
|
|
128
|
+
* THE CONTRACT — what a panel stores and what any component's IR may hold.
|
|
129
|
+
*
|
|
130
|
+
* @remarks
|
|
131
|
+
* Non-generic by construction, so it embeds directly in a `UIComponentType`
|
|
132
|
+
* arm. A renderer needs nothing else: `key` to self-subscribe, `state` to read
|
|
133
|
+
* and write, `items` to draw.
|
|
134
|
+
*
|
|
135
|
+
* `items` is an EXPRESSION (`all.map(describe)`), not a build-time snapshot, so
|
|
136
|
+
* a count derived from data re-evaluates every reactive frame instead of
|
|
137
|
+
* freezing at authoring time.
|
|
138
|
+
*
|
|
139
|
+
* @property key - The store key; renderers self-subscribe on it, like `SliceBindType.key`
|
|
140
|
+
* @property state - The {@link PickStateHandleType} binding
|
|
141
|
+
* @property items - Every pickable thing, in declaration order
|
|
142
|
+
*/
|
|
143
|
+
export const PickBindType = StructType({
|
|
144
|
+
key: StringType,
|
|
145
|
+
state: PickStateHandleType,
|
|
146
|
+
items: ArrayType(PickItemType),
|
|
147
|
+
});
|
|
148
|
+
/**
|
|
149
|
+
* The `Pick.Panel` component payload — the contract plus the author's noun.
|
|
150
|
+
*
|
|
151
|
+
* @remarks
|
|
152
|
+
* Defined HERE rather than inline in `component.ts` because it carries no
|
|
153
|
+
* `UIComponentType`: only arms that need the recursion `node` for children have
|
|
154
|
+
* to be written inline (and then hand-synced). `SliceLegendType` is legal as a
|
|
155
|
+
* single shared export for exactly the same reason, and this follows it.
|
|
156
|
+
*
|
|
157
|
+
* `persist` is deliberately absent. The slice's storage vocabulary
|
|
158
|
+
* (`SlicePersistType`) lives in `platform/slice`, which imports FROM
|
|
159
|
+
* `contracts/` — referencing it here would close an import cycle. Persistence
|
|
160
|
+
* beyond the store's own lifetime is a separate decision, made where the
|
|
161
|
+
* dependency runs the right way.
|
|
162
|
+
*
|
|
163
|
+
* @property pick - The bound contract ({@link PickBindType})
|
|
164
|
+
* @property title - The author's noun for the collection ("Series" / "Columns")
|
|
165
|
+
*/
|
|
166
|
+
export const PickPanelType = StructType({
|
|
167
|
+
pick: PickBindType,
|
|
168
|
+
title: StringType,
|
|
169
|
+
});
|
|
170
|
+
/**
|
|
171
|
+
* The AUTHOR's handle — the contract plus the typed things it selects over.
|
|
172
|
+
*
|
|
173
|
+
* @remarks
|
|
174
|
+
* Never enters the IR. `all` and `id` are what carry `I`, structurally, so the
|
|
175
|
+
* type flows from `Pick.bind` to `Pick.active` and back into the component
|
|
176
|
+
* without a phantom brand and without surviving into a closed arm.
|
|
177
|
+
*
|
|
178
|
+
* @typeParam I - The item type being picked over
|
|
179
|
+
* @param i - The item type value
|
|
180
|
+
* @returns The concrete `StructType` of a handle over `i`
|
|
181
|
+
*
|
|
182
|
+
* @property pick - The non-generic contract handed to {@link Pick.Panel}
|
|
183
|
+
* @property all - Every item that COULD show, in declaration order
|
|
184
|
+
* @property id - An item's stable id — the same one its {@link PickItemType} carries
|
|
185
|
+
*/
|
|
186
|
+
export const PickHandleType = (i) => StructType({
|
|
187
|
+
pick: PickBindType,
|
|
188
|
+
all: ArrayType(i),
|
|
189
|
+
id: FunctionType([i], StringType),
|
|
190
|
+
});
|
|
191
|
+
/**
|
|
192
|
+
* Build a {@link PickStateType} seed.
|
|
193
|
+
*
|
|
194
|
+
* @param hidden - The ids switched off; omit ⇒ everything shows
|
|
195
|
+
* @returns The state expression
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```ts
|
|
199
|
+
* Pick.state() // everything shows
|
|
200
|
+
* Pick.state(["crew"]) // "crew" starts switched off
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
export function createPickState(hidden) {
|
|
204
|
+
return East.value([...(hidden ?? [])], PickStateType);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Bind a list of things to a persisted pick.
|
|
208
|
+
*
|
|
209
|
+
* @remarks
|
|
210
|
+
* Takes NO item-type argument — `I` is already carried by `all`, recovered with
|
|
211
|
+
* the `Expr.type` idiom, so the call reads the way the author thinks about it.
|
|
212
|
+
*
|
|
213
|
+
* The accessors are REIFIED once into a single describe function which the map
|
|
214
|
+
* then CALLS, per the factory rule (`shared/reify.ts`, `EAST_UI_PROP_PATTERNS.md`)
|
|
215
|
+
* — never invoked mid-map with their expression trees spliced in.
|
|
216
|
+
*
|
|
217
|
+
* Bind exactly ONCE, in the same reactive evaluation that mounts both the panel
|
|
218
|
+
* and the component. A `Reactive.Root` body is a free function and cannot
|
|
219
|
+
* capture a `$.let` handle from an enclosing scope, so a panel that is its own
|
|
220
|
+
* root would need its own bind — two binds on one key work (they share the
|
|
221
|
+
* store) but must be given identical item lists, or the two surfaces disagree
|
|
222
|
+
* about what exists.
|
|
223
|
+
*
|
|
224
|
+
* @typeParam I - The item type being picked over
|
|
225
|
+
* @param key - The store key; also the persistence key
|
|
226
|
+
* @param all - Every item that COULD show — an expression of `Array<I>`
|
|
227
|
+
* @param options - The per-item accessors and the seed ({@link PickOptions})
|
|
228
|
+
* @returns A {@link PickHandleType} over `I`
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* ```tsx
|
|
232
|
+
* const shown = $.let(Pick.bind("orders.cols", cols, {
|
|
233
|
+
* id: c => c.key,
|
|
234
|
+
* title: c => c.header,
|
|
235
|
+
* hidden: ["price"],
|
|
236
|
+
* }));
|
|
237
|
+
*
|
|
238
|
+
* <Pick.Panel value={shown} title="Columns" />
|
|
239
|
+
* <Table data={orders} columns={Pick.active(shown)} />
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
/**
|
|
243
|
+
* The library entries alone — every item described, with NO state binding.
|
|
244
|
+
*
|
|
245
|
+
* @remarks
|
|
246
|
+
* {@link Pick.bind} builds `items` with exactly this call, so proving one
|
|
247
|
+
* proves the other. It is split out for the same reason {@link pickVisible} is:
|
|
248
|
+
* `State.bind` is not runnable in a `describeEast` spec, and the descriptor
|
|
249
|
+
* derivation — identity, icons, counts — is the part worth testing.
|
|
250
|
+
*
|
|
251
|
+
* Useful in its own right when a host wants to render its own list rather than
|
|
252
|
+
* mount `Pick.Panel`.
|
|
253
|
+
*
|
|
254
|
+
* @typeParam I - The item type being picked over
|
|
255
|
+
* @param all - Every item that COULD show
|
|
256
|
+
* @param options - The per-item accessors ({@link PickOptions})
|
|
257
|
+
* @returns The descriptors, in declaration order
|
|
258
|
+
*/
|
|
259
|
+
export function pickItems(all, options) {
|
|
260
|
+
const allExpr = East.value(all);
|
|
261
|
+
const itemType = Expr.type(allExpr).value;
|
|
262
|
+
const opts = options;
|
|
263
|
+
// Reified ONCE, outside every block; the map below CALLS them.
|
|
264
|
+
const idFn = East.function([itemType], StringType, (_$, item) => opts.id(item));
|
|
265
|
+
const describe = East.function([itemType], PickItemType, (_$, item) => ({
|
|
266
|
+
id: idFn(item),
|
|
267
|
+
title: opts.title(item),
|
|
268
|
+
subtitle: opts.subtitle !== undefined ? opts.subtitle(item) : none,
|
|
269
|
+
icon: opts.icon !== undefined ? opts.icon(item) : none,
|
|
270
|
+
count: opts.count !== undefined ? opts.count(item) : none,
|
|
271
|
+
narrowed: opts.narrowed !== undefined ? opts.narrowed(item) : false,
|
|
272
|
+
}));
|
|
273
|
+
return allExpr.map((_$, item) => describe(item));
|
|
274
|
+
}
|
|
275
|
+
export function createPickBind(key, all, options) {
|
|
276
|
+
const allExpr = East.value(all);
|
|
277
|
+
const itemType = Expr.type(allExpr).value;
|
|
278
|
+
const opts = options;
|
|
279
|
+
const idFn = East.function([itemType], StringType, (_$, item) => opts.id(item));
|
|
280
|
+
const pick = East.value({
|
|
281
|
+
key: East.value(key, StringType),
|
|
282
|
+
// The state IS `State.bind`'s handle — nothing bespoke, and per #106 it
|
|
283
|
+
// serializes and re-binds like any other bound value.
|
|
284
|
+
state: State.bind([PickStateType], key, createPickState(options.hidden)),
|
|
285
|
+
// The SAME derivation `pickItems` exposes — proving one proves the other.
|
|
286
|
+
items: pickItems(allExpr, opts),
|
|
287
|
+
}, PickBindType);
|
|
288
|
+
// Two-step cast (the `Paged.of` idiom): the members are built against the
|
|
289
|
+
// item type recovered from the expression, which TS sees as the erased
|
|
290
|
+
// `EastType`. The East-side type is what actually types the value.
|
|
291
|
+
return East.value({
|
|
292
|
+
pick,
|
|
293
|
+
all: allExpr,
|
|
294
|
+
id: idFn,
|
|
295
|
+
}, PickHandleType(itemType));
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* The items still switched on, in DECLARATION order — the feed a component takes.
|
|
299
|
+
*
|
|
300
|
+
* @remarks
|
|
301
|
+
* The twin of `Slice.rows(...)`: one tracked read, one derivation, and the
|
|
302
|
+
* result is an ordinary expression the component's own prop already accepts.
|
|
303
|
+
* For a Plan that means `series={Pick.active(shown)}` needs no Plan change at
|
|
304
|
+
* all, because `PlanSeriesInput` already accepts the expression form.
|
|
305
|
+
*
|
|
306
|
+
* Declaration order, never the state's — see this module's overview. An id in
|
|
307
|
+
* the state that names nothing is ignored, so a rename or removal degrades to
|
|
308
|
+
* "shown" rather than to an error.
|
|
309
|
+
*
|
|
310
|
+
* Call this INSIDE the reactive evaluation that renders the component: the read
|
|
311
|
+
* is what registers the dependency that repaints on a toggle.
|
|
312
|
+
*
|
|
313
|
+
* @typeParam I - The item type being picked over
|
|
314
|
+
* @param handle - The handle from {@link Pick.bind}
|
|
315
|
+
* @returns The surviving items, as `Array<I>`
|
|
316
|
+
*/
|
|
317
|
+
export function pickActive(handle) {
|
|
318
|
+
const h = handle;
|
|
319
|
+
// The tracked read is the ONLY thing this adds over `pickVisible`, which is
|
|
320
|
+
// what makes the derivation itself testable without a State runtime.
|
|
321
|
+
return pickVisible(h.all, h.id, h.pick.state.read());
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* The derivation on its own — items minus a hidden list, with NO state binding.
|
|
325
|
+
*
|
|
326
|
+
* @remarks
|
|
327
|
+
* {@link Pick.active} is this plus one tracked read, so proving this proves the
|
|
328
|
+
* shipped behaviour. It exists split out because the semantics are the part
|
|
329
|
+
* worth testing and `State.bind` is not runnable in a `describeEast` spec —
|
|
330
|
+
* `TestImpl` carries no State runtime (`test/platform/state.spec.ts` is
|
|
331
|
+
* compile-only for exactly this reason). Here the hidden list is a plain value,
|
|
332
|
+
* so the whole contract is provable with no platform function at all.
|
|
333
|
+
*
|
|
334
|
+
* Three behaviours it fixes, all of them things a bare `active` list gets
|
|
335
|
+
* wrong: declaration order is preserved, an id naming nothing is ignored, and
|
|
336
|
+
* an item absent from the list still shows.
|
|
337
|
+
*
|
|
338
|
+
* @typeParam I - The item type being picked over
|
|
339
|
+
* @param all - Every item that COULD show
|
|
340
|
+
* @param id - An item's stable id
|
|
341
|
+
* @param hidden - The ids switched off
|
|
342
|
+
* @returns The surviving items, in declaration order
|
|
343
|
+
*/
|
|
344
|
+
export function pickVisible(all, id, hidden) {
|
|
345
|
+
const allExpr = East.value(all);
|
|
346
|
+
const listType = Expr.type(allExpr);
|
|
347
|
+
const idType = FunctionType([listType.value], StringType);
|
|
348
|
+
// Everything the block touches arrives as a PARAMETER: a JS const holding
|
|
349
|
+
// an East expression is re-inlined — and re-evaluated — at every use.
|
|
350
|
+
const fn = East.function([PickStateType, listType, idType], listType, ($, off, items, idOf) => {
|
|
351
|
+
const hiddenSet = $.let(off.toSet(), SetType(StringType));
|
|
352
|
+
return items.filter((_$, item) => hiddenSet.has(idOf(item)).not());
|
|
353
|
+
});
|
|
354
|
+
// Two-step cast (the `Paged.of` idiom): `fn` is built against the item type
|
|
355
|
+
// recovered from the expression, which TS sees as the erased `EastType`
|
|
356
|
+
// rather than the caller's `I`. The East-side types are what type the call.
|
|
357
|
+
const idErased = id;
|
|
358
|
+
return fn(hidden, allExpr, idErased);
|
|
359
|
+
}
|
|
360
|
+
//# sourceMappingURL=pick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pick.js","sourceRoot":"","sources":["../../../src/contracts/pick.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,EAIH,SAAS,EACT,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EACV,OAAO,EACP,UAAU,EACV,UAAU,EACV,IAAI,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,+EAA+E;AAC/E,yCAAyC;AACzC,+EAA+E;AAE/E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;AAInD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;IACnC,EAAE,EAAQ,UAAU;IACpB,KAAK,EAAK,UAAU;IACpB,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC;IAChC,IAAI,EAAM,UAAU,CAAC,QAAQ,CAAC;IAC9B,KAAK,EAAK,UAAU,CAAC,WAAW,CAAC;IACjC,QAAQ,EAAE,WAAW;CACxB,CAAC,CAAC;AAIH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;IAC1C,IAAI,EAAG,YAAY,CAAC,EAAE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;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,WAAW,CACvB,GAAqC,EACrC,EAAqD,EACrD,MAAyC;IAEzC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAA8C,CAAkC,CAAC;IAC5G,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAwB,CAAC;IAC3D,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,QAAQ,CAAC,KAAiB,CAAC,EAAE,UAAU,CAAC,CAAC;IACtE,0EAA0E;IAC1E,sEAAsE;IACtE,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QAC1F,MAAM,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;QAC1D,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IACH,4EAA4E;IAC5E,wEAAwE;IACxE,4EAA4E;IAC5E,MAAM,QAAQ,GAAG,EAAyE,CAAC;IAC3F,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAsC,CAAC;AAC9E,CAAC"}
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
* Review / approval grammar — the shared contract for decision surfaces.
|
|
7
7
|
*
|
|
8
8
|
* Lifted from the Planner's review chrome (PR #76) so every grid surface
|
|
9
|
-
* (
|
|
9
|
+
* (Table, Roster, Board, Plan) speaks one approval vocabulary and
|
|
10
10
|
* wears identical chrome: a per-subject Approve / Reject **decision column**
|
|
11
11
|
* plus a batch **`commitBar` foot** (Approve all / Reject all / Rerun).
|
|
12
12
|
*
|
|
13
13
|
* The vocabulary is deliberately two-axis:
|
|
14
14
|
*
|
|
15
|
-
* - **Event lifecycle** (`PlannerStateType
|
|
15
|
+
* - **Event lifecycle** (`PlannerStateType` in `contracts/states.ts`:
|
|
16
|
+
* committed / proposed / rejected — or the richer `EventStateType`)
|
|
16
17
|
* is what happened to a scheduled event — the audit trail.
|
|
17
18
|
* - **Approval state** ({@link ApprovalStateType}: approved / pending /
|
|
18
19
|
* rejected) is the *reviewer's* verdict on a subject (usually a row) — the
|
|
@@ -27,106 +28,13 @@
|
|
|
27
28
|
*
|
|
28
29
|
* @packageDocumentation
|
|
29
30
|
*/
|
|
30
|
-
import { type EastType, type ExprType, type SubtypeExprOrValue, BooleanType, FunctionType,
|
|
31
|
+
import { type EastType, type ExprType, type SubtypeExprOrValue, BooleanType, FunctionType, NullType, OptionType, StringType } from "@elaraai/east";
|
|
31
32
|
import { UIComponentType } from "../component.js";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* the event-level audit lifecycle (`PlannerStateType`).
|
|
35
|
-
*
|
|
36
|
-
* @remarks
|
|
37
|
-
* `approved` rests pre-approved (a clean line's resting state — its Approve
|
|
38
|
-
* button renders as the active state); `pending` awaits an explicit call (a
|
|
39
|
-
* flagged line); `rejected` is an explicit decline. Authors usually derive it
|
|
40
|
-
* in East — see {@link deriveApproval} for the canonical "clean ⇒ approved,
|
|
41
|
-
* flagged ⇒ pending" rule.
|
|
42
|
-
*
|
|
43
|
-
* The same three words appear in e3-ui's DecisionQueue at *case* granularity
|
|
44
|
-
* (`Verdict`); this variant is the in-surface (row / batch) resolution.
|
|
45
|
-
*
|
|
46
|
-
* @property approved - Pre-approved / accepted (the resting state for a clean subject)
|
|
47
|
-
* @property pending - Undecided — awaits an explicit Approve / Reject
|
|
48
|
-
* @property rejected - Explicitly declined
|
|
49
|
-
*/
|
|
50
|
-
export declare const ApprovalStateType: VariantType<{
|
|
51
|
-
/** Pre-approved / accepted (the resting state for a clean subject). */
|
|
52
|
-
readonly approved: NullType;
|
|
53
|
-
/** Undecided — awaits an explicit Approve / Reject. */
|
|
54
|
-
readonly pending: NullType;
|
|
55
|
-
/** Explicitly declined. */
|
|
56
|
-
readonly rejected: NullType;
|
|
57
|
-
}>;
|
|
58
|
-
/**
|
|
59
|
-
* Type representing approval state values.
|
|
60
|
-
*/
|
|
61
|
-
export type ApprovalStateType = typeof ApprovalStateType;
|
|
62
|
-
/**
|
|
63
|
-
* String literal form of {@link ApprovalStateType} tags.
|
|
64
|
-
*/
|
|
65
|
-
export type ApprovalStateLiteral = "approved" | "pending" | "rejected";
|
|
66
|
-
/**
|
|
67
|
-
* The row-subject reference — the payload of per-row review callbacks on the
|
|
68
|
-
* row-granularity adopters (Planner, Gantt, Table, Roster).
|
|
69
|
-
*
|
|
70
|
-
* @remarks
|
|
71
|
-
* `rowIndex` addresses the row in the surface's **unsliced** row order (the
|
|
72
|
-
* same convention as row-selection events), so hosts map it straight back to
|
|
73
|
-
* their source data. Tile-granularity acceptance keeps its own subject — the
|
|
74
|
-
* drag contract's `CellRefType` — documented as the *item*-level sibling of
|
|
75
|
-
* this row-level ref.
|
|
76
|
-
*
|
|
77
|
-
* @property rowIndex - The acted-on row's index (0-based, unsliced order)
|
|
78
|
-
*/
|
|
79
|
-
export declare const RowRefType: StructType<{
|
|
80
|
-
/** The acted-on row's index (0-based, unsliced order) */
|
|
81
|
-
readonly rowIndex: IntegerType;
|
|
82
|
-
}>;
|
|
83
|
-
/**
|
|
84
|
-
* Type representing row-subject reference values.
|
|
85
|
-
*/
|
|
86
|
-
export type RowRefType = typeof RowRefType;
|
|
87
|
-
/**
|
|
88
|
-
* The review-config struct shape for a subject-ref type `S` and a UI
|
|
89
|
-
* component type `C` — see {@link reviewType}.
|
|
90
|
-
*/
|
|
91
|
-
export type ReviewStructType<S extends EastType, C extends EastType> = StructType<{
|
|
92
|
-
columnLabel: StringType;
|
|
93
|
-
summary: OptionType<C>;
|
|
94
|
-
onApprove: OptionType<FunctionType<[S], NullType>>;
|
|
95
|
-
onReject: OptionType<FunctionType<[S], NullType>>;
|
|
96
|
-
onApproveAll: OptionType<FunctionType<[], NullType>>;
|
|
97
|
-
onRejectAll: OptionType<FunctionType<[], NullType>>;
|
|
98
|
-
onRerun: OptionType<FunctionType<[], NullType>>;
|
|
99
|
-
rerunLabel: StringType;
|
|
100
|
-
}>;
|
|
101
|
-
/**
|
|
102
|
-
* Builds the review-config East type for a given subject-ref type — the
|
|
103
|
-
* honest per-component variability of the shared contract.
|
|
104
|
-
*
|
|
105
|
-
* @param subjectRefType - The per-subject callback payload type (e.g. {@link RowRefType} for row-granularity surfaces)
|
|
106
|
-
* @param componentType - The UI component type for the `summary` field — pass `UIComponentType` (or the recursion `node` when spelling a root inline in `component.ts`)
|
|
107
|
-
* @returns The review-config `StructType` for that subject
|
|
108
|
-
*
|
|
109
|
-
* @remarks
|
|
110
|
-
* Every adopter's `review` field is `OptionType(reviewType(...))` with the
|
|
111
|
-
* same fixed fields — only the subject varies: Planner / Gantt / Table /
|
|
112
|
-
* Roster review rows (`{ rowIndex }`), while per-tile ghost-accept stays on
|
|
113
|
-
* the drag contract's `CellRefType`. `componentType` is injected (rather than
|
|
114
|
-
* imported) so `component.ts` can spell the same shape inside its
|
|
115
|
-
* `RecursiveType` using the recursion `node`; every other caller passes the
|
|
116
|
-
* resolved `UIComponentType`.
|
|
117
|
-
*
|
|
118
|
-
* Semantics of the fields (identical across adopters):
|
|
119
|
-
* - `columnLabel` — the decision-column header (builders default `"Decision"`).
|
|
120
|
-
* - `summary` — optional host-composed foot eyebrow (a `UIComponentType`).
|
|
121
|
-
* - `onApprove` / `onReject` — per-subject calls, receiving the subject ref.
|
|
122
|
-
* - `onApproveAll` / `onRejectAll` — batch foot verbs.
|
|
123
|
-
* - `onRerun` — optional re-run verb (absent ⇒ no Rerun button);
|
|
124
|
-
* `rerunLabel` its label (builders default `"Rerun"`).
|
|
125
|
-
*/
|
|
126
|
-
export declare function reviewType<S extends EastType, C extends EastType>(subjectRefType: S, componentType: C): ReviewStructType<S, C>;
|
|
33
|
+
import { ApprovalStateType, RowRefType, type ReviewStructType } from "./approval.js";
|
|
34
|
+
export { ApprovalStateType, type ApprovalStateLiteral, RowRefType, reviewType, type ReviewStructType, } from "./approval.js";
|
|
127
35
|
/**
|
|
128
36
|
* The resolved row-granularity review-config type — `reviewType(RowRefType,
|
|
129
|
-
* UIComponentType)`. The concrete type
|
|
37
|
+
* UIComponentType)`. The concrete type Table / Roster / Board carry
|
|
130
38
|
* (and the one renderers decode).
|
|
131
39
|
*/
|
|
132
40
|
export declare const RowReviewType: ReviewStructType<RowRefType, UIComponentType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/contracts/review.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/contracts/review.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAEvB,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,UAAU,EAIb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACH,iBAAiB,EACjB,UAAU,EAEV,KAAK,gBAAgB,EACxB,MAAM,eAAe,CAAC;AASvB,OAAO,EACH,iBAAiB,EAAE,KAAK,oBAAoB,EAC5C,UAAU,EACV,UAAU,EAAE,KAAK,gBAAgB,GACpC,MAAM,eAAe,CAAC;AAEvB;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,gBAAgB,CAAC,UAAU,EAAE,eAAe,CAA2C,CAAC;AAEpH;;GAEG;AACH,MAAM,MAAM,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,CAAC,GACzC,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAKzC"}
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
* Review / approval grammar — the shared contract for decision surfaces.
|
|
7
7
|
*
|
|
8
8
|
* Lifted from the Planner's review chrome (PR #76) so every grid surface
|
|
9
|
-
* (
|
|
9
|
+
* (Table, Roster, Board, Plan) speaks one approval vocabulary and
|
|
10
10
|
* wears identical chrome: a per-subject Approve / Reject **decision column**
|
|
11
11
|
* plus a batch **`commitBar` foot** (Approve all / Reject all / Rerun).
|
|
12
12
|
*
|
|
13
13
|
* The vocabulary is deliberately two-axis:
|
|
14
14
|
*
|
|
15
|
-
* - **Event lifecycle** (`PlannerStateType
|
|
15
|
+
* - **Event lifecycle** (`PlannerStateType` in `contracts/states.ts`:
|
|
16
|
+
* committed / proposed / rejected — or the richer `EventStateType`)
|
|
16
17
|
* is what happened to a scheduled event — the audit trail.
|
|
17
18
|
* - **Approval state** ({@link ApprovalStateType}: approved / pending /
|
|
18
19
|
* rejected) is the *reviewer's* verdict on a subject (usually a row) — the
|
|
@@ -27,94 +28,19 @@
|
|
|
27
28
|
*
|
|
28
29
|
* @packageDocumentation
|
|
29
30
|
*/
|
|
30
|
-
import { East, BooleanType, FunctionType,
|
|
31
|
+
import { East, BooleanType, FunctionType, NullType, OptionType, StringType, variant, none, some, } from "@elaraai/east";
|
|
31
32
|
import { UIComponentType } from "../component.js";
|
|
33
|
+
import { ApprovalStateType, RowRefType, reviewType, } from "./approval.js";
|
|
32
34
|
// ============================================================================
|
|
33
|
-
// Approval vocabulary
|
|
35
|
+
// Approval vocabulary + type builder — canonical definitions in
|
|
36
|
+
// `contracts/approval.ts` (the `UIComponentType`-free leaf, importable from
|
|
37
|
+
// inside the `component.ts` module graph); re-exported here so this module
|
|
38
|
+
// stays the canonical import path for host code.
|
|
34
39
|
// ============================================================================
|
|
35
|
-
|
|
36
|
-
* A review subject's approval state — the reviewer's verdict, distinct from
|
|
37
|
-
* the event-level audit lifecycle (`PlannerStateType`).
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* `approved` rests pre-approved (a clean line's resting state — its Approve
|
|
41
|
-
* button renders as the active state); `pending` awaits an explicit call (a
|
|
42
|
-
* flagged line); `rejected` is an explicit decline. Authors usually derive it
|
|
43
|
-
* in East — see {@link deriveApproval} for the canonical "clean ⇒ approved,
|
|
44
|
-
* flagged ⇒ pending" rule.
|
|
45
|
-
*
|
|
46
|
-
* The same three words appear in e3-ui's DecisionQueue at *case* granularity
|
|
47
|
-
* (`Verdict`); this variant is the in-surface (row / batch) resolution.
|
|
48
|
-
*
|
|
49
|
-
* @property approved - Pre-approved / accepted (the resting state for a clean subject)
|
|
50
|
-
* @property pending - Undecided — awaits an explicit Approve / Reject
|
|
51
|
-
* @property rejected - Explicitly declined
|
|
52
|
-
*/
|
|
53
|
-
export const ApprovalStateType = VariantType({
|
|
54
|
-
/** Pre-approved / accepted (the resting state for a clean subject). */
|
|
55
|
-
approved: NullType,
|
|
56
|
-
/** Undecided — awaits an explicit Approve / Reject. */
|
|
57
|
-
pending: NullType,
|
|
58
|
-
/** Explicitly declined. */
|
|
59
|
-
rejected: NullType,
|
|
60
|
-
});
|
|
61
|
-
/**
|
|
62
|
-
* The row-subject reference — the payload of per-row review callbacks on the
|
|
63
|
-
* row-granularity adopters (Planner, Gantt, Table, Roster).
|
|
64
|
-
*
|
|
65
|
-
* @remarks
|
|
66
|
-
* `rowIndex` addresses the row in the surface's **unsliced** row order (the
|
|
67
|
-
* same convention as row-selection events), so hosts map it straight back to
|
|
68
|
-
* their source data. Tile-granularity acceptance keeps its own subject — the
|
|
69
|
-
* drag contract's `CellRefType` — documented as the *item*-level sibling of
|
|
70
|
-
* this row-level ref.
|
|
71
|
-
*
|
|
72
|
-
* @property rowIndex - The acted-on row's index (0-based, unsliced order)
|
|
73
|
-
*/
|
|
74
|
-
export const RowRefType = StructType({
|
|
75
|
-
/** The acted-on row's index (0-based, unsliced order) */
|
|
76
|
-
rowIndex: IntegerType,
|
|
77
|
-
});
|
|
78
|
-
/**
|
|
79
|
-
* Builds the review-config East type for a given subject-ref type — the
|
|
80
|
-
* honest per-component variability of the shared contract.
|
|
81
|
-
*
|
|
82
|
-
* @param subjectRefType - The per-subject callback payload type (e.g. {@link RowRefType} for row-granularity surfaces)
|
|
83
|
-
* @param componentType - The UI component type for the `summary` field — pass `UIComponentType` (or the recursion `node` when spelling a root inline in `component.ts`)
|
|
84
|
-
* @returns The review-config `StructType` for that subject
|
|
85
|
-
*
|
|
86
|
-
* @remarks
|
|
87
|
-
* Every adopter's `review` field is `OptionType(reviewType(...))` with the
|
|
88
|
-
* same fixed fields — only the subject varies: Planner / Gantt / Table /
|
|
89
|
-
* Roster review rows (`{ rowIndex }`), while per-tile ghost-accept stays on
|
|
90
|
-
* the drag contract's `CellRefType`. `componentType` is injected (rather than
|
|
91
|
-
* imported) so `component.ts` can spell the same shape inside its
|
|
92
|
-
* `RecursiveType` using the recursion `node`; every other caller passes the
|
|
93
|
-
* resolved `UIComponentType`.
|
|
94
|
-
*
|
|
95
|
-
* Semantics of the fields (identical across adopters):
|
|
96
|
-
* - `columnLabel` — the decision-column header (builders default `"Decision"`).
|
|
97
|
-
* - `summary` — optional host-composed foot eyebrow (a `UIComponentType`).
|
|
98
|
-
* - `onApprove` / `onReject` — per-subject calls, receiving the subject ref.
|
|
99
|
-
* - `onApproveAll` / `onRejectAll` — batch foot verbs.
|
|
100
|
-
* - `onRerun` — optional re-run verb (absent ⇒ no Rerun button);
|
|
101
|
-
* `rerunLabel` its label (builders default `"Rerun"`).
|
|
102
|
-
*/
|
|
103
|
-
export function reviewType(subjectRefType, componentType) {
|
|
104
|
-
return StructType({
|
|
105
|
-
columnLabel: StringType,
|
|
106
|
-
summary: OptionType(componentType),
|
|
107
|
-
onApprove: OptionType(FunctionType([subjectRefType], NullType)),
|
|
108
|
-
onReject: OptionType(FunctionType([subjectRefType], NullType)),
|
|
109
|
-
onApproveAll: OptionType(FunctionType([], NullType)),
|
|
110
|
-
onRejectAll: OptionType(FunctionType([], NullType)),
|
|
111
|
-
onRerun: OptionType(FunctionType([], NullType)),
|
|
112
|
-
rerunLabel: StringType,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
40
|
+
export { ApprovalStateType, RowRefType, reviewType, } from "./approval.js";
|
|
115
41
|
/**
|
|
116
42
|
* The resolved row-granularity review-config type — `reviewType(RowRefType,
|
|
117
|
-
* UIComponentType)`. The concrete type
|
|
43
|
+
* UIComponentType)`. The concrete type Table / Roster / Board carry
|
|
118
44
|
* (and the one renderers decode).
|
|
119
45
|
*/
|
|
120
46
|
export const RowReviewType = reviewType(RowRefType, UIComponentType);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review.js","sourceRoot":"","sources":["../../../src/contracts/review.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"review.js","sourceRoot":"","sources":["../../../src/contracts/review.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAIH,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,UAAU,EACV,OAAO,EACP,IAAI,EACJ,IAAI,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACH,iBAAiB,EACjB,UAAU,EACV,UAAU,GAEb,MAAM,eAAe,CAAC;AAEvB,+EAA+E;AAC/E,gEAAgE;AAChE,4EAA4E;AAC5E,2EAA2E;AAC3E,iDAAiD;AACjD,+EAA+E;AAE/E,OAAO,EACH,iBAAiB,EACjB,UAAU,EACV,UAAU,GACb,MAAM,eAAe,CAAC;AAEvB;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkD,UAAU,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;AA4CpH;;;;;;;;;;;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