vome-core 0.3.69 → 0.3.70

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 (278) hide show
  1. package/dist/admin/components/ui/avatar/Avatar.vue +18 -18
  2. package/dist/admin/components/ui/avatar/AvatarFallback.vue +21 -21
  3. package/dist/admin/components/ui/avatar/AvatarImage.vue +16 -16
  4. package/dist/admin/components/ui/avatar/index.js +1 -1
  5. package/dist/admin/components/ui/badge/Badge.vue +26 -26
  6. package/dist/admin/components/ui/button/Button.vue +31 -31
  7. package/dist/admin/components/ui/button/index.d.ts +1 -1
  8. package/dist/admin/components/ui/checkbox/Checkbox.vue +35 -35
  9. package/dist/admin/components/ui/checkbox/index.js +1 -1
  10. package/dist/admin/components/ui/dialog/Dialog.vue +19 -19
  11. package/dist/admin/components/ui/dialog/DialogClose.vue +15 -15
  12. package/dist/admin/components/ui/dialog/DialogContent.vue +267 -267
  13. package/dist/admin/components/ui/dialog/DialogDescription.vue +23 -23
  14. package/dist/admin/components/ui/dialog/DialogFooter.vue +27 -27
  15. package/dist/admin/components/ui/dialog/DialogHeader.vue +17 -17
  16. package/dist/admin/components/ui/dialog/DialogOverlay.vue +21 -21
  17. package/dist/admin/components/ui/dialog/DialogScrollContent.vue +60 -60
  18. package/dist/admin/components/ui/dialog/DialogTitle.vue +23 -23
  19. package/dist/admin/components/ui/dialog/DialogTrigger.vue +15 -15
  20. package/dist/admin/components/ui/dialog/index.js +1 -1
  21. package/dist/admin/components/ui/dropdown-menu/DropdownMenu.vue +19 -19
  22. package/dist/admin/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -39
  23. package/dist/admin/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -39
  24. package/dist/admin/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -15
  25. package/dist/admin/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -31
  26. package/dist/admin/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -23
  27. package/dist/admin/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -21
  28. package/dist/admin/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +40 -40
  29. package/dist/admin/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -23
  30. package/dist/admin/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -17
  31. package/dist/admin/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -18
  32. package/dist/admin/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -27
  33. package/dist/admin/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -31
  34. package/dist/admin/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -17
  35. package/dist/admin/components/ui/dropdown-menu/index.js +1 -1
  36. package/dist/admin/components/ui/input/Input.vue +183 -183
  37. package/dist/admin/components/ui/input/index.js +1 -1
  38. package/dist/admin/components/ui/label/Label.vue +26 -26
  39. package/dist/admin/components/ui/label/index.js +1 -1
  40. package/dist/admin/components/ui/scroll-area/ScrollArea.vue +33 -33
  41. package/dist/admin/components/ui/scroll-area/ScrollBar.vue +32 -32
  42. package/dist/admin/components/ui/scroll-area/index.js +1 -1
  43. package/dist/admin/components/ui/select/Select.vue +19 -19
  44. package/dist/admin/components/ui/select/SelectContent.vue +51 -51
  45. package/dist/admin/components/ui/select/SelectGroup.vue +15 -15
  46. package/dist/admin/components/ui/select/SelectItem.vue +53 -53
  47. package/dist/admin/components/ui/select/SelectItemText.vue +15 -15
  48. package/dist/admin/components/ui/select/SelectLabel.vue +17 -17
  49. package/dist/admin/components/ui/select/SelectScrollDownButton.vue +26 -26
  50. package/dist/admin/components/ui/select/SelectScrollUpButton.vue +26 -26
  51. package/dist/admin/components/ui/select/SelectSeparator.vue +19 -19
  52. package/dist/admin/components/ui/select/SelectTrigger.vue +44 -44
  53. package/dist/admin/components/ui/select/SelectValue.vue +15 -15
  54. package/dist/admin/components/ui/select/index.js +1 -1
  55. package/dist/admin/components/ui/separator/Separator.vue +29 -29
  56. package/dist/admin/components/ui/separator/index.js +1 -1
  57. package/dist/admin/components/ui/sheet/Sheet.vue +19 -19
  58. package/dist/admin/components/ui/sheet/SheetClose.vue +15 -15
  59. package/dist/admin/components/ui/sheet/SheetContent.vue +63 -63
  60. package/dist/admin/components/ui/sheet/SheetDescription.vue +21 -21
  61. package/dist/admin/components/ui/sheet/SheetFooter.vue +16 -16
  62. package/dist/admin/components/ui/sheet/SheetHeader.vue +15 -15
  63. package/dist/admin/components/ui/sheet/SheetOverlay.vue +21 -21
  64. package/dist/admin/components/ui/sheet/SheetTitle.vue +21 -21
  65. package/dist/admin/components/ui/sheet/SheetTrigger.vue +15 -15
  66. package/dist/admin/components/ui/sheet/index.js +1 -1
  67. package/dist/admin/components/ui/sonner/Toaster.vue +117 -117
  68. package/dist/admin/components/ui/sonner/index.js +1 -1
  69. package/dist/admin/components/ui/table/Table.vue +16 -16
  70. package/dist/admin/components/ui/table/TableBody.vue +17 -17
  71. package/dist/admin/components/ui/table/TableCaption.vue +17 -17
  72. package/dist/admin/components/ui/table/TableCell.vue +22 -22
  73. package/dist/admin/components/ui/table/TableEmpty.vue +34 -34
  74. package/dist/admin/components/ui/table/TableFooter.vue +17 -17
  75. package/dist/admin/components/ui/table/TableHead.vue +17 -17
  76. package/dist/admin/components/ui/table/TableHeader.vue +17 -17
  77. package/dist/admin/components/ui/table/TableRow.vue +17 -17
  78. package/dist/admin/components/ui/table/index.js +1 -1
  79. package/dist/admin/components/ui/tabs/Tabs.vue +24 -24
  80. package/dist/admin/components/ui/tabs/TabsContent.vue +21 -21
  81. package/dist/admin/components/ui/tabs/TabsList.vue +24 -24
  82. package/dist/admin/components/ui/tabs/TabsTrigger.vue +26 -26
  83. package/dist/admin/components/ui/tabs/index.js +1 -1
  84. package/dist/admin/components/ui/tooltip/Tooltip.vue +19 -19
  85. package/dist/admin/components/ui/tooltip/TooltipContent.vue +34 -34
  86. package/dist/admin/components/ui/tooltip/TooltipProvider.vue +14 -14
  87. package/dist/admin/components/ui/tooltip/TooltipTrigger.vue +15 -15
  88. package/dist/admin/components/ui/tooltip/index.js +1 -1
  89. package/dist/admin/components/vm-action-btn.vue +136 -136
  90. package/dist/admin/components/vm-aside-list-item.vue +136 -136
  91. package/dist/admin/components/vm-aside.vue +229 -229
  92. package/dist/admin/components/vm-auto-perm-dialog.vue +371 -371
  93. package/dist/admin/components/vm-card-grid.vue +37 -37
  94. package/dist/admin/components/vm-card-head.vue +45 -45
  95. package/dist/admin/components/vm-card-meta.vue +22 -22
  96. package/dist/admin/components/vm-card-title.vue +56 -56
  97. package/dist/admin/components/vm-card.vue +176 -176
  98. package/dist/admin/components/vm-check-tree.vue +340 -340
  99. package/dist/admin/components/vm-clamp-text.vue +39 -39
  100. package/dist/admin/components/vm-dept-tree.vue +497 -497
  101. package/dist/admin/components/vm-empty.vue +68 -68
  102. package/dist/admin/components/vm-eps-perm-picker.vue +123 -123
  103. package/dist/admin/components/vm-form-dialog.vue +632 -632
  104. package/dist/admin/components/vm-group-cascader.vue +560 -560
  105. package/dist/admin/components/vm-icon-btn.vue +88 -88
  106. package/dist/admin/components/vm-icon-picker.vue +647 -647
  107. package/dist/admin/components/vm-inline-search.vue +61 -61
  108. package/dist/admin/components/vm-loading.vue +114 -114
  109. package/dist/admin/components/vm-markdown.vue +405 -405
  110. package/dist/admin/components/vm-marquee.vue +265 -265
  111. package/dist/admin/components/vm-page-tabs.vue +94 -94
  112. package/dist/admin/components/vm-perm-section.vue +57 -57
  113. package/dist/admin/components/vm-ri-icon.vue +23 -23
  114. package/dist/admin/components/vm-role-picker.vue +314 -314
  115. package/dist/admin/components/vm-split-layout.vue +106 -106
  116. package/dist/admin/components/vm-thumb.vue +49 -49
  117. package/dist/admin/components/vm-view-path-picker.vue +59 -59
  118. package/dist/admin/crud/auto-fields.d.ts +7 -0
  119. package/dist/admin/crud/auto-fields.js +1 -1
  120. package/dist/admin/crud/components/vm-avatar.vue +104 -104
  121. package/dist/admin/crud/components/vm-color-picker.vue +1626 -1626
  122. package/dist/admin/crud/components/vm-column-custom.vue +193 -193
  123. package/dist/admin/crud/components/vm-context-menu.vue +105 -105
  124. package/dist/admin/crud/components/vm-copy-btn.vue +102 -102
  125. package/dist/admin/crud/components/vm-date-calendar-panel.vue +537 -537
  126. package/dist/admin/crud/components/vm-date-picker.vue +75 -75
  127. package/dist/admin/crud/components/vm-date-range.vue +88 -88
  128. package/dist/admin/crud/components/vm-date-text.vue +42 -42
  129. package/dist/admin/crud/components/vm-datetime-field.vue +215 -215
  130. package/dist/admin/crud/components/vm-datetime-picker.vue +9 -9
  131. package/dist/admin/crud/components/vm-dict-tag.vue +112 -112
  132. package/dist/admin/crud/components/vm-ellipsis-text.vue +34 -34
  133. package/dist/admin/crud/components/vm-form-hint.vue +81 -81
  134. package/dist/admin/crud/components/vm-json-code.vue +41 -41
  135. package/dist/admin/crud/components/vm-json-editor.vue +161 -161
  136. package/dist/admin/crud/components/vm-json-kv-editor.vue +318 -318
  137. package/dist/admin/crud/components/vm-kv-row.vue +51 -51
  138. package/dist/admin/crud/components/vm-multi-select.vue +279 -279
  139. package/dist/admin/crud/components/vm-number-range.vue +204 -204
  140. package/dist/admin/crud/components/vm-preview-viewer.vue +894 -894
  141. package/dist/admin/crud/components/vm-radio.vue +87 -87
  142. package/dist/admin/crud/components/vm-richtext.vue +313 -313
  143. package/dist/admin/crud/components/vm-select.vue +570 -570
  144. package/dist/admin/crud/components/vm-status-tag.vue +158 -158
  145. package/dist/admin/crud/components/vm-switch.vue +158 -158
  146. package/dist/admin/crud/components/vm-tag-list.vue +108 -108
  147. package/dist/admin/crud/components/vm-text-link.vue +52 -52
  148. package/dist/admin/crud/components/vm-toggle-switch.vue +84 -84
  149. package/dist/admin/crud/components/vm-tree-select.vue +450 -450
  150. package/dist/admin/crud/components/vm-upload-item.vue +298 -298
  151. package/dist/admin/crud/components/vm-upload.vue +436 -436
  152. package/dist/admin/crud/config.js +1 -1
  153. package/dist/admin/crud/confirm.js +1 -1
  154. package/dist/admin/crud/crud-page-request.js +1 -1
  155. package/dist/admin/crud/data-i18n.js +1 -1
  156. package/dist/admin/crud/dict.js +1 -1
  157. package/dist/admin/crud/export-fetch.js +1 -1
  158. package/dist/admin/crud/index.d.ts +1 -1
  159. package/dist/admin/crud/index.js +1 -0
  160. package/dist/admin/crud/key.js +1 -1
  161. package/dist/admin/crud/plugins.js +1 -1
  162. package/dist/admin/crud/span.js +1 -1
  163. package/dist/admin/crud/style.js +1 -1
  164. package/dist/admin/crud/validate.js +1 -1
  165. package/dist/admin/crud/vm-add-btn.vue +70 -70
  166. package/dist/admin/crud/vm-adv-search.vue +83 -83
  167. package/dist/admin/crud/vm-crud.vue +711 -711
  168. package/dist/admin/crud/vm-data-i18n-btn.vue +456 -456
  169. package/dist/admin/crud/vm-data-i18n-lang.vue +183 -183
  170. package/dist/admin/crud/vm-export-btn.vue +183 -183
  171. package/dist/admin/crud/vm-flex.vue +14 -14
  172. package/dist/admin/crud/vm-import-btn.vue +747 -747
  173. package/dist/admin/crud/vm-multi-delete-btn.vue +49 -49
  174. package/dist/admin/crud/vm-pagination.vue +212 -212
  175. package/dist/admin/crud/vm-refresh-btn.vue +35 -35
  176. package/dist/admin/crud/vm-row.vue +55 -55
  177. package/dist/admin/crud/vm-search-key.vue +78 -78
  178. package/dist/admin/crud/vm-search.vue +466 -466
  179. package/dist/admin/crud/vm-table.vue +1390 -1390
  180. package/dist/admin/crud/vm-tabs.vue +94 -94
  181. package/dist/admin/crud/vm-toolbar.vue +357 -357
  182. package/dist/admin/crud/vm-upsert.vue +765 -765
  183. package/dist/admin/directives/perm.js +1 -1
  184. package/dist/admin/env.d.ts +1 -1
  185. package/dist/admin/hooks/useUpload.js +1 -1
  186. package/dist/admin/hooks/useVome.d.ts +2 -2
  187. package/dist/admin/lib/browser.js +1 -1
  188. package/dist/admin/lib/cn.js +1 -1
  189. package/dist/admin/lib/dialog-float.js +1 -1
  190. package/dist/admin/lib/export-excel.js +1 -1
  191. package/dist/admin/lib/import-excel.js +1 -1
  192. package/dist/admin/lib/json.js +1 -1
  193. package/dist/admin/lib/menu.js +1 -1
  194. package/dist/admin/lib/micro-locale.js +1 -1
  195. package/dist/admin/lib/micro-theme.js +1 -1
  196. package/dist/admin/lib/shell.js +1 -1
  197. package/dist/admin/lib/theme-color-options.js +1 -1
  198. package/dist/admin/lib/tree.js +1 -1
  199. package/dist/admin/lib/upload.js +1 -1
  200. package/dist/admin/lib/video-frame.js +1 -1
  201. package/dist/admin/router/create.js +1 -1
  202. package/dist/admin/router/guards.js +1 -1
  203. package/dist/admin/stores/app.d.ts +13 -1
  204. package/dist/admin/stores/tags.d.ts +14 -1
  205. package/dist/admin/stores/user.d.ts +48 -1
  206. package/dist/admin/styles/base.css +121 -121
  207. package/dist/admin/vendor/browser-image-compression.js +1144 -1144
  208. package/dist/admin/vendor/decimal-js.js +12 -12
  209. package/dist/admin/vendor/xlsx.js +263 -263
  210. package/dist/ai/index.js +1 -1
  211. package/dist/client/ai-model-registry.js +1 -1
  212. package/dist/client/base.js +1 -1
  213. package/dist/client/configure.js +1 -1
  214. package/dist/client/dict.js +1 -1
  215. package/dist/client/eps-payload.js +1 -1
  216. package/dist/client/eps.d.ts +7 -4
  217. package/dist/client/eps.js +1 -1
  218. package/dist/client/index.d.ts +1 -1
  219. package/dist/client/index.js +1 -1
  220. package/dist/client/locale-change.js +1 -1
  221. package/dist/client/locale-store.d.ts +45 -1
  222. package/dist/client/locale-store.js +1 -1
  223. package/dist/client/path.js +1 -1
  224. package/dist/client/service.d.ts +8 -0
  225. package/dist/client/service.js +1 -1
  226. package/dist/client/vite-admin.js +1 -1
  227. package/dist/client/vite-auto-import.js +1 -1
  228. package/dist/client/vite-micro-proxy.js +1 -1
  229. package/dist/client/vite-plugin-eps.d.ts +5 -0
  230. package/dist/client/vite-plugin-eps.js +1 -1
  231. package/dist/client/vite-resolve.js +1 -1
  232. package/dist/config/index.js +1 -1
  233. package/dist/core/index.d.ts +2 -2
  234. package/dist/index.js +1 -1
  235. package/dist/routing/context.d.ts +12 -2
  236. package/dist/routing/eps.d.ts +4 -1
  237. package/dist/routing/index.d.ts +2 -1
  238. package/dist/routing/metadata.d.ts +7 -3
  239. package/dist/server/index.d.ts +2 -2
  240. package/dist/server/index.js +1 -1
  241. package/dist/shared/datetime-picker.js +1 -1
  242. package/dist/shared/decimal.js +1 -1
  243. package/dist/shared/excel.js +1 -1
  244. package/dist/shared/index.js +1 -1
  245. package/dist/shared/locale-json.js +1 -1
  246. package/dist/shared/tree.js +1 -1
  247. package/dist/typings/routing/eps.d.ts +3 -1
  248. package/dist/typings/routing/meta.d.ts +15 -0
  249. package/package.json +1 -1
  250. package/typings/admin/base/auth.ts +24 -24
  251. package/typings/admin/base/permission.ts +19 -19
  252. package/typings/admin/comm/cascader.ts +7 -7
  253. package/typings/admin/comm/check-tree.ts +7 -7
  254. package/typings/admin/comm/crud.ts +427 -427
  255. package/typings/admin/comm/eps.ts +88 -86
  256. package/typings/admin/comm/request.ts +16 -16
  257. package/typings/admin/comm/service.ts +43 -43
  258. package/typings/admin/comm/upload.ts +39 -39
  259. package/typings/admin/theme.ts +10 -10
  260. package/typings/admin/vome/browser.ts +11 -11
  261. package/typings/admin/vome/module.ts +13 -13
  262. package/typings/admin/vome/tags.ts +9 -9
  263. package/typings/comm/crud.ts +83 -83
  264. package/typings/comm/page.ts +18 -18
  265. package/typings/comm/scan.ts +6 -6
  266. package/typings/common.ts +4 -4
  267. package/typings/context/data.ts +10 -10
  268. package/typings/ext/market-seat.ts +42 -42
  269. package/typings/ext/market.ts +55 -55
  270. package/typings/ext/module.ts +64 -64
  271. package/typings/ext/plugin.ts +38 -38
  272. package/typings/ioc/metadata.ts +34 -34
  273. package/typings/logger/config.ts +6 -6
  274. package/typings/routing/crud.ts +199 -199
  275. package/typings/routing/eps.ts +90 -88
  276. package/typings/routing/meta.ts +80 -63
  277. package/typings/routing/register.ts +21 -21
  278. package/typings/routing/scan-context.ts +7 -7
@@ -1,183 +1,183 @@
1
- <script setup lang="ts">
2
- import { crudLabel } from '../../../crud/style'
3
- import type { HTMLAttributes } from "vue"
4
- import { computed } from "vue"
5
- import { useVModel } from "@vueuse/core"
6
- import { cn } from "../../../lib/cn"
7
-
8
- const props = withDefaults(
9
- defineProps<{
10
- defaultValue?: string | number
11
- modelValue?: string | number | null
12
- class?: HTMLAttributes["class"]
13
- /** 原生 input type;数字用 number */
14
- type?: string
15
- /** 小数位数;blur 时按位四舍五入(仅 type=number) */
16
- precision?: number
17
- /**
18
- * 是否显示 number 步进器;false 隐藏(对齐常见 InputNumber.controls)
19
- * 默认 true(保持原生外观);业务常传 false
20
- */
21
- controls?: boolean
22
- step?: string | number
23
- placeholder?: string
24
- disabled?: boolean
25
- /** 有值时显示清除;默认 true(password 除外) */
26
- clearable?: boolean
27
- }>(),
28
- {
29
- controls: true,
30
- clearable: undefined,
31
- },
32
- )
33
-
34
- const emits = defineEmits<{
35
- (e: "update:modelValue", payload: string | number | null): void
36
- }>()
37
-
38
- const modelValue = useVModel(props, "modelValue", emits, {
39
- passive: true,
40
- defaultValue: props.defaultValue,
41
- })
42
-
43
- const isNumber = computed(() => props.type === "number")
44
- const isPassword = computed(() => props.type === "password")
45
- const showClear = computed(() => {
46
- if (props.disabled || isPassword.value) return false
47
- const on = props.clearable !== false
48
- if (!on) return false
49
- const v = modelValue.value
50
- return v != null && v !== ""
51
- })
52
- const hideControls = computed(
53
- () => isNumber.value && props.controls === false,
54
- )
55
-
56
- /** number 未显式传 step 时,按 precision 生成(避免原生默认 step=1 挡小数) */
57
- const resolvedStep = computed(() => {
58
- if (!isNumber.value) return props.step
59
- if (props.step != null && props.step !== "") return props.step
60
- if (props.precision == null) return "any"
61
- const p = Math.max(0, Math.floor(props.precision))
62
- if (p === 0) return 1
63
- return (1 / 10 ** p).toFixed(p)
64
- })
65
-
66
- function roundToPrecision(n: number) {
67
- if (props.precision == null || !Number.isFinite(n)) return n
68
- const p = Math.max(0, Math.floor(props.precision))
69
- const f = 10 ** p
70
- return Math.round(n * f) / f
71
- }
72
-
73
- function onUpdate(raw: string | number) {
74
- if (!isNumber.value) {
75
- modelValue.value = raw
76
- return
77
- }
78
- if (raw === "" || raw == null) {
79
- modelValue.value = null
80
- return
81
- }
82
- const n = typeof raw === "number" ? raw : Number(raw)
83
- modelValue.value = Number.isFinite(n) ? n : raw
84
- }
85
-
86
- function onBlur() {
87
- if (!isNumber.value || props.precision == null) return
88
- const cur = modelValue.value
89
- if (cur == null || cur === "") return
90
- const n = typeof cur === "number" ? cur : Number(cur)
91
- if (!Number.isFinite(n)) return
92
- modelValue.value = roundToPrecision(n)
93
- }
94
-
95
- function clear() {
96
- modelValue.value = isNumber.value ? null : ""
97
- }
98
- </script>
99
-
100
- <template>
101
- <div
102
- data-slot="input-wrap"
103
- :class="cn('vm-input-wrap', showClear && 'has-clear', props.class)"
104
- >
105
- <input
106
- data-slot="input"
107
- :type="type"
108
- :step="resolvedStep"
109
- :placeholder="placeholder"
110
- :disabled="disabled"
111
- :value="modelValue ?? ''"
112
- :class="cn(
113
- 'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-[var(--vm-control-height)] w-full min-w-0 rounded-[var(--vm-control-radius)] border bg-transparent px-[var(--vm-control-padding-x)] py-0 text-sm shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
114
- 'focus-visible:border-[var(--focus-border)] focus-visible:ring-0 focus-visible:shadow-none',
115
- 'aria-invalid:border-destructive aria-invalid:ring-0',
116
- hideControls && 'is-no-controls',
117
- showClear && 'is-clearable',
118
- )"
119
- @input="onUpdate(($event.target as HTMLInputElement).value)"
120
- @blur="onBlur"
121
- >
122
- <i
123
- v-if="showClear"
124
- class="ri-close-circle-fill vm-input-wrap__clear"
125
- role="button"
126
- tabindex="-1"
127
- :aria-label="crudLabel('clear')"
128
- @mousedown.prevent
129
- @click="clear"
130
- />
131
- </div>
132
- </template>
133
-
134
- <style scoped>
135
- /* controls: false → 隐藏原生 number 步进器 */
136
- input.is-no-controls[type='number'] {
137
- -moz-appearance: textfield;
138
- }
139
- input.is-no-controls[type='number']::-webkit-outer-spin-button,
140
- input.is-no-controls[type='number']::-webkit-inner-spin-button {
141
- -webkit-appearance: none;
142
- margin: 0;
143
- }
144
-
145
- .vm-input-wrap {
146
- position: relative;
147
- box-sizing: border-box;
148
- width: 100%;
149
- min-width: 0;
150
- }
151
-
152
- .vm-input-wrap input.is-clearable {
153
- padding-right: 28px;
154
- }
155
-
156
- .vm-input-wrap__clear {
157
- position: absolute;
158
- top: 50%;
159
- right: var(--vm-control-padding-x);
160
- z-index: 1;
161
- color: var(--muted-foreground);
162
- font-size: 14px;
163
- line-height: 1;
164
- cursor: pointer;
165
- transform: translateY(-50%);
166
- }
167
-
168
- .vm-input-wrap__clear:hover {
169
- color: var(--foreground);
170
- }
171
- </style>
172
-
173
- <style>
174
- /* 与 CRUD 表单控件高度约定对齐(原 base.css data-slot 规则) */
175
- [data-slot='input'] {
176
- height: var(--vm-control-height) !important;
177
- min-height: var(--vm-control-height);
178
- padding-top: 0 !important;
179
- padding-bottom: 0 !important;
180
- font-size: var(--vm-control-font-size) !important;
181
- line-height: 1.4;
182
- }
183
- </style>
1
+ <script setup lang="ts">
2
+ import { crudLabel } from '../../../crud/style'
3
+ import type { HTMLAttributes } from "vue"
4
+ import { computed } from "vue"
5
+ import { useVModel } from "@vueuse/core"
6
+ import { cn } from "../../../lib/cn"
7
+
8
+ const props = withDefaults(
9
+ defineProps<{
10
+ defaultValue?: string | number
11
+ modelValue?: string | number | null
12
+ class?: HTMLAttributes["class"]
13
+ /** 原生 input type;数字用 number */
14
+ type?: string
15
+ /** 小数位数;blur 时按位四舍五入(仅 type=number) */
16
+ precision?: number
17
+ /**
18
+ * 是否显示 number 步进器;false 隐藏(对齐常见 InputNumber.controls)
19
+ * 默认 true(保持原生外观);业务常传 false
20
+ */
21
+ controls?: boolean
22
+ step?: string | number
23
+ placeholder?: string
24
+ disabled?: boolean
25
+ /** 有值时显示清除;默认 true(password 除外) */
26
+ clearable?: boolean
27
+ }>(),
28
+ {
29
+ controls: true,
30
+ clearable: undefined,
31
+ },
32
+ )
33
+
34
+ const emits = defineEmits<{
35
+ (e: "update:modelValue", payload: string | number | null): void
36
+ }>()
37
+
38
+ const modelValue = useVModel(props, "modelValue", emits, {
39
+ passive: true,
40
+ defaultValue: props.defaultValue,
41
+ })
42
+
43
+ const isNumber = computed(() => props.type === "number")
44
+ const isPassword = computed(() => props.type === "password")
45
+ const showClear = computed(() => {
46
+ if (props.disabled || isPassword.value) return false
47
+ const on = props.clearable !== false
48
+ if (!on) return false
49
+ const v = modelValue.value
50
+ return v != null && v !== ""
51
+ })
52
+ const hideControls = computed(
53
+ () => isNumber.value && props.controls === false,
54
+ )
55
+
56
+ /** number 未显式传 step 时,按 precision 生成(避免原生默认 step=1 挡小数) */
57
+ const resolvedStep = computed(() => {
58
+ if (!isNumber.value) return props.step
59
+ if (props.step != null && props.step !== "") return props.step
60
+ if (props.precision == null) return "any"
61
+ const p = Math.max(0, Math.floor(props.precision))
62
+ if (p === 0) return 1
63
+ return (1 / 10 ** p).toFixed(p)
64
+ })
65
+
66
+ function roundToPrecision(n: number) {
67
+ if (props.precision == null || !Number.isFinite(n)) return n
68
+ const p = Math.max(0, Math.floor(props.precision))
69
+ const f = 10 ** p
70
+ return Math.round(n * f) / f
71
+ }
72
+
73
+ function onUpdate(raw: string | number) {
74
+ if (!isNumber.value) {
75
+ modelValue.value = raw
76
+ return
77
+ }
78
+ if (raw === "" || raw == null) {
79
+ modelValue.value = null
80
+ return
81
+ }
82
+ const n = typeof raw === "number" ? raw : Number(raw)
83
+ modelValue.value = Number.isFinite(n) ? n : raw
84
+ }
85
+
86
+ function onBlur() {
87
+ if (!isNumber.value || props.precision == null) return
88
+ const cur = modelValue.value
89
+ if (cur == null || cur === "") return
90
+ const n = typeof cur === "number" ? cur : Number(cur)
91
+ if (!Number.isFinite(n)) return
92
+ modelValue.value = roundToPrecision(n)
93
+ }
94
+
95
+ function clear() {
96
+ modelValue.value = isNumber.value ? null : ""
97
+ }
98
+ </script>
99
+
100
+ <template>
101
+ <div
102
+ data-slot="input-wrap"
103
+ :class="cn('vm-input-wrap', showClear && 'has-clear', props.class)"
104
+ >
105
+ <input
106
+ data-slot="input"
107
+ :type="type"
108
+ :step="resolvedStep"
109
+ :placeholder="placeholder"
110
+ :disabled="disabled"
111
+ :value="modelValue ?? ''"
112
+ :class="cn(
113
+ 'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-[var(--vm-control-height)] w-full min-w-0 rounded-[var(--vm-control-radius)] border bg-transparent px-[var(--vm-control-padding-x)] py-0 text-sm shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
114
+ 'focus-visible:border-[var(--focus-border)] focus-visible:ring-0 focus-visible:shadow-none',
115
+ 'aria-invalid:border-destructive aria-invalid:ring-0',
116
+ hideControls && 'is-no-controls',
117
+ showClear && 'is-clearable',
118
+ )"
119
+ @input="onUpdate(($event.target as HTMLInputElement).value)"
120
+ @blur="onBlur"
121
+ >
122
+ <i
123
+ v-if="showClear"
124
+ class="ri-close-circle-fill vm-input-wrap__clear"
125
+ role="button"
126
+ tabindex="-1"
127
+ :aria-label="crudLabel('clear')"
128
+ @mousedown.prevent
129
+ @click="clear"
130
+ />
131
+ </div>
132
+ </template>
133
+
134
+ <style scoped>
135
+ /* controls: false → 隐藏原生 number 步进器 */
136
+ input.is-no-controls[type='number'] {
137
+ -moz-appearance: textfield;
138
+ }
139
+ input.is-no-controls[type='number']::-webkit-outer-spin-button,
140
+ input.is-no-controls[type='number']::-webkit-inner-spin-button {
141
+ -webkit-appearance: none;
142
+ margin: 0;
143
+ }
144
+
145
+ .vm-input-wrap {
146
+ position: relative;
147
+ box-sizing: border-box;
148
+ width: 100%;
149
+ min-width: 0;
150
+ }
151
+
152
+ .vm-input-wrap input.is-clearable {
153
+ padding-right: 28px;
154
+ }
155
+
156
+ .vm-input-wrap__clear {
157
+ position: absolute;
158
+ top: 50%;
159
+ right: var(--vm-control-padding-x);
160
+ z-index: 1;
161
+ color: var(--muted-foreground);
162
+ font-size: 14px;
163
+ line-height: 1;
164
+ cursor: pointer;
165
+ transform: translateY(-50%);
166
+ }
167
+
168
+ .vm-input-wrap__clear:hover {
169
+ color: var(--foreground);
170
+ }
171
+ </style>
172
+
173
+ <style>
174
+ /* 与 CRUD 表单控件高度约定对齐(原 base.css data-slot 规则) */
175
+ [data-slot='input'] {
176
+ height: var(--vm-control-height) !important;
177
+ min-height: var(--vm-control-height);
178
+ padding-top: 0 !important;
179
+ padding-bottom: 0 !important;
180
+ font-size: var(--vm-control-font-size) !important;
181
+ line-height: 1.4;
182
+ }
183
+ </style>
@@ -1 +1 @@
1
- (function(_0x19ae6f,_0x15032f){var _0x329b1a=_0x2ac6,_0x520567=_0x19ae6f();while(!![]){try{var _0x5ac8b0=-parseInt(_0x329b1a(0x7e))/0x1*(-parseInt(_0x329b1a(0x75))/0x2)+parseInt(_0x329b1a(0x7d))/0x3*(-parseInt(_0x329b1a(0x78))/0x4)+parseInt(_0x329b1a(0x74))/0x5+-parseInt(_0x329b1a(0x77))/0x6*(parseInt(_0x329b1a(0x76))/0x7)+parseInt(_0x329b1a(0x7c))/0x8*(-parseInt(_0x329b1a(0x7a))/0x9)+-parseInt(_0x329b1a(0x7b))/0xa+parseInt(_0x329b1a(0x79))/0xb;if(_0x5ac8b0===_0x15032f)break;else _0x520567['push'](_0x520567['shift']());}catch(_0x4a0715){_0x520567['push'](_0x520567['shift']());}}}(_0x59a0,0x297ad));export{default as Input}from'./Input.vue';function _0x2ac6(_0x105e9c,_0x355048){_0x105e9c=_0x105e9c-0x74;var _0x59a0b6=_0x59a0();var _0x2ac6a3=_0x59a0b6[_0x105e9c];if(_0x2ac6['TDiPQK']===undefined){var _0x21f813=function(_0x3b50c7){var _0xef682e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x76a726='',_0x4980c0='';for(var _0x2a4a12=0x0,_0x5c67a0,_0x25e188,_0x1796e5=0x0;_0x25e188=_0x3b50c7['charAt'](_0x1796e5++);~_0x25e188&&(_0x5c67a0=_0x2a4a12%0x4?_0x5c67a0*0x40+_0x25e188:_0x25e188,_0x2a4a12++%0x4)?_0x76a726+=String['fromCharCode'](0xff&_0x5c67a0>>(-0x2*_0x2a4a12&0x6)):0x0){_0x25e188=_0xef682e['indexOf'](_0x25e188);}for(var _0xbdbda=0x0,_0x36f901=_0x76a726['length'];_0xbdbda<_0x36f901;_0xbdbda++){_0x4980c0+='%'+('00'+_0x76a726['charCodeAt'](_0xbdbda)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4980c0);};_0x2ac6['ASWYGj']=_0x21f813,_0x2ac6['XXVBMy']={},_0x2ac6['TDiPQK']=!![];}var _0x306f47=_0x59a0b6[0x0],_0x5653f2=_0x105e9c+_0x306f47,_0x33161b=_0x2ac6['XXVBMy'][_0x5653f2];return!_0x33161b?(_0x2ac6a3=_0x2ac6['ASWYGj'](_0x2ac6a3),_0x2ac6['XXVBMy'][_0x5653f2]=_0x2ac6a3):_0x2ac6a3=_0x33161b,_0x2ac6a3;}function _0x59a0(){var _0x206bb9=['mZeWmtq2mwjwr3Dwra','oxbewKDLva','mZm0ntG4mg9uB3j2CG','mtm3ndaWofn0EKXiEG','ndGZz01dCLzm','mtLqz0rwvKS','mtu5mZq0meTbvhjMqq','mtKZnJz0vKzMyMK','nZa5mufUuMzVCW','nde0DwnYzuvt','otu2v0neqxvH'];_0x59a0=function(){return _0x206bb9;};return _0x59a0();}
1
+ function _0x1dea(_0x459f24,_0x162f0c){_0x459f24=_0x459f24-0xb5;var _0x2312a1=_0x2312();var _0x1dea29=_0x2312a1[_0x459f24];if(_0x1dea['dbVpNn']===undefined){var _0x274d2f=function(_0x421e8f){var _0x44d07a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x5936ba='',_0x12ce73='';for(var _0x55980b=0x0,_0x1fcacb,_0xe3ba41,_0x5f5be5=0x0;_0xe3ba41=_0x421e8f['charAt'](_0x5f5be5++);~_0xe3ba41&&(_0x1fcacb=_0x55980b%0x4?_0x1fcacb*0x40+_0xe3ba41:_0xe3ba41,_0x55980b++%0x4)?_0x5936ba+=String['fromCharCode'](0xff&_0x1fcacb>>(-0x2*_0x55980b&0x6)):0x0){_0xe3ba41=_0x44d07a['indexOf'](_0xe3ba41);}for(var _0x4176a2=0x0,_0x50c88b=_0x5936ba['length'];_0x4176a2<_0x50c88b;_0x4176a2++){_0x12ce73+='%'+('00'+_0x5936ba['charCodeAt'](_0x4176a2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x12ce73);};_0x1dea['BpzOti']=_0x274d2f,_0x1dea['NzXGXV']={},_0x1dea['dbVpNn']=!![];}var _0x2db610=_0x2312a1[0x0],_0x26e75f=_0x459f24+_0x2db610,_0x19166b=_0x1dea['NzXGXV'][_0x26e75f];return!_0x19166b?(_0x1dea29=_0x1dea['BpzOti'](_0x1dea29),_0x1dea['NzXGXV'][_0x26e75f]=_0x1dea29):_0x1dea29=_0x19166b,_0x1dea29;}(function(_0x2d6d72,_0x5131d3){var _0x478d2f=_0x1dea,_0x57145e=_0x2d6d72();while(!![]){try{var _0x55b5bc=parseInt(_0x478d2f(0xb9))/0x1*(-parseInt(_0x478d2f(0xb7))/0x2)+parseInt(_0x478d2f(0xbd))/0x3+-parseInt(_0x478d2f(0xb8))/0x4+-parseInt(_0x478d2f(0xba))/0x5+-parseInt(_0x478d2f(0xb6))/0x6*(-parseInt(_0x478d2f(0xbc))/0x7)+-parseInt(_0x478d2f(0xb5))/0x8*(-parseInt(_0x478d2f(0xbe))/0x9)+parseInt(_0x478d2f(0xbb))/0xa;if(_0x55b5bc===_0x5131d3)break;else _0x57145e['push'](_0x57145e['shift']());}catch(_0x127678){_0x57145e['push'](_0x57145e['shift']());}}}(_0x2312,0xe5f61));function _0x2312(){var _0x185395=['nJq2mtqZmfjRD0X2vq','nJKZoti0BMXNv1Pm','ndq5mZa0nM9wDLzxrW','ndvkwLv3Eg4','mteYmZy4ofzpzerpqW','mte0y0D0zK1z','mtGZnZC3og9Ju1bMwq','mJuXmJmXnLnlrvrrBq','mMLfAwTNvq','nJyWotmWme13wvH5uW'];_0x2312=function(){return _0x185395;};return _0x2312();}export{default as Input}from'./Input.vue';
@@ -1,26 +1,26 @@
1
- <script setup lang="ts">
2
- import type { LabelProps } from "reka-ui"
3
- import type { HTMLAttributes } from "vue"
4
- import { reactiveOmit } from "@vueuse/core"
5
- import { Label } from "reka-ui"
6
- import { cn } from "../../../lib/cn"
7
-
8
- const props = defineProps<LabelProps & { class?: HTMLAttributes["class"] }>()
9
-
10
- const delegatedProps = reactiveOmit(props, "class")
11
- </script>
12
-
13
- <template>
14
- <Label
15
- data-slot="label"
16
- v-bind="delegatedProps"
17
- :class="
18
- cn(
19
- 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
20
- props.class,
21
- )
22
- "
23
- >
24
- <slot />
25
- </Label>
26
- </template>
1
+ <script setup lang="ts">
2
+ import type { LabelProps } from "reka-ui"
3
+ import type { HTMLAttributes } from "vue"
4
+ import { reactiveOmit } from "@vueuse/core"
5
+ import { Label } from "reka-ui"
6
+ import { cn } from "../../../lib/cn"
7
+
8
+ const props = defineProps<LabelProps & { class?: HTMLAttributes["class"] }>()
9
+
10
+ const delegatedProps = reactiveOmit(props, "class")
11
+ </script>
12
+
13
+ <template>
14
+ <Label
15
+ data-slot="label"
16
+ v-bind="delegatedProps"
17
+ :class="
18
+ cn(
19
+ 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
20
+ props.class,
21
+ )
22
+ "
23
+ >
24
+ <slot />
25
+ </Label>
26
+ </template>
@@ -1 +1 @@
1
- function _0x3110(){var _0x205e93=['mZi2ndC3neXoy2jYyq','mJG5ndqWouftv2XUDG','mte1mZm0nhz3zxv3EG','mtbWtfDNuNG','mtj3uwLVvhG','mtmZodK4BhDMsujw','mJK0nZy1ntb3EMfAwLa','mJmXotK3nfL0z0nVuW','mtC2oteZBgvVyvrX','ntm2rMvKz29f'];_0x3110=function(){return _0x205e93;};return _0x3110();}(function(_0x338571,_0x15444b){var _0x4c4bee=_0x353b,_0xc20f64=_0x338571();while(!![]){try{var _0x33e15e=-parseInt(_0x4c4bee(0xd2))/0x1+-parseInt(_0x4c4bee(0xd4))/0x2+-parseInt(_0x4c4bee(0xcf))/0x3*(-parseInt(_0x4c4bee(0xd1))/0x4)+-parseInt(_0x4c4bee(0xd0))/0x5*(parseInt(_0x4c4bee(0xcd))/0x6)+parseInt(_0x4c4bee(0xce))/0x7+-parseInt(_0x4c4bee(0xd6))/0x8*(parseInt(_0x4c4bee(0xd5))/0x9)+parseInt(_0x4c4bee(0xd3))/0xa;if(_0x33e15e===_0x15444b)break;else _0xc20f64['push'](_0xc20f64['shift']());}catch(_0x2000a3){_0xc20f64['push'](_0xc20f64['shift']());}}}(_0x3110,0xc70dc));function _0x353b(_0x19362f,_0x2bc3d9){_0x19362f=_0x19362f-0xcd;var _0x31102f=_0x3110();var _0x353b08=_0x31102f[_0x19362f];if(_0x353b['FUgIjo']===undefined){var _0x293d87=function(_0x1bd156){var _0x17eab4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x4bcce8='',_0x2bc5fe='';for(var _0xdc5760=0x0,_0x516950,_0xfde5de,_0x3bc74d=0x0;_0xfde5de=_0x1bd156['charAt'](_0x3bc74d++);~_0xfde5de&&(_0x516950=_0xdc5760%0x4?_0x516950*0x40+_0xfde5de:_0xfde5de,_0xdc5760++%0x4)?_0x4bcce8+=String['fromCharCode'](0xff&_0x516950>>(-0x2*_0xdc5760&0x6)):0x0){_0xfde5de=_0x17eab4['indexOf'](_0xfde5de);}for(var _0x92e091=0x0,_0x2ed084=_0x4bcce8['length'];_0x92e091<_0x2ed084;_0x92e091++){_0x2bc5fe+='%'+('00'+_0x4bcce8['charCodeAt'](_0x92e091)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2bc5fe);};_0x353b['wVWArI']=_0x293d87,_0x353b['sowcXi']={},_0x353b['FUgIjo']=!![];}var _0x249a56=_0x31102f[0x0],_0x106a22=_0x19362f+_0x249a56,_0x28fdf1=_0x353b['sowcXi'][_0x106a22];return!_0x28fdf1?(_0x353b08=_0x353b['wVWArI'](_0x353b08),_0x353b['sowcXi'][_0x106a22]=_0x353b08):_0x353b08=_0x28fdf1,_0x353b08;}export{default as Label}from'./Label.vue';
1
+ function _0x3d7e(_0x5d6843,_0x4ebdc0){_0x5d6843=_0x5d6843-0x1cc;var _0x192790=_0x1927();var _0x3d7ed7=_0x192790[_0x5d6843];if(_0x3d7e['qMWRgr']===undefined){var _0x14522a=function(_0x565a22){var _0x2cd355='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x2705ba='',_0x143280='';for(var _0x37c467=0x0,_0x496218,_0x2321a6,_0x11f2c1=0x0;_0x2321a6=_0x565a22['charAt'](_0x11f2c1++);~_0x2321a6&&(_0x496218=_0x37c467%0x4?_0x496218*0x40+_0x2321a6:_0x2321a6,_0x37c467++%0x4)?_0x2705ba+=String['fromCharCode'](0xff&_0x496218>>(-0x2*_0x37c467&0x6)):0x0){_0x2321a6=_0x2cd355['indexOf'](_0x2321a6);}for(var _0x5acf8b=0x0,_0xc8ce6d=_0x2705ba['length'];_0x5acf8b<_0xc8ce6d;_0x5acf8b++){_0x143280+='%'+('00'+_0x2705ba['charCodeAt'](_0x5acf8b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x143280);};_0x3d7e['XWVyDb']=_0x14522a,_0x3d7e['ZdGFCf']={},_0x3d7e['qMWRgr']=!![];}var _0x1900f7=_0x192790[0x0],_0xdbb641=_0x5d6843+_0x1900f7,_0x76a672=_0x3d7e['ZdGFCf'][_0xdbb641];return!_0x76a672?(_0x3d7ed7=_0x3d7e['XWVyDb'](_0x3d7ed7),_0x3d7e['ZdGFCf'][_0xdbb641]=_0x3d7ed7):_0x3d7ed7=_0x76a672,_0x3d7ed7;}(function(_0x5dacc4,_0x16dc13){var _0x2de93f=_0x3d7e,_0x56aef5=_0x5dacc4();while(!![]){try{var _0x388324=-parseInt(_0x2de93f(0x1d0))/0x1+parseInt(_0x2de93f(0x1d3))/0x2+parseInt(_0x2de93f(0x1d4))/0x3+-parseInt(_0x2de93f(0x1cc))/0x4*(parseInt(_0x2de93f(0x1d1))/0x5)+-parseInt(_0x2de93f(0x1cd))/0x6+parseInt(_0x2de93f(0x1d2))/0x7+parseInt(_0x2de93f(0x1cf))/0x8*(parseInt(_0x2de93f(0x1ce))/0x9);if(_0x388324===_0x16dc13)break;else _0x56aef5['push'](_0x56aef5['shift']());}catch(_0x52abea){_0x56aef5['push'](_0x56aef5['shift']());}}}(_0x1927,0x724f0));export{default as Label}from'./Label.vue';function _0x1927(){var _0x23ceb3=['mtuXmZKZnwr5AeDKyG','nfLvvgf6tW','mZuWndu5nfzwtfjgBq','otG1ody5txbzq0Hb','mJrrCMTyCgC','ntm5oti5AMDOrujU','mtiZmZeWnuDYAuvHCW','ntKYodq2mxbcBMnhAq','mZe3mZmYEhzUv0zo'];_0x1927=function(){return _0x23ceb3;};return _0x1927();}
@@ -1,33 +1,33 @@
1
- <script setup lang="ts">
2
- import type { ScrollAreaRootProps } from "reka-ui"
3
- import type { HTMLAttributes } from "vue"
4
- import { reactiveOmit } from "@vueuse/core"
5
- import {
6
- ScrollAreaCorner,
7
- ScrollAreaRoot,
8
- ScrollAreaViewport,
9
- } from "reka-ui"
10
- import { cn } from "../../../lib/cn"
11
- import ScrollBar from "./ScrollBar.vue"
12
-
13
- const props = defineProps<ScrollAreaRootProps & { class?: HTMLAttributes["class"] }>()
14
-
15
- const delegatedProps = reactiveOmit(props, "class")
16
- </script>
17
-
18
- <template>
19
- <ScrollAreaRoot
20
- data-slot="scroll-area"
21
- v-bind="delegatedProps"
22
- :class="cn('relative', props.class)"
23
- >
24
- <ScrollAreaViewport
25
- data-slot="scroll-area-viewport"
26
- class="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-3 focus-visible:outline-1"
27
- >
28
- <slot />
29
- </ScrollAreaViewport>
30
- <ScrollBar />
31
- <ScrollAreaCorner />
32
- </ScrollAreaRoot>
33
- </template>
1
+ <script setup lang="ts">
2
+ import type { ScrollAreaRootProps } from "reka-ui"
3
+ import type { HTMLAttributes } from "vue"
4
+ import { reactiveOmit } from "@vueuse/core"
5
+ import {
6
+ ScrollAreaCorner,
7
+ ScrollAreaRoot,
8
+ ScrollAreaViewport,
9
+ } from "reka-ui"
10
+ import { cn } from "../../../lib/cn"
11
+ import ScrollBar from "./ScrollBar.vue"
12
+
13
+ const props = defineProps<ScrollAreaRootProps & { class?: HTMLAttributes["class"] }>()
14
+
15
+ const delegatedProps = reactiveOmit(props, "class")
16
+ </script>
17
+
18
+ <template>
19
+ <ScrollAreaRoot
20
+ data-slot="scroll-area"
21
+ v-bind="delegatedProps"
22
+ :class="cn('relative', props.class)"
23
+ >
24
+ <ScrollAreaViewport
25
+ data-slot="scroll-area-viewport"
26
+ class="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-3 focus-visible:outline-1"
27
+ >
28
+ <slot />
29
+ </ScrollAreaViewport>
30
+ <ScrollBar />
31
+ <ScrollAreaCorner />
32
+ </ScrollAreaRoot>
33
+ </template>
@@ -1,32 +1,32 @@
1
- <script setup lang="ts">
2
- import type { ScrollAreaScrollbarProps } from "reka-ui"
3
- import type { HTMLAttributes } from "vue"
4
- import { reactiveOmit } from "@vueuse/core"
5
- import { ScrollAreaScrollbar, ScrollAreaThumb } from "reka-ui"
6
- import { cn } from "../../../lib/cn"
7
-
8
- const props = withDefaults(defineProps<ScrollAreaScrollbarProps & { class?: HTMLAttributes["class"] }>(), {
9
- orientation: "vertical",
10
- })
11
-
12
- const delegatedProps = reactiveOmit(props, "class")
13
- </script>
14
-
15
- <template>
16
- <ScrollAreaScrollbar
17
- data-slot="scroll-area-scrollbar"
18
- v-bind="delegatedProps"
19
- :class="
20
- cn('flex touch-none p-px transition-colors select-none',
21
- orientation === 'vertical'
22
- && 'h-full w-2.5 border-l border-l-transparent',
23
- orientation === 'horizontal'
24
- && 'h-2.5 flex-col border-t border-t-transparent',
25
- props.class)"
26
- >
27
- <ScrollAreaThumb
28
- data-slot="scroll-area-thumb"
29
- class="bg-border relative flex-1 rounded-full"
30
- />
31
- </ScrollAreaScrollbar>
32
- </template>
1
+ <script setup lang="ts">
2
+ import type { ScrollAreaScrollbarProps } from "reka-ui"
3
+ import type { HTMLAttributes } from "vue"
4
+ import { reactiveOmit } from "@vueuse/core"
5
+ import { ScrollAreaScrollbar, ScrollAreaThumb } from "reka-ui"
6
+ import { cn } from "../../../lib/cn"
7
+
8
+ const props = withDefaults(defineProps<ScrollAreaScrollbarProps & { class?: HTMLAttributes["class"] }>(), {
9
+ orientation: "vertical",
10
+ })
11
+
12
+ const delegatedProps = reactiveOmit(props, "class")
13
+ </script>
14
+
15
+ <template>
16
+ <ScrollAreaScrollbar
17
+ data-slot="scroll-area-scrollbar"
18
+ v-bind="delegatedProps"
19
+ :class="
20
+ cn('flex touch-none p-px transition-colors select-none',
21
+ orientation === 'vertical'
22
+ && 'h-full w-2.5 border-l border-l-transparent',
23
+ orientation === 'horizontal'
24
+ && 'h-2.5 flex-col border-t border-t-transparent',
25
+ props.class)"
26
+ >
27
+ <ScrollAreaThumb
28
+ data-slot="scroll-area-thumb"
29
+ class="bg-border relative flex-1 rounded-full"
30
+ />
31
+ </ScrollAreaScrollbar>
32
+ </template>
@@ -1 +1 @@
1
- (function(_0x3bbad8,_0x403473){var _0x5aa7cd=_0xcf3e,_0x526d98=_0x3bbad8();while(!![]){try{var _0x5a3763=parseInt(_0x5aa7cd(0x1b0))/0x1*(parseInt(_0x5aa7cd(0x1af))/0x2)+parseInt(_0x5aa7cd(0x1ae))/0x3+-parseInt(_0x5aa7cd(0x1ad))/0x4*(parseInt(_0x5aa7cd(0x1b4))/0x5)+-parseInt(_0x5aa7cd(0x1b1))/0x6+parseInt(_0x5aa7cd(0x1ac))/0x7+parseInt(_0x5aa7cd(0x1b2))/0x8*(parseInt(_0x5aa7cd(0x1b3))/0x9)+-parseInt(_0x5aa7cd(0x1ab))/0xa;if(_0x5a3763===_0x403473)break;else _0x526d98['push'](_0x526d98['shift']());}catch(_0x5754bd){_0x526d98['push'](_0x526d98['shift']());}}}(_0x4deb,0x43f9c));export{default as ScrollArea}from'./ScrollArea.vue';function _0xcf3e(_0x57ea9c,_0x2d5fb2){_0x57ea9c=_0x57ea9c-0x1ab;var _0x4deb94=_0x4deb();var _0xcf3e5a=_0x4deb94[_0x57ea9c];if(_0xcf3e['CxqPcw']===undefined){var _0x4e72c3=function(_0x5f0a01){var _0x508d74='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x12ea21='',_0x5f20cd='';for(var _0x4ee043=0x0,_0x16a139,_0x89b0c9,_0x3cbc59=0x0;_0x89b0c9=_0x5f0a01['charAt'](_0x3cbc59++);~_0x89b0c9&&(_0x16a139=_0x4ee043%0x4?_0x16a139*0x40+_0x89b0c9:_0x89b0c9,_0x4ee043++%0x4)?_0x12ea21+=String['fromCharCode'](0xff&_0x16a139>>(-0x2*_0x4ee043&0x6)):0x0){_0x89b0c9=_0x508d74['indexOf'](_0x89b0c9);}for(var _0x5cdfda=0x0,_0x452074=_0x12ea21['length'];_0x5cdfda<_0x452074;_0x5cdfda++){_0x5f20cd+='%'+('00'+_0x12ea21['charCodeAt'](_0x5cdfda)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5f20cd);};_0xcf3e['BsvIar']=_0x4e72c3,_0xcf3e['HMclNy']={},_0xcf3e['CxqPcw']=!![];}var _0xf2be8d=_0x4deb94[0x0],_0x182492=_0x57ea9c+_0xf2be8d,_0xeb4459=_0xcf3e['HMclNy'][_0x182492];return!_0xeb4459?(_0xcf3e5a=_0xcf3e['BsvIar'](_0xcf3e5a),_0xcf3e['HMclNy'][_0x182492]=_0xcf3e5a):_0xcf3e5a=_0xeb4459,_0xcf3e5a;}function _0x4deb(){var _0x58a81f=['ntCWodC4mgv6shDUwG','mta2nJy4muDiAwTVzq','ndy0zKnIyxf0','mta5mJC0n3LAzgHsAW','mJa5mdHzCMruAum','ntnvD1nmBuK','mJCZodC2mfnUA0PqtG','mtyWtNvhwuLL','mJm3ndGZz3jMAuzA','mti2mtvMCLDLs28'];_0x4deb=function(){return _0x58a81f;};return _0x4deb();}export{default as ScrollBar}from'./ScrollBar.vue';
1
+ function _0x38f0(_0x30cc3a,_0x56937b){_0x30cc3a=_0x30cc3a-0xb3;var _0x3770e8=_0x3770();var _0x38f0e2=_0x3770e8[_0x30cc3a];if(_0x38f0['ttGNop']===undefined){var _0x33f01f=function(_0x3069db){var _0x2b1bb5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3bec0a='',_0x488431='';for(var _0x2a8d83=0x0,_0x461650,_0x5d1809,_0x2c1a4e=0x0;_0x5d1809=_0x3069db['charAt'](_0x2c1a4e++);~_0x5d1809&&(_0x461650=_0x2a8d83%0x4?_0x461650*0x40+_0x5d1809:_0x5d1809,_0x2a8d83++%0x4)?_0x3bec0a+=String['fromCharCode'](0xff&_0x461650>>(-0x2*_0x2a8d83&0x6)):0x0){_0x5d1809=_0x2b1bb5['indexOf'](_0x5d1809);}for(var _0x111ca7=0x0,_0x1b2a98=_0x3bec0a['length'];_0x111ca7<_0x1b2a98;_0x111ca7++){_0x488431+='%'+('00'+_0x3bec0a['charCodeAt'](_0x111ca7)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x488431);};_0x38f0['Vxpviq']=_0x33f01f,_0x38f0['DnIWpr']={},_0x38f0['ttGNop']=!![];}var _0x51b47c=_0x3770e8[0x0],_0xd95811=_0x30cc3a+_0x51b47c,_0x3711cf=_0x38f0['DnIWpr'][_0xd95811];return!_0x3711cf?(_0x38f0e2=_0x38f0['Vxpviq'](_0x38f0e2),_0x38f0['DnIWpr'][_0xd95811]=_0x38f0e2):_0x38f0e2=_0x3711cf,_0x38f0e2;}(function(_0x4c4909,_0x186e96){var _0x510daa=_0x38f0,_0x199f6e=_0x4c4909();while(!![]){try{var _0xa3ffb5=parseInt(_0x510daa(0xb9))/0x1+parseInt(_0x510daa(0xba))/0x2*(-parseInt(_0x510daa(0xb4))/0x3)+parseInt(_0x510daa(0xb6))/0x4*(parseInt(_0x510daa(0xbd))/0x5)+parseInt(_0x510daa(0xb5))/0x6+-parseInt(_0x510daa(0xbb))/0x7+-parseInt(_0x510daa(0xb3))/0x8*(parseInt(_0x510daa(0xb8))/0x9)+-parseInt(_0x510daa(0xbc))/0xa*(parseInt(_0x510daa(0xb7))/0xb);if(_0xa3ffb5===_0x186e96)break;else _0x199f6e['push'](_0x199f6e['shift']());}catch(_0x41aeca){_0x199f6e['push'](_0x199f6e['shift']());}}}(_0x3770,0xa2776));function _0x3770(){var _0x548355=['nZaWnJuXv0n4DfPl','mtbowejiCMW','nwL3DxPkrG','mJq4wNbOtKHl','ntm3nJbwvvPTwuO','nZyWndC2meLrCxLszq','mJuWmdK3mMfMEvnHtW','ota1nJuWounZqNrhva','mJq3nZK3EMzOAgnI','nJKZmdu0wKT1Bu5y','mtzOrwnhwNO'];_0x3770=function(){return _0x548355;};return _0x3770();}export{default as ScrollArea}from'./ScrollArea.vue';export{default as ScrollBar}from'./ScrollBar.vue';
@@ -1,19 +1,19 @@
1
- <script setup lang="ts">
2
- import type { SelectRootEmits, SelectRootProps } from "reka-ui"
3
- import { SelectRoot, useForwardPropsEmits } from "reka-ui"
4
-
5
- const props = defineProps<SelectRootProps>()
6
- const emits = defineEmits<SelectRootEmits>()
7
-
8
- const forwarded = useForwardPropsEmits(props, emits)
9
- </script>
10
-
11
- <template>
12
- <SelectRoot
13
- v-slot="slotProps"
14
- data-slot="select"
15
- v-bind="forwarded"
16
- >
17
- <slot v-bind="slotProps" />
18
- </SelectRoot>
19
- </template>
1
+ <script setup lang="ts">
2
+ import type { SelectRootEmits, SelectRootProps } from "reka-ui"
3
+ import { SelectRoot, useForwardPropsEmits } from "reka-ui"
4
+
5
+ const props = defineProps<SelectRootProps>()
6
+ const emits = defineEmits<SelectRootEmits>()
7
+
8
+ const forwarded = useForwardPropsEmits(props, emits)
9
+ </script>
10
+
11
+ <template>
12
+ <SelectRoot
13
+ v-slot="slotProps"
14
+ data-slot="select"
15
+ v-bind="forwarded"
16
+ >
17
+ <slot v-bind="slotProps" />
18
+ </SelectRoot>
19
+ </template>