litten-hooks 1.0.0 → 1.2.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 (38) hide show
  1. package/README.md +6 -0
  2. package/package.json +15 -9
  3. package/dist/checkedControl.d.ts +0 -1
  4. package/dist/checkedControl.js +0 -5
  5. package/dist/chunks/checkedControl.BcxCIv6S.js +0 -74
  6. package/dist/chunks/contentControl.BDOf7ZM1.js +0 -38
  7. package/dist/chunks/disabledControl.SpguzRdp.js +0 -16
  8. package/dist/chunks/focusControl.CRsuxRz-.js +0 -20
  9. package/dist/chunks/usePrevious.VSe_Wq1g.js +0 -10
  10. package/dist/chunks/userControl.BSXLnyVL.js +0 -46
  11. package/dist/contentControl.d.ts +0 -1
  12. package/dist/contentControl.js +0 -6
  13. package/dist/control/checkedControl/checkedControl.d.ts +0 -16
  14. package/dist/control/checkedControl/checkedControl.types.d.ts +0 -46
  15. package/dist/control/contentControl/contentControl.d.ts +0 -26
  16. package/dist/control/contentControl/contentControl.types.d.ts +0 -17
  17. package/dist/control/disabledControl/disabledControl.d.ts +0 -8
  18. package/dist/control/disabledControl/disabledControl.types.d.ts +0 -19
  19. package/dist/control/event/littenEvent.types.d.ts +0 -22
  20. package/dist/control/focusControl/focusControl.d.ts +0 -15
  21. package/dist/control/focusControl/focusControl.types.d.ts +0 -19
  22. package/dist/control/layoutControl/layoutControl.types.d.ts +0 -13
  23. package/dist/control/userControl/userControl.d.ts +0 -19
  24. package/dist/control/userControl/userControl.types.d.ts +0 -75
  25. package/dist/disabledControl.d.ts +0 -1
  26. package/dist/disabledControl.js +0 -4
  27. package/dist/enum.d.ts +0 -1
  28. package/dist/enum.js +0 -7
  29. package/dist/focusControl.d.ts +0 -1
  30. package/dist/focusControl.js +0 -5
  31. package/dist/global/enum.d.ts +0 -47
  32. package/dist/hooks/usePrevious.d.ts +0 -6
  33. package/dist/index.d.ts +0 -7
  34. package/dist/index.js +0 -25
  35. package/dist/usePrevious.d.ts +0 -1
  36. package/dist/usePrevious.js +0 -4
  37. package/dist/userControl.d.ts +0 -1
  38. package/dist/userControl.js +0 -6
package/README.md CHANGED
@@ -13,6 +13,12 @@
13
13
 
14
14
  [https://liuxian496.github.io/litten-hooks/](https://liuxian496.github.io/litten-hooks/)
15
15
 
16
+ ## 依赖
17
+ <code>react</code>
18
+ <code>react-dom</code>
19
+ <code>loadsh</code>
20
+ 上述依赖,打包时不包含,需要使用的项目自行引入。
21
+
16
22
  ## 如果你想请我喝一咖啡(Buy Me a Coffee)
17
23
  <img src=".\\public\\wechat.jpg" height="360">
18
24
  <img src=".\\public\\alipay.jpg" height="360">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "litten-hooks",
3
3
  "private": false,
4
- "version": "1.0.0",
4
+ "version": "1.2.0",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -28,6 +28,12 @@
28
28
  "prepare": "husky"
29
29
  },
30
30
  "dependencies": {
31
+ "lodash": "^4.17.21",
32
+ "react": "^18.2.0",
33
+ "react-dom": "^18.2.0"
34
+ },
35
+ "peerDependencies": {
36
+ "lodash": "^4.17.21",
31
37
  "react": "^18.2.0",
32
38
  "react-dom": "^18.2.0"
33
39
  },
@@ -36,13 +42,13 @@
36
42
  "@commitlint/cli": "^19.3.0",
37
43
  "@commitlint/config-conventional": "^19.2.2",
