@panneau/lists 5.0.0-alpha.16 → 5.0.0-alpha.18
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 +14 -14
- package/dist/ListSkeleton.d.ts +3 -1
- package/dist/ListSkeleton.d.ts.map +1 -1
- package/dist/ListSkeleton.js +34 -30
- package/dist/ListSkeleton.js.map +1 -1
- package/dist/ListView.d.ts +10 -3
- package/dist/ListView.d.ts.map +1 -1
- package/dist/ListView.js +44 -35
- package/dist/ListView.js.map +1 -1
- package/dist/actions/ActionButton.d.ts +7 -1
- package/dist/actions/ActionButton.d.ts.map +1 -1
- package/dist/actions/ActionButton.js +74 -72
- package/dist/actions/ActionButton.js.map +1 -1
- package/dist/actions/Actions.css +12 -0
- package/dist/actions/Actions.module.js +6 -2
- package/dist/actions/Actions.module.js.map +1 -1
- package/dist/actions/ConfirmDialog.d.ts +5 -1
- package/dist/actions/ConfirmDialog.d.ts.map +1 -1
- package/dist/actions/ConfirmDialog.js +7 -3
- package/dist/actions/ConfirmDialog.js.map +1 -1
- package/dist/actions/RowActions.d.ts +21 -4
- package/dist/actions/RowActions.d.ts.map +1 -1
- package/dist/actions/RowActions.js +149 -84
- package/dist/actions/RowActions.js.map +1 -1
- package/dist/actions/fit.d.ts +25 -0
- package/dist/actions/fit.d.ts.map +1 -0
- package/dist/actions/fit.js +197 -0
- package/dist/actions/fit.js.map +1 -0
- package/dist/actions/icons.d.ts +5 -0
- package/dist/actions/icons.d.ts.map +1 -1
- package/dist/actions/icons.js +15 -1
- package/dist/actions/icons.js.map +1 -1
- package/dist/displays/Displays.css +12 -1
- package/dist/displays/Displays.module.js +6 -2
- package/dist/displays/Displays.module.js.map +1 -1
- package/dist/displays/displays.d.ts +12 -3
- package/dist/displays/displays.d.ts.map +1 -1
- package/dist/displays/displays.js +223 -66
- package/dist/displays/displays.js.map +1 -1
- package/dist/images.d.ts +3 -2
- package/dist/images.d.ts.map +1 -1
- package/dist/images.js +24 -3
- package/dist/images.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/inline/InlineCell.d.ts +3 -1
- package/dist/inline/InlineCell.d.ts.map +1 -1
- package/dist/inline/InlineCell.js +153 -134
- package/dist/inline/InlineCell.js.map +1 -1
- package/dist/layouts/CardsLayout.d.ts.map +1 -1
- package/dist/layouts/CardsLayout.js +90 -93
- package/dist/layouts/CardsLayout.js.map +1 -1
- package/dist/layouts/GalleryLayout.css +7 -0
- package/dist/layouts/GalleryLayout.d.ts.map +1 -1
- package/dist/layouts/GalleryLayout.js +76 -53
- package/dist/layouts/GalleryLayout.js.map +1 -1
- package/dist/layouts/GalleryLayout.module.js.map +1 -1
- package/dist/layouts/TableLayout.css +31 -0
- package/dist/layouts/TableLayout.d.ts +4 -3
- package/dist/layouts/TableLayout.d.ts.map +1 -1
- package/dist/layouts/TableLayout.js +158 -98
- package/dist/layouts/TableLayout.js.map +1 -1
- package/dist/layouts/TableLayout.module.js +5 -1
- package/dist/layouts/TableLayout.module.js.map +1 -1
- package/dist/types.d.ts +4 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { messages } from "../messages.js";
|
|
2
2
|
import { ItemTitle } from "./ItemTitle.js";
|
|
3
|
+
import { RowActionsFit, fitContent, useRowActionsFit } from "../actions/fit.js";
|
|
3
4
|
import CardsLayout_module_default from "./CardsLayout.module.js";
|
|
4
5
|
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { Checkbox, usePanneauIntl } from "@panneau/ui";
|
|
@@ -7,107 +8,103 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
8
|
//#region src/layouts/CardsLayout.tsx
|
|
8
9
|
/** Items as cards: the first column is the title, the others are listed under it. */
|
|
9
10
|
function CardsLayout(t0) {
|
|
10
|
-
const $ = c(
|
|
11
|
+
const $ = c(18);
|
|
11
12
|
const { items, columns, renderValue, getItemLabel, getItemHref, isCurrent, selectable, isSelected, onToggle, renderActions, label, pageSelection } = t0;
|
|
12
13
|
const intl = usePanneauIntl();
|
|
14
|
+
const [title, ...others] = columns;
|
|
13
15
|
let t1;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let t4;
|
|
17
|
-
if ($[0] !== columns || $[1] !== getItemHref || $[2] !== getItemLabel || $[3] !== intl || $[4] !== isCurrent || $[5] !== isSelected || $[6] !== items || $[7] !== label || $[8] !== onToggle || $[9] !== pageSelection || $[10] !== renderActions || $[11] !== renderValue || $[12] !== selectable) {
|
|
18
|
-
const [title, ...others] = columns;
|
|
19
|
-
if ($[17] !== pageSelection || $[18] !== selectable) {
|
|
20
|
-
t4 = selectable ? /* @__PURE__ */ jsx("div", {
|
|
21
|
-
className: CardsLayout_module_default.pageSelection,
|
|
22
|
-
children: pageSelection
|
|
23
|
-
}) : null;
|
|
24
|
-
$[17] = pageSelection;
|
|
25
|
-
$[18] = selectable;
|
|
26
|
-
$[19] = t4;
|
|
27
|
-
} else t4 = $[19];
|
|
28
|
-
t1 = CardsLayout_module_default.cards;
|
|
29
|
-
t2 = label;
|
|
30
|
-
t3 = items.map((item) => {
|
|
31
|
-
const selected = selectable && isSelected(item);
|
|
32
|
-
const actions = renderActions(item);
|
|
33
|
-
const current = isCurrent?.(item) ?? false;
|
|
34
|
-
return /* @__PURE__ */ jsxs("li", {
|
|
35
|
-
className: CardsLayout_module_default.card,
|
|
36
|
-
"data-selected": selected || void 0,
|
|
37
|
-
"data-current": current || void 0,
|
|
38
|
-
children: [
|
|
39
|
-
/* @__PURE__ */ jsxs("div", {
|
|
40
|
-
className: CardsLayout_module_default.header,
|
|
41
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
42
|
-
className: CardsLayout_module_default.title,
|
|
43
|
-
children: /* @__PURE__ */ jsx(ItemTitle, {
|
|
44
|
-
href: getItemHref?.(item) ?? null,
|
|
45
|
-
current,
|
|
46
|
-
children: title !== void 0 ? renderValue(item, title) : getItemLabel(item)
|
|
47
|
-
})
|
|
48
|
-
}), selectable ? /* @__PURE__ */ jsx(Checkbox, {
|
|
49
|
-
"aria-label": intl.formatMessage(messages.selectItem, { item: getItemLabel(item) }),
|
|
50
|
-
isSelected: selected,
|
|
51
|
-
onChange: () => onToggle(item)
|
|
52
|
-
}) : null]
|
|
53
|
-
}),
|
|
54
|
-
others.length > 0 ? /* @__PURE__ */ jsx("dl", {
|
|
55
|
-
className: CardsLayout_module_default.values,
|
|
56
|
-
children: others.map((column) => /* @__PURE__ */ jsxs("div", {
|
|
57
|
-
className: CardsLayout_module_default.value,
|
|
58
|
-
children: [/* @__PURE__ */ jsx("dt", { children: column.label ?? column.id }), /* @__PURE__ */ jsx("dd", { children: renderValue(item, column) })]
|
|
59
|
-
}, column.id))
|
|
60
|
-
}) : null,
|
|
61
|
-
actions !== null ? /* @__PURE__ */ jsx("div", {
|
|
62
|
-
className: CardsLayout_module_default.actions,
|
|
63
|
-
children: actions
|
|
64
|
-
}) : null
|
|
65
|
-
]
|
|
66
|
-
}, item.id);
|
|
67
|
-
});
|
|
16
|
+
if ($[0] !== columns || $[1] !== items) {
|
|
17
|
+
t1 = fitContent(items, columns);
|
|
68
18
|
$[0] = columns;
|
|
69
|
-
$[1] =
|
|
70
|
-
$[2] =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
19
|
+
$[1] = items;
|
|
20
|
+
$[2] = t1;
|
|
21
|
+
} else t1 = $[2];
|
|
22
|
+
const [fitLevel, measureList] = useRowActionsFit(t1);
|
|
23
|
+
const T0 = RowActionsFit;
|
|
24
|
+
let t2;
|
|
25
|
+
if ($[3] !== pageSelection || $[4] !== selectable) {
|
|
26
|
+
t2 = selectable ? /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: CardsLayout_module_default.pageSelection,
|
|
28
|
+
children: pageSelection
|
|
29
|
+
}) : null;
|
|
30
|
+
$[3] = pageSelection;
|
|
31
|
+
$[4] = selectable;
|
|
32
|
+
$[5] = t2;
|
|
33
|
+
} else t2 = $[5];
|
|
34
|
+
const t3 = CardsLayout_module_default;
|
|
35
|
+
const t4 = items.map((item) => {
|
|
36
|
+
const selected = selectable && isSelected(item);
|
|
37
|
+
const actions = renderActions(item);
|
|
38
|
+
const current = isCurrent?.(item) ?? false;
|
|
39
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
40
|
+
className: CardsLayout_module_default.card,
|
|
41
|
+
"data-selected": selected || void 0,
|
|
42
|
+
"data-current": current || void 0,
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: CardsLayout_module_default.header,
|
|
46
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: CardsLayout_module_default.title,
|
|
48
|
+
children: /* @__PURE__ */ jsx(ItemTitle, {
|
|
49
|
+
href: getItemHref?.(item) ?? null,
|
|
50
|
+
current,
|
|
51
|
+
children: title !== void 0 ? renderValue(item, title) : getItemLabel(item)
|
|
52
|
+
})
|
|
53
|
+
}), selectable ? /* @__PURE__ */ jsx(Checkbox, {
|
|
54
|
+
"aria-label": intl.formatMessage(messages.selectItem, { item: getItemLabel(item) }),
|
|
55
|
+
isSelected: selected,
|
|
56
|
+
onChange: () => onToggle(item)
|
|
57
|
+
}) : null]
|
|
58
|
+
}),
|
|
59
|
+
others.length > 0 ? /* @__PURE__ */ jsx("dl", {
|
|
60
|
+
className: CardsLayout_module_default.values,
|
|
61
|
+
children: others.map((column) => /* @__PURE__ */ jsxs("div", {
|
|
62
|
+
className: CardsLayout_module_default.value,
|
|
63
|
+
children: [/* @__PURE__ */ jsx("dt", { children: column.label ?? column.id }), /* @__PURE__ */ jsx("dd", { children: renderValue(item, column) })]
|
|
64
|
+
}, column.id))
|
|
65
|
+
}) : null,
|
|
66
|
+
actions !== null ? /* @__PURE__ */ jsx("div", {
|
|
67
|
+
className: CardsLayout_module_default.actions,
|
|
68
|
+
children: actions
|
|
69
|
+
}) : null
|
|
70
|
+
]
|
|
71
|
+
}, item.id);
|
|
72
|
+
});
|
|
91
73
|
let t5;
|
|
92
|
-
if ($[
|
|
74
|
+
if ($[6] !== label || $[7] !== t3.cards || $[8] !== t4) {
|
|
93
75
|
t5 = /* @__PURE__ */ jsx("ul", {
|
|
94
|
-
className:
|
|
95
|
-
"aria-label":
|
|
96
|
-
children:
|
|
76
|
+
className: t3.cards,
|
|
77
|
+
"aria-label": label,
|
|
78
|
+
children: t4
|
|
97
79
|
});
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
} else t5 = $[
|
|
80
|
+
$[6] = label;
|
|
81
|
+
$[7] = t3.cards;
|
|
82
|
+
$[8] = t4;
|
|
83
|
+
$[9] = t5;
|
|
84
|
+
} else t5 = $[9];
|
|
103
85
|
let t6;
|
|
104
|
-
if ($[
|
|
105
|
-
t6 = /* @__PURE__ */ jsxs("div", {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
86
|
+
if ($[10] !== measureList || $[11] !== t2 || $[12] !== t5) {
|
|
87
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
88
|
+
ref: measureList,
|
|
89
|
+
children: [t2, t5]
|
|
90
|
+
});
|
|
91
|
+
$[10] = measureList;
|
|
92
|
+
$[11] = t2;
|
|
93
|
+
$[12] = t5;
|
|
94
|
+
$[13] = t6;
|
|
95
|
+
} else t6 = $[13];
|
|
96
|
+
let t7;
|
|
97
|
+
if ($[14] !== T0 || $[15] !== fitLevel || $[16] !== t6) {
|
|
98
|
+
t7 = /* @__PURE__ */ jsx(T0, {
|
|
99
|
+
value: fitLevel,
|
|
100
|
+
children: t6
|
|
101
|
+
});
|
|
102
|
+
$[14] = T0;
|
|
103
|
+
$[15] = fitLevel;
|
|
104
|
+
$[16] = t6;
|
|
105
|
+
$[17] = t7;
|
|
106
|
+
} else t7 = $[17];
|
|
107
|
+
return t7;
|
|
111
108
|
}
|
|
112
109
|
//#endregion
|
|
113
110
|
export { CardsLayout };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardsLayout.js","names":["Checkbox","usePanneauIntl","messages","ListLayoutProps","styles","ItemTitle","CardsLayout","t0","$","_c","items","columns","renderValue","getItemLabel","getItemHref","isCurrent","selectable","isSelected","onToggle","renderActions","label","pageSelection","intl","
|
|
1
|
+
{"version":3,"file":"CardsLayout.js","names":["Checkbox","usePanneauIntl","RowActionsFit","fitContent","useRowActionsFit","messages","ListLayoutProps","styles","ItemTitle","CardsLayout","t0","$","_c","items","columns","renderValue","getItemLabel","getItemHref","isCurrent","selectable","isSelected","onToggle","renderActions","label","pageSelection","intl","title","others","t1","fitLevel","measureList","T0","t2","t4","map","item","selected","actions","current","id","card","undefined","header","formatMessage","selectItem","length","values","column","value","t5","t3","cards","t6","t7","_c","styles"],"sources":["../../src/layouts/CardsLayout.tsx"],"sourcesContent":["import { Checkbox, usePanneauIntl } from '@panneau/ui';\n\nimport { RowActionsFit, fitContent, useRowActionsFit } from '../actions/fit';\nimport { messages } from '../messages';\nimport type { ListLayoutProps } from '../types';\nimport styles from './CardsLayout.module.css';\nimport { ItemTitle } from './ItemTitle';\n\n/** Items as cards: the first column is the title, the others are listed under it. */\nexport function CardsLayout({\n items,\n columns,\n renderValue,\n getItemLabel,\n getItemHref,\n isCurrent,\n selectable,\n isSelected,\n onToggle,\n renderActions,\n label,\n pageSelection,\n}: ListLayoutProps) {\n const intl = usePanneauIntl();\n const [title, ...others] = columns;\n const [fitLevel, measureList] = useRowActionsFit(fitContent(items, columns));\n return (\n <RowActionsFit value={fitLevel}>\n <div ref={measureList}>\n {selectable ? <div className={styles.pageSelection}>{pageSelection}</div> : null}\n <ul className={styles.cards} aria-label={label}>\n {items.map((item) => {\n const selected = selectable && isSelected(item);\n const actions = renderActions(item);\n const current = isCurrent?.(item) ?? false;\n return (\n <li\n key={item.id}\n className={styles.card}\n data-selected={selected || undefined}\n data-current={current || undefined}\n >\n <div className={styles.header}>\n <div className={styles.title}>\n <ItemTitle\n href={getItemHref?.(item) ?? null}\n current={current}\n >\n {title !== undefined\n ? renderValue(item, title)\n : getItemLabel(item)}\n </ItemTitle>\n </div>\n {selectable ? (\n <Checkbox\n aria-label={intl.formatMessage(messages.selectItem, {\n item: getItemLabel(item),\n })}\n isSelected={selected}\n onChange={() => onToggle(item)}\n />\n ) : null}\n </div>\n {others.length > 0 ? (\n <dl className={styles.values}>\n {others.map((column) => (\n <div key={column.id} className={styles.value}>\n <dt>{column.label ?? column.id}</dt>\n <dd>{renderValue(item, column)}</dd>\n </div>\n ))}\n </dl>\n ) : null}\n {actions !== null ? (\n <div className={styles.actions}>{actions}</div>\n ) : null}\n </li>\n );\n })}\n </ul>\n </div>\n </RowActionsFit>\n );\n}\n"],"mappings":";;;;;;;;;AASA,SAAOS,YAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAqB,MAAA,EAAAC,OAAAC,SAAAC,aAAAC,cAAAC,aAAAC,WAAAC,YAAAC,YAAAC,UAAAC,eAAAC,OAAAC,kBAAAd;CAcxB,MAAAe,OAAaxB,eAAe;CAC5B,MAAA,CAAAyB,OAAA,GAAAC,UAA2Bb;CAAQ,IAAAc;CAAA,IAAAjB,EAAA,OAAAG,WAAAH,EAAA,OAAAE,OAAA;EACce,KAAAzB,WAAWU,OAAOC,OAAO;EAACH,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAA3E,MAAA,CAAAkB,UAAAC,eAAgC1B,iBAAiBwB,EAA0B;CAEtE,M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|
74
74
|
flex-shrink: 0;
|
|
75
75
|
gap: var(--panneau-space-1);
|
|
76
|
+
max-width: 100%;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* On one line: the list measures what doesn't fit, and moves it to the menu (decision 0060). */
|
|
81
|
+
.panneau-gallery-layout-actions > * {
|
|
82
|
+
flex-wrap: nowrap;
|
|
76
83
|
}
|
|
77
84
|
|
|
78
85
|
.panneau-gallery-layout-page-selection {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/GalleryLayout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GalleryLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/GalleryLayout.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,EACR,aAAa,EACb,KAAK,EACL,aAAa,GAChB,EAAE,eAAe,+BAkEjB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { messages } from "../messages.js";
|
|
2
2
|
import { ItemTitle } from "./ItemTitle.js";
|
|
3
|
+
import { RowActionsFit, fitContent, useRowActionsFit } from "../actions/fit.js";
|
|
3
4
|
import GalleryLayout_module_default from "./GalleryLayout.module.js";
|
|
4
5
|
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { Checkbox, Icon, usePanneauIntl } from "@panneau/ui";
|
|
@@ -12,25 +13,33 @@ import { ImageOff } from "lucide-react";
|
|
|
12
13
|
* placeholder.
|
|
13
14
|
*/
|
|
14
15
|
function GalleryLayout(t0) {
|
|
15
|
-
const $ = c(
|
|
16
|
+
const $ = c(41);
|
|
16
17
|
const { items, columns, renderValue, getItemLabel, getItemHref, getItemImage, isCurrent, selectable, isSelected, onToggle, renderActions, label, pageSelection } = t0;
|
|
17
18
|
const intl = usePanneauIntl();
|
|
18
19
|
const [title] = columns;
|
|
19
20
|
let t1;
|
|
20
|
-
if ($[0] !==
|
|
21
|
-
t1 =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}) : null;
|
|
25
|
-
$[0] = pageSelection;
|
|
26
|
-
$[1] = selectable;
|
|
21
|
+
if ($[0] !== columns || $[1] !== items) {
|
|
22
|
+
t1 = fitContent(items, columns);
|
|
23
|
+
$[0] = columns;
|
|
24
|
+
$[1] = items;
|
|
27
25
|
$[2] = t1;
|
|
28
26
|
} else t1 = $[2];
|
|
27
|
+
const [fitLevel, measureList] = useRowActionsFit(t1);
|
|
29
28
|
let t2;
|
|
30
|
-
if ($[3] !==
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
if ($[3] !== pageSelection || $[4] !== selectable) {
|
|
30
|
+
t2 = selectable ? /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: GalleryLayout_module_default.pageSelection,
|
|
32
|
+
children: pageSelection
|
|
33
|
+
}) : null;
|
|
34
|
+
$[3] = pageSelection;
|
|
35
|
+
$[4] = selectable;
|
|
36
|
+
$[5] = t2;
|
|
37
|
+
} else t2 = $[5];
|
|
38
|
+
let t3;
|
|
39
|
+
if ($[6] !== getItemHref || $[7] !== getItemImage || $[8] !== getItemLabel || $[9] !== intl || $[10] !== isCurrent || $[11] !== isSelected || $[12] !== items || $[13] !== onToggle || $[14] !== renderActions || $[15] !== renderValue || $[16] !== selectable || $[17] !== title) {
|
|
40
|
+
let t4;
|
|
41
|
+
if ($[19] !== getItemHref || $[20] !== getItemImage || $[21] !== getItemLabel || $[22] !== intl || $[23] !== isCurrent || $[24] !== isSelected || $[25] !== onToggle || $[26] !== renderActions || $[27] !== renderValue || $[28] !== selectable || $[29] !== title) {
|
|
42
|
+
t4 = (item) => {
|
|
34
43
|
const selected = selectable && isSelected(item);
|
|
35
44
|
const actions = renderActions(item);
|
|
36
45
|
const current = isCurrent?.(item) ?? false;
|
|
@@ -75,53 +84,67 @@ function GalleryLayout(t0) {
|
|
|
75
84
|
})]
|
|
76
85
|
}, item.id);
|
|
77
86
|
};
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
} else
|
|
91
|
-
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
} else
|
|
106
|
-
let
|
|
107
|
-
if ($[
|
|
108
|
-
|
|
87
|
+
$[19] = getItemHref;
|
|
88
|
+
$[20] = getItemImage;
|
|
89
|
+
$[21] = getItemLabel;
|
|
90
|
+
$[22] = intl;
|
|
91
|
+
$[23] = isCurrent;
|
|
92
|
+
$[24] = isSelected;
|
|
93
|
+
$[25] = onToggle;
|
|
94
|
+
$[26] = renderActions;
|
|
95
|
+
$[27] = renderValue;
|
|
96
|
+
$[28] = selectable;
|
|
97
|
+
$[29] = title;
|
|
98
|
+
$[30] = t4;
|
|
99
|
+
} else t4 = $[30];
|
|
100
|
+
t3 = items.map(t4);
|
|
101
|
+
$[6] = getItemHref;
|
|
102
|
+
$[7] = getItemImage;
|
|
103
|
+
$[8] = getItemLabel;
|
|
104
|
+
$[9] = intl;
|
|
105
|
+
$[10] = isCurrent;
|
|
106
|
+
$[11] = isSelected;
|
|
107
|
+
$[12] = items;
|
|
108
|
+
$[13] = onToggle;
|
|
109
|
+
$[14] = renderActions;
|
|
110
|
+
$[15] = renderValue;
|
|
111
|
+
$[16] = selectable;
|
|
112
|
+
$[17] = title;
|
|
113
|
+
$[18] = t3;
|
|
114
|
+
} else t3 = $[18];
|
|
115
|
+
let t4;
|
|
116
|
+
if ($[31] !== label || $[32] !== t3) {
|
|
117
|
+
t4 = /* @__PURE__ */ jsx("ul", {
|
|
109
118
|
className: GalleryLayout_module_default.gallery,
|
|
110
119
|
"aria-label": label,
|
|
111
|
-
children:
|
|
120
|
+
children: t3
|
|
112
121
|
});
|
|
113
|
-
$[
|
|
114
|
-
$[29] = t2;
|
|
115
|
-
$[30] = t3;
|
|
116
|
-
} else t3 = $[30];
|
|
117
|
-
let t4;
|
|
118
|
-
if ($[31] !== t1 || $[32] !== t3) {
|
|
119
|
-
t4 = /* @__PURE__ */ jsxs("div", { children: [t1, t3] });
|
|
120
|
-
$[31] = t1;
|
|
122
|
+
$[31] = label;
|
|
121
123
|
$[32] = t3;
|
|
122
124
|
$[33] = t4;
|
|
123
125
|
} else t4 = $[33];
|
|
124
|
-
|
|
126
|
+
let t5;
|
|
127
|
+
if ($[34] !== measureList || $[35] !== t2 || $[36] !== t4) {
|
|
128
|
+
t5 = /* @__PURE__ */ jsxs("div", {
|
|
129
|
+
ref: measureList,
|
|
130
|
+
children: [t2, t4]
|
|
131
|
+
});
|
|
132
|
+
$[34] = measureList;
|
|
133
|
+
$[35] = t2;
|
|
134
|
+
$[36] = t4;
|
|
135
|
+
$[37] = t5;
|
|
136
|
+
} else t5 = $[37];
|
|
137
|
+
let t6;
|
|
138
|
+
if ($[38] !== fitLevel || $[39] !== t5) {
|
|
139
|
+
t6 = /* @__PURE__ */ jsx(RowActionsFit, {
|
|
140
|
+
value: fitLevel,
|
|
141
|
+
children: t5
|
|
142
|
+
});
|
|
143
|
+
$[38] = fitLevel;
|
|
144
|
+
$[39] = t5;
|
|
145
|
+
$[40] = t6;
|
|
146
|
+
} else t6 = $[40];
|
|
147
|
+
return t6;
|
|
125
148
|
}
|
|
126
149
|
//#endregion
|
|
127
150
|
export { GalleryLayout };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryLayout.js","names":["ImageOff","Checkbox","Icon","usePanneauIntl","messages","ListLayoutProps","styles","ItemTitle","GalleryLayout","t0","$","_c","items","columns","renderValue","getItemLabel","getItemHref","getItemImage","isCurrent","selectable","isSelected","onToggle","renderActions","label","pageSelection","intl","title","t1","t2","t3","item","selected","actions","current","image","id","tile","undefined","media","placeholder","check","formatMessage","selectItem","caption","map","gallery","
|
|
1
|
+
{"version":3,"file":"GalleryLayout.js","names":["ImageOff","Checkbox","Icon","usePanneauIntl","RowActionsFit","fitContent","useRowActionsFit","messages","ListLayoutProps","styles","ItemTitle","GalleryLayout","t0","$","_c","items","columns","renderValue","getItemLabel","getItemHref","getItemImage","isCurrent","selectable","isSelected","onToggle","renderActions","label","pageSelection","intl","title","t1","fitLevel","measureList","t2","t3","t4","item","selected","actions","current","image","id","tile","undefined","media","placeholder","check","formatMessage","selectItem","caption","map","gallery","t5","t6","_c","styles"],"sources":["../../src/layouts/GalleryLayout.tsx"],"sourcesContent":["import { ImageOff } from 'lucide-react';\n\nimport { Checkbox, Icon, usePanneauIntl } from '@panneau/ui';\n\nimport { RowActionsFit, fitContent, useRowActionsFit } from '../actions/fit';\nimport { messages } from '../messages';\nimport type { ListLayoutProps } from '../types';\nimport styles from './GalleryLayout.module.css';\nimport { ItemTitle } from './ItemTitle';\n\n/**\n * Items as a grid of images (decision 0044): the image of each item (`itemImage` of the\n * resource), its title under it, its checkbox and its actions. An item without an image shows a\n * placeholder.\n */\nexport function GalleryLayout({\n items,\n columns,\n renderValue,\n getItemLabel,\n getItemHref,\n getItemImage,\n isCurrent,\n selectable,\n isSelected,\n onToggle,\n renderActions,\n label,\n pageSelection,\n}: ListLayoutProps) {\n const intl = usePanneauIntl();\n const [title] = columns;\n const [fitLevel, measureList] = useRowActionsFit(fitContent(items, columns));\n return (\n <RowActionsFit value={fitLevel}>\n <div ref={measureList}>\n {selectable ? <div className={styles.pageSelection}>{pageSelection}</div> : null}\n <ul className={styles.gallery} aria-label={label}>\n {items.map((item) => {\n const selected = selectable && isSelected(item);\n const actions = renderActions(item);\n const current = isCurrent?.(item) ?? false;\n const image = getItemImage?.(item) ?? null;\n return (\n <li\n key={item.id}\n className={styles.tile}\n data-selected={selected || undefined}\n data-current={current || undefined}\n >\n <div className={styles.media}>\n {image !== null ? (\n <img src={image} alt=\"\" loading=\"lazy\" />\n ) : (\n <span className={styles.placeholder}>\n <Icon icon={ImageOff} size=\"lg\" />\n </span>\n )}\n {selectable ? (\n <span className={styles.check}>\n <Checkbox\n aria-label={intl.formatMessage(\n messages.selectItem,\n {\n item: getItemLabel(item),\n },\n )}\n isSelected={selected}\n onChange={() => onToggle(item)}\n />\n </span>\n ) : null}\n </div>\n <div className={styles.caption}>\n <div className={styles.title}>\n <ItemTitle\n href={getItemHref?.(item) ?? null}\n current={current}\n >\n {title !== undefined\n ? renderValue(item, title)\n : getItemLabel(item)}\n </ItemTitle>\n </div>\n {actions !== null ? (\n <div className={styles.actions}>{actions}</div>\n ) : null}\n </div>\n </li>\n );\n })}\n </ul>\n </div>\n </RowActionsFit>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,SAAOW,cAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAuB,MAAA,EAAAC,OAAAC,SAAAC,aAAAC,cAAAC,aAAAC,cAAAC,WAAAC,YAAAC,YAAAC,UAAAC,eAAAC,OAAAC,kBAAAf;CAe1B,MAAAgB,OAAazB,eAAe;CAC5B,MAAA,CAAA0B,SAAgBb;CAAQ,IAAAc;CAAA,IAAAjB,EAAA,OAAAG,WAAAH,EAAA,OAAAE,OAAA;EACyBe,KAAAzB,WAAWU,OAAOC,OAAO;EAACH,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAA3E,MAAA,CAAAkB,UAA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,EAAA,MAAAQ;EAAAR,EAAA,MAAAU;EAAAV,EAAA,MAAAE;EAAAF,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAAI;EAAAJ,EAAA,MAAAS;EAAAT,EAAA,MAAAgB;EAAAhB,EAAA,MAAAqB;CAAA,OAAAA,KAAArB,EAAA;CAAA,IAAAsB;CAAA,IAAAtB,EAAA,QAAAa,SAAAb,EAAA,QAAAqB,IAAA;EArDNC,KAAA,oBAAA,MAAA;GAAe,WAAA1B,6BAAM0C;GAAsBzB,cAAAA;GACtCQ,UAAAA;EAqDA,CAAA;EAAArB,EAAA,MAAAa;EAAAb,EAAA,MAAAqB;EAAArB,EAAA,MAAAsB;CAAA,OAAAA,KAAAtB,EAAA;CAAA,IAAAuC;CAAA,IAAAvC,EAAA,QAAAmB,eAAAnB,EAAA,QAAAoB,MAAApB,EAAA,QAAAsB,IAAA;EAxDTiB,KAAA,qBAAA,OAAA;GAAUpB,KAAAA;GAAV,UAAA,CACKC,IACDE,EAuDE;;EAAAtB,EAAA,MAAAmB;EAAAnB,EAAA,MAAAoB;EAAApB,EAAA,MAAAsB;EAAAtB,EAAA,MAAAuC;CAAA,OAAAA,KAAAvC,EAAA;CAAA,IAAAwC;CAAA,IAAAxC,EAAA,QAAAkB,YAAAlB,EAAA,QAAAuC,IAAA;EA1DVC,KAAA,oBAAC,eAAD;GAAsBtB,OAAAA;GAClBqB,UAAAA;EADU,CAAA;EA2DEvC,EAAA,MAAAkB;EAAAlB,EAAA,MAAAuC;EAAAvC,EAAA,MAAAwC;CAAA,OAAAA,KAAAxC,EAAA;CAAA,OA3DhBwC;AA2DgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryLayout.module.js","names":[],"sources":["../../src/layouts/GalleryLayout.module.css"],"sourcesContent":[".gallery {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr));\n gap: var(--panneau-space-3);\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.tile {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n background-color: var(--panneau-color-surface);\n border: var(--panneau-border-width) solid var(--panneau-color-border);\n border-radius: var(--panneau-radius-lg);\n}\n\n.tile[data-current] {\n border-color: var(--panneau-color-accent);\n box-shadow: inset 0 0 0 1px var(--panneau-color-accent);\n}\n\n.tile[data-selected] {\n background-color: var(--panneau-color-accent-subtle);\n border-color: var(--panneau-color-border-control);\n}\n\n.media {\n position: relative;\n aspect-ratio: 4 / 3;\n background-color: var(--panneau-color-surface-sunken);\n}\n\n.media img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n.placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: var(--panneau-color-text-muted);\n}\n\n.check {\n position: absolute;\n top: var(--panneau-space-2);\n left: var(--panneau-space-2);\n padding: 2px;\n background-color: var(--panneau-color-surface);\n border-radius: var(--panneau-radius-sm);\n}\n\n.caption {\n display: flex;\n align-items: flex-start;\n gap: var(--panneau-space-2);\n padding: var(--panneau-space-2) var(--panneau-space-3);\n}\n\n.title {\n flex: 1;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.actions {\n display: flex;\n flex-shrink: 0;\n gap: var(--panneau-space-1);\n}\n\n.pageSelection {\n margin-bottom: var(--panneau-space-2);\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"GalleryLayout.module.js","names":[],"sources":["../../src/layouts/GalleryLayout.module.css"],"sourcesContent":[".gallery {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr));\n gap: var(--panneau-space-3);\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.tile {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n background-color: var(--panneau-color-surface);\n border: var(--panneau-border-width) solid var(--panneau-color-border);\n border-radius: var(--panneau-radius-lg);\n}\n\n.tile[data-current] {\n border-color: var(--panneau-color-accent);\n box-shadow: inset 0 0 0 1px var(--panneau-color-accent);\n}\n\n.tile[data-selected] {\n background-color: var(--panneau-color-accent-subtle);\n border-color: var(--panneau-color-border-control);\n}\n\n.media {\n position: relative;\n aspect-ratio: 4 / 3;\n background-color: var(--panneau-color-surface-sunken);\n}\n\n.media img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n.placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: var(--panneau-color-text-muted);\n}\n\n.check {\n position: absolute;\n top: var(--panneau-space-2);\n left: var(--panneau-space-2);\n padding: 2px;\n background-color: var(--panneau-color-surface);\n border-radius: var(--panneau-radius-sm);\n}\n\n.caption {\n display: flex;\n align-items: flex-start;\n gap: var(--panneau-space-2);\n padding: var(--panneau-space-2) var(--panneau-space-3);\n}\n\n.title {\n flex: 1;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.actions {\n display: flex;\n flex-shrink: 0;\n gap: var(--panneau-space-1);\n max-width: 100%;\n overflow: hidden;\n}\n\n/* On one line: the list measures what doesn't fit, and moves it to the menu (decision 0060). */\n.actions > * {\n flex-wrap: nowrap;\n}\n\n.pageSelection {\n margin-bottom: var(--panneau-space-2);\n}\n"],"mappings":""}
|
|
@@ -50,6 +50,37 @@
|
|
|
50
50
|
background-color: var(--panneau-color-hover);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
/* The thumbnail of an item, before its title (decision 0061). */
|
|
54
|
+
.panneau-table-layout-with-thumbnail {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: var(--panneau-space-3);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.panneau-table-layout-with-thumbnail > :last-child {
|
|
61
|
+
min-width: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.panneau-table-layout-thumbnail {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex: none;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
width: 2.5rem;
|
|
70
|
+
height: 2.5rem;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
color: var(--panneau-color-text-muted);
|
|
73
|
+
background-color: var(--panneau-color-surface-sunken);
|
|
74
|
+
border-radius: var(--panneau-radius-sm);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.panneau-table-layout-thumbnail img {
|
|
78
|
+
display: block;
|
|
79
|
+
width: 100%;
|
|
80
|
+
height: 100%;
|
|
81
|
+
object-fit: cover;
|
|
82
|
+
}
|
|
83
|
+
|
|
53
84
|
.panneau-table-layout-center {
|
|
54
85
|
text-align: center !important;
|
|
55
86
|
}
|
|
@@ -2,8 +2,9 @@ import type { ListColumn, ListLayoutProps } from '../types.js';
|
|
|
2
2
|
/** The sort direction of a column, from the first `sort` value. */
|
|
3
3
|
export declare function getSortDirection(sort: readonly string[], column: ListColumn): 'ascending' | 'descending' | null;
|
|
4
4
|
/**
|
|
5
|
-
* Items as a table, with sortable column headers.
|
|
6
|
-
*
|
|
5
|
+
* Items as a table, with sortable column headers. With the image of items (`getItemImage`), each
|
|
6
|
+
* title starts with a thumbnail. On narrow lists (phones), each row turns into a block that shows
|
|
7
|
+
* the label of each value.
|
|
7
8
|
*/
|
|
8
|
-
export declare function TableLayout({ items, columns, renderValue, getItemLabel, getItemHref, isCurrent, selectable, isSelected, onToggle, renderActions, sort, onSort, label, pageSelection, renderCell, }: ListLayoutProps): import("react").JSX.Element;
|
|
9
|
+
export declare function TableLayout({ items, columns, renderValue, getItemLabel, getItemHref, getItemImage, isCurrent, selectable, isSelected, onToggle, renderActions, sort, onSort, label, pageSelection, renderCell, }: ListLayoutProps): import("react").JSX.Element;
|
|
9
10
|
//# sourceMappingURL=TableLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/TableLayout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TableLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/TableLayout.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI5D,mEAAmE;AACnE,wBAAgB,gBAAgB,CAC5B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,MAAM,EAAE,UAAU,GACnB,WAAW,GAAG,YAAY,GAAG,IAAI,CAMnC;AAyBD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,MAAM,EACN,KAAK,EACL,aAAa,EACb,UAAU,GACb,EAAE,eAAe,+BA8IjB"}
|