@robot-admin/naive-ui-components 0.40.3 → 0.40.5

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.
Files changed (208) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +101 -79
  3. package/README_EN.md +110 -67
  4. package/dist/BPMN.cjs +1 -1
  5. package/dist/BPMN.js +1 -1
  6. package/dist/C_ActionBar.css +58 -52
  7. package/dist/C_ActionBar2.cjs +1 -1
  8. package/dist/C_ActionBar2.js +1 -1
  9. package/dist/C_AntV.css +108 -108
  10. package/dist/C_AvatarGroup.css +29 -29
  11. package/dist/C_AvatarGroup2.cjs +1 -1
  12. package/dist/C_AvatarGroup2.js +1 -1
  13. package/dist/C_Barcode.css +6 -6
  14. package/dist/C_Barcode.d.cts +2 -2
  15. package/dist/C_Barcode.d.ts +2 -2
  16. package/dist/C_Barcode2.cjs +1 -1
  17. package/dist/C_Barcode2.js +1 -1
  18. package/dist/C_Captcha.css +42 -42
  19. package/dist/C_Captcha2.cjs +1 -1
  20. package/dist/C_Captcha2.js +1 -1
  21. package/dist/C_Cascade.css +4 -4
  22. package/dist/C_Cascade.d.cts +2 -2
  23. package/dist/C_Cascade.d.ts +2 -2
  24. package/dist/C_Cascade2.cjs +1 -1
  25. package/dist/C_Cascade2.js +1 -1
  26. package/dist/C_City.css +35 -35
  27. package/dist/C_City2.cjs +1 -1
  28. package/dist/C_City2.js +1 -1
  29. package/dist/C_Code.css +27 -27
  30. package/dist/C_Code.d.cts +2 -2
  31. package/dist/C_Code.d.ts +2 -2
  32. package/dist/C_Code2.cjs +1 -1
  33. package/dist/C_Code2.js +1 -1
  34. package/dist/C_CollapsePanel2.cjs +1 -1
  35. package/dist/C_CollapsePanel2.js +1 -1
  36. package/dist/C_ContextMenu.css +3 -3
  37. package/dist/C_ContextMenu2.cjs +1 -1
  38. package/dist/C_ContextMenu2.js +1 -1
  39. package/dist/C_Editor.css +13 -13
  40. package/dist/C_Editor.d.cts +2 -2
  41. package/dist/C_Editor.d.ts +2 -2
  42. package/dist/C_Editor2.cjs +1 -1
  43. package/dist/C_Editor2.js +1 -1
  44. package/dist/C_FilePreview.css +104 -104
  45. package/dist/C_FilePreview2.cjs +1 -1
  46. package/dist/C_FilePreview2.js +1 -1
  47. package/dist/C_FormModal.css +58 -52
  48. package/dist/C_GlobalSearch.css +139 -136
  49. package/dist/C_GlobalSearch2.cjs +1 -1
  50. package/dist/C_GlobalSearch2.js +1 -1
  51. package/dist/C_Guide.css +3 -3
  52. package/dist/C_Guide2.cjs +1 -1
  53. package/dist/C_Guide2.js +1 -1
  54. package/dist/C_Language.css +2 -2
  55. package/dist/C_Language2.cjs +1 -1
  56. package/dist/C_Language2.js +1 -1
  57. package/dist/C_Login.css +136 -121
  58. package/dist/C_Login2.cjs +1 -1
  59. package/dist/C_Login2.js +1 -1
  60. package/dist/C_Markdown.css +37 -37
  61. package/dist/C_Markdown.d.cts +2 -2
  62. package/dist/C_Markdown.d.ts +2 -2
  63. package/dist/C_Markdown2.cjs +1 -1
  64. package/dist/C_Markdown2.js +1 -1
  65. package/dist/C_NotificationCenter.css +51 -36
  66. package/dist/C_NotificationCenter2.cjs +1 -1
  67. package/dist/C_NotificationCenter2.js +1 -1
  68. package/dist/C_Progress.d.cts +2 -2
  69. package/dist/C_Progress.d.ts +2 -2
  70. package/dist/C_Progress2.cjs +1 -1
  71. package/dist/C_Progress2.js +1 -1
  72. package/dist/C_Signature.css +15 -15
  73. package/dist/C_Signature2.cjs +1 -1
  74. package/dist/C_Signature2.js +1 -1
  75. package/dist/C_Steps.css +39 -39
  76. package/dist/C_Steps.d.cts +2 -2
  77. package/dist/C_Steps.d.ts +2 -2
  78. package/dist/C_Steps2.cjs +1 -1
  79. package/dist/C_Steps2.js +1 -1
  80. package/dist/C_Table.base.css +58 -52
  81. package/dist/C_Table.css +58 -52
  82. package/dist/C_Table2.cjs +2 -2
  83. package/dist/C_Table2.js +2 -2
  84. package/dist/C_TagsView.css +60 -50
  85. package/dist/C_TagsView2.cjs +1 -1
  86. package/dist/C_TagsView2.js +1 -1
  87. package/dist/C_Timeline.css +53 -53
  88. package/dist/C_Timeline2.cjs +1 -1
  89. package/dist/C_Timeline2.js +1 -1
  90. package/dist/C_Upload2.cjs +1 -1
  91. package/dist/C_Upload2.js +1 -1
  92. package/dist/C_WaterFall.css +41 -41
  93. package/dist/C_WaterFall.d.cts +2 -2
  94. package/dist/C_WaterFall.d.ts +2 -2
  95. package/dist/C_WaterFall2.cjs +1 -1
  96. package/dist/C_WaterFall2.js +1 -1
  97. package/dist/C_WorkFlow.css +93 -92
  98. package/dist/C_WorkFlow2.cjs +1 -1
  99. package/dist/C_WorkFlow2.js +1 -1
  100. package/dist/ER.cjs +1 -1
  101. package/dist/ER.js +1 -1
  102. package/dist/UML.cjs +3 -3
  103. package/dist/UML.js +3 -3
  104. package/dist/component-config.d.ts +2 -0
  105. package/dist/constants.d.cts +1 -1
  106. package/dist/constants.d.ts +1 -1
  107. package/dist/constants3.d.cts +6 -6
  108. package/dist/constants3.d.ts +6 -6
  109. package/dist/constants4.d.cts +5 -5
  110. package/dist/constants4.d.ts +5 -5
  111. package/dist/context.d.cts +2 -0
  112. package/dist/data2.d.cts +7 -7
  113. package/dist/data2.d.ts +7 -7
  114. package/dist/editors.d.cts +8 -8
  115. package/dist/editors.d.ts +8 -8
  116. package/dist/graphEditSession.cjs +1 -0
  117. package/dist/graphEditSession.js +1 -0
  118. package/dist/index.d.cts +9 -10
  119. package/dist/index.d.ts +9 -9
  120. package/dist/index.vue.d.cts +3 -3
  121. package/dist/index.vue.d.ts +3 -3
  122. package/dist/index10.vue.d.cts +0 -1
  123. package/dist/index10.vue.d.ts +12 -9
  124. package/dist/index11.vue.d.cts +12 -9
  125. package/dist/index11.vue.d.ts +4 -4
  126. package/dist/index12.vue.d.cts +4 -4
  127. package/dist/index13.vue.d.ts +19 -16
  128. package/dist/index14.vue.d.cts +19 -16
  129. package/dist/index16.vue.d.ts +5 -10
  130. package/dist/index17.vue.d.cts +5 -10
  131. package/dist/index17.vue.d.ts +6 -6
  132. package/dist/index18.vue.d.cts +6 -6
  133. package/dist/index18.vue.d.ts +2 -7
  134. package/dist/index19.vue.d.cts +2 -7
  135. package/dist/index19.vue.d.ts +1 -1
  136. package/dist/index20.vue.d.cts +1 -1
  137. package/dist/index20.vue.d.ts +0 -1
  138. package/dist/index21.vue.d.cts +0 -1
  139. package/dist/index21.vue.d.ts +18 -16
  140. package/dist/index22.vue.d.cts +18 -16
  141. package/dist/index24.vue.d.cts +10 -7
  142. package/dist/index24.vue.d.ts +10 -7
  143. package/dist/index27.vue.d.cts +2 -2
  144. package/dist/index27.vue.d.ts +2 -2
  145. package/dist/index28.vue.d.cts +12 -19
  146. package/dist/index28.vue.d.ts +12 -19
  147. package/dist/index3.vue.d.cts +2 -2
  148. package/dist/index3.vue.d.ts +2 -2
  149. package/dist/index30.vue.d.cts +2 -9
  150. package/dist/index30.vue.d.ts +2 -9
  151. package/dist/index31.vue.d.cts +4 -4
  152. package/dist/index31.vue.d.ts +4 -4
  153. package/dist/index32.vue.d.cts +2 -2
  154. package/dist/index32.vue.d.ts +2 -2
  155. package/dist/index4.vue.d.cts +13 -10
  156. package/dist/index4.vue.d.ts +13 -10
  157. package/dist/index7.vue.d.ts +12 -12
  158. package/dist/index8.vue.d.cts +12 -12
  159. package/dist/index9.vue.d.ts +0 -1
  160. package/dist/mapUtils.d.cts +2 -2
  161. package/dist/mapUtils.d.ts +2 -2
  162. package/dist/presets.d.cts +1 -1
  163. package/dist/presets.d.ts +1 -1
  164. package/dist/serializeSearch.cjs +1 -1
  165. package/dist/serializeSearch.js +1 -1
  166. package/dist/style.css +1056 -1006
  167. package/dist/types.d.cts +1 -0
  168. package/dist/types.d.ts +1 -0
  169. package/dist/useCalendarEvents.d.cts +1 -1
  170. package/dist/useCalendarEvents.d.ts +1 -1
  171. package/dist/useCollapsePanel.d.cts +5 -5
  172. package/dist/useCollapsePanel.d.ts +5 -5
  173. package/dist/useCropperCore.d.cts +6 -6
  174. package/dist/useCropperCore.d.ts +6 -6
  175. package/dist/useEdgeInteraction.d.cts +1 -1
  176. package/dist/useEdgeInteraction.d.ts +1 -1
  177. package/dist/useFullscreen.d.cts +2 -2
  178. package/dist/useFullscreen.d.ts +2 -2
  179. package/dist/useGlobalSearch.d.cts +1 -5
  180. package/dist/useGlobalSearch.d.ts +1 -5
  181. package/dist/useInfiniteScroll.d.cts +42 -70
  182. package/dist/useInfiniteScroll.d.ts +42 -70
  183. package/dist/useQRCode.d.cts +5 -5
  184. package/dist/useQRCode.d.ts +5 -5
  185. package/dist/useScopedComponentLocale.cjs +1 -0
  186. package/dist/useScopedComponentLocale.js +1 -0
  187. package/dist/useSignatureHistory.d.cts +11 -6
  188. package/dist/useSignatureHistory.d.ts +11 -6
  189. package/dist/useSplitResize.d.cts +4 -4
  190. package/dist/useSplitResize.d.ts +4 -4
  191. package/dist/useTimeSelection.d.cts +3 -3
  192. package/dist/useTimeSelection.d.ts +3 -3
  193. package/dist/useWorkflowValidation.d.cts +89 -84
  194. package/dist/useWorkflowValidation.d.ts +89 -84
  195. package/dist/verification.d.cts +6 -6
  196. package/dist/verification.d.ts +6 -6
  197. package/docs/component-audit-closure-0.40.4.md +62 -0
  198. package/docs/engineering.en.md +6 -0
  199. package/docs/engineering.md +6 -0
  200. package/docs/guides/api-migration.md +17 -1
  201. package/docs/guides/search-workflows.md +2 -0
  202. package/docs/guides/transfer.md +2 -0
  203. package/docs/guides/usage.en.md +15 -1
  204. package/docs/guides/usage.md +24 -1
  205. package/docs/guides/workflow.md +5 -1
  206. package/package.json +1 -1
  207. package/dist/readonlyGraph.cjs +0 -1
  208. package/dist/readonlyGraph.js +0 -1
