zartui 3.1.85 → 3.1.87

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/lib/zartui.cjs.js CHANGED
@@ -9227,9 +9227,13 @@ var stdin_default$14 = vue.defineComponent({
9227
9227
  const isStrValid = (text) => {
9228
9228
  return text !== null && text !== "" && Object.prototype.toString.call(text) === "[object String]";
9229
9229
  };
9230
+ const showSearchPopup = () => {
9231
+ updateOffset();
9232
+ show.value = true;
9233
+ };
9230
9234
  const onSearch = (value2) => {
9231
9235
  if (isStrValid(value2)) {
9232
- show.value = true;
9236
+ showSearchPopup();
9233
9237
  }
9234
9238
  };
9235
9239
  const onClickInput = (e) => {
@@ -9477,7 +9481,7 @@ var stdin_default$14 = vue.defineComponent({
9477
9481
  "onClickInput": onClickInput,
9478
9482
  "onSearch": onSearch,
9479
9483
  "onClear": clearSearch,
9480
- "onFocus": () => show.value = true,
9484
+ "onFocus": showSearchPopup,
9481
9485
  "autocomplete": "off"
9482
9486
  }, null), vue.withDirectives(vue.createVNode("div", {
9483
9487
  "class": [bem$L("wrap")],
@@ -16334,11 +16338,29 @@ var stdin_default$D = vue.defineComponent({
16334
16338
  const gridRef = vue.ref();
16335
16339
  const mediaListPlaceholder = vue.ref([]);
16336
16340
  const sort2 = vue.ref();
16337
- vue.watch(() => props.mediaList.length, () => {
16341
+ const shouldIsolateSortableTouch = () => props.sortable && props.mediaList.length > 0;
16342
+ const stopSortableTouchStartPropagation = (event) => {
16343
+ if (!shouldIsolateSortableTouch()) {
16344
+ return;
16345
+ }
16346
+ event.stopPropagation();
16347
+ };
16348
+ const destroySortable = () => {
16349
+ var _a;
16350
+ if ((_a = sort2.value) == null ? void 0 : _a.destroy) {
16351
+ sort2.value.destroy();
16352
+ }
16353
+ sort2.value = void 0;
16354
+ };
16355
+ const initSortable = () => __async$2(this, null, function* () {
16338
16356
  var _a;
16339
- if (sort2.value || !props.sortable)
16357
+ if (sort2.value || !props.sortable || !props.mediaList.length)
16358
+ return;
16359
+ yield vue.nextTick();
16360
+ const gridEl = (_a = gridRef.value) == null ? void 0 : _a.$el;
16361
+ if (!gridEl)
16340
16362
  return;
16341
- sort2.value = Sortable.create((_a = gridRef.value) == null ? void 0 : _a.$el, {
16363
+ sort2.value = Sortable.create(gridEl, {
16342
16364
  animation: 200,
16343
16365
  handle: ".zt-grid-item",
16344
16366
  onEnd: (evt) => {
@@ -17069,6 +17091,18 @@ var stdin_default$D = vue.defineComponent({
17069
17091
  actionVisible.value = false;
17070
17092
  action.func && action.func();
17071
17093
  };
17094
+ vue.watch(() => [props.sortable, props.mediaList.length], (_0) => __async$2(this, [_0], function* ([sortable, mediaCount]) {
17095
+ if (!sortable || !mediaCount) {
17096
+ destroySortable();
17097
+ return;
17098
+ }
17099
+ yield initSortable();
17100
+ }), {
17101
+ immediate: true
17102
+ });
17103
+ vue.onBeforeUnmount(() => {
17104
+ destroySortable();
17105
+ });
17072
17106
  useExpose({
17073
17107
  mediaPickAction,
17074
17108
  handleInputFiles,
@@ -17106,7 +17140,8 @@ var stdin_default$D = vue.defineComponent({
17106
17140
  "border": false,
17107
17141
  "square": true,
17108
17142
  "gutter": "4",
17109
- "class": bem$v("grid")
17143
+ "class": bem$v("grid"),
17144
+ "onTouchstart": stopSortableTouchStartPropagation
17110
17145
  }, {
17111
17146
  default: () => [renderMediaList()]
17112
17147
  }), [[vue.vShow, props.mediaList.length]]), vue.withDirectives(vue.createVNode(stdin_default$Y, {
@@ -23829,7 +23864,7 @@ const Lazyload = {
23829
23864
  });
23830
23865
  }
23831
23866
  };
23832
- const version = "3.1.85";
23867
+ const version = "3.1.87";
23833
23868
  function install(app) {
23834
23869
  const components = [
23835
23870
  ActionSheet,
package/lib/zartui.es.js CHANGED
@@ -9225,9 +9225,13 @@ var stdin_default$14 = defineComponent({
9225
9225
  const isStrValid = (text) => {
9226
9226
  return text !== null && text !== "" && Object.prototype.toString.call(text) === "[object String]";
9227
9227
  };
9228
+ const showSearchPopup = () => {
9229
+ updateOffset();
9230
+ show.value = true;
9231
+ };
9228
9232
  const onSearch = (value2) => {
9229
9233
  if (isStrValid(value2)) {
9230
- show.value = true;
9234
+ showSearchPopup();
9231
9235
  }
9232
9236
  };
9233
9237
  const onClickInput = (e) => {
@@ -9475,7 +9479,7 @@ var stdin_default$14 = defineComponent({
9475
9479
  "onClickInput": onClickInput,
9476
9480
  "onSearch": onSearch,
9477
9481
  "onClear": clearSearch,
9478
- "onFocus": () => show.value = true,
9482
+ "onFocus": showSearchPopup,
9479
9483
  "autocomplete": "off"
9480
9484
  }, null), withDirectives(createVNode("div", {
9481
9485
  "class": [bem$L("wrap")],
@@ -16332,11 +16336,29 @@ var stdin_default$D = defineComponent({
16332
16336
  const gridRef = ref();
16333
16337
  const mediaListPlaceholder = ref([]);
16334
16338
  const sort2 = ref();
16335
- watch(() => props.mediaList.length, () => {
16339
+ const shouldIsolateSortableTouch = () => props.sortable && props.mediaList.length > 0;
16340
+ const stopSortableTouchStartPropagation = (event) => {
16341
+ if (!shouldIsolateSortableTouch()) {
16342
+ return;
16343
+ }
16344
+ event.stopPropagation();
16345
+ };
16346
+ const destroySortable = () => {
16347
+ var _a;
16348
+ if ((_a = sort2.value) == null ? void 0 : _a.destroy) {
16349
+ sort2.value.destroy();
16350
+ }
16351
+ sort2.value = void 0;
16352
+ };
16353
+ const initSortable = () => __async$2(this, null, function* () {
16336
16354
  var _a;
16337
- if (sort2.value || !props.sortable)
16355
+ if (sort2.value || !props.sortable || !props.mediaList.length)
16356
+ return;
16357
+ yield nextTick();
16358
+ const gridEl = (_a = gridRef.value) == null ? void 0 : _a.$el;
16359
+ if (!gridEl)
16338
16360
  return;
16339
- sort2.value = Sortable.create((_a = gridRef.value) == null ? void 0 : _a.$el, {
16361
+ sort2.value = Sortable.create(gridEl, {
16340
16362
  animation: 200,
16341
16363
  handle: ".zt-grid-item",
16342
16364
  onEnd: (evt) => {
@@ -17067,6 +17089,18 @@ var stdin_default$D = defineComponent({
17067
17089
  actionVisible.value = false;
17068
17090
  action.func && action.func();
17069
17091
  };
17092
+ watch(() => [props.sortable, props.mediaList.length], (_0) => __async$2(this, [_0], function* ([sortable, mediaCount]) {
17093
+ if (!sortable || !mediaCount) {
17094
+ destroySortable();
17095
+ return;
17096
+ }
17097
+ yield initSortable();
17098
+ }), {
17099
+ immediate: true
17100
+ });
17101
+ onBeforeUnmount(() => {
17102
+ destroySortable();
17103
+ });
17070
17104
  useExpose({
17071
17105
  mediaPickAction,
17072
17106
  handleInputFiles,
@@ -17104,7 +17138,8 @@ var stdin_default$D = defineComponent({
17104
17138
  "border": false,
17105
17139
  "square": true,
17106
17140
  "gutter": "4",
17107
- "class": bem$v("grid")
17141
+ "class": bem$v("grid"),
17142
+ "onTouchstart": stopSortableTouchStartPropagation
17108
17143
  }, {
17109
17144
  default: () => [renderMediaList()]
17110
17145
  }), [[vShow, props.mediaList.length]]), withDirectives(createVNode(stdin_default$Y, {
@@ -23827,7 +23862,7 @@ const Lazyload = {
23827
23862
  });
23828
23863
  }
23829
23864
  };
23830
- const version = "3.1.85";
23865
+ const version = "3.1.87";
23831
23866
  function install(app) {
23832
23867
  const components = [
23833
23868
  ActionSheet,
package/lib/zartui.js CHANGED
@@ -9476,9 +9476,13 @@ var __publicField = (obj, key, value) => {
9476
9476
  const isStrValid = (text) => {
9477
9477
  return text !== null && text !== "" && Object.prototype.toString.call(text) === "[object String]";
9478
9478
  };
9479
+ const showSearchPopup = () => {
9480
+ updateOffset();
9481
+ show.value = true;
9482
+ };
9479
9483
  const onSearch = (value2) => {
9480
9484
  if (isStrValid(value2)) {
9481
- show.value = true;
9485
+ showSearchPopup();
9482
9486
  }
9483
9487
  };
9484
9488
  const onClickInput = (e) => {
@@ -9726,7 +9730,7 @@ var __publicField = (obj, key, value) => {
9726
9730
  "onClickInput": onClickInput,
9727
9731
  "onSearch": onSearch,
9728
9732
  "onClear": clearSearch,
9729
- "onFocus": () => show.value = true,
9733
+ "onFocus": showSearchPopup,
9730
9734
  "autocomplete": "off"
9731
9735
  }, null), vue.withDirectives(vue.createVNode("div", {
9732
9736
  "class": [bem$L("wrap")],
@@ -21563,11 +21567,29 @@ var __publicField = (obj, key, value) => {
21563
21567
  const gridRef = vue.ref();
21564
21568
  const mediaListPlaceholder = vue.ref([]);
21565
21569
  const sort = vue.ref();
21566
- vue.watch(() => props.mediaList.length, () => {
21570
+ const shouldIsolateSortableTouch = () => props.sortable && props.mediaList.length > 0;
21571
+ const stopSortableTouchStartPropagation = (event) => {
21572
+ if (!shouldIsolateSortableTouch()) {
21573
+ return;
21574
+ }
21575
+ event.stopPropagation();
21576
+ };
21577
+ const destroySortable = () => {
21578
+ var _a;
21579
+ if ((_a = sort.value) == null ? void 0 : _a.destroy) {
21580
+ sort.value.destroy();
21581
+ }
21582
+ sort.value = void 0;
21583
+ };
21584
+ const initSortable = () => __async$2(this, null, function* () {
21567
21585
  var _a;
21568
- if (sort.value || !props.sortable)
21586
+ if (sort.value || !props.sortable || !props.mediaList.length)
21587
+ return;
21588
+ yield vue.nextTick();
21589
+ const gridEl = (_a = gridRef.value) == null ? void 0 : _a.$el;
21590
+ if (!gridEl)
21569
21591
  return;
21570
- sort.value = Sortable.create((_a = gridRef.value) == null ? void 0 : _a.$el, {
21592
+ sort.value = Sortable.create(gridEl, {
21571
21593
  animation: 200,
21572
21594
  handle: ".zt-grid-item",
21573
21595
  onEnd: (evt) => {
@@ -22298,6 +22320,18 @@ var __publicField = (obj, key, value) => {
22298
22320
  actionVisible.value = false;
22299
22321
  action.func && action.func();
22300
22322
  };
22323
+ vue.watch(() => [props.sortable, props.mediaList.length], (_0) => __async$2(this, [_0], function* ([sortable, mediaCount]) {
22324
+ if (!sortable || !mediaCount) {
22325
+ destroySortable();
22326
+ return;
22327
+ }
22328
+ yield initSortable();
22329
+ }), {
22330
+ immediate: true
22331
+ });
22332
+ vue.onBeforeUnmount(() => {
22333
+ destroySortable();
22334
+ });
22301
22335
  useExpose({
22302
22336
  mediaPickAction,
22303
22337
  handleInputFiles,
@@ -22335,7 +22369,8 @@ var __publicField = (obj, key, value) => {
22335
22369
  "border": false,
22336
22370
  "square": true,
22337
22371
  "gutter": "4",
22338
- "class": bem$v("grid")
22372
+ "class": bem$v("grid"),
22373
+ "onTouchstart": stopSortableTouchStartPropagation
22339
22374
  }, {
22340
22375
  default: () => [renderMediaList()]
22341
22376
  }), [[vue.vShow, props.mediaList.length]]), vue.withDirectives(vue.createVNode(stdin_default$Y, {
@@ -31342,7 +31377,7 @@ var __publicField = (obj, key, value) => {
31342
31377
  });
31343
31378
  }
31344
31379
  };
31345
- const version = "3.1.85";
31380
+ const version = "3.1.87";
31346
31381
  function install(app) {
31347
31382
  const components = [
31348
31383
  ActionSheet,