@webitel/ui-sdk 25.8.49 → 25.8.51
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/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +1763 -1764
- package/dist/ui-sdk.umd.cjs +24 -24
- package/package.json +1 -1
- package/src/components/wt-checkbox/wt-checkbox.vue +10 -10
- package/src/components/wt-tree-line/wt-tree-line.vue +14 -7
- package/types/components/wt-tree-line/wt-tree-line.vue.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-sdk",
|
|
3
|
-
"version": "25.8.
|
|
3
|
+
"version": "25.8.51",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"make-all": "npm version patch --git-tag-version false && npm run build && (npm run build:types || true) && (npm run lint:fix || true) && npm run publish-lib",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
3
|
class="wt-checkbox"
|
|
4
4
|
>
|
|
5
5
|
<p-checkbox
|
|
6
6
|
v-model="model"
|
|
7
|
-
:
|
|
7
|
+
:binary="isSingle"
|
|
8
8
|
:disabled="disabled"
|
|
9
|
+
:input-id="checkboxId"
|
|
9
10
|
:value="value"
|
|
10
|
-
:binary="isSingle"
|
|
11
11
|
>
|
|
12
12
|
<template #icon>
|
|
13
13
|
<span class="wt-checkbox__checkmark">
|
|
@@ -18,10 +18,9 @@
|
|
|
18
18
|
</span>
|
|
19
19
|
</template>
|
|
20
20
|
</p-checkbox>
|
|
21
|
-
<wt-label
|
|
22
|
-
v-if="label"
|
|
23
|
-
:for="checkboxId"
|
|
21
|
+
<wt-label
|
|
24
22
|
:disabled="disabled"
|
|
23
|
+
:for="checkboxId"
|
|
25
24
|
>
|
|
26
25
|
<!-- @slot Custom label markup -->
|
|
27
26
|
<slot
|
|
@@ -29,6 +28,7 @@
|
|
|
29
28
|
v-bind="{ label, isChecked, disabled }"
|
|
30
29
|
>
|
|
31
30
|
<div
|
|
31
|
+
v-if="label"
|
|
32
32
|
class="wt-checkbox__label"
|
|
33
33
|
>
|
|
34
34
|
{{ label }}
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
</div>
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
|
-
<script
|
|
41
|
+
<script lang="ts" setup>
|
|
42
42
|
import type { CheckboxProps } from 'primevue/checkbox';
|
|
43
43
|
import { computed, defineModel, defineProps } from 'vue';
|
|
44
44
|
|
|
@@ -84,8 +84,8 @@ const iconColor = computed(() => {
|
|
|
84
84
|
|
|
85
85
|
<style lang="scss" scoped>
|
|
86
86
|
.wt-checkbox {
|
|
87
|
-
display: flex;
|
|
88
87
|
position: relative;
|
|
88
|
+
display: flex;
|
|
89
89
|
align-items: center;
|
|
90
90
|
user-select: none;
|
|
91
91
|
}
|
|
@@ -95,8 +95,8 @@ const iconColor = computed(() => {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
.wt-checkbox__label {
|
|
98
|
-
transition: var(--transition);
|
|
99
|
-
cursor: pointer;
|
|
100
98
|
margin-left: var(--checkbox-icon-margin);
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
transition: var(--transition);
|
|
101
101
|
}
|
|
102
102
|
</style>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
/>
|
|
19
19
|
</div>
|
|
20
20
|
<div
|
|
21
|
-
:class="{ active:
|
|
21
|
+
:class="{ active: displayActiveState }"
|
|
22
22
|
class="wt-tree-line__label-wrapper"
|
|
23
23
|
@click="selectElement"
|
|
24
24
|
>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
{{ label }}
|
|
27
27
|
</p>
|
|
28
28
|
<wt-icon
|
|
29
|
-
v-if="
|
|
29
|
+
v-if="displayActiveState"
|
|
30
30
|
icon="chat-message-status-sent"
|
|
31
31
|
/>
|
|
32
32
|
</div>
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
:item-label="itemLabel"
|
|
43
43
|
:item-data="itemData"
|
|
44
44
|
:nested-level="nestedLevel + 1"
|
|
45
|
+
:selected-parent="isSelected || selectedParent"
|
|
45
46
|
:next-element="!!data[childrenProp][index + 1]"
|
|
46
47
|
:nested-icons="displayIcons"
|
|
47
48
|
:last-child="index === data[childrenProp].length - 1"
|
|
@@ -69,6 +70,7 @@ const props = withDefaults(
|
|
|
69
70
|
childrenProp?: string;
|
|
70
71
|
nestedLevel?: number;
|
|
71
72
|
lastChild?: boolean;
|
|
73
|
+
selectedParent?: boolean;
|
|
72
74
|
nestedIcons?: WtTreeNestedIcons[];
|
|
73
75
|
nextElement?: boolean;
|
|
74
76
|
multiple?: boolean;
|
|
@@ -82,6 +84,7 @@ const props = withDefaults(
|
|
|
82
84
|
childrenProp: 'children',
|
|
83
85
|
lastChild: false,
|
|
84
86
|
nextElement: false,
|
|
87
|
+
selectedParent: false,
|
|
85
88
|
multiple: false,
|
|
86
89
|
searchedProp: 'searched',
|
|
87
90
|
},
|
|
@@ -132,6 +135,15 @@ const isSelected = computed(() => {
|
|
|
132
135
|
return deepEqual(props.modelValue, props.data);
|
|
133
136
|
});
|
|
134
137
|
|
|
138
|
+
const displayActiveState = computed(() => {
|
|
139
|
+
if (props.multiple) {
|
|
140
|
+
return isSelected.value;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return isSelected.value || props.selectedParent;
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
|
|
135
147
|
const setMultipleModelValue = () => {
|
|
136
148
|
const value = props.itemData ? props.data[props.itemData] : props.data;
|
|
137
149
|
let existingIndex;
|
|
@@ -162,11 +174,6 @@ const selectElement = () => {
|
|
|
162
174
|
return;
|
|
163
175
|
}
|
|
164
176
|
|
|
165
|
-
if (props.data[props.childrenProp]?.length) {
|
|
166
|
-
collapsed.value = !collapsed.value;
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
177
|
emit(
|
|
171
178
|
'update:modelValue',
|
|
172
179
|
props.itemData ? props.data[props.itemData] : props.data,
|
|
@@ -7,6 +7,7 @@ type __VLS_Props = {
|
|
|
7
7
|
childrenProp?: string;
|
|
8
8
|
nestedLevel?: number;
|
|
9
9
|
lastChild?: boolean;
|
|
10
|
+
selectedParent?: boolean;
|
|
10
11
|
nestedIcons?: WtTreeNestedIcons[];
|
|
11
12
|
nextElement?: boolean;
|
|
12
13
|
multiple?: boolean;
|
|
@@ -26,6 +27,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
26
27
|
lastChild: boolean;
|
|
27
28
|
childrenProp: string;
|
|
28
29
|
nestedLevel: number;
|
|
30
|
+
selectedParent: boolean;
|
|
29
31
|
nextElement: boolean;
|
|
30
32
|
searchedProp: string;
|
|
31
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|