@uniformdev/mesh-sdk-react 20.50.2-alpha.1 → 20.50.2-alpha.39
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 +64 -5
- package/dist/index.d.ts +64 -5
- package/dist/index.esm.js +389 -269
- package/dist/index.js +630 -506
- package/dist/index.mjs +389 -269
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -266,6 +266,22 @@ function useConnectedDataAsVariables(connectedData) {
|
|
|
266
266
|
);
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
+
// src/hooks/useDelegation.ts
|
|
270
|
+
import { useContext } from "react";
|
|
271
|
+
|
|
272
|
+
// src/components/Delegation/DelegationContext.ts
|
|
273
|
+
import { createContext } from "react";
|
|
274
|
+
var DelegationContext = createContext(null);
|
|
275
|
+
|
|
276
|
+
// src/hooks/useDelegation.ts
|
|
277
|
+
function useDelegation() {
|
|
278
|
+
const ctx = useContext(DelegationContext);
|
|
279
|
+
if (!ctx) {
|
|
280
|
+
throw new Error("useDelegation must be used within a <DelegationProvider>");
|
|
281
|
+
}
|
|
282
|
+
return ctx;
|
|
283
|
+
}
|
|
284
|
+
|
|
269
285
|
// src/hooks/useDynamicInputsAsVariables.tsx
|
|
270
286
|
import { LOCALE_DYNAMIC_INPUT_NAME } from "@uniformdev/canvas";
|
|
271
287
|
import { useMemo as useMemo2 } from "react";
|
|
@@ -309,15 +325,15 @@ Current preview value: ${input3.value || "not provided"}`
|
|
|
309
325
|
import { useMemo as useMemo4, useRef } from "react";
|
|
310
326
|
|
|
311
327
|
// src/components/UniformMeshLocationContext.tsx
|
|
312
|
-
import { createContext as
|
|
328
|
+
import { createContext as createContext3, useContext as useContext3, useMemo as useMemo3, useState } from "react";
|
|
313
329
|
|
|
314
330
|
// src/components/UniformMeshSdkContext.tsx
|
|
315
331
|
import { Theme } from "@uniformdev/design-system";
|
|
316
|
-
import { createContext, useContext } from "react";
|
|
332
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
317
333
|
import { jsx as jsx16, jsxs as jsxs4 } from "@emotion/react/jsx-runtime";
|
|
318
|
-
var UniformMeshSdkContext =
|
|
334
|
+
var UniformMeshSdkContext = createContext2(void 0);
|
|
319
335
|
var useUniformMeshSdkContext = () => {
|
|
320
|
-
const context =
|
|
336
|
+
const context = useContext2(UniformMeshSdkContext);
|
|
321
337
|
if (!context) {
|
|
322
338
|
throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");
|
|
323
339
|
}
|
|
@@ -332,7 +348,7 @@ function useUniformMeshSdk() {
|
|
|
332
348
|
|
|
333
349
|
// src/components/UniformMeshLocationContext.tsx
|
|
334
350
|
import { jsx as jsx17 } from "@emotion/react/jsx-runtime";
|
|
335
|
-
var UniformMeshLocationContext =
|
|
351
|
+
var UniformMeshLocationContext = createContext3(void 0);
|
|
336
352
|
var UniformMeshLocationContextProvider = ({
|
|
337
353
|
children
|
|
338
354
|
}) => {
|
|
@@ -355,7 +371,7 @@ var UniformMeshLocationContextProvider = ({
|
|
|
355
371
|
return /* @__PURE__ */ jsx17(UniformMeshLocationContext.Provider, { value: { location }, children });
|
|
356
372
|
};
|
|
357
373
|
var useUniformMeshLocationContext = () => {
|
|
358
|
-
const context =
|
|
374
|
+
const context = useContext3(UniformMeshLocationContext);
|
|
359
375
|
if (!context) {
|
|
360
376
|
throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");
|
|
361
377
|
}
|
|
@@ -720,7 +736,7 @@ var variablesTipText = css`
|
|
|
720
736
|
|
|
721
737
|
// src/components/Variables/VariablesProvider.tsx
|
|
722
738
|
import mitt from "mitt";
|
|
723
|
-
import { createContext as
|
|
739
|
+
import { createContext as createContext4, useContext as useContext4, useEffect as useEffect3, useMemo as useMemo5, useState as useState3 } from "react";
|
|
724
740
|
|
|
725
741
|
// src/components/Variables/util/useVariableEditTransaction.ts
|
|
726
742
|
import { useCallback, useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -909,7 +925,7 @@ function VariableEditor({
|
|
|
909
925
|
|
|
910
926
|
// src/components/Variables/VariablesProvider.tsx
|
|
911
927
|
import { jsx as jsx20, jsxs as jsxs6 } from "@emotion/react/jsx-runtime";
|
|
912
|
-
var VariablesContext =
|
|
928
|
+
var VariablesContext = createContext4(null);
|
|
913
929
|
function VariablesProvider({
|
|
914
930
|
value,
|
|
915
931
|
onChange,
|
|
@@ -1034,7 +1050,7 @@ function VariablesProvider({
|
|
|
1034
1050
|
] });
|
|
1035
1051
|
}
|
|
1036
1052
|
function useVariables(returnEmptyWithoutProvider = false) {
|
|
1037
|
-
const context =
|
|
1053
|
+
const context = useContext4(VariablesContext);
|
|
1038
1054
|
if (!context) {
|
|
1039
1055
|
if (returnEmptyWithoutProvider) {
|
|
1040
1056
|
return {
|
|
@@ -3887,17 +3903,106 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
3887
3903
|
};
|
|
3888
3904
|
}
|
|
3889
3905
|
|
|
3906
|
+
// src/components/Delegation/DelegationGate.tsx
|
|
3907
|
+
import { Fragment as Fragment10, jsx as jsx46 } from "@emotion/react/jsx-runtime";
|
|
3908
|
+
function DelegationGate({
|
|
3909
|
+
children,
|
|
3910
|
+
loadingComponent,
|
|
3911
|
+
disabledComponent,
|
|
3912
|
+
errorComponent
|
|
3913
|
+
}) {
|
|
3914
|
+
const { status, error } = useDelegation();
|
|
3915
|
+
if (status === "active") {
|
|
3916
|
+
return /* @__PURE__ */ jsx46(Fragment10, { children });
|
|
3917
|
+
}
|
|
3918
|
+
if (status === "idle" || status === "acquiring") {
|
|
3919
|
+
return /* @__PURE__ */ jsx46(Fragment10, { children: loadingComponent != null ? loadingComponent : null });
|
|
3920
|
+
}
|
|
3921
|
+
if (status === "disabled") {
|
|
3922
|
+
return /* @__PURE__ */ jsx46(Fragment10, { children: disabledComponent != null ? disabledComponent : null });
|
|
3923
|
+
}
|
|
3924
|
+
if (status === "error") {
|
|
3925
|
+
const resolvedError = error != null ? error : new Error("Unknown delegation error");
|
|
3926
|
+
if (typeof errorComponent === "function") {
|
|
3927
|
+
return /* @__PURE__ */ jsx46(Fragment10, { children: errorComponent({ error: resolvedError }) });
|
|
3928
|
+
}
|
|
3929
|
+
return /* @__PURE__ */ jsx46(Fragment10, { children: errorComponent != null ? errorComponent : null });
|
|
3930
|
+
}
|
|
3931
|
+
return null;
|
|
3932
|
+
}
|
|
3933
|
+
|
|
3934
|
+
// src/components/Delegation/DelegationProvider.tsx
|
|
3935
|
+
import { useCallback as useCallback5, useEffect as useEffect12, useMemo as useMemo12, useRef as useRef7, useState as useState11 } from "react";
|
|
3936
|
+
import { jsx as jsx47 } from "@emotion/react/jsx-runtime";
|
|
3937
|
+
function DelegationProvider({ sdk, onSessionToken, checkActive, children }) {
|
|
3938
|
+
const [status, setStatus] = useState11("idle");
|
|
3939
|
+
const [error, setError] = useState11(null);
|
|
3940
|
+
const acquiringRef = useRef7(false);
|
|
3941
|
+
const mountedRef = useRef7(true);
|
|
3942
|
+
const acquire = useCallback5(async () => {
|
|
3943
|
+
if (acquiringRef.current) {
|
|
3944
|
+
return;
|
|
3945
|
+
}
|
|
3946
|
+
acquiringRef.current = true;
|
|
3947
|
+
setStatus("acquiring");
|
|
3948
|
+
setError(null);
|
|
3949
|
+
try {
|
|
3950
|
+
const isActive = await checkActive();
|
|
3951
|
+
if (isActive) {
|
|
3952
|
+
if (mountedRef.current) {
|
|
3953
|
+
setStatus("active");
|
|
3954
|
+
}
|
|
3955
|
+
return;
|
|
3956
|
+
}
|
|
3957
|
+
if (!mountedRef.current) {
|
|
3958
|
+
return;
|
|
3959
|
+
}
|
|
3960
|
+
const sessionToken = await sdk.getSessionToken();
|
|
3961
|
+
if (!mountedRef.current) {
|
|
3962
|
+
return;
|
|
3963
|
+
}
|
|
3964
|
+
if (!sessionToken) {
|
|
3965
|
+
setStatus("disabled");
|
|
3966
|
+
return;
|
|
3967
|
+
}
|
|
3968
|
+
await onSessionToken(sessionToken);
|
|
3969
|
+
if (mountedRef.current) {
|
|
3970
|
+
setStatus("active");
|
|
3971
|
+
}
|
|
3972
|
+
} catch (err) {
|
|
3973
|
+
if (mountedRef.current) {
|
|
3974
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
3975
|
+
setStatus("error");
|
|
3976
|
+
}
|
|
3977
|
+
} finally {
|
|
3978
|
+
acquiringRef.current = false;
|
|
3979
|
+
}
|
|
3980
|
+
}, [sdk, onSessionToken, checkActive]);
|
|
3981
|
+
useEffect12(() => {
|
|
3982
|
+
mountedRef.current = true;
|
|
3983
|
+
void acquire();
|
|
3984
|
+
return () => {
|
|
3985
|
+
mountedRef.current = false;
|
|
3986
|
+
};
|
|
3987
|
+
}, [acquire]);
|
|
3988
|
+
const reacquire = useCallback5(() => {
|
|
3989
|
+
void acquire();
|
|
3990
|
+
}, [acquire]);
|
|
3991
|
+
const value = useMemo12(() => ({ status, error, reacquire }), [status, error, reacquire]);
|
|
3992
|
+
return /* @__PURE__ */ jsx47(DelegationContext.Provider, { value, children });
|
|
3993
|
+
}
|
|
3994
|
+
|
|
3890
3995
|
// src/components/MeshApp.tsx
|
|
3891
3996
|
import { LoadingIndicator as LoadingIndicator2, Theme as Theme2 } from "@uniformdev/design-system";
|
|
3892
3997
|
|
|
3893
3998
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
3894
3999
|
import { initializeUniformMeshSDK } from "@uniformdev/mesh-sdk";
|
|
3895
|
-
import { useEffect as
|
|
4000
|
+
import { useEffect as useEffect13, useRef as useRef8, useState as useState12 } from "react";
|
|
3896
4001
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
3897
|
-
const [error, setError] =
|
|
3898
|
-
const [sdk, setSdk] =
|
|
3899
|
-
const initializationInProgress =
|
|
3900
|
-
|
|
4002
|
+
const [error, setError] = useState12();
|
|
4003
|
+
const [sdk, setSdk] = useState12();
|
|
4004
|
+
const initializationInProgress = useRef8(false);
|
|
4005
|
+
useEffect13(
|
|
3901
4006
|
() => {
|
|
3902
4007
|
if (typeof window === "undefined" || sdk) {
|
|
3903
4008
|
return;
|
|
@@ -3930,7 +4035,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
|
3930
4035
|
};
|
|
3931
4036
|
|
|
3932
4037
|
// src/components/MeshApp.tsx
|
|
3933
|
-
import { jsx as
|
|
4038
|
+
import { jsx as jsx48, jsxs as jsxs21 } from "@emotion/react/jsx-runtime";
|
|
3934
4039
|
var MeshApp = ({
|
|
3935
4040
|
children,
|
|
3936
4041
|
loadingComponent,
|
|
@@ -3939,25 +4044,25 @@ var MeshApp = ({
|
|
|
3939
4044
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
3940
4045
|
if (initializing || !sdk) {
|
|
3941
4046
|
const LoadingComponent = loadingComponent;
|
|
3942
|
-
return LoadingComponent ? /* @__PURE__ */
|
|
4047
|
+
return LoadingComponent ? /* @__PURE__ */ jsx48(LoadingComponent, {}) : /* @__PURE__ */ jsx48(LoadingIndicator2, {});
|
|
3943
4048
|
}
|
|
3944
4049
|
if (error) {
|
|
3945
4050
|
const ErrorComponent = errorComponent;
|
|
3946
4051
|
if (ErrorComponent) {
|
|
3947
|
-
return /* @__PURE__ */
|
|
4052
|
+
return /* @__PURE__ */ jsx48(ErrorComponent, { error });
|
|
3948
4053
|
}
|
|
3949
4054
|
throw error;
|
|
3950
4055
|
}
|
|
3951
4056
|
return /* @__PURE__ */ jsxs21(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
|
|
3952
|
-
/* @__PURE__ */
|
|
3953
|
-
/* @__PURE__ */
|
|
4057
|
+
/* @__PURE__ */ jsx48(Theme2, {}),
|
|
4058
|
+
/* @__PURE__ */ jsx48(UniformMeshLocationContextProvider, { children })
|
|
3954
4059
|
] });
|
|
3955
4060
|
};
|
|
3956
4061
|
|
|
3957
4062
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
3958
4063
|
import { css as css14 } from "@emotion/react";
|
|
3959
4064
|
import { Button as Button2, LoadingIndicator as LoadingIndicator3 } from "@uniformdev/design-system";
|
|
3960
|
-
import { jsx as
|
|
4065
|
+
import { jsx as jsx49, jsxs as jsxs22 } from "@emotion/react/jsx-runtime";
|
|
3961
4066
|
var DataRefreshButton = ({
|
|
3962
4067
|
buttonText,
|
|
3963
4068
|
isLoading,
|
|
@@ -3965,7 +4070,7 @@ var DataRefreshButton = ({
|
|
|
3965
4070
|
...props
|
|
3966
4071
|
}) => {
|
|
3967
4072
|
return /* @__PURE__ */ jsxs22(Button2, { buttonType: "ghost", onClick: onRefreshData, disabled: isLoading, ...props, children: [
|
|
3968
|
-
!isLoading ? null : /* @__PURE__ */
|
|
4073
|
+
!isLoading ? null : /* @__PURE__ */ jsx49(
|
|
3969
4074
|
LoadingIndicator3,
|
|
3970
4075
|
{
|
|
3971
4076
|
css: css14`
|
|
@@ -3985,15 +4090,15 @@ import { Callout as Callout3, Container, ScrollableList, VerticalRhythm as Verti
|
|
|
3985
4090
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
3986
4091
|
import { bindVariablesToObject as bindVariablesToObject2 } from "@uniformdev/canvas";
|
|
3987
4092
|
import {
|
|
3988
|
-
createContext as
|
|
3989
|
-
useCallback as
|
|
3990
|
-
useContext as
|
|
4093
|
+
createContext as createContext6,
|
|
4094
|
+
useCallback as useCallback6,
|
|
4095
|
+
useContext as useContext6,
|
|
3991
4096
|
useDeferredValue,
|
|
3992
|
-
useMemo as
|
|
3993
|
-
useState as
|
|
4097
|
+
useMemo as useMemo13,
|
|
4098
|
+
useState as useState13
|
|
3994
4099
|
} from "react";
|
|
3995
|
-
import { jsx as
|
|
3996
|
-
var ObjectSearchContext =
|
|
4100
|
+
import { jsx as jsx50 } from "@emotion/react/jsx-runtime";
|
|
4101
|
+
var ObjectSearchContext = createContext6({
|
|
3997
4102
|
onSetQuery: () => {
|
|
3998
4103
|
},
|
|
3999
4104
|
onSelectItem: () => {
|
|
@@ -4014,16 +4119,16 @@ var ObjectSearchProvider = ({
|
|
|
4014
4119
|
children,
|
|
4015
4120
|
defaultQuery
|
|
4016
4121
|
}) => {
|
|
4017
|
-
const [query, setQuery] =
|
|
4122
|
+
const [query, setQuery] = useState13({
|
|
4018
4123
|
contentType: "",
|
|
4019
4124
|
keyword: "",
|
|
4020
4125
|
...defaultQuery
|
|
4021
4126
|
});
|
|
4022
4127
|
const { flatVariables } = useVariables(true);
|
|
4023
4128
|
const querySearchDeferred = useDeferredValue(query);
|
|
4024
|
-
const [selectedItems, setSelectedItems] =
|
|
4025
|
-
const [list, setList] =
|
|
4026
|
-
const onSetQuery =
|
|
4129
|
+
const [selectedItems, setSelectedItems] = useState13(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
4130
|
+
const [list, setList] = useState13({});
|
|
4131
|
+
const onSetQuery = useCallback6(
|
|
4027
4132
|
(value2) => {
|
|
4028
4133
|
if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
|
|
4029
4134
|
return setQuery({
|
|
@@ -4035,7 +4140,7 @@ var ObjectSearchProvider = ({
|
|
|
4035
4140
|
},
|
|
4036
4141
|
[setQuery]
|
|
4037
4142
|
);
|
|
4038
|
-
const onSelectItem =
|
|
4143
|
+
const onSelectItem = useCallback6(
|
|
4039
4144
|
(selectedResult) => {
|
|
4040
4145
|
if (Array.isArray(selectedResult)) {
|
|
4041
4146
|
setSelectedItems(selectedResult);
|
|
@@ -4049,17 +4154,17 @@ var ObjectSearchProvider = ({
|
|
|
4049
4154
|
},
|
|
4050
4155
|
[setSelectedItems, selectedItems]
|
|
4051
4156
|
);
|
|
4052
|
-
const onRemoveAllSelectedItems =
|
|
4157
|
+
const onRemoveAllSelectedItems = useCallback6(() => {
|
|
4053
4158
|
setSelectedItems([]);
|
|
4054
4159
|
}, [setSelectedItems]);
|
|
4055
|
-
const onSetList =
|
|
4160
|
+
const onSetList = useCallback6(
|
|
4056
4161
|
(value2) => {
|
|
4057
4162
|
setList(value2);
|
|
4058
4163
|
},
|
|
4059
4164
|
[setList]
|
|
4060
4165
|
);
|
|
4061
|
-
const boundQuery =
|
|
4062
|
-
const value =
|
|
4166
|
+
const boundQuery = useMemo13(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
4167
|
+
const value = useMemo13(
|
|
4063
4168
|
() => ({
|
|
4064
4169
|
boundQuery,
|
|
4065
4170
|
onSetQuery,
|
|
@@ -4083,10 +4188,10 @@ var ObjectSearchProvider = ({
|
|
|
4083
4188
|
onSetList
|
|
4084
4189
|
]
|
|
4085
4190
|
);
|
|
4086
|
-
return /* @__PURE__ */
|
|
4191
|
+
return /* @__PURE__ */ jsx50(ObjectSearchContext.Provider, { value, children });
|
|
4087
4192
|
};
|
|
4088
4193
|
function useObjectSearchContext() {
|
|
4089
|
-
return
|
|
4194
|
+
return useContext6(ObjectSearchContext);
|
|
4090
4195
|
}
|
|
4091
4196
|
function bindQuery(query, inputs) {
|
|
4092
4197
|
const { result, errors } = bindVariablesToObject2({
|
|
@@ -4179,7 +4284,7 @@ var ObjectListItemUnControlledContent = css15`
|
|
|
4179
4284
|
`;
|
|
4180
4285
|
|
|
4181
4286
|
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
4182
|
-
import { jsx as
|
|
4287
|
+
import { jsx as jsx51, jsxs as jsxs23 } from "@emotion/react/jsx-runtime";
|
|
4183
4288
|
var ObjectSearchListItem = ({
|
|
4184
4289
|
id,
|
|
4185
4290
|
title,
|
|
@@ -4220,7 +4325,7 @@ var ObjectSearchListItem = ({
|
|
|
4220
4325
|
css: ObjectListItemControlledContent,
|
|
4221
4326
|
"aria-disabled": disabled,
|
|
4222
4327
|
children: [
|
|
4223
|
-
imageUrl ? /* @__PURE__ */
|
|
4328
|
+
imageUrl ? /* @__PURE__ */ jsx51(
|
|
4224
4329
|
"img",
|
|
4225
4330
|
{
|
|
4226
4331
|
src: imageUrl,
|
|
@@ -4230,27 +4335,27 @@ var ObjectSearchListItem = ({
|
|
|
4230
4335
|
}
|
|
4231
4336
|
) : null,
|
|
4232
4337
|
/* @__PURE__ */ jsxs23("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
|
|
4233
|
-
!contentType ? null : /* @__PURE__ */
|
|
4234
|
-
/* @__PURE__ */
|
|
4338
|
+
!contentType ? null : /* @__PURE__ */ jsx51("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
|
|
4339
|
+
/* @__PURE__ */ jsx51("span", { css: ObjectListItemTitle, "data-testid": "title", children: title })
|
|
4235
4340
|
] })
|
|
4236
4341
|
]
|
|
4237
4342
|
}
|
|
4238
4343
|
),
|
|
4239
4344
|
/* @__PURE__ */ jsxs23("div", { css: ObjectListItemInfoContainer, children: [
|
|
4240
|
-
selected ? /* @__PURE__ */
|
|
4241
|
-
!popoverData ? null : /* @__PURE__ */
|
|
4345
|
+
selected ? /* @__PURE__ */ jsx51(Chip, { text: "selected", size: "xs" }) : null,
|
|
4346
|
+
!popoverData ? null : /* @__PURE__ */ jsx51(Popover, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4242
4347
|
] }),
|
|
4243
|
-
!children ? null : /* @__PURE__ */
|
|
4348
|
+
!children ? null : /* @__PURE__ */ jsx51("div", { css: ObjectListItemUnControlledContent, children })
|
|
4244
4349
|
]
|
|
4245
4350
|
}
|
|
4246
4351
|
);
|
|
4247
4352
|
};
|
|
4248
4353
|
var ObjectSearchListItemLoadingSkeleton = () => {
|
|
4249
|
-
return /* @__PURE__ */
|
|
4354
|
+
return /* @__PURE__ */ jsx51("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
|
|
4250
4355
|
};
|
|
4251
4356
|
|
|
4252
4357
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
4253
|
-
import { jsx as
|
|
4358
|
+
import { jsx as jsx52, jsxs as jsxs24 } from "@emotion/react/jsx-runtime";
|
|
4254
4359
|
var ObjectSearchContainer = ({
|
|
4255
4360
|
label,
|
|
4256
4361
|
enableDynamicInputToResultId,
|
|
@@ -4262,7 +4367,7 @@ var ObjectSearchContainer = ({
|
|
|
4262
4367
|
const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
|
|
4263
4368
|
const { flatVariables } = useVariables(true);
|
|
4264
4369
|
const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
|
|
4265
|
-
const listItems = resultList != null ? resultList : /* @__PURE__ */
|
|
4370
|
+
const listItems = resultList != null ? resultList : /* @__PURE__ */ jsx52(
|
|
4266
4371
|
ScrollableList,
|
|
4267
4372
|
{
|
|
4268
4373
|
role: "list",
|
|
@@ -4271,7 +4376,7 @@ var ObjectSearchContainer = ({
|
|
|
4271
4376
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
4272
4377
|
}
|
|
4273
4378
|
`,
|
|
4274
|
-
children: /* @__PURE__ */
|
|
4379
|
+
children: /* @__PURE__ */ jsx52(DefaultResultList, {})
|
|
4275
4380
|
}
|
|
4276
4381
|
);
|
|
4277
4382
|
const body = /* @__PURE__ */ jsxs24(VerticalRhythm3, { children: [
|
|
@@ -4306,7 +4411,7 @@ var ObjectSearchContainer = ({
|
|
|
4306
4411
|
]);
|
|
4307
4412
|
};
|
|
4308
4413
|
return /* @__PURE__ */ jsxs24(VerticalRhythm3, { children: [
|
|
4309
|
-
/* @__PURE__ */
|
|
4414
|
+
/* @__PURE__ */ jsx52(Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ jsx52(
|
|
4310
4415
|
InputVariables,
|
|
4311
4416
|
{
|
|
4312
4417
|
label,
|
|
@@ -4328,17 +4433,17 @@ var DefaultResultList = () => {
|
|
|
4328
4433
|
var _a;
|
|
4329
4434
|
const { list } = useObjectSearchContext();
|
|
4330
4435
|
if (!list.items) {
|
|
4331
|
-
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */
|
|
4436
|
+
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ jsx52(ObjectSearchListItemLoadingSkeleton, {}, i));
|
|
4332
4437
|
}
|
|
4333
4438
|
if (list.items.length === 0) {
|
|
4334
|
-
return /* @__PURE__ */
|
|
4439
|
+
return /* @__PURE__ */ jsx52(Callout3, { type: "info", children: "No results were found" });
|
|
4335
4440
|
}
|
|
4336
|
-
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */
|
|
4441
|
+
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ jsx52(ObjectSearchListItem, { ...item }, item.id));
|
|
4337
4442
|
};
|
|
4338
4443
|
|
|
4339
4444
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
4340
4445
|
import { DebouncedInputKeywordSearch, InputSelect as InputSelect3 } from "@uniformdev/design-system";
|
|
4341
|
-
import { useMemo as
|
|
4446
|
+
import { useMemo as useMemo14, useState as useState14 } from "react";
|
|
4342
4447
|
|
|
4343
4448
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
4344
4449
|
import { css as css17 } from "@emotion/react";
|
|
@@ -4361,7 +4466,7 @@ var ObjectSearchFilterGrid = (gridColumns) => css17`
|
|
|
4361
4466
|
`;
|
|
4362
4467
|
|
|
4363
4468
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
4364
|
-
import { jsx as
|
|
4469
|
+
import { jsx as jsx53, jsxs as jsxs25 } from "@emotion/react/jsx-runtime";
|
|
4365
4470
|
var ObjectSearchFilter = ({
|
|
4366
4471
|
requireContentType,
|
|
4367
4472
|
typeSelectorAllTypesOptionText = "All content types",
|
|
@@ -4372,7 +4477,7 @@ var ObjectSearchFilter = ({
|
|
|
4372
4477
|
}) => {
|
|
4373
4478
|
var _a, _b;
|
|
4374
4479
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
4375
|
-
const [searchState, setSearchState] =
|
|
4480
|
+
const [searchState, setSearchState] = useState14({
|
|
4376
4481
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
4377
4482
|
keyword: (_b = query.keyword) != null ? _b : ""
|
|
4378
4483
|
});
|
|
@@ -4382,7 +4487,7 @@ var ObjectSearchFilter = ({
|
|
|
4382
4487
|
});
|
|
4383
4488
|
onSetQuery({ ...query, ...value });
|
|
4384
4489
|
};
|
|
4385
|
-
const memoizedSelectOptions =
|
|
4490
|
+
const memoizedSelectOptions = useMemo14(() => {
|
|
4386
4491
|
if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
|
|
4387
4492
|
return [];
|
|
4388
4493
|
}
|
|
@@ -4400,7 +4505,7 @@ var ObjectSearchFilter = ({
|
|
|
4400
4505
|
ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
|
|
4401
4506
|
],
|
|
4402
4507
|
children: [
|
|
4403
|
-
memoizedSelectOptions.length ? /* @__PURE__ */
|
|
4508
|
+
memoizedSelectOptions.length ? /* @__PURE__ */ jsx53(
|
|
4404
4509
|
InputSelect3,
|
|
4405
4510
|
{
|
|
4406
4511
|
label: selectLabel,
|
|
@@ -4410,7 +4515,7 @@ var ObjectSearchFilter = ({
|
|
|
4410
4515
|
value: query.contentType
|
|
4411
4516
|
}
|
|
4412
4517
|
) : null,
|
|
4413
|
-
/* @__PURE__ */
|
|
4518
|
+
/* @__PURE__ */ jsx53(
|
|
4414
4519
|
DebouncedInputKeywordSearch,
|
|
4415
4520
|
{
|
|
4416
4521
|
inputFieldName: searchInputName,
|
|
@@ -4427,9 +4532,9 @@ var ObjectSearchFilter = ({
|
|
|
4427
4532
|
};
|
|
4428
4533
|
|
|
4429
4534
|
// src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
|
|
4430
|
-
import { jsx as
|
|
4535
|
+
import { jsx as jsx54 } from "@emotion/react/jsx-runtime";
|
|
4431
4536
|
var ObjectSearchFilterContainer2 = ({ children }) => {
|
|
4432
|
-
return /* @__PURE__ */
|
|
4537
|
+
return /* @__PURE__ */ jsx54("div", { children: /* @__PURE__ */ jsx54("div", { css: ObjectSearchFilterContainer, children }) });
|
|
4433
4538
|
};
|
|
4434
4539
|
|
|
4435
4540
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
@@ -4437,10 +4542,10 @@ import { Button as Button3, Chip as Chip2, Link, Popover as Popover2 } from "@un
|
|
|
4437
4542
|
import { format as timeagoFormat } from "timeago.js";
|
|
4438
4543
|
|
|
4439
4544
|
// src/components/Image/Image.tsx
|
|
4440
|
-
import { jsx as
|
|
4545
|
+
import { jsx as jsx55 } from "@emotion/react/jsx-runtime";
|
|
4441
4546
|
function Image({ src, alt, className }) {
|
|
4442
4547
|
const CompImage = src && typeof src !== "string" ? src : null;
|
|
4443
|
-
return CompImage ? /* @__PURE__ */
|
|
4548
|
+
return CompImage ? /* @__PURE__ */ jsx55(CompImage, { className }) : /* @__PURE__ */ jsx55("img", { src, alt, className });
|
|
4444
4549
|
}
|
|
4445
4550
|
|
|
4446
4551
|
// src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
|
|
@@ -4480,14 +4585,14 @@ var ButtonIcon = css18`
|
|
|
4480
4585
|
`;
|
|
4481
4586
|
|
|
4482
4587
|
// src/components/ObjectSearch/ObjectSearchResultItemButton.tsx
|
|
4483
|
-
import { jsx as
|
|
4588
|
+
import { jsx as jsx56, jsxs as jsxs26 } from "@emotion/react/jsx-runtime";
|
|
4484
4589
|
var ObjectSearchResultItemButton = ({
|
|
4485
4590
|
text,
|
|
4486
4591
|
icon,
|
|
4487
4592
|
...props
|
|
4488
4593
|
}) => {
|
|
4489
4594
|
return /* @__PURE__ */ jsxs26("button", { type: "button", css: ButtonStyles, ...props, children: [
|
|
4490
|
-
!icon ? null : /* @__PURE__ */
|
|
4595
|
+
!icon ? null : /* @__PURE__ */ jsx56(Image, { src: icon, css: ButtonIcon }),
|
|
4491
4596
|
text
|
|
4492
4597
|
] });
|
|
4493
4598
|
};
|
|
@@ -4497,7 +4602,7 @@ var LinkButton = ({
|
|
|
4497
4602
|
...props
|
|
4498
4603
|
}) => {
|
|
4499
4604
|
return /* @__PURE__ */ jsxs26("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
|
|
4500
|
-
!icon ? null : /* @__PURE__ */
|
|
4605
|
+
!icon ? null : /* @__PURE__ */ jsx56(Image, { src: icon, css: ButtonIcon }),
|
|
4501
4606
|
text
|
|
4502
4607
|
] });
|
|
4503
4608
|
};
|
|
@@ -4569,7 +4674,7 @@ var ObjectSearchImage = css19`
|
|
|
4569
4674
|
`;
|
|
4570
4675
|
|
|
4571
4676
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
4572
|
-
import { jsx as
|
|
4677
|
+
import { jsx as jsx57, jsxs as jsxs27 } from "@emotion/react/jsx-runtime";
|
|
4573
4678
|
var ObjectSearchResultItem = ({
|
|
4574
4679
|
id,
|
|
4575
4680
|
title,
|
|
@@ -4594,9 +4699,9 @@ var ObjectSearchResultItem = ({
|
|
|
4594
4699
|
onRemove == null ? void 0 : onRemove();
|
|
4595
4700
|
};
|
|
4596
4701
|
return /* @__PURE__ */ jsxs27("div", { css: ObjectSearchResultItemContainer, "data-testid": "search-result-item", children: [
|
|
4597
|
-
disableDnD ? null : /* @__PURE__ */
|
|
4598
|
-
/* @__PURE__ */
|
|
4599
|
-
!imageUrl ? null : /* @__PURE__ */
|
|
4702
|
+
disableDnD ? null : /* @__PURE__ */ jsx57("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
|
|
4703
|
+
/* @__PURE__ */ jsx57("div", { children: /* @__PURE__ */ jsxs27("div", { css: ObjectSearchContentContainer, children: [
|
|
4704
|
+
!imageUrl ? null : /* @__PURE__ */ jsx57(
|
|
4600
4705
|
"img",
|
|
4601
4706
|
{
|
|
4602
4707
|
src: imageUrl,
|
|
@@ -4606,9 +4711,9 @@ var ObjectSearchResultItem = ({
|
|
|
4606
4711
|
}
|
|
4607
4712
|
),
|
|
4608
4713
|
/* @__PURE__ */ jsxs27("div", { children: [
|
|
4609
|
-
/* @__PURE__ */
|
|
4714
|
+
/* @__PURE__ */ jsx57("span", { css: ObjectSearchResultItemSubtitle, "data-testid": "sub-title", children: formatedContentType }),
|
|
4610
4715
|
/* @__PURE__ */ jsxs27("span", { role: "heading", css: ObjectSearchResultItemTitle, "data-testid": "title", children: [
|
|
4611
|
-
onClick ? /* @__PURE__ */
|
|
4716
|
+
onClick ? /* @__PURE__ */ jsx57(
|
|
4612
4717
|
Link,
|
|
4613
4718
|
{
|
|
4614
4719
|
onClick: (e) => {
|
|
@@ -4620,28 +4725,28 @@ var ObjectSearchResultItem = ({
|
|
|
4620
4725
|
text: title != null ? title : name,
|
|
4621
4726
|
css: ObjectSearchResultItemTitleLink
|
|
4622
4727
|
}
|
|
4623
|
-
) : /* @__PURE__ */
|
|
4624
|
-
!popoverData ? null : /* @__PURE__ */
|
|
4728
|
+
) : /* @__PURE__ */ jsx57("span", { children: title != null ? title : name }),
|
|
4729
|
+
!popoverData ? null : /* @__PURE__ */ jsx57(Popover2, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4625
4730
|
] }),
|
|
4626
4731
|
!createdAt && !publishStatus ? null : /* @__PURE__ */ jsxs27("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
4627
|
-
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */
|
|
4732
|
+
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ jsx57(Chip2, { theme: legacyThemeMapper(publishStatus.theme), text: publishStatus.text, size: "xs" }),
|
|
4628
4733
|
!createdAt && !publishedAt ? null : /* @__PURE__ */ jsxs27("div", { css: ObjectSearchUpdateGroup, children: [
|
|
4629
4734
|
!createdAt ? null : /* @__PURE__ */ jsxs27("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
4630
|
-
/* @__PURE__ */
|
|
4735
|
+
/* @__PURE__ */ jsx57("strong", { children: "Last updated: " }),
|
|
4631
4736
|
timeagoFormat(createdAt)
|
|
4632
4737
|
] }),
|
|
4633
4738
|
!publishedAt ? null : /* @__PURE__ */ jsxs27("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
4634
|
-
/* @__PURE__ */
|
|
4739
|
+
/* @__PURE__ */ jsx57("strong", { children: "Last published: " }),
|
|
4635
4740
|
timeagoFormat(publishedAt)
|
|
4636
4741
|
] })
|
|
4637
4742
|
] })
|
|
4638
4743
|
] }),
|
|
4639
|
-
/* @__PURE__ */
|
|
4744
|
+
/* @__PURE__ */ jsx57("div", { children })
|
|
4640
4745
|
] })
|
|
4641
4746
|
] }) }),
|
|
4642
4747
|
!editLink && hideRemoveButton ? null : /* @__PURE__ */ jsxs27("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
4643
|
-
!editLink ? null : /* @__PURE__ */
|
|
4644
|
-
hideRemoveButton ? null : /* @__PURE__ */
|
|
4748
|
+
!editLink ? null : /* @__PURE__ */ jsx57(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
|
|
4749
|
+
hideRemoveButton ? null : /* @__PURE__ */ jsx57(Button3, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
|
|
4645
4750
|
] })
|
|
4646
4751
|
] });
|
|
4647
4752
|
};
|
|
@@ -4693,7 +4798,7 @@ var ObjectSearchResultListTitle = css20`
|
|
|
4693
4798
|
`;
|
|
4694
4799
|
|
|
4695
4800
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
4696
|
-
import { Fragment as
|
|
4801
|
+
import { Fragment as Fragment11, jsx as jsx58, jsxs as jsxs28 } from "@emotion/react/jsx-runtime";
|
|
4697
4802
|
var DroppableHack2 = Droppable2;
|
|
4698
4803
|
var DraggableHack2 = Draggable2;
|
|
4699
4804
|
function ObjectSearchResultList({
|
|
@@ -4703,7 +4808,7 @@ function ObjectSearchResultList({
|
|
|
4703
4808
|
hideRemoveButton = false,
|
|
4704
4809
|
resultLabelOverride,
|
|
4705
4810
|
additionalButtons,
|
|
4706
|
-
renderResultComponent = (value) => /* @__PURE__ */
|
|
4811
|
+
renderResultComponent = (value) => /* @__PURE__ */ jsx58(ObjectSearchResultItem, { ...value }),
|
|
4707
4812
|
multiSelectId,
|
|
4708
4813
|
disableDnD = false,
|
|
4709
4814
|
getContainerForDnDReparenting,
|
|
@@ -4730,7 +4835,7 @@ function ObjectSearchResultList({
|
|
|
4730
4835
|
...item,
|
|
4731
4836
|
disableDnD: selectedListItems.length === 1 || disableDnD
|
|
4732
4837
|
});
|
|
4733
|
-
return /* @__PURE__ */
|
|
4838
|
+
return /* @__PURE__ */ jsx58(
|
|
4734
4839
|
"div",
|
|
4735
4840
|
{
|
|
4736
4841
|
css: [
|
|
@@ -4745,16 +4850,16 @@ function ObjectSearchResultList({
|
|
|
4745
4850
|
}
|
|
4746
4851
|
);
|
|
4747
4852
|
};
|
|
4748
|
-
return /* @__PURE__ */ jsxs28(
|
|
4853
|
+
return /* @__PURE__ */ jsxs28(Fragment11, { children: [
|
|
4749
4854
|
/* @__PURE__ */ jsxs28("div", { role: "group", css: ObjectSearchResultListContainer, children: [
|
|
4750
4855
|
!resultLabelOverride ? /* @__PURE__ */ jsxs28("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
|
|
4751
|
-
/* @__PURE__ */
|
|
4856
|
+
/* @__PURE__ */ jsx58("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
|
|
4752
4857
|
" ",
|
|
4753
|
-
!selectedListItems.length ? null : /* @__PURE__ */
|
|
4858
|
+
!selectedListItems.length ? null : /* @__PURE__ */ jsx58(Counter, { count: selectedListItems.length })
|
|
4754
4859
|
] }) : resultLabelOverride,
|
|
4755
4860
|
/* @__PURE__ */ jsxs28("div", { css: ObjectSearchResultListCounterContainer, children: [
|
|
4756
4861
|
additionalButtons,
|
|
4757
|
-
hideRemoveButton ? null : /* @__PURE__ */
|
|
4862
|
+
hideRemoveButton ? null : /* @__PURE__ */ jsx58(
|
|
4758
4863
|
Button4,
|
|
4759
4864
|
{
|
|
4760
4865
|
buttonType: "ghostDestructive",
|
|
@@ -4766,7 +4871,7 @@ function ObjectSearchResultList({
|
|
|
4766
4871
|
)
|
|
4767
4872
|
] })
|
|
4768
4873
|
] }),
|
|
4769
|
-
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */
|
|
4874
|
+
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ jsx58(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx58(
|
|
4770
4875
|
DroppableHack2,
|
|
4771
4876
|
{
|
|
4772
4877
|
droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select",
|
|
@@ -4774,7 +4879,7 @@ function ObjectSearchResultList({
|
|
|
4774
4879
|
getContainerForClone: getContainerForDnDReparenting,
|
|
4775
4880
|
children: (provided) => /* @__PURE__ */ jsxs28("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
4776
4881
|
selectedListItems.map((item, i) => {
|
|
4777
|
-
return /* @__PURE__ */
|
|
4882
|
+
return /* @__PURE__ */ jsx58(
|
|
4778
4883
|
DraggableHack2,
|
|
4779
4884
|
{
|
|
4780
4885
|
draggableId: item.id,
|
|
@@ -4794,8 +4899,8 @@ function ObjectSearchResultList({
|
|
|
4794
4899
|
|
|
4795
4900
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
4796
4901
|
import { DebouncedInputKeywordSearch as DebouncedInputKeywordSearch2, Input as Input4, InputSelect as InputSelect4, VerticalRhythm as VerticalRhythm4 } from "@uniformdev/design-system";
|
|
4797
|
-
import { useEffect as
|
|
4798
|
-
import { jsx as
|
|
4902
|
+
import { useEffect as useEffect14, useState as useState15 } from "react";
|
|
4903
|
+
import { jsx as jsx59, jsxs as jsxs29 } from "@emotion/react/jsx-runtime";
|
|
4799
4904
|
var QueryFilter = ({
|
|
4800
4905
|
requireContentType,
|
|
4801
4906
|
queryFilterTitle = "Configure Query",
|
|
@@ -4823,7 +4928,7 @@ var QueryFilter = ({
|
|
|
4823
4928
|
}) => {
|
|
4824
4929
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
4825
4930
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
4826
|
-
const [queryState, setQueryState] =
|
|
4931
|
+
const [queryState, setQueryState] = useState15({
|
|
4827
4932
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
4828
4933
|
keyword: (_b = query.keyword) != null ? _b : "",
|
|
4829
4934
|
count: (_c = query.count) != null ? _c : 5,
|
|
@@ -4834,13 +4939,13 @@ var QueryFilter = ({
|
|
|
4834
4939
|
setQueryState((prev) => ({ ...prev, ...value }));
|
|
4835
4940
|
onSetQuery({ ...query, ...value });
|
|
4836
4941
|
};
|
|
4837
|
-
|
|
4942
|
+
useEffect14(() => {
|
|
4838
4943
|
onSetQuery(queryState);
|
|
4839
4944
|
}, []);
|
|
4840
4945
|
return /* @__PURE__ */ jsxs29("fieldset", { children: [
|
|
4841
|
-
/* @__PURE__ */
|
|
4842
|
-
/* @__PURE__ */
|
|
4843
|
-
/* @__PURE__ */
|
|
4946
|
+
/* @__PURE__ */ jsx59("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
|
|
4947
|
+
/* @__PURE__ */ jsx59("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ jsxs29(VerticalRhythm4, { children: [
|
|
4948
|
+
/* @__PURE__ */ jsx59(
|
|
4844
4949
|
InputVariables,
|
|
4845
4950
|
{
|
|
4846
4951
|
label: searchInputLabel,
|
|
@@ -4848,7 +4953,7 @@ var QueryFilter = ({
|
|
|
4848
4953
|
onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
|
|
4849
4954
|
disableInlineMenu: true,
|
|
4850
4955
|
id: "qf_searchText",
|
|
4851
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
4956
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx59(
|
|
4852
4957
|
DebouncedInputKeywordSearch2,
|
|
4853
4958
|
{
|
|
4854
4959
|
id: "qf_searchText",
|
|
@@ -4863,7 +4968,7 @@ var QueryFilter = ({
|
|
|
4863
4968
|
}
|
|
4864
4969
|
),
|
|
4865
4970
|
/* @__PURE__ */ jsxs29("div", { css: ObjectSearchFilterGrid("1fr 100px"), children: [
|
|
4866
|
-
/* @__PURE__ */
|
|
4971
|
+
/* @__PURE__ */ jsx59(
|
|
4867
4972
|
InputVariables,
|
|
4868
4973
|
{
|
|
4869
4974
|
label: contentTypeLabel,
|
|
@@ -4871,7 +4976,7 @@ var QueryFilter = ({
|
|
|
4871
4976
|
value: (_g = queryState.contentType) != null ? _g : "",
|
|
4872
4977
|
onChange: (newType) => handleFilterChange({ contentType: newType }),
|
|
4873
4978
|
disableInlineMenu: true,
|
|
4874
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
4979
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx59(
|
|
4875
4980
|
InputSelect4,
|
|
4876
4981
|
{
|
|
4877
4982
|
id: "qf_contentType",
|
|
@@ -4885,7 +4990,7 @@ var QueryFilter = ({
|
|
|
4885
4990
|
)
|
|
4886
4991
|
}
|
|
4887
4992
|
),
|
|
4888
|
-
/* @__PURE__ */
|
|
4993
|
+
/* @__PURE__ */ jsx59(
|
|
4889
4994
|
InputVariables,
|
|
4890
4995
|
{
|
|
4891
4996
|
label: countLabel,
|
|
@@ -4894,7 +4999,7 @@ var QueryFilter = ({
|
|
|
4894
4999
|
onChange: (newCount) => handleFilterChange({ count: newCount }),
|
|
4895
5000
|
disableInlineMenu: true,
|
|
4896
5001
|
valueToResetTo: "5",
|
|
4897
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
5002
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx59(
|
|
4898
5003
|
Input4,
|
|
4899
5004
|
{
|
|
4900
5005
|
id: "qf_count",
|
|
@@ -4910,7 +5015,7 @@ var QueryFilter = ({
|
|
|
4910
5015
|
)
|
|
4911
5016
|
] }),
|
|
4912
5017
|
/* @__PURE__ */ jsxs29("div", { css: ObjectSearchFilterGrid("2fr 1fr"), children: [
|
|
4913
|
-
/* @__PURE__ */
|
|
5018
|
+
/* @__PURE__ */ jsx59(
|
|
4914
5019
|
InputVariables,
|
|
4915
5020
|
{
|
|
4916
5021
|
id: "qf_sortBy",
|
|
@@ -4918,7 +5023,7 @@ var QueryFilter = ({
|
|
|
4918
5023
|
value: queryState.sortBy,
|
|
4919
5024
|
onChange: (newSortBy) => handleFilterChange({ sortBy: newSortBy }),
|
|
4920
5025
|
disableInlineMenu: true,
|
|
4921
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
5026
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx59(
|
|
4922
5027
|
InputSelect4,
|
|
4923
5028
|
{
|
|
4924
5029
|
label: sortLabel,
|
|
@@ -4932,7 +5037,7 @@ var QueryFilter = ({
|
|
|
4932
5037
|
)
|
|
4933
5038
|
}
|
|
4934
5039
|
),
|
|
4935
|
-
/* @__PURE__ */
|
|
5040
|
+
/* @__PURE__ */ jsx59(
|
|
4936
5041
|
InputVariables,
|
|
4937
5042
|
{
|
|
4938
5043
|
label: sortOrderLabel,
|
|
@@ -4940,7 +5045,7 @@ var QueryFilter = ({
|
|
|
4940
5045
|
value: queryState.sortOrder,
|
|
4941
5046
|
onChange: (newSort) => handleFilterChange({ sortOrder: newSort }),
|
|
4942
5047
|
disableInlineMenu: true,
|
|
4943
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
5048
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx59(
|
|
4944
5049
|
InputSelect4,
|
|
4945
5050
|
{
|
|
4946
5051
|
label: sortOrderLabel,
|
|
@@ -4960,8 +5065,8 @@ var QueryFilter = ({
|
|
|
4960
5065
|
};
|
|
4961
5066
|
|
|
4962
5067
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
4963
|
-
import { useEffect as
|
|
4964
|
-
import { jsx as
|
|
5068
|
+
import { useEffect as useEffect15, useMemo as useMemo15, useRef as useRef9 } from "react";
|
|
5069
|
+
import { jsx as jsx60 } from "@emotion/react/jsx-runtime";
|
|
4965
5070
|
function ParamTypeDynamicDataProvider(props) {
|
|
4966
5071
|
const { children } = props;
|
|
4967
5072
|
const {
|
|
@@ -4969,11 +5074,11 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
4969
5074
|
} = useMeshLocation("paramType");
|
|
4970
5075
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
4971
5076
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
4972
|
-
const variables =
|
|
5077
|
+
const variables = useMemo15(
|
|
4973
5078
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
4974
5079
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
4975
5080
|
);
|
|
4976
|
-
return /* @__PURE__ */
|
|
5081
|
+
return /* @__PURE__ */ jsx60(VariablesProvider, { value: variables, onChange: () => {
|
|
4977
5082
|
}, editVariableComponent: JsonMeshVariableEditor, children });
|
|
4978
5083
|
}
|
|
4979
5084
|
var JsonMeshVariableEditor = ({
|
|
@@ -4982,9 +5087,9 @@ var JsonMeshVariableEditor = ({
|
|
|
4982
5087
|
variable,
|
|
4983
5088
|
context
|
|
4984
5089
|
}) => {
|
|
4985
|
-
const sillyRef =
|
|
5090
|
+
const sillyRef = useRef9(false);
|
|
4986
5091
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
4987
|
-
|
|
5092
|
+
useEffect15(() => {
|
|
4988
5093
|
if (sillyRef.current) {
|
|
4989
5094
|
return;
|
|
4990
5095
|
}
|
|
@@ -5420,6 +5525,12 @@ var MULTI_SELECT_OPERATORS = [
|
|
|
5420
5525
|
editorType: "multiChoice",
|
|
5421
5526
|
expectedValueType: "array"
|
|
5422
5527
|
},
|
|
5528
|
+
{
|
|
5529
|
+
label: "is all of...",
|
|
5530
|
+
value: "all",
|
|
5531
|
+
editorType: "multiChoice",
|
|
5532
|
+
expectedValueType: "array"
|
|
5533
|
+
},
|
|
5423
5534
|
{
|
|
5424
5535
|
label: "is empty",
|
|
5425
5536
|
value: "ndef",
|
|
@@ -5448,9 +5559,9 @@ var MULTI_SELECT_OPERATORS = [
|
|
|
5448
5559
|
|
|
5449
5560
|
// src/components/SearchAndFilter/editors/DateEditor.tsx
|
|
5450
5561
|
import { Input as Input5 } from "@uniformdev/design-system";
|
|
5451
|
-
import { useState as
|
|
5562
|
+
import { useState as useState16 } from "react";
|
|
5452
5563
|
import { useDebounce as useDebounce2 } from "react-use";
|
|
5453
|
-
import { jsx as
|
|
5564
|
+
import { jsx as jsx61 } from "@emotion/react/jsx-runtime";
|
|
5454
5565
|
var DateEditor = ({
|
|
5455
5566
|
onChange,
|
|
5456
5567
|
ariaLabel,
|
|
@@ -5459,9 +5570,9 @@ var DateEditor = ({
|
|
|
5459
5570
|
readOnly,
|
|
5460
5571
|
valueTestId
|
|
5461
5572
|
}) => {
|
|
5462
|
-
const [innerValue, setInnerValue] =
|
|
5573
|
+
const [innerValue, setInnerValue] = useState16(value != null ? value : "");
|
|
5463
5574
|
useDebounce2(() => onChange(innerValue), 500, [innerValue]);
|
|
5464
|
-
return /* @__PURE__ */
|
|
5575
|
+
return /* @__PURE__ */ jsx61(
|
|
5465
5576
|
Input5,
|
|
5466
5577
|
{
|
|
5467
5578
|
type: "date",
|
|
@@ -5478,21 +5589,21 @@ var DateEditor = ({
|
|
|
5478
5589
|
|
|
5479
5590
|
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
5480
5591
|
import { Input as Input6 } from "@uniformdev/design-system";
|
|
5481
|
-
import { useEffect as
|
|
5592
|
+
import { useEffect as useEffect16, useState as useState17 } from "react";
|
|
5482
5593
|
import { useDebounce as useDebounce3 } from "react-use";
|
|
5483
5594
|
|
|
5484
5595
|
// src/components/SearchAndFilter/editors/shared/ErrorContainer.tsx
|
|
5485
5596
|
import { FieldMessage } from "@uniformdev/design-system";
|
|
5486
|
-
import { jsx as
|
|
5597
|
+
import { jsx as jsx62 } from "@emotion/react/jsx-runtime";
|
|
5487
5598
|
var ErrorContainer = ({ errorMessage }) => {
|
|
5488
|
-
return /* @__PURE__ */
|
|
5599
|
+
return /* @__PURE__ */ jsx62(
|
|
5489
5600
|
"div",
|
|
5490
5601
|
{
|
|
5491
5602
|
css: {
|
|
5492
5603
|
gridColumn: "span 6",
|
|
5493
5604
|
order: 6
|
|
5494
5605
|
},
|
|
5495
|
-
children: /* @__PURE__ */
|
|
5606
|
+
children: /* @__PURE__ */ jsx62(FieldMessage, { errorMessage })
|
|
5496
5607
|
}
|
|
5497
5608
|
);
|
|
5498
5609
|
};
|
|
@@ -5505,7 +5616,7 @@ var twoColumnGrid = {
|
|
|
5505
5616
|
};
|
|
5506
5617
|
|
|
5507
5618
|
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
5508
|
-
import { Fragment as
|
|
5619
|
+
import { Fragment as Fragment12, jsx as jsx63, jsxs as jsxs30 } from "@emotion/react/jsx-runtime";
|
|
5509
5620
|
var DateRangeEditor = ({
|
|
5510
5621
|
ariaLabel,
|
|
5511
5622
|
onChange,
|
|
@@ -5514,9 +5625,9 @@ var DateRangeEditor = ({
|
|
|
5514
5625
|
readOnly,
|
|
5515
5626
|
valueTestId
|
|
5516
5627
|
}) => {
|
|
5517
|
-
const [minDateValue, setMinDateValue] =
|
|
5518
|
-
const [maxDateValue, setMaxDateValue] =
|
|
5519
|
-
const [error, setError] =
|
|
5628
|
+
const [minDateValue, setMinDateValue] = useState17(value ? value[0] : "");
|
|
5629
|
+
const [maxDateValue, setMaxDateValue] = useState17(value ? value[1] : "");
|
|
5630
|
+
const [error, setError] = useState17("");
|
|
5520
5631
|
useDebounce3(
|
|
5521
5632
|
() => {
|
|
5522
5633
|
if (minDateValue && maxDateValue && !error) {
|
|
@@ -5528,7 +5639,7 @@ var DateRangeEditor = ({
|
|
|
5528
5639
|
500,
|
|
5529
5640
|
[minDateValue, maxDateValue]
|
|
5530
5641
|
);
|
|
5531
|
-
|
|
5642
|
+
useEffect16(() => {
|
|
5532
5643
|
if (!minDateValue || !maxDateValue) {
|
|
5533
5644
|
return;
|
|
5534
5645
|
}
|
|
@@ -5563,9 +5674,9 @@ var DateRangeEditor = ({
|
|
|
5563
5674
|
setMaxDateValue("");
|
|
5564
5675
|
}
|
|
5565
5676
|
}, [minDateValue, maxDateValue, setError]);
|
|
5566
|
-
return /* @__PURE__ */ jsxs30(
|
|
5677
|
+
return /* @__PURE__ */ jsxs30(Fragment12, { children: [
|
|
5567
5678
|
/* @__PURE__ */ jsxs30("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
5568
|
-
/* @__PURE__ */
|
|
5679
|
+
/* @__PURE__ */ jsx63(
|
|
5569
5680
|
Input6,
|
|
5570
5681
|
{
|
|
5571
5682
|
label: `${ariaLabel}-min-date`,
|
|
@@ -5579,7 +5690,7 @@ var DateRangeEditor = ({
|
|
|
5579
5690
|
"data-testid": "value-low"
|
|
5580
5691
|
}
|
|
5581
5692
|
),
|
|
5582
|
-
/* @__PURE__ */
|
|
5693
|
+
/* @__PURE__ */ jsx63(
|
|
5583
5694
|
Input6,
|
|
5584
5695
|
{
|
|
5585
5696
|
label: `${ariaLabel}-max-date`,
|
|
@@ -5594,7 +5705,7 @@ var DateRangeEditor = ({
|
|
|
5594
5705
|
}
|
|
5595
5706
|
)
|
|
5596
5707
|
] }),
|
|
5597
|
-
/* @__PURE__ */
|
|
5708
|
+
/* @__PURE__ */ jsx63(ErrorContainer, { errorMessage: error })
|
|
5598
5709
|
] });
|
|
5599
5710
|
};
|
|
5600
5711
|
|
|
@@ -5604,7 +5715,7 @@ import {
|
|
|
5604
5715
|
getComboBoxSelectedSelectableGroups,
|
|
5605
5716
|
InputComboBox
|
|
5606
5717
|
} from "@uniformdev/design-system";
|
|
5607
|
-
import { useMemo as
|
|
5718
|
+
import { useMemo as useMemo16 } from "react";
|
|
5608
5719
|
|
|
5609
5720
|
// src/components/SearchAndFilter/editors/shared/readOnlyAttributes.tsx
|
|
5610
5721
|
var readOnlyAttributes = {
|
|
@@ -5614,7 +5725,7 @@ var readOnlyAttributes = {
|
|
|
5614
5725
|
};
|
|
5615
5726
|
|
|
5616
5727
|
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
5617
|
-
import { jsx as
|
|
5728
|
+
import { jsx as jsx64 } from "@emotion/react/jsx-runtime";
|
|
5618
5729
|
var FilterMultiChoiceEditor = ({
|
|
5619
5730
|
value,
|
|
5620
5731
|
options,
|
|
@@ -5625,11 +5736,11 @@ var FilterMultiChoiceEditor = ({
|
|
|
5625
5736
|
}) => {
|
|
5626
5737
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5627
5738
|
const isClearable = !readOnly || !disabled;
|
|
5628
|
-
const { groupedOptions, selectedOptions } =
|
|
5739
|
+
const { groupedOptions, selectedOptions } = useMemo16(
|
|
5629
5740
|
() => convertComboBoxGroupsToSelectableGroups({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
5630
5741
|
[options, value]
|
|
5631
5742
|
);
|
|
5632
|
-
return /* @__PURE__ */
|
|
5743
|
+
return /* @__PURE__ */ jsx64("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx64(
|
|
5633
5744
|
InputComboBox,
|
|
5634
5745
|
{
|
|
5635
5746
|
...props,
|
|
@@ -5662,8 +5773,8 @@ import {
|
|
|
5662
5773
|
convertComboBoxGroupsToSelectableGroups as convertComboBoxGroupsToSelectableGroups2,
|
|
5663
5774
|
InputComboBox as InputComboBox2
|
|
5664
5775
|
} from "@uniformdev/design-system";
|
|
5665
|
-
import { useMemo as
|
|
5666
|
-
import { jsx as
|
|
5776
|
+
import { useMemo as useMemo17 } from "react";
|
|
5777
|
+
import { jsx as jsx65 } from "@emotion/react/jsx-runtime";
|
|
5667
5778
|
var FilterSingleChoiceEditor = ({
|
|
5668
5779
|
options,
|
|
5669
5780
|
value,
|
|
@@ -5673,7 +5784,7 @@ var FilterSingleChoiceEditor = ({
|
|
|
5673
5784
|
valueTestId
|
|
5674
5785
|
}) => {
|
|
5675
5786
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5676
|
-
const { groupedOptions, selectedOptions } =
|
|
5787
|
+
const { groupedOptions, selectedOptions } = useMemo17(
|
|
5677
5788
|
() => convertComboBoxGroupsToSelectableGroups2({
|
|
5678
5789
|
options: options != null ? options : [],
|
|
5679
5790
|
selectedItems: new Set(value ? [String(value)] : void 0),
|
|
@@ -5681,7 +5792,7 @@ var FilterSingleChoiceEditor = ({
|
|
|
5681
5792
|
}),
|
|
5682
5793
|
[options, value]
|
|
5683
5794
|
);
|
|
5684
|
-
return /* @__PURE__ */
|
|
5795
|
+
return /* @__PURE__ */ jsx65("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx65(
|
|
5685
5796
|
InputComboBox2,
|
|
5686
5797
|
{
|
|
5687
5798
|
placeholder: "Type to search...",
|
|
@@ -5711,9 +5822,9 @@ var FilterSingleChoiceEditor = ({
|
|
|
5711
5822
|
|
|
5712
5823
|
// src/components/SearchAndFilter/editors/NumberEditor.tsx
|
|
5713
5824
|
import { Input as Input7 } from "@uniformdev/design-system";
|
|
5714
|
-
import { useState as
|
|
5825
|
+
import { useState as useState18 } from "react";
|
|
5715
5826
|
import { useDebounce as useDebounce4 } from "react-use";
|
|
5716
|
-
import { jsx as
|
|
5827
|
+
import { jsx as jsx66 } from "@emotion/react/jsx-runtime";
|
|
5717
5828
|
var NumberEditor = ({
|
|
5718
5829
|
ariaLabel,
|
|
5719
5830
|
onChange,
|
|
@@ -5722,9 +5833,9 @@ var NumberEditor = ({
|
|
|
5722
5833
|
readOnly,
|
|
5723
5834
|
valueTestId
|
|
5724
5835
|
}) => {
|
|
5725
|
-
const [innerValue, setInnerValue] =
|
|
5836
|
+
const [innerValue, setInnerValue] = useState18(value != null ? value : "");
|
|
5726
5837
|
useDebounce4(() => onChange(innerValue), 500, [innerValue]);
|
|
5727
|
-
return /* @__PURE__ */
|
|
5838
|
+
return /* @__PURE__ */ jsx66(
|
|
5728
5839
|
Input7,
|
|
5729
5840
|
{
|
|
5730
5841
|
label: ariaLabel,
|
|
@@ -5742,9 +5853,9 @@ var NumberEditor = ({
|
|
|
5742
5853
|
|
|
5743
5854
|
// src/components/SearchAndFilter/editors/NumberRangeEditor.tsx
|
|
5744
5855
|
import { Input as Input8 } from "@uniformdev/design-system";
|
|
5745
|
-
import { useEffect as
|
|
5856
|
+
import { useEffect as useEffect17, useState as useState19 } from "react";
|
|
5746
5857
|
import { useDebounce as useDebounce5 } from "react-use";
|
|
5747
|
-
import { Fragment as
|
|
5858
|
+
import { Fragment as Fragment13, jsx as jsx67, jsxs as jsxs31 } from "@emotion/react/jsx-runtime";
|
|
5748
5859
|
var NumberRangeEditor = ({
|
|
5749
5860
|
onChange,
|
|
5750
5861
|
disabled,
|
|
@@ -5753,9 +5864,9 @@ var NumberRangeEditor = ({
|
|
|
5753
5864
|
readOnly,
|
|
5754
5865
|
valueTestId
|
|
5755
5866
|
}) => {
|
|
5756
|
-
const [minValue, setMinValue] =
|
|
5757
|
-
const [maxValue, setMaxValue] =
|
|
5758
|
-
const [error, setError] =
|
|
5867
|
+
const [minValue, setMinValue] = useState19("");
|
|
5868
|
+
const [maxValue, setMaxValue] = useState19("");
|
|
5869
|
+
const [error, setError] = useState19("");
|
|
5759
5870
|
useDebounce5(
|
|
5760
5871
|
() => {
|
|
5761
5872
|
if (minValue && maxValue && !error) {
|
|
@@ -5767,7 +5878,7 @@ var NumberRangeEditor = ({
|
|
|
5767
5878
|
500,
|
|
5768
5879
|
[minValue, maxValue]
|
|
5769
5880
|
);
|
|
5770
|
-
|
|
5881
|
+
useEffect17(() => {
|
|
5771
5882
|
if (!maxValue && !minValue) {
|
|
5772
5883
|
return;
|
|
5773
5884
|
}
|
|
@@ -5789,9 +5900,9 @@ var NumberRangeEditor = ({
|
|
|
5789
5900
|
setMaxValue(maxValue);
|
|
5790
5901
|
}
|
|
5791
5902
|
}, [maxValue, minValue, setError]);
|
|
5792
|
-
return /* @__PURE__ */ jsxs31(
|
|
5903
|
+
return /* @__PURE__ */ jsxs31(Fragment13, { children: [
|
|
5793
5904
|
/* @__PURE__ */ jsxs31("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
5794
|
-
/* @__PURE__ */
|
|
5905
|
+
/* @__PURE__ */ jsx67(
|
|
5795
5906
|
Input8,
|
|
5796
5907
|
{
|
|
5797
5908
|
label: `${ariaLabel}-min`,
|
|
@@ -5807,7 +5918,7 @@ var NumberRangeEditor = ({
|
|
|
5807
5918
|
"data-testid": "value-low"
|
|
5808
5919
|
}
|
|
5809
5920
|
),
|
|
5810
|
-
/* @__PURE__ */
|
|
5921
|
+
/* @__PURE__ */ jsx67(
|
|
5811
5922
|
Input8,
|
|
5812
5923
|
{
|
|
5813
5924
|
type: "number",
|
|
@@ -5824,7 +5935,7 @@ var NumberRangeEditor = ({
|
|
|
5824
5935
|
}
|
|
5825
5936
|
)
|
|
5826
5937
|
] }),
|
|
5827
|
-
/* @__PURE__ */
|
|
5938
|
+
/* @__PURE__ */ jsx67(ErrorContainer, { errorMessage: error })
|
|
5828
5939
|
] });
|
|
5829
5940
|
};
|
|
5830
5941
|
|
|
@@ -5834,13 +5945,13 @@ import {
|
|
|
5834
5945
|
getComboBoxSelectedSelectableGroups as getComboBoxSelectedSelectableGroups2,
|
|
5835
5946
|
InputComboBox as InputComboBox3
|
|
5836
5947
|
} from "@uniformdev/design-system";
|
|
5837
|
-
import { useMemo as
|
|
5948
|
+
import { useMemo as useMemo18 } from "react";
|
|
5838
5949
|
|
|
5839
5950
|
// src/components/SearchAndFilter/editors/shared/CustomOptions.tsx
|
|
5840
5951
|
import { StatusBullet } from "@uniformdev/design-system";
|
|
5841
|
-
import { jsx as
|
|
5952
|
+
import { jsx as jsx68 } from "@emotion/react/jsx-runtime";
|
|
5842
5953
|
var CustomOptions = ({ label, value }) => {
|
|
5843
|
-
return /* @__PURE__ */
|
|
5954
|
+
return /* @__PURE__ */ jsx68(
|
|
5844
5955
|
StatusBullet,
|
|
5845
5956
|
{
|
|
5846
5957
|
status: label,
|
|
@@ -5850,7 +5961,7 @@ var CustomOptions = ({ label, value }) => {
|
|
|
5850
5961
|
};
|
|
5851
5962
|
|
|
5852
5963
|
// src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
|
|
5853
|
-
import { jsx as
|
|
5964
|
+
import { jsx as jsx69 } from "@emotion/react/jsx-runtime";
|
|
5854
5965
|
var StatusMultiEditor = ({
|
|
5855
5966
|
options,
|
|
5856
5967
|
value,
|
|
@@ -5860,11 +5971,11 @@ var StatusMultiEditor = ({
|
|
|
5860
5971
|
valueTestId
|
|
5861
5972
|
}) => {
|
|
5862
5973
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5863
|
-
const { groupedOptions, selectedOptions } =
|
|
5974
|
+
const { groupedOptions, selectedOptions } = useMemo18(
|
|
5864
5975
|
() => convertComboBoxGroupsToSelectableGroups3({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
5865
5976
|
[options, value]
|
|
5866
5977
|
);
|
|
5867
|
-
return /* @__PURE__ */
|
|
5978
|
+
return /* @__PURE__ */ jsx69("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx69(
|
|
5868
5979
|
InputComboBox3,
|
|
5869
5980
|
{
|
|
5870
5981
|
options: groupedOptions != null ? groupedOptions : [],
|
|
@@ -5895,8 +6006,8 @@ import {
|
|
|
5895
6006
|
convertComboBoxGroupsToSelectableGroups as convertComboBoxGroupsToSelectableGroups4,
|
|
5896
6007
|
InputComboBox as InputComboBox4
|
|
5897
6008
|
} from "@uniformdev/design-system";
|
|
5898
|
-
import { useMemo as
|
|
5899
|
-
import { jsx as
|
|
6009
|
+
import { useMemo as useMemo19 } from "react";
|
|
6010
|
+
import { jsx as jsx70 } from "@emotion/react/jsx-runtime";
|
|
5900
6011
|
var StatusSingleEditor = ({
|
|
5901
6012
|
options,
|
|
5902
6013
|
value,
|
|
@@ -5906,7 +6017,7 @@ var StatusSingleEditor = ({
|
|
|
5906
6017
|
valueTestId
|
|
5907
6018
|
}) => {
|
|
5908
6019
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5909
|
-
const { groupedOptions, selectedOptions } =
|
|
6020
|
+
const { groupedOptions, selectedOptions } = useMemo19(
|
|
5910
6021
|
() => convertComboBoxGroupsToSelectableGroups4({
|
|
5911
6022
|
options: options != null ? options : [],
|
|
5912
6023
|
selectedItems: new Set(value ? [value] : void 0),
|
|
@@ -5914,7 +6025,7 @@ var StatusSingleEditor = ({
|
|
|
5914
6025
|
}),
|
|
5915
6026
|
[options, value]
|
|
5916
6027
|
);
|
|
5917
|
-
return /* @__PURE__ */
|
|
6028
|
+
return /* @__PURE__ */ jsx70("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx70(
|
|
5918
6029
|
InputComboBox4,
|
|
5919
6030
|
{
|
|
5920
6031
|
options: groupedOptions,
|
|
@@ -5943,9 +6054,9 @@ var StatusSingleEditor = ({
|
|
|
5943
6054
|
|
|
5944
6055
|
// src/components/SearchAndFilter/editors/TextEditor.tsx
|
|
5945
6056
|
import { Input as Input9 } from "@uniformdev/design-system";
|
|
5946
|
-
import { useState as
|
|
6057
|
+
import { useState as useState20 } from "react";
|
|
5947
6058
|
import { useDebounce as useDebounce6 } from "react-use";
|
|
5948
|
-
import { jsx as
|
|
6059
|
+
import { jsx as jsx71 } from "@emotion/react/jsx-runtime";
|
|
5949
6060
|
var TextEditor = ({
|
|
5950
6061
|
onChange,
|
|
5951
6062
|
ariaLabel,
|
|
@@ -5953,9 +6064,9 @@ var TextEditor = ({
|
|
|
5953
6064
|
readOnly,
|
|
5954
6065
|
valueTestId
|
|
5955
6066
|
}) => {
|
|
5956
|
-
const [innerValue, setInnerValue] =
|
|
6067
|
+
const [innerValue, setInnerValue] = useState20(value != null ? value : "");
|
|
5957
6068
|
useDebounce6(() => onChange(innerValue), 500, [innerValue]);
|
|
5958
|
-
return /* @__PURE__ */
|
|
6069
|
+
return /* @__PURE__ */ jsx71(
|
|
5959
6070
|
Input9,
|
|
5960
6071
|
{
|
|
5961
6072
|
showLabel: false,
|
|
@@ -5975,8 +6086,8 @@ import {
|
|
|
5975
6086
|
getComboBoxSelectedSelectableGroups as getComboBoxSelectedSelectableGroups3,
|
|
5976
6087
|
InputCreatableComboBox
|
|
5977
6088
|
} from "@uniformdev/design-system";
|
|
5978
|
-
import { useMemo as
|
|
5979
|
-
import { jsx as
|
|
6089
|
+
import { useMemo as useMemo20 } from "react";
|
|
6090
|
+
import { jsx as jsx72 } from "@emotion/react/jsx-runtime";
|
|
5980
6091
|
var TextMultiChoiceEditor = ({
|
|
5981
6092
|
value,
|
|
5982
6093
|
disabled,
|
|
@@ -5986,13 +6097,13 @@ var TextMultiChoiceEditor = ({
|
|
|
5986
6097
|
}) => {
|
|
5987
6098
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5988
6099
|
const isClearable = !readOnly || !disabled;
|
|
5989
|
-
const { groupedOptions, selectedOptions } =
|
|
6100
|
+
const { groupedOptions, selectedOptions } = useMemo20(() => {
|
|
5990
6101
|
var _a;
|
|
5991
6102
|
const coercedValue = typeof value === "string" ? [value] : value != null ? value : [];
|
|
5992
6103
|
const options = (_a = coercedValue.map((v) => ({ label: v, value: v }))) != null ? _a : [];
|
|
5993
6104
|
return convertComboBoxGroupsToSelectableGroups5({ options, selectedItems: new Set(value) });
|
|
5994
6105
|
}, [value]);
|
|
5995
|
-
return /* @__PURE__ */
|
|
6106
|
+
return /* @__PURE__ */ jsx72("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx72(
|
|
5996
6107
|
InputCreatableComboBox,
|
|
5997
6108
|
{
|
|
5998
6109
|
...props,
|
|
@@ -6283,7 +6394,7 @@ var SearchAndFilterAdditionalContainer = css21`
|
|
|
6283
6394
|
`;
|
|
6284
6395
|
|
|
6285
6396
|
// src/components/SearchAndFilter/FilterButton.tsx
|
|
6286
|
-
import { jsx as
|
|
6397
|
+
import { jsx as jsx73, jsxs as jsxs32 } from "@emotion/react/jsx-runtime";
|
|
6287
6398
|
var FilterButton2 = ({
|
|
6288
6399
|
text = "Filters",
|
|
6289
6400
|
icon = customIcons["filter-add"],
|
|
@@ -6305,10 +6416,10 @@ var FilterButton2 = ({
|
|
|
6305
6416
|
...props,
|
|
6306
6417
|
"data-testid": dataTestId,
|
|
6307
6418
|
children: [
|
|
6308
|
-
/* @__PURE__ */
|
|
6309
|
-
/* @__PURE__ */
|
|
6310
|
-
filterCount ? /* @__PURE__ */
|
|
6311
|
-
showDropdownIcon ? /* @__PURE__ */
|
|
6419
|
+
/* @__PURE__ */ jsx73(Icon2, { icon, iconColor: "currentColor", size: "1rem" }),
|
|
6420
|
+
/* @__PURE__ */ jsx73("span", { css: FilterButtonText, children: text }),
|
|
6421
|
+
filterCount ? /* @__PURE__ */ jsx73(Counter2, { count: filterCount, bgColor: "var(--white)" }) : null,
|
|
6422
|
+
showDropdownIcon ? /* @__PURE__ */ jsx73(Icon2, { icon: "chevron-down", iconColor: "currentColor", size: "1rem" }) : null
|
|
6312
6423
|
]
|
|
6313
6424
|
}
|
|
6314
6425
|
);
|
|
@@ -6319,31 +6430,31 @@ import { CgClose } from "@react-icons/all-files/cg/CgClose";
|
|
|
6319
6430
|
import { hasReferencedVariables as hasReferencedVariables2 } from "@uniformdev/canvas";
|
|
6320
6431
|
import { Icon as Icon3, InputKeywordSearch } from "@uniformdev/design-system";
|
|
6321
6432
|
import { CLEAR_EDITOR_COMMAND as CLEAR_EDITOR_COMMAND2 } from "lexical";
|
|
6322
|
-
import { useEffect as
|
|
6433
|
+
import { useEffect as useEffect19, useRef as useRef10, useState as useState22 } from "react";
|
|
6323
6434
|
import { useDebounce as useDebounce7 } from "react-use";
|
|
6324
6435
|
import { v4 as v42 } from "uuid";
|
|
6325
6436
|
|
|
6326
6437
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
6327
6438
|
import { VerticalRhythm as VerticalRhythm5 } from "@uniformdev/design-system";
|
|
6328
6439
|
import {
|
|
6329
|
-
createContext as
|
|
6330
|
-
useCallback as
|
|
6331
|
-
useContext as
|
|
6440
|
+
createContext as createContext7,
|
|
6441
|
+
useCallback as useCallback7,
|
|
6442
|
+
useContext as useContext7,
|
|
6332
6443
|
useDeferredValue as useDeferredValue2,
|
|
6333
|
-
useEffect as
|
|
6334
|
-
useMemo as
|
|
6335
|
-
useState as
|
|
6444
|
+
useEffect as useEffect18,
|
|
6445
|
+
useMemo as useMemo21,
|
|
6446
|
+
useState as useState21
|
|
6336
6447
|
} from "react";
|
|
6337
6448
|
|
|
6338
6449
|
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
6339
|
-
import { jsx as
|
|
6450
|
+
import { jsx as jsx74 } from "@emotion/react/jsx-runtime";
|
|
6340
6451
|
var FilterEditorRenderer = ({ editorType, ...props }) => {
|
|
6341
6452
|
const { filterMapper: contextFilterMapper } = useSearchAndFilter();
|
|
6342
6453
|
const Editor = contextFilterMapper == null ? void 0 : contextFilterMapper[editorType];
|
|
6343
6454
|
if (!Editor || editorType === "empty") {
|
|
6344
|
-
return /* @__PURE__ */
|
|
6455
|
+
return /* @__PURE__ */ jsx74("span", {});
|
|
6345
6456
|
}
|
|
6346
|
-
return /* @__PURE__ */
|
|
6457
|
+
return /* @__PURE__ */ jsx74(Editor, { ...props });
|
|
6347
6458
|
};
|
|
6348
6459
|
var filterMapper = {
|
|
6349
6460
|
multiChoice: FilterMultiChoiceEditor,
|
|
@@ -6361,9 +6472,9 @@ var filterMapper = {
|
|
|
6361
6472
|
function withInputVariables(WrappedComponent, noSwapping = false) {
|
|
6362
6473
|
const WithInputVariables = (props) => {
|
|
6363
6474
|
if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
|
|
6364
|
-
return /* @__PURE__ */
|
|
6475
|
+
return /* @__PURE__ */ jsx74(WrappedComponent, { ...props });
|
|
6365
6476
|
}
|
|
6366
|
-
return /* @__PURE__ */
|
|
6477
|
+
return /* @__PURE__ */ jsx74(
|
|
6367
6478
|
InputVariables,
|
|
6368
6479
|
{
|
|
6369
6480
|
"data-testid": "filter-value",
|
|
@@ -6372,7 +6483,7 @@ function withInputVariables(WrappedComponent, noSwapping = false) {
|
|
|
6372
6483
|
onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
|
|
6373
6484
|
value: props.value,
|
|
6374
6485
|
disabled: props.disabled,
|
|
6375
|
-
inputWhenNoVariables: noSwapping ? void 0 : /* @__PURE__ */
|
|
6486
|
+
inputWhenNoVariables: noSwapping ? void 0 : /* @__PURE__ */ jsx74(WrappedComponent, { ...props })
|
|
6376
6487
|
}
|
|
6377
6488
|
);
|
|
6378
6489
|
};
|
|
@@ -6382,9 +6493,9 @@ function withInputVariablesForMultiValue(WrappedComponent) {
|
|
|
6382
6493
|
const WithInputVariables = (props) => {
|
|
6383
6494
|
var _a;
|
|
6384
6495
|
if (!props.bindable || props.disabled || props.readOnly) {
|
|
6385
|
-
return /* @__PURE__ */
|
|
6496
|
+
return /* @__PURE__ */ jsx74(WrappedComponent, { ...props });
|
|
6386
6497
|
}
|
|
6387
|
-
return /* @__PURE__ */
|
|
6498
|
+
return /* @__PURE__ */ jsx74(
|
|
6388
6499
|
InputVariables,
|
|
6389
6500
|
{
|
|
6390
6501
|
"data-testid": "filter-value",
|
|
@@ -6392,7 +6503,7 @@ function withInputVariablesForMultiValue(WrappedComponent) {
|
|
|
6392
6503
|
showMenuPosition: "inline-right",
|
|
6393
6504
|
onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
|
|
6394
6505
|
value: (_a = props.value) == null ? void 0 : _a[0],
|
|
6395
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
6506
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx74(WrappedComponent, { ...props })
|
|
6396
6507
|
}
|
|
6397
6508
|
);
|
|
6398
6509
|
};
|
|
@@ -6408,8 +6519,8 @@ var bindableFiltersMapper = {
|
|
|
6408
6519
|
};
|
|
6409
6520
|
|
|
6410
6521
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
6411
|
-
import { jsx as
|
|
6412
|
-
var SearchAndFilterContext =
|
|
6522
|
+
import { jsx as jsx75 } from "@emotion/react/jsx-runtime";
|
|
6523
|
+
var SearchAndFilterContext = createContext7({
|
|
6413
6524
|
searchTerm: "",
|
|
6414
6525
|
setSearchTerm: () => {
|
|
6415
6526
|
},
|
|
@@ -6429,6 +6540,7 @@ var SearchAndFilterContext = createContext6({
|
|
|
6429
6540
|
validFilterQuery: [],
|
|
6430
6541
|
filterMapper: {},
|
|
6431
6542
|
totalResults: 0,
|
|
6543
|
+
isLoading: false,
|
|
6432
6544
|
allowBindingSearchTerm: false
|
|
6433
6545
|
});
|
|
6434
6546
|
var SearchAndFilterProvider = ({
|
|
@@ -6442,21 +6554,22 @@ var SearchAndFilterProvider = ({
|
|
|
6442
6554
|
resetFilterValues = [{ field: "", operator: "", value: "" }],
|
|
6443
6555
|
onResetFilterValues,
|
|
6444
6556
|
totalResults,
|
|
6557
|
+
isLoading,
|
|
6445
6558
|
filterMapper: filterMapper2 = filterMapper,
|
|
6446
6559
|
children,
|
|
6447
6560
|
allowBindingSearchTerm
|
|
6448
6561
|
}) => {
|
|
6449
|
-
const [searchTerm, setSearchTerm] =
|
|
6562
|
+
const [searchTerm, setSearchTerm] = useState21(defaultSearchTerm);
|
|
6450
6563
|
const deferredSearchTerm = useDeferredValue2(searchTerm);
|
|
6451
|
-
const [filterVisibility, setFilterVisibility] =
|
|
6452
|
-
const handleSearchTerm =
|
|
6564
|
+
const [filterVisibility, setFilterVisibility] = useState21(alwaysVisible || filterVisible);
|
|
6565
|
+
const handleSearchTerm = useCallback7(
|
|
6453
6566
|
(term) => {
|
|
6454
6567
|
setSearchTerm(term);
|
|
6455
6568
|
onSearchChange == null ? void 0 : onSearchChange(term);
|
|
6456
6569
|
},
|
|
6457
6570
|
[setSearchTerm, onSearchChange]
|
|
6458
6571
|
);
|
|
6459
|
-
const handleToggleFilterVisibility =
|
|
6572
|
+
const handleToggleFilterVisibility = useCallback7(
|
|
6460
6573
|
(visible) => {
|
|
6461
6574
|
if (alwaysVisible) {
|
|
6462
6575
|
return;
|
|
@@ -6465,30 +6578,30 @@ var SearchAndFilterProvider = ({
|
|
|
6465
6578
|
},
|
|
6466
6579
|
[alwaysVisible]
|
|
6467
6580
|
);
|
|
6468
|
-
const handleAddFilter =
|
|
6581
|
+
const handleAddFilter = useCallback7(() => {
|
|
6469
6582
|
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
6470
6583
|
}, [filters, onChange]);
|
|
6471
|
-
const handleResetFilters =
|
|
6584
|
+
const handleResetFilters = useCallback7(() => {
|
|
6472
6585
|
if (onResetFilterValues) {
|
|
6473
6586
|
return onResetFilterValues();
|
|
6474
6587
|
}
|
|
6475
6588
|
onSearchChange == null ? void 0 : onSearchChange("");
|
|
6476
6589
|
onChange(resetFilterValues);
|
|
6477
6590
|
}, [onChange, resetFilterValues, onSearchChange, onResetFilterValues]);
|
|
6478
|
-
const handleDeleteFilter =
|
|
6591
|
+
const handleDeleteFilter = useCallback7(
|
|
6479
6592
|
(index) => {
|
|
6480
6593
|
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
6481
6594
|
onChange(remainingFilters);
|
|
6482
6595
|
},
|
|
6483
6596
|
[filters, onChange]
|
|
6484
6597
|
);
|
|
6485
|
-
const validFilterQuery =
|
|
6598
|
+
const validFilterQuery = useMemo21(() => {
|
|
6486
6599
|
const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
|
|
6487
6600
|
if (hasValidFilters) {
|
|
6488
6601
|
return filters;
|
|
6489
6602
|
}
|
|
6490
6603
|
}, [filters]);
|
|
6491
|
-
|
|
6604
|
+
useEffect18(() => {
|
|
6492
6605
|
if (filterVisibility) {
|
|
6493
6606
|
const handleEscKeyFilterClose = (e) => {
|
|
6494
6607
|
if (e.key === "Escape") {
|
|
@@ -6501,7 +6614,7 @@ var SearchAndFilterProvider = ({
|
|
|
6501
6614
|
};
|
|
6502
6615
|
}
|
|
6503
6616
|
}, [filterVisibility, handleToggleFilterVisibility]);
|
|
6504
|
-
return /* @__PURE__ */
|
|
6617
|
+
return /* @__PURE__ */ jsx75(
|
|
6505
6618
|
SearchAndFilterContext.Provider,
|
|
6506
6619
|
{
|
|
6507
6620
|
value: {
|
|
@@ -6517,20 +6630,21 @@ var SearchAndFilterProvider = ({
|
|
|
6517
6630
|
filterOptions,
|
|
6518
6631
|
validFilterQuery,
|
|
6519
6632
|
totalResults,
|
|
6633
|
+
isLoading,
|
|
6520
6634
|
filterMapper: filterMapper2,
|
|
6521
6635
|
allowBindingSearchTerm
|
|
6522
6636
|
},
|
|
6523
|
-
children: /* @__PURE__ */
|
|
6637
|
+
children: /* @__PURE__ */ jsx75(VerticalRhythm5, { children })
|
|
6524
6638
|
}
|
|
6525
6639
|
);
|
|
6526
6640
|
};
|
|
6527
6641
|
var useSearchAndFilter = () => {
|
|
6528
|
-
const value =
|
|
6642
|
+
const value = useContext7(SearchAndFilterContext);
|
|
6529
6643
|
return { ...value };
|
|
6530
6644
|
};
|
|
6531
6645
|
|
|
6532
6646
|
// src/components/SearchAndFilter/FilterControls.tsx
|
|
6533
|
-
import { Fragment as
|
|
6647
|
+
import { Fragment as Fragment14, jsx as jsx76, jsxs as jsxs33 } from "@emotion/react/jsx-runtime";
|
|
6534
6648
|
var FilterControls = ({
|
|
6535
6649
|
children,
|
|
6536
6650
|
hideSearchInput
|
|
@@ -6543,10 +6657,10 @@ var FilterControls = ({
|
|
|
6543
6657
|
searchTerm,
|
|
6544
6658
|
allowBindingSearchTerm
|
|
6545
6659
|
} = useSearchAndFilter();
|
|
6546
|
-
const editorRef =
|
|
6660
|
+
const editorRef = useRef10(null);
|
|
6547
6661
|
const variableRefernceCountInSearchTerm = hasReferencedVariables2(searchTerm);
|
|
6548
|
-
const [idToResetInputVariables, setIdToResetInputVariables] =
|
|
6549
|
-
const [localSearchTerm, setLocalSearchTerm] =
|
|
6662
|
+
const [idToResetInputVariables, setIdToResetInputVariables] = useState22("data-resource-search-term-input");
|
|
6663
|
+
const [localSearchTerm, setLocalSearchTerm] = useState22(searchTerm);
|
|
6550
6664
|
useDebounce7(
|
|
6551
6665
|
() => {
|
|
6552
6666
|
setSearchTerm(localSearchTerm);
|
|
@@ -6554,14 +6668,14 @@ var FilterControls = ({
|
|
|
6554
6668
|
300,
|
|
6555
6669
|
[localSearchTerm]
|
|
6556
6670
|
);
|
|
6557
|
-
|
|
6671
|
+
useEffect19(() => {
|
|
6558
6672
|
if (searchTerm === "") {
|
|
6559
6673
|
setLocalSearchTerm("");
|
|
6560
6674
|
setIdToResetInputVariables(`data-resource-search-term-input-${v42()}`);
|
|
6561
6675
|
}
|
|
6562
6676
|
}, [searchTerm]);
|
|
6563
|
-
return /* @__PURE__ */ jsxs33(
|
|
6564
|
-
/* @__PURE__ */
|
|
6677
|
+
return /* @__PURE__ */ jsxs33(Fragment14, { children: [
|
|
6678
|
+
/* @__PURE__ */ jsx76(
|
|
6565
6679
|
FilterButton2,
|
|
6566
6680
|
{
|
|
6567
6681
|
"aria-controls": "search-and-filter-options",
|
|
@@ -6575,7 +6689,7 @@ var FilterControls = ({
|
|
|
6575
6689
|
}
|
|
6576
6690
|
),
|
|
6577
6691
|
hideSearchInput ? null : /* @__PURE__ */ jsxs33("div", { css: BindableKeywordSearchInputStyles, "data-testid": "search-container", children: [
|
|
6578
|
-
/* @__PURE__ */
|
|
6692
|
+
/* @__PURE__ */ jsx76(
|
|
6579
6693
|
InputVariables,
|
|
6580
6694
|
{
|
|
6581
6695
|
label: "",
|
|
@@ -6585,7 +6699,7 @@ var FilterControls = ({
|
|
|
6585
6699
|
value: localSearchTerm,
|
|
6586
6700
|
onChange: (value) => setLocalSearchTerm(value != null ? value : ""),
|
|
6587
6701
|
disableVariables: !allowBindingSearchTerm,
|
|
6588
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
6702
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx76(
|
|
6589
6703
|
InputKeywordSearch,
|
|
6590
6704
|
{
|
|
6591
6705
|
placeholder: "Search...",
|
|
@@ -6604,7 +6718,7 @@ var FilterControls = ({
|
|
|
6604
6718
|
)
|
|
6605
6719
|
}
|
|
6606
6720
|
),
|
|
6607
|
-
variableRefernceCountInSearchTerm ? /* @__PURE__ */
|
|
6721
|
+
variableRefernceCountInSearchTerm ? /* @__PURE__ */ jsx76("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ jsx76(
|
|
6608
6722
|
"button",
|
|
6609
6723
|
{
|
|
6610
6724
|
css: ClearSearchButtonStyles,
|
|
@@ -6618,7 +6732,7 @@ var FilterControls = ({
|
|
|
6618
6732
|
},
|
|
6619
6733
|
type: "button",
|
|
6620
6734
|
"data-testid": "keyword-search-clear-button",
|
|
6621
|
-
children: /* @__PURE__ */
|
|
6735
|
+
children: /* @__PURE__ */ jsx76(Icon3, { icon: CgClose, iconColor: "red", size: "1rem" })
|
|
6622
6736
|
}
|
|
6623
6737
|
) }) : null
|
|
6624
6738
|
] }),
|
|
@@ -6629,7 +6743,7 @@ var FilterControls = ({
|
|
|
6629
6743
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
6630
6744
|
import { CgTrash as CgTrash2 } from "@react-icons/all-files/cg/CgTrash";
|
|
6631
6745
|
import { Icon as Icon4, InputComboBox as InputComboBox5 } from "@uniformdev/design-system";
|
|
6632
|
-
import { useMemo as
|
|
6746
|
+
import { useMemo as useMemo22 } from "react";
|
|
6633
6747
|
|
|
6634
6748
|
// src/components/SearchAndFilter/util/isFilterBindable.ts
|
|
6635
6749
|
function isFilterBindable(filter, operator) {
|
|
@@ -6638,7 +6752,7 @@ function isFilterBindable(filter, operator) {
|
|
|
6638
6752
|
}
|
|
6639
6753
|
|
|
6640
6754
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
6641
|
-
import { jsx as
|
|
6755
|
+
import { jsx as jsx77, jsxs as jsxs34 } from "@emotion/react/jsx-runtime";
|
|
6642
6756
|
var FilterItem = ({
|
|
6643
6757
|
index,
|
|
6644
6758
|
operatorOptions,
|
|
@@ -6656,7 +6770,7 @@ var FilterItem = ({
|
|
|
6656
6770
|
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
6657
6771
|
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
6658
6772
|
const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
|
|
6659
|
-
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } =
|
|
6773
|
+
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = useMemo22(() => {
|
|
6660
6774
|
var _a2;
|
|
6661
6775
|
const currentSelectedFilterGroup = filterOptions.find((item) => {
|
|
6662
6776
|
var _a3;
|
|
@@ -6687,9 +6801,9 @@ var FilterItem = ({
|
|
|
6687
6801
|
const CustomLeftHandComponent = selectedFieldValue == null ? void 0 : selectedFieldValue.leftHandSideComponentWhenSelected;
|
|
6688
6802
|
const isEmptyOperator = metaDataPossibleOptions === "empty";
|
|
6689
6803
|
return /* @__PURE__ */ jsxs34("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
|
|
6690
|
-
/* @__PURE__ */
|
|
6804
|
+
/* @__PURE__ */ jsx77("span", { children: index === 0 ? initialCriteriaTitle : criteriaGroupOperator }),
|
|
6691
6805
|
/* @__PURE__ */ jsxs34("div", { css: [ConditionalInputRow, isEmptyOperator ? ConditionalInputRowEmpty : null], children: [
|
|
6692
|
-
CustomLeftHandComponent ? /* @__PURE__ */
|
|
6806
|
+
CustomLeftHandComponent ? /* @__PURE__ */ jsx77(
|
|
6693
6807
|
CustomLeftHandComponent,
|
|
6694
6808
|
{
|
|
6695
6809
|
filterOption: selectedFieldValue,
|
|
@@ -6699,7 +6813,7 @@ var FilterItem = ({
|
|
|
6699
6813
|
onFilterOptionChange("");
|
|
6700
6814
|
}
|
|
6701
6815
|
}
|
|
6702
|
-
) : /* @__PURE__ */
|
|
6816
|
+
) : /* @__PURE__ */ jsx77(
|
|
6703
6817
|
InputComboBox5,
|
|
6704
6818
|
{
|
|
6705
6819
|
"aria-label": label,
|
|
@@ -6726,7 +6840,7 @@ var FilterItem = ({
|
|
|
6726
6840
|
name: `filter-field-${index}`
|
|
6727
6841
|
}
|
|
6728
6842
|
),
|
|
6729
|
-
/* @__PURE__ */
|
|
6843
|
+
/* @__PURE__ */ jsx77(
|
|
6730
6844
|
InputComboBox5,
|
|
6731
6845
|
{
|
|
6732
6846
|
"aria-label": operatorLabel,
|
|
@@ -6750,7 +6864,7 @@ var FilterItem = ({
|
|
|
6750
6864
|
name: `filter-operator-${index}`
|
|
6751
6865
|
}
|
|
6752
6866
|
),
|
|
6753
|
-
/* @__PURE__ */
|
|
6867
|
+
/* @__PURE__ */ jsx77(
|
|
6754
6868
|
FilterEditorRenderer,
|
|
6755
6869
|
{
|
|
6756
6870
|
"aria-label": metaDataLabel,
|
|
@@ -6765,7 +6879,7 @@ var FilterItem = ({
|
|
|
6765
6879
|
filterFieldName: filters[index].field
|
|
6766
6880
|
}
|
|
6767
6881
|
),
|
|
6768
|
-
readOnly ? null : /* @__PURE__ */
|
|
6882
|
+
readOnly ? null : /* @__PURE__ */ jsx77(
|
|
6769
6883
|
"button",
|
|
6770
6884
|
{
|
|
6771
6885
|
type: "button",
|
|
@@ -6774,7 +6888,7 @@ var FilterItem = ({
|
|
|
6774
6888
|
css: IconBtn,
|
|
6775
6889
|
"data-testid": "delete-filter",
|
|
6776
6890
|
disabled: filters.length === 1,
|
|
6777
|
-
children: /* @__PURE__ */
|
|
6891
|
+
children: /* @__PURE__ */ jsx77(Icon4, { icon: CgTrash2, iconColor: filters.length === 1 ? "gray" : "red", size: "1rem" })
|
|
6778
6892
|
}
|
|
6779
6893
|
)
|
|
6780
6894
|
] })
|
|
@@ -6787,16 +6901,16 @@ import { Icon as Icon5 } from "@uniformdev/design-system";
|
|
|
6787
6901
|
|
|
6788
6902
|
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
6789
6903
|
import { HorizontalRhythm as HorizontalRhythm8, VerticalRhythm as VerticalRhythm6 } from "@uniformdev/design-system";
|
|
6790
|
-
import
|
|
6791
|
-
import { jsx as
|
|
6904
|
+
import React7, { useEffect as useEffect20 } from "react";
|
|
6905
|
+
import { jsx as jsx78, jsxs as jsxs35 } from "@emotion/react/jsx-runtime";
|
|
6792
6906
|
var SearchAndFilterOptionsContainer2 = ({
|
|
6793
6907
|
buttonRow,
|
|
6794
6908
|
additionalFiltersContainer,
|
|
6795
6909
|
children
|
|
6796
6910
|
}) => {
|
|
6797
6911
|
return /* @__PURE__ */ jsxs35("div", { css: SearchAndFilterOptionsContainer, children: [
|
|
6798
|
-
/* @__PURE__ */
|
|
6799
|
-
buttonRow ? /* @__PURE__ */
|
|
6912
|
+
/* @__PURE__ */ jsx78("div", { css: SearchAndFilterOptionsInnerContainer, children }),
|
|
6913
|
+
buttonRow ? /* @__PURE__ */ jsx78(
|
|
6800
6914
|
HorizontalRhythm8,
|
|
6801
6915
|
{
|
|
6802
6916
|
css: SearchAndFilterButtonGroup,
|
|
@@ -6806,7 +6920,7 @@ var SearchAndFilterOptionsContainer2 = ({
|
|
|
6806
6920
|
children: buttonRow
|
|
6807
6921
|
}
|
|
6808
6922
|
) : null,
|
|
6809
|
-
additionalFiltersContainer ? /* @__PURE__ */
|
|
6923
|
+
additionalFiltersContainer ? /* @__PURE__ */ jsx78("div", { css: SearchAndFilterAdditionalContainer, children: additionalFiltersContainer }) : null
|
|
6810
6924
|
] });
|
|
6811
6925
|
};
|
|
6812
6926
|
var FilterMenu = ({
|
|
@@ -6819,22 +6933,22 @@ var FilterMenu = ({
|
|
|
6819
6933
|
resetButtonText = "reset"
|
|
6820
6934
|
}) => {
|
|
6821
6935
|
const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
|
|
6822
|
-
const innerMenuRef =
|
|
6823
|
-
|
|
6936
|
+
const innerMenuRef = React7.useRef(null);
|
|
6937
|
+
useEffect20(() => {
|
|
6824
6938
|
var _a;
|
|
6825
6939
|
if (filterVisibility) {
|
|
6826
6940
|
(_a = innerMenuRef.current) == null ? void 0 : _a.focus();
|
|
6827
6941
|
}
|
|
6828
6942
|
}, [filterVisibility]);
|
|
6829
|
-
return /* @__PURE__ */
|
|
6943
|
+
return /* @__PURE__ */ jsx78(VerticalRhythm6, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ jsxs35(
|
|
6830
6944
|
SearchAndFilterOptionsContainer2,
|
|
6831
6945
|
{
|
|
6832
6946
|
buttonRow: menuControls,
|
|
6833
6947
|
additionalFiltersContainer,
|
|
6834
6948
|
children: [
|
|
6835
6949
|
/* @__PURE__ */ jsxs35(HorizontalRhythm8, { gap: "sm", align: "center", justify: "space-between", children: [
|
|
6836
|
-
filterTitle ? /* @__PURE__ */
|
|
6837
|
-
(filters == null ? void 0 : filters.length) && resetButtonText ? /* @__PURE__ */
|
|
6950
|
+
filterTitle ? /* @__PURE__ */ jsx78("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }) : null,
|
|
6951
|
+
(filters == null ? void 0 : filters.length) && resetButtonText ? /* @__PURE__ */ jsx78(
|
|
6838
6952
|
"button",
|
|
6839
6953
|
{
|
|
6840
6954
|
type: "button",
|
|
@@ -6945,7 +7059,7 @@ function hasBindings(currentValue) {
|
|
|
6945
7059
|
}
|
|
6946
7060
|
|
|
6947
7061
|
// src/components/SearchAndFilter/FilterItems.tsx
|
|
6948
|
-
import { jsx as
|
|
7062
|
+
import { jsx as jsx79, jsxs as jsxs36 } from "@emotion/react/jsx-runtime";
|
|
6949
7063
|
var FilterItems = ({
|
|
6950
7064
|
addButtonText = "add condition",
|
|
6951
7065
|
additionalFiltersContainer,
|
|
@@ -6982,7 +7096,7 @@ var FilterItems = ({
|
|
|
6982
7096
|
}
|
|
6983
7097
|
setFilters(next);
|
|
6984
7098
|
};
|
|
6985
|
-
return /* @__PURE__ */
|
|
7099
|
+
return /* @__PURE__ */ jsx79(
|
|
6986
7100
|
FilterMenu,
|
|
6987
7101
|
{
|
|
6988
7102
|
id: "search-and-filter-options",
|
|
@@ -6995,7 +7109,7 @@ var FilterItems = ({
|
|
|
6995
7109
|
onClick: handleAddFilter,
|
|
6996
7110
|
"data-testid": "add-filter",
|
|
6997
7111
|
children: [
|
|
6998
|
-
/* @__PURE__ */
|
|
7112
|
+
/* @__PURE__ */ jsx79(Icon5, { icon: CgMathPlus, iconColor: "currentColor", size: "1rem" }),
|
|
6999
7113
|
addButtonText
|
|
7000
7114
|
]
|
|
7001
7115
|
}
|
|
@@ -7011,7 +7125,7 @@ var FilterItems = ({
|
|
|
7011
7125
|
})) == null ? void 0 : _a.options) != null ? _b : [];
|
|
7012
7126
|
const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
|
|
7013
7127
|
const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
|
|
7014
|
-
return /* @__PURE__ */
|
|
7128
|
+
return /* @__PURE__ */ jsx79(
|
|
7015
7129
|
FilterItem,
|
|
7016
7130
|
{
|
|
7017
7131
|
index: i,
|
|
@@ -7036,7 +7150,7 @@ import { VerticalRhythm as VerticalRhythm7 } from "@uniformdev/design-system";
|
|
|
7036
7150
|
|
|
7037
7151
|
// src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
|
|
7038
7152
|
import { Button as Button5, Callout as Callout4, HorizontalRhythm as HorizontalRhythm9, Paragraph } from "@uniformdev/design-system";
|
|
7039
|
-
import { Fragment as
|
|
7153
|
+
import { Fragment as Fragment15, jsx as jsx80, jsxs as jsxs37 } from "@emotion/react/jsx-runtime";
|
|
7040
7154
|
var SearchAndFilterResultContainer = ({
|
|
7041
7155
|
buttonText,
|
|
7042
7156
|
clearButtonLabel = "clear",
|
|
@@ -7045,7 +7159,7 @@ var SearchAndFilterResultContainer = ({
|
|
|
7045
7159
|
onHandleClear,
|
|
7046
7160
|
hideClearButton
|
|
7047
7161
|
}) => {
|
|
7048
|
-
const { searchTerm, totalResults, filters, handleResetFilters, setSearchTerm } = useSearchAndFilter();
|
|
7162
|
+
const { searchTerm, totalResults, filters, handleResetFilters, setSearchTerm, isLoading } = useSearchAndFilter();
|
|
7049
7163
|
const emptyFilters = filters.length === 0 || filters.every((filter) => !filter.value);
|
|
7050
7164
|
const getTextValue = ({
|
|
7051
7165
|
defaultPropText,
|
|
@@ -7076,7 +7190,7 @@ var SearchAndFilterResultContainer = ({
|
|
|
7076
7190
|
filterText: "No results match the selected filters",
|
|
7077
7191
|
fallbackText: "No matching results found"
|
|
7078
7192
|
});
|
|
7079
|
-
if (totalResults
|
|
7193
|
+
if (isLoading || totalResults === void 0 || totalResults > 0) {
|
|
7080
7194
|
return null;
|
|
7081
7195
|
}
|
|
7082
7196
|
const handleClearSearch = () => {
|
|
@@ -7087,18 +7201,18 @@ var SearchAndFilterResultContainer = ({
|
|
|
7087
7201
|
handleResetFilters();
|
|
7088
7202
|
}
|
|
7089
7203
|
};
|
|
7090
|
-
return /* @__PURE__ */ jsxs37(
|
|
7204
|
+
return /* @__PURE__ */ jsxs37(Fragment15, { children: [
|
|
7091
7205
|
/* @__PURE__ */ jsxs37(HorizontalRhythm9, { children: [
|
|
7092
7206
|
/* @__PURE__ */ jsxs37("span", { children: [
|
|
7093
7207
|
totalResults,
|
|
7094
7208
|
" results ",
|
|
7095
7209
|
searchTerm ? `for "${searchTerm}"` : null
|
|
7096
7210
|
] }),
|
|
7097
|
-
!searchTerm || hideClearButton ? null : /* @__PURE__ */
|
|
7211
|
+
!searchTerm || hideClearButton ? null : /* @__PURE__ */ jsx80(Button5, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
|
|
7098
7212
|
] }),
|
|
7099
7213
|
totalResults === 0 ? /* @__PURE__ */ jsxs37(Callout4, { title: automateCalloutTitle, type: "note", children: [
|
|
7100
|
-
calloutText ? /* @__PURE__ */
|
|
7101
|
-
hideClearButton ? null : /* @__PURE__ */
|
|
7214
|
+
calloutText ? /* @__PURE__ */ jsx80(Paragraph, { children: calloutText }) : null,
|
|
7215
|
+
hideClearButton ? null : /* @__PURE__ */ jsx80(
|
|
7102
7216
|
Button5,
|
|
7103
7217
|
{
|
|
7104
7218
|
buttonType: "tertiaryOutline",
|
|
@@ -7113,25 +7227,26 @@ var SearchAndFilterResultContainer = ({
|
|
|
7113
7227
|
};
|
|
7114
7228
|
|
|
7115
7229
|
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
7116
|
-
import { jsx as
|
|
7230
|
+
import { jsx as jsx81, jsxs as jsxs38 } from "@emotion/react/jsx-runtime";
|
|
7117
7231
|
var SearchAndFilter = ({
|
|
7118
7232
|
filters,
|
|
7119
7233
|
filterOptions,
|
|
7120
7234
|
filterVisible,
|
|
7121
7235
|
filterControls,
|
|
7122
7236
|
viewSwitchControls,
|
|
7123
|
-
resultsContainerView = /* @__PURE__ */
|
|
7237
|
+
resultsContainerView = /* @__PURE__ */ jsx81(SearchAndFilterResultContainer, {}),
|
|
7124
7238
|
filterMapper: filterMapper2 = filterMapper,
|
|
7125
7239
|
additionalFiltersContainer,
|
|
7126
7240
|
onChange,
|
|
7127
7241
|
defaultSearchTerm,
|
|
7128
7242
|
onSearchChange,
|
|
7129
7243
|
totalResults,
|
|
7244
|
+
isLoading,
|
|
7130
7245
|
allowBindingSearchTerm = false,
|
|
7131
7246
|
resetFilterValues = [],
|
|
7132
7247
|
onResetFilterValues
|
|
7133
7248
|
}) => {
|
|
7134
|
-
return /* @__PURE__ */
|
|
7249
|
+
return /* @__PURE__ */ jsx81(
|
|
7135
7250
|
SearchAndFilterProvider,
|
|
7136
7251
|
{
|
|
7137
7252
|
filters,
|
|
@@ -7141,22 +7256,23 @@ var SearchAndFilter = ({
|
|
|
7141
7256
|
defaultSearchTerm,
|
|
7142
7257
|
onSearchChange,
|
|
7143
7258
|
totalResults,
|
|
7259
|
+
isLoading,
|
|
7144
7260
|
resetFilterValues,
|
|
7145
7261
|
filterMapper: filterMapper2,
|
|
7146
7262
|
allowBindingSearchTerm,
|
|
7147
7263
|
onResetFilterValues,
|
|
7148
7264
|
children: /* @__PURE__ */ jsxs38(VerticalRhythm7, { "data-testid": "search-and-filter", children: [
|
|
7149
7265
|
/* @__PURE__ */ jsxs38("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
|
|
7150
|
-
/* @__PURE__ */
|
|
7266
|
+
/* @__PURE__ */ jsx81(
|
|
7151
7267
|
"div",
|
|
7152
7268
|
{
|
|
7153
7269
|
css: SearchAndFilterControlsWrapper(viewSwitchControls ? "auto 1fr 0.05fr" : "auto 1fr"),
|
|
7154
|
-
children: !filterControls ? /* @__PURE__ */
|
|
7270
|
+
children: !filterControls ? /* @__PURE__ */ jsx81(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
|
|
7155
7271
|
}
|
|
7156
7272
|
),
|
|
7157
7273
|
viewSwitchControls
|
|
7158
7274
|
] }),
|
|
7159
|
-
/* @__PURE__ */
|
|
7275
|
+
/* @__PURE__ */ jsx81(FilterItems, { additionalFiltersContainer }),
|
|
7160
7276
|
resultsContainerView
|
|
7161
7277
|
] })
|
|
7162
7278
|
}
|
|
@@ -7165,17 +7281,17 @@ var SearchAndFilter = ({
|
|
|
7165
7281
|
|
|
7166
7282
|
// src/components/SearchAndFilter/SearchOnlyFilter.tsx
|
|
7167
7283
|
import { InputKeywordSearch as InputKeywordSearch2 } from "@uniformdev/design-system";
|
|
7168
|
-
import { createContext as
|
|
7284
|
+
import { createContext as createContext8, useState as useState23 } from "react";
|
|
7169
7285
|
import { useDebounce as useDebounce8 } from "react-use";
|
|
7170
|
-
import { jsx as
|
|
7171
|
-
var SearchOnlyContext =
|
|
7286
|
+
import { jsx as jsx82 } from "@emotion/react/jsx-runtime";
|
|
7287
|
+
var SearchOnlyContext = createContext8({
|
|
7172
7288
|
searchTerm: "",
|
|
7173
7289
|
setSearchTerm: () => {
|
|
7174
7290
|
}
|
|
7175
7291
|
});
|
|
7176
7292
|
var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
7177
7293
|
const { searchTerm, setSearchTerm } = useSearchAndFilter();
|
|
7178
|
-
const [localeSearchTerm, setLocaleSearchTerm] =
|
|
7294
|
+
const [localeSearchTerm, setLocaleSearchTerm] = useState23("");
|
|
7179
7295
|
useDebounce8(
|
|
7180
7296
|
() => {
|
|
7181
7297
|
setSearchTerm(localeSearchTerm);
|
|
@@ -7184,14 +7300,14 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
7184
7300
|
300,
|
|
7185
7301
|
[localeSearchTerm]
|
|
7186
7302
|
);
|
|
7187
|
-
return /* @__PURE__ */
|
|
7303
|
+
return /* @__PURE__ */ jsx82(
|
|
7188
7304
|
SearchOnlyContext.Provider,
|
|
7189
7305
|
{
|
|
7190
7306
|
value: {
|
|
7191
7307
|
searchTerm,
|
|
7192
7308
|
setSearchTerm: setLocaleSearchTerm
|
|
7193
7309
|
},
|
|
7194
|
-
children: /* @__PURE__ */
|
|
7310
|
+
children: /* @__PURE__ */ jsx82("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ jsx82(
|
|
7195
7311
|
InputKeywordSearch2,
|
|
7196
7312
|
{
|
|
7197
7313
|
placeholder: "Search...",
|
|
@@ -7441,7 +7557,7 @@ var InputVariableWrapper = css22`
|
|
|
7441
7557
|
`;
|
|
7442
7558
|
|
|
7443
7559
|
// src/components/SearchAndFilter/SortItems.tsx
|
|
7444
|
-
import { jsx as
|
|
7560
|
+
import { jsx as jsx83, jsxs as jsxs39 } from "@emotion/react/jsx-runtime";
|
|
7445
7561
|
var SortItems = ({
|
|
7446
7562
|
sortByLabel = "Sort by",
|
|
7447
7563
|
localeLabel = "Show locale",
|
|
@@ -7465,9 +7581,9 @@ var SortItems = ({
|
|
|
7465
7581
|
const localeLabelValue = sortOptions.length > 1 ? localeLabel : `${localeLabel}s`;
|
|
7466
7582
|
return /* @__PURE__ */ jsxs39("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
|
|
7467
7583
|
/* @__PURE__ */ jsxs39(VerticalRhythm8, { gap: "xs", children: [
|
|
7468
|
-
/* @__PURE__ */
|
|
7584
|
+
/* @__PURE__ */ jsx83("span", { css: Title2, children: sortByLabel }),
|
|
7469
7585
|
/* @__PURE__ */ jsxs39("div", { css: SortFilterInputRow, children: [
|
|
7470
|
-
/* @__PURE__ */
|
|
7586
|
+
/* @__PURE__ */ jsx83(
|
|
7471
7587
|
InputVariables,
|
|
7472
7588
|
{
|
|
7473
7589
|
disableInlineMenu: disableSortBinding,
|
|
@@ -7475,7 +7591,7 @@ var SortItems = ({
|
|
|
7475
7591
|
value: sortField,
|
|
7476
7592
|
valueToResetTo: "created_at",
|
|
7477
7593
|
onChange: (e) => onSortChange(`${e}_${sortDirection}`),
|
|
7478
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
7594
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx83(
|
|
7479
7595
|
InputComboBox6,
|
|
7480
7596
|
{
|
|
7481
7597
|
id: "sort-by-field",
|
|
@@ -7498,7 +7614,7 @@ var SortItems = ({
|
|
|
7498
7614
|
)
|
|
7499
7615
|
}
|
|
7500
7616
|
),
|
|
7501
|
-
/* @__PURE__ */
|
|
7617
|
+
/* @__PURE__ */ jsx83(
|
|
7502
7618
|
InputVariables,
|
|
7503
7619
|
{
|
|
7504
7620
|
disableInlineMenu: disableSortBinding,
|
|
@@ -7506,7 +7622,7 @@ var SortItems = ({
|
|
|
7506
7622
|
valueToResetTo: "DESC",
|
|
7507
7623
|
showMenuPosition: disableSortBinding ? void 0 : "inline-right",
|
|
7508
7624
|
onChange: (e) => onSortChange(`${sortField}_${e}`),
|
|
7509
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
7625
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx83(
|
|
7510
7626
|
SegmentedControl,
|
|
7511
7627
|
{
|
|
7512
7628
|
noCheckmark: true,
|
|
@@ -7538,14 +7654,14 @@ var SortItems = ({
|
|
|
7538
7654
|
)
|
|
7539
7655
|
] })
|
|
7540
7656
|
] }),
|
|
7541
|
-
hideLocaleOptions ? null : /* @__PURE__ */
|
|
7657
|
+
hideLocaleOptions ? null : /* @__PURE__ */ jsx83(VerticalRhythm8, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ jsx83(
|
|
7542
7658
|
InputVariables,
|
|
7543
7659
|
{
|
|
7544
7660
|
label: localeLabelValue,
|
|
7545
7661
|
value: localeValue,
|
|
7546
7662
|
showMenuPosition: "inline-right",
|
|
7547
7663
|
onChange: (e) => onLocaleChange(e != null ? e : ""),
|
|
7548
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
7664
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx83(
|
|
7549
7665
|
InputSelect5,
|
|
7550
7666
|
{
|
|
7551
7667
|
name: "localeReturned",
|
|
@@ -7576,7 +7692,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
7576
7692
|
|
|
7577
7693
|
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
7578
7694
|
import { bindVariables as bindVariables2, createVariableReference as createVariableReference4, LOCALE_DYNAMIC_INPUT_NAME as LOCALE_DYNAMIC_INPUT_NAME2 } from "@uniformdev/canvas";
|
|
7579
|
-
import { useEffect as
|
|
7695
|
+
import { useEffect as useEffect21, useRef as useRef11 } from "react";
|
|
7580
7696
|
function useContentDataResourceLocaleInfo({
|
|
7581
7697
|
locale,
|
|
7582
7698
|
defaultLocale,
|
|
@@ -7584,12 +7700,12 @@ function useContentDataResourceLocaleInfo({
|
|
|
7584
7700
|
dynamicInputs
|
|
7585
7701
|
}) {
|
|
7586
7702
|
var _a;
|
|
7587
|
-
const setLocaleRef =
|
|
7703
|
+
const setLocaleRef = useRef11(setLocale);
|
|
7588
7704
|
setLocaleRef.current = setLocale;
|
|
7589
7705
|
const { flatVariables } = useVariables();
|
|
7590
7706
|
const effectiveLocale = locale != null ? locale : dynamicInputs[LOCALE_DYNAMIC_INPUT_NAME2] ? createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2) : defaultLocale != null ? defaultLocale : "";
|
|
7591
7707
|
const boundLocale = (_a = bindVariables2({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
7592
|
-
|
|
7708
|
+
useEffect21(() => {
|
|
7593
7709
|
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
7594
7710
|
setLocaleRef.current(effectiveLocale);
|
|
7595
7711
|
}
|
|
@@ -7655,6 +7771,9 @@ export {
|
|
|
7655
7771
|
DataTypeEditor,
|
|
7656
7772
|
DateEditor,
|
|
7657
7773
|
DateRangeEditor,
|
|
7774
|
+
DelegationContext,
|
|
7775
|
+
DelegationGate,
|
|
7776
|
+
DelegationProvider,
|
|
7658
7777
|
DrawerContent,
|
|
7659
7778
|
EDIT_VARIABLE_COMMAND,
|
|
7660
7779
|
FilterButton2 as FilterButton,
|
|
@@ -7767,6 +7886,7 @@ export {
|
|
|
7767
7886
|
urlEncodeRequestUrl,
|
|
7768
7887
|
useConnectedDataAsVariables,
|
|
7769
7888
|
useContentDataResourceLocaleInfo,
|
|
7889
|
+
useDelegation,
|
|
7770
7890
|
useDynamicInputsAsVariables,
|
|
7771
7891
|
useMeshLocation,
|
|
7772
7892
|
useObjectSearchContext,
|