@uniformdev/context-ui 20.37.1-alpha.1 → 20.37.1-alpha.6

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 CHANGED
@@ -39,6 +39,8 @@ type CriteriaOperatorMenuProps = {
39
39
  value: DimensionMatch['op'] | QuirkMatch['op'];
40
40
  onChange: (newValue: DimensionMatch['op'] | QuirkMatch['op']) => void;
41
41
  rhsType?: ResolvedDimensionDefinition['category'] | 'QUIRK';
42
+ /** sets the disabled state of the component */
43
+ disabled?: boolean;
42
44
  } & Omit<InputComboBoxProps<InputComboBoxOption, false>, 'value' | 'options' | 'onChange'>;
43
45
  declare const contextCriteriaMenuOperators: Array<{
44
46
  name: string;
@@ -93,6 +95,8 @@ type CriteriaMatchMenuProps = {
93
95
  dimensions: DimensionsData;
94
96
  errorMessage?: string;
95
97
  onChange: (newCriteria: DimensionMatch) => void;
98
+ /** sets the disabled state of the component */
99
+ disabled?: boolean;
96
100
  } & Omit<InputComboBoxProps<InputComboBoxOption, false>, 'value' | 'options' | 'onChange' | 'inputValue' | 'value' | 'onInputChange'>;
97
101
  declare function CriteriaMatchMenu({ onChange, criteriaMatch, dimensions, errorMessage, ...props }: CriteriaMatchMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
98
102
 
@@ -106,6 +110,8 @@ type DimensionMenuProps = {
106
110
  quirks?: QuirkGetResponse['quirks'];
107
111
  errorMessage?: string;
108
112
  onChange: (newValue: ResolvedDimensionDefinition | Quirk | undefined) => void;
113
+ /** sets the disabled state of the component */
114
+ disabled?: boolean;
109
115
  } & Omit<InputComboBoxProps<DimensionMenuOption, false>, 'value' | 'options' | 'onChange'>;
110
116
  declare function DimensionMenu({ onChange, value, dimensions, errorMessage, quirks, ...props }: DimensionMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
111
117
 
@@ -150,6 +156,8 @@ interface PersonalizationCriteriaStaticProps {
150
156
  lhs?: Array<string | undefined>;
151
157
  rhs?: Array<string | undefined>;
152
158
  };
159
+ /** sets the disabled state of the component */
160
+ readOnly?: boolean;
153
161
  }
154
162
  declare const PersonalizationCriteriaStatic: React.FC<PersonalizationCriteriaStaticProps>;
155
163
 
package/dist/index.d.ts CHANGED
@@ -39,6 +39,8 @@ type CriteriaOperatorMenuProps = {
39
39
  value: DimensionMatch['op'] | QuirkMatch['op'];
40
40
  onChange: (newValue: DimensionMatch['op'] | QuirkMatch['op']) => void;
41
41
  rhsType?: ResolvedDimensionDefinition['category'] | 'QUIRK';
42
+ /** sets the disabled state of the component */
43
+ disabled?: boolean;
42
44
  } & Omit<InputComboBoxProps<InputComboBoxOption, false>, 'value' | 'options' | 'onChange'>;
43
45
  declare const contextCriteriaMenuOperators: Array<{
44
46
  name: string;
@@ -93,6 +95,8 @@ type CriteriaMatchMenuProps = {
93
95
  dimensions: DimensionsData;
94
96
  errorMessage?: string;
95
97
  onChange: (newCriteria: DimensionMatch) => void;
98
+ /** sets the disabled state of the component */
99
+ disabled?: boolean;
96
100
  } & Omit<InputComboBoxProps<InputComboBoxOption, false>, 'value' | 'options' | 'onChange' | 'inputValue' | 'value' | 'onInputChange'>;
97
101
  declare function CriteriaMatchMenu({ onChange, criteriaMatch, dimensions, errorMessage, ...props }: CriteriaMatchMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
98
102
 
@@ -106,6 +110,8 @@ type DimensionMenuProps = {
106
110
  quirks?: QuirkGetResponse['quirks'];
107
111
  errorMessage?: string;
108
112
  onChange: (newValue: ResolvedDimensionDefinition | Quirk | undefined) => void;
113
+ /** sets the disabled state of the component */
114
+ disabled?: boolean;
109
115
  } & Omit<InputComboBoxProps<DimensionMenuOption, false>, 'value' | 'options' | 'onChange'>;
110
116
  declare function DimensionMenu({ onChange, value, dimensions, errorMessage, quirks, ...props }: DimensionMenuProps): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
111
117
 
@@ -150,6 +156,8 @@ interface PersonalizationCriteriaStaticProps {
150
156
  lhs?: Array<string | undefined>;
151
157
  rhs?: Array<string | undefined>;
152
158
  };
159
+ /** sets the disabled state of the component */
160
+ readOnly?: boolean;
153
161
  }
154
162
  declare const PersonalizationCriteriaStatic: React.FC<PersonalizationCriteriaStaticProps>;
155
163
 
package/dist/index.esm.js CHANGED
@@ -320,6 +320,7 @@ function CriteriaOperatorMenu({ onChange, value, rhsType, ...props }) {
320
320
  InputComboBox,
321
321
  {
322
322
  ...props,
323
+ isDisabled: props.disabled,
323
324
  value: {
324
325
  label: (_b = (_a = operators.find((e) => e.value === value)) == null ? void 0 : _a.name) != null ? _b : value,
325
326
  value
@@ -766,6 +767,7 @@ function CriteriaMatchMenu({
766
767
  InputComboBox3,
767
768
  {
768
769
  ...props,
770
+ isDisabled: props.disabled,
769
771
  inputValue,
770
772
  menuShouldScrollIntoView: true,
771
773
  value: {
@@ -873,6 +875,7 @@ function DimensionMenu({
873
875
  InputComboBox4,
874
876
  {
875
877
  ...props,
878
+ isDisabled: props.disabled,
876
879
  value: valueAsMenuOption,
877
880
  options: groupedDimensions,
878
881
  getOptionValue: (option) => option.label,
@@ -1416,7 +1419,8 @@ var PersonalizationCriteriaStatic = ({
1416
1419
  onRemoveCriteria,
1417
1420
  displayTitle = true,
1418
1421
  components,
1419
- errors = {}
1422
+ errors = {},
1423
+ readOnly
1420
1424
  }) => {
1421
1425
  var _a;
1422
1426
  const currentValue = { crit: [], ...value };
@@ -1510,7 +1514,8 @@ var PersonalizationCriteriaStatic = ({
1510
1514
  },
1511
1515
  value: currentDimension != null ? currentDimension : currentQuirk,
1512
1516
  onMenuOpen,
1513
- onMenuClose
1517
+ onMenuClose,
1518
+ disabled: readOnly
1514
1519
  }
1515
1520
  )
1516
1521
  }
@@ -1537,7 +1542,8 @@ var PersonalizationCriteriaStatic = ({
1537
1542
  }
1538
1543
  },
1539
1544
  onMenuOpen,
1540
- onMenuClose
1545
+ onMenuClose,
1546
+ disabled: readOnly
1541
1547
  }
1542
1548
  )
1543
1549
  }
@@ -1570,7 +1576,8 @@ var PersonalizationCriteriaStatic = ({
1570
1576
  options: [
1571
1577
  { label: "Select\u2026", value: "" },
1572
1578
  ...currentQuirk.options.map((o) => ({ label: o.name, value: o.value }))
1573
- ]
1579
+ ],
1580
+ disabled: readOnly
1574
1581
  }
1575
1582
  ) : /* @__PURE__ */ jsx17(
1576
1583
  Input2,
@@ -1581,7 +1588,8 @@ var PersonalizationCriteriaStatic = ({
1581
1588
  value: (_e = currentCriteria.r) != null ? _e : "",
1582
1589
  errorMessage: (_f = errors.rhs) == null ? void 0 : _f[index],
1583
1590
  onChange: (e) => update({ ...currentCriteria, r: e.currentTarget.value }, index),
1584
- placeholder: "Enter a value"
1591
+ placeholder: "Enter a value",
1592
+ disabled: readOnly
1585
1593
  }
1586
1594
  )
1587
1595
  }
@@ -1598,7 +1606,8 @@ var PersonalizationCriteriaStatic = ({
1598
1606
  isDisabled: !critHasLhs,
1599
1607
  dimensions,
1600
1608
  onMenuOpen,
1601
- onMenuClose
1609
+ onMenuClose,
1610
+ disabled: readOnly
1602
1611
  }
1603
1612
  )
1604
1613
  }
@@ -1612,6 +1621,7 @@ var PersonalizationCriteriaStatic = ({
1612
1621
  title: `Delete Personalization`,
1613
1622
  css: { backgroundColor: "transparent", backgroundImage: "none", borderWidth: 0 },
1614
1623
  "data-testid": "button-delete",
1624
+ disabled: readOnly,
1615
1625
  children: /* @__PURE__ */ jsx17(Icon5, { icon: CgCloseO2, iconColor: "red", size: "1.5rem" })
1616
1626
  }
1617
1627
  ),
@@ -1628,7 +1638,7 @@ var PersonalizationCriteriaStatic = ({
1628
1638
  InputInlineSelect,
1629
1639
  {
1630
1640
  "data-testid": "dropdown-button-combine",
1631
- disabled: index > 1,
1641
+ disabled: index > 1 || readOnly,
1632
1642
  value: (_h = currentValue.op) != null ? _h : "&",
1633
1643
  options: [
1634
1644
  { label: "AND", value: "&" },
@@ -1649,7 +1659,8 @@ var PersonalizationCriteriaStatic = ({
1649
1659
  "data-testid": "button-add-criteria",
1650
1660
  className: "add-more",
1651
1661
  buttonText: "Add Criteria",
1652
- onButtonClick: addToList
1662
+ onButtonClick: addToList,
1663
+ disabled: readOnly
1653
1664
  }
1654
1665
  )
1655
1666
  ] })
package/dist/index.js CHANGED
@@ -374,6 +374,7 @@ function CriteriaOperatorMenu({ onChange, value, rhsType, ...props }) {
374
374
  import_design_system2.InputComboBox,
375
375
  {
376
376
  ...props,
377
+ isDisabled: props.disabled,
377
378
  value: {
378
379
  label: (_b = (_a = operators.find((e) => e.value === value)) == null ? void 0 : _a.name) != null ? _b : value,
379
380
  value
@@ -820,6 +821,7 @@ function CriteriaMatchMenu({
820
821
  import_design_system6.InputComboBox,
821
822
  {
822
823
  ...props,
824
+ isDisabled: props.disabled,
823
825
  inputValue,
824
826
  menuShouldScrollIntoView: true,
825
827
  value: {
@@ -927,6 +929,7 @@ function DimensionMenu({
927
929
  import_design_system7.InputComboBox,
928
930
  {
929
931
  ...props,
932
+ isDisabled: props.disabled,
930
933
  value: valueAsMenuOption,
931
934
  options: groupedDimensions,
932
935
  getOptionValue: (option) => option.label,
@@ -1452,7 +1455,8 @@ var PersonalizationCriteriaStatic = ({
1452
1455
  onRemoveCriteria,
1453
1456
  displayTitle = true,
1454
1457
  components,
1455
- errors = {}
1458
+ errors = {},
1459
+ readOnly
1456
1460
  }) => {
1457
1461
  var _a;
1458
1462
  const currentValue = { crit: [], ...value };
@@ -1546,7 +1550,8 @@ var PersonalizationCriteriaStatic = ({
1546
1550
  },
1547
1551
  value: currentDimension != null ? currentDimension : currentQuirk,
1548
1552
  onMenuOpen,
1549
- onMenuClose
1553
+ onMenuClose,
1554
+ disabled: readOnly
1550
1555
  }
1551
1556
  )
1552
1557
  }
@@ -1573,7 +1578,8 @@ var PersonalizationCriteriaStatic = ({
1573
1578
  }
1574
1579
  },
1575
1580
  onMenuOpen,
1576
- onMenuClose
1581
+ onMenuClose,
1582
+ disabled: readOnly
1577
1583
  }
1578
1584
  )
1579
1585
  }
@@ -1606,7 +1612,8 @@ var PersonalizationCriteriaStatic = ({
1606
1612
  options: [
1607
1613
  { label: "Select\u2026", value: "" },
1608
1614
  ...currentQuirk.options.map((o) => ({ label: o.name, value: o.value }))
1609
- ]
1615
+ ],
1616
+ disabled: readOnly
1610
1617
  }
1611
1618
  ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1612
1619
  import_design_system10.Input,
@@ -1617,7 +1624,8 @@ var PersonalizationCriteriaStatic = ({
1617
1624
  value: (_e = currentCriteria.r) != null ? _e : "",
1618
1625
  errorMessage: (_f = errors.rhs) == null ? void 0 : _f[index],
1619
1626
  onChange: (e) => update({ ...currentCriteria, r: e.currentTarget.value }, index),
1620
- placeholder: "Enter a value"
1627
+ placeholder: "Enter a value",
1628
+ disabled: readOnly
1621
1629
  }
1622
1630
  )
1623
1631
  }
@@ -1634,7 +1642,8 @@ var PersonalizationCriteriaStatic = ({
1634
1642
  isDisabled: !critHasLhs,
1635
1643
  dimensions,
1636
1644
  onMenuOpen,
1637
- onMenuClose
1645
+ onMenuClose,
1646
+ disabled: readOnly
1638
1647
  }
1639
1648
  )
1640
1649
  }
@@ -1648,6 +1657,7 @@ var PersonalizationCriteriaStatic = ({
1648
1657
  title: `Delete Personalization`,
1649
1658
  css: { backgroundColor: "transparent", backgroundImage: "none", borderWidth: 0 },
1650
1659
  "data-testid": "button-delete",
1660
+ disabled: readOnly,
1651
1661
  children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Icon, { icon: import_CgCloseO2.CgCloseO, iconColor: "red", size: "1.5rem" })
1652
1662
  }
1653
1663
  ),
@@ -1664,7 +1674,7 @@ var PersonalizationCriteriaStatic = ({
1664
1674
  import_design_system10.InputInlineSelect,
1665
1675
  {
1666
1676
  "data-testid": "dropdown-button-combine",
1667
- disabled: index > 1,
1677
+ disabled: index > 1 || readOnly,
1668
1678
  value: (_h = currentValue.op) != null ? _h : "&",
1669
1679
  options: [
1670
1680
  { label: "AND", value: "&" },
@@ -1685,7 +1695,8 @@ var PersonalizationCriteriaStatic = ({
1685
1695
  "data-testid": "button-add-criteria",
1686
1696
  className: "add-more",
1687
1697
  buttonText: "Add Criteria",
1688
- onButtonClick: addToList
1698
+ onButtonClick: addToList,
1699
+ disabled: readOnly
1689
1700
  }
1690
1701
  )
1691
1702
  ] })
package/dist/index.mjs CHANGED
@@ -320,6 +320,7 @@ function CriteriaOperatorMenu({ onChange, value, rhsType, ...props }) {
320
320
  InputComboBox,
321
321
  {
322
322
  ...props,
323
+ isDisabled: props.disabled,
323
324
  value: {
324
325
  label: (_b = (_a = operators.find((e) => e.value === value)) == null ? void 0 : _a.name) != null ? _b : value,
325
326
  value
@@ -766,6 +767,7 @@ function CriteriaMatchMenu({
766
767
  InputComboBox3,
767
768
  {
768
769
  ...props,
770
+ isDisabled: props.disabled,
769
771
  inputValue,
770
772
  menuShouldScrollIntoView: true,
771
773
  value: {
@@ -873,6 +875,7 @@ function DimensionMenu({
873
875
  InputComboBox4,
874
876
  {
875
877
  ...props,
878
+ isDisabled: props.disabled,
876
879
  value: valueAsMenuOption,
877
880
  options: groupedDimensions,
878
881
  getOptionValue: (option) => option.label,
@@ -1416,7 +1419,8 @@ var PersonalizationCriteriaStatic = ({
1416
1419
  onRemoveCriteria,
1417
1420
  displayTitle = true,
1418
1421
  components,
1419
- errors = {}
1422
+ errors = {},
1423
+ readOnly
1420
1424
  }) => {
1421
1425
  var _a;
1422
1426
  const currentValue = { crit: [], ...value };
@@ -1510,7 +1514,8 @@ var PersonalizationCriteriaStatic = ({
1510
1514
  },
1511
1515
  value: currentDimension != null ? currentDimension : currentQuirk,
1512
1516
  onMenuOpen,
1513
- onMenuClose
1517
+ onMenuClose,
1518
+ disabled: readOnly
1514
1519
  }
1515
1520
  )
1516
1521
  }
@@ -1537,7 +1542,8 @@ var PersonalizationCriteriaStatic = ({
1537
1542
  }
1538
1543
  },
1539
1544
  onMenuOpen,
1540
- onMenuClose
1545
+ onMenuClose,
1546
+ disabled: readOnly
1541
1547
  }
1542
1548
  )
1543
1549
  }
@@ -1570,7 +1576,8 @@ var PersonalizationCriteriaStatic = ({
1570
1576
  options: [
1571
1577
  { label: "Select\u2026", value: "" },
1572
1578
  ...currentQuirk.options.map((o) => ({ label: o.name, value: o.value }))
1573
- ]
1579
+ ],
1580
+ disabled: readOnly
1574
1581
  }
1575
1582
  ) : /* @__PURE__ */ jsx17(
1576
1583
  Input2,
@@ -1581,7 +1588,8 @@ var PersonalizationCriteriaStatic = ({
1581
1588
  value: (_e = currentCriteria.r) != null ? _e : "",
1582
1589
  errorMessage: (_f = errors.rhs) == null ? void 0 : _f[index],
1583
1590
  onChange: (e) => update({ ...currentCriteria, r: e.currentTarget.value }, index),
1584
- placeholder: "Enter a value"
1591
+ placeholder: "Enter a value",
1592
+ disabled: readOnly
1585
1593
  }
1586
1594
  )
1587
1595
  }
@@ -1598,7 +1606,8 @@ var PersonalizationCriteriaStatic = ({
1598
1606
  isDisabled: !critHasLhs,
1599
1607
  dimensions,
1600
1608
  onMenuOpen,
1601
- onMenuClose
1609
+ onMenuClose,
1610
+ disabled: readOnly
1602
1611
  }
1603
1612
  )
1604
1613
  }
@@ -1612,6 +1621,7 @@ var PersonalizationCriteriaStatic = ({
1612
1621
  title: `Delete Personalization`,
1613
1622
  css: { backgroundColor: "transparent", backgroundImage: "none", borderWidth: 0 },
1614
1623
  "data-testid": "button-delete",
1624
+ disabled: readOnly,
1615
1625
  children: /* @__PURE__ */ jsx17(Icon5, { icon: CgCloseO2, iconColor: "red", size: "1.5rem" })
1616
1626
  }
1617
1627
  ),
@@ -1628,7 +1638,7 @@ var PersonalizationCriteriaStatic = ({
1628
1638
  InputInlineSelect,
1629
1639
  {
1630
1640
  "data-testid": "dropdown-button-combine",
1631
- disabled: index > 1,
1641
+ disabled: index > 1 || readOnly,
1632
1642
  value: (_h = currentValue.op) != null ? _h : "&",
1633
1643
  options: [
1634
1644
  { label: "AND", value: "&" },
@@ -1649,7 +1659,8 @@ var PersonalizationCriteriaStatic = ({
1649
1659
  "data-testid": "button-add-criteria",
1650
1660
  className: "add-more",
1651
1661
  buttonText: "Add Criteria",
1652
- onButtonClick: addToList
1662
+ onButtonClick: addToList,
1663
+ disabled: readOnly
1653
1664
  }
1654
1665
  )
1655
1666
  ] })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/context-ui",
3
- "version": "20.37.1-alpha.1+5ac67f77a7",
3
+ "version": "20.37.1-alpha.6+0bdc7878de",
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",
@@ -29,8 +29,8 @@
29
29
  "dependencies": {
30
30
  "@emotion/react": "11.13.5",
31
31
  "@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v5.5.0/react-icons-all-files-5.5.0.tgz",
32
- "@uniformdev/context": "20.37.1-alpha.1+5ac67f77a7",
33
- "@uniformdev/design-system": "20.37.1-alpha.1+5ac67f77a7",
32
+ "@uniformdev/context": "20.37.1-alpha.6+0bdc7878de",
33
+ "@uniformdev/design-system": "20.37.1-alpha.6+0bdc7878de",
34
34
  "immer": "10.1.1",
35
35
  "react-beautiful-dnd": "13.1.1",
36
36
  "react-select": "5.10.0",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "5ac67f77a77da73d93c76b9ec23d86acbd0a2123"
67
+ "gitHead": "0bdc7878de6fcd5f152feb2a0f8fa56563c61e7c"
68
68
  }