@avakhula/ui 0.0.229 → 0.0.232
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/index.js +300 -299
- package/dist/index.umd.cjs +31 -31
- package/package.json +1 -1
- package/src/App.vue +136 -24
- package/src/components/Button/Button.vue +2 -2
- package/src/components/IconButton/IconButton.vue +2 -1
- package/src/components/TreeSelect/Option.vue +13 -11
- package/src/components/TreeSelect/Select.vue +30 -26
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
{{ selectedRoles }}
|
|
3
3
|
|
|
4
|
+
<ib-select
|
|
5
|
+
:options="opt"
|
|
6
|
+
/>
|
|
7
|
+
|
|
8
|
+
<button @click="selectedRoles = []">resset</button>
|
|
4
9
|
</template>
|
|
5
10
|
|
|
6
11
|
<script>
|
|
@@ -10,8 +15,6 @@ const testData1 = [
|
|
|
10
15
|
id: "1",
|
|
11
16
|
title: "A Education",
|
|
12
17
|
is_category: true,
|
|
13
|
-
initiallyVisible: true,
|
|
14
|
-
visible: true,
|
|
15
18
|
isDisabled: false,
|
|
16
19
|
checked: true,
|
|
17
20
|
isChildrenVisible: true,
|
|
@@ -20,8 +23,6 @@ const testData1 = [
|
|
|
20
23
|
id: "2",
|
|
21
24
|
title: "Education 2",
|
|
22
25
|
is_category: true,
|
|
23
|
-
initiallyVisible: true,
|
|
24
|
-
visible: true,
|
|
25
26
|
isDisabled: false,
|
|
26
27
|
checked: false,
|
|
27
28
|
isChildrenVisible: true,
|
|
@@ -30,8 +31,6 @@ const testData1 = [
|
|
|
30
31
|
id: "3",
|
|
31
32
|
title: "Education 3",
|
|
32
33
|
is_category: true,
|
|
33
|
-
initiallyVisible: true,
|
|
34
|
-
visible: true,
|
|
35
34
|
isDisabled: false,
|
|
36
35
|
checked: false,
|
|
37
36
|
isChildrenVisible: true,
|
|
@@ -40,8 +39,6 @@ const testData1 = [
|
|
|
40
39
|
id: "4",
|
|
41
40
|
title: "Education 4",
|
|
42
41
|
is_category: true,
|
|
43
|
-
initiallyVisible: true,
|
|
44
|
-
visible: true,
|
|
45
42
|
isDisabled: false,
|
|
46
43
|
checked: false,
|
|
47
44
|
isChildrenVisible: true,
|
|
@@ -50,8 +47,6 @@ const testData1 = [
|
|
|
50
47
|
id: "5",
|
|
51
48
|
title: "Education 5",
|
|
52
49
|
is_category: true,
|
|
53
|
-
initiallyVisible: true,
|
|
54
|
-
visible: true,
|
|
55
50
|
isDisabled: false,
|
|
56
51
|
checked: false,
|
|
57
52
|
isChildrenVisible: true,
|
|
@@ -61,8 +56,6 @@ const testData1 = [
|
|
|
61
56
|
id: "6",
|
|
62
57
|
title: "Education 6",
|
|
63
58
|
is_category: true,
|
|
64
|
-
initiallyVisible: true,
|
|
65
|
-
visible: true,
|
|
66
59
|
isDisabled: false,
|
|
67
60
|
checked: false,
|
|
68
61
|
isChildrenVisible: true,
|
|
@@ -72,8 +65,6 @@ const testData1 = [
|
|
|
72
65
|
id: "7",
|
|
73
66
|
title: "Education 7",
|
|
74
67
|
is_category: true,
|
|
75
|
-
initiallyVisible: true,
|
|
76
|
-
visible: true,
|
|
77
68
|
isDisabled: false,
|
|
78
69
|
checked: false,
|
|
79
70
|
isChildrenVisible: true,
|
|
@@ -83,8 +74,6 @@ const testData1 = [
|
|
|
83
74
|
id: "8",
|
|
84
75
|
title: "Education 8",
|
|
85
76
|
is_category: true,
|
|
86
|
-
initiallyVisible: true,
|
|
87
|
-
visible: true,
|
|
88
77
|
isDisabled: false,
|
|
89
78
|
checked: false,
|
|
90
79
|
isChildrenVisible: true,
|
|
@@ -93,8 +82,6 @@ const testData1 = [
|
|
|
93
82
|
id: "9",
|
|
94
83
|
title: "Education 9",
|
|
95
84
|
is_category: true,
|
|
96
|
-
initiallyVisible: true,
|
|
97
|
-
visible: true,
|
|
98
85
|
isDisabled: false,
|
|
99
86
|
checked: false,
|
|
100
87
|
isChildrenVisible: true,
|
|
@@ -103,8 +90,6 @@ const testData1 = [
|
|
|
103
90
|
id: "10",
|
|
104
91
|
title: "Education 10",
|
|
105
92
|
is_category: true,
|
|
106
|
-
initiallyVisible: true,
|
|
107
|
-
visible: true,
|
|
108
93
|
isDisabled: false,
|
|
109
94
|
checked: false,
|
|
110
95
|
isChildrenVisible: true,
|
|
@@ -113,17 +98,144 @@ const testData1 = [
|
|
|
113
98
|
id: "11",
|
|
114
99
|
title: "Education 11",
|
|
115
100
|
is_category: true,
|
|
116
|
-
initiallyVisible: true,
|
|
117
|
-
visible: true,
|
|
118
101
|
isDisabled: false,
|
|
119
102
|
checked: false,
|
|
120
103
|
isChildrenVisible: true,
|
|
121
104
|
},
|
|
122
105
|
];
|
|
106
|
+
|
|
107
|
+
const testData = [
|
|
108
|
+
{
|
|
109
|
+
id: "category_id_2",
|
|
110
|
+
title: "Education",
|
|
111
|
+
is_category: true,
|
|
112
|
+
children: [
|
|
113
|
+
{
|
|
114
|
+
id: "category_id_19",
|
|
115
|
+
title: "Test1",
|
|
116
|
+
is_category: true,
|
|
117
|
+
children: [
|
|
118
|
+
{
|
|
119
|
+
id: 139,
|
|
120
|
+
title: "Test Course 1",
|
|
121
|
+
selected: false,
|
|
122
|
+
isDisabled: false,
|
|
123
|
+
checked: false,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: 300,
|
|
127
|
+
title: "Course for unenrollmemt test",
|
|
128
|
+
selected: false,
|
|
129
|
+
isDisabled: false,
|
|
130
|
+
checked: false,
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
isDisabled: false,
|
|
134
|
+
checked: false,
|
|
135
|
+
isChildrenVisible: true,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: 15,
|
|
139
|
+
title: "History",
|
|
140
|
+
selected: false,
|
|
141
|
+
isDisabled: false,
|
|
142
|
+
checked: false,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: 17,
|
|
146
|
+
title: "Algebra 101",
|
|
147
|
+
selected: false,
|
|
148
|
+
isDisabled: false,
|
|
149
|
+
checked: false,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: 29,
|
|
153
|
+
title: "Music",
|
|
154
|
+
selected: false,
|
|
155
|
+
isDisabled: false,
|
|
156
|
+
checked: false,
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: 30,
|
|
160
|
+
title: "Astronomy",
|
|
161
|
+
selected: false,
|
|
162
|
+
isDisabled: false,
|
|
163
|
+
checked: false,
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
id: 31,
|
|
167
|
+
title: "Pharmacology",
|
|
168
|
+
selected: false,
|
|
169
|
+
isDisabled: false,
|
|
170
|
+
checked: false,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: 32,
|
|
174
|
+
title: "German Basics",
|
|
175
|
+
selected: false,
|
|
176
|
+
isDisabled: false,
|
|
177
|
+
checked: false,
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
isDisabled: false,
|
|
181
|
+
checked: false,
|
|
182
|
+
isChildrenVisible: true,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
id: 43234,
|
|
186
|
+
title: "German Basics 1",
|
|
187
|
+
selected: false,
|
|
188
|
+
isDisabled: false,
|
|
189
|
+
checked: false,
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: 434,
|
|
193
|
+
title: "German Basics 2",
|
|
194
|
+
selected: false,
|
|
195
|
+
isDisabled: false,
|
|
196
|
+
checked: false,
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
id: 4324,
|
|
200
|
+
title: "German Basics 3",
|
|
201
|
+
selected: false,
|
|
202
|
+
isDisabled: false,
|
|
203
|
+
checked: false,
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: 41224,
|
|
207
|
+
title: "German Basics 4",
|
|
208
|
+
selected: false,
|
|
209
|
+
isDisabled: false,
|
|
210
|
+
checked: false,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: 990,
|
|
214
|
+
title: "German Basics 5",
|
|
215
|
+
selected: false,
|
|
216
|
+
isDisabled: false,
|
|
217
|
+
checked: false,
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: 122324,
|
|
221
|
+
title: "German Basics 6",
|
|
222
|
+
selected: false,
|
|
223
|
+
isDisabled: false,
|
|
224
|
+
checked: false,
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: 9123123,
|
|
228
|
+
title: "German Basics 7",
|
|
229
|
+
selected: false,
|
|
230
|
+
isDisabled: false,
|
|
231
|
+
checked: false,
|
|
232
|
+
},
|
|
233
|
+
];
|
|
123
234
|
export default {
|
|
124
235
|
data() {
|
|
125
236
|
return {
|
|
126
|
-
opt:
|
|
237
|
+
opt: testData,
|
|
238
|
+
selectedRolesVal: []
|
|
127
239
|
}
|
|
128
240
|
},
|
|
129
241
|
components: {IbSelect}
|
|
@@ -146,7 +146,7 @@ export default {
|
|
|
146
146
|
return classList;
|
|
147
147
|
},
|
|
148
148
|
attrs() {
|
|
149
|
-
const attrsList =
|
|
149
|
+
const attrsList = removeEvents({ ...this.$attrs }, ['onClick']);
|
|
150
150
|
|
|
151
151
|
attrsList.class = [...this.classes, attrsList.class];
|
|
152
152
|
attrsList.disabled = this.isDisabled;
|
|
@@ -164,7 +164,7 @@ export default {
|
|
|
164
164
|
return this.linkMethod === "GET" ? "GET" : "POST";
|
|
165
165
|
},
|
|
166
166
|
token() {
|
|
167
|
-
return document.head.querySelector('meta[name="csrf-token"]')
|
|
167
|
+
return document.head.querySelector('meta[name="csrf-token"]')?.content;
|
|
168
168
|
},
|
|
169
169
|
},
|
|
170
170
|
inheritAttrs: false,
|
|
@@ -85,7 +85,8 @@ export default {
|
|
|
85
85
|
return classList;
|
|
86
86
|
},
|
|
87
87
|
attrs() {
|
|
88
|
-
const attrsList =
|
|
88
|
+
const attrsList = removeEvents({ ...this.$attrs }, ['onClick']);
|
|
89
|
+
|
|
89
90
|
attrsList.class = [...this.classes, attrsList.class];
|
|
90
91
|
|
|
91
92
|
if (this.disabledFocus) {
|
|
@@ -275,6 +275,17 @@ export default {
|
|
|
275
275
|
else return Checkbox;
|
|
276
276
|
},
|
|
277
277
|
isChecked() {
|
|
278
|
+
if(this.hasChildren) {
|
|
279
|
+
if (!this.childrenSelectedCount) {
|
|
280
|
+
return false;
|
|
281
|
+
} else if (
|
|
282
|
+
this.childrenSelectedCount > 0 &&
|
|
283
|
+
this.countOfAllChildren > this.childrenSelectedCount
|
|
284
|
+
) {
|
|
285
|
+
return null; //null will trigger indeterminate stage
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
278
289
|
if (this.option.checked) {
|
|
279
290
|
return true;
|
|
280
291
|
}
|
|
@@ -283,19 +294,10 @@ export default {
|
|
|
283
294
|
return null; //null will trigger indeterminate stage
|
|
284
295
|
}
|
|
285
296
|
|
|
286
|
-
|
|
287
|
-
return false;
|
|
288
|
-
} else if (
|
|
289
|
-
this.childrenSelectedCount > 0 &&
|
|
290
|
-
this.countOfAllChildren > this.childrenSelectedCount
|
|
291
|
-
) {
|
|
292
|
-
return null; //null will trigger indeterminate stage
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
return true;
|
|
297
|
+
return false;
|
|
296
298
|
},
|
|
297
299
|
hasChildren() {
|
|
298
|
-
return this.option.children && this.option.children.length;
|
|
300
|
+
return Boolean(this.option.children && this.option.children.length);
|
|
299
301
|
},
|
|
300
302
|
hasVisibleChildren() {
|
|
301
303
|
return this.calculateChildren(this.option, (item) => item.visible);
|
|
@@ -46,11 +46,15 @@
|
|
|
46
46
|
</span>
|
|
47
47
|
</template>
|
|
48
48
|
</div>
|
|
49
|
+
|
|
49
50
|
<ib-icon-button
|
|
50
51
|
v-if="showClearButton"
|
|
51
52
|
kind="ghost"
|
|
52
53
|
class="button-clear"
|
|
53
54
|
@click.prevent="clearValue"
|
|
55
|
+
@keypress.enter.stop.prevent
|
|
56
|
+
@keydown.enter.stop.prevent
|
|
57
|
+
@keyup.enter.prevent="clearValue"
|
|
54
58
|
:help-text="clearButtonMessage"
|
|
55
59
|
v-show="Object.keys(selected).length"
|
|
56
60
|
>
|
|
@@ -212,7 +216,7 @@
|
|
|
212
216
|
:html-title="htmlOptionTitle"
|
|
213
217
|
:show-input="showInputs"
|
|
214
218
|
>
|
|
215
|
-
|
|
219
|
+
<select-option
|
|
216
220
|
v-show="option.visible"
|
|
217
221
|
:option="option"
|
|
218
222
|
:is-toggle="isToggle"
|
|
@@ -657,6 +661,8 @@ export default {
|
|
|
657
661
|
this.$emit("update:modelValue", null);
|
|
658
662
|
},
|
|
659
663
|
clearValue() {
|
|
664
|
+
console.log('test')
|
|
665
|
+
|
|
660
666
|
this.clear();
|
|
661
667
|
this.setPreparedValues();
|
|
662
668
|
},
|
|
@@ -733,36 +739,34 @@ export default {
|
|
|
733
739
|
});
|
|
734
740
|
},
|
|
735
741
|
filterFunc(options, filterString) {
|
|
736
|
-
|
|
737
|
-
let isVisible =
|
|
738
|
-
option.initiallyVisible &&
|
|
739
|
-
option.title.toString().toLowerCase().includes(filterString) &&
|
|
740
|
-
!this.actualBookmarkedOptions[option.id];
|
|
742
|
+
let visibleOptionsCount = 0;
|
|
741
743
|
|
|
742
|
-
|
|
743
|
-
let
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
if (visibleChildrenCount) {
|
|
749
|
-
option.isChildrenVisible =
|
|
750
|
-
!!filterString ||
|
|
751
|
-
Boolean(Object.keys(this.actualBookmarkedOptions).length);
|
|
752
|
-
option.isDisabled =
|
|
753
|
-
visibleChildrenCount < option.children.length &&
|
|
754
|
-
!this.isBookmarkable;
|
|
755
|
-
}
|
|
744
|
+
options.forEach(option => {
|
|
745
|
+
let isVisible = option.initiallyVisible && option.title && option.title.toString().toLowerCase().includes(filterString) && !this.actualBookmarkedOptions[option.id];
|
|
746
|
+
|
|
747
|
+
if (option.children && option.children.length) {
|
|
748
|
+
let visibleChildrenCount = this.filterFunc(option.children, filterString);
|
|
749
|
+
visibleOptionsCount += visibleChildrenCount;
|
|
756
750
|
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
751
|
+
if (visibleChildrenCount) {
|
|
752
|
+
option.isChildrenVisible = !!filterString || Boolean(Object.keys(this.actualBookmarkedOptions).length);
|
|
753
|
+
option.isDisabled = visibleChildrenCount < option.children.length && !this.isBookmarkable;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
if (!isVisible) {
|
|
757
|
+
isVisible = !!visibleChildrenCount;
|
|
758
|
+
} else if (!visibleChildrenCount) {
|
|
759
|
+
isVisible = false;
|
|
760
|
+
}
|
|
761
761
|
}
|
|
762
|
-
}
|
|
763
762
|
|
|
764
|
-
|
|
763
|
+
option.visible = isVisible;
|
|
764
|
+
|
|
765
|
+
if (isVisible) {
|
|
766
|
+
visibleOptionsCount++;
|
|
767
|
+
}
|
|
765
768
|
});
|
|
769
|
+
return visibleOptionsCount;
|
|
766
770
|
},
|
|
767
771
|
submit() {
|
|
768
772
|
this.change();
|