@avakhula/ui 0.0.252 → 0.0.254
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 +18 -10
- package/dist/index.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.vue +16 -12
- package/src/components/Form/Toggle/Toggle.vue +1 -0
- package/src/components/TreeSelect/Select.vue +20 -8
- package/src/components/TreeSelect/scss/select.scss +7 -0
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
name="email"
|
|
6
|
-
@input="val => console.log(val)"
|
|
7
|
-
@blur="val => console.log(val)"
|
|
8
|
-
/>
|
|
2
|
+
<div class="test">
|
|
3
|
+
<limit-selector />
|
|
4
|
+
</div>
|
|
9
5
|
</template>
|
|
10
6
|
|
|
11
7
|
<script>
|
|
12
|
-
import
|
|
13
|
-
|
|
8
|
+
import LimitSelector from "./components/Pagination/LimitSelector.vue"
|
|
14
9
|
export default {
|
|
15
10
|
components: {
|
|
16
|
-
|
|
17
|
-
}
|
|
11
|
+
LimitSelector
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<style lang="scss">
|
|
18
|
+
.test {
|
|
19
|
+
height: 100vh;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: end;
|
|
18
22
|
}
|
|
19
|
-
</
|
|
23
|
+
</style>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
:vertical="vertical"
|
|
11
11
|
ref="dropdown"
|
|
12
12
|
@close="onClose"
|
|
13
|
-
@open="
|
|
13
|
+
@open="onOpen"
|
|
14
14
|
>
|
|
15
15
|
<template v-if="hasTrigger" v-slot:trigger>
|
|
16
16
|
<slot v-bind:selected-count="selectedKeys.length" name="trigger"></slot>
|
|
@@ -374,9 +374,10 @@ export default {
|
|
|
374
374
|
type: Boolean,
|
|
375
375
|
default: false,
|
|
376
376
|
},
|
|
377
|
-
vertical: {
|
|
378
|
-
|
|
379
|
-
|
|
377
|
+
// vertical: {
|
|
378
|
+
// type: String,
|
|
379
|
+
// default: "bottom"
|
|
380
|
+
// },
|
|
380
381
|
emptyMessage: {
|
|
381
382
|
type: String,
|
|
382
383
|
default: "",
|
|
@@ -415,7 +416,9 @@ export default {
|
|
|
415
416
|
watch: {
|
|
416
417
|
value(value) {
|
|
417
418
|
this.val = value;
|
|
418
|
-
this.
|
|
419
|
+
if (!Array.isArray(value) || value.join(',') !== Object.keys(this.selected).join(',')) {
|
|
420
|
+
this.setPreparedValues(this.actualOptions, false);
|
|
421
|
+
}
|
|
419
422
|
},
|
|
420
423
|
modelValue(value) {
|
|
421
424
|
this.val = value;
|
|
@@ -513,6 +516,7 @@ export default {
|
|
|
513
516
|
actualBookmarkedOptions: {},
|
|
514
517
|
selected: [],
|
|
515
518
|
isOpen: false,
|
|
519
|
+
vertical: "bottom",
|
|
516
520
|
allOptionsIsChecked: true,
|
|
517
521
|
hasTreeChildren: false,
|
|
518
522
|
uid: `f${(~~(Math.random() * 1e8)).toString(16)}`,
|
|
@@ -636,7 +640,6 @@ export default {
|
|
|
636
640
|
filter(filterString, options) {
|
|
637
641
|
this.filterString = filterString;
|
|
638
642
|
this.$emit("search", { search: this.filterString });
|
|
639
|
-
console.log(options, filterString, 'test')
|
|
640
643
|
this.defaultFilter(options);
|
|
641
644
|
},
|
|
642
645
|
setPreparedValues(opt) {
|
|
@@ -754,7 +757,6 @@ export default {
|
|
|
754
757
|
|
|
755
758
|
options.forEach(option => {
|
|
756
759
|
let isVisible = option.initiallyVisible && option.title && option.title.toString().toLowerCase().includes(filterString) && !this.actualBookmarkedOptions[option.id];
|
|
757
|
-
console.log(option, option.initiallyVisible, option.title, option.title.toString().toLowerCase().includes(filterString), !this.actualBookmarkedOptions[option.id])
|
|
758
760
|
|
|
759
761
|
if (option.children && option.children.length) {
|
|
760
762
|
let visibleChildrenCount = this.filterFunc(option.children, filterString);
|
|
@@ -778,7 +780,6 @@ export default {
|
|
|
778
780
|
visibleOptionsCount++;
|
|
779
781
|
}
|
|
780
782
|
});
|
|
781
|
-
|
|
782
783
|
return visibleOptionsCount;
|
|
783
784
|
},
|
|
784
785
|
submit() {
|
|
@@ -911,6 +912,17 @@ export default {
|
|
|
911
912
|
}
|
|
912
913
|
this.$emit("blur");
|
|
913
914
|
},
|
|
915
|
+
onOpen() {
|
|
916
|
+
const screenHeight = document.documentElement.scrollHeight;
|
|
917
|
+
this.isOpen = true;
|
|
918
|
+
|
|
919
|
+
this.$nextTick(() => {
|
|
920
|
+
const newScreenHeight = document.documentElement.scrollHeight
|
|
921
|
+
if(newScreenHeight > screenHeight) {
|
|
922
|
+
this.vertical = "top"
|
|
923
|
+
}
|
|
924
|
+
})
|
|
925
|
+
}
|
|
914
926
|
},
|
|
915
927
|
computed: {
|
|
916
928
|
hasTrigger() {
|