namirasoft-site-react 1.4.548 → 1.4.550

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.
Files changed (30) hide show
  1. package/dist/components/NSBoxBaseLayout.d.ts +1 -0
  2. package/dist/components/NSBoxBaseLayout.js +5 -0
  3. package/dist/components/NSBoxBaseLayout.js.map +1 -1
  4. package/dist/components/NSBoxDateRange.d.ts +1 -0
  5. package/dist/components/NSBoxDateRange.js +6 -6
  6. package/dist/components/NSBoxDateRange.js.map +1 -1
  7. package/dist/components/NSBoxDateRangeBase.d.ts +1 -0
  8. package/dist/components/NSBoxDateRangeBase.js +7 -4
  9. package/dist/components/NSBoxDateRangeBase.js.map +1 -1
  10. package/dist/components/NSBoxDateRangeBase.module.css +8 -24
  11. package/dist/components/NSBoxDateTimeRange.js +5 -3
  12. package/dist/components/NSBoxDateTimeRange.js.map +1 -1
  13. package/dist/components/NSBoxTimeRange.js +2 -0
  14. package/dist/components/NSBoxTimeRange.js.map +1 -1
  15. package/dist/components/NSButton.d.ts +3 -2
  16. package/dist/components/NSButton.js +3 -5
  17. package/dist/components/NSButton.js.map +1 -1
  18. package/dist/components/NSTable.js +1 -1
  19. package/dist/components/NSTable.js.map +1 -1
  20. package/dist/components/NSTable.module.css +248 -239
  21. package/package.json +1 -1
  22. package/src/components/NSBoxBaseLayout.tsx +5 -0
  23. package/src/components/NSBoxDateRange.tsx +8 -6
  24. package/src/components/NSBoxDateRangeBase.module.css +8 -24
  25. package/src/components/NSBoxDateRangeBase.tsx +8 -4
  26. package/src/components/NSBoxDateTimeRange.tsx +5 -3
  27. package/src/components/NSBoxTimeRange.tsx +2 -0
  28. package/src/components/NSButton.tsx +7 -8
  29. package/src/components/NSTable.module.css +248 -239
  30. package/src/components/NSTable.tsx +2 -2
@@ -1,312 +1,321 @@
1
1
  .ns_table {
2
- display: flex;
3
- flex-direction: column;
4
- overflow-x: auto;
5
- color: rgba(20, 27, 92);
2
+ display: flex;
3
+ flex-direction: column;
4
+ overflow-x: auto;
5
+ color: rgba(20, 27, 92);
6
6
  }
7
7
 
8
8
  .ns_search_input {
9
- display: flex;
10
- justify-content: space-between;
11
- align-items: center;
12
- flex-wrap: wrap;
13
- position: relative;
14
- z-index: -1;
9
+ display: flex;
10
+ justify-content: space-between;
11
+ align-items: center;
12
+ flex-wrap: wrap;
13
+ position: relative;
14
+ z-index: -1;
15
15
  }
16
16
 
17
17
  .ns_search_input {
18
- display: flex;
19
- justify-content: space-between;
20
- align-items: center;
21
- flex-wrap: wrap;
22
- position: relative;
23
- z-index: -1;
18
+ display: flex;
19
+ justify-content: space-between;
20
+ align-items: center;
21
+ flex-wrap: wrap;
22
+ position: relative;
23
+ z-index: -1;
24
24
  }
25
25
 
26
26
  .ns_table thead {
27
- display: none;
27
+ display: none;
28
28
  }
29
29
 
30
30
  .ns_table tr {
31
- border-radius: 0px;
32
- padding: 16px 8px;
33
- display: block;
34
- background-color: #fff;
35
- transition: all 0.2s ease-in-out;
31
+ border-radius: 0px;
32
+ padding: 16px 8px;
33
+ display: block;
34
+ background-color: #fff;
35
+ transition: all 0.2s ease-in-out;
36
36
  }
37
37
 
38
38
  .ns_table tbody tr {
39
- cursor: pointer;
39
+ cursor: pointer;
40
40
  }
41
41
 
