litten-hooks 1.6.0 → 1.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/dist/checkedControl.js +1 -1
- package/dist/chunks/{checkedControl.BcxCIv6S.js → checkedControl.DJK032i4.js} +11 -11
- package/dist/control/checkedControl/checkedControl.d.ts +2 -2
- package/dist/enum.js +1 -1
- package/dist/global/enum.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/checkedControl.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { g as l } from "./contentControl.BDOf7ZM1.js";
|
|
1
|
+
import { useState as l, useEffect as d, useId as h, useCallback as m } from "react";
|
|
3
2
|
import { ControlType as y } from "../enum.js";
|
|
4
3
|
import { u as v } from "./usePrevious.VSe_Wq1g.js";
|
|
4
|
+
import { g as k } from "./contentControl.BDOf7ZM1.js";
|
|
5
5
|
const G = {};
|
|
6
6
|
function i(t) {
|
|
7
7
|
let e = {};
|
|
@@ -47,26 +47,26 @@ function w(t, e, o) {
|
|
|
47
47
|
}
|
|
48
48
|
function O(t, e) {
|
|
49
49
|
const { name: o, controlType: u, value: r } = t, n = h() + "-litten";
|
|
50
|
-
return
|
|
50
|
+
return d(() => (T({ name: o, value: r, uuid: n, controlType: u }, e), () => {
|
|
51
51
|
E({ name: o, uuid: n, controlType: u });
|
|
52
52
|
}), [o, r, n, u, e]), [m(() => {
|
|
53
53
|
b({ name: o, uuid: n, controlType: u });
|
|
54
54
|
}, [o, n, u])];
|
|
55
55
|
}
|
|
56
56
|
function x(t) {
|
|
57
|
-
const { checked: e, defaultChecked: o, controlType: u, onChange: r, value: n } = t, c = v(e), [s, p] =
|
|
58
|
-
|
|
59
|
-
),
|
|
60
|
-
return
|
|
61
|
-
c !== e && (
|
|
62
|
-
}, [c, e, o]),
|
|
63
|
-
|
|
57
|
+
const { checked: e, defaultChecked: o, controlType: u, onChange: r, value: n } = t, c = v(e), [s, p] = l(
|
|
58
|
+
k(e, o)
|
|
59
|
+
), a = v(s), [C, f] = l(), [g] = O(t, p);
|
|
60
|
+
return d(() => {
|
|
61
|
+
c !== e && (f(void 0), p(k(e, o)));
|
|
62
|
+
}, [c, e, o]), d(() => {
|
|
63
|
+
a !== s && a !== void 0 && (r == null || r({
|
|
64
64
|
e: C,
|
|
65
65
|
value: n,
|
|
66
66
|
controlType: u,
|
|
67
67
|
checked: s
|
|
68
68
|
}), s === !0 && g());
|
|
69
|
-
}), [s, p,
|
|
69
|
+
}), [s, p, f];
|
|
70
70
|
}
|
|
71
71
|
export {
|
|
72
72
|
w as s,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ControlType } from '../../global/enum';
|
|
2
1
|
import { CheckedControlProps } from './checkedControl.types';
|
|
3
|
-
import {
|
|
2
|
+
import { ControlType } from '../../global/enum';
|
|
3
|
+
import { ChangeEvent, Dispatch, SetStateAction } from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 通过单选按钮组的值,设置选中的单选按钮
|
package/dist/enum.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e = /* @__PURE__ */ ((r) => (r.disabled = "disabled", r.enabled = "enabled", r))(e || {}), u = /* @__PURE__ */ ((r) => (r.mouseup = "mouseup", r.mousedown = "mousedown", r.mouseover = "mouseover", r.mouseout = "mouseout", r.mousemove = "mousemove", r.none = "mousenone", r))(u || {}), i = /* @__PURE__ */ ((r) => (r.focus = "focus", r.blur = "blur", r))(i || {}), m = /* @__PURE__ */ ((r) => (r.Button = "Button", r.Checkbox = "Checkbox", r.Form = "Form", r.FormControl = "FormControl", r.FormLabel = "FormLabel", r.IconButton = "IconButton", r.Listbox = "Listbox", r.ListItem = "ListItem", r.Loading = "Loading", r.Radio = "Radio", r.Ripple = "Ripple", r.RippleFocus = "RippleFocus", r.RadioGroup = "RadioGroup", r.Summary = "Summary", r.Switch = "Switch", r.StackPanel = "StackPanel", r.Slider = "Slider", r.TextField = "TextField", r.Wave = "Wave", r))(m || {}), a = /* @__PURE__ */ ((r) => (r.top = "placementTop", r.bottom = "placementBottom", r.left = "placementLeft", r.right = "placementRight", r))(a || {}), d = /* @__PURE__ */ ((r) => (r.circle = "circle", r.rectangle = "rectangle", r))(d || {}), c = /* @__PURE__ */ ((r) => (r.Default = "Default", r.UserInput = "UserInput", r.DevSet = "DevSet", r))(c || {}), o = /* @__PURE__ */ ((r) => (r.checked = "checked", r.unChecked = "unChecked", r.indeterminate = "indeterminate", r))(o || {}), s = /* @__PURE__ */ ((r) => (r.text = "text", r.password = "password", r))(s || {}), t = /* @__PURE__ */ ((r) => (r.vertical = "vertical", r.horizontal = "horizontal", r))(t || {});
|
|
1
|
+
var e = /* @__PURE__ */ ((r) => (r.disabled = "disabled", r.enabled = "enabled", r))(e || {}), u = /* @__PURE__ */ ((r) => (r.mouseup = "mouseup", r.mousedown = "mousedown", r.mouseover = "mouseover", r.mouseout = "mouseout", r.mousemove = "mousemove", r.none = "mousenone", r))(u || {}), i = /* @__PURE__ */ ((r) => (r.focus = "focus", r.blur = "blur", r))(i || {}), m = /* @__PURE__ */ ((r) => (r.Button = "Button", r.Checkbox = "Checkbox", r.Form = "Form", r.FormControl = "FormControl", r.FormLabel = "FormLabel", r.IconButton = "IconButton", r.Listbox = "Listbox", r.ListGroup = "ListGroup", r.ListItem = "ListItem", r.Loading = "Loading", r.Radio = "Radio", r.Ripple = "Ripple", r.RippleFocus = "RippleFocus", r.RadioGroup = "RadioGroup", r.Summary = "Summary", r.Switch = "Switch", r.StackPanel = "StackPanel", r.Slider = "Slider", r.TextField = "TextField", r.Wave = "Wave", r))(m || {}), a = /* @__PURE__ */ ((r) => (r.top = "placementTop", r.bottom = "placementBottom", r.left = "placementLeft", r.right = "placementRight", r))(a || {}), d = /* @__PURE__ */ ((r) => (r.circle = "circle", r.rectangle = "rectangle", r))(d || {}), c = /* @__PURE__ */ ((r) => (r.Default = "Default", r.UserInput = "UserInput", r.DevSet = "DevSet", r))(c || {}), o = /* @__PURE__ */ ((r) => (r.checked = "checked", r.unChecked = "unChecked", r.indeterminate = "indeterminate", r))(o || {}), s = /* @__PURE__ */ ((r) => (r.text = "text", r.password = "password", r))(s || {}), t = /* @__PURE__ */ ((r) => (r.vertical = "vertical", r.horizontal = "horizontal", r))(t || {});
|
|
2
2
|
export {
|
|
3
3
|
c as ChangeEventState,
|
|
4
4
|
o as CheckState,
|
package/dist/global/enum.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeEventState as a, CheckState as s, ControlType as u, EnableState as o, FocusState as r, MouseState as l, Orientation as n, Placement as p, Shape as x, TextFieldType as i } from "./enum.js";
|
|
2
|
-
import { s as m, u as d } from "./chunks/checkedControl.
|
|
2
|
+
import { s as m, u as d } from "./chunks/checkedControl.DJK032i4.js";
|
|
3
3
|
import { g, a as C, u as S } from "./chunks/contentControl.BDOf7ZM1.js";
|
|
4
4
|
import { u as F } from "./chunks/disabledControl.SpguzRdp.js";
|
|
5
5
|
import { g as V, u as k } from "./chunks/focusControl.BDOZSK39.js";
|