@varlet/ui 2.12.0-alpha.1688105697429 → 2.12.0

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/fab/Fab.mjs CHANGED
@@ -91,8 +91,8 @@ export default defineComponent({
91
91
  };
92
92
  var renderFab = () => {
93
93
  var _slot;
94
- var _slots$default;
95
- var children = flatFragment((_slots$default = slots.default == null ? void 0 : slots.default()) != null ? _slots$default : []);
94
+ var _call;
95
+ var children = flatFragment((_call = call(slots.default)) != null ? _call : []);
96
96
  return _createVNode("div", _mergeProps({
97
97
  "class": classes(n(), n("--position-" + props.position), n("--direction-" + props.direction), [props.fixed, n('--fixed'), n('--absolute')], [props.safeArea, n('--safe-area')]),
98
98
  "style": {
@@ -41,6 +41,7 @@ function __render__(_ctx, _cache) {
41
41
  onRouteChange: _ctx.onRouteChange
42
42
  }, {
43
43
  default: _withCtx(() => [_createVNode(_component_var_swipe, _mergeProps({
44
+ ref: "swipeRef",
44
45
  class: _ctx.n('swipe'),
45
46
  "var-image-preview-cover": "",
46
47
  touchable: _ctx.canSwipe,
@@ -121,10 +122,16 @@ var __sfc__ = defineComponent({
121
122
  setup(props) {
122
123
  var popupShow = ref(false);
123
124
  var initialIndex = computed(() => {
125
+ // For compatibility with current, temporarily keep this computed method
126
+ // Current will be replaced by initialIndex in the future
124
127
  var {
125
128
  images,
126
- current
129
+ current,
130
+ initialIndex
127
131
  } = props;
132
+ if (initialIndex != null) {
133
+ return toNumber(initialIndex);
134
+ }
128
135
  var index = images.findIndex(image => image === current);
129
136
  return index >= 0 ? index : 0;
130
137
  });
@@ -134,6 +141,7 @@ var __sfc__ = defineComponent({
134
141
  var transitionTimingFunction = ref(undefined);
135
142
  var transitionDuration = ref(undefined);
136
143
  var canSwipe = ref(true);
144
+ var swipeRef = ref(null);
137
145
  var startTouch = null;
138
146
  var prevTouch = null;
139
147
  var closeRunner = null;
@@ -311,6 +319,24 @@ var __sfc__ = defineComponent({
311
319
  }
312
320
  call(props['onUpdate:show'], false);
313
321
  };
322
+
323
+ // expose
324
+ var prev = options => {
325
+ var _swipeRef$value;
326
+ (_swipeRef$value = swipeRef.value) == null ? void 0 : _swipeRef$value.prev(options);
327
+ };
328
+
329
+ // expose
330
+ var next = options => {
331
+ var _swipeRef$value2;
332
+ (_swipeRef$value2 = swipeRef.value) == null ? void 0 : _swipeRef$value2.next(options);
333
+ };
334
+
335
+ // expose
336
+ var to = (idx, options) => {
337
+ var _swipeRef$value3;
338
+ (_swipeRef$value3 = swipeRef.value) == null ? void 0 : _swipeRef$value3.to(idx, options);
339
+ };
314
340
  var preventImageDefault = event => {
315
341
  props.imagePreventDefault && props.show && event.preventDefault();
316
342
  };
@@ -336,7 +362,10 @@ var __sfc__ = defineComponent({
336
362
  handleTouchmove,
337
363
  handleTouchend,
338
364
  handleTouchcancel,
339
- close
365
+ close,
366
+ prev,
367
+ next,
368
+ to
340
369
  };
341
370
  }
342
371
  });
@@ -15,9 +15,14 @@ export var props = _extends({
15
15
  type: Array,
16
16
  default: () => []
17
17
  },
18
+ /** @deprecated Use initialIndex to instead. */
18
19
  current: {
19
20
  type: String
20
21
  },
22
+ initialIndex: {
23
+ type: [String, Number],
24
+ default: 0
25
+ },
21
26
  zoom: {
22
27
  type: [String, Number],
23
28
  default: 2
@@ -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.12.0-alpha.1688105697429'
244
+ const version = '2.12.0'
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.12.0-alpha.1688105697429'
163
+ const version = '2.12.0'
164
164
 
165
165
  function install(app) {
166
166
  ActionSheet.install && app.use(ActionSheet)