@uniformdev/mesh-sdk-react 19.157.1-alpha.6 → 19.159.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +95 -130
- package/dist/index.d.ts +95 -130
- package/dist/index.esm.js +743 -636
- package/dist/index.js +796 -703
- package/dist/index.mjs +743 -636
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -33,10 +33,10 @@ var src_exports = {};
|
|
|
33
33
|
__export(src_exports, {
|
|
34
34
|
$createVariableNode: () => $createVariableNode,
|
|
35
35
|
$isVariableNode: () => $isVariableNode,
|
|
36
|
-
AddListButton: () =>
|
|
37
|
-
Button: () =>
|
|
36
|
+
AddListButton: () => import_design_system63.AddListButton,
|
|
37
|
+
Button: () => import_design_system63.Button,
|
|
38
38
|
CHECKBOX_OPERATORS: () => CHECKBOX_OPERATORS,
|
|
39
|
-
Callout: () =>
|
|
39
|
+
Callout: () => import_design_system63.Callout,
|
|
40
40
|
ControlledValuePlugin: () => ControlledValuePlugin,
|
|
41
41
|
DATE_OPERATORS: () => DATE_OPERATORS,
|
|
42
42
|
DISCONNECT_VARIABLE_COMMAND: () => DISCONNECT_VARIABLE_COMMAND,
|
|
@@ -51,7 +51,7 @@ __export(src_exports, {
|
|
|
51
51
|
DateRangeEditor: () => DateRangeEditor,
|
|
52
52
|
DefaultSearchRow: () => DefaultSearchRow,
|
|
53
53
|
DefaultSelectedItem: () => DefaultSelectedItem,
|
|
54
|
-
DrawerContent: () =>
|
|
54
|
+
DrawerContent: () => import_design_system63.DrawerContent,
|
|
55
55
|
EDIT_VARIABLE_COMMAND: () => EDIT_VARIABLE_COMMAND,
|
|
56
56
|
EntrySearch: () => EntrySearch,
|
|
57
57
|
FilterButton: () => FilterButton2,
|
|
@@ -62,22 +62,22 @@ __export(src_exports, {
|
|
|
62
62
|
FilterMenu: () => FilterMenu,
|
|
63
63
|
FilterMultiChoiceEditor: () => FilterMultiChoiceEditor,
|
|
64
64
|
FilterSingleChoiceEditor: () => FilterSingleChoiceEditor,
|
|
65
|
-
Heading: () =>
|
|
65
|
+
Heading: () => import_design_system63.Heading,
|
|
66
66
|
INSERT_VARIABLE_COMMAND: () => INSERT_VARIABLE_COMMAND,
|
|
67
67
|
Icons: () => icons_exports,
|
|
68
|
-
Input: () =>
|
|
69
|
-
InputComboBox: () =>
|
|
70
|
-
InputKeywordSearch: () =>
|
|
71
|
-
InputSelect: () =>
|
|
72
|
-
InputToggle: () =>
|
|
68
|
+
Input: () => import_design_system63.Input,
|
|
69
|
+
InputComboBox: () => import_design_system63.InputComboBox,
|
|
70
|
+
InputKeywordSearch: () => import_design_system63.InputKeywordSearch,
|
|
71
|
+
InputSelect: () => import_design_system63.InputSelect,
|
|
72
|
+
InputToggle: () => import_design_system63.InputToggle,
|
|
73
73
|
InputVariables: () => InputVariables,
|
|
74
|
-
Label: () =>
|
|
74
|
+
Label: () => import_design_system63.Label,
|
|
75
75
|
LinkButton: () => LinkButton,
|
|
76
|
-
LoadingIndicator: () =>
|
|
77
|
-
LoadingOverlay: () =>
|
|
76
|
+
LoadingIndicator: () => import_design_system63.LoadingIndicator,
|
|
77
|
+
LoadingOverlay: () => import_design_system63.LoadingOverlay,
|
|
78
78
|
MULTI_SELECT_OPERATORS: () => MULTI_SELECT_OPERATORS,
|
|
79
|
-
Menu: () =>
|
|
80
|
-
MenuItem: () =>
|
|
79
|
+
Menu: () => import_design_system63.Menu,
|
|
80
|
+
MenuItem: () => import_design_system63.MenuItem,
|
|
81
81
|
MeshApp: () => MeshApp,
|
|
82
82
|
NUMBER_OPERATORS: () => NUMBER_OPERATORS,
|
|
83
83
|
NumberEditor: () => NumberEditor,
|
|
@@ -95,22 +95,22 @@ __export(src_exports, {
|
|
|
95
95
|
PUBLISH_STATUS_FIELD_OPERATORS: () => PUBLISH_STATUS_FIELD_OPERATORS,
|
|
96
96
|
ParamTypeDynamicDataProvider: () => ParamTypeDynamicDataProvider,
|
|
97
97
|
ParameterConnectionIndicator: () => ParameterConnectionIndicator,
|
|
98
|
-
ParameterGroup: () =>
|
|
99
|
-
ParameterImage: () =>
|
|
100
|
-
ParameterImageInner: () =>
|
|
101
|
-
ParameterInput: () =>
|
|
102
|
-
ParameterInputInner: () =>
|
|
103
|
-
ParameterLabel: () =>
|
|
104
|
-
ParameterMenuButton: () =>
|
|
98
|
+
ParameterGroup: () => import_design_system63.ParameterGroup,
|
|
99
|
+
ParameterImage: () => import_design_system63.ParameterImage,
|
|
100
|
+
ParameterImageInner: () => import_design_system63.ParameterImageInner,
|
|
101
|
+
ParameterInput: () => import_design_system63.ParameterInput,
|
|
102
|
+
ParameterInputInner: () => import_design_system63.ParameterInputInner,
|
|
103
|
+
ParameterLabel: () => import_design_system63.ParameterLabel,
|
|
104
|
+
ParameterMenuButton: () => import_design_system63.ParameterMenuButton,
|
|
105
105
|
ParameterOrSingleVariable: () => ParameterOrSingleVariable,
|
|
106
|
-
ParameterSelect: () =>
|
|
107
|
-
ParameterSelectInner: () =>
|
|
108
|
-
ParameterShell: () =>
|
|
106
|
+
ParameterSelect: () => import_design_system63.ParameterSelect,
|
|
107
|
+
ParameterSelectInner: () => import_design_system63.ParameterSelectInner,
|
|
108
|
+
ParameterShell: () => import_design_system63.ParameterShell,
|
|
109
109
|
ParameterShellContext: () => import_design_system14.ParameterShellContext,
|
|
110
|
-
ParameterTextarea: () =>
|
|
111
|
-
ParameterTextareaInner: () =>
|
|
112
|
-
ParameterToggle: () =>
|
|
113
|
-
ParameterToggleInner: () =>
|
|
110
|
+
ParameterTextarea: () => import_design_system63.ParameterTextarea,
|
|
111
|
+
ParameterTextareaInner: () => import_design_system63.ParameterTextareaInner,
|
|
112
|
+
ParameterToggle: () => import_design_system63.ParameterToggle,
|
|
113
|
+
ParameterToggleInner: () => import_design_system63.ParameterToggleInner,
|
|
114
114
|
ParameterVariables: () => ParameterVariables,
|
|
115
115
|
ProductPreviewList: () => ProductPreviewList,
|
|
116
116
|
ProductQuery: () => ProductQuery,
|
|
@@ -133,8 +133,8 @@ __export(src_exports, {
|
|
|
133
133
|
SELECT_OPERATORS: () => SELECT_OPERATORS,
|
|
134
134
|
SYSTEM_DATE_OPERATORS: () => SYSTEM_DATE_OPERATORS,
|
|
135
135
|
SYSTEM_FIELD_OPERATORS: () => SYSTEM_FIELD_OPERATORS,
|
|
136
|
-
ScrollableList: () =>
|
|
137
|
-
ScrollableListItem: () =>
|
|
136
|
+
ScrollableList: () => import_design_system63.ScrollableList,
|
|
137
|
+
ScrollableListItem: () => import_design_system63.ScrollableListItem,
|
|
138
138
|
SearchAndFilter: () => SearchAndFilter,
|
|
139
139
|
SearchAndFilterContext: () => SearchAndFilterContext,
|
|
140
140
|
SearchAndFilterOptionsContainer: () => SearchAndFilterOptionsContainer2,
|
|
@@ -146,12 +146,12 @@ __export(src_exports, {
|
|
|
146
146
|
SortItems: () => SortItems,
|
|
147
147
|
StatusMultiEditor: () => StatusMultiEditor,
|
|
148
148
|
StatusSingleEditor: () => StatusSingleEditor,
|
|
149
|
-
Switch: () =>
|
|
149
|
+
Switch: () => import_design_system63.Switch,
|
|
150
150
|
TEXTBOX_OPERATORS: () => TEXTBOX_OPERATORS,
|
|
151
151
|
TextEditor: () => TextEditor,
|
|
152
152
|
TextVariableRenderer: () => TextVariableRenderer,
|
|
153
|
-
Textarea: () =>
|
|
154
|
-
Theme: () =>
|
|
153
|
+
Textarea: () => import_design_system63.Textarea,
|
|
154
|
+
Theme: () => import_design_system63.Theme,
|
|
155
155
|
USER_OPERATORS: () => USER_OPERATORS,
|
|
156
156
|
VariableEditor: () => VariableEditor,
|
|
157
157
|
VariableNode: () => VariableNode,
|
|
@@ -246,7 +246,7 @@ __export(src_exports, {
|
|
|
246
246
|
useVariableEditor: () => useVariableEditor,
|
|
247
247
|
useVariables: () => useVariables,
|
|
248
248
|
useVariablesMenu: () => useVariablesMenu,
|
|
249
|
-
utilityColors: () =>
|
|
249
|
+
utilityColors: () => import_design_system63.utilityColors,
|
|
250
250
|
variableDefaultTextValue: () => variableDefaultTextValue,
|
|
251
251
|
variablePrefix: () => variablePrefix,
|
|
252
252
|
variableSuffix: () => variableSuffix,
|
|
@@ -7637,11 +7637,6 @@ var SYSTEM_DATE_OPERATORS = [
|
|
|
7637
7637
|
label: "is on or after...",
|
|
7638
7638
|
value: "sys-date-gte",
|
|
7639
7639
|
editorType: "date"
|
|
7640
|
-
},
|
|
7641
|
-
{
|
|
7642
|
-
label: "is not",
|
|
7643
|
-
value: "sys-date-neq",
|
|
7644
|
-
editorType: "date"
|
|
7645
7640
|
}
|
|
7646
7641
|
];
|
|
7647
7642
|
var RICHTEXT_OPERATORS = [
|
|
@@ -7797,303 +7792,171 @@ var MULTI_SELECT_OPERATORS = [
|
|
|
7797
7792
|
}
|
|
7798
7793
|
];
|
|
7799
7794
|
|
|
7800
|
-
// src/components/SearchAndFilter/
|
|
7801
|
-
var import_design_system42 = require("@uniformdev/design-system");
|
|
7802
|
-
|
|
7803
|
-
// src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
|
|
7804
|
-
var import_react76 = require("@emotion/react");
|
|
7795
|
+
// src/components/SearchAndFilter/editors/DateEditor.tsx
|
|
7805
7796
|
var import_design_system41 = require("@uniformdev/design-system");
|
|
7806
|
-
var
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
height: 1px;
|
|
7831
|
-
background: var(--gray-300);
|
|
7832
|
-
width: calc(100% - var(--spacing-base));
|
|
7833
|
-
margin-left: var(--spacing-base);
|
|
7834
|
-
}
|
|
7835
|
-
&:last-of-type:after {
|
|
7836
|
-
display: none;
|
|
7797
|
+
var import_react76 = require("react");
|
|
7798
|
+
var import_react_use5 = require("react-use");
|
|
7799
|
+
var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
|
|
7800
|
+
var DateEditor = ({
|
|
7801
|
+
onChange,
|
|
7802
|
+
ariaLabel,
|
|
7803
|
+
disabled,
|
|
7804
|
+
value,
|
|
7805
|
+
readOnly,
|
|
7806
|
+
valueTestId
|
|
7807
|
+
}) => {
|
|
7808
|
+
const [innerValue, setInnerValue] = (0, import_react76.useState)(value != null ? value : "");
|
|
7809
|
+
(0, import_react_use5.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
7810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
7811
|
+
import_design_system41.Input,
|
|
7812
|
+
{
|
|
7813
|
+
type: "date",
|
|
7814
|
+
label: ariaLabel,
|
|
7815
|
+
showLabel: false,
|
|
7816
|
+
onChange: (e) => setInnerValue(e.currentTarget.value),
|
|
7817
|
+
disabled,
|
|
7818
|
+
value: innerValue,
|
|
7819
|
+
readOnly,
|
|
7820
|
+
"data-testid": valueTestId
|
|
7837
7821
|
}
|
|
7838
|
-
|
|
7822
|
+
);
|
|
7823
|
+
};
|
|
7839
7824
|
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7825
|
+
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
7826
|
+
var import_design_system43 = require("@uniformdev/design-system");
|
|
7827
|
+
var import_react77 = require("react");
|
|
7828
|
+
var import_react_use6 = require("react-use");
|
|
7844
7829
|
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7830
|
+
// src/components/SearchAndFilter/editors/shared/ErrorContainer.tsx
|
|
7831
|
+
var import_design_system42 = require("@uniformdev/design-system");
|
|
7832
|
+
var import_jsx_runtime70 = require("@emotion/react/jsx-runtime");
|
|
7833
|
+
var ErrorContainer = ({ errorMessage }) => {
|
|
7834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
7835
|
+
"div",
|
|
7836
|
+
{
|
|
7837
|
+
css: {
|
|
7838
|
+
gridColumn: "span 6",
|
|
7839
|
+
order: 6
|
|
7840
|
+
},
|
|
7841
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_design_system42.FieldMessage, { errorMessage })
|
|
7848
7842
|
}
|
|
7849
|
-
|
|
7843
|
+
);
|
|
7844
|
+
};
|
|
7850
7845
|
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
var
|
|
7856
|
-
|
|
7857
|
-
gap: var(--spacing-sm);
|
|
7858
|
-
flex-wrap: wrap;
|
|
7846
|
+
// src/components/SearchAndFilter/editors/shared/twoColumnGrid.tsx
|
|
7847
|
+
var twoColumnGrid = {
|
|
7848
|
+
display: "grid",
|
|
7849
|
+
gridTemplateColumns: "1fr 1fr",
|
|
7850
|
+
gap: "var(--spacing-sm);"
|
|
7851
|
+
};
|
|
7859
7852
|
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7853
|
+
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
7854
|
+
var import_jsx_runtime71 = require("@emotion/react/jsx-runtime");
|
|
7855
|
+
var DateRangeEditor = ({
|
|
7856
|
+
ariaLabel,
|
|
7857
|
+
onChange,
|
|
7858
|
+
disabled,
|
|
7859
|
+
value,
|
|
7860
|
+
readOnly,
|
|
7861
|
+
valueTestId
|
|
7862
|
+
}) => {
|
|
7863
|
+
const [minDateValue, setMinDateValue] = (0, import_react77.useState)(value ? value[0] : "");
|
|
7864
|
+
const [maxDateValue, setMaxDateValue] = (0, import_react77.useState)(value ? value[1] : "");
|
|
7865
|
+
const [error, setError] = (0, import_react77.useState)("");
|
|
7866
|
+
(0, import_react_use6.useDebounce)(
|
|
7867
|
+
() => {
|
|
7868
|
+
if (minDateValue && maxDateValue && !error) {
|
|
7869
|
+
onChange([minDateValue, maxDateValue]);
|
|
7870
|
+
} else {
|
|
7871
|
+
onChange([]);
|
|
7872
|
+
}
|
|
7873
|
+
},
|
|
7874
|
+
500,
|
|
7875
|
+
[minDateValue, maxDateValue]
|
|
7876
|
+
);
|
|
7877
|
+
(0, import_react77.useEffect)(() => {
|
|
7878
|
+
if (!minDateValue || !maxDateValue) {
|
|
7879
|
+
return;
|
|
7863
7880
|
}
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7881
|
+
const minDate = new Date(minDateValue);
|
|
7882
|
+
const maxDate = new Date(maxDateValue);
|
|
7883
|
+
if (maxDate < minDate) {
|
|
7884
|
+
setError("The max date cannot be lower than the min date");
|
|
7885
|
+
return;
|
|
7867
7886
|
}
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
grid-template-columns: 200px 160px 1fr 32px;
|
|
7872
|
-
|
|
7873
|
-
& > div:nth-child(n) {
|
|
7874
|
-
width: auto;
|
|
7887
|
+
if (maxDate && !minDate) {
|
|
7888
|
+
setError("Please enter both a low and high date");
|
|
7889
|
+
return;
|
|
7875
7890
|
}
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
`;
|
|
7882
|
-
var BindableKeywordSearchInputStyles = import_react76.css`
|
|
7883
|
-
position: relative;
|
|
7884
|
-
width: 100%;
|
|
7885
|
-
|
|
7886
|
-
& [data-lexical-editor='true'] {
|
|
7887
|
-
padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
|
|
7888
|
-
font-size: var(--fs-sm);
|
|
7889
|
-
border-radius: var(--rounded-full);
|
|
7890
|
-
max-height: 40px;
|
|
7891
|
-
min-height: unset;
|
|
7892
|
-
width: 100%;
|
|
7893
|
-
position: relative;
|
|
7894
|
-
white-space: nowrap;
|
|
7895
|
-
}
|
|
7896
|
-
`;
|
|
7897
|
-
var ClearSearchButtonContainer = import_react76.css`
|
|
7898
|
-
align-items: center;
|
|
7899
|
-
display: flex;
|
|
7900
|
-
position: absolute;
|
|
7901
|
-
inset: 0 var(--spacing-lg) 0 auto;
|
|
7902
|
-
`;
|
|
7903
|
-
var ClearSearchButtonStyles = import_react76.css`
|
|
7904
|
-
background: none;
|
|
7905
|
-
border: none;
|
|
7906
|
-
padding: 0;
|
|
7907
|
-
pointer-events: all;
|
|
7908
|
-
`;
|
|
7909
|
-
var FilterButton = import_react76.css`
|
|
7910
|
-
align-items: center;
|
|
7911
|
-
background: var(--white);
|
|
7912
|
-
border: 1px solid var(--gray-300);
|
|
7913
|
-
border-radius: var(--rounded-full);
|
|
7914
|
-
color: var(--typography-base);
|
|
7915
|
-
display: flex;
|
|
7916
|
-
font-size: var(--fs-sm);
|
|
7917
|
-
gap: var(--spacing-sm);
|
|
7918
|
-
padding: var(--spacing-sm) var(--spacing-base);
|
|
7919
|
-
max-height: 40px;
|
|
7920
|
-
transition: color var(--duration-fast) var(--timing-ease-out),
|
|
7921
|
-
background-color var(--duration-fast) var(--timing-ease-out),
|
|
7922
|
-
border-color var(--duration-fast) var(--timing-ease-out),
|
|
7923
|
-
box-shadow var(--duration-fast) var(--timing-ease-out);
|
|
7924
|
-
|
|
7925
|
-
svg {
|
|
7926
|
-
color: var(--gray-300);
|
|
7927
|
-
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7928
|
-
}
|
|
7929
|
-
|
|
7930
|
-
&:hover,
|
|
7931
|
-
:where([aria-expanded='true']) {
|
|
7932
|
-
outline: none;
|
|
7933
|
-
background: var(--gray-200);
|
|
7934
|
-
border-color: var(--gray-300);
|
|
7935
|
-
|
|
7936
|
-
svg {
|
|
7937
|
-
color: var(--typography-base);
|
|
7891
|
+
const minDateString = minDate.toDateString();
|
|
7892
|
+
const maxDateString = maxDate.toDateString();
|
|
7893
|
+
if (minDateString === maxDateString || maxDateString === minDateString) {
|
|
7894
|
+
setError("The min and max date cannot be the same");
|
|
7895
|
+
return;
|
|
7938
7896
|
}
|
|
7939
|
-
|
|
7897
|
+
if (minDate > maxDate) {
|
|
7898
|
+
setError("The min date cannot be higher than the max date");
|
|
7899
|
+
return;
|
|
7900
|
+
}
|
|
7901
|
+
if (error) {
|
|
7902
|
+
setError("");
|
|
7903
|
+
}
|
|
7904
|
+
if (minDate && maxDate) {
|
|
7905
|
+
setMinDateValue(minDateValue);
|
|
7906
|
+
setMaxDateValue(maxDateValue);
|
|
7907
|
+
} else {
|
|
7908
|
+
setMinDateValue("");
|
|
7909
|
+
setMaxDateValue("");
|
|
7910
|
+
}
|
|
7911
|
+
}, [minDateValue, maxDateValue, setError]);
|
|
7912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_jsx_runtime71.Fragment, { children: [
|
|
7913
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
7914
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
7915
|
+
import_design_system43.Input,
|
|
7916
|
+
{
|
|
7917
|
+
label: `${ariaLabel}-min-date`,
|
|
7918
|
+
type: "date",
|
|
7919
|
+
showLabel: false,
|
|
7920
|
+
value: minDateValue,
|
|
7921
|
+
onChange: (e) => setMinDateValue(e.currentTarget.value),
|
|
7922
|
+
"aria-invalid": !error ? false : true,
|
|
7923
|
+
disabled,
|
|
7924
|
+
readOnly,
|
|
7925
|
+
"data-testid": "value-low"
|
|
7926
|
+
}
|
|
7927
|
+
),
|
|
7928
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
7929
|
+
import_design_system43.Input,
|
|
7930
|
+
{
|
|
7931
|
+
label: `${ariaLabel}-max-date`,
|
|
7932
|
+
type: "date",
|
|
7933
|
+
showLabel: false,
|
|
7934
|
+
value: maxDateValue,
|
|
7935
|
+
onChange: (e) => setMaxDateValue(e.currentTarget.value),
|
|
7936
|
+
"aria-invalid": !error ? false : true,
|
|
7937
|
+
disabled,
|
|
7938
|
+
readOnly,
|
|
7939
|
+
"data-testid": "value-high"
|
|
7940
|
+
}
|
|
7941
|
+
)
|
|
7942
|
+
] }),
|
|
7943
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ErrorContainer, { errorMessage: error })
|
|
7944
|
+
] });
|
|
7945
|
+
};
|
|
7940
7946
|
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
`;
|
|
7945
|
-
var FilterButtonText = import_react76.css`
|
|
7946
|
-
overflow: hidden;
|
|
7947
|
-
text-overflow: ellipsis;
|
|
7948
|
-
white-space: nowrap;
|
|
7949
|
-
max-width: 14ch;
|
|
7950
|
-
`;
|
|
7951
|
-
var FilterButtonSelected = import_react76.css`
|
|
7952
|
-
background: var(--gray-100);
|
|
7953
|
-
border-color: var(--gray-300);
|
|
7947
|
+
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
7948
|
+
var import_design_system44 = require("@uniformdev/design-system");
|
|
7949
|
+
var import_react78 = require("react");
|
|
7954
7950
|
|
|
7955
|
-
|
|
7956
|
-
color: var(--accent-dark);
|
|
7957
|
-
}
|
|
7958
|
-
`;
|
|
7959
|
-
var FilterButtonWithOptions = import_react76.css`
|
|
7960
|
-
:where([aria-expanded='true']) {
|
|
7961
|
-
background: var(--purple-rain-100);
|
|
7962
|
-
border-color: var(--accent-light);
|
|
7963
|
-
color: var(--typography-base);
|
|
7964
|
-
box-shadow: var(--elevation-100);
|
|
7965
|
-
|
|
7966
|
-
svg {
|
|
7967
|
-
color: var(--accent-dark);
|
|
7968
|
-
}
|
|
7969
|
-
}
|
|
7970
|
-
`;
|
|
7971
|
-
var SearchIcon = import_react76.css`
|
|
7972
|
-
color: var(--icon-color);
|
|
7973
|
-
position: absolute;
|
|
7974
|
-
inset: 0 var(--spacing-base) 0 auto;
|
|
7975
|
-
margin: auto;
|
|
7976
|
-
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7977
|
-
`;
|
|
7978
|
-
var AddConditionalBtn = import_react76.css`
|
|
7979
|
-
align-items: center;
|
|
7980
|
-
background: transparent;
|
|
7981
|
-
border: none;
|
|
7982
|
-
color: var(--primary-action-default);
|
|
7983
|
-
display: flex;
|
|
7984
|
-
gap: var(--spacing-sm);
|
|
7985
|
-
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7986
|
-
padding: 0;
|
|
7987
|
-
|
|
7988
|
-
&:hover,
|
|
7989
|
-
&:focus {
|
|
7990
|
-
color: var(--primary-action-hover);
|
|
7991
|
-
}
|
|
7992
|
-
|
|
7993
|
-
&:disabled {
|
|
7994
|
-
color: var(--gray-400);
|
|
7995
|
-
}
|
|
7996
|
-
`;
|
|
7997
|
-
var Title = import_react76.css`
|
|
7998
|
-
color: var(--typography-light);
|
|
7999
|
-
|
|
8000
|
-
&:focus {
|
|
8001
|
-
outline: none;
|
|
8002
|
-
}
|
|
8003
|
-
`;
|
|
8004
|
-
var ResetConditionsBtn = import_react76.css`
|
|
8005
|
-
background: transparent;
|
|
8006
|
-
border: none;
|
|
8007
|
-
color: var(--action-destructive-default);
|
|
8008
|
-
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
8009
|
-
padding: 0;
|
|
8010
|
-
|
|
8011
|
-
&:hover,
|
|
8012
|
-
&:focus {
|
|
8013
|
-
color: var(--action-destructive-hover);
|
|
8014
|
-
}
|
|
8015
|
-
`;
|
|
8016
|
-
var IconBtn = import_react76.css`
|
|
8017
|
-
background: transparent;
|
|
8018
|
-
border: none;
|
|
8019
|
-
padding: var(--spacing-sm);
|
|
8020
|
-
`;
|
|
8021
|
-
var SearchAndFilterOptionsContainer = import_react76.css`
|
|
8022
|
-
background: var(--gray-50);
|
|
8023
|
-
border: 1px solid var(--gray-300);
|
|
8024
|
-
border-radius: var(--rounded-base);
|
|
8025
|
-
container-type: inline-size;
|
|
8026
|
-
display: flex;
|
|
8027
|
-
flex-direction: column;
|
|
8028
|
-
gap: var(--spacing-sm);
|
|
8029
|
-
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
8030
|
-
will-change: height;
|
|
8031
|
-
position: relative;
|
|
8032
|
-
z-index: 1;
|
|
8033
|
-
`;
|
|
8034
|
-
var SearchAndFilterOptionsInnerContainer = import_react76.css`
|
|
8035
|
-
display: flex;
|
|
8036
|
-
flex-direction: column;
|
|
8037
|
-
gap: var(--spacing-sm);
|
|
8038
|
-
padding-inline: var(--spacing-md);
|
|
8039
|
-
`;
|
|
8040
|
-
var SearchAndFilterButtonGroup = import_react76.css`
|
|
8041
|
-
margin-top: var(--spacing-xs);
|
|
8042
|
-
margin-left: calc(56px + var(--spacing-md));
|
|
8043
|
-
`;
|
|
8044
|
-
|
|
8045
|
-
// src/components/SearchAndFilter/FilterButton.tsx
|
|
8046
|
-
var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
|
|
8047
|
-
var FilterButton2 = ({
|
|
8048
|
-
text = "Filters",
|
|
8049
|
-
icon = "filter-add",
|
|
8050
|
-
filterCount,
|
|
8051
|
-
hasSelectedValue,
|
|
8052
|
-
dataTestId,
|
|
8053
|
-
...props
|
|
8054
|
-
}) => {
|
|
8055
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
8056
|
-
"button",
|
|
8057
|
-
{
|
|
8058
|
-
type: "button",
|
|
8059
|
-
css: [
|
|
8060
|
-
FilterButton,
|
|
8061
|
-
hasSelectedValue ? FilterButtonSelected : void 0,
|
|
8062
|
-
filterCount ? [FilterButtonWithOptions, FilterButtonSelected] : void 0
|
|
8063
|
-
],
|
|
8064
|
-
...props,
|
|
8065
|
-
"data-testid": dataTestId,
|
|
8066
|
-
children: [
|
|
8067
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_design_system42.Icon, { icon, iconColor: "currentColor", size: "1rem" }),
|
|
8068
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { css: FilterButtonText, children: text }),
|
|
8069
|
-
filterCount ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_design_system42.Counter, { count: filterCount, bgColor: "var(--white)" }) : null
|
|
8070
|
-
]
|
|
8071
|
-
}
|
|
8072
|
-
);
|
|
8073
|
-
};
|
|
8074
|
-
|
|
8075
|
-
// src/components/SearchAndFilter/FilterControls.tsx
|
|
8076
|
-
var import_CgClose5 = require("@react-icons/all-files/cg/CgClose");
|
|
8077
|
-
var import_design_system45 = require("@uniformdev/design-system");
|
|
8078
|
-
var import_lexical11 = require("lexical");
|
|
8079
|
-
var import_react79 = require("react");
|
|
8080
|
-
var import_react_use6 = require("react-use");
|
|
8081
|
-
var import_uuid3 = require("uuid");
|
|
8082
|
-
|
|
8083
|
-
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
8084
|
-
var import_design_system44 = require("@uniformdev/design-system");
|
|
8085
|
-
var import_react78 = require("react");
|
|
8086
|
-
|
|
8087
|
-
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
8088
|
-
var import_design_system43 = require("@uniformdev/design-system");
|
|
8089
|
-
var import_react77 = require("react");
|
|
8090
|
-
var import_react_use5 = require("react-use");
|
|
8091
|
-
var import_jsx_runtime70 = require("@emotion/react/jsx-runtime");
|
|
7951
|
+
// src/components/SearchAndFilter/editors/shared/readOnlyAttributes.tsx
|
|
8092
7952
|
var readOnlyAttributes = {
|
|
8093
7953
|
isSearchable: false,
|
|
8094
7954
|
menuIsOpen: false,
|
|
8095
7955
|
isClearable: false
|
|
8096
7956
|
};
|
|
7957
|
+
|
|
7958
|
+
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
7959
|
+
var import_jsx_runtime72 = require("@emotion/react/jsx-runtime");
|
|
8097
7960
|
var FilterMultiChoiceEditor = ({
|
|
8098
7961
|
value,
|
|
8099
7962
|
options,
|
|
@@ -8104,20 +7967,24 @@ var FilterMultiChoiceEditor = ({
|
|
|
8104
7967
|
}) => {
|
|
8105
7968
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8106
7969
|
const isClearable = !readOnly || !disabled;
|
|
8107
|
-
|
|
8108
|
-
|
|
7970
|
+
const { groupedOptions, selectedOptions } = (0, import_react78.useMemo)(
|
|
7971
|
+
() => (0, import_design_system44.convertComboBoxGroupsToSelectableGroups)({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
7972
|
+
[options, value]
|
|
7973
|
+
);
|
|
7974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
7975
|
+
import_design_system44.InputComboBox,
|
|
8109
7976
|
{
|
|
8110
7977
|
...props,
|
|
8111
7978
|
placeholder: "Type to search...",
|
|
8112
|
-
options,
|
|
7979
|
+
options: groupedOptions,
|
|
8113
7980
|
isMulti: true,
|
|
8114
7981
|
isClearable,
|
|
8115
7982
|
isDisabled: disabled,
|
|
8116
7983
|
onChange: (e) => {
|
|
8117
|
-
|
|
8118
|
-
return props.onChange(
|
|
7984
|
+
const selectedValues = (0, import_design_system44.getComboBoxSelectedSelectableGroups)(e);
|
|
7985
|
+
return props.onChange([...selectedValues]);
|
|
8119
7986
|
},
|
|
8120
|
-
value:
|
|
7987
|
+
value: selectedOptions,
|
|
8121
7988
|
"aria-readonly": readOnly,
|
|
8122
7989
|
styles: {
|
|
8123
7990
|
menu(base) {
|
|
@@ -8131,6 +7998,11 @@ var FilterMultiChoiceEditor = ({
|
|
|
8131
7998
|
}
|
|
8132
7999
|
) });
|
|
8133
8000
|
};
|
|
8001
|
+
|
|
8002
|
+
// src/components/SearchAndFilter/editors/FilterSingleChoiceEditor.tsx
|
|
8003
|
+
var import_design_system45 = require("@uniformdev/design-system");
|
|
8004
|
+
var import_react79 = require("react");
|
|
8005
|
+
var import_jsx_runtime73 = require("@emotion/react/jsx-runtime");
|
|
8134
8006
|
var FilterSingleChoiceEditor = ({
|
|
8135
8007
|
options,
|
|
8136
8008
|
value,
|
|
@@ -8139,91 +8011,30 @@ var FilterSingleChoiceEditor = ({
|
|
|
8139
8011
|
onChange,
|
|
8140
8012
|
valueTestId
|
|
8141
8013
|
}) => {
|
|
8142
|
-
var _a;
|
|
8143
8014
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8144
|
-
|
|
8145
|
-
|
|
8015
|
+
const { groupedOptions, selectedOptions } = (0, import_react79.useMemo)(
|
|
8016
|
+
() => (0, import_design_system45.convertComboBoxGroupsToSelectableGroups)({
|
|
8017
|
+
options: options != null ? options : [],
|
|
8018
|
+
selectedItems: new Set(value ? [value] : void 0),
|
|
8019
|
+
selectionMode: "single"
|
|
8020
|
+
}),
|
|
8021
|
+
[options, value]
|
|
8022
|
+
);
|
|
8023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
8024
|
+
import_design_system45.InputComboBox,
|
|
8146
8025
|
{
|
|
8147
8026
|
placeholder: "Type to search...",
|
|
8148
|
-
options,
|
|
8027
|
+
options: groupedOptions,
|
|
8149
8028
|
isClearable: true,
|
|
8150
8029
|
onChange: (e) => {
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
},
|
|
8154
|
-
isDisabled: disabled,
|
|
8155
|
-
value: (_a = options == null ? void 0 : options.find((option) => option.value === value)) != null ? _a : null,
|
|
8156
|
-
"aria-readonly": readOnly,
|
|
8157
|
-
styles: {
|
|
8158
|
-
menu(base) {
|
|
8159
|
-
return {
|
|
8160
|
-
...base,
|
|
8161
|
-
minWidth: "max-content"
|
|
8162
|
-
};
|
|
8030
|
+
if (Array.isArray(e == null ? void 0 : e.value)) {
|
|
8031
|
+
return;
|
|
8163
8032
|
}
|
|
8033
|
+
return onChange(e == null ? void 0 : e.value);
|
|
8164
8034
|
},
|
|
8165
|
-
...readOnlyProps
|
|
8166
|
-
}
|
|
8167
|
-
) });
|
|
8168
|
-
};
|
|
8169
|
-
var CustomOptions = ({ label, value }) => {
|
|
8170
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_design_system43.StatusBullet, { status: label, message: value });
|
|
8171
|
-
};
|
|
8172
|
-
var StatusMultiEditor = ({
|
|
8173
|
-
options,
|
|
8174
|
-
value,
|
|
8175
|
-
disabled,
|
|
8176
|
-
readOnly,
|
|
8177
|
-
onChange,
|
|
8178
|
-
valueTestId
|
|
8179
|
-
}) => {
|
|
8180
|
-
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8181
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
8182
|
-
import_design_system43.InputComboBox,
|
|
8183
|
-
{
|
|
8184
|
-
options,
|
|
8185
|
-
isMulti: true,
|
|
8186
|
-
onChange: (e) => {
|
|
8187
|
-
var _a;
|
|
8188
|
-
return onChange((_a = e.map((item) => item.value)) != null ? _a : []);
|
|
8189
|
-
},
|
|
8190
|
-
formatOptionLabel: CustomOptions,
|
|
8191
|
-
"aria-readonly": readOnly,
|
|
8192
|
-
value: options == null ? void 0 : options.filter((option) => value == null ? void 0 : value.includes(option.value)),
|
|
8193
8035
|
isDisabled: disabled,
|
|
8194
|
-
|
|
8195
|
-
menu(base) {
|
|
8196
|
-
return {
|
|
8197
|
-
...base,
|
|
8198
|
-
minWidth: "max-content"
|
|
8199
|
-
};
|
|
8200
|
-
}
|
|
8201
|
-
},
|
|
8202
|
-
...readOnlyProps
|
|
8203
|
-
}
|
|
8204
|
-
) });
|
|
8205
|
-
};
|
|
8206
|
-
var StatusSingleEditor = ({
|
|
8207
|
-
options,
|
|
8208
|
-
value,
|
|
8209
|
-
disabled,
|
|
8210
|
-
readOnly,
|
|
8211
|
-
onChange,
|
|
8212
|
-
valueTestId
|
|
8213
|
-
}) => {
|
|
8214
|
-
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8215
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
8216
|
-
import_design_system43.InputComboBox,
|
|
8217
|
-
{
|
|
8218
|
-
options,
|
|
8219
|
-
onChange: (e) => {
|
|
8220
|
-
var _a;
|
|
8221
|
-
return onChange((_a = e == null ? void 0 : e.value) != null ? _a : "");
|
|
8222
|
-
},
|
|
8223
|
-
formatOptionLabel: CustomOptions,
|
|
8036
|
+
value: selectedOptions,
|
|
8224
8037
|
"aria-readonly": readOnly,
|
|
8225
|
-
value: options == null ? void 0 : options.find((option) => option.value === value),
|
|
8226
|
-
isDisabled: disabled,
|
|
8227
8038
|
styles: {
|
|
8228
8039
|
menu(base) {
|
|
8229
8040
|
return {
|
|
@@ -8236,28 +8047,43 @@ var StatusSingleEditor = ({
|
|
|
8236
8047
|
}
|
|
8237
8048
|
) });
|
|
8238
8049
|
};
|
|
8239
|
-
|
|
8240
|
-
|
|
8050
|
+
|
|
8051
|
+
// src/components/SearchAndFilter/editors/NumberEditor.tsx
|
|
8052
|
+
var import_design_system46 = require("@uniformdev/design-system");
|
|
8053
|
+
var import_react80 = require("react");
|
|
8054
|
+
var import_react_use7 = require("react-use");
|
|
8055
|
+
var import_jsx_runtime74 = require("@emotion/react/jsx-runtime");
|
|
8056
|
+
var NumberEditor = ({
|
|
8241
8057
|
ariaLabel,
|
|
8058
|
+
onChange,
|
|
8059
|
+
disabled,
|
|
8242
8060
|
value,
|
|
8243
8061
|
readOnly,
|
|
8244
8062
|
valueTestId
|
|
8245
8063
|
}) => {
|
|
8246
|
-
const [innerValue, setInnerValue] = (0,
|
|
8247
|
-
(0,
|
|
8248
|
-
return /* @__PURE__ */ (0,
|
|
8249
|
-
|
|
8064
|
+
const [innerValue, setInnerValue] = (0, import_react80.useState)(value != null ? value : "");
|
|
8065
|
+
(0, import_react_use7.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
8066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
8067
|
+
import_design_system46.Input,
|
|
8250
8068
|
{
|
|
8251
|
-
showLabel: false,
|
|
8252
8069
|
label: ariaLabel,
|
|
8070
|
+
type: "number",
|
|
8071
|
+
showLabel: false,
|
|
8072
|
+
min: 0,
|
|
8253
8073
|
onChange: (e) => setInnerValue(e.currentTarget.value),
|
|
8254
|
-
|
|
8074
|
+
disabled,
|
|
8255
8075
|
value: innerValue,
|
|
8256
8076
|
readOnly,
|
|
8257
8077
|
"data-testid": valueTestId
|
|
8258
8078
|
}
|
|
8259
8079
|
);
|
|
8260
8080
|
};
|
|
8081
|
+
|
|
8082
|
+
// src/components/SearchAndFilter/editors/NumberRangeEditor.tsx
|
|
8083
|
+
var import_design_system47 = require("@uniformdev/design-system");
|
|
8084
|
+
var import_react81 = require("react");
|
|
8085
|
+
var import_react_use8 = require("react-use");
|
|
8086
|
+
var import_jsx_runtime75 = require("@emotion/react/jsx-runtime");
|
|
8261
8087
|
var NumberRangeEditor = ({
|
|
8262
8088
|
onChange,
|
|
8263
8089
|
disabled,
|
|
@@ -8266,10 +8092,10 @@ var NumberRangeEditor = ({
|
|
|
8266
8092
|
readOnly,
|
|
8267
8093
|
valueTestId
|
|
8268
8094
|
}) => {
|
|
8269
|
-
const [minValue, setMinValue] = (0,
|
|
8270
|
-
const [maxValue, setMaxValue] = (0,
|
|
8271
|
-
const [error, setError] = (0,
|
|
8272
|
-
(0,
|
|
8095
|
+
const [minValue, setMinValue] = (0, import_react81.useState)("");
|
|
8096
|
+
const [maxValue, setMaxValue] = (0, import_react81.useState)("");
|
|
8097
|
+
const [error, setError] = (0, import_react81.useState)("");
|
|
8098
|
+
(0, import_react_use8.useDebounce)(
|
|
8273
8099
|
() => {
|
|
8274
8100
|
if (minValue && maxValue && !error) {
|
|
8275
8101
|
onChange([minValue, maxValue]);
|
|
@@ -8280,7 +8106,7 @@ var NumberRangeEditor = ({
|
|
|
8280
8106
|
500,
|
|
8281
8107
|
[minValue, maxValue]
|
|
8282
8108
|
);
|
|
8283
|
-
(0,
|
|
8109
|
+
(0, import_react81.useEffect)(() => {
|
|
8284
8110
|
if (!maxValue && !minValue) {
|
|
8285
8111
|
return;
|
|
8286
8112
|
}
|
|
@@ -8302,10 +8128,10 @@ var NumberRangeEditor = ({
|
|
|
8302
8128
|
setMaxValue(maxValue);
|
|
8303
8129
|
}
|
|
8304
8130
|
}, [maxValue, minValue, setError]);
|
|
8305
|
-
return /* @__PURE__ */ (0,
|
|
8306
|
-
/* @__PURE__ */ (0,
|
|
8307
|
-
/* @__PURE__ */ (0,
|
|
8308
|
-
|
|
8131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
8132
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
8133
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
8134
|
+
import_design_system47.Input,
|
|
8309
8135
|
{
|
|
8310
8136
|
label: `${ariaLabel}-min`,
|
|
8311
8137
|
type: "number",
|
|
@@ -8320,8 +8146,8 @@ var NumberRangeEditor = ({
|
|
|
8320
8146
|
"data-testid": "value-low"
|
|
8321
8147
|
}
|
|
8322
8148
|
),
|
|
8323
|
-
/* @__PURE__ */ (0,
|
|
8324
|
-
|
|
8149
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
8150
|
+
import_design_system47.Input,
|
|
8325
8151
|
{
|
|
8326
8152
|
type: "number",
|
|
8327
8153
|
label: `${ariaLabel}-max`,
|
|
@@ -8337,149 +8163,433 @@ var NumberRangeEditor = ({
|
|
|
8337
8163
|
}
|
|
8338
8164
|
)
|
|
8339
8165
|
] }),
|
|
8340
|
-
/* @__PURE__ */ (0,
|
|
8166
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ErrorContainer, { errorMessage: error })
|
|
8341
8167
|
] });
|
|
8342
8168
|
};
|
|
8343
|
-
|
|
8344
|
-
|
|
8169
|
+
|
|
8170
|
+
// src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
|
|
8171
|
+
var import_design_system49 = require("@uniformdev/design-system");
|
|
8172
|
+
var import_react82 = require("react");
|
|
8173
|
+
|
|
8174
|
+
// src/components/SearchAndFilter/editors/shared/CustomOptions.tsx
|
|
8175
|
+
var import_design_system48 = require("@uniformdev/design-system");
|
|
8176
|
+
var import_jsx_runtime76 = require("@emotion/react/jsx-runtime");
|
|
8177
|
+
var CustomOptions = ({ label, value }) => {
|
|
8178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
8179
|
+
import_design_system48.StatusBullet,
|
|
8180
|
+
{
|
|
8181
|
+
status: label,
|
|
8182
|
+
message: Array.isArray(value) ? value.join(",") : value
|
|
8183
|
+
}
|
|
8184
|
+
);
|
|
8185
|
+
};
|
|
8186
|
+
|
|
8187
|
+
// src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
|
|
8188
|
+
var import_jsx_runtime77 = require("@emotion/react/jsx-runtime");
|
|
8189
|
+
var StatusMultiEditor = ({
|
|
8190
|
+
options,
|
|
8191
|
+
value,
|
|
8192
|
+
disabled,
|
|
8193
|
+
readOnly,
|
|
8345
8194
|
onChange,
|
|
8195
|
+
valueTestId
|
|
8196
|
+
}) => {
|
|
8197
|
+
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8198
|
+
const { groupedOptions, selectedOptions } = (0, import_react82.useMemo)(
|
|
8199
|
+
() => (0, import_design_system49.convertComboBoxGroupsToSelectableGroups)({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
8200
|
+
[options, value]
|
|
8201
|
+
);
|
|
8202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
8203
|
+
import_design_system49.InputComboBox,
|
|
8204
|
+
{
|
|
8205
|
+
options: groupedOptions != null ? groupedOptions : [],
|
|
8206
|
+
isMulti: true,
|
|
8207
|
+
onChange: (e) => {
|
|
8208
|
+
const selectedValues = (0, import_design_system49.getComboBoxSelectedSelectableGroups)(e);
|
|
8209
|
+
return onChange([...selectedValues]);
|
|
8210
|
+
},
|
|
8211
|
+
formatOptionLabel: CustomOptions,
|
|
8212
|
+
"aria-readonly": readOnly,
|
|
8213
|
+
value: selectedOptions,
|
|
8214
|
+
isDisabled: disabled,
|
|
8215
|
+
styles: {
|
|
8216
|
+
menu(base) {
|
|
8217
|
+
return {
|
|
8218
|
+
...base,
|
|
8219
|
+
minWidth: "max-content"
|
|
8220
|
+
};
|
|
8221
|
+
}
|
|
8222
|
+
},
|
|
8223
|
+
...readOnlyProps
|
|
8224
|
+
}
|
|
8225
|
+
) });
|
|
8226
|
+
};
|
|
8227
|
+
|
|
8228
|
+
// src/components/SearchAndFilter/editors/StatusSingleEditor.tsx
|
|
8229
|
+
var import_design_system50 = require("@uniformdev/design-system");
|
|
8230
|
+
var import_react83 = require("react");
|
|
8231
|
+
var import_jsx_runtime78 = require("@emotion/react/jsx-runtime");
|
|
8232
|
+
var StatusSingleEditor = ({
|
|
8233
|
+
options,
|
|
8234
|
+
value,
|
|
8346
8235
|
disabled,
|
|
8236
|
+
readOnly,
|
|
8237
|
+
onChange,
|
|
8238
|
+
valueTestId
|
|
8239
|
+
}) => {
|
|
8240
|
+
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8241
|
+
const { groupedOptions, selectedOptions } = (0, import_react83.useMemo)(
|
|
8242
|
+
() => (0, import_design_system50.convertComboBoxGroupsToSelectableGroups)({
|
|
8243
|
+
options: options != null ? options : [],
|
|
8244
|
+
selectedItems: new Set(value ? [value] : void 0),
|
|
8245
|
+
selectionMode: "single"
|
|
8246
|
+
}),
|
|
8247
|
+
[options, value]
|
|
8248
|
+
);
|
|
8249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
8250
|
+
import_design_system50.InputComboBox,
|
|
8251
|
+
{
|
|
8252
|
+
options: groupedOptions,
|
|
8253
|
+
onChange: (e) => {
|
|
8254
|
+
if (Array.isArray(e == null ? void 0 : e.value)) {
|
|
8255
|
+
return;
|
|
8256
|
+
}
|
|
8257
|
+
return onChange(e == null ? void 0 : e.value);
|
|
8258
|
+
},
|
|
8259
|
+
formatOptionLabel: CustomOptions,
|
|
8260
|
+
"aria-readonly": readOnly,
|
|
8261
|
+
value: selectedOptions,
|
|
8262
|
+
isDisabled: disabled,
|
|
8263
|
+
styles: {
|
|
8264
|
+
menu(base) {
|
|
8265
|
+
return {
|
|
8266
|
+
...base,
|
|
8267
|
+
minWidth: "max-content"
|
|
8268
|
+
};
|
|
8269
|
+
}
|
|
8270
|
+
},
|
|
8271
|
+
...readOnlyProps
|
|
8272
|
+
}
|
|
8273
|
+
) });
|
|
8274
|
+
};
|
|
8275
|
+
|
|
8276
|
+
// src/components/SearchAndFilter/editors/TextEditor.tsx
|
|
8277
|
+
var import_design_system51 = require("@uniformdev/design-system");
|
|
8278
|
+
var import_react84 = require("react");
|
|
8279
|
+
var import_react_use9 = require("react-use");
|
|
8280
|
+
var import_jsx_runtime79 = require("@emotion/react/jsx-runtime");
|
|
8281
|
+
var TextEditor = ({
|
|
8282
|
+
onChange,
|
|
8283
|
+
ariaLabel,
|
|
8347
8284
|
value,
|
|
8348
8285
|
readOnly,
|
|
8349
8286
|
valueTestId
|
|
8350
8287
|
}) => {
|
|
8351
|
-
const [innerValue, setInnerValue] = (0,
|
|
8352
|
-
(0,
|
|
8353
|
-
return /* @__PURE__ */ (0,
|
|
8354
|
-
|
|
8288
|
+
const [innerValue, setInnerValue] = (0, import_react84.useState)(value != null ? value : "");
|
|
8289
|
+
(0, import_react_use9.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
8290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
8291
|
+
import_design_system51.Input,
|
|
8355
8292
|
{
|
|
8356
|
-
label: ariaLabel,
|
|
8357
|
-
type: "number",
|
|
8358
8293
|
showLabel: false,
|
|
8359
|
-
|
|
8294
|
+
label: ariaLabel,
|
|
8360
8295
|
onChange: (e) => setInnerValue(e.currentTarget.value),
|
|
8361
|
-
|
|
8296
|
+
placeholder: "Enter phrase to search\u2026",
|
|
8362
8297
|
value: innerValue,
|
|
8363
8298
|
readOnly,
|
|
8364
8299
|
"data-testid": valueTestId
|
|
8365
8300
|
}
|
|
8366
|
-
);
|
|
8367
|
-
};
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8301
|
+
);
|
|
8302
|
+
};
|
|
8303
|
+
|
|
8304
|
+
// src/components/SearchAndFilter/FilterButton.tsx
|
|
8305
|
+
var import_design_system53 = require("@uniformdev/design-system");
|
|
8306
|
+
|
|
8307
|
+
// src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
|
|
8308
|
+
var import_react85 = require("@emotion/react");
|
|
8309
|
+
var import_design_system52 = require("@uniformdev/design-system");
|
|
8310
|
+
var SearchAndFilterControlsWrapper = (gridColumns) => import_react85.css`
|
|
8311
|
+
align-items: stretch;
|
|
8312
|
+
display: grid;
|
|
8313
|
+
grid-template-columns: ${gridColumns};
|
|
8314
|
+
gap: var(--spacing-sm);
|
|
8315
|
+
`;
|
|
8316
|
+
var SearchAndFilterOutterControlWrapper = (gridColumns) => import_react85.css`
|
|
8317
|
+
align-items: stretch;
|
|
8318
|
+
display: grid;
|
|
8319
|
+
grid-template-columns: ${gridColumns};
|
|
8320
|
+
gap: var(--spacing-sm);
|
|
8321
|
+
`;
|
|
8322
|
+
var ConditionalFilterRow = import_react85.css`
|
|
8323
|
+
align-items: baseline;
|
|
8324
|
+
display: grid;
|
|
8325
|
+
grid-template-columns: 35px 1fr;
|
|
8326
|
+
gap: var(--spacing-sm);
|
|
8327
|
+
margin-left: var(--spacing-base);
|
|
8328
|
+
|
|
8329
|
+
${(0, import_design_system52.cq)("380px")} {
|
|
8330
|
+
&:after {
|
|
8331
|
+
content: '';
|
|
8332
|
+
display: block;
|
|
8333
|
+
height: 1px;
|
|
8334
|
+
background: var(--gray-300);
|
|
8335
|
+
width: calc(100% - var(--spacing-base));
|
|
8336
|
+
margin-left: var(--spacing-base);
|
|
8337
|
+
}
|
|
8338
|
+
&:last-of-type:after {
|
|
8339
|
+
display: none;
|
|
8340
|
+
}
|
|
8341
|
+
}
|
|
8342
|
+
|
|
8343
|
+
&:nth-of-type(2) {
|
|
8344
|
+
margin-left: 0;
|
|
8345
|
+
grid-template-columns: 50px 1fr;
|
|
8346
|
+
}
|
|
8347
|
+
|
|
8348
|
+
${(0, import_design_system52.cq)("580px")} {
|
|
8349
|
+
&:after {
|
|
8350
|
+
display: none;
|
|
8351
|
+
}
|
|
8352
|
+
}
|
|
8353
|
+
|
|
8354
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
8355
|
+
animation: ${import_design_system52.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
8356
|
+
}
|
|
8357
|
+
`;
|
|
8358
|
+
var ConditionalInputRow = import_react85.css`
|
|
8359
|
+
display: flex;
|
|
8360
|
+
gap: var(--spacing-sm);
|
|
8361
|
+
flex-wrap: wrap;
|
|
8362
|
+
|
|
8363
|
+
${(0, import_design_system52.cq)("380px")} {
|
|
8364
|
+
& > div:nth-child(-n + 2) {
|
|
8365
|
+
width: calc(50% - var(--spacing-sm));
|
|
8366
|
+
}
|
|
8367
|
+
|
|
8368
|
+
& > div:nth-child(n + 3) {
|
|
8369
|
+
width: calc(100% - 48px);
|
|
8370
|
+
}
|
|
8371
|
+
}
|
|
8372
|
+
${(0, import_design_system52.cq)("764px")} {
|
|
8373
|
+
align-items: flex-start;
|
|
8374
|
+
display: grid;
|
|
8375
|
+
grid-template-columns: 200px 160px 1fr 32px;
|
|
8376
|
+
|
|
8377
|
+
& > div:nth-child(n) {
|
|
8378
|
+
width: auto;
|
|
8379
|
+
}
|
|
8380
|
+
}
|
|
8381
|
+
`;
|
|
8382
|
+
var SearchInput = import_react85.css`
|
|
8383
|
+
max-height: 40px;
|
|
8384
|
+
min-height: unset;
|
|
8385
|
+
`;
|
|
8386
|
+
var BindableKeywordSearchInputStyles = import_react85.css`
|
|
8387
|
+
position: relative;
|
|
8388
|
+
width: 100%;
|
|
8389
|
+
|
|
8390
|
+
& [data-lexical-editor='true'] {
|
|
8391
|
+
padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
|
|
8392
|
+
font-size: var(--fs-sm);
|
|
8393
|
+
border-radius: var(--rounded-full);
|
|
8394
|
+
max-height: 40px;
|
|
8395
|
+
min-height: unset;
|
|
8396
|
+
width: 100%;
|
|
8397
|
+
position: relative;
|
|
8398
|
+
white-space: nowrap;
|
|
8399
|
+
}
|
|
8400
|
+
`;
|
|
8401
|
+
var ClearSearchButtonContainer = import_react85.css`
|
|
8402
|
+
align-items: center;
|
|
8403
|
+
display: flex;
|
|
8404
|
+
position: absolute;
|
|
8405
|
+
inset: 0 var(--spacing-lg) 0 auto;
|
|
8406
|
+
`;
|
|
8407
|
+
var ClearSearchButtonStyles = import_react85.css`
|
|
8408
|
+
background: none;
|
|
8409
|
+
border: none;
|
|
8410
|
+
padding: 0;
|
|
8411
|
+
pointer-events: all;
|
|
8412
|
+
`;
|
|
8413
|
+
var FilterButton = import_react85.css`
|
|
8414
|
+
align-items: center;
|
|
8415
|
+
background: var(--white);
|
|
8416
|
+
border: 1px solid var(--gray-300);
|
|
8417
|
+
border-radius: var(--rounded-full);
|
|
8418
|
+
color: var(--typography-base);
|
|
8419
|
+
display: flex;
|
|
8420
|
+
font-size: var(--fs-sm);
|
|
8421
|
+
gap: var(--spacing-sm);
|
|
8422
|
+
padding: var(--spacing-sm) var(--spacing-base);
|
|
8423
|
+
max-height: 40px;
|
|
8424
|
+
transition: color var(--duration-fast) var(--timing-ease-out),
|
|
8425
|
+
background-color var(--duration-fast) var(--timing-ease-out),
|
|
8426
|
+
border-color var(--duration-fast) var(--timing-ease-out),
|
|
8427
|
+
box-shadow var(--duration-fast) var(--timing-ease-out);
|
|
8428
|
+
|
|
8429
|
+
svg {
|
|
8430
|
+
color: var(--gray-300);
|
|
8431
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
8432
|
+
}
|
|
8433
|
+
|
|
8434
|
+
&:hover,
|
|
8435
|
+
:where([aria-expanded='true']) {
|
|
8436
|
+
outline: none;
|
|
8437
|
+
background: var(--gray-200);
|
|
8438
|
+
border-color: var(--gray-300);
|
|
8439
|
+
|
|
8440
|
+
svg {
|
|
8441
|
+
color: var(--typography-base);
|
|
8442
|
+
}
|
|
8443
|
+
}
|
|
8444
|
+
|
|
8445
|
+
&:disabled {
|
|
8446
|
+
opacity: var(--opacity-50);
|
|
8447
|
+
}
|
|
8448
|
+
`;
|
|
8449
|
+
var FilterButtonText = import_react85.css`
|
|
8450
|
+
overflow: hidden;
|
|
8451
|
+
text-overflow: ellipsis;
|
|
8452
|
+
white-space: nowrap;
|
|
8453
|
+
max-width: 14ch;
|
|
8454
|
+
`;
|
|
8455
|
+
var FilterButtonSelected = import_react85.css`
|
|
8456
|
+
background: var(--gray-100);
|
|
8457
|
+
border-color: var(--gray-300);
|
|
8458
|
+
|
|
8459
|
+
svg {
|
|
8460
|
+
color: var(--accent-dark);
|
|
8461
|
+
}
|
|
8462
|
+
`;
|
|
8463
|
+
var FilterButtonWithOptions = import_react85.css`
|
|
8464
|
+
:where([aria-expanded='true']) {
|
|
8465
|
+
background: var(--purple-rain-100);
|
|
8466
|
+
border-color: var(--accent-light);
|
|
8467
|
+
color: var(--typography-base);
|
|
8468
|
+
box-shadow: var(--elevation-100);
|
|
8469
|
+
|
|
8470
|
+
svg {
|
|
8471
|
+
color: var(--accent-dark);
|
|
8472
|
+
}
|
|
8473
|
+
}
|
|
8474
|
+
`;
|
|
8475
|
+
var SearchIcon = import_react85.css`
|
|
8476
|
+
color: var(--icon-color);
|
|
8477
|
+
position: absolute;
|
|
8478
|
+
inset: 0 var(--spacing-base) 0 auto;
|
|
8479
|
+
margin: auto;
|
|
8480
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
8481
|
+
`;
|
|
8482
|
+
var AddConditionalBtn = import_react85.css`
|
|
8483
|
+
align-items: center;
|
|
8484
|
+
background: transparent;
|
|
8485
|
+
border: none;
|
|
8486
|
+
color: var(--primary-action-default);
|
|
8487
|
+
display: flex;
|
|
8488
|
+
gap: var(--spacing-sm);
|
|
8489
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
8490
|
+
padding: 0;
|
|
8491
|
+
|
|
8492
|
+
&:hover,
|
|
8493
|
+
&:focus {
|
|
8494
|
+
color: var(--primary-action-hover);
|
|
8495
|
+
}
|
|
8496
|
+
|
|
8497
|
+
&:disabled {
|
|
8498
|
+
color: var(--gray-400);
|
|
8499
|
+
}
|
|
8500
|
+
`;
|
|
8501
|
+
var Title = import_react85.css`
|
|
8502
|
+
color: var(--typography-light);
|
|
8503
|
+
|
|
8504
|
+
&:focus {
|
|
8505
|
+
outline: none;
|
|
8506
|
+
}
|
|
8507
|
+
`;
|
|
8508
|
+
var ResetConditionsBtn = import_react85.css`
|
|
8509
|
+
background: transparent;
|
|
8510
|
+
border: none;
|
|
8511
|
+
color: var(--action-destructive-default);
|
|
8512
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
8513
|
+
padding: 0;
|
|
8514
|
+
|
|
8515
|
+
&:hover,
|
|
8516
|
+
&:focus {
|
|
8517
|
+
color: var(--action-destructive-hover);
|
|
8518
|
+
}
|
|
8519
|
+
`;
|
|
8520
|
+
var IconBtn = import_react85.css`
|
|
8521
|
+
background: transparent;
|
|
8522
|
+
border: none;
|
|
8523
|
+
padding: var(--spacing-sm);
|
|
8524
|
+
`;
|
|
8525
|
+
var SearchAndFilterOptionsContainer = import_react85.css`
|
|
8526
|
+
background: var(--gray-50);
|
|
8527
|
+
border: 1px solid var(--gray-300);
|
|
8528
|
+
border-radius: var(--rounded-base);
|
|
8529
|
+
container-type: inline-size;
|
|
8530
|
+
display: flex;
|
|
8531
|
+
flex-direction: column;
|
|
8532
|
+
gap: var(--spacing-sm);
|
|
8533
|
+
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
8534
|
+
will-change: height;
|
|
8535
|
+
position: relative;
|
|
8536
|
+
z-index: 1;
|
|
8537
|
+
`;
|
|
8538
|
+
var SearchAndFilterOptionsInnerContainer = import_react85.css`
|
|
8539
|
+
display: flex;
|
|
8540
|
+
flex-direction: column;
|
|
8541
|
+
gap: var(--spacing-sm);
|
|
8542
|
+
padding-inline: var(--spacing-md);
|
|
8543
|
+
`;
|
|
8544
|
+
var SearchAndFilterButtonGroup = import_react85.css`
|
|
8545
|
+
margin-top: var(--spacing-xs);
|
|
8546
|
+
margin-left: calc(56px + var(--spacing-md));
|
|
8547
|
+
`;
|
|
8548
|
+
|
|
8549
|
+
// src/components/SearchAndFilter/FilterButton.tsx
|
|
8550
|
+
var import_jsx_runtime80 = require("@emotion/react/jsx-runtime");
|
|
8551
|
+
var FilterButton2 = ({
|
|
8552
|
+
text = "Filters",
|
|
8553
|
+
icon = "filter-add",
|
|
8554
|
+
filterCount,
|
|
8555
|
+
hasSelectedValue,
|
|
8556
|
+
dataTestId,
|
|
8557
|
+
...props
|
|
8375
8558
|
}) => {
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
8379
|
-
import_design_system43.Input,
|
|
8559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
8560
|
+
"button",
|
|
8380
8561
|
{
|
|
8381
|
-
type: "
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
"data-testid":
|
|
8562
|
+
type: "button",
|
|
8563
|
+
css: [
|
|
8564
|
+
FilterButton,
|
|
8565
|
+
hasSelectedValue ? FilterButtonSelected : void 0,
|
|
8566
|
+
filterCount ? [FilterButtonWithOptions, FilterButtonSelected] : void 0
|
|
8567
|
+
],
|
|
8568
|
+
...props,
|
|
8569
|
+
"data-testid": dataTestId,
|
|
8570
|
+
children: [
|
|
8571
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_design_system53.Icon, { icon, iconColor: "currentColor", size: "1rem" }),
|
|
8572
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { css: FilterButtonText, children: text }),
|
|
8573
|
+
filterCount ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_design_system53.Counter, { count: filterCount, bgColor: "var(--white)" }) : null
|
|
8574
|
+
]
|
|
8389
8575
|
}
|
|
8390
8576
|
);
|
|
8391
8577
|
};
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
} else {
|
|
8408
|
-
onChange([]);
|
|
8409
|
-
}
|
|
8410
|
-
},
|
|
8411
|
-
500,
|
|
8412
|
-
[minDateValue, maxDateValue]
|
|
8413
|
-
);
|
|
8414
|
-
(0, import_react77.useEffect)(() => {
|
|
8415
|
-
if (!minDateValue || !maxDateValue) {
|
|
8416
|
-
return;
|
|
8417
|
-
}
|
|
8418
|
-
const minDate = new Date(minDateValue);
|
|
8419
|
-
const maxDate = new Date(maxDateValue);
|
|
8420
|
-
if (maxDate < minDate) {
|
|
8421
|
-
setError("The max date cannot be lower than the min date");
|
|
8422
|
-
return;
|
|
8423
|
-
}
|
|
8424
|
-
if (maxDate && !minDate) {
|
|
8425
|
-
setError("Please enter both a low and high date");
|
|
8426
|
-
return;
|
|
8427
|
-
}
|
|
8428
|
-
const minDateString = minDate.toDateString();
|
|
8429
|
-
const maxDateString = maxDate.toDateString();
|
|
8430
|
-
if (minDateString === maxDateString || maxDateString === minDateString) {
|
|
8431
|
-
setError("The min and max date cannot be the same");
|
|
8432
|
-
return;
|
|
8433
|
-
}
|
|
8434
|
-
if (minDate > maxDate) {
|
|
8435
|
-
setError("The min date cannot be higher than the max date");
|
|
8436
|
-
return;
|
|
8437
|
-
}
|
|
8438
|
-
if (error) {
|
|
8439
|
-
setError("");
|
|
8440
|
-
}
|
|
8441
|
-
if (minDate && maxDate) {
|
|
8442
|
-
setMinDateValue(minDateValue);
|
|
8443
|
-
setMaxDateValue(maxDateValue);
|
|
8444
|
-
} else {
|
|
8445
|
-
setMinDateValue("");
|
|
8446
|
-
setMaxDateValue("");
|
|
8447
|
-
}
|
|
8448
|
-
}, [minDateValue, maxDateValue, setError]);
|
|
8449
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
|
|
8450
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
8451
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
8452
|
-
import_design_system43.Input,
|
|
8453
|
-
{
|
|
8454
|
-
label: `${ariaLabel}-min-date`,
|
|
8455
|
-
type: "date",
|
|
8456
|
-
showLabel: false,
|
|
8457
|
-
value: minDateValue,
|
|
8458
|
-
onChange: (e) => setMinDateValue(e.currentTarget.value),
|
|
8459
|
-
"aria-invalid": !error ? false : true,
|
|
8460
|
-
disabled,
|
|
8461
|
-
readOnly,
|
|
8462
|
-
"data-testid": "value-low"
|
|
8463
|
-
}
|
|
8464
|
-
),
|
|
8465
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
8466
|
-
import_design_system43.Input,
|
|
8467
|
-
{
|
|
8468
|
-
label: `${ariaLabel}-max-date`,
|
|
8469
|
-
type: "date",
|
|
8470
|
-
showLabel: false,
|
|
8471
|
-
value: maxDateValue,
|
|
8472
|
-
onChange: (e) => setMaxDateValue(e.currentTarget.value),
|
|
8473
|
-
"aria-invalid": !error ? false : true,
|
|
8474
|
-
disabled,
|
|
8475
|
-
readOnly,
|
|
8476
|
-
"data-testid": "value-high"
|
|
8477
|
-
}
|
|
8478
|
-
)
|
|
8479
|
-
] }),
|
|
8480
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ErrorContainer, { errorMessage: error })
|
|
8481
|
-
] });
|
|
8482
|
-
};
|
|
8578
|
+
|
|
8579
|
+
// src/components/SearchAndFilter/FilterControls.tsx
|
|
8580
|
+
var import_CgClose5 = require("@react-icons/all-files/cg/CgClose");
|
|
8581
|
+
var import_design_system55 = require("@uniformdev/design-system");
|
|
8582
|
+
var import_lexical11 = require("lexical");
|
|
8583
|
+
var import_react87 = require("react");
|
|
8584
|
+
var import_react_use10 = require("react-use");
|
|
8585
|
+
var import_uuid3 = require("uuid");
|
|
8586
|
+
|
|
8587
|
+
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
8588
|
+
var import_design_system54 = require("@uniformdev/design-system");
|
|
8589
|
+
var import_react86 = require("react");
|
|
8590
|
+
|
|
8591
|
+
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
8592
|
+
var import_jsx_runtime81 = require("@emotion/react/jsx-runtime");
|
|
8483
8593
|
var FilterEditorRenderer = ({ editorType, ...props }) => {
|
|
8484
8594
|
const { filterMapper: contextFilterMapper } = useSearchAndFilter();
|
|
8485
8595
|
const Editor = contextFilterMapper == null ? void 0 : contextFilterMapper[editorType];
|
|
@@ -8489,7 +8599,7 @@ var FilterEditorRenderer = ({ editorType, ...props }) => {
|
|
|
8489
8599
|
if (editorType === "empty") {
|
|
8490
8600
|
return null;
|
|
8491
8601
|
}
|
|
8492
|
-
return /* @__PURE__ */ (0,
|
|
8602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Editor, { ...props });
|
|
8493
8603
|
};
|
|
8494
8604
|
var filterMapper = {
|
|
8495
8605
|
multiChoice: FilterMultiChoiceEditor,
|
|
@@ -8506,9 +8616,9 @@ var filterMapper = {
|
|
|
8506
8616
|
function withInputVariables(WrappedComponent) {
|
|
8507
8617
|
const WithInputVariables = (props) => {
|
|
8508
8618
|
if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
|
|
8509
|
-
return /* @__PURE__ */ (0,
|
|
8619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WrappedComponent, { ...props });
|
|
8510
8620
|
}
|
|
8511
|
-
return /* @__PURE__ */ (0,
|
|
8621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8512
8622
|
InputVariables,
|
|
8513
8623
|
{
|
|
8514
8624
|
disableInlineMenu: true,
|
|
@@ -8516,7 +8626,7 @@ function withInputVariables(WrappedComponent) {
|
|
|
8516
8626
|
onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
|
|
8517
8627
|
value: props.value,
|
|
8518
8628
|
disabled: props.disabled,
|
|
8519
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
8629
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WrappedComponent, { ...props })
|
|
8520
8630
|
}
|
|
8521
8631
|
);
|
|
8522
8632
|
};
|
|
@@ -8526,16 +8636,16 @@ function withInputVariablesForMultiValue(WrappedComponent) {
|
|
|
8526
8636
|
const WithInputVariables = (props) => {
|
|
8527
8637
|
var _a;
|
|
8528
8638
|
if (!props.bindable || props.disabled || props.readOnly) {
|
|
8529
|
-
return /* @__PURE__ */ (0,
|
|
8639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WrappedComponent, { ...props });
|
|
8530
8640
|
}
|
|
8531
|
-
return /* @__PURE__ */ (0,
|
|
8641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8532
8642
|
InputVariables,
|
|
8533
8643
|
{
|
|
8534
8644
|
disableInlineMenu: true,
|
|
8535
8645
|
showMenuPosition: "inline-right",
|
|
8536
8646
|
onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
|
|
8537
8647
|
value: (_a = props.value) == null ? void 0 : _a[0],
|
|
8538
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
8648
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WrappedComponent, { ...props })
|
|
8539
8649
|
}
|
|
8540
8650
|
);
|
|
8541
8651
|
};
|
|
@@ -8549,27 +8659,10 @@ var bindableFiltersMapper = {
|
|
|
8549
8659
|
text: withInputVariables(TextEditor),
|
|
8550
8660
|
number: withInputVariables(NumberEditor)
|
|
8551
8661
|
};
|
|
8552
|
-
var ErrorContainer = ({ errorMessage }) => {
|
|
8553
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
8554
|
-
"div",
|
|
8555
|
-
{
|
|
8556
|
-
css: {
|
|
8557
|
-
gridColumn: "span 6",
|
|
8558
|
-
order: 6
|
|
8559
|
-
},
|
|
8560
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_design_system43.FieldMessage, { errorMessage })
|
|
8561
|
-
}
|
|
8562
|
-
);
|
|
8563
|
-
};
|
|
8564
|
-
var twoColumnGrid = {
|
|
8565
|
-
display: "grid",
|
|
8566
|
-
gridTemplateColumns: "1fr 1fr",
|
|
8567
|
-
gap: "var(--spacing-sm);"
|
|
8568
|
-
};
|
|
8569
8662
|
|
|
8570
8663
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
8571
|
-
var
|
|
8572
|
-
var SearchAndFilterContext = (0,
|
|
8664
|
+
var import_jsx_runtime82 = require("@emotion/react/jsx-runtime");
|
|
8665
|
+
var SearchAndFilterContext = (0, import_react86.createContext)({
|
|
8573
8666
|
searchTerm: "",
|
|
8574
8667
|
setSearchTerm: () => {
|
|
8575
8668
|
},
|
|
@@ -8604,41 +8697,41 @@ var SearchAndFilterProvider = ({
|
|
|
8604
8697
|
children,
|
|
8605
8698
|
allowBindingSearchTerm
|
|
8606
8699
|
}) => {
|
|
8607
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
8608
|
-
const deferredSearchTerm = (0,
|
|
8609
|
-
const [filterVisibility, setFilterVisibility] = (0,
|
|
8610
|
-
const handleSearchTerm = (0,
|
|
8700
|
+
const [searchTerm, setSearchTerm] = (0, import_react86.useState)(defaultSearchTerm);
|
|
8701
|
+
const deferredSearchTerm = (0, import_react86.useDeferredValue)(searchTerm);
|
|
8702
|
+
const [filterVisibility, setFilterVisibility] = (0, import_react86.useState)(filterVisible);
|
|
8703
|
+
const handleSearchTerm = (0, import_react86.useCallback)(
|
|
8611
8704
|
(term) => {
|
|
8612
8705
|
setSearchTerm(term);
|
|
8613
8706
|
onSearchChange == null ? void 0 : onSearchChange(term);
|
|
8614
8707
|
},
|
|
8615
8708
|
[setSearchTerm, onSearchChange]
|
|
8616
8709
|
);
|
|
8617
|
-
const handleToggleFilterVisibility = (0,
|
|
8710
|
+
const handleToggleFilterVisibility = (0, import_react86.useCallback)(
|
|
8618
8711
|
(visible) => setFilterVisibility(visible),
|
|
8619
8712
|
[setFilterVisibility]
|
|
8620
8713
|
);
|
|
8621
|
-
const handleAddFilter = (0,
|
|
8714
|
+
const handleAddFilter = (0, import_react86.useCallback)(() => {
|
|
8622
8715
|
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
8623
8716
|
}, [filters, onChange]);
|
|
8624
|
-
const handleResetFilters = (0,
|
|
8717
|
+
const handleResetFilters = (0, import_react86.useCallback)(() => {
|
|
8625
8718
|
onSearchChange == null ? void 0 : onSearchChange("");
|
|
8626
8719
|
onChange(resetFilterValues);
|
|
8627
8720
|
}, [onChange, resetFilterValues, onSearchChange]);
|
|
8628
|
-
const handleDeleteFilter = (0,
|
|
8721
|
+
const handleDeleteFilter = (0, import_react86.useCallback)(
|
|
8629
8722
|
(index) => {
|
|
8630
8723
|
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
8631
8724
|
onChange(remainingFilters);
|
|
8632
8725
|
},
|
|
8633
8726
|
[filters, onChange]
|
|
8634
8727
|
);
|
|
8635
|
-
const validFilterQuery = (0,
|
|
8728
|
+
const validFilterQuery = (0, import_react86.useMemo)(() => {
|
|
8636
8729
|
const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
|
|
8637
8730
|
if (hasValidFilters) {
|
|
8638
8731
|
return filters;
|
|
8639
8732
|
}
|
|
8640
8733
|
}, [filters]);
|
|
8641
|
-
(0,
|
|
8734
|
+
(0, import_react86.useEffect)(() => {
|
|
8642
8735
|
if (filterVisibility) {
|
|
8643
8736
|
const handleEscKeyFilterClose = (e) => {
|
|
8644
8737
|
if (e.key === "Escape") {
|
|
@@ -8651,7 +8744,7 @@ var SearchAndFilterProvider = ({
|
|
|
8651
8744
|
};
|
|
8652
8745
|
}
|
|
8653
8746
|
}, [filterVisibility]);
|
|
8654
|
-
return /* @__PURE__ */ (0,
|
|
8747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
8655
8748
|
SearchAndFilterContext.Provider,
|
|
8656
8749
|
{
|
|
8657
8750
|
value: {
|
|
@@ -8670,17 +8763,17 @@ var SearchAndFilterProvider = ({
|
|
|
8670
8763
|
filterMapper: filterMapper2,
|
|
8671
8764
|
allowBindingSearchTerm
|
|
8672
8765
|
},
|
|
8673
|
-
children: /* @__PURE__ */ (0,
|
|
8766
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system54.VerticalRhythm, { children })
|
|
8674
8767
|
}
|
|
8675
8768
|
);
|
|
8676
8769
|
};
|
|
8677
8770
|
var useSearchAndFilter = () => {
|
|
8678
|
-
const value = (0,
|
|
8771
|
+
const value = (0, import_react86.useContext)(SearchAndFilterContext);
|
|
8679
8772
|
return { ...value };
|
|
8680
8773
|
};
|
|
8681
8774
|
|
|
8682
8775
|
// src/components/SearchAndFilter/FilterControls.tsx
|
|
8683
|
-
var
|
|
8776
|
+
var import_jsx_runtime83 = require("@emotion/react/jsx-runtime");
|
|
8684
8777
|
var FilterControls = ({
|
|
8685
8778
|
children,
|
|
8686
8779
|
hideSearchInput
|
|
@@ -8693,25 +8786,25 @@ var FilterControls = ({
|
|
|
8693
8786
|
searchTerm,
|
|
8694
8787
|
allowBindingSearchTerm
|
|
8695
8788
|
} = useSearchAndFilter();
|
|
8696
|
-
const editorRef = (0,
|
|
8789
|
+
const editorRef = (0, import_react87.useRef)(null);
|
|
8697
8790
|
const hasVariableInSearchTerm = hasReferencedVariables(searchTerm);
|
|
8698
|
-
const [idToResetInputVariables, setIdToResetInputVariables] = (0,
|
|
8699
|
-
const [localeSearchTerm, setLocaleSearchTerm] = (0,
|
|
8700
|
-
(0,
|
|
8791
|
+
const [idToResetInputVariables, setIdToResetInputVariables] = (0, import_react87.useState)("data-resource-search-term-input");
|
|
8792
|
+
const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react87.useState)(searchTerm);
|
|
8793
|
+
(0, import_react_use10.useDebounce)(
|
|
8701
8794
|
() => {
|
|
8702
8795
|
setSearchTerm(localeSearchTerm);
|
|
8703
8796
|
},
|
|
8704
8797
|
300,
|
|
8705
8798
|
[localeSearchTerm]
|
|
8706
8799
|
);
|
|
8707
|
-
(0,
|
|
8800
|
+
(0, import_react87.useEffect)(() => {
|
|
8708
8801
|
if (searchTerm === "") {
|
|
8709
8802
|
setLocaleSearchTerm("");
|
|
8710
8803
|
setIdToResetInputVariables(`data-resource-search-term-input-${(0, import_uuid3.v4)()}`);
|
|
8711
8804
|
}
|
|
8712
8805
|
}, [searchTerm]);
|
|
8713
|
-
return /* @__PURE__ */ (0,
|
|
8714
|
-
/* @__PURE__ */ (0,
|
|
8806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
8807
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8715
8808
|
FilterButton2,
|
|
8716
8809
|
{
|
|
8717
8810
|
"aria-controls": "search-and-filter-options",
|
|
@@ -8724,8 +8817,8 @@ var FilterControls = ({
|
|
|
8724
8817
|
dataTestId: "filters-button"
|
|
8725
8818
|
}
|
|
8726
8819
|
),
|
|
8727
|
-
hideSearchInput ? null : /* @__PURE__ */ (0,
|
|
8728
|
-
/* @__PURE__ */ (0,
|
|
8820
|
+
hideSearchInput ? null : /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { css: BindableKeywordSearchInputStyles, children: [
|
|
8821
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8729
8822
|
InputVariables,
|
|
8730
8823
|
{
|
|
8731
8824
|
label: "",
|
|
@@ -8735,8 +8828,8 @@ var FilterControls = ({
|
|
|
8735
8828
|
value: localeSearchTerm,
|
|
8736
8829
|
onChange: (value) => setLocaleSearchTerm(value != null ? value : ""),
|
|
8737
8830
|
disableVariables: !allowBindingSearchTerm,
|
|
8738
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
8739
|
-
|
|
8831
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8832
|
+
import_design_system55.InputKeywordSearch,
|
|
8740
8833
|
{
|
|
8741
8834
|
placeholder: "Search...",
|
|
8742
8835
|
onSearchTextChanged: (e) => setLocaleSearchTerm(e),
|
|
@@ -8748,7 +8841,7 @@ var FilterControls = ({
|
|
|
8748
8841
|
)
|
|
8749
8842
|
}
|
|
8750
8843
|
),
|
|
8751
|
-
hasVariableInSearchTerm ? /* @__PURE__ */ (0,
|
|
8844
|
+
hasVariableInSearchTerm ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8752
8845
|
"button",
|
|
8753
8846
|
{
|
|
8754
8847
|
css: ClearSearchButtonStyles,
|
|
@@ -8762,7 +8855,7 @@ var FilterControls = ({
|
|
|
8762
8855
|
},
|
|
8763
8856
|
type: "button",
|
|
8764
8857
|
"data-testid": "keyword-search-clear-button",
|
|
8765
|
-
children: /* @__PURE__ */ (0,
|
|
8858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_design_system55.Icon, { icon: import_CgClose5.CgClose, iconColor: "red", size: "1rem" })
|
|
8766
8859
|
}
|
|
8767
8860
|
) }) : null
|
|
8768
8861
|
] }),
|
|
@@ -8771,22 +8864,22 @@ var FilterControls = ({
|
|
|
8771
8864
|
};
|
|
8772
8865
|
|
|
8773
8866
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
8774
|
-
var
|
|
8775
|
-
var
|
|
8867
|
+
var import_design_system57 = require("@uniformdev/design-system");
|
|
8868
|
+
var import_react89 = require("react");
|
|
8776
8869
|
|
|
8777
8870
|
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
8778
|
-
var
|
|
8779
|
-
var
|
|
8780
|
-
var
|
|
8871
|
+
var import_design_system56 = require("@uniformdev/design-system");
|
|
8872
|
+
var import_react88 = __toESM(require("react"));
|
|
8873
|
+
var import_jsx_runtime84 = require("@emotion/react/jsx-runtime");
|
|
8781
8874
|
var SearchAndFilterOptionsContainer2 = ({
|
|
8782
8875
|
buttonRow,
|
|
8783
8876
|
additionalFiltersContainer,
|
|
8784
8877
|
children
|
|
8785
8878
|
}) => {
|
|
8786
|
-
return /* @__PURE__ */ (0,
|
|
8787
|
-
/* @__PURE__ */ (0,
|
|
8788
|
-
buttonRow ? /* @__PURE__ */ (0,
|
|
8789
|
-
|
|
8879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { css: SearchAndFilterOptionsContainer, children: [
|
|
8880
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { css: SearchAndFilterOptionsInnerContainer, children }),
|
|
8881
|
+
buttonRow ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
8882
|
+
import_design_system56.HorizontalRhythm,
|
|
8790
8883
|
{
|
|
8791
8884
|
css: SearchAndFilterButtonGroup,
|
|
8792
8885
|
gap: "sm",
|
|
@@ -8795,7 +8888,7 @@ var SearchAndFilterOptionsContainer2 = ({
|
|
|
8795
8888
|
children: buttonRow
|
|
8796
8889
|
}
|
|
8797
8890
|
) : null,
|
|
8798
|
-
additionalFiltersContainer ? /* @__PURE__ */ (0,
|
|
8891
|
+
additionalFiltersContainer ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { children: additionalFiltersContainer }) : null
|
|
8799
8892
|
] });
|
|
8800
8893
|
};
|
|
8801
8894
|
var FilterMenu = ({
|
|
@@ -8808,22 +8901,22 @@ var FilterMenu = ({
|
|
|
8808
8901
|
resetButtonText = "reset"
|
|
8809
8902
|
}) => {
|
|
8810
8903
|
const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
|
|
8811
|
-
const innerMenuRef =
|
|
8812
|
-
(0,
|
|
8904
|
+
const innerMenuRef = import_react88.default.useRef(null);
|
|
8905
|
+
(0, import_react88.useEffect)(() => {
|
|
8813
8906
|
var _a;
|
|
8814
8907
|
if (filterVisibility) {
|
|
8815
8908
|
(_a = innerMenuRef.current) == null ? void 0 : _a.focus();
|
|
8816
8909
|
}
|
|
8817
8910
|
}, [filterVisibility]);
|
|
8818
|
-
return /* @__PURE__ */ (0,
|
|
8911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_design_system56.VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
8819
8912
|
SearchAndFilterOptionsContainer2,
|
|
8820
8913
|
{
|
|
8821
8914
|
buttonRow: menuControls,
|
|
8822
8915
|
additionalFiltersContainer,
|
|
8823
8916
|
children: [
|
|
8824
|
-
/* @__PURE__ */ (0,
|
|
8825
|
-
/* @__PURE__ */ (0,
|
|
8826
|
-
(filters == null ? void 0 : filters.length) ? /* @__PURE__ */ (0,
|
|
8917
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_design_system56.HorizontalRhythm, { gap: "sm", align: "center", justify: "space-between", children: [
|
|
8918
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }),
|
|
8919
|
+
(filters == null ? void 0 : filters.length) ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
8827
8920
|
"button",
|
|
8828
8921
|
{
|
|
8829
8922
|
type: "button",
|
|
@@ -8844,7 +8937,7 @@ var FilterMenu = ({
|
|
|
8844
8937
|
};
|
|
8845
8938
|
|
|
8846
8939
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
8847
|
-
var
|
|
8940
|
+
var import_jsx_runtime85 = require("@emotion/react/jsx-runtime");
|
|
8848
8941
|
var FilterItem = ({
|
|
8849
8942
|
index,
|
|
8850
8943
|
paramOptions,
|
|
@@ -8860,7 +8953,7 @@ var FilterItem = ({
|
|
|
8860
8953
|
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
8861
8954
|
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
8862
8955
|
const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
|
|
8863
|
-
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0,
|
|
8956
|
+
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0, import_react89.useMemo)(() => {
|
|
8864
8957
|
var _a2;
|
|
8865
8958
|
const currentSelectedFilter = filterOptions.find((item) => {
|
|
8866
8959
|
var _a3;
|
|
@@ -8887,11 +8980,11 @@ var FilterItem = ({
|
|
|
8887
8980
|
menuIsOpen: false,
|
|
8888
8981
|
isClearable: false
|
|
8889
8982
|
} : {};
|
|
8890
|
-
return /* @__PURE__ */ (0,
|
|
8891
|
-
/* @__PURE__ */ (0,
|
|
8892
|
-
/* @__PURE__ */ (0,
|
|
8893
|
-
/* @__PURE__ */ (0,
|
|
8894
|
-
|
|
8983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
|
|
8984
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: index === 0 ? "Where" : "and" }),
|
|
8985
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { css: ConditionalInputRow, children: [
|
|
8986
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8987
|
+
import_design_system57.InputComboBox,
|
|
8895
8988
|
{
|
|
8896
8989
|
"aria-label": label,
|
|
8897
8990
|
options: paramOptions,
|
|
@@ -8917,8 +9010,8 @@ var FilterItem = ({
|
|
|
8917
9010
|
name: `filter-field-${index}`
|
|
8918
9011
|
}
|
|
8919
9012
|
),
|
|
8920
|
-
/* @__PURE__ */ (0,
|
|
8921
|
-
|
|
9013
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
9014
|
+
import_design_system57.InputComboBox,
|
|
8922
9015
|
{
|
|
8923
9016
|
"aria-label": operatorLabel,
|
|
8924
9017
|
options: operatorOptions,
|
|
@@ -8941,7 +9034,7 @@ var FilterItem = ({
|
|
|
8941
9034
|
name: `filter-operator-${index}`
|
|
8942
9035
|
}
|
|
8943
9036
|
),
|
|
8944
|
-
/* @__PURE__ */ (0,
|
|
9037
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8945
9038
|
FilterEditorRenderer,
|
|
8946
9039
|
{
|
|
8947
9040
|
"aria-label": metaDataLabel,
|
|
@@ -8955,7 +9048,7 @@ var FilterItem = ({
|
|
|
8955
9048
|
valueTestId: "filter-value"
|
|
8956
9049
|
}
|
|
8957
9050
|
),
|
|
8958
|
-
readOnly || index === 0 ? null : /* @__PURE__ */ (0,
|
|
9051
|
+
readOnly || index === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8959
9052
|
"button",
|
|
8960
9053
|
{
|
|
8961
9054
|
type: "button",
|
|
@@ -8963,7 +9056,7 @@ var FilterItem = ({
|
|
|
8963
9056
|
"aria-label": "delete filter",
|
|
8964
9057
|
css: IconBtn,
|
|
8965
9058
|
"data-testid": "delete-filter",
|
|
8966
|
-
children: /* @__PURE__ */ (0,
|
|
9059
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_design_system57.Icon, { icon: "trash", iconColor: "red", size: "1rem" })
|
|
8967
9060
|
}
|
|
8968
9061
|
)
|
|
8969
9062
|
] })
|
|
@@ -8979,13 +9072,13 @@ var FilterItems = ({
|
|
|
8979
9072
|
const next = [...filters];
|
|
8980
9073
|
next[index] = { ...next[index], [prop]: value };
|
|
8981
9074
|
if (prop === "operator") {
|
|
8982
|
-
if (["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
|
|
9075
|
+
if (!Array.isArray(value) && ["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
|
|
8983
9076
|
next[index].value = next[index].value[0];
|
|
8984
9077
|
}
|
|
8985
9078
|
if (filters[index].operator === "ndef" || filters[index].operator === "def") {
|
|
8986
9079
|
next[index].value = "";
|
|
8987
9080
|
}
|
|
8988
|
-
if (["between"].includes(value) && Array.isArray(next[index].value) === false) {
|
|
9081
|
+
if (!Array.isArray(value) && ["between"].includes(value) && Array.isArray(next[index].value) === false) {
|
|
8989
9082
|
next[index].value = [next[index].value, ""];
|
|
8990
9083
|
}
|
|
8991
9084
|
if (value === "def" || value === "true") {
|
|
@@ -9005,12 +9098,12 @@ var FilterItems = ({
|
|
|
9005
9098
|
}
|
|
9006
9099
|
setFilters(next);
|
|
9007
9100
|
};
|
|
9008
|
-
return /* @__PURE__ */ (0,
|
|
9101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
9009
9102
|
FilterMenu,
|
|
9010
9103
|
{
|
|
9011
9104
|
id: "search-and-filter-options",
|
|
9012
9105
|
dataTestId: "search-and-filter-options",
|
|
9013
|
-
menuControls: /* @__PURE__ */ (0,
|
|
9106
|
+
menuControls: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
9014
9107
|
"button",
|
|
9015
9108
|
{
|
|
9016
9109
|
type: "button",
|
|
@@ -9018,7 +9111,7 @@ var FilterItems = ({
|
|
|
9018
9111
|
onClick: handleAddFilter,
|
|
9019
9112
|
"data-testid": "add-filter",
|
|
9020
9113
|
children: [
|
|
9021
|
-
/* @__PURE__ */ (0,
|
|
9114
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_design_system57.Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
|
|
9022
9115
|
addButtonText
|
|
9023
9116
|
]
|
|
9024
9117
|
}
|
|
@@ -9032,7 +9125,7 @@ var FilterItems = ({
|
|
|
9032
9125
|
})) == null ? void 0 : _a.options) != null ? _b : [];
|
|
9033
9126
|
const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
|
|
9034
9127
|
const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
|
|
9035
|
-
return /* @__PURE__ */ (0,
|
|
9128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
9036
9129
|
FilterItem,
|
|
9037
9130
|
{
|
|
9038
9131
|
index: i,
|
|
@@ -9051,11 +9144,11 @@ var FilterItems = ({
|
|
|
9051
9144
|
};
|
|
9052
9145
|
|
|
9053
9146
|
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
9054
|
-
var
|
|
9147
|
+
var import_design_system59 = require("@uniformdev/design-system");
|
|
9055
9148
|
|
|
9056
9149
|
// src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
|
|
9057
|
-
var
|
|
9058
|
-
var
|
|
9150
|
+
var import_design_system58 = require("@uniformdev/design-system");
|
|
9151
|
+
var import_jsx_runtime86 = require("@emotion/react/jsx-runtime");
|
|
9059
9152
|
var SearchAndFilterResultContainer = ({
|
|
9060
9153
|
buttonText,
|
|
9061
9154
|
clearButtonLabel = "clear",
|
|
@@ -9085,31 +9178,31 @@ var SearchAndFilterResultContainer = ({
|
|
|
9085
9178
|
handleResetFilters();
|
|
9086
9179
|
}
|
|
9087
9180
|
};
|
|
9088
|
-
return /* @__PURE__ */ (0,
|
|
9089
|
-
/* @__PURE__ */ (0,
|
|
9090
|
-
/* @__PURE__ */ (0,
|
|
9181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
|
|
9182
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_design_system58.HorizontalRhythm, { children: [
|
|
9183
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("span", { children: [
|
|
9091
9184
|
totalResults,
|
|
9092
9185
|
" results ",
|
|
9093
9186
|
searchTerm ? `for "${searchTerm}"` : null
|
|
9094
9187
|
] }),
|
|
9095
|
-
!searchTerm || hideClearButton ? null : /* @__PURE__ */ (0,
|
|
9188
|
+
!searchTerm || hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_design_system58.Button, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
|
|
9096
9189
|
] }),
|
|
9097
|
-
totalResults === 0 ? /* @__PURE__ */ (0,
|
|
9098
|
-
calloutText ? /* @__PURE__ */ (0,
|
|
9099
|
-
hideClearButton ? null : /* @__PURE__ */ (0,
|
|
9190
|
+
totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_design_system58.Callout, { title: calloutTitle != null ? calloutTitle : automateCalloutTitle(), type: "note", children: [
|
|
9191
|
+
calloutText ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_design_system58.Paragraph, { children: calloutText }) : null,
|
|
9192
|
+
hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_design_system58.Button, { buttonType: "tertiaryOutline", size: "xs", onClick: handleClearSearch, children: buttonText != null ? buttonText : "Clear search" })
|
|
9100
9193
|
] }) : null
|
|
9101
9194
|
] });
|
|
9102
9195
|
};
|
|
9103
9196
|
|
|
9104
9197
|
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
9105
|
-
var
|
|
9198
|
+
var import_jsx_runtime87 = require("@emotion/react/jsx-runtime");
|
|
9106
9199
|
var SearchAndFilter = ({
|
|
9107
9200
|
filters,
|
|
9108
9201
|
filterOptions,
|
|
9109
9202
|
filterVisible,
|
|
9110
9203
|
filterControls,
|
|
9111
9204
|
viewSwitchControls,
|
|
9112
|
-
resultsContainerView = /* @__PURE__ */ (0,
|
|
9205
|
+
resultsContainerView = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(SearchAndFilterResultContainer, {}),
|
|
9113
9206
|
filterMapper: filterMapper2 = filterMapper,
|
|
9114
9207
|
additionalFiltersContainer,
|
|
9115
9208
|
onChange,
|
|
@@ -9119,7 +9212,7 @@ var SearchAndFilter = ({
|
|
|
9119
9212
|
allowBindingSearchTerm = false,
|
|
9120
9213
|
resetFilterValues = []
|
|
9121
9214
|
}) => {
|
|
9122
|
-
return /* @__PURE__ */ (0,
|
|
9215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
9123
9216
|
SearchAndFilterProvider,
|
|
9124
9217
|
{
|
|
9125
9218
|
filters,
|
|
@@ -9132,18 +9225,18 @@ var SearchAndFilter = ({
|
|
|
9132
9225
|
resetFilterValues,
|
|
9133
9226
|
filterMapper: filterMapper2,
|
|
9134
9227
|
allowBindingSearchTerm,
|
|
9135
|
-
children: /* @__PURE__ */ (0,
|
|
9136
|
-
/* @__PURE__ */ (0,
|
|
9137
|
-
/* @__PURE__ */ (0,
|
|
9228
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_design_system59.VerticalRhythm, { "data-testid": "search-and-filter", children: [
|
|
9229
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
|
|
9230
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
9138
9231
|
"div",
|
|
9139
9232
|
{
|
|
9140
9233
|
css: SearchAndFilterControlsWrapper(viewSwitchControls ? "auto 1fr 0.05fr" : "auto 1fr"),
|
|
9141
|
-
children: !filterControls ? /* @__PURE__ */ (0,
|
|
9234
|
+
children: !filterControls ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
|
|
9142
9235
|
}
|
|
9143
9236
|
),
|
|
9144
9237
|
viewSwitchControls
|
|
9145
9238
|
] }),
|
|
9146
|
-
/* @__PURE__ */ (0,
|
|
9239
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(FilterItems, { additionalFiltersContainer }),
|
|
9147
9240
|
resultsContainerView
|
|
9148
9241
|
] })
|
|
9149
9242
|
}
|
|
@@ -9151,19 +9244,19 @@ var SearchAndFilter = ({
|
|
|
9151
9244
|
};
|
|
9152
9245
|
|
|
9153
9246
|
// src/components/SearchAndFilter/SearchOnlyFilter.tsx
|
|
9154
|
-
var
|
|
9155
|
-
var
|
|
9156
|
-
var
|
|
9157
|
-
var
|
|
9158
|
-
var SearchOnlyContext = (0,
|
|
9247
|
+
var import_design_system60 = require("@uniformdev/design-system");
|
|
9248
|
+
var import_react90 = require("react");
|
|
9249
|
+
var import_react_use11 = require("react-use");
|
|
9250
|
+
var import_jsx_runtime88 = require("@emotion/react/jsx-runtime");
|
|
9251
|
+
var SearchOnlyContext = (0, import_react90.createContext)({
|
|
9159
9252
|
searchTerm: "",
|
|
9160
9253
|
setSearchTerm: () => {
|
|
9161
9254
|
}
|
|
9162
9255
|
});
|
|
9163
9256
|
var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
9164
9257
|
const { searchTerm, setSearchTerm } = useSearchAndFilter();
|
|
9165
|
-
const [localeSearchTerm, setLocaleSearchTerm] = (0,
|
|
9166
|
-
(0,
|
|
9258
|
+
const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react90.useState)("");
|
|
9259
|
+
(0, import_react_use11.useDebounce)(
|
|
9167
9260
|
() => {
|
|
9168
9261
|
setSearchTerm(localeSearchTerm);
|
|
9169
9262
|
onSearchChange == null ? void 0 : onSearchChange(localeSearchTerm);
|
|
@@ -9171,15 +9264,15 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
9171
9264
|
300,
|
|
9172
9265
|
[localeSearchTerm]
|
|
9173
9266
|
);
|
|
9174
|
-
return /* @__PURE__ */ (0,
|
|
9267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9175
9268
|
SearchOnlyContext.Provider,
|
|
9176
9269
|
{
|
|
9177
9270
|
value: {
|
|
9178
9271
|
searchTerm,
|
|
9179
9272
|
setSearchTerm: setLocaleSearchTerm
|
|
9180
9273
|
},
|
|
9181
|
-
children: /* @__PURE__ */ (0,
|
|
9182
|
-
|
|
9274
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9275
|
+
import_design_system60.InputKeywordSearch,
|
|
9183
9276
|
{
|
|
9184
9277
|
placeholder: "Search...",
|
|
9185
9278
|
onSearchTextChanged: (e) => setLocaleSearchTerm(e),
|
|
@@ -9193,18 +9286,18 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
9193
9286
|
};
|
|
9194
9287
|
|
|
9195
9288
|
// src/components/SearchAndFilter/SortItems.tsx
|
|
9196
|
-
var
|
|
9289
|
+
var import_design_system62 = require("@uniformdev/design-system");
|
|
9197
9290
|
|
|
9198
9291
|
// src/components/SearchAndFilter/styles/SortItems.styles.ts
|
|
9199
|
-
var
|
|
9200
|
-
var
|
|
9201
|
-
var ConditionalFilterRow2 =
|
|
9292
|
+
var import_react91 = require("@emotion/react");
|
|
9293
|
+
var import_design_system61 = require("@uniformdev/design-system");
|
|
9294
|
+
var ConditionalFilterRow2 = import_react91.css`
|
|
9202
9295
|
display: grid;
|
|
9203
9296
|
grid-template-columns: 35px 1fr;
|
|
9204
9297
|
gap: var(--spacing-sm);
|
|
9205
9298
|
margin-left: var(--spacing-base);
|
|
9206
9299
|
|
|
9207
|
-
${(0,
|
|
9300
|
+
${(0, import_design_system61.cq)("380px")} {
|
|
9208
9301
|
align-items: center;
|
|
9209
9302
|
|
|
9210
9303
|
&:after {
|
|
@@ -9225,22 +9318,22 @@ var ConditionalFilterRow2 = import_react83.css`
|
|
|
9225
9318
|
grid-template-columns: 50px 1fr;
|
|
9226
9319
|
}
|
|
9227
9320
|
|
|
9228
|
-
${(0,
|
|
9321
|
+
${(0, import_design_system61.cq)("580px")} {
|
|
9229
9322
|
&:after {
|
|
9230
9323
|
display: none;
|
|
9231
9324
|
}
|
|
9232
9325
|
}
|
|
9233
9326
|
|
|
9234
9327
|
@media (prefers-reduced-motion: no-preference) {
|
|
9235
|
-
animation: ${
|
|
9328
|
+
animation: ${import_design_system61.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
9236
9329
|
}
|
|
9237
9330
|
`;
|
|
9238
|
-
var ConditionalInputRow2 =
|
|
9331
|
+
var ConditionalInputRow2 = import_react91.css`
|
|
9239
9332
|
display: flex;
|
|
9240
9333
|
gap: var(--spacing-sm);
|
|
9241
9334
|
flex-wrap: wrap;
|
|
9242
9335
|
|
|
9243
|
-
${(0,
|
|
9336
|
+
${(0, import_design_system61.cq)("380px")} {
|
|
9244
9337
|
& > div:nth-child(-n + 2) {
|
|
9245
9338
|
width: calc(50% - var(--spacing-sm));
|
|
9246
9339
|
}
|
|
@@ -9249,7 +9342,7 @@ var ConditionalInputRow2 = import_react83.css`
|
|
|
9249
9342
|
width: calc(100% - 48px);
|
|
9250
9343
|
}
|
|
9251
9344
|
}
|
|
9252
|
-
${(0,
|
|
9345
|
+
${(0, import_design_system61.cq)("580px")} {
|
|
9253
9346
|
display: grid;
|
|
9254
9347
|
grid-template-columns: 200px 160px 1fr 32px;
|
|
9255
9348
|
|
|
@@ -9258,11 +9351,11 @@ var ConditionalInputRow2 = import_react83.css`
|
|
|
9258
9351
|
}
|
|
9259
9352
|
}
|
|
9260
9353
|
`;
|
|
9261
|
-
var SearchInput2 =
|
|
9354
|
+
var SearchInput2 = import_react91.css`
|
|
9262
9355
|
max-height: 40px;
|
|
9263
9356
|
min-height: unset;
|
|
9264
9357
|
`;
|
|
9265
|
-
var FilterButton3 =
|
|
9358
|
+
var FilterButton3 = import_react91.css`
|
|
9266
9359
|
align-items: center;
|
|
9267
9360
|
background: var(--white);
|
|
9268
9361
|
border: 1px solid var(--gray-300);
|
|
@@ -9298,13 +9391,13 @@ var FilterButton3 = import_react83.css`
|
|
|
9298
9391
|
opacity: var(--opacity-50);
|
|
9299
9392
|
}
|
|
9300
9393
|
`;
|
|
9301
|
-
var FilterButtonText2 =
|
|
9394
|
+
var FilterButtonText2 = import_react91.css`
|
|
9302
9395
|
overflow: hidden;
|
|
9303
9396
|
text-overflow: ellipsis;
|
|
9304
9397
|
white-space: nowrap;
|
|
9305
9398
|
max-width: 14ch;
|
|
9306
9399
|
`;
|
|
9307
|
-
var FilterButtonSelected2 =
|
|
9400
|
+
var FilterButtonSelected2 = import_react91.css`
|
|
9308
9401
|
background: var(--gray-100);
|
|
9309
9402
|
border-color: var(--gray-300);
|
|
9310
9403
|
|
|
@@ -9312,7 +9405,7 @@ var FilterButtonSelected2 = import_react83.css`
|
|
|
9312
9405
|
color: var(--accent-dark);
|
|
9313
9406
|
}
|
|
9314
9407
|
`;
|
|
9315
|
-
var FilterButtonWithOptions2 =
|
|
9408
|
+
var FilterButtonWithOptions2 = import_react91.css`
|
|
9316
9409
|
:where([aria-expanded='true']) {
|
|
9317
9410
|
background: var(--purple-rain-100);
|
|
9318
9411
|
border-color: var(--accent-light);
|
|
@@ -9324,14 +9417,14 @@ var FilterButtonWithOptions2 = import_react83.css`
|
|
|
9324
9417
|
}
|
|
9325
9418
|
}
|
|
9326
9419
|
`;
|
|
9327
|
-
var SearchIcon2 =
|
|
9420
|
+
var SearchIcon2 = import_react91.css`
|
|
9328
9421
|
color: var(--icon-color);
|
|
9329
9422
|
position: absolute;
|
|
9330
9423
|
inset: 0 var(--spacing-base) 0 auto;
|
|
9331
9424
|
margin: auto;
|
|
9332
9425
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
9333
9426
|
`;
|
|
9334
|
-
var AddConditionalBtn2 =
|
|
9427
|
+
var AddConditionalBtn2 = import_react91.css`
|
|
9335
9428
|
align-items: center;
|
|
9336
9429
|
background: transparent;
|
|
9337
9430
|
border: none;
|
|
@@ -9350,14 +9443,14 @@ var AddConditionalBtn2 = import_react83.css`
|
|
|
9350
9443
|
color: var(--gray-400);
|
|
9351
9444
|
}
|
|
9352
9445
|
`;
|
|
9353
|
-
var Title2 =
|
|
9446
|
+
var Title2 = import_react91.css`
|
|
9354
9447
|
color: var(--typography-light);
|
|
9355
9448
|
|
|
9356
9449
|
&:focus {
|
|
9357
9450
|
outline: none;
|
|
9358
9451
|
}
|
|
9359
9452
|
`;
|
|
9360
|
-
var ResetConditionsBtn2 =
|
|
9453
|
+
var ResetConditionsBtn2 = import_react91.css`
|
|
9361
9454
|
background: transparent;
|
|
9362
9455
|
border: none;
|
|
9363
9456
|
color: var(--action-destructive-default);
|
|
@@ -9369,12 +9462,12 @@ var ResetConditionsBtn2 = import_react83.css`
|
|
|
9369
9462
|
color: var(--action-destructive-hover);
|
|
9370
9463
|
}
|
|
9371
9464
|
`;
|
|
9372
|
-
var IconBtn2 =
|
|
9465
|
+
var IconBtn2 = import_react91.css`
|
|
9373
9466
|
background: transparent;
|
|
9374
9467
|
border: none;
|
|
9375
9468
|
padding: var(--spacing-sm);
|
|
9376
9469
|
`;
|
|
9377
|
-
var SearchAndFilterOptionsContainer3 =
|
|
9470
|
+
var SearchAndFilterOptionsContainer3 = import_react91.css`
|
|
9378
9471
|
background: var(--gray-50);
|
|
9379
9472
|
border: 1px solid var(--gray-300);
|
|
9380
9473
|
border-radius: var(--rounded-base);
|
|
@@ -9387,17 +9480,17 @@ var SearchAndFilterOptionsContainer3 = import_react83.css`
|
|
|
9387
9480
|
position: relative;
|
|
9388
9481
|
z-index: 1;
|
|
9389
9482
|
`;
|
|
9390
|
-
var SearchAndFilterOptionsInnerContainer2 =
|
|
9483
|
+
var SearchAndFilterOptionsInnerContainer2 = import_react91.css`
|
|
9391
9484
|
display: flex;
|
|
9392
9485
|
flex-direction: column;
|
|
9393
9486
|
gap: var(--spacing-sm);
|
|
9394
9487
|
padding-inline: var(--spacing-md);
|
|
9395
9488
|
`;
|
|
9396
|
-
var SearchAndFilterButtonGroup2 =
|
|
9489
|
+
var SearchAndFilterButtonGroup2 = import_react91.css`
|
|
9397
9490
|
margin-top: var(--spacing-xs);
|
|
9398
9491
|
margin-left: calc(56px + var(--spacing-md));
|
|
9399
9492
|
`;
|
|
9400
|
-
var SortFilterWrapper = (hiddenLocaleInput) =>
|
|
9493
|
+
var SortFilterWrapper = (hiddenLocaleInput) => import_react91.css`
|
|
9401
9494
|
align-items: center;
|
|
9402
9495
|
border-top: 1px solid var(--gray-300);
|
|
9403
9496
|
display: flex;
|
|
@@ -9407,18 +9500,18 @@ var SortFilterWrapper = (hiddenLocaleInput) => import_react83.css`
|
|
|
9407
9500
|
position: relative;
|
|
9408
9501
|
z-index: 0;
|
|
9409
9502
|
|
|
9410
|
-
${(0,
|
|
9503
|
+
${(0, import_design_system61.cq)("420px")} {
|
|
9411
9504
|
display: grid;
|
|
9412
9505
|
grid-template-columns: ${hiddenLocaleInput ? "1fr" : "1fr minmax(140px, 0.25fr)"};
|
|
9413
9506
|
}
|
|
9414
9507
|
`;
|
|
9415
|
-
var SortFilterInputRow =
|
|
9508
|
+
var SortFilterInputRow = import_react91.css`
|
|
9416
9509
|
align-items: center;
|
|
9417
9510
|
display: grid;
|
|
9418
9511
|
grid-template-columns: 1fr auto;
|
|
9419
9512
|
gap: var(--spacing-base);
|
|
9420
9513
|
`;
|
|
9421
|
-
var InputVariableWrapper =
|
|
9514
|
+
var InputVariableWrapper = import_react91.css`
|
|
9422
9515
|
flex-grow: 1;
|
|
9423
9516
|
|
|
9424
9517
|
// we need to override label styles nested within the input variable
|
|
@@ -9429,7 +9522,7 @@ var InputVariableWrapper = import_react83.css`
|
|
|
9429
9522
|
`;
|
|
9430
9523
|
|
|
9431
9524
|
// src/components/SearchAndFilter/SortItems.tsx
|
|
9432
|
-
var
|
|
9525
|
+
var import_jsx_runtime89 = require("@emotion/react/jsx-runtime");
|
|
9433
9526
|
var SortItems = ({
|
|
9434
9527
|
sortByLabel = "Sort by",
|
|
9435
9528
|
localeLabel = "Show locale",
|
|
@@ -9451,11 +9544,11 @@ var SortItems = ({
|
|
|
9451
9544
|
return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
|
|
9452
9545
|
})) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
|
|
9453
9546
|
const localeLabelValue = sortOptions.length > 1 ? localeLabel : `${localeLabel}s`;
|
|
9454
|
-
return /* @__PURE__ */ (0,
|
|
9455
|
-
/* @__PURE__ */ (0,
|
|
9456
|
-
/* @__PURE__ */ (0,
|
|
9457
|
-
/* @__PURE__ */ (0,
|
|
9458
|
-
/* @__PURE__ */ (0,
|
|
9547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
|
|
9548
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_design_system62.VerticalRhythm, { gap: "xs", children: [
|
|
9549
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { css: Title2, children: sortByLabel }),
|
|
9550
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { css: SortFilterInputRow, children: [
|
|
9551
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
9459
9552
|
InputVariables,
|
|
9460
9553
|
{
|
|
9461
9554
|
disableInlineMenu: disableSortBinding,
|
|
@@ -9463,8 +9556,8 @@ var SortItems = ({
|
|
|
9463
9556
|
value: sortField,
|
|
9464
9557
|
valueToResetTo: "created_at",
|
|
9465
9558
|
onChange: (e) => onSortChange(`${e}_${sortDirection}`),
|
|
9466
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
9467
|
-
|
|
9559
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
9560
|
+
import_design_system62.InputComboBox,
|
|
9468
9561
|
{
|
|
9469
9562
|
id: "sort-by-field",
|
|
9470
9563
|
"aria-label": "Sort by",
|
|
@@ -9486,7 +9579,7 @@ var SortItems = ({
|
|
|
9486
9579
|
)
|
|
9487
9580
|
}
|
|
9488
9581
|
),
|
|
9489
|
-
/* @__PURE__ */ (0,
|
|
9582
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
9490
9583
|
InputVariables,
|
|
9491
9584
|
{
|
|
9492
9585
|
disableInlineMenu: disableSortBinding,
|
|
@@ -9494,8 +9587,8 @@ var SortItems = ({
|
|
|
9494
9587
|
valueToResetTo: "DESC",
|
|
9495
9588
|
showMenuPosition: disableSortBinding ? void 0 : "inline-right",
|
|
9496
9589
|
onChange: (e) => onSortChange(`${sortField}_${e}`),
|
|
9497
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
9498
|
-
|
|
9590
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
9591
|
+
import_design_system62.SegmentedControl,
|
|
9499
9592
|
{
|
|
9500
9593
|
noCheckmark: true,
|
|
9501
9594
|
name: "sortBy",
|
|
@@ -9526,15 +9619,15 @@ var SortItems = ({
|
|
|
9526
9619
|
)
|
|
9527
9620
|
] })
|
|
9528
9621
|
] }),
|
|
9529
|
-
hideLocaleOptions ? null : /* @__PURE__ */ (0,
|
|
9622
|
+
hideLocaleOptions ? null : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_design_system62.VerticalRhythm, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
9530
9623
|
InputVariables,
|
|
9531
9624
|
{
|
|
9532
9625
|
label: localeLabelValue,
|
|
9533
9626
|
value: localeValue,
|
|
9534
9627
|
showMenuPosition: "inline-right",
|
|
9535
9628
|
onChange: (e) => onLocaleChange(e != null ? e : ""),
|
|
9536
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
9537
|
-
|
|
9629
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
9630
|
+
import_design_system62.InputSelect,
|
|
9538
9631
|
{
|
|
9539
9632
|
name: "localeReturned",
|
|
9540
9633
|
"aria-label": localeLabelValue,
|
|
@@ -9564,19 +9657,19 @@ function createLocationValidator(setValue, validate) {
|
|
|
9564
9657
|
|
|
9565
9658
|
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
9566
9659
|
var import_canvas10 = require("@uniformdev/canvas");
|
|
9567
|
-
var
|
|
9660
|
+
var import_react92 = require("react");
|
|
9568
9661
|
function useContentDataResourceLocaleInfo({
|
|
9569
9662
|
locale,
|
|
9570
9663
|
setLocale,
|
|
9571
9664
|
dynamicInputs
|
|
9572
9665
|
}) {
|
|
9573
9666
|
var _a;
|
|
9574
|
-
const setLocaleRef = (0,
|
|
9667
|
+
const setLocaleRef = (0, import_react92.useRef)(setLocale);
|
|
9575
9668
|
setLocaleRef.current = setLocale;
|
|
9576
9669
|
const { flatVariables } = useVariables();
|
|
9577
9670
|
const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas10.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME) : "";
|
|
9578
9671
|
const boundLocale = (_a = (0, import_canvas10.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
9579
|
-
(0,
|
|
9672
|
+
(0, import_react92.useEffect)(() => {
|
|
9580
9673
|
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
9581
9674
|
setLocaleRef.current((0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME));
|
|
9582
9675
|
}
|
|
@@ -9585,7 +9678,7 @@ function useContentDataResourceLocaleInfo({
|
|
|
9585
9678
|
}
|
|
9586
9679
|
|
|
9587
9680
|
// src/index.ts
|
|
9588
|
-
var
|
|
9681
|
+
var import_design_system63 = require("@uniformdev/design-system");
|
|
9589
9682
|
__reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
9590
9683
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9591
9684
|
0 && (module.exports = {
|