42
42
  .ns_table td {
43
- display: flex;
44
- flex-direction: row;
45
- gap: 16px;
46
- margin: 8px;
47
- padding: 8px 0;
48
- font-size: 16px;
49
- justify-content: left;
50
- align-items: center;
51
- color: #000;
52
- height: max-content;
53
- max-height: 3rem;
54
- line-clamp: 2;
55
- -webkit-line-clamp: 2;
56
- -webkit-box-orient: vertical;
57
- overflow: hidden;
58
- padding-top: 0 !important;
59
- padding-bottom: 0 !important;
60
- overflow-wrap: break-word;
61
- word-break: break-word;
43
+ display: flex;
44
+ flex-direction: row;
45
+ gap: 16px;
46
+ margin: 8px;
47
+ padding: 8px 0;
48
+ font-size: 16px;
49
+ justify-content: left;
50
+ align-items: center;
51
+ color: #000;
52
+ height: max-content;
53
+ max-height: 3rem;
54
+ line-clamp: 2;
55
+ -webkit-line-clamp: 2;
56
+ -webkit-box-orient: vertical;
57
+ overflow: hidden;
58
+ padding-top: 0 !important;
59
+ padding-bottom: 0 !important;
60
+ overflow-wrap: break-word;
61
+ word-break: break-word;
62
62
  }
63
63
 
64
64
  .ns_table td::before {
65
- content: attr(data-label);
66
- font-weight: bold;
67
- float: left;
68
- min-width: 30%;
65
+ content: attr(data-label);
66
+ font-weight: bold;
67
+ float: left;
68
+ min-width: 30%;
69
69
  }
70
70
 
71
71
  .ns_tbody tr:nth-child(odd) {
72
- background-color: #f5f5f5;
72
+ background-color: #f5f5f5;
73
73
  }
74
74
 
75
75
  .ns_tbody tr:nth-child(even) {
76
- background-color: #ffffff;
76
+ background-color: #ffffff;
77
77
  }
78
78
 
79
79
  .ns_tbody tr:hover {
80
- background-color: rgb(184, 190, 240, 0.32);
80
+ background-color: rgb(184, 190, 240, 0.32);
81
81
  }
82
82
 
83
83
  .ns_tbody tr.ns_selected {
84
- background-color: rgb(184, 190, 240, 0.64);
84
+ background-color: rgb(184, 190, 240, 0.64);
85
85
  }
86
86
 
87
87
  .ns_table tfoot {
88
- padding: 1rem 0 0;
89
- display: flex;
90
- flex-direction: column;
91
- align-items: center;
88
+ padding: 1rem 0 0;
89
+ display: flex;
90
+ flex-direction: column;
91
+ align-items: center;
92
92
  }
93
93
 
94
94
  /* Check Box */
95
95
  .ns_check_box {
96
- width: 100%;
97
- text-align: center;
96
+ width: 100%;
97
+ text-align: center;
98
98
  }
99
99
 
100
100
  .ns_check_box {
101
- height: 24px;
102
- width: 24px !important;
103
- cursor: pointer;
101
+ height: 24px;
102
+ width: 24px !important;
103
+ cursor: pointer;
104
104
  }
105
105
 
106
106
  .ns_check_box:checked {
107
- accent-color: #141B5C;
107
+ accent-color: #141B5C;
108
108
  }
109
109
 
110
110
  .ns_check_box_label {
111
- display: block;
112
- width: 100%;
113
- height: 100%;
114
- cursor: pointer;
115
- display: flex;
116
- justify-content: left;
117
- align-items: center;
111
+ display: block;
112
+ width: 100%;
113
+ height: 100%;
114
+ cursor: pointer;
115
+ display: flex;
116
+ justify-content: left;
117
+ align-items: center;
118
118
  }
119
119
 
120
120
  .ns_indeterminate:indeterminate {
121
- border: 1px solid rgba(255, 148, 50, 1);
121
+ border: 1px solid rgba(255, 148, 50, 1);
122
122
  }
123
123
 
124
124
  .ns_indeterminate {
125
- position: relative;
125
+ position: relative;
126
126
  }
127
127
 
128
128
  .ns_indeterminate::after {
129
- content: "-";
130
- display: block;
131
- position: absolute;
132
- width: 100%;
133
- height: 100%;
134
- top: 0;
135
- left: 0;
136
- border: 5px solid #fffbff;
137
- color: #141b5c;
138
- background: #141b5c;
129
+ content: "-";
130
+ display: block;
131
+ position: absolute;
132
+ width: 100%;
133
+ height: 100%;
134
+ top: 0;
135
+ left: 0;
136
+ border: 5px solid #fffbff;
137
+ color: #141b5c;
138
+ background: #141b5c;
139
+ }
140
+
141
+ .ns_tfoot_row,
142
+ .ns_tfoot_cell {
143
+ display: contents !important;
144
+ }
145
+
146
+ .ns_tfoot_cell::before {
147
+ display: none !important;
139
148
  }
140
149
 
