@uniformdev/mesh-sdk-react 19.87.0 → 19.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.esm.js +189 -170
- package/dist/index.js +194 -175
- package/dist/index.mjs +189 -170
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1309,12 +1309,15 @@ type ObjectSearchContextProps<TExtraFilters = unknown, TExtraItemProps = unknown
|
|
|
1309
1309
|
list: ItemListProps<TExtraItemProps>;
|
|
1310
1310
|
/** function that sets the list of items to state */
|
|
1311
1311
|
onSetList: (value: ItemListProps) => void;
|
|
1312
|
+
/** is multi items selection allowed or not */
|
|
1313
|
+
isMulti: boolean;
|
|
1312
1314
|
};
|
|
1313
1315
|
type ObjectSearchProviderProps = {
|
|
1314
1316
|
children: ReactNode;
|
|
1315
1317
|
currentlySelectedItems?: Array<SelectedItemProps>;
|
|
1318
|
+
isMulti?: boolean;
|
|
1316
1319
|
};
|
|
1317
|
-
declare const ObjectSearchProvider: ({ currentlySelectedItems, children }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1320
|
+
declare const ObjectSearchProvider: ({ currentlySelectedItems, isMulti, children, }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1318
1321
|
declare function useObjectSearchContext<TExtraSearchFilters = unknown, TExtraItemProps = unknown>(): ObjectSearchContextProps<TExtraSearchFilters, TExtraItemProps>;
|
|
1319
1322
|
|
|
1320
1323
|
type ObjectSearchListItemProps = SelectedItemProps & {
|
|
@@ -1323,7 +1326,7 @@ type ObjectSearchListItemProps = SelectedItemProps & {
|
|
|
1323
1326
|
/** sets image parameters
|
|
1324
1327
|
* @deprecated Please use imageUrl to make it compatible with */
|
|
1325
1328
|
image?: {
|
|
1326
|
-
/** sets the src
|
|
1329
|
+
/** sets the src value */
|
|
1327
1330
|
src: string;
|
|
1328
1331
|
/** sets the alt text value */
|
|
1329
1332
|
alt: string;
|
|
@@ -1345,6 +1348,7 @@ type ObjectSearchListItemProps = SelectedItemProps & {
|
|
|
1345
1348
|
children?: React$1.ReactNode;
|
|
1346
1349
|
/** sets whether multiple entries can be added to the results list context
|
|
1347
1350
|
* @default false
|
|
1351
|
+
* @deprecated Please use isMulti property in <ObjectSearchProvider />
|
|
1348
1352
|
*/
|
|
1349
1353
|
isMulti?: boolean;
|
|
1350
1354
|
/** sets disabled state to the interactive element */
|
package/dist/index.d.ts
CHANGED
|
@@ -1309,12 +1309,15 @@ type ObjectSearchContextProps<TExtraFilters = unknown, TExtraItemProps = unknown
|
|
|
1309
1309
|
list: ItemListProps<TExtraItemProps>;
|
|
1310
1310
|
/** function that sets the list of items to state */
|
|
1311
1311
|
onSetList: (value: ItemListProps) => void;
|
|
1312
|
+
/** is multi items selection allowed or not */
|
|
1313
|
+
isMulti: boolean;
|
|
1312
1314
|
};
|
|
1313
1315
|
type ObjectSearchProviderProps = {
|
|
1314
1316
|
children: ReactNode;
|
|
1315
1317
|
currentlySelectedItems?: Array<SelectedItemProps>;
|
|
1318
|
+
isMulti?: boolean;
|
|
1316
1319
|
};
|
|
1317
|
-
declare const ObjectSearchProvider: ({ currentlySelectedItems, children }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1320
|
+
declare const ObjectSearchProvider: ({ currentlySelectedItems, isMulti, children, }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1318
1321
|
declare function useObjectSearchContext<TExtraSearchFilters = unknown, TExtraItemProps = unknown>(): ObjectSearchContextProps<TExtraSearchFilters, TExtraItemProps>;
|
|
1319
1322
|
|
|
1320
1323
|
type ObjectSearchListItemProps = SelectedItemProps & {
|
|
@@ -1323,7 +1326,7 @@ type ObjectSearchListItemProps = SelectedItemProps & {
|
|
|
1323
1326
|
/** sets image parameters
|
|
1324
1327
|
* @deprecated Please use imageUrl to make it compatible with */
|
|
1325
1328
|
image?: {
|
|
1326
|
-
/** sets the src
|
|
1329
|
+
/** sets the src value */
|
|
1327
1330
|
src: string;
|
|
1328
1331
|
/** sets the alt text value */
|
|
1329
1332
|
alt: string;
|
|
@@ -1345,6 +1348,7 @@ type ObjectSearchListItemProps = SelectedItemProps & {
|
|
|
1345
1348
|
children?: React$1.ReactNode;
|
|
1346
1349
|
/** sets whether multiple entries can be added to the results list context
|
|
1347
1350
|
* @default false
|
|
1351
|
+
* @deprecated Please use isMulti property in <ObjectSearchProvider />
|
|
1348
1352
|
*/
|
|
1349
1353
|
isMulti?: boolean;
|
|
1350
1354
|
/** sets disabled state to the interactive element */
|
package/dist/index.esm.js
CHANGED
|
@@ -6140,9 +6140,9 @@ var DataRefreshButton = ({
|
|
|
6140
6140
|
};
|
|
6141
6141
|
|
|
6142
6142
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6143
|
-
import { css as
|
|
6143
|
+
import { css as css32 } from "@emotion/react";
|
|
6144
6144
|
import { bindVariables } from "@uniformdev/canvas";
|
|
6145
|
-
import { Container, IconsProvider, ScrollableList, VerticalRhythm as VerticalRhythm2 } from "@uniformdev/design-system";
|
|
6145
|
+
import { Callout as Callout5, Container, IconsProvider, ScrollableList, VerticalRhythm as VerticalRhythm2 } from "@uniformdev/design-system";
|
|
6146
6146
|
|
|
6147
6147
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
6148
6148
|
import { bindVariablesToObject as bindVariablesToObject2 } from "@uniformdev/canvas";
|
|
@@ -6167,9 +6167,14 @@ var ObjectSearchContext = createContext5({
|
|
|
6167
6167
|
},
|
|
6168
6168
|
selectedListItems: [],
|
|
6169
6169
|
onRemoveAllSelectedItems: () => {
|
|
6170
|
-
}
|
|
6170
|
+
},
|
|
6171
|
+
isMulti: false
|
|
6171
6172
|
});
|
|
6172
|
-
var ObjectSearchProvider = ({
|
|
6173
|
+
var ObjectSearchProvider = ({
|
|
6174
|
+
currentlySelectedItems,
|
|
6175
|
+
isMulti = false,
|
|
6176
|
+
children
|
|
6177
|
+
}) => {
|
|
6173
6178
|
const [query, setQuery] = useState15({
|
|
6174
6179
|
contentType: "",
|
|
6175
6180
|
keyword: ""
|
|
@@ -6223,6 +6228,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
|
|
|
6223
6228
|
selectedListItems: selectedItems,
|
|
6224
6229
|
onRemoveAllSelectedItems,
|
|
6225
6230
|
list,
|
|
6231
|
+
isMulti,
|
|
6226
6232
|
onSetList
|
|
6227
6233
|
}),
|
|
6228
6234
|
[
|
|
@@ -6233,6 +6239,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
|
|
|
6233
6239
|
selectedItems,
|
|
6234
6240
|
onRemoveAllSelectedItems,
|
|
6235
6241
|
list,
|
|
6242
|
+
isMulti,
|
|
6236
6243
|
onSetList
|
|
6237
6244
|
]
|
|
6238
6245
|
);
|
|
@@ -6253,8 +6260,148 @@ function bindQuery(query, inputs) {
|
|
|
6253
6260
|
return result;
|
|
6254
6261
|
}
|
|
6255
6262
|
|
|
6256
|
-
// src/components/ObjectSearch/
|
|
6263
|
+
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
6264
|
+
import { Chip, Popover } from "@uniformdev/design-system";
|
|
6265
|
+
|
|
6266
|
+
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
6267
|
+
import { css as css31 } from "@emotion/react";
|
|
6268
|
+
import { skeletonLoading } from "@uniformdev/design-system";
|
|
6269
|
+
var ObjectListItemContainer = css31`
|
|
6270
|
+
align-items: center;
|
|
6271
|
+
border: 1px solid var(--gray-300);
|
|
6272
|
+
border-radius: var(--rounded-base);
|
|
6273
|
+
background: var(--white);
|
|
6274
|
+
display: grid;
|
|
6275
|
+
grid-template-columns: 1fr auto;
|
|
6276
|
+
padding: var(--spacing-sm);
|
|
6277
|
+
`;
|
|
6278
|
+
var ObjectListItemContainerDisabled = css31`
|
|
6279
|
+
opacity: var(--opacity-50);
|
|
6280
|
+
pointer-events: none;
|
|
6281
|
+
`;
|
|
6282
|
+
var ObjectListItemLoading = css31`
|
|
6283
|
+
animation: ${skeletonLoading} 1s linear infinite alternate;
|
|
6284
|
+
border-color: transparent;
|
|
6285
|
+
min-height: 42px;
|
|
6286
|
+
position: relative;
|
|
6287
|
+
|
|
6288
|
+
&:before,
|
|
6289
|
+
&:after {
|
|
6290
|
+
background: var(--gray-200);
|
|
6291
|
+
content: '';
|
|
6292
|
+
display: block;
|
|
6293
|
+
height: 1rem;
|
|
6294
|
+
}
|
|
6295
|
+
|
|
6296
|
+
&:before {
|
|
6297
|
+
border-radius: var(--rounded-base);
|
|
6298
|
+
width: 10rem;
|
|
6299
|
+
}
|
|
6300
|
+
|
|
6301
|
+
&:after {
|
|
6302
|
+
border-radius: var(--rounded-full);
|
|
6303
|
+
width: 1rem;
|
|
6304
|
+
}
|
|
6305
|
+
`;
|
|
6306
|
+
var ObjectListItemHeadingGroup = css31`
|
|
6307
|
+
align-items: center;
|
|
6308
|
+
display: grid;
|
|
6309
|
+
`;
|
|
6310
|
+
var ObjectListItemThumbnail = css31`
|
|
6311
|
+
width: 30px;
|
|
6312
|
+
object-fit: contain;
|
|
6313
|
+
`;
|
|
6314
|
+
var ObjectListItemTitle = css31`
|
|
6315
|
+
color: var(--brand-secondary-1);
|
|
6316
|
+
display: block;
|
|
6317
|
+
font-size: var(--fs-sm);
|
|
6318
|
+
`;
|
|
6319
|
+
var ObjectListItemSubtitle = css31`
|
|
6320
|
+
color: var(--gray-500);
|
|
6321
|
+
display: block;
|
|
6322
|
+
font-size: var(--fs-xs);
|
|
6323
|
+
line-height: 1;
|
|
6324
|
+
`;
|
|
6325
|
+
var ObjectListItemInfoContainer = css31`
|
|
6326
|
+
align-items: center;
|
|
6327
|
+
display: flex;
|
|
6328
|
+
gap: var(--spacing-sm);
|
|
6329
|
+
justify-content: center;
|
|
6330
|
+
`;
|
|
6331
|
+
var ObjectListItemControlledContent = css31`
|
|
6332
|
+
display: flex;
|
|
6333
|
+
gap: var(--spacing-sm);
|
|
6334
|
+
`;
|
|
6335
|
+
var ObjectListItemUnControlledContent = css31`
|
|
6336
|
+
margin-top: var(--spacing-sm);
|
|
6337
|
+
grid-column: 1 / -1;
|
|
6338
|
+
`;
|
|
6339
|
+
|
|
6340
|
+
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
6257
6341
|
import { jsx as jsx59, jsxs as jsxs34 } from "@emotion/react/jsx-runtime";
|
|
6342
|
+
var ObjectSearchListItem = ({
|
|
6343
|
+
id,
|
|
6344
|
+
title,
|
|
6345
|
+
contentType,
|
|
6346
|
+
image,
|
|
6347
|
+
imageUrl,
|
|
6348
|
+
popoverData,
|
|
6349
|
+
onSelect,
|
|
6350
|
+
isMulti,
|
|
6351
|
+
disabled,
|
|
6352
|
+
children
|
|
6353
|
+
}) => {
|
|
6354
|
+
const { onSelectItem, selectedListItems, isMulti: globalIsMulti } = useObjectSearchContext();
|
|
6355
|
+
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
6356
|
+
const handleSelectItem = () => {
|
|
6357
|
+
var _a;
|
|
6358
|
+
const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
|
|
6359
|
+
const selectedItem = { id, title, contentType, imageUrl, image, popoverData, ...extraData };
|
|
6360
|
+
if (isMulti === true || globalIsMulti) {
|
|
6361
|
+
return onSelectItem(selectedItem);
|
|
6362
|
+
}
|
|
6363
|
+
return onSelectItem([selectedItem]);
|
|
6364
|
+
};
|
|
6365
|
+
const selected = selectedListItems.some((item) => item.id === id);
|
|
6366
|
+
return /* @__PURE__ */ jsxs34(
|
|
6367
|
+
"div",
|
|
6368
|
+
{
|
|
6369
|
+
role: "listitem",
|
|
6370
|
+
css: [ObjectListItemContainer, disabled ? ObjectListItemContainerDisabled : void 0],
|
|
6371
|
+
"data-testid": "list-item",
|
|
6372
|
+
children: [
|
|
6373
|
+
/* @__PURE__ */ jsxs34(
|
|
6374
|
+
"div",
|
|
6375
|
+
{
|
|
6376
|
+
role: "button",
|
|
6377
|
+
onClick: handleSelectItem,
|
|
6378
|
+
css: ObjectListItemControlledContent,
|
|
6379
|
+
"aria-disabled": disabled,
|
|
6380
|
+
children: [
|
|
6381
|
+
!imageUrl ? null : /* @__PURE__ */ jsx59("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectListItemThumbnail }),
|
|
6382
|
+
!image || imageUrl ? null : /* @__PURE__ */ jsx59("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
|
|
6383
|
+
/* @__PURE__ */ jsxs34("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
|
|
6384
|
+
!contentType ? null : /* @__PURE__ */ jsx59("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
|
|
6385
|
+
/* @__PURE__ */ jsx59("span", { css: ObjectListItemTitle, "data-testid": "title", children: title })
|
|
6386
|
+
] })
|
|
6387
|
+
]
|
|
6388
|
+
}
|
|
6389
|
+
),
|
|
6390
|
+
/* @__PURE__ */ jsxs34("div", { css: ObjectListItemInfoContainer, children: [
|
|
6391
|
+
selected ? /* @__PURE__ */ jsx59(Chip, { text: "selected", size: "xs" }) : null,
|
|
6392
|
+
!popoverData ? null : /* @__PURE__ */ jsx59(Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, iconColor: "default", children: popoverData })
|
|
6393
|
+
] }),
|
|
6394
|
+
!children ? null : /* @__PURE__ */ jsx59("div", { css: ObjectListItemUnControlledContent, children })
|
|
6395
|
+
]
|
|
6396
|
+
}
|
|
6397
|
+
);
|
|
6398
|
+
};
|
|
6399
|
+
var ObjectSearchListItemLoadingSkeleton = () => {
|
|
6400
|
+
return /* @__PURE__ */ jsx59("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
|
|
6401
|
+
};
|
|
6402
|
+
|
|
6403
|
+
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6404
|
+
import { jsx as jsx60, jsxs as jsxs35 } from "@emotion/react/jsx-runtime";
|
|
6258
6405
|
var ObjectSearchContainer = ({
|
|
6259
6406
|
label,
|
|
6260
6407
|
enableDynamicInputToResultId,
|
|
@@ -6266,19 +6413,20 @@ var ObjectSearchContainer = ({
|
|
|
6266
6413
|
const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
|
|
6267
6414
|
const { flatVariables } = useVariables(true);
|
|
6268
6415
|
const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
|
|
6269
|
-
const
|
|
6416
|
+
const listItems = resultList != null ? resultList : /* @__PURE__ */ jsx60(DefaultResultList, {});
|
|
6417
|
+
const body = /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
|
|
6270
6418
|
searchFilters,
|
|
6271
|
-
|
|
6419
|
+
/* @__PURE__ */ jsx60(
|
|
6272
6420
|
ScrollableList,
|
|
6273
6421
|
{
|
|
6274
6422
|
role: "list",
|
|
6275
|
-
css:
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
children:
|
|
6423
|
+
css: css32`
|
|
6424
|
+
> div {
|
|
6425
|
+
transition: max-height var(--duration-slow) var(--timing-ease-out);
|
|
6426
|
+
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
6427
|
+
}
|
|
6428
|
+
`,
|
|
6429
|
+
children: listItems
|
|
6282
6430
|
}
|
|
6283
6431
|
)
|
|
6284
6432
|
] });
|
|
@@ -6309,8 +6457,8 @@ var ObjectSearchContainer = ({
|
|
|
6309
6457
|
}
|
|
6310
6458
|
]);
|
|
6311
6459
|
};
|
|
6312
|
-
return /* @__PURE__ */
|
|
6313
|
-
/* @__PURE__ */
|
|
6460
|
+
return /* @__PURE__ */ jsx60(IconsProvider, { children: /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
|
|
6461
|
+
/* @__PURE__ */ jsx60(Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ jsx60(
|
|
6314
6462
|
InputVariables,
|
|
6315
6463
|
{
|
|
6316
6464
|
label,
|
|
@@ -6328,14 +6476,25 @@ var ObjectSearchContainer = ({
|
|
|
6328
6476
|
children
|
|
6329
6477
|
] }) });
|
|
6330
6478
|
};
|
|
6479
|
+
var DefaultResultList = () => {
|
|
6480
|
+
var _a;
|
|
6481
|
+
const { list } = useObjectSearchContext();
|
|
6482
|
+
if (!list.items) {
|
|
6483
|
+
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ jsx60(ObjectSearchListItemLoadingSkeleton, {}, i));
|
|
6484
|
+
}
|
|
6485
|
+
if (list.items.length === 0) {
|
|
6486
|
+
return /* @__PURE__ */ jsx60(Callout5, { type: "info", children: "No results were found" });
|
|
6487
|
+
}
|
|
6488
|
+
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ jsx60(ObjectSearchListItem, { ...item }, item.id));
|
|
6489
|
+
};
|
|
6331
6490
|
|
|
6332
6491
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6333
6492
|
import { InputKeywordSearch as InputKeywordSearch2, InputSelect as InputSelect6 } from "@uniformdev/design-system";
|
|
6334
6493
|
import { useMemo as useMemo15, useState as useState16 } from "react";
|
|
6335
6494
|
|
|
6336
6495
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
6337
|
-
import { css as
|
|
6338
|
-
var ObjectSearchFilterContainerLabel =
|
|
6496
|
+
import { css as css33 } from "@emotion/react";
|
|
6497
|
+
var ObjectSearchFilterContainerLabel = css33`
|
|
6339
6498
|
align-items: center;
|
|
6340
6499
|
display: flex;
|
|
6341
6500
|
font-size: var(--fs-sm);
|
|
@@ -6343,18 +6502,18 @@ var ObjectSearchFilterContainerLabel = css32`
|
|
|
6343
6502
|
line-height: 1rem;
|
|
6344
6503
|
margin-bottom: var(--spacing-sm);
|
|
6345
6504
|
`;
|
|
6346
|
-
var ObjectSearchFilterContainer =
|
|
6505
|
+
var ObjectSearchFilterContainer = css33`
|
|
6347
6506
|
display: grid;
|
|
6348
6507
|
gap: var(--spacing-base);
|
|
6349
6508
|
`;
|
|
6350
|
-
var ObjectSearchFilterGrid = (gridColumns) =>
|
|
6509
|
+
var ObjectSearchFilterGrid = (gridColumns) => css33`
|
|
6351
6510
|
display: grid;
|
|
6352
6511
|
grid-template-columns: ${gridColumns};
|
|
6353
6512
|
gap: var(--spacing-base);
|
|
6354
6513
|
`;
|
|
6355
6514
|
|
|
6356
6515
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6357
|
-
import { jsx as
|
|
6516
|
+
import { jsx as jsx61, jsxs as jsxs36 } from "@emotion/react/jsx-runtime";
|
|
6358
6517
|
var ObjectSearchFilter = ({
|
|
6359
6518
|
requireContentType,
|
|
6360
6519
|
typeSelectorAllTypesOptionText = "All content types",
|
|
@@ -6387,7 +6546,7 @@ var ObjectSearchFilter = ({
|
|
|
6387
6546
|
];
|
|
6388
6547
|
}, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
|
|
6389
6548
|
const shouldRenderSelect = memoizedSelectOptions.length > 0;
|
|
6390
|
-
return /* @__PURE__ */
|
|
6549
|
+
return /* @__PURE__ */ jsxs36(
|
|
6391
6550
|
"fieldset",
|
|
6392
6551
|
{
|
|
6393
6552
|
css: [
|
|
@@ -6395,7 +6554,7 @@ var ObjectSearchFilter = ({
|
|
|
6395
6554
|
ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
|
|
6396
6555
|
],
|
|
6397
6556
|
children: [
|
|
6398
|
-
memoizedSelectOptions.length ? /* @__PURE__ */
|
|
6557
|
+
memoizedSelectOptions.length ? /* @__PURE__ */ jsx61(
|
|
6399
6558
|
InputSelect6,
|
|
6400
6559
|
{
|
|
6401
6560
|
label: selectLabel,
|
|
@@ -6405,7 +6564,7 @@ var ObjectSearchFilter = ({
|
|
|
6405
6564
|
value: query.contentType
|
|
6406
6565
|
}
|
|
6407
6566
|
) : null,
|
|
6408
|
-
/* @__PURE__ */
|
|
6567
|
+
/* @__PURE__ */ jsx61(
|
|
6409
6568
|
InputKeywordSearch2,
|
|
6410
6569
|
{
|
|
6411
6570
|
inputFieldName: searchInputName,
|
|
@@ -6422,154 +6581,14 @@ var ObjectSearchFilter = ({
|
|
|
6422
6581
|
};
|
|
6423
6582
|
|
|
6424
6583
|
// src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
|
|
6425
|
-
import { jsx as
|
|
6584
|
+
import { jsx as jsx62, jsxs as jsxs37 } from "@emotion/react/jsx-runtime";
|
|
6426
6585
|
var ObjectSearchFilterContainer2 = ({ label, children }) => {
|
|
6427
|
-
return /* @__PURE__ */
|
|
6428
|
-
label ? /* @__PURE__ */
|
|
6429
|
-
/* @__PURE__ */
|
|
6586
|
+
return /* @__PURE__ */ jsxs37("div", { children: [
|
|
6587
|
+
label ? /* @__PURE__ */ jsx62("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
|
|
6588
|
+
/* @__PURE__ */ jsx62("div", { css: ObjectSearchFilterContainer, children })
|
|
6430
6589
|
] });
|
|
6431
6590
|
};
|
|
6432
6591
|
|
|
6433
|
-
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
6434
|
-
import { Chip, Popover } from "@uniformdev/design-system";
|
|
6435
|
-
|
|
6436
|
-
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
6437
|
-
import { css as css33 } from "@emotion/react";
|
|
6438
|
-
import { skeletonLoading } from "@uniformdev/design-system";
|
|
6439
|
-
var ObjectListItemContainer = css33`
|
|
6440
|
-
align-items: center;
|
|
6441
|
-
border: 1px solid var(--gray-300);
|
|
6442
|
-
border-radius: var(--rounded-base);
|
|
6443
|
-
background: var(--white);
|
|
6444
|
-
display: grid;
|
|
6445
|
-
grid-template-columns: 1fr auto;
|
|
6446
|
-
padding: var(--spacing-sm);
|
|
6447
|
-
`;
|
|
6448
|
-
var ObjectListItemContainerDisabled = css33`
|
|
6449
|
-
opacity: var(--opacity-50);
|
|
6450
|
-
pointer-events: none;
|
|
6451
|
-
`;
|
|
6452
|
-
var ObjectListItemLoading = css33`
|
|
6453
|
-
animation: ${skeletonLoading} 1s linear infinite alternate;
|
|
6454
|
-
border-color: transparent;
|
|
6455
|
-
min-height: 42px;
|
|
6456
|
-
position: relative;
|
|
6457
|
-
|
|
6458
|
-
&:before,
|
|
6459
|
-
&:after {
|
|
6460
|
-
background: var(--gray-200);
|
|
6461
|
-
content: '';
|
|
6462
|
-
display: block;
|
|
6463
|
-
height: 1rem;
|
|
6464
|
-
}
|
|
6465
|
-
|
|
6466
|
-
&:before {
|
|
6467
|
-
border-radius: var(--rounded-base);
|
|
6468
|
-
width: 10rem;
|
|
6469
|
-
}
|
|
6470
|
-
|
|
6471
|
-
&:after {
|
|
6472
|
-
border-radius: var(--rounded-full);
|
|
6473
|
-
width: 1rem;
|
|
6474
|
-
}
|
|
6475
|
-
`;
|
|
6476
|
-
var ObjectListItemHeadingGroup = css33`
|
|
6477
|
-
align-items: center;
|
|
6478
|
-
display: grid;
|
|
6479
|
-
`;
|
|
6480
|
-
var ObjectListItemThumbnail = css33`
|
|
6481
|
-
width: 30px;
|
|
6482
|
-
object-fit: contain;
|
|
6483
|
-
`;
|
|
6484
|
-
var ObjectListItemTitle = css33`
|
|
6485
|
-
color: var(--brand-secondary-1);
|
|
6486
|
-
display: block;
|
|
6487
|
-
font-size: var(--fs-sm);
|
|
6488
|
-
`;
|
|
6489
|
-
var ObjectListItemSubtitle = css33`
|
|
6490
|
-
color: var(--gray-500);
|
|
6491
|
-
display: block;
|
|
6492
|
-
font-size: var(--fs-xs);
|
|
6493
|
-
line-height: 1;
|
|
6494
|
-
`;
|
|
6495
|
-
var ObjectListItemInfoContainer = css33`
|
|
6496
|
-
align-items: center;
|
|
6497
|
-
display: flex;
|
|
6498
|
-
gap: var(--spacing-sm);
|
|
6499
|
-
justify-content: center;
|
|
6500
|
-
`;
|
|
6501
|
-
var ObjectListItemControlledContent = css33`
|
|
6502
|
-
display: flex;
|
|
6503
|
-
gap: var(--spacing-sm);
|
|
6504
|
-
`;
|
|
6505
|
-
var ObjectListItemUnControlledContent = css33`
|
|
6506
|
-
margin-top: var(--spacing-sm);
|
|
6507
|
-
grid-column: 1 / -1;
|
|
6508
|
-
`;
|
|
6509
|
-
|
|
6510
|
-
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
6511
|
-
import { jsx as jsx62, jsxs as jsxs37 } from "@emotion/react/jsx-runtime";
|
|
6512
|
-
var ObjectSearchListItem = ({
|
|
6513
|
-
id,
|
|
6514
|
-
title,
|
|
6515
|
-
contentType,
|
|
6516
|
-
image,
|
|
6517
|
-
imageUrl,
|
|
6518
|
-
popoverData,
|
|
6519
|
-
onSelect,
|
|
6520
|
-
isMulti = false,
|
|
6521
|
-
disabled,
|
|
6522
|
-
children
|
|
6523
|
-
}) => {
|
|
6524
|
-
const { onSelectItem, selectedListItems } = useObjectSearchContext();
|
|
6525
|
-
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
6526
|
-
const handleSelectItem = () => {
|
|
6527
|
-
var _a;
|
|
6528
|
-
const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
|
|
6529
|
-
const selectedItem = { id, title, contentType, imageUrl, image, popoverData, ...extraData };
|
|
6530
|
-
if (isMulti) {
|
|
6531
|
-
return onSelectItem(selectedItem);
|
|
6532
|
-
}
|
|
6533
|
-
return onSelectItem([selectedItem]);
|
|
6534
|
-
};
|
|
6535
|
-
const selected = selectedListItems.some((item) => item.id === id);
|
|
6536
|
-
return /* @__PURE__ */ jsxs37(
|
|
6537
|
-
"div",
|
|
6538
|
-
{
|
|
6539
|
-
role: "listitem",
|
|
6540
|
-
css: [ObjectListItemContainer, disabled ? ObjectListItemContainerDisabled : void 0],
|
|
6541
|
-
"data-testid": "list-item",
|
|
6542
|
-
children: [
|
|
6543
|
-
/* @__PURE__ */ jsxs37(
|
|
6544
|
-
"div",
|
|
6545
|
-
{
|
|
6546
|
-
role: "button",
|
|
6547
|
-
onClick: handleSelectItem,
|
|
6548
|
-
css: ObjectListItemControlledContent,
|
|
6549
|
-
"aria-disabled": disabled,
|
|
6550
|
-
children: [
|
|
6551
|
-
!imageUrl ? null : /* @__PURE__ */ jsx62("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectListItemThumbnail }),
|
|
6552
|
-
!image || imageUrl ? null : /* @__PURE__ */ jsx62("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
|
|
6553
|
-
/* @__PURE__ */ jsxs37("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
|
|
6554
|
-
!contentType ? null : /* @__PURE__ */ jsx62("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
|
|
6555
|
-
/* @__PURE__ */ jsx62("span", { css: ObjectListItemTitle, "data-testid": "title", children: title })
|
|
6556
|
-
] })
|
|
6557
|
-
]
|
|
6558
|
-
}
|
|
6559
|
-
),
|
|
6560
|
-
/* @__PURE__ */ jsxs37("div", { css: ObjectListItemInfoContainer, children: [
|
|
6561
|
-
selected ? /* @__PURE__ */ jsx62(Chip, { text: "selected", size: "xs" }) : null,
|
|
6562
|
-
!popoverData ? null : /* @__PURE__ */ jsx62(Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, iconColor: "default", children: popoverData })
|
|
6563
|
-
] }),
|
|
6564
|
-
!children ? null : /* @__PURE__ */ jsx62("div", { css: ObjectListItemUnControlledContent, children })
|
|
6565
|
-
]
|
|
6566
|
-
}
|
|
6567
|
-
);
|
|
6568
|
-
};
|
|
6569
|
-
var ObjectSearchListItemLoadingSkeleton = () => {
|
|
6570
|
-
return /* @__PURE__ */ jsx62("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
|
|
6571
|
-
};
|
|
6572
|
-
|
|
6573
6592
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
6574
6593
|
import { Badge, Button as Button4, Popover as Popover2 } from "@uniformdev/design-system";
|
|
6575
6594
|
import { format as timeagoFormat } from "timeago.js";
|
|
@@ -7113,7 +7132,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
7113
7132
|
import {
|
|
7114
7133
|
AddListButton as AddListButton2,
|
|
7115
7134
|
Button as Button6,
|
|
7116
|
-
Callout as
|
|
7135
|
+
Callout as Callout6,
|
|
7117
7136
|
DrawerContent,
|
|
7118
7137
|
Heading,
|
|
7119
7138
|
Input as Input6,
|
|
@@ -7152,7 +7171,7 @@ export {
|
|
|
7152
7171
|
$isVariableNode,
|
|
7153
7172
|
AddListButton2 as AddListButton,
|
|
7154
7173
|
Button6 as Button,
|
|
7155
|
-
|
|
7174
|
+
Callout6 as Callout,
|
|
7156
7175
|
ControlledValuePlugin,
|
|
7157
7176
|
DISCONNECT_VARIABLE_COMMAND,
|
|
7158
7177
|
DamSelectedItem,
|