@payloadcms/ui 3.62.0 → 3.63.0-internal.dc01f92
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/ConfirmationModal/index.d.ts.map +1 -1
- package/dist/elements/ConfirmationModal/index.js +5 -1
- package/dist/elements/ConfirmationModal/index.js.map +1 -1
- package/dist/elements/DocumentControls/index.d.ts.map +1 -1
- package/dist/elements/DocumentControls/index.js +16 -7
- package/dist/elements/DocumentControls/index.js.map +1 -1
- package/dist/elements/DuplicateDocument/SelectLocalesDrawer/index.d.ts +16 -0
- package/dist/elements/DuplicateDocument/SelectLocalesDrawer/index.d.ts.map +1 -0
- package/dist/elements/DuplicateDocument/SelectLocalesDrawer/index.js +103 -0
- package/dist/elements/DuplicateDocument/SelectLocalesDrawer/index.js.map +1 -0
- package/dist/elements/DuplicateDocument/SelectLocalesDrawer/index.scss +24 -0
- package/dist/elements/DuplicateDocument/index.d.ts +2 -1
- package/dist/elements/DuplicateDocument/index.d.ts.map +1 -1
- package/dist/elements/DuplicateDocument/index.js +82 -38
- package/dist/elements/DuplicateDocument/index.js.map +1 -1
- package/dist/elements/SortHeader/index.d.ts.map +1 -1
- package/dist/elements/SortHeader/index.js +29 -64
- package/dist/elements/SortHeader/index.js.map +1 -1
- package/dist/elements/withMergedProps/index.d.ts +1 -1
- package/dist/elements/withMergedProps/index.js +1 -1
- package/dist/elements/withMergedProps/index.js.map +1 -1
- package/dist/exports/client/index.js +12 -12
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/shared/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useModal","getTranslation","useRouter","formatAdminURL","React","useCallback","toast","useForm","useFormModified","useConfig","useLocale","useRouteTransition","useTranslation","requests","ConfirmationModal","PopupList","DuplicateDocument","id","slug","onDuplicate","redirectAfterDuplicate","singularLabel","router","modified","openModal","locale","setModified","startRouteTransition","config","routes","admin","adminRoute","api","apiRoute","serverURL","getEntityConfig","collectionConfig","collectionSlug","renderModal","setRenderModal","useState","i18n","t","modalSlug","duplicate","post","code","body","JSON","stringify","headers","language","credentials","then","res","doc","errors","message","json","status","success","label","push","path","error","onConfirm","_jsxs","Fragment","_jsx","Button","onClick","confirmLabel","heading"],"sources":["../../../src/elements/DuplicateDocument/index.tsx"],"sourcesContent":["'use client'\n\nimport type { SanitizedCollectionConfig } from 'payload'\n\nimport { useModal } from '@faceless-ui/modal'\nimport { getTranslation } from '@payloadcms/translations'\nimport { useRouter } from 'next/navigation.js'\nimport { formatAdminURL } from 'payload/shared'\nimport React, { useCallback } from 'react'\nimport { toast } from 'sonner'\n\nimport type { DocumentDrawerContextType } from '../DocumentDrawer/Provider.js'\n\nimport { useForm, useFormModified } from '../../forms/Form/context.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useLocale } from '../../providers/Locale/index.js'\nimport { useRouteTransition } from '../../providers/RouteTransition/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { requests } from '../../utilities/api.js'\nimport { ConfirmationModal } from '../ConfirmationModal/index.js'\nimport { PopupList } from '../Popup/index.js'\n\nexport type Props = {\n readonly id: string\n readonly onDuplicate?: DocumentDrawerContextType['onDuplicate']\n readonly redirectAfterDuplicate?: boolean\n readonly singularLabel: SanitizedCollectionConfig['labels']['singular']\n readonly slug: string\n}\n\nexport const DuplicateDocument: React.FC<Props> = ({\n id,\n slug,\n onDuplicate,\n redirectAfterDuplicate = true,\n singularLabel,\n}) => {\n const router = useRouter()\n const modified = useFormModified()\n const { openModal } = useModal()\n const locale = useLocale()\n const { setModified } = useForm()\n const { startRouteTransition } = useRouteTransition()\n\n const {\n config: {\n routes: { admin: adminRoute, api: apiRoute },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n\n const collectionConfig = getEntityConfig({ collectionSlug: slug })\n\n const [renderModal, setRenderModal] = React.useState(false)\n const { i18n, t } = useTranslation()\n\n const modalSlug = `duplicate-${id}`\n\n const duplicate = useCallback(async () => {\n setRenderModal(true)\n\n await requests\n .post(\n `${serverURL}${apiRoute}/${slug}/${id}/duplicate${locale?.code ? `?locale=${locale.code}` : ''}`,\n {\n body: JSON.stringify({}),\n headers: {\n 'Accept-Language': i18n.language,\n 'Content-Type': 'application/json',\n credentials: 'include',\n },\n },\n )\n .then(async (res) => {\n const { doc, errors, message } = await res.json()\n\n if (res.status < 400) {\n toast.success(\n message ||\n t('general:successfullyDuplicated', { label: getTranslation(singularLabel, i18n) }),\n )\n\n setModified(false)\n\n if (redirectAfterDuplicate) {\n return startRouteTransition(() =>\n router.push(\n formatAdminURL({\n adminRoute,\n path: `/collections/${slug}/${doc.id}${locale?.code ? `?locale=${locale.code}` : ''}`,\n }),\n ),\n )\n }\n\n if (typeof onDuplicate === 'function') {\n void onDuplicate({ collectionConfig, doc })\n }\n } else {\n toast.error(\n errors?.[0].message ||\n message ||\n t('error:unspecific', { label: getTranslation(singularLabel, i18n) }),\n )\n }\n })\n }, [\n locale,\n serverURL,\n apiRoute,\n slug,\n id,\n i18n,\n t,\n singularLabel,\n onDuplicate,\n redirectAfterDuplicate,\n setModified,\n router,\n adminRoute,\n collectionConfig,\n startRouteTransition,\n ])\n\n const onConfirm = useCallback(async () => {\n setRenderModal(false)\n\n await duplicate()\n }, [duplicate])\n\n return (\n <React.Fragment>\n <PopupList.Button\n id=\"action-duplicate\"\n onClick={() => {\n if (modified) {\n setRenderModal(true)\n return openModal(modalSlug)\n }\n\n return duplicate()\n }}\n >\n {t('general:duplicate')}\n </PopupList.Button>\n {renderModal && (\n <ConfirmationModal\n body={t('general:unsavedChangesDuplicate')}\n confirmLabel={t('general:duplicateWithoutSaving')}\n heading={t('general:unsavedChanges')}\n modalSlug={modalSlug}\n onConfirm={onConfirm}\n />\n )}\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;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AA,EACAD,EAAA,EACAwB,IAAA,EACAC,CAAA,EACArB,aAAA,EACAF,WAAA,EACAC,sBAAA,EACAM,WAAA,EACAJ,MAAA,EACAS,UAAA,EACAK,gBAAA,EACAT,oBAAA,CACD;EAED,MAAMsC,SAAA,GAAY5D,WAAA,CAAY;IAC5BkC,cAAA,CAAe;IAEf,MAAMK,SAAA;EACR,GAAG,CAACA,SAAA,CAAU;EAEd,oBACEsB,KAAA,CAAC9D,KAAA,CAAM+D,QAAQ;4BACbC,IAAA,CAACrD,SAAA,CAAUsD,MAAM;MACfpD,EAAA,EAAG;MACHqD,OAAA,EAASA,CAAA;QACP,IAAI/C,QAAA,EAAU;UACZgB,cAAA,CAAe;UACf,OAAOf,SAAA,CAAUmB,SAAA;QACnB;QAEA,OAAOC,SAAA;MACT;gBAECF,CAAA,CAAE;QAEJJ,WAAA,iBACC8B,IAAA,CAACtD,iBAAA;MACCiC,IAAA,EAAML,CAAA,CAAE;MACR6B,YAAA,EAAc7B,CAAA,CAAE;MAChB8B,OAAA,EAAS9B,CAAA,CAAE;MACXC,SAAA,EAAWA,SAAA;MACXsB,SAAA,EAAWA;;;AAKrB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["useModal","getTranslation","useRouter","formatAdminURL","qs","React","useCallback","useMemo","toast","useForm","useFormModified","useConfig","useLocale","useRouteTransition","useTranslation","requests","traverseForLocalizedFields","ConfirmationModal","PopupList","SelectLocalesDrawer","DuplicateDocument","id","slug","onDuplicate","redirectAfterDuplicate","selectLocales","singularLabel","router","modified","openModal","code","localeCode","setModified","startRouteTransition","config","localization","routes","admin","adminRoute","api","apiRoute","serverURL","getEntityConfig","collectionConfig","collectionSlug","i18n","t","modalSlug","drawerSlug","isDuplicateByLocaleEnabled","fields","handleDuplicate","args","selectedLocales","hasSelectedLocales","length","queryParams","locale","headers","language","credentials","res","post","stringify","addQueryPrefix","body","JSON","doc","errors","message","json","status","success","label","push","path","error","_error","handleConfirmWithoutSaving","buttonLabel","_jsxs","Fragment","_jsx","Button","onClick","confirmLabel","heading","onConfirm"],"sources":["../../../src/elements/DuplicateDocument/index.tsx"],"sourcesContent":["'use client'\n\nimport type { SanitizedCollectionConfig } from 'payload'\n\nimport { useModal } from '@faceless-ui/modal'\nimport { getTranslation } from '@payloadcms/translations'\nimport { useRouter } from 'next/navigation.js'\nimport { formatAdminURL } from 'payload/shared'\nimport * as qs from 'qs-esm'\nimport React, { useCallback, useMemo } from 'react'\nimport { toast } from 'sonner'\n\nimport type { DocumentDrawerContextType } from '../DocumentDrawer/Provider.js'\n\nimport { useForm, useFormModified } from '../../forms/Form/context.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useLocale } from '../../providers/Locale/index.js'\nimport { useRouteTransition } from '../../providers/RouteTransition/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { requests } from '../../utilities/api.js'\nimport { traverseForLocalizedFields } from '../../utilities/traverseForLocalizedFields.js'\nimport { ConfirmationModal } from '../ConfirmationModal/index.js'\nimport { PopupList } from '../Popup/index.js'\nimport { SelectLocalesDrawer } from './SelectLocalesDrawer/index.js'\n\nexport type Props = {\n readonly id: number | string\n readonly onDuplicate?: DocumentDrawerContextType['onDuplicate']\n readonly redirectAfterDuplicate?: boolean\n readonly selectLocales?: boolean\n readonly singularLabel: SanitizedCollectionConfig['labels']['singular']\n readonly slug: string\n}\n\nexport const DuplicateDocument: React.FC<Props> = ({\n id,\n slug,\n onDuplicate,\n redirectAfterDuplicate = true,\n selectLocales,\n singularLabel,\n}) => {\n const router = useRouter()\n const modified = useFormModified()\n const { openModal } = useModal()\n const { code: localeCode } = useLocale()\n const { setModified } = useForm()\n const { startRouteTransition } = useRouteTransition()\n\n const {\n config: {\n localization,\n routes: { admin: adminRoute, api: apiRoute },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n\n const collectionConfig = getEntityConfig({ collectionSlug: slug })\n\n const { i18n, t } = useTranslation()\n\n const modalSlug = `duplicate-${id}`\n const drawerSlug = `duplicate-locales-${id}`\n\n const isDuplicateByLocaleEnabled = useMemo(() => {\n if (selectLocales && collectionConfig) {\n return traverseForLocalizedFields(collectionConfig.fields)\n }\n return false\n }, [collectionConfig, selectLocales])\n\n const handleDuplicate = useCallback(\n async (args?: { selectedLocales?: string[] }) => {\n const { selectedLocales } = args || {}\n const hasSelectedLocales = selectedLocales && selectedLocales.length > 0\n\n const queryParams: Record<string, string | string[]> = {}\n if (localeCode) {\n queryParams.locale = localeCode\n }\n if (hasSelectedLocales) {\n queryParams.selectedLocales = selectedLocales\n }\n\n const headers = {\n 'Accept-Language': i18n.language,\n 'Content-Type': 'application/json',\n credentials: 'include',\n }\n\n try {\n const res = await requests.post(\n `${serverURL}${apiRoute}/${slug}/${id}/duplicate${qs.stringify(queryParams, {\n addQueryPrefix: true,\n })}`,\n {\n body: JSON.stringify({}),\n headers,\n },\n )\n\n const { doc, errors, message } = await res.json()\n\n if (res.status < 400) {\n toast.success(\n message ||\n t('general:successfullyDuplicated', { label: getTranslation(singularLabel, i18n) }),\n )\n\n setModified(false)\n\n if (redirectAfterDuplicate) {\n return startRouteTransition(() =>\n router.push(\n formatAdminURL({\n adminRoute,\n path: `/collections/${slug}/${doc.id}${localeCode ? `?locale=${localeCode}` : ''}`,\n }),\n ),\n )\n }\n\n if (typeof onDuplicate === 'function') {\n void onDuplicate({ collectionConfig, doc })\n }\n } else {\n toast.error(\n errors?.[0].message ||\n message ||\n t('error:unspecific', { label: getTranslation(singularLabel, i18n) }),\n )\n }\n } catch (_error) {\n toast.error(t('error:unspecific', { label: getTranslation(singularLabel, i18n) }))\n }\n },\n [\n adminRoute,\n apiRoute,\n collectionConfig,\n i18n,\n id,\n localeCode,\n onDuplicate,\n redirectAfterDuplicate,\n router,\n serverURL,\n setModified,\n singularLabel,\n slug,\n startRouteTransition,\n t,\n ],\n )\n\n const handleConfirmWithoutSaving = useCallback(async () => {\n if (selectLocales) {\n openModal(drawerSlug)\n } else {\n await handleDuplicate()\n }\n }, [handleDuplicate, drawerSlug, selectLocales, openModal])\n\n const buttonLabel = selectLocales\n ? `${t('general:duplicate')} ${t('localization:selectedLocales')}`\n : t('general:duplicate')\n\n if (!selectLocales || isDuplicateByLocaleEnabled) {\n return (\n <React.Fragment>\n <PopupList.Button\n id={`action-duplicate${isDuplicateByLocaleEnabled ? `-locales` : ''}`}\n onClick={() => {\n if (modified) {\n openModal(modalSlug)\n } else if (selectLocales) {\n openModal(drawerSlug)\n } else {\n void handleDuplicate()\n }\n }}\n >\n {buttonLabel}\n </PopupList.Button>\n <ConfirmationModal\n body={t('general:unsavedChangesDuplicate')}\n confirmLabel={t('general:duplicateWithoutSaving')}\n heading={t('general:unsavedChanges')}\n modalSlug={modalSlug}\n onConfirm={handleConfirmWithoutSaving}\n />\n {selectLocales && localization && (\n <SelectLocalesDrawer\n localization={localization}\n onConfirm={handleDuplicate}\n slug={drawerSlug}\n />\n )}\n </React.Fragment>\n )\n }\n\n return null\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,YAAYC,EAAA,MAAQ;AACpB,OAAOC,KAAA,IAASC,WAAW,EAAEC,OAAO,QAAQ;AAC5C,SAASC,KAAK,QAAQ;AAItB,SAASC,OAAO,EAAEC,eAAe,QAAQ;AACzC,SAASC,SAAS,QAAQ;AAC1B,SAASC,SAAS,QAAQ;AAC1B,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SAASC,QAAQ,QAAQ;AACzB,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,iBAAiB,QAAQ;AAClC,SAASC,SAAS,QAAQ;AAC1B,SAASC,mBAAmB,QAAQ;AAWpC,OAAO,MAAMC,iBAAA,GAAqCA,CAAC;EACjDC,EAAE;EACFC,IAAI;EACJC,WAAW;EACXC,sBAAA,GAAyB,IAAI;EAC7BC,aAAa;EACbC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aAAA,IAAiBU,YAAA,iBAChB+C,IAAA,CAAC/D,mBAAA;QACCgB,YAAA,EAAcA,YAAA;QACdoD,SAAA,EAAWpC,eAAA;QACX7B,IAAA,EAAM0B;;;EAKhB;EAEA,OAAO;AACT","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/SortHeader/index.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/SortHeader/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,cAAc,CAAA;AAGrB,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAqBD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA0BhD,CAAA"}
|
|
@@ -2,84 +2,59 @@
|
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
import React
|
|
6
|
-
import { SortDownIcon
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { SortDownIcon } from '../../icons/Sort/index.js';
|
|
7
7
|
import { useListQuery } from '../../providers/ListQuery/index.js';
|
|
8
8
|
import './index.scss';
|
|
9
9
|
import { useTranslation } from '../../providers/Translation/index.js';
|
|
10
10
|
const baseClass = 'sort-header';
|
|
11
11
|
function useSort() {
|
|
12
|
-
const $ = _c(
|
|
12
|
+
const $ = _c(7);
|
|
13
13
|
const {
|
|
14
14
|
handleSortChange,
|
|
15
15
|
orderableFieldName,
|
|
16
16
|
query
|
|
17
17
|
} = useListQuery();
|
|
18
18
|
const querySort = Array.isArray(query.sort) ? query.sort[0] : query.sort;
|
|
19
|
-
const
|
|
20
|
-
const isActive = querySort === `-${orderableFieldName}` || querySort === orderableFieldName;
|
|
19
|
+
const isActive = querySort === orderableFieldName;
|
|
21
20
|
let t0;
|
|
22
|
-
|
|
23
|
-
if ($[0] !== isActive || $[1] !== orderableFieldName || $[2] !== querySort) {
|
|
21
|
+
if ($[0] !== handleSortChange || $[1] !== isActive || $[2] !== orderableFieldName) {
|
|
24
22
|
t0 = () => {
|
|
25
|
-
if (
|
|
23
|
+
if (isActive) {
|
|
26
24
|
return;
|
|
27
25
|
}
|
|
28
|
-
|
|
26
|
+
handleSortChange(orderableFieldName);
|
|
29
27
|
};
|
|
30
|
-
|
|
31
|
-
$[
|
|
32
|
-
$[
|
|
33
|
-
$[2] = querySort;
|
|
28
|
+
$[0] = handleSortChange;
|
|
29
|
+
$[1] = isActive;
|
|
30
|
+
$[2] = orderableFieldName;
|
|
34
31
|
$[3] = t0;
|
|
35
|
-
$[4] = t1;
|
|
36
32
|
} else {
|
|
37
33
|
t0 = $[3];
|
|
38
|
-
t1 = $[4];
|
|
39
|
-
}
|
|
40
|
-
useEffect(t0, t1);
|
|
41
|
-
let t2;
|
|
42
|
-
if ($[5] !== handleSortChange || $[6] !== isActive || $[7] !== orderableFieldName) {
|
|
43
|
-
t2 = () => {
|
|
44
|
-
if (isActive) {
|
|
45
|
-
handleSortChange(sort.current === "asc" ? `-${orderableFieldName}` : orderableFieldName);
|
|
46
|
-
sort.current = sort.current === "asc" ? "desc" : "asc";
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
handleSortChange(sort.current === "asc" ? orderableFieldName : `-${orderableFieldName}`);
|
|
50
|
-
};
|
|
51
|
-
$[5] = handleSortChange;
|
|
52
|
-
$[6] = isActive;
|
|
53
|
-
$[7] = orderableFieldName;
|
|
54
|
-
$[8] = t2;
|
|
55
|
-
} else {
|
|
56
|
-
t2 = $[8];
|
|
57
34
|
}
|
|
58
|
-
const handleSortPress =
|
|
59
|
-
let
|
|
60
|
-
if ($[
|
|
61
|
-
|
|
35
|
+
const handleSortPress = t0;
|
|
36
|
+
let t1;
|
|
37
|
+
if ($[4] !== handleSortPress || $[5] !== isActive) {
|
|
38
|
+
t1 = {
|
|
62
39
|
handleSortPress,
|
|
63
|
-
isActive
|
|
64
|
-
sort
|
|
40
|
+
isActive
|
|
65
41
|
};
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
42
|
+
$[4] = handleSortPress;
|
|
43
|
+
$[5] = isActive;
|
|
44
|
+
$[6] = t1;
|
|
69
45
|
} else {
|
|
70
|
-
|
|
46
|
+
t1 = $[6];
|
|
71
47
|
}
|
|
72
|
-
return
|
|
48
|
+
return t1;
|
|
73
49
|
}
|
|
74
50
|
export const SortHeader = props => {
|
|
75
|
-
const $ = _c(
|
|
51
|
+
const $ = _c(7);
|
|
76
52
|
const {
|
|
77
53
|
appearance
|
|
78
54
|
} = props;
|
|
79
55
|
const {
|
|
80
56
|
handleSortPress,
|
|
81
|
-
isActive
|
|
82
|
-
sort
|
|
57
|
+
isActive
|
|
83
58
|
} = useSort();
|
|
84
59
|
const {
|
|
85
60
|
t
|
|
@@ -95,40 +70,30 @@ export const SortHeader = props => {
|
|
|
95
70
|
}
|
|
96
71
|
const t2 = t1.join(" ");
|
|
97
72
|
let t3;
|
|
98
|
-
if ($[2] !== handleSortPress || $[3] !== isActive || $[4] !==
|
|
73
|
+
if ($[2] !== handleSortPress || $[3] !== isActive || $[4] !== t || $[5] !== t2) {
|
|
99
74
|
t3 = _jsx("div", {
|
|
100
75
|
className: t2,
|
|
101
76
|
children: _jsx("div", {
|
|
102
77
|
className: `${baseClass}__buttons`,
|
|
103
|
-
children:
|
|
78
|
+
children: _jsx("button", {
|
|
104
79
|
"aria-label": t("general:sortByLabelDirection", {
|
|
105
80
|
direction: t("general:ascending"),
|
|
106
81
|
label: "Order"
|
|
107
82
|
}),
|
|
108
|
-
className: `${baseClass}__button ${
|
|
83
|
+
className: `${baseClass}__button ${isActive ? `${baseClass}--active` : ""}`,
|
|
109
84
|
onClick: handleSortPress,
|
|
110
85
|
type: "button",
|
|
111
86
|
children: _jsx(SortDownIcon, {})
|
|
112
|
-
}) : _jsx("button", {
|
|
113
|
-
"aria-label": t("general:sortByLabelDirection", {
|
|
114
|
-
direction: t("general:descending"),
|
|
115
|
-
label: "Order"
|
|
116
|
-
}),
|
|
117
|
-
className: `${baseClass}__button ${baseClass}__${sort.current} ${isActive ? `${baseClass}--active` : ""}`,
|
|
118
|
-
onClick: handleSortPress,
|
|
119
|
-
type: "button",
|
|
120
|
-
children: _jsx(SortUpIcon, {})
|
|
121
87
|
})
|
|
122
88
|
})
|
|
123
89
|
});
|
|
124
90
|
$[2] = handleSortPress;
|
|
125
91
|
$[3] = isActive;
|
|
126
|
-
$[4] =
|
|
127
|
-
$[5] =
|
|
128
|
-
$[6] =
|
|
129
|
-
$[7] = t3;
|
|
92
|
+
$[4] = t;
|
|
93
|
+
$[5] = t2;
|
|
94
|
+
$[6] = t3;
|
|
130
95
|
} else {
|
|
131
|
-
t3 = $[
|
|
96
|
+
t3 = $[6];
|
|
132
97
|
}
|
|
133
98
|
return t3;
|
|
134
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","React","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","React","SortDownIcon","useListQuery","useTranslation","baseClass","useSort","$","handleSortChange","orderableFieldName","query","querySort","Array","isArray","sort","isActive","t0","handleSortPress","t1","SortHeader","props","appearance","t","filter","Boolean","t2","join","t3","_jsx","className","children","direction","label","onClick","type"],"sources":["../../../src/elements/SortHeader/index.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\n\nimport { SortDownIcon } from '../../icons/Sort/index.js'\nimport { useListQuery } from '../../providers/ListQuery/index.js'\nimport './index.scss'\nimport { useTranslation } from '../../providers/Translation/index.js'\n\nexport type SortHeaderProps = {\n readonly appearance?: 'condensed' | 'default'\n readonly disable?: boolean\n}\n\nconst baseClass = 'sort-header'\n\nfunction useSort() {\n const { handleSortChange, orderableFieldName, query } = useListQuery()\n const querySort = Array.isArray(query.sort) ? query.sort[0] : query.sort\n const isActive = querySort === orderableFieldName\n\n const handleSortPress = () => {\n // If it's already sorted by the \"_order\" field, do nothing\n if (isActive) {\n return\n }\n // If NOT sorted by the \"_order\" field, sort by that field.\n void handleSortChange(orderableFieldName)\n }\n\n return { handleSortPress, isActive }\n}\n\nexport const SortHeader: React.FC<SortHeaderProps> = (props) => {\n const { appearance } = props\n const { handleSortPress, isActive } = useSort()\n const { t } = useTranslation()\n\n return (\n <div\n className={[baseClass, appearance && `${baseClass}--appearance-${appearance}`]\n .filter(Boolean)\n .join(' ')}\n >\n <div className={`${baseClass}__buttons`}>\n <button\n aria-label={t('general:sortByLabelDirection', {\n direction: t('general:ascending'),\n label: 'Order',\n })}\n className={`${baseClass}__button ${isActive ? `${baseClass}--active` : ''}`}\n onClick={handleSortPress}\n type=\"button\"\n >\n <SortDownIcon />\n </button>\n </div>\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAEA,OAAOC,KAAA,MAAW;AAElB,SAASC,YAAY,QAAQ;AAC7B,SAASC,YAAY,QAAQ;AAC7B,OAAO;AACP,SAASC,cAAc,QAAQ;AAO/B,MAAMC,SAAA,GAAY;AAElB,SAAAC,QAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EACE;IAAAQ,gBAAA;IAAAC,kBAAA;IAAAC;EAAA,IAAwDP,YAAA;EACxD,MAAAQ,SAAA,GAAkBC,KAAA,CAAAC,OAAA,CAAcH,KAAA,CAAAI,IAAU,IAAIJ,KAAA,CAAAI,IAAA,MAAgBJ,KAAA,CAAAI,IAAU;EACxE,MAAAC,QAAA,GAAiBJ,SAAA,KAAcF,kBAAA;EAAA,IAAAO,EAAA;EAAA,IAAAT,CAAA,QAAAC,gBAAA,IAAAD,CAAA,QAAAQ,QAAA,IAAAR,C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AAA,GAAAC,IAAA,CAAC;MAAAC,SAAA,EACYJ,EAEH;MAAAK,QAAA,EAERF,IAAA,CAAC;QAAAC,SAAA,EAAe,GAAAxB,SAAA,WAAuB;QAAAyB,QAAA,EACrCF,IAAA,CAAC;UAAA,cACaN,CAAA,CAAE;YAAAS,SAAA,EACDT,CAAA,CAAE;YAAAU,KAAA,EACN;UAAA,CACT;UAAAH,SAAA,EACW,GAAAxB,SAAA,YAAwBU,QAAA,GAAW,GAAAV,SAAA,UAAsB,GAAG,IAAI;UAAA4B,OAAA,EAClEhB,eAAA;UAAAiB,IAAA,EACJ;UAAAJ,QAAA,EAELF,IAAA,CAAA1B,YAAA,IAAC;QAAA,C;;;;;;;;;;;SAfPyB,E;CAoBJ","ignoreList":[]}
|
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
|
8
8
|
* rendering the original component.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
|
-
* const PredefinedComponent =
|
|
11
|
+
* const PredefinedComponent = withMergedProps({
|
|
12
12
|
* Component: OriginalComponent,
|
|
13
13
|
* toMergeIntoProps: { someExtraValue: 5 }
|
|
14
14
|
* });
|
|
@@ -10,7 +10,7 @@ import React from 'react';
|
|
|
10
10
|
* rendering the original component.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
|
-
* const PredefinedComponent =
|
|
13
|
+
* const PredefinedComponent = withMergedProps({
|
|
14
14
|
* Component: OriginalComponent,
|
|
15
15
|
* toMergeIntoProps: { someExtraValue: 5 }
|
|
16
16
|
* });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["isReactServerComponentOrFunction","serverProps","React","withMergedProps","Component","sanitizeServerOnlyProps","toMergeIntoProps","undefined","MergedPropsComponent","passedProps","mergedProps","simpleMergeProps","forEach","prop","_jsx","props","toMerge"],"sources":["../../../src/elements/withMergedProps/index.tsx"],"sourcesContent":["import { isReactServerComponentOrFunction, serverProps } from 'payload/shared'\nimport React from 'react'\n\n/**\n * Creates a higher-order component (HOC) that merges predefined properties (`toMergeIntoProps`)\n * with any properties passed to the resulting component.\n *\n * Use this when you want to pre-specify some props for a component, while also allowing users to\n * pass in their own props. The HOC ensures the passed props and predefined props are combined before\n * rendering the original component.\n *\n * @example\n * const PredefinedComponent =
|
|
1
|
+
{"version":3,"file":"index.js","names":["isReactServerComponentOrFunction","serverProps","React","withMergedProps","Component","sanitizeServerOnlyProps","toMergeIntoProps","undefined","MergedPropsComponent","passedProps","mergedProps","simpleMergeProps","forEach","prop","_jsx","props","toMerge"],"sources":["../../../src/elements/withMergedProps/index.tsx"],"sourcesContent":["import { isReactServerComponentOrFunction, serverProps } from 'payload/shared'\nimport React from 'react'\n\n/**\n * Creates a higher-order component (HOC) that merges predefined properties (`toMergeIntoProps`)\n * with any properties passed to the resulting component.\n *\n * Use this when you want to pre-specify some props for a component, while also allowing users to\n * pass in their own props. The HOC ensures the passed props and predefined props are combined before\n * rendering the original component.\n *\n * @example\n * const PredefinedComponent = withMergedProps({\n * Component: OriginalComponent,\n * toMergeIntoProps: { someExtraValue: 5 }\n * });\n * // Using <PredefinedComponent customProp=\"value\" /> will result in\n * // <OriginalComponent customProp=\"value\" someExtraValue={5} />\n *\n * @returns A higher-order component with combined properties.\n *\n * @param Component - The original component to wrap.\n * @param sanitizeServerOnlyProps - If true, server-only props will be removed from the merged props. @default true if the component is not a server component, false otherwise.\n * @param toMergeIntoProps - The properties to merge into the passed props.\n */\nexport function withMergedProps<ToMergeIntoProps, CompleteReturnProps>({\n Component,\n sanitizeServerOnlyProps,\n toMergeIntoProps,\n}: {\n Component: React.FC<CompleteReturnProps>\n sanitizeServerOnlyProps?: boolean\n toMergeIntoProps: ToMergeIntoProps\n}): React.FC<CompleteReturnProps> {\n if (sanitizeServerOnlyProps === undefined) {\n sanitizeServerOnlyProps = !isReactServerComponentOrFunction(Component)\n }\n // A wrapper around the args.Component to inject the args.toMergeArgs as props, which are merged with the passed props\n const MergedPropsComponent: React.FC<CompleteReturnProps> = (passedProps) => {\n const mergedProps = simpleMergeProps(passedProps, toMergeIntoProps) as CompleteReturnProps\n\n if (sanitizeServerOnlyProps) {\n serverProps.forEach((prop) => {\n delete mergedProps[prop]\n })\n }\n\n return <Component {...mergedProps} />\n }\n\n return MergedPropsComponent\n}\n\nfunction simpleMergeProps(props, toMerge) {\n return { ...props, ...toMerge }\n}\n"],"mappings":";AAAA,SAASA,gCAAgC,EAAEC,WAAW,QAAQ;AAC9D,OAAOC,KAAA,MAAW;AAElB;;;;;;;;;;;;;;;;;;;;;;AAsBA,OAAO,SAASC,gBAAuD;EACrEC,SAAS;EACTC,uBAAuB;EACvBC;AAAgB,CAKjB;EACC,IAAID,uBAAA,KAA4BE,SAAA,EAAW;IACzCF,uBAAA,GAA0B,CAACL,gCAAA,CAAiCI,SAAA;EAC9D;EACA;EACA,MAAMI,oBAAA,GAAuDC,WAAA;IAC3D,MAAMC,WAAA,GAAcC,gBAAA,CAAiBF,WAAA,EAAaH,gBAAA;IAElD,IAAID,uBAAA,EAAyB;MAC3BJ,WAAA,CAAYW,OAAO,CAAEC,IAAA;QACnB,OAAOH,WAAW,CAACG,IAAA,CAAK;MAC1B;IACF;IAEA,oBAAOC,IAAA,CAACV,SAAA;MAAW,GAAGM;;EACxB;EAEA,OAAOF,oBAAA;AACT;AAEA,SAASG,iBAAiBI,KAAK,EAAEC,OAAO;EACtC,OAAO;IAAE,GAAGD,KAAK;IAAE,GAAGC;EAAQ;AAChC","ignoreList":[]}
|