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