formik-form-components 0.2.27 → 0.2.28
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/index.d.ts +64 -133
- package/dist/index.js +570 -575
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +539 -544
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var formik = require('formik');
|
|
4
|
-
var
|
|
4
|
+
var React4 = require('react');
|
|
5
5
|
var material = require('@mui/material');
|
|
6
6
|
var DatePicker = require('@mui/x-date-pickers/DatePicker');
|
|
7
7
|
var LocalizationProvider = require('@mui/x-date-pickers/LocalizationProvider');
|
|
@@ -12,11 +12,10 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
12
12
|
var DateTimePicker = require('@mui/x-date-pickers/DateTimePicker');
|
|
13
13
|
var Autocomplete3 = require('@mui/material/Autocomplete');
|
|
14
14
|
var Typography9 = require('@mui/material/Typography');
|
|
15
|
-
var react
|
|
16
|
-
var Select = require('@mui/material/Select');
|
|
15
|
+
var react = require('@iconify/react');
|
|
17
16
|
var PhoneInput = require('react-phone-number-input');
|
|
18
17
|
require('react-phone-number-input/style.css');
|
|
19
|
-
var react$
|
|
18
|
+
var react$1 = require('@tiptap/react');
|
|
20
19
|
var StarterKit = require('@tiptap/starter-kit');
|
|
21
20
|
var Link = require('@tiptap/extension-link');
|
|
22
21
|
var TextAlign = require('@tiptap/extension-text-align');
|
|
@@ -42,11 +41,11 @@ var reactI18next = require('react-i18next');
|
|
|
42
41
|
|
|
43
42
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
44
43
|
|
|
44
|
+
var React4__default = /*#__PURE__*/_interopDefault(React4);
|
|
45
45
|
var CalendarMonthIcon__default = /*#__PURE__*/_interopDefault(CalendarMonthIcon);
|
|
46
46
|
var _19__default = /*#__PURE__*/_interopDefault(_19);
|
|
47
47
|
var Autocomplete3__default = /*#__PURE__*/_interopDefault(Autocomplete3);
|
|
48
48
|
var Typography9__default = /*#__PURE__*/_interopDefault(Typography9);
|
|
49
|
-
var Select__default = /*#__PURE__*/_interopDefault(Select);
|
|
50
49
|
var PhoneInput__default = /*#__PURE__*/_interopDefault(PhoneInput);
|
|
51
50
|
var StarterKit__default = /*#__PURE__*/_interopDefault(StarterKit);
|
|
52
51
|
var Link__default = /*#__PURE__*/_interopDefault(Link);
|
|
@@ -67,7 +66,7 @@ var CloudUploadIcon__default = /*#__PURE__*/_interopDefault(CloudUploadIcon);
|
|
|
67
66
|
var CloseIcon__default = /*#__PURE__*/_interopDefault(CloseIcon);
|
|
68
67
|
|
|
69
68
|
// src/Form/index.tsx
|
|
70
|
-
var AppDatePicker =
|
|
69
|
+
var AppDatePicker = React4.forwardRef(
|
|
71
70
|
({
|
|
72
71
|
name,
|
|
73
72
|
label,
|
|
@@ -111,7 +110,7 @@ var AppDatePicker = react.forwardRef(
|
|
|
111
110
|
);
|
|
112
111
|
AppDatePicker.displayName = "AppDatePicker";
|
|
113
112
|
var AppDatePicker_default = AppDatePicker;
|
|
114
|
-
var AppDateAndTimePicker =
|
|
113
|
+
var AppDateAndTimePicker = React4.forwardRef((props, ref) => {
|
|
115
114
|
const {
|
|
116
115
|
name,
|
|
117
116
|
label,
|
|
@@ -368,7 +367,7 @@ function AppFormErrorMessage({
|
|
|
368
367
|
return null;
|
|
369
368
|
}
|
|
370
369
|
var AppFormErrorMessage_default = AppFormErrorMessage;
|
|
371
|
-
var AppTextArea =
|
|
370
|
+
var AppTextArea = React4.forwardRef(({
|
|
372
371
|
name,
|
|
373
372
|
label,
|
|
374
373
|
placeholder = "Enter text...",
|
|
@@ -574,7 +573,7 @@ function AppTagsCreator({
|
|
|
574
573
|
flexWrap: "wrap",
|
|
575
574
|
gap: 0.5,
|
|
576
575
|
...chipContainerSx
|
|
577
|
-
}, children: value == null ? void 0 : value.map((option, index) => /* @__PURE__ */
|
|
576
|
+
}, children: value == null ? void 0 : value.map((option, index) => /* @__PURE__ */ React4.createElement(
|
|
578
577
|
material.Chip,
|
|
579
578
|
{
|
|
580
579
|
variant: "outlined",
|
|
@@ -893,7 +892,7 @@ function AppAutoComplete({
|
|
|
893
892
|
id: "tags-filled",
|
|
894
893
|
options,
|
|
895
894
|
freeSolo: true,
|
|
896
|
-
renderTags: (value, getTagProps) => value.map((option, index) => /* @__PURE__ */
|
|
895
|
+
renderTags: (value, getTagProps) => value.map((option, index) => /* @__PURE__ */ React4.createElement(
|
|
897
896
|
material.Chip,
|
|
898
897
|
{
|
|
899
898
|
variant: "outlined",
|
|
@@ -971,7 +970,7 @@ function AppAutoCompleter({
|
|
|
971
970
|
onChange: (_20, newValue) => {
|
|
972
971
|
setFieldValue(name, newValue ? newValue.value : null);
|
|
973
972
|
},
|
|
974
|
-
renderOption: (props, option) => /* @__PURE__ */
|
|
973
|
+
renderOption: (props, option) => /* @__PURE__ */ React4.createElement(material.Box, { component: "li", ...props, key: option.value, sx: listboxSx }, option.label),
|
|
975
974
|
renderInput: (params) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
976
975
|
material.TextField,
|
|
977
976
|
{
|
|
@@ -1161,11 +1160,11 @@ var AppCheckBox = ({
|
|
|
1161
1160
|
);
|
|
1162
1161
|
};
|
|
1163
1162
|
var AppCheckBox_default = AppCheckBox;
|
|
1164
|
-
var Iconify =
|
|
1163
|
+
var Iconify = React4.forwardRef(({ icon, width = 20, color, sx, ...other }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1165
1164
|
material.Box,
|
|
1166
1165
|
{
|
|
1167
1166
|
ref,
|
|
1168
|
-
component: react
|
|
1167
|
+
component: react.Icon,
|
|
1169
1168
|
icon,
|
|
1170
1169
|
sx: { width, height: width, flexShrink: 0, color: color || "text.secondary", ...sx || {} },
|
|
1171
1170
|
...other
|
|
@@ -1185,7 +1184,7 @@ function AppInputField({
|
|
|
1185
1184
|
const { errors, getFieldProps, touched } = formik.useFormikContext();
|
|
1186
1185
|
const fieldError = _19__default.default.get(errors, name);
|
|
1187
1186
|
const isTouched = _19__default.default.get(touched, name);
|
|
1188
|
-
const [showPassword, setShowPassword] =
|
|
1187
|
+
const [showPassword, setShowPassword] = React4.useState(false);
|
|
1189
1188
|
const handleShowPassword = () => {
|
|
1190
1189
|
setShowPassword(!showPassword);
|
|
1191
1190
|
};
|
|
@@ -1243,282 +1242,323 @@ function AppInputField({
|
|
|
1243
1242
|
}
|
|
1244
1243
|
);
|
|
1245
1244
|
}
|
|
1246
|
-
var AppMultiSelector =
|
|
1245
|
+
var AppMultiSelector = React4.forwardRef(
|
|
1247
1246
|
({
|
|
1248
|
-
multiple = true,
|
|
1249
1247
|
name,
|
|
1250
1248
|
label,
|
|
1249
|
+
mode = "autocomplete",
|
|
1251
1250
|
options = [],
|
|
1252
1251
|
required = false,
|
|
1253
|
-
variant = "outlined",
|
|
1254
1252
|
disabled = false,
|
|
1255
1253
|
maxSelections,
|
|
1256
1254
|
showSelectedCount = true,
|
|
1257
|
-
showHelperText = false,
|
|
1258
1255
|
helperText,
|
|
1256
|
+
variant = "outlined",
|
|
1257
|
+
placeholder = "Select options...",
|
|
1258
|
+
onSearchChange,
|
|
1259
|
+
onChange: externalOnChange,
|
|
1260
|
+
onMaxSelectionsReached,
|
|
1259
1261
|
sx,
|
|
1260
1262
|
formControlSx,
|
|
1261
|
-
selectSx,
|
|
1262
1263
|
labelSx,
|
|
1263
1264
|
chipSx,
|
|
1264
1265
|
checkboxSx,
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
helperTextSx,
|
|
1268
|
-
iconSx,
|
|
1269
|
-
onChange: externalOnChange,
|
|
1270
|
-
onOpen,
|
|
1271
|
-
onClose,
|
|
1272
|
-
renderValue: externalRenderValue,
|
|
1273
|
-
renderMenuItem,
|
|
1274
|
-
...otherProps
|
|
1266
|
+
searchDebounce = 300,
|
|
1267
|
+
clearable = true
|
|
1275
1268
|
}, ref) => {
|
|
1276
1269
|
const theme = material.useTheme();
|
|
1277
|
-
const {
|
|
1270
|
+
const { values, setFieldValue, errors, touched, setFieldTouched } = formik.useFormikContext();
|
|
1278
1271
|
const fieldError = _19__default.default.get(errors, name);
|
|
1279
|
-
const isTouched = _19__default.default.get(touched, name);
|
|
1280
|
-
const
|
|
1281
|
-
const
|
|
1282
|
-
const
|
|
1283
|
-
|
|
1284
|
-
|
|
1272
|
+
const isTouched = Boolean(_19__default.default.get(touched, name));
|
|
1273
|
+
const hasError = Boolean(fieldError) && isTouched;
|
|
1274
|
+
const currentValue = _19__default.default.get(values, name);
|
|
1275
|
+
const selectedValues = Array.isArray(currentValue) ? currentValue : [];
|
|
1276
|
+
const selectedCount = selectedValues.length;
|
|
1277
|
+
const isMaxReached = maxSelections ? selectedCount >= maxSelections : false;
|
|
1278
|
+
const handleValueChange = (newValues) => {
|
|
1279
|
+
if (maxSelections && newValues.length > maxSelections) {
|
|
1280
|
+
if (onMaxSelectionsReached) {
|
|
1281
|
+
onMaxSelectionsReached(maxSelections);
|
|
1282
|
+
}
|
|
1285
1283
|
return;
|
|
1286
1284
|
}
|
|
1287
|
-
setFieldValue(name,
|
|
1285
|
+
setFieldValue(name, newValues, true);
|
|
1288
1286
|
if (externalOnChange) {
|
|
1289
|
-
externalOnChange(
|
|
1287
|
+
externalOnChange(newValues);
|
|
1290
1288
|
}
|
|
1291
1289
|
};
|
|
1292
1290
|
const handleBlur = () => {
|
|
1293
1291
|
setFieldTouched(name, true, true);
|
|
1294
1292
|
};
|
|
1295
|
-
const
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1293
|
+
const getSelectedOptions = () => {
|
|
1294
|
+
return options.filter((opt) => selectedValues.includes(opt.value));
|
|
1295
|
+
};
|
|
1296
|
+
if (mode === "autocomplete") {
|
|
1297
|
+
const debouncedSearch = React4__default.default.useRef();
|
|
1298
|
+
const handleSearchChange = (query) => {
|
|
1299
|
+
if (debouncedSearch.current) {
|
|
1300
|
+
clearTimeout(debouncedSearch.current);
|
|
1301
|
+
}
|
|
1302
|
+
debouncedSearch.current = setTimeout(() => {
|
|
1303
|
+
if (onSearchChange) {
|
|
1304
|
+
onSearchChange(query);
|
|
1305
|
+
}
|
|
1306
|
+
}, searchDebounce);
|
|
1307
|
+
};
|
|
1308
|
+
const filterOptions = (options2, { inputValue }) => {
|
|
1309
|
+
if (!inputValue)
|
|
1310
|
+
return options2;
|
|
1311
|
+
const inputValueLower = inputValue.toLowerCase();
|
|
1312
|
+
return options2.filter(
|
|
1313
|
+
(option) => {
|
|
1314
|
+
var _a, _b, _c;
|
|
1315
|
+
return option.label.toLowerCase().includes(inputValueLower) || String(option.value).toLowerCase().includes(inputValueLower) || ((_a = option.searchAbleValue1) == null ? void 0 : _a.toLowerCase().includes(inputValueLower)) || ((_b = option.searchAbleValue2) == null ? void 0 : _b.toLowerCase().includes(inputValueLower)) || ((_c = option.searchAbleValue3) == null ? void 0 : _c.toLowerCase().includes(inputValueLower));
|
|
1316
|
+
}
|
|
1317
|
+
);
|
|
1318
|
+
};
|
|
1319
|
+
const selectedOptions = getSelectedOptions();
|
|
1320
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { ref, sx, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1321
|
+
material.FormControl,
|
|
1322
|
+
{
|
|
1323
|
+
fullWidth: true,
|
|
1324
|
+
error: hasError,
|
|
1325
|
+
disabled,
|
|
1326
|
+
sx: formControlSx,
|
|
1327
|
+
children: [
|
|
1328
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1329
|
+
material.Autocomplete,
|
|
1330
|
+
{
|
|
1331
|
+
multiple: true,
|
|
1332
|
+
options,
|
|
1333
|
+
value: selectedOptions,
|
|
1334
|
+
onChange: (event, newValues) => {
|
|
1335
|
+
const values2 = newValues.map((opt) => opt.value);
|
|
1336
|
+
handleValueChange(values2);
|
|
1337
|
+
},
|
|
1338
|
+
onInputChange: (event, value, reason) => {
|
|
1339
|
+
if (reason === "input" && onSearchChange) {
|
|
1340
|
+
handleSearchChange(value);
|
|
1316
1341
|
}
|
|
1317
1342
|
},
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
checked: isSelected,
|
|
1351
|
-
disabled: option.disabled,
|
|
1352
|
-
sx: [
|
|
1353
|
-
{
|
|
1354
|
-
color: "text.secondary",
|
|
1355
|
-
"&.Mui-checked": {
|
|
1356
|
-
color: "primary.main"
|
|
1357
|
-
},
|
|
1358
|
-
...option.disabled && {
|
|
1359
|
-
color: "action.disabled"
|
|
1343
|
+
filterOptions,
|
|
1344
|
+
onBlur: handleBlur,
|
|
1345
|
+
disabled: disabled || isMaxReached,
|
|
1346
|
+
disableCloseOnSelect: true,
|
|
1347
|
+
clearOnBlur: false,
|
|
1348
|
+
clearOnEscape: true,
|
|
1349
|
+
disableClearable: !clearable,
|
|
1350
|
+
getOptionLabel: (option) => option.label,
|
|
1351
|
+
isOptionEqualToValue: (option, value) => option.value === value.value,
|
|
1352
|
+
getOptionDisabled: (option) => !!option.disabled,
|
|
1353
|
+
renderInput: (params) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1354
|
+
material.TextField,
|
|
1355
|
+
{
|
|
1356
|
+
...params,
|
|
1357
|
+
label: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1358
|
+
label,
|
|
1359
|
+
required && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1360
|
+
material.Typography,
|
|
1361
|
+
{
|
|
1362
|
+
sx: { color: "error.main" },
|
|
1363
|
+
component: "span",
|
|
1364
|
+
children: " *"
|
|
1365
|
+
}
|
|
1366
|
+
)
|
|
1367
|
+
] }),
|
|
1368
|
+
variant,
|
|
1369
|
+
placeholder,
|
|
1370
|
+
error: hasError,
|
|
1371
|
+
helperText: hasError ? fieldError : helperText,
|
|
1372
|
+
FormHelperTextProps: {
|
|
1373
|
+
sx: { mx: 0, mt: 0.5 }
|
|
1374
|
+
}
|
|
1360
1375
|
}
|
|
1376
|
+
),
|
|
1377
|
+
renderOption: (props, option, { selected }) => /* @__PURE__ */ jsxRuntime.jsxs("li", { ...props, children: [
|
|
1378
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1379
|
+
material.Checkbox,
|
|
1380
|
+
{
|
|
1381
|
+
checked: selected,
|
|
1382
|
+
disabled: option.disabled || isMaxReached && !selected,
|
|
1383
|
+
sx: checkboxSx
|
|
1384
|
+
}
|
|
1385
|
+
),
|
|
1386
|
+
option.icon,
|
|
1387
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1388
|
+
material.Typography,
|
|
1389
|
+
{
|
|
1390
|
+
variant: "body2",
|
|
1391
|
+
sx: {
|
|
1392
|
+
color: option.disabled ? "text.disabled" : "text.primary",
|
|
1393
|
+
...option.textSx
|
|
1394
|
+
},
|
|
1395
|
+
children: option.label
|
|
1396
|
+
}
|
|
1397
|
+
)
|
|
1398
|
+
] }),
|
|
1399
|
+
renderTags: (value, getTagProps) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1400
|
+
material.Box,
|
|
1401
|
+
{
|
|
1402
|
+
sx: { display: "flex", flexWrap: "wrap", gap: 0.5, mt: 0.5 },
|
|
1403
|
+
children: value.map((option, index) => /* @__PURE__ */ React4.createElement(
|
|
1404
|
+
material.Chip,
|
|
1405
|
+
{
|
|
1406
|
+
...getTagProps({ index }),
|
|
1407
|
+
key: option.value,
|
|
1408
|
+
label: option.label,
|
|
1409
|
+
disabled: disabled || option.disabled,
|
|
1410
|
+
sx: chipSx,
|
|
1411
|
+
onDelete: !disabled && !option.disabled ? () => {
|
|
1412
|
+
const newValues = selectedValues.filter(
|
|
1413
|
+
(v) => v !== option.value
|
|
1414
|
+
);
|
|
1415
|
+
handleValueChange(newValues);
|
|
1416
|
+
} : void 0
|
|
1417
|
+
}
|
|
1418
|
+
))
|
|
1419
|
+
}
|
|
1420
|
+
)
|
|
1421
|
+
}
|
|
1422
|
+
),
|
|
1423
|
+
showSelectedCount && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1424
|
+
material.Typography,
|
|
1425
|
+
{
|
|
1426
|
+
variant: "caption",
|
|
1427
|
+
sx: {
|
|
1428
|
+
mt: 0.5,
|
|
1429
|
+
color: isMaxReached ? "error.main" : "text.secondary"
|
|
1361
1430
|
},
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
material.Typography,
|
|
1368
|
-
{
|
|
1369
|
-
variant: "body2",
|
|
1370
|
-
sx: [
|
|
1371
|
-
{
|
|
1372
|
-
color: option.disabled ? "text.disabled" : "text.primary",
|
|
1373
|
-
...option.textSx
|
|
1374
|
-
}
|
|
1375
|
-
],
|
|
1376
|
-
children: option.label || String(option.value)
|
|
1377
|
-
}
|
|
1378
|
-
)
|
|
1379
|
-
]
|
|
1380
|
-
},
|
|
1381
|
-
option.value
|
|
1382
|
-
);
|
|
1383
|
-
const displayLabel = showSelectedCount && selectedValues.length > 0 ? `${label} (${selectedValues.length} selected)` : label;
|
|
1384
|
-
return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx, ref, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1385
|
-
material.FormControl,
|
|
1386
|
-
{
|
|
1387
|
-
fullWidth: true,
|
|
1388
|
-
variant,
|
|
1389
|
-
error: isTouched && Boolean(fieldError),
|
|
1390
|
-
disabled,
|
|
1391
|
-
sx: [
|
|
1392
|
-
{
|
|
1393
|
-
"& .MuiInputLabel-root": {
|
|
1394
|
-
"&.Mui-focused": {
|
|
1395
|
-
color: "primary.main"
|
|
1396
|
-
},
|
|
1397
|
-
"&.Mui-error": {
|
|
1398
|
-
color: "error.main"
|
|
1399
|
-
},
|
|
1400
|
-
"&.Mui-disabled": {
|
|
1401
|
-
color: "text.disabled"
|
|
1431
|
+
children: [
|
|
1432
|
+
selectedCount,
|
|
1433
|
+
" selected",
|
|
1434
|
+
maxSelections ? ` (max ${maxSelections})` : ""
|
|
1435
|
+
]
|
|
1402
1436
|
}
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1437
|
+
)
|
|
1438
|
+
]
|
|
1439
|
+
}
|
|
1440
|
+
) });
|
|
1441
|
+
}
|
|
1442
|
+
if (mode === "dropdown") {
|
|
1443
|
+
const handleSelectChange = (event) => {
|
|
1444
|
+
const {
|
|
1445
|
+
target: { value }
|
|
1446
|
+
} = event;
|
|
1447
|
+
const newValues = typeof value === "string" ? value.split(",") : value;
|
|
1448
|
+
handleValueChange(newValues);
|
|
1449
|
+
};
|
|
1450
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { ref, sx, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1451
|
+
material.FormControl,
|
|
1452
|
+
{
|
|
1453
|
+
fullWidth: true,
|
|
1454
|
+
variant,
|
|
1455
|
+
error: hasError,
|
|
1456
|
+
disabled,
|
|
1457
|
+
sx: formControlSx,
|
|
1458
|
+
children: [
|
|
1459
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1460
|
+
material.Typography,
|
|
1461
|
+
{
|
|
1462
|
+
variant: "body2",
|
|
1463
|
+
sx: {
|
|
1464
|
+
mb: 1,
|
|
1465
|
+
color: hasError ? "error.main" : "text.secondary",
|
|
1466
|
+
...labelSx
|
|
1467
|
+
},
|
|
1468
|
+
children: [
|
|
1469
|
+
label,
|
|
1470
|
+
required && /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { sx: { color: "error.main" }, component: "span", children: " *" })
|
|
1471
|
+
]
|
|
1472
|
+
}
|
|
1473
|
+
),
|
|
1474
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1475
|
+
material.Select,
|
|
1476
|
+
{
|
|
1477
|
+
multiple: true,
|
|
1478
|
+
value: selectedValues,
|
|
1479
|
+
onChange: handleSelectChange,
|
|
1480
|
+
onBlur: handleBlur,
|
|
1481
|
+
displayEmpty: true,
|
|
1482
|
+
renderValue: (selected) => {
|
|
1483
|
+
if (selected.length === 0) {
|
|
1484
|
+
return /* @__PURE__ */ jsxRuntime.jsx("em", { children: placeholder });
|
|
1420
1485
|
}
|
|
1486
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 0.5 }, children: selected.map((value) => {
|
|
1487
|
+
const option = options.find((opt) => opt.value === value);
|
|
1488
|
+
return option ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1489
|
+
material.Chip,
|
|
1490
|
+
{
|
|
1491
|
+
label: option.label,
|
|
1492
|
+
size: "small",
|
|
1493
|
+
sx: chipSx
|
|
1494
|
+
},
|
|
1495
|
+
value
|
|
1496
|
+
) : null;
|
|
1497
|
+
}) });
|
|
1421
1498
|
},
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
children: [
|
|
1425
|
-
displayLabel,
|
|
1426
|
-
required && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1427
|
-
material.Typography,
|
|
1428
|
-
{
|
|
1429
|
-
component: "span",
|
|
1499
|
+
MenuProps: {
|
|
1500
|
+
PaperProps: {
|
|
1430
1501
|
sx: {
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
children: "*"
|
|
1435
|
-
}
|
|
1436
|
-
)
|
|
1437
|
-
]
|
|
1438
|
-
}
|
|
1439
|
-
),
|
|
1440
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1441
|
-
Select__default.default,
|
|
1442
|
-
{
|
|
1443
|
-
multiple,
|
|
1444
|
-
variant: "outlined",
|
|
1445
|
-
labelId: label ? `select-${name}` : void 0,
|
|
1446
|
-
label: label || void 0,
|
|
1447
|
-
value: selectedValues,
|
|
1448
|
-
onChange: handleChange,
|
|
1449
|
-
onBlur: handleBlur,
|
|
1450
|
-
onOpen,
|
|
1451
|
-
onClose,
|
|
1452
|
-
renderValue: externalRenderValue || defaultRenderValue,
|
|
1453
|
-
MenuProps: {
|
|
1454
|
-
PaperProps: {
|
|
1455
|
-
sx: {
|
|
1456
|
-
mt: 1,
|
|
1457
|
-
boxShadow: theme.shadows[3],
|
|
1458
|
-
"& .MuiMenuItem-root": {
|
|
1459
|
-
px: 2,
|
|
1460
|
-
py: 1
|
|
1502
|
+
mt: 1,
|
|
1503
|
+
boxShadow: theme.shadows[3],
|
|
1504
|
+
maxHeight: 300
|
|
1461
1505
|
}
|
|
1462
1506
|
}
|
|
1463
|
-
}
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
}
|
|
1507
|
+
},
|
|
1508
|
+
children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1509
|
+
material.MenuItem,
|
|
1510
|
+
{
|
|
1511
|
+
value: option.value,
|
|
1512
|
+
disabled: option.disabled || isMaxReached && !selectedValues.includes(option.value),
|
|
1513
|
+
sx: option.sx,
|
|
1514
|
+
children: [
|
|
1515
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1516
|
+
material.Checkbox,
|
|
1517
|
+
{
|
|
1518
|
+
checked: selectedValues.includes(option.value),
|
|
1519
|
+
disabled: option.disabled,
|
|
1520
|
+
sx: checkboxSx
|
|
1521
|
+
}
|
|
1522
|
+
),
|
|
1523
|
+
option.icon,
|
|
1524
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1525
|
+
material.Typography,
|
|
1526
|
+
{
|
|
1527
|
+
variant: "body2",
|
|
1528
|
+
sx: {
|
|
1529
|
+
color: option.disabled ? "text.disabled" : "text.primary",
|
|
1530
|
+
...option.textSx
|
|
1531
|
+
},
|
|
1532
|
+
children: option.label
|
|
1533
|
+
}
|
|
1534
|
+
)
|
|
1535
|
+
]
|
|
1493
1536
|
},
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
),
|
|
1505
|
-
(showHelperText || isTouched && fieldError) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1506
|
-
material.FormHelperText,
|
|
1507
|
-
{
|
|
1508
|
-
sx: [
|
|
1509
|
-
{
|
|
1510
|
-
mx: 0,
|
|
1537
|
+
option.value
|
|
1538
|
+
))
|
|
1539
|
+
}
|
|
1540
|
+
),
|
|
1541
|
+
(helperText || hasError) && /* @__PURE__ */ jsxRuntime.jsx(material.FormHelperText, { error: hasError, sx: { mx: 0, mt: 0.5 }, children: hasError ? fieldError : helperText }),
|
|
1542
|
+
showSelectedCount && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1543
|
+
material.Typography,
|
|
1544
|
+
{
|
|
1545
|
+
variant: "caption",
|
|
1546
|
+
sx: {
|
|
1511
1547
|
mt: 0.5,
|
|
1512
|
-
color:
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1548
|
+
color: isMaxReached ? "error.main" : "text.secondary"
|
|
1549
|
+
},
|
|
1550
|
+
children: [
|
|
1551
|
+
selectedCount,
|
|
1552
|
+
" selected",
|
|
1553
|
+
maxSelections ? ` (max ${maxSelections})` : ""
|
|
1554
|
+
]
|
|
1555
|
+
}
|
|
1556
|
+
)
|
|
1557
|
+
]
|
|
1558
|
+
}
|
|
1559
|
+
) });
|
|
1560
|
+
}
|
|
1561
|
+
return null;
|
|
1522
1562
|
}
|
|
1523
1563
|
);
|
|
1524
1564
|
AppMultiSelector.displayName = "AppMultiSelector";
|
|
@@ -1538,8 +1578,8 @@ var AppPhoneNoInput = ({
|
|
|
1538
1578
|
withCountryCallingCode = true
|
|
1539
1579
|
}) => {
|
|
1540
1580
|
const { values, errors, touched, setFieldValue, setFieldTouched } = formik.useFormikContext();
|
|
1541
|
-
const fieldError =
|
|
1542
|
-
const isTouched =
|
|
1581
|
+
const fieldError = React4.useMemo(() => _19__default.default.get(errors, name), [errors, name]);
|
|
1582
|
+
const isTouched = React4.useMemo(() => _19__default.default.get(touched, name), [touched, name]);
|
|
1543
1583
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1544
1584
|
material.Box,
|
|
1545
1585
|
{
|
|
@@ -1630,7 +1670,7 @@ var AppPhoneNoInput = ({
|
|
|
1630
1670
|
);
|
|
1631
1671
|
};
|
|
1632
1672
|
var AppPhoneNoInput_default = AppPhoneNoInput;
|
|
1633
|
-
var AppRadioGroup =
|
|
1673
|
+
var AppRadioGroup = React4.forwardRef(({
|
|
1634
1674
|
name,
|
|
1635
1675
|
options = [],
|
|
1636
1676
|
label,
|
|
@@ -1790,7 +1830,7 @@ var AppRadioGroup = react.forwardRef(({
|
|
|
1790
1830
|
});
|
|
1791
1831
|
AppRadioGroup.displayName = "AppRadioGroup";
|
|
1792
1832
|
var AppRadioGroup_default = AppRadioGroup;
|
|
1793
|
-
var AppRating =
|
|
1833
|
+
var AppRating = React4.forwardRef(
|
|
1794
1834
|
({
|
|
1795
1835
|
name,
|
|
1796
1836
|
label,
|
|
@@ -2177,7 +2217,7 @@ function findDiffEnd(a, b, posA, posB) {
|
|
|
2177
2217
|
posB -= size;
|
|
2178
2218
|
}
|
|
2179
2219
|
}
|
|
2180
|
-
var
|
|
2220
|
+
var Fragment3 = class {
|
|
2181
2221
|
/**
|
|
2182
2222
|
@internal
|
|
2183
2223
|
*/
|
|
@@ -2245,7 +2285,7 @@ var Fragment2 = class {
|
|
|
2245
2285
|
}
|
|
2246
2286
|
for (; i < other.content.length; i++)
|
|
2247
2287
|
content.push(other.content[i]);
|
|
2248
|
-
return new
|
|
2288
|
+
return new Fragment3(content, this.size + other.size);
|
|
2249
2289
|
}
|
|
2250
2290
|
/**
|
|
2251
2291
|
Cut out the sub-fragment between the two given positions.
|
|
@@ -2269,17 +2309,17 @@ var Fragment2 = class {
|
|
|
2269
2309
|
}
|
|
2270
2310
|
pos = end;
|
|
2271
2311
|
}
|
|
2272
|
-
return new
|
|
2312
|
+
return new Fragment3(result, size);
|
|
2273
2313
|
}
|
|
2274
2314
|
/**
|
|
2275
2315
|
@internal
|
|
2276
2316
|
*/
|
|
2277
2317
|
cutByIndex(from, to) {
|
|
2278
2318
|
if (from == to)
|
|
2279
|
-
return
|
|
2319
|
+
return Fragment3.empty;
|
|
2280
2320
|
if (from == 0 && to == this.content.length)
|
|
2281
2321
|
return this;
|
|
2282
|
-
return new
|
|
2322
|
+
return new Fragment3(this.content.slice(from, to));
|
|
2283
2323
|
}
|
|
2284
2324
|
/**
|
|
2285
2325
|
Create a new fragment in which the node at the given index is
|
|
@@ -2292,21 +2332,21 @@ var Fragment2 = class {
|
|
|
2292
2332
|
let copy2 = this.content.slice();
|
|
2293
2333
|
let size = this.size + node.nodeSize - current.nodeSize;
|
|
2294
2334
|
copy2[index] = node;
|
|
2295
|
-
return new
|
|
2335
|
+
return new Fragment3(copy2, size);
|
|
2296
2336
|
}
|
|
2297
2337
|
/**
|
|
2298
2338
|
Create a new fragment by prepending the given node to this
|
|
2299
2339
|
fragment.
|
|
2300
2340
|
*/
|
|
2301
2341
|
addToStart(node) {
|
|
2302
|
-
return new
|
|
2342
|
+
return new Fragment3([node].concat(this.content), this.size + node.nodeSize);
|
|
2303
2343
|
}
|
|
2304
2344
|
/**
|
|
2305
2345
|
Create a new fragment by appending the given node to this
|
|
2306
2346
|
fragment.
|
|
2307
2347
|
*/
|
|
2308
2348
|
addToEnd(node) {
|
|
2309
|
-
return new
|
|
2349
|
+
return new Fragment3(this.content.concat(node), this.size + node.nodeSize);
|
|
2310
2350
|
}
|
|
2311
2351
|
/**
|
|
2312
2352
|
Compare this fragment to another one.
|
|
@@ -2425,10 +2465,10 @@ var Fragment2 = class {
|
|
|
2425
2465
|
*/
|
|
2426
2466
|
static fromJSON(schema, value) {
|
|
2427
2467
|
if (!value)
|
|
2428
|
-
return
|
|
2468
|
+
return Fragment3.empty;
|
|
2429
2469
|
if (!Array.isArray(value))
|
|
2430
2470
|
throw new RangeError("Invalid input for Fragment.fromJSON");
|
|
2431
|
-
return new
|
|
2471
|
+
return new Fragment3(value.map(schema.nodeFromJSON));
|
|
2432
2472
|
}
|
|
2433
2473
|
/**
|
|
2434
2474
|
Build a fragment from an array of nodes. Ensures that adjacent
|
|
@@ -2436,7 +2476,7 @@ var Fragment2 = class {
|
|
|
2436
2476
|
*/
|
|
2437
2477
|
static fromArray(array) {
|
|
2438
2478
|
if (!array.length)
|
|
2439
|
-
return
|
|
2479
|
+
return Fragment3.empty;
|
|
2440
2480
|
let joined, size = 0;
|
|
2441
2481
|
for (let i = 0; i < array.length; i++) {
|
|
2442
2482
|
let node = array[i];
|
|
@@ -2449,7 +2489,7 @@ var Fragment2 = class {
|
|
|
2449
2489
|
joined.push(node);
|
|
2450
2490
|
}
|
|
2451
2491
|
}
|
|
2452
|
-
return new
|
|
2492
|
+
return new Fragment3(joined || array, size);
|
|
2453
2493
|
}
|
|
2454
2494
|
/**
|
|
2455
2495
|
Create a fragment from something that can be interpreted as a
|
|
@@ -2459,17 +2499,17 @@ var Fragment2 = class {
|
|
|
2459
2499
|
*/
|
|
2460
2500
|
static from(nodes) {
|
|
2461
2501
|
if (!nodes)
|
|
2462
|
-
return
|
|
2463
|
-
if (nodes instanceof
|
|
2502
|
+
return Fragment3.empty;
|
|
2503
|
+
if (nodes instanceof Fragment3)
|
|
2464
2504
|
return nodes;
|
|
2465
2505
|
if (Array.isArray(nodes))
|
|
2466
2506
|
return this.fromArray(nodes);
|
|
2467
2507
|
if (nodes.attrs)
|
|
2468
|
-
return new
|
|
2508
|
+
return new Fragment3([nodes], nodes.nodeSize);
|
|
2469
2509
|
throw new RangeError("Can not convert " + nodes + " to a Fragment" + (nodes.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
|
|
2470
2510
|
}
|
|
2471
2511
|
};
|
|
2472
|
-
|
|
2512
|
+
Fragment3.empty = new Fragment3([], 0);
|
|
2473
2513
|
var found = { index: 0, offset: 0 };
|
|
2474
2514
|
function retIndex(index, offset) {
|
|
2475
2515
|
found.index = index;
|
|
@@ -2694,7 +2734,7 @@ var Slice = class {
|
|
|
2694
2734
|
let openStart = json.openStart || 0, openEnd = json.openEnd || 0;
|
|
2695
2735
|
if (typeof openStart != "number" || typeof openEnd != "number")
|
|
2696
2736
|
throw new RangeError("Invalid input for Slice.fromJSON");
|
|
2697
|
-
return new Slice(
|
|
2737
|
+
return new Slice(Fragment3.fromJSON(schema, json.content), openStart, openEnd);
|
|
2698
2738
|
}
|
|
2699
2739
|
/**
|
|
2700
2740
|
Create a slice from a fragment by taking the maximum possible
|
|
@@ -2709,7 +2749,7 @@ var Slice = class {
|
|
|
2709
2749
|
return new Slice(fragment, openStart, openEnd);
|
|
2710
2750
|
}
|
|
2711
2751
|
};
|
|
2712
|
-
Slice.empty = new Slice(
|
|
2752
|
+
Slice.empty = new Slice(Fragment3.empty, 0, 0);
|
|
2713
2753
|
function removeRange(content, from, to) {
|
|
2714
2754
|
let { index, offset } = content.findIndex(from), child = content.maybeChild(index);
|
|
2715
2755
|
let { index: indexTo, offset: offsetTo } = content.findIndex(to);
|
|
@@ -2807,7 +2847,7 @@ function replaceThreeWay($from, $start, $end, $to, depth) {
|
|
|
2807
2847
|
addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);
|
|
2808
2848
|
}
|
|
2809
2849
|
addRange($to, null, depth, content);
|
|
2810
|
-
return new
|
|
2850
|
+
return new Fragment3(content);
|
|
2811
2851
|
}
|
|
2812
2852
|
function replaceTwoWay($from, $to, depth) {
|
|
2813
2853
|
let content = [];
|
|
@@ -2817,13 +2857,13 @@ function replaceTwoWay($from, $to, depth) {
|
|
|
2817
2857
|
addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);
|
|
2818
2858
|
}
|
|
2819
2859
|
addRange($to, null, depth, content);
|
|
2820
|
-
return new
|
|
2860
|
+
return new Fragment3(content);
|
|
2821
2861
|
}
|
|
2822
2862
|
function prepareSliceForReplace(slice, $along) {
|
|
2823
2863
|
let extra = $along.depth - slice.openStart, parent = $along.node(extra);
|
|
2824
2864
|
let node = parent.copy(slice.content);
|
|
2825
2865
|
for (let i = extra - 1; i >= 0; i--)
|
|
2826
|
-
node = $along.node(i).copy(
|
|
2866
|
+
node = $along.node(i).copy(Fragment3.from(node));
|
|
2827
2867
|
return {
|
|
2828
2868
|
start: node.resolveNoCache(slice.openStart + extra),
|
|
2829
2869
|
end: node.resolveNoCache(node.content.size - slice.openEnd - extra)
|
|
@@ -3162,7 +3202,7 @@ var Node = class {
|
|
|
3162
3202
|
this.type = type;
|
|
3163
3203
|
this.attrs = attrs;
|
|
3164
3204
|
this.marks = marks;
|
|
3165
|
-
this.content = content ||
|
|
3205
|
+
this.content = content || Fragment3.empty;
|
|
3166
3206
|
}
|
|
3167
3207
|
/**
|
|
3168
3208
|
The array of this node's child nodes.
|
|
@@ -3467,7 +3507,7 @@ var Node = class {
|
|
|
3467
3507
|
can optionally pass `start` and `end` indices into the
|
|
3468
3508
|
replacement fragment.
|
|
3469
3509
|
*/
|
|
3470
|
-
canReplace(from, to, replacement =
|
|
3510
|
+
canReplace(from, to, replacement = Fragment3.empty, start = 0, end = replacement.childCount) {
|
|
3471
3511
|
let one = this.contentMatchAt(from).matchFragment(replacement, start, end);
|
|
3472
3512
|
let two = one && one.matchFragment(this.content, to);
|
|
3473
3513
|
if (!two || !two.validEnd)
|
|
@@ -3549,7 +3589,7 @@ var Node = class {
|
|
|
3549
3589
|
throw new RangeError("Invalid text node in JSON");
|
|
3550
3590
|
return schema.text(json.text, marks);
|
|
3551
3591
|
}
|
|
3552
|
-
let content =
|
|
3592
|
+
let content = Fragment3.fromJSON(schema, json.content);
|
|
3553
3593
|
let node = schema.nodeType(json.type).create(json.attrs, content, marks);
|
|
3554
3594
|
node.type.checkAttrs(node.attrs);
|
|
3555
3595
|
return node;
|
|
@@ -3691,7 +3731,7 @@ var ContentMatch = class {
|
|
|
3691
3731
|
function search(match, types) {
|
|
3692
3732
|
let finished = match.matchFragment(after, startIndex);
|
|
3693
3733
|
if (finished && (!toEnd || finished.validEnd))
|
|
3694
|
-
return
|
|
3734
|
+
return Fragment3.from(types.map((tp) => tp.createAndFill()));
|
|
3695
3735
|
for (let i = 0; i < match.next.length; i++) {
|
|
3696
3736
|
let { type, next } = match.next[i];
|
|
3697
3737
|
if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {
|
|
@@ -4143,7 +4183,7 @@ var NodeType = class {
|
|
|
4143
4183
|
create(attrs = null, content, marks) {
|
|
4144
4184
|
if (this.isText)
|
|
4145
4185
|
throw new Error("NodeType.create can't construct text nodes");
|
|
4146
|
-
return new Node(this, this.computeAttrs(attrs),
|
|
4186
|
+
return new Node(this, this.computeAttrs(attrs), Fragment3.from(content), Mark.setFrom(marks));
|
|
4147
4187
|
}
|
|
4148
4188
|
/**
|
|
4149
4189
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
|
|
@@ -4151,7 +4191,7 @@ var NodeType = class {
|
|
|
4151
4191
|
if it doesn't match.
|
|
4152
4192
|
*/
|
|
4153
4193
|
createChecked(attrs = null, content, marks) {
|
|
4154
|
-
content =
|
|
4194
|
+
content = Fragment3.from(content);
|
|
4155
4195
|
this.checkContent(content);
|
|
4156
4196
|
return new Node(this, this.computeAttrs(attrs), content, Mark.setFrom(marks));
|
|
4157
4197
|
}
|
|
@@ -4165,7 +4205,7 @@ var NodeType = class {
|
|
|
4165
4205
|
*/
|
|
4166
4206
|
createAndFill(attrs = null, content, marks) {
|
|
4167
4207
|
attrs = this.computeAttrs(attrs);
|
|
4168
|
-
content =
|
|
4208
|
+
content = Fragment3.from(content);
|
|
4169
4209
|
if (content.size) {
|
|
4170
4210
|
let before = this.contentMatch.fillBefore(content);
|
|
4171
4211
|
if (!before)
|
|
@@ -4173,7 +4213,7 @@ var NodeType = class {
|
|
|
4173
4213
|
content = before.append(content);
|
|
4174
4214
|
}
|
|
4175
4215
|
let matched = this.contentMatch.matchFragment(content);
|
|
4176
|
-
let after = matched && matched.fillBefore(
|
|
4216
|
+
let after = matched && matched.fillBefore(Fragment3.empty, true);
|
|
4177
4217
|
if (!after)
|
|
4178
4218
|
return null;
|
|
4179
4219
|
return new Node(this, attrs, content.append(after), Mark.setFrom(marks));
|
|
@@ -4637,7 +4677,7 @@ var NodeContext = class {
|
|
|
4637
4677
|
if (!this.match) {
|
|
4638
4678
|
if (!this.type)
|
|
4639
4679
|
return [];
|
|
4640
|
-
let fill = this.type.contentMatch.fillBefore(
|
|
4680
|
+
let fill = this.type.contentMatch.fillBefore(Fragment3.from(node));
|
|
4641
4681
|
if (fill) {
|
|
4642
4682
|
this.match = this.type.contentMatch.matchFragment(fill);
|
|
4643
4683
|
} else {
|
|
@@ -4663,9 +4703,9 @@ var NodeContext = class {
|
|
|
4663
4703
|
this.content[this.content.length - 1] = text.withText(text.text.slice(0, text.text.length - m2[0].length));
|
|
4664
4704
|
}
|
|
4665
4705
|
}
|
|
4666
|
-
let content =
|
|
4706
|
+
let content = Fragment3.from(this.content);
|
|
4667
4707
|
if (!openEnd && this.match)
|
|
4668
|
-
content = content.append(this.match.fillBefore(
|
|
4708
|
+
content = content.append(this.match.fillBefore(Fragment3.empty, true));
|
|
4669
4709
|
return this.type ? this.type.create(this.attrs, content, this.marks) : content;
|
|
4670
4710
|
}
|
|
4671
4711
|
inlineContext(node) {
|
|
@@ -5482,7 +5522,7 @@ function mapFragment(fragment, f, parent) {
|
|
|
5482
5522
|
child = f(child, parent, i);
|
|
5483
5523
|
mapped.push(child);
|
|
5484
5524
|
}
|
|
5485
|
-
return
|
|
5525
|
+
return Fragment3.fromArray(mapped);
|
|
5486
5526
|
}
|
|
5487
5527
|
var AddMarkStep = class extends Step {
|
|
5488
5528
|
/**
|
|
@@ -5599,7 +5639,7 @@ var AddNodeMarkStep = class extends Step {
|
|
|
5599
5639
|
if (!node)
|
|
5600
5640
|
return StepResult.fail("No node at mark step's position");
|
|
5601
5641
|
let updated = node.type.create(node.attrs, null, this.mark.addToSet(node.marks));
|
|
5602
|
-
return StepResult.fromReplace(doc2, this.pos, this.pos + 1, new Slice(
|
|
5642
|
+
return StepResult.fromReplace(doc2, this.pos, this.pos + 1, new Slice(Fragment3.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
5603
5643
|
}
|
|
5604
5644
|
invert(doc2) {
|
|
5605
5645
|
let node = doc2.nodeAt(this.pos);
|
|
@@ -5645,7 +5685,7 @@ var RemoveNodeMarkStep = class extends Step {
|
|
|
5645
5685
|
if (!node)
|
|
5646
5686
|
return StepResult.fail("No node at mark step's position");
|
|
5647
5687
|
let updated = node.type.create(node.attrs, null, this.mark.removeFromSet(node.marks));
|
|
5648
|
-
return StepResult.fromReplace(doc2, this.pos, this.pos + 1, new Slice(
|
|
5688
|
+
return StepResult.fromReplace(doc2, this.pos, this.pos + 1, new Slice(Fragment3.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
5649
5689
|
}
|
|
5650
5690
|
invert(doc2) {
|
|
5651
5691
|
let node = doc2.nodeAt(this.pos);
|
|
@@ -5910,7 +5950,7 @@ function clearIncompatible(tr, pos, parentType, match = parentType.contentMatch,
|
|
|
5910
5950
|
let m2, newline = /\r?\n|\r/g, slice;
|
|
5911
5951
|
while (m2 = newline.exec(child.text)) {
|
|
5912
5952
|
if (!slice)
|
|
5913
|
-
slice = new Slice(
|
|
5953
|
+
slice = new Slice(Fragment3.from(parentType.schema.text(" ", parentType.allowedMarks(child.marks))), 0, 0);
|
|
5914
5954
|
replSteps.push(new ReplaceStep(cur + m2.index, cur + m2.index + m2[0].length, slice));
|
|
5915
5955
|
}
|
|
5916
5956
|
}
|
|
@@ -5918,7 +5958,7 @@ function clearIncompatible(tr, pos, parentType, match = parentType.contentMatch,
|
|
|
5918
5958
|
cur = end;
|
|
5919
5959
|
}
|
|
5920
5960
|
if (!match.validEnd) {
|
|
5921
|
-
let fill = match.fillBefore(
|
|
5961
|
+
let fill = match.fillBefore(Fragment3.empty, true);
|
|
5922
5962
|
tr.replace(cur, cur, new Slice(fill, 0, 0));
|
|
5923
5963
|
}
|
|
5924
5964
|
for (let i = replSteps.length - 1; i >= 0; i--)
|
|
@@ -5948,20 +5988,20 @@ function lift(tr, range, target) {
|
|
|
5948
5988
|
let { $from, $to, depth } = range;
|
|
5949
5989
|
let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);
|
|
5950
5990
|
let start = gapStart, end = gapEnd;
|
|
5951
|
-
let before =
|
|
5991
|
+
let before = Fragment3.empty, openStart = 0;
|
|
5952
5992
|
for (let d = depth, splitting = false; d > target; d--)
|
|
5953
5993
|
if (splitting || $from.index(d) > 0) {
|
|
5954
5994
|
splitting = true;
|
|
5955
|
-
before =
|
|
5995
|
+
before = Fragment3.from($from.node(d).copy(before));
|
|
5956
5996
|
openStart++;
|
|
5957
5997
|
} else {
|
|
5958
5998
|
start--;
|
|
5959
5999
|
}
|
|
5960
|
-
let after =
|
|
6000
|
+
let after = Fragment3.empty, openEnd = 0;
|
|
5961
6001
|
for (let d = depth, splitting = false; d > target; d--)
|
|
5962
6002
|
if (splitting || $to.after(d + 1) < $to.end(d)) {
|
|
5963
6003
|
splitting = true;
|
|
5964
|
-
after =
|
|
6004
|
+
after = Fragment3.from($to.node(d).copy(after));
|
|
5965
6005
|
openEnd++;
|
|
5966
6006
|
} else {
|
|
5967
6007
|
end++;
|
|
@@ -6001,14 +6041,14 @@ function findWrappingInside(range, type) {
|
|
|
6001
6041
|
return inside;
|
|
6002
6042
|
}
|
|
6003
6043
|
function wrap(tr, range, wrappers) {
|
|
6004
|
-
let content =
|
|
6044
|
+
let content = Fragment3.empty;
|
|
6005
6045
|
for (let i = wrappers.length - 1; i >= 0; i--) {
|
|
6006
6046
|
if (content.size) {
|
|
6007
6047
|
let match = wrappers[i].type.contentMatch.matchFragment(content);
|
|
6008
6048
|
if (!match || !match.validEnd)
|
|
6009
6049
|
throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
|
|
6010
6050
|
}
|
|
6011
|
-
content =
|
|
6051
|
+
content = Fragment3.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
6012
6052
|
}
|
|
6013
6053
|
let start = range.start, end = range.end;
|
|
6014
6054
|
tr.step(new ReplaceAroundStep(start, end, start, end, new Slice(content, 0, 0), wrappers.length, true));
|
|
@@ -6033,7 +6073,7 @@ function setBlockType(tr, from, to, type, attrs) {
|
|
|
6033
6073
|
clearIncompatible(tr, tr.mapping.slice(mapFrom).map(pos, 1), type, void 0, convertNewlines === null);
|
|
6034
6074
|
let mapping = tr.mapping.slice(mapFrom);
|
|
6035
6075
|
let startM = mapping.map(pos, 1), endM = mapping.map(pos + node.nodeSize, 1);
|
|
6036
|
-
tr.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(
|
|
6076
|
+
tr.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment3.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));
|
|
6037
6077
|
if (convertNewlines === true)
|
|
6038
6078
|
replaceNewlines(tr, node, pos, mapFrom);
|
|
6039
6079
|
return false;
|
|
@@ -6074,7 +6114,7 @@ function setNodeMarkup(tr, pos, type, attrs, marks) {
|
|
|
6074
6114
|
return tr.replaceWith(pos, pos + node.nodeSize, newNode);
|
|
6075
6115
|
if (!type.validContent(node.content))
|
|
6076
6116
|
throw new RangeError("Invalid content for node type " + type.name);
|
|
6077
|
-
tr.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(
|
|
6117
|
+
tr.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment3.from(newNode), 0, 0), 1, true));
|
|
6078
6118
|
}
|
|
6079
6119
|
function canSplit(doc2, pos, depth = 1, typesAfter) {
|
|
6080
6120
|
let $pos = doc2.resolve(pos), base2 = $pos.depth - depth;
|
|
@@ -6098,11 +6138,11 @@ function canSplit(doc2, pos, depth = 1, typesAfter) {
|
|
|
6098
6138
|
return $pos.node(base2).canReplaceWith(index, index, baseType ? baseType.type : $pos.node(base2 + 1).type);
|
|
6099
6139
|
}
|
|
6100
6140
|
function split(tr, pos, depth = 1, typesAfter) {
|
|
6101
|
-
let $pos = tr.doc.resolve(pos), before =
|
|
6141
|
+
let $pos = tr.doc.resolve(pos), before = Fragment3.empty, after = Fragment3.empty;
|
|
6102
6142
|
for (let d = $pos.depth, e = $pos.depth - depth, i = depth - 1; d > e; d--, i--) {
|
|
6103
|
-
before =
|
|
6143
|
+
before = Fragment3.from($pos.node(d).copy(before));
|
|
6104
6144
|
let typeAfter = typesAfter && typesAfter[i];
|
|
6105
|
-
after =
|
|
6145
|
+
after = Fragment3.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
|
|
6106
6146
|
}
|
|
6107
6147
|
tr.step(new ReplaceStep(pos, pos, new Slice(before.append(after), depth, depth), true));
|
|
6108
6148
|
}
|
|
@@ -6217,7 +6257,7 @@ var Fitter = class {
|
|
|
6217
6257
|
this.$to = $to;
|
|
6218
6258
|
this.unplaced = unplaced;
|
|
6219
6259
|
this.frontier = [];
|
|
6220
|
-
this.placed =
|
|
6260
|
+
this.placed = Fragment3.empty;
|
|
6221
6261
|
for (let i = 0; i <= $from.depth; i++) {
|
|
6222
6262
|
let node = $from.node(i);
|
|
6223
6263
|
this.frontier.push({
|
|
@@ -6226,7 +6266,7 @@ var Fitter = class {
|
|
|
6226
6266
|
});
|
|
6227
6267
|
}
|
|
6228
6268
|
for (let i = $from.depth; i > 0; i--)
|
|
6229
|
-
this.placed =
|
|
6269
|
+
this.placed = Fragment3.from($from.node(i).copy(this.placed));
|
|
6230
6270
|
}
|
|
6231
6271
|
get depth() {
|
|
6232
6272
|
return this.frontier.length - 1;
|
|
@@ -6283,7 +6323,7 @@ var Fitter = class {
|
|
|
6283
6323
|
let first2 = fragment.firstChild;
|
|
6284
6324
|
for (let frontierDepth = this.depth; frontierDepth >= 0; frontierDepth--) {
|
|
6285
6325
|
let { type, match } = this.frontier[frontierDepth], wrap2, inject = null;
|
|
6286
|
-
if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(
|
|
6326
|
+
if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(Fragment3.from(first2), false)) : parent && type.compatibleContent(parent.type)))
|
|
6287
6327
|
return { sliceDepth, frontierDepth, parent, inject };
|
|
6288
6328
|
else if (pass == 2 && first2 && (wrap2 = match.findWrapping(first2.type)))
|
|
6289
6329
|
return { sliceDepth, frontierDepth, parent, wrap: wrap2 };
|
|
@@ -6343,7 +6383,7 @@ var Fitter = class {
|
|
|
6343
6383
|
let toEnd = taken == fragment.childCount;
|
|
6344
6384
|
if (!toEnd)
|
|
6345
6385
|
openEndCount = -1;
|
|
6346
|
-
this.placed = addToFragment(this.placed, frontierDepth,
|
|
6386
|
+
this.placed = addToFragment(this.placed, frontierDepth, Fragment3.from(add));
|
|
6347
6387
|
this.frontier[frontierDepth].match = match;
|
|
6348
6388
|
if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1)
|
|
6349
6389
|
this.closeFrontierNode();
|
|
@@ -6400,12 +6440,12 @@ var Fitter = class {
|
|
|
6400
6440
|
openFrontierNode(type, attrs = null, content) {
|
|
6401
6441
|
let top = this.frontier[this.depth];
|
|
6402
6442
|
top.match = top.match.matchType(type);
|
|
6403
|
-
this.placed = addToFragment(this.placed, this.depth,
|
|
6443
|
+
this.placed = addToFragment(this.placed, this.depth, Fragment3.from(type.create(attrs, content)));
|
|
6404
6444
|
this.frontier.push({ type, match: type.contentMatch });
|
|
6405
6445
|
}
|
|
6406
6446
|
closeFrontierNode() {
|
|
6407
6447
|
let open = this.frontier.pop();
|
|
6408
|
-
let add = open.match.fillBefore(
|
|
6448
|
+
let add = open.match.fillBefore(Fragment3.empty, true);
|
|
6409
6449
|
if (add.childCount)
|
|
6410
6450
|
this.placed = addToFragment(this.placed, this.frontier.length, add);
|
|
6411
6451
|
}
|
|
@@ -6434,7 +6474,7 @@ function closeNodeStart(node, openStart, openEnd) {
|
|
|
6434
6474
|
if (openStart > 0) {
|
|
6435
6475
|
frag = node.type.contentMatch.fillBefore(frag).append(frag);
|
|
6436
6476
|
if (openEnd <= 0)
|
|
6437
|
-
frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(
|
|
6477
|
+
frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment3.empty, true));
|
|
6438
6478
|
}
|
|
6439
6479
|
return node.copy(frag);
|
|
6440
6480
|
}
|
|
@@ -6526,7 +6566,7 @@ function closeFragment(fragment, depth, oldOpen, newOpen, parent) {
|
|
|
6526
6566
|
if (depth > newOpen) {
|
|
6527
6567
|
let match = parent.contentMatchAt(0);
|
|
6528
6568
|
let start = match.fillBefore(fragment).append(fragment);
|
|
6529
|
-
fragment = start.append(match.matchFragment(start).fillBefore(
|
|
6569
|
+
fragment = start.append(match.matchFragment(start).fillBefore(Fragment3.empty, true));
|
|
6530
6570
|
}
|
|
6531
6571
|
return fragment;
|
|
6532
6572
|
}
|
|
@@ -6536,7 +6576,7 @@ function replaceRangeWith(tr, from, to, node) {
|
|
|
6536
6576
|
if (point != null)
|
|
6537
6577
|
from = to = point;
|
|
6538
6578
|
}
|
|
6539
|
-
tr.replaceRange(from, to, new Slice(
|
|
6579
|
+
tr.replaceRange(from, to, new Slice(Fragment3.from(node), 0, 0));
|
|
6540
6580
|
}
|
|
6541
6581
|
function deleteRange(tr, from, to) {
|
|
6542
6582
|
let $from = tr.doc.resolve(from), $to = tr.doc.resolve(to);
|
|
@@ -6584,7 +6624,7 @@ var AttrStep = class extends Step {
|
|
|
6584
6624
|
attrs[name] = node.attrs[name];
|
|
6585
6625
|
attrs[this.attr] = this.value;
|
|
6586
6626
|
let updated = node.type.create(attrs, null, node.marks);
|
|
6587
|
-
return StepResult.fromReplace(doc2, this.pos, this.pos + 1, new Slice(
|
|
6627
|
+
return StepResult.fromReplace(doc2, this.pos, this.pos + 1, new Slice(Fragment3.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
6588
6628
|
}
|
|
6589
6629
|
getMap() {
|
|
6590
6630
|
return StepMap.empty;
|
|
@@ -6719,7 +6759,7 @@ var Transform = class {
|
|
|
6719
6759
|
fragment, node, or array of nodes.
|
|
6720
6760
|
*/
|
|
6721
6761
|
replaceWith(from, to, content) {
|
|
6722
|
-
return this.replace(from, to, new Slice(
|
|
6762
|
+
return this.replace(from, to, new Slice(Fragment3.from(content), 0, 0));
|
|
6723
6763
|
}
|
|
6724
6764
|
/**
|
|
6725
6765
|
Delete the content between the given positions.
|
|
@@ -7221,7 +7261,7 @@ var NodeSelection = class extends Selection {
|
|
|
7221
7261
|
return new NodeSelection($pos);
|
|
7222
7262
|
}
|
|
7223
7263
|
content() {
|
|
7224
|
-
return new Slice(
|
|
7264
|
+
return new Slice(Fragment3.from(this.node), 0, 0);
|
|
7225
7265
|
}
|
|
7226
7266
|
eq(other) {
|
|
7227
7267
|
return other instanceof NodeSelection && other.anchor == this.anchor;
|
|
@@ -7779,10 +7819,10 @@ function deleteBarrier(state, $cut, dispatch, dir) {
|
|
|
7779
7819
|
let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);
|
|
7780
7820
|
if (canDelAfter && (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) && match.matchType(conn[0] || after.type).validEnd) {
|
|
7781
7821
|
if (dispatch) {
|
|
7782
|
-
let end = $cut.pos + after.nodeSize, wrap2 =
|
|
7822
|
+
let end = $cut.pos + after.nodeSize, wrap2 = Fragment3.empty;
|
|
7783
7823
|
for (let i = conn.length - 1; i >= 0; i--)
|
|
7784
|
-
wrap2 =
|
|
7785
|
-
wrap2 =
|
|
7824
|
+
wrap2 = Fragment3.from(conn[i].create(null, wrap2));
|
|
7825
|
+
wrap2 = Fragment3.from(before.copy(wrap2));
|
|
7786
7826
|
let tr = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap2, 1, 0), conn.length, true));
|
|
7787
7827
|
let $joinAt = tr.doc.resolve(end + 2 * conn.length);
|
|
7788
7828
|
if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type && canJoin(tr.doc, $joinAt.pos))
|
|
@@ -7811,9 +7851,9 @@ function deleteBarrier(state, $cut, dispatch, dir) {
|
|
|
7811
7851
|
afterDepth++;
|
|
7812
7852
|
if (at.canReplace(at.childCount, at.childCount, afterText.content)) {
|
|
7813
7853
|
if (dispatch) {
|
|
7814
|
-
let end =
|
|
7854
|
+
let end = Fragment3.empty;
|
|
7815
7855
|
for (let i = wrap2.length - 1; i >= 0; i--)
|
|
7816
|
-
end =
|
|
7856
|
+
end = Fragment3.from(wrap2[i].copy(end));
|
|
7817
7857
|
let tr = state.tr.step(new ReplaceAroundStep($cut.pos - wrap2.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end, wrap2.length, 0), 0, true));
|
|
7818
7858
|
dispatch(tr.scrollIntoView());
|
|
7819
7859
|
}
|
|
@@ -7918,9 +7958,9 @@ function wrapRangeInList(tr, range, listType, attrs = null) {
|
|
|
7918
7958
|
return true;
|
|
7919
7959
|
}
|
|
7920
7960
|
function doWrapInList(tr, range, wrappers, joinBefore, listType) {
|
|
7921
|
-
let content =
|
|
7961
|
+
let content = Fragment3.empty;
|
|
7922
7962
|
for (let i = wrappers.length - 1; i >= 0; i--)
|
|
7923
|
-
content =
|
|
7963
|
+
content = Fragment3.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
7924
7964
|
tr.step(new ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new Slice(content, 0, 0), wrappers.length, true));
|
|
7925
7965
|
let found2 = 0;
|
|
7926
7966
|
for (let i = 0; i < wrappers.length; i++)
|
|
@@ -7954,7 +7994,7 @@ function liftListItem(itemType) {
|
|
|
7954
7994
|
function liftToOuterList(state, dispatch, itemType, range) {
|
|
7955
7995
|
let tr = state.tr, end = range.end, endOfList = range.$to.end(range.depth);
|
|
7956
7996
|
if (end < endOfList) {
|
|
7957
|
-
tr.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(
|
|
7997
|
+
tr.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment3.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
|
|
7958
7998
|
range = new NodeRange(tr.doc.resolve(range.$from.pos), tr.doc.resolve(endOfList), range.depth);
|
|
7959
7999
|
}
|
|
7960
8000
|
const target = liftTarget(range);
|
|
@@ -7978,10 +8018,10 @@ function liftOutOfList(state, dispatch, range) {
|
|
|
7978
8018
|
return false;
|
|
7979
8019
|
let atStart = range.startIndex == 0, atEnd = range.endIndex == list.childCount;
|
|
7980
8020
|
let parent = $start.node(-1), indexBefore = $start.index(-1);
|
|
7981
|
-
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ?
|
|
8021
|
+
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment3.empty : Fragment3.from(list))))
|
|
7982
8022
|
return false;
|
|
7983
8023
|
let start = $start.pos, end = start + item.nodeSize;
|
|
7984
|
-
tr.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ?
|
|
8024
|
+
tr.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment3.empty : Fragment3.from(list.copy(Fragment3.empty))).append(atEnd ? Fragment3.empty : Fragment3.from(list.copy(Fragment3.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
|
|
7985
8025
|
dispatch(tr.scrollIntoView());
|
|
7986
8026
|
return true;
|
|
7987
8027
|
}
|
|
@@ -7999,8 +8039,8 @@ function sinkListItem(itemType) {
|
|
|
7999
8039
|
return false;
|
|
8000
8040
|
if (dispatch) {
|
|
8001
8041
|
let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
|
|
8002
|
-
let inner =
|
|
8003
|
-
let slice = new Slice(
|
|
8042
|
+
let inner = Fragment3.from(nestedBefore ? itemType.create() : null);
|
|
8043
|
+
let slice = new Slice(Fragment3.from(itemType.create(null, Fragment3.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
|
|
8004
8044
|
let before = range.start, after = range.end;
|
|
8005
8045
|
dispatch(state.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice, 1, true)).scrollIntoView());
|
|
8006
8046
|
}
|
|
@@ -8619,7 +8659,7 @@ function elementFromString(value) {
|
|
|
8619
8659
|
return removeWhitespaces(html);
|
|
8620
8660
|
}
|
|
8621
8661
|
function createNodeFromContent(content, schema, options) {
|
|
8622
|
-
if (content instanceof Node || content instanceof
|
|
8662
|
+
if (content instanceof Node || content instanceof Fragment3) {
|
|
8623
8663
|
return content;
|
|
8624
8664
|
}
|
|
8625
8665
|
options = {
|
|
@@ -8633,7 +8673,7 @@ function createNodeFromContent(content, schema, options) {
|
|
|
8633
8673
|
try {
|
|
8634
8674
|
const isArrayContent = Array.isArray(content) && content.length > 0;
|
|
8635
8675
|
if (isArrayContent) {
|
|
8636
|
-
return
|
|
8676
|
+
return Fragment3.fromArray(content.map((item) => schema.nodeFromJSON(item)));
|
|
8637
8677
|
}
|
|
8638
8678
|
const node = schema.nodeFromJSON(content);
|
|
8639
8679
|
if (options.errorOnInvalidContent) {
|
|
@@ -8780,7 +8820,7 @@ var insertContentAt = (position, value, options) => ({ tr, dispatch, editor }) =
|
|
|
8780
8820
|
if (isOnlyTextContent) {
|
|
8781
8821
|
if (Array.isArray(value)) {
|
|
8782
8822
|
newContent = value.map((v) => v.text || "").join("");
|
|
8783
|
-
} else if (value instanceof
|
|
8823
|
+
} else if (value instanceof Fragment3) {
|
|
8784
8824
|
let text = "";
|
|
8785
8825
|
value.forEach((node) => {
|
|
8786
8826
|
if (node.text) {
|
|
@@ -9651,10 +9691,10 @@ var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr, state, dispatch,
|
|
|
9651
9691
|
return false;
|
|
9652
9692
|
}
|
|
9653
9693
|
if (dispatch) {
|
|
9654
|
-
let wrap2 =
|
|
9694
|
+
let wrap2 = Fragment3.empty;
|
|
9655
9695
|
const depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
|
|
9656
9696
|
for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d -= 1) {
|
|
9657
|
-
wrap2 =
|
|
9697
|
+
wrap2 = Fragment3.from($from.node(d).copy(wrap2));
|
|
9658
9698
|
}
|
|
9659
9699
|
const depthAfter = (
|
|
9660
9700
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -9665,7 +9705,7 @@ var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr, state, dispatch,
|
|
|
9665
9705
|
...overrideAttrs
|
|
9666
9706
|
};
|
|
9667
9707
|
const nextType2 = ((_a = type.contentMatch.defaultType) == null ? void 0 : _a.createAndFill(newNextTypeAttributes2)) || void 0;
|
|
9668
|
-
wrap2 = wrap2.append(
|
|
9708
|
+
wrap2 = wrap2.append(Fragment3.from(type.createAndFill(null, nextType2) || void 0));
|
|
9669
9709
|
const start = $from.before($from.depth - (depthBefore - 1));
|
|
9670
9710
|
tr.replace(start, $from.after(-depthAfter), new Slice(wrap2, 4 - depthBefore, 0));
|
|
9671
9711
|
let sel = -1;
|
|
@@ -11105,9 +11145,9 @@ var AppRichTextEditor = ({
|
|
|
11105
11145
|
}) => {
|
|
11106
11146
|
material.useTheme();
|
|
11107
11147
|
const { values, setFieldValue } = formik.useFormikContext();
|
|
11108
|
-
const [linkDialogOpen, setLinkDialogOpen] =
|
|
11109
|
-
const [linkUrl, setLinkUrl] =
|
|
11110
|
-
const editor = react$
|
|
11148
|
+
const [linkDialogOpen, setLinkDialogOpen] = React4.useState(false);
|
|
11149
|
+
const [linkUrl, setLinkUrl] = React4.useState("");
|
|
11150
|
+
const editor = react$1.useEditor({
|
|
11111
11151
|
extensions: [
|
|
11112
11152
|
StarterKit__default.default,
|
|
11113
11153
|
index_default,
|
|
@@ -11119,7 +11159,7 @@ var AppRichTextEditor = ({
|
|
|
11119
11159
|
setFieldValue(name, editor2.getHTML());
|
|
11120
11160
|
}
|
|
11121
11161
|
});
|
|
11122
|
-
|
|
11162
|
+
React4.useEffect(() => {
|
|
11123
11163
|
if (editor && values[name] !== editor.getHTML()) {
|
|
11124
11164
|
editor.commands.setContent(values[name] || "");
|
|
11125
11165
|
}
|
|
@@ -11377,7 +11417,7 @@ var AppRichTextEditor = ({
|
|
|
11377
11417
|
...editorSx
|
|
11378
11418
|
},
|
|
11379
11419
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11380
|
-
react$
|
|
11420
|
+
react$1.EditorContent,
|
|
11381
11421
|
{
|
|
11382
11422
|
editor,
|
|
11383
11423
|
placeholder: placeholder || "Start typing..."
|
|
@@ -11451,7 +11491,7 @@ var AppRichTextEditor = ({
|
|
|
11451
11491
|
] });
|
|
11452
11492
|
};
|
|
11453
11493
|
var AppRichTextEditor_default = AppRichTextEditor;
|
|
11454
|
-
var AppSearchableMultiSelector =
|
|
11494
|
+
var AppSearchableMultiSelector = React4.forwardRef(
|
|
11455
11495
|
({
|
|
11456
11496
|
name,
|
|
11457
11497
|
label,
|
|
@@ -11631,7 +11671,7 @@ var AppSearchableMultiSelector = react.forwardRef(
|
|
|
11631
11671
|
...textFieldProps
|
|
11632
11672
|
}
|
|
11633
11673
|
);
|
|
11634
|
-
const defaultRenderOption = (props, option, { selected }) => /* @__PURE__ */
|
|
11674
|
+
const defaultRenderOption = (props, option, { selected }) => /* @__PURE__ */ React4.createElement(
|
|
11635
11675
|
"li",
|
|
11636
11676
|
{
|
|
11637
11677
|
...props,
|
|
@@ -11680,7 +11720,7 @@ var AppSearchableMultiSelector = react.forwardRef(
|
|
|
11680
11720
|
);
|
|
11681
11721
|
const defaultRenderTags = (value, getTagProps) => /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 0.5, mt: 0.5 }, children: value.map((option, index) => {
|
|
11682
11722
|
const { key, ...tagProps } = getTagProps({ index });
|
|
11683
|
-
return /* @__PURE__ */
|
|
11723
|
+
return /* @__PURE__ */ React4.createElement(
|
|
11684
11724
|
material.Chip,
|
|
11685
11725
|
{
|
|
11686
11726
|
...tagProps,
|
|
@@ -11986,269 +12026,224 @@ function AppSearchableSelectInput({
|
|
|
11986
12026
|
}
|
|
11987
12027
|
);
|
|
11988
12028
|
}
|
|
11989
|
-
var AppSelectInput =
|
|
12029
|
+
var AppSelectInput = React4.forwardRef(
|
|
11990
12030
|
({
|
|
11991
12031
|
name,
|
|
11992
|
-
variant = "outlined",
|
|
11993
12032
|
label,
|
|
11994
|
-
|
|
12033
|
+
mode = "autocomplete",
|
|
12034
|
+
options = [],
|
|
11995
12035
|
required = false,
|
|
11996
12036
|
disabled = false,
|
|
11997
|
-
readOnly = false,
|
|
11998
|
-
options = [],
|
|
11999
12037
|
showNoneOption = false,
|
|
12000
12038
|
noneOptionText = "None",
|
|
12001
|
-
showHelperText = false,
|
|
12002
12039
|
helperText,
|
|
12040
|
+
variant = "outlined",
|
|
12041
|
+
placeholder,
|
|
12042
|
+
onSearchChange,
|
|
12043
|
+
onChange: externalOnChange,
|
|
12003
12044
|
sx,
|
|
12004
12045
|
formControlSx,
|
|
12005
|
-
selectSx,
|
|
12006
|
-
inputSx,
|
|
12007
12046
|
labelSx,
|
|
12008
|
-
|
|
12009
|
-
|
|
12010
|
-
selectedMenuItemSx,
|
|
12011
|
-
errorSx,
|
|
12012
|
-
helperTextSx,
|
|
12013
|
-
iconSx,
|
|
12014
|
-
labelComponent: LabelComponent = material.InputLabel,
|
|
12015
|
-
errorComponent: ErrorComponent = material.Typography,
|
|
12016
|
-
helperTextComponent: HelperTextComponent = material.FormHelperText,
|
|
12017
|
-
onChange: externalOnChange,
|
|
12018
|
-
onOpen,
|
|
12019
|
-
onClose,
|
|
12020
|
-
onBlur: externalOnBlur,
|
|
12021
|
-
renderValue,
|
|
12022
|
-
renderMenuItem,
|
|
12023
|
-
MenuProps,
|
|
12024
|
-
inputProps,
|
|
12025
|
-
...otherProps
|
|
12047
|
+
searchDebounce = 300,
|
|
12048
|
+
clearable = true
|
|
12026
12049
|
}, ref) => {
|
|
12027
12050
|
const theme = material.useTheme();
|
|
12028
|
-
const {
|
|
12051
|
+
const { values, setFieldValue, errors, touched, setFieldTouched } = formik.useFormikContext();
|
|
12029
12052
|
const fieldError = _19__default.default.get(errors, name);
|
|
12030
|
-
const isTouched = _19__default.default.get(touched, name);
|
|
12053
|
+
const isTouched = Boolean(_19__default.default.get(touched, name));
|
|
12031
12054
|
const hasError = Boolean(fieldError) && isTouched;
|
|
12032
|
-
const
|
|
12033
|
-
const
|
|
12034
|
-
setFieldValue(name,
|
|
12055
|
+
const currentValue = _19__default.default.get(values, name);
|
|
12056
|
+
const handleValueChange = (newValue) => {
|
|
12057
|
+
setFieldValue(name, newValue, true);
|
|
12035
12058
|
if (externalOnChange) {
|
|
12036
|
-
externalOnChange(
|
|
12059
|
+
externalOnChange(newValue);
|
|
12037
12060
|
}
|
|
12038
12061
|
};
|
|
12039
|
-
const handleBlur = (
|
|
12062
|
+
const handleBlur = () => {
|
|
12040
12063
|
setFieldTouched(name, true, true);
|
|
12041
|
-
if (externalOnBlur) {
|
|
12042
|
-
externalOnBlur(event);
|
|
12043
|
-
}
|
|
12044
12064
|
};
|
|
12045
|
-
const
|
|
12046
|
-
|
|
12047
|
-
const
|
|
12048
|
-
|
|
12049
|
-
|
|
12065
|
+
const selectedOption = options.find((opt) => opt.value === currentValue) || null;
|
|
12066
|
+
if (mode === "autocomplete") {
|
|
12067
|
+
const debouncedSearch = React4__default.default.useRef();
|
|
12068
|
+
const handleSearchChange = (query) => {
|
|
12069
|
+
if (debouncedSearch.current) {
|
|
12070
|
+
clearTimeout(debouncedSearch.current);
|
|
12071
|
+
}
|
|
12072
|
+
debouncedSearch.current = setTimeout(() => {
|
|
12073
|
+
if (onSearchChange) {
|
|
12074
|
+
onSearchChange(query);
|
|
12075
|
+
}
|
|
12076
|
+
}, searchDebounce);
|
|
12077
|
+
};
|
|
12078
|
+
const filterOptions = (options2, { inputValue }) => {
|
|
12079
|
+
if (!inputValue)
|
|
12080
|
+
return options2;
|
|
12081
|
+
const inputValueLower = inputValue.toLowerCase();
|
|
12082
|
+
return options2.filter(
|
|
12083
|
+
(option) => {
|
|
12084
|
+
var _a, _b, _c;
|
|
12085
|
+
return option.label.toLowerCase().includes(inputValueLower) || String(option.value).toLowerCase().includes(inputValueLower) || ((_a = option.searchAbleValue1) == null ? void 0 : _a.toLowerCase().includes(inputValueLower)) || ((_b = option.searchAbleValue2) == null ? void 0 : _b.toLowerCase().includes(inputValueLower)) || ((_c = option.searchAbleValue3) == null ? void 0 : _c.toLowerCase().includes(inputValueLower));
|
|
12086
|
+
}
|
|
12087
|
+
);
|
|
12088
|
+
};
|
|
12089
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { ref, sx, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12090
|
+
material.FormControl,
|
|
12050
12091
|
{
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
|
|
12054
|
-
sx:
|
|
12092
|
+
fullWidth: true,
|
|
12093
|
+
error: hasError,
|
|
12094
|
+
disabled,
|
|
12095
|
+
sx: formControlSx,
|
|
12096
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12097
|
+
material.Autocomplete,
|
|
12055
12098
|
{
|
|
12056
|
-
|
|
12057
|
-
|
|
12058
|
-
|
|
12059
|
-
"
|
|
12060
|
-
backgroundColor: "action.hover"
|
|
12061
|
-
},
|
|
12062
|
-
...selectedMenuItemSx
|
|
12063
|
-
},
|
|
12064
|
-
"&.Mui-disabled": {
|
|
12065
|
-
opacity: 0.5,
|
|
12066
|
-
pointerEvents: "none"
|
|
12067
|
-
},
|
|
12068
|
-
...option.sx
|
|
12069
|
-
},
|
|
12070
|
-
...Array.isArray(menuItemSx) ? menuItemSx : [menuItemSx]
|
|
12071
|
-
],
|
|
12072
|
-
children: [
|
|
12073
|
-
option.icon && /* @__PURE__ */ jsxRuntime.jsx(material.Box, { component: "span", sx: { mr: 1 }, children: option.icon }),
|
|
12074
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12075
|
-
material.Typography,
|
|
12076
|
-
{
|
|
12077
|
-
variant: "body2",
|
|
12078
|
-
sx: [
|
|
12079
|
-
{
|
|
12080
|
-
color: option.disabled ? "text.disabled" : "text.primary",
|
|
12081
|
-
...option.textSx
|
|
12082
|
-
}
|
|
12083
|
-
],
|
|
12084
|
-
children: option.label
|
|
12085
|
-
}
|
|
12086
|
-
)
|
|
12087
|
-
]
|
|
12088
|
-
},
|
|
12089
|
-
`${option.value}-${index}`
|
|
12090
|
-
);
|
|
12091
|
-
};
|
|
12092
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12093
|
-
material.Box,
|
|
12094
|
-
{
|
|
12095
|
-
ref,
|
|
12096
|
-
className: "app-select-input",
|
|
12097
|
-
sx: [
|
|
12098
|
-
{
|
|
12099
|
-
"& .MuiInputLabel-root": {
|
|
12100
|
-
"&.Mui-focused": {
|
|
12101
|
-
color: hasError ? "error.main" : "primary.main"
|
|
12099
|
+
options,
|
|
12100
|
+
value: selectedOption,
|
|
12101
|
+
onChange: (event, newValue) => {
|
|
12102
|
+
handleValueChange((newValue == null ? void 0 : newValue.value) || "");
|
|
12102
12103
|
},
|
|
12103
|
-
|
|
12104
|
-
|
|
12105
|
-
|
|
12106
|
-
}
|
|
12107
|
-
},
|
|
12108
|
-
...Array.isArray(formControlSx) ? formControlSx : [formControlSx].filter(Boolean)
|
|
12109
|
-
],
|
|
12110
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12111
|
-
material.FormControl,
|
|
12112
|
-
{
|
|
12113
|
-
fullWidth,
|
|
12114
|
-
variant,
|
|
12115
|
-
error: hasError,
|
|
12116
|
-
disabled,
|
|
12117
|
-
className: "app-select-form-control",
|
|
12118
|
-
sx: [
|
|
12119
|
-
{
|
|
12120
|
-
"& .MuiInputLabel-root": {
|
|
12121
|
-
"&.Mui-focused": {
|
|
12122
|
-
color: hasError ? "error.main" : "primary.main"
|
|
12123
|
-
},
|
|
12124
|
-
"&.Mui-disabled": {
|
|
12125
|
-
color: "text.disabled"
|
|
12126
|
-
}
|
|
12104
|
+
onInputChange: (event, value, reason) => {
|
|
12105
|
+
if (reason === "input" && onSearchChange) {
|
|
12106
|
+
handleSearchChange(value);
|
|
12127
12107
|
}
|
|
12128
12108
|
},
|
|
12129
|
-
|
|
12130
|
-
|
|
12131
|
-
|
|
12132
|
-
|
|
12133
|
-
|
|
12109
|
+
filterOptions,
|
|
12110
|
+
onBlur: handleBlur,
|
|
12111
|
+
disabled,
|
|
12112
|
+
clearOnBlur: false,
|
|
12113
|
+
clearOnEscape: true,
|
|
12114
|
+
disableClearable: !clearable,
|
|
12115
|
+
getOptionLabel: (option) => option.label,
|
|
12116
|
+
isOptionEqualToValue: (option, value) => option.value === value.value,
|
|
12117
|
+
getOptionDisabled: (option) => !!option.disabled,
|
|
12118
|
+
renderInput: (params) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12119
|
+
material.TextField,
|
|
12134
12120
|
{
|
|
12135
|
-
|
|
12136
|
-
|
|
12137
|
-
className: "app-select-label",
|
|
12138
|
-
sx: [
|
|
12139
|
-
{
|
|
12140
|
-
color: hasError ? "error.main" : "text.secondary",
|
|
12141
|
-
"&.Mui-focused": {
|
|
12142
|
-
color: hasError ? "error.main" : "primary.main"
|
|
12143
|
-
},
|
|
12144
|
-
mb: 1,
|
|
12145
|
-
...Array.isArray(labelSx) ? labelSx : [labelSx]
|
|
12146
|
-
}
|
|
12147
|
-
],
|
|
12148
|
-
children: [
|
|
12121
|
+
...params,
|
|
12122
|
+
label: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12149
12123
|
label,
|
|
12150
12124
|
required && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12151
|
-
material.
|
|
12125
|
+
material.Typography,
|
|
12152
12126
|
{
|
|
12127
|
+
sx: { color: "error.main" },
|
|
12153
12128
|
component: "span",
|
|
12154
|
-
|
|
12155
|
-
color: "error.main",
|
|
12156
|
-
ml: 0.5
|
|
12157
|
-
},
|
|
12158
|
-
children: "*"
|
|
12129
|
+
children: " *"
|
|
12159
12130
|
}
|
|
12160
12131
|
)
|
|
12161
|
-
]
|
|
12132
|
+
] }),
|
|
12133
|
+
variant,
|
|
12134
|
+
placeholder,
|
|
12135
|
+
error: hasError,
|
|
12136
|
+
helperText: hasError ? fieldError : helperText,
|
|
12137
|
+
FormHelperTextProps: {
|
|
12138
|
+
sx: { mx: 0, mt: 0.5 }
|
|
12139
|
+
}
|
|
12162
12140
|
}
|
|
12163
12141
|
),
|
|
12164
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
|
|
12171
|
-
|
|
12172
|
-
|
|
12173
|
-
onBlur: handleBlur,
|
|
12174
|
-
onOpen,
|
|
12175
|
-
onClose,
|
|
12176
|
-
renderValue,
|
|
12177
|
-
inputProps: {
|
|
12178
|
-
readOnly,
|
|
12179
|
-
...inputProps
|
|
12180
|
-
},
|
|
12181
|
-
MenuProps: {
|
|
12182
|
-
PaperProps: {
|
|
12183
|
-
sx: [
|
|
12184
|
-
{
|
|
12185
|
-
mt: 1,
|
|
12186
|
-
boxShadow: theme.shadows[3],
|
|
12187
|
-
"& .MuiMenuItem-root": {
|
|
12188
|
-
px: 2,
|
|
12189
|
-
py: 1,
|
|
12190
|
-
"&.Mui-selected": {
|
|
12191
|
-
backgroundColor: "action.selected",
|
|
12192
|
-
"&:hover": {
|
|
12193
|
-
backgroundColor: "action.hover"
|
|
12194
|
-
}
|
|
12195
|
-
}
|
|
12196
|
-
},
|
|
12197
|
-
...Array.isArray(menuPaperSx) ? menuPaperSx : [menuPaperSx]
|
|
12198
|
-
}
|
|
12199
|
-
]
|
|
12142
|
+
renderOption: (props, option) => /* @__PURE__ */ jsxRuntime.jsxs("li", { ...props, children: [
|
|
12143
|
+
option.icon,
|
|
12144
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12145
|
+
material.Typography,
|
|
12146
|
+
{
|
|
12147
|
+
variant: "body2",
|
|
12148
|
+
sx: {
|
|
12149
|
+
color: option.disabled ? "text.disabled" : "text.primary",
|
|
12150
|
+
...option.textSx
|
|
12200
12151
|
},
|
|
12201
|
-
|
|
12202
|
-
}
|
|
12203
|
-
|
|
12152
|
+
children: option.label
|
|
12153
|
+
}
|
|
12154
|
+
)
|
|
12155
|
+
] })
|
|
12156
|
+
}
|
|
12157
|
+
)
|
|
12158
|
+
}
|
|
12159
|
+
) });
|
|
12160
|
+
}
|
|
12161
|
+
if (mode === "dropdown") {
|
|
12162
|
+
const handleSelectChange = (event) => {
|
|
12163
|
+
const newValue = event.target.value;
|
|
12164
|
+
handleValueChange(newValue);
|
|
12165
|
+
};
|
|
12166
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { ref, sx, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12167
|
+
material.FormControl,
|
|
12168
|
+
{
|
|
12169
|
+
fullWidth: true,
|
|
12170
|
+
variant,
|
|
12171
|
+
error: hasError,
|
|
12172
|
+
disabled,
|
|
12173
|
+
sx: formControlSx,
|
|
12174
|
+
children: [
|
|
12175
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12176
|
+
material.Typography,
|
|
12177
|
+
{
|
|
12178
|
+
variant: "body2",
|
|
12179
|
+
sx: {
|
|
12180
|
+
mb: 1,
|
|
12181
|
+
color: hasError ? "error.main" : "text.secondary",
|
|
12182
|
+
...labelSx
|
|
12183
|
+
},
|
|
12184
|
+
children: [
|
|
12185
|
+
label,
|
|
12186
|
+
required && /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { sx: { color: "error.main" }, component: "span", children: " *" })
|
|
12187
|
+
]
|
|
12188
|
+
}
|
|
12189
|
+
),
|
|
12190
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12191
|
+
material.Select,
|
|
12192
|
+
{
|
|
12193
|
+
value: currentValue != null ? currentValue : "",
|
|
12194
|
+
onChange: handleSelectChange,
|
|
12195
|
+
onBlur: handleBlur,
|
|
12196
|
+
displayEmpty: true,
|
|
12197
|
+
renderValue: (selected) => {
|
|
12198
|
+
if (selected === "") {
|
|
12199
|
+
return /* @__PURE__ */ jsxRuntime.jsx("em", { children: placeholder || noneOptionText });
|
|
12200
|
+
}
|
|
12201
|
+
const option = options.find((opt) => opt.value === selected);
|
|
12202
|
+
return (option == null ? void 0 : option.label) || String(selected);
|
|
12203
|
+
},
|
|
12204
|
+
MenuProps: {
|
|
12205
|
+
PaperProps: {
|
|
12206
|
+
sx: {
|
|
12207
|
+
mt: 1,
|
|
12208
|
+
boxShadow: theme.shadows[3],
|
|
12209
|
+
maxHeight: 300
|
|
12210
|
+
}
|
|
12211
|
+
}
|
|
12212
|
+
},
|
|
12213
|
+
children: [
|
|
12214
|
+
showNoneOption && /* @__PURE__ */ jsxRuntime.jsx(material.MenuItem, { value: "", children: /* @__PURE__ */ jsxRuntime.jsx("em", { children: noneOptionText }) }),
|
|
12215
|
+
options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12216
|
+
material.MenuItem,
|
|
12204
12217
|
{
|
|
12205
|
-
|
|
12206
|
-
|
|
12207
|
-
|
|
12208
|
-
|
|
12209
|
-
|
|
12210
|
-
|
|
12211
|
-
|
|
12212
|
-
|
|
12213
|
-
|
|
12214
|
-
|
|
12218
|
+
value: option.value,
|
|
12219
|
+
disabled: option.disabled,
|
|
12220
|
+
sx: option.sx,
|
|
12221
|
+
children: [
|
|
12222
|
+
option.icon,
|
|
12223
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12224
|
+
material.Typography,
|
|
12225
|
+
{
|
|
12226
|
+
variant: "body2",
|
|
12227
|
+
sx: {
|
|
12228
|
+
color: option.disabled ? "text.disabled" : "text.primary",
|
|
12229
|
+
...option.textSx
|
|
12230
|
+
},
|
|
12231
|
+
children: option.label
|
|
12232
|
+
}
|
|
12233
|
+
)
|
|
12234
|
+
]
|
|
12215
12235
|
},
|
|
12216
|
-
|
|
12217
|
-
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12221
|
-
|
|
12222
|
-
|
|
12223
|
-
|
|
12224
|
-
|
|
12225
|
-
|
|
12226
|
-
|
|
12227
|
-
(showHelperText || hasError) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12228
|
-
HelperTextComponent,
|
|
12229
|
-
{
|
|
12230
|
-
error: hasError,
|
|
12231
|
-
sx: [
|
|
12232
|
-
{
|
|
12233
|
-
mx: 0,
|
|
12234
|
-
mt: 0.5,
|
|
12235
|
-
...hasError ? {
|
|
12236
|
-
color: "error.main",
|
|
12237
|
-
...errorSx
|
|
12238
|
-
} : {
|
|
12239
|
-
color: "text.secondary",
|
|
12240
|
-
...helperTextSx
|
|
12241
|
-
}
|
|
12242
|
-
}
|
|
12243
|
-
],
|
|
12244
|
-
children: hasError ? fieldError : helperText
|
|
12245
|
-
}
|
|
12246
|
-
)
|
|
12247
|
-
]
|
|
12248
|
-
}
|
|
12249
|
-
)
|
|
12250
|
-
}
|
|
12251
|
-
);
|
|
12236
|
+
option.value
|
|
12237
|
+
))
|
|
12238
|
+
]
|
|
12239
|
+
}
|
|
12240
|
+
),
|
|
12241
|
+
(helperText || hasError) && /* @__PURE__ */ jsxRuntime.jsx(material.FormHelperText, { error: hasError, sx: { mx: 0, mt: 0.5 }, children: hasError ? fieldError : helperText })
|
|
12242
|
+
]
|
|
12243
|
+
}
|
|
12244
|
+
) });
|
|
12245
|
+
}
|
|
12246
|
+
return null;
|
|
12252
12247
|
}
|
|
12253
12248
|
);
|
|
12254
12249
|
AppSelectInput.displayName = "AppSelectInput";
|
|
@@ -12666,7 +12661,7 @@ function getRatio(ratio = "1/1") {
|
|
|
12666
12661
|
}[ratio];
|
|
12667
12662
|
}
|
|
12668
12663
|
var TRANSPARENT_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8Xw8AApIBgX6cJqkAAAAASUVORK5CYII=";
|
|
12669
|
-
var Image =
|
|
12664
|
+
var Image = React4.forwardRef(
|
|
12670
12665
|
({
|
|
12671
12666
|
ratio,
|
|
12672
12667
|
disabledEffect = false,
|
|
@@ -12844,8 +12839,8 @@ function MultiFilePreview({
|
|
|
12844
12839
|
if ((files == null ? void 0 : files.length) == null) {
|
|
12845
12840
|
return null;
|
|
12846
12841
|
}
|
|
12847
|
-
const [anchorEl, setAnchorEl] =
|
|
12848
|
-
const [selectedFile, setSelectedFile] =
|
|
12842
|
+
const [anchorEl, setAnchorEl] = React4.useState(null);
|
|
12843
|
+
const [selectedFile, setSelectedFile] = React4.useState(null);
|
|
12849
12844
|
const canViewPrivate = true;
|
|
12850
12845
|
return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: false, children: files.map((file) => {
|
|
12851
12846
|
const typedFile = file;
|
|
@@ -13126,7 +13121,7 @@ function BackgroundIllustration() {
|
|
|
13126
13121
|
)
|
|
13127
13122
|
] });
|
|
13128
13123
|
}
|
|
13129
|
-
var BackgroundIllustration_default =
|
|
13124
|
+
var BackgroundIllustration_default = React4.memo(BackgroundIllustration);
|
|
13130
13125
|
function UploadIllustration({ ...other }) {
|
|
13131
13126
|
const theme = styles.useTheme();
|
|
13132
13127
|
const PRIMARY_MAIN = theme.palette.primary.main;
|
|
@@ -13680,7 +13675,7 @@ function UploadIllustration({ ...other }) {
|
|
|
13680
13675
|
)
|
|
13681
13676
|
] }) });
|
|
13682
13677
|
}
|
|
13683
|
-
var UploadIllustration_default =
|
|
13678
|
+
var UploadIllustration_default = React4.memo(UploadIllustration);
|
|
13684
13679
|
var StyledDropZone = styles.styled("div")(({ theme }) => ({
|
|
13685
13680
|
outline: "none",
|
|
13686
13681
|
cursor: "pointer",
|
|
@@ -13958,7 +13953,7 @@ var SubmitButton = ({
|
|
|
13958
13953
|
...rest
|
|
13959
13954
|
}) => {
|
|
13960
13955
|
const { submitForm, isSubmitting } = formik.useFormikContext();
|
|
13961
|
-
const [isLoading, setIsLoading] =
|
|
13956
|
+
const [isLoading, setIsLoading] = React4.useState(false);
|
|
13962
13957
|
const handleClick = async () => {
|
|
13963
13958
|
try {
|
|
13964
13959
|
setIsLoading(true);
|