@dexma/ui-components 8.0.4 → 8.0.5
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.
|
@@ -20,5 +20,5 @@ export type DropdownProps = DropDownProps & {
|
|
|
20
20
|
iconAriaLabel?: string;
|
|
21
21
|
onItemSelected: (key: number) => void;
|
|
22
22
|
};
|
|
23
|
-
export declare const Dropdown: ({ dataId, trigger, text, placement, menu, icon, content, variant, open, disabled, iconAriaLabel, onItemSelected }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const Dropdown: ({ dataId, trigger, text, placement, menu, icon, content, variant, open, disabled, iconAriaLabel, onItemSelected, }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
export default Dropdown;
|
package/dist/ui-components.es.js
CHANGED
|
@@ -61112,28 +61112,42 @@ const U_e = (e) => {
|
|
|
61112
61112
|
if (!$) return null;
|
|
61113
61113
|
const E = (L, T) => L && T ? "iconTextButton" : !L && T ? "iconButton" : "button";
|
|
61114
61114
|
return {
|
|
61115
|
-
items: $ ? $.map(
|
|
61116
|
-
|
|
61117
|
-
|
|
61118
|
-
|
|
61119
|
-
|
|
61120
|
-
|
|
61121
|
-
|
|
61122
|
-
|
|
61123
|
-
|
|
61124
|
-
|
|
61125
|
-
|
|
61126
|
-
|
|
61127
|
-
|
|
61128
|
-
|
|
61129
|
-
|
|
61130
|
-
|
|
61131
|
-
|
|
61132
|
-
|
|
61133
|
-
|
|
61134
|
-
|
|
61135
|
-
|
|
61136
|
-
|
|
61115
|
+
items: $ ? $.map(
|
|
61116
|
+
({
|
|
61117
|
+
key: L,
|
|
61118
|
+
icon: T,
|
|
61119
|
+
onClick: I,
|
|
61120
|
+
dataId: O,
|
|
61121
|
+
variant: D,
|
|
61122
|
+
text: P,
|
|
61123
|
+
ariaLabel: V,
|
|
61124
|
+
disabled: H,
|
|
61125
|
+
iconAriaLabel: N,
|
|
61126
|
+
onKeyDown: k,
|
|
61127
|
+
...F
|
|
61128
|
+
}, A) => ({
|
|
61129
|
+
label: /* @__PURE__ */ Pe(
|
|
61130
|
+
i6e,
|
|
61131
|
+
{
|
|
61132
|
+
kind: E(P, T),
|
|
61133
|
+
className: "dropdown-button-item",
|
|
61134
|
+
style: { width: "100%", padding: "0px 1rem" },
|
|
61135
|
+
iconBefore: T,
|
|
61136
|
+
onClick: I,
|
|
61137
|
+
dataId: O ?? "ddItem",
|
|
61138
|
+
variant: D ?? "icon",
|
|
61139
|
+
text: E(P, T) === "button" || E(P, T) === "iconTextButton" ? P : "",
|
|
61140
|
+
"aria-label": T ? V : void 0,
|
|
61141
|
+
"aria-disabled": H,
|
|
61142
|
+
disabled: H,
|
|
61143
|
+
iconAriaLabel: T && N || "",
|
|
61144
|
+
...F,
|
|
61145
|
+
type: "button"
|
|
61146
|
+
},
|
|
61147
|
+
L ?? `key_${A}`
|
|
61148
|
+
)
|
|
61149
|
+
})
|
|
61150
|
+
) : void 0
|
|
61137
61151
|
};
|
|
61138
61152
|
})(o), S = ($) => {
|
|
61139
61153
|
g(!1);
|
|
@@ -61142,25 +61156,37 @@ const U_e = (e) => {
|
|
|
61142
61156
|
};
|
|
61143
61157
|
return /* @__PURE__ */ Jt(ja, { children: [
|
|
61144
61158
|
/* @__PURE__ */ Pe(a6e, {}),
|
|
61145
|
-
/* @__PURE__ */ Pe(
|
|
61146
|
-
|
|
61159
|
+
/* @__PURE__ */ Pe(
|
|
61160
|
+
av,
|
|
61147
61161
|
{
|
|
61148
|
-
|
|
61149
|
-
|
|
61150
|
-
|
|
61151
|
-
|
|
61152
|
-
|
|
61153
|
-
|
|
61154
|
-
|
|
61155
|
-
|
|
61156
|
-
|
|
61157
|
-
|
|
61158
|
-
|
|
61159
|
-
|
|
61160
|
-
|
|
61161
|
-
|
|
61162
|
-
|
|
61163
|
-
|
|
61162
|
+
menu: { items: M ? M.items : [], onClick: S },
|
|
61163
|
+
placement: r,
|
|
61164
|
+
trigger: t,
|
|
61165
|
+
open: h,
|
|
61166
|
+
onOpenChange: C,
|
|
61167
|
+
disabled: c,
|
|
61168
|
+
children: /* @__PURE__ */ Pe(
|
|
61169
|
+
o6e,
|
|
61170
|
+
{
|
|
61171
|
+
tabIndex: 0,
|
|
61172
|
+
kind: p,
|
|
61173
|
+
id: m,
|
|
61174
|
+
"data-testid": `dropdown-button-${i ? "icon" : "text"}`,
|
|
61175
|
+
dataId: e,
|
|
61176
|
+
className: "dropdown-button",
|
|
61177
|
+
variant: l ?? "icon",
|
|
61178
|
+
iconBefore: i,
|
|
61179
|
+
text: p === "button" || p === "iconTextButton" ? n : "",
|
|
61180
|
+
"aria-disabled": c,
|
|
61181
|
+
onKeyDown: t && t.find(($) => $ !== "click") ? y : void 0,
|
|
61182
|
+
ref: v,
|
|
61183
|
+
type: "button",
|
|
61184
|
+
"aria-expanded": h,
|
|
61185
|
+
iconAriaLabel: i && d || ""
|
|
61186
|
+
}
|
|
61187
|
+
)
|
|
61188
|
+
}
|
|
61189
|
+
)
|
|
61164
61190
|
] });
|
|
61165
61191
|
};
|
|
61166
61192
|
var l6e = ex, s6e = hp, c6e = b1;
|
|
@@ -2095,7 +2095,7 @@ Valid keys: `+JSON.stringify(Object.keys(A),null," "));var G=ae(U,oe,Z,J,te+"."
|
|
|
2095
2095
|
width: 100%;
|
|
2096
2096
|
`,M4e=Ut(Tl)`
|
|
2097
2097
|
${e=>!e.variant&&e.variant!==""||e.variant==="icon"||e.variant==="icon-secondary"?"padding: 0; margin: 0;":""}
|
|
2098
|
-
`,_4e=({dataId:e="dropdown-button",trigger:t=["hover"],text:n,placement:r="bottomRight",menu:a,icon:i,content:o,variant:l,open:s,disabled:c,iconAriaLabel:d,onItemSelected:u})=>{const[h,g]=Y.useState(s||!1),v=Y.useRef(null),m=`dropdown-button-${n?"text":"icon"}_${Date.now()}`,p=n&&i?"iconTextButton":!n&&i?"iconButton":"button",C=()=>{g($=>!$),setTimeout(()=>{var M;const $=document.querySelector(".ant-dropdown");$&&v&&($.setAttribute("role","dialog"),$.setAttribute("aria-labelledby",((M=v.current)==null?void 0:M.id)||""))},0)},y=$=>{$.key==="Enter"&&!s&&($.preventDefault(),C())},E=a||($=>{if(!$)return null;const M=(P,R)=>P&&R?"iconTextButton":!P&&R?"iconButton":"button";return{items:$?$.map(({key:P,icon:R,onClick:H,dataId:O,variant:D,text:k,ariaLabel:V,disabled:I,iconAriaLabel:N,onKeyDown:T,...F},A)=>({label:we.jsx(E4e,{kind:M(k,R),className:"dropdown-button-item",style:{width:"100%",padding:"0px 1rem"},iconBefore:R,onClick:H,dataId:O??"ddItem",variant:D??"icon",text:M(k,R)==="button"||M(k,R)==="iconTextButton"?k:"","aria-label":R?V:void 0,"aria-disabled":I,disabled:I,iconAriaLabel:R&&N||"",...F,type:"button"},P??`key_${A}`)})):void 0}})(o),S=$=>{g(!1);const M=$.key.split("-")[1];u(M)};return we.jsxs(we.Fragment,{children:[we.jsx($4e,{}),we.jsx(Rg,{menu:{items:E?E.items:[],onClick:S},placement:r,trigger:t,open:h,onOpenChange:C,disabled:c,children:we.jsx(M4e,{tabIndex:0,kind:p,id:m,"data-testid":`dropdown-button-${i?"icon":"text"}`,dataId:e,className:"dropdown-button",variant:l??"icon",iconBefore:i,text:p==="button"||p==="iconTextButton"?n:"","aria-disabled":c,onKeyDown:t&&t.find($=>$!=="click")?y:void 0,ref:v,"aria-expanded":h,iconAriaLabel:i&&d||""})})]})};var L4e=H4,P4e=Y1,k4e=Od;function T4e(e){return function(t,n,r){var a=Object(t);if(!P4e(t)){var i=L4e(n);t=k4e(t),n=function(l){return i(a[l],l,a)}}var o=e(t,n,r);return o>-1?a[i?t[o]:o]:void 0}}var R4e=T4e;function O4e(e,t,n,r){for(var a=e.length,i=n+(r?1:-1);r?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var N4e=O4e,D4e=n7,lR=1/0,I4e=17976931348623157e292;function H4e(e){if(!e)return e===0?e:0;if(e=D4e(e),e===lR||e===-lR){var t=e<0?-1:1;return t*I4e}return e===e?e:0}var A4e=H4e,V4e=A4e;function j4e(e){var t=V4e(e),n=t%1;return t===t?n?t-n:t:0}var F4e=j4e,z4e=N4e,B4e=H4,Y4e=F4e,W4e=Math.max;function Z4e(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:Y4e(n);return a<0&&(a=W4e(r+a,0)),z4e(e,B4e(t),a)}var U4e=Z4e,K4e=R4e,G4e=U4e,X4e=K4e(G4e),q4e=X4e;const cm=fn(q4e);var Q4e=zb,J4e=I1,eCe=Wb,sR=Ll,tCe=Ld;function nCe(e,t,n,r){if(!sR(e))return e;t=J4e(t,e);for(var a=-1,i=t.length,o=i-1,l=e;l!=null&&++a<i;){var s=tCe(t[a]),c=n;if(s==="__proto__"||s==="constructor"||s==="prototype")return e;if(a!=o){var d=l[s];c=r?r(d,s,l):void 0,c===void 0&&(c=sR(d)?d:eCe(t[a+1])?[]:{})}Q4e(l,s,c),l=l[s]}return e}var rCe=nCe,aCe=rCe;function iCe(e,t,n){return e==null?e:aCe(e,t,n)}var oCe=iCe;const cR=fn(oCe),lCe=e=>Zt`
|
|
2098
|
+
`,_4e=({dataId:e="dropdown-button",trigger:t=["hover"],text:n,placement:r="bottomRight",menu:a,icon:i,content:o,variant:l,open:s,disabled:c,iconAriaLabel:d,onItemSelected:u})=>{const[h,g]=Y.useState(s||!1),v=Y.useRef(null),m=`dropdown-button-${n?"text":"icon"}_${Date.now()}`,p=n&&i?"iconTextButton":!n&&i?"iconButton":"button",C=()=>{g($=>!$),setTimeout(()=>{var M;const $=document.querySelector(".ant-dropdown");$&&v&&($.setAttribute("role","dialog"),$.setAttribute("aria-labelledby",((M=v.current)==null?void 0:M.id)||""))},0)},y=$=>{$.key==="Enter"&&!s&&($.preventDefault(),C())},E=a||($=>{if(!$)return null;const M=(P,R)=>P&&R?"iconTextButton":!P&&R?"iconButton":"button";return{items:$?$.map(({key:P,icon:R,onClick:H,dataId:O,variant:D,text:k,ariaLabel:V,disabled:I,iconAriaLabel:N,onKeyDown:T,...F},A)=>({label:we.jsx(E4e,{kind:M(k,R),className:"dropdown-button-item",style:{width:"100%",padding:"0px 1rem"},iconBefore:R,onClick:H,dataId:O??"ddItem",variant:D??"icon",text:M(k,R)==="button"||M(k,R)==="iconTextButton"?k:"","aria-label":R?V:void 0,"aria-disabled":I,disabled:I,iconAriaLabel:R&&N||"",...F,type:"button"},P??`key_${A}`)})):void 0}})(o),S=$=>{g(!1);const M=$.key.split("-")[1];u(M)};return we.jsxs(we.Fragment,{children:[we.jsx($4e,{}),we.jsx(Rg,{menu:{items:E?E.items:[],onClick:S},placement:r,trigger:t,open:h,onOpenChange:C,disabled:c,children:we.jsx(M4e,{tabIndex:0,kind:p,id:m,"data-testid":`dropdown-button-${i?"icon":"text"}`,dataId:e,className:"dropdown-button",variant:l??"icon",iconBefore:i,text:p==="button"||p==="iconTextButton"?n:"","aria-disabled":c,onKeyDown:t&&t.find($=>$!=="click")?y:void 0,ref:v,type:"button","aria-expanded":h,iconAriaLabel:i&&d||""})})]})};var L4e=H4,P4e=Y1,k4e=Od;function T4e(e){return function(t,n,r){var a=Object(t);if(!P4e(t)){var i=L4e(n);t=k4e(t),n=function(l){return i(a[l],l,a)}}var o=e(t,n,r);return o>-1?a[i?t[o]:o]:void 0}}var R4e=T4e;function O4e(e,t,n,r){for(var a=e.length,i=n+(r?1:-1);r?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var N4e=O4e,D4e=n7,lR=1/0,I4e=17976931348623157e292;function H4e(e){if(!e)return e===0?e:0;if(e=D4e(e),e===lR||e===-lR){var t=e<0?-1:1;return t*I4e}return e===e?e:0}var A4e=H4e,V4e=A4e;function j4e(e){var t=V4e(e),n=t%1;return t===t?n?t-n:t:0}var F4e=j4e,z4e=N4e,B4e=H4,Y4e=F4e,W4e=Math.max;function Z4e(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:Y4e(n);return a<0&&(a=W4e(r+a,0)),z4e(e,B4e(t),a)}var U4e=Z4e,K4e=R4e,G4e=U4e,X4e=K4e(G4e),q4e=X4e;const cm=fn(q4e);var Q4e=zb,J4e=I1,eCe=Wb,sR=Ll,tCe=Ld;function nCe(e,t,n,r){if(!sR(e))return e;t=J4e(t,e);for(var a=-1,i=t.length,o=i-1,l=e;l!=null&&++a<i;){var s=tCe(t[a]),c=n;if(s==="__proto__"||s==="constructor"||s==="prototype")return e;if(a!=o){var d=l[s];c=r?r(d,s,l):void 0,c===void 0&&(c=sR(d)?d:eCe(t[a+1])?[]:{})}Q4e(l,s,c),l=l[s]}return e}var rCe=nCe,aCe=rCe;function iCe(e,t,n){return e==null?e:aCe(e,t,n)}var oCe=iCe;const cR=fn(oCe),lCe=e=>Zt`
|
|
2099
2099
|
label {
|
|
2100
2100
|
&.active {
|
|
2101
2101
|
&:hover {
|