@npm-questionpro/wick-ui-lib 0.22.4 → 0.23.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.
- package/dist/src/components/combobox/WuCombobox.d.ts +2 -2
- package/dist/src/components/combobox/ui/_trigger.d.ts +3 -3
- package/dist/src/components/select/WuSelect.d.ts +1 -1
- package/dist/src/components/select/ui/_trigger.d.ts +3 -3
- package/dist/wick-ui-lib/es/index.js +31 -27
- package/dist/wick-ui-lib/es/index.js.map +1 -1
- package/dist/wick-ui-lib/umd/index.js +1 -1
- package/dist/wick-ui-lib/umd/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type IWuComboboxProps<T> = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue' | 'onSelect'> & {
|
|
3
3
|
data: T[];
|
|
4
4
|
accessorKey: {
|
|
5
5
|
value: string;
|
|
@@ -28,5 +28,5 @@ export interface IWuComboboxProps<T> {
|
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
labelPosition?: 'left' | 'top' | 'right';
|
|
30
30
|
className?: string;
|
|
31
|
-
}
|
|
31
|
+
};
|
|
32
32
|
export declare const WuCombobox: <T>({ data, accessorKey, value, defaultValue, Header, virtualizedThreshold, isEllipse, placeholder, variant, dir, onSelect, label, maxHeight, multiple, hasGroup, selectAll, id, disabled, labelPosition, className, }: IWuComboboxProps<T>) => React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IWuComboboxItem } from '../types/IWuComboboxOptions';
|
|
3
3
|
import { IWuComboboxProps } from '../WuCombobox';
|
|
4
|
-
export
|
|
4
|
+
export type IWuComboboxTriggerProps<T> = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue' | 'onSelect'> & {
|
|
5
5
|
accessorKey: {
|
|
6
6
|
label: string;
|
|
7
7
|
value: string;
|
|
@@ -17,5 +17,5 @@ export interface IWuComboboxTriggerProps<T> {
|
|
|
17
17
|
selectAll?: IWuComboboxProps<T>['selectAll'];
|
|
18
18
|
isCheckedAll?: boolean;
|
|
19
19
|
className?: string;
|
|
20
|
-
}
|
|
21
|
-
export declare const WuComboboxTrigger: <T>({ placeholder, isEllipse, selectedOptions, variant, dir, accessorKey, multiple, id, disabled, selectAll, isCheckedAll, className, }: IWuComboboxTriggerProps<T>) => React.JSX.Element;
|
|
20
|
+
};
|
|
21
|
+
export declare const WuComboboxTrigger: <T>({ placeholder, isEllipse, selectedOptions, variant, dir, accessorKey, multiple, id, disabled, selectAll, isCheckedAll, className, ...rest }: IWuComboboxTriggerProps<T>) => React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export interface IWuSelectProps<T> extends Omit<React.
|
|
2
|
+
export interface IWuSelectProps<T> extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue' | 'onSelect'> {
|
|
3
3
|
defaultValue?: T | T[] | null;
|
|
4
4
|
label?: string;
|
|
5
5
|
value?: T | T[] | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IWuSelectProps } from '../WuSelect';
|
|
3
|
-
export
|
|
3
|
+
export type IWuSelectTriggerProps<T> = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue'> & {
|
|
4
4
|
placeholder: string;
|
|
5
5
|
value: T | T[];
|
|
6
6
|
multiple?: boolean;
|
|
@@ -16,5 +16,5 @@ export interface IWuSelectTriggerProps<T> {
|
|
|
16
16
|
selectAll?: IWuSelectProps<T>['selectAll'];
|
|
17
17
|
isCheckedAll?: boolean;
|
|
18
18
|
width?: number;
|
|
19
|
-
}
|
|
20
|
-
export declare const WuSelectTrigger: <T>({ placeholder, value, multiple, accessorKey, variant, dir, customTriggerChildren, id, disabled, selectAll, isCheckedAll, width, }: IWuSelectTriggerProps<T>) => React.JSX.Element;
|
|
19
|
+
};
|
|
20
|
+
export declare const WuSelectTrigger: <T>({ placeholder, value, multiple, accessorKey, variant, dir, customTriggerChildren, id, disabled, selectAll, isCheckedAll, width, ...rest }: IWuSelectTriggerProps<T>) => React.JSX.Element;
|
|
@@ -14862,38 +14862,40 @@ const PN = ({ tags: e, triggerRef: t }) => {
|
|
|
14862
14862
|
disabled: l,
|
|
14863
14863
|
selectAll: c,
|
|
14864
14864
|
isCheckedAll: u,
|
|
14865
|
-
className: f
|
|
14865
|
+
className: f,
|
|
14866
|
+
...m
|
|
14866
14867
|
}) => {
|
|
14867
|
-
const [
|
|
14868
|
+
const [g, b] = re([]), h = ze(null);
|
|
14868
14869
|
Re(() => {
|
|
14869
14870
|
if (!n || Array.isArray(n) && n.length === 0) {
|
|
14870
|
-
|
|
14871
|
+
b([]);
|
|
14871
14872
|
return;
|
|
14872
14873
|
}
|
|
14873
14874
|
if (a) {
|
|
14874
|
-
const
|
|
14875
|
-
|
|
14876
|
-
|
|
14875
|
+
const y = n;
|
|
14876
|
+
b(
|
|
14877
|
+
y == null ? void 0 : y.map((w) => w[s.label])
|
|
14877
14878
|
);
|
|
14878
14879
|
return;
|
|
14879
14880
|
} else
|
|
14880
|
-
|
|
14881
|
+
b([n[s.label]]);
|
|
14881
14882
|
}, [n]);
|
|
14882
|
-
const
|
|
14883
|
-
var
|
|
14884
|
-
return
|
|
14883
|
+
const v = () => {
|
|
14884
|
+
var y;
|
|
14885
|
+
return g.length ? u && (c != null && c.enable) && (c != null && c.triggerText) ? /* @__PURE__ */ d("span", { className: "overflow-hidden text-xs text-start text-ellipsis whitespace-nowrap", children: c.triggerText }) : t ? /* @__PURE__ */ d(
|
|
14885
14886
|
"span",
|
|
14886
14887
|
{
|
|
14887
14888
|
className: "overflow-hidden text-xs text-start text-ellipsis whitespace-nowrap",
|
|
14888
|
-
style: { width: `${(((
|
|
14889
|
-
children:
|
|
14889
|
+
style: { width: `${(((y = h.current) == null ? void 0 : y.offsetWidth) || 0) - 32}px` },
|
|
14890
|
+
children: g.join(", ")
|
|
14890
14891
|
}
|
|
14891
|
-
) : /* @__PURE__ */ d(PN, { tags:
|
|
14892
|
+
) : /* @__PURE__ */ d(PN, { tags: g, triggerRef: h }) : /* @__PURE__ */ d("p", { className: "text-xs opacity-70", children: e });
|
|
14892
14893
|
};
|
|
14893
14894
|
return /* @__PURE__ */ d(qn, { dir: o, asChild: !0, id: i, disabled: l, children: /* @__PURE__ */ P(
|
|
14894
14895
|
"button",
|
|
14895
14896
|
{
|
|
14896
|
-
|
|
14897
|
+
...m,
|
|
14898
|
+
ref: h,
|
|
14897
14899
|
disabled: l,
|
|
14898
14900
|
className: N(
|
|
14899
14901
|
"select-trigger text-xs rounded-t-sm flex gap-2 h-8 group wu-combobox-trigger",
|
|
@@ -14901,9 +14903,8 @@ const PN = ({ tags: e, triggerRef: t }) => {
|
|
|
14901
14903
|
"disabled:cursor-not-allowed disabled:hover:border-gray-subtle disabled:bg-gray-10",
|
|
14902
14904
|
f
|
|
14903
14905
|
),
|
|
14904
|
-
"aria-label": "combobox-trigger",
|
|
14905
14906
|
children: [
|
|
14906
|
-
|
|
14907
|
+
v(),
|
|
14907
14908
|
/* @__PURE__ */ d("span", { className: "wm-arrow-drop-down group-data-[state=open]:rotate-180 transition-transform duration-300 text-base" })
|
|
14908
14909
|
]
|
|
14909
14910
|
}
|
|
@@ -16739,22 +16740,24 @@ const uT = "600px", dT = {
|
|
|
16739
16740
|
disabled: l,
|
|
16740
16741
|
selectAll: c,
|
|
16741
16742
|
isCheckedAll: u,
|
|
16742
|
-
width: f
|
|
16743
|
+
width: f,
|
|
16744
|
+
...m
|
|
16743
16745
|
}) => {
|
|
16744
|
-
const [
|
|
16746
|
+
const [g, b] = re(e);
|
|
16745
16747
|
return Re(() => {
|
|
16746
16748
|
if (!t || Array.isArray(t) && t.length === 0) {
|
|
16747
|
-
|
|
16749
|
+
b(e);
|
|
16748
16750
|
return;
|
|
16749
16751
|
}
|
|
16750
|
-
const
|
|
16752
|
+
const h = r.label;
|
|
16751
16753
|
if (n && Array.isArray(t)) {
|
|
16752
|
-
const
|
|
16753
|
-
|
|
16754
|
-
} else !n && !Array.isArray(t) &&
|
|
16754
|
+
const v = t.map((y) => y[h]).join(", ");
|
|
16755
|
+
b(v);
|
|
16756
|
+
} else !n && !Array.isArray(t) && b(t[h]);
|
|
16755
16757
|
}, [t, r.label, n, e]), /* @__PURE__ */ d(zm, { asChild: !0, dir: s, id: i, disabled: l, children: /* @__PURE__ */ P(
|
|
16756
16758
|
"button",
|
|
16757
16759
|
{
|
|
16760
|
+
...m,
|
|
16758
16761
|
disabled: l,
|
|
16759
16762
|
className: N(
|
|
16760
16763
|
"flex gap-2 w-full items-center justify-between py-1.5 px-2 text-xs transition-colors cursor-pointer border-b bg-white border-gray-subtle h-8",
|
|
@@ -16762,7 +16765,8 @@ const uT = "600px", dT = {
|
|
|
16762
16765
|
"disabled:cursor-not-allowed disabled:hover:border-gray-subtle disabled:bg-gray-10 disabled:opacity-50",
|
|
16763
16766
|
"hover:bg-gray-10 hover:border-blue-p",
|
|
16764
16767
|
o === "outlined" && "border border-gray-40",
|
|
16765
|
-
"group wu-select-trigger"
|
|
16768
|
+
"group wu-select-trigger",
|
|
16769
|
+
m.className
|
|
16766
16770
|
),
|
|
16767
16771
|
children: [
|
|
16768
16772
|
a ?? /* @__PURE__ */ d(
|
|
@@ -16770,7 +16774,7 @@ const uT = "600px", dT = {
|
|
|
16770
16774
|
{
|
|
16771
16775
|
className: "overflow-hidden text-xs text-start text-ellipsis whitespace-nowrap",
|
|
16772
16776
|
style: { width: `${(f || 0) - 32}px` },
|
|
16773
|
-
children: u ? (c == null ? void 0 : c.triggerText) ??
|
|
16777
|
+
children: u ? (c == null ? void 0 : c.triggerText) ?? g : g
|
|
16774
16778
|
}
|
|
16775
16779
|
),
|
|
16776
16780
|
/* @__PURE__ */ d("span", { className: "wm-arrow-drop-down group-data-[state=open]:rotate-180 transition-transform duration-300 text-base" })
|
|
@@ -16987,6 +16991,7 @@ const uT = "600px", dT = {
|
|
|
16987
16991
|
/* @__PURE__ */ d(
|
|
16988
16992
|
gT,
|
|
16989
16993
|
{
|
|
16994
|
+
...w,
|
|
16990
16995
|
value: x,
|
|
16991
16996
|
multiple: n,
|
|
16992
16997
|
variant: a,
|
|
@@ -16997,8 +17002,7 @@ const uT = "600px", dT = {
|
|
|
16997
17002
|
id: w.id,
|
|
16998
17003
|
disabled: v,
|
|
16999
17004
|
selectAll: h,
|
|
17000
|
-
isCheckedAll: E
|
|
17001
|
-
...w
|
|
17005
|
+
isCheckedAll: E
|
|
17002
17006
|
}
|
|
17003
17007
|
),
|
|
17004
17008
|
/* @__PURE__ */ P(
|