@antscorp/antsomi-ui 1.3.5-beta.973 → 1.3.5-beta.976

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.
@@ -43,15 +43,16 @@ export const DisplayFormatSettings = props => {
43
43
  if (displayFormatType === 'datetime') {
44
44
  formatDFValue = formatDatetimeDF(DATE_TIME_EXAMPLE, settings);
45
45
  }
46
- return (_jsxs("div", { className: "ants-flex ants-items-center ants-mt-1 ants-gap-2 ant-flex-row", style: {
46
+ return (_jsxs("div", { className: "ants-flex ants-items-center ants-gap-2 ant-flex-row", style: {
47
47
  display: 'flex',
48
- alignItems: 'end',
48
+ alignItems: 'center',
49
49
  gap: '8px',
50
50
  marginBottom: '5px',
51
51
  flexShrink: 0,
52
52
  width: '100%',
53
53
  flexWrap: 'nowrap',
54
54
  overflow: 'hidden',
55
+ marginTop: '5px',
55
56
  }, ...rest, children: [_jsxs(Typography.Text
56
57
  // size={11}
57
58
  , {
@@ -65,13 +66,12 @@ export const DisplayFormatSettings = props => {
65
66
  color: '#7F7F7F',
66
67
  fontSize: '11px',
67
68
  whiteSpace: 'nowrap',
68
- maxWidth: 'calc(85%)',
69
+ maxWidth: 'calc(81%)',
69
70
  }, ellipsis: { tooltip: true }, children: _jsx("bdo", { dir: "ltr", children: formatDFValue }) })] }), _jsx(Button, { disabled: disabled, size: "small", icon: _jsx(EditIcon, { width: 16, height: 16, color: "#005EB8" }), className: "ants-border-none",
70
71
  // className={`ants-border-none transition-colors duration-300 rounded-md ${
71
72
  // showDetailEdit ? 'bg-[#DEEFFE]' : 'hover:bg-[#E0F2FE]'
72
73
  // }`}
73
74
  style: {
74
- marginTop: '1px',
75
75
  backgroundColor: showDetailEdit ? '#DEEFFE' : 'transparent',
76
76
  border: 'none',
77
77
  boxShadow: 'none',
@@ -118,12 +118,10 @@ export const FormatNumber = (props) => {
118
118
  }), size: "small", icon: _jsx(DecreaseDecimalIcon, { color: "#005EB8", style: { padding: '2px' } }) }), _jsx(Button, { style: { border: 'none', boxShadow: 'none', borderRadius: '5px' }, onClick: () => onChangeSettingsHandle({
119
119
  ...settingValues,
120
120
  decimalPlaces: decimalPlaces + 1,
121
- }), size: "small", icon: _jsx(IncreaseDecimalIcon, { color: "#005EB8", style: { padding: '2px' } }) })] }) }), _jsx(Form.Item, { label: _jsxs(_Fragment, { children: [_jsx("span", { style: { marginRight: '6px' }, children: translate(translations._DISPLAY_GROUPING) }), _jsx(Tooltip, { placement: "top", title: t(translations.dynamicContent.modal.label.formNumberDisplayFormat
122
- .groupingIconTooltipTitle), style: { marginLeft: 4, opacity: 0.4 }, children: _jsx(ViewDetailsInformationIcon, { size: 14 }) })] }), colon: false, labelCol: { span: 10 }, wrapperCol: { span: 14 }, children: _jsx(Select, { style: { width: 100 }, value: grouping, onChange: value => onChangeSettingsHandle({
121
+ }), size: "small", icon: _jsx(IncreaseDecimalIcon, { color: "#005EB8", style: { padding: '2px' } }) })] }) }), _jsx(Form.Item, { label: _jsxs(_Fragment, { children: [_jsx("span", { style: { marginRight: '6px' }, children: translate(translations._DISPLAY_GROUPING) }), _jsx(Tooltip, { placement: "top", title: translate(translations._TOOLTIP__DISPLAY_DECIMAL), style: { marginLeft: 4, opacity: 0.4 }, children: _jsx(ViewDetailsInformationIcon, { size: 14 }) })] }), colon: false, labelCol: { span: 10 }, wrapperCol: { span: 14 }, children: _jsx(Select, { style: { width: 100 }, value: grouping, onChange: value => onChangeSettingsHandle({
123
122
  ...settingValues,
124
123
  grouping: value,
125
- }), options: listGroupingSeparatorOptions }) }), _jsx(Form.Item, { label: _jsxs(_Fragment, { children: [_jsx("span", { style: { marginRight: '6px' }, children: translate(translations._DISPLAY_DECIMAL) }), _jsx(Tooltip, { placement: "top", title: t(translations.dynamicContent.modal.label.formNumberDisplayFormat
126
- .decimalIconTooltipTitle), style: { marginLeft: 4, opacity: 0.4 }, children: _jsx(ViewDetailsInformationIcon, { size: 14 }) })] }), labelCol: { span: 10 }, wrapperCol: { span: 14 }, colon: false, children: _jsx(Select, { style: { width: 100 }, value: decimal, onChange: value => onChangeSettingsHandle({
124
+ }), options: listGroupingSeparatorOptions }) }), _jsx(Form.Item, { label: _jsxs(_Fragment, { children: [_jsx("span", { style: { marginRight: '6px' }, children: translate(translations._DISPLAY_DECIMAL) }), _jsx(Tooltip, { placement: "top", title: translate(translations._TOOLTIP__DISPLAY_GROUPING), style: { marginLeft: 4, opacity: 0.4 }, children: _jsx(ViewDetailsInformationIcon, { size: 14 }) })] }), labelCol: { span: 10 }, wrapperCol: { span: 14 }, colon: false, children: _jsx(Select, { style: { width: 100 }, value: decimal, onChange: value => onChangeSettingsHandle({
127
125
  ...settingValues,
128
126
  decimal: value,
129
127
  }), options: listDecimalSeparatorOptions }) })] }));
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-cond-assign */
2
2
  /* eslint-disable no-console */
