@greypan/web-ui 9.0.0 → 10.0.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/README.CN.md +102 -31
- package/README.md +115 -42
- package/dist/assets/modal-surface.js +6 -0
- package/dist/assets/modal-surface.js.map +1 -0
- package/dist/components/context-menu/index.d.ts +15 -0
- package/dist/components/context-menu/index.js +50 -46
- package/dist/components/context-menu/index.js.map +1 -1
- package/dist/components/context-menu/scrim.js +1 -1
- package/dist/components/context-menu/scrim.js.map +1 -1
- package/dist/components/dialog/index.d.ts +30 -5
- package/dist/components/dialog/index.js +53 -33
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/style.js +1 -1
- package/dist/components/dialog/style.js.map +1 -1
- package/dist/components/drawer/index.js +54 -49
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/drawer/style.js +1 -1
- package/dist/components/drawer/style.js.map +1 -1
- package/dist/components/image-preview/index.js +66 -61
- package/dist/components/image-preview/index.js.map +1 -1
- package/dist/components/image-preview/style.js +1 -1
- package/dist/components/image-preview/style.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +17 -16
- package/dist/components/input/style.js +1 -1
- package/dist/components/input/style.js.map +1 -1
- package/dist/components/input-number/style.js +1 -1
- package/dist/components/input-number/style.js.map +1 -1
- package/dist/components/layout/index.d.ts +22 -4
- package/dist/components/layout/index.js +46 -26
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/style.js +1 -1
- package/dist/components/layout/style.js.map +1 -1
- package/dist/components/middle-ellipsis/index.d.ts +100 -0
- package/dist/components/middle-ellipsis/index.js +112 -0
- package/dist/components/middle-ellipsis/index.js.map +1 -0
- package/dist/components/middle-ellipsis/style.js +6 -0
- package/dist/components/middle-ellipsis/style.js.map +1 -0
- package/dist/components/middle-ellipsis/truncate.d.ts +62 -0
- package/dist/components/middle-ellipsis/truncate.js +45 -0
- package/dist/components/middle-ellipsis/truncate.js.map +1 -0
- package/dist/components/textarea/style.js +1 -1
- package/dist/components/textarea/style.js.map +1 -1
- package/dist/scrollbars/index.d.ts +33 -0
- package/dist/scrollbars/index.js +18 -0
- package/dist/scrollbars/index.js.map +1 -0
- package/dist/scrollbars/style.css +10 -0
- package/dist/shared/element-width/index.js +37 -0
- package/dist/shared/element-width/index.js.map +1 -0
- package/package.json +14 -2
|
@@ -12,26 +12,27 @@ import { defineOpenOverlay as c } from "../../shared/overlay/open-overlay.js";
|
|
|
12
12
|
import { getFallbackOverlayRoot as l } from "../../shared/overlay/overlay-root.js";
|
|
13
13
|
import { findNearestTheme as u, findRootTheme as d } from "../../shared/overlay/theme-overlay-scope.js";
|
|
14
14
|
import { defineScrollLockLease as f } from "../../shared/scroll-lock/scroll-lock.js";
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import _ from "
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
15
|
+
import p from "../../assets/modal-surface.js";
|
|
16
|
+
import { defineNativeDialogPresence as m } from "../../shared/overlay/native-dialog-presence.js";
|
|
17
|
+
import { attachDragGesture as h } from "../../shared/gesture/drag-gesture.js";
|
|
18
|
+
import { clamp as g } from "../../shared/gesture/physics.js";
|
|
19
|
+
import { attachPinchGesture as _ } from "../../shared/gesture/pinch-gesture.js";
|
|
20
|
+
import v from "./style.js";
|
|
21
|
+
import { LitElement as y, html as b, nothing as x, unsafeCSS as S } from "lit";
|
|
22
|
+
import { customElement as C, property as w, state as T } from "lit/decorators.js";
|
|
23
|
+
import { classMap as E } from "lit/directives/class-map.js";
|
|
24
|
+
import { styleMap as D } from "lit/directives/style-map.js";
|
|
24
25
|
//#region src/components/image-preview/index.ts
|
|
25
|
-
var
|
|
26
|
+
var O = 1, k = 4, A = .5, j = .002, M = 3, N = .15, P = 320, F = 16, I = 160, L = 320, R = class extends y {
|
|
26
27
|
constructor(...e) {
|
|
27
|
-
super(...e), this.images = [], this.loop = !0, this.nav = !1, this.toolbar = !1, this.closable = !1, this.indicator = !1, this.swipe = !1, this.noScrollLock = !1, this.noBackdropClose = !1, this._open = !1, this._index = 0, this._scale =
|
|
28
|
+
super(...e), this.images = [], this.loop = !0, this.nav = !1, this.toolbar = !1, this.closable = !1, this.indicator = !1, this.swipe = !1, this.noScrollLock = !1, this.noBackdropClose = !1, this._open = !1, this._index = 0, this._scale = O, this._offsetX = 0, this._offsetY = 0, this._swipeOffset = 0, this._swipeSettling = !1, this._dragging = !1, this._loadedSources = /* @__PURE__ */ new Set(), this._swipeDir = 0, this._swipeStartTime = 0, this._swipeSettleCommit = !1, this._swipeSettleDir = 1, this._scrollLock = f().make(), this._overlay = c().make({
|
|
28
29
|
requestClose: () => this.close(),
|
|
29
30
|
isConnected: () => this.isConnected
|
|
30
|
-
}), this._handle = null, this._presence =
|
|
31
|
+
}), this._handle = null, this._presence = m().make({
|
|
31
32
|
getDialog: () => this.dialog,
|
|
32
33
|
isConnected: () => this.isConnected,
|
|
33
34
|
isOpen: () => this._open
|
|
34
|
-
}), this._dismissed = !1, this._swipeGesture = !1, this._panOriginX = 0, this._panOriginY = 0, this._dragged = !1, this._blankPointerDown = !1, this._pinchScale =
|
|
35
|
+
}), this._dismissed = !1, this._swipeGesture = !1, this._panOriginX = 0, this._panOriginY = 0, this._dragged = !1, this._blankPointerDown = !1, this._pinchScale = O, this._pinchLocalX = 0, this._pinchLocalY = 0, this._handleImageSettled = (e) => {
|
|
35
36
|
let t = e.currentTarget;
|
|
36
37
|
t && (this._markLoaded(t), this.requestUpdate());
|
|
37
38
|
}, this._handleCancel = (e) => {
|
|
@@ -62,7 +63,7 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
62
63
|
if (!this._open) return;
|
|
63
64
|
e.preventDefault();
|
|
64
65
|
let t = e.deltaMode === 1 ? e.deltaY * 16 : e.deltaY, n = this._stageOrigin();
|
|
65
|
-
this._zoomAt(this._scale * Math.exp(-t *
|
|
66
|
+
this._zoomAt(this._scale * Math.exp(-t * j), e.clientX - n.x, e.clientY - n.y);
|
|
66
67
|
}, this._handleClick = (e) => {
|
|
67
68
|
if (!this._open) return;
|
|
68
69
|
let t = this._blankPointerDown;
|
|
@@ -74,7 +75,7 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
74
75
|
this.noBackdropClose || this.close();
|
|
75
76
|
}
|
|
76
77
|
}, this._handleDoubleClick = (e) => {
|
|
77
|
-
this._open && e.target === this._image && (this._scale >
|
|
78
|
+
this._open && e.target === this._image && (this._scale > O ? this.resetZoom() : this._setScale(k / 2));
|
|
78
79
|
}, this._handlePinchStart = (e) => {
|
|
79
80
|
if (!this._open) return;
|
|
80
81
|
this._endGesture(), this._dragging = !0, this._dragged = !0;
|
|
@@ -82,7 +83,7 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
82
83
|
this._pinchScale = this._scale, this._pinchLocalX = (e.centerX - t.x - this._offsetX) / this._scale, this._pinchLocalY = (e.centerY - t.y - this._offsetY) / this._scale;
|
|
83
84
|
}, this._handlePinchMove = (e) => {
|
|
84
85
|
if (!this._open) return;
|
|
85
|
-
let t =
|
|
86
|
+
let t = g(this._pinchScale * e.ratio, O, k), n = this._stageOrigin();
|
|
86
87
|
this._applyScale(t, e.centerX - n.x - this._pinchLocalX * t, e.centerY - n.y - this._pinchLocalY * t);
|
|
87
88
|
}, this._handlePinchEnd = () => {
|
|
88
89
|
this._dragging = !1;
|
|
@@ -94,9 +95,9 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
94
95
|
if (!this._open || (this._cancelSwipeSettle(), this._swipeDir = 0, this._swipeOffset = 0, e.button !== 0 || e.isPrimary === !1)) return;
|
|
95
96
|
this._blankPointerDown = this._isBlank(e.target), this._dragged = !1;
|
|
96
97
|
let t = this._stage;
|
|
97
|
-
t && (e.target === t || t.contains(e.target)) && (this._swipeGesture = this._scale ===
|
|
98
|
+
t && (e.target === t || t.contains(e.target)) && (this._swipeGesture = this._scale === O && this.swipe && this.images.length > 1, this._swipeStartTime = e.timeStamp, this._panOriginX = this._offsetX, this._panOriginY = this._offsetY, this._gesture?.destroy(), this._gesture = h(e, {
|
|
98
99
|
axis: "both",
|
|
99
|
-
threshold:
|
|
100
|
+
threshold: M,
|
|
100
101
|
onMove: (e) => {
|
|
101
102
|
this._swipeGesture ? (this._swipeOffset = e.deltaX, e.deltaX !== 0 && (this._swipeDir = e.deltaX < 0 ? 1 : -1)) : this._panTo(e.deltaX, e.deltaY);
|
|
102
103
|
},
|
|
@@ -113,7 +114,11 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
113
114
|
};
|
|
114
115
|
}
|
|
115
116
|
static {
|
|
116
|
-
this.styles = [
|
|
117
|
+
this.styles = [
|
|
118
|
+
S(t),
|
|
119
|
+
S(p),
|
|
120
|
+
S(v)
|
|
121
|
+
];
|
|
117
122
|
}
|
|
118
123
|
get dialog() {
|
|
119
124
|
return this.shadowRoot?.querySelector("dialog") ?? null;
|
|
@@ -131,7 +136,7 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
131
136
|
return this._scale;
|
|
132
137
|
}
|
|
133
138
|
configure(e) {
|
|
134
|
-
this.images = e.images, this.loop = e.loop, this.nav = e.nav, this.toolbar = e.toolbar, this.closable = e.closable, this.indicator = e.indicator, this.swipe = e.swipe, this.noScrollLock = e.noScrollLock, this.noBackdropClose = e.noBackdropClose, this._index =
|
|
139
|
+
this.images = e.images, this.loop = e.loop, this.nav = e.nav, this.toolbar = e.toolbar, this.closable = e.closable, this.indicator = e.indicator, this.swipe = e.swipe, this.noScrollLock = e.noScrollLock, this.noBackdropClose = e.noBackdropClose, this._index = g(e.index, 0, Math.max(0, e.images.length - 1));
|
|
135
140
|
}
|
|
136
141
|
show() {
|
|
137
142
|
this._open ||= (this._dismissed = !1, !0);
|
|
@@ -142,7 +147,7 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
142
147
|
goTo(e) {
|
|
143
148
|
let t = this.images.length;
|
|
144
149
|
if (t === 0) return;
|
|
145
|
-
let n = this.loop ? (e % t + t) % t :
|
|
150
|
+
let n = this.loop ? (e % t + t) % t : g(e, 0, t - 1);
|
|
146
151
|
n !== this._index && (this._index = n, this.resetZoom());
|
|
147
152
|
}
|
|
148
153
|
next() {
|
|
@@ -152,13 +157,13 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
152
157
|
this.goTo(this._index - 1);
|
|
153
158
|
}
|
|
154
159
|
zoomIn() {
|
|
155
|
-
this._setScale(this._scale +
|
|
160
|
+
this._setScale(this._scale + A);
|
|
156
161
|
}
|
|
157
162
|
zoomOut() {
|
|
158
|
-
this._setScale(this._scale -
|
|
163
|
+
this._setScale(this._scale - A);
|
|
159
164
|
}
|
|
160
165
|
resetZoom() {
|
|
161
|
-
(this._scale !==
|
|
166
|
+
(this._scale !== O || this._offsetX !== 0 || this._offsetY !== 0) && (this._scale = O, this._offsetX = 0, this._offsetY = 0);
|
|
162
167
|
}
|
|
163
168
|
connectedCallback() {
|
|
164
169
|
super.connectedCallback(), this._presence.reconcile(), this._syncScrollLock(), this._attachPinch(), this._reclaimIfOpen();
|
|
@@ -174,7 +179,7 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
174
179
|
_attachPinch() {
|
|
175
180
|
if (this._pinch) return;
|
|
176
181
|
let e = this._stage;
|
|
177
|
-
e && (this._pinch =
|
|
182
|
+
e && (this._pinch = _(e, {
|
|
178
183
|
onStart: this._handlePinchStart,
|
|
179
184
|
onMove: this._handlePinchMove,
|
|
180
185
|
onEnd: this._handlePinchEnd,
|
|
@@ -201,13 +206,13 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
201
206
|
this._dismissed || this._open || (this._dismissed = !0, this.dispatchEvent(new CustomEvent("preview-dismissed")));
|
|
202
207
|
}
|
|
203
208
|
_zoomAt(e, t, n) {
|
|
204
|
-
let r =
|
|
209
|
+
let r = g(e, O, k);
|
|
205
210
|
if (r === this._scale) return;
|
|
206
211
|
let i = r / this._scale;
|
|
207
212
|
this._applyScale(r, t - (t - this._offsetX) * i, n - (n - this._offsetY) * i);
|
|
208
213
|
}
|
|
209
214
|
_applyScale(e, t, n) {
|
|
210
|
-
if (this._scale = e, e ===
|
|
215
|
+
if (this._scale = e, e === O) {
|
|
211
216
|
this._offsetX = 0, this._offsetY = 0;
|
|
212
217
|
return;
|
|
213
218
|
}
|
|
@@ -248,7 +253,7 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
248
253
|
}
|
|
249
254
|
_clampOffsets() {
|
|
250
255
|
let e = this._offsetBounds();
|
|
251
|
-
this._offsetX =
|
|
256
|
+
this._offsetX = g(this._offsetX, -e.x, e.x), this._offsetY = g(this._offsetY, -e.y, e.y);
|
|
252
257
|
}
|
|
253
258
|
_isBlank(e) {
|
|
254
259
|
return e === this.dialog || e === this._stage;
|
|
@@ -286,16 +291,16 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
286
291
|
this._swipeOffset = 0;
|
|
287
292
|
return;
|
|
288
293
|
}
|
|
289
|
-
let a = Math.max(1, Math.round(i *
|
|
290
|
-
this._swipeSettling = !0, this._swipeSettleCommit = c, this._swipeSettleDir = r, this._swipeOffset = c ? -r * i : 0, this._swipeSettleTimer = setTimeout(() => this._finishSwipeSettle(),
|
|
294
|
+
let a = Math.max(1, Math.round(i * N)), o = n - this._swipeStartTime, s = o >= 2 ? e / o * 1e3 : 0, c = (Math.abs(e) >= a || Math.abs(t) >= P || Math.abs(e) >= F && Math.max(Math.abs(t), Math.abs(s)) >= I) && this._adjacentIndex(r) !== -1;
|
|
295
|
+
this._swipeSettling = !0, this._swipeSettleCommit = c, this._swipeSettleDir = r, this._swipeOffset = c ? -r * i : 0, this._swipeSettleTimer = setTimeout(() => this._finishSwipeSettle(), L);
|
|
291
296
|
}
|
|
292
297
|
_panTo(e, t) {
|
|
293
298
|
let n = this._offsetBounds();
|
|
294
|
-
this._offsetX =
|
|
299
|
+
this._offsetX = g(this._panOriginX + e, -n.x, n.x), this._offsetY = g(this._panOriginY + t, -n.y, n.y);
|
|
295
300
|
}
|
|
296
301
|
render() {
|
|
297
|
-
let e = this.images.length, t = this._scale >
|
|
298
|
-
return
|
|
302
|
+
let e = this.images.length, t = this._scale > O, c = e > 0 ? this._adjacentIndex(-1) : -1, l = e > 0 ? this._adjacentIndex(1) : -1, u = `translate3d(${this._swipeOffset}px, 0, 0)`, d = `translate3d(${this._offsetX}px, ${this._offsetY}px, 0) scale(${this._scale})`, f = t ? "translate3d(0, 0, 0) scale(1)" : `translate3d(0, ${this._offsetY}px, 0) scale(1)`;
|
|
303
|
+
return b`
|
|
299
304
|
<dialog
|
|
300
305
|
aria-label="图片预览"
|
|
301
306
|
@cancel=${this._handleCancel}
|
|
@@ -311,7 +316,7 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
311
316
|
<div class="wui-image-preview-content">
|
|
312
317
|
<div class="wui-image-preview-surface">
|
|
313
318
|
<div
|
|
314
|
-
class=${
|
|
319
|
+
class=${E({
|
|
315
320
|
"wui-image-preview-stage": !0,
|
|
316
321
|
"is-zoomed": t,
|
|
317
322
|
"is-dragging": this._dragging,
|
|
@@ -320,13 +325,13 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
320
325
|
>
|
|
321
326
|
<div
|
|
322
327
|
class="wui-image-preview-track"
|
|
323
|
-
style=${
|
|
328
|
+
style=${D({ transform: u })}
|
|
324
329
|
@transitionend=${this._handleSwipeSettleEnd}
|
|
325
330
|
>
|
|
326
|
-
${c >= 0 ?
|
|
331
|
+
${c >= 0 ? b`
|
|
327
332
|
<div class="wui-image-preview-slide is-prev" aria-hidden="true">
|
|
328
333
|
<img
|
|
329
|
-
class=${
|
|
334
|
+
class=${E({
|
|
330
335
|
"wui-image-preview-image": !0,
|
|
331
336
|
"is-loaded": this._loadedSources.has(this.images[c].src)
|
|
332
337
|
})}
|
|
@@ -334,16 +339,16 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
334
339
|
src=${this.images[c].src}
|
|
335
340
|
alt=${this.images[c].alt ?? ""}
|
|
336
341
|
draggable="false"
|
|
337
|
-
style=${
|
|
342
|
+
style=${D({ transform: f })}
|
|
338
343
|
@load=${this._handleImageSettled}
|
|
339
344
|
@error=${this._handleImageSettled}
|
|
340
345
|
/>
|
|
341
346
|
</div>
|
|
342
|
-
` :
|
|
343
|
-
${e > 0 ?
|
|
347
|
+
` : x}
|
|
348
|
+
${e > 0 ? b`
|
|
344
349
|
<div class="wui-image-preview-slide is-current">
|
|
345
350
|
<img
|
|
346
|
-
class=${
|
|
351
|
+
class=${E({
|
|
347
352
|
"wui-image-preview-image": !0,
|
|
348
353
|
"is-loaded": this._loadedSources.has(this.images[this._index].src)
|
|
349
354
|
})}
|
|
@@ -351,16 +356,16 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
351
356
|
src=${this.images[this._index].src}
|
|
352
357
|
alt=${this.images[this._index].alt ?? ""}
|
|
353
358
|
draggable="false"
|
|
354
|
-
style=${
|
|
359
|
+
style=${D({ transform: d })}
|
|
355
360
|
@load=${this._handleImageSettled}
|
|
356
361
|
@error=${this._handleImageSettled}
|
|
357
362
|
/>
|
|
358
363
|
</div>
|
|
359
|
-
` :
|
|
360
|
-
${l >= 0 ?
|
|
364
|
+
` : x}
|
|
365
|
+
${l >= 0 ? b`
|
|
361
366
|
<div class="wui-image-preview-slide is-next" aria-hidden="true">
|
|
362
367
|
<img
|
|
363
|
-
class=${
|
|
368
|
+
class=${E({
|
|
364
369
|
"wui-image-preview-image": !0,
|
|
365
370
|
"is-loaded": this._loadedSources.has(this.images[l].src)
|
|
366
371
|
})}
|
|
@@ -368,20 +373,20 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
368
373
|
src=${this.images[l].src}
|
|
369
374
|
alt=${this.images[l].alt ?? ""}
|
|
370
375
|
draggable="false"
|
|
371
|
-
style=${
|
|
376
|
+
style=${D({ transform: f })}
|
|
372
377
|
@load=${this._handleImageSettled}
|
|
373
378
|
@error=${this._handleImageSettled}
|
|
374
379
|
/>
|
|
375
380
|
</div>
|
|
376
|
-
` :
|
|
381
|
+
` : x}
|
|
377
382
|
</div>
|
|
378
383
|
</div>
|
|
379
384
|
</div>
|
|
380
385
|
<div class="wui-image-preview-controls">
|
|
381
|
-
${this.indicator ?
|
|
386
|
+
${this.indicator ? b`<span class="wui-image-preview-counter wui-glass" aria-live="polite"
|
|
382
387
|
>${this._index + 1} / ${e}</span
|
|
383
|
-
>` :
|
|
384
|
-
${this.closable ?
|
|
388
|
+
>` : x}
|
|
389
|
+
${this.closable ? b`
|
|
385
390
|
<web-ui-button
|
|
386
391
|
class="wui-image-preview-close"
|
|
387
392
|
variant="glass"
|
|
@@ -392,8 +397,8 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
392
397
|
>
|
|
393
398
|
<web-ui-icon size="16" .icon=${o}></web-ui-icon>
|
|
394
399
|
</web-ui-button>
|
|
395
|
-
` :
|
|
396
|
-
${this.nav && e > 1 ?
|
|
400
|
+
` : x}
|
|
401
|
+
${this.nav && e > 1 ? b`
|
|
397
402
|
<web-ui-button
|
|
398
403
|
class="wui-image-preview-nav wui-image-preview-nav-prev"
|
|
399
404
|
variant="glass"
|
|
@@ -416,15 +421,15 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
416
421
|
>
|
|
417
422
|
<web-ui-icon size="20" .icon=${r}></web-ui-icon>
|
|
418
423
|
</web-ui-button>
|
|
419
|
-
` :
|
|
420
|
-
${this.toolbar ?
|
|
424
|
+
` : x}
|
|
425
|
+
${this.toolbar ? b`
|
|
421
426
|
<div class="wui-image-preview-toolbar wui-glass">
|
|
422
427
|
<web-ui-button
|
|
423
428
|
variant="glass"
|
|
424
429
|
icon
|
|
425
430
|
size="30"
|
|
426
431
|
aria-label="缩小"
|
|
427
|
-
?disabled=${this._scale <=
|
|
432
|
+
?disabled=${this._scale <= O}
|
|
428
433
|
@click=${this.zoomOut}
|
|
429
434
|
>
|
|
430
435
|
<web-ui-icon size="16" .icon=${a}></web-ui-icon>
|
|
@@ -435,7 +440,7 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
435
440
|
icon
|
|
436
441
|
size="30"
|
|
437
442
|
aria-label="放大"
|
|
438
|
-
?disabled=${this._scale >=
|
|
443
|
+
?disabled=${this._scale >= k}
|
|
439
444
|
@click=${this.zoomIn}
|
|
440
445
|
>
|
|
441
446
|
<web-ui-icon size="16" .icon=${i}></web-ui-icon>
|
|
@@ -445,21 +450,21 @@ var D = 1, O = 4, k = .5, A = .002, j = 3, M = .15, N = 320, P = 16, F = 160, I
|
|
|
445
450
|
icon
|
|
446
451
|
size="30"
|
|
447
452
|
aria-label="重置缩放"
|
|
448
|
-
?disabled=${this._scale <=
|
|
453
|
+
?disabled=${this._scale <= O && !this._isPanned}
|
|
449
454
|
@click=${this.resetZoom}
|
|
450
455
|
>
|
|
451
456
|
<web-ui-icon size="16" .icon=${s}></web-ui-icon>
|
|
452
457
|
</web-ui-button>
|
|
453
458
|
</div>
|
|
454
|
-
` :
|
|
459
|
+
` : x}
|
|
455
460
|
</div>
|
|
456
461
|
</div>
|
|
457
462
|
</dialog>
|
|
458
463
|
`;
|
|
459
464
|
}
|
|
460
465
|
};
|
|
461
|
-
e([
|
|
462
|
-
function
|
|
466
|
+
e([w({ attribute: !1 })], R.prototype, "images", void 0), e([w({ attribute: !1 })], R.prototype, "loop", void 0), e([w({ attribute: !1 })], R.prototype, "nav", void 0), e([w({ attribute: !1 })], R.prototype, "toolbar", void 0), e([w({ attribute: !1 })], R.prototype, "closable", void 0), e([w({ attribute: !1 })], R.prototype, "indicator", void 0), e([w({ attribute: !1 })], R.prototype, "swipe", void 0), e([w({ attribute: !1 })], R.prototype, "noScrollLock", void 0), e([w({ attribute: !1 })], R.prototype, "noBackdropClose", void 0), e([T()], R.prototype, "_open", void 0), e([T()], R.prototype, "_index", void 0), e([T()], R.prototype, "_scale", void 0), e([T()], R.prototype, "_offsetX", void 0), e([T()], R.prototype, "_offsetY", void 0), e([T()], R.prototype, "_swipeOffset", void 0), e([T()], R.prototype, "_swipeSettling", void 0), e([T()], R.prototype, "_dragging", void 0), R = e([C("web-ui-image-preview")], R);
|
|
467
|
+
function z(e) {
|
|
463
468
|
let t = (e.images ?? []).map((e) => ({
|
|
464
469
|
src: e.src,
|
|
465
470
|
alt: e.alt ?? ""
|
|
@@ -506,6 +511,6 @@ function R(e) {
|
|
|
506
511
|
};
|
|
507
512
|
}
|
|
508
513
|
//#endregion
|
|
509
|
-
export {
|
|
514
|
+
export { z as imagePreview };
|
|
510
515
|
|
|
511
516
|
//# sourceMappingURL=index.js.map
|