design-system-next 2.17.6 → 2.17.7
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 +2221 -2212
- package/dist/design-system-next.es.js.gz +0 -0
- package/dist/design-system-next.umd.js +13 -13
- 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/components/banner/banner.vue +39 -15
- package/src/components/banner/use-banner.ts +28 -39
- package/src/components/select/select-multiple/select-multiple.ts +4 -0
- package/src/components/select/select-multiple/select-multiple.vue +21 -8
- package/src/components/select/select-multiple/use-select-multiple.ts +7 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { computed, type Ref } from
|
|
2
|
-
import type { BannerPropTypes } from
|
|
3
|
-
import classNames from
|
|
1
|
+
import { computed, type Ref } from 'vue';
|
|
2
|
+
import type { BannerPropTypes } from './banner';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
4
|
|
|
5
5
|
interface BannerClasses {
|
|
6
6
|
base: string;
|
|
@@ -11,7 +11,7 @@ interface BannerClasses {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const useBanner = (props: BannerPropTypes, showModel: Ref<boolean>) => {
|
|
14
|
-
const closeBanner = () => showModel.value = false;
|
|
14
|
+
const closeBanner = () => (showModel.value = false);
|
|
15
15
|
|
|
16
16
|
const bannerClasses = computed<BannerClasses>(() => {
|
|
17
17
|
const base = classNames(
|
|
@@ -22,45 +22,34 @@ export const useBanner = (props: BannerPropTypes, showModel: Ref<boolean>) => {
|
|
|
22
22
|
'spr-background-color-information-weak': props.type === 'info',
|
|
23
23
|
'spr-background-color-pending-weak': props.type === 'pending',
|
|
24
24
|
'spr-background-color-caution-weak': props.type === 'caution',
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
const content = classNames(
|
|
29
|
-
'spr-flex-auto'
|
|
30
|
-
);
|
|
28
|
+
const content = classNames('spr-flex-auto');
|
|
31
29
|
|
|
32
|
-
const icon = classNames(
|
|
33
|
-
'spr-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
'spr-text-color-caution-base': props.type === 'caution',
|
|
40
|
-
}
|
|
41
|
-
);
|
|
30
|
+
const icon = classNames({
|
|
31
|
+
'spr-text-color-brand-base': props.type === 'success',
|
|
32
|
+
'spr-text-color-danger-base': props.type === 'error',
|
|
33
|
+
'spr-text-color-information-base': props.type === 'info',
|
|
34
|
+
'spr-text-color-pending-base': props.type === 'pending',
|
|
35
|
+
'spr-text-color-caution-base': props.type === 'caution',
|
|
36
|
+
});
|
|
42
37
|
|
|
43
|
-
const message = classNames(
|
|
44
|
-
'spr-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
'spr-text-color-caution-pressed': props.type === 'caution',
|
|
51
|
-
}
|
|
52
|
-
);
|
|
38
|
+
const message = classNames('spr-block spr-m-0 spr-body-sm-regular', {
|
|
39
|
+
'spr-text-color-brand-base': props.type === 'success',
|
|
40
|
+
'spr-text-color-danger-pressed': props.type === 'error',
|
|
41
|
+
'spr-text-color-information-pressed': props.type === 'info',
|
|
42
|
+
'spr-text-color-pending-pressed': props.type === 'pending',
|
|
43
|
+
'spr-text-color-caution-pressed': props.type === 'caution',
|
|
44
|
+
});
|
|
53
45
|
|
|
54
|
-
const close = classNames(
|
|
55
|
-
'spr-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
'spr-text-color-caution-base': props.type === 'caution',
|
|
62
|
-
}
|
|
63
|
-
);
|
|
46
|
+
const close = classNames('spr-flex-none spr-cursor-pointer spr-mt-[2px]', {
|
|
47
|
+
'spr-text-color-brand-base': props.type === 'success',
|
|
48
|
+
'spr-text-color-danger-base': props.type === 'error',
|
|
49
|
+
'spr-text-color-information-base': props.type === 'info',
|
|
50
|
+
'spr-text-color-pending-base': props.type === 'pending',
|
|
51
|
+
'spr-text-color-caution-base': props.type === 'caution',
|
|
52
|
+
});
|
|
64
53
|
|
|
65
54
|
return {
|
|
66
55
|
base,
|
|
@@ -68,7 +57,7 @@ export const useBanner = (props: BannerPropTypes, showModel: Ref<boolean>) => {
|
|
|
68
57
|
icon,
|
|
69
58
|
message,
|
|
70
59
|
close,
|
|
71
|
-
}
|
|
60
|
+
};
|
|
72
61
|
});
|
|
73
62
|
|
|
74
63
|
const bannerIcon = computed(() => {
|
|
@@ -33,14 +33,27 @@
|
|
|
33
33
|
<div ref="chippedInputTextRef" :class="multiSelectClasses.chippedInputTextClasses">
|
|
34
34
|
<div class="spr-h-auto spr-w-full">
|
|
35
35
|
<template v-if="multiSelectedListItems.length > 0">
|
|
36
|
-
<template v-
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
<template v-if="!props.displaySelectedCountOnly">
|
|
37
|
+
<template v-for="item in multiSelectedListItems" :key="item.value">
|
|
38
|
+
<spr-chips
|
|
39
|
+
class="spr-m-1 spr-inline-block"
|
|
40
|
+
:label="String(item.text)"
|
|
41
|
+
closable
|
|
42
|
+
visible
|
|
43
|
+
@close="handleChippedRemoveItem(String(item.value))"
|
|
44
|
+
/>
|
|
45
|
+
</template>
|
|
46
|
+
</template>
|
|
47
|
+
<template v-else>
|
|
48
|
+
<span
|
|
49
|
+
class="spr-text-color-supporting spr-px-3"
|
|
50
|
+
:aria-label="`${multiSelectedListItems.length} selected options`"
|
|
51
|
+
>
|
|
52
|
+
{{ multiSelectedListItems.length }} item{{
|
|
53
|
+
multiSelectedListItems.length === 1 ? '' : 's'
|
|
54
|
+
}}
|
|
55
|
+
selected
|
|
56
|
+
</span>
|
|
44
57
|
</template>
|
|
45
58
|
</template>
|
|
46
59
|
<template v-else>
|
|
@@ -297,7 +297,12 @@ export const useMultiSelect = (props: MultiSelectPropTypes, emit: SetupContext<M
|
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
|
|
300
|
+
// Determine input text based on whether count-only mode is enabled
|
|
301
|
+
if (props.displaySelectedCountOnly && multiSelectedListItems.value.length) {
|
|
302
|
+
inputText.value = `${multiSelectedListItems.value.length} item${
|
|
303
|
+
multiSelectedListItems.value.length === 1 ? '' : 's'
|
|
304
|
+
} selected`;
|
|
305
|
+
} else if (multiSelectedListItems.value.length > 3) {
|
|
301
306
|
inputText.value = `${multiSelectedListItems.value.length} items selected`;
|
|
302
307
|
} else {
|
|
303
308
|
inputText.value = multiSelectedListItems.value.map((item) => item.text).join(', ');
|
|
@@ -408,5 +413,6 @@ export const useMultiSelect = (props: MultiSelectPropTypes, emit: SetupContext<M
|
|
|
408
413
|
handleMultiSelectedItem,
|
|
409
414
|
handleChippedRemoveItem,
|
|
410
415
|
handleClear,
|
|
416
|
+
normalizedValue,
|
|
411
417
|
};
|
|
412
418
|
};
|