zartui 3.1.84 → 3.1.86
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/drawer-select/DrawerSelect.d.ts +45 -2
- package/es/drawer-select/DrawerSelect.mjs +163 -3
- package/es/drawer-select/index.css +1 -1
- package/es/drawer-select/index.d.ts +32 -2
- package/es/drawer-select/types.d.ts +22 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/media-picker/MediaPicker.mjs +36 -5
- package/lib/drawer-select/DrawerSelect.d.ts +45 -2
- package/lib/drawer-select/DrawerSelect.js +163 -3
- package/lib/drawer-select/index.css +1 -1
- package/lib/drawer-select/index.d.ts +32 -2
- package/lib/drawer-select/types.d.ts +22 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/media-picker/MediaPicker.js +35 -4
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +198 -8
- package/lib/zartui.es.js +198 -8
- package/lib/zartui.js +198 -8
- package/lib/zartui.min.js +2 -2
- package/package.json +6 -6
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -184,7 +184,7 @@ __reExport(stdin_exports, require("./timeline"), module.exports);
|
|
|
184
184
|
__reExport(stdin_exports, require("./toast"), module.exports);
|
|
185
185
|
__reExport(stdin_exports, require("./uploader"), module.exports);
|
|
186
186
|
__reExport(stdin_exports, require("./video"), module.exports);
|
|
187
|
-
const version = "3.1.
|
|
187
|
+
const version = "3.1.86";
|
|
188
188
|
function install(app) {
|
|
189
189
|
const components = [
|
|
190
190
|
import_action_sheet.ActionSheet,
|
|
@@ -179,11 +179,29 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
179
179
|
const gridRef = (0, import_vue2.ref)();
|
|
180
180
|
const mediaListPlaceholder = (0, import_vue2.ref)([]);
|
|
181
181
|
const sort = (0, import_vue2.ref)();
|
|
182
|
-
|
|
182
|
+
const shouldIsolateSortableTouch = () => props.sortable && props.mediaList.length > 0;
|
|
183
|
+
const stopSortableTouchStartPropagation = (event) => {
|
|
184
|
+
if (!shouldIsolateSortableTouch()) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
event.stopPropagation();
|
|
188
|
+
};
|
|
189
|
+
const destroySortable = () => {
|
|
190
|
+
var _a;
|
|
191
|
+
if ((_a = sort.value) == null ? void 0 : _a.destroy) {
|
|
192
|
+
sort.value.destroy();
|
|
193
|
+
}
|
|
194
|
+
sort.value = void 0;
|
|
195
|
+
};
|
|
196
|
+
const initSortable = () => __async(this, null, function* () {
|
|
183
197
|
var _a;
|
|
184
|
-
if (sort.value || !props.sortable)
|
|
198
|
+
if (sort.value || !props.sortable || !props.mediaList.length)
|
|
185
199
|
return;
|
|
186
|
-
|
|
200
|
+
yield (0, import_vue2.nextTick)();
|
|
201
|
+
const gridEl = (_a = gridRef.value) == null ? void 0 : _a.$el;
|
|
202
|
+
if (!gridEl)
|
|
203
|
+
return;
|
|
204
|
+
sort.value = import_sortablejs.default.create(gridEl, {
|
|
187
205
|
animation: 200,
|
|
188
206
|
handle: ".zt-grid-item",
|
|
189
207
|
onEnd: (evt) => {
|
|
@@ -914,6 +932,18 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
914
932
|
actionVisible.value = false;
|
|
915
933
|
action.func && action.func();
|
|
916
934
|
};
|
|
935
|
+
(0, import_vue2.watch)(() => [props.sortable, props.mediaList.length], (_0) => __async(this, [_0], function* ([sortable, mediaCount]) {
|
|
936
|
+
if (!sortable || !mediaCount) {
|
|
937
|
+
destroySortable();
|
|
938
|
+
return;
|
|
939
|
+
}
|
|
940
|
+
yield initSortable();
|
|
941
|
+
}), {
|
|
942
|
+
immediate: true
|
|
943
|
+
});
|
|
944
|
+
(0, import_vue2.onBeforeUnmount)(() => {
|
|
945
|
+
destroySortable();
|
|
946
|
+
});
|
|
917
947
|
(0, import_use_expose.useExpose)({
|
|
918
948
|
mediaPickAction,
|
|
919
949
|
handleInputFiles,
|
|
@@ -951,7 +981,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
951
981
|
"border": false,
|
|
952
982
|
"square": true,
|
|
953
983
|
"gutter": "4",
|
|
954
|
-
"class": bem("grid")
|
|
984
|
+
"class": bem("grid"),
|
|
985
|
+
"onTouchstart": stopSortableTouchStartPropagation
|
|
955
986
|
}, {
|
|
956
987
|
default: () => [renderMediaList()]
|
|
957
988
|
}), [[import_vue.vShow, props.mediaList.length]]), (0, import_vue.withDirectives)((0, import_vue.createVNode)(import_grid.default, {
|