tsv2-library 0.3.76 → 0.3.78

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.
@@ -1,6 +1,7 @@
1
1
  import { ClassComponent } from '../ts-helpers';
2
2
  import { Asset } from '../../../types/assets.type';
3
3
  import { ScanPayload } from '../ButtonSearchByScan/ButtonSearchByScan.vue.d';
4
+ import { QueryParams } from '../DataTable/DataTable.vue';
4
5
 
5
6
  export type ButtonAddByScanEmits = {
6
7
  'update:modelValue': [assets: Asset[]];
@@ -13,6 +14,9 @@ export interface ButtonAddByScanProps {
13
14
  *
14
15
  */
15
16
  modelValue: Asset[];
17
+ reportedDisposalAssets?: boolean;
18
+ noDisposalAssets?: boolean;
19
+ queryParams?: QueryParams;
16
20
  }
17
21
 
18
22
  /**
@@ -1,128 +1,502 @@
1
1
  export default {
2
- root: {
2
+ root: ({ props }) => ({
3
3
  class: [
4
4
  'relative',
5
+ {
6
+ 'flex flex-col h-full': props.scrollHeight === 'flex',
7
+ },
5
8
 
6
- 'w-4 h-4',
9
+ // Shape
10
+ 'border-spacing-0 border-separate',
11
+ ],
12
+ }),
13
+ loadingoverlay: {
14
+ class: [
15
+ // Position
16
+ 'absolute',
17
+ 'top-0 left-0',
18
+ 'z-20',
7
19
 
8
- // Alignment
9
- 'inline-flex',
10
- 'align-bottom',
20
+ // Flex & Alignment
21
+ 'flex items-center justify-center',
11
22
 
12
- // Transitions
13
- 'transition-all',
14
- 'duration-200',
23
+ // Size
24
+ 'w-full h-full',
25
+
26
+ // Color
27
+ 'bg-surface-100/40 dark:bg-surface-800/40',
28
+
29
+ // Transition
30
+ 'transition duration-200',
15
31
  ],
16
32
  },
17
- box: ({ props, context }) => ({
33
+ loadingicon: {
34
+ class: 'w-8 h-8 animate-spin',
35
+ },
36
+ wrapper: ({ props }) => ({
18
37
  class: [
19
- // Alignment
20
- 'flex',
21
- 'items-center',
22
- 'justify-center',
38
+ // Overflow
39
+ {
40
+ 'relative overflow-auto': props.scrollable,
41
+ 'overflow-x-auto': props.resizableColumns,
42
+ },
43
+ ],
44
+ }),
45
+ header: ({ props }) => ({
46
+ class: [
47
+ 'font-semibold',
23
48
 
24
- // Size
25
- 'w-full',
26
- 'h-full',
49
+ // Shape
50
+ props.showGridlines ? 'border-b' : 'border-b border-x-0',
51
+
52
+ // Spacing
53
+ 'py-3.5 px-3',
54
+
55
+ // Color
56
+ 'bg-surface-0 dark:bg-surface-800',
57
+ 'border-surface-300 dark:border-surface-600',
58
+ 'text-surface-700 dark:text-white/80',
59
+ ],
60
+ }),
61
+ footer: {
62
+ class: [
63
+ 'font-semibold',
27
64
 
28
65
  // Shape
29
- 'rounded',
30
- 'border-2',
66
+ 'border-t-0 border-t border-x-0',
67
+
68
+ // Spacing
69
+ 'p-4',
31
70
 
32
- // Colors
33
- 'text-surface-0',
71
+ // Color
72
+ 'bg-surface-0 dark:bg-surface-800',
73
+ 'border-surface-200 dark:border-surface-700',
74
+ 'text-surface-700 dark:text-white/80',
75
+ ],
76
+ },
77
+ table: {
78
+ class: [
79
+ // Table & Width
80
+ 'border-collapse table-fixed w-full ',
81
+ ],
82
+ },
83
+ thead: ({ props }) => ({
84
+ class: [
85
+ // Position & Z-index
86
+ {
87
+ 'top-0 z-40 sticky': props.scrollable,
88
+ },
89
+ ],
90
+ }),
91
+ tbody: ({ props }) => ({
92
+ class: [
93
+ {
94
+ block: props.scrollable,
95
+ },
96
+ ],
97
+ }),
98
+ tfoot: ({ props }) => ({
99
+ class: [
100
+ // Block Display
101
+ {
102
+ block: props.scrollable,
103
+ },
104
+ ],
105
+ }),
106
+ headerrow: ({ props }) => ({
107
+ class: [
108
+ // Flexbox & Width
34
109
  {
35
- 'border-general-100 bg-surface-0 dark:border-general-300 dark:bg-grayscale-800':
36
- !context.active && !props.disabled,
37
- 'border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500':
38
- context.active && !props.disabled,
110
+ 'flex flex-nowrap w-full': props.scrollable,
39
111
  },
112
+ ],
113
+ }),
114
+ row: ({ context, props }) => ({
115
+ class: [
116
+ // Flex
117
+ { 'flex flex-nowrap w-full': context.scrollable },
40
118
 
119
+ // Color
120
+ 'dark:text-white/80',
121
+ { 'bg-surface-50 dark:bg-surface-500/30': context.selected },
41
122
  {
42
- 'ring-2 ring-primary-500 dark:ring-primary-400':
43
- !props.disabled && context.focused,
44
- 'cursor-default': props.disabled,
123
+ 'bg-surface-0 text-surface-600 dark:bg-surface-800': !context.selected,
45
124
  },
46
125
 
47
- // States
126
+ // Hover & Flexbox
48
127
  {
49
- 'peer-focus-visible:ring-2 peer-focus-visible:ring-offset-1 peer-focus-visible:ring-primary dark:peer-focus-visible:ring-primary':
50
- !props.disabled,
51
- 'cursor-default bg-general-50 border-general-200 dark:bg-general-100 dark:border-general-200':
52
- props.disabled && !context.active,
53
- 'bg-general-200 dark:bg-general-200 border-general-200 dark:border-general-200':
54
- props.disabled && context.active,
128
+ 'hover:bg-surface-300/20 hover:text-surface-600':
129
+ context.selectable && !context.selected,
55
130
  },
131
+ 'focus:outline-none focus:outline-offset-0 focus:ring-2 focus:ring-primary-500 ring-inset dark:focus:ring-primary-400',
56
132
 
57
- // Transitions
58
- 'transition-colors',
59
- 'duration-200',
133
+ // Transition
134
+ {
135
+ 'transition duration-200':
136
+ (props.selectionMode && !context.selected) || props.rowHover,
137
+ },
60
138
  ],
61
139
  }),
62
- input: {
140
+ headercell: ({ context, props }) => ({
63
141
  class: [
64
- 'peer',
65
-
66
- // Size
67
- 'w-full ',
68
- 'h-full',
142
+ 'font-semibold',
143
+ 'text-sm',
69
144
 
70
145
  // Position
71
- 'absolute',
72
- 'top-0 left-0',
73
- 'z-10',
146
+ {
147
+ 'sticky z-40':
148
+ context.scrollable &&
149
+ context.scrollDirection === 'both' &&
150
+ context.frozen,
151
+ },
74
152
 
75
- // Spacing
76
- 'p-0',
77
- 'm-0',
153
+ // Flex & Alignment
154
+ {
155
+ 'flex flex-1 items-center': context.scrollable,
156
+ 'flex-initial shrink-0':
157
+ context.scrollable &&
158
+ context.scrollDirection === 'both' &&
159
+ !context.frozen,
160
+ },
161
+ 'text-left',
78
162
 
79
163
  // Shape
80
- 'rounded',
81
- 'border',
164
+ { 'border-r last:border-r-0': context?.showGridlines },
165
+ 'border-0 border-b border-solid',
82
166
 
83
- // Shape
84
- 'opacity-0',
85
- 'rounded-md',
86
- 'outline-none',
87
- 'border-2 border-surface-300 dark:border-surface-700',
167
+ // Spacing
168
+ context?.size === 'small'
169
+ ? 'py-2.5 px-2'
170
+ : context?.size === 'large'
171
+ ? 'py-5 px-4'
172
+ : 'py-3.5 px-3',
173
+
174
+ // Color
175
+ (props.sortable === '' || props.sortable) && context.sorted
176
+ ? 'text-primary-500'
177
+ : 'bg-surface-0 text-surface-700',
178
+ (props.sortable === '' || props.sortable) && context.sorted
179
+ ? 'dark:text-primary-400'
180
+ : 'dark:text-white/80 dark:bg-surface-800',
181
+ 'border-surface-200 dark:border-surface-700 ',
182
+
183
+ // States
184
+ 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-500 dark:focus-visible:ring-primary-400',
185
+
186
+ // Transition
187
+ { 'transition duration-200': props.sortable === '' || props.sortable },
88
188
 
89
189
  // Misc
90
- 'appareance-none',
91
- 'cursor-pointer',
190
+ {
191
+ 'overflow-hidden relative bg-clip-padding':
192
+ context.resizable && !context.frozen,
193
+ },
92
194
  ],
93
- },
94
- checkicon: {
95
- class: [
96
- // Font
97
- 'text-normal',
195
+ }),
196
+ column: {
197
+ headercell: ({ context, props }) => ({
198
+ class: [
199
+ 'font-semibold',
200
+ 'text-sm',
98
201
 
99
- // Size
100
- 'w-3',
101
- 'h-3',
202
+ // Position
203
+ {
204
+ 'sticky z-40':
205
+ context.scrollable &&
206
+ context.scrollDirection === 'both' &&
207
+ context.frozen,
208
+ },
102
209
 
103
- // Colors
104
- 'text-surface-0 dark:text-surface-0',
210
+ // Flex & Alignment
211
+ {
212
+ 'flex flex-1 items-center': context.scrollable,
213
+ 'flex-initial shrink-0':
214
+ context.scrollable &&
215
+ context.scrollDirection === 'both' &&
216
+ !context.frozen,
217
+ },
218
+ 'text-left',
105
219
 
106
- // Transitions
107
- 'transition-all',
108
- 'duration-200',
109
- ],
110
- },
111
- uncheckicon: {
112
- class: [
113
- // Font
114
- 'text-normal',
220
+ // Shape
221
+ { 'border-r last:border-r-0': context?.showGridlines },
222
+ 'border-0 border-b border-solid',
115
223
 
116
- // Size
117
- 'w-3',
118
- 'h-3',
224
+ // Spacing
225
+ context?.size === 'small'
226
+ ? 'py-2.5 px-2'
227
+ : context?.size === 'large'
228
+ ? 'py-5 px-4'
229
+ : 'py-3.5 px-3',
119
230
 
120
- // Colors
121
- 'text-surface-0 dark:text-surface-0',
231
+ // Color
232
+ (props.sortable === '' || props.sortable) && context.sorted
233
+ ? 'text-primary-500'
234
+ : 'bg-surface-0 text-surface-700',
235
+ (props.sortable === '' || props.sortable) && context.sorted
236
+ ? 'dark:text-primary-400'
237
+ : 'dark:text-white/80 dark:bg-surface-800',
238
+ 'border-surface-200 dark:border-surface-700 ',
122
239
 
123
- // Transitions
124
- 'transition-all',
125
- 'duration-200',
126
- ],
240
+ // States
241
+ 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-500 dark:focus-visible:ring-primary-400',
242
+
243
+ // Transition
244
+ { 'transition duration-200': props.sortable === '' || props.sortable },
245
+
246
+ // Misc
247
+ {
248
+ 'overflow-hidden relative bg-clip-padding':
249
+ context.resizable && !context.frozen,
250
+ },
251
+ ],
252
+ }),
253
+ bodycell: ({ context }) => ({
254
+ class: [
255
+ // Position
256
+ {
257
+ sticky:
258
+ context.scrollable &&
259
+ context.scrollDirection === 'both' &&
260
+ context.frozen,
261
+ },
262
+
263
+ // Font
264
+ 'text-sm',
265
+
266
+ // Flex & Alignment
267
+ {
268
+ 'flex flex-1 items-center': context.scrollable,
269
+ 'flex-initial shrink-0':
270
+ context.scrollable &&
271
+ context.scrollDirection === 'both' &&
272
+ !context.frozen,
273
+ },
274
+ 'text-left',
275
+
276
+ // Shape
277
+ 'border-0 border-b border-solid',
278
+ { 'last:border-r-0 border-r border-b': context?.showGridlines },
279
+
280
+ // Color
281
+ 'border-surface-200 dark:border-surface-700',
282
+ { 'bg-surface-0 dark:bg-surface-800': !context.selected },
283
+
284
+ // Spacing
285
+ context?.size === 'small'
286
+ ? 'py-2.5 px-2'
287
+ : context?.size === 'large'
288
+ ? 'py-5 px-4'
289
+ : 'py-3.5 px-3',
290
+
291
+ // Misc
292
+ 'space-nowrap',
293
+ {
294
+ 'cursor-pointer': context.selectable,
295
+ },
296
+ ],
297
+ }),
298
+ rowtoggler: {
299
+ class: [
300
+ 'relative',
301
+
302
+ // Flex & Alignment
303
+ 'inline-flex items-center justify-center',
304
+ 'text-left align-middle',
305
+
306
+ // Spacing
307
+ 'm-0 mr-2 p-0',
308
+
309
+ // Size
310
+ 'w-8 h-8',
311
+
312
+ // Shape
313
+ 'border-0 rounded-full',
314
+
315
+ // Color
316
+ 'text-surface-500 dark:text-white/70',
317
+ 'bg-transparent',
318
+
319
+ // States
320
+ 'hover:bg-surface-50 dark:hover:bg-surface-700',
321
+ 'focus-visible:outline-none focus-visible:outline-offset-0',
322
+ 'focus-visible:ring-2 focus-visible:ring-primary-500 dark:focus-visible:ring-primary-400',
323
+
324
+ // Transition
325
+ 'transition duration-200',
326
+
327
+ // Misc
328
+ 'overflow-hidden',
329
+ 'cursor-pointer select-none',
330
+ ],
331
+ },
332
+ sorticon: ({ context }) => ({
333
+ class: [
334
+ 'ml-2 inline-block',
335
+ context.sorted
336
+ ? 'fill-primary-700 dark:fill-white/80'
337
+ : 'fill-surface-700 dark:fill-white/70',
338
+ ],
339
+ }),
340
+ sortbadge: {
341
+ class: [
342
+ // Flex & Alignment
343
+ 'inline-flex items-center justify-center align-middle',
344
+
345
+ // Shape
346
+ 'rounded-full',
347
+
348
+ // Size
349
+ 'w-[1.143rem] leading-[1.143rem]',
350
+
351
+ // Spacing
352
+ 'ml-2',
353
+
354
+ // Color
355
+ 'text-primary-700 dark:text-white',
356
+ 'bg-primary-50 dark:bg-primary-400/30',
357
+ ],
358
+ },
359
+ columnresizer: {
360
+ class: [
361
+ 'block',
362
+
363
+ // Position
364
+ 'absolute top-0 right-0',
365
+
366
+ // Sizing
367
+ 'w-2 h-full',
368
+
369
+ // Spacing
370
+ 'm-0 p-0',
371
+
372
+ // Color
373
+ 'border border-transparent',
374
+
375
+ // Misc
376
+ 'cursor-col-resize',
377
+ ],
378
+ },
379
+ rowCheckbox: {
380
+ root: {
381
+ class: [
382
+ 'relative',
383
+
384
+ // Alignment
385
+ 'inline-flex',
386
+ 'align-middle',
387
+
388
+ // Size
389
+ 'w-4',
390
+ 'h-4',
391
+
392
+ // Spacing
393
+ 'mr-2',
394
+
395
+ // Misc
396
+ 'cursor-default',
397
+ 'select-none',
398
+ ],
399
+ },
400
+ box: ({ props, context }) => ({
401
+ class: [
402
+ // Alignment
403
+ 'flex',
404
+ 'items-center',
405
+ 'justify-center',
406
+
407
+ // Size
408
+ 'w-4',
409
+ 'h-4',
410
+
411
+ // Shape
412
+ 'rounded',
413
+ 'border',
414
+
415
+ // Colors
416
+ 'text-surface-600',
417
+ {
418
+ 'border-surface-300 bg-surface-0 dark:border-surface-700 dark:bg-surface-900':
419
+ !context.checked,
420
+ 'border-primary-500 bg-primary-500 dark:border-primary-400 dark:bg-primary-400':
421
+ context.checked,
422
+ },
423
+
424
+ {
425
+ 'ring-2 ring-primary-500 dark:ring-primary-400':
426
+ !props.disabled && context.focused,
427
+ 'cursor-default opacity-60': props.disabled,
428
+ },
429
+
430
+ // States
431
+ {
432
+ 'peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 dark:peer-focus-visible:ring-primary-400':
433
+ !props.disabled,
434
+ 'cursor-default opacity-60': props.disabled,
435
+ },
436
+
437
+ // Transitions
438
+ 'transition-colors',
439
+ 'duration-200',
440
+ ],
441
+ }),
442
+ input: {
443
+ class: [
444
+ 'peer',
445
+
446
+ // Size
447
+ 'w-full ',
448
+ 'h-full',
449
+
450
+ // Position
451
+ 'absolute',
452
+ 'top-0 left-0',
453
+ 'z-10',
454
+
455
+ // Spacing
456
+ 'p-0',
457
+ 'm-0',
458
+
459
+ // Shape
460
+ 'rounded',
461
+ 'border',
462
+
463
+ // Shape
464
+ 'opacity-0',
465
+ 'rounded-md',
466
+ 'outline-none',
467
+ 'border-2 border-surface-300 dark:border-surface-700',
468
+
469
+ // Misc
470
+ 'appareance-none',
471
+ ],
472
+ },
473
+ icon: {
474
+ class: [
475
+ // Font
476
+ 'text-normal',
477
+
478
+ // Size
479
+ 'w-3',
480
+ 'h-3',
481
+
482
+ // Colors
483
+ 'text-white dark:text-surface-900',
484
+
485
+ // Transitions
486
+ 'transition-all',
487
+ 'duration-200',
488
+ ],
489
+ },
490
+ },
491
+ transition: {
492
+ enterFromClass: 'opacity-0 scale-y-[0.8]',
493
+ enterActiveClass:
494
+ 'transition-[transform,opacity] duration-[120ms] ease-[cubic-bezier(0,0,0.2,1)]',
495
+ leaveActiveClass: 'transition-opacity duration-100 ease-linear',
496
+ leaveToClass: 'opacity-0',
497
+ },
498
+ },
499
+ resizehelper: {
500
+ class: 'absolute hidden w-[2px] z-20 bg-primary-500 dark:bg-primary-400',
127
501
  },
128
502
  };
@@ -17,6 +17,7 @@ export declare const API: ({ headers, params }?: {
17
17
  params?: {} | undefined;
18
18
  }) => AxiosInstance;
19
19
  declare const DisposalServices: {
20
+ getReportedDisposal: (params?: any) => Promise<AxiosResponse>;
20
21
  postReportDisposal: (body: ReportDisposalBody) => Promise<AxiosResponse>;
21
22
  cancelReportDisposal: (params: CancelReportDisposalQueryParams) => Promise<AxiosResponse>;
22
23
  };
@@ -28,6 +28,7 @@ export type AssetName = AssetFieldObject & {
28
28
  };
29
29
  export type Asset = {
30
30
  _id?: string;
31
+ asset?: string;
31
32
  assetId?: string;
32
33
  name?: AssetName;
33
34
  aliasName?: string;