@robot-admin/naive-ui-components 0.42.0 → 0.42.2
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/CHANGELOG.md +15 -0
- package/README.md +1 -1
- package/README_EN.md +1 -1
- package/dist/C_SplitPane.css +73 -71
- package/dist/C_SplitPane2.cjs +1 -1
- package/dist/C_SplitPane2.js +1 -1
- package/dist/constants3.d.cts +4 -4
- package/dist/constants3.d.ts +4 -4
- package/dist/constants4.d.cts +3 -3
- package/dist/constants4.d.ts +3 -3
- package/dist/data2.d.cts +8 -8
- package/dist/data2.d.ts +8 -8
- package/dist/editors.d.cts +9 -9
- package/dist/editors.d.ts +9 -9
- package/dist/graphics.d.cts +1 -1
- package/dist/graphics.d.ts +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index10.vue.d.ts +1 -1
- package/dist/index11.vue.d.cts +1 -1
- package/dist/index11.vue.d.ts +3 -3
- package/dist/index12.vue.d.cts +3 -3
- package/dist/index13.vue.d.ts +2 -2
- package/dist/index14.vue.d.cts +2 -2
- package/dist/index14.vue.d.ts +3 -3
- package/dist/index15.vue.d.cts +3 -3
- package/dist/index17.vue.d.ts +1 -1
- package/dist/index18.vue.d.cts +1 -1
- package/dist/index19.vue.d.ts +2 -2
- package/dist/index2.vue.d.cts +2 -2
- package/dist/index2.vue.d.ts +2 -2
- package/dist/index20.vue.d.cts +2 -2
- package/dist/index20.vue.d.ts +3 -3
- package/dist/index21.vue.d.cts +3 -3
- package/dist/index21.vue.d.ts +6 -6
- package/dist/index22.vue.d.cts +6 -6
- package/dist/index23.vue.d.ts +2 -2
- package/dist/index24.vue.d.cts +2 -2
- package/dist/index24.vue.d.ts +1 -1
- package/dist/index25.vue.d.cts +1 -1
- package/dist/index27.vue.d.ts +1 -1
- package/dist/index28.vue.d.cts +1 -1
- package/dist/index29.vue.d.cts +2 -2
- package/dist/index29.vue.d.ts +2 -2
- package/dist/index3.vue.d.cts +1 -1
- package/dist/index3.vue.d.ts +1 -1
- package/dist/index31.vue.d.cts +1 -1
- package/dist/index31.vue.d.ts +1 -1
- package/dist/index35.vue.d.cts +4 -4
- package/dist/index35.vue.d.ts +4 -4
- package/dist/index38.vue.d.cts +2 -2
- package/dist/index38.vue.d.ts +2 -2
- package/dist/index39.vue.d.cts +1 -1
- package/dist/index39.vue.d.ts +1 -1
- package/dist/index42.vue.d.cts +2 -2
- package/dist/index42.vue.d.ts +2 -2
- package/dist/index5.vue.d.cts +2 -2
- package/dist/index5.vue.d.ts +2 -2
- package/dist/index6.vue.d.cts +5 -5
- package/dist/index6.vue.d.ts +5 -5
- package/dist/mapUtils.d.cts +3 -3
- package/dist/mapUtils.d.ts +3 -3
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/style.css +73 -71
- package/dist/useCalendarEvents.d.cts +1 -1
- package/dist/useCalendarEvents.d.ts +1 -1
- package/dist/useCollapsePanel.d.cts +7 -7
- package/dist/useCollapsePanel.d.ts +7 -7
- package/dist/useCropperCore.d.cts +6 -6
- package/dist/useCropperCore.d.ts +6 -6
- package/dist/useEdgeInteraction.d.cts +1 -1
- package/dist/useEdgeInteraction.d.ts +1 -1
- package/dist/useFullscreen.d.cts +2 -2
- package/dist/useFullscreen.d.ts +2 -2
- package/dist/useQRCode.d.cts +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useSignatureHistory.d.cts +1 -1
- package/dist/useSignatureHistory.d.ts +1 -1
- package/dist/useSplitResize.d.cts +7 -7
- package/dist/useSplitResize.d.ts +7 -7
- package/dist/useWorkflowValidation.d.cts +84 -84
- package/dist/useWorkflowValidation.d.ts +84 -84
- package/dist/verification.d.cts +6 -6
- package/dist/verification.d.ts +6 -6
- package/docs/guides/split-pane.en.md +7 -5
- package/docs/guides/split-pane.md +6 -12
- package/docs/wl-ui-produce-coverage.md +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @robot-admin/naive-ui-components
|
|
2
2
|
|
|
3
|
+
## 0.42.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- `C_SplitPane` 按实际折叠状态通知 `collapse` 和 `expand`。禁用折叠后,键盘抵达或离开尺寸边界时只通知比例变化。
|
|
8
|
+
- 受控拖动合并同一手势内连续重复的尺寸请求。容器尺寸变化后,仍按最新可用空间重新换算位移。
|
|
9
|
+
- 握柄悬停时的透明区域允许相邻表格接收点击,两侧箭头保持可达。减少动态效果模式下保留无动画的短暂停留时间。
|
|
10
|
+
- 根据生产多表页面与实际平台手柄实现更新中英文指南,说明拖动热区、页面高度预算和初始尺寸单位。
|
|
11
|
+
|
|
12
|
+
## 0.42.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- `C_SplitPane` 将点击与拖动分开,合并每帧的指针更新并在松手时结算最终尺寸。修复快速连续拖动被判为折叠、折叠控件间的悬停断点以及受控尺寸的拖动收尾。
|
|
17
|
+
|
|
3
18
|
## 0.42.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
**Naive UI Components** 是从 [Robot Admin](https://github.com/ChenyCHENYU/Robot_Admin) 提炼的 Vue 3 组件库,以 `@robot-admin/naive-ui-components` 独立发布。表单、表格、实体选择和工作台可以通过类型化的配置接入。业务接口、权限和任务执行由宿主应用负责。
|
|
30
30
|
|
|
31
|
-
当前仓库版本 **0.42.
|
|
31
|
+
当前仓库版本 **0.42.2**。分割面板按实际状态通知折叠和展开,受控拖动合并连续重复的尺寸请求。多表页面可用像素下限和分隔条宽度预留拖动空间。 [分割面板](./docs/guides/split-pane.md) · [变更记录](./CHANGELOG.md)
|
|
32
32
|
|
|
33
33
|
## 快速开始
|
|
34
34
|
|
package/README_EN.md
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
**Naive UI Components** is a Vue 3 library extracted from [Robot Admin](https://github.com/ChenyCHENYU/Robot_Admin) and published independently as `@robot-admin/naive-ui-components`. It provides typed configuration for forms, tables, entity pickers, and workspaces. The host application owns endpoints, permissions, and task execution.
|
|
30
30
|
|
|
31
|
-
The current repository version is **0.42.
|
|
31
|
+
The current repository version is **0.42.2**. Split panes report actual collapse and expansion, and controlled dragging suppresses consecutive duplicate size requests. Multi-table workspaces can reserve room to resize with pixel minimums and a configurable divider. [Split panes](./docs/guides/split-pane.en.md) · [Changelog](./CHANGELOG.md)
|
|
32
32
|
|
|
33
33
|
## Quick start
|
|
34
34
|
|
package/dist/C_SplitPane.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@import "./shared-tokens.css";
|
|
2
|
-
.c-split-pane[data-v-
|
|
2
|
+
.c-split-pane[data-v-6f1b8596] {
|
|
3
3
|
display: flex;
|
|
4
4
|
width: 100%;
|
|
5
5
|
height: 100%;
|
|
@@ -8,21 +8,21 @@
|
|
|
8
8
|
overflow: hidden;
|
|
9
9
|
position: relative;
|
|
10
10
|
}
|
|
11
|
-
.c-split-pane--horizontal[data-v-
|
|
11
|
+
.c-split-pane--horizontal[data-v-6f1b8596] {
|
|
12
12
|
flex-direction: row;
|
|
13
13
|
}
|
|
14
|
-
.c-split-pane--vertical[data-v-
|
|
14
|
+
.c-split-pane--vertical[data-v-6f1b8596] {
|
|
15
15
|
flex-direction: column;
|
|
16
16
|
}
|
|
17
|
-
.c-split-pane--dragging > .split-panel > .split-panel__content[data-v-
|
|
17
|
+
.c-split-pane--dragging > .split-panel > .split-panel__content[data-v-6f1b8596] {
|
|
18
18
|
pointer-events: none;
|
|
19
19
|
user-select: none;
|
|
20
20
|
}
|
|
21
|
-
.c-split-pane--disabled > .split-gutter[data-v-
|
|
21
|
+
.c-split-pane--disabled > .split-gutter[data-v-6f1b8596] {
|
|
22
22
|
cursor: default;
|
|
23
23
|
opacity: 0.5;
|
|
24
24
|
}
|
|
25
|
-
.split-panel[data-v-
|
|
25
|
+
.split-panel[data-v-6f1b8596] {
|
|
26
26
|
min-width: 0;
|
|
27
27
|
min-height: 0;
|
|
28
28
|
overflow: hidden;
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
display: flex;
|
|
31
31
|
flex-direction: column;
|
|
32
32
|
}
|
|
33
|
-
.split-panel__content[data-v-
|
|
33
|
+
.split-panel__content[data-v-6f1b8596] {
|
|
34
34
|
width: 100%;
|
|
35
35
|
height: 100%;
|
|
36
36
|
min-width: 0;
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
overflow: auto;
|
|
39
39
|
overscroll-behavior: contain;
|
|
40
40
|
}
|
|
41
|
-
.split-gutter[data-v-
|
|
41
|
+
.split-gutter[data-v-6f1b8596] {
|
|
42
42
|
--split-accent: var(
|
|
43
43
|
--c-primary,
|
|
44
44
|
var(--c-theme-primary, var(--primary-color, #2080f0))
|
|
@@ -84,28 +84,28 @@
|
|
|
84
84
|
background: transparent;
|
|
85
85
|
outline: none;
|
|
86
86
|
}
|
|
87
|
-
.split-gutter[data-v-
|
|
87
|
+
.split-gutter[data-v-6f1b8596]::before {
|
|
88
88
|
content: "";
|
|
89
89
|
position: absolute;
|
|
90
90
|
background: var(--split-line-color);
|
|
91
91
|
pointer-events: none;
|
|
92
92
|
transition: background-color 0.16s ease;
|
|
93
93
|
}
|
|
94
|
-
.c-split-pane--horizontal > .split-gutter[data-v-
|
|
94
|
+
.c-split-pane--horizontal > .split-gutter[data-v-6f1b8596] {
|
|
95
95
|
cursor: col-resize;
|
|
96
96
|
}
|
|
97
|
-
.c-split-pane--horizontal > .split-gutter[data-v-
|
|
97
|
+
.c-split-pane--horizontal > .split-gutter[data-v-6f1b8596]::before {
|
|
98
98
|
inset: 0 auto;
|
|
99
99
|
width: 1px;
|
|
100
100
|
}
|
|
101
|
-
.c-split-pane--vertical > .split-gutter[data-v-
|
|
101
|
+
.c-split-pane--vertical > .split-gutter[data-v-6f1b8596] {
|
|
102
102
|
cursor: row-resize;
|
|
103
103
|
}
|
|
104
|
-
.c-split-pane--vertical > .split-gutter[data-v-
|
|
104
|
+
.c-split-pane--vertical > .split-gutter[data-v-6f1b8596]::before {
|
|
105
105
|
inset: auto 0;
|
|
106
106
|
height: 1px;
|
|
107
107
|
}
|
|
108
|
-
.split-gutter__controls[data-v-
|
|
108
|
+
.split-gutter__controls[data-v-6f1b8596] {
|
|
109
109
|
position: absolute;
|
|
110
110
|
display: flex;
|
|
111
111
|
align-items: center;
|
|
@@ -113,22 +113,22 @@
|
|
|
113
113
|
gap: var(--split-control-gap);
|
|
114
114
|
pointer-events: none;
|
|
115
115
|
}
|
|
116
|
-
.split-gutter__controls--with-collapse[data-v-
|
|
116
|
+
.split-gutter__controls--with-collapse[data-v-6f1b8596] {
|
|
117
117
|
--split-controls-length: calc(
|
|
118
118
|
var(--split-handle-length) + var(--split-button-size) * 2 +
|
|
119
119
|
var(--split-control-gap) * 2
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
|
-
.c-split-pane--horizontal > .split-gutter .split-gutter__controls[data-v-
|
|
122
|
+
.c-split-pane--horizontal > .split-gutter .split-gutter__controls[data-v-6f1b8596] {
|
|
123
123
|
flex-direction: column;
|
|
124
124
|
width: var(--split-button-size);
|
|
125
125
|
height: min(var(--split-controls-length), 100% - 8px);
|
|
126
126
|
}
|
|
127
|
-
.c-split-pane--vertical > .split-gutter .split-gutter__controls[data-v-
|
|
127
|
+
.c-split-pane--vertical > .split-gutter .split-gutter__controls[data-v-6f1b8596] {
|
|
128
128
|
width: min(var(--split-controls-length), 100% - 8px);
|
|
129
129
|
height: var(--split-button-size);
|
|
130
130
|
}
|
|
131
|
-
.split-gutter__visual[data-v-
|
|
131
|
+
.split-gutter__visual[data-v-6f1b8596] {
|
|
132
132
|
display: flex;
|
|
133
133
|
align-items: center;
|
|
134
134
|
justify-content: center;
|
|
@@ -142,23 +142,23 @@
|
|
|
142
142
|
pointer-events: auto;
|
|
143
143
|
transition: border-color 0.16s ease, box-shadow 0.16s ease;
|
|
144
144
|
}
|
|
145
|
-
.c-split-pane--horizontal > .split-gutter .split-gutter__visual[data-v-
|
|
145
|
+
.c-split-pane--horizontal > .split-gutter .split-gutter__visual[data-v-6f1b8596] {
|
|
146
146
|
width: var(--split-handle-thickness);
|
|
147
147
|
min-height: 20px;
|
|
148
148
|
}
|
|
149
|
-
.c-split-pane--vertical > .split-gutter .split-gutter__visual[data-v-
|
|
149
|
+
.c-split-pane--vertical > .split-gutter .split-gutter__visual[data-v-6f1b8596] {
|
|
150
150
|
min-width: 20px;
|
|
151
151
|
height: var(--split-handle-thickness);
|
|
152
152
|
}
|
|
153
|
-
.split-gutter__dots[data-v-
|
|
153
|
+
.split-gutter__dots[data-v-6f1b8596] {
|
|
154
154
|
display: flex;
|
|
155
155
|
gap: 5px;
|
|
156
156
|
pointer-events: none;
|
|
157
157
|
}
|
|
158
|
-
.c-split-pane--horizontal > .split-gutter .split-gutter__dots[data-v-
|
|
158
|
+
.c-split-pane--horizontal > .split-gutter .split-gutter__dots[data-v-6f1b8596] {
|
|
159
159
|
flex-direction: column;
|
|
160
160
|
}
|
|
161
|
-
.split-gutter__dot[data-v-
|
|
161
|
+
.split-gutter__dot[data-v-6f1b8596] {
|
|
162
162
|
width: 3px;
|
|
163
163
|
height: 3px;
|
|
164
164
|
border-radius: 50%;
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
|
|
167
167
|
transition: background-color 0.16s ease;
|
|
168
168
|
}
|
|
169
|
-
.split-gutter__collapse-btn[data-v-
|
|
169
|
+
.split-gutter__collapse-btn[data-v-6f1b8596] {
|
|
170
170
|
display: flex;
|
|
171
171
|
align-items: center;
|
|
172
172
|
justify-content: center;
|
|
@@ -185,21 +185,21 @@
|
|
|
185
185
|
cursor: pointer;
|
|
186
186
|
opacity: 0;
|
|
187
187
|
visibility: hidden;
|
|
188
|
-
pointer-events:
|
|
189
|
-
transition: opacity 0.16s ease, border-color 0.16s ease, color 0.16s ease;
|
|
188
|
+
pointer-events: auto;
|
|
189
|
+
transition: opacity 0.16s ease, visibility 0s linear 0.16s, border-color 0.16s ease, color 0.16s ease;
|
|
190
190
|
}
|
|
191
|
-
.split-gutter__collapse-btn[data-v-
|
|
191
|
+
.split-gutter__collapse-btn[data-v-6f1b8596]:hover, .split-gutter__collapse-btn[data-v-6f1b8596]:focus-visible {
|
|
192
192
|
color: var(--split-accent);
|
|
193
193
|
border-color: color-mix(in srgb, var(--split-accent) 55%, var(--split-border));
|
|
194
194
|
}
|
|
195
|
-
.split-gutter__collapse-btn[data-v-
|
|
195
|
+
.split-gutter__collapse-btn[data-v-6f1b8596]:focus-visible {
|
|
196
196
|
outline: 2px solid var(--split-accent);
|
|
197
197
|
outline-offset: 2px;
|
|
198
198
|
}
|
|
199
|
-
.split-gutter__collapse-btn[data-v-
|
|
199
|
+
.split-gutter__collapse-btn[data-v-6f1b8596]:disabled {
|
|
200
200
|
cursor: default;
|
|
201
201
|
}
|
|
202
|
-
.split-gutter__chevron[data-v-
|
|
202
|
+
.split-gutter__chevron[data-v-6f1b8596] {
|
|
203
203
|
width: 14px;
|
|
204
204
|
height: 14px;
|
|
205
205
|
fill: none;
|
|
@@ -209,28 +209,28 @@
|
|
|
209
209
|
stroke-linejoin: round;
|
|
210
210
|
pointer-events: none;
|
|
211
211
|
}
|
|
212
|
-
.split-gutter__collapse-btn--second .split-gutter__chevron[data-v-
|
|
212
|
+
.split-gutter__collapse-btn--second .split-gutter__chevron[data-v-6f1b8596] {
|
|
213
213
|
transform: rotate(180deg);
|
|
214
214
|
}
|
|
215
|
-
.c-split-pane--vertical > .split-gutter .split-gutter__collapse-btn--first .split-gutter__chevron[data-v-
|
|
215
|
+
.c-split-pane--vertical > .split-gutter .split-gutter__collapse-btn--first .split-gutter__chevron[data-v-6f1b8596] {
|
|
216
216
|
transform: rotate(90deg);
|
|
217
217
|
}
|
|
218
|
-
.c-split-pane--vertical > .split-gutter .split-gutter__collapse-btn--second .split-gutter__chevron[data-v-
|
|
218
|
+
.c-split-pane--vertical > .split-gutter .split-gutter__collapse-btn--second .split-gutter__chevron[data-v-6f1b8596] {
|
|
219
219
|
transform: rotate(270deg);
|
|
220
220
|
}
|
|
221
|
-
.c-split-pane--collapsed-first > .split-gutter .split-gutter__collapse-btn--first .split-gutter__chevron[data-v-
|
|
221
|
+
.c-split-pane--collapsed-first > .split-gutter .split-gutter__collapse-btn--first .split-gutter__chevron[data-v-6f1b8596] {
|
|
222
222
|
transform: rotate(180deg);
|
|
223
223
|
}
|
|
224
|
-
.c-split-pane--collapsed-second > .split-gutter .split-gutter__collapse-btn--second .split-gutter__chevron[data-v-
|
|
224
|
+
.c-split-pane--collapsed-second > .split-gutter .split-gutter__collapse-btn--second .split-gutter__chevron[data-v-6f1b8596] {
|
|
225
225
|
transform: none;
|
|
226
226
|
}
|
|
227
|
-
.c-split-pane--vertical.c-split-pane--collapsed-first > .split-gutter .split-gutter__collapse-btn--first .split-gutter__chevron[data-v-
|
|
227
|
+
.c-split-pane--vertical.c-split-pane--collapsed-first > .split-gutter .split-gutter__collapse-btn--first .split-gutter__chevron[data-v-6f1b8596] {
|
|
228
228
|
transform: rotate(270deg);
|
|
229
229
|
}
|
|
230
|
-
.c-split-pane--vertical.c-split-pane--collapsed-second > .split-gutter .split-gutter__collapse-btn--second .split-gutter__chevron[data-v-
|
|
230
|
+
.c-split-pane--vertical.c-split-pane--collapsed-second > .split-gutter .split-gutter__collapse-btn--second .split-gutter__chevron[data-v-6f1b8596] {
|
|
231
231
|
transform: rotate(90deg);
|
|
232
232
|
}
|
|
233
|
-
.c-split-pane:not(.c-split-pane--disabled) > .split-gutter[data-v-
|
|
233
|
+
.c-split-pane:not(.c-split-pane--disabled) > .split-gutter[data-v-6f1b8596]:hover, .c-split-pane:not(.c-split-pane--disabled) > .split-gutter[data-v-6f1b8596]:focus-within {
|
|
234
234
|
--split-line-color: color-mix(
|
|
235
235
|
in srgb,
|
|
236
236
|
var(--split-accent) 28%,
|
|
@@ -246,16 +246,16 @@
|
|
|
246
246
|
0 1px 3px rgb(15 23 42 / 9%),
|
|
247
247
|
0 3px 12px color-mix(in srgb, var(--split-accent) 13%, transparent);
|
|
248
248
|
}
|
|
249
|
-
.c-split-pane:not(.c-split-pane--disabled) > .split-gutter:hover .split-gutter__collapse-btn[data-v-
|
|
249
|
+
.c-split-pane:not(.c-split-pane--disabled) > .split-gutter:hover .split-gutter__collapse-btn[data-v-6f1b8596], .c-split-pane:not(.c-split-pane--disabled) > .split-gutter:focus-within .split-gutter__collapse-btn[data-v-6f1b8596] {
|
|
250
250
|
opacity: 1;
|
|
251
251
|
visibility: visible;
|
|
252
|
-
|
|
252
|
+
transition-delay: 0s;
|
|
253
253
|
}
|
|
254
|
-
.c-split-pane:not(.c-split-pane--disabled) > .split-gutter:focus-visible .split-gutter__visual[data-v-
|
|
254
|
+
.c-split-pane:not(.c-split-pane--disabled) > .split-gutter:focus-visible .split-gutter__visual[data-v-6f1b8596] {
|
|
255
255
|
outline: 2px solid var(--split-accent);
|
|
256
256
|
outline-offset: 3px;
|
|
257
257
|
}
|
|
258
|
-
.c-split-pane--dragging:not(.c-split-pane--disabled) > .split-gutter[data-v-
|
|
258
|
+
.c-split-pane--dragging:not(.c-split-pane--disabled) > .split-gutter[data-v-6f1b8596] {
|
|
259
259
|
--split-line-color: color-mix(
|
|
260
260
|
in srgb,
|
|
261
261
|
var(--split-accent) 28%,
|
|
@@ -271,74 +271,76 @@
|
|
|
271
271
|
0 1px 3px rgb(15 23 42 / 9%),
|
|
272
272
|
0 3px 12px color-mix(in srgb, var(--split-accent) 13%, transparent);
|
|
273
273
|
}
|
|
274
|
-
.c-split-pane--collapsed-first > .split-gutter .split-gutter__collapse-btn[data-v-
|
|
275
|
-
.c-split-pane--collapsed-second > .split-gutter .split-gutter__collapse-btn[data-v-
|
|
274
|
+
.c-split-pane--collapsed-first > .split-gutter .split-gutter__collapse-btn[data-v-6f1b8596],
|
|
275
|
+
.c-split-pane--collapsed-second > .split-gutter .split-gutter__collapse-btn[data-v-6f1b8596] {
|
|
276
276
|
opacity: 1;
|
|
277
277
|
visibility: visible;
|
|
278
|
-
|
|
278
|
+
transition-delay: 0s;
|
|
279
279
|
}
|
|
280
|
-
.c-split-pane--horizontal.c-split-pane--collapsed-first > .split-gutter .split-gutter__controls[data-v-
|
|
280
|
+
.c-split-pane--horizontal.c-split-pane--collapsed-first > .split-gutter .split-gutter__controls[data-v-6f1b8596] {
|
|
281
281
|
left: 0;
|
|
282
282
|
}
|
|
283
|
-
.c-split-pane--horizontal.c-split-pane--collapsed-second > .split-gutter .split-gutter__controls[data-v-
|
|
283
|
+
.c-split-pane--horizontal.c-split-pane--collapsed-second > .split-gutter .split-gutter__controls[data-v-6f1b8596] {
|
|
284
284
|
right: 0;
|
|
285
285
|
}
|
|
286
|
-
.c-split-pane--vertical.c-split-pane--collapsed-first > .split-gutter .split-gutter__controls[data-v-
|
|
286
|
+
.c-split-pane--vertical.c-split-pane--collapsed-first > .split-gutter .split-gutter__controls[data-v-6f1b8596] {
|
|
287
287
|
top: 0;
|
|
288
288
|
}
|
|
289
|
-
.c-split-pane--vertical.c-split-pane--collapsed-second > .split-gutter .split-gutter__controls[data-v-
|
|
289
|
+
.c-split-pane--vertical.c-split-pane--collapsed-second > .split-gutter .split-gutter__controls[data-v-6f1b8596] {
|
|
290
290
|
bottom: 0;
|
|
291
291
|
}
|
|
292
|
-
.c-split-pane--disabled > .split-gutter .split-gutter__visual[data-v-
|
|
292
|
+
.c-split-pane--disabled > .split-gutter .split-gutter__visual[data-v-6f1b8596] {
|
|
293
293
|
pointer-events: none;
|
|
294
294
|
box-shadow: none;
|
|
295
295
|
}
|
|
296
|
-
.c-split-pane--disabled > .split-gutter .split-gutter__collapse-btn[data-v-
|
|
296
|
+
.c-split-pane--disabled > .split-gutter .split-gutter__collapse-btn[data-v-6f1b8596] {
|
|
297
297
|
visibility: hidden;
|
|
298
298
|
pointer-events: none;
|
|
299
299
|
}
|
|
300
300
|
@media (hover: none), (pointer: coarse) {
|
|
301
|
-
.split-gutter[data-v-
|
|
301
|
+
.split-gutter[data-v-6f1b8596] {
|
|
302
302
|
--split-handle-thickness: 24px;
|
|
303
303
|
--split-button-size: 28px;
|
|
304
304
|
}
|
|
305
|
-
.c-split-pane:not(.c-split-pane--disabled) > .split-gutter .split-gutter__collapse-btn[data-v-
|
|
305
|
+
.c-split-pane:not(.c-split-pane--disabled) > .split-gutter .split-gutter__collapse-btn[data-v-6f1b8596] {
|
|
306
306
|
opacity: 1;
|
|
307
307
|
visibility: visible;
|
|
308
|
-
|
|
308
|
+
transition-delay: 0s;
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
@media (prefers-reduced-motion: reduce) {
|
|
312
|
-
.split-gutter[data-v-
|
|
313
|
-
.split-gutter__visual[data-v-
|
|
314
|
-
.split-gutter__dot[data-v-
|
|
315
|
-
.split-gutter__collapse-btn[data-v-8dec0887] {
|
|
312
|
+
.split-gutter[data-v-6f1b8596]::before,
|
|
313
|
+
.split-gutter__visual[data-v-6f1b8596],
|
|
314
|
+
.split-gutter__dot[data-v-6f1b8596] {
|
|
316
315
|
transition: none;
|
|
317
316
|
}
|
|
317
|
+
.split-gutter__collapse-btn[data-v-6f1b8596] {
|
|
318
|
+
transition: opacity 0s linear 0.16s, visibility 0s linear 0.16s;
|
|
319
|
+
}
|
|
318
320
|
}
|
|
319
321
|
|
|
320
322
|
/* layer: shortcuts */
|
|
321
|
-
.container[data-v-
|
|
323
|
+
.container[data-v-6f1b8596]{width:100%;}
|
|
322
324
|
@media (min-width: 640px){
|
|
323
|
-
.container[data-v-
|
|
325
|
+
.container[data-v-6f1b8596]{max-width:640px;}
|
|
324
326
|
}
|
|
325
327
|
@media (min-width: 768px){
|
|
326
|
-
.container[data-v-
|
|
328
|
+
.container[data-v-6f1b8596]{max-width:768px;}
|
|
327
329
|
}
|
|
328
330
|
@media (min-width: 1024px){
|
|
329
|
-
.container[data-v-
|
|
331
|
+
.container[data-v-6f1b8596]{max-width:1024px;}
|
|
330
332
|
}
|
|
331
333
|
@media (min-width: 1280px){
|
|
332
|
-
.container[data-v-
|
|
334
|
+
.container[data-v-6f1b8596]{max-width:1280px;}
|
|
333
335
|
}
|
|
334
336
|
@media (min-width: 1536px){
|
|
335
|
-
.container[data-v-
|
|
337
|
+
.container[data-v-6f1b8596]{max-width:1536px;}
|
|
336
338
|
}
|
|
337
339
|
/* layer: default */
|
|
338
|
-
.visible[data-v-
|
|
339
|
-
.m9\.5[data-v-
|
|
340
|
-
.flex[data-v-
|
|
341
|
-
.table[data-v-
|
|
342
|
-
.resize[data-v-
|
|
343
|
-
.px[data-v-
|
|
344
|
-
.blur[data-v-
|
|
340
|
+
.visible[data-v-6f1b8596]{visibility:visible;}
|
|
341
|
+
.m9\.5[data-v-6f1b8596]{margin:2.375rem;}
|
|
342
|
+
.flex[data-v-6f1b8596]{display:flex;}
|
|
343
|
+
.table[data-v-6f1b8596]{display:table;}
|
|
344
|
+
.resize[data-v-6f1b8596]{resize:both;}
|
|
345
|
+
.px[data-v-6f1b8596]{padding-left:1rem;padding-right:1rem;}
|
|
346
|
+
.blur[data-v-6f1b8596]{--un-blur:blur(8px);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}
|
package/dist/C_SplitPane2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./useComponentLocale.cjs`),t=require(`./useComponentTheme.cjs`),n=require(`./export-helper.cjs`);let r=require(`vue`);const i=(e,t)=>typeof e==`number`&&Number.isFinite(e)?e:t,a=e=>Math.max(4,i(e,6));function o(e){let t=Math.max(0,Math.min(100,i(e.minSize,0))),n=Math.max(0,Math.min(100,i(e.maxSize,100))),r=Math.min(t,n),a=Math.max(t,n),o=Math.max(0,i(e.availableLength,0));if(!o)return{min:r,max:a};let s=Math.max(0,i(e.minFirstSize,0)),c=Math.max(0,i(e.minSecondSize,0)),l=Math.max(r,s/o*100),u=Math.min(a,100-c/o*100);if(l<=u)return{min:l,max:u};let d=s+c?s/(s+c)*100:50,f=Math.max(r,Math.min(a,d));return{min:f,max:f}}function s(e,t,n){return Math.min(n,Math.max(t,i(e,50)))}const c=new WeakMap;function l(e){return`button`in e&&e.button!==0?!1:!(`isPrimary`in e)||e.isPrimary}function u(e,t,n){if(!(`touches`in e))return t===`horizontal`?e.clientX:e.clientY;let r=n===void 0?e.touches[0]:Array.from(e.touches).find(e=>e.identifier===n);if(r)return t===`horizontal`?r.clientX:r.clientY}function d(e,t){return t===void 0||!(`pointerId`in e)?!0:e.pointerId===t}function f(e,t){let{style:n}=e.body,r=t===`horizontal`?`col-resize`:`row-resize`,i=[`cursor`,`user-select`].map(e=>({name:e,value:n.getPropertyValue(e),priority:n.getPropertyPriority(e),owned:e===`cursor`?r:`none`}));for(let e of i)n.setProperty(e.name,e.owned);return()=>{for(let e of i)n.getPropertyValue(e.name)===e.owned&&(e.value?n.setProperty(e.name,e.value,e.priority):n.removeProperty(e.name))}}function p(e){return`pointerId`in e?{move:[`pointermove`],end:[`pointerup`,`pointercancel`]}:`touches`in e?{move:[`touchmove`],end:[`touchend`,`touchcancel`]}:{move:[`mousemove`],end:[`mouseup`]}}function m(e,t){let n=u(e,t.direction);if(n===void 0)return;let r=t.element.ownerDocument,i=r.defaultView;c.get(r)?.();let a=f(r,t.direction),o=`pointerId`in e?e.pointerId:void 0,s=`touches`in e?e.touches[0]?.identifier:void 0,l=!0;e.preventDefault(),e.stopPropagation(),e.currentTarget?.focus({preventScroll:!0});let m=e=>{if(!d(e,o))return;let r=u(e,t.direction,s);r!==void 0&&(e.cancelable&&e.preventDefault(),t.onDelta(r-n))},h=e=>{if(!(e&&!d(e,o))&&l){l=!1,a();for(let[e,t]of v)r.removeEventListener(e,t);i?.removeEventListener(`blur`,h),c.get(r)===h&&c.delete(r),t.onEnd()}},g=()=>{r.hidden&&h()},_=p(e),v=[..._.move.map(e=>[e,m]),..._.end.map(e=>[e,h]),[`visibilitychange`,g]];for(let[e,t]of v)r.addEventListener(e,t,{passive:!1});return i?.addEventListener(`blur`,h),c.set(r,h),h}function h(e){return e===0?`first`:e===100?`second`:null}function g(e,t,n,r,i){if(e===`Home`)return i.min;if(e===`End`)return i.max;let a=t===`horizontal`?`ArrowLeft`:`ArrowUp`,o=t===`horizontal`?`ArrowRight`:`ArrowDown`;if(e===a)return r-n;if(e===o)return r+n}function _(e){let{containerRef:t,direction:n,disabled:c,collapsible:u}=e,d=(0,r.ref)(0),f=(0,r.computed)(()=>a((0,r.toValue)(e.gutterSize))),p=(0,r.computed)(()=>Math.max(0,d.value-f.value)),_=(0,r.computed)(()=>o({minSize:(0,r.toValue)(e.minSize),maxSize:(0,r.toValue)(e.maxSize),minFirstSize:(0,r.toValue)(e.minFirstSize)??0,minSecondSize:(0,r.toValue)(e.minSecondSize)??0,availableLength:p.value})),v=(0,r.ref)(s((0,r.toValue)(e.defaultSize),_.value.min,_.value.max)),y=(0,r.computed)(()=>(0,r.toValue)(e.size)!==void 0),b=(0,r.computed)(()=>y.value?i((0,r.toValue)(e.size),50):v.value),x=(0,r.computed)(()=>u.value?b.value===0?`first`:b.value===100?`second`:null:null),S=(0,r.computed)(()=>x.value?x.value===`first`?0:100:s(b.value,_.value.min,_.value.max)),C=(0,r.ref)(!1),w=(0,r.computed)(()=>x.value===`first`),T=(0,r.computed)(()=>x.value===`second`),E=i((0,r.toValue)(e.defaultSize),50),D=x.value?s(E>0&&E<100?E:50,_.value.min,_.value.max):S.value,O,k,A=(t,n=!1)=>{if(!Number.isFinite(t))return;let r=n?t:s(t,_.value.min,_.value.max);r!==b.value&&(y.value||(v.value=r),e.onUpdateSize?.(r))};(0,r.watch)(S,(t,n)=>{let r=h(n),i=x.value;!r&&i&&(D=n),r&&r!==i&&e.onExpand?.(r),i&&i!==r&&e.onCollapse?.(i),e.onResize?.(t,100-t)},{flush:`sync`}),(0,r.watch)(_,()=>{x.value||A(S.value)},{flush:`sync`}),(0,r.watch)([c,n],()=>O?.(),{flush:`sync`}),(0,r.watch)(u,()=>{x.value||A(S.value)},{flush:`sync`});let j=()=>{let e=t.value;if(!e)return;let r=e.getBoundingClientRect();d.value=n.value===`horizontal`?r.width:r.height};(0,r.watch)(n,j,{flush:`post`}),(0,r.onMounted)(()=>{j(),typeof ResizeObserver<`u`&&t.value&&(k=new ResizeObserver(j),k.observe(t.value))});let M=(e=`first`)=>{!u.value||x.value===e||(x.value||(D=S.value),A(e===`first`?0:100,!0))},N=()=>{x.value&&A(D)},P=(e=`first`)=>{x.value===e?N():M(e)};return(0,r.onDeactivated)(()=>O?.()),(0,r.onUnmounted)(()=>{O?.(),k?.disconnect()}),{panelSize:S,isDragging:C,collapsedTarget:x,isFirstCollapsed:w,isSecondCollapsed:T,bounds:_,gutterSize:f,handleMouseDown:r=>{if(c.value||C.value||!l(r))return;let i=t.value;if(!i||(j(),!p.value))return;let a=S.value;O=m(r,{element:i,direction:n.value,onDelta:e=>A(a+e/p.value*100),onEnd:()=>{C.value=!1,O=void 0,e.onDragEnd?.(S.value)}}),O&&(C.value=!0,e.onDragStart?.(S.value))},handleDoubleClick:()=>{c.value||P(`first`)},handleKeyDown:t=>{if(c.value||t.target!==t.currentTarget)return;if(t.key===`Enter`){u.value&&(t.preventDefault(),x.value?N():M(`first`));return}let a=Math.max(0,i((0,r.toValue)(e.step),2))||2,o=t.shiftKey?10:1,s=g(t.key,n.value,a*o,S.value,_.value);s!==void 0&&(t.preventDefault(),A(s))},collapse:M,expand:N,toggle:P,resetSize:()=>A(i((0,r.toValue)(e.defaultSize),50)),setSize:e=>A(e),getPanelInfo:()=>({first:{size:S.value,collapsed:w.value},second:{size:100-S.value,collapsed:T.value}})}}const v=[`aria-hidden`,`inert`],y={class:`split-panel__content`},b=[`aria-orientation`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`,`aria-disabled`,`aria-label`,`tabindex`],x=[`disabled`,`aria-label`,`aria-expanded`,`title`],S={class:`split-gutter__visual`,"aria-hidden":`true`},C={class:`split-gutter__dots`},w=[`disabled`,`aria-label`,`aria-expanded`,`title`],T=[`aria-hidden`,`inert`],E={class:`split-panel__content`},D=(0,r.defineComponent)({name:`C_SplitPane`,__name:`index`,props:{ariaLabel:{},direction:{default:`horizontal`},size:{},defaultSize:{default:50},minSize:{default:0},maxSize:{default:100},minFirstSize:{default:0},minSecondSize:{default:0},disabled:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},gutterSize:{default:6},step:{default:2}},emits:[`update:size`,`resize`,`collapse`,`expand`,`drag-start`,`drag-end`],setup(n,{expose:i,emit:a}){let o=t.n(),{t:s}=e.t(),c=n,l=a,u=(0,r.useId)(),d=`split-${u}-first`,f=`split-${u}-second`,p=(0,r.ref)(null),{panelSize:m,bounds:h,gutterSize:g,isDragging:D,isFirstCollapsed:O,isSecondCollapsed:k,handleMouseDown:A,handleDoubleClick:j,handleKeyDown:M,collapse:N,expand:P,toggle:F,resetSize:I,setSize:L,getPanelInfo:R}=_({containerRef:p,direction:(0,r.toRef)(c,`direction`),size:(0,r.toRef)(c,`size`),defaultSize:(0,r.toRef)(c,`defaultSize`),minSize:(0,r.toRef)(c,`minSize`),maxSize:(0,r.toRef)(c,`maxSize`),minFirstSize:(0,r.toRef)(c,`minFirstSize`),minSecondSize:(0,r.toRef)(c,`minSecondSize`),gutterSize:(0,r.toRef)(c,`gutterSize`),disabled:(0,r.toRef)(c,`disabled`),collapsible:(0,r.toRef)(c,`collapsible`),step:(0,r.toRef)(c,`step`),onUpdateSize:e=>l(`update:size`,e),onResize:(e,t)=>l(`resize`,e,t),onCollapse:e=>l(`collapse`,e),onExpand:e=>l(`expand`,e),onDragStart:e=>l(`drag-start`,e),onDragEnd:e=>l(`drag-end`,e)}),z=(0,r.computed)(()=>({flex:`${m.value} 1 0px`})),B=(0,r.computed)(()=>({flex:`${100-m.value} 1 0px`})),V=(0,r.computed)(()=>c.direction===`horizontal`?{width:`${g.value}px`}:{height:`${g.value}px`});return i({collapse:N,expand:P,toggle:F,resetSize:I,getPanelInfo:R,setSize:L}),(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref_key:`containerRef`,ref:p,class:(0,r.normalizeClass)([`c-split-pane`,[`c-split-pane--${n.direction}`,{"c-split-pane--dragging":(0,r.unref)(D),"c-split-pane--disabled":n.disabled,"c-split-pane--collapsed-first":(0,r.unref)(O),"c-split-pane--collapsed-second":(0,r.unref)(k)}]]),style:(0,r.normalizeStyle)((0,r.unref)(o))},[(0,r.createCommentVNode)(` 首面板 `),(0,r.createElementVNode)(`div`,{class:`split-panel split-panel--first`,id:d,style:(0,r.normalizeStyle)(z.value),"aria-hidden":(0,r.unref)(O)||void 0,inert:(0,r.unref)(O)},[(0,r.createElementVNode)(`div`,y,[(0,r.renderSlot)(e.$slots,`first`,{size:(0,r.unref)(m),collapsed:(0,r.unref)(O)},void 0,!0)])],12,v),(0,r.createCommentVNode)(` 分割线手柄 `),(0,r.createElementVNode)(`div`,{class:`split-gutter`,style:(0,r.normalizeStyle)(V.value),role:`separator`,"aria-orientation":n.direction===`horizontal`?`vertical`:`horizontal`,"aria-valuenow":(0,r.unref)(m),"aria-valuemin":(0,r.unref)(O)?0:(0,r.unref)(h).min,"aria-valuemax":(0,r.unref)(k)?100:(0,r.unref)(h).max,"aria-disabled":n.disabled||void 0,"aria-controls":d,"aria-label":n.ariaLabel??(0,r.unref)(s)(`split.resize`),tabindex:n.disabled?-1:0,onPointerdown:t[6]||=(...e)=>(0,r.unref)(A)&&(0,r.unref)(A)(...e),onDblclick:t[7]||=(...e)=>(0,r.unref)(j)&&(0,r.unref)(j)(...e),onKeydown:t[8]||=(...e)=>(0,r.unref)(M)&&(0,r.unref)(M)(...e)},[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`split-gutter__controls`,{"split-gutter__controls--with-collapse":n.showCollapseButton&&n.collapsible}])},[n.showCollapseButton&&n.collapsible?((0,r.openBlock)(),(0,r.createElementBlock)(`button`,{key:0,class:`split-gutter__collapse-btn split-gutter__collapse-btn--first`,type:`button`,disabled:n.disabled,"aria-label":(0,r.unref)(O)?(0,r.unref)(s)(`split.expandFirst`):(0,r.unref)(s)(`split.collapseFirst`),"aria-expanded":!(0,r.unref)(O),"aria-controls":d,title:(0,r.unref)(O)?(0,r.unref)(s)(`split.expandFirst`):(0,r.unref)(s)(`split.collapseFirst`),onClick:t[0]||=(0,r.withModifiers)(e=>(0,r.unref)(F)(`first`),[`stop`]),onPointerdown:t[1]||=(0,r.withModifiers)(()=>{},[`stop`]),onDblclick:t[2]||=(0,r.withModifiers)(()=>{},[`stop`])},[...t[9]||=[(0,r.createElementVNode)(`svg`,{class:`split-gutter__chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,focusable:`false`},[(0,r.createElementVNode)(`path`,{d:`m9.5 4.5-3.5 3.5 3.5 3.5`})],-1)]],40,x)):(0,r.createCommentVNode)(`v-if`,!0),(0,r.createElementVNode)(`div`,S,[(0,r.createElementVNode)(`div`,C,[((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(3,e=>(0,r.createElementVNode)(`span`,{key:e,class:`split-gutter__dot`})),64))])]),n.showCollapseButton&&n.collapsible?((0,r.openBlock)(),(0,r.createElementBlock)(`button`,{key:1,class:`split-gutter__collapse-btn split-gutter__collapse-btn--second`,type:`button`,disabled:n.disabled,"aria-label":(0,r.unref)(k)?(0,r.unref)(s)(`split.expandSecond`):(0,r.unref)(s)(`split.collapseSecond`),"aria-expanded":!(0,r.unref)(k),"aria-controls":f,title:(0,r.unref)(k)?(0,r.unref)(s)(`split.expandSecond`):(0,r.unref)(s)(`split.collapseSecond`),onClick:t[3]||=(0,r.withModifiers)(e=>(0,r.unref)(F)(`second`),[`stop`]),onPointerdown:t[4]||=(0,r.withModifiers)(()=>{},[`stop`]),onDblclick:t[5]||=(0,r.withModifiers)(()=>{},[`stop`])},[...t[10]||=[(0,r.createElementVNode)(`svg`,{class:`split-gutter__chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,focusable:`false`},[(0,r.createElementVNode)(`path`,{d:`m9.5 4.5-3.5 3.5 3.5 3.5`})],-1)]],40,w)):(0,r.createCommentVNode)(`v-if`,!0)],2)],44,b),(0,r.createCommentVNode)(` 第二面板 `),(0,r.createElementVNode)(`div`,{class:`split-panel split-panel--second`,id:f,style:(0,r.normalizeStyle)(B.value),"aria-hidden":(0,r.unref)(k)||void 0,inert:(0,r.unref)(k)},[(0,r.createElementVNode)(`div`,E,[(0,r.renderSlot)(e.$slots,`second`,{size:100-(0,r.unref)(m),collapsed:(0,r.unref)(k)},void 0,!0)])],12,T)],6))}});var O=n.t(D,[[`__scopeId`,`data-v-8dec0887`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return O}});
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./useComponentLocale.cjs`),t=require(`./useComponentTheme.cjs`),n=require(`./export-helper.cjs`);let r=require(`vue`);const i=(e,t)=>typeof e==`number`&&Number.isFinite(e)?e:t,a=e=>Math.max(4,i(e,6));function o(e){let t=Math.max(0,Math.min(100,i(e.minSize,0))),n=Math.max(0,Math.min(100,i(e.maxSize,100))),r=Math.min(t,n),a=Math.max(t,n),o=Math.max(0,i(e.availableLength,0));if(!o)return{min:r,max:a};let s=Math.max(0,i(e.minFirstSize,0)),c=Math.max(0,i(e.minSecondSize,0)),l=Math.max(r,s/o*100),u=Math.min(a,100-c/o*100);if(l<=u)return{min:l,max:u};let d=s+c?s/(s+c)*100:50,f=Math.max(r,Math.min(a,d));return{min:f,max:f}}function s(e,t,n){return Math.min(n,Math.max(t,i(e,50)))}const c=new WeakMap;function l(e,t){let{style:n}=e.body,r=t===`horizontal`?`col-resize`:`row-resize`,i=[`cursor`,`user-select`].map(e=>({name:e,value:n.getPropertyValue(e),priority:n.getPropertyPriority(e),owned:e===`cursor`?r:`none`}));for(let e of i)n.setProperty(e.name,e.owned);return()=>{for(let e of i)n.getPropertyValue(e.name)===e.owned&&(e.value?n.setProperty(e.name,e.value,e.priority):n.removeProperty(e.name))}}function u(e,t){let n=e.currentTarget,r=n.ownerDocument,i=r.defaultView;if(!i)return;let a=i,o=t.direction===`horizontal`?`clientX`:`clientY`,s=e[o],u=e.pointerId,d=!0,f=!1,p=0,m,h,g;c.get(r)?.(),e.preventDefault(),e.stopPropagation(),n.focus({preventScroll:!0});function _(e){p=e[o]-s,!f&&Math.abs(p)>=3&&(f=!0,g=l(r,t.direction),t.onStart())}function v(e){e.pointerId===u&&(_(e),!(!f||!d)&&(e.cancelable&&e.preventDefault(),h===void 0&&(h=a.requestAnimationFrame(()=>{h=void 0,m=p,t.onDelta(p)}))))}function y(e){d&&(d=!1,h!==void 0&&a.cancelAnimationFrame(h),g?.(),r.removeEventListener(`pointermove`,v,!0),r.removeEventListener(`pointerup`,b,!0),r.removeEventListener(`pointercancel`,b,!0),r.removeEventListener(`visibilitychange`,S),a.removeEventListener(`blur`,x),c.get(r)===x&&c.delete(r),e&&f&&p!==m&&t.onDelta(p),t.onEnd(f))}function b(e){if(!d||e.pointerId!==u)return;let t=e.type===`pointerup`;t&&_(e),y(t)}let x=()=>y(!1),S=()=>{r.hidden&&x()};return r.addEventListener(`pointermove`,v,{capture:!0,passive:!1}),r.addEventListener(`pointerup`,b,!0),r.addEventListener(`pointercancel`,b,!0),r.addEventListener(`visibilitychange`,S),a.addEventListener(`blur`,x),c.set(r,x),x}function d(e,t,n,r,i){if(e===`Home`)return i.min;if(e===`End`)return i.max;let a=t===`horizontal`?`ArrowLeft`:`ArrowUp`,o=t===`horizontal`?`ArrowRight`:`ArrowDown`;if(e===a)return r-n;if(e===o)return r+n}function f(e){let{containerRef:t,direction:n,disabled:c,collapsible:l}=e,f=(0,r.ref)(0),p=(0,r.computed)(()=>a((0,r.toValue)(e.gutterSize))),m=(0,r.computed)(()=>Math.max(0,f.value-p.value)),h=(0,r.computed)(()=>o({minSize:(0,r.toValue)(e.minSize),maxSize:(0,r.toValue)(e.maxSize),minFirstSize:(0,r.toValue)(e.minFirstSize)??0,minSecondSize:(0,r.toValue)(e.minSecondSize)??0,availableLength:m.value})),g=(0,r.ref)(s((0,r.toValue)(e.defaultSize),h.value.min,h.value.max)),_=(0,r.computed)(()=>(0,r.toValue)(e.size)!==void 0),v=(0,r.computed)(()=>_.value?i((0,r.toValue)(e.size),50):g.value),y=(0,r.computed)(()=>l.value?v.value===0?`first`:v.value===100?`second`:null:null),b=(0,r.computed)(()=>y.value?y.value===`first`?0:100:s(v.value,h.value.min,h.value.max)),x=(0,r.ref)(!1),S=(0,r.computed)(()=>y.value===`first`),C=(0,r.computed)(()=>y.value===`second`),w=b.value,T=i((0,r.toValue)(e.defaultSize),50),E=w>0&&w<100?w:s(T>0&&T<100?T:50,h.value.min,h.value.max),D,O=!1,k=!1,A,j=t=>{t!==v.value&&(_.value||(g.value=t),e.onUpdateSize?.(t))},M=(e,t=!1)=>{Number.isFinite(e)&&j(t?e:s(e,h.value.min,h.value.max))};(0,r.watch)([b,y],([t,n],[r,i])=>{t>0&&t<100&&(E=t),i!==n&&(i&&e.onExpand?.(i),n&&e.onCollapse?.(n)),t!==r&&e.onResize?.(t,100-t)},{flush:`sync`}),(0,r.watch)(h,()=>{y.value||M(b.value)},{flush:`sync`}),(0,r.watch)([c,n],()=>D?.(),{flush:`sync`}),(0,r.watch)(l,()=>{y.value||M(b.value)},{flush:`sync`});let N=()=>{let e=t.value;if(!e)return;let r=e.getBoundingClientRect();f.value=n.value===`horizontal`?r.width:r.height};(0,r.watch)(n,N,{flush:`post`}),(0,r.onMounted)(()=>{N(),typeof ResizeObserver<`u`&&t.value&&(A=new ResizeObserver(N),A.observe(t.value))});let P=(e=`first`)=>{!l.value||y.value===e||M(e===`first`?0:100,!0)},F=()=>{y.value&&M(E)},I=(e=`first`)=>{y.value===e?F():P(e)},L=()=>M(i((0,r.toValue)(e.defaultSize),50)),R=e=>M(e),z=t=>{if(c.value||D||t.button!==0||!t.isPrimary||(N(),!m.value))return;O=k,k=!1;let i=b.value,a;D=u(t,{direction:n.value,onStart:()=>{k=!0,x.value=!0,e.onDragStart?.(i)},onDelta:e=>{let t=m.value;if(!t)return;let{min:n,max:r}=h.value,o=s(i+e/t*100,n,r);o!==a&&(a=o,j(o))},onEnd:t=>{if(x.value=!1,D=void 0,!t)return;let n=()=>e.onDragEnd?.(b.value);_.value?(0,r.nextTick)(n):n()}})},B=()=>{y.value?F():P(`first`)};return(0,r.onDeactivated)(()=>D?.()),(0,r.onUnmounted)(()=>{D?.(),A?.disconnect()}),{panelSize:b,isDragging:x,collapsedTarget:y,isFirstCollapsed:S,isSecondCollapsed:C,bounds:h,gutterSize:p,handlePointerDown:z,handleDoubleClick:()=>{!c.value&&!O&&!k&&B()},handleKeyDown:t=>{if(c.value||t.target!==t.currentTarget)return;if(t.key===`Enter`){l.value&&(t.preventDefault(),B());return}let a=Math.max(0,i((0,r.toValue)(e.step),2))||2,o=t.shiftKey?10:1,s=d(t.key,n.value,a*o,b.value,h.value);s!==void 0&&(t.preventDefault(),M(s))},collapse:P,expand:F,toggle:I,resetSize:L,setSize:R,getPanelInfo:()=>({first:{size:b.value,collapsed:S.value},second:{size:100-b.value,collapsed:C.value}})}}const p=[`aria-hidden`,`inert`],m={class:`split-panel__content`},h=[`aria-orientation`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`,`aria-disabled`,`aria-label`,`tabindex`],g=[`disabled`,`aria-label`,`aria-expanded`,`title`],_={class:`split-gutter__visual`,"aria-hidden":`true`},v={class:`split-gutter__dots`},y=[`disabled`,`aria-label`,`aria-expanded`,`title`],b=[`aria-hidden`,`inert`],x={class:`split-panel__content`},S=(0,r.defineComponent)({name:`C_SplitPane`,__name:`index`,props:{ariaLabel:{},direction:{default:`horizontal`},size:{},defaultSize:{default:50},minSize:{default:0},maxSize:{default:100},minFirstSize:{default:0},minSecondSize:{default:0},disabled:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},gutterSize:{default:6},step:{default:2}},emits:[`update:size`,`resize`,`collapse`,`expand`,`drag-start`,`drag-end`],setup(n,{expose:i,emit:a}){let o=t.n(),{t:s}=e.t(),c=n,l=a,u=(0,r.useId)(),d=`split-${u}-first`,S=`split-${u}-second`,C=(0,r.ref)(null),{panelSize:w,bounds:T,gutterSize:E,isDragging:D,isFirstCollapsed:O,isSecondCollapsed:k,handlePointerDown:A,handleDoubleClick:j,handleKeyDown:M,collapse:N,expand:P,toggle:F,resetSize:I,setSize:L,getPanelInfo:R}=f({containerRef:C,direction:(0,r.toRef)(c,`direction`),size:(0,r.toRef)(c,`size`),defaultSize:(0,r.toRef)(c,`defaultSize`),minSize:(0,r.toRef)(c,`minSize`),maxSize:(0,r.toRef)(c,`maxSize`),minFirstSize:(0,r.toRef)(c,`minFirstSize`),minSecondSize:(0,r.toRef)(c,`minSecondSize`),gutterSize:(0,r.toRef)(c,`gutterSize`),disabled:(0,r.toRef)(c,`disabled`),collapsible:(0,r.toRef)(c,`collapsible`),step:(0,r.toRef)(c,`step`),onUpdateSize:e=>l(`update:size`,e),onResize:(e,t)=>l(`resize`,e,t),onCollapse:e=>l(`collapse`,e),onExpand:e=>l(`expand`,e),onDragStart:e=>l(`drag-start`,e),onDragEnd:e=>l(`drag-end`,e)}),z=(0,r.computed)(()=>({flex:`${w.value} 1 0px`})),B=(0,r.computed)(()=>({flex:`${100-w.value} 1 0px`})),V=(0,r.computed)(()=>c.direction===`horizontal`?{width:`${E.value}px`}:{height:`${E.value}px`});return i({collapse:N,expand:P,toggle:F,resetSize:I,getPanelInfo:R,setSize:L}),(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref_key:`containerRef`,ref:C,class:(0,r.normalizeClass)([`c-split-pane`,[`c-split-pane--${n.direction}`,{"c-split-pane--dragging":(0,r.unref)(D),"c-split-pane--disabled":n.disabled,"c-split-pane--collapsed-first":(0,r.unref)(O),"c-split-pane--collapsed-second":(0,r.unref)(k)}]]),style:(0,r.normalizeStyle)((0,r.unref)(o))},[(0,r.createCommentVNode)(` 首面板 `),(0,r.createElementVNode)(`div`,{class:`split-panel split-panel--first`,id:d,style:(0,r.normalizeStyle)(z.value),"aria-hidden":(0,r.unref)(O)||void 0,inert:(0,r.unref)(O)},[(0,r.createElementVNode)(`div`,m,[(0,r.renderSlot)(e.$slots,`first`,{size:(0,r.unref)(w),collapsed:(0,r.unref)(O)},void 0,!0)])],12,p),(0,r.createCommentVNode)(` 分割线手柄 `),(0,r.createElementVNode)(`div`,{class:`split-gutter`,style:(0,r.normalizeStyle)(V.value),role:`separator`,"aria-orientation":n.direction===`horizontal`?`vertical`:`horizontal`,"aria-valuenow":(0,r.unref)(w),"aria-valuemin":(0,r.unref)(O)?0:(0,r.unref)(T).min,"aria-valuemax":(0,r.unref)(k)?100:(0,r.unref)(T).max,"aria-disabled":n.disabled||void 0,"aria-controls":d,"aria-label":n.ariaLabel??(0,r.unref)(s)(`split.resize`),tabindex:n.disabled?-1:0,onPointerdown:t[6]||=(...e)=>(0,r.unref)(A)&&(0,r.unref)(A)(...e),onDblclick:t[7]||=(...e)=>(0,r.unref)(j)&&(0,r.unref)(j)(...e),onKeydown:t[8]||=(...e)=>(0,r.unref)(M)&&(0,r.unref)(M)(...e)},[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`split-gutter__controls`,{"split-gutter__controls--with-collapse":n.showCollapseButton&&n.collapsible}])},[n.showCollapseButton&&n.collapsible?((0,r.openBlock)(),(0,r.createElementBlock)(`button`,{key:0,class:`split-gutter__collapse-btn split-gutter__collapse-btn--first`,type:`button`,disabled:n.disabled,"aria-label":(0,r.unref)(O)?(0,r.unref)(s)(`split.expandFirst`):(0,r.unref)(s)(`split.collapseFirst`),"aria-expanded":!(0,r.unref)(O),"aria-controls":d,title:(0,r.unref)(O)?(0,r.unref)(s)(`split.expandFirst`):(0,r.unref)(s)(`split.collapseFirst`),onClick:t[0]||=(0,r.withModifiers)(e=>(0,r.unref)(F)(`first`),[`stop`]),onPointerdown:t[1]||=(0,r.withModifiers)(()=>{},[`stop`]),onDblclick:t[2]||=(0,r.withModifiers)(()=>{},[`stop`])},[...t[9]||=[(0,r.createElementVNode)(`svg`,{class:`split-gutter__chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,focusable:`false`},[(0,r.createElementVNode)(`path`,{d:`m9.5 4.5-3.5 3.5 3.5 3.5`})],-1)]],40,g)):(0,r.createCommentVNode)(`v-if`,!0),(0,r.createElementVNode)(`div`,_,[(0,r.createElementVNode)(`div`,v,[((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(3,e=>(0,r.createElementVNode)(`span`,{key:e,class:`split-gutter__dot`})),64))])]),n.showCollapseButton&&n.collapsible?((0,r.openBlock)(),(0,r.createElementBlock)(`button`,{key:1,class:`split-gutter__collapse-btn split-gutter__collapse-btn--second`,type:`button`,disabled:n.disabled,"aria-label":(0,r.unref)(k)?(0,r.unref)(s)(`split.expandSecond`):(0,r.unref)(s)(`split.collapseSecond`),"aria-expanded":!(0,r.unref)(k),"aria-controls":S,title:(0,r.unref)(k)?(0,r.unref)(s)(`split.expandSecond`):(0,r.unref)(s)(`split.collapseSecond`),onClick:t[3]||=(0,r.withModifiers)(e=>(0,r.unref)(F)(`second`),[`stop`]),onPointerdown:t[4]||=(0,r.withModifiers)(()=>{},[`stop`]),onDblclick:t[5]||=(0,r.withModifiers)(()=>{},[`stop`])},[...t[10]||=[(0,r.createElementVNode)(`svg`,{class:`split-gutter__chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,focusable:`false`},[(0,r.createElementVNode)(`path`,{d:`m9.5 4.5-3.5 3.5 3.5 3.5`})],-1)]],40,y)):(0,r.createCommentVNode)(`v-if`,!0)],2)],44,h),(0,r.createCommentVNode)(` 第二面板 `),(0,r.createElementVNode)(`div`,{class:`split-panel split-panel--second`,id:S,style:(0,r.normalizeStyle)(B.value),"aria-hidden":(0,r.unref)(k)||void 0,inert:(0,r.unref)(k)},[(0,r.createElementVNode)(`div`,x,[(0,r.renderSlot)(e.$slots,`second`,{size:100-(0,r.unref)(w),collapsed:(0,r.unref)(k)},void 0,!0)])],12,b)],6))}});var C=n.t(S,[[`__scopeId`,`data-v-6f1b8596`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return C}});
|
package/dist/C_SplitPane2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./useComponentLocale.js";import{n as t}from"./useComponentTheme.js";import{t as n}from"./export-helper.js";import{Fragment as r,computed as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,defineComponent as c,normalizeClass as l,normalizeStyle as u,onDeactivated as d,onMounted as f,onUnmounted as p,openBlock as m,ref as h,renderList as g,renderSlot as _,toRef as v,toValue as y,unref as b,useId as x,watch as S,withModifiers as C}from"vue";const w=(e,t)=>typeof e==`number`&&Number.isFinite(e)?e:t,T=e=>Math.max(4,w(e,6));function E(e){let t=Math.max(0,Math.min(100,w(e.minSize,0))),n=Math.max(0,Math.min(100,w(e.maxSize,100))),r=Math.min(t,n),i=Math.max(t,n),a=Math.max(0,w(e.availableLength,0));if(!a)return{min:r,max:i};let o=Math.max(0,w(e.minFirstSize,0)),s=Math.max(0,w(e.minSecondSize,0)),c=Math.max(r,o/a*100),l=Math.min(i,100-s/a*100);if(c<=l)return{min:c,max:l};let u=o+s?o/(o+s)*100:50,d=Math.max(r,Math.min(i,u));return{min:d,max:d}}function D(e,t,n){return Math.min(n,Math.max(t,w(e,50)))}const O=new WeakMap;function k(e){return`button`in e&&e.button!==0?!1:!(`isPrimary`in e)||e.isPrimary}function A(e,t,n){if(!(`touches`in e))return t===`horizontal`?e.clientX:e.clientY;let r=n===void 0?e.touches[0]:Array.from(e.touches).find(e=>e.identifier===n);if(r)return t===`horizontal`?r.clientX:r.clientY}function j(e,t){return t===void 0||!(`pointerId`in e)?!0:e.pointerId===t}function M(e,t){let{style:n}=e.body,r=t===`horizontal`?`col-resize`:`row-resize`,i=[`cursor`,`user-select`].map(e=>({name:e,value:n.getPropertyValue(e),priority:n.getPropertyPriority(e),owned:e===`cursor`?r:`none`}));for(let e of i)n.setProperty(e.name,e.owned);return()=>{for(let e of i)n.getPropertyValue(e.name)===e.owned&&(e.value?n.setProperty(e.name,e.value,e.priority):n.removeProperty(e.name))}}function N(e){return`pointerId`in e?{move:[`pointermove`],end:[`pointerup`,`pointercancel`]}:`touches`in e?{move:[`touchmove`],end:[`touchend`,`touchcancel`]}:{move:[`mousemove`],end:[`mouseup`]}}function P(e,t){let n=A(e,t.direction);if(n===void 0)return;let r=t.element.ownerDocument,i=r.defaultView;O.get(r)?.();let a=M(r,t.direction),o=`pointerId`in e?e.pointerId:void 0,s=`touches`in e?e.touches[0]?.identifier:void 0,c=!0;e.preventDefault(),e.stopPropagation(),e.currentTarget?.focus({preventScroll:!0});let l=e=>{if(!j(e,o))return;let r=A(e,t.direction,s);r!==void 0&&(e.cancelable&&e.preventDefault(),t.onDelta(r-n))},u=e=>{if(!(e&&!j(e,o))&&c){c=!1,a();for(let[e,t]of p)r.removeEventListener(e,t);i?.removeEventListener(`blur`,u),O.get(r)===u&&O.delete(r),t.onEnd()}},d=()=>{r.hidden&&u()},f=N(e),p=[...f.move.map(e=>[e,l]),...f.end.map(e=>[e,u]),[`visibilitychange`,d]];for(let[e,t]of p)r.addEventListener(e,t,{passive:!1});return i?.addEventListener(`blur`,u),O.set(r,u),u}function F(e){return e===0?`first`:e===100?`second`:null}function I(e,t,n,r,i){if(e===`Home`)return i.min;if(e===`End`)return i.max;let a=t===`horizontal`?`ArrowLeft`:`ArrowUp`,o=t===`horizontal`?`ArrowRight`:`ArrowDown`;if(e===a)return r-n;if(e===o)return r+n}function L(e){let{containerRef:t,direction:n,disabled:r,collapsible:a}=e,o=h(0),s=i(()=>T(y(e.gutterSize))),c=i(()=>Math.max(0,o.value-s.value)),l=i(()=>E({minSize:y(e.minSize),maxSize:y(e.maxSize),minFirstSize:y(e.minFirstSize)??0,minSecondSize:y(e.minSecondSize)??0,availableLength:c.value})),u=h(D(y(e.defaultSize),l.value.min,l.value.max)),m=i(()=>y(e.size)!==void 0),g=i(()=>m.value?w(y(e.size),50):u.value),_=i(()=>a.value?g.value===0?`first`:g.value===100?`second`:null:null),v=i(()=>_.value?_.value===`first`?0:100:D(g.value,l.value.min,l.value.max)),b=h(!1),x=i(()=>_.value===`first`),C=i(()=>_.value===`second`),O=w(y(e.defaultSize),50),A=_.value?D(O>0&&O<100?O:50,l.value.min,l.value.max):v.value,j,M,N=(t,n=!1)=>{if(!Number.isFinite(t))return;let r=n?t:D(t,l.value.min,l.value.max);r!==g.value&&(m.value||(u.value=r),e.onUpdateSize?.(r))};S(v,(t,n)=>{let r=F(n),i=_.value;!r&&i&&(A=n),r&&r!==i&&e.onExpand?.(r),i&&i!==r&&e.onCollapse?.(i),e.onResize?.(t,100-t)},{flush:`sync`}),S(l,()=>{_.value||N(v.value)},{flush:`sync`}),S([r,n],()=>j?.(),{flush:`sync`}),S(a,()=>{_.value||N(v.value)},{flush:`sync`});let L=()=>{let e=t.value;if(!e)return;let r=e.getBoundingClientRect();o.value=n.value===`horizontal`?r.width:r.height};S(n,L,{flush:`post`}),f(()=>{L(),typeof ResizeObserver<`u`&&t.value&&(M=new ResizeObserver(L),M.observe(t.value))});let R=(e=`first`)=>{!a.value||_.value===e||(_.value||(A=v.value),N(e===`first`?0:100,!0))},z=()=>{_.value&&N(A)},B=(e=`first`)=>{_.value===e?z():R(e)};return d(()=>j?.()),p(()=>{j?.(),M?.disconnect()}),{panelSize:v,isDragging:b,collapsedTarget:_,isFirstCollapsed:x,isSecondCollapsed:C,bounds:l,gutterSize:s,handleMouseDown:i=>{if(r.value||b.value||!k(i))return;let a=t.value;if(!a||(L(),!c.value))return;let o=v.value;j=P(i,{element:a,direction:n.value,onDelta:e=>N(o+e/c.value*100),onEnd:()=>{b.value=!1,j=void 0,e.onDragEnd?.(v.value)}}),j&&(b.value=!0,e.onDragStart?.(v.value))},handleDoubleClick:()=>{r.value||B(`first`)},handleKeyDown:t=>{if(r.value||t.target!==t.currentTarget)return;if(t.key===`Enter`){a.value&&(t.preventDefault(),_.value?z():R(`first`));return}let i=Math.max(0,w(y(e.step),2))||2,o=t.shiftKey?10:1,s=I(t.key,n.value,i*o,v.value,l.value);s!==void 0&&(t.preventDefault(),N(s))},collapse:R,expand:z,toggle:B,resetSize:()=>N(w(y(e.defaultSize),50)),setSize:e=>N(e),getPanelInfo:()=>({first:{size:v.value,collapsed:x.value},second:{size:100-v.value,collapsed:C.value}})}}const R=[`aria-hidden`,`inert`],z={class:`split-panel__content`},B=[`aria-orientation`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`,`aria-disabled`,`aria-label`,`tabindex`],V=[`disabled`,`aria-label`,`aria-expanded`,`title`],H={class:`split-gutter__visual`,"aria-hidden":`true`},U={class:`split-gutter__dots`},W=[`disabled`,`aria-label`,`aria-expanded`,`title`],G=[`aria-hidden`,`inert`],K={class:`split-panel__content`};var q=n(c({name:`C_SplitPane`,__name:`index`,props:{ariaLabel:{},direction:{default:`horizontal`},size:{},defaultSize:{default:50},minSize:{default:0},maxSize:{default:100},minFirstSize:{default:0},minSecondSize:{default:0},disabled:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},gutterSize:{default:6},step:{default:2}},emits:[`update:size`,`resize`,`collapse`,`expand`,`drag-start`,`drag-end`],setup(n,{expose:c,emit:d}){let f=t(),{t:p}=e(),y=n,S=d,w=x(),T=`split-${w}-first`,E=`split-${w}-second`,D=h(null),{panelSize:O,bounds:k,gutterSize:A,isDragging:j,isFirstCollapsed:M,isSecondCollapsed:N,handleMouseDown:P,handleDoubleClick:F,handleKeyDown:I,collapse:q,expand:J,toggle:Y,resetSize:X,setSize:Z,getPanelInfo:Q}=L({containerRef:D,direction:v(y,`direction`),size:v(y,`size`),defaultSize:v(y,`defaultSize`),minSize:v(y,`minSize`),maxSize:v(y,`maxSize`),minFirstSize:v(y,`minFirstSize`),minSecondSize:v(y,`minSecondSize`),gutterSize:v(y,`gutterSize`),disabled:v(y,`disabled`),collapsible:v(y,`collapsible`),step:v(y,`step`),onUpdateSize:e=>S(`update:size`,e),onResize:(e,t)=>S(`resize`,e,t),onCollapse:e=>S(`collapse`,e),onExpand:e=>S(`expand`,e),onDragStart:e=>S(`drag-start`,e),onDragEnd:e=>S(`drag-end`,e)}),$=i(()=>({flex:`${O.value} 1 0px`})),ee=i(()=>({flex:`${100-O.value} 1 0px`})),te=i(()=>y.direction===`horizontal`?{width:`${A.value}px`}:{height:`${A.value}px`});return c({collapse:q,expand:J,toggle:Y,resetSize:X,getPanelInfo:Q,setSize:Z}),(e,t)=>(m(),o(`div`,{ref_key:`containerRef`,ref:D,class:l([`c-split-pane`,[`c-split-pane--${n.direction}`,{"c-split-pane--dragging":b(j),"c-split-pane--disabled":n.disabled,"c-split-pane--collapsed-first":b(M),"c-split-pane--collapsed-second":b(N)}]]),style:u(b(f))},[a(` 首面板 `),s(`div`,{class:`split-panel split-panel--first`,id:T,style:u($.value),"aria-hidden":b(M)||void 0,inert:b(M)},[s(`div`,z,[_(e.$slots,`first`,{size:b(O),collapsed:b(M)},void 0,!0)])],12,R),a(` 分割线手柄 `),s(`div`,{class:`split-gutter`,style:u(te.value),role:`separator`,"aria-orientation":n.direction===`horizontal`?`vertical`:`horizontal`,"aria-valuenow":b(O),"aria-valuemin":b(M)?0:b(k).min,"aria-valuemax":b(N)?100:b(k).max,"aria-disabled":n.disabled||void 0,"aria-controls":T,"aria-label":n.ariaLabel??b(p)(`split.resize`),tabindex:n.disabled?-1:0,onPointerdown:t[6]||=(...e)=>b(P)&&b(P)(...e),onDblclick:t[7]||=(...e)=>b(F)&&b(F)(...e),onKeydown:t[8]||=(...e)=>b(I)&&b(I)(...e)},[s(`div`,{class:l([`split-gutter__controls`,{"split-gutter__controls--with-collapse":n.showCollapseButton&&n.collapsible}])},[n.showCollapseButton&&n.collapsible?(m(),o(`button`,{key:0,class:`split-gutter__collapse-btn split-gutter__collapse-btn--first`,type:`button`,disabled:n.disabled,"aria-label":b(M)?b(p)(`split.expandFirst`):b(p)(`split.collapseFirst`),"aria-expanded":!b(M),"aria-controls":T,title:b(M)?b(p)(`split.expandFirst`):b(p)(`split.collapseFirst`),onClick:t[0]||=C(e=>b(Y)(`first`),[`stop`]),onPointerdown:t[1]||=C(()=>{},[`stop`]),onDblclick:t[2]||=C(()=>{},[`stop`])},[...t[9]||=[s(`svg`,{class:`split-gutter__chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,focusable:`false`},[s(`path`,{d:`m9.5 4.5-3.5 3.5 3.5 3.5`})],-1)]],40,V)):a(`v-if`,!0),s(`div`,H,[s(`div`,U,[(m(),o(r,null,g(3,e=>s(`span`,{key:e,class:`split-gutter__dot`})),64))])]),n.showCollapseButton&&n.collapsible?(m(),o(`button`,{key:1,class:`split-gutter__collapse-btn split-gutter__collapse-btn--second`,type:`button`,disabled:n.disabled,"aria-label":b(N)?b(p)(`split.expandSecond`):b(p)(`split.collapseSecond`),"aria-expanded":!b(N),"aria-controls":E,title:b(N)?b(p)(`split.expandSecond`):b(p)(`split.collapseSecond`),onClick:t[3]||=C(e=>b(Y)(`second`),[`stop`]),onPointerdown:t[4]||=C(()=>{},[`stop`]),onDblclick:t[5]||=C(()=>{},[`stop`])},[...t[10]||=[s(`svg`,{class:`split-gutter__chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,focusable:`false`},[s(`path`,{d:`m9.5 4.5-3.5 3.5 3.5 3.5`})],-1)]],40,W)):a(`v-if`,!0)],2)],44,B),a(` 第二面板 `),s(`div`,{class:`split-panel split-panel--second`,id:E,style:u(ee.value),"aria-hidden":b(N)||void 0,inert:b(N)},[s(`div`,K,[_(e.$slots,`second`,{size:100-b(O),collapsed:b(N)},void 0,!0)])],12,G)],6))}}),[[`__scopeId`,`data-v-8dec0887`]]);export{L as n,q as t};
|
|
1
|
+
import{t as e}from"./useComponentLocale.js";import{n as t}from"./useComponentTheme.js";import{t as n}from"./export-helper.js";import{Fragment as r,computed as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,defineComponent as c,nextTick as l,normalizeClass as u,normalizeStyle as d,onDeactivated as f,onMounted as p,onUnmounted as m,openBlock as h,ref as g,renderList as _,renderSlot as v,toRef as y,toValue as b,unref as x,useId as S,watch as C,withModifiers as w}from"vue";const T=(e,t)=>typeof e==`number`&&Number.isFinite(e)?e:t,E=e=>Math.max(4,T(e,6));function D(e){let t=Math.max(0,Math.min(100,T(e.minSize,0))),n=Math.max(0,Math.min(100,T(e.maxSize,100))),r=Math.min(t,n),i=Math.max(t,n),a=Math.max(0,T(e.availableLength,0));if(!a)return{min:r,max:i};let o=Math.max(0,T(e.minFirstSize,0)),s=Math.max(0,T(e.minSecondSize,0)),c=Math.max(r,o/a*100),l=Math.min(i,100-s/a*100);if(c<=l)return{min:c,max:l};let u=o+s?o/(o+s)*100:50,d=Math.max(r,Math.min(i,u));return{min:d,max:d}}function O(e,t,n){return Math.min(n,Math.max(t,T(e,50)))}const k=new WeakMap;function A(e,t){let{style:n}=e.body,r=t===`horizontal`?`col-resize`:`row-resize`,i=[`cursor`,`user-select`].map(e=>({name:e,value:n.getPropertyValue(e),priority:n.getPropertyPriority(e),owned:e===`cursor`?r:`none`}));for(let e of i)n.setProperty(e.name,e.owned);return()=>{for(let e of i)n.getPropertyValue(e.name)===e.owned&&(e.value?n.setProperty(e.name,e.value,e.priority):n.removeProperty(e.name))}}function j(e,t){let n=e.currentTarget,r=n.ownerDocument,i=r.defaultView;if(!i)return;let a=i,o=t.direction===`horizontal`?`clientX`:`clientY`,s=e[o],c=e.pointerId,l=!0,u=!1,d=0,f,p,m;k.get(r)?.(),e.preventDefault(),e.stopPropagation(),n.focus({preventScroll:!0});function h(e){d=e[o]-s,!u&&Math.abs(d)>=3&&(u=!0,m=A(r,t.direction),t.onStart())}function g(e){e.pointerId===c&&(h(e),!(!u||!l)&&(e.cancelable&&e.preventDefault(),p===void 0&&(p=a.requestAnimationFrame(()=>{p=void 0,f=d,t.onDelta(d)}))))}function _(e){l&&(l=!1,p!==void 0&&a.cancelAnimationFrame(p),m?.(),r.removeEventListener(`pointermove`,g,!0),r.removeEventListener(`pointerup`,v,!0),r.removeEventListener(`pointercancel`,v,!0),r.removeEventListener(`visibilitychange`,b),a.removeEventListener(`blur`,y),k.get(r)===y&&k.delete(r),e&&u&&d!==f&&t.onDelta(d),t.onEnd(u))}function v(e){if(!l||e.pointerId!==c)return;let t=e.type===`pointerup`;t&&h(e),_(t)}let y=()=>_(!1),b=()=>{r.hidden&&y()};return r.addEventListener(`pointermove`,g,{capture:!0,passive:!1}),r.addEventListener(`pointerup`,v,!0),r.addEventListener(`pointercancel`,v,!0),r.addEventListener(`visibilitychange`,b),a.addEventListener(`blur`,y),k.set(r,y),y}function M(e,t,n,r,i){if(e===`Home`)return i.min;if(e===`End`)return i.max;let a=t===`horizontal`?`ArrowLeft`:`ArrowUp`,o=t===`horizontal`?`ArrowRight`:`ArrowDown`;if(e===a)return r-n;if(e===o)return r+n}function N(e){let{containerRef:t,direction:n,disabled:r,collapsible:a}=e,o=g(0),s=i(()=>E(b(e.gutterSize))),c=i(()=>Math.max(0,o.value-s.value)),u=i(()=>D({minSize:b(e.minSize),maxSize:b(e.maxSize),minFirstSize:b(e.minFirstSize)??0,minSecondSize:b(e.minSecondSize)??0,availableLength:c.value})),d=g(O(b(e.defaultSize),u.value.min,u.value.max)),h=i(()=>b(e.size)!==void 0),_=i(()=>h.value?T(b(e.size),50):d.value),v=i(()=>a.value?_.value===0?`first`:_.value===100?`second`:null:null),y=i(()=>v.value?v.value===`first`?0:100:O(_.value,u.value.min,u.value.max)),x=g(!1),S=i(()=>v.value===`first`),w=i(()=>v.value===`second`),k=y.value,A=T(b(e.defaultSize),50),N=k>0&&k<100?k:O(A>0&&A<100?A:50,u.value.min,u.value.max),P,F=!1,I=!1,L,R=t=>{t!==_.value&&(h.value||(d.value=t),e.onUpdateSize?.(t))},z=(e,t=!1)=>{Number.isFinite(e)&&R(t?e:O(e,u.value.min,u.value.max))};C([y,v],([t,n],[r,i])=>{t>0&&t<100&&(N=t),i!==n&&(i&&e.onExpand?.(i),n&&e.onCollapse?.(n)),t!==r&&e.onResize?.(t,100-t)},{flush:`sync`}),C(u,()=>{v.value||z(y.value)},{flush:`sync`}),C([r,n],()=>P?.(),{flush:`sync`}),C(a,()=>{v.value||z(y.value)},{flush:`sync`});let B=()=>{let e=t.value;if(!e)return;let r=e.getBoundingClientRect();o.value=n.value===`horizontal`?r.width:r.height};C(n,B,{flush:`post`}),p(()=>{B(),typeof ResizeObserver<`u`&&t.value&&(L=new ResizeObserver(B),L.observe(t.value))});let V=(e=`first`)=>{!a.value||v.value===e||z(e===`first`?0:100,!0)},H=()=>{v.value&&z(N)},U=(e=`first`)=>{v.value===e?H():V(e)},W=()=>z(T(b(e.defaultSize),50)),G=e=>z(e),K=t=>{if(r.value||P||t.button!==0||!t.isPrimary||(B(),!c.value))return;F=I,I=!1;let i=y.value,a;P=j(t,{direction:n.value,onStart:()=>{I=!0,x.value=!0,e.onDragStart?.(i)},onDelta:e=>{let t=c.value;if(!t)return;let{min:n,max:r}=u.value,o=O(i+e/t*100,n,r);o!==a&&(a=o,R(o))},onEnd:t=>{if(x.value=!1,P=void 0,!t)return;let n=()=>e.onDragEnd?.(y.value);h.value?l(n):n()}})},q=()=>{v.value?H():V(`first`)};return f(()=>P?.()),m(()=>{P?.(),L?.disconnect()}),{panelSize:y,isDragging:x,collapsedTarget:v,isFirstCollapsed:S,isSecondCollapsed:w,bounds:u,gutterSize:s,handlePointerDown:K,handleDoubleClick:()=>{!r.value&&!F&&!I&&q()},handleKeyDown:t=>{if(r.value||t.target!==t.currentTarget)return;if(t.key===`Enter`){a.value&&(t.preventDefault(),q());return}let i=Math.max(0,T(b(e.step),2))||2,o=t.shiftKey?10:1,s=M(t.key,n.value,i*o,y.value,u.value);s!==void 0&&(t.preventDefault(),z(s))},collapse:V,expand:H,toggle:U,resetSize:W,setSize:G,getPanelInfo:()=>({first:{size:y.value,collapsed:S.value},second:{size:100-y.value,collapsed:w.value}})}}const P=[`aria-hidden`,`inert`],F={class:`split-panel__content`},I=[`aria-orientation`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`,`aria-disabled`,`aria-label`,`tabindex`],L=[`disabled`,`aria-label`,`aria-expanded`,`title`],R={class:`split-gutter__visual`,"aria-hidden":`true`},z={class:`split-gutter__dots`},B=[`disabled`,`aria-label`,`aria-expanded`,`title`],V=[`aria-hidden`,`inert`],H={class:`split-panel__content`};var U=n(c({name:`C_SplitPane`,__name:`index`,props:{ariaLabel:{},direction:{default:`horizontal`},size:{},defaultSize:{default:50},minSize:{default:0},maxSize:{default:100},minFirstSize:{default:0},minSecondSize:{default:0},disabled:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},gutterSize:{default:6},step:{default:2}},emits:[`update:size`,`resize`,`collapse`,`expand`,`drag-start`,`drag-end`],setup(n,{expose:c,emit:l}){let f=t(),{t:p}=e(),m=n,b=l,C=S(),T=`split-${C}-first`,E=`split-${C}-second`,D=g(null),{panelSize:O,bounds:k,gutterSize:A,isDragging:j,isFirstCollapsed:M,isSecondCollapsed:U,handlePointerDown:W,handleDoubleClick:G,handleKeyDown:K,collapse:q,expand:J,toggle:Y,resetSize:X,setSize:Z,getPanelInfo:Q}=N({containerRef:D,direction:y(m,`direction`),size:y(m,`size`),defaultSize:y(m,`defaultSize`),minSize:y(m,`minSize`),maxSize:y(m,`maxSize`),minFirstSize:y(m,`minFirstSize`),minSecondSize:y(m,`minSecondSize`),gutterSize:y(m,`gutterSize`),disabled:y(m,`disabled`),collapsible:y(m,`collapsible`),step:y(m,`step`),onUpdateSize:e=>b(`update:size`,e),onResize:(e,t)=>b(`resize`,e,t),onCollapse:e=>b(`collapse`,e),onExpand:e=>b(`expand`,e),onDragStart:e=>b(`drag-start`,e),onDragEnd:e=>b(`drag-end`,e)}),$=i(()=>({flex:`${O.value} 1 0px`})),ee=i(()=>({flex:`${100-O.value} 1 0px`})),te=i(()=>m.direction===`horizontal`?{width:`${A.value}px`}:{height:`${A.value}px`});return c({collapse:q,expand:J,toggle:Y,resetSize:X,getPanelInfo:Q,setSize:Z}),(e,t)=>(h(),o(`div`,{ref_key:`containerRef`,ref:D,class:u([`c-split-pane`,[`c-split-pane--${n.direction}`,{"c-split-pane--dragging":x(j),"c-split-pane--disabled":n.disabled,"c-split-pane--collapsed-first":x(M),"c-split-pane--collapsed-second":x(U)}]]),style:d(x(f))},[a(` 首面板 `),s(`div`,{class:`split-panel split-panel--first`,id:T,style:d($.value),"aria-hidden":x(M)||void 0,inert:x(M)},[s(`div`,F,[v(e.$slots,`first`,{size:x(O),collapsed:x(M)},void 0,!0)])],12,P),a(` 分割线手柄 `),s(`div`,{class:`split-gutter`,style:d(te.value),role:`separator`,"aria-orientation":n.direction===`horizontal`?`vertical`:`horizontal`,"aria-valuenow":x(O),"aria-valuemin":x(M)?0:x(k).min,"aria-valuemax":x(U)?100:x(k).max,"aria-disabled":n.disabled||void 0,"aria-controls":T,"aria-label":n.ariaLabel??x(p)(`split.resize`),tabindex:n.disabled?-1:0,onPointerdown:t[6]||=(...e)=>x(W)&&x(W)(...e),onDblclick:t[7]||=(...e)=>x(G)&&x(G)(...e),onKeydown:t[8]||=(...e)=>x(K)&&x(K)(...e)},[s(`div`,{class:u([`split-gutter__controls`,{"split-gutter__controls--with-collapse":n.showCollapseButton&&n.collapsible}])},[n.showCollapseButton&&n.collapsible?(h(),o(`button`,{key:0,class:`split-gutter__collapse-btn split-gutter__collapse-btn--first`,type:`button`,disabled:n.disabled,"aria-label":x(M)?x(p)(`split.expandFirst`):x(p)(`split.collapseFirst`),"aria-expanded":!x(M),"aria-controls":T,title:x(M)?x(p)(`split.expandFirst`):x(p)(`split.collapseFirst`),onClick:t[0]||=w(e=>x(Y)(`first`),[`stop`]),onPointerdown:t[1]||=w(()=>{},[`stop`]),onDblclick:t[2]||=w(()=>{},[`stop`])},[...t[9]||=[s(`svg`,{class:`split-gutter__chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,focusable:`false`},[s(`path`,{d:`m9.5 4.5-3.5 3.5 3.5 3.5`})],-1)]],40,L)):a(`v-if`,!0),s(`div`,R,[s(`div`,z,[(h(),o(r,null,_(3,e=>s(`span`,{key:e,class:`split-gutter__dot`})),64))])]),n.showCollapseButton&&n.collapsible?(h(),o(`button`,{key:1,class:`split-gutter__collapse-btn split-gutter__collapse-btn--second`,type:`button`,disabled:n.disabled,"aria-label":x(U)?x(p)(`split.expandSecond`):x(p)(`split.collapseSecond`),"aria-expanded":!x(U),"aria-controls":E,title:x(U)?x(p)(`split.expandSecond`):x(p)(`split.collapseSecond`),onClick:t[3]||=w(e=>x(Y)(`second`),[`stop`]),onPointerdown:t[4]||=w(()=>{},[`stop`]),onDblclick:t[5]||=w(()=>{},[`stop`])},[...t[10]||=[s(`svg`,{class:`split-gutter__chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,focusable:`false`},[s(`path`,{d:`m9.5 4.5-3.5 3.5 3.5 3.5`})],-1)]],40,B)):a(`v-if`,!0)],2)],44,I),a(` 第二面板 `),s(`div`,{class:`split-panel split-panel--second`,id:E,style:d(ee.value),"aria-hidden":x(U)||void 0,inert:x(U)},[s(`div`,H,[v(e.$slots,`second`,{size:100-x(O),collapsed:x(U)},void 0,!0)])],12,V)],6))}}),[[`__scopeId`,`data-v-6f1b8596`]]);export{N as n,U as t};
|
package/dist/constants3.d.cts
CHANGED
|
@@ -4,25 +4,25 @@ import * as vue from "vue";
|
|
|
4
4
|
//#region src/components/C_NotificationCenter/index.vue.d.ts
|
|
5
5
|
type __VLS_Slots = NotificationCenterSlots;
|
|
6
6
|
declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, NotificationCenterExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
7
|
+
itemClick: (message: NotificationMessage) => any;
|
|
7
8
|
delete: (ids: string[]) => any;
|
|
9
|
+
navigate: (url: string) => any;
|
|
8
10
|
read: (ids: string[]) => any;
|
|
9
11
|
viewAll: () => any;
|
|
10
|
-
itemClick: (message: NotificationMessage) => any;
|
|
11
12
|
allRead: (category?: NotificationCategory | undefined) => any;
|
|
12
13
|
unreadChange: (count: number) => any;
|
|
13
14
|
wsStatusChange: (status: WSConnectionStatus) => any;
|
|
14
15
|
newMessage: (message: NotificationMessage) => any;
|
|
15
|
-
navigate: (url: string) => any;
|
|
16
16
|
}, string, vue.PublicProps, Readonly<NotificationCenterProps> & Readonly<{
|
|
17
|
+
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
17
18
|
onDelete?: ((ids: string[]) => any) | undefined;
|
|
19
|
+
onNavigate?: ((url: string) => any) | undefined;
|
|
18
20
|
onRead?: ((ids: string[]) => any) | undefined;
|
|
19
21
|
onViewAll?: (() => any) | undefined;
|
|
20
|
-
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
21
22
|
onAllRead?: ((category?: NotificationCategory | undefined) => any) | undefined;
|
|
22
23
|
onUnreadChange?: ((count: number) => any) | undefined;
|
|
23
24
|
onWsStatusChange?: ((status: WSConnectionStatus) => any) | undefined;
|
|
24
25
|
onNewMessage?: ((message: NotificationMessage) => any) | undefined;
|
|
25
|
-
onNavigate?: ((url: string) => any) | undefined;
|
|
26
26
|
}>, {
|
|
27
27
|
pageSize: number;
|
|
28
28
|
storageKey: string;
|
package/dist/constants3.d.ts
CHANGED
|
@@ -4,25 +4,25 @@ import * as vue from "vue";
|
|
|
4
4
|
//#region src/components/C_NotificationCenter/index.vue.d.ts
|
|
5
5
|
type __VLS_Slots = NotificationCenterSlots;
|
|
6
6
|
declare const __VLS_base: vue.DefineComponent<NotificationCenterProps, NotificationCenterExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
7
|
+
itemClick: (message: NotificationMessage) => any;
|
|
7
8
|
delete: (ids: string[]) => any;
|
|
9
|
+
navigate: (url: string) => any;
|
|
8
10
|
read: (ids: string[]) => any;
|
|
9
11
|
viewAll: () => any;
|
|
10
|
-
itemClick: (message: NotificationMessage) => any;
|
|
11
12
|
allRead: (category?: NotificationCategory | undefined) => any;
|
|
12
13
|
unreadChange: (count: number) => any;
|
|
13
14
|
wsStatusChange: (status: WSConnectionStatus) => any;
|
|
14
15
|
newMessage: (message: NotificationMessage) => any;
|
|
15
|
-
navigate: (url: string) => any;
|
|
16
16
|
}, string, vue.PublicProps, Readonly<NotificationCenterProps> & Readonly<{
|
|
17
|
+
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
17
18
|
onDelete?: ((ids: string[]) => any) | undefined;
|
|
19
|
+
onNavigate?: ((url: string) => any) | undefined;
|
|
18
20
|
onRead?: ((ids: string[]) => any) | undefined;
|
|
19
21
|
onViewAll?: (() => any) | undefined;
|
|
20
|
-
onItemClick?: ((message: NotificationMessage) => any) | undefined;
|
|
21
22
|
onAllRead?: ((category?: NotificationCategory | undefined) => any) | undefined;
|
|
22
23
|
onUnreadChange?: ((count: number) => any) | undefined;
|
|
23
24
|
onWsStatusChange?: ((status: WSConnectionStatus) => any) | undefined;
|
|
24
25
|
onNewMessage?: ((message: NotificationMessage) => any) | undefined;
|
|
25
|
-
onNavigate?: ((url: string) => any) | undefined;
|
|
26
26
|
}>, {
|
|
27
27
|
pageSize: number;
|
|
28
28
|
storageKey: string;
|
package/dist/constants4.d.cts
CHANGED
|
@@ -8,18 +8,18 @@ type __VLS_Slots = {} & {
|
|
|
8
8
|
area?: (props: typeof __VLS_11) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
11
|
+
success: (file: UploadFileItem, response: unknown) => any;
|
|
11
12
|
error: (file: UploadFileItem, error: Error) => any;
|
|
12
13
|
change: (fileList: UploadFileItem[]) => any;
|
|
13
14
|
progress: (file: UploadFileItem, percent: number) => any;
|
|
14
|
-
success: (file: UploadFileItem, response: unknown) => any;
|
|
15
15
|
remove: (file: UploadFileItem) => any;
|
|
16
16
|
finish: (fileList: UploadFileItem[]) => any;
|
|
17
17
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
18
18
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
19
|
+
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
19
20
|
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
20
21
|
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
21
22
|
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
22
|
-
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
23
23
|
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
24
24
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
25
25
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
@@ -28,12 +28,12 @@ declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {},
|
|
|
28
28
|
disabled: boolean;
|
|
29
29
|
multiple: boolean;
|
|
30
30
|
action: string;
|
|
31
|
+
draggable: boolean;
|
|
31
32
|
headers: Record<string, string>;
|
|
32
33
|
directory: boolean;
|
|
33
34
|
accept: string;
|
|
34
35
|
maxSize: number;
|
|
35
36
|
maxCount: number;
|
|
36
|
-
draggable: boolean;
|
|
37
37
|
pasteable: boolean;
|
|
38
38
|
chunked: boolean;
|
|
39
39
|
chunkSize: number;
|
package/dist/constants4.d.ts
CHANGED
|
@@ -9,18 +9,18 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
area?: (props: typeof __VLS_11) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
12
|
+
success: (file: UploadFileItem, response: unknown) => any;
|
|
12
13
|
error: (file: UploadFileItem, error: Error) => any;
|
|
13
14
|
change: (fileList: UploadFileItem[]) => any;
|
|
14
15
|
progress: (file: UploadFileItem, percent: number) => any;
|
|
15
|
-
success: (file: UploadFileItem, response: unknown) => any;
|
|
16
16
|
remove: (file: UploadFileItem) => any;
|
|
17
17
|
finish: (fileList: UploadFileItem[]) => any;
|
|
18
18
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
19
19
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
20
|
+
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
20
21
|
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
21
22
|
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
22
23
|
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
23
|
-
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
24
24
|
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
25
25
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
26
26
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
@@ -29,12 +29,12 @@ declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {},
|
|
|
29
29
|
disabled: boolean;
|
|
30
30
|
multiple: boolean;
|
|
31
31
|
action: string;
|
|
32
|
+
draggable: boolean;
|
|
32
33
|
headers: Record<string, string>;
|
|
33
34
|
directory: boolean;
|
|
34
35
|
accept: string;
|
|
35
36
|
maxSize: number;
|
|
36
37
|
maxCount: number;
|
|
37
|
-
draggable: boolean;
|
|
38
38
|
pasteable: boolean;
|
|
39
39
|
chunked: boolean;
|
|
40
40
|
chunkSize: number;
|