@uniformdev/mesh-sdk-react 19.158.0 → 19.159.1-alpha.9
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 +94 -129
- package/dist/index.d.ts +94 -129
- package/dist/index.esm.js +734 -622
- package/dist/index.js +793 -695
- package/dist/index.mjs +734 -622
- 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,
|
|
@@ -7792,303 +7792,171 @@ var MULTI_SELECT_OPERATORS = [
|
|
|
7792
7792
|
}
|
|
7793
7793
|
];
|
|
7794
7794
|
|
|
7795
|
-
// src/components/SearchAndFilter/
|
|
7796
|
-
var import_design_system42 = require("@uniformdev/design-system");
|
|
7797
|
-
|
|
7798
|
-
// src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
|
|
7799
|
-
var import_react76 = require("@emotion/react");
|
|
7795
|
+
// src/components/SearchAndFilter/editors/DateEditor.tsx
|
|
7800
7796
|
var import_design_system41 = require("@uniformdev/design-system");
|
|
7801
|
-
var
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
height: 1px;
|
|
7826
|
-
background: var(--gray-300);
|
|
7827
|
-
width: calc(100% - var(--spacing-base));
|
|
7828
|
-
margin-left: var(--spacing-base);
|
|
7829
|
-
}
|
|
7830
|
-
&:last-of-type:after {
|
|
7831
|
-
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
|
|
7832
7821
|
}
|
|
7833
|
-
|
|
7822
|
+
);
|
|
7823
|
+
};
|
|
7834
7824
|
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
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");
|
|
7839
7829
|
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
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 })
|
|
7843
7842
|
}
|
|
7844
|
-
|
|
7843
|
+
);
|
|
7844
|
+
};
|
|
7845
7845
|
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
var
|
|
7851
|
-
|
|
7852
|
-
gap: var(--spacing-sm);
|
|
7853
|
-
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
|
+
};
|
|
7854
7852
|
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
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;
|
|
7858
7880
|
}
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
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;
|
|
7862
7886
|
}
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
grid-template-columns: 200px 160px 1fr 32px;
|
|
7867
|
-
|
|
7868
|
-
& > div:nth-child(n) {
|
|
7869
|
-
width: auto;
|
|
7887
|
+
if (maxDate && !minDate) {
|
|
7888
|
+
setError("Please enter both a low and high date");
|
|
7889
|
+
return;
|
|
7870
7890
|
}
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
`;
|
|
7877
|
-
var BindableKeywordSearchInputStyles = import_react76.css`
|
|
7878
|
-
position: relative;
|
|
7879
|
-
width: 100%;
|
|
7880
|
-
|
|
7881
|
-
& [data-lexical-editor='true'] {
|
|
7882
|
-
padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
|
|
7883
|
-
font-size: var(--fs-sm);
|
|
7884
|
-
border-radius: var(--rounded-full);
|
|
7885
|
-
max-height: 40px;
|
|
7886
|
-
min-height: unset;
|
|
7887
|
-
width: 100%;
|
|
7888
|
-
position: relative;
|
|
7889
|
-
white-space: nowrap;
|
|
7890
|
-
}
|
|
7891
|
-
`;
|
|
7892
|
-
var ClearSearchButtonContainer = import_react76.css`
|
|
7893
|
-
align-items: center;
|
|
7894
|
-
display: flex;
|
|
7895
|
-
position: absolute;
|
|
7896
|
-
inset: 0 var(--spacing-lg) 0 auto;
|
|
7897
|
-
`;
|
|
7898
|
-
var ClearSearchButtonStyles = import_react76.css`
|
|
7899
|
-
background: none;
|
|
7900
|
-
border: none;
|
|
7901
|
-
padding: 0;
|
|
7902
|
-
pointer-events: all;
|
|
7903
|
-
`;
|
|
7904
|
-
var FilterButton = import_react76.css`
|
|
7905
|
-
align-items: center;
|
|
7906
|
-
background: var(--white);
|
|
7907
|
-
border: 1px solid var(--gray-300);
|
|
7908
|
-
border-radius: var(--rounded-full);
|
|
7909
|
-
color: var(--typography-base);
|
|
7910
|
-
display: flex;
|
|
7911
|
-
font-size: var(--fs-sm);
|
|
7912
|
-
gap: var(--spacing-sm);
|
|
7913
|
-
padding: var(--spacing-sm) var(--spacing-base);
|
|
7914
|
-
max-height: 40px;
|
|
7915
|
-
transition: color var(--duration-fast) var(--timing-ease-out),
|
|
7916
|
-
background-color var(--duration-fast) var(--timing-ease-out),
|
|
7917
|
-
border-color var(--duration-fast) var(--timing-ease-out),
|
|
7918
|
-
box-shadow var(--duration-fast) var(--timing-ease-out);
|
|
7919
|
-
|
|
7920
|
-
svg {
|
|
7921
|
-
color: var(--gray-300);
|
|
7922
|
-
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7923
|
-
}
|
|
7924
|
-
|
|
7925
|
-
&:hover,
|
|
7926
|
-
:where([aria-expanded='true']) {
|
|
7927
|
-
outline: none;
|
|
7928
|
-
background: var(--gray-200);
|
|
7929
|
-
border-color: var(--gray-300);
|
|
7930
|
-
|
|
7931
|
-
svg {
|
|
7932
|
-
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;
|
|
7933
7896
|
}
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
opacity: var(--opacity-50);
|
|
7938
|
-
}
|
|
7939
|
-
`;
|
|
7940
|
-
var FilterButtonText = import_react76.css`
|
|
7941
|
-
overflow: hidden;
|
|
7942
|
-
text-overflow: ellipsis;
|
|
7943
|
-
white-space: nowrap;
|
|
7944
|
-
max-width: 14ch;
|
|
7945
|
-
`;
|
|
7946
|
-
var FilterButtonSelected = import_react76.css`
|
|
7947
|
-
background: var(--gray-100);
|
|
7948
|
-
border-color: var(--gray-300);
|
|
7949
|
-
|
|
7950
|
-
svg {
|
|
7951
|
-
color: var(--accent-dark);
|
|
7952
|
-
}
|
|
7953
|
-
`;
|
|
7954
|
-
var FilterButtonWithOptions = import_react76.css`
|
|
7955
|
-
:where([aria-expanded='true']) {
|
|
7956
|
-
background: var(--purple-rain-100);
|
|
7957
|
-
border-color: var(--accent-light);
|
|
7958
|
-
color: var(--typography-base);
|
|
7959
|
-
box-shadow: var(--elevation-100);
|
|
7960
|
-
|
|
7961
|
-
svg {
|
|
7962
|
-
color: var(--accent-dark);
|
|
7897
|
+
if (minDate > maxDate) {
|
|
7898
|
+
setError("The min date cannot be higher than the max date");
|
|
7899
|
+
return;
|
|
7963
7900
|
}
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
var SearchIcon = import_react76.css`
|
|
7967
|
-
color: var(--icon-color);
|
|
7968
|
-
position: absolute;
|
|
7969
|
-
inset: 0 var(--spacing-base) 0 auto;
|
|
7970
|
-
margin: auto;
|
|
7971
|
-
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7972
|
-
`;
|
|
7973
|
-
var AddConditionalBtn = import_react76.css`
|
|
7974
|
-
align-items: center;
|
|
7975
|
-
background: transparent;
|
|
7976
|
-
border: none;
|
|
7977
|
-
color: var(--primary-action-default);
|
|
7978
|
-
display: flex;
|
|
7979
|
-
gap: var(--spacing-sm);
|
|
7980
|
-
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7981
|
-
padding: 0;
|
|
7982
|
-
|
|
7983
|
-
&:hover,
|
|
7984
|
-
&:focus {
|
|
7985
|
-
color: var(--primary-action-hover);
|
|
7986
|
-
}
|
|
7987
|
-
|
|
7988
|
-
&:disabled {
|
|
7989
|
-
color: var(--gray-400);
|
|
7990
|
-
}
|
|
7991
|
-
`;
|
|
7992
|
-
var Title = import_react76.css`
|
|
7993
|
-
color: var(--typography-light);
|
|
7994
|
-
|
|
7995
|
-
&:focus {
|
|
7996
|
-
outline: none;
|
|
7997
|
-
}
|
|
7998
|
-
`;
|
|
7999
|
-
var ResetConditionsBtn = import_react76.css`
|
|
8000
|
-
background: transparent;
|
|
8001
|
-
border: none;
|
|
8002
|
-
color: var(--action-destructive-default);
|
|
8003
|
-
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
8004
|
-
padding: 0;
|
|
8005
|
-
|
|
8006
|
-
&:hover,
|
|
8007
|
-
&:focus {
|
|
8008
|
-
color: var(--action-destructive-hover);
|
|
8009
|
-
}
|
|
8010
|
-
`;
|
|
8011
|
-
var IconBtn = import_react76.css`
|
|
8012
|
-
background: transparent;
|
|
8013
|
-
border: none;
|
|
8014
|
-
padding: var(--spacing-sm);
|
|
8015
|
-
`;
|
|
8016
|
-
var SearchAndFilterOptionsContainer = import_react76.css`
|
|
8017
|
-
background: var(--gray-50);
|
|
8018
|
-
border: 1px solid var(--gray-300);
|
|
8019
|
-
border-radius: var(--rounded-base);
|
|
8020
|
-
container-type: inline-size;
|
|
8021
|
-
display: flex;
|
|
8022
|
-
flex-direction: column;
|
|
8023
|
-
gap: var(--spacing-sm);
|
|
8024
|
-
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
8025
|
-
will-change: height;
|
|
8026
|
-
position: relative;
|
|
8027
|
-
z-index: 1;
|
|
8028
|
-
`;
|
|
8029
|
-
var SearchAndFilterOptionsInnerContainer = import_react76.css`
|
|
8030
|
-
display: flex;
|
|
8031
|
-
flex-direction: column;
|
|
8032
|
-
gap: var(--spacing-sm);
|
|
8033
|
-
padding-inline: var(--spacing-md);
|
|
8034
|
-
`;
|
|
8035
|
-
var SearchAndFilterButtonGroup = import_react76.css`
|
|
8036
|
-
margin-top: var(--spacing-xs);
|
|
8037
|
-
margin-left: calc(56px + var(--spacing-md));
|
|
8038
|
-
`;
|
|
8039
|
-
|
|
8040
|
-
// src/components/SearchAndFilter/FilterButton.tsx
|
|
8041
|
-
var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
|
|
8042
|
-
var FilterButton2 = ({
|
|
8043
|
-
text = "Filters",
|
|
8044
|
-
icon = "filter-add",
|
|
8045
|
-
filterCount,
|
|
8046
|
-
hasSelectedValue,
|
|
8047
|
-
dataTestId,
|
|
8048
|
-
...props
|
|
8049
|
-
}) => {
|
|
8050
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
8051
|
-
"button",
|
|
8052
|
-
{
|
|
8053
|
-
type: "button",
|
|
8054
|
-
css: [
|
|
8055
|
-
FilterButton,
|
|
8056
|
-
hasSelectedValue ? FilterButtonSelected : void 0,
|
|
8057
|
-
filterCount ? [FilterButtonWithOptions, FilterButtonSelected] : void 0
|
|
8058
|
-
],
|
|
8059
|
-
...props,
|
|
8060
|
-
"data-testid": dataTestId,
|
|
8061
|
-
children: [
|
|
8062
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_design_system42.Icon, { icon, iconColor: "currentColor", size: "1rem" }),
|
|
8063
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { css: FilterButtonText, children: text }),
|
|
8064
|
-
filterCount ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_design_system42.Counter, { count: filterCount, bgColor: "var(--white)" }) : null
|
|
8065
|
-
]
|
|
7901
|
+
if (error) {
|
|
7902
|
+
setError("");
|
|
8066
7903
|
}
|
|
8067
|
-
|
|
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
|
+
] });
|
|
8068
7945
|
};
|
|
8069
7946
|
|
|
8070
|
-
// src/components/SearchAndFilter/
|
|
8071
|
-
var import_CgClose5 = require("@react-icons/all-files/cg/CgClose");
|
|
8072
|
-
var import_design_system45 = require("@uniformdev/design-system");
|
|
8073
|
-
var import_lexical11 = require("lexical");
|
|
8074
|
-
var import_react79 = require("react");
|
|
8075
|
-
var import_react_use6 = require("react-use");
|
|
8076
|
-
var import_uuid3 = require("uuid");
|
|
8077
|
-
|
|
8078
|
-
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
7947
|
+
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
8079
7948
|
var import_design_system44 = require("@uniformdev/design-system");
|
|
8080
7949
|
var import_react78 = require("react");
|
|
8081
7950
|
|
|
8082
|
-
// src/components/SearchAndFilter/
|
|
8083
|
-
var import_design_system43 = require("@uniformdev/design-system");
|
|
8084
|
-
var import_react77 = require("react");
|
|
8085
|
-
var import_react_use5 = require("react-use");
|
|
8086
|
-
var import_jsx_runtime70 = require("@emotion/react/jsx-runtime");
|
|
7951
|
+
// src/components/SearchAndFilter/editors/shared/readOnlyAttributes.tsx
|
|
8087
7952
|
var readOnlyAttributes = {
|
|
8088
7953
|
isSearchable: false,
|
|
8089
7954
|
menuIsOpen: false,
|
|
8090
7955
|
isClearable: false
|
|
8091
7956
|
};
|
|
7957
|
+
|
|
7958
|
+
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
7959
|
+
var import_jsx_runtime72 = require("@emotion/react/jsx-runtime");
|
|
8092
7960
|
var FilterMultiChoiceEditor = ({
|
|
8093
7961
|
value,
|
|
8094
7962
|
options,
|
|
@@ -8099,20 +7967,24 @@ var FilterMultiChoiceEditor = ({
|
|
|
8099
7967
|
}) => {
|
|
8100
7968
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8101
7969
|
const isClearable = !readOnly || !disabled;
|
|
8102
|
-
|
|
8103
|
-
|
|
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,
|
|
8104
7976
|
{
|
|
8105
7977
|
...props,
|
|
8106
7978
|
placeholder: "Type to search...",
|
|
8107
|
-
options,
|
|
7979
|
+
options: groupedOptions,
|
|
8108
7980
|
isMulti: true,
|
|
8109
7981
|
isClearable,
|
|
8110
7982
|
isDisabled: disabled,
|
|
8111
7983
|
onChange: (e) => {
|
|
8112
|
-
|
|
8113
|
-
return props.onChange(
|
|
7984
|
+
const selectedValues = (0, import_design_system44.getComboBoxSelectedSelectableGroups)(e);
|
|
7985
|
+
return props.onChange([...selectedValues]);
|
|
8114
7986
|
},
|
|
8115
|
-
value:
|
|
7987
|
+
value: selectedOptions,
|
|
8116
7988
|
"aria-readonly": readOnly,
|
|
8117
7989
|
styles: {
|
|
8118
7990
|
menu(base) {
|
|
@@ -8126,6 +7998,11 @@ var FilterMultiChoiceEditor = ({
|
|
|
8126
7998
|
}
|
|
8127
7999
|
) });
|
|
8128
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");
|
|
8129
8006
|
var FilterSingleChoiceEditor = ({
|
|
8130
8007
|
options,
|
|
8131
8008
|
value,
|
|
@@ -8134,91 +8011,30 @@ var FilterSingleChoiceEditor = ({
|
|
|
8134
8011
|
onChange,
|
|
8135
8012
|
valueTestId
|
|
8136
8013
|
}) => {
|
|
8137
|
-
var _a;
|
|
8138
8014
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8139
|
-
|
|
8140
|
-
|
|
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,
|
|
8141
8025
|
{
|
|
8142
8026
|
placeholder: "Type to search...",
|
|
8143
|
-
options,
|
|
8027
|
+
options: groupedOptions,
|
|
8144
8028
|
isClearable: true,
|
|
8145
8029
|
onChange: (e) => {
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
},
|
|
8149
|
-
isDisabled: disabled,
|
|
8150
|
-
value: (_a = options == null ? void 0 : options.find((option) => option.value === value)) != null ? _a : null,
|
|
8151
|
-
"aria-readonly": readOnly,
|
|
8152
|
-
styles: {
|
|
8153
|
-
menu(base) {
|
|
8154
|
-
return {
|
|
8155
|
-
...base,
|
|
8156
|
-
minWidth: "max-content"
|
|
8157
|
-
};
|
|
8158
|
-
}
|
|
8159
|
-
},
|
|
8160
|
-
...readOnlyProps
|
|
8161
|
-
}
|
|
8162
|
-
) });
|
|
8163
|
-
};
|
|
8164
|
-
var CustomOptions = ({ label, value }) => {
|
|
8165
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_design_system43.StatusBullet, { status: label, message: value });
|
|
8166
|
-
};
|
|
8167
|
-
var StatusMultiEditor = ({
|
|
8168
|
-
options,
|
|
8169
|
-
value,
|
|
8170
|
-
disabled,
|
|
8171
|
-
readOnly,
|
|
8172
|
-
onChange,
|
|
8173
|
-
valueTestId
|
|
8174
|
-
}) => {
|
|
8175
|
-
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8176
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
8177
|
-
import_design_system43.InputComboBox,
|
|
8178
|
-
{
|
|
8179
|
-
options,
|
|
8180
|
-
isMulti: true,
|
|
8181
|
-
onChange: (e) => {
|
|
8182
|
-
var _a;
|
|
8183
|
-
return onChange((_a = e.map((item) => item.value)) != null ? _a : []);
|
|
8184
|
-
},
|
|
8185
|
-
formatOptionLabel: CustomOptions,
|
|
8186
|
-
"aria-readonly": readOnly,
|
|
8187
|
-
value: options == null ? void 0 : options.filter((option) => value == null ? void 0 : value.includes(option.value)),
|
|
8188
|
-
isDisabled: disabled,
|
|
8189
|
-
styles: {
|
|
8190
|
-
menu(base) {
|
|
8191
|
-
return {
|
|
8192
|
-
...base,
|
|
8193
|
-
minWidth: "max-content"
|
|
8194
|
-
};
|
|
8030
|
+
if (Array.isArray(e == null ? void 0 : e.value)) {
|
|
8031
|
+
return;
|
|
8195
8032
|
}
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
}
|
|
8199
|
-
) });
|
|
8200
|
-
};
|
|
8201
|
-
var StatusSingleEditor = ({
|
|
8202
|
-
options,
|
|
8203
|
-
value,
|
|
8204
|
-
disabled,
|
|
8205
|
-
readOnly,
|
|
8206
|
-
onChange,
|
|
8207
|
-
valueTestId
|
|
8208
|
-
}) => {
|
|
8209
|
-
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8210
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
8211
|
-
import_design_system43.InputComboBox,
|
|
8212
|
-
{
|
|
8213
|
-
options,
|
|
8214
|
-
onChange: (e) => {
|
|
8215
|
-
var _a;
|
|
8216
|
-
return onChange((_a = e == null ? void 0 : e.value) != null ? _a : "");
|
|
8217
|
-
},
|
|
8218
|
-
formatOptionLabel: CustomOptions,
|
|
8219
|
-
"aria-readonly": readOnly,
|
|
8220
|
-
value: options == null ? void 0 : options.find((option) => option.value === value),
|
|
8033
|
+
return onChange(e == null ? void 0 : e.value);
|
|
8034
|
+
},
|
|
8221
8035
|
isDisabled: disabled,
|
|
8036
|
+
value: selectedOptions,
|
|
8037
|
+
"aria-readonly": readOnly,
|
|
8222
8038
|
styles: {
|
|
8223
8039
|
menu(base) {
|
|
8224
8040
|
return {
|
|
@@ -8231,28 +8047,43 @@ var StatusSingleEditor = ({
|
|
|
8231
8047
|
}
|
|
8232
8048
|
) });
|
|
8233
8049
|
};
|
|
8234
|
-
|
|
8235
|
-
|
|
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 = ({
|
|
8236
8057
|
ariaLabel,
|
|
8058
|
+
onChange,
|
|
8059
|
+
disabled,
|
|
8237
8060
|
value,
|
|
8238
8061
|
readOnly,
|
|
8239
8062
|
valueTestId
|
|
8240
8063
|
}) => {
|
|
8241
|
-
const [innerValue, setInnerValue] = (0,
|
|
8242
|
-
(0,
|
|
8243
|
-
return /* @__PURE__ */ (0,
|
|
8244
|
-
|
|
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,
|
|
8245
8068
|
{
|
|
8246
|
-
showLabel: false,
|
|
8247
8069
|
label: ariaLabel,
|
|
8070
|
+
type: "number",
|
|
8071
|
+
showLabel: false,
|
|
8072
|
+
min: 0,
|
|
8248
8073
|
onChange: (e) => setInnerValue(e.currentTarget.value),
|
|
8249
|
-
|
|
8074
|
+
disabled,
|
|
8250
8075
|
value: innerValue,
|
|
8251
8076
|
readOnly,
|
|
8252
8077
|
"data-testid": valueTestId
|
|
8253
8078
|
}
|
|
8254
8079
|
);
|
|
8255
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");
|
|
8256
8087
|
var NumberRangeEditor = ({
|
|
8257
8088
|
onChange,
|
|
8258
8089
|
disabled,
|
|
@@ -8261,10 +8092,10 @@ var NumberRangeEditor = ({
|
|
|
8261
8092
|
readOnly,
|
|
8262
8093
|
valueTestId
|
|
8263
8094
|
}) => {
|
|
8264
|
-
const [minValue, setMinValue] = (0,
|
|
8265
|
-
const [maxValue, setMaxValue] = (0,
|
|
8266
|
-
const [error, setError] = (0,
|
|
8267
|
-
(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)(
|
|
8268
8099
|
() => {
|
|
8269
8100
|
if (minValue && maxValue && !error) {
|
|
8270
8101
|
onChange([minValue, maxValue]);
|
|
@@ -8275,7 +8106,7 @@ var NumberRangeEditor = ({
|
|
|
8275
8106
|
500,
|
|
8276
8107
|
[minValue, maxValue]
|
|
8277
8108
|
);
|
|
8278
|
-
(0,
|
|
8109
|
+
(0, import_react81.useEffect)(() => {
|
|
8279
8110
|
if (!maxValue && !minValue) {
|
|
8280
8111
|
return;
|
|
8281
8112
|
}
|
|
@@ -8297,10 +8128,10 @@ var NumberRangeEditor = ({
|
|
|
8297
8128
|
setMaxValue(maxValue);
|
|
8298
8129
|
}
|
|
8299
8130
|
}, [maxValue, minValue, setError]);
|
|
8300
|
-
return /* @__PURE__ */ (0,
|
|
8301
|
-
/* @__PURE__ */ (0,
|
|
8302
|
-
/* @__PURE__ */ (0,
|
|
8303
|
-
|
|
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,
|
|
8304
8135
|
{
|
|
8305
8136
|
label: `${ariaLabel}-min`,
|
|
8306
8137
|
type: "number",
|
|
@@ -8315,8 +8146,8 @@ var NumberRangeEditor = ({
|
|
|
8315
8146
|
"data-testid": "value-low"
|
|
8316
8147
|
}
|
|
8317
8148
|
),
|
|
8318
|
-
/* @__PURE__ */ (0,
|
|
8319
|
-
|
|
8149
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
8150
|
+
import_design_system47.Input,
|
|
8320
8151
|
{
|
|
8321
8152
|
type: "number",
|
|
8322
8153
|
label: `${ariaLabel}-max`,
|
|
@@ -8332,149 +8163,433 @@ var NumberRangeEditor = ({
|
|
|
8332
8163
|
}
|
|
8333
8164
|
)
|
|
8334
8165
|
] }),
|
|
8335
|
-
/* @__PURE__ */ (0,
|
|
8166
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ErrorContainer, { errorMessage: error })
|
|
8336
8167
|
] });
|
|
8337
8168
|
};
|
|
8338
|
-
|
|
8339
|
-
|
|
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,
|
|
8340
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,
|
|
8341
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,
|
|
8342
8284
|
value,
|
|
8343
8285
|
readOnly,
|
|
8344
8286
|
valueTestId
|
|
8345
8287
|
}) => {
|
|
8346
|
-
const [innerValue, setInnerValue] = (0,
|
|
8347
|
-
(0,
|
|
8348
|
-
return /* @__PURE__ */ (0,
|
|
8349
|
-
|
|
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,
|
|
8350
8292
|
{
|
|
8351
|
-
label: ariaLabel,
|
|
8352
|
-
type: "number",
|
|
8353
8293
|
showLabel: false,
|
|
8354
|
-
|
|
8294
|
+
label: ariaLabel,
|
|
8355
8295
|
onChange: (e) => setInnerValue(e.currentTarget.value),
|
|
8356
|
-
|
|
8296
|
+
placeholder: "Enter phrase to search\u2026",
|
|
8357
8297
|
value: innerValue,
|
|
8358
8298
|
readOnly,
|
|
8359
8299
|
"data-testid": valueTestId
|
|
8360
8300
|
}
|
|
8361
|
-
);
|
|
8362
|
-
};
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
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
|
|
8370
8558
|
}) => {
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
8374
|
-
import_design_system43.Input,
|
|
8559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
8560
|
+
"button",
|
|
8375
8561
|
{
|
|
8376
|
-
type: "
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
"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
|
+
]
|
|
8384
8575
|
}
|
|
8385
8576
|
);
|
|
8386
8577
|
};
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
} else {
|
|
8403
|
-
onChange([]);
|
|
8404
|
-
}
|
|
8405
|
-
},
|
|
8406
|
-
500,
|
|
8407
|
-
[minDateValue, maxDateValue]
|
|
8408
|
-
);
|
|
8409
|
-
(0, import_react77.useEffect)(() => {
|
|
8410
|
-
if (!minDateValue || !maxDateValue) {
|
|
8411
|
-
return;
|
|
8412
|
-
}
|
|
8413
|
-
const minDate = new Date(minDateValue);
|
|
8414
|
-
const maxDate = new Date(maxDateValue);
|
|
8415
|
-
if (maxDate < minDate) {
|
|
8416
|
-
setError("The max date cannot be lower than the min date");
|
|
8417
|
-
return;
|
|
8418
|
-
}
|
|
8419
|
-
if (maxDate && !minDate) {
|
|
8420
|
-
setError("Please enter both a low and high date");
|
|
8421
|
-
return;
|
|
8422
|
-
}
|
|
8423
|
-
const minDateString = minDate.toDateString();
|
|
8424
|
-
const maxDateString = maxDate.toDateString();
|
|
8425
|
-
if (minDateString === maxDateString || maxDateString === minDateString) {
|
|
8426
|
-
setError("The min and max date cannot be the same");
|
|
8427
|
-
return;
|
|
8428
|
-
}
|
|
8429
|
-
if (minDate > maxDate) {
|
|
8430
|
-
setError("The min date cannot be higher than the max date");
|
|
8431
|
-
return;
|
|
8432
|
-
}
|
|
8433
|
-
if (error) {
|
|
8434
|
-
setError("");
|
|
8435
|
-
}
|
|
8436
|
-
if (minDate && maxDate) {
|
|
8437
|
-
setMinDateValue(minDateValue);
|
|
8438
|
-
setMaxDateValue(maxDateValue);
|
|
8439
|
-
} else {
|
|
8440
|
-
setMinDateValue("");
|
|
8441
|
-
setMaxDateValue("");
|
|
8442
|
-
}
|
|
8443
|
-
}, [minDateValue, maxDateValue, setError]);
|
|
8444
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
|
|
8445
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
8446
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
8447
|
-
import_design_system43.Input,
|
|
8448
|
-
{
|
|
8449
|
-
label: `${ariaLabel}-min-date`,
|
|
8450
|
-
type: "date",
|
|
8451
|
-
showLabel: false,
|
|
8452
|
-
value: minDateValue,
|
|
8453
|
-
onChange: (e) => setMinDateValue(e.currentTarget.value),
|
|
8454
|
-
"aria-invalid": !error ? false : true,
|
|
8455
|
-
disabled,
|
|
8456
|
-
readOnly,
|
|
8457
|
-
"data-testid": "value-low"
|
|
8458
|
-
}
|
|
8459
|
-
),
|
|
8460
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
8461
|
-
import_design_system43.Input,
|
|
8462
|
-
{
|
|
8463
|
-
label: `${ariaLabel}-max-date`,
|
|
8464
|
-
type: "date",
|
|
8465
|
-
showLabel: false,
|
|
8466
|
-
value: maxDateValue,
|
|
8467
|
-
onChange: (e) => setMaxDateValue(e.currentTarget.value),
|
|
8468
|
-
"aria-invalid": !error ? false : true,
|
|
8469
|
-
disabled,
|
|
8470
|
-
readOnly,
|
|
8471
|
-
"data-testid": "value-high"
|
|
8472
|
-
}
|
|
8473
|
-
)
|
|
8474
|
-
] }),
|
|
8475
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ErrorContainer, { errorMessage: error })
|
|
8476
|
-
] });
|
|
8477
|
-
};
|
|
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");
|
|
8478
8593
|
var FilterEditorRenderer = ({ editorType, ...props }) => {
|
|
8479
8594
|
const { filterMapper: contextFilterMapper } = useSearchAndFilter();
|
|
8480
8595
|
const Editor = contextFilterMapper == null ? void 0 : contextFilterMapper[editorType];
|
|
@@ -8484,7 +8599,7 @@ var FilterEditorRenderer = ({ editorType, ...props }) => {
|
|
|
8484
8599
|
if (editorType === "empty") {
|
|
8485
8600
|
return null;
|
|
8486
8601
|
}
|
|
8487
|
-
return /* @__PURE__ */ (0,
|
|
8602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Editor, { ...props });
|
|
8488
8603
|
};
|
|
8489
8604
|
var filterMapper = {
|
|
8490
8605
|
multiChoice: FilterMultiChoiceEditor,
|
|
@@ -8501,9 +8616,9 @@ var filterMapper = {
|
|
|
8501
8616
|
function withInputVariables(WrappedComponent) {
|
|
8502
8617
|
const WithInputVariables = (props) => {
|
|
8503
8618
|
if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
|
|
8504
|
-
return /* @__PURE__ */ (0,
|
|
8619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WrappedComponent, { ...props });
|
|
8505
8620
|
}
|
|
8506
|
-
return /* @__PURE__ */ (0,
|
|
8621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8507
8622
|
InputVariables,
|
|
8508
8623
|
{
|
|
8509
8624
|
disableInlineMenu: true,
|
|
@@ -8511,7 +8626,7 @@ function withInputVariables(WrappedComponent) {
|
|
|
8511
8626
|
onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
|
|
8512
8627
|
value: props.value,
|
|
8513
8628
|
disabled: props.disabled,
|
|
8514
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
8629
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WrappedComponent, { ...props })
|
|
8515
8630
|
}
|
|
8516
8631
|
);
|
|
8517
8632
|
};
|
|
@@ -8521,16 +8636,16 @@ function withInputVariablesForMultiValue(WrappedComponent) {
|
|
|
8521
8636
|
const WithInputVariables = (props) => {
|
|
8522
8637
|
var _a;
|
|
8523
8638
|
if (!props.bindable || props.disabled || props.readOnly) {
|
|
8524
|
-
return /* @__PURE__ */ (0,
|
|
8639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WrappedComponent, { ...props });
|
|
8525
8640
|
}
|
|
8526
|
-
return /* @__PURE__ */ (0,
|
|
8641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8527
8642
|
InputVariables,
|
|
8528
8643
|
{
|
|
8529
8644
|
disableInlineMenu: true,
|
|
8530
8645
|
showMenuPosition: "inline-right",
|
|
8531
8646
|
onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
|
|
8532
8647
|
value: (_a = props.value) == null ? void 0 : _a[0],
|
|
8533
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
8648
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WrappedComponent, { ...props })
|
|
8534
8649
|
}
|
|
8535
8650
|
);
|
|
8536
8651
|
};
|
|
@@ -8544,27 +8659,10 @@ var bindableFiltersMapper = {
|
|
|
8544
8659
|
text: withInputVariables(TextEditor),
|
|
8545
8660
|
number: withInputVariables(NumberEditor)
|
|
8546
8661
|
};
|
|
8547
|
-
var ErrorContainer = ({ errorMessage }) => {
|
|
8548
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
8549
|
-
"div",
|
|
8550
|
-
{
|
|
8551
|
-
css: {
|
|
8552
|
-
gridColumn: "span 6",
|
|
8553
|
-
order: 6
|
|
8554
|
-
},
|
|
8555
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_design_system43.FieldMessage, { errorMessage })
|
|
8556
|
-
}
|
|
8557
|
-
);
|
|
8558
|
-
};
|
|
8559
|
-
var twoColumnGrid = {
|
|
8560
|
-
display: "grid",
|
|
8561
|
-
gridTemplateColumns: "1fr 1fr",
|
|
8562
|
-
gap: "var(--spacing-sm);"
|
|
8563
|
-
};
|
|
8564
8662
|
|
|
8565
8663
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
8566
|
-
var
|
|
8567
|
-
var SearchAndFilterContext = (0,
|
|
8664
|
+
var import_jsx_runtime82 = require("@emotion/react/jsx-runtime");
|
|
8665
|
+
var SearchAndFilterContext = (0, import_react86.createContext)({
|
|
8568
8666
|
searchTerm: "",
|
|
8569
8667
|
setSearchTerm: () => {
|
|
8570
8668
|
},
|
|
@@ -8599,41 +8697,41 @@ var SearchAndFilterProvider = ({
|
|
|
8599
8697
|
children,
|
|
8600
8698
|
allowBindingSearchTerm
|
|
8601
8699
|
}) => {
|
|
8602
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
8603
|
-
const deferredSearchTerm = (0,
|
|
8604
|
-
const [filterVisibility, setFilterVisibility] = (0,
|
|
8605
|
-
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)(
|
|
8606
8704
|
(term) => {
|
|
8607
8705
|
setSearchTerm(term);
|
|
8608
8706
|
onSearchChange == null ? void 0 : onSearchChange(term);
|
|
8609
8707
|
},
|
|
8610
8708
|
[setSearchTerm, onSearchChange]
|
|
8611
8709
|
);
|
|
8612
|
-
const handleToggleFilterVisibility = (0,
|
|
8710
|
+
const handleToggleFilterVisibility = (0, import_react86.useCallback)(
|
|
8613
8711
|
(visible) => setFilterVisibility(visible),
|
|
8614
8712
|
[setFilterVisibility]
|
|
8615
8713
|
);
|
|
8616
|
-
const handleAddFilter = (0,
|
|
8714
|
+
const handleAddFilter = (0, import_react86.useCallback)(() => {
|
|
8617
8715
|
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
8618
8716
|
}, [filters, onChange]);
|
|
8619
|
-
const handleResetFilters = (0,
|
|
8717
|
+
const handleResetFilters = (0, import_react86.useCallback)(() => {
|
|
8620
8718
|
onSearchChange == null ? void 0 : onSearchChange("");
|
|
8621
8719
|
onChange(resetFilterValues);
|
|
8622
8720
|
}, [onChange, resetFilterValues, onSearchChange]);
|
|
8623
|
-
const handleDeleteFilter = (0,
|
|
8721
|
+
const handleDeleteFilter = (0, import_react86.useCallback)(
|
|
8624
8722
|
(index) => {
|
|
8625
8723
|
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
8626
8724
|
onChange(remainingFilters);
|
|
8627
8725
|
},
|
|
8628
8726
|
[filters, onChange]
|
|
8629
8727
|
);
|
|
8630
|
-
const validFilterQuery = (0,
|
|
8728
|
+
const validFilterQuery = (0, import_react86.useMemo)(() => {
|
|
8631
8729
|
const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
|
|
8632
8730
|
if (hasValidFilters) {
|
|
8633
8731
|
return filters;
|
|
8634
8732
|
}
|
|
8635
8733
|
}, [filters]);
|
|
8636
|
-
(0,
|
|
8734
|
+
(0, import_react86.useEffect)(() => {
|
|
8637
8735
|
if (filterVisibility) {
|
|
8638
8736
|
const handleEscKeyFilterClose = (e) => {
|
|
8639
8737
|
if (e.key === "Escape") {
|
|
@@ -8646,7 +8744,7 @@ var SearchAndFilterProvider = ({
|
|
|
8646
8744
|
};
|
|
8647
8745
|
}
|
|
8648
8746
|
}, [filterVisibility]);
|
|
8649
|
-
return /* @__PURE__ */ (0,
|
|
8747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
8650
8748
|
SearchAndFilterContext.Provider,
|
|
8651
8749
|
{
|
|
8652
8750
|
value: {
|
|
@@ -8665,17 +8763,17 @@ var SearchAndFilterProvider = ({
|
|
|
8665
8763
|
filterMapper: filterMapper2,
|
|
8666
8764
|
allowBindingSearchTerm
|
|
8667
8765
|
},
|
|
8668
|
-
children: /* @__PURE__ */ (0,
|
|
8766
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system54.VerticalRhythm, { children })
|
|
8669
8767
|
}
|
|
8670
8768
|
);
|
|
8671
8769
|
};
|
|
8672
8770
|
var useSearchAndFilter = () => {
|
|
8673
|
-
const value = (0,
|
|
8771
|
+
const value = (0, import_react86.useContext)(SearchAndFilterContext);
|
|
8674
8772
|
return { ...value };
|
|
8675
8773
|
};
|
|
8676
8774
|
|
|
8677
8775
|
// src/components/SearchAndFilter/FilterControls.tsx
|
|
8678
|
-
var
|
|
8776
|
+
var import_jsx_runtime83 = require("@emotion/react/jsx-runtime");
|
|
8679
8777
|
var FilterControls = ({
|
|
8680
8778
|
children,
|
|
8681
8779
|
hideSearchInput
|
|
@@ -8688,25 +8786,25 @@ var FilterControls = ({
|
|
|
8688
8786
|
searchTerm,
|
|
8689
8787
|
allowBindingSearchTerm
|
|
8690
8788
|
} = useSearchAndFilter();
|
|
8691
|
-
const editorRef = (0,
|
|
8789
|
+
const editorRef = (0, import_react87.useRef)(null);
|
|
8692
8790
|
const hasVariableInSearchTerm = hasReferencedVariables(searchTerm);
|
|
8693
|
-
const [idToResetInputVariables, setIdToResetInputVariables] = (0,
|
|
8694
|
-
const [localeSearchTerm, setLocaleSearchTerm] = (0,
|
|
8695
|
-
(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)(
|
|
8696
8794
|
() => {
|
|
8697
8795
|
setSearchTerm(localeSearchTerm);
|
|
8698
8796
|
},
|
|
8699
8797
|
300,
|
|
8700
8798
|
[localeSearchTerm]
|
|
8701
8799
|
);
|
|
8702
|
-
(0,
|
|
8800
|
+
(0, import_react87.useEffect)(() => {
|
|
8703
8801
|
if (searchTerm === "") {
|
|
8704
8802
|
setLocaleSearchTerm("");
|
|
8705
8803
|
setIdToResetInputVariables(`data-resource-search-term-input-${(0, import_uuid3.v4)()}`);
|
|
8706
8804
|
}
|
|
8707
8805
|
}, [searchTerm]);
|
|
8708
|
-
return /* @__PURE__ */ (0,
|
|
8709
|
-
/* @__PURE__ */ (0,
|
|
8806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
8807
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8710
8808
|
FilterButton2,
|
|
8711
8809
|
{
|
|
8712
8810
|
"aria-controls": "search-and-filter-options",
|
|
@@ -8719,8 +8817,8 @@ var FilterControls = ({
|
|
|
8719
8817
|
dataTestId: "filters-button"
|
|
8720
8818
|
}
|
|
8721
8819
|
),
|
|
8722
|
-
hideSearchInput ? null : /* @__PURE__ */ (0,
|
|
8723
|
-
/* @__PURE__ */ (0,
|
|
8820
|
+
hideSearchInput ? null : /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { css: BindableKeywordSearchInputStyles, children: [
|
|
8821
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8724
8822
|
InputVariables,
|
|
8725
8823
|
{
|
|
8726
8824
|
label: "",
|
|
@@ -8730,8 +8828,8 @@ var FilterControls = ({
|
|
|
8730
8828
|
value: localeSearchTerm,
|
|
8731
8829
|
onChange: (value) => setLocaleSearchTerm(value != null ? value : ""),
|
|
8732
8830
|
disableVariables: !allowBindingSearchTerm,
|
|
8733
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
8734
|
-
|
|
8831
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8832
|
+
import_design_system55.InputKeywordSearch,
|
|
8735
8833
|
{
|
|
8736
8834
|
placeholder: "Search...",
|
|
8737
8835
|
onSearchTextChanged: (e) => setLocaleSearchTerm(e),
|
|
@@ -8743,7 +8841,7 @@ var FilterControls = ({
|
|
|
8743
8841
|
)
|
|
8744
8842
|
}
|
|
8745
8843
|
),
|
|
8746
|
-
hasVariableInSearchTerm ? /* @__PURE__ */ (0,
|
|
8844
|
+
hasVariableInSearchTerm ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8747
8845
|
"button",
|
|
8748
8846
|
{
|
|
8749
8847
|
css: ClearSearchButtonStyles,
|
|
@@ -8757,7 +8855,7 @@ var FilterControls = ({
|
|
|
8757
8855
|
},
|
|
8758
8856
|
type: "button",
|
|
8759
8857
|
"data-testid": "keyword-search-clear-button",
|
|
8760
|
-
children: /* @__PURE__ */ (0,
|
|
8858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_design_system55.Icon, { icon: import_CgClose5.CgClose, iconColor: "red", size: "1rem" })
|
|
8761
8859
|
}
|
|
8762
8860
|
) }) : null
|
|
8763
8861
|
] }),
|
|
@@ -8766,22 +8864,22 @@ var FilterControls = ({
|
|
|
8766
8864
|
};
|
|
8767
8865
|
|
|
8768
8866
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
8769
|
-
var
|
|
8770
|
-
var
|
|
8867
|
+
var import_design_system57 = require("@uniformdev/design-system");
|
|
8868
|
+
var import_react89 = require("react");
|
|
8771
8869
|
|
|
8772
8870
|
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
8773
|
-
var
|
|
8774
|
-
var
|
|
8775
|
-
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");
|
|
8776
8874
|
var SearchAndFilterOptionsContainer2 = ({
|
|
8777
8875
|
buttonRow,
|
|
8778
8876
|
additionalFiltersContainer,
|
|
8779
8877
|
children
|
|
8780
8878
|
}) => {
|
|
8781
|
-
return /* @__PURE__ */ (0,
|
|
8782
|
-
/* @__PURE__ */ (0,
|
|
8783
|
-
buttonRow ? /* @__PURE__ */ (0,
|
|
8784
|
-
|
|
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,
|
|
8785
8883
|
{
|
|
8786
8884
|
css: SearchAndFilterButtonGroup,
|
|
8787
8885
|
gap: "sm",
|
|
@@ -8790,7 +8888,7 @@ var SearchAndFilterOptionsContainer2 = ({
|
|
|
8790
8888
|
children: buttonRow
|
|
8791
8889
|
}
|
|
8792
8890
|
) : null,
|
|
8793
|
-
additionalFiltersContainer ? /* @__PURE__ */ (0,
|
|
8891
|
+
additionalFiltersContainer ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { children: additionalFiltersContainer }) : null
|
|
8794
8892
|
] });
|
|
8795
8893
|
};
|
|
8796
8894
|
var FilterMenu = ({
|
|
@@ -8803,22 +8901,22 @@ var FilterMenu = ({
|
|
|
8803
8901
|
resetButtonText = "reset"
|
|
8804
8902
|
}) => {
|
|
8805
8903
|
const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
|
|
8806
|
-
const innerMenuRef =
|
|
8807
|
-
(0,
|
|
8904
|
+
const innerMenuRef = import_react88.default.useRef(null);
|
|
8905
|
+
(0, import_react88.useEffect)(() => {
|
|
8808
8906
|
var _a;
|
|
8809
8907
|
if (filterVisibility) {
|
|
8810
8908
|
(_a = innerMenuRef.current) == null ? void 0 : _a.focus();
|
|
8811
8909
|
}
|
|
8812
8910
|
}, [filterVisibility]);
|
|
8813
|
-
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)(
|
|
8814
8912
|
SearchAndFilterOptionsContainer2,
|
|
8815
8913
|
{
|
|
8816
8914
|
buttonRow: menuControls,
|
|
8817
8915
|
additionalFiltersContainer,
|
|
8818
8916
|
children: [
|
|
8819
|
-
/* @__PURE__ */ (0,
|
|
8820
|
-
/* @__PURE__ */ (0,
|
|
8821
|
-
(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)(
|
|
8822
8920
|
"button",
|
|
8823
8921
|
{
|
|
8824
8922
|
type: "button",
|
|
@@ -8839,7 +8937,7 @@ var FilterMenu = ({
|
|
|
8839
8937
|
};
|
|
8840
8938
|
|
|
8841
8939
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
8842
|
-
var
|
|
8940
|
+
var import_jsx_runtime85 = require("@emotion/react/jsx-runtime");
|
|
8843
8941
|
var FilterItem = ({
|
|
8844
8942
|
index,
|
|
8845
8943
|
paramOptions,
|
|
@@ -8855,7 +8953,7 @@ var FilterItem = ({
|
|
|
8855
8953
|
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
8856
8954
|
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
8857
8955
|
const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
|
|
8858
|
-
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0,
|
|
8956
|
+
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0, import_react89.useMemo)(() => {
|
|
8859
8957
|
var _a2;
|
|
8860
8958
|
const currentSelectedFilter = filterOptions.find((item) => {
|
|
8861
8959
|
var _a3;
|
|
@@ -8882,11 +8980,11 @@ var FilterItem = ({
|
|
|
8882
8980
|
menuIsOpen: false,
|
|
8883
8981
|
isClearable: false
|
|
8884
8982
|
} : {};
|
|
8885
|
-
return /* @__PURE__ */ (0,
|
|
8886
|
-
/* @__PURE__ */ (0,
|
|
8887
|
-
/* @__PURE__ */ (0,
|
|
8888
|
-
/* @__PURE__ */ (0,
|
|
8889
|
-
|
|
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,
|
|
8890
8988
|
{
|
|
8891
8989
|
"aria-label": label,
|
|
8892
8990
|
options: paramOptions,
|
|
@@ -8912,8 +9010,8 @@ var FilterItem = ({
|
|
|
8912
9010
|
name: `filter-field-${index}`
|
|
8913
9011
|
}
|
|
8914
9012
|
),
|
|
8915
|
-
/* @__PURE__ */ (0,
|
|
8916
|
-
|
|
9013
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
9014
|
+
import_design_system57.InputComboBox,
|
|
8917
9015
|
{
|
|
8918
9016
|
"aria-label": operatorLabel,
|
|
8919
9017
|
options: operatorOptions,
|
|
@@ -8936,7 +9034,7 @@ var FilterItem = ({
|
|
|
8936
9034
|
name: `filter-operator-${index}`
|
|
8937
9035
|
}
|
|
8938
9036
|
),
|
|
8939
|
-
/* @__PURE__ */ (0,
|
|
9037
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8940
9038
|
FilterEditorRenderer,
|
|
8941
9039
|
{
|
|
8942
9040
|
"aria-label": metaDataLabel,
|
|
@@ -8950,7 +9048,7 @@ var FilterItem = ({
|
|
|
8950
9048
|
valueTestId: "filter-value"
|
|
8951
9049
|
}
|
|
8952
9050
|
),
|
|
8953
|
-
readOnly || index === 0 ? null : /* @__PURE__ */ (0,
|
|
9051
|
+
readOnly || index === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8954
9052
|
"button",
|
|
8955
9053
|
{
|
|
8956
9054
|
type: "button",
|
|
@@ -8958,7 +9056,7 @@ var FilterItem = ({
|
|
|
8958
9056
|
"aria-label": "delete filter",
|
|
8959
9057
|
css: IconBtn,
|
|
8960
9058
|
"data-testid": "delete-filter",
|
|
8961
|
-
children: /* @__PURE__ */ (0,
|
|
9059
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_design_system57.Icon, { icon: "trash", iconColor: "red", size: "1rem" })
|
|
8962
9060
|
}
|
|
8963
9061
|
)
|
|
8964
9062
|
] })
|
|
@@ -8974,13 +9072,13 @@ var FilterItems = ({
|
|
|
8974
9072
|
const next = [...filters];
|
|
8975
9073
|
next[index] = { ...next[index], [prop]: value };
|
|
8976
9074
|
if (prop === "operator") {
|
|
8977
|
-
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)) {
|
|
8978
9076
|
next[index].value = next[index].value[0];
|
|
8979
9077
|
}
|
|
8980
9078
|
if (filters[index].operator === "ndef" || filters[index].operator === "def") {
|
|
8981
9079
|
next[index].value = "";
|
|
8982
9080
|
}
|
|
8983
|
-
if (["between"].includes(value) && Array.isArray(next[index].value) === false) {
|
|
9081
|
+
if (!Array.isArray(value) && ["between"].includes(value) && Array.isArray(next[index].value) === false) {
|
|
8984
9082
|
next[index].value = [next[index].value, ""];
|
|
8985
9083
|
}
|
|
8986
9084
|
if (value === "def" || value === "true") {
|
|
@@ -9000,12 +9098,12 @@ var FilterItems = ({
|
|
|
9000
9098
|
}
|
|
9001
9099
|
setFilters(next);
|
|
9002
9100
|
};
|
|
9003
|
-
return /* @__PURE__ */ (0,
|
|
9101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
9004
9102
|
FilterMenu,
|
|
9005
9103
|
{
|
|
9006
9104
|
id: "search-and-filter-options",
|
|
9007
9105
|
dataTestId: "search-and-filter-options",
|
|
9008
|
-
menuControls: /* @__PURE__ */ (0,
|
|
9106
|
+
menuControls: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
9009
9107
|
"button",
|
|
9010
9108
|
{
|
|
9011
9109
|
type: "button",
|
|
@@ -9013,7 +9111,7 @@ var FilterItems = ({
|
|
|
9013
9111
|
onClick: handleAddFilter,
|
|
9014
9112
|
"data-testid": "add-filter",
|
|
9015
9113
|
children: [
|
|
9016
|
-
/* @__PURE__ */ (0,
|
|
9114
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_design_system57.Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
|
|
9017
9115
|
addButtonText
|
|
9018
9116
|
]
|
|
9019
9117
|
}
|
|
@@ -9027,7 +9125,7 @@ var FilterItems = ({
|
|
|
9027
9125
|
})) == null ? void 0 : _a.options) != null ? _b : [];
|
|
9028
9126
|
const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
|
|
9029
9127
|
const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
|
|
9030
|
-
return /* @__PURE__ */ (0,
|
|
9128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
9031
9129
|
FilterItem,
|
|
9032
9130
|
{
|
|
9033
9131
|
index: i,
|
|
@@ -9046,11 +9144,11 @@ var FilterItems = ({
|
|
|
9046
9144
|
};
|
|
9047
9145
|
|
|
9048
9146
|
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
9049
|
-
var
|
|
9147
|
+
var import_design_system59 = require("@uniformdev/design-system");
|
|
9050
9148
|
|
|
9051
9149
|
// src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
|
|
9052
|
-
var
|
|
9053
|
-
var
|
|
9150
|
+
var import_design_system58 = require("@uniformdev/design-system");
|
|
9151
|
+
var import_jsx_runtime86 = require("@emotion/react/jsx-runtime");
|
|
9054
9152
|
var SearchAndFilterResultContainer = ({
|
|
9055
9153
|
buttonText,
|
|
9056
9154
|
clearButtonLabel = "clear",
|
|
@@ -9080,31 +9178,31 @@ var SearchAndFilterResultContainer = ({
|
|
|
9080
9178
|
handleResetFilters();
|
|
9081
9179
|
}
|
|
9082
9180
|
};
|
|
9083
|
-
return /* @__PURE__ */ (0,
|
|
9084
|
-
/* @__PURE__ */ (0,
|
|
9085
|
-
/* @__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: [
|
|
9086
9184
|
totalResults,
|
|
9087
9185
|
" results ",
|
|
9088
9186
|
searchTerm ? `for "${searchTerm}"` : null
|
|
9089
9187
|
] }),
|
|
9090
|
-
!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 })
|
|
9091
9189
|
] }),
|
|
9092
|
-
totalResults === 0 ? /* @__PURE__ */ (0,
|
|
9093
|
-
calloutText ? /* @__PURE__ */ (0,
|
|
9094
|
-
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" })
|
|
9095
9193
|
] }) : null
|
|
9096
9194
|
] });
|
|
9097
9195
|
};
|
|
9098
9196
|
|
|
9099
9197
|
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
9100
|
-
var
|
|
9198
|
+
var import_jsx_runtime87 = require("@emotion/react/jsx-runtime");
|
|
9101
9199
|
var SearchAndFilter = ({
|
|
9102
9200
|
filters,
|
|
9103
9201
|
filterOptions,
|
|
9104
9202
|
filterVisible,
|
|
9105
9203
|
filterControls,
|
|
9106
9204
|
viewSwitchControls,
|
|
9107
|
-
resultsContainerView = /* @__PURE__ */ (0,
|
|
9205
|
+
resultsContainerView = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(SearchAndFilterResultContainer, {}),
|
|
9108
9206
|
filterMapper: filterMapper2 = filterMapper,
|
|
9109
9207
|
additionalFiltersContainer,
|
|
9110
9208
|
onChange,
|
|
@@ -9114,7 +9212,7 @@ var SearchAndFilter = ({
|
|
|
9114
9212
|
allowBindingSearchTerm = false,
|
|
9115
9213
|
resetFilterValues = []
|
|
9116
9214
|
}) => {
|
|
9117
|
-
return /* @__PURE__ */ (0,
|
|
9215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
9118
9216
|
SearchAndFilterProvider,
|
|
9119
9217
|
{
|
|
9120
9218
|
filters,
|
|
@@ -9127,18 +9225,18 @@ var SearchAndFilter = ({
|
|
|
9127
9225
|
resetFilterValues,
|
|
9128
9226
|
filterMapper: filterMapper2,
|
|
9129
9227
|
allowBindingSearchTerm,
|
|
9130
|
-
children: /* @__PURE__ */ (0,
|
|
9131
|
-
/* @__PURE__ */ (0,
|
|
9132
|
-
/* @__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)(
|
|
9133
9231
|
"div",
|
|
9134
9232
|
{
|
|
9135
9233
|
css: SearchAndFilterControlsWrapper(viewSwitchControls ? "auto 1fr 0.05fr" : "auto 1fr"),
|
|
9136
|
-
children: !filterControls ? /* @__PURE__ */ (0,
|
|
9234
|
+
children: !filterControls ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
|
|
9137
9235
|
}
|
|
9138
9236
|
),
|
|
9139
9237
|
viewSwitchControls
|
|
9140
9238
|
] }),
|
|
9141
|
-
/* @__PURE__ */ (0,
|
|
9239
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(FilterItems, { additionalFiltersContainer }),
|
|
9142
9240
|
resultsContainerView
|
|
9143
9241
|
] })
|
|
9144
9242
|
}
|
|
@@ -9146,19 +9244,19 @@ var SearchAndFilter = ({
|
|
|
9146
9244
|
};
|
|
9147
9245
|
|
|
9148
9246
|
// src/components/SearchAndFilter/SearchOnlyFilter.tsx
|
|
9149
|
-
var
|
|
9150
|
-
var
|
|
9151
|
-
var
|
|
9152
|
-
var
|
|
9153
|
-
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)({
|
|
9154
9252
|
searchTerm: "",
|
|
9155
9253
|
setSearchTerm: () => {
|
|
9156
9254
|
}
|
|
9157
9255
|
});
|
|
9158
9256
|
var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
9159
9257
|
const { searchTerm, setSearchTerm } = useSearchAndFilter();
|
|
9160
|
-
const [localeSearchTerm, setLocaleSearchTerm] = (0,
|
|
9161
|
-
(0,
|
|
9258
|
+
const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react90.useState)("");
|
|
9259
|
+
(0, import_react_use11.useDebounce)(
|
|
9162
9260
|
() => {
|
|
9163
9261
|
setSearchTerm(localeSearchTerm);
|
|
9164
9262
|
onSearchChange == null ? void 0 : onSearchChange(localeSearchTerm);
|
|
@@ -9166,15 +9264,15 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
9166
9264
|
300,
|
|
9167
9265
|
[localeSearchTerm]
|
|
9168
9266
|
);
|
|
9169
|
-
return /* @__PURE__ */ (0,
|
|
9267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9170
9268
|
SearchOnlyContext.Provider,
|
|
9171
9269
|
{
|
|
9172
9270
|
value: {
|
|
9173
9271
|
searchTerm,
|
|
9174
9272
|
setSearchTerm: setLocaleSearchTerm
|
|
9175
9273
|
},
|
|
9176
|
-
children: /* @__PURE__ */ (0,
|
|
9177
|
-
|
|
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,
|
|
9178
9276
|
{
|
|
9179
9277
|
placeholder: "Search...",
|
|
9180
9278
|
onSearchTextChanged: (e) => setLocaleSearchTerm(e),
|
|
@@ -9188,18 +9286,18 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
9188
9286
|
};
|
|
9189
9287
|
|
|
9190
9288
|
// src/components/SearchAndFilter/SortItems.tsx
|
|
9191
|
-
var
|
|
9289
|
+
var import_design_system62 = require("@uniformdev/design-system");
|
|
9192
9290
|
|
|
9193
9291
|
// src/components/SearchAndFilter/styles/SortItems.styles.ts
|
|
9194
|
-
var
|
|
9195
|
-
var
|
|
9196
|
-
var ConditionalFilterRow2 =
|
|
9292
|
+
var import_react91 = require("@emotion/react");
|
|
9293
|
+
var import_design_system61 = require("@uniformdev/design-system");
|
|
9294
|
+
var ConditionalFilterRow2 = import_react91.css`
|
|
9197
9295
|
display: grid;
|
|
9198
9296
|
grid-template-columns: 35px 1fr;
|
|
9199
9297
|
gap: var(--spacing-sm);
|
|
9200
9298
|
margin-left: var(--spacing-base);
|
|
9201
9299
|
|
|
9202
|
-
${(0,
|
|
9300
|
+
${(0, import_design_system61.cq)("380px")} {
|
|
9203
9301
|
align-items: center;
|
|
9204
9302
|
|
|
9205
9303
|
&:after {
|
|
@@ -9220,22 +9318,22 @@ var ConditionalFilterRow2 = import_react83.css`
|
|
|
9220
9318
|
grid-template-columns: 50px 1fr;
|
|
9221
9319
|
}
|
|
9222
9320
|
|
|
9223
|
-
${(0,
|
|
9321
|
+
${(0, import_design_system61.cq)("580px")} {
|
|
9224
9322
|
&:after {
|
|
9225
9323
|
display: none;
|
|
9226
9324
|
}
|
|
9227
9325
|
}
|
|
9228
9326
|
|
|
9229
9327
|
@media (prefers-reduced-motion: no-preference) {
|
|
9230
|
-
animation: ${
|
|
9328
|
+
animation: ${import_design_system61.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
9231
9329
|
}
|
|
9232
9330
|
`;
|
|
9233
|
-
var ConditionalInputRow2 =
|
|
9331
|
+
var ConditionalInputRow2 = import_react91.css`
|
|
9234
9332
|
display: flex;
|
|
9235
9333
|
gap: var(--spacing-sm);
|
|
9236
9334
|
flex-wrap: wrap;
|
|
9237
9335
|
|
|
9238
|
-
${(0,
|
|
9336
|
+
${(0, import_design_system61.cq)("380px")} {
|
|
9239
9337
|
& > div:nth-child(-n + 2) {
|
|
9240
9338
|
width: calc(50% - var(--spacing-sm));
|
|
9241
9339
|
}
|
|
@@ -9244,7 +9342,7 @@ var ConditionalInputRow2 = import_react83.css`
|
|
|
9244
9342
|
width: calc(100% - 48px);
|
|
9245
9343
|
}
|
|
9246
9344
|
}
|
|
9247
|
-
${(0,
|
|
9345
|
+
${(0, import_design_system61.cq)("580px")} {
|
|
9248
9346
|
display: grid;
|
|
9249
9347
|
grid-template-columns: 200px 160px 1fr 32px;
|
|
9250
9348
|
|
|
@@ -9253,11 +9351,11 @@ var ConditionalInputRow2 = import_react83.css`
|
|
|
9253
9351
|
}
|
|
9254
9352
|
}
|
|
9255
9353
|
`;
|
|
9256
|
-
var SearchInput2 =
|
|
9354
|
+
var SearchInput2 = import_react91.css`
|
|
9257
9355
|
max-height: 40px;
|
|
9258
9356
|
min-height: unset;
|
|
9259
9357
|
`;
|
|
9260
|
-
var FilterButton3 =
|
|
9358
|
+
var FilterButton3 = import_react91.css`
|
|
9261
9359
|
align-items: center;
|
|
9262
9360
|
background: var(--white);
|
|
9263
9361
|
border: 1px solid var(--gray-300);
|
|
@@ -9293,13 +9391,13 @@ var FilterButton3 = import_react83.css`
|
|
|
9293
9391
|
opacity: var(--opacity-50);
|
|
9294
9392
|
}
|
|
9295
9393
|
`;
|
|
9296
|
-
var FilterButtonText2 =
|
|
9394
|
+
var FilterButtonText2 = import_react91.css`
|
|
9297
9395
|
overflow: hidden;
|
|
9298
9396
|
text-overflow: ellipsis;
|
|
9299
9397
|
white-space: nowrap;
|
|
9300
9398
|
max-width: 14ch;
|
|
9301
9399
|
`;
|
|
9302
|
-
var FilterButtonSelected2 =
|
|
9400
|
+
var FilterButtonSelected2 = import_react91.css`
|
|
9303
9401
|
background: var(--gray-100);
|
|
9304
9402
|
border-color: var(--gray-300);
|
|
9305
9403
|
|
|
@@ -9307,7 +9405,7 @@ var FilterButtonSelected2 = import_react83.css`
|
|
|
9307
9405
|
color: var(--accent-dark);
|
|
9308
9406
|
}
|
|
9309
9407
|
`;
|
|
9310
|
-
var FilterButtonWithOptions2 =
|
|
9408
|
+
var FilterButtonWithOptions2 = import_react91.css`
|
|
9311
9409
|
:where([aria-expanded='true']) {
|
|
9312
9410
|
background: var(--purple-rain-100);
|
|
9313
9411
|
border-color: var(--accent-light);
|
|
@@ -9319,14 +9417,14 @@ var FilterButtonWithOptions2 = import_react83.css`
|
|
|
9319
9417
|
}
|
|
9320
9418
|
}
|
|
9321
9419
|
`;
|
|
9322
|
-
var SearchIcon2 =
|
|
9420
|
+
var SearchIcon2 = import_react91.css`
|
|
9323
9421
|
color: var(--icon-color);
|
|
9324
9422
|
position: absolute;
|
|
9325
9423
|
inset: 0 var(--spacing-base) 0 auto;
|
|
9326
9424
|
margin: auto;
|
|
9327
9425
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
9328
9426
|
`;
|
|
9329
|
-
var AddConditionalBtn2 =
|
|
9427
|
+
var AddConditionalBtn2 = import_react91.css`
|
|
9330
9428
|
align-items: center;
|
|
9331
9429
|
background: transparent;
|
|
9332
9430
|
border: none;
|
|
@@ -9345,14 +9443,14 @@ var AddConditionalBtn2 = import_react83.css`
|
|
|
9345
9443
|
color: var(--gray-400);
|
|
9346
9444
|
}
|
|
9347
9445
|
`;
|
|
9348
|
-
var Title2 =
|
|
9446
|
+
var Title2 = import_react91.css`
|
|
9349
9447
|
color: var(--typography-light);
|
|
9350
9448
|
|
|
9351
9449
|
&:focus {
|
|
9352
9450
|
outline: none;
|
|
9353
9451
|
}
|
|
9354
9452
|
`;
|
|
9355
|
-
var ResetConditionsBtn2 =
|
|
9453
|
+
var ResetConditionsBtn2 = import_react91.css`
|
|
9356
9454
|
background: transparent;
|
|
9357
9455
|
border: none;
|
|
9358
9456
|
color: var(--action-destructive-default);
|
|
@@ -9364,12 +9462,12 @@ var ResetConditionsBtn2 = import_react83.css`
|
|
|
9364
9462
|
color: var(--action-destructive-hover);
|
|
9365
9463
|
}
|
|
9366
9464
|
`;
|
|
9367
|
-
var IconBtn2 =
|
|
9465
|
+
var IconBtn2 = import_react91.css`
|
|
9368
9466
|
background: transparent;
|
|
9369
9467
|
border: none;
|
|
9370
9468
|
padding: var(--spacing-sm);
|
|
9371
9469
|
`;
|
|
9372
|
-
var SearchAndFilterOptionsContainer3 =
|
|
9470
|
+
var SearchAndFilterOptionsContainer3 = import_react91.css`
|
|
9373
9471
|
background: var(--gray-50);
|
|
9374
9472
|
border: 1px solid var(--gray-300);
|
|
9375
9473
|
border-radius: var(--rounded-base);
|
|
@@ -9382,17 +9480,17 @@ var SearchAndFilterOptionsContainer3 = import_react83.css`
|
|
|
9382
9480
|
position: relative;
|
|
9383
9481
|
z-index: 1;
|
|
9384
9482
|
`;
|
|
9385
|
-
var SearchAndFilterOptionsInnerContainer2 =
|
|
9483
|
+
var SearchAndFilterOptionsInnerContainer2 = import_react91.css`
|
|
9386
9484
|
display: flex;
|
|
9387
9485
|
flex-direction: column;
|
|
9388
9486
|
gap: var(--spacing-sm);
|
|
9389
9487
|
padding-inline: var(--spacing-md);
|
|
9390
9488
|
`;
|
|
9391
|
-
var SearchAndFilterButtonGroup2 =
|
|
9489
|
+
var SearchAndFilterButtonGroup2 = import_react91.css`
|
|
9392
9490
|
margin-top: var(--spacing-xs);
|
|
9393
9491
|
margin-left: calc(56px + var(--spacing-md));
|
|
9394
9492
|
`;
|
|
9395
|
-
var SortFilterWrapper = (hiddenLocaleInput) =>
|
|
9493
|
+
var SortFilterWrapper = (hiddenLocaleInput) => import_react91.css`
|
|
9396
9494
|
align-items: center;
|
|
9397
9495
|
border-top: 1px solid var(--gray-300);
|
|
9398
9496
|
display: flex;
|
|
@@ -9402,18 +9500,18 @@ var SortFilterWrapper = (hiddenLocaleInput) => import_react83.css`
|
|
|
9402
9500
|
position: relative;
|
|
9403
9501
|
z-index: 0;
|
|
9404
9502
|
|
|
9405
|
-
${(0,
|
|
9503
|
+
${(0, import_design_system61.cq)("420px")} {
|
|
9406
9504
|
display: grid;
|
|
9407
9505
|
grid-template-columns: ${hiddenLocaleInput ? "1fr" : "1fr minmax(140px, 0.25fr)"};
|
|
9408
9506
|
}
|
|
9409
9507
|
`;
|
|
9410
|
-
var SortFilterInputRow =
|
|
9508
|
+
var SortFilterInputRow = import_react91.css`
|
|
9411
9509
|
align-items: center;
|
|
9412
9510
|
display: grid;
|
|
9413
9511
|
grid-template-columns: 1fr auto;
|
|
9414
9512
|
gap: var(--spacing-base);
|
|
9415
9513
|
`;
|
|
9416
|
-
var InputVariableWrapper =
|
|
9514
|
+
var InputVariableWrapper = import_react91.css`
|
|
9417
9515
|
flex-grow: 1;
|
|
9418
9516
|
|
|
9419
9517
|
// we need to override label styles nested within the input variable
|
|
@@ -9424,7 +9522,7 @@ var InputVariableWrapper = import_react83.css`
|
|
|
9424
9522
|
`;
|
|
9425
9523
|
|
|
9426
9524
|
// src/components/SearchAndFilter/SortItems.tsx
|
|
9427
|
-
var
|
|
9525
|
+
var import_jsx_runtime89 = require("@emotion/react/jsx-runtime");
|
|
9428
9526
|
var SortItems = ({
|
|
9429
9527
|
sortByLabel = "Sort by",
|
|
9430
9528
|
localeLabel = "Show locale",
|
|
@@ -9446,11 +9544,11 @@ var SortItems = ({
|
|
|
9446
9544
|
return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
|
|
9447
9545
|
})) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
|
|
9448
9546
|
const localeLabelValue = sortOptions.length > 1 ? localeLabel : `${localeLabel}s`;
|
|
9449
|
-
return /* @__PURE__ */ (0,
|
|
9450
|
-
/* @__PURE__ */ (0,
|
|
9451
|
-
/* @__PURE__ */ (0,
|
|
9452
|
-
/* @__PURE__ */ (0,
|
|
9453
|
-
/* @__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)(
|
|
9454
9552
|
InputVariables,
|
|
9455
9553
|
{
|
|
9456
9554
|
disableInlineMenu: disableSortBinding,
|
|
@@ -9458,8 +9556,8 @@ var SortItems = ({
|
|
|
9458
9556
|
value: sortField,
|
|
9459
9557
|
valueToResetTo: "created_at",
|
|
9460
9558
|
onChange: (e) => onSortChange(`${e}_${sortDirection}`),
|
|
9461
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
9462
|
-
|
|
9559
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
9560
|
+
import_design_system62.InputComboBox,
|
|
9463
9561
|
{
|
|
9464
9562
|
id: "sort-by-field",
|
|
9465
9563
|
"aria-label": "Sort by",
|
|
@@ -9481,7 +9579,7 @@ var SortItems = ({
|
|
|
9481
9579
|
)
|
|
9482
9580
|
}
|
|
9483
9581
|
),
|
|
9484
|
-
/* @__PURE__ */ (0,
|
|
9582
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
9485
9583
|
InputVariables,
|
|
9486
9584
|
{
|
|
9487
9585
|
disableInlineMenu: disableSortBinding,
|
|
@@ -9489,8 +9587,8 @@ var SortItems = ({
|
|
|
9489
9587
|
valueToResetTo: "DESC",
|
|
9490
9588
|
showMenuPosition: disableSortBinding ? void 0 : "inline-right",
|
|
9491
9589
|
onChange: (e) => onSortChange(`${sortField}_${e}`),
|
|
9492
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
9493
|
-
|
|
9590
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
9591
|
+
import_design_system62.SegmentedControl,
|
|
9494
9592
|
{
|
|
9495
9593
|
noCheckmark: true,
|
|
9496
9594
|
name: "sortBy",
|
|
@@ -9521,15 +9619,15 @@ var SortItems = ({
|
|
|
9521
9619
|
)
|
|
9522
9620
|
] })
|
|
9523
9621
|
] }),
|
|
9524
|
-
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)(
|
|
9525
9623
|
InputVariables,
|
|
9526
9624
|
{
|
|
9527
9625
|
label: localeLabelValue,
|
|
9528
9626
|
value: localeValue,
|
|
9529
9627
|
showMenuPosition: "inline-right",
|
|
9530
9628
|
onChange: (e) => onLocaleChange(e != null ? e : ""),
|
|
9531
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
9532
|
-
|
|
9629
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
9630
|
+
import_design_system62.InputSelect,
|
|
9533
9631
|
{
|
|
9534
9632
|
name: "localeReturned",
|
|
9535
9633
|
"aria-label": localeLabelValue,
|
|
@@ -9559,19 +9657,19 @@ function createLocationValidator(setValue, validate) {
|
|
|
9559
9657
|
|
|
9560
9658
|
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
9561
9659
|
var import_canvas10 = require("@uniformdev/canvas");
|
|
9562
|
-
var
|
|
9660
|
+
var import_react92 = require("react");
|
|
9563
9661
|
function useContentDataResourceLocaleInfo({
|
|
9564
9662
|
locale,
|
|
9565
9663
|
setLocale,
|
|
9566
9664
|
dynamicInputs
|
|
9567
9665
|
}) {
|
|
9568
9666
|
var _a;
|
|
9569
|
-
const setLocaleRef = (0,
|
|
9667
|
+
const setLocaleRef = (0, import_react92.useRef)(setLocale);
|
|
9570
9668
|
setLocaleRef.current = setLocale;
|
|
9571
9669
|
const { flatVariables } = useVariables();
|
|
9572
9670
|
const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas10.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME) : "";
|
|
9573
9671
|
const boundLocale = (_a = (0, import_canvas10.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
9574
|
-
(0,
|
|
9672
|
+
(0, import_react92.useEffect)(() => {
|
|
9575
9673
|
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
9576
9674
|
setLocaleRef.current((0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME));
|
|
9577
9675
|
}
|
|
@@ -9580,7 +9678,7 @@ function useContentDataResourceLocaleInfo({
|
|
|
9580
9678
|
}
|
|
9581
9679
|
|
|
9582
9680
|
// src/index.ts
|
|
9583
|
-
var
|
|
9681
|
+
var import_design_system63 = require("@uniformdev/design-system");
|
|
9584
9682
|
__reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
9585
9683
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9586
9684
|
0 && (module.exports = {
|