@npm-questionpro/wick-ui-lib 0.22.0 → 0.22.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/src/components/checkbox/WuCheckbox.d.ts +4 -3
- package/dist/src/components/toggle/WuToggle.d.ts +4 -5
- package/dist/wick-ui-lib/es/index.js +27 -21
- package/dist/wick-ui-lib/es/index.js.map +1 -1
- package/dist/wick-ui-lib/umd/index.js +4 -4
- package/dist/wick-ui-lib/umd/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Checkbox } from '../../base/ui/checkbox';
|
|
1
2
|
import { default as React } from 'react';
|
|
2
|
-
export
|
|
3
|
+
export type IWuCheckboxProps = Omit<React.ComponentPropsWithRef<typeof Checkbox>, 'onChange'> & {
|
|
3
4
|
disabled?: boolean;
|
|
4
5
|
checked?: boolean;
|
|
5
6
|
label?: string;
|
|
@@ -8,9 +9,9 @@ export interface IWuCheckboxProps extends Omit<React.ButtonHTMLAttributes<HTMLBu
|
|
|
8
9
|
readonly?: boolean;
|
|
9
10
|
required?: boolean;
|
|
10
11
|
onChange?: (e: boolean) => void;
|
|
11
|
-
}
|
|
12
|
+
};
|
|
12
13
|
/**
|
|
13
14
|
* This extends to HTML button. So it supports all attributes of button.
|
|
14
15
|
* Note: className will apply to container. Style will apply to checkbox.
|
|
15
16
|
*/
|
|
16
|
-
export declare const WuCheckbox: React.ForwardRefExoticComponent<IWuCheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export declare const WuCheckbox: React.ForwardRefExoticComponent<Omit<IWuCheckboxProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
checked?: boolean;
|
|
2
|
+
import { Switch } from '../../base/ui/switch';
|
|
3
|
+
export type IWuToggleProps = Omit<React.ComponentPropsWithRef<typeof Switch>, 'onChange'> & {
|
|
5
4
|
label?: string;
|
|
6
5
|
labelPosition?: 'left' | 'right' | 'top';
|
|
7
6
|
onChange?: (e: boolean) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const WuToggle: React.ForwardRefExoticComponent<IWuToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
};
|
|
8
|
+
export declare const WuToggle: React.ForwardRefExoticComponent<Omit<IWuToggleProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -10371,7 +10371,11 @@ const Sn = T.forwardRef(
|
|
|
10371
10371
|
readonly: f,
|
|
10372
10372
|
...m
|
|
10373
10373
|
} = e;
|
|
10374
|
-
return
|
|
10374
|
+
return T.useEffect(() => {
|
|
10375
|
+
m.defaultChecked !== void 0 && r !== void 0 && console.error(
|
|
10376
|
+
"WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them."
|
|
10377
|
+
);
|
|
10378
|
+
}, [m.defaultChecked, r]), /* @__PURE__ */ P(
|
|
10375
10379
|
"div",
|
|
10376
10380
|
{
|
|
10377
10381
|
className: t0({
|
|
@@ -22265,47 +22269,49 @@ Gh.displayName = zh.displayName;
|
|
|
22265
22269
|
const UI = T.forwardRef(
|
|
22266
22270
|
(e, t) => {
|
|
22267
22271
|
const {
|
|
22268
|
-
|
|
22269
|
-
|
|
22270
|
-
|
|
22271
|
-
|
|
22272
|
-
|
|
22273
|
-
|
|
22274
|
-
|
|
22272
|
+
label: n,
|
|
22273
|
+
labelPosition: r = "right",
|
|
22274
|
+
onChange: o,
|
|
22275
|
+
className: s,
|
|
22276
|
+
dir: a,
|
|
22277
|
+
disabled: i,
|
|
22278
|
+
id: l = Uo(),
|
|
22275
22279
|
...c
|
|
22276
22280
|
} = e;
|
|
22277
|
-
return
|
|
22281
|
+
return T.useEffect(() => {
|
|
22282
|
+
const { checked: u, defaultChecked: f } = c;
|
|
22283
|
+
u !== void 0 && f !== void 0 && console.error(
|
|
22284
|
+
"WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them."
|
|
22285
|
+
);
|
|
22286
|
+
}, [c.checked, c.defaultChecked]), /* @__PURE__ */ P(
|
|
22278
22287
|
"div",
|
|
22279
22288
|
{
|
|
22280
22289
|
className: N(
|
|
22281
|
-
qI({ labelPosition:
|
|
22290
|
+
qI({ labelPosition: r }),
|
|
22282
22291
|
"wu-toggle-container"
|
|
22283
22292
|
),
|
|
22284
|
-
dir:
|
|
22293
|
+
dir: a,
|
|
22285
22294
|
children: [
|
|
22286
22295
|
/* @__PURE__ */ d(
|
|
22287
22296
|
Gh,
|
|
22288
22297
|
{
|
|
22289
|
-
id: a,
|
|
22290
22298
|
...c,
|
|
22299
|
+
id: l,
|
|
22300
|
+
disabled: i,
|
|
22291
22301
|
ref: t,
|
|
22292
|
-
|
|
22293
|
-
|
|
22294
|
-
onCheckedChange: i,
|
|
22295
|
-
className: N("peer", l),
|
|
22296
|
-
dir: c.dir
|
|
22302
|
+
onCheckedChange: o,
|
|
22303
|
+
className: N("peer", s)
|
|
22297
22304
|
}
|
|
22298
22305
|
),
|
|
22299
22306
|
/* @__PURE__ */ d(
|
|
22300
22307
|
mt,
|
|
22301
22308
|
{
|
|
22302
|
-
htmlFor:
|
|
22309
|
+
htmlFor: l,
|
|
22303
22310
|
className: N(
|
|
22304
|
-
|
|
22311
|
+
i ? "cursor-not-allowed" : "cursor-pointer",
|
|
22305
22312
|
"wu-toggle-label"
|
|
22306
22313
|
),
|
|
22307
|
-
|
|
22308
|
-
children: o
|
|
22314
|
+
children: n
|
|
22309
22315
|
}
|
|
22310
22316
|
)
|
|
22311
22317
|
]
|