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,34 +1,34 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="stepperClasses.baseClass">
|
|
3
|
-
<div v-for="(step, index) in props.steps" :key="index" :class="stepperClasses.stepClass">
|
|
4
|
-
<!-- STEP NUMBER -->
|
|
5
|
-
<spr-step
|
|
6
|
-
:number="step.number"
|
|
7
|
-
:label="step.label"
|
|
8
|
-
:status="step.status"
|
|
9
|
-
:description="step.description"
|
|
10
|
-
:type="props.type"
|
|
11
|
-
/>
|
|
12
|
-
|
|
13
|
-
<!-- LINES -->
|
|
14
|
-
<!-- Line container -->
|
|
15
|
-
<div
|
|
16
|
-
v-if="props.hasLines && index < props.steps.length - 1"
|
|
17
|
-
:class="stepperClasses.lineContainerClass"
|
|
18
|
-
>
|
|
19
|
-
<!-- Actual line -->
|
|
20
|
-
<div :class="[stepperClasses.linesClass, getLineColorClass(step)]"/>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<script setup lang="ts">
|
|
27
|
-
import SprStep from '@/components/stepper/step/step.vue';
|
|
28
|
-
import { stepperPropTypes } from '@/components/stepper/stepper';
|
|
29
|
-
import { useStepper } from '@/components/stepper/use-stepper';
|
|
30
|
-
|
|
31
|
-
const props = defineProps(stepperPropTypes);
|
|
32
|
-
|
|
33
|
-
const { stepperClasses, getLineColorClass} = useStepper(props);
|
|
34
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="stepperClasses.baseClass">
|
|
3
|
+
<div v-for="(step, index) in props.steps" :key="index" :class="stepperClasses.stepClass">
|
|
4
|
+
<!-- STEP NUMBER -->
|
|
5
|
+
<spr-step
|
|
6
|
+
:number="step.number"
|
|
7
|
+
:label="step.label"
|
|
8
|
+
:status="step.status"
|
|
9
|
+
:description="step.description"
|
|
10
|
+
:type="props.type"
|
|
11
|
+
/>
|
|
12
|
+
|
|
13
|
+
<!-- LINES -->
|
|
14
|
+
<!-- Line container -->
|
|
15
|
+
<div
|
|
16
|
+
v-if="props.hasLines && index < props.steps.length - 1"
|
|
17
|
+
:class="stepperClasses.lineContainerClass"
|
|
18
|
+
>
|
|
19
|
+
<!-- Actual line -->
|
|
20
|
+
<div :class="[stepperClasses.linesClass, getLineColorClass(step)]"/>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup lang="ts">
|
|
27
|
+
import SprStep from '@/components/stepper/step/step.vue';
|
|
28
|
+
import { stepperPropTypes } from '@/components/stepper/stepper';
|
|
29
|
+
import { useStepper } from '@/components/stepper/use-stepper';
|
|
30
|
+
|
|
31
|
+
const props = defineProps(stepperPropTypes);
|
|
32
|
+
|
|
33
|
+
const { stepperClasses, getLineColorClass} = useStepper(props);
|
|
34
|
+
</script>
|
|
@@ -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
|
-
const SWITCH_STATES = ['default', 'hover', 'pressed', 'disabled'] as const;
|
|
5
|
-
|
|
6
|
-
export const switchPropTypes = {
|
|
7
|
-
/**
|
|
8
|
-
* @description Switch UI state when hovered, pressed, disabled
|
|
9
|
-
*/
|
|
10
|
-
state: {
|
|
11
|
-
type: String as PropType<(typeof SWITCH_STATES)[number]>,
|
|
12
|
-
validator: (value: (typeof SWITCH_STATES)[number]) => SWITCH_STATES.includes(value),
|
|
13
|
-
default: 'default',
|
|
14
|
-
},
|
|
15
|
-
/**
|
|
16
|
-
* @description Switch input state when disabled
|
|
17
|
-
*/
|
|
18
|
-
disabled: {
|
|
19
|
-
type: Boolean,
|
|
20
|
-
default: false,
|
|
21
|
-
},
|
|
22
|
-
/**
|
|
23
|
-
* @description Required prop value for v-model
|
|
24
|
-
*/
|
|
25
|
-
modelValue: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
required: true,
|
|
28
|
-
default: false,
|
|
29
|
-
},
|
|
30
|
-
/**
|
|
31
|
-
* @description Switch id
|
|
32
|
-
*/
|
|
33
|
-
id: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: '',
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const switchEmitTypes = ['update:modelValue'];
|
|
40
|
-
|
|
41
|
-
export type SwitchPropTypes = ExtractPropTypes<typeof switchPropTypes>;
|
|
42
|
-
export type SwitchEmitTypes = typeof switchEmitTypes;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
const SWITCH_STATES = ['default', 'hover', 'pressed', 'disabled'] as const;
|
|
5
|
+
|
|
6
|
+
export const switchPropTypes = {
|
|
7
|
+
/**
|
|
8
|
+
* @description Switch UI state when hovered, pressed, disabled
|
|
9
|
+
*/
|
|
10
|
+
state: {
|
|
11
|
+
type: String as PropType<(typeof SWITCH_STATES)[number]>,
|
|
12
|
+
validator: (value: (typeof SWITCH_STATES)[number]) => SWITCH_STATES.includes(value),
|
|
13
|
+
default: 'default',
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* @description Switch input state when disabled
|
|
17
|
+
*/
|
|
18
|
+
disabled: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* @description Required prop value for v-model
|
|
24
|
+
*/
|
|
25
|
+
modelValue: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
required: true,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* @description Switch id
|
|
32
|
+
*/
|
|
33
|
+
id: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: '',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const switchEmitTypes = ['update:modelValue'];
|
|
40
|
+
|
|
41
|
+
export type SwitchPropTypes = ExtractPropTypes<typeof switchPropTypes>;
|
|
42
|
+
export type SwitchEmitTypes = typeof switchEmitTypes;
|
|
@@ -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
|
+
};
|