@payloadcms/ui 3.79.0 → 3.80.0-internal.cee0ccf
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/TimezonePicker/index.js +1 -1
- package/dist/elements/TimezonePicker/index.js.map +1 -1
- package/dist/exports/client/index.js +1 -1
- package/dist/exports/client/index.js.map +2 -2
- package/dist/fields/Join/index.js +1 -1
- package/dist/fields/Join/index.js.map +1 -1
- package/dist/utilities/buildTableState.js +2 -1
- package/dist/utilities/buildTableState.js.map +1 -1
- package/package.json +5 -5
|
@@ -23,7 +23,7 @@ export const TimezonePicker = props => {
|
|
|
23
23
|
const selectedTimezone = useMemo(() => {
|
|
24
24
|
return options.find(t_0 => {
|
|
25
25
|
const value = typeof t_0 === 'string' ? t_0 : t_0.value;
|
|
26
|
-
return value ===
|
|
26
|
+
return value === selectedTimezoneFromProps;
|
|
27
27
|
});
|
|
28
28
|
}, [options, selectedTimezoneFromProps]);
|
|
29
29
|
const readOnly = Boolean(readOnlyFromProps) || options.length === 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useMemo","FieldLabel","useTranslation","ReactSelect","formatOptions","TimezonePicker","props","id","onChange","onChangeFromProps","options","optionsFromProps","readOnly","readOnlyFromProps","required","selectedTimezone","selectedTimezoneFromProps","t","find","value","Boolean","length","_jsxs","className","_jsx","htmlFor","label","unstyled","disabled","inputId","isClearable","isCreatable","val"],"sources":["../../../src/elements/TimezonePicker/index.tsx"],"sourcesContent":["'use client'\n\nimport type { OptionObject } from 'payload'\nimport type React from 'react'\n\nimport { useMemo } from 'react'\n\nimport type { Props } from './types.js'\n\nimport { FieldLabel } from '../../fields/FieldLabel/index.js'\nimport './index.scss'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { ReactSelect } from '../ReactSelect/index.js'\nimport { formatOptions } from '../WhereBuilder/Condition/Select/formatOptions.js'\n\nexport const TimezonePicker: React.FC<Props> = (props) => {\n const {\n id,\n onChange: onChangeFromProps,\n options: optionsFromProps,\n readOnly: readOnlyFromProps,\n required,\n selectedTimezone: selectedTimezoneFromProps,\n } = props\n\n const { t } = useTranslation()\n\n const options = formatOptions(optionsFromProps)\n\n const selectedTimezone = useMemo(() => {\n return options.find((t) => {\n const value = typeof t === 'string' ? t : t.value\n return value ===
|
|
1
|
+
{"version":3,"file":"index.js","names":["useMemo","FieldLabel","useTranslation","ReactSelect","formatOptions","TimezonePicker","props","id","onChange","onChangeFromProps","options","optionsFromProps","readOnly","readOnlyFromProps","required","selectedTimezone","selectedTimezoneFromProps","t","find","value","Boolean","length","_jsxs","className","_jsx","htmlFor","label","unstyled","disabled","inputId","isClearable","isCreatable","val"],"sources":["../../../src/elements/TimezonePicker/index.tsx"],"sourcesContent":["'use client'\n\nimport type { OptionObject } from 'payload'\nimport type React from 'react'\n\nimport { useMemo } from 'react'\n\nimport type { Props } from './types.js'\n\nimport { FieldLabel } from '../../fields/FieldLabel/index.js'\nimport './index.scss'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { ReactSelect } from '../ReactSelect/index.js'\nimport { formatOptions } from '../WhereBuilder/Condition/Select/formatOptions.js'\n\nexport const TimezonePicker: React.FC<Props> = (props) => {\n const {\n id,\n onChange: onChangeFromProps,\n options: optionsFromProps,\n readOnly: readOnlyFromProps,\n required,\n selectedTimezone: selectedTimezoneFromProps,\n } = props\n\n const { t } = useTranslation()\n\n const options = formatOptions(optionsFromProps)\n\n const selectedTimezone = useMemo(() => {\n return options.find((t) => {\n const value = typeof t === 'string' ? t : t.value\n return value === selectedTimezoneFromProps\n })\n }, [options, selectedTimezoneFromProps])\n\n const readOnly = Boolean(readOnlyFromProps) || options.length === 1\n\n return (\n <div className=\"timezone-picker-wrapper\">\n <FieldLabel\n htmlFor={id}\n label={`${t('general:timezone')} ${required ? '*' : ''}`}\n required={required}\n unstyled\n />\n <ReactSelect\n className=\"timezone-picker\"\n disabled={readOnly}\n inputId={id}\n isClearable={!required}\n isCreatable={false}\n onChange={(val: OptionObject) => {\n if (onChangeFromProps) {\n onChangeFromProps(val?.value || '')\n }\n }}\n options={options}\n value={selectedTimezone}\n />\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAKA,SAASA,OAAO,QAAQ;AAIxB,SAASC,UAAU,QAAQ;AAC3B,OAAO;AACP,SAASC,cAAc,QAAQ;AAC/B,SAASC,WAAW,QAAQ;AAC5B,SAASC,aAAa,QAAQ;AAE9B,OAAO,MAAMC,cAAA,GAAmCC,KAAA;EAC9C,MAAM;IACJC,EAAE;IACFC,QAAA,EAAUC,iBAAiB;IAC3BC,OAAA,EAASC,gBAAgB;IACzBC,QAAA,EAAUC,iBAAiB;IAC3BC,QAAQ;IACRC,gBAAA,EAAkBC;EAAyB,CAC5C,GAAGV,KAAA;EAEJ,MAAM;IAAEW;EAAC,CAAE,GAAGf,cAAA;EAEd,MAAMQ,OAAA,GAAUN,aAAA,CAAcO,gBAAA;EAE9B,MAAMI,gBAAA,GAAmBf,OAAA,CAAQ;IAC/B,OAAOU,OAAA,CAAQQ,IAAI,CAAED,GAAA;MACnB,MAAME,KAAA,GAAQ,OAAOF,GAAA,KAAM,WAAWA,GAAA,GAAIA,GAAA,CAAEE,KAAK;MACjD,OAAOA,KAAA,KAAUH,yBAAA;IACnB;EACF,GAAG,CAACN,OAAA,EAASM,yBAAA,CAA0B;EAEvC,MAAMJ,QAAA,GAAWQ,OAAA,CAAQP,iBAAA,KAAsBH,OAAA,CAAQW,MAAM,KAAK;EAElE,oBACEC,KAAA,CAAC;IAAIC,SAAA,EAAU;4BACbC,IAAA,CAACvB,UAAA;MACCwB,OAAA,EAASlB,EAAA;MACTmB,KAAA,EAAO,GAAGT,CAAA,CAAE,uBAAuBH,QAAA,GAAW,MAAM,IAAI;MACxDA,QAAA,EAAUA,QAAA;MACVa,QAAQ;qBAEVH,IAAA,CAACrB,WAAA;MACCoB,SAAA,EAAU;MACVK,QAAA,EAAUhB,QAAA;MACViB,OAAA,EAAStB,EAAA;MACTuB,WAAA,EAAa,CAAChB,QAAA;MACdiB,WAAA,EAAa;MACbvB,QAAA,EAAWwB,GAAA;QACT,IAAIvB,iBAAA,EAAmB;UACrBA,iBAAA,CAAkBuB,GAAA,EAAKb,KAAA,IAAS;QAClC;MACF;MACAT,OAAA,EAASA,OAAA;MACTS,KAAA,EAAOJ;;;AAIf","ignoreList":[]}
|