@v1nt1248/3nclient-lib 0.1.26 → 0.1.28
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/components/ui3n-radio-group/types.d.ts +1 -1
- package/dist/components/ui3n-radio-group/ui3n-radio-group.vue.d.ts +0 -1
- package/dist/style.css +1 -1
- package/dist/ui3n-components.js +5457 -5447
- package/dist/ui3n-plugins.js +2057 -2049
- package/dist/variables.css +40 -0
- package/package.json +1 -1
- package/src/components/ui3n-badge/ui3n-badge-simple.vue +6 -6
- package/src/components/ui3n-badge/ui3n-badge.vue +6 -6
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumb.vue +17 -7
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +2 -2
- package/src/components/ui3n-button/ui3n-button.vue +30 -15
- package/src/components/ui3n-checkbox/ui3n-checkbox.vue +29 -10
- package/src/components/ui3n-chip/ui3n-chip.vue +19 -15
- package/src/components/ui3n-dialog/ui3n-dialog.vue +10 -10
- package/src/components/ui3n-drop-files/ui3n-drop-files.vue +17 -17
- package/src/components/ui3n-emoji/ui3n-emoji.vue +2 -2
- package/src/components/ui3n-input/ui3n-input.vue +73 -54
- package/src/components/ui3n-list/ui3n-list.vue +15 -15
- package/src/components/ui3n-menu/ui3n-menu.vue +7 -7
- package/src/components/ui3n-notification/ui3n-notification.vue +32 -23
- package/src/components/ui3n-progress/ui3n-progress-circular.vue +2 -2
- package/src/components/ui3n-progress/ui3n-progress-linear.vue +2 -2
- package/src/components/ui3n-radio-group/types.ts +1 -1
- package/src/components/ui3n-radio-group/ui3n-radio-group.vue +4 -5
- package/src/components/ui3n-radio-group/ui3n-radio.vue +3 -3
- package/src/components/ui3n-step-line-bar/ui3n-step-line-bar.vue +2 -2
- package/src/components/ui3n-switch/ui3n-switch.vue +2 -2
- package/src/components/ui3n-table/ui3n-table.vue +2 -2
- package/src/components/ui3n-tabs/ui3n-tabs.vue +2 -2
- package/src/components/ui3n-text/ui3n-text.vue +2 -2
- package/src/components/ui3n-tooltip/ui3n-tooltip.vue +2 -2
- package/src/components/ui3n-virtual-scroll/ui3n-virtual-scroll.vue +2 -2
package/dist/variables.css
CHANGED
|
@@ -148,6 +148,21 @@
|
|
|
148
148
|
--s-default-outline-focused: var(--grey-50);
|
|
149
149
|
--s-default-outline-pressed: var(--grey-15);
|
|
150
150
|
--s-default-outline-disabled: var(--grey-10);
|
|
151
|
+
--t-default-fill-default: var(--grey-90);
|
|
152
|
+
--t-default-fill-hover: var(--grey-80);
|
|
153
|
+
--t-default-fill-focused: var(--grey-100);
|
|
154
|
+
--t-default-fill-pressed: var(--grey-100);
|
|
155
|
+
--t-default-fill-disabled: var(--grey-60);
|
|
156
|
+
--t-default-content-default: var(--grey-0);
|
|
157
|
+
--t-default-content-hover: var(--grey-5);
|
|
158
|
+
--t-default-content-focused: var(--grey-0);
|
|
159
|
+
--t-default-content-pressed: var(--grey-30);
|
|
160
|
+
--t-default-content-disabled: var(--grey-20);
|
|
161
|
+
--t-default-outline-default: var(--grey-0);
|
|
162
|
+
--t-default-outline-hover: var(--grey-5);
|
|
163
|
+
--t-default-outline-focused: var(--grey-0);
|
|
164
|
+
--t-default-outline-pressed: var(--grey-30);
|
|
165
|
+
--t-default-outline-disabled: var(--grey-20);
|
|
151
166
|
--accent-fill-default: var(--blue-50);
|
|
152
167
|
--accent-fill-hover: var(--blue-60);
|
|
153
168
|
--accent-fill-focused: var(--blue-50);
|
|
@@ -292,6 +307,21 @@
|
|
|
292
307
|
--s-default-outline-focused: var(--blue-50);
|
|
293
308
|
--s-default-outline-pressed: var(--blue-80);
|
|
294
309
|
--s-default-outline-disabled: var(--blue-85);
|
|
310
|
+
--t-default-fill-default: var(--grey-0);
|
|
311
|
+
--t-default-fill-hover: var(--grey-5);
|
|
312
|
+
--t-default-fill-focused: var(--grey-0);
|
|
313
|
+
--t-default-fill-pressed: var(--grey-30);
|
|
314
|
+
--t-default-fill-disabled: var(--grey-0);
|
|
315
|
+
--t-default-content-default: var(--grey-90);
|
|
316
|
+
--t-default-content-hover: var(--grey-80);
|
|
317
|
+
--t-default-content-focused: var(--grey-90);
|
|
318
|
+
--t-default-content-pressed: var(--grey-60);
|
|
319
|
+
--t-default-content-disabled: var(--grey-30);
|
|
320
|
+
--t-default-outline-default: var(--grey-90);
|
|
321
|
+
--t-default-outline-hover: var(--grey-80);
|
|
322
|
+
--t-default-outline-focused: var(--grey-90);
|
|
323
|
+
--t-default-outline-pressed: var(--grey-60);
|
|
324
|
+
--t-default-outline-disabled: var(--grey-30);
|
|
295
325
|
--accent-fill-default: var(--blue-50);
|
|
296
326
|
--accent-fill-hover: var(--blue-60);
|
|
297
327
|
--accent-fill-focused: var(--blue-50);
|
|
@@ -424,6 +454,11 @@
|
|
|
424
454
|
--color-bg-block-tritery-focused: var(--default-content-focused);
|
|
425
455
|
--color-bg-block-tritery-pressed: var(--default-content-pressed);
|
|
426
456
|
--color-bg-block-tritery-disabled: var(--default-content-disabled);
|
|
457
|
+
--color-bg-block-darkery-default: var(--t-default-fill-default);
|
|
458
|
+
--color-bg-block-darkery-hover: var(--t-default-fill-hover);
|
|
459
|
+
--color-bg-block-darkery-focused: var(--t-default-fill-focused);
|
|
460
|
+
--color-bg-block-darkery-pressed: var(--t-default-fill-pressed);
|
|
461
|
+
--color-bg-block-darkery-disabled: var(--t-default-fill-disabled);
|
|
427
462
|
--color-bg-control-accent-default: var(--accent-fill-default);
|
|
428
463
|
--color-bg-control-accent-hover: var(--accent-fill-hover);
|
|
429
464
|
--color-bg-control-accent-focused: var(--accent-fill-focused);
|
|
@@ -549,6 +584,11 @@
|
|
|
549
584
|
--color-text-block-secondary-focused: var(--default-hint-focused);
|
|
550
585
|
--color-text-block-secondary-pressed: var(--default-hint-pressed);
|
|
551
586
|
--color-text-block-secondary-disabled: var(--default-hint-disabled);
|
|
587
|
+
--color-text-block-darkery-default: var(--t-default-content-default);
|
|
588
|
+
--color-text-block-darkery-hover: var(--t-default-content-hover);
|
|
589
|
+
--color-text-block-darkery-focused: var(--t-default-content-focused);
|
|
590
|
+
--color-text-block-darkery-pressed: var(--t-default-content-pressed);
|
|
591
|
+
--color-text-block-darkery-disabled: var(--t-default-content-disabled);
|
|
552
592
|
--color-text-block-warning-default: var(--warning-content-default);
|
|
553
593
|
--color-text-block-warning-hover: var(--warning-content-hover);
|
|
554
594
|
--color-text-block-warning-focused: var(--warning-content-focused);
|
package/package.json
CHANGED
|
@@ -39,11 +39,11 @@ function getElementSize() {
|
|
|
39
39
|
<template>
|
|
40
40
|
<div
|
|
41
41
|
ref="element"
|
|
42
|
-
:class="[$style.
|
|
42
|
+
:class="[$style.ui3nBadgeSimple, dot && $style.ui3nBadgeDot]"
|
|
43
43
|
>
|
|
44
44
|
<span
|
|
45
45
|
v-if="!dot"
|
|
46
|
-
:class="$style.
|
|
46
|
+
:class="$style.ui3nBadgeText"
|
|
47
47
|
>
|
|
48
48
|
{{ value }}
|
|
49
49
|
</span>
|
|
@@ -51,7 +51,7 @@ function getElementSize() {
|
|
|
51
51
|
</template>
|
|
52
52
|
|
|
53
53
|
<style lang="scss" module>
|
|
54
|
-
.
|
|
54
|
+
.ui3nBadgeSimple {
|
|
55
55
|
--ui3n-badge-size: 20px;
|
|
56
56
|
|
|
57
57
|
position: relative;
|
|
@@ -59,7 +59,7 @@ function getElementSize() {
|
|
|
59
59
|
background-color: v-bind(color);
|
|
60
60
|
outline: 1px var(--white-0) solid;
|
|
61
61
|
|
|
62
|
-
&:not(.
|
|
62
|
+
&:not(.ui3nBadgeDot) {
|
|
63
63
|
min-height: var(--ui3n-badge-size);
|
|
64
64
|
height: var(--ui3n-badge-size);
|
|
65
65
|
width: max-content;
|
|
@@ -68,7 +68,7 @@ function getElementSize() {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.
|
|
71
|
+
.ui3nBadgeDot {
|
|
72
72
|
min-width: var(--spacing-s);
|
|
73
73
|
width: var(--spacing-s);
|
|
74
74
|
max-width: var(--spacing-s);
|
|
@@ -78,7 +78,7 @@ function getElementSize() {
|
|
|
78
78
|
border-radius: 50%;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
.
|
|
81
|
+
.ui3nBadgeText {
|
|
82
82
|
display: block;
|
|
83
83
|
color: v-bind(textColor);
|
|
84
84
|
font-size: var(--font-12);
|
|
@@ -37,9 +37,9 @@ const style = computed(() => {
|
|
|
37
37
|
<!-- eslint-disable vue/no-multiple-template-root -->
|
|
38
38
|
<div
|
|
39
39
|
v-if="hasDefaultSlot"
|
|
40
|
-
:class="$style.
|
|
40
|
+
:class="$style.ui3nBadge"
|
|
41
41
|
>
|
|
42
|
-
<div :class="$style.
|
|
42
|
+
<div :class="$style.ui3nBadgeWrapper">
|
|
43
43
|
<slot />
|
|
44
44
|
|
|
45
45
|
<ui3n-badge-simple
|
|
@@ -48,7 +48,7 @@ const style = computed(() => {
|
|
|
48
48
|
:color="color"
|
|
49
49
|
:text-color="textColor"
|
|
50
50
|
:style="style"
|
|
51
|
-
:class="$style.
|
|
51
|
+
:class="$style.ui3nBadgeContent"
|
|
52
52
|
@change:size="badgeElementSize = $event"
|
|
53
53
|
/>
|
|
54
54
|
</div>
|
|
@@ -64,18 +64,18 @@ const style = computed(() => {
|
|
|
64
64
|
</template>
|
|
65
65
|
|
|
66
66
|
<style lang="scss" module>
|
|
67
|
-
.
|
|
67
|
+
.ui3nBadge {
|
|
68
68
|
--ui3n-badge-size: 20px;
|
|
69
69
|
|
|
70
70
|
position: relative;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
.
|
|
73
|
+
.ui3nBadgeWrapper {
|
|
74
74
|
position: relative;
|
|
75
75
|
width: max-content;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
.
|
|
78
|
+
.ui3nBadgeContent {
|
|
79
79
|
position: absolute;
|
|
80
80
|
z-index: 5;
|
|
81
81
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, getCurrentInstance } from 'vue';
|
|
2
|
+
import { computed, getCurrentInstance, useCssModule } from 'vue';
|
|
3
3
|
import type { Ui3nBreadcrumbEmits, Ui3nBreadcrumbProps, Ui3nBreadcrumbSlots } from './types';
|
|
4
4
|
|
|
5
5
|
const props = withDefaults(defineProps<Ui3nBreadcrumbProps>(), {
|
|
@@ -10,6 +10,8 @@ const props = withDefaults(defineProps<Ui3nBreadcrumbProps>(), {
|
|
|
10
10
|
const emits = defineEmits<Ui3nBreadcrumbEmits>();
|
|
11
11
|
defineSlots<Ui3nBreadcrumbSlots>();
|
|
12
12
|
|
|
13
|
+
const $css = useCssModule();
|
|
14
|
+
|
|
13
15
|
const separatorValue = computed(() => {
|
|
14
16
|
if (props.separator) {
|
|
15
17
|
return props.separator;
|
|
@@ -24,6 +26,14 @@ const parentDisabled = computed(() => {
|
|
|
24
26
|
return instance?.parent?.props.disabled || false;
|
|
25
27
|
});
|
|
26
28
|
|
|
29
|
+
const cssClasses = computed(() => {
|
|
30
|
+
const val = [$css.ui3nBreadcrumb];
|
|
31
|
+
props.isActive && val.push($css.ui3nBreadcrumbActive);
|
|
32
|
+
(props.disabled || parentDisabled.value) && val.push($css.ui3nBreadcrumbDisabled);
|
|
33
|
+
|
|
34
|
+
return val;
|
|
35
|
+
});
|
|
36
|
+
|
|
27
37
|
const onClick = (ev: Event) => {
|
|
28
38
|
emits('click', ev);
|
|
29
39
|
};
|
|
@@ -31,13 +41,13 @@ const onClick = (ev: Event) => {
|
|
|
31
41
|
|
|
32
42
|
<template>
|
|
33
43
|
<div
|
|
34
|
-
:class="
|
|
44
|
+
:class="cssClasses"
|
|
35
45
|
v-on="isActive && !(disabled || parentDisabled) ? { click: onClick } : {}"
|
|
36
46
|
>
|
|
37
47
|
<slot />
|
|
38
48
|
<div
|
|
39
49
|
v-if="isActive"
|
|
40
|
-
:class="$style.
|
|
50
|
+
:class="$style.ui3nBreadcrumbSeparator"
|
|
41
51
|
>
|
|
42
52
|
<slot name="separator">
|
|
43
53
|
<span>{{ separatorValue }}</span>
|
|
@@ -47,7 +57,7 @@ const onClick = (ev: Event) => {
|
|
|
47
57
|
</template>
|
|
48
58
|
|
|
49
59
|
<style lang="scss" module>
|
|
50
|
-
.
|
|
60
|
+
.ui3nBreadcrumb {
|
|
51
61
|
--ui3n-breadcrumb-font-size: var(--spacing-m);
|
|
52
62
|
--ui3n-breadcrumb-color-default: var(--color-text-block-primary-default);
|
|
53
63
|
--ui3n-breadcrumb-color-selected: var(--color-text-block-accent-default);
|
|
@@ -63,7 +73,7 @@ const onClick = (ev: Event) => {
|
|
|
63
73
|
margin: 0 var(--spacing-s);
|
|
64
74
|
}
|
|
65
75
|
|
|
66
|
-
.
|
|
76
|
+
.ui3nBreadcrumbActive {
|
|
67
77
|
font-size: var(--ui3n-breadcrumb-font-size);
|
|
68
78
|
line-height: 1.25;
|
|
69
79
|
color: var(--ui3n-breadcrumb-color-default);
|
|
@@ -72,13 +82,13 @@ const onClick = (ev: Event) => {
|
|
|
72
82
|
cursor: pointer;
|
|
73
83
|
color: var(--ui3n-breadcrumb-color-selected);
|
|
74
84
|
|
|
75
|
-
.
|
|
85
|
+
.ui3nBreadcrumbSeparator {
|
|
76
86
|
color: var(--ui3n-breadcrumb-color-default);
|
|
77
87
|
}
|
|
78
88
|
}
|
|
79
89
|
}
|
|
80
90
|
|
|
81
|
-
.
|
|
91
|
+
.ui3nBreadcrumbDisabled {
|
|
82
92
|
cursor: default;
|
|
83
93
|
pointer-events: none;
|
|
84
94
|
}
|
|
@@ -11,13 +11,13 @@ withDefaults(
|
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<template>
|
|
14
|
-
<div :class="$style.
|
|
14
|
+
<div :class="$style.ui3nBreadcrumbs">
|
|
15
15
|
<slot/>
|
|
16
16
|
</div>
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<style lang="scss" module>
|
|
20
|
-
.
|
|
20
|
+
.ui3nBreadcrumbs {
|
|
21
21
|
position: relative;
|
|
22
22
|
display: flex;
|
|
23
23
|
flex-wrap: wrap;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { onMounted, ref, watch } from 'vue';
|
|
2
|
+
import { computed, onMounted, ref, watch, useCssModule } from 'vue';
|
|
3
3
|
import Ui3nIcon from '../ui3n-icon/ui3n-icon.vue';
|
|
4
4
|
import Ui3nRipple from '../..//directives/ui3n-ripple';
|
|
5
5
|
import type { Ui3nButtonEmits, Ui3nButtonProps, Ui3nButtonEventName } from './types';
|
|
@@ -17,9 +17,21 @@ const props = withDefaults(
|
|
|
17
17
|
);
|
|
18
18
|
const emits = defineEmits<Ui3nButtonEmits>();
|
|
19
19
|
|
|
20
|
+
const $css = useCssModule();
|
|
21
|
+
|
|
20
22
|
const buttonEl = ref<HTMLButtonElement | null>(null);
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
const mainCssClasses = computed(() => {
|
|
25
|
+
const val = [$css.ui3nButton, $css[props.size], $css[props.type]];
|
|
26
|
+
|
|
27
|
+
props.block && props.type !== 'icon' && val.push($css.block);
|
|
28
|
+
props.icon && val.push($css[`withIcon-${props.iconPosition}`]);
|
|
29
|
+
props.elevation && val.push($css.elevation);
|
|
30
|
+
|
|
31
|
+
return val;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
async function handleButtonEvent(eventName: Ui3nButtonEventName, value?: Event) {
|
|
23
35
|
if (['init', 'enter'].includes(eventName)) {
|
|
24
36
|
// @ts-ignore
|
|
25
37
|
emits(eventName, buttonEl.value);
|
|
@@ -39,20 +51,30 @@ watch(
|
|
|
39
51
|
|
|
40
52
|
(props.type === 'custom' || props.type === 'icon')
|
|
41
53
|
&& color !== prevColor
|
|
42
|
-
&& buttonEl.value.style.setProperty(
|
|
54
|
+
&& buttonEl.value.style.setProperty(
|
|
55
|
+
'--ui3n-button-bg-color-custom',
|
|
56
|
+
color ?? 'var(--color-bg-button-primary-default)',
|
|
57
|
+
);
|
|
43
58
|
|
|
44
59
|
props.type === 'custom'
|
|
45
60
|
&& textColor !== prevTextColor
|
|
46
|
-
&& buttonEl.value.style.setProperty(
|
|
61
|
+
&& buttonEl.value.style.setProperty(
|
|
62
|
+
'--ui3n-button-text-color-custom',
|
|
63
|
+
textColor ?? 'var(--color-text-button-primary-default',
|
|
64
|
+
);
|
|
47
65
|
},
|
|
48
66
|
);
|
|
49
67
|
|
|
50
68
|
onMounted(() => {
|
|
51
69
|
if (!buttonEl.value) return;
|
|
52
70
|
|
|
53
|
-
(props.type === 'custom' || props.type === 'icon')
|
|
71
|
+
(props.type === 'custom' || props.type === 'icon')
|
|
72
|
+
&& props.color
|
|
73
|
+
&& buttonEl.value.style.setProperty('--ui3n-button-bg-color-custom', props.color);
|
|
54
74
|
|
|
55
|
-
props.type === 'custom'
|
|
75
|
+
props.type === 'custom'
|
|
76
|
+
&& props.textColor
|
|
77
|
+
&& buttonEl.value.style.setProperty('--ui3n-button-text-color-custom', props.textColor);
|
|
56
78
|
|
|
57
79
|
handleButtonEvent('init');
|
|
58
80
|
});
|
|
@@ -62,14 +84,7 @@ onMounted(() => {
|
|
|
62
84
|
<button
|
|
63
85
|
ref="buttonEl"
|
|
64
86
|
v-ui3n-ripple
|
|
65
|
-
:class="
|
|
66
|
-
$style.button,
|
|
67
|
-
$style[size!],
|
|
68
|
-
$style[type!],
|
|
69
|
-
block && type !== 'icon' && $style.block,
|
|
70
|
-
icon && $style[`withIcon-${iconPosition}`],
|
|
71
|
-
elevation && $style.elevation,
|
|
72
|
-
]"
|
|
87
|
+
:class="mainCssClasses"
|
|
73
88
|
type="button"
|
|
74
89
|
:disabled="disabled"
|
|
75
90
|
@click="handleButtonEvent('click', $event)"
|
|
@@ -95,7 +110,7 @@ onMounted(() => {
|
|
|
95
110
|
<style lang="scss" module>
|
|
96
111
|
@import "../../assets/styles/mixins";
|
|
97
112
|
|
|
98
|
-
.
|
|
113
|
+
.ui3nButton {
|
|
99
114
|
--ui3n-button-padding: var(--spacing-m);
|
|
100
115
|
--ui3n-button-text-size: var(--font-12);
|
|
101
116
|
--ui3n-button-text-color-custom: var(--color-text-button-primary-default);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, onMounted, watch, onBeforeMount, ref, useSlots } from 'vue';
|
|
2
|
+
import { computed, onMounted, watch, onBeforeMount, ref, useCssModule, useSlots } from 'vue';
|
|
3
3
|
import type { Ui3nCheckboxEmits, Ui3nCheckboxProps, Ui3nCheckboxSlots, Ui3nCheckboxValue } from './types';
|
|
4
4
|
|
|
5
5
|
const props = withDefaults(
|
|
@@ -18,6 +18,8 @@ const emits = defineEmits<Ui3nCheckboxEmits>();
|
|
|
18
18
|
defineSlots<Ui3nCheckboxSlots>();
|
|
19
19
|
|
|
20
20
|
const slots = useSlots();
|
|
21
|
+
const $css = useCssModule();
|
|
22
|
+
|
|
21
23
|
const checkboxEl = ref<HTMLDivElement | null>(null);
|
|
22
24
|
const val = ref<Ui3nCheckboxValue>(props.uncheckedValue || false);
|
|
23
25
|
const uncertain = ref(false);
|
|
@@ -32,6 +34,23 @@ const checkBoxValue = computed(() => {
|
|
|
32
34
|
: 'unchecked';
|
|
33
35
|
});
|
|
34
36
|
|
|
37
|
+
const mainCssClasses = computed(() => {
|
|
38
|
+
const val = [$css.ui3nCheckbox];
|
|
39
|
+
|
|
40
|
+
props.disabled && val.push($css.disabled);
|
|
41
|
+
!slots.default && val.push($css.noLabel);
|
|
42
|
+
|
|
43
|
+
return val;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const bodyCssClasses = computed(() => {
|
|
47
|
+
const val = [$css.ui3nCheckboxBody];
|
|
48
|
+
|
|
49
|
+
checkBoxValue.value === 'unchecked' ? val.push($css.unfilled) : val.push($css.filled);
|
|
50
|
+
|
|
51
|
+
return val;
|
|
52
|
+
});
|
|
53
|
+
|
|
35
54
|
onBeforeMount(() => {
|
|
36
55
|
const checkedValueType = typeof props.checkedValue;
|
|
37
56
|
const uncheckedValueType = typeof props.uncheckedValue;
|
|
@@ -99,10 +118,10 @@ function change() {
|
|
|
99
118
|
<template>
|
|
100
119
|
<div
|
|
101
120
|
ref="checkboxEl"
|
|
102
|
-
:class="
|
|
121
|
+
:class="mainCssClasses"
|
|
103
122
|
>
|
|
104
123
|
<div
|
|
105
|
-
:class="
|
|
124
|
+
:class="bodyCssClasses"
|
|
106
125
|
@click="change"
|
|
107
126
|
>
|
|
108
127
|
<svg
|
|
@@ -112,7 +131,7 @@ function change() {
|
|
|
112
131
|
viewBox="0 0 24 24"
|
|
113
132
|
fill="none"
|
|
114
133
|
xmlns="http://www.w3.org/2000/svg"
|
|
115
|
-
:class="$style.
|
|
134
|
+
:class="$style.ui3nCheckboxIcon"
|
|
116
135
|
>
|
|
117
136
|
<g id="SVGRepo_bgCarrier" stroke-width="0" />
|
|
118
137
|
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -128,7 +147,7 @@ function change() {
|
|
|
128
147
|
viewBox="0 0 24 24"
|
|
129
148
|
fill="none"
|
|
130
149
|
xmlns="http://www.w3.org/2000/svg"
|
|
131
|
-
:class="$style.
|
|
150
|
+
:class="$style.ui3nCheckboxIcon"
|
|
132
151
|
>
|
|
133
152
|
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
|
134
153
|
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
|
@@ -139,7 +158,7 @@ function change() {
|
|
|
139
158
|
</div>
|
|
140
159
|
|
|
141
160
|
<div
|
|
142
|
-
:class="$style.
|
|
161
|
+
:class="$style.ui3nCheckboxLabel"
|
|
143
162
|
@click="change"
|
|
144
163
|
>
|
|
145
164
|
<slot />
|
|
@@ -150,7 +169,7 @@ function change() {
|
|
|
150
169
|
<style lang="scss" module>
|
|
151
170
|
@import "../../assets/styles/mixins";
|
|
152
171
|
|
|
153
|
-
.
|
|
172
|
+
.ui3nCheckbox {
|
|
154
173
|
--ui3n-checkbox-size: 16px;
|
|
155
174
|
--ui3n-checkbox-color: var(--color-icon-control-accent-default);
|
|
156
175
|
--ui3n-checkbox-text-size: 12px;
|
|
@@ -169,7 +188,7 @@ function change() {
|
|
|
169
188
|
gap: 0;
|
|
170
189
|
}
|
|
171
190
|
|
|
172
|
-
.
|
|
191
|
+
.ui3nCheckboxBody {
|
|
173
192
|
position: relative;
|
|
174
193
|
display: flex;
|
|
175
194
|
width: var(--ui3n-checkbox-size);
|
|
@@ -201,12 +220,12 @@ function change() {
|
|
|
201
220
|
}
|
|
202
221
|
}
|
|
203
222
|
|
|
204
|
-
.
|
|
223
|
+
.ui3nCheckboxIcon {
|
|
205
224
|
min-height: calc(var(--ui3n-checkbox-size) - 4px);
|
|
206
225
|
min-width: calc(var(--ui3n-checkbox-size) - 4px);
|
|
207
226
|
}
|
|
208
227
|
|
|
209
|
-
.
|
|
228
|
+
.ui3nCheckboxLabel {
|
|
210
229
|
font-size: var(--ui3n-checkbox-text-size);
|
|
211
230
|
font-weight: var(--ui3n-checkbox-text-weight);
|
|
212
231
|
color: var(--ui3n-checkbox-text-color);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, useSlots } from 'vue';
|
|
2
|
+
import { computed, useCssModule, useSlots } from 'vue';
|
|
3
3
|
import Ui3nButton from '../ui3n-button/ui3n-button.vue';
|
|
4
4
|
import type { Ui3nChipEmits, Ui3nChipProps, Ui3nChipSlots } from './types';
|
|
5
5
|
|
|
@@ -21,6 +21,7 @@ const emits = defineEmits<Ui3nChipEmits>();
|
|
|
21
21
|
defineSlots<Ui3nChipSlots>();
|
|
22
22
|
|
|
23
23
|
const slots = useSlots();
|
|
24
|
+
const $css = useCssModule();
|
|
24
25
|
|
|
25
26
|
const height = computed(() => `${props.height}px`);
|
|
26
27
|
const iconHeight = computed(() => props.height ? Number(props.height) - 2 : Number(props.height));
|
|
@@ -30,23 +31,26 @@ const bgColor = computed(() => props.color);
|
|
|
30
31
|
const textSize = computed(() => `${props.textSize}px`);
|
|
31
32
|
const textColor = computed(() => props.textColor);
|
|
32
33
|
const hasLeftSlot = computed(() => !!slots.left);
|
|
34
|
+
|
|
35
|
+
const mainCssClasses = computed(() => {
|
|
36
|
+
const val = [$css.ui3nChip];
|
|
37
|
+
|
|
38
|
+
props.round && val.push($css.round);
|
|
39
|
+
props.plain && val.push($css.plain);
|
|
40
|
+
props.closeable && val.push($css.closeable);
|
|
41
|
+
hasLeftSlot.value && val.push($css.withIcon);
|
|
42
|
+
|
|
43
|
+
return val;
|
|
44
|
+
});
|
|
33
45
|
</script>
|
|
34
46
|
|
|
35
47
|
<template>
|
|
36
|
-
<div
|
|
37
|
-
:class="
|
|
38
|
-
$style.chip,
|
|
39
|
-
round && $style.round,
|
|
40
|
-
plain && $style.plain,
|
|
41
|
-
closeable && $style.closable,
|
|
42
|
-
hasLeftSlot && $style.withIcon,
|
|
43
|
-
]"
|
|
44
|
-
>
|
|
45
|
-
<div :class="$style.icon">
|
|
48
|
+
<div :class="mainCssClasses">
|
|
49
|
+
<div :class="$style.ui3nChipIcon">
|
|
46
50
|
<slot name="left" :size="iconHeight" :color="props.textColor" />
|
|
47
51
|
</div>
|
|
48
52
|
|
|
49
|
-
<div :class="$style.
|
|
53
|
+
<div :class="$style.ui3nChipBody">
|
|
50
54
|
<slot />
|
|
51
55
|
</div>
|
|
52
56
|
|
|
@@ -66,7 +70,7 @@ const hasLeftSlot = computed(() => !!slots.left);
|
|
|
66
70
|
<style lang="scss" module>
|
|
67
71
|
@import "../../assets/styles/mixins";
|
|
68
72
|
|
|
69
|
-
.
|
|
73
|
+
.ui3nChip {
|
|
70
74
|
position: relative;
|
|
71
75
|
display: flex;
|
|
72
76
|
height: v-bind('height');
|
|
@@ -96,7 +100,7 @@ const hasLeftSlot = computed(() => !!slots.left);
|
|
|
96
100
|
}
|
|
97
101
|
}
|
|
98
102
|
|
|
99
|
-
.
|
|
103
|
+
.ui3nChipBody {
|
|
100
104
|
font-size: v-bind('textSize');
|
|
101
105
|
line-height: 1;
|
|
102
106
|
font-weight: 400;
|
|
@@ -111,7 +115,7 @@ const hasLeftSlot = computed(() => !!slots.left);
|
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
.withIcon {
|
|
114
|
-
.
|
|
118
|
+
.ui3nChipIcon {
|
|
115
119
|
display: flex;
|
|
116
120
|
flex-grow: 0;
|
|
117
121
|
flex-shrink: 0;
|
|
@@ -53,19 +53,19 @@ onMounted(() => {
|
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
function selectData(value: any) {
|
|
57
57
|
data.value = value;
|
|
58
58
|
if (!dialogProps.value.confirmButton && !dialogProps.value.cancelButton && props.dialogProps?.onConfirm) {
|
|
59
59
|
props.dialogProps?.onConfirm(data.value);
|
|
60
60
|
closeDialog();
|
|
61
61
|
}
|
|
62
|
-
}
|
|
62
|
+
}
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
function validate(value: boolean) {
|
|
65
65
|
isValid.value = value;
|
|
66
|
-
}
|
|
66
|
+
}
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
function closeDialog(arg?: { ev?: Event; withAction?: boolean }) {
|
|
69
69
|
const { ev, withAction = true } = arg || {};
|
|
70
70
|
if (ev) {
|
|
71
71
|
ev.stopImmediatePropagation();
|
|
@@ -76,9 +76,9 @@ const closeDialog = (arg?: { ev?: Event; withAction?: boolean }) => {
|
|
|
76
76
|
if (withAction) {
|
|
77
77
|
emits('close');
|
|
78
78
|
}
|
|
79
|
-
}
|
|
79
|
+
}
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
function startEmit(event: Ui3nDialogEvent) {
|
|
82
82
|
if (event === 'click-overlay') {
|
|
83
83
|
emits(event);
|
|
84
84
|
closeDialog();
|
|
@@ -101,13 +101,13 @@ const startEmit = (event: Ui3nDialogEvent) => {
|
|
|
101
101
|
// @ts-ignore
|
|
102
102
|
emits(event);
|
|
103
103
|
}
|
|
104
|
-
}
|
|
104
|
+
}
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
function handleEvent(event: Event, eventName: Ui3nDialogEvent) {
|
|
107
107
|
event.stopImmediatePropagation();
|
|
108
108
|
event.preventDefault();
|
|
109
109
|
startEmit(eventName);
|
|
110
|
-
}
|
|
110
|
+
}
|
|
111
111
|
</script>
|
|
112
112
|
|
|
113
113
|
<template>
|