@uniformdev/context-ui 20.6.2-alpha.11 → 20.7.1-alpha.4
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 +11 -23
- package/dist/index.d.ts +11 -23
- package/dist/index.esm.js +115 -223
- package/dist/index.js +140 -240
- package/dist/index.mjs +115 -223
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -289,39 +289,23 @@ var contextCriteriaMenuOperators = [
|
|
|
289
289
|
{
|
|
290
290
|
name: "has the weakest score",
|
|
291
291
|
value: "-"
|
|
292
|
-
}
|
|
293
|
-
];
|
|
294
|
-
var enrichmentCriteriaMenuOperators = [
|
|
295
|
-
...contextCriteriaMenuOperators,
|
|
292
|
+
},
|
|
296
293
|
{
|
|
297
294
|
name: "has strongest category score",
|
|
298
295
|
value: "^"
|
|
299
296
|
}
|
|
300
297
|
];
|
|
301
|
-
|
|
302
|
-
{
|
|
303
|
-
name: "=",
|
|
304
|
-
description: "equals",
|
|
305
|
-
value: "="
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
name: "\u2260",
|
|
309
|
-
description: "not equal",
|
|
310
|
-
value: "!="
|
|
311
|
-
}
|
|
312
|
-
];
|
|
313
|
-
function CriteriaOperatorMenu({ onChange, value, rhsType, ...props }) {
|
|
298
|
+
function CriteriaOperatorMenu({ onChange, value, ...props }) {
|
|
314
299
|
var _a, _b;
|
|
315
|
-
const operators = rhsType === "QUIRK" ? quirkCriteriaMenuOperators : rhsType === "ENR" ? enrichmentCriteriaMenuOperators : contextCriteriaMenuOperators;
|
|
316
300
|
return /* @__PURE__ */ jsx6(
|
|
317
301
|
InputComboBox,
|
|
318
302
|
{
|
|
319
303
|
...props,
|
|
320
304
|
value: {
|
|
321
|
-
label: (_b = (_a =
|
|
305
|
+
label: (_b = (_a = contextCriteriaMenuOperators.find((e) => e.value === value)) == null ? void 0 : _a.name) != null ? _b : value,
|
|
322
306
|
value
|
|
323
307
|
},
|
|
324
|
-
options:
|
|
308
|
+
options: contextCriteriaMenuOperators.map((option) => ({
|
|
325
309
|
label: option.description ? `${option.name}:${option.description}` : option.name,
|
|
326
310
|
value: option.value
|
|
327
311
|
})),
|
|
@@ -559,23 +543,18 @@ import { useState as useState5 } from "react";
|
|
|
559
543
|
import { Icon } from "@uniformdev/design-system";
|
|
560
544
|
|
|
561
545
|
// src/components/DimensionMenu/utils.ts
|
|
562
|
-
import { useMemo } from "react";
|
|
563
546
|
function dimensionToMenuOption(dimension) {
|
|
564
|
-
if ("dim" in dimension) {
|
|
565
|
-
return {
|
|
566
|
-
label: dimension.displayName,
|
|
567
|
-
value: dimension.dim,
|
|
568
|
-
original: dimension
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
const quirk = dimension;
|
|
572
547
|
return {
|
|
573
|
-
label:
|
|
574
|
-
value:
|
|
575
|
-
|
|
548
|
+
label: dimension.displayName,
|
|
549
|
+
value: dimension.dim,
|
|
550
|
+
isDisabled: false
|
|
576
551
|
};
|
|
577
552
|
}
|
|
578
|
-
function dimensionIcon(
|
|
553
|
+
function dimensionIcon(displayName) {
|
|
554
|
+
if (!displayName) {
|
|
555
|
+
return "unavailable";
|
|
556
|
+
}
|
|
557
|
+
const [type] = displayName.split(":");
|
|
579
558
|
switch (type.toLowerCase()) {
|
|
580
559
|
case "signal":
|
|
581
560
|
return "data";
|
|
@@ -587,42 +566,25 @@ function dimensionIcon(type) {
|
|
|
587
566
|
return "user-list";
|
|
588
567
|
}
|
|
589
568
|
}
|
|
590
|
-
function
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
lastType = type != null ? type : "";
|
|
599
|
-
}
|
|
600
|
-
result[result.length - 1].options.push(dimensionToMenuOption(dim));
|
|
601
|
-
}
|
|
602
|
-
if (quirks == null ? void 0 : quirks.length) {
|
|
603
|
-
result.push({
|
|
604
|
-
label: "Quirks",
|
|
605
|
-
options: quirks.map(dimensionToMenuOption)
|
|
606
|
-
});
|
|
569
|
+
function groupDimensions(dimensions) {
|
|
570
|
+
const result = [];
|
|
571
|
+
let lastType = "";
|
|
572
|
+
for (const dim of dimensions) {
|
|
573
|
+
const [type] = dim.displayName.split(":");
|
|
574
|
+
if (lastType !== type) {
|
|
575
|
+
result.push({ label: type, options: [] });
|
|
576
|
+
lastType = type;
|
|
607
577
|
}
|
|
608
|
-
|
|
609
|
-
}, [dimensions, quirks]);
|
|
610
|
-
}
|
|
611
|
-
function dimensionDisplayName(displayName) {
|
|
612
|
-
if (!displayName) {
|
|
613
|
-
return {};
|
|
578
|
+
result[result.length - 1].options.push(dimensionToMenuOption(dim));
|
|
614
579
|
}
|
|
615
|
-
|
|
616
|
-
const type = colonIndex >= 0 ? displayName.substring(0, colonIndex) : void 0;
|
|
617
|
-
const name = colonIndex >= 0 ? displayName.substring(colonIndex + 1) : displayName;
|
|
618
|
-
return { type, name };
|
|
580
|
+
return result;
|
|
619
581
|
}
|
|
620
582
|
|
|
621
583
|
// src/components/DimensionMenu/DimensionGroupHeading.tsx
|
|
622
584
|
import { jsx as jsx8, jsxs as jsxs3 } from "@emotion/react/jsx-runtime";
|
|
623
585
|
var DimensionGroupHeading = (props) => {
|
|
586
|
+
var _a;
|
|
624
587
|
const { data, getStyles, className } = props;
|
|
625
|
-
const { type } = dimensionDisplayName(data.label);
|
|
626
588
|
return /* @__PURE__ */ jsx8(
|
|
627
589
|
"div",
|
|
628
590
|
{
|
|
@@ -637,7 +599,7 @@ var DimensionGroupHeading = (props) => {
|
|
|
637
599
|
{
|
|
638
600
|
css: { color: "var(--gray-500)", display: "flex", alignItems: "center", gap: "var(--spacing-xs)" },
|
|
639
601
|
children: [
|
|
640
|
-
|
|
602
|
+
/* @__PURE__ */ jsx8(Icon, { icon: dimensionIcon((_a = data.label) != null ? _a : ""), iconColor: "currentColor", size: 16 }),
|
|
641
603
|
/* @__PURE__ */ jsx8("span", { children: data.label })
|
|
642
604
|
]
|
|
643
605
|
}
|
|
@@ -668,8 +630,9 @@ function DimensionMenuErrorMessage({ message }) {
|
|
|
668
630
|
// src/components/DimensionMenu/DimensionOption.tsx
|
|
669
631
|
import { jsx as jsx10 } from "@emotion/react/jsx-runtime";
|
|
670
632
|
var DimensionOption = (props) => {
|
|
633
|
+
var _a, _b;
|
|
671
634
|
const { data, getStyles, cx, isDisabled, isFocused, isSelected, className, innerRef, innerProps } = props;
|
|
672
|
-
const
|
|
635
|
+
const [, value] = (_b = (_a = data.label) == null ? void 0 : _a.split(":")) != null ? _b : [];
|
|
673
636
|
return /* @__PURE__ */ jsx10(
|
|
674
637
|
"div",
|
|
675
638
|
{
|
|
@@ -686,7 +649,7 @@ var DimensionOption = (props) => {
|
|
|
686
649
|
ref: innerRef,
|
|
687
650
|
"aria-disabled": isDisabled,
|
|
688
651
|
...innerProps,
|
|
689
|
-
children: /* @__PURE__ */ jsx10("div", { css: { color: "var(--gray-700)" }, children:
|
|
652
|
+
children: /* @__PURE__ */ jsx10("div", { css: { color: "var(--gray-700)" }, children: value != null ? value : data.label })
|
|
690
653
|
}
|
|
691
654
|
);
|
|
692
655
|
};
|
|
@@ -695,7 +658,7 @@ var DimensionOption = (props) => {
|
|
|
695
658
|
import { Icon as Icon2 } from "@uniformdev/design-system";
|
|
696
659
|
import { jsx as jsx11, jsxs as jsxs4 } from "@emotion/react/jsx-runtime";
|
|
697
660
|
function DimensionValue({ displayName }) {
|
|
698
|
-
const
|
|
661
|
+
const [type, name] = displayName.split(":");
|
|
699
662
|
return /* @__PURE__ */ jsxs4(
|
|
700
663
|
"div",
|
|
701
664
|
{
|
|
@@ -704,7 +667,7 @@ function DimensionValue({ displayName }) {
|
|
|
704
667
|
overflow: "hidden"
|
|
705
668
|
},
|
|
706
669
|
children: [
|
|
707
|
-
|
|
670
|
+
name ? /* @__PURE__ */ jsxs4(
|
|
708
671
|
"small",
|
|
709
672
|
{
|
|
710
673
|
css: { color: "var(--gray-500)", display: "flex", alignItems: "center", gap: "var(--spacing-xs)" },
|
|
@@ -742,7 +705,6 @@ function CriteriaMatchMenu({
|
|
|
742
705
|
);
|
|
743
706
|
const rDim = criteriaMatch.rDim;
|
|
744
707
|
const targetDim = criteriaMatch.rDim ? dimensions.dimIndex[criteriaMatch.rDim] : void 0;
|
|
745
|
-
const groupedDimensions = useGroupedDimensions(dimensions.dimensions, void 0);
|
|
746
708
|
return /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
747
709
|
/* @__PURE__ */ jsx13(
|
|
748
710
|
InputComboBox3,
|
|
@@ -761,7 +723,7 @@ function CriteriaMatchMenu({
|
|
|
761
723
|
value: "",
|
|
762
724
|
isDisabled: true
|
|
763
725
|
},
|
|
764
|
-
...
|
|
726
|
+
...groupDimensions(dimensions.dimensions)
|
|
765
727
|
],
|
|
766
728
|
styles: {
|
|
767
729
|
...props.styles,
|
|
@@ -840,23 +802,14 @@ function isInt(value) {
|
|
|
840
802
|
// src/components/DimensionMenu/DimensionMenu.tsx
|
|
841
803
|
import { InputComboBox as InputComboBox4 } from "@uniformdev/design-system";
|
|
842
804
|
import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs6 } from "@emotion/react/jsx-runtime";
|
|
843
|
-
function DimensionMenu({
|
|
844
|
-
onChange,
|
|
845
|
-
value,
|
|
846
|
-
dimensions,
|
|
847
|
-
errorMessage,
|
|
848
|
-
quirks,
|
|
849
|
-
...props
|
|
850
|
-
}) {
|
|
851
|
-
const groupedDimensions = useGroupedDimensions(dimensions, quirks);
|
|
852
|
-
const valueAsMenuOption = value ? dimensionToMenuOption(value) : void 0;
|
|
805
|
+
function DimensionMenu({ onChange, value, dimensions, errorMessage, ...props }) {
|
|
853
806
|
return /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
854
807
|
/* @__PURE__ */ jsx14(
|
|
855
808
|
InputComboBox4,
|
|
856
809
|
{
|
|
857
810
|
...props,
|
|
858
|
-
value:
|
|
859
|
-
options:
|
|
811
|
+
value: value ? dimensionToMenuOption(value) : void 0,
|
|
812
|
+
options: groupDimensions(dimensions),
|
|
860
813
|
styles: {
|
|
861
814
|
...props.styles,
|
|
862
815
|
valueContainer: (provided, state) => {
|
|
@@ -869,10 +822,8 @@ function DimensionMenu({
|
|
|
869
822
|
}
|
|
870
823
|
},
|
|
871
824
|
onChange: (e) => {
|
|
872
|
-
if (e
|
|
873
|
-
onChange(e.
|
|
874
|
-
} else {
|
|
875
|
-
onChange(void 0);
|
|
825
|
+
if (e) {
|
|
826
|
+
onChange(dimensions.find((d) => d.dim === e.value));
|
|
876
827
|
}
|
|
877
828
|
},
|
|
878
829
|
components: {
|
|
@@ -941,7 +892,7 @@ import {
|
|
|
941
892
|
LoadingIndicator as LoadingIndicator3
|
|
942
893
|
} from "@uniformdev/design-system";
|
|
943
894
|
import { produce } from "immer";
|
|
944
|
-
import { useMemo
|
|
895
|
+
import { useMemo, useState as useState6 } from "react";
|
|
945
896
|
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs8 } from "@emotion/react/jsx-runtime";
|
|
946
897
|
var addEnrichmentLink = css5`
|
|
947
898
|
flex: 2;
|
|
@@ -962,10 +913,10 @@ var EnrichmentTag = ({
|
|
|
962
913
|
displayTitle = true
|
|
963
914
|
}) => {
|
|
964
915
|
const { loading, result: dimensions, error } = useDimensions(contextConfig);
|
|
965
|
-
const allEnrichments =
|
|
916
|
+
const allEnrichments = useMemo(() => {
|
|
966
917
|
if (dimensions) return dimensions.dimensions.filter((dimension) => dimension.category === "ENR");
|
|
967
918
|
}, [dimensions]);
|
|
968
|
-
const remainingEnrichments =
|
|
919
|
+
const remainingEnrichments = useMemo(() => {
|
|
969
920
|
if (!value) return allEnrichments;
|
|
970
921
|
if (allEnrichments)
|
|
971
922
|
return allEnrichments.filter(
|
|
@@ -1311,16 +1262,7 @@ function opHasRhs(op) {
|
|
|
1311
1262
|
// src/components/PersonalizationCriteria/PersonalizationCriteriaStatic.tsx
|
|
1312
1263
|
import { css as css7 } from "@emotion/react";
|
|
1313
1264
|
import { CgCloseO as CgCloseO2 } from "@react-icons/all-files/cg/CgCloseO";
|
|
1314
|
-
import {
|
|
1315
|
-
AddListButton as AddListButton3,
|
|
1316
|
-
Callout as Callout3,
|
|
1317
|
-
Heading as Heading2,
|
|
1318
|
-
Icon as Icon5,
|
|
1319
|
-
Input as Input2,
|
|
1320
|
-
InputInlineSelect,
|
|
1321
|
-
InputSelect as InputSelect2,
|
|
1322
|
-
Paragraph
|
|
1323
|
-
} from "@uniformdev/design-system";
|
|
1265
|
+
import { AddListButton as AddListButton3, Callout as Callout3, Icon as Icon5, InputInlineSelect, Paragraph } from "@uniformdev/design-system";
|
|
1324
1266
|
import { produce as produce2 } from "immer";
|
|
1325
1267
|
|
|
1326
1268
|
// src/components/PersonalizationCriteria/PersonalizationCriteriaStatic.styles.ts
|
|
@@ -1356,8 +1298,7 @@ var criteriaItem = css6`
|
|
|
1356
1298
|
`;
|
|
1357
1299
|
var criteriaItemInner = css6`
|
|
1358
1300
|
display: flex;
|
|
1359
|
-
|
|
1360
|
-
column-gap: var(--spacing-xs);
|
|
1301
|
+
gap: var(--spacing-base);
|
|
1361
1302
|
flex-grow: 1;
|
|
1362
1303
|
flex-wrap: wrap;
|
|
1363
1304
|
margin-right: var(--spacing-base);
|
|
@@ -1375,7 +1316,6 @@ var criteriaOperandWrapper = css6`
|
|
|
1375
1316
|
`;
|
|
1376
1317
|
var criteriaOperatorWrapper = css6`
|
|
1377
1318
|
flex: 1;
|
|
1378
|
-
flex-wrap: nowrap;
|
|
1379
1319
|
min-width: 80px;
|
|
1380
1320
|
`;
|
|
1381
1321
|
var expand = css6`
|
|
@@ -1389,7 +1329,6 @@ var PersonalizationCriteriaStatic = ({
|
|
|
1389
1329
|
value,
|
|
1390
1330
|
setValue,
|
|
1391
1331
|
dimensions,
|
|
1392
|
-
quirks,
|
|
1393
1332
|
onMenuOpen,
|
|
1394
1333
|
onMenuClose,
|
|
1395
1334
|
onAddCriteria,
|
|
@@ -1439,146 +1378,100 @@ var PersonalizationCriteriaStatic = ({
|
|
|
1439
1378
|
fontSize: "var(--fs-md)",
|
|
1440
1379
|
fontWeight: "var(--fw-bold)"
|
|
1441
1380
|
},
|
|
1442
|
-
children:
|
|
1381
|
+
children: "Personalize This"
|
|
1443
1382
|
}
|
|
1444
1383
|
) : null,
|
|
1445
1384
|
(components == null ? void 0 : components.CustomVariantName) ? /* @__PURE__ */ jsx17(components.CustomVariantName, {}) : null,
|
|
1446
1385
|
(components == null ? void 0 : components.ControlPercentage) ? /* @__PURE__ */ jsx17(components.ControlPercentage, {}) : null,
|
|
1447
1386
|
!currentValue.crit.length ? /* @__PURE__ */ jsx17(Callout3, { title: "Default variant", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ jsx17(Paragraph, { children: 'This personalized variant has no match criteria and will be shown to any visitor that does not match any preceding variants. Ensure that default variants come last in the variant list. Personalize this variant by clicking "Add Criteria" to get started.' }) }) : /* @__PURE__ */ jsx17("div", { children: currentValue.crit.map((currentCriteria, index) => {
|
|
1448
|
-
var _a2, _b, _c, _d
|
|
1387
|
+
var _a2, _b, _c, _d;
|
|
1449
1388
|
const critHasLhs = ((_a2 = currentCriteria.l) == null ? void 0 : _a2.length) > 0;
|
|
1450
1389
|
const critHasRhs = opHasRhs(currentCriteria.op);
|
|
1451
|
-
const currentDimension = dimensions.dimIndex[currentCriteria.l];
|
|
1452
|
-
const currentQuirk = quirks == null ? void 0 : quirks.find((q) => q.id === currentCriteria.l);
|
|
1453
1390
|
return /* @__PURE__ */ jsxs9("div", { css: criteriaItem, "data-testid": "criteria-container", children: [
|
|
1454
|
-
/* @__PURE__ */ jsxs9(
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1391
|
+
/* @__PURE__ */ jsxs9(
|
|
1392
|
+
"div",
|
|
1393
|
+
{
|
|
1394
|
+
css: css7`
|
|
1395
|
+
${criteriaItemInner}/* grid-template-columns: minmax(0, 1fr) ${critHasRhs ? "minmax(0, 79px) minmax(0, 1fr)" : "minmax(0, 1fr)"} */
|
|
1396
|
+
`,
|
|
1397
|
+
className: "criteriaItemInner",
|
|
1398
|
+
children: [
|
|
1399
|
+
/* @__PURE__ */ jsx17(
|
|
1400
|
+
"div",
|
|
1463
1401
|
{
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
...currentCriteria,
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
};
|
|
1481
|
-
update(newCriteria, index);
|
|
1482
|
-
} else {
|
|
1483
|
-
update({ ...currentCriteria, l: selection.id, t: "q", op: "=", r: "" }, index);
|
|
1402
|
+
css: [criteriaWrapper, criteriaOperandWrapper],
|
|
1403
|
+
className: "criteria-wrapper",
|
|
1404
|
+
"data-testid": "select-criteria",
|
|
1405
|
+
children: /* @__PURE__ */ jsx17(
|
|
1406
|
+
DimensionMenu,
|
|
1407
|
+
{
|
|
1408
|
+
errorMessage: (_b = errors.lhs) == null ? void 0 : _b[index],
|
|
1409
|
+
css: expand,
|
|
1410
|
+
styles: { control: (base) => ({ ...base, height: "100%" }) },
|
|
1411
|
+
dimensions: dimensions.dimensions,
|
|
1412
|
+
onChange: (dim) => {
|
|
1413
|
+
update({ ...currentCriteria, l: dim.dim }, index);
|
|
1414
|
+
},
|
|
1415
|
+
value: dimensions.dimIndex[currentCriteria.l],
|
|
1416
|
+
onMenuOpen,
|
|
1417
|
+
onMenuClose
|
|
1484
1418
|
}
|
|
1485
|
-
|
|
1486
|
-
value: currentDimension != null ? currentDimension : currentQuirk,
|
|
1487
|
-
onMenuOpen,
|
|
1488
|
-
onMenuClose
|
|
1419
|
+
)
|
|
1489
1420
|
}
|
|
1490
|
-
)
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
/* @__PURE__ */ jsx17(
|
|
1494
|
-
"div",
|
|
1495
|
-
{
|
|
1496
|
-
css: [criteriaWrapper, criteriaOperatorWrapper],
|
|
1497
|
-
className: "criteria-wrapper",
|
|
1498
|
-
"data-testid": "select-operator",
|
|
1499
|
-
children: /* @__PURE__ */ jsx17(
|
|
1500
|
-
CriteriaOperatorMenu,
|
|
1421
|
+
),
|
|
1422
|
+
/* @__PURE__ */ jsx17(
|
|
1423
|
+
"div",
|
|
1501
1424
|
{
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1425
|
+
css: [criteriaWrapper, criteriaOperatorWrapper],
|
|
1426
|
+
className: "criteria-wrapper",
|
|
1427
|
+
"data-testid": "select-operator",
|
|
1428
|
+
children: /* @__PURE__ */ jsx17(
|
|
1429
|
+
CriteriaOperatorMenu,
|
|
1430
|
+
{
|
|
1431
|
+
name: `op-${index}`,
|
|
1432
|
+
css: expand,
|
|
1433
|
+
styles: { control: (base) => ({ ...base, height: "100%" }) },
|
|
1434
|
+
value: currentCriteria.op,
|
|
1435
|
+
onChange: (op) => {
|
|
1436
|
+
if (op === "+" || op === "-") {
|
|
1437
|
+
update({ ...currentCriteria, op, r: void 0, rDim: void 0 }, index);
|
|
1438
|
+
} else {
|
|
1439
|
+
update({ ...currentCriteria, op }, index);
|
|
1440
|
+
}
|
|
1441
|
+
},
|
|
1442
|
+
onMenuOpen,
|
|
1443
|
+
onMenuClose
|
|
1512
1444
|
}
|
|
1513
|
-
|
|
1514
|
-
onMenuOpen,
|
|
1515
|
-
onMenuClose
|
|
1445
|
+
)
|
|
1516
1446
|
}
|
|
1517
|
-
)
|
|
1518
|
-
|
|
1519
|
-
),
|
|
1520
|
-
critHasRhs ? /* @__PURE__ */ jsx17(
|
|
1521
|
-
"div",
|
|
1522
|
-
{
|
|
1523
|
-
css: [criteriaWrapper, criteriaOperandWrapper],
|
|
1524
|
-
className: "criteria-wrapper",
|
|
1525
|
-
"data-testid": "select-match-criteria",
|
|
1526
|
-
children: currentQuirk ? /* @__PURE__ */ jsx17(
|
|
1447
|
+
),
|
|
1448
|
+
critHasRhs ? /* @__PURE__ */ jsx17(
|
|
1527
1449
|
"div",
|
|
1528
1450
|
{
|
|
1529
|
-
css:
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
width: 100%;
|
|
1535
|
-
}
|
|
1536
|
-
`,
|
|
1537
|
-
children: currentQuirk.options ? /* @__PURE__ */ jsx17(
|
|
1538
|
-
InputSelect2,
|
|
1539
|
-
{
|
|
1540
|
-
label: "quirk match value",
|
|
1541
|
-
showLabel: false,
|
|
1542
|
-
value: (_c = currentCriteria.r) != null ? _c : "",
|
|
1543
|
-
errorMessage: (_d = errors.rhs) == null ? void 0 : _d[index],
|
|
1544
|
-
onChange: (e) => update({ ...currentCriteria, r: e.currentTarget.value }, index),
|
|
1545
|
-
options: [
|
|
1546
|
-
{ label: "Select\u2026", value: "" },
|
|
1547
|
-
...currentQuirk.options.map((o) => ({ label: o.name, value: o.value }))
|
|
1548
|
-
]
|
|
1549
|
-
}
|
|
1550
|
-
) : /* @__PURE__ */ jsx17(
|
|
1551
|
-
Input2,
|
|
1451
|
+
css: [criteriaWrapper, criteriaOperandWrapper],
|
|
1452
|
+
className: "criteria-wrapper",
|
|
1453
|
+
"data-testid": "select-match-criteria",
|
|
1454
|
+
children: /* @__PURE__ */ jsx17(
|
|
1455
|
+
CriteriaMatchMenu,
|
|
1552
1456
|
{
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1457
|
+
errorMessage: (_c = errors.rhs) == null ? void 0 : _c[index],
|
|
1458
|
+
css: expand,
|
|
1459
|
+
styles: { control: (base) => ({ ...base, height: "100%" }) },
|
|
1460
|
+
criteriaMatch: currentCriteria,
|
|
1461
|
+
onChange: (match) => {
|
|
1462
|
+
update(match, index);
|
|
1463
|
+
},
|
|
1464
|
+
isDisabled: !critHasLhs,
|
|
1465
|
+
dimensions,
|
|
1466
|
+
onMenuOpen,
|
|
1467
|
+
onMenuClose
|
|
1560
1468
|
}
|
|
1561
1469
|
)
|
|
1562
1470
|
}
|
|
1563
|
-
) :
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
css: expand,
|
|
1568
|
-
styles: { control: (base) => ({ ...base, height: "100%" }) },
|
|
1569
|
-
criteriaMatch: currentCriteria,
|
|
1570
|
-
onChange: (match) => {
|
|
1571
|
-
update(match, index);
|
|
1572
|
-
},
|
|
1573
|
-
isDisabled: !critHasLhs,
|
|
1574
|
-
dimensions,
|
|
1575
|
-
onMenuOpen,
|
|
1576
|
-
onMenuClose
|
|
1577
|
-
}
|
|
1578
|
-
)
|
|
1579
|
-
}
|
|
1580
|
-
) : null
|
|
1581
|
-
] }),
|
|
1471
|
+
) : null
|
|
1472
|
+
]
|
|
1473
|
+
}
|
|
1474
|
+
),
|
|
1582
1475
|
/* @__PURE__ */ jsx17(
|
|
1583
1476
|
"button",
|
|
1584
1477
|
{
|
|
@@ -1604,7 +1497,7 @@ var PersonalizationCriteriaStatic = ({
|
|
|
1604
1497
|
{
|
|
1605
1498
|
"data-testid": "dropdown-button-combine",
|
|
1606
1499
|
disabled: index > 1,
|
|
1607
|
-
value: (
|
|
1500
|
+
value: (_d = currentValue.op) != null ? _d : "&",
|
|
1608
1501
|
options: [
|
|
1609
1502
|
{ label: "AND", value: "&" },
|
|
1610
1503
|
{ label: "OR", value: "|" }
|
|
@@ -1836,7 +1729,6 @@ export {
|
|
|
1836
1729
|
addEnrichmentLink,
|
|
1837
1730
|
contextCriteriaMenuOperators,
|
|
1838
1731
|
convertErrorsToObj,
|
|
1839
|
-
enrichmentCriteriaMenuOperators,
|
|
1840
1732
|
isEnrichmentTagData,
|
|
1841
1733
|
isPersonalizationCriteriaData,
|
|
1842
1734
|
opHasRhs,
|