@payloadcms/ui 3.29.0-canary.1 → 3.29.0-canary.2
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/LeaveWithoutSaving/usePreventLeave.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js +2 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -1
- package/dist/exports/client/index.js +11 -11
- package/dist/exports/client/index.js.map +4 -4
- package/dist/fields/Tabs/Tab/index.d.ts +1 -0
- package/dist/fields/Tabs/Tab/index.d.ts.map +1 -1
- package/dist/fields/Tabs/Tab/index.js +29 -25
- package/dist/fields/Tabs/Tab/index.js.map +1 -1
- package/dist/fields/Tabs/Tab/index.scss +4 -0
- package/dist/fields/Tabs/index.d.ts +1 -1
- package/dist/fields/Tabs/index.d.ts.map +1 -1
- package/dist/fields/Tabs/index.js +285 -194
- package/dist/fields/Tabs/index.js.map +1 -1
- package/dist/fields/Tabs/index.scss +8 -0
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +17 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -4
|
@@ -7,6 +7,7 @@ import { tabHasName, toKebabCase } from 'payload/shared';
|
|
|
7
7
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
8
8
|
import { useCollapsible } from '../../elements/Collapsible/provider.js';
|
|
9
9
|
import { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js';
|
|
10
|
+
import { useFormFields } from '../../forms/Form/index.js';
|
|
10
11
|
import { RenderFields } from '../../forms/RenderFields/index.js';
|
|
11
12
|
import { useField } from '../../forms/useField/index.js';
|
|
12
13
|
import { withCondition } from '../../forms/withCondition/index.js';
|
|
@@ -15,9 +16,9 @@ import { usePreferences } from '../../providers/Preferences/index.js';
|
|
|
15
16
|
import { useTranslation } from '../../providers/Translation/index.js';
|
|
16
17
|
import { FieldDescription } from '../FieldDescription/index.js';
|
|
17
18
|
import { fieldBaseClass } from '../shared/index.js';
|
|
18
|
-
import './index.scss';
|
|
19
19
|
import { TabsProvider } from './provider.js';
|
|
20
20
|
import { TabComponent } from './Tab/index.js';
|
|
21
|
+
import './index.scss';
|
|
21
22
|
const baseClass = 'tabs-field';
|
|
22
23
|
export { TabsProvider };
|
|
23
24
|
function generateTabPath({
|
|
@@ -35,7 +36,7 @@ function generateTabPath({
|
|
|
35
36
|
return tabPath;
|
|
36
37
|
}
|
|
37
38
|
const TabsFieldComponent = props => {
|
|
38
|
-
const $ = _c(
|
|
39
|
+
const $ = _c(89);
|
|
39
40
|
const {
|
|
40
41
|
field: t0,
|
|
41
42
|
forceRender: t1,
|
|
@@ -88,99 +89,105 @@ const TabsFieldComponent = props => {
|
|
|
88
89
|
const {
|
|
89
90
|
isWithinCollapsible
|
|
90
91
|
} = useCollapsible();
|
|
91
|
-
const [activeTabIndex, setActiveTabIndex] = useState(0);
|
|
92
|
-
const tabsPrefKey = `tabs-${indexPath}`;
|
|
93
92
|
let t10;
|
|
94
|
-
if ($[4] !==
|
|
95
|
-
t10 =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
if ($[4] !== tabs) {
|
|
94
|
+
t10 = t11 => {
|
|
95
|
+
const [fields] = t11;
|
|
96
|
+
return tabs.map((tab, index) => {
|
|
97
|
+
const id = tab?.id;
|
|
98
|
+
return {
|
|
99
|
+
index,
|
|
100
|
+
passesCondition: fields?.[id]?.passesCondition ?? true,
|
|
101
|
+
tab
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
$[4] = tabs;
|
|
106
|
+
$[5] = t10;
|
|
103
107
|
} else {
|
|
104
|
-
t10 = $[
|
|
108
|
+
t10 = $[5];
|
|
105
109
|
}
|
|
106
|
-
const
|
|
110
|
+
const tabStates = useFormFields(t10);
|
|
107
111
|
let t11;
|
|
108
|
-
if ($[
|
|
109
|
-
t11 =
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[10] = parentPath;
|
|
113
|
-
$[11] = tabs;
|
|
114
|
-
$[12] = t11;
|
|
112
|
+
if ($[6] !== tabStates) {
|
|
113
|
+
t11 = () => tabStates.filter(_temp)?.[0]?.index ?? 0;
|
|
114
|
+
$[6] = tabStates;
|
|
115
|
+
$[7] = t11;
|
|
115
116
|
} else {
|
|
116
|
-
t11 = $[
|
|
117
|
+
t11 = $[7];
|
|
117
118
|
}
|
|
118
|
-
const
|
|
119
|
+
const [activeTabIndex, setActiveTabIndex] = useState(t11);
|
|
120
|
+
const tabsPrefKey = `tabs-${indexPath}`;
|
|
119
121
|
let t12;
|
|
120
|
-
if ($[
|
|
122
|
+
if ($[8] !== activeTabIndex || $[9] !== parentPath || $[10] !== tabs) {
|
|
121
123
|
t12 = () => generateTabPath({
|
|
122
|
-
activeTabConfig: tabs[
|
|
123
|
-
path:
|
|
124
|
+
activeTabConfig: tabs[activeTabIndex],
|
|
125
|
+
path: parentPath
|
|
124
126
|
});
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
127
|
+
$[8] = activeTabIndex;
|
|
128
|
+
$[9] = parentPath;
|
|
129
|
+
$[10] = tabs;
|
|
130
|
+
$[11] = t12;
|
|
128
131
|
} else {
|
|
129
|
-
t12 = $[
|
|
132
|
+
t12 = $[11];
|
|
130
133
|
}
|
|
131
|
-
const [
|
|
134
|
+
const [activeTabPath, setActiveTabPath] = useState(t12);
|
|
132
135
|
let t13;
|
|
133
|
-
if ($[
|
|
134
|
-
t13 =
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
136
|
+
if ($[12] !== parentSchemaPath || $[13] !== tabs) {
|
|
137
|
+
t13 = () => generateTabPath({
|
|
138
|
+
activeTabConfig: tabs[0],
|
|
139
|
+
path: parentSchemaPath
|
|
140
|
+
});
|
|
141
|
+
$[12] = parentSchemaPath;
|
|
142
|
+
$[13] = tabs;
|
|
143
|
+
$[14] = t13;
|
|
140
144
|
} else {
|
|
141
|
-
t13 = $[
|
|
145
|
+
t13 = $[14];
|
|
142
146
|
}
|
|
143
|
-
const
|
|
147
|
+
const [activeTabSchemaPath, setActiveTabSchemaPath] = useState(t13);
|
|
144
148
|
let t14;
|
|
149
|
+
if ($[15] !== activeTabIndex || $[16] !== activeTabPath || $[17] !== parentPath || $[18] !== tabs) {
|
|
150
|
+
t14 = tabHasName(tabs[activeTabIndex]) ? activeTabPath : parentPath;
|
|
151
|
+
$[15] = activeTabIndex;
|
|
152
|
+
$[16] = activeTabPath;
|
|
153
|
+
$[17] = parentPath;
|
|
154
|
+
$[18] = tabs;
|
|
155
|
+
$[19] = t14;
|
|
156
|
+
} else {
|
|
157
|
+
t14 = $[19];
|
|
158
|
+
}
|
|
159
|
+
const activePathChildrenPath = t14;
|
|
160
|
+
const activeTabInfo = tabStates[activeTabIndex];
|
|
161
|
+
const activeTabConfig = activeTabInfo?.tab;
|
|
145
162
|
let t15;
|
|
146
|
-
if ($[
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
setActiveTabIndex(newIndex);
|
|
154
|
-
setActiveTabPath(generateTabPath({
|
|
155
|
-
activeTabConfig: tabs[newIndex],
|
|
156
|
-
path: parentPath
|
|
157
|
-
}));
|
|
158
|
-
setActiveTabSchemaPath(generateTabPath({
|
|
159
|
-
activeTabConfig: tabs[newIndex],
|
|
160
|
-
path: parentSchemaPath
|
|
161
|
-
}));
|
|
162
|
-
};
|
|
163
|
-
getInitialPref();
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
t15 = [path, getPreference, preferencesKey, tabsPrefKey, tabs, parentPath, parentSchemaPath];
|
|
167
|
-
$[21] = getPreference;
|
|
168
|
-
$[22] = parentPath;
|
|
169
|
-
$[23] = parentSchemaPath;
|
|
170
|
-
$[24] = path;
|
|
171
|
-
$[25] = preferencesKey;
|
|
172
|
-
$[26] = tabs;
|
|
173
|
-
$[27] = tabsPrefKey;
|
|
174
|
-
$[28] = t14;
|
|
175
|
-
$[29] = t15;
|
|
163
|
+
if ($[20] !== activeTabIndex || $[21] !== activeTabSchemaPath || $[22] !== parentSchemaPath || $[23] !== tabs) {
|
|
164
|
+
t15 = tabHasName(tabs[activeTabIndex]) ? activeTabSchemaPath : parentSchemaPath;
|
|
165
|
+
$[20] = activeTabIndex;
|
|
166
|
+
$[21] = activeTabSchemaPath;
|
|
167
|
+
$[22] = parentSchemaPath;
|
|
168
|
+
$[23] = tabs;
|
|
169
|
+
$[24] = t15;
|
|
176
170
|
} else {
|
|
177
|
-
|
|
178
|
-
t15 = $[29];
|
|
171
|
+
t15 = $[24];
|
|
179
172
|
}
|
|
180
|
-
|
|
173
|
+
const activePathSchemaChildrenPath = t15;
|
|
174
|
+
const activeTabDescription = activeTabConfig.admin?.description ?? activeTabConfig.description;
|
|
181
175
|
let t16;
|
|
182
|
-
if ($[
|
|
183
|
-
t16 =
|
|
176
|
+
if ($[25] !== activeTabDescription || $[26] !== i18n) {
|
|
177
|
+
t16 = typeof activeTabDescription === "function" ? activeTabDescription({
|
|
178
|
+
t: i18n.t
|
|
179
|
+
}) : activeTabDescription;
|
|
180
|
+
$[25] = activeTabDescription;
|
|
181
|
+
$[26] = i18n;
|
|
182
|
+
$[27] = t16;
|
|
183
|
+
} else {
|
|
184
|
+
t16 = $[27];
|
|
185
|
+
}
|
|
186
|
+
const activeTabStaticDescription = t16;
|
|
187
|
+
const hasVisibleTabs = tabStates.some(_temp2);
|
|
188
|
+
let t17;
|
|
189
|
+
if ($[28] !== getPreference || $[29] !== parentPath || $[30] !== parentSchemaPath || $[31] !== path || $[32] !== preferencesKey || $[33] !== setPreference || $[34] !== tabs || $[35] !== tabsPrefKey) {
|
|
190
|
+
t17 = async incomingTabIndex => {
|
|
184
191
|
setActiveTabIndex(incomingTabIndex);
|
|
185
192
|
setActiveTabPath(generateTabPath({
|
|
186
193
|
activeTabConfig: tabs[incomingTabIndex],
|
|
@@ -190,23 +197,23 @@ const TabsFieldComponent = props => {
|
|
|
190
197
|
activeTabConfig: tabs[incomingTabIndex],
|
|
191
198
|
path: parentSchemaPath
|
|
192
199
|
}));
|
|
193
|
-
const
|
|
200
|
+
const existingPreferences = await getPreference(preferencesKey);
|
|
194
201
|
if (preferencesKey) {
|
|
195
202
|
setPreference(preferencesKey, {
|
|
196
|
-
...
|
|
203
|
+
...existingPreferences,
|
|
197
204
|
...(path ? {
|
|
198
205
|
fields: {
|
|
199
|
-
...(
|
|
206
|
+
...(existingPreferences?.fields || {}),
|
|
200
207
|
[path]: {
|
|
201
|
-
...
|
|
208
|
+
...existingPreferences?.fields?.[path],
|
|
202
209
|
tabIndex: incomingTabIndex
|
|
203
210
|
}
|
|
204
211
|
}
|
|
205
212
|
} : {
|
|
206
213
|
fields: {
|
|
207
|
-
...
|
|
214
|
+
...existingPreferences?.fields,
|
|
208
215
|
[tabsPrefKey]: {
|
|
209
|
-
...
|
|
216
|
+
...existingPreferences?.fields?.[tabsPrefKey],
|
|
210
217
|
tabIndex: incomingTabIndex
|
|
211
218
|
}
|
|
212
219
|
}
|
|
@@ -214,132 +221,196 @@ const TabsFieldComponent = props => {
|
|
|
214
221
|
});
|
|
215
222
|
}
|
|
216
223
|
};
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
224
|
+
$[28] = getPreference;
|
|
225
|
+
$[29] = parentPath;
|
|
226
|
+
$[30] = parentSchemaPath;
|
|
227
|
+
$[31] = path;
|
|
228
|
+
$[32] = preferencesKey;
|
|
229
|
+
$[33] = setPreference;
|
|
230
|
+
$[34] = tabs;
|
|
231
|
+
$[35] = tabsPrefKey;
|
|
232
|
+
$[36] = t17;
|
|
226
233
|
} else {
|
|
227
|
-
|
|
234
|
+
t17 = $[36];
|
|
228
235
|
}
|
|
229
|
-
const handleTabChange =
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
236
|
+
const handleTabChange = t17;
|
|
237
|
+
let t18;
|
|
238
|
+
let t19;
|
|
239
|
+
if ($[37] !== getPreference || $[38] !== parentPath || $[39] !== parentSchemaPath || $[40] !== path || $[41] !== preferencesKey || $[42] !== tabs || $[43] !== tabsPrefKey) {
|
|
240
|
+
t18 = () => {
|
|
241
|
+
if (preferencesKey) {
|
|
242
|
+
const getInitialPref = async () => {
|
|
243
|
+
const existingPreferences_0 = await getPreference(preferencesKey);
|
|
244
|
+
const initialIndex = path ? existingPreferences_0?.fields?.[path]?.tabIndex : existingPreferences_0?.fields?.[tabsPrefKey]?.tabIndex;
|
|
245
|
+
const newIndex = initialIndex || 0;
|
|
246
|
+
setActiveTabIndex(newIndex);
|
|
247
|
+
setActiveTabPath(generateTabPath({
|
|
248
|
+
activeTabConfig: tabs[newIndex],
|
|
249
|
+
path: parentPath
|
|
250
|
+
}));
|
|
251
|
+
setActiveTabSchemaPath(generateTabPath({
|
|
252
|
+
activeTabConfig: tabs[newIndex],
|
|
253
|
+
path: parentSchemaPath
|
|
254
|
+
}));
|
|
255
|
+
};
|
|
256
|
+
getInitialPref();
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
t19 = [path, getPreference, preferencesKey, tabsPrefKey, tabs, parentPath, parentSchemaPath];
|
|
260
|
+
$[37] = getPreference;
|
|
261
|
+
$[38] = parentPath;
|
|
262
|
+
$[39] = parentSchemaPath;
|
|
263
|
+
$[40] = path;
|
|
264
|
+
$[41] = preferencesKey;
|
|
265
|
+
$[42] = tabs;
|
|
266
|
+
$[43] = tabsPrefKey;
|
|
267
|
+
$[44] = t18;
|
|
268
|
+
$[45] = t19;
|
|
240
269
|
} else {
|
|
241
|
-
|
|
270
|
+
t18 = $[44];
|
|
271
|
+
t19 = $[45];
|
|
242
272
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
273
|
+
useEffect(t18, t19);
|
|
274
|
+
let t20;
|
|
275
|
+
if ($[46] !== activeTabInfo?.passesCondition || $[47] !== handleTabChange || $[48] !== tabStates) {
|
|
276
|
+
t20 = () => {
|
|
277
|
+
if (activeTabInfo?.passesCondition === false) {
|
|
278
|
+
const nextTab = tabStates.find(_temp3);
|
|
279
|
+
if (nextTab) {
|
|
280
|
+
handleTabChange(nextTab.index);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
$[46] = activeTabInfo?.passesCondition;
|
|
285
|
+
$[47] = handleTabChange;
|
|
286
|
+
$[48] = tabStates;
|
|
287
|
+
$[49] = t20;
|
|
251
288
|
} else {
|
|
252
|
-
|
|
289
|
+
t20 = $[49];
|
|
253
290
|
}
|
|
254
|
-
const t20 = t19.join(" ");
|
|
255
291
|
let t21;
|
|
256
|
-
if ($[
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
292
|
+
if ($[50] !== activeTabInfo || $[51] !== handleTabChange || $[52] !== tabStates) {
|
|
293
|
+
t21 = [activeTabInfo, tabStates, handleTabChange];
|
|
294
|
+
$[50] = activeTabInfo;
|
|
295
|
+
$[51] = handleTabChange;
|
|
296
|
+
$[52] = tabStates;
|
|
297
|
+
$[53] = t21;
|
|
298
|
+
} else {
|
|
299
|
+
t21 = $[53];
|
|
300
|
+
}
|
|
301
|
+
useEffect(t20, t21);
|
|
302
|
+
const t22 = isWithinCollapsible && `${baseClass}--within-collapsible`;
|
|
303
|
+
const t23 = !hasVisibleTabs && `${baseClass}--hidden`;
|
|
304
|
+
let t24;
|
|
305
|
+
if ($[54] !== className || $[55] !== t22 || $[56] !== t23) {
|
|
306
|
+
t24 = [fieldBaseClass, className, baseClass, t22, t23].filter(Boolean);
|
|
307
|
+
$[54] = className;
|
|
308
|
+
$[55] = t22;
|
|
309
|
+
$[56] = t23;
|
|
310
|
+
$[57] = t24;
|
|
311
|
+
} else {
|
|
312
|
+
t24 = $[57];
|
|
313
|
+
}
|
|
314
|
+
const t25 = t24.join(" ");
|
|
315
|
+
let t26;
|
|
316
|
+
if ($[58] !== activePathChildrenPath || $[59] !== activePathSchemaChildrenPath || $[60] !== activeTabConfig || $[61] !== activeTabIndex || $[62] !== activeTabInfo || $[63] !== activeTabPath || $[64] !== activeTabStaticDescription || $[65] !== forceRender || $[66] !== handleTabChange || $[67] !== indexPath || $[68] !== path || $[69] !== permissions || $[70] !== readOnly || $[71] !== t25 || $[72] !== tabStates) {
|
|
317
|
+
let t27;
|
|
318
|
+
if ($[74] !== activeTabIndex || $[75] !== handleTabChange || $[76] !== path) {
|
|
319
|
+
t27 = t28 => {
|
|
320
|
+
const {
|
|
321
|
+
index: index_0,
|
|
322
|
+
passesCondition: passesCondition_2,
|
|
323
|
+
tab: tab_0
|
|
324
|
+
} = t28;
|
|
325
|
+
return _jsx(TabComponent, {
|
|
326
|
+
hidden: !passesCondition_2,
|
|
327
|
+
isActive: activeTabIndex === index_0,
|
|
328
|
+
parentPath: path,
|
|
329
|
+
setIsActive: () => {
|
|
330
|
+
handleTabChange(index_0);
|
|
331
|
+
},
|
|
332
|
+
tab: tab_0
|
|
333
|
+
}, index_0);
|
|
334
|
+
};
|
|
335
|
+
$[74] = activeTabIndex;
|
|
336
|
+
$[75] = handleTabChange;
|
|
337
|
+
$[76] = path;
|
|
338
|
+
$[77] = t27;
|
|
271
339
|
} else {
|
|
272
|
-
|
|
340
|
+
t27 = $[77];
|
|
273
341
|
}
|
|
274
|
-
let
|
|
275
|
-
if ($[
|
|
276
|
-
|
|
342
|
+
let t28;
|
|
343
|
+
if ($[78] !== activePathChildrenPath || $[79] !== activePathSchemaChildrenPath || $[80] !== activeTabConfig || $[81] !== activeTabInfo || $[82] !== activeTabPath || $[83] !== activeTabStaticDescription || $[84] !== forceRender || $[85] !== indexPath || $[86] !== permissions || $[87] !== readOnly) {
|
|
344
|
+
t28 = activeTabConfig && _jsx(TabContent, {
|
|
277
345
|
description: activeTabStaticDescription,
|
|
278
346
|
fields: activeTabConfig.fields,
|
|
279
347
|
forceRender,
|
|
280
|
-
|
|
348
|
+
hidden: false,
|
|
349
|
+
parentIndexPath: tabHasName(activeTabConfig) ? "" : `${indexPath ? indexPath + "-" : ""}` + String(activeTabInfo.index),
|
|
281
350
|
parentPath: activePathChildrenPath,
|
|
282
351
|
parentSchemaPath: activePathSchemaChildrenPath,
|
|
283
352
|
path: activeTabPath,
|
|
284
353
|
permissions: permissions && typeof permissions === "object" && "name" in activeTabConfig ? permissions[activeTabConfig.name] && typeof permissions[activeTabConfig.name] === "object" && "fields" in permissions[activeTabConfig.name] ? permissions[activeTabConfig.name].fields : permissions[activeTabConfig.name] : permissions,
|
|
285
354
|
readOnly
|
|
286
355
|
});
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
356
|
+
$[78] = activePathChildrenPath;
|
|
357
|
+
$[79] = activePathSchemaChildrenPath;
|
|
358
|
+
$[80] = activeTabConfig;
|
|
359
|
+
$[81] = activeTabInfo;
|
|
360
|
+
$[82] = activeTabPath;
|
|
361
|
+
$[83] = activeTabStaticDescription;
|
|
362
|
+
$[84] = forceRender;
|
|
363
|
+
$[85] = indexPath;
|
|
364
|
+
$[86] = permissions;
|
|
365
|
+
$[87] = readOnly;
|
|
366
|
+
$[88] = t28;
|
|
298
367
|
} else {
|
|
299
|
-
|
|
368
|
+
t28 = $[88];
|
|
300
369
|
}
|
|
301
|
-
|
|
302
|
-
className:
|
|
370
|
+
t26 = _jsx("div", {
|
|
371
|
+
className: t25,
|
|
303
372
|
children: _jsxs(TabsProvider, {
|
|
304
373
|
children: [_jsx("div", {
|
|
305
374
|
className: `${baseClass}__tabs-wrap`,
|
|
306
375
|
children: _jsx("div", {
|
|
307
376
|
className: `${baseClass}__tabs`,
|
|
308
|
-
children:
|
|
377
|
+
children: tabStates.map(t27)
|
|
309
378
|
})
|
|
310
379
|
}), _jsx("div", {
|
|
311
380
|
className: `${baseClass}__content-wrap`,
|
|
312
|
-
children:
|
|
381
|
+
children: t28
|
|
313
382
|
})]
|
|
314
383
|
})
|
|
315
384
|
});
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
323
|
-
$[
|
|
324
|
-
$[
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
327
|
-
$[
|
|
328
|
-
$[
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
385
|
+
$[58] = activePathChildrenPath;
|
|
386
|
+
$[59] = activePathSchemaChildrenPath;
|
|
387
|
+
$[60] = activeTabConfig;
|
|
388
|
+
$[61] = activeTabIndex;
|
|
389
|
+
$[62] = activeTabInfo;
|
|
390
|
+
$[63] = activeTabPath;
|
|
391
|
+
$[64] = activeTabStaticDescription;
|
|
392
|
+
$[65] = forceRender;
|
|
393
|
+
$[66] = handleTabChange;
|
|
394
|
+
$[67] = indexPath;
|
|
395
|
+
$[68] = path;
|
|
396
|
+
$[69] = permissions;
|
|
397
|
+
$[70] = readOnly;
|
|
398
|
+
$[71] = t25;
|
|
399
|
+
$[72] = tabStates;
|
|
400
|
+
$[73] = t26;
|
|
331
401
|
} else {
|
|
332
|
-
|
|
402
|
+
t26 = $[73];
|
|
333
403
|
}
|
|
334
|
-
return
|
|
404
|
+
return t26;
|
|
335
405
|
};
|
|
336
406
|
export const TabsField = withCondition(TabsFieldComponent);
|
|
337
|
-
function
|
|
338
|
-
const $ = _c(
|
|
407
|
+
function TabContent(t0) {
|
|
408
|
+
const $ = _c(21);
|
|
339
409
|
const {
|
|
340
410
|
description,
|
|
341
411
|
fields,
|
|
342
412
|
forceRender,
|
|
413
|
+
hidden,
|
|
343
414
|
label,
|
|
344
415
|
parentIndexPath,
|
|
345
416
|
parentPath,
|
|
@@ -381,20 +452,22 @@ function ActiveTabContent(t0) {
|
|
|
381
452
|
if (Field) {
|
|
382
453
|
return Field;
|
|
383
454
|
}
|
|
384
|
-
const t4 =
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
455
|
+
const t4 = hidden && `${baseClass}__tab--hidden`;
|
|
456
|
+
const t5 = label && `${baseClass}__tabConfigLabel-${toKebabCase(getTranslation(label, i18n))}`;
|
|
457
|
+
let t6;
|
|
458
|
+
if ($[4] !== t4 || $[5] !== t5) {
|
|
459
|
+
t6 = [t4, `${baseClass}__tab`, t5].filter(Boolean);
|
|
388
460
|
$[4] = t4;
|
|
389
461
|
$[5] = t5;
|
|
462
|
+
$[6] = t6;
|
|
390
463
|
} else {
|
|
391
|
-
|
|
464
|
+
t6 = $[6];
|
|
392
465
|
}
|
|
393
|
-
const
|
|
394
|
-
let
|
|
395
|
-
if ($[
|
|
396
|
-
|
|
397
|
-
className:
|
|
466
|
+
const t7 = t6.join(" ");
|
|
467
|
+
let t8;
|
|
468
|
+
if ($[7] !== AfterInput || $[8] !== BeforeInput || $[9] !== Description || $[10] !== description || $[11] !== fields || $[12] !== forceRender || $[13] !== parentIndexPath || $[14] !== parentPath || $[15] !== parentSchemaPath || $[16] !== path || $[17] !== permissions || $[18] !== readOnly || $[19] !== t7) {
|
|
469
|
+
t8 = _jsxs("div", {
|
|
470
|
+
className: t7,
|
|
398
471
|
children: [_jsx(RenderCustomComponent, {
|
|
399
472
|
CustomComponent: Description,
|
|
400
473
|
Fallback: _jsx(FieldDescription, {
|
|
@@ -412,23 +485,41 @@ function ActiveTabContent(t0) {
|
|
|
412
485
|
readOnly
|
|
413
486
|
}), AfterInput]
|
|
414
487
|
});
|
|
415
|
-
$[
|
|
416
|
-
$[
|
|
417
|
-
$[
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
$[
|
|
423
|
-
$[
|
|
424
|
-
$[
|
|
425
|
-
$[
|
|
426
|
-
$[
|
|
427
|
-
$[18] = t6;
|
|
488
|
+
$[7] = AfterInput;
|
|
489
|
+
$[8] = BeforeInput;
|
|
490
|
+
$[9] = Description;
|
|
491
|
+
$[10] = description;
|
|
492
|
+
$[11] = fields;
|
|
493
|
+
$[12] = forceRender;
|
|
494
|
+
$[13] = parentIndexPath;
|
|
495
|
+
$[14] = parentPath;
|
|
496
|
+
$[15] = parentSchemaPath;
|
|
497
|
+
$[16] = path;
|
|
498
|
+
$[17] = permissions;
|
|
499
|
+
$[18] = readOnly;
|
|
428
500
|
$[19] = t7;
|
|
501
|
+
$[20] = t8;
|
|
429
502
|
} else {
|
|
430
|
-
|
|
503
|
+
t8 = $[20];
|
|
431
504
|
}
|
|
432
|
-
return
|
|
505
|
+
return t8;
|
|
506
|
+
}
|
|
507
|
+
function _temp(t0) {
|
|
508
|
+
const {
|
|
509
|
+
passesCondition
|
|
510
|
+
} = t0;
|
|
511
|
+
return passesCondition;
|
|
512
|
+
}
|
|
513
|
+
function _temp2(t0) {
|
|
514
|
+
const {
|
|
515
|
+
passesCondition: passesCondition_0
|
|
516
|
+
} = t0;
|
|
517
|
+
return passesCondition_0;
|
|
518
|
+
}
|
|
519
|
+
function _temp3(t0) {
|
|
520
|
+
const {
|
|
521
|
+
passesCondition: passesCondition_1
|
|
522
|
+
} = t0;
|
|
523
|
+
return passesCondition_1;
|
|
433
524
|
}
|
|
434
525
|
//# sourceMappingURL=index.js.map
|