@uniformdev/mesh-sdk-react 19.158.0 → 19.159.1-alpha.16
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 +96 -129
- package/dist/index.d.ts +96 -129
- package/dist/index.esm.js +766 -622
- package/dist/index.js +824 -693
- package/dist/index.mjs +766 -622
- package/package.json +6 -6
package/dist/index.esm.js
CHANGED
|
@@ -7632,312 +7632,198 @@ var MULTI_SELECT_OPERATORS = [
|
|
|
7632
7632
|
editorType: "empty"
|
|
7633
7633
|
}
|
|
7634
7634
|
];
|
|
7635
|
+
var WORKFLOW_STAGES_OPERATORS = [
|
|
7636
|
+
{
|
|
7637
|
+
label: "is",
|
|
7638
|
+
value: "eq",
|
|
7639
|
+
editorType: "singleChoice"
|
|
7640
|
+
},
|
|
7641
|
+
{
|
|
7642
|
+
label: "is any of...",
|
|
7643
|
+
value: "in",
|
|
7644
|
+
editorType: "multiChoice"
|
|
7645
|
+
},
|
|
7646
|
+
{
|
|
7647
|
+
label: "is not",
|
|
7648
|
+
value: "neq",
|
|
7649
|
+
editorType: "singleChoice"
|
|
7650
|
+
},
|
|
7651
|
+
{
|
|
7652
|
+
label: "is none of...",
|
|
7653
|
+
value: "nin",
|
|
7654
|
+
editorType: "multiChoice"
|
|
7655
|
+
}
|
|
7656
|
+
];
|
|
7635
7657
|
|
|
7636
|
-
// src/components/SearchAndFilter/
|
|
7637
|
-
import {
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
import {
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
&:after {
|
|
7664
|
-
content: '';
|
|
7665
|
-
display: block;
|
|
7666
|
-
height: 1px;
|
|
7667
|
-
background: var(--gray-300);
|
|
7668
|
-
width: calc(100% - var(--spacing-base));
|
|
7669
|
-
margin-left: var(--spacing-base);
|
|
7670
|
-
}
|
|
7671
|
-
&:last-of-type:after {
|
|
7672
|
-
display: none;
|
|
7658
|
+
// src/components/SearchAndFilter/editors/DateEditor.tsx
|
|
7659
|
+
import { Input as Input6 } from "@uniformdev/design-system";
|
|
7660
|
+
import { useState as useState19 } from "react";
|
|
7661
|
+
import { useDebounce as useDebounce4 } from "react-use";
|
|
7662
|
+
import { jsx as jsx69 } from "@emotion/react/jsx-runtime";
|
|
7663
|
+
var DateEditor = ({
|
|
7664
|
+
onChange,
|
|
7665
|
+
ariaLabel,
|
|
7666
|
+
disabled,
|
|
7667
|
+
value,
|
|
7668
|
+
readOnly,
|
|
7669
|
+
valueTestId
|
|
7670
|
+
}) => {
|
|
7671
|
+
const [innerValue, setInnerValue] = useState19(value != null ? value : "");
|
|
7672
|
+
useDebounce4(() => onChange(innerValue), 500, [innerValue]);
|
|
7673
|
+
return /* @__PURE__ */ jsx69(
|
|
7674
|
+
Input6,
|
|
7675
|
+
{
|
|
7676
|
+
type: "date",
|
|
7677
|
+
label: ariaLabel,
|
|
7678
|
+
showLabel: false,
|
|
7679
|
+
onChange: (e) => setInnerValue(e.currentTarget.value),
|
|
7680
|
+
disabled,
|
|
7681
|
+
value: innerValue,
|
|
7682
|
+
readOnly,
|
|
7683
|
+
"data-testid": valueTestId
|
|
7673
7684
|
}
|
|
7674
|
-
|
|
7685
|
+
);
|
|
7686
|
+
};
|
|
7675
7687
|
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7688
|
+
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
7689
|
+
import { Input as Input7 } from "@uniformdev/design-system";
|
|
7690
|
+
import { useEffect as useEffect19, useState as useState20 } from "react";
|
|
7691
|
+
import { useDebounce as useDebounce5 } from "react-use";
|
|
7680
7692
|
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7693
|
+
// src/components/SearchAndFilter/editors/shared/ErrorContainer.tsx
|
|
7694
|
+
import { FieldMessage } from "@uniformdev/design-system";
|
|
7695
|
+
import { jsx as jsx70 } from "@emotion/react/jsx-runtime";
|
|
7696
|
+
var ErrorContainer = ({ errorMessage }) => {
|
|
7697
|
+
return /* @__PURE__ */ jsx70(
|
|
7698
|
+
"div",
|
|
7699
|
+
{
|
|
7700
|
+
css: {
|
|
7701
|
+
gridColumn: "span 6",
|
|
7702
|
+
order: 6
|
|
7703
|
+
},
|
|
7704
|
+
children: /* @__PURE__ */ jsx70(FieldMessage, { errorMessage })
|
|
7684
7705
|
}
|
|
7685
|
-
|
|
7706
|
+
);
|
|
7707
|
+
};
|
|
7686
7708
|
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
var
|
|
7692
|
-
|
|
7693
|
-
gap: var(--spacing-sm);
|
|
7694
|
-
flex-wrap: wrap;
|
|
7709
|
+
// src/components/SearchAndFilter/editors/shared/twoColumnGrid.tsx
|
|
7710
|
+
var twoColumnGrid = {
|
|
7711
|
+
display: "grid",
|
|
7712
|
+
gridTemplateColumns: "1fr 1fr",
|
|
7713
|
+
gap: "var(--spacing-sm);"
|
|
7714
|
+
};
|
|
7695
7715
|
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7716
|
+
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
7717
|
+
import { Fragment as Fragment14, jsx as jsx71, jsxs as jsxs42 } from "@emotion/react/jsx-runtime";
|
|
7718
|
+
var DateRangeEditor = ({
|
|
7719
|
+
ariaLabel,
|
|
7720
|
+
onChange,
|
|
7721
|
+
disabled,
|
|
7722
|
+
value,
|
|
7723
|
+
readOnly,
|
|
7724
|
+
valueTestId
|
|
7725
|
+
}) => {
|
|
7726
|
+
const [minDateValue, setMinDateValue] = useState20(value ? value[0] : "");
|
|
7727
|
+
const [maxDateValue, setMaxDateValue] = useState20(value ? value[1] : "");
|
|
7728
|
+
const [error, setError] = useState20("");
|
|
7729
|
+
useDebounce5(
|
|
7730
|
+
() => {
|
|
7731
|
+
if (minDateValue && maxDateValue && !error) {
|
|
7732
|
+
onChange([minDateValue, maxDateValue]);
|
|
7733
|
+
} else {
|
|
7734
|
+
onChange([]);
|
|
7735
|
+
}
|
|
7736
|
+
},
|
|
7737
|
+
500,
|
|
7738
|
+
[minDateValue, maxDateValue]
|
|
7739
|
+
);
|
|
7740
|
+
useEffect19(() => {
|
|
7741
|
+
if (!minDateValue || !maxDateValue) {
|
|
7742
|
+
return;
|
|
7699
7743
|
}
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7744
|
+
const minDate = new Date(minDateValue);
|
|
7745
|
+
const maxDate = new Date(maxDateValue);
|
|
7746
|
+
if (maxDate < minDate) {
|
|
7747
|
+
setError("The max date cannot be lower than the min date");
|
|
7748
|
+
return;
|
|
7703
7749
|
}
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
grid-template-columns: 200px 160px 1fr 32px;
|
|
7708
|
-
|
|
7709
|
-
& > div:nth-child(n) {
|
|
7710
|
-
width: auto;
|
|
7750
|
+
if (maxDate && !minDate) {
|
|
7751
|
+
setError("Please enter both a low and high date");
|
|
7752
|
+
return;
|
|
7711
7753
|
}
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
`;
|
|
7718
|
-
var BindableKeywordSearchInputStyles = css38`
|
|
7719
|
-
position: relative;
|
|
7720
|
-
width: 100%;
|
|
7721
|
-
|
|
7722
|
-
& [data-lexical-editor='true'] {
|
|
7723
|
-
padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
|
|
7724
|
-
font-size: var(--fs-sm);
|
|
7725
|
-
border-radius: var(--rounded-full);
|
|
7726
|
-
max-height: 40px;
|
|
7727
|
-
min-height: unset;
|
|
7728
|
-
width: 100%;
|
|
7729
|
-
position: relative;
|
|
7730
|
-
white-space: nowrap;
|
|
7731
|
-
}
|
|
7732
|
-
`;
|
|
7733
|
-
var ClearSearchButtonContainer = css38`
|
|
7734
|
-
align-items: center;
|
|
7735
|
-
display: flex;
|
|
7736
|
-
position: absolute;
|
|
7737
|
-
inset: 0 var(--spacing-lg) 0 auto;
|
|
7738
|
-
`;
|
|
7739
|
-
var ClearSearchButtonStyles = css38`
|
|
7740
|
-
background: none;
|
|
7741
|
-
border: none;
|
|
7742
|
-
padding: 0;
|
|
7743
|
-
pointer-events: all;
|
|
7744
|
-
`;
|
|
7745
|
-
var FilterButton = css38`
|
|
7746
|
-
align-items: center;
|
|
7747
|
-
background: var(--white);
|
|
7748
|
-
border: 1px solid var(--gray-300);
|
|
7749
|
-
border-radius: var(--rounded-full);
|
|
7750
|
-
color: var(--typography-base);
|
|
7751
|
-
display: flex;
|
|
7752
|
-
font-size: var(--fs-sm);
|
|
7753
|
-
gap: var(--spacing-sm);
|
|
7754
|
-
padding: var(--spacing-sm) var(--spacing-base);
|
|
7755
|
-
max-height: 40px;
|
|
7756
|
-
transition: color var(--duration-fast) var(--timing-ease-out),
|
|
7757
|
-
background-color var(--duration-fast) var(--timing-ease-out),
|
|
7758
|
-
border-color var(--duration-fast) var(--timing-ease-out),
|
|
7759
|
-
box-shadow var(--duration-fast) var(--timing-ease-out);
|
|
7760
|
-
|
|
7761
|
-
svg {
|
|
7762
|
-
color: var(--gray-300);
|
|
7763
|
-
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7764
|
-
}
|
|
7765
|
-
|
|
7766
|
-
&:hover,
|
|
7767
|
-
:where([aria-expanded='true']) {
|
|
7768
|
-
outline: none;
|
|
7769
|
-
background: var(--gray-200);
|
|
7770
|
-
border-color: var(--gray-300);
|
|
7771
|
-
|
|
7772
|
-
svg {
|
|
7773
|
-
color: var(--typography-base);
|
|
7754
|
+
const minDateString = minDate.toDateString();
|
|
7755
|
+
const maxDateString = maxDate.toDateString();
|
|
7756
|
+
if (minDateString === maxDateString || maxDateString === minDateString) {
|
|
7757
|
+
setError("The min and max date cannot be the same");
|
|
7758
|
+
return;
|
|
7774
7759
|
}
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
opacity: var(--opacity-50);
|
|
7779
|
-
}
|
|
7780
|
-
`;
|
|
7781
|
-
var FilterButtonText = css38`
|
|
7782
|
-
overflow: hidden;
|
|
7783
|
-
text-overflow: ellipsis;
|
|
7784
|
-
white-space: nowrap;
|
|
7785
|
-
max-width: 14ch;
|
|
7786
|
-
`;
|
|
7787
|
-
var FilterButtonSelected = css38`
|
|
7788
|
-
background: var(--gray-100);
|
|
7789
|
-
border-color: var(--gray-300);
|
|
7790
|
-
|
|
7791
|
-
svg {
|
|
7792
|
-
color: var(--accent-dark);
|
|
7793
|
-
}
|
|
7794
|
-
`;
|
|
7795
|
-
var FilterButtonWithOptions = css38`
|
|
7796
|
-
:where([aria-expanded='true']) {
|
|
7797
|
-
background: var(--purple-rain-100);
|
|
7798
|
-
border-color: var(--accent-light);
|
|
7799
|
-
color: var(--typography-base);
|
|
7800
|
-
box-shadow: var(--elevation-100);
|
|
7801
|
-
|
|
7802
|
-
svg {
|
|
7803
|
-
color: var(--accent-dark);
|
|
7760
|
+
if (minDate > maxDate) {
|
|
7761
|
+
setError("The min date cannot be higher than the max date");
|
|
7762
|
+
return;
|
|
7804
7763
|
}
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
var SearchIcon = css38`
|
|
7808
|
-
color: var(--icon-color);
|
|
7809
|
-
position: absolute;
|
|
7810
|
-
inset: 0 var(--spacing-base) 0 auto;
|
|
7811
|
-
margin: auto;
|
|
7812
|
-
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7813
|
-
`;
|
|
7814
|
-
var AddConditionalBtn = css38`
|
|
7815
|
-
align-items: center;
|
|
7816
|
-
background: transparent;
|
|
7817
|
-
border: none;
|
|
7818
|
-
color: var(--primary-action-default);
|
|
7819
|
-
display: flex;
|
|
7820
|
-
gap: var(--spacing-sm);
|
|
7821
|
-
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7822
|
-
padding: 0;
|
|
7823
|
-
|
|
7824
|
-
&:hover,
|
|
7825
|
-
&:focus {
|
|
7826
|
-
color: var(--primary-action-hover);
|
|
7827
|
-
}
|
|
7828
|
-
|
|
7829
|
-
&:disabled {
|
|
7830
|
-
color: var(--gray-400);
|
|
7831
|
-
}
|
|
7832
|
-
`;
|
|
7833
|
-
var Title = css38`
|
|
7834
|
-
color: var(--typography-light);
|
|
7835
|
-
|
|
7836
|
-
&:focus {
|
|
7837
|
-
outline: none;
|
|
7838
|
-
}
|
|
7839
|
-
`;
|
|
7840
|
-
var ResetConditionsBtn = css38`
|
|
7841
|
-
background: transparent;
|
|
7842
|
-
border: none;
|
|
7843
|
-
color: var(--action-destructive-default);
|
|
7844
|
-
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7845
|
-
padding: 0;
|
|
7846
|
-
|
|
7847
|
-
&:hover,
|
|
7848
|
-
&:focus {
|
|
7849
|
-
color: var(--action-destructive-hover);
|
|
7850
|
-
}
|
|
7851
|
-
`;
|
|
7852
|
-
var IconBtn = css38`
|
|
7853
|
-
background: transparent;
|
|
7854
|
-
border: none;
|
|
7855
|
-
padding: var(--spacing-sm);
|
|
7856
|
-
`;
|
|
7857
|
-
var SearchAndFilterOptionsContainer = css38`
|
|
7858
|
-
background: var(--gray-50);
|
|
7859
|
-
border: 1px solid var(--gray-300);
|
|
7860
|
-
border-radius: var(--rounded-base);
|
|
7861
|
-
container-type: inline-size;
|
|
7862
|
-
display: flex;
|
|
7863
|
-
flex-direction: column;
|
|
7864
|
-
gap: var(--spacing-sm);
|
|
7865
|
-
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
7866
|
-
will-change: height;
|
|
7867
|
-
position: relative;
|
|
7868
|
-
z-index: 1;
|
|
7869
|
-
`;
|
|
7870
|
-
var SearchAndFilterOptionsInnerContainer = css38`
|
|
7871
|
-
display: flex;
|
|
7872
|
-
flex-direction: column;
|
|
7873
|
-
gap: var(--spacing-sm);
|
|
7874
|
-
padding-inline: var(--spacing-md);
|
|
7875
|
-
`;
|
|
7876
|
-
var SearchAndFilterButtonGroup = css38`
|
|
7877
|
-
margin-top: var(--spacing-xs);
|
|
7878
|
-
margin-left: calc(56px + var(--spacing-md));
|
|
7879
|
-
`;
|
|
7880
|
-
|
|
7881
|
-
// src/components/SearchAndFilter/FilterButton.tsx
|
|
7882
|
-
import { jsx as jsx69, jsxs as jsxs42 } from "@emotion/react/jsx-runtime";
|
|
7883
|
-
var FilterButton2 = ({
|
|
7884
|
-
text = "Filters",
|
|
7885
|
-
icon = "filter-add",
|
|
7886
|
-
filterCount,
|
|
7887
|
-
hasSelectedValue,
|
|
7888
|
-
dataTestId,
|
|
7889
|
-
...props
|
|
7890
|
-
}) => {
|
|
7891
|
-
return /* @__PURE__ */ jsxs42(
|
|
7892
|
-
"button",
|
|
7893
|
-
{
|
|
7894
|
-
type: "button",
|
|
7895
|
-
css: [
|
|
7896
|
-
FilterButton,
|
|
7897
|
-
hasSelectedValue ? FilterButtonSelected : void 0,
|
|
7898
|
-
filterCount ? [FilterButtonWithOptions, FilterButtonSelected] : void 0
|
|
7899
|
-
],
|
|
7900
|
-
...props,
|
|
7901
|
-
"data-testid": dataTestId,
|
|
7902
|
-
children: [
|
|
7903
|
-
/* @__PURE__ */ jsx69(Icon6, { icon, iconColor: "currentColor", size: "1rem" }),
|
|
7904
|
-
/* @__PURE__ */ jsx69("span", { css: FilterButtonText, children: text }),
|
|
7905
|
-
filterCount ? /* @__PURE__ */ jsx69(Counter2, { count: filterCount, bgColor: "var(--white)" }) : null
|
|
7906
|
-
]
|
|
7764
|
+
if (error) {
|
|
7765
|
+
setError("");
|
|
7907
7766
|
}
|
|
7908
|
-
|
|
7767
|
+
if (minDate && maxDate) {
|
|
7768
|
+
setMinDateValue(minDateValue);
|
|
7769
|
+
setMaxDateValue(maxDateValue);
|
|
7770
|
+
} else {
|
|
7771
|
+
setMinDateValue("");
|
|
7772
|
+
setMaxDateValue("");
|
|
7773
|
+
}
|
|
7774
|
+
}, [minDateValue, maxDateValue, setError]);
|
|
7775
|
+
return /* @__PURE__ */ jsxs42(Fragment14, { children: [
|
|
7776
|
+
/* @__PURE__ */ jsxs42("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
7777
|
+
/* @__PURE__ */ jsx71(
|
|
7778
|
+
Input7,
|
|
7779
|
+
{
|
|
7780
|
+
label: `${ariaLabel}-min-date`,
|
|
7781
|
+
type: "date",
|
|
7782
|
+
showLabel: false,
|
|
7783
|
+
value: minDateValue,
|
|
7784
|
+
onChange: (e) => setMinDateValue(e.currentTarget.value),
|
|
7785
|
+
"aria-invalid": !error ? false : true,
|
|
7786
|
+
disabled,
|
|
7787
|
+
readOnly,
|
|
7788
|
+
"data-testid": "value-low"
|
|
7789
|
+
}
|
|
7790
|
+
),
|
|
7791
|
+
/* @__PURE__ */ jsx71(
|
|
7792
|
+
Input7,
|
|
7793
|
+
{
|
|
7794
|
+
label: `${ariaLabel}-max-date`,
|
|
7795
|
+
type: "date",
|
|
7796
|
+
showLabel: false,
|
|
7797
|
+
value: maxDateValue,
|
|
7798
|
+
onChange: (e) => setMaxDateValue(e.currentTarget.value),
|
|
7799
|
+
"aria-invalid": !error ? false : true,
|
|
7800
|
+
disabled,
|
|
7801
|
+
readOnly,
|
|
7802
|
+
"data-testid": "value-high"
|
|
7803
|
+
}
|
|
7804
|
+
)
|
|
7805
|
+
] }),
|
|
7806
|
+
/* @__PURE__ */ jsx71(ErrorContainer, { errorMessage: error })
|
|
7807
|
+
] });
|
|
7909
7808
|
};
|
|
7910
7809
|
|
|
7911
|
-
// src/components/SearchAndFilter/
|
|
7912
|
-
import { CgClose as CgClose5 } from "@react-icons/all-files/cg/CgClose";
|
|
7913
|
-
import { Icon as Icon7, InputKeywordSearch as InputKeywordSearch2 } from "@uniformdev/design-system";
|
|
7914
|
-
import { CLEAR_EDITOR_COMMAND as CLEAR_EDITOR_COMMAND2 } from "lexical";
|
|
7915
|
-
import { useEffect as useEffect21, useRef as useRef16, useState as useState21 } from "react";
|
|
7916
|
-
import { useDebounce as useDebounce5 } from "react-use";
|
|
7917
|
-
import { v4 as v43 } from "uuid";
|
|
7918
|
-
|
|
7919
|
-
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
7920
|
-
import { VerticalRhythm as VerticalRhythm5 } from "@uniformdev/design-system";
|
|
7810
|
+
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
7921
7811
|
import {
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
useMemo as useMemo17,
|
|
7928
|
-
useState as useState20
|
|
7929
|
-
} from "react";
|
|
7812
|
+
convertComboBoxGroupsToSelectableGroups,
|
|
7813
|
+
getComboBoxSelectedSelectableGroups,
|
|
7814
|
+
InputComboBox
|
|
7815
|
+
} from "@uniformdev/design-system";
|
|
7816
|
+
import { useMemo as useMemo17 } from "react";
|
|
7930
7817
|
|
|
7931
|
-
// src/components/SearchAndFilter/
|
|
7932
|
-
import { FieldMessage, Input as Input6, InputComboBox, StatusBullet } from "@uniformdev/design-system";
|
|
7933
|
-
import { useEffect as useEffect19, useState as useState19 } from "react";
|
|
7934
|
-
import { useDebounce as useDebounce4 } from "react-use";
|
|
7935
|
-
import { Fragment as Fragment14, jsx as jsx70, jsxs as jsxs43 } from "@emotion/react/jsx-runtime";
|
|
7818
|
+
// src/components/SearchAndFilter/editors/shared/readOnlyAttributes.tsx
|
|
7936
7819
|
var readOnlyAttributes = {
|
|
7937
7820
|
isSearchable: false,
|
|
7938
7821
|
menuIsOpen: false,
|
|
7939
7822
|
isClearable: false
|
|
7940
7823
|
};
|
|
7824
|
+
|
|
7825
|
+
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
7826
|
+
import { jsx as jsx72 } from "@emotion/react/jsx-runtime";
|
|
7941
7827
|
var FilterMultiChoiceEditor = ({
|
|
7942
7828
|
value,
|
|
7943
7829
|
options,
|
|
@@ -7948,20 +7834,24 @@ var FilterMultiChoiceEditor = ({
|
|
|
7948
7834
|
}) => {
|
|
7949
7835
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
7950
7836
|
const isClearable = !readOnly || !disabled;
|
|
7951
|
-
|
|
7837
|
+
const { groupedOptions, selectedOptions } = useMemo17(
|
|
7838
|
+
() => convertComboBoxGroupsToSelectableGroups({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
7839
|
+
[options, value]
|
|
7840
|
+
);
|
|
7841
|
+
return /* @__PURE__ */ jsx72("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx72(
|
|
7952
7842
|
InputComboBox,
|
|
7953
7843
|
{
|
|
7954
7844
|
...props,
|
|
7955
7845
|
placeholder: "Type to search...",
|
|
7956
|
-
options,
|
|
7846
|
+
options: groupedOptions,
|
|
7957
7847
|
isMulti: true,
|
|
7958
7848
|
isClearable,
|
|
7959
7849
|
isDisabled: disabled,
|
|
7960
7850
|
onChange: (e) => {
|
|
7961
|
-
|
|
7962
|
-
return props.onChange(
|
|
7851
|
+
const selectedValues = getComboBoxSelectedSelectableGroups(e);
|
|
7852
|
+
return props.onChange([...selectedValues]);
|
|
7963
7853
|
},
|
|
7964
|
-
value:
|
|
7854
|
+
value: selectedOptions,
|
|
7965
7855
|
"aria-readonly": readOnly,
|
|
7966
7856
|
styles: {
|
|
7967
7857
|
menu(base) {
|
|
@@ -7975,6 +7865,14 @@ var FilterMultiChoiceEditor = ({
|
|
|
7975
7865
|
}
|
|
7976
7866
|
) });
|
|
7977
7867
|
};
|
|
7868
|
+
|
|
7869
|
+
// src/components/SearchAndFilter/editors/FilterSingleChoiceEditor.tsx
|
|
7870
|
+
import {
|
|
7871
|
+
convertComboBoxGroupsToSelectableGroups as convertComboBoxGroupsToSelectableGroups2,
|
|
7872
|
+
InputComboBox as InputComboBox2
|
|
7873
|
+
} from "@uniformdev/design-system";
|
|
7874
|
+
import { useMemo as useMemo18 } from "react";
|
|
7875
|
+
import { jsx as jsx73 } from "@emotion/react/jsx-runtime";
|
|
7978
7876
|
var FilterSingleChoiceEditor = ({
|
|
7979
7877
|
options,
|
|
7980
7878
|
value,
|
|
@@ -7983,91 +7881,30 @@ var FilterSingleChoiceEditor = ({
|
|
|
7983
7881
|
onChange,
|
|
7984
7882
|
valueTestId
|
|
7985
7883
|
}) => {
|
|
7986
|
-
var _a;
|
|
7987
7884
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
7988
|
-
|
|
7989
|
-
|
|
7885
|
+
const { groupedOptions, selectedOptions } = useMemo18(
|
|
7886
|
+
() => convertComboBoxGroupsToSelectableGroups2({
|
|
7887
|
+
options: options != null ? options : [],
|
|
7888
|
+
selectedItems: new Set(value ? [value] : void 0),
|
|
7889
|
+
selectionMode: "single"
|
|
7890
|
+
}),
|
|
7891
|
+
[options, value]
|
|
7892
|
+
);
|
|
7893
|
+
return /* @__PURE__ */ jsx73("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx73(
|
|
7894
|
+
InputComboBox2,
|
|
7990
7895
|
{
|
|
7991
7896
|
placeholder: "Type to search...",
|
|
7992
|
-
options,
|
|
7897
|
+
options: groupedOptions,
|
|
7993
7898
|
isClearable: true,
|
|
7994
7899
|
onChange: (e) => {
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
},
|
|
7998
|
-
isDisabled: disabled,
|
|
7999
|
-
value: (_a = options == null ? void 0 : options.find((option) => option.value === value)) != null ? _a : null,
|
|
8000
|
-
"aria-readonly": readOnly,
|
|
8001
|
-
styles: {
|
|
8002
|
-
menu(base) {
|
|
8003
|
-
return {
|
|
8004
|
-
...base,
|
|
8005
|
-
minWidth: "max-content"
|
|
8006
|
-
};
|
|
7900
|
+
if (Array.isArray(e == null ? void 0 : e.value)) {
|
|
7901
|
+
return;
|
|
8007
7902
|
}
|
|
7903
|
+
return onChange(e == null ? void 0 : e.value);
|
|
8008
7904
|
},
|
|
8009
|
-
...readOnlyProps
|
|
8010
|
-
}
|
|
8011
|
-
) });
|
|
8012
|
-
};
|
|
8013
|
-
var CustomOptions = ({ label, value }) => {
|
|
8014
|
-
return /* @__PURE__ */ jsx70(StatusBullet, { status: label, message: value });
|
|
8015
|
-
};
|
|
8016
|
-
var StatusMultiEditor = ({
|
|
8017
|
-
options,
|
|
8018
|
-
value,
|
|
8019
|
-
disabled,
|
|
8020
|
-
readOnly,
|
|
8021
|
-
onChange,
|
|
8022
|
-
valueTestId
|
|
8023
|
-
}) => {
|
|
8024
|
-
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8025
|
-
return /* @__PURE__ */ jsx70("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx70(
|
|
8026
|
-
InputComboBox,
|
|
8027
|
-
{
|
|
8028
|
-
options,
|
|
8029
|
-
isMulti: true,
|
|
8030
|
-
onChange: (e) => {
|
|
8031
|
-
var _a;
|
|
8032
|
-
return onChange((_a = e.map((item) => item.value)) != null ? _a : []);
|
|
8033
|
-
},
|
|
8034
|
-
formatOptionLabel: CustomOptions,
|
|
8035
|
-
"aria-readonly": readOnly,
|
|
8036
|
-
value: options == null ? void 0 : options.filter((option) => value == null ? void 0 : value.includes(option.value)),
|
|
8037
7905
|
isDisabled: disabled,
|
|
8038
|
-
|
|
8039
|
-
menu(base) {
|
|
8040
|
-
return {
|
|
8041
|
-
...base,
|
|
8042
|
-
minWidth: "max-content"
|
|
8043
|
-
};
|
|
8044
|
-
}
|
|
8045
|
-
},
|
|
8046
|
-
...readOnlyProps
|
|
8047
|
-
}
|
|
8048
|
-
) });
|
|
8049
|
-
};
|
|
8050
|
-
var StatusSingleEditor = ({
|
|
8051
|
-
options,
|
|
8052
|
-
value,
|
|
8053
|
-
disabled,
|
|
8054
|
-
readOnly,
|
|
8055
|
-
onChange,
|
|
8056
|
-
valueTestId
|
|
8057
|
-
}) => {
|
|
8058
|
-
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8059
|
-
return /* @__PURE__ */ jsx70("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx70(
|
|
8060
|
-
InputComboBox,
|
|
8061
|
-
{
|
|
8062
|
-
options,
|
|
8063
|
-
onChange: (e) => {
|
|
8064
|
-
var _a;
|
|
8065
|
-
return onChange((_a = e == null ? void 0 : e.value) != null ? _a : "");
|
|
8066
|
-
},
|
|
8067
|
-
formatOptionLabel: CustomOptions,
|
|
7906
|
+
value: selectedOptions,
|
|
8068
7907
|
"aria-readonly": readOnly,
|
|
8069
|
-
value: options == null ? void 0 : options.find((option) => option.value === value),
|
|
8070
|
-
isDisabled: disabled,
|
|
8071
7908
|
styles: {
|
|
8072
7909
|
menu(base) {
|
|
8073
7910
|
return {
|
|
@@ -8080,28 +7917,43 @@ var StatusSingleEditor = ({
|
|
|
8080
7917
|
}
|
|
8081
7918
|
) });
|
|
8082
7919
|
};
|
|
8083
|
-
|
|
8084
|
-
|
|
7920
|
+
|
|
7921
|
+
// src/components/SearchAndFilter/editors/NumberEditor.tsx
|
|
7922
|
+
import { Input as Input8 } from "@uniformdev/design-system";
|
|
7923
|
+
import { useState as useState21 } from "react";
|
|
7924
|
+
import { useDebounce as useDebounce6 } from "react-use";
|
|
7925
|
+
import { jsx as jsx74 } from "@emotion/react/jsx-runtime";
|
|
7926
|
+
var NumberEditor = ({
|
|
8085
7927
|
ariaLabel,
|
|
7928
|
+
onChange,
|
|
7929
|
+
disabled,
|
|
8086
7930
|
value,
|
|
8087
7931
|
readOnly,
|
|
8088
7932
|
valueTestId
|
|
8089
7933
|
}) => {
|
|
8090
|
-
const [innerValue, setInnerValue] =
|
|
8091
|
-
|
|
8092
|
-
return /* @__PURE__ */
|
|
8093
|
-
|
|
7934
|
+
const [innerValue, setInnerValue] = useState21(value != null ? value : "");
|
|
7935
|
+
useDebounce6(() => onChange(innerValue), 500, [innerValue]);
|
|
7936
|
+
return /* @__PURE__ */ jsx74(
|
|
7937
|
+
Input8,
|
|
8094
7938
|
{
|
|
7939
|
+
label: ariaLabel,
|
|
7940
|
+
type: "number",
|
|
8095
7941
|
showLabel: false,
|
|
8096
|
-
|
|
7942
|
+
min: 0,
|
|
8097
7943
|
onChange: (e) => setInnerValue(e.currentTarget.value),
|
|
8098
|
-
|
|
7944
|
+
disabled,
|
|
8099
7945
|
value: innerValue,
|
|
8100
7946
|
readOnly,
|
|
8101
7947
|
"data-testid": valueTestId
|
|
8102
7948
|
}
|
|
8103
7949
|
);
|
|
8104
7950
|
};
|
|
7951
|
+
|
|
7952
|
+
// src/components/SearchAndFilter/editors/NumberRangeEditor.tsx
|
|
7953
|
+
import { Input as Input9 } from "@uniformdev/design-system";
|
|
7954
|
+
import { useEffect as useEffect20, useState as useState22 } from "react";
|
|
7955
|
+
import { useDebounce as useDebounce7 } from "react-use";
|
|
7956
|
+
import { Fragment as Fragment15, jsx as jsx75, jsxs as jsxs43 } from "@emotion/react/jsx-runtime";
|
|
8105
7957
|
var NumberRangeEditor = ({
|
|
8106
7958
|
onChange,
|
|
8107
7959
|
disabled,
|
|
@@ -8110,10 +7962,10 @@ var NumberRangeEditor = ({
|
|
|
8110
7962
|
readOnly,
|
|
8111
7963
|
valueTestId
|
|
8112
7964
|
}) => {
|
|
8113
|
-
const [minValue, setMinValue] =
|
|
8114
|
-
const [maxValue, setMaxValue] =
|
|
8115
|
-
const [error, setError] =
|
|
8116
|
-
|
|
7965
|
+
const [minValue, setMinValue] = useState22("");
|
|
7966
|
+
const [maxValue, setMaxValue] = useState22("");
|
|
7967
|
+
const [error, setError] = useState22("");
|
|
7968
|
+
useDebounce7(
|
|
8117
7969
|
() => {
|
|
8118
7970
|
if (minValue && maxValue && !error) {
|
|
8119
7971
|
onChange([minValue, maxValue]);
|
|
@@ -8124,7 +7976,7 @@ var NumberRangeEditor = ({
|
|
|
8124
7976
|
500,
|
|
8125
7977
|
[minValue, maxValue]
|
|
8126
7978
|
);
|
|
8127
|
-
|
|
7979
|
+
useEffect20(() => {
|
|
8128
7980
|
if (!maxValue && !minValue) {
|
|
8129
7981
|
return;
|
|
8130
7982
|
}
|
|
@@ -8146,10 +7998,10 @@ var NumberRangeEditor = ({
|
|
|
8146
7998
|
setMaxValue(maxValue);
|
|
8147
7999
|
}
|
|
8148
8000
|
}, [maxValue, minValue, setError]);
|
|
8149
|
-
return /* @__PURE__ */ jsxs43(
|
|
8001
|
+
return /* @__PURE__ */ jsxs43(Fragment15, { children: [
|
|
8150
8002
|
/* @__PURE__ */ jsxs43("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
8151
|
-
/* @__PURE__ */
|
|
8152
|
-
|
|
8003
|
+
/* @__PURE__ */ jsx75(
|
|
8004
|
+
Input9,
|
|
8153
8005
|
{
|
|
8154
8006
|
label: `${ariaLabel}-min`,
|
|
8155
8007
|
type: "number",
|
|
@@ -8164,8 +8016,8 @@ var NumberRangeEditor = ({
|
|
|
8164
8016
|
"data-testid": "value-low"
|
|
8165
8017
|
}
|
|
8166
8018
|
),
|
|
8167
|
-
/* @__PURE__ */
|
|
8168
|
-
|
|
8019
|
+
/* @__PURE__ */ jsx75(
|
|
8020
|
+
Input9,
|
|
8169
8021
|
{
|
|
8170
8022
|
type: "number",
|
|
8171
8023
|
label: `${ariaLabel}-max`,
|
|
@@ -8181,149 +8033,448 @@ var NumberRangeEditor = ({
|
|
|
8181
8033
|
}
|
|
8182
8034
|
)
|
|
8183
8035
|
] }),
|
|
8184
|
-
/* @__PURE__ */
|
|
8036
|
+
/* @__PURE__ */ jsx75(ErrorContainer, { errorMessage: error })
|
|
8185
8037
|
] });
|
|
8186
8038
|
};
|
|
8187
|
-
|
|
8188
|
-
|
|
8039
|
+
|
|
8040
|
+
// src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
|
|
8041
|
+
import {
|
|
8042
|
+
convertComboBoxGroupsToSelectableGroups as convertComboBoxGroupsToSelectableGroups3,
|
|
8043
|
+
getComboBoxSelectedSelectableGroups as getComboBoxSelectedSelectableGroups2,
|
|
8044
|
+
InputComboBox as InputComboBox3
|
|
8045
|
+
} from "@uniformdev/design-system";
|
|
8046
|
+
import { useMemo as useMemo19 } from "react";
|
|
8047
|
+
|
|
8048
|
+
// src/components/SearchAndFilter/editors/shared/CustomOptions.tsx
|
|
8049
|
+
import { StatusBullet } from "@uniformdev/design-system";
|
|
8050
|
+
import { jsx as jsx76 } from "@emotion/react/jsx-runtime";
|
|
8051
|
+
var CustomOptions = ({ label, value }) => {
|
|
8052
|
+
return /* @__PURE__ */ jsx76(
|
|
8053
|
+
StatusBullet,
|
|
8054
|
+
{
|
|
8055
|
+
status: label,
|
|
8056
|
+
message: Array.isArray(value) ? value.join(",") : value
|
|
8057
|
+
}
|
|
8058
|
+
);
|
|
8059
|
+
};
|
|
8060
|
+
|
|
8061
|
+
// src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
|
|
8062
|
+
import { jsx as jsx77 } from "@emotion/react/jsx-runtime";
|
|
8063
|
+
var StatusMultiEditor = ({
|
|
8064
|
+
options,
|
|
8065
|
+
value,
|
|
8066
|
+
disabled,
|
|
8067
|
+
readOnly,
|
|
8189
8068
|
onChange,
|
|
8069
|
+
valueTestId
|
|
8070
|
+
}) => {
|
|
8071
|
+
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8072
|
+
const { groupedOptions, selectedOptions } = useMemo19(
|
|
8073
|
+
() => convertComboBoxGroupsToSelectableGroups3({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
8074
|
+
[options, value]
|
|
8075
|
+
);
|
|
8076
|
+
return /* @__PURE__ */ jsx77("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx77(
|
|
8077
|
+
InputComboBox3,
|
|
8078
|
+
{
|
|
8079
|
+
options: groupedOptions != null ? groupedOptions : [],
|
|
8080
|
+
isMulti: true,
|
|
8081
|
+
onChange: (e) => {
|
|
8082
|
+
const selectedValues = getComboBoxSelectedSelectableGroups2(e);
|
|
8083
|
+
return onChange([...selectedValues]);
|
|
8084
|
+
},
|
|
8085
|
+
formatOptionLabel: CustomOptions,
|
|
8086
|
+
"aria-readonly": readOnly,
|
|
8087
|
+
value: selectedOptions,
|
|
8088
|
+
isDisabled: disabled,
|
|
8089
|
+
styles: {
|
|
8090
|
+
menu(base) {
|
|
8091
|
+
return {
|
|
8092
|
+
...base,
|
|
8093
|
+
minWidth: "max-content"
|
|
8094
|
+
};
|
|
8095
|
+
}
|
|
8096
|
+
},
|
|
8097
|
+
...readOnlyProps
|
|
8098
|
+
}
|
|
8099
|
+
) });
|
|
8100
|
+
};
|
|
8101
|
+
|
|
8102
|
+
// src/components/SearchAndFilter/editors/StatusSingleEditor.tsx
|
|
8103
|
+
import {
|
|
8104
|
+
convertComboBoxGroupsToSelectableGroups as convertComboBoxGroupsToSelectableGroups4,
|
|
8105
|
+
InputComboBox as InputComboBox4
|
|
8106
|
+
} from "@uniformdev/design-system";
|
|
8107
|
+
import { useMemo as useMemo20 } from "react";
|
|
8108
|
+
import { jsx as jsx78 } from "@emotion/react/jsx-runtime";
|
|
8109
|
+
var StatusSingleEditor = ({
|
|
8110
|
+
options,
|
|
8111
|
+
value,
|
|
8190
8112
|
disabled,
|
|
8113
|
+
readOnly,
|
|
8114
|
+
onChange,
|
|
8115
|
+
valueTestId
|
|
8116
|
+
}) => {
|
|
8117
|
+
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
8118
|
+
const { groupedOptions, selectedOptions } = useMemo20(
|
|
8119
|
+
() => convertComboBoxGroupsToSelectableGroups4({
|
|
8120
|
+
options: options != null ? options : [],
|
|
8121
|
+
selectedItems: new Set(value ? [value] : void 0),
|
|
8122
|
+
selectionMode: "single"
|
|
8123
|
+
}),
|
|
8124
|
+
[options, value]
|
|
8125
|
+
);
|
|
8126
|
+
return /* @__PURE__ */ jsx78("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx78(
|
|
8127
|
+
InputComboBox4,
|
|
8128
|
+
{
|
|
8129
|
+
options: groupedOptions,
|
|
8130
|
+
onChange: (e) => {
|
|
8131
|
+
if (Array.isArray(e == null ? void 0 : e.value)) {
|
|
8132
|
+
return;
|
|
8133
|
+
}
|
|
8134
|
+
return onChange(e == null ? void 0 : e.value);
|
|
8135
|
+
},
|
|
8136
|
+
formatOptionLabel: CustomOptions,
|
|
8137
|
+
"aria-readonly": readOnly,
|
|
8138
|
+
value: selectedOptions,
|
|
8139
|
+
isDisabled: disabled,
|
|
8140
|
+
styles: {
|
|
8141
|
+
menu(base) {
|
|
8142
|
+
return {
|
|
8143
|
+
...base,
|
|
8144
|
+
minWidth: "max-content"
|
|
8145
|
+
};
|
|
8146
|
+
}
|
|
8147
|
+
},
|
|
8148
|
+
...readOnlyProps
|
|
8149
|
+
}
|
|
8150
|
+
) });
|
|
8151
|
+
};
|
|
8152
|
+
|
|
8153
|
+
// src/components/SearchAndFilter/editors/TextEditor.tsx
|
|
8154
|
+
import { Input as Input10 } from "@uniformdev/design-system";
|
|
8155
|
+
import { useState as useState23 } from "react";
|
|
8156
|
+
import { useDebounce as useDebounce8 } from "react-use";
|
|
8157
|
+
import { jsx as jsx79 } from "@emotion/react/jsx-runtime";
|
|
8158
|
+
var TextEditor = ({
|
|
8159
|
+
onChange,
|
|
8160
|
+
ariaLabel,
|
|
8191
8161
|
value,
|
|
8192
8162
|
readOnly,
|
|
8193
8163
|
valueTestId
|
|
8194
8164
|
}) => {
|
|
8195
|
-
const [innerValue, setInnerValue] =
|
|
8196
|
-
|
|
8197
|
-
return /* @__PURE__ */
|
|
8198
|
-
|
|
8165
|
+
const [innerValue, setInnerValue] = useState23(value != null ? value : "");
|
|
8166
|
+
useDebounce8(() => onChange(innerValue), 500, [innerValue]);
|
|
8167
|
+
return /* @__PURE__ */ jsx79(
|
|
8168
|
+
Input10,
|
|
8199
8169
|
{
|
|
8200
|
-
label: ariaLabel,
|
|
8201
|
-
type: "number",
|
|
8202
8170
|
showLabel: false,
|
|
8203
|
-
|
|
8171
|
+
label: ariaLabel,
|
|
8204
8172
|
onChange: (e) => setInnerValue(e.currentTarget.value),
|
|
8205
|
-
|
|
8173
|
+
placeholder: "Enter phrase to search\u2026",
|
|
8206
8174
|
value: innerValue,
|
|
8207
8175
|
readOnly,
|
|
8208
8176
|
"data-testid": valueTestId
|
|
8209
8177
|
}
|
|
8210
|
-
);
|
|
8211
|
-
};
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8178
|
+
);
|
|
8179
|
+
};
|
|
8180
|
+
|
|
8181
|
+
// src/components/SearchAndFilter/FilterButton.tsx
|
|
8182
|
+
import { Counter as Counter2, Icon as Icon6 } from "@uniformdev/design-system";
|
|
8183
|
+
|
|
8184
|
+
// src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
|
|
8185
|
+
import { css as css38 } from "@emotion/react";
|
|
8186
|
+
import { cq, fadeInLtr } from "@uniformdev/design-system";
|
|
8187
|
+
var SearchAndFilterControlsWrapper = (gridColumns) => css38`
|
|
8188
|
+
align-items: stretch;
|
|
8189
|
+
display: grid;
|
|
8190
|
+
grid-template-columns: ${gridColumns};
|
|
8191
|
+
gap: var(--spacing-sm);
|
|
8192
|
+
`;
|
|
8193
|
+
var SearchAndFilterOutterControlWrapper = (gridColumns) => css38`
|
|
8194
|
+
align-items: stretch;
|
|
8195
|
+
display: grid;
|
|
8196
|
+
grid-template-columns: ${gridColumns};
|
|
8197
|
+
gap: var(--spacing-sm);
|
|
8198
|
+
`;
|
|
8199
|
+
var ConditionalFilterRow = css38`
|
|
8200
|
+
align-items: baseline;
|
|
8201
|
+
display: grid;
|
|
8202
|
+
grid-template-columns: 35px 1fr;
|
|
8203
|
+
gap: var(--spacing-sm);
|
|
8204
|
+
margin-left: var(--spacing-base);
|
|
8205
|
+
|
|
8206
|
+
${cq("380px")} {
|
|
8207
|
+
&:after {
|
|
8208
|
+
content: '';
|
|
8209
|
+
display: block;
|
|
8210
|
+
height: 1px;
|
|
8211
|
+
background: var(--gray-300);
|
|
8212
|
+
width: calc(100% - var(--spacing-base));
|
|
8213
|
+
margin-left: var(--spacing-base);
|
|
8214
|
+
}
|
|
8215
|
+
&:last-of-type:after {
|
|
8216
|
+
display: none;
|
|
8217
|
+
}
|
|
8218
|
+
}
|
|
8219
|
+
|
|
8220
|
+
&:nth-of-type(2) {
|
|
8221
|
+
margin-left: 0;
|
|
8222
|
+
grid-template-columns: 50px 1fr;
|
|
8223
|
+
}
|
|
8224
|
+
|
|
8225
|
+
${cq("580px")} {
|
|
8226
|
+
&:after {
|
|
8227
|
+
display: none;
|
|
8228
|
+
}
|
|
8229
|
+
}
|
|
8230
|
+
|
|
8231
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
8232
|
+
animation: ${fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
8233
|
+
}
|
|
8234
|
+
`;
|
|
8235
|
+
var ConditionalInputRow = css38`
|
|
8236
|
+
display: flex;
|
|
8237
|
+
gap: var(--spacing-sm);
|
|
8238
|
+
flex-wrap: wrap;
|
|
8239
|
+
|
|
8240
|
+
${cq("380px")} {
|
|
8241
|
+
& > div:nth-child(-n + 2) {
|
|
8242
|
+
width: calc(50% - var(--spacing-sm));
|
|
8243
|
+
}
|
|
8244
|
+
|
|
8245
|
+
& > div:nth-child(n + 3) {
|
|
8246
|
+
width: calc(100% - 48px);
|
|
8247
|
+
}
|
|
8248
|
+
}
|
|
8249
|
+
${cq("764px")} {
|
|
8250
|
+
align-items: flex-start;
|
|
8251
|
+
display: grid;
|
|
8252
|
+
grid-template-columns: 200px 160px 1fr 32px;
|
|
8253
|
+
|
|
8254
|
+
& > div:nth-child(n) {
|
|
8255
|
+
width: auto;
|
|
8256
|
+
}
|
|
8257
|
+
}
|
|
8258
|
+
`;
|
|
8259
|
+
var SearchInput = css38`
|
|
8260
|
+
max-height: 40px;
|
|
8261
|
+
min-height: unset;
|
|
8262
|
+
`;
|
|
8263
|
+
var BindableKeywordSearchInputStyles = css38`
|
|
8264
|
+
position: relative;
|
|
8265
|
+
width: 100%;
|
|
8266
|
+
|
|
8267
|
+
& [data-lexical-editor='true'] {
|
|
8268
|
+
padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
|
|
8269
|
+
font-size: var(--fs-sm);
|
|
8270
|
+
border-radius: var(--rounded-full);
|
|
8271
|
+
max-height: 40px;
|
|
8272
|
+
min-height: unset;
|
|
8273
|
+
width: 100%;
|
|
8274
|
+
position: relative;
|
|
8275
|
+
white-space: nowrap;
|
|
8276
|
+
}
|
|
8277
|
+
`;
|
|
8278
|
+
var ClearSearchButtonContainer = css38`
|
|
8279
|
+
align-items: center;
|
|
8280
|
+
display: flex;
|
|
8281
|
+
position: absolute;
|
|
8282
|
+
inset: 0 var(--spacing-lg) 0 auto;
|
|
8283
|
+
`;
|
|
8284
|
+
var ClearSearchButtonStyles = css38`
|
|
8285
|
+
background: none;
|
|
8286
|
+
border: none;
|
|
8287
|
+
padding: 0;
|
|
8288
|
+
pointer-events: all;
|
|
8289
|
+
`;
|
|
8290
|
+
var FilterButton = css38`
|
|
8291
|
+
align-items: center;
|
|
8292
|
+
background: var(--white);
|
|
8293
|
+
border: 1px solid var(--gray-300);
|
|
8294
|
+
border-radius: var(--rounded-full);
|
|
8295
|
+
color: var(--typography-base);
|
|
8296
|
+
display: flex;
|
|
8297
|
+
font-size: var(--fs-sm);
|
|
8298
|
+
gap: var(--spacing-sm);
|
|
8299
|
+
padding: var(--spacing-sm) var(--spacing-base);
|
|
8300
|
+
max-height: 40px;
|
|
8301
|
+
transition: color var(--duration-fast) var(--timing-ease-out),
|
|
8302
|
+
background-color var(--duration-fast) var(--timing-ease-out),
|
|
8303
|
+
border-color var(--duration-fast) var(--timing-ease-out),
|
|
8304
|
+
box-shadow var(--duration-fast) var(--timing-ease-out);
|
|
8305
|
+
|
|
8306
|
+
svg {
|
|
8307
|
+
color: var(--gray-300);
|
|
8308
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
8309
|
+
}
|
|
8310
|
+
|
|
8311
|
+
&:hover,
|
|
8312
|
+
:where([aria-expanded='true']) {
|
|
8313
|
+
outline: none;
|
|
8314
|
+
background: var(--gray-200);
|
|
8315
|
+
border-color: var(--gray-300);
|
|
8316
|
+
|
|
8317
|
+
svg {
|
|
8318
|
+
color: var(--typography-base);
|
|
8319
|
+
}
|
|
8320
|
+
}
|
|
8321
|
+
|
|
8322
|
+
&:disabled {
|
|
8323
|
+
opacity: var(--opacity-50);
|
|
8324
|
+
}
|
|
8325
|
+
`;
|
|
8326
|
+
var FilterButtonText = css38`
|
|
8327
|
+
overflow: hidden;
|
|
8328
|
+
text-overflow: ellipsis;
|
|
8329
|
+
white-space: nowrap;
|
|
8330
|
+
max-width: 14ch;
|
|
8331
|
+
`;
|
|
8332
|
+
var FilterButtonSelected = css38`
|
|
8333
|
+
background: var(--gray-100);
|
|
8334
|
+
border-color: var(--gray-300);
|
|
8335
|
+
|
|
8336
|
+
svg {
|
|
8337
|
+
color: var(--accent-dark);
|
|
8338
|
+
}
|
|
8339
|
+
`;
|
|
8340
|
+
var FilterButtonWithOptions = css38`
|
|
8341
|
+
:where([aria-expanded='true']) {
|
|
8342
|
+
background: var(--purple-rain-100);
|
|
8343
|
+
border-color: var(--accent-light);
|
|
8344
|
+
color: var(--typography-base);
|
|
8345
|
+
box-shadow: var(--elevation-100);
|
|
8346
|
+
|
|
8347
|
+
svg {
|
|
8348
|
+
color: var(--accent-dark);
|
|
8349
|
+
}
|
|
8350
|
+
}
|
|
8351
|
+
`;
|
|
8352
|
+
var SearchIcon = css38`
|
|
8353
|
+
color: var(--icon-color);
|
|
8354
|
+
position: absolute;
|
|
8355
|
+
inset: 0 var(--spacing-base) 0 auto;
|
|
8356
|
+
margin: auto;
|
|
8357
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
8358
|
+
`;
|
|
8359
|
+
var AddConditionalBtn = css38`
|
|
8360
|
+
align-items: center;
|
|
8361
|
+
background: transparent;
|
|
8362
|
+
border: none;
|
|
8363
|
+
color: var(--primary-action-default);
|
|
8364
|
+
display: flex;
|
|
8365
|
+
gap: var(--spacing-sm);
|
|
8366
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
8367
|
+
padding: 0;
|
|
8368
|
+
|
|
8369
|
+
&:hover,
|
|
8370
|
+
&:focus {
|
|
8371
|
+
color: var(--primary-action-hover);
|
|
8372
|
+
}
|
|
8373
|
+
|
|
8374
|
+
&:disabled {
|
|
8375
|
+
color: var(--gray-400);
|
|
8376
|
+
}
|
|
8377
|
+
`;
|
|
8378
|
+
var Title = css38`
|
|
8379
|
+
color: var(--typography-light);
|
|
8380
|
+
|
|
8381
|
+
&:focus {
|
|
8382
|
+
outline: none;
|
|
8383
|
+
}
|
|
8384
|
+
`;
|
|
8385
|
+
var ResetConditionsBtn = css38`
|
|
8386
|
+
background: transparent;
|
|
8387
|
+
border: none;
|
|
8388
|
+
color: var(--action-destructive-default);
|
|
8389
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
8390
|
+
padding: 0;
|
|
8391
|
+
|
|
8392
|
+
&:hover,
|
|
8393
|
+
&:focus {
|
|
8394
|
+
color: var(--action-destructive-hover);
|
|
8395
|
+
}
|
|
8396
|
+
`;
|
|
8397
|
+
var IconBtn = css38`
|
|
8398
|
+
background: transparent;
|
|
8399
|
+
border: none;
|
|
8400
|
+
padding: var(--spacing-sm);
|
|
8401
|
+
`;
|
|
8402
|
+
var SearchAndFilterOptionsContainer = css38`
|
|
8403
|
+
background: var(--gray-50);
|
|
8404
|
+
border: 1px solid var(--gray-300);
|
|
8405
|
+
border-radius: var(--rounded-base);
|
|
8406
|
+
container-type: inline-size;
|
|
8407
|
+
display: flex;
|
|
8408
|
+
flex-direction: column;
|
|
8409
|
+
gap: var(--spacing-sm);
|
|
8410
|
+
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
8411
|
+
will-change: height;
|
|
8412
|
+
position: relative;
|
|
8413
|
+
z-index: 2;
|
|
8414
|
+
`;
|
|
8415
|
+
var SearchAndFilterOptionsInnerContainer = css38`
|
|
8416
|
+
display: flex;
|
|
8417
|
+
flex-direction: column;
|
|
8418
|
+
gap: var(--spacing-sm);
|
|
8419
|
+
padding-inline: var(--spacing-md);
|
|
8420
|
+
`;
|
|
8421
|
+
var SearchAndFilterButtonGroup = css38`
|
|
8422
|
+
margin-top: var(--spacing-xs);
|
|
8423
|
+
margin-left: calc(56px + var(--spacing-md));
|
|
8424
|
+
`;
|
|
8425
|
+
|
|
8426
|
+
// src/components/SearchAndFilter/FilterButton.tsx
|
|
8427
|
+
import { jsx as jsx80, jsxs as jsxs44 } from "@emotion/react/jsx-runtime";
|
|
8428
|
+
var FilterButton2 = ({
|
|
8429
|
+
text = "Filters",
|
|
8430
|
+
icon = "filter-add",
|
|
8431
|
+
filterCount,
|
|
8432
|
+
hasSelectedValue,
|
|
8433
|
+
dataTestId,
|
|
8434
|
+
...props
|
|
8219
8435
|
}) => {
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
return /* @__PURE__ */ jsx70(
|
|
8223
|
-
Input6,
|
|
8436
|
+
return /* @__PURE__ */ jsxs44(
|
|
8437
|
+
"button",
|
|
8224
8438
|
{
|
|
8225
|
-
type: "
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
"data-testid":
|
|
8439
|
+
type: "button",
|
|
8440
|
+
css: [
|
|
8441
|
+
FilterButton,
|
|
8442
|
+
hasSelectedValue ? FilterButtonSelected : void 0,
|
|
8443
|
+
filterCount ? [FilterButtonWithOptions, FilterButtonSelected] : void 0
|
|
8444
|
+
],
|
|
8445
|
+
...props,
|
|
8446
|
+
"data-testid": dataTestId,
|
|
8447
|
+
children: [
|
|
8448
|
+
/* @__PURE__ */ jsx80(Icon6, { icon, iconColor: "currentColor", size: "1rem" }),
|
|
8449
|
+
/* @__PURE__ */ jsx80("span", { css: FilterButtonText, children: text }),
|
|
8450
|
+
filterCount ? /* @__PURE__ */ jsx80(Counter2, { count: filterCount, bgColor: "var(--white)" }) : null
|
|
8451
|
+
]
|
|
8233
8452
|
}
|
|
8234
8453
|
);
|
|
8235
8454
|
};
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
}
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
if (!minDateValue || !maxDateValue) {
|
|
8260
|
-
return;
|
|
8261
|
-
}
|
|
8262
|
-
const minDate = new Date(minDateValue);
|
|
8263
|
-
const maxDate = new Date(maxDateValue);
|
|
8264
|
-
if (maxDate < minDate) {
|
|
8265
|
-
setError("The max date cannot be lower than the min date");
|
|
8266
|
-
return;
|
|
8267
|
-
}
|
|
8268
|
-
if (maxDate && !minDate) {
|
|
8269
|
-
setError("Please enter both a low and high date");
|
|
8270
|
-
return;
|
|
8271
|
-
}
|
|
8272
|
-
const minDateString = minDate.toDateString();
|
|
8273
|
-
const maxDateString = maxDate.toDateString();
|
|
8274
|
-
if (minDateString === maxDateString || maxDateString === minDateString) {
|
|
8275
|
-
setError("The min and max date cannot be the same");
|
|
8276
|
-
return;
|
|
8277
|
-
}
|
|
8278
|
-
if (minDate > maxDate) {
|
|
8279
|
-
setError("The min date cannot be higher than the max date");
|
|
8280
|
-
return;
|
|
8281
|
-
}
|
|
8282
|
-
if (error) {
|
|
8283
|
-
setError("");
|
|
8284
|
-
}
|
|
8285
|
-
if (minDate && maxDate) {
|
|
8286
|
-
setMinDateValue(minDateValue);
|
|
8287
|
-
setMaxDateValue(maxDateValue);
|
|
8288
|
-
} else {
|
|
8289
|
-
setMinDateValue("");
|
|
8290
|
-
setMaxDateValue("");
|
|
8291
|
-
}
|
|
8292
|
-
}, [minDateValue, maxDateValue, setError]);
|
|
8293
|
-
return /* @__PURE__ */ jsxs43(Fragment14, { children: [
|
|
8294
|
-
/* @__PURE__ */ jsxs43("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
8295
|
-
/* @__PURE__ */ jsx70(
|
|
8296
|
-
Input6,
|
|
8297
|
-
{
|
|
8298
|
-
label: `${ariaLabel}-min-date`,
|
|
8299
|
-
type: "date",
|
|
8300
|
-
showLabel: false,
|
|
8301
|
-
value: minDateValue,
|
|
8302
|
-
onChange: (e) => setMinDateValue(e.currentTarget.value),
|
|
8303
|
-
"aria-invalid": !error ? false : true,
|
|
8304
|
-
disabled,
|
|
8305
|
-
readOnly,
|
|
8306
|
-
"data-testid": "value-low"
|
|
8307
|
-
}
|
|
8308
|
-
),
|
|
8309
|
-
/* @__PURE__ */ jsx70(
|
|
8310
|
-
Input6,
|
|
8311
|
-
{
|
|
8312
|
-
label: `${ariaLabel}-max-date`,
|
|
8313
|
-
type: "date",
|
|
8314
|
-
showLabel: false,
|
|
8315
|
-
value: maxDateValue,
|
|
8316
|
-
onChange: (e) => setMaxDateValue(e.currentTarget.value),
|
|
8317
|
-
"aria-invalid": !error ? false : true,
|
|
8318
|
-
disabled,
|
|
8319
|
-
readOnly,
|
|
8320
|
-
"data-testid": "value-high"
|
|
8321
|
-
}
|
|
8322
|
-
)
|
|
8323
|
-
] }),
|
|
8324
|
-
/* @__PURE__ */ jsx70(ErrorContainer, { errorMessage: error })
|
|
8325
|
-
] });
|
|
8326
|
-
};
|
|
8455
|
+
|
|
8456
|
+
// src/components/SearchAndFilter/FilterControls.tsx
|
|
8457
|
+
import { CgClose as CgClose5 } from "@react-icons/all-files/cg/CgClose";
|
|
8458
|
+
import { Icon as Icon7, InputKeywordSearch as InputKeywordSearch2 } from "@uniformdev/design-system";
|
|
8459
|
+
import { CLEAR_EDITOR_COMMAND as CLEAR_EDITOR_COMMAND2 } from "lexical";
|
|
8460
|
+
import { useEffect as useEffect22, useRef as useRef16, useState as useState25 } from "react";
|
|
8461
|
+
import { useDebounce as useDebounce9 } from "react-use";
|
|
8462
|
+
import { v4 as v43 } from "uuid";
|
|
8463
|
+
|
|
8464
|
+
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
8465
|
+
import { VerticalRhythm as VerticalRhythm5 } from "@uniformdev/design-system";
|
|
8466
|
+
import {
|
|
8467
|
+
createContext as createContext6,
|
|
8468
|
+
useCallback as useCallback6,
|
|
8469
|
+
useContext as useContext8,
|
|
8470
|
+
useDeferredValue as useDeferredValue2,
|
|
8471
|
+
useEffect as useEffect21,
|
|
8472
|
+
useMemo as useMemo21,
|
|
8473
|
+
useState as useState24
|
|
8474
|
+
} from "react";
|
|
8475
|
+
|
|
8476
|
+
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
8477
|
+
import { jsx as jsx81 } from "@emotion/react/jsx-runtime";
|
|
8327
8478
|
var FilterEditorRenderer = ({ editorType, ...props }) => {
|
|
8328
8479
|
const { filterMapper: contextFilterMapper } = useSearchAndFilter();
|
|
8329
8480
|
const Editor = contextFilterMapper == null ? void 0 : contextFilterMapper[editorType];
|
|
@@ -8333,7 +8484,7 @@ var FilterEditorRenderer = ({ editorType, ...props }) => {
|
|
|
8333
8484
|
if (editorType === "empty") {
|
|
8334
8485
|
return null;
|
|
8335
8486
|
}
|
|
8336
|
-
return /* @__PURE__ */
|
|
8487
|
+
return /* @__PURE__ */ jsx81(Editor, { ...props });
|
|
8337
8488
|
};
|
|
8338
8489
|
var filterMapper = {
|
|
8339
8490
|
multiChoice: FilterMultiChoiceEditor,
|
|
@@ -8350,9 +8501,9 @@ var filterMapper = {
|
|
|
8350
8501
|
function withInputVariables(WrappedComponent) {
|
|
8351
8502
|
const WithInputVariables = (props) => {
|
|
8352
8503
|
if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
|
|
8353
|
-
return /* @__PURE__ */
|
|
8504
|
+
return /* @__PURE__ */ jsx81(WrappedComponent, { ...props });
|
|
8354
8505
|
}
|
|
8355
|
-
return /* @__PURE__ */
|
|
8506
|
+
return /* @__PURE__ */ jsx81(
|
|
8356
8507
|
InputVariables,
|
|
8357
8508
|
{
|
|
8358
8509
|
disableInlineMenu: true,
|
|
@@ -8360,7 +8511,7 @@ function withInputVariables(WrappedComponent) {
|
|
|
8360
8511
|
onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
|
|
8361
8512
|
value: props.value,
|
|
8362
8513
|
disabled: props.disabled,
|
|
8363
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
8514
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx81(WrappedComponent, { ...props })
|
|
8364
8515
|
}
|
|
8365
8516
|
);
|
|
8366
8517
|
};
|
|
@@ -8370,16 +8521,16 @@ function withInputVariablesForMultiValue(WrappedComponent) {
|
|
|
8370
8521
|
const WithInputVariables = (props) => {
|
|
8371
8522
|
var _a;
|
|
8372
8523
|
if (!props.bindable || props.disabled || props.readOnly) {
|
|
8373
|
-
return /* @__PURE__ */
|
|
8524
|
+
return /* @__PURE__ */ jsx81(WrappedComponent, { ...props });
|
|
8374
8525
|
}
|
|
8375
|
-
return /* @__PURE__ */
|
|
8526
|
+
return /* @__PURE__ */ jsx81(
|
|
8376
8527
|
InputVariables,
|
|
8377
8528
|
{
|
|
8378
8529
|
disableInlineMenu: true,
|
|
8379
8530
|
showMenuPosition: "inline-right",
|
|
8380
8531
|
onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
|
|
8381
8532
|
value: (_a = props.value) == null ? void 0 : _a[0],
|
|
8382
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
8533
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx81(WrappedComponent, { ...props })
|
|
8383
8534
|
}
|
|
8384
8535
|
);
|
|
8385
8536
|
};
|
|
@@ -8393,26 +8544,9 @@ var bindableFiltersMapper = {
|
|
|
8393
8544
|
text: withInputVariables(TextEditor),
|
|
8394
8545
|
number: withInputVariables(NumberEditor)
|
|
8395
8546
|
};
|
|
8396
|
-
var ErrorContainer = ({ errorMessage }) => {
|
|
8397
|
-
return /* @__PURE__ */ jsx70(
|
|
8398
|
-
"div",
|
|
8399
|
-
{
|
|
8400
|
-
css: {
|
|
8401
|
-
gridColumn: "span 6",
|
|
8402
|
-
order: 6
|
|
8403
|
-
},
|
|
8404
|
-
children: /* @__PURE__ */ jsx70(FieldMessage, { errorMessage })
|
|
8405
|
-
}
|
|
8406
|
-
);
|
|
8407
|
-
};
|
|
8408
|
-
var twoColumnGrid = {
|
|
8409
|
-
display: "grid",
|
|
8410
|
-
gridTemplateColumns: "1fr 1fr",
|
|
8411
|
-
gap: "var(--spacing-sm);"
|
|
8412
|
-
};
|
|
8413
8547
|
|
|
8414
8548
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
8415
|
-
import { jsx as
|
|
8549
|
+
import { jsx as jsx82 } from "@emotion/react/jsx-runtime";
|
|
8416
8550
|
var SearchAndFilterContext = createContext6({
|
|
8417
8551
|
searchTerm: "",
|
|
8418
8552
|
setSearchTerm: () => {
|
|
@@ -8448,9 +8582,9 @@ var SearchAndFilterProvider = ({
|
|
|
8448
8582
|
children,
|
|
8449
8583
|
allowBindingSearchTerm
|
|
8450
8584
|
}) => {
|
|
8451
|
-
const [searchTerm, setSearchTerm] =
|
|
8585
|
+
const [searchTerm, setSearchTerm] = useState24(defaultSearchTerm);
|
|
8452
8586
|
const deferredSearchTerm = useDeferredValue2(searchTerm);
|
|
8453
|
-
const [filterVisibility, setFilterVisibility] =
|
|
8587
|
+
const [filterVisibility, setFilterVisibility] = useState24(filterVisible);
|
|
8454
8588
|
const handleSearchTerm = useCallback6(
|
|
8455
8589
|
(term) => {
|
|
8456
8590
|
setSearchTerm(term);
|
|
@@ -8476,13 +8610,13 @@ var SearchAndFilterProvider = ({
|
|
|
8476
8610
|
},
|
|
8477
8611
|
[filters, onChange]
|
|
8478
8612
|
);
|
|
8479
|
-
const validFilterQuery =
|
|
8613
|
+
const validFilterQuery = useMemo21(() => {
|
|
8480
8614
|
const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
|
|
8481
8615
|
if (hasValidFilters) {
|
|
8482
8616
|
return filters;
|
|
8483
8617
|
}
|
|
8484
8618
|
}, [filters]);
|
|
8485
|
-
|
|
8619
|
+
useEffect21(() => {
|
|
8486
8620
|
if (filterVisibility) {
|
|
8487
8621
|
const handleEscKeyFilterClose = (e) => {
|
|
8488
8622
|
if (e.key === "Escape") {
|
|
@@ -8495,7 +8629,7 @@ var SearchAndFilterProvider = ({
|
|
|
8495
8629
|
};
|
|
8496
8630
|
}
|
|
8497
8631
|
}, [filterVisibility]);
|
|
8498
|
-
return /* @__PURE__ */
|
|
8632
|
+
return /* @__PURE__ */ jsx82(
|
|
8499
8633
|
SearchAndFilterContext.Provider,
|
|
8500
8634
|
{
|
|
8501
8635
|
value: {
|
|
@@ -8514,7 +8648,7 @@ var SearchAndFilterProvider = ({
|
|
|
8514
8648
|
filterMapper: filterMapper2,
|
|
8515
8649
|
allowBindingSearchTerm
|
|
8516
8650
|
},
|
|
8517
|
-
children: /* @__PURE__ */
|
|
8651
|
+
children: /* @__PURE__ */ jsx82(VerticalRhythm5, { children })
|
|
8518
8652
|
}
|
|
8519
8653
|
);
|
|
8520
8654
|
};
|
|
@@ -8524,7 +8658,7 @@ var useSearchAndFilter = () => {
|
|
|
8524
8658
|
};
|
|
8525
8659
|
|
|
8526
8660
|
// src/components/SearchAndFilter/FilterControls.tsx
|
|
8527
|
-
import { Fragment as
|
|
8661
|
+
import { Fragment as Fragment16, jsx as jsx83, jsxs as jsxs45 } from "@emotion/react/jsx-runtime";
|
|
8528
8662
|
var FilterControls = ({
|
|
8529
8663
|
children,
|
|
8530
8664
|
hideSearchInput
|
|
@@ -8539,23 +8673,23 @@ var FilterControls = ({
|
|
|
8539
8673
|
} = useSearchAndFilter();
|
|
8540
8674
|
const editorRef = useRef16(null);
|
|
8541
8675
|
const hasVariableInSearchTerm = hasReferencedVariables(searchTerm);
|
|
8542
|
-
const [idToResetInputVariables, setIdToResetInputVariables] =
|
|
8543
|
-
const [localeSearchTerm, setLocaleSearchTerm] =
|
|
8544
|
-
|
|
8676
|
+
const [idToResetInputVariables, setIdToResetInputVariables] = useState25("data-resource-search-term-input");
|
|
8677
|
+
const [localeSearchTerm, setLocaleSearchTerm] = useState25(searchTerm);
|
|
8678
|
+
useDebounce9(
|
|
8545
8679
|
() => {
|
|
8546
8680
|
setSearchTerm(localeSearchTerm);
|
|
8547
8681
|
},
|
|
8548
8682
|
300,
|
|
8549
8683
|
[localeSearchTerm]
|
|
8550
8684
|
);
|
|
8551
|
-
|
|
8685
|
+
useEffect22(() => {
|
|
8552
8686
|
if (searchTerm === "") {
|
|
8553
8687
|
setLocaleSearchTerm("");
|
|
8554
8688
|
setIdToResetInputVariables(`data-resource-search-term-input-${v43()}`);
|
|
8555
8689
|
}
|
|
8556
8690
|
}, [searchTerm]);
|
|
8557
|
-
return /* @__PURE__ */
|
|
8558
|
-
/* @__PURE__ */
|
|
8691
|
+
return /* @__PURE__ */ jsxs45(Fragment16, { children: [
|
|
8692
|
+
/* @__PURE__ */ jsx83(
|
|
8559
8693
|
FilterButton2,
|
|
8560
8694
|
{
|
|
8561
8695
|
"aria-controls": "search-and-filter-options",
|
|
@@ -8568,8 +8702,8 @@ var FilterControls = ({
|
|
|
8568
8702
|
dataTestId: "filters-button"
|
|
8569
8703
|
}
|
|
8570
8704
|
),
|
|
8571
|
-
hideSearchInput ? null : /* @__PURE__ */
|
|
8572
|
-
/* @__PURE__ */
|
|
8705
|
+
hideSearchInput ? null : /* @__PURE__ */ jsxs45("div", { css: BindableKeywordSearchInputStyles, children: [
|
|
8706
|
+
/* @__PURE__ */ jsx83(
|
|
8573
8707
|
InputVariables,
|
|
8574
8708
|
{
|
|
8575
8709
|
label: "",
|
|
@@ -8579,7 +8713,7 @@ var FilterControls = ({
|
|
|
8579
8713
|
value: localeSearchTerm,
|
|
8580
8714
|
onChange: (value) => setLocaleSearchTerm(value != null ? value : ""),
|
|
8581
8715
|
disableVariables: !allowBindingSearchTerm,
|
|
8582
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
8716
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx83(
|
|
8583
8717
|
InputKeywordSearch2,
|
|
8584
8718
|
{
|
|
8585
8719
|
placeholder: "Search...",
|
|
@@ -8592,7 +8726,7 @@ var FilterControls = ({
|
|
|
8592
8726
|
)
|
|
8593
8727
|
}
|
|
8594
8728
|
),
|
|
8595
|
-
hasVariableInSearchTerm ? /* @__PURE__ */
|
|
8729
|
+
hasVariableInSearchTerm ? /* @__PURE__ */ jsx83("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ jsx83(
|
|
8596
8730
|
"button",
|
|
8597
8731
|
{
|
|
8598
8732
|
css: ClearSearchButtonStyles,
|
|
@@ -8606,7 +8740,7 @@ var FilterControls = ({
|
|
|
8606
8740
|
},
|
|
8607
8741
|
type: "button",
|
|
8608
8742
|
"data-testid": "keyword-search-clear-button",
|
|
8609
|
-
children: /* @__PURE__ */
|
|
8743
|
+
children: /* @__PURE__ */ jsx83(Icon7, { icon: CgClose5, iconColor: "red", size: "1rem" })
|
|
8610
8744
|
}
|
|
8611
8745
|
) }) : null
|
|
8612
8746
|
] }),
|
|
@@ -8615,21 +8749,21 @@ var FilterControls = ({
|
|
|
8615
8749
|
};
|
|
8616
8750
|
|
|
8617
8751
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
8618
|
-
import { Icon as Icon8, InputComboBox as
|
|
8619
|
-
import { useMemo as
|
|
8752
|
+
import { Icon as Icon8, InputComboBox as InputComboBox5 } from "@uniformdev/design-system";
|
|
8753
|
+
import { useMemo as useMemo22 } from "react";
|
|
8620
8754
|
|
|
8621
8755
|
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
8622
8756
|
import { HorizontalRhythm as HorizontalRhythm8, VerticalRhythm as VerticalRhythm6 } from "@uniformdev/design-system";
|
|
8623
|
-
import React13, { useEffect as
|
|
8624
|
-
import { jsx as
|
|
8757
|
+
import React13, { useEffect as useEffect23 } from "react";
|
|
8758
|
+
import { jsx as jsx84, jsxs as jsxs46 } from "@emotion/react/jsx-runtime";
|
|
8625
8759
|
var SearchAndFilterOptionsContainer2 = ({
|
|
8626
8760
|
buttonRow,
|
|
8627
8761
|
additionalFiltersContainer,
|
|
8628
8762
|
children
|
|
8629
8763
|
}) => {
|
|
8630
|
-
return /* @__PURE__ */
|
|
8631
|
-
/* @__PURE__ */
|
|
8632
|
-
buttonRow ? /* @__PURE__ */
|
|
8764
|
+
return /* @__PURE__ */ jsxs46("div", { css: SearchAndFilterOptionsContainer, children: [
|
|
8765
|
+
/* @__PURE__ */ jsx84("div", { css: SearchAndFilterOptionsInnerContainer, children }),
|
|
8766
|
+
buttonRow ? /* @__PURE__ */ jsx84(
|
|
8633
8767
|
HorizontalRhythm8,
|
|
8634
8768
|
{
|
|
8635
8769
|
css: SearchAndFilterButtonGroup,
|
|
@@ -8639,7 +8773,7 @@ var SearchAndFilterOptionsContainer2 = ({
|
|
|
8639
8773
|
children: buttonRow
|
|
8640
8774
|
}
|
|
8641
8775
|
) : null,
|
|
8642
|
-
additionalFiltersContainer ? /* @__PURE__ */
|
|
8776
|
+
additionalFiltersContainer ? /* @__PURE__ */ jsx84("div", { children: additionalFiltersContainer }) : null
|
|
8643
8777
|
] });
|
|
8644
8778
|
};
|
|
8645
8779
|
var FilterMenu = ({
|
|
@@ -8653,21 +8787,21 @@ var FilterMenu = ({
|
|
|
8653
8787
|
}) => {
|
|
8654
8788
|
const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
|
|
8655
8789
|
const innerMenuRef = React13.useRef(null);
|
|
8656
|
-
|
|
8790
|
+
useEffect23(() => {
|
|
8657
8791
|
var _a;
|
|
8658
8792
|
if (filterVisibility) {
|
|
8659
8793
|
(_a = innerMenuRef.current) == null ? void 0 : _a.focus();
|
|
8660
8794
|
}
|
|
8661
8795
|
}, [filterVisibility]);
|
|
8662
|
-
return /* @__PURE__ */
|
|
8796
|
+
return /* @__PURE__ */ jsx84(VerticalRhythm6, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ jsxs46(
|
|
8663
8797
|
SearchAndFilterOptionsContainer2,
|
|
8664
8798
|
{
|
|
8665
8799
|
buttonRow: menuControls,
|
|
8666
8800
|
additionalFiltersContainer,
|
|
8667
8801
|
children: [
|
|
8668
|
-
/* @__PURE__ */
|
|
8669
|
-
/* @__PURE__ */
|
|
8670
|
-
(filters == null ? void 0 : filters.length) ? /* @__PURE__ */
|
|
8802
|
+
/* @__PURE__ */ jsxs46(HorizontalRhythm8, { gap: "sm", align: "center", justify: "space-between", children: [
|
|
8803
|
+
/* @__PURE__ */ jsx84("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }),
|
|
8804
|
+
(filters == null ? void 0 : filters.length) ? /* @__PURE__ */ jsx84(
|
|
8671
8805
|
"button",
|
|
8672
8806
|
{
|
|
8673
8807
|
type: "button",
|
|
@@ -8688,7 +8822,7 @@ var FilterMenu = ({
|
|
|
8688
8822
|
};
|
|
8689
8823
|
|
|
8690
8824
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
8691
|
-
import { jsx as
|
|
8825
|
+
import { jsx as jsx85, jsxs as jsxs47 } from "@emotion/react/jsx-runtime";
|
|
8692
8826
|
var FilterItem = ({
|
|
8693
8827
|
index,
|
|
8694
8828
|
paramOptions,
|
|
@@ -8704,7 +8838,7 @@ var FilterItem = ({
|
|
|
8704
8838
|
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
8705
8839
|
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
8706
8840
|
const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
|
|
8707
|
-
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } =
|
|
8841
|
+
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = useMemo22(() => {
|
|
8708
8842
|
var _a2;
|
|
8709
8843
|
const currentSelectedFilter = filterOptions.find((item) => {
|
|
8710
8844
|
var _a3;
|
|
@@ -8731,11 +8865,11 @@ var FilterItem = ({
|
|
|
8731
8865
|
menuIsOpen: false,
|
|
8732
8866
|
isClearable: false
|
|
8733
8867
|
} : {};
|
|
8734
|
-
return /* @__PURE__ */
|
|
8735
|
-
/* @__PURE__ */
|
|
8736
|
-
/* @__PURE__ */
|
|
8737
|
-
/* @__PURE__ */
|
|
8738
|
-
|
|
8868
|
+
return /* @__PURE__ */ jsxs47("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
|
|
8869
|
+
/* @__PURE__ */ jsx85("span", { children: index === 0 ? "Where" : "and" }),
|
|
8870
|
+
/* @__PURE__ */ jsxs47("div", { css: ConditionalInputRow, children: [
|
|
8871
|
+
/* @__PURE__ */ jsx85(
|
|
8872
|
+
InputComboBox5,
|
|
8739
8873
|
{
|
|
8740
8874
|
"aria-label": label,
|
|
8741
8875
|
options: paramOptions,
|
|
@@ -8761,8 +8895,8 @@ var FilterItem = ({
|
|
|
8761
8895
|
name: `filter-field-${index}`
|
|
8762
8896
|
}
|
|
8763
8897
|
),
|
|
8764
|
-
/* @__PURE__ */
|
|
8765
|
-
|
|
8898
|
+
/* @__PURE__ */ jsx85(
|
|
8899
|
+
InputComboBox5,
|
|
8766
8900
|
{
|
|
8767
8901
|
"aria-label": operatorLabel,
|
|
8768
8902
|
options: operatorOptions,
|
|
@@ -8785,7 +8919,7 @@ var FilterItem = ({
|
|
|
8785
8919
|
name: `filter-operator-${index}`
|
|
8786
8920
|
}
|
|
8787
8921
|
),
|
|
8788
|
-
/* @__PURE__ */
|
|
8922
|
+
/* @__PURE__ */ jsx85(
|
|
8789
8923
|
FilterEditorRenderer,
|
|
8790
8924
|
{
|
|
8791
8925
|
"aria-label": metaDataLabel,
|
|
@@ -8799,7 +8933,7 @@ var FilterItem = ({
|
|
|
8799
8933
|
valueTestId: "filter-value"
|
|
8800
8934
|
}
|
|
8801
8935
|
),
|
|
8802
|
-
readOnly || index === 0 ? null : /* @__PURE__ */
|
|
8936
|
+
readOnly || index === 0 ? null : /* @__PURE__ */ jsx85(
|
|
8803
8937
|
"button",
|
|
8804
8938
|
{
|
|
8805
8939
|
type: "button",
|
|
@@ -8807,7 +8941,7 @@ var FilterItem = ({
|
|
|
8807
8941
|
"aria-label": "delete filter",
|
|
8808
8942
|
css: IconBtn,
|
|
8809
8943
|
"data-testid": "delete-filter",
|
|
8810
|
-
children: /* @__PURE__ */
|
|
8944
|
+
children: /* @__PURE__ */ jsx85(Icon8, { icon: "trash", iconColor: "red", size: "1rem" })
|
|
8811
8945
|
}
|
|
8812
8946
|
)
|
|
8813
8947
|
] })
|
|
@@ -8823,13 +8957,13 @@ var FilterItems = ({
|
|
|
8823
8957
|
const next = [...filters];
|
|
8824
8958
|
next[index] = { ...next[index], [prop]: value };
|
|
8825
8959
|
if (prop === "operator") {
|
|
8826
|
-
if (["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
|
|
8960
|
+
if (!Array.isArray(value) && ["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
|
|
8827
8961
|
next[index].value = next[index].value[0];
|
|
8828
8962
|
}
|
|
8829
8963
|
if (filters[index].operator === "ndef" || filters[index].operator === "def") {
|
|
8830
8964
|
next[index].value = "";
|
|
8831
8965
|
}
|
|
8832
|
-
if (["between"].includes(value) && Array.isArray(next[index].value) === false) {
|
|
8966
|
+
if (!Array.isArray(value) && ["between"].includes(value) && Array.isArray(next[index].value) === false) {
|
|
8833
8967
|
next[index].value = [next[index].value, ""];
|
|
8834
8968
|
}
|
|
8835
8969
|
if (value === "def" || value === "true") {
|
|
@@ -8849,12 +8983,12 @@ var FilterItems = ({
|
|
|
8849
8983
|
}
|
|
8850
8984
|
setFilters(next);
|
|
8851
8985
|
};
|
|
8852
|
-
return /* @__PURE__ */
|
|
8986
|
+
return /* @__PURE__ */ jsx85(
|
|
8853
8987
|
FilterMenu,
|
|
8854
8988
|
{
|
|
8855
8989
|
id: "search-and-filter-options",
|
|
8856
8990
|
dataTestId: "search-and-filter-options",
|
|
8857
|
-
menuControls: /* @__PURE__ */
|
|
8991
|
+
menuControls: /* @__PURE__ */ jsxs47(
|
|
8858
8992
|
"button",
|
|
8859
8993
|
{
|
|
8860
8994
|
type: "button",
|
|
@@ -8862,7 +8996,7 @@ var FilterItems = ({
|
|
|
8862
8996
|
onClick: handleAddFilter,
|
|
8863
8997
|
"data-testid": "add-filter",
|
|
8864
8998
|
children: [
|
|
8865
|
-
/* @__PURE__ */
|
|
8999
|
+
/* @__PURE__ */ jsx85(Icon8, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
|
|
8866
9000
|
addButtonText
|
|
8867
9001
|
]
|
|
8868
9002
|
}
|
|
@@ -8876,7 +9010,7 @@ var FilterItems = ({
|
|
|
8876
9010
|
})) == null ? void 0 : _a.options) != null ? _b : [];
|
|
8877
9011
|
const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
|
|
8878
9012
|
const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
|
|
8879
|
-
return /* @__PURE__ */
|
|
9013
|
+
return /* @__PURE__ */ jsx85(
|
|
8880
9014
|
FilterItem,
|
|
8881
9015
|
{
|
|
8882
9016
|
index: i,
|
|
@@ -8899,7 +9033,7 @@ import { VerticalRhythm as VerticalRhythm7 } from "@uniformdev/design-system";
|
|
|
8899
9033
|
|
|
8900
9034
|
// src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
|
|
8901
9035
|
import { Button as Button6, Callout as Callout6, HorizontalRhythm as HorizontalRhythm9, Paragraph } from "@uniformdev/design-system";
|
|
8902
|
-
import { Fragment as
|
|
9036
|
+
import { Fragment as Fragment17, jsx as jsx86, jsxs as jsxs48 } from "@emotion/react/jsx-runtime";
|
|
8903
9037
|
var SearchAndFilterResultContainer = ({
|
|
8904
9038
|
buttonText,
|
|
8905
9039
|
clearButtonLabel = "clear",
|
|
@@ -8929,31 +9063,40 @@ var SearchAndFilterResultContainer = ({
|
|
|
8929
9063
|
handleResetFilters();
|
|
8930
9064
|
}
|
|
8931
9065
|
};
|
|
8932
|
-
return /* @__PURE__ */
|
|
8933
|
-
/* @__PURE__ */
|
|
8934
|
-
/* @__PURE__ */
|
|
9066
|
+
return /* @__PURE__ */ jsxs48(Fragment17, { children: [
|
|
9067
|
+
/* @__PURE__ */ jsxs48(HorizontalRhythm9, { children: [
|
|
9068
|
+
/* @__PURE__ */ jsxs48("span", { children: [
|
|
8935
9069
|
totalResults,
|
|
8936
9070
|
" results ",
|
|
8937
9071
|
searchTerm ? `for "${searchTerm}"` : null
|
|
8938
9072
|
] }),
|
|
8939
|
-
!searchTerm || hideClearButton ? null : /* @__PURE__ */
|
|
9073
|
+
!searchTerm || hideClearButton ? null : /* @__PURE__ */ jsx86(Button6, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
|
|
8940
9074
|
] }),
|
|
8941
|
-
totalResults === 0 ? /* @__PURE__ */
|
|
8942
|
-
calloutText ? /* @__PURE__ */
|
|
8943
|
-
hideClearButton ? null : /* @__PURE__ */
|
|
9075
|
+
totalResults === 0 ? /* @__PURE__ */ jsxs48(Callout6, { title: calloutTitle != null ? calloutTitle : automateCalloutTitle(), type: "note", children: [
|
|
9076
|
+
calloutText ? /* @__PURE__ */ jsx86(Paragraph, { children: calloutText }) : null,
|
|
9077
|
+
hideClearButton ? null : /* @__PURE__ */ jsx86(
|
|
9078
|
+
Button6,
|
|
9079
|
+
{
|
|
9080
|
+
buttonType: "tertiaryOutline",
|
|
9081
|
+
size: "xs",
|
|
9082
|
+
onClick: handleClearSearch,
|
|
9083
|
+
"data-testid": "clear-search",
|
|
9084
|
+
children: buttonText != null ? buttonText : "Clear search"
|
|
9085
|
+
}
|
|
9086
|
+
)
|
|
8944
9087
|
] }) : null
|
|
8945
9088
|
] });
|
|
8946
9089
|
};
|
|
8947
9090
|
|
|
8948
9091
|
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
8949
|
-
import { jsx as
|
|
9092
|
+
import { jsx as jsx87, jsxs as jsxs49 } from "@emotion/react/jsx-runtime";
|
|
8950
9093
|
var SearchAndFilter = ({
|
|
8951
9094
|
filters,
|
|
8952
9095
|
filterOptions,
|
|
8953
9096
|
filterVisible,
|
|
8954
9097
|
filterControls,
|
|
8955
9098
|
viewSwitchControls,
|
|
8956
|
-
resultsContainerView = /* @__PURE__ */
|
|
9099
|
+
resultsContainerView = /* @__PURE__ */ jsx87(SearchAndFilterResultContainer, {}),
|
|
8957
9100
|
filterMapper: filterMapper2 = filterMapper,
|
|
8958
9101
|
additionalFiltersContainer,
|
|
8959
9102
|
onChange,
|
|
@@ -8963,7 +9106,7 @@ var SearchAndFilter = ({
|
|
|
8963
9106
|
allowBindingSearchTerm = false,
|
|
8964
9107
|
resetFilterValues = []
|
|
8965
9108
|
}) => {
|
|
8966
|
-
return /* @__PURE__ */
|
|
9109
|
+
return /* @__PURE__ */ jsx87(
|
|
8967
9110
|
SearchAndFilterProvider,
|
|
8968
9111
|
{
|
|
8969
9112
|
filters,
|
|
@@ -8976,18 +9119,18 @@ var SearchAndFilter = ({
|
|
|
8976
9119
|
resetFilterValues,
|
|
8977
9120
|
filterMapper: filterMapper2,
|
|
8978
9121
|
allowBindingSearchTerm,
|
|
8979
|
-
children: /* @__PURE__ */
|
|
8980
|
-
/* @__PURE__ */
|
|
8981
|
-
/* @__PURE__ */
|
|
9122
|
+
children: /* @__PURE__ */ jsxs49(VerticalRhythm7, { "data-testid": "search-and-filter", children: [
|
|
9123
|
+
/* @__PURE__ */ jsxs49("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
|
|
9124
|
+
/* @__PURE__ */ jsx87(
|
|
8982
9125
|
"div",
|
|
8983
9126
|
{
|
|
8984
9127
|
css: SearchAndFilterControlsWrapper(viewSwitchControls ? "auto 1fr 0.05fr" : "auto 1fr"),
|
|
8985
|
-
children: !filterControls ? /* @__PURE__ */
|
|
9128
|
+
children: !filterControls ? /* @__PURE__ */ jsx87(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
|
|
8986
9129
|
}
|
|
8987
9130
|
),
|
|
8988
9131
|
viewSwitchControls
|
|
8989
9132
|
] }),
|
|
8990
|
-
/* @__PURE__ */
|
|
9133
|
+
/* @__PURE__ */ jsx87(FilterItems, { additionalFiltersContainer }),
|
|
8991
9134
|
resultsContainerView
|
|
8992
9135
|
] })
|
|
8993
9136
|
}
|
|
@@ -8996,9 +9139,9 @@ var SearchAndFilter = ({
|
|
|
8996
9139
|
|
|
8997
9140
|
// src/components/SearchAndFilter/SearchOnlyFilter.tsx
|
|
8998
9141
|
import { InputKeywordSearch as InputKeywordSearch3 } from "@uniformdev/design-system";
|
|
8999
|
-
import { createContext as createContext7, useState as
|
|
9000
|
-
import { useDebounce as
|
|
9001
|
-
import { jsx as
|
|
9142
|
+
import { createContext as createContext7, useState as useState26 } from "react";
|
|
9143
|
+
import { useDebounce as useDebounce10 } from "react-use";
|
|
9144
|
+
import { jsx as jsx88 } from "@emotion/react/jsx-runtime";
|
|
9002
9145
|
var SearchOnlyContext = createContext7({
|
|
9003
9146
|
searchTerm: "",
|
|
9004
9147
|
setSearchTerm: () => {
|
|
@@ -9006,8 +9149,8 @@ var SearchOnlyContext = createContext7({
|
|
|
9006
9149
|
});
|
|
9007
9150
|
var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
9008
9151
|
const { searchTerm, setSearchTerm } = useSearchAndFilter();
|
|
9009
|
-
const [localeSearchTerm, setLocaleSearchTerm] =
|
|
9010
|
-
|
|
9152
|
+
const [localeSearchTerm, setLocaleSearchTerm] = useState26("");
|
|
9153
|
+
useDebounce10(
|
|
9011
9154
|
() => {
|
|
9012
9155
|
setSearchTerm(localeSearchTerm);
|
|
9013
9156
|
onSearchChange == null ? void 0 : onSearchChange(localeSearchTerm);
|
|
@@ -9015,14 +9158,14 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
9015
9158
|
300,
|
|
9016
9159
|
[localeSearchTerm]
|
|
9017
9160
|
);
|
|
9018
|
-
return /* @__PURE__ */
|
|
9161
|
+
return /* @__PURE__ */ jsx88(
|
|
9019
9162
|
SearchOnlyContext.Provider,
|
|
9020
9163
|
{
|
|
9021
9164
|
value: {
|
|
9022
9165
|
searchTerm,
|
|
9023
9166
|
setSearchTerm: setLocaleSearchTerm
|
|
9024
9167
|
},
|
|
9025
|
-
children: /* @__PURE__ */
|
|
9168
|
+
children: /* @__PURE__ */ jsx88("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ jsx88(
|
|
9026
9169
|
InputKeywordSearch3,
|
|
9027
9170
|
{
|
|
9028
9171
|
placeholder: "Search...",
|
|
@@ -9037,7 +9180,7 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
9037
9180
|
};
|
|
9038
9181
|
|
|
9039
9182
|
// src/components/SearchAndFilter/SortItems.tsx
|
|
9040
|
-
import { InputComboBox as
|
|
9183
|
+
import { InputComboBox as InputComboBox6, InputSelect as InputSelect8, SegmentedControl, VerticalRhythm as VerticalRhythm8 } from "@uniformdev/design-system";
|
|
9041
9184
|
|
|
9042
9185
|
// src/components/SearchAndFilter/styles/SortItems.styles.ts
|
|
9043
9186
|
import { css as css39 } from "@emotion/react";
|
|
@@ -9273,7 +9416,7 @@ var InputVariableWrapper = css39`
|
|
|
9273
9416
|
`;
|
|
9274
9417
|
|
|
9275
9418
|
// src/components/SearchAndFilter/SortItems.tsx
|
|
9276
|
-
import { jsx as
|
|
9419
|
+
import { jsx as jsx89, jsxs as jsxs50 } from "@emotion/react/jsx-runtime";
|
|
9277
9420
|
var SortItems = ({
|
|
9278
9421
|
sortByLabel = "Sort by",
|
|
9279
9422
|
localeLabel = "Show locale",
|
|
@@ -9295,11 +9438,11 @@ var SortItems = ({
|
|
|
9295
9438
|
return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
|
|
9296
9439
|
})) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
|
|
9297
9440
|
const localeLabelValue = sortOptions.length > 1 ? localeLabel : `${localeLabel}s`;
|
|
9298
|
-
return /* @__PURE__ */
|
|
9299
|
-
/* @__PURE__ */
|
|
9300
|
-
/* @__PURE__ */
|
|
9301
|
-
/* @__PURE__ */
|
|
9302
|
-
/* @__PURE__ */
|
|
9441
|
+
return /* @__PURE__ */ jsxs50("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
|
|
9442
|
+
/* @__PURE__ */ jsxs50(VerticalRhythm8, { gap: "xs", children: [
|
|
9443
|
+
/* @__PURE__ */ jsx89("span", { css: Title2, children: sortByLabel }),
|
|
9444
|
+
/* @__PURE__ */ jsxs50("div", { css: SortFilterInputRow, children: [
|
|
9445
|
+
/* @__PURE__ */ jsx89(
|
|
9303
9446
|
InputVariables,
|
|
9304
9447
|
{
|
|
9305
9448
|
disableInlineMenu: disableSortBinding,
|
|
@@ -9307,8 +9450,8 @@ var SortItems = ({
|
|
|
9307
9450
|
value: sortField,
|
|
9308
9451
|
valueToResetTo: "created_at",
|
|
9309
9452
|
onChange: (e) => onSortChange(`${e}_${sortDirection}`),
|
|
9310
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
9311
|
-
|
|
9453
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx89(
|
|
9454
|
+
InputComboBox6,
|
|
9312
9455
|
{
|
|
9313
9456
|
id: "sort-by-field",
|
|
9314
9457
|
"aria-label": "Sort by",
|
|
@@ -9330,7 +9473,7 @@ var SortItems = ({
|
|
|
9330
9473
|
)
|
|
9331
9474
|
}
|
|
9332
9475
|
),
|
|
9333
|
-
/* @__PURE__ */
|
|
9476
|
+
/* @__PURE__ */ jsx89(
|
|
9334
9477
|
InputVariables,
|
|
9335
9478
|
{
|
|
9336
9479
|
disableInlineMenu: disableSortBinding,
|
|
@@ -9338,7 +9481,7 @@ var SortItems = ({
|
|
|
9338
9481
|
valueToResetTo: "DESC",
|
|
9339
9482
|
showMenuPosition: disableSortBinding ? void 0 : "inline-right",
|
|
9340
9483
|
onChange: (e) => onSortChange(`${sortField}_${e}`),
|
|
9341
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
9484
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx89(
|
|
9342
9485
|
SegmentedControl,
|
|
9343
9486
|
{
|
|
9344
9487
|
noCheckmark: true,
|
|
@@ -9370,14 +9513,14 @@ var SortItems = ({
|
|
|
9370
9513
|
)
|
|
9371
9514
|
] })
|
|
9372
9515
|
] }),
|
|
9373
|
-
hideLocaleOptions ? null : /* @__PURE__ */
|
|
9516
|
+
hideLocaleOptions ? null : /* @__PURE__ */ jsx89(VerticalRhythm8, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ jsx89(
|
|
9374
9517
|
InputVariables,
|
|
9375
9518
|
{
|
|
9376
9519
|
label: localeLabelValue,
|
|
9377
9520
|
value: localeValue,
|
|
9378
9521
|
showMenuPosition: "inline-right",
|
|
9379
9522
|
onChange: (e) => onLocaleChange(e != null ? e : ""),
|
|
9380
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
9523
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx89(
|
|
9381
9524
|
InputSelect8,
|
|
9382
9525
|
{
|
|
9383
9526
|
name: "localeReturned",
|
|
@@ -9408,7 +9551,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
9408
9551
|
|
|
9409
9552
|
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
9410
9553
|
import { bindVariables as bindVariables2, createVariableReference as createVariableReference4, LOCALE_DYNAMIC_INPUT_NAME as LOCALE_DYNAMIC_INPUT_NAME2 } from "@uniformdev/canvas";
|
|
9411
|
-
import { useEffect as
|
|
9554
|
+
import { useEffect as useEffect24, useRef as useRef17 } from "react";
|
|
9412
9555
|
function useContentDataResourceLocaleInfo({
|
|
9413
9556
|
locale,
|
|
9414
9557
|
setLocale,
|
|
@@ -9420,7 +9563,7 @@ function useContentDataResourceLocaleInfo({
|
|
|
9420
9563
|
const { flatVariables } = useVariables();
|
|
9421
9564
|
const effectiveLocale = locale != null ? locale : dynamicInputs[LOCALE_DYNAMIC_INPUT_NAME2] ? createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2) : "";
|
|
9422
9565
|
const boundLocale = (_a = bindVariables2({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
9423
|
-
|
|
9566
|
+
useEffect24(() => {
|
|
9424
9567
|
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
9425
9568
|
setLocaleRef.current(createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2));
|
|
9426
9569
|
}
|
|
@@ -9435,8 +9578,8 @@ import {
|
|
|
9435
9578
|
Callout as Callout7,
|
|
9436
9579
|
DrawerContent,
|
|
9437
9580
|
Heading,
|
|
9438
|
-
Input as
|
|
9439
|
-
InputComboBox as
|
|
9581
|
+
Input as Input11,
|
|
9582
|
+
InputComboBox as InputComboBox7,
|
|
9440
9583
|
InputKeywordSearch as InputKeywordSearch4,
|
|
9441
9584
|
InputSelect as InputSelect9,
|
|
9442
9585
|
InputToggle as InputToggle3,
|
|
@@ -9502,8 +9645,8 @@ export {
|
|
|
9502
9645
|
Heading,
|
|
9503
9646
|
INSERT_VARIABLE_COMMAND,
|
|
9504
9647
|
icons_exports as Icons,
|
|
9505
|
-
|
|
9506
|
-
|
|
9648
|
+
Input11 as Input,
|
|
9649
|
+
InputComboBox7 as InputComboBox,
|
|
9507
9650
|
InputKeywordSearch4 as InputKeywordSearch,
|
|
9508
9651
|
InputSelect9 as InputSelect,
|
|
9509
9652
|
InputToggle3 as InputToggle,
|
|
@@ -9595,6 +9738,7 @@ export {
|
|
|
9595
9738
|
VariablesList,
|
|
9596
9739
|
VariablesPlugin,
|
|
9597
9740
|
VariablesProvider,
|
|
9741
|
+
WORKFLOW_STAGES_OPERATORS,
|
|
9598
9742
|
badgeIcon,
|
|
9599
9743
|
bindableFiltersMapper,
|
|
9600
9744
|
convertConnectedDataToVariable,
|