@webitel/ui-sdk 25.8.37 → 25.8.39
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 +7517 -7014
- package/dist/ui-sdk.umd.cjs +244 -104
- package/package.json +2 -2
- package/src/components/wt-checkbox/wt-checkbox.vue +39 -117
- package/src/components/wt-table/wt-table.vue +2 -2
- package/src/components/wt-table-column-select/wt-table-column-select.vue +1 -1
- package/src/components/wt-tree-table/wt-tree-table.vue +1 -1
- package/src/components/wt-tree-table-row/wt-tree-table-row.vue +1 -1
- package/src/plugins/primevue/primevue.plugin.js +2 -0
- package/src/plugins/primevue/theme/components/checkbox/checkbox.js +8 -0
- package/src/plugins/primevue/theme/components/components.js +2 -0
- package/types/components/wt-checkbox/wt-checkbox.vue.d.ts +48 -52
- package/types/components/wt-table/wt-table.vue.d.ts +1 -1
- package/types/plugins/primevue/theme/components/checkbox/checkbox.d.ts +90 -0
- package/types/plugins/primevue/theme/components/components.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.39",
|
|
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",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@vuepic/vue-datepicker": "^4.5.1",
|
|
57
57
|
"@vueuse/components": "^13.0.0",
|
|
58
58
|
"@webitel/api-services": "^0.0.33",
|
|
59
|
-
"@webitel/styleguide": "^24.12.
|
|
59
|
+
"@webitel/styleguide": "^24.12.47",
|
|
60
60
|
"autosize": "^6.0.1",
|
|
61
61
|
"axios": "^1.8.3",
|
|
62
62
|
"clipboard-copy": "^4.0.1",
|
|
@@ -1,37 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="{
|
|
4
|
-
'wt-checkbox--active': isChecked,
|
|
5
|
-
'wt-checkbox--disabled': disabled,
|
|
6
|
-
}"
|
|
2
|
+
<div
|
|
7
3
|
class="wt-checkbox"
|
|
8
4
|
>
|
|
9
|
-
<
|
|
5
|
+
<p-checkbox
|
|
6
|
+
v-model="model"
|
|
7
|
+
:input-id="checkboxId"
|
|
8
|
+
:disabled="disabled"
|
|
9
|
+
:value="value"
|
|
10
|
+
:binary="isSingle"
|
|
11
|
+
/>
|
|
12
|
+
<wt-label
|
|
13
|
+
v-if="label"
|
|
14
|
+
:for="checkboxId"
|
|
10
15
|
:disabled="disabled"
|
|
11
|
-
class="wt-checkbox__wrapper"
|
|
12
|
-
v-bind="labelProps"
|
|
13
16
|
>
|
|
14
|
-
<input
|
|
15
|
-
:checked="isChecked"
|
|
16
|
-
:disabled="disabled"
|
|
17
|
-
:value="value"
|
|
18
|
-
class="wt-checkbox__input"
|
|
19
|
-
type="checkbox"
|
|
20
|
-
@change="inputHandler"
|
|
21
|
-
/>
|
|
22
|
-
<span class="wt-checkbox__checkmark">
|
|
23
|
-
<wt-icon
|
|
24
|
-
:color="iconColor"
|
|
25
|
-
:icon="checkboxIcon"
|
|
26
|
-
/>
|
|
27
|
-
</span>
|
|
28
17
|
<!-- @slot Custom label markup -->
|
|
29
18
|
<slot
|
|
30
19
|
name="label"
|
|
31
20
|
v-bind="{ label, isChecked, disabled }"
|
|
32
21
|
>
|
|
33
22
|
<div
|
|
34
|
-
v-if="label"
|
|
35
23
|
class="wt-checkbox__label"
|
|
36
24
|
>
|
|
37
25
|
{{ label }}
|
|
@@ -41,68 +29,34 @@
|
|
|
41
29
|
</div>
|
|
42
30
|
</template>
|
|
43
31
|
|
|
44
|
-
<script>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
emits: ['change'],
|
|
74
|
-
computed: {
|
|
75
|
-
isChecked() {
|
|
76
|
-
if (typeof this.selected === 'boolean') {
|
|
77
|
-
return this.selected;
|
|
78
|
-
}
|
|
79
|
-
return this.selected.includes(this.value);
|
|
80
|
-
},
|
|
81
|
-
checkboxIcon() {
|
|
82
|
-
return this.isChecked ? 'checkbox--checked' : 'checkbox';
|
|
83
|
-
},
|
|
84
|
-
iconColor() {
|
|
85
|
-
if (this.disabled) return 'disabled';
|
|
86
|
-
if (this.isChecked) return 'active';
|
|
87
|
-
return null;
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
methods: {
|
|
91
|
-
inputHandler() {
|
|
92
|
-
if (typeof this.selected === 'boolean') {
|
|
93
|
-
this.$emit('change', !this.selected);
|
|
94
|
-
} else {
|
|
95
|
-
let selected = [...this.selected];
|
|
96
|
-
if (selected.includes(this.value)) {
|
|
97
|
-
selected = selected.filter((value) => value !== this.value);
|
|
98
|
-
} else {
|
|
99
|
-
selected.push(this.value);
|
|
100
|
-
}
|
|
101
|
-
this.$emit('change', selected);
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
};
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
import type { CheckboxProps } from 'primevue/checkbox';
|
|
34
|
+
import { computed, defineModel, defineProps } from 'vue';
|
|
35
|
+
|
|
36
|
+
interface WtCheckboxProps extends CheckboxProps {
|
|
37
|
+
value?: string | boolean;
|
|
38
|
+
label?: string;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const props = withDefaults(defineProps<WtCheckboxProps>(), {
|
|
43
|
+
value: '',
|
|
44
|
+
label: '',
|
|
45
|
+
disabled: false,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const model = defineModel<boolean | string[]>('selected', {required: true});
|
|
49
|
+
|
|
50
|
+
const checkboxId = `checkbox-${Math.random().toString(36).slice(2, 11)}`;
|
|
51
|
+
|
|
52
|
+
const isSingle = computed(() => typeof model.value === 'boolean');
|
|
53
|
+
|
|
54
|
+
const isChecked = computed(() => {
|
|
55
|
+
if (isSingle.value) {
|
|
56
|
+
return model.value;
|
|
57
|
+
}
|
|
58
|
+
return model.value.includes(props.value);
|
|
59
|
+
});
|
|
106
60
|
</script>
|
|
107
61
|
|
|
108
62
|
<style lang="scss">
|
|
@@ -111,23 +65,10 @@ export default {
|
|
|
111
65
|
|
|
112
66
|
<style lang="scss" scoped>
|
|
113
67
|
.wt-checkbox {
|
|
114
|
-
box-sizing: border-box;
|
|
115
|
-
width: fit-content;
|
|
116
|
-
|
|
117
|
-
.wt-label {
|
|
118
|
-
cursor: pointer;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.wt-checkbox__wrapper {
|
|
123
68
|
display: flex;
|
|
124
69
|
position: relative;
|
|
125
70
|
align-items: center;
|
|
126
71
|
user-select: none;
|
|
127
|
-
|
|
128
|
-
.wt-checkbox__checkmark {
|
|
129
|
-
line-height: 0; // prevent icon height >> content
|
|
130
|
-
}
|
|
131
72
|
}
|
|
132
73
|
|
|
133
74
|
.wt-checkbox__label {
|
|
@@ -135,23 +76,4 @@ export default {
|
|
|
135
76
|
cursor: pointer;
|
|
136
77
|
margin-left: var(--checkbox-icon-margin);
|
|
137
78
|
}
|
|
138
|
-
|
|
139
|
-
/* Hide the browser's default checkbox */
|
|
140
|
-
.wt-checkbox__input {
|
|
141
|
-
position: absolute;
|
|
142
|
-
opacity: 0;
|
|
143
|
-
width: 0;
|
|
144
|
-
height: 0;
|
|
145
|
-
pointer-events: none;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.wt-checkbox:hover {
|
|
149
|
-
:deep(.wt-icon__icon) {
|
|
150
|
-
fill: var(--icon-active-color);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.wt-checkbox--disabled {
|
|
155
|
-
pointer-events: none;
|
|
156
|
-
}
|
|
157
79
|
</style>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
>
|
|
19
19
|
<wt-checkbox
|
|
20
20
|
:selected="isAllSelected"
|
|
21
|
-
@
|
|
21
|
+
@update:selected="selectAll"
|
|
22
22
|
/>
|
|
23
23
|
</th>
|
|
24
24
|
<th
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
>
|
|
72
72
|
<wt-checkbox
|
|
73
73
|
:selected="_selected.includes(row)"
|
|
74
|
-
@
|
|
74
|
+
@update:selected="handleSelection(row, $event)"
|
|
75
75
|
/>
|
|
76
76
|
</td>
|
|
77
77
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import PAutoComplete from 'primevue/autocomplete';
|
|
2
2
|
import PButton from 'primevue/button';
|
|
3
|
+
import PCheckbox from 'primevue/checkbox';
|
|
3
4
|
import PrimeVue from 'primevue/config';
|
|
4
5
|
import PInputText from 'primevue/inputtext';
|
|
5
6
|
import PPopover from 'primevue/popover';
|
|
@@ -27,6 +28,7 @@ const initPrimevue = (app) => {
|
|
|
27
28
|
app.component('PAutoComplete', changeComponentCompatMode(PAutoComplete));
|
|
28
29
|
app.component('PInputText', changeComponentCompatMode(PInputText));
|
|
29
30
|
app.component('PPopover', changeComponentCompatMode(PPopover));
|
|
31
|
+
app.component('PCheckbox', changeComponentCompatMode(PCheckbox));
|
|
30
32
|
|
|
31
33
|
app.directive('tooltip', Tooltip);
|
|
32
34
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import autocomplete from './autocomplete/autocomplete.js';
|
|
2
2
|
import button from './button/button.js';
|
|
3
|
+
import checkbox from './checkbox/checkbox.js';
|
|
3
4
|
import popover from './popover/popover.js';
|
|
4
5
|
import tooltip from './tooltip/tooltip.js';
|
|
5
6
|
|
|
@@ -8,6 +9,7 @@ const components = {
|
|
|
8
9
|
autocomplete,
|
|
9
10
|
popover,
|
|
10
11
|
tooltip,
|
|
12
|
+
checkbox,
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
export default components;
|
|
@@ -1,57 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
type: BooleanConstructor;
|
|
43
|
-
default: boolean;
|
|
44
|
-
};
|
|
45
|
-
labelProps: {
|
|
46
|
-
type: ObjectConstructor;
|
|
47
|
-
description: string;
|
|
48
|
-
};
|
|
49
|
-
}>> & Readonly<{
|
|
50
|
-
onChange?: (...args: any[]) => any;
|
|
1
|
+
import type { CheckboxProps } from 'primevue/checkbox';
|
|
2
|
+
interface WtCheckboxProps extends CheckboxProps {
|
|
3
|
+
value?: string | boolean;
|
|
4
|
+
label?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
type __VLS_Props = WtCheckboxProps;
|
|
8
|
+
declare const model: import("vue").ModelRef<boolean | string[], string, boolean | string[], boolean | string[]>;
|
|
9
|
+
declare const checkboxId: string;
|
|
10
|
+
declare const isSingle: import("vue").ComputedRef<boolean>;
|
|
11
|
+
declare const isChecked: import("vue").ComputedRef<any>;
|
|
12
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
13
|
+
'selected': boolean | string[];
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
16
|
+
declare var __VLS_9: {
|
|
17
|
+
label: string;
|
|
18
|
+
isChecked: any;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
};
|
|
21
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
22
|
+
label?: (props: typeof __VLS_9) => any;
|
|
23
|
+
}>;
|
|
24
|
+
declare const __VLS_self: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
25
|
+
model: typeof model;
|
|
26
|
+
checkboxId: typeof checkboxId;
|
|
27
|
+
isSingle: typeof isSingle;
|
|
28
|
+
isChecked: typeof isChecked;
|
|
29
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
"update:selected": (value: boolean | string[]) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
32
|
+
"onUpdate:selected"?: (value: boolean | string[]) => any;
|
|
33
|
+
}>, {
|
|
34
|
+
value: string | boolean;
|
|
35
|
+
label: string;
|
|
36
|
+
disabled: boolean;
|
|
37
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
"update:selected": (value: boolean | string[]) => any;
|
|
40
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
41
|
+
"onUpdate:selected"?: (value: boolean | string[]) => any;
|
|
51
42
|
}>, {
|
|
52
43
|
value: string | boolean;
|
|
53
44
|
label: string;
|
|
54
|
-
selected: boolean | unknown[];
|
|
55
45
|
disabled: boolean;
|
|
56
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions,
|
|
46
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
47
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
57
48
|
export default _default;
|
|
49
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -118,8 +118,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
118
118
|
default: boolean;
|
|
119
119
|
};
|
|
120
120
|
}>> & Readonly<{
|
|
121
|
-
onSort?: (...args: any[]) => any;
|
|
122
121
|
"onUpdate:selected"?: (...args: any[]) => any;
|
|
122
|
+
onSort?: (...args: any[]) => any;
|
|
123
123
|
}>, {
|
|
124
124
|
headers: unknown[];
|
|
125
125
|
data: unknown[];
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export default checkbox;
|
|
2
|
+
declare const checkbox: {
|
|
3
|
+
colorScheme: {
|
|
4
|
+
light: {
|
|
5
|
+
root: {
|
|
6
|
+
background: string;
|
|
7
|
+
checkedBackground: string;
|
|
8
|
+
checkedHoverBackground: string;
|
|
9
|
+
disabledBackground: string;
|
|
10
|
+
filledBackground: string;
|
|
11
|
+
borderColor: string;
|
|
12
|
+
hoverBorderColor: string;
|
|
13
|
+
focusBorderColor: string;
|
|
14
|
+
checkedBorderColor: string;
|
|
15
|
+
checkedHoverBorderColor: string;
|
|
16
|
+
checkedFocusBorderColor: string;
|
|
17
|
+
checkedDisabledBorderColor: string;
|
|
18
|
+
invalidBorderColor: string;
|
|
19
|
+
shadow: string;
|
|
20
|
+
focusRing: {
|
|
21
|
+
color: string;
|
|
22
|
+
shadow: string;
|
|
23
|
+
};
|
|
24
|
+
transitionDuration: string;
|
|
25
|
+
};
|
|
26
|
+
icon: {
|
|
27
|
+
color: string;
|
|
28
|
+
checkedColor: string;
|
|
29
|
+
checkedHoverColor: string;
|
|
30
|
+
disabledColor: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
dark: {
|
|
34
|
+
root: {
|
|
35
|
+
background: string;
|
|
36
|
+
checkedBackground: string;
|
|
37
|
+
checkedHoverBackground: string;
|
|
38
|
+
disabledBackground: string;
|
|
39
|
+
filledBackground: string;
|
|
40
|
+
borderColor: string;
|
|
41
|
+
hoverBorderColor: string;
|
|
42
|
+
focusBorderColor: string;
|
|
43
|
+
checkedBorderColor: string;
|
|
44
|
+
checkedHoverBorderColor: string;
|
|
45
|
+
checkedFocusBorderColor: string;
|
|
46
|
+
checkedDisabledBorderColor: string;
|
|
47
|
+
invalidBorderColor: string;
|
|
48
|
+
shadow: string;
|
|
49
|
+
focusRing: {
|
|
50
|
+
color: string;
|
|
51
|
+
shadow: string;
|
|
52
|
+
};
|
|
53
|
+
transitionDuration: string;
|
|
54
|
+
};
|
|
55
|
+
icon: {
|
|
56
|
+
color: string;
|
|
57
|
+
checkedColor: string;
|
|
58
|
+
checkedHoverColor: string;
|
|
59
|
+
disabledColor: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
root: {
|
|
64
|
+
borderRadius: string;
|
|
65
|
+
width: string;
|
|
66
|
+
height: string;
|
|
67
|
+
sm: {
|
|
68
|
+
width: string;
|
|
69
|
+
height: string;
|
|
70
|
+
};
|
|
71
|
+
lg: {
|
|
72
|
+
width: string;
|
|
73
|
+
height: string;
|
|
74
|
+
};
|
|
75
|
+
focusRing: {
|
|
76
|
+
width: string;
|
|
77
|
+
style: string;
|
|
78
|
+
offset: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
icon: {
|
|
82
|
+
size: string;
|
|
83
|
+
sm: {
|
|
84
|
+
size: string;
|
|
85
|
+
};
|
|
86
|
+
lg: {
|
|
87
|
+
size: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
@@ -4,8 +4,10 @@ declare namespace components {
|
|
|
4
4
|
export { autocomplete };
|
|
5
5
|
export { popover };
|
|
6
6
|
export { tooltip };
|
|
7
|
+
export { checkbox };
|
|
7
8
|
}
|
|
8
9
|
import button from './button/button.js';
|
|
9
10
|
import autocomplete from './autocomplete/autocomplete.js';
|
|
10
11
|
import popover from './popover/popover.js';
|
|
11
12
|
import tooltip from './tooltip/tooltip.js';
|
|
13
|
+
import checkbox from './checkbox/checkbox.js';
|