@uniformdev/context-ui 20.3.1-alpha.0 → 20.3.1-alpha.7
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 +23 -11
- package/dist/index.d.ts +23 -11
- package/dist/index.esm.js +216 -114
- package/dist/index.js +234 -139
- package/dist/index.mjs +216 -114
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -289,23 +289,39 @@ var contextCriteriaMenuOperators = [
|
|
|
289
289
|
{
|
|
290
290
|
name: "has the weakest score",
|
|
291
291
|
value: "-"
|
|
292
|
-
}
|
|
292
|
+
}
|
|
293
|
+
];
|
|
294
|
+
var enrichmentCriteriaMenuOperators = [
|
|
295
|
+
...contextCriteriaMenuOperators,
|
|
293
296
|
{
|
|
294
297
|
name: "has strongest category score",
|
|
295
298
|
value: "^"
|
|
296
299
|
}
|
|
297
300
|
];
|
|
298
|
-
|
|
301
|
+
var quirkCriteriaMenuOperators = [
|
|
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 }) {
|
|
299
314
|
var _a, _b;
|
|
315
|
+
const operators = rhsType === "QUIRK" ? quirkCriteriaMenuOperators : rhsType === "ENR" ? enrichmentCriteriaMenuOperators : contextCriteriaMenuOperators;
|
|
300
316
|
return /* @__PURE__ */ jsx6(
|
|
301
317
|
InputComboBox,
|
|
302
318
|
{
|
|
303
319
|
...props,
|
|
304
320
|
value: {
|
|
305
|
-
label: (_b = (_a =
|
|
321
|
+
label: (_b = (_a = operators.find((e) => e.value === value)) == null ? void 0 : _a.name) != null ? _b : value,
|
|
306
322
|
value
|
|
307
323
|
},
|
|
308
|
-
options:
|
|
324
|
+
options: operators.map((option) => ({
|
|
309
325
|
label: option.description ? `${option.name}:${option.description}` : option.name,
|
|
310
326
|
value: option.value
|
|
311
327
|
})),
|
|
@@ -543,18 +559,23 @@ import { useState as useState5 } from "react";
|
|
|
543
559
|
import { Icon } from "@uniformdev/design-system";
|
|
544
560
|
|
|
545
561
|
// src/components/DimensionMenu/utils.ts
|
|
562
|
+
import { useMemo } from "react";
|
|
546
563
|
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;
|
|
547
572
|
return {
|
|
548
|
-
label:
|
|
549
|
-
value:
|
|
550
|
-
|
|
573
|
+
label: `Quirk:${quirk.name}`,
|
|
574
|
+
value: quirk.id,
|
|
575
|
+
original: quirk
|
|
551
576
|
};
|
|
552
577
|
}
|
|
553
|
-
function dimensionIcon(
|
|
554
|
-
if (!displayName) {
|
|
555
|
-
return "unavailable";
|
|
556
|
-
}
|
|
557
|
-
const [type] = displayName.split(":");
|
|
578
|
+
function dimensionIcon(type) {
|
|
558
579
|
switch (type.toLowerCase()) {
|
|
559
580
|
case "signal":
|
|
560
581
|
return "data";
|
|
@@ -566,25 +587,42 @@ function dimensionIcon(displayName) {
|
|
|
566
587
|
return "user-list";
|
|
567
588
|
}
|
|
568
589
|
}
|
|
569
|
-
function
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
590
|
+
function useGroupedDimensions(dimensions, quirks) {
|
|
591
|
+
return useMemo(() => {
|
|
592
|
+
const result = [];
|
|
593
|
+
let lastType = "";
|
|
594
|
+
for (const dim of dimensions) {
|
|
595
|
+
const { type } = dimensionDisplayName(dim.displayName);
|
|
596
|
+
if (lastType !== type) {
|
|
597
|
+
result.push({ label: type != null ? type : "", options: [] });
|
|
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
|
+
});
|
|
577
607
|
}
|
|
578
|
-
result
|
|
608
|
+
return result;
|
|
609
|
+
}, [dimensions, quirks]);
|
|
610
|
+
}
|
|
611
|
+
function dimensionDisplayName(displayName) {
|
|
612
|
+
if (!displayName) {
|
|
613
|
+
return {};
|
|
579
614
|
}
|
|
580
|
-
|
|
615
|
+
const colonIndex = displayName.indexOf(":");
|
|
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 };
|
|
581
619
|
}
|
|
582
620
|
|
|
583
621
|
// src/components/DimensionMenu/DimensionGroupHeading.tsx
|
|
584
622
|
import { jsx as jsx8, jsxs as jsxs3 } from "@emotion/react/jsx-runtime";
|
|
585
623
|
var DimensionGroupHeading = (props) => {
|
|
586
|
-
var _a;
|
|
587
624
|
const { data, getStyles, className } = props;
|
|
625
|
+
const { type } = dimensionDisplayName(data.label);
|
|
588
626
|
return /* @__PURE__ */ jsx8(
|
|
589
627
|
"div",
|
|
590
628
|
{
|
|
@@ -599,7 +637,7 @@ var DimensionGroupHeading = (props) => {
|
|
|
599
637
|
{
|
|
600
638
|
css: { color: "var(--gray-500)", display: "flex", alignItems: "center", gap: "var(--spacing-xs)" },
|
|
601
639
|
children: [
|
|
602
|
-
/* @__PURE__ */ jsx8(Icon, { icon: dimensionIcon(
|
|
640
|
+
type ? /* @__PURE__ */ jsx8(Icon, { icon: dimensionIcon(type), iconColor: "currentColor", size: 16 }) : null,
|
|
603
641
|
/* @__PURE__ */ jsx8("span", { children: data.label })
|
|
604
642
|
]
|
|
605
643
|
}
|
|
@@ -630,9 +668,8 @@ function DimensionMenuErrorMessage({ message }) {
|
|
|
630
668
|
// src/components/DimensionMenu/DimensionOption.tsx
|
|
631
669
|
import { jsx as jsx10 } from "@emotion/react/jsx-runtime";
|
|
632
670
|
var DimensionOption = (props) => {
|
|
633
|
-
var _a, _b;
|
|
634
671
|
const { data, getStyles, cx, isDisabled, isFocused, isSelected, className, innerRef, innerProps } = props;
|
|
635
|
-
const
|
|
672
|
+
const { name } = dimensionDisplayName(data.label);
|
|
636
673
|
return /* @__PURE__ */ jsx10(
|
|
637
674
|
"div",
|
|
638
675
|
{
|
|
@@ -649,7 +686,7 @@ var DimensionOption = (props) => {
|
|
|
649
686
|
ref: innerRef,
|
|
650
687
|
"aria-disabled": isDisabled,
|
|
651
688
|
...innerProps,
|
|
652
|
-
children: /* @__PURE__ */ jsx10("div", { css: { color: "var(--gray-700)" }, children:
|
|
689
|
+
children: /* @__PURE__ */ jsx10("div", { css: { color: "var(--gray-700)" }, children: name != null ? name : data.label })
|
|
653
690
|
}
|
|
654
691
|
);
|
|
655
692
|
};
|
|
@@ -658,7 +695,7 @@ var DimensionOption = (props) => {
|
|
|
658
695
|
import { Icon as Icon2 } from "@uniformdev/design-system";
|
|
659
696
|
import { jsx as jsx11, jsxs as jsxs4 } from "@emotion/react/jsx-runtime";
|
|
660
697
|
function DimensionValue({ displayName }) {
|
|
661
|
-
const
|
|
698
|
+
const { type, name } = dimensionDisplayName(displayName);
|
|
662
699
|
return /* @__PURE__ */ jsxs4(
|
|
663
700
|
"div",
|
|
664
701
|
{
|
|
@@ -667,7 +704,7 @@ function DimensionValue({ displayName }) {
|
|
|
667
704
|
overflow: "hidden"
|
|
668
705
|
},
|
|
669
706
|
children: [
|
|
670
|
-
|
|
707
|
+
type ? /* @__PURE__ */ jsxs4(
|
|
671
708
|
"small",
|
|
672
709
|
{
|
|
673
710
|
css: { color: "var(--gray-500)", display: "flex", alignItems: "center", gap: "var(--spacing-xs)" },
|
|
@@ -705,6 +742,7 @@ function CriteriaMatchMenu({
|
|
|
705
742
|
);
|
|
706
743
|
const rDim = criteriaMatch.rDim;
|
|
707
744
|
const targetDim = criteriaMatch.rDim ? dimensions.dimIndex[criteriaMatch.rDim] : void 0;
|
|
745
|
+
const groupedDimensions = useGroupedDimensions(dimensions.dimensions, void 0);
|
|
708
746
|
return /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
709
747
|
/* @__PURE__ */ jsx13(
|
|
710
748
|
InputComboBox3,
|
|
@@ -723,7 +761,7 @@ function CriteriaMatchMenu({
|
|
|
723
761
|
value: "",
|
|
724
762
|
isDisabled: true
|
|
725
763
|
},
|
|
726
|
-
...
|
|
764
|
+
...groupedDimensions
|
|
727
765
|
],
|
|
728
766
|
styles: {
|
|
729
767
|
...props.styles,
|
|
@@ -802,14 +840,23 @@ function isInt(value) {
|
|
|
802
840
|
// src/components/DimensionMenu/DimensionMenu.tsx
|
|
803
841
|
import { InputComboBox as InputComboBox4 } from "@uniformdev/design-system";
|
|
804
842
|
import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs6 } from "@emotion/react/jsx-runtime";
|
|
805
|
-
function DimensionMenu({
|
|
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;
|
|
806
853
|
return /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
807
854
|
/* @__PURE__ */ jsx14(
|
|
808
855
|
InputComboBox4,
|
|
809
856
|
{
|
|
810
857
|
...props,
|
|
811
|
-
value:
|
|
812
|
-
options:
|
|
858
|
+
value: valueAsMenuOption,
|
|
859
|
+
options: groupedDimensions,
|
|
813
860
|
styles: {
|
|
814
861
|
...props.styles,
|
|
815
862
|
valueContainer: (provided, state) => {
|
|
@@ -822,8 +869,8 @@ function DimensionMenu({ onChange, value, dimensions, errorMessage, ...props })
|
|
|
822
869
|
}
|
|
823
870
|
},
|
|
824
871
|
onChange: (e) => {
|
|
825
|
-
if (e) {
|
|
826
|
-
onChange(
|
|
872
|
+
if (e == null ? void 0 : e.original) {
|
|
873
|
+
onChange(e.original);
|
|
827
874
|
}
|
|
828
875
|
},
|
|
829
876
|
components: {
|
|
@@ -892,7 +939,7 @@ import {
|
|
|
892
939
|
LoadingIndicator as LoadingIndicator3
|
|
893
940
|
} from "@uniformdev/design-system";
|
|
894
941
|
import { produce } from "immer";
|
|
895
|
-
import { useMemo, useState as useState6 } from "react";
|
|
942
|
+
import { useMemo as useMemo2, useState as useState6 } from "react";
|
|
896
943
|
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs8 } from "@emotion/react/jsx-runtime";
|
|
897
944
|
var addEnrichmentLink = css5`
|
|
898
945
|
flex: 2;
|
|
@@ -913,10 +960,10 @@ var EnrichmentTag = ({
|
|
|
913
960
|
displayTitle = true
|
|
914
961
|
}) => {
|
|
915
962
|
const { loading, result: dimensions, error } = useDimensions(contextConfig);
|
|
916
|
-
const allEnrichments =
|
|
963
|
+
const allEnrichments = useMemo2(() => {
|
|
917
964
|
if (dimensions) return dimensions.dimensions.filter((dimension) => dimension.category === "ENR");
|
|
918
965
|
}, [dimensions]);
|
|
919
|
-
const remainingEnrichments =
|
|
966
|
+
const remainingEnrichments = useMemo2(() => {
|
|
920
967
|
if (!value) return allEnrichments;
|
|
921
968
|
if (allEnrichments)
|
|
922
969
|
return allEnrichments.filter(
|
|
@@ -1262,7 +1309,15 @@ function opHasRhs(op) {
|
|
|
1262
1309
|
// src/components/PersonalizationCriteria/PersonalizationCriteriaStatic.tsx
|
|
1263
1310
|
import { css as css7 } from "@emotion/react";
|
|
1264
1311
|
import { CgCloseO as CgCloseO2 } from "@react-icons/all-files/cg/CgCloseO";
|
|
1265
|
-
import {
|
|
1312
|
+
import {
|
|
1313
|
+
AddListButton as AddListButton3,
|
|
1314
|
+
Callout as Callout3,
|
|
1315
|
+
Icon as Icon5,
|
|
1316
|
+
Input as Input2,
|
|
1317
|
+
InputInlineSelect,
|
|
1318
|
+
InputSelect as InputSelect2,
|
|
1319
|
+
Paragraph
|
|
1320
|
+
} from "@uniformdev/design-system";
|
|
1266
1321
|
import { produce as produce2 } from "immer";
|
|
1267
1322
|
|
|
1268
1323
|
// src/components/PersonalizationCriteria/PersonalizationCriteriaStatic.styles.ts
|
|
@@ -1298,7 +1353,8 @@ var criteriaItem = css6`
|
|
|
1298
1353
|
`;
|
|
1299
1354
|
var criteriaItemInner = css6`
|
|
1300
1355
|
display: flex;
|
|
1301
|
-
gap: var(--spacing-base);
|
|
1356
|
+
row-gap: var(--spacing-base);
|
|
1357
|
+
column-gap: var(--spacing-xs);
|
|
1302
1358
|
flex-grow: 1;
|
|
1303
1359
|
flex-wrap: wrap;
|
|
1304
1360
|
margin-right: var(--spacing-base);
|
|
@@ -1316,6 +1372,7 @@ var criteriaOperandWrapper = css6`
|
|
|
1316
1372
|
`;
|
|
1317
1373
|
var criteriaOperatorWrapper = css6`
|
|
1318
1374
|
flex: 1;
|
|
1375
|
+
flex-wrap: nowrap;
|
|
1319
1376
|
min-width: 80px;
|
|
1320
1377
|
`;
|
|
1321
1378
|
var expand = css6`
|
|
@@ -1329,6 +1386,7 @@ var PersonalizationCriteriaStatic = ({
|
|
|
1329
1386
|
value,
|
|
1330
1387
|
setValue,
|
|
1331
1388
|
dimensions,
|
|
1389
|
+
quirks,
|
|
1332
1390
|
onMenuOpen,
|
|
1333
1391
|
onMenuClose,
|
|
1334
1392
|
onAddCriteria,
|
|
@@ -1384,94 +1442,137 @@ var PersonalizationCriteriaStatic = ({
|
|
|
1384
1442
|
(components == null ? void 0 : components.CustomVariantName) ? /* @__PURE__ */ jsx17(components.CustomVariantName, {}) : null,
|
|
1385
1443
|
(components == null ? void 0 : components.ControlPercentage) ? /* @__PURE__ */ jsx17(components.ControlPercentage, {}) : null,
|
|
1386
1444
|
!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) => {
|
|
1387
|
-
var _a2, _b, _c, _d;
|
|
1445
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
1388
1446
|
const critHasLhs = ((_a2 = currentCriteria.l) == null ? void 0 : _a2.length) > 0;
|
|
1389
1447
|
const critHasRhs = opHasRhs(currentCriteria.op);
|
|
1448
|
+
const currentDimension = dimensions.dimIndex[currentCriteria.l];
|
|
1449
|
+
const currentQuirk = quirks == null ? void 0 : quirks.find((q) => q.id === currentCriteria.l);
|
|
1390
1450
|
return /* @__PURE__ */ jsxs9("div", { css: criteriaItem, "data-testid": "criteria-container", children: [
|
|
1391
|
-
/* @__PURE__ */ jsxs9(
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
"div",
|
|
1451
|
+
/* @__PURE__ */ jsxs9("div", { css: criteriaItemInner, className: "criteriaItemInner", children: [
|
|
1452
|
+
/* @__PURE__ */ jsx17(
|
|
1453
|
+
"div",
|
|
1454
|
+
{
|
|
1455
|
+
css: [criteriaWrapper, criteriaOperandWrapper],
|
|
1456
|
+
className: "criteria-wrapper",
|
|
1457
|
+
"data-testid": "select-criteria",
|
|
1458
|
+
children: /* @__PURE__ */ jsx17(
|
|
1459
|
+
DimensionMenu,
|
|
1401
1460
|
{
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1461
|
+
errorMessage: (_b = errors.lhs) == null ? void 0 : _b[index],
|
|
1462
|
+
css: expand,
|
|
1463
|
+
styles: { control: (base) => ({ ...base, height: "100%" }) },
|
|
1464
|
+
dimensions: dimensions.dimensions,
|
|
1465
|
+
quirks,
|
|
1466
|
+
onChange: (selection) => {
|
|
1467
|
+
if ("dim" in selection) {
|
|
1468
|
+
const newCriteria = {
|
|
1469
|
+
...currentCriteria,
|
|
1470
|
+
l: selection.dim,
|
|
1471
|
+
t: void 0,
|
|
1472
|
+
op: ">",
|
|
1473
|
+
r: 0
|
|
1474
|
+
};
|
|
1475
|
+
update(newCriteria, index);
|
|
1476
|
+
} else {
|
|
1477
|
+
update({ ...currentCriteria, l: selection.id, t: "q", op: "=", r: "" }, index);
|
|
1418
1478
|
}
|
|
1419
|
-
|
|
1479
|
+
},
|
|
1480
|
+
value: currentDimension != null ? currentDimension : currentQuirk,
|
|
1481
|
+
onMenuOpen,
|
|
1482
|
+
onMenuClose
|
|
1420
1483
|
}
|
|
1421
|
-
)
|
|
1422
|
-
|
|
1423
|
-
|
|
1484
|
+
)
|
|
1485
|
+
}
|
|
1486
|
+
),
|
|
1487
|
+
/* @__PURE__ */ jsx17(
|
|
1488
|
+
"div",
|
|
1489
|
+
{
|
|
1490
|
+
css: [criteriaWrapper, criteriaOperatorWrapper],
|
|
1491
|
+
className: "criteria-wrapper",
|
|
1492
|
+
"data-testid": "select-operator",
|
|
1493
|
+
children: /* @__PURE__ */ jsx17(
|
|
1494
|
+
CriteriaOperatorMenu,
|
|
1424
1495
|
{
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
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
|
|
1496
|
+
name: `op-${index}`,
|
|
1497
|
+
css: expand,
|
|
1498
|
+
styles: { control: (base) => ({ ...base, height: "100%" }) },
|
|
1499
|
+
value: currentCriteria.op,
|
|
1500
|
+
rhsType: currentQuirk ? "QUIRK" : currentDimension == null ? void 0 : currentDimension.category,
|
|
1501
|
+
onChange: (op) => {
|
|
1502
|
+
if (op === "+" || op === "-") {
|
|
1503
|
+
update({ ...currentCriteria, op, r: void 0, rDim: void 0 }, index);
|
|
1504
|
+
} else {
|
|
1505
|
+
update({ ...currentCriteria, op }, index);
|
|
1444
1506
|
}
|
|
1445
|
-
|
|
1507
|
+
},
|
|
1508
|
+
onMenuOpen,
|
|
1509
|
+
onMenuClose
|
|
1446
1510
|
}
|
|
1447
|
-
)
|
|
1448
|
-
|
|
1511
|
+
)
|
|
1512
|
+
}
|
|
1513
|
+
),
|
|
1514
|
+
critHasRhs ? /* @__PURE__ */ jsx17(
|
|
1515
|
+
"div",
|
|
1516
|
+
{
|
|
1517
|
+
css: [criteriaWrapper, criteriaOperandWrapper],
|
|
1518
|
+
className: "criteria-wrapper",
|
|
1519
|
+
"data-testid": "select-match-criteria",
|
|
1520
|
+
children: currentQuirk ? /* @__PURE__ */ jsx17(
|
|
1449
1521
|
"div",
|
|
1450
1522
|
{
|
|
1451
|
-
css:
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1523
|
+
css: css7`
|
|
1524
|
+
width: 100%;
|
|
1525
|
+
// InputSelect wrapper is unstylable so need a descendant selector
|
|
1526
|
+
// to full-width it
|
|
1527
|
+
& > * {
|
|
1528
|
+
width: 100%;
|
|
1529
|
+
}
|
|
1530
|
+
`,
|
|
1531
|
+
children: currentQuirk.options ? /* @__PURE__ */ jsx17(
|
|
1532
|
+
InputSelect2,
|
|
1533
|
+
{
|
|
1534
|
+
label: "quirk match value",
|
|
1535
|
+
showLabel: false,
|
|
1536
|
+
value: (_c = currentCriteria.r) != null ? _c : "",
|
|
1537
|
+
errorMessage: (_d = errors.rhs) == null ? void 0 : _d[index],
|
|
1538
|
+
onChange: (e) => update({ ...currentCriteria, r: e.currentTarget.value }, index),
|
|
1539
|
+
options: [
|
|
1540
|
+
{ label: "Select\u2026", value: "" },
|
|
1541
|
+
...currentQuirk.options.map((o) => ({ label: o.name, value: o.value }))
|
|
1542
|
+
]
|
|
1543
|
+
}
|
|
1544
|
+
) : /* @__PURE__ */ jsx17(
|
|
1545
|
+
Input2,
|
|
1456
1546
|
{
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
isDisabled: !critHasLhs,
|
|
1465
|
-
dimensions,
|
|
1466
|
-
onMenuOpen,
|
|
1467
|
-
onMenuClose
|
|
1547
|
+
type: "text",
|
|
1548
|
+
label: "quirk match value",
|
|
1549
|
+
showLabel: false,
|
|
1550
|
+
value: (_e = currentCriteria.r) != null ? _e : "",
|
|
1551
|
+
errorMessage: (_f = errors.rhs) == null ? void 0 : _f[index],
|
|
1552
|
+
onChange: (e) => update({ ...currentCriteria, r: e.currentTarget.value }, index),
|
|
1553
|
+
placeholder: "Enter a value"
|
|
1468
1554
|
}
|
|
1469
1555
|
)
|
|
1470
1556
|
}
|
|
1471
|
-
) :
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1557
|
+
) : /* @__PURE__ */ jsx17(
|
|
1558
|
+
CriteriaMatchMenu,
|
|
1559
|
+
{
|
|
1560
|
+
errorMessage: (_g = errors.rhs) == null ? void 0 : _g[index],
|
|
1561
|
+
css: expand,
|
|
1562
|
+
styles: { control: (base) => ({ ...base, height: "100%" }) },
|
|
1563
|
+
criteriaMatch: currentCriteria,
|
|
1564
|
+
onChange: (match) => {
|
|
1565
|
+
update(match, index);
|
|
1566
|
+
},
|
|
1567
|
+
isDisabled: !critHasLhs,
|
|
1568
|
+
dimensions,
|
|
1569
|
+
onMenuOpen,
|
|
1570
|
+
onMenuClose
|
|
1571
|
+
}
|
|
1572
|
+
)
|
|
1573
|
+
}
|
|
1574
|
+
) : null
|
|
1575
|
+
] }),
|
|
1475
1576
|
/* @__PURE__ */ jsx17(
|
|
1476
1577
|
"button",
|
|
1477
1578
|
{
|
|
@@ -1497,7 +1598,7 @@ var PersonalizationCriteriaStatic = ({
|
|
|
1497
1598
|
{
|
|
1498
1599
|
"data-testid": "dropdown-button-combine",
|
|
1499
1600
|
disabled: index > 1,
|
|
1500
|
-
value: (
|
|
1601
|
+
value: (_h = currentValue.op) != null ? _h : "&",
|
|
1501
1602
|
options: [
|
|
1502
1603
|
{ label: "AND", value: "&" },
|
|
1503
1604
|
{ label: "OR", value: "|" }
|
|
@@ -1729,6 +1830,7 @@ export {
|
|
|
1729
1830
|
addEnrichmentLink,
|
|
1730
1831
|
contextCriteriaMenuOperators,
|
|
1731
1832
|
convertErrorsToObj,
|
|
1833
|
+
enrichmentCriteriaMenuOperators,
|
|
1732
1834
|
isEnrichmentTagData,
|
|
1733
1835
|
isPersonalizationCriteriaData,
|
|
1734
1836
|
opHasRhs,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/context-ui",
|
|
3
|
-
"version": "20.3.1-alpha.
|
|
3
|
+
"version": "20.3.1-alpha.7+bede5bf489",
|
|
4
4
|
"description": "React-based functionality and components for Uniform Context",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@emotion/react": "11.13.5",
|
|
36
36
|
"@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v5.2.1/react-icons-all-files-5.2.1.tgz",
|
|
37
|
-
"@uniformdev/context": "20.3.1-alpha.
|
|
38
|
-
"@uniformdev/design-system": "20.3.1-alpha.
|
|
37
|
+
"@uniformdev/context": "20.3.1-alpha.7+bede5bf489",
|
|
38
|
+
"@uniformdev/design-system": "20.3.1-alpha.7+bede5bf489",
|
|
39
39
|
"immer": "10.1.1",
|
|
40
40
|
"react-beautiful-dnd": "13.1.1",
|
|
41
41
|
"react-select": "5.8.0",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "bede5bf4893bf814af6aba78a558e28efd9f5682"
|
|
80
80
|
}
|