design-system-next 2.11.17 → 2.11.19
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/design-system-next.es.js +6885 -6987
- package/dist/design-system-next.es.js.gz +0 -0
- package/dist/design-system-next.umd.js +12 -12
- package/dist/design-system-next.umd.js.gz +0 -0
- package/dist/main.css +1 -1
- package/dist/main.css.gz +0 -0
- package/dist/package.json.d.ts +1 -1
- package/package.json +1 -1
- package/src/assets/scripts/border-radius.ts +15 -15
- package/src/assets/scripts/colors.ts +134 -134
- package/src/assets/scripts/max-width.ts +11 -11
- package/src/assets/scripts/spacing.ts +23 -23
- package/src/assets/scripts/utilities.ts +15 -15
- package/src/assets/styles/tailwind.css +6 -18
- package/src/components/accordion/accordion.ts +43 -43
- package/src/components/accordion/use-accordion.ts +43 -43
- package/src/components/avatar/avatar.ts +64 -64
- package/src/components/badge/badge.ts +43 -43
- package/src/components/banner/banner.ts +20 -20
- package/src/components/button/button.ts +72 -72
- package/src/components/button/button.vue +15 -15
- package/src/components/calendar/calendar.ts +89 -89
- package/src/components/card/card.ts +52 -52
- package/src/components/checkbox/checkbox.ts +45 -45
- package/src/components/chips/chips.ts +95 -95
- package/src/components/collapsible/collapsible.ts +21 -21
- package/src/components/collapsible/collapsible.vue +27 -27
- package/src/components/date-picker/__tests__/date-picker.test.ts +112 -112
- package/src/components/date-picker/date-picker.ts +157 -157
- package/src/components/dropdown/__tests__/dropdown-fixes.spec.ts +106 -106
- package/src/components/dropdown/__tests__/dropdown-value-types.spec.ts +213 -213
- package/src/components/dropdown/dropdown.ts +4 -0
- package/src/components/dropdown/dropdown.vue +2 -0
- package/src/components/dropdown/fix-multi-number.ts +92 -92
- package/src/components/dropdown/use-dropdown.ts +488 -488
- package/src/components/empty-state/empty-state.ts +50 -50
- package/src/components/file-upload/file-upload.ts +87 -87
- package/src/components/floating-action/floating-action.ts +12 -12
- package/src/components/input/input-contact-number/input-contact-number.ts +83 -83
- package/src/components/input/input-email/input-email.vue +17 -17
- package/src/components/input/input-password/use-input-password.ts +19 -19
- package/src/components/input/input-search/input-search.vue +13 -13
- package/src/components/input/input-url/input-url.vue +20 -20
- package/src/components/input/input-username/input-username.vue +17 -17
- package/src/components/input/input.vue +72 -72
- package/src/components/list/ladderized-list/ladderized-list.ts +39 -39
- package/src/components/list/list.ts +4 -0
- package/src/components/list/list.vue +33 -24
- package/src/components/logo/logo.ts +43 -43
- package/src/components/logo/logo.vue +14 -14
- package/src/components/logo/use-logo.ts +41 -41
- package/src/components/lozenge/lozenge.ts +61 -61
- package/src/components/modal/modal.ts +45 -45
- package/src/components/progress-bar/progress-bar.ts +39 -39
- package/src/components/radio/radio.ts +42 -42
- package/src/components/select/select.ts +144 -144
- package/src/components/sidenav/sidenav.ts +172 -173
- package/src/components/sidenav/sidenav.vue +211 -126
- package/src/components/sidenav/use-sidenav.ts +85 -76
- package/src/components/sidepanel/sidepanel.ts +104 -100
- package/src/components/sidepanel/sidepanel.vue +55 -55
- package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.ts +16 -16
- package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.vue +39 -39
- package/src/components/sidepanel/use-sidepanel.ts +5 -2
- package/src/components/slider/slider.ts +38 -38
- package/src/components/snackbar/snack/snack.ts +71 -71
- package/src/components/snackbar/use-snackbar.ts +34 -34
- package/src/components/status/status.ts +19 -19
- package/src/components/status/status.vue +13 -13
- package/src/components/stepper/step/step.ts +47 -47
- package/src/components/stepper/stepper.ts +47 -47
- package/src/components/stepper/stepper.vue +34 -34
- package/src/components/switch/switch.ts +42 -42
- package/src/components/table/table-actions/table-actions.ts +42 -42
- package/src/components/table/table-actions/table-actions.vue +40 -40
- package/src/components/table/table-chips-title/table-chips-title.ts +27 -27
- package/src/components/table/table-chips-title/table-chips-title.vue +32 -32
- package/src/components/table/table-chips-title/use-table-chips-title.ts +22 -22
- package/src/components/table/table-lozenge-title/table-lozenge-title.ts +23 -23
- package/src/components/table/table-lozenge-title/table-lozenge-title.vue +26 -26
- package/src/components/table/table-lozenge-title/use-table-lozenge-title.ts +21 -21
- package/src/components/table/table-pagination/table-pagination.ts +63 -63
- package/src/components/table/table-pagination/table-pagination.vue +72 -72
- package/src/components/table/table.ts +173 -173
- package/src/components/tabs/tabs.ts +43 -43
- package/src/components/textarea/textarea.ts +72 -72
- package/src/components/textarea/textarea.vue +45 -45
- package/src/components/time-picker/time-picker.ts +69 -69
- package/src/components/tooltip/tooltip.ts +44 -46
- package/src/components/tooltip/tooltip.vue +4 -1
- package/src/components/tooltip/use-tooltip.ts +13 -13
- package/src/examples/dropdown-number-multi-select.vue +76 -76
- package/src/stores/useSnackbarStore.ts +44 -44
- package/src/vite-env.d.ts +0 -6
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
const AVATAR_SIZE = ['2xl', 'xl', 'lg', 'md', 'sm', 'xs', '2xs'] as const;
|
|
6
|
-
const AVATAR_PRIMARY = ['primary', 'secondary'] as const;
|
|
7
|
-
const AVATAR_STATUS = ['danger', 'disabled', 'information', 'brand'] as const;
|
|
8
|
-
export const AVATAR_VARIANT = ['image', 'initial', 'client', 'user', 'user-group', 'count'] as const;
|
|
9
|
-
|
|
10
|
-
export const avatarPropTypes = {
|
|
11
|
-
src: {
|
|
12
|
-
type: String,
|
|
13
|
-
},
|
|
14
|
-
alt: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: 'Avatar',
|
|
17
|
-
},
|
|
18
|
-
badge: {
|
|
19
|
-
type: Boolean,
|
|
20
|
-
default: false,
|
|
21
|
-
},
|
|
22
|
-
size: {
|
|
23
|
-
type: String,
|
|
24
|
-
validator: (value: (typeof AVATAR_SIZE)[number]) => AVATAR_SIZE.includes(value),
|
|
25
|
-
default: '2xl',
|
|
26
|
-
},
|
|
27
|
-
notification: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: false,
|
|
30
|
-
},
|
|
31
|
-
notificationText: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: '0',
|
|
34
|
-
},
|
|
35
|
-
initial: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: 'Avatar',
|
|
38
|
-
},
|
|
39
|
-
color: {
|
|
40
|
-
type: String,
|
|
41
|
-
validator: (value: (typeof AVATAR_PRIMARY)[number]) => AVATAR_PRIMARY.includes(value),
|
|
42
|
-
default: 'primary',
|
|
43
|
-
},
|
|
44
|
-
status: {
|
|
45
|
-
type: String,
|
|
46
|
-
validator: (value: (typeof AVATAR_STATUS)[number]) => AVATAR_STATUS.includes(value),
|
|
47
|
-
default: 'brand',
|
|
48
|
-
},
|
|
49
|
-
count: {
|
|
50
|
-
type: Number,
|
|
51
|
-
default: 0,
|
|
52
|
-
},
|
|
53
|
-
variant: {
|
|
54
|
-
type: String,
|
|
55
|
-
validator: (value: (typeof AVATAR_VARIANT)[number]) => AVATAR_VARIANT.includes(value),
|
|
56
|
-
default: 'initial',
|
|
57
|
-
},
|
|
58
|
-
loading: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: false,
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export type AvatarPropTypes = ExtractPropTypes<typeof avatarPropTypes>;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
const AVATAR_SIZE = ['2xl', 'xl', 'lg', 'md', 'sm', 'xs', '2xs'] as const;
|
|
6
|
+
const AVATAR_PRIMARY = ['primary', 'secondary'] as const;
|
|
7
|
+
const AVATAR_STATUS = ['danger', 'disabled', 'information', 'brand'] as const;
|
|
8
|
+
export const AVATAR_VARIANT = ['image', 'initial', 'client', 'user', 'user-group', 'count'] as const;
|
|
9
|
+
|
|
10
|
+
export const avatarPropTypes = {
|
|
11
|
+
src: {
|
|
12
|
+
type: String,
|
|
13
|
+
},
|
|
14
|
+
alt: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'Avatar',
|
|
17
|
+
},
|
|
18
|
+
badge: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
type: String,
|
|
24
|
+
validator: (value: (typeof AVATAR_SIZE)[number]) => AVATAR_SIZE.includes(value),
|
|
25
|
+
default: '2xl',
|
|
26
|
+
},
|
|
27
|
+
notification: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false,
|
|
30
|
+
},
|
|
31
|
+
notificationText: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: '0',
|
|
34
|
+
},
|
|
35
|
+
initial: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'Avatar',
|
|
38
|
+
},
|
|
39
|
+
color: {
|
|
40
|
+
type: String,
|
|
41
|
+
validator: (value: (typeof AVATAR_PRIMARY)[number]) => AVATAR_PRIMARY.includes(value),
|
|
42
|
+
default: 'primary',
|
|
43
|
+
},
|
|
44
|
+
status: {
|
|
45
|
+
type: String,
|
|
46
|
+
validator: (value: (typeof AVATAR_STATUS)[number]) => AVATAR_STATUS.includes(value),
|
|
47
|
+
default: 'brand',
|
|
48
|
+
},
|
|
49
|
+
count: {
|
|
50
|
+
type: Number,
|
|
51
|
+
default: 0,
|
|
52
|
+
},
|
|
53
|
+
variant: {
|
|
54
|
+
type: String,
|
|
55
|
+
validator: (value: (typeof AVATAR_VARIANT)[number]) => AVATAR_VARIANT.includes(value),
|
|
56
|
+
default: 'initial',
|
|
57
|
+
},
|
|
58
|
+
loading: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type AvatarPropTypes = ExtractPropTypes<typeof avatarPropTypes>;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
const BADGE_VARIANT = ['danger', 'disabled', 'information', 'brand'] as const;
|
|
6
|
-
const BADGE_SIZE = ['small', 'big', 'tiny'] as const;
|
|
7
|
-
const BADGE_POSITION = ['top', 'bottom', 'default'] as const;
|
|
8
|
-
|
|
9
|
-
export const badgePropTypes = {
|
|
10
|
-
/**
|
|
11
|
-
* @description Badge Label
|
|
12
|
-
*/
|
|
13
|
-
text: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: '0',
|
|
16
|
-
},
|
|
17
|
-
/**
|
|
18
|
-
* @description Badge variant
|
|
19
|
-
*/
|
|
20
|
-
variant: {
|
|
21
|
-
type: String,
|
|
22
|
-
validator: (value: (typeof BADGE_VARIANT)[number]) => BADGE_VARIANT.includes(value),
|
|
23
|
-
default: 'brand',
|
|
24
|
-
},
|
|
25
|
-
/**
|
|
26
|
-
* @description Badge size
|
|
27
|
-
*/
|
|
28
|
-
size: {
|
|
29
|
-
type: String,
|
|
30
|
-
validator: (value: (typeof BADGE_SIZE)[number]) => BADGE_SIZE.includes(value),
|
|
31
|
-
default: 'small',
|
|
32
|
-
},
|
|
33
|
-
/**
|
|
34
|
-
* @description Badge position (top, bottom, default)
|
|
35
|
-
*/
|
|
36
|
-
position: {
|
|
37
|
-
type: String,
|
|
38
|
-
validator: (value: (typeof BADGE_POSITION)[number]) => BADGE_POSITION.includes(value),
|
|
39
|
-
default: 'default',
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type BadgePropTypes = ExtractPropTypes<typeof badgePropTypes>;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
const BADGE_VARIANT = ['danger', 'disabled', 'information', 'brand'] as const;
|
|
6
|
+
const BADGE_SIZE = ['small', 'big', 'tiny'] as const;
|
|
7
|
+
const BADGE_POSITION = ['top', 'bottom', 'default'] as const;
|
|
8
|
+
|
|
9
|
+
export const badgePropTypes = {
|
|
10
|
+
/**
|
|
11
|
+
* @description Badge Label
|
|
12
|
+
*/
|
|
13
|
+
text: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: '0',
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* @description Badge variant
|
|
19
|
+
*/
|
|
20
|
+
variant: {
|
|
21
|
+
type: String,
|
|
22
|
+
validator: (value: (typeof BADGE_VARIANT)[number]) => BADGE_VARIANT.includes(value),
|
|
23
|
+
default: 'brand',
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* @description Badge size
|
|
27
|
+
*/
|
|
28
|
+
size: {
|
|
29
|
+
type: String,
|
|
30
|
+
validator: (value: (typeof BADGE_SIZE)[number]) => BADGE_SIZE.includes(value),
|
|
31
|
+
default: 'small',
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* @description Badge position (top, bottom, default)
|
|
35
|
+
*/
|
|
36
|
+
position: {
|
|
37
|
+
type: String,
|
|
38
|
+
validator: (value: (typeof BADGE_POSITION)[number]) => BADGE_POSITION.includes(value),
|
|
39
|
+
default: 'default',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type BadgePropTypes = ExtractPropTypes<typeof badgePropTypes>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { PropType, type ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const BANNER_TYPE = ['success', 'error', 'info', 'pending', 'caution'] as const;
|
|
4
|
-
|
|
5
|
-
export const bannerProps = {
|
|
6
|
-
type: {
|
|
7
|
-
type: String as PropType<(typeof BANNER_TYPE)[number]>,
|
|
8
|
-
validator: (value: (typeof BANNER_TYPE)[number]) => BANNER_TYPE.includes(value),
|
|
9
|
-
default: 'success',
|
|
10
|
-
},
|
|
11
|
-
showCloseButton: {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
default: false,
|
|
14
|
-
},
|
|
15
|
-
message: {
|
|
16
|
-
type: String,
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type BannerPropTypes = ExtractPropTypes<typeof bannerProps>;
|
|
1
|
+
import { PropType, type ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const BANNER_TYPE = ['success', 'error', 'info', 'pending', 'caution'] as const;
|
|
4
|
+
|
|
5
|
+
export const bannerProps = {
|
|
6
|
+
type: {
|
|
7
|
+
type: String as PropType<(typeof BANNER_TYPE)[number]>,
|
|
8
|
+
validator: (value: (typeof BANNER_TYPE)[number]) => BANNER_TYPE.includes(value),
|
|
9
|
+
default: 'success',
|
|
10
|
+
},
|
|
11
|
+
showCloseButton: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: false,
|
|
14
|
+
},
|
|
15
|
+
message: {
|
|
16
|
+
type: String,
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type BannerPropTypes = ExtractPropTypes<typeof bannerProps>;
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
const BUTTON_TONES = ['neutral', 'success', 'danger'] as const;
|
|
6
|
-
const BUTTON_SIZES = ['small', 'medium', 'large'] as const;
|
|
7
|
-
const BUTTON_TYPES = ['button', 'submit', 'reset'] as const;
|
|
8
|
-
const BUTTON_STATES = ['base', 'hover', 'pressed', 'focus'] as const;
|
|
9
|
-
const BUTTON_VARIANTS = ['primary', 'secondary', 'tertiary'] as const;
|
|
10
|
-
|
|
11
|
-
export const buttonPropTypes = {
|
|
12
|
-
/**
|
|
13
|
-
* @description Button tone
|
|
14
|
-
*/
|
|
15
|
-
tone: {
|
|
16
|
-
type: String as PropType<(typeof BUTTON_TONES)[number]>,
|
|
17
|
-
validator: (value: (typeof BUTTON_TONES)[number]) => BUTTON_TONES.includes(value),
|
|
18
|
-
default: 'neutral',
|
|
19
|
-
},
|
|
20
|
-
/**
|
|
21
|
-
* @description Button size
|
|
22
|
-
*/
|
|
23
|
-
size: {
|
|
24
|
-
type: String as PropType<(typeof BUTTON_SIZES)[number]>,
|
|
25
|
-
validator: (value: (typeof BUTTON_SIZES)[number]) => BUTTON_SIZES.includes(value),
|
|
26
|
-
default: 'medium',
|
|
27
|
-
},
|
|
28
|
-
/**
|
|
29
|
-
* @description Native button type
|
|
30
|
-
*/
|
|
31
|
-
type: {
|
|
32
|
-
type: String as PropType<(typeof BUTTON_TYPES)[number]>,
|
|
33
|
-
validator: (value: (typeof BUTTON_TYPES)[number]) => BUTTON_TYPES.includes(value),
|
|
34
|
-
default: 'button',
|
|
35
|
-
},
|
|
36
|
-
/**
|
|
37
|
-
* @description Button state
|
|
38
|
-
*/
|
|
39
|
-
state: {
|
|
40
|
-
type: String as PropType<(typeof BUTTON_STATES)[number]>,
|
|
41
|
-
validator: (value: (typeof BUTTON_STATES)[number]) => BUTTON_STATES.includes(value),
|
|
42
|
-
default: 'base',
|
|
43
|
-
},
|
|
44
|
-
/**
|
|
45
|
-
* @description Button Variant
|
|
46
|
-
*/
|
|
47
|
-
variant: {
|
|
48
|
-
type: String as PropType<(typeof BUTTON_VARIANTS)[number]>,
|
|
49
|
-
validator: (value: (typeof BUTTON_VARIANTS)[number]) => BUTTON_VARIANTS.includes(value),
|
|
50
|
-
default: 'primary',
|
|
51
|
-
},
|
|
52
|
-
disabled: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: false,
|
|
55
|
-
},
|
|
56
|
-
hasIcon: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false,
|
|
59
|
-
},
|
|
60
|
-
fullwidth: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: false,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const buttonEmitTypes = {
|
|
67
|
-
click: (evt: MouseEvent): evt is MouseEvent => evt instanceof MouseEvent,
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export type ButtonPropTypes = ExtractPropTypes<typeof buttonPropTypes>;
|
|
71
|
-
export type ButtonEmitTypes = typeof buttonEmitTypes;
|
|
72
|
-
export type ButtonType = ButtonPropTypes['type'];
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
const BUTTON_TONES = ['neutral', 'success', 'danger'] as const;
|
|
6
|
+
const BUTTON_SIZES = ['small', 'medium', 'large'] as const;
|
|
7
|
+
const BUTTON_TYPES = ['button', 'submit', 'reset'] as const;
|
|
8
|
+
const BUTTON_STATES = ['base', 'hover', 'pressed', 'focus'] as const;
|
|
9
|
+
const BUTTON_VARIANTS = ['primary', 'secondary', 'tertiary'] as const;
|
|
10
|
+
|
|
11
|
+
export const buttonPropTypes = {
|
|
12
|
+
/**
|
|
13
|
+
* @description Button tone
|
|
14
|
+
*/
|
|
15
|
+
tone: {
|
|
16
|
+
type: String as PropType<(typeof BUTTON_TONES)[number]>,
|
|
17
|
+
validator: (value: (typeof BUTTON_TONES)[number]) => BUTTON_TONES.includes(value),
|
|
18
|
+
default: 'neutral',
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* @description Button size
|
|
22
|
+
*/
|
|
23
|
+
size: {
|
|
24
|
+
type: String as PropType<(typeof BUTTON_SIZES)[number]>,
|
|
25
|
+
validator: (value: (typeof BUTTON_SIZES)[number]) => BUTTON_SIZES.includes(value),
|
|
26
|
+
default: 'medium',
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* @description Native button type
|
|
30
|
+
*/
|
|
31
|
+
type: {
|
|
32
|
+
type: String as PropType<(typeof BUTTON_TYPES)[number]>,
|
|
33
|
+
validator: (value: (typeof BUTTON_TYPES)[number]) => BUTTON_TYPES.includes(value),
|
|
34
|
+
default: 'button',
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* @description Button state
|
|
38
|
+
*/
|
|
39
|
+
state: {
|
|
40
|
+
type: String as PropType<(typeof BUTTON_STATES)[number]>,
|
|
41
|
+
validator: (value: (typeof BUTTON_STATES)[number]) => BUTTON_STATES.includes(value),
|
|
42
|
+
default: 'base',
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* @description Button Variant
|
|
46
|
+
*/
|
|
47
|
+
variant: {
|
|
48
|
+
type: String as PropType<(typeof BUTTON_VARIANTS)[number]>,
|
|
49
|
+
validator: (value: (typeof BUTTON_VARIANTS)[number]) => BUTTON_VARIANTS.includes(value),
|
|
50
|
+
default: 'primary',
|
|
51
|
+
},
|
|
52
|
+
disabled: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
56
|
+
hasIcon: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false,
|
|
59
|
+
},
|
|
60
|
+
fullwidth: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const buttonEmitTypes = {
|
|
67
|
+
click: (evt: MouseEvent): evt is MouseEvent => evt instanceof MouseEvent,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type ButtonPropTypes = ExtractPropTypes<typeof buttonPropTypes>;
|
|
71
|
+
export type ButtonEmitTypes = typeof buttonEmitTypes;
|
|
72
|
+
export type ButtonType = ButtonPropTypes['type'];
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<button ref="buttonRef" :class="buttonClassses" v-bind="buttonProps" @click="handleClick">
|
|
3
|
-
<slot />
|
|
4
|
-
</button>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script lang="ts" setup>
|
|
8
|
-
import { buttonEmitTypes, buttonPropTypes } from './button';
|
|
9
|
-
import { useButton } from './use-button';
|
|
10
|
-
|
|
11
|
-
const props = defineProps(buttonPropTypes);
|
|
12
|
-
const emit = defineEmits(buttonEmitTypes);
|
|
13
|
-
|
|
14
|
-
const { buttonRef, buttonClassses, buttonProps, handleClick } = useButton(props, emit);
|
|
15
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<button ref="buttonRef" :class="buttonClassses" v-bind="buttonProps" @click="handleClick">
|
|
3
|
+
<slot />
|
|
4
|
+
</button>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { buttonEmitTypes, buttonPropTypes } from './button';
|
|
9
|
+
import { useButton } from './use-button';
|
|
10
|
+
|
|
11
|
+
const props = defineProps(buttonPropTypes);
|
|
12
|
+
const emit = defineEmits(buttonEmitTypes);
|
|
13
|
+
|
|
14
|
+
const { buttonRef, buttonClassses, buttonProps, handleClick } = useButton(props, emit);
|
|
15
|
+
</script>
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
export interface ShiftType {
|
|
6
|
-
startTime: string;
|
|
7
|
-
endTime: string;
|
|
8
|
-
location: string;
|
|
9
|
-
type: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface EmployeeSchedule {
|
|
13
|
-
[key: string]: ShiftType | 'restday' | null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface Employee {
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
position: string;
|
|
20
|
-
avatar?: string;
|
|
21
|
-
hoursWorked?: number;
|
|
22
|
-
hoursTarget?: number;
|
|
23
|
-
schedule: EmployeeSchedule[];
|
|
24
|
-
}
|
|
25
|
-
export interface SelectedShift {
|
|
26
|
-
employeeId: string;
|
|
27
|
-
date: string;
|
|
28
|
-
shift?: ShiftType | 'restday' | null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const calendarPropTypes = {
|
|
32
|
-
employees: {
|
|
33
|
-
type: Array as PropType<Employee[]>,
|
|
34
|
-
default: () => [],
|
|
35
|
-
},
|
|
36
|
-
initialDate: {
|
|
37
|
-
type: Date,
|
|
38
|
-
default: () => new Date(),
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
search: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: '',
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
selectedCell: {
|
|
47
|
-
type: Object as PropType<SelectedShift>,
|
|
48
|
-
default: () => ({
|
|
49
|
-
employeeId: '',
|
|
50
|
-
date: '',
|
|
51
|
-
shift: null,
|
|
52
|
-
}),
|
|
53
|
-
},
|
|
54
|
-
loading: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: false,
|
|
57
|
-
},
|
|
58
|
-
emptyStateTitle: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: 'No List Found',
|
|
61
|
-
},
|
|
62
|
-
emptyStateDescription: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: '',
|
|
65
|
-
},
|
|
66
|
-
emptyStateButtonText: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: 'Add Employee',
|
|
69
|
-
},
|
|
70
|
-
hideAddButton: {
|
|
71
|
-
type: Boolean,
|
|
72
|
-
default: false,
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
infiniteLoading: {
|
|
76
|
-
type: Boolean,
|
|
77
|
-
default: false,
|
|
78
|
-
},
|
|
79
|
-
loadingTextCompleted: {
|
|
80
|
-
type: String,
|
|
81
|
-
default: '',
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export const calendarEmitTypes = {};
|
|
86
|
-
|
|
87
|
-
export type CalendarEmitTypes = typeof calendarEmitTypes;
|
|
88
|
-
|
|
89
|
-
export type CalendarPropTypes = ExtractPropTypes<typeof calendarPropTypes>;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
export interface ShiftType {
|
|
6
|
+
startTime: string;
|
|
7
|
+
endTime: string;
|
|
8
|
+
location: string;
|
|
9
|
+
type: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface EmployeeSchedule {
|
|
13
|
+
[key: string]: ShiftType | 'restday' | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface Employee {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
position: string;
|
|
20
|
+
avatar?: string;
|
|
21
|
+
hoursWorked?: number;
|
|
22
|
+
hoursTarget?: number;
|
|
23
|
+
schedule: EmployeeSchedule[];
|
|
24
|
+
}
|
|
25
|
+
export interface SelectedShift {
|
|
26
|
+
employeeId: string;
|
|
27
|
+
date: string;
|
|
28
|
+
shift?: ShiftType | 'restday' | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const calendarPropTypes = {
|
|
32
|
+
employees: {
|
|
33
|
+
type: Array as PropType<Employee[]>,
|
|
34
|
+
default: () => [],
|
|
35
|
+
},
|
|
36
|
+
initialDate: {
|
|
37
|
+
type: Date,
|
|
38
|
+
default: () => new Date(),
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
search: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: '',
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
selectedCell: {
|
|
47
|
+
type: Object as PropType<SelectedShift>,
|
|
48
|
+
default: () => ({
|
|
49
|
+
employeeId: '',
|
|
50
|
+
date: '',
|
|
51
|
+
shift: null,
|
|
52
|
+
}),
|
|
53
|
+
},
|
|
54
|
+
loading: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false,
|
|
57
|
+
},
|
|
58
|
+
emptyStateTitle: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: 'No List Found',
|
|
61
|
+
},
|
|
62
|
+
emptyStateDescription: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: '',
|
|
65
|
+
},
|
|
66
|
+
emptyStateButtonText: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: 'Add Employee',
|
|
69
|
+
},
|
|
70
|
+
hideAddButton: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: false,
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
infiniteLoading: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false,
|
|
78
|
+
},
|
|
79
|
+
loadingTextCompleted: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: '',
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const calendarEmitTypes = {};
|
|
86
|
+
|
|
87
|
+
export type CalendarEmitTypes = typeof calendarEmitTypes;
|
|
88
|
+
|
|
89
|
+
export type CalendarPropTypes = ExtractPropTypes<typeof calendarPropTypes>;
|