@antscorp/antsomi-ui 1.3.5-beta.980 → 1.3.5-beta.981
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/atoms/Typography/EllipsisMiddle.d.ts +7 -0
- package/es/components/atoms/Typography/EllipsisMiddle.js +9 -0
- package/es/components/atoms/Typography/index.d.ts +1 -0
- package/es/components/atoms/Typography/index.js +1 -0
- package/es/components/atoms/index.d.ts +1 -1
- package/es/components/atoms/index.js +1 -1
- package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.d.ts +1 -0
- package/es/components/molecules/DisplayFormat/DisplayFormatSettings.js +15 -21
- package/es/components/molecules/DisplayFormat/components/FormatNumber.js +2 -2
- package/es/components/template/TemplateListing/Loadable.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Typography } from 'antd';
|
|
3
|
+
export const EllipsisMiddle = ({ suffixCount, children, tooltip = false, style }) => {
|
|
4
|
+
if (children.length <= suffixCount)
|
|
5
|
+
return _jsx(Typography.Text, { style: style, children: children });
|
|
6
|
+
const start = children.slice(0, children.length - suffixCount);
|
|
7
|
+
const suffix = children.slice(-suffixCount);
|
|
8
|
+
return (_jsx(Typography.Text, { style: { maxWidth: '100%', ...style }, ellipsis: { tooltip: tooltip ? children : false, suffix }, children: start }));
|
|
9
|
+
};
|
|
@@ -6,7 +6,7 @@ export { Radio, RadioGroupSub, RadioButton } from './Radio';
|
|
|
6
6
|
export { Space } from './Space';
|
|
7
7
|
export { Tag } from './Tag';
|
|
8
8
|
export { Tooltip } from './Tooltip';
|
|
9
|
-
export { Typography } from './Typography';
|
|
9
|
+
export { Typography, EllipsisMiddle } from './Typography';
|
|
10
10
|
export { Checkbox } from './Checkbox';
|
|
11
11
|
export { message } from './Message';
|
|
12
12
|
export { Segmented } from './Segmented';
|
|
@@ -6,7 +6,7 @@ export { Radio, RadioGroupSub, RadioButton } from './Radio';
|
|
|
6
6
|
export { Space } from './Space';
|
|
7
7
|
export { Tag } from './Tag';
|
|
8
8
|
export { Tooltip } from './Tooltip';
|
|
9
|
-
export { Typography } from './Typography';
|
|
9
|
+
export { Typography, EllipsisMiddle } from './Typography';
|
|
10
10
|
export { Checkbox } from './Checkbox';
|
|
11
11
|
export { message } from './Message';
|
|
12
12
|
export { Segmented } from './Segmented';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// Libraries
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { translate, translations } from '@antscorp/antsomi-locales';
|
|
5
5
|
// Components
|
|
6
6
|
import { FormatDatetime, FormatNumber, } from './components';
|
|
7
7
|
import { EditIcon } from '../../icons';
|
|
8
|
-
import { Button, Typography } from '../../atoms';
|
|
8
|
+
import { Button, EllipsisMiddle, Typography } from '../../atoms';
|
|
9
9
|
// Utils
|
|
10
10
|
import { formatDatetimeDF, formatNumberDF } from './utils';
|
|
11
11
|
// Constants
|
|
@@ -53,31 +53,25 @@ export const DisplayFormatSettings = props => {
|
|
|
53
53
|
flexWrap: 'nowrap',
|
|
54
54
|
overflow: 'hidden',
|
|
55
55
|
marginTop: '5px',
|
|
56
|
-
}, ...rest, children: [_jsxs(Typography.Text
|
|
57
|
-
// size={11}
|
|
58
|
-
, {
|
|
59
|
-
// size={11}
|
|
60
|
-
className: "ants-flex", style: {
|
|
56
|
+
}, ...rest, children: [_jsxs(Typography.Text, { className: "ants-flex", style: {
|
|
61
57
|
color: '#7F7F7F',
|
|
62
58
|
fontSize: '11px',
|
|
63
59
|
whiteSpace: 'nowrap',
|
|
64
|
-
maxWidth: '
|
|
65
|
-
}, children: [translate(translations._ACT_PREVIEW), ": \u00A0", _jsx(
|
|
60
|
+
maxWidth: '100%',
|
|
61
|
+
}, children: [translate(translations._ACT_PREVIEW), ": \u00A0"] }), _jsxs("div", { style: { display: 'inline-flex', maxWidth: '100%', alignItems: 'center' }, children: [_jsx(EllipsisMiddle, { style: {
|
|
66
62
|
color: '#7F7F7F',
|
|
67
63
|
fontSize: '11px',
|
|
68
64
|
whiteSpace: 'nowrap',
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
flexShrink: 0,
|
|
80
|
-
}, onClick: () => setShowDetailEdit(prevShow => !prevShow) })] }));
|
|
65
|
+
flexShrink: 0,
|
|
66
|
+
width: '100%',
|
|
67
|
+
maxWidth: displayFormatType === 'datetime' ? '100%' : 'calc(98% + 1px)',
|
|
68
|
+
}, suffixCount: 7, tooltip: true, children: formatDFValue }), _jsx(Button, { disabled: disabled, size: "small", icon: _jsx(EditIcon, { width: 16, height: 16, color: "#005EB8" }), className: "ants-border-none", style: {
|
|
69
|
+
backgroundColor: showDetailEdit ? '#DEEFFE' : 'transparent',
|
|
70
|
+
border: 'none',
|
|
71
|
+
boxShadow: 'none',
|
|
72
|
+
borderRadius: '5px',
|
|
73
|
+
flexShrink: 0,
|
|
74
|
+
}, onClick: () => setShowDetailEdit(prevShow => !prevShow) })] })] }));
|
|
81
75
|
};
|
|
82
76
|
const renderFormatSetting = () => {
|
|
83
77
|
switch (displayFormatType) {
|
|
@@ -112,13 +112,13 @@ export const FormatNumber = (props) => {
|
|
|
112
112
|
...settingValues,
|
|
113
113
|
isCompact: checked,
|
|
114
114
|
});
|
|
115
|
-
}, children: translate(translations._TITL_EDIT_NUMBER_COMPACT) }) }), _jsx(Form.Item, { label: decimalPlacesLabel, style: { marginBottom: 12 }, colon: false, labelCol: { span:
|
|
115
|
+
}, children: translate(translations._TITL_EDIT_NUMBER_COMPACT) }) }), _jsx(Form.Item, { label: decimalPlacesLabel, style: { marginBottom: 12 }, colon: false, labelCol: { span: 12 }, wrapperCol: { span: 12 }, children: _jsxs("div", { style: { display: 'flex', marginLeft: '55px', gap: '15px' }, children: [_jsx(Button, { style: { border: 'none', boxShadow: 'none', borderRadius: '5px' }, disabled: decimalPlaces <= 0, onClick: () => onChangeSettingsHandle({
|
|
116
116
|
...settingValues,
|
|
117
117
|
decimalPlaces: decimalPlaces - 1,
|
|
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: 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({
|
|
121
|
+
}), disabled: decimalPlaces >= 100, 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({
|
|
122
122
|
...settingValues,
|
|
123
123
|
grouping: value,
|
|
124
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({
|