namirasoft-site-react 1.4.564 → 1.4.566
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/App.d.ts +13 -16
- package/dist/App.js +87 -94
- package/dist/App.js.map +1 -1
- package/dist/LinkOperation.d.ts +3 -1
- package/dist/LinkOperation.js +12 -0
- package/dist/LinkOperation.js.map +1 -1
- package/package.json +1 -1
- package/src/App.tsx +118 -149
- package/src/LinkOperation.ts +15 -0
package/dist/App.d.ts
CHANGED
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import './App.css';
|
|
4
|
-
import {
|
|
4
|
+
import { NSTable } from './main';
|
|
5
5
|
type TestRow = {
|
|
6
6
|
id: string;
|
|
7
|
-
|
|
7
|
+
name: string;
|
|
8
|
+
city: string;
|
|
9
|
+
department: string;
|
|
10
|
+
age: number;
|
|
11
|
+
salary: number;
|
|
12
|
+
score: number;
|
|
13
|
+
experience: number;
|
|
8
14
|
percentage: number;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
id: string;
|
|
13
|
-
parent_id: string | null;
|
|
14
|
-
title: string;
|
|
15
|
-
percentage: number;
|
|
16
|
-
url: string;
|
|
15
|
+
phone: string;
|
|
16
|
+
email: string;
|
|
17
|
+
created_at: string;
|
|
17
18
|
};
|
|
18
19
|
interface AppProps {
|
|
19
20
|
}
|
|
20
21
|
interface AppState {
|
|
21
|
-
dialog_show: boolean;
|
|
22
|
-
dialog_loading: boolean;
|
|
23
22
|
}
|
|
24
23
|
export declare class App extends Component<AppProps, AppState> {
|
|
25
|
-
NSBoxDateRef: import("react").RefObject<NSBoxDate>;
|
|
26
|
-
NSBoxTimeRangeRef: import("react").RefObject<NSBoxTimeRange>;
|
|
27
|
-
NSBoxDateRangeRef: import("react").RefObject<NSBoxDateRange>;
|
|
28
24
|
NSTableRef: import("react").RefObject<NSTable<TestRow>>;
|
|
29
|
-
NSTreeTableRef: import("react").RefObject<NSTable<TreeRow>>;
|
|
30
25
|
constructor(props: AppProps);
|
|
26
|
+
componentDidMount(): void;
|
|
27
|
+
componentWillUnmount(): void;
|
|
31
28
|
render(): import("react").JSX.Element;
|
|
32
29
|
}
|
|
33
30
|
export {};
|
package/dist/App.js
CHANGED
|
@@ -13,36 +13,43 @@ import { Component, createRef } from 'react';
|
|
|
13
13
|
import './App.css';
|
|
14
14
|
import { NSLayout } from './components/NSLayout';
|
|
15
15
|
import { PercentFormatter } from './formatter/PercentFormatter';
|
|
16
|
-
import {
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
import { DateTimeFormatter, EmailFormatter, IntegerFormatter, KeyOperation, NSButtonBlue, NSTable, PhoneFormatter, StringFormatter } from './main';
|
|
17
|
+
const FIRST_NAMES = ["Amin", "Negar", "Milad", "Sara", "Reza", "Maryam", "Ali", "Fatemeh", "Hossein", "Zahra", "Mohammad", "Narges", "Saeed", "Leila", "Hamed"];
|
|
18
|
+
const LAST_NAMES = ["Pasban", "Sharifpour", "Nazirzadeh", "Ahmadi", "Karimi", "Hosseini", "Rezaei", "Moradi", "Jafari", "Bagheri", "Salehi", "Ghasemi", "Akbari", "Mousavi", "Tavakoli"];
|
|
19
|
+
const CITIES = ["Tehran", "Shiraz", "Tabriz", "Isfahan", "Mashhad"];
|
|
20
|
+
const DEPARTMENTS = ["Engineering", "Sales", "Marketing", "Support", "Finance"];
|
|
21
|
+
const ALL_ROWS = Array.from({ length: 45 }, (_, i) => {
|
|
22
|
+
const n = i + 1;
|
|
23
|
+
return {
|
|
24
|
+
id: n.toString(),
|
|
25
|
+
name: `${FIRST_NAMES[i % FIRST_NAMES.length]} ${LAST_NAMES[(i * 7) % LAST_NAMES.length]}`,
|
|
26
|
+
city: CITIES[i % CITIES.length],
|
|
27
|
+
department: DEPARTMENTS[(i * 3) % DEPARTMENTS.length],
|
|
28
|
+
age: 22 + (i * 5) % 35,
|
|
29
|
+
salary: 30000 + (i * 1700) % 90000,
|
|
30
|
+
score: 40 + (i * 11) % 60,
|
|
31
|
+
experience: (i * 2) % 20,
|
|
32
|
+
percentage: 10 + (i * 13) % 80,
|
|
33
|
+
phone: "0912" + (1000000 + i).toString(),
|
|
34
|
+
email: `${FIRST_NAMES[i % FIRST_NAMES.length].toLowerCase()}.${n}@example.com`,
|
|
35
|
+
created_at: new Date(Date.now() - i * 86400000 - i * 3600000).toISOString()
|
|
36
|
+
};
|
|
37
|
+
});
|
|
30
38
|
export class App extends Component {
|
|
31
39
|
constructor(props) {
|
|
32
40
|
super(props);
|
|
33
|
-
this.NSBoxDateRef = createRef();
|
|
34
|
-
this.NSBoxTimeRangeRef = createRef();
|
|
35
|
-
this.NSBoxDateRangeRef = createRef();
|
|
36
41
|
this.NSTableRef = createRef();
|
|
37
|
-
this.
|
|
38
|
-
this.state = {
|
|
39
|
-
dialog_show: false,
|
|
40
|
-
dialog_loading: false,
|
|
41
|
-
};
|
|
42
|
+
this.state = {};
|
|
42
43
|
}
|
|
43
44
|
;
|
|
45
|
+
componentDidMount() {
|
|
46
|
+
KeyOperation.start();
|
|
47
|
+
}
|
|
48
|
+
componentWillUnmount() {
|
|
49
|
+
KeyOperation.stop();
|
|
50
|
+
}
|
|
44
51
|
render() {
|
|
45
|
-
return (
|
|
52
|
+
return (_jsxs(NSLayout, { header: {
|
|
46
53
|
right: {
|
|
47
54
|
icons: [
|
|
48
55
|
{
|
|
@@ -54,77 +61,63 @@ export class App extends Component {
|
|
|
54
61
|
},
|
|
55
62
|
mega_menu: true,
|
|
56
63
|
onCollapse: () => { },
|
|
57
|
-
}, isLoggedIn: () => true, logo: 'https://static.namirasoft.com/image/namirasoft/access/logo/base.png', background: { image: "https://static.namirasoft.com/image/namirasoft/access/background/base.svg" }, notifications: [], notifier: {}, scope: '', children:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
name: "url",
|
|
115
|
-
text: "URL",
|
|
116
|
-
formatter: new URLFormatter(),
|
|
117
|
-
defaults: { hidden: true }
|
|
118
|
-
},
|
|
119
|
-
], getRowKey: (item) => item.value.id, getRows: () => __awaiter(this, void 0, void 0, function* () { return ({ count: TREE_DATA.length, rows: TREE_DATA }); }), ui: { pagination: false, button_panel: false } }), _jsx(NSBoxDate, { ref: this.NSBoxDateRef, title: "Date", required: true }), _jsx(NSBoxDateRange, { ref: this.NSBoxDateRangeRef, required: true, title: 'Range' }), _jsx(NSBoxTimeRange, { ref: this.NSBoxTimeRangeRef, required: true, title: 'Time Range', preset: true }), _jsx(NSButtonBlue, { title: "Log Data", onClick: {
|
|
120
|
-
showLoading: false,
|
|
121
|
-
action: () => {
|
|
122
|
-
var _a, _b, _c;
|
|
123
|
-
console.log((_a = this.NSBoxDateRef.current) === null || _a === void 0 ? void 0 : _a.getValue(false));
|
|
124
|
-
console.log((_b = this.NSBoxDateRangeRef.current) === null || _b === void 0 ? void 0 : _b.getValue(false));
|
|
125
|
-
console.log((_c = this.NSBoxTimeRangeRef.current) === null || _c === void 0 ? void 0 : _c.setValue({ from: "12:00:00", to: "13:00:00" }));
|
|
126
|
-
}
|
|
127
|
-
} })] }) }));
|
|
64
|
+
}, isLoggedIn: () => true, logo: 'https://static.namirasoft.com/image/namirasoft/access/logo/base.png', background: { image: "https://static.namirasoft.com/image/namirasoft/access/background/base.svg" }, notifications: [], notifier: {}, scope: '', children: [_jsx(NSTable, { ref: this.NSTableRef, name: "test_table", checkbox: true, columns: [
|
|
65
|
+
{
|
|
66
|
+
table: { name: "test_table", text: "Test Table" },
|
|
67
|
+
index: 0, type: "String", name: "name", text: "Name", formatter: new StringFormatter()
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
table: { name: "test_table", text: "Test Table" },
|
|
71
|
+
index: 1, type: "String", name: "city", text: "City", formatter: new StringFormatter()
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
table: { name: "test_table", text: "Test Table" },
|
|
75
|
+
index: 2, type: "String", name: "department", text: "Department", formatter: new StringFormatter()
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
table: { name: "test_table", text: "Test Table" },
|
|
79
|
+
index: 3, type: "Number", name: "age", text: "Age", formatter: new IntegerFormatter()
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
table: { name: "test_table", text: "Test Table" },
|
|
83
|
+
index: 4, type: "Number", name: "salary", text: "Salary", formatter: new IntegerFormatter()
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
table: { name: "test_table", text: "Test Table" },
|
|
87
|
+
index: 5, type: "Number", name: "score", text: "Score", formatter: new IntegerFormatter()
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
table: { name: "test_table", text: "Test Table" },
|
|
91
|
+
index: 6, type: "Number", name: "experience", text: "Experience", formatter: new IntegerFormatter()
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
table: { name: "test_table", text: "Test Table" },
|
|
95
|
+
index: 7, type: "Number", name: "percentage", text: "Percentage", formatter: new PercentFormatter()
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
table: { name: "test_table", text: "Test Table" },
|
|
99
|
+
index: 8, type: "String", name: "phone", text: "Phone", formatter: new PhoneFormatter()
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
table: { name: "test_table", text: "Test Table" },
|
|
103
|
+
index: 9, type: "String", name: "email", text: "Email", formatter: new EmailFormatter()
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
table: { name: "test_table", text: "Test Table" },
|
|
107
|
+
index: 10, type: "DateTime", name: "created_at", text: "Created At", formatter: new DateTimeFormatter()
|
|
108
|
+
},
|
|
109
|
+
], getRowKey: (item) => item.value.id, getRows: (page, size) => __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
const start = (page - 1) * size;
|
|
111
|
+
return {
|
|
112
|
+
count: ALL_ROWS.length,
|
|
113
|
+
rows: ALL_ROWS.slice(start, start + size)
|
|
114
|
+
};
|
|
115
|
+
}), getRowCheckboxDisabled: row => row.value.percentage < 20 }), _jsx(NSButtonBlue, { title: "Log", onClick: {
|
|
116
|
+
showLoading: false,
|
|
117
|
+
action: () => {
|
|
118
|
+
console.log(KeyOperation.isControlPressed());
|
|
119
|
+
}
|
|
120
|
+
} })] }));
|
|
128
121
|
}
|
|
129
122
|
}
|
|
130
123
|
//# sourceMappingURL=App.js.map
|
package/dist/App.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.js","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO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KAAK,GAAG,IAAI,CAAC;yBAC5C,CAAC;oBACN,CAAC,CAAA,EACD,sBAAsB,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE,GAC1D,EACF,KAAC,YAAY,IACT,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE;wBACL,WAAW,EAAE,KAAK;wBAClB,MAAM,EAAE,GAAG,EAAE;4BAET,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,gBAAgB,EAAE,CAAC,CAAC;wBACjD,CAAC;qBACJ,GACH,IACK,CACd,CAAC;IACN,CAAC;CACJ"}
|
package/dist/LinkOperation.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NavigateFunction, NavigateOptions } from "react-router-dom";
|
|
2
2
|
export declare enum LinkTarget {
|
|
3
3
|
Self = "_self",
|
|
4
|
-
Blank = "_blank"
|
|
4
|
+
Blank = "_blank",
|
|
5
|
+
Window = "_window"
|
|
5
6
|
}
|
|
6
7
|
export declare class LinkOperation {
|
|
7
8
|
private static navigate?;
|
|
@@ -10,6 +11,7 @@ export declare class LinkOperation {
|
|
|
10
11
|
private static isExternal;
|
|
11
12
|
static open(url: string, target?: LinkTarget, options?: NavigateOptions): void;
|
|
12
13
|
static openBlank(url: string): void;
|
|
14
|
+
static openWindow(url: string): void;
|
|
13
15
|
static openSelf(url: string, options?: NavigateOptions): void;
|
|
14
16
|
static replace(url: string, options?: NavigateOptions): void;
|
|
15
17
|
static back(): void;
|
package/dist/LinkOperation.js
CHANGED
|
@@ -3,6 +3,7 @@ export var LinkTarget;
|
|
|
3
3
|
(function (LinkTarget) {
|
|
4
4
|
LinkTarget["Self"] = "_self";
|
|
5
5
|
LinkTarget["Blank"] = "_blank";
|
|
6
|
+
LinkTarget["Window"] = "_window";
|
|
6
7
|
})(LinkTarget || (LinkTarget = {}));
|
|
7
8
|
export class LinkOperation {
|
|
8
9
|
static setNavigate(navigate) {
|
|
@@ -11,6 +12,8 @@ export class LinkOperation {
|
|
|
11
12
|
static resolveTarget(target) {
|
|
12
13
|
if (target)
|
|
13
14
|
return target;
|
|
15
|
+
if (KeyOperation.isShiftPressed())
|
|
16
|
+
return LinkTarget.Window;
|
|
14
17
|
if (KeyOperation.isControlPressed() || KeyOperation.isMetaPressed())
|
|
15
18
|
return LinkTarget.Blank;
|
|
16
19
|
return LinkTarget.Self;
|
|
@@ -24,6 +27,10 @@ export class LinkOperation {
|
|
|
24
27
|
LinkOperation.openBlank(url);
|
|
25
28
|
return;
|
|
26
29
|
}
|
|
30
|
+
if (resolved === LinkTarget.Window) {
|
|
31
|
+
LinkOperation.openWindow(url);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
27
34
|
if (LinkOperation.isExternal(url) || !LinkOperation.navigate) {
|
|
28
35
|
window.location.href = url;
|
|
29
36
|
return;
|
|
@@ -35,6 +42,11 @@ export class LinkOperation {
|
|
|
35
42
|
return;
|
|
36
43
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
37
44
|
}
|
|
45
|
+
static openWindow(url) {
|
|
46
|
+
if (typeof window === "undefined")
|
|
47
|
+
return;
|
|
48
|
+
window.open(url, "_blank", "noopener,noreferrer,popup");
|
|
49
|
+
}
|
|
38
50
|
static openSelf(url, options) {
|
|
39
51
|
LinkOperation.open(url, LinkTarget.Self, options);
|
|
40
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkOperation.js","sourceRoot":"","sources":["../src/LinkOperation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"LinkOperation.js","sourceRoot":"","sources":["../src/LinkOperation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IAElB,4BAAc,CAAA;IACd,8BAA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J"}
|
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -3,53 +3,70 @@ import { Component, createRef } from 'react';
|
|
|
3
3
|
import './App.css';
|
|
4
4
|
import { NSLayout } from './components/NSLayout';
|
|
5
5
|
import { PercentFormatter } from './formatter/PercentFormatter';
|
|
6
|
-
import
|
|
7
|
-
{ NSBoxDate, NSBoxDateRange, NSBoxTimeRange, NSButtonBlue, NSColumn, NSTable, StringFormatter, URLFormatter } from './main';
|
|
6
|
+
import { DateTimeFormatter, EmailFormatter, IntegerFormatter, KeyOperation, NSButtonBlue, NSTable, PhoneFormatter, StringFormatter } from './main';
|
|
8
7
|
|
|
8
|
+
type TestRow = {
|
|
9
|
+
id: string,
|
|
10
|
+
name: string,
|
|
11
|
+
city: string,
|
|
12
|
+
department: string,
|
|
13
|
+
age: number,
|
|
14
|
+
salary: number,
|
|
15
|
+
score: number,
|
|
16
|
+
experience: number,
|
|
17
|
+
percentage: number,
|
|
18
|
+
phone: string,
|
|
19
|
+
email: string,
|
|
20
|
+
created_at: string,
|
|
21
|
+
};
|
|
9
22
|
|
|
10
|
-
|
|
23
|
+
const FIRST_NAMES = ["Amin", "Negar", "Milad", "Sara", "Reza", "Maryam", "Ali", "Fatemeh", "Hossein", "Zahra", "Mohammad", "Narges", "Saeed", "Leila", "Hamed"];
|
|
24
|
+
const LAST_NAMES = ["Pasban", "Sharifpour", "Nazirzadeh", "Ahmadi", "Karimi", "Hosseini", "Rezaei", "Moradi", "Jafari", "Bagheri", "Salehi", "Ghasemi", "Akbari", "Mousavi", "Tavakoli"];
|
|
25
|
+
const CITIES = ["Tehran", "Shiraz", "Tabriz", "Isfahan", "Mashhad"];
|
|
26
|
+
const DEPARTMENTS = ["Engineering", "Sales", "Marketing", "Support", "Finance"];
|
|
11
27
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
const ALL_ROWS: TestRow[] = Array.from({ length: 45 }, (_, i) =>
|
|
29
|
+
{
|
|
30
|
+
const n = i + 1;
|
|
31
|
+
return {
|
|
32
|
+
id: n.toString(),
|
|
33
|
+
name: `${FIRST_NAMES[i % FIRST_NAMES.length]} ${LAST_NAMES[(i * 7) % LAST_NAMES.length]}`,
|
|
34
|
+
city: CITIES[i % CITIES.length],
|
|
35
|
+
department: DEPARTMENTS[(i * 3) % DEPARTMENTS.length],
|
|
36
|
+
age: 22 + (i * 5) % 35,
|
|
37
|
+
salary: 30000 + (i * 1700) % 90000,
|
|
38
|
+
score: 40 + (i * 11) % 60,
|
|
39
|
+
experience: (i * 2) % 20,
|
|
40
|
+
percentage: 10 + (i * 13) % 80,
|
|
41
|
+
phone: "0912" + (1000000 + i).toString(),
|
|
42
|
+
email: `${FIRST_NAMES[i % FIRST_NAMES.length].toLowerCase()}.${n}@example.com`,
|
|
43
|
+
created_at: new Date(Date.now() - i * 86400000 - i * 3600000).toISOString()
|
|
44
|
+
};
|
|
45
|
+
});
|
|
28
46
|
|
|
29
47
|
interface AppProps { }
|
|
30
|
-
interface AppState
|
|
31
|
-
{
|
|
32
|
-
dialog_show: boolean;
|
|
33
|
-
dialog_loading: boolean;
|
|
34
|
-
}
|
|
48
|
+
interface AppState { }
|
|
35
49
|
|
|
36
50
|
export class App extends Component<AppProps, AppState>
|
|
37
51
|
{
|
|
38
|
-
NSBoxDateRef = createRef<NSBoxDate>();
|
|
39
|
-
NSBoxTimeRangeRef = createRef<NSBoxTimeRange>();
|
|
40
|
-
NSBoxDateRangeRef = createRef<NSBoxDateRange>();
|
|
41
52
|
NSTableRef = createRef<NSTable<TestRow>>();
|
|
42
|
-
NSTreeTableRef = createRef<NSTable<TreeRow>>();
|
|
43
53
|
|
|
44
54
|
constructor(props: AppProps)
|
|
45
55
|
{
|
|
46
56
|
super(props);
|
|
47
|
-
this.state = {
|
|
48
|
-
dialog_show: false,
|
|
49
|
-
dialog_loading: false,
|
|
50
|
-
}
|
|
57
|
+
this.state = {}
|
|
51
58
|
};
|
|
52
59
|
|
|
60
|
+
override componentDidMount(): void
|
|
61
|
+
{
|
|
62
|
+
KeyOperation.start();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
override componentWillUnmount(): void
|
|
66
|
+
{
|
|
67
|
+
KeyOperation.stop();
|
|
68
|
+
}
|
|
69
|
+
|
|
53
70
|
override render()
|
|
54
71
|
{
|
|
55
72
|
return (
|
|
@@ -74,125 +91,77 @@ export class App extends Component<AppProps, AppState>
|
|
|
74
91
|
notifier={{} as any}
|
|
75
92
|
scope=''
|
|
76
93
|
>
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
columns={[
|
|
83
|
-
{
|
|
84
|
-
table: { name: TEST_TABLE, text: "Test Table" },
|
|
85
|
-
index: 0,
|
|
86
|
-
type: "String",
|
|
87
|
-
name: "title",
|
|
88
|
-
text: "Title",
|
|
89
|
-
formatter: new StringFormatter()
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
table: { name: TEST_TABLE, text: "Test Table" },
|
|
93
|
-
index: 1,
|
|
94
|
-
type: "Number",
|
|
95
|
-
name: "percentage",
|
|
96
|
-
text: "Percentage",
|
|
97
|
-
formatter: new PercentFormatter()
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
{
|
|
101
|
-
table: { name: TEST_TABLE, text: "Test Table" },
|
|
102
|
-
index: 2,
|
|
103
|
-
type: "String",
|
|
104
|
-
name: "url",
|
|
105
|
-
text: "URL",
|
|
106
|
-
formatter: new URLFormatter(),
|
|
107
|
-
defaults: { hidden: true }
|
|
108
|
-
},
|
|
109
|
-
]}
|
|
110
|
-
getRowKey={(item) => item.value.id}
|
|
111
|
-
getRows={async () =>
|
|
94
|
+
<NSTable<TestRow>
|
|
95
|
+
ref={this.NSTableRef}
|
|
96
|
+
name={"test_table"}
|
|
97
|
+
checkbox
|
|
98
|
+
columns={[
|
|
112
99
|
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
{ id: "1", title: "Amin", percentage: 19, url: "https://example.com/amin" },
|
|
117
|
-
{ id: "2", title: "Negar", percentage: 21, url: "example.com/negar" },
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
}}
|
|
121
|
-
getRowCheckboxDisabled={row =>
|
|
100
|
+
table: { name: "test_table", text: "Test Table" },
|
|
101
|
+
index: 0, type: "String", name: "name", text: "Name", formatter: new StringFormatter()
|
|
102
|
+
},
|
|
122
103
|
{
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
title="Log Data"
|
|
185
|
-
onClick={{
|
|
186
|
-
showLoading: false,
|
|
187
|
-
action: () =>
|
|
188
|
-
{
|
|
189
|
-
console.log(this.NSBoxDateRef.current?.getValue(false))
|
|
190
|
-
console.log(this.NSBoxDateRangeRef.current?.getValue(false))
|
|
191
|
-
console.log(this.NSBoxTimeRangeRef.current?.setValue({ from: "12:00:00", to: "13:00:00" }))
|
|
192
|
-
}
|
|
193
|
-
}}
|
|
194
|
-
/>
|
|
195
|
-
</NSColumn>
|
|
104
|
+
table: { name: "test_table", text: "Test Table" },
|
|
105
|
+
index: 1, type: "String", name: "city", text: "City", formatter: new StringFormatter()
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
table: { name: "test_table", text: "Test Table" },
|
|
109
|
+
index: 2, type: "String", name: "department", text: "Department", formatter: new StringFormatter()
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
table: { name: "test_table", text: "Test Table" },
|
|
113
|
+
index: 3, type: "Number", name: "age", text: "Age", formatter: new IntegerFormatter()
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
table: { name: "test_table", text: "Test Table" },
|
|
117
|
+
index: 4, type: "Number", name: "salary", text: "Salary", formatter: new IntegerFormatter()
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
table: { name: "test_table", text: "Test Table" },
|
|
121
|
+
index: 5, type: "Number", name: "score", text: "Score", formatter: new IntegerFormatter()
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
table: { name: "test_table", text: "Test Table" },
|
|
125
|
+
index: 6, type: "Number", name: "experience", text: "Experience", formatter: new IntegerFormatter()
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
table: { name: "test_table", text: "Test Table" },
|
|
129
|
+
index: 7, type: "Number", name: "percentage", text: "Percentage", formatter: new PercentFormatter()
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
table: { name: "test_table", text: "Test Table" },
|
|
133
|
+
index: 8, type: "String", name: "phone", text: "Phone", formatter: new PhoneFormatter()
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
table: { name: "test_table", text: "Test Table" },
|
|
137
|
+
index: 9, type: "String", name: "email", text: "Email", formatter: new EmailFormatter()
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
table: { name: "test_table", text: "Test Table" },
|
|
141
|
+
index: 10, type: "DateTime", name: "created_at", text: "Created At", formatter: new DateTimeFormatter()
|
|
142
|
+
},
|
|
143
|
+
]}
|
|
144
|
+
getRowKey={(item) => item.value.id}
|
|
145
|
+
getRows={async (page, size) =>
|
|
146
|
+
{
|
|
147
|
+
const start = (page - 1) * size;
|
|
148
|
+
return {
|
|
149
|
+
count: ALL_ROWS.length,
|
|
150
|
+
rows: ALL_ROWS.slice(start, start + size)
|
|
151
|
+
};
|
|
152
|
+
}}
|
|
153
|
+
getRowCheckboxDisabled={row => row.value.percentage < 20}
|
|
154
|
+
/>
|
|
155
|
+
<NSButtonBlue
|
|
156
|
+
title={"Log"}
|
|
157
|
+
onClick={{
|
|
158
|
+
showLoading: false,
|
|
159
|
+
action: () =>
|
|
160
|
+
{
|
|
161
|
+
console.log(KeyOperation.isControlPressed());
|
|
162
|
+
}
|
|
163
|
+
}}
|
|
164
|
+
/>
|
|
196
165
|
</NSLayout>
|
|
197
166
|
);
|
|
198
167
|
}
|
package/src/LinkOperation.ts
CHANGED
|
@@ -5,6 +5,7 @@ export enum LinkTarget
|
|
|
5
5
|
{
|
|
6
6
|
Self = "_self",
|
|
7
7
|
Blank = "_blank",
|
|
8
|
+
Window = "_window",
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export class LinkOperation
|
|
@@ -20,6 +21,8 @@ export class LinkOperation
|
|
|
20
21
|
{
|
|
21
22
|
if (target)
|
|
22
23
|
return target;
|
|
24
|
+
if (KeyOperation.isShiftPressed())
|
|
25
|
+
return LinkTarget.Window;
|
|
23
26
|
if (KeyOperation.isControlPressed() || KeyOperation.isMetaPressed())
|
|
24
27
|
return LinkTarget.Blank;
|
|
25
28
|
return LinkTarget.Self;
|
|
@@ -38,6 +41,11 @@ export class LinkOperation
|
|
|
38
41
|
LinkOperation.openBlank(url);
|
|
39
42
|
return;
|
|
40
43
|
}
|
|
44
|
+
if (resolved === LinkTarget.Window)
|
|
45
|
+
{
|
|
46
|
+
LinkOperation.openWindow(url);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
41
49
|
if (LinkOperation.isExternal(url) || !LinkOperation.navigate)
|
|
42
50
|
{
|
|
43
51
|
window.location.href = url;
|
|
@@ -53,6 +61,13 @@ export class LinkOperation
|
|
|
53
61
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
54
62
|
}
|
|
55
63
|
|
|
64
|
+
static openWindow(url: string): void
|
|
65
|
+
{
|
|
66
|
+
if (typeof window === "undefined")
|
|
67
|
+
return;
|
|
68
|
+
window.open(url, "_blank", "noopener,noreferrer,popup");
|
|
69
|
+
}
|
|
70
|
+
|
|
56
71
|
static openSelf(url: string, options?: NavigateOptions): void
|
|
57
72
|
{
|
|
58
73
|
LinkOperation.open(url, LinkTarget.Self, options);
|