x-next 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/AI_USAGE.md +67 -7
  2. package/CHANGELOG.md +24 -0
  3. package/dist/_utils/chart/scale.d.ts +1 -1
  4. package/dist/components/_components/chart/axis-labels.d.ts +8 -0
  5. package/dist/components/link/Link.vue.d.ts +1 -1
  6. package/dist/components/link/index.d.ts +3 -3
  7. package/dist/components/virtual-list-v2/interface.d.ts +3 -0
  8. package/dist/components/virtual-list-v2/virtual-list.vue.d.ts +336 -1
  9. package/dist/es/_hooks/use-component-ref.js +9 -9
  10. package/dist/es/_utils/chart/scale.js +44 -39
  11. package/dist/es/components/_components/chart/ChartAxis.js +61 -36
  12. package/dist/es/components/_components/chart/axis-labels.js +26 -0
  13. package/dist/es/components/button/Button.js +23 -23
  14. package/dist/es/components/form-select/Select.js +142 -141
  15. package/dist/es/components/trigger/Trigger.js +174 -183
  16. package/dist/es/components/virtual-list-v2/virtual-list.vue.js +22 -23
  17. package/dist/es/components/virtual-list-v2/virtual-list.vue2.js +67 -53
  18. package/dist/es/icons/icon.js +37 -36
  19. package/dist/es/icons/index.js +6 -8
  20. package/dist/es/icons/public/lucide-names.js +167 -0
  21. package/dist/es/icons/public/lucide.js +75 -188
  22. package/dist/es/index.js +152 -148
  23. package/dist/es/style.css +1 -1
  24. package/dist/icons/index.d.ts +3 -3
  25. package/dist/icons/names.d.ts +2 -2
  26. package/dist/icons/public/lucide-names.d.ts +32 -0
  27. package/dist/icons/public/lucide.d.ts +2 -2
  28. package/dist/index.cjs +3 -62
  29. package/dist/index.umd.js +3 -62
  30. package/dist/style/base.css +1 -1
  31. package/dist/style/button.css +1 -1
  32. package/dist/style.css +1 -1
  33. package/package.json +3 -2
package/AI_USAGE.md CHANGED
@@ -1,11 +1,11 @@
1
1
  <!-- Generated by pnpm generate:ai-usage. Edit src/docs/guide/ai-usage.md and script/ai-usage/manifest.js. -->
2
2
  # x-next AI 使用手册
3
3
 
4
- 适用版本:**x-next@1.9.0**。Vue:`^3.5.0`;Node:`>=20.19.0`。
4
+ 适用版本:**x-next@1.10.0**。Vue:`^3.5.0`;Node:`>=20.19.0`。
5
5
 
6
- 来源指纹(精选示例、映射、版本与公开类型声明):`151adc8affe9aa22cdd6adad1e92c2091f9d33a67f34de49fb767ec647df2a92`。
6
+ 来源指纹(精选示例、映射、版本与公开类型声明):`c176a3e6388bb70f3e2b34f65c43da412a3a9166c20d276ddfbda3576370c40d`。
7
7
 
8
- 本手册覆盖 26 个常用组件与服务;包内还有更多导出可用,只是未在此逐个展开。按业务需要选择即可,不必全部使用。
8
+ 本手册覆盖 27 个常用组件与服务;包内还有更多导出可用,只是未在此逐个展开。按业务需要选择即可,不必全部使用。
9
9
 
10
10
  读取入口:`node_modules/x-next/AI_USAGE.md`;可用 `require.resolve('x-next/AI_USAGE.md')` 定位。这个文件名不会自动让所有 AI 工具加载,消费项目应在自己的指令中明确引用。
11
11
 
@@ -13,6 +13,7 @@
13
13
 
14
14
  | 组件/服务 | 公共导出 | 全局标签/形式 | 受控模型 | 详细文档 |
15
15
  | --- | --- | --- | --- | --- |
