@zeyos/zx 4.3.0 → 4.4.0
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/CHANGELOG.md +266 -1
- package/README.md +7 -3
- package/dist/types/components/activity-item/activity-item.d.ts +351 -0
- package/dist/types/components/activity-list/activity-list.d.ts +195 -0
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +28 -0
- package/dist/types/components/button/button.d.ts +8 -0
- package/dist/types/components/calendar/calendar-model.d.ts +22 -0
- package/dist/types/components/calendar/calendar.d.ts +19 -0
- package/dist/types/components/card/card.d.ts +7 -0
- package/dist/types/components/card-view/card-view.d.ts +12 -4
- package/dist/types/components/card-view/record-card.d.ts +53 -5
- package/dist/types/components/code-editor/code-editor.d.ts +160 -0
- package/dist/types/components/code-editor/field-adapter.d.ts +5 -0
- package/dist/types/components/context-menu/context-menu.d.ts +18 -2
- package/dist/types/components/date-picker/date-picker.d.ts +8 -0
- package/dist/types/components/date-picker/time-picker.d.ts +7 -0
- package/dist/types/components/dialog/dialog.d.ts +29 -0
- package/dist/types/components/entity-ref/entity-ref.d.ts +331 -0
- package/dist/types/components/file-item/file-item.d.ts +234 -0
- package/dist/types/components/file-list/file-list.d.ts +171 -0
- package/dist/types/components/filter/filter.d.ts +91 -36
- package/dist/types/components/filter-panel/filter-panel.d.ts +449 -0
- package/dist/types/components/kanban-view/kanban-card.d.ts +138 -0
- package/dist/types/components/kanban-view/kanban-policy.d.ts +268 -0
- package/dist/types/components/kanban-view/kanban-view.d.ts +837 -26
- package/dist/types/components/launcher/launcher.d.ts +19 -12
- package/dist/types/components/list-toolbar/list-toolbar.d.ts +599 -0
- package/dist/types/components/menu-button/menu-button.d.ts +4 -37
- package/dist/types/components/message/message.d.ts +7 -0
- package/dist/types/components/modal/modal.d.ts +48 -0
- package/dist/types/components/navigation-bar/navigation-bar.d.ts +105 -21
- package/dist/types/components/panel/panel.d.ts +7 -0
- package/dist/types/components/search/search.d.ts +7 -0
- package/dist/types/components/select/select.d.ts +4 -0
- package/dist/types/components/sort-control/sort-control.d.ts +105 -0
- package/dist/types/components/stat-tile/stat-tile.d.ts +277 -0
- package/dist/types/components/tabbox/tabbox.d.ts +7 -0
- package/dist/types/components/table/table.d.ts +144 -0
- package/dist/types/components/table-view/table-view.d.ts +11 -5
- package/dist/types/components/timebox/timebox.d.ts +7 -0
- package/dist/types/components/value-list/value-list.d.ts +8 -0
- package/dist/types/components/view/record-view.d.ts +96 -5
- package/dist/types/core/component.d.ts +6 -1
- package/dist/types/core/icons.d.ts +17 -0
- package/dist/types/index.d.ts +13 -1
- package/dist/types/internal/app-rail.d.ts +10 -0
- package/dist/types/internal/menu-items.d.ts +134 -0
- package/dist/zx-zeyos.esm.js +651 -88
- package/dist/zx-zeyos.esm.min.js +8 -1
- package/dist/zx.css +6266 -3900
- package/dist/zx.esm.js +8487 -1805
- package/dist/zx.esm.min.js +10 -3
- package/dist/zx.global.js +8487 -1805
- package/dist/zx.global.min.js +10 -3
- package/dist/zx.min.css +1 -1
- package/docs/api.json +1811 -247
- package/docs/llms.md +345 -40
- package/docs/llms.txt +11 -7
- package/package.json +1 -2
- package/src/components/activity-item/activity-item.css +137 -0
- package/src/components/activity-item/activity-item.js +599 -0
- package/src/components/activity-list/activity-list.css +64 -0
- package/src/components/activity-list/activity-list.js +375 -0
- package/src/components/app-rail/app-rail.css +227 -19
- package/src/components/app-sidebar/app-sidebar.css +414 -24
- package/src/components/app-sidebar/app-sidebar.js +65 -5
- package/src/components/button/button.css +8 -0
- package/src/components/button/button.js +6 -1
- package/src/components/calendar/calendar-model.js +45 -0
- package/src/components/calendar/calendar.css +30 -10
- package/src/components/calendar/calendar.js +41 -13
- package/src/components/card/card.js +12 -1
- package/src/components/card-view/card-view.css +212 -9
- package/src/components/card-view/card-view.js +32 -16
- package/src/components/card-view/record-card.js +98 -21
- package/src/components/code-editor/code-editor.css +67 -0
- package/src/components/code-editor/code-editor.js +288 -0
- package/src/components/code-editor/field-adapter.js +34 -0
- package/src/components/context-menu/context-menu.css +80 -3
- package/src/components/context-menu/context-menu.js +22 -30
- package/src/components/date-picker/date-picker.js +22 -8
- package/src/components/date-picker/month-picker.js +3 -3
- package/src/components/date-picker/time-picker.js +20 -8
- package/src/components/dialog/dialog.js +88 -66
- package/src/components/dropdown/dropdown.js +2 -2
- package/src/components/entity-ref/entity-ref.css +182 -0
- package/src/components/entity-ref/entity-ref.js +496 -0
- package/src/components/file-item/file-item.css +88 -0
- package/src/components/file-item/file-item.js +371 -0
- package/src/components/file-list/file-list.css +51 -0
- package/src/components/file-list/file-list.js +320 -0
- package/src/components/filter/filter.css +27 -1
- package/src/components/filter/filter.js +199 -45
- package/src/components/filter-panel/filter-panel.css +104 -0
- package/src/components/filter-panel/filter-panel.js +964 -0
- package/src/components/kanban-view/kanban-card.js +239 -0
- package/src/components/kanban-view/kanban-policy.js +412 -0
- package/src/components/kanban-view/kanban-view.css +674 -36
- package/src/components/kanban-view/kanban-view.js +1762 -240
- package/src/components/launcher/launcher.js +59 -27
- package/src/components/list-toolbar/list-toolbar.css +189 -0
- package/src/components/list-toolbar/list-toolbar.js +851 -0
- package/src/components/menu-button/menu-button.css +80 -3
- package/src/components/menu-button/menu-button.js +21 -37
- package/src/components/message/message.css +14 -12
- package/src/components/message/message.js +13 -2
- package/src/components/modal/modal.css +15 -0
- package/src/components/modal/modal.js +141 -0
- package/src/components/navigation-bar/navigation-bar.css +77 -2
- package/src/components/navigation-bar/navigation-bar.js +171 -4
- package/src/components/panel/panel.js +13 -2
- package/src/components/search/search.js +17 -5
- package/src/components/select/field-adapter.js +4 -1
- package/src/components/select/select.js +3 -0
- package/src/components/sort-control/sort-control.css +17 -0
- package/src/components/sort-control/sort-control.js +140 -0
- package/src/components/stat-tile/stat-tile.css +213 -0
- package/src/components/stat-tile/stat-tile.js +590 -0
- package/src/components/tabbox/tabbox.js +12 -1
- package/src/components/table/table.css +51 -2
- package/src/components/table/table.js +298 -19
- package/src/components/table-view/table-view.css +8 -2
- package/src/components/table-view/table-view.js +21 -6
- package/src/components/tag-picker/tag-picker.css +3 -1
- package/src/components/timebox/timebox.js +18 -5
- package/src/components/value-list/value-list.js +22 -6
- package/src/components/view/record-view.css +5 -0
- package/src/components/view/record-view.js +100 -7
- package/src/core/component.js +8 -3
- package/src/core/icons.js +74 -5
- package/src/index.js +33 -3
- package/src/internal/app-rail.js +19 -1
- package/src/internal/menu-items.js +142 -0
- package/styles/print.css +192 -0
- package/styles/zx.css +11 -0
- package/DESIGN-SYSTEM.md +0 -182
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
export type KanbanRecord = Record<string, any>;
|
|
2
|
+
export type KanbanColumn = import('./kanban-view.js').KanbanColumn;
|
|
3
|
+
export type KanbanSwimlane = import('./kanban-view.js').KanbanSwimlane;
|
|
4
|
+
export type KanbanMovePoint = import('./kanban-view.js').KanbanMovePoint;
|
|
5
|
+
export type KanbanAccessor = import('./kanban-view.js').KanbanAccessor;
|
|
6
|
+
export type KanbanRule = {
|
|
7
|
+
/**
|
|
8
|
+
* Stable rule id, written to the card's `data-rule` list.
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* Predicate deciding whether the rule applies to one record.
|
|
13
|
+
*/
|
|
14
|
+
when: (record: KanbanRecord, context: {
|
|
15
|
+
index: number;
|
|
16
|
+
column: string;
|
|
17
|
+
lane: string | null;
|
|
18
|
+
}) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Visual intent.
|
|
21
|
+
* The first matching rule paints the card marker; later matches only contribute badges.
|
|
22
|
+
*/
|
|
23
|
+
tone?: 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info';
|
|
24
|
+
/**
|
|
25
|
+
* Badge text. A rule without a label is marker-only.
|
|
26
|
+
*/
|
|
27
|
+
label?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional badge icon name.
|
|
30
|
+
*/
|
|
31
|
+
icon?: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Text joined into the card's accessible description so a
|
|
34
|
+
* rule is never communicated by colour alone.
|
|
35
|
+
*/
|
|
36
|
+
description?: string;
|
|
37
|
+
};
|
|
38
|
+
export type KanbanMoveEvaluation = {
|
|
39
|
+
/**
|
|
40
|
+
* Whether the move may proceed to the cancelable event.
|
|
41
|
+
*/
|
|
42
|
+
allowed: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Refusal reason, or null when allowed.
|
|
45
|
+
*/
|
|
46
|
+
reason: KanbanRejectReason | null;
|
|
47
|
+
/**
|
|
48
|
+
* The limit the destination count was measured against.
|
|
49
|
+
*/
|
|
50
|
+
limit: number | null;
|
|
51
|
+
/**
|
|
52
|
+
* Resulting record count in the constrained scope.
|
|
53
|
+
*/
|
|
54
|
+
count: number;
|
|
55
|
+
/**
|
|
56
|
+
* Whether an applicable limit would be exceeded.
|
|
57
|
+
*/
|
|
58
|
+
limitExceeded: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Whether an applicable limit would be met exactly.
|
|
61
|
+
*/
|
|
62
|
+
limitReached: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Effective work-in-progress policy.
|
|
65
|
+
*/
|
|
66
|
+
policy: 'warn' | 'block';
|
|
67
|
+
};
|
|
68
|
+
export type KanbanRejectReason = 'accept' | 'transition' | 'wip' | 'lane-accept' | 'lane-transition' | 'lane-wip' | 'destination' | 'grouping';
|
|
69
|
+
export type KanbanHistoryEntry = {
|
|
70
|
+
/**
|
|
71
|
+
* Record order before or after one committed move.
|
|
72
|
+
*/
|
|
73
|
+
records: KanbanRecord[];
|
|
74
|
+
/**
|
|
75
|
+
* Selected record ids at that moment.
|
|
76
|
+
*/
|
|
77
|
+
selection: unknown[];
|
|
78
|
+
/**
|
|
79
|
+
* Human-readable description of the step.
|
|
80
|
+
*/
|
|
81
|
+
label?: string;
|
|
82
|
+
};
|
|
83
|
+
export type KanbanHistory = {
|
|
84
|
+
/**
|
|
85
|
+
* Records a step and drops the redo stack.
|
|
86
|
+
*/
|
|
87
|
+
push: (entry: KanbanHistoryEntry) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Steps back.
|
|
90
|
+
*/
|
|
91
|
+
undo: (current: KanbanHistoryEntry) => KanbanHistoryEntry | null;
|
|
92
|
+
/**
|
|
93
|
+
* Steps forward.
|
|
94
|
+
*/
|
|
95
|
+
redo: (current: KanbanHistoryEntry) => KanbanHistoryEntry | null;
|
|
96
|
+
/**
|
|
97
|
+
* Whether a step back exists.
|
|
98
|
+
*/
|
|
99
|
+
canUndo: () => boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Whether a step forward exists.
|
|
102
|
+
*/
|
|
103
|
+
canRedo: () => boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Empties both stacks.
|
|
106
|
+
*/
|
|
107
|
+
clear: () => void;
|
|
108
|
+
/**
|
|
109
|
+
* Current stack depths.
|
|
110
|
+
*/
|
|
111
|
+
depth: () => {
|
|
112
|
+
undo: number;
|
|
113
|
+
redo: number;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Validates and clones ordered card rules. Rules are pure presentation: they never change a
|
|
118
|
+
* record, a move, or a policy decision.
|
|
119
|
+
* @param {unknown} rules Configured rules.
|
|
120
|
+
* @returns {KanbanRule[]} Normalized rules.
|
|
121
|
+
*/
|
|
122
|
+
export declare function normalizeKanbanRules(rules: unknown): KanbanRule[];
|
|
123
|
+
/**
|
|
124
|
+
* Returns the rules matching one record, in configured order. A predicate that throws is treated
|
|
125
|
+
* as "does not apply" so one broken rule cannot take the board down.
|
|
126
|
+
* @param {KanbanRule[]} rules Normalized rules.
|
|
127
|
+
* @param {KanbanRecord} record Record.
|
|
128
|
+
* @param {{index:number,column:string,lane:string|null}} context Position context.
|
|
129
|
+
* @returns {KanbanRule[]} Matching rules.
|
|
130
|
+
*/
|
|
131
|
+
export declare function resolveKanbanRules(rules: KanbanRule[], record: KanbanRecord, context: {
|
|
132
|
+
index: number;
|
|
133
|
+
column: string;
|
|
134
|
+
lane: string | null;
|
|
135
|
+
}): KanbanRule[];
|
|
136
|
+
/**
|
|
137
|
+
* Decides whether a proposed move may proceed, and reports the work-in-progress consequence either
|
|
138
|
+
* way. Checks run in a fixed order — transition, eligibility, then capacity — so a refusal always
|
|
139
|
+
* names the first constraint the move violates rather than an arbitrary one.
|
|
140
|
+
*
|
|
141
|
+
* Counts exclude the moving records, so a reorder inside one column is measured against the column
|
|
142
|
+
* it is already in rather than being told it doubles the load.
|
|
143
|
+
*
|
|
144
|
+
* @param {Object} input Evaluation input.
|
|
145
|
+
* @param {KanbanRecord[]} input.records Records being moved together.
|
|
146
|
+
* @param {KanbanColumn} input.column Destination column descriptor.
|
|
147
|
+
* @param {KanbanSwimlane|null} input.swimlane Destination lane descriptor, or null.
|
|
148
|
+
* @param {import('./kanban-view.js').KanbanMoveContext} input.context Context passed to `accept`.
|
|
149
|
+
* @param {KanbanMovePoint} input.from Origin of the primary record.
|
|
150
|
+
* @param {number} input.columnCount Records already in the destination column, movers excluded.
|
|
151
|
+
* @param {number} input.laneCount Records already in the destination lane, movers excluded.
|
|
152
|
+
* @param {number} input.cellCount Records already in the destination column and lane, movers excluded.
|
|
153
|
+
* @param {'warn'|'block'} [input.policy='warn'] Board work-in-progress policy.
|
|
154
|
+
* @returns {KanbanMoveEvaluation} Decision and capacity report.
|
|
155
|
+
*/
|
|
156
|
+
export declare function evaluateKanbanMove(input: {
|
|
157
|
+
records: KanbanRecord[];
|
|
158
|
+
column: KanbanColumn;
|
|
159
|
+
swimlane: KanbanSwimlane | null;
|
|
160
|
+
context: import('./kanban-view.js').KanbanMoveContext;
|
|
161
|
+
from: KanbanMovePoint;
|
|
162
|
+
columnCount: number;
|
|
163
|
+
laneCount: number;
|
|
164
|
+
cellCount: number;
|
|
165
|
+
policy?: 'warn' | 'block';
|
|
166
|
+
}): KanbanMoveEvaluation;
|
|
167
|
+
/**
|
|
168
|
+
* Reports which transition allow-list, if any, refuses one origin. A move that stays on an axis is
|
|
169
|
+
* never judged by that axis's rule: reordering inside a column is not a transition into it.
|
|
170
|
+
* @param {KanbanColumn} column Destination column.
|
|
171
|
+
* @param {KanbanSwimlane|null} swimlane Destination lane, or null.
|
|
172
|
+
* @param {KanbanMovePoint} from Origin.
|
|
173
|
+
* @returns {'transition'|'lane-transition'|null} Refusing rule, or null when the origin is admitted.
|
|
174
|
+
*/
|
|
175
|
+
export declare function allowsKanbanTransition(column: KanbanColumn, swimlane: KanbanSwimlane | null, from: KanbanMovePoint): 'transition' | 'lane-transition' | null;
|
|
176
|
+
/**
|
|
177
|
+
* Splits a search string into lowercase terms. Quoted groups stay together so `"needs review"`
|
|
178
|
+
* matches a phrase rather than two independent words.
|
|
179
|
+
* @param {unknown} search Raw search string.
|
|
180
|
+
* @returns {string[]} Lowercase terms.
|
|
181
|
+
*/
|
|
182
|
+
export declare function kanbanSearchTerms(search: unknown): string[];
|
|
183
|
+
/**
|
|
184
|
+
* Reports whether searchable text contains every term.
|
|
185
|
+
* @param {string} text Concatenated searchable text.
|
|
186
|
+
* @param {string[]} terms Lowercase terms.
|
|
187
|
+
* @returns {boolean} Whether the record matches.
|
|
188
|
+
*/
|
|
189
|
+
export declare function matchesKanbanSearch(text: string, terms: string[]): boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Bounded undo/redo stack over whole record-order snapshots. Snapshots are shallow arrays of the
|
|
192
|
+
* very record objects the board already holds, so a step costs one array rather than a deep clone;
|
|
193
|
+
* this is safe precisely because a Kanban move clones the record it changes and never mutates one.
|
|
194
|
+
* @param {number} [limit=50] Maximum remembered steps.
|
|
195
|
+
* @returns {KanbanHistory} History controller.
|
|
196
|
+
*/
|
|
197
|
+
export declare function createKanbanHistory(limit?: number): KanbanHistory;
|
|
198
|
+
/**
|
|
199
|
+
* Reorders records around one or more already-cloned moved records. The input array and every
|
|
200
|
+
* input record remain untouched. Movers keep their relative order and land contiguously, so a
|
|
201
|
+
* multi-card move reads on the board exactly as it read before it was picked up.
|
|
202
|
+
*
|
|
203
|
+
* The destination index is relative to the records remaining in the destination column and lane
|
|
204
|
+
* after the movers are lifted out — the same frame of reference a user sees while dragging.
|
|
205
|
+
*
|
|
206
|
+
* @param {KanbanRecord[]} records Current records.
|
|
207
|
+
* @param {{id:unknown,record:KanbanRecord}[]} entries Moving ids paired with their cloned records.
|
|
208
|
+
* @param {{recordId:string|((record:KanbanRecord)=>unknown),columnBy:KanbanAccessor,swimlaneBy:KanbanAccessor,destination:KanbanMovePoint}} options Accessors and destination.
|
|
209
|
+
* @returns {{records:KanbanRecord[],moves:{id:unknown,from:KanbanMovePoint}[],to:KanbanMovePoint}|null}
|
|
210
|
+
*/
|
|
211
|
+
export declare function reorderKanbanRecords(records: KanbanRecord[], entries: {
|
|
212
|
+
id: unknown;
|
|
213
|
+
record: KanbanRecord;
|
|
214
|
+
}[], options: {
|
|
215
|
+
recordId: string | ((record: KanbanRecord) => unknown);
|
|
216
|
+
columnBy: KanbanAccessor;
|
|
217
|
+
swimlaneBy: KanbanAccessor;
|
|
218
|
+
destination: KanbanMovePoint;
|
|
219
|
+
}): {
|
|
220
|
+
records: KanbanRecord[];
|
|
221
|
+
moves: {
|
|
222
|
+
id: unknown;
|
|
223
|
+
from: KanbanMovePoint;
|
|
224
|
+
}[];
|
|
225
|
+
to: KanbanMovePoint;
|
|
226
|
+
} | null;
|
|
227
|
+
/**
|
|
228
|
+
* Resolves one record's column, lane, and position within its bucket.
|
|
229
|
+
* @param {KanbanRecord[]} records Records.
|
|
230
|
+
* @param {number} index Position in `records`.
|
|
231
|
+
* @param {{recordId:string|((record:KanbanRecord)=>unknown),columnBy:KanbanAccessor,swimlaneBy:KanbanAccessor}} options Accessors.
|
|
232
|
+
* @returns {KanbanMovePoint} Location.
|
|
233
|
+
*/
|
|
234
|
+
export declare function locateKanbanRecord(records: KanbanRecord[], index: number, options: {
|
|
235
|
+
recordId: string | ((record: KanbanRecord) => unknown);
|
|
236
|
+
columnBy: KanbanAccessor;
|
|
237
|
+
swimlaneBy: KanbanAccessor;
|
|
238
|
+
}): KanbanMovePoint;
|
|
239
|
+
/**
|
|
240
|
+
* Translates a position among *rendered* cards into a position among all records in the same
|
|
241
|
+
* column and lane. Search and filters hide records without removing them, and a drop between two
|
|
242
|
+
* visible cards must land between them in the underlying data rather than at the same ordinal.
|
|
243
|
+
* @param {boolean[]} visibility Per-record visibility inside the bucket, in record order.
|
|
244
|
+
* @param {number} visibleIndex Zero-based position among the visible records.
|
|
245
|
+
* @returns {number} Zero-based position among all records in the bucket.
|
|
246
|
+
*/
|
|
247
|
+
export declare function absoluteKanbanIndex(visibility: boolean[], visibleIndex: number): number;
|
|
248
|
+
/**
|
|
249
|
+
* Reads a grouping accessor without touching field descriptors.
|
|
250
|
+
* @param {KanbanRecord} record Record.
|
|
251
|
+
* @param {number} index Display index.
|
|
252
|
+
* @param {KanbanAccessor} accessor Accessor.
|
|
253
|
+
* @returns {unknown} Raw value.
|
|
254
|
+
*/
|
|
255
|
+
export declare function readKanbanAccessor(record: KanbanRecord, index: number, accessor: KanbanAccessor): unknown;
|
|
256
|
+
/**
|
|
257
|
+
* Normalizes any grouping value to its stable string id.
|
|
258
|
+
* @param {unknown} value Raw value.
|
|
259
|
+
* @returns {string} Axis id.
|
|
260
|
+
*/
|
|
261
|
+
export declare function normalizeAxisId(value: unknown): string;
|
|
262
|
+
/**
|
|
263
|
+
* Clamps a requested position into an insertable range, treating anything unusable as "append".
|
|
264
|
+
* @param {unknown} value Requested index.
|
|
265
|
+
* @param {number} maximum Highest insertable position.
|
|
266
|
+
* @returns {number} Clamped index.
|
|
267
|
+
*/
|
|
268
|
+
export declare function clampKanbanIndex(value: unknown, maximum: number): number;
|