@payloadcms/ui 3.55.0-canary.3 → 3.55.0-internal.d44d1d3
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/dist/elements/BulkUpload/EditForm/index.js +18 -4
- package/dist/elements/BulkUpload/EditForm/index.js.map +1 -1
- package/dist/elements/ClipboardAction/index.js +74 -173
- package/dist/elements/ClipboardAction/index.js.map +1 -1
- package/dist/elements/CodeEditor/CodeEditor.js +67 -155
- package/dist/elements/CodeEditor/CodeEditor.js.map +1 -1
- package/dist/elements/Collapsible/index.js +7 -15
- package/dist/elements/Collapsible/index.js.map +1 -1
- package/dist/elements/ConfirmationModal/index.js +8 -44
- package/dist/elements/ConfirmationModal/index.js.map +1 -1
- package/dist/elements/CopyLocaleData/index.js +89 -97
- package/dist/elements/CopyLocaleData/index.js.map +1 -1
- package/dist/elements/CopyToClipboard/index.js +2 -22
- package/dist/elements/CopyToClipboard/index.js.map +1 -1
- package/dist/elements/DeleteMany/index.js +47 -83
- package/dist/elements/DeleteMany/index.js.map +1 -1
- package/dist/elements/DocumentControls/index.js +27 -55
- package/dist/elements/DocumentControls/index.js.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerHeader/index.js +2 -10
- package/dist/elements/DocumentDrawer/DrawerHeader/index.js.map +1 -1
- package/dist/elements/DocumentDrawer/index.js +47 -99
- package/dist/elements/DocumentDrawer/index.js.map +1 -1
- package/dist/elements/Drawer/index.js +23 -57
- package/dist/elements/Drawer/index.js.map +1 -1
- package/dist/elements/DrawerActionHeader/index.js +3 -21
- package/dist/elements/DrawerActionHeader/index.js.map +1 -1
- package/dist/elements/FolderView/Drawers/MoveToFolder/index.js +149 -225
- package/dist/elements/FolderView/Drawers/MoveToFolder/index.js.map +1 -1
- package/dist/elements/FolderView/FolderFileCard/index.js +19 -27
- package/dist/elements/FolderView/FolderFileCard/index.js.map +1 -1
- package/dist/elements/FolderView/MoveDocToFolder/index.js +12 -23
- package/dist/elements/FolderView/MoveDocToFolder/index.js.map +1 -1
- package/dist/elements/FullscreenModal/index.js +10 -20
- package/dist/elements/FullscreenModal/index.js.map +1 -1
- package/dist/elements/ListDrawer/index.js +18 -24
- package/dist/elements/ListDrawer/index.js.map +1 -1
- package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.js +19 -32
- package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.js.map +1 -1
- package/dist/elements/ListHeaderTabs/DefaultListPill.js +15 -8
- package/dist/elements/ListHeaderTabs/DefaultListPill.js.map +1 -1
- package/dist/elements/ListSelection/index.js +11 -27
- package/dist/elements/ListSelection/index.js.map +1 -1
- package/dist/elements/LivePreview/Window/index.js +68 -139
- package/dist/elements/LivePreview/Window/index.js.map +1 -1
- package/dist/elements/Loading/index.js +2 -11
- package/dist/elements/Loading/index.js.map +1 -1
- package/dist/elements/LoadingOverlay/index.js +46 -102
- package/dist/elements/LoadingOverlay/index.js.map +1 -1
- package/dist/elements/Localizer/LocalizerLabel/index.js +23 -36
- package/dist/elements/Localizer/LocalizerLabel/index.js.map +1 -1
- package/dist/elements/QueryPresets/QueryPresetToggler/index.js +41 -139
- package/dist/elements/QueryPresets/QueryPresetToggler/index.js.map +1 -1
- package/dist/elements/RenderIfInViewport/index.d.ts +2 -2
- package/dist/elements/RenderIfInViewport/index.d.ts.map +1 -1
- package/dist/elements/RenderIfInViewport/index.js.map +1 -1
- package/dist/elements/SelectRow/index.js +39 -40
- package/dist/elements/SelectRow/index.js.map +1 -1
- package/dist/elements/ShimmerEffect/index.js +20 -12
- package/dist/elements/ShimmerEffect/index.js.map +1 -1
- package/dist/elements/SortColumn/index.js +21 -30
- package/dist/elements/SortColumn/index.js.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Date/index.js +9 -37
- package/dist/elements/Table/DefaultCell/fields/Date/index.js.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Relationship/index.js +35 -37
- package/dist/elements/Table/DefaultCell/fields/Relationship/index.js.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Select/index.js +12 -27
- package/dist/elements/Table/DefaultCell/fields/Select/index.js.map +1 -1
- package/dist/elements/Thumbnail/index.js +35 -75
- package/dist/elements/Thumbnail/index.js.map +1 -1
- package/dist/elements/ThumbnailCard/index.js +17 -26
- package/dist/elements/ThumbnailCard/index.js.map +1 -1
- package/dist/elements/Tooltip/index.js +51 -127
- package/dist/elements/Tooltip/index.js.map +1 -1
- package/dist/elements/Upload/index.js +2 -10
- package/dist/elements/Upload/index.js.map +1 -1
- package/dist/elements/WhereBuilder/Condition/Select/index.js +31 -44
- package/dist/elements/WhereBuilder/Condition/Select/index.js.map +1 -1
- package/dist/exports/client/{CodeEditor-MIIBUJZ4.js → CodeEditor-O6BWJHD2.js} +2 -2
- package/dist/exports/client/{DatePicker-NMDEHPWL.js → DatePicker-F432AIH3.js} +2 -2
- package/dist/exports/client/{chunk-7RGKTZG2.js → chunk-AZDI6MW4.js} +1 -1
- package/dist/exports/client/{chunk-7RGKTZG2.js.map → chunk-AZDI6MW4.js.map} +1 -1
- package/dist/exports/client/{chunk-Z6O2JA43.js → chunk-FXAFULZQ.js} +6 -6
- package/dist/exports/client/{chunk-Z6O2JA43.js.map → chunk-FXAFULZQ.js.map} +3 -3
- package/dist/exports/client/index.d.ts +3 -2
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +12 -12
- package/dist/exports/client/index.js.map +4 -4
- package/dist/fields/Array/ArrayRow.d.ts +2 -3
- package/dist/fields/Array/ArrayRow.d.ts.map +1 -1
- package/dist/fields/Array/ArrayRow.js +13 -23
- package/dist/fields/Array/ArrayRow.js.map +1 -1
- package/dist/fields/Array/index.js +273 -477
- package/dist/fields/Array/index.js.map +1 -1
- package/dist/fields/Checkbox/Input.js +2 -19
- package/dist/fields/Checkbox/Input.js.map +1 -1
- package/dist/fields/FieldError/index.js +30 -29
- package/dist/fields/FieldError/index.js.map +1 -1
- package/dist/fields/FieldLabel/index.js +12 -64
- package/dist/fields/FieldLabel/index.js.map +1 -1
- package/dist/fields/Relationship/select-components/MultiValueLabel/index.js +45 -103
- package/dist/fields/Relationship/select-components/MultiValueLabel/index.js.map +1 -1
- package/dist/fields/Relationship/select-components/SingleValue/index.js +29 -44
- package/dist/fields/Relationship/select-components/SingleValue/index.js.map +1 -1
- package/dist/fields/Row/index.d.ts +1 -3
- package/dist/fields/Row/index.d.ts.map +1 -1
- package/dist/fields/Select/Input.js +18 -31
- package/dist/fields/Select/Input.js.map +1 -1
- package/dist/fields/Tabs/Tab/index.js +2 -11
- package/dist/fields/Tabs/Tab/index.js.map +1 -1
- package/dist/fields/Tabs/index.d.ts +2 -1
- package/dist/fields/Tabs/index.d.ts.map +1 -1
- package/dist/fields/Tabs/index.js +185 -225
- package/dist/fields/Tabs/index.js.map +1 -1
- package/dist/fields/Upload/RelationshipContent/index.js +79 -127
- package/dist/fields/Upload/RelationshipContent/index.js.map +1 -1
- package/dist/forms/RenderFields/RenderField.js +245 -237
- package/dist/forms/RenderFields/RenderField.js.map +1 -1
- package/dist/forms/RenderFields/types.d.ts +2 -10
- package/dist/forms/RenderFields/types.d.ts.map +1 -1
- package/dist/forms/RenderFields/types.js.map +1 -1
- package/dist/forms/useField/index.d.ts +5 -0
- package/dist/forms/useField/index.d.ts.map +1 -1
- package/dist/forms/useField/index.js +74 -45
- package/dist/forms/useField/index.js.map +1 -1
- package/dist/hooks/useIntersect.js +35 -53
- package/dist/hooks/useIntersect.js.map +1 -1
- package/dist/hooks/usePayloadAPI.js +36 -44
- package/dist/hooks/usePayloadAPI.js.map +1 -1
- package/dist/providers/ServerFunctions/index.d.ts +1 -1
- package/dist/providers/ServerFunctions/index.d.ts.map +1 -1
- package/dist/providers/ServerFunctions/index.js.map +1 -1
- package/dist/views/BrowseByFolder/index.js +37 -55
- package/dist/views/BrowseByFolder/index.js.map +1 -1
- package/dist/views/CollectionFolder/index.js +13 -40
- package/dist/views/CollectionFolder/index.js.map +1 -1
- package/dist/views/Edit/Auth/index.js +93 -105
- package/dist/views/Edit/Auth/index.js.map +1 -1
- package/package.json +8 -8
- /package/dist/exports/client/{CodeEditor-MIIBUJZ4.js.map → CodeEditor-O6BWJHD2.js.map} +0 -0
- /package/dist/exports/client/{DatePicker-NMDEHPWL.js.map → DatePicker-F432AIH3.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/RenderIfInViewport/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/RenderIfInViewport/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CACvC;IACE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,IAAI,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAyB9C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","React","useIntersect","RenderIfInViewport","t0","$","children","className","forceRender","hasRendered","setHasRendered","useState","Boolean","t1","Symbol","for","rootMargin","intersectionRef","entry","isIntersecting","isAboveViewport","boundingClientRect","top","shouldRender","t2","t3","useEffect","t4","t5","_jsx","ref"],"sources":["../../../src/elements/RenderIfInViewport/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useIntersect } from '../../hooks/useIntersect.js'\n\nexport const RenderIfInViewport: React.FC
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","React","useIntersect","RenderIfInViewport","t0","$","children","className","forceRender","hasRendered","setHasRendered","useState","Boolean","t1","Symbol","for","rootMargin","intersectionRef","entry","isIntersecting","isAboveViewport","boundingClientRect","top","shouldRender","t2","t3","useEffect","t4","t5","_jsx","ref"],"sources":["../../../src/elements/RenderIfInViewport/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientComponentProps } from 'payload'\n\nimport React from 'react'\n\nimport { useIntersect } from '../../hooks/useIntersect.js'\n\nexport const RenderIfInViewport: React.FC<\n {\n children: React.ReactNode\n className?: string\n } & Pick<ClientComponentProps, 'forceRender'>\n> = ({ children, className, forceRender }) => {\n const [hasRendered, setHasRendered] = React.useState(Boolean(forceRender))\n const [intersectionRef, entry] = useIntersect(\n {\n rootMargin: '1000px',\n },\n Boolean(forceRender),\n )\n\n const isIntersecting = Boolean(entry?.isIntersecting)\n const isAboveViewport = entry?.boundingClientRect?.top < 0\n const shouldRender = forceRender || isIntersecting || isAboveViewport\n\n React.useEffect(() => {\n if (shouldRender && !hasRendered) {\n setHasRendered(true)\n }\n }, [shouldRender, hasRendered])\n\n return (\n <div className={className} ref={intersectionRef}>\n {hasRendered ? children : null}\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,OAAOC,KAAA,MAAW;AAElB,SAASC,YAAY,QAAQ;AAE7B,OAAO,MAAMC,kBAAA,GAKTC,EAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EAAC;IAAAM,QAAA;IAAAC,SAAA;IAAAC;EAAA,IAAAJ,EAAoC;EACvC,OAAAK,WAAA,EAAAC,cAAA,IAAsCT,KAAA,CAAAU,QAAA,CAAeC,OAAA,CAAQJ,WAAA;EAAA,IAAAK,EAAA;EAAA,IAAAR,CAAA,QAAAS,MAAA,CAAAC,GAAA;IAE3DF,EAAA;MAAAG,UAAA,EACc;IAAA;IACdX,CAAA,MAAAQ,EAAA;EAAA;IAAAA,EAAA,GAAAR,CAAA;EAAA;EAHF,OAAAY,eAAA,EAAAC,KAAA,IAAiChB,YAAA,CAC/BW,EAEA,EACAD,OAAA,CAAQJ,WAAA;EAGV,MAAAW,cAAA,GAAuBP,OAAA,CAAQM,KAAA,EAAAC,cAAO;EACtC,MAAAC,eAAA,GAAwBF,KAAA,EAAAG,kBAAA,EAAAC,GAAA,IAAiC;EACzD,MAAAC,YAAA,GAAqBf,WAAA,IAAeW,cAAA,IAAkBC,eAAA;EAAA,IAAAI,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAApB,CAAA,QAAAI,WAAA,IAAAJ,CAAA,QAAAkB,YAAA;IAEtCC,EAAA,GAAAA,CAAA;MAAA,IACVD,YAAA,KAAiBd,WAAA;QACnBC,cAAA,KAAe;MAAA;IAAA;IAEhBe,EAAA,IAACF,YAAA,EAAcd,WAAA;IAAYJ,CAAA,MAAAI,WAAA;IAAAJ,CAAA,MAAAkB,YAAA;IAAAlB,CAAA,MAAAmB,EAAA;IAAAnB,CAAA,MAAAoB,EAAA;EAAA;IAAAD,EAAA,GAAAnB,CAAA;IAAAoB,EAAA,GAAApB,CAAA;EAAA;EAJ9BJ,KAAA,CAAAyB,SAAA,CAAgBF,EAIhB,EAAGC,EAA2B;EAIzB,MAAAE,EAAA,GAAAlB,WAAA,GAAcH,QAAA,OAAW;EAAA,IAAAsB,EAAA;EAAA,IAAAvB,CAAA,QAAAE,SAAA,IAAAF,CAAA,QAAAY,eAAA,IAAAZ,CAAA,QAAAsB,EAAA;IAD5BC,EAAA,GAAAC,IAAA,CAAC;MAAAtB,SAAA;MAAAuB,GAAA,EAA+Bb,eAAA;MAAAX,QAAA,EAC7BqB;IAAyB,C;;;;;;;;SAD5BC,E;CAIJ","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ import { Locked } from '../Locked/index.js';
|
|
|
10
10
|
import './index.scss';
|
|
11
11
|
const baseClass = 'select-row';
|
|
12
12
|
export const SelectRow = t0 => {
|
|
13
|
-
const $ = _c(
|
|
13
|
+
const $ = _c(13);
|
|
14
14
|
const {
|
|
15
15
|
rowData
|
|
16
16
|
} = t0;
|
|
@@ -22,69 +22,68 @@ export const SelectRow = t0 => {
|
|
|
22
22
|
setSelection
|
|
23
23
|
} = useSelection();
|
|
24
24
|
let t1;
|
|
25
|
-
if ($[0] !== rowData) {
|
|
26
|
-
t1 =
|
|
25
|
+
if ($[0] !== rowData || $[1] !== user?.id) {
|
|
26
|
+
t1 = Symbol.for("react.early_return_sentinel");
|
|
27
|
+
bb0: {
|
|
28
|
+
const {
|
|
29
|
+
_isLocked,
|
|
30
|
+
_userEditing
|
|
31
|
+
} = rowData || {};
|
|
32
|
+
const documentIsLocked = _isLocked && _userEditing;
|
|
33
|
+
if (documentIsLocked && _userEditing.id !== user?.id) {
|
|
34
|
+
t1 = _jsx(Locked, {
|
|
35
|
+
user: _userEditing
|
|
36
|
+
});
|
|
37
|
+
break bb0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
27
40
|
$[0] = rowData;
|
|
28
|
-
$[1] =
|
|
41
|
+
$[1] = user?.id;
|
|
42
|
+
$[2] = t1;
|
|
29
43
|
} else {
|
|
30
|
-
t1 = $[
|
|
44
|
+
t1 = $[2];
|
|
31
45
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
_userEditing
|
|
35
|
-
} = t1;
|
|
36
|
-
const documentIsLocked = _isLocked && _userEditing;
|
|
37
|
-
if (documentIsLocked && _userEditing.id !== user?.id) {
|
|
38
|
-
let t2;
|
|
39
|
-
if ($[2] !== _userEditing) {
|
|
40
|
-
t2 = _jsx(Locked, {
|
|
41
|
-
user: _userEditing
|
|
42
|
-
});
|
|
43
|
-
$[2] = _userEditing;
|
|
44
|
-
$[3] = t2;
|
|
45
|
-
} else {
|
|
46
|
-
t2 = $[3];
|
|
47
|
-
}
|
|
48
|
-
return t2;
|
|
46
|
+
if (t1 !== Symbol.for("react.early_return_sentinel")) {
|
|
47
|
+
return t1;
|
|
49
48
|
}
|
|
50
49
|
let t2;
|
|
51
|
-
if ($[
|
|
50
|
+
if ($[3] !== rowData.id || $[4] !== selected) {
|
|
52
51
|
t2 = selected.get(rowData.id);
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
$[
|
|
52
|
+
$[3] = rowData.id;
|
|
53
|
+
$[4] = selected;
|
|
54
|
+
$[5] = t2;
|
|
56
55
|
} else {
|
|
57
|
-
t2 = $[
|
|
56
|
+
t2 = $[5];
|
|
58
57
|
}
|
|
59
58
|
const t3 = Boolean(t2);
|
|
60
59
|
let t4;
|
|
61
|
-
if ($[
|
|
60
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
62
61
|
t4 = [baseClass, `${baseClass}__checkbox`];
|
|
63
|
-
$[
|
|
62
|
+
$[6] = t4;
|
|
64
63
|
} else {
|
|
65
|
-
t4 = $[
|
|
64
|
+
t4 = $[6];
|
|
66
65
|
}
|
|
67
66
|
let t5;
|
|
68
|
-
if ($[
|
|
67
|
+
if ($[7] !== rowData.id || $[8] !== setSelection) {
|
|
69
68
|
t5 = () => setSelection(rowData.id);
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
69
|
+
$[7] = rowData.id;
|
|
70
|
+
$[8] = setSelection;
|
|
71
|
+
$[9] = t5;
|
|
73
72
|
} else {
|
|
74
|
-
t5 = $[
|
|
73
|
+
t5 = $[9];
|
|
75
74
|
}
|
|
76
75
|
let t6;
|
|
77
|
-
if ($[
|
|
76
|
+
if ($[10] !== t3 || $[11] !== t5) {
|
|
78
77
|
t6 = _jsx(CheckboxInput, {
|
|
79
78
|
checked: t3,
|
|
80
79
|
className: t4.join(" "),
|
|
81
80
|
onToggle: t5
|
|
82
81
|
});
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
82
|
+
$[10] = t3;
|
|
83
|
+
$[11] = t5;
|
|
84
|
+
$[12] = t6;
|
|
86
85
|
} else {
|
|
87
|
-
t6 = $[
|
|
86
|
+
t6 = $[12];
|
|
88
87
|
}
|
|
89
88
|
return t6;
|
|
90
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","React","CheckboxInput","useAuth","useSelection","Locked","baseClass","SelectRow","t0","$","rowData","user","selected","setSelection","t1","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","React","CheckboxInput","useAuth","useSelection","Locked","baseClass","SelectRow","t0","$","rowData","user","selected","setSelection","t1","id","Symbol","for","_isLocked","_userEditing","documentIsLocked","_jsx","t2","get","t3","Boolean","t4","t5","t6","checked","className","join","onToggle"],"sources":["../../../src/elements/SelectRow/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientUser } from 'payload'\n\nimport React from 'react'\n\nimport { CheckboxInput } from '../../fields/Checkbox/Input.js'\nimport { useAuth } from '../../providers/Auth/index.js'\nimport { useSelection } from '../../providers/Selection/index.js'\nimport { Locked } from '../Locked/index.js'\nimport './index.scss'\n\nconst baseClass = 'select-row'\n\nexport const SelectRow: React.FC<{\n rowData: {\n _isLocked: boolean\n _userEditing: ClientUser\n id: string\n }\n}> = ({ rowData }) => {\n const { user } = useAuth()\n const { selected, setSelection } = useSelection()\n const { _isLocked, _userEditing } = rowData || {}\n\n const documentIsLocked = _isLocked && _userEditing\n\n if (documentIsLocked && _userEditing.id !== user?.id) {\n return <Locked user={_userEditing} />\n }\n\n return (\n <CheckboxInput\n checked={Boolean(selected.get(rowData.id))}\n className={[baseClass, `${baseClass}__checkbox`].join(' ')}\n onToggle={() => setSelection(rowData.id)}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,OAAOC,KAAA,MAAW;AAElB,SAASC,aAAa,QAAQ;AAC9B,SAASC,OAAO,QAAQ;AACxB,SAASC,YAAY,QAAQ;AAC7B,SAASC,MAAM,QAAQ;AACvB,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,SAAA,GAMRC,EAAA;EAAA,MAAAC,CAAA,GAAAT,EAAA;EAAC;IAAAU;EAAA,IAAAF,EAAW;EACf;IAAAG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,CAAA,SAAAe,EAAA,IAAAf,CAAA,SAAAkB,EAAA;IAHzCC,EAAA,GAAAP,IAAA,CAAAnB,aAAA;MAAA2B,OAAA,EACWL,EAA+B;MAAAM,SAAA,EAC7BJ,EAAqC,CAAAK,IAAA,CAAM;MAAAC,QAAA,EAC5CL;IAA6B,C;;;;;;;SAHzCC,E;CAMJ","ignoreList":[]}
|
|
@@ -27,7 +27,7 @@ export const ShimmerEffect = ({
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
export const StaggeredShimmers = t0 => {
|
|
30
|
-
const $ = _c(
|
|
30
|
+
const $ = _c(9);
|
|
31
31
|
const {
|
|
32
32
|
className,
|
|
33
33
|
count,
|
|
@@ -45,10 +45,18 @@ export const StaggeredShimmers = t0 => {
|
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
47
|
let t3;
|
|
48
|
-
if ($[0] !==
|
|
49
|
-
t3 =
|
|
48
|
+
if ($[0] !== count) {
|
|
49
|
+
t3 = [...Array(count)];
|
|
50
|
+
$[0] = count;
|
|
51
|
+
$[1] = t3;
|
|
52
|
+
} else {
|
|
53
|
+
t3 = $[1];
|
|
54
|
+
}
|
|
55
|
+
let t4;
|
|
56
|
+
if ($[2] !== className || $[3] !== height || $[4] !== shimmerDelayToPass || $[5] !== shimmerItemClassName || $[6] !== t3 || $[7] !== width) {
|
|
57
|
+
t4 = _jsx("div", {
|
|
50
58
|
className,
|
|
51
|
-
children:
|
|
59
|
+
children: t3.map((_, i) => _jsx("div", {
|
|
52
60
|
className: shimmerItemClassName,
|
|
53
61
|
children: _jsx(ShimmerEffect, {
|
|
54
62
|
animationDelay: `calc(${i} * ${shimmerDelayToPass})`,
|
|
@@ -57,16 +65,16 @@ export const StaggeredShimmers = t0 => {
|
|
|
57
65
|
})
|
|
58
66
|
}, i))
|
|
59
67
|
});
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
62
|
-
$[
|
|
63
|
-
$[
|
|
64
|
-
$[4] = shimmerItemClassName;
|
|
65
|
-
$[5] = width;
|
|
68
|
+
$[2] = className;
|
|
69
|
+
$[3] = height;
|
|
70
|
+
$[4] = shimmerDelayToPass;
|
|
71
|
+
$[5] = shimmerItemClassName;
|
|
66
72
|
$[6] = t3;
|
|
73
|
+
$[7] = width;
|
|
74
|
+
$[8] = t4;
|
|
67
75
|
} else {
|
|
68
|
-
|
|
76
|
+
t4 = $[8];
|
|
69
77
|
}
|
|
70
|
-
return
|
|
78
|
+
return t4;
|
|
71
79
|
};
|
|
72
80
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","React","useDelay","ShimmerEffect","animationDelay","className","disableInlineStyles","height","width","_jsx","filter","Boolean","join","style","StaggeredShimmers","t0","$","count","renderDelay","t1","shimmerDelay","t2","shimmerItemClassName","undefined","shimmerDelayToPass","hasDelayed","t3","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","React","useDelay","ShimmerEffect","animationDelay","className","disableInlineStyles","height","width","_jsx","filter","Boolean","join","style","StaggeredShimmers","t0","$","count","renderDelay","t1","shimmerDelay","t2","shimmerItemClassName","undefined","shimmerDelayToPass","hasDelayed","t3","Array","t4","children","map","_","i"],"sources":["../../../src/elements/ShimmerEffect/index.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { useDelay } from '../../hooks/useDelay.js'\nimport './index.scss'\n\nexport type ShimmerEffectProps = {\n readonly animationDelay?: string\n readonly className?: string\n readonly disableInlineStyles?: boolean\n readonly height?: number | string\n readonly width?: number | string\n}\n\nexport const ShimmerEffect: React.FC<ShimmerEffectProps> = ({\n animationDelay = '0ms',\n className,\n disableInlineStyles = false,\n height = '60px',\n width = '100%',\n}) => {\n return (\n <div\n className={['shimmer-effect', className].filter(Boolean).join(' ')}\n style={{\n height: !disableInlineStyles && (typeof height === 'number' ? `${height}px` : height),\n width: !disableInlineStyles && (typeof width === 'number' ? `${width}px` : width),\n }}\n >\n <div\n className=\"shimmer-effect__shine\"\n style={{\n animationDelay,\n }}\n />\n </div>\n )\n}\n\nexport type StaggeredShimmersProps = {\n className?: string\n count: number\n height?: number | string\n renderDelay?: number\n shimmerDelay?: number | string\n shimmerItemClassName?: string\n width?: number | string\n}\n\nexport const StaggeredShimmers: React.FC<StaggeredShimmersProps> = ({\n className,\n count,\n height,\n renderDelay = 500,\n shimmerDelay = 25,\n shimmerItemClassName,\n width,\n}) => {\n const shimmerDelayToPass = typeof shimmerDelay === 'number' ? `${shimmerDelay}ms` : shimmerDelay\n const [hasDelayed] = useDelay(renderDelay, true)\n\n if (!hasDelayed) {\n return null\n }\n\n return (\n <div className={className}>\n {[...Array(count)].map((_, i) => (\n <div className={shimmerItemClassName} key={i}>\n <ShimmerEffect\n animationDelay={`calc(${i} * ${shimmerDelayToPass})`}\n height={height}\n width={width}\n />\n </div>\n ))}\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,YAAYC,KAAA,MAAW;AAEvB,SAASC,QAAQ,QAAQ;AACzB,OAAO;AAUP,OAAO,MAAMC,aAAA,GAA8CA,CAAC;EAC1DC,cAAA,GAAiB,KAAK;EACtBC,SAAS;EACTC,mBAAA,GAAsB,KAAK;EAC3BC,MAAA,GAAS,MAAM;EACfC,KAAA,GAAQ;AAAM,CACf;EACC,oBACEC,IAAA,CAAC;IACCJ,SAAA,EAAW,CAAC,kBAAkBA,SAAA,CAAU,CAACK,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;IAC9DC,KAAA,EAAO;MACLN,MAAA,EAAQ,CAACD,mBAAA,KAAwB,OAAOC,MAAA,KAAW,WAAW,GAAGA,MAAA,IAAU,GAAGA,MAAK;MACnFC,KAAA,EAAO,CAACF,mBAAA,KAAwB,OAAOE,KAAA,KAAU,WAAW,GAAGA,KAAA,IAAS,GAAGA,KAAI;IACjF;cAEA,aAAAC,IAAA,CAAC;MACCJ,SAAA,EAAU;MACVQ,KAAA,EAA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;;;;;;;SAF/CJ,E;CAYJ","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ import { useTranslation } from '../../providers/Translation/index.js';
|
|
|
10
10
|
import './index.scss';
|
|
11
11
|
const baseClass = 'sort-column';
|
|
12
12
|
export const SortColumn = props => {
|
|
13
|
-
const $ = _c(
|
|
13
|
+
const $ = _c(19);
|
|
14
14
|
const {
|
|
15
15
|
name,
|
|
16
16
|
appearance,
|
|
@@ -66,25 +66,16 @@ export const SortColumn = props => {
|
|
|
66
66
|
}
|
|
67
67
|
const t3 = t2.join(" ");
|
|
68
68
|
let t4;
|
|
69
|
-
if ($[8] !== Label || $[9] !== label) {
|
|
70
|
-
t4 =
|
|
71
|
-
hideLocale: true,
|
|
72
|
-
label,
|
|
73
|
-
unstyled: true
|
|
74
|
-
});
|
|
75
|
-
$[8] = Label;
|
|
76
|
-
$[9] = label;
|
|
77
|
-
$[10] = t4;
|
|
78
|
-
} else {
|
|
79
|
-
t4 = $[10];
|
|
80
|
-
}
|
|
81
|
-
let t5;
|
|
82
|
-
if ($[11] !== asc || $[12] !== ascClasses || $[13] !== desc || $[14] !== descClasses || $[15] !== disable || $[16] !== handleSortChange || $[17] !== label || $[18] !== t || $[19] !== t3 || $[20] !== t4) {
|
|
83
|
-
t5 = _jsxs("div", {
|
|
69
|
+
if ($[8] !== Label || $[9] !== asc || $[10] !== ascClasses || $[11] !== desc || $[12] !== descClasses || $[13] !== disable || $[14] !== handleSortChange || $[15] !== label || $[16] !== t || $[17] !== t3) {
|
|
70
|
+
t4 = _jsxs("div", {
|
|
84
71
|
className: t3,
|
|
85
72
|
children: [_jsx("span", {
|
|
86
73
|
className: `${baseClass}__label`,
|
|
87
|
-
children:
|
|
74
|
+
children: Label ?? _jsx(FieldLabel, {
|
|
75
|
+
hideLocale: true,
|
|
76
|
+
label,
|
|
77
|
+
unstyled: true
|
|
78
|
+
})
|
|
88
79
|
}), !disable && _jsxs("div", {
|
|
89
80
|
className: `${baseClass}__buttons`,
|
|
90
81
|
children: [_jsx("button", {
|
|
@@ -110,20 +101,20 @@ export const SortColumn = props => {
|
|
|
110
101
|
})]
|
|
111
102
|
})]
|
|
112
103
|
});
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
104
|
+
$[8] = Label;
|
|
105
|
+
$[9] = asc;
|
|
106
|
+
$[10] = ascClasses;
|
|
107
|
+
$[11] = desc;
|
|
108
|
+
$[12] = descClasses;
|
|
109
|
+
$[13] = disable;
|
|
110
|
+
$[14] = handleSortChange;
|
|
111
|
+
$[15] = label;
|
|
112
|
+
$[16] = t;
|
|
113
|
+
$[17] = t3;
|
|
114
|
+
$[18] = t4;
|
|
124
115
|
} else {
|
|
125
|
-
|
|
116
|
+
t4 = $[18];
|
|
126
117
|
}
|
|
127
|
-
return
|
|
118
|
+
return t4;
|
|
128
119
|
};
|
|
129
120
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","React","FieldLabel","ChevronIcon","useListQuery","useTranslation","baseClass","SortColumn","props","$","name","appearance","disable","t0","Label","label","undefined","handleSortChange","query","t","sort","desc","asc","ascClasses","push","descClasses","t1","t2","filter","Boolean","t3","join","t4","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","React","FieldLabel","ChevronIcon","useListQuery","useTranslation","baseClass","SortColumn","props","$","name","appearance","disable","t0","Label","label","undefined","handleSortChange","query","t","sort","desc","asc","ascClasses","push","descClasses","t1","t2","filter","Boolean","t3","join","t4","_jsxs","className","children","_jsx","hideLocale","unstyled","direction","onClick","type"],"sources":["../../../src/elements/SortColumn/index.tsx"],"sourcesContent":["'use client'\nimport type { StaticLabel } from 'payload'\n\nimport React from 'react'\n\nimport { FieldLabel } from '../../fields/FieldLabel/index.js'\nimport { ChevronIcon } from '../../icons/Chevron/index.js'\nimport { useListQuery } from '../../providers/ListQuery/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport './index.scss'\n\nexport type SortColumnProps = {\n readonly appearance?: 'condensed' | 'default'\n readonly disable?: boolean\n readonly Label: React.ReactNode\n readonly label?: StaticLabel\n readonly name: string\n}\n\nconst baseClass = 'sort-column'\n\nexport const SortColumn: React.FC<SortColumnProps> = (props) => {\n const { name, appearance, disable = false, Label, label } = props\n const { handleSortChange, query } = useListQuery()\n const { t } = useTranslation()\n\n const { sort } = query\n\n const desc = `-${name}`\n const asc = name\n\n const ascClasses = [`${baseClass}__asc`]\n if (sort === asc) {\n ascClasses.push(`${baseClass}--active`)\n }\n\n const descClasses = [`${baseClass}__desc`]\n if (sort === desc) {\n descClasses.push(`${baseClass}--active`)\n }\n\n return (\n <div\n className={[baseClass, appearance && `${baseClass}--appearance-${appearance}`]\n .filter(Boolean)\n .join(' ')}\n >\n <span className={`${baseClass}__label`}>\n {Label ?? <FieldLabel hideLocale label={label} unstyled />}\n </span>\n {!disable && (\n <div className={`${baseClass}__buttons`}>\n <button\n aria-label={t('general:sortByLabelDirection', {\n direction: t('general:ascending'),\n label,\n })}\n className={[...ascClasses, `${baseClass}__button`].filter(Boolean).join(' ')}\n onClick={() => void handleSortChange(asc)}\n type=\"button\"\n >\n <ChevronIcon direction=\"up\" />\n </button>\n <button\n aria-label={t('general:sortByLabelDirection', {\n direction: t('general:descending'),\n label,\n })}\n className={[...descClasses, `${baseClass}__button`].filter(Boolean).join(' ')}\n onClick={() => void handleSortChange(desc)}\n type=\"button\"\n >\n <ChevronIcon />\n </button>\n </div>\n )}\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,OAAOC,KAAA,MAAW;AAElB,SAASC,UAAU,QAAQ;AAC3B,SAASC,WAAW,QAAQ;AAC5B,SAASC,YAAY,QAAQ;AAC7B,SAASC,cA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;UAAA,C;YAEzBH,IAAA,CAAC;UAAA,cACajB,CAAA,CAAE;YAAAoB,SAAA,EACDpB,CAAA,CAAE;YAAAJ;UAAA,CAEf;UAAAmB,SAAA,EACW,IAAIT,WAAA,EAAa,GAAAnB,SAAA,UAAsB,EAAAsB,MAAA,CAAAC,OAAS,EAAAE,IAAA,CAAc;UAAAS,OAAA,EAAAA,CAAA,UACrDvB,gBAAA,CAAiBI,IAAA;UAAAoB,IAAA,EAChC;UAAAN,QAAA,EAELC,IAAA,CAAAjC,WAAA,IAAC;QAAA,C;;;;;;;;;;;;;;;;;SA9BT6B,E;CAoCJ","ignoreList":[]}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { c as _c } from "react/compiler-runtime";
|
|
4
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import { useConfig } from '../../../../../providers/Config/index.js';
|
|
7
6
|
import { useTranslation } from '../../../../../providers/Translation/index.js';
|
|
8
7
|
import { formatDate } from '../../../../../utilities/formatDocTitle/formatDateTitle.js';
|
|
9
8
|
export const DateCell = t0 => {
|
|
10
|
-
const $ = _c(8);
|
|
11
9
|
const {
|
|
12
10
|
cellData,
|
|
13
11
|
field: t1
|
|
@@ -15,54 +13,28 @@ export const DateCell = t0 => {
|
|
|
15
13
|
const {
|
|
16
14
|
admin: t2
|
|
17
15
|
} = t1;
|
|
18
|
-
let t3;
|
|
19
|
-
if ($[0] !== t2) {
|
|
20
|
-
t3 = t2 === undefined ? {} : t2;
|
|
21
|
-
$[0] = t2;
|
|
22
|
-
$[1] = t3;
|
|
23
|
-
} else {
|
|
24
|
-
t3 = $[1];
|
|
25
|
-
}
|
|
26
16
|
const {
|
|
27
17
|
date
|
|
28
|
-
} =
|
|
18
|
+
} = t2 === undefined ? {} : t2;
|
|
29
19
|
const {
|
|
30
|
-
config:
|
|
20
|
+
config: t3
|
|
31
21
|
} = useConfig();
|
|
32
22
|
const {
|
|
33
|
-
admin:
|
|
34
|
-
} =
|
|
23
|
+
admin: t4
|
|
24
|
+
} = t3;
|
|
35
25
|
const {
|
|
36
26
|
dateFormat: dateFormatFromRoot
|
|
37
|
-
} =
|
|
27
|
+
} = t4;
|
|
38
28
|
const dateFormat = date?.displayFormat || dateFormatFromRoot;
|
|
39
29
|
const {
|
|
40
30
|
i18n
|
|
41
31
|
} = useTranslation();
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
t6 = cellData && formatDate({
|
|
32
|
+
return _jsx("span", {
|
|
33
|
+
children: cellData && formatDate({
|
|
45
34
|
date: cellData,
|
|
46
35
|
i18n,
|
|
47
36
|
pattern: dateFormat
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
$[3] = dateFormat;
|
|
51
|
-
$[4] = i18n;
|
|
52
|
-
$[5] = t6;
|
|
53
|
-
} else {
|
|
54
|
-
t6 = $[5];
|
|
55
|
-
}
|
|
56
|
-
let t7;
|
|
57
|
-
if ($[6] !== t6) {
|
|
58
|
-
t7 = _jsx("span", {
|
|
59
|
-
children: t6
|
|
60
|
-
});
|
|
61
|
-
$[6] = t6;
|
|
62
|
-
$[7] = t7;
|
|
63
|
-
} else {
|
|
64
|
-
t7 = $[7];
|
|
65
|
-
}
|
|
66
|
-
return t7;
|
|
37
|
+
})
|
|
38
|
+
});
|
|
67
39
|
};
|
|
68
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useConfig","useTranslation","formatDate","DateCell","t0","cellData","field","t1","admin","t2","date","undefined","config","t3","t4","dateFormat","dateFormatFromRoot","displayFormat","i18n","_jsx","children","pattern"],"sources":["../../../../../../src/elements/Table/DefaultCell/fields/Date/index.tsx"],"sourcesContent":["'use client'\nimport type { DateFieldClient, DefaultCellComponentProps } from 'payload'\n\nimport React from 'react'\n\nimport { useConfig } from '../../../../../providers/Config/index.js'\nimport { useTranslation } from '../../../../../providers/Translation/index.js'\nimport { formatDate } from '../../../../../utilities/formatDocTitle/formatDateTitle.js'\n\nexport const DateCell: React.FC<DefaultCellComponentProps<DateFieldClient>> = ({\n cellData,\n field: { admin: { date } = {} },\n}) => {\n const {\n config: {\n admin: { dateFormat: dateFormatFromRoot },\n },\n } = useConfig()\n\n const dateFormat = date?.displayFormat || dateFormatFromRoot\n\n const { i18n } = useTranslation()\n\n return <span>{cellData && formatDate({ date: cellData, i18n, pattern: dateFormat })}</span>\n}\n"],"mappings":"AAAA;;;AAGA,OAAOA,KAAA,MAAW;AAElB,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,UAAU,QAAQ;AAE3B,OAAO,MAAMC,QAAA,GAAiEC,EAAA;EAAC;IAAAC,QAAA;IAAAC,KAAA,EAAAC;EAAA,IAAAH,EAG9E;EADQ;IAAAI,KAAA,EAAAC;EAAA,IAAAF,EAAwB;EAAf;IAAAG;EAAA,IAAAD,EAAa,KAAAE,SAAA,QAAbF,EAAa;EAE7B;IAAAG,MAAA,EAAAC;EAAA,IAIIb,SAAA;EAHM;IAAAQ,KAAA,EAAAM;EAAA,IAAAD,EAEP;EADQ;IAAAE,UAAA,EAAAC;EAAA,IAAAF,EAAkC;EAI7C,MAAAC,UAAA,GAAmBL,IAAA,EAAAO,aAAA,IAAuBD,kBAAA;EAE1C;IAAAE;EAAA,IAAiBjB,cAAA;EAAA,OAEVkB,IAAA,CAAC;IAAAC,QAAA,EAAMf,QAAA,IAAYH,UAAA;MAAAQ,IAAA,EAAmBL,QAAA;MAAAa,IAAA;MAAAG,OAAA,EAAyBN;IAAA,CAAW;EAAA,C;CACnF","ignoreList":[]}
|
|
@@ -26,9 +26,7 @@ export const RelationshipCell = t0 => {
|
|
|
26
26
|
label
|
|
27
27
|
} = t1;
|
|
28
28
|
const relationTo = "relationTo" in field && field.relationTo || "collection" in field && field.collection;
|
|
29
|
-
|
|
30
|
-
t2 = "collection" in field ? cellDataFromProps?.docs : cellDataFromProps;
|
|
31
|
-
const cellData = t2;
|
|
29
|
+
const cellData = "collection" in field ? cellDataFromProps?.docs : cellDataFromProps;
|
|
32
30
|
const {
|
|
33
31
|
config,
|
|
34
32
|
getEntityConfig
|
|
@@ -38,14 +36,14 @@ export const RelationshipCell = t0 => {
|
|
|
38
36
|
routes
|
|
39
37
|
} = config;
|
|
40
38
|
const [intersectionRef, entry] = useIntersect();
|
|
41
|
-
let
|
|
39
|
+
let t2;
|
|
42
40
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
43
|
-
|
|
44
|
-
$[0] =
|
|
41
|
+
t2 = [];
|
|
42
|
+
$[0] = t2;
|
|
45
43
|
} else {
|
|
46
|
-
|
|
44
|
+
t2 = $[0];
|
|
47
45
|
}
|
|
48
|
-
const [values, setValues] = useState(
|
|
46
|
+
const [values, setValues] = useState(t2);
|
|
49
47
|
const {
|
|
50
48
|
documents,
|
|
51
49
|
getRelationships
|
|
@@ -56,9 +54,9 @@ export const RelationshipCell = t0 => {
|
|
|
56
54
|
t
|
|
57
55
|
} = useTranslation();
|
|
58
56
|
const isAboveViewport = canUseDOM ? entry?.boundingClientRect?.top < window.innerHeight : false;
|
|
59
|
-
let
|
|
57
|
+
let t3;
|
|
60
58
|
if ($[1] !== cellData || $[2] !== getRelationships || $[3] !== hasRequested || $[4] !== isAboveViewport || $[5] !== relationTo) {
|
|
61
|
-
|
|
59
|
+
t3 = () => {
|
|
62
60
|
if ((cellData || typeof cellData === "number") && isAboveViewport && !hasRequested) {
|
|
63
61
|
const formattedValues = [];
|
|
64
62
|
const arrayCellData = Array.isArray(cellData) ? cellData : [cellData];
|
|
@@ -83,13 +81,13 @@ export const RelationshipCell = t0 => {
|
|
|
83
81
|
$[3] = hasRequested;
|
|
84
82
|
$[4] = isAboveViewport;
|
|
85
83
|
$[5] = relationTo;
|
|
86
|
-
$[6] =
|
|
84
|
+
$[6] = t3;
|
|
87
85
|
} else {
|
|
88
|
-
|
|
86
|
+
t3 = $[6];
|
|
89
87
|
}
|
|
90
|
-
let
|
|
88
|
+
let t4;
|
|
91
89
|
if ($[7] !== cellData || $[8] !== collections || $[9] !== getRelationships || $[10] !== hasRequested || $[11] !== isAboveViewport || $[12] !== relationTo || $[13] !== routes.api) {
|
|
92
|
-
|
|
90
|
+
t4 = [cellData, relationTo, collections, isAboveViewport, routes.api, hasRequested, getRelationships];
|
|
93
91
|
$[7] = cellData;
|
|
94
92
|
$[8] = collections;
|
|
95
93
|
$[9] = getRelationships;
|
|
@@ -97,41 +95,41 @@ export const RelationshipCell = t0 => {
|
|
|
97
95
|
$[11] = isAboveViewport;
|
|
98
96
|
$[12] = relationTo;
|
|
99
97
|
$[13] = routes.api;
|
|
100
|
-
$[14] =
|
|
98
|
+
$[14] = t4;
|
|
101
99
|
} else {
|
|
102
|
-
|
|
100
|
+
t4 = $[14];
|
|
103
101
|
}
|
|
104
|
-
useEffect(
|
|
105
|
-
let
|
|
102
|
+
useEffect(t3, t4);
|
|
103
|
+
let t5;
|
|
106
104
|
if ($[15] !== hasRequested) {
|
|
107
|
-
|
|
105
|
+
t5 = () => {
|
|
108
106
|
if (hasRequested) {
|
|
109
107
|
setHasRequested(false);
|
|
110
108
|
}
|
|
111
109
|
};
|
|
112
110
|
$[15] = hasRequested;
|
|
113
|
-
$[16] =
|
|
111
|
+
$[16] = t5;
|
|
114
112
|
} else {
|
|
115
|
-
|
|
113
|
+
t5 = $[16];
|
|
116
114
|
}
|
|
117
|
-
let
|
|
115
|
+
let t6;
|
|
118
116
|
if ($[17] !== cellData) {
|
|
119
|
-
|
|
117
|
+
t6 = [cellData];
|
|
120
118
|
$[17] = cellData;
|
|
121
|
-
$[18] =
|
|
119
|
+
$[18] = t6;
|
|
122
120
|
} else {
|
|
123
|
-
|
|
121
|
+
t6 = $[18];
|
|
124
122
|
}
|
|
125
|
-
useEffect(
|
|
126
|
-
let
|
|
123
|
+
useEffect(t5, t6);
|
|
124
|
+
let t7;
|
|
127
125
|
if ($[19] !== cellData || $[20] !== config.admin || $[21] !== customCellContext || $[22] !== documents || $[23] !== field || $[24] !== getEntityConfig || $[25] !== i18n || $[26] !== intersectionRef || $[27] !== label || $[28] !== t || $[29] !== values) {
|
|
128
|
-
let
|
|
126
|
+
let t8;
|
|
129
127
|
if ($[31] !== config.admin || $[32] !== customCellContext || $[33] !== documents || $[34] !== field || $[35] !== getEntityConfig || $[36] !== i18n || $[37] !== t || $[38] !== values.length) {
|
|
130
|
-
|
|
128
|
+
t8 = (t9, i) => {
|
|
131
129
|
const {
|
|
132
130
|
relationTo: relationTo_0,
|
|
133
131
|
value
|
|
134
|
-
} =
|
|
132
|
+
} = t9;
|
|
135
133
|
const document = documents[relationTo_0][value];
|
|
136
134
|
const relatedCollection = getEntityConfig({
|
|
137
135
|
collectionSlug: relationTo_0
|
|
@@ -170,14 +168,14 @@ export const RelationshipCell = t0 => {
|
|
|
170
168
|
$[36] = i18n;
|
|
171
169
|
$[37] = t;
|
|
172
170
|
$[38] = values.length;
|
|
173
|
-
$[39] =
|
|
171
|
+
$[39] = t8;
|
|
174
172
|
} else {
|
|
175
|
-
|
|
173
|
+
t8 = $[39];
|
|
176
174
|
}
|
|
177
|
-
|
|
175
|
+
t7 = _jsxs("div", {
|
|
178
176
|
className: baseClass,
|
|
179
177
|
ref: intersectionRef,
|
|
180
|
-
children: [values.map(
|
|
178
|
+
children: [values.map(t8), Array.isArray(cellData) && cellData.length > totalToShow && t("fields:itemsAndMore", {
|
|
181
179
|
count: cellData.length - totalToShow,
|
|
182
180
|
items: ""
|
|
183
181
|
}), values.length === 0 && t("general:noLabel", {
|
|
@@ -195,10 +193,10 @@ export const RelationshipCell = t0 => {
|
|
|
195
193
|
$[27] = label;
|
|
196
194
|
$[28] = t;
|
|
197
195
|
$[29] = values;
|
|
198
|
-
$[30] =
|
|
196
|
+
$[30] = t7;
|
|
199
197
|
} else {
|
|
200
|
-
|
|
198
|
+
t7 = $[30];
|
|
201
199
|
}
|
|
202
|
-
return
|
|
200
|
+
return t7;
|
|
203
201
|
};
|
|
204
202
|
//# sourceMappingURL=index.js.map
|