tsv2-library 0.2.44 → 0.2.45
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/src/build-entry.d.ts +2 -2
- package/dist/src/components/v2/DataTable/DataTable.vue.d.ts +4 -0
- package/dist/src/components/v2/DatePicker/DatePicker.vue.d.ts +61 -0
- package/dist/src/components/v2/DayPicker/DayPicker.vue.d.ts +58 -0
- package/dist/src/components/v2/DisposalReport/DisposalReportTable.vue.d.ts +8 -0
- package/dist/src/components/v2/InputCurrency/InputCurrency.vue.d.ts +1 -1
- package/dist/src/components/v2/InputNumber/InputNumber.vue.d.ts +19 -0
- package/dist/src/components/v2/index.d.ts +3 -1
- package/dist/src/types/fieldValidation.type.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/tsv2-library.es.js +13297 -12950
- package/package.json +1 -1
- package/src/components/v2/DataTable/DataTable.vue.d.ts +4 -0
- package/src/components/v2/DatePicker/DatePicker.vue.d.ts +61 -0
- package/src/components/v2/DayPicker/DayPicker.vue.d.ts +58 -0
- package/src/components/v2/InputCurrency/InputCurrency.vue.d.ts +1 -1
- package/src/components/v2/InputNumber/InputNumber.vue.d.ts +19 -0
- package/src/presets/calendar/index.js +3 -3
- package/src/presets/datepicker/index.js +39 -0
- package/src/presets/daypicker/index.js +38 -0
- package/src/presets/dialog/index.js +1 -1
- package/src/presets/global.js +9 -0
- package/src/presets/image/index.js +5 -12
- package/src/presets/inputcurrency/index.js +12 -0
- package/src/presets/inputphonenumber/index.js +19 -0
- package/src/presets/textarea/index.js +3 -2
package/package.json
CHANGED
|
@@ -307,6 +307,10 @@ export interface TSDataTableProps {
|
|
|
307
307
|
* Set the scrollHeight in px
|
|
308
308
|
*/
|
|
309
309
|
scrollHeight?: string;
|
|
310
|
+
/**
|
|
311
|
+
* An array of fields as string to use in global filtering.
|
|
312
|
+
*/
|
|
313
|
+
globalFilterFields?: string[];
|
|
310
314
|
}
|
|
311
315
|
|
|
312
316
|
export type TSDataTableEmits = {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TSDatePicker component props
|
|
5
|
+
*/
|
|
6
|
+
export interface TSDatePickerProps {
|
|
7
|
+
/**
|
|
8
|
+
* TSDatePicker modelValue is day index from 0
|
|
9
|
+
*/
|
|
10
|
+
modelValue?: number[];
|
|
11
|
+
/**
|
|
12
|
+
* Display label on top of Date Input.
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Enable Validator using vee-validate. Combine with TSForm that handle form validation.
|
|
17
|
+
*/
|
|
18
|
+
useValidator?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* When used as field in From Validation using TSForm,
|
|
21
|
+
* specify the unique field name, match with your needs for API request.
|
|
22
|
+
*/
|
|
23
|
+
fieldName?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether this field should be filled or not.
|
|
26
|
+
*/
|
|
27
|
+
mandatory?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the invalid state.
|
|
30
|
+
*/
|
|
31
|
+
invalid?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Set the custom validator message.
|
|
34
|
+
* By default each field has preserved with its validator message, you don't need to worrying about the message.
|
|
35
|
+
*/
|
|
36
|
+
errorMessage?: { empty: string };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* TSDatePicker component emits
|
|
41
|
+
*/
|
|
42
|
+
export type TSDatePickerEmits = {
|
|
43
|
+
'update:modelValue': [days?: number[]];
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* **TSVue - TSDatePicker**
|
|
48
|
+
*
|
|
49
|
+
* _Handle input day with form validation._
|
|
50
|
+
*
|
|
51
|
+
* --- ---
|
|
52
|
+
* 
|
|
53
|
+
*
|
|
54
|
+
* @group form
|
|
55
|
+
*/
|
|
56
|
+
declare const TSDatePicker: DefineComponent<
|
|
57
|
+
TSDatePickerProps,
|
|
58
|
+
TSDatePickerEmits
|
|
59
|
+
>;
|
|
60
|
+
|
|
61
|
+
export default TSDatePicker;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TSDayPicker component props
|
|
5
|
+
*/
|
|
6
|
+
export interface TSDayPickerProps {
|
|
7
|
+
/**
|
|
8
|
+
* TSDayPicker modelValue is day index from 0
|
|
9
|
+
*/
|
|
10
|
+
modelValue?: number[];
|
|
11
|
+
/**
|
|
12
|
+
* Display label on top of Date Input.
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Enable Validator using vee-validate. Combine with TSForm that handle form validation.
|
|
17
|
+
*/
|
|
18
|
+
useValidator?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* When used as field in From Validation using TSForm,
|
|
21
|
+
* specify the unique field name, match with your needs for API request.
|
|
22
|
+
*/
|
|
23
|
+
fieldName?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether this field should be filled or not.
|
|
26
|
+
*/
|
|
27
|
+
mandatory?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the invalid state.
|
|
30
|
+
*/
|
|
31
|
+
invalid?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Set the custom validator message.
|
|
34
|
+
* By default each field has preserved with its validator message, you don't need to worrying about the message.
|
|
35
|
+
*/
|
|
36
|
+
errorMessage?: { empty: string };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* TSDayPicker component emits
|
|
41
|
+
*/
|
|
42
|
+
export type TSDayPickerEmits = {
|
|
43
|
+
'update:modelValue': [days?: number[]];
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* **TSVue - TSDayPicker**
|
|
48
|
+
*
|
|
49
|
+
* _Handle input day with form validation._
|
|
50
|
+
*
|
|
51
|
+
* --- ---
|
|
52
|
+
* 
|
|
53
|
+
*
|
|
54
|
+
* @group form
|
|
55
|
+
*/
|
|
56
|
+
declare const TSDayPicker: DefineComponent<TSDayPickerProps, TSDayPickerEmits>;
|
|
57
|
+
|
|
58
|
+
export default TSDayPicker;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CurrencyFormat } from '@/utils/currency.util';
|
|
2
1
|
import { DefineComponent } from 'vue';
|
|
3
2
|
|
|
4
3
|
export interface CurrencyValue {
|
|
@@ -90,6 +89,7 @@ export interface InputCurrencyProps {
|
|
|
90
89
|
* Show information about the field.
|
|
91
90
|
*/
|
|
92
91
|
fieldInfo?: string;
|
|
92
|
+
inputnNumberId?: string;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/**
|
|
@@ -114,6 +114,25 @@ export interface InputNumberProps {
|
|
|
114
114
|
* Class to be bind on addon left component
|
|
115
115
|
*/
|
|
116
116
|
addonLeftClass?: any;
|
|
117
|
+
/**
|
|
118
|
+
* Class to be bind on input group component
|
|
119
|
+
*/
|
|
120
|
+
inputGroupClass?: any;
|
|
121
|
+
/**
|
|
122
|
+
* Class to be bind on input number component
|
|
123
|
+
*/
|
|
124
|
+
inputNumberClass?: any;
|
|
125
|
+
/**
|
|
126
|
+
* Unique id for input number element
|
|
127
|
+
*/
|
|
128
|
+
inputId?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Set auto Resize Input
|
|
131
|
+
* The input width is counted by the value length
|
|
132
|
+
*
|
|
133
|
+
* @default false
|
|
134
|
+
*/
|
|
135
|
+
autoResize?: boolean;
|
|
117
136
|
}
|
|
118
137
|
|
|
119
138
|
/**
|
|
@@ -91,7 +91,7 @@ export default {
|
|
|
91
91
|
},
|
|
92
92
|
|
|
93
93
|
// Size
|
|
94
|
-
'!min-w-0 max-w-[272px] h-max p-6 shadow-
|
|
94
|
+
'!min-w-0 max-w-[272px] h-max p-6 shadow-panel',
|
|
95
95
|
{ 'min-w-[80vw] w-auto p-2 ': props.touchUI },
|
|
96
96
|
{ 'p-2 min-w-full': props.inline },
|
|
97
97
|
|
|
@@ -394,7 +394,7 @@ export default {
|
|
|
394
394
|
{
|
|
395
395
|
'text-text-general-800 dark:text-general-800 bg-transparent':
|
|
396
396
|
!context.selected && !context.disabled,
|
|
397
|
-
'
|
|
397
|
+
'bg-primary-500 text-white dark:bg-primary-400 dark:text-white':
|
|
398
398
|
context.selected && !context.disabled,
|
|
399
399
|
},
|
|
400
400
|
|
|
@@ -432,7 +432,7 @@ export default {
|
|
|
432
432
|
{
|
|
433
433
|
'text-text-general-800 dark:text-general-800 bg-transparent':
|
|
434
434
|
!context.selected && !context.disabled,
|
|
435
|
-
'
|
|
435
|
+
'bg-primary-500 text-white dark:bg-primary-400 dark:text-white':
|
|
436
436
|
context.selected && !context.disabled,
|
|
437
437
|
},
|
|
438
438
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
inputgroup: {
|
|
3
|
+
class: ['grid grid-cols-[1fr,max-content] !items-center gap-1 px-3 py-1'],
|
|
4
|
+
},
|
|
5
|
+
|
|
6
|
+
inputtext: {
|
|
7
|
+
class: ['!p-0'],
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
inputtrigger: {
|
|
11
|
+
class: ['w-4 h-4 shrink-0 !text-general-500'],
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
panel: {
|
|
15
|
+
class: ['border-none !mt-0 !shadow-panel'],
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
panelcontent: {
|
|
19
|
+
class: ['grid grid-cols-7 grid-rows-[repeat(5,max-content)] p-6'],
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
date: {
|
|
23
|
+
class: [
|
|
24
|
+
'text-body-medium text-general-800',
|
|
25
|
+
'bg-white hover:bg-primary-100',
|
|
26
|
+
'rounded-[20px]',
|
|
27
|
+
// In range selection
|
|
28
|
+
'[&[data-in-range="true"]]:bg-primary-200',
|
|
29
|
+
'[&[data-in-range="true"]]:text-general-800',
|
|
30
|
+
'[&[data-in-range="true"]]:rounded-[0]',
|
|
31
|
+
|
|
32
|
+
// Selected State
|
|
33
|
+
'[&[aria-selected="true"]]:bg-primary-500',
|
|
34
|
+
'[&[aria-selected="true"]]:text-white',
|
|
35
|
+
|
|
36
|
+
'text-center p-2 cursor-pointer',
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
inputgroup: {
|
|
3
|
+
class: ['grid grid-cols-[1fr,max-content] !items-center gap-1 px-3 py-1'],
|
|
4
|
+
},
|
|
5
|
+
|
|
6
|
+
inputtext: {
|
|
7
|
+
class: ['!p-0'],
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
inputtrigger: {
|
|
11
|
+
class: ['w-4 h-4 shrink-0 !text-general-500'],
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
panel: {
|
|
15
|
+
class: ['border-none !mt-0 !shadow-panel'],
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
panelcontent: {
|
|
19
|
+
class: ['grid grid-cols-3 grid-rows-[repeat(3,max-content)] p-6 gap-y-4'],
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
day: {
|
|
23
|
+
class: [
|
|
24
|
+
'text-body-medium text-general-800',
|
|
25
|
+
'bg-white hover:bg-primary-100',
|
|
26
|
+
// In range selection
|
|
27
|
+
'[&[data-in-range="true"]]:bg-primary-200',
|
|
28
|
+
'[&[data-in-range="true"]]:text-general-800',
|
|
29
|
+
|
|
30
|
+
// Selected State
|
|
31
|
+
'[&[aria-selected="true"]]:bg-primary-500',
|
|
32
|
+
'[&[aria-selected="true"]]:text-white',
|
|
33
|
+
'[&[aria-selected="true"]]:rounded-[20px]',
|
|
34
|
+
|
|
35
|
+
'last:col-span-3 text-center p-2 cursor-pointer',
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -152,7 +152,7 @@ export default {
|
|
|
152
152
|
// Font
|
|
153
153
|
'!text-header-weak text-xs font-medium tracking-[0.02em]',
|
|
154
154
|
|
|
155
|
-
'pr-1.5 -mr-1.5 pl-1.5 -ml-1.5 pt-1.5 -mt-1.5',
|
|
155
|
+
'pr-1.5 -mr-1.5 pl-1.5 -ml-1.5 pt-1.5 -mt-1.5 !pb-1.5 -mb-1.5',
|
|
156
156
|
|
|
157
157
|
// Layout
|
|
158
158
|
'flex flex-col gap-3',
|
package/src/presets/global.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export const ringClass = [
|
|
2
|
+
{
|
|
3
|
+
'ring-1 p-[1px]': navigator.userAgent.includes('Firefox'),
|
|
4
|
+
'ring-[0.5px] p-[0.5px]': !navigator.userAgent.includes('Firefox'),
|
|
5
|
+
},
|
|
6
|
+
'ring-inset',
|
|
7
|
+
'ring-general-200 dark:ring-general-200',
|
|
8
|
+
];
|
|
9
|
+
|
|
1
10
|
export default {
|
|
2
11
|
css: `
|
|
3
12
|
*[data-pd-ripple="true"]{
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
{
|
|
3
|
-
'ring-1 p-[1px]': navigator.userAgent.includes('Firefox'),
|
|
4
|
-
'ring-[0.5px] p-[0.5px]': !navigator.userAgent.includes('Firefox'),
|
|
5
|
-
},
|
|
6
|
-
'ring-inset',
|
|
7
|
-
'ring-general-200 dark:ring-general-200',
|
|
8
|
-
]
|
|
1
|
+
import { ringClass } from '../global';
|
|
9
2
|
|
|
10
3
|
export default {
|
|
11
4
|
root: ({ props }) => ({
|
|
12
5
|
class: [
|
|
13
6
|
'relative inline-block w-[125px] h-[125px]',
|
|
14
7
|
'shrink-0',
|
|
15
|
-
{ 'rounded-full': props.rounded},
|
|
8
|
+
{ 'rounded-full': props.rounded },
|
|
16
9
|
{ 'rounded-lg': !props.rounded },
|
|
17
10
|
...ringClass,
|
|
18
11
|
],
|
|
19
12
|
}),
|
|
20
|
-
image: ({ props}) => ({
|
|
13
|
+
image: ({ props }) => ({
|
|
21
14
|
class: [
|
|
22
15
|
'w-full h-full object-cover',
|
|
23
16
|
{ 'rounded-full': props.rounded },
|
|
@@ -33,10 +26,10 @@ export default {
|
|
|
33
26
|
'bg-transparent text-surface-0',
|
|
34
27
|
'hover:cursor-pointer hover:bg-header-weak hover:opacity-50',
|
|
35
28
|
],
|
|
36
|
-
style: 'border-radius: inherit'
|
|
29
|
+
style: 'border-radius: inherit',
|
|
37
30
|
},
|
|
38
31
|
icon: {
|
|
39
|
-
class: 'w-6 h-6'
|
|
32
|
+
class: 'w-6 h-6',
|
|
40
33
|
},
|
|
41
34
|
mask: {
|
|
42
35
|
class: [
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { commonClasses } from '../inputphonenumber';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
currency: (ctx) => ({
|
|
5
|
+
'class': [...commonClasses(ctx), 'rounded-l rounded-r-none'],
|
|
6
|
+
'data-ts-section': 'currency',
|
|
7
|
+
}),
|
|
8
|
+
value: (ctx) => ({
|
|
9
|
+
'class': [...commonClasses(ctx), 'rounded-r rounded-l-none -ml-[1px]'],
|
|
10
|
+
'data-ts-section': 'value',
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const commonClasses = ({ isFirefoxBased, invalidInput }) => [
|
|
2
|
+
{ 'ring-[1px]': isFirefoxBased, 'ring-[0.5px]': !isFirefoxBased },
|
|
3
|
+
{ '!ring-danger-500': invalidInput },
|
|
4
|
+
'ring-inset',
|
|
5
|
+
'ring-general-200',
|
|
6
|
+
'[&:has(:focus)]:bg-none [&:has(:focus)]:dark:bg-none',
|
|
7
|
+
'[&:has(:focus)]:ring-primary-500',
|
|
8
|
+
'bg-white dark:bg-white',
|
|
9
|
+
'z-[0] [&:has(:focus)]:z-[12]',
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
dialcode: (ctx) => ({
|
|
14
|
+
class: [...commonClasses(ctx), 'rounded-l rounded-r-none'],
|
|
15
|
+
}),
|
|
16
|
+
inputnumber: (ctx) => ({
|
|
17
|
+
class: [...commonClasses(ctx), 'rounded-r rounded-l-none -ml-[1px]'],
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ringClass } from '../global';
|
|
2
|
+
|
|
1
3
|
export default {
|
|
2
4
|
root: ({ context }) => ({
|
|
3
5
|
class: [
|
|
@@ -13,8 +15,7 @@ export default {
|
|
|
13
15
|
// Shape
|
|
14
16
|
'rounded',
|
|
15
17
|
'appearance-none',
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
...ringClass,
|
|
18
19
|
// // States
|
|
19
20
|
{
|
|
20
21
|
'bg-transparent text-general-800 dark:text-general-800':
|