@varlet/ui 3.18.0 → 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.
@@ -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
- const { checkedValue: checkedValue2, onChange } = props2;
160
- value.value = changedValue;
161
- call(onChange, value.value, isIndeterminate.value);
162
- validateWithTrigger("onChange");
163
- changedValue === checkedValue2 ? checkboxGroup == null ? void 0 : checkboxGroup.onChecked(checkedValue2) : checkboxGroup == null ? void 0 : checkboxGroup.onUnchecked(checkedValue2);
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
- const { disabled, readonly, checkedValue: checkedValue2, uncheckedValue, onClick } = props2;
167
- if ((form == null ? void 0 : form.disabled.value) || disabled) {
168
- return;
169
- }
170
- call(onClick, e);
171
- if ((form == null ? void 0 : form.readonly.value) || readonly) {
172
- return;
173
- }
174
- if (isIndeterminate.value === true) {
175
- isIndeterminate.value = false;
176
- call(props2.onChange, value.value, isIndeterminate.value);
177
- validateWithTrigger("onChange");
178
- return;
179
- }
180
- const maximum = checkboxGroup ? checkboxGroup.checkedCount.value >= Number(checkboxGroup.max.value) : false;
181
- if (!checked.value && maximum) {
182
- return;
183
- }
184
- change(checked.value ? uncheckedValue : checkedValue2);
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();
@@ -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.0'
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.0'
205
+ const version = '3.18.2'
206
206
 
207
207
  function install(app) {
208
208
  ActionSheet.install && app.use(ActionSheet)
@@ -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
- const { checkedValue, onChange } = props2;
194
- if (radioGroup && value.value === checkedValue) {
195
- return;
196
- }
197
- value.value = changedValue;
198
- call(onChange, value.value);
199
- radioGroup == null ? void 0 : radioGroup.onToggle(checkedValue);
200
- validateWithTrigger("onChange");
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;
@@ -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) {
@@ -1,7 +1,7 @@
1
1
  import '../../styles/common.css'
2
+ import '../SnackbarSfc.css'
2
3
  import '../../styles/elevation.css'
3
4
  import '../../loading/loading.css'
4
5
  import '../../icon/icon.css'
5
6
  import '../snackbar.css'
6
7
  import '../coreSfc.css'
7
- import '../SnackbarSfc.css'
@@ -222,8 +222,8 @@ const __sfc__ = defineComponent({
222
222
  validateWithTrigger("onLazyChange");
223
223
  });
224
224
  } else {
225
- call(onChange, newValue);
226
225
  call(updateModelValue, newValue);
226
+ call(onChange, newValue);
227
227
  validateWithTrigger("onChange");
228
228
  }
229
229
  }
@@ -13,7 +13,7 @@ var stdin_default = {
13
13
  "--data-table-sort-trigger-hover-background": "hsla(var(--hsl-primary), 0.12)",
14
14
  "--data-table-empty-text-color": "var(--color-text-disabled)",
15
15
  "--data-table-resize-trigger-color": "hsla(var(--hsl-on-surface-variant), 0.36)",
16
- "--data-table-fixed-shadow-color": "rgba(0, 0, 0, 0.04)",
16
+ "--data-table-fixed-shadow-color": "rgba(0, 0, 0, 0.14)",
17
17
  "--data-table-border-radius": "2px",
18
18
  "--data-table-cell-normal-padding": "8px 16px",
19
19
  "--data-table-cell-small-padding": "4px 16px",
@@ -13,7 +13,7 @@ var stdin_default = {
13
13
  "--data-table-sort-trigger-hover-background": "hsla(var(--hsl-primary), 0.12)",
14
14
  "--data-table-empty-text-color": "var(--color-text-disabled)",
15
15
  "--data-table-resize-trigger-color": "hsla(var(--hsl-on-surface-variant), 0.36)",
16
- "--data-table-fixed-shadow-color": "rgba(0, 0, 0, 0.04)",
16
+ "--data-table-fixed-shadow-color": "rgba(0, 0, 0, 0.14)",
17
17
  "--data-table-border-radius": "2px",
18
18
  "--data-table-cell-normal-padding": "8px 16px",
19
19
  "--data-table-cell-small-padding": "4px 16px",