141
150
  /* Button Panel */
142
151
  .ns_button_panel {
143
- display: flex;
144
- flex-direction: row;
145
- flex-wrap: wrap;
146
- justify-content: center;
147
- align-items: center;
148
- width: 100%;
149
- gap: 16px;
152
+ display: flex;
153
+ flex-direction: row;
154
+ flex-wrap: wrap;
155
+ justify-content: center;
156
+ align-items: center;
157
+ width: 100%;
158
+ gap: 16px;
150
159
  }
151
160
 
152
161
  @media screen and (max-width: 991px) {
153
- .ns_table td {
154
- width: auto;
155
- }
162
+ .ns_table td {
163
+ width: auto;
164
+ }
156
165
  }
157
166
 
158
167
  @media screen and (min-width: 992px) {
159
- .ns_table_wrapper {
160
- position: relative;
161
- height: 100%;
162
- }
163
-
164
- .ns_table {
165
- height: 100%;
166
- max-height: 33.625rem;
167
- border-radius: 0.75rem;
168
- justify-content: flex-start;
169
- overflow: scroll auto;
170
- background-color: #fff;
171
- color: #000;
172
- }
173
-
174
- .ns_table tr {
175
- min-width: fit-content;
176
- margin: 0;
177
- border: 1px solid transparent;
178
- border-radius: 0;
179
- padding: 4px 8px;
180
- display: grid;
181
- align-items: center;
182
- grid-auto-flow: column;
183
- grid-auto-columns: max-content;
184
- }
185
-
186
- .ns_table th {
187
- margin: 8px;
188
- padding: 0;
189
- font-size: 16px;
190
- font-weight: 500;
191
- line-height: 1.5rem;
192
- color: #fff;
193
- }
194
-
195
- .ns_table td {
196
- align-items: flex-start;
197
- line-height: 1.5rem;
198
- text-align: left;
199
- }
200
-
201
- .ns_table td::before {
202
- content: "";
203
- float: left;
204
- font-weight: bold;
205
- min-width: unset;
206
- display: none;
207
- }
208
-
209
- .ns_table thead {
210
- position: sticky;
211
- top: 0;
212
- min-width: max-content;
213
- display: block;
214
- }
215
-
216
- .ns_table thead tr {
217
- background-color: rgba(20, 27, 92);
218
- }
219
-
220
- .ns_table tbody {
221
- padding-bottom: 0.5rem;
222
- }
223
-
224
- .ns_table tbody tr.ns_selected,
225
- .ns_table tbody tr.ns_last_selected {
226
- border-color: rgba(20, 27, 92);
227
- }
228
-
229
- .ns_table tbody tr.ns_selected+tr,
230
- .ns_table tbody tr.ns_last_selected+tr {
231
- border-top-color: transparent;
232
- }
233
-
234
- .ns_table tfoot {
235
- position: sticky;
236
- bottom: 0;
237
- left: 0;
238
- width: 100%;
239
- padding: 1rem;
240
- flex-direction: row;
241
- background-color: #fff;
242
- }
243
-
244
- .ns_table tfoot.padding_0 {
245
- padding: 0;
246
- }
247
-
248
- .ns_check_box {
249
- display: flex;
250
- align-items: center;
251
- cursor: pointer;
252
- }
253
-
254
- .ns_checkbox_label {
255
- justify-content: center;
256
- }
257
-
258
- .ns_table_scrollbar {
259
- position: absolute;
260
- left: 0;
261
- width: 100%;
262
- height: 0.5rem;
263
- overflow: auto visible;
264
- background-color: #efefef;
265
- }
266
-
267
- .ns_table_scrollbar.bottom-0 {
268
- bottom: 0;
269
- }
270
-
271
- .ns_table_scrollbar_content {
272
- height: 0.25rem;
273
- }
274
-
275
- .ns_table,
276
- .ns_table_scrollbar {
277
- &::-webkit-scrollbar {
278
- width: 0.5rem;
279
- height: 0.5rem;
280
- }
281
-
282
- &::-webkit-scrollbar-track {
283
- border-radius: 0.25rem;
284
- background: #efefef;
285
- }
286
-
287
- &::-webkit-scrollbar-thumb {
288
- border-radius: 0.25rem;
289
- background: #888;
290
- }
291
-
292
- &::-webkit-scrollbar-thumb:hover {
293
- background: #555;
294
- }
295
- }
296
-
297
- .ns_table::-webkit-scrollbar {
298
- height: 0;
299
- }
300
-
301
- .ns_table_scrollbar::-webkit-scrollbar {
302
- width: 0;
303
- }
168
+ .ns_table_wrapper {
169
+ position: relative;
170
+ height: 100%;
171
+ }
172
+
173
+ .ns_table {
174
+ height: 100%;
175
+ max-height: 33.625rem;
176
+ border-radius: 0.75rem;
177
+ justify-content: flex-start;
178
+ overflow: scroll auto;
179
+ background-color: #fff;
180
+ color: #000;
181
+ }
182
+
183
+ .ns_table tr {
184
+ min-width: fit-content;
185
+ margin: 0;
186
+ border: 1px solid transparent;
187
+ border-radius: 0;
188
+ padding: 4px 8px;
189
+ display: grid;
190
+ align-items: center;
191
+ grid-auto-flow: column;
192
+ grid-auto-columns: max-content;
193
+ }
194
+
195
+ .ns_table th {
196
+ margin: 8px;
197
+ padding: 0;
198
+ font-size: 16px;
199
+ font-weight: 500;
200
+ line-height: 1.5rem;
201
+ color: #fff;
202
+ }
203
+
204
+ .ns_table td {
205
+ align-items: flex-start;
206
+ line-height: 1.5rem;
207
+ text-align: left;
208
+ }
209
+
210
+ .ns_table td::before {
211
+ content: "";
212
+ float: left;
213
+ font-weight: bold;
214
+ min-width: unset;
215
+ display: none;
216
+ }
217
+
218
+ .ns_table thead {
219
+ position: sticky;
220
+ top: 0;
221
+ min-width: max-content;
222
+ display: block;
223
+ }
224
+
225
+ .ns_table thead tr {
226
+ background-color: rgba(20, 27, 92);
227
+ }
228
+
229
+ .ns_table tbody {
230
+ padding-bottom: 0.5rem;
231
+ }
232
+
233
+ .ns_table tbody tr.ns_selected,
234
+ .ns_table tbody tr.ns_last_selected {
235
+ border-color: rgba(20, 27, 92);
236
+ }
237
+
238
+ .ns_table tbody tr.ns_selected+tr,
239
+ .ns_table tbody tr.ns_last_selected+tr {
240
+ border-top-color: transparent;
241
+ }
242
+
243
+ .ns_table tfoot {
244
+ position: sticky;
245
+ bottom: 0;
246
+ left: 0;
247
+ width: 100%;
248
+ padding: 1rem;
249
+ flex-direction: row;
250
+ background-color: #fff;
251
+ }
252
+
253
+ .ns_table tfoot.padding_0 {
254
+ padding: 0;
255
+ }
256
+
257
+ .ns_check_box {
258
+ display: flex;
259
+ align-items: center;
260
+ cursor: pointer;
261
+ }
262
+
263
+ .ns_checkbox_label {
264
+ justify-content: center;
265
+ }
266
+
267
+ .ns_table_scrollbar {
268
+ position: absolute;
269
+ left: 0;
270
+ width: 100%;
271
+ height: 0.5rem;
272
+ overflow: auto visible;
273
+ background-color: #efefef;
274
+ }
275
+
276
+ .ns_table_scrollbar.bottom-0 {
277
+ bottom: 0;
278
+ }
279
+
280
+ .ns_table_scrollbar_content {
281
+ height: 0.25rem;
282
+ }
283
+
284
+ .ns_table,
285
+ .ns_table_scrollbar {
286
+ &::-webkit-scrollbar {
287
+ width: 0.5rem;
288
+ height: 0.5rem;
289
+ }
290
+
291
+ &::-webkit-scrollbar-track {
292
+ border-radius: 0.25rem;
293
+ background: #efefef;
294
+ }
295
+
296
+ &::-webkit-scrollbar-thumb {
297
+ border-radius: 0.25rem;
298
+ background: #888;
299
+ }
300
+
301
+ &::-webkit-scrollbar-thumb:hover {
302
+ background: #555;
303
+ }
304
+ }
305
+
306
+ .ns_table::-webkit-scrollbar {
307
+ height: 0;
308
+ }
309
+
310
+ .ns_table_scrollbar::-webkit-scrollbar {
311
+ width: 0;
312
+ }
304
313
  }
