@robot-admin/naive-ui-components 0.40.2 → 0.40.4
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 +2 -2
- package/README_EN.md +17 -17
- package/dist/BPMN.cjs +1 -1
- package/dist/BPMN.js +1 -1
- package/dist/C_ActionBar.css +58 -52
- package/dist/C_ActionBar2.cjs +1 -1
- package/dist/C_ActionBar2.js +1 -1
- package/dist/C_AntV.css +108 -108
- package/dist/C_AvatarGroup.css +29 -29
- package/dist/C_AvatarGroup2.cjs +1 -1
- package/dist/C_AvatarGroup2.js +1 -1
- package/dist/C_Barcode.css +6 -6
- package/dist/C_Barcode.d.cts +2 -2
- package/dist/C_Barcode.d.ts +2 -2
- package/dist/C_Barcode2.cjs +1 -1
- package/dist/C_Barcode2.js +1 -1
- package/dist/C_Captcha.css +42 -42
- package/dist/C_Captcha2.cjs +1 -1
- package/dist/C_Captcha2.js +1 -1
- package/dist/C_Cascade.css +4 -4
- package/dist/C_Cascade.d.cts +2 -2
- package/dist/C_Cascade.d.ts +2 -2
- package/dist/C_Cascade2.cjs +1 -1
- package/dist/C_Cascade2.js +1 -1
- package/dist/C_City.css +35 -35
- package/dist/C_City2.cjs +1 -1
- package/dist/C_City2.js +1 -1
- package/dist/C_Code.css +27 -27
- package/dist/C_Code.d.cts +2 -2
- package/dist/C_Code.d.ts +2 -2
- package/dist/C_Code2.cjs +1 -1
- package/dist/C_Code2.js +1 -1
- package/dist/C_CollapsePanel2.cjs +1 -1
- package/dist/C_CollapsePanel2.js +1 -1
- package/dist/C_ContextMenu.css +10 -10
- package/dist/C_ContextMenu2.cjs +1 -1
- package/dist/C_ContextMenu2.js +1 -1
- package/dist/C_DataPicker.css +32 -32
- package/dist/C_DataPicker2.cjs +1 -1
- package/dist/C_DataPicker2.js +1 -1
- package/dist/C_Editor.css +13 -13
- package/dist/C_Editor.d.cts +2 -2
- package/dist/C_Editor.d.ts +2 -2
- package/dist/C_Editor2.cjs +1 -1
- package/dist/C_Editor2.js +1 -1
- package/dist/C_FilePreview.css +104 -104
- package/dist/C_FilePreview2.cjs +1 -1
- package/dist/C_FilePreview2.js +1 -1
- package/dist/C_FormModal.css +58 -52
- package/dist/C_FormSearch.css +72 -72
- package/dist/C_FullCalendar2.cjs +1 -1
- package/dist/C_FullCalendar2.js +1 -1
- package/dist/C_GlobalSearch.css +139 -136
- package/dist/C_GlobalSearch2.cjs +1 -1
- package/dist/C_GlobalSearch2.js +1 -1
- package/dist/C_Guide.css +3 -3
- package/dist/C_Guide2.cjs +1 -1
- package/dist/C_Guide2.js +1 -1
- package/dist/C_Language.css +2 -2
- package/dist/C_Language2.cjs +1 -1
- package/dist/C_Language2.js +1 -1
- package/dist/C_Login.css +136 -121
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.js +1 -1
- package/dist/C_Markdown.css +37 -37
- package/dist/C_Markdown.d.cts +2 -2
- package/dist/C_Markdown.d.ts +2 -2
- package/dist/C_Markdown2.cjs +1 -1
- package/dist/C_Markdown2.js +1 -1
- package/dist/C_NotificationCenter.css +51 -36
- package/dist/C_NotificationCenter2.cjs +1 -1
- package/dist/C_NotificationCenter2.js +1 -1
- package/dist/C_Progress.d.cts +2 -2
- package/dist/C_Progress.d.ts +2 -2
- package/dist/C_Progress2.cjs +1 -1
- package/dist/C_Progress2.js +1 -1
- package/dist/C_Signature.css +15 -15
- package/dist/C_Signature2.cjs +1 -1
- package/dist/C_Signature2.js +1 -1
- package/dist/C_Steps.css +39 -39
- package/dist/C_Steps.d.cts +2 -2
- package/dist/C_Steps.d.ts +2 -2
- package/dist/C_Steps2.cjs +1 -1
- package/dist/C_Steps2.js +1 -1
- package/dist/C_Table.base.css +58 -52
- package/dist/C_Table.css +58 -52
- package/dist/C_Table.d.ts +1 -0
- package/dist/C_Table2.cjs +2 -2
- package/dist/C_Table2.js +2 -2
- package/dist/C_TagsView.css +60 -50
- package/dist/C_TagsView2.cjs +1 -1
- package/dist/C_TagsView2.js +1 -1
- package/dist/C_Timeline.css +53 -53
- package/dist/C_Timeline2.cjs +1 -1
- package/dist/C_Timeline2.js +1 -1
- package/dist/C_Tree.d.ts +1 -0
- package/dist/C_Upload.css +80 -80
- package/dist/C_Upload2.cjs +1 -1
- package/dist/C_Upload2.js +1 -1
- package/dist/C_WaterFall.css +41 -41
- package/dist/C_WaterFall.d.cts +2 -2
- package/dist/C_WaterFall.d.ts +2 -2
- package/dist/C_WaterFall2.cjs +1 -1
- package/dist/C_WaterFall2.js +1 -1
- package/dist/C_WorkFlow.css +93 -92
- package/dist/C_WorkFlow2.cjs +1 -1
- package/dist/C_WorkFlow2.js +1 -1
- package/dist/ER.cjs +1 -1
- package/dist/ER.js +1 -1
- package/dist/UML.cjs +3 -3
- package/dist/UML.js +3 -3
- package/dist/component-config.d.ts +2 -0
- package/dist/constants.d.cts +3 -3
- package/dist/constants.d.ts +3 -3
- package/dist/constants2.d.cts +2 -2
- package/dist/constants2.d.ts +2 -2
- package/dist/constants3.d.cts +1 -1
- package/dist/constants3.d.ts +1 -1
- package/dist/constants4.d.cts +6 -6
- package/dist/constants4.d.ts +7 -6
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/context.d.cts +2 -0
- package/dist/data2.d.cts +10 -10
- package/dist/data2.d.ts +10 -10
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.cts +3 -3
- package/dist/editors.d.ts +3 -3
- package/dist/editors.js +1 -1
- package/dist/graphEditSession.cjs +1 -0
- package/dist/graphEditSession.js +1 -0
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.vue.d.cts +4 -4
- package/dist/index.vue.d.ts +4 -4
- package/dist/index10.vue.d.cts +2 -3
- package/dist/index10.vue.d.ts +10 -7
- package/dist/index11.vue.d.cts +10 -7
- package/dist/index11.vue.d.ts +4 -4
- package/dist/index12.vue.d.cts +4 -4
- package/dist/index13.vue.d.ts +16 -13
- package/dist/index14.vue.d.cts +16 -13
- package/dist/index16.vue.d.ts +6 -11
- package/dist/index17.vue.d.cts +6 -11
- package/dist/index17.vue.d.ts +6 -6
- package/dist/index18.vue.d.cts +6 -6
- package/dist/index18.vue.d.ts +4 -9
- package/dist/index19.vue.d.cts +4 -9
- package/dist/index20.vue.d.ts +1 -2
- package/dist/index21.vue.d.cts +1 -2
- package/dist/index21.vue.d.ts +19 -17
- package/dist/index22.vue.d.cts +19 -17
- package/dist/index24.vue.d.cts +9 -6
- package/dist/index24.vue.d.ts +9 -6
- package/dist/index27.vue.d.cts +3 -3
- package/dist/index27.vue.d.ts +3 -3
- package/dist/index28.vue.d.cts +12 -19
- package/dist/index28.vue.d.ts +12 -19
- package/dist/index3.vue.d.cts +3 -3
- package/dist/index3.vue.d.ts +3 -3
- package/dist/index30.vue.d.cts +3 -10
- package/dist/index30.vue.d.ts +3 -10
- package/dist/index31.vue.d.cts +5 -5
- package/dist/index31.vue.d.ts +5 -5
- package/dist/index32.vue.d.cts +4 -4
- package/dist/index32.vue.d.ts +4 -4
- package/dist/index4.vue.d.cts +12 -9
- package/dist/index4.vue.d.ts +12 -9
- package/dist/index7.vue.d.ts +14 -14
- package/dist/index8.vue.d.cts +14 -14
- package/dist/index8.vue.d.ts +1 -1
- package/dist/index9.vue.d.cts +1 -1
- package/dist/index9.vue.d.ts +2 -3
- package/dist/locale.cjs +1 -0
- package/dist/locale.js +1 -0
- package/dist/mapUtils.d.cts +4 -4
- package/dist/mapUtils.d.ts +4 -4
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/serializeSearch.cjs +1 -1
- package/dist/serializeSearch.js +1 -1
- package/dist/style.css +1250 -1200
- package/dist/types.d.cts +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/useCollapsePanel.d.cts +7 -7
- package/dist/useCollapsePanel.d.ts +7 -7
- package/dist/useComponentLocale.cjs +1 -1
- package/dist/useComponentLocale.js +1 -1
- package/dist/useCropperCore.d.cts +10 -10
- package/dist/useCropperCore.d.ts +10 -10
- package/dist/useDynamicFormState.d.cts +2 -2
- package/dist/useDynamicFormState.d.ts +2 -2
- package/dist/useEdgeInteraction.d.cts +1 -1
- package/dist/useEdgeInteraction.d.ts +1 -1
- package/dist/useFullscreen.d.cts +1 -1
- package/dist/useFullscreen.d.ts +1 -1
- package/dist/useGlobalSearch.d.cts +1 -5
- package/dist/useGlobalSearch.d.ts +1 -5
- package/dist/useInfiniteScroll.d.cts +42 -70
- package/dist/useInfiniteScroll.d.ts +42 -70
- package/dist/useQRCode.d.cts +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useScopedComponentLocale.cjs +1 -0
- package/dist/useScopedComponentLocale.js +1 -0
- package/dist/useSignatureHistory.d.cts +9 -4
- package/dist/useSignatureHistory.d.ts +9 -4
- package/dist/useSplitResize.d.cts +8 -8
- package/dist/useSplitResize.d.ts +8 -8
- package/dist/useWorkflowValidation.d.cts +39 -34
- package/dist/useWorkflowValidation.d.ts +39 -34
- package/dist/verification.d.cts +2 -2
- package/dist/verification.d.ts +2 -2
- package/docs/architecture.en.md +1 -1
- package/docs/architecture.md +1 -1
- package/docs/component-audit-closure-0.40.4.md +62 -0
- package/docs/engineering.en.md +3 -2
- package/docs/engineering.md +3 -2
- package/docs/guides/search-workflows.md +2 -0
- package/docs/guides/transfer.md +2 -0
- package/docs/guides/usage.en.md +15 -1
- package/docs/guides/usage.md +25 -2
- package/docs/guides/workflow.md +5 -1
- package/docs/stability-boundaries-0.40.3.md +38 -0
- package/package.json +1 -1
- package/dist/readonlyGraph.cjs +0 -1
- package/dist/readonlyGraph.js +0 -1
package/dist/C_TagsView.css
CHANGED
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
* 标签组件样式 - 精简版
|
|
82
82
|
* =========================================== */
|
|
83
83
|
/* --------- 标签视图容器 --------- */
|
|
84
|
-
.tags-view-container[data-v-
|
|
84
|
+
.tags-view-container[data-v-2c9ad3f6] {
|
|
85
85
|
border-bottom: 1px solid var(--c-border, var(--c-theme-border));
|
|
86
86
|
padding: 8px 16px 0;
|
|
87
87
|
position: relative;
|
|
@@ -90,14 +90,14 @@
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/* --------- 滚动轨道容器 --------- */
|
|
93
|
-
.tags-track[data-v-
|
|
93
|
+
.tags-track[data-v-2c9ad3f6] {
|
|
94
94
|
width: 100%;
|
|
95
95
|
overflow: hidden;
|
|
96
96
|
position: relative;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/* --------- 滚动容器 --------- */
|
|
100
|
-
.tags-container[data-v-
|
|
100
|
+
.tags-container[data-v-2c9ad3f6] {
|
|
101
101
|
display: flex;
|
|
102
102
|
overflow-x: auto;
|
|
103
103
|
overflow-y: hidden;
|
|
@@ -107,12 +107,12 @@
|
|
|
107
107
|
align-items: center;
|
|
108
108
|
min-height: 40px;
|
|
109
109
|
}
|
|
110
|
-
.tags-container[data-v-
|
|
110
|
+
.tags-container[data-v-2c9ad3f6]::-webkit-scrollbar {
|
|
111
111
|
display: none;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
/* --------- 现代化标签样式 --------- */
|
|
115
|
-
.n-tag[data-v-
|
|
115
|
+
.n-tag[data-v-2c9ad3f6] {
|
|
116
116
|
position: relative;
|
|
117
117
|
display: inline-flex;
|
|
118
118
|
align-items: center;
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
white-space: nowrap;
|
|
130
130
|
/* 内部高光效果 */
|
|
131
131
|
}
|
|
132
|
-
.n-tag[data-v-
|
|
132
|
+
.n-tag[data-v-2c9ad3f6]::before {
|
|
133
133
|
content: "";
|
|
134
134
|
position: absolute;
|
|
135
135
|
top: 1px;
|
|
@@ -141,65 +141,65 @@
|
|
|
141
141
|
opacity: 0.5;
|
|
142
142
|
transition: opacity 0.22s ease;
|
|
143
143
|
}
|
|
144
|
-
.n-tag[data-v-
|
|
144
|
+
.n-tag[data-v-2c9ad3f6] {
|
|
145
145
|
/* --------- 悬停效果 --------- */
|
|
146
146
|
}
|
|
147
|
-
.n-tag[data-v-
|
|
147
|
+
.n-tag[data-v-2c9ad3f6]:hover:not(.is-active) {
|
|
148
148
|
color: var(--c-primary, var(--c-theme-primary)) !important;
|
|
149
149
|
border-color: var(--c-primary, var(--c-theme-primary));
|
|
150
150
|
transform: scale(1.02);
|
|
151
151
|
}
|
|
152
|
-
.n-tag[data-v-
|
|
152
|
+
.n-tag[data-v-2c9ad3f6]:hover:not(.is-active)::before {
|
|
153
153
|
opacity: 0.8;
|
|
154
154
|
}
|
|
155
|
-
.n-tag[data-v-
|
|
156
|
-
.n-tag[data-v-
|
|
155
|
+
.n-tag[data-v-2c9ad3f6]:hover:not(.is-active) .c-icon,
|
|
156
|
+
.n-tag[data-v-2c9ad3f6]:hover:not(.is-active) [class*='c-icon'] {
|
|
157
157
|
color: var(--c-primary, var(--c-theme-primary)) !important;
|
|
158
158
|
}
|
|
159
|
-
.n-tag:hover:not(.is-active) i[data-v-
|
|
160
|
-
.n-tag:hover:not(.is-active) .icon[data-v-
|
|
159
|
+
.n-tag:hover:not(.is-active) i[data-v-2c9ad3f6],
|
|
160
|
+
.n-tag:hover:not(.is-active) .icon[data-v-2c9ad3f6] {
|
|
161
161
|
color: var(--c-primary, var(--c-theme-primary)) !important;
|
|
162
162
|
}
|
|
163
|
-
.n-tag[data-v-
|
|
163
|
+
.n-tag[data-v-2c9ad3f6]:hover:not(.is-active) .n-tag__close {
|
|
164
164
|
color: var(--c-primary, var(--c-theme-primary)) !important;
|
|
165
165
|
opacity: 0.8;
|
|
166
166
|
}
|
|
167
|
-
.n-tag[data-v-
|
|
167
|
+
.n-tag[data-v-2c9ad3f6] {
|
|
168
168
|
/* --------- 激活状态 --------- */
|
|
169
169
|
}
|
|
170
|
-
.n-tag.is-active[data-v-
|
|
170
|
+
.n-tag.is-active[data-v-2c9ad3f6] {
|
|
171
171
|
background: var(--tag-active-bg, color-mix(in srgb, var(--c-primary, var(--c-theme-primary)) 8%, transparent)) !important;
|
|
172
172
|
color: var(--c-primary, var(--c-theme-primary)) !important;
|
|
173
173
|
border-color: var(--c-primary, var(--c-theme-primary)) !important;
|
|
174
174
|
font-weight: 600;
|
|
175
175
|
transform: scale(1.02);
|
|
176
176
|
}
|
|
177
|
-
.n-tag.is-active[data-v-
|
|
177
|
+
.n-tag.is-active[data-v-2c9ad3f6]::before {
|
|
178
178
|
opacity: 0.6;
|
|
179
179
|
}
|
|
180
|
-
.n-tag.is-active[data-v-
|
|
180
|
+
.n-tag.is-active[data-v-2c9ad3f6] .n-tag__content {
|
|
181
181
|
color: var(--c-primary, var(--c-theme-primary)) !important;
|
|
182
182
|
}
|
|
183
|
-
.n-tag.is-active[data-v-
|
|
184
|
-
.n-tag.is-active[data-v-
|
|
183
|
+
.n-tag.is-active[data-v-2c9ad3f6] .c-icon,
|
|
184
|
+
.n-tag.is-active[data-v-2c9ad3f6] [class*='c-icon'] {
|
|
185
185
|
color: var(--c-primary, var(--c-theme-primary)) !important;
|
|
186
186
|
}
|
|
187
|
-
.n-tag.is-active i[data-v-
|
|
188
|
-
.n-tag.is-active .icon[data-v-
|
|
187
|
+
.n-tag.is-active i[data-v-2c9ad3f6],
|
|
188
|
+
.n-tag.is-active .icon[data-v-2c9ad3f6] {
|
|
189
189
|
color: var(--c-primary, var(--c-theme-primary)) !important;
|
|
190
190
|
}
|
|
191
|
-
.n-tag.is-active[data-v-
|
|
191
|
+
.n-tag.is-active[data-v-2c9ad3f6]:hover {
|
|
192
192
|
background: var(--tag-active-hover-bg, color-mix(in srgb, var(--c-primary, var(--c-theme-primary)) 12%, transparent)) !important;
|
|
193
193
|
transform: scale(1.03);
|
|
194
194
|
}
|
|
195
|
-
.n-tag.is-active[data-v-
|
|
195
|
+
.n-tag.is-active[data-v-2c9ad3f6] .n-tag__close {
|
|
196
196
|
color: var(--c-primary, var(--c-theme-primary)) !important;
|
|
197
197
|
opacity: 0.8;
|
|
198
198
|
}
|
|
199
|
-
.n-tag[data-v-
|
|
199
|
+
.n-tag[data-v-2c9ad3f6] {
|
|
200
200
|
/* --------- 关闭按钮 --------- */
|
|
201
201
|
}
|
|
202
|
-
.n-tag[data-v-
|
|
202
|
+
.n-tag[data-v-2c9ad3f6] .n-tag__close {
|
|
203
203
|
width: 22px !important;
|
|
204
204
|
height: 22px !important;
|
|
205
205
|
border-radius: 8px !important;
|
|
@@ -214,19 +214,19 @@
|
|
|
214
214
|
background: transparent !important;
|
|
215
215
|
border: 1px solid transparent;
|
|
216
216
|
}
|
|
217
|
-
.n-tag[data-v-
|
|
217
|
+
.n-tag[data-v-2c9ad3f6] .n-tag__close:hover {
|
|
218
218
|
background: linear-gradient(135deg, color-mix(in srgb, var(--c-error, var(--c-theme-error)) 10%, transparent), color-mix(in srgb, var(--c-error, var(--c-theme-error)) 8%, transparent)) !important;
|
|
219
219
|
border-color: color-mix(in srgb, var(--c-error, var(--c-theme-error)) 15%, transparent) !important;
|
|
220
220
|
color: var(--c-error, var(--c-theme-error)) !important;
|
|
221
221
|
opacity: 1 !important;
|
|
222
222
|
box-shadow: 0 2px 6px color-mix(in srgb, var(--c-error, var(--c-theme-error)) 20%, transparent) !important;
|
|
223
223
|
}
|
|
224
|
-
.n-tag[data-v-
|
|
224
|
+
.n-tag[data-v-2c9ad3f6] .n-tag__close:active {
|
|
225
225
|
transition-duration: 0.1s !important;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
/* --------- C_Icon --------- */
|
|
229
|
-
[data-v-
|
|
229
|
+
[data-v-2c9ad3f6] .c-icon {
|
|
230
230
|
margin-right: 4px;
|
|
231
231
|
font-size: 12px;
|
|
232
232
|
transition: color 0.22s ease;
|
|
@@ -236,63 +236,73 @@
|
|
|
236
236
|
|
|
237
237
|
/* --------- 响应式 --------- */
|
|
238
238
|
@media (max-width: 768px) {
|
|
239
|
-
.tags-view-container[data-v-
|
|
239
|
+
.tags-view-container[data-v-2c9ad3f6] {
|
|
240
240
|
padding: 6px 12px 0;
|
|
241
241
|
}
|
|
242
|
-
.n-tag[data-v-
|
|
242
|
+
.n-tag[data-v-2c9ad3f6] {
|
|
243
243
|
height: 26px;
|
|
244
244
|
padding: 0 10px;
|
|
245
245
|
font-size: 11px;
|
|
246
246
|
margin-right: 3px;
|
|
247
247
|
border-radius: 13px;
|
|
248
248
|
}
|
|
249
|
-
.n-tag[data-v-
|
|
249
|
+
.n-tag[data-v-2c9ad3f6] .n-tag__close {
|
|
250
250
|
width: 22px;
|
|
251
251
|
height: 22px;
|
|
252
252
|
font-size: 11px;
|
|
253
253
|
margin-left: 4px;
|
|
254
254
|
}
|
|
255
|
-
.tags-container[data-v-
|
|
255
|
+
.tags-container[data-v-2c9ad3f6] {
|
|
256
256
|
padding: 0 12px;
|
|
257
257
|
min-height: 36px;
|
|
258
258
|
}
|
|
259
|
-
[data-v-
|
|
259
|
+
[data-v-2c9ad3f6] .c-icon {
|
|
260
260
|
font-size: 11px;
|
|
261
261
|
margin-right: 3px;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
@media (prefers-reduced-motion: reduce) {
|
|
265
|
-
.tags-view-container[data-v-
|
|
266
|
-
.tags-view-container[data-v-
|
|
267
|
-
.tags-view-container[data-v-
|
|
265
|
+
.tags-view-container[data-v-2c9ad3f6] .n-tag,
|
|
266
|
+
.tags-view-container[data-v-2c9ad3f6] .n-tag__close,
|
|
267
|
+
.tags-view-container[data-v-2c9ad3f6] .c-icon {
|
|
268
268
|
transition: none !important;
|
|
269
269
|
transform: none !important;
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
+
/* 主导航和关闭按钮是同级入口,保留原生链接的键盘与地址语义。 */
|
|
273
|
+
.tag-navigation[data-v-2c9ad3f6] {
|
|
274
|
+
position: relative;
|
|
275
|
+
color: inherit;
|
|
276
|
+
text-decoration: none;
|
|
277
|
+
outline-offset: 3px;
|
|
278
|
+
}
|
|
279
|
+
.tag-navigation[data-v-2c9ad3f6]:focus-visible {
|
|
280
|
+
outline: 2px solid var(--c-primary, var(--c-theme-primary));
|
|
281
|
+
}
|
|
272
282
|
|
|
273
283
|
/* layer: icons */
|
|
274
|
-
.i-mdi\:align-horizontal-left[data-v-
|
|
275
|
-
.i-mdi\:align-horizontal-right[data-v-
|
|
276
|
-
.i-mdi\:arrow-left-right-bold[data-v-
|
|
277
|
-
.i-mdi\:close[data-v-
|
|
278
|
-
.i-mdi\:tally-mark-5[data-v-
|
|
284
|
+
.i-mdi\:align-horizontal-left[data-v-2c9ad3f6]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M4 22H2V2h2zM22 7H6v3h16zm-6 7H6v3h10z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
285
|
+
.i-mdi\:align-horizontal-right[data-v-2c9ad3f6]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M20 2h2v20h-2zM2 10h16V7H2zm6 7h10v-3H8z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
286
|
+
.i-mdi\:arrow-left-right-bold[data-v-2c9ad3f6]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M8 14v4l-6-6l6-6v4h8V6l6 6l-6 6v-4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
287
|
+
.i-mdi\:close[data-v-2c9ad3f6]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
288
|
+
.i-mdi\:tally-mark-5[data-v-2c9ad3f6]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19 10.73V19h-2v-7.64L15 12v7h-2v-6.38l-2 .64V19H9v-5.11l-2 .61V19H5v-3.85l-2.43.77L2 14l3-.95V5h2v7.42l2-.63V5h2v6.16l2-.63V5h2v4.9l2-.64V5h2v3.63L21 8l.57 1.92z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
|
|
279
289
|
/* layer: shortcuts */
|
|
280
|
-
.container[data-v-
|
|
290
|
+
.container[data-v-2c9ad3f6]{width:100%;}
|
|
281
291
|
@media (min-width: 640px){
|
|
282
|
-
.container[data-v-
|
|
292
|
+
.container[data-v-2c9ad3f6]{max-width:640px;}
|
|
283
293
|
}
|
|
284
294
|
@media (min-width: 768px){
|
|
285
|
-
.container[data-v-
|
|
295
|
+
.container[data-v-2c9ad3f6]{max-width:768px;}
|
|
286
296
|
}
|
|
287
297
|
@media (min-width: 1024px){
|
|
288
|
-
.container[data-v-
|
|
298
|
+
.container[data-v-2c9ad3f6]{max-width:1024px;}
|
|
289
299
|
}
|
|
290
300
|
@media (min-width: 1280px){
|
|
291
|
-
.container[data-v-
|
|
301
|
+
.container[data-v-2c9ad3f6]{max-width:1280px;}
|
|
292
302
|
}
|
|
293
303
|
@media (min-width: 1536px){
|
|
294
|
-
.container[data-v-
|
|
304
|
+
.container[data-v-2c9ad3f6]{max-width:1536px;}
|
|
295
305
|
}
|
|
296
306
|
/* layer: default */
|
|
297
|
-
.inline[data-v-
|
|
298
|
-
.block[data-v-
|
|
307
|
+
.inline[data-v-2c9ad3f6]{display:inline;}
|
|
308
|
+
.block[data-v-2c9ad3f6]{display:block;}
|
package/dist/C_TagsView2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`),n=require(`./C_Icon2.cjs`);let r=require(`vue`),i=require(`naive-ui`),a=require(`vue-router`);const o=e=>typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.includes(`\\`)&&!Array.from(e).some(e=>e.charCodeAt(0)<32);function s(e){return o(e.fullPath)&&e.fullPath.split(/[?#]/,1)[0]===e.path?e.fullPath:e.path}const c=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return o(t.path)&&typeof t.title==`string`},l=e=>{if(!(!e||typeof e!=`object`||Array.isArray(e)))return Object.fromEntries(Object.entries(e).filter(([e,t])=>![`__proto__`,`prototype`,`constructor`].includes(e)&&(e!==`affix`||typeof t==`boolean`)))};function u(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>c(e)?[{path:e.path,...typeof e.fullPath==`string`&&s({path:e.path,fullPath:e.fullPath})===e.fullPath?{fullPath:e.fullPath}:{},title:e.title,originalTitle:typeof e.originalTitle==`string`?e.originalTitle:void 0,icon:typeof e.icon==`string`?e.icon:void 0,meta:l(e.meta)}]:[]):[]}catch{return[]}}function d(e={}){let{persistKey:t=`__tags_view_list__`,homePath:n=`/home`}=e,i=()=>{if(!t)return[];try{return u(localStorage.getItem(t))}catch{return[]}},a=e=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},o=(0,r.ref)(i()),c=(0,r.ref)(``),l=()=>a(o.value),d=e=>{e?o.value=e:o.value=[...new Map(o.value.map(e=>[e.path,e])).values()],l()},f=e=>{c.value=e};return{tagsViewList:o,activeTag:c,homePath:n,initTags:d,setActiveTag:f,addTag:e=>{let t=o.value.findIndex(t=>t.path===e.path);if(t===-1)o.value.push(e);else{let n=o.value[t];e.fullPath!==void 0&&(n.fullPath=s(e)),(n.title!==e.title||!n.originalTitle)&&(n.title=e.title,n.originalTitle=e.originalTitle||n.originalTitle)}f(e.path),l()},removeTag:e=>{if(e>=0&&e<o.value.length){let t=o.value.splice(e,1)[0]?.path??null;return l(),t}return null},removeOtherTags:e=>{o.value=o.value.filter((t,n)=>n===0||t.meta?.affix||n===e),l()},removeLeftTags:e=>{o.value=o.value.filter((t,n)=>n===0||t.meta?.affix||n>=e),l()},removeRightTags:e=>{o.value=o.value.filter((t,n)=>t.meta?.affix||n<=e),l()},removeAllTags:()=>{o.value=o.value.filter(e=>e.meta?.affix),l()}}}const f=(0,r.defineComponent)({name:`C_TagsView`,__name:`index`,props:{labelFormatter:{},homePath:{default:`/home`},homeTitle:{default:`首页`},homeIcon:{default:`mdi:home`},persistKey:{default:`__tags_view_list__`},contextMenuLabels:{default:()=>({close:`关闭`,closeOthers:`关闭其他`,closeLeft:`关闭左侧`,closeRight:`关闭右侧`,closeAll:`关闭所有`})},tagsViewOptions:{}},emits:[`close`,`closeAll`],setup(t,{expose:o,emit:c}){let l=e.n(),u=t,
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`),n=require(`./C_Icon2.cjs`);let r=require(`vue`),i=require(`naive-ui`),a=require(`vue-router`);const o=e=>typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.includes(`\\`)&&!Array.from(e).some(e=>e.charCodeAt(0)<32);function s(e){return o(e.fullPath)&&e.fullPath.split(/[?#]/,1)[0]===e.path?e.fullPath:e.path}const c=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return o(t.path)&&typeof t.title==`string`},l=e=>{if(!(!e||typeof e!=`object`||Array.isArray(e)))return Object.fromEntries(Object.entries(e).filter(([e,t])=>![`__proto__`,`prototype`,`constructor`].includes(e)&&(e!==`affix`||typeof t==`boolean`)))};function u(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>c(e)?[{path:e.path,...typeof e.fullPath==`string`&&s({path:e.path,fullPath:e.fullPath})===e.fullPath?{fullPath:e.fullPath}:{},title:e.title,originalTitle:typeof e.originalTitle==`string`?e.originalTitle:void 0,icon:typeof e.icon==`string`?e.icon:void 0,meta:l(e.meta)}]:[]):[]}catch{return[]}}function d(e={}){let{persistKey:t=`__tags_view_list__`,homePath:n=`/home`}=e,i=()=>{if(!t)return[];try{return u(localStorage.getItem(t))}catch{return[]}},a=e=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},o=(0,r.ref)(i()),c=(0,r.ref)(``),l=()=>a(o.value),d=e=>{e?o.value=e:o.value=[...new Map(o.value.map(e=>[e.path,e])).values()],l()},f=e=>{c.value=e};return{tagsViewList:o,activeTag:c,homePath:n,initTags:d,setActiveTag:f,addTag:e=>{let t=o.value.findIndex(t=>t.path===e.path);if(t===-1)o.value.push(e);else{let n=o.value[t];e.fullPath!==void 0&&(n.fullPath=s(e)),(n.title!==e.title||!n.originalTitle)&&(n.title=e.title,n.originalTitle=e.originalTitle||n.originalTitle)}f(e.path),l()},removeTag:e=>{if(e>=0&&e<o.value.length){let t=o.value.splice(e,1)[0]?.path??null;return l(),t}return null},removeOtherTags:e=>{o.value=o.value.filter((t,n)=>n===0||t.meta?.affix||n===e),l()},removeLeftTags:e=>{o.value=o.value.filter((t,n)=>n===0||t.meta?.affix||n>=e),l()},removeRightTags:e=>{o.value=o.value.filter((t,n)=>t.meta?.affix||n<=e),l()},removeAllTags:()=>{o.value=o.value.filter(e=>e.meta?.affix),l()}}}const f=[`href`,`aria-current`,`onClick`],p=(0,r.defineComponent)({name:`C_TagsView`,__name:`index`,props:{labelFormatter:{},homePath:{default:`/home`},homeTitle:{default:`首页`},homeIcon:{default:`mdi:home`},persistKey:{default:`__tags_view_list__`},contextMenuLabels:{default:()=>({close:`关闭`,closeOthers:`关闭其他`,closeLeft:`关闭左侧`,closeRight:`关闭右侧`,closeAll:`关闭所有`})},tagsViewOptions:{}},emits:[`close`,`closeAll`],setup(t,{expose:o,emit:c}){let l=e.n(),u=t,p=c,m=(0,a.useRoute)(),h=(0,a.useRouter)(),g=d(u.tagsViewOptions??{persistKey:u.persistKey,homePath:u.homePath});if(g.tagsViewList.value.length>0&&u.labelFormatter){let e=h.getRoutes(),t=g.tagsViewList.value.map(t=>{let n=e.find(e=>e.path===t.path),r=t.originalTitle||n?.meta?.title||t.title;return{...t,originalTitle:r,title:u.labelFormatter(r)}});g.initTags(t)}let _=e=>u.labelFormatter?u.labelFormatter(e):e,v=()=>{let e=m.path===u.homePath,t=e?u.homeTitle:m.meta.title||`Unnamed Page`;return{path:m.path,fullPath:m.fullPath,originalTitle:t,title:_(t),icon:e?u.homeIcon:m.meta.icon,meta:{affix:m.meta.affix}}},y=(0,r.ref)(!1),b=(0,r.ref)(0),x=(0,r.ref)(0),S=(0,r.ref)(null),C=(0,r.ref)(),w=(0,r.ref)(),T=e=>e.path===m.path,E=e=>e.meta?.affix,D=e=>{let t=w.value;t&&(e.preventDefault(),t.scrollTo({left:t.scrollLeft+e.deltaY,behavior:`smooth`}))},O=e=>{(0,r.nextTick)(()=>{let t=[...w.value?.querySelectorAll(`[data-path]`)??[]].find(t=>t.dataset.path===e);t&&t.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})})},k=e=>{let t=s(e);t!==m.fullPath&&h.push(t).catch(()=>void 0),O(e.path)},A=(e,t)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),k(t))},j=0,M=!1,N=async e=>{try{let t=await h.push(e);return!(0,a.isNavigationFailure)(t)||(0,a.isNavigationFailure)(t,a.NavigationFailureType.duplicated)}catch{return!1}},P=async(e,t,n=!1)=>{let r=++j,i=n||!e.some(e=>e.path===m.path),a=e.find(e=>e.path===t),o=a?s(a):t;if(i&&!await N(o)||M||r!==j)return!1;let c=g.tagsViewList.value.find(e=>e.path===m.path)??v();return g.initTags(e.some(e=>e.path===c.path)?e:[...e,c]),g.setActiveTag(m.path),O(m.path),!0},F=async e=>{if(E(e))return;let t=g.tagsViewList.value,n=t.findIndex(t=>t.path===e.path);if(n===-1)return;let r=T(e),i=t.filter(t=>t.path!==e.path),a=n===t.length-1?i[n-1]?.path||u.homePath:i[i.length-1]?.path||u.homePath;await P(i,a)&&r&&p(`close`,a)};(0,r.onBeforeUnmount)(()=>{M=!0,j+=1});let I=(e,t)=>{e.preventDefault(),S.value=t,y.value=!0,b.value=e.clientX,x.value=e.clientY},L=()=>y.value=!1,R=(0,r.computed)(()=>{let e=u.contextMenuLabels;return[{type:`option`,label:e.close??`关闭`,key:`close`,disabled:E(S.value),icon:()=>(0,r.h)(`span`,{class:`i-mdi:close`})},{type:`option`,label:e.closeOthers??`关闭其他`,key:`closeOthers`,icon:()=>(0,r.h)(`span`,{class:`i-mdi:arrow-left-right-bold`})},{type:`option`,label:e.closeLeft??`关闭左侧`,key:`closeLeft`,icon:()=>(0,r.h)(`span`,{class:`i-mdi:align-horizontal-left`})},{type:`option`,label:e.closeRight??`关闭右侧`,key:`closeRight`,icon:()=>(0,r.h)(`span`,{class:`i-mdi:align-horizontal-right`})},{type:`option`,label:e.closeAll??`关闭所有`,key:`closeAll`,icon:()=>(0,r.h)(`span`,{class:`i-mdi:tally-mark-5`})}]}),z=async e=>{let t=S.value,n=g.tagsViewList.value,r=n.findIndex(e=>e.path===t?.path);if(L(),!t||r===-1)return;if(e===`close`){await F(t);return}let i=n.filter((t,n)=>t.meta?.affix?!0:e===`closeOthers`?n===0||n===r:e===`closeLeft`?n===0||n>=r:e===`closeRight`?n<=r:e!==`closeAll`);[`closeOthers`,`closeLeft`,`closeRight`,`closeAll`].includes(e)&&await P(i,e===`closeAll`?u.homePath:t.path,e===`closeAll`)&&e===`closeAll`&&p(`closeAll`)};return(0,r.watch)(()=>m.fullPath,()=>{g.addTag(v()),g.setActiveTag(m.path),O(m.path)},{immediate:!0}),o({tags:g,scrollToTag:O}),(e,t)=>{let a=i.NTag,o=i.NDropdown;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:`tags-view-container`,style:(0,r.normalizeStyle)((0,r.unref)(l))},[(0,r.createElementVNode)(`div`,{class:`tags-track`,ref_key:`tagsTrack`,ref:C,onWheel:D},[(0,r.createElementVNode)(`div`,{class:`tags-container`,ref_key:`tagsContainer`,ref:w},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(g).tagsViewList.value,e=>((0,r.openBlock)(),(0,r.createBlock)(a,{key:e.path,type:T(e)?`primary`:`default`,class:(0,r.normalizeClass)({"is-active":T(e)}),closable:!E(e),"data-path":e.path,onClose:(0,r.withModifiers)(t=>F(e),[`stop`]),onClick:t=>k(e),onContextmenu:(0,r.withModifiers)(t=>I(t,e),[`prevent`])},{icon:(0,r.withCtx)(()=>[e.icon?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(n.t),{key:0,name:e.icon,size:12},null,8,[`name`])):(0,r.createCommentVNode)(`v-if`,!0)]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`a`,{class:`tag-navigation`,href:(0,r.unref)(h).resolve((0,r.unref)(s)(e)).href,"aria-current":T(e)?`page`:void 0,onClick:(0,r.withModifiers)(t=>A(t,e),[`stop`])},(0,r.toDisplayString)(e.title),9,f)]),_:2},1032,[`type`,`class`,`closable`,`data-path`,`onClose`,`onClick`,`onContextmenu`]))),128))],512)],544),y.value?((0,r.openBlock)(),(0,r.createBlock)(o,{key:0,show:y.value,options:R.value,x:b.value,y:x.value,onClickoutside:L,onSelect:z},null,8,[`show`,`options`,`x`,`y`])):(0,r.createCommentVNode)(`v-if`,!0)],4)}}});var m=t.t(p,[[`__scopeId`,`data-v-2c9ad3f6`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return m}});
|
package/dist/C_TagsView2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./useComponentTheme.js";import{t}from"./export-helper.js";import{t as n}from"./C_Icon2.js";import{Fragment as r,computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createElementVNode as c,
|
|
1
|
+
import{n as e}from"./useComponentTheme.js";import{t}from"./export-helper.js";import{t as n}from"./C_Icon2.js";import{Fragment as r,computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createElementVNode as c,defineComponent as l,h as u,nextTick as ee,normalizeClass as d,normalizeStyle as f,onBeforeUnmount as p,openBlock as m,ref as h,renderList as g,resolveComponent as _,toDisplayString as v,unref as y,watch as b,withCtx as x,withModifiers as S}from"vue";import{NDropdown as te,NTag as ne}from"naive-ui";import{NavigationFailureType as C,isNavigationFailure as w,useRoute as T,useRouter as E}from"vue-router";const D=e=>typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.includes(`\\`)&&!Array.from(e).some(e=>e.charCodeAt(0)<32);function O(e){return D(e.fullPath)&&e.fullPath.split(/[?#]/,1)[0]===e.path?e.fullPath:e.path}const k=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return D(t.path)&&typeof t.title==`string`},A=e=>{if(!(!e||typeof e!=`object`||Array.isArray(e)))return Object.fromEntries(Object.entries(e).filter(([e,t])=>![`__proto__`,`prototype`,`constructor`].includes(e)&&(e!==`affix`||typeof t==`boolean`)))};function j(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>k(e)?[{path:e.path,...typeof e.fullPath==`string`&&O({path:e.path,fullPath:e.fullPath})===e.fullPath?{fullPath:e.fullPath}:{},title:e.title,originalTitle:typeof e.originalTitle==`string`?e.originalTitle:void 0,icon:typeof e.icon==`string`?e.icon:void 0,meta:A(e.meta)}]:[]):[]}catch{return[]}}function M(e={}){let{persistKey:t=`__tags_view_list__`,homePath:n=`/home`}=e,r=()=>{if(!t)return[];try{return j(localStorage.getItem(t))}catch{return[]}},i=e=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},a=h(r()),o=h(``),s=()=>i(a.value),c=e=>{e?a.value=e:a.value=[...new Map(a.value.map(e=>[e.path,e])).values()],s()},l=e=>{o.value=e};return{tagsViewList:a,activeTag:o,homePath:n,initTags:c,setActiveTag:l,addTag:e=>{let t=a.value.findIndex(t=>t.path===e.path);if(t===-1)a.value.push(e);else{let n=a.value[t];e.fullPath!==void 0&&(n.fullPath=O(e)),(n.title!==e.title||!n.originalTitle)&&(n.title=e.title,n.originalTitle=e.originalTitle||n.originalTitle)}l(e.path),s()},removeTag:e=>{if(e>=0&&e<a.value.length){let t=a.value.splice(e,1)[0]?.path??null;return s(),t}return null},removeOtherTags:e=>{a.value=a.value.filter((t,n)=>n===0||t.meta?.affix||n===e),s()},removeLeftTags:e=>{a.value=a.value.filter((t,n)=>n===0||t.meta?.affix||n>=e),s()},removeRightTags:e=>{a.value=a.value.filter((t,n)=>t.meta?.affix||n<=e),s()},removeAllTags:()=>{a.value=a.value.filter(e=>e.meta?.affix),s()}}}const N=[`href`,`aria-current`,`onClick`];var P=t(l({name:`C_TagsView`,__name:`index`,props:{labelFormatter:{},homePath:{default:`/home`},homeTitle:{default:`首页`},homeIcon:{default:`mdi:home`},persistKey:{default:`__tags_view_list__`},contextMenuLabels:{default:()=>({close:`关闭`,closeOthers:`关闭其他`,closeLeft:`关闭左侧`,closeRight:`关闭右侧`,closeAll:`关闭所有`})},tagsViewOptions:{}},emits:[`close`,`closeAll`],setup(t,{expose:l,emit:_}){let D=e(),k=t,A=_,j=T(),P=E(),F=M(k.tagsViewOptions??{persistKey:k.persistKey,homePath:k.homePath});if(F.tagsViewList.value.length>0&&k.labelFormatter){let e=P.getRoutes(),t=F.tagsViewList.value.map(t=>{let n=e.find(e=>e.path===t.path),r=t.originalTitle||n?.meta?.title||t.title;return{...t,originalTitle:r,title:k.labelFormatter(r)}});F.initTags(t)}let re=e=>k.labelFormatter?k.labelFormatter(e):e,I=()=>{let e=j.path===k.homePath,t=e?k.homeTitle:j.meta.title||`Unnamed Page`;return{path:j.path,fullPath:j.fullPath,originalTitle:t,title:re(t),icon:e?k.homeIcon:j.meta.icon,meta:{affix:j.meta.affix}}},L=h(!1),R=h(0),z=h(0),B=h(null),V=h(),H=h(),U=e=>e.path===j.path,W=e=>e.meta?.affix,G=e=>{let t=H.value;t&&(e.preventDefault(),t.scrollTo({left:t.scrollLeft+e.deltaY,behavior:`smooth`}))},K=e=>{ee(()=>{let t=[...H.value?.querySelectorAll(`[data-path]`)??[]].find(t=>t.dataset.path===e);t&&t.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})})},q=e=>{let t=O(e);t!==j.fullPath&&P.push(t).catch(()=>void 0),K(e.path)},J=(e,t)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),q(t))},Y=0,X=!1,ie=async e=>{try{let t=await P.push(e);return!w(t)||w(t,C.duplicated)}catch{return!1}},Z=async(e,t,n=!1)=>{let r=++Y,i=n||!e.some(e=>e.path===j.path),a=e.find(e=>e.path===t),o=a?O(a):t;if(i&&!await ie(o)||X||r!==Y)return!1;let s=F.tagsViewList.value.find(e=>e.path===j.path)??I();return F.initTags(e.some(e=>e.path===s.path)?e:[...e,s]),F.setActiveTag(j.path),K(j.path),!0},Q=async e=>{if(W(e))return;let t=F.tagsViewList.value,n=t.findIndex(t=>t.path===e.path);if(n===-1)return;let r=U(e),i=t.filter(t=>t.path!==e.path),a=n===t.length-1?i[n-1]?.path||k.homePath:i[i.length-1]?.path||k.homePath;await Z(i,a)&&r&&A(`close`,a)};p(()=>{X=!0,Y+=1});let ae=(e,t)=>{e.preventDefault(),B.value=t,L.value=!0,R.value=e.clientX,z.value=e.clientY},$=()=>L.value=!1,oe=i(()=>{let e=k.contextMenuLabels;return[{type:`option`,label:e.close??`关闭`,key:`close`,disabled:W(B.value),icon:()=>u(`span`,{class:`i-mdi:close`})},{type:`option`,label:e.closeOthers??`关闭其他`,key:`closeOthers`,icon:()=>u(`span`,{class:`i-mdi:arrow-left-right-bold`})},{type:`option`,label:e.closeLeft??`关闭左侧`,key:`closeLeft`,icon:()=>u(`span`,{class:`i-mdi:align-horizontal-left`})},{type:`option`,label:e.closeRight??`关闭右侧`,key:`closeRight`,icon:()=>u(`span`,{class:`i-mdi:align-horizontal-right`})},{type:`option`,label:e.closeAll??`关闭所有`,key:`closeAll`,icon:()=>u(`span`,{class:`i-mdi:tally-mark-5`})}]}),se=async e=>{let t=B.value,n=F.tagsViewList.value,r=n.findIndex(e=>e.path===t?.path);if($(),!t||r===-1)return;if(e===`close`){await Q(t);return}let i=n.filter((t,n)=>t.meta?.affix?!0:e===`closeOthers`?n===0||n===r:e===`closeLeft`?n===0||n>=r:e===`closeRight`?n<=r:e!==`closeAll`);[`closeOthers`,`closeLeft`,`closeRight`,`closeAll`].includes(e)&&await Z(i,e===`closeAll`?k.homePath:t.path,e===`closeAll`)&&e===`closeAll`&&A(`closeAll`)};return b(()=>j.fullPath,()=>{F.addTag(I()),F.setActiveTag(j.path),K(j.path)},{immediate:!0}),l({tags:F,scrollToTag:K}),(e,t)=>{let i=ne,l=te;return m(),s(`div`,{class:`tags-view-container`,style:f(y(D))},[c(`div`,{class:`tags-track`,ref_key:`tagsTrack`,ref:V,onWheel:G},[c(`div`,{class:`tags-container`,ref_key:`tagsContainer`,ref:H},[(m(!0),s(r,null,g(y(F).tagsViewList.value,e=>(m(),a(i,{key:e.path,type:U(e)?`primary`:`default`,class:d({"is-active":U(e)}),closable:!W(e),"data-path":e.path,onClose:S(t=>Q(e),[`stop`]),onClick:t=>q(e),onContextmenu:S(t=>ae(t,e),[`prevent`])},{icon:x(()=>[e.icon?(m(),a(y(n),{key:0,name:e.icon,size:12},null,8,[`name`])):o(`v-if`,!0)]),default:x(()=>[c(`a`,{class:`tag-navigation`,href:y(P).resolve(y(O)(e)).href,"aria-current":U(e)?`page`:void 0,onClick:S(t=>J(t,e),[`stop`])},v(e.title),9,N)]),_:2},1032,[`type`,`class`,`closable`,`data-path`,`onClose`,`onClick`,`onContextmenu`]))),128))],512)],544),L.value?(m(),a(l,{key:0,show:L.value,options:oe.value,x:R.value,y:z.value,onClickoutside:$,onSelect:se},null,8,[`show`,`options`,`x`,`y`])):o(`v-if`,!0)],4)}}}),[[`__scopeId`,`data-v-2c9ad3f6`]]);export{M as n,P as t};
|