@npm-questionpro/wick-ui-lib 0.22.0 → 0.22.2
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 +61 -53
- 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>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as d, Fragment as Ae, jsxs as P } from "react/jsx-runtime";
|
|
2
2
|
import * as p from "react";
|
|
3
|
-
import T, { forwardRef as Zn, useState as re, useRef as
|
|
3
|
+
import T, { forwardRef as Zn, useState as re, useRef as ze, useLayoutEffect as Xa, useEffect as Re, Fragment as qh, useMemo as We, createContext as Kh, useContext as Xh, useCallback as _e, createElement as Wn, memo as Jc } from "react";
|
|
4
4
|
import * as Za from "react-dom";
|
|
5
5
|
import eu from "react-dom";
|
|
6
6
|
function Zh(e, t) {
|
|
@@ -2886,7 +2886,7 @@ const Ww = ({ onLogout: e, DataCenter: t }) => /* @__PURE__ */ P("section", { cl
|
|
|
2886
2886
|
DataCenter: r
|
|
2887
2887
|
}) => {
|
|
2888
2888
|
var c, u;
|
|
2889
|
-
const [o, s] = re(!1), a =
|
|
2889
|
+
const [o, s] = re(!1), a = ze(null), i = ze(null);
|
|
2890
2890
|
Mo([a, i], () => s(!1));
|
|
2891
2891
|
const l = () => {
|
|
2892
2892
|
s(!o);
|
|
@@ -4552,8 +4552,8 @@ var ci = "PopperContent", [tv, nv] = Vu(ci), ju = p.forwardRef(
|
|
|
4552
4552
|
Kb({
|
|
4553
4553
|
...j,
|
|
4554
4554
|
apply: ({ elements: Ve, rects: et, availableWidth: wt, availableHeight: bt }) => {
|
|
4555
|
-
const { width: Be, height:
|
|
4556
|
-
Xt.setProperty("--radix-popper-available-width", `${wt}px`), Xt.setProperty("--radix-popper-available-height", `${bt}px`), Xt.setProperty("--radix-popper-anchor-width", `${Be}px`), Xt.setProperty("--radix-popper-anchor-height", `${
|
|
4555
|
+
const { width: Be, height: Ge } = et.reference, Xt = Ve.floating.style;
|
|
4556
|
+
Xt.setProperty("--radix-popper-available-width", `${wt}px`), Xt.setProperty("--radix-popper-available-height", `${bt}px`), Xt.setProperty("--radix-popper-anchor-width", `${Be}px`), Xt.setProperty("--radix-popper-anchor-height", `${Ge}px`);
|
|
4557
4557
|
}
|
|
4558
4558
|
}),
|
|
4559
4559
|
R && Zb({ element: R, padding: i }),
|
|
@@ -5166,7 +5166,7 @@ const pi = T.forwardRef(
|
|
|
5166
5166
|
);
|
|
5167
5167
|
pi.displayName = "WuTooltip";
|
|
5168
5168
|
const Vs = ({ label: e, className: t }) => {
|
|
5169
|
-
const n =
|
|
5169
|
+
const n = ze(null), [r, o] = re(!1);
|
|
5170
5170
|
return Re(() => {
|
|
5171
5171
|
const s = n.current;
|
|
5172
5172
|
if (s) {
|
|
@@ -5273,7 +5273,7 @@ const Vs = ({ label: e, className: t }) => {
|
|
|
5273
5273
|
link: "https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",
|
|
5274
5274
|
target: "window"
|
|
5275
5275
|
}
|
|
5276
|
-
], r =
|
|
5276
|
+
], r = ze(null), o = ze(null), [s, a] = re(!1);
|
|
5277
5277
|
Mo([r, o], () => {
|
|
5278
5278
|
a(!1);
|
|
5279
5279
|
});
|
|
@@ -5902,7 +5902,7 @@ const eP = (e) => {
|
|
|
5902
5902
|
homeLink: o,
|
|
5903
5903
|
expandAll: s
|
|
5904
5904
|
}) => {
|
|
5905
|
-
const a =
|
|
5905
|
+
const a = ze(null), i = ze(null), l = ze(null), c = ze(null), [u, f] = re(!1), [m, g] = re(
|
|
5906
5906
|
null
|
|
5907
5907
|
), [w, h] = re(
|
|
5908
5908
|
n.base
|
|
@@ -9665,7 +9665,7 @@ function jS(e) {
|
|
|
9665
9665
|
e.formatters,
|
|
9666
9666
|
e.labels,
|
|
9667
9667
|
e.classNames
|
|
9668
|
-
]), { captionLayout: i, mode: l, onDayBlur: c, onDayClick: u, onDayFocus: f, onDayKeyDown: m, onDayMouseEnter: g, onDayMouseLeave: w, onNextClick: h, onPrevClick: v, showWeekNumber: y, styles: b } = e, { formatCaption: x, formatDay: R, formatMonthDropdown: S, formatWeekNumber: C, formatWeekNumberHeader: E, formatWeekdayName: M, formatYearDropdown: I } = n, _ = OS(e, o), { days: L, months: k, navStart: j, navEnd: F, previousMonth: O, nextMonth: H, goToMonth: U } = _, G = $S(L, e, o), { isSelected: $, select: Z, selected: ee } = YS(e, o) ?? {}, { blur: D, focused: z, isFocusTarget: Q, moveFocus: B, setFocused: X } = LS(e, _, G, $ ?? (() => !1), o), { labelDayButton: ne, labelGridcell: A, labelGrid: K, labelMonthDropdown: de, labelNav: ie, labelWeekday: ge, labelWeekNumber: Ve, labelWeekNumberHeader: et, labelYearDropdown: wt } = r, bt = We(() => uS(o, e.ISOWeek), [o, e.ISOWeek]), Be = l !== void 0 || u !== void 0,
|
|
9668
|
+
]), { captionLayout: i, mode: l, onDayBlur: c, onDayClick: u, onDayFocus: f, onDayKeyDown: m, onDayMouseEnter: g, onDayMouseLeave: w, onNextClick: h, onPrevClick: v, showWeekNumber: y, styles: b } = e, { formatCaption: x, formatDay: R, formatMonthDropdown: S, formatWeekNumber: C, formatWeekNumberHeader: E, formatWeekdayName: M, formatYearDropdown: I } = n, _ = OS(e, o), { days: L, months: k, navStart: j, navEnd: F, previousMonth: O, nextMonth: H, goToMonth: U } = _, G = $S(L, e, o), { isSelected: $, select: Z, selected: ee } = YS(e, o) ?? {}, { blur: D, focused: z, isFocusTarget: Q, moveFocus: B, setFocused: X } = LS(e, _, G, $ ?? (() => !1), o), { labelDayButton: ne, labelGridcell: A, labelGrid: K, labelMonthDropdown: de, labelNav: ie, labelWeekday: ge, labelWeekNumber: Ve, labelWeekNumberHeader: et, labelYearDropdown: wt } = r, bt = We(() => uS(o, e.ISOWeek), [o, e.ISOWeek]), Be = l !== void 0 || u !== void 0, Ge = _e(() => {
|
|
9669
9669
|
O && (U(O), v == null || v(O));
|
|
9670
9670
|
}, [O, U, v]), Xt = _e(() => {
|
|
9671
9671
|
H && (U(H), h == null || h(H));
|
|
@@ -9730,7 +9730,7 @@ function jS(e) {
|
|
|
9730
9730
|
T.createElement(
|
|
9731
9731
|
t.Months,
|
|
9732
9732
|
{ className: a[oe.Months], style: b == null ? void 0 : b[oe.Months] },
|
|
9733
|
-
!e.hideNavigation && T.createElement(t.Nav, { className: a[oe.Nav], style: b == null ? void 0 : b[oe.Nav], "aria-label": ie(), onPreviousClick:
|
|
9733
|
+
!e.hideNavigation && T.createElement(t.Nav, { className: a[oe.Nav], style: b == null ? void 0 : b[oe.Nav], "aria-label": ie(), onPreviousClick: Ge, onNextClick: Xt, previousMonth: O, nextMonth: H }),
|
|
9734
9734
|
k.map((he, ke) => {
|
|
9735
9735
|
const Ee = lS(he.date, j, F, n, o), Qt = dS(j, F, n, o);
|
|
9736
9736
|
return T.createElement(
|
|
@@ -9757,14 +9757,14 @@ function jS(e) {
|
|
|
9757
9757
|
y && T.createElement(t.WeekNumber, { week: vt, style: b == null ? void 0 : b[oe.WeekNumber], "aria-label": Ve(vt.weekNumber, {
|
|
9758
9758
|
locale: s
|
|
9759
9759
|
}), className: a[oe.WeekNumber], scope: "row", role: "rowheader" }, C(vt.weekNumber)),
|
|
9760
|
-
vt.days.map((
|
|
9761
|
-
const { date: Tt } =
|
|
9762
|
-
if (ye[Te.focused] = !ye.hidden && !!(z != null && z.isEqualTo(
|
|
9760
|
+
vt.days.map((Ye) => {
|
|
9761
|
+
const { date: Tt } = Ye, ye = G(Ye);
|
|
9762
|
+
if (ye[Te.focused] = !ye.hidden && !!(z != null && z.isEqualTo(Ye)), ye[yt.selected] = !ye.disabled && (($ == null ? void 0 : $(Tt)) || ye.selected), Ri(ee)) {
|
|
9763
9763
|
const { from: Fs, to: Ls } = ee;
|
|
9764
9764
|
ye[yt.range_start] = !!(Fs && Ls && o.isSameDay(Tt, Fs)), ye[yt.range_end] = !!(Fs && Ls && o.isSameDay(Tt, Ls)), ye[yt.range_middle] = zt(ee, Tt, !0, o);
|
|
9765
9765
|
}
|
|
9766
9766
|
const Yh = cS(ye, b, e.modifiersStyles), jh = SC(ye, a, e.modifiersClassNames), Uh = !Be && !ye.hidden ? A(Tt, ye, o.options, o) : void 0;
|
|
9767
|
-
return T.createElement(t.Day, { key: `${o.format(Tt, "yyyy-MM-dd")}_${o.format(
|
|
9767
|
+
return T.createElement(t.Day, { key: `${o.format(Tt, "yyyy-MM-dd")}_${o.format(Ye.displayMonth, "yyyy-MM")}`, day: Ye, modifiers: ye, className: jh.join(" "), style: Yh, role: "gridcell", "aria-selected": ye.selected || void 0, "aria-label": Uh, "data-day": o.format(Tt, "yyyy-MM-dd"), "data-month": Ye.outside ? o.format(Tt, "yyyy-MM") : void 0, "data-selected": ye.selected || void 0, "data-disabled": ye.disabled || void 0, "data-hidden": ye.hidden || void 0, "data-outside": Ye.outside || void 0, "data-focused": ye.focused || void 0, "data-today": ye.today || void 0 }, !ye.hidden && Be ? T.createElement(t.DayButton, { className: a[oe.DayButton], style: b == null ? void 0 : b[oe.DayButton], type: "button", day: Ye, modifiers: ye, disabled: ye.disabled || void 0, tabIndex: Q(Ye) ? 0 : -1, "aria-label": ne(Tt, ye, o.options, o), onClick: Dn(Ye, ye), onBlur: eo(Ye, ye), onFocus: cr(Ye, ye), onKeyDown: kn(Ye, ye), onMouseEnter: Zt(Ye, ye), onMouseLeave: Wt(Ye, ye) }, R(Tt, o.options, o)) : !ye.hidden && R(Ye.date, o.options, o));
|
|
9768
9768
|
})
|
|
9769
9769
|
)))
|
|
9770
9770
|
)
|
|
@@ -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({
|
|
@@ -14412,7 +14416,7 @@ const bN = /* @__PURE__ */ ve(
|
|
|
14412
14416
|
bt,
|
|
14413
14417
|
Be
|
|
14414
14418
|
]) => {
|
|
14415
|
-
const { row:
|
|
14419
|
+
const { row: Ge, column: Xt } = ie, { height: Dn, width: cr } = ge, { width: eo } = Ve;
|
|
14416
14420
|
if (wt === 0 && (A === 0 || eo === 0))
|
|
14417
14421
|
return kc;
|
|
14418
14422
|
if (cr === 0) {
|
|
@@ -14421,8 +14425,8 @@ const bN = /* @__PURE__ */ ve(
|
|
|
14421
14425
|
}
|
|
14422
14426
|
const kn = Lg(eo, cr, Xt);
|
|
14423
14427
|
let Zt, Wt;
|
|
14424
|
-
bt ? K === 0 && de === 0 && wt > 0 ? (Zt = 0, Wt = wt - 1) : (Zt = kn * Vo((K +
|
|
14425
|
-
const to = Fc(Zt, Wt, et), { top: no, bottom: ro } = Lc(Ve, ie, ge, to), oo = Ac(A / kn), As = oo * Dn + (oo - 1) *
|
|
14428
|
+
bt ? K === 0 && de === 0 && wt > 0 ? (Zt = 0, Wt = wt - 1) : (Zt = kn * Vo((K + Ge) / (Dn + Ge)), Wt = kn * Ac((de + Ge) / (Dn + Ge)) - 1, Wt = aa(A - 1, yr(Wt, kn - 1)), Zt = aa(Wt, yr(0, Zt))) : (Zt = 0, Wt = -1);
|
|
14429
|
+
const to = Fc(Zt, Wt, et), { top: no, bottom: ro } = Lc(Ve, ie, ge, to), oo = Ac(A / kn), As = oo * Dn + (oo - 1) * Ge - ro;
|
|
14426
14430
|
return { items: to, offsetTop: no, offsetBottom: As, top: no, bottom: ro, itemHeight: Dn, itemWidth: cr };
|
|
14427
14431
|
}
|
|
14428
14432
|
)
|
|
@@ -14497,8 +14501,8 @@ const bN = /* @__PURE__ */ ve(
|
|
|
14497
14501
|
const Ve = Cg(A), { align: et, behavior: wt, offset: bt } = Ve;
|
|
14498
14502
|
let Be = Ve.index;
|
|
14499
14503
|
Be === "LAST" && (Be = ie - 1), Be = yr(0, Be, aa(ie - 1, Be));
|
|
14500
|
-
let
|
|
14501
|
-
return et === "end" ?
|
|
14504
|
+
let Ge = $a(K, ge, de, Be);
|
|
14505
|
+
return et === "end" ? Ge = Oc(Ge - K.height + de.height) : et === "center" && (Ge = Oc(Ge - K.height / 2 + de.height / 2)), bt && (Ge += bt), { top: Ge, behavior: wt };
|
|
14502
14506
|
})
|
|
14503
14507
|
),
|
|
14504
14508
|
i
|
|
@@ -14860,7 +14864,7 @@ const PN = ({ tags: e, triggerRef: t }) => {
|
|
|
14860
14864
|
isCheckedAll: u,
|
|
14861
14865
|
className: f
|
|
14862
14866
|
}) => {
|
|
14863
|
-
const [m, g] = re([]), w =
|
|
14867
|
+
const [m, g] = re([]), w = ze(null);
|
|
14864
14868
|
Re(() => {
|
|
14865
14869
|
if (!n || Array.isArray(n) && n.length === 0) {
|
|
14866
14870
|
g([]);
|
|
@@ -16149,7 +16153,7 @@ const Hc = ({
|
|
|
16149
16153
|
labelPosition: b = "top",
|
|
16150
16154
|
className: x
|
|
16151
16155
|
}) => {
|
|
16152
|
-
const [R, S] = re(""), [C, E] = re(), [M, I] = re(!1), [_, L] = re(!1), [k, j] = re(!1), F =
|
|
16156
|
+
const [R, S] = re(""), [C, E] = re(), [M, I] = re(!1), [_, L] = re(!1), [k, j] = re(!1), F = ze(null), [O, H] = re(0), U = ze(null);
|
|
16153
16157
|
Xa(() => {
|
|
16154
16158
|
b === "left" && U.current ? H(U.current.offsetWidth + 8) : H(0);
|
|
16155
16159
|
}, [b]);
|
|
@@ -16911,7 +16915,7 @@ const uT = "600px", dT = {
|
|
|
16911
16915
|
labelPosition: y = "top",
|
|
16912
16916
|
...b
|
|
16913
16917
|
}) => {
|
|
16914
|
-
const [x, R] = re(), S =
|
|
16918
|
+
const [x, R] = re(), S = ze(null), C = ze(null), [E, M] = re(!1), [I, _] = re(!1), [L, k] = re(0);
|
|
16915
16919
|
Xa(() => {
|
|
16916
16920
|
y === "left" && C.current ? k(C.current.offsetWidth + 8) : k(0);
|
|
16917
16921
|
}, [y]);
|
|
@@ -18477,7 +18481,7 @@ const AP = ({
|
|
|
18477
18481
|
const { state: t, isMobile: n, openMobile: r } = ir();
|
|
18478
18482
|
return /* @__PURE__ */ d(Rp, { ...e, children: /* @__PURE__ */ d(Xm, { showMenu: n ? r : t === "expanded" }) });
|
|
18479
18483
|
}, FP = ({ className: e, children: t, ...n }) => {
|
|
18480
|
-
const r =
|
|
18484
|
+
const r = ze(null), o = ze(null), s = ({
|
|
18481
18485
|
currentTarget: i
|
|
18482
18486
|
}) => {
|
|
18483
18487
|
const { scrollTop: l, clientHeight: c, scrollHeight: u } = i;
|
|
@@ -18536,9 +18540,10 @@ const AP = ({
|
|
|
18536
18540
|
}
|
|
18537
18541
|
)
|
|
18538
18542
|
] })
|
|
18539
|
-
});
|
|
18543
|
+
}), c = ze(null);
|
|
18540
18544
|
return T.useEffect(() => {
|
|
18541
|
-
|
|
18545
|
+
var u;
|
|
18546
|
+
i(((u = c.current) == null ? void 0 : u.textContent) || "");
|
|
18542
18547
|
}, []), /* @__PURE__ */ d(Dp, { ...o, className: "flex items-center gap-2 px-2", children: /* @__PURE__ */ d(
|
|
18543
18548
|
kp,
|
|
18544
18549
|
{
|
|
@@ -18550,6 +18555,7 @@ const AP = ({
|
|
|
18550
18555
|
isActive: r,
|
|
18551
18556
|
tooltip: a,
|
|
18552
18557
|
asChild: !0,
|
|
18558
|
+
ref: c,
|
|
18553
18559
|
children: l
|
|
18554
18560
|
}
|
|
18555
18561
|
) });
|
|
@@ -19319,7 +19325,7 @@ function yM(e, t, n, r) {
|
|
|
19319
19325
|
m.createColumn == null || m.createColumn(f, e);
|
|
19320
19326
|
return f;
|
|
19321
19327
|
}
|
|
19322
|
-
const
|
|
19328
|
+
const je = "debugHeaders";
|
|
19323
19329
|
function Kc(e, t, n) {
|
|
19324
19330
|
var r;
|
|
19325
19331
|
let s = {
|
|
@@ -19355,27 +19361,27 @@ const xM = {
|
|
|
19355
19361
|
var s, a;
|
|
19356
19362
|
const i = (s = r == null ? void 0 : r.map((f) => n.find((m) => m.id === f)).filter(Boolean)) != null ? s : [], l = (a = o == null ? void 0 : o.map((f) => n.find((m) => m.id === f)).filter(Boolean)) != null ? a : [], c = n.filter((f) => !(r != null && r.includes(f.id)) && !(o != null && o.includes(f.id)));
|
|
19357
19363
|
return ho(t, [...i, ...c, ...l], e);
|
|
19358
|
-
}, ae(e.options,
|
|
19364
|
+
}, ae(e.options, je, "getHeaderGroups")), e.getCenterHeaderGroups = se(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (t, n, r, o) => (n = n.filter((s) => !(r != null && r.includes(s.id)) && !(o != null && o.includes(s.id))), ho(t, n, e, "center")), ae(e.options, je, "getCenterHeaderGroups")), e.getLeftHeaderGroups = se(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (t, n, r) => {
|
|
19359
19365
|
var o;
|
|
19360
19366
|
const s = (o = r == null ? void 0 : r.map((a) => n.find((i) => i.id === a)).filter(Boolean)) != null ? o : [];
|
|
19361
19367
|
return ho(t, s, e, "left");
|
|
19362
|
-
}, ae(e.options,
|
|
19368
|
+
}, ae(e.options, je, "getLeftHeaderGroups")), e.getRightHeaderGroups = se(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (t, n, r) => {
|
|
19363
19369
|
var o;
|
|
19364
19370
|
const s = (o = r == null ? void 0 : r.map((a) => n.find((i) => i.id === a)).filter(Boolean)) != null ? o : [];
|
|
19365
19371
|
return ho(t, s, e, "right");
|
|
19366
|
-
}, ae(e.options,
|
|
19372
|
+
}, ae(e.options, je, "getRightHeaderGroups")), e.getFooterGroups = se(() => [e.getHeaderGroups()], (t) => [...t].reverse(), ae(e.options, je, "getFooterGroups")), e.getLeftFooterGroups = se(() => [e.getLeftHeaderGroups()], (t) => [...t].reverse(), ae(e.options, je, "getLeftFooterGroups")), e.getCenterFooterGroups = se(() => [e.getCenterHeaderGroups()], (t) => [...t].reverse(), ae(e.options, je, "getCenterFooterGroups")), e.getRightFooterGroups = se(() => [e.getRightHeaderGroups()], (t) => [...t].reverse(), ae(e.options, je, "getRightFooterGroups")), e.getFlatHeaders = se(() => [e.getHeaderGroups()], (t) => t.map((n) => n.headers).flat(), ae(e.options, je, "getFlatHeaders")), e.getLeftFlatHeaders = se(() => [e.getLeftHeaderGroups()], (t) => t.map((n) => n.headers).flat(), ae(e.options, je, "getLeftFlatHeaders")), e.getCenterFlatHeaders = se(() => [e.getCenterHeaderGroups()], (t) => t.map((n) => n.headers).flat(), ae(e.options, je, "getCenterFlatHeaders")), e.getRightFlatHeaders = se(() => [e.getRightHeaderGroups()], (t) => t.map((n) => n.headers).flat(), ae(e.options, je, "getRightFlatHeaders")), e.getCenterLeafHeaders = se(() => [e.getCenterFlatHeaders()], (t) => t.filter((n) => {
|
|
19367
19373
|
var r;
|
|
19368
19374
|
return !((r = n.subHeaders) != null && r.length);
|
|
19369
|
-
}), ae(e.options,
|
|
19375
|
+
}), ae(e.options, je, "getCenterLeafHeaders")), e.getLeftLeafHeaders = se(() => [e.getLeftFlatHeaders()], (t) => t.filter((n) => {
|
|
19370
19376
|
var r;
|
|
19371
19377
|
return !((r = n.subHeaders) != null && r.length);
|
|
19372
|
-
}), ae(e.options,
|
|
19378
|
+
}), ae(e.options, je, "getLeftLeafHeaders")), e.getRightLeafHeaders = se(() => [e.getRightFlatHeaders()], (t) => t.filter((n) => {
|
|
19373
19379
|
var r;
|
|
19374
19380
|
return !((r = n.subHeaders) != null && r.length);
|
|
19375
|
-
}), ae(e.options,
|
|
19381
|
+
}), ae(e.options, je, "getRightLeafHeaders")), e.getLeafHeaders = se(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (t, n, r) => {
|
|
19376
19382
|
var o, s, a, i, l, c;
|
|
19377
19383
|
return [...(o = (s = t[0]) == null ? void 0 : s.headers) != null ? o : [], ...(a = (i = n[0]) == null ? void 0 : i.headers) != null ? a : [], ...(l = (c = r[0]) == null ? void 0 : c.headers) != null ? l : []].map((u) => u.getLeafHeaders()).flat();
|
|
19378
|
-
}, ae(e.options,
|
|
19384
|
+
}, ae(e.options, je, "getLeafHeaders"));
|
|
19379
19385
|
}
|
|
19380
19386
|
};
|
|
19381
19387
|
function ho(e, t, n, r) {
|
|
@@ -22265,47 +22271,49 @@ Gh.displayName = zh.displayName;
|
|
|
22265
22271
|
const UI = T.forwardRef(
|
|
22266
22272
|
(e, t) => {
|
|
22267
22273
|
const {
|
|
22268
|
-
|
|
22269
|
-
|
|
22270
|
-
|
|
22271
|
-
|
|
22272
|
-
|
|
22273
|
-
|
|
22274
|
-
|
|
22274
|
+
label: n,
|
|
22275
|
+
labelPosition: r = "right",
|
|
22276
|
+
onChange: o,
|
|
22277
|
+
className: s,
|
|
22278
|
+
dir: a,
|
|
22279
|
+
disabled: i,
|
|
22280
|
+
id: l = Uo(),
|
|
22275
22281
|
...c
|
|
22276
22282
|
} = e;
|
|
22277
|
-
return
|
|
22283
|
+
return T.useEffect(() => {
|
|
22284
|
+
const { checked: u, defaultChecked: f } = c;
|
|
22285
|
+
u !== void 0 && f !== void 0 && console.error(
|
|
22286
|
+
"WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them."
|
|
22287
|
+
);
|
|
22288
|
+
}, [c.checked, c.defaultChecked]), /* @__PURE__ */ P(
|
|
22278
22289
|
"div",
|
|
22279
22290
|
{
|
|
22280
22291
|
className: N(
|
|
22281
|
-
qI({ labelPosition:
|
|
22292
|
+
qI({ labelPosition: r }),
|
|
22282
22293
|
"wu-toggle-container"
|
|
22283
22294
|
),
|
|
22284
|
-
dir:
|
|
22295
|
+
dir: a,
|
|
22285
22296
|
children: [
|
|
22286
22297
|
/* @__PURE__ */ d(
|
|
22287
22298
|
Gh,
|
|
22288
22299
|
{
|
|
22289
|
-
id: a,
|
|
22290
22300
|
...c,
|
|
22301
|
+
id: l,
|
|
22302
|
+
disabled: i,
|
|
22291
22303
|
ref: t,
|
|
22292
|
-
|
|
22293
|
-
|
|
22294
|
-
onCheckedChange: i,
|
|
22295
|
-
className: N("peer", l),
|
|
22296
|
-
dir: c.dir
|
|
22304
|
+
onCheckedChange: o,
|
|
22305
|
+
className: N("peer", s)
|
|
22297
22306
|
}
|
|
22298
22307
|
),
|
|
22299
22308
|
/* @__PURE__ */ d(
|
|
22300
22309
|
mt,
|
|
22301
22310
|
{
|
|
22302
|
-
htmlFor:
|
|
22311
|
+
htmlFor: l,
|
|
22303
22312
|
className: N(
|
|
22304
|
-
|
|
22313
|
+
i ? "cursor-not-allowed" : "cursor-pointer",
|
|
22305
22314
|
"wu-toggle-label"
|
|
22306
22315
|
),
|
|
22307
|
-
|
|
22308
|
-
children: o
|
|
22316
|
+
children: n
|
|
22309
22317
|
}
|
|
22310
22318
|
)
|
|
22311
22319
|
]
|