305
314
 
306
315
  @media screen and (min-width: 1024px) {
307
- .ns_button_panel {
308
- flex-wrap: nowrap;
309
- justify-content: flex-end;
310
- gap: 24px;
311
- }
316
+ .ns_button_panel {
317
+ flex-wrap: nowrap;
318
+ justify-content: flex-end;
319
+ gap: 24px;
320
+ }
312
321
  }
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.548",
11
+ "version": "1.4.550",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/main.js",
@@ -91,6 +91,11 @@ export class NSBoxBaseLayout extends React.Component<NSBoxBaseLayoutProps, NSBox
91
91
  {
92
92
  this.setState(() => ({ disabled }));
93
93
  }
94
+ override componentDidUpdate(prevProps: NSBoxBaseLayoutProps): void
95
+ {
96
+ if (prevProps.disabled !== this.props.disabled)
97
+ this.setState({ disabled: this.props.disabled ?? false });
98
+ }
94
99
  override render()
95
100
  {
96
101
  let value = this.props.getValue() ?? "";
@@ -24,14 +24,14 @@ export class NSBoxDateRange extends NSBoxDateRangeBase<NSBoxDateRangeProps>
24
24
  return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);
25
25
  }
26
26
 
27
+ protected override normalizeValue(value: NSBoxDateRangeValue): NSBoxDateRangeValue
28
+ {
29
+ return { from: NSBoxDateRange.startOfDay(value.from), to: NSBoxDateRange.endOfDay(value.to) };
30
+ }
31
+
27
32
  override setValue(value: NSBoxDateRangeValue | null, callback?: () => void): void
