@opentinyvue/vue-image-viewer 2.21.0 → 3.21.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.
@@ -6,6 +6,7 @@ import DropdownMenu from '@opentinyvue/vue-dropdown-menu';
6
6
  import DropdownItem from '@opentinyvue/vue-dropdown-item';
7
7
  import ActionSheet from '@opentinyvue/vue-action-sheet';
8
8
  import { iconClose, iconChevronLeft, iconChevronRight, iconZoomOut, iconZoomIn, iconFullscreen, iconMinscreen, iconRepeat, iconRefres, iconDel, iconDownload, iconArrowLeft, iconArrowRight, iconEditorMenuRight, iconPicture } from '@opentinyvue/vue-icon';
9
+ import { resolveComponent, resolveDirective, openBlock, createElementBlock, createVNode, Transition, withCtx, normalizeClass, normalizeStyle, Fragment, renderList, createElementVNode, toDisplayString, createCommentVNode, createBlock, resolveDynamicComponent, createTextVNode, withDirectives } from 'vue';
9
10
 
10
11
  var TinyTouch = /* @__PURE__ */ function() {
11
12
  function TinyTouch2(element, tinyBinding, type) {
@@ -103,35 +104,38 @@ var mapDirective = function mapDirective2() {
103
104
  };
104
105
  var touchDeactives = mapDirective();
105
106
 
106
- function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
107
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
108
- if (render) {
109
- options.render = render;
110
- options.staticRenderFns = staticRenderFns;
111
- options._compiled = true;
112
- }
113
- var hook;
114
- if (injectStyles) {
115
- hook = injectStyles;
107
+ function _createForOfIteratorHelperLoose(r, e) {
108
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
109
+ if (t) return (t = t.call(r)).next.bind(t);
110
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
111
+ t && (r = t);
112
+ var o = 0;
113
+ return function() {
114
+ return o >= r.length ? { done: true } : { done: false, value: r[o++] };
115
+ };
116
116
  }
117
- if (hook) {
118
- if (options.functional) {
119
- options._injectStyles = hook;
120
- var originalRender = options.render;
121
- options.render = function renderWithStyleInjection(h, context) {
122
- hook.call(context);
123
- return originalRender(h, context);
124
- };
125
- } else {
126
- var existing = options.beforeCreate;
127
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
128
- }
117
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
118
+ }
119
+ function _unsupportedIterableToArray(r, a) {
120
+ if (r) {
121
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
122
+ var t = {}.toString.call(r).slice(8, -1);
123
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
129
124
  }
130
- return {
131
- exports: scriptExports,
132
- options
133
- };
134
125
  }
126
+ function _arrayLikeToArray(r, a) {
127
+ (null == a || a > r.length) && (a = r.length);
128
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
129
+ return n;
130
+ }
131
+ var _export_sfc = function _export_sfc2(sfc, props) {
132
+ var target = sfc.__vccOpts || sfc;
133
+ for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
134
+ var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
135
+ target[key] = val;
136
+ }
137
+ return target;
138
+ };
135
139
 
136
140
  function _extends() {
137
141
  return _extends = Object.assign ? Object.assign.bind() : function(n) {
@@ -142,7 +146,7 @@ function _extends() {
142
146
  return n;
143
147
  }, _extends.apply(null, arguments);
144
148
  }
145
- var __vue2_script = defineComponent({
149
+ var _sfc_main = defineComponent({
146
150
  emits: ["close", "update:preview-visible", "delete", "change", "newImageList"],
147
151
  props: [].concat(props, ["urlList", "zIndex", "onSwitch", "onClose", "showIndex", "isThumbnail", "isMenuView", "modalView", "modalHeight", "bgColor", "keepStyle"]),
148
152
  components: {
@@ -176,496 +180,635 @@ var __vue2_script = defineComponent({
176
180
  });
177
181
  }
178
182
  });
179
- var render = function render2() {
180
- var _vm = this;
181
- var _h = _vm.$createElement;
182
- var _c = _vm._self._c || _h;
183
- return _vm.state.showImageViewer ? _c("div", {
184
- attrs: {
185
- "data-tag": "tiny-image-viewer"
186
- }
187
- }, [_c("transition", {
188
- attrs: {
189
- "name": "viewer-fade"
190
- }
191
- }, [_vm.state.showImageViewer ? _c("div", {
192
- class: ["left-0 right-0 top-0 bottom-0 hidden sm:flex z-10", _vm.modalView ? "" : "fixed"],
193
- style: {
194
- "z-index": _vm.state.zIndex,
195
- "height": _vm.modalView && _vm.modalHeight + "px"
196
- },
197
- attrs: {
198
- "data-tag": "tiny-image-body"
199
- }
200
- }, [_vm.state.isThumbnail ? _c("div", {
201
- ref: "isThumbnailContent",
202
- class: ["flex-none w-[12%] h-full flex flex-col overflow-y-scroll items-center scrollbar-size-0", _vm.bgColor !== "white" ? "bg-color-icon-primary" : ""],
203
- style: {
204
- backgroundColor: _vm.bgColor === "white" && _vm.bgColor
205
- },
206
- attrs: {
207
- "data-tag": "tiny-isthumbnail"
208
- }
209
- }, _vm._l(_vm.state.urlList, function(item, i) {
210
- return _c("div", {
211
- key: i,
212
- ref: "isThumbnail_" + i,
213
- refInFor: true,
214
- staticClass: "w-[88%] [&:not(:last-child)]:mb-2 [&:first-of-type]:mt-2"
215
- }, [_c("div", {
216
- class: ["rounded cursor-pointer p-1", {
217
- "bg-color-brand": _vm.state.currentIndex === i
218
- }],
219
- on: {
220
- "click": function click($event) {
221
- return _vm.activeItems(i);
222
- }
223
- }
224
- }, [_c("img", {
225
- ref: "img_" + i,
226
- refInFor: true,
227
- staticClass: "max-h-full max-w-full aspect-square bg-current rounded",
228
- attrs: {
229
- "src": item.url
230
- }
231
- }), _c("div", {
232
- class: ["px-1 mt-1 sm:text-xs text-sm leading-5 overflow-hidden whitespace-nowrap text-ellipsis", _vm.bgColor === "white" ? _vm.state.currentIndex !== i ? "text-color-text-primary" : "text-color-bg-1" : "text-color-bg-1"],
233
- attrs: {
234
- "title": item.name || item.url
235
- }
236
- }, [_vm._v(" " + _vm._s(item.name) + " ")])])]);
237
- }), 0) : _vm._e(), _vm.state.isMenuView ? _c("div", {
238
- ref: "isMenuViewContent",
239
- class: ["flex-none w-[12%] h-full flex flex-col overflow-y-scroll items-center scrollbar-size-0", _vm.bgColor !== "white" ? "bg-color-icon-primary" : "bg-color-bg-1"],
240
- attrs: {
241
- "data-tag": "tiny-is-menu-view"
242
- }
243
- }, _vm._l(_vm.state.urlList, function(items, i) {
244
- return _c("div", {
245
- key: i,
246
- staticClass: "w-[88%]"
247
- }, [_c("div", {
248
- ref: "isMenuView_" + i,
249
- refInFor: true,
250
- class: ["[&:first-of-type]:mt-2.5 rounded cursor-pointer flex mx-1 h-9 items-center", {
251
- "bg-color-brand": _vm.state.currentIndex === i
252
- }],
253
- on: {
254
- "click": function click($event) {
255
- return _vm.activeItems(i);
256
- }
257
- }
258
- }, [_c("icon-picture", {
259
- ref: "img_" + i,
260
- refInFor: true,
261
- class: ["max-h-full max-w-full w-[9%] h-auto my-2.5 mx-1.5 object-none", _vm.bgColor === "white" ? _vm.state.menuItemIndex !== i ? "fill-color-text-primary" : "fill-color-bg-1" : "fill-color-bg-1"],
262
- attrs: {
263
- "src": items.url
264
- }
265
- }), _c("div", {
266
- class: ["w-[67%] sm:text-xs text-sm leading-5 overflow-hidden whitespace-nowrap text-ellipsis", _vm.bgColor === "white" ? _vm.state.menuItemIndex !== i ? "text-color-text-primary" : "text-color-bg-1" : "text-color-bg-1"],
267
- attrs: {
268
- "title": items.name || items.url
269
- }
270
- }, [_vm._v(" " + _vm._s(items.name) + " ")])], 1)]);
271
- }), 0) : _vm._e(), _c("div", {
272
- staticClass: "flex-auto h-full relative",
273
- attrs: {
274
- "data-tag": "tiny-image-tools"
275
- }
276
- }, [_c("div", {
277
- staticClass: "absolute w-full h-full top-0 left-0 bg-color-bg-7",
278
- attrs: {
279
- "data-tag": "tiny-image-pc-mask"
280
- }
281
- }), _vm.modalView || !_vm.state.isThumbnail && !_vm.state.isMenuView ? _c("span", {
282
- staticClass: "z-[1] flex absolute items-center justify-center rounded-full box-border select-none top-20 right-20 bottom-10 text-xl cursor-pointer w-8 h-8 hover:bg-color-text-primary active:bg-color-border fill-color-bg-1 bg-color-border",
283
- attrs: {
284
- "data-tag": "tiny-image-pc-close"
285
- },
286
- on: {
287
- "click": _vm.hide
288
- }
289
- }, [_c("icon-close", {
290
- staticClass: "fill-color-bg-1 cursor-pointer"
291
- })], 1) : _vm._e(), _c("div", {
292
- staticClass: "z-[1] absolute inline-flex items-center justify-center box-border select-none left-1/2 bottom-12 -translate-x-1/2 w-80 h-10 px-4 bg-color-bg-7 rounded cursor-pointer",
293
- attrs: {
294
- "data-tag": "tiny-image-pc-actions"
295
- }
296
- }, [_c("div", {
297
- staticClass: "w-full h-full text-justify cursor-default text-2xl flex items-center justify-between fill-color-bg-1"
298
- }, [_c(_vm.state.mode.icon, {
299
- tag: "component",
300
- staticClass: "cursor-pointer",
301
- on: {
302
- "click": _vm.toggleMode
303
- }
304
- }), _c("icon-zoom-out", {
305
- staticClass: "cursor-pointer",
306
- on: {
307
- "click": function click($event) {
308
- return _vm.handleActions("zoomOut");
309
- }
310
- }
311
- }), _c("icon-zoom-in", {
312
- staticClass: "cursor-pointer",
313
- on: {
314
- "click": function click($event) {
315
- return _vm.handleActions("zoomIn");
316
- }
317
- }
318
- }), _c("icon-refres", {
319
- staticClass: "cursor-pointer",
320
- on: {
321
- "click": function click($event) {
322
- return _vm.handleActions("clocelise");
323
- }
324
- }
325
- }), _c("icon-repeat", {
326
- staticClass: "cursor-pointer",
327
- on: {
328
- "click": function click($event) {
329
- return _vm.handleActions("anticlocelise");
330
- }
331
- }
332
- }), _c("icon-del", {
333
- staticClass: "cursor-pointer",
334
- on: {
335
- "click": function click($event) {
336
- return _vm.handleActions("delImage");
337
- }
338
- }
339
- }), _c("a", {
340
- staticClass: "cursor-pointer inline-flex fill-color-bg-1",
341
- attrs: {
342
- "href": "" + _vm.state.currentImg,
343
- "target": "_blank",
344
- "rel": "noopener noreferrer",
345
- "download": ""
346
- }
347
- }, [_c("icon-download")], 1), _c("tiny-dropdown", {
348
- staticClass: "flex",
349
- attrs: {
350
- "show-self-icon": ""
351
- },
352
- on: {
353
- "item-click": _vm.itemClick
354
- },
355
- scopedSlots: _vm._u([{
356
- key: "dropdown",
357
- fn: function fn() {
358
- return [_c("tiny-dropdown-menu", {
359
- attrs: {
360
- "checked-status": "",
361
- "placement": "top"
183
+ var _hoisted_1 = {
184
+ key: 0,
185
+ "data-tag": "tiny-image-viewer"
186
+ };
187
+ var _hoisted_2 = ["onClick"];
188
+ var _hoisted_3 = ["src"];
189
+ var _hoisted_4 = ["title"];
190
+ var _hoisted_5 = ["onClick"];
191
+ var _hoisted_6 = ["title"];
192
+ var _hoisted_7 = {
193
+ class: "flex-auto h-full relative",
194
+ "data-tag": "tiny-image-tools"
195
+ };
196
+ var _hoisted_8 = /* @__PURE__ */ createElementVNode(
197
+ "div",
198
+ {
199
+ "data-tag": "tiny-image-pc-mask",
200
+ class: "absolute w-full h-full top-0 left-0 bg-color-bg-7"
201
+ },
202
+ null,
203
+ -1
204
+ /* HOISTED */
205
+ );
206
+ var _hoisted_9 = {
207
+ "data-tag": "tiny-image-pc-actions",
208
+ class: "z-[1] absolute inline-flex items-center justify-center box-border select-none left-1/2 bottom-12 -translate-x-1/2 w-80 h-10 px-4 bg-color-bg-7 rounded cursor-pointer"
209
+ };
210
+ var _hoisted_10 = {
211
+ class: "w-full h-full text-justify cursor-default text-2xl flex items-center justify-between fill-color-bg-1"
212
+ };
213
+ var _hoisted_11 = ["href"];
214
+ var _hoisted_12 = {
215
+ key: 1,
216
+ "data-tag": "tiny-image-pc-index",
217
+ class: "z-10 absolute flex items-center justify-center box-border left-1/2 -translate-x-1/2 px-4 bottom-5"
218
+ };
219
+ var _hoisted_13 = {
220
+ class: "h-4.5 inline-flex items-center text-color-text-primary"
221
+ };
222
+ var _hoisted_14 = {
223
+ "data-tag": "tiny-image-pc-canvas",
224
+ class: "z-10 flex w-full h-full items-center justify-center"
225
+ };
226
+ var _hoisted_15 = ["src"];
227
+ var _hoisted_16 = {
228
+ class: "bg-color-bg-1 w-screen h-screen overflow-auto"
229
+ };
230
+ var _hoisted_17 = ["onTouchstart"];
231
+ var _hoisted_18 = ["src"];
232
+ var _hoisted_19 = ["title"];
233
+ var _hoisted_20 = {
234
+ key: 1,
235
+ "data-tag": "tiny-image-mobile-common",
236
+ class: "w-screen h-screen fixed top-0 left-0 z-50 sm:hidden"
237
+ };
238
+ var _hoisted_21 = /* @__PURE__ */ createElementVNode(
239
+ "div",
240
+ {
241
+ "data-tag": "tiny-image-mobile-mask",
242
+ class: "absolute w-full h-full top-0 left-0 bg-black"
243
+ },
244
+ null,
245
+ -1
246
+ /* HOISTED */
247
+ );
248
+ var _hoisted_22 = {
249
+ "data-tag": "tiny-image-mobile-index",
250
+ class: "left-0 right-0 top-0 bottom-0 fixed"
251
+ };
252
+ var _hoisted_23 = {
253
+ key: 0,
254
+ class: "absolute flex items-center justify-center box-border left-1/2 -translate-x-1/2 px-4 bottom-12"
255
+ };
256
+ var _hoisted_24 = {
257
+ class: "h-4.5 inline-flex items-center text-color-bg-1"
258
+ };
259
+ var _hoisted_25 = {
260
+ "data-tag": "tiny-image-mobile-canvas",
261
+ ref: "canvasBox",
262
+ class: "w-full h-full"
263
+ };
264
+ var _hoisted_26 = {
265
+ class: "absolute top-0 left-0 right-0 bottom-0 text-center transition-transform inline-block duration-300"
266
+ };
267
+ var _hoisted_27 = ["src"];
268
+ var _hoisted_28 = {
269
+ key: 0,
270
+ "data-tag": "tiny-image-isthumbnail-preview",
271
+ class: "w-screen h-screen fixed top-0 left-0 z-50 sm:hidden"
272
+ };
273
+ var _hoisted_29 = /* @__PURE__ */ createElementVNode(
274
+ "div",
275
+ {
276
+ "data-tag": "tiny-image-mobile-mask",
277
+ class: "absolute w-full h-full top-0 left-0 bg-black"
278
+ },
279
+ null,
280
+ -1
281
+ /* HOISTED */
282
+ );
283
+ var _hoisted_30 = {
284
+ "data-tag": "tiny-image-isthumbnail-index",
285
+ class: "left-0 right-0 top-0 bottom-0 fixed"
286
+ };
287
+ var _hoisted_31 = {
288
+ key: 0,
289
+ class: "absolute flex items-center justify-center box-border left-1/2 -translate-x-1/2 px-4 bottom-12"
290
+ };
291
+ var _hoisted_32 = {
292
+ class: "h-4.5 inline-flex items-center text-color-bg-1"
293
+ };
294
+ var _hoisted_33 = {
295
+ "data-tag": "tiny-image-isthumbnail-canvas",
296
+ ref: "thumbnailCanvasBox",
297
+ class: "w-full h-full"
298
+ };
299
+ var _hoisted_34 = {
300
+ class: "absolute top-0 left-0 right-0 bottom-0 text-center transition-transform inline-block duration-300"
301
+ };
302
+ var _hoisted_35 = ["src"];
303
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
304
+ var _component_icon_picture = resolveComponent("icon-picture");
305
+ var _component_icon_close = resolveComponent("icon-close");
306
+ var _component_icon_zoom_out = resolveComponent("icon-zoom-out");
307
+ var _component_icon_zoom_in = resolveComponent("icon-zoom-in");
308
+ var _component_icon_refres = resolveComponent("icon-refres");
309
+ var _component_icon_repeat = resolveComponent("icon-repeat");
310
+ var _component_icon_del = resolveComponent("icon-del");
311
+ var _component_icon_download = resolveComponent("icon-download");
312
+ var _component_icon_editor_menu_right = resolveComponent("icon-editor-menu-right");
313
+ var _component_tiny_dropdown_item = resolveComponent("tiny-dropdown-item");
314
+ var _component_tiny_dropdown_menu = resolveComponent("tiny-dropdown-menu");
315
+ var _component_tiny_dropdown = resolveComponent("tiny-dropdown");
316
+ var _component_icon_arrow_left = resolveComponent("icon-arrow-left");
317
+ var _component_icon_arrow_right = resolveComponent("icon-arrow-right");
318
+ var _component_tiny_action_sheet = resolveComponent("tiny-action-sheet");
319
+ var _directive_swipeleft = resolveDirective("swipeleft");
320
+ var _directive_swiperight = resolveDirective("swiperight");
321
+ return _ctx.state.showImageViewer ? (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(Transition, {
322
+ name: "viewer-fade"
323
+ }, {
324
+ default: withCtx(function() {
325
+ return [_ctx.state.showImageViewer ? (openBlock(), createElementBlock(
326
+ "div",
327
+ {
328
+ key: 0,
329
+ "data-tag": "tiny-image-body",
330
+ class: normalizeClass(["left-0 right-0 top-0 bottom-0 hidden sm:flex z-10", _ctx.modalView ? "" : "fixed"]),
331
+ style: normalizeStyle({
332
+ "z-index": _ctx.state.zIndex,
333
+ "height": _ctx.modalView && _ctx.modalHeight + "px"
334
+ })
335
+ },
336
+ [_ctx.state.isThumbnail ? (openBlock(), createElementBlock(
337
+ "div",
338
+ {
339
+ key: 0,
340
+ "data-tag": "tiny-isthumbnail",
341
+ ref: "isThumbnailContent",
342
+ class: normalizeClass(["flex-none w-[12%] h-full flex flex-col overflow-y-scroll items-center scrollbar-size-0", _ctx.bgColor !== "white" ? "bg-color-icon-primary" : ""]),
343
+ style: normalizeStyle({
344
+ backgroundColor: _ctx.bgColor === "white" && _ctx.bgColor
345
+ })
346
+ },
347
+ [(openBlock(true), createElementBlock(
348
+ Fragment,
349
+ null,
350
+ renderList(_ctx.state.urlList, function(item, i) {
351
+ return openBlock(), createElementBlock("div", {
352
+ key: i,
353
+ class: "w-[88%] [&:not(:last-child)]:mb-2 [&:first-of-type]:mt-2",
354
+ ref_for: true,
355
+ ref: "isThumbnail_" + i
356
+ }, [createElementVNode("div", {
357
+ onClick: function onClick($event) {
358
+ return _ctx.activeItems(i);
359
+ },
360
+ class: normalizeClass(["rounded cursor-pointer p-1", {
361
+ "bg-color-brand": _ctx.state.currentIndex === i
362
+ }])
363
+ }, [createElementVNode("img", {
364
+ class: "max-h-full max-w-full aspect-square bg-current rounded",
365
+ ref_for: true,
366
+ ref: "img_" + i,
367
+ src: item.url
368
+ }, null, 8, _hoisted_3), createElementVNode("div", {
369
+ title: item.name || item.url,
370
+ class: normalizeClass(["px-1 mt-1 sm:text-xs text-sm leading-5 overflow-hidden whitespace-nowrap text-ellipsis", _ctx.bgColor === "white" ? _ctx.state.currentIndex !== i ? "text-color-text-primary" : "text-color-bg-1" : "text-color-bg-1"])
371
+ }, toDisplayString(item.name), 11, _hoisted_4)], 10, _hoisted_2)]);
372
+ }),
373
+ 128
374
+ /* KEYED_FRAGMENT */
375
+ ))],
376
+ 6
377
+ /* CLASS, STYLE */
378
+ )) : createCommentVNode("v-if", true), _ctx.state.isMenuView ? (openBlock(), createElementBlock(
379
+ "div",
380
+ {
381
+ key: 1,
382
+ "data-tag": "tiny-is-menu-view",
383
+ ref: "isMenuViewContent",
384
+ class: normalizeClass(["flex-none w-[12%] h-full flex flex-col overflow-y-scroll items-center scrollbar-size-0", _ctx.bgColor !== "white" ? "bg-color-icon-primary" : "bg-color-bg-1"])
362
385
  },
363
- scopedSlots: _vm._u([{
364
- key: "default",
365
- fn: function fn2(_ref) {
366
- var selectedIndex = _ref.selectedIndex;
367
- return [_c("tiny-dropdown-item", {
368
- attrs: {
386
+ [(openBlock(true), createElementBlock(
387
+ Fragment,
388
+ null,
389
+ renderList(_ctx.state.urlList, function(items, i) {
390
+ return openBlock(), createElementBlock("div", {
391
+ key: i,
392
+ class: "w-[88%]"
393
+ }, [createElementVNode("div", {
394
+ onClick: function onClick($event) {
395
+ return _ctx.activeItems(i);
396
+ },
397
+ ref_for: true,
398
+ ref: "isMenuView_" + i,
399
+ class: normalizeClass(["[&:first-of-type]:mt-2.5 rounded cursor-pointer flex mx-1 h-9 items-center", {
400
+ "bg-color-brand": _ctx.state.currentIndex === i
401
+ }])
402
+ }, [createVNode(_component_icon_picture, {
403
+ class: normalizeClass(["max-h-full max-w-full w-[9%] h-auto my-2.5 mx-1.5 object-none", _ctx.bgColor === "white" ? _ctx.state.menuItemIndex !== i ? "fill-color-text-primary" : "fill-color-bg-1" : "fill-color-bg-1"]),
404
+ ref_for: true,
405
+ ref: "img_" + i,
406
+ src: items.url
407
+ }, null, 8, ["class", "src"]), createElementVNode("div", {
408
+ title: items.name || items.url,
409
+ class: normalizeClass(["w-[67%] sm:text-xs text-sm leading-5 overflow-hidden whitespace-nowrap text-ellipsis", _ctx.bgColor === "white" ? _ctx.state.menuItemIndex !== i ? "text-color-text-primary" : "text-color-bg-1" : "text-color-bg-1"])
410
+ }, toDisplayString(items.name), 11, _hoisted_6)], 10, _hoisted_5)]);
411
+ }),
412
+ 128
413
+ /* KEYED_FRAGMENT */
414
+ ))],
415
+ 2
416
+ /* CLASS */
417
+ )) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_7, [_hoisted_8, _ctx.modalView || !_ctx.state.isThumbnail && !_ctx.state.isMenuView ? (openBlock(), createElementBlock("span", {
418
+ key: 0,
419
+ "data-tag": "tiny-image-pc-close",
420
+ class: "z-[1] flex absolute items-center justify-center rounded-full box-border select-none top-20 right-20 bottom-10 text-xl cursor-pointer w-8 h-8 hover:bg-color-text-primary active:bg-color-border fill-color-bg-1 bg-color-border",
421
+ onClick: _cache[0] || (_cache[0] = function() {
422
+ return _ctx.hide && _ctx.hide.apply(_ctx, arguments);
423
+ })
424
+ }, [createVNode(_component_icon_close, {
425
+ class: "fill-color-bg-1 cursor-pointer"
426
+ })])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_9, [createElementVNode("div", _hoisted_10, [(openBlock(), createBlock(resolveDynamicComponent(_ctx.state.mode.icon), {
427
+ class: "cursor-pointer",
428
+ onClick: _ctx.toggleMode
429
+ }, null, 8, ["onClick"])), createVNode(_component_icon_zoom_out, {
430
+ class: "cursor-pointer",
431
+ onClick: _cache[1] || (_cache[1] = function($event) {
432
+ return _ctx.handleActions("zoomOut");
433
+ })
434
+ }), createVNode(_component_icon_zoom_in, {
435
+ class: "cursor-pointer",
436
+ onClick: _cache[2] || (_cache[2] = function($event) {
437
+ return _ctx.handleActions("zoomIn");
438
+ })
439
+ }), createVNode(_component_icon_refres, {
440
+ class: "cursor-pointer",
441
+ onClick: _cache[3] || (_cache[3] = function($event) {
442
+ return _ctx.handleActions("clocelise");
443
+ })
444
+ }), createVNode(_component_icon_repeat, {
445
+ class: "cursor-pointer",
446
+ onClick: _cache[4] || (_cache[4] = function($event) {
447
+ return _ctx.handleActions("anticlocelise");
448
+ })
449
+ }), createVNode(_component_icon_del, {
450
+ class: "cursor-pointer",
451
+ onClick: _cache[5] || (_cache[5] = function($event) {
452
+ return _ctx.handleActions("delImage");
453
+ })
454
+ }), createElementVNode("a", {
455
+ href: "" + _ctx.state.currentImg,
456
+ target: "_blank",
457
+ rel: "noopener noreferrer",
458
+ download: "",
459
+ class: "cursor-pointer inline-flex fill-color-bg-1"
460
+ }, [createVNode(_component_icon_download)], 8, _hoisted_11), createVNode(_component_tiny_dropdown, {
461
+ "show-self-icon": "",
462
+ class: "flex",
463
+ onItemClick: _ctx.itemClick
464
+ }, {
465
+ dropdown: withCtx(function() {
466
+ return [createVNode(_component_tiny_dropdown_menu, {
467
+ "checked-status": "",
468
+ placement: "top"
469
+ }, {
470
+ default: withCtx(function(_ref) {
471
+ var selectedIndex = _ref.selectedIndex;
472
+ return [createVNode(_component_tiny_dropdown_item, {
369
473
  "current-index": 0,
370
- "selected": selectedIndex === "0" && !_vm.state.isThumbnail && !_vm.state.isMenuView,
371
- "item-data": !_vm.state.isThumbnail && !_vm.state.isMenuView ? "4" : "1"
372
- }
373
- }, [_vm._v(_vm._s(_vm.state.isThumbnail || _vm.state.isMenuView ? _vm.t("ui.imageViewer.hide") : _vm.t("ui.imageViewer.show")))]), _c("tiny-dropdown-item", {
374
- attrs: {
474
+ selected: selectedIndex === "0" && !_ctx.state.isThumbnail && !_ctx.state.isMenuView,
475
+ "item-data": !_ctx.state.isThumbnail && !_ctx.state.isMenuView ? "4" : "1"
476
+ }, {
477
+ default: withCtx(function() {
478
+ return [createTextVNode(
479
+ toDisplayString(_ctx.state.isThumbnail || _ctx.state.isMenuView ? _ctx.t("ui.imageViewer.hide") : _ctx.t("ui.imageViewer.show")),
480
+ 1
481
+ /* TEXT */
482
+ )];
483
+ }),
484
+ _: 2
485
+ /* DYNAMIC */
486
+ }, 1032, ["selected", "item-data"]), createVNode(_component_tiny_dropdown_item, {
375
487
  "current-index": 1,
376
- "selected": selectedIndex === "1" || _vm.state.isThumbnail,
488
+ selected: selectedIndex === "1" || _ctx.state.isThumbnail,
377
489
  "item-data": "2"
378
- }
379
- }, [_vm._v(_vm._s(_vm.t("ui.imageViewer.thumbnail")))]), _c("tiny-dropdown-item", {
380
- attrs: {
490
+ }, {
491
+ default: withCtx(function() {
492
+ return [createTextVNode(
493
+ toDisplayString(_ctx.t("ui.imageViewer.thumbnail")),
494
+ 1
495
+ /* TEXT */
496
+ )];
497
+ }),
498
+ _: 2
499
+ /* DYNAMIC */
500
+ }, 1032, ["selected"]), createVNode(_component_tiny_dropdown_item, {
381
501
  "current-index": 2,
382
- "selected": selectedIndex === "2" || _vm.state.isMenuView,
502
+ selected: selectedIndex === "2" || _ctx.state.isMenuView,
383
503
  "item-data": "3"
384
- }
385
- }, [_vm._v(_vm._s(_vm.t("ui.imageViewer.menu")))])];
386
- }
387
- }], null, false, 1242418640)
388
- })];
389
- },
390
- proxy: true
391
- }], null, false, 849811104)
392
- }, [_c("span", [_c("icon-editor-menu-right")], 1)]), _c("icon-arrow-left", {
393
- class: ["cursor-pointer", {
394
- "is-disabled": !_vm.state.infinite && _vm.state.isFirst
395
- }],
396
- on: {
397
- "click": _vm.prev
398
- }
399
- }), _c("icon-arrow-right", {
400
- class: ["cursor-pointer", {
401
- "is-disabled": !_vm.state.infinite && _vm.state.isLast
402
- }],
403
- on: {
404
- "click": _vm.next
405
- }
406
- })], 1)]), _vm.showIndex ? _c("div", {
407
- staticClass: "z-10 absolute flex items-center justify-center box-border left-1/2 -translate-x-1/2 px-4 bottom-5",
408
- attrs: {
409
- "data-tag": "tiny-image-pc-index"
410
- }
411
- }, [_c("span", {
412
- staticClass: "h-4.5 inline-flex items-center text-color-text-primary"
413
- }, [_vm._v(" " + _vm._s(_vm.state.index + 1 + "/" + _vm.state.urlList.length) + " ")])]) : _vm._e(), _c("div", {
414
- staticClass: "z-10 flex w-full h-full items-center justify-center",
415
- attrs: {
416
- "data-tag": "tiny-image-pc-canvas"
417
- }
418
- }, [_vm._l(_vm.state.urlList, function(url, i) {
419
- return [i === _vm.state.index ? _c("img", {
420
- key: i,
421
- ref: "img_" + i,
422
- refInFor: true,
423
- style: _vm.state.imgStyle,
424
- attrs: {
425
- "src": _vm.state.currentImg
426
- },
427
- on: {
428
- "error": _vm.handleImgError,
429
- "mousedown": _vm.handleMouseDown,
430
- "load": _vm.handleImgLoad
431
- }
432
- }) : _vm._e()];
433
- })], 2)])]) : _vm._e()]), _c("transition", {
434
- attrs: {
435
- "name": "viewer-fade"
436
- }
437
- }, [_vm.state.isThumbnail ? _c("div", {
438
- class: ["w-screen h-screen fixed top-0 left-0 sm:hidden z-40", {
439
- "hidden": _vm.state.hiddenThumbnail
440
- }],
441
- attrs: {
442
- "data-tag": "tiny-image-mobile-thumbnail-list"
443
- }
444
- }, [_c("div", {
445
- staticClass: "bg-color-bg-1 w-screen h-screen overflow-auto"
446
- }, _vm._l(_vm.state.urlList, function(item, i) {
447
- return _c("div", {
448
- key: i,
449
- staticClass: "px-4 pt-4 [&:last-of-type]:mb-5 cursor-pointer",
450
- on: {
451
- "touchstart": function touchstart($event) {
452
- return _vm.imagePreview(i);
453
- }
454
- }
455
- }, [_c("img", {
456
- ref: "img_" + i,
457
- refInFor: true,
458
- staticClass: "bg-current w-full h-auto",
459
- attrs: {
460
- "src": item.url
461
- }
462
- }), _c("div", {
463
- staticClass: "color-text-primary mt-2 sm:text-xs text-sm leading-5 overflow-hidden whitespace-nowrap text-ellipsis text-color-text-primary",
464
- attrs: {
465
- "title": item.name || item.url
466
- }
467
- }, [_vm._v(" " + _vm._s(item.name) + " ")])]);
468
- }), 0)]) : !_vm.state.isMenuView ? _c("div", {
469
- staticClass: "w-screen h-screen fixed top-0 left-0 z-50 sm:hidden",
470
- attrs: {
471
- "data-tag": "tiny-image-mobile-common"
472
- }
473
- }, [_c("div", {
474
- staticClass: "absolute w-full h-full top-0 left-0 bg-black",
475
- attrs: {
476
- "data-tag": "tiny-image-mobile-mask"
477
- }
478
- }), _c("div", {
479
- directives: [{
480
- name: "swipeleft",
481
- rawName: "v-swipeleft",
482
- value: _vm.swipeLeft,
483
- expression: "swipeLeft"
504
+ }, {
505
+ default: withCtx(function() {
506
+ return [createTextVNode(
507
+ toDisplayString(_ctx.t("ui.imageViewer.menu")),
508
+ 1
509
+ /* TEXT */
510
+ )];
511
+ }),
512
+ _: 2
513
+ /* DYNAMIC */
514
+ }, 1032, ["selected"])];
515
+ }),
516
+ _: 1
517
+ /* STABLE */
518
+ })];
519
+ }),
520
+ default: withCtx(function() {
521
+ return [createElementVNode("span", null, [createVNode(_component_icon_editor_menu_right)])];
522
+ }),
523
+ _: 1
524
+ /* STABLE */
525
+ }, 8, ["onItemClick"]), createVNode(_component_icon_arrow_left, {
526
+ onClick: _ctx.prev,
527
+ class: normalizeClass(["cursor-pointer", {
528
+ "is-disabled": !_ctx.state.infinite && _ctx.state.isFirst
529
+ }])
530
+ }, null, 8, ["onClick", "class"]), createVNode(_component_icon_arrow_right, {
531
+ onClick: _ctx.next,
532
+ class: normalizeClass(["cursor-pointer", {
533
+ "is-disabled": !_ctx.state.infinite && _ctx.state.isLast
534
+ }])
535
+ }, null, 8, ["onClick", "class"])])]), _ctx.showIndex ? (openBlock(), createElementBlock("div", _hoisted_12, [createElementVNode(
536
+ "span",
537
+ _hoisted_13,
538
+ toDisplayString(_ctx.state.index + 1 + "/" + _ctx.state.urlList.length),
539
+ 1
540
+ /* TEXT */
541
+ )])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_14, [(openBlock(true), createElementBlock(
542
+ Fragment,
543
+ null,
544
+ renderList(_ctx.state.urlList, function(url, i) {
545
+ return openBlock(), createElementBlock(
546
+ Fragment,
547
+ null,
548
+ [i === _ctx.state.index ? (openBlock(), createElementBlock("img", {
549
+ ref_for: true,
550
+ ref: "img_" + i,
551
+ key: i,
552
+ src: _ctx.state.currentImg,
553
+ style: normalizeStyle(_ctx.state.imgStyle),
554
+ onError: _cache[6] || (_cache[6] = function() {
555
+ return _ctx.handleImgError && _ctx.handleImgError.apply(_ctx, arguments);
556
+ }),
557
+ onMousedown: _cache[7] || (_cache[7] = function() {
558
+ return _ctx.handleMouseDown && _ctx.handleMouseDown.apply(_ctx, arguments);
559
+ }),
560
+ onLoad: _cache[8] || (_cache[8] = function() {
561
+ return _ctx.handleImgLoad && _ctx.handleImgLoad.apply(_ctx, arguments);
562
+ })
563
+ }, null, 44, _hoisted_15)) : createCommentVNode("v-if", true)],
564
+ 64
565
+ /* STABLE_FRAGMENT */
566
+ );
567
+ }),
568
+ 256
569
+ /* UNKEYED_FRAGMENT */
570
+ ))])])],
571
+ 6
572
+ /* CLASS, STYLE */
573
+ )) : createCommentVNode("v-if", true)];
574
+ }),
575
+ _: 1
576
+ /* STABLE */
577
+ }), createVNode(Transition, {
578
+ name: "viewer-fade"
579
+ }, {
580
+ default: withCtx(function() {
581
+ return [_ctx.state.isThumbnail ? (openBlock(), createElementBlock(
582
+ "div",
583
+ {
584
+ key: 0,
585
+ "data-tag": "tiny-image-mobile-thumbnail-list",
586
+ class: normalizeClass(["w-screen h-screen fixed top-0 left-0 sm:hidden z-40", {
587
+ "hidden": _ctx.state.hiddenThumbnail
588
+ }])
589
+ },
590
+ [createElementVNode("div", _hoisted_16, [(openBlock(true), createElementBlock(
591
+ Fragment,
592
+ null,
593
+ renderList(_ctx.state.urlList, function(item, i) {
594
+ return openBlock(), createElementBlock("div", {
595
+ class: "px-4 pt-4 [&:last-of-type]:mb-5 cursor-pointer",
596
+ key: i,
597
+ onTouchstart: function onTouchstart($event) {
598
+ return _ctx.imagePreview(i);
599
+ }
600
+ }, [createElementVNode("img", {
601
+ class: "bg-current w-full h-auto",
602
+ ref_for: true,
603
+ ref: "img_" + i,
604
+ src: item.url
605
+ }, null, 8, _hoisted_18), createElementVNode("div", {
606
+ title: item.name || item.url,
607
+ class: "color-text-primary mt-2 sm:text-xs text-sm leading-5 overflow-hidden whitespace-nowrap text-ellipsis text-color-text-primary"
608
+ }, toDisplayString(item.name), 9, _hoisted_19)], 40, _hoisted_17);
609
+ }),
610
+ 128
611
+ /* KEYED_FRAGMENT */
612
+ ))])],
613
+ 2
614
+ /* CLASS */
615
+ )) : !_ctx.state.isMenuView ? (openBlock(), createElementBlock("div", _hoisted_20, [_hoisted_21, withDirectives((openBlock(), createElementBlock("div", _hoisted_22, [_ctx.showIndex ? (openBlock(), createElementBlock("div", _hoisted_23, [createElementVNode(
616
+ "span",
617
+ _hoisted_24,
618
+ toDisplayString(_ctx.state.index + 1 + "/" + _ctx.state.urlList.length),
619
+ 1
620
+ /* TEXT */
621
+ )])) : createCommentVNode("v-if", true), createElementVNode(
622
+ "div",
623
+ _hoisted_25,
624
+ [createElementVNode(
625
+ "div",
626
+ {
627
+ class: "h-full flex items-center justify-center",
628
+ style: normalizeStyle({
629
+ "width": _ctx.state.imageAllWidth + "px",
630
+ "transition-duration": _ctx.state.imageTransition + "ms",
631
+ transform: "translateX(" + _ctx.state.imageTransformSize + "px)"
632
+ })
633
+ },
634
+ [(openBlock(true), createElementBlock(
635
+ Fragment,
636
+ null,
637
+ renderList(_ctx.urlList, function(url, i) {
638
+ return openBlock(), createElementBlock(
639
+ "div",
640
+ {
641
+ "data-tag": "tiny-image-mobile-viewer-item",
642
+ class: "relative shrink h-full",
643
+ ref_for: true,
644
+ ref: "viewerItem",
645
+ key: i,
646
+ style: normalizeStyle(Object.assign({
647
+ width: _ctx.state.imageItemWidth + "px"
648
+ }, i === _ctx.state.index ? _ctx.state.imgStyle : ""))
649
+ },
650
+ [createElementVNode("div", _hoisted_26, [i === _ctx.state.index ? (openBlock(), createElementBlock("img", {
651
+ key: i,
652
+ class: normalizeClass(["block w-full h-full object-contain", {
653
+ "object-fill": _ctx.state.fullScreen
654
+ }]),
655
+ ref_for: true,
656
+ ref: "img_" + i,
657
+ src: _ctx.state.currentImg,
658
+ style: normalizeStyle(_ctx.state.imgStyle),
659
+ onMousedown: _cache[9] || (_cache[9] = function() {
660
+ return _ctx.handleMouseDown && _ctx.handleMouseDown.apply(_ctx, arguments);
661
+ }),
662
+ onError: _cache[10] || (_cache[10] = function() {
663
+ return _ctx.handleImgError && _ctx.handleImgError.apply(_ctx, arguments);
664
+ }),
665
+ onLoad: _cache[11] || (_cache[11] = function() {
666
+ return _ctx.handleImgLoad && _ctx.handleImgLoad.apply(_ctx, arguments);
667
+ }),
668
+ onTouchstart: _cache[12] || (_cache[12] = function() {
669
+ return _ctx.touchstart && _ctx.touchstart.apply(_ctx, arguments);
670
+ }),
671
+ onTouchmove: _cache[13] || (_cache[13] = function() {
672
+ return _ctx.touchmove && _ctx.touchmove.apply(_ctx, arguments);
673
+ }),
674
+ onTouchend: _cache[14] || (_cache[14] = function() {
675
+ return _ctx.touchend && _ctx.touchend.apply(_ctx, arguments);
676
+ })
677
+ }, null, 46, _hoisted_27)) : createCommentVNode("v-if", true)])],
678
+ 4
679
+ /* STYLE */
680
+ );
681
+ }),
682
+ 128
683
+ /* KEYED_FRAGMENT */
684
+ ))],
685
+ 4
686
+ /* STYLE */
687
+ )],
688
+ 512
689
+ /* NEED_PATCH */
690
+ )])), [[_directive_swipeleft, _ctx.swipeLeft], [_directive_swiperight, _ctx.swipeRight]])])) : createCommentVNode("v-if", true)];
691
+ }),
692
+ _: 1
693
+ /* STABLE */
694
+ }), createVNode(Transition, {
695
+ name: "viewer-fade"
696
+ }, {
697
+ default: withCtx(function() {
698
+ return [_ctx.state.isImagePreview ? (openBlock(), createElementBlock("div", _hoisted_28, [_hoisted_29, withDirectives((openBlock(), createElementBlock("div", _hoisted_30, [_ctx.showIndex ? (openBlock(), createElementBlock("div", _hoisted_31, [createElementVNode(
699
+ "span",
700
+ _hoisted_32,
701
+ toDisplayString(_ctx.state.index + 1 + "/" + _ctx.state.urlList.length),
702
+ 1
703
+ /* TEXT */
704
+ )])) : createCommentVNode("v-if", true), createElementVNode(
705
+ "div",
706
+ _hoisted_33,
707
+ [createElementVNode(
708
+ "div",
709
+ {
710
+ class: "h-full flex items-center justify-center",
711
+ style: normalizeStyle({
712
+ "width": _ctx.state.imageAllWidth + "px",
713
+ "transition-duration": _ctx.state.imageTransition + "ms",
714
+ transform: "translateX(" + _ctx.state.imageTransformSize + "px)"
715
+ })
716
+ },
717
+ [(openBlock(true), createElementBlock(
718
+ Fragment,
719
+ null,
720
+ renderList(_ctx.state.urlList, function(url, i) {
721
+ return openBlock(), createElementBlock(
722
+ "div",
723
+ {
724
+ "data-tag": "tiny-image-isthumbnail-viewer-item",
725
+ class: "relative shrink h-full",
726
+ ref_for: true,
727
+ ref: "viewerItem",
728
+ key: i,
729
+ style: normalizeStyle(Object.assign({
730
+ width: _ctx.state.imageItemWidth + "px"
731
+ }, i === _ctx.state.index ? _ctx.state.imgStyle : ""))
732
+ },
733
+ [createElementVNode("div", _hoisted_34, [(openBlock(), createElementBlock("img", {
734
+ key: i,
735
+ class: normalizeClass(["block w-full h-full object-contain", {
736
+ "object-fill": _ctx.state.fullScreen
737
+ }]),
738
+ ref_for: true,
739
+ ref: "img_" + i,
740
+ src: _ctx.state.currentImg,
741
+ style: normalizeStyle(_ctx.state.imgStyle),
742
+ onMousedown: _cache[15] || (_cache[15] = function() {
743
+ return _ctx.handleMouseDown && _ctx.handleMouseDown.apply(_ctx, arguments);
744
+ }),
745
+ onError: _cache[16] || (_cache[16] = function() {
746
+ return _ctx.handleImgError && _ctx.handleImgError.apply(_ctx, arguments);
747
+ }),
748
+ onLoad: _cache[17] || (_cache[17] = function() {
749
+ return _ctx.handleImgLoad && _ctx.handleImgLoad.apply(_ctx, arguments);
750
+ }),
751
+ onTouchstart: _cache[18] || (_cache[18] = function() {
752
+ return _ctx.touchstart && _ctx.touchstart.apply(_ctx, arguments);
753
+ }),
754
+ onTouchmove: _cache[19] || (_cache[19] = function() {
755
+ return _ctx.touchmove && _ctx.touchmove.apply(_ctx, arguments);
756
+ }),
757
+ onTouchend: _cache[20] || (_cache[20] = function() {
758
+ return _ctx.touchend && _ctx.touchend.apply(_ctx, arguments);
759
+ })
760
+ }, null, 46, _hoisted_35))])],
761
+ 4
762
+ /* STYLE */
763
+ );
764
+ }),
765
+ 128
766
+ /* KEYED_FRAGMENT */
767
+ ))],
768
+ 4
769
+ /* STYLE */
770
+ )],
771
+ 512
772
+ /* NEED_PATCH */
773
+ )])), [[_directive_swipeleft, _ctx.swipeLeft], [_directive_swiperight, _ctx.swipeRight]])])) : createCommentVNode("v-if", true)];
774
+ }),
775
+ _: 1
776
+ /* STABLE */
777
+ }), createVNode(_component_tiny_action_sheet, {
778
+ type: "action",
779
+ menus: [{
780
+ type: "save",
781
+ label: _ctx.t("ui.imageViewer.save")
484
782
  }, {
485
- name: "swiperight",
486
- rawName: "v-swiperight",
487
- value: _vm.swipeRight,
488
- expression: "swipeRight"
489
- }],
490
- staticClass: "left-0 right-0 top-0 bottom-0 fixed",
491
- attrs: {
492
- "data-tag": "tiny-image-mobile-index"
493
- }
494
- }, [_vm.showIndex ? _c("div", {
495
- staticClass: "absolute flex items-center justify-center box-border left-1/2 -translate-x-1/2 px-4 bottom-12"
496
- }, [_c("span", {
497
- staticClass: "h-4.5 inline-flex items-center text-color-bg-1"
498
- }, [_vm._v(" " + _vm._s(_vm.state.index + 1 + "/" + _vm.state.urlList.length) + " ")])]) : _vm._e(), _c("div", {
499
- ref: "canvasBox",
500
- staticClass: "w-full h-full",
501
- attrs: {
502
- "data-tag": "tiny-image-mobile-canvas"
503
- }
504
- }, [_c("div", {
505
- staticClass: "h-full flex items-center justify-center",
506
- style: {
507
- "width": _vm.state.imageAllWidth + "px",
508
- "transition-duration": _vm.state.imageTransition + "ms",
509
- transform: "translateX(" + _vm.state.imageTransformSize + "px)"
510
- }
511
- }, _vm._l(_vm.urlList, function(url, i) {
512
- return _c("div", {
513
- key: i,
514
- ref: "viewerItem",
515
- refInFor: true,
516
- staticClass: "relative shrink h-full",
517
- style: Object.assign({
518
- width: _vm.state.imageItemWidth + "px"
519
- }, i === _vm.state.index ? _vm.state.imgStyle : ""),
520
- attrs: {
521
- "data-tag": "tiny-image-mobile-viewer-item"
522
- }
523
- }, [_c("div", {
524
- staticClass: "absolute top-0 left-0 right-0 bottom-0 text-center transition-transform inline-block duration-300"
525
- }, [i === _vm.state.index ? _c("img", {
526
- key: i,
527
- ref: "img_" + i,
528
- refInFor: true,
529
- class: ["block w-full h-full object-contain", {
530
- "object-fill": _vm.state.fullScreen
531
- }],
532
- style: _vm.state.imgStyle,
533
- attrs: {
534
- "src": _vm.state.currentImg
535
- },
536
- on: {
537
- "mousedown": _vm.handleMouseDown,
538
- "error": _vm.handleImgError,
539
- "load": _vm.handleImgLoad,
540
- "touchstart": _vm.touchstart,
541
- "touchmove": _vm.touchmove,
542
- "touchend": _vm.touchend
543
- }
544
- }) : _vm._e()])]);
545
- }), 0)])])]) : _vm._e()]), _c("transition", {
546
- attrs: {
547
- "name": "viewer-fade"
548
- }
549
- }, [_vm.state.isImagePreview ? _c("div", {
550
- staticClass: "w-screen h-screen fixed top-0 left-0 z-50 sm:hidden",
551
- attrs: {
552
- "data-tag": "tiny-image-isthumbnail-preview"
553
- }
554
- }, [_c("div", {
555
- staticClass: "absolute w-full h-full top-0 left-0 bg-black",
556
- attrs: {
557
- "data-tag": "tiny-image-mobile-mask"
558
- }
559
- }), _c("div", {
560
- directives: [{
561
- name: "swipeleft",
562
- rawName: "v-swipeleft",
563
- value: _vm.swipeLeft,
564
- expression: "swipeLeft"
783
+ type: "thumbnail",
784
+ label: _ctx.t("ui.imageViewer.thumbnail")
565
785
  }, {
566
- name: "swiperight",
567
- rawName: "v-swiperight",
568
- value: _vm.swipeRight,
569
- expression: "swipeRight"
786
+ type: "del",
787
+ label: _ctx.t("ui.imageViewer.del")
570
788
  }],
571
- staticClass: "left-0 right-0 top-0 bottom-0 fixed",
572
- attrs: {
573
- "data-tag": "tiny-image-isthumbnail-index"
574
- }
575
- }, [_vm.showIndex ? _c("div", {
576
- staticClass: "absolute flex items-center justify-center box-border left-1/2 -translate-x-1/2 px-4 bottom-12"
577
- }, [_c("span", {
578
- staticClass: "h-4.5 inline-flex items-center text-color-bg-1"
579
- }, [_vm._v(" " + _vm._s(_vm.state.index + 1 + "/" + _vm.state.urlList.length) + " ")])]) : _vm._e(), _c("div", {
580
- ref: "thumbnailCanvasBox",
581
- staticClass: "w-full h-full",
582
- attrs: {
583
- "data-tag": "tiny-image-isthumbnail-canvas"
584
- }
585
- }, [_c("div", {
586
- staticClass: "h-full flex items-center justify-center",
587
- style: {
588
- "width": _vm.state.imageAllWidth + "px",
589
- "transition-duration": _vm.state.imageTransition + "ms",
590
- transform: "translateX(" + _vm.state.imageTransformSize + "px)"
591
- }
592
- }, _vm._l(_vm.state.urlList, function(url, i) {
593
- return _c("div", {
594
- key: i,
595
- ref: "viewerItem",
596
- refInFor: true,
597
- staticClass: "relative shrink h-full",
598
- style: Object.assign({
599
- width: _vm.state.imageItemWidth + "px"
600
- }, i === _vm.state.index ? _vm.state.imgStyle : ""),
601
- attrs: {
602
- "data-tag": "tiny-image-isthumbnail-viewer-item"
603
- }
604
- }, [_c("div", {
605
- staticClass: "absolute top-0 left-0 right-0 bottom-0 text-center transition-transform inline-block duration-300"
606
- }, [_c("img", {
607
- key: i,
608
- ref: "img_" + i,
609
- refInFor: true,
610
- class: ["block w-full h-full object-contain", {
611
- "object-fill": _vm.state.fullScreen
612
- }],
613
- style: _vm.state.imgStyle,
614
- attrs: {
615
- "src": _vm.state.currentImg
616
- },
617
- on: {
618
- "mousedown": _vm.handleMouseDown,
619
- "error": _vm.handleImgError,
620
- "load": _vm.handleImgLoad,
621
- "touchstart": _vm.touchstart,
622
- "touchmove": _vm.touchmove,
623
- "touchend": _vm.touchend
624
- }
625
- })])]);
626
- }), 0)])])]) : _vm._e()]), _c("tiny-action-sheet", {
627
- attrs: {
628
- "type": "action",
629
- "menus": [{
630
- type: "save",
631
- label: _vm.t("ui.imageViewer.save")
632
- }, {
633
- type: "thumbnail",
634
- label: _vm.t("ui.imageViewer.thumbnail")
635
- }, {
636
- type: "del",
637
- label: _vm.t("ui.imageViewer.del")
638
- }],
639
- "visible": _vm.state.boxVisibility
640
- },
641
- on: {
642
- "update:visible": function updateVisible($event) {
643
- _vm.state.boxVisibility = $event;
644
- },
645
- "click": _vm.selectOption
646
- },
647
- scopedSlots: _vm._u([{
648
- key: "default",
649
- fn: function fn(data) {
650
- return [_c("div", {
651
- class: [{
789
+ visible: _ctx.state.boxVisibility,
790
+ "onUpdate:visible": _cache[21] || (_cache[21] = function($event) {
791
+ return _ctx.state.boxVisibility = $event;
792
+ }),
793
+ onClick: _ctx.selectOption
794
+ }, {
795
+ default: withCtx(function(data) {
796
+ return [createElementVNode(
797
+ "div",
798
+ {
799
+ class: normalizeClass([{
652
800
  "text-color-error": data.data.type === "del"
653
- }]
654
- }, [_vm._v(_vm._s(data.data.label))])];
655
- }
656
- }], null, false, 852563897)
657
- })], 1) : _vm._e();
658
- };
659
- var staticRenderFns = [];
660
- var __cssModules = {};
661
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
662
- function __vue2_injectStyles(context) {
663
- for (var o in __cssModules) {
664
- this[o] = __cssModules[o];
665
- }
801
+ }])
802
+ },
803
+ toDisplayString(data.data.label),
804
+ 3
805
+ /* TEXT, CLASS */
806
+ )];
807
+ }),
808
+ _: 1
809
+ /* STABLE */
810
+ }, 8, ["menus", "visible", "onClick"])])) : createCommentVNode("v-if", true);
666
811
  }
667
- var mobileFirst = /* @__PURE__ */ function() {
668
- return __component__.exports;
669
- }();
812
+ var mobileFirst = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
670
813
 
671
814
  export { mobileFirst as default };