@mgamadeus/ddd-admin-ui 0.1.0-rc.2 → 0.1.0-rc.3
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/.claude/skills/ddd-admin-ui-specialist/SKILL.md +13 -2
- package/CHANGELOG.md +39 -1
- package/README.md +12 -3
- package/STANDARDS.md +105 -57
- package/dist/components.css +55 -0
- package/dist/i18n/hints.json +2 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/store.d.ts +10 -2
- package/dist/i18n/store.d.ts.map +1 -1
- package/dist/i18n/store.js +6 -2
- package/dist/i18n/store.js.map +1 -1
- package/dist/i18n-keys.json +9 -1
- package/dist/list/EntityListBody.d.ts +10 -3
- package/dist/list/EntityListBody.d.ts.map +1 -1
- package/dist/list/EntityListBody.js +9 -3
- package/dist/list/EntityListBody.js.map +1 -1
- package/dist/list/EntityListTable.d.ts +35 -2
- package/dist/list/EntityListTable.d.ts.map +1 -1
- package/dist/list/EntityListTable.js +157 -6
- package/dist/list/EntityListTable.js.map +1 -1
- package/dist/list/StatusBadge.d.ts +1 -1
- package/dist/list/StatusBadge.d.ts.map +1 -1
- package/dist/list/StatusBadge.js +3 -2
- package/dist/list/StatusBadge.js.map +1 -1
- package/dist/logic/index.d.ts +5 -1
- package/dist/logic/index.d.ts.map +1 -1
- package/dist/logic/index.js +2 -0
- package/dist/logic/index.js.map +1 -1
- package/dist/logic/pure/listSort.d.ts +21 -0
- package/dist/logic/pure/listSort.d.ts.map +1 -0
- package/dist/logic/pure/listSort.js +31 -0
- package/dist/logic/pure/listSort.js.map +1 -0
- package/dist/logic/pure/listTracks.d.ts +90 -0
- package/dist/logic/pure/listTracks.d.ts.map +1 -0
- package/dist/logic/pure/listTracks.js +139 -0
- package/dist/logic/pure/listTracks.js.map +1 -0
- package/dist/logic/pure/status.d.ts +23 -2
- package/dist/logic/pure/status.d.ts.map +1 -1
- package/dist/logic/pure/status.js +23 -2
- package/dist/logic/pure/status.js.map +1 -1
- package/dist/tokens.json +20 -0
- package/package.json +3 -6
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sort after a click on the header of `key`: not sorted → ascending → descending → not sorted (`null`: the host
|
|
3
|
+
* applies its default order). A click on another column starts that column ascending.
|
|
4
|
+
*/
|
|
5
|
+
export const nextListSort = (current, key) => {
|
|
6
|
+
if (!current || current.key !== key)
|
|
7
|
+
return { key, direction: 'asc' };
|
|
8
|
+
return current.direction === 'asc' ? { key, direction: 'desc' } : null;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Reads a sort written by `formatListSort` (`name:asc`, `createdTime:desc`) back, e.g. from a URL parameter. Anything
|
|
12
|
+
* else — empty, no direction, an unknown direction, a key outside `allowedKeys` when given — is `null`, so a stale
|
|
13
|
+
* link falls back to the default order.
|
|
14
|
+
*/
|
|
15
|
+
export const parseListSort = (text, allowedKeys) => {
|
|
16
|
+
if (!text)
|
|
17
|
+
return null;
|
|
18
|
+
const separator = text.lastIndexOf(':');
|
|
19
|
+
if (separator <= 0)
|
|
20
|
+
return null;
|
|
21
|
+
const key = text.slice(0, separator);
|
|
22
|
+
const direction = text.slice(separator + 1);
|
|
23
|
+
if (direction !== 'asc' && direction !== 'desc')
|
|
24
|
+
return null;
|
|
25
|
+
if (allowedKeys && !allowedKeys.includes(key))
|
|
26
|
+
return null;
|
|
27
|
+
return { key, direction };
|
|
28
|
+
};
|
|
29
|
+
/** Writes a sort as one text, `key:asc` / `key:desc`; no sort is `''` (an empty URL parameter is removed). */
|
|
30
|
+
export const formatListSort = (sort) => sort ? `${sort.key}:${sort.direction}` : '';
|
|
31
|
+
//# sourceMappingURL=listSort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listSort.js","sourceRoot":"","sources":["../../../src/logic/pure/listSort.ts"],"names":[],"mappings":"AASA;;;GAGG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+
/**
|
|
2
|
+
* Column tracks and pins of a list table, as pure functions: the table measures its visible width after hydration and
|
|
3
|
+
* applies what these return. Nothing here reads the DOM.
|
|
4
|
+
*/
|
|
5
|
+
/** Width of a column track: a share of the free width (`'1fr'`, `'2fr'`) or a fixed length (`'120px'`). */
|
|
6
|
+
export type ListColumnWidth = `${number}fr` | `${number}px`;
|
|
7
|
+
/** Edge a column stays at while the table scrolls sideways. */
|
|
8
|
+
export type ListColumnPin = 'start' | 'end';
|
|
9
|
+
/** Horizontal alignment of a column's header and cells. */
|
|
10
|
+
export type ListColumnAlign = 'start' | 'center' | 'end';
|
|
11
|
+
/** Lower bound (px) of a share column without its own `minWidth`. */
|
|
12
|
+
export declare const LIST_COLUMN_MIN_WIDTH = 120;
|
|
13
|
+
/** A start pin is honoured only while the pinned columns together take less than this share of the visible width. */
|
|
14
|
+
export declare const LIST_PIN_MAX_VISIBLE_SHARE: number;
|
|
15
|
+
/**
|
|
16
|
+
* A start pin is honoured only while the table overflows its visible width by at least this much (px): a sliver of
|
|
17
|
+
* sideways scroll is not worth a column that never moves.
|
|
18
|
+
*/
|
|
19
|
+
export declare const LIST_PIN_MIN_OVERFLOW = 120;
|
|
20
|
+
/** One track as the table declares it. */
|
|
21
|
+
export interface ListTrack {
|
|
22
|
+
/** `'<n>fr'` or `'<n>px'`; absent (or anything else) is `'1fr'`. */
|
|
23
|
+
width?: string;
|
|
24
|
+
/** Lower bound in px of a share track (default `LIST_COLUMN_MIN_WIDTH`); a fixed track keeps its length. */
|
|
25
|
+
minWidth?: number;
|
|
26
|
+
}
|
|
27
|
+
/** Does the table opt into tracks? As soon as one column declares a `width`. */
|
|
28
|
+
export declare const hasListTracks: (tracks: readonly ListTrack[]) => boolean;
|
|
29
|
+
/** The narrowest the table can be: fixed lengths plus the minimum of every share track (px). */
|
|
30
|
+
export declare const minimumListWidth: (tracks: readonly ListTrack[]) => number;
|
|
31
|
+
/**
|
|
32
|
+
* The CSS `grid-template-columns` of the tracks, before the visible width is known (server render, hydration): fixed
|
|
33
|
+
* lengths and `minmax(<minimum>px, <n>fr)`. CSS resolves it to the same widths as `computeListTracks`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const listTrackTemplate: (tracks: readonly ListTrack[]) => string;
|
|
36
|
+
/** Track widths for one visible width. */
|
|
37
|
+
export interface ListTrackLayout {
|
|
38
|
+
/** px per track, in track order. */
|
|
39
|
+
widths: number[];
|
|
40
|
+
/** Sum of the widths: the table's width, larger than the visible width when it overflows. */
|
|
41
|
+
scrollWidth: number;
|
|
42
|
+
/** `scrollWidth` exceeds the visible width: the table scrolls sideways inside its card. */
|
|
43
|
+
overflows: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Divides `availableWidth` (the visible width of the table, px) among the tracks. Fixed tracks keep their length. Share
|
|
47
|
+
* tracks divide what is left by their factors; a track whose share falls below its minimum is held at the minimum and
|
|
48
|
+
* the rest is divided again among the others (the CSS `fr` rule). When the minimums do not fit, every share track sits
|
|
49
|
+
* at its minimum and the table overflows. Widths are whole pixels; rounding goes to the last free share track, so a
|
|
50
|
+
* table that fits fills the width exactly.
|
|
51
|
+
*/
|
|
52
|
+
export declare const computeListTracks: (tracks: readonly ListTrack[], availableWidth: number) => ListTrackLayout;
|
|
53
|
+
/** One column as the pin layout sees it. */
|
|
54
|
+
export interface ListPinRequest {
|
|
55
|
+
pin?: ListColumnPin;
|
|
56
|
+
/** Pinned at the start whatever the guard says (the selection and row index columns). */
|
|
57
|
+
always?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/** Where a pinned column sticks: its edge and the distance (px) from that edge of the scroll area. */
|
|
60
|
+
export interface ListPinPlacement {
|
|
61
|
+
side: ListColumnPin;
|
|
62
|
+
offset: number;
|
|
63
|
+
/** The innermost pinned column of its side: it draws the separating edge while content scrolls under it. */
|
|
64
|
+
edge: boolean;
|
|
65
|
+
}
|
|
66
|
+
/** The measured or computed sizes the pin layout works from; `null` while unknown (before hydration). */
|
|
67
|
+
export interface ListPinMeasure {
|
|
68
|
+
/** px per column, `null` for a column whose width is not known yet. */
|
|
69
|
+
widths: readonly (number | null)[];
|
|
70
|
+
visibleWidth: number | null;
|
|
71
|
+
scrollWidth: number | null;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The pin guard: requested start pins hold only while the table overflows by at least `LIST_PIN_MIN_OVERFLOW` and all
|
|
75
|
+
* pinned columns (start, end and the always-pinned ones) take less than a third of the visible width. Otherwise the
|
|
76
|
+
* columns that asked for a start pin scroll like the others.
|
|
77
|
+
*/
|
|
78
|
+
export declare const shouldHonourStartPins: (visibleWidth: number | null, scrollWidth: number | null, pinnedWidth: number | null) => boolean;
|
|
79
|
+
/** The pin layout of a table: a placement per column (`null` = scrolls) and whether the start pins are honoured. */
|
|
80
|
+
export interface ListPinLayout {
|
|
81
|
+
placements: (ListPinPlacement | null)[];
|
|
82
|
+
startPinsHonoured: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Places the pinned columns. Always-pinned columns and (when the guard allows) start pins stick at the start, each
|
|
86
|
+
* offset by the pinned columns before it; end pins always stick at the end, offset by the end pins after them. A column
|
|
87
|
+
* whose offset depends on a width not known yet is not placed (before hydration only fixed widths are known).
|
|
88
|
+
*/
|
|
89
|
+
export declare const resolveListPins: (columns: readonly ListPinRequest[], measure: ListPinMeasure) => ListPinLayout;
|
|
90
|
+
//# sourceMappingURL=listTracks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listTracks.d.ts","sourceRoot":"","sources":["../../../src/logic/pure/listTracks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,2GAA2G;AAC3G,MAAM,MAAM,eAAe,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,MAAM,IAAI,CAAC;AAE5D,+DAA+D;AAC/D,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,CAAC;AAE5C,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GAAG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,WAAW,cAAc;IAC7B,uEAAuE;IACvE,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,cAAc,MAAM,GAAG,IAAI,EAAE,aAAa,MAAM,GAAG,IAAI,EAAE,aAAa,MAAM,GAAG,IAAI,KAAG,OAI3H,CAAC;AAEF,oHAAoH;AACpH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAAE,CAAC;IACxC,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,SAAS,cAAc,EAAE,EAAE,SAAS,cAAc,KAAG,aAkC7F,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column tracks and pins of a list table, as pure functions: the table measures its visible width after hydration and
|
|
3
|
+
* applies what these return. Nothing here reads the DOM.
|
|
4
|
+
*/
|
|
5
|
+
/** Lower bound (px) of a share column without its own `minWidth`. */
|
|
6
|
+
export const LIST_COLUMN_MIN_WIDTH = 120;
|
|
7
|
+
/** A start pin is honoured only while the pinned columns together take less than this share of the visible width. */
|
|
8
|
+
export const LIST_PIN_MAX_VISIBLE_SHARE = 1 / 3;
|
|
9
|
+
/**
|
|
10
|
+
* A start pin is honoured only while the table overflows its visible width by at least this much (px): a sliver of
|
|
11
|
+
* sideways scroll is not worth a column that never moves.
|
|
12
|
+
*/
|
|
13
|
+
export const LIST_PIN_MIN_OVERFLOW = 120;
|
|
14
|
+
const FIXED = /^(\d+(?:\.\d+)?|\.\d+)px$/;
|
|
15
|
+
const SHARE = /^(\d+(?:\.\d+)?|\.\d+)fr$/;
|
|
16
|
+
const parseTrack = ({ width, minWidth }) => {
|
|
17
|
+
const fixed = width ? FIXED.exec(width.trim()) : null;
|
|
18
|
+
if (fixed)
|
|
19
|
+
return { kind: 'fixed', length: Number(fixed[1]) };
|
|
20
|
+
const share = width ? SHARE.exec(width.trim()) : null;
|
|
21
|
+
const factor = share ? Number(share[1]) : 1;
|
|
22
|
+
return {
|
|
23
|
+
kind: 'share',
|
|
24
|
+
factor: factor > 0 ? factor : 1,
|
|
25
|
+
minimum: Math.max(0, minWidth ?? LIST_COLUMN_MIN_WIDTH),
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/** Does the table opt into tracks? As soon as one column declares a `width`. */
|
|
29
|
+
export const hasListTracks = (tracks) => tracks.some(track => track.width !== undefined);
|
|
30
|
+
/** The narrowest the table can be: fixed lengths plus the minimum of every share track (px). */
|
|
31
|
+
export const minimumListWidth = (tracks) => tracks.reduce((sum, track) => {
|
|
32
|
+
const parsed = parseTrack(track);
|
|
33
|
+
return sum + (parsed.kind === 'fixed' ? parsed.length : parsed.minimum);
|
|
34
|
+
}, 0);
|
|
35
|
+
/**
|
|
36
|
+
* The CSS `grid-template-columns` of the tracks, before the visible width is known (server render, hydration): fixed
|
|
37
|
+
* lengths and `minmax(<minimum>px, <n>fr)`. CSS resolves it to the same widths as `computeListTracks`.
|
|
38
|
+
*/
|
|
39
|
+
export const listTrackTemplate = (tracks) => tracks
|
|
40
|
+
.map(track => {
|
|
41
|
+
const parsed = parseTrack(track);
|
|
42
|
+
return parsed.kind === 'fixed' ? `${parsed.length}px` : `minmax(${parsed.minimum}px, ${parsed.factor}fr)`;
|
|
43
|
+
})
|
|
44
|
+
.join(' ');
|
|
45
|
+
/**
|
|
46
|
+
* Divides `availableWidth` (the visible width of the table, px) among the tracks. Fixed tracks keep their length. Share
|
|
47
|
+
* tracks divide what is left by their factors; a track whose share falls below its minimum is held at the minimum and
|
|
48
|
+
* the rest is divided again among the others (the CSS `fr` rule). When the minimums do not fit, every share track sits
|
|
49
|
+
* at its minimum and the table overflows. Widths are whole pixels; rounding goes to the last free share track, so a
|
|
50
|
+
* table that fits fills the width exactly.
|
|
51
|
+
*/
|
|
52
|
+
export const computeListTracks = (tracks, availableWidth) => {
|
|
53
|
+
const available = Math.max(0, Math.floor(availableWidth));
|
|
54
|
+
const parsed = tracks.map(parseTrack);
|
|
55
|
+
const widths = parsed.map(track => (track.kind === 'fixed' ? track.length : track.minimum));
|
|
56
|
+
const fixedTotal = parsed.reduce((sum, track) => sum + (track.kind === 'fixed' ? track.length : 0), 0);
|
|
57
|
+
let free = available - fixedTotal;
|
|
58
|
+
let open = parsed.flatMap((track, index) => (track.kind === 'share' ? [index] : []));
|
|
59
|
+
while (open.length > 0) {
|
|
60
|
+
const factors = open.reduce((sum, index) => sum + parsed[index].factor, 0);
|
|
61
|
+
const unit = free / factors;
|
|
62
|
+
const held = open.filter(index => {
|
|
63
|
+
const track = parsed[index];
|
|
64
|
+
return track.factor * unit < track.minimum;
|
|
65
|
+
});
|
|
66
|
+
if (held.length === 0) {
|
|
67
|
+
let assigned = 0;
|
|
68
|
+
for (const index of open) {
|
|
69
|
+
const width = Math.floor(parsed[index].factor * unit);
|
|
70
|
+
widths[index] = width;
|
|
71
|
+
assigned += width;
|
|
72
|
+
}
|
|
73
|
+
const last = open[open.length - 1];
|
|
74
|
+
widths[last] = widths[last] + (free - assigned);
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
for (const index of held)
|
|
78
|
+
free -= parsed[index].minimum;
|
|
79
|
+
open = open.filter(index => !held.includes(index));
|
|
80
|
+
}
|
|
81
|
+
const scrollWidth = widths.reduce((sum, width) => sum + width, 0);
|
|
82
|
+
return { widths, scrollWidth, overflows: scrollWidth > available };
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* The pin guard: requested start pins hold only while the table overflows by at least `LIST_PIN_MIN_OVERFLOW` and all
|
|
86
|
+
* pinned columns (start, end and the always-pinned ones) take less than a third of the visible width. Otherwise the
|
|
87
|
+
* columns that asked for a start pin scroll like the others.
|
|
88
|
+
*/
|
|
89
|
+
export const shouldHonourStartPins = (visibleWidth, scrollWidth, pinnedWidth) => {
|
|
90
|
+
if (visibleWidth === null || scrollWidth === null || pinnedWidth === null || visibleWidth <= 0)
|
|
91
|
+
return false;
|
|
92
|
+
if (scrollWidth - visibleWidth < LIST_PIN_MIN_OVERFLOW)
|
|
93
|
+
return false;
|
|
94
|
+
return pinnedWidth < visibleWidth * LIST_PIN_MAX_VISIBLE_SHARE;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Places the pinned columns. Always-pinned columns and (when the guard allows) start pins stick at the start, each
|
|
98
|
+
* offset by the pinned columns before it; end pins always stick at the end, offset by the end pins after them. A column
|
|
99
|
+
* whose offset depends on a width not known yet is not placed (before hydration only fixed widths are known).
|
|
100
|
+
*/
|
|
101
|
+
export const resolveListPins = (columns, measure) => {
|
|
102
|
+
const widthAt = (index) => measure.widths[index] ?? null;
|
|
103
|
+
const pinnedIndexes = columns.flatMap((column, index) => (column.always || column.pin ? [index] : []));
|
|
104
|
+
const requestsStart = columns.some(column => !column.always && column.pin === 'start');
|
|
105
|
+
let pinnedWidth = 0;
|
|
106
|
+
for (const index of pinnedIndexes) {
|
|
107
|
+
const width = widthAt(index);
|
|
108
|
+
pinnedWidth = pinnedWidth === null || width === null ? null : pinnedWidth + width;
|
|
109
|
+
}
|
|
110
|
+
const startPinsHonoured = requestsStart && shouldHonourStartPins(measure.visibleWidth, measure.scrollWidth, pinnedWidth);
|
|
111
|
+
const placements = columns.map(() => null);
|
|
112
|
+
let startOffset = 0;
|
|
113
|
+
let lastStart = -1;
|
|
114
|
+
columns.forEach((column, index) => {
|
|
115
|
+
if (!(column.always || (column.pin === 'start' && startPinsHonoured)) || startOffset === null)
|
|
116
|
+
return;
|
|
117
|
+
placements[index] = { side: 'start', offset: startOffset, edge: false };
|
|
118
|
+
lastStart = index;
|
|
119
|
+
const width = widthAt(index);
|
|
120
|
+
startOffset = width === null ? null : startOffset + width;
|
|
121
|
+
});
|
|
122
|
+
let endOffset = 0;
|
|
123
|
+
let firstEnd = -1;
|
|
124
|
+
for (let index = columns.length - 1; index >= 0; index -= 1) {
|
|
125
|
+
const column = columns[index];
|
|
126
|
+
if (column.always || column.pin !== 'end' || endOffset === null)
|
|
127
|
+
continue;
|
|
128
|
+
placements[index] = { side: 'end', offset: endOffset, edge: false };
|
|
129
|
+
firstEnd = index;
|
|
130
|
+
const width = widthAt(index);
|
|
131
|
+
endOffset = width === null ? null : endOffset + width;
|
|
132
|
+
}
|
|
133
|
+
if (lastStart !== -1)
|
|
134
|
+
placements[lastStart].edge = true;
|
|
135
|
+
if (firstEnd !== -1)
|
|
136
|
+
placements[firstEnd].edge = true;
|
|
137
|
+
return { placements, startPinsHonoured };
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=listTracks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listTracks.js","sourceRoot":"","sources":["../../../src/logic/pure/listTracks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,qEAAqE;AACrE,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,qHAAqH;AACrH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,GAAG,CAAC,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAYzC,MAAM,KAAK,GAAG,2BAA2B,CAAC;AAC1C,MAAM,KAAK,GAAG,2BAA2B,CAAC;AAE1C,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAa,EAAe,EAAE;IACjE,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACtD,IAAI,KAAK;QAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAA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AAC;QAC5D,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAmB,CAAC;QAChD,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,GAAG,KAAK,KAAK,IAAI,SAAS,KAAK,IAAI;YAAE,SAAS;QAC1E,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QACpE,QAAQ,GAAG,KAAK,CAAC;QACjB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7B,SAAS,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;IACxD,CAAC;IACD,IAAI,SAAS,KAAK,CAAC,CAAC;QAAG,UAAU,CAAC,SAAS,CAAsB,CAAC,IAAI,GAAG,IAAI,CAAC;IAC9E,IAAI,QAAQ,KAAK,CAAC,CAAC;QAAG,UAAU,CAAC,QAAQ,CAAsB,CAAC,IAAI,GAAG,IAAI,CAAC;IAC5E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC;AAC3C,CAAC,CAAC"}
|
|
@@ -13,9 +13,30 @@ export interface StatusDefinition {
|
|
|
13
13
|
icon?: LucideIcon;
|
|
14
14
|
/** Hover text (e.g. what the status means). */
|
|
15
15
|
description?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Translation context of `label` and `description` (key `<text>__<context>`), for a word that means something else
|
|
18
|
+
* elsewhere (`Open` as a status vs. as an action). Mark the label with the same context so text exports find the
|
|
19
|
+
* key: `label: m('Failed', { context: 'import-status' })`.
|
|
20
|
+
*/
|
|
21
|
+
context?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Options of a whole status family. */
|
|
24
|
+
export interface StatusMapOptions {
|
|
25
|
+
/** Translation context of every definition without its own `context`. */
|
|
26
|
+
context?: string;
|
|
16
27
|
}
|
|
17
28
|
/** A status family: every value of one enum → its badge. Define it once per family and reuse it in rows, cards, details. */
|
|
18
29
|
export type StatusMap<TValue extends string = string> = Readonly<Record<TValue, StatusDefinition>>;
|
|
19
|
-
/**
|
|
20
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Typed helper: `defineStatusMap<Item['status'] & string>({ RUNNING: { … }, … })` checks completeness. Without options
|
|
32
|
+
* it returns the map itself; with a `context` every definition without its own gets it (the definition's wins):
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* const IMPORT_STATUS = defineStatusMap(
|
|
36
|
+
* { FAILED: { label: m('Failed', { context: 'import-status' }), tone: 'danger', icon: CircleX } },
|
|
37
|
+
* { context: 'import-status' },
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare const defineStatusMap: <TValue extends string>(map: Record<TValue, StatusDefinition>, options?: StatusMapOptions) => StatusMap<TValue>;
|
|
21
42
|
//# sourceMappingURL=status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/logic/pure/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/logic/pure/status.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAEvG,yGAAyG;AACzG,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wCAAwC;AACxC,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,4HAA4H;AAC5H,MAAM,MAAM,SAAS,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEnG;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,SAAS,MAAM,EACnD,KAAK,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,EACrC,UAAU,gBAAgB,KACzB,SAAS,CAAC,MAAM,CASlB,CAAC"}
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @translations-ignore-file — the doc examples below are not UI texts
|
|
2
|
+
/**
|
|
3
|
+
* Typed helper: `defineStatusMap<Item['status'] & string>({ RUNNING: { … }, … })` checks completeness. Without options
|
|
4
|
+
* it returns the map itself; with a `context` every definition without its own gets it (the definition's wins):
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* const IMPORT_STATUS = defineStatusMap(
|
|
8
|
+
* { FAILED: { label: m('Failed', { context: 'import-status' }), tone: 'danger', icon: CircleX } },
|
|
9
|
+
* { context: 'import-status' },
|
|
10
|
+
* );
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export const defineStatusMap = (map, options) => {
|
|
14
|
+
const context = options?.context;
|
|
15
|
+
if (!context)
|
|
16
|
+
return map;
|
|
17
|
+
const withContext = {};
|
|
18
|
+
for (const value of Object.keys(map)) {
|
|
19
|
+
const definition = map[value];
|
|
20
|
+
withContext[value] = definition.context ? definition : { ...definition, context };
|
|
21
|
+
}
|
|
22
|
+
return withContext;
|
|
23
|
+
};
|
|
3
24
|
//# sourceMappingURL=status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/logic/pure/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/logic/pure/status.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAoCtE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,GAAqC,EACrC,OAA0B,EACP,EAAE;IACrB,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,CAAC;IACjC,IAAI,CAAC,OAAO;QAAE,OAAO,GAAG,CAAC;IACzB,MAAM,WAAW,GAAG,EAAsC,CAAC;IAC3D,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAa,EAAE,CAAC;QACjD,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;QAC9B,WAAW,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,UAAU,EAAE,OAAO,EAAE,CAAC;IACpF,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC"}
|
package/dist/tokens.json
CHANGED
|
@@ -390,6 +390,26 @@
|
|
|
390
390
|
"data-control": {
|
|
391
391
|
"setBy": "primitives and SearchField",
|
|
392
392
|
"readBy": "components.css"
|
|
393
|
+
},
|
|
394
|
+
"data-list-tracks": {
|
|
395
|
+
"setBy": "EntityListTable",
|
|
396
|
+
"readBy": "components.css"
|
|
397
|
+
},
|
|
398
|
+
"data-list-pin": {
|
|
399
|
+
"setBy": "EntityListTable",
|
|
400
|
+
"readBy": "components.css"
|
|
401
|
+
},
|
|
402
|
+
"data-list-pin-edge": {
|
|
403
|
+
"setBy": "EntityListTable",
|
|
404
|
+
"readBy": "components.css"
|
|
405
|
+
},
|
|
406
|
+
"data-list-overflow-start": {
|
|
407
|
+
"setBy": "EntityListTable",
|
|
408
|
+
"readBy": "components.css"
|
|
409
|
+
},
|
|
410
|
+
"data-list-overflow-end": {
|
|
411
|
+
"setBy": "EntityListTable",
|
|
412
|
+
"readBy": "components.css"
|
|
393
413
|
}
|
|
394
414
|
},
|
|
395
415
|
"hostRequirements": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgamadeus/ddd-admin-ui",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.3",
|
|
4
4
|
"description": "Admin UI building blocks for React 19 / Next 16 / Tailwind 4 apps on @mgamadeus/ddd-web: entity lists (table and card grid, filters, selection, bulk actions), page frames and detail shells, form shells with conditional fields and server validation, translatable inputs, media pickers, Next adapters, a provider, and the shadcn-style primitives they are drawn with, plus two stylesheets and two JSON manifests.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddd",
|
|
@@ -115,7 +115,6 @@
|
|
|
115
115
|
"react": "^19.0.0",
|
|
116
116
|
"react-dom": "^19.0.0",
|
|
117
117
|
"react-hook-form": "^7.65.0",
|
|
118
|
-
"recharts": "^3.0.0",
|
|
119
118
|
"sonner": "^2.0.0",
|
|
120
119
|
"tailwindcss": "^4.1.0",
|
|
121
120
|
"zod": "^4.0.0"
|
|
@@ -124,9 +123,6 @@
|
|
|
124
123
|
"next": {
|
|
125
124
|
"optional": true
|
|
126
125
|
},
|
|
127
|
-
"recharts": {
|
|
128
|
-
"optional": true
|
|
129
|
-
},
|
|
130
126
|
"sonner": {
|
|
131
127
|
"optional": true
|
|
132
128
|
},
|
|
@@ -154,6 +150,7 @@
|
|
|
154
150
|
"typecheck": "tsc -p .",
|
|
155
151
|
"test": "node --experimental-strip-types --no-warnings --test \"src/**/*.test.ts\" \"test/unit/**/*.test.ts\" \"test/check-package/**/*.test.ts\"",
|
|
156
152
|
"check-package": "node scripts/check-package.mjs --dir .",
|
|
157
|
-
"i18n:manifest": "node scripts/build-i18n-manifest.mjs"
|
|
153
|
+
"i18n:manifest": "node scripts/build-i18n-manifest.mjs",
|
|
154
|
+
"test:render": "node test/consumer/fixtures/plain/list-snapshot.mjs && node test/consumer/fixtures/plain/status-context.mjs"
|
|
158
155
|
}
|
|
159
156
|
}
|