@ithinkdt/ui 4.0.0-38 → 4.0.0-40

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 (55) hide show
  1. package/dist/components-BC8oa62b.js +1612 -0
  2. package/dist/components.js +5 -0
  3. package/dist/directives-DUuJW647.js +183 -0
  4. package/dist/directives.js +3 -0
  5. package/dist/index.js +1222 -0
  6. package/dist/page.js +511 -0
  7. package/dist/use-i18n-Dx7V4KrY.js +6 -0
  8. package/dist/use-style-DcT-1dj4.js +29 -0
  9. package/dist/use-style.js +2 -0
  10. package/esm/components.js +1 -0
  11. package/esm/directives.js +1 -0
  12. package/esm/index.js +1 -0
  13. package/esm/page.js +1 -0
  14. package/esm/use-style.js +1 -0
  15. package/package.json +21 -18
  16. package/src/components/Checkboxes.jsx +0 -130
  17. package/src/components/DataActions.jsx +0 -105
  18. package/src/components/DataCustom.jsx +0 -187
  19. package/src/components/DataFilter.jsx +0 -119
  20. package/src/components/DataForm.jsx +0 -264
  21. package/src/components/DataLocaleInput.jsx +0 -121
  22. package/src/components/DataPagination.jsx +0 -62
  23. package/src/components/DataSelection.jsx +0 -57
  24. package/src/components/DataTable.jsx +0 -302
  25. package/src/components/Radios.jsx +0 -134
  26. package/src/components/UserDept.jsx +0 -643
  27. package/src/components/assets.jsx +0 -274
  28. package/src/components/index.js +0 -11
  29. package/src/design/Account.jsx +0 -154
  30. package/src/design/Appearance.jsx +0 -89
  31. package/src/design/Breadcrumb.jsx +0 -67
  32. package/src/design/Fullscreen.jsx +0 -65
  33. package/src/design/Language.jsx +0 -45
  34. package/src/design/Layout.jsx +0 -241
  35. package/src/design/Logo.jsx +0 -92
  36. package/src/design/Menu.jsx +0 -133
  37. package/src/design/MultiTabs.jsx +0 -501
  38. package/src/design/Notification.jsx +0 -311
  39. package/src/design/Tenant.jsx +0 -88
  40. package/src/design/common.jsx +0 -21
  41. package/src/design/index.js +0 -11
  42. package/src/directives/index.js +0 -2
  43. package/src/directives/spin.js +0 -181
  44. package/src/directives/tooltip.jsx +0 -121
  45. package/src/index.js +0 -18
  46. package/src/page.jsx +0 -740
  47. package/src/use-i18n.js +0 -8
  48. package/src/use-style.js +0 -58
  49. package/src/utils.js +0 -20
  50. /package/{src → esm}/components.d.ts +0 -0
  51. /package/{src → esm}/design.d.ts +0 -0
  52. /package/{src → esm}/directives.d.ts +0 -0
  53. /package/{src → esm}/index.d.ts +0 -0
  54. /package/{src → esm}/page.d.ts +0 -0
  55. /package/{src → esm}/use-style.d.ts +0 -0
