@varlet/ui 2.11.1-alpha.1684493331817 → 2.11.1

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.
@@ -241,7 +241,7 @@ import './time-picker/style/index.mjs'
241
241
  import './tooltip/style/index.mjs'
242
242
  import './uploader/style/index.mjs'
243
243
 
244
- const version = '2.11.1-alpha.1684493331817'
244
+ const version = '2.11.1'
245
245
 
246
246
  function install(app) {
247
247
  ActionSheet.install && app.use(ActionSheet)
package/es/index.mjs CHANGED
@@ -160,7 +160,7 @@ export * from './time-picker/index.mjs'
160
160
  export * from './tooltip/index.mjs'
161
161
  export * from './uploader/index.mjs'
162
162
 
163
- const version = '2.11.1-alpha.1684493331817'
163
+ const version = '2.11.1'
164
164
 
165
165
  function install(app) {
166
166
  ActionSheet.install && app.use(ActionSheet)
@@ -20,7 +20,7 @@ import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createT
20
20
 
21
21
  var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
22
22
 
23
- var _hoisted_1 = ["onTouchstart", "onTouchmove", "onTouchend"];
23
+ var _hoisted_1 = ["onTouchstartPassive", "onTouchmove", "onTouchend"];
24
24
  var _hoisted_2 = ["onTransitionend"];
25
25
  var _hoisted_3 = ["onClick"];
26
26
 
@@ -94,7 +94,7 @@ function __render__(_ctx, _cache) {
94
94
  return _openBlock(), _createElementBlock("div", {
95
95
  class: _normalizeClass(_ctx.n('column')),
96
96
  key: c.id,
97
- onTouchstart: $event => _ctx.handleTouchstart($event, c),
97
+ onTouchstartPassive: $event => _ctx.handleTouchstart(c),
98
98
  onTouchmove: _withModifiers($event => _ctx.handleTouchmove($event, c), ["prevent"]),
99
99
  onTouchend: $event => _ctx.handleTouchend($event, c)
100
100
  }, [_createElementVNode("div", {
@@ -249,10 +249,8 @@ var __sfc__ = defineComponent({
249
249
  scrollTo(scrollColumn, TRANSITION_DURATION);
250
250
  };
251
251
 
252
- var handleTouchstart = (event, scrollColumn) => {
252
+ var handleTouchstart = scrollColumn => {
253
253
  scrollColumn.touching = true;
254
- scrollColumn.scrolling = false;
255
- scrollColumn.duration = 0;
256
254
  scrollColumn.translate = getTranslateY(scrollColumn.scrollEl);
257
255
  };
258
256
 
@@ -262,6 +260,8 @@ var __sfc__ = defineComponent({
262
260
  }
263
261
 
264
262
  dragging = true;
263
+ scrollColumn.scrolling = false;
264
+ scrollColumn.duration = 0;
265
265
  var {
266
266
  clientY
267
267
  } = event.touches[0];
@@ -377,12 +377,23 @@ var __sfc__ = defineComponent({
377
377
  createChildren(scrollColumns.value, scrollColumn.columns[scrollColumn.index].children, scrollColumn.columnIndex + 1);
378
378
  };
379
379
 
380
+ var isSamePicked = () => {
381
+ var {
382
+ indexes
383
+ } = getPicked();
384
+ return indexes.every((index, idx) => index === prevIndexes[idx]);
385
+ };
386
+
380
387
  var change = scrollColumn => {
381
388
  var {
382
389
  cascade,
383
390
  onChange
384
391
  } = props;
385
392
 
393
+ if (isSamePicked()) {
394
+ return;
395
+ }
396
+
386
397
  if (cascade) {
387
398
  rebuildChildren(scrollColumn);
388
399
  }
@@ -391,18 +402,13 @@ var __sfc__ = defineComponent({
391
402
 
392
403
  if (hasScrolling) {
393
404
  return;
394
- }
405
+ } // rebuild will update the value of picked, so need to get the latest value again.
406
+
395
407
 
396
408
  var {
397
409
  texts,
398
410
  indexes
399
411
  } = getPicked();
400
- var samePicked = indexes.every((index, idx) => index === prevIndexes[idx]);
401
-
402
- if (samePicked) {
403
- return;
404
- }
405
-
406
412
  prevIndexes = [...indexes];
407
413
  call(onChange, texts, indexes);
408
414
  };
@@ -170,7 +170,9 @@ export function createNamespace(name) {
170
170
  var componentName = namespace + "-" + name;
171
171
 
172
172
  var createBEM = suffix => {
173
- if (!suffix) return componentName;
173
+ if (!suffix) {
174
+ return componentName;
175
+ }
174
176
 
175
177
  if (suffix[0] === '$') {
176
178
  return suffix.replace('$', namespace);