@commercetools-frontend-extensions/export-resources-modal 0.0.0-fec-202-react19-20250204105856 → 0.0.0-fec-202-react19-20250307085017
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/commercetools-frontend-extensions-export-resources-modal.cjs.dev.js +130 -74
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.prod.js +124 -68
- package/dist/commercetools-frontend-extensions-export-resources-modal.esm.js +131 -75
- package/dist/{de-3d4cf3d0.cjs.prod.js → de-1903dccf.cjs.prod.js} +37 -25
- package/dist/{de-abc94d19.esm.js → de-2ad4e0d7.esm.js} +37 -25
- package/dist/{de-d6a38e9e.cjs.dev.js → de-b820e753.cjs.dev.js} +37 -25
- package/dist/declarations/src/@types/export-resources-modal-types.d.ts +1 -0
- package/dist/declarations/src/@types/form.d.ts +2 -7
- package/dist/{en-fc0085cc.cjs.prod.js → en-56c15954.cjs.prod.js} +33 -21
- package/dist/{en-38313842.esm.js → en-5b88bfde.esm.js} +33 -21
- package/dist/{en-0ea9f92c.cjs.dev.js → en-9aa667ca.cjs.dev.js} +33 -21
- package/dist/{es-a4227b21.cjs.dev.js → es-01c31bc7.cjs.dev.js} +37 -25
- package/dist/{es-85c5a396.esm.js → es-4658edf6.esm.js} +37 -25
- package/dist/{es-6360d546.cjs.prod.js → es-7959f578.cjs.prod.js} +37 -25
- package/dist/{fr-FR-1602d5ff.cjs.dev.js → fr-FR-0a721f97.cjs.prod.js} +37 -25
- package/dist/{fr-FR-e610590b.esm.js → fr-FR-3057d941.esm.js} +37 -25
- package/dist/{fr-FR-ff7ec057.cjs.prod.js → fr-FR-d641720a.cjs.dev.js} +37 -25
- package/dist/{pt-BR-d9b0a36d.cjs.prod.js → pt-BR-442e5bba.cjs.dev.js} +37 -25
- package/dist/{pt-BR-7b17be9e.cjs.dev.js → pt-BR-89644b77.cjs.prod.js} +37 -25
- package/dist/{pt-BR-ccc18639.esm.js → pt-BR-b849606a.esm.js} +37 -25
- package/package.json +12 -9
|
@@ -103,7 +103,7 @@ function getBold(msg) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
function getNewLine() {
|
|
106
|
-
return jsxRuntime.jsx("br", {},
|
|
106
|
+
return jsxRuntime.jsx("br", {}, crypto.randomUUID());
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
var messages = reactIntl.defineMessages({
|
|
@@ -401,6 +401,16 @@ var messages = reactIntl.defineMessages({
|
|
|
401
401
|
id: 'ExportResourcesModal.fillRowsForProductExport',
|
|
402
402
|
description: 'A checkbox label for filling rows for product export',
|
|
403
403
|
defaultMessage: 'Include Product- and Variant-level information in every row'
|
|
404
|
+
},
|
|
405
|
+
loadMoreFields: {
|
|
406
|
+
id: 'ExportResourcesModal.loadMoreFields',
|
|
407
|
+
description: 'Load more fields message',
|
|
408
|
+
defaultMessage: 'Load more fields by using the search functionality'
|
|
409
|
+
},
|
|
410
|
+
itemCount: {
|
|
411
|
+
id: 'ExportResourcesModal.itemCount',
|
|
412
|
+
description: 'Label for item count',
|
|
413
|
+
defaultMessage: '{count, plural, one {# item} other {# items}}'
|
|
404
414
|
}
|
|
405
415
|
});
|
|
406
416
|
|
|
@@ -647,16 +657,16 @@ const isAnyDependentChecked = function (groups) {
|
|
|
647
657
|
const areAllFieldsChecked = fields => {
|
|
648
658
|
return _everyInstanceProperty__default["default"](fields).call(fields, field => field.fields ? areAllFieldsChecked(field.fields) : field.isChecked || field.isRequired || hasDependentFields(field));
|
|
649
659
|
};
|
|
650
|
-
const
|
|
651
|
-
const
|
|
660
|
+
const getGroupSelectedFieldCount = group => {
|
|
661
|
+
const countSelectedFields = fields => {
|
|
652
662
|
return _reduceInstanceProperty__default["default"](fields).call(fields, (total, field) => {
|
|
653
663
|
if (field.fields) {
|
|
654
|
-
return total +
|
|
664
|
+
return total + countSelectedFields(field.fields);
|
|
655
665
|
}
|
|
656
666
|
return total + (field.isChecked ? 1 : 0);
|
|
657
667
|
}, 0);
|
|
658
668
|
};
|
|
659
|
-
return
|
|
669
|
+
return countSelectedFields(group.fields);
|
|
660
670
|
};
|
|
661
671
|
|
|
662
672
|
let Step = /*#__PURE__*/function (Step) {
|
|
@@ -895,12 +905,22 @@ const updateFieldGroupWithAdditionalFieldExtensions = groups => {
|
|
|
895
905
|
});
|
|
896
906
|
});
|
|
897
907
|
};
|
|
908
|
+
const getIsExpanded = (field, groupName, cachedExpandedGroups) => {
|
|
909
|
+
if (!field.isExpandable) {
|
|
910
|
+
return false;
|
|
911
|
+
}
|
|
912
|
+
if (field.fields && field.maxVisibleChildren && field.fields.length > field.maxVisibleChildren) {
|
|
913
|
+
return false;
|
|
914
|
+
}
|
|
915
|
+
const cacheKey = `${groupName}.${field.name}`;
|
|
916
|
+
return cachedExpandedGroups[cacheKey] ?? field.isExpanded ?? false;
|
|
917
|
+
};
|
|
898
918
|
const updateFieldGroupsWithIsExpandedValue = (groups, cachedExpandedGroups) => {
|
|
899
919
|
function updateFields(fields, groupName) {
|
|
900
920
|
return _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
901
921
|
let isExpanded = null;
|
|
902
922
|
if (field.isExpandable) {
|
|
903
|
-
isExpanded =
|
|
923
|
+
isExpanded = getIsExpanded(field, groupName, cachedExpandedGroups);
|
|
904
924
|
}
|
|
905
925
|
if (field.fields) {
|
|
906
926
|
field.fields = updateFields(field.fields, groupName);
|
|
@@ -978,8 +998,8 @@ const useInitialValues = props => {
|
|
|
978
998
|
cachedExpandedGroups = _useStorage4[0];
|
|
979
999
|
return React__default["default"].useMemo(() => {
|
|
980
1000
|
let groups = removeEmptyGroups(props.fieldGroups);
|
|
981
|
-
groups = updateFieldGroupsWithIsCheckedValue(groups, cachedSelectedGroups[props.resourceType] || {});
|
|
982
|
-
groups = updateFieldGroupsWithIsExpandedValue(groups, cachedExpandedGroups[props.resourceType] || {});
|
|
1001
|
+
groups = updateFieldGroupsWithIsCheckedValue(groups, cachedSelectedGroups?.[props.resourceType] || {});
|
|
1002
|
+
groups = updateFieldGroupsWithIsExpandedValue(groups, cachedExpandedGroups?.[props.resourceType] || {});
|
|
983
1003
|
return {
|
|
984
1004
|
outputFormat: props.outputFormat,
|
|
985
1005
|
fileName: `${resourceTypeToFileName(props.resourceType, userLocale)}`,
|
|
@@ -1261,7 +1281,6 @@ const ExportPreferenceSection = () => {
|
|
|
1261
1281
|
function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1262
1282
|
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1263
1283
|
function ExportScopeSection() {
|
|
1264
|
-
const intl = reactIntl.useIntl();
|
|
1265
1284
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
1266
1285
|
exportType = _useExportResourcesMo.exportType,
|
|
1267
1286
|
totalResourcesCount = _useExportResourcesMo.totalResourcesCount,
|
|
@@ -1287,7 +1306,7 @@ function ExportScopeSection() {
|
|
|
1287
1306
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1288
1307
|
intlMessage: _objectSpread$4(_objectSpread$4({}, resourceTypeMessages[resourceType].exportScopeAll), {}, {
|
|
1289
1308
|
values: {
|
|
1290
|
-
total:
|
|
1309
|
+
total: totalResourcesCount
|
|
1291
1310
|
}
|
|
1292
1311
|
})
|
|
1293
1312
|
})
|
|
@@ -1298,7 +1317,7 @@ function ExportScopeSection() {
|
|
|
1298
1317
|
tone: !filters.total || !hasFilters ? 'tertiary' : undefined,
|
|
1299
1318
|
intlMessage: filters.total ? _objectSpread$4(_objectSpread$4({}, resourceTypeMessages[resourceType].exportScopeFiltered), {}, {
|
|
1300
1319
|
values: {
|
|
1301
|
-
total:
|
|
1320
|
+
total: filters.total
|
|
1302
1321
|
}
|
|
1303
1322
|
}) : messages.exportScopeFilteredWithoutCount
|
|
1304
1323
|
})
|
|
@@ -1309,7 +1328,7 @@ function ExportScopeSection() {
|
|
|
1309
1328
|
tone: !selectedResourceIds?.length ? 'tertiary' : undefined,
|
|
1310
1329
|
intlMessage: selectedResourceIds?.length ? _objectSpread$4(_objectSpread$4({}, resourceTypeMessages[resourceType].exportScopeSelected), {}, {
|
|
1311
1330
|
values: {
|
|
1312
|
-
total:
|
|
1331
|
+
total: selectedResourceIds.length
|
|
1313
1332
|
}
|
|
1314
1333
|
}) : messages.exportScopeSelectedWithoutCount
|
|
1315
1334
|
})
|
|
@@ -1449,7 +1468,7 @@ const ExportFieldSelectionProvider = _ref => {
|
|
|
1449
1468
|
setCachedExpandedGroups = _useStorage2[1];
|
|
1450
1469
|
const updateExpandedGroups = React.useCallback((name, value) => {
|
|
1451
1470
|
setCachedExpandedGroups({
|
|
1452
|
-
[resourceType]: _objectSpread$3(_objectSpread$3({}, cachedExpandedGroups[resourceType] || {}), {}, {
|
|
1471
|
+
[resourceType]: _objectSpread$3(_objectSpread$3({}, cachedExpandedGroups?.[resourceType] || {}), {}, {
|
|
1453
1472
|
[name]: value
|
|
1454
1473
|
})
|
|
1455
1474
|
});
|
|
@@ -1465,22 +1484,15 @@ const useExportFieldSelectionContext = () => {
|
|
|
1465
1484
|
return React.useContext(ExportFieldSelectionContext);
|
|
1466
1485
|
};
|
|
1467
1486
|
|
|
1468
|
-
const
|
|
1469
|
-
let
|
|
1487
|
+
const FieldsCountStamp = _ref => {
|
|
1488
|
+
let count = _ref.count;
|
|
1470
1489
|
const _useIntl = reactIntl.useIntl(),
|
|
1471
1490
|
formatMessage = _useIntl.formatMessage;
|
|
1472
|
-
return jsxRuntime.jsx(uiKit.
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
children: jsxRuntime.jsx(uiKit.Stamp, {
|
|
1478
|
-
tone: "secondary",
|
|
1479
|
-
isCondensed: true,
|
|
1480
|
-
label: formatMessage(messages.selected, {
|
|
1481
|
-
total: getTotalCheckedFields(group)
|
|
1482
|
-
})
|
|
1483
|
-
})
|
|
1491
|
+
return jsxRuntime.jsx(uiKit.Stamp, {
|
|
1492
|
+
tone: "information",
|
|
1493
|
+
isCondensed: true,
|
|
1494
|
+
label: formatMessage(messages.itemCount, {
|
|
1495
|
+
count
|
|
1484
1496
|
})
|
|
1485
1497
|
});
|
|
1486
1498
|
};
|
|
@@ -1519,13 +1531,26 @@ const FieldSection = _ref3 => {
|
|
|
1519
1531
|
parentKeys = _ref3.parentKeys,
|
|
1520
1532
|
formik = _ref3.formik,
|
|
1521
1533
|
isAnySiblingChecked = _ref3.isAnySiblingChecked,
|
|
1522
|
-
|
|
1523
|
-
groupName = _ref3.groupName
|
|
1534
|
+
isSearchActive = _ref3.isSearchActive,
|
|
1535
|
+
groupName = _ref3.groupName,
|
|
1536
|
+
maxVisibleChildren = _ref3.maxVisibleChildren;
|
|
1524
1537
|
const _useExportFieldSelect = useExportFieldSelectionContext(),
|
|
1525
1538
|
updateExpandedGroups = _useExportFieldSelect.updateExpandedGroups;
|
|
1526
|
-
|
|
1539
|
+
const visibleFields = isSearchActive || !maxVisibleChildren ? fields : fields?.slice(0, maxVisibleChildren);
|
|
1540
|
+
const hasMoreFields = maxVisibleChildren && !isSearchActive && fields && fields.length > maxVisibleChildren;
|
|
1541
|
+
const visibleIndex = field => fields?.filter(f => !f.isHidden).indexOf(field) || -1;
|
|
1542
|
+
const shouldDisplayField = field => {
|
|
1543
|
+
if (field.isHidden) return false;
|
|
1544
|
+
if (!maxVisibleChildren) return true;
|
|
1545
|
+
return maxVisibleChildren && visibleIndex(field) < maxVisibleChildren;
|
|
1546
|
+
};
|
|
1547
|
+
const shouldDisplayChildrenCount = field => {
|
|
1548
|
+
return Boolean(field.maxVisibleChildren);
|
|
1549
|
+
};
|
|
1550
|
+
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1527
1551
|
scale: "s",
|
|
1528
|
-
children:
|
|
1552
|
+
children: [visibleFields?.map((field, index) => {
|
|
1553
|
+
const isChildrenCountDisplayed = shouldDisplayChildrenCount(field);
|
|
1529
1554
|
const hasDependents = Boolean(field.dependentGroupNames?.length || field.dependentFieldNames?.length);
|
|
1530
1555
|
const isAnyOfTheChildFieldsChecked = isAnyFieldChecked(field.fields || []);
|
|
1531
1556
|
const allFieldsChecked = areAllFieldsChecked(field.fields || []);
|
|
@@ -1534,9 +1559,9 @@ const FieldSection = _ref3 => {
|
|
|
1534
1559
|
if (isParent) return areAllFieldsChecked(field.fields);
|
|
1535
1560
|
return field.isChecked;
|
|
1536
1561
|
};
|
|
1537
|
-
if (field
|
|
1562
|
+
if (!shouldDisplayField(field)) return null;
|
|
1538
1563
|
return jsxRuntime.jsx(CollapsibleFieldWrapper, {
|
|
1539
|
-
isForceExpanded:
|
|
1564
|
+
isForceExpanded: isSearchActive,
|
|
1540
1565
|
field: field,
|
|
1541
1566
|
children: _ref4 => {
|
|
1542
1567
|
let isOpen = _ref4.isOpen,
|
|
@@ -1551,17 +1576,17 @@ const FieldSection = _ref3 => {
|
|
|
1551
1576
|
left: `calc(-1 * ${uiKit.designTokens.spacingXl})`
|
|
1552
1577
|
},
|
|
1553
1578
|
onClick: () => {
|
|
1554
|
-
if (!
|
|
1579
|
+
if (!isSearchActive) {
|
|
1555
1580
|
updateExpandedGroups(`${groupName}.${field.name}`, !isOpen);
|
|
1556
1581
|
}
|
|
1557
1582
|
toggle();
|
|
1558
1583
|
},
|
|
1559
1584
|
icon: isOpen ? jsxRuntime.jsx(uiKit.AngleDownIcon, {}) : jsxRuntime.jsx(uiKit.AngleRightIcon, {}),
|
|
1560
1585
|
label: ""
|
|
1561
|
-
}), jsxRuntime.
|
|
1586
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1562
1587
|
scale: "s",
|
|
1563
1588
|
alignItems: "center",
|
|
1564
|
-
children: jsxRuntime.jsxs(uiKit.CheckboxInput, {
|
|
1589
|
+
children: [jsxRuntime.jsxs(uiKit.CheckboxInput, {
|
|
1565
1590
|
isIndeterminate: field.isExpandable && !allFieldsChecked && isAnyOfTheChildFieldsChecked,
|
|
1566
1591
|
isChecked: getIsChecked(),
|
|
1567
1592
|
isReadOnly: hasDependents || field.isRequired,
|
|
@@ -1592,26 +1617,60 @@ const FieldSection = _ref3 => {
|
|
|
1592
1617
|
updateAllChildFieldsChecked(path, checked);
|
|
1593
1618
|
},
|
|
1594
1619
|
children: [field.label, (hasDependents || field.isRequired) && ' *']
|
|
1595
|
-
})
|
|
1620
|
+
}), isChildrenCountDisplayed && field.fields && field.fields.length > 0 && jsxRuntime.jsx("div", {
|
|
1621
|
+
style: {
|
|
1622
|
+
flex: '0 0 auto'
|
|
1623
|
+
},
|
|
1624
|
+
children: jsxRuntime.jsx(FieldsCountStamp, {
|
|
1625
|
+
count: field.fields.length
|
|
1626
|
+
})
|
|
1627
|
+
})]
|
|
1596
1628
|
})]
|
|
1597
|
-
}), field.fields && field.fields
|
|
1629
|
+
}), field.fields && field.fields.length > 0 && jsxRuntime.jsx(StyledExpandableContent, {
|
|
1598
1630
|
ref: registerContentNode,
|
|
1599
1631
|
isOpen: isOpen,
|
|
1600
1632
|
children: isOpen && jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1601
1633
|
scale: "xl",
|
|
1602
1634
|
children: [jsxRuntime.jsx("div", {}), jsxRuntime.jsx(FieldSection, {
|
|
1603
1635
|
fields: field.fields,
|
|
1636
|
+
maxVisibleChildren: field.maxVisibleChildren,
|
|
1604
1637
|
formik: formik,
|
|
1605
1638
|
parentKeys: [...parentKeys, `fields[${index}]`],
|
|
1606
1639
|
isAnySiblingChecked: isAnySiblingChecked,
|
|
1607
|
-
|
|
1640
|
+
isSearchActive: isSearchActive,
|
|
1608
1641
|
groupName: groupName
|
|
1609
1642
|
})]
|
|
1610
1643
|
})
|
|
1611
1644
|
})]
|
|
1612
1645
|
}, `${field.name}-${index}`);
|
|
1613
1646
|
}
|
|
1614
|
-
}, `${field.name}.${
|
|
1647
|
+
}, `${field.name}.${isSearchActive}`);
|
|
1648
|
+
}), hasMoreFields && jsxRuntime.jsx("div", {
|
|
1649
|
+
css: /*#__PURE__*/react.css("padding-left:", uiKit.designTokens.spacingXs, ";" + ("" ), "" ),
|
|
1650
|
+
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
1651
|
+
tone: "tertiary",
|
|
1652
|
+
intlMessage: messages.loadMoreFields
|
|
1653
|
+
})
|
|
1654
|
+
})]
|
|
1655
|
+
});
|
|
1656
|
+
};
|
|
1657
|
+
|
|
1658
|
+
const SelectedGroupFieldsCountStamp = _ref => {
|
|
1659
|
+
let group = _ref.group;
|
|
1660
|
+
const _useIntl = reactIntl.useIntl(),
|
|
1661
|
+
formatMessage = _useIntl.formatMessage;
|
|
1662
|
+
return jsxRuntime.jsx(uiKit.Card, {
|
|
1663
|
+
type: "flat",
|
|
1664
|
+
insetScale: "m",
|
|
1665
|
+
children: jsxRuntime.jsx(uiKit.Spacings.Inline, {
|
|
1666
|
+
justifyContent: "flex-end",
|
|
1667
|
+
children: jsxRuntime.jsx(uiKit.Stamp, {
|
|
1668
|
+
tone: "secondary",
|
|
1669
|
+
isCondensed: true,
|
|
1670
|
+
label: formatMessage(messages.selected, {
|
|
1671
|
+
total: getGroupSelectedFieldCount(group)
|
|
1672
|
+
})
|
|
1673
|
+
})
|
|
1615
1674
|
})
|
|
1616
1675
|
});
|
|
1617
1676
|
};
|
|
@@ -1635,7 +1694,7 @@ const FieldGroupSection = _ref2 => {
|
|
|
1635
1694
|
let group = _ref2.group,
|
|
1636
1695
|
index = _ref2.index,
|
|
1637
1696
|
formik = _ref2.formik,
|
|
1638
|
-
|
|
1697
|
+
isSearchActive = _ref2.isSearchActive;
|
|
1639
1698
|
const allFieldsChecked = React.useMemo(() => areAllFieldsChecked(group.fields), [group.fields]);
|
|
1640
1699
|
const isAnyFieldInGroupChecked = React.useMemo(() => isAnyFieldChecked(group.fields), [group.fields]);
|
|
1641
1700
|
const _useExportFieldSelect = useExportFieldSelectionContext(),
|
|
@@ -1662,7 +1721,9 @@ const FieldGroupSection = _ref2 => {
|
|
|
1662
1721
|
};
|
|
1663
1722
|
if (group.isHidden) return null;
|
|
1664
1723
|
return jsxRuntime.jsx(uiKit.CollapsibleMotion, {
|
|
1665
|
-
isDefaultClosed:
|
|
1724
|
+
isDefaultClosed: isSearchActive ? false : !group.isExpanded
|
|
1725
|
+
// Reset collapse state when search input becomes active/inactive
|
|
1726
|
+
,
|
|
1666
1727
|
children: _ref3 => {
|
|
1667
1728
|
let isOpen = _ref3.isOpen,
|
|
1668
1729
|
toggle = _ref3.toggle,
|
|
@@ -1679,7 +1740,7 @@ const FieldGroupSection = _ref2 => {
|
|
|
1679
1740
|
children: [jsxRuntime.jsx(uiKit.IconButton, {
|
|
1680
1741
|
size: "20",
|
|
1681
1742
|
onClick: () => {
|
|
1682
|
-
if (!
|
|
1743
|
+
if (!isSearchActive) {
|
|
1683
1744
|
updateExpandedGroups(group.groupName, !isOpen);
|
|
1684
1745
|
}
|
|
1685
1746
|
toggle();
|
|
@@ -1704,26 +1765,23 @@ const FieldGroupSection = _ref2 => {
|
|
|
1704
1765
|
type: "flat",
|
|
1705
1766
|
insetScale: "m",
|
|
1706
1767
|
showTopBorder: true,
|
|
1707
|
-
children: isOpen && jsxRuntime.jsx(
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
groupName: group.groupName,
|
|
1715
|
-
isForceExpanded: isForceExpanded
|
|
1716
|
-
})
|
|
1768
|
+
children: isOpen && jsxRuntime.jsx(FieldSection, {
|
|
1769
|
+
fields: group.fields,
|
|
1770
|
+
formik: formik,
|
|
1771
|
+
parentKeys: [parentKey],
|
|
1772
|
+
isAnySiblingChecked: isAnyFieldInGroupChecked,
|
|
1773
|
+
groupName: group.groupName,
|
|
1774
|
+
isSearchActive: isSearchActive
|
|
1717
1775
|
})
|
|
1718
1776
|
})
|
|
1719
|
-
}), !isOpen && jsxRuntime.jsx(
|
|
1777
|
+
}), !isOpen && jsxRuntime.jsx(SelectedGroupFieldsCountStamp, {
|
|
1720
1778
|
group: group
|
|
1721
1779
|
})]
|
|
1722
1780
|
})
|
|
1723
1781
|
})]
|
|
1724
1782
|
});
|
|
1725
1783
|
}
|
|
1726
|
-
}, `${
|
|
1784
|
+
}, `${isSearchActive}`);
|
|
1727
1785
|
};
|
|
1728
1786
|
|
|
1729
1787
|
var _ref = {
|
|
@@ -1778,6 +1836,7 @@ const totalSpacing = 32 * 2 + (
|
|
|
1778
1836
|
// MC header
|
|
1779
1837
|
4; // borders
|
|
1780
1838
|
|
|
1839
|
+
const MIN_SEARCH_LENGTH = 3;
|
|
1781
1840
|
const StyledGridCard = /*#__PURE__*/_styled__default["default"](uiKit.Card, {
|
|
1782
1841
|
target: "e5mvpn60"
|
|
1783
1842
|
} )("max-height:calc(100vh - ", totalSpacing, "px);overflow:auto;" + ("" ));
|
|
@@ -1800,9 +1859,9 @@ const ExportFieldsSelectionStep = () => {
|
|
|
1800
1859
|
setCurrentStep = _useExportResourcesMo.setCurrentStep,
|
|
1801
1860
|
resourceType = _useExportResourcesMo.resourceType,
|
|
1802
1861
|
onClose = _useExportResourcesMo.onClose;
|
|
1862
|
+
const isSearchActive = fieldSearchTerm?.trim()?.length >= MIN_SEARCH_LENGTH;
|
|
1803
1863
|
React__default["default"].useEffect(() => {
|
|
1804
1864
|
var _context2;
|
|
1805
|
-
formik.validateForm();
|
|
1806
1865
|
updateFieldDependenciesStatus(formik);
|
|
1807
1866
|
const checkedFields = {};
|
|
1808
1867
|
function getCheckedFields(field, groupName) {
|
|
@@ -1843,7 +1902,7 @@ const ExportFieldsSelectionStep = () => {
|
|
|
1843
1902
|
});
|
|
1844
1903
|
});
|
|
1845
1904
|
};
|
|
1846
|
-
if (!
|
|
1905
|
+
if (!isSearchActive) return _valuesInstanceProperty__default["default"](formik).groups;
|
|
1847
1906
|
const updateGroups = groups => {
|
|
1848
1907
|
return _mapInstanceProperty__default["default"](groups).call(groups, group => {
|
|
1849
1908
|
const updatedFields = updateFields(group.fields, false);
|
|
@@ -1855,12 +1914,12 @@ const ExportFieldsSelectionStep = () => {
|
|
|
1855
1914
|
});
|
|
1856
1915
|
};
|
|
1857
1916
|
return updateGroups(_valuesInstanceProperty__default["default"](formik).groups);
|
|
1858
|
-
}, [_valuesInstanceProperty__default["default"](formik).groups, fieldSearchTerm]);
|
|
1917
|
+
}, [_valuesInstanceProperty__default["default"](formik).groups, fieldSearchTerm, isSearchActive]);
|
|
1859
1918
|
const onSearchChange = React__default["default"].useCallback(event => {
|
|
1860
1919
|
setFieldSearchTerm(event.target.value);
|
|
1861
1920
|
}, [setFieldSearchTerm]);
|
|
1862
1921
|
const hasResults = Boolean(_findInstanceProperty__default["default"](filteredGroups).call(filteredGroups, group => !group.isHidden));
|
|
1863
|
-
const onSearchChangeDebounced = React__default["default"].useMemo(() => debounce__default["default"](onSearchChange,
|
|
1922
|
+
const onSearchChangeDebounced = React__default["default"].useMemo(() => debounce__default["default"](onSearchChange, 500), [onSearchChange]);
|
|
1864
1923
|
const onSearchReset = () => {
|
|
1865
1924
|
setFieldSearchTerm('');
|
|
1866
1925
|
};
|
|
@@ -1900,7 +1959,7 @@ const ExportFieldsSelectionStep = () => {
|
|
|
1900
1959
|
group: group,
|
|
1901
1960
|
index: index,
|
|
1902
1961
|
formik: formik,
|
|
1903
|
-
|
|
1962
|
+
isSearchActive: isSearchActive
|
|
1904
1963
|
}, group.groupName))
|
|
1905
1964
|
})
|
|
1906
1965
|
}) : jsxRuntime.jsx(NoSearchResults, {})]
|
|
@@ -1945,9 +2004,6 @@ const ExportResourcesProvider = _ref => {
|
|
|
1945
2004
|
}),
|
|
1946
2005
|
onSubmit
|
|
1947
2006
|
});
|
|
1948
|
-
React__default["default"].useEffect(() => {
|
|
1949
|
-
formik$1.validateForm();
|
|
1950
|
-
}, [currentStep]);
|
|
1951
2007
|
return jsxRuntime.jsx(ExportResourcesContext.Provider, {
|
|
1952
2008
|
value: {
|
|
1953
2009
|
formik: formik$1,
|
|
@@ -1981,17 +2037,17 @@ const getChunkImport = locale => {
|
|
|
1981
2037
|
const intlLocale = i18n.mapLocaleToIntlLocale(locale);
|
|
1982
2038
|
switch (intlLocale) {
|
|
1983
2039
|
case 'de':
|
|
1984
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-de" */'./de-
|
|
2040
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-de" */'./de-1903dccf.cjs.prod.js'); });
|
|
1985
2041
|
case 'es':
|
|
1986
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-es" */'./es-
|
|
2042
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-es" */'./es-7959f578.cjs.prod.js'); });
|
|
1987
2043
|
case 'fr-FR':
|
|
1988
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-fr-FR" */'./fr-FR-
|
|
2044
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-fr-FR" */'./fr-FR-0a721f97.cjs.prod.js'); });
|
|
1989
2045
|
case 'ja':
|
|
1990
2046
|
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-ja" */'./ja-37632763.cjs.prod.js'); });
|
|
1991
2047
|
case 'pt-BR':
|
|
1992
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "change-history-i18n-pt-BR" */'./pt-BR-
|
|
2048
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "change-history-i18n-pt-BR" */'./pt-BR-89644b77.cjs.prod.js'); });
|
|
1993
2049
|
default:
|
|
1994
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-en" */'./en-
|
|
2050
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-en" */'./en-56c15954.cjs.prod.js'); });
|
|
1995
2051
|
}
|
|
1996
2052
|
};
|
|
1997
2053
|
const loadMessages = async locale => {
|