@veltra/desktop 1.8.5 → 1.9.1
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/components/alert/alert.js +69 -0
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/alert/style.d.ts +1 -0
- package/dist/components/alert/style.js +1 -0
- package/dist/components/alert/style2.css +76 -0
- package/dist/components/anchor/anchor-item.js +35 -0
- package/dist/components/anchor/anchor-item.js.map +1 -0
- package/dist/components/anchor/anchor.js +61 -0
- package/dist/components/anchor/anchor.js.map +1 -0
- package/dist/components/anchor/di.js +6 -0
- package/dist/components/anchor/di.js.map +1 -0
- package/dist/components/anchor/style.d.ts +1 -0
- package/dist/components/anchor/style.js +1 -0
- package/dist/components/anchor/style2.css +45 -0
- package/dist/components/anchor/use-anchor.js +81 -0
- package/dist/components/anchor/use-anchor.js.map +1 -0
- package/dist/components/avatar/avatar-group.js +28 -0
- package/dist/components/avatar/avatar-group.js.map +1 -0
- package/dist/components/avatar/avatar.js +51 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/style.d.ts +1 -0
- package/dist/components/avatar/style.js +1 -0
- package/dist/components/avatar/style2.css +87 -0
- package/dist/components/back-top/back-top.js +82 -0
- package/dist/components/back-top/back-top.js.map +1 -0
- package/dist/components/back-top/style.d.ts +1 -0
- package/dist/components/back-top/style.js +2 -0
- package/dist/components/back-top/style2.css +32 -0
- package/dist/components/carousel/carousel-item.js +27 -0
- package/dist/components/carousel/carousel-item.js.map +1 -0
- package/dist/components/carousel/carousel.js +118 -0
- package/dist/components/carousel/carousel.js.map +1 -0
- package/dist/components/carousel/di.js +7 -0
- package/dist/components/carousel/di.js.map +1 -0
- package/dist/components/carousel/style.d.ts +1 -0
- package/dist/components/carousel/style.js +1 -0
- package/dist/components/carousel/style2.css +97 -0
- package/dist/components/carousel/use-carousel.js +68 -0
- package/dist/components/carousel/use-carousel.js.map +1 -0
- package/dist/components/descriptions/descriptions-item.js +16 -0
- package/dist/components/descriptions/descriptions-item.js.map +1 -0
- package/dist/components/descriptions/descriptions.js +67 -0
- package/dist/components/descriptions/descriptions.js.map +1 -0
- package/dist/components/descriptions/style.d.ts +1 -0
- package/dist/components/descriptions/style.js +1 -0
- package/dist/components/descriptions/style2.css +81 -0
- package/dist/components/divider/divider.js +41 -0
- package/dist/components/divider/divider.js.map +1 -0
- package/dist/components/divider/style.d.ts +1 -0
- package/dist/components/divider/style.js +1 -0
- package/dist/components/divider/style2.css +68 -0
- package/dist/components/expression-editor/components/variable-picker.js +1 -1
- package/dist/components/expression-editor/components/variable-picker.js.map +1 -1
- package/dist/components/image-cropper/image-cropper.js +1 -1
- package/dist/components/image-cropper/image-cropper.js.map +1 -1
- package/dist/components/index.d.ts +48 -30
- package/dist/components/index.js +95 -59
- package/dist/components/index.js.map +1 -1
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/rate/rate.js +130 -0
- package/dist/components/rate/rate.js.map +1 -0
- package/dist/components/rate/style.d.ts +1 -0
- package/dist/components/rate/style.js +1 -0
- package/dist/components/rate/style2.css +58 -0
- package/dist/components/skeleton/skeleton.js +74 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/skeleton/style.d.ts +1 -0
- package/dist/components/skeleton/style.js +1 -0
- package/dist/components/skeleton/style2.css +86 -0
- package/dist/components/space/space.js +47 -0
- package/dist/components/space/space.js.map +1 -0
- package/dist/components/space/style.d.ts +1 -0
- package/dist/components/space/style.js +1 -0
- package/dist/components/space/style2.css +43 -0
- package/dist/components/time-picker/style.d.ts +2 -0
- package/dist/components/time-picker/style.js +3 -0
- package/dist/components/time-picker/style2.css +110 -0
- package/dist/components/time-picker/time-picker.js +196 -0
- package/dist/components/time-picker/time-picker.js.map +1 -0
- package/dist/components/timeline/style.d.ts +1 -0
- package/dist/components/timeline/style.js +1 -0
- package/dist/components/timeline/style2.css +95 -0
- package/dist/components/timeline/timeline-item.js +32 -0
- package/dist/components/timeline/timeline-item.js.map +1 -0
- package/dist/components/timeline/timeline.js +17 -0
- package/dist/components/timeline/timeline.js.map +1 -0
- package/dist/components/transfer/style.d.ts +2 -0
- package/dist/components/transfer/style.js +4 -0
- package/dist/components/transfer/style2.css +172 -0
- package/dist/components/transfer/transfer-list.js +101 -0
- package/dist/components/transfer/transfer-list.js.map +1 -0
- package/dist/components/transfer/transfer.js +138 -0
- package/dist/components/transfer/transfer.js.map +1 -0
- package/dist/index.d.ts +119 -88
- package/dist/index.js +106 -88
- package/dist/types/alert.d.ts +27 -0
- package/dist/types/anchor.d.ts +48 -0
- package/dist/types/avatar.d.ts +28 -0
- package/dist/types/back-top.d.ts +19 -0
- package/dist/types/carousel.d.ts +25 -0
- package/dist/types/descriptions.d.ts +22 -0
- package/dist/types/divider.d.ts +14 -0
- package/dist/types/index.d.ts +14 -1
- package/dist/types/layout.d.ts +2 -1
- package/dist/types/rate.d.ts +26 -0
- package/dist/types/skeleton.d.ts +24 -0
- package/dist/types/space.d.ts +20 -0
- package/dist/types/time-picker.d.ts +38 -0
- package/dist/types/timeline.d.ts +16 -0
- package/dist/types/transfer.d.ts +37 -0
- package/package.json +2 -1
- package/src/components/alert/alert.vue +62 -0
- package/src/components/alert/index.ts +1 -0
- package/src/components/alert/style.scss +67 -0
- package/src/components/alert/style.ts +1 -0
- package/src/components/anchor/anchor-item.vue +35 -0
- package/src/components/anchor/anchor.vue +63 -0
- package/src/components/anchor/di.ts +15 -0
- package/src/components/anchor/index.ts +2 -0
- package/src/components/anchor/style.scss +44 -0
- package/src/components/anchor/style.ts +1 -0
- package/src/components/anchor/use-anchor.ts +120 -0
- package/src/components/avatar/avatar-group.vue +26 -0
- package/src/components/avatar/avatar.vue +52 -0
- package/src/components/avatar/index.ts +2 -0
- package/src/components/avatar/style.scss +79 -0
- package/src/components/avatar/style.ts +1 -0
- package/src/components/back-top/back-top.vue +89 -0
- package/src/components/back-top/index.ts +1 -0
- package/src/components/back-top/style.scss +31 -0
- package/src/components/back-top/style.ts +2 -0
- package/src/components/carousel/carousel-item.vue +27 -0
- package/src/components/carousel/carousel.vue +93 -0
- package/src/components/carousel/di.ts +15 -0
- package/src/components/carousel/index.ts +2 -0
- package/src/components/carousel/style.scss +109 -0
- package/src/components/carousel/style.ts +1 -0
- package/src/components/carousel/use-carousel.ts +77 -0
- package/src/components/descriptions/descriptions-item.vue +12 -0
- package/src/components/descriptions/descriptions.vue +81 -0
- package/src/components/descriptions/index.ts +2 -0
- package/src/components/descriptions/style.scss +73 -0
- package/src/components/descriptions/style.ts +1 -0
- package/src/components/divider/divider.vue +29 -0
- package/src/components/divider/index.ts +1 -0
- package/src/components/divider/style.scss +90 -0
- package/src/components/divider/style.ts +1 -0
- package/src/components/expression-editor/components/variable-picker.vue +1 -1
- package/src/components/image-cropper/image-cropper.vue +1 -1
- package/src/components/index.ts +26 -0
- package/src/components/input/__test__/input.test.ts +106 -0
- package/src/components/input/input.vue +4 -1
- package/src/components/rate/index.ts +1 -0
- package/src/components/rate/rate.vue +127 -0
- package/src/components/rate/style.scss +51 -0
- package/src/components/rate/style.ts +1 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/skeleton/skeleton.vue +37 -0
- package/src/components/skeleton/style.scss +94 -0
- package/src/components/skeleton/style.ts +1 -0
- package/src/components/space/index.ts +1 -0
- package/src/components/space/space.vue +45 -0
- package/src/components/space/style.scss +41 -0
- package/src/components/space/style.ts +1 -0
- package/src/components/time-picker/index.ts +1 -0
- package/src/components/time-picker/style.scss +82 -0
- package/src/components/time-picker/style.ts +3 -0
- package/src/components/time-picker/time-picker.vue +183 -0
- package/src/components/timeline/index.ts +2 -0
- package/src/components/timeline/style.scss +107 -0
- package/src/components/timeline/style.ts +1 -0
- package/src/components/timeline/timeline-item.vue +43 -0
- package/src/components/timeline/timeline.vue +17 -0
- package/src/components/transfer/index.ts +1 -0
- package/src/components/transfer/style.scss +135 -0
- package/src/components/transfer/style.ts +4 -0
- package/src/components/transfer/transfer-list.vue +120 -0
- package/src/components/transfer/transfer.vue +134 -0
- package/src/types/alert.ts +29 -0
- package/src/types/anchor.ts +50 -0
- package/src/types/avatar.ts +31 -0
- package/src/types/back-top.ts +20 -0
- package/src/types/carousel.ts +29 -0
- package/src/types/descriptions.ts +22 -0
- package/src/types/divider.ts +14 -0
- package/src/types/index.ts +16 -0
- package/src/types/layout.ts +2 -1
- package/src/types/rate.ts +27 -0
- package/src/types/skeleton.ts +29 -0
- package/src/types/space.ts +22 -0
- package/src/types/time-picker.ts +40 -0
- package/src/types/timeline.ts +15 -0
- package/src/types/transfer.ts +45 -0
package/dist/components/index.js
CHANGED
|
@@ -72,45 +72,69 @@ import _sfc_main$57 from "./action/action.js";
|
|
|
72
72
|
import action_group_default from "./action/action-group.js";
|
|
73
73
|
import _sfc_main$58 from "./batch-edit/batch-edit.js";
|
|
74
74
|
import { defineBatchEditColumns } from "./batch-edit/helper.js";
|
|
75
|
-
import _sfc_main$59 from "./
|
|
76
|
-
import _sfc_main$60 from "./
|
|
77
|
-
import _sfc_main$61 from "./
|
|
78
|
-
import _sfc_main$62 from "./
|
|
79
|
-
import _sfc_main$63 from "./
|
|
80
|
-
import _sfc_main$64 from "./
|
|
81
|
-
import _sfc_main$65 from "./
|
|
82
|
-
import _sfc_main$66 from "./
|
|
83
|
-
import _sfc_main$67 from "./
|
|
84
|
-
import _sfc_main$68 from "./list/list
|
|
85
|
-
import _sfc_main$69 from "./
|
|
86
|
-
import _sfc_main$70 from "./
|
|
87
|
-
import _sfc_main$71 from "./nav/nav-
|
|
88
|
-
import _sfc_main$72 from "./nav/nav.js";
|
|
89
|
-
import _sfc_main$73 from "./
|
|
90
|
-
import _sfc_main$74 from "./
|
|
91
|
-
import _sfc_main$75 from "./
|
|
92
|
-
import _sfc_main$76 from "./
|
|
93
|
-
import _sfc_main$77 from "./
|
|
94
|
-
import _sfc_main$78 from "./
|
|
95
|
-
import _sfc_main$79 from "./
|
|
96
|
-
import _sfc_main$80 from "./
|
|
97
|
-
import _sfc_main$81 from "./
|
|
98
|
-
import _sfc_main$82 from "./
|
|
99
|
-
import _sfc_main$83 from "./
|
|
100
|
-
import _sfc_main$84 from "./
|
|
101
|
-
import _sfc_main$85 from "./
|
|
102
|
-
import _sfc_main$86 from "./
|
|
103
|
-
import _sfc_main$87 from "./
|
|
75
|
+
import _sfc_main$59 from "./transfer/transfer.js";
|
|
76
|
+
import _sfc_main$60 from "./textarea/textarea.js";
|
|
77
|
+
import _sfc_main$61 from "./cascade/cascade.js";
|
|
78
|
+
import _sfc_main$62 from "./steps/steps.js";
|
|
79
|
+
import _sfc_main$63 from "./date-picker/date-picker.js";
|
|
80
|
+
import _sfc_main$64 from "./palette/palette.js";
|
|
81
|
+
import _sfc_main$65 from "./theme/theme.js";
|
|
82
|
+
import _sfc_main$66 from "./multi-tree-select/multi-tree-select.js";
|
|
83
|
+
import _sfc_main$67 from "./group-input/group-input.js";
|
|
84
|
+
import _sfc_main$68 from "./list/list.js";
|
|
85
|
+
import _sfc_main$69 from "./list/list-item.js";
|
|
86
|
+
import _sfc_main$70 from "./rich-text-editor/rich-text-editor.js";
|
|
87
|
+
import _sfc_main$71 from "./nav/nav-item.js";
|
|
88
|
+
import _sfc_main$72 from "./nav/nav-sub.js";
|
|
89
|
+
import _sfc_main$73 from "./nav/nav.js";
|
|
90
|
+
import _sfc_main$74 from "./dual-nav/dual-nav.js";
|
|
91
|
+
import _sfc_main$75 from "./group-nav/group-nav.js";
|
|
92
|
+
import _sfc_main$76 from "./grid-input/grid-input.js";
|
|
93
|
+
import _sfc_main$77 from "./switch/switch.js";
|
|
94
|
+
import _sfc_main$78 from "./radio-group/radio-group.js";
|
|
95
|
+
import _sfc_main$79 from "./checkbox-group/checkbox-group.js";
|
|
96
|
+
import _sfc_main$80 from "./file-viewer/file-viewer.js";
|
|
97
|
+
import _sfc_main$81 from "./text/text.js";
|
|
98
|
+
import _sfc_main$82 from "./breadcrumb/breadcrumb.js";
|
|
99
|
+
import _sfc_main$83 from "./paginator/paginator.js";
|
|
100
|
+
import _sfc_main$84 from "./float-button/float-button.js";
|
|
101
|
+
import _sfc_main$85 from "./badge/badge.js";
|
|
102
|
+
import _sfc_main$86 from "./segment/segment.js";
|
|
103
|
+
import _sfc_main$87 from "./image-cropper/image-cropper.js";
|
|
104
|
+
import _sfc_main$88 from "./kanban/kanban.js";
|
|
105
|
+
import _sfc_main$89 from "./anchor/anchor.js";
|
|
106
|
+
import _sfc_main$90 from "./anchor/anchor-item.js";
|
|
107
|
+
import _sfc_main$91 from "./avatar/avatar.js";
|
|
108
|
+
import _sfc_main$92 from "./avatar/avatar-group.js";
|
|
109
|
+
import _sfc_main$93 from "./back-top/back-top.js";
|
|
110
|
+
import _sfc_main$94 from "./alert/alert.js";
|
|
111
|
+
import _sfc_main$95 from "./rate/rate.js";
|
|
112
|
+
import _sfc_main$96 from "./divider/divider.js";
|
|
113
|
+
import _sfc_main$97 from "./space/space.js";
|
|
114
|
+
import _sfc_main$98 from "./skeleton/skeleton.js";
|
|
115
|
+
import _sfc_main$99 from "./time-picker/time-picker.js";
|
|
116
|
+
import _sfc_main$100 from "./descriptions/descriptions-item.js";
|
|
117
|
+
import _sfc_main$101 from "./descriptions/descriptions.js";
|
|
118
|
+
import _sfc_main$102 from "./timeline/timeline.js";
|
|
119
|
+
import _sfc_main$103 from "./timeline/timeline-item.js";
|
|
120
|
+
import _sfc_main$104 from "./carousel/carousel.js";
|
|
121
|
+
import _sfc_main$105 from "./carousel/carousel-item.js";
|
|
104
122
|
//#region src/components/index.ts
|
|
105
123
|
var components_exports = /* @__PURE__ */ __exportAll({
|
|
106
124
|
ContextmenuPanelDIKey: () => ContextmenuPanelDIKey,
|
|
107
125
|
ContextmenuRootDIKey: () => ContextmenuRootDIKey,
|
|
108
126
|
UAction: () => _sfc_main$57,
|
|
109
127
|
UActionGroup: () => action_group_default,
|
|
128
|
+
UAlert: () => _sfc_main$94,
|
|
129
|
+
UAnchor: () => _sfc_main$89,
|
|
130
|
+
UAnchorItem: () => _sfc_main$90,
|
|
110
131
|
UAutoComplete: () => _sfc_main$31,
|
|
111
|
-
|
|
132
|
+
UAvatar: () => _sfc_main$91,
|
|
133
|
+
UAvatarGroup: () => _sfc_main$92,
|
|
134
|
+
UBackTop: () => _sfc_main$93,
|
|
135
|
+
UBadge: () => _sfc_main$85,
|
|
112
136
|
UBatchEdit: () => _sfc_main$58,
|
|
113
|
-
UBreadcrumb: () => _sfc_main$
|
|
137
|
+
UBreadcrumb: () => _sfc_main$82,
|
|
114
138
|
UButton: () => _sfc_main$18,
|
|
115
139
|
UButtonGroup: () => _sfc_main$19,
|
|
116
140
|
UCalendar: () => _sfc_main$21,
|
|
@@ -119,82 +143,94 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
119
143
|
UCardContent: () => _sfc_main$26,
|
|
120
144
|
UCardCover: () => _sfc_main$25,
|
|
121
145
|
UCardHeader: () => _sfc_main$24,
|
|
122
|
-
|
|
146
|
+
UCarousel: () => _sfc_main$104,
|
|
147
|
+
UCarouselItem: () => _sfc_main$105,
|
|
148
|
+
UCascade: () => _sfc_main$61,
|
|
123
149
|
UCheckTag: () => _sfc_main$48,
|
|
124
150
|
UCheckbox: () => _sfc_main$11,
|
|
125
151
|
UCheckboxButton: () => _sfc_main$36,
|
|
126
|
-
UCheckboxGroup: () => _sfc_main$
|
|
152
|
+
UCheckboxGroup: () => _sfc_main$79,
|
|
127
153
|
UCodeEditor: () => _sfc_main$14,
|
|
128
154
|
UCollapse: () => _sfc_main$44,
|
|
129
155
|
UCollapseItem: () => _sfc_main$45,
|
|
130
156
|
UConditionEditor: () => _sfc_main$7,
|
|
131
157
|
UContextmenu: () => _sfc_main$49,
|
|
132
158
|
UDatePanel: () => _sfc_main$28,
|
|
133
|
-
UDatePicker: () => _sfc_main$
|
|
159
|
+
UDatePicker: () => _sfc_main$63,
|
|
134
160
|
UDateRangePicker: () => _sfc_main$29,
|
|
161
|
+
UDescriptions: () => _sfc_main$101,
|
|
162
|
+
UDescriptionsItem: () => _sfc_main$100,
|
|
135
163
|
UDialog: () => _sfc_main$52,
|
|
164
|
+
UDivider: () => _sfc_main$96,
|
|
136
165
|
UDrawer: () => _sfc_main$15,
|
|
137
166
|
UDropdown: () => _sfc_main$4,
|
|
138
|
-
UDualNav: () => _sfc_main$
|
|
167
|
+
UDualNav: () => _sfc_main$74,
|
|
139
168
|
UEmpty: () => _sfc_main$1,
|
|
140
169
|
UExpressionEditor: () => _sfc_main$53,
|
|
141
170
|
UFilePicker: () => _sfc_main$41,
|
|
142
|
-
UFileViewer: () => _sfc_main$
|
|
143
|
-
UFloatButton: () => _sfc_main$
|
|
171
|
+
UFileViewer: () => _sfc_main$80,
|
|
172
|
+
UFloatButton: () => _sfc_main$84,
|
|
144
173
|
UForm: () => form_default,
|
|
145
174
|
UFormItem: () => form_item_default,
|
|
146
175
|
UGanttChart: () => _sfc_main$39,
|
|
147
176
|
UGrid: () => _sfc_main$16,
|
|
148
|
-
UGridInput: () => _sfc_main$
|
|
177
|
+
UGridInput: () => _sfc_main$76,
|
|
149
178
|
UGridItem: () => _sfc_main$17,
|
|
150
|
-
UGroupInput: () => _sfc_main$
|
|
151
|
-
UGroupNav: () => _sfc_main$
|
|
179
|
+
UGroupInput: () => _sfc_main$67,
|
|
180
|
+
UGroupNav: () => _sfc_main$75,
|
|
152
181
|
UIcon: () => _sfc_main,
|
|
153
|
-
UImageCropper: () => _sfc_main$
|
|
182
|
+
UImageCropper: () => _sfc_main$87,
|
|
154
183
|
UInput: () => input_default,
|
|
155
|
-
UKanban: () => _sfc_main$
|
|
184
|
+
UKanban: () => _sfc_main$88,
|
|
156
185
|
UKbd: () => _sfc_main$55,
|
|
157
186
|
ULayout: () => _sfc_main$34,
|
|
158
|
-
UList: () => _sfc_main$
|
|
159
|
-
UListItem: () => _sfc_main$
|
|
187
|
+
UList: () => _sfc_main$68,
|
|
188
|
+
UListItem: () => _sfc_main$69,
|
|
160
189
|
ULoading: () => _sfc_main$5,
|
|
161
190
|
UMessage: () => _sfc_main$40,
|
|
162
191
|
UMessageConfirm: () => _sfc_main$20,
|
|
163
192
|
UMultiSelect: () => _sfc_main$37,
|
|
164
|
-
UMultiTreeSelect: () => _sfc_main$
|
|
165
|
-
UNav: () => _sfc_main$
|
|
166
|
-
UNavItem: () => _sfc_main$
|
|
167
|
-
UNavSub: () => _sfc_main$
|
|
193
|
+
UMultiTreeSelect: () => _sfc_main$66,
|
|
194
|
+
UNav: () => _sfc_main$73,
|
|
195
|
+
UNavItem: () => _sfc_main$71,
|
|
196
|
+
UNavSub: () => _sfc_main$72,
|
|
168
197
|
UNodeRender: () => NodeRender,
|
|
169
198
|
UNotification: () => _sfc_main$33,
|
|
170
199
|
UNumber: () => _sfc_main$51,
|
|
171
200
|
UNumberInput: () => _sfc_main$42,
|
|
172
201
|
UNumberRangeInput: () => _sfc_main$43,
|
|
173
|
-
UPaginator: () => _sfc_main$
|
|
174
|
-
UPalette: () => _sfc_main$
|
|
202
|
+
UPaginator: () => _sfc_main$83,
|
|
203
|
+
UPalette: () => _sfc_main$64,
|
|
175
204
|
UPasswordInput: () => _sfc_main$50,
|
|
176
205
|
UPopConfirm: () => _sfc_main$56,
|
|
177
206
|
UProgress: () => _sfc_main$32,
|
|
178
207
|
UProgressNodes: () => _sfc_main$30,
|
|
179
208
|
URadio: () => _sfc_main$22,
|
|
180
|
-
URadioGroup: () => _sfc_main$
|
|
181
|
-
|
|
209
|
+
URadioGroup: () => _sfc_main$78,
|
|
210
|
+
URate: () => _sfc_main$95,
|
|
211
|
+
URichTextEditor: () => _sfc_main$70,
|
|
182
212
|
UScroll: () => _sfc_main$2,
|
|
183
|
-
USegment: () => _sfc_main$
|
|
213
|
+
USegment: () => _sfc_main$86,
|
|
184
214
|
USelect: () => _sfc_main$6,
|
|
215
|
+
USkeleton: () => _sfc_main$98,
|
|
185
216
|
USlider: () => _sfc_main$38,
|
|
186
|
-
|
|
187
|
-
|
|
217
|
+
USpace: () => _sfc_main$97,
|
|
218
|
+
USteps: () => _sfc_main$62,
|
|
219
|
+
USwitch: () => _sfc_main$77,
|
|
188
220
|
UTable: () => _sfc_main$46,
|
|
189
221
|
UTableEditor: () => _sfc_main$47,
|
|
190
222
|
UTabs: () => _sfc_main$10,
|
|
191
223
|
UTabsHorizontal: () => _sfc_main$8,
|
|
192
224
|
UTabsVertical: () => _sfc_main$9,
|
|
193
225
|
UTag: () => _sfc_main$35,
|
|
194
|
-
UText: () => _sfc_main$
|
|
195
|
-
UTextarea: () => _sfc_main$
|
|
196
|
-
UTheme: () => _sfc_main$
|
|
226
|
+
UText: () => _sfc_main$81,
|
|
227
|
+
UTextarea: () => _sfc_main$60,
|
|
228
|
+
UTheme: () => _sfc_main$65,
|
|
229
|
+
UTimePicker: () => _sfc_main$99,
|
|
230
|
+
UTimeline: () => _sfc_main$102,
|
|
231
|
+
UTimelineItem: () => _sfc_main$103,
|
|
197
232
|
UTip: () => _sfc_main$3,
|
|
233
|
+
UTransfer: () => _sfc_main$59,
|
|
198
234
|
UTree: () => _sfc_main$12,
|
|
199
235
|
UTreeSelect: () => _sfc_main$13,
|
|
200
236
|
UWatermark: () => _sfc_main$54,
|
|
@@ -210,6 +246,6 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
210
246
|
vLoading: () => vLoading
|
|
211
247
|
});
|
|
212
248
|
//#endregion
|
|
213
|
-
export { ContextmenuPanelDIKey, ContextmenuRootDIKey, _sfc_main$57 as UAction, action_group_default as UActionGroup, _sfc_main$31 as UAutoComplete, _sfc_main$
|
|
249
|
+
export { ContextmenuPanelDIKey, ContextmenuRootDIKey, _sfc_main$57 as UAction, action_group_default as UActionGroup, _sfc_main$94 as UAlert, _sfc_main$89 as UAnchor, _sfc_main$90 as UAnchorItem, _sfc_main$31 as UAutoComplete, _sfc_main$91 as UAvatar, _sfc_main$92 as UAvatarGroup, _sfc_main$93 as UBackTop, _sfc_main$85 as UBadge, _sfc_main$58 as UBatchEdit, _sfc_main$82 as UBreadcrumb, _sfc_main$18 as UButton, _sfc_main$19 as UButtonGroup, _sfc_main$21 as UCalendar, _sfc_main$23 as UCard, _sfc_main$27 as UCardAction, _sfc_main$26 as UCardContent, _sfc_main$25 as UCardCover, _sfc_main$24 as UCardHeader, _sfc_main$104 as UCarousel, _sfc_main$105 as UCarouselItem, _sfc_main$61 as UCascade, _sfc_main$48 as UCheckTag, _sfc_main$11 as UCheckbox, _sfc_main$36 as UCheckboxButton, _sfc_main$79 as UCheckboxGroup, _sfc_main$14 as UCodeEditor, _sfc_main$44 as UCollapse, _sfc_main$45 as UCollapseItem, _sfc_main$7 as UConditionEditor, _sfc_main$49 as UContextmenu, _sfc_main$28 as UDatePanel, _sfc_main$63 as UDatePicker, _sfc_main$29 as UDateRangePicker, _sfc_main$101 as UDescriptions, _sfc_main$100 as UDescriptionsItem, _sfc_main$52 as UDialog, _sfc_main$96 as UDivider, _sfc_main$15 as UDrawer, _sfc_main$4 as UDropdown, _sfc_main$74 as UDualNav, _sfc_main$1 as UEmpty, _sfc_main$53 as UExpressionEditor, _sfc_main$41 as UFilePicker, _sfc_main$80 as UFileViewer, _sfc_main$84 as UFloatButton, form_default as UForm, form_item_default as UFormItem, _sfc_main$39 as UGanttChart, _sfc_main$16 as UGrid, _sfc_main$76 as UGridInput, _sfc_main$17 as UGridItem, _sfc_main$67 as UGroupInput, _sfc_main$75 as UGroupNav, _sfc_main as UIcon, _sfc_main$87 as UImageCropper, input_default as UInput, _sfc_main$88 as UKanban, _sfc_main$55 as UKbd, _sfc_main$34 as ULayout, _sfc_main$68 as UList, _sfc_main$69 as UListItem, _sfc_main$5 as ULoading, _sfc_main$40 as UMessage, _sfc_main$20 as UMessageConfirm, _sfc_main$37 as UMultiSelect, _sfc_main$66 as UMultiTreeSelect, _sfc_main$73 as UNav, _sfc_main$71 as UNavItem, _sfc_main$72 as UNavSub, NodeRender as UNodeRender, _sfc_main$33 as UNotification, _sfc_main$51 as UNumber, _sfc_main$42 as UNumberInput, _sfc_main$43 as UNumberRangeInput, _sfc_main$83 as UPaginator, _sfc_main$64 as UPalette, _sfc_main$50 as UPasswordInput, _sfc_main$56 as UPopConfirm, _sfc_main$32 as UProgress, _sfc_main$30 as UProgressNodes, _sfc_main$22 as URadio, _sfc_main$78 as URadioGroup, _sfc_main$95 as URate, _sfc_main$70 as URichTextEditor, _sfc_main$2 as UScroll, _sfc_main$86 as USegment, _sfc_main$6 as USelect, _sfc_main$98 as USkeleton, _sfc_main$38 as USlider, _sfc_main$97 as USpace, _sfc_main$62 as USteps, _sfc_main$77 as USwitch, _sfc_main$46 as UTable, _sfc_main$47 as UTableEditor, _sfc_main$10 as UTabs, _sfc_main$8 as UTabsHorizontal, _sfc_main$9 as UTabsVertical, _sfc_main$35 as UTag, _sfc_main$81 as UText, _sfc_main$60 as UTextarea, _sfc_main$65 as UTheme, _sfc_main$99 as UTimePicker, _sfc_main$102 as UTimeline, _sfc_main$103 as UTimelineItem, _sfc_main$3 as UTip, _sfc_main$59 as UTransfer, _sfc_main$12 as UTree, _sfc_main$13 as UTreeSelect, _sfc_main$54 as UWatermark, components_exports, contextmenu, createEmptyGroup, createEmptyLeaf, defineBatchEditColumns, defineTableColumns, evaluate as evaluateConditionExpression, message, messageConfirm, notification, vLoading };
|
|
214
250
|
|
|
215
251
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/components/index.ts"],"sourcesContent":["export * from './condition-editor'\n\nexport * from './tabs'\n\nexport * from './tree'\n\nexport * from './tree-select'\n\nexport * from './code-editor'\n\nexport * from './dropdown'\n\nexport * from './drawer'\n\nexport * from './form'\n\nexport * from './message-confirm'\n\nexport * from './calendar'\n\nexport * from './radio'\n\nexport * from './card'\n\nexport * from './date-range-picker'\n\nexport * from './loading'\n\nexport * from './scroll'\n\nexport * from './progress-nodes'\n\nexport * from './empty'\n\nexport * from './auto-complete'\n\nexport * from './progress'\n\nexport * from './input'\n\nexport * from './notification'\n\nexport * from './layout'\n\nexport * from './multi-select'\n\nexport * from './checkbox'\n\nexport * from './slider'\n\nexport * from './gantt-chart'\n\nexport * from './message'\n\nexport * from './file-picker'\n\nexport * from './number-range-input'\n\nexport * from './number-input'\n\nexport * from './collapse'\n\nexport * from './date-panel'\n\nexport * from './table-editor'\n\nexport * from './check-tag'\n\nexport * from './contextmenu'\n\nexport * from './password-input'\n\nexport * from './number'\n\nexport * from './dialog'\n\nexport * from './node-render'\n\nexport * from './expression-editor'\n\nexport * from './watermark'\n\nexport * from './batch-edit'\n\nexport * from './action'\n\nexport * from './tip'\n\nexport * from './textarea'\n\nexport * from './button'\n\nexport * from './cascade'\n\nexport * from './steps'\n\nexport * from './date-picker'\n\nexport * from './theme'\n\nexport * from './table'\n\nexport * from './multi-tree-select'\n\nexport * from './group-input'\n\nexport * from './list'\n\nexport * from './rich-text-editor'\n\nexport * from './nav'\n\nexport * from './dual-nav'\n\nexport * from './group-nav'\n\nexport * from './grid-input'\n\nexport * from './switch'\n\nexport * from './form-item'\n\nexport * from './radio-group'\n\nexport * from './checkbox-group'\n\nexport * from './file-viewer'\n\nexport * from './text'\n\nexport * from './select'\n\nexport * from './breadcrumb'\n\nexport * from './icon'\n\nexport * from './kbd'\n\nexport * from './pop-confirm'\n\nexport * from './paginator'\n\nexport * from './tag'\n\nexport * from './float-button'\n\nexport * from './palette'\n\nexport * from './grid'\n\nexport * from './badge'\n\nexport * from './segment'\n\nexport * from './image-cropper'\n\nexport * from './kanban'\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/components/index.ts"],"sourcesContent":["export * from './condition-editor'\n\nexport * from './tabs'\n\nexport * from './tree'\n\nexport * from './tree-select'\n\nexport * from './code-editor'\n\nexport * from './dropdown'\n\nexport * from './drawer'\n\nexport * from './form'\n\nexport * from './message-confirm'\n\nexport * from './calendar'\n\nexport * from './radio'\n\nexport * from './card'\n\nexport * from './date-range-picker'\n\nexport * from './loading'\n\nexport * from './scroll'\n\nexport * from './progress-nodes'\n\nexport * from './empty'\n\nexport * from './auto-complete'\n\nexport * from './progress'\n\nexport * from './input'\n\nexport * from './notification'\n\nexport * from './layout'\n\nexport * from './multi-select'\n\nexport * from './checkbox'\n\nexport * from './slider'\n\nexport * from './gantt-chart'\n\nexport * from './message'\n\nexport * from './file-picker'\n\nexport * from './number-range-input'\n\nexport * from './number-input'\n\nexport * from './collapse'\n\nexport * from './date-panel'\n\nexport * from './table-editor'\n\nexport * from './check-tag'\n\nexport * from './contextmenu'\n\nexport * from './password-input'\n\nexport * from './number'\n\nexport * from './dialog'\n\nexport * from './node-render'\n\nexport * from './expression-editor'\n\nexport * from './watermark'\n\nexport * from './batch-edit'\n\nexport * from './action'\n\nexport * from './tip'\n\nexport * from './transfer'\n\nexport * from './textarea'\n\nexport * from './button'\n\nexport * from './cascade'\n\nexport * from './steps'\n\nexport * from './date-picker'\n\nexport * from './theme'\n\nexport * from './table'\n\nexport * from './multi-tree-select'\n\nexport * from './group-input'\n\nexport * from './list'\n\nexport * from './rich-text-editor'\n\nexport * from './nav'\n\nexport * from './dual-nav'\n\nexport * from './group-nav'\n\nexport * from './grid-input'\n\nexport * from './switch'\n\nexport * from './form-item'\n\nexport * from './radio-group'\n\nexport * from './checkbox-group'\n\nexport * from './file-viewer'\n\nexport * from './text'\n\nexport * from './select'\n\nexport * from './breadcrumb'\n\nexport * from './icon'\n\nexport * from './kbd'\n\nexport * from './pop-confirm'\n\nexport * from './paginator'\n\nexport * from './tag'\n\nexport * from './float-button'\n\nexport * from './palette'\n\nexport * from './grid'\n\nexport * from './badge'\n\nexport * from './segment'\n\nexport * from './image-cropper'\n\nexport * from './kanban'\n\nexport * from './anchor'\n\nexport * from './avatar'\n\nexport * from './back-top'\n\nexport * from './alert'\n\nexport * from './rate'\n\nexport * from './divider'\n\nexport * from './space'\n\nexport * from './skeleton'\n\nexport * from './time-picker'\n\nexport * from './descriptions'\n\nexport * from './timeline'\n\nexport * from './carousel'\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","names":["_sfc_main"],"sources":["../../../src/components/input/input.vue"],"sourcesContent":["<template>\n <div\n v-if=\"!readonly\"\n v-bind=\"$attrs\"\n :class=\"inputClass\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n >\n <span v-if=\"$slots.prefix || prefix\" :class=\"prefixClass\" @click=\"handlePrefixClick\">\n {{ prefix }}\n <slot name=\"prefix\"></slot>\n </span>\n\n <input\n :class=\"cls.e('native')\"\n :placeholder=\"props.placeholder\"\n type=\"text\"\n :value=\"model\"\n @input=\"handleInput\"\n @change=\"handleChange\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @compositionstart=\"handleCompositionStart\"\n @compositionend=\"handleCompositionEnd\"\n autocomplete=\"off\"\n ref=\"el\"\n :disabled=\"disabled\"\n :readonly=\"nativeReadonly\"\n />\n\n <span :class=\"suffixClass\" v-if=\"hasSuffix\">\n <Transition name=\"zoom-in\" mode=\"out-in\">\n <UIcon\n v-if=\"showClear\"\n :class=\"cls.e('clear')\"\n title=\"清除\"\n @click.stop=\"clearModelValue\"\n key=\"clear\"\n >\n <Close />\n </UIcon>\n\n <span v-else :class=\"cls.e('suffix-content')\" @click=\"handleSuffixClick\" key=\"suffix\">\n {{ suffix }}\n <slot name=\"suffix\"></slot>\n </span>\n </Transition>\n </span>\n </div>\n\n <template v-else>\n {{ generateModel || FORM_EMPTY_CONTENT }}\n </template>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { useFocus, useFormFallbackProps } from '@veltra/compositions'\nimport { Close } from '@veltra/icons/normal'\nimport { bem, FORM_EMPTY_CONTENT } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { computed, getCurrentInstance, ref, shallowRef, nextTick } from 'vue'\n\nimport type { InputEmits, InputProps, _InputExposed } from '../../types'\nimport { UIcon } from '../icon'\n\ndefineOptions({ name: 'UInput', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<InputProps>(), {\n placeholder: '请输入',\n clearable: true,\n disabled: undefined,\n readonly: undefined\n})\n\nconst emit = defineEmits<InputEmits>()\n\nconst model = defineModel<string>()\n\nconst inst = getCurrentInstance()\n\nconst cls = bem('input')\n\nconst { formProps } = injectFormContext()\n\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props])\n\nconst { focus, handleBlur, handleFocus } = useFocus((focused) => {\n if (focused) {\n emit('focus')\n } else {\n emit('blur')\n }\n})\n\nconst inputClass = computed(() => {\n return [\n cls.b,\n cls.m(size.value),\n bem.is('disabled', disabled.value),\n bem.is('readonly', readonly.value),\n bem.is('focus', focus.value)\n ]\n})\n\nconst prefixClass = [cls.e('prefix'), bem.is('clickable', !!inst?.vnode.props?.['onPrefix:click'])]\n\nconst suffixClass = [cls.e('suffix'), bem.is('clickable', !!inst?.vnode.props?.['onSuffix:click'])]\n\nlet isComposing = false\n\nfunction handleCompositionStart() {\n isComposing = true\n}\n\nfunction handleCompositionEnd(e: Event) {\n isComposing = false\n handleInput(e)\n}\n\nconst handleInput = (e: Event) => {\n if (isComposing) return\n\n const inputVal = (e.target as HTMLInputElement).value\n emit('native:input', e)\n\n const valid = props.pattern?.test(inputVal) ?? true\n\n if (!valid) return\n model.value = inputVal\n}\n\nconst handlePrefixClick = () => {\n emit('prefix:click', model.value)\n}\n\nconst handleSuffixClick = () => {\n emit('suffix:click', model.value)\n}\n\nconst clearModelValue = () => {\n model.value = ''\n emit('clear')\n}\n\nconst hovered = ref(false)\nconst handleMouseEnter = () => {\n hovered.value = true\n}\n\nconst handleMouseLeave = () => {\n hovered.value = false\n}\n\nconst showClear = computed(() => {\n return props.clearable && !disabled.value && !!model.value && hovered.value\n})\n\nconst hasSuffixContent = computed(() => {\n return !!inst?.slots.suffix || !!props.suffix\n})\n\nconst hasSuffix = computed(() => {\n return hasSuffixContent.value ||
|
|
1
|
+
{"version":3,"file":"input.js","names":["_sfc_main"],"sources":["../../../src/components/input/input.vue"],"sourcesContent":["<template>\n <div\n v-if=\"!readonly\"\n v-bind=\"$attrs\"\n :class=\"inputClass\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n >\n <span v-if=\"$slots.prefix || prefix\" :class=\"prefixClass\" @click=\"handlePrefixClick\">\n {{ prefix }}\n <slot name=\"prefix\"></slot>\n </span>\n\n <input\n :class=\"cls.e('native')\"\n :placeholder=\"props.placeholder\"\n type=\"text\"\n :value=\"model\"\n @input=\"handleInput\"\n @change=\"handleChange\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @compositionstart=\"handleCompositionStart\"\n @compositionend=\"handleCompositionEnd\"\n autocomplete=\"off\"\n ref=\"el\"\n :disabled=\"disabled\"\n :readonly=\"nativeReadonly\"\n />\n\n <span :class=\"suffixClass\" v-if=\"hasSuffix\">\n <Transition name=\"zoom-in\" mode=\"out-in\">\n <UIcon\n v-if=\"showClear\"\n :class=\"cls.e('clear')\"\n title=\"清除\"\n @click.stop=\"clearModelValue\"\n key=\"clear\"\n >\n <Close />\n </UIcon>\n\n <span v-else :class=\"cls.e('suffix-content')\" @click=\"handleSuffixClick\" key=\"suffix\">\n {{ suffix }}\n <slot name=\"suffix\"></slot>\n </span>\n </Transition>\n </span>\n </div>\n\n <template v-else>\n {{ generateModel || FORM_EMPTY_CONTENT }}\n </template>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { useFocus, useFormFallbackProps } from '@veltra/compositions'\nimport { Close } from '@veltra/icons/normal'\nimport { bem, FORM_EMPTY_CONTENT } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { computed, getCurrentInstance, ref, shallowRef, nextTick } from 'vue'\n\nimport type { InputEmits, InputProps, _InputExposed } from '../../types'\nimport { UIcon } from '../icon'\n\ndefineOptions({ name: 'UInput', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<InputProps>(), {\n placeholder: '请输入',\n clearable: true,\n disabled: undefined,\n readonly: undefined\n})\n\nconst emit = defineEmits<InputEmits>()\n\nconst model = defineModel<string>()\n\nconst inst = getCurrentInstance()\n\nconst cls = bem('input')\n\nconst { formProps } = injectFormContext()\n\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props])\n\nconst { focus, handleBlur, handleFocus } = useFocus((focused) => {\n if (focused) {\n emit('focus')\n } else {\n emit('blur')\n }\n})\n\nconst inputClass = computed(() => {\n return [\n cls.b,\n cls.m(size.value),\n bem.is('disabled', disabled.value),\n bem.is('readonly', readonly.value),\n bem.is('focus', focus.value)\n ]\n})\n\nconst prefixClass = [cls.e('prefix'), bem.is('clickable', !!inst?.vnode.props?.['onPrefix:click'])]\n\nconst suffixClass = [cls.e('suffix'), bem.is('clickable', !!inst?.vnode.props?.['onSuffix:click'])]\n\nlet isComposing = false\n\nfunction handleCompositionStart() {\n isComposing = true\n}\n\nfunction handleCompositionEnd(e: Event) {\n isComposing = false\n handleInput(e)\n}\n\nconst handleInput = (e: Event) => {\n if (isComposing) return\n\n const inputVal = (e.target as HTMLInputElement).value\n emit('native:input', e)\n\n const valid = props.pattern?.test(inputVal) ?? true\n\n if (!valid) return\n model.value = inputVal\n}\n\nconst handlePrefixClick = () => {\n emit('prefix:click', model.value)\n}\n\nconst handleSuffixClick = () => {\n // 占位空后缀不触发点击(与恒渲染前的行为一致)\n if (!hasSuffixContent.value) return\n emit('suffix:click', model.value)\n}\n\nconst clearModelValue = () => {\n model.value = ''\n emit('clear')\n}\n\nconst hovered = ref(false)\nconst handleMouseEnter = () => {\n hovered.value = true\n}\n\nconst handleMouseLeave = () => {\n hovered.value = false\n}\n\nconst showClear = computed(() => {\n return props.clearable && !disabled.value && !!model.value && hovered.value\n})\n\nconst hasSuffixContent = computed(() => {\n return !!inst?.slots.suffix || !!props.suffix\n})\n\n// clearable 时后缀恒渲染占位(min-width 20px),避免 hover 出现清除图标时宽度跳变\nconst hasSuffix = computed(() => {\n return hasSuffixContent.value || props.clearable\n})\n\nconst handleChange = (e: Event) => {\n const target = e.target as HTMLInputElement\n\n const valid = props.pattern?.test(target.value) ?? true\n\n if (valid) {\n emit('change', target.value)\n } else {\n nextTick(() => {\n target.value = model.value ?? ''\n })\n }\n}\n\nconst el = shallowRef<HTMLInputElement>()\n\nconst generateModel = computed(() => {\n if (!model.value) return ''\n\n return `${props.prefix ?? ''}${model.value}${props.suffix ?? ''}`\n})\n\ndefineExpose<_InputExposed>({ el })\n</script>\n"],"mappings":""}
|
|
@@ -95,6 +95,7 @@ var input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
95
95
|
emit("prefix:click", model.value);
|
|
96
96
|
};
|
|
97
97
|
const handleSuffixClick = () => {
|
|
98
|
+
if (!hasSuffixContent.value) return;
|
|
98
99
|
emit("suffix:click", model.value);
|
|
99
100
|
};
|
|
100
101
|
const clearModelValue = () => {
|
|
@@ -115,7 +116,7 @@ var input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
115
116
|
return !!inst?.slots.suffix || !!props.suffix;
|
|
116
117
|
});
|
|
117
118
|
const hasSuffix = computed(() => {
|
|
118
|
-
return hasSuffixContent.value ||
|
|
119
|
+
return hasSuffixContent.value || props.clearable;
|
|
119
120
|
});
|
|
120
121
|
const handleChange = (e) => {
|
|
121
122
|
const target = e.target;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.vue_vue_type_script_setup_true_lang.js","names":["$attrs","$slots","_useModel","_unref","_openBlock","_createElementBlock","_mergeProps","_normalizeClass","_createTextVNode","_toDisplayString","_renderSlot","_createCommentVNode","_createElementVNode","_createVNode","_Transition","_withCtx","_createBlock","UIcon","_withModifiers","_Fragment"],"sources":["../../../src/components/input/input.vue"],"sourcesContent":["<template>\n <div\n v-if=\"!readonly\"\n v-bind=\"$attrs\"\n :class=\"inputClass\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n >\n <span v-if=\"$slots.prefix || prefix\" :class=\"prefixClass\" @click=\"handlePrefixClick\">\n {{ prefix }}\n <slot name=\"prefix\"></slot>\n </span>\n\n <input\n :class=\"cls.e('native')\"\n :placeholder=\"props.placeholder\"\n type=\"text\"\n :value=\"model\"\n @input=\"handleInput\"\n @change=\"handleChange\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @compositionstart=\"handleCompositionStart\"\n @compositionend=\"handleCompositionEnd\"\n autocomplete=\"off\"\n ref=\"el\"\n :disabled=\"disabled\"\n :readonly=\"nativeReadonly\"\n />\n\n <span :class=\"suffixClass\" v-if=\"hasSuffix\">\n <Transition name=\"zoom-in\" mode=\"out-in\">\n <UIcon\n v-if=\"showClear\"\n :class=\"cls.e('clear')\"\n title=\"清除\"\n @click.stop=\"clearModelValue\"\n key=\"clear\"\n >\n <Close />\n </UIcon>\n\n <span v-else :class=\"cls.e('suffix-content')\" @click=\"handleSuffixClick\" key=\"suffix\">\n {{ suffix }}\n <slot name=\"suffix\"></slot>\n </span>\n </Transition>\n </span>\n </div>\n\n <template v-else>\n {{ generateModel || FORM_EMPTY_CONTENT }}\n </template>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { useFocus, useFormFallbackProps } from '@veltra/compositions'\nimport { Close } from '@veltra/icons/normal'\nimport { bem, FORM_EMPTY_CONTENT } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { computed, getCurrentInstance, ref, shallowRef, nextTick } from 'vue'\n\nimport type { InputEmits, InputProps, _InputExposed } from '../../types'\nimport { UIcon } from '../icon'\n\ndefineOptions({ name: 'UInput', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<InputProps>(), {\n placeholder: '请输入',\n clearable: true,\n disabled: undefined,\n readonly: undefined\n})\n\nconst emit = defineEmits<InputEmits>()\n\nconst model = defineModel<string>()\n\nconst inst = getCurrentInstance()\n\nconst cls = bem('input')\n\nconst { formProps } = injectFormContext()\n\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props])\n\nconst { focus, handleBlur, handleFocus } = useFocus((focused) => {\n if (focused) {\n emit('focus')\n } else {\n emit('blur')\n }\n})\n\nconst inputClass = computed(() => {\n return [\n cls.b,\n cls.m(size.value),\n bem.is('disabled', disabled.value),\n bem.is('readonly', readonly.value),\n bem.is('focus', focus.value)\n ]\n})\n\nconst prefixClass = [cls.e('prefix'), bem.is('clickable', !!inst?.vnode.props?.['onPrefix:click'])]\n\nconst suffixClass = [cls.e('suffix'), bem.is('clickable', !!inst?.vnode.props?.['onSuffix:click'])]\n\nlet isComposing = false\n\nfunction handleCompositionStart() {\n isComposing = true\n}\n\nfunction handleCompositionEnd(e: Event) {\n isComposing = false\n handleInput(e)\n}\n\nconst handleInput = (e: Event) => {\n if (isComposing) return\n\n const inputVal = (e.target as HTMLInputElement).value\n emit('native:input', e)\n\n const valid = props.pattern?.test(inputVal) ?? true\n\n if (!valid) return\n model.value = inputVal\n}\n\nconst handlePrefixClick = () => {\n emit('prefix:click', model.value)\n}\n\nconst handleSuffixClick = () => {\n emit('suffix:click', model.value)\n}\n\nconst clearModelValue = () => {\n model.value = ''\n emit('clear')\n}\n\nconst hovered = ref(false)\nconst handleMouseEnter = () => {\n hovered.value = true\n}\n\nconst handleMouseLeave = () => {\n hovered.value = false\n}\n\nconst showClear = computed(() => {\n return props.clearable && !disabled.value && !!model.value && hovered.value\n})\n\nconst hasSuffixContent = computed(() => {\n return !!inst?.slots.suffix || !!props.suffix\n})\n\nconst hasSuffix = computed(() => {\n return hasSuffixContent.value ||
|
|
1
|
+
{"version":3,"file":"input.vue_vue_type_script_setup_true_lang.js","names":["$attrs","$slots","_useModel","_unref","_openBlock","_createElementBlock","_mergeProps","_normalizeClass","_createTextVNode","_toDisplayString","_renderSlot","_createCommentVNode","_createElementVNode","_createVNode","_Transition","_withCtx","_createBlock","UIcon","_withModifiers","_Fragment"],"sources":["../../../src/components/input/input.vue"],"sourcesContent":["<template>\n <div\n v-if=\"!readonly\"\n v-bind=\"$attrs\"\n :class=\"inputClass\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n >\n <span v-if=\"$slots.prefix || prefix\" :class=\"prefixClass\" @click=\"handlePrefixClick\">\n {{ prefix }}\n <slot name=\"prefix\"></slot>\n </span>\n\n <input\n :class=\"cls.e('native')\"\n :placeholder=\"props.placeholder\"\n type=\"text\"\n :value=\"model\"\n @input=\"handleInput\"\n @change=\"handleChange\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @compositionstart=\"handleCompositionStart\"\n @compositionend=\"handleCompositionEnd\"\n autocomplete=\"off\"\n ref=\"el\"\n :disabled=\"disabled\"\n :readonly=\"nativeReadonly\"\n />\n\n <span :class=\"suffixClass\" v-if=\"hasSuffix\">\n <Transition name=\"zoom-in\" mode=\"out-in\">\n <UIcon\n v-if=\"showClear\"\n :class=\"cls.e('clear')\"\n title=\"清除\"\n @click.stop=\"clearModelValue\"\n key=\"clear\"\n >\n <Close />\n </UIcon>\n\n <span v-else :class=\"cls.e('suffix-content')\" @click=\"handleSuffixClick\" key=\"suffix\">\n {{ suffix }}\n <slot name=\"suffix\"></slot>\n </span>\n </Transition>\n </span>\n </div>\n\n <template v-else>\n {{ generateModel || FORM_EMPTY_CONTENT }}\n </template>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { useFocus, useFormFallbackProps } from '@veltra/compositions'\nimport { Close } from '@veltra/icons/normal'\nimport { bem, FORM_EMPTY_CONTENT } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { computed, getCurrentInstance, ref, shallowRef, nextTick } from 'vue'\n\nimport type { InputEmits, InputProps, _InputExposed } from '../../types'\nimport { UIcon } from '../icon'\n\ndefineOptions({ name: 'UInput', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<InputProps>(), {\n placeholder: '请输入',\n clearable: true,\n disabled: undefined,\n readonly: undefined\n})\n\nconst emit = defineEmits<InputEmits>()\n\nconst model = defineModel<string>()\n\nconst inst = getCurrentInstance()\n\nconst cls = bem('input')\n\nconst { formProps } = injectFormContext()\n\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props])\n\nconst { focus, handleBlur, handleFocus } = useFocus((focused) => {\n if (focused) {\n emit('focus')\n } else {\n emit('blur')\n }\n})\n\nconst inputClass = computed(() => {\n return [\n cls.b,\n cls.m(size.value),\n bem.is('disabled', disabled.value),\n bem.is('readonly', readonly.value),\n bem.is('focus', focus.value)\n ]\n})\n\nconst prefixClass = [cls.e('prefix'), bem.is('clickable', !!inst?.vnode.props?.['onPrefix:click'])]\n\nconst suffixClass = [cls.e('suffix'), bem.is('clickable', !!inst?.vnode.props?.['onSuffix:click'])]\n\nlet isComposing = false\n\nfunction handleCompositionStart() {\n isComposing = true\n}\n\nfunction handleCompositionEnd(e: Event) {\n isComposing = false\n handleInput(e)\n}\n\nconst handleInput = (e: Event) => {\n if (isComposing) return\n\n const inputVal = (e.target as HTMLInputElement).value\n emit('native:input', e)\n\n const valid = props.pattern?.test(inputVal) ?? true\n\n if (!valid) return\n model.value = inputVal\n}\n\nconst handlePrefixClick = () => {\n emit('prefix:click', model.value)\n}\n\nconst handleSuffixClick = () => {\n // 占位空后缀不触发点击(与恒渲染前的行为一致)\n if (!hasSuffixContent.value) return\n emit('suffix:click', model.value)\n}\n\nconst clearModelValue = () => {\n model.value = ''\n emit('clear')\n}\n\nconst hovered = ref(false)\nconst handleMouseEnter = () => {\n hovered.value = true\n}\n\nconst handleMouseLeave = () => {\n hovered.value = false\n}\n\nconst showClear = computed(() => {\n return props.clearable && !disabled.value && !!model.value && hovered.value\n})\n\nconst hasSuffixContent = computed(() => {\n return !!inst?.slots.suffix || !!props.suffix\n})\n\n// clearable 时后缀恒渲染占位(min-width 20px),避免 hover 出现清除图标时宽度跳变\nconst hasSuffix = computed(() => {\n return hasSuffixContent.value || props.clearable\n})\n\nconst handleChange = (e: Event) => {\n const target = e.target as HTMLInputElement\n\n const valid = props.pattern?.test(target.value) ?? true\n\n if (valid) {\n emit('change', target.value)\n } else {\n nextTick(() => {\n target.value = model.value ?? ''\n })\n }\n}\n\nconst el = shallowRef<HTMLInputElement>()\n\nconst generateModel = computed(() => {\n if (!model.value) return ''\n\n return `${props.prefix ?? ''}${model.value}${props.suffix ?? ''}`\n})\n\ndefineExpose<_InputExposed>({ el })\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEA,MAAM,QAAQ;EAOd,MAAM,OAAO;EAEb,MAAM,QAAQE,SAAmB,SAAA,YAAC;EAElC,MAAM,OAAO,mBAAmB;EAEhC,MAAM,MAAM,IAAI,OAAO;EAEvB,MAAM,EAAE,cAAc,kBAAkB;EAExC,MAAM,EAAE,MAAM,UAAU,aAAa,qBAAqB,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;EAElF,MAAM,EAAE,OAAO,YAAY,gBAAgB,UAAU,YAAY;GAC/D,IAAI,SACF,KAAK,OAAO;QAEZ,KAAK,MAAM;EAEf,CAAC;EAED,MAAM,aAAa,eAAe;GAChC,OAAO;IACL,IAAI;IACJ,IAAI,EAAE,KAAK,KAAK;IAChB,IAAI,GAAG,YAAY,SAAS,KAAK;IACjC,IAAI,GAAG,YAAY,SAAS,KAAK;IACjC,IAAI,GAAG,SAAS,MAAM,KAAK;GAAA;EAE/B,CAAC;EAED,MAAM,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,aAAa,CAAC,CAAC,MAAM,MAAM,QAAQ,iBAAiB,CAAC;EAElG,MAAM,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,aAAa,CAAC,CAAC,MAAM,MAAM,QAAQ,iBAAiB,CAAC;EAElG,IAAI,cAAc;EAElB,SAAS,yBAAyB;GAChC,cAAc;EAChB;EAEA,SAAS,qBAAqB,GAAU;GACtC,cAAc;GACd,YAAY,CAAC;EACf;EAEA,MAAM,eAAe,MAAa;GACh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AA,CAAAA,OAAAA,CAAAA,MAAAA,UAAA,GAAAC,mBAGO,QAAA;MAHO,OAAKE,eAAEJ,MAAA,GAAA,CAAG,CAAC,EAAC,gBAAA,CAAA;MAAqB,SAAO;MAAmB,KAAI;KACxEK,GAAAA,CAAAA,gBAAAC,gBAAA,QAAA,MAAM,IAAG,KACZ,CAAA,GAAAC,WAA2B,KAAA,QAAA,QAAA,CAAA,GAAA,CAAA,EAAA,CAAA;;;GAMnCN,GAAAA,EAAAA,MAAAA,UAAA,GAAAC,mBAEWc,UAAA,EAAA,KAAA,EAAA,GAAA,CADNX,gBAAAC,gBAAA,cAAA,SAAiBN,MAAA,kBAAA,CAAkB,GAAA,CAAA,CAAA,GAAA,EAAA"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import _sfc_main$1 from "../icon/icon.js";
|
|
2
|
+
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, normalizeClass, normalizeStyle, openBlock, ref, renderList, toDisplayString, unref, useModel, withCtx } from "vue";
|
|
3
|
+
import { useFormFallbackProps } from "@veltra/compositions";
|
|
4
|
+
import { bem, injectFormContext } from "@veltra/utils";
|
|
5
|
+
import { StarFilled } from "@veltra/icons/normal";
|
|
6
|
+
//#region src/components/rate/rate.vue
|
|
7
|
+
const _hoisted_1 = [
|
|
8
|
+
"tabindex",
|
|
9
|
+
"aria-valuemax",
|
|
10
|
+
"aria-valuenow"
|
|
11
|
+
];
|
|
12
|
+
const _hoisted_2 = ["onMousemove", "onClick"];
|
|
13
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
14
|
+
name: "URate",
|
|
15
|
+
__name: "rate",
|
|
16
|
+
props: /*@__PURE__*/ mergeModels({
|
|
17
|
+
modelValue: {},
|
|
18
|
+
count: {},
|
|
19
|
+
allowHalf: { type: Boolean },
|
|
20
|
+
character: {},
|
|
21
|
+
color: {},
|
|
22
|
+
tips: {},
|
|
23
|
+
span: {},
|
|
24
|
+
label: {},
|
|
25
|
+
field: {},
|
|
26
|
+
disabled: { type: Boolean },
|
|
27
|
+
readonly: { type: Boolean },
|
|
28
|
+
rules: {},
|
|
29
|
+
size: {}
|
|
30
|
+
}, {
|
|
31
|
+
"modelValue": { default: 0 },
|
|
32
|
+
"modelModifiers": {}
|
|
33
|
+
}),
|
|
34
|
+
emits: /*@__PURE__*/ mergeModels(["update:modelValue", "change"], ["update:modelValue"]),
|
|
35
|
+
setup(__props, { emit: __emit }) {
|
|
36
|
+
const props = __props;
|
|
37
|
+
const emit = __emit;
|
|
38
|
+
const cls = bem("rate");
|
|
39
|
+
const model = useModel(__props, "modelValue");
|
|
40
|
+
const { formProps } = injectFormContext();
|
|
41
|
+
const { disabled, readonly } = useFormFallbackProps([formProps ?? {}, props]);
|
|
42
|
+
const count = computed(() => props.count ?? 5);
|
|
43
|
+
/** 步长:允许半星时 0.5,否则 1 */
|
|
44
|
+
const step = computed(() => props.allowHalf ? .5 : 1);
|
|
45
|
+
/** 悬浮预览的分值,未悬浮时为 undefined */
|
|
46
|
+
const hoverValue = ref();
|
|
47
|
+
const interactive = computed(() => !disabled.value && !readonly.value);
|
|
48
|
+
const className = computed(() => [
|
|
49
|
+
cls.b,
|
|
50
|
+
bem.is("disabled", disabled.value),
|
|
51
|
+
bem.is("readonly", readonly.value)
|
|
52
|
+
]);
|
|
53
|
+
/** color 属性经 CSS 变量注入,未传时走 token 默认值 */
|
|
54
|
+
const rateStyle = computed(() => ({ "--u-rate-active-color": props.color }));
|
|
55
|
+
/** 当前展示分值:悬浮预览优先 */
|
|
56
|
+
const displayValue = computed(() => hoverValue.value ?? model.value);
|
|
57
|
+
/** 第 star 颗星彩色层的裁剪宽度 */
|
|
58
|
+
const overlayWidth = (star) => {
|
|
59
|
+
const value = displayValue.value;
|
|
60
|
+
if (value >= star) return "100%";
|
|
61
|
+
if (props.allowHalf && value >= star - .5) return "50%";
|
|
62
|
+
return "0%";
|
|
63
|
+
};
|
|
64
|
+
/** 按事件位置算分值:左半颗 0.5(allowHalf 时),右半颗整颗 */
|
|
65
|
+
const eventToValue = (star, e) => {
|
|
66
|
+
if (!props.allowHalf) return star;
|
|
67
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
68
|
+
return e.clientX - rect.left < rect.width / 2 ? star - .5 : star;
|
|
69
|
+
};
|
|
70
|
+
const handleItemMove = (star, e) => {
|
|
71
|
+
if (!interactive.value) return;
|
|
72
|
+
hoverValue.value = eventToValue(star, e);
|
|
73
|
+
};
|
|
74
|
+
const handleItemClick = (star, e) => {
|
|
75
|
+
if (!interactive.value) return;
|
|
76
|
+
setValue(eventToValue(star, e));
|
|
77
|
+
};
|
|
78
|
+
const handleKeydown = (e) => {
|
|
79
|
+
if (!interactive.value) return;
|
|
80
|
+
const delta = {
|
|
81
|
+
ArrowRight: step.value,
|
|
82
|
+
ArrowUp: step.value,
|
|
83
|
+
ArrowLeft: -step.value,
|
|
84
|
+
ArrowDown: -step.value
|
|
85
|
+
}[e.key];
|
|
86
|
+
if (delta === void 0) return;
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
setValue(clamp(model.value + delta));
|
|
89
|
+
};
|
|
90
|
+
const clamp = (value) => Math.min(Math.max(value, 0), count.value);
|
|
91
|
+
const setValue = (value) => {
|
|
92
|
+
if (value === model.value) return;
|
|
93
|
+
model.value = value;
|
|
94
|
+
emit("change", value);
|
|
95
|
+
};
|
|
96
|
+
return (_ctx, _cache) => {
|
|
97
|
+
return openBlock(), createElementBlock("div", {
|
|
98
|
+
class: normalizeClass(className.value),
|
|
99
|
+
style: normalizeStyle(rateStyle.value),
|
|
100
|
+
tabindex: interactive.value ? 0 : -1,
|
|
101
|
+
role: "slider",
|
|
102
|
+
"aria-valuemin": 0,
|
|
103
|
+
"aria-valuemax": count.value,
|
|
104
|
+
"aria-valuenow": model.value,
|
|
105
|
+
onMouseleave: _cache[0] || (_cache[0] = ($event) => hoverValue.value = void 0),
|
|
106
|
+
onKeydown: handleKeydown
|
|
107
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(count.value, (star) => {
|
|
108
|
+
return openBlock(), createElementBlock("div", {
|
|
109
|
+
key: star,
|
|
110
|
+
class: normalizeClass(unref(cls).e("item")),
|
|
111
|
+
onMousemove: ($event) => handleItemMove(star, $event),
|
|
112
|
+
onClick: ($event) => handleItemClick(star, $event)
|
|
113
|
+
}, [createElementVNode("span", { class: normalizeClass(unref(cls).e("base")) }, [!__props.character ? (openBlock(), createBlock(unref(_sfc_main$1), { key: 0 }, {
|
|
114
|
+
default: withCtx(() => [createVNode(unref(StarFilled))]),
|
|
115
|
+
_: 1
|
|
116
|
+
})) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(__props.character), 1)], 64))], 2), createElementVNode("span", {
|
|
117
|
+
class: normalizeClass(unref(cls).e("overlay")),
|
|
118
|
+
style: normalizeStyle({ width: overlayWidth(star) })
|
|
119
|
+
}, [!__props.character ? (openBlock(), createBlock(unref(_sfc_main$1), { key: 0 }, {
|
|
120
|
+
default: withCtx(() => [createVNode(unref(StarFilled))]),
|
|
121
|
+
_: 1
|
|
122
|
+
})) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(__props.character), 1)], 64))], 6)], 42, _hoisted_2);
|
|
123
|
+
}), 128))], 46, _hoisted_1);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
//#endregion
|
|
128
|
+
export { _sfc_main as default };
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=rate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate.js","names":["_useModel","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_Fragment","_renderList","_unref","_createElementVNode","_createBlock","UIcon","_withCtx","_createVNode","_createTextVNode","_toDisplayString"],"sources":["../../../src/components/rate/rate.vue"],"sourcesContent":["<template>\n <div\n :class=\"className\"\n :style=\"rateStyle\"\n :tabindex=\"interactive ? 0 : -1\"\n role=\"slider\"\n :aria-valuemin=\"0\"\n :aria-valuemax=\"count\"\n :aria-valuenow=\"model\"\n @mouseleave=\"hoverValue = undefined\"\n @keydown=\"handleKeydown\"\n >\n <div\n v-for=\"star in count\"\n :key=\"star\"\n :class=\"cls.e('item')\"\n @mousemove=\"handleItemMove(star, $event)\"\n @click=\"handleItemClick(star, $event)\"\n >\n <span :class=\"cls.e('base')\">\n <u-icon v-if=\"!character\"><StarFilled /></u-icon>\n <template v-else>{{ character }}</template>\n </span>\n\n <span :class=\"cls.e('overlay')\" :style=\"{ width: overlayWidth(star) }\">\n <u-icon v-if=\"!character\"><StarFilled /></u-icon>\n <template v-else>{{ character }}</template>\n </span>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFormFallbackProps } from '@veltra/compositions'\nimport { StarFilled } from '@veltra/icons/normal'\nimport { bem, injectFormContext } from '@veltra/utils'\nimport { computed, ref, type CSSProperties } from 'vue'\n\nimport type { RateEmits, RateProps } from '../../types'\nimport { UIcon } from '../icon'\n\ndefineOptions({ name: 'URate' })\n\nconst props = defineProps<RateProps>()\n\nconst emit = defineEmits<RateEmits>()\n\nconst cls = bem('rate')\n\nconst model = defineModel<number>({ default: 0 })\n\nconst { formProps } = injectFormContext()\n\nconst { disabled, readonly } = useFormFallbackProps([formProps ?? {}, props])\n\nconst count = computed(() => props.count ?? 5)\n\n/** 步长:允许半星时 0.5,否则 1 */\nconst step = computed(() => (props.allowHalf ? 0.5 : 1))\n\n/** 悬浮预览的分值,未悬浮时为 undefined */\nconst hoverValue = ref<number | undefined>()\n\nconst interactive = computed(() => !disabled.value && !readonly.value)\n\nconst className = computed(() => [\n cls.b,\n bem.is('disabled', disabled.value),\n bem.is('readonly', readonly.value)\n])\n\n/** color 属性经 CSS 变量注入,未传时走 token 默认值 */\nconst rateStyle = computed<CSSProperties>(() => ({ '--u-rate-active-color': props.color }))\n\n/** 当前展示分值:悬浮预览优先 */\nconst displayValue = computed(() => hoverValue.value ?? model.value)\n\n/** 第 star 颗星彩色层的裁剪宽度 */\nconst overlayWidth = (star: number) => {\n const value = displayValue.value\n if (value >= star) return '100%'\n if (props.allowHalf && value >= star - 0.5) return '50%'\n return '0%'\n}\n\n/** 按事件位置算分值:左半颗 0.5(allowHalf 时),右半颗整颗 */\nconst eventToValue = (star: number, e: MouseEvent) => {\n if (!props.allowHalf) return star\n\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect()\n return e.clientX - rect.left < rect.width / 2 ? star - 0.5 : star\n}\n\nconst handleItemMove = (star: number, e: MouseEvent) => {\n if (!interactive.value) return\n hoverValue.value = eventToValue(star, e)\n}\n\nconst handleItemClick = (star: number, e: MouseEvent) => {\n if (!interactive.value) return\n setValue(eventToValue(star, e))\n}\n\nconst handleKeydown = (e: KeyboardEvent) => {\n if (!interactive.value) return\n\n const keyMap: Record<string, number> = {\n ArrowRight: step.value,\n ArrowUp: step.value,\n ArrowLeft: -step.value,\n ArrowDown: -step.value\n }\n const delta = keyMap[e.key]\n if (delta === undefined) return\n\n e.preventDefault()\n setValue(clamp(model.value + delta))\n}\n\nconst clamp = (value: number) => Math.min(Math.max(value, 0), count.value)\n\nconst setValue = (value: number) => {\n if (value === model.value) return\n model.value = value\n emit('change', value)\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAEb,MAAM,MAAM,IAAI,MAAM;EAEtB,MAAM,QAAQA,SAAmB,SAAA,YAAe;EAEhD,MAAM,EAAE,cAAc,kBAAkB;EAExC,MAAM,EAAE,UAAU,aAAa,qBAAqB,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;EAE5E,MAAM,QAAQ,eAAe,MAAM,SAAS,CAAC;;EAG7C,MAAM,OAAO,eAAgB,MAAM,YAAY,KAAM,CAAE;;EAGvD,MAAM,aAAa,IAAwB;EAE3C,MAAM,cAAc,eAAe,CAAC,SAAS,SAAS,CAAC,S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AAA;KAAvB,SAAAC,cAAc,CAAdC,YAAcL,MAAA,UAAA,CAAA,CAAA,CAAA;;IACxC,CAAA,MAAAN,UAAA,GAAAC,mBAA2CG,UAAA,EAAA,KAAA,EAAA,GAAA,CAAvBQ,gBAAAC,gBAAA,QAAA,SAAS,GAAA,CAAA,CAAA,GAAA,EAAA,EAAA,GAAA,CAAA,CAAA,GAAA,IAAA,UAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./style2.css";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/** flex布局 */
|
|
3
|
+
/**
|
|
4
|
+
* 设置css变量
|
|
5
|
+
* 参数1:变量前缀
|
|
6
|
+
* 参数2: 一个由值组成的列表或者由key, value组成的map
|
|
7
|
+
* css-var(height, (
|
|
8
|
+
* large: 40px
|
|
9
|
+
* default: 32px
|
|
10
|
+
* small: 24px
|
|
11
|
+
* ))
|
|
12
|
+
* 生成的css变量:
|
|
13
|
+
* --u-height-large: 40px;
|
|
14
|
+
* --u-height-default: 32px;
|
|
15
|
+
* --u-height-small: 24px;
|
|
16
|
+
*/
|
|
17
|
+
/** 暗色:`UITheme.render()` 按主题系列写入 html[data-theme] */
|
|
18
|
+
.u-rate {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
justify-content: flex-start;
|
|
21
|
+
align-items: center;
|
|
22
|
+
flex-wrap: nowrap;
|
|
23
|
+
gap: var(--u-gap-small);
|
|
24
|
+
font-size: var(--u-font-size-main-large);
|
|
25
|
+
outline: none;
|
|
26
|
+
border-radius: var(--u-radius-small);
|
|
27
|
+
}
|
|
28
|
+
.u-rate.is-disabled {
|
|
29
|
+
cursor: not-allowed;
|
|
30
|
+
opacity: 0.55;
|
|
31
|
+
}
|
|
32
|
+
.u-rate.is-readonly {
|
|
33
|
+
cursor: default;
|
|
34
|
+
}
|
|
35
|
+
.u-rate:not(.is-readonly):not(.is-disabled) {
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
.u-rate:not(.is-readonly):not(.is-disabled):focus-visible {
|
|
39
|
+
box-shadow: var(--u-focus-ring);
|
|
40
|
+
}
|
|
41
|
+
.u-rate__item {
|
|
42
|
+
position: relative;
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
}
|
|
45
|
+
.u-rate__base {
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
color: var(--u-text-color-placeholder);
|
|
48
|
+
}
|
|
49
|
+
.u-rate__overlay {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 0;
|
|
52
|
+
left: 0;
|
|
53
|
+
height: 100%;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
color: var(--u-rate-active-color, var(--u-color-warning));
|
|
58
|
+
}
|