@antscorp/antsomi-ui 1.3.5-beta.965 → 1.3.5-beta.967

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.
@@ -8,8 +8,8 @@ import SelectTag from './SelectTag';
8
8
  import { defaultProps } from './constants';
9
9
  export const SelectAssociatedTag = (props) => {
10
10
  // Props
11
- const { tagConfigs, style, selected, options, children, onSelect } = props;
11
+ const { tagConfigs, style, selected, disabled, options, children, onSelect } = props;
12
12
  const { tag, value } = selected || {};
13
- return (_jsxs(StyledSpace, { className: "select-associated-tag", style: style, children: [_jsx(SelectTag, { ...tagConfigs, selectedTag: tag }), _jsx(Divider, { type: "vertical", style: { margin: '0px 1px 0px 6px' } }), children ?? (_jsx(Select, { style: { width: '100%', height: '100%' }, value: value, options: options, onChange: onSelect }))] }));
13
+ return (_jsxs(StyledSpace, { className: "select-associated-tag", style: style, children: [_jsx(SelectTag, { ...tagConfigs, selectedTag: tag }), _jsx(Divider, { type: "vertical", style: { margin: '0px 1px 0px 6px' }, className: "antsomi-divider-between-select" }), children ?? (_jsx(Select, { style: { width: '100%', height: '100%' }, value: value, disabled: disabled, options: options, onChange: onSelect }))] }));
14
14
  };
15
15
  SelectAssociatedTag.defaultProps = defaultProps;
@@ -8,7 +8,7 @@ import { Popover } from '../Popover';
8
8
  import { SelectedTag } from './styled';
9
9
  const SelectTag = (props) => {
10
10
  // Props
11
- const { selectedTag, title, options, onSelect } = props;
11
+ const { selectedTag, disabled, title, options, onSelect } = props;
12
12
  // State
13
13
  const [open, setOpen] = useState(false);
14
14
  // Memoized
@@ -21,6 +21,6 @@ const SelectTag = (props) => {
21
21
  setOpen(false);
22
22
  onSelect(item);
23
23
  };
24
- return (_jsx(Popover, { open: open, title: _jsx(Typography.Text, { style: { fontWeight: '400', maxWidth: 130 }, ellipsis: { tooltip: title }, children: title }), content: _jsx(Flex, { wrap: "wrap", gap: 6, style: { padding: '10px 0px' }, children: options?.map(item => (_jsx(SelectedTag, { "$color": item.color, "$background": item.background, ellipsis: { tooltip: item.label }, onClick: () => handleClick(item), children: item.label }, item.value))) }), placement: "bottomLeft", trigger: "click", overlayInnerStyle: { padding: 10, maxWidth: 150 }, onOpenChange: handleOpenChange, children: _jsx(SelectedTag, { "$color": selectedItem?.color, "$background": selectedItem?.background, ellipsis: { tooltip: selectedItem?.label }, children: selectedItem?.label }) }));
24
+ return (_jsx(Popover, { open: open && !disabled, title: _jsx(Typography.Text, { style: { fontWeight: '400', maxWidth: 130 }, ellipsis: { tooltip: title }, children: title }), content: _jsx(Flex, { wrap: "wrap", gap: 6, style: { padding: '10px 0px' }, children: options?.map(item => (_jsx(SelectedTag, { "$color": item.color, "$background": item.background, ellipsis: { tooltip: item.label }, onClick: () => handleClick(item), children: item.label }, item.value))) }), placement: "bottomLeft", trigger: "click", overlayInnerStyle: { padding: 10, maxWidth: 150 }, onOpenChange: handleOpenChange, children: _jsx(SelectedTag, { "$color": selectedItem?.color, "$background": selectedItem?.background, ellipsis: { tooltip: selectedItem?.label }, children: selectedItem?.label }) }));
25
25
  };
26
26
  export default memo(SelectTag);