@@ -81,7 +81,7 @@
81
81
  * 标签组件样式 - 精简版
82
82
  * =========================================== */
83
83
  /* --------- 标签视图容器 --------- */
84
- .tags-view-container[data-v-906e9836] {
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-906e9836] {
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-906e9836] {
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-906e9836]::-webkit-scrollbar {
110
+ .tags-container[data-v-2c9ad3f6]::-webkit-scrollbar {
111
111
  display: none;
112
112
  }
113
113
 
114
114
  /* --------- 现代化标签样式 --------- */
115
- .n-tag[data-v-906e9836] {
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-906e9836]::before {
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-906e9836] {
144
+ .n-tag[data-v-2c9ad3f6] {
145
145
  /* --------- 悬停效果 --------- */
146
146
  }
147
- .n-tag[data-v-906e9836]:hover:not(.is-active) {
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-906e9836]:hover:not(.is-active)::before {
152
+ .n-tag[data-v-2c9ad3f6]:hover:not(.is-active)::before {
153
153
  opacity: 0.8;
154
154
  }
155
- .n-tag[data-v-906e9836]:hover:not(.is-active) .c-icon,
156
- .n-tag[data-v-906e9836]:hover:not(.is-active) [class*='c-icon'] {
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-906e9836],
160
- .n-tag:hover:not(.is-active) .icon[data-v-906e9836] {
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-906e9836]:hover:not(.is-active) .n-tag__close {
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-906e9836] {
167
+ .n-tag[data-v-2c9ad3f6] {
168
168
  /* --------- 激活状态 --------- */
169
169
  }
170
- .n-tag.is-active[data-v-906e9836] {
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-906e9836]::before {
177
+ .n-tag.is-active[data-v-2c9ad3f6]::before {
178
178
  opacity: 0.6;
179
179
  }
180
- .n-tag.is-active[data-v-906e9836] .n-tag__content {
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-906e9836] .c-icon,
184
- .n-tag.is-active[data-v-906e9836] [class*='c-icon'] {
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-906e9836],
188
- .n-tag.is-active .icon[data-v-906e9836] {
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-906e9836]:hover {
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-906e9836] .n-tag__close {
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-906e9836] {
199
+ .n-tag[data-v-2c9ad3f6] {
200
200
  /* --------- 关闭按钮 --------- */
201
201
  }
202
- .n-tag[data-v-906e9836] .n-tag__close {
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-906e9836] .n-tag__close:hover {
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-906e9836] .n-tag__close:active {
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-906e9836] .c-icon {
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-906e9836] {
239
+ .tags-view-container[data-v-2c9ad3f6] {
240
240
  padding: 6px 12px 0;
241
241
  }
242
- .n-tag[data-v-906e9836] {
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-906e9836] .n-tag__close {
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-906e9836] {
255
+ .tags-container[data-v-2c9ad3f6] {
256
256
  padding: 0 12px;
257
257
  min-height: 36px;
258
258
  }
259
- [data-v-906e9836] .c-icon {
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-906e9836] .n-tag,
266
- .tags-view-container[data-v-906e9836] .n-tag__close,
267
- .tags-view-container[data-v-906e9836] .c-icon {
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-906e9836]{--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;}
275
- .i-mdi\:align-horizontal-right[data-v-906e9836]{--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;}
276
- .i-mdi\:arrow-left-right-bold[data-v-906e9836]{--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;}
277
- .i-mdi\:close[data-v-906e9836]{--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;}
278
- .i-mdi\:tally-mark-5[data-v-906e9836]{--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;}
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-906e9836]{width:100%;}
290
+ .container[data-v-2c9ad3f6]{width:100%;}
281
291
  @media (min-width: 640px){
282
- .container[data-v-906e9836]{max-width:640px;}
292
+ .container[data-v-2c9ad3f6]{max-width:640px;}
283
293
  }
284
294
  @media (min-width: 768px){
285
- .container[data-v-906e9836]{max-width:768px;}
295
+ .container[data-v-2c9ad3f6]{max-width:768px;}
286
296
  }
287
297
  @media (min-width: 1024px){
288
- .container[data-v-906e9836]{max-width:1024px;}
298
+ .container[data-v-2c9ad3f6]{max-width:1024px;}
289
299
  }
290
300
  @media (min-width: 1280px){
291
- .container[data-v-906e9836]{max-width:1280px;}
301
+ .container[data-v-2c9ad3f6]{max-width:1280px;}
292
302
  }
293
303
  @media (min-width: 1536px){
294
- .container[data-v-906e9836]{max-width:1536px;}
304
+ .container[data-v-2c9ad3f6]{max-width:1536px;}
295
305
  }
296
306
  /* layer: default */
297
- .inline[data-v-906e9836]{display:inline;}
298
- .block[data-v-906e9836]{display:block;}
307
+ .inline[data-v-2c9ad3f6]{display:inline;}
308
+ .block[data-v-2c9ad3f6]{display:block;}
@@ -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,f=c,p=(0,a.useRoute)(),m=(0,a.useRouter)(),h=d(u.tagsViewOptions??{persistKey:u.persistKey,homePath:u.homePath});if(h.tagsViewList.value.length>0&&u.labelFormatter){let e=m.getRoutes(),t=h.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)}});h.initTags(t)}let g=e=>u.labelFormatter?u.labelFormatter(e):e,_=()=>{let e=p.path===u.homePath,t=e?u.homeTitle:p.meta.title||`Unnamed Page`;return{path:p.path,fullPath:p.fullPath,originalTitle:t,title:g(t),icon:e?u.homeIcon:p.meta.icon,meta:{affix:p.meta.affix}}},v=(0,r.ref)(!1),y=(0,r.ref)(0),b=(0,r.ref)(0),x=(0,r.ref)(null),S=(0,r.ref)(),C=(0,r.ref)(),w=e=>e.path===p.path,T=e=>e.meta?.affix,E=e=>{let t=C.value;t&&(e.preventDefault(),t.scrollTo({left:t.scrollLeft+e.deltaY,behavior:`smooth`}))},D=e=>{(0,r.nextTick)(()=>{let t=[...C.value?.querySelectorAll(`[data-path]`)??[]].find(t=>t.dataset.path===e);t&&t.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})})},O=e=>{let t=s(e);t!==p.fullPath&&m.push(t).catch(()=>void 0),D(e.path)},k=0,A=!1,j=async e=>{try{let t=await m.push(e);return!(0,a.isNavigationFailure)(t)||(0,a.isNavigationFailure)(t,a.NavigationFailureType.duplicated)}catch{return!1}},M=async(e,t,n=!1)=>{let r=++k,i=n||!e.some(e=>e.path===p.path),a=e.find(e=>e.path===t),o=a?s(a):t;if(i&&!await j(o)||A||r!==k)return!1;let c=h.tagsViewList.value.find(e=>e.path===p.path)??_();return h.initTags(e.some(e=>e.path===c.path)?e:[...e,c]),h.setActiveTag(p.path),D(p.path),!0},N=async e=>{if(T(e))return;let t=h.tagsViewList.value,n=t.findIndex(t=>t.path===e.path);if(n===-1)return;let r=w(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 M(i,a)&&r&&f(`close`,a)};(0,r.onBeforeUnmount)(()=>{A=!0,k+=1});let P=(e,t)=>{e.preventDefault(),x.value=t,v.value=!0,y.value=e.clientX,b.value=e.clientY},F=()=>v.value=!1,I=(0,r.computed)(()=>{let e=u.contextMenuLabels;return[{type:`option`,label:e.close??`关闭`,key:`close`,disabled:T(x.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`})}]}),L=async e=>{let t=x.value,n=h.tagsViewList.value,r=n.findIndex(e=>e.path===t?.path);if(F(),!t||r===-1)return;if(e===`close`){await N(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 M(i,e===`closeAll`?u.homePath:t.path,e===`closeAll`)&&e===`closeAll`&&f(`closeAll`)};return(0,r.watch)(()=>p.fullPath,()=>{h.addTag(_()),h.setActiveTag(p.path),D(p.path)},{immediate:!0}),o({tags:h,scrollToTag:D}),(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:S,onWheel:E},[(0,r.createElementVNode)(`div`,{class:`tags-container`,ref_key:`tagsContainer`,ref:C},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(h).tagsViewList.value,e=>((0,r.openBlock)(),(0,r.createBlock)(a,{key:e.path,type:w(e)?`primary`:`default`,class:(0,r.normalizeClass)({"is-active":w(e)}),closable:!T(e),"data-path":e.path,onClose:(0,r.withModifiers)(t=>N(e),[`stop`]),onClick:t=>O(e),onContextmenu:(0,r.withModifiers)(t=>P(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.createTextVNode)(` `+(0,r.toDisplayString)(e.title),1)]),_:2},1032,[`type`,`class`,`closable`,`data-path`,`onClose`,`onClick`,`onContextmenu`]))),128))],512)],544),v.value?((0,r.openBlock)(),(0,r.createBlock)(o,{key:0,show:v.value,options:I.value,x:y.value,y:b.value,onClickoutside:F,onSelect:L},null,8,[`show`,`options`,`x`,`y`])):(0,r.createCommentVNode)(`v-if`,!0)],4)}}});var p=t.t(f,[[`__scopeId`,`data-v-906e9836`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
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}});
@@ -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,createTextVNode as l,defineComponent as u,h as d,nextTick as f,normalizeClass as p,normalizeStyle as m,onBeforeUnmount as ee,openBlock as h,ref as g,renderList as _,resolveComponent as v,toDisplayString as y,unref as b,watch as x,withCtx as S,withModifiers as C}from"vue";import{NDropdown as w,NTag as T}from"naive-ui";import{NavigationFailureType as E,isNavigationFailure as D,useRoute as te,useRouter as O}from"vue-router";const k=e=>typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.includes(`\\`)&&!Array.from(e).some(e=>e.charCodeAt(0)<32);function A(e){return k(e.fullPath)&&e.fullPath.split(/[?#]/,1)[0]===e.path?e.fullPath:e.path}const j=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return k(t.path)&&typeof t.title==`string`},M=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 N(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>j(e)?[{path:e.path,...typeof e.fullPath==`string`&&A({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:M(e.meta)}]:[]):[]}catch{return[]}}function P(e={}){let{persistKey:t=`__tags_view_list__`,homePath:n=`/home`}=e,r=()=>{if(!t)return[];try{return N(localStorage.getItem(t))}catch{return[]}},i=e=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},a=g(r()),o=g(``),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=A(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()}}}var F=t(u({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:u,emit:v}){let k=e(),j=t,M=v,N=te(),F=O(),I=P(j.tagsViewOptions??{persistKey:j.persistKey,homePath:j.homePath});if(I.tagsViewList.value.length>0&&j.labelFormatter){let e=F.getRoutes(),t=I.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:j.labelFormatter(r)}});I.initTags(t)}let L=e=>j.labelFormatter?j.labelFormatter(e):e,R=()=>{let e=N.path===j.homePath,t=e?j.homeTitle:N.meta.title||`Unnamed Page`;return{path:N.path,fullPath:N.fullPath,originalTitle:t,title:L(t),icon:e?j.homeIcon:N.meta.icon,meta:{affix:N.meta.affix}}},z=g(!1),B=g(0),V=g(0),H=g(null),U=g(),W=g(),G=e=>e.path===N.path,K=e=>e.meta?.affix,q=e=>{let t=W.value;t&&(e.preventDefault(),t.scrollTo({left:t.scrollLeft+e.deltaY,behavior:`smooth`}))},J=e=>{f(()=>{let t=[...W.value?.querySelectorAll(`[data-path]`)??[]].find(t=>t.dataset.path===e);t&&t.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})})},ne=e=>{let t=A(e);t!==N.fullPath&&F.push(t).catch(()=>void 0),J(e.path)},Y=0,X=!1,re=async e=>{try{let t=await F.push(e);return!D(t)||D(t,E.duplicated)}catch{return!1}},Z=async(e,t,n=!1)=>{let r=++Y,i=n||!e.some(e=>e.path===N.path),a=e.find(e=>e.path===t),o=a?A(a):t;if(i&&!await re(o)||X||r!==Y)return!1;let s=I.tagsViewList.value.find(e=>e.path===N.path)??R();return I.initTags(e.some(e=>e.path===s.path)?e:[...e,s]),I.setActiveTag(N.path),J(N.path),!0},Q=async e=>{if(K(e))return;let t=I.tagsViewList.value,n=t.findIndex(t=>t.path===e.path);if(n===-1)return;let r=G(e),i=t.filter(t=>t.path!==e.path),a=n===t.length-1?i[n-1]?.path||j.homePath:i[i.length-1]?.path||j.homePath;await Z(i,a)&&r&&M(`close`,a)};ee(()=>{X=!0,Y+=1});let ie=(e,t)=>{e.preventDefault(),H.value=t,z.value=!0,B.value=e.clientX,V.value=e.clientY},$=()=>z.value=!1,ae=i(()=>{let e=j.contextMenuLabels;return[{type:`option`,label:e.close??`关闭`,key:`close`,disabled:K(H.value),icon:()=>d(`span`,{class:`i-mdi:close`})},{type:`option`,label:e.closeOthers??`关闭其他`,key:`closeOthers`,icon:()=>d(`span`,{class:`i-mdi:arrow-left-right-bold`})},{type:`option`,label:e.closeLeft??`关闭左侧`,key:`closeLeft`,icon:()=>d(`span`,{class:`i-mdi:align-horizontal-left`})},{type:`option`,label:e.closeRight??`关闭右侧`,key:`closeRight`,icon:()=>d(`span`,{class:`i-mdi:align-horizontal-right`})},{type:`option`,label:e.closeAll??`关闭所有`,key:`closeAll`,icon:()=>d(`span`,{class:`i-mdi:tally-mark-5`})}]}),oe=async e=>{let t=H.value,n=I.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`?j.homePath:t.path,e===`closeAll`)&&e===`closeAll`&&M(`closeAll`)};return x(()=>N.fullPath,()=>{I.addTag(R()),I.setActiveTag(N.path),J(N.path)},{immediate:!0}),u({tags:I,scrollToTag:J}),(e,t)=>{let i=T,u=w;return h(),s(`div`,{class:`tags-view-container`,style:m(b(k))},[c(`div`,{class:`tags-track`,ref_key:`tagsTrack`,ref:U,onWheel:q},[c(`div`,{class:`tags-container`,ref_key:`tagsContainer`,ref:W},[(h(!0),s(r,null,_(b(I).tagsViewList.value,e=>(h(),a(i,{key:e.path,type:G(e)?`primary`:`default`,class:p({"is-active":G(e)}),closable:!K(e),"data-path":e.path,onClose:C(t=>Q(e),[`stop`]),onClick:t=>ne(e),onContextmenu:C(t=>ie(t,e),[`prevent`])},{icon:S(()=>[e.icon?(h(),a(b(n),{key:0,name:e.icon,size:12},null,8,[`name`])):o(`v-if`,!0)]),default:S(()=>[l(` `+y(e.title),1)]),_:2},1032,[`type`,`class`,`closable`,`data-path`,`onClose`,`onClick`,`onContextmenu`]))),128))],512)],544),z.value?(h(),a(u,{key:0,show:z.value,options:ae.value,x:B.value,y:V.value,onClickoutside:$,onSelect:oe},null,8,[`show`,`options`,`x`,`y`])):o(`v-if`,!0)],4)}}}),[[`__scopeId`,`data-v-906e9836`]]);export{P as n,F as t};
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};