@moubing/bing-ui 0.6.0 → 0.7.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/README.md +161 -172
- package/dist/bing-ui.css +1 -1
- package/dist/bing-ui.es.js +8592 -9186
- package/dist/bing-ui.umd.js +29 -29
- package/dist/components/BingCursor/BingCursor.controller.d.ts +3 -3
- package/dist/components/BingCursor/BingCursor.native.d.ts +3 -0
- package/dist/components/BingCursor/BingCursor.shapes.d.ts +2 -3
- package/dist/components/BingCursor/BingCursor.styleSource.d.ts +1 -1
- package/dist/components/BingCursor/BingCursor.types.d.ts +1 -18
- package/dist/components/BingCursor/BingCursor.vue.d.ts +0 -4
- package/dist/components/BingCursor/index.d.ts +1 -1
- package/dist/components/BingTable/BingTable.measurements.d.ts +11 -0
- package/dist/utils/useClientReady.d.ts +2 -0
- package/package.json +1 -1
- package/dist/components/BingCursor/BingCursor.morph.d.ts +0 -9
- package/dist/components/BingCursor/BingCursorMorph.vue.d.ts +0 -11
- package/dist/components/BingCursor/BingCursorTransition.vue.d.ts +0 -28
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BingCursorProps,
|
|
1
|
+
import { BingCursorProps, BingCursorType } from './BingCursor.types';
|
|
2
2
|
interface CursorOwner {
|
|
3
3
|
root: HTMLElement;
|
|
4
4
|
options: () => BingCursorProps;
|
|
5
|
-
show: (
|
|
6
|
-
move: (x: number, y: number) => void;
|
|
5
|
+
show: (type: BingCursorType) => void;
|
|
7
6
|
hide: () => void;
|
|
7
|
+
nativeCursor: (type: BingCursorType) => string | undefined;
|
|
8
8
|
}
|
|
9
9
|
export declare function registerCursor(owner: CursorOwner): {
|
|
10
10
|
refresh: () => void;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { BingCursorType } from './BingCursor.types';
|
|
2
2
|
export interface CursorPath {
|
|
3
3
|
d: string;
|
|
4
|
-
/** 1 为主色,0
|
|
4
|
+
/** 1 为主色,0 为描边色。 */
|
|
5
5
|
ink: number;
|
|
6
6
|
outline: number;
|
|
7
7
|
strokeWidth: number;
|
|
8
|
-
opacity: number;
|
|
9
8
|
}
|
|
10
|
-
/**
|
|
9
|
+
/** 预览与原生光标图片共用的静态路径。 */
|
|
11
10
|
export declare const cursorShapes: Record<BingCursorType, readonly CursorPath[]>;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
2
|
export type BingCursorType = 'default' | 'pointer' | 'not-allowed' | 'text' | 'grab' | 'grabbing' | 'move' | 'crosshair' | 'col-resize' | 'row-resize' | 'ew-resize' | 'ns-resize' | 'nwse-resize' | 'nesw-resize' | 'zoom-in' | 'zoom-out';
|
|
3
|
-
export type BingCursorMode = 'replace' | 'follow';
|
|
4
3
|
export interface BingCursorProps {
|
|
5
4
|
/** 自动识别元素的 CSS cursor 和交互语义,也可固定一种光标。 */
|
|
6
5
|
type?: BingCursorType | 'auto';
|
|
7
|
-
/** replace 使用自定义光标;follow 保留原生光标并显示跟随圆环。 */
|
|
8
|
-
mode?: BingCursorMode;
|
|
9
6
|
/** 默认只作用于默认插槽的内容;开启后作用于当前文档。 */
|
|
10
7
|
global?: boolean;
|
|
11
8
|
disabled?: boolean;
|
|
@@ -13,25 +10,11 @@ export interface BingCursorProps {
|
|
|
13
10
|
size?: number;
|
|
14
11
|
color?: string;
|
|
15
12
|
outlineColor?: string;
|
|
16
|
-
/**
|
|
13
|
+
/** 点击热点,相对于光标左上角,单位 px;原生渲染会取整并限制在画布内。 */
|
|
17
14
|
hotspot?: readonly [number, number];
|
|
18
|
-
/** 仅跟随模式使用,单位秒;替换模式始终精确定位。 */
|
|
19
|
-
followDuration?: number;
|
|
20
|
-
/** 内置 SVG 轮廓形变与自定义提示的过渡时长,单位秒,默认 0.24;设为 0 关闭。 */
|
|
21
|
-
transitionDuration?: number;
|
|
22
|
-
zIndex?: number;
|
|
23
|
-
}
|
|
24
|
-
export interface BingCursorSlotProps {
|
|
25
|
-
type: BingCursorType;
|
|
26
|
-
pressed: boolean;
|
|
27
|
-
size: number;
|
|
28
|
-
/** 来自当前元素或祖先的 data-bing-cursor-label。 */
|
|
29
|
-
label: string;
|
|
30
|
-
target: Element | null;
|
|
31
15
|
}
|
|
32
16
|
export interface BingCursorSlots {
|
|
33
17
|
default?: () => VNode[];
|
|
34
|
-
cursor?: (props: BingCursorSlotProps) => VNode[];
|
|
35
18
|
}
|
|
36
19
|
export interface BingCursorEmits {
|
|
37
20
|
change: [type: BingCursorType];
|
|
@@ -8,13 +8,9 @@ declare const __VLS_base: import('vue').DefineComponent<BingCursorProps, {}, {},
|
|
|
8
8
|
"onVisibility-change"?: ((visible: boolean) => any) | undefined;
|
|
9
9
|
}>, {
|
|
10
10
|
disabled: boolean;
|
|
11
|
-
transitionDuration: number;
|
|
12
|
-
zIndex: number;
|
|
13
11
|
type: BingCursorType | "auto";
|
|
14
|
-
mode: import('./BingCursor.types').BingCursorMode;
|
|
15
12
|
size: number;
|
|
16
13
|
global: boolean;
|
|
17
|
-
followDuration: number;
|
|
18
14
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
15
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
16
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as BingCursor } from './BingCursor.vue';
|
|
2
|
-
export type { BingCursorEmits,
|
|
2
|
+
export type { BingCursorEmits, BingCursorProps, BingCursorSlots, BingCursorType, } from './BingCursor.types';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InjectionKey, Ref } from 'vue';
|
|
2
|
+
type CommitMeasurement = () => void;
|
|
3
|
+
type ReadMeasurement = () => CommitMeasurement | undefined;
|
|
4
|
+
export interface BingTableMeasurements {
|
|
5
|
+
register: (element: HTMLElement, read: ReadMeasurement) => () => void;
|
|
6
|
+
invalidate: (element?: HTMLElement | null) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const bingTableMeasurementsKey: InjectionKey<BingTableMeasurements>;
|
|
9
|
+
/** 同一张表共用监听器;一帧内先读完变化的单元格,再提交结果。 */
|
|
10
|
+
export declare function createTableMeasurements(root: Ref<HTMLElement | null>, readLayout?: (elements: HTMLElement[]) => CommitMeasurement | undefined): BingTableMeasurements;
|
|
11
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BingCursorType } from './BingCursor.types';
|
|
2
|
-
/** 把点击热点统一对齐到画布中心,轮廓形变不带动鼠标位置。 */
|
|
3
|
-
export declare function alignCursorPaths(type: BingCursorType, hotspot: readonly [number, number], size: number): {
|
|
4
|
-
d: string;
|
|
5
|
-
ink: number;
|
|
6
|
-
outline: number;
|
|
7
|
-
strokeWidth: number;
|
|
8
|
-
opacity: number;
|
|
9
|
-
}[];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BingCursorType } from './BingCursor.types';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
type: BingCursorType;
|
|
4
|
-
size: number;
|
|
5
|
-
hotspot: readonly [number, number];
|
|
6
|
-
duration: number;
|
|
7
|
-
active: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
10
|
-
declare const _default: typeof __VLS_export;
|
|
11
|
-
export default _default;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { BingCursorMode, BingCursorSlotProps } from './BingCursor.types';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
state: BingCursorSlotProps;
|
|
4
|
-
hotspot: readonly [number, number];
|
|
5
|
-
duration: number;
|
|
6
|
-
active: boolean;
|
|
7
|
-
mode: BingCursorMode;
|
|
8
|
-
custom: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare var __VLS_1: {
|
|
11
|
-
type: import('./BingCursor.types').BingCursorType;
|
|
12
|
-
pressed: boolean;
|
|
13
|
-
size: number;
|
|
14
|
-
label: string;
|
|
15
|
-
target: Element | null;
|
|
16
|
-
};
|
|
17
|
-
type __VLS_Slots = {} & {
|
|
18
|
-
default?: (props: typeof __VLS_1) => any;
|
|
19
|
-
};
|
|
20
|
-
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
-
declare const _default: typeof __VLS_export;
|
|
23
|
-
export default _default;
|
|
24
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
-
new (): {
|
|
26
|
-
$slots: S;
|
|
27
|
-
};
|
|
28
|
-
};
|