@v1nt1248/3nclient-lib 0.2.32 → 0.2.34
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/README.md +2 -0
- package/dist/components/ui3n-dialog/types.d.ts +1 -1
- package/dist/components/ui3n-editable/types.d.ts +1 -1
- package/dist/components/ui3n-editable/ui3n-editable.vue.d.ts +1 -1
- package/dist/components/ui3n-editable/useContentEditable.d.ts +1 -1
- package/dist/components/ui3n-input/ui3n-input.vue.d.ts +33 -5
- package/dist/components/ui3n-text/ui3n-text.vue.d.ts +31 -5
- package/dist/directives/index.d.ts +2 -1
- package/dist/directives/ui3n-long-press.d.ts +27 -0
- package/dist/index.d.ts +3 -2
- package/dist/style.css +1 -1
- package/dist/types/directives.types.d.ts +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/ui3n-components.d.ts +3 -1
- package/dist/ui3n-components.js +5640 -5563
- package/dist/ui3n-plugins.d.ts +1 -2
- package/dist/ui3n-plugins.js +2 -2
- package/dist/ui3n-utils.js +154 -144
- package/dist/utils/files/create-video-thumbnail.d.ts +1 -1
- package/dist/utils/for-vue/try-on-scope-dispose.d.ts +2 -0
- package/dist/utils/for-vue/unref-element.d.ts +2 -0
- package/dist/utils/index.d.ts +3 -1
- package/package.json +52 -46
- package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +32 -9
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +14 -14
- package/src/components/ui3n-button/ui3n-button.vue +229 -226
- package/src/components/ui3n-checkbox/ui3n-checkbox.vue +30 -7
- package/src/components/ui3n-chip/ui3n-chip.vue +113 -109
- package/src/components/ui3n-dialog/types.ts +1 -1
- package/src/components/ui3n-dialog/ui3n-dialog.vue +7 -8
- package/src/components/ui3n-editable/types.ts +1 -1
- package/src/components/ui3n-editable/ui3n-editable.vue +34 -12
- package/src/components/ui3n-editable/useContentEditable.ts +6 -3
- package/src/components/ui3n-icon/ui3n-icon.vue +1 -1
- package/src/components/ui3n-input/ui3n-input.vue +272 -273
- package/src/components/ui3n-input-file/ui3n-input-file.vue +2 -2
- package/src/components/ui3n-list/ui3n-list.vue +70 -60
- package/src/components/ui3n-menu/ui3n-menu.vue +1 -1
- package/src/components/ui3n-notification/ui3n-notification.vue +4 -1
- package/src/components/ui3n-progress/ui3n-progress-circular.vue +168 -147
- package/src/components/ui3n-progress/ui3n-progress-linear.vue +77 -73
- package/src/components/ui3n-radio-group/ui3n-radio.vue +178 -177
- package/src/components/ui3n-step-line-bar/ui3n-step-line-bar.vue +50 -46
- package/src/components/ui3n-switch/ui3n-switch.vue +114 -116
- package/src/components/ui3n-table/composables/useTable.ts +17 -9
- package/src/components/ui3n-table/ui3n-table-sort-icon.vue +9 -6
- package/src/components/ui3n-table/ui3n-table.vue +7 -5
- package/src/components/ui3n-text/ui3n-text.vue +157 -215
- package/src/components/ui3n-tooltip/ui3n-tooltip.vue +4 -5
- package/src/components/types/index.ts +0 -15
- /package/dist/{components/types/index.d.ts → types/components.types.d.ts} +0 -0
- /package/dist/{plugins/types.d.ts → types/plugins.types.d.ts} +0 -0
- /package/dist/utils/{for-we3n.d.ts → for-web3n.d.ts} +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { toNumber } from 'lodash';
|
|
4
|
-
import type { Ui3nProgressLinearProps } from './types';
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { toNumber } from 'lodash';
|
|
4
|
+
import type { Ui3nProgressLinearProps } from './types';
|
|
5
5
|
|
|
6
|
-
const thresholdHeight = 12;
|
|
7
|
-
const thresholdValue = 5;
|
|
6
|
+
const thresholdHeight = 12;
|
|
7
|
+
const thresholdValue = 5;
|
|
8
8
|
|
|
9
|
-
const props = withDefaults(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
);
|
|
9
|
+
const props = withDefaults(
|
|
10
|
+
defineProps<Ui3nProgressLinearProps>(),
|
|
11
|
+
{
|
|
12
|
+
value: 0,
|
|
13
|
+
height: 2,
|
|
14
|
+
bgColor: 'var(--color-bg-control-primary-default)',
|
|
15
|
+
color: 'var(--color-bg-control-accent-default)',
|
|
16
|
+
},
|
|
17
|
+
);
|
|
18
18
|
|
|
19
|
-
const isValueShown = computed(() => props.withText && !props.indeterminate);
|
|
20
|
-
const innerHeight = computed(() => toNumber(props.height));
|
|
21
|
-
const cssHeight = computed(() => `${innerHeight.value}px`);
|
|
22
|
-
const innerValue = computed(() => toNumber(props.value));
|
|
23
|
-
const displayValue = computed(() => props.indeterminate
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
19
|
+
const isValueShown = computed(() => props.withText && !props.indeterminate);
|
|
20
|
+
const innerHeight = computed(() => toNumber(props.height));
|
|
21
|
+
const cssHeight = computed(() => `${innerHeight.value}px`);
|
|
22
|
+
const innerValue = computed(() => toNumber(props.value));
|
|
23
|
+
const displayValue = computed(() => props.indeterminate
|
|
24
|
+
? `20%`
|
|
25
|
+
: `${Math.min(innerValue.value, 100)}%`,
|
|
26
|
+
);
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<template>
|
|
@@ -36,7 +36,10 @@ const displayValue = computed(() => props.indeterminate
|
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
<div :class="$style.body">
|
|
39
|
-
<div
|
|
39
|
+
<div
|
|
40
|
+
:class="$style.value"
|
|
41
|
+
:style="{ width: displayValue }"
|
|
42
|
+
>
|
|
40
43
|
<div
|
|
41
44
|
v-if="isValueShown && innerHeight >= thresholdHeight && innerValue >= thresholdValue"
|
|
42
45
|
:class="$style.text"
|
|
@@ -49,63 +52,64 @@ const displayValue = computed(() => props.indeterminate
|
|
|
49
52
|
</template>
|
|
50
53
|
|
|
51
54
|
<style lang="scss" module>
|
|
52
|
-
.ui3nProgressLinear {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
.ui3nProgressLinear {
|
|
56
|
+
--ui3n-progress-linear-height: v-bind(cssHeight);
|
|
57
|
+
--ui3n-progress-linear-bg: v-bind(bgColor);
|
|
58
|
+
--ui3n-progress-linear-color: v-bind(color);
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.body {
|
|
62
|
-
position: relative;
|
|
63
|
-
width: 100%;
|
|
64
|
-
height: var(--ui3n-progress-linear-height);
|
|
65
|
-
border-radius: calc(var(--ui3n-progress-linear-height) - 2px);
|
|
66
|
-
background-color: var(--ui3n-progress-linear-bg);
|
|
67
|
-
overflow-x: hidden;
|
|
68
|
-
}
|
|
60
|
+
position: relative;
|
|
61
|
+
width: 100%;
|
|
62
|
+
}
|
|
69
63
|
|
|
70
|
-
.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
background-color: var(--ui3n-progress-linear-color);
|
|
79
|
-
}
|
|
64
|
+
.body {
|
|
65
|
+
position: relative;
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: var(--ui3n-progress-linear-height);
|
|
68
|
+
border-radius: calc(var(--ui3n-progress-linear-height) - 2px);
|
|
69
|
+
background-color: var(--ui3n-progress-linear-bg);
|
|
70
|
+
overflow-x: hidden;
|
|
71
|
+
}
|
|
80
72
|
|
|
81
|
-
.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
.value {
|
|
74
|
+
display: flex;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
align-items: center;
|
|
77
|
+
position: absolute;
|
|
78
|
+
left: 0;
|
|
79
|
+
height: var(--ui3n-progress-linear-height);
|
|
80
|
+
border-radius: calc(var(--ui3n-progress-linear-height) - 2px);
|
|
81
|
+
background-color: var(--ui3n-progress-linear-color);
|
|
82
|
+
}
|
|
87
83
|
|
|
88
|
-
.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
color: var(--color-bg-control-accent-default);
|
|
95
|
-
}
|
|
84
|
+
.text {
|
|
85
|
+
font-size: calc(var(--ui3n-progress-linear-height) - 2px);
|
|
86
|
+
font-weight: 500;
|
|
87
|
+
line-height: var(--ui3n-progress-linear-height);
|
|
88
|
+
color: var(--ui3n-progress-linear-bg);
|
|
89
|
+
}
|
|
96
90
|
|
|
97
|
-
.
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
.above {
|
|
92
|
+
position: relative;
|
|
93
|
+
width: 100%;
|
|
94
|
+
text-align: center;
|
|
95
|
+
font-size: var(--font-14);
|
|
96
|
+
line-height: var(--font-16);
|
|
97
|
+
color: var(--color-bg-control-accent-default);
|
|
100
98
|
}
|
|
101
|
-
}
|
|
102
99
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
.indeterminate {
|
|
101
|
+
.value {
|
|
102
|
+
animation: 1s linear 0s infinite normal move;
|
|
103
|
+
}
|
|
106
104
|
}
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
|
|
106
|
+
@keyframes move {
|
|
107
|
+
from {
|
|
108
|
+
left: -22%
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
to {
|
|
112
|
+
left: 122%
|
|
113
|
+
}
|
|
109
114
|
}
|
|
110
|
-
}
|
|
111
115
|
</style>
|
|
@@ -1,124 +1,124 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, getCurrentInstance, inject, onBeforeMount, onMounted, ref, useSlots, watch } from 'vue';
|
|
3
|
-
import type { Ref } from 'vue';
|
|
4
|
-
import type { Nullable } from '
|
|
5
|
-
import type { Ui3nRadioEmits, Ui3nRadioProps, Ui3nRadioSlots, Ui3nRadioValue } from './types';
|
|
6
|
-
|
|
7
|
-
const props = withDefaults(defineProps<Ui3nRadioProps>(), {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
const emits = defineEmits<Ui3nRadioEmits>();
|
|
16
|
-
defineSlots<Ui3nRadioSlots>();
|
|
17
|
-
|
|
18
|
-
const slots = useSlots();
|
|
19
|
-
|
|
20
|
-
const instance = getCurrentInstance();
|
|
21
|
-
const isComponentPartOfGroup =
|
|
22
|
-
|
|
23
|
-
const groupName = isComponentPartOfGroup ? instance?.parent?.props.name : '';
|
|
24
|
-
|
|
25
|
-
const radioEl = ref<HTMLDivElement | null>(null);
|
|
26
|
-
|
|
27
|
-
const {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} = groupName
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const val = ref<Ui3nRadioValue>(groupName ? groupValue!.value : props.modelValue);
|
|
41
|
-
|
|
42
|
-
const isOn = computed(() => val.value === props.checkedValue);
|
|
43
|
-
|
|
44
|
-
function change(ev: Event) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
2
|
+
import { computed, getCurrentInstance, inject, onBeforeMount, onMounted, ref, useSlots, watch } from 'vue';
|
|
3
|
+
import type { Ref } from 'vue';
|
|
4
|
+
import type { Nullable } from '../../types';
|
|
5
|
+
import type { Ui3nRadioEmits, Ui3nRadioProps, Ui3nRadioSlots, Ui3nRadioValue } from './types';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<Ui3nRadioProps>(), {
|
|
8
|
+
modelValue: false,
|
|
9
|
+
checkedValue: true,
|
|
10
|
+
uncheckedValue: false,
|
|
11
|
+
size: '16',
|
|
12
|
+
color: 'var(--color-icon-control-accent-default)',
|
|
13
|
+
disabled: false,
|
|
14
|
+
});
|
|
15
|
+
const emits = defineEmits<Ui3nRadioEmits>();
|
|
16
|
+
defineSlots<Ui3nRadioSlots>();
|
|
17
|
+
|
|
18
|
+
const slots = useSlots();
|
|
19
|
+
|
|
20
|
+
const instance = getCurrentInstance();
|
|
21
|
+
const isComponentPartOfGroup =
|
|
22
|
+
instance?.parent?.type.__name === 'Ui3nRadioGroup' || instance?.parent?.type.__name === 'ui3n-radio-group';
|
|
23
|
+
const groupName = isComponentPartOfGroup ? instance?.parent?.props.name : '';
|
|
24
|
+
|
|
25
|
+
const radioEl = ref<HTMLDivElement | null>(null);
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
groupValue,
|
|
29
|
+
updateGroupValue,
|
|
30
|
+
}: {
|
|
31
|
+
groupValue: Nullable<Ref<Ui3nRadioValue>>;
|
|
32
|
+
updateGroupValue: Nullable<(value: Ui3nRadioValue) => void>;
|
|
33
|
+
} = groupName
|
|
34
|
+
? inject(`radio-group-${groupName}`)!
|
|
35
|
+
: {
|
|
36
|
+
groupValue: null,
|
|
37
|
+
updateGroupValue: null,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const val = ref<Ui3nRadioValue>(groupName ? groupValue!.value : props.modelValue);
|
|
41
|
+
|
|
42
|
+
const isOn = computed(() => val.value === props.checkedValue);
|
|
43
|
+
|
|
44
|
+
function change(ev: Event) {
|
|
45
|
+
ev.preventDefault();
|
|
46
|
+
|
|
47
|
+
if (!groupName) {
|
|
48
|
+
val.value = isOn.value ? props.uncheckedValue : props.checkedValue;
|
|
49
|
+
emits('change', val.value);
|
|
50
|
+
emits('update:modelValue', val.value);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
if (isOn.value) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// if (groupName) {
|
|
62
|
-
// isOn.value && updateGroupValue!(val.value);
|
|
63
|
-
// } else {
|
|
64
|
-
// emits('change', val.value);
|
|
65
|
-
// emits('update:modelValue', val.value);
|
|
66
|
-
// }
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
onBeforeMount(() => {
|
|
70
|
-
if (
|
|
71
|
-
// @ts-ignore
|
|
72
|
-
(slots.checkedIcon && !slots.uncheckedIcon) ||
|
|
73
|
-
// @ts-ignore
|
|
74
|
-
(!slots.checkedIcon && slots.uncheckedIcon)
|
|
75
|
-
) {
|
|
76
|
-
throw Error('[Ui3nRadio] Both checkedIcon and uncheckedIcon slots must have values defined.');
|
|
77
|
-
}
|
|
78
|
-
});
|
|
58
|
+
val.value = props.checkedValue;
|
|
59
|
+
updateGroupValue!(val.value);
|
|
79
60
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
61
|
+
// if (groupName) {
|
|
62
|
+
// isOn.value && updateGroupValue!(val.value);
|
|
63
|
+
// } else {
|
|
64
|
+
// emits('change', val.value);
|
|
65
|
+
// emits('update:modelValue', val.value);
|
|
66
|
+
// }
|
|
84
67
|
}
|
|
85
|
-
});
|
|
86
68
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
69
|
+
onBeforeMount(() => {
|
|
70
|
+
if (
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
(slots.checkedIcon && !slots.uncheckedIcon) ||
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
(!slots.checkedIcon && slots.uncheckedIcon)
|
|
75
|
+
) {
|
|
76
|
+
throw Error('[Ui3nRadio] Both checkedIcon and uncheckedIcon slots must have values defined.');
|
|
92
77
|
}
|
|
93
|
-
}
|
|
94
|
-
);
|
|
78
|
+
});
|
|
95
79
|
|
|
96
|
-
|
|
97
|
-
() => props.size,
|
|
98
|
-
newValue => {
|
|
80
|
+
onMounted(() => {
|
|
99
81
|
if (radioEl.value) {
|
|
100
|
-
radioEl.value.style.setProperty('--ui3n-radio-size', `${
|
|
82
|
+
radioEl.value.style.setProperty('--ui3n-radio-size', `${props.size}px`);
|
|
83
|
+
radioEl.value.style.setProperty('--ui3n-radio-color', props.color);
|
|
101
84
|
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
watch(
|
|
88
|
+
() => props.modelValue,
|
|
89
|
+
newValue => {
|
|
90
|
+
if (newValue !== val.value) {
|
|
91
|
+
val.value = newValue;
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
watch(
|
|
97
|
+
() => props.size,
|
|
98
|
+
newValue => {
|
|
99
|
+
if (radioEl.value) {
|
|
100
|
+
radioEl.value.style.setProperty('--ui3n-radio-size', `${newValue}px`);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
watch(
|
|
106
|
+
() => props.color,
|
|
107
|
+
newValue => {
|
|
108
|
+
if (radioEl.value) {
|
|
109
|
+
radioEl.value.style.setProperty('--ui3n-radio-color', newValue);
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
watch(
|
|
115
|
+
() => groupValue?.value,
|
|
116
|
+
newVal => {
|
|
117
|
+
if (groupName) {
|
|
118
|
+
val.value = newVal === props.checkedValue ? props.checkedValue : props.uncheckedValue;
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
);
|
|
122
122
|
</script>
|
|
123
123
|
|
|
124
124
|
<template>
|
|
@@ -178,74 +178,75 @@ watch(
|
|
|
178
178
|
</template>
|
|
179
179
|
|
|
180
180
|
<style lang="scss" module>
|
|
181
|
-
@use '../../assets/styles/mixins' as mixins;
|
|
182
|
-
|
|
183
|
-
.ui3nRadio {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
181
|
+
@use '../../assets/styles/mixins' as mixins;
|
|
182
|
+
|
|
183
|
+
.ui3nRadio {
|
|
184
|
+
--ui3n-radio-size: 16px;
|
|
185
|
+
--ui3n-radio-color: var(--color-icon-control-accent-default);
|
|
186
|
+
--ui3n-radio-text-size: 12px;
|
|
187
|
+
--ui3n-radio-text-color: var(--color-text-control-primary-default);
|
|
188
|
+
--ui3n-radio-text-weight: 500;
|
|
189
|
+
|
|
190
|
+
position: relative;
|
|
191
|
+
display: flex;
|
|
192
|
+
justify-content: flex-start;
|
|
193
|
+
align-items: center;
|
|
194
|
+
min-height: var(--spacing-vl);
|
|
195
|
+
gap: var(--spacing-s);
|
|
196
|
+
|
|
197
|
+
&.disabled {
|
|
198
|
+
--ui3n-radio-color: var(--color-icon-control-primary-disabled) !important;
|
|
199
|
+
|
|
200
|
+
pointer-events: none;
|
|
201
|
+
cursor: default;
|
|
202
|
+
|
|
203
|
+
.label {
|
|
204
|
+
opacity: 0.7;
|
|
205
|
+
}
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
208
|
+
|
|
209
|
+
.noLabel {
|
|
210
|
+
gap: 0;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.body {
|
|
214
|
+
position: relative;
|
|
215
|
+
display: flex;
|
|
216
|
+
width: var(--ui3n-radio-size);
|
|
217
|
+
min-width: var(--ui3n-radio-size);
|
|
218
|
+
height: var(--ui3n-radio-size);
|
|
219
|
+
min-height: var(--ui3n-radio-size);
|
|
220
|
+
justify-content: center;
|
|
221
|
+
align-items: center;
|
|
222
|
+
border-radius: 50%;
|
|
223
|
+
|
|
224
|
+
&:hover {
|
|
225
|
+
cursor: pointer;
|
|
226
|
+
background-color: hsl(from transparent h s calc(l - 10));
|
|
227
|
+
@include mixins.ripple(hsl(from transparent h s calc(l - 10)));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.label {
|
|
232
|
+
font-size: var(--ui3n-radio-text-size);
|
|
233
|
+
font-weight: var(--ui3n-radio-text-weight);
|
|
234
|
+
color: var(--ui3n-radio-text-color);
|
|
235
|
+
user-select: none;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.icon {
|
|
239
|
+
color: var(--ui3n-radio-color);
|
|
240
|
+
min-height: calc(var(--ui3n-radion-size) - 2px);
|
|
241
|
+
height: calc(var(--ui3n-radion-size) - 2px);
|
|
242
|
+
min-width: calc(var(--ui3n-checkbox-size) - 2px);
|
|
243
|
+
width: calc(var(--ui3n-radion-size) - 2px);
|
|
224
244
|
cursor: pointer;
|
|
225
|
-
background-color: hsl(from transparent h s calc(l - 10));
|
|
226
|
-
@include mixins.ripple(hsl(from transparent h s calc(l - 10)));
|
|
227
245
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
user-select: none;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.icon {
|
|
238
|
-
color: var(--ui3n-radio-color);
|
|
239
|
-
min-height: calc(var(--ui3n-radion-size) - 2px);
|
|
240
|
-
height: calc(var(--ui3n-radion-size) - 2px);
|
|
241
|
-
min-width: calc(var(--ui3n-checkbox-size) - 2px);
|
|
242
|
-
width: calc(var(--ui3n-radion-size) - 2px);
|
|
243
|
-
cursor: pointer;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.bodyDisabled,
|
|
247
|
-
.iconDisabled {
|
|
248
|
-
filter: grayscale(1);
|
|
249
|
-
opacity: 0.5;
|
|
250
|
-
}
|
|
246
|
+
|
|
247
|
+
.bodyDisabled,
|
|
248
|
+
.iconDisabled {
|
|
249
|
+
filter: grayscale(1);
|
|
250
|
+
opacity: 0.5;
|
|
251
|
+
}
|
|
251
252
|
</style>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { Ui3nStepLineBarProps } from './types';
|
|
3
|
-
|
|
4
|
-
withDefaults(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
);
|
|
2
|
+
import type { Ui3nStepLineBarProps } from './types';
|
|
3
|
+
|
|
4
|
+
withDefaults(
|
|
5
|
+
defineProps<Ui3nStepLineBarProps>(),
|
|
6
|
+
{
|
|
7
|
+
current: 1,
|
|
8
|
+
},
|
|
9
|
+
);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -16,47 +16,51 @@ withDefaults(
|
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
18
|
<div :class="$style.body">
|
|
19
|
-
<div
|
|
19
|
+
<div
|
|
20
|
+
v-for="step in steps"
|
|
21
|
+
:key="step"
|
|
22
|
+
:class="[$style.step, step <= current && $style.active]"
|
|
23
|
+
/>
|
|
20
24
|
</div>
|
|
21
25
|
</div>
|
|
22
26
|
</template>
|
|
23
27
|
|
|
24
28
|
<style lang="scss" module>
|
|
25
|
-
.ui3nStepLineBar {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.label {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.body {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.step {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.active {
|
|
60
|
-
|
|
61
|
-
}
|
|
29
|
+
.ui3nStepLineBar {
|
|
30
|
+
--ui3n-step-line-bar-steps: v-bind(steps);
|
|
31
|
+
|
|
32
|
+
position: relative;
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.label {
|
|
37
|
+
position: relative;
|
|
38
|
+
width: 100%;
|
|
39
|
+
text-align: center;
|
|
40
|
+
font-size: var(--font-14);
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
line-height: var(--font-20);
|
|
43
|
+
color: var(--color-text-block-accent-default);
|
|
44
|
+
margin-bottom: var(--spacing-m);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.body {
|
|
48
|
+
display: flex;
|
|
49
|
+
width: 100%;
|
|
50
|
+
justify-content: space-between;
|
|
51
|
+
align-items: center;
|
|
52
|
+
gap: var(--spacing-s);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.step {
|
|
56
|
+
position: relative;
|
|
57
|
+
width: calc((100% - (calc(var(--ui3n-step-line-bar-steps) - 1) * var(--spacing-s))) / var(--ui3n-step-line-bar-steps));
|
|
58
|
+
height: var(--spacing-xs);
|
|
59
|
+
border-radius: var(--spacing-xs);
|
|
60
|
+
background-color: var(--color-bg-control-secondary-default);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.active {
|
|
64
|
+
background-color: var(--color-bg-control-accent-default);
|
|
65
|
+
}
|
|
62
66
|
</style>
|