@avakhula/ui 0.0.141 → 0.0.143
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 +128 -124
- package/dist/index.umd.cjs +11 -11
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.vue +15 -46
- package/src/components/Alert/Alert.vue +15 -5
- package/src/components/Form/Radio/Radio.vue +9 -9
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -1,56 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<
|
|
4
|
-
<ib-label
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<ib-input id="first_name" name="first_name"
|
|
9
|
-
v-tooltip="'Cannot be edited because user info were synchronized from another LMS.'"
|
|
10
|
-
readonly />
|
|
11
|
-
</ib-form-group>
|
|
12
|
-
|
|
13
|
-
<ib-form-group class="form-group">
|
|
14
|
-
<ib-label for="first_name" required>
|
|
15
|
-
test
|
|
16
|
-
</ib-label>
|
|
17
|
-
|
|
18
|
-
<ib-input id="first_name" name="first_name"
|
|
19
|
-
v-tooltip="'Cannot be edited because user info were synchronized from another LMS.'"
|
|
20
|
-
readonly />
|
|
21
|
-
</ib-form-group>
|
|
2
|
+
<div class="test">
|
|
3
|
+
<div>
|
|
4
|
+
<ib-radio value="a" label="Item 1" name="Checkbox" v-bind="{}" />
|
|
5
|
+
<ib-radio isChecked style="margin-left: 15px" value="b" label="Item 2" name="Checkbox" v-bind="{}" />
|
|
6
|
+
</div>
|
|
22
7
|
</div>
|
|
23
8
|
</template>
|
|
24
9
|
|
|
25
10
|
<script>
|
|
26
|
-
import
|
|
27
|
-
|
|
11
|
+
import IbRadio from "./components/Form/Radio/Radio.vue";
|
|
12
|
+
|
|
28
13
|
export default {
|
|
29
|
-
directives: {
|
|
30
|
-
Tooltip
|
|
31
|
-
},
|
|
32
|
-
methods: {
|
|
33
|
-
test() {
|
|
34
|
-
console.log('test')
|
|
35
|
-
},
|
|
36
|
-
test1() {
|
|
37
|
-
console.log('test')
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
14
|
components: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
15
|
+
IbRadio
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
46
19
|
</script>
|
|
47
20
|
|
|
48
|
-
<style
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
height: 100vh;
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
justify-content: center;
|
|
21
|
+
<style>
|
|
22
|
+
.test {
|
|
23
|
+
padding-top: 110vh;
|
|
55
24
|
}
|
|
56
|
-
</style>
|
|
25
|
+
</style>
|
|
@@ -56,12 +56,22 @@ export default {
|
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
mounted() {
|
|
59
|
-
|
|
60
|
-
this.checkHeight();
|
|
61
|
-
}, 1000);
|
|
59
|
+
this.checkHeight();
|
|
62
60
|
|
|
61
|
+
if (this.$refs.content) {
|
|
62
|
+
this.contentObserver = new ResizeObserver(() => {
|
|
63
|
+
this.checkHeight();
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
this.contentObserver.observe(this.$refs.content);
|
|
67
|
+
}
|
|
63
68
|
window.addEventListener("resize", () => this.checkHeight());
|
|
64
69
|
},
|
|
70
|
+
data() {
|
|
71
|
+
return {
|
|
72
|
+
contentObserver: null,
|
|
73
|
+
};
|
|
74
|
+
},
|
|
65
75
|
methods: {
|
|
66
76
|
close() {
|
|
67
77
|
this.$emit("close");
|
|
@@ -76,11 +86,10 @@ export default {
|
|
|
76
86
|
|
|
77
87
|
if (!parentWidth || !contentStyle) return;
|
|
78
88
|
|
|
79
|
-
console.log(contentStyle.width, 'contentStyle.width', 'parentWidth', parentWidth)
|
|
80
89
|
if (parseInt(contentStyle.width) <= parentWidth) {
|
|
81
90
|
this.$refs.content.classList.remove("large");
|
|
82
91
|
}
|
|
83
|
-
|
|
92
|
+
|
|
84
93
|
if (parseInt(contentStyle.height) > 37) {
|
|
85
94
|
this.$refs.content.classList.add("large");
|
|
86
95
|
}
|
|
@@ -122,6 +131,7 @@ export default {
|
|
|
122
131
|
},
|
|
123
132
|
},
|
|
124
133
|
beforeUnmount() {
|
|
134
|
+
this.contentObserver?.disconnect();
|
|
125
135
|
window.removeEventListener("resize", () => this.checkHeight());
|
|
126
136
|
},
|
|
127
137
|
components: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<label :class="classes" :for="id">
|
|
2
|
+
<label :class="classes" :for="id" @click.prevent="onClick">
|
|
3
3
|
<input
|
|
4
4
|
type="radio"
|
|
5
5
|
:name="name"
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
:disabled="disabled"
|
|
10
10
|
ref="radio"
|
|
11
11
|
@input.stop
|
|
12
|
-
@click="onClick"
|
|
13
12
|
@change="onChange"
|
|
14
13
|
/>
|
|
15
14
|
<span class="ib-radio-body" :class="{ 'without-text': !label?.length }">
|
|
@@ -62,32 +61,33 @@ export default {
|
|
|
62
61
|
},
|
|
63
62
|
},
|
|
64
63
|
mounted() {
|
|
65
|
-
this.$globalEvents.$on(
|
|
66
|
-
if (
|
|
67
|
-
this.checked =
|
|
64
|
+
this.$globalEvents.$on(`radio:update:${this.name}`, (uid) => {
|
|
65
|
+
if (this.uid !== uid) {
|
|
66
|
+
this.checked = false;
|
|
68
67
|
}
|
|
69
68
|
});
|
|
70
69
|
},
|
|
71
70
|
data() {
|
|
72
71
|
return {
|
|
73
72
|
checked: this.isChecked,
|
|
73
|
+
uid: generateUID(),
|
|
74
74
|
};
|
|
75
75
|
},
|
|
76
76
|
methods: {
|
|
77
77
|
onClick() {
|
|
78
78
|
if (!this.disabled) {
|
|
79
|
-
this.checked = this
|
|
79
|
+
this.checked = !this.checked;
|
|
80
|
+
this.$globalEvents.$emit(`radio:update:${this.name}`, this.uid);
|
|
80
81
|
this.$emit("input", this.checked);
|
|
81
82
|
this.$emit("change", this.checked);
|
|
82
|
-
this.$globalEvents.$emit("radio:update", this.name);
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
onChange() {
|
|
86
86
|
if (!this.disabled) {
|
|
87
|
-
this.checked = this
|
|
87
|
+
this.checked = !this.checked;
|
|
88
|
+
this.$globalEvents.$emit(`radio:update:${this.name}`, this.uid);
|
|
88
89
|
this.$emit("change", this.checked);
|
|
89
90
|
this.$emit("input", this.checked);
|
|
90
|
-
this.$globalEvents.$emit("radio:update", this.name);
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
},
|