@commercetools-frontend/experimental-components 6.3.1 → 6.3.2

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.
@@ -265,6 +265,7 @@ const INTERVALS_IN_SECONDS = {
265
265
  };
266
266
  const EXCLUDING_PRODUCTS = 'excludingProducts';
267
267
  const PRODUCT_TAILORING_FOR_ATTRIBUTES = 'productTailoringForAttributes';
268
+ const PRODUCT_TAILORING_FOR_ATTRIBUTES_TYPES_OTHER_THAN_TEXT = 'productTailoringForAttributesTypesOtherThanText';
268
269
 
269
270
  // TODO: apply a more robust solution to overlaying issues
270
271
  const Z_INDEX_DROPDOWN = 30000;
@@ -7817,15 +7818,19 @@ const useDnDContext = () => {
7817
7818
  const _excluded$1 = ["WrapperComponent"];
7818
7819
  function ownKeys$J(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
7819
7820
  function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$J(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$J(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
7820
- const textAttributeTypes = ['text', 'ltext'];
7821
+ const existingAttributeTypes = ['text', 'ltext'];
7822
+ const newAttributeTypes = ['text', 'ltext', 'number']; // Add more types here
7823
+
7821
7824
  const getFieldName = (parentName, fieldName) => {
7822
7825
  if (!parentName) return fieldName;
7823
7826
  return `${parentName}.${fieldName}`;
7824
7827
  };
7825
- const isTextAttribute = function () {
7828
+ function isAttributeType() {
7826
7829
  let fieldDefinitionType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7827
- return _includesInstanceProperty__default["default"](textAttributeTypes).call(textAttributeTypes, fieldDefinitionType.name);
7828
- };
7830
+ let isTailoringAttributeForOtherTypes = arguments.length > 1 ? arguments[1] : undefined;
7831
+ const attributeTypes = isTailoringAttributeForOtherTypes ? newAttributeTypes : existingAttributeTypes;
7832
+ return _includesInstanceProperty__default["default"](attributeTypes).call(attributeTypes, fieldDefinitionType.name);
7833
+ }
7829
7834
  const isNested = fieldDefinition => {
7830
7835
  const type = fieldDefinition.type;
7831
7836
  const typeName = type.name.toLowerCase();
@@ -7845,6 +7850,7 @@ const CustomFieldsInternal = _ref => {
7845
7850
  handleBlur = _useFormikContext.handleBlur,
7846
7851
  status = _useFormikContext.status;
7847
7852
  const isTailoringAttributesEnabled = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES);
7853
+ const isTailoringAttributeForOtherTypes = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES_TYPES_OTHER_THAN_TEXT);
7848
7854
  const didFormValidationFail = useDidFormValidationFail();
7849
7855
  const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
7850
7856
  const _useDnDContext = useDnDContext(),
@@ -7858,7 +7864,7 @@ const CustomFieldsInternal = _ref => {
7858
7864
  children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
7859
7865
  const fieldName = getFieldName(props.name, fieldDefinition.name);
7860
7866
  const isTouched = Boolean(formik.getIn(touched, fieldName));
7861
- const isFieldDisabled = props.isDisabled && !(isTextAttribute(fieldDefinition.type) && isTailoringAttributesEnabled);
7867
+ const isFieldDisabled = props.isDisabled && !(isAttributeType(fieldDefinition.type, isTailoringAttributeForOtherTypes) && isTailoringAttributesEnabled);
7862
7868
  const fieldErrors = formik.getIn(errors, fieldName);
7863
7869
  const value = props.inputValuesConverter(fieldName, formik.getIn(values, fieldName));
7864
7870
 
@@ -264,6 +264,7 @@ const INTERVALS_IN_SECONDS = {
264
264
  };
265
265
  const EXCLUDING_PRODUCTS = 'excludingProducts';
266
266
  const PRODUCT_TAILORING_FOR_ATTRIBUTES = 'productTailoringForAttributes';
267
+ const PRODUCT_TAILORING_FOR_ATTRIBUTES_TYPES_OTHER_THAN_TEXT = 'productTailoringForAttributesTypesOtherThanText';
267
268
 
268
269
  // TODO: apply a more robust solution to overlaying issues
269
270
  const Z_INDEX_DROPDOWN = 30000;
@@ -7804,15 +7805,19 @@ const useDnDContext = () => {
7804
7805
  const _excluded$1 = ["WrapperComponent"];
7805
7806
  function ownKeys$J(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
7806
7807
  function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$J(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$J(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
7807
- const textAttributeTypes = ['text', 'ltext'];
7808
+ const existingAttributeTypes = ['text', 'ltext'];
7809
+ const newAttributeTypes = ['text', 'ltext', 'number']; // Add more types here
7810
+
7808
7811
  const getFieldName = (parentName, fieldName) => {
7809
7812
  if (!parentName) return fieldName;
7810
7813
  return `${parentName}.${fieldName}`;
7811
7814
  };
7812
- const isTextAttribute = function () {
7815
+ function isAttributeType() {
7813
7816
  let fieldDefinitionType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7814
- return _includesInstanceProperty__default["default"](textAttributeTypes).call(textAttributeTypes, fieldDefinitionType.name);
7815
- };
7817
+ let isTailoringAttributeForOtherTypes = arguments.length > 1 ? arguments[1] : undefined;
7818
+ const attributeTypes = isTailoringAttributeForOtherTypes ? newAttributeTypes : existingAttributeTypes;
7819
+ return _includesInstanceProperty__default["default"](attributeTypes).call(attributeTypes, fieldDefinitionType.name);
7820
+ }
7816
7821
  const isNested = fieldDefinition => {
7817
7822
  const type = fieldDefinition.type;
7818
7823
  const typeName = type.name.toLowerCase();
@@ -7832,6 +7837,7 @@ const CustomFieldsInternal = _ref => {
7832
7837
  handleBlur = _useFormikContext.handleBlur,
7833
7838
  status = _useFormikContext.status;
7834
7839
  const isTailoringAttributesEnabled = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES);
7840
+ const isTailoringAttributeForOtherTypes = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES_TYPES_OTHER_THAN_TEXT);
7835
7841
  const didFormValidationFail = useDidFormValidationFail();
7836
7842
  const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
7837
7843
  const _useDnDContext = useDnDContext(),
@@ -7845,7 +7851,7 @@ const CustomFieldsInternal = _ref => {
7845
7851
  children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
7846
7852
  const fieldName = getFieldName(props.name, fieldDefinition.name);
7847
7853
  const isTouched = Boolean(formik.getIn(touched, fieldName));
7848
- const isFieldDisabled = props.isDisabled && !(isTextAttribute(fieldDefinition.type) && isTailoringAttributesEnabled);
7854
+ const isFieldDisabled = props.isDisabled && !(isAttributeType(fieldDefinition.type, isTailoringAttributeForOtherTypes) && isTailoringAttributesEnabled);
7849
7855
  const fieldErrors = formik.getIn(errors, fieldName);
7850
7856
  const value = props.inputValuesConverter(fieldName, formik.getIn(values, fieldName));
7851
7857
 
@@ -165,6 +165,7 @@ const INTERVALS_IN_SECONDS = {
165
165
  };
166
166
  const EXCLUDING_PRODUCTS = 'excludingProducts';
167
167
  const PRODUCT_TAILORING_FOR_ATTRIBUTES = 'productTailoringForAttributes';
168
+ const PRODUCT_TAILORING_FOR_ATTRIBUTES_TYPES_OTHER_THAN_TEXT = 'productTailoringForAttributesTypesOtherThanText';
168
169
 
169
170
  // TODO: apply a more robust solution to overlaying issues
170
171
  const Z_INDEX_DROPDOWN = 30000;
@@ -7717,15 +7718,19 @@ const useDnDContext = () => {
7717
7718
  const _excluded$1 = ["WrapperComponent"];
7718
7719
  function ownKeys$J(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7719
7720
  function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$J(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$J(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
7720
- const textAttributeTypes = ['text', 'ltext'];
7721
+ const existingAttributeTypes = ['text', 'ltext'];
7722
+ const newAttributeTypes = ['text', 'ltext', 'number']; // Add more types here
7723
+
7721
7724
  const getFieldName = (parentName, fieldName) => {
7722
7725
  if (!parentName) return fieldName;
7723
7726
  return `${parentName}.${fieldName}`;
7724
7727
  };
7725
- const isTextAttribute = function () {
7728
+ function isAttributeType() {
7726
7729
  let fieldDefinitionType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7727
- return _includesInstanceProperty(textAttributeTypes).call(textAttributeTypes, fieldDefinitionType.name);
7728
- };
7730
+ let isTailoringAttributeForOtherTypes = arguments.length > 1 ? arguments[1] : undefined;
7731
+ const attributeTypes = isTailoringAttributeForOtherTypes ? newAttributeTypes : existingAttributeTypes;
7732
+ return _includesInstanceProperty(attributeTypes).call(attributeTypes, fieldDefinitionType.name);
7733
+ }
7729
7734
  const isNested = fieldDefinition => {
7730
7735
  const type = fieldDefinition.type;
7731
7736
  const typeName = type.name.toLowerCase();
@@ -7745,6 +7750,7 @@ const CustomFieldsInternal = _ref => {
7745
7750
  handleBlur = _useFormikContext.handleBlur,
7746
7751
  status = _useFormikContext.status;
7747
7752
  const isTailoringAttributesEnabled = useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES);
7753
+ const isTailoringAttributeForOtherTypes = useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES_TYPES_OTHER_THAN_TEXT);
7748
7754
  const didFormValidationFail = useDidFormValidationFail();
7749
7755
  const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
7750
7756
  const _useDnDContext = useDnDContext(),
@@ -7758,7 +7764,7 @@ const CustomFieldsInternal = _ref => {
7758
7764
  children: _mapInstanceProperty(fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
7759
7765
  const fieldName = getFieldName(props.name, fieldDefinition.name);
7760
7766
  const isTouched = Boolean(getIn(touched, fieldName));
7761
- const isFieldDisabled = props.isDisabled && !(isTextAttribute(fieldDefinition.type) && isTailoringAttributesEnabled);
7767
+ const isFieldDisabled = props.isDisabled && !(isAttributeType(fieldDefinition.type, isTailoringAttributeForOtherTypes) && isTailoringAttributesEnabled);
7762
7768
  const fieldErrors = getIn(errors, fieldName);
7763
7769
  const value = props.inputValuesConverter(fieldName, getIn(values, fieldName));
7764
7770
 
package/dist/styles.css CHANGED
@@ -40,12 +40,6 @@
40
40
  .validated-input-module__container___3L2KB {
41
41
  display: inline;
42
42
  }
43
- /* imported from label-range.module.css */
44
-
45
- .label-range-module__label___3Tb0p {
46
- font-size: 0.9rem;
47
- font-weight: bold;
48
- }
49
43
  /* imported from multi-value-search-input.module.css */
50
44
 
51
45
  .multi-value-search-input-module__container___2u64d {
@@ -92,17 +86,11 @@
92
86
  border-bottom-left-radius: var(--border-radius-for-input);
93
87
  border-bottom-right-radius: var(--border-radius-for-input);
94
88
  }
95
- /* imported from numeric-format-input.module.css */
96
-
97
- .numeric-format-input-module__invalid___3LcyE {
98
- /* this needs !important because react-select has a :focus style that
99
- stops the border colour being set unless the element is blurred */
100
- border-color: var(--color-error) !important;
101
- border: 1px solid;
102
- }
89
+ /* imported from label-range.module.css */
103
90
 
104
- .numeric-format-input-module__disabled___hb6h4 {
105
- cursor: not-allowed;
91
+ .label-range-module__label___3Tb0p {
92
+ font-size: 0.9rem;
93
+ font-weight: bold;
106
94
  }
107
95
  /* imported from search-input.module.css */
108
96
 
@@ -194,6 +182,18 @@
194
182
  flex-shrink: 1;
195
183
  margin-left: var(--spacing-s);
196
184
  }
185
+ /* imported from numeric-format-input.module.css */
186
+
187
+ .numeric-format-input-module__invalid___3LcyE {
188
+ /* this needs !important because react-select has a :focus style that
189
+ stops the border colour being set unless the element is blurred */
190
+ border-color: var(--color-error) !important;
191
+ border: 1px solid;
192
+ }
193
+
194
+ .numeric-format-input-module__disabled___hb6h4 {
195
+ cursor: not-allowed;
196
+ }
197
197
  /* imported from throttled-field.module.css */
198
198
 
199
199
  .throttled-field-module__size___324jx {
@@ -589,23 +589,23 @@
589
589
  .set-buttons-module__gap___38Qr0 {
590
590
  padding: 20px;
591
591
  }
592
- /* imported from platform-limits-customers-status.module.css */
592
+ /* imported from platform-limits-customer-groups-status.module.css */
593
593
 
594
- .platform-limits-customers-status-module__status___3rXYM {
594
+ .platform-limits-customer-groups-status-module__status___6099G {
595
595
  min-width: max-content;
596
596
  }
597
- /* imported from platform-limits-customers-combined.module.css */
597
+ /* imported from platform-limits-customer-groups-combined.module.css */
598
598
 
599
- .platform-limits-customers-combined-module__combined___OszDd {
599
+ .platform-limits-customer-groups-combined-module__combined___WjRoI {
600
600
  margin-bottom: var(--spacing-s);
601
601
  }
602
- /* imported from platform-limits-customer-groups-status.module.css */
602
+ /* imported from platform-limits-customers-status.module.css */
603
603
 
604
- .platform-limits-customer-groups-status-module__status___6099G {
604
+ .platform-limits-customers-status-module__status___3rXYM {
605
605
  min-width: max-content;
606
606
  }
607
- /* imported from platform-limits-customer-groups-combined.module.css */
607
+ /* imported from platform-limits-customers-combined.module.css */
608
608
 
609
- .platform-limits-customer-groups-combined-module__combined___WjRoI {
609
+ .platform-limits-customers-combined-module__combined___OszDd {
610
610
  margin-bottom: var(--spacing-s);
611
611
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/experimental-components",
3
- "version": "6.3.1",
3
+ "version": "6.3.2",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,12 +48,12 @@
48
48
  "lodash": "4.17.21",
49
49
  "memoize-one": "6.0.0",
50
50
  "moment": "2.30.1",
51
- "moment-timezone": "0.5.45",
51
+ "moment-timezone": "0.5.46",
52
52
  "omit-deep": "0.3.0",
53
53
  "omit-empty-es": "1.2.0",
54
54
  "prop-types": "15.8.1",
55
55
  "react-beautiful-dnd": "13.1.1",
56
- "react-textarea-autosize": "8.5.3",
56
+ "react-textarea-autosize": "8.5.4",
57
57
  "reselect": "4.1.8",
58
58
  "tiny-invariant": "1.3.3",
59
59
  "tiny-warning": "1.0.3",
@@ -71,7 +71,7 @@
71
71
  "formik": "2.4.6",
72
72
  "graphql": "16.9.0",
73
73
  "graphql-tag": "2.12.6",
74
- "msw": "1.3.3",
74
+ "msw": "1.3.5",
75
75
  "react": "17.0.2",
76
76
  "react-dom": "17.0.2",
77
77
  "react-intl": "6.6.8",
@@ -81,8 +81,8 @@
81
81
  "react-test-renderer": "17.0.2",
82
82
  "redux": "4.2.1",
83
83
  "typescript": "5.2.2",
84
- "@commercetools-local/test-data": "1.2.13",
85
- "@commercetools-local/test-utils": "1.2.14"
84
+ "@commercetools-local/test-data": "1.2.14",
85
+ "@commercetools-local/test-utils": "1.2.15"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "@apollo/client": "3.x",