@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,10 +1,11 @@
|
|
|
1
1
|
import { messages } from "../messages.js";
|
|
2
|
-
import { findOption, getFieldOptions, toText } from "../values.js";
|
|
2
|
+
import { findOption, getFieldOptions, isRecord, toText } from "../values.js";
|
|
3
|
+
import { getImageUrl } from "../images.js";
|
|
3
4
|
import Displays_module_default from "./Displays.module.js";
|
|
4
5
|
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { fieldsMessages } from "@panneau/intl";
|
|
6
7
|
import { Badge, Icon, usePanneauIntl } from "@panneau/ui";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { Check, File, FileText, Globe, Hash, Mail, Minus, Phone } from "lucide-react";
|
|
9
10
|
import { toReferences } from "@panneau/fields";
|
|
10
11
|
import { formatAddress, isAddress } from "@panneau/fields/address";
|
|
@@ -14,7 +15,7 @@ import { formatDateRange, getDateRangeSettings } from "@panneau/fields/daterange
|
|
|
14
15
|
import { formatDuration, getDurationUnits } from "@panneau/fields/duration";
|
|
15
16
|
import { getLinkText, isLink } from "@panneau/fields/link";
|
|
16
17
|
import { formatMoney } from "@panneau/fields/money";
|
|
17
|
-
import { getRegionCountry, getRegionName } from "@panneau/fields/region";
|
|
18
|
+
import { RegionFlag, getRegionCountry, getRegionName } from "@panneau/fields/region";
|
|
18
19
|
import { parsePhone, splitExtension } from "@panneau/fields/tel";
|
|
19
20
|
//#region src/displays/displays.tsx
|
|
20
21
|
/** What a cell shows without a value. Hidden from assistive technologies, which skip the cell. */
|
|
@@ -81,6 +82,7 @@ function TextDisplay(t0) {
|
|
|
81
82
|
if ($[8] !== text) {
|
|
82
83
|
t2 = /* @__PURE__ */ jsx("span", {
|
|
83
84
|
className: Displays_module_default.text,
|
|
85
|
+
"data-clamp": "",
|
|
84
86
|
children: text
|
|
85
87
|
});
|
|
86
88
|
$[8] = text;
|
|
@@ -103,6 +105,7 @@ function RichTextDisplay(t0) {
|
|
|
103
105
|
if ($[2] !== text) {
|
|
104
106
|
t2 = text === "" ? /* @__PURE__ */ jsx(EmptyValue, {}) : /* @__PURE__ */ jsx("span", {
|
|
105
107
|
className: Displays_module_default.text,
|
|
108
|
+
"data-clamp": "",
|
|
106
109
|
children: text
|
|
107
110
|
});
|
|
108
111
|
$[2] = text;
|
|
@@ -334,6 +337,7 @@ function DateRangeDisplay(t0) {
|
|
|
334
337
|
if ($[6] !== text) {
|
|
335
338
|
t3 = /* @__PURE__ */ jsx("span", {
|
|
336
339
|
className: Displays_module_default.text,
|
|
340
|
+
"data-clamp": "",
|
|
337
341
|
children: text
|
|
338
342
|
});
|
|
339
343
|
$[6] = text;
|
|
@@ -477,48 +481,54 @@ function SelectDisplay(t0) {
|
|
|
477
481
|
}
|
|
478
482
|
/** The labels of related items. */
|
|
479
483
|
function RelationDisplay(t0) {
|
|
480
|
-
const $ = c(
|
|
484
|
+
const $ = c(10);
|
|
481
485
|
const { value } = t0;
|
|
482
486
|
let t1;
|
|
483
487
|
let t2;
|
|
484
488
|
let t3;
|
|
489
|
+
let t4;
|
|
485
490
|
if ($[0] !== value) {
|
|
486
|
-
|
|
491
|
+
t4 = Symbol.for("react.early_return_sentinel");
|
|
487
492
|
bb0: {
|
|
488
493
|
const references = toReferences(value);
|
|
489
494
|
if (references.length === 0) {
|
|
490
|
-
let
|
|
491
|
-
if ($[
|
|
492
|
-
|
|
493
|
-
$[
|
|
494
|
-
} else
|
|
495
|
-
|
|
495
|
+
let t5;
|
|
496
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
497
|
+
t5 = /* @__PURE__ */ jsx(EmptyValue, {});
|
|
498
|
+
$[5] = t5;
|
|
499
|
+
} else t5 = $[5];
|
|
500
|
+
t4 = t5;
|
|
496
501
|
break bb0;
|
|
497
502
|
}
|
|
498
503
|
t1 = Displays_module_default.text;
|
|
499
|
-
t2 =
|
|
504
|
+
t2 = "";
|
|
505
|
+
t3 = references.map(_temp).join(", ");
|
|
500
506
|
}
|
|
501
507
|
$[0] = value;
|
|
502
508
|
$[1] = t1;
|
|
503
509
|
$[2] = t2;
|
|
504
510
|
$[3] = t3;
|
|
511
|
+
$[4] = t4;
|
|
505
512
|
} else {
|
|
506
513
|
t1 = $[1];
|
|
507
514
|
t2 = $[2];
|
|
508
515
|
t3 = $[3];
|
|
516
|
+
t4 = $[4];
|
|
509
517
|
}
|
|
510
|
-
if (
|
|
511
|
-
let
|
|
512
|
-
if ($[
|
|
513
|
-
|
|
518
|
+
if (t4 !== Symbol.for("react.early_return_sentinel")) return t4;
|
|
519
|
+
let t5;
|
|
520
|
+
if ($[6] !== t1 || $[7] !== t2 || $[8] !== t3) {
|
|
521
|
+
t5 = /* @__PURE__ */ jsx("span", {
|
|
514
522
|
className: t1,
|
|
515
|
-
|
|
523
|
+
"data-clamp": t2,
|
|
524
|
+
children: t3
|
|
516
525
|
});
|
|
517
|
-
$[
|
|
518
|
-
$[
|
|
519
|
-
$[
|
|
520
|
-
|
|
521
|
-
|
|
526
|
+
$[6] = t1;
|
|
527
|
+
$[7] = t2;
|
|
528
|
+
$[8] = t3;
|
|
529
|
+
$[9] = t5;
|
|
530
|
+
} else t5 = $[9];
|
|
531
|
+
return t5;
|
|
522
532
|
}
|
|
523
533
|
/** A link that opens the URL. */
|
|
524
534
|
function _temp(reference) {
|
|
@@ -697,6 +707,7 @@ function Country(t0) {
|
|
|
697
707
|
if ($[0] !== code) {
|
|
698
708
|
t1 = /* @__PURE__ */ jsx("span", {
|
|
699
709
|
className: Displays_module_default.text,
|
|
710
|
+
"data-clamp": "",
|
|
700
711
|
children: code
|
|
701
712
|
});
|
|
702
713
|
$[0] = code;
|
|
@@ -731,6 +742,7 @@ function Country(t0) {
|
|
|
731
742
|
if ($[9] !== t3) {
|
|
732
743
|
t4 = /* @__PURE__ */ jsx("span", {
|
|
733
744
|
className: Displays_module_default.text,
|
|
745
|
+
"data-clamp": "",
|
|
734
746
|
children: t3
|
|
735
747
|
});
|
|
736
748
|
$[9] = t3;
|
|
@@ -798,8 +810,9 @@ function CountryDisplay(t0) {
|
|
|
798
810
|
return t4;
|
|
799
811
|
}
|
|
800
812
|
/**
|
|
801
|
-
* A region: its name in the user's locale, from its country in the
|
|
802
|
-
* the field's settings. A region that Panneau doesn't know shows as it
|
|
813
|
+
* A region: its flag, when it has one, and its name in the user's locale, from its country in the
|
|
814
|
+
* item (the field's `from`) or the field's settings. A region that Panneau doesn't know shows as it
|
|
815
|
+
* is.
|
|
803
816
|
*/
|
|
804
817
|
function _temp3(code_0) {
|
|
805
818
|
return /* @__PURE__ */ jsx(Country, { code: code_0 }, code_0);
|
|
@@ -808,7 +821,7 @@ function _temp2(code) {
|
|
|
808
821
|
return typeof code === "string" && code !== "";
|
|
809
822
|
}
|
|
810
823
|
function RegionDisplay(t0) {
|
|
811
|
-
const $ = c(
|
|
824
|
+
const $ = c(17);
|
|
812
825
|
const { value, field, item } = t0;
|
|
813
826
|
const intl = usePanneauIntl();
|
|
814
827
|
if (typeof value !== "string" || value === "") {
|
|
@@ -819,33 +832,67 @@ function RegionDisplay(t0) {
|
|
|
819
832
|
} else t1 = $[0];
|
|
820
833
|
return t1;
|
|
821
834
|
}
|
|
835
|
+
let country;
|
|
822
836
|
let t1;
|
|
823
|
-
let t2;
|
|
824
837
|
if ($[1] !== field || $[2] !== intl.locale || $[3] !== item || $[4] !== value) {
|
|
825
|
-
|
|
826
|
-
t1 =
|
|
827
|
-
t2 = getRegionName(country, value, intl.locale) ?? value;
|
|
838
|
+
country = field !== null ? getRegionCountry(field, item) : null;
|
|
839
|
+
t1 = getRegionName(country, value, intl.locale);
|
|
828
840
|
$[1] = field;
|
|
829
841
|
$[2] = intl.locale;
|
|
830
842
|
$[3] = item;
|
|
831
843
|
$[4] = value;
|
|
832
|
-
$[5] =
|
|
833
|
-
$[6] =
|
|
844
|
+
$[5] = country;
|
|
845
|
+
$[6] = t1;
|
|
834
846
|
} else {
|
|
835
|
-
|
|
836
|
-
|
|
847
|
+
country = $[5];
|
|
848
|
+
t1 = $[6];
|
|
849
|
+
}
|
|
850
|
+
const name = t1;
|
|
851
|
+
if (name === null) {
|
|
852
|
+
let t2;
|
|
853
|
+
if ($[7] !== value) {
|
|
854
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
855
|
+
className: Displays_module_default.text,
|
|
856
|
+
"data-clamp": "",
|
|
857
|
+
children: value
|
|
858
|
+
});
|
|
859
|
+
$[7] = value;
|
|
860
|
+
$[8] = t2;
|
|
861
|
+
} else t2 = $[8];
|
|
862
|
+
return t2;
|
|
837
863
|
}
|
|
864
|
+
let t2;
|
|
865
|
+
if ($[9] !== country || $[10] !== value) {
|
|
866
|
+
t2 = /* @__PURE__ */ jsx(RegionFlag, {
|
|
867
|
+
country,
|
|
868
|
+
code: value,
|
|
869
|
+
className: Displays_module_default.regionFlag
|
|
870
|
+
});
|
|
871
|
+
$[9] = country;
|
|
872
|
+
$[10] = value;
|
|
873
|
+
$[11] = t2;
|
|
874
|
+
} else t2 = $[11];
|
|
838
875
|
let t3;
|
|
839
|
-
if ($[
|
|
876
|
+
if ($[12] !== name) {
|
|
840
877
|
t3 = /* @__PURE__ */ jsx("span", {
|
|
841
|
-
className:
|
|
842
|
-
|
|
878
|
+
className: Displays_module_default.text,
|
|
879
|
+
"data-clamp": "",
|
|
880
|
+
children: name
|
|
843
881
|
});
|
|
844
|
-
$[
|
|
845
|
-
$[
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
882
|
+
$[12] = name;
|
|
883
|
+
$[13] = t3;
|
|
884
|
+
} else t3 = $[13];
|
|
885
|
+
let t4;
|
|
886
|
+
if ($[14] !== t2 || $[15] !== t3) {
|
|
887
|
+
t4 = /* @__PURE__ */ jsxs("span", {
|
|
888
|
+
className: Displays_module_default.flagged,
|
|
889
|
+
children: [t2, t3]
|
|
890
|
+
});
|
|
891
|
+
$[14] = t2;
|
|
892
|
+
$[15] = t3;
|
|
893
|
+
$[16] = t4;
|
|
894
|
+
} else t4 = $[16];
|
|
895
|
+
return t4;
|
|
849
896
|
}
|
|
850
897
|
/**
|
|
851
898
|
* A duration with its units, `1 h 5 min` or `2 d 4 h`: in the unit of its field (seconds by
|
|
@@ -1038,6 +1085,7 @@ function EmbedDisplay(t0) {
|
|
|
1038
1085
|
if ($[6] !== t2) {
|
|
1039
1086
|
t3 = /* @__PURE__ */ jsx("span", {
|
|
1040
1087
|
className: Displays_module_default.text,
|
|
1088
|
+
"data-clamp": "",
|
|
1041
1089
|
children: t2
|
|
1042
1090
|
});
|
|
1043
1091
|
$[6] = t2;
|
|
@@ -1078,6 +1126,7 @@ function LocationDisplay(t0) {
|
|
|
1078
1126
|
if ($[1] !== address) {
|
|
1079
1127
|
t1 = /* @__PURE__ */ jsx("span", {
|
|
1080
1128
|
className: Displays_module_default.text,
|
|
1129
|
+
"data-clamp": "",
|
|
1081
1130
|
children: address
|
|
1082
1131
|
});
|
|
1083
1132
|
$[1] = address;
|
|
@@ -1183,6 +1232,7 @@ function AddressDisplay(t0) {
|
|
|
1183
1232
|
if ($[12] !== t3) {
|
|
1184
1233
|
t4 = /* @__PURE__ */ jsx("span", {
|
|
1185
1234
|
className: Displays_module_default.text,
|
|
1235
|
+
"data-clamp": "",
|
|
1186
1236
|
children: t3
|
|
1187
1237
|
});
|
|
1188
1238
|
$[12] = t3;
|
|
@@ -1256,6 +1306,7 @@ function LinkDisplay(t0) {
|
|
|
1256
1306
|
if ($[7] !== text) {
|
|
1257
1307
|
t4 = /* @__PURE__ */ jsx("span", {
|
|
1258
1308
|
className: Displays_module_default.text,
|
|
1309
|
+
"data-clamp": "",
|
|
1259
1310
|
children: text
|
|
1260
1311
|
});
|
|
1261
1312
|
$[7] = text;
|
|
@@ -1341,6 +1392,7 @@ function ColorDisplay(t0) {
|
|
|
1341
1392
|
if ($[8] !== t4) {
|
|
1342
1393
|
t5 = /* @__PURE__ */ jsx("span", {
|
|
1343
1394
|
className: Displays_module_default.text,
|
|
1395
|
+
"data-clamp": "",
|
|
1344
1396
|
children: t4
|
|
1345
1397
|
});
|
|
1346
1398
|
$[8] = t4;
|
|
@@ -1387,12 +1439,27 @@ function ColorDisplay(t0) {
|
|
|
1387
1439
|
} else t3 = $[17];
|
|
1388
1440
|
return t3;
|
|
1389
1441
|
}
|
|
1390
|
-
/**
|
|
1442
|
+
/** The text of a media, a reference or a file: its label, name or file name. */
|
|
1443
|
+
function mediaLabel(value) {
|
|
1444
|
+
for (const key of [
|
|
1445
|
+
"label",
|
|
1446
|
+
"name",
|
|
1447
|
+
"filename"
|
|
1448
|
+
]) {
|
|
1449
|
+
const text = value[key];
|
|
1450
|
+
if (typeof text === "string" && text !== "") return text;
|
|
1451
|
+
}
|
|
1452
|
+
return "";
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* A thumbnail and the name of a media (or of the first one), for `media` and `image` values:
|
|
1456
|
+
* a media reference (`{ id, label, media }`), or a media with its URLs.
|
|
1457
|
+
*/
|
|
1391
1458
|
function MediaDisplay(t0) {
|
|
1392
|
-
const $ = c(
|
|
1459
|
+
const $ = c(12);
|
|
1393
1460
|
const { value } = t0;
|
|
1394
1461
|
const media = Array.isArray(value) ? value[0] : value;
|
|
1395
|
-
if (media
|
|
1462
|
+
if (!isRecord(media)) {
|
|
1396
1463
|
let t1;
|
|
1397
1464
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1398
1465
|
t1 = /* @__PURE__ */ jsx(EmptyValue, {});
|
|
@@ -1400,45 +1467,133 @@ function MediaDisplay(t0) {
|
|
|
1400
1467
|
} else t1 = $[0];
|
|
1401
1468
|
return t1;
|
|
1402
1469
|
}
|
|
1403
|
-
const { thumbnailUrl, url, name, filename } = media;
|
|
1404
|
-
const source = typeof thumbnailUrl === "string" ? thumbnailUrl : typeof url === "string" ? url : null;
|
|
1405
|
-
const label = typeof name === "string" ? name : typeof filename === "string" ? filename : "";
|
|
1406
1470
|
let t1;
|
|
1407
|
-
if ($[1] !==
|
|
1408
|
-
t1 =
|
|
1409
|
-
|
|
1410
|
-
src: source,
|
|
1411
|
-
alt: ""
|
|
1412
|
-
}) : null;
|
|
1413
|
-
$[1] = source;
|
|
1471
|
+
if ($[1] !== media) {
|
|
1472
|
+
t1 = getImageUrl(media);
|
|
1473
|
+
$[1] = media;
|
|
1414
1474
|
$[2] = t1;
|
|
1415
1475
|
} else t1 = $[2];
|
|
1476
|
+
const source = t1;
|
|
1416
1477
|
let t2;
|
|
1417
|
-
if ($[3] !==
|
|
1418
|
-
t2 =
|
|
1478
|
+
if ($[3] !== media) {
|
|
1479
|
+
t2 = mediaLabel(media);
|
|
1480
|
+
$[3] = media;
|
|
1481
|
+
$[4] = t2;
|
|
1482
|
+
} else t2 = $[4];
|
|
1483
|
+
const label = t2;
|
|
1484
|
+
let t3;
|
|
1485
|
+
if ($[5] !== source) {
|
|
1486
|
+
t3 = source !== null ? /* @__PURE__ */ jsx("img", {
|
|
1487
|
+
className: Displays_module_default.thumbnail,
|
|
1488
|
+
src: source,
|
|
1489
|
+
alt: "",
|
|
1490
|
+
loading: "lazy"
|
|
1491
|
+
}) : null;
|
|
1492
|
+
$[5] = source;
|
|
1493
|
+
$[6] = t3;
|
|
1494
|
+
} else t3 = $[6];
|
|
1495
|
+
let t4;
|
|
1496
|
+
if ($[7] !== label) {
|
|
1497
|
+
t4 = label !== "" ? /* @__PURE__ */ jsx("span", {
|
|
1419
1498
|
className: Displays_module_default.text,
|
|
1499
|
+
"data-clamp": "",
|
|
1420
1500
|
children: label
|
|
1421
1501
|
}) : null;
|
|
1422
|
-
$[
|
|
1423
|
-
$[
|
|
1424
|
-
} else
|
|
1502
|
+
$[7] = label;
|
|
1503
|
+
$[8] = t4;
|
|
1504
|
+
} else t4 = $[8];
|
|
1505
|
+
let t5;
|
|
1506
|
+
if ($[9] !== t3 || $[10] !== t4) {
|
|
1507
|
+
t5 = /* @__PURE__ */ jsxs("span", {
|
|
1508
|
+
className: Displays_module_default.media,
|
|
1509
|
+
children: [t3, t4]
|
|
1510
|
+
});
|
|
1511
|
+
$[9] = t3;
|
|
1512
|
+
$[10] = t4;
|
|
1513
|
+
$[11] = t5;
|
|
1514
|
+
} else t5 = $[11];
|
|
1515
|
+
return t5;
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* Stored files (`file` values): the thumbnail of an image, or an icon, and the name of each file,
|
|
1519
|
+
* linked to its URL.
|
|
1520
|
+
*/
|
|
1521
|
+
function FileDisplay(t0) {
|
|
1522
|
+
const $ = c(8);
|
|
1523
|
+
const { value } = t0;
|
|
1524
|
+
let t1;
|
|
1525
|
+
let t2;
|
|
1425
1526
|
let t3;
|
|
1527
|
+
if ($[0] !== value) {
|
|
1528
|
+
t3 = Symbol.for("react.early_return_sentinel");
|
|
1529
|
+
bb0: {
|
|
1530
|
+
const files = (Array.isArray(value) ? value : [value]).filter(isRecord);
|
|
1531
|
+
if (files.length === 0) {
|
|
1532
|
+
let t4;
|
|
1533
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1534
|
+
t4 = /* @__PURE__ */ jsx(EmptyValue, {});
|
|
1535
|
+
$[4] = t4;
|
|
1536
|
+
} else t4 = $[4];
|
|
1537
|
+
t3 = t4;
|
|
1538
|
+
break bb0;
|
|
1539
|
+
}
|
|
1540
|
+
t1 = Displays_module_default.files;
|
|
1541
|
+
t2 = files.map(_temp5);
|
|
1542
|
+
}
|
|
1543
|
+
$[0] = value;
|
|
1544
|
+
$[1] = t1;
|
|
1545
|
+
$[2] = t2;
|
|
1546
|
+
$[3] = t3;
|
|
1547
|
+
} else {
|
|
1548
|
+
t1 = $[1];
|
|
1549
|
+
t2 = $[2];
|
|
1550
|
+
t3 = $[3];
|
|
1551
|
+
}
|
|
1552
|
+
if (t3 !== Symbol.for("react.early_return_sentinel")) return t3;
|
|
1553
|
+
let t4;
|
|
1426
1554
|
if ($[5] !== t1 || $[6] !== t2) {
|
|
1427
|
-
|
|
1428
|
-
className:
|
|
1429
|
-
children:
|
|
1555
|
+
t4 = /* @__PURE__ */ jsx("span", {
|
|
1556
|
+
className: t1,
|
|
1557
|
+
children: t2
|
|
1430
1558
|
});
|
|
1431
1559
|
$[5] = t1;
|
|
1432
1560
|
$[6] = t2;
|
|
1433
|
-
$[7] =
|
|
1434
|
-
} else
|
|
1435
|
-
return
|
|
1561
|
+
$[7] = t4;
|
|
1562
|
+
} else t4 = $[7];
|
|
1563
|
+
return t4;
|
|
1436
1564
|
}
|
|
1437
1565
|
/**
|
|
1438
1566
|
* The built-in displays, by name. A column's display is its `display`, its field's `display`, or
|
|
1439
1567
|
* its field's type: field types are display names. Values without a known display are shown as
|
|
1440
1568
|
* text.
|
|
1441
1569
|
*/
|
|
1570
|
+
function _temp5(file, index) {
|
|
1571
|
+
const image = getImageUrl(file);
|
|
1572
|
+
const name = mediaLabel(file);
|
|
1573
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [image !== null ? /* @__PURE__ */ jsx("img", {
|
|
1574
|
+
className: Displays_module_default.thumbnail,
|
|
1575
|
+
src: image,
|
|
1576
|
+
alt: "",
|
|
1577
|
+
loading: "lazy"
|
|
1578
|
+
}) : /* @__PURE__ */ jsx(Icon, {
|
|
1579
|
+
icon: File,
|
|
1580
|
+
size: "sm"
|
|
1581
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1582
|
+
className: Displays_module_default.text,
|
|
1583
|
+
"data-clamp": "",
|
|
1584
|
+
children: name !== "" ? name : typeof file.url === "string" ? file.url : ""
|
|
1585
|
+
})] });
|
|
1586
|
+
return typeof file.url === "string" && file.url !== "" ? /* @__PURE__ */ jsx("a", {
|
|
1587
|
+
className: `${Displays_module_default.link} ${Displays_module_default.media}`,
|
|
1588
|
+
href: file.url,
|
|
1589
|
+
target: "_blank",
|
|
1590
|
+
rel: "noreferrer",
|
|
1591
|
+
children: content
|
|
1592
|
+
}, index) : /* @__PURE__ */ jsx("span", {
|
|
1593
|
+
className: Displays_module_default.media,
|
|
1594
|
+
children: content
|
|
1595
|
+
}, index);
|
|
1596
|
+
}
|
|
1442
1597
|
var builtInDisplays = {
|
|
1443
1598
|
text: TextDisplay,
|
|
1444
1599
|
textarea: TextDisplay,
|
|
@@ -1455,6 +1610,8 @@ var builtInDisplays = {
|
|
|
1455
1610
|
email: EmailDisplay,
|
|
1456
1611
|
color: ColorDisplay,
|
|
1457
1612
|
media: MediaDisplay,
|
|
1613
|
+
image: MediaDisplay,
|
|
1614
|
+
file: FileDisplay,
|
|
1458
1615
|
tel: TelDisplay,
|
|
1459
1616
|
range: NumberDisplay,
|
|
1460
1617
|
duration: DurationDisplay,
|
|
@@ -1470,6 +1627,6 @@ var builtInDisplays = {
|
|
|
1470
1627
|
money: MoneyDisplay
|
|
1471
1628
|
};
|
|
1472
1629
|
//#endregion
|
|
1473
|
-
export { AddressDisplay, BooleanDisplay, ColorDisplay, CountryDisplay, DateDisplay, DateRangeDisplay, DateTimeDisplay, DurationDisplay, EmailDisplay, EmbedDisplay, EmptyValue, JsonDisplay, LinkDisplay, LocationDisplay, MediaDisplay, MoneyDisplay, NumberDisplay, RegionDisplay, RelationDisplay, RichTextDisplay, SelectDisplay, TagsDisplay, TelDisplay, TextDisplay, TimeDisplay, UrlDisplay, builtInDisplays };
|
|
1630
|
+
export { AddressDisplay, BooleanDisplay, ColorDisplay, CountryDisplay, DateDisplay, DateRangeDisplay, DateTimeDisplay, DurationDisplay, EmailDisplay, EmbedDisplay, EmptyValue, FileDisplay, JsonDisplay, LinkDisplay, LocationDisplay, MediaDisplay, MoneyDisplay, NumberDisplay, RegionDisplay, RelationDisplay, RichTextDisplay, SelectDisplay, TagsDisplay, TelDisplay, TextDisplay, TimeDisplay, UrlDisplay, builtInDisplays };
|
|
1474
1631
|
|
|
1475
1632
|
//# sourceMappingURL=displays.js.map
|