namirasoft-site-react 1.4.551 → 1.4.553
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/dist/components/NSBoxBoolean.d.ts +2 -0
- package/dist/components/NSBoxBoolean.js +9 -2
- package/dist/components/NSBoxBoolean.js.map +1 -1
- package/dist/components/NSPagination.module.css +1 -0
- package/dist/components/NSTable.d.ts +23 -3
- package/dist/components/NSTable.js +159 -60
- package/dist/components/NSTable.js.map +1 -1
- package/dist/components/NSTable.module.css +146 -55
- package/dist/formatter/BaseURLImageFormatter.js +1 -1
- package/dist/formatter/BaseURLImageFormatter.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NSBoxBoolean.tsx +11 -2
- package/src/components/NSPagination.module.css +1 -0
- package/src/components/NSTable.module.css +146 -55
- package/src/components/NSTable.tsx +270 -132
- package/src/formatter/BaseURLImageFormatter.tsx +1 -1
|
@@ -5,6 +5,7 @@ import { INSBoxBaseLayoutProps, NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
|
5
5
|
import { INSBox } from "./INSBox";
|
|
6
6
|
export interface NSBoxBooleanProps extends IBaseComponentProps, IValidationProps, INSBoxBaseLayoutProps<NSBoxBoolean, boolean> {
|
|
7
7
|
checked?: (boolean | null);
|
|
8
|
+
triState?: boolean;
|
|
8
9
|
label?: IBaseComponentProps;
|
|
9
10
|
input?: IBaseComponentProps;
|
|
10
11
|
children?: ReactNode;
|
|
@@ -23,6 +24,7 @@ export declare class NSBoxBoolean extends React.Component<NSBoxBooleanProps, NSB
|
|
|
23
24
|
setValueBool(value: boolean, callback?: () => void): void;
|
|
24
25
|
getValueNull(checkError?: boolean): boolean | null;
|
|
25
26
|
setValueNull(value: boolean | null, callback?: () => void): void;
|
|
27
|
+
getNextTriState(): boolean | null;
|
|
26
28
|
isEmpty(): boolean;
|
|
27
29
|
setDisabled(disabled: boolean): void;
|
|
28
30
|
componentDidUpdate(prevProps: Readonly<NSBoxBooleanProps>): void;
|
|
@@ -12,7 +12,7 @@ export class NSBoxBoolean extends React.Component {
|
|
|
12
12
|
super(props);
|
|
13
13
|
this._isdirtied = false;
|
|
14
14
|
this.NSBoxBaseLayout_Main = createRef();
|
|
15
|
-
this.state = { value: (_b = (_a = props.checked) !== null && _a !== void 0 ? _a : props.defaultValue) !== null && _b !== void 0 ? _b : false };
|
|
15
|
+
this.state = { value: (_b = (_a = props.checked) !== null && _a !== void 0 ? _a : props.defaultValue) !== null && _b !== void 0 ? _b : (props.triState ? null : false) };
|
|
16
16
|
this.isEmpty = this.isEmpty.bind(this);
|
|
17
17
|
this.getError = this.getError.bind(this);
|
|
18
18
|
this.getValue = this.getValue.bind(this);
|
|
@@ -59,6 +59,13 @@ export class NSBoxBoolean extends React.Component {
|
|
|
59
59
|
callback === null || callback === void 0 ? void 0 : callback();
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
+
getNextTriState() {
|
|
63
|
+
if (this.state.value === null)
|
|
64
|
+
return true;
|
|
65
|
+
if (this.state.value === true)
|
|
66
|
+
return false;
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
62
69
|
isEmpty() {
|
|
63
70
|
return !this._isdirtied;
|
|
64
71
|
}
|
|
@@ -80,7 +87,7 @@ export class NSBoxBoolean extends React.Component {
|
|
|
80
87
|
let menu = safeMenuMenuItem(this.props, () => { });
|
|
81
88
|
return (_jsx(NSBoxBaseLayout, Object.assign({ ref: this.NSBoxBaseLayout_Main }, this.props, { title: this.props.disabled ? this.props.title : "", menu: menu, getValue: () => new BooleanFormatter("True", "False").format(this.getValue(false)), children: _jsxs("label", { id: (_a = this.props.label) === null || _a === void 0 ? void 0 : _a.id, className: `ns-font-16-normal ${Styles.ns_box_boolean_label} ${(_d = (_c = (_b = this.props.label) === null || _b === void 0 ? void 0 : _b.classList) === null || _c === void 0 ? void 0 : _c.join(" ")) !== null && _d !== void 0 ? _d : ""}`, style: (_e = this.props.label) === null || _e === void 0 ? void 0 : _e.style, htmlFor: this.props.name, children: [_jsx("input", { id: (_f = this.props.input) === null || _f === void 0 ? void 0 : _f.id, name: (_g = this.props.input) === null || _g === void 0 ? void 0 : _g.name, type: "checkbox", className: `${Styles.ns_box_boolean_input} ${this.state.value == null ? Styles.ns_box_boolean_indeterminate : ""} ${(_k = (_j = (_h = this.props.input) === null || _h === void 0 ? void 0 : _h.classList) === null || _j === void 0 ? void 0 : _j.join(" ")) !== null && _k !== void 0 ? _k : ""}`, checked: (_l = this.state.value) !== null && _l !== void 0 ? _l : false, onChange: e => {
|
|
82
89
|
this._isdirtied = true;
|
|
83
|
-
this.setValue(e.target.checked);
|
|
90
|
+
this.setValue(this.props.triState ? this.getNextTriState() : e.target.checked);
|
|
84
91
|
}, onClick: () => { var _a, _b; (_b = (_a = this.props).onClicked) === null || _b === void 0 ? void 0 : _b.call(_a, this); }, style: (_m = this.props.input) === null || _m === void 0 ? void 0 : _m.style }), _jsx("span", { style: { width: "0px" } }), this.props.hideHeader && this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), this.props.title, this.props.children] }) })));
|
|
85
92
|
}
|
|
86
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBoxBoolean.js","sourceRoot":"","sources":["../../src/components/NSBoxBoolean.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AACpD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAG/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAyB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"NSBoxBoolean.js","sourceRoot":"","sources":["../../src/components/NSBoxBoolean.tsx"],"names":[],"mappings":"AAAA,YAAY,C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AAG,CAAC,mCAAI,EAAE,EAAE,EAClK,OAAO,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,mCAAI,KAAK,EAClC,QAAQ,EAAE,CAAC,CAAC,EAAE;4BAEV,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;4BACvB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;wBACnF,CAAC,EACD,OAAO,EAAE,GAAG,EAAE,eAAG,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,SAAS,mDAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAChD,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,KAAK,GAChC,EACjB,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAS,EACrC,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAU,EACvF,IAAI,CAAC,KAAK,CAAC,KAAK,EAChB,IAAI,CAAC,KAAK,CAAC,QAAQ,IACb,IACS,CAClB,CAAC;IACH,CAAC;CACD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { SortItem } from "namirasoft-core";
|
|
2
|
-
import
|
|
2
|
+
import { Component, ReactNode } from "react";
|
|
3
3
|
import { BaseColumnFormatter } from '../formatter/BaseColumnFormatter';
|
|
4
4
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
5
|
+
import { NSButtonProps } from './NSButton';
|
|
5
6
|
import { NSPagination } from './NSPagination';
|
|
6
7
|
export interface TableInfo {
|
|
7
8
|
name: string;
|
|
@@ -50,6 +51,9 @@ export interface NSTableProps<RowType> extends IBaseComponentProps {
|
|
|
50
51
|
onRowClick?: (e: React.MouseEvent<HTMLTableRowElement, MouseEvent>, row: TableRowInfo<RowType>) => void;
|
|
51
52
|
onCellClick?: (e: React.MouseEvent<HTMLTableCellElement, MouseEvent>, cell: TableCellInfo<RowType>) => boolean | undefined;
|
|
52
53
|
getRowCheckboxDisabled?: (row: TableRowInfo<RowType>) => boolean;
|
|
54
|
+
buttons?: NSButtonProps[];
|
|
55
|
+
children?: ReactNode;
|
|
56
|
+
headerChildren?: ReactNode;
|
|
53
57
|
hierarchy?: {
|
|
54
58
|
id: string;
|
|
55
59
|
parent: string;
|
|
@@ -85,6 +89,10 @@ interface NSTableState<RowType> {
|
|
|
85
89
|
expandedIDs: string[];
|
|
86
90
|
pageSelectionMode: PageSelectionMode;
|
|
87
91
|
sortItems: SortItem[] | null;
|
|
92
|
+
columnWidths: {
|
|
93
|
+
[key: string]: number;
|
|
94
|
+
};
|
|
95
|
+
fullscreen: boolean;
|
|
88
96
|
}
|
|
89
97
|
declare enum PageSelectionMode {
|
|
90
98
|
Hidden = "Hidden",
|
|
@@ -95,9 +103,12 @@ export declare class NSTable<RowType> extends Component<NSTableProps<RowType>, N
|
|
|
95
103
|
private Table_Ref;
|
|
96
104
|
private TableScrollbar_Ref;
|
|
97
105
|
private TableScrollbarContent_Ref;
|
|
98
|
-
NSPagination:
|
|
106
|
+
NSPagination: import("react").RefObject<NSPagination>;
|
|
99
107
|
private LastSelectedRowID;
|
|
108
|
+
private resizeMoveHandler;
|
|
109
|
+
private resizeUpHandler;
|
|
100
110
|
constructor(props: NSTableProps<RowType>);
|
|
111
|
+
private toggleFullscreen;
|
|
101
112
|
private getSortItemsKey;
|
|
102
113
|
getSortItems(): SortItem[];
|
|
103
114
|
setSortItems(items: SortItem[] | null): void;
|
|
@@ -111,6 +122,7 @@ export declare class NSTable<RowType> extends Component<NSTableProps<RowType>, N
|
|
|
111
122
|
column: string;
|
|
112
123
|
}[]): void;
|
|
113
124
|
setColumns(columns: TableColumnInfo[]): void;
|
|
125
|
+
private syncScrollbarWidth;
|
|
114
126
|
setRows(rows: RowType[] | null, totalItems: number): void;
|
|
115
127
|
foreachColumn(visible: boolean | null, handler: (column: TableColumnInfo) => void): void;
|
|
116
128
|
getColumns(visible: boolean | null): TableColumnInfo[];
|
|
@@ -137,7 +149,15 @@ export declare class NSTable<RowType> extends Component<NSTableProps<RowType>, N
|
|
|
137
149
|
private isMultipleSelected;
|
|
138
150
|
private getCellTableInfo;
|
|
139
151
|
private getCellFormattedValue;
|
|
152
|
+
private getColumnWidthsKey;
|
|
153
|
+
private loadColumnWidths;
|
|
154
|
+
private saveColumnWidths;
|
|
155
|
+
private getColumnKey;
|
|
156
|
+
private getColumnWidth;
|
|
157
|
+
private getGridTemplateColumns;
|
|
158
|
+
private startResize;
|
|
140
159
|
componentDidMount(): void;
|
|
141
|
-
|
|
160
|
+
componentWillUnmount(): void;
|
|
161
|
+
render(): import("react").JSX.Element;
|
|
142
162
|
}
|
|
143
163
|
export {};
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
12
|
import { BaseMetaColumn, BaseMetaTable, IStorageLocal, SortItem } from "namirasoft-core";
|
|
13
|
-
import
|
|
13
|
+
import { Component, createRef } from "react";
|
|
14
14
|
import { utils, writeFile } from 'xlsx';
|
|
15
15
|
import { NSButton } from './NSButton';
|
|
16
16
|
import { NSDialogInfo } from './NSDialogInfo';
|
|
@@ -18,7 +18,6 @@ import { NSDialogPageSelection } from './NSDialogPageSelection';
|
|
|
18
18
|
import { NSLoading } from './NSLoading';
|
|
19
19
|
import { NSNoData } from './NSNoData';
|
|
20
20
|
import { NSPagination } from './NSPagination';
|
|
21
|
-
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
22
21
|
import Styles from './NSTable.module.css';
|
|
23
22
|
var PageSelectionMode;
|
|
24
23
|
(function (PageSelectionMode) {
|
|
@@ -29,11 +28,13 @@ var PageSelectionMode;
|
|
|
29
28
|
export class NSTable extends Component {
|
|
30
29
|
constructor(props) {
|
|
31
30
|
super(props);
|
|
32
|
-
this.Table_Ref =
|
|
33
|
-
this.TableScrollbar_Ref =
|
|
34
|
-
this.TableScrollbarContent_Ref =
|
|
35
|
-
this.NSPagination =
|
|
31
|
+
this.Table_Ref = createRef();
|
|
32
|
+
this.TableScrollbar_Ref = createRef();
|
|
33
|
+
this.TableScrollbarContent_Ref = createRef();
|
|
34
|
+
this.NSPagination = createRef();
|
|
36
35
|
this.LastSelectedRowID = null;
|
|
36
|
+
this.resizeMoveHandler = null;
|
|
37
|
+
this.resizeUpHandler = null;
|
|
37
38
|
this.state = {
|
|
38
39
|
columns: props.columns,
|
|
39
40
|
visible_columns: this.getVisibleColumns(),
|
|
@@ -45,6 +46,8 @@ export class NSTable extends Component {
|
|
|
45
46
|
expandedIDs: [],
|
|
46
47
|
pageSelectionMode: PageSelectionMode.Hidden,
|
|
47
48
|
sortItems: this.getSortItems(),
|
|
49
|
+
columnWidths: this.loadColumnWidths(),
|
|
50
|
+
fullscreen: false,
|
|
48
51
|
};
|
|
49
52
|
this.getSortItemsKey = this.getSortItemsKey.bind(this);
|
|
50
53
|
this.getSortItems = this.getSortItems.bind(this);
|
|
@@ -66,6 +69,10 @@ export class NSTable extends Component {
|
|
|
66
69
|
this.exportCSV = this.exportCSV.bind(this);
|
|
67
70
|
this.isAllSelected = this.isAllSelected.bind(this);
|
|
68
71
|
this.reload = this.reload.bind(this);
|
|
72
|
+
this.toggleFullscreen = this.toggleFullscreen.bind(this);
|
|
73
|
+
}
|
|
74
|
+
toggleFullscreen() {
|
|
75
|
+
this.setState({ fullscreen: !this.state.fullscreen }, () => this.syncScrollbarWidth());
|
|
69
76
|
}
|
|
70
77
|
getSortItemsKey() {
|
|
71
78
|
return "ns_table_" + this.props.name + "_sort_items";
|
|
@@ -113,13 +120,17 @@ export class NSTable extends Component {
|
|
|
113
120
|
setColumns(columns) {
|
|
114
121
|
this.setState({ columns });
|
|
115
122
|
}
|
|
123
|
+
syncScrollbarWidth() {
|
|
124
|
+
var _a, _b;
|
|
125
|
+
if (this.TableScrollbarContent_Ref.current)
|
|
126
|
+
this.TableScrollbarContent_Ref.current.style.width = ((_b = (_a = this.Table_Ref.current) === null || _a === void 0 ? void 0 : _a.scrollWidth) !== null && _b !== void 0 ? _b : 0) + "px";
|
|
127
|
+
}
|
|
116
128
|
setRows(rows, totalItems) {
|
|
117
129
|
this.setState({ rows, totalItems }, () => {
|
|
118
|
-
var _a
|
|
130
|
+
var _a;
|
|
119
131
|
if (this.props.scroll !== false)
|
|
120
132
|
(_a = this.Table_Ref.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
121
|
-
|
|
122
|
-
this.TableScrollbarContent_Ref.current.style.width = ((_c = (_b = this.Table_Ref.current) === null || _b === void 0 ? void 0 : _b.scrollWidth) !== null && _c !== void 0 ? _c : 0) + "px";
|
|
133
|
+
this.syncScrollbarWidth();
|
|
123
134
|
});
|
|
124
135
|
}
|
|
125
136
|
foreachColumn(visible, handler) {
|
|
@@ -352,12 +363,88 @@ export class NSTable extends Component {
|
|
|
352
363
|
return this.props.getCellFormattedValue(value, column, row, printable);
|
|
353
364
|
return column.formatter.format(value, column, row, printable);
|
|
354
365
|
}
|
|
366
|
+
getColumnWidthsKey() {
|
|
367
|
+
return "ns_table_" + this.props.name + "_column_widths";
|
|
368
|
+
}
|
|
369
|
+
loadColumnWidths() {
|
|
370
|
+
let storage = new IStorageLocal();
|
|
371
|
+
let item = storage.get(this.getColumnWidthsKey(), "");
|
|
372
|
+
try {
|
|
373
|
+
return JSON.parse(item);
|
|
374
|
+
}
|
|
375
|
+
catch (_a) {
|
|
376
|
+
return {};
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
saveColumnWidths(widths) {
|
|
380
|
+
let storage = new IStorageLocal();
|
|
381
|
+
storage.set(this.getColumnWidthsKey(), JSON.stringify(widths));
|
|
382
|
+
}
|
|
383
|
+
getColumnKey(column) {
|
|
384
|
+
return column.table.name + "_" + column.name;
|
|
385
|
+
}
|
|
386
|
+
getColumnWidth(column) {
|
|
387
|
+
let key = this.getColumnKey(column);
|
|
388
|
+
if (this.state.columnWidths[key] !== undefined)
|
|
389
|
+
return this.state.columnWidths[key];
|
|
390
|
+
let w = column.formatter.width;
|
|
391
|
+
if (typeof w === 'number')
|
|
392
|
+
return w;
|
|
393
|
+
if (typeof w === 'string') {
|
|
394
|
+
let parsed = parseInt(w, 10);
|
|
395
|
+
if (!isNaN(parsed))
|
|
396
|
+
return parsed;
|
|
397
|
+
}
|
|
398
|
+
return 120;
|
|
399
|
+
}
|
|
400
|
+
getGridTemplateColumns() {
|
|
401
|
+
let parts = [];
|
|
402
|
+
if (this.props.checkbox)
|
|
403
|
+
parts.push("40px");
|
|
404
|
+
this.getColumns(true).forEach(column => {
|
|
405
|
+
parts.push(this.getColumnWidth(column) + "px");
|
|
406
|
+
});
|
|
407
|
+
return parts.join(" ");
|
|
408
|
+
}
|
|
409
|
+
startResize(e, column) {
|
|
410
|
+
e.preventDefault();
|
|
411
|
+
e.stopPropagation();
|
|
412
|
+
let key = this.getColumnKey(column);
|
|
413
|
+
let startX = e.clientX;
|
|
414
|
+
let startWidth = this.getColumnWidth(column);
|
|
415
|
+
let currentWidths = Object.assign({}, this.state.columnWidths);
|
|
416
|
+
document.body.style.cursor = 'col-resize';
|
|
417
|
+
document.body.style.userSelect = 'none';
|
|
418
|
+
const onMouseMove = (ev) => {
|
|
419
|
+
let delta = ev.clientX - startX;
|
|
420
|
+
let newWidth = Math.max(80, startWidth + delta);
|
|
421
|
+
currentWidths = Object.assign(Object.assign({}, currentWidths), { [key]: newWidth });
|
|
422
|
+
this.setState({ columnWidths: currentWidths }, () => this.syncScrollbarWidth());
|
|
423
|
+
};
|
|
424
|
+
const onMouseUp = () => {
|
|
425
|
+
document.body.style.cursor = '';
|
|
426
|
+
document.body.style.userSelect = '';
|
|
427
|
+
document.removeEventListener('mousemove', onMouseMove);
|
|
428
|
+
document.removeEventListener('mouseup', onMouseUp);
|
|
429
|
+
this.resizeMoveHandler = null;
|
|
430
|
+
this.resizeUpHandler = null;
|
|
431
|
+
this.saveColumnWidths(currentWidths);
|
|
432
|
+
};
|
|
433
|
+
this.resizeMoveHandler = onMouseMove;
|
|
434
|
+
this.resizeUpHandler = onMouseUp;
|
|
435
|
+
document.addEventListener('mousemove', onMouseMove);
|
|
436
|
+
document.addEventListener('mouseup', onMouseUp);
|
|
437
|
+
}
|
|
355
438
|
componentDidMount() {
|
|
356
|
-
var _a, _b;
|
|
357
439
|
if (!this.NSPagination.current)
|
|
358
440
|
this.reload(null, null);
|
|
359
|
-
|
|
360
|
-
|
|
441
|
+
this.syncScrollbarWidth();
|
|
442
|
+
}
|
|
443
|
+
componentWillUnmount() {
|
|
444
|
+
if (this.resizeMoveHandler)
|
|
445
|
+
document.removeEventListener('mousemove', this.resizeMoveHandler);
|
|
446
|
+
if (this.resizeUpHandler)
|
|
447
|
+
document.removeEventListener('mouseup', this.resizeUpHandler);
|
|
361
448
|
}
|
|
362
449
|
render() {
|
|
363
450
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
@@ -397,6 +484,7 @@ export class NSTable extends Component {
|
|
|
397
484
|
if (!overided)
|
|
398
485
|
this.showModal(cell.formatted, cell.column.text);
|
|
399
486
|
};
|
|
487
|
+
let gridTemplateColumns = this.getGridTemplateColumns();
|
|
400
488
|
let content;
|
|
401
489
|
if (this.state.rows === null) {
|
|
402
490
|
content = (_jsx("tr", { className: "d-flex justify-content-center align-items-center p-0", children: _jsx("td", { className: "w-100 h-100 m-0 mh-100", children: _jsx(NSLoading, {}) }) }));
|
|
@@ -426,14 +514,15 @@ export class NSTable extends Component {
|
|
|
426
514
|
}
|
|
427
515
|
let hasChildren = children.length > 0;
|
|
428
516
|
let expanded = this.isExpanded(rowKey);
|
|
517
|
+
let rowAttrs = getRowAttributes(rowValue, rowIndex);
|
|
429
518
|
let nodes = [];
|
|
430
|
-
nodes.push(_jsxs("tr", Object.assign({},
|
|
519
|
+
nodes.push(_jsxs("tr", Object.assign({}, rowAttrs, { style: Object.assign(Object.assign({}, (rowAttrs.style || {})), { gridTemplateColumns }), className: `${isSelected ? Styles.ns_selected : ""} ${isLastSelected ? Styles.ns_last_selected : ""}`.trim(), onClick: (e) => !isCheckboxDisabled && onRowClick(e, row, isSelected), children: [this.props.checkbox &&
|
|
431
520
|
_jsx("td", { "data-cell-type": "checkbox", children: _jsx("label", { htmlFor: `checkbox_device_${rowKey}`, className: Styles.ns_check_box_label, children: _jsx("input", { id: `checkbox_device_${rowKey}`, type: "checkbox", checked: isSelected, disabled: isCheckboxDisabled, className: Styles.ns_check_box, onChange: () => { } }) }) }), this.getColumns(true).map((column, index) => {
|
|
432
521
|
var _a, _b;
|
|
433
522
|
column.index = index + (this.props.checkbox ? 1 : 0);
|
|
434
523
|
let cell = this.getCellTableInfo(column, row, false);
|
|
435
524
|
let isFirstDataColumn = index === 0;
|
|
436
|
-
return (_jsx("td", Object.assign({}, getColumnAttributes(column), { "data-label": `${column.text}: `, width: column.formatter.width, className: '
|
|
525
|
+
return (_jsx("td", Object.assign({}, getColumnAttributes(column), { "data-label": `${column.text}: `, width: column.formatter.width, className: '', style: isFirstDataColumn && hierarchical ? { overflow: "visible" } : undefined, onClick: (e) => {
|
|
437
526
|
onColumnClick(e, column);
|
|
438
527
|
onCellClick(e, cell);
|
|
439
528
|
}, children: isFirstDataColumn && hierarchical ? (_jsxs("div", { style: {
|
|
@@ -534,12 +623,60 @@ export class NSTable extends Component {
|
|
|
534
623
|
}
|
|
535
624
|
return "";
|
|
536
625
|
};
|
|
537
|
-
|
|
626
|
+
let buttonPanel = show_button_panel && (_jsxs("div", { className: Styles.ns_button_panel, children: [this.state.pageSelectionMode !== PageSelectionMode.Hidden &&
|
|
627
|
+
_jsx(NSDialogPageSelection, { icon: this.state.pageSelectionMode === PageSelectionMode.Print ? "https://static.namirasoft.com/image/concept/print/blue.svg" :
|
|
628
|
+
this.state.pageSelectionMode === PageSelectionMode.CSV ? "https://static.namirasoft.com/image/concept/export/blue.svg" : "", current_page: (_f = (_e = this.NSPagination.current) === null || _e === void 0 ? void 0 : _e.getCurrentPage()) !== null && _f !== void 0 ? _f : 1, current_size: (_h = (_g = this.NSPagination.current) === null || _g === void 0 ? void 0 : _g.getPageSize()) !== null && _h !== void 0 ? _h : 0, max_page: this.state.totalItems, getItems: (page, size, selected) => __awaiter(this, void 0, void 0, function* () {
|
|
629
|
+
if (selected) {
|
|
630
|
+
let rows = [];
|
|
631
|
+
if (this.state.rows)
|
|
632
|
+
for (let i = 0; i < this.state.rows.length; i++) {
|
|
633
|
+
const row = { index: i, value: this.state.rows[i] };
|
|
634
|
+
let id = this.props.getRowKey(row);
|
|
635
|
+
if (this.state.selectedIDs.includes(id))
|
|
636
|
+
rows.push(row.value);
|
|
637
|
+
}
|
|
638
|
+
return rows;
|
|
639
|
+
}
|
|
640
|
+
let res = yield this.props.getRows(page, size, this.getSortItems());
|
|
641
|
+
return res.rows;
|
|
642
|
+
}), onFinish: (items) => __awaiter(this, void 0, void 0, function* () {
|
|
643
|
+
if (this.state.pageSelectionMode === PageSelectionMode.Print)
|
|
644
|
+
this.print(items);
|
|
645
|
+
else if (this.state.pageSelectionMode === PageSelectionMode.CSV)
|
|
646
|
+
this.exportCSV(items);
|
|
647
|
+
}), onClose: () => this.setState({ pageSelectionMode: PageSelectionMode.Hidden }) }), (_j = this.props.buttons) === null || _j === void 0 ? void 0 : _j.map((button, index) => {
|
|
648
|
+
var _a;
|
|
649
|
+
return (_jsx(NSButton, Object.assign({}, button, { classList: [Styles.ns_table_button, ...((_a = button.classList) !== null && _a !== void 0 ? _a : [])] }), index));
|
|
650
|
+
}), _jsx(NSButton, { icon: { src: `https://static.namirasoft.com/image/concept/full-screen/blue.svg` }, classList: [Styles.ns_table_button, Styles.ns_fullscreen_button], onClick: {
|
|
651
|
+
action: this.toggleFullscreen,
|
|
652
|
+
showLoading: false
|
|
653
|
+
}, attributes: { title: this.state.fullscreen ? 'Minimize' : 'Maximize' } }), _jsx(NSButton, { attributes: { title: 'Chart' }, icon: { src: "https://static.namirasoft.com/image/concept/chart/blue.svg" }, onClick: {
|
|
654
|
+
action: () => {
|
|
655
|
+
this.showModal(" ", "This feature will be available soon in upcoming versions.");
|
|
656
|
+
},
|
|
657
|
+
showLoading: false
|
|
658
|
+
}, classList: [Styles.ns_table_button] }), _jsx(NSButton, { icon: { src: "https://static.namirasoft.com/image/concept/export/blue.svg" }, onClick: {
|
|
659
|
+
action: () => { this.setState({ pageSelectionMode: PageSelectionMode.CSV }); },
|
|
660
|
+
showLoading: false
|
|
661
|
+
}, classList: [Styles.ns_table_button], attributes: { title: 'Export' } }), _jsx(NSButton, { attributes: { title: 'Print' }, icon: { src: "https://static.namirasoft.com/image/concept/print/blue.svg" }, onClick: {
|
|
662
|
+
action: () => { this.setState({ pageSelectionMode: PageSelectionMode.Print }); },
|
|
663
|
+
showLoading: false
|
|
664
|
+
}, classList: [Styles.ns_table_button] }), _jsx(NSButton, { attributes: { title: 'Refresh' }, icon: { src: "https://static.namirasoft.com/image/concept/refresh/blue.svg" }, onClick: {
|
|
665
|
+
action: (onFinished) => __awaiter(this, void 0, void 0, function* () {
|
|
666
|
+
this.reload(null, null).then(onFinished).catch(onFinished);
|
|
667
|
+
})
|
|
668
|
+
}, classList: [Styles.ns_table_button], style: { border: '1px solid rgb(3, 119, 255)' } })] }));
|
|
669
|
+
return (_jsxs("div", { id: this.props.id, className: [...(_k = this.props.classList) !== null && _k !== void 0 ? _k : [], Styles.ns_table_wrapper, this.state.fullscreen ? Styles.ns_fullscreen : ""].filter(Boolean).join(" "), style: Object.assign({}, this.props.style), children: [_jsxs("div", { className: Styles.ns_table_topbar, children: [!this.state.fullscreen &&
|
|
670
|
+
this.props.headerChildren, show_pagination &&
|
|
671
|
+
_jsx(NSPagination, { ref: this.NSPagination, totalItems: this.state.totalItems, onPageChange: this.onPageChange, style: { marginRight: "auto" } }), buttonPanel] }), !this.state.fullscreen && this.props.children &&
|
|
672
|
+
_jsx("div", { className: Styles.ns_table_children, children: this.props.children }), _jsxs("table", { ref: this.Table_Ref, className: Styles.ns_table, onScroll: () => {
|
|
538
673
|
var _a, _b;
|
|
539
674
|
if (this.TableScrollbar_Ref.current)
|
|
540
675
|
this.TableScrollbar_Ref.current.scrollLeft = (_b = (_a = this.Table_Ref.current) === null || _a === void 0 ? void 0 : _a.scrollLeft) !== null && _b !== void 0 ? _b : 0;
|
|
541
|
-
}, children: [_jsx("thead", { children: _jsxs("tr", { children: [this.props.checkbox &&
|
|
542
|
-
_jsx("th", { style: { width: "24px", height: "24px" }, children: _jsx("label", { htmlFor: 'checkbox', className: Styles.ns_checkbox_label, children: _jsx("input", { id: "checkbox", type: "checkbox", className: `${Styles.ns_check_box} ${this.isSomeSelected() ? Styles.ns_indeterminate : ""}`, checked: this.getSelectedIDs().length > 0, onChange: this.toggleAllSelections }) }) }), this.getColumns(true).map(column =>
|
|
676
|
+
}, children: [_jsx("thead", { children: _jsxs("tr", { style: { gridTemplateColumns }, children: [this.props.checkbox &&
|
|
677
|
+
_jsx("th", { "data-cell-type": "checkbox", style: { width: "24px", height: "24px", padding: 0 }, children: _jsx("label", { htmlFor: 'checkbox', className: Styles.ns_checkbox_label, children: _jsx("input", { id: "checkbox", type: "checkbox", className: `${Styles.ns_check_box} ${this.isSomeSelected() ? Styles.ns_indeterminate : ""}`, checked: this.getSelectedIDs().length > 0, onChange: this.toggleAllSelections }) }) }), this.getColumns(true).map(column => _jsxs("th", { scope: "col", style: { width: this.getColumnWidth(column), cursor: "pointer", position: "relative", userSelect: "none" }, onClick: (e) => {
|
|
678
|
+
if (e.target.closest('[data-resize-handle]'))
|
|
679
|
+
return;
|
|
543
680
|
let t = new BaseMetaTable(null, column.table.name, column.table.text);
|
|
544
681
|
let c = new BaseMetaColumn(t, column.name, column.text, "", false);
|
|
545
682
|
let items = this.getSortItems();
|
|
@@ -551,49 +688,11 @@ export class NSTable extends Component {
|
|
|
551
688
|
else
|
|
552
689
|
this.setSortItems(null);
|
|
553
690
|
}
|
|
554
|
-
}, children: column.text + " " + getSortSign(column) }
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
_jsx(NSPagination, { ref: this.NSPagination, totalItems: this.state.totalItems, onPageChange: this.onPageChange }), _jsx(NSSpace, { size: NSSpaceSizeType.MINI, classList: ["d-lg-none"] }), show_button_panel &&
|
|
560
|
-
_jsxs("div", { className: Styles.ns_button_panel, children: [this.state.pageSelectionMode !== PageSelectionMode.Hidden &&
|
|
561
|
-
_jsx(NSDialogPageSelection, { icon: this.state.pageSelectionMode === PageSelectionMode.Print ? "https://static.namirasoft.com/image/concept/print/blue.svg" :
|
|
562
|
-
this.state.pageSelectionMode === PageSelectionMode.CSV ? "https://static.namirasoft.com/image/concept/export/blue.svg" : "", current_page: (_h = (_g = this.NSPagination.current) === null || _g === void 0 ? void 0 : _g.getCurrentPage()) !== null && _h !== void 0 ? _h : 1, current_size: (_k = (_j = this.NSPagination.current) === null || _j === void 0 ? void 0 : _j.getPageSize()) !== null && _k !== void 0 ? _k : 0, max_page: this.state.totalItems, getItems: (page, size, selected) => __awaiter(this, void 0, void 0, function* () {
|
|
563
|
-
if (selected) {
|
|
564
|
-
let rows = [];
|
|
565
|
-
if (this.state.rows)
|
|
566
|
-
for (let i = 0; i < this.state.rows.length; i++) {
|
|
567
|
-
const row = { index: i, value: this.state.rows[i] };
|
|
568
|
-
let id = this.props.getRowKey(row);
|
|
569
|
-
if (this.state.selectedIDs.includes(id))
|
|
570
|
-
rows.push(row.value);
|
|
571
|
-
}
|
|
572
|
-
return rows;
|
|
573
|
-
}
|
|
574
|
-
let res = yield this.props.getRows(page, size, this.getSortItems());
|
|
575
|
-
return res.rows;
|
|
576
|
-
}), onFinish: (items) => __awaiter(this, void 0, void 0, function* () {
|
|
577
|
-
if (this.state.pageSelectionMode === PageSelectionMode.Print)
|
|
578
|
-
this.print(items);
|
|
579
|
-
else if (this.state.pageSelectionMode === PageSelectionMode.CSV)
|
|
580
|
-
this.exportCSV(items);
|
|
581
|
-
}), onClose: () => { this.setState({ pageSelectionMode: PageSelectionMode.Hidden }); } }), _jsx(NSButton, { title: 'Chart', icon: { src: "https://static.namirasoft.com/image/concept/chart/blue.svg" }, onClick: {
|
|
582
|
-
action: () => {
|
|
583
|
-
this.showModal(" ", "This feature will be available soon in upcoming versions.");
|
|
584
|
-
},
|
|
585
|
-
showLoading: false
|
|
586
|
-
}, style: { border: '1px solid rgba(255, 148, 50, 1)', width: "128px" } }), _jsx(NSButton, { title: 'Print', icon: { src: "https://static.namirasoft.com/image/concept/print/blue.svg" }, onClick: {
|
|
587
|
-
action: () => { this.setState({ pageSelectionMode: PageSelectionMode.Print }); },
|
|
588
|
-
showLoading: false
|
|
589
|
-
}, style: { border: '1px solid rgba(255, 148, 50, 1)', width: "128px" } }), _jsx(NSButton, { title: 'Export', icon: { src: "https://static.namirasoft.com/image/concept/export/blue.svg" }, onClick: {
|
|
590
|
-
action: () => { this.setState({ pageSelectionMode: PageSelectionMode.CSV }); },
|
|
591
|
-
showLoading: false
|
|
592
|
-
}, style: { border: '1px solid rgba(255, 148, 50, 1)', width: "128px" } }), _jsx(NSButton, { title: 'Refresh', icon: { src: "https://static.namirasoft.com/image/concept/refresh/blue.svg" }, onClick: {
|
|
593
|
-
action: (onFinished) => __awaiter(this, void 0, void 0, function* () {
|
|
594
|
-
this.reload(null, null).then(onFinished).catch(onFinished);
|
|
595
|
-
})
|
|
596
|
-
}, style: { border: '1px solid rgba(3, 119, 255, 1)', width: "128px" } })] })] }) }) })] }), this.state.model.show &&
|
|
691
|
+
}, children: [_jsx("span", { children: column.text + " " + getSortSign(column) }), _jsx("div", { "data-resize-handle": "true", className: Styles.ns_resize_handle, onMouseDown: (e) => this.startResize(e, column), onClick: (e) => e.stopPropagation() })] }, column.name))] }) }), _jsx("tbody", { className: Styles.ns_tbody, children: content })] }), _jsx("div", { ref: this.TableScrollbar_Ref, className: Styles.ns_table_scrollbar, onScroll: () => {
|
|
692
|
+
var _a, _b;
|
|
693
|
+
if (this.Table_Ref.current)
|
|
694
|
+
this.Table_Ref.current.scrollLeft = (_b = (_a = this.TableScrollbar_Ref.current) === null || _a === void 0 ? void 0 : _a.scrollLeft) !== null && _b !== void 0 ? _b : 0;
|
|
695
|
+
}, children: _jsx("div", { ref: this.TableScrollbarContent_Ref, className: Styles.ns_table_scrollbar_content }) }), this.state.model.show &&
|
|
597
696
|
_jsx(NSDialogInfo, { description: this.state.model.description, onClose: () => { this.hideModal(); }, title: this.state.title, show_as_code: true, children: _jsx(_Fragment, {}) })] }));
|
|
598
697
|
}
|
|
599
698
|
}
|