@webority/ui-react 0.85.1 → 0.86.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.
Files changed (48) hide show
  1. package/dist/components/AppAccordion.js +1 -1
  2. package/dist/components/AppActionIcon.js +1 -1
  3. package/dist/components/AppConsentBanner.js +1 -1
  4. package/dist/components/AppDataTable.js +1 -1
  5. package/dist/components/AppDatePicker.js +1 -1
  6. package/dist/components/AppFileViewer.js +1 -1
  7. package/dist/components/AppFormRow.js +1 -1
  8. package/dist/components/AppInput.js +1 -1
  9. package/dist/components/AppKpiTile.js +1 -1
  10. package/dist/components/AppRollingNumber.js +1 -1
  11. package/dist/components/AppSectionFaq.js +1 -1
  12. package/dist/components/AppSegmented.js +1 -1
  13. package/dist/components/AppSelect.js +1 -1
  14. package/dist/components/AppSwitch.js +1 -1
  15. package/dist/components/AppTablePagination.js +1 -1
  16. package/dist/components/AppTimePicker.js +1 -1
  17. package/dist/components/AppWizard.js +1 -1
  18. package/dist/components/iconCatalogFull/bold/b.g.js +1 -1
  19. package/dist/components/iconCatalogFull/broken/b.g.js +1 -1
  20. package/dist/components/iconCatalogFull/bulk/b.g.js +1 -1
  21. package/dist/components/iconCatalogFull/linear/b.g.js +1 -1
  22. package/dist/components/iconCatalogFull/outline/b.g.js +1 -1
  23. package/dist/components/iconCatalogFull/twotone/b.g.js +1 -1
  24. package/dist/components/iconCatalogNames.g.js +1 -1
  25. package/dist/components/iconGlyphs.g.js +1 -1
  26. package/dist/components/iconVariants.g.js +1 -1
  27. package/dist/lib/sectionShell.js +1 -1
  28. package/dist/types/components/AppAccordion.d.ts +2 -0
  29. package/dist/types/components/AppActionIcon.d.ts +1 -1
  30. package/dist/types/components/AppConsentBanner.d.ts +2 -0
  31. package/dist/types/components/AppDataTable.d.ts +6 -3
  32. package/dist/types/components/AppFileViewer.d.ts +1 -0
  33. package/dist/types/components/AppFormRow.d.ts +6 -4
  34. package/dist/types/components/AppIcon.d.ts +1 -1
  35. package/dist/types/components/AppResult.d.ts +2 -0
  36. package/dist/types/components/AppSectionFaq.d.ts +2 -0
  37. package/dist/types/components/AppSectionHero.d.ts +1 -1
  38. package/dist/types/components/AppTablePagination.d.ts +8 -6
  39. package/dist/types/components/AppTimePicker.d.ts +1 -1
  40. package/dist/types/components/iconCatalogFull/bold/b.g.d.ts +1 -0
  41. package/dist/types/components/iconCatalogFull/broken/b.g.d.ts +1 -0
  42. package/dist/types/components/iconCatalogFull/bulk/b.g.d.ts +1 -0
  43. package/dist/types/components/iconCatalogFull/linear/b.g.d.ts +1 -0
  44. package/dist/types/components/iconCatalogFull/outline/b.g.d.ts +1 -0
  45. package/dist/types/components/iconCatalogFull/twotone/b.g.d.ts +1 -0
  46. package/dist/types/components/iconGlyphs.g.d.ts +6 -0
  47. package/dist/types/components/iconVariants.g.d.ts +30 -0
  48. package/package.json +3 -3
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{useId as r,useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(s){let{items:c=[],multiple:l=!1,id:u,className:d=``,...f}=s;t(`AppAccordion`,f);let p=r(),m=u||p,[h,g]=i(()=>{let e=c.map((e,t)=>({item:e,key:e.key??String(t)})).filter(({item:e})=>e.open).map(({key:e})=>e);return new Set(l?e:e.slice(0,1))}),_=(e,t)=>e.key??String(t),v=e=>{g(t=>{let n=new Set(l?t:[]);return t.has(e)?n.delete(e):n.add(e),n})};return a(`div`,{className:`faq-list${d?` ${d}`:``}`,...e(`AppAccordion`,s),...f,children:c.map((e,t)=>{let r=_(e,t),i=h.has(r),s=`${m}-${t}`,c=`${s}-q`;return o(`div`,{className:`faq-item${i?` open`:``}`,children:[o(`button`,{type:`button`,className:`faq-q`,id:c,"aria-expanded":i,"aria-controls":s,onClick:()=>v(r),children:[e.title,a(`span`,{className:`faq-q-icon`,children:a(n,{name:`chevron-down`,size:18})})]}),a(`section`,{className:`faq-a-wrap`,id:s,"aria-labelledby":c,inert:!i,"aria-hidden":!i||void 0,children:a(`div`,{className:`faq-a-inner`,children:e.content})})]},r)})})}export{s as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{useEffect as r,useId as i,useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(e,t,n){if(Array.isArray(n)){let e=n.map(String);return new Set(t?e:e.slice(0,1))}let r=e.map((e,t)=>({item:e,key:e.key??String(t)})).filter(({item:e})=>e.open).map(({key:e})=>e);return new Set(t?r:r.slice(0,1))}function l(l){let{items:u=[],multiple:d=!1,openItems:f,id:p,className:m=``,...h}=l;t(`AppAccordion`,h);let g=i(),_=p||g,[v,y]=a(()=>c(u,d,f)),b=Array.isArray(f)?f.map(String).join(`\0`):null;r(()=>{b!==null&&y(c(u,d,f))},[b,d]);let x=(e,t)=>e.key??String(t),S=e=>{y(t=>{let n=new Set(d?t:[]);return t.has(e)?n.delete(e):n.add(e),n})};return o(`div`,{className:`faq-list${m?` ${m}`:``}`,...e(`AppAccordion`,l),...h,children:u.map((e,t)=>{let r=x(e,t),i=v.has(r),a=`${_}-${t}`,c=`${a}-q`;return s(`div`,{className:`faq-item${i?` open`:``}`,children:[s(`button`,{type:`button`,className:`faq-q`,id:c,"aria-expanded":i,"aria-controls":a,onClick:()=>S(r),children:[e.title,o(`span`,{className:`faq-q-icon`,children:o(n,{name:`chevron-down`,size:18})})]}),o(`section`,{className:`faq-a-wrap`,id:a,"aria-labelledby":c,inert:!i,"aria-hidden":!i||void 0,children:o(`div`,{className:`faq-a-inner`,children:e.content})})]},r)})})}export{l as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{shortcutAria as i}from"../lib/shortcutChip.js";import a from"./withTooltip.js";import o from"./renderIconProp.js";import{useRef as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`];function f(f){let{icon:p,iconVariant:m,label:h,tooltipPlacement:g=`auto`,shortcut:_,danger:v=!1,disabled:y=!1,size:b=20,onClick:x,className:S=``,as:C,href:w,accept:T,multiple:E=!1,onFiles:D,...O}=f;r(`AppActionIcon`,C===void 0?O:{...O,as:C}),n(`AppActionIcon`,`iconVariant`,m,d);let k=typeof D==`function`;k&&(C!==void 0||w!==void 0)&&t(`AppActionIcon: file mode renders a button; href and as are ignored.`),!k&&(T!==void 0||E)&&t(`AppActionIcon: accept and multiple apply only in file mode (pass onFiles).`);let A=s(null),j=e=>{let t=[...e.target.files];e.target.value=``,t.length>0&&D(t)},M=[`u-action`,v?`danger`:``,S].filter(Boolean).join(` `),{style:N,...P}=O,F={"--wui-action-size":`${b+16}px`,...N},I=k?`button`:C??(w?`a`:`button`),L=I===`button`,R=a(l(I,{type:L?`button`:void 0,href:L||y?void 0:w,className:M,style:F,"aria-label":h,"aria-keyshortcuts":i(_),disabled:L?y:void 0,"aria-disabled":!L&&y?`true`:void 0,role:!L&&y?`link`:void 0,tabIndex:!L&&y?-1:void 0,onClick:e=>{if(y){e.preventDefault(),e.stopPropagation();return}x?.(e),k&&!e.defaultPrevented&&A.current?.click()},...e(`AppActionIcon`,f),...P,children:o(p,{size:b,variant:m})}),h,g,_);return k?u(c,{children:[R,l(`input`,{type:`file`,ref:A,className:`wui-action-icon-file`,hidden:!0,tabIndex:-1,"aria-hidden":`true`,accept:T,multiple:E,onChange:j,onClick:e=>e.stopPropagation()})]}):R}export{f as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{shortcutAria as i}from"../lib/shortcutChip.js";import a from"./withTooltip.js";import o from"./renderIconProp.js";import{useRef as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`];function f(f){let{icon:p,iconVariant:m,label:h,tooltipPlacement:g=`auto`,shortcut:_,danger:v=!1,disabled:y=!1,size:b=20,onClick:x,className:S=``,as:C,href:w,accept:T,multiple:E=!1,onFiles:D,...O}=f,k=Number(b),A=Number.isFinite(k)&&k>0?k:20;b!==void 0&&!(Number.isFinite(k)&&k>0)&&t(`AppActionIcon: size must be a positive number of px.`),r(`AppActionIcon`,C===void 0?O:{...O,as:C}),n(`AppActionIcon`,`iconVariant`,m,d);let j=typeof D==`function`;j&&(C!==void 0||w!==void 0)&&t(`AppActionIcon: file mode renders a button; href and as are ignored.`),!j&&(T!==void 0||E)&&t(`AppActionIcon: accept and multiple apply only in file mode (pass onFiles).`);let M=s(null),N=e=>{let t=[...e.target.files];e.target.value=``,t.length>0&&D(t)},P=[`u-action`,v?`danger`:``,S].filter(Boolean).join(` `),{style:F,...I}=O,L={"--wui-action-size":`${A+16}px`,...F},R=j?`button`:C??(w?`a`:`button`),z=R===`button`,B=a(l(R,{type:z?`button`:void 0,href:z||y?void 0:w,className:P,style:L,"aria-label":h,"aria-keyshortcuts":i(_),disabled:z?y:void 0,"aria-disabled":!z&&y?`true`:void 0,role:!z&&y?`link`:void 0,tabIndex:!z&&y?-1:void 0,onClick:e=>{if(y){e.preventDefault(),e.stopPropagation();return}x?.(e),j&&!e.defaultPrevented&&M.current?.click()},...e(`AppActionIcon`,f),...I,children:o(p,{size:A,variant:m})}),h,g,_);return j?u(c,{children:[B,l(`input`,{type:`file`,ref:M,className:`wui-action-icon-file`,hidden:!0,tabIndex:-1,"aria-hidden":`true`,accept:T,multiple:E,onChange:N,onClick:e=>e.stopPropagation()})]}):B}export{f as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./useWuiControl.js";import{useEffect as i}from"react";import{jsx as a}from"react/jsx-runtime";import"@webority/ui-elements/elements/consent-banner";import{getConsent as o,saveConsent as s}from"@webority/analytics/site";var c=[`bottom-left`,`bottom-right`,`bar`],l=[`analytics`,`functional`,`marketing`];function u(u){let{heading:d,description:f,policyHref:p,policyLabel:m,analyticsDescription:h,functionalDescription:g,marketingDescription:_,categories:v,position:y=`bottom-left`,standalone:b=!1,className:x=``,style:S,...C}=u;n(`AppConsentBanner`,C),t(`AppConsentBanner`,`position`,y,c);for(let e of v??[])t(`AppConsentBanner`,`categories`,e,l);let{setRef:w,innerRef:T}=r({on:{"wui-consent-save":e=>{s(e.detail),T.current&&(T.current.preferences=o())}}});return i(()=>{let e=T.current;if(!e)return;let t=o();e.preferences=t,t.decided||e.open()},[T]),a(`wui-consent-banner`,{ref:w,position:y,heading:d||void 0,description:f||void 0,"policy-href":p||void 0,"policy-label":m||void 0,"analytics-description":h||void 0,"functional-description":g||void 0,"marketing-description":_||void 0,categories:v?.length?v.join(` `):void 0,standalone:b||void 0,class:x||void 0,style:S,...e(`AppConsentBanner`,u),...C})}export{u as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./useWuiControl.js";import{useEffect as i}from"react";import{jsx as a}from"react/jsx-runtime";import"@webority/ui-elements/elements/consent-banner";import{getConsent as o,saveConsent as s}from"@webority/analytics/site";var c=[`bottom-left`,`bottom-right`,`bar`],l=[`analytics`,`functional`,`marketing`];function u(u){let{heading:d,description:f,policyHref:p,policyLabel:m,analyticsDescription:h,functionalDescription:g,marketingDescription:_,categories:v,position:y=`bottom-left`,standalone:b=!1,preview:x=!1,className:S=``,style:C,...w}=u;n(`AppConsentBanner`,w),t(`AppConsentBanner`,`position`,y,c);for(let e of v??[])t(`AppConsentBanner`,`categories`,e,l);let{setRef:T,innerRef:E}=r({on:{"wui-consent-save":e=>{x||(s(e.detail),E.current&&(E.current.preferences=o()))}}});return i(()=>{let e=E.current;if(!e)return;if(x){e.open();return}let t=o();e.preferences=t,t.decided||e.open()},[E,x]),a(`wui-consent-banner`,{ref:T,position:y,heading:d||void 0,description:f||void 0,"policy-href":p||void 0,"policy-label":m||void 0,"analytics-description":h||void 0,"functional-description":g||void 0,"marketing-description":_||void 0,categories:v?.length?v.join(` `):void 0,standalone:b||void 0,preview:x||void 0,class:S||void 0,style:C,...e(`AppConsentBanner`,u),...w})}export{u as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import i from"./AppIcon.js";import{AppSkeletonRows as a}from"./AppSkeleton.js";import o from"./AppTablePagination.js";import{attachRowDrag as s,attachScrollEdges as c,syncTargets as ee}from"@webority/ui-elements/helpers";import{Fragment as te,useEffect as l,useLayoutEffect as u,useMemo as ne,useRef as d,useState as f}from"react";import{Fragment as re,jsx as p,jsxs as m}from"react/jsx-runtime";import{COLUMN_MAX_WIDTH as ie,COLUMN_MIN_WIDTH as ae,DATA_TABLE_TEXT as oe,PIN_AT_VAR as se,PIN_SIDES as ce,ROW_HEIGHTS as le,ROW_MOVE_LIMIT as ue,ROW_SAVE_ERROR_CLASS as de,groupCount as fe,groupItems as pe,measureRows as me,pinAtValue as he,pinClasses as ge,planPins as _e,playRowMoves as ve,rowOrderChanged as ye,saveOutcomeText as be,settledRows as xe,virtualRange as Se}from"@webority/ui-elements/elements/data-table";var Ce=[`comfortable`,`cozy`,`compact`],h=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},g=new Set;function _(e,n){g.has(e)||!h()||(g.add(e),t(`[@webority/ui-react] <AppDataTable> ${n}`))}var we=100,Te=e=>e.id,Ee=(e,t,n)=>{let r=!!t?.(e),i=r?``:n?.(e)||``;return{state:r?`saving`:i?`error`:null,message:i}};function v(e){return e===`end`?`wui-cell-end`:e===`num`?`num`:e===`center`?`text-center`:``}function De(e){return e==null||e===``?`-`:typeof e==`boolean`?String(e):e}function Oe(e){if(!e||!(e.total>0))return!1;let t=e.pageSizes?.length?e.pageSizes:[e.pageSize];return e.total>Math.min(...t)}function y(t){let{columns:h,rows:g,rowKey:y=Te,sort:ke,onSort:b,loading:x=!1,skeletonRows:Ae=5,empty:je=`No records found.`,emptyFiltered:Me,sourceCount:Ne,rowActions:S,rowActionsLabel:Pe,pagination:C,ariaLabel:Fe,className:Ie=``,wrapperClassName:Le=``,selectable:w=!1,selectedIds:T,isRowSelectable:Re,onToggleRow:ze,onToggleAll:Be,onSelectRange:Ve,renderExpanded:He,density:E=`comfortable`,striped:Ue=!1,flush:We=!1,rowDrag:D=!1,maxHeight:O,stickyFirstColumn:Ge=!1,stickyActions:Ke=!1,stackOnMobile:k=!1,hiddenColumns:qe,rowStatus:Je,rowHref:A,onRowClick:j,activeRowKey:Ye,resizableColumns:M=!1,viewKey:Xe,groupBy:N,groupLabel:Ze,virtual:P=!1,rowSaving:F,rowSaveError:I,...Qe}=t;r(`AppDataTable`,Qe);let $e=qe?.length?new Set(qe):null;h=$e?h.filter(e=>!(e.hideable&&$e.has(e.key))):h,n(`AppDataTable`,`density`,E,Ce);for(let e of h)n(`AppDataTable`,`column.pin`,e.pin,ce);let et=[`table table-ledger`,E===`cozy`||E===`compact`?`wui-table-${E}`:``,Ue?`wui-table-striped`:``,Ge?`wui-table-sticky-first`:``,Ke?`wui-table-sticky-actions`:``,k?`wui-table-stack`:``,Ie].filter(Boolean).join(` `),L=typeof He==`function`,[tt,nt]=f(()=>new Set),rt=e=>nt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),it=h.some(e=>typeof e.footer==`function`),R=typeof A==`function`||typeof j==`function`,at=e=>!!e.target.closest(`a, button, input, select, textarea, label, [role='menu'], [role='menuitem'], .dropdown`),ot=(e,t)=>{if(at(t)||(j&&j(e),!A))return;let n=A(e);n&&(t.ctrlKey||t.metaKey||t.button===1?window.open(n,`_blank`,`noopener`):window.location.assign(n))},z=O!==void 0,st=[`table-wrap`,z?`wui-table-scroll`:``,We?`wui-table-flush`:``,Le].filter(Boolean).join(` `),ct=z?{maxHeight:O}:void 0,B=Math.max(1,h.length+ +!!S+ +!!w+ +!!L),lt=h.some(e=>e.pin===`start`||e.pin===`end`),V=lt||M||!!N||P,H=+!!L+ +!!w,ut=lt?_e([...L?[`lead`]:[],...w?[`lead`]:[],...h.map(e=>e.pin===`start`||e.pin===`end`?e.pin:null),...S?[null]:[]]):[],U=(e,t=``)=>{let n=ut[e];return n?{className:`${t.trim()} ${ge(n)}`.trim(),style:{[se]:he(n.side,n.ordinal)}}:{className:t,style:void 0}},dt=(e,t)=>ut[e]?{...t,...U(e).style}:t,ft=h.length-1+ +!!S;Xe&&!M&&_(`view-key`,"`viewKey` remembers resized widths: add `resizableColumns`."),P&&!z&&_(`virtual-height`,"`virtual` needs `maxHeight`: without a scroll box every row renders."),P&&(L||k)&&_(`virtual-shape`,"`virtual` takes rows of one height, so it is off with `renderExpanded` or `stackOnMobile`."),!P&&g?.length>500&&_(`rows-without-virtual`,`renders more than 500 rows without virtual: add virtual with maxHeight, or page the data.`);let W=P&&z&&!L&&!k&&!x&&g?.length>0,G=(e,t)=>!Re||!!Re(e,t),pt=w&&g?g.reduce((e,t,n)=>e+ +!!G(t,n),0):0,K=w&&g?g.reduce((e,t,n)=>e+(G(t,n)&&T?.has(y(t,n))?1:0),0):0,mt=pt>0&&K===pt,ht=K>0&&!mt,gt=e=>{e&&(e.indeterminate=ht)},_t=d(null),vt=(e,t)=>{let n=_t.current;_t.current=e;let r=t&&n!==null?g.findIndex((e,t)=>y(e,t)===n):-1,i=g.findIndex((t,n)=>y(t,n)===e);if(r<0||i<0||r===i){ze?.(e);return}let a=!T?.has(e),o=Math.min(r,i),s=g.slice(o,Math.max(r,i)+1).map((e,t)=>[e,o+t]).filter(([e,t])=>G(e,t)).map(([e,t])=>y(e,t)).filter(e=>(T?.has(e)||!1)!==a);if(Ve)Ve(s,a);else for(let e of s)ze?.(e)},yt=e=>{if(!Re){Be?.(e);return}(g||[]).forEach((t,n)=>{let r=y(t,n);G(t,n)&&(T?.has(r)||!1)!==e&&ze?.(r)})},[bt,xt]=f(()=>new Set),St=e=>xt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),q=ne(()=>{let e=(g||[]).map((e,t)=>({row:e,i:t}));return N?pe(e,({row:e})=>String(e[N]??``)).flatMap(e=>[{group:e,open:!bt.has(e.key)},...bt.has(e.key)?[]:e.items]):e},[g,N,bt]),J=d(null),Y=d(null);l(()=>{let e=J.current;if(!e)return;let t=e=>{let t=e.target.closest?.(`.u-name`);t&&!t.title&&(t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight)&&(t.title=t.textContent.trim())},n=e=>{let t=e.target.closest?.(`tbody > tr[aria-rowindex]`)?.getAttribute(`aria-rowindex`);Y.current=t?Number(t)-2:null},r=t=>{e.contains(t.relatedTarget)||(Y.current=null)};e.addEventListener(`mouseover`,t),e.addEventListener(`focusin`,t),e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,r);let i=c(e);return()=>{e.removeEventListener(`mouseover`,t),e.removeEventListener(`focusin`,t),e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,r),i()}},[V]),l(()=>{if(!D||!J.current)return;let e=s(J.current);return ee(document),e},[D,V]);let Ct=d(!1);l(()=>{!Ct.current&&(Ct.current=!0,K===0)||J.current?.querySelector(`table`)?.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:{selected:K,total:g?.length??0,keys:g?g.flatMap((e,t)=>{let n=y(e,t);return G(e,t)&&T?.has(n)?[String(n)]:[]}):[]}}))},[w,K]);let[wt,Tt]=f({top:0,height:0}),[X,Et]=f(le[E]??le.comfortable);l(()=>{let e=J.current;if(!W||!e)return;let t=0,n=()=>{t=0;let n=e.querySelector(`:scope > table > thead`)?.getBoundingClientRect().height||0,r={top:Math.max(0,e.scrollTop-n),height:e.clientHeight};Tt(e=>e.top===r.top&&e.height===r.height?e:r)},r=()=>{t||=requestAnimationFrame(n)};e.addEventListener(`scroll`,r,{passive:!0});let i=typeof ResizeObserver<`u`?new ResizeObserver(r):null;return i?.observe(e),n(),()=>{e.removeEventListener(`scroll`,r),i?.disconnect(),t&&cancelAnimationFrame(t)}},[W,V]),u(()=>{if(!W)return;let e=(J.current?.querySelector(`:scope > table > tbody > tr:not(.wui-virtual-spacer, .wui-group-row)`))?.getBoundingClientRect().height;e>0&&Math.abs(e-X)>.5&&Et(e)},[E,g?.length,P,W]);let Z={start:0,end:q.length,before:0,after:0};if(W){Z=Se({scrollTop:wt.top,viewport:wt.height||Number.parseFloat(O)||0,rowHeight:X,count:q.length});let e=Y.current;e!==null&&e>=0&&e<q.length&&(e<Z.start&&Z.start-e<=we&&(Z={...Z,start:e,before:e*X}),e>=Z.end&&e-Z.end<we&&(Z={...Z,end:e+1,after:(q.length-e-1)*X}))}let Dt=d(null),Ot=d(null),kt=d(null),At=!P&&!x&&g?.length>0&&g.length<=ue;u(()=>{let e=Dt.current;if(!At||!e){Ot.current=null,kt.current=null;return}let t=g.map((e,t)=>y(e,t));ye(kt.current,t)&&ve(e.rows,Ot.current),Ot.current=me(e.rows),kt.current=t});let jt=typeof F==`function`||typeof I==`function`,Mt=d(null),Nt=d(null);l(()=>{if(!jt){Nt.current=null;return}let e=h[0]?.key,t=new Map;(g||[]).forEach((n,r)=>{let i=e===void 0?void 0:n[e],a=typeof i==`string`||typeof i==`number`?String(i):``;t.set(y(n,r),{...Ee(n,F,I),label:a})});let n=be(xe(Nt.current,t));Nt.current=t,n&&Mt.current&&(Mt.current.textContent=n)},[g,F,I,y]);let Pt=Me!==void 0&&Ne>0?Me:je,Ft=({group:e,open:t},n)=>{let r=e.items[0].row[N],a=e.items.map(e=>e.row);return p(`tr`,{className:`wui-group-row`,"data-group-key":e.key,"aria-rowindex":W?n+2:void 0,children:p(`th`,{className:`wui-group-cell`,scope:`rowgroup`,colSpan:B,children:m(`button`,{type:`button`,className:`wui-group-toggle`,"aria-expanded":t,onClick:()=>St(e.key),children:[p(i,{name:`chevron-down`,size:16}),p(`span`,{className:`wui-group-label`,children:Ze?Ze(r,a):De(r)}),p(`span`,{className:`wui-group-count`,"aria-hidden":`true`,children:fe(e.items.length)}),p(`span`,{className:`visually-hidden wui-group-rows`,children:`, ${oe.rows(e.items.length)}`})]})})},`group:${e.key}`)},It=({row:e,i:t},n)=>{let r=y(e,t),a=L&&tt.has(r),o=Ye!=null&&String(Ye)===String(r),s=String(r).replace(/[^a-z0-9]/gi,`_`),c=U(0,`wui-expand-cell`),ee=U(+!!L,`wui-select-cell`),l=jt?Ee(e,F,I):null,u=G(e,t);return m(te,{children:[m(`tr`,{className:[w&&u&&T?.has(r)?`is-selected`:``,R?`wui-row-link`:``,o?`wui-row-active`:``].filter(Boolean).join(` `)||void 0,"aria-current":o?`true`:void 0,"aria-rowindex":W?n+2:void 0,"aria-busy":l?.state===`saving`?`true`:void 0,"data-wui-save-state":l?.state||void 0,"data-status":Je?.(e)||void 0,"data-href":A?.(e)||void 0,"data-row-key":D?String(r):void 0,tabIndex:R?0:void 0,onClick:R?t=>ot(e,t):void 0,onAuxClick:R&&A?t=>t.button===1&&ot(e,t):void 0,onKeyDown:R?t=>{t.key===`Enter`&&t.target===t.currentTarget&&ot(e,t)}:void 0,children:[L&&p(`td`,{className:c.className,style:c.style,children:p(`button`,{type:`button`,className:`wui-expand-toggle${a?` is-open`:``}`,"aria-expanded":a,"aria-controls":a?`${s}-expanded`:void 0,"aria-label":a?`Collapse row`:`Expand row`,onClick:()=>rt(r),children:p(i,{name:`chevron-down`,size:16})})}),w&&p(`td`,{className:ee.className,style:ee.style,children:p(`input`,{type:`checkbox`,className:`wui-check`,checked:u&&(T?.has(r)||!1),disabled:!u,onChange:e=>vt(r,e.nativeEvent.shiftKey),onMouseDown:e=>{e.shiftKey&&e.preventDefault()},"aria-label":`Select row`})}),h.map((t,n)=>m(`td`,{className:U(H+n,(n===0?`wui-name-cell `:``)+(t.nowrap?`text-nowrap `:``)+v(t.align)+(t.cellClassName?` ${t.cellClassName}`:``)).className,style:dt(H+n,t.cellStyle),"data-label":k&&typeof t.label==`string`?t.label:void 0,children:[t.render?t.render(e):De(e[t.key]),n===0&&l?.state===`error`&&p(`span`,{className:de,children:l.message})]},t.key)),S&&p(`td`,{children:p(`div`,{className:`u-row-actions`,children:S(e)})})]}),a&&p(`tr`,{className:`wui-row-expanded`,children:p(`td`,{id:`${s}-expanded`,colSpan:B,children:He(e)})})]},r)},Lt=(e,t)=>e.group?Ft(e,t):It(e,t),Rt=(e,t)=>W?p(`tr`,{className:`wui-virtual-spacer`,"aria-hidden":`true`,hidden:t===0,children:p(`td`,{colSpan:B,style:{height:t}})},e):null,Q=U(0,`wui-expand-cell`),$=U(+!!L,`wui-select-cell`);return m(re,{children:[m(V?`wui-data-table`:`div`,{ref:J,...V?{class:st,resizable:M?``:void 0,"view-key":Xe||void 0,"data-wui-row-drag":D?``:void 0}:{className:st,"data-wui-row-drag":D?``:void 0},style:ct,tabIndex:0,...e(`AppDataTable`,t),...Qe,children:[m(`table`,{className:et,"aria-label":Fe,"aria-rowcount":W?q.length+1:void 0,children:[p(`thead`,{children:m(`tr`,{"aria-rowindex":W?1:void 0,children:[L&&p(`th`,{className:Q.className,style:Q.style,children:p(`span`,{className:`visually-hidden`,children:`Expand`})}),w&&p(`th`,{className:$.className,style:$.style,children:p(`input`,{ref:gt,type:`checkbox`,className:`wui-check`,checked:mt,onChange:e=>yt(e.target.checked),"aria-label":`Select all rows`})}),h.map((e,t)=>{let n=!!(e.sortable&&b),r=ke&&ke.key===e.key,a=e.align===`num`||e.align===`end`,o=n&&p(`span`,{className:`sort-icon${a?` wui-sort-lead`:``}`,children:p(i,{name:`chevrons-up-down`,size:14})}),s=M&&t!==ft,c=e.width||e.minWidth?{width:e.width,minWidth:e.minWidth}:void 0;return m(`th`,{className:U(H+t,(n?`sortable `:``)+(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+(e.grow?`wui-col-grow `:``)+(s?`wui-col-resizable `:``)+v(e.align)).className,style:dt(H+t,c),"data-key":V?e.key:void 0,"aria-label":s&&typeof e.label==`string`?e.label:void 0,"data-pin":e.pin===`start`||e.pin===`end`?e.pin:void 0,tabIndex:n?0:void 0,"aria-sort":r?ke.dir===`asc`?`ascending`:`descending`:n?`none`:void 0,onClick:n?()=>b(e.key):void 0,onKeyDown:n?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),b(e.key))}:void 0,children:[a&&o,e.label,!a&&o,s&&p(`span`,{className:`wui-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":ae,"aria-valuemax":ie,tabIndex:0,"aria-label":oe.resize(typeof e.label==`string`?e.label:e.key)})]},e.key)}),S&&(Pe?p(`th`,{className:`wui-cell-end`,children:Pe}):p(`th`,{className:`wui-cell-end`,children:p(`span`,{className:`visually-hidden`,children:`Actions`})}))]})}),p(`tbody`,{ref:Dt,children:x?p(a,{rows:Ae,cols:B}):g?.length?m(re,{children:[Rt(`before`,Z.before),q.slice(Z.start,Z.end).map((e,t)=>Lt(e,Z.start+t)),Rt(`after`,Z.after)]}):null}),it&&!x&&g?.length>0&&p(`tfoot`,{children:m(`tr`,{children:[L&&p(`td`,{className:Q.className,style:Q.style}),w&&p(`td`,{className:$.className,style:$.style}),h.map((e,t)=>p(`td`,{className:U(H+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+v(e.align)).className,style:dt(H+t,void 0),children:e.footer?e.footer(g):null},e.key)),S&&p(`td`,{})]})})]}),!x&&!g?.length&&p(`div`,{className:`tbl-empty-block`,children:typeof Pt==`string`?p(`div`,{className:`tbl-empty-plain`,children:Pt}):Pt})]}),Oe(C)&&p(o,{page:C.page,totalPages:C.totalPages,pageSize:C.pageSize,onPageChange:C.setPage,onPageSizeChange:C.setPageSize,pageSizes:C.pageSizes,mode:C.mode}),jt&&p(`div`,{ref:Mt,className:`visually-hidden`,role:`status`,"aria-live":`polite`,"data-wui-table-status":``})]})}export{y as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import i from"./AppIcon.js";import{AppSkeletonRows as a}from"./AppSkeleton.js";import o from"./AppTablePagination.js";import{attachRowDrag as s,attachScrollEdges as c,syncTargets as ee}from"@webority/ui-elements/helpers";import{Children as l,Fragment as te,useEffect as u,useLayoutEffect as d,useMemo as ne,useRef as f,useState as p}from"react";import{Fragment as re,jsx as m,jsxs as h}from"react/jsx-runtime";import{COLUMN_MAX_WIDTH as ie,COLUMN_MIN_WIDTH as ae,DATA_TABLE_TEXT as oe,PIN_AT_VAR as se,PIN_SIDES as ce,ROW_HEIGHTS as le,ROW_MOVE_LIMIT as ue,ROW_SAVE_ERROR_CLASS as de,groupCount as fe,groupItems as pe,measureRows as me,pinAtValue as he,pinClasses as ge,planPins as _e,playRowMoves as ve,rowOrderChanged as ye,saveOutcomeText as be,settledRows as xe,virtualRange as Se}from"@webority/ui-elements/elements/data-table";var Ce=[`comfortable`,`cozy`,`compact`],we=[`auto`,`fixed`],g=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},_=new Set;function v(e,n){_.has(e)||!g()||(_.add(e),t(`[@webority/ui-react] <AppDataTable> ${n}`))}var Te=100,Ee=e=>e.id,De=(e,t,n)=>{let r=!!t?.(e),i=r?``:n?.(e)||``;return{state:r?`saving`:i?`error`:null,message:i}};function Oe(e){return e===`end`?`wui-cell-end`:e===`num`?`num`:e===`center`?`text-center`:``}function ke(e){return e==null||e===``?`-`:Array.isArray(e)?l.toArray(e):typeof e==`boolean`?String(e):e}function Ae(e){if(!e||!(e.total>0))return!1;let t=e.pageSizes?.length?e.pageSizes:[e.pageSize];return e.total>Math.min(...t)}function y(t){let{columns:l,rows:g,rowKey:_=Ee,sort:y,onSort:je,loading:b=!1,skeletonRows:Me=5,empty:Ne=`No records found.`,emptyFiltered:Pe,sourceCount:Fe,rowActions:x,rowActionsLabel:Ie,pagination:S,ariaLabel:Le,className:Re=``,wrapperClassName:ze=``,selectable:C=!1,selectedIds:w,isRowSelectable:T,onToggleRow:E,onToggleAll:Be,onSelectRange:Ve,renderExpanded:He,density:D=`comfortable`,tableLayout:Ue=`auto`,striped:We=!1,flush:Ge=!1,rowDrag:O=!1,maxHeight:k,stickyFirstColumn:Ke=!1,stickyActions:qe=!1,stackOnMobile:A=!1,hiddenColumns:Je,rowStatus:Ye,rowHref:j,onRowClick:Xe,activeRowKey:Ze,resizableColumns:M=!1,viewKey:Qe,groupBy:N,groupLabel:$e,virtual:P=!1,rowSaving:F,rowSaveError:I,...et}=t;r(`AppDataTable`,et);let tt=Je?.length?new Set(Je):null;l=tt?l.filter(e=>!(e.hideable&&tt.has(e.key))):l,n(`AppDataTable`,`density`,D,Ce),n(`AppDataTable`,`tableLayout`,Ue,we);for(let e of l)n(`AppDataTable`,`column.pin`,e.pin,ce);let nt=[`table table-ledger`,D===`cozy`||D===`compact`?`wui-table-${D}`:``,We?`wui-table-striped`:``,Ke?`wui-table-sticky-first`:``,qe?`wui-table-sticky-actions`:``,A?`wui-table-stack`:``,Re].filter(Boolean).join(` `),L=typeof He==`function`,[rt,it]=p(()=>new Set),at=e=>it(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),ot=l.some(e=>typeof e.footer==`function`),R=typeof j==`function`||typeof Xe==`function`,st=e=>!!e.target.closest(`a, button, input, select, textarea, label, [role='menu'], [role='menuitem'], .dropdown`),ct=(e,t)=>{if(st(t)||(Xe&&Xe(e),!j))return;let n=j(e);n&&(t.ctrlKey||t.metaKey||t.button===1?window.open(n,`_blank`,`noopener`):window.location.assign(n))},z=k!==void 0,lt=[`table-wrap`,z?`wui-table-scroll`:``,Ge?`wui-table-flush`:``,ze].filter(Boolean).join(` `),ut=z?{maxHeight:k}:void 0,B=Math.max(1,l.length+ +!!x+ +!!C+ +!!L),dt=l.some(e=>e.pin===`start`||e.pin===`end`),V=dt||M||!!N||P,H=+!!L+ +!!C,ft=dt?_e([...L?[`lead`]:[],...C?[`lead`]:[],...l.map(e=>e.pin===`start`||e.pin===`end`?e.pin:null),...x?[null]:[]]):[],U=(e,t=``)=>{let n=ft[e];return n?{className:`${t.trim()} ${ge(n)}`.trim(),style:{[se]:he(n.side,n.ordinal)}}:{className:t,style:void 0}},pt=(e,t)=>ft[e]?{...t,...U(e).style}:t,mt=l.length-1+ +!!x;Qe&&!M&&v(`view-key`,"`viewKey` remembers resized widths: add `resizableColumns`."),P&&!z&&v(`virtual-height`,"`virtual` needs `maxHeight`: without a scroll box every row renders."),P&&(L||A)&&v(`virtual-shape`,"`virtual` takes rows of one height, so it is off with `renderExpanded` or `stackOnMobile`."),!P&&g?.length>500&&v(`rows-without-virtual`,`renders more than 500 rows without virtual: add virtual with maxHeight, or page the data.`);let W=P&&z&&!L&&!A&&!b&&g?.length>0,G=(e,t)=>!T||!!T(e,t),ht=C&&g?g.reduce((e,t,n)=>e+ +!!G(t,n),0):0,K=C&&g?g.reduce((e,t,n)=>e+(G(t,n)&&w?.has(_(t,n))?1:0),0):0,gt=ht>0&&K===ht,_t=K>0&&!gt,vt=e=>{e&&(e.indeterminate=_t)},yt=f(null),bt=(e,t)=>{let n=yt.current;yt.current=e;let r=t&&n!==null?g.findIndex((e,t)=>_(e,t)===n):-1,i=g.findIndex((t,n)=>_(t,n)===e);if(r<0||i<0||r===i){E?.(e);return}let a=!w?.has(e),o=Math.min(r,i),s=g.slice(o,Math.max(r,i)+1).map((e,t)=>[e,o+t]).filter(([e,t])=>G(e,t)).map(([e,t])=>_(e,t)).filter(e=>(w?.has(e)||!1)!==a);if(Ve)Ve(s,a);else for(let e of s)E?.(e)},xt=e=>{if(!T){Be?.(e);return}(g||[]).forEach((t,n)=>{let r=_(t,n);G(t,n)&&(w?.has(r)||!1)!==e&&E?.(r)})},[St,Ct]=p(()=>new Set),wt=e=>Ct(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),q=ne(()=>{let e=(g||[]).map((e,t)=>({row:e,i:t}));return N?pe(e,({row:e})=>String(e[N]??``)).flatMap(e=>[{group:e,open:!St.has(e.key)},...St.has(e.key)?[]:e.items]):e},[g,N,St]),J=f(null),Tt=f(null);u(()=>{let e=J.current;if(!e)return;let t=e=>{let t=e.target.closest?.(`.u-name`);t&&!t.title&&(t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight)&&(t.title=t.textContent.trim())},n=e=>{let t=e.target.closest?.(`tbody > tr[aria-rowindex]`)?.getAttribute(`aria-rowindex`);Tt.current=t?Number(t)-2:null},r=t=>{e.contains(t.relatedTarget)||(Tt.current=null)};e.addEventListener(`mouseover`,t),e.addEventListener(`focusin`,t),e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,r);let i=c(e);return()=>{e.removeEventListener(`mouseover`,t),e.removeEventListener(`focusin`,t),e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,r),i()}},[V]),u(()=>{if(!O||!J.current)return;let e=s(J.current);return ee(document),e},[O,V]);let Et=f(!1);u(()=>{!Et.current&&(Et.current=!0,K===0)||J.current?.querySelector(`table`)?.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:{selected:K,total:g?.length??0,keys:g?g.flatMap((e,t)=>{let n=_(e,t);return G(e,t)&&w?.has(n)?[String(n)]:[]}):[]}}))},[C,K]);let[Dt,Ot]=p({top:0,height:0}),[Y,kt]=p(le[D]??le.comfortable);u(()=>{let e=J.current;if(!W||!e)return;let t=0,n=()=>{t=0;let n=e.querySelector(`:scope > table > thead`)?.getBoundingClientRect().height||0,r={top:Math.max(0,e.scrollTop-n),height:e.clientHeight};Ot(e=>e.top===r.top&&e.height===r.height?e:r)},r=()=>{t||=requestAnimationFrame(n)};e.addEventListener(`scroll`,r,{passive:!0});let i=typeof ResizeObserver<`u`?new ResizeObserver(r):null;return i?.observe(e),n(),()=>{e.removeEventListener(`scroll`,r),i?.disconnect(),t&&cancelAnimationFrame(t)}},[W,V]),d(()=>{if(!W)return;let e=(J.current?.querySelector(`:scope > table > tbody > tr:not(.wui-virtual-spacer, .wui-group-row)`))?.getBoundingClientRect().height;e>0&&Math.abs(e-Y)>.5&&kt(e)},[D,g?.length,P,W]);let X={start:0,end:q.length,before:0,after:0};if(W){X=Se({scrollTop:Dt.top,viewport:Dt.height||Number.parseFloat(k)||0,rowHeight:Y,count:q.length});let e=Tt.current;e!==null&&e>=0&&e<q.length&&(e<X.start&&X.start-e<=Te&&(X={...X,start:e,before:e*Y}),e>=X.end&&e-X.end<Te&&(X={...X,end:e+1,after:(q.length-e-1)*Y}))}let At=f(null),Z=f(null),jt=f(null),Mt=!P&&!b&&g?.length>0&&g.length<=ue;d(()=>{let e=At.current;if(!Mt||!e){Z.current=null,jt.current=null;return}let t=g.map((e,t)=>_(e,t));ye(jt.current,t)&&ve(e.rows,Z.current),Z.current=me(e.rows),jt.current=t});let Nt=typeof F==`function`||typeof I==`function`,Pt=f(null),Ft=f(null);u(()=>{if(!Nt){Ft.current=null;return}let e=l[0]?.key,t=new Map;(g||[]).forEach((n,r)=>{let i=e===void 0?void 0:n[e],a=typeof i==`string`||typeof i==`number`?String(i):``;t.set(_(n,r),{...De(n,F,I),label:a})});let n=be(xe(Ft.current,t));Ft.current=t,n&&Pt.current&&(Pt.current.textContent=n)},[g,F,I,_]);let It=Pe!==void 0&&(Fe===void 0||Fe>0)?Pe:Ne,Lt=({group:e,open:t},n)=>{let r=e.items[0].row[N],a=e.items.map(e=>e.row);return m(`tr`,{className:`wui-group-row`,"data-group-key":e.key,"aria-rowindex":W?n+2:void 0,children:m(`th`,{className:`wui-group-cell`,scope:`rowgroup`,colSpan:B,children:h(`button`,{type:`button`,className:`wui-group-toggle`,"aria-expanded":t,onClick:()=>wt(e.key),children:[m(i,{name:`chevron-down`,size:16}),m(`span`,{className:`wui-group-label`,children:$e?$e(r,a):ke(r)}),m(`span`,{className:`wui-group-count`,"aria-hidden":`true`,children:fe(e.items.length)}),m(`span`,{className:`visually-hidden wui-group-rows`,children:`, ${oe.rows(e.items.length)}`})]})})},`group:${e.key}`)},Rt=({row:e,i:t},n)=>{let r=_(e,t),a=L&&rt.has(r),o=Ze!=null&&String(Ze)===String(r),s=String(r).replace(/[^a-z0-9]/gi,`_`),c=U(0,`wui-expand-cell`),ee=U(+!!L,`wui-select-cell`),u=Nt?De(e,F,I):null,d=G(e,t);return h(te,{children:[h(`tr`,{className:[C&&d&&w?.has(r)?`is-selected`:``,R?`wui-row-link`:``,o?`wui-row-active`:``].filter(Boolean).join(` `)||void 0,"aria-current":o?`true`:void 0,"aria-rowindex":W?n+2:void 0,"aria-busy":u?.state===`saving`?`true`:void 0,"data-wui-save-state":u?.state||void 0,"data-status":Ye?.(e)||void 0,"data-href":j?.(e)||void 0,"data-row-key":O?String(r):void 0,tabIndex:R?0:void 0,onClick:R?t=>ct(e,t):void 0,onAuxClick:R&&j?t=>t.button===1&&ct(e,t):void 0,onKeyDown:R?t=>{t.key===`Enter`&&t.target===t.currentTarget&&ct(e,t)}:void 0,children:[L&&m(`td`,{className:c.className,style:c.style,children:m(`button`,{type:`button`,className:`wui-expand-toggle${a?` is-open`:``}`,"aria-expanded":a,"aria-controls":a?`${s}-expanded`:void 0,"aria-label":a?`Collapse row`:`Expand row`,onClick:()=>at(r),children:m(i,{name:`chevron-down`,size:16})})}),C&&m(`td`,{className:ee.className,style:ee.style,children:m(`input`,{type:`checkbox`,className:`wui-check`,checked:d&&(w?.has(r)||!1),disabled:!d,onChange:e=>bt(r,e.nativeEvent.shiftKey),onMouseDown:e=>{e.shiftKey&&e.preventDefault()},"aria-label":`Select row`})}),l.map((t,n)=>h(`td`,{className:U(H+n,(n===0?`wui-name-cell `:``)+(t.nowrap?`text-nowrap `:``)+Oe(t.align)+(t.cellClassName?` ${t.cellClassName}`:``)).className,style:pt(H+n,t.cellStyle),"data-label":A&&typeof t.label==`string`?t.label:void 0,children:[t.render?t.render(e):ke(e[t.key]),n===0&&u?.state===`error`&&m(`span`,{className:de,children:u.message})]},t.key)),x&&m(`td`,{children:m(`div`,{className:`u-row-actions`,children:x(e)})})]}),a&&m(`tr`,{className:`wui-row-expanded`,children:m(`td`,{id:`${s}-expanded`,colSpan:B,children:He(e)})})]},r)},zt=(e,t)=>e.group?Lt(e,t):Rt(e,t),Bt=(e,t)=>W?m(`tr`,{className:`wui-virtual-spacer`,"aria-hidden":`true`,hidden:t===0,children:m(`td`,{colSpan:B,style:{height:t}})},e):null,Q=U(0,`wui-expand-cell`),$=U(+!!L,`wui-select-cell`);return h(re,{children:[h(V?`wui-data-table`:`div`,{ref:J,...V?{class:lt,resizable:M?``:void 0,"view-key":Qe||void 0,"data-wui-row-drag":O?``:void 0}:{className:lt,"data-wui-row-drag":O?``:void 0},style:ut,tabIndex:0,...e(`AppDataTable`,t),...et,children:[h(`table`,{className:nt,"aria-label":Le,"aria-rowcount":W?q.length+1:void 0,style:Ue===`fixed`?{tableLayout:`fixed`}:void 0,children:[m(`thead`,{children:h(`tr`,{"aria-rowindex":W?1:void 0,children:[L&&m(`th`,{className:Q.className,style:Q.style,children:m(`span`,{className:`visually-hidden`,children:`Expand`})}),C&&m(`th`,{className:$.className,style:$.style,children:m(`input`,{ref:vt,type:`checkbox`,className:`wui-check`,checked:gt,onChange:e=>xt(e.target.checked),"aria-label":`Select all rows`})}),l.map((e,t)=>{let n=!!(e.sortable&&je),r=y&&y.key===e.key,a=e.align===`num`||e.align===`end`,o=n&&m(`span`,{className:`sort-icon${a?` wui-sort-lead`:``}`,children:m(i,{name:`chevrons-up-down`,size:14})}),s=M&&t!==mt,c=e.width||e.minWidth?{width:e.width,minWidth:e.minWidth}:void 0;return h(`th`,{className:U(H+t,(n?`sortable `:``)+(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+(e.grow?`wui-col-grow `:``)+(s?`wui-col-resizable `:``)+Oe(e.align)).className,style:pt(H+t,c),"data-key":V?e.key:void 0,"aria-label":s&&typeof e.label==`string`?e.label:void 0,"data-pin":e.pin===`start`||e.pin===`end`?e.pin:void 0,tabIndex:n?0:void 0,"aria-sort":r?y.dir===`asc`?`ascending`:`descending`:n?`none`:void 0,onClick:n?()=>je(e.key):void 0,onKeyDown:n?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),je(e.key))}:void 0,children:[a&&o,e.label,!a&&o,s&&m(`span`,{className:`wui-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":ae,"aria-valuemax":ie,tabIndex:0,"aria-label":oe.resize(typeof e.label==`string`?e.label:e.key)})]},e.key)}),x&&(Ie?m(`th`,{className:`wui-cell-end`,children:Ie}):m(`th`,{className:`wui-cell-end`,children:m(`span`,{className:`visually-hidden`,children:`Actions`})}))]})}),m(`tbody`,{ref:At,children:b?m(a,{rows:Me,cols:B}):g?.length?h(re,{children:[Bt(`before`,X.before),q.slice(X.start,X.end).map((e,t)=>zt(e,X.start+t)),Bt(`after`,X.after)]}):null}),ot&&!b&&g?.length>0&&m(`tfoot`,{children:h(`tr`,{children:[L&&m(`td`,{className:Q.className,style:Q.style}),C&&m(`td`,{className:$.className,style:$.style}),l.map((e,t)=>m(`td`,{className:U(H+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+Oe(e.align)).className,style:pt(H+t,void 0),children:e.footer?e.footer(g):null},e.key)),x&&m(`td`,{})]})})]}),!b&&!g?.length&&m(`div`,{className:`tbl-empty-block`,children:typeof It==`string`?m(`div`,{className:`tbl-empty-plain`,children:It}):It})]}),Ae(S)&&m(o,{page:S.page,totalPages:S.totalPages,pageSize:S.pageSize,onPageChange:S.setPage,onPageSizeChange:S.setPageSize,pageSizes:S.pageSizes,mode:S.mode}),Nt&&m(`div`,{ref:Pt,className:`visually-hidden`,role:`status`,"aria-live":`polite`,"data-wui-table-status":``})]})}export{y as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"../lib/FieldMessage.js";import i from"./AppRequiredMark.js";import a from"./useWuiControl.js";import{cloneElement as o,forwardRef as s,useId as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import"@webority/ui-elements/elements/datepicker";var d=[`sm`,`md`,`lg`],f=s(function(s,f){let{value:p,onChange:m,label:h,required:g=!1,hint:_,error:v,name:y,min:b,max:x,placeholder:S=`Choose a date`,disabled:C,size:w,firstDay:T,displayFormat:E,id:D,ariaLabel:O,className:k=``,fieldClassName:A=``,...j}=s;n(`AppDatePicker`,j),t(`AppDatePicker`,`size`,w,d);let M=c(),N=D||M,{setRef:P}=a({ref:f,value:p??``,onChange:m}),F=!h&&!v&&!_,I=v?`${N}-error`:void 0,L=_?`${N}-hint`:void 0,R=l(`wui-datepicker`,{ref:P,id:N,name:y,min:b,max:x,placeholder:S,size:w||void 0,"first-day":T==null?void 0:String(T),"display-format":E||void 0,"aria-label":O||(typeof h==`string`?h:void 0),"aria-describedby":I||L,"aria-invalid":v?`true`:void 0,disabled:C?``:void 0,required:g?``:void 0,className:k||void 0,...j});return F?o(R,e(`AppDatePicker`,s)):u(`div`,{...e(`AppDatePicker`,s),className:`field${A?` ${A}`:``}`,children:[h&&u(`label`,{className:`label`,htmlFor:N,children:[h,g&&l(i,{})]}),R,l(r,{error:v,hint:_,errorId:I,hintId:L})]})});export{f as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import i from"../lib/FieldMessage.js";import a from"./AppRequiredMark.js";import o from"./useWuiControl.js";import{cloneElement as s,forwardRef as c,useId as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/datepicker";var f=[`sm`,`md`,`lg`],p=c(function(c,p){let{value:m,onChange:h,label:g,required:_=!1,hint:v,error:y,name:b,min:x,max:S,placeholder:C=`Choose a date`,disabled:w,size:T,firstDay:E,displayFormat:D,id:O,ariaLabel:k,className:A=``,fieldClassName:j=``,...M}=c;r(`AppDatePicker`,M),n(`AppDatePicker`,`size`,T,f),typeof D==`string`&&D!==``&&/DD|YYYY|YY/.test(D)&&t(`[@webority/ui-react] <AppDatePicker> displayFormat "${D}" uses uppercase day or year tokens, which print as written; the tokens are yyyy, MMMM, MMM, MM, dd and d.`);let N=l(),P=O||N,{setRef:F}=o({ref:p,value:m??``,onChange:h}),I=!g&&!y&&!v,L=y?`${P}-error`:void 0,R=v?`${P}-hint`:void 0,z=u(`wui-datepicker`,{ref:F,value:m||void 0,id:P,name:b,min:x,max:S,placeholder:C,size:T||void 0,"first-day":E==null?void 0:String(E),"display-format":D||void 0,"aria-label":k||(typeof g==`string`?g:void 0),"aria-describedby":L||R,"aria-invalid":y?`true`:void 0,disabled:w?``:void 0,required:_?``:void 0,className:A||void 0,...M});return I?s(z,e(`AppDatePicker`,c)):d(`div`,{...e(`AppDatePicker`,c),className:`field${j?` ${j}`:``}`,children:[g&&d(`label`,{className:`label`,htmlFor:P,children:[g,_&&u(a,{})]}),z,u(i,{error:y,hint:v,errorId:L,hintId:R})]})});export{p as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnUnknownProps.js";import{forwardRef as r,useCallback as i,useEffect as a,useLayoutEffect as o,useRef as s,useState as c}from"react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{createPortal as f}from"react-dom";var p=`wui-file-viewer:load`,m=`wui-file-viewer:error`,h=`wui-file-viewer:prefs-change`,g=r(function(r,g){let{src:_,name:v,type:y,prefs:b,onPrefsChange:x,viewKey:S,download:C=!1,print:w=!0,workerSrc:T,assetBase:E,captions:D,actions:O,onLoad:k,onError:A,className:j=``,style:M,...N}=r;n(`AppFileViewer`,N);let P=s(null),F=s(k),I=s(A),L=s(x),[R,z]=c(null),B=i(e=>{P.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]);return o(()=>{b!==void 0&&(P.current.prefs=b)},[b]),a(()=>{F.current=k,I.current=A,L.current=x}),a(()=>{let e=P.current,t=e=>F.current?.(e.detail),n=e=>I.current?.(e.detail),r=e=>L.current?.(e.detail);return e.addEventListener(p,t),e.addEventListener(m,n),e.addEventListener(h,r),()=>{e.removeEventListener(p,t),e.removeEventListener(m,n),e.removeEventListener(h,r)}},[]),a(()=>{let e=!0;return import(`@webority/ui-elements/file-viewer`).then(()=>{let t=P.current;e&&t?.isConnected&&z(t.actionsContainer)}).catch(n=>{t(`[AppFileViewer] the viewer failed to load:`,n?.message),e&&I.current?.({message:n?.message??String(n)})}),()=>{e=!1}},[]),d(l,{children:[u(`wui-file-viewer`,{ref:B,src:_,name:v||void 0,type:y||void 0,"view-key":S||void 0,download:C?``:void 0,print:w?void 0:`false`,"worker-src":T||void 0,"asset-base":E||void 0,captions:D||void 0,className:j||void 0,style:M,...e(`AppFileViewer`,r),...N}),R&&O!=null&&f(u(`div`,{slot:`actions`,className:`wui-file-viewer-slot`,children:O}),R)]})});export{g as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{forwardRef as n,useCallback as r,useEffect as i,useLayoutEffect as a,useRef as o,useState as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import{createPortal as d}from"react-dom";import"@webority/ui-elements/file-viewer";var f=`wui-file-viewer:load`,p=`wui-file-viewer:error`,m=`wui-file-viewer:prefs-change`,h=n(function(n,h){let{src:g,name:_,type:v,prefs:y,onPrefsChange:b,viewKey:x,download:S=!1,print:C=!0,workerSrc:w,assetBase:T,captions:E,actions:D,onLoad:O,onError:k,className:A=``,style:j,...M}=n;t(`AppFileViewer`,M);let N=o(null),P=o(O),F=o(k),I=o(b),[L,R]=s(null),z=r(e=>{N.current=e,typeof h==`function`?h(e):h&&(h.current=e)},[h]);a(()=>{y!==void 0&&(N.current.prefs=y)},[y]),i(()=>{P.current=O,F.current=k,I.current=b}),i(()=>{let e=N.current,t=e=>P.current?.(e.detail),n=e=>F.current?.(e.detail),r=e=>I.current?.(e.detail);return e.addEventListener(f,t),e.addEventListener(p,n),e.addEventListener(m,r),()=>{e.removeEventListener(f,t),e.removeEventListener(p,n),e.removeEventListener(m,r)}},[]),i(()=>{let e=N.current;e?.isConnected&&R(e.actionsContainer)},[]);let B=j&&j.height!==void 0&&j.minHeight===void 0?{...j,minHeight:0}:j;return u(c,{children:[l(`wui-file-viewer`,{ref:z,src:g,name:_||void 0,type:v||void 0,"view-key":x||void 0,download:S?``:void 0,print:C?void 0:`false`,"worker-src":w||void 0,"asset-base":T||void 0,captions:E||void 0,className:A||void 0,style:B,...e(`AppFileViewer`,n),...M}),L&&D!=null&&d(l(`div`,{slot:`actions`,className:`wui-file-viewer-slot`,children:D}),L)]})});export{h as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i=[1,2,3];function a(a){let{children:o,columns:s=2,className:c=``,...l}=a;n(`AppFormRow`,l),t(`AppFormRow`,`columns`,s,i);let{style:u,...d}=l;return r(`div`,{className:[`form-row-grid`,`wui-form-cols-${Math.min(12,Math.max(1,s))}`,c].filter(Boolean).join(` `),style:u,...e(`AppFormRow`,a),...d,children:o})}export{a as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i=[1,2,3,4,5,6,7,8,9,10,11,12];function a(a){let{children:o,columns:s=2,collapse:c=!0,className:l=``,...u}=a;n(`AppFormRow`,u),t(`AppFormRow`,`columns`,s,i);let{style:d,...f}=u;return r(`div`,{className:[`form-row-grid`,`wui-form-cols-${Math.min(12,Math.max(1,Number(s)||2))}`,c===!1&&`wui-form-row-keep`,l].filter(Boolean).join(` `),style:d,...e(`AppFormRow`,a),...f,children:o})}export{a as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import ee from"../lib/FieldMessage.js";import te from"./AppPopover.js";import ne from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import{MASK_INPUT_TYPES as re,MASK_NAMES as ie,attachInputMask as ae,evaluatePassword as oe,formatMasked as a,isMaskPattern as se,postedMasked as ce}from"@webority/ui-elements/helpers";import{forwardRef as o,useEffect as s,useId as le,useRef as c,useState as l}from"react";import{Form as u}from"react-bootstrap";import{jsx as d,jsxs as f}from"react/jsx-runtime";var ue=[`sm`,`md`,`lg`],de=[`bare`],fe=[!0,!1,`above`],p=o(function(o,p){let{label:m,required:h=!1,error:pe,hint:g,help:_,helpLabel:me=`More information`,type:v=`text`,size:y=`md`,leftIcon:b,rightIcon:x,onRightIconClick:he,rightIconLabel:ge,unit:S,id:_e,name:ve,className:ye=``,fieldClassName:C=``,disabled:w=!1,clearable:T=!1,showCount:E=!1,maxLength:D,prefix:O,suffix:k,action:A,floatingLabel:j=!1,variant:M,passwordRequirements:N=!1,requirementsPlacement:P=`auto`,mask:F,postFormatted:I=!1,onMaskChange:L,...R}=o;n(`AppInput`,R),t(`AppInput`,`size`,y,ue),t(`AppInput`,`variant`,M,de),t(`AppInput`,`floatingLabel`,j,fe),F!=null&&!se(F)&&t(`AppInput`,`mask`,F,ie),F!=null&&t(`AppInput`,`type`,v,re);let[z,be]=l(!1),[xe,Se]=l(``),B=pe||xe,Ce=le(),V=_e||Ce,H=v===`password`,we=H&&z?`text`:v,U=c(null),Te=e=>{U.current=e,typeof p==`function`?p(e):p&&(p.current=e)},W=String(R.value??R.defaultValue??``),[Ee,G]=l(()=>!!W),[De,Oe]=l(()=>W.length),ke=T&&!w,K=T||E,q=H&&!!N,[Ae,je]=l(W);s(()=>{!q||R.value===void 0||je(String(R.value??``))},[R.value,q]),s(()=>{if(!K||R.value===void 0)return;let e=String(R.value??``);G(!!e),Oe(e.length)},[R.value,K]);let Me=e=>{G(!!e.target.value),Oe(e.target.value.length),R.onInput?.(e)},Ne=e=>{q&&je(e.target.value),K?Me(e):R.onInput?.(e)},Pe=F?{...R.value!==void 0&&{value:a(F,R.value)},...R.defaultValue!==void 0&&{defaultValue:a(F,R.defaultValue)}}:null,Fe=c(L);Fe.current=L,s(()=>{let e=U.current;if(!(!F||!e))return ae(e,{mask:F,postFormatted:I,onChange:(e,t)=>Fe.current?.(e,t),onInvalidChange:Se})},[F,I]);let J=e=>F&&!I&&e?t=>{let n=t.target,r=new Proxy(n,{get:(e,t)=>{if(t===`value`)return ce(F,e.value);let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}});e(Object.create(t,{target:{value:r}}))}:e,Ie=ke?d(`button`,{type:`button`,className:`input-clear`,onClick:()=>{let e=U.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set;t?t.call(e,``):e.value=``,e.dispatchEvent(new Event(`input`,{bubbles:!0})),G(!1),e.focus()},"aria-label":`Clear`,tabIndex:-1,hidden:!Ee,children:d(r,{name:`x`,size:16})}):null,Le=B&&V?`${V}-error`:void 0,Re=g&&V?`${V}-hint`:void 0,Y=q&&P===`inline`,ze=Y&&V?`${V}-requirements`:void 0,Be=Le||(Y?ze:Re),Ve=[`input`,y===`sm`?`input-sm`:``,y===`lg`?`input-lg`:``,B?`error`:``,H?`pw`:``,S?`num-input`:``,!(j&&m||O||k||S||H||x)&&T&&ke?`has-clear`:``,M===`bare`?`input-bare`:``,ye].filter(Boolean).join(` `),X=d(u.Control,{id:V,name:ve,type:we,className:Ve,disabled:w,required:h,"aria-invalid":B?`true`:`false`,"aria-describedby":Be,maxLength:D,...R,onChange:J(R.onChange),onBlur:J(R.onBlur),...Pe,placeholder:j?` `:R.placeholder,ref:Te,onInput:K||q?Ne:R.onInput}),Z=N===!0||N,He=Z&&typeof Z==`object`&&Z.title||`Password requirements`,Ue=q?oe(Ae,Z):null,Q=q?d(`ul`,{className:`pw-criteria`,"aria-live":`polite`,id:ze,"aria-label":Y?He:void 0,children:Ue.map(e=>f(`li`,{className:`pw-rule ${e.met?`met`:`unmet`}`,children:[d(`span`,{className:`pw-mark`,"aria-hidden":`true`}),d(`span`,{className:`pw-rule-text`,children:e.label}),d(`span`,{className:`visually-hidden`,children:e.met?`: met`:`: not met`})]},e.key))}):null,$;if(j&&m)$=f(`div`,{className:j===`above`?`field-float wui-float-above`:`field-float`,children:[X,f(`label`,{className:`float-label`,htmlFor:V,children:[m,h&&d(i,{})]})]});else if(A)$=f(`div`,{className:`input-action-row`,children:[f(`div`,{className:b?`input-icon`:`input-wrap`,children:[b&&d(`span`,{className:`ic`,children:d(r,{name:b,size:16})}),X]}),d(`div`,{className:`input-action`,children:A})]});else if(O||k)$=f(`div`,{className:`input-affixed`,children:[O!=null&&d(`span`,{className:`affix affix-pre`,children:O}),X,k!=null&&d(`span`,{className:`affix affix-suf`,children:k})]});else if(S)$=f(`div`,{className:`input-with-unit`,children:[X,d(`span`,{className:`unit`,children:S})]});else if(H){let e=f(`div`,{className:b?`input-icon`:`input-wrap`,children:[b&&d(`span`,{className:`ic`,children:d(r,{name:b,size:16})}),X,f(`button`,{type:`button`,className:`pw-toggle${z?` pw-revealed`:``}`,onClick:()=>be(e=>!e),"aria-label":z?`Hide password`:`Show password`,tabIndex:-1,children:[d(r,{name:`eye`,size:18,className:`pw-eye`}),d(r,{name:`eye-off`,size:18,className:`pw-eye-off`})]})]});$=q&&!Y?d(te,{trigger:e,triggerType:`focus`,placement:P,title:He,className:`pw-popover`,children:Q}):e}else $=x?f(`div`,{className:`input-wrap`,children:[X,d(`button`,{type:`button`,className:`pw-toggle`,onClick:he,disabled:!he,tabIndex:-1,"aria-label":ge||x,children:d(r,{name:x,size:18})})]}):T?f(`div`,{className:b?`input-icon`:`input-wrap`,children:[b&&d(`span`,{className:`ic`,children:d(r,{name:b,size:16})}),X,Ie]}):b?f(`div`,{className:`input-icon`,children:[d(`span`,{className:`ic`,children:d(r,{name:b,size:16})}),X]}):X;return f(u.Group,{...e(`AppInput`,o),className:`field${C?` ${C}`:``}`,children:[m&&!j&&f(u.Label,{className:`label`,htmlFor:V,children:[m,h&&d(i,{}),_&&d(ne,{label:me,children:_})]}),$,Y&&d(`div`,{className:`wui-pw-inline`,children:Q}),d(ee,{error:B,hint:Y?null:g,errorId:Le,hintId:Re}),E&&f(`div`,{className:`field-count${D&&De>=D?` at-limit`:``}`,children:[De,D?` / ${D}`:``]})]})});export{p as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import ee from"../lib/FieldMessage.js";import te from"./AppPopover.js";import ne from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import{MASK_INPUT_TYPES as re,MASK_NAMES as ie,attachInputMask as ae,evaluatePassword as oe,formatMasked as a,isMaskPattern as se,postedMasked as ce}from"@webority/ui-elements/helpers";import{forwardRef as o,useEffect as s,useId as le,useRef as c,useState as l}from"react";import{Form as u}from"react-bootstrap";import{jsx as d,jsxs as f}from"react/jsx-runtime";var ue=[`sm`,`md`,`lg`],de=[`bare`],fe=[!0,!1,`above`],p=o(function(o,p){let{label:m,required:h=!1,error:pe,hint:me,help:g,helpLabel:he=`More information`,type:_=`text`,size:v=`md`,leftIcon:y,rightIcon:b,onRightIconClick:x,rightIconLabel:ge,unit:S,id:_e,name:ve,className:ye=``,fieldClassName:C=``,disabled:w=!1,clearable:T=!1,showCount:E=!1,maxLength:D,prefix:O,suffix:k,action:A,floatingLabel:j=!1,variant:M,passwordRequirements:N=!1,requirementsPlacement:P=`auto`,mask:F,postFormatted:I=!1,onMaskChange:L,...R}=o;n(`AppInput`,R),t(`AppInput`,`size`,v,ue),t(`AppInput`,`variant`,M,de),t(`AppInput`,`floatingLabel`,j,fe),F!=null&&!se(F)&&t(`AppInput`,`mask`,F,ie),F!=null&&t(`AppInput`,`type`,_,re);let[z,be]=l(!1),[xe,Se]=l(``),B=pe||xe,Ce=le(),V=_e||Ce,H=_===`password`,we=H&&z?`text`:_,U=c(null),Te=e=>{U.current=e,typeof p==`function`?p(e):p&&(p.current=e)},W=String(R.value??R.defaultValue??``),[Ee,G]=l(()=>!!W),[K,q]=l(()=>W.length),De=T&&!w,J=T||E,Y=H&&!!N,[Oe,ke]=l(W);s(()=>{!Y||R.value===void 0||ke(String(R.value??``))},[R.value,Y]),s(()=>{if(!J||R.value===void 0)return;let e=String(R.value??``);G(!!e),q(e.length)},[R.value,J]);let Ae=e=>{G(!!e.target.value),q(e.target.value.length),R.onInput?.(e)},je=e=>{Y&&ke(e.target.value),J?Ae(e):R.onInput?.(e)},Me=F?{...R.value!==void 0&&{value:a(F,R.value)},...R.defaultValue!==void 0&&{defaultValue:a(F,R.defaultValue)}}:null,Ne=c(L);Ne.current=L,s(()=>{let e=U.current;if(!(!F||!e))return ae(e,{mask:F,postFormatted:I,onChange:(e,t)=>Ne.current?.(e,t),onInvalidChange:Se})},[F,I]);let Pe=e=>F&&!I&&e?t=>{let n=t.target,r=new Proxy(n,{get:(e,t)=>{if(t===`value`)return ce(F,e.value);let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}});e(Object.create(t,{target:{value:r}}))}:e,Fe=De?d(`button`,{type:`button`,className:`input-clear`,onClick:()=>{let e=U.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set;t?t.call(e,``):e.value=``,e.dispatchEvent(new Event(`input`,{bubbles:!0})),G(!1),e.focus()},"aria-label":`Clear`,tabIndex:-1,hidden:!Ee,children:d(r,{name:`x`,size:16})}):null,Ie=B&&V?`${V}-error`:void 0,Le=me&&V?`${V}-hint`:void 0,X=Y&&P===`inline`,Re=X&&V?`${V}-requirements`:void 0,ze=Ie||(X?Re:Le),Be=[`input`,v===`sm`?`input-sm`:``,v===`lg`?`input-lg`:``,B?`error`:``,H?`pw`:``,S?`num-input`:``,!(j&&m||O||k||S||H||b)&&T&&De?`has-clear`:``,M===`bare`?`input-bare`:``,ye].filter(Boolean).join(` `),Z=d(u.Control,{id:V,name:ve,type:we,className:Be,disabled:w,required:h,"aria-invalid":B?`true`:`false`,"aria-describedby":ze,maxLength:D,...R,onChange:Pe(R.onChange),onBlur:Pe(R.onBlur),...Me,placeholder:j?` `:R.placeholder,ref:Te,onInput:J||Y?je:R.onInput}),Q=N===!0||N,Ve=Q&&typeof Q==`object`&&Q.title||`Password requirements`,He=Y?oe(Oe,Q):null,Ue=Y?d(`ul`,{className:`pw-criteria`,"aria-live":`polite`,id:Re,"aria-label":X?Ve:void 0,children:He.map(e=>f(`li`,{className:`pw-rule ${e.met?`met`:`unmet`}`,children:[d(`span`,{className:`pw-mark`,"aria-hidden":`true`}),d(`span`,{className:`pw-rule-text`,children:e.label}),d(`span`,{className:`visually-hidden`,children:e.met?`: met`:`: not met`})]},e.key))}):null,$;if(j&&m&&!H)$=f(`div`,{className:j===`above`?`field-float wui-float-above`:`field-float`,children:[Z,f(`label`,{className:`float-label`,htmlFor:V,children:[m,h&&d(i,{})]})]});else if(A)$=f(`div`,{className:`input-action-row`,children:[f(`div`,{className:y?`input-icon`:`input-wrap`,children:[y&&d(`span`,{className:`ic`,children:d(r,{name:y,size:16})}),Z]}),d(`div`,{className:`input-action`,children:A})]});else if(O||k)$=f(`div`,{className:`input-affixed`,children:[O!=null&&d(`span`,{className:`affix affix-pre`,children:O}),Z,k!=null&&d(`span`,{className:`affix affix-suf`,children:k})]});else if(S)$=f(`div`,{className:`input-with-unit`,children:[Z,d(`span`,{className:`unit`,children:S})]});else if(H){let e=f(`button`,{type:`button`,className:`pw-toggle${z?` pw-revealed`:``}`,onClick:()=>be(e=>!e),"aria-label":z?`Hide password`:`Show password`,tabIndex:-1,children:[d(r,{name:`eye`,size:18,className:`pw-eye`}),d(r,{name:`eye-off`,size:18,className:`pw-eye-off`})]}),t=j&&m?d(`div`,{className:j===`above`?`field-float wui-float-above`:`field-float`,children:f(`div`,{className:`input-wrap`,children:[Z,e,f(`label`,{className:`float-label`,htmlFor:V,children:[m,h&&d(i,{})]})]})}):f(`div`,{className:y?`input-icon`:`input-wrap`,children:[y&&d(`span`,{className:`ic`,children:d(r,{name:y,size:16})}),Z,e]});$=Y&&!X?d(te,{trigger:t,triggerType:`focus`,placement:P,title:Ve,className:`pw-popover`,children:Ue}):t}else $=b?f(`div`,{className:`input-wrap`,children:[Z,d(`button`,{type:`button`,className:`pw-toggle`,onClick:x,disabled:!x,tabIndex:-1,"aria-label":ge||b,children:d(r,{name:b,size:18})})]}):T?f(`div`,{className:y?`input-icon`:`input-wrap`,children:[y&&d(`span`,{className:`ic`,children:d(r,{name:y,size:16})}),Z,Fe]}):y?f(`div`,{className:`input-icon`,children:[d(`span`,{className:`ic`,children:d(r,{name:y,size:16})}),Z]}):Z;return f(u.Group,{...e(`AppInput`,o),className:`field${C?` ${C}`:``}`,children:[m&&!j&&f(u.Label,{className:`label`,htmlFor:V,children:[m,h&&d(i,{}),g&&d(ne,{label:he,children:g})]}),$,X&&d(`div`,{className:`wui-pw-inline`,children:Ue}),d(ee,{error:B,hint:X?null:me,errorId:Ie,hintId:Le}),E&&f(`div`,{className:`field-count${D&&K>=D?` at-limit`:``}`,children:[K,D?` / ${D}`:``]})]})});export{p as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"./renderIconProp.js";import a from"./AppSparkline.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`plain`,`filled`,`accent`,`spotlight`],l=[`sm`,`md`,`lg`],u=[`primary`,`success`,`warning`,`danger`,`info`,`neutral`],d=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],f=[`up`,`down`,`flat`],p=[`success`,`danger`,`neutral`],m={success:` wui-kpi-delta--success`,danger:` wui-kpi-delta--danger`,neutral:` wui-kpi-delta--neutral`};function h(e){if(typeof e!=`string`)return`flat`;let t=e.trim();return t.startsWith(`+`)?`up`:t.startsWith(`-`)||t.startsWith(`−`)?`down`:`flat`}function g(g){let{label:_,value:v,caption:y,icon:b,iconTone:x,iconVariant:S,delta:C,deltaDirection:w,deltaTone:T,sparkline:E,variant:D=`plain`,size:O=`md`,valueSize:k,inline:A=!1,attention:j=!1,href:M,linkComponent:N,className:P=``,style:F,iconClassName:I=``,labelClassName:L=``,valueClassName:R=``,captionClassName:z=``,deltaClassName:B=``,sparklineClassName:V=``,...H}=g;n(`AppKpiTile`,H),t(`AppKpiTile`,`variant`,D,c),t(`AppKpiTile`,`size`,O,l),t(`AppKpiTile`,`iconTone`,x,u),t(`AppKpiTile`,`iconVariant`,S,d),t(`AppKpiTile`,`deltaDirection`,w,f),t(`AppKpiTile`,`deltaTone`,T,p);let U=`kpi${A?` kpi-inline`:``}${D===`filled`?` kpi-filled`:D===`accent`?` kpi-accent`:D===`spotlight`?` kpi-spotlight`:``}${O===`lg`?` kpi-lg`:O===`sm`?` kpi-sm`:``}${j?` kpi-attention`:``}${P?` ${P}`:``}`,W=typeof k==`number`&&k>0?{...F,"--wui-kpi-value-size":`${k}px`}:F,G=w??h(C),K=G===`up`?`arrow-up`:G===`down`?`arrow-down`:null,q=Object.hasOwn(m,T??``)?m[T]:``,J=M==null?`div`:N||`a`,Y=M==null?{}:N?{to:M}:{href:M};return s(J,{className:U,style:W,...e(`AppKpiTile`,g),...H,...Y,children:[b&&o(`span`,{className:`kpi-icon${x?` kpi-icon-${x}`:``}${I?` ${I}`:``}`,children:i(b,{size:20,variant:S})}),o(`div`,{className:`kpi-label${L?` ${L}`:``}`,children:_}),o(`div`,{className:`kpi-value${R?` ${R}`:``}`,children:v}),y&&o(`div`,{className:`kpi-caption${z?` ${z}`:``}`,children:y}),C&&s(`div`,{className:`kpi-delta${G===`flat`?``:` ${G}`}${q}${B?` ${B}`:``}`,children:[K&&o(r,{name:K,size:13}),C]}),E&&E.length>0&&o(a,{data:E,className:`kpi-sparkline${V?` ${V}`:``}`})]})}export{g as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"./renderIconProp.js";import a from"./AppSparkline.js";import{isValidElement as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`plain`,`filled`,`accent`,`spotlight`],u=[`sm`,`md`,`lg`],d=[`primary`,`success`,`warning`,`danger`,`info`,`neutral`],f=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],p=[`up`,`down`,`flat`],m=[`success`,`danger`,`neutral`],h={success:` wui-kpi-delta--success`,danger:` wui-kpi-delta--danger`,neutral:` wui-kpi-delta--neutral`};function g(e){return e==null||typeof e==`boolean`?``:typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(g).join(``):o(e)?g(e.props?.children):``}function _(e){let t=g(e).trim();return t.startsWith(`+`)?`up`:t.startsWith(`-`)||t.startsWith(`−`)?`down`:`flat`}function v(o){let{label:g,value:v,caption:y,icon:b,iconTone:x,iconVariant:S,delta:C,deltaDirection:w,deltaTone:T,sparkline:E,variant:D=`plain`,size:O=`md`,valueSize:k,inline:A=!1,attention:j=!1,href:M,linkComponent:N,className:P=``,style:F,iconClassName:I=``,labelClassName:L=``,valueClassName:R=``,captionClassName:z=``,deltaClassName:B=``,sparklineClassName:V=``,...H}=o;n(`AppKpiTile`,H),t(`AppKpiTile`,`variant`,D,l),t(`AppKpiTile`,`size`,O,u),t(`AppKpiTile`,`iconTone`,x,d),t(`AppKpiTile`,`iconVariant`,S,f),t(`AppKpiTile`,`deltaDirection`,w,p),t(`AppKpiTile`,`deltaTone`,T,m);let U=`kpi${A?` kpi-inline`:``}${D===`filled`?` kpi-filled`:D===`accent`?` kpi-accent`:D===`spotlight`?` kpi-spotlight`:``}${O===`lg`?` kpi-lg`:O===`sm`?` kpi-sm`:``}${j?` kpi-attention`:``}${P?` ${P}`:``}`,W=typeof k==`number`&&k>0?{...F,"--wui-kpi-value-size":`${k}px`}:F,G=w??_(C),K=G===`up`?`arrow-up`:G===`down`?`arrow-down`:null,q=Object.hasOwn(h,T??``)?h[T]:``,J=M==null?`div`:N||`a`,Y=M==null?{}:N?{to:M}:{href:M};return c(J,{className:U,style:W,...e(`AppKpiTile`,o),...H,...Y,children:[b&&s(`span`,{className:`kpi-icon${x?` kpi-icon-${x}`:``}${I?` ${I}`:``}`,children:i(b,{size:20,variant:S})}),s(`div`,{className:`kpi-label${L?` ${L}`:``}`,children:g}),s(`div`,{className:`kpi-value${R?` ${R}`:``}`,children:v}),y&&s(`div`,{className:`kpi-caption${z?` ${z}`:``}`,children:y}),C&&c(`div`,{className:`kpi-delta${G===`flat`?``:` ${G}`}${q}${B?` ${B}`:``}`,children:[K&&s(r,{name:K,size:13}),C]}),E&&E.length>0&&s(a,{data:E,className:`kpi-sparkline${V?` ${V}`:``}`})]})}export{v as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{MONEY_UNITS as r,formatValue as i}from"@webority/ui-elements/helpers";import{jsx as a,jsxs as o}from"react/jsx-runtime";import"@webority/ui-elements/elements/rolling-number";var s=[`number`,`currency`,`percent`];function c(c){let{value:l,format:u=`number`,unit:d,decimals:f,duration:p,className:m=``,...h}=c;n(`AppRollingNumber`,h),t(`AppRollingNumber`,`format`,u,s),t(`AppRollingNumber`,`unit`,d,r);let g=typeof l==`number`&&Number.isFinite(l),_=i(g?l:null,{style:u,unit:d,decimals:f});return o(`wui-rolling-number`,{class:[`wui-rolling-number`,m].filter(Boolean).join(` `),value:g?String(l):void 0,format:u,unit:d,decimals:f===void 0?void 0:String(f),duration:p===void 0?void 0:String(p),...e(`AppRollingNumber`,c),...h,children:[a(`span`,{className:`wui-rolling-number-text`,children:_}),a(`span`,{className:`wui-rolling-number-roll`,"aria-hidden":`true`})]})}export{c as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{MONEY_UNITS as r,formatValue as i}from"@webority/ui-elements/helpers";import{jsx as a,jsxs as o}from"react/jsx-runtime";import"@webority/ui-elements/elements/rolling-number";var s=[`number`,`currency`,`percent`];function c(c){let{value:l,format:u=`number`,unit:d,decimals:f,duration:p,className:m=``,...h}=c;n(`AppRollingNumber`,h),t(`AppRollingNumber`,`format`,u,s),t(`AppRollingNumber`,`unit`,d,r);let g=typeof l==`string`&&l.trim()!==``?Number(l):l,_=typeof g==`number`&&Number.isFinite(g),v=i(_?g:null,{style:u,unit:d,decimals:f});return o(`wui-rolling-number`,{class:[`wui-rolling-number`,m].filter(Boolean).join(` `),value:_?String(g):void 0,format:u,unit:d,decimals:f===void 0?void 0:String(f),duration:p===void 0?void 0:String(p),...e(`AppRollingNumber`,c),...h,children:[a(`span`,{className:`wui-rolling-number-text`,children:v}),a(`span`,{className:`wui-rolling-number-roll`,"aria-hidden":`true`})]})}export{c as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r,{SECTION_ALIGNS as i,SECTION_HEADINGS as a,SECTION_VARIANTS as o,sectionHeading as s}from"../lib/sectionShell.js";import{jsx as c}from"react/jsx-runtime";function l(l){let{title:u,as:d=`h2`,eyebrow:f,subtitle:p,align:m=`center`,variant:h=`default`,children:g,className:_=``,...v}=l;return n(`AppSectionFaq`,v),t(`AppSectionFaq`,`as`,d,a),t(`AppSectionFaq`,`align`,m,i),t(`AppSectionFaq`,`variant`,h,o),c(r,{component:`AppSectionFaq`,kind:`faq`,title:u,as:s(d,`h2`),eyebrow:f,subtitle:p,align:m,variant:h,className:_,rest:{...e(`AppSectionFaq`,l),...v},children:g!=null&&g!==!1&&c(`div`,{className:`wui-section-faq-body`,children:g})})}export{l as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppAccordion.js";import i,{SECTION_ALIGNS as a,SECTION_HEADINGS as o,SECTION_VARIANTS as s,sectionHeading as c}from"../lib/sectionShell.js";import{Children as l,cloneElement as u,isValidElement as d}from"react";import{jsx as f}from"react/jsx-runtime";function p(e,t){return Array.isArray(t)?l.map(e,e=>!d(e)||e.type!==r?e:u(e,{openItems:t.map(t=>e.props.items?.[t]?.key??String(t))})):e}function m(r){let{title:l,as:u=`h2`,eyebrow:d,subtitle:m,align:h=`center`,variant:g=`default`,children:_,openItems:v,className:y=``,...b}=r;return n(`AppSectionFaq`,b),t(`AppSectionFaq`,`as`,u,o),t(`AppSectionFaq`,`align`,h,a),t(`AppSectionFaq`,`variant`,g,s),f(i,{component:`AppSectionFaq`,kind:`faq`,title:l,as:c(u,`h2`),eyebrow:d,subtitle:m,align:h,variant:g,className:y,rest:{...e(`AppSectionFaq`,r),...b},children:_!=null&&_!==!1&&f(`div`,{className:`wui-section-faq-body`,children:p(_,v)})})}export{m as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"./warnDeprecatedValue.js";import{useEffect as a,useId as o,useLayoutEffect as s,useRef as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";var d={sm:`segmented-sm`,md:``,lg:`segmented-lg`},f={xl:{use:`lg`,removeIn:`0.83.0`}};function p(p){let{options:m=[],value:h,onChange:g,label:_,name:v,size:y=`md`,fullWidth:b=!1,bordered:x=!0,disabled:S=!1,labelVisible:C=!1,className:w=``,...T}=p;n(`AppSegmented`,T),i(`AppSegmented`,`size`,y,f);let E=f[y]?.use??y;t(`AppSegmented`,`size`,E,Object.keys(d));let D=o(),O=v||D,k=c(null),A=c(null),j=[`segmented`,d[E]??``,b?`segmented-full`:``,x?``:`wui-segmented-borderless`,S?`is-disabled`:``,w].filter(Boolean).join(` `);s(()=>{let e=k.current,t=A.current;if(!e||!t)return;let n=n=>{let r=e.querySelector(`.segmented-option:has(.segmented-input:checked)`);if(!r||!e.offsetWidth){t.style.opacity=`0`;return}n||e.classList.remove(`is-animated`),t.style.width=`${r.offsetWidth}px`,t.style.transform=`translateX(${r.offsetLeft}px)`,t.style.opacity=`1`,n||requestAnimationFrame(()=>k.current?.classList.add(`is-animated`))};n(!0);let r=typeof ResizeObserver<`u`?new ResizeObserver(()=>n(!1)):null;return r?.observe(e),()=>r?.disconnect()},[h,m,y,b,C]),a(()=>{let e=requestAnimationFrame(()=>k.current?.classList.add(`is-animated`));return()=>cancelAnimationFrame(e)},[]);let M=C&&_,N=e(`AppSegmented`,p),P=u(`div`,{ref:k,className:j,role:`radiogroup`,"aria-label":_,"aria-disabled":S||void 0,...M?void 0:N,...T,children:[l(`span`,{className:`segmented-thumb`,ref:A,"aria-hidden":`true`}),m.map(e=>u(`label`,{className:`segmented-option`,children:[l(`input`,{type:`radio`,className:`segmented-input`,name:O,value:e.value,checked:e.value===h,disabled:S||e.disabled,onChange:()=>g?.(e.value)}),e.icon&&l(r,{name:e.icon,size:13}),e.note?u(`span`,{className:`segmented-option-text`,children:[l(`span`,{className:`segmented-option-label`,children:e.label}),l(`span`,{className:`segmented-option-note`,children:e.note})]}):e.label,e.count!=null&&l(`span`,{className:`wui-segmented-option-count`,children:e.count})]},e.value))]});return M?u(`div`,{className:`field`,...N,children:[l(`span`,{className:`label`,"aria-hidden":`true`,children:_}),P]}):P}export{p as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"./warnDeprecatedValue.js";import{useEffect as a,useId as o,useLayoutEffect as s,useRef as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";var d={sm:`segmented-sm`,md:``,lg:`segmented-lg`},f={xl:{use:`lg`,removeIn:`0.83.0`}};function p(p){let{options:m=[],value:h,onChange:g,label:_,name:v,size:y=`md`,fullWidth:b=!1,bordered:x=!0,disabled:S=!1,labelVisible:C=!1,className:w=``,...T}=p;n(`AppSegmented`,T),i(`AppSegmented`,`size`,y,f);let E=f[y]?.use??y;t(`AppSegmented`,`size`,E,Object.keys(d));let D=o(),O=v||D,k=c(null),A=c(null),j=[`segmented`,d[E]??``,b?`segmented-full`:``,x?``:`wui-segmented-borderless`,S?`is-disabled`:``,w].filter(Boolean).join(` `);s(()=>{let e=k.current,t=A.current;if(!e||!t)return;let n=n=>{let r=e.querySelector(`.segmented-option:has(.segmented-input:checked)`);if(!r||!e.offsetWidth){t.style.opacity=`0`;return}n||e.classList.remove(`is-animated`),t.style.width=`${r.offsetWidth}px`,t.style.transform=`translateX(${r.offsetLeft}px)`,t.style.opacity=`1`,n||requestAnimationFrame(()=>k.current?.classList.add(`is-animated`))};n(!0);let r=typeof ResizeObserver<`u`?new ResizeObserver(()=>n(!1)):null;return r?.observe(e),()=>r?.disconnect()},[h,m,y,b,C]),a(()=>{let e=requestAnimationFrame(()=>k.current?.classList.add(`is-animated`));return()=>cancelAnimationFrame(e)},[]);let M=C&&_,N=e(`AppSegmented`,p),P=u(`div`,{ref:k,className:j,role:`radiogroup`,"aria-label":_,"aria-disabled":S||void 0,...M?void 0:N,...T,children:[l(`span`,{className:`segmented-thumb`,ref:A,"aria-hidden":`true`}),m.map(e=>u(`label`,{className:`segmented-option`,children:[l(`input`,{type:`radio`,className:`segmented-input`,name:O,value:e.value,checked:e.value===h,disabled:S||e.disabled,onChange:()=>g?.(e.value)}),e.icon&&l(r,{name:e.icon,size:13}),e.note?u(`span`,{className:`segmented-option-text`,children:[l(`span`,{className:`segmented-option-label`,children:e.label}),l(`span`,{className:`segmented-option-note`,children:e.note})]}):e.label,e.count!=null&&l(`span`,{className:`wui-segmented-option-count`,children:e.count})]},e.value))]},`group`);return M?u(`div`,{className:`field`,...N,children:[l(`span`,{className:`label`,"aria-hidden":`true`,children:_}),P]},`field`):P}export{p as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import ee from"./warnUnknownProps.js";import te from"../lib/FieldMessage.js";import n from"./AppInfoTip.js";import r from"./AppRequiredMark.js";import i from"./useNodeLabels.js";import a,{optionsEqual as o}from"./useWuiControl.js";import{forwardRef as s,useEffect as c,useId as l,useRef as u}from"react";import{Fragment as ne,jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/select";var re=[`sm`,`lg`],p=(e,t)=>({value:e.value,label:t,icon:e.icon}),m=s(function(s,m){let{value:h,onChange:g,options:_=[],placeholder:v=`Select...`,searchPlaceholder:y=`Search...`,searchable:b=!1,clearable:ie=!1,size:x,icon:ae,prefix:S,suffix:C,floatingLabel:w=!1,disabled:T,label:E,required:D=!1,error:O,hint:k,help:A,helpLabel:j=`More information`,id:M,name:N,className:P=``,fieldClassName:F=``,"aria-label":I,"aria-labelledby":L,"aria-describedby":R,...z}=s;ee(`AppSelect`,z),t(`AppSelect`,`size`,x,re);let oe=l(),{setRef:B,innerRef:V}=a({ref:m,value:h??``,onChange:g}),{portal:H,toElementOptions:U}=i(_),W=u({el:null,options:null,map:null});c(()=>{let e=V.current;if(!e||W.current.el===e&&W.current.options===_&&W.current.map===U)return;W.current={el:e,options:_,map:U};let t=U(_,p);o(t,e.options)||(e.options=t)});let G=M||oe,K=w&&E,q=O&&G?`${G}-error`:void 0,J=k&&G?`${G}-hint`:void 0,se=q||J||R,Y=!K&&(S!=null||C!=null),X=!E&&!O&&!k,Z=e(`AppSelect`,s),Q=f(ne,{children:[d(`wui-select`,{"aria-label":I||(typeof E==`string`?E:void 0),"aria-labelledby":L||void 0,"aria-describedby":se||void 0,"aria-invalid":O?`true`:void 0,ref:B,id:G,name:N,placeholder:w&&E?` `:v,"search-placeholder":y,searchable:b?``:void 0,clearable:ie?``:void 0,size:x||void 0,icon:ae||void 0,disabled:T?``:void 0,required:D?``:void 0,className:P||void 0,...X&&!Y?Z:null,...z}),H]}),$=Y?f(`div`,{...X?Z:null,className:`input-affixed`,children:[S!=null&&d(`span`,{className:`affix affix-pre`,children:S}),Q,C!=null&&d(`span`,{className:`affix affix-suf`,children:C})]}):Q;if(X)return $;let ce=[`field`,F].filter(Boolean).join(` `);return f(`div`,{...Z,className:ce,children:[E&&!K&&f(`label`,{className:`label`,htmlFor:G,children:[E,D&&d(r,{}),A&&d(n,{label:j,children:A})]}),K?f(`div`,{className:`field-float`,children:[Q,f(`label`,{className:`float-label`,htmlFor:G,children:[E,D&&d(r,{})]})]}):$,d(te,{error:O,hint:k,errorId:q,hintId:J})]})});export{m as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import ee from"./warnUnknownProps.js";import te from"../lib/FieldMessage.js";import n from"./AppInfoTip.js";import r from"./AppRequiredMark.js";import i from"./useNodeLabels.js";import a,{optionsEqual as o}from"./useWuiControl.js";import{forwardRef as s,useId as c,useLayoutEffect as l,useRef as u}from"react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import"@webority/ui-elements/elements/select";var ne=[`sm`,`lg`],re=(e,t)=>({value:e.value,label:t,icon:e.icon}),m=s(function(s,m){let{value:h,onChange:g,options:_=[],placeholder:v=`Select...`,searchPlaceholder:y=`Search...`,searchable:b=!1,clearable:ie=!1,size:x,icon:ae,prefix:S,suffix:C,floatingLabel:w=!1,disabled:oe,label:T,required:E=!1,error:D,hint:O,help:k,helpLabel:A=`More information`,id:j,name:M,className:N=``,fieldClassName:P=``,"aria-label":F,"aria-labelledby":I,"aria-describedby":L,...R}=s;ee(`AppSelect`,R),t(`AppSelect`,`size`,x,ne);let z=c(),{setRef:B,innerRef:V}=a({ref:m,value:h??``,onChange:g}),{portal:H,toElementOptions:U}=i(_),W=u({el:null,options:null,map:null});l(()=>{let e=V.current;if(!e||W.current.el===e&&W.current.options===_&&W.current.map===U)return;W.current={el:e,options:_,map:U};let t=U(_,re);o(t,e.options)||(e.options=t)});let G=j||z,K=w&&T,q=D&&G?`${G}-error`:void 0,J=O&&G?`${G}-hint`:void 0,se=q||J||L,Y=!K&&(S!=null||C!=null),X=!T&&!D&&!O,Z=e(`AppSelect`,s),Q=p(d,{children:[f(`wui-select`,{"aria-label":F||(typeof T==`string`?T:void 0),"aria-labelledby":I||void 0,"aria-describedby":se||void 0,"aria-invalid":D?`true`:void 0,ref:B,value:h||void 0,id:G,name:M,placeholder:w&&T?` `:v,"search-placeholder":y,searchable:b?``:void 0,clearable:ie?``:void 0,size:x||void 0,icon:ae||void 0,disabled:oe?``:void 0,required:E?``:void 0,className:N||void 0,...X&&!Y?Z:null,...R}),H]}),$=Y?p(`div`,{...X?Z:null,className:`input-affixed`,children:[S!=null&&f(`span`,{className:`affix affix-pre`,children:S}),Q,C!=null&&f(`span`,{className:`affix affix-suf`,children:C})]}):Q;if(X)return $;let ce=[`field`,P].filter(Boolean).join(` `);return p(`div`,{...Z,className:ce,children:[T&&!K&&p(`label`,{className:`label`,htmlFor:G,children:[T,E&&f(r,{}),k&&f(n,{label:A,children:k})]}),K?p(`div`,{className:`field-float`,children:[Q,p(`label`,{className:`float-label`,htmlFor:G,children:[T,E&&f(r,{})]})]}):$,f(te,{error:D,hint:O,errorId:q,hintId:J})]})});export{m as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"../lib/CheckField.js";import{forwardRef as i}from"react";import{jsx as a}from"react/jsx-runtime";var o=[`round`,`pill`,`circle`],s=i(function(i,s){let{label:c,id:l,name:u,error:d,hint:f,shape:p=`round`,className:m=``,...h}=i;n(`AppSwitch`,h),t(`AppSwitch`,`shape`,p,o);let g=`form-check form-switch${p===`circle`?` form-switch-circle`:p===`pill`?` form-switch-pill`:``}`;return a(r,{rootProps:e(`AppSwitch`,i),ref:s,label:c,id:l,name:u,error:d,hint:f,className:m,rest:h,inputType:`checkbox`,wrapperClass:g})});export{s as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"../lib/CheckField.js";import{forwardRef as i}from"react";import{jsx as a}from"react/jsx-runtime";var o=[`round`,`pill`,`circle`],s=i(function(i,s){let{label:c,id:l,name:u,error:d,hint:f,shape:p=`round`,className:m=``,checked:h,defaultChecked:g,onChange:_,...v}=i;n(`AppSwitch`,v),t(`AppSwitch`,`shape`,p,o);let y=`form-check form-switch${p===`circle`?` form-switch-circle`:p===`pill`?` form-switch-pill`:``}`,b={...v};return h!==void 0&&(b.checked=h),g!==void 0&&(b.defaultChecked=g),_!==void 0&&(b.onChange=_),h!==void 0&&_===void 0&&(b.readOnly=!0),a(r,{rootProps:e(`AppSwitch`,i),ref:s,label:c,id:l,name:u,error:d,hint:f,className:m,rest:b,inputType:`checkbox`,wrapperClass:y})});export{s as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{pageWindow as i}from"../lib/pageWindow.js";import a from"./AppSelectMini.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`numbered`,`prev-next`],l=[5,10,25,50];function u(u){let{page:d,totalPages:f,pageSize:p,onPageChange:m,onPageSizeChange:h,pageSizes:g=l,mode:_=`numbered`,showPageSize:v=!0,className:y=``,...b}=u;n(`AppTablePagination`,b),t(`AppTablePagination`,`mode`,_,c);let x=_===`numbered`,S=x?i(d,f):null;return s(`div`,{className:`table-pagination${y?` ${y}`:``}`,...e(`AppTablePagination`,u),...b,children:[v&&o(`span`,{className:`tpg-rows`,children:o(a,{value:p,onChange:e=>h(Number(e)),ariaLabel:`Rows per page`,options:g.map(e=>({value:e,label:`${e} per page`}))})}),!x&&s(`span`,{className:`tpg-range`,children:[`Page `,d,` of `,f]}),s(`div`,{className:`tpg-nav`,children:[o(`button`,{type:`button`,className:`tpg-arrow`,onClick:()=>m(Math.max(1,d-1)),disabled:d<=1,"aria-label":`Previous page`,children:o(r,{name:`arrow-left`,size:18})}),x&&S.map(e=>typeof e==`number`?o(`button`,{type:`button`,className:`tpg-page${e===d?` is-active`:``}`,onClick:()=>m(e),"aria-current":e===d?`page`:void 0,"aria-label":`Page ${e}`,children:e},e):o(`span`,{className:`tpg-ellipsis`,"aria-hidden":`true`,children:`…`},e)),o(`button`,{type:`button`,className:`tpg-arrow`,onClick:()=>m(Math.min(f,d+1)),disabled:d>=f,"aria-label":`Next page`,children:o(r,{name:`arrow-right`,size:18})})]})]})}export{u as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{pageWindow as i}from"../lib/pageWindow.js";import a from"./AppSelectMini.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`numbered`,`prev-next`],l=[5,10,25,50];function u(u){let{page:d,totalPages:f,total:p,pageSize:m,onPageChange:h,onPageSizeChange:g,pageSizes:_=l,mode:v=`numbered`,showPageSize:y=!0,className:b=``,...x}=u;n(`AppTablePagination`,x),t(`AppTablePagination`,`mode`,v,c);let S=Number(d),C=Number(m)||0,w=Number(p)||0,T=f??Math.max(1,Math.ceil(w/(C>0?C:10))),E=v===`numbered`,D=E?i(S,T):null;return s(`div`,{className:`table-pagination${b?` ${b}`:``}`,...e(`AppTablePagination`,u),...x,children:[y&&o(`span`,{className:`tpg-rows`,children:o(a,{value:C,onChange:e=>g?.(Number(e)),ariaLabel:`Rows per page`,options:_.map(e=>({value:e,label:`${e} per page`}))})}),!E&&s(`span`,{className:`tpg-range`,children:[`Page `,S,` of `,T]}),s(`div`,{className:`tpg-nav`,children:[o(`button`,{type:`button`,className:`tpg-arrow`,onClick:()=>h?.(Math.max(1,S-1)),disabled:S<=1,"aria-label":`Previous page`,children:o(r,{name:`arrow-left`,size:18})}),E&&D.map(e=>typeof e==`number`?o(`button`,{type:`button`,className:`tpg-page${e===S?` is-active`:``}`,onClick:()=>h?.(e),"aria-current":e===S?`page`:void 0,"aria-label":`Page ${e}`,children:e},e):o(`span`,{className:`tpg-ellipsis`,"aria-hidden":`true`,children:`…`},e)),o(`button`,{type:`button`,className:`tpg-arrow`,onClick:()=>h?.(Math.min(T,S+1)),disabled:S>=T,"aria-label":`Next page`,children:o(r,{name:`arrow-right`,size:18})})]})]})}export{u as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"../lib/FieldMessage.js";import i from"./AppInfoTip.js";import a from"./AppRequiredMark.js";import o from"./useWuiControl.js";import{cloneElement as s,forwardRef as c,useId as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/timepicker";var f=[`sm`,`md`,`lg`],p=[`12`,`24`],m=c(function(c,m){let{value:h,onChange:g,label:_,required:v=!1,hint:y,error:b,help:x,helpLabel:S=`More information`,name:C,min:w,max:T,step:E,format:D=`24`,placeholder:O=`Select time`,disabled:k,size:A,id:j,ariaLabel:M,className:N=``,fieldClassName:P=``,...F}=c;n(`AppTimePicker`,F),t(`AppTimePicker`,`size`,A,f),t(`AppTimePicker`,`format`,D,p);let I=l(),L=j||C||I,{setRef:R}=o({ref:m,value:h??``,onChange:g}),z=!_&&!b&&!y,B=b?`${L}-error`:void 0,V=y?`${L}-hint`:void 0,H=u(`wui-timepicker`,{ref:R,id:L,name:C,min:w,max:T,step:E==null?void 0:String(E),format:D,placeholder:O,size:A||void 0,"aria-label":M||(typeof _==`string`?_:void 0),"aria-describedby":B||V,"aria-invalid":b?`true`:void 0,disabled:k?``:void 0,required:v?``:void 0,className:N||void 0,...F});return z?s(H,e(`AppTimePicker`,c)):d(`div`,{...e(`AppTimePicker`,c),className:`field${P?` ${P}`:``}`,children:[_&&d(`label`,{className:`label`,htmlFor:L,children:[_,v&&u(a,{}),x&&u(i,{label:S,children:x})]}),H,u(r,{error:b,hint:y,errorId:B,hintId:V})]})});export{m as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"../lib/FieldMessage.js";import i from"./AppInfoTip.js";import a from"./AppRequiredMark.js";import o from"./useWuiControl.js";import{cloneElement as s,forwardRef as c,useId as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/timepicker";var f=[`sm`,`md`,`lg`],p=[`12`,`24`],m=c(function(c,m){let{value:h,onChange:g,label:_,required:v=!1,hint:y,error:b,help:x,helpLabel:S=`More information`,name:C,min:w,max:T,step:E,format:D=`24`,placeholder:O=`Select time`,disabled:k,size:A,id:j,ariaLabel:M,className:N=``,fieldClassName:P=``,...F}=c;n(`AppTimePicker`,F),t(`AppTimePicker`,`size`,A,f);let I=String(D);t(`AppTimePicker`,`format`,I,p);let L=l(),R=j||C||L,{setRef:z}=o({ref:m,value:h??``,onChange:g}),B=!_&&!b&&!y,V=b?`${R}-error`:void 0,H=y?`${R}-hint`:void 0,U=u(`wui-timepicker`,{ref:z,value:h||void 0,id:R,name:C,min:w,max:T,step:E==null?void 0:String(E),format:I,placeholder:O,size:A||void 0,"aria-label":M||(typeof _==`string`?_:void 0),"aria-describedby":V||H,"aria-invalid":b?`true`:void 0,disabled:k?``:void 0,required:v?``:void 0,className:N||void 0,...F});return B?s(U,e(`AppTimePicker`,c)):d(`div`,{...e(`AppTimePicker`,c),className:`field${P?` ${P}`:``}`,children:[_&&d(`label`,{className:`label`,htmlFor:R,children:[_,v&&u(a,{}),x&&u(i,{label:S,children:x})]}),U,u(r,{error:b,hint:y,errorId:V,hintId:H})]})});export{m as default};
@@ -1 +1 @@
1
- import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{Children as i,forwardRef as a,useEffect as o,useRef as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import"@webority/ui-elements/elements/wizard";var u=[`steps`,`journey`,`icons`,`tiles`],d=[`primary`,`success`,`warning`,`danger`,`info`],f=[`horizontal`,`vertical`],ee=[`center`,`start`],p=[`done`,`active`,`pending`,`error`],m=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],h=[`check`,`alert-triangle`,`minus`],g=[`sm`,`md`,`lg`],_={sm:14,md:16,lg:20},v=a(function(a,v){let{steps:y=[],children:b,active:x,defaultActive:te=0,onStepChange:S,onFinish:C,onSkip:w,beforeNext:T,onInvalid:E,onClose:D,variant:O=`steps`,tone:k,doneTone:A,orientation:j=`horizontal`,align:M=`center`,iconVariant:N,size:P=`md`,iconSize:F,skippable:I=!1,nonLinear:L=!1,hideStepper:R=!1,hideConnectors:z=!1,disabled:B=!1,label:V=`Progress`,backLabel:H=`Back`,nextLabel:U=`Next`,skipLabel:W=`Skip`,finishLabel:G=`Finish`,topBar:K=!1,barTitle:q,closeLabel:J=`Close`,className:Y=``,...X}=a;n(`AppWizard`,X),t(`AppWizard`,`variant`,O,u),t(`AppWizard`,`tone`,k,d),t(`AppWizard`,`doneTone`,A,d),t(`AppWizard`,`orientation`,j,f),t(`AppWizard`,`align`,M,ee),t(`AppWizard`,`iconVariant`,N,m),t(`AppWizard`,`size`,P,g);let Z=F>0?F:_[P]??_.md;for(let e of y)t(`AppWizard`,`steps[].status`,e.status,p);let Q=s(null),ne=e=>{Q.current=e,typeof v==`function`?v(e):v&&(v.current=e)},re=i.toArray(b),$=N&&N!==`linear`?[...new Set([...h,...y.map(e=>e.icon).filter(Boolean)])]:[],ie=[k&&`wui-step-tone-${k}`,A&&`wui-step-done-tone-${A}`,P!==`md`&&g.includes(P)&&`wui-step-size-${P}`,Y].filter(Boolean).join(` `);return o(()=>{let e=Q.current;if(!e)return;let t=x===void 0?te:x;t&&(e.active=t)},[]),o(()=>{let e=Q.current;e&&x!==void 0&&Number(e.active)!==x&&(e.active=x)},[x]),o(()=>{let e=Q.current;e&&(e.beforeNext=T??null)},[T]),o(()=>{let e=Q.current;if(!e)return;let t=e=>S?.(e.detail.index,e.detail),n=e=>C?.(e.detail),r=e=>w?.(e.detail.index),i=e=>E?.(e.detail.index),a=e=>D?.(e.detail);return e.addEventListener(`wui-wizard:change`,t),e.addEventListener(`wui-wizard:finish`,n),e.addEventListener(`wui-wizard:skip`,r),e.addEventListener(`wui-wizard:invalid`,i),e.addEventListener(`wui-wizard:close`,a),()=>{e.removeEventListener(`wui-wizard:change`,t),e.removeEventListener(`wui-wizard:finish`,n),e.removeEventListener(`wui-wizard:skip`,r),e.removeEventListener(`wui-wizard:invalid`,i),e.removeEventListener(`wui-wizard:close`,a)}},[S,C,w,E,D]),l(`wui-wizard`,{ref:ne,variant:O,orientation:j,align:M===`start`?`start`:void 0,"icon-size":Z===16?void 0:Z,skippable:I?``:void 0,"non-linear":L?``:void 0,"hide-stepper":R?``:void 0,"hide-connectors":z?``:void 0,disabled:B?``:void 0,label:V,"back-label":H,"next-label":U,"skip-label":W,"finish-label":G,"top-bar":K?``:void 0,"bar-title":q||void 0,"close-label":J,className:ie||void 0,...e(`AppWizard`,a),...X,children:[y.map((e,t)=>c(`wui-wizard-step`,{label:e.label,description:e.description||void 0,optional:e.optional?``:void 0,icon:e.icon||void 0,status:e.status||void 0,children:re[t]},e.key??`${e.label}-${t}`)),$.length>0&&c(`span`,{hidden:!0,"data-wui-glyphs":``,children:$.map(e=>c(r,{name:e,size:Z,variant:N},e))})]})});export{v as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import i from"./AppIcon.js";import{Children as a,forwardRef as o,useEffect as s,useRef as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import"@webority/ui-elements/elements/wizard";var d=[`steps`,`journey`,`icons`,`tiles`],f=[`primary`,`success`,`warning`,`danger`,`info`],p=[`horizontal`,`vertical`],ee=[`center`,`start`],m=[`done`,`active`,`pending`,`error`],h=[`key`,`label`,`description`,`optional`,`icon`,`status`],g=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],te=[`check`,`alert-triangle`,`minus`],_=[`sm`,`md`,`lg`],v={sm:14,md:16,lg:20},y=new Set,b=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}};function ne(e){if(!Array.isArray(e))throw Error(`AppWizard: steps must be an array of { label, description?, optional?, icon?, status?, key? } objects.`);e.forEach((e,n)=>{if(typeof e!=`object`||!e||typeof e.label!=`string`||e.label.trim()===``)throw Error(`AppWizard: steps[${n}] needs a text label.`);if(b())for(let r of Object.keys(e)){if(h.includes(r))continue;let e=`AppWizard: steps[${n}] has an unknown field ${r}; the fields are ${h.join(`, `)}.`;y.has(e)||(y.add(e),t(e))}})}var x=o(function(t,o){let{steps:h=[],children:y,active:b,defaultActive:x=0,onStepChange:S,onFinish:C,onSkip:w,beforeNext:T,onInvalid:E,onClose:D,variant:O=`steps`,tone:k,doneTone:A,orientation:j=`horizontal`,align:M=`center`,iconVariant:N,size:P=`md`,iconSize:F,skippable:I=!1,nonLinear:L=!1,hideStepper:R=!1,hideConnectors:z=!1,disabled:B=!1,label:V=`Progress`,backLabel:H=`Back`,nextLabel:U=`Next`,skipLabel:W=`Skip`,finishLabel:G=`Finish`,topBar:K=!1,barTitle:q,closeLabel:J=`Close`,className:Y=``,...X}=t;r(`AppWizard`,X),n(`AppWizard`,`variant`,O,d),n(`AppWizard`,`tone`,k,f),n(`AppWizard`,`doneTone`,A,f),n(`AppWizard`,`orientation`,j,p),n(`AppWizard`,`align`,M,ee),n(`AppWizard`,`iconVariant`,N,g),n(`AppWizard`,`size`,P,_),ne(h);let Z=F>0?F:v[P]??v.md;for(let e of h)n(`AppWizard`,`steps[].status`,e.status,m);let Q=c(null),re=e=>{Q.current=e,typeof o==`function`?o(e):o&&(o.current=e)},ie=a.toArray(y),$=N&&N!==`linear`?[...new Set([...te,...h.map(e=>e.icon).filter(Boolean)])]:[],ae=[k&&`wui-step-tone-${k}`,A&&`wui-step-done-tone-${A}`,P!==`md`&&_.includes(P)&&`wui-step-size-${P}`,Y].filter(Boolean).join(` `);return s(()=>{let e=Q.current;if(!e)return;let t=b===void 0?x:b;t&&(e.active=t)},[]),s(()=>{let e=Q.current;e&&b!==void 0&&Number(e.active)!==b&&(e.active=b)},[b]),s(()=>{let e=Q.current;e&&(e.beforeNext=T??null)},[T]),s(()=>{let e=Q.current;if(!e)return;let t=e=>S?.(e.detail.index,e.detail),n=e=>C?.(e.detail),r=e=>w?.(e.detail.index),i=e=>E?.(e.detail.index),a=e=>D?.(e.detail);return e.addEventListener(`wui-wizard:change`,t),e.addEventListener(`wui-wizard:finish`,n),e.addEventListener(`wui-wizard:skip`,r),e.addEventListener(`wui-wizard:invalid`,i),e.addEventListener(`wui-wizard:close`,a),()=>{e.removeEventListener(`wui-wizard:change`,t),e.removeEventListener(`wui-wizard:finish`,n),e.removeEventListener(`wui-wizard:skip`,r),e.removeEventListener(`wui-wizard:invalid`,i),e.removeEventListener(`wui-wizard:close`,a)}},[S,C,w,E,D]),u(`wui-wizard`,{ref:re,variant:O,orientation:j,align:M===`start`?`start`:void 0,"icon-size":Z===16?void 0:Z,skippable:I?``:void 0,"non-linear":L?``:void 0,"hide-stepper":R?``:void 0,"hide-connectors":z?``:void 0,disabled:B?``:void 0,label:V,"back-label":H,"next-label":U,"skip-label":W,"finish-label":G,"top-bar":K?``:void 0,"bar-title":q||void 0,"close-label":J,className:ae||void 0,...e(`AppWizard`,t),...X,children:[h.map((e,t)=>l(`wui-wizard-step`,{label:e.label,description:e.description||void 0,optional:e.optional?``:void 0,icon:e.icon||void 0,status:e.status||void 0,children:ie[t]},e.key??`${e.label}-${t}`)),$.length>0&&l(`span`,{hidden:!0,"data-wui-glyphs":``,children:$.map(e=>l(i,{name:e,size:Z,variant:N},e))})]})});export{x as default};