es-grid-template 1.5.13 → 1.5.15
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/collapse/index.d.ts +4 -0
- package/es/collapse/index.js +2 -0
- package/es/date-range-picker/index.d.ts +4 -0
- package/es/date-range-picker/index.js +2 -0
- package/es/datepicker/index.d.ts +4 -0
- package/es/datepicker/index.js +2 -0
- package/es/dropdown/index.d.ts +4 -0
- package/es/dropdown/index.js +2 -0
- package/es/grid-component/InternalTable.js +12 -4
- package/es/grid-component/TableGrid.js +19 -6
- package/es/grid-component/hooks/columns/index.js +12 -2
- package/es/grid-component/hooks/content/HeaderContent.d.ts +2 -0
- package/es/grid-component/hooks/content/HeaderContent.js +16 -5
- package/es/grid-component/hooks/utils.d.ts +5 -0
- package/es/grid-component/hooks/utils.js +60 -1
- package/es/grid-component/styles.scss +27 -0
- package/es/grid-component/table/GridEdit.js +278 -239
- package/es/grid-component/type.d.ts +25 -2
- package/es/index.d.ts +12 -0
- package/es/index.js +7 -1
- package/es/select/index.d.ts +4 -0
- package/es/select/index.js +2 -0
- package/es/select-table/index.d.ts +4 -0
- package/es/select-table/index.js +2 -0
- package/es/splitter/index.d.ts +4 -0
- package/es/splitter/index.js +2 -0
- package/es/tree-select/index.d.ts +4 -0
- package/es/tree-select/index.js +2 -0
- package/lib/collapse/index.d.ts +4 -0
- package/lib/collapse/index.js +8 -0
- package/lib/date-range-picker/index.d.ts +4 -0
- package/lib/date-range-picker/index.js +9 -0
- package/lib/datepicker/index.d.ts +4 -0
- package/lib/datepicker/index.js +9 -0
- package/lib/dropdown/index.d.ts +4 -0
- package/lib/dropdown/index.js +9 -0
- package/lib/grid-component/InternalTable.js +12 -4
- package/lib/grid-component/TableGrid.js +19 -6
- package/lib/grid-component/hooks/columns/index.js +12 -2
- package/lib/grid-component/hooks/content/HeaderContent.d.ts +2 -0
- package/lib/grid-component/hooks/content/HeaderContent.js +16 -5
- package/lib/grid-component/hooks/utils.d.ts +5 -0
- package/lib/grid-component/hooks/utils.js +66 -5
- package/lib/grid-component/styles.scss +27 -0
- package/lib/grid-component/table/GridEdit.js +277 -238
- package/lib/grid-component/type.d.ts +25 -2
- package/lib/index.d.ts +12 -0
- package/lib/index.js +43 -1
- package/lib/select/index.d.ts +4 -0
- package/lib/select/index.js +8 -0
- package/lib/select-table/index.d.ts +4 -0
- package/lib/select-table/index.js +9 -0
- package/lib/splitter/index.d.ts +4 -0
- package/lib/splitter/index.js +8 -0
- package/lib/tree-select/index.d.ts +4 -0
- package/lib/tree-select/index.js +8 -0
- package/package.json +2 -2
|
@@ -8,6 +8,7 @@ import type { ItemType } from "rc-master-ui/es/menu/interface";
|
|
|
8
8
|
import type { FieldNames, FilterFunc } from "rc-select/es/Select";
|
|
9
9
|
import type { ColorPickerProps } from "antd";
|
|
10
10
|
import type { FixedType } from "rc-base-table/lib/interface";
|
|
11
|
+
import type { TableLocale } from "rc-master-ui/lib/table/interface";
|
|
11
12
|
export type IColumnType = "number" | "time" | "date" | "week" | "month" | "file" | "quarter" | "year" | "datetime" | "string" | "boolean" | "checkbox" | "color" | null | undefined;
|
|
12
13
|
export type AnyObject = Record<PropertyKey, any>;
|
|
13
14
|
export type SelectMode = 'checkbox' | 'radio' | undefined;
|
|
@@ -67,7 +68,7 @@ export type IEditSelectSettings = {
|
|
|
67
68
|
[key: string]: string;
|
|
68
69
|
} | null;
|
|
69
70
|
formatOptionLabel?: (option: any) => ReactNode | ReactElement;
|
|
70
|
-
loadOptions?: (search: string, callback: (newOptions: any[]) => void) => void;
|
|
71
|
+
loadOptions?: (search: string, callback: (newOptions: any[]) => void, args?: LoadOptionsArgs) => void;
|
|
71
72
|
isMulti?: boolean;
|
|
72
73
|
closeMenuOnSelect?: boolean;
|
|
73
74
|
menuWidth?: number;
|
|
@@ -132,6 +133,7 @@ export type ColumnTable<RecordType = AnyObject> = Omit<RcColumnType<RecordType>,
|
|
|
132
133
|
min?: number;
|
|
133
134
|
editSelectSettings?: IEditSelectSettings;
|
|
134
135
|
fixedType?: FixedType;
|
|
136
|
+
headerTextWrap?: boolean;
|
|
135
137
|
};
|
|
136
138
|
export type ColumnTemplate<RecordType> = {
|
|
137
139
|
value: any;
|
|
@@ -140,10 +142,26 @@ export type ColumnTemplate<RecordType> = {
|
|
|
140
142
|
field: string;
|
|
141
143
|
};
|
|
142
144
|
export type ColumnsTable<RecordType = AnyObject> = ColumnTable<RecordType>[];
|
|
143
|
-
export
|
|
145
|
+
export type Locale = TableLocale & {
|
|
146
|
+
ok_btn: string;
|
|
147
|
+
cancel_btn: string;
|
|
148
|
+
add_rows: string;
|
|
149
|
+
add_rows_before: string;
|
|
150
|
+
add_rows_after: string;
|
|
151
|
+
add_1: string;
|
|
152
|
+
add_10: string;
|
|
153
|
+
add_50: string;
|
|
154
|
+
add_100: string;
|
|
155
|
+
add_children: string;
|
|
156
|
+
delete_content: string;
|
|
157
|
+
delete_rows: string;
|
|
158
|
+
custom: string;
|
|
159
|
+
};
|
|
160
|
+
export interface TableProps<RecordType = AnyObject> extends Omit<RcTableProps<RecordType>, 'columns' | 'rowSelection' | 'loading' | 'dataSource' | 'summary' | 'pagination' | 'locale'> {
|
|
144
161
|
editAble?: boolean;
|
|
145
162
|
infiniteScroll?: boolean;
|
|
146
163
|
next?: () => void;
|
|
164
|
+
locale?: Locale;
|
|
147
165
|
groupAble?: boolean;
|
|
148
166
|
groupColumns?: string[];
|
|
149
167
|
groupSetting?: IGroupSetting;
|
|
@@ -208,6 +226,7 @@ export interface TableProps<RecordType = AnyObject> extends Omit<RcTableProps<Re
|
|
|
208
226
|
key: string;
|
|
209
227
|
rowData: any;
|
|
210
228
|
}) => void;
|
|
229
|
+
wrapSettings?: IWrapSettings;
|
|
211
230
|
}
|
|
212
231
|
export type PaginationConfig = TablePaginationConfig & {
|
|
213
232
|
currentPage?: number;
|
|
@@ -319,4 +338,8 @@ export type CommandSettings = {
|
|
|
319
338
|
client?: boolean;
|
|
320
339
|
confirmDialog?: boolean;
|
|
321
340
|
};
|
|
341
|
+
export type IWrapMode = 'Header' | 'Both' | 'Content';
|
|
342
|
+
export type IWrapSettings = {
|
|
343
|
+
wrapMode?: IWrapMode;
|
|
344
|
+
};
|
|
322
345
|
export {};
|
package/es/index.d.ts
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
export { default as Dropdown } from './dropdown';
|
|
2
|
+
export type { DropdownProps as DropDownProps, DropdownProps, } from './dropdown';
|
|
1
3
|
export { default as GridComponent } from './grid-component';
|
|
2
4
|
export type { ColumnsTable, TableProps, ColumnTable, CommandItem, ToolbarItem, ContextMenuItem } from './grid-component';
|
|
3
5
|
export { default as Tabs } from './tabs';
|
|
4
6
|
export type { TabPaneProps, TabsProps } from './tabs';
|
|
7
|
+
export { default as SelectTable } from './select-table';
|
|
8
|
+
export type { TableSelectProps as SelectTableProps } from './select-table';
|
|
9
|
+
export { default as DateRangePicker } from './date-range-picker';
|
|
10
|
+
export type { DateRangePickerProps } from './date-range-picker';
|
|
11
|
+
export { default as DatePicker } from './datepicker';
|
|
12
|
+
export type { DatePickerType, DatePickerProps } from './datepicker';
|
|
13
|
+
export { default as Splitter } from './splitter';
|
|
14
|
+
export type { SplitterProps } from './splitter';
|
|
15
|
+
export { default as Collapse } from './collapse';
|
|
16
|
+
export type { CollapsePanelProps, CollapseProps } from './collapse';
|
package/es/index.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
export { default as Dropdown } from "./dropdown";
|
|
1
2
|
export { default as GridComponent } from "./grid-component";
|
|
2
|
-
export { default as Tabs } from "./tabs";
|
|
3
|
+
export { default as Tabs } from "./tabs";
|
|
4
|
+
export { default as SelectTable } from "./select-table";
|
|
5
|
+
export { default as DateRangePicker } from "./date-range-picker";
|
|
6
|
+
export { default as DatePicker } from "./datepicker";
|
|
7
|
+
export { default as Splitter } from "./splitter";
|
|
8
|
+
export { default as Collapse } from "./collapse";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _dateRangePicker = _interopRequireDefault(require("rc-master-ui/es/date-range-picker"));
|
|
9
|
+
var _default = exports.default = _dateRangePicker.default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _DatePicker = _interopRequireDefault(require("rc-master-ui/es/DatePicker"));
|
|
9
|
+
var _default = exports.default = _DatePicker.default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _dropdown = _interopRequireDefault(require("rc-master-ui/es/dropdown"));
|
|
9
|
+
var _default = exports.default = _dropdown.default;
|
|
@@ -190,6 +190,7 @@ const InternalTable = props => {
|
|
|
190
190
|
height: propsHeight,
|
|
191
191
|
summary,
|
|
192
192
|
infiniteScroll,
|
|
193
|
+
wrapSettings,
|
|
193
194
|
...rest
|
|
194
195
|
} = props;
|
|
195
196
|
const id = _react.default.useMemo(() => {
|
|
@@ -388,7 +389,8 @@ const InternalTable = props => {
|
|
|
388
389
|
...column
|
|
389
390
|
},
|
|
390
391
|
t: t,
|
|
391
|
-
id: id
|
|
392
|
+
id: id,
|
|
393
|
+
wrapSettings: wrapSettings
|
|
392
394
|
})),
|
|
393
395
|
ellipsis: column.ellipsis !== false,
|
|
394
396
|
align: column.textAlign ?? column.align,
|
|
@@ -403,7 +405,9 @@ const InternalTable = props => {
|
|
|
403
405
|
column: {
|
|
404
406
|
...column
|
|
405
407
|
},
|
|
406
|
-
t: t
|
|
408
|
+
t: t,
|
|
409
|
+
id: id,
|
|
410
|
+
wrapSettings: wrapSettings
|
|
407
411
|
}),
|
|
408
412
|
onCell: data => ({
|
|
409
413
|
// className: 'cell-number',
|
|
@@ -426,7 +430,9 @@ const InternalTable = props => {
|
|
|
426
430
|
column: {
|
|
427
431
|
...column
|
|
428
432
|
},
|
|
429
|
-
t: t
|
|
433
|
+
t: t,
|
|
434
|
+
id: id,
|
|
435
|
+
wrapSettings: wrapSettings
|
|
430
436
|
}),
|
|
431
437
|
onCell: data => ({
|
|
432
438
|
// className: 'cell-number',
|
|
@@ -547,7 +553,9 @@ const InternalTable = props => {
|
|
|
547
553
|
column: {
|
|
548
554
|
...column
|
|
549
555
|
},
|
|
550
|
-
t: t
|
|
556
|
+
t: t,
|
|
557
|
+
id: id,
|
|
558
|
+
wrapSettings: wrapSettings
|
|
551
559
|
})),
|
|
552
560
|
ellipsis: column.ellipsis !== false,
|
|
553
561
|
align: column.textAlign ?? column.align,
|
|
@@ -322,13 +322,26 @@ const TableGrid = props => {
|
|
|
322
322
|
rowData: selectedRow
|
|
323
323
|
});
|
|
324
324
|
} else {
|
|
325
|
+
const keySet = new Set(keys);
|
|
326
|
+
|
|
325
327
|
// @ts-ignore
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
328
|
+
if (!keySet.has(selectedRow[rowKey])) {
|
|
329
|
+
setMergedSelectedKeys([]);
|
|
330
|
+
rowSelected?.({
|
|
331
|
+
selected: [],
|
|
332
|
+
type: 'rowSelected',
|
|
333
|
+
rowData: selectedRow
|
|
334
|
+
});
|
|
335
|
+
} else {
|
|
336
|
+
// @ts-ignore
|
|
337
|
+
setMergedSelectedKeys([selectedRow[rowKey]]);
|
|
338
|
+
rowSelected?.({
|
|
339
|
+
// @ts-ignore
|
|
340
|
+
selected: [selectedRow[rowKey]],
|
|
341
|
+
type: 'rowSelected',
|
|
342
|
+
rowData: selectedRow
|
|
343
|
+
});
|
|
344
|
+
}
|
|
332
345
|
}
|
|
333
346
|
}
|
|
334
347
|
};
|
|
@@ -78,8 +78,8 @@ const getValueCell = (column, value, record, format) => {
|
|
|
78
78
|
// const contentNumber = !isEmpty(value) ? ((dec || dec === 0) ? parseFloat(Number(value).toFixed(dec)).toString() : value.toString()) : '0'
|
|
79
79
|
|
|
80
80
|
const tmpval = typeof value === 'string' ? Number(value) : value;
|
|
81
|
-
|
|
82
|
-
//
|
|
81
|
+
|
|
82
|
+
// console.log('aaaaa', Number(value))
|
|
83
83
|
|
|
84
84
|
const numericFormatProps = {
|
|
85
85
|
thousandSeparator: (0, _utils.checkThousandSeparator)(thousandSeparator, decimalSeparator),
|
|
@@ -90,6 +90,16 @@ const getValueCell = (column, value, record, format) => {
|
|
|
90
90
|
decimalScale: dec,
|
|
91
91
|
fixedDecimalScale: cellFormat?.fixedDecimalScale ?? false
|
|
92
92
|
};
|
|
93
|
+
|
|
94
|
+
// if ( typeof value === "string") {
|
|
95
|
+
// const ttt = removeNumericFormat(value, undefined, numericFormatProps )
|
|
96
|
+
//
|
|
97
|
+
// console.log('ttt', ttt)
|
|
98
|
+
// }
|
|
99
|
+
|
|
100
|
+
const contentNumber = !(0, _utils.isEmpty)(value) ? dec || dec === 0 ? parseFloat(tmpval.toFixed(dec)).toString() : tmpval.toString() : '0';
|
|
101
|
+
// const contentNumber = !isEmpty(value) ? ((dec || dec === 0) ? tmpval.toString() : tmpval.toString()) : '0'
|
|
102
|
+
|
|
93
103
|
return !(0, _utils.isEmpty)(contentNumber) ? (0, _reactNumericComponent.numericFormatter)(contentNumber, numericFormatProps) : '';
|
|
94
104
|
case 'date':
|
|
95
105
|
return value ? (0, _dayjs.default)(value).format(format?.dateFormat ?? 'DD/MM/YYYY') : '';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ColumnTable } from "../../type";
|
|
3
|
+
import type { IWrapSettings } from "../../type";
|
|
3
4
|
type Props = {
|
|
4
5
|
t?: any;
|
|
5
6
|
id?: string;
|
|
6
7
|
content?: string;
|
|
8
|
+
wrapSettings?: IWrapSettings;
|
|
7
9
|
column?: ColumnTable;
|
|
8
10
|
template?: React.ReactElement | React.ReactNode | (() => React.ReactElement | React.ReactNode);
|
|
9
11
|
tooltip?: string | number | React.ReactElement | React.ReactNode | (() => React.ReactElement | React.ReactNode);
|
|
@@ -8,27 +8,38 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _utils = require("../utils");
|
|
11
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const HeaderStyle = _styledComponents.default.div.withConfig({
|
|
15
|
+
displayName: "HeaderStyle",
|
|
16
|
+
componentId: "es-grid-template__sc-ibhq66-0"
|
|
17
|
+
})([""]);
|
|
13
18
|
const HeaderContent = props => {
|
|
14
19
|
const {
|
|
15
20
|
t,
|
|
16
|
-
id
|
|
21
|
+
id,
|
|
22
|
+
wrapSettings
|
|
17
23
|
} = props;
|
|
18
24
|
const {
|
|
19
25
|
headerTooltip,
|
|
20
26
|
headerText,
|
|
21
27
|
columnGroupText,
|
|
22
|
-
headerTemplate
|
|
28
|
+
headerTemplate,
|
|
29
|
+
headerTextWrap,
|
|
30
|
+
ellipsis
|
|
23
31
|
} = props.column ?? {};
|
|
24
32
|
const text = _react.default.useMemo(() => {
|
|
25
33
|
return columnGroupText ?? headerText;
|
|
26
34
|
}, [columnGroupText, headerText]);
|
|
27
35
|
const tooltip = _react.default.useMemo(() => {
|
|
28
|
-
return
|
|
36
|
+
return t ? t?.(headerTooltip ?? columnGroupText ?? headerText) : headerTooltip ?? columnGroupText ?? headerText;
|
|
29
37
|
}, [columnGroupText, headerText, headerTooltip, t]);
|
|
30
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(
|
|
31
|
-
className: (0, _classnames.default)('', {
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(HeaderStyle, {
|
|
39
|
+
className: (0, _classnames.default)('', {
|
|
40
|
+
'ui-rc-table-cell-ellipsis': ellipsis !== false && headerTextWrap !== true,
|
|
41
|
+
'header-text-wrap': headerTextWrap ?? (wrapSettings?.wrapMode === 'Header' || wrapSettings?.wrapMode === 'Both')
|
|
42
|
+
}),
|
|
32
43
|
"data-tooltip-id": `${id}-tooltip-header`,
|
|
33
44
|
"data-tooltip-content": tooltip,
|
|
34
45
|
"data-tooltip-offset": 16
|
|
@@ -144,3 +144,8 @@ export declare const hideDraggingPoint: (selectedCells: any, id?: any) => void;
|
|
|
144
144
|
export declare const isRangeCell: (selectedCells: any, type: string, rowIndex: number, colIndex: number) => boolean;
|
|
145
145
|
export declare const isSelectedCell: (selectedCells: any, rowIndex: number, colIndex: number) => any;
|
|
146
146
|
export declare function groupArrayByColumns(arr: any[], columns: string[] | undefined): any;
|
|
147
|
+
export declare const isFormattedNumber: (str: string) => boolean;
|
|
148
|
+
export declare const detectSeparators: (str: string) => {
|
|
149
|
+
thousandSeparator: string;
|
|
150
|
+
decimalSeparator: string;
|
|
151
|
+
};
|
|
@@ -12,7 +12,7 @@ exports.compareDate = compareDate;
|
|
|
12
12
|
exports.compareDates = compareDates;
|
|
13
13
|
exports.convertFlatColumn = exports.convertDayjsToDate = exports.convertDateToDayjs = exports.convertColumns = exports.convertArrayWithIndent = void 0;
|
|
14
14
|
exports.convertFormat = convertFormat;
|
|
15
|
-
exports.filterDataByColumns3 = exports.filterDataByColumns2 = exports.filterDataByColumns = exports.editAbleColumns = exports.customWeekStartEndFormat = exports.countItemsBeforeIndex = exports.convertLabelToTitle = void 0;
|
|
15
|
+
exports.filterDataByColumns3 = exports.filterDataByColumns2 = exports.filterDataByColumns = exports.editAbleColumns = exports.detectSeparators = exports.customWeekStartEndFormat = exports.countItemsBeforeIndex = exports.convertLabelToTitle = void 0;
|
|
16
16
|
exports.filterDataByColumns4 = filterDataByColumns4;
|
|
17
17
|
exports.findAllChildrenKeys = findAllChildrenKeys;
|
|
18
18
|
exports.getAllVisibleKeys = exports.genPresets = exports.flattenData = exports.flattenArray = exports.findItemPath = exports.findItemByKey = void 0;
|
|
@@ -31,10 +31,10 @@ exports.isContinuous = exports.isColor = exports.isBottomMostInRegion = void 0;
|
|
|
31
31
|
exports.isDateString = isDateString;
|
|
32
32
|
exports.isEmpty = exports.isEditable = exports.isDisable = void 0;
|
|
33
33
|
exports.isEqualSet = isEqualSet;
|
|
34
|
-
exports.isRangeCell = exports.isObjEmpty = exports.isNullOrUndefined = exports.isNameColor = void 0;
|
|
34
|
+
exports.isRangeCell = exports.isObjEmpty = exports.isNullOrUndefined = exports.isNameColor = exports.isFormattedNumber = void 0;
|
|
35
35
|
exports.isRightMostInRegion = isRightMostInRegion;
|
|
36
|
-
exports.
|
|
37
|
-
exports.updateData = exports.updateColumnsByGroup = void 0;
|
|
36
|
+
exports.transformColumns1 = exports.transformColumns = exports.totalFixedWidth = exports.sumDataByField = exports.sortedSetDSC = exports.sortedSetASC = exports.showDraggingPoint = exports.shouldInclude = exports.removeFieldRecursive = exports.removeColumns = exports.removeClassCellIndexSelected = exports.removeClassBorderPasteCell = exports.removeBorderPasteClass = exports.removeBorderClass2 = exports.removeBorderClass = exports.parseCells = exports.parseBooleanToValue = exports.onRemoveBorderSelectedCell = exports.onRemoveBgSelectedCell = exports.onRemoveBgCellIndex = exports.onAddBorderSelectedCell = exports.onAddBgSelectedCell = exports.onAddBgCellIndex = exports.newGuid = exports.mergedSets = exports.isTopMostInRegion = exports.isSelectedCell = void 0;
|
|
37
|
+
exports.updateData = exports.updateColumnsByGroup = exports.updateColumns = exports.updateArrayByKey = void 0;
|
|
38
38
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
39
39
|
var _moment = _interopRequireDefault(require("moment/moment"));
|
|
40
40
|
var _uuid = require("uuid");
|
|
@@ -2184,4 +2184,65 @@ function groupArrayByColumns(arr, columns) {
|
|
|
2184
2184
|
} else {
|
|
2185
2185
|
return arr;
|
|
2186
2186
|
}
|
|
2187
|
-
}
|
|
2187
|
+
}
|
|
2188
|
+
const isFormattedNumber = str => {
|
|
2189
|
+
if (!str) return false;
|
|
2190
|
+
if (typeof str !== 'string') return false;
|
|
2191
|
+
const regexUS = /^\d{1,3}(,\d{3})*(\.\d+)?$/; // 100,000.111
|
|
2192
|
+
const regexEU = /^\d{1,3}(\.\d{3})*(,\d+)?$/; // 100.000,111
|
|
2193
|
+
|
|
2194
|
+
// Không có dấu hàng nghìn, chỉ dấu thập phân: 100000.1 hoặc 100000,01
|
|
2195
|
+
const regexDecimalOnly = /^\d+([.,]\d{1,})$/;
|
|
2196
|
+
return regexUS.test(str) || regexEU.test(str) || regexDecimalOnly.test(str);
|
|
2197
|
+
};
|
|
2198
|
+
exports.isFormattedNumber = isFormattedNumber;
|
|
2199
|
+
const detectSeparators = str => {
|
|
2200
|
+
if (typeof str !== 'string') return null;
|
|
2201
|
+
const hasComma = str.includes(',');
|
|
2202
|
+
const hasDot = str.includes('.');
|
|
2203
|
+
|
|
2204
|
+
// Trường hợp có cả dấu , và .
|
|
2205
|
+
if (hasComma && hasDot) {
|
|
2206
|
+
const lastComma = str.lastIndexOf(',');
|
|
2207
|
+
const lastDot = str.lastIndexOf('.');
|
|
2208
|
+
return lastComma > lastDot ? {
|
|
2209
|
+
thousandSeparator: '.',
|
|
2210
|
+
decimalSeparator: ','
|
|
2211
|
+
} : {
|
|
2212
|
+
thousandSeparator: ',',
|
|
2213
|
+
decimalSeparator: '.'
|
|
2214
|
+
};
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
// Trường hợp chỉ có dấu phẩy
|
|
2218
|
+
if (hasComma && !hasDot) {
|
|
2219
|
+
const parts = str.split(',');
|
|
2220
|
+
if (parts.length === 2) {
|
|
2221
|
+
return parts[1].length === 3 ? {
|
|
2222
|
+
thousandSeparator: ',',
|
|
2223
|
+
decimalSeparator: null
|
|
2224
|
+
} : {
|
|
2225
|
+
thousandSeparator: null,
|
|
2226
|
+
decimalSeparator: ','
|
|
2227
|
+
};
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
// Trường hợp chỉ có dấu chấm
|
|
2232
|
+
if (hasDot && !hasComma) {
|
|
2233
|
+
const parts = str.split('.');
|
|
2234
|
+
if (parts.length === 2) {
|
|
2235
|
+
return parts[1].length === 3 ? {
|
|
2236
|
+
thousandSeparator: '.',
|
|
2237
|
+
decimalSeparator: null
|
|
2238
|
+
} : {
|
|
2239
|
+
thousandSeparator: null,
|
|
2240
|
+
decimalSeparator: '.'
|
|
2241
|
+
};
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
// Không có dấu hoặc không hợp lệ
|
|
2246
|
+
return null;
|
|
2247
|
+
};
|
|
2248
|
+
exports.detectSeparators = detectSeparators;
|
|
@@ -317,6 +317,7 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
317
317
|
//overflow: visible;
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
+
|
|
320
321
|
.#{$prefix}-table-column-title {
|
|
321
322
|
//display: flex;
|
|
322
323
|
}
|
|
@@ -324,9 +325,18 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
324
325
|
&.head-align-center {
|
|
325
326
|
text-align: center;
|
|
326
327
|
}
|
|
328
|
+
|
|
327
329
|
&.head-align-right {
|
|
328
330
|
text-align: right;
|
|
329
331
|
}
|
|
332
|
+
|
|
333
|
+
.ui-rc-table-column-title {
|
|
334
|
+
.header-text-wrap {
|
|
335
|
+
white-space: normal !important;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
|
|
330
340
|
}
|
|
331
341
|
}
|
|
332
342
|
|
|
@@ -1085,6 +1095,23 @@ $fontFamily: "Montserrat",Helvetica,Arial,serif !default;
|
|
|
1085
1095
|
}
|
|
1086
1096
|
}
|
|
1087
1097
|
|
|
1098
|
+
|
|
1099
|
+
// -------------- radio ----------
|
|
1100
|
+
|
|
1101
|
+
.ui-rc-radio-wrapper {
|
|
1102
|
+
.ui-rc-radio-checked {
|
|
1103
|
+
.ui-rc-radio-inner {
|
|
1104
|
+
background-color: $primary;
|
|
1105
|
+
border-color: $primary;
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
&:hover {
|
|
1109
|
+
.ui-rc-radio-inner {
|
|
1110
|
+
border-color: $primary;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1088
1115
|
// ------------ Tree ---------------
|
|
1089
1116
|
|
|
1090
1117
|
.#{$prefix}-tree {
|