@uniformdev/design-system 19.121.0 → 19.121.1-alpha.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/esm/{importedIcons-GRLD5JXK.js → importedIcons-XEGXOSVC.js} +2 -0
- package/dist/esm/index.js +330 -112
- package/dist/index.d.mts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +326 -104
- package/package.json +4 -4
package/dist/esm/index.js
CHANGED
|
@@ -1255,7 +1255,7 @@ function IconsProvider({ children }) {
|
|
|
1255
1255
|
const [isLoading, setIsLoading] = useState2(true);
|
|
1256
1256
|
const [iconsMap, setIconsMap] = useState2({});
|
|
1257
1257
|
const initializeIconsMap = async () => {
|
|
1258
|
-
const { importedIcons } = await import("./importedIcons-
|
|
1258
|
+
const { importedIcons } = await import("./importedIcons-XEGXOSVC.js");
|
|
1259
1259
|
setIconsMap({ ...importedIcons, ...customIcons });
|
|
1260
1260
|
setIsLoading(false);
|
|
1261
1261
|
};
|
|
@@ -2557,7 +2557,7 @@ import { css as css15 } from "@emotion/react";
|
|
|
2557
2557
|
var PageHeaderSectionContainer = css15`
|
|
2558
2558
|
display: flex;
|
|
2559
2559
|
justify-content: space-between;
|
|
2560
|
-
margin-bottom: var(--spacing-
|
|
2560
|
+
margin-bottom: var(--spacing-sm);
|
|
2561
2561
|
flex-direction: column;
|
|
2562
2562
|
gap: var(--spacing-sm);
|
|
2563
2563
|
|
|
@@ -13845,7 +13845,8 @@ function InputComboBox(props) {
|
|
|
13845
13845
|
background: "var(--gray-100)",
|
|
13846
13846
|
"&:hover": {
|
|
13847
13847
|
borderColor: "var(--gray-300)"
|
|
13848
|
-
}
|
|
13848
|
+
},
|
|
13849
|
+
...state.isFocused ? { borderColor: "var(--gray-300)" } : {}
|
|
13849
13850
|
},
|
|
13850
13851
|
...(_b = (_a2 = props.styles) == null ? void 0 : _a2.control) == null ? void 0 : _b.call(_a2, base, state)
|
|
13851
13852
|
};
|
|
@@ -17561,6 +17562,16 @@ var toggleInput2 = css79`
|
|
|
17561
17562
|
color: var(--white);
|
|
17562
17563
|
}
|
|
17563
17564
|
|
|
17565
|
+
&:indeterminate,
|
|
17566
|
+
&:indeterminate:hover,
|
|
17567
|
+
&:indeterminate:focus {
|
|
17568
|
+
background: var(--accent-dark-active)
|
|
17569
|
+
url('data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIxNiIKICBoZWlnaHQ9IjE2IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKPgogIDxwYXRoCiAgICBkPSJNNCAxMkM0IDExLjQ0NzcgNC40NDc3MiAxMSA1IDExSDE5QzE5LjU1MjMgMTEgMjAgMTEuNDQ3NyAyMCAxMkMyMCAxMi41NTIzIDE5LjU1MjMgMTMgMTkgMTNINUM0LjQ0NzcyIDEzIDQgMTIuNTUyMyA0IDEyWiIKICAgIGZpbGw9IndoaXRlIgogIC8+Cjwvc3ZnPg==')
|
|
17570
|
+
no-repeat center center;
|
|
17571
|
+
border-color: var(--accent-dark-active);
|
|
17572
|
+
color: var(--white);
|
|
17573
|
+
}
|
|
17574
|
+
|
|
17564
17575
|
&:hover {
|
|
17565
17576
|
border-color: var(--accent-dark-hover);
|
|
17566
17577
|
}
|
|
@@ -20272,6 +20283,60 @@ var TEXTBOX_OPERATORS = [
|
|
|
20272
20283
|
editorType: "empty"
|
|
20273
20284
|
}
|
|
20274
20285
|
];
|
|
20286
|
+
var USER_OPERATORS = [
|
|
20287
|
+
{
|
|
20288
|
+
label: "is...",
|
|
20289
|
+
value: "eq",
|
|
20290
|
+
editorType: "text"
|
|
20291
|
+
},
|
|
20292
|
+
{
|
|
20293
|
+
label: "contains...",
|
|
20294
|
+
value: "match",
|
|
20295
|
+
editorType: "text"
|
|
20296
|
+
},
|
|
20297
|
+
{
|
|
20298
|
+
label: "is not...",
|
|
20299
|
+
value: "neq",
|
|
20300
|
+
editorType: "text"
|
|
20301
|
+
}
|
|
20302
|
+
];
|
|
20303
|
+
var SYSTEM_DATE_OPERATORS = [
|
|
20304
|
+
{
|
|
20305
|
+
label: "is...",
|
|
20306
|
+
value: "eq",
|
|
20307
|
+
editorType: "date"
|
|
20308
|
+
},
|
|
20309
|
+
{
|
|
20310
|
+
label: "is between...",
|
|
20311
|
+
value: "between",
|
|
20312
|
+
editorType: "dateRange"
|
|
20313
|
+
},
|
|
20314
|
+
{
|
|
20315
|
+
label: "is before...",
|
|
20316
|
+
value: "lt",
|
|
20317
|
+
editorType: "date"
|
|
20318
|
+
},
|
|
20319
|
+
{
|
|
20320
|
+
label: "is after...",
|
|
20321
|
+
value: "gt",
|
|
20322
|
+
editorType: "date"
|
|
20323
|
+
},
|
|
20324
|
+
{
|
|
20325
|
+
label: "is on or before...",
|
|
20326
|
+
value: "lte",
|
|
20327
|
+
editorType: "date"
|
|
20328
|
+
},
|
|
20329
|
+
{
|
|
20330
|
+
label: "is on or after...",
|
|
20331
|
+
value: "gte",
|
|
20332
|
+
editorType: "date"
|
|
20333
|
+
},
|
|
20334
|
+
{
|
|
20335
|
+
label: "is not...",
|
|
20336
|
+
value: "neq",
|
|
20337
|
+
editorType: "date"
|
|
20338
|
+
}
|
|
20339
|
+
];
|
|
20275
20340
|
var RICHTEXT_OPERATORS = [
|
|
20276
20341
|
{
|
|
20277
20342
|
label: "is empty...",
|
|
@@ -20413,6 +20478,12 @@ var FilterButton = css92`
|
|
|
20413
20478
|
opacity: var(--opacity-50);
|
|
20414
20479
|
}
|
|
20415
20480
|
`;
|
|
20481
|
+
var FilterButtonText = css92`
|
|
20482
|
+
overflow: hidden;
|
|
20483
|
+
text-overflow: ellipsis;
|
|
20484
|
+
white-space: nowrap;
|
|
20485
|
+
max-width: 14ch;
|
|
20486
|
+
`;
|
|
20416
20487
|
var FilterButtonSelected = css92`
|
|
20417
20488
|
background: var(--gray-100);
|
|
20418
20489
|
border-color: var(--gray-300);
|
|
@@ -20449,7 +20520,6 @@ var AddConditionalBtn = css92`
|
|
|
20449
20520
|
gap: var(--spacing-sm);
|
|
20450
20521
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
20451
20522
|
padding: 0;
|
|
20452
|
-
font-size: var(--fs-sm);
|
|
20453
20523
|
|
|
20454
20524
|
&:hover,
|
|
20455
20525
|
&:focus {
|
|
@@ -20504,7 +20574,7 @@ var SearchAndFilterOptionsContainer = css92`
|
|
|
20504
20574
|
padding: var(--spacing-md) var(--spacing-md) var(--spacing-base);
|
|
20505
20575
|
will-change: height;
|
|
20506
20576
|
position: relative;
|
|
20507
|
-
z-index:
|
|
20577
|
+
z-index: 1;
|
|
20508
20578
|
`;
|
|
20509
20579
|
var SearchAndFilterOptionsInnerContainer = css92`
|
|
20510
20580
|
display: flex;
|
|
@@ -20514,6 +20584,11 @@ var SearchAndFilterOptionsInnerContainer = css92`
|
|
|
20514
20584
|
var SearchAndFilterButtonGroup = css92`
|
|
20515
20585
|
margin-top: var(--spacing-base);
|
|
20516
20586
|
`;
|
|
20587
|
+
var SortFilterInputRow = css92`
|
|
20588
|
+
align-items: center;
|
|
20589
|
+
display: flex;
|
|
20590
|
+
gap: var(--spacing-sm);
|
|
20591
|
+
`;
|
|
20517
20592
|
|
|
20518
20593
|
// src/components/SearchAndFilter/FilterButton.tsx
|
|
20519
20594
|
import { jsx as jsx117, jsxs as jsxs79 } from "@emotion/react/jsx-runtime";
|
|
@@ -20537,7 +20612,7 @@ var FilterButton2 = ({
|
|
|
20537
20612
|
"data-testid": "filters-button",
|
|
20538
20613
|
children: [
|
|
20539
20614
|
/* @__PURE__ */ jsx117(Icon, { icon, iconColor: "currentColor", size: "1rem" }),
|
|
20540
|
-
text,
|
|
20615
|
+
/* @__PURE__ */ jsx117("span", { css: FilterButtonText, children: text }),
|
|
20541
20616
|
filterCount ? /* @__PURE__ */ jsx117(Counter, { count: filterCount, bgColor: "var(--white)" }) : null
|
|
20542
20617
|
]
|
|
20543
20618
|
}
|
|
@@ -20546,7 +20621,7 @@ var FilterButton2 = ({
|
|
|
20546
20621
|
|
|
20547
20622
|
// src/components/SearchAndFilter/FilterControls.tsx
|
|
20548
20623
|
import { useEffect as useEffect18, useState as useState17 } from "react";
|
|
20549
|
-
import { useDebounce as useDebounce2 } from "react-use";
|
|
20624
|
+
import { useDebounce as useDebounce2, useEffectOnce } from "react-use";
|
|
20550
20625
|
|
|
20551
20626
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
20552
20627
|
import {
|
|
@@ -20682,10 +20757,22 @@ var useSearchAndFilter = () => {
|
|
|
20682
20757
|
import { Fragment as Fragment19, jsx as jsx119, jsxs as jsxs80 } from "@emotion/react/jsx-runtime";
|
|
20683
20758
|
var FilterControls = ({
|
|
20684
20759
|
children,
|
|
20760
|
+
defaultSortByValue,
|
|
20685
20761
|
hideSearchInput
|
|
20686
20762
|
}) => {
|
|
20687
|
-
|
|
20763
|
+
var _a, _b, _c;
|
|
20764
|
+
const {
|
|
20765
|
+
setFilterVisibility,
|
|
20766
|
+
filterVisibility,
|
|
20767
|
+
setSearchTerm,
|
|
20768
|
+
validFilterQuery,
|
|
20769
|
+
searchTerm,
|
|
20770
|
+
sortByValue,
|
|
20771
|
+
filterOptions
|
|
20772
|
+
} = useSearchAndFilter();
|
|
20773
|
+
const [initialSortValue, setInitialSortValue] = useState17(sortByValue);
|
|
20688
20774
|
const [localeSearchTerm, setLocaleSearchTerm] = useState17("");
|
|
20775
|
+
const [userHasChangedSortByValue, setUserHasChangedSortByValue] = useState17(false);
|
|
20689
20776
|
useDebounce2(
|
|
20690
20777
|
() => {
|
|
20691
20778
|
setSearchTerm(localeSearchTerm);
|
|
@@ -20699,14 +20786,25 @@ var FilterControls = ({
|
|
|
20699
20786
|
}
|
|
20700
20787
|
}, [searchTerm]);
|
|
20701
20788
|
const handleFilterToggle = (mode) => {
|
|
20702
|
-
if (filterVisibility &&
|
|
20789
|
+
if (filterVisibility === "filters" && mode === "filters" || filterVisibility === "sort" && mode === "sort") {
|
|
20703
20790
|
return setFilterVisibility(void 0);
|
|
20704
20791
|
}
|
|
20705
20792
|
return setFilterVisibility(mode);
|
|
20706
20793
|
};
|
|
20707
|
-
const
|
|
20708
|
-
const
|
|
20709
|
-
const
|
|
20794
|
+
const sortValue = (sortByValue != null ? sortByValue : defaultSortByValue).split("_");
|
|
20795
|
+
const sortDirection = sortValue == null ? void 0 : sortValue.pop();
|
|
20796
|
+
const sortField = sortValue == null ? void 0 : sortValue.join("_");
|
|
20797
|
+
const sortOn = sortField.startsWith("fields.") ? "contentTypeFields" : "metadata";
|
|
20798
|
+
const sortByValueLabel = (_c = (_b = (_a = filterOptions == null ? void 0 : filterOptions.find((op) => op.value === sortOn)) == null ? void 0 : _a.options) == null ? void 0 : _b.find((f) => f.value === sortField)) == null ? void 0 : _c.label;
|
|
20799
|
+
const sortByIcon = userHasChangedSortByValue ? sortDirection === "ASC" ? "arrow-up" : "arrow-down" : "sort-az";
|
|
20800
|
+
useEffectOnce(() => {
|
|
20801
|
+
setInitialSortValue(sortByValue);
|
|
20802
|
+
});
|
|
20803
|
+
useEffect18(() => {
|
|
20804
|
+
if (initialSortValue !== sortByValue) {
|
|
20805
|
+
setUserHasChangedSortByValue(true);
|
|
20806
|
+
}
|
|
20807
|
+
}, [initialSortValue, sortByValue]);
|
|
20710
20808
|
return /* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
20711
20809
|
/* @__PURE__ */ jsx119(
|
|
20712
20810
|
FilterButton2,
|
|
@@ -20725,7 +20823,7 @@ var FilterControls = ({
|
|
|
20725
20823
|
"aria-controls": "search-and-filter-sortBy",
|
|
20726
20824
|
"aria-label": "sort by options",
|
|
20727
20825
|
"aria-haspopup": "true",
|
|
20728
|
-
text: sortByValueLabel,
|
|
20826
|
+
text: !userHasChangedSortByValue ? "Sort" : sortByValueLabel,
|
|
20729
20827
|
icon: sortByIcon,
|
|
20730
20828
|
"aria-expanded": filterVisibility === "sort",
|
|
20731
20829
|
hasSelectedValue: sortByValue !== "",
|
|
@@ -20867,7 +20965,7 @@ var StatusBullet = ({
|
|
|
20867
20965
|
};
|
|
20868
20966
|
|
|
20869
20967
|
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
20870
|
-
import { jsx as jsx121, jsxs as jsxs81 } from "@emotion/react/jsx-runtime";
|
|
20968
|
+
import { Fragment as Fragment20, jsx as jsx121, jsxs as jsxs81 } from "@emotion/react/jsx-runtime";
|
|
20871
20969
|
var readOnlyAttributes = {
|
|
20872
20970
|
isSearchable: false,
|
|
20873
20971
|
menuIsOpen: false,
|
|
@@ -20878,10 +20976,11 @@ var FilterMultiChoiceEditor = ({
|
|
|
20878
20976
|
options,
|
|
20879
20977
|
isDisabled,
|
|
20880
20978
|
readOnly,
|
|
20979
|
+
valueTestId,
|
|
20881
20980
|
...props
|
|
20882
20981
|
}) => {
|
|
20883
20982
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
20884
|
-
return /* @__PURE__ */ jsx121(
|
|
20983
|
+
return /* @__PURE__ */ jsx121("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx121(
|
|
20885
20984
|
InputComboBox,
|
|
20886
20985
|
{
|
|
20887
20986
|
...props,
|
|
@@ -20896,19 +20995,28 @@ var FilterMultiChoiceEditor = ({
|
|
|
20896
20995
|
},
|
|
20897
20996
|
value,
|
|
20898
20997
|
"aria-readonly": readOnly,
|
|
20998
|
+
styles: {
|
|
20999
|
+
menu(base) {
|
|
21000
|
+
return {
|
|
21001
|
+
...base,
|
|
21002
|
+
minWidth: "max-content"
|
|
21003
|
+
};
|
|
21004
|
+
}
|
|
21005
|
+
},
|
|
20899
21006
|
...readOnlyProps
|
|
20900
21007
|
}
|
|
20901
|
-
);
|
|
21008
|
+
) });
|
|
20902
21009
|
};
|
|
20903
21010
|
var FilterSingleChoiceEditor = ({
|
|
20904
21011
|
options,
|
|
20905
21012
|
value,
|
|
20906
21013
|
isDisabled,
|
|
20907
21014
|
readOnly,
|
|
20908
|
-
onChange
|
|
21015
|
+
onChange,
|
|
21016
|
+
valueTestId
|
|
20909
21017
|
}) => {
|
|
20910
21018
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
20911
|
-
return /* @__PURE__ */ jsx121(
|
|
21019
|
+
return /* @__PURE__ */ jsx121("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx121(
|
|
20912
21020
|
InputComboBox,
|
|
20913
21021
|
{
|
|
20914
21022
|
placeholder: "Type to search...",
|
|
@@ -20921,9 +21029,17 @@ var FilterSingleChoiceEditor = ({
|
|
|
20921
21029
|
isDisabled,
|
|
20922
21030
|
value,
|
|
20923
21031
|
"aria-readonly": readOnly,
|
|
21032
|
+
styles: {
|
|
21033
|
+
menu(base) {
|
|
21034
|
+
return {
|
|
21035
|
+
...base,
|
|
21036
|
+
minWidth: "max-content"
|
|
21037
|
+
};
|
|
21038
|
+
}
|
|
21039
|
+
},
|
|
20924
21040
|
...readOnlyProps
|
|
20925
21041
|
}
|
|
20926
|
-
);
|
|
21042
|
+
) });
|
|
20927
21043
|
};
|
|
20928
21044
|
var CustomOptions = ({ label, value }) => {
|
|
20929
21045
|
return /* @__PURE__ */ jsx121(StatusBullet, { status: label, message: value });
|
|
@@ -20933,10 +21049,11 @@ var StatusMultiEditor = ({
|
|
|
20933
21049
|
value,
|
|
20934
21050
|
isDisabled,
|
|
20935
21051
|
readOnly,
|
|
20936
|
-
onChange
|
|
21052
|
+
onChange,
|
|
21053
|
+
valueTestId
|
|
20937
21054
|
}) => {
|
|
20938
21055
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
20939
|
-
return /* @__PURE__ */ jsx121(
|
|
21056
|
+
return /* @__PURE__ */ jsx121("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx121(
|
|
20940
21057
|
InputComboBox,
|
|
20941
21058
|
{
|
|
20942
21059
|
options,
|
|
@@ -20948,19 +21065,28 @@ var StatusMultiEditor = ({
|
|
|
20948
21065
|
formatOptionLabel: CustomOptions,
|
|
20949
21066
|
value,
|
|
20950
21067
|
isDisabled,
|
|
21068
|
+
styles: {
|
|
21069
|
+
menu(base) {
|
|
21070
|
+
return {
|
|
21071
|
+
...base,
|
|
21072
|
+
minWidth: "max-content"
|
|
21073
|
+
};
|
|
21074
|
+
}
|
|
21075
|
+
},
|
|
20951
21076
|
...readOnlyProps
|
|
20952
21077
|
}
|
|
20953
|
-
);
|
|
21078
|
+
) });
|
|
20954
21079
|
};
|
|
20955
21080
|
var StatusSingleEditor = ({
|
|
20956
21081
|
options,
|
|
20957
21082
|
value,
|
|
20958
21083
|
isDisabled,
|
|
20959
21084
|
readOnly,
|
|
20960
|
-
onChange
|
|
21085
|
+
onChange,
|
|
21086
|
+
valueTestId
|
|
20961
21087
|
}) => {
|
|
20962
21088
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
20963
|
-
return /* @__PURE__ */ jsx121(
|
|
21089
|
+
return /* @__PURE__ */ jsx121("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx121(
|
|
20964
21090
|
InputComboBox,
|
|
20965
21091
|
{
|
|
20966
21092
|
options,
|
|
@@ -20971,11 +21097,19 @@ var StatusSingleEditor = ({
|
|
|
20971
21097
|
formatOptionLabel: CustomOptions,
|
|
20972
21098
|
value,
|
|
20973
21099
|
isDisabled,
|
|
21100
|
+
styles: {
|
|
21101
|
+
menu(base) {
|
|
21102
|
+
return {
|
|
21103
|
+
...base,
|
|
21104
|
+
minWidth: "max-content"
|
|
21105
|
+
};
|
|
21106
|
+
}
|
|
21107
|
+
},
|
|
20974
21108
|
...readOnlyProps
|
|
20975
21109
|
}
|
|
20976
|
-
);
|
|
21110
|
+
) });
|
|
20977
21111
|
};
|
|
20978
|
-
var TextEditor = ({ onChange, ariaLabel, value, readOnly }) => {
|
|
21112
|
+
var TextEditor = ({ onChange, ariaLabel, value, readOnly, valueTestId }) => {
|
|
20979
21113
|
useDebounce3(() => onChange, 500, [value]);
|
|
20980
21114
|
return /* @__PURE__ */ jsx121(
|
|
20981
21115
|
Input,
|
|
@@ -20985,11 +21119,19 @@ var TextEditor = ({ onChange, ariaLabel, value, readOnly }) => {
|
|
|
20985
21119
|
onChange: (e) => onChange(e.currentTarget.value),
|
|
20986
21120
|
placeholder: "Enter phrase to search\u2026",
|
|
20987
21121
|
value,
|
|
20988
|
-
readOnly
|
|
21122
|
+
readOnly,
|
|
21123
|
+
"data-testid": valueTestId
|
|
20989
21124
|
}
|
|
20990
21125
|
);
|
|
20991
21126
|
};
|
|
20992
|
-
var NumberRangeEditor = ({
|
|
21127
|
+
var NumberRangeEditor = ({
|
|
21128
|
+
onChange,
|
|
21129
|
+
disabled: disabled2,
|
|
21130
|
+
ariaLabel,
|
|
21131
|
+
value,
|
|
21132
|
+
readOnly,
|
|
21133
|
+
valueTestId
|
|
21134
|
+
}) => {
|
|
20993
21135
|
const [minValue, setMinValue] = useState18("");
|
|
20994
21136
|
const [maxValue, setMaxValue] = useState18("");
|
|
20995
21137
|
const [error, setError] = useState18("");
|
|
@@ -21012,41 +21154,50 @@ var NumberRangeEditor = ({ onChange, disabled: disabled2, ariaLabel, value, read
|
|
|
21012
21154
|
setError("");
|
|
21013
21155
|
onChange([minValue, maxValue]);
|
|
21014
21156
|
}, [maxValue, minValue, setError]);
|
|
21015
|
-
return /* @__PURE__ */ jsxs81(
|
|
21016
|
-
/* @__PURE__ */
|
|
21017
|
-
|
|
21018
|
-
|
|
21019
|
-
|
|
21020
|
-
|
|
21021
|
-
|
|
21022
|
-
|
|
21023
|
-
|
|
21024
|
-
|
|
21025
|
-
|
|
21026
|
-
|
|
21027
|
-
|
|
21028
|
-
|
|
21029
|
-
|
|
21030
|
-
|
|
21031
|
-
|
|
21032
|
-
|
|
21033
|
-
|
|
21034
|
-
|
|
21035
|
-
|
|
21036
|
-
|
|
21037
|
-
|
|
21038
|
-
|
|
21039
|
-
|
|
21040
|
-
|
|
21041
|
-
|
|
21042
|
-
|
|
21043
|
-
|
|
21044
|
-
|
|
21045
|
-
|
|
21157
|
+
return /* @__PURE__ */ jsxs81(Fragment20, { children: [
|
|
21158
|
+
/* @__PURE__ */ jsxs81("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
21159
|
+
/* @__PURE__ */ jsx121(
|
|
21160
|
+
Input,
|
|
21161
|
+
{
|
|
21162
|
+
label: `${ariaLabel}-min`,
|
|
21163
|
+
type: "number",
|
|
21164
|
+
showLabel: false,
|
|
21165
|
+
min: 0,
|
|
21166
|
+
placeholder: "Low",
|
|
21167
|
+
onChange: (e) => setMinValue(e.currentTarget.value),
|
|
21168
|
+
"aria-invalid": !error ? false : true,
|
|
21169
|
+
disabled: disabled2,
|
|
21170
|
+
value: value ? value[0] : "",
|
|
21171
|
+
readOnly
|
|
21172
|
+
}
|
|
21173
|
+
),
|
|
21174
|
+
/* @__PURE__ */ jsx121(
|
|
21175
|
+
Input,
|
|
21176
|
+
{
|
|
21177
|
+
type: "number",
|
|
21178
|
+
label: `${ariaLabel}-max`,
|
|
21179
|
+
showLabel: false,
|
|
21180
|
+
min: 0,
|
|
21181
|
+
placeholder: "High",
|
|
21182
|
+
onChange: (e) => setMaxValue(e.currentTarget.value),
|
|
21183
|
+
"aria-invalid": !error ? false : true,
|
|
21184
|
+
disabled: disabled2,
|
|
21185
|
+
value: value ? value[1] : "",
|
|
21186
|
+
readOnly
|
|
21187
|
+
}
|
|
21188
|
+
)
|
|
21189
|
+
] }),
|
|
21046
21190
|
/* @__PURE__ */ jsx121(ErrorContainer, { errorMessage: error })
|
|
21047
21191
|
] });
|
|
21048
21192
|
};
|
|
21049
|
-
var NumberEditor = ({
|
|
21193
|
+
var NumberEditor = ({
|
|
21194
|
+
ariaLabel,
|
|
21195
|
+
onChange,
|
|
21196
|
+
disabled: disabled2,
|
|
21197
|
+
value,
|
|
21198
|
+
readOnly,
|
|
21199
|
+
valueTestId
|
|
21200
|
+
}) => {
|
|
21050
21201
|
return /* @__PURE__ */ jsx121(
|
|
21051
21202
|
Input,
|
|
21052
21203
|
{
|
|
@@ -21057,11 +21208,19 @@ var NumberEditor = ({ ariaLabel, onChange, disabled: disabled2, value, readOnly
|
|
|
21057
21208
|
onChange: (e) => onChange(e.currentTarget.value),
|
|
21058
21209
|
disabled: disabled2,
|
|
21059
21210
|
value,
|
|
21060
|
-
readOnly
|
|
21211
|
+
readOnly,
|
|
21212
|
+
"data-testid": valueTestId
|
|
21061
21213
|
}
|
|
21062
21214
|
);
|
|
21063
21215
|
};
|
|
21064
|
-
var DateEditor = ({
|
|
21216
|
+
var DateEditor = ({
|
|
21217
|
+
onChange,
|
|
21218
|
+
ariaLabel,
|
|
21219
|
+
disabled: disabled2,
|
|
21220
|
+
value,
|
|
21221
|
+
readOnly,
|
|
21222
|
+
valueTestId
|
|
21223
|
+
}) => {
|
|
21065
21224
|
return /* @__PURE__ */ jsx121(
|
|
21066
21225
|
Input,
|
|
21067
21226
|
{
|
|
@@ -21071,11 +21230,19 @@ var DateEditor = ({ onChange, ariaLabel, disabled: disabled2, value, readOnly })
|
|
|
21071
21230
|
onChange: (e) => onChange(e.currentTarget.value),
|
|
21072
21231
|
disabled: disabled2,
|
|
21073
21232
|
value,
|
|
21074
|
-
readOnly
|
|
21233
|
+
readOnly,
|
|
21234
|
+
"data-testid": valueTestId
|
|
21075
21235
|
}
|
|
21076
21236
|
);
|
|
21077
21237
|
};
|
|
21078
|
-
var DateRangeEditor = ({
|
|
21238
|
+
var DateRangeEditor = ({
|
|
21239
|
+
ariaLabel,
|
|
21240
|
+
onChange,
|
|
21241
|
+
disabled: disabled2,
|
|
21242
|
+
value,
|
|
21243
|
+
readOnly,
|
|
21244
|
+
valueTestId
|
|
21245
|
+
}) => {
|
|
21079
21246
|
const [minDateValue, setMinDateValue] = useState18(value ? value[0] : "");
|
|
21080
21247
|
const [maxDateValue, setMaxDateValue] = useState18(value ? value[1] : "");
|
|
21081
21248
|
const [error, setError] = useState18("");
|
|
@@ -21110,33 +21277,35 @@ var DateRangeEditor = ({ ariaLabel, onChange, disabled: disabled2, value, readOn
|
|
|
21110
21277
|
setError("");
|
|
21111
21278
|
onChange([minDateValue, maxDateValue]);
|
|
21112
21279
|
}, [minDateValue, maxDateValue, setError]);
|
|
21113
|
-
return /* @__PURE__ */ jsxs81(
|
|
21114
|
-
/* @__PURE__ */
|
|
21115
|
-
|
|
21116
|
-
|
|
21117
|
-
|
|
21118
|
-
|
|
21119
|
-
|
|
21120
|
-
|
|
21121
|
-
|
|
21122
|
-
|
|
21123
|
-
|
|
21124
|
-
|
|
21125
|
-
|
|
21126
|
-
|
|
21127
|
-
|
|
21128
|
-
|
|
21129
|
-
|
|
21130
|
-
|
|
21131
|
-
|
|
21132
|
-
|
|
21133
|
-
|
|
21134
|
-
|
|
21135
|
-
|
|
21136
|
-
|
|
21137
|
-
|
|
21138
|
-
|
|
21139
|
-
|
|
21280
|
+
return /* @__PURE__ */ jsxs81(Fragment20, { children: [
|
|
21281
|
+
/* @__PURE__ */ jsxs81("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
21282
|
+
/* @__PURE__ */ jsx121(
|
|
21283
|
+
Input,
|
|
21284
|
+
{
|
|
21285
|
+
label: `${ariaLabel}-min-date`,
|
|
21286
|
+
type: "date",
|
|
21287
|
+
showLabel: false,
|
|
21288
|
+
value: minDateValue,
|
|
21289
|
+
onChange: (e) => setMinDateValue(e.currentTarget.value),
|
|
21290
|
+
"aria-invalid": !error ? false : true,
|
|
21291
|
+
disabled: disabled2,
|
|
21292
|
+
readOnly
|
|
21293
|
+
}
|
|
21294
|
+
),
|
|
21295
|
+
/* @__PURE__ */ jsx121(
|
|
21296
|
+
Input,
|
|
21297
|
+
{
|
|
21298
|
+
label: `${ariaLabel}-max-date`,
|
|
21299
|
+
type: "date",
|
|
21300
|
+
showLabel: false,
|
|
21301
|
+
value: maxDateValue,
|
|
21302
|
+
onChange: (e) => setMaxDateValue(e.currentTarget.value),
|
|
21303
|
+
"aria-invalid": !error ? false : true,
|
|
21304
|
+
disabled: disabled2,
|
|
21305
|
+
readOnly
|
|
21306
|
+
}
|
|
21307
|
+
)
|
|
21308
|
+
] }),
|
|
21140
21309
|
/* @__PURE__ */ jsx121(ErrorContainer, { errorMessage: error })
|
|
21141
21310
|
] });
|
|
21142
21311
|
};
|
|
@@ -21201,7 +21370,7 @@ var SearchAndFilterOptionsContainer2 = ({
|
|
|
21201
21370
|
) : null
|
|
21202
21371
|
] });
|
|
21203
21372
|
};
|
|
21204
|
-
var FilterMenu = ({ id, filterTitle = "Show
|
|
21373
|
+
var FilterMenu = ({ id, filterTitle = "Show results", menuControls, children }) => {
|
|
21205
21374
|
const { filterVisibility, setFilterVisibility } = useSearchAndFilter();
|
|
21206
21375
|
const innerMenuRef = React24.useRef(null);
|
|
21207
21376
|
useEffect20(() => {
|
|
@@ -21227,7 +21396,7 @@ var FilterMenu = ({ id, filterTitle = "Show records", menuControls, children })
|
|
|
21227
21396
|
};
|
|
21228
21397
|
|
|
21229
21398
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
21230
|
-
import { Fragment as
|
|
21399
|
+
import { Fragment as Fragment21, jsx as jsx123, jsxs as jsxs83 } from "@emotion/react/jsx-runtime";
|
|
21231
21400
|
var FilterItem = ({
|
|
21232
21401
|
index,
|
|
21233
21402
|
paramOptions,
|
|
@@ -21275,8 +21444,8 @@ var FilterItem = ({
|
|
|
21275
21444
|
menuIsOpen: false,
|
|
21276
21445
|
isClearable: false
|
|
21277
21446
|
} : {};
|
|
21278
|
-
return /* @__PURE__ */ jsxs83("div", { css: ConditionalFilterRow, children: [
|
|
21279
|
-
/* @__PURE__ */ jsx123("span", { children: index === 0 ? "
|
|
21447
|
+
return /* @__PURE__ */ jsxs83("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
|
|
21448
|
+
/* @__PURE__ */ jsx123("span", { children: index === 0 ? "Where" : "and" }),
|
|
21280
21449
|
/* @__PURE__ */ jsxs83("div", { css: ConditionalInputRow, children: [
|
|
21281
21450
|
/* @__PURE__ */ jsx123(
|
|
21282
21451
|
InputComboBox,
|
|
@@ -21287,8 +21456,21 @@ var FilterItem = ({
|
|
|
21287
21456
|
var _a2;
|
|
21288
21457
|
onParamChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
|
|
21289
21458
|
},
|
|
21459
|
+
isOptionDisabled: (option) => {
|
|
21460
|
+
var _a2;
|
|
21461
|
+
return (_a2 = option == null ? void 0 : option.disabled) != null ? _a2 : false;
|
|
21462
|
+
},
|
|
21463
|
+
styles: {
|
|
21464
|
+
menu(base) {
|
|
21465
|
+
return {
|
|
21466
|
+
...base,
|
|
21467
|
+
minWidth: "max-content"
|
|
21468
|
+
};
|
|
21469
|
+
}
|
|
21470
|
+
},
|
|
21290
21471
|
value: selectedFieldValue,
|
|
21291
|
-
...readOnlyProps
|
|
21472
|
+
...readOnlyProps,
|
|
21473
|
+
id: "filter-field"
|
|
21292
21474
|
}
|
|
21293
21475
|
),
|
|
21294
21476
|
/* @__PURE__ */ jsx123(
|
|
@@ -21302,7 +21484,16 @@ var FilterItem = ({
|
|
|
21302
21484
|
},
|
|
21303
21485
|
isDisabled: !filters[index].field,
|
|
21304
21486
|
value: selectedOperatorValue,
|
|
21305
|
-
|
|
21487
|
+
styles: {
|
|
21488
|
+
menu(base) {
|
|
21489
|
+
return {
|
|
21490
|
+
...base,
|
|
21491
|
+
minWidth: "max-content"
|
|
21492
|
+
};
|
|
21493
|
+
}
|
|
21494
|
+
},
|
|
21495
|
+
...readOnlyProps,
|
|
21496
|
+
id: "filter-operator"
|
|
21306
21497
|
}
|
|
21307
21498
|
),
|
|
21308
21499
|
/* @__PURE__ */ jsx123(
|
|
@@ -21314,16 +21505,18 @@ var FilterItem = ({
|
|
|
21314
21505
|
onChange: (e) => onValueChange(e != null ? e : ""),
|
|
21315
21506
|
readOnly,
|
|
21316
21507
|
isDisabled: !filters[index].operator,
|
|
21317
|
-
value: selectedMetaValue
|
|
21508
|
+
value: selectedMetaValue,
|
|
21509
|
+
valueTestId: "filter-value"
|
|
21318
21510
|
}
|
|
21319
21511
|
),
|
|
21320
|
-
/* @__PURE__ */ jsx123(
|
|
21512
|
+
readOnly ? null : /* @__PURE__ */ jsx123(
|
|
21321
21513
|
"button",
|
|
21322
21514
|
{
|
|
21323
21515
|
type: "button",
|
|
21324
21516
|
onClick: () => handleDeleteFilter(index),
|
|
21325
21517
|
"aria-label": "delete filter",
|
|
21326
21518
|
css: IconBtn,
|
|
21519
|
+
"data-testid": "delete-filter",
|
|
21327
21520
|
children: /* @__PURE__ */ jsx123(Icon, { icon: "trash", iconColor: "red", size: "1rem" })
|
|
21328
21521
|
}
|
|
21329
21522
|
)
|
|
@@ -21336,6 +21529,7 @@ var FilterItems = ({
|
|
|
21336
21529
|
}) => {
|
|
21337
21530
|
const { filterOptions, filters, setFilters, handleAddFilter, handleResetFilters, setFilterVisibility } = useSearchAndFilter();
|
|
21338
21531
|
const handleUpdateFilter = (index, prop, value) => {
|
|
21532
|
+
var _a, _b, _c, _d, _e;
|
|
21339
21533
|
const next = [...filters];
|
|
21340
21534
|
next[index] = { ...next[index], [prop]: value };
|
|
21341
21535
|
if (prop === "operator") {
|
|
@@ -21348,7 +21542,11 @@ var FilterItems = ({
|
|
|
21348
21542
|
}
|
|
21349
21543
|
}
|
|
21350
21544
|
if (prop === "field") {
|
|
21351
|
-
|
|
21545
|
+
const firstOperatorInAvailableOperators = (_e = (_d = (_c = (_b = (_a = filterOptions.find((fo) => {
|
|
21546
|
+
var _a2;
|
|
21547
|
+
return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === value);
|
|
21548
|
+
})) == null ? void 0 : _a.options) == null ? void 0 : _b.find((op) => op.value === next[index].field)) == null ? void 0 : _c.operatorOptions) == null ? void 0 : _d[0].value) != null ? _e : "eq";
|
|
21549
|
+
next[index].operator = firstOperatorInAvailableOperators;
|
|
21352
21550
|
next[index].value = "";
|
|
21353
21551
|
}
|
|
21354
21552
|
setFilters(next);
|
|
@@ -21357,11 +21555,20 @@ var FilterItems = ({
|
|
|
21357
21555
|
FilterMenu,
|
|
21358
21556
|
{
|
|
21359
21557
|
id: "search-and-filter-options",
|
|
21360
|
-
menuControls: /* @__PURE__ */ jsxs83(
|
|
21361
|
-
/* @__PURE__ */ jsxs83(
|
|
21362
|
-
|
|
21363
|
-
|
|
21364
|
-
|
|
21558
|
+
menuControls: /* @__PURE__ */ jsxs83(Fragment21, { children: [
|
|
21559
|
+
/* @__PURE__ */ jsxs83(
|
|
21560
|
+
"button",
|
|
21561
|
+
{
|
|
21562
|
+
type: "button",
|
|
21563
|
+
css: AddConditionalBtn,
|
|
21564
|
+
onClick: handleAddFilter,
|
|
21565
|
+
"data-testid": "add-filter",
|
|
21566
|
+
children: [
|
|
21567
|
+
/* @__PURE__ */ jsx123(Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
|
|
21568
|
+
addButtonText
|
|
21569
|
+
]
|
|
21570
|
+
}
|
|
21571
|
+
),
|
|
21365
21572
|
(filters == null ? void 0 : filters.length) ? /* @__PURE__ */ jsx123(
|
|
21366
21573
|
"button",
|
|
21367
21574
|
{
|
|
@@ -21371,6 +21578,7 @@ var FilterItems = ({
|
|
|
21371
21578
|
handleResetFilters();
|
|
21372
21579
|
setFilterVisibility(void 0);
|
|
21373
21580
|
},
|
|
21581
|
+
"data-testid": "reset-filters",
|
|
21374
21582
|
children: resetButtonText
|
|
21375
21583
|
}
|
|
21376
21584
|
) : null
|
|
@@ -21617,7 +21825,7 @@ var SortItems = () => {
|
|
|
21617
21825
|
var _a2;
|
|
21618
21826
|
return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
|
|
21619
21827
|
})) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
|
|
21620
|
-
return /* @__PURE__ */ jsx125(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", children: /* @__PURE__ */
|
|
21828
|
+
return /* @__PURE__ */ jsx125(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", children: /* @__PURE__ */ jsxs85("div", { css: SortFilterInputRow, children: [
|
|
21621
21829
|
/* @__PURE__ */ jsx125(
|
|
21622
21830
|
InputComboBox,
|
|
21623
21831
|
{
|
|
@@ -21626,6 +21834,14 @@ var SortItems = () => {
|
|
|
21626
21834
|
const fieldName = e == null ? void 0 : e.value;
|
|
21627
21835
|
setSortBy(`${fieldName}_${sortDirection}`);
|
|
21628
21836
|
},
|
|
21837
|
+
styles: {
|
|
21838
|
+
menu(base) {
|
|
21839
|
+
return {
|
|
21840
|
+
...base,
|
|
21841
|
+
minWidth: "max-content"
|
|
21842
|
+
};
|
|
21843
|
+
}
|
|
21844
|
+
},
|
|
21629
21845
|
value: currentSelectedOption
|
|
21630
21846
|
}
|
|
21631
21847
|
),
|
|
@@ -21642,7 +21858,7 @@ var SortItems = () => {
|
|
|
21642
21858
|
value: sortDirection
|
|
21643
21859
|
}
|
|
21644
21860
|
)
|
|
21645
|
-
] }) })
|
|
21861
|
+
] }) });
|
|
21646
21862
|
};
|
|
21647
21863
|
|
|
21648
21864
|
// src/components/SearchAndFilter/FilterModeView.tsx
|
|
@@ -21657,7 +21873,7 @@ var FilterModeView = () => {
|
|
|
21657
21873
|
};
|
|
21658
21874
|
|
|
21659
21875
|
// src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
|
|
21660
|
-
import { Fragment as
|
|
21876
|
+
import { Fragment as Fragment22, jsx as jsx127, jsxs as jsxs86 } from "@emotion/react/jsx-runtime";
|
|
21661
21877
|
var SearchAndFilterResultContainer = ({
|
|
21662
21878
|
buttonText,
|
|
21663
21879
|
clearButtonLabel = "clear",
|
|
@@ -21691,7 +21907,7 @@ var SearchAndFilterResultContainer = ({
|
|
|
21691
21907
|
if (totalResults && totalResults > 0) {
|
|
21692
21908
|
return null;
|
|
21693
21909
|
}
|
|
21694
|
-
return /* @__PURE__ */ jsxs86(
|
|
21910
|
+
return /* @__PURE__ */ jsxs86(Fragment22, { children: [
|
|
21695
21911
|
/* @__PURE__ */ jsxs86(HorizontalRhythm, { children: [
|
|
21696
21912
|
/* @__PURE__ */ jsxs86("span", { children: [
|
|
21697
21913
|
totalResults,
|
|
@@ -21744,7 +21960,7 @@ var SearchAndFilter = ({
|
|
|
21744
21960
|
css: SearchAndFilterControlsWrapper(
|
|
21745
21961
|
viewSwitchControls ? "auto auto 1fr 0.5fr" : "auto auto 1fr"
|
|
21746
21962
|
),
|
|
21747
|
-
children: !filterControls ? /* @__PURE__ */ jsx128(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
|
|
21963
|
+
children: !filterControls ? /* @__PURE__ */ jsx128(FilterControls, { hideSearchInput: !onSearchChange, defaultSortByValue }) : filterControls
|
|
21748
21964
|
}
|
|
21749
21965
|
),
|
|
21750
21966
|
viewSwitchControls
|
|
@@ -21924,14 +22140,14 @@ var SwitchText = css97`
|
|
|
21924
22140
|
`;
|
|
21925
22141
|
|
|
21926
22142
|
// src/components/Switch/Switch.tsx
|
|
21927
|
-
import { Fragment as
|
|
22143
|
+
import { Fragment as Fragment23, jsx as jsx131, jsxs as jsxs88 } from "@emotion/react/jsx-runtime";
|
|
21928
22144
|
var Switch = React26.forwardRef(
|
|
21929
22145
|
({ label, infoText, toggleText, children, ...inputProps }, ref) => {
|
|
21930
22146
|
let additionalText = infoText;
|
|
21931
22147
|
if (infoText && toggleText) {
|
|
21932
22148
|
additionalText = inputProps.checked ? toggleText : infoText;
|
|
21933
22149
|
}
|
|
21934
|
-
return /* @__PURE__ */ jsxs88(
|
|
22150
|
+
return /* @__PURE__ */ jsxs88(Fragment23, { children: [
|
|
21935
22151
|
/* @__PURE__ */ jsxs88("label", { css: [SwitchInputContainer, inputProps.disabled ? SwitchInputDisabled : void 0], children: [
|
|
21936
22152
|
/* @__PURE__ */ jsx131("input", { type: "checkbox", css: SwitchInput, ...inputProps, ref }),
|
|
21937
22153
|
/* @__PURE__ */ jsx131("span", { css: SwitchInputLabel, children: label })
|
|
@@ -22469,6 +22685,7 @@ export {
|
|
|
22469
22685
|
RICHTEXT_OPERATORS,
|
|
22470
22686
|
ResolveIcon,
|
|
22471
22687
|
RichTextToolbarIcon,
|
|
22688
|
+
SYSTEM_DATE_OPERATORS,
|
|
22472
22689
|
SYSTEM_FIELD_OPERATORS,
|
|
22473
22690
|
ScrollableList,
|
|
22474
22691
|
ScrollableListInputItem,
|
|
@@ -22509,6 +22726,7 @@ export {
|
|
|
22509
22726
|
ToastContainer,
|
|
22510
22727
|
Tooltip,
|
|
22511
22728
|
TwoColumnLayout,
|
|
22729
|
+
USER_OPERATORS,
|
|
22512
22730
|
UniformBadge,
|
|
22513
22731
|
UniformLogo,
|
|
22514
22732
|
UniformLogoLarge,
|