28
33
  {
29
- if (value)
30
- value = {
31
- from: NSBoxDateRange.startOfDay(value.from),
32
- to: NSBoxDateRange.endOfDay(value.to)
33
- };
34
- super.setValue(value, callback);
34
+ super.setValue(value ? this.normalizeValue(value) : null, callback);
35
35
  }
36
36
 
37
37
  getError(): string | null
@@ -54,6 +54,8 @@ export class NSBoxDateRange extends NSBoxDateRangeBase<NSBoxDateRangeProps>
54
54
  { label: '1W', title: 'Last 1 Week', from: TimeOperation.weeksAgo(1, now), to: now },
55
55
  { label: '1M', title: 'Last 1 Month', from: TimeOperation.monthsAgo(1, now), to: now },
56
56
  { label: '3M', title: 'Last 3 Months', from: TimeOperation.monthsAgo(3, now), to: now },
57
+ { label: '6M', title: 'Last 6 Months', from: TimeOperation.monthsAgo(6, now), to: now },
58
+ { label: '1Y', title: 'Last Year', from: TimeOperation.yearsAgo(1, now), to: now },
57
59
  ];
58
60
  }
59
61
 
@@ -5,12 +5,14 @@
5
5
  }
6
6
 
7
7
  .ns_preset_container {
8
+ margin-top: -8px;
9
+ padding-top: 8px;
8
10
  display: flex;
9
- align-items: center;
11
+ justify-content: space-evenly;
10
12
  flex-wrap: nowrap;
11
- margin: 0 0.5rem 0.5rem;
12
13
  border: 1px solid #d9d9d9;
13
- border-radius: 6px;
14
+ border-top: none;
15
+ border-radius: 0 0 6px 6px;
14
16
  overflow-x: auto;
15
17
  overflow-y: hidden;
16
18
  background: white;
@@ -18,23 +20,6 @@
18
20
  scrollbar-color: #d9d9d9 transparent;
19
21
  }
20
22
 
21
- .ns_preset_container::-webkit-scrollbar {
22
- height: 3px;
23
- }
24
-
25
- .ns_preset_container::-webkit-scrollbar-track {
26
- background: transparent;
27
- }
28
-
29
- .ns_preset_container::-webkit-scrollbar-thumb {
30
- background: #d9d9d9;
31
- border-radius: 3px;
32
- }
33
-
34
- .ns_preset_container::-webkit-scrollbar-thumb:hover {
35
- background: #bfbfbf;
36
- }
37
-
38
23
  .ns_preset_divider {
39
24
  width: 1px;
40
25
  height: 20px;
@@ -44,17 +29,16 @@
44
29
 
45
30
  .ns_preset_btn {
46
31
  flex-shrink: 0;
47
- padding: 4px 10px;
32
+ padding: 4px 8px;
48
33
  border: none;
49
34
  background: transparent;
50
35
  color: #595959;
51
36
  cursor: pointer;
52
37
  font-size: 12px;
53
38
  font-weight: 500;
54
- font-family: inherit;
55
- transition: color 0.15s, background 0.15s;
56
39
  white-space: nowrap;
57
- line-height: 1.4;
40
+ line-height: 16px;
41
+ transition: color 0.15s, background-color 0.15s;
58
42
  }
59
43
 
60
44
  .ns_preset_btn:hover {