@@ -9,6 +9,7 @@ export type TagItem = {
9
9
  export interface TagConfigProps {
10
10
  selectedTag: TagItem['value'];
11
11
  title?: string;
12
+ disabled?: boolean;
12
13
  options: TagItem[];
13
14
  onSelect: (newItem: TagItem) => void;
14
15
  }
@@ -41,6 +42,11 @@ export interface SelectAssociatedTagProps {
41
42
  */
42
43
  value: Dictionary<SelectOption>;
43
44
  };
45
+ /**
46
+ * Whether the SelectAssociatedTag is disabled.
47
+ * @type {boolean}
48
+ */
49
+ disabled?: boolean;
44
50
  /**
45
51
  * A list of selectable options.
46
52
  * @type {SelectOption[]}
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { PayloadInfo } from '@antscorp/antsomi-ui/es/types';
2
3
  export type TDisplayFormat = 'number' | 'percentage' | 'currency' | 'datetime';
3
4
  type DisplayFormatProps = {
@@ -3,29 +3,29 @@ import { PayloadInfo } from '@antscorp/antsomi-ui/es/types';
3
3
  declare const groupingOptions: {
4
4
  readonly COMMA: {
5
5
  readonly index: 0;
6
- readonly label: `${string} ( , )`;
6
+ readonly label: string;
7
7
  readonly value: ",";
8
8
  };
9
9
  readonly DOT: {
10
10
  readonly index: 1;
11
- readonly label: "Dot ( . )";
11
+ readonly label: string;
12
12
  readonly value: ".";
13
13
  };
14
14
  readonly NONE: {
15
15
  readonly index: 2;
16
- readonly label: "None";
16
+ readonly label: string;
17
17
  readonly value: "none";
18
18
  };
19
19
  };
20
20
  declare const decimalOptions: {
21
21
  readonly COMMA: {
22
22
  readonly index: 0;
23
- readonly label: `${string} ( , )`;
23
+ readonly label: string;
24
24
  readonly value: ",";
25
25
  };
26
26
  readonly DOT: {
27
27
  readonly index: 1;
28
- readonly label: "Dot ( . )";
28
+ readonly label: string;
29
29
  readonly value: ".";
30
30
  };
31
31
  };
@@ -74,29 +74,29 @@ export declare const ATTRIBUTE_NUMBERIC_FORMAT_OPTION: {
74
74
  readonly DECIMAL_SEPARATOR: {
75
75
  readonly COMMA: {
76
76
  readonly index: 0;
77
- readonly label: `${string} ( , )`;
77
+ readonly label: string;
78
78
  readonly value: ",";
79
79
  };
80
80
  readonly DOT: {
81
81
  readonly index: 1;
82
- readonly label: "Dot ( . )";
82
+ readonly label: string;
83
83
  readonly value: ".";
84
84
  };
85
85
  };
86
86
  readonly GROUPING_SEPARATOR: {
87
87
  readonly COMMA: {
88
88
  readonly index: 0;
89
- readonly label: `${string} ( , )`;
89
+ readonly label: string;
90
90
  readonly value: ",";
91
91
  };
92
92
  readonly DOT: {
93
93
  readonly index: 1;
94
- readonly label: "Dot ( . )";
94
+ readonly label: string;
95
95
  readonly value: ".";
96
96
  };
97
97
  readonly NONE: {
98
98
  readonly index: 2;
99
- readonly label: "None";
99
+ readonly label: string;
100
100
  readonly value: "none";
101
101
  };
102
102
  };
@@ -54,7 +54,7 @@ export const DYNAMIC_CONTENT_TYPE = {
54
54
  };
55
55
  export const DYNAMIC_CONTENT_ATTR_DF_TYPE = [
56
56
  {
57
- label: translate(translations._DATA_TYPE_NUMBER),
57
+ label: translate(translations._TITL_NUMBER),
58
58
  value: 'number',
59
59
  dataType: 'number',
60
60
  },
@@ -69,7 +69,7 @@ export const DYNAMIC_CONTENT_ATTR_DF_TYPE = [
69
69
  dataType: 'number',
70
70
  },
71
71
  {
72
- label: translate(translations._DATA_TYPE_DATETIME),
72
+ label: translate(translations._TITL_DATE_TIME_DEFAULT_FORMAT),
73
73
  value: 'datetime',
74
74
  dataType: 'datetime',
75
75
  },
@@ -122,29 +122,29 @@ export const ATTRIBUTE_NUMBERIC_FORMAT_OPTION = {
122
122
  DECIMAL_SEPARATOR: {
123
123
  COMMA: {
124
124
  index: 0,
125
- label: `${translate(translations._OPTION_COMMA)} ( , )`,
125
+ label: translate(translations._PERSONALIZE_PROCESS_CODE_DELIMETER_1),
126
126
  value: ',',
127
127
  },
128
128
  DOT: {
129
129
  index: 1,
130
- label: 'Dot ( . )',
130
+ label: translate(translations._PERSONALIZE_PROCESS_CODE_DELIMETER_2),
131
131
  value: '.',
132
132
  },
133
133
  },
134
134
  GROUPING_SEPARATOR: {
135
135
  COMMA: {
136
136
  index: 0,
137
- label: `${translate(translations._OPTION_COMMA)} ( , )`,
137
+ label: translate(translations._PERSONALIZE_PROCESS_CODE_DELIMETER_1),
138
138
  value: ',',
139
139
  },
140
140
  DOT: {
141
141
  index: 1,
142
- label: 'Dot ( . )',
142
+ label: translate(translations._PERSONALIZE_PROCESS_CODE_DELIMETER_2),
143
143
  value: '.',
144
144
  },
145
145
  NONE: {
146
146
  index: 2,
147
- label: 'None',
147
+ label: translate(translations._TITL_NONE),
148
148
  value: 'none',
149
149
  },
150
150
  },
@@ -1,4 +1,5 @@
1
1
  import dayjs from 'dayjs';
2
+ import 'dayjs/locale/vi';
2
3
  import type { TDatetimeFormatSetting, TNumberFormatSettings } from './components';
3
4
  import { LabeledTreeValue, LabeledValue } from '../AddDynamicContent';
4
5
  export declare function getStringFormatDateDF(formatSettings: TDatetimeFormatSetting): string;
@@ -3,6 +3,7 @@
3
3
  import dayjs from 'dayjs';
4
4
  import currencyFormatter from 'currency-formatter';
5
5
  import { has, get, set } from 'lodash';
6
+ import 'dayjs/locale/vi';
6
7
  // Json
7
8
  import Currencies from './currencies.json';
8
9
  // Constants
@@ -3,4 +3,5 @@
3
3
  * Asynchronously loads the component for TemplateListing
4
4
  *
5
5
  */
6
+ /// <reference types="react" />
6
7
  export declare const TemplateListing: (props: import("./types").TemplateListingProps<{}>) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.965",
3
+ "version": "1.3.5-beta.967",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",