3
3
  // Libraries
4
- import { has } from 'lodash';
4
+ import { get, has } from 'lodash';
5
5
  import { translate, translations } from '@antscorp/antsomi-locales';
6
6
  // Utils
7
7
  import { errorWrapper } from './errorWrapper';
@@ -261,7 +261,7 @@ export const getPersonalizeTagInfo = (originalTag, mapAttributes, mapErrorAttrib
261
261
  true,
262
262
  false,
263
263
  ];
264
- if (!has(mapAttributes, type) && !has(tagProperties, combineAttribute) && !isCsGroup) {
264
+ if (!has(mapAttributes, type) && !has(tagProperties, attributeName) && !isCsGroup) {
265
265
  // return fallback if no mapping
266
266
  return {
267
267
  type,
@@ -279,55 +279,49 @@ export const getPersonalizeTagInfo = (originalTag, mapAttributes, mapErrorAttrib
279
279
  const label = isCsGroup
280
280
  ? getContentSourceLabel(attributeName, subAttributeName, mapAttributes)
281
281
  : getLabelAttribute(type, attributeName, subAttributeName, mapAttributes);
282
- switch (type) {
282
+ const tagType = type === CUSTOM_TAG ? get(tagProperties, [attributeName, 'type']) : type;
283
+ switch (tagType) {
283
284
  case PROMOTION_CODE: {
284
- // Check if the code is exist in the map
285
- const isExistPromotionPool = has(mapAttributes, [type, attributeName]) || has(tagProperties, attributeName);
286
- if (!isExistPromotionPool) {
285
+ if (has(mapErrorAttributes, [tagType, attributeName])) {
287
286
  isValid = false;
288
287
  message = 'This pool does not exist anymore';
289
- if (has(mapErrorAttributes, [type, attributeName])) {
290
- const {
291
- // isEdit = false,
292
- isView = false, isExist = true, isArchived: _isArchived = false, isActive: _isActive = true, isExpired: _isExpired = false, } = mapErrorAttributes?.[type]?.[attributeName] || {};
293
- if (!isExist) {
294
- // Case Pool Removed
295
- isRemoved = !isExist;
296
- message = translate(translations._PERSONALIZATION_TAG_ERR_REMOVED, 'This pool is removed');
297
- }
298
- else if (_isArchived) {
299
- // Case Pool is Archived
300
- isArchived = true;
301
- message = translate(translations._PERSONALIZATION_TAG_ERR_ATT_ARCHIVE, 'This attribute has been archived');
302
- }
303
- else if (!_isActive) {
304
- // Case Pool is Inactive
305
- isActive = false;
306
- message = translate(translations._PERSONALIZATION_TAG_ERR_POOL_DEACTIVATE, 'This pool has been deactivated. You have to turn it on to use');
307
- }
308
- else if (_isExpired) {
309
- // Case Pool is Expired
310
- isExpired = true;
311
- message = translate(translations._PERSONALIZATION_TAG_ERR_POOL_EXPIRE, 'This pool has expired, new codes could not be allocated');
312
- }
313
- else if (!isView) {
314
- // Case Pool Can't View
315
- canView = isView;
316
- message = translate(translations._PERMISSION_ERR_POOL, 'You do not have permission on this pool');
317
- }
288
+ const {
289
+ // isEdit = false,
290
+ isView = false, isExist = true, isArchived: _isArchived = false, isActive: _isActive = true, isExpired: _isExpired = false, } = mapErrorAttributes?.[tagType]?.[attributeName] || {};
291
+ if (!isExist) {
292
+ // Case Pool Removed
293
+ isRemoved = !isExist;
294
+ message = translate(translations._PERSONALIZATION_TAG_ERR_REMOVED, 'This pool is removed');
295
+ }
296
+ else if (_isArchived) {
297
+ // Case Pool is Archived
298
+ isArchived = true;
299
+ message = translate(translations._PERSONALIZATION_TAG_ERR_ATT_ARCHIVE, 'This attribute has been archived');
300
+ }
301
+ else if (!_isActive) {
302
+ // Case Pool is Inactive
303
+ isActive = false;
304
+ message = translate(translations._PERSONALIZATION_TAG_ERR_POOL_DEACTIVATE, 'This pool has been deactivated. You have to turn it on to use');
305
+ }
306
+ else if (_isExpired) {
307
+ // Case Pool is Expired
308
+ isExpired = true;
309
+ message = translate(translations._PERSONALIZATION_TAG_ERR_POOL_EXPIRE, 'This pool has expired, new codes could not be allocated');
310
+ }
311
+ else if (!isView) {
312
+ // Case Pool Can't View
313
+ canView = isView;
314
+ message = translate(translations._PERMISSION_ERR_POOL, 'You do not have permission on this pool');
318
315
  }
319
316
  }
317
+ // }
320
318
  break;
321
319
  }
322
320
  default: {
323
- if (combineAttribute &&
324
- (!has(mapAttributes, [type, combineAttribute]) ||
325
- !has(tagProperties, [type, combineAttribute]))) {
321
+ if (has(mapErrorAttributes, [tagType, combineAttribute])) {
326
322
  isValid = false;
327
323
  message = 'This attribute does not exist anymore';
328
- }
329
- if (has(mapErrorAttributes, [type, combineAttribute])) {
330
- const { isArchived: _isArchived = false, isActive: _isActive = true, isExpired: _isExpired = false, } = mapErrorAttributes?.[type]?.[combineAttribute] || {};
324
+ const { isArchived: _isArchived = false, isActive: _isActive = true, isExpired: _isExpired = false, } = mapErrorAttributes?.[tagType]?.[combineAttribute] || {};
331
325
  if (_isArchived) {
332
326
  // Case Tag is Archived
333
327
  isArchived = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.973",
3
+ "version": "1.3.5-beta.976",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -61,7 +61,7 @@
61
61
  "not op_mini all"
62
62
  ],
63
63
  "dependencies": {
64
- "@antscorp/antsomi-locales": "1.0.33",
64
+ "@antscorp/antsomi-locales": "1.0.34",
65
65
  "@ant-design/cssinjs": "^1.6.2",
66
66
  "@antscorp/icons": "0.27.54",
67
67
  "@antscorp/image-editor": "1.0.2",