38
44
  "@storybook/addon-coverage": "^1.0.1",
39
- "@storybook/addon-essentials": "^8.0.9",
40
- "@storybook/addon-interactions": "^8.0.9",
41
- "@storybook/addon-links": "^8.0.9",
42
- "@storybook/blocks": "^8.0.9",
43
- "@storybook/react": "^8.0.9",
44
- "@storybook/react-vite": "^8.0.9",
45
- "@storybook/test": "^8.0.9",
45
+ "@storybook/addon-essentials": "^8.0.10",
46
+ "@storybook/addon-interactions": "^8.0.10",
47
+ "@storybook/addon-links": "^8.0.10",
48
+ "@storybook/blocks": "^8.0.10",
49
+ "@storybook/react": "^8.0.10",
50
+ "@storybook/react-vite": "^8.0.10",
51
+ "@storybook/test": "^8.0.10",
46
52
  "@storybook/test-runner": "^0.17.0",
47
53
  "@types/react": "^18.2.66",
48
54
  "@types/react-dom": "^18.2.22",
@@ -58,7 +64,7 @@
58
64
  "husky": "^9.0.11",
59
65
  "litten": "^0.9.5",
60
66
  "rollup-plugin-visualizer": "^5.12.0",
61
- "storybook": "^8.0.9",
67
+ "storybook": "^8.0.10",
62
68
  "typescript": "^5.2.2",
63
69
  "vite": "^5.2.0",
64
70
  "vite-plugin-dts": "^3.9.0",
@@ -1 +0,0 @@
1
- export { setCheckedByGroupValue, useCurrentChecked, } from '../src/control/checkedControl/checkedControl';
@@ -1,5 +0,0 @@
1
- import { s, u } from "./chunks/checkedControl.BcxCIv6S.js";
2
- export {
3
- s as setCheckedByGroupValue,
4
- u as useCurrentChecked
5
- };
@@ -1,74 +0,0 @@
1
- import { useState as f, useEffect as a, useId as h, useCallback as m } from "react";
2
- import { g as l } from "./contentControl.BDOf7ZM1.js";
3
- import { ControlType as y } from "../enum.js";
4
- import { u as v } from "./usePrevious.VSe_Wq1g.js";
5
- const G = {};
6
- function i(t) {
7
- let e = {};
8
- switch (t) {
9
- case y.Radio:
10
- e = G;
11
- break;
12
- }
13
- return e;
14
- }
15
- function T(t, e) {
16
- const { name: o, value: u, uuid: r, controlType: n } = t;
17
- if (o !== void 0) {
18
- const c = i(n);
19
- c[o] === void 0 && (c[o] = {}), c[o][r] = {
20
- setChecked: e,
21
- value: u
22
- };
23
- }
24
- }
25
- function E(t) {
26
- const { name: e, uuid: o, controlType: u } = t;
27
- if (e !== void 0) {
28
- const r = i(u);
29
- delete r[e][o];
30
- }
31
- }
32
- function b(t) {
33
- const { name: e, uuid: o, controlType: u } = t;
34
- if (e !== void 0) {
35
- const n = i(u)[e];
36
- Object.keys(n).forEach((c) => {
37
- c !== o && n[c].setChecked(!1);
38
- });
39
- }
40
- }
41
- function w(t, e, o) {
42
- const r = i(e)[t];
43
- Object.keys(r).forEach((n) => {
44
- const c = r[n];
45
- o === c.value && c.setChecked(!0);
46
- });
47
- }
48
- function O(t, e) {
49
- const { name: o, controlType: u, value: r } = t, n = h() + "-litten";
50
- return a(() => (T({ name: o, value: r, uuid: n, controlType: u }, e), () => {
51
- E({ name: o, uuid: n, controlType: u });
52
- }), [o, r, n, u, e]), [m(() => {
53
- b({ name: o, uuid: n, controlType: u });
54
- }, [o, n, u])];
55
- }
56
- function x(t) {
57
- const { checked: e, defaultChecked: o, controlType: u, onChange: r, value: n } = t, c = v(e), [s, p] = f(
58
- l(e, o)
59
- ), k = v(s), [C, d] = f(), [g] = O(t, p);
60
- return a(() => {
61
- c !== e && (d(void 0), p(l(e, o)));
62
- }, [c, e, o]), a(() => {
63
- k !== s && (r == null || r({
64
- e: C,
65
- value: n,
66
- controlType: u,
67
- checked: s
68
- }), s === !0 && g());
69
- }), [s, p, d];
70
- }
71
- export {
72
- w as s,
73
- x as u
74
- };
@@ -1,38 +0,0 @@
1
- import { useState as i, useEffect as l } from "react";
2
- import { ControlType as d } from "../enum.js";
3
- import { u as f } from "./usePrevious.VSe_Wq1g.js";
4
- function c(r, e) {
5
- let t;
6
- return r !== void 0 ? t = r : t = e, t;
7
- }
8
- function C(r) {
9
- let e;
10
- switch (r) {
11
- case d.Slider:
12
- e = 50;
13
- break;
14
- default:
15
- e = "";
16
- break;
17
- }
18
- return e;
19
- }
20
- function E(r) {
21
- const { value: e, defaultValue: t, controlType: p, onChange: a } = r, n = f(e), [u, o] = i(
22
- c(e, t)
23
- ), v = f(u), [m, s] = i();
24
- return l(() => {
25
- n !== e && (s(void 0), o(c(e, t)));
26
- }, [n, e, t]), l(() => {
27
- v !== u && (a == null || a({
28
- e: m,
29
- controlType: p,
30
- value: u
31
- }));
32
- }), [u, o, s];
33
- }
34
- export {
35
- C as a,
36
- c as g,
37
- E as u
38
- };
@@ -1,16 +0,0 @@
1
- import { useState as l, useEffect as u } from "react";
2
- import { u as c } from "./usePrevious.VSe_Wq1g.js";
3
- function p(r) {
4
- const { disabled: o, loading: t, controlType: i, onDisabledChange: s } = r, [e, a] = l(!1), f = c(e);
5
- return u(() => {
6
- a(o || t);
7
- }, [o, t]), u(() => {
8
- f !== e && (s == null || s({
9
- controlType: i,
10
- disabled: e
11
- }));
12
- }), e;
13
- }
14
- export {
15
- p as u
16
- };
@@ -1,20 +0,0 @@
1
- import { useState as i } from "react";
2
- import { FocusState as a, MouseState as n } from "../enum.js";
3
- import { g as l, s as d } from "./userControl.BSXLnyVL.js";
4
- function p(e) {
5
- const { onFocus: t, onBlur: s } = e, [r, u] = i(!1);
6
- function c(o) {
7
- l() === n.none ? u(!0) : d(n.none), t == null || t(o);
8
- }
9
- function f(o) {
10
- u(!1), s == null || s(o);
11
- }
12
- return [r, c, f];
13
- }
14
- function F(e) {
15
- return e === !0 ? a.focus : a.blur;
16
- }
17
- export {
18
- F as g,
19
- p as u
20
- };
@@ -1,10 +0,0 @@
1
- import { useRef as u, useEffect as t } from "react";
2
- function n(r) {
3
- const e = u();
4
- return t(() => {
5
- e.current = r;
6
- }), e.current;
7
- }
8
- export {
9
- n as u
10
- };
@@ -1,46 +0,0 @@
1
- import { useState as d, useEffect as l } from "react";
2
- import { MouseState as g } from "../enum.js";
3
- import { u as v } from "./usePrevious.VSe_Wq1g.js";
4
- let s = g.none;
5
- function L() {
6
- return s;
7
- }
8
- function M(e) {
9
- s = e;
10
- }
11
- function E(e, i) {
12
- const [o, m] = d({
13
- left: 0,
14
- right: 0,
15
- top: 0,
16
- bottom: 0,
17
- targetWidth: 0,
18
- targetHeight: 0
19
- }), c = v(o);
20
- l(() => {
21
- c !== o && o.targetWidth > 0 && i && i(o);
22
- });
23
- function a() {
24
- document.addEventListener("mousedown", n), document.addEventListener("mousemove", n), document.addEventListener("mouseup", r);
25
- }
26
- function n(u) {
27
- let t;
28
- e.current && (t = e.current.getBoundingClientRect()), t && m({
29
- left: u.clientX - t.left,
30
- right: u.clientX - t.right,
31
- top: u.clientY - t.top,
32
- bottom: u.clientY - t.bottom,
33
- targetWidth: t.width,
34
- targetHeight: t.height
35
- });
36
- }
37
- function r() {
38
- document.removeEventListener("mousedown", n), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", r);
39
- }
40
- return [a];
41
- }
42
- export {
43
- L as g,
44
- M as s,
45
- E as u
46
- };
@@ -1 +0,0 @@
1
- export { getCurrentValue, getDefaultValueByDisplayName, useCurrentValue, } from '../src/control/contentControl/contentControl';
@@ -1,6 +0,0 @@
1
- import { g as u, a as r, u as t } from "./chunks/contentControl.BDOf7ZM1.js";
2
- export {
3
- u as getCurrentValue,
4
- r as getDefaultValueByDisplayName,
5
- t as useCurrentValue
6
- };
@@ -1,16 +0,0 @@
1
- import { Dispatch, SetStateAction, ChangeEvent } from 'react';
2
- import { CheckedControlProps } from './checkedControl.types';
3
- import { ControlType } from '../../global/enum';
4
-
5
- /**
6
- * 通过单选按钮组的值,设置选中的单选按钮
7
- * @param name 组名称
8
- * @param controlType UserControl类型
9
- * @param value 单选按钮组的值
10
- */
11
- export declare function setCheckedByGroupValue(name: string, controlType: ControlType, value: string): void;
12
- /**
13
- * 控制控件的选中状态,并触发对应的change事件
14
- * @param props 控件属性 CheckedControlProps
15
- */
16
- export declare function useCurrentChecked<T>(props: CheckedControlProps<T>): [boolean | undefined, Dispatch<SetStateAction<boolean | undefined>>, Dispatch<SetStateAction<ChangeEvent<T> | undefined>>];
@@ -1,46 +0,0 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
- import { ControlType } from '../../global/enum';
3
- import { ContentControlProps } from '../contentControl/contentControl.types';
4
- import { FocusControlProps } from '../focusControl/focusControl.types';
5
- import { DisabledControlProps } from '../disabledControl/disabledControl.types';
6
-
7
- export interface CheckedControlProps<T> extends FocusControlProps<T>, DisabledControlProps, ContentControlProps<T, string> {
8
- /**
9
- * 设置一个值,该值表示是否勾选。true,代表勾选。
10
- */
11
- checked?: boolean;
12
- /**
13
- * 设置一个值,该值表示是否默认勾选,只在初始化后生效一次。true,表示默认勾选。
14
- */
15
- defaultChecked?: boolean;
16
- /**
17
- * 单选按钮组的名称。当按钮组中的任一单选按钮选中时,其他单选按钮会自动取消选中状态
18
- */
19
- name?: string;
20
- }
21
- export interface CheckedControlGroup {
22
- /**
23
- * 组名称
24
- */
25
- name?: string;
26
- /**
27
- * 全局唯一id
28
- */
29
- uuid: string;
30
- /**
31
- * UserControl类型
32
- */
33
- controlType?: ControlType;
34
- /**
35
- * 选中时,对应的值
36
- */
37
- value?: string;
38
- }
39
- export interface LittenCheckedGroups {
40
- [name: string]: {
41
- [uuid: string]: {
42
- setChecked: Dispatch<SetStateAction<boolean | undefined>>;
43
- value?: string;
44
- };
45
- };
46
- }
@@ -1,26 +0,0 @@
1
- import { ChangeEvent, Dispatch, SetStateAction } from 'react';
2
- import { ContentControlProps } from './contentControl.types';
3
-
4
- /**
5
- * 检测一个数是否在给定的极值范围之内,并返回检测后的数值。如果小于最小值返回最小值,如果大于最大值返回最大值
6
- * @param value 待检测的数值
7
- * @param extremum 极值范围
8
- * @returns 检测后校准的数值
9
- */
10
- /**
11
- * value值不是undefined时,返回value值。否则返回defaultValue的值
12
- * @param value 控件的值(外部传入) {V}
13
- * @param defaultValue 控件的默认值(外部传入) {V}
14
- * @returns 计算之后的控件的值
15
- */
16
- export declare function getCurrentValue<V>(value: V | undefined, defaultValue: V | undefined): V | undefined;
17
- /**
18
- * 如果没有设置DefaultValue,原生控件会有默认值。根据Litten控件displayName获取这个默认值
19
- * @param displayName Litten控件名称
20
- */
21
- export declare function getDefaultValueByDisplayName(displayName: string): string | number;
22
- /**
23
- * value值不是undefined时,返回value值。否则返回defaultValue的值
24
- * @returns current 当前控件的默认值
25
- */
26
- export declare function useCurrentValue<T, V>(props: ContentControlProps<T, V>): [V | undefined, Dispatch<SetStateAction<V | undefined>>, Dispatch<SetStateAction<ChangeEvent<T> | undefined>>];
@@ -1,17 +0,0 @@
1
- import { LittenValue, UserControlProps } from '../userControl/userControl.types';
2
- import { LittenContentChangeEventHandler } from '../event/littenEvent.types';
3
-
4
- export interface ContentControlProps<T = Element, V = LittenValue> extends UserControlProps {
5
- /**
6
- * 输入的值
7
- */
8
- value?: V;
9
- /**
10
- * 默认值
11
- */
12
- defaultValue?: V;
13
- /**
14
- * 输入的值变化时触发。
15
- */
16
- onChange?: LittenContentChangeEventHandler<T, V>;
17
- }
@@ -1,8 +0,0 @@
1
- import { DisabledControlProps } from './disabledControl.types';
2
-
3
- /**
4
- * 根据disabled和loading属性的值,计算控件的可用性
5
- * @param props DisabledControlProps
6
- * @returns {boolean} 控件的可用性
7
- */
8
- export declare function useDisabled(props: DisabledControlProps): boolean | undefined;
@@ -1,19 +0,0 @@
1
- import { UserControlProps } from '../userControl/userControl.types';
2
- import { LittenDisabledChangeEventHandler } from '../event/littenEvent.types';
3
-
4
- export interface DisabledControlProps extends UserControlProps {
5
- /**
6
- * 设置一个值,表示是否禁用按钮。默认值false,表示控件可用。
7
- * @default false 表示按钮可以使用。
8
- */
9
- disabled?: boolean;
10
- /**
11
- * 设置一个值,该值表示是否正在进行后台加载。默认值,false,表示没有进行后台加载。
12
- * @default false
13
- */
14
- loading?: boolean;
15
- /**
16
- * 在此元素的 disabled 属性值更改时发生。
17
- */
18
- onDisabledChange?: LittenDisabledChangeEventHandler;
19
- }
@@ -1,22 +0,0 @@
1
- import { ChangeEvent } from 'react';
2
- import { ControlType } from '../../global/enum';
3
- import { LittenValue } from '../userControl/userControl.types';
4
-
5
- export type TextFieldValue = string | ReadonlyArray<string> | number | undefined;
6
- /**
7
- * 自定义事件参数
8
- */
9
- export interface LittenEvent<E, V> {
10
- e?: E;
11
- value?: V;
12
- controlType?: ControlType;
13
- checked?: boolean;
14
- disabled?: boolean;
15
- }
16
- export type LittenContentChangeEvent = LittenEvent<ChangeEvent<Element>, LittenValue>;
17
- export type LittenContentChangeEventHandler<T, V> = (e: LittenEvent<ChangeEvent<T>, V>) => void;
18
- export type LittenTextChangeEvent = LittenEvent<ChangeEvent<HTMLInputElement>, TextFieldValue>;
19
- export type LittenCheckedChangeEvent = LittenEvent<ChangeEvent<HTMLInputElement>, string>;
20
- export type LittenNumberChangeEvent = LittenEvent<ChangeEvent<HTMLInputElement>, number>;
21
- export type LittenDisabledChangeEvent = LittenEvent<ChangeEvent<Element>, undefined>;
22
- export type LittenDisabledChangeEventHandler = (e: LittenEvent<ChangeEvent<Element>, undefined>) => void;
@@ -1,15 +0,0 @@
1
- import { FocusEvent } from 'react';
2
- import { FocusControlProps } from './focusControl.types';
3
- import { FocusState } from '../../global/enum';
4
-
5
- /**
6
- * 获取用户控件的focused属性对应的值,以及onFocus和onBlur的事件处理函数
7
- * @param props 用户控件属性
8
- */
9
- export declare function useFocused<T>(props: FocusControlProps<T>): [boolean, (e: FocusEvent<T>) => void, (e: FocusEvent<T>) => void];
10
- /**
11
- * 通过focused的值,获取焦点状态
12
- * @param focused 控件是否获得焦点
13
- * @returns 焦点状态
14
- */
15
- export declare function getStateByFocused(focused: boolean): FocusState;
@@ -1,19 +0,0 @@
1
- import { FocusEvent } from 'react';
2
- import { UserControlProps } from '../userControl/userControl.types';
3
-
4
- export interface FocusControlProps<T> extends UserControlProps {
5
- /**
6
- * 设置元素是否可以聚焦
7
- */
8
- tabIndex?: number;
9
- /**
10
- *
11
- * @returns void
12
- */
13
- onFocus?: (e: FocusEvent<T>) => void;
14
- /**
15
- *
16
- * @returns void
17
- */
18
- onBlur?: (e: FocusEvent<T>) => void;
19
- }
@@ -1,13 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { UserControlProps } from '../userControl/userControl.types';
3
-
4
- export interface LayoutControlProps extends UserControlProps {
5
- /**
6
- * 设置元素的 class 属性
7
- */
8
- className?: string | undefined;
9
- /**
10
- * 子组件
11
- */
12
- children?: ReactNode;
13
- }
@@ -1,19 +0,0 @@
1
- import { MutableRefObject } from 'react';
2
- import { MouseState } from '../../global/enum';
3
- import { RelativeRect } from './userControl.types';
4
-
5
- /**
6
- * 获取littenLabelMouseState
7
- * @returns
8
- */
9
- export declare function getLabelMouseState(): MouseState;
10
- /**
11
- * 设置littenLabelMouseState
12
- * @param state 待设置的MouseState {MouseState}
13
- */
14
- export declare function setLabelMouseState(state: MouseState): void;
15
- /**
16
- * 鼠标按下时,获取鼠标相对于指定的DOM节点的相对位置
17
- * @param ref DOM节点的ref
18
- */
19
- export declare function useRelativePosition(ref: MutableRefObject<HTMLElement | null>, onReactChange?: (rect: RelativeRect) => void): [() => void];
@@ -1,75 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- import { EnableState, FocusState, MouseState, ControlType } from '../../global/enum';
3
-
4
- export interface UserControlProps {
5
- /**
6
- * 设置自定义控件前缀
7
- */
8
- prefixCls?: string | undefined;
9
- /**
10
- * 设置内联样式
11
- */
12
- style?: CSSProperties | undefined;
13
- /**
14
- * UserControl类型,代表在litten中的唯一标识
15
- */
16
- controlType?: ControlType | undefined;
17
- }
18
- export type StyleValue<T> = T;
19
- export type ResponsiveStyleValue<T> = T | {
20
- [key: string]: T | null;
21
- };
22
- export type LittenValue = string | ReadonlyArray<string> | number | boolean | undefined;
23
- /**
24
- * 极值
25
- */
26
- export type Extremum = {
27
- readonly min: number;
28
- readonly max: number;
29
- };
30
- /**
31
- * 视觉状态组
32
- */
33
- export interface VisualStates {
34
- /**
35
- * 设置一个值,该值表示控件的焦点状态。
36
- */
37
- focusState?: FocusState;
38
- /**
39
- * 设置一个值,表示是控件的可用状态。
40
- */
41
- enableState?: EnableState;
42
- /**
43
- * 设置一个值,该值表示控件的鼠标状态。
44
- */
45
- mouseState?: MouseState;
46
- }
47
- /**
48
- * 相对于目标DOM节点的位置
49
- */
50
- export type RelativeRect = {
51
- /**
52
- * 鼠标位置与目标DOM的相对位置的左坐标
53
- */
54
- readonly left: number;
55
- /**
56
- * 鼠标位置与目标DOM的相对位置的右坐标
57
- */
58
- readonly right: number;
59
- /**
60
- * 鼠标位置与目标DOM的相对位置的上坐标
61
- */
62
- readonly top: number;
63
- /**
64
- * 鼠标位置与目标DOM的相对位置的下坐标
65
- */
66
- readonly bottom: number;
67
- /**
68
- * 目标节点的宽度
69
- */
70
- readonly targetWidth: number;
71
- /**
72
- * 目标节点的高度
73
- */
74
- readonly targetHeight: number;
75
- };
@@ -1 +0,0 @@
1
- export { useDisabled } from '../src/control/disabledControl/disabledControl';
@@ -1,4 +0,0 @@
1
- import { u as a } from "./chunks/disabledControl.SpguzRdp.js";
2
- export {
3
- a as useDisabled
4
- };
package/dist/enum.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './global/enum';
package/dist/enum.js DELETED
@@ -1,7 +0,0 @@
1
- var m = /* @__PURE__ */ ((u) => (u.disabled = "disabled", u.enabled = "enabled", u))(m || {}), d = /* @__PURE__ */ ((u) => (u.mouseup = "mouseup", u.mousedown = "mousedown", u.mouseover = "mouseover", u.mouseout = "mouseout", u.mousemove = "mousemove", u.none = "mousenone", u))(d || {}), i = /* @__PURE__ */ ((u) => (u.focus = "focus", u.blur = "blur", u))(i || {}), e = /* @__PURE__ */ ((u) => (u.Button = "Button", u.Checkbox = "Checkbox", u.Form = "Form", u.FormControl = "FormControl", u.FormLabel = "FormLabel", u.IconButton = "IconButton", u.Loading = "Loading", u.Radio = "Radio", u.Ripple = "Ripple", u.RippleFocus = "RippleFocus", u.RadioGroup = "RadioGroup", u.Summary = "Summary", u.Switch = "Switch", u.StackPanel = "StackPanel", u.Slider = "Slider", u.TextField = "TextField", u.Wave = "Wave", u))(e || {});
2
- export {
3
- e as ControlType,
4
- m as EnableState,
5
- i as FocusState,
6
- d as MouseState
7
- };
@@ -1 +0,0 @@
1
- export { getStateByFocused, useFocused, } from '../src/control/focusControl/focusControl';
@@ -1,5 +0,0 @@
1
- import { g as o, u as t } from "./chunks/focusControl.CRsuxRz-.js";
2
- export {
3
- o as getStateByFocused,
4
- t as useFocused
5
- };
@@ -1,47 +0,0 @@
1
- /**
2
- * 可用状态
3
- */
4
- export declare enum EnableState {
5
- disabled = "disabled",
6
- enabled = "enabled"
7
- }
8
- /**
9
- * 鼠标状态
10
- */
11
- export declare enum MouseState {
12
- mouseup = "mouseup",
13
- mousedown = "mousedown",
14
- mouseover = "mouseover",
15
- mouseout = "mouseout",
16
- mousemove = "mousemove",
17
- none = "mousenone"
18
- }
19
- /**
20
- * 焦点状态
21
- */
22
- export declare enum FocusState {
23
- focus = "focus",
24
- blur = "blur"
25
- }
26
- /**
27
- * UserControl类型
28
- */
29
- export declare enum ControlType {
30
- Button = "Button",
31
- Checkbox = "Checkbox",
32
- Form = "Form",
33
- FormControl = "FormControl",
34
- FormLabel = "FormLabel",
35
- IconButton = "IconButton",
36
- Loading = "Loading",
37
- Radio = "Radio",
38
- Ripple = "Ripple",
39
- RippleFocus = "RippleFocus",
40
- RadioGroup = "RadioGroup",
41
- Summary = "Summary",
42
- Switch = "Switch",
43
- StackPanel = "StackPanel",
44
- Slider = "Slider",
45
- TextField = "TextField",
46
- Wave = "Wave"
47
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * 保存前一个状态的值
3
- * @param value 要保存的值
4
- * @returns current 前一个状态的值 {T}
5
- */
6
- export declare function usePrevious<T>(value: T): T | undefined;
package/dist/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export * from './global/enum';
2
- export { setCheckedByGroupValue, useCurrentChecked, } from '../src/control/checkedControl/checkedControl';
3
- export { getCurrentValue, getDefaultValueByDisplayName, useCurrentValue, } from '../src/control/contentControl/contentControl';
4
- export { useDisabled } from '../src/control/disabledControl/disabledControl';
5
- export { getStateByFocused, useFocused, } from '../src/control/focusControl/focusControl';
6
- export { getLabelMouseState, setLabelMouseState, useRelativePosition, } from '../src/control/userControl/userControl';
7
- export { usePrevious } from '../src/hooks/usePrevious';
package/dist/index.js DELETED
@@ -1,25 +0,0 @@
1
- import { ControlType as t, EnableState as a, FocusState as u, MouseState as o } from "./enum.js";
2
- import { s as l, u as p } from "./chunks/checkedControl.BcxCIv6S.js";
3
- import { g as m, a as g, u as x } from "./chunks/contentControl.BDOf7ZM1.js";
4
- import { u as n } from "./chunks/disabledControl.SpguzRdp.js";
5
- import { g as S, u as c } from "./chunks/focusControl.CRsuxRz-.js";
6
- import { g as y, s as b, u as V } from "./chunks/userControl.BSXLnyVL.js";
7
- import { u as D } from "./chunks/usePrevious.VSe_Wq1g.js";
8
- export {
9
- t as ControlType,
10
- a as EnableState,
11
- u as FocusState,
12
- o as MouseState,
13
- m as getCurrentValue,
14
- g as getDefaultValueByDisplayName,
15
- y as getLabelMouseState,
16
- S as getStateByFocused,
17
- l as setCheckedByGroupValue,
18
- b as setLabelMouseState,
19
- p as useCurrentChecked,
20
- x as useCurrentValue,
21
- n as useDisabled,
22
- c as useFocused,
23
- D as usePrevious,
24
- V as useRelativePosition
25
- };
@@ -1 +0,0 @@
1
- export { usePrevious } from '../src/hooks/usePrevious';
@@ -1,4 +0,0 @@
1
- import { u as r } from "./chunks/usePrevious.VSe_Wq1g.js";
2
- export {
3
- r as usePrevious
4
- };
@@ -1 +0,0 @@
1
- export { getLabelMouseState, setLabelMouseState, useRelativePosition, } from '../src/control/userControl/userControl';
@@ -1,6 +0,0 @@
1
- import { g as t, s as a, u as o } from "./chunks/userControl.BSXLnyVL.js";
2
- export {
3
- t as getLabelMouseState,
4
- a as setLabelMouseState,
5
- o as useRelativePosition
6
- };