@@ -1,274 +0,0 @@
1
- export const IHelp = props => (
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- xmlns:xlink="http://www.w3.org/1999/xlink"
5
- role="img"
6
- width="1em"
7
- height="1em"
8
- viewBox="0 0 24 24"
9
- {...props}
10
- >
11
- <path
12
- fill="currentColor"
13
- d="M11 18h2v-2h-2v2m1-16A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8m0-14a4 4 0 0 0-4 4h2a2 2 0 0 1 2-2a2 2 0 0 1 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5a4 4 0 0 0-4-4Z"
14
- />
15
- </svg>
16
- )
17
-
18
- export const ICustom = props => (
19
- <svg
20
- xmlns="http://www.w3.org/2000/svg"
21
- xmlns:xlink="http://www.w3.org/1999/xlink"
22
- role="img"
23
- width="1em"
24
- height="1em"
25
- viewBox="0 0 1024 1024"
26
- {...props}
27
- >
28
- <path
29
- fill="currentColor"
30
- d="m924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 0 0 9.3-35.2l-.9-2.6a443.74 443.74 0 0 0-79.7-137.9l-1.8-2.1a32.12 32.12 0 0 0-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 0 0-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 0 0-25.8 25.7l-15.8 85.4a351.86 351.86 0 0 0-99 57.4l-81.9-29.1a32 32 0 0 0-35.1 9.5l-1.8 2.1a446.02 446.02 0 0 0-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1c0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 0 0-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0 0 35.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0 0 25.8 25.7l2.7.5a449.4 449.4 0 0 0 159 0l2.7-.5a32.05 32.05 0 0 0 25.8-25.7l15.7-85a350 350 0 0 0 99.7-57.6l81.3 28.9a32 32 0 0 0 35.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1l74.7 63.9a370.03 370.03 0 0 1-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3l-17.9 97a377.5 377.5 0 0 1-85 0l-17.9-97.2l-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9l-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5l-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5c0-15.3 1.2-30.6 3.7-45.5l6.5-40l-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2l31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3l17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97l38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8l92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176s176-78.8 176-176s-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 0 1 512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 0 1 400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 0 1 624 502c0 29.9-11.7 58-32.8 79.2z"
31
- />
32
- </svg>
33
- )
34
-
35
- export const IDrag = props => (
36
- <svg
37
- xmlns="http://www.w3.org/2000/svg"
38
- xmlns:xlink="http://www.w3.org/1999/xlink"
39
- role="img"
40
- width="1em"
41
- height="1em"
42
- viewBox="0 0 1024 1024"
43
- {...props}
44
- >
45
- <path
46
- fill="currentColor"
47
- d="M300 276.497a56 56 0 1 0 56-96.994a56 56 0 0 0-56 96.994Zm0 284a56 56 0 1 0 56-96.994a56 56 0 0 0-56 96.994ZM640 228a56 56 0 1 0 112 0a56 56 0 0 0-112 0Zm0 284a56 56 0 1 0 112 0a56 56 0 0 0-112 0ZM300 844.497a56 56 0 1 0 56-96.994a56 56 0 0 0-56 96.994ZM640 796a56 56 0 1 0 112 0a56 56 0 0 0-112 0Z"
48
- />
49
- </svg>
50
- )
51
- export const ILeft = props => (
52
- <svg
53
- xmlns="http://www.w3.org/2000/svg"
54
- xmlns:xlink="http://www.w3.org/1999/xlink"
55
- role="img"
56
- width="1em"
57
- height="1em"
58
- viewBox="0 0 1024 1024"
59
- {...props}
60
- >
61
- <path
62
- fill="currentColor"
63
- d="M326 164h-64c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V172c0-4.4-3.6-8-8-8zm444 72.4V164c0-6.8-7.9-10.5-13.1-6.1L335 512l421.9 354.1c5.2 4.4 13.1.7 13.1-6.1v-72.4c0-9.4-4.2-18.4-11.4-24.5L459.4 512l299.2-251.1c7.2-6.1 11.4-15.1 11.4-24.5z"
64
- />
65
- </svg>
66
- )
67
- export const IRight = props => (
68
- <svg
69
- xmlns="http://www.w3.org/2000/svg"
70
- xmlns:xlink="http://www.w3.org/1999/xlink"
71
- role="img"
72
- width="1em"
73
- height="1em"
74
- viewBox="0 0 1024 1024"
75
- {...props}
76
- >
77
- <path
78
- fill="currentColor"
79
- d="M762 164h-64c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V172c0-4.4-3.6-8-8-8zm-508 0v72.4c0 9.5 4.2 18.4 11.4 24.5L564.6 512L265.4 763.1c-7.2 6.1-11.4 15-11.4 24.5V860c0 6.8 7.9 10.5 13.1 6.1L689 512L267.1 157.9A7.95 7.95 0 0 0 254 164z"
80
- />
81
- </svg>
82
- )
83
- export const IDown = props => (
84
- <svg
85
- xmlns="http://www.w3.org/2000/svg"
86
- xmlns:xlink="http://www.w3.org/1999/xlink"
87
- role="img"
88
- width="1em"
89
- height="1em"
90
- viewBox="0 0 32 32"
91
- {...props}
92
- >
93
- <path fill="currentColor" d="M16 22L6 12l1.4-1.4l8.6 8.6l8.6-8.6L26 12z" />
94
- </svg>
95
- )
96
-
97
- export const IUp = props => (
98
- <svg
99
- xmlns="http://www.w3.org/2000/svg"
100
- xmlns:xlink="http://www.w3.org/1999/xlink"
101
- role="img"
102
- width="1em"
103
- height="1em"
104
- viewBox="0 0 32 32"
105
- {...props}
106
- >
107
- <path fill="currentColor" d="m16 10l10 10l-1.4 1.4l-8.6-8.6l-8.6 8.6L6 20z" />
108
- </svg>
109
- )
110
-
111
- export const ICheck = props => (
112
- <svg
113
- xmlns="http://www.w3.org/2000/svg"
114
- xmlns:xlink="http://www.w3.org/1999/xlink"
115
- role="img"
116
- width="1em"
117
- height="1em"
118
- viewBox="0 0 24 24"
119
- {...props}
120
- >
121
- <path fill="currentColor" d="m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z" />
122
- </svg>
123
- )
124
-
125
- export const ILanguage = props => (
126
- <svg
127
- xmlns="http://www.w3.org/2000/svg"
128
- xmlns:xlink="http://www.w3.org/1999/xlink"
129
- role="img"
130
- width="1em"
131
- height="1em"
132
- viewBox="0 0 24 24"
133
- {...props}
134
- >
135
- {/* Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE */}
136
- <path fill="currentColor" d="M12 22q-2.05 0-3.875-.788t-3.187-2.15t-2.15-3.187T2 12q0-2.075.788-3.887t2.15-3.175t3.187-2.15T12 2q2.075 0 3.888.788t3.174 2.15t2.15 3.175T22 12q0 2.05-.788 3.875t-2.15 3.188t-3.175 2.15T12 22m0-2.05q.65-.9 1.125-1.875T13.9 16h-3.8q.3 1.1.775 2.075T12 19.95m-2.6-.4q-.45-.825-.787-1.713T8.05 16H5.1q.725 1.25 1.813 2.175T9.4 19.55m5.2 0q1.4-.45 2.488-1.375T18.9 16h-2.95q-.225.95-.562 1.838T14.6 19.55M4.25 14h3.4q-.075-.5-.112-.987T7.5 12t.038-1.012T7.65 10h-3.4q-.125.5-.187.988T4 12t.063 1.013t.187.987m5.4 0h4.7q.075-.5.113-.987T14.5 12t-.038-1.012T14.35 10h-4.7q-.075.5-.112.988T9.5 12t.038 1.013t.112.987m6.7 0h3.4q.125-.5.188-.987T20 12t-.062-1.012T19.75 10h-3.4q.075.5.113.988T16.5 12t-.038 1.013t-.112.987m-.4-6h2.95q-.725-1.25-1.812-2.175T14.6 4.45q.45.825.788 1.713T15.95 8M10.1 8h3.8q-.3-1.1-.775-2.075T12 4.05q-.65.9-1.125 1.875T10.1 8m-5 0h2.95q.225-.95.563-1.838T9.4 4.45Q8 4.9 6.912 5.825T5.1 8" />
137
- </svg>
138
- )
139
-
140
- export const IMore = props => (
141
- <svg
142
- xmlns="http://www.w3.org/2000/svg"
143
- xmlns:xlink="http://www.w3.org/1999/xlink"
144
- role="img"
145
- width="1em"
146
- height="1em"
147
- viewBox="0 0 20 20"
148
- {...props}
149
- >
150
- {/* Icon from uiw icons by liwen0526 - https://github.com/uiwjs/icons/blob/master/LICENSE */}
151
- <path fill="currentColor" fillRule="evenodd" d="M2.5 7.5a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5m15 0a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5m-7.274 0a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5" />
152
- </svg>
153
- )
154
-
155
- export const IPlus = props => (
156
- <svg
157
- xmlns="http://www.w3.org/2000/svg"
158
- xmlns:xlink="http://www.w3.org/1999/xlink"
159
- role="img"
160
- width="1em"
161
- height="1em"
162
- viewBox="0 0 24 24"
163
- {...props}
164
- >
165
- <path fill="currentColor" d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"></path>
166
- </svg>
167
- )
168
-
169
- export const IPlus2 = props => (
170
- <svg
171
- xmlns="http://www.w3.org/2000/svg"
172
- xmlns:xlink="http://www.w3.org/1999/xlink"
173
- width="1em"
174
- height="1em"
175
- viewBox="0 0 24 24"
176
- {...props}
177
- >
178
- <path
179
- fill="currentColor"
180
- d="M21 8H3V6h18zm-7.19 8H10v2h3.09c.12-.72.37-1.39.72-2M18 11H6v2h12zm0 4v3h-3v2h3v3h2v-3h3v-2h-3v-3z"
181
- >
182
- </path>
183
- </svg>
184
- )
185
-
186
- export const IImgNone = props => (
187
- <svg
188
- xmlns="http://www.w3.org/2000/svg"
189
- xmlns:xlink="http://www.w3.org/1999/xlink"
190
- width="1em"
191
- height="1em"
192
- viewBox="0 0 24 24"
193
- {...props}
194
- >
195
- {/* Icon from Tabler Icons by Paweł Kuna - https://github.com/tabler/tabler-icons/blob/master/LICENSE */}
196
- <g fill="none" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2">
197
- <path d="M15 8h.01M15 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v6" />
198
- <path d="m3 16l5-5c.928-.893 2.072-.893 3 0l4 4" />
199
- <path d="m14 14l1-1c.665-.64 1.44-.821 2.167-.545M19 16v3m0 3v.01" />
200
- </g>
201
- </svg>
202
- )
203
-
204
- export const IImgError = props => (
205
- <svg
206
- xmlns="http://www.w3.org/2000/svg"
207
- xmlns:xlink="http://www.w3.org/1999/xlink"
208
- role="img"
209
- width="1em"
210
- height="1em"
211
- viewBox="0 0 24 24"
212
- {...props}
213
- >
214
- <path
215
- fill="currentColor"
216
- d="M22 20.7L3.3 2L2 3.3l1 1V19c0 1.1.9 2 2 2h14.7l1 1zM5 19V6.3l7.6 7.6l-1.5 1.9L9 13.1L6 17h9.7l2 2zM8.8 5l-2-2H19c1.1 0 2 .9 2 2v12.2l-2-2V5z"
217
- >
218
- </path>
219
- </svg>
220
- )
221
-
222
- export const IDept = props => (
223
- <svg
224
- xmlns="http://www.w3.org/2000/svg"
225
- xmlns:xlink="http://www.w3.org/1999/xlink"
226
- width="1em"
227
- height="1em"
228
- viewBox="0 0 12 12"
229
- {...props}
230
- >
231
- <path
232
- fill="currentColor"
233
- d="M5.5 4.937a2 2 0 1 1 1 0V6h2a1 1 0 0 1 1 1v1.063a2 2 0 1 1-1 0V7h-5v1.063a2 2 0 1 1-1 0V7a1 1 0 0 1 1-1h2zM6 4a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-3 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m5-1a1 1 0 1 0 2 0a1 1 0 0 0-2 0"
234
- >
235
- </path>
236
- </svg>
237
- )
238
- export const IGroup = props => (
239
- <svg
240
- xmlns="http://www.w3.org/2000/svg"
241
- xmlns:xlink="http://www.w3.org/1999/xlink"
242
- width="1em"
243
- height="1em"
244
- viewBox="0 0 24 24"
245
- {...props}
246
- >
247
- <g fill="none" fillRule="evenodd">
248
- <path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022m-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"></path>
249
- <path
250
- fill="currentColor"
251
- d="M13 13a4 4 0 0 1 4 4v2a1 1 0 1 1-2 0v-2a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v2a1 1 0 1 1-2 0v-2a4 4 0 0 1 4-4zm6 0a3 3 0 0 1 3 3v2a1 1 0 1 1-2 0v-2a1 1 0 0 0-1-1h-1.416a5.02 5.02 0 0 0-1.583-2zM9.5 3a4.5 4.5 0 1 1 0 9a4.5 4.5 0 0 1 0-9M18 6a3 3 0 1 1 0 6a3 3 0 0 1 0-6M9.5 5a2.5 2.5 0 1 0 0 5a2.5 2.5 0 0 0 0-5M18 8a1 1 0 1 0 0 2a1 1 0 0 0 0-2"
252
- >
253
- </path>
254
- </g>
255
- </svg>
256
- )
257
-
258
- export const IAccount = props => (
259
- <svg
260
- xmlns="http://www.w3.org/2000/svg"
261
- xmlns:xlink="http://www.w3.org/1999/xlink"
262
- role="img"
263
- width="1em"
264
- height="1em"
265
- viewBox="0 0 256 256"
266
- {...props}
267
- >
268
- <path
269
- fill="currentColor"
270
- d="M235.4 210a124.2 124.2 0 0 0-61.8-53.2a76 76 0 1 0-91.2 0A124.2 124.2 0 0 0 20.6 210a12 12 0 0 0 20.8 12a100 100 0 0 1 173.2 0a12.1 12.1 0 0 0 10.4 6a11.7 11.7 0 0 0 6-1.6a12 12 0 0 0 4.4-16.4ZM76 96a52 52 0 1 1 52 52a52 52 0 0 1-52-52Z"
271
- >
272
- </path>
273
- </svg>
274
- )
@@ -1,11 +0,0 @@
1
- export * from './Checkboxes.jsx'
2
- export * from './DataActions.jsx'
3
- export * from './DataCustom.jsx'
4
- export * from './DataFilter.jsx'
5
- export * from './DataForm.jsx'
6
- export * from './DataLocaleInput.jsx'
7
- export * from './DataPagination.jsx'
8
- export * from './DataSelection.jsx'
9
- export * from './DataTable.jsx'
10
- export * from './Radios.jsx'
11
- export * from './UserDept.jsx'
@@ -1,154 +0,0 @@
1
- import { NAvatar, NButton, NIcon, NPopover } from 'ithinkdt-ui'
2
- import { computed, defineComponent, withDirectives } from 'vue'
3
-
4
- import { vTooltip } from '../directives/tooltip.jsx'
5
- import { useI18n } from '../use-i18n.js'
6
-
7
- export const AppAccount = /* @__PURE__ */ defineComponent({
8
- name: 'AppAccount',
9
- props: {
10
- username: String,
11
- nickname: String,
12
- head: String,
13
- showLogoutButton: { type: Boolean, default: true },
14
- showChangePwd: { type: Boolean, default: true },
15
- },
16
- emit: ['logout', 'change-pwd'],
17
- setup(props, { emit, slots }) {
18
- const firstname = computed(() =>
19
- /^[\u4E00-\u9FA5]+$/.test(props.nickname)
20
- ? props.nickname?.slice(props.nickname?.length > 3 ? 2 : 1)
21
- : props.nickname?.split(' ')[0],
22
- )
23
-
24
- const { t } = useI18n()
25
-
26
- const def = (
27
- <NIcon size="28">
28
- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="-4 -4 32 32">
29
- <path
30
- fill="currentColor"
31
- d="M12 12q-1.65 0-2.825-1.175T8 8t1.175-2.825T12 4t2.825 1.175T16 8t-1.175 2.825T12 12m-8 6v-.8q0-.85.438-1.562T5.6 14.55q1.55-.775 3.15-1.162T12 13t3.25.388t3.15 1.162q.725.375 1.163 1.088T20 17.2v.8q0 .825-.587 1.413T18 20H6q-.825 0-1.412-.587T4 18"
32
- >
33
- </path>
34
- </svg>
35
- </NIcon>
36
- )
37
-
38
- const logoutIcon = (
39
- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
40
- <path
41
- fill="currentColor"
42
- d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2a9.99 9.99 0 0 1 8 4h-2.71a8 8 0 1 0 .001 12h2.71A9.99 9.99 0 0 1 12 22m7-6v-3h-8v-2h8V8l5 4z"
43
- >
44
- </path>
45
- </svg>
46
- )
47
-
48
- return () => {
49
- return (
50
- <div style="display: flex; align-items: center">
51
- <NPopover style="padding: 4px">
52
- {{
53
- trigger: () => (
54
- <NButton quaternary style="--n-padding: 0 12px">
55
- <div style="display: flex; align-items: center; gap: 8px">
56
- <NAvatar
57
- key={props.head ? 'head' : 'no-head'}
58
- src={props.head}
59
- round
60
- size="small"
61
- radix={0.78}
62
- color="var(--color-primary-hover)"
63
- >
64
- {{
65
- fallback: () => def,
66
- placeholder: () => def,
67
- default: props.head ? undefined : () => firstname.value,
68
- }}
69
- </NAvatar>
70
- <span style="font-size: 14px">{props.username ?? ''}</span>
71
- </div>
72
- </NButton>
73
- ),
74
- default: () => {
75
- const changePwd = () =>
76
- props.showChangePwd
77
- ? (
78
- <NButton
79
- quaternary
80
- style="justify-content: left"
81
- onClick={() => emit('change-pwd')}
82
- >
83
- {{
84
- icon: () => (
85
- <NIcon>
86
- <svg
87
- xmlns="http://www.w3.org/2000/svg"
88
- width="1em"
89
- height="1em"
90
- viewBox="0 0 32 32"
91
- >
92
- <path
93
- fill="currentColor"
94
- d="M21 2a8.998 8.998 0 0 0-8.612 11.612L2 24v6h6l10.388-10.388A9 9 0 1 0 21 2m0 16a7 7 0 0 1-2.032-.302l-1.147-.348l-.847.847l-3.181 3.181L12.414 20L11 21.414l1.379 1.379l-1.586 1.586L9.414 23L8 24.414l1.379 1.379L7.172 28H4v-3.172l9.802-9.802l.848-.847l-.348-1.147A7 7 0 1 1 21 18"
95
- >
96
- </path>
97
- <circle cx="22" cy="10" r="2" fill="currentColor"></circle>
98
- </svg>
99
- </NIcon>
100
- ),
101
- default: () => t('common.account.changePwd'),
102
- }}
103
- </NButton>
104
- )
105
- : undefined
106
- const logoutButton = () =>
107
- props.showLogoutButton
108
- ? undefined
109
- : (
110
- <NButton
111
- quaternary
112
- style="justify-content: left"
113
- onClick={() => emit('logout')}
114
- >
115
- {{
116
- icon: () => <NIcon>{logoutIcon}</NIcon>,
117
- default: () => t('common.account.logout'),
118
- }}
119
- </NButton>
120
- )
121
- return slots.dropdown
122
- ? (
123
- slots.dropdown({ pwd: changePwd, logout: logoutButton })
124
- )
125
- : (
126
- <div style="display: flex; flex-direction: column">
127
- {changePwd()}
128
- {slots.dropdownExtra?.()}
129
- {logoutButton()}
130
- </div>
131
- )
132
- },
133
- }}
134
- </NPopover>
135
-
136
- {slots.extra?.()}
137
-
138
- {props.showLogoutButton
139
- ? withDirectives(
140
- <NButton
141
- quaternary
142
- style="--n-padding: 0 12px"
143
- onClick={() => props.username && emit('logout')}
144
- >
145
- {slots.logoutButton?.() ?? <NIcon size="16">{logoutIcon}</NIcon>}
146
- </NButton>,
147
- [[vTooltip, t('common.account.logout'), undefined, { 'bottom-end': true }]],
148
- )
149
- : undefined}
150
- </div>
151
- )
152
- }
153
- },
154
- })
@@ -1,89 +0,0 @@
1
- import { NButton, NIcon } from 'ithinkdt-ui'
2
- import { defineComponent, withDirectives } from 'vue'
3
-
4
- import { vTooltip } from '../directives/tooltip.jsx'
5
- import { useI18n } from '../use-i18n.js'
6
-
7
- export const AppAppearance = /* @__PURE__ */ defineComponent({
8
- name: 'AppAppearance',
9
- props: {
10
- mode: String,
11
- },
12
- emit: ['update:mode'],
13
- setup(props, { emit }) {
14
- const { t } = useI18n()
15
-
16
- return () =>
17
- withDirectives(
18
- <NButton
19
- quaternary
20
- style="--n-padding: 0 12px"
21
- onClick={() => {
22
- emit('update:mode', props.mode === 'light' ? 'dark' : props.mode === 'dark' ? 'auto' : 'light')
23
- }}
24
- >
25
- <NIcon size="18">
26
- {props.mode === 'light'
27
- ? (
28
- <svg
29
- xmlns="http://www.w3.org/2000/svg"
30
- xmlns:xlink="http://www.w3.org/1999/xlink"
31
- role="img"
32
- width="1em"
33
- height="1em"
34
- viewBox="0 0 24 24"
35
- >
36
- <path
37
- fill="currentColor"
38
- d="M12 15q1.25 0 2.125-.875T15 12q0-1.25-.875-2.125T12 9q-1.25 0-2.125.875T9 12q0 1.25.875 2.125T12 15Zm0 2q-2.075 0-3.537-1.463Q7 14.075 7 12t1.463-3.538Q9.925 7 12 7t3.538 1.462Q17 9.925 17 12q0 2.075-1.462 3.537Q14.075 17 12 17ZM1 13v-2h4v2Zm18 0v-2h4v2Zm-8-8V1h2v4Zm0 18v-4h2v4ZM6.35 7.75L3.875 5.275l1.4-1.4L7.75 6.35Zm12.375 12.375L16.25 17.65l1.4-1.4l2.475 2.475ZM17.65 7.75l-1.4-1.4l2.475-2.475l1.4 1.4ZM5.275 20.125l-1.4-1.4L6.35 16.25l1.4 1.4ZM12 12Z"
39
- />
40
- </svg>
41
- )
42
- : props.mode === 'dark'
43
- ? (
44
- <svg
45
- xmlns="http://www.w3.org/2000/svg"
46
- xmlns:xlink="http://www.w3.org/1999/xlink"
47
- role="img"
48
- width="1em"
49
- height="1em"
50
- viewBox="0 0 24 24"
51
- >
52
- <path
53
- fill="currentColor"
54
- d="M12 21q-3.75 0-6.375-2.625T3 12q0-3.75 2.625-6.375T12 3q.35 0 .688.025q.337.025.662.075q-1.025.725-1.637 1.887Q11.1 6.15 11.1 7.5q0 2.25 1.575 3.825Q14.25 12.9 16.5 12.9q1.375 0 2.525-.613q1.15-.612 1.875-1.637q.05.325.075.662Q21 11.65 21 12q0 3.75-2.625 6.375T12 21Zm0-2q2.2 0 3.95-1.212q1.75-1.213 2.55-3.163q-.5.125-1 .2q-.5.075-1 .075q-3.075 0-5.238-2.162Q9.1 10.575 9.1 7.5q0-.5.075-1t.2-1q-1.95.8-3.162 2.55Q5 9.8 5 12q0 2.9 2.05 4.95Q9.1 19 12 19Zm-.25-6.75Z"
55
- />
56
- </svg>
57
- )
58
- : (
59
- <svg
60
- xmlns="http://www.w3.org/2000/svg"
61
- xmlns:xlink="http://www.w3.org/1999/xlink"
62
- role="img"
63
- width="1em"
64
- height="1em"
65
- viewBox="0 0 24 24"
66
- >
67
- <path
68
- fill="currentColor"
69
- d="M11 19q1.35 0 2.513-.538q1.162-.537 1.987-1.487q-3.15-.2-5.325-2.488Q8 12.2 8 9q0-.325.025-.638q.025-.312.075-.612q-1.4.775-2.25 2.162Q5 11.3 5 13q0 2.5 1.75 4.25T11 19Zm0 2q-3.35 0-5.675-2.325Q3 16.35 3 13q0-3.35 2.325-5.675Q7.65 5 11 5q.125 0 .25.012q.125.013.25.013q-.725.8-1.113 1.812Q10 7.85 10 9q0 2.5 1.75 4.25T16 15q.8 0 1.525-.2q.725-.2 1.375-.55q-.45 2.875-2.662 4.812Q14.025 21 11 21Zm2.8-10L17 2h2l3.2 9h-1.9l-.7-2h-3.2l-.7 2Zm3.05-3.35h2.3L18 4Z"
70
- />
71
- </svg>
72
- )}
73
- </NIcon>
74
- </NButton>,
75
- [
76
- [
77
- vTooltip,
78
- props.mode === 'light'
79
- ? t('common.layout.mode.light')
80
- : props.mode === 'dark'
81
- ? t('common.layout.mode.dark')
82
- : t('common.layout.mode.auto'),
83
- undefined,
84
- { bottom: true },
85
- ],
86
- ],
87
- )
88
- },
89
- })
@@ -1,67 +0,0 @@
1
- import { NBreadcrumb, NBreadcrumbItem, NIcon } from 'ithinkdt-ui'
2
- import { defineComponent, toValue, watch } from 'vue'
3
- import { useRouter } from 'vue-router'
4
-
5
- import { walkTree } from '@ithinkdt/common/tree'
6
-
7
- import { IBookmark } from './common.jsx'
8
-
9
- export const AppBreadcrumb = /* @__PURE__ */ defineComponent({
10
- name: 'AppBreadcrumb',
11
- props: {
12
- items: { type: Array, default: () => [] },
13
- getIcon: { type: Function, default: undefined },
14
- },
15
- setup(props) {
16
- const router = useRouter()
17
- const iconContent = Symbol()
18
- const iconRenderer = Symbol()
19
- watch(
20
- () => props.items,
21
- (items) => {
22
- walkTree(items, (item) => {
23
- if (item.icon) {
24
- if (typeof item.icon === 'string') {
25
- item[iconContent] = props.getIcon?.(item.icon)
26
- item[iconRenderer] = () => {
27
- return item[iconContent]?.() || IBookmark()
28
- }
29
- } else {
30
- item[iconRenderer] = item.icon
31
- }
32
- }
33
- })
34
- },
35
- { immediate: true },
36
- )
37
- return () => {
38
- return (
39
- <NBreadcrumb>
40
- {props.items.map(item => (
41
- <NBreadcrumbItem
42
- clickable={item.href?.length > 0}
43
- separator={item.separator}
44
- onClick={
45
- item.href
46
- && ((evt) => {
47
- evt.stopPropagation()
48
- router.push(item.href)
49
- })
50
- }
51
- >
52
- {item.icon
53
- ? (
54
- <>
55
- <NIcon component={item[iconRenderer]} />
56
- {' '}
57
- </>
58
- )
59
- : undefined}
60
- {toValue(item.title)}
61
- </NBreadcrumbItem>
62
- ))}
63
- </NBreadcrumb>
64
- )
65
- }
66
- },
67
- })
@@ -1,65 +0,0 @@
1
- import { useFullscreen } from '@vueuse/core'
2
- import { NButton, NIcon } from 'ithinkdt-ui'
3
- import { defineComponent, withDirectives } from 'vue'
4
-
5
- import { vTooltip } from '../directives/tooltip.jsx'
6
- import { useI18n } from '../use-i18n.js'
7
-
8
- export const AppFullscreen = /* @__PURE__ */ defineComponent({
9
- name: 'AppFullscreen',
10
- props: {},
11
- emit: ['change'],
12
- setup(_props, { emit }) {
13
- const { t } = useI18n()
14
-
15
- const { isFullscreen, toggle } = useFullscreen()
16
-
17
- return () =>
18
- withDirectives(
19
- <NButton
20
- quaternary
21
- style="--n-padding: 0 12px"
22
- onClick={() => {
23
- toggle()
24
- emit('change', isFullscreen.value)
25
- }}
26
- >
27
- <NIcon size="18">
28
- {isFullscreen.value
29
- ? (
30
- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
31
- <path
32
- fill="none"
33
- stroke="currentColor"
34
- stroke-linecap="round"
35
- stroke-linejoin="round"
36
- stroke-width="1.5"
37
- d="M8.345 3.75v2.095a2.5 2.5 0 0 1-2.5 2.5H3.75M8.345 20.25v-2.095a2.5 2.5 0 0 0-2.5-2.5H3.75M15.655 3.75v2.095a2.5 2.5 0 0 0 2.5 2.5h2.095M15.655 20.25v-2.095a2.5 2.5 0 0 1 2.5-2.5h2.095"
38
- />
39
- </svg>
40
- )
41
- : (
42
- <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
43
- <path
44
- fill="none"
45
- stroke="currentColor"
46
- stroke-linecap="round"
47
- stroke-linejoin="round"
48
- stroke-width="1.5"
49
- d="M3.75 8.345V6.25a2.5 2.5 0 0 1 2.5-2.5h2.095M3.75 15.655v2.095a2.5 2.5 0 0 0 2.5 2.5h2.095M20.25 8.345V6.25a2.5 2.5 0 0 0-2.5-2.5h-2.095m4.595 11.905v2.095a2.5 2.5 0 0 1-2.5 2.5h-2.095"
50
- />
51
- </svg>
52
- )}
53
- </NIcon>
54
- </NButton>,
55
- [
56
- [
57
- vTooltip,
58
- isFullscreen.value ? t('common.layout.screen.exitfull') : t('common.layout.screen.full'),
59
- undefined,
60
- { bottom: true },
61
- ],
62
- ],
63
- )
64
- },
65
- })