@activecollab/components 1.0.304 → 1.0.306
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/cjs/components/Autocomplete/Autocomplete.js +44 -34
- package/dist/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/dist/cjs/components/Icons/collection/ArrowRefresh.js +4 -2
- package/dist/cjs/components/Icons/collection/ArrowRefresh.js.map +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.js +44 -34
- package/dist/esm/components/Autocomplete/Autocomplete.js.map +1 -1
- package/dist/esm/components/Icons/collection/ArrowRefresh.d.ts.map +1 -1
- package/dist/esm/components/Icons/collection/ArrowRefresh.js +4 -2
- package/dist/esm/components/Icons/collection/ArrowRefresh.js.map +1 -1
- package/dist/index.js +48 -36
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1589,14 +1589,16 @@
|
|
|
1589
1589
|
return /*#__PURE__*/React__default["default"].createElement("svg", _extends({
|
|
1590
1590
|
width: 24,
|
|
1591
1591
|
height: 24,
|
|
1592
|
+
viewBox: "0 0 24 24",
|
|
1592
1593
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1593
1594
|
"data-testid": "ArrowRefreshIcon",
|
|
1594
1595
|
fill: "var(--color-theme-600)",
|
|
1595
1596
|
focusable: false,
|
|
1596
1597
|
ref: svgRef
|
|
1597
1598
|
}, props), /*#__PURE__*/React__default["default"].createElement("path", {
|
|
1598
|
-
|
|
1599
|
-
|
|
1599
|
+
fillRule: "evenodd",
|
|
1600
|
+
clipRule: "evenodd",
|
|
1601
|
+
d: "M12 3a9 9 0 00-9 9H1l3 3.89L7 12H5a7 7 0 117 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.896 8.896 0 0012 21a9 9 0 100-18z"
|
|
1600
1602
|
}));
|
|
1601
1603
|
});
|
|
1602
1604
|
ArrowRefreshIcon.displayName = "ArrowRefreshIcon";
|
|
@@ -10377,51 +10379,61 @@
|
|
|
10377
10379
|
return [selected];
|
|
10378
10380
|
}, [selected]);
|
|
10379
10381
|
var handleSort = React.useCallback(function (opts) {
|
|
10382
|
+
var _opts$;
|
|
10380
10383
|
if (keepSameOptionsOrder) {
|
|
10381
10384
|
return opts;
|
|
10382
10385
|
}
|
|
10383
|
-
var
|
|
10384
|
-
if (
|
|
10385
|
-
return
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
return
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
return !selectedIdsSet.has(opt.id);
|
|
10399
|
-
}));
|
|
10400
|
-
}
|
|
10401
|
-
return opts.map(function (group) {
|
|
10402
|
-
var groupSelectedOptions = group.options.filter(function (opt) {
|
|
10403
|
-
return selectedIdsSet.has(opt.id);
|
|
10404
|
-
});
|
|
10405
|
-
var groupUnselectedOptions = group.options.filter(function (opt) {
|
|
10406
|
-
return !selectedIdsSet.has(opt.id);
|
|
10407
|
-
});
|
|
10408
|
-
var selectedOptionsInOrder = groupSelectedOptions.sort(function (a, b) {
|
|
10409
|
-
return selectedOptions.indexOf(a.id) - selectedOptions.indexOf(b.id);
|
|
10386
|
+
var isGrouped = Array.isArray((_opts$ = opts[0]) === null || _opts$ === void 0 ? void 0 : _opts$.options);
|
|
10387
|
+
if (isGrouped) {
|
|
10388
|
+
return opts.map(function (group) {
|
|
10389
|
+
var sortedGroupOptions = group.options.sort(function (a, b) {
|
|
10390
|
+
if (selectedOptions.includes(b.id) && !selectedOptions.includes(a.id)) {
|
|
10391
|
+
return 1;
|
|
10392
|
+
}
|
|
10393
|
+
if (selectedOptions.includes(a.id) && !selectedOptions.includes(b.id)) {
|
|
10394
|
+
return -1;
|
|
10395
|
+
}
|
|
10396
|
+
return 0;
|
|
10397
|
+
});
|
|
10398
|
+
return _objectSpread2(_objectSpread2({}, group), {}, {
|
|
10399
|
+
options: sortedGroupOptions
|
|
10400
|
+
});
|
|
10410
10401
|
});
|
|
10411
|
-
|
|
10412
|
-
return
|
|
10413
|
-
|
|
10402
|
+
} else {
|
|
10403
|
+
return opts.sort(function (a, b) {
|
|
10404
|
+
if (selectedOptions.includes(b.id) && !selectedOptions.includes(a.id)) {
|
|
10405
|
+
return 1;
|
|
10406
|
+
}
|
|
10407
|
+
if (selectedOptions.includes(a.id) && !selectedOptions.includes(b.id)) {
|
|
10408
|
+
return -1;
|
|
10409
|
+
}
|
|
10410
|
+
return 0;
|
|
10414
10411
|
});
|
|
10415
|
-
}
|
|
10412
|
+
}
|
|
10416
10413
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10417
10414
|
}, []);
|
|
10418
10415
|
var sortList = React.useCallback(function (options) {
|
|
10416
|
+
var _options$;
|
|
10419
10417
|
if (disabledInternalSort) {
|
|
10420
10418
|
return handleSort(_toConsumableArray(options));
|
|
10421
10419
|
}
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10420
|
+
var isGrouped = Array.isArray((_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.options);
|
|
10421
|
+
if (isGrouped) {
|
|
10422
|
+
var sortedOptions = options.map(function (group) {
|
|
10423
|
+
var sortedGroupOptions = group.options.sort(function (a, b) {
|
|
10424
|
+
return sortDirection === "asc" ? a.name.localeCompare(b.name) : b.name.localeCompare(a.name);
|
|
10425
|
+
});
|
|
10426
|
+
return _objectSpread2(_objectSpread2({}, group), {}, {
|
|
10427
|
+
options: handleSort(sortedGroupOptions)
|
|
10428
|
+
});
|
|
10429
|
+
});
|
|
10430
|
+
return handleSort(sortedOptions);
|
|
10431
|
+
} else {
|
|
10432
|
+
var _sortedOptions = options.sort(function (a, b) {
|
|
10433
|
+
return sortDirection === "asc" ? a.name.localeCompare(b.name) : b.name.localeCompare(a.name);
|
|
10434
|
+
});
|
|
10435
|
+
return handleSort(_sortedOptions);
|
|
10436
|
+
}
|
|
10425
10437
|
}, [sortDirection, disabledInternalSort, handleSort]);
|
|
10426
10438
|
var sortedList = React.useMemo(function () {
|
|
10427
10439
|
return sortList(options);
|