zan-layer 1.0.4 → 1.0.6
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.md +353 -194
- package/lib/index.css +1 -1
- package/lib/zan-layer.js +1 -1
- package/lib/zan-layer.umd.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,197 +1,356 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- 🎛️ **完整API** - open、close、msg、confirm、load、drawer、notify、photos、prompt
|
|
16
|
-
|
|
17
|
-
## 📦 安装
|
|
18
|
-
|
|
19
|
-
```bash
|
|
1
|
+
# zan-layer
|
|
2
|
+
|
|
3
|
+
Vue 3 弹层组件库,提供函数式弹层 API 和组件能力,适合中后台常见的消息、确认框、页面层、抽屉、通知、图片预览和输入层。
|
|
4
|
+
|
|
5
|
+
## 适用范围
|
|
6
|
+
|
|
7
|
+
- 通用确认框、消息、加载层
|
|
8
|
+
- 需要承载 Vue 组件内容的页面层 / 抽屉
|
|
9
|
+
- 图片预览、通知消息、输入弹层
|
|
10
|
+
- 希望用统一 API 管理打开、关闭、最大化、最小化、恢复等动作
|
|
11
|
+
|
|
12
|
+
## 安装
|
|
13
|
+
|
|
14
|
+
```bash
|
|
20
15
|
npm install zan-layer
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
样式需要显式引入:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import 'zan-layer/lib/index.css'
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 快速开始
|
|
25
|
+
|
|
26
|
+
### 全局安装
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { createApp } from 'vue'
|
|
29
30
|
import ZanLayer from 'zan-layer'
|
|
30
31
|
import 'zan-layer/lib/index.css'
|
|
31
|
-
|
|
32
|
-
const app = createApp(App)
|
|
33
|
-
app.use(ZanLayer)
|
|
34
|
-
app.mount('#app')
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
32
|
+
|
|
33
|
+
const app = createApp(App)
|
|
34
|
+
app.use(ZanLayer)
|
|
35
|
+
app.mount('#app')
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
安装后:
|
|
39
|
+
|
|
40
|
+
- 注册组件:`<ZanLayer />`
|
|
41
|
+
- 挂载全局方法:`app.config.globalProperties.$layer`
|
|
42
|
+
- 可直接导入函数式 API:`import { layer, zanLayer } from 'zan-layer'`
|
|
43
|
+
|
|
44
|
+
### 直接使用函数式 API
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import { layer } from 'zan-layer'
|
|
48
|
+
|
|
49
|
+
layer.msg('操作成功')
|
|
50
|
+
|
|
51
|
+
layer.confirm('确定要删除吗?', {
|
|
52
|
+
yes: (id: string) => {
|
|
53
|
+
console.log('confirmed')
|
|
54
|
+
layer.close(id)
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 导出内容
|
|
60
|
+
|
|
61
|
+
包对外提供:
|
|
62
|
+
|
|
63
|
+
- 默认导出:`ZanLayerPlugin`
|
|
64
|
+
- 命名导出:`layer`
|
|
65
|
+
- 命名导出:`zanLayer`,与 `layer` 等价
|
|
66
|
+
- 命名导出:`ZanLayer`
|
|
67
|
+
- 类型导出:`LayerProps`、`BtnType`、`ImgListType` 等
|
|
68
|
+
|
|
69
|
+
## 常用方法
|
|
70
|
+
|
|
71
|
+
### `layer.open(options)`
|
|
72
|
+
|
|
73
|
+
通用页面层入口,几乎所有复杂弹层场景都从这里开始。
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
const id = layer.open({
|
|
77
|
+
type: 'page',
|
|
78
|
+
title: '编辑商品',
|
|
79
|
+
content: '这里可以放字符串、VNode 或返回 VNode 的函数',
|
|
80
|
+
area: ['720px', '560px'],
|
|
81
|
+
shadeClose: false,
|
|
82
|
+
maxmin: true,
|
|
83
|
+
resize: true
|
|
84
|
+
})
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### `layer.msg(message, options?)`
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
layer.msg('保存成功', {
|
|
91
|
+
icon: 1,
|
|
92
|
+
time: 2000
|
|
93
|
+
})
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### `layer.confirm(message, options?)`
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
layer.confirm('确定提交吗?', {
|
|
100
|
+
yes: (id: string) => {
|
|
101
|
+
submit()
|
|
102
|
+
layer.close(id)
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### `layer.load(type?, options?)`
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
const loadingId = layer.load(0, {
|
|
111
|
+
shade: true,
|
|
112
|
+
shadeOpacity: '0.3'
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
setTimeout(() => {
|
|
116
|
+
layer.close(loadingId)
|
|
117
|
+
}, 1500)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### `layer.drawer(options)`
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
layer.drawer({
|
|
124
|
+
title: '筛选条件',
|
|
125
|
+
content: '这里是抽屉内容',
|
|
126
|
+
offset: 'r',
|
|
127
|
+
area: ['420px', '100%']
|
|
128
|
+
})
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### `layer.notify(options)`
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
layer.notify({
|
|
135
|
+
title: '新消息',
|
|
136
|
+
content: '订单已完成支付',
|
|
137
|
+
icon: 1,
|
|
138
|
+
offset: 'rt',
|
|
139
|
+
time: 3000
|
|
140
|
+
})
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### `layer.photos(options)`
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
layer.photos({
|
|
147
|
+
imgList: [
|
|
148
|
+
{ src: '/img/1.jpg', alt: '图片1' },
|
|
149
|
+
{ src: '/img/2.jpg', alt: '图片2' }
|
|
150
|
+
],
|
|
151
|
+
startIndex: 0
|
|
152
|
+
})
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### `layer.prompt(options)`
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
layer.prompt({
|
|
159
|
+
title: '请输入备注',
|
|
160
|
+
formType: 'textarea',
|
|
161
|
+
value: '默认内容',
|
|
162
|
+
maxLength: 100,
|
|
163
|
+
yes: (id: string, value: string) => {
|
|
164
|
+
console.log(value)
|
|
165
|
+
layer.close(id)
|
|
166
|
+
}
|
|
167
|
+
})
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## `LayerProps` 核心字段
|
|
171
|
+
|
|
172
|
+
最常用字段如下:
|
|
173
|
+
|
|
174
|
+
| 字段 | 说明 |
|
|
175
|
+
| --- | --- |
|
|
176
|
+
| `type` | 弹层类型,支持数字和字符串别名 |
|
|
177
|
+
| `title` | 标题,可传字符串、VNode、返回 VNode 的函数,传 `false` 可隐藏 |
|
|
178
|
+
| `footer` | 底部区域内容 |
|
|
179
|
+
| `content` | 主体内容,支持字符串、VNode、函数 |
|
|
180
|
+
| `area` | 宽高,如 `'560px'` 或 `['720px', '560px']` |
|
|
181
|
+
| `offset` | 位置,如 `'r'`、`'rt'`、`'auto'` 或坐标数组 |
|
|
182
|
+
| `shade` | 是否显示遮罩 |
|
|
183
|
+
| `shadeClose` | 点击遮罩是否关闭 |
|
|
184
|
+
| `shadeOpacity` | 遮罩透明度 |
|
|
185
|
+
| `move` | 是否允许拖拽 |
|
|
186
|
+
| `resize` | 是否允许右下角拉伸 |
|
|
187
|
+
| `maxmin` | 是否显示最大化/最小化按钮 |
|
|
188
|
+
| `closeBtn` | 是否显示关闭按钮 |
|
|
189
|
+
| `btn` | 自定义底部按钮 |
|
|
190
|
+
| `btnAlign` | 底部按钮对齐方式 |
|
|
191
|
+
| `anim` | 入场动画 |
|
|
192
|
+
| `isOutAnim` | 是否启用退场动画 |
|
|
193
|
+
| `icon` | 消息/通知图标 |
|
|
194
|
+
| `time` | 自动关闭时间,毫秒 |
|
|
195
|
+
| `zIndex` | 层级 |
|
|
196
|
+
| `appContext` | 函数式渲染时复用宿主 Vue app 上下文 |
|
|
197
|
+
|
|
198
|
+
## 弹层类型
|
|
199
|
+
|
|
200
|
+
`type` 支持数字和字符串两套写法:
|
|
201
|
+
|
|
202
|
+
- `0` / `'dialog'`
|
|
203
|
+
- `1` / `'page'`
|
|
204
|
+
- `2` / `'iframe'`
|
|
205
|
+
- `3` / `'loading'`
|
|
206
|
+
- `4` / `'drawer'`
|
|
207
|
+
- `5` / `'photos'`
|
|
208
|
+
- `6` / `'notify'`
|
|
209
|
+
- `7` / `'prompt'`
|
|
210
|
+
|
|
211
|
+
## 在 Vue 组件中承载真实组件内容
|
|
212
|
+
|
|
213
|
+
这是中后台里最常见的用法。`content` 推荐直接传 VNode,且把 `appContext` 一起带上,避免丢失注入、全局组件或 UI 库上下文。
|
|
214
|
+
|
|
215
|
+
```ts
|
|
216
|
+
import { getCurrentInstance, h } from 'vue'
|
|
217
|
+
import { layer } from 'zan-layer'
|
|
218
|
+
import EditForm from './EditForm.vue'
|
|
219
|
+
|
|
220
|
+
const instance = getCurrentInstance()
|
|
221
|
+
|
|
222
|
+
layer.open({
|
|
223
|
+
type: 'page',
|
|
224
|
+
title: '编辑商品',
|
|
225
|
+
area: ['880px', '620px'],
|
|
226
|
+
resize: true,
|
|
227
|
+
maxmin: true,
|
|
228
|
+
appContext: instance?.appContext,
|
|
229
|
+
content: h(EditForm, {
|
|
230
|
+
productId: 1001
|
|
231
|
+
})
|
|
232
|
+
})
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
如果你需要在关闭时拿到实例 ID,推荐先接住 `open()` 返回值:
|
|
236
|
+
|
|
237
|
+
```ts
|
|
238
|
+
const layerId = layer.open({
|
|
239
|
+
title: '详情',
|
|
240
|
+
appContext: instance?.appContext,
|
|
241
|
+
content: h(DetailPanel, {
|
|
242
|
+
onClose: () => layer.close(layerId)
|
|
243
|
+
})
|
|
244
|
+
})
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## 自定义按钮
|
|
248
|
+
|
|
249
|
+
```ts
|
|
250
|
+
layer.open({
|
|
251
|
+
title: '批量操作',
|
|
252
|
+
content: '确认执行吗?',
|
|
253
|
+
btnAlign: 'r',
|
|
254
|
+
btn: [
|
|
255
|
+
{
|
|
256
|
+
text: '取消',
|
|
257
|
+
callback: id => layer.close(id)
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
text: '确认',
|
|
261
|
+
type: 'primary',
|
|
262
|
+
callback: id => {
|
|
263
|
+
runAction()
|
|
264
|
+
layer.close(id)
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
})
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
`BtnType` 支持:
|
|
272
|
+
|
|
273
|
+
- `text`
|
|
274
|
+
- `type`
|
|
275
|
+
- `style`
|
|
276
|
+
- `class`
|
|
277
|
+
- `disabled`
|
|
278
|
+
- `callback`
|
|
279
|
+
|
|
280
|
+
## 生命周期和交互回调
|
|
281
|
+
|
|
282
|
+
### 常用业务回调
|
|
283
|
+
|
|
284
|
+
- `success`
|
|
285
|
+
- `end`
|
|
286
|
+
- `yes`
|
|
287
|
+
- `beforeClose`
|
|
288
|
+
- `close`
|
|
289
|
+
|
|
290
|
+
### 拖拽 / 缩放回调
|
|
291
|
+
|
|
292
|
+
- `moveStart`
|
|
293
|
+
- `moving`
|
|
294
|
+
- `moveEnd`
|
|
295
|
+
- `resizeStart`
|
|
296
|
+
- `resizing`
|
|
297
|
+
- `resizeEnd`
|
|
298
|
+
|
|
299
|
+
示例:
|
|
300
|
+
|
|
301
|
+
```ts
|
|
302
|
+
layer.open({
|
|
303
|
+
title: '可拖拽窗口',
|
|
304
|
+
content: '拖动后记录位置',
|
|
305
|
+
move: true,
|
|
306
|
+
resize: true,
|
|
307
|
+
moveEnd: (id, options) => {
|
|
308
|
+
console.log(id, options.left, options.top)
|
|
309
|
+
},
|
|
310
|
+
resizeEnd: (id, options) => {
|
|
311
|
+
console.log(id, options.width, options.height)
|
|
312
|
+
}
|
|
313
|
+
})
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## 控制方法
|
|
317
|
+
|
|
318
|
+
打开后可通过实例 ID 做控制:
|
|
319
|
+
|
|
320
|
+
- `layer.close(id)`
|
|
321
|
+
- `layer.closeAll()`
|
|
322
|
+
- `layer.reset(id)`
|
|
323
|
+
- `layer.min(id)`
|
|
324
|
+
- `layer.full(id)`
|
|
325
|
+
- `layer.revert(id)`
|
|
326
|
+
|
|
327
|
+
## 安装选项
|
|
328
|
+
|
|
329
|
+
插件安装时支持传入自定义 `zIndex`:
|
|
330
|
+
|
|
331
|
+
```ts
|
|
332
|
+
app.use(ZanLayer, {
|
|
333
|
+
zIndex: 3000
|
|
334
|
+
})
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## 使用建议
|
|
338
|
+
|
|
339
|
+
- 页面层、抽屉、复杂表单弹层优先走 `layer.open()` / `layer.drawer()`
|
|
340
|
+
- 函数式打开 Vue 组件时,优先传 `appContext`
|
|
341
|
+
- 通知和消息属于短生命周期,不要把复杂交互塞进 `notify` / `msg`
|
|
342
|
+
- 如果你有统一视觉规范,建议在宿主项目里覆盖 `layerClasses` 或 `contentClass`
|
|
343
|
+
|
|
344
|
+
## 边界与限制
|
|
345
|
+
|
|
346
|
+
- 当前主打浏览器端函数式弹层,不是 SSR 优先组件
|
|
347
|
+
- `content` 是字符串时只做内容渲染,不会自动编译成 Vue 模板
|
|
348
|
+
- 需要复杂表单、表格、图表内容时,推荐传真实 VNode,而不是大段 HTML 字符串
|
|
349
|
+
|
|
350
|
+
## 开发命令
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
npm run dev
|
|
354
|
+
npm run build
|
|
355
|
+
npm run acceptance:smoke
|
|
356
|
+
```
|
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.zan-icon-btn[data-v-8d683fcb]{position:relative;width:20px;height:20px;display:inline-block;cursor:pointer;color:#333;font-style:normal;text-align:center;padding:2px}.zan-icon-btn[data-v-8d683fcb]:hover{color:var(--global-primary-color)}.zan-tooltip[data-v-8d683fcb]{position:absolute;bottom:-32px;left:50%;transform:translate(-50%);padding:4px 8px;background-color:#000000bf;color:#fff;font-size:12px;white-space:nowrap;border-radius:4px;pointer-events:none;opacity:0;transition:opacity .3s;z-index:9999}.zan-tooltip[data-v-8d683fcb]:before{content:"";position:absolute;top:-4px;left:50%;transform:translate(-50%);width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(0,0,0,.75)}.zan-icon-btn:hover .zan-tooltip[data-v-8d683fcb]{opacity:1}.zan-icon-min[data-v-8d683fcb]:before{content:"";position:absolute;bottom:8px;left:0;width:16px;height:2px;text-align:center;background-color:currentColor}.zan-icon-max[data-v-8d683fcb]:before{content:"";position:absolute;top:4px;left:4px;width:12px;height:12px;border:2px solid currentColor}.zan-icon-full[data-v-8d683fcb]:before{content:"";position:absolute;top:4px;left:4px;width:12px;height:12px;border:2px solid currentColor}.zan-icon-restore[data-v-8d683fcb]:before{content:"";position:absolute;top:4px;left:4px;width:10px;height:10px;border:2px solid currentColor}.zan-icon-restore[data-v-8d683fcb]:after{content:"";position:absolute;top:6px;left:6px;width:10px;height:10px;border:2px solid currentColor;background:#fff}.zan-icon-close-btn[data-v-8d683fcb]:before,.zan-icon-close-btn[data-v-8d683fcb]:after{content:"";position:absolute;top:50%;left:50%;width:16px;height:2px;background-color:currentColor}.zan-icon-close-btn[data-v-8d683fcb]:before{transform:translate(-50%,-50%) rotate(45deg)}.zan-icon-close-btn[data-v-8d683fcb]:after{transform:translate(-50%,-50%) rotate(-45deg)}.zan-layer-close2[data-v-8d683fcb]:before,.zan-layer-close2[data-v-8d683fcb]:after{width:16px;height:2px}:root{--global-primary-color: #16baaa;--global-border-radius: 2px}.zan-layer-imgbar,.zan-layer-imgtit a,.zan-layer-tab .zan-layer-title span,.zan-layer-title{text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:none;user-select:none}.zan-layer,.zan-layer-shade{position:absolute;pointer-events:auto}.zan-layer-shade{top:0;left:0;width:100%;height:100%;background-color:#000}.zan-layer{top:0;left:0;display:flex;flex-direction:column;box-shadow:1px 1px 50px #0000004d;background-color:#fff;border-radius:var(--global-border-radius);padding:0;margin:0;will-change:transform,width,height;transform:translateZ(0);backface-visibility:hidden}.zan-layer-close{position:absolute}.zan-layer-content{position:relative;flex:1 1 auto}.zan-layer-dialog .zan-layer-content,.zan-layer-page .zan-layer-content{min-width:200px;min-height:100px}.zan-layer-border{border:1px solid #eeeeee;box-shadow:1px 1px 5px #0003}.zan-layer-btn a,.zan-layer-dialog .zan-layer-ico,.zan-layer-setwin a{display:inline-block;vertical-align:top}.zan-layer-resize{z-index:999999999;position:absolute;width:15px;height:15px;right:0;bottom:0;cursor:se-resize}.zan-layer-resizing,.zan-layer-resizing *,.zan-layer-moving,.zan-layer-moving *{pointer-events:none}.zan-layer-anim{animation-fill-mode:both;animation-duration:.3s}.zan-layer-drawer-anim{animation-duration:.3s;animation-timing-function:cubic-bezier(.7,.3,.1,1)}@keyframes zan-layer-rl{0%{transform:translate3d(100%,0,0);opacity:1}to{transform:translateZ(0);opacity:1}}.zan-layer-anim-rl{animation-name:zan-layer-rl}@keyframes zan-layer-rl-close{0%{transform:translateZ(0)}to{transform:translate3d(100%,0,0)}}.zan-layer-anim-rl-close{animation-name:zan-layer-rl-close}@keyframes zan-layer-lr{0%{transform:translate3d(-100%,0,0);opacity:1}to{transform:translateZ(0);opacity:1}}.zan-layer-anim-lr{animation-name:zan-layer-lr}@keyframes zan-layer-lr-close{0%{transform:translateZ(0)}to{transform:translate3d(-100%,0,0)}}.zan-layer-anim-lr-close{animation-name:zan-layer-lr-close}@keyframes zan-layer-tb{0%{transform:translate3d(0,-100%,0);opacity:1;animation-timing-function:cubic-bezier(.7,.3,.1,1)}to{transform:translateZ(0);opacity:1;animation-timing-function:cubic-bezier(.7,.3,.1,1)}}.zan-layer-anim-tb{animation-name:zan-layer-tb}@keyframes zan-layer-tb-close{0%{transform:translateZ(0)}to{transform:translate3d(0,-100%,0)}}.zan-layer-anim-tb-close{animation-name:zan-layer-tb-close}@keyframes zan-layer-bt{0%{transform:translate3d(0,100%,0);opacity:1}to{transform:translateZ(0);opacity:1}}.zan-layer-anim-bt{animation-name:zan-layer-bt}@keyframes zan-layer-bt-close{0%{transform:translateZ(0)}to{transform:translate3d(0,100%,0)}}.zan-layer-anim-bt-close{animation-name:zan-layer-bt-close}@keyframes zan-layer-bounceIn{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.zan-layer-anim-00{animation-name:zan-layer-bounceIn}@keyframes zan-layer-zoomInDown{0%{opacity:0;transform:scale(.1) translateY(-2000px);animation-timing-function:ease-in-out}60%{opacity:1;transform:scale(.475) translateY(60px);animation-timing-function:ease-out}}.zan-layer-anim-01{animation-name:zan-layer-zoomInDown}@keyframes zan-layer-fadeInUpBig{0%{opacity:0;transform:translateY(2000px)}to{opacity:1;transform:translateY(0)}}.zan-layer-anim-02{animation-name:zan-layer-fadeInUpBig}@keyframes zan-layer-zoomInLeft{0%{opacity:0;transform:scale(.1) translate(-2000px);animation-timing-function:ease-in-out}60%{opacity:1;transform:scale(.475) translate(48px);animation-timing-function:ease-out}}.zan-layer-anim-03{animation-name:zan-layer-zoomInLeft}@keyframes zan-layer-rollIn{0%{opacity:0;transform:translate(-100%) rotate(-120deg)}to{opacity:1;transform:translate(0) rotate(0)}}.zan-layer-anim-04{animation-name:zan-layer-rollIn}@keyframes zan-layer-fadeIn{0%{opacity:0}to{opacity:1}}.zan-layer-anim-05{animation-name:zan-layer-fadeIn}@keyframes zan-layer-shake{0%,to{transform:translate(0)}10%,30%,50%,70%,90%{transform:translate(-10px)}20%,40%,60%,80%{transform:translate(10px)}}.zan-layer-anim-06{animation-name:zan-layer-shake}.zan-layer-title{padding:0 100px 0 5px;height:36px;line-height:36px;border-bottom:1px solid #f0f0f0;font-size:14px;color:#333;overflow:hidden;border-radius:2px 2px 0 0;flex-shrink:0}.zan-layer-setwin{position:absolute;right:5px;top:5px;font-size:0;line-height:initial;display:flex;align-items:center;gap:5px}.zan-layer-setwin a{position:relative;width:16px;height:16px;margin-left:0;font-size:12px}.zan-layer-setwin i{position:relative;width:16px;height:16px;margin-left:0;font-size:16px;color:#333;cursor:pointer;transition:color .3s}.zan-layer-setwin i:hover{color:var(--global-primary-color)}.zan-layer-btn{text-align:right;padding:0 5px 5px;pointer-events:auto}.zan-layer-btn a{height:28px;line-height:28px;padding:0 5px;border-radius:var(--global-border-radius);border:1px solid #dedede;background-color:#fff;cursor:pointer;color:#333;font-weight:400;margin-left:5px}.zan-layer-btn-disabled{border-color:#eee!important;background-color:#fbfbfb!important;color:#d2d2d2!important;cursor:not-allowed!important}.zan-layer-btn .zan-layer-btn0{border-color:var(--global-primary-color);background-color:var(--global-primary-color);color:#fff}.zan-layer-btn-l{text-align:left}.zan-layer-btn-c{text-align:center}.zan-layer-dialog{min-width:300px}.zan-layer-dialog .zan-layer-content{position:relative;padding:5px;line-height:22px;word-break:break-all;overflow:hidden;font-size:13px;overflow-x:hidden;overflow-y:auto;color:#333}.zan-layer-msg{min-width:180px;border:1px solid rgba(220,220,220,.5);box-shadow:2px 0 8px #1d232908}.zan-layer-msg .zan-layer-content{padding:10px;text-align:center;line-height:22px;font-size:13px}.zan-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:#0009;color:#fff;border:none}.zan-layer-hui .zan-layer-content{padding:5px;text-align:center;color:#fff}.zan-layer-dialog .zan-layer-padding{padding:5px 5px 5px 50px;text-align:left}.zan-layer-drawer{border-radius:0}.zan-layer-drawer .zan-layer-content,.zan-layer-page .zan-layer-content{position:relative;overflow:auto;padding:5px;color:#333;font-size:13px;line-height:1.5}.zan-layer-drawer .zan-layer-btn,.zan-layer-iframe .zan-layer-btn,.zan-layer-page .zan-layer-btn{padding-top:5px}.zan-layer-iframe iframe{display:block;width:100%;height:100%}.zan-layer-loading{border-radius:100%;background:#000000b3;box-shadow:none;border:none}.zan-layer-loading .zan-layer-content{background:transparent;display:flex;align-items:center;justify-content:center;position:relative;min-width:auto;min-height:auto}.zan-layer-loading0{padding:15px}.zan-layer-loading0 .zan-layer-content{width:60px;height:24px;padding:0}.zan-layer-loading0 .zan-layer-content:after{content:"";position:absolute;width:60px;height:24px;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA2MCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsPSIjZmZmIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI0Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiBkdXI9IjFzIiB2YWx1ZXM9IjA7MTswIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAiLz48L2NpcmNsZT48Y2lyY2xlIGN4PSIzMCIgY3k9IjEyIiByPSI0Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiBkdXI9IjFzIiB2YWx1ZXM9IjA7MTswIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuMzMzIi8+PC9jaXJjbGU+PGNpcmNsZSBjeD0iNDgiIGN5PSIxMiIgcj0iNCI+PGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgZHVyPSIxcyIgdmFsdWVzPSIwOzE7MCIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIwLjY2NiIvPjwvY2lyY2xlPjwvc3ZnPg==) no-repeat center;background-size:contain}.zan-layer-loading1{padding:20px}.zan-layer-loading1 .zan-layer-content{width:40px;height:40px;padding:0}.zan-layer-loading1 .zan-layer-content:after{content:"";position:absolute;width:32px;height:32px;border:3px solid #fff;border-top-color:transparent;border-radius:50%;animation:zan-spin 1s linear infinite}.zan-layer-loading2{padding:20px}.zan-layer-loading2 .zan-layer-content{width:40px;height:40px;padding:0}.zan-layer-loading2 .zan-layer-content:after{content:"";position:absolute;width:32px;height:32px;border:4px solid;border-color:#fff transparent #fff transparent;border-radius:50%;animation:zan-spin 1.2s linear infinite}@keyframes zan-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.zan-layer-photos{background:#000000e6;box-shadow:none;border:none}.zan-layer-photos .zan-layer-content{overflow:hidden;text-align:center;background:transparent}.zan-layer-photos .zan-layer-phimg img{position:relative;width:100%;height:100%;display:inline-block;vertical-align:top;object-fit:contain}.zan-layer-imgnext,.zan-layer-imgprev{position:fixed;top:50%;width:40px;height:60px;margin-top:-30px;outline:0;font-size:40px;color:#fff;text-align:center;line-height:60px;cursor:pointer;text-decoration:none}.zan-layer-imgprev{left:30px}.zan-layer-imgnext{right:30px}.zan-layer-imgbar{position:fixed;left:0;right:0;bottom:0;width:100%;min-height:40px;height:auto;line-height:40px;background-color:#02000059;color:#fff;overflow:hidden;font-size:0;opacity:0;transition:all 1s ease-in-out;display:flex;flex-wrap:wrap;justify-content:center}.zan-layer-imgtit *{display:inline-block;vertical-align:top;font-size:12px}.zan-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.zan-layer-imgtit em{padding-left:5px;font-style:normal}.zan-layer-imgbar .thumb-row{width:100%;display:flex;justify-content:center;align-self:center}.zan-layer-imgbar .thumb-box{width:100px;height:100px;margin:0;display:inline-flex;align-items:center;justify-content:center;position:relative}.zan-layer-imgbar .thumb-box-border{position:absolute;top:0;transition:all .2s ease-in-out;width:100px;height:100px;border:1px solid #5fb878;box-sizing:border-box}.zan-layer-imgbar img{max-width:100%;max-height:100%;object-fit:contain}@keyframes zan-layer-bounceOut{to{opacity:0;transform:scale(.7)}30%{transform:scale(1.05)}0%{transform:scale(1)}}.zan-layer-anim-close{animation-name:zan-layer-bounceOut;animation-fill-mode:both;animation-duration:.2s}.zan-layer-notifiy{border:none;box-shadow:none}.zan-layer-notifiy-wrapper{padding:5px 10px 5px 5px;box-sizing:border-box;background-color:#fff;overflow:hidden;border-radius:4px;border:1px solid #ebeef5;box-shadow:0 2px 8px #0000001a;min-width:280px;max-width:380px;transition:opacity .3s,transform .3s}.zan-layer-notifiy-wrapper .title{font-weight:600;font-size:14px;color:#303133;margin:0;display:flex;align-items:center;gap:8px;line-height:1.4}.zan-layer-notifiy-wrapper .content{font-size:13px;line-height:1.5;margin:8px 0 0;color:#606266;word-break:break-word}.zan-layer-notifiy-wrapper .content img{max-width:100%}.zan-icon-close{cursor:pointer;width:20px;height:20px;position:absolute;top:10px;right:10px;color:#909399;font-style:normal;font-size:16px;line-height:20px;transition:color .3s;display:flex;align-items:center;justify-content:center}.zan-icon-close svg{width:20px;height:20px}.zan-icon-close:hover{color:#333}.zan-layer-notifiy-transition{transition:top .3s ease-in-out,opacity .3s ease-in-out}.zan-layer-notifiy-wrapper .title .zan-icon{display:inline-block;position:inherit;margin:0;transform:scale(1);height:24px!important;width:24px!important;line-height:24px;font-size:16px;flex-shrink:0}.zan-icon{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;text-align:center;line-height:1;font-style:normal;font-size:26px;font-weight:700;flex-shrink:0}.zan-icon-ico1{background-color:#67c23a;color:#fff}.zan-icon-ico1:before{content:"✓"}.zan-icon-ico2{background-color:#f56c6c;color:#fff}.zan-icon-ico2:before{content:"✕"}.zan-icon-ico3{background-color:#e6a23c;color:#fff}.zan-icon-ico3:before{content:"?"}.zan-icon-ico4{background-color:#409eff;color:#fff}.zan-icon-ico4:before{content:"ℹ"}.zan-icon-ico5{background-color:#e6a23c;color:#fff}.zan-icon-ico5:before{content:"☹"}.zan-icon-ico6{background-color:#67c23a;color:#fff}.zan-icon-ico6:before{content:"☺"}.zan-icon-ico7{background-color:#f56c6c;color:#fff}.zan-icon-ico7:before{content:"!"}.zan-icon-ico16{background:transparent}.zan-input,.zan-textarea{width:100%;padding:5px;border:1px solid #ddd;border-radius:var(--global-border-radius);font-size:13px;outline:none;box-sizing:border-box;font-family:inherit}.zan-input:focus,.zan-textarea:focus{border-color:var(--global-primary-color)}.zan-textarea{min-height:80px;resize:vertical;line-height:1.5}.zan-layer-dialog .zan-input,.zan-layer-dialog .zan-textarea{margin-top:8px}.zan-layer-dialog .zan-layer-content>.zan-input,.zan-layer-dialog .zan-layer-content>.zan-textarea{display:block;width:100%}.zan-layer-dialog .zan-layer-content .zan-input,.zan-layer-dialog .zan-layer-content .zan-textarea{width:100%}.zan-layer-msg .zan-icon{margin-right:10px;vertical-align:middle}.zan-layer-msg .zan-layer-content{display:flex;align-items:center;justify-content:center;padding:10px;min-height:48px}.zan-layer-dialog .zan-layer-padding .zan-icon{position:absolute;left:10px;top:10px}.zan-layer.zan-layer-min{z-index:99999}.zan-layer.zan-layer-min .zan-layer-title{cursor:default;-webkit-user-select:none;user-select:none}.zan-layer.zan-layer-min:hover{box-shadow:0 2px 8px #0000004d}.zan-layer.zan-layer-tips{background:transparent!important;box-shadow:none!important;border:none!important;padding:0!important}.zan-layer.zan-layer-tips .zan-layer-content{padding:0!important;min-width:auto!important;min-height:auto!important;background:transparent!important;overflow:visible!important}
|
|
1
|
+
.zan-icon-btn[data-v-a2b66c03]{position:relative;width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--zan-layer-header-icon-color, #333);font-style:normal;text-align:center;padding:2px;border-radius:4px;transition:color .2s ease,background-color .2s ease}.zan-icon-btn[data-v-a2b66c03]:hover{color:var(--zan-layer-header-icon-hover-color, var(--global-primary-color, #2563eb));background-color:var(--zan-layer-header-icon-hover-bg, transparent)}.zan-tooltip[data-v-a2b66c03]{position:absolute;bottom:-32px;left:50%;transform:translate(-50%);padding:4px 8px;background-color:#000000bf;color:#fff;font-size:12px;white-space:nowrap;border-radius:4px;pointer-events:none;opacity:0;transition:opacity .3s;z-index:9999}.zan-tooltip[data-v-a2b66c03]:before{content:"";position:absolute;top:-4px;left:50%;transform:translate(-50%);width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(0,0,0,.75)}.zan-icon-btn:hover .zan-tooltip[data-v-a2b66c03]{opacity:1}.zan-icon-min[data-v-a2b66c03]:before{content:"";position:absolute;bottom:8px;left:0;width:16px;height:2px;text-align:center;background-color:currentColor}.zan-icon-max[data-v-a2b66c03]:before{content:"";position:absolute;top:4px;left:4px;width:12px;height:12px;border:2px solid currentColor}.zan-icon-full[data-v-a2b66c03]:before{content:"";position:absolute;top:4px;left:4px;width:12px;height:12px;border:2px solid currentColor}.zan-icon-restore[data-v-a2b66c03]:before{content:"";position:absolute;top:4px;left:4px;width:10px;height:10px;border:2px solid currentColor}.zan-icon-restore[data-v-a2b66c03]:after{content:"";position:absolute;top:6px;left:6px;width:10px;height:10px;border:2px solid currentColor;background:var(--zan-layer-surface-color, white)}.zan-icon-close-btn[data-v-a2b66c03]:before,.zan-icon-close-btn[data-v-a2b66c03]:after{content:"";position:absolute;top:50%;left:50%;width:16px;height:2px;background-color:currentColor}.zan-icon-close-btn[data-v-a2b66c03]:before{transform:translate(-50%,-50%) rotate(45deg)}.zan-icon-close-btn[data-v-a2b66c03]:after{transform:translate(-50%,-50%) rotate(-45deg)}.zan-layer-close2[data-v-a2b66c03]:before,.zan-layer-close2[data-v-a2b66c03]:after{width:16px;height:2px}:root{--global-primary-color: rgb(var(--primary-color, 22 186 170));--global-border-radius: 2px;--zan-layer-surface-color: rgb(var(--container-bg-color, 255 255 255));--zan-layer-text-color: rgb(var(--base-text-color, 51 51 51));--zan-layer-muted-text-color: rgba(var(--base-text-color, 51 51 51), .72);--zan-layer-subtle-text-color: rgba(var(--base-text-color, 51 51 51), .58);--zan-layer-border-color: rgba(var(--base-text-color, 51 51 51), .08);--zan-layer-title-border-color: rgba(var(--base-text-color, 51 51 51), .08);--zan-layer-button-border-color: rgba(var(--base-text-color, 51 51 51), .12);--zan-layer-button-bg: rgba(var(--base-text-color, 51 51 51), .04);--zan-layer-button-text: rgb(var(--base-text-color, 51 51 51));--zan-layer-button-disabled-border-color: rgba(var(--base-text-color, 51 51 51), .08);--zan-layer-button-disabled-bg: rgba(var(--base-text-color, 51 51 51), .03);--zan-layer-button-disabled-text: rgba(var(--base-text-color, 51 51 51), .36);--zan-layer-input-bg: rgba(var(--base-text-color, 51 51 51), .04);--zan-layer-input-border-color: rgba(var(--base-text-color, 51 51 51), .12);--zan-layer-notify-bg: rgb(var(--container-bg-color, 255 255 255));--zan-layer-notify-border-color: rgba(var(--base-text-color, 51 51 51), .08);--zan-layer-notify-title-color: rgb(var(--base-text-color, 48 49 51));--zan-layer-notify-content-color: rgba(var(--base-text-color, 51 51 51), .72);--zan-layer-header-icon-color: rgba(var(--base-text-color, 51 51 51), .68);--zan-layer-header-icon-hover-color: rgb(var(--primary-color, 22 186 170));--zan-layer-header-icon-hover-bg: rgba(var(--primary-color, 22 186 170), .12);--zan-layer-notify-close-color: rgba(var(--base-text-color, 51 51 51), .62);--zan-layer-notify-close-hover-color: rgb(var(--primary-color, 22 186 170))}.zan-layer-imgbar,.zan-layer-imgtit a,.zan-layer-tab .zan-layer-title span,.zan-layer-title{text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:none;user-select:none}.zan-layer,.zan-layer-shade{position:absolute;pointer-events:auto}.zan-layer-shade{top:0;left:0;width:100%;height:100%;background-color:#000}.zan-layer{top:0;left:0;display:flex;flex-direction:column;box-shadow:1px 1px 50px #0000004d;background-color:var(--zan-layer-surface-color);border-radius:var(--global-border-radius);padding:0;margin:0;color:var(--zan-layer-text-color);will-change:transform,width,height;transform:translateZ(0);backface-visibility:hidden}.zan-layer-close{position:absolute}.zan-layer-content{position:relative;flex:1 1 auto}.zan-layer-dialog .zan-layer-content,.zan-layer-page .zan-layer-content{min-width:200px;min-height:100px}.zan-layer-border{border:1px solid var(--zan-layer-border-color);box-shadow:1px 1px 5px #0003}.zan-layer-btn a,.zan-layer-dialog .zan-layer-ico,.zan-layer-setwin a{display:inline-block;vertical-align:top}.zan-layer-resize{z-index:999999999;position:absolute;width:15px;height:15px;right:0;bottom:0;cursor:se-resize}.zan-layer-resizing,.zan-layer-resizing *,.zan-layer-moving,.zan-layer-moving *{pointer-events:none}.zan-layer-anim{animation-fill-mode:both;animation-duration:.3s}.zan-layer-drawer-anim{animation-duration:.3s;animation-timing-function:cubic-bezier(.7,.3,.1,1)}@keyframes zan-layer-rl{0%{transform:translate3d(100%,0,0);opacity:1}to{transform:translateZ(0);opacity:1}}.zan-layer-anim-rl{animation-name:zan-layer-rl}@keyframes zan-layer-rl-close{0%{transform:translateZ(0)}to{transform:translate3d(100%,0,0)}}.zan-layer-anim-rl-close{animation-name:zan-layer-rl-close}@keyframes zan-layer-lr{0%{transform:translate3d(-100%,0,0);opacity:1}to{transform:translateZ(0);opacity:1}}.zan-layer-anim-lr{animation-name:zan-layer-lr}@keyframes zan-layer-lr-close{0%{transform:translateZ(0)}to{transform:translate3d(-100%,0,0)}}.zan-layer-anim-lr-close{animation-name:zan-layer-lr-close}@keyframes zan-layer-tb{0%{transform:translate3d(0,-100%,0);opacity:1;animation-timing-function:cubic-bezier(.7,.3,.1,1)}to{transform:translateZ(0);opacity:1;animation-timing-function:cubic-bezier(.7,.3,.1,1)}}.zan-layer-anim-tb{animation-name:zan-layer-tb}@keyframes zan-layer-tb-close{0%{transform:translateZ(0)}to{transform:translate3d(0,-100%,0)}}.zan-layer-anim-tb-close{animation-name:zan-layer-tb-close}@keyframes zan-layer-bt{0%{transform:translate3d(0,100%,0);opacity:1}to{transform:translateZ(0);opacity:1}}.zan-layer-anim-bt{animation-name:zan-layer-bt}@keyframes zan-layer-bt-close{0%{transform:translateZ(0)}to{transform:translate3d(0,100%,0)}}.zan-layer-anim-bt-close{animation-name:zan-layer-bt-close}@keyframes zan-layer-bounceIn{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.zan-layer-anim-00{animation-name:zan-layer-bounceIn}@keyframes zan-layer-zoomInDown{0%{opacity:0;transform:scale(.1) translateY(-2000px);animation-timing-function:ease-in-out}60%{opacity:1;transform:scale(.475) translateY(60px);animation-timing-function:ease-out}}.zan-layer-anim-01{animation-name:zan-layer-zoomInDown}@keyframes zan-layer-fadeInUpBig{0%{opacity:0;transform:translateY(2000px)}to{opacity:1;transform:translateY(0)}}.zan-layer-anim-02{animation-name:zan-layer-fadeInUpBig}@keyframes zan-layer-zoomInLeft{0%{opacity:0;transform:scale(.1) translate(-2000px);animation-timing-function:ease-in-out}60%{opacity:1;transform:scale(.475) translate(48px);animation-timing-function:ease-out}}.zan-layer-anim-03{animation-name:zan-layer-zoomInLeft}@keyframes zan-layer-rollIn{0%{opacity:0;transform:translate(-100%) rotate(-120deg)}to{opacity:1;transform:translate(0) rotate(0)}}.zan-layer-anim-04{animation-name:zan-layer-rollIn}@keyframes zan-layer-fadeIn{0%{opacity:0}to{opacity:1}}.zan-layer-anim-05{animation-name:zan-layer-fadeIn}@keyframes zan-layer-shake{0%,to{transform:translate(0)}10%,30%,50%,70%,90%{transform:translate(-10px)}20%,40%,60%,80%{transform:translate(10px)}}.zan-layer-anim-06{animation-name:zan-layer-shake}.zan-layer-title{padding:0 100px 0 5px;height:36px;line-height:36px;border-bottom:1px solid var(--zan-layer-title-border-color);font-size:14px;color:var(--zan-layer-text-color);overflow:hidden;border-radius:2px 2px 0 0;flex-shrink:0}.zan-layer-setwin{position:absolute;right:5px;top:5px;font-size:0;line-height:initial;display:flex;align-items:center;gap:5px}.zan-layer-setwin a{position:relative;width:16px;height:16px;margin-left:0;font-size:12px}.zan-layer-setwin i{position:relative;width:16px;height:16px;margin-left:0;font-size:16px;color:var(--zan-layer-header-icon-color);cursor:pointer;transition:color .3s,background-color .3s}.zan-layer-setwin i:hover{color:var(--zan-layer-header-icon-hover-color);background-color:var(--zan-layer-header-icon-hover-bg)}.zan-layer-btn{text-align:right;padding:0 5px 5px;pointer-events:auto}.zan-layer-btn a{height:28px;line-height:28px;padding:0 5px;border-radius:var(--global-border-radius);border:1px solid var(--zan-layer-button-border-color);background-color:var(--zan-layer-button-bg);cursor:pointer;color:var(--zan-layer-button-text);font-weight:400;margin-left:5px}.zan-layer-btn-disabled{border-color:var(--zan-layer-button-disabled-border-color)!important;background-color:var(--zan-layer-button-disabled-bg)!important;color:var(--zan-layer-button-disabled-text)!important;cursor:not-allowed!important}.zan-layer-btn .zan-layer-btn0{border-color:var(--global-primary-color);background-color:var(--global-primary-color);color:#fff}.zan-layer-btn-l{text-align:left}.zan-layer-btn-c{text-align:center}.zan-layer-dialog{min-width:300px}.zan-layer-dialog .zan-layer-content{position:relative;padding:5px;line-height:22px;word-break:break-all;overflow:hidden;font-size:13px;overflow-x:hidden;overflow-y:auto;color:var(--zan-layer-text-color)}.zan-layer-msg{min-width:180px;border:1px solid rgba(220,220,220,.5);box-shadow:2px 0 8px #1d232908}.zan-layer-msg .zan-layer-content{padding:10px;text-align:center;line-height:22px;font-size:13px}.zan-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:#0009;color:#fff;border:none}.zan-layer-hui .zan-layer-content{padding:5px;text-align:center;color:#fff}.zan-layer-dialog .zan-layer-padding{padding:5px 5px 5px 50px;text-align:left}.zan-layer-drawer{border-radius:0}.zan-layer-drawer .zan-layer-content,.zan-layer-page .zan-layer-content{position:relative;overflow:auto;padding:5px;color:var(--zan-layer-text-color);font-size:13px;line-height:1.5}.zan-layer-drawer .zan-layer-btn,.zan-layer-iframe .zan-layer-btn,.zan-layer-page .zan-layer-btn{padding-top:5px}.zan-layer-iframe iframe{display:block;width:100%;height:100%}.zan-layer-loading{border-radius:100%;background:#000000b3;box-shadow:none;border:none}.zan-layer-loading .zan-layer-content{background:transparent;display:flex;align-items:center;justify-content:center;position:relative;min-width:auto;min-height:auto}.zan-layer-loading0{padding:15px}.zan-layer-loading0 .zan-layer-content{width:60px;height:24px;padding:0}.zan-layer-loading0 .zan-layer-content:after{content:"";position:absolute;width:60px;height:24px;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA2MCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsPSIjZmZmIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI0Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiBkdXI9IjFzIiB2YWx1ZXM9IjA7MTswIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAiLz48L2NpcmNsZT48Y2lyY2xlIGN4PSIzMCIgY3k9IjEyIiByPSI0Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiBkdXI9IjFzIiB2YWx1ZXM9IjA7MTswIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuMzMzIi8+PC9jaXJjbGU+PGNpcmNsZSBjeD0iNDgiIGN5PSIxMiIgcj0iNCI+PGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgZHVyPSIxcyIgdmFsdWVzPSIwOzE7MCIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIwLjY2NiIvPjwvY2lyY2xlPjwvc3ZnPg==) no-repeat center;background-size:contain}.zan-layer-loading1{padding:20px}.zan-layer-loading1 .zan-layer-content{width:40px;height:40px;padding:0}.zan-layer-loading1 .zan-layer-content:after{content:"";position:absolute;width:32px;height:32px;border:3px solid #fff;border-top-color:transparent;border-radius:50%;animation:zan-spin 1s linear infinite}.zan-layer-loading2{padding:20px}.zan-layer-loading2 .zan-layer-content{width:40px;height:40px;padding:0}.zan-layer-loading2 .zan-layer-content:after{content:"";position:absolute;width:32px;height:32px;border:4px solid;border-color:#fff transparent #fff transparent;border-radius:50%;animation:zan-spin 1.2s linear infinite}@keyframes zan-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.zan-layer-photos{background:#000000e6;box-shadow:none;border:none}.zan-layer-photos .zan-layer-content{overflow:hidden;text-align:center;background:transparent}.zan-layer-photos .zan-layer-phimg img{position:relative;width:100%;height:100%;display:inline-block;vertical-align:top;object-fit:contain}.zan-layer-imgnext,.zan-layer-imgprev{position:fixed;top:50%;width:40px;height:60px;margin-top:-30px;outline:0;font-size:40px;color:#fff;text-align:center;line-height:60px;cursor:pointer;text-decoration:none}.zan-layer-imgprev{left:30px}.zan-layer-imgnext{right:30px}.zan-layer-imgbar{position:fixed;left:0;right:0;bottom:0;width:100%;min-height:40px;height:auto;line-height:40px;background-color:#02000059;color:#fff;overflow:hidden;font-size:0;opacity:0;transition:all 1s ease-in-out;display:flex;flex-wrap:wrap;justify-content:center}.zan-layer-imgtit *{display:inline-block;vertical-align:top;font-size:12px}.zan-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.zan-layer-imgtit em{padding-left:5px;font-style:normal}.zan-layer-imgbar .thumb-row{width:100%;display:flex;justify-content:center;align-self:center}.zan-layer-imgbar .thumb-box{width:100px;height:100px;margin:0;display:inline-flex;align-items:center;justify-content:center;position:relative}.zan-layer-imgbar .thumb-box-border{position:absolute;top:0;transition:all .2s ease-in-out;width:100px;height:100px;border:1px solid #5fb878;box-sizing:border-box}.zan-layer-imgbar img{max-width:100%;max-height:100%;object-fit:contain}@keyframes zan-layer-bounceOut{to{opacity:0;transform:scale(.7)}30%{transform:scale(1.05)}0%{transform:scale(1)}}.zan-layer-anim-close{animation-name:zan-layer-bounceOut;animation-fill-mode:both;animation-duration:.2s}.zan-layer-notifiy{border:none;box-shadow:none}.zan-layer-notifiy-wrapper{padding:5px 10px 5px 5px;box-sizing:border-box;background-color:var(--zan-layer-notify-bg);overflow:hidden;border-radius:4px;border:1px solid var(--zan-layer-notify-border-color);box-shadow:0 2px 8px #0000001a;min-width:280px;max-width:380px;transition:opacity .3s,transform .3s}.zan-layer-notifiy-wrapper .title{font-weight:600;font-size:14px;color:var(--zan-layer-notify-title-color);margin:0;display:flex;align-items:center;gap:8px;line-height:1.4}.zan-layer-notifiy-wrapper .content{font-size:13px;line-height:1.5;margin:8px 0 0;color:var(--zan-layer-notify-content-color);word-break:break-word}.zan-layer-notifiy-wrapper .content img{max-width:100%}.zan-icon-close{cursor:pointer;width:20px;height:20px;position:absolute;top:10px;right:10px;color:var(--zan-layer-notify-close-color);font-style:normal;font-size:16px;line-height:20px;transition:color .3s;display:flex;align-items:center;justify-content:center}.zan-icon-close svg{width:20px;height:20px}.zan-icon-close:hover{color:var(--zan-layer-notify-close-hover-color)}.zan-layer-notifiy-transition{transition:top .3s ease-in-out,opacity .3s ease-in-out}.zan-layer-notifiy-wrapper .title .zan-icon{display:inline-block;position:inherit;margin:0;transform:scale(1);height:24px!important;width:24px!important;line-height:24px;font-size:16px;flex-shrink:0}.zan-icon{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;text-align:center;line-height:1;font-style:normal;font-size:26px;font-weight:700;flex-shrink:0}.zan-icon-ico1{background-color:#67c23a;color:#fff}.zan-icon-ico1:before{content:"✓"}.zan-icon-ico2{background-color:#f56c6c;color:#fff}.zan-icon-ico2:before{content:"✕"}.zan-icon-ico3{background-color:#e6a23c;color:#fff}.zan-icon-ico3:before{content:"?"}.zan-icon-ico4{background-color:#409eff;color:#fff}.zan-icon-ico4:before{content:"ℹ"}.zan-icon-ico5{background-color:#e6a23c;color:#fff}.zan-icon-ico5:before{content:"☹"}.zan-icon-ico6{background-color:#67c23a;color:#fff}.zan-icon-ico6:before{content:"☺"}.zan-icon-ico7{background-color:#f56c6c;color:#fff}.zan-icon-ico7:before{content:"!"}.zan-icon-ico16{background:transparent}.zan-input,.zan-textarea{width:100%;padding:5px;border:1px solid var(--zan-layer-input-border-color);border-radius:var(--global-border-radius);font-size:13px;outline:none;box-sizing:border-box;font-family:inherit;background-color:var(--zan-layer-input-bg);color:var(--zan-layer-text-color)}.zan-input:focus,.zan-textarea:focus{border-color:var(--global-primary-color)}.zan-textarea{min-height:80px;resize:vertical;line-height:1.5}.zan-layer-dialog .zan-input,.zan-layer-dialog .zan-textarea{margin-top:8px}.zan-layer-dialog .zan-layer-content>.zan-input,.zan-layer-dialog .zan-layer-content>.zan-textarea{display:block;width:100%}.zan-layer-dialog .zan-layer-content .zan-input,.zan-layer-dialog .zan-layer-content .zan-textarea{width:100%}.zan-layer-msg .zan-icon{margin-right:10px;vertical-align:middle}.zan-layer-msg .zan-layer-content{display:flex;align-items:center;justify-content:center;padding:10px;min-height:48px}.zan-layer-dialog .zan-layer-padding .zan-icon{position:absolute;left:10px;top:10px}.zan-layer.zan-layer-min{z-index:99999}.zan-layer.zan-layer-min .zan-layer-title{cursor:default;-webkit-user-select:none;user-select:none}.zan-layer.zan-layer-min:hover{box-shadow:0 2px 8px #0000004d}.zan-layer.zan-layer-tips{background:transparent!important;box-shadow:none!important;border:none!important;padding:0!important}.zan-layer.zan-layer-tips .zan-layer-content{padding:0!important;min-width:auto!important;min-height:auto!important;background:transparent!important;overflow:visible!important}
|
package/lib/zan-layer.js
CHANGED
|
@@ -290,7 +290,7 @@ const kt = /* @__PURE__ */ A({
|
|
|
290
290
|
for (const [t, o] of n)
|
|
291
291
|
l[t] = o;
|
|
292
292
|
return l;
|
|
293
|
-
}, Ft = /* @__PURE__ */ Ot(Bt, [["__scopeId", "data-v-
|
|
293
|
+
}, Ft = /* @__PURE__ */ Ot(Bt, [["__scopeId", "data-v-a2b66c03"]]), Et = { class: "zan-layer-phimg" }, Ht = ["src"], At = {
|
|
294
294
|
key: 0,
|
|
295
295
|
class: "zan-layer-imgsee"
|
|
296
296
|
}, Mt = {
|
package/lib/zan-layer.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(v,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(v=typeof globalThis<"u"?globalThis:v||self,t(v.ZanLayer={},v.Vue))})(this,function(v,t){"use strict";const he=t.defineComponent({name:"Shade",__name:"Shade",props:{visible:{type:[Boolean,String]},opacity:{},index:{type:[Number,Function]},teleport:{},teleportDisabled:{type:Boolean},shadeStyle:{type:[Boolean,null,String,Object,Array]}},emits:["shadeClick"],setup(e,{emit:l}){const o=e,n=l,i=t.computed(()=>[{opacity:o.opacity,position:o.teleportDisabled||o.teleport!="body"?"absolute":"fixed",zIndex:o.index},o.shadeStyle]),r=()=>{n("shadeClick")};return(d,a)=>e.visible?(t.openBlock(),t.createElementBlock("div",{key:0,class:"zan-layer-shade",style:t.normalizeStyle(i.value),onClick:r},null,4)):t.createCommentVNode("",!0)}}),ge=["src"],ke=t.defineComponent({name:"Iframe",__name:"Iframe",props:{src:{}},setup(e){const l=e,o=t.computed(()=>l.src);return(n,i)=>(t.openBlock(),t.createElementBlock("iframe",{scrolling:"auto",class:"zan-layer-iframe",allowtransparency:"true",frameborder:"0",src:o.value},null,8,ge))}}),_=t.defineComponent({name:"ZanRender",props:{render:{type:Function,required:!0}},setup(e){return()=>e.render()}}),M=function(e){return typeof e=="function"?e():typeof e=="string"?t.h("span",e):e};function J(){const e=[],l="0123456789abcdef";for(let n=0;n<36;n++)e[n]=l.substr(Math.floor(Math.random()*16),1);return e[14]="4",e[19]=l.substr(e[19]&3|8,1),e[8]=e[13]=e[18]=e[23]="-",e.join("").replaceAll("-","")}function xe(e,l,o){return e!="drawer"&&e!=4?Be(l):ee(o,l)}function Be(e){return e==null||e==="auto"?[]:typeof e=="string"?[e]:e[1]&&e[1]==="auto"?e[0]&&e[0]==="auto"?[]:[e[0]]:e[0]&&e[0]==="auto"?e[1]&&e[1]!="auto"?[void 0,e[1]]:[]:[...e]}function ee(e,l="30%"){return l==null&&(l="30%"),l instanceof Array?l:(l==="auto"&&(l="30%"),e==="l"||e==="r"||e==="lt"||e==="lb"||e==="rt"||e==="rb"?[l,"100%"]:e==="t"||e==="b"||e==="tr"||e==="tl"||e==="br"||e==="bl"?["100%",l]:[l,"100%"])}function te(e){return e==null||e===""?"0px":e}function Q(e="auto",l,o){e==null&&(e="auto");const n=Array.isArray(l)?l:[],i=te(n[0]),r=te(n[1]),d=["t","r","b","l","lt","tl","lb","bl","rt","tr","rb","br"],a=[];return e==="auto"&&o==4&&(e="r"),typeof e=="string"?d.indexOf(e)>-1?(e==="t"&&(a[0]="0px",a[1]="calc(50% - "+i+"/2)"),e==="l"&&(a[0]="calc(50% - "+r+"/2)",a[1]="0px"),e==="b"&&(a[0]="calc(100% - "+r+")",a[1]="calc(50% - "+i+"/2)"),e==="r"&&(a[0]="calc(50% - "+r+"/2)",a[1]="calc(100% - "+i+")"),(e==="lt"||e==="tl")&&(a[0]="0px",a[1]="0px"),(e==="lb"||e==="bl")&&(a[0]="calc(100% - "+r+")",a[1]="0px"),(e==="rt"||e==="tr")&&(a[0]="0px",a[1]="calc(100% - "+i+")"),(e==="rb"||e==="br")&&(a[0]="calc(100% - "+r+")",a[1]="calc(100% - "+i+")")):e=="auto"?(a[0]="calc(50% - "+r+"/2)",a[1]="calc(50% - "+i+"/2)"):(a[0]=e,a[1]="calc(50% - "+i+"/2)"):e&&e[0]!==void 0&&e[1]!==void 0?(a[0]=e[0],a[1]=e[1]):(a[0]="calc(50% - "+r+"/2)",a[1]="calc(50% - "+i+"/2)"),a}function be(e){return e==="dialog"||e==0?0:e==="page"||e==1?1:e==="iframe"||e==2?2:e==="loading"||e==3?3:e==="drawer"||e==4?4:e==="photos"||e==5?5:e==="notify"||e==6?6:e==="prompt"||e==7?7:0}function ne(){return{w:"100%",h:"100%"}}function le(){return{t:"0px",l:"0px"}}function oe(e){var n,i;const l=(n=getComputedStyle(e,null))==null?void 0:n.width,o=(i=getComputedStyle(e,null))==null?void 0:i.height;return[l,o]}const F=[];function H(e,l){let o=0;if(l){const n=F.findIndex(i=>i===void 0);n===-1?(F.push(e),o=F.length-1):(F[n]=e,o=n)}else delete F[F.findIndex(n=>n==e)],o=-1;return o}function ae(e,l=!1){const o=["rl"],n="zan-layer-drawer-anim zan-layer-anim";return e==="l"||e==="lt"||e==="lb"?o[0]="lr":e==="r"||e==="rt"||e==="rb"?o[0]="rl":e==="t"||e==="tr"||e==="tl"?o[0]="tb":(e==="b"||e==="br"||e==="bl")&&(o[0]="bt"),l?`${n}-${o[0]}-close`:`${n}-${o[0]}`}async function ie(e,l){const o=new Image;return o.src=e,new Promise((i,r)=>{if(o.complete){i(n(o));return}const d=x.load(2,{shadeOpacity:"0"});o.onload=()=>{x.close(d),i(n(o))},o.onerror=()=>{x.close(d),x.msg("图片加载失败"),r(!1)}});function n(i){const r=[i.width,i.height],d=[window.innerWidth-250,window.innerHeight-250];if(r[0]>d[0]||r[1]>d[1]){const a=[r[0]/d[0],r[1]/d[1]];a[0]>a[1]?(r[0]=r[0]/a[0],r[1]=r[1]/a[0]):a[0]<a[1]&&(r[0]=r[0]/a[1],r[1]=r[1]/a[1])}return[r[0]+"px",r[1]+"px"]}}function Z(e,l){const o=document.getElementsByClassName(e);for(let n=0;n<o.length;n++){const i=o[n];if(i.id===l)return i}}function Ce(e,l,o){const n=["lt","lb","rt","rb"];let i="0",r="0",a=15;window.NotifiyQueen=window.NotifiyQueen||[];const c=window.NotifiyQueen;(typeof e!="string"||n.indexOf(e)===-1)&&(e="rt");const f=c.filter(s=>{if(s.offset===e)return s});let m=f.length>0?f[f.length-1]:null;if(m)if(m=Z("zan-layer",m.id),e==="rt"||e==="lt")a+=m.offsetHeight+parseFloat(m.style.top);else{const s=parseFloat(m.style.top.split(" - ")[1]);a+=m.offsetHeight+s}else(e==="rb"||e==="lb")&&(a+=parseFloat(l[1]));return e==="rt"?(i=a+"px",r="calc(100% - "+(parseFloat(l[0])+15)+"px)"):e==="rb"?(i="calc(100% - "+a+"px)",r="calc(100% - "+(parseFloat(l[0])+15)+"px)"):e==="lt"?(i=a+"px",r="15px"):e==="lb"&&(i="calc(100% - "+a+"px)",r="15px"),c.push({id:o,offset:e}),[i,r]}function ze(e){const l=Z("zan-layer",e);if(!l)return;const o=15,n=l.offsetHeight;window.NotifiyQueen=window.NotifiyQueen||[];const i=window.NotifiyQueen,r=i.findIndex(m=>m.id===e),d=i[r].offset,a=i.filter(m=>{if(m.offset===d)return m}),c=a.findIndex(m=>m.id===e);a.slice(c+1).forEach(m=>{const s=Z("zan-layer",m.id);if(d==="rt"||d==="lt")s.style.top=parseFloat(s.style.top)-o-n+"px";else{const y=parseFloat(s.style.top.split(" - ")[1])-o-n;s.style.top="calc(100% - "+y+"px)"}}),i.splice(r,1)}function Ee(e){const l="zan-layer-drawer-anim zan-layer-anim";let o="";return e==="lt"||e==="lb"?o="lr":o="rl",`${l}-${o}`}const Se=t.defineComponent({name:"Header",__name:"Header",props:{title:{type:[String,Object,Symbol,Function,Boolean]},titleStyle:{type:[String,Boolean,null,Object,Array]},move:{type:Boolean}},setup(e){const l=e,o=t.computed(()=>[l.move?"cursor: move":"",l.titleStyle]);return(n,i)=>(t.openBlock(),t.createElementBlock("div",{class:"zan-layer-title",style:t.normalizeStyle(o.value)},[t.renderSlot(n.$slots,"default",{},()=>[t.createVNode(_,{render:()=>t.unref(M)(e.title)},null,8,["render"])])],4))}}),we=t.defineComponent({name:"Footer",__name:"Footer",props:{footer:{type:[String,Object,Symbol,Function,Boolean]},footerStyle:{type:[String,Boolean,null,Object,Array]}},setup(e){return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"zan-layer-footer",style:t.normalizeStyle(e.footerStyle)},[t.renderSlot(l.$slots,"default",{},()=>[t.createVNode(_,{render:()=>t.unref(M)(e.footer)},null,8,["render"])])],4))}}),Ne={class:"zan-layer-setwin"},ve={class:"zan-tooltip"},Le={class:"zan-tooltip"},Ve=((e,l)=>{const o=e.__vccOpts||e;for(const[n,i]of l)o[n]=i;return o})(t.defineComponent({name:"HeaderBtn",__name:"HeaderBtn",props:{maxmin:{type:Boolean},min:{type:Boolean},max:{type:Boolean},closeBtn:{type:[String,Boolean],default:"1"}},emits:["onMin","onMax","onClose"],setup(e,{emit:l}){const o=e,n=l,i=()=>{n("onMin")},r=()=>{n("onMax")},d=()=>{n("onClose")};return(a,c)=>(t.openBlock(),t.createElementBlock("span",Ne,[o.maxmin&&!o.max?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass(["zan-icon-btn",o.min?"zan-icon-full":"zan-icon-min"]),onClick:t.withModifiers(i,["stop"])},[t.createElementVNode("span",ve,t.toDisplayString(o.min?"还原":"最小化"),1)],2)):t.createCommentVNode("",!0),o.maxmin&&!o.min?(t.openBlock(),t.createElementBlock("i",{key:1,class:t.normalizeClass(["zan-icon-btn",o.max?"zan-icon-restore":"zan-icon-max"]),onClick:t.withModifiers(r,["stop"])},[t.createElementVNode("span",Le,t.toDisplayString(o.max?"还原":"最大化"),1)],2)):t.createCommentVNode("",!0),o.closeBtn?(t.openBlock(),t.createElementBlock("i",{key:2,class:t.normalizeClass(["zan-icon-btn zan-icon-close-btn",`zan-layer-close${e.closeBtn}`]),onClick:t.withModifiers(d,["stop"])},[...c[0]||(c[0]=[t.createElementVNode("span",{class:"zan-tooltip"},"关闭",-1)])],2)):t.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-8d683fcb"]]),$e={class:"zan-layer-phimg"},Ie=["src"],Fe={key:0,class:"zan-layer-imgsee"},Oe={key:0,class:"zan-layer-imguide"},Me={key:0,class:"thumb-row"},He=["onClick"],De=["src"],Te={key:1,class:"zan-layer-imgtit"},Ae={key:0},Pe={key:1},_e=t.defineComponent({name:"Photos",__name:"Photos",props:{imgList:{},startIndex:{default:0}},emits:["resetCalculationPohtosArea"],setup(e,{emit:l}){const o=l,n=e,i=t.ref(n.startIndex);t.watch(i,()=>{o("resetCalculationPohtosArea",i.value)});const r=c=>{let m=i.value+c;m<0&&(m=n.imgList.length-1),m>=n.imgList.length&&(m=0),i.value=m},d=t.ref(!1);t.onMounted(()=>{t.nextTick(()=>{setTimeout(()=>{d.value=!0},400)})});const a=t.computed(()=>{let c=!1;return n.imgList.forEach(f=>{f.thumb&&(c=!0)}),c});return(c,f)=>(t.openBlock(),t.createElementBlock("div",$e,[t.createElementVNode("img",{src:e.imgList[i.value].src},null,8,Ie),e.imgList.length>0?(t.openBlock(),t.createElementBlock("div",Fe,[e.imgList.length>1?(t.openBlock(),t.createElementBlock("span",Oe,[t.createElementVNode("a",{href:"javascript:;",class:"zan-layer-iconext zan-layer-imgprev",onClick:f[0]||(f[0]=m=>r(-1))},"‹"),t.createElementVNode("a",{href:"javascript:;",class:"zan-layer-iconext zan-layer-imgnext",onClick:f[1]||(f[1]=m=>r(1))},"›")])):t.createCommentVNode("",!0),e.imgList.length>1||e.imgList[i.value].alt?(t.openBlock(),t.createElementBlock("div",{key:1,class:"zan-layer-imgbar",style:t.normalizeStyle({opacity:d.value?1:0})},[a.value?(t.openBlock(),t.createElementBlock("div",Me,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.imgList,(m,s)=>(t.openBlock(),t.createElementBlock("div",{class:"thumb-box",key:"thumb-box"+s,onClick:y=>i.value=s},[t.createElementVNode("img",{src:m.thumb},null,8,De)],8,He))),128)),t.createElementVNode("div",{class:"thumb-box-border",style:t.normalizeStyle({left:`calc(calc( calc(100% - ${100*e.imgList.length}px) / 2) + ${i.value*100}px)`})},null,4)])):(t.openBlock(),t.createElementBlock("span",Te,[e.imgList[i.value].alt?(t.openBlock(),t.createElementBlock("span",Ae,t.toDisplayString(e.imgList[i.value].alt),1)):t.createCommentVNode("",!0),e.imgList.length>1?(t.openBlock(),t.createElementBlock("em",Pe,t.toDisplayString(i.value+1)+" / "+t.toDisplayString(e.imgList.length),1)):t.createCommentVNode("",!0)]))],4)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]))}}),je={class:"title"},Re={key:0,class:"content"},We=["innerHTML"],Xe=t.defineComponent({name:"Notifiy",__name:"Notifiy",props:{title:{},content:{},isHtmlFragment:{type:Boolean,default:!1},icon:{},iconClass:{}},emits:["close"],setup(e,{emit:l}){const o=e,n=l,i=t.shallowRef(null),r=()=>{n("close")};function d(a,c){let f=a.className,m=f!=""?" ":"",s=f+m+c;a.className=s}return t.onMounted(()=>{t.nextTick(()=>{setTimeout(()=>{var a,c,f,m;(c=(a=i.value)==null?void 0:a.parentElement)!=null&&c.parentElement&&d((m=(f=i.value)==null?void 0:f.parentElement)==null?void 0:m.parentElement,"zan-layer-notifiy-transition")},300)})}),(a,c)=>(t.openBlock(),t.createElementBlock("div",{class:"zan-layer-notifiy-wrapper",ref_key:"notifyRef",ref:i},[t.createElementVNode("h2",je,[e.icon?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass(e.iconClass)},null,2)):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString(e.title),1)]),!e.isHtmlFragment&&e.content?(t.openBlock(),t.createElementBlock("div",Re,[t.createVNode(_,{render:()=>t.unref(M)(o.content)},null,8,["render"])])):e.isHtmlFragment&&e.content?(t.openBlock(),t.createElementBlock("div",{key:1,class:"content",innerHTML:e.content},null,8,We)):t.createCommentVNode("",!0),t.createElementVNode("i",{class:"zan-icon-close",onClick:r},[...c[0]||(c[0]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"16",height:"16"},[t.createElementVNode("path",{d:"M810.666667 273.493333L750.506667 213.333333 512 451.84 273.493333 213.333333 213.333333 273.493333 451.84 512 213.333333 750.506667 273.493333 810.666667 512 572.16 750.506667 810.666667 810.666667 750.506667 572.16 512z",fill:"currentColor"})],-1)])])],512))}}),Ye=["maxlength","placeholder"],Qe=["type","placeholder"],Ze=t.defineComponent({name:"Prompt",__name:"Prompt",props:{promptValue:{},formType:{default:"text"},maxLength:{},placeholder:{default:""}},emits:["update:promptValue"],setup(e,{emit:l}){const o=e,n=t.ref(o.promptValue),i=t.computed(()=>{switch(typeof o.formType){case"string":return o.formType==="textarea";case"number":return o.formType===2;default:return!1}}),r=t.computed(()=>o.formType==1||o.formType=="password");return(d,a)=>i.value?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:0,onInput:a[0]||(a[0]=c=>d.$emit("update:promptValue",n.value)),"onUpdate:modelValue":a[1]||(a[1]=c=>n.value=c),maxlength:o.maxLength,placeholder:o.placeholder,class:"zan-textarea"},null,40,Ye)),[[t.vModelText,n.value]]):t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:1,onInput:a[2]||(a[2]=c=>d.$emit("update:promptValue",n.value)),"onUpdate:modelValue":a[3]||(a[3]=c=>n.value=c),type:r.value?"password":"text",placeholder:o.placeholder,class:"zan-input"},null,40,Qe)),[[t.vModelDynamic,n.value]])}});function qe(e){for(;e&&e.parentNode;)if(e=e.parentNode,e&&getComputedStyle(e).position==="relative")return e;return null}const j=e=>{document.querySelectorAll(".zan-layer iframe").forEach(o=>{o.style.pointerEvents=e})},Ge=function(e,l,o,n,i){let r,d,a=0,c=0,f=!0;const m=s=>{const y=s.target;return!y||y.closest("button, input, textarea, select, a")?!1:(s.composedPath&&s.composedPath()||s.path||[]).some(E=>E instanceof HTMLElement&&E.classList.contains("zan-layer-title"))};e!=null&&e.addEventListener("mousedown",function(s){if(m(s)&&s.button==0&&e!=null){j("none");const y=getComputedStyle(e);r=s.pageX-e.offsetLeft+parseInt(y["margin-left"]),d=s.pageY-e.offsetTop+parseInt(y["margin-right"]),a=s.clientX,c=s.clientY,document.body.style.userSelect="none",document.body.style.cursor="move";const C=function(z){if(e!=null){(z.clientX-a!=0||z.clientY-c!=0)&&f&&(f=!1,i());let h=z.pageX-r,g=z.pageY-d;const B=document.documentElement.clientWidth,b=document.documentElement.clientHeight;if(!l){let S=B-e.offsetWidth,w=b-e.offsetHeight;if(e.style.position==="absolute"){const N=qe(e);N!=null&&(S=N.clientWidth-e.offsetWidth,w=N.clientHeight-e.offsetHeight)}h<0?h=0:h>S&&(h=S),g<0?g=0:g>w&&(g=w)}e.style.top=g+"px",e.style.left=h+"px",o(e.style.left,e.style.top)}return!1},E=function(){f=!0,document.body.style.userSelect="",document.body.style.cursor="",n(),j("auto"),document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",C,{passive:!1}),document.addEventListener("mouseup",E)}return!1})},Ue=function(e,l,o,n){let i=0,r=0,d=!0;e!=null&&e.addEventListener("mousedown",function(a){if((a.composedPath&&a.composedPath()||a.path)[0].className==="zan-layer-resize"&&a.button==0&&e!=null){j("none");const f=e.getBoundingClientRect(),m=f.left,s=f.top;i=a.clientX,r=a.clientY,document.body.style.userSelect="none",document.body.style.cursor="se-resize";const y=function(E){var z;if(window.getSelection!=null&&((z=window.getSelection())==null||z.removeAllRanges()),e!=null){const h=E.clientX,g=E.clientY;(h-i!=0||g-r!=0)&&d&&(d=!1,n());let B=h-m,b=g-s;B<260&&(B=260),b<115&&(b=115),e.style.width=B+"px",e.style.height=b+"px",l(e.style.width,e.style.height)}return!1};document.addEventListener("mousemove",y,{passive:!1});const C=function(){d=!0,document.body.style.userSelect="",document.body.style.cursor="",o(),j("auto"),document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",C)};document.addEventListener("mouseup",C)}return!1})},Ke=Symbol("zIndex");let Je=99999;function se(){return++Je}const et=["id"],tt={key:1,class:"slot-fragment"},nt=["innerHTML"],lt=["onClick"],ot={key:2,class:"zan-layer-resize"},R=t.defineComponent({name:"ZanLayer",__name:"ZanLayer",props:{modelValue:{type:Boolean,default:!1},type:{default:1},title:{type:[String,Object,Symbol,Function,Boolean],default:"标题"},footer:{type:[String,Object,Symbol,Function,Boolean]},titleStyle:{type:[String,Boolean,null,Object,Array],default:""},footerStyle:{type:[String,Boolean,null,Object,Array]},content:{},isHtmlFragment:{type:Boolean,default:!1},offset:{default:()=>"auto"},area:{default:()=>"auto"},move:{type:Boolean,default:!0},maxmin:{type:Boolean,default:!1},resize:{type:Boolean,default:!1},shade:{type:Boolean,default:!0},shadeClose:{type:Boolean,default:!0},shadeStyle:{type:[Boolean,null,String,Object,Array]},shadeOpacity:{default:"0.1"},layerClasses:{},contentClass:{default:""},zIndex:{},closeBtn:{type:[Boolean,String],default:"1"},btn:{},btnAlign:{default:"r"},anim:{default:0},isOutAnim:{type:Boolean,default:!0},icon:{},imgList:{default:()=>[]},startIndex:{default:0},animDuration:{default:"0.3s"},moveOut:{type:Boolean,default:!1},teleport:{default:"body"},teleportDisabled:{type:Boolean,default:!1},lastPosition:{type:Boolean,default:!0},time:{default:0},load:{default:0},yesText:{default:"确定"},formType:{default:"text"},value:{default:""},maxLength:{},placeholder:{default:"请输入内容"},isMessage:{type:Boolean,default:!1},id:{},isFunction:{type:Boolean,default:!1},appContext:{},success:{type:Function,default:()=>{}},end:{type:Function,default:()=>{}},yes:{},beforeClose:{type:Function,default:()=>!0},close:{type:Function,default:()=>{}},min:{type:Function,default:()=>{}},full:{type:Function,default:()=>{}},revert:{type:Function,default:()=>{}},moveStart:{type:Function,default:()=>{}},moving:{type:Function,default:()=>{}},moveEnd:{type:Function,default:()=>{}},resizeStart:{type:Function,default:()=>{}},resizing:{type:Function,default:()=>{}},resizeEnd:{type:Function,default:()=>{}},internalDestroy:{}},emits:["close","update:modelValue","opened"],setup(e,{expose:l,emit:o}){const n=e,i=o,r=t.useSlots(),d=t.ref(!1),a=t.ref(!1),c=t.ref(n.id||J()),f=t.ref(null),m=t.ref(),s=be(n.type),y=t.ref(xe(n.type,n.area,n.offset)),C=t.ref(Q(n.offset,y.value,s)),E=t.ref(99999),z=t.ref(!1),h=t.ref(y.value[0]),g=t.ref(y.value[1]),B=t.ref(C.value[0]),b=t.ref(C.value[1]),S=t.ref(""),w=t.ref(""),N=t.ref(""),V=t.ref(""),W=t.ref(!1),A=t.ref(n.value);t.watch(()=>n.value,()=>{A.value=n.value});const re=()=>{E.value=n.zIndex??se()};t.watch(()=>n.zIndex,()=>{re()},{immediate:!0});const ce=function(){t.nextTick(async()=>{s==4&&(y.value=ee(n.offset,n.area)),s==5&&(y.value=await ie(n.imgList[n.startIndex].src));let u=y.value;(u[0]==null||u[1]==null)&&(u=oe(f.value)),s==6&&(C.value=Ce(n.offset,u,c.value)),Y(),ye(),pt()})},mt=function(){a.value&&fe(),d.value&&ue(),S.value="",w.value="",N.value="",V.value=""},de=()=>{N.value=B.value,V.value=b.value,S.value=h.value,w.value=g.value,h.value=ne().w,g.value=ne().h,B.value=le().t,b.value=le().l},ue=()=>{d.value?(P(),h.value=S.value,g.value=w.value,n.revert(c.value)):(O(),de(),n.full(c.value)),d.value=!d.value},me=()=>{let K=10+190*H(c.value,!0);const Ot=document.documentElement.clientWidth;K+180>Ot&&(K=10),S.value=h.value,w.value=g.value,N.value=B.value,V.value=b.value,g.value="51px",h.value="180px",B.value="calc(100% - 51px)",b.value=K+"px"},fe=async()=>{a.value?(P(),H(c.value,!1),h.value=S.value,g.value=w.value,n.revert(c.value)):(O(),me(),n.min(c.value)),a.value=!a.value};t.watch(()=>n.modelValue,u=>{z.value!==u&&(z.value=u)},{immediate:!0}),t.watch(()=>z.value,(u,p)=>{if(u!==p&&!(!u&&p===void 0)){if(u){W.value=!1,ce(),re(),P(),n.isFunction&&ce(),t.nextTick(()=>{n.success(c.value)});return}O(),mt(),p!==void 0&&n.end(c.value)}},{immediate:!0,flush:"post"});const ft=t.computed(()=>[{"zan-layer-dialog":s===0||s===7,"zan-layer-page":s===1,"zan-layer-iframe":s===2,"zan-layer-loading":s===3,"zan-layer-drawer":s===4,"zan-layer-photos":s===5,"zan-layer-notifiy":s===6,"zan-layer-msg":n.isMessage,"zan-layer-hui":n.isMessage&&!n.icon},n.layerClasses]),pt=function(){n.move&&s!=4&&t.nextTick(()=>{f.value&&(Ge(f.value,n.moveOut,(u,p)=>{b.value=u,B.value=p,W.value=!0,a.value||(V.value=u,N.value=p),n.moving(c.value,{top:p,left:u})},()=>{const u={left:b.value,top:B.value,isMin:a.value,isMax:d.value},[p,k]=n.moveEnd(c.value,u)||[];k&&p&&(b.value=p,B.value=k)},()=>{n.moveStart(c.value)}),Ue(f.value,(u,p)=>{g.value=p,h.value=u,w.value=p,S.value=u,n.resizing(c.value,{width:u,height:p})},()=>{const u={width:h.value,height:g.value},[p,k]=n.resizeEnd(c.value,u)||[];p&&k&&(h.value=p,g.value=k)},()=>{n.resizeStart(c.value)}))})},yt=t.computed(()=>({position:n.teleportDisabled||n.teleport!="body"?"absolute":"fixed",top:B.value,left:b.value,height:g.value,width:h.value,animationDuration:n.animDuration,zIndex:E.value})),ht=t.computed(()=>[s===3?`zan-layer-loading${n.load}`:"",n.icon?"zan-layer-padding":"",n.contentClass]),X=()=>{if(typeof n.beforeClose=="function"){const u=n.beforeClose(c.value);(u===void 0||u!=null&&u===!0)&&(n.close(c.value),i("close"),i("update:modelValue",!1),n.internalDestroy&&n.internalDestroy(),a.value&&H(c.value,!a.value))}},gt=(...u)=>{typeof n.yes=="function"?n.yes(...u):X()},kt=()=>{n.shadeClose&&X()},pe=t.computed(()=>["zan-icon",`zan-icon-ico${n.icon}`]),xt=t.computed(()=>s===4?ae(n.offset):s===6?Ee(n.offset):`zan-layer-anim-0${n.anim}`),Bt=t.computed(()=>s===4?ae(n.offset,!0):n.isOutAnim?"zan-layer-anim-close":""),bt=()=>{z.value=!0},Ct=()=>{z.value=!1,s===6&&ze(c.value)},zt=t.computed(()=>z.value&&n.shade&&!a.value),Et=t.computed(()=>n.resize&&!d.value&&!a.value),St=t.computed(()=>n.title&&s!=3&&s!=5&&s!=6),wt=function(u){t.nextTick(async()=>{y.value=await ie(n.imgList[u].src),C.value=Q(n.offset,y.value,s),h.value=y.value[0],g.value=y.value[1],B.value=C.value[0],b.value=C.value[1],S.value=y.value[0],w.value=y.value[1]})},Nt=function(){n.zIndex||(E.value=se())},vt=(u,p)=>((u==null?void 0:u[0])||"")===((p==null?void 0:p[0])||"")&&((u==null?void 0:u[1])||"")===((p==null?void 0:p[1])||""),Lt=()=>{i("opened")};t.onMounted(()=>{}),t.onUnmounted(()=>{O()});let $,I=0;const P=function(){t.nextTick(()=>{!z.value||!m.value||$||s==6||m.value&&!$&&s!=6&&($=new ResizeObserver(()=>{f.value&&(I&&cancelAnimationFrame(I),I=requestAnimationFrame(()=>{if(I=0,!f.value)return;const u=Q(n.offset,oe(f.value),s);if(vt(C.value,u)||(C.value=u),W.value&&n.lastPosition)return;const p=n.lastPosition&&N.value||u[0],k=n.lastPosition&&V.value||u[1];B.value!==p&&(B.value=p),b.value!==k&&(b.value=k)}))}),$.observe(m.value))})},O=function(){I&&(cancelAnimationFrame(I),I=0),$&&($.disconnect(),$=void 0)},Y=function(u=!1){B.value=u&&n.lastPosition&&N.value||C.value[0],b.value=u&&n.lastPosition&&V.value||C.value[1]},ye=function(){h.value=y.value[0],g.value=y.value[1],S.value=y.value[0],w.value=y.value[1]},Vt=function(){P(),H(c.value,!1),a.value=!1,d.value=!1,W.value=!1,N.value="",V.value="",Y(),ye(),n.modelValue||i("update:modelValue",!0)},$t=async function(){a.value&&(G(),Y(!0)),d.value||(await t.nextTick(),O(),de(),d.value=!0)},It=async function(){d.value&&(G(),Y(!0)),a.value||(await t.nextTick(),O(),me(),a.value=!0)},G=()=>{P(),H(c.value,!1),a.value=!1,d.value=!1,h.value=S.value,g.value=w.value};return l({reset:Vt,open:bt,close:Ct,full:$t,min:It,revert:G}),(u,p)=>(t.openBlock(),t.createBlock(t.Teleport,{to:e.teleport,disabled:e.teleportDisabled},[t.createVNode(he,{index:E.value,"shade-style":e.shadeStyle,visible:zt.value,opacity:e.shadeOpacity,teleport:e.teleport,teleportDisabled:e.teleportDisabled,onShadeClick:kt},null,8,["index","shade-style","visible","opacity","teleport","teleportDisabled"]),t.createVNode(t.Transition,{"enter-active-class":xt.value,"leave-active-class":Bt.value,onAfterEnter:Lt},{default:t.withCtx(()=>[z.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"layerRef",ref:f,class:t.normalizeClass(["zan-layer zan-layer-border",[ft.value,{"zan-layer-min":a.value}]]),id:c.value,style:t.normalizeStyle(yt.value)},[St.value?(t.openBlock(),t.createBlock(Se,{key:0,title:e.title,titleStyle:e.titleStyle,move:e.move,onMousedown:Nt},{default:t.withCtx(()=>[t.renderSlot(u.$slots,"title")]),_:3},8,["title","titleStyle","move"])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"contentRef",ref:m,class:t.normalizeClass(["zan-layer-content",ht.value]),style:t.normalizeStyle(a.value===!0?"display:none":"")},[t.unref(s)===0||t.unref(s)===1||t.unref(s)===4?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.icon?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass(pe.value)},null,2)):t.createCommentVNode("",!0),t.unref(r).default?(t.openBlock(),t.createElementBlock("div",tt,[t.renderSlot(u.$slots,"default")])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[e.isHtmlFragment?(t.openBlock(),t.createElementBlock("div",{key:0,class:"html-fragment",innerHTML:t.unref(M)(n.content)},null,8,nt)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[n.content?(t.openBlock(),t.createBlock(_,{key:0,render:()=>t.unref(M)(n.content)},null,8,["render"])):t.createCommentVNode("",!0)],64))],64))],64)):t.createCommentVNode("",!0),t.unref(s)===7?(t.openBlock(),t.createBlock(Ze,{key:1,"prompt-value":A.value,"onUpdate:promptValue":p[0]||(p[0]=k=>A.value=k),formType:n.formType,maxLength:n.maxLength,placeholder:n.placeholder},null,8,["prompt-value","formType","maxLength","placeholder"])):t.createCommentVNode("",!0),t.unref(s)===2?(t.openBlock(),t.createBlock(ke,{key:2,src:n.content},null,8,["src"])):t.createCommentVNode("",!0),t.unref(s)===5?(t.openBlock(),t.createBlock(_e,{key:3,imgList:n.imgList,startIndex:n.startIndex,onResetCalculationPohtosArea:wt},null,8,["imgList","startIndex"])):t.createCommentVNode("",!0),t.unref(s)===6?(t.openBlock(),t.createBlock(Xe,{key:4,onClose:X,title:n.title,content:n.content,isHtmlFragment:n.isHtmlFragment,icon:n.icon,iconClass:pe.value},null,8,["title","content","isHtmlFragment","icon","iconClass"])):t.createCommentVNode("",!0)],6),t.unref(s)!=3&&t.unref(s)!=5&&t.unref(s)!=6?(t.openBlock(),t.createBlock(Ve,{key:1,maxmin:e.maxmin,max:d.value,min:a.value,closeBtn:e.closeBtn,onOnMin:fe,onOnMax:ue,onOnClose:X},null,8,["maxmin","max","min","closeBtn"])):t.createCommentVNode("",!0),t.createElementVNode("div",{style:t.normalizeStyle(a.value===!0?"display:none":"")},[t.unref(r).footer||n.footer?(t.openBlock(),t.createBlock(we,{key:0,footer:n.footer,footerStyle:n.footerStyle},{default:t.withCtx(()=>[t.renderSlot(u.$slots,"footer")]),_:3},8,["footer","footerStyle"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[(e.btn&&e.btn.length>0||t.unref(s)===0||t.unref(s)===7)&&!e.isMessage?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["zan-layer-btn",[`zan-layer-btn-${e.btnAlign}`]])},[e.btn&&e.btn.length>0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(e.btn,(k,U)=>(t.openBlock(),t.createElementBlock("a",{key:U,style:t.normalizeStyle(k.style),class:t.normalizeClass([k.class,`zan-layer-btn${U}`,{"zan-layer-btn-disabled":k.disabled}]),onClick:Ft=>!k.disabled&&(t.unref(s)===7?k.callback(c.value,A.value):k.callback(c.value))},t.toDisplayString(k.text),15,lt))),128)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.unref(s)===0||t.unref(s)===7?(t.openBlock(),t.createElementBlock("a",{key:0,class:"zan-layer-btn0",onClick:p[1]||(p[1]=k=>gt(c.value,A.value))},t.toDisplayString(e.yesText),1)):t.createCommentVNode("",!0)],64))],2)):t.createCommentVNode("",!0)],64))],4),Et.value?(t.openBlock(),t.createElementBlock("span",ot)):t.createCommentVNode("",!0)],14,et)):t.createCommentVNode("",!0)]),_:3},8,["enter-active-class","leave-active-class"])],8,["to","disabled"]))}}),L=[],at=e=>{L.push(e)},q=e=>{L.forEach((l,o)=>{l.modalContainer.id===e&&L.splice(o,1)})},it=()=>{L.splice(0,L.length)},D=e=>{let l=!1;return L.forEach((o,n)=>{o.modalContainer.id==e&&(l=!0)}),l},T=e=>{let l=null;return L.forEach((o,n)=>{o.modalContainer.id===e&&(l=o)}),l},st=(e,l)=>(e&&(l=Object.assign(l,e)),l),rt=e=>{const l=document.createElement("div");return l.id=e.id,document.body.appendChild(l),l},ct=e=>typeof e=="function"?t.isVNode(e())?{default:()=>e()}:void 0:t.isVNode(e)?{default:()=>e}:void 0,x={_context:null,open:e=>{const l={};return x.create(e,l)},drawer:e=>{const l={type:"drawer"};return x.create(e,l)},msg:(e,l={},o)=>{const n={type:0,title:!1,content:e,shadeClose:!1,closeBtn:!1,isMessage:!0,shade:!1,btn:void 0,time:2e3};return x.create(l,n,o)},load:(e=0,l={})=>{const o={type:3,load:e,anim:5,isOutAnim:!1,shadeClose:!1,shade:!0,shadeOpacity:"0.3"};return x.create(l,o)},confirm:(e,l={})=>{const o={type:0,content:e,shadeClose:!1};return x.create(l,o)},notify:(e,l)=>{e.type=6;const o={offset:"rt",time:3e3,area:"auto",shade:!1};return x.create(e,o,l)},photos:e=>{typeof e=="string"&&(e={imgList:[{src:e}]});const l={type:5,anim:2,startIndex:0,isOutAnim:!0,shadeClose:!0,shadeOpacity:"0.2"};return x.create(e,l)},prompt:e=>{e.type=7;const l={type:"prompt",shadeClose:!1,shadeOpacity:"0.2"};return x.create(e,l)},create:(e,l,o)=>{var a,c;let n;const i=st(e,l);i.hasOwnProperty("id")?x.close(i.id):i.id=J();const r=rt(i),d=t.h(R,{...i,isFunction:!0,internalDestroy(){var f,m;n&&clearTimeout(n),(m=(f=d.component)==null?void 0:f.exposed)==null||m.close(),setTimeout(()=>{t.render(null,r),document.body.contains(r)&&document.body.removeChild(r)},500),q(r.id)}},ct(i.content));return d.appContext=i.appContext||x._context,t.render(d,r),(c=(a=d.component)==null?void 0:a.exposed)==null||c.open(),l&&l.time!=null&&l.time!=0&&(n=setTimeout(()=>{var f,m;(m=(f=d.component)==null?void 0:f.exposed)==null||m.close(),o&&o(r.id),setTimeout(()=>{t.render(null,r),document.body.contains(r)&&document.body.removeChild(r)},500),q(r.id)},l.time)),at({modalContainer:r,modalInstance:d}),r.id},close:e=>{var l,o;if(e!=null&&D(e)){const n=T(e);(o=(l=n.modalInstance.component)==null?void 0:l.exposed)==null||o.close(),setTimeout(()=>{t.render(null,n.modalContainer),document.body.contains(n.modalContainer)&&document.body.removeChild(n.modalContainer)},500)}q(e)},closeAll:()=>{L.forEach(e=>{var l,o;(o=(l=e.modalInstance.component)==null?void 0:l.exposed)==null||o.close(),setTimeout(()=>{t.render(null,e.modalContainer),document.body.contains(e.modalContainer)&&document.body.removeChild(e.modalContainer)},500)}),it()},reset:e=>{var l,o;e!=null&&D(e)&&((o=(l=T(e).modalInstance.component)==null?void 0:l.exposed)==null||o.reset())},min:e=>{var l,o;e!=null&&D(e)&&((o=(l=T(e).modalInstance.component)==null?void 0:l.exposed)==null||o.min())},full:e=>{var l,o;e!=null&&D(e)&&((o=(l=T(e).modalInstance.component)==null?void 0:l.exposed)==null||o.full())},revert:e=>{var l,o;e!=null&&D(e)&&((o=(l=T(e).modalInstance.component)==null?void 0:l.exposed)==null||o.revert())}},dt=(e,l)=>{x._context=e._context,e.component(R.name,R),e.config.globalProperties.$layer=x,l&&typeof l.zIndex=="number"&&e.provide(Ke,t.ref(l.zIndex))},ut={install(e,l){dt(e,l)}};v.ZanLayer=R,v.default=ut,v.layer=x,v.zanLayer=x,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(v,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(v=typeof globalThis<"u"?globalThis:v||self,t(v.ZanLayer={},v.Vue))})(this,function(v,t){"use strict";const he=t.defineComponent({name:"Shade",__name:"Shade",props:{visible:{type:[Boolean,String]},opacity:{},index:{type:[Number,Function]},teleport:{},teleportDisabled:{type:Boolean},shadeStyle:{type:[Boolean,null,String,Object,Array]}},emits:["shadeClick"],setup(e,{emit:l}){const o=e,n=l,i=t.computed(()=>[{opacity:o.opacity,position:o.teleportDisabled||o.teleport!="body"?"absolute":"fixed",zIndex:o.index},o.shadeStyle]),r=()=>{n("shadeClick")};return(d,a)=>e.visible?(t.openBlock(),t.createElementBlock("div",{key:0,class:"zan-layer-shade",style:t.normalizeStyle(i.value),onClick:r},null,4)):t.createCommentVNode("",!0)}}),ge=["src"],ke=t.defineComponent({name:"Iframe",__name:"Iframe",props:{src:{}},setup(e){const l=e,o=t.computed(()=>l.src);return(n,i)=>(t.openBlock(),t.createElementBlock("iframe",{scrolling:"auto",class:"zan-layer-iframe",allowtransparency:"true",frameborder:"0",src:o.value},null,8,ge))}}),_=t.defineComponent({name:"ZanRender",props:{render:{type:Function,required:!0}},setup(e){return()=>e.render()}}),M=function(e){return typeof e=="function"?e():typeof e=="string"?t.h("span",e):e};function J(){const e=[],l="0123456789abcdef";for(let n=0;n<36;n++)e[n]=l.substr(Math.floor(Math.random()*16),1);return e[14]="4",e[19]=l.substr(e[19]&3|8,1),e[8]=e[13]=e[18]=e[23]="-",e.join("").replaceAll("-","")}function xe(e,l,o){return e!="drawer"&&e!=4?Be(l):ee(o,l)}function Be(e){return e==null||e==="auto"?[]:typeof e=="string"?[e]:e[1]&&e[1]==="auto"?e[0]&&e[0]==="auto"?[]:[e[0]]:e[0]&&e[0]==="auto"?e[1]&&e[1]!="auto"?[void 0,e[1]]:[]:[...e]}function ee(e,l="30%"){return l==null&&(l="30%"),l instanceof Array?l:(l==="auto"&&(l="30%"),e==="l"||e==="r"||e==="lt"||e==="lb"||e==="rt"||e==="rb"?[l,"100%"]:e==="t"||e==="b"||e==="tr"||e==="tl"||e==="br"||e==="bl"?["100%",l]:[l,"100%"])}function te(e){return e==null||e===""?"0px":e}function Q(e="auto",l,o){e==null&&(e="auto");const n=Array.isArray(l)?l:[],i=te(n[0]),r=te(n[1]),d=["t","r","b","l","lt","tl","lb","bl","rt","tr","rb","br"],a=[];return e==="auto"&&o==4&&(e="r"),typeof e=="string"?d.indexOf(e)>-1?(e==="t"&&(a[0]="0px",a[1]="calc(50% - "+i+"/2)"),e==="l"&&(a[0]="calc(50% - "+r+"/2)",a[1]="0px"),e==="b"&&(a[0]="calc(100% - "+r+")",a[1]="calc(50% - "+i+"/2)"),e==="r"&&(a[0]="calc(50% - "+r+"/2)",a[1]="calc(100% - "+i+")"),(e==="lt"||e==="tl")&&(a[0]="0px",a[1]="0px"),(e==="lb"||e==="bl")&&(a[0]="calc(100% - "+r+")",a[1]="0px"),(e==="rt"||e==="tr")&&(a[0]="0px",a[1]="calc(100% - "+i+")"),(e==="rb"||e==="br")&&(a[0]="calc(100% - "+r+")",a[1]="calc(100% - "+i+")")):e=="auto"?(a[0]="calc(50% - "+r+"/2)",a[1]="calc(50% - "+i+"/2)"):(a[0]=e,a[1]="calc(50% - "+i+"/2)"):e&&e[0]!==void 0&&e[1]!==void 0?(a[0]=e[0],a[1]=e[1]):(a[0]="calc(50% - "+r+"/2)",a[1]="calc(50% - "+i+"/2)"),a}function be(e){return e==="dialog"||e==0?0:e==="page"||e==1?1:e==="iframe"||e==2?2:e==="loading"||e==3?3:e==="drawer"||e==4?4:e==="photos"||e==5?5:e==="notify"||e==6?6:e==="prompt"||e==7?7:0}function ne(){return{w:"100%",h:"100%"}}function le(){return{t:"0px",l:"0px"}}function oe(e){var n,i;const l=(n=getComputedStyle(e,null))==null?void 0:n.width,o=(i=getComputedStyle(e,null))==null?void 0:i.height;return[l,o]}const F=[];function H(e,l){let o=0;if(l){const n=F.findIndex(i=>i===void 0);n===-1?(F.push(e),o=F.length-1):(F[n]=e,o=n)}else delete F[F.findIndex(n=>n==e)],o=-1;return o}function ae(e,l=!1){const o=["rl"],n="zan-layer-drawer-anim zan-layer-anim";return e==="l"||e==="lt"||e==="lb"?o[0]="lr":e==="r"||e==="rt"||e==="rb"?o[0]="rl":e==="t"||e==="tr"||e==="tl"?o[0]="tb":(e==="b"||e==="br"||e==="bl")&&(o[0]="bt"),l?`${n}-${o[0]}-close`:`${n}-${o[0]}`}async function ie(e,l){const o=new Image;return o.src=e,new Promise((i,r)=>{if(o.complete){i(n(o));return}const d=x.load(2,{shadeOpacity:"0"});o.onload=()=>{x.close(d),i(n(o))},o.onerror=()=>{x.close(d),x.msg("图片加载失败"),r(!1)}});function n(i){const r=[i.width,i.height],d=[window.innerWidth-250,window.innerHeight-250];if(r[0]>d[0]||r[1]>d[1]){const a=[r[0]/d[0],r[1]/d[1]];a[0]>a[1]?(r[0]=r[0]/a[0],r[1]=r[1]/a[0]):a[0]<a[1]&&(r[0]=r[0]/a[1],r[1]=r[1]/a[1])}return[r[0]+"px",r[1]+"px"]}}function Z(e,l){const o=document.getElementsByClassName(e);for(let n=0;n<o.length;n++){const i=o[n];if(i.id===l)return i}}function Ce(e,l,o){const n=["lt","lb","rt","rb"];let i="0",r="0",a=15;window.NotifiyQueen=window.NotifiyQueen||[];const c=window.NotifiyQueen;(typeof e!="string"||n.indexOf(e)===-1)&&(e="rt");const f=c.filter(s=>{if(s.offset===e)return s});let m=f.length>0?f[f.length-1]:null;if(m)if(m=Z("zan-layer",m.id),e==="rt"||e==="lt")a+=m.offsetHeight+parseFloat(m.style.top);else{const s=parseFloat(m.style.top.split(" - ")[1]);a+=m.offsetHeight+s}else(e==="rb"||e==="lb")&&(a+=parseFloat(l[1]));return e==="rt"?(i=a+"px",r="calc(100% - "+(parseFloat(l[0])+15)+"px)"):e==="rb"?(i="calc(100% - "+a+"px)",r="calc(100% - "+(parseFloat(l[0])+15)+"px)"):e==="lt"?(i=a+"px",r="15px"):e==="lb"&&(i="calc(100% - "+a+"px)",r="15px"),c.push({id:o,offset:e}),[i,r]}function ze(e){const l=Z("zan-layer",e);if(!l)return;const o=15,n=l.offsetHeight;window.NotifiyQueen=window.NotifiyQueen||[];const i=window.NotifiyQueen,r=i.findIndex(m=>m.id===e),d=i[r].offset,a=i.filter(m=>{if(m.offset===d)return m}),c=a.findIndex(m=>m.id===e);a.slice(c+1).forEach(m=>{const s=Z("zan-layer",m.id);if(d==="rt"||d==="lt")s.style.top=parseFloat(s.style.top)-o-n+"px";else{const y=parseFloat(s.style.top.split(" - ")[1])-o-n;s.style.top="calc(100% - "+y+"px)"}}),i.splice(r,1)}function Ee(e){const l="zan-layer-drawer-anim zan-layer-anim";let o="";return e==="lt"||e==="lb"?o="lr":o="rl",`${l}-${o}`}const Se=t.defineComponent({name:"Header",__name:"Header",props:{title:{type:[String,Object,Symbol,Function,Boolean]},titleStyle:{type:[String,Boolean,null,Object,Array]},move:{type:Boolean}},setup(e){const l=e,o=t.computed(()=>[l.move?"cursor: move":"",l.titleStyle]);return(n,i)=>(t.openBlock(),t.createElementBlock("div",{class:"zan-layer-title",style:t.normalizeStyle(o.value)},[t.renderSlot(n.$slots,"default",{},()=>[t.createVNode(_,{render:()=>t.unref(M)(e.title)},null,8,["render"])])],4))}}),we=t.defineComponent({name:"Footer",__name:"Footer",props:{footer:{type:[String,Object,Symbol,Function,Boolean]},footerStyle:{type:[String,Boolean,null,Object,Array]}},setup(e){return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"zan-layer-footer",style:t.normalizeStyle(e.footerStyle)},[t.renderSlot(l.$slots,"default",{},()=>[t.createVNode(_,{render:()=>t.unref(M)(e.footer)},null,8,["render"])])],4))}}),Ne={class:"zan-layer-setwin"},ve={class:"zan-tooltip"},Le={class:"zan-tooltip"},Ve=((e,l)=>{const o=e.__vccOpts||e;for(const[n,i]of l)o[n]=i;return o})(t.defineComponent({name:"HeaderBtn",__name:"HeaderBtn",props:{maxmin:{type:Boolean},min:{type:Boolean},max:{type:Boolean},closeBtn:{type:[String,Boolean],default:"1"}},emits:["onMin","onMax","onClose"],setup(e,{emit:l}){const o=e,n=l,i=()=>{n("onMin")},r=()=>{n("onMax")},d=()=>{n("onClose")};return(a,c)=>(t.openBlock(),t.createElementBlock("span",Ne,[o.maxmin&&!o.max?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass(["zan-icon-btn",o.min?"zan-icon-full":"zan-icon-min"]),onClick:t.withModifiers(i,["stop"])},[t.createElementVNode("span",ve,t.toDisplayString(o.min?"还原":"最小化"),1)],2)):t.createCommentVNode("",!0),o.maxmin&&!o.min?(t.openBlock(),t.createElementBlock("i",{key:1,class:t.normalizeClass(["zan-icon-btn",o.max?"zan-icon-restore":"zan-icon-max"]),onClick:t.withModifiers(r,["stop"])},[t.createElementVNode("span",Le,t.toDisplayString(o.max?"还原":"最大化"),1)],2)):t.createCommentVNode("",!0),o.closeBtn?(t.openBlock(),t.createElementBlock("i",{key:2,class:t.normalizeClass(["zan-icon-btn zan-icon-close-btn",`zan-layer-close${e.closeBtn}`]),onClick:t.withModifiers(d,["stop"])},[...c[0]||(c[0]=[t.createElementVNode("span",{class:"zan-tooltip"},"关闭",-1)])],2)):t.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-a2b66c03"]]),$e={class:"zan-layer-phimg"},Ie=["src"],Fe={key:0,class:"zan-layer-imgsee"},Oe={key:0,class:"zan-layer-imguide"},Me={key:0,class:"thumb-row"},He=["onClick"],De=["src"],Te={key:1,class:"zan-layer-imgtit"},Ae={key:0},Pe={key:1},_e=t.defineComponent({name:"Photos",__name:"Photos",props:{imgList:{},startIndex:{default:0}},emits:["resetCalculationPohtosArea"],setup(e,{emit:l}){const o=l,n=e,i=t.ref(n.startIndex);t.watch(i,()=>{o("resetCalculationPohtosArea",i.value)});const r=c=>{let m=i.value+c;m<0&&(m=n.imgList.length-1),m>=n.imgList.length&&(m=0),i.value=m},d=t.ref(!1);t.onMounted(()=>{t.nextTick(()=>{setTimeout(()=>{d.value=!0},400)})});const a=t.computed(()=>{let c=!1;return n.imgList.forEach(f=>{f.thumb&&(c=!0)}),c});return(c,f)=>(t.openBlock(),t.createElementBlock("div",$e,[t.createElementVNode("img",{src:e.imgList[i.value].src},null,8,Ie),e.imgList.length>0?(t.openBlock(),t.createElementBlock("div",Fe,[e.imgList.length>1?(t.openBlock(),t.createElementBlock("span",Oe,[t.createElementVNode("a",{href:"javascript:;",class:"zan-layer-iconext zan-layer-imgprev",onClick:f[0]||(f[0]=m=>r(-1))},"‹"),t.createElementVNode("a",{href:"javascript:;",class:"zan-layer-iconext zan-layer-imgnext",onClick:f[1]||(f[1]=m=>r(1))},"›")])):t.createCommentVNode("",!0),e.imgList.length>1||e.imgList[i.value].alt?(t.openBlock(),t.createElementBlock("div",{key:1,class:"zan-layer-imgbar",style:t.normalizeStyle({opacity:d.value?1:0})},[a.value?(t.openBlock(),t.createElementBlock("div",Me,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.imgList,(m,s)=>(t.openBlock(),t.createElementBlock("div",{class:"thumb-box",key:"thumb-box"+s,onClick:y=>i.value=s},[t.createElementVNode("img",{src:m.thumb},null,8,De)],8,He))),128)),t.createElementVNode("div",{class:"thumb-box-border",style:t.normalizeStyle({left:`calc(calc( calc(100% - ${100*e.imgList.length}px) / 2) + ${i.value*100}px)`})},null,4)])):(t.openBlock(),t.createElementBlock("span",Te,[e.imgList[i.value].alt?(t.openBlock(),t.createElementBlock("span",Ae,t.toDisplayString(e.imgList[i.value].alt),1)):t.createCommentVNode("",!0),e.imgList.length>1?(t.openBlock(),t.createElementBlock("em",Pe,t.toDisplayString(i.value+1)+" / "+t.toDisplayString(e.imgList.length),1)):t.createCommentVNode("",!0)]))],4)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]))}}),je={class:"title"},Re={key:0,class:"content"},We=["innerHTML"],Xe=t.defineComponent({name:"Notifiy",__name:"Notifiy",props:{title:{},content:{},isHtmlFragment:{type:Boolean,default:!1},icon:{},iconClass:{}},emits:["close"],setup(e,{emit:l}){const o=e,n=l,i=t.shallowRef(null),r=()=>{n("close")};function d(a,c){let f=a.className,m=f!=""?" ":"",s=f+m+c;a.className=s}return t.onMounted(()=>{t.nextTick(()=>{setTimeout(()=>{var a,c,f,m;(c=(a=i.value)==null?void 0:a.parentElement)!=null&&c.parentElement&&d((m=(f=i.value)==null?void 0:f.parentElement)==null?void 0:m.parentElement,"zan-layer-notifiy-transition")},300)})}),(a,c)=>(t.openBlock(),t.createElementBlock("div",{class:"zan-layer-notifiy-wrapper",ref_key:"notifyRef",ref:i},[t.createElementVNode("h2",je,[e.icon?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass(e.iconClass)},null,2)):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString(e.title),1)]),!e.isHtmlFragment&&e.content?(t.openBlock(),t.createElementBlock("div",Re,[t.createVNode(_,{render:()=>t.unref(M)(o.content)},null,8,["render"])])):e.isHtmlFragment&&e.content?(t.openBlock(),t.createElementBlock("div",{key:1,class:"content",innerHTML:e.content},null,8,We)):t.createCommentVNode("",!0),t.createElementVNode("i",{class:"zan-icon-close",onClick:r},[...c[0]||(c[0]=[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"16",height:"16"},[t.createElementVNode("path",{d:"M810.666667 273.493333L750.506667 213.333333 512 451.84 273.493333 213.333333 213.333333 273.493333 451.84 512 213.333333 750.506667 273.493333 810.666667 512 572.16 750.506667 810.666667 810.666667 750.506667 572.16 512z",fill:"currentColor"})],-1)])])],512))}}),Ye=["maxlength","placeholder"],Qe=["type","placeholder"],Ze=t.defineComponent({name:"Prompt",__name:"Prompt",props:{promptValue:{},formType:{default:"text"},maxLength:{},placeholder:{default:""}},emits:["update:promptValue"],setup(e,{emit:l}){const o=e,n=t.ref(o.promptValue),i=t.computed(()=>{switch(typeof o.formType){case"string":return o.formType==="textarea";case"number":return o.formType===2;default:return!1}}),r=t.computed(()=>o.formType==1||o.formType=="password");return(d,a)=>i.value?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:0,onInput:a[0]||(a[0]=c=>d.$emit("update:promptValue",n.value)),"onUpdate:modelValue":a[1]||(a[1]=c=>n.value=c),maxlength:o.maxLength,placeholder:o.placeholder,class:"zan-textarea"},null,40,Ye)),[[t.vModelText,n.value]]):t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:1,onInput:a[2]||(a[2]=c=>d.$emit("update:promptValue",n.value)),"onUpdate:modelValue":a[3]||(a[3]=c=>n.value=c),type:r.value?"password":"text",placeholder:o.placeholder,class:"zan-input"},null,40,Qe)),[[t.vModelDynamic,n.value]])}});function qe(e){for(;e&&e.parentNode;)if(e=e.parentNode,e&&getComputedStyle(e).position==="relative")return e;return null}const j=e=>{document.querySelectorAll(".zan-layer iframe").forEach(o=>{o.style.pointerEvents=e})},Ge=function(e,l,o,n,i){let r,d,a=0,c=0,f=!0;const m=s=>{const y=s.target;return!y||y.closest("button, input, textarea, select, a")?!1:(s.composedPath&&s.composedPath()||s.path||[]).some(E=>E instanceof HTMLElement&&E.classList.contains("zan-layer-title"))};e!=null&&e.addEventListener("mousedown",function(s){if(m(s)&&s.button==0&&e!=null){j("none");const y=getComputedStyle(e);r=s.pageX-e.offsetLeft+parseInt(y["margin-left"]),d=s.pageY-e.offsetTop+parseInt(y["margin-right"]),a=s.clientX,c=s.clientY,document.body.style.userSelect="none",document.body.style.cursor="move";const C=function(z){if(e!=null){(z.clientX-a!=0||z.clientY-c!=0)&&f&&(f=!1,i());let h=z.pageX-r,g=z.pageY-d;const B=document.documentElement.clientWidth,b=document.documentElement.clientHeight;if(!l){let S=B-e.offsetWidth,w=b-e.offsetHeight;if(e.style.position==="absolute"){const N=qe(e);N!=null&&(S=N.clientWidth-e.offsetWidth,w=N.clientHeight-e.offsetHeight)}h<0?h=0:h>S&&(h=S),g<0?g=0:g>w&&(g=w)}e.style.top=g+"px",e.style.left=h+"px",o(e.style.left,e.style.top)}return!1},E=function(){f=!0,document.body.style.userSelect="",document.body.style.cursor="",n(),j("auto"),document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",C,{passive:!1}),document.addEventListener("mouseup",E)}return!1})},Ue=function(e,l,o,n){let i=0,r=0,d=!0;e!=null&&e.addEventListener("mousedown",function(a){if((a.composedPath&&a.composedPath()||a.path)[0].className==="zan-layer-resize"&&a.button==0&&e!=null){j("none");const f=e.getBoundingClientRect(),m=f.left,s=f.top;i=a.clientX,r=a.clientY,document.body.style.userSelect="none",document.body.style.cursor="se-resize";const y=function(E){var z;if(window.getSelection!=null&&((z=window.getSelection())==null||z.removeAllRanges()),e!=null){const h=E.clientX,g=E.clientY;(h-i!=0||g-r!=0)&&d&&(d=!1,n());let B=h-m,b=g-s;B<260&&(B=260),b<115&&(b=115),e.style.width=B+"px",e.style.height=b+"px",l(e.style.width,e.style.height)}return!1};document.addEventListener("mousemove",y,{passive:!1});const C=function(){d=!0,document.body.style.userSelect="",document.body.style.cursor="",o(),j("auto"),document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",C)};document.addEventListener("mouseup",C)}return!1})},Ke=Symbol("zIndex");let Je=99999;function se(){return++Je}const et=["id"],tt={key:1,class:"slot-fragment"},nt=["innerHTML"],lt=["onClick"],ot={key:2,class:"zan-layer-resize"},R=t.defineComponent({name:"ZanLayer",__name:"ZanLayer",props:{modelValue:{type:Boolean,default:!1},type:{default:1},title:{type:[String,Object,Symbol,Function,Boolean],default:"标题"},footer:{type:[String,Object,Symbol,Function,Boolean]},titleStyle:{type:[String,Boolean,null,Object,Array],default:""},footerStyle:{type:[String,Boolean,null,Object,Array]},content:{},isHtmlFragment:{type:Boolean,default:!1},offset:{default:()=>"auto"},area:{default:()=>"auto"},move:{type:Boolean,default:!0},maxmin:{type:Boolean,default:!1},resize:{type:Boolean,default:!1},shade:{type:Boolean,default:!0},shadeClose:{type:Boolean,default:!0},shadeStyle:{type:[Boolean,null,String,Object,Array]},shadeOpacity:{default:"0.1"},layerClasses:{},contentClass:{default:""},zIndex:{},closeBtn:{type:[Boolean,String],default:"1"},btn:{},btnAlign:{default:"r"},anim:{default:0},isOutAnim:{type:Boolean,default:!0},icon:{},imgList:{default:()=>[]},startIndex:{default:0},animDuration:{default:"0.3s"},moveOut:{type:Boolean,default:!1},teleport:{default:"body"},teleportDisabled:{type:Boolean,default:!1},lastPosition:{type:Boolean,default:!0},time:{default:0},load:{default:0},yesText:{default:"确定"},formType:{default:"text"},value:{default:""},maxLength:{},placeholder:{default:"请输入内容"},isMessage:{type:Boolean,default:!1},id:{},isFunction:{type:Boolean,default:!1},appContext:{},success:{type:Function,default:()=>{}},end:{type:Function,default:()=>{}},yes:{},beforeClose:{type:Function,default:()=>!0},close:{type:Function,default:()=>{}},min:{type:Function,default:()=>{}},full:{type:Function,default:()=>{}},revert:{type:Function,default:()=>{}},moveStart:{type:Function,default:()=>{}},moving:{type:Function,default:()=>{}},moveEnd:{type:Function,default:()=>{}},resizeStart:{type:Function,default:()=>{}},resizing:{type:Function,default:()=>{}},resizeEnd:{type:Function,default:()=>{}},internalDestroy:{}},emits:["close","update:modelValue","opened"],setup(e,{expose:l,emit:o}){const n=e,i=o,r=t.useSlots(),d=t.ref(!1),a=t.ref(!1),c=t.ref(n.id||J()),f=t.ref(null),m=t.ref(),s=be(n.type),y=t.ref(xe(n.type,n.area,n.offset)),C=t.ref(Q(n.offset,y.value,s)),E=t.ref(99999),z=t.ref(!1),h=t.ref(y.value[0]),g=t.ref(y.value[1]),B=t.ref(C.value[0]),b=t.ref(C.value[1]),S=t.ref(""),w=t.ref(""),N=t.ref(""),V=t.ref(""),W=t.ref(!1),A=t.ref(n.value);t.watch(()=>n.value,()=>{A.value=n.value});const re=()=>{E.value=n.zIndex??se()};t.watch(()=>n.zIndex,()=>{re()},{immediate:!0});const ce=function(){t.nextTick(async()=>{s==4&&(y.value=ee(n.offset,n.area)),s==5&&(y.value=await ie(n.imgList[n.startIndex].src));let u=y.value;(u[0]==null||u[1]==null)&&(u=oe(f.value)),s==6&&(C.value=Ce(n.offset,u,c.value)),Y(),ye(),pt()})},mt=function(){a.value&&fe(),d.value&&ue(),S.value="",w.value="",N.value="",V.value=""},de=()=>{N.value=B.value,V.value=b.value,S.value=h.value,w.value=g.value,h.value=ne().w,g.value=ne().h,B.value=le().t,b.value=le().l},ue=()=>{d.value?(P(),h.value=S.value,g.value=w.value,n.revert(c.value)):(O(),de(),n.full(c.value)),d.value=!d.value},me=()=>{let K=10+190*H(c.value,!0);const Ot=document.documentElement.clientWidth;K+180>Ot&&(K=10),S.value=h.value,w.value=g.value,N.value=B.value,V.value=b.value,g.value="51px",h.value="180px",B.value="calc(100% - 51px)",b.value=K+"px"},fe=async()=>{a.value?(P(),H(c.value,!1),h.value=S.value,g.value=w.value,n.revert(c.value)):(O(),me(),n.min(c.value)),a.value=!a.value};t.watch(()=>n.modelValue,u=>{z.value!==u&&(z.value=u)},{immediate:!0}),t.watch(()=>z.value,(u,p)=>{if(u!==p&&!(!u&&p===void 0)){if(u){W.value=!1,ce(),re(),P(),n.isFunction&&ce(),t.nextTick(()=>{n.success(c.value)});return}O(),mt(),p!==void 0&&n.end(c.value)}},{immediate:!0,flush:"post"});const ft=t.computed(()=>[{"zan-layer-dialog":s===0||s===7,"zan-layer-page":s===1,"zan-layer-iframe":s===2,"zan-layer-loading":s===3,"zan-layer-drawer":s===4,"zan-layer-photos":s===5,"zan-layer-notifiy":s===6,"zan-layer-msg":n.isMessage,"zan-layer-hui":n.isMessage&&!n.icon},n.layerClasses]),pt=function(){n.move&&s!=4&&t.nextTick(()=>{f.value&&(Ge(f.value,n.moveOut,(u,p)=>{b.value=u,B.value=p,W.value=!0,a.value||(V.value=u,N.value=p),n.moving(c.value,{top:p,left:u})},()=>{const u={left:b.value,top:B.value,isMin:a.value,isMax:d.value},[p,k]=n.moveEnd(c.value,u)||[];k&&p&&(b.value=p,B.value=k)},()=>{n.moveStart(c.value)}),Ue(f.value,(u,p)=>{g.value=p,h.value=u,w.value=p,S.value=u,n.resizing(c.value,{width:u,height:p})},()=>{const u={width:h.value,height:g.value},[p,k]=n.resizeEnd(c.value,u)||[];p&&k&&(h.value=p,g.value=k)},()=>{n.resizeStart(c.value)}))})},yt=t.computed(()=>({position:n.teleportDisabled||n.teleport!="body"?"absolute":"fixed",top:B.value,left:b.value,height:g.value,width:h.value,animationDuration:n.animDuration,zIndex:E.value})),ht=t.computed(()=>[s===3?`zan-layer-loading${n.load}`:"",n.icon?"zan-layer-padding":"",n.contentClass]),X=()=>{if(typeof n.beforeClose=="function"){const u=n.beforeClose(c.value);(u===void 0||u!=null&&u===!0)&&(n.close(c.value),i("close"),i("update:modelValue",!1),n.internalDestroy&&n.internalDestroy(),a.value&&H(c.value,!a.value))}},gt=(...u)=>{typeof n.yes=="function"?n.yes(...u):X()},kt=()=>{n.shadeClose&&X()},pe=t.computed(()=>["zan-icon",`zan-icon-ico${n.icon}`]),xt=t.computed(()=>s===4?ae(n.offset):s===6?Ee(n.offset):`zan-layer-anim-0${n.anim}`),Bt=t.computed(()=>s===4?ae(n.offset,!0):n.isOutAnim?"zan-layer-anim-close":""),bt=()=>{z.value=!0},Ct=()=>{z.value=!1,s===6&&ze(c.value)},zt=t.computed(()=>z.value&&n.shade&&!a.value),Et=t.computed(()=>n.resize&&!d.value&&!a.value),St=t.computed(()=>n.title&&s!=3&&s!=5&&s!=6),wt=function(u){t.nextTick(async()=>{y.value=await ie(n.imgList[u].src),C.value=Q(n.offset,y.value,s),h.value=y.value[0],g.value=y.value[1],B.value=C.value[0],b.value=C.value[1],S.value=y.value[0],w.value=y.value[1]})},Nt=function(){n.zIndex||(E.value=se())},vt=(u,p)=>((u==null?void 0:u[0])||"")===((p==null?void 0:p[0])||"")&&((u==null?void 0:u[1])||"")===((p==null?void 0:p[1])||""),Lt=()=>{i("opened")};t.onMounted(()=>{}),t.onUnmounted(()=>{O()});let $,I=0;const P=function(){t.nextTick(()=>{!z.value||!m.value||$||s==6||m.value&&!$&&s!=6&&($=new ResizeObserver(()=>{f.value&&(I&&cancelAnimationFrame(I),I=requestAnimationFrame(()=>{if(I=0,!f.value)return;const u=Q(n.offset,oe(f.value),s);if(vt(C.value,u)||(C.value=u),W.value&&n.lastPosition)return;const p=n.lastPosition&&N.value||u[0],k=n.lastPosition&&V.value||u[1];B.value!==p&&(B.value=p),b.value!==k&&(b.value=k)}))}),$.observe(m.value))})},O=function(){I&&(cancelAnimationFrame(I),I=0),$&&($.disconnect(),$=void 0)},Y=function(u=!1){B.value=u&&n.lastPosition&&N.value||C.value[0],b.value=u&&n.lastPosition&&V.value||C.value[1]},ye=function(){h.value=y.value[0],g.value=y.value[1],S.value=y.value[0],w.value=y.value[1]},Vt=function(){P(),H(c.value,!1),a.value=!1,d.value=!1,W.value=!1,N.value="",V.value="",Y(),ye(),n.modelValue||i("update:modelValue",!0)},$t=async function(){a.value&&(G(),Y(!0)),d.value||(await t.nextTick(),O(),de(),d.value=!0)},It=async function(){d.value&&(G(),Y(!0)),a.value||(await t.nextTick(),O(),me(),a.value=!0)},G=()=>{P(),H(c.value,!1),a.value=!1,d.value=!1,h.value=S.value,g.value=w.value};return l({reset:Vt,open:bt,close:Ct,full:$t,min:It,revert:G}),(u,p)=>(t.openBlock(),t.createBlock(t.Teleport,{to:e.teleport,disabled:e.teleportDisabled},[t.createVNode(he,{index:E.value,"shade-style":e.shadeStyle,visible:zt.value,opacity:e.shadeOpacity,teleport:e.teleport,teleportDisabled:e.teleportDisabled,onShadeClick:kt},null,8,["index","shade-style","visible","opacity","teleport","teleportDisabled"]),t.createVNode(t.Transition,{"enter-active-class":xt.value,"leave-active-class":Bt.value,onAfterEnter:Lt},{default:t.withCtx(()=>[z.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"layerRef",ref:f,class:t.normalizeClass(["zan-layer zan-layer-border",[ft.value,{"zan-layer-min":a.value}]]),id:c.value,style:t.normalizeStyle(yt.value)},[St.value?(t.openBlock(),t.createBlock(Se,{key:0,title:e.title,titleStyle:e.titleStyle,move:e.move,onMousedown:Nt},{default:t.withCtx(()=>[t.renderSlot(u.$slots,"title")]),_:3},8,["title","titleStyle","move"])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"contentRef",ref:m,class:t.normalizeClass(["zan-layer-content",ht.value]),style:t.normalizeStyle(a.value===!0?"display:none":"")},[t.unref(s)===0||t.unref(s)===1||t.unref(s)===4?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.icon?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass(pe.value)},null,2)):t.createCommentVNode("",!0),t.unref(r).default?(t.openBlock(),t.createElementBlock("div",tt,[t.renderSlot(u.$slots,"default")])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[e.isHtmlFragment?(t.openBlock(),t.createElementBlock("div",{key:0,class:"html-fragment",innerHTML:t.unref(M)(n.content)},null,8,nt)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[n.content?(t.openBlock(),t.createBlock(_,{key:0,render:()=>t.unref(M)(n.content)},null,8,["render"])):t.createCommentVNode("",!0)],64))],64))],64)):t.createCommentVNode("",!0),t.unref(s)===7?(t.openBlock(),t.createBlock(Ze,{key:1,"prompt-value":A.value,"onUpdate:promptValue":p[0]||(p[0]=k=>A.value=k),formType:n.formType,maxLength:n.maxLength,placeholder:n.placeholder},null,8,["prompt-value","formType","maxLength","placeholder"])):t.createCommentVNode("",!0),t.unref(s)===2?(t.openBlock(),t.createBlock(ke,{key:2,src:n.content},null,8,["src"])):t.createCommentVNode("",!0),t.unref(s)===5?(t.openBlock(),t.createBlock(_e,{key:3,imgList:n.imgList,startIndex:n.startIndex,onResetCalculationPohtosArea:wt},null,8,["imgList","startIndex"])):t.createCommentVNode("",!0),t.unref(s)===6?(t.openBlock(),t.createBlock(Xe,{key:4,onClose:X,title:n.title,content:n.content,isHtmlFragment:n.isHtmlFragment,icon:n.icon,iconClass:pe.value},null,8,["title","content","isHtmlFragment","icon","iconClass"])):t.createCommentVNode("",!0)],6),t.unref(s)!=3&&t.unref(s)!=5&&t.unref(s)!=6?(t.openBlock(),t.createBlock(Ve,{key:1,maxmin:e.maxmin,max:d.value,min:a.value,closeBtn:e.closeBtn,onOnMin:fe,onOnMax:ue,onOnClose:X},null,8,["maxmin","max","min","closeBtn"])):t.createCommentVNode("",!0),t.createElementVNode("div",{style:t.normalizeStyle(a.value===!0?"display:none":"")},[t.unref(r).footer||n.footer?(t.openBlock(),t.createBlock(we,{key:0,footer:n.footer,footerStyle:n.footerStyle},{default:t.withCtx(()=>[t.renderSlot(u.$slots,"footer")]),_:3},8,["footer","footerStyle"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[(e.btn&&e.btn.length>0||t.unref(s)===0||t.unref(s)===7)&&!e.isMessage?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["zan-layer-btn",[`zan-layer-btn-${e.btnAlign}`]])},[e.btn&&e.btn.length>0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(e.btn,(k,U)=>(t.openBlock(),t.createElementBlock("a",{key:U,style:t.normalizeStyle(k.style),class:t.normalizeClass([k.class,`zan-layer-btn${U}`,{"zan-layer-btn-disabled":k.disabled}]),onClick:Ft=>!k.disabled&&(t.unref(s)===7?k.callback(c.value,A.value):k.callback(c.value))},t.toDisplayString(k.text),15,lt))),128)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.unref(s)===0||t.unref(s)===7?(t.openBlock(),t.createElementBlock("a",{key:0,class:"zan-layer-btn0",onClick:p[1]||(p[1]=k=>gt(c.value,A.value))},t.toDisplayString(e.yesText),1)):t.createCommentVNode("",!0)],64))],2)):t.createCommentVNode("",!0)],64))],4),Et.value?(t.openBlock(),t.createElementBlock("span",ot)):t.createCommentVNode("",!0)],14,et)):t.createCommentVNode("",!0)]),_:3},8,["enter-active-class","leave-active-class"])],8,["to","disabled"]))}}),L=[],at=e=>{L.push(e)},q=e=>{L.forEach((l,o)=>{l.modalContainer.id===e&&L.splice(o,1)})},it=()=>{L.splice(0,L.length)},D=e=>{let l=!1;return L.forEach((o,n)=>{o.modalContainer.id==e&&(l=!0)}),l},T=e=>{let l=null;return L.forEach((o,n)=>{o.modalContainer.id===e&&(l=o)}),l},st=(e,l)=>(e&&(l=Object.assign(l,e)),l),rt=e=>{const l=document.createElement("div");return l.id=e.id,document.body.appendChild(l),l},ct=e=>typeof e=="function"?t.isVNode(e())?{default:()=>e()}:void 0:t.isVNode(e)?{default:()=>e}:void 0,x={_context:null,open:e=>{const l={};return x.create(e,l)},drawer:e=>{const l={type:"drawer"};return x.create(e,l)},msg:(e,l={},o)=>{const n={type:0,title:!1,content:e,shadeClose:!1,closeBtn:!1,isMessage:!0,shade:!1,btn:void 0,time:2e3};return x.create(l,n,o)},load:(e=0,l={})=>{const o={type:3,load:e,anim:5,isOutAnim:!1,shadeClose:!1,shade:!0,shadeOpacity:"0.3"};return x.create(l,o)},confirm:(e,l={})=>{const o={type:0,content:e,shadeClose:!1};return x.create(l,o)},notify:(e,l)=>{e.type=6;const o={offset:"rt",time:3e3,area:"auto",shade:!1};return x.create(e,o,l)},photos:e=>{typeof e=="string"&&(e={imgList:[{src:e}]});const l={type:5,anim:2,startIndex:0,isOutAnim:!0,shadeClose:!0,shadeOpacity:"0.2"};return x.create(e,l)},prompt:e=>{e.type=7;const l={type:"prompt",shadeClose:!1,shadeOpacity:"0.2"};return x.create(e,l)},create:(e,l,o)=>{var a,c;let n;const i=st(e,l);i.hasOwnProperty("id")?x.close(i.id):i.id=J();const r=rt(i),d=t.h(R,{...i,isFunction:!0,internalDestroy(){var f,m;n&&clearTimeout(n),(m=(f=d.component)==null?void 0:f.exposed)==null||m.close(),setTimeout(()=>{t.render(null,r),document.body.contains(r)&&document.body.removeChild(r)},500),q(r.id)}},ct(i.content));return d.appContext=i.appContext||x._context,t.render(d,r),(c=(a=d.component)==null?void 0:a.exposed)==null||c.open(),l&&l.time!=null&&l.time!=0&&(n=setTimeout(()=>{var f,m;(m=(f=d.component)==null?void 0:f.exposed)==null||m.close(),o&&o(r.id),setTimeout(()=>{t.render(null,r),document.body.contains(r)&&document.body.removeChild(r)},500),q(r.id)},l.time)),at({modalContainer:r,modalInstance:d}),r.id},close:e=>{var l,o;if(e!=null&&D(e)){const n=T(e);(o=(l=n.modalInstance.component)==null?void 0:l.exposed)==null||o.close(),setTimeout(()=>{t.render(null,n.modalContainer),document.body.contains(n.modalContainer)&&document.body.removeChild(n.modalContainer)},500)}q(e)},closeAll:()=>{L.forEach(e=>{var l,o;(o=(l=e.modalInstance.component)==null?void 0:l.exposed)==null||o.close(),setTimeout(()=>{t.render(null,e.modalContainer),document.body.contains(e.modalContainer)&&document.body.removeChild(e.modalContainer)},500)}),it()},reset:e=>{var l,o;e!=null&&D(e)&&((o=(l=T(e).modalInstance.component)==null?void 0:l.exposed)==null||o.reset())},min:e=>{var l,o;e!=null&&D(e)&&((o=(l=T(e).modalInstance.component)==null?void 0:l.exposed)==null||o.min())},full:e=>{var l,o;e!=null&&D(e)&&((o=(l=T(e).modalInstance.component)==null?void 0:l.exposed)==null||o.full())},revert:e=>{var l,o;e!=null&&D(e)&&((o=(l=T(e).modalInstance.component)==null?void 0:l.exposed)==null||o.revert())}},dt=(e,l)=>{x._context=e._context,e.component(R.name,R),e.config.globalProperties.$layer=x,l&&typeof l.zIndex=="number"&&e.provide(Ke,t.ref(l.zIndex))},ut={install(e,l){dt(e,l)}};v.ZanLayer=R,v.default=ut,v.layer=x,v.zanLayer=x,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|