@avakhula/ui 0.0.289 → 0.0.290
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 +485 -478
- package/dist/index.umd.cjs +18 -18
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Form/Checkbox/Checkbox.scss +14 -10
- package/src/components/Form/Checkbox/Checkbox.vue +8 -1
- package/src/components/TreeSelect/Option.vue +1 -0
- package/src/components/TreeSelect/Select.stories.js +1 -0
- package/src/components/TreeSelect/Select.vue +3 -2
package/package.json
CHANGED
|
@@ -130,12 +130,13 @@ $checkbox-bg-indeterminate: $blue-800;
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
&.checkbox-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
133
|
+
// &.checkbox-readonly,
|
|
134
|
+
// &.checkbox-disabled {
|
|
135
|
+
// .checkbox-input {
|
|
136
|
+
// background-color: $checkbox-bg-filed-disabled;
|
|
137
|
+
// border-color: $checkbox-border-filed-disabled;
|
|
138
|
+
// }
|
|
139
|
+
// }
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
&.ib-checkbox-indeterminate {
|
|
@@ -165,6 +166,7 @@ $checkbox-bg-indeterminate: $blue-800;
|
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
168
|
|
|
169
|
+
&.ib-checkbox-readonly,
|
|
168
170
|
&.ib-checkbox-disabled {
|
|
169
171
|
cursor: not-allowed;
|
|
170
172
|
|
|
@@ -198,10 +200,6 @@ $checkbox-bg-indeterminate: $blue-800;
|
|
|
198
200
|
}
|
|
199
201
|
}
|
|
200
202
|
|
|
201
|
-
.ib-checkbox-label {
|
|
202
|
-
color: $checkbox-text-color-disabled;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
203
|
&.ib-checkbox-filled,
|
|
206
204
|
&.ib-checkbox-indeterminate{
|
|
207
205
|
.ib-checkbox-input {
|
|
@@ -220,6 +218,12 @@ $checkbox-bg-indeterminate: $blue-800;
|
|
|
220
218
|
}
|
|
221
219
|
}
|
|
222
220
|
}
|
|
221
|
+
|
|
222
|
+
&.ib-checkbox-disabled {
|
|
223
|
+
.ib-checkbox-label {
|
|
224
|
+
color: $checkbox-text-color-disabled;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
223
227
|
}
|
|
224
228
|
|
|
225
229
|
&.ib-has-error {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
:checked="checked"
|
|
16
16
|
:disabled="disabled"
|
|
17
17
|
:required="required"
|
|
18
|
-
@click="onChange"
|
|
18
|
+
@click.prevent="onChange"
|
|
19
19
|
/>
|
|
20
20
|
<div class="ib-checkbox-body">
|
|
21
21
|
<span
|
|
@@ -80,6 +80,10 @@ export default {
|
|
|
80
80
|
type: Boolean,
|
|
81
81
|
default: false,
|
|
82
82
|
},
|
|
83
|
+
readonly: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false,
|
|
86
|
+
},
|
|
83
87
|
disabled: {
|
|
84
88
|
type: Boolean,
|
|
85
89
|
default: false,
|
|
@@ -112,6 +116,8 @@ export default {
|
|
|
112
116
|
},
|
|
113
117
|
methods: {
|
|
114
118
|
onChange() {
|
|
119
|
+
if (this.readonly) return;
|
|
120
|
+
|
|
115
121
|
this.checked = !this.checked;
|
|
116
122
|
this.$emit("update:modelValue", this.checked);
|
|
117
123
|
this.$emit("input", this.checked);
|
|
@@ -124,6 +130,7 @@ export default {
|
|
|
124
130
|
"ib-has-error": this.error,
|
|
125
131
|
"ib-checkbox-filled": this.checked,
|
|
126
132
|
"ib-checkbox-disabled": this.disabled,
|
|
133
|
+
"ib-checkbox-readonly": this.readonly,
|
|
127
134
|
"ib-checkbox-indeterminate": this.indeterminate,
|
|
128
135
|
};
|
|
129
136
|
},
|
|
@@ -459,7 +459,7 @@ export default {
|
|
|
459
459
|
}
|
|
460
460
|
},
|
|
461
461
|
options(newOptions) {
|
|
462
|
-
|
|
462
|
+
this.initialOptions = copy(newOptions);
|
|
463
463
|
},
|
|
464
464
|
initialOptions(newOptions) {
|
|
465
465
|
let isOptionsEqual = true;
|
|
@@ -830,7 +830,7 @@ export default {
|
|
|
830
830
|
this.$refs.dropdown.close();
|
|
831
831
|
},
|
|
832
832
|
checkIfOptionsChecked(options) {
|
|
833
|
-
return options.every((option) => option.checked);
|
|
833
|
+
return options.every((option) => option.checked || option.readonly);
|
|
834
834
|
},
|
|
835
835
|
registerCheck(option, isChecked, isDirectChild) {
|
|
836
836
|
if (isChecked) {
|
|
@@ -880,6 +880,7 @@ export default {
|
|
|
880
880
|
manageAll() {
|
|
881
881
|
this.allOptionsIsChecked = !this.allOptionsIsChecked;
|
|
882
882
|
this.traverseTree(this.actualOptions, (option) => {
|
|
883
|
+
if (option.readonly) return;
|
|
883
884
|
this.registerCheck(option, this.allOptionsIsChecked, false);
|
|
884
885
|
});
|
|
885
886
|
},
|