plugin-ui-for-kzt 0.0.22 → 0.0.23
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/BaseBadge/BaseBadge.vue.d.ts +1 -1
- package/dist/components/BaseButton/BaseButton.vue.d.ts +3 -3
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +4 -4
- package/dist/components/BaseDropdown/BaseDropdown.vue.d.ts +3 -3
- package/dist/components/BaseField/BaseField.vue.d.ts +2 -2
- package/dist/components/BaseInput/BaseInput.vue.d.ts +6 -6
- package/dist/components/BaseInputCalendar/BaseInputCalendar.vue.d.ts +5 -5
- package/dist/components/BaseInputCurrency/BaseInputCurrency.vue.d.ts +6 -6
- package/dist/components/BaseInputEmail/BaseInputEmail.vue.d.ts +5 -5
- package/dist/components/BaseInputPhone/BaseInputPhone.vue.d.ts +5 -5
- package/dist/components/BaseOpenedListItem/BaseOpenedListItem.vue.d.ts +3 -3
- package/dist/components/BasePagination/BasePagination.vue.d.ts +1 -1
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +4 -4
- package/dist/components/BaseSegmentedButtons/BaseSegmentedButtons.vue.d.ts +3 -3
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +4 -4
- package/dist/components/BaseTabs/BaseTabs.vue.d.ts +25 -0
- package/dist/components/BaseTag/BaseTag.vue.d.ts +1 -1
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +5 -5
- package/dist/components/BaseToggle/BaseToggle.vue.d.ts +4 -4
- package/dist/components/BaseUpload/BaseUpload.vue.d.ts +11 -0
- package/dist/components/BaseUpload/CropModal.vue.d.ts +9 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +15 -0
- package/example/App.vue +37 -31
- package/example/TestImage.vue +6 -0
- package/package.json +2 -1
- package/src/components/BaseCheckbox/BaseCheckbox.vue +76 -46
- package/src/components/BaseRadio/BaseRadio.vue +266 -233
- package/src/components/BaseTabs/BaseTabs.vue +193 -0
- package/src/components/BaseUpload/BaseUpload.vue +35 -1
- package/src/components/BaseUpload/CropModal.vue +210 -0
- package/src/index.ts +5 -2
- package/src/types/tab.d.ts +17 -0
- package/src/types/uploadedFile.d.ts +7 -0
|
@@ -1 +1,16 @@
|
|
|
1
1
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
2
|
+
|
|
3
|
+
/*! *****************************************************************************
|
|
4
|
+
Copyright (c) Microsoft Corporation.
|
|
5
|
+
|
|
6
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
+
purpose with or without fee is hereby granted.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
***************************************************************************** */
|
package/example/App.vue
CHANGED
|
@@ -1,43 +1,49 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="demo-page">
|
|
3
3
|
<h1>Plugin UI KZT - Компоненты</h1>
|
|
4
|
-
<section>
|
|
5
|
-
|
|
6
|
-
v-model="currentSlide"
|
|
7
|
-
:options="options"
|
|
8
|
-
size="extra-small"
|
|
9
|
-
/>
|
|
10
|
-
<br/>
|
|
11
|
-
<base-segmented-buttons
|
|
12
|
-
v-model="currentSlide"
|
|
13
|
-
:options="options"
|
|
14
|
-
size="small"
|
|
15
|
-
/>
|
|
16
|
-
<br/>
|
|
17
|
-
<base-segmented-buttons
|
|
18
|
-
v-model="currentSlide"
|
|
19
|
-
:options="options"
|
|
20
|
-
size="medium"
|
|
21
|
-
/>
|
|
22
|
-
<br/>
|
|
23
|
-
<base-segmented-buttons
|
|
24
|
-
v-model="currentSlide"
|
|
25
|
-
:options="options"
|
|
26
|
-
size="large"
|
|
27
|
-
/>
|
|
4
|
+
<section style="display: flex; flex-direction: column; gap: 10px;">
|
|
5
|
+
<base-upload :enableCrop="true" :crop-texts="{ cancel: 'Cancel', confirm: 'Apply' }" :accepted-formats="accept" :on-update:files="onFilesUpdate" />
|
|
28
6
|
</section>
|
|
29
7
|
</div>
|
|
30
8
|
</template>
|
|
31
9
|
<script setup lang="ts">
|
|
32
|
-
import { ref } from 'vue';
|
|
10
|
+
import { ref, markRaw } from 'vue';
|
|
11
|
+
import TestImage from './TestImage.vue';
|
|
33
12
|
|
|
34
|
-
const
|
|
35
|
-
{ value: '0', label: 'Компоненты', disabled: true },
|
|
36
|
-
{ value: '1', label: 'Композиции' },
|
|
37
|
-
{ value: '2', label: 'Стили' },
|
|
38
|
-
];
|
|
13
|
+
const accept = ['.png', '.jpg', '.jpeg', '.pdf', '.doc', '.docx'];
|
|
39
14
|
|
|
40
|
-
const
|
|
15
|
+
const uploadedFiles = ref<{ name: string; size: number; file: File }[]>([]);
|
|
16
|
+
|
|
17
|
+
const onFilesUpdate = (files: typeof uploadedFiles.value) => {
|
|
18
|
+
uploadedFiles.value = files;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const activeTab = ref(2);
|
|
22
|
+
const options = ref([
|
|
23
|
+
{
|
|
24
|
+
title: 'title 1',
|
|
25
|
+
id: 1,
|
|
26
|
+
icon: markRaw(TestImage),
|
|
27
|
+
disabled: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: 'title 2',
|
|
31
|
+
id: 2,
|
|
32
|
+
icon: markRaw(TestImage),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: 'title 4',
|
|
36
|
+
id: 4,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: 'title 5',
|
|
40
|
+
id: 5,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: 'title 6',
|
|
44
|
+
id: 6,
|
|
45
|
+
},
|
|
46
|
+
])
|
|
41
47
|
</script>
|
|
42
48
|
|
|
43
49
|
<style lang="scss" scoped>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path d="M15.7999 2.20999C15.3899 1.79999 14.6799 2.07999 14.6799 2.64999V6.13999C14.6799 7.59999 15.9199 8.80999 17.4299 8.80999C18.3799 8.81999 19.6999 8.81999 20.8299 8.81999C21.3999 8.81999 21.6999 8.14999 21.2999 7.74999C19.8599 6.29999 17.2799 3.68999 15.7999 2.20999Z" fill="currentColor"/>
|
|
4
|
+
<path d="M20.5 10.19H17.61C15.24 10.19 13.31 8.26 13.31 5.89V3C13.31 2.45 12.86 2 12.31 2H8.07C4.99 2 2.5 4 2.5 7.57V16.43C2.5 20 4.99 22 8.07 22H15.93C19.01 22 21.5 20 21.5 16.43V11.19C21.5 10.64 21.05 10.19 20.5 10.19ZM11.5 17.75H7.5C7.09 17.75 6.75 17.41 6.75 17C6.75 16.59 7.09 16.25 7.5 16.25H11.5C11.91 16.25 12.25 16.59 12.25 17C12.25 17.41 11.91 17.75 11.5 17.75ZM13.5 13.75H7.5C7.09 13.75 6.75 13.41 6.75 13C6.75 12.59 7.09 12.25 7.5 12.25H13.5C13.91 12.25 14.25 12.59 14.25 13C14.25 13.41 13.91 13.75 13.5 13.75Z" fill="currentColor"/>
|
|
5
|
+
</svg>
|
|
6
|
+
</template>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plugin-ui-for-kzt",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"description": "plugin-ui for kazaktelekom",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"maska": "^3.1.1",
|
|
52
52
|
"pinia": "^2.3.1",
|
|
53
53
|
"vue": "^3.0.0",
|
|
54
|
+
"vue-advanced-cropper": "^2.8.9",
|
|
54
55
|
"vue-virtual-scroller": "^2.0.0-beta.8"
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -4,29 +4,25 @@
|
|
|
4
4
|
:class="classList"
|
|
5
5
|
>
|
|
6
6
|
<div class="base-checkbox__wrapper" @click="handleToggle">
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class="base-checkbox__input"
|
|
14
|
-
/>
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<div class="base-checkbox__icon-wrapper">
|
|
18
|
-
<base-icon
|
|
19
|
-
class="base-checkbox__icon"
|
|
20
|
-
name="checkbox"
|
|
21
|
-
:size="size"
|
|
7
|
+
<div class="base-checkbox__input-wrapper">
|
|
8
|
+
<input
|
|
9
|
+
v-model="model"
|
|
10
|
+
v-bind="inputAttrs"
|
|
11
|
+
type="checkbox"
|
|
12
|
+
class="base-checkbox__input"
|
|
22
13
|
/>
|
|
14
|
+
<div class="base-checkbox__icon-wrapper">
|
|
15
|
+
<base-icon
|
|
16
|
+
class="base-checkbox__icon"
|
|
17
|
+
name="checkbox"
|
|
18
|
+
size="custom"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
23
21
|
</div>
|
|
24
|
-
|
|
25
22
|
<div class="base-checkbox__label-wrapper">
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</div>
|
|
23
|
+
<span v-if="label" class="base-checkbox__label">{{ label }}</span>
|
|
24
|
+
<span v-if="subLabel" class="base-checkbox__sublabel">{{ subLabel }}</span>
|
|
25
|
+
</div>
|
|
30
26
|
</div>
|
|
31
27
|
</div>
|
|
32
28
|
</template>
|
|
@@ -39,42 +35,42 @@ import { useAttrs, computed } from 'vue';
|
|
|
39
35
|
import BaseIcon from '../BaseIcon/BaseIcon.vue';
|
|
40
36
|
|
|
41
37
|
const props = withDefaults(defineProps<IBaseRadioProps>(), {
|
|
42
|
-
|
|
38
|
+
size: 'medium',
|
|
43
39
|
});
|
|
44
40
|
|
|
45
41
|
const emit = defineEmits<{
|
|
46
|
-
|
|
42
|
+
(e: 'update:modelValue', value: boolean): void;
|
|
47
43
|
}>();
|
|
48
44
|
|
|
49
45
|
const { sizeClassList } = useKitSize(props);
|
|
50
46
|
const { stateClassList, stateAttrs } = useKitState(props);
|
|
51
47
|
|
|
52
48
|
const model = computed({
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
get: () => props.modelValue,
|
|
50
|
+
set: (val) => emit('update:modelValue', val),
|
|
55
51
|
});
|
|
56
52
|
|
|
57
53
|
const attrs = useAttrs();
|
|
58
54
|
|
|
59
55
|
const inputAttrs = computed(() => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
return {
|
|
57
|
+
...attrs,
|
|
58
|
+
...stateAttrs.value,
|
|
59
|
+
id: props.id,
|
|
60
|
+
};
|
|
65
61
|
});
|
|
66
62
|
|
|
67
63
|
function handleToggle() {
|
|
68
|
-
|
|
64
|
+
model.value = !model.value;
|
|
69
65
|
}
|
|
70
66
|
|
|
71
67
|
const classList = computed(() => [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
sizeClassList.value,
|
|
69
|
+
stateClassList.value,
|
|
70
|
+
{
|
|
71
|
+
'--is-active': model.value,
|
|
72
|
+
'--is-readonly': props.readonly,
|
|
73
|
+
},
|
|
78
74
|
]);
|
|
79
75
|
</script>
|
|
80
76
|
|
|
@@ -85,8 +81,6 @@ const classList = computed(() => [
|
|
|
85
81
|
.base-checkbox {
|
|
86
82
|
$item: &;
|
|
87
83
|
|
|
88
|
-
--icon-size: 18px;
|
|
89
|
-
|
|
90
84
|
&__wrapper {
|
|
91
85
|
display: flex;
|
|
92
86
|
column-gap: 10px;
|
|
@@ -99,31 +93,36 @@ const classList = computed(() => [
|
|
|
99
93
|
pointer-events: none;
|
|
100
94
|
}
|
|
101
95
|
|
|
102
|
-
&.--
|
|
96
|
+
&.--small-size {
|
|
103
97
|
#{$item} {
|
|
104
98
|
&__wrapper {
|
|
105
|
-
column-gap: var(--spacing-
|
|
99
|
+
column-gap: var(--spacing-s);
|
|
106
100
|
}
|
|
107
101
|
|
|
108
102
|
&__label {
|
|
109
|
-
font: var(--typography-text-
|
|
103
|
+
font: var(--typography-text-s-medium);
|
|
110
104
|
}
|
|
111
105
|
|
|
112
106
|
&__sublabel {
|
|
113
|
-
font: var(--typography-text-
|
|
107
|
+
font: var(--typography-text-xs-regular);
|
|
114
108
|
}
|
|
115
109
|
|
|
116
110
|
&__icon-wrapper {
|
|
117
|
-
width:
|
|
118
|
-
height:
|
|
111
|
+
width: 20px;
|
|
112
|
+
height: 20px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&__icon {
|
|
116
|
+
width: 15px;
|
|
117
|
+
height: 15px;
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
|
|
123
|
-
&.--
|
|
122
|
+
&.--medium-size {
|
|
124
123
|
#{$item} {
|
|
125
124
|
&__wrapper {
|
|
126
|
-
column-gap: var(--spacing-
|
|
125
|
+
column-gap: var(--spacing-m);
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
&__label {
|
|
@@ -138,6 +137,37 @@ const classList = computed(() => [
|
|
|
138
137
|
width: 24px;
|
|
139
138
|
height: 24px;
|
|
140
139
|
}
|
|
140
|
+
|
|
141
|
+
&__icon {
|
|
142
|
+
width: 18px;
|
|
143
|
+
height: 18px;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&.--large-size {
|
|
149
|
+
#{$item} {
|
|
150
|
+
&__wrapper {
|
|
151
|
+
column-gap: var(--spacing-l);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&__label {
|
|
155
|
+
font: var(--typography-text-m-medium);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&__sublabel {
|
|
159
|
+
font: var(--typography-text-s-regular);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&__icon-wrapper {
|
|
163
|
+
width: 32px;
|
|
164
|
+
height: 32px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&__icon {
|
|
168
|
+
width: 22.4px;
|
|
169
|
+
height: 22.4px;
|
|
170
|
+
}
|
|
141
171
|
}
|
|
142
172
|
}
|
|
143
173
|
|