design-system-next 2.19.4 → 2.20.0
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 +11652 -8447
- package/dist/design-system-next.es.js.gz +0 -0
- package/dist/design-system-next.umd.js +13 -14
- 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 +36 -33
- package/package.json +36 -33
- package/src/App.vue +1 -51
- 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/components/accordion/accordion.ts +43 -43
- package/src/components/accordion/use-accordion.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/card/card.vue +4 -1
- package/src/components/card/use-card.ts +12 -12
- package/src/components/checkbox/checkbox.ts +45 -45
- package/src/components/collapsible/collapsible.ts +21 -21
- package/src/components/collapsible/collapsible.vue +27 -27
- package/src/components/date-picker/date-picker.ts +3 -3
- package/src/components/date-picker/tabs/DatePickerCalendarTab.vue +4 -13
- package/src/components/dropdown/dropdown.vue +1 -1
- package/src/components/dropdown/fix-multi-number.ts +92 -92
- 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-email/input-email.vue +17 -17
- package/src/components/input/input-password/input-password.vue +5 -1
- 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/list/ladderized-list/ladderized-list.ts +39 -39
- 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/progress-bar/progress-bar.ts +39 -39
- package/src/components/radio/radio.ts +42 -42
- package/src/components/select/select-ladderized/select-ladderized.ts +2 -1
- 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/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/tabs/tabs.ts +43 -43
- package/src/components/time-picker/time-picker.ts +69 -69
- package/src/components/tooltip/use-tooltip.ts +13 -13
- package/src/stores/useSnackbarStore.ts +44 -44
- package/src/vite-env.d.ts +6 -0
- package/src/vue.d.ts +5 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<spr-input v-bind="$attrs" type="url">
|
|
3
|
-
<template v-for="(_, slotName) in $slots" #[slotName]>
|
|
4
|
-
<slot :name="slotName" />
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<template #prefix>
|
|
8
|
-
<span> https:// </span>
|
|
9
|
-
</template>
|
|
10
|
-
<template #icon>
|
|
11
|
-
<Icon icon="ph:question-fill" />
|
|
12
|
-
</template>
|
|
13
|
-
</spr-input>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script setup lang="ts">
|
|
17
|
-
import { Icon } from '@iconify/vue';
|
|
18
|
-
|
|
19
|
-
import SprInput from '@/components/input/input.vue';
|
|
20
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<spr-input v-bind="$attrs" type="url">
|
|
3
|
+
<template v-for="(_, slotName) in $slots" #[slotName]>
|
|
4
|
+
<slot :name="slotName" />
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<template #prefix>
|
|
8
|
+
<span> https:// </span>
|
|
9
|
+
</template>
|
|
10
|
+
<template #icon>
|
|
11
|
+
<Icon icon="ph:question-fill" />
|
|
12
|
+
</template>
|
|
13
|
+
</spr-input>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
import { Icon } from '@iconify/vue';
|
|
18
|
+
|
|
19
|
+
import SprInput from '@/components/input/input.vue';
|
|
20
|
+
</script>
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<spr-input v-bind="$attrs">
|
|
3
|
-
<template v-for="(_, slotName) in $slots" #[slotName]>
|
|
4
|
-
<slot :name="slotName" />
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<template #prefix>
|
|
8
|
-
<Icon icon="ph:user" />
|
|
9
|
-
</template>
|
|
10
|
-
</spr-input>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script setup lang="ts">
|
|
14
|
-
import { Icon } from '@iconify/vue';
|
|
15
|
-
|
|
16
|
-
import SprInput from '@/components/input/input.vue';
|
|
17
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<spr-input v-bind="$attrs">
|
|
3
|
+
<template v-for="(_, slotName) in $slots" #[slotName]>
|
|
4
|
+
<slot :name="slotName" />
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<template #prefix>
|
|
8
|
+
<Icon icon="ph:user" />
|
|
9
|
+
</template>
|
|
10
|
+
</spr-input>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
import { Icon } from '@iconify/vue';
|
|
15
|
+
|
|
16
|
+
import SprInput from '@/components/input/input.vue';
|
|
17
|
+
</script>
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import { MenuListType } from '../list';
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
export const ladderizedListPropTypes = {
|
|
6
|
-
modelValue: {
|
|
7
|
-
type: Array as PropType<string[]>,
|
|
8
|
-
required: true,
|
|
9
|
-
default: [],
|
|
10
|
-
},
|
|
11
|
-
menuList: {
|
|
12
|
-
type: Array as PropType<MenuListType[]>,
|
|
13
|
-
required: true,
|
|
14
|
-
default: [],
|
|
15
|
-
},
|
|
16
|
-
menuLevel: {
|
|
17
|
-
type: Number,
|
|
18
|
-
default: 0,
|
|
19
|
-
},
|
|
20
|
-
searchableMenu: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false,
|
|
23
|
-
},
|
|
24
|
-
searchableMenuPlaceholder: {
|
|
25
|
-
type: String,
|
|
26
|
-
default: 'Search...',
|
|
27
|
-
},
|
|
28
|
-
removeCurrentLevelInBackLabel: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false,
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const ladderizedListEmitTypes = {
|
|
35
|
-
'update:modelValue': (value: string[]) => value,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export type LadderizedListPropTypes = ExtractPropTypes<typeof ladderizedListPropTypes>;
|
|
39
|
-
export type LadderizedListEmitTypes = typeof ladderizedListEmitTypes;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
import { MenuListType } from '../list';
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
export const ladderizedListPropTypes = {
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: Array as PropType<string[]>,
|
|
8
|
+
required: true,
|
|
9
|
+
default: [],
|
|
10
|
+
},
|
|
11
|
+
menuList: {
|
|
12
|
+
type: Array as PropType<MenuListType[]>,
|
|
13
|
+
required: true,
|
|
14
|
+
default: [],
|
|
15
|
+
},
|
|
16
|
+
menuLevel: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 0,
|
|
19
|
+
},
|
|
20
|
+
searchableMenu: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false,
|
|
23
|
+
},
|
|
24
|
+
searchableMenuPlaceholder: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'Search...',
|
|
27
|
+
},
|
|
28
|
+
removeCurrentLevelInBackLabel: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const ladderizedListEmitTypes = {
|
|
35
|
+
'update:modelValue': (value: string[]) => value,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type LadderizedListPropTypes = ExtractPropTypes<typeof ladderizedListPropTypes>;
|
|
39
|
+
export type LadderizedListEmitTypes = typeof ladderizedListEmitTypes;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
const LOGO_THEMES = ['white', 'dark', 'gray', 'green'] as const;
|
|
4
|
-
const LOGO_NAMES = [
|
|
5
|
-
'benchmark',
|
|
6
|
-
'ecosystem',
|
|
7
|
-
'engage',
|
|
8
|
-
'finances',
|
|
9
|
-
'hr-mobile',
|
|
10
|
-
'hr',
|
|
11
|
-
'inbound',
|
|
12
|
-
'insight',
|
|
13
|
-
'readycash',
|
|
14
|
-
'readywage',
|
|
15
|
-
'payroll',
|
|
16
|
-
'performance-plus',
|
|
17
|
-
'procurement',
|
|
18
|
-
'professional-services',
|
|
19
|
-
'recruit',
|
|
20
|
-
'recruit-plus',
|
|
21
|
-
'sail',
|
|
22
|
-
'sidekick',
|
|
23
|
-
'wellness',
|
|
24
|
-
] as const;
|
|
25
|
-
|
|
26
|
-
export const logoPropTypes = {
|
|
27
|
-
name: {
|
|
28
|
-
type: String as PropType<(typeof LOGO_NAMES)[number]>,
|
|
29
|
-
validator: (value: (typeof LOGO_NAMES)[number]) => LOGO_NAMES.includes(value),
|
|
30
|
-
default: 'hr',
|
|
31
|
-
},
|
|
32
|
-
theme: {
|
|
33
|
-
type: String as PropType<(typeof LOGO_THEMES)[number]>,
|
|
34
|
-
validator: (value: (typeof LOGO_THEMES)[number]) => LOGO_THEMES.includes(value),
|
|
35
|
-
default: 'dark',
|
|
36
|
-
},
|
|
37
|
-
width: {
|
|
38
|
-
type: [String, Number] as PropType<string | number>,
|
|
39
|
-
default: '50', // If number, it will be treated as px
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type LogoPropTypes = ExtractPropTypes<typeof logoPropTypes>;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
const LOGO_THEMES = ['white', 'dark', 'gray', 'green'] as const;
|
|
4
|
+
const LOGO_NAMES = [
|
|
5
|
+
'benchmark',
|
|
6
|
+
'ecosystem',
|
|
7
|
+
'engage',
|
|
8
|
+
'finances',
|
|
9
|
+
'hr-mobile',
|
|
10
|
+
'hr',
|
|
11
|
+
'inbound',
|
|
12
|
+
'insight',
|
|
13
|
+
'readycash',
|
|
14
|
+
'readywage',
|
|
15
|
+
'payroll',
|
|
16
|
+
'performance-plus',
|
|
17
|
+
'procurement',
|
|
18
|
+
'professional-services',
|
|
19
|
+
'recruit',
|
|
20
|
+
'recruit-plus',
|
|
21
|
+
'sail',
|
|
22
|
+
'sidekick',
|
|
23
|
+
'wellness',
|
|
24
|
+
] as const;
|
|
25
|
+
|
|
26
|
+
export const logoPropTypes = {
|
|
27
|
+
name: {
|
|
28
|
+
type: String as PropType<(typeof LOGO_NAMES)[number]>,
|
|
29
|
+
validator: (value: (typeof LOGO_NAMES)[number]) => LOGO_NAMES.includes(value),
|
|
30
|
+
default: 'hr',
|
|
31
|
+
},
|
|
32
|
+
theme: {
|
|
33
|
+
type: String as PropType<(typeof LOGO_THEMES)[number]>,
|
|
34
|
+
validator: (value: (typeof LOGO_THEMES)[number]) => LOGO_THEMES.includes(value),
|
|
35
|
+
default: 'dark',
|
|
36
|
+
},
|
|
37
|
+
width: {
|
|
38
|
+
type: [String, Number] as PropType<string | number>,
|
|
39
|
+
default: '50', // If number, it will be treated as px
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type LogoPropTypes = ExtractPropTypes<typeof logoPropTypes>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<img v-bind="$attrs" :src="logoSrc" :alt="logoTitle" :title="logoTitle" :width="width" />
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script lang="ts" setup>
|
|
8
|
-
import { useLogo } from './use-logo';
|
|
9
|
-
import { logoPropTypes } from './logo';
|
|
10
|
-
|
|
11
|
-
const props = defineProps(logoPropTypes);
|
|
12
|
-
|
|
13
|
-
const { logoSrc, logoTitle } = useLogo(props);
|
|
14
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<img v-bind="$attrs" :src="logoSrc" :alt="logoTitle" :title="logoTitle" :width="width" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { useLogo } from './use-logo';
|
|
9
|
+
import { logoPropTypes } from './logo';
|
|
10
|
+
|
|
11
|
+
const props = defineProps(logoPropTypes);
|
|
12
|
+
|
|
13
|
+
const { logoSrc, logoTitle } = useLogo(props);
|
|
14
|
+
</script>
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { computed } from 'vue';
|
|
2
|
-
import type { LogoPropTypes } from './logo';
|
|
3
|
-
import { Cloudinary } from '@cloudinary/url-gen';
|
|
4
|
-
|
|
5
|
-
const CLOUD_NAME = 'dfeykvudc';
|
|
6
|
-
|
|
7
|
-
const NAME_MAP: Record<string, string> = {
|
|
8
|
-
'hr': 'Sprout HR',
|
|
9
|
-
'hr-mobile': 'Sprout HR Mobile',
|
|
10
|
-
'performance-plus': 'Sprout Performance+',
|
|
11
|
-
'recruit-plus': 'Sprout Recruit+',
|
|
12
|
-
'sail': 'Sprout SAIL',
|
|
13
|
-
'readycash': 'Sprout ReadyCash',
|
|
14
|
-
'readywage': 'Sprout ReadyWage',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export function useLogo(props: LogoPropTypes) {
|
|
18
|
-
const cld = new Cloudinary({
|
|
19
|
-
cloud: {
|
|
20
|
-
cloudName: CLOUD_NAME,
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const logoSrc = computed(() => cld.image(`sprout-${props.name}-${props.theme}`).toURL());
|
|
25
|
-
|
|
26
|
-
const logoTitle = computed(() => {
|
|
27
|
-
if (props.name in NAME_MAP) {
|
|
28
|
-
return NAME_MAP[props.name];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const firstChar = props.name.charAt(0).toUpperCase();
|
|
32
|
-
const remainingChars = props.name.slice(1);
|
|
33
|
-
const formattedName = `${firstChar}${remainingChars}`;
|
|
34
|
-
return `Sprout ${formattedName}`;
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
logoSrc,
|
|
39
|
-
logoTitle,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import type { LogoPropTypes } from './logo';
|
|
3
|
+
import { Cloudinary } from '@cloudinary/url-gen';
|
|
4
|
+
|
|
5
|
+
const CLOUD_NAME = 'dfeykvudc';
|
|
6
|
+
|
|
7
|
+
const NAME_MAP: Record<string, string> = {
|
|
8
|
+
'hr': 'Sprout HR',
|
|
9
|
+
'hr-mobile': 'Sprout HR Mobile',
|
|
10
|
+
'performance-plus': 'Sprout Performance+',
|
|
11
|
+
'recruit-plus': 'Sprout Recruit+',
|
|
12
|
+
'sail': 'Sprout SAIL',
|
|
13
|
+
'readycash': 'Sprout ReadyCash',
|
|
14
|
+
'readywage': 'Sprout ReadyWage',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export function useLogo(props: LogoPropTypes) {
|
|
18
|
+
const cld = new Cloudinary({
|
|
19
|
+
cloud: {
|
|
20
|
+
cloudName: CLOUD_NAME,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const logoSrc = computed(() => cld.image(`sprout-${props.name}-${props.theme}`).toURL());
|
|
25
|
+
|
|
26
|
+
const logoTitle = computed(() => {
|
|
27
|
+
if (props.name in NAME_MAP) {
|
|
28
|
+
return NAME_MAP[props.name];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const firstChar = props.name.charAt(0).toUpperCase();
|
|
32
|
+
const remainingChars = props.name.slice(1);
|
|
33
|
+
const formattedName = `${firstChar}${remainingChars}`;
|
|
34
|
+
return `Sprout ${formattedName}`;
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
logoSrc,
|
|
39
|
+
logoTitle,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
const PROGRESS_BAR_SIZES = ['xs', 'sm', 'lg'] as const;
|
|
4
|
-
|
|
5
|
-
export const progressBarPropTypes = {
|
|
6
|
-
size: {
|
|
7
|
-
type: String as PropType<(typeof PROGRESS_BAR_SIZES)[number]>,
|
|
8
|
-
validator: (value: (typeof PROGRESS_BAR_SIZES)[number]) => PROGRESS_BAR_SIZES.includes(value),
|
|
9
|
-
default: 'lg',
|
|
10
|
-
},
|
|
11
|
-
label: {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
default: true,
|
|
14
|
-
},
|
|
15
|
-
value: {
|
|
16
|
-
type: Number,
|
|
17
|
-
default: 0,
|
|
18
|
-
validator(value: number, props: { max: number }) {
|
|
19
|
-
if (value < 0 || value > props.max) {
|
|
20
|
-
console.error(`Invalid prop: "value" (${value}) must be between 0 and ${props.max}.`);
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
return true;
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
max: {
|
|
27
|
-
type: Number,
|
|
28
|
-
default: 100,
|
|
29
|
-
validator(value: number) {
|
|
30
|
-
if (value <= 0 || value > 100) {
|
|
31
|
-
console.error('Invalid prop: "max" must be between 1 and 100.');
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type ProgressBarPropTypes = ExtractPropTypes<typeof progressBarPropTypes>;
|
|
1
|
+
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
const PROGRESS_BAR_SIZES = ['xs', 'sm', 'lg'] as const;
|
|
4
|
+
|
|
5
|
+
export const progressBarPropTypes = {
|
|
6
|
+
size: {
|
|
7
|
+
type: String as PropType<(typeof PROGRESS_BAR_SIZES)[number]>,
|
|
8
|
+
validator: (value: (typeof PROGRESS_BAR_SIZES)[number]) => PROGRESS_BAR_SIZES.includes(value),
|
|
9
|
+
default: 'lg',
|
|
10
|
+
},
|
|
11
|
+
label: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: true,
|
|
14
|
+
},
|
|
15
|
+
value: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 0,
|
|
18
|
+
validator(value: number, props: { max: number }) {
|
|
19
|
+
if (value < 0 || value > props.max) {
|
|
20
|
+
console.error(`Invalid prop: "value" (${value}) must be between 0 and ${props.max}.`);
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
max: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 100,
|
|
29
|
+
validator(value: number) {
|
|
30
|
+
if (value <= 0 || value > 100) {
|
|
31
|
+
console.error('Invalid prop: "max" must be between 1 and 100.');
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type ProgressBarPropTypes = ExtractPropTypes<typeof progressBarPropTypes>;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
export const radioPropTypes = {
|
|
6
|
-
id: {
|
|
7
|
-
type: String,
|
|
8
|
-
required: true,
|
|
9
|
-
},
|
|
10
|
-
modelValue: {
|
|
11
|
-
type: [String, Number, Boolean],
|
|
12
|
-
},
|
|
13
|
-
disabled: {
|
|
14
|
-
type: Boolean,
|
|
15
|
-
default: false,
|
|
16
|
-
},
|
|
17
|
-
name: {
|
|
18
|
-
type: String,
|
|
19
|
-
required: true,
|
|
20
|
-
},
|
|
21
|
-
value: {
|
|
22
|
-
type: [String, Number, Boolean],
|
|
23
|
-
required: true,
|
|
24
|
-
},
|
|
25
|
-
description: {
|
|
26
|
-
type: String,
|
|
27
|
-
},
|
|
28
|
-
bordered: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false,
|
|
31
|
-
},
|
|
32
|
-
fullWidth: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: false,
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const radioEmitTypes = ['update:modelValue'];
|
|
39
|
-
|
|
40
|
-
export type RadioPropTypes = ExtractPropTypes<typeof radioPropTypes>;
|
|
41
|
-
|
|
42
|
-
export type RadioEmitTypes = typeof radioEmitTypes;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
export const radioPropTypes = {
|
|
6
|
+
id: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [String, Number, Boolean],
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: false,
|
|
16
|
+
},
|
|
17
|
+
name: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
value: {
|
|
22
|
+
type: [String, Number, Boolean],
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
description: {
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
bordered: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false,
|
|
31
|
+
},
|
|
32
|
+
fullWidth: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false,
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const radioEmitTypes = ['update:modelValue'];
|
|
39
|
+
|
|
40
|
+
export type RadioPropTypes = ExtractPropTypes<typeof radioPropTypes>;
|
|
41
|
+
|
|
42
|
+
export type RadioEmitTypes = typeof radioEmitTypes;
|
|
@@ -153,7 +153,8 @@ export const selectLadderizedPropTypes = {
|
|
|
153
153
|
export const selectLadderizedEmitTypes = {
|
|
154
154
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
155
155
|
'update:modelValue': (_value: unknown) => true,
|
|
156
|
-
|
|
156
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
157
|
+
'popper-state': (_state: boolean) => true,
|
|
157
158
|
};
|
|
158
159
|
|
|
159
160
|
export type SelectLadderizedEmitFn = (event: string, ...args: unknown[]) => void;
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="!props.isStacking && isOpen && hasBackdrop" :class="sidepanelClasses.backdropBaseClasses"></div>
|
|
3
|
-
|
|
4
|
-
<Transition
|
|
5
|
-
:enter-active-class="sidepanelClasses.sidepanelTransitionActiveClasses"
|
|
6
|
-
:leave-active-class="sidepanelClasses.sidepanelTransitionActiveClasses"
|
|
7
|
-
:enter-from-class="sidepanelClasses.sidepanelTransitionHiddenClasses"
|
|
8
|
-
:enter-to-class="sidepanelClasses.sidepanelTransitionVisibleClasses"
|
|
9
|
-
:leave-from-class="sidepanelClasses.sidepanelTransitionVisibleClasses"
|
|
10
|
-
:leave-to-class="sidepanelClasses.sidepanelTransitionHiddenClasses"
|
|
11
|
-
:appear="!props.isStacking"
|
|
12
|
-
>
|
|
13
|
-
<div
|
|
14
|
-
v-if="props.isOpen || props.isStacking"
|
|
15
|
-
ref="sidepanelRef"
|
|
16
|
-
role="dialog"
|
|
17
|
-
aria-labelledby="sidepanel-title"
|
|
18
|
-
aria-describedby="sidepanel-content"
|
|
19
|
-
:class="sidepanelClasses.sidepanelBaseClasses"
|
|
20
|
-
:style="{ height: typeof height === 'number' ? `${height}px` : height }"
|
|
21
|
-
>
|
|
22
|
-
<template v-if="!props.hideHeader">
|
|
23
|
-
<div v-if="!$slots.header" :class="sidepanelClasses.sidepanelHeaderClasses">
|
|
24
|
-
<div id="sidepanel-title" :class="sidepanelClasses.sidepanelHeaderTitleClasses">
|
|
25
|
-
{{ headerTitle }}
|
|
26
|
-
</div>
|
|
27
|
-
<Icon :class="sidepanelClasses.sidepanelHeaderIconClasses" icon="ph:x" @click="handleClose" />
|
|
28
|
-
</div>
|
|
29
|
-
<div v-else>
|
|
30
|
-
<slot name="header"></slot>
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<div id="sidepanel-content" :class="sidepanelClasses.sidepanelContentClasses">
|
|
35
|
-
<slot />
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<div v-if="$slots.footer" :class="sidepanelClasses.sidepanelFooterClasses">
|
|
39
|
-
<slot name="footer"></slot>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</Transition>
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<script lang="ts" setup>
|
|
46
|
-
import { Icon } from '@iconify/vue';
|
|
47
|
-
|
|
48
|
-
import { useSidepanel } from './use-sidepanel';
|
|
49
|
-
import { sidepanelPropTypes, sidepanelEmitTypes } from './sidepanel';
|
|
50
|
-
|
|
51
|
-
const props = defineProps(sidepanelPropTypes);
|
|
52
|
-
const emit = defineEmits(sidepanelEmitTypes);
|
|
53
|
-
|
|
54
|
-
const { sidepanelClasses, sidepanelRef, handleClose } = useSidepanel(props, emit);
|
|
55
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="!props.isStacking && isOpen && hasBackdrop" :class="sidepanelClasses.backdropBaseClasses"></div>
|
|
3
|
+
|
|
4
|
+
<Transition
|
|
5
|
+
:enter-active-class="sidepanelClasses.sidepanelTransitionActiveClasses"
|
|
6
|
+
:leave-active-class="sidepanelClasses.sidepanelTransitionActiveClasses"
|
|
7
|
+
:enter-from-class="sidepanelClasses.sidepanelTransitionHiddenClasses"
|
|
8
|
+
:enter-to-class="sidepanelClasses.sidepanelTransitionVisibleClasses"
|
|
9
|
+
:leave-from-class="sidepanelClasses.sidepanelTransitionVisibleClasses"
|
|
10
|
+
:leave-to-class="sidepanelClasses.sidepanelTransitionHiddenClasses"
|
|
11
|
+
:appear="!props.isStacking"
|
|
12
|
+
>
|
|
13
|
+
<div
|
|
14
|
+
v-if="props.isOpen || props.isStacking"
|
|
15
|
+
ref="sidepanelRef"
|
|
16
|
+
role="dialog"
|
|
17
|
+
aria-labelledby="sidepanel-title"
|
|
18
|
+
aria-describedby="sidepanel-content"
|
|
19
|
+
:class="sidepanelClasses.sidepanelBaseClasses"
|
|
20
|
+
:style="{ height: typeof height === 'number' ? `${height}px` : height }"
|
|
21
|
+
>
|
|
22
|
+
<template v-if="!props.hideHeader">
|
|
23
|
+
<div v-if="!$slots.header" :class="sidepanelClasses.sidepanelHeaderClasses">
|
|
24
|
+
<div id="sidepanel-title" :class="sidepanelClasses.sidepanelHeaderTitleClasses">
|
|
25
|
+
{{ headerTitle }}
|
|
26
|
+
</div>
|
|
27
|
+
<Icon :class="sidepanelClasses.sidepanelHeaderIconClasses" icon="ph:x" @click="handleClose" />
|
|
28
|
+
</div>
|
|
29
|
+
<div v-else>
|
|
30
|
+
<slot name="header"></slot>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<div id="sidepanel-content" :class="sidepanelClasses.sidepanelContentClasses">
|
|
35
|
+
<slot />
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div v-if="$slots.footer" :class="sidepanelClasses.sidepanelFooterClasses">
|
|
39
|
+
<slot name="footer"></slot>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</Transition>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script lang="ts" setup>
|
|
46
|
+
import { Icon } from '@iconify/vue';
|
|
47
|
+
|
|
48
|
+
import { useSidepanel } from './use-sidepanel';
|
|
49
|
+
import { sidepanelPropTypes, sidepanelEmitTypes } from './sidepanel';
|
|
50
|
+
|
|
51
|
+
const props = defineProps(sidepanelPropTypes);
|
|
52
|
+
const emit = defineEmits(sidepanelEmitTypes);
|
|
53
|
+
|
|
54
|
+
const { sidepanelClasses, sidepanelRef, handleClose } = useSidepanel(props, emit);
|
|
55
|
+
</script>
|