@payloadcms/ui 3.65.0-internal.098b771 → 3.65.0-internal.d8c3085
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/ReactSelect/MultiValueLabel/index.d.ts.map +1 -1
- package/dist/elements/ReactSelect/MultiValueLabel/index.js +18 -9
- package/dist/elements/ReactSelect/MultiValueLabel/index.js.map +1 -1
- package/dist/elements/ReactSelect/ValueContainer/index.d.ts.map +1 -1
- package/dist/elements/ReactSelect/ValueContainer/index.js +19 -7
- package/dist/elements/ReactSelect/ValueContainer/index.js.map +1 -1
- package/dist/exports/client/index.js +12 -12
- package/dist/exports/client/index.js.map +3 -3
- package/dist/fields/Relationship/select-components/MultiValueLabel/index.js +1 -0
- package/dist/fields/Relationship/select-components/MultiValueLabel/index.js.map +1 -1
- package/dist/fields/Relationship/select-components/SingleValue/index.js +11 -8
- package/dist/fields/Relationship/select-components/SingleValue/index.js.map +1 -1
- package/dist/utilities/handleLivePreview.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/ReactSelect/MultiValueLabel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/ReactSelect/MultiValueLabel/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAGnD,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAqB7D,CAAA"}
|
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { getTranslation } from '@payloadcms/translations';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import { components as SelectComponents } from 'react-select';
|
|
7
|
+
import { useTranslation } from '../../../providers/Translation/index.js';
|
|
6
8
|
import './index.scss';
|
|
7
9
|
const baseClass = 'multi-value-label';
|
|
8
10
|
export const MultiValueLabel = props => {
|
|
9
|
-
// @ts-expect-error-next-line// TODO Fix this - moduleResolution 16 breaks our declare module
|
|
10
11
|
const {
|
|
11
12
|
data,
|
|
12
|
-
selectProps:
|
|
13
|
-
customProps: {
|
|
14
|
-
draggableProps,
|
|
15
|
-
editableProps
|
|
16
|
-
} = {}
|
|
17
|
-
} = {}
|
|
13
|
+
selectProps: t0
|
|
18
14
|
} = props;
|
|
15
|
+
const {
|
|
16
|
+
customProps: t1
|
|
17
|
+
} = t0 === undefined ? {} : t0;
|
|
18
|
+
const {
|
|
19
|
+
draggableProps,
|
|
20
|
+
editableProps
|
|
21
|
+
} = t1 === undefined ? {} : t1;
|
|
22
|
+
const {
|
|
23
|
+
i18n
|
|
24
|
+
} = useTranslation();
|
|
19
25
|
const className = `${baseClass}__text`;
|
|
20
|
-
|
|
26
|
+
const labelText = data.label ? getTranslation(data.label, i18n) : "";
|
|
27
|
+
const titleText = typeof labelText === "string" ? labelText : "";
|
|
28
|
+
return _jsx("div", {
|
|
21
29
|
className: baseClass,
|
|
22
|
-
|
|
30
|
+
title: titleText,
|
|
31
|
+
children: _jsx(SelectComponents.MultiValueLabel, {
|
|
23
32
|
...props,
|
|
24
33
|
innerProps: {
|
|
25
34
|
className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","components","SelectComponents","baseClass","MultiValueLabel","props","data","selectProps","customProps","draggableProps","editableProps","className","_jsx","innerProps"],"sources":["../../../../src/elements/ReactSelect/MultiValueLabel/index.tsx"],"sourcesContent":["'use client'\nimport type { MultiValueProps } from 'react-select'\n\nimport React from 'react'\nimport { components as SelectComponents } from 'react-select'\n\nimport type { Option } from '../types.js'\n\nimport './index.scss'\n\nconst baseClass = 'multi-value-label'\n\nexport const MultiValueLabel: React.FC<MultiValueProps<Option>> = (props) => {\n // @ts-expect-error-next-line// TODO Fix this - moduleResolution 16 breaks our declare module\n const { data, selectProps: { customProps: { draggableProps, editableProps } = {} } = {} } = props\n\n const className = `${baseClass}__text`\n\n return (\n <div className={baseClass}>\n <SelectComponents.MultiValueLabel\n {...props}\n innerProps={{\n className,\n ...((editableProps && editableProps(data, className, props.selectProps)) || {}),\n ...(draggableProps || {}),\n }}\n />\n </div>\n )\n}\n"],"mappings":"AAAA;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["getTranslation","React","components","SelectComponents","useTranslation","baseClass","MultiValueLabel","props","data","selectProps","t0","customProps","t1","undefined","draggableProps","editableProps","i18n","className","labelText","label","titleText","_jsx","title","children","innerProps"],"sources":["../../../../src/elements/ReactSelect/MultiValueLabel/index.tsx"],"sourcesContent":["'use client'\nimport type { OptionLabel } from 'payload'\nimport type { MultiValueProps } from 'react-select'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\nimport { components as SelectComponents } from 'react-select'\n\nimport type { Option } from '../types.js'\n\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport './index.scss'\n\nconst baseClass = 'multi-value-label'\n\nexport const MultiValueLabel: React.FC<MultiValueProps<Option>> = (props) => {\n // @ts-expect-error-next-line// TODO Fix this - moduleResolution 16 breaks our declare module\n const { data, selectProps: { customProps: { draggableProps, editableProps } = {} } = {} } = props\n const { i18n } = useTranslation()\n\n const className = `${baseClass}__text`\n const labelText = data.label ? getTranslation(data.label as OptionLabel, i18n) : ''\n const titleText = typeof labelText === 'string' ? labelText : ''\n\n return (\n <div className={baseClass} title={titleText}>\n <SelectComponents.MultiValueLabel\n {...props}\n innerProps={{\n className,\n ...((editableProps && editableProps(data, className, props.selectProps)) || {}),\n ...(draggableProps || {}),\n }}\n />\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAClB,SAASC,UAAA,IAAcC,gBAAgB,QAAQ;AAI/C,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,eAAA,GAAqDC,KAAA;EAEhE;IAAAC,IAAA;IAAAC,WAAA,EAAAC;EAAA,IAA4FH,KAAA;EAAjE;IAAAI,WAAA,EAAAC;EAAA,IAAAF,EAA4D,KAAAG,SAAA,QAA5DH,EAA4D;EAA7C;IAAAI,cAAA;IAAAC;EAAA,IAAAH,EAAsC,KAAAC,SAAA,QAAtCD,EAAsC;EAChF;IAAAI;EAAA,IAAiBZ,cAAA;EAEjB,MAAAa,SAAA,GAAkB,GAAAZ,SAAA,QAAoB;EACtC,MAAAa,SAAA,GAAkBV,IAAA,CAAAW,KAAA,GAAanB,cAAA,CAAeQ,IAAA,CAAAW,KAAA,EAA2BH,IAAA,IAAQ;EACjF,MAAAI,SAAA,GAAkB,OAAOF,SAAA,KAAc,WAAWA,SAAA,GAAY;EAAA,OAG5DG,IAAA,CAAC;IAAAJ,SAAA,EAAAZ,SAAA;IAAAiB,KAAA,EAAiCF,SAAA;IAAAG,QAAA,EAChCF,IAAA,CAAAlB,gBAAA,CAAAG,eAAA;MAAA,GACMC,KAAK;MAAAiB,UAAA;QAAAP,SAAA;QAAA,IAGHF,aAAC,IAAiBA,aAAA,CAAcP,IAAA,EAAMS,SAAA,EAAWV,KAAA,CAAAE,WAAiB,OAAQ;QAAA,IAC1EK,cAAA,MAAoB;MAAA;IAAA,C;;CAKlC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/ReactSelect/ValueContainer/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/ReactSelect/ValueContainer/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAGvD,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,CAoBrE,CAAA"}
|
|
@@ -1,24 +1,36 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { getTranslation } from '@payloadcms/translations';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import { components as SelectComponents } from 'react-select';
|
|
7
|
+
import { useTranslation } from '../../../providers/Translation/index.js';
|
|
6
8
|
import './index.scss';
|
|
7
9
|
const baseClass = 'value-container';
|
|
8
10
|
export const ValueContainer = props => {
|
|
9
|
-
// @ts-expect-error-next-line // TODO Fix this - moduleResolution 16 breaks our declare module
|
|
10
11
|
const {
|
|
11
|
-
selectProps:
|
|
12
|
-
customProps
|
|
13
|
-
} = {}
|
|
12
|
+
selectProps: t0
|
|
14
13
|
} = props;
|
|
15
|
-
|
|
14
|
+
const {
|
|
15
|
+
customProps,
|
|
16
|
+
value
|
|
17
|
+
} = t0 === undefined ? {} : t0;
|
|
18
|
+
const {
|
|
19
|
+
i18n
|
|
20
|
+
} = useTranslation();
|
|
21
|
+
let titleText = "";
|
|
22
|
+
if (value && !Array.isArray(value) && typeof value === "object" && "label" in value) {
|
|
23
|
+
const labelText = value.label ? getTranslation(value.label, i18n) : "";
|
|
24
|
+
titleText = typeof labelText === "string" ? labelText : "";
|
|
25
|
+
}
|
|
26
|
+
return _jsxs("div", {
|
|
16
27
|
className: baseClass,
|
|
17
28
|
ref: customProps?.droppableRef,
|
|
18
|
-
|
|
29
|
+
title: titleText,
|
|
30
|
+
children: [customProps?.valueContainerLabel && _jsx("span", {
|
|
19
31
|
className: `${baseClass}__label`,
|
|
20
32
|
children: customProps?.valueContainerLabel
|
|
21
|
-
}),
|
|
33
|
+
}), _jsx(SelectComponents.ValueContainer, {
|
|
22
34
|
...props
|
|
23
35
|
})]
|
|
24
36
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","components","SelectComponents","baseClass","ValueContainer","props","selectProps","customProps","_jsxs","className","ref","droppableRef","valueContainerLabel","_jsx"],"sources":["../../../../src/elements/ReactSelect/ValueContainer/index.tsx"],"sourcesContent":["'use client'\nimport type { ValueContainerProps } from 'react-select'\n\nimport React from 'react'\nimport { components as SelectComponents } from 'react-select'\n\nimport type { Option } from '../types.js'\n\nimport './index.scss'\n\nconst baseClass = 'value-container'\n\nexport const ValueContainer: React.FC<ValueContainerProps<Option, any>> = (props) => {\n // @ts-expect-error-next-line // TODO Fix this - moduleResolution 16 breaks our declare module\n const { selectProps: { customProps } = {} } = props\n\n return (\n <div className={baseClass} ref={customProps?.droppableRef}>\n {customProps?.valueContainerLabel && (\n <span className={`${baseClass}__label`}>{customProps?.valueContainerLabel}</span>\n )}\n <SelectComponents.ValueContainer {...props} />\n </div>\n )\n}\n"],"mappings":"AAAA;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["getTranslation","React","components","SelectComponents","useTranslation","baseClass","ValueContainer","props","selectProps","t0","customProps","value","undefined","i18n","titleText","Array","isArray","labelText","label","_jsxs","className","ref","droppableRef","title","children","valueContainerLabel","_jsx"],"sources":["../../../../src/elements/ReactSelect/ValueContainer/index.tsx"],"sourcesContent":["'use client'\nimport type { OptionLabel } from 'payload'\nimport type { ValueContainerProps } from 'react-select'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\nimport { components as SelectComponents } from 'react-select'\n\nimport type { Option } from '../types.js'\n\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport './index.scss'\n\nconst baseClass = 'value-container'\n\nexport const ValueContainer: React.FC<ValueContainerProps<Option, any>> = (props) => {\n // @ts-expect-error-next-line // TODO Fix this - moduleResolution 16 breaks our declare module\n const { selectProps: { customProps, value } = {} } = props\n const { i18n } = useTranslation()\n\n // Get the title for single-value selects\n let titleText = ''\n if (value && !Array.isArray(value) && typeof value === 'object' && 'label' in value) {\n const labelText = value.label ? getTranslation(value.label as OptionLabel, i18n) : ''\n titleText = typeof labelText === 'string' ? labelText : ''\n }\n\n return (\n <div className={baseClass} ref={customProps?.droppableRef} title={titleText}>\n {customProps?.valueContainerLabel && (\n <span className={`${baseClass}__label`}>{customProps?.valueContainerLabel}</span>\n )}\n <SelectComponents.ValueContainer {...props} />\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAClB,SAASC,UAAA,IAAcC,gBAAgB,QAAQ;AAI/C,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,cAAA,GAA6DC,KAAA;EAExE;IAAAC,WAAA,EAAAC;EAAA,IAAqDF,KAAA;EAAhC;IAAAG,WAAA;IAAAC;EAAA,IAAAF,EAA2B,KAAAG,SAAA,QAA3BH,EAA2B;EAChD;IAAAI;EAAA,IAAiBT,cAAA;EAGjB,IAAAU,SAAA,GAAgB;EAAA,IACZH,KAAA,KAAUI,KAAA,CAAAC,OAAA,CAAcL,KAAA,KAAU,OAAOA,KAAA,KAAU,YAAY,WAAWA,KAAA;IAC5E,MAAAM,SAAA,GAAkBN,KAAA,CAAAO,KAAA,GAAclB,cAAA,CAAeW,KAAA,CAAAO,KAAA,EAA4BL,IAAA,IAAQ;IACnFC,SAAA,CAAAA,CAAA,CAAYA,MAAA,CAAOG,SAAA,KAAc,WAAWA,SAAA,GAAY;EAAxD;EAAA,OAIAE,KAAA,CAAC;IAAAC,SAAA,EAAAf,SAAA;IAAAgB,GAAA,EAA+BX,WAAA,EAAAY,YAAA;IAAAC,KAAA,EAAkCT,SAAA;IAAAU,QAAA,GAC/Dd,WAAA,EAAAe,mBAAA,IACCC,IAAA,CAAC;MAAAN,SAAA,EAAgB,GAAAf,SAAA,SAAqB;MAAAmB,QAAA,EAAGd,WAAA,EAAAe;IAAA,C,GAE3CC,IAAA,CAAAvB,gBAAA,CAAAG,cAAA;MAAA,GAAqCC;IAAK,C;;CAGhD","ignoreList":[]}
|