@aivenio/aquarium 2.5.1 → 2.5.3
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/atoms.cjs +1 -0
- package/dist/atoms.mjs +1 -0
- package/dist/src/molecules/Badge/Badge.js +2 -1
- package/dist/src/molecules/Combobox/Combobox.js +18 -6
- package/dist/src/molecules/Select/Select.js +2 -14
- package/dist/src/molecules/Select/utils.d.ts +1 -0
- package/dist/src/molecules/Select/utils.js +10 -1
- package/dist/system.cjs +72 -60
- package/dist/system.mjs +36 -24
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/system.cjs
CHANGED
@@ -8675,6 +8675,7 @@ var DotBadge = (_a) => {
|
|
8675
8675
|
}));
|
8676
8676
|
};
|
8677
8677
|
var Badge = createBadge("default", "Badge");
|
8678
|
+
Badge.displayName = "Badge";
|
8678
8679
|
Badge.Notification = NotificationBadge;
|
8679
8680
|
Badge.Notification.displayName = "Badge.Notification";
|
8680
8681
|
Badge.Dot = DotBadge;
|
@@ -10418,6 +10419,15 @@ var isOptionGroup = (val) => {
|
|
10418
10419
|
var hasOptionGroups = (val) => {
|
10419
10420
|
return val.some(isOptionGroup);
|
10420
10421
|
};
|
10422
|
+
var defaultGetValue = (opt) => {
|
10423
|
+
if (typeof opt === "string") {
|
10424
|
+
return opt;
|
10425
|
+
}
|
10426
|
+
if (typeof opt.value === "string") {
|
10427
|
+
return opt.value;
|
10428
|
+
}
|
10429
|
+
return opt;
|
10430
|
+
};
|
10421
10431
|
|
10422
10432
|
// src/molecules/Combobox/Combobox.tsx
|
10423
10433
|
var import_smallCross2 = __toESM(require_smallCross());
|
@@ -10480,8 +10490,23 @@ var ComboboxBase = (_a) => {
|
|
10480
10490
|
if (selected && itemToString(selected) === query) {
|
10481
10491
|
setInputItems(allOptions);
|
10482
10492
|
} else {
|
10483
|
-
|
10493
|
+
if (hasOptionGroups(options)) {
|
10494
|
+
const filteredGroupedOptions = options.flatMap(
|
10495
|
+
(group) => query ? (0, import_match_sorter.matchSorter)(group.options, query, { keys, threshold: import_match_sorter.matchSorter.rankings.CONTAINS }) : group.options
|
10496
|
+
);
|
10497
|
+
setInputItems(filteredGroupedOptions);
|
10498
|
+
} else {
|
10499
|
+
setInputItems(
|
10500
|
+
query ? (0, import_match_sorter.matchSorter)(allOptions, query, { keys, threshold: import_match_sorter.matchSorter.rankings.CONTAINS }) : allOptions
|
10501
|
+
);
|
10502
|
+
}
|
10503
|
+
}
|
10504
|
+
};
|
10505
|
+
const findItemByValue = (val) => {
|
10506
|
+
if (val === null) {
|
10507
|
+
return null;
|
10484
10508
|
}
|
10509
|
+
return val === void 0 ? void 0 : inputItems.find((opt) => defaultGetValue(opt) === defaultGetValue(val));
|
10485
10510
|
};
|
10486
10511
|
const {
|
10487
10512
|
isOpen,
|
@@ -10498,8 +10523,8 @@ var ComboboxBase = (_a) => {
|
|
10498
10523
|
selectItem
|
10499
10524
|
} = (0, import_downshift.useCombobox)({
|
10500
10525
|
id,
|
10501
|
-
selectedItem: value,
|
10502
|
-
defaultSelectedItem: defaultValue,
|
10526
|
+
selectedItem: findItemByValue(value),
|
10527
|
+
defaultSelectedItem: findItemByValue(defaultValue),
|
10503
10528
|
isItemDisabled: (item, index) => isOptionDisabled(item, index),
|
10504
10529
|
itemToString,
|
10505
10530
|
items: inputItems,
|
@@ -10533,7 +10558,7 @@ var ComboboxBase = (_a) => {
|
|
10533
10558
|
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
10534
10559
|
};
|
10535
10560
|
const renderGroup = (group) => {
|
10536
|
-
const groupInputItems =
|
10561
|
+
const groupInputItems = inputItems.filter((o) => group.options.includes(o));
|
10537
10562
|
return groupInputItems.length > 0 ? /* @__PURE__ */ import_react60.default.createElement(import_react60.default.Fragment, {
|
10538
10563
|
key: group.label
|
10539
10564
|
}, /* @__PURE__ */ import_react60.default.createElement(Select.Group, null, group.label), groupInputItems.map((opt) => renderItem(opt, inputItems.indexOf(opt)))) : null;
|
@@ -10669,11 +10694,11 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ import_react
|
|
10669
10694
|
|
10670
10695
|
// src/molecules/DataList/DataList.tsx
|
10671
10696
|
var import_react80 = __toESM(require("react"));
|
10672
|
-
var
|
10697
|
+
var import_utils17 = require("@react-stately/utils");
|
10673
10698
|
var import_castArray2 = __toESM(require("lodash/castArray"));
|
10674
10699
|
var import_compact = __toESM(require("lodash/compact"));
|
10675
10700
|
var import_groupBy2 = __toESM(require("lodash/groupBy"));
|
10676
|
-
var
|
10701
|
+
var import_isArray2 = __toESM(require("lodash/isArray"));
|
10677
10702
|
var import_isFunction3 = __toESM(require("lodash/isFunction"));
|
10678
10703
|
|
10679
10704
|
// src/molecules/List/List.tsx
|
@@ -10883,16 +10908,12 @@ var import_utils11 = require("@react-aria/utils");
|
|
10883
10908
|
var import_downshift2 = require("downshift");
|
10884
10909
|
var import_lodash = require("lodash");
|
10885
10910
|
var import_defaults = __toESM(require("lodash/defaults"));
|
10886
|
-
var import_isArray = __toESM(require("lodash/isArray"));
|
10887
10911
|
var import_isNil = __toESM(require("lodash/isNil"));
|
10888
10912
|
var import_omit6 = __toESM(require("lodash/omit"));
|
10889
10913
|
var hasIconProperty = (val) => {
|
10890
10914
|
var _a;
|
10891
10915
|
return typeof val === "string" || ((_a = val == null ? void 0 : val.icon) == null ? void 0 : _a.body) !== void 0;
|
10892
10916
|
};
|
10893
|
-
var hasOptionGroups2 = (val) => {
|
10894
|
-
return !val.some((opt) => (opt == null ? void 0 : opt.label) === void 0 || !(0, import_isArray.default)(opt == null ? void 0 : opt.options));
|
10895
|
-
};
|
10896
10917
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
10897
10918
|
var _a, _b;
|
10898
10919
|
return /* @__PURE__ */ import_react64.default.createElement(Select.Item, __spreadValues({
|
@@ -10902,15 +10923,6 @@ var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getVal
|
|
10902
10923
|
icon: item.icon
|
10903
10924
|
}), optionToString(item));
|
10904
10925
|
};
|
10905
|
-
var defaultGetValue = (opt) => {
|
10906
|
-
if (typeof opt === "string") {
|
10907
|
-
return opt;
|
10908
|
-
}
|
10909
|
-
if (typeof opt.value === "string") {
|
10910
|
-
return opt.value;
|
10911
|
-
}
|
10912
|
-
return "";
|
10913
|
-
};
|
10914
10926
|
var _SelectBase = (props) => {
|
10915
10927
|
var _b;
|
10916
10928
|
const withDefaults = (0, import_defaults.default)({}, props, {
|
@@ -10970,7 +10982,7 @@ var _SelectBase = (props) => {
|
|
10970
10982
|
const [hasFocus, setFocus] = (0, import_react64.useState)(false);
|
10971
10983
|
const targetRef = (0, import_react64.useRef)(null);
|
10972
10984
|
const menuRef = (0, import_react64.useRef)(null);
|
10973
|
-
const items =
|
10985
|
+
const items = hasOptionGroups(options) ? options.flatMap((g) => g.options) : options;
|
10974
10986
|
const findItemByValue = (val) => {
|
10975
10987
|
if (val === null) {
|
10976
10988
|
return null;
|
@@ -11051,7 +11063,7 @@ var _SelectBase = (props) => {
|
|
11051
11063
|
style: { width: (_b = targetRef.current) == null ? void 0 : _b.offsetWidth }
|
11052
11064
|
}, /* @__PURE__ */ import_react64.default.createElement(Select.Menu, __spreadValues({
|
11053
11065
|
maxHeight
|
11054
|
-
}, menuProps), options.length === 0 && /* @__PURE__ */ import_react64.default.createElement(Select.EmptyStateContainer, null, emptyState), options.length > 0 && !
|
11066
|
+
}, menuProps), options.length === 0 && /* @__PURE__ */ import_react64.default.createElement(Select.EmptyStateContainer, null, emptyState), options.length > 0 && !hasOptionGroups(options) && options.map(renderItem), options.length > 0 && hasOptionGroups(options) && options.map(renderGroup), actions.length > 0 && /* @__PURE__ */ import_react64.default.createElement(import_react64.default.Fragment, null, /* @__PURE__ */ import_react64.default.createElement(Select.Divider, {
|
11055
11067
|
onMouseOver: () => setHighlightedIndex(-1)
|
11056
11068
|
}), actions.map((act, index) => /* @__PURE__ */ import_react64.default.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
11057
11069
|
key: `${index}`
|
@@ -11777,9 +11789,9 @@ function useScrollStyles({
|
|
11777
11789
|
}
|
11778
11790
|
|
11779
11791
|
// src/utils/table/types.ts
|
11780
|
-
var
|
11792
|
+
var import_isArray = __toESM(require("lodash/isArray"));
|
11781
11793
|
var areRowsGrouped = (rows) => {
|
11782
|
-
return !(0,
|
11794
|
+
return !(0, import_isArray.default)(rows);
|
11783
11795
|
};
|
11784
11796
|
var toSortDirection = (direction) => direction === "ascending" ? "asc" : direction === "descending" ? "desc" : false;
|
11785
11797
|
var cellProps = (column) => {
|
@@ -11866,7 +11878,7 @@ var import_i18n2 = require("@react-aria/i18n");
|
|
11866
11878
|
var import_interactions2 = require("@react-aria/interactions");
|
11867
11879
|
var import_menu2 = require("@react-aria/menu");
|
11868
11880
|
var import_separator = require("@react-aria/separator");
|
11869
|
-
var
|
11881
|
+
var import_utils13 = require("@react-aria/utils");
|
11870
11882
|
var import_collections = require("@react-stately/collections");
|
11871
11883
|
var import_menu3 = require("@react-stately/menu");
|
11872
11884
|
var import_tree = require("@react-stately/tree");
|
@@ -12065,7 +12077,7 @@ var TriggerWrapper = (_a) => {
|
|
12065
12077
|
if (!trigger || !import_react74.default.isValidElement(trigger)) {
|
12066
12078
|
throw new Error("<DropdownMenu.Trigger> must have valid child");
|
12067
12079
|
}
|
12068
|
-
return import_react74.default.cloneElement(trigger, __spreadValues({ ref }, (0,
|
12080
|
+
return import_react74.default.cloneElement(trigger, __spreadValues({ ref }, (0, import_utils13.mergeProps)(pressProps, props)));
|
12069
12081
|
};
|
12070
12082
|
var isSectionNode = (item) => item.type === "section";
|
12071
12083
|
var isItemNode = (item) => item.type === "item";
|
@@ -12755,12 +12767,12 @@ var DataList2 = (_a) => {
|
|
12755
12767
|
const containerRef = (0, import_react80.useRef)(null);
|
12756
12768
|
const hasStickyColumns = columns.some((column) => column.sticky);
|
12757
12769
|
const stickyStyles = useScrollStyles({ containerRef, skip: !hasStickyColumns });
|
12758
|
-
const [selected, setSelected] = (0,
|
12770
|
+
const [selected, setSelected] = (0, import_utils17.useControlledState)(
|
12759
12771
|
selectedRows,
|
12760
12772
|
defaultSelectedRows,
|
12761
12773
|
(value) => onSelectionChange == null ? void 0 : onSelectionChange(value != null ? value : [])
|
12762
12774
|
);
|
12763
|
-
const [expandedGroupIds, setExpandedGroupIds] = (0,
|
12775
|
+
const [expandedGroupIds, setExpandedGroupIds] = (0, import_utils17.useControlledState)(_expandedGroupIds, []);
|
12764
12776
|
const onGroupToggled = (id, open) => {
|
12765
12777
|
if (!open) {
|
12766
12778
|
setExpandedGroupIds([...expandedGroupIds, id]);
|
@@ -12772,7 +12784,7 @@ var DataList2 = (_a) => {
|
|
12772
12784
|
const defaultSortedColumn = columns.find((c) => c.headerName === (defaultSort == null ? void 0 : defaultSort.headerName));
|
12773
12785
|
const initialSortState = defaultSortedColumn ? { column: defaultSortedColumn, direction: (_a2 = defaultSort == null ? void 0 : defaultSort.direction) != null ? _a2 : "ascending" } : {};
|
12774
12786
|
const [sort, updateSort] = useTableSort(__spreadProps(__spreadValues({}, initialSortState), { onSortChanged }));
|
12775
|
-
const sortedRows = (0,
|
12787
|
+
const sortedRows = (0, import_isArray2.default)(rows) ? sortRowsBy(rows, sort) : [];
|
12776
12788
|
const groups = areRowsGrouped(rows) ? rows : group ? (0, import_isFunction3.default)(group) ? group(sortedRows) : (0, import_groupBy2.default)(sortedRows, group) : void 0;
|
12777
12789
|
const isCollapsible = (0, import_isFunction3.default)(rowDetails);
|
12778
12790
|
const templateColumns = (0, import_compact.default)([
|
@@ -12969,7 +12981,7 @@ var DataList2 = (_a) => {
|
|
12969
12981
|
}, componentContent) : componentContent;
|
12970
12982
|
return /* @__PURE__ */ import_react80.default.createElement(DataListContext.Provider, {
|
12971
12983
|
value: {
|
12972
|
-
rows: (0,
|
12984
|
+
rows: (0, import_isArray2.default)(rows) ? sortedRows : rows,
|
12973
12985
|
selectedRows: selected
|
12974
12986
|
}
|
12975
12987
|
}, wrappedContent);
|
@@ -13221,7 +13233,7 @@ DataTable.Skeleton = DataListSkeleton;
|
|
13221
13233
|
var import_react91 = __toESM(require("react"));
|
13222
13234
|
var import_react_aria_components8 = require("react-aria-components");
|
13223
13235
|
var import_label2 = require("@react-aria/label");
|
13224
|
-
var
|
13236
|
+
var import_utils26 = require("@react-aria/utils");
|
13225
13237
|
var import_omit9 = __toESM(require("lodash/omit"));
|
13226
13238
|
|
13227
13239
|
// src/molecules/DateField/DateInput.tsx
|
@@ -13299,7 +13311,7 @@ var FieldGroup = (props) => {
|
|
13299
13311
|
var import_react86 = __toESM(require("react"));
|
13300
13312
|
var import_react_aria_components3 = require("react-aria-components");
|
13301
13313
|
var import_label = require("@react-aria/label");
|
13302
|
-
var
|
13314
|
+
var import_utils23 = require("@react-aria/utils");
|
13303
13315
|
var import_omit8 = __toESM(require("lodash/omit"));
|
13304
13316
|
function TimeFieldBase(_a) {
|
13305
13317
|
var _b = _a, { disabled, valid } = _b, props = __objRest(_b, ["disabled", "valid"]);
|
@@ -13310,7 +13322,7 @@ function TimeFieldBase(_a) {
|
|
13310
13322
|
}
|
13311
13323
|
function TimeField(props) {
|
13312
13324
|
const { labelProps, fieldProps } = (0, import_label.useLabel)({ label: props.labelText });
|
13313
|
-
const errorMessageId = (0,
|
13325
|
+
const errorMessageId = (0, import_utils23.useId)();
|
13314
13326
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13315
13327
|
const _a = getLabelControlProps(props), { "data-testid": dataTestId } = _a, labelControlProps = __objRest(_a, ["data-testid"]);
|
13316
13328
|
const baseProps = (0, import_omit8.default)(props, Object.keys(labelControlProps));
|
@@ -13485,7 +13497,7 @@ var PickerTimeField = ({ granularity }) => {
|
|
13485
13497
|
var createDatePicker = (variant) => (props) => {
|
13486
13498
|
var _a;
|
13487
13499
|
const { labelProps, fieldProps } = (0, import_label2.useLabel)({ label: props.labelText });
|
13488
|
-
const errorMessageId = (0,
|
13500
|
+
const errorMessageId = (0, import_utils26.useId)();
|
13489
13501
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": (_a = props.helperText) != null ? _a : props.error } : {};
|
13490
13502
|
const _b = getLabelControlProps(props), { "data-testid": dataTestId } = _b, labelControlProps = __objRest(_b, ["data-testid"]);
|
13491
13503
|
const baseProps = (0, import_omit9.default)(props, Object.keys(labelControlProps));
|
@@ -13502,7 +13514,7 @@ var DateTimePicker = createDatePicker("datetime");
|
|
13502
13514
|
var import_react93 = __toESM(require("react"));
|
13503
13515
|
var import_react_aria_components10 = require("react-aria-components");
|
13504
13516
|
var import_label3 = require("@react-aria/label");
|
13505
|
-
var
|
13517
|
+
var import_utils28 = require("@react-aria/utils");
|
13506
13518
|
var import_omit10 = __toESM(require("lodash/omit"));
|
13507
13519
|
var import_calendar3 = __toESM(require_calendar());
|
13508
13520
|
|
@@ -13624,7 +13636,7 @@ var DateTimeRangePickerBase = createDateRangePickerBase("datetime");
|
|
13624
13636
|
var createDateRangePicker = (variant) => (props) => {
|
13625
13637
|
var _a;
|
13626
13638
|
const { labelProps, fieldProps } = (0, import_label3.useLabel)({ label: props.labelText });
|
13627
|
-
const errorMessageId = (0,
|
13639
|
+
const errorMessageId = (0, import_utils28.useId)();
|
13628
13640
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": (_a = props.helperText) != null ? _a : props.error } : {};
|
13629
13641
|
const _b = getLabelControlProps(props), { "data-testid": dataTestId } = _b, labelControlProps = __objRest(_b, ["data-testid"]);
|
13630
13642
|
const baseProps = (0, import_omit10.default)(props, Object.keys(labelControlProps));
|
@@ -13641,7 +13653,7 @@ var DateTimeRangePicker = createDateRangePicker("datetime");
|
|
13641
13653
|
var import_react95 = __toESM(require("react"));
|
13642
13654
|
var import_dialog = require("@react-aria/dialog");
|
13643
13655
|
var import_overlays6 = require("@react-aria/overlays");
|
13644
|
-
var
|
13656
|
+
var import_utils29 = require("@react-aria/utils");
|
13645
13657
|
var import_overlays7 = require("@react-stately/overlays");
|
13646
13658
|
var import_omit11 = __toESM(require("lodash/omit"));
|
13647
13659
|
|
@@ -13900,8 +13912,8 @@ var DialogWrapper = ({
|
|
13900
13912
|
secondaryAction
|
13901
13913
|
}) => {
|
13902
13914
|
const ref = import_react95.default.useRef(null);
|
13903
|
-
const labelledBy = (0,
|
13904
|
-
const describedBy = (0,
|
13915
|
+
const labelledBy = (0, import_utils29.useId)();
|
13916
|
+
const describedBy = (0, import_utils29.useId)();
|
13905
13917
|
const { dialogProps } = (0, import_dialog.useDialog)(
|
13906
13918
|
{
|
13907
13919
|
"role": "alertdialog",
|
@@ -14361,7 +14373,7 @@ var import_react102 = __toESM(require("react"));
|
|
14361
14373
|
var import_react101 = __toESM(require("react"));
|
14362
14374
|
var import_interactions3 = require("@react-aria/interactions");
|
14363
14375
|
var import_overlays8 = require("@react-aria/overlays");
|
14364
|
-
var
|
14376
|
+
var import_utils31 = require("@react-aria/utils");
|
14365
14377
|
var import_overlays9 = require("@react-stately/overlays");
|
14366
14378
|
var import_classnames10 = __toESM(require("classnames"));
|
14367
14379
|
var import_omit13 = __toESM(require("lodash/omit"));
|
@@ -14474,7 +14486,7 @@ var PopoverTriggerWrapper = (_a) => {
|
|
14474
14486
|
const { pressProps } = (0, import_interactions3.usePress)(__spreadProps(__spreadValues({}, rest), { ref }));
|
14475
14487
|
return import_react101.default.cloneElement(trigger, __spreadProps(__spreadValues({
|
14476
14488
|
"ref": ref
|
14477
|
-
}, (0,
|
14489
|
+
}, (0, import_utils31.mergeProps)(pressProps, trigger.props)), {
|
14478
14490
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
14479
14491
|
}));
|
14480
14492
|
};
|
@@ -14936,7 +14948,7 @@ var ModalTabs = createTabsComponent(
|
|
14936
14948
|
|
14937
14949
|
// src/molecules/MultiInput/MultiInput.tsx
|
14938
14950
|
var import_react113 = __toESM(require("react"));
|
14939
|
-
var
|
14951
|
+
var import_utils34 = require("@react-aria/utils");
|
14940
14952
|
var import_castArray5 = __toESM(require("lodash/castArray"));
|
14941
14953
|
var import_identity = __toESM(require("lodash/identity"));
|
14942
14954
|
var import_omit15 = __toESM(require("lodash/omit"));
|
@@ -15167,9 +15179,9 @@ var MultiInput = (props) => {
|
|
15167
15179
|
var _a2;
|
15168
15180
|
setValue((_a2 = props.value) != null ? _a2 : []);
|
15169
15181
|
}, [JSON.stringify(props.value)]);
|
15170
|
-
const defaultId = (0,
|
15182
|
+
const defaultId = (0, import_utils34.useId)();
|
15171
15183
|
const id = (_e = (_d = props.id) != null ? _d : props.name) != null ? _e : defaultId;
|
15172
|
-
const errorMessageId = (0,
|
15184
|
+
const errorMessageId = (0, import_utils34.useId)();
|
15173
15185
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
15174
15186
|
const labelControlProps = getLabelControlProps(props);
|
15175
15187
|
const baseProps = (0, import_omit15.default)(props, Object.keys(labelControlProps));
|
@@ -15200,7 +15212,7 @@ MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
|
15200
15212
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
15201
15213
|
var import_react114 = __toESM(require("react"));
|
15202
15214
|
var import_overlays10 = require("@react-aria/overlays");
|
15203
|
-
var
|
15215
|
+
var import_utils35 = require("@react-aria/utils");
|
15204
15216
|
var import_downshift3 = require("downshift");
|
15205
15217
|
var import_isEqual = __toESM(require("lodash/isEqual"));
|
15206
15218
|
var import_isNil2 = __toESM(require("lodash/isNil"));
|
@@ -15438,9 +15450,9 @@ var MultiSelect = (_a) => {
|
|
15438
15450
|
"emptyState"
|
15439
15451
|
]);
|
15440
15452
|
var _a2;
|
15441
|
-
const defaultId = (0,
|
15453
|
+
const defaultId = (0, import_utils35.useId)();
|
15442
15454
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
15443
|
-
const errorMessageId = (0,
|
15455
|
+
const errorMessageId = (0, import_utils35.useId)();
|
15444
15456
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
15445
15457
|
const labelControlProps = getLabelControlProps(props);
|
15446
15458
|
const baseProps = (0, import_omit16.default)(props, Object.keys(labelControlProps));
|
@@ -15464,7 +15476,7 @@ MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
|
15464
15476
|
|
15465
15477
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
15466
15478
|
var import_react115 = __toESM(require("react"));
|
15467
|
-
var
|
15479
|
+
var import_utils37 = require("@react-aria/utils");
|
15468
15480
|
var import_omit17 = __toESM(require("lodash/omit"));
|
15469
15481
|
var import_uniqueId = __toESM(require("lodash/uniqueId"));
|
15470
15482
|
var import_caretDown2 = __toESM(require_caretDown());
|
@@ -15526,9 +15538,9 @@ var NativeSelect = import_react115.default.forwardRef(
|
|
15526
15538
|
(_a, ref) => {
|
15527
15539
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
15528
15540
|
var _a2;
|
15529
|
-
const defaultId = (0,
|
15541
|
+
const defaultId = (0, import_utils37.useId)();
|
15530
15542
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
15531
|
-
const errorMessageId = (0,
|
15543
|
+
const errorMessageId = (0, import_utils37.useId)();
|
15532
15544
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
15533
15545
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
15534
15546
|
const baseProps = (0, import_omit17.default)(props, Object.keys(labelControlProps));
|
@@ -15987,7 +15999,7 @@ RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
|
15987
15999
|
|
15988
16000
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
15989
16001
|
var import_react125 = __toESM(require("react"));
|
15990
|
-
var
|
16002
|
+
var import_utils39 = require("@react-aria/utils");
|
15991
16003
|
var isRadioButton = (c) => {
|
15992
16004
|
return import_react125.default.isValidElement(c) && c.type === RadioButton2;
|
15993
16005
|
};
|
@@ -16013,7 +16025,7 @@ var RadioButtonGroup = (_a) => {
|
|
16013
16025
|
]);
|
16014
16026
|
var _a2;
|
16015
16027
|
const [value, setValue] = import_react125.default.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
16016
|
-
const errorMessageId = (0,
|
16028
|
+
const errorMessageId = (0, import_utils39.useId)();
|
16017
16029
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16018
16030
|
const labelControlProps = getLabelControlProps(props);
|
16019
16031
|
if (_value !== void 0 && _value !== value) {
|
@@ -16069,7 +16081,7 @@ RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
|
16069
16081
|
// src/molecules/Section/Section.tsx
|
16070
16082
|
var import_react130 = __toESM(require("react"));
|
16071
16083
|
var import_button4 = require("@react-aria/button");
|
16072
|
-
var
|
16084
|
+
var import_utils40 = require("@react-aria/utils");
|
16073
16085
|
var import_web6 = require("@react-spring/web");
|
16074
16086
|
var import_castArray7 = __toESM(require("lodash/castArray"));
|
16075
16087
|
var import_isUndefined9 = __toESM(require("lodash/isUndefined"));
|
@@ -16333,9 +16345,9 @@ var Section4 = (props) => {
|
|
16333
16345
|
onStart: () => isMounted.current && setResting(false),
|
16334
16346
|
onRest: () => isMounted.current && setResting(true)
|
16335
16347
|
}), { transform } = _f, spring = __objRest(_f, ["transform"]);
|
16336
|
-
const toggleId = (0,
|
16337
|
-
const regionId = (0,
|
16338
|
-
const titleId = (0,
|
16348
|
+
const toggleId = (0, import_utils40.useId)();
|
16349
|
+
const regionId = (0, import_utils40.useId)();
|
16350
|
+
const titleId = (0, import_utils40.useId)();
|
16339
16351
|
const hasTabs = isComponentType(children, Tabs);
|
16340
16352
|
const { buttonProps } = (0, import_button4.useButton)(
|
16341
16353
|
{ "elementType": "div", "onPress": handleTitleClick, "aria-expanded": !isCollapsed, "aria-controls": regionId },
|
@@ -16584,7 +16596,7 @@ Stepper2.Step = Step2;
|
|
16584
16596
|
|
16585
16597
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
16586
16598
|
var import_react134 = __toESM(require("react"));
|
16587
|
-
var
|
16599
|
+
var import_utils43 = require("@react-aria/utils");
|
16588
16600
|
var SwitchGroup = (_a) => {
|
16589
16601
|
var _b = _a, {
|
16590
16602
|
value,
|
@@ -16606,7 +16618,7 @@ var SwitchGroup = (_a) => {
|
|
16606
16618
|
if (value !== void 0 && value !== selectedItems) {
|
16607
16619
|
setSelectedItems(value);
|
16608
16620
|
}
|
16609
|
-
const errorMessageId = (0,
|
16621
|
+
const errorMessageId = (0, import_utils43.useId)();
|
16610
16622
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16611
16623
|
const labelControlProps = getLabelControlProps(props);
|
16612
16624
|
const handleChange = (e) => {
|
@@ -16650,7 +16662,7 @@ SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
|
16650
16662
|
|
16651
16663
|
// src/molecules/Textarea/Textarea.tsx
|
16652
16664
|
var import_react135 = __toESM(require("react"));
|
16653
|
-
var
|
16665
|
+
var import_utils45 = require("@react-aria/utils");
|
16654
16666
|
var import_omit19 = __toESM(require("lodash/omit"));
|
16655
16667
|
var import_toString2 = __toESM(require("lodash/toString"));
|
16656
16668
|
var TextareaBase = import_react135.default.forwardRef(
|
@@ -16670,9 +16682,9 @@ TextareaBase.Skeleton = () => /* @__PURE__ */ import_react135.default.createElem
|
|
16670
16682
|
var Textarea = import_react135.default.forwardRef((props, ref) => {
|
16671
16683
|
var _a, _b, _c;
|
16672
16684
|
const [value, setValue] = (0, import_react135.useState)((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
16673
|
-
const defaultId = (0,
|
16685
|
+
const defaultId = (0, import_utils45.useId)();
|
16674
16686
|
const id = (_c = props.id) != null ? _c : defaultId;
|
16675
|
-
const errorMessageId = (0,
|
16687
|
+
const errorMessageId = (0, import_utils45.useId)();
|
16676
16688
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16677
16689
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
16678
16690
|
const baseProps = (0, import_omit19.default)(props, Object.keys(labelControlProps));
|
package/dist/system.mjs
CHANGED
@@ -8512,6 +8512,7 @@ var DotBadge = (_a) => {
|
|
8512
8512
|
}));
|
8513
8513
|
};
|
8514
8514
|
var Badge = createBadge("default", "Badge");
|
8515
|
+
Badge.displayName = "Badge";
|
8515
8516
|
Badge.Notification = NotificationBadge;
|
8516
8517
|
Badge.Notification.displayName = "Badge.Notification";
|
8517
8518
|
Badge.Dot = DotBadge;
|
@@ -10255,6 +10256,15 @@ var isOptionGroup = (val) => {
|
|
10255
10256
|
var hasOptionGroups = (val) => {
|
10256
10257
|
return val.some(isOptionGroup);
|
10257
10258
|
};
|
10259
|
+
var defaultGetValue = (opt) => {
|
10260
|
+
if (typeof opt === "string") {
|
10261
|
+
return opt;
|
10262
|
+
}
|
10263
|
+
if (typeof opt.value === "string") {
|
10264
|
+
return opt.value;
|
10265
|
+
}
|
10266
|
+
return opt;
|
10267
|
+
};
|
10258
10268
|
|
10259
10269
|
// src/molecules/Combobox/Combobox.tsx
|
10260
10270
|
var import_smallCross2 = __toESM(require_smallCross());
|
@@ -10317,8 +10327,23 @@ var ComboboxBase = (_a) => {
|
|
10317
10327
|
if (selected && itemToString(selected) === query) {
|
10318
10328
|
setInputItems(allOptions);
|
10319
10329
|
} else {
|
10320
|
-
|
10330
|
+
if (hasOptionGroups(options)) {
|
10331
|
+
const filteredGroupedOptions = options.flatMap(
|
10332
|
+
(group) => query ? matchSorter(group.options, query, { keys, threshold: matchSorter.rankings.CONTAINS }) : group.options
|
10333
|
+
);
|
10334
|
+
setInputItems(filteredGroupedOptions);
|
10335
|
+
} else {
|
10336
|
+
setInputItems(
|
10337
|
+
query ? matchSorter(allOptions, query, { keys, threshold: matchSorter.rankings.CONTAINS }) : allOptions
|
10338
|
+
);
|
10339
|
+
}
|
10340
|
+
}
|
10341
|
+
};
|
10342
|
+
const findItemByValue = (val) => {
|
10343
|
+
if (val === null) {
|
10344
|
+
return null;
|
10321
10345
|
}
|
10346
|
+
return val === void 0 ? void 0 : inputItems.find((opt) => defaultGetValue(opt) === defaultGetValue(val));
|
10322
10347
|
};
|
10323
10348
|
const {
|
10324
10349
|
isOpen,
|
@@ -10335,8 +10360,8 @@ var ComboboxBase = (_a) => {
|
|
10335
10360
|
selectItem
|
10336
10361
|
} = useCombobox({
|
10337
10362
|
id,
|
10338
|
-
selectedItem: value,
|
10339
|
-
defaultSelectedItem: defaultValue,
|
10363
|
+
selectedItem: findItemByValue(value),
|
10364
|
+
defaultSelectedItem: findItemByValue(defaultValue),
|
10340
10365
|
isItemDisabled: (item, index) => isOptionDisabled(item, index),
|
10341
10366
|
itemToString,
|
10342
10367
|
items: inputItems,
|
@@ -10370,7 +10395,7 @@ var ComboboxBase = (_a) => {
|
|
10370
10395
|
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
10371
10396
|
};
|
10372
10397
|
const renderGroup = (group) => {
|
10373
|
-
const groupInputItems =
|
10398
|
+
const groupInputItems = inputItems.filter((o) => group.options.includes(o));
|
10374
10399
|
return groupInputItems.length > 0 ? /* @__PURE__ */ React54.createElement(React54.Fragment, {
|
10375
10400
|
key: group.label
|
10376
10401
|
}, /* @__PURE__ */ React54.createElement(Select.Group, null, group.label), groupInputItems.map((opt) => renderItem(opt, inputItems.indexOf(opt)))) : null;
|
@@ -10510,7 +10535,7 @@ import { useControlledState } from "@react-stately/utils";
|
|
10510
10535
|
import castArray2 from "lodash/castArray";
|
10511
10536
|
import compact from "lodash/compact";
|
10512
10537
|
import groupBy2 from "lodash/groupBy";
|
10513
|
-
import
|
10538
|
+
import isArray2 from "lodash/isArray";
|
10514
10539
|
import isFunction3 from "lodash/isFunction";
|
10515
10540
|
|
10516
10541
|
// src/molecules/List/List.tsx
|
@@ -10720,16 +10745,12 @@ import { useId as useId8 } from "@react-aria/utils";
|
|
10720
10745
|
import { useSelect } from "downshift";
|
10721
10746
|
import { without } from "lodash";
|
10722
10747
|
import defaults from "lodash/defaults";
|
10723
|
-
import isArray from "lodash/isArray";
|
10724
10748
|
import isNil from "lodash/isNil";
|
10725
10749
|
import omit6 from "lodash/omit";
|
10726
10750
|
var hasIconProperty = (val) => {
|
10727
10751
|
var _a;
|
10728
10752
|
return typeof val === "string" || ((_a = val == null ? void 0 : val.icon) == null ? void 0 : _a.body) !== void 0;
|
10729
10753
|
};
|
10730
|
-
var hasOptionGroups2 = (val) => {
|
10731
|
-
return !val.some((opt) => (opt == null ? void 0 : opt.label) === void 0 || !isArray(opt == null ? void 0 : opt.options));
|
10732
|
-
};
|
10733
10754
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
10734
10755
|
var _a, _b;
|
10735
10756
|
return /* @__PURE__ */ React58.createElement(Select.Item, __spreadValues({
|
@@ -10739,15 +10760,6 @@ var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getVal
|
|
10739
10760
|
icon: item.icon
|
10740
10761
|
}), optionToString(item));
|
10741
10762
|
};
|
10742
|
-
var defaultGetValue = (opt) => {
|
10743
|
-
if (typeof opt === "string") {
|
10744
|
-
return opt;
|
10745
|
-
}
|
10746
|
-
if (typeof opt.value === "string") {
|
10747
|
-
return opt.value;
|
10748
|
-
}
|
10749
|
-
return "";
|
10750
|
-
};
|
10751
10763
|
var _SelectBase = (props) => {
|
10752
10764
|
var _b;
|
10753
10765
|
const withDefaults = defaults({}, props, {
|
@@ -10807,7 +10819,7 @@ var _SelectBase = (props) => {
|
|
10807
10819
|
const [hasFocus, setFocus] = useState8(false);
|
10808
10820
|
const targetRef = useRef7(null);
|
10809
10821
|
const menuRef = useRef7(null);
|
10810
|
-
const items =
|
10822
|
+
const items = hasOptionGroups(options) ? options.flatMap((g) => g.options) : options;
|
10811
10823
|
const findItemByValue = (val) => {
|
10812
10824
|
if (val === null) {
|
10813
10825
|
return null;
|
@@ -10888,7 +10900,7 @@ var _SelectBase = (props) => {
|
|
10888
10900
|
style: { width: (_b = targetRef.current) == null ? void 0 : _b.offsetWidth }
|
10889
10901
|
}, /* @__PURE__ */ React58.createElement(Select.Menu, __spreadValues({
|
10890
10902
|
maxHeight
|
10891
|
-
}, menuProps), options.length === 0 && /* @__PURE__ */ React58.createElement(Select.EmptyStateContainer, null, emptyState), options.length > 0 && !
|
10903
|
+
}, menuProps), options.length === 0 && /* @__PURE__ */ React58.createElement(Select.EmptyStateContainer, null, emptyState), options.length > 0 && !hasOptionGroups(options) && options.map(renderItem), options.length > 0 && hasOptionGroups(options) && options.map(renderGroup), actions.length > 0 && /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(Select.Divider, {
|
10892
10904
|
onMouseOver: () => setHighlightedIndex(-1)
|
10893
10905
|
}), actions.map((act, index) => /* @__PURE__ */ React58.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
10894
10906
|
key: `${index}`
|
@@ -11614,9 +11626,9 @@ function useScrollStyles({
|
|
11614
11626
|
}
|
11615
11627
|
|
11616
11628
|
// src/utils/table/types.ts
|
11617
|
-
import
|
11629
|
+
import isArray from "lodash/isArray";
|
11618
11630
|
var areRowsGrouped = (rows) => {
|
11619
|
-
return !
|
11631
|
+
return !isArray(rows);
|
11620
11632
|
};
|
11621
11633
|
var toSortDirection = (direction) => direction === "ascending" ? "asc" : direction === "descending" ? "desc" : false;
|
11622
11634
|
var cellProps = (column) => {
|
@@ -12609,7 +12621,7 @@ var DataList2 = (_a) => {
|
|
12609
12621
|
const defaultSortedColumn = columns.find((c) => c.headerName === (defaultSort == null ? void 0 : defaultSort.headerName));
|
12610
12622
|
const initialSortState = defaultSortedColumn ? { column: defaultSortedColumn, direction: (_a2 = defaultSort == null ? void 0 : defaultSort.direction) != null ? _a2 : "ascending" } : {};
|
12611
12623
|
const [sort, updateSort] = useTableSort(__spreadProps(__spreadValues({}, initialSortState), { onSortChanged }));
|
12612
|
-
const sortedRows =
|
12624
|
+
const sortedRows = isArray2(rows) ? sortRowsBy(rows, sort) : [];
|
12613
12625
|
const groups = areRowsGrouped(rows) ? rows : group ? isFunction3(group) ? group(sortedRows) : groupBy2(sortedRows, group) : void 0;
|
12614
12626
|
const isCollapsible = isFunction3(rowDetails);
|
12615
12627
|
const templateColumns = compact([
|
@@ -12806,7 +12818,7 @@ var DataList2 = (_a) => {
|
|
12806
12818
|
}, componentContent) : componentContent;
|
12807
12819
|
return /* @__PURE__ */ React72.createElement(DataListContext.Provider, {
|
12808
12820
|
value: {
|
12809
|
-
rows:
|
12821
|
+
rows: isArray2(rows) ? sortedRows : rows,
|
12810
12822
|
selectedRows: selected
|
12811
12823
|
}
|
12812
12824
|
}, wrappedContent);
|