@payloadcms/ui 3.0.0-beta.133 → 3.0.0-beta.135

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.
Files changed (128) hide show
  1. package/dist/assets/payload-favicon-dark.png +0 -0
  2. package/dist/assets/payload-favicon-light.png +0 -0
  3. package/dist/assets/payload-favicon.svg +4 -4
  4. package/dist/assets/payload-logo-dark.svg +1 -23
  5. package/dist/assets/payload-logo-light.svg +1 -23
  6. package/dist/assets/static-og-image.png +0 -0
  7. package/dist/elements/RelationshipTable/index.d.ts +1 -0
  8. package/dist/elements/RelationshipTable/index.d.ts.map +1 -1
  9. package/dist/elements/RelationshipTable/index.js +3 -2
  10. package/dist/elements/RelationshipTable/index.js.map +1 -1
  11. package/dist/elements/RenderServerComponent/index.d.ts +0 -6
  12. package/dist/elements/RenderServerComponent/index.d.ts.map +1 -1
  13. package/dist/elements/RenderServerComponent/index.js +1 -24
  14. package/dist/elements/RenderServerComponent/index.js.map +1 -1
  15. package/dist/elements/WhereBuilder/Condition/DefaultFilter/index.js +1 -1
  16. package/dist/elements/WhereBuilder/Condition/DefaultFilter/index.js.map +1 -1
  17. package/dist/exports/client/index.js +22 -22
  18. package/dist/exports/client/index.js.map +4 -4
  19. package/dist/exports/shared/index.d.ts +1 -0
  20. package/dist/exports/shared/index.d.ts.map +1 -1
  21. package/dist/exports/shared/index.js +2 -2
  22. package/dist/exports/shared/index.js.map +4 -4
  23. package/dist/fields/Checkbox/index.d.ts.map +1 -1
  24. package/dist/fields/Checkbox/index.js +71 -183
  25. package/dist/fields/Checkbox/index.js.map +1 -1
  26. package/dist/fields/Code/index.d.ts.map +1 -1
  27. package/dist/fields/Code/index.js +68 -170
  28. package/dist/fields/Code/index.js.map +1 -1
  29. package/dist/fields/Collapsible/index.d.ts.map +1 -1
  30. package/dist/fields/Collapsible/index.js +100 -207
  31. package/dist/fields/Collapsible/index.js.map +1 -1
  32. package/dist/fields/DateTime/index.d.ts.map +1 -1
  33. package/dist/fields/DateTime/index.js +72 -162
  34. package/dist/fields/DateTime/index.js.map +1 -1
  35. package/dist/fields/Email/index.d.ts.map +1 -1
  36. package/dist/fields/Email/index.js +72 -161
  37. package/dist/fields/Email/index.js.map +1 -1
  38. package/dist/fields/Group/index.d.ts.map +1 -1
  39. package/dist/fields/Group/index.js +64 -152
  40. package/dist/fields/Group/index.js.map +1 -1
  41. package/dist/fields/JSON/index.d.ts.map +1 -1
  42. package/dist/fields/JSON/index.js +7 -10
  43. package/dist/fields/JSON/index.js.map +1 -1
  44. package/dist/fields/Join/index.d.ts.map +1 -1
  45. package/dist/fields/Join/index.js +5 -2
  46. package/dist/fields/Join/index.js.map +1 -1
  47. package/dist/fields/Number/index.d.ts.map +1 -1
  48. package/dist/fields/Number/index.js +143 -275
  49. package/dist/fields/Number/index.js.map +1 -1
  50. package/dist/fields/Password/index.d.ts.map +1 -1
  51. package/dist/fields/Password/index.js +79 -166
  52. package/dist/fields/Password/index.js.map +1 -1
  53. package/dist/fields/Point/index.d.ts.map +1 -1
  54. package/dist/fields/Point/index.js +110 -235
  55. package/dist/fields/Point/index.js.map +1 -1
  56. package/dist/fields/RadioGroup/index.d.ts.map +1 -1
  57. package/dist/fields/RadioGroup/index.js +93 -209
  58. package/dist/fields/RadioGroup/index.js.map +1 -1
  59. package/dist/fields/Relationship/index.d.ts.map +1 -1
  60. package/dist/fields/Relationship/index.js +7 -10
  61. package/dist/fields/Relationship/index.js.map +1 -1
  62. package/dist/fields/Select/Input.d.ts +0 -1
  63. package/dist/fields/Select/Input.d.ts.map +1 -1
  64. package/dist/fields/Select/Input.js +45 -50
  65. package/dist/fields/Select/Input.js.map +1 -1
  66. package/dist/fields/Select/index.d.ts.map +1 -1
  67. package/dist/fields/Select/index.js +7 -7
  68. package/dist/fields/Select/index.js.map +1 -1
  69. package/dist/fields/Text/Input.d.ts.map +1 -1
  70. package/dist/fields/Text/Input.js +31 -36
  71. package/dist/fields/Text/Input.js.map +1 -1
  72. package/dist/fields/Text/index.d.ts +1 -1
  73. package/dist/fields/Text/index.d.ts.map +1 -1
  74. package/dist/fields/Text/index.js +93 -171
  75. package/dist/fields/Text/index.js.map +1 -1
  76. package/dist/fields/Text/types.d.ts +0 -1
  77. package/dist/fields/Text/types.d.ts.map +1 -1
  78. package/dist/fields/Text/types.js.map +1 -1
  79. package/dist/fields/Textarea/Input.d.ts.map +1 -1
  80. package/dist/fields/Textarea/Input.js +26 -31
  81. package/dist/fields/Textarea/Input.js.map +1 -1
  82. package/dist/fields/Textarea/index.d.ts.map +1 -1
  83. package/dist/fields/Textarea/index.js +62 -112
  84. package/dist/fields/Textarea/index.js.map +1 -1
  85. package/dist/fields/Textarea/types.d.ts +0 -1
  86. package/dist/fields/Textarea/types.d.ts.map +1 -1
  87. package/dist/fields/Textarea/types.js.map +1 -1
  88. package/dist/fields/Upload/Input.d.ts +0 -1
  89. package/dist/fields/Upload/Input.d.ts.map +1 -1
  90. package/dist/fields/Upload/Input.js +41 -46
  91. package/dist/fields/Upload/Input.js.map +1 -1
  92. package/dist/fields/Upload/index.d.ts.map +1 -1
  93. package/dist/fields/Upload/index.js +63 -135
  94. package/dist/fields/Upload/index.js.map +1 -1
  95. package/dist/fields/mergeFieldStyles.d.ts +3 -0
  96. package/dist/fields/mergeFieldStyles.d.ts.map +1 -0
  97. package/dist/fields/mergeFieldStyles.js +13 -0
  98. package/dist/fields/mergeFieldStyles.js.map +1 -0
  99. package/dist/forms/Form/index.d.ts.map +1 -1
  100. package/dist/forms/Form/index.js +3 -3
  101. package/dist/forms/Form/index.js.map +1 -1
  102. package/dist/forms/Submit/index.d.ts.map +1 -1
  103. package/dist/forms/Submit/index.js +7 -2
  104. package/dist/forms/Submit/index.js.map +1 -1
  105. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
  106. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +3 -0
  107. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
  108. package/dist/forms/fieldSchemasToFormState/renderField.d.ts.map +1 -1
  109. package/dist/forms/fieldSchemasToFormState/renderField.js +40 -9
  110. package/dist/forms/fieldSchemasToFormState/renderField.js.map +1 -1
  111. package/dist/forms/fieldSchemasToFormState/types.d.ts +4 -1
  112. package/dist/forms/fieldSchemasToFormState/types.d.ts.map +1 -1
  113. package/dist/forms/fieldSchemasToFormState/types.js.map +1 -1
  114. package/dist/graphics/Icon/index.d.ts.map +1 -1
  115. package/dist/graphics/Icon/index.js +2 -2
  116. package/dist/graphics/Icon/index.js.map +1 -1
  117. package/dist/graphics/Logo/index.d.ts.map +1 -1
  118. package/dist/graphics/Logo/index.js +30 -21
  119. package/dist/graphics/Logo/index.js.map +1 -1
  120. package/dist/utilities/buildFormState.d.ts +0 -4
  121. package/dist/utilities/buildFormState.d.ts.map +1 -1
  122. package/dist/utilities/buildFormState.js +1 -15
  123. package/dist/utilities/buildFormState.js.map +1 -1
  124. package/dist/utilities/buildTableState.d.ts +2 -1
  125. package/dist/utilities/buildTableState.d.ts.map +1 -1
  126. package/dist/utilities/buildTableState.js +7 -4
  127. package/dist/utilities/buildTableState.js.map +1 -1
  128. package/package.json +15 -5
