namirasoft-site-react 1.4.560 → 1.4.561
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/SKILL.md +1 -1
- package/dist/ColorOperation.d.ts +27 -0
- package/dist/ColorOperation.js +145 -0
- package/dist/ColorOperation.js.map +1 -0
- package/dist/components/NSBoxBaseCombo.d.ts +2 -0
- package/dist/components/NSBoxBaseCombo.js +16 -14
- package/dist/components/NSBoxBaseCombo.js.map +1 -1
- package/dist/components/NSBoxCombo.d.ts +4 -4
- package/dist/components/NSBoxCombo.js +2 -2
- package/dist/components/NSBoxCombo.js.map +1 -1
- package/dist/components/NSBoxOptions.d.ts +32 -0
- package/dist/components/NSBoxOptions.js +105 -0
- package/dist/components/NSBoxOptions.js.map +1 -0
- package/dist/components/NSBoxOptions.module.css +54 -0
- package/dist/components/{NSChartColumn.d.ts → NSChartBar.d.ts} +6 -2
- package/dist/components/NSChartBar.js +93 -0
- package/dist/components/NSChartBar.js.map +1 -0
- package/dist/components/NSChartDoughnut.d.ts +3 -0
- package/dist/components/NSChartDoughnut.js +22 -20
- package/dist/components/NSChartDoughnut.js.map +1 -1
- package/dist/components/NSChartLine.d.ts +21 -0
- package/dist/components/NSChartLine.js +76 -0
- package/dist/components/NSChartLine.js.map +1 -0
- package/dist/components/NSChartPie.d.ts +3 -0
- package/dist/components/NSChartPie.js +20 -21
- package/dist/components/NSChartPie.js.map +1 -1
- package/dist/components/NSPagination.js +9 -8
- package/dist/components/NSPagination.js.map +1 -1
- package/dist/components/NSPagination.module.css +1 -0
- package/dist/components/NSTable.d.ts +1 -0
- package/dist/components/NSTable.js +9 -3
- package/dist/components/NSTable.js.map +1 -1
- package/dist/components/NSTableChart.d.ts +49 -0
- package/dist/components/NSTableChart.js +335 -0
- package/dist/components/NSTableChart.js.map +1 -0
- package/dist/components/NSTableChart.module.css +120 -0
- package/dist/main.d.ts +5 -2
- package/dist/main.js +5 -2
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
- package/src/ColorOperation.ts +154 -0
- package/src/components/NSBoxBaseCombo.tsx +14 -10
- package/src/components/NSBoxCombo.tsx +2 -2
- package/src/components/NSBoxOptions.module.css +54 -0
- package/src/components/NSBoxOptions.tsx +183 -0
- package/src/components/NSChartBar.tsx +135 -0
- package/src/components/NSChartDoughnut.tsx +26 -24
- package/src/components/NSChartLine.tsx +111 -0
- package/src/components/NSChartPie.tsx +23 -23
- package/src/components/NSPagination.module.css +1 -0
- package/src/components/NSPagination.tsx +14 -13
- package/src/components/NSTable.tsx +17 -1
- package/src/components/NSTableChart.module.css +120 -0
- package/src/components/NSTableChart.tsx +588 -0
- package/src/main.ts +5 -2
- package/dist/components/NSChartColumn.js +0 -95
- package/dist/components/NSChartColumn.js.map +0 -1
- package/dist/components/NSChartColumn.module.css +0 -8
- package/dist/components/NSChartTable.d.ts +0 -15
- package/dist/components/NSChartTable.js +0 -63
- package/dist/components/NSChartTable.js.map +0 -1
- package/dist/components/NSChartTable.module.css +0 -22
- package/src/components/NSChartColumn.module.css +0 -8
- package/src/components/NSChartColumn.tsx +0 -131
- package/src/components/NSChartTable.module.css +0 -22
- package/src/components/NSChartTable.tsx +0 -95
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
.ns_chart_overlay {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
right: 0;
|
|
5
|
+
left: 0;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
z-index: 950;
|
|
8
|
+
background-color: #ffffff;
|
|
9
|
+
display: flex;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.ns_chart_modal {
|
|
13
|
+
background-color: #ffffff;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
color: #141b5c;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ns_chart_header {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
padding: 12px 16px;
|
|
27
|
+
border-bottom: 1px solid #e6eef5;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ns_chart_title {
|
|
31
|
+
font-size: 16px;
|
|
32
|
+
font-weight: 700;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ns_chart_close {
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ns_chart_body {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
flex: 1;
|
|
43
|
+
min-height: 0;
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ns_chart_canvas {
|
|
48
|
+
position: relative;
|
|
49
|
+
flex: none;
|
|
50
|
+
width: 100%;
|
|
51
|
+
padding: 16px;
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ns_chart_message {
|
|
59
|
+
color: #6b73a8;
|
|
60
|
+
font-size: 16px;
|
|
61
|
+
text-align: center;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ns_chart_panel {
|
|
65
|
+
width: 100%;
|
|
66
|
+
border-top: 1px solid #e6eef5;
|
|
67
|
+
padding: 16px;
|
|
68
|
+
align-items: center;
|
|
69
|
+
flex-wrap: nowrap;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ns_chart_field {
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
gap: 8px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ns_chart_label {
|
|
79
|
+
font-size: 13px;
|
|
80
|
+
font-weight: 700;
|
|
81
|
+
color: #141b5c;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ns_chart_hint {
|
|
85
|
+
font-size: 12px;
|
|
86
|
+
color: #8a90bb;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@media only screen and (min-width: 992px) {
|
|
90
|
+
.ns_chart_header {
|
|
91
|
+
padding: 16px 20px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.ns_chart_title {
|
|
95
|
+
font-size: 18px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ns_chart_body {
|
|
99
|
+
flex-direction: row;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.ns_chart_canvas {
|
|
104
|
+
flex: 1;
|
|
105
|
+
min-width: 0;
|
|
106
|
+
min-height: 0;
|
|
107
|
+
padding: 48px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.ns_chart_panel {
|
|
111
|
+
flex: 0 0 400px;
|
|
112
|
+
width: 400px;
|
|
113
|
+
border-top: none;
|
|
114
|
+
border-left: 1px solid #e6eef5;
|
|
115
|
+
padding: 20px;
|
|
116
|
+
align-items: center;
|
|
117
|
+
min-height: 0;
|
|
118
|
+
overflow-y: auto;
|
|
119
|
+
}
|
|
120
|
+
}
|
package/dist/main.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export * from "./components/NSBoxMoney";
|
|
|
30
30
|
export * from "./components/NSBoxSensitive";
|
|
31
31
|
export * from "./components/NSBoxPhone";
|
|
32
32
|
export * from "./components/NSBoxRadio";
|
|
33
|
+
export * from "./components/NSBoxOptions";
|
|
33
34
|
export * from "./components/NSBoxSchemaBase";
|
|
34
35
|
export * from "./components/NSBoxSchemaVariable";
|
|
35
36
|
export * from "./components/NSBoxSearch";
|
|
@@ -46,11 +47,13 @@ export * from "./components/NSButtonGreen";
|
|
|
46
47
|
export * from "./components/NSButtonRed";
|
|
47
48
|
export * from "./components/NSCard";
|
|
48
49
|
export * from "./components/NSCardScreenshot";
|
|
49
|
-
export * from "./components/
|
|
50
|
+
export * from "./components/NSChartBar";
|
|
51
|
+
export * from "./components/NSChartLine";
|
|
50
52
|
export * from "./components/NSChartDoughnut";
|
|
51
53
|
export * from "./components/NSChartPie";
|
|
52
54
|
export * from "./components/NSChartRange";
|
|
53
|
-
export * from "./components/
|
|
55
|
+
export * from "./components/NSTableChart";
|
|
56
|
+
export * from "./ColorOperation";
|
|
54
57
|
export * from "./components/NSCopyBox";
|
|
55
58
|
export * from "./components/NSCopy";
|
|
56
59
|
export * from "./components/NSColumn";
|
package/dist/main.js
CHANGED
|
@@ -32,6 +32,7 @@ export * from "./components/NSBoxMoney";
|
|
|
32
32
|
export * from "./components/NSBoxSensitive";
|
|
33
33
|
export * from "./components/NSBoxPhone";
|
|
34
34
|
export * from "./components/NSBoxRadio";
|
|
35
|
+
export * from "./components/NSBoxOptions";
|
|
35
36
|
export * from "./components/NSBoxSchemaBase";
|
|
36
37
|
export * from "./components/NSBoxSchemaVariable";
|
|
37
38
|
export * from "./components/NSBoxSearch";
|
|
@@ -48,11 +49,13 @@ export * from "./components/NSButtonGreen";
|
|
|
48
49
|
export * from "./components/NSButtonRed";
|
|
49
50
|
export * from "./components/NSCard";
|
|
50
51
|
export * from "./components/NSCardScreenshot";
|
|
51
|
-
export * from "./components/
|
|
52
|
+
export * from "./components/NSChartBar";
|
|
53
|
+
export * from "./components/NSChartLine";
|
|
52
54
|
export * from "./components/NSChartDoughnut";
|
|
53
55
|
export * from "./components/NSChartPie";
|
|
54
56
|
export * from "./components/NSChartRange";
|
|
55
|
-
export * from "./components/
|
|
57
|
+
export * from "./components/NSTableChart";
|
|
58
|
+
export * from "./ColorOperation";
|
|
56
59
|
export * from "./components/NSCopyBox";
|
|
57
60
|
export * from "./components/NSCopy";
|
|
58
61
|
export * from "./components/NSColumn";
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,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B,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;QACnF,OAAO,sBAAsB,IAAI,EAAE,CAAC;IACxC,CAAC,CAAA;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
export class ColorOperation
|
|
2
|
+
{
|
|
3
|
+
private static readonly GOLDEN_ANGLE = 137.508;
|
|
4
|
+
private static readonly BASE_HUE = 210;
|
|
5
|
+
private static readonly SATURATION = 68;
|
|
6
|
+
private static readonly LIGHTNESS = 56;
|
|
7
|
+
|
|
8
|
+
private index: number;
|
|
9
|
+
|
|
10
|
+
constructor(startIndex: number = 0)
|
|
11
|
+
{
|
|
12
|
+
this.index = startIndex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
generate(): string
|
|
16
|
+
{
|
|
17
|
+
return ColorOperation.at(this.index++);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
peek(): string
|
|
21
|
+
{
|
|
22
|
+
return ColorOperation.at(this.index);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
reset(startIndex: number = 0): void
|
|
26
|
+
{
|
|
27
|
+
this.index = startIndex;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static at(index: number): string
|
|
31
|
+
{
|
|
32
|
+
let hue = ColorOperation.normalizeHue(ColorOperation.BASE_HUE + index * ColorOperation.GOLDEN_ANGLE);
|
|
33
|
+
return ColorOperation.hslToHex(hue, ColorOperation.SATURATION, ColorOperation.LIGHTNESS);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static generate(count: number): string[]
|
|
37
|
+
{
|
|
38
|
+
let colors: string[] = [];
|
|
39
|
+
for (let i = 0; i < count; i++)
|
|
40
|
+
colors.push(ColorOperation.at(i));
|
|
41
|
+
return colors;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static random(): string
|
|
45
|
+
{
|
|
46
|
+
return ColorOperation.hslToHex(Math.random() * 360, ColorOperation.SATURATION, ColorOperation.LIGHTNESS);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static randoms(count: number): string[]
|
|
50
|
+
{
|
|
51
|
+
let start = Math.random() * 360;
|
|
52
|
+
let colors: string[] = [];
|
|
53
|
+
for (let i = 0; i < count; i++)
|
|
54
|
+
{
|
|
55
|
+
let hue = ColorOperation.normalizeHue(start + i * ColorOperation.GOLDEN_ANGLE);
|
|
56
|
+
colors.push(ColorOperation.hslToHex(hue, ColorOperation.SATURATION, ColorOperation.LIGHTNESS));
|
|
57
|
+
}
|
|
58
|
+
return colors;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static next(color: string): string
|
|
62
|
+
{
|
|
63
|
+
let { h, s, l } = ColorOperation.toHsl(color);
|
|
64
|
+
return ColorOperation.hslToHex(ColorOperation.normalizeHue(h + ColorOperation.GOLDEN_ANGLE), s, l);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static prev(color: string): string
|
|
68
|
+
{
|
|
69
|
+
let { h, s, l } = ColorOperation.toHsl(color);
|
|
70
|
+
return ColorOperation.hslToHex(ColorOperation.normalizeHue(h - ColorOperation.GOLDEN_ANGLE), s, l);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static hslToHex(h: number, s: number, l: number): string
|
|
74
|
+
{
|
|
75
|
+
h = ColorOperation.normalizeHue(h);
|
|
76
|
+
s = Math.max(0, Math.min(100, s)) / 100;
|
|
77
|
+
l = Math.max(0, Math.min(100, l)) / 100;
|
|
78
|
+
|
|
79
|
+
let c = (1 - Math.abs(2 * l - 1)) * s;
|
|
80
|
+
let x = c * (1 - Math.abs(((h / 60) % 2) - 1));
|
|
81
|
+
let m = l - c / 2;
|
|
82
|
+
|
|
83
|
+
let r = 0, g = 0, b = 0;
|
|
84
|
+
if (h < 60) { r = c; g = x; b = 0; }
|
|
85
|
+
else if (h < 120) { r = x; g = c; b = 0; }
|
|
86
|
+
else if (h < 180) { r = 0; g = c; b = x; }
|
|
87
|
+
else if (h < 240) { r = 0; g = x; b = c; }
|
|
88
|
+
else if (h < 300) { r = x; g = 0; b = c; }
|
|
89
|
+
else { r = c; g = 0; b = x; }
|
|
90
|
+
|
|
91
|
+
return ColorOperation.rgbToHex((r + m) * 255, (g + m) * 255, (b + m) * 255);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
static toHsl(color: string): { h: number, s: number, l: number }
|
|
95
|
+
{
|
|
96
|
+
let trimmed = color.trim().toLowerCase();
|
|
97
|
+
if (trimmed.startsWith("hsl"))
|
|
98
|
+
{
|
|
99
|
+
let parts = trimmed.replace(/hsla?\(|\)|%/g, "").split(/[\s,/]+/).filter(Boolean);
|
|
100
|
+
return {
|
|
101
|
+
h: ColorOperation.normalizeHue(parseFloat(parts[0]) || 0),
|
|
102
|
+
s: parseFloat(parts[1]) || 0,
|
|
103
|
+
l: parseFloat(parts[2]) || 0,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
let { r, g, b } = ColorOperation.hexToRgb(trimmed);
|
|
107
|
+
return ColorOperation.rgbToHsl(r, g, b);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
private static normalizeHue(hue: number): number
|
|
111
|
+
{
|
|
112
|
+
return ((hue % 360) + 360) % 360;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
private static hexToRgb(hex: string): { r: number, g: number, b: number }
|
|
116
|
+
{
|
|
117
|
+
let value = hex.replace("#", "");
|
|
118
|
+
if (value.length === 3)
|
|
119
|
+
value = value.split("").map(ch => ch + ch).join("");
|
|
120
|
+
let num = parseInt(value, 16);
|
|
121
|
+
return {
|
|
122
|
+
r: (num >> 16) & 255,
|
|
123
|
+
g: (num >> 8) & 255,
|
|
124
|
+
b: num & 255,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private static rgbToHex(r: number, g: number, b: number): string
|
|
129
|
+
{
|
|
130
|
+
let toHex = (v: number) => Math.round(Math.max(0, Math.min(255, v))).toString(16).padStart(2, "0");
|
|
131
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`.toUpperCase();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
private static rgbToHsl(r: number, g: number, b: number): { h: number, s: number, l: number }
|
|
135
|
+
{
|
|
136
|
+
r /= 255; g /= 255; b /= 255;
|
|
137
|
+
let max = Math.max(r, g, b), min = Math.min(r, g, b);
|
|
138
|
+
let l = (max + min) / 2;
|
|
139
|
+
let d = max - min;
|
|
140
|
+
let h = 0, s = 0;
|
|
141
|
+
if (d !== 0)
|
|
142
|
+
{
|
|
143
|
+
s = d / (1 - Math.abs(2 * l - 1));
|
|
144
|
+
switch (max)
|
|
145
|
+
{
|
|
146
|
+
case r: h = ((g - b) / d) % 6; break;
|
|
147
|
+
case g: h = (b - r) / d + 2; break;
|
|
148
|
+
default: h = (r - g) / d + 4; break;
|
|
149
|
+
}
|
|
150
|
+
h *= 60;
|
|
151
|
+
}
|
|
152
|
+
return { h: ColorOperation.normalizeHue(h), s: s * 100, l: l * 100 };
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -24,6 +24,8 @@ export interface INSBoxBaseComboProps<Box> extends INSBoxBaseLayoutProps<Box, st
|
|
|
24
24
|
{
|
|
25
25
|
multiple: boolean;
|
|
26
26
|
searchable?: boolean;
|
|
27
|
+
reloadable?: boolean;
|
|
28
|
+
clearable?: boolean;
|
|
27
29
|
input?: IBaseComponentProps;
|
|
28
30
|
onLoaded?: (box: any) => void;
|
|
29
31
|
onList?: () => string | void;
|
|
@@ -369,16 +371,18 @@ export class NSBoxBaseCombo<Data> extends React.Component<NSBoxBaseComboProps<Da
|
|
|
369
371
|
}
|
|
370
372
|
});
|
|
371
373
|
}
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
374
|
+
if (this.props.reloadable !== false)
|
|
375
|
+
if (!this.state.loading)
|
|
376
|
+
items.push({
|
|
377
|
+
title: "Reload",
|
|
378
|
+
icon: "https://static.namirasoft.com/image/concept/refresh/blue.svg",
|
|
379
|
+
onClick: () =>
|
|
380
|
+
{
|
|
381
|
+
this.reload();
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
if (this.props.clearable !== false)
|
|
385
|
+
if (!this.props.required && (this.state.data || this.state.data_list.length > 0))
|
|
382
386
|
items.push({
|
|
383
387
|
title: "Clear",
|
|
384
388
|
icon: "https://static.namirasoft.com/image/concept/delete/blue.svg",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { Component, createRef } from "react";
|
|
4
4
|
import { NSBoxBaseCombo, INSBoxBaseComboProps, NSBoxBaseComboOption } from "./NSBoxBaseCombo";
|
|
5
5
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
6
6
|
import { IValidationProps } from "../props/IValidationProps";
|
|
@@ -12,7 +12,7 @@ export interface NSBoxComboProps extends IBaseComponentProps, IValidationProps,
|
|
|
12
12
|
input?: IBaseComponentProps;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export class NSBoxCombo extends
|
|
15
|
+
export class NSBoxCombo extends Component<NSBoxComboProps> implements INSBox
|
|
16
16
|
{
|
|
17
17
|
public NSBoxBaseCombo = createRef<NSBoxBaseCombo<NSBoxBaseComboOption>>();
|
|
18
18
|
constructor(props: NSBoxComboProps)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
.ns_box_options {
|
|
2
|
+
width: 100%;
|
|
3
|
+
min-height: 48px;
|
|
4
|
+
border: 1px solid #e1e1e1;
|
|
5
|
+
border-radius: 8px;
|
|
6
|
+
padding: 8px;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-wrap: wrap;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: 4px;
|
|
11
|
+
background-color: #fff;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ns_box_options_title {
|
|
15
|
+
color: #141B5C;
|
|
16
|
+
font-size: 16px;
|
|
17
|
+
font-weight: 500;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
margin-right: 4px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ns_box_options_item {
|
|
23
|
+
padding: 4px 12px;
|
|
24
|
+
border: 1px solid #d7dbec;
|
|
25
|
+
border-radius: 9999px;
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
font-weight: 500;
|
|
28
|
+
line-height: 14px;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
user-select: none;
|
|
31
|
+
background-color: #fff;
|
|
32
|
+
color: #141B5C;
|
|
33
|
+
transition: background-color 0.15s, border-color 0.15s, color 0.15s;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ns_box_options_item:hover {
|
|
38
|
+
border-color: #0377FF;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ns_box_options_item_checked {
|
|
42
|
+
background-color: #0377ff;
|
|
43
|
+
border-color: #0377FF;
|
|
44
|
+
color: #fff;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ns_box_options_item_disabled {
|
|
48
|
+
opacity: 0.5;
|
|
49
|
+
cursor: not-allowed;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ns_box_options_item_disabled:hover {
|
|
53
|
+
border-color: #d7dbec;
|
|
54
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import React, { createRef } from "react";
|
|
2
|
+
import Styles from "./NSBoxOptions.module.css";
|
|
3
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
4
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
5
|
+
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
6
|
+
import { safeMenuMenuItem } from "./NSMenuButton";
|
|
7
|
+
import { INSBoxBaseLayoutProps, NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
8
|
+
import { Validator } from "../Validator";
|
|
9
|
+
import { INSBox } from "./INSBox";
|
|
10
|
+
|
|
11
|
+
export interface NSBoxOptionsItem
|
|
12
|
+
{
|
|
13
|
+
title: string;
|
|
14
|
+
value: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface NSBoxOptionsProps extends IBaseComponentProps, IValidationProps, IValidationStringProps, INSBoxBaseLayoutProps<NSBoxOptions, string | string[]>
|
|
19
|
+
{
|
|
20
|
+
options: NSBoxOptionsItem[];
|
|
21
|
+
multiple: boolean;
|
|
22
|
+
input?: IBaseComponentProps;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface NSBoxOptionsState
|
|
26
|
+
{
|
|
27
|
+
values: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class NSBoxOptions extends React.Component<NSBoxOptionsProps, NSBoxOptionsState> implements INSBox
|
|
31
|
+
{
|
|
32
|
+
NSBoxBaseLayout_Main = createRef<NSBoxBaseLayout>();
|
|
33
|
+
|
|
34
|
+
constructor(props: NSBoxOptionsProps)
|
|
35
|
+
{
|
|
36
|
+
super(props);
|
|
37
|
+
this.state = { values: NSBoxOptions.normalize(props.defaultValue) };
|
|
38
|
+
|
|
39
|
+
this.isEmpty = this.isEmpty.bind(this);
|
|
40
|
+
this.getError = this.getError.bind(this);
|
|
41
|
+
this.getValue = this.getValue.bind(this);
|
|
42
|
+
this.setValue = this.setValue.bind(this);
|
|
43
|
+
this.toggle = this.toggle.bind(this);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private static normalize(value: string | string[] | null | undefined): string[]
|
|
47
|
+
{
|
|
48
|
+
if (value == null)
|
|
49
|
+
return [];
|
|
50
|
+
if (Array.isArray(value))
|
|
51
|
+
return [...value];
|
|
52
|
+
return [value];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
isEmpty(): boolean
|
|
56
|
+
{
|
|
57
|
+
return this.state.values.length === 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
getError(): string | null
|
|
61
|
+
{
|
|
62
|
+
let value = this.getValue(false);
|
|
63
|
+
let asString = Array.isArray(value) ? value.join(",") : value;
|
|
64
|
+
return Validator.getError(this.props.title, asString, this.props);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
getValue(checkError: boolean = true): string[] | string | null
|
|
68
|
+
{
|
|
69
|
+
if (this.props.nullable)
|
|
70
|
+
if (this.NSBoxBaseLayout_Main.current?.isNull())
|
|
71
|
+
return null;
|
|
72
|
+
|
|
73
|
+
let values = NSBoxBaseLayout.checkGetValue(this, checkError, () => this.state.values) ?? [];
|
|
74
|
+
if (this.props.multiple)
|
|
75
|
+
return values;
|
|
76
|
+
return values[0] ?? null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
setValue(value: string[] | string | null, callback?: () => void): void
|
|
80
|
+
{
|
|
81
|
+
if (this.props.multiple)
|
|
82
|
+
{
|
|
83
|
+
if (value != null && !Array.isArray(value))
|
|
84
|
+
throw new Error("When props.multiple = true, value must be string[] or null. But it is " + typeof value);
|
|
85
|
+
}
|
|
86
|
+
else
|
|
87
|
+
{
|
|
88
|
+
if (value != null && typeof value !== "string")
|
|
89
|
+
throw new Error("When props.multiple = false, value must be string or null. But it is " + typeof value);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
let values = NSBoxOptions.normalize(value);
|
|
93
|
+
if (this.props.nullable)
|
|
94
|
+
this.NSBoxBaseLayout_Main.current?.setNull(values.length === 0);
|
|
95
|
+
|
|
96
|
+
this.setState({ values }, () =>
|
|
97
|
+
{
|
|
98
|
+
this.props.onChanged?.(this);
|
|
99
|
+
callback?.();
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
setDisabled(disabled: boolean): void
|
|
104
|
+
{
|
|
105
|
+
this.NSBoxBaseLayout_Main.current?.setDisabled(disabled);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
private toggle(optionValue: string): void
|
|
109
|
+
{
|
|
110
|
+
let values = this.state.values;
|
|
111
|
+
if (this.props.multiple)
|
|
112
|
+
{
|
|
113
|
+
let next = values.includes(optionValue) ? values.filter(value => value !== optionValue) : [...values, optionValue];
|
|
114
|
+
this.setValue(next);
|
|
115
|
+
}
|
|
116
|
+
else
|
|
117
|
+
{
|
|
118
|
+
if (values.includes(optionValue))
|
|
119
|
+
{
|
|
120
|
+
if (this.props.nullable)
|
|
121
|
+
this.setValue(null);
|
|
122
|
+
}
|
|
123
|
+
else
|
|
124
|
+
this.setValue(optionValue);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private getTitleOf(values: string[]): string
|
|
129
|
+
{
|
|
130
|
+
return values
|
|
131
|
+
.map(value => this.props.options.find(option => option.value === value)?.title ?? value)
|
|
132
|
+
.join(", ");
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
override render()
|
|
136
|
+
{
|
|
137
|
+
let menu = safeMenuMenuItem(this.props, () => { });
|
|
138
|
+
let showInlineTitle = !!(this.props.hideHeader && this.props.title);
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<NSBoxBaseLayout
|
|
142
|
+
ref={this.NSBoxBaseLayout_Main}
|
|
143
|
+
{...this.props}
|
|
144
|
+
menu={menu}
|
|
145
|
+
getValue={() => this.getTitleOf(this.state.values)}
|
|
146
|
+
>
|
|
147
|
+
<div className={`${Styles.ns_box_options}`} style={{ ...this.props.input?.style }}>
|
|
148
|
+
{
|
|
149
|
+
showInlineTitle &&
|
|
150
|
+
<span className={Styles.ns_box_options_title}>
|
|
151
|
+
{this.props.required && <span style={{ color: "red" }}>*</span>}{this.props.title}
|
|
152
|
+
</span>
|
|
153
|
+
}
|
|
154
|
+
{
|
|
155
|
+
this.props.options.map((option) =>
|
|
156
|
+
{
|
|
157
|
+
let checked = this.state.values.includes(option.value);
|
|
158
|
+
return (
|
|
159
|
+
<button
|
|
160
|
+
type="button"
|
|
161
|
+
key={option.value}
|
|
162
|
+
disabled={option.disabled}
|
|
163
|
+
className={[
|
|
164
|
+
Styles.ns_box_options_item,
|
|
165
|
+
checked ? Styles.ns_box_options_item_checked : "",
|
|
166
|
+
option.disabled ? Styles.ns_box_options_item_disabled : "",
|
|
167
|
+
].filter(Boolean).join(" ")}
|
|
168
|
+
onClick={() =>
|
|
169
|
+
{
|
|
170
|
+
this.props.onClicked?.(this);
|
|
171
|
+
this.toggle(option.value);
|
|
172
|
+
}}
|
|
173
|
+
>
|
|
174
|
+
{option.title}
|
|
175
|
+
</button>
|
|
176
|
+
);
|
|
177
|
+
})
|
|
178
|
+
}
|
|
179
|
+
</div>
|
|
180
|
+
</NSBoxBaseLayout>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
}
|