@varlet/ui 3.18.1 → 3.18.2
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/es/action-sheet/style/index.mjs +1 -1
- package/es/checkbox/Checkbox.mjs +50 -24
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/radio/Radio.mjs +31 -8
- package/es/slider/Slider.mjs +1 -1
- package/es/switch/Switch.mjs +1 -1
- package/es/varlet.esm.js +3272 -3236
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +1 -1
- package/lib/varlet.cjs.js +105 -56
- package/package.json +7 -7
- package/umd/varlet.js +6 -6
package/es/checkbox/Checkbox.mjs
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
1
21
|
import { call, preventDefault } from "@varlet/shared";
|
|
2
22
|
import { useEventListener, useVModel } from "@varlet/use";
|
|
3
23
|
import { computed, defineComponent, nextTick, ref } from "vue";
|
|
@@ -156,32 +176,38 @@ const __sfc__ = defineComponent({
|
|
|
156
176
|
});
|
|
157
177
|
}
|
|
158
178
|
function change(changedValue) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
179
|
+
return __async(this, null, function* () {
|
|
180
|
+
const { checkedValue: checkedValue2, onChange } = props2;
|
|
181
|
+
value.value = changedValue;
|
|
182
|
+
changedValue === checkedValue2 ? checkboxGroup == null ? void 0 : checkboxGroup.onChecked(checkedValue2) : checkboxGroup == null ? void 0 : checkboxGroup.onUnchecked(checkedValue2);
|
|
183
|
+
yield nextTick();
|
|
184
|
+
call(onChange, changedValue, isIndeterminate.value);
|
|
185
|
+
validateWithTrigger("onChange");
|
|
186
|
+
});
|
|
164
187
|
}
|
|
165
188
|
function handleClick(e) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
isIndeterminate.value
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
189
|
+
return __async(this, null, function* () {
|
|
190
|
+
const { disabled, readonly, checkedValue: checkedValue2, uncheckedValue, onClick } = props2;
|
|
191
|
+
if ((form == null ? void 0 : form.disabled.value) || disabled) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
call(onClick, e);
|
|
195
|
+
if ((form == null ? void 0 : form.readonly.value) || readonly) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (isIndeterminate.value === true) {
|
|
199
|
+
isIndeterminate.value = false;
|
|
200
|
+
yield nextTick();
|
|
201
|
+
call(props2.onChange, value.value, isIndeterminate.value);
|
|
202
|
+
validateWithTrigger("onChange");
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const maximum = checkboxGroup ? checkboxGroup.checkedCount.value >= Number(checkboxGroup.max.value) : false;
|
|
206
|
+
if (!checked.value && maximum) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
change(checked.value ? uncheckedValue : checkedValue2);
|
|
210
|
+
});
|
|
185
211
|
}
|
|
186
212
|
function handleTextClick() {
|
|
187
213
|
checkbox.value.focus();
|
package/es/index.bundle.mjs
CHANGED
|
@@ -304,7 +304,7 @@ import './tree-menu/style/index.mjs'
|
|
|
304
304
|
import './uploader/style/index.mjs'
|
|
305
305
|
import './watermark/style/index.mjs'
|
|
306
306
|
|
|
307
|
-
const version = '3.18.
|
|
307
|
+
const version = '3.18.2'
|
|
308
308
|
|
|
309
309
|
function install(app) {
|
|
310
310
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -202,7 +202,7 @@ export * from './tree-menu/index.mjs'
|
|
|
202
202
|
export * from './uploader/index.mjs'
|
|
203
203
|
export * from './watermark/index.mjs'
|
|
204
204
|
|
|
205
|
-
const version = '3.18.
|
|
205
|
+
const version = '3.18.2'
|
|
206
206
|
|
|
207
207
|
function install(app) {
|
|
208
208
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/radio/Radio.mjs
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
1
21
|
import { call, preventDefault } from "@varlet/shared";
|
|
2
22
|
import { useEventListener, useVModel } from "@varlet/use";
|
|
3
23
|
import { computed, defineComponent, nextTick, ref } from "vue";
|
|
@@ -190,14 +210,17 @@ const __sfc__ = defineComponent({
|
|
|
190
210
|
});
|
|
191
211
|
}
|
|
192
212
|
function change(changedValue) {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
213
|
+
return __async(this, null, function* () {
|
|
214
|
+
const { checkedValue, onChange } = props2;
|
|
215
|
+
if (radioGroup && value.value === checkedValue) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
value.value = changedValue;
|
|
219
|
+
radioGroup == null ? void 0 : radioGroup.onToggle(checkedValue);
|
|
220
|
+
yield nextTick();
|
|
221
|
+
call(onChange, changedValue);
|
|
222
|
+
validateWithTrigger("onChange");
|
|
223
|
+
});
|
|
201
224
|
}
|
|
202
225
|
function handleClick(e) {
|
|
203
226
|
const { disabled, readonly, uncheckedValue, checkedValue, onClick } = props2;
|
package/es/slider/Slider.mjs
CHANGED
|
@@ -346,8 +346,8 @@ const __sfc__ = defineComponent({
|
|
|
346
346
|
item.handleHovering(value);
|
|
347
347
|
}
|
|
348
348
|
function emitChange(value) {
|
|
349
|
-
call(props2.onChange, value);
|
|
350
349
|
call(props2["onUpdate:modelValue"], value);
|
|
350
|
+
call(props2.onChange, value);
|
|
351
351
|
validateWithTrigger();
|
|
352
352
|
}
|
|
353
353
|
function setPercent(moveDistance, type) {
|
package/es/switch/Switch.mjs
CHANGED