@@ -1,56 +1,36 @@
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 { password } from 'payload/shared';
6
- import React, { useCallback } from 'react';
5
+ import React, { useCallback, useMemo } from 'react';
7
6
  import { useField } from '../../forms/useField/index.js';
8
7
  import { withCondition } from '../../forms/withCondition/index.js';
9
8
  import { useConfig } from '../../providers/Config/index.js';
10
9
  import { useLocale } from '../../providers/Locale/index.js';
11
10
  import { useTranslation } from '../../providers/Translation/index.js';
12
- import { isFieldRTL } from '../shared/index.js';
11
+ import { mergeFieldStyles } from '../mergeFieldStyles.js';
13
12
  import './index.scss';
13
+ import { isFieldRTL } from '../shared/index.js';
14
14
  import { PasswordInput } from './input.js';
15
15
  const PasswordFieldComponent = props => {
16
- const $ = _c(39);
17
16
  const {
18
17
  autoComplete,
19
- field: t0,
18
+ field,
19
+ field: {
20
+ admin: {
21
+ className,
22
+ disabled: disabledFromProps,
23
+ placeholder,
24
+ rtl
25
+ } = {},
26
+ label,
27
+ localized,
28
+ required
29
+ } = {},
20
30
  inputRef,
21
31
  path,
22
32
  validate
23
33
  } = props;
24
- let t1;
25
- if ($[0] !== t0) {
26
- t1 = t0 === undefined ? {} : t0;
27
- $[0] = t0;
28
- $[1] = t1;
29
- } else {
30
- t1 = $[1];
31
- }
32
- const {
33
- admin: t2,
34
- label,
35
- localized,
36
- required
37
- } = t1;
38
- let t3;
39
- if ($[2] !== t2) {
40
- t3 = t2 === undefined ? {} : t2;
41
- $[2] = t2;
42
- $[3] = t3;
43
- } else {
44
- t3 = $[3];
45
- }
46
- const {
47
- className,
48
- disabled: disabledFromProps,
49
- placeholder,
50
- rtl,
51
- style,
52
- width
53
- } = t3;
54
34
  const {
55
35
  t
56
36
  } = useTranslation();
@@ -58,145 +38,78 @@ const PasswordFieldComponent = props => {
58
38
  const {
59
39
  config
60
40
  } = useConfig();
61
- let t4;
62
- if ($[4] !== validate || $[5] !== required || $[6] !== config || $[7] !== t) {
63
- t4 = (value, options) => {
64
- if (typeof validate === "function") {
65
- return validate(value, {
66
- ...options,
67
- required
68
- });
69
- }
70
- return password(value, {
71
- name: "password",
72
- type: "text",
73
- data: {},
74
- preferences: {
75
- fields: {}
76
- },
77
- req: {
78
- payload: {
79
- config
80
- },
81
- t
82
- },
83
- required: true,
84
- siblingData: {}
41
+ const memoizedValidate = useCallback((value, options) => {
42
+ if (typeof validate === 'function') {
43
+ return validate(value, {
44
+ ...options,
45
+ required
85
46
  });
86
- };
87
- $[4] = validate;
88
- $[5] = required;
89
- $[6] = config;
90
- $[7] = t;
91
- $[8] = t4;
92
- } else {
93
- t4 = $[8];
94
- }
95
- const memoizedValidate = t4;
96
- let t5;
97
- if ($[9] !== path || $[10] !== memoizedValidate) {
98
- t5 = {
99
- path,
100
- validate: memoizedValidate
101
- };
102
- $[9] = path;
103
- $[10] = memoizedValidate;
104
- $[11] = t5;
105
- } else {
106
- t5 = $[11];
107
- }
47
+ }
48
+ return password(value, {
49
+ name: 'password',
50
+ type: 'text',
51
+ data: {},
52
+ preferences: {
53
+ fields: {}
54
+ },
55
+ req: {
56
+ payload: {
57
+ config
58
+ },
59
+ t
60
+ },
61
+ required: true,
62
+ siblingData: {}
63
+ });
64
+ }, [validate, config, t, required]);
108
65
  const {
109
- customComponents: t6,
66
+ customComponents: {
67
+ AfterInput,
68
+ BeforeInput,
69
+ Description,
70
+ Error,
71
+ Label
72
+ } = {},
110
73
  formInitializing,
111
74
  formProcessing,
112
75
  setValue,
113
76
  showError,
114
77
  value: value_0
115
- } = useField(t5);
116
- let t7;
117
- if ($[12] !== t6) {
118
- t7 = t6 === undefined ? {} : t6;
119
- $[12] = t6;
120
- $[13] = t7;
121
- } else {
122
- t7 = $[13];
123
- }
124
- const {
125
- AfterInput,
126
- BeforeInput,
127
- Description,
128
- Error,
129
- Label
130
- } = t7;
78
+ } = useField({
79
+ path,
80
+ validate: memoizedValidate
81
+ });
131
82
  const disabled = disabledFromProps || formInitializing || formProcessing;
132
- const t8 = config.localization || undefined;
133
- let t9;
134
- if ($[14] !== rtl || $[15] !== locale || $[16] !== t8 || $[17] !== setValue || $[18] !== value_0 || $[19] !== AfterInput || $[20] !== autoComplete || $[21] !== BeforeInput || $[22] !== className || $[23] !== Description || $[24] !== Error || $[25] !== inputRef || $[26] !== Label || $[27] !== label || $[28] !== localized || $[29] !== path || $[30] !== placeholder || $[31] !== disabled || $[32] !== required || $[33] !== showError || $[34] !== style || $[35] !== width) {
135
- const renderRTL = isFieldRTL({
136
- fieldLocalized: false,
137
- fieldRTL: rtl,
138
- locale,
139
- localizationConfig: t8
140
- });
141
- let t10;
142
- if ($[37] !== setValue) {
143
- t10 = e => {
144
- setValue(e.target.value);
145
- };
146
- $[37] = setValue;
147
- $[38] = t10;
148
- } else {
149
- t10 = $[38];
150
- }
151
- t9 = _jsx(PasswordInput, {
152
- AfterInput,
153
- autoComplete,
154
- BeforeInput,
155
- className,
156
- Description,
157
- Error,
158
- inputRef,
159
- Label,
160
- label,
161
- localized,
162
- onChange: t10,
163
- path,
164
- placeholder,
165
- readOnly: disabled,
166
- required,
167
- rtl: renderRTL,
168
- showError,
169
- style,
170
- value: value_0 || "",
171
- width
172
- });
173
- $[14] = rtl;
174
- $[15] = locale;
175
- $[16] = t8;
176
- $[17] = setValue;
177
- $[18] = value_0;
178
- $[19] = AfterInput;
179
- $[20] = autoComplete;
180
- $[21] = BeforeInput;
181
- $[22] = className;
182
- $[23] = Description;
183
- $[24] = Error;
184
- $[25] = inputRef;
185
- $[26] = Label;
186
- $[27] = label;
187
- $[28] = localized;
188
- $[29] = path;
189
- $[30] = placeholder;
190
- $[31] = disabled;
191
- $[32] = required;
192
- $[33] = showError;
193
- $[34] = style;
194
- $[35] = width;
195
- $[36] = t9;
196
- } else {
197
- t9 = $[36];
198
- }
199
- return t9;
83
+ const renderRTL = isFieldRTL({
84
+ fieldLocalized: false,
85
+ fieldRTL: rtl,
86
+ locale,
87
+ localizationConfig: config.localization || undefined
88
+ });
89
+ const styles = useMemo(() => mergeFieldStyles(field), [field]);
90
+ return /*#__PURE__*/_jsx(PasswordInput, {
91
+ AfterInput: AfterInput,
92
+ autoComplete: autoComplete,
93
+ BeforeInput: BeforeInput,
94
+ className: className,
95
+ Description: Description,
96
+ Error: Error,
97
+ inputRef: inputRef,
98
+ Label: Label,
99
+ label: label,
100
+ localized: localized,
101
+ onChange: e => {
102
+ setValue(e.target.value);
103
+ },
104
+ path: path,
105
+ placeholder: placeholder,
106
+ readOnly: disabled,
107
+ required: required,
108
+ rtl: renderRTL,
109
+ showError: showError,
110
+ style: styles,
111
+ value: value_0 || ''
112
+ });
200
113
  };
201
114
  export const PasswordField = withCondition(PasswordFieldComponent);
202
115
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","password","React","useCallback","useField","withCondition","useConfig","useLocale","useTranslation","isFieldRTL","PasswordInput","PasswordFieldComponent","props","$","autoComplete","field","t0","inputRef","path","validate","t1","undefined","admin","t2","label","localized","required","t3","className","disabled","disabledFromProps","placeholder","rtl","style","width","t","locale","config","t4","value","options","name","type","data","preferences","fields","req","payload","siblingData","memoizedValidate","t5","customComponents","t6","formInitializing","formProcessing","setValue","showError","value_0","t7","AfterInput","BeforeInput","Description","Error","Label","t8","localization","t9","renderRTL","fieldLocalized","fieldRTL","localizationConfig","t10","e","target","_jsx","onChange","readOnly","PasswordField"],"sources":["../../../src/fields/Password/index.tsx"],"sourcesContent":["'use client'\nimport type { PasswordFieldValidation, PayloadRequest } from 'payload'\n\nimport { password } from 'payload/shared'\nimport React, { useCallback } from 'react'\n\nimport type { PasswordFieldProps } from './types.js'\n\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useLocale } from '../../providers/Locale/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { isFieldRTL } from '../shared/index.js'\nimport './index.scss'\nimport { PasswordInput } from './input.js'\n\nconst PasswordFieldComponent: React.FC<PasswordFieldProps> = (props) => {\n const {\n autoComplete,\n field: {\n name,\n admin: {\n className,\n disabled: disabledFromProps,\n placeholder,\n rtl,\n style,\n width,\n } = {} as PasswordFieldProps['field']['admin'],\n label,\n localized,\n required,\n } = {} as PasswordFieldProps['field'],\n inputRef,\n path,\n validate,\n } = props\n\n const { t } = useTranslation()\n const locale = useLocale()\n const { config } = useConfig()\n\n const memoizedValidate: PasswordFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n\n return password(value, {\n name: 'password',\n type: 'text',\n data: {},\n preferences: { fields: {} },\n req: {\n payload: {\n config,\n },\n t,\n } as unknown as PayloadRequest,\n required: true,\n siblingData: {},\n })\n },\n [validate, config, t, required],\n )\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Error, Label } = {},\n formInitializing,\n formProcessing,\n setValue,\n showError,\n value,\n } = useField({\n path,\n validate: memoizedValidate,\n })\n\n const disabled = disabledFromProps || formInitializing || formProcessing\n\n const renderRTL = isFieldRTL({\n fieldLocalized: false,\n fieldRTL: rtl,\n locale,\n localizationConfig: config.localization || undefined,\n })\n\n return (\n <PasswordInput\n AfterInput={AfterInput}\n autoComplete={autoComplete}\n BeforeInput={BeforeInput}\n className={className}\n Description={Description}\n Error={Error}\n inputRef={inputRef}\n Label={Label}\n label={label}\n localized={localized}\n onChange={(e) => {\n setValue(e.target.value)\n }}\n path={path}\n placeholder={placeholder}\n readOnly={disabled}\n required={required}\n rtl={renderRTL}\n showError={showError}\n style={style}\n value={(value as string) || ''}\n width={width}\n />\n )\n}\n\nexport const PasswordField = withCondition(PasswordFieldComponent)\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,QAAQ,QAAQ;AACzB,OAAOC,KAAA,IAASC,WAAW,QAAQ;AAInC,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,SAAS,QAAQ;AAC1B,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,UAAU,QAAQ;AAC3B,OAAO;AACP,SAASC,aAAa,QAAQ;AAE9B,MAAMC,sBAAA,GAAuDC,KAAA;EAAA,MAAAC,CAAA,GAAAb,EAAA;EAC3D;IAAAc,YAAA;IAAAC,KAAA,EAAAC,EAAA;IAAAC,QAAA;IAAAC,IAAA;IAAAC;EAAA,IAmBIP,KAAA;EAAA,IAAAQ,EAAA;EAAA,IAAAP,CAAA,QAAAG,EAAA;IAjBKI,EAAA,GAAAJ,EAa8B,KAAAK,SAAA,QAb9BL,EAa8B;IAAAH,CAAA,MAAAG,EAAA;IAAAH,CAAA,MAAAO,EAAA;EAAA;IAAAA,EAAA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J,CAAA,SAAAkD,KAAA,IAAAlD,CAAA,SAAAW,KAAA,IAAAX,CAAA,SAAAY,SAAA,IAAAZ,CAAA,SAAAK,IAAA,IAAAL,CAAA,SAAAkB,WAAA,IAAAlB,CAAA,SAAAgB,QAAA,IAAAhB,CAAA,SAAAa,QAAA,IAAAb,CAAA,SAAA2C,SAAA,IAAA3C,CAAA,SAAAoB,KAAA,IAAApB,CAAA,SAAAqB,KAAA;IAJ7C,MAAAiC,SAAA,GAAkB1D,UAAA;MAAA2D,cAAA;MAAAC,QAAA,EAENrC,GAAA;MAAAI,MAAA;MAAAkC,kBAAA,EAEUN;IAAuB,CAC7C;IAAA,IAAAO,GAAA;IAAA,IAAA1D,CAAA,SAAA0C,QAAA;MAccgB,GAAA,GAAAC,CAAA;QACRjB,QAAA,CAASiB,CAAA,CAAAC,MAAA,CAAAlC,KAAc;MAAA;MACzB1B,CAAA,OAAA0C,QAAA;MAAA1C,CAAA,OAAA0D,GAAA;IAAA;MAAAA,GAAA,GAAA1D,CAAA;IAAA;IAbFqD,EAAA,GAAAQ,IAAA,CAAAhE,aAAA;MAAAiD,UAAA;MAAA7C,YAAA;MAAA8C,WAAA;MAAAhC,SAAA;MAAAiC,WAAA;MAAAC,KAAA;MAAA7C,QAAA;MAAA8C,KAAA;MAAAvC,KAAA;MAAAC,SAAA;MAAAkD,QAAA,EAWYJ,GAEV;MAAArD,IAAA;MAAAa,WAAA;MAAA6C,QAAA,EAGU/C,QAAA;MAAAH,QAAA;MAAAM,GAAA,EAELmC,SAAA;MAAAX,SAAA;MAAAvB,KAAA;MAAAM,KAAA,EAGEA,OAAC,IAAoB;MAAAL;IAAA,C;;;;;;;;;;;;;;;;;;;;;;;;;;;SArB9BgC,E;CAyBJ;AAEA,OAAO,MAAMW,aAAA,GAAgBxE,aAAA,CAAcM,sBAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["password","React","useCallback","useMemo","useField","withCondition","useConfig","useLocale","useTranslation","mergeFieldStyles","isFieldRTL","PasswordInput","PasswordFieldComponent","props","autoComplete","field","admin","className","disabled","disabledFromProps","placeholder","rtl","label","localized","required","inputRef","path","validate","t","locale","config","memoizedValidate","value","options","name","type","data","preferences","fields","req","payload","siblingData","customComponents","AfterInput","BeforeInput","Description","Error","Label","formInitializing","formProcessing","setValue","showError","renderRTL","fieldLocalized","fieldRTL","localizationConfig","localization","undefined","styles","_jsx","onChange","e","target","readOnly","style","PasswordField"],"sources":["../../../src/fields/Password/index.tsx"],"sourcesContent":["'use client'\nimport type { PasswordFieldValidation, PayloadRequest } from 'payload'\n\nimport { password } from 'payload/shared'\nimport React, { useCallback, useMemo } from 'react'\n\nimport type { PasswordFieldProps } from './types.js'\n\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useLocale } from '../../providers/Locale/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { mergeFieldStyles } from '../mergeFieldStyles.js'\nimport './index.scss'\nimport { isFieldRTL } from '../shared/index.js'\nimport { PasswordInput } from './input.js'\n\nconst PasswordFieldComponent: React.FC<PasswordFieldProps> = (props) => {\n const {\n autoComplete,\n field,\n field: {\n admin: {\n className,\n disabled: disabledFromProps,\n placeholder,\n rtl,\n } = {} as PasswordFieldProps['field']['admin'],\n label,\n localized,\n required,\n } = {} as PasswordFieldProps['field'],\n inputRef,\n path,\n validate,\n } = props\n\n const { t } = useTranslation()\n const locale = useLocale()\n const { config } = useConfig()\n\n const memoizedValidate: PasswordFieldValidation = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, required })\n }\n\n return password(value, {\n name: 'password',\n type: 'text',\n data: {},\n preferences: { fields: {} },\n req: {\n payload: {\n config,\n },\n t,\n } as unknown as PayloadRequest,\n required: true,\n siblingData: {},\n })\n },\n [validate, config, t, required],\n )\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Error, Label } = {},\n formInitializing,\n formProcessing,\n setValue,\n showError,\n value,\n } = useField({\n path,\n validate: memoizedValidate,\n })\n\n const disabled = disabledFromProps || formInitializing || formProcessing\n\n const renderRTL = isFieldRTL({\n fieldLocalized: false,\n fieldRTL: rtl,\n locale,\n localizationConfig: config.localization || undefined,\n })\n\n const styles = useMemo(() => mergeFieldStyles(field), [field])\n\n return (\n <PasswordInput\n AfterInput={AfterInput}\n autoComplete={autoComplete}\n BeforeInput={BeforeInput}\n className={className}\n Description={Description}\n Error={Error}\n inputRef={inputRef}\n Label={Label}\n label={label}\n localized={localized}\n onChange={(e) => {\n setValue(e.target.value)\n }}\n path={path}\n placeholder={placeholder}\n readOnly={disabled}\n required={required}\n rtl={renderRTL}\n showError={showError}\n style={styles}\n value={(value as string) || ''}\n />\n )\n}\n\nexport const PasswordField = withCondition(PasswordFieldComponent)\n"],"mappings":"AAAA;;;AAGA,SAASA,QAAQ,QAAQ;AACzB,OAAOC,KAAA,IAASC,WAAW,EAAEC,OAAO,QAAQ;AAI5C,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,SAAS,QAAQ;AAC1B,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ;AACjC,OAAO;AACP,SAASC,UAAU,QAAQ;AAC3B,SAASC,aAAa,QAAQ;AAE9B,MAAMC,sBAAA,GAAwDC,KAAA;EAC5D,MAAM;IACJC,YAAY;IACZC,KAAK;IACLA,KAAA,EAAO;MACLC,KAAA,EAAO;QACLC,SAAS;QACTC,QAAA,EAAUC,iBAAiB;QAC3BC,WAAW;QACXC;MAAG,CACJ,GAAG,CAAC,CAAyC;MAC9CC,KAAK;MACLC,SAAS;MACTC;IAAQ,CACT,GAAG,CAAC,CAAgC;IACrCC,QAAQ;IACRC,IAAI;IACJC;EAAQ,CACT,GAAGd,KAAA;EAEJ,MAAM;IAAEe;EAAC,CAAE,GAAGpB,cAAA;EACd,MAAMqB,MAAA,GAAStB,S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AcA,YAAA;IACd8B,WAAA,EAAaA,WAAA;IACb3B,SAAA,EAAWA,SAAA;IACX4B,WAAA,EAAaA,WAAA;IACbC,KAAA,EAAOA,KAAA;IACPrB,QAAA,EAAUA,QAAA;IACVsB,KAAA,EAAOA,KAAA;IACPzB,KAAA,EAAOA,KAAA;IACPC,SAAA,EAAWA,SAAA;IACXqC,QAAA,EAAWC,CAAA;MACTX,QAAA,CAASW,CAAA,CAAEC,MAAM,CAAC9B,KAAK;IACzB;IACAN,IAAA,EAAMA,IAAA;IACNN,WAAA,EAAaA,WAAA;IACb2C,QAAA,EAAU7C,QAAA;IACVM,QAAA,EAAUA,QAAA;IACVH,GAAA,EAAK+B,SAAA;IACLD,SAAA,EAAWA,SAAA;IACXa,KAAA,EAAON,MAAA;IACP1B,KAAA,EAAOA,OAAC,IAAoB;;AAGlC;AAEA,OAAO,MAAMiC,aAAA,GAAgB5D,aAAA,CAAcO,sBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Point/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAG9E,OAAO,KAAsB,MAAM,OAAO,CAAA;AAU1C,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,mBAAmB,EAAE,yBA6IjC,CAAA;AAED,eAAO,MAAM,UAAU;;;;;+EAAqC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Point/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAG9E,OAAO,KAA+B,MAAM,OAAO,CAAA;AAUnD,OAAO,cAAc,CAAA;AAKrB,eAAO,MAAM,mBAAmB,EAAE,yBA4IjC,CAAA;AAED,eAAO,MAAM,UAAU;;;;;+EAAqC,CAAA"}