16
+ | ConfigProvider | `ConfigProvider` | `<x-config-provider>` | 无 | [组件文档](https://x-next.yjmf.com/components/config-provider) |
16
17
  | Button | `Button` | `<x-button>` | 无 | [组件文档](https://x-next.yjmf.com/components/button) |
17
18
  | Checkbox | `Checkbox` | `<x-checkbox>` | `v-model` | [组件文档](https://x-next.yjmf.com/components/checkbox) |
18
19
  | Radio | `Radio` | `<x-radio>` | `v-model` | [组件文档](https://x-next.yjmf.com/components/radio) |
@@ -49,18 +50,17 @@
49
50
  npm install x-next
50
51
  ```
51
52
 
52
- 应用需已有 Vue 3、TypeScript 和 Vue SFC 构建支持。在 `main.ts` 全局安装插件:
53
+ 应用需已有 Vue 3、TypeScript 和 Vue SFC 构建支持。按需具名导入无需安装全局插件;在 `main.ts` 引入一次样式:
53
54
 
54
55
  ```ts
55
56
  import { createApp } from 'vue';
56
- import XNext from 'x-next';
57
57
  import App from './App.vue';
58
58
  import 'x-next/dist/style.css';
59
59
 
60
- createApp(App).use(XNext).mount('#app');
60
+ createApp(App).mount('#app');
61
61
  ```
62
62
 
63
- `app.use(XNext)` 注册全部全局组件;下方各节的局部具名导入也可独立使用。根入口的 `Dialog` 是命令式服务,模板组件是 `DialogComponent`;MessageBox 使用服务函数。
63
+ 下方各节使用局部具名导入。需要全局注册时可另用 `app.use(XNext)`(默认导出),它会注册全部组件。根入口的 `Dialog` 是命令式服务,模板组件是 `DialogComponent`;MessageBox 使用服务函数。
64
64
 
65
65
  接入时遵循这些约定:
66
66
 
@@ -71,6 +71,66 @@ createApp(App).use(XNext).mount('#app');
71
71
  - **约束业务全局 CSS**:reset 用 `:where(...)` 降低优先级并限定作用域;宽泛的原生元素选择器可能覆盖组件样式。自定义内容用插槽和公开属性,不依赖内部结构类名。
72
72
  - **清理页面创建的服务**:保留句柄,在路由页面卸载时调用 `close()`;KeepAlive 页面可在停用时清理。Dialog / MessageBox 的命令式关闭不触发确认、取消回调,业务取消逻辑需自行调用;Message / Notification 的关闭会触发各自的 `onClose`。
73
73
 
74
+ ## ConfigProvider
75
+
76
+ 局部品牌色用 `themeColor`,它一次生成色阶并重绑定组件别名;不必逐个覆盖 Button、Switch 的颜色。将弹层宿主放在同一主题子树内,Teleport 后仍能继承。Select 默认跟随祖先滚动;要滚动关闭可传 `triggerProps.scrollToClose`。
77
+
78
+ ```vue
79
+ <script setup lang="ts">
80
+ import { ref } from 'vue';
81
+ import { Button, ConfigProvider, Select, Switch } from 'x-next';
82
+
83
+ const brand = ref('#2f6feb');
84
+ const dark = ref(false);
85
+ const value = ref('day');
86
+ const overlayHost = ref<HTMLElement>();
87
+ const switchAttrs = { 'aria-label': '局部暗色' };
88
+ const selectAttrs = { 'aria-label': '统计粒度' };
89
+ const options = [
90
+ { label: '按天', value: 'day' },
91
+ { label: '按周', value: 'week' },
92
+ ];
93
+ </script>
94
+
95
+ <template>
96
+ <ConfigProvider :theme-color="brand" :dark="dark" class="brand-scope">
97
+ <Button type="primary" @click="brand = brand === '#2f6feb' ? '#0f766e' : '#2f6feb'">
98
+ 切换品牌色
99
+ </Button>
100
+ <Switch v-model="dark" v-bind="switchAttrs" />
101
+ <Select
102
+ v-if="overlayHost"
103
+ v-model="value"
104
+ :options="options"
105
+ :popup-container="overlayHost"
106
+ v-bind="selectAttrs"
107
+ style="width: 160px"
108
+ />
109
+ <div ref="overlayHost" class="brand-overlay" />
110
+ </ConfigProvider>
111
+ </template>
112
+
113
+ <style scoped>
114
+ .brand-scope {
115
+ display: flex;
116
+ flex-wrap: wrap;
117
+ align-items: center;
118
+ gap: 12px;
119
+ padding: 16px;
120
+ color: var(--x-color-text-primary);
121
+ background: var(--x-color-bg-surface);
122
+ }
123
+ .brand-overlay {
124
+ position: fixed;
125
+ inset: 0;
126
+ pointer-events: none;
127
+ z-index: 2000;
128
+ }
129
+ </style>
130
+ ```
131
+
132
+ 已有主题容器时,也可调用公开 `applyThemeColor(seed, { target, dark })`;切换暗色后需重新调用。只改后代的几条 semantic CSS 变量不会重算祖先 alias;`:tag="null"` 的 ConfigProvider 没有承载局部主题的 DOM。
133
+
74
134
  ## Button
75
135
 
76
136
  [组件文档与 live demo](https://x-next.yjmf.com/components/button)。`type` 默认 `'default'`,视觉主按钮用 `'primary'`;`htmlType` 默认 `'button'`,原生提交用 `'submit'`。独立使用时尺寸回退为 `'medium'`,`disabled` / `loading` 默认关闭。
package/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## [未发布]
6
+
7
+ ## [1.10.0] - 2026-10-05
8
+
9
+ ### 新增
10
+
11
+ - 公共图标补齐四向箭头、双向翻页、问号帮助、纵向更多与顺时针旋转,共 9 种新图形;图标墙展示 59 种推荐图形,保留旧名称与 22 个兼容别名,搜索旧名可定位推荐名称。
12
+ - 新增 `check:icons` 门禁,检查图标生成结果与源码、文档中的静态名称和导入引用,接入完整检查流程。
13
+
14
+ ### 修复
15
+
16
+ - 公共线性图标统一描边风格,`strokeWidth` 实际生效;内部图标工厂不再覆盖已经注册的公共图标。减少动效模式下,加载图标的外层旋转与内部圆弧动画均停止。
17
+ - 修复图标墙加载圆环被裁切、默认颜色不随暗色主题切换,以及 Clipboard API 不可用时误报复制成功的问题。
18
+ - Select 默认跟随滚动祖先,仍可通过 `triggerProps.updateAtScroll=false` 关闭;Trigger 的滚动关闭支持局部与嵌套容器,按打开时的位置计算阈值,并在关闭/卸载时清理监听。
19
+ - Select 虚拟列表恢复 `dropdown-scroll` / `dropdown-reach-bottom` 事件,复用 `scrollbar` 配置;搜索过滤复位虚拟窗口,尾部追加保持位置,兼容 Table 滚动节点引用。
20
+ - Button 非加载时不再运行隐藏加载动画,保留加载禁用状态和宽度过渡,尊重减少动画偏好。
21
+ - BarChart、LineChart 的末位标签按实际间距避让,首末标签收边;超长文字省略并保留完整提示,避免窄画布叠字或越界。
22
+
23
+ ### 文档
24
+
25
+ - 图标页新增别名搜索、推荐名称复制和可交互描边示例。
26
+ - AI 使用手册新增 ConfigProvider 局部品牌色与浮层宿主配方,以具名导入作为默认接入方式。
27
+ - 增加 Select 局部滚动、图表完整日期与窄容器的可交互示例。
28
+
5
29
  ## [1.9.0] - 2026-10-05
6
30
 
7
31
  ### 新增
@@ -50,6 +50,6 @@ export declare const formatPercent: (value: number, total: number, digits?: numb
50
50
  export declare const estimateTextWidth: (text: string, fontSize: number) => number;
51
51
  /**
52
52
  * 类目标签抽稀:按柱间距与标签宽度算出步长,保证相邻标签间留有 gap。
53
- * 末位标签总是保留(趋势图需要看到最新时间点),与倒数第二个太近时挤掉前一个。
53
+ * 优先保留末位(最新时间点),空间不足时移除冲突项,包括首位。
54
54
  */
55
55
  export declare const pickLabelIndices: (count: number, band: number, maxLabelWidth: number, gap?: number) => number[];
@@ -0,0 +1,8 @@
1
+ import { ChartAxisXLabel } from './interface';
2
+ export interface PositionedAxisLabel extends ChartAxisXLabel {
3
+ width: number;
4
+ /** 完整文案,仅在省略时提供原生 SVG 提示。 */
5
+ title?: string;
6
+ }
7
+ /** 收边后再次检查文字区间,优先保留最新类目;单个超长标签省略。 */
8
+ export declare const layoutAxisLabels: (labels: ChartAxisXLabel[], left: number, right: number, gap: number, measure: (text: string) => number) => PositionedAxisLabel[];
@@ -121,8 +121,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
121
121
  }>, {
122
122
  strong: boolean;
123
123
  disabled: boolean;
124
- icon: boolean;
125
124
  loading: boolean;
125
+ icon: boolean;
126
126
  status: "normal" | "success" | "warning" | "strong" | "danger";
127
127
  hoverable: boolean;
128
128
  }, {}, {
@@ -37,8 +37,8 @@ export declare const Link: {
37
37
  }, import('vue').PublicProps, {
38
38
  strong: boolean;
39
39
  disabled: boolean;
40
- icon: boolean;
41
40
  loading: boolean;
41
+ icon: boolean;
42
42
  status: "normal" | "success" | "warning" | "strong" | "danger";
43
43
  hoverable: boolean;
44
44
  }, true, {}, {}, {
@@ -255,8 +255,8 @@ export declare const Link: {
255
255
  }, {}, {}, {}, {
256
256
  strong: boolean;
257
257
  disabled: boolean;
258
- icon: boolean;
259
258
  loading: boolean;
259
+ icon: boolean;
260
260
  status: "normal" | "success" | "warning" | "strong" | "danger";
261
261
  hoverable: boolean;
262
262
  }>;
@@ -301,8 +301,8 @@ export declare const Link: {
301
301
  }, string, {
302
302
  strong: boolean;
303
303
  disabled: boolean;
304
- icon: boolean;
305
304
  loading: boolean;
305
+ icon: boolean;
306
306
  status: "normal" | "success" | "warning" | "strong" | "danger";
307
307
  hoverable: boolean;
308
308
  }, {}, string, {}, {
@@ -1,4 +1,5 @@
1
1
  import { VNode } from 'vue';
2
+ import { ScrollbarProps } from '../scrollbar-v2';
2
3
  export type VirtualItemKey = string | number;
3
4
  export interface InternalDataItem {
4
5
  key: VirtualItemKey;
@@ -52,6 +53,8 @@ export interface VirtualListProps {
52
53
  data?: unknown[];
53
54
  itemKey?: string;
54
55
  component?: keyof HTMLElementTagNameMap;
56
+ /** 使用库内滚动条;独立 VirtualList 默认 false,Select 会传入自己的配置。 */
57
+ scrollbar?: boolean | ScrollbarProps;
55
58
  }
56
59
  export type ScrollOptions = number | {
57
60
  index?: number;
@@ -1,5 +1,6 @@
1
1
  import { PropType } from 'vue';
2
2
  import { ScrollOptions } from './interface';
3
+ import { ScrollbarProps } from '../scrollbar-v2';
3
4
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
5
  height: {
5
6
  type: (StringConstructor | NumberConstructor)[];
@@ -43,6 +44,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
43
44
  type: StringConstructor;
44
45
  default: string;
45
46
  };
47
+ scrollbar: {
48
+ type: PropType<boolean | ScrollbarProps>;
49
+ default: boolean;
50
+ };
46
51
  }>, {
47
52
  className: {
48
53
  block: string;
@@ -50,7 +55,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
50
55
  modifier: (className: string) => string;
51
56
  is: (className: string) => string;
52
57
  };
53
- containerRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
58
+ containerRef: import('vue').Ref<any, any>;
59
+ wrapperComRef: import('vue').Ref<HTMLElement | import('vue').ComponentPublicInstance | undefined, HTMLElement | import('vue').ComponentPublicInstance | undefined>;
60
+ displayScrollbar: import('vue').ComputedRef<boolean>;
61
+ scrollbarProps: import('vue').ComputedRef<ScrollbarProps | undefined>;
54
62
  contentRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
55
63
  frontPadding: import('vue').ComputedRef<number>;
56
64
  currentList: import('vue').ComputedRef<Record<string, any>[]>;
@@ -115,6 +123,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
115
123
  type: StringConstructor;
116
124
  default: string;
117
125
  };
126
+ scrollbar: {
127
+ type: PropType<boolean | ScrollbarProps>;
128
+ default: boolean;
129
+ };
118
130
  }>> & Readonly<{
119
131
  onScroll?: ((ev: Event) => any) | undefined;
120
132
  onReachBottom?: ((ev: Event) => any) | undefined;
@@ -122,6 +134,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
122
134
  data: Record<string, any>[];
123
135
  component: string | Record<string, any>;
124
136
  height: string | number;
137
+ scrollbar: boolean | ScrollbarProps;
125
138
  fixedSize: boolean;
126
139
  estimatedSize: number;
127
140
  buffer: number;
@@ -150,5 +163,327 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
150
163
  required: true;
151
164
  };
152
165
  }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
166
+ ScrollbarComponent: {
167
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
168
+ type: {
169
+ type: PropType<"track" | "embed">;
170
+ default: string;
171
+ };
172
+ outerClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
173
+ outerStyle: {
174
+ type: PropType<import('vue').StyleValue>;
175
+ };
176
+ hide: {
177
+ type: BooleanConstructor;
178
+ default: boolean;
179
+ };
180
+ disableHorizontal: {
181
+ type: BooleanConstructor;
182
+ default: boolean;
183
+ };
184
+ disableVertical: {
185
+ type: BooleanConstructor;
186
+ default: boolean;
187
+ };
188
+ horizontalWheel: {
189
+ type: BooleanConstructor;
190
+ default: boolean;
191
+ };
192
+ }>> & Readonly<{
193
+ onScroll?: ((ev: Event) => any) | undefined;
194
+ }>, {
195
+ className: {
196
+ block: string;
197
+ element: (className: string) => string;
198
+ modifier: (className: string) => string;
199
+ is: (className: string) => string;
200
+ };
201
+ cls: import('vue').ComputedRef<unknown[]>;
202
+ style: import('vue').ComputedRef<import('vue').StyleValue[]>;
203
+ rootRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
204
+ getContainerAttrs: () => {
205
+ [x: string]: unknown;
206
+ };
207
+ getContainerStyle: () => import('vue').StyleValue;
208
+ containerRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
209
+ horizontalThumbRef: import('vue').Ref<any, any>;
210
+ verticalThumbRef: import('vue').Ref<any, any>;
211
+ horizontalData: import('vue').Ref<import('../scrollbar-v2/interface').ThumbData | undefined, import('../scrollbar-v2/interface').ThumbData | undefined>;
212
+ verticalData: import('vue').Ref<import('../scrollbar-v2/interface').ThumbData | undefined, import('../scrollbar-v2/interface').ThumbData | undefined>;
213
+ isBoth: import('vue').Ref<boolean, boolean>;
214
+ hasHorizontalScrollbar: import('vue').ComputedRef<boolean>;
215
+ hasVerticalScrollbar: import('vue').ComputedRef<boolean>;
216
+ handleResize: () => void;
217
+ handleScroll: (ev: Event) => void;
218
+ handleWheel: (ev: WheelEvent) => void;
219
+ handleHorizontalScroll: (offset: number) => void;
220
+ handleVerticalScroll: (offset: number) => void;
221
+ }, {}, {}, {
222
+ scrollTo(options?: number | {
223
+ left?: number;
224
+ top?: number;
225
+ }, y?: number): void;
226
+ scrollTop(top: number): void;
227
+ scrollLeft(left: number): void;
228
+ }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
229
+ scroll: (ev: Event) => true;
230
+ }, import('vue').PublicProps, {
231
+ type: "embed" | "track";
232
+ hide: boolean;
233
+ disableHorizontal: boolean;
234
+ disableVertical: boolean;
235
+ horizontalWheel: boolean;
236
+ }, true, {}, {}, {
237
+ ResizeObserver: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
238
+ watchOnUpdated: BooleanConstructor;
239
+ }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
240
+ [key: string]: any;
241
+ }>[] | undefined, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "resize"[], "resize", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
242
+ watchOnUpdated: BooleanConstructor;
243
+ }>> & Readonly<{
244
+ onResize?: ((...args: any[]) => any) | undefined;
245
+ }>, {
246
+ watchOnUpdated: boolean;
247
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
248
+ Thumb: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
249
+ data: {
250
+ type: PropType<import('../scrollbar-v2/interface').ThumbData>;
251
+ };
252
+ direction: {
253
+ type: PropType<import('../../_utils/constant').Direction>;
254
+ default: string;
255
+ };
256
+ }>, {
257
+ trackRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
258
+ thumbRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
259
+ className: {
260
+ block: string;
261
+ element: (className: string) => string;
262
+ modifier: (className: string) => string;
263
+ is: (className: string) => string;
264
+ };
265
+ thumbCls: import('vue').ComputedRef<(string | {
266
+ [x: string]: boolean;
267
+ })[]>;
268
+ thumbStyle: import('vue').ComputedRef<{
269
+ [x: string]: string;
270
+ }>;
271
+ handleThumbMouseDown: (ev: MouseEvent) => void;
272
+ handleTrackClick: (ev: MouseEvent) => void;
273
+ setOffset: (_offset: number) => void;
274
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "scroll"[], "scroll", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
275
+ data: {
276
+ type: PropType<import('../scrollbar-v2/interface').ThumbData>;
277
+ };
278
+ direction: {
279
+ type: PropType<import('../../_utils/constant').Direction>;
280
+ default: string;
281
+ };
282
+ }>> & Readonly<{
283
+ onScroll?: ((...args: any[]) => any) | undefined;
284
+ }>, {
285
+ direction: "horizontal" | "vertical";
286
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
287
+ } & import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
288
+ P: {};
289
+ B: {};
290
+ D: {};
291
+ C: {};
292
+ M: {};
293
+ Defaults: {};
294
+ }, Readonly<import('vue').ExtractPropTypes<{
295
+ type: {
296
+ type: PropType<"track" | "embed">;
297
+ default: string;
298
+ };
299
+ outerClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
300
+ outerStyle: {
301
+ type: PropType<import('vue').StyleValue>;
302
+ };
303
+ hide: {
304
+ type: BooleanConstructor;
305
+ default: boolean;
306
+ };
307
+ disableHorizontal: {
308
+ type: BooleanConstructor;
309
+ default: boolean;
310
+ };
311
+ disableVertical: {
312
+ type: BooleanConstructor;
313
+ default: boolean;
314
+ };
315
+ horizontalWheel: {
316
+ type: BooleanConstructor;
317
+ default: boolean;
318
+ };
319
+ }>> & Readonly<{
320
+ onScroll?: ((ev: Event) => any) | undefined;
321
+ }>, {
322
+ className: {
323
+ block: string;
324
+ element: (className: string) => string;
325
+ modifier: (className: string) => string;
326
+ is: (className: string) => string;
327
+ };
328
+ cls: import('vue').ComputedRef<unknown[]>;
329
+ style: import('vue').ComputedRef<import('vue').StyleValue[]>;
330
+ rootRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
331
+ getContainerAttrs: () => {
332
+ [x: string]: unknown;
333
+ };
334
+ getContainerStyle: () => import('vue').StyleValue;
335
+ containerRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
336
+ horizontalThumbRef: import('vue').Ref<any, any>;
337
+ verticalThumbRef: import('vue').Ref<any, any>;
338
+ horizontalData: import('vue').Ref<import('../scrollbar-v2/interface').ThumbData | undefined, import('../scrollbar-v2/interface').ThumbData | undefined>;
339
+ verticalData: import('vue').Ref<import('../scrollbar-v2/interface').ThumbData | undefined, import('../scrollbar-v2/interface').ThumbData | undefined>;
340
+ isBoth: import('vue').Ref<boolean, boolean>;
341
+ hasHorizontalScrollbar: import('vue').ComputedRef<boolean>;
342
+ hasVerticalScrollbar: import('vue').ComputedRef<boolean>;
343
+ handleResize: () => void;
344
+ handleScroll: (ev: Event) => void;
345
+ handleWheel: (ev: WheelEvent) => void;
346
+ handleHorizontalScroll: (offset: number) => void;
347
+ handleVerticalScroll: (offset: number) => void;
348
+ }, {}, {}, {
349
+ scrollTo(options?: number | {
350
+ left?: number;
351
+ top?: number;
352
+ }, y?: number): void;
353
+ scrollTop(top: number): void;
354
+ scrollLeft(left: number): void;
355
+ }, {
356
+ type: "embed" | "track";
357
+ hide: boolean;
358
+ disableHorizontal: boolean;
359
+ disableVertical: boolean;
360
+ horizontalWheel: boolean;
361
+ }>;
362
+ __isFragment?: never;
363
+ __isTeleport?: never;
364
+ __isSuspense?: never;
365
+ } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
366
+ type: {
367
+ type: PropType<"track" | "embed">;
368
+ default: string;
369
+ };
370
+ outerClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
371
+ outerStyle: {
372
+ type: PropType<import('vue').StyleValue>;
373
+ };
374
+ hide: {
375
+ type: BooleanConstructor;
376
+ default: boolean;
377
+ };
378
+ disableHorizontal: {
379
+ type: BooleanConstructor;
380
+ default: boolean;
381
+ };
382
+ disableVertical: {
383
+ type: BooleanConstructor;
384
+ default: boolean;
385
+ };
386
+ horizontalWheel: {
387
+ type: BooleanConstructor;
388
+ default: boolean;
389
+ };
390
+ }>> & Readonly<{
391
+ onScroll?: ((ev: Event) => any) | undefined;
392
+ }>, {
393
+ className: {
394
+ block: string;
395
+ element: (className: string) => string;
396
+ modifier: (className: string) => string;
397
+ is: (className: string) => string;
398
+ };
399
+ cls: import('vue').ComputedRef<unknown[]>;
400
+ style: import('vue').ComputedRef<import('vue').StyleValue[]>;
401
+ rootRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
402
+ getContainerAttrs: () => {
403
+ [x: string]: unknown;
404
+ };
405
+ getContainerStyle: () => import('vue').StyleValue;
406
+ containerRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
407
+ horizontalThumbRef: import('vue').Ref<any, any>;
408
+ verticalThumbRef: import('vue').Ref<any, any>;
409
+ horizontalData: import('vue').Ref<import('../scrollbar-v2/interface').ThumbData | undefined, import('../scrollbar-v2/interface').ThumbData | undefined>;
410
+ verticalData: import('vue').Ref<import('../scrollbar-v2/interface').ThumbData | undefined, import('../scrollbar-v2/interface').ThumbData | undefined>;
411
+ isBoth: import('vue').Ref<boolean, boolean>;
412
+ hasHorizontalScrollbar: import('vue').ComputedRef<boolean>;
413
+ hasVerticalScrollbar: import('vue').ComputedRef<boolean>;
414
+ handleResize: () => void;
415
+ handleScroll: (ev: Event) => void;
416
+ handleWheel: (ev: WheelEvent) => void;
417
+ handleHorizontalScroll: (offset: number) => void;
418
+ handleVerticalScroll: (offset: number) => void;
419
+ }, {}, {}, {
420
+ scrollTo(options?: number | {
421
+ left?: number;
422
+ top?: number;
423
+ }, y?: number): void;
424
+ scrollTop(top: number): void;
425
+ scrollLeft(left: number): void;
426
+ }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
427
+ scroll: (ev: Event) => true;
428
+ }, string, {
429
+ type: "embed" | "track";
430
+ hide: boolean;
431
+ disableHorizontal: boolean;
432
+ disableVertical: boolean;
433
+ horizontalWheel: boolean;
434
+ }, {}, string, {}, {
435
+ ResizeObserver: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
436
+ watchOnUpdated: BooleanConstructor;
437
+ }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
438
+ [key: string]: any;
439
+ }>[] | undefined, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "resize"[], "resize", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
440
+ watchOnUpdated: BooleanConstructor;
441
+ }>> & Readonly<{
442
+ onResize?: ((...args: any[]) => any) | undefined;
443
+ }>, {
444
+ watchOnUpdated: boolean;
445
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
446
+ Thumb: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
447
+ data: {
448
+ type: PropType<import('../scrollbar-v2/interface').ThumbData>;
449
+ };
450
+ direction: {
451
+ type: PropType<import('../../_utils/constant').Direction>;
452
+ default: string;
453
+ };
454
+ }>, {
455
+ trackRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
456
+ thumbRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
457
+ className: {
458
+ block: string;
459
+ element: (className: string) => string;
460
+ modifier: (className: string) => string;
461
+ is: (className: string) => string;
462
+ };
463
+ thumbCls: import('vue').ComputedRef<(string | {
464
+ [x: string]: boolean;
465
+ })[]>;
466
+ thumbStyle: import('vue').ComputedRef<{
467
+ [x: string]: string;
468
+ }>;
469
+ handleThumbMouseDown: (ev: MouseEvent) => void;
470
+ handleTrackClick: (ev: MouseEvent) => void;
471
+ setOffset: (_offset: number) => void;
472
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "scroll"[], "scroll", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
473
+ data: {
474
+ type: PropType<import('../scrollbar-v2/interface').ThumbData>;
475
+ };
476
+ direction: {
477
+ type: PropType<import('../../_utils/constant').Direction>;
478
+ default: string;
479
+ };
480
+ }>> & Readonly<{
481
+ onScroll?: ((...args: any[]) => any) | undefined;
482
+ }>, {
483
+ direction: "horizontal" | "vertical";
484
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
485
+ } & import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
486
+ install(app: import('vue').App): void;
487
+ };
153
488
  }, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
154
489
  export default _default;
@@ -1,16 +1,16 @@
1
- import { ref as o, onMounted as u, watch as m } from "vue";
2
- import { isComponentInstance as f } from "../_utils/is.js";
3
- const c = (r) => {
4
- const e = o(), t = () => f(e.value) ? e.value.$refs[r] : e.value, n = o();
1
+ import { ref as r, onMounted as u, watch as f } from "vue";
2
+ import { isComponentInstance as l } from "../_utils/is.js";
3
+ const s = (n) => {
4
+ const e = r(), o = () => l(e.value) ? e.value.$refs[n] ?? Reflect.get(e.value, n) : e.value, t = r();
5
5
  return u(() => {
6
- n.value = t();
7
- }), m([e], () => {
8
- n.value = t();
6
+ t.value = o();
7
+ }), f([e], () => {
8
+ t.value = o();
9
9
  }), {
10
10
  componentRef: e,
11
- elementRef: n
11
+ elementRef: t
12
12
  };
13
13
  };
14
14
  export {
15
- c as useComponentRef
15
+ s as useComponentRef
16
16
  };