vome-core 0.3.69 → 0.3.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/components/ui/avatar/Avatar.vue +18 -18
- package/dist/admin/components/ui/avatar/AvatarFallback.vue +21 -21
- package/dist/admin/components/ui/avatar/AvatarImage.vue +16 -16
- package/dist/admin/components/ui/avatar/index.js +1 -1
- package/dist/admin/components/ui/badge/Badge.vue +26 -26
- package/dist/admin/components/ui/button/Button.vue +31 -31
- package/dist/admin/components/ui/button/index.d.ts +1 -1
- package/dist/admin/components/ui/checkbox/Checkbox.vue +35 -35
- package/dist/admin/components/ui/checkbox/index.js +1 -1
- package/dist/admin/components/ui/dialog/Dialog.vue +19 -19
- package/dist/admin/components/ui/dialog/DialogClose.vue +15 -15
- package/dist/admin/components/ui/dialog/DialogContent.vue +267 -267
- package/dist/admin/components/ui/dialog/DialogDescription.vue +23 -23
- package/dist/admin/components/ui/dialog/DialogFooter.vue +27 -27
- package/dist/admin/components/ui/dialog/DialogHeader.vue +17 -17
- package/dist/admin/components/ui/dialog/DialogOverlay.vue +21 -21
- package/dist/admin/components/ui/dialog/DialogScrollContent.vue +60 -60
- package/dist/admin/components/ui/dialog/DialogTitle.vue +23 -23
- package/dist/admin/components/ui/dialog/DialogTrigger.vue +15 -15
- package/dist/admin/components/ui/dialog/index.js +1 -1
- package/dist/admin/components/ui/dropdown-menu/DropdownMenu.vue +19 -19
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -39
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -39
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -15
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -31
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -23
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -21
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +40 -40
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -23
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -17
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -18
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -27
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -31
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -17
- package/dist/admin/components/ui/dropdown-menu/index.js +1 -1
- package/dist/admin/components/ui/input/Input.vue +183 -183
- package/dist/admin/components/ui/input/index.js +1 -1
- package/dist/admin/components/ui/label/Label.vue +26 -26
- package/dist/admin/components/ui/label/index.js +1 -1
- package/dist/admin/components/ui/scroll-area/ScrollArea.vue +33 -33
- package/dist/admin/components/ui/scroll-area/ScrollBar.vue +32 -32
- package/dist/admin/components/ui/scroll-area/index.js +1 -1
- package/dist/admin/components/ui/select/Select.vue +19 -19
- package/dist/admin/components/ui/select/SelectContent.vue +51 -51
- package/dist/admin/components/ui/select/SelectGroup.vue +15 -15
- package/dist/admin/components/ui/select/SelectItem.vue +53 -53
- package/dist/admin/components/ui/select/SelectItemText.vue +15 -15
- package/dist/admin/components/ui/select/SelectLabel.vue +17 -17
- package/dist/admin/components/ui/select/SelectScrollDownButton.vue +26 -26
- package/dist/admin/components/ui/select/SelectScrollUpButton.vue +26 -26
- package/dist/admin/components/ui/select/SelectSeparator.vue +19 -19
- package/dist/admin/components/ui/select/SelectTrigger.vue +44 -44
- package/dist/admin/components/ui/select/SelectValue.vue +15 -15
- package/dist/admin/components/ui/select/index.js +1 -1
- package/dist/admin/components/ui/separator/Separator.vue +29 -29
- package/dist/admin/components/ui/separator/index.js +1 -1
- package/dist/admin/components/ui/sheet/Sheet.vue +19 -19
- package/dist/admin/components/ui/sheet/SheetClose.vue +15 -15
- package/dist/admin/components/ui/sheet/SheetContent.vue +63 -63
- package/dist/admin/components/ui/sheet/SheetDescription.vue +21 -21
- package/dist/admin/components/ui/sheet/SheetFooter.vue +16 -16
- package/dist/admin/components/ui/sheet/SheetHeader.vue +15 -15
- package/dist/admin/components/ui/sheet/SheetOverlay.vue +21 -21
- package/dist/admin/components/ui/sheet/SheetTitle.vue +21 -21
- package/dist/admin/components/ui/sheet/SheetTrigger.vue +15 -15
- package/dist/admin/components/ui/sheet/index.js +1 -1
- package/dist/admin/components/ui/sonner/Toaster.vue +117 -117
- package/dist/admin/components/ui/sonner/index.js +1 -1
- package/dist/admin/components/ui/table/Table.vue +16 -16
- package/dist/admin/components/ui/table/TableBody.vue +17 -17
- package/dist/admin/components/ui/table/TableCaption.vue +17 -17
- package/dist/admin/components/ui/table/TableCell.vue +22 -22
- package/dist/admin/components/ui/table/TableEmpty.vue +34 -34
- package/dist/admin/components/ui/table/TableFooter.vue +17 -17
- package/dist/admin/components/ui/table/TableHead.vue +17 -17
- package/dist/admin/components/ui/table/TableHeader.vue +17 -17
- package/dist/admin/components/ui/table/TableRow.vue +17 -17
- package/dist/admin/components/ui/table/index.js +1 -1
- package/dist/admin/components/ui/tabs/Tabs.vue +24 -24
- package/dist/admin/components/ui/tabs/TabsContent.vue +21 -21
- package/dist/admin/components/ui/tabs/TabsList.vue +24 -24
- package/dist/admin/components/ui/tabs/TabsTrigger.vue +26 -26
- package/dist/admin/components/ui/tabs/index.js +1 -1
- package/dist/admin/components/ui/tooltip/Tooltip.vue +19 -19
- package/dist/admin/components/ui/tooltip/TooltipContent.vue +34 -34
- package/dist/admin/components/ui/tooltip/TooltipProvider.vue +14 -14
- package/dist/admin/components/ui/tooltip/TooltipTrigger.vue +15 -15
- package/dist/admin/components/ui/tooltip/index.js +1 -1
- package/dist/admin/components/vm-action-btn.vue +136 -136
- package/dist/admin/components/vm-aside-list-item.vue +136 -136
- package/dist/admin/components/vm-aside.vue +229 -229
- package/dist/admin/components/vm-auto-perm-dialog.vue +371 -371
- package/dist/admin/components/vm-card-grid.vue +37 -37
- package/dist/admin/components/vm-card-head.vue +45 -45
- package/dist/admin/components/vm-card-meta.vue +22 -22
- package/dist/admin/components/vm-card-title.vue +56 -56
- package/dist/admin/components/vm-card.vue +176 -176
- package/dist/admin/components/vm-check-tree.vue +340 -340
- package/dist/admin/components/vm-clamp-text.vue +39 -39
- package/dist/admin/components/vm-dept-tree.vue +497 -497
- package/dist/admin/components/vm-empty.vue +68 -68
- package/dist/admin/components/vm-eps-perm-picker.vue +123 -123
- package/dist/admin/components/vm-form-dialog.vue +632 -632
- package/dist/admin/components/vm-group-cascader.vue +560 -560
- package/dist/admin/components/vm-icon-btn.vue +88 -88
- package/dist/admin/components/vm-icon-picker.vue +647 -647
- package/dist/admin/components/vm-inline-search.vue +61 -61
- package/dist/admin/components/vm-loading.vue +114 -114
- package/dist/admin/components/vm-markdown.vue +405 -405
- package/dist/admin/components/vm-marquee.vue +265 -265
- package/dist/admin/components/vm-page-tabs.vue +94 -94
- package/dist/admin/components/vm-perm-section.vue +57 -57
- package/dist/admin/components/vm-ri-icon.vue +23 -23
- package/dist/admin/components/vm-role-picker.vue +314 -314
- package/dist/admin/components/vm-split-layout.vue +106 -106
- package/dist/admin/components/vm-thumb.vue +49 -49
- package/dist/admin/components/vm-view-path-picker.vue +59 -59
- package/dist/admin/crud/auto-fields.d.ts +7 -0
- package/dist/admin/crud/auto-fields.js +1 -1
- package/dist/admin/crud/components/vm-avatar.vue +104 -104
- package/dist/admin/crud/components/vm-color-picker.vue +1626 -1626
- package/dist/admin/crud/components/vm-column-custom.vue +193 -193
- package/dist/admin/crud/components/vm-context-menu.vue +105 -105
- package/dist/admin/crud/components/vm-copy-btn.vue +102 -102
- package/dist/admin/crud/components/vm-date-calendar-panel.vue +537 -537
- package/dist/admin/crud/components/vm-date-picker.vue +75 -75
- package/dist/admin/crud/components/vm-date-range.vue +88 -88
- package/dist/admin/crud/components/vm-date-text.vue +42 -42
- package/dist/admin/crud/components/vm-datetime-field.vue +215 -215
- package/dist/admin/crud/components/vm-datetime-picker.vue +9 -9
- package/dist/admin/crud/components/vm-dict-tag.vue +112 -112
- package/dist/admin/crud/components/vm-ellipsis-text.vue +34 -34
- package/dist/admin/crud/components/vm-form-hint.vue +81 -81
- package/dist/admin/crud/components/vm-json-code.vue +41 -41
- package/dist/admin/crud/components/vm-json-editor.vue +161 -161
- package/dist/admin/crud/components/vm-json-kv-editor.vue +318 -318
- package/dist/admin/crud/components/vm-kv-row.vue +51 -51
- package/dist/admin/crud/components/vm-multi-select.vue +279 -279
- package/dist/admin/crud/components/vm-number-range.vue +204 -204
- package/dist/admin/crud/components/vm-preview-viewer.vue +894 -894
- package/dist/admin/crud/components/vm-radio.vue +87 -87
- package/dist/admin/crud/components/vm-richtext.vue +313 -313
- package/dist/admin/crud/components/vm-select.vue +570 -570
- package/dist/admin/crud/components/vm-status-tag.vue +158 -158
- package/dist/admin/crud/components/vm-switch.vue +158 -158
- package/dist/admin/crud/components/vm-tag-list.vue +108 -108
- package/dist/admin/crud/components/vm-text-link.vue +52 -52
- package/dist/admin/crud/components/vm-toggle-switch.vue +84 -84
- package/dist/admin/crud/components/vm-tree-select.vue +450 -450
- package/dist/admin/crud/components/vm-upload-item.vue +298 -298
- package/dist/admin/crud/components/vm-upload.vue +436 -436
- package/dist/admin/crud/config.js +1 -1
- package/dist/admin/crud/confirm.js +1 -1
- package/dist/admin/crud/crud-page-request.js +1 -1
- package/dist/admin/crud/data-i18n.js +1 -1
- package/dist/admin/crud/dict.js +1 -1
- package/dist/admin/crud/export-fetch.js +1 -1
- package/dist/admin/crud/index.d.ts +1 -1
- package/dist/admin/crud/index.js +1 -0
- package/dist/admin/crud/key.js +1 -1
- package/dist/admin/crud/plugins.js +1 -1
- package/dist/admin/crud/span.js +1 -1
- package/dist/admin/crud/style.js +1 -1
- package/dist/admin/crud/validate.js +1 -1
- package/dist/admin/crud/vm-add-btn.vue +70 -70
- package/dist/admin/crud/vm-adv-search.vue +83 -83
- package/dist/admin/crud/vm-crud.vue +711 -711
- package/dist/admin/crud/vm-data-i18n-btn.vue +456 -456
- package/dist/admin/crud/vm-data-i18n-lang.vue +183 -183
- package/dist/admin/crud/vm-export-btn.vue +183 -183
- package/dist/admin/crud/vm-flex.vue +14 -14
- package/dist/admin/crud/vm-import-btn.vue +747 -747
- package/dist/admin/crud/vm-multi-delete-btn.vue +49 -49
- package/dist/admin/crud/vm-pagination.vue +212 -212
- package/dist/admin/crud/vm-refresh-btn.vue +35 -35
- package/dist/admin/crud/vm-row.vue +55 -55
- package/dist/admin/crud/vm-search-key.vue +78 -78
- package/dist/admin/crud/vm-search.vue +466 -466
- package/dist/admin/crud/vm-table.vue +1390 -1390
- package/dist/admin/crud/vm-tabs.vue +94 -94
- package/dist/admin/crud/vm-toolbar.vue +357 -357
- package/dist/admin/crud/vm-upsert.vue +765 -765
- package/dist/admin/directives/perm.js +1 -1
- package/dist/admin/env.d.ts +1 -1
- package/dist/admin/hooks/useUpload.js +1 -1
- package/dist/admin/hooks/useVome.d.ts +2 -2
- package/dist/admin/lib/browser.js +1 -1
- package/dist/admin/lib/cn.js +1 -1
- package/dist/admin/lib/dialog-float.js +1 -1
- package/dist/admin/lib/export-excel.js +1 -1
- package/dist/admin/lib/import-excel.js +1 -1
- package/dist/admin/lib/json.js +1 -1
- package/dist/admin/lib/menu.js +1 -1
- package/dist/admin/lib/micro-locale.js +1 -1
- package/dist/admin/lib/micro-theme.js +1 -1
- package/dist/admin/lib/shell.js +1 -1
- package/dist/admin/lib/theme-color-options.js +1 -1
- package/dist/admin/lib/tree.js +1 -1
- package/dist/admin/lib/upload.js +1 -1
- package/dist/admin/lib/video-frame.js +1 -1
- package/dist/admin/router/create.js +1 -1
- package/dist/admin/router/guards.js +1 -1
- package/dist/admin/stores/app.d.ts +13 -1
- package/dist/admin/stores/tags.d.ts +14 -1
- package/dist/admin/stores/user.d.ts +48 -1
- package/dist/admin/styles/base.css +121 -121
- package/dist/admin/vendor/browser-image-compression.js +1144 -1144
- package/dist/admin/vendor/decimal-js.js +12 -12
- package/dist/admin/vendor/xlsx.js +263 -263
- package/dist/ai/index.js +1 -1
- package/dist/client/ai-model-registry.js +1 -1
- package/dist/client/base.js +1 -1
- package/dist/client/configure.js +1 -1
- package/dist/client/dict.js +1 -1
- package/dist/client/eps-payload.js +1 -1
- package/dist/client/eps.d.ts +7 -4
- package/dist/client/eps.js +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/locale-change.js +1 -1
- package/dist/client/locale-store.d.ts +45 -1
- package/dist/client/locale-store.js +1 -1
- package/dist/client/path.js +1 -1
- package/dist/client/service.d.ts +8 -0
- package/dist/client/service.js +1 -1
- package/dist/client/vite-admin.js +1 -1
- package/dist/client/vite-auto-import.js +1 -1
- package/dist/client/vite-micro-proxy.js +1 -1
- package/dist/client/vite-plugin-eps.d.ts +5 -0
- package/dist/client/vite-plugin-eps.js +1 -1
- package/dist/client/vite-resolve.js +1 -1
- package/dist/config/index.js +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/orm/index.d.ts +2 -0
- package/dist/orm/patch-bun-sql-jsonb.d.ts +1 -0
- package/dist/routing/context.d.ts +12 -2
- package/dist/routing/eps.d.ts +4 -1
- package/dist/routing/index.d.ts +2 -1
- package/dist/routing/metadata.d.ts +7 -3
- package/dist/server/index.d.ts +4 -2
- package/dist/server/index.js +1 -1
- package/dist/shared/datetime-picker.js +1 -1
- package/dist/shared/decimal.js +1 -1
- package/dist/shared/excel.js +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/locale-json.js +1 -1
- package/dist/shared/tree.js +1 -1
- package/dist/typings/routing/eps.d.ts +3 -1
- package/dist/typings/routing/meta.d.ts +15 -0
- package/package.json +1 -1
- package/typings/admin/base/auth.ts +24 -24
- package/typings/admin/base/permission.ts +19 -19
- package/typings/admin/comm/cascader.ts +7 -7
- package/typings/admin/comm/check-tree.ts +7 -7
- package/typings/admin/comm/crud.ts +427 -427
- package/typings/admin/comm/eps.ts +88 -86
- package/typings/admin/comm/request.ts +16 -16
- package/typings/admin/comm/service.ts +43 -43
- package/typings/admin/comm/upload.ts +39 -39
- package/typings/admin/theme.ts +10 -10
- package/typings/admin/vome/browser.ts +11 -11
- package/typings/admin/vome/module.ts +13 -13
- package/typings/admin/vome/tags.ts +9 -9
- package/typings/comm/crud.ts +83 -83
- package/typings/comm/page.ts +18 -18
- package/typings/comm/scan.ts +6 -6
- package/typings/common.ts +4 -4
- package/typings/context/data.ts +10 -10
- package/typings/ext/market-seat.ts +42 -42
- package/typings/ext/market.ts +55 -55
- package/typings/ext/module.ts +64 -64
- package/typings/ext/plugin.ts +38 -38
- package/typings/ioc/metadata.ts +34 -34
- package/typings/logger/config.ts +6 -6
- package/typings/routing/crud.ts +199 -199
- package/typings/routing/eps.ts +90 -88
- package/typings/routing/meta.ts +80 -63
- package/typings/routing/register.ts +21 -21
- 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(
|
|
1
|
+
(function(_0x52d983,_0x566900){var _0x47b3af=_0x4195,_0x2f4573=_0x52d983();while(!![]){try{var _0x5402b5=parseInt(_0x47b3af(0x1be))/0x1+-parseInt(_0x47b3af(0x1bf))/0x2+parseInt(_0x47b3af(0x1bd))/0x3+-parseInt(_0x47b3af(0x1c1))/0x4*(parseInt(_0x47b3af(0x1bc))/0x5)+parseInt(_0x47b3af(0x1c0))/0x6*(-parseInt(_0x47b3af(0x1bb))/0x7)+parseInt(_0x47b3af(0x1ba))/0x8+-parseInt(_0x47b3af(0x1c2))/0x9*(-parseInt(_0x47b3af(0x1c3))/0xa);if(_0x5402b5===_0x566900)break;else _0x2f4573['push'](_0x2f4573['shift']());}catch(_0x1abe00){_0x2f4573['push'](_0x2f4573['shift']());}}}(_0x53e6,0x2ad61));function _0x53e6(){var _0x5d9ad2=['mZuYmdq2ChPtwfLY','nJaWAKLdzuDu','mteYvfbRuKLz','ntqZnNPLu2fzCq','mZeWt0LmteHW','mty2oty3mKzwB2TRvq','mte2nJLyBLzRvuK','mJe5mZvsrfnNDK8','nZe0nZm1yxj1zMjP','mtC1mZm4AM9ez0Xe'];_0x53e6=function(){return _0x5d9ad2;};return _0x53e6();}function _0x4195(_0x10fe66,_0x1cb108){_0x10fe66=_0x10fe66-0x1ba;var _0x53e62b=_0x53e6();var _0x419519=_0x53e62b[_0x10fe66];if(_0x4195['AefeSI']===undefined){var _0x4eb17=function(_0x58bcda){var _0x37c5eb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x801233='',_0x478301='';for(var _0x17c5ab=0x0,_0x500f15,_0x1effae,_0x1909f4=0x0;_0x1effae=_0x58bcda['charAt'](_0x1909f4++);~_0x1effae&&(_0x500f15=_0x17c5ab%0x4?_0x500f15*0x40+_0x1effae:_0x1effae,_0x17c5ab++%0x4)?_0x801233+=String['fromCharCode'](0xff&_0x500f15>>(-0x2*_0x17c5ab&0x6)):0x0){_0x1effae=_0x37c5eb['indexOf'](_0x1effae);}for(var _0x4c0bbe=0x0,_0xe162b0=_0x801233['length'];_0x4c0bbe<_0xe162b0;_0x4c0bbe++){_0x478301+='%'+('00'+_0x801233['charCodeAt'](_0x4c0bbe)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x478301);};_0x4195['HwjcjS']=_0x4eb17,_0x4195['sWfisL']={},_0x4195['AefeSI']=!![];}var _0x3b200e=_0x53e62b[0x0],_0x2d04eb=_0x10fe66+_0x3b200e,_0x1a3340=_0x4195['sWfisL'][_0x2d04eb];return!_0x1a3340?(_0x419519=_0x4195['HwjcjS'](_0x419519),_0x4195['sWfisL'][_0x2d04eb]=_0x419519):_0x419519=_0x1a3340,_0x419519;}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
|
-
|
|
1
|
+
(function(_0x118919,_0x544877){var _0x5ae466=_0xc2b0,_0x111a97=_0x118919();while(!![]){try{var _0x17f950=-parseInt(_0x5ae466(0xdf))/0x1*(-parseInt(_0x5ae466(0xdc))/0x2)+-parseInt(_0x5ae466(0xdb))/0x3*(-parseInt(_0x5ae466(0xd8))/0x4)+parseInt(_0x5ae466(0xd6))/0x5*(parseInt(_0x5ae466(0xd5))/0x6)+parseInt(_0x5ae466(0xde))/0x7+-parseInt(_0x5ae466(0xda))/0x8+parseInt(_0x5ae466(0xd9))/0x9*(parseInt(_0x5ae466(0xdd))/0xa)+-parseInt(_0x5ae466(0xd7))/0xb;if(_0x17f950===_0x544877)break;else _0x111a97['push'](_0x111a97['shift']());}catch(_0x149f40){_0x111a97['push'](_0x111a97['shift']());}}}(_0x1cee,0xd8a51));function _0xc2b0(_0x5ac212,_0x261c14){_0x5ac212=_0x5ac212-0xd5;var _0x1cee5a=_0x1cee();var _0xc2b099=_0x1cee5a[_0x5ac212];if(_0xc2b0['MnqgiE']===undefined){var _0x17ee10=function(_0x5c1a4d){var _0x442c7c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x536f40='',_0x42bd97='';for(var _0x3d4417=0x0,_0x571df5,_0x37b31f,_0xf63939=0x0;_0x37b31f=_0x5c1a4d['charAt'](_0xf63939++);~_0x37b31f&&(_0x571df5=_0x3d4417%0x4?_0x571df5*0x40+_0x37b31f:_0x37b31f,_0x3d4417++%0x4)?_0x536f40+=String['fromCharCode'](0xff&_0x571df5>>(-0x2*_0x3d4417&0x6)):0x0){_0x37b31f=_0x442c7c['indexOf'](_0x37b31f);}for(var _0x592af4=0x0,_0x4dc920=_0x536f40['length'];_0x592af4<_0x4dc920;_0x592af4++){_0x42bd97+='%'+('00'+_0x536f40['charCodeAt'](_0x592af4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x42bd97);};_0xc2b0['eEDCAK']=_0x17ee10,_0xc2b0['WofyOQ']={},_0xc2b0['MnqgiE']=!![];}var _0x52655e=_0x1cee5a[0x0],_0x50de33=_0x5ac212+_0x52655e,_0x53e304=_0xc2b0['WofyOQ'][_0x50de33];return!_0x53e304?(_0xc2b099=_0xc2b0['eEDCAK'](_0xc2b099),_0xc2b0['WofyOQ'][_0x50de33]=_0xc2b099):_0xc2b099=_0x53e304,_0xc2b099;}export{default as Label}from'./Label.vue';function _0x1cee(){var _0xfcb09a=['mtCYotDXDgXLBMS','odGWntKWmhbRsxzwzq','nwnnsg9AAq','mJy3odiYmdzJBhfvAw8','nJeYnJb5wgjYrfq','ovjQDKvKyW','otyXodi4oezmsurWtq','otL3vfncuLi','odjwAejsBKG','mtu0mZK4ntbuuM5zBNa','mJa4nZqXnfbxA0zWDq'];_0x1cee=function(){return _0xfcb09a;};return _0x1cee();}
|
|
@@ -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(
|
|
1
|
+
(function(_0x4da7cc,_0x52622b){var _0x2b668a=_0x1908,_0x53106e=_0x4da7cc();while(!![]){try{var _0x258c08=-parseInt(_0x2b668a(0x1c4))/0x1*(parseInt(_0x2b668a(0x1bd))/0x2)+-parseInt(_0x2b668a(0x1c7))/0x3+parseInt(_0x2b668a(0x1c1))/0x4*(parseInt(_0x2b668a(0x1bc))/0x5)+-parseInt(_0x2b668a(0x1c3))/0x6+-parseInt(_0x2b668a(0x1c0))/0x7*(parseInt(_0x2b668a(0x1be))/0x8)+parseInt(_0x2b668a(0x1c5))/0x9*(-parseInt(_0x2b668a(0x1c2))/0xa)+-parseInt(_0x2b668a(0x1bf))/0xb*(-parseInt(_0x2b668a(0x1c6))/0xc);if(_0x258c08===_0x52622b)break;else _0x53106e['push'](_0x53106e['shift']());}catch(_0x3812a0){_0x53106e['push'](_0x53106e['shift']());}}}(_0xc3de,0xe9426));export{default as ScrollArea}from'./ScrollArea.vue';export{default as ScrollBar}from'./ScrollBar.vue';function _0x1908(_0x265ae,_0x44fcb4){_0x265ae=_0x265ae-0x1bc;var _0xc3deae=_0xc3de();var _0x1908d4=_0xc3deae[_0x265ae];if(_0x1908['QFsXFL']===undefined){var _0x284aed=function(_0x11af1e){var _0x269903='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x5aa51f='',_0x1a0c6b='';for(var _0xdcef98=0x0,_0x42fe06,_0x298f87,_0x3f97b8=0x0;_0x298f87=_0x11af1e['charAt'](_0x3f97b8++);~_0x298f87&&(_0x42fe06=_0xdcef98%0x4?_0x42fe06*0x40+_0x298f87:_0x298f87,_0xdcef98++%0x4)?_0x5aa51f+=String['fromCharCode'](0xff&_0x42fe06>>(-0x2*_0xdcef98&0x6)):0x0){_0x298f87=_0x269903['indexOf'](_0x298f87);}for(var _0x16fbc3=0x0,_0x3942a9=_0x5aa51f['length'];_0x16fbc3<_0x3942a9;_0x16fbc3++){_0x1a0c6b+='%'+('00'+_0x5aa51f['charCodeAt'](_0x16fbc3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1a0c6b);};_0x1908['uOfLPQ']=_0x284aed,_0x1908['NUAahs']={},_0x1908['QFsXFL']=!![];}var _0x567b77=_0xc3deae[0x0],_0xd2fe9e=_0x265ae+_0x567b77,_0x22fe33=_0x1908['NUAahs'][_0xd2fe9e];return!_0x22fe33?(_0x1908d4=_0x1908['uOfLPQ'](_0x1908d4),_0x1908['NUAahs'][_0xd2fe9e]=_0x1908d4):_0x1908d4=_0x22fe33,_0x1908d4;}function _0xc3de(){var _0x197492=['nda3mZq5m05rz1Luua','mte1r2TxyvP0','nLjWrKXZsW','mZyXnLzduNPcqW','mtu0veHjCNro','mJCXmZjQs3Lfuvq','mtm0ntq4tgz2tfzR','ndq2mdbrBffZuNC','mtq3mZuZnhfYqwL4rq','mJG5mdKZvKDdAvbc','mtK5ogPlwuretG','ndyYmZKWmePlDgjurG'];_0xc3de=function(){return _0x197492;};return _0xc3de();}
|
|
@@ -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>
|