@commercetools-frontend/experimental-components 5.3.0 → 5.4.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.
|
@@ -1684,7 +1684,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1684
1684
|
return '';
|
|
1685
1685
|
}
|
|
1686
1686
|
function formatMoneyValue(amount, currency, intl) {
|
|
1687
|
-
return formatMoney$
|
|
1687
|
+
return formatMoney$2(_objectSpread$1l({
|
|
1688
1688
|
centAmount: amount,
|
|
1689
1689
|
fractionDigits: getFractionDigit(currency)
|
|
1690
1690
|
}, currency ? {
|
|
@@ -1699,7 +1699,7 @@ function getFractionedAmount(moneyValue) {
|
|
|
1699
1699
|
const amount = moneyValue.type === PRECISION_TYPES.highPrecision ? moneyValue.preciseAmount : moneyValue.centAmount;
|
|
1700
1700
|
return amount / 10 ** fractionDigits;
|
|
1701
1701
|
}
|
|
1702
|
-
function formatMoney$
|
|
1702
|
+
function formatMoney$2(moneyValue, intl, options) {
|
|
1703
1703
|
var _moneyValue$fractione;
|
|
1704
1704
|
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1l({
|
|
1705
1705
|
style: 'currency',
|
|
@@ -1750,10 +1750,10 @@ const formatLtext = _ref3 => {
|
|
|
1750
1750
|
locale: language
|
|
1751
1751
|
});
|
|
1752
1752
|
};
|
|
1753
|
-
const formatMoney = _ref4 => {
|
|
1753
|
+
const formatMoney$1 = _ref4 => {
|
|
1754
1754
|
let value = _ref4.value,
|
|
1755
1755
|
intl = _ref4.intl;
|
|
1756
|
-
return formatMoney$
|
|
1756
|
+
return formatMoney$2(value, intl);
|
|
1757
1757
|
};
|
|
1758
1758
|
const formatReference = _ref5 => {
|
|
1759
1759
|
let value = _ref5.value;
|
|
@@ -1843,7 +1843,7 @@ const doNotFormat = _ref13 => {
|
|
|
1843
1843
|
let value = _ref13.value;
|
|
1844
1844
|
return value;
|
|
1845
1845
|
};
|
|
1846
|
-
const getFormatter = type => isNil__default["default"](type) ? formatNilType : type.name === 'nested' ? formatNested : type.name === 'set' ? formatSet : type.name === 'enum' ? formatEnum : type.name === 'lenum' ? formatLenum : type.name === 'ltext' ? formatLtext : type.name === 'money' ? formatMoney : type.name === 'reference' ? formatReference : type.name === 'date' ? formatDate : type.name === 'time' ? doNotFormat : type.name === 'datetime' ? formatDateTime : type.name === 'boolean' ? formatBoolean : type.name === 'text' ? doNotFormat : type.name === 'number' ? doNotFormat : formatUnknown;
|
|
1846
|
+
const getFormatter = type => isNil__default["default"](type) ? formatNilType : type.name === 'nested' ? formatNested : type.name === 'set' ? formatSet : type.name === 'enum' ? formatEnum : type.name === 'lenum' ? formatLenum : type.name === 'ltext' ? formatLtext : type.name === 'money' ? formatMoney$1 : type.name === 'reference' ? formatReference : type.name === 'date' ? formatDate : type.name === 'time' ? doNotFormat : type.name === 'datetime' ? formatDateTime : type.name === 'boolean' ? formatBoolean : type.name === 'text' ? doNotFormat : type.name === 'number' ? doNotFormat : formatUnknown;
|
|
1847
1847
|
function formatAttribute(_ref14) {
|
|
1848
1848
|
let type = _ref14.type,
|
|
1849
1849
|
value = _ref14.value,
|
|
@@ -4333,12 +4333,38 @@ const createAttributeTypeValue = attribute => {
|
|
|
4333
4333
|
return attribute.type;
|
|
4334
4334
|
}
|
|
4335
4335
|
};
|
|
4336
|
+
|
|
4337
|
+
/*
|
|
4338
|
+
* Fixed price supports high precision. Action format is nested with the
|
|
4339
|
+
* the type of the money. Absolute discount only works with cent precision,
|
|
4340
|
+
* hence the action structure is flat.
|
|
4341
|
+
*/
|
|
4342
|
+
const formatMoney = valueType => money => {
|
|
4343
|
+
if (valueType === 'fixed') {
|
|
4344
|
+
return {
|
|
4345
|
+
[money.type]: _objectSpread$10({
|
|
4346
|
+
centAmount: money.centAmount,
|
|
4347
|
+
currencyCode: money.currencyCode
|
|
4348
|
+
}, money.type === PRECISION_TYPES.highPrecision && {
|
|
4349
|
+
preciseAmount: money.preciseAmount,
|
|
4350
|
+
fractionDigits: money.fractionDigits
|
|
4351
|
+
})
|
|
4352
|
+
};
|
|
4353
|
+
} else if (valueType === 'absolute') {
|
|
4354
|
+
return {
|
|
4355
|
+
centAmount: money.centAmount,
|
|
4356
|
+
currencyCode: money.currencyCode
|
|
4357
|
+
};
|
|
4358
|
+
} else {
|
|
4359
|
+
throw new Error('Unexpected value type for money.');
|
|
4360
|
+
}
|
|
4361
|
+
};
|
|
4362
|
+
|
|
4336
4363
|
/**
|
|
4337
4364
|
* converts the `changeValue` action to GraphQL actions variable
|
|
4338
4365
|
* @param {Object} actionPayload
|
|
4339
4366
|
*/
|
|
4340
4367
|
const convertChangeValueAction = actionPayload => {
|
|
4341
|
-
var _context2;
|
|
4342
4368
|
const valueType = actionPayload.value.type;
|
|
4343
4369
|
const possibleTypeKeys = {
|
|
4344
4370
|
relative: ['permyriad'],
|
|
@@ -4347,7 +4373,11 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4347
4373
|
giftLineItem: ['product', 'variantId', 'distributionChannel', 'supplyChannel', 'ResourceIdentifierInput']
|
|
4348
4374
|
};
|
|
4349
4375
|
const filteredValue = pick__default["default"](actionPayload.value, possibleTypeKeys[valueType]);
|
|
4350
|
-
if (filteredValue.money)
|
|
4376
|
+
if (filteredValue.money) {
|
|
4377
|
+
var _context2;
|
|
4378
|
+
const moneyFormatter = formatMoney(valueType);
|
|
4379
|
+
filteredValue.money = _mapInstanceProperty__default["default"](_context2 = filteredValue.money).call(_context2, moneyFormatter);
|
|
4380
|
+
}
|
|
4351
4381
|
return {
|
|
4352
4382
|
changeValue: {
|
|
4353
4383
|
value: {
|
|
@@ -4356,6 +4386,7 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4356
4386
|
}
|
|
4357
4387
|
};
|
|
4358
4388
|
};
|
|
4389
|
+
|
|
4359
4390
|
/**
|
|
4360
4391
|
* This function changes any payload after the actions have been computed.
|
|
4361
4392
|
* Currently we only need to change the `setCustomField` action payload
|
|
@@ -7209,6 +7240,13 @@ function CustomInputSet(props) {
|
|
|
7209
7240
|
children: jsxRuntime.jsx(formik.Field, {
|
|
7210
7241
|
name: props.name,
|
|
7211
7242
|
validate: values => {
|
|
7243
|
+
// This validate function overrides the one found in CustomFieldInternal ,
|
|
7244
|
+
// so we need to check if the field is required here.
|
|
7245
|
+
if (props.fieldDefinition.required && isNil__default["default"](dropEmptyEntries(values))) {
|
|
7246
|
+
return {
|
|
7247
|
+
missing: true
|
|
7248
|
+
};
|
|
7249
|
+
}
|
|
7212
7250
|
const errors = getDuplicateErrors(values);
|
|
7213
7251
|
return errors.length > 0 ? errors : undefined;
|
|
7214
7252
|
},
|
|
@@ -8974,7 +9012,7 @@ function formatDiscount(discount, currencyCode, intl) {
|
|
|
8974
9012
|
if (discount.type === 'relative') return "".concat(discount.permyriad / 100, "%");
|
|
8975
9013
|
if (!discount.money) return null;
|
|
8976
9014
|
const moneyForCurrencyCode = _findInstanceProperty__default["default"](_context = discount.money).call(_context, discountMoney => discountMoney.currencyCode === currencyCode);
|
|
8977
|
-
return moneyForCurrencyCode ? formatMoney$
|
|
9015
|
+
return moneyForCurrencyCode ? formatMoney$2(moneyForCurrencyCode, intl) : null;
|
|
8978
9016
|
}
|
|
8979
9017
|
|
|
8980
9018
|
function formatPercentage(percentage) {
|
|
@@ -12622,7 +12660,7 @@ const computedProperties = {
|
|
|
12622
12660
|
intl = _ref4.intl;
|
|
12623
12661
|
const allVariants = _concatInstanceProperty__default["default"](_context2 = product.variants).call(_context2, product.masterVariant);
|
|
12624
12662
|
const variantPrices = flatMap__default["default"](allVariants, variant => variant.prices);
|
|
12625
|
-
return _mapInstanceProperty__default["default"](_context3 = getMinimumPricesByCurrencyCode(variantPrices)).call(_context3, price => formatMoney$
|
|
12663
|
+
return _mapInstanceProperty__default["default"](_context3 = getMinimumPricesByCurrencyCode(variantPrices)).call(_context3, price => formatMoney$2(price, intl)).join(', ') || constants.NO_VALUE_FALLBACK;
|
|
12626
12664
|
},
|
|
12627
12665
|
sku(_ref5) {
|
|
12628
12666
|
var _context4, _context5;
|
|
@@ -12927,13 +12965,18 @@ var messages = reactIntl.defineMessages({
|
|
|
12927
12965
|
id: 'CustomTypesSubform.typesPlaceholder',
|
|
12928
12966
|
description: 'The placeholder for the types',
|
|
12929
12967
|
defaultMessage: 'Select...'
|
|
12968
|
+
},
|
|
12969
|
+
noInputValues: {
|
|
12970
|
+
id: 'CustomTypesSubform.noInputValues',
|
|
12971
|
+
description: 'The label when there are no input values defined for the custom fields.',
|
|
12972
|
+
defaultMessage: 'There are no input values defined for the custom fields.'
|
|
12930
12973
|
}
|
|
12931
12974
|
});
|
|
12932
12975
|
|
|
12933
12976
|
const FIELD_NAME = 'custom';
|
|
12934
12977
|
|
|
12935
12978
|
function ownKeys$2(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; }
|
|
12936
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
12979
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$2(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
12937
12980
|
const typeDefinitionsExist = typeDefinitions => {
|
|
12938
12981
|
return typeDefinitions.length > 0;
|
|
12939
12982
|
};
|
|
@@ -12944,9 +12987,18 @@ const typeDefinitionSelected = formValues => {
|
|
|
12944
12987
|
const typeDefinitionContainsFieldDefinitions = formValues => {
|
|
12945
12988
|
return formValues[FIELD_NAME].type.obj.key && formValues[FIELD_NAME].type.obj.fieldDefinitions.length > 0;
|
|
12946
12989
|
};
|
|
12947
|
-
const
|
|
12948
|
-
|
|
12949
|
-
|
|
12990
|
+
const fieldDefinitionsWithValues = formValues => {
|
|
12991
|
+
var _context;
|
|
12992
|
+
const fieldValues = formValues[FIELD_NAME].fields;
|
|
12993
|
+
return _filterInstanceProperty__default["default"](_context = formValues[FIELD_NAME].type.obj.fieldDefinitions).call(_context, _ref => {
|
|
12994
|
+
let name = _ref.name;
|
|
12995
|
+
return fieldValues[name] !== undefined;
|
|
12996
|
+
});
|
|
12997
|
+
};
|
|
12998
|
+
const CustomFieldsInputWrapper = _ref2 => {
|
|
12999
|
+
let typeDefinitions = _ref2.typeDefinitions,
|
|
13000
|
+
isReadOnly = _ref2.isReadOnly,
|
|
13001
|
+
hideEmptyFields = _ref2.hideEmptyFields;
|
|
12950
13002
|
const _useFormikContext = formik.useFormikContext(),
|
|
12951
13003
|
formValues = _valuesInstanceProperty__default["default"](_useFormikContext);
|
|
12952
13004
|
if (!typeDefinitionsExist(typeDefinitions)) {
|
|
@@ -12958,12 +13010,15 @@ const CustomFieldsInputWrapper = _ref => {
|
|
|
12958
13010
|
if (!typeDefinitionContainsFieldDefinitions(formValues)) {
|
|
12959
13011
|
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages.noCustomFields));
|
|
12960
13012
|
}
|
|
13013
|
+
if (fieldDefinitionsWithValues(formValues).length === 0 && isReadOnly && hideEmptyFields) {
|
|
13014
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages.noInputValues));
|
|
13015
|
+
}
|
|
12961
13016
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
12962
13017
|
max: "scale",
|
|
12963
13018
|
children: jsxRuntime.jsx(CustomFields, {
|
|
12964
13019
|
isReadOnly: isReadOnly,
|
|
12965
13020
|
name: "".concat(FIELD_NAME, ".fields"),
|
|
12966
|
-
fieldDefinitions: formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
13021
|
+
fieldDefinitions: isReadOnly && hideEmptyFields ? fieldDefinitionsWithValues(formValues) : formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
12967
13022
|
})
|
|
12968
13023
|
});
|
|
12969
13024
|
};
|
|
@@ -12997,10 +13052,11 @@ const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
|
12997
13052
|
};
|
|
12998
13053
|
};
|
|
12999
13054
|
const CustomTypeSubform = _ref => {
|
|
13000
|
-
var _formValues$
|
|
13055
|
+
var _formValues$FIELD_NAM3, _formValues$FIELD_NAM4;
|
|
13001
13056
|
let typeDefinitions = _ref.typeDefinitions,
|
|
13002
13057
|
isReadOnly = _ref.isReadOnly,
|
|
13003
|
-
isCondensed = _ref.isCondensed
|
|
13058
|
+
isCondensed = _ref.isCondensed,
|
|
13059
|
+
hideEmptyFields = _ref.hideEmptyFields;
|
|
13004
13060
|
const _useFormikContext = formik.useFormikContext(),
|
|
13005
13061
|
formValues = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
13006
13062
|
setFieldValue = _useFormikContext.setFieldValue,
|
|
@@ -13027,19 +13083,26 @@ const CustomTypeSubform = _ref => {
|
|
|
13027
13083
|
});
|
|
13028
13084
|
}
|
|
13029
13085
|
}, [typeDefinitions, setFieldValue, validateForm]);
|
|
13086
|
+
const typeDefinitionSelected = formValues => {
|
|
13087
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
13088
|
+
return ((_formValues$FIELD_NAM = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM === void 0 ? void 0 : _formValues$FIELD_NAM.type) && ((_formValues$FIELD_NAM2 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM2 === void 0 || (_formValues$FIELD_NAM2 = _formValues$FIELD_NAM2.type) === null || _formValues$FIELD_NAM2 === void 0 ? void 0 : _formValues$FIELD_NAM2.obj);
|
|
13089
|
+
};
|
|
13090
|
+
|
|
13091
|
+
// if the user has read-only permissions, empty fields are hidden, and no type definition is selected, hide the component
|
|
13092
|
+
if (isReadOnly && hideEmptyFields && !typeDefinitionSelected(formValues)) return null;
|
|
13030
13093
|
return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
13031
13094
|
header: jsxRuntime.jsx(uiKit.CollapsiblePanel.Header, {
|
|
13032
13095
|
isCondensed: isCondensed,
|
|
13033
13096
|
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.title))
|
|
13034
13097
|
}),
|
|
13035
13098
|
headerControls: typeDefinitions.length > 0 && jsxRuntime.jsx("div", {
|
|
13036
|
-
css: /*#__PURE__*/react$1.css("min-width:", uiKit.designTokens.constraint11, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomTypeSubform;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
13099
|
+
css: /*#__PURE__*/react$1.css("min-width:", uiKit.designTokens.constraint11, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomTypeSubform;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS10eXBlLXN1YmZvcm0uanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStHb0IiLCJmaWxlIjoiY3VzdG9tLXR5cGUtc3ViZm9ybS5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyB1c2VDYWxsYmFjayB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgeyB1c2VGb3J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YWRlcj5cbiAgICAgIH1cbiAgICAgIGhlYWRlckNvbnRyb2xzPXtcbiAgICAgICAgdHlwZURlZmluaXRpb25zLmxlbmd0aCA+IDAgJiYgKFxuICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgIGNzcz17Y3NzYFxuICAgICAgICAgICAgICBtaW4td2lkdGg6ICR7ZGVzaWduVG9rZW5zLmNvbnN0cmFpbnQxMX07XG4gICAgICAgICAgICBgfVxuICAgICAgICAgID5cbiAgICAgICAgICAgIDxTZWxlY3RJbnB1dFxuICAgICAgICAgICAgICBpc0NsZWFyYWJsZVxuICAgICAgICAgICAgICBkYXRhLXRlc3RpZD1cImN1c3RvbS10eXBlLXNlbGVjdFwiXG4gICAgICAgICAgICAgIG5hbWU9e2Ake0ZJRUxEX05BTUV9LnR5cGUub2JqLmtleWB9XG4gICAgICAgICAgICAgIG9wdGlvbnM9e21hcFR5cGVEZWZpbml0aW9uc1RvT3B0aW9ucyhcbiAgICAgICAgICAgICAgICB0eXBlRGVmaW5pdGlvbnMsXG4gICAgICAgICAgICAgICAgbGFuZ3VhZ2UsXG4gICAgICAgICAgICAgICAgbGFuZ3VhZ2VzLFxuICAgICAgICAgICAgICAgIGZvcm1WYWx1ZXNbRklFTERfTkFNRV0/LnR5cGU/LmlkXG4gICAgICAgICAgICAgICl9XG4gICAgICAgICAgICAgIHZhbHVlPXtmb3JtVmFsdWVzW0ZJRUxEX05BTUVdPy50eXBlPy5vYmo/LmtleX1cbiAgICAgICAgICAgICAgb25DaGFuZ2U9e2hhbmRsZVR5cGVEZWZpbml0aW9uU2VsZWN0fVxuICAgICAgICAgICAgICBwbGFjZWhvbGRlcj17Zm9ybWF0TWVzc2FnZShtZXNzYWdlcy50eXBlc1BsYWNlaG9sZGVyKX1cbiAgICAgICAgICAgICAgaXNSZWFkT25seT17aXNSZWFkT25seX1cbiAgICAgICAgICAgIC8+XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgIClcbiAgICAgIH1cbiAgICAgIGhlYWRlckNvbnRyb2xzQWxpZ25tZW50PVwicmlnaHRcIlxuICAgID5cbiAgICAgIDxDdXN0b21GaWVsZHNJbnB1dFdyYXBwZXJcbiAgICAgICAgdHlwZURlZmluaXRpb25zPXt0eXBlRGVmaW5pdGlvbnN9XG4gICAgICAgIGlzUmVhZE9ubHk9e2lzUmVhZE9ubHl9XG4gICAgICAgIGhpZGVFbXB0eUZpZWxkcz17aGlkZUVtcHR5RmllbGRzfVxuICAgICAgLz5cbiAgICA8L0NvbGxhcHNpYmxlUGFuZWw+XG4gICk7XG59O1xuXG5DdXN0b21UeXBlU3ViZm9ybS5kaXNwbGF5TmFtZSA9ICdDdXN0b21UeXBlU3ViZm9ybSc7XG5DdXN0b21UeXBlU3ViZm9ybS5wcm9wVHlwZXMgPSB7XG4gIHR5cGVEZWZpbml0aW9uczogUHJvcFR5cGVzLmFycmF5LmlzUmVxdWlyZWQsXG4gIGlzUmVhZE9ubHk6IFByb3BUeXBlcy5ib29sLFxuICBpc0NvbmRlbnNlZDogUHJvcFR5cGVzLmJvb2wsXG4gIGhpZGVFbXB0eUZpZWxkczogUHJvcFR5cGVzLmJvb2wsXG59O1xuXG5leHBvcnQgZGVmYXVsdCBDdXN0b21UeXBlU3ViZm9ybTtcbiJdfQ== */"),
|
|
13037
13100
|
children: jsxRuntime.jsx(uiKit.SelectInput, {
|
|
13038
13101
|
isClearable: true,
|
|
13039
13102
|
"data-testid": "custom-type-select",
|
|
13040
13103
|
name: "".concat(FIELD_NAME, ".type.obj.key"),
|
|
13041
|
-
options: mapTypeDefinitionsToOptions(typeDefinitions, language, languages, (_formValues$
|
|
13042
|
-
value: (_formValues$
|
|
13104
|
+
options: mapTypeDefinitionsToOptions(typeDefinitions, language, languages, (_formValues$FIELD_NAM3 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM3 === void 0 || (_formValues$FIELD_NAM3 = _formValues$FIELD_NAM3.type) === null || _formValues$FIELD_NAM3 === void 0 ? void 0 : _formValues$FIELD_NAM3.id),
|
|
13105
|
+
value: (_formValues$FIELD_NAM4 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM4 === void 0 || (_formValues$FIELD_NAM4 = _formValues$FIELD_NAM4.type) === null || _formValues$FIELD_NAM4 === void 0 || (_formValues$FIELD_NAM4 = _formValues$FIELD_NAM4.obj) === null || _formValues$FIELD_NAM4 === void 0 ? void 0 : _formValues$FIELD_NAM4.key,
|
|
13043
13106
|
onChange: handleTypeDefinitionSelect,
|
|
13044
13107
|
placeholder: formatMessage(messages.typesPlaceholder),
|
|
13045
13108
|
isReadOnly: isReadOnly
|
|
@@ -13048,7 +13111,8 @@ const CustomTypeSubform = _ref => {
|
|
|
13048
13111
|
headerControlsAlignment: "right",
|
|
13049
13112
|
children: jsxRuntime.jsx(CustomFieldsInputWrapper, {
|
|
13050
13113
|
typeDefinitions: typeDefinitions,
|
|
13051
|
-
isReadOnly: isReadOnly
|
|
13114
|
+
isReadOnly: isReadOnly,
|
|
13115
|
+
hideEmptyFields: hideEmptyFields
|
|
13052
13116
|
})
|
|
13053
13117
|
});
|
|
13054
13118
|
};
|
|
@@ -13144,7 +13208,8 @@ const createGraphQlDocFromFormState = formState => {
|
|
|
13144
13208
|
const CustomFieldsFormField = _ref => {
|
|
13145
13209
|
let resources = _ref.resources,
|
|
13146
13210
|
isReadOnly = _ref.isReadOnly,
|
|
13147
|
-
isCondensed = _ref.isCondensed
|
|
13211
|
+
isCondensed = _ref.isCondensed,
|
|
13212
|
+
hideEmptyFields = _ref.hideEmptyFields;
|
|
13148
13213
|
const projectKey = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.project.key);
|
|
13149
13214
|
return jsxRuntime.jsx(CustomFieldTypeDefinitionsConnector$1, {
|
|
13150
13215
|
resources: resources,
|
|
@@ -13161,7 +13226,8 @@ const CustomFieldsFormField = _ref => {
|
|
|
13161
13226
|
return jsxRuntime.jsx(CustomTypeSubform, {
|
|
13162
13227
|
typeDefinitions: typeDefinitions,
|
|
13163
13228
|
isReadOnly: isReadOnly,
|
|
13164
|
-
isCondensed: isCondensed
|
|
13229
|
+
isCondensed: isCondensed,
|
|
13230
|
+
hideEmptyFields: hideEmptyFields
|
|
13165
13231
|
});
|
|
13166
13232
|
}
|
|
13167
13233
|
});
|
|
@@ -13248,7 +13314,7 @@ exports.formatCustomerName = formatCustomerName;
|
|
|
13248
13314
|
exports.formatDateRangeValue = formatDateRangeValue;
|
|
13249
13315
|
exports.formatDateTime = formatDateTime$1;
|
|
13250
13316
|
exports.formatDiscount = formatDiscount;
|
|
13251
|
-
exports.formatMoney = formatMoney$
|
|
13317
|
+
exports.formatMoney = formatMoney$2;
|
|
13252
13318
|
exports.formatMoneyRangeValue = formatMoneyRangeValue;
|
|
13253
13319
|
exports.formatMoneyValue = formatMoneyValue;
|
|
13254
13320
|
exports.formatPercentage = formatPercentage;
|
|
@@ -1683,7 +1683,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1683
1683
|
return '';
|
|
1684
1684
|
}
|
|
1685
1685
|
function formatMoneyValue(amount, currency, intl) {
|
|
1686
|
-
return formatMoney$
|
|
1686
|
+
return formatMoney$2(_objectSpread$1l({
|
|
1687
1687
|
centAmount: amount,
|
|
1688
1688
|
fractionDigits: getFractionDigit(currency)
|
|
1689
1689
|
}, currency ? {
|
|
@@ -1698,7 +1698,7 @@ function getFractionedAmount(moneyValue) {
|
|
|
1698
1698
|
const amount = moneyValue.type === PRECISION_TYPES.highPrecision ? moneyValue.preciseAmount : moneyValue.centAmount;
|
|
1699
1699
|
return amount / 10 ** fractionDigits;
|
|
1700
1700
|
}
|
|
1701
|
-
function formatMoney$
|
|
1701
|
+
function formatMoney$2(moneyValue, intl, options) {
|
|
1702
1702
|
var _moneyValue$fractione;
|
|
1703
1703
|
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1l({
|
|
1704
1704
|
style: 'currency',
|
|
@@ -1749,10 +1749,10 @@ const formatLtext = _ref3 => {
|
|
|
1749
1749
|
locale: language
|
|
1750
1750
|
});
|
|
1751
1751
|
};
|
|
1752
|
-
const formatMoney = _ref4 => {
|
|
1752
|
+
const formatMoney$1 = _ref4 => {
|
|
1753
1753
|
let value = _ref4.value,
|
|
1754
1754
|
intl = _ref4.intl;
|
|
1755
|
-
return formatMoney$
|
|
1755
|
+
return formatMoney$2(value, intl);
|
|
1756
1756
|
};
|
|
1757
1757
|
const formatReference = _ref5 => {
|
|
1758
1758
|
let value = _ref5.value;
|
|
@@ -1842,7 +1842,7 @@ const doNotFormat = _ref13 => {
|
|
|
1842
1842
|
let value = _ref13.value;
|
|
1843
1843
|
return value;
|
|
1844
1844
|
};
|
|
1845
|
-
const getFormatter = type => isNil__default["default"](type) ? formatNilType : type.name === 'nested' ? formatNested : type.name === 'set' ? formatSet : type.name === 'enum' ? formatEnum : type.name === 'lenum' ? formatLenum : type.name === 'ltext' ? formatLtext : type.name === 'money' ? formatMoney : type.name === 'reference' ? formatReference : type.name === 'date' ? formatDate : type.name === 'time' ? doNotFormat : type.name === 'datetime' ? formatDateTime : type.name === 'boolean' ? formatBoolean : type.name === 'text' ? doNotFormat : type.name === 'number' ? doNotFormat : formatUnknown;
|
|
1845
|
+
const getFormatter = type => isNil__default["default"](type) ? formatNilType : type.name === 'nested' ? formatNested : type.name === 'set' ? formatSet : type.name === 'enum' ? formatEnum : type.name === 'lenum' ? formatLenum : type.name === 'ltext' ? formatLtext : type.name === 'money' ? formatMoney$1 : type.name === 'reference' ? formatReference : type.name === 'date' ? formatDate : type.name === 'time' ? doNotFormat : type.name === 'datetime' ? formatDateTime : type.name === 'boolean' ? formatBoolean : type.name === 'text' ? doNotFormat : type.name === 'number' ? doNotFormat : formatUnknown;
|
|
1846
1846
|
function formatAttribute(_ref14) {
|
|
1847
1847
|
let type = _ref14.type,
|
|
1848
1848
|
value = _ref14.value,
|
|
@@ -4332,12 +4332,38 @@ const createAttributeTypeValue = attribute => {
|
|
|
4332
4332
|
return attribute.type;
|
|
4333
4333
|
}
|
|
4334
4334
|
};
|
|
4335
|
+
|
|
4336
|
+
/*
|
|
4337
|
+
* Fixed price supports high precision. Action format is nested with the
|
|
4338
|
+
* the type of the money. Absolute discount only works with cent precision,
|
|
4339
|
+
* hence the action structure is flat.
|
|
4340
|
+
*/
|
|
4341
|
+
const formatMoney = valueType => money => {
|
|
4342
|
+
if (valueType === 'fixed') {
|
|
4343
|
+
return {
|
|
4344
|
+
[money.type]: _objectSpread$10({
|
|
4345
|
+
centAmount: money.centAmount,
|
|
4346
|
+
currencyCode: money.currencyCode
|
|
4347
|
+
}, money.type === PRECISION_TYPES.highPrecision && {
|
|
4348
|
+
preciseAmount: money.preciseAmount,
|
|
4349
|
+
fractionDigits: money.fractionDigits
|
|
4350
|
+
})
|
|
4351
|
+
};
|
|
4352
|
+
} else if (valueType === 'absolute') {
|
|
4353
|
+
return {
|
|
4354
|
+
centAmount: money.centAmount,
|
|
4355
|
+
currencyCode: money.currencyCode
|
|
4356
|
+
};
|
|
4357
|
+
} else {
|
|
4358
|
+
throw new Error('Unexpected value type for money.');
|
|
4359
|
+
}
|
|
4360
|
+
};
|
|
4361
|
+
|
|
4335
4362
|
/**
|
|
4336
4363
|
* converts the `changeValue` action to GraphQL actions variable
|
|
4337
4364
|
* @param {Object} actionPayload
|
|
4338
4365
|
*/
|
|
4339
4366
|
const convertChangeValueAction = actionPayload => {
|
|
4340
|
-
var _context2;
|
|
4341
4367
|
const valueType = actionPayload.value.type;
|
|
4342
4368
|
const possibleTypeKeys = {
|
|
4343
4369
|
relative: ['permyriad'],
|
|
@@ -4346,7 +4372,11 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4346
4372
|
giftLineItem: ['product', 'variantId', 'distributionChannel', 'supplyChannel', 'ResourceIdentifierInput']
|
|
4347
4373
|
};
|
|
4348
4374
|
const filteredValue = pick__default["default"](actionPayload.value, possibleTypeKeys[valueType]);
|
|
4349
|
-
if (filteredValue.money)
|
|
4375
|
+
if (filteredValue.money) {
|
|
4376
|
+
var _context2;
|
|
4377
|
+
const moneyFormatter = formatMoney(valueType);
|
|
4378
|
+
filteredValue.money = _mapInstanceProperty__default["default"](_context2 = filteredValue.money).call(_context2, moneyFormatter);
|
|
4379
|
+
}
|
|
4350
4380
|
return {
|
|
4351
4381
|
changeValue: {
|
|
4352
4382
|
value: {
|
|
@@ -4355,6 +4385,7 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4355
4385
|
}
|
|
4356
4386
|
};
|
|
4357
4387
|
};
|
|
4388
|
+
|
|
4358
4389
|
/**
|
|
4359
4390
|
* This function changes any payload after the actions have been computed.
|
|
4360
4391
|
* Currently we only need to change the `setCustomField` action payload
|
|
@@ -7208,6 +7239,13 @@ function CustomInputSet(props) {
|
|
|
7208
7239
|
children: jsxRuntime.jsx(formik.Field, {
|
|
7209
7240
|
name: props.name,
|
|
7210
7241
|
validate: values => {
|
|
7242
|
+
// This validate function overrides the one found in CustomFieldInternal ,
|
|
7243
|
+
// so we need to check if the field is required here.
|
|
7244
|
+
if (props.fieldDefinition.required && isNil__default["default"](dropEmptyEntries(values))) {
|
|
7245
|
+
return {
|
|
7246
|
+
missing: true
|
|
7247
|
+
};
|
|
7248
|
+
}
|
|
7211
7249
|
const errors = getDuplicateErrors(values);
|
|
7212
7250
|
return errors.length > 0 ? errors : undefined;
|
|
7213
7251
|
},
|
|
@@ -8967,7 +9005,7 @@ function formatDiscount(discount, currencyCode, intl) {
|
|
|
8967
9005
|
if (discount.type === 'relative') return "".concat(discount.permyriad / 100, "%");
|
|
8968
9006
|
if (!discount.money) return null;
|
|
8969
9007
|
const moneyForCurrencyCode = _findInstanceProperty__default["default"](_context = discount.money).call(_context, discountMoney => discountMoney.currencyCode === currencyCode);
|
|
8970
|
-
return moneyForCurrencyCode ? formatMoney$
|
|
9008
|
+
return moneyForCurrencyCode ? formatMoney$2(moneyForCurrencyCode, intl) : null;
|
|
8971
9009
|
}
|
|
8972
9010
|
|
|
8973
9011
|
function formatPercentage(percentage) {
|
|
@@ -12607,7 +12645,7 @@ const computedProperties = {
|
|
|
12607
12645
|
intl = _ref4.intl;
|
|
12608
12646
|
const allVariants = _concatInstanceProperty__default["default"](_context2 = product.variants).call(_context2, product.masterVariant);
|
|
12609
12647
|
const variantPrices = flatMap__default["default"](allVariants, variant => variant.prices);
|
|
12610
|
-
return _mapInstanceProperty__default["default"](_context3 = getMinimumPricesByCurrencyCode(variantPrices)).call(_context3, price => formatMoney$
|
|
12648
|
+
return _mapInstanceProperty__default["default"](_context3 = getMinimumPricesByCurrencyCode(variantPrices)).call(_context3, price => formatMoney$2(price, intl)).join(', ') || constants.NO_VALUE_FALLBACK;
|
|
12611
12649
|
},
|
|
12612
12650
|
sku(_ref5) {
|
|
12613
12651
|
var _context4, _context5;
|
|
@@ -12912,13 +12950,18 @@ var messages = reactIntl.defineMessages({
|
|
|
12912
12950
|
id: 'CustomTypesSubform.typesPlaceholder',
|
|
12913
12951
|
description: 'The placeholder for the types',
|
|
12914
12952
|
defaultMessage: 'Select...'
|
|
12953
|
+
},
|
|
12954
|
+
noInputValues: {
|
|
12955
|
+
id: 'CustomTypesSubform.noInputValues',
|
|
12956
|
+
description: 'The label when there are no input values defined for the custom fields.',
|
|
12957
|
+
defaultMessage: 'There are no input values defined for the custom fields.'
|
|
12915
12958
|
}
|
|
12916
12959
|
});
|
|
12917
12960
|
|
|
12918
12961
|
const FIELD_NAME = 'custom';
|
|
12919
12962
|
|
|
12920
12963
|
function ownKeys$2(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; }
|
|
12921
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
12964
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$2(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
12922
12965
|
const typeDefinitionsExist = typeDefinitions => {
|
|
12923
12966
|
return typeDefinitions.length > 0;
|
|
12924
12967
|
};
|
|
@@ -12929,9 +12972,18 @@ const typeDefinitionSelected = formValues => {
|
|
|
12929
12972
|
const typeDefinitionContainsFieldDefinitions = formValues => {
|
|
12930
12973
|
return formValues[FIELD_NAME].type.obj.key && formValues[FIELD_NAME].type.obj.fieldDefinitions.length > 0;
|
|
12931
12974
|
};
|
|
12932
|
-
const
|
|
12933
|
-
|
|
12934
|
-
|
|
12975
|
+
const fieldDefinitionsWithValues = formValues => {
|
|
12976
|
+
var _context;
|
|
12977
|
+
const fieldValues = formValues[FIELD_NAME].fields;
|
|
12978
|
+
return _filterInstanceProperty__default["default"](_context = formValues[FIELD_NAME].type.obj.fieldDefinitions).call(_context, _ref => {
|
|
12979
|
+
let name = _ref.name;
|
|
12980
|
+
return fieldValues[name] !== undefined;
|
|
12981
|
+
});
|
|
12982
|
+
};
|
|
12983
|
+
const CustomFieldsInputWrapper = _ref2 => {
|
|
12984
|
+
let typeDefinitions = _ref2.typeDefinitions,
|
|
12985
|
+
isReadOnly = _ref2.isReadOnly,
|
|
12986
|
+
hideEmptyFields = _ref2.hideEmptyFields;
|
|
12935
12987
|
const _useFormikContext = formik.useFormikContext(),
|
|
12936
12988
|
formValues = _valuesInstanceProperty__default["default"](_useFormikContext);
|
|
12937
12989
|
if (!typeDefinitionsExist(typeDefinitions)) {
|
|
@@ -12943,12 +12995,15 @@ const CustomFieldsInputWrapper = _ref => {
|
|
|
12943
12995
|
if (!typeDefinitionContainsFieldDefinitions(formValues)) {
|
|
12944
12996
|
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages.noCustomFields));
|
|
12945
12997
|
}
|
|
12998
|
+
if (fieldDefinitionsWithValues(formValues).length === 0 && isReadOnly && hideEmptyFields) {
|
|
12999
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages.noInputValues));
|
|
13000
|
+
}
|
|
12946
13001
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
12947
13002
|
max: "scale",
|
|
12948
13003
|
children: jsxRuntime.jsx(CustomFields, {
|
|
12949
13004
|
isReadOnly: isReadOnly,
|
|
12950
13005
|
name: "".concat(FIELD_NAME, ".fields"),
|
|
12951
|
-
fieldDefinitions: formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
13006
|
+
fieldDefinitions: isReadOnly && hideEmptyFields ? fieldDefinitionsWithValues(formValues) : formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
12952
13007
|
})
|
|
12953
13008
|
});
|
|
12954
13009
|
};
|
|
@@ -12982,10 +13037,11 @@ const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
|
12982
13037
|
};
|
|
12983
13038
|
};
|
|
12984
13039
|
const CustomTypeSubform = _ref => {
|
|
12985
|
-
var _formValues$
|
|
13040
|
+
var _formValues$FIELD_NAM3, _formValues$FIELD_NAM4;
|
|
12986
13041
|
let typeDefinitions = _ref.typeDefinitions,
|
|
12987
13042
|
isReadOnly = _ref.isReadOnly,
|
|
12988
|
-
isCondensed = _ref.isCondensed
|
|
13043
|
+
isCondensed = _ref.isCondensed,
|
|
13044
|
+
hideEmptyFields = _ref.hideEmptyFields;
|
|
12989
13045
|
const _useFormikContext = formik.useFormikContext(),
|
|
12990
13046
|
formValues = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
12991
13047
|
setFieldValue = _useFormikContext.setFieldValue,
|
|
@@ -13012,6 +13068,13 @@ const CustomTypeSubform = _ref => {
|
|
|
13012
13068
|
});
|
|
13013
13069
|
}
|
|
13014
13070
|
}, [typeDefinitions, setFieldValue, validateForm]);
|
|
13071
|
+
const typeDefinitionSelected = formValues => {
|
|
13072
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
13073
|
+
return ((_formValues$FIELD_NAM = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM === void 0 ? void 0 : _formValues$FIELD_NAM.type) && ((_formValues$FIELD_NAM2 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM2 === void 0 || (_formValues$FIELD_NAM2 = _formValues$FIELD_NAM2.type) === null || _formValues$FIELD_NAM2 === void 0 ? void 0 : _formValues$FIELD_NAM2.obj);
|
|
13074
|
+
};
|
|
13075
|
+
|
|
13076
|
+
// if the user has read-only permissions, empty fields are hidden, and no type definition is selected, hide the component
|
|
13077
|
+
if (isReadOnly && hideEmptyFields && !typeDefinitionSelected(formValues)) return null;
|
|
13015
13078
|
return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
13016
13079
|
header: jsxRuntime.jsx(uiKit.CollapsiblePanel.Header, {
|
|
13017
13080
|
isCondensed: isCondensed,
|
|
@@ -13023,8 +13086,8 @@ const CustomTypeSubform = _ref => {
|
|
|
13023
13086
|
isClearable: true,
|
|
13024
13087
|
"data-testid": "custom-type-select",
|
|
13025
13088
|
name: "".concat(FIELD_NAME, ".type.obj.key"),
|
|
13026
|
-
options: mapTypeDefinitionsToOptions(typeDefinitions, language, languages, (_formValues$
|
|
13027
|
-
value: (_formValues$
|
|
13089
|
+
options: mapTypeDefinitionsToOptions(typeDefinitions, language, languages, (_formValues$FIELD_NAM3 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM3 === void 0 || (_formValues$FIELD_NAM3 = _formValues$FIELD_NAM3.type) === null || _formValues$FIELD_NAM3 === void 0 ? void 0 : _formValues$FIELD_NAM3.id),
|
|
13090
|
+
value: (_formValues$FIELD_NAM4 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM4 === void 0 || (_formValues$FIELD_NAM4 = _formValues$FIELD_NAM4.type) === null || _formValues$FIELD_NAM4 === void 0 || (_formValues$FIELD_NAM4 = _formValues$FIELD_NAM4.obj) === null || _formValues$FIELD_NAM4 === void 0 ? void 0 : _formValues$FIELD_NAM4.key,
|
|
13028
13091
|
onChange: handleTypeDefinitionSelect,
|
|
13029
13092
|
placeholder: formatMessage(messages.typesPlaceholder),
|
|
13030
13093
|
isReadOnly: isReadOnly
|
|
@@ -13033,7 +13096,8 @@ const CustomTypeSubform = _ref => {
|
|
|
13033
13096
|
headerControlsAlignment: "right",
|
|
13034
13097
|
children: jsxRuntime.jsx(CustomFieldsInputWrapper, {
|
|
13035
13098
|
typeDefinitions: typeDefinitions,
|
|
13036
|
-
isReadOnly: isReadOnly
|
|
13099
|
+
isReadOnly: isReadOnly,
|
|
13100
|
+
hideEmptyFields: hideEmptyFields
|
|
13037
13101
|
})
|
|
13038
13102
|
});
|
|
13039
13103
|
};
|
|
@@ -13129,7 +13193,8 @@ const createGraphQlDocFromFormState = formState => {
|
|
|
13129
13193
|
const CustomFieldsFormField = _ref => {
|
|
13130
13194
|
let resources = _ref.resources,
|
|
13131
13195
|
isReadOnly = _ref.isReadOnly,
|
|
13132
|
-
isCondensed = _ref.isCondensed
|
|
13196
|
+
isCondensed = _ref.isCondensed,
|
|
13197
|
+
hideEmptyFields = _ref.hideEmptyFields;
|
|
13133
13198
|
const projectKey = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.project.key);
|
|
13134
13199
|
return jsxRuntime.jsx(CustomFieldTypeDefinitionsConnector$1, {
|
|
13135
13200
|
resources: resources,
|
|
@@ -13146,7 +13211,8 @@ const CustomFieldsFormField = _ref => {
|
|
|
13146
13211
|
return jsxRuntime.jsx(CustomTypeSubform, {
|
|
13147
13212
|
typeDefinitions: typeDefinitions,
|
|
13148
13213
|
isReadOnly: isReadOnly,
|
|
13149
|
-
isCondensed: isCondensed
|
|
13214
|
+
isCondensed: isCondensed,
|
|
13215
|
+
hideEmptyFields: hideEmptyFields
|
|
13150
13216
|
});
|
|
13151
13217
|
}
|
|
13152
13218
|
});
|
|
@@ -13233,7 +13299,7 @@ exports.formatCustomerName = formatCustomerName;
|
|
|
13233
13299
|
exports.formatDateRangeValue = formatDateRangeValue;
|
|
13234
13300
|
exports.formatDateTime = formatDateTime$1;
|
|
13235
13301
|
exports.formatDiscount = formatDiscount;
|
|
13236
|
-
exports.formatMoney = formatMoney$
|
|
13302
|
+
exports.formatMoney = formatMoney$2;
|
|
13237
13303
|
exports.formatMoneyRangeValue = formatMoneyRangeValue;
|
|
13238
13304
|
exports.formatMoneyValue = formatMoneyValue;
|
|
13239
13305
|
exports.formatPercentage = formatPercentage;
|
|
@@ -1601,7 +1601,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1601
1601
|
return '';
|
|
1602
1602
|
}
|
|
1603
1603
|
function formatMoneyValue(amount, currency, intl) {
|
|
1604
|
-
return formatMoney$
|
|
1604
|
+
return formatMoney$2(_objectSpread$1l({
|
|
1605
1605
|
centAmount: amount,
|
|
1606
1606
|
fractionDigits: getFractionDigit(currency)
|
|
1607
1607
|
}, currency ? {
|
|
@@ -1616,7 +1616,7 @@ function getFractionedAmount(moneyValue) {
|
|
|
1616
1616
|
const amount = moneyValue.type === PRECISION_TYPES.highPrecision ? moneyValue.preciseAmount : moneyValue.centAmount;
|
|
1617
1617
|
return amount / 10 ** fractionDigits;
|
|
1618
1618
|
}
|
|
1619
|
-
function formatMoney$
|
|
1619
|
+
function formatMoney$2(moneyValue, intl, options) {
|
|
1620
1620
|
var _moneyValue$fractione;
|
|
1621
1621
|
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1l({
|
|
1622
1622
|
style: 'currency',
|
|
@@ -1667,10 +1667,10 @@ const formatLtext = _ref3 => {
|
|
|
1667
1667
|
locale: language
|
|
1668
1668
|
});
|
|
1669
1669
|
};
|
|
1670
|
-
const formatMoney = _ref4 => {
|
|
1670
|
+
const formatMoney$1 = _ref4 => {
|
|
1671
1671
|
let value = _ref4.value,
|
|
1672
1672
|
intl = _ref4.intl;
|
|
1673
|
-
return formatMoney$
|
|
1673
|
+
return formatMoney$2(value, intl);
|
|
1674
1674
|
};
|
|
1675
1675
|
const formatReference = _ref5 => {
|
|
1676
1676
|
let value = _ref5.value;
|
|
@@ -1760,7 +1760,7 @@ const doNotFormat = _ref13 => {
|
|
|
1760
1760
|
let value = _ref13.value;
|
|
1761
1761
|
return value;
|
|
1762
1762
|
};
|
|
1763
|
-
const getFormatter = type => isNil$1(type) ? formatNilType : type.name === 'nested' ? formatNested : type.name === 'set' ? formatSet : type.name === 'enum' ? formatEnum : type.name === 'lenum' ? formatLenum : type.name === 'ltext' ? formatLtext : type.name === 'money' ? formatMoney : type.name === 'reference' ? formatReference : type.name === 'date' ? formatDate : type.name === 'time' ? doNotFormat : type.name === 'datetime' ? formatDateTime : type.name === 'boolean' ? formatBoolean : type.name === 'text' ? doNotFormat : type.name === 'number' ? doNotFormat : formatUnknown;
|
|
1763
|
+
const getFormatter = type => isNil$1(type) ? formatNilType : type.name === 'nested' ? formatNested : type.name === 'set' ? formatSet : type.name === 'enum' ? formatEnum : type.name === 'lenum' ? formatLenum : type.name === 'ltext' ? formatLtext : type.name === 'money' ? formatMoney$1 : type.name === 'reference' ? formatReference : type.name === 'date' ? formatDate : type.name === 'time' ? doNotFormat : type.name === 'datetime' ? formatDateTime : type.name === 'boolean' ? formatBoolean : type.name === 'text' ? doNotFormat : type.name === 'number' ? doNotFormat : formatUnknown;
|
|
1764
1764
|
function formatAttribute(_ref14) {
|
|
1765
1765
|
let type = _ref14.type,
|
|
1766
1766
|
value = _ref14.value,
|
|
@@ -4250,12 +4250,38 @@ const createAttributeTypeValue = attribute => {
|
|
|
4250
4250
|
return attribute.type;
|
|
4251
4251
|
}
|
|
4252
4252
|
};
|
|
4253
|
+
|
|
4254
|
+
/*
|
|
4255
|
+
* Fixed price supports high precision. Action format is nested with the
|
|
4256
|
+
* the type of the money. Absolute discount only works with cent precision,
|
|
4257
|
+
* hence the action structure is flat.
|
|
4258
|
+
*/
|
|
4259
|
+
const formatMoney = valueType => money => {
|
|
4260
|
+
if (valueType === 'fixed') {
|
|
4261
|
+
return {
|
|
4262
|
+
[money.type]: _objectSpread$10({
|
|
4263
|
+
centAmount: money.centAmount,
|
|
4264
|
+
currencyCode: money.currencyCode
|
|
4265
|
+
}, money.type === PRECISION_TYPES.highPrecision && {
|
|
4266
|
+
preciseAmount: money.preciseAmount,
|
|
4267
|
+
fractionDigits: money.fractionDigits
|
|
4268
|
+
})
|
|
4269
|
+
};
|
|
4270
|
+
} else if (valueType === 'absolute') {
|
|
4271
|
+
return {
|
|
4272
|
+
centAmount: money.centAmount,
|
|
4273
|
+
currencyCode: money.currencyCode
|
|
4274
|
+
};
|
|
4275
|
+
} else {
|
|
4276
|
+
throw new Error('Unexpected value type for money.');
|
|
4277
|
+
}
|
|
4278
|
+
};
|
|
4279
|
+
|
|
4253
4280
|
/**
|
|
4254
4281
|
* converts the `changeValue` action to GraphQL actions variable
|
|
4255
4282
|
* @param {Object} actionPayload
|
|
4256
4283
|
*/
|
|
4257
4284
|
const convertChangeValueAction = actionPayload => {
|
|
4258
|
-
var _context2;
|
|
4259
4285
|
const valueType = actionPayload.value.type;
|
|
4260
4286
|
const possibleTypeKeys = {
|
|
4261
4287
|
relative: ['permyriad'],
|
|
@@ -4264,7 +4290,11 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4264
4290
|
giftLineItem: ['product', 'variantId', 'distributionChannel', 'supplyChannel', 'ResourceIdentifierInput']
|
|
4265
4291
|
};
|
|
4266
4292
|
const filteredValue = pick(actionPayload.value, possibleTypeKeys[valueType]);
|
|
4267
|
-
if (filteredValue.money)
|
|
4293
|
+
if (filteredValue.money) {
|
|
4294
|
+
var _context2;
|
|
4295
|
+
const moneyFormatter = formatMoney(valueType);
|
|
4296
|
+
filteredValue.money = _mapInstanceProperty(_context2 = filteredValue.money).call(_context2, moneyFormatter);
|
|
4297
|
+
}
|
|
4268
4298
|
return {
|
|
4269
4299
|
changeValue: {
|
|
4270
4300
|
value: {
|
|
@@ -4273,6 +4303,7 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4273
4303
|
}
|
|
4274
4304
|
};
|
|
4275
4305
|
};
|
|
4306
|
+
|
|
4276
4307
|
/**
|
|
4277
4308
|
* This function changes any payload after the actions have been computed.
|
|
4278
4309
|
* Currently we only need to change the `setCustomField` action payload
|
|
@@ -7126,6 +7157,13 @@ function CustomInputSet(props) {
|
|
|
7126
7157
|
children: jsx(Field, {
|
|
7127
7158
|
name: props.name,
|
|
7128
7159
|
validate: values => {
|
|
7160
|
+
// This validate function overrides the one found in CustomFieldInternal ,
|
|
7161
|
+
// so we need to check if the field is required here.
|
|
7162
|
+
if (props.fieldDefinition.required && isNil$1(dropEmptyEntries(values))) {
|
|
7163
|
+
return {
|
|
7164
|
+
missing: true
|
|
7165
|
+
};
|
|
7166
|
+
}
|
|
7129
7167
|
const errors = getDuplicateErrors(values);
|
|
7130
7168
|
return errors.length > 0 ? errors : undefined;
|
|
7131
7169
|
},
|
|
@@ -8891,7 +8929,7 @@ function formatDiscount(discount, currencyCode, intl) {
|
|
|
8891
8929
|
if (discount.type === 'relative') return "".concat(discount.permyriad / 100, "%");
|
|
8892
8930
|
if (!discount.money) return null;
|
|
8893
8931
|
const moneyForCurrencyCode = _findInstanceProperty(_context = discount.money).call(_context, discountMoney => discountMoney.currencyCode === currencyCode);
|
|
8894
|
-
return moneyForCurrencyCode ? formatMoney$
|
|
8932
|
+
return moneyForCurrencyCode ? formatMoney$2(moneyForCurrencyCode, intl) : null;
|
|
8895
8933
|
}
|
|
8896
8934
|
|
|
8897
8935
|
function formatPercentage(percentage) {
|
|
@@ -12539,7 +12577,7 @@ const computedProperties = {
|
|
|
12539
12577
|
intl = _ref4.intl;
|
|
12540
12578
|
const allVariants = _concatInstanceProperty(_context2 = product.variants).call(_context2, product.masterVariant);
|
|
12541
12579
|
const variantPrices = flatMap(allVariants, variant => variant.prices);
|
|
12542
|
-
return _mapInstanceProperty(_context3 = getMinimumPricesByCurrencyCode(variantPrices)).call(_context3, price => formatMoney$
|
|
12580
|
+
return _mapInstanceProperty(_context3 = getMinimumPricesByCurrencyCode(variantPrices)).call(_context3, price => formatMoney$2(price, intl)).join(', ') || NO_VALUE_FALLBACK;
|
|
12543
12581
|
},
|
|
12544
12582
|
sku(_ref5) {
|
|
12545
12583
|
var _context4, _context5;
|
|
@@ -12844,13 +12882,18 @@ var messages = defineMessages({
|
|
|
12844
12882
|
id: 'CustomTypesSubform.typesPlaceholder',
|
|
12845
12883
|
description: 'The placeholder for the types',
|
|
12846
12884
|
defaultMessage: 'Select...'
|
|
12885
|
+
},
|
|
12886
|
+
noInputValues: {
|
|
12887
|
+
id: 'CustomTypesSubform.noInputValues',
|
|
12888
|
+
description: 'The label when there are no input values defined for the custom fields.',
|
|
12889
|
+
defaultMessage: 'There are no input values defined for the custom fields.'
|
|
12847
12890
|
}
|
|
12848
12891
|
});
|
|
12849
12892
|
|
|
12850
12893
|
const FIELD_NAME = 'custom';
|
|
12851
12894
|
|
|
12852
12895
|
function ownKeys$2(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; }
|
|
12853
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
12896
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$2(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$2(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12854
12897
|
const typeDefinitionsExist = typeDefinitions => {
|
|
12855
12898
|
return typeDefinitions.length > 0;
|
|
12856
12899
|
};
|
|
@@ -12861,9 +12904,18 @@ const typeDefinitionSelected = formValues => {
|
|
|
12861
12904
|
const typeDefinitionContainsFieldDefinitions = formValues => {
|
|
12862
12905
|
return formValues[FIELD_NAME].type.obj.key && formValues[FIELD_NAME].type.obj.fieldDefinitions.length > 0;
|
|
12863
12906
|
};
|
|
12864
|
-
const
|
|
12865
|
-
|
|
12866
|
-
|
|
12907
|
+
const fieldDefinitionsWithValues = formValues => {
|
|
12908
|
+
var _context;
|
|
12909
|
+
const fieldValues = formValues[FIELD_NAME].fields;
|
|
12910
|
+
return _filterInstanceProperty(_context = formValues[FIELD_NAME].type.obj.fieldDefinitions).call(_context, _ref => {
|
|
12911
|
+
let name = _ref.name;
|
|
12912
|
+
return fieldValues[name] !== undefined;
|
|
12913
|
+
});
|
|
12914
|
+
};
|
|
12915
|
+
const CustomFieldsInputWrapper = _ref2 => {
|
|
12916
|
+
let typeDefinitions = _ref2.typeDefinitions,
|
|
12917
|
+
isReadOnly = _ref2.isReadOnly,
|
|
12918
|
+
hideEmptyFields = _ref2.hideEmptyFields;
|
|
12867
12919
|
const _useFormikContext = useFormikContext(),
|
|
12868
12920
|
formValues = _valuesInstanceProperty(_useFormikContext);
|
|
12869
12921
|
if (!typeDefinitionsExist(typeDefinitions)) {
|
|
@@ -12875,12 +12927,15 @@ const CustomFieldsInputWrapper = _ref => {
|
|
|
12875
12927
|
if (!typeDefinitionContainsFieldDefinitions(formValues)) {
|
|
12876
12928
|
return jsx(FormattedMessage, _objectSpread$2({}, messages.noCustomFields));
|
|
12877
12929
|
}
|
|
12930
|
+
if (fieldDefinitionsWithValues(formValues).length === 0 && isReadOnly && hideEmptyFields) {
|
|
12931
|
+
return jsx(FormattedMessage, _objectSpread$2({}, messages.noInputValues));
|
|
12932
|
+
}
|
|
12878
12933
|
return jsx(Constraints.Horizontal, {
|
|
12879
12934
|
max: "scale",
|
|
12880
12935
|
children: jsx(CustomFields, {
|
|
12881
12936
|
isReadOnly: isReadOnly,
|
|
12882
12937
|
name: "".concat(FIELD_NAME, ".fields"),
|
|
12883
|
-
fieldDefinitions: formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
12938
|
+
fieldDefinitions: isReadOnly && hideEmptyFields ? fieldDefinitionsWithValues(formValues) : formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
12884
12939
|
})
|
|
12885
12940
|
});
|
|
12886
12941
|
};
|
|
@@ -12914,10 +12969,11 @@ const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
|
12914
12969
|
};
|
|
12915
12970
|
};
|
|
12916
12971
|
const CustomTypeSubform = _ref => {
|
|
12917
|
-
var _formValues$
|
|
12972
|
+
var _formValues$FIELD_NAM3, _formValues$FIELD_NAM4;
|
|
12918
12973
|
let typeDefinitions = _ref.typeDefinitions,
|
|
12919
12974
|
isReadOnly = _ref.isReadOnly,
|
|
12920
|
-
isCondensed = _ref.isCondensed
|
|
12975
|
+
isCondensed = _ref.isCondensed,
|
|
12976
|
+
hideEmptyFields = _ref.hideEmptyFields;
|
|
12921
12977
|
const _useFormikContext = useFormikContext(),
|
|
12922
12978
|
formValues = _valuesInstanceProperty(_useFormikContext),
|
|
12923
12979
|
setFieldValue = _useFormikContext.setFieldValue,
|
|
@@ -12944,19 +13000,26 @@ const CustomTypeSubform = _ref => {
|
|
|
12944
13000
|
});
|
|
12945
13001
|
}
|
|
12946
13002
|
}, [typeDefinitions, setFieldValue, validateForm]);
|
|
13003
|
+
const typeDefinitionSelected = formValues => {
|
|
13004
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
13005
|
+
return ((_formValues$FIELD_NAM = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM === void 0 ? void 0 : _formValues$FIELD_NAM.type) && ((_formValues$FIELD_NAM2 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM2 === void 0 || (_formValues$FIELD_NAM2 = _formValues$FIELD_NAM2.type) === null || _formValues$FIELD_NAM2 === void 0 ? void 0 : _formValues$FIELD_NAM2.obj);
|
|
13006
|
+
};
|
|
13007
|
+
|
|
13008
|
+
// if the user has read-only permissions, empty fields are hidden, and no type definition is selected, hide the component
|
|
13009
|
+
if (isReadOnly && hideEmptyFields && !typeDefinitionSelected(formValues)) return null;
|
|
12947
13010
|
return jsx(CollapsiblePanel, {
|
|
12948
13011
|
header: jsx(CollapsiblePanel.Header, {
|
|
12949
13012
|
isCondensed: isCondensed,
|
|
12950
13013
|
children: jsx(FormattedMessage, _objectSpread$1({}, messages.title))
|
|
12951
13014
|
}),
|
|
12952
13015
|
headerControls: typeDefinitions.length > 0 && jsx("div", {
|
|
12953
|
-
css: /*#__PURE__*/css("min-width:", designTokens.constraint11, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomTypeSubform;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
13016
|
+
css: /*#__PURE__*/css("min-width:", designTokens.constraint11, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomTypeSubform;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS10eXBlLXN1YmZvcm0uanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStHb0IiLCJmaWxlIjoiY3VzdG9tLXR5cGUtc3ViZm9ybS5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyB1c2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ICAgICAgIDxGb3JtYXR0ZWRNZXNzYWdlIHsuLi5tZXNzYWdlcy50aXRsZX0gLz5cbiAgICAgICAgPC9Db2xsYXBzaWJsZVBhbmVsLkhlYWRlcj5cbiAgICAgIH1cbiAgICAgIGhlYWRlckNvbnRyb2xzPXtcbiAgICAgICAgdHlwZURlZmluaXRpb25zLmxlbmd0aCA+IDAgJiYgKFxuICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgIGNzcz17Y3NzYFxuICAgICAgICAgICAgICBtaW4td2lkdGg6ICR7ZGVzaWduVG9rZW5zLmNvbnN0cmFpbnQxMX07XG4gICAgICAgICAgICBgfVxuICAgICAgICAgID5cbiAgICAgICAgICAgIDxTZWxlY3RJbnB1dFxuICAgICAgICAgICAgICBpc0NsZWFyYWJsZVxuICAgICAgICAgICAgICBkYXRhLXRlc3RpZD1cImN1c3RvbS10eXBlLXNlbGVjdFwiXG4gICAgICAgICAgICAgIG5hbWU9e2Ake0ZJRUxEX05BTUV9LnR5cGUub2JqLmtleWB9XG4gICAgICAgICAgICAgIG9wdGlvbnM9e21hcFR5cGVEZWZpbml0aW9uc1RvT3B0aW9ucyhcbiAgICAgICAgICAgICAgICB0eXBlRGVmaW5pdGlvbnMsXG4gICAgICAgICAgICAgICAgbGFuZ3VhZ2UsXG4gICAgICAgICAgICAgICAgbGFuZ3VhZ2VzLFxuICAgICAgICAgICAgICAgIGZvcm1WYWx1ZXNbRklFTERfTkFNRV0/LnR5cGU/LmlkXG4gICAgICAgICAgICAgICl9XG4gICAgICAgICAgICAgIHZhbHVlPXtmb3JtVmFsdWVzW0ZJRUxEX05BTUVdPy50eXBlPy5vYmo/LmtleX1cbiAgICAgICAgICAgICAgb25DaGFuZ2U9e2hhbmRsZVR5cGVEZWZpbml0aW9uU2VsZWN0fVxuICAgICAgICAgICAgICBwbGFjZWhvbGRlcj17Zm9ybWF0TWVzc2FnZShtZXNzYWdlcy50eXBlc1BsYWNlaG9sZGVyKX1cbiAgICAgICAgICAgICAgaXNSZWFkT25seT17aXNSZWFkT25seX1cbiAgICAgICAgICAgIC8+XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgIClcbiAgICAgIH1cbiAgICAgIGhlYWRlckNvbnRyb2xzQWxpZ25tZW50PVwicmlnaHRcIlxuICAgID5cbiAgICAgIDxDdXN0b21GaWVsZHNJbnB1dFdyYXBwZXJcbiAgICAgICAgdHlwZURlZmluaXRpb25zPXt0eXBlRGVmaW5pdGlvbnN9XG4gICAgICAgIGlzUmVhZE9ubHk9e2lzUmVhZE9ubHl9XG4gICAgICAgIGhpZGVFbXB0eUZpZWxkcz17aGlkZUVtcHR5RmllbGRzfVxuICAgICAgLz5cbiAgICA8L0NvbGxhcHNpYmxlUGFuZWw+XG4gICk7XG59O1xuXG5DdXN0b21UeXBlU3ViZm9ybS5kaXNwbGF5TmFtZSA9ICdDdXN0b21UeXBlU3ViZm9ybSc7XG5DdXN0b21UeXBlU3ViZm9ybS5wcm9wVHlwZXMgPSB7XG4gIHR5cGVEZWZpbml0aW9uczogUHJvcFR5cGVzLmFycmF5LmlzUmVxdWlyZWQsXG4gIGlzUmVhZE9ubHk6IFByb3BUeXBlcy5ib29sLFxuICBpc0NvbmRlbnNlZDogUHJvcFR5cGVzLmJvb2wsXG4gIGhpZGVFbXB0eUZpZWxkczogUHJvcFR5cGVzLmJvb2wsXG59O1xuXG5leHBvcnQgZGVmYXVsdCBDdXN0b21UeXBlU3ViZm9ybTtcbiJdfQ== */"),
|
|
12954
13017
|
children: jsx(SelectInput, {
|
|
12955
13018
|
isClearable: true,
|
|
12956
13019
|
"data-testid": "custom-type-select",
|
|
12957
13020
|
name: "".concat(FIELD_NAME, ".type.obj.key"),
|
|
12958
|
-
options: mapTypeDefinitionsToOptions(typeDefinitions, language, languages, (_formValues$
|
|
12959
|
-
value: (_formValues$
|
|
13021
|
+
options: mapTypeDefinitionsToOptions(typeDefinitions, language, languages, (_formValues$FIELD_NAM3 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM3 === void 0 || (_formValues$FIELD_NAM3 = _formValues$FIELD_NAM3.type) === null || _formValues$FIELD_NAM3 === void 0 ? void 0 : _formValues$FIELD_NAM3.id),
|
|
13022
|
+
value: (_formValues$FIELD_NAM4 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM4 === void 0 || (_formValues$FIELD_NAM4 = _formValues$FIELD_NAM4.type) === null || _formValues$FIELD_NAM4 === void 0 || (_formValues$FIELD_NAM4 = _formValues$FIELD_NAM4.obj) === null || _formValues$FIELD_NAM4 === void 0 ? void 0 : _formValues$FIELD_NAM4.key,
|
|
12960
13023
|
onChange: handleTypeDefinitionSelect,
|
|
12961
13024
|
placeholder: formatMessage(messages.typesPlaceholder),
|
|
12962
13025
|
isReadOnly: isReadOnly
|
|
@@ -12965,7 +13028,8 @@ const CustomTypeSubform = _ref => {
|
|
|
12965
13028
|
headerControlsAlignment: "right",
|
|
12966
13029
|
children: jsx(CustomFieldsInputWrapper, {
|
|
12967
13030
|
typeDefinitions: typeDefinitions,
|
|
12968
|
-
isReadOnly: isReadOnly
|
|
13031
|
+
isReadOnly: isReadOnly,
|
|
13032
|
+
hideEmptyFields: hideEmptyFields
|
|
12969
13033
|
})
|
|
12970
13034
|
});
|
|
12971
13035
|
};
|
|
@@ -13061,7 +13125,8 @@ const createGraphQlDocFromFormState = formState => {
|
|
|
13061
13125
|
const CustomFieldsFormField = _ref => {
|
|
13062
13126
|
let resources = _ref.resources,
|
|
13063
13127
|
isReadOnly = _ref.isReadOnly,
|
|
13064
|
-
isCondensed = _ref.isCondensed
|
|
13128
|
+
isCondensed = _ref.isCondensed,
|
|
13129
|
+
hideEmptyFields = _ref.hideEmptyFields;
|
|
13065
13130
|
const projectKey = useApplicationContext(applicationContext => applicationContext.project.key);
|
|
13066
13131
|
return jsx(CustomFieldTypeDefinitionsConnector$1, {
|
|
13067
13132
|
resources: resources,
|
|
@@ -13078,7 +13143,8 @@ const CustomFieldsFormField = _ref => {
|
|
|
13078
13143
|
return jsx(CustomTypeSubform, {
|
|
13079
13144
|
typeDefinitions: typeDefinitions,
|
|
13080
13145
|
isReadOnly: isReadOnly,
|
|
13081
|
-
isCondensed: isCondensed
|
|
13146
|
+
isCondensed: isCondensed,
|
|
13147
|
+
hideEmptyFields: hideEmptyFields
|
|
13082
13148
|
});
|
|
13083
13149
|
}
|
|
13084
13150
|
});
|
|
@@ -13088,4 +13154,4 @@ CustomFieldsFormField.createGraphQlDocFromFormState = createGraphQlDocFromFormSt
|
|
|
13088
13154
|
|
|
13089
13155
|
var CategorySearchPickerOptionFragment = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "CategorySearchPickerOptionFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CategorySearch" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "externalId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "slugAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "parent" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "ancestors" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 685, source: { body: "query SearchCategoryReference($locale: Locale!, $text: String!) {\n categories: categoryAutocomplete(locale: $locale, text: $text) {\n results {\n ...CategorySearchPickerOptionFragment\n }\n }\n}\n\nquery FetchCategoriesByIds($where: String!) {\n categories(where: $where) {\n results {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nfragment CategorySearchPickerOptionFragment on CategorySearch {\n id\n externalId\n nameAllLocales {\n locale\n value\n }\n slugAllLocales {\n locale\n value\n }\n parent {\n nameAllLocales {\n locale\n value\n }\n }\n ancestors {\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
13090
13156
|
|
|
13091
|
-
export { booleanField as BooleanField, Button, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner, ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector, CustomFieldTypeDefinitionsConnector$1 as CustomFieldTypeDefinitionsConnector, CustomFields, CustomFieldsErrorTextNotification, CustomFieldsFormField, CustomerGroupPickerInput, DefaultPageSizes, Divider, EMAIL_REGEX, FileInput, FormattedDateTime$1 as FormattedDateTime, LabelRange, MissingValueField, MultiValueSearchInput, numericFormatInput as NumericFormatInput, PRECISION_TYPES, pimIndexerProvider as PimIndexerProvider, ProductAttributeInput, ProductAttributes, ProductPickerInput, ProductSelectionsPicker as ProductSelectionPicker, RequestCache, RequiredIndicator, ScrollToFieldError, searchInput as SearchInput, SelectableFieldSearchInput, StoreSelectField, StoreSelectInput, ThrottledField, VALIDATOR_INTEGER, VALIDATOR_NUMERIC, VALIDATOR_REQUIRED, WithPimIndexer, allowedProperties, and, attributesMapToNameValuePairs, base64ToString, messages$8 as booleanMessages, buildSearchQuery, businessRoleConstants, messages$r as businessRoleMessages, businessRoleKeys as businessRoles, capitalizeFirst, clone, coerceToInteger, computedProperties, convertApolloNetworkStatusToLoadingState, convertApolloQueryDataToConnectorData, convertProductSelectionFromGraphQl, convertRatioToPercentage, createGraphQlUpdateActions, createNextSortDefinition, createReducer, createResourceReducer, handlers$2 as customFieldDefinitionsMockHanders, customFields as customFieldsTransformer, dateTransformer$1 as dateTransformer, exact, exists, extractErrorFromGraphQlResponse, filterCustomTypeUpdateActionValues, filterDataAttributes, filterEmptyValues, formatCustomField, formatCustomerAddress, formatCustomerName, formatDateRangeValue, formatDateTime$1 as formatDateTime, formatDiscount, formatMoney$
|
|
13157
|
+
export { booleanField as BooleanField, Button, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner, ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector, CustomFieldTypeDefinitionsConnector$1 as CustomFieldTypeDefinitionsConnector, CustomFields, CustomFieldsErrorTextNotification, CustomFieldsFormField, CustomerGroupPickerInput, DefaultPageSizes, Divider, EMAIL_REGEX, FileInput, FormattedDateTime$1 as FormattedDateTime, LabelRange, MissingValueField, MultiValueSearchInput, numericFormatInput as NumericFormatInput, PRECISION_TYPES, pimIndexerProvider as PimIndexerProvider, ProductAttributeInput, ProductAttributes, ProductPickerInput, ProductSelectionsPicker as ProductSelectionPicker, RequestCache, RequiredIndicator, ScrollToFieldError, searchInput as SearchInput, SelectableFieldSearchInput, StoreSelectField, StoreSelectInput, ThrottledField, VALIDATOR_INTEGER, VALIDATOR_NUMERIC, VALIDATOR_REQUIRED, WithPimIndexer, allowedProperties, and, attributesMapToNameValuePairs, base64ToString, messages$8 as booleanMessages, buildSearchQuery, businessRoleConstants, messages$r as businessRoleMessages, businessRoleKeys as businessRoles, capitalizeFirst, clone, coerceToInteger, computedProperties, convertApolloNetworkStatusToLoadingState, convertApolloQueryDataToConnectorData, convertProductSelectionFromGraphQl, convertRatioToPercentage, createGraphQlUpdateActions, createNextSortDefinition, createReducer, createResourceReducer, handlers$2 as customFieldDefinitionsMockHanders, customFields as customFieldsTransformer, dateTransformer$1 as dateTransformer, exact, exists, extractErrorFromGraphQlResponse, filterCustomTypeUpdateActionValues, filterDataAttributes, filterEmptyValues, formatCustomField, formatCustomerAddress, formatCustomerName, formatDateRangeValue, formatDateTime$1 as formatDateTime, formatDiscount, formatMoney$2 as formatMoney, formatMoneyRangeValue, formatMoneyValue, formatPercentage, formatAttribute as formatProductAttribute, getAncestors, getAttributeValueByType, getAttributeValueType, getBulkNotification, getCategoryLevel, getCountsFromBulkSummary, getDiscountValue, getDisplayName, getFractionedAmount, getIndexesOfInvalidValues, getMinimumPricesByCurrencyCode, getNetUnitPrice, getPathName, getPrefixSearchBounds, getPriceChannelName, getReferenceTypeId, getSelectedPrice, getTimeZoneId, getTimeZoneLabel, getTypeNameOfType, graphqlCategoryLevelTransformer, dateTransformer as graphqlDateTransformer, missingLocaleTransformer as graphqlMissingLocaleTransformer, missingTransformer as graphqlMissingTransformer, numberTransformer as graphqlNumberTransformer, graphqlQueryBuilder, referenceTransformer as graphqlReferenceTransformer, textTransformer as graphqlTextTransformer, hasInvalidInputError, hasSemanticError, injectCustomerGroupsPlatformLimits, injectCustomersPlatformLimits, injectDataTablePaginationState, injectModalState$1 as injectModalState, injectNotifications, injectPimIndexer, injectShippingMethodsPlatformLimits, injectStorage, injectTaxCategoriesPlatformLimits, injectModalState as injectToggleState, injectZonesPlatformLimits, isEmptyFilter as isEmpty, isEmptyValue, isUUID, isValidISODate, isValidISODateTime, isValidISOTime, keepDisplayName, mapStoresToOptions, mapTimeZonesToOptions, minusify, messages$7 as missingValueMessages, nameValuePairsToMap, normalizeProductSettings, not, omitDeep, omitSetsOfSets, or, commonPickerMessages as pickerMessages, handlers as platformLimitsMockHandlers, handlers$3 as productSelectionsFetcherMockHandler, handlers$4 as productSelectionsTotalFetcherMockHandler, range, reorderArrayItems, resolveStatusType, safelyAddFallback, sanitize, searchCategories, messages$F as searchInputMessages, setDisplayName, setToArray, shallowEqual, shouldUpdateAttributeInput, slugify, sortDataByIdsArray, sortRequiresLanguage, splitVariantAttributesByConstraint, handlers$5 as storesListConnectorMockHandlers, stringToBase64, swapArrayItems, transformAllToProperNounCase, transformCustomFieldsRawToCustomFields, transformLocalizedFieldsForCategory, truncate, unique, uniqueObjects, useCachedCategoryOptions, useCustomerGroupsPlatformLimits, useCustomersPlatformLimits, useDebouncedPromiseCallback, useFormatLocalizedFieldToString, useLocalizedKeyFallback, usePendingRequests, usePersistedTableConfiguration, usePimIndexer, usePrevious, useProductSelectionsFetcher, useProductSelectionsTotalFetcher, useRoleNotificationEffect, useShippingMethodsLimits as useShippingMethodsPlatformLimits, useStorage, useStoreKeysInDataFences, useStoresListFetcher, useTaxCategoriesLimits as useTaxCategoriesPlatformLimits, useTotalNumberOfStoresFetcher, handlers$1 as useTotalNumberOfStoresFetcherHandlers, validateFilter$2 as validateCustomField, validations as validateCustomFields, validateFilter$1 as validateDate, validateMultiOptionEnum, validateFilter as validateNumber, validateSingleOptionEnum, validateText, validatedInput, messages$K as validationMessages, withPendingRequests, withProps, withRedirectTo, withoutEmptyErrorsByField, wrapDisplayName };
|
package/dist/styles.css
CHANGED
|
@@ -1,67 +1,3 @@
|
|
|
1
|
-
/* imported from multi-value-search-input.module.css */
|
|
2
|
-
|
|
3
|
-
.multi-value-search-input-module__container___2u64d {
|
|
4
|
-
position: relative;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.multi-value-search-input-module__searchInput___363nj input {
|
|
8
|
-
border-color: var(--border-color-for-input);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.multi-value-search-input-module__searchInput___363nj input::placeholder {
|
|
12
|
-
color: var(--font-color-for-input-when-disabled);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.multi-value-search-input-module__submittingTip___2339U {
|
|
16
|
-
margin-top: var(--spacing-xs);
|
|
17
|
-
background: var(--background-color-for-input);
|
|
18
|
-
border: solid 1px var(--border-color-for-input-when-focused);
|
|
19
|
-
border-radius: var(--border-radius-for-input);
|
|
20
|
-
position: relative;
|
|
21
|
-
cursor: default;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.multi-value-search-input-module__submitting-tip-single___1LcNy {
|
|
25
|
-
padding: var(--spacing-s);
|
|
26
|
-
color: var(--font-color-for-input-when-disabled);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.multi-value-search-input-module__submitting-tip-content___IyuVb {
|
|
30
|
-
padding: var(--spacing-s);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.multi-value-search-input-module__submitting-tip-content-separate___3Y_CI {
|
|
34
|
-
padding-top: var(--spacing-s);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.multi-value-search-input-module__submitting-tip-content-hoverable___2TK6S:hover {
|
|
38
|
-
background-color: var(--color-neutral-95);
|
|
39
|
-
border-radius: var(--border-radius-for-input);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.multi-value-search-input-module__submitting-tip-content-separate-hoverable___3VUnV:hover {
|
|
43
|
-
background-color: var(--color-neutral-95);
|
|
44
|
-
border-bottom-left-radius: var(--border-radius-for-input);
|
|
45
|
-
border-bottom-right-radius: var(--border-radius-for-input);
|
|
46
|
-
}
|
|
47
|
-
/* imported from label-range.module.css */
|
|
48
|
-
|
|
49
|
-
.label-range-module__label___3Tb0p {
|
|
50
|
-
font-size: 0.9rem;
|
|
51
|
-
font-weight: bold;
|
|
52
|
-
}
|
|
53
|
-
/* imported from numeric-format-input.module.css */
|
|
54
|
-
|
|
55
|
-
.numeric-format-input-module__invalid___3LcyE {
|
|
56
|
-
/* this needs !important because react-select has a :focus style that
|
|
57
|
-
stops the border colour being set unless the element is blurred */
|
|
58
|
-
border-color: var(--color-error) !important;
|
|
59
|
-
border: 1px solid;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.numeric-format-input-module__disabled___hb6h4 {
|
|
63
|
-
cursor: not-allowed;
|
|
64
|
-
}
|
|
65
1
|
/* imported from search-input.module.css */
|
|
66
2
|
|
|
67
3
|
.search-input-module__block___1uM-y {
|
|
@@ -189,6 +125,70 @@
|
|
|
189
125
|
.validated-input-module__container___3L2KB {
|
|
190
126
|
display: inline;
|
|
191
127
|
}
|
|
128
|
+
/* imported from label-range.module.css */
|
|
129
|
+
|
|
130
|
+
.label-range-module__label___3Tb0p {
|
|
131
|
+
font-size: 0.9rem;
|
|
132
|
+
font-weight: bold;
|
|
133
|
+
}
|
|
134
|
+
/* imported from multi-value-search-input.module.css */
|
|
135
|
+
|
|
136
|
+
.multi-value-search-input-module__container___2u64d {
|
|
137
|
+
position: relative;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.multi-value-search-input-module__searchInput___363nj input {
|
|
141
|
+
border-color: var(--border-color-for-input);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.multi-value-search-input-module__searchInput___363nj input::placeholder {
|
|
145
|
+
color: var(--font-color-for-input-when-disabled);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.multi-value-search-input-module__submittingTip___2339U {
|
|
149
|
+
margin-top: var(--spacing-xs);
|
|
150
|
+
background: var(--background-color-for-input);
|
|
151
|
+
border: solid 1px var(--border-color-for-input-when-focused);
|
|
152
|
+
border-radius: var(--border-radius-for-input);
|
|
153
|
+
position: relative;
|
|
154
|
+
cursor: default;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.multi-value-search-input-module__submitting-tip-single___1LcNy {
|
|
158
|
+
padding: var(--spacing-s);
|
|
159
|
+
color: var(--font-color-for-input-when-disabled);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.multi-value-search-input-module__submitting-tip-content___IyuVb {
|
|
163
|
+
padding: var(--spacing-s);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.multi-value-search-input-module__submitting-tip-content-separate___3Y_CI {
|
|
167
|
+
padding-top: var(--spacing-s);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.multi-value-search-input-module__submitting-tip-content-hoverable___2TK6S:hover {
|
|
171
|
+
background-color: var(--color-neutral-95);
|
|
172
|
+
border-radius: var(--border-radius-for-input);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.multi-value-search-input-module__submitting-tip-content-separate-hoverable___3VUnV:hover {
|
|
176
|
+
background-color: var(--color-neutral-95);
|
|
177
|
+
border-bottom-left-radius: var(--border-radius-for-input);
|
|
178
|
+
border-bottom-right-radius: var(--border-radius-for-input);
|
|
179
|
+
}
|
|
180
|
+
/* imported from numeric-format-input.module.css */
|
|
181
|
+
|
|
182
|
+
.numeric-format-input-module__invalid___3LcyE {
|
|
183
|
+
/* this needs !important because react-select has a :focus style that
|
|
184
|
+
stops the border colour being set unless the element is blurred */
|
|
185
|
+
border-color: var(--color-error) !important;
|
|
186
|
+
border: 1px solid;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.numeric-format-input-module__disabled___hb6h4 {
|
|
190
|
+
cursor: not-allowed;
|
|
191
|
+
}
|
|
192
192
|
/* imported from throttled-field.module.css */
|
|
193
193
|
|
|
194
194
|
.throttled-field-module__size___324jx {
|
|
@@ -261,6 +261,42 @@
|
|
|
261
261
|
border-bottom-left-radius: 0;
|
|
262
262
|
margin-left: 0;
|
|
263
263
|
}
|
|
264
|
+
/* imported from file-input.module.css */
|
|
265
|
+
|
|
266
|
+
/** Button */
|
|
267
|
+
|
|
268
|
+
.file-input-module__button___2KypN {
|
|
269
|
+
display: inline-flex;
|
|
270
|
+
background-color: var(--color-surface);
|
|
271
|
+
border: var(--border-for-button-as-secondary);
|
|
272
|
+
box-shadow: none;
|
|
273
|
+
border-radius: var(--border-radius-4);
|
|
274
|
+
color: var(--color-solid);
|
|
275
|
+
height: var(--height-for-button-as-big);
|
|
276
|
+
font-size: var(--font-size-20);
|
|
277
|
+
font-weight: var(--font-weight-500);
|
|
278
|
+
align-items: center;
|
|
279
|
+
transition: background-color var(--transition-linear-80ms);
|
|
280
|
+
padding: 0 var(--spacing-m);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.file-input-module__button___2KypN:hover,
|
|
284
|
+
.file-input-module__button___2KypN:focus {
|
|
285
|
+
cursor: pointer;
|
|
286
|
+
background-color: var(--background-color-for-button-when-hovered);
|
|
287
|
+
box-shadow: none;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.file-input-module__button___2KypN:active {
|
|
291
|
+
box-shadow: var(--shadow-9);
|
|
292
|
+
background-color: var(--color-surface);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.file-input-module__input___3MP4D {
|
|
296
|
+
visibility: hidden;
|
|
297
|
+
width: 1px;
|
|
298
|
+
height: 1px;
|
|
299
|
+
}
|
|
264
300
|
/* imported from button.module.css */
|
|
265
301
|
|
|
266
302
|
/* Generic button */
|
|
@@ -464,42 +500,6 @@
|
|
|
464
500
|
.button-module__add-button___1f093 {
|
|
465
501
|
min-height: 32px;
|
|
466
502
|
}
|
|
467
|
-
/* imported from file-input.module.css */
|
|
468
|
-
|
|
469
|
-
/** Button */
|
|
470
|
-
|
|
471
|
-
.file-input-module__button___2KypN {
|
|
472
|
-
display: inline-flex;
|
|
473
|
-
background-color: var(--color-surface);
|
|
474
|
-
border: var(--border-for-button-as-secondary);
|
|
475
|
-
box-shadow: none;
|
|
476
|
-
border-radius: var(--border-radius-4);
|
|
477
|
-
color: var(--color-solid);
|
|
478
|
-
height: var(--height-for-button-as-big);
|
|
479
|
-
font-size: var(--font-size-20);
|
|
480
|
-
font-weight: var(--font-weight-500);
|
|
481
|
-
align-items: center;
|
|
482
|
-
transition: background-color var(--transition-linear-80ms);
|
|
483
|
-
padding: 0 var(--spacing-m);
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
.file-input-module__button___2KypN:hover,
|
|
487
|
-
.file-input-module__button___2KypN:focus {
|
|
488
|
-
cursor: pointer;
|
|
489
|
-
background-color: var(--background-color-for-button-when-hovered);
|
|
490
|
-
box-shadow: none;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
.file-input-module__button___2KypN:active {
|
|
494
|
-
box-shadow: var(--shadow-9);
|
|
495
|
-
background-color: var(--color-surface);
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
.file-input-module__input___3MP4D {
|
|
499
|
-
visibility: hidden;
|
|
500
|
-
width: 1px;
|
|
501
|
-
height: 1px;
|
|
502
|
-
}
|
|
503
503
|
/* imported from centered-loading-spinner.module.css */
|
|
504
504
|
|
|
505
505
|
.centered-loading-spinner-module__loading-container___3_9-h {
|
|
@@ -556,23 +556,23 @@
|
|
|
556
556
|
.set-buttons-module__gap___38Qr0 {
|
|
557
557
|
padding: 20px;
|
|
558
558
|
}
|
|
559
|
-
/* imported from platform-limits-
|
|
559
|
+
/* imported from platform-limits-customer-groups-status.module.css */
|
|
560
560
|
|
|
561
|
-
.platform-limits-
|
|
561
|
+
.platform-limits-customer-groups-status-module__status___6099G {
|
|
562
562
|
min-width: max-content;
|
|
563
563
|
}
|
|
564
|
-
/* imported from platform-limits-
|
|
564
|
+
/* imported from platform-limits-customer-groups-combined.module.css */
|
|
565
565
|
|
|
566
|
-
.platform-limits-
|
|
566
|
+
.platform-limits-customer-groups-combined-module__combined___WjRoI {
|
|
567
567
|
margin-bottom: var(--spacing-s);
|
|
568
568
|
}
|
|
569
|
-
/* imported from platform-limits-
|
|
569
|
+
/* imported from platform-limits-customers-status.module.css */
|
|
570
570
|
|
|
571
|
-
.platform-limits-
|
|
571
|
+
.platform-limits-customers-status-module__status___3rXYM {
|
|
572
572
|
min-width: max-content;
|
|
573
573
|
}
|
|
574
|
-
/* imported from platform-limits-
|
|
574
|
+
/* imported from platform-limits-customers-combined.module.css */
|
|
575
575
|
|
|
576
|
-
.platform-limits-
|
|
576
|
+
.platform-limits-customers-combined-module__combined___OszDd {
|
|
577
577
|
margin-bottom: var(--spacing-s);
|
|
578
578
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/experimental-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/commercetools-frontend-experimental-components.cjs.js",
|
|
6
6
|
"module": "dist/commercetools-frontend-experimental-components.esm.js",
|
|
@@ -11,78 +11,77 @@
|
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@babel/core": "^7.22.11",
|
|
14
|
-
"@babel/runtime-corejs3": "^7.21.0",
|
|
15
14
|
"@babel/runtime": "^7.21.0",
|
|
15
|
+
"@babel/runtime-corejs3": "^7.21.0",
|
|
16
16
|
"@commercetools-frontend/actions-global": "^22.7.1",
|
|
17
17
|
"@commercetools-frontend/application-components": "^22.7.1",
|
|
18
|
-
"@commercetools-frontend/application-shell-connectors": "^22.7.1",
|
|
19
18
|
"@commercetools-frontend/application-shell": "^22.7.1",
|
|
19
|
+
"@commercetools-frontend/application-shell-connectors": "^22.7.1",
|
|
20
20
|
"@commercetools-frontend/constants": "^22.7.1",
|
|
21
21
|
"@commercetools-frontend/l10n": "^22.7.1",
|
|
22
22
|
"@commercetools-frontend/sdk": "^22.7.1",
|
|
23
23
|
"@commercetools-frontend/sentry": "^22.7.1",
|
|
24
|
-
"@commercetools-frontend/ui-kit": "^16.7.
|
|
25
|
-
"@commercetools-uikit/design-system": "^16.7.
|
|
26
|
-
"@commercetools-uikit/select-utils": "^16.7.
|
|
27
|
-
"@commercetools-uikit/utils": "^16.7.
|
|
28
|
-
"@emotion/react": "^11.
|
|
24
|
+
"@commercetools-frontend/ui-kit": "^16.7.4",
|
|
25
|
+
"@commercetools-uikit/design-system": "^16.7.4",
|
|
26
|
+
"@commercetools-uikit/select-utils": "^16.7.4",
|
|
27
|
+
"@commercetools-uikit/utils": "^16.7.4",
|
|
28
|
+
"@emotion/react": "^11.11.1",
|
|
29
29
|
"classnames": "2.3.2",
|
|
30
30
|
"cleave.js": "1.5.10",
|
|
31
31
|
"common-tags": "1.8.2",
|
|
32
32
|
"debounce-promise": "3.1.2",
|
|
33
33
|
"fast-equals": "4.0.3",
|
|
34
|
-
"formik": "2.4.
|
|
34
|
+
"formik": "2.4.5",
|
|
35
35
|
"hoist-non-react-statics": "3.3.2",
|
|
36
36
|
"lodash": "4.17.21",
|
|
37
37
|
"memoize-one": "6.0.0",
|
|
38
|
-
"moment-timezone": "0.5.43",
|
|
39
38
|
"moment": "2.29.4",
|
|
39
|
+
"moment-timezone": "0.5.43",
|
|
40
40
|
"omit-deep": "0.3.0",
|
|
41
41
|
"omit-empty-es": "1.2.0",
|
|
42
42
|
"prop-types": "^15.8.1",
|
|
43
|
-
"react-textarea-autosize": "8.5.
|
|
43
|
+
"react-textarea-autosize": "8.5.3",
|
|
44
44
|
"reselect": "4.1.8",
|
|
45
45
|
"tiny-invariant": "1.3.1",
|
|
46
46
|
"tiny-warning": "1.0.3",
|
|
47
|
-
"
|
|
48
|
-
"uuid": "9.0.0"
|
|
47
|
+
"uuid": "9.0.1"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
50
|
"@apollo/client": "^3.7.10",
|
|
52
51
|
"@commercetools-test-data/channel": "^5.0.0",
|
|
53
52
|
"@commercetools-test-data/commons": "^5.0.0",
|
|
54
53
|
"@commercetools-test-data/core": "^4.11.1",
|
|
55
|
-
"@testing-library/react-hooks": "^8.0.1",
|
|
56
54
|
"@testing-library/react": "^12.1.5",
|
|
55
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
57
56
|
"enzyme": "^3.11.0",
|
|
58
|
-
"graphql-tag": "^2.12.6",
|
|
59
57
|
"graphql": "^16.6.0",
|
|
60
|
-
"
|
|
58
|
+
"graphql-tag": "^2.12.6",
|
|
59
|
+
"msw": "^1.3.0",
|
|
60
|
+
"react": "^17.0.2",
|
|
61
61
|
"react-dom": "^17.0.2",
|
|
62
|
-
"react-intl": "^6.4.
|
|
62
|
+
"react-intl": "^6.4.5",
|
|
63
63
|
"react-redux": "^7.2.9",
|
|
64
64
|
"react-required-if": "^1.0.3",
|
|
65
65
|
"react-router-dom": "^5.3.4",
|
|
66
66
|
"react-test-renderer": "^17.0.2",
|
|
67
|
-
"react": "^17.0.2",
|
|
68
67
|
"redux": "^4.2.1",
|
|
69
|
-
"typescript": "
|
|
68
|
+
"typescript": "5.1.6",
|
|
70
69
|
"xhr-mock": "^2.5.1",
|
|
71
|
-
"@commercetools-local/test-data": "1.2.
|
|
72
|
-
"@commercetools-local/test-utils": "1.2.
|
|
70
|
+
"@commercetools-local/test-data": "1.2.1",
|
|
71
|
+
"@commercetools-local/test-utils": "1.2.1"
|
|
73
72
|
},
|
|
74
73
|
"peerDependencies": {
|
|
75
74
|
"@apollo/client": "3.x",
|
|
76
75
|
"@testing-library/react": "12.x",
|
|
77
76
|
"@testing-library/react-hooks": "8.x",
|
|
77
|
+
"msw": "1.x.x",
|
|
78
78
|
"react": "17.x",
|
|
79
79
|
"react-dom": "17.x",
|
|
80
80
|
"react-intl": "6.x",
|
|
81
81
|
"react-redux": "7.x",
|
|
82
|
+
"react-required-if": "1.x.x",
|
|
82
83
|
"react-router-dom": "5.x",
|
|
83
|
-
"redux": "4.x"
|
|
84
|
-
"msw": "1.x.x",
|
|
85
|
-
"react-required-if": "1.x.x"
|
|
84
|
+
"redux": "4.x"
|
|
86
85
|
},
|
|
87
86
|
"publishConfig": {
|
|
88
87
|
"access": "public"
|