design-system-next 2.11.22 → 2.12.1
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 +6328 -6212
- 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/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/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/date-picker/date-picker.vue +60 -53
- package/src/components/date-picker/use-date-picker.ts +6 -0
- 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/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/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/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/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/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/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 +6 -0
|
@@ -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
|
-
|
|
6
|
-
export const tableActionPropTypes = {
|
|
7
|
-
/**
|
|
8
|
-
* @description Toggle Search field,
|
|
9
|
-
*/
|
|
10
|
-
toggleSearch: {
|
|
11
|
-
type: Boolean as PropType<boolean>,
|
|
12
|
-
default: false,
|
|
13
|
-
},
|
|
14
|
-
/**
|
|
15
|
-
* @description Toggle Option button
|
|
16
|
-
*/
|
|
17
|
-
toggleOption: {
|
|
18
|
-
type: Boolean as PropType<boolean>,
|
|
19
|
-
default: false,
|
|
20
|
-
},
|
|
21
|
-
/**
|
|
22
|
-
* @description Toggle Filter Button
|
|
23
|
-
*/
|
|
24
|
-
toggleFilter: {
|
|
25
|
-
type: Boolean as PropType<boolean>,
|
|
26
|
-
default: false,
|
|
27
|
-
},
|
|
28
|
-
/**
|
|
29
|
-
* @description Search variable
|
|
30
|
-
*/
|
|
31
|
-
searchModel: {
|
|
32
|
-
type: String as PropType<string>,
|
|
33
|
-
default: '',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const tableActionEmitTypes = {
|
|
38
|
-
'update:searchModel': (value: string): value is string => typeof value === 'string',
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export type TableActionEmitTypes = { 'update:searchModel': typeof tableActionEmitTypes };
|
|
42
|
-
export type TableActionPropTypes = ExtractPropTypes<typeof tableActionPropTypes>;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export const tableActionPropTypes = {
|
|
7
|
+
/**
|
|
8
|
+
* @description Toggle Search field,
|
|
9
|
+
*/
|
|
10
|
+
toggleSearch: {
|
|
11
|
+
type: Boolean as PropType<boolean>,
|
|
12
|
+
default: false,
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* @description Toggle Option button
|
|
16
|
+
*/
|
|
17
|
+
toggleOption: {
|
|
18
|
+
type: Boolean as PropType<boolean>,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* @description Toggle Filter Button
|
|
23
|
+
*/
|
|
24
|
+
toggleFilter: {
|
|
25
|
+
type: Boolean as PropType<boolean>,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* @description Search variable
|
|
30
|
+
*/
|
|
31
|
+
searchModel: {
|
|
32
|
+
type: String as PropType<string>,
|
|
33
|
+
default: '',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const tableActionEmitTypes = {
|
|
38
|
+
'update:searchModel': (value: string): value is string => typeof value === 'string',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type TableActionEmitTypes = { 'update:searchModel': typeof tableActionEmitTypes };
|
|
42
|
+
export type TableActionPropTypes = ExtractPropTypes<typeof tableActionPropTypes>;
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="tableActionsBaseClasses">
|
|
3
|
-
<slot name="tableActionSection">
|
|
4
|
-
<div :class="searchFilterClasses">
|
|
5
|
-
<spr-input-search
|
|
6
|
-
v-if="props.toggleSearch"
|
|
7
|
-
:model-value="props.searchModel"
|
|
8
|
-
:class="inputSearchClasses"
|
|
9
|
-
placeholder="Search"
|
|
10
|
-
@update:model-value="updateSearchField"
|
|
11
|
-
/>
|
|
12
|
-
<spr-button v-if="props.toggleFilter" variant="secondary" has-icon>
|
|
13
|
-
<Icon icon="ph:sliders-horizontal"/>
|
|
14
|
-
</spr-button>
|
|
15
|
-
</div>
|
|
16
|
-
<spr-button v-if="props.toggleOption" >
|
|
17
|
-
<Icon icon="ph:dots-three-vertical"/>
|
|
18
|
-
</spr-button>
|
|
19
|
-
</slot>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script setup lang="ts">
|
|
24
|
-
import { useTableActions } from './use-table-actions';
|
|
25
|
-
import SprInputSearch from '@/components/input/input-search/input-search.vue';
|
|
26
|
-
import SprButton from '@/components/button/button.vue';
|
|
27
|
-
import { Icon } from '@iconify/vue';
|
|
28
|
-
import { tableActionEmitTypes, tableActionPropTypes } from './table-actions';
|
|
29
|
-
|
|
30
|
-
const emit = defineEmits(tableActionEmitTypes);
|
|
31
|
-
|
|
32
|
-
const props = defineProps(tableActionPropTypes);
|
|
33
|
-
|
|
34
|
-
const {
|
|
35
|
-
tableActionsBaseClasses,
|
|
36
|
-
inputSearchClasses,
|
|
37
|
-
searchFilterClasses,
|
|
38
|
-
updateSearchField
|
|
39
|
-
} = useTableActions(emit);
|
|
40
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="tableActionsBaseClasses">
|
|
3
|
+
<slot name="tableActionSection">
|
|
4
|
+
<div :class="searchFilterClasses">
|
|
5
|
+
<spr-input-search
|
|
6
|
+
v-if="props.toggleSearch"
|
|
7
|
+
:model-value="props.searchModel"
|
|
8
|
+
:class="inputSearchClasses"
|
|
9
|
+
placeholder="Search"
|
|
10
|
+
@update:model-value="updateSearchField"
|
|
11
|
+
/>
|
|
12
|
+
<spr-button v-if="props.toggleFilter" variant="secondary" has-icon>
|
|
13
|
+
<Icon icon="ph:sliders-horizontal"/>
|
|
14
|
+
</spr-button>
|
|
15
|
+
</div>
|
|
16
|
+
<spr-button v-if="props.toggleOption" >
|
|
17
|
+
<Icon icon="ph:dots-three-vertical"/>
|
|
18
|
+
</spr-button>
|
|
19
|
+
</slot>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
import { useTableActions } from './use-table-actions';
|
|
25
|
+
import SprInputSearch from '@/components/input/input-search/input-search.vue';
|
|
26
|
+
import SprButton from '@/components/button/button.vue';
|
|
27
|
+
import { Icon } from '@iconify/vue';
|
|
28
|
+
import { tableActionEmitTypes, tableActionPropTypes } from './table-actions';
|
|
29
|
+
|
|
30
|
+
const emit = defineEmits(tableActionEmitTypes);
|
|
31
|
+
|
|
32
|
+
const props = defineProps(tableActionPropTypes);
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
tableActionsBaseClasses,
|
|
36
|
+
inputSearchClasses,
|
|
37
|
+
searchFilterClasses,
|
|
38
|
+
updateSearchField
|
|
39
|
+
} = useTableActions(emit);
|
|
40
|
+
</script>
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import type { AVATAR_VARIANT } from '@/components/avatar/avatar';
|
|
3
|
-
import type { ICON_WEIGHTS } from '@/components/chips/chips';
|
|
4
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
5
|
-
|
|
6
|
-
export interface ChipTitle {
|
|
7
|
-
title: string;
|
|
8
|
-
icon: string;
|
|
9
|
-
iconWeight: (typeof ICON_WEIGHTS)[number];
|
|
10
|
-
badge: boolean;
|
|
11
|
-
badgeText: string;
|
|
12
|
-
badgeVariant: string;
|
|
13
|
-
avatarUrl: string;
|
|
14
|
-
avatarVariant: (typeof AVATAR_VARIANT)[number];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const tableChipsTitlePropTypes = {
|
|
18
|
-
/**
|
|
19
|
-
* @description Cell Content,
|
|
20
|
-
*/
|
|
21
|
-
cell: {
|
|
22
|
-
type: definePropType<ChipTitle>(Object),
|
|
23
|
-
required: true,
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type TableChipsTitlePropTypes = ExtractPropTypes<typeof tableChipsTitlePropTypes>;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
import type { AVATAR_VARIANT } from '@/components/avatar/avatar';
|
|
3
|
+
import type { ICON_WEIGHTS } from '@/components/chips/chips';
|
|
4
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
5
|
+
|
|
6
|
+
export interface ChipTitle {
|
|
7
|
+
title: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
iconWeight: (typeof ICON_WEIGHTS)[number];
|
|
10
|
+
badge: boolean;
|
|
11
|
+
badgeText: string;
|
|
12
|
+
badgeVariant: string;
|
|
13
|
+
avatarUrl: string;
|
|
14
|
+
avatarVariant: (typeof AVATAR_VARIANT)[number];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const tableChipsTitlePropTypes = {
|
|
18
|
+
/**
|
|
19
|
+
* @description Cell Content,
|
|
20
|
+
*/
|
|
21
|
+
cell: {
|
|
22
|
+
type: definePropType<ChipTitle>(Object),
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type TableChipsTitlePropTypes = ExtractPropTypes<typeof tableChipsTitlePropTypes>;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<spr-chips
|
|
3
|
-
:label="props.cell?.title"
|
|
4
|
-
:icon="computeIcon"
|
|
5
|
-
:icon-weight="computeIconWeight"
|
|
6
|
-
:badge="computeBadge"
|
|
7
|
-
:badge-text="computeBadgeText"
|
|
8
|
-
:badge-variant="computeBadgeVariant"
|
|
9
|
-
:avatar-url="computeAvatarUrl"
|
|
10
|
-
:avatar-variant="computeAvatarVariant"
|
|
11
|
-
/>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<script lang="ts" setup>
|
|
16
|
-
import SprChips from '@/components/chips/chips.vue';
|
|
17
|
-
|
|
18
|
-
import { tableChipsTitlePropTypes } from '@/components/table/table-chips-title/table-chips-title';
|
|
19
|
-
import { useTableChipsTitle } from './use-table-chips-title';
|
|
20
|
-
|
|
21
|
-
const props = defineProps(tableChipsTitlePropTypes);
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
computeIcon,
|
|
25
|
-
computeIconWeight,
|
|
26
|
-
computeBadge,
|
|
27
|
-
computeBadgeText,
|
|
28
|
-
computeBadgeVariant,
|
|
29
|
-
computeAvatarUrl,
|
|
30
|
-
computeAvatarVariant
|
|
31
|
-
} = useTableChipsTitle(props);
|
|
32
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<spr-chips
|
|
3
|
+
:label="props.cell?.title"
|
|
4
|
+
:icon="computeIcon"
|
|
5
|
+
:icon-weight="computeIconWeight"
|
|
6
|
+
:badge="computeBadge"
|
|
7
|
+
:badge-text="computeBadgeText"
|
|
8
|
+
:badge-variant="computeBadgeVariant"
|
|
9
|
+
:avatar-url="computeAvatarUrl"
|
|
10
|
+
:avatar-variant="computeAvatarVariant"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
import SprChips from '@/components/chips/chips.vue';
|
|
17
|
+
|
|
18
|
+
import { tableChipsTitlePropTypes } from '@/components/table/table-chips-title/table-chips-title';
|
|
19
|
+
import { useTableChipsTitle } from './use-table-chips-title';
|
|
20
|
+
|
|
21
|
+
const props = defineProps(tableChipsTitlePropTypes);
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
computeIcon,
|
|
25
|
+
computeIconWeight,
|
|
26
|
+
computeBadge,
|
|
27
|
+
computeBadgeText,
|
|
28
|
+
computeBadgeVariant,
|
|
29
|
+
computeAvatarUrl,
|
|
30
|
+
computeAvatarVariant
|
|
31
|
+
} = useTableChipsTitle(props);
|
|
32
|
+
</script>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { computed } from 'vue';
|
|
2
|
-
import type { TableChipsTitlePropTypes } from '@/components/table/table-chips-title/table-chips-title';
|
|
3
|
-
|
|
4
|
-
export const useTableChipsTitle = (props: TableChipsTitlePropTypes) => {
|
|
5
|
-
const computeIcon = computed(() => props.cell?.icon || '');
|
|
6
|
-
const computeIconWeight = computed(() => props.cell?.iconWeight || 'regular');
|
|
7
|
-
const computeBadge = computed(() => props.cell?.badge || false);
|
|
8
|
-
const computeBadgeText = computed(() => props.cell?.badgeText || '');
|
|
9
|
-
const computeBadgeVariant = computed(() => props.cell?.badgeVariant || 'primary');
|
|
10
|
-
const computeAvatarUrl = computed(() => props.cell?.avatarUrl);
|
|
11
|
-
const computeAvatarVariant = computed(() => props.cell?.avatarVariant || 'image');
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
computeIcon,
|
|
15
|
-
computeIconWeight,
|
|
16
|
-
computeBadge,
|
|
17
|
-
computeBadgeText,
|
|
18
|
-
computeBadgeVariant,
|
|
19
|
-
computeAvatarUrl,
|
|
20
|
-
computeAvatarVariant,
|
|
21
|
-
};
|
|
22
|
-
};
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import type { TableChipsTitlePropTypes } from '@/components/table/table-chips-title/table-chips-title';
|
|
3
|
+
|
|
4
|
+
export const useTableChipsTitle = (props: TableChipsTitlePropTypes) => {
|
|
5
|
+
const computeIcon = computed(() => props.cell?.icon || '');
|
|
6
|
+
const computeIconWeight = computed(() => props.cell?.iconWeight || 'regular');
|
|
7
|
+
const computeBadge = computed(() => props.cell?.badge || false);
|
|
8
|
+
const computeBadgeText = computed(() => props.cell?.badgeText || '');
|
|
9
|
+
const computeBadgeVariant = computed(() => props.cell?.badgeVariant || 'primary');
|
|
10
|
+
const computeAvatarUrl = computed(() => props.cell?.avatarUrl);
|
|
11
|
+
const computeAvatarVariant = computed(() => props.cell?.avatarVariant || 'image');
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
computeIcon,
|
|
15
|
+
computeIconWeight,
|
|
16
|
+
computeBadge,
|
|
17
|
+
computeBadgeText,
|
|
18
|
+
computeBadgeVariant,
|
|
19
|
+
computeAvatarUrl,
|
|
20
|
+
computeAvatarVariant,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import type { LOZENGE_TONE } from '@/components/lozenge/lozenge';
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
export interface LozengeTitle {
|
|
6
|
-
title: string;
|
|
7
|
-
fill?: boolean;
|
|
8
|
-
avatarUrl?: string;
|
|
9
|
-
tone?: (typeof LOZENGE_TONE)[number];
|
|
10
|
-
icon?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const tableLozengesTitlePropTypes = {
|
|
14
|
-
/**
|
|
15
|
-
* @description Cell Content,
|
|
16
|
-
*/
|
|
17
|
-
cell: {
|
|
18
|
-
type: definePropType<LozengeTitle>(Object),
|
|
19
|
-
required: true,
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type TableLozengeTitlePropTypes = ExtractPropTypes<typeof tableLozengesTitlePropTypes>;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
import type { LOZENGE_TONE } from '@/components/lozenge/lozenge';
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
export interface LozengeTitle {
|
|
6
|
+
title: string;
|
|
7
|
+
fill?: boolean;
|
|
8
|
+
avatarUrl?: string;
|
|
9
|
+
tone?: (typeof LOZENGE_TONE)[number];
|
|
10
|
+
icon?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const tableLozengesTitlePropTypes = {
|
|
14
|
+
/**
|
|
15
|
+
* @description Cell Content,
|
|
16
|
+
*/
|
|
17
|
+
cell: {
|
|
18
|
+
type: definePropType<LozengeTitle>(Object),
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type TableLozengeTitlePropTypes = ExtractPropTypes<typeof tableLozengesTitlePropTypes>;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<spr-lozenge
|
|
3
|
-
:label="props.cell?.title"
|
|
4
|
-
:tone="computeTone"
|
|
5
|
-
:url="props.cell?.avatarUrl"
|
|
6
|
-
:fill="computeFill"
|
|
7
|
-
>
|
|
8
|
-
<template v-if="props.cell?.icon" #icon>
|
|
9
|
-
<Icon :icon="props.cell?.icon" />
|
|
10
|
-
</template>
|
|
11
|
-
</spr-lozenge>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<script lang="ts" setup>
|
|
16
|
-
import SprLozenge from '@/components/lozenge/lozenge.vue';
|
|
17
|
-
import { Icon } from '@iconify/vue';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import { tableLozengesTitlePropTypes } from '@/components/table/table-lozenge-title/table-lozenge-title';
|
|
21
|
-
import { useTableLozengeTitle } from './use-table-lozenge-title';
|
|
22
|
-
|
|
23
|
-
const props = defineProps(tableLozengesTitlePropTypes);
|
|
24
|
-
|
|
25
|
-
const { computeTone, computeFill} = useTableLozengeTitle(props);
|
|
26
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<spr-lozenge
|
|
3
|
+
:label="props.cell?.title"
|
|
4
|
+
:tone="computeTone"
|
|
5
|
+
:url="props.cell?.avatarUrl"
|
|
6
|
+
:fill="computeFill"
|
|
7
|
+
>
|
|
8
|
+
<template v-if="props.cell?.icon" #icon>
|
|
9
|
+
<Icon :icon="props.cell?.icon" />
|
|
10
|
+
</template>
|
|
11
|
+
</spr-lozenge>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
import SprLozenge from '@/components/lozenge/lozenge.vue';
|
|
17
|
+
import { Icon } from '@iconify/vue';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
import { tableLozengesTitlePropTypes } from '@/components/table/table-lozenge-title/table-lozenge-title';
|
|
21
|
+
import { useTableLozengeTitle } from './use-table-lozenge-title';
|
|
22
|
+
|
|
23
|
+
const props = defineProps(tableLozengesTitlePropTypes);
|
|
24
|
+
|
|
25
|
+
const { computeTone, computeFill} = useTableLozengeTitle(props);
|
|
26
|
+
</script>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { computed } from 'vue';
|
|
2
|
-
import type { TableLozengeTitlePropTypes } from './table-lozenge-title';
|
|
3
|
-
|
|
4
|
-
export const useTableLozengeTitle= (
|
|
5
|
-
props: TableLozengeTitlePropTypes,
|
|
6
|
-
) => {
|
|
7
|
-
|
|
8
|
-
const computeTone = computed(() => {
|
|
9
|
-
return props.cell?.tone || 'plain';
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const computeFill = computed(() => {
|
|
13
|
-
return props.cell?.fill || false;
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
computeTone,
|
|
19
|
-
computeFill,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import type { TableLozengeTitlePropTypes } from './table-lozenge-title';
|
|
3
|
+
|
|
4
|
+
export const useTableLozengeTitle= (
|
|
5
|
+
props: TableLozengeTitlePropTypes,
|
|
6
|
+
) => {
|
|
7
|
+
|
|
8
|
+
const computeTone = computed(() => {
|
|
9
|
+
return props.cell?.tone || 'plain';
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const computeFill = computed(() => {
|
|
13
|
+
return props.cell?.fill || false;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
computeTone,
|
|
19
|
+
computeFill,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
// Current implem is backend, but we can add more types in the future
|
|
6
|
-
// No behavior is implemented for checking this for now
|
|
7
|
-
export const PAGINATION_TYPES = ['backend'] as const;
|
|
8
|
-
|
|
9
|
-
export const tablePaginationPropTypes = {
|
|
10
|
-
/**
|
|
11
|
-
* @description Toggle Search field,
|
|
12
|
-
*/
|
|
13
|
-
selectedRowCount: {
|
|
14
|
-
required: true,
|
|
15
|
-
type: Number as PropType<number>,
|
|
16
|
-
default: 10,
|
|
17
|
-
},
|
|
18
|
-
/**
|
|
19
|
-
* @description Toggle Option button
|
|
20
|
-
*/
|
|
21
|
-
totalItems: {
|
|
22
|
-
required: true,
|
|
23
|
-
type: Number as PropType<number>,
|
|
24
|
-
default: 1,
|
|
25
|
-
},
|
|
26
|
-
/**
|
|
27
|
-
* @description Toggle Option button
|
|
28
|
-
*/
|
|
29
|
-
currentPage: {
|
|
30
|
-
required: true,
|
|
31
|
-
type: Number as PropType<number>,
|
|
32
|
-
default: 1,
|
|
33
|
-
},
|
|
34
|
-
/**
|
|
35
|
-
* @description Menu items
|
|
36
|
-
*/
|
|
37
|
-
dropdownSelection: {
|
|
38
|
-
type: Array as PropType<{ text: string; value: string }[]>,
|
|
39
|
-
required: true,
|
|
40
|
-
default: [
|
|
41
|
-
{ text: 10, value: 10 },
|
|
42
|
-
{ text: 20, value: 20 },
|
|
43
|
-
{ text: 50, value: 50 },
|
|
44
|
-
{ text: 100, value: 100 },
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* @description Toggle Search field,
|
|
49
|
-
*/
|
|
50
|
-
bordered: {
|
|
51
|
-
type: Boolean as PropType<boolean>,
|
|
52
|
-
default: true,
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const tablePaginationEmitTypes = {
|
|
57
|
-
'update:selectedRowCount': (value: number): value is number => typeof value === 'number',
|
|
58
|
-
previous: () => true,
|
|
59
|
-
next: () => true,
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export type TablePaginationEmitTypes = typeof tablePaginationEmitTypes;
|
|
63
|
-
export type TablePaginationPropTypes = ExtractPropTypes<typeof tablePaginationPropTypes>;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
// Current implem is backend, but we can add more types in the future
|
|
6
|
+
// No behavior is implemented for checking this for now
|
|
7
|
+
export const PAGINATION_TYPES = ['backend'] as const;
|
|
8
|
+
|
|
9
|
+
export const tablePaginationPropTypes = {
|
|
10
|
+
/**
|
|
11
|
+
* @description Toggle Search field,
|
|
12
|
+
*/
|
|
13
|
+
selectedRowCount: {
|
|
14
|
+
required: true,
|
|
15
|
+
type: Number as PropType<number>,
|
|
16
|
+
default: 10,
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* @description Toggle Option button
|
|
20
|
+
*/
|
|
21
|
+
totalItems: {
|
|
22
|
+
required: true,
|
|
23
|
+
type: Number as PropType<number>,
|
|
24
|
+
default: 1,
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* @description Toggle Option button
|
|
28
|
+
*/
|
|
29
|
+
currentPage: {
|
|
30
|
+
required: true,
|
|
31
|
+
type: Number as PropType<number>,
|
|
32
|
+
default: 1,
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* @description Menu items
|
|
36
|
+
*/
|
|
37
|
+
dropdownSelection: {
|
|
38
|
+
type: Array as PropType<{ text: string; value: string }[]>,
|
|
39
|
+
required: true,
|
|
40
|
+
default: [
|
|
41
|
+
{ text: 10, value: 10 },
|
|
42
|
+
{ text: 20, value: 20 },
|
|
43
|
+
{ text: 50, value: 50 },
|
|
44
|
+
{ text: 100, value: 100 },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* @description Toggle Search field,
|
|
49
|
+
*/
|
|
50
|
+
bordered: {
|
|
51
|
+
type: Boolean as PropType<boolean>,
|
|
52
|
+
default: true,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const tablePaginationEmitTypes = {
|
|
57
|
+
'update:selectedRowCount': (value: number): value is number => typeof value === 'number',
|
|
58
|
+
previous: () => true,
|
|
59
|
+
next: () => true,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type TablePaginationEmitTypes = typeof tablePaginationEmitTypes;
|
|
63
|
+
export type TablePaginationPropTypes = ExtractPropTypes<typeof tablePaginationPropTypes>;
|