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.
@@ -1,4 +1,4 @@
1
- import { s, u } from "./chunks/checkedControl.BcxCIv6S.js";
1
+ import { s, u } from "./chunks/checkedControl.DJK032i4.js";
2
2
  export {
3
3
  s as setCheckedByGroupValue,
4
4
  u as useCurrentChecked
@@ -1,7 +1,7 @@
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";
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 a(() => (T({ name: o, value: r, uuid: n, controlType: u }, e), () => {
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] = 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({
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, d];
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 { Dispatch, SetStateAction, ChangeEvent } from 'react';
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,
@@ -34,6 +34,7 @@ export declare enum ControlType {
34
34
  FormLabel = "FormLabel",
35
35
  IconButton = "IconButton",
36
36
  Listbox = "Listbox",
37
+ ListGroup = "ListGroup",
37
38
  ListItem = "ListItem",
38
39
  Loading = "Loading",
39
40
  Radio = "Radio",
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.BcxCIv6S.js";
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";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "litten-hooks",
3
3
  "private": false,
4
- "version": "1.6.0",
4
+ "version": "1.7.1",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",