@webority/ui-react 0.64.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppDataTable.js +1 -1
- package/dist/components/AppDescriptions.js +1 -1
- package/dist/components/AppDropdown.js +1 -1
- package/dist/components/AppDueDate.js +1 -0
- package/dist/components/AppFilterBar.js +1 -1
- package/dist/components/AppFormSection.js +1 -1
- package/dist/components/AppKanban.js +1 -1
- package/dist/components/AppMetricStrip.js +1 -0
- package/dist/components/AppPageHeader.js +1 -1
- package/dist/components/AppScoreScale.js +1 -0
- package/dist/components/AppSegmented.js +1 -1
- package/dist/components/AppShell.js +1 -1
- package/dist/components/AppSplitView.js +1 -1
- package/dist/components/AppStepper.js +1 -1
- package/dist/components/AppTabs.js +1 -1
- package/dist/lib/initials.js +1 -1
- package/dist/types/components/AppDataTable.d.ts +3 -1
- package/dist/types/components/AppDescriptions.d.ts +6 -2
- package/dist/types/components/AppDropdown.d.ts +2 -1
- package/dist/types/components/AppDueDate.d.ts +19 -0
- package/dist/types/components/AppFilterBar.d.ts +4 -1
- package/dist/types/components/AppFormSection.d.ts +3 -1
- package/dist/types/components/AppKanban.d.ts +9 -1
- package/dist/types/components/AppMetricStrip.d.ts +22 -0
- package/dist/types/components/AppPageHeader.d.ts +19 -3
- package/dist/types/components/AppScoreScale.d.ts +40 -0
- package/dist/types/components/AppSegmented.d.ts +2 -1
- package/dist/types/components/AppShell.d.ts +3 -1
- package/dist/types/components/AppStepper.d.ts +3 -1
- package/dist/types/components/AppTabs.d.ts +5 -2
- package/dist/types/index.d.ts +3 -0
- package/dist/ui-react.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{AppSkeletonRows as r}from"./AppSkeleton.js";import i from"./AppTablePagination.js";import{attachScrollEdges as a}from"@webority/ui-elements/helpers";import{Fragment as o,useEffect as s,useLayoutEffect as c,useMemo as l,useRef as u,useState as d}from"react";import{Fragment as ee,jsx as f,jsxs as p}from"react/jsx-runtime";import{COLUMN_MAX_WIDTH as te,COLUMN_MIN_WIDTH as ne,DATA_TABLE_TEXT as re,PIN_AT_VAR as ie,PIN_SIDES as ae,ROW_HEIGHTS as oe,ROW_MOVE_LIMIT as se,ROW_SAVE_ERROR_CLASS as ce,groupCount as le,groupItems as ue,measureRows as de,pinAtValue as fe,pinClasses as pe,planPins as me,playRowMoves as he,rowOrderChanged as ge,saveOutcomeText as _e,settledRows as ve,virtualRange as ye}from"@webority/ui-elements/elements/data-table";var be=[`comfortable`,`cozy`,`compact`],m=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},h=new Set;function g(e,t){h.has(e)||!m()||(h.add(e),console.warn(`[@webority/ui-react] <AppDataTable> ${t}`))}var xe=100;function Se(e){return e===`end`?`wui-cell-end`:e===`num`?`num`:e===`center`?`text-center`:``}function Ce(e){return e==null||e===``?`-`:typeof e==`boolean`?String(e):e}function _({columns:m,rows:h,rowKey:_=e=>e.id,sort:v,onSort:y,loading:b=!1,skeletonRows:we=5,empty:Te=`No records found.`,emptyFiltered:Ee,sourceCount:De,rowActions:x,rowActionsLabel:Oe,pagination:S,ariaLabel:ke,className:Ae=``,wrapperClassName:je=``,selectable:C=!1,selectedIds:w,onToggleRow:Me,onToggleAll:Ne,onSelectRange:Pe,renderExpanded:Fe,density:T=`comfortable`,striped:Ie=!1,maxHeight:E,stickyFirstColumn:Le=!1,stickyActions:Re=!1,stackOnMobile:D=!1,hiddenColumns:ze,rowStatus:Be,rowHref:O,onRowClick:k,activeRowKey:Ve,resizableColumns:A=!1,viewKey:He,groupBy:j,groupLabel:Ue,virtual:M=!1,rowSaving:We,rowSaveError:Ge,...Ke}){t(`AppDataTable`,Ke);let qe=ze?.length?new Set(ze):null;m=qe?m.filter(e=>!(e.hideable&&qe.has(e.key))):m,e(`AppDataTable`,`density`,T,be);for(let t of m)e(`AppDataTable`,`column.pin`,t.pin,ae);let Je=[`table table-ledger`,T===`cozy`||T===`compact`?`wui-table-${T}`:``,Ie?`wui-table-striped`:``,Le?`wui-table-sticky-first`:``,Re?`wui-table-sticky-actions`:``,D?`wui-table-stack`:``,Ae].filter(Boolean).join(` `),N=typeof Fe==`function`,[Ye,Xe]=d(()=>new Set),Ze=e=>Xe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),Qe=m.some(e=>typeof e.footer==`function`),P=typeof O==`function`||typeof k==`function`,$e=e=>!!e.target.closest(`a, button, input, select, textarea, label, [role='menu'], [role='menuitem'], .dropdown`),F=(e,t)=>{if($e(t)||(k&&k(e),!O))return;let n=O(e);n&&(t.ctrlKey||t.metaKey||t.button===1?window.open(n,`_blank`,`noopener`):window.location.assign(n))},I=E!==void 0,et=[`table-wrap`,I?`wui-table-scroll`:``,je].filter(Boolean).join(` `),tt=I?{maxHeight:E}:void 0,L=Math.max(1,m.length+ +!!x+ +!!C+ +!!N),nt=m.some(e=>e.pin===`start`||e.pin===`end`),R=nt||A||!!j||M,z=+!!N+ +!!C,rt=nt?me([...N?[`lead`]:[],...C?[`lead`]:[],...m.map(e=>e.pin===`start`||e.pin===`end`?e.pin:null),...x?[null]:[]]):[],B=(e,t=``)=>{let n=rt[e];return n?{className:`${t.trim()} ${pe(n)}`.trim(),style:{[ie]:fe(n.side,n.ordinal)}}:{className:t,style:void 0}},V=(e,t)=>rt[e]?{...t,...B(e).style}:t,it=m.length-1+ +!!x;He&&!A&&g(`view-key`,"`viewKey` remembers resized widths: add `resizableColumns`."),M&&!I&&g(`virtual-height`,"`virtual` needs `maxHeight`: without a scroll box every row renders."),M&&(N||D)&&g(`virtual-shape`,"`virtual` takes rows of one height, so it is off with `renderExpanded` or `stackOnMobile`.");let H=M&&I&&!N&&!D&&!b&&h?.length>0,at=C&&h?h.reduce((e,t,n)=>e+ +!!w?.has(_(t,n)),0):0,ot=C&&h&&h.length>0&&at===h.length,st=at>0&&!ot,ct=e=>{e&&(e.indeterminate=st)},lt=u(null),ut=(e,t)=>{let n=lt.current;lt.current=e;let r=t&&n!==null?h.findIndex((e,t)=>_(e,t)===n):-1,i=h.findIndex((t,n)=>_(t,n)===e);if(r<0||i<0||r===i){Me?.(e);return}let a=!w?.has(e),o=h.slice(Math.min(r,i),Math.max(r,i)+1).map((e,t)=>_(e,Math.min(r,i)+t)).filter(e=>(w?.has(e)||!1)!==a);if(Pe)Pe(o,a);else for(let e of o)Me?.(e)},[U,dt]=d(()=>new Set),ft=e=>dt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),W=l(()=>{let e=(h||[]).map((e,t)=>({row:e,i:t}));return j?ue(e,({row:e})=>String(e[j]??``)).flatMap(e=>[{group:e,open:!U.has(e.key)},...U.has(e.key)?[]:e.items]):e},[h,j,U]),G=u(null),K=u(null);s(()=>{let e=G.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`);K.current=t?Number(t)-2:null},r=t=>{e.contains(t.relatedTarget)||(K.current=null)};e.addEventListener(`mouseover`,t),e.addEventListener(`focusin`,t),e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,r);let i=a(e);return()=>{e.removeEventListener(`mouseover`,t),e.removeEventListener(`focusin`,t),e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,r),i()}},[R]);let[pt,mt]=d({top:0,height:0}),[q,ht]=d(oe[T]??oe.comfortable);s(()=>{let e=G.current;if(!H||!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};mt(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)}},[H,R]),c(()=>{if(!H)return;let e=(G.current?.querySelector(`:scope > table > tbody > tr:not(.wui-virtual-spacer, .wui-group-row)`))?.getBoundingClientRect().height;e>0&&Math.abs(e-q)>.5&&ht(e)});let J={start:0,end:W.length,before:0,after:0};if(H){J=ye({scrollTop:pt.top,viewport:pt.height||Number.parseFloat(E)||0,rowHeight:q,count:W.length});let e=K.current;e!==null&&e>=0&&e<W.length&&(e<J.start&&J.start-e<=xe&&(J={...J,start:e,before:e*q}),e>=J.end&&e-J.end<xe&&(J={...J,end:e+1,after:(W.length-e-1)*q}))}let gt=u(null),Y=u(null),X=u(null),_t=!M&&!b&&h?.length>0&&h.length<=se;c(()=>{let e=gt.current;if(!_t||!e){Y.current=null,X.current=null;return}let t=h.map((e,t)=>_(e,t));ge(X.current,t)&&he(e.rows,Y.current),Y.current=de(e.rows),X.current=t});let vt=typeof We==`function`||typeof Ge==`function`,yt=e=>{let t=!!We?.(e),n=t?``:Ge?.(e)||``;return{state:t?`saving`:n?`error`:null,message:n}},bt=u(null),Z=u(null);s(()=>{if(!vt){Z.current=null;return}let e=m[0]?.key,t=new Map;(h||[]).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),{...yt(n),label:a})});let n=_e(ve(Z.current,t));Z.current=t,n&&bt.current&&(bt.current.textContent=n)});let xt=Ee!==void 0&&De>0?Ee:Te,St=({group:e,open:t},r)=>{let i=e.items[0].row[j],a=e.items.map(e=>e.row);return f(`tr`,{className:`wui-group-row`,"data-group-key":e.key,"aria-rowindex":H?r+2:void 0,children:f(`th`,{className:`wui-group-cell`,scope:`rowgroup`,colSpan:L,children:p(`button`,{type:`button`,className:`wui-group-toggle`,"aria-expanded":t,onClick:()=>ft(e.key),children:[f(n,{name:`chevron-down`,size:16}),f(`span`,{className:`wui-group-label`,children:Ue?Ue(i,a):Ce(i)}),f(`span`,{className:`wui-group-count`,"aria-hidden":`true`,children:le(e.items.length)}),f(`span`,{className:`visually-hidden wui-group-rows`,children:`, ${re.rows(e.items.length)}`})]})})},`group:${e.key}`)},Ct=({row:e,i:t},r)=>{let i=_(e,t),a=N&&Ye.has(i),s=Ve!=null&&String(Ve)===String(i),c=String(i).replace(/[^a-z0-9]/gi,`_`),l=B(0,`wui-expand-cell`),u=B(+!!N,`wui-select-cell`),d=vt?yt(e):null;return p(o,{children:[p(`tr`,{className:[C&&w?.has(i)?`is-selected`:``,P?`wui-row-link`:``,s?`wui-row-active`:``].filter(Boolean).join(` `)||void 0,"aria-current":s?`true`:void 0,"aria-rowindex":H?r+2:void 0,"aria-busy":d?.state===`saving`?`true`:void 0,"data-wui-save-state":d?.state||void 0,"data-status":Be?.(e)||void 0,"data-href":O?.(e)||void 0,tabIndex:P?0:void 0,onClick:P?t=>F(e,t):void 0,onAuxClick:P&&O?t=>t.button===1&&F(e,t):void 0,onKeyDown:P?t=>{t.key===`Enter`&&t.target===t.currentTarget&&F(e,t)}:void 0,children:[N&&f(`td`,{className:l.className,style:l.style,children:f(`button`,{type:`button`,className:`wui-expand-toggle${a?` is-open`:``}`,"aria-expanded":a,"aria-controls":a?`${c}-expanded`:void 0,"aria-label":a?`Collapse row`:`Expand row`,onClick:()=>Ze(i),children:f(n,{name:`chevron-down`,size:16})})}),C&&f(`td`,{className:u.className,style:u.style,children:f(`input`,{type:`checkbox`,className:`wui-check`,checked:w?.has(i)||!1,onChange:e=>ut(i,e.nativeEvent.shiftKey),onMouseDown:e=>{e.shiftKey&&e.preventDefault()},"aria-label":`Select row`})}),m.map((t,n)=>p(`td`,{className:B(z+n,(n===0?`wui-name-cell `:``)+(t.nowrap?`text-nowrap `:``)+Se(t.align)+(t.cellClassName?` ${t.cellClassName}`:``)).className,style:V(z+n,t.cellStyle),"data-label":D&&typeof t.label==`string`?t.label:void 0,children:[t.render?t.render(e):Ce(e[t.key]),n===0&&d?.state===`error`&&f(`span`,{className:ce,children:d.message})]},t.key)),x&&f(`td`,{children:f(`div`,{className:`u-row-actions`,children:x(e)})})]}),a&&f(`tr`,{className:`wui-row-expanded`,children:f(`td`,{id:`${c}-expanded`,colSpan:L,children:Fe(e)})})]},i)},wt=(e,t)=>e.group?St(e,t):Ct(e,t),Tt=(e,t)=>H?f(`tr`,{className:`wui-virtual-spacer`,"aria-hidden":`true`,hidden:t===0,children:f(`td`,{colSpan:L,style:{height:t}})},e):null,Q=B(0,`wui-expand-cell`),$=B(+!!N,`wui-select-cell`);return p(ee,{children:[p(R?`wui-data-table`:`div`,{ref:G,...R?{class:et,resizable:A?``:void 0,"view-key":He||void 0}:{className:et},style:tt,tabIndex:0,...Ke,children:[p(`table`,{className:Je,"aria-label":ke,"aria-rowcount":H?W.length+1:void 0,children:[f(`thead`,{children:p(`tr`,{"aria-rowindex":H?1:void 0,children:[N&&f(`th`,{className:Q.className,style:Q.style,children:f(`span`,{className:`visually-hidden`,children:`Expand`})}),C&&f(`th`,{className:$.className,style:$.style,children:f(`input`,{ref:ct,type:`checkbox`,className:`wui-check`,checked:ot,onChange:e=>Ne?.(e.target.checked),"aria-label":`Select all rows`})}),m.map((e,t)=>{let r=!!(e.sortable&&y),i=v&&v.key===e.key,a=e.align===`num`||e.align===`end`,o=r&&f(`span`,{className:`sort-icon${a?` wui-sort-lead`:``}`,children:f(n,{name:`chevrons-up-down`,size:14})}),s=A&&t!==it,c=e.width||e.minWidth?{width:e.width,minWidth:e.minWidth}:void 0;return p(`th`,{className:B(z+t,(r?`sortable `:``)+(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+(s?`wui-col-resizable `:``)+Se(e.align)).className,style:V(z+t,c),"data-key":R?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:r?0:void 0,"aria-sort":i?v.dir===`asc`?`ascending`:`descending`:r?`none`:void 0,onClick:r?()=>y(e.key):void 0,onKeyDown:r?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),y(e.key))}:void 0,children:[a&&o,e.label,!a&&o,s&&f(`span`,{className:`wui-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":ne,"aria-valuemax":te,tabIndex:0,"aria-label":re.resize(typeof e.label==`string`?e.label:e.key)})]},e.key)}),x&&(Oe?f(`th`,{className:`wui-cell-end`,children:Oe}):f(`th`,{className:`wui-cell-end`,children:f(`span`,{className:`visually-hidden`,children:`Actions`})}))]})}),f(`tbody`,{ref:gt,children:b?f(r,{rows:we,cols:L}):h?.length?p(ee,{children:[Tt(`before`,J.before),W.slice(J.start,J.end).map((e,t)=>wt(e,J.start+t)),Tt(`after`,J.after)]}):null}),Qe&&!b&&h?.length>0&&f(`tfoot`,{children:p(`tr`,{children:[N&&f(`td`,{className:Q.className,style:Q.style}),C&&f(`td`,{className:$.className,style:$.style}),m.map((e,t)=>f(`td`,{className:B(z+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+Se(e.align)).className,style:V(z+t,void 0),children:e.footer?e.footer(h):null},e.key)),x&&f(`td`,{})]})})]}),!b&&!h?.length&&f(`div`,{className:`tbl-empty-block`,children:typeof xt==`string`?f(`div`,{className:`tbl-empty-plain`,children:xt}):xt})]}),S&&S.total>0&&f(i,{page:S.page,totalPages:S.totalPages,pageSize:S.pageSize,onPageChange:S.setPage,onPageSizeChange:S.setPageSize,pageSizes:S.pageSizes,mode:S.mode}),vt&&f(`div`,{ref:bt,className:`visually-hidden`,role:`status`,"aria-live":`polite`,"data-wui-table-status":``})]})}export{_ as default};
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{AppSkeletonRows as r}from"./AppSkeleton.js";import i from"./AppTablePagination.js";import{attachScrollEdges as a}from"@webority/ui-elements/helpers";import{Fragment as o,useEffect as s,useLayoutEffect as c,useMemo as l,useRef as u,useState as d}from"react";import{Fragment as ee,jsx as f,jsxs as p}from"react/jsx-runtime";import{COLUMN_MAX_WIDTH as te,COLUMN_MIN_WIDTH as ne,DATA_TABLE_TEXT as re,PIN_AT_VAR as ie,PIN_SIDES as ae,ROW_HEIGHTS as oe,ROW_MOVE_LIMIT as se,ROW_SAVE_ERROR_CLASS as ce,groupCount as le,groupItems as ue,measureRows as de,pinAtValue as fe,pinClasses as pe,planPins as me,playRowMoves as he,rowOrderChanged as ge,saveOutcomeText as _e,settledRows as ve,virtualRange as ye}from"@webority/ui-elements/elements/data-table";var be=[`comfortable`,`cozy`,`compact`],m=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},h=new Set;function g(e,t){h.has(e)||!m()||(h.add(e),console.warn(`[@webority/ui-react] <AppDataTable> ${t}`))}var xe=100;function Se(e){return e===`end`?`wui-cell-end`:e===`num`?`num`:e===`center`?`text-center`:``}function Ce(e){return e==null||e===``?`-`:typeof e==`boolean`?String(e):e}function _({columns:m,rows:h,rowKey:_=e=>e.id,sort:v,onSort:y,loading:b=!1,skeletonRows:we=5,empty:Te=`No records found.`,emptyFiltered:Ee,sourceCount:De,rowActions:x,rowActionsLabel:Oe,pagination:S,ariaLabel:ke,className:Ae=``,wrapperClassName:je=``,selectable:C=!1,selectedIds:w,onToggleRow:Me,onToggleAll:Ne,onSelectRange:Pe,renderExpanded:Fe,density:T=`comfortable`,striped:Ie=!1,flush:Le=!1,maxHeight:E,stickyFirstColumn:Re=!1,stickyActions:ze=!1,stackOnMobile:D=!1,hiddenColumns:Be,rowStatus:Ve,rowHref:O,onRowClick:k,activeRowKey:He,resizableColumns:A=!1,viewKey:Ue,groupBy:j,groupLabel:We,virtual:M=!1,rowSaving:Ge,rowSaveError:Ke,...qe}){t(`AppDataTable`,qe);let Je=Be?.length?new Set(Be):null;m=Je?m.filter(e=>!(e.hideable&&Je.has(e.key))):m,e(`AppDataTable`,`density`,T,be);for(let t of m)e(`AppDataTable`,`column.pin`,t.pin,ae);let Ye=[`table table-ledger`,T===`cozy`||T===`compact`?`wui-table-${T}`:``,Ie?`wui-table-striped`:``,Re?`wui-table-sticky-first`:``,ze?`wui-table-sticky-actions`:``,D?`wui-table-stack`:``,Ae].filter(Boolean).join(` `),N=typeof Fe==`function`,[Xe,Ze]=d(()=>new Set),Qe=e=>Ze(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),$e=m.some(e=>typeof e.footer==`function`),P=typeof O==`function`||typeof k==`function`,et=e=>!!e.target.closest(`a, button, input, select, textarea, label, [role='menu'], [role='menuitem'], .dropdown`),F=(e,t)=>{if(et(t)||(k&&k(e),!O))return;let n=O(e);n&&(t.ctrlKey||t.metaKey||t.button===1?window.open(n,`_blank`,`noopener`):window.location.assign(n))},I=E!==void 0,tt=[`table-wrap`,I?`wui-table-scroll`:``,Le?`wui-table-flush`:``,je].filter(Boolean).join(` `),nt=I?{maxHeight:E}:void 0,L=Math.max(1,m.length+ +!!x+ +!!C+ +!!N),rt=m.some(e=>e.pin===`start`||e.pin===`end`),R=rt||A||!!j||M,z=+!!N+ +!!C,it=rt?me([...N?[`lead`]:[],...C?[`lead`]:[],...m.map(e=>e.pin===`start`||e.pin===`end`?e.pin:null),...x?[null]:[]]):[],B=(e,t=``)=>{let n=it[e];return n?{className:`${t.trim()} ${pe(n)}`.trim(),style:{[ie]:fe(n.side,n.ordinal)}}:{className:t,style:void 0}},V=(e,t)=>it[e]?{...t,...B(e).style}:t,at=m.length-1+ +!!x;Ue&&!A&&g(`view-key`,"`viewKey` remembers resized widths: add `resizableColumns`."),M&&!I&&g(`virtual-height`,"`virtual` needs `maxHeight`: without a scroll box every row renders."),M&&(N||D)&&g(`virtual-shape`,"`virtual` takes rows of one height, so it is off with `renderExpanded` or `stackOnMobile`.");let H=M&&I&&!N&&!D&&!b&&h?.length>0,ot=C&&h?h.reduce((e,t,n)=>e+ +!!w?.has(_(t,n)),0):0,st=C&&h&&h.length>0&&ot===h.length,ct=ot>0&&!st,lt=e=>{e&&(e.indeterminate=ct)},ut=u(null),dt=(e,t)=>{let n=ut.current;ut.current=e;let r=t&&n!==null?h.findIndex((e,t)=>_(e,t)===n):-1,i=h.findIndex((t,n)=>_(t,n)===e);if(r<0||i<0||r===i){Me?.(e);return}let a=!w?.has(e),o=h.slice(Math.min(r,i),Math.max(r,i)+1).map((e,t)=>_(e,Math.min(r,i)+t)).filter(e=>(w?.has(e)||!1)!==a);if(Pe)Pe(o,a);else for(let e of o)Me?.(e)},[U,ft]=d(()=>new Set),pt=e=>ft(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),W=l(()=>{let e=(h||[]).map((e,t)=>({row:e,i:t}));return j?ue(e,({row:e})=>String(e[j]??``)).flatMap(e=>[{group:e,open:!U.has(e.key)},...U.has(e.key)?[]:e.items]):e},[h,j,U]),G=u(null),K=u(null);s(()=>{let e=G.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`);K.current=t?Number(t)-2:null},r=t=>{e.contains(t.relatedTarget)||(K.current=null)};e.addEventListener(`mouseover`,t),e.addEventListener(`focusin`,t),e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,r);let i=a(e);return()=>{e.removeEventListener(`mouseover`,t),e.removeEventListener(`focusin`,t),e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,r),i()}},[R]);let[mt,ht]=d({top:0,height:0}),[q,gt]=d(oe[T]??oe.comfortable);s(()=>{let e=G.current;if(!H||!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};ht(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)}},[H,R]),c(()=>{if(!H)return;let e=(G.current?.querySelector(`:scope > table > tbody > tr:not(.wui-virtual-spacer, .wui-group-row)`))?.getBoundingClientRect().height;e>0&&Math.abs(e-q)>.5&>(e)});let J={start:0,end:W.length,before:0,after:0};if(H){J=ye({scrollTop:mt.top,viewport:mt.height||Number.parseFloat(E)||0,rowHeight:q,count:W.length});let e=K.current;e!==null&&e>=0&&e<W.length&&(e<J.start&&J.start-e<=xe&&(J={...J,start:e,before:e*q}),e>=J.end&&e-J.end<xe&&(J={...J,end:e+1,after:(W.length-e-1)*q}))}let _t=u(null),Y=u(null),X=u(null),vt=!M&&!b&&h?.length>0&&h.length<=se;c(()=>{let e=_t.current;if(!vt||!e){Y.current=null,X.current=null;return}let t=h.map((e,t)=>_(e,t));ge(X.current,t)&&he(e.rows,Y.current),Y.current=de(e.rows),X.current=t});let yt=typeof Ge==`function`||typeof Ke==`function`,bt=e=>{let t=!!Ge?.(e),n=t?``:Ke?.(e)||``;return{state:t?`saving`:n?`error`:null,message:n}},Z=u(null),xt=u(null);s(()=>{if(!yt){xt.current=null;return}let e=m[0]?.key,t=new Map;(h||[]).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),{...bt(n),label:a})});let n=_e(ve(xt.current,t));xt.current=t,n&&Z.current&&(Z.current.textContent=n)});let St=Ee!==void 0&&De>0?Ee:Te,Ct=({group:e,open:t},r)=>{let i=e.items[0].row[j],a=e.items.map(e=>e.row);return f(`tr`,{className:`wui-group-row`,"data-group-key":e.key,"aria-rowindex":H?r+2:void 0,children:f(`th`,{className:`wui-group-cell`,scope:`rowgroup`,colSpan:L,children:p(`button`,{type:`button`,className:`wui-group-toggle`,"aria-expanded":t,onClick:()=>pt(e.key),children:[f(n,{name:`chevron-down`,size:16}),f(`span`,{className:`wui-group-label`,children:We?We(i,a):Ce(i)}),f(`span`,{className:`wui-group-count`,"aria-hidden":`true`,children:le(e.items.length)}),f(`span`,{className:`visually-hidden wui-group-rows`,children:`, ${re.rows(e.items.length)}`})]})})},`group:${e.key}`)},wt=({row:e,i:t},r)=>{let i=_(e,t),a=N&&Xe.has(i),s=He!=null&&String(He)===String(i),c=String(i).replace(/[^a-z0-9]/gi,`_`),l=B(0,`wui-expand-cell`),u=B(+!!N,`wui-select-cell`),d=yt?bt(e):null;return p(o,{children:[p(`tr`,{className:[C&&w?.has(i)?`is-selected`:``,P?`wui-row-link`:``,s?`wui-row-active`:``].filter(Boolean).join(` `)||void 0,"aria-current":s?`true`:void 0,"aria-rowindex":H?r+2:void 0,"aria-busy":d?.state===`saving`?`true`:void 0,"data-wui-save-state":d?.state||void 0,"data-status":Ve?.(e)||void 0,"data-href":O?.(e)||void 0,tabIndex:P?0:void 0,onClick:P?t=>F(e,t):void 0,onAuxClick:P&&O?t=>t.button===1&&F(e,t):void 0,onKeyDown:P?t=>{t.key===`Enter`&&t.target===t.currentTarget&&F(e,t)}:void 0,children:[N&&f(`td`,{className:l.className,style:l.style,children:f(`button`,{type:`button`,className:`wui-expand-toggle${a?` is-open`:``}`,"aria-expanded":a,"aria-controls":a?`${c}-expanded`:void 0,"aria-label":a?`Collapse row`:`Expand row`,onClick:()=>Qe(i),children:f(n,{name:`chevron-down`,size:16})})}),C&&f(`td`,{className:u.className,style:u.style,children:f(`input`,{type:`checkbox`,className:`wui-check`,checked:w?.has(i)||!1,onChange:e=>dt(i,e.nativeEvent.shiftKey),onMouseDown:e=>{e.shiftKey&&e.preventDefault()},"aria-label":`Select row`})}),m.map((t,n)=>p(`td`,{className:B(z+n,(n===0?`wui-name-cell `:``)+(t.nowrap?`text-nowrap `:``)+Se(t.align)+(t.cellClassName?` ${t.cellClassName}`:``)).className,style:V(z+n,t.cellStyle),"data-label":D&&typeof t.label==`string`?t.label:void 0,children:[t.render?t.render(e):Ce(e[t.key]),n===0&&d?.state===`error`&&f(`span`,{className:ce,children:d.message})]},t.key)),x&&f(`td`,{children:f(`div`,{className:`u-row-actions`,children:x(e)})})]}),a&&f(`tr`,{className:`wui-row-expanded`,children:f(`td`,{id:`${c}-expanded`,colSpan:L,children:Fe(e)})})]},i)},Tt=(e,t)=>e.group?Ct(e,t):wt(e,t),Et=(e,t)=>H?f(`tr`,{className:`wui-virtual-spacer`,"aria-hidden":`true`,hidden:t===0,children:f(`td`,{colSpan:L,style:{height:t}})},e):null,Q=B(0,`wui-expand-cell`),$=B(+!!N,`wui-select-cell`);return p(ee,{children:[p(R?`wui-data-table`:`div`,{ref:G,...R?{class:tt,resizable:A?``:void 0,"view-key":Ue||void 0}:{className:tt},style:nt,tabIndex:0,...qe,children:[p(`table`,{className:Ye,"aria-label":ke,"aria-rowcount":H?W.length+1:void 0,children:[f(`thead`,{children:p(`tr`,{"aria-rowindex":H?1:void 0,children:[N&&f(`th`,{className:Q.className,style:Q.style,children:f(`span`,{className:`visually-hidden`,children:`Expand`})}),C&&f(`th`,{className:$.className,style:$.style,children:f(`input`,{ref:lt,type:`checkbox`,className:`wui-check`,checked:st,onChange:e=>Ne?.(e.target.checked),"aria-label":`Select all rows`})}),m.map((e,t)=>{let r=!!(e.sortable&&y),i=v&&v.key===e.key,a=e.align===`num`||e.align===`end`,o=r&&f(`span`,{className:`sort-icon${a?` wui-sort-lead`:``}`,children:f(n,{name:`chevrons-up-down`,size:14})}),s=A&&t!==at,c=e.width||e.minWidth?{width:e.width,minWidth:e.minWidth}:void 0;return p(`th`,{className:B(z+t,(r?`sortable `:``)+(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+(e.grow?`wui-col-grow `:``)+(s?`wui-col-resizable `:``)+Se(e.align)).className,style:V(z+t,c),"data-key":R?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:r?0:void 0,"aria-sort":i?v.dir===`asc`?`ascending`:`descending`:r?`none`:void 0,onClick:r?()=>y(e.key):void 0,onKeyDown:r?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),y(e.key))}:void 0,children:[a&&o,e.label,!a&&o,s&&f(`span`,{className:`wui-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":ne,"aria-valuemax":te,tabIndex:0,"aria-label":re.resize(typeof e.label==`string`?e.label:e.key)})]},e.key)}),x&&(Oe?f(`th`,{className:`wui-cell-end`,children:Oe}):f(`th`,{className:`wui-cell-end`,children:f(`span`,{className:`visually-hidden`,children:`Actions`})}))]})}),f(`tbody`,{ref:_t,children:b?f(r,{rows:we,cols:L}):h?.length?p(ee,{children:[Et(`before`,J.before),W.slice(J.start,J.end).map((e,t)=>Tt(e,J.start+t)),Et(`after`,J.after)]}):null}),$e&&!b&&h?.length>0&&f(`tfoot`,{children:p(`tr`,{children:[N&&f(`td`,{className:Q.className,style:Q.style}),C&&f(`td`,{className:$.className,style:$.style}),m.map((e,t)=>f(`td`,{className:B(z+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+Se(e.align)).className,style:V(z+t,void 0),children:e.footer?e.footer(h):null},e.key)),x&&f(`td`,{})]})})]}),!b&&!h?.length&&f(`div`,{className:`tbl-empty-block`,children:typeof St==`string`?f(`div`,{className:`tbl-empty-plain`,children:St}):St})]}),S&&S.total>0&&f(i,{page:S.page,totalPages:S.totalPages,pageSize:S.pageSize,onPageChange:S.setPage,onPageSizeChange:S.setPageSize,pageSizes:S.pageSizes,mode:S.mode}),yt&&f(`div`,{ref:Z,className:`visually-hidden`,role:`status`,"aria-live":`polite`,"data-wui-table-status":``})]})}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{isEmpty as n}from"../lib/emptyValue.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`sm`,`md`];function
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{isEmpty as n}from"../lib/emptyValue.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`sm`,`md`],o=[`grid`,`summary`];function s({items:s=[],columns:c=2,size:l=`md`,bordered:u=!1,layout:d=`grid`,title:f,className:p=``,...m}){return t(`AppDescriptions`,m),e(`AppDescriptions`,`size`,l,a),e(`AppDescriptions`,`layout`,d,o),i(`div`,{className:[`descs`,`descs-col-${c}`,l&&l!==`md`?`descs-${l}`:``,u?`descs-bordered`:``,d===`summary`?`wui-descs-summary`:``,p].filter(Boolean).join(` `)||void 0,...m,children:[f&&r(`div`,{className:`descs-title`,children:f}),r(`dl`,{className:`descs-list`,children:s.map((e,t)=>{let a=n(e.value),o=e.span??1,s=e.key??`${e.label}-${t}`;return i(`div`,{className:`descs-item${e.emphasis?` wui-descs-emphasis`:``}`,style:{"--descs-span":o},children:[r(`dt`,{className:`descs-label`,children:e.label}),r(`dd`,{className:`descs-value${a?` is-empty`:``}`,children:a?`-`:e.value})]},s)})})]})}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnUnknownProps.js";import{shortcutAria as
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{shortcutAria as n,shortcutChip as r}from"../lib/shortcutChip.js";import i from"./AppIcon.js";import a from"./renderIconProp.js";import{forwardRef as o,useEffect as s,useRef as c,useState as l}from"react";import{Dropdown as u}from"react-bootstrap";import{jsx as d,jsxs as f}from"react/jsx-runtime";var p=[`sm`,`md`,`lg`,`xl`],m=!1;function h(){let e=!0;try{e=process.env.NODE_ENV!==`production`}catch{e=!0}!e||m||(m=!0,console.warn("[@webority/ui-react] <AppDropdown> icon-only toggle has no accessible name — pass `label` or `ariaLabel`."))}function g({icon:i,iconSize:o,toggleClassName:m,label:g,ariaLabel:v,align:y=`end`,items:b=[],menuClassName:x=``,linkComponent:S,children:C,trigger:w,show:T,onToggle:E,...D}){t(`AppDropdown`,D);for(let t of b)e(`AppDropdown`,`items[].hiddenFrom`,t.hiddenFrom,p);!w&&!v&&!g&&h();let O=m??(w?`wui-dropdown-trigger`:`topbar-icon-btn`),k=T!==void 0,[A,j]=l(!1),M=k?!!T:A,N=c(null);N.current=(e,t)=>{k||j(e),E?.(e,t)};let P=c(null);return s(()=>{if(!M)return;let e=P.current?.getBoundingClientRect(),t=()=>{let t=P.current?.getBoundingClientRect();(!e||!t||Math.abs(t.top-e.top)>2||Math.abs(t.left-e.left)>2)&&N.current(!1,{source:`scroll`})},n=()=>N.current(!1,{source:`resize`});return window.addEventListener(`scroll`,t,{capture:!0,passive:!0}),window.addEventListener(`resize`,n),()=>{window.removeEventListener(`scroll`,t,{capture:!0}),window.removeEventListener(`resize`,n)}},[M]),f(u,{ref:P,align:y,show:M,onToggle:(e,t)=>N.current(e,t),...D,children:[d(u.Toggle,{as:_,icon:i,iconSize:o,btnClassName:O,trigger:w,title:g,"aria-label":v??(w?void 0:g)}),d(u.Menu,{className:x,renderOnMount:!0,popperConfig:{strategy:`fixed`},children:C??b.map(e=>{if(e.header!=null)return d(`div`,{className:`dropdown-header`,children:e.header},e.key);if(e.divider)return d(u.Divider,{},e.key);let t=e.to?S?{as:S,to:e.to}:{as:`a`,href:e.to}:{as:`button`,type:`button`},i=[e.danger&&`danger`,p.includes(e.hiddenFrom)&&`wui-hidden-from-${e.hiddenFrom}`].filter(Boolean).join(` `)||void 0;return f(u.Item,{...t,onClick:e.onClick,className:i,"aria-keyshortcuts":n(e.shortcut),children:[e.image?d(`img`,{src:e.image,alt:``}):a(e.icon,{size:16}),e.label,r(e.shortcut)]},e.key)})})]})}var _=o(function({icon:e,iconSize:t=20,btnClassName:n=`topbar-icon-btn`,trigger:r,"aria-label":a,className:o,...s},c){return d(`button`,{ref:c,type:`button`,className:n,"aria-label":a,...s,children:r??d(i,{name:e,size:t})})});export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./warnUnknownProps.js";import t from"./AppIcon.js";import{formatDate as n,toInstant as r}from"@webority/ui-elements/helpers";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=864e5,s=330*6e4,c=14,l=e=>Math.floor((e+s)/o),u=(...e)=>e.filter(Boolean).join(` `);function d({date:s,soonDays:d,overdue:f=!1,overdueLabel:p,className:m=``,...h}){e(`AppDueDate`,h);let g=r(s);if(!Number.isFinite(g))return i(`wui-due-date`,{class:u(`wui-due-date`,`wui-due-date-empty`,m),...h,children:i(`time`,{children:`Not set`})});let _=l(g),v=new Date(_*o).toISOString().slice(0,10),y=_-l(Date.now());if(f){let e=n(g);return a(`wui-due-date`,{class:u(`wui-due-date`,`wui-due-date-danger`,m),title:`Overdue since ${e}`,...h,children:[i(t,{name:`x`,size:c}),i(`time`,{dateTime:v,children:p||e})]})}if(Number.isFinite(d)&&y>=0&&y<=d){let e=y===1?`1 day left`:`${y} days left`;return i(`wui-due-date`,{class:u(`wui-due-date`,`wui-due-date-warning`,m),...h,children:i(`time`,{dateTime:v,children:e})})}return i(`wui-due-date`,{class:u(`wui-due-date`,m),...h,children:i(`time`,{dateTime:v,children:n(g)})})}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import r from"./AppButton.js";import i from"./AppSegmented.js";import a from"./AppChip.js";import o from"./AppDateRangePicker.js";import{emptyFacetValue as s,isFacetActive as c}from"../lib/listQuery.js";import l from"./AppMultiSelect.js";import u from"./AppSearch.js";import d from"./AppSelect.js";import{useEffect as
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import r from"./AppButton.js";import i from"./AppSegmented.js";import a from"./AppChip.js";import o from"./AppDateRangePicker.js";import{emptyFacetValue as s,isFacetActive as c}from"../lib/listQuery.js";import l from"./AppMultiSelect.js";import u from"./AppSearch.js";import d from"./AppSelect.js";import f from"./AppSwitch.js";import{useEffect as p,useId as m,useRef as h,useSyncExternalStore as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import"@webority/ui-elements/elements/filter-popover";var y=`(max-width: 575.98px)`,b=3,x=2,S=e=>{let t=window.matchMedia?.(y);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},C=()=>window.matchMedia?.(y).matches??!1,w=[`enum`,`multiEnum`,`dateRange`,`text`],T=4,E=e=>(e.type===`enum`||e.type===`multiEnum`)&&!e.options?.length,D=(e,t)=>e.options?.find(e=>e.value===t)?.label??t;function O(e,t){if(!c(e,t))return[];if(e.type===`enum`)return[{id:e.key,text:D(e,t),clear:()=>s(e)}];if(e.type===`multiEnum`)return t.map(n=>({id:`${e.key}:${n}`,text:D(e,n),clear:()=>t.filter(e=>e!==n)}));if(e.type===`dateRange`){let n=t.from&&t.to?`${t.from} to ${t.to}`:t.from?`From ${t.from}`:`Until ${t.to}`;return[{id:e.key,text:n,clear:()=>s(e)}]}return[]}var k=new Set;function A(e){let t=!0;try{t=process.env.NODE_ENV!==`production`}catch{t=!0}!t||k.has(e)||(k.add(e),console.warn(`[@webority/ui-react] <AppFilterBar> facet "${e}" sets allLabel, which only an enum facet uses.`))}function j({facets:i,value:o,onChange:l,inline:u=b,floating:d=!1,className:y=``,...T}){t(`AppFilterBar`,T);let D=g(S,C,()=>!1),k=h(null),j=m();for(let t of i)e(`AppFilterBar`,`facets[].type`,t.type,w);for(let e of i)e.allLabel!=null&&e.type!==`enum`&&A(e.key);let N=i.filter(e=>!E(e)),P=N.flatMap(e=>O(e,o[e.key]).map(t=>({...t,facet:e}))),F=N.filter(e=>c(e,o[e.key])),I=d||D?0:Math.max(0,u),L=N.slice(I),R=L.filter(e=>F.includes(e)).length,z=!d&&L.length>0;p(()=>{if(!z)return;let e=e=>{let t=k.current;t?.open&&(e.type===`keydown`?e.key===`Escape`:!e.composedPath().includes(t))&&(t.open=!1)};return document.addEventListener(`click`,e),document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`click`,e),document.removeEventListener(`keydown`,e)}},[z]);let B=e=>_(M,{facet:e,value:o[e.key],onChange:t=>l(e.key,t)},e.key),V=(e,t)=>t>0&&_(`span`,{className:e,children:` (${t})`}),H=e=>_(a,{size:`sm`,label:`${e.facet.label}: ${e.text}`,removeLabel:`Remove ${e.facet.label} filter ${e.text}`,onRemove:()=>l(e.facet.key,e.clear())},e.id),U=_(r,{variant:`ghost`,size:`sm`,onClick:()=>{for(let e of F)l(e.key,s(e))},children:`Clear all`});if(d){let e=P.slice(x);return v(`div`,{className:`wui-filter-bar d-flex flex-wrap align-items-center gap-2${y?` ${y}`:``}`,...T,children:[v(`wui-filter-popover`,{class:`wui-filter-popover`,children:[v(`button`,{type:`button`,className:`btn btn-outline-primary btn-sm wui-filter-popover-trigger`,"aria-expanded":`false`,"aria-controls":j,children:[_(n,{name:`filter`,size:14,className:`me-2`}),`Filters`,V(`wui-filter-popover-count`,F.length)]}),v(`div`,{id:j,className:`wui-filter-popover-panel`,role:`dialog`,"aria-label":`Filters`,hidden:!0,children:[_(`div`,{className:`wui-filter-popover-grid`,children:N.map(B)}),v(`div`,{className:`wui-filter-popover-foot`,children:[_(f,{label:`Keep open`,id:`${j}-pin`}),F.length>1&&U]})]})]}),P.slice(0,x).map(H),e.length>0&&v(`span`,{className:`chip chip-sm wui-filter-popover-more`,title:e.map(e=>`${e.facet.label}: ${e.text}`).join(`, `),children:[`+`,e.length]})]})}return v(`div`,{className:`wui-filter-bar d-flex flex-wrap align-items-center gap-2${D&&z?` wui-filter-bar--folded`:``}${y?` ${y}`:``}`,...T,children:[N.slice(0,I).map(B),z&&v(`details`,{ref:k,className:`wui-filter-more`,children:[v(`summary`,{className:`btn btn-outline-primary btn-sm wui-filter-more-trigger`,children:[_(n,{name:`filter`,size:14,className:`me-2`}),`Filters`,V(`wui-filter-count-desktop`,R),V(`wui-filter-count-phone`,F.length)]}),v(`div`,{className:`wui-filter-more-panel`,children:[_(`div`,{className:`wui-filter-more-head`,children:`Filters`}),L.map(B)]})]}),P.map(H),F.length>1&&U]})}function M({facet:e,value:t,onChange:n}){if(e.type===`enum`){let r=e.options??[];return r.length<T?_(i,{label:e.label,name:e.key,size:`sm`,value:t??``,onChange:n,options:[{value:``,label:e.allLabel||`All`},...r]}):_(d,{"aria-label":e.label,name:e.key,placeholder:e.label,size:`sm`,clearable:!0,value:t??``,onChange:n,options:r})}return e.type===`multiEnum`?_(l,{"aria-label":e.label,name:e.key,placeholder:e.label,size:`sm`,collapseChips:!0,values:t??[],onChange:n,options:e.options??[]}):e.type===`dateRange`?_(o,{ariaLabel:e.label,startName:`${e.key}From`,endName:`${e.key}To`,placeholder:e.label,size:`sm`,start:t?.from??``,end:t?.to??``,onChange:e=>n({from:e.start??``,to:e.end??``})}):_(u,{ariaLabel:e.label,name:e.key,placeholder:e.label,size:`sm`,value:t??``,onChange:n})}export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";var i=[`stacked`,`side`],a=[`top`,`start`],o=[`comfortable`,`compact`];function
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";var i=[`stacked`,`side`],a=[`top`,`start`],o=[`comfortable`,`compact`],s=[2,3,4];function c({children:c,title:l,description:u,layout:d=`stacked`,labels:f=`top`,density:p=`comfortable`,headingLevel:m=3,className:h=``,...g}){t(`AppFormSection`,g),e(`AppFormSection`,`layout`,d,i),e(`AppFormSection`,`labels`,f,a),e(`AppFormSection`,`density`,p,o),e(`AppFormSection`,`headingLevel`,m,s);let _=s.includes(m)?`h${m}`:`h3`;return r(`section`,{className:[`form-section`,d===`side`?`wui-form-side`:``,f===`start`?`wui-form-labels-start`:``,p===`compact`?`wui-form-compact`:``,h].filter(Boolean).join(` `),...g,children:[(l!=null||u!=null)&&r(`div`,{className:`form-section-head`,children:[l!=null&&n(_,{className:`form-section-title`,children:l}),u!=null&&n(`p`,{className:`form-section-desc`,children:u})]}),n(`div`,{className:`form-section-body`,children:c})]})}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{errorToast as r}from"./toast.js";import{formatValue as i}from"@webority/ui-elements/helpers";import{useEffect as a,useId as o,useMemo as s,useRef as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{KANBAN_SUMMARY_FORMATS as f,KANBAN_TEXT as p,KANBAN_TONES as m,kanbanOverflow as ee,kanbanSummaryFormat as h,kanbanVisibleLimit as
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{errorToast as r}from"./toast.js";import{formatValue as i}from"@webority/ui-elements/helpers";import{useEffect as a,useId as o,useMemo as s,useRef as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{KANBAN_SUMMARY_FORMATS as f,KANBAN_TEXT as p,KANBAN_TONES as m,kanbanOverflow as ee,kanbanSummaryFormat as h,kanbanVisibleLimit as te,sumKanbanValues as ne}from"@webority/ui-elements/elements/kanban";var g=e=>e.key??e.id,_=e=>e.column,v=[`rupees`,`paise`],re=[`inline`,`stacked`];function y({columns:y=[],cards:b=[],renderCard:ie,renderColumnActions:ae,getCardKey:x=g,getCardColumn:S=_,getCardValue:C,cardLabel:w,isCardLocked:T,onLocked:oe,onMove:se,accept:E,filter:D,boardId:O,ariaLabel:k=`Board`,emptyText:A=p.empty,readOnly:j=!1,swipeHint:ce=!1,fill:le=!1,columnWidth:M,fillOffset:N,activeCardKey:P,headLayout:F=`inline`,summaryFormat:I,summaryUnit:L,className:R=``,id:z,...B}){t(`AppKanban`,B),e(`AppKanban`,`summaryFormat`,I,f),e(`AppKanban`,`summaryUnit`,L,v),e(`AppKanban`,`headLayout`,F,re);for(let t of y)e(`AppKanban`,`columns[].tone`,t.tone,m);let V=o(),H=z||`kanban-${V.replace(/[^a-zA-Z0-9_-]/g,``)}`,U=c(null),[W,G]=l(()=>new Map),[K,q]=l(()=>new Set),[ue,J]=l(()=>new Set),de=s(()=>new Map(b.map(e=>[String(x(e)),e])),[b,x]),Y=c(null);Y.current={accept:E,onMove:se,onLocked:oe,byKey:de,columns:y};let X=I&&f.includes(I)&&(L==null||v.includes(L))?h(I,L):null,Z=s(()=>{let e=new Map(y.map(e=>[e.key,[]])),t=[];for(let n of b){let r=String(x(n)),i=W.get(r);i?t.push([n,i]):e.get(S(n))?.push(n)}for(let[n,r]of t){let t=e.get(r.to);t&&t.splice(Math.min(r.index,t.length),0,n)}return e},[y,b,W,x,S]);a(()=>{let e=U.current;if(!e)return;e.accept=(e,t,n)=>{let r=Y.current.accept;return!r||r(Y.current.byKey.get(e.getAttribute(`data-wui-card`)),t,n)};let t=e=>{let{key:t,from:n,to:i,index:a}=e.detail,o=Y.current.onMove,s=Y.current.byKey.get(t);if(!o||!s)return;let c=Y.current.columns.find(e=>e.key===i)?.visibleLimit!=null;c&&J(e=>new Set(e).add(t)),G(e=>new Map(e).set(t,{to:i,index:a}));let l=()=>G(e=>{let n=new Map(e);return n.delete(t),n}),u;try{u=o({card:s,key:t,from:n,to:i,index:a})}catch(e){u=Promise.reject(e)}Promise.resolve(u).then(l,e=>{l(),c&&J(e=>{let n=new Set(e);return n.delete(t),n}),r(e?.message||p.failed.server)})},n=e=>{let{key:t,reason:n}=e.detail,r=Y.current.byKey.get(t);r&&Y.current.onLocked?.({card:r,key:t,reason:n})};return e.addEventListener(`wui:kanban:move`,t),e.addEventListener(`wui:kanban:locked`,n),()=>{e.removeEventListener(`wui:kanban:move`,t),e.removeEventListener(`wui:kanban:locked`,n),e.accept=void 0}},[]);let Q=e=>!D||D(e)!==!1,fe=(e,t)=>{K.has(e)&&J(e=>{let n=new Set(e);for(let e of t)n.delete(String(x(e)));return n}),q(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},$={};return M!=null&&($[`--wui-kanban-column-width`]=`${M}px`),N!=null&&($[`--wui-kanban-fill-offset`]=`${N}px`),d(`wui-kanban`,{ref:U,id:H,class:R?`wui-kanban ${R}`:`wui-kanban`,role:`region`,"aria-label":k,"board-id":O||void 0,"summary-format":X?I:void 0,"summary-unit":X&&L?L:void 0,readonly:j?``:void 0,fill:le?``:void 0,"data-head-layout":F===`stacked`?`stacked`:void 0,style:$,controlled:``,...B,children:[u(`nav`,{className:`wui-kanban-switcher`,"aria-label":`Board columns`,children:y.map((e,t)=>d(`button`,{type:`button`,className:`wui-kanban-switch`,"data-wui-switch":e.key,"aria-controls":`${H}-${e.key}`,"aria-current":t===0?`true`:void 0,children:[u(`span`,{className:`wui-kanban-switch-title`,children:e.title}),u(`span`,{className:`wui-kanban-count`,"data-wui-count":``,children:(Z.get(e.key)||[]).filter(Q).length})]},e.key))}),ce&&d(`p`,{className:`wui-kanban-hint`,"aria-hidden":`true`,children:[u(n,{name:`arrow-swap-horizontal`,size:14}),p.swipeHint]}),u(`div`,{className:`wui-kanban-board`,"data-wui-scroller":``,children:y.map(e=>{let t=`${H}-${e.key}`,r=Z.get(e.key)||[],a=r.filter(Q),o=!!(e.collapsible&&e.collapsed),s=te(e.visibleLimit),c=K.has(e.key),l=ee(a.map(e=>String(x(e))),s,c,ue),f=typeof e.summary==`function`?e.summary(a):e.summary;X&&(f=i(ne(a.map(e=>C?.(e))),X));let h=ae?.(e,a);return d(`section`,{className:`wui-kanban-column`,id:t,"data-wui-column":e.key,"data-tone":e.tone&&m.includes(e.tone)?e.tone:`neutral`,"aria-labelledby":`${t}-title`,"data-accept-from":e.acceptFrom?e.acceptFrom.join(` `):void 0,"data-collapsible":e.collapsible?``:void 0,"data-collapsed":o?``:void 0,children:[d(`header`,{className:`wui-kanban-head`,children:[u(`span`,{className:`wui-kanban-dot`,"aria-hidden":`true`}),u(`h2`,{className:`wui-kanban-title`,id:`${t}-title`,children:e.href?u(`a`,{href:e.href,children:e.title}):e.title}),u(`span`,{className:`wui-kanban-count`,"data-wui-count":``,children:a.length}),e.collapsible&&u(`span`,{className:`wui-kanban-lock`,"aria-hidden":`true`,children:u(n,{name:`lock`,size:14})}),h!=null&&h!==!1&&u(`div`,{className:`wui-kanban-actions`,"data-wui-no-drag":``,children:h}),e.collapsible&&u(`button`,{type:`button`,className:`wui-kanban-collapse`,"data-wui-collapse":``,"aria-expanded":o?`false`:`true`,"aria-controls":`${t}-body`,"aria-label":o?p.expand(e.title):p.collapse(e.title),children:u(n,{name:`chevron-left`,size:16})}),f!=null&&u(`div`,{className:`wui-kanban-summary`,"data-wui-summary":``,children:f})]}),u(`p`,{className:`wui-kanban-drop-note`,"data-wui-drop-note":``,hidden:!0}),u(`div`,{className:`wui-kanban-body`,id:`${t}-body`,"data-wui-body":``,children:r.map(e=>{let t=String(x(e)),n=W.has(t);return u(`article`,{className:`wui-kanban-card`,"data-wui-card":t,tabIndex:0,"aria-label":w?w(e):void 0,"data-wui-locked":T?.(e)?``:void 0,"data-wui-value":C?C(e)??void 0:void 0,"aria-current":P!=null&&t===String(P)?`true`:void 0,"aria-busy":n?`true`:void 0,"data-wui-saving":n?``:void 0,"data-wui-overflow":l.has(t)?``:void 0,hidden:!Q(e),children:ie?.(e)},t)})}),s!=null&&u(`button`,{type:`button`,className:`wui-kanban-more`,"data-wui-more":``,"aria-controls":`${t}-body`,"aria-expanded":c?`true`:`false`,hidden:c?a.length<=s:l.size===0,onClick:()=>fe(e.key,r),children:c?p.fewer:p.more(l.size)}),u(`p`,{className:`wui-kanban-empty`,"data-wui-empty":``,hidden:a.length>0,children:e.emptyText??A})]},e.key)})}),u(`p`,{className:`visually-hidden`,id:`${H}-help`,"data-wui-help":``,children:p.help}),u(`div`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}export{y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{Fragment as n,jsx as r,jsxs as i}from"react/jsx-runtime";var a=[3,4,5],o=[`sm`,`md`],s=[`neutral`,`success`,`warning`,`danger`,`info`];function c({items:c=[],columns:l=4,size:u=`md`,className:d=``,...f}){return t(`AppMetricStrip`,f),e(`AppMetricStrip`,`columns`,l,a),e(`AppMetricStrip`,`size`,u,o),r(`div`,{className:[`wui-metric-strip`,`wui-metric-strip-cols-${l}`,u===`sm`?`wui-metric-strip-sm`:``,d].filter(Boolean).join(` `),...f,children:c.map((t,a)=>{e(`AppMetricStrip`,`tone`,t.tone,s);let o=`wui-metric${t.tone&&t.tone!==`neutral`?` wui-metric-tone-${t.tone}`:``}`,c=i(n,{children:[r(`div`,{className:`wui-metric-label`,children:t.label}),r(`div`,{className:`wui-metric-value`,children:t.value}),t.note&&r(`div`,{className:`wui-metric-note`,children:t.note})]}),l=`${t.label}-${a}`;return t.href?r(`a`,{href:t.href,className:o,children:c},l):r(`div`,{className:o,children:c},l)})})}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`primary`,`success`,`warning`,`danger`,`info`],o=[`sm`,`md`,`lg`],s=[`start`,`center`],c=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`primary`,`success`,`warning`,`danger`,`info`],o=[`sm`,`md`,`lg`,`bar`],s=[`start`,`center`],c=[`inline`,`below`],l=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function u({title:u,as:d=`h1`,subtitle:f,eyebrow:p,icon:m,tone:h=`primary`,status:g,breadcrumbs:_,actions:v,views:y,tools:b,meta:x,metaPlacement:S=`inline`,bulkFor:C,bulk:w,size:T=`md`,align:E=`start`,divider:D=!1,sticky:O=!1,className:k=``,...A}){t(`AppPageHeader`,A),e(`AppPageHeader`,`tone`,h,a),e(`AppPageHeader`,`size`,T,o),e(`AppPageHeader`,`align`,E,s),e(`AppPageHeader`,`as`,d,l),e(`AppPageHeader`,`metaPlacement`,S,c);let j=l.includes(d)?d:`h1`,M=T===`bar`,N=M&&S===`below`,P=[`page-header`,T&&T!==`md`?`page-header-${T}`:``,E===`center`?`page-header-center`:``,D?`page-header-divider`:``,O?`page-header-sticky`:``,h&&h!==`primary`?`tone-${h}`:``,N?`wui-page-header-meta-below`:``,k].filter(Boolean).join(` `);if(M)return i(`header`,{className:P,"data-wui-page-header-bar":``,"data-wui-bulk-for":C||void 0,...A,children:[_!=null&&r(`div`,{className:`page-header-bar-crumbs`,children:_}),u!=null&&r(j,{className:`page-title`,children:u}),g!=null&&r(`span`,{className:`page-status`,children:g}),y!=null&&r(`div`,{className:`page-header-bar-views`,"data-wui-bar-swap":``,children:y}),x!=null&&!N&&r(`div`,{className:`page-header-bar-meta`,children:x}),b!=null&&r(`div`,{className:`page-header-bar-tools`,"data-wui-bar-swap":``,children:b}),C?r(`div`,{className:`page-header-bar-bulk`,"data-wui-bar-bulk":``,hidden:!0,children:w}):null,v!=null&&r(`div`,{className:`page-actions`,children:v}),x!=null&&N&&r(`div`,{className:`page-header-bar-meta`,children:x})]});let F=m==null?null:typeof m==`string`?r(n,{name:m,size:20}):m;return i(`div`,{className:P,...A,children:[_!=null&&r(`div`,{className:`page-breadcrumbs`,children:_}),i(`div`,{className:`page-header-bar`,children:[i(`div`,{className:`page-header-lead`,children:[F!=null&&r(`span`,{className:`page-header-icon`,children:F}),i(`div`,{className:`page-header-titles`,children:[p!=null&&r(`div`,{className:`page-eyebrow`,children:p}),i(`div`,{className:`page-titlebar`,children:[u!=null&&r(j,{className:`page-title`,children:u}),g!=null&&r(`span`,{className:`page-status`,children:g})]}),f!=null&&r(`div`,{className:`page-subtitle`,children:f})]})]}),v!=null&&r(`div`,{className:`page-actions`,children:v})]})]})}export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useId as e}from"react";import{jsx as t,jsxs as n}from"react/jsx-runtime";function r({value:r=null,onChange:i,min:a=0,max:o=10,label:s,lowLabel:c,highLabel:l,name:u,disabled:d=!1,error:f,hint:p,id:m,className:h=``,fieldClassName:g=``}){let _=e(),v=m||_,y=u||v,b=`${v}-error`,x=`${v}-hint`,S=Array.from({length:Math.max(0,o-a+1)},(e,t)=>a+t),C=c!=null||l!=null;return n(`div`,{className:`field${g?` ${g}`:``}`,children:[s!=null&&t(`span`,{className:`label`,id:`${v}-label`,children:s}),n(`div`,{className:`wui-score-scale${h?` ${h}`:``}`,id:v,role:`radiogroup`,"aria-labelledby":s==null?void 0:`${v}-label`,"aria-label":s==null?`Score`:void 0,"aria-invalid":f?`true`:void 0,"aria-describedby":f?b:p?x:void 0,children:[S.map(e=>n(`label`,{className:`wui-score-scale__item${r===e?` wui-score-scale__item--selected`:``}`,children:[t(`input`,{type:`radio`,className:`visually-hidden`,name:y,value:e,checked:r===e,disabled:d,onChange:()=>i?.(e)}),e]},e)),C&&n(`span`,{className:`wui-score-scale__ends`,children:[t(`span`,{children:c}),t(`span`,{children:l})]})]}),f?t(`div`,{className:`field-error`,id:b,children:f}):p?t(`div`,{className:`field-hint`,id:x,children:p}):null]})}export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{useEffect as r,useId as i,useLayoutEffect as a,useRef as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l={sm:`segmented-sm`,md:``,lg:`segmented-lg`,xl:`wui-segmented-xl`};function u({options:u=[],value:d,onChange:f,label:p,name:m,size:h=`md`,fullWidth:g=!1,bordered:_=!0,disabled:v=!1,className:
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{useEffect as r,useId as i,useLayoutEffect as a,useRef as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l={sm:`segmented-sm`,md:``,lg:`segmented-lg`,xl:`wui-segmented-xl`};function u({options:u=[],value:d,onChange:f,label:p,name:m,size:h=`md`,fullWidth:g=!1,bordered:_=!0,disabled:v=!1,labelVisible:y=!1,className:b=``,...x}){t(`AppSegmented`,x),e(`AppSegmented`,`size`,h,Object.keys(l));let S=i(),C=m||S,w=o(null),T=o(null),E=[`segmented`,l[h]??``,g?`segmented-full`:``,_?``:`wui-segmented-borderless`,v?`is-disabled`:``,b].filter(Boolean).join(` `);a(()=>{let e=w.current,t=T.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(()=>w.current?.classList.add(`is-animated`))};n(!0);let r=typeof ResizeObserver<`u`?new ResizeObserver(()=>n(!1)):null;return r?.observe(e),()=>r?.disconnect()},[d,u,h,g,y]),r(()=>{let e=requestAnimationFrame(()=>w.current?.classList.add(`is-animated`));return()=>cancelAnimationFrame(e)},[]);let D=c(`div`,{ref:w,className:E,role:`radiogroup`,"aria-label":p,"aria-disabled":v||void 0,...x,children:[s(`span`,{className:`segmented-thumb`,ref:T,"aria-hidden":`true`}),u.map(e=>c(`label`,{className:`segmented-option`,children:[s(`input`,{type:`radio`,className:`segmented-input`,name:C,value:e.value,checked:e.value===d,disabled:v||e.disabled,onChange:()=>f?.(e.value)}),e.icon&&s(n,{name:e.icon,size:13}),e.note?c(`span`,{className:`segmented-option-text`,children:[s(`span`,{className:`segmented-option-label`,children:e.label}),s(`span`,{className:`segmented-option-note`,children:e.note})]}):e.label,e.count!=null&&s(`span`,{className:`wui-segmented-option-count`,children:e.count})]},e.value))]});return!y||!p?D:c(`div`,{className:`field`,children:[s(`span`,{className:`label`,"aria-hidden":`true`,children:p}),D]})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import r from"./AppAvatar.js";import{navMatchScore as i}from"../lib/navMatch.js";import{readShellCollapsed as a,writeShellCollapsed as o}from"../lib/shellCookie.js";import{initScrollEdges as s}from"@webority/ui-elements/helpers";import{useEffect as c,useId as l,useMemo as u,useRef as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";var g=99,_=4,v=5,y=[`prefix`,`exact`],b=e=>e>g?`${g}+`:String(e);function x({groups:e=[],brand:r,sidebarStart:i,sidebarStartCompact:l,sidebarFooter:p,topbarStart:g,topbarEnd:_,footer:v,children:y,collapsed:b,onCollapsedChange:x,noSidebar:T=!1,navLabel:D=`Main navigation`,linkComponent:A,currentPath:M,rememberCollapsed:N=!1,collapsedCookie:P=`wui-shell-collapsed`,tabBarLabel:F=`Quick navigation`,moreLabel:I=`More`,userMenu:L,notifications:R,search:z,className:B=``,...V}){t(`AppShell`,V);let[H,U]=f(()=>N&&b===void 0&&typeof document<`u`?a(P)??!1:!1),[W,G]=f(!1),[K,q]=f(!1),J=d(null),Y=b??H,X=()=>{let e=!Y;b===void 0&&U(e),N&&o(e,P),x?.(e)},Z=u(()=>S(e,M),[e,M]),Q=T?null:C(Z);return c(()=>{let e=()=>q(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),c(()=>{s()},[]),c(()=>{let e=J.current,t=e?.querySelector(`.app-nav-item[aria-current="page"]`);if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.top<r.top?e.scrollTop-=r.top-n.top:n.bottom>r.bottom&&(e.scrollTop+=n.bottom-r.bottom)},[]),c(()=>{if(!W)return;let e=e=>{e.key===`Escape`&&G(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[W]),h(`div`,{className:[`app-shell`,Y?`collapsed`:``,T?`no-sidebar`:``,W?`mobile-open`:``,B].filter(Boolean).join(` `),...V,children:[h(`aside`,{className:`app-sidebar`,children:[r&&m(`div`,{className:`app-sidebar-brand`,children:r}),i&&m(`div`,{className:`app-sidebar-start`,children:i}),l&&m(`div`,{className:`app-sidebar-start-compact`,children:l}),m(`nav`,{className:`app-sidebar-scroll`,"aria-label":D,ref:J,children:Z.map((e,t)=>h(`div`,{className:`app-nav-group`,children:[e.label&&m(`div`,{className:`app-nav-group-label`,children:e.label}),e.items.map(e=>m(E,{item:e,linkComponent:A,onNavigate:()=>G(!1)},e.key??e.href??e.label)),e.after&&m(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.label??`group-${t}`))}),p&&m(`div`,{className:`app-sidebar-foot`,children:p}),!T&&m(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:X,"aria-label":Y?`Expand navigation`:`Collapse navigation`,"aria-expanded":!Y,children:m(n,{name:`chevrons-left`,size:20})})]}),h(`div`,{className:`app-main`,children:[h(`header`,{className:`app-topbar${K?` scrolled`:``}`,children:[h(`div`,{className:`app-topbar-start`,children:[m(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>G(!0),"aria-label":`Open navigation`,"aria-expanded":W,children:m(n,{name:`menu`,size:18})}),g,z&&m(j,{config:z})]}),h(`div`,{className:`app-topbar-end`,children:[_,R&&m(k,{config:R}),L&&m(O,{config:L,linkComponent:A})]})]}),m(`main`,{className:`app-content`,children:y}),v&&m(`footer`,{className:`app-footer`,children:v})]}),Q&&h(`nav`,{className:`wui-tabbar`,"aria-label":F,children:[Q.tabs.map(e=>m(w,{tab:e,linkComponent:A},e.key??e.href)),Q.hasMore&&h(`button`,{type:`button`,className:`wui-tabbar-item${Q.moreActive?` active`:``}`,onClick:()=>G(!0),children:[m(`span`,{className:`wui-tabbar-icon`,children:m(n,{name:`more`,size:24})}),m(`span`,{className:`wui-tabbar-label`,children:I})]})]}),m(`button`,{type:`button`,className:`app-scrim`,onClick:()=>G(!1),"aria-label":`Close navigation`,tabIndex:W?0:-1})]})}function S(t,n){let r=e=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:r(e.children)}:{...e}).filter(e=>(e.children?.length??0)>0||!!e.href),a=t.map(e=>({...e,items:r(e.items)})).filter(e=>e.items.length>0),o=[],s=e=>{for(let t of e)o.push(t),t.children&&s(t.children)};for(let e of a)s(e.items);for(let t of o)e(`AppShell`,`match`,t.match,y);let c=null;if(n!=null&&!o.some(e=>e.active===!0)){let e=-1;for(let t of o){if(t.active!=null||t.children?.length)continue;let r=i(n,t.href,{exact:t.match===`exact`,also:t.matchAlso});r>e&&(e=r,c=t)}}for(let e of o)e.active=e.active??e===c;return a}function C(e){let t=[],n=e=>{for(let r of e)r.children?.length?n(r.children):t.push(r)};for(let t of e)n(t.items);let r=t.filter(e=>e.tab);if(r.length===0)return null;let i=r.length<t.length,a=i?_:v;if(r.length>a)throw Error(`<AppShell>: ${r.length} items carry tab: true, but the phone tab bar holds ${a} (${i?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:r,hasMore:i,moreActive:t.some(e=>!e.tab&&e.active)}}function w({tab:e,linkComponent:t}){let r=`wui-tabbar-item${e.active?` active`:``}`,i=h(p,{children:[e.icon&&m(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?m(n,{name:e.icon,size:24}):e.icon}),m(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&m(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,children:e.badge})]}),a=e.active?`page`:void 0;return t?m(t,{className:r,to:e.href,"aria-current":a,children:i}):m(`a`,{className:r,href:e.href,"aria-current":a,children:i})}function T(e){for(let t of e){if(t.active)return t;let e=t.children?.length?T(t.children):void 0;if(e)return e}}function E({item:e,linkComponent:t,onNavigate:r,depth:i=0}){let a=i>0,o=i>1?{"--wui-nav-depth":i}:void 0,s=Array.isArray(e.children)&&e.children.length>0,l=s?T(e.children):void 0,u=!!l,d=l?l.key??l.href??l.label:null,[g,_]=f(u);c(()=>{d!=null&&_(!0)},[d]);let v=typeof e.label==`string`?e.label:void 0,y=!a&&e.icon&&m(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?m(n,{name:e.icon,size:22}):e.icon}),b=e.badge!=null&&m(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,children:e.badge});if(s)return h(p,{children:[h(`button`,{type:`button`,className:`app-nav-item${a?` app-nav-subitem`:``} has-children${u?` active`:``}`,style:o,"aria-expanded":g,"data-label":v,onClick:()=>_(e=>!e),children:[y,m(`span`,{className:`app-nav-text`,children:e.label}),b,m(`span`,{className:`app-nav-caret`,children:m(n,{name:`chevron-right`,size:16})})]}),m(`div`,{className:`app-nav-sub${g?` expanded`:``}`,inert:!g,"aria-hidden":!g||void 0,children:m(`div`,{className:`app-nav-sub-inner`,children:e.children.map(e=>m(E,{item:e,linkComponent:t,onNavigate:r,depth:i+1},e.key??e.href))})})]});let x=`app-nav-item${a?` app-nav-subitem`:``}${e.active?` active`:``}`,S=h(p,{children:[y,m(`span`,{className:`app-nav-text`,children:e.label}),b,e.trailingIcon&&m(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?m(n,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),C=e.active?`page`:void 0;return t?m(t,{className:x,style:o,to:e.href,"aria-current":C,"data-label":v,onClick:r,children:S}):m(`a`,{className:x,style:o,href:e.href,"aria-current":C,"data-label":v,onClick:r,children:S})}function D(){let[e,t]=f(!1),n=d(null);return c(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target)||t(!1)},i=e=>{e.key===`Escape`&&(t(!1),n.current?.querySelector(`button`)?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]),{open:e,setOpen:t,ref:n}}function O({config:e,linkComponent:t}){let i=l(),{open:a,setOpen:o,ref:s}=D(),{name:c,role:u,photo:d,profileHref:f,profileLabel:g=`My profile`,onLogout:_,logoutAction:v,logoutLabel:y=`Sign out`,items:b=[]}=e;if(!c)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let x=()=>o(!1),S=(e,n,r,i)=>t?m(t,{className:`dropdown-item`,to:e,onClick:i,children:n},r):m(`a`,{className:`dropdown-item`,href:e,onClick:i,children:n},r),C=h(p,{children:[m(n,{name:`log-out`,size:18}),y]});return h(`div`,{className:`dropdown wui-usermenu`,ref:s,children:[h(`button`,{type:`button`,id:i,className:`wui-usermenu-trigger`,"aria-expanded":a,"aria-label":`Account menu for ${c}`,onClick:()=>o(e=>!e),children:[m(r,{name:c,src:d,tone:`auto`}),h(`span`,{className:`wui-usermenu-text`,children:[m(`span`,{className:`wui-usermenu-name`,children:c}),u&&m(`span`,{className:`wui-usermenu-role`,children:u})]}),m(n,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),h(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${a?` show`:``}`,"aria-labelledby":i,"data-bs-popper":a?`static`:void 0,children:[h(`div`,{className:`wui-usermenu-head`,children:[m(r,{name:c,src:d,size:`lg`,tone:`auto`}),h(`div`,{className:`wui-usermenu-who`,children:[m(`div`,{className:`wui-usermenu-name`,children:c}),u&&m(`div`,{className:`wui-usermenu-role`,children:u})]})]}),f&&S(f,h(p,{children:[m(n,{name:`user`,size:18}),g]}),void 0,x),b.map(e=>{if(e.divider)return m(`hr`,{className:`dropdown-divider`},e.key);let t=h(p,{children:[e.icon&&m(n,{name:e.icon,size:18}),e.label]}),r=()=>{e.onClick?.(),x()};return e.href?S(e.href,t,e.key,r):m(`button`,{type:`button`,className:`dropdown-item`,onClick:r,children:t},e.key)}),v?m(`form`,{method:`post`,action:v,className:`wui-usermenu-logout`,children:m(`button`,{type:`submit`,className:`dropdown-item danger`,children:C})}):_&&m(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{x(),_()},children:C})]})]})}function k({config:e}){let t=l(),{open:r,setOpen:i,ref:a}=D(),{unread:o=0,items:s,loading:u=!1,onOpen:g,onMarkAllRead:_,viewAllHref:v,label:y=`Notifications`,emptyText:x=`You are all caught up.`}=e,[S,C]=f(``),w=d(o);c(()=>{w.current!==o&&(w.current=o,C(o===0?`No unread notifications`:`${b(o)} unread notifications`))},[o]);let T=null;return s?.length?T=m(`div`,{className:`wui-bell-items`,children:s.map((e,t)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=h(p,{children:[m(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&m(`span`,{className:`wui-bell-icon`,children:m(n,{name:e.icon,size:18})}),h(`span`,{className:`wui-bell-body`,children:[!e.read&&m(`span`,{className:`visually-hidden`,children:`Unread: `}),m(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&m(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?m(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??t):m(`div`,{className:r,"data-id":e.id,children:i},e.id??t)})}):u?T=m(`div`,{className:`wui-bell-state`,children:`Loading…`}):s&&(T=m(`div`,{className:`wui-bell-state`,children:x})),h(`div`,{className:`dropdown wui-bell`,ref:a,children:[h(`button`,{type:`button`,id:t,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":r,"aria-label":o===0?y:`${y}, ${b(o)} unread`,onClick:()=>{let e=!r;i(e),e&&g?.()},children:[m(n,{name:`notification`,size:20}),m(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:o===0,children:b(o)})]}),m(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:S}),h(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${r?` show`:``}`,"aria-labelledby":t,"data-bs-popper":r?`static`:void 0,children:[h(`div`,{className:`wui-bell-head`,children:[m(`span`,{className:`wui-bell-title`,children:y}),_&&m(`button`,{type:`button`,className:`wui-bell-markall`,onClick:_,children:`Mark all read`})]}),m(`div`,{className:`wui-bell-list`,"aria-busy":u||void 0,children:T}),v&&m(`a`,{className:`wui-bell-foot`,href:v,children:`View all`})]})]})}var A=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function j({config:e}){let t=l(),{value:r=``,onChange:i,results:a=null,loading:o=!1,onSelect:s,onSubmit:p,placeholder:g=`Search`}=e,[_,v]=f(!1),[y,b]=f(!1),[x,S]=f({results:null,index:-1}),C=x.results===a?x.index:-1,w=e=>S({results:a,index:e}),T=d(null),E=d(null),D=d([]),O=u(()=>(a??[]).flatMap(e=>e.hits??[]),[a]),k=a!=null&&!y,j=O.length;c(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||A(e.target)||(e.preventDefault(),v(!0),E.current?.focus())},t=e=>{T.current?.contains(e.target)||(b(!0),v(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let M=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!k||j===0)return;e.preventDefault(),w((C+(e.key===`ArrowDown`?1:-1)+j)%j)}else e.key===`Enter`?k&&C>=0&&D.current[C]?(e.preventDefault(),D.current[C].click()):p&&r.trim()!==``&&(e.preventDefault(),p(r.trim())):e.key===`Escape`&&(k?(e.preventDefault(),b(!0)):_&&(e.preventDefault(),v(!1)))},N=-1;return D.current=[],h(`div`,{className:`wui-topsearch${_?` is-open`:``}${o?` is-loading`:``}`,ref:T,children:[m(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":g,"aria-expanded":_,"aria-controls":`${t}-panel`,onClick:()=>{let e=!_;v(e),e&&E.current?.focus()},children:m(n,{name:`search`,size:20})}),h(`div`,{className:`wui-topsearch-panel`,id:`${t}-panel`,children:[h(`div`,{className:`search-wrap`,children:[m(n,{name:`search`,size:18,className:`search-icon`}),m(`input`,{ref:E,type:`search`,className:`form-control input search-input`,id:`${t}-input`,placeholder:g,"aria-label":g,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":k,"aria-controls":`${t}-list`,"aria-activedescendant":k&&C>=0?`${t}-opt-${C}`:void 0,autoComplete:`off`,value:r,onChange:e=>{b(!1),i?.(e.target.value)},onKeyDown:M})]}),m(`div`,{className:`wui-topsearch-results`,id:`${t}-list`,role:`listbox`,"aria-label":`Search results`,hidden:!k,children:k&&h(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[j===0&&h(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:[`No results for “`,r,`”`]}),a.filter(e=>e.hits?.length).map((e,r)=>h(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&m(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{N+=1;let r=N;return h(`a`,{className:`wui-topsearch-hit${r===C?` is-active`:``}`,role:`option`,"aria-selected":r===C,id:`${t}-opt-${r}`,href:e.href,ref:e=>{D.current[r]=e},onClick:t=>s?.(e,t),children:[e.icon&&m(`span`,{className:`wui-topsearch-hit-icon`,children:m(n,{name:e.icon,size:18})}),h(`span`,{className:`wui-topsearch-hit-text`,children:[m(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&m(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${r}`)})]},e.label??r))]})})]}),m(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k?j===0?`No results`:`${j} ${j===1?`result`:`results`}`:``})]})}export{x as default};
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import r from"./AppAvatar.js";import{navMatchScore as i}from"../lib/navMatch.js";import{readShellCollapsed as a,writeShellCollapsed as o}from"../lib/shellCookie.js";import{initScrollEdges as s}from"@webority/ui-elements/helpers";import{useEffect as c,useId as l,useMemo as u,useRef as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";var g=99,_=4,v=5,y=[`prefix`,`exact`],b=[`comfortable`,`compact`],x=e=>e>g?`${g}+`:String(e);function S({groups:r=[],brand:i,sidebarStart:l,sidebarStartCompact:p,sidebarFooter:g,topbarStart:_,topbarEnd:v,footer:y,children:x,collapsed:S,onCollapsedChange:E,noSidebar:O=!1,density:j=`comfortable`,navLabel:N=`Main navigation`,linkComponent:P,currentPath:F,rememberCollapsed:I=!1,collapsedCookie:L=`wui-shell-collapsed`,tabBarLabel:R=`Quick navigation`,moreLabel:z=`More`,userMenu:B,notifications:V,search:H,className:U=``,...W}){t(`AppShell`,W),e(`AppShell`,`density`,j,b);let[G,K]=f(()=>I&&S===void 0&&typeof document<`u`?a(L)??!1:!1),[q,J]=f(!1),[Y,ee]=f(!1),X=d(null),Z=S??G,te=()=>{let e=!Z;S===void 0&&K(e),I&&o(e,L),E?.(e)},Q=u(()=>C(r,F),[r,F]),$=O?null:w(Q);return c(()=>{let e=()=>ee(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),c(()=>{s()},[]),c(()=>{let e=X.current,t=e?.querySelector(`.app-nav-item[aria-current="page"]`);if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.top<r.top?e.scrollTop-=r.top-n.top:n.bottom>r.bottom&&(e.scrollTop+=n.bottom-r.bottom)},[]),c(()=>{if(!q)return;let e=e=>{e.key===`Escape`&&J(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[q]),h(`div`,{className:[`app-shell`,Z?`collapsed`:``,O?`no-sidebar`:``,q?`mobile-open`:``,U].filter(Boolean).join(` `),"data-density":j===`compact`?`compact`:void 0,...W,children:[m(`a`,{className:`wui-skip-link`,href:`#main-content`,children:`Skip to content`}),h(`aside`,{className:`app-sidebar`,children:[i&&m(`div`,{className:`app-sidebar-brand`,children:i}),l&&m(`div`,{className:`app-sidebar-start`,children:l}),p&&m(`div`,{className:`app-sidebar-start-compact`,children:p}),m(`nav`,{className:`app-sidebar-scroll`,"aria-label":N,ref:X,children:Q.map((e,t)=>h(`div`,{className:`app-nav-group`,children:[e.label&&m(`div`,{className:`app-nav-group-label`,children:e.label}),e.items.map(e=>m(D,{item:e,linkComponent:P,onNavigate:()=>J(!1)},e.key??e.href??e.label)),e.after&&m(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.label??`group-${t}`))}),g&&m(`div`,{className:`app-sidebar-foot`,children:g}),!O&&m(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:te,"aria-label":Z?`Expand navigation`:`Collapse navigation`,"aria-expanded":!Z,children:m(n,{name:`chevrons-left`,size:20})})]}),h(`div`,{className:`app-main`,children:[h(`header`,{className:`app-topbar${Y?` scrolled`:``}`,children:[h(`div`,{className:`app-topbar-start`,children:[m(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>J(!0),"aria-label":`Open navigation`,"aria-expanded":q,children:m(n,{name:`menu`,size:18})}),_,H&&m(M,{config:H})]}),h(`div`,{className:`app-topbar-end`,children:[v,V&&m(A,{config:V}),B&&m(k,{config:B,linkComponent:P})]})]}),m(`main`,{className:`app-content`,id:`main-content`,children:x}),y&&m(`footer`,{className:`app-footer`,children:y})]}),$&&h(`nav`,{className:`wui-tabbar`,"aria-label":R,children:[$.tabs.map(e=>m(T,{tab:e,linkComponent:P},e.key??e.href)),$.hasMore&&h(`button`,{type:`button`,className:`wui-tabbar-item${$.moreActive?` active`:``}`,onClick:()=>J(!0),children:[m(`span`,{className:`wui-tabbar-icon`,children:m(n,{name:`more`,size:24})}),m(`span`,{className:`wui-tabbar-label`,children:z})]})]}),m(`button`,{type:`button`,className:`app-scrim`,onClick:()=>J(!1),"aria-label":`Close navigation`,tabIndex:q?0:-1})]})}function C(t,n){let r=e=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:r(e.children)}:{...e}).filter(e=>(e.children?.length??0)>0||!!e.href),a=t.map(e=>({...e,items:r(e.items)})).filter(e=>e.items.length>0),o=[],s=e=>{for(let t of e)o.push(t),t.children&&s(t.children)};for(let e of a)s(e.items);for(let t of o)e(`AppShell`,`match`,t.match,y);let c=null;if(n!=null&&!o.some(e=>e.active===!0)){let e=-1;for(let t of o){if(t.active!=null||t.children?.length)continue;let r=i(n,t.href,{exact:t.match===`exact`,also:t.matchAlso});r>e&&(e=r,c=t)}}for(let e of o)e.active=e.active??e===c;return a}function w(e){let t=[],n=e=>{for(let r of e)r.children?.length?n(r.children):t.push(r)};for(let t of e)n(t.items);let r=t.filter(e=>e.tab);if(r.length===0)return null;let i=r.length<t.length,a=i?_:v;if(r.length>a)throw Error(`<AppShell>: ${r.length} items carry tab: true, but the phone tab bar holds ${a} (${i?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:r,hasMore:i,moreActive:t.some(e=>!e.tab&&e.active)}}function T({tab:e,linkComponent:t}){let r=`wui-tabbar-item${e.active?` active`:``}`,i=h(p,{children:[e.icon&&m(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?m(n,{name:e.icon,size:24}):e.icon}),m(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&m(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,children:e.badge})]}),a=e.active?`page`:void 0;return t?m(t,{className:r,to:e.href,"aria-current":a,children:i}):m(`a`,{className:r,href:e.href,"aria-current":a,children:i})}function E(e){for(let t of e){if(t.active)return t;let e=t.children?.length?E(t.children):void 0;if(e)return e}}function D({item:e,linkComponent:t,onNavigate:r,depth:i=0}){let a=i>0,o=i>1?{"--wui-nav-depth":i}:void 0,s=Array.isArray(e.children)&&e.children.length>0,l=s?E(e.children):void 0,u=!!l,d=l?l.key??l.href??l.label:null,[g,_]=f(u);c(()=>{d!=null&&_(!0)},[d]);let v=typeof e.label==`string`?e.label:void 0,y=!a&&e.icon&&m(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?m(n,{name:e.icon,size:22}):e.icon}),b=e.badge!=null&&m(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,children:e.badge});if(s)return h(p,{children:[h(`button`,{type:`button`,className:`app-nav-item${a?` app-nav-subitem`:``} has-children${u?` active`:``}`,style:o,"aria-expanded":g,"data-label":v,onClick:()=>_(e=>!e),children:[y,m(`span`,{className:`app-nav-text`,children:e.label}),b,m(`span`,{className:`app-nav-caret`,children:m(n,{name:`chevron-right`,size:16})})]}),m(`div`,{className:`app-nav-sub${g?` expanded`:``}`,inert:!g,"aria-hidden":!g||void 0,children:m(`div`,{className:`app-nav-sub-inner`,children:e.children.map(e=>m(D,{item:e,linkComponent:t,onNavigate:r,depth:i+1},e.key??e.href))})})]});let x=`app-nav-item${a?` app-nav-subitem`:``}${e.active?` active`:``}`,S=h(p,{children:[y,m(`span`,{className:`app-nav-text`,children:e.label}),b,e.trailingIcon&&m(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?m(n,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),C=e.active?`page`:void 0;return t?m(t,{className:x,style:o,to:e.href,"aria-current":C,"data-label":v,onClick:r,children:S}):m(`a`,{className:x,style:o,href:e.href,"aria-current":C,"data-label":v,onClick:r,children:S})}function O(){let[e,t]=f(!1),n=d(null);return c(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target)||t(!1)},i=e=>{e.key===`Escape`&&(t(!1),n.current?.querySelector(`button`)?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]),{open:e,setOpen:t,ref:n}}function k({config:e,linkComponent:t}){let i=l(),{open:a,setOpen:o,ref:s}=O(),{name:c,role:u,photo:d,profileHref:f,profileLabel:g=`My profile`,onLogout:_,logoutAction:v,logoutLabel:y=`Sign out`,items:b=[]}=e;if(!c)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let x=()=>o(!1),S=(e,n,r,i)=>t?m(t,{className:`dropdown-item`,to:e,onClick:i,children:n},r):m(`a`,{className:`dropdown-item`,href:e,onClick:i,children:n},r),C=h(p,{children:[m(n,{name:`log-out`,size:18}),y]});return h(`div`,{className:`dropdown wui-usermenu`,ref:s,children:[h(`button`,{type:`button`,id:i,className:`wui-usermenu-trigger`,"aria-expanded":a,"aria-label":`Account menu for ${c}`,onClick:()=>o(e=>!e),children:[m(r,{name:c,src:d,tone:`auto`}),h(`span`,{className:`wui-usermenu-text`,children:[m(`span`,{className:`wui-usermenu-name`,children:c}),u&&m(`span`,{className:`wui-usermenu-role`,children:u})]}),m(n,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),h(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${a?` show`:``}`,"aria-labelledby":i,"data-bs-popper":a?`static`:void 0,children:[h(`div`,{className:`wui-usermenu-head`,children:[m(r,{name:c,src:d,size:`lg`,tone:`auto`}),h(`div`,{className:`wui-usermenu-who`,children:[m(`div`,{className:`wui-usermenu-name`,children:c}),u&&m(`div`,{className:`wui-usermenu-role`,children:u})]})]}),f&&S(f,h(p,{children:[m(n,{name:`user`,size:18}),g]}),void 0,x),b.map(e=>{if(e.divider)return m(`hr`,{className:`dropdown-divider`},e.key);let t=h(p,{children:[e.icon&&m(n,{name:e.icon,size:18}),e.label]}),r=()=>{e.onClick?.(),x()};return e.href?S(e.href,t,e.key,r):m(`button`,{type:`button`,className:`dropdown-item`,onClick:r,children:t},e.key)}),v?m(`form`,{method:`post`,action:v,className:`wui-usermenu-logout`,children:m(`button`,{type:`submit`,className:`dropdown-item danger`,children:C})}):_&&m(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{x(),_()},children:C})]})]})}function A({config:e}){let t=l(),{open:r,setOpen:i,ref:a}=O(),{unread:o=0,items:s,loading:u=!1,onOpen:g,onMarkAllRead:_,viewAllHref:v,label:y=`Notifications`,emptyText:b=`You are all caught up.`}=e,[S,C]=f(``),w=d(o);c(()=>{w.current!==o&&(w.current=o,C(o===0?`No unread notifications`:`${x(o)} unread notifications`))},[o]);let T=null;return s?.length?T=m(`div`,{className:`wui-bell-items`,children:s.map((e,t)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=h(p,{children:[m(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&m(`span`,{className:`wui-bell-icon`,children:m(n,{name:e.icon,size:18})}),h(`span`,{className:`wui-bell-body`,children:[!e.read&&m(`span`,{className:`visually-hidden`,children:`Unread: `}),m(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&m(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?m(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??t):m(`div`,{className:r,"data-id":e.id,children:i},e.id??t)})}):u?T=m(`div`,{className:`wui-bell-state`,children:`Loading…`}):s&&(T=m(`div`,{className:`wui-bell-state`,children:b})),h(`div`,{className:`dropdown wui-bell`,ref:a,children:[h(`button`,{type:`button`,id:t,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":r,"aria-label":o===0?y:`${y}, ${x(o)} unread`,onClick:()=>{let e=!r;i(e),e&&g?.()},children:[m(n,{name:`notification`,size:20}),m(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:o===0,children:x(o)})]}),m(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:S}),h(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${r?` show`:``}`,"aria-labelledby":t,"data-bs-popper":r?`static`:void 0,children:[h(`div`,{className:`wui-bell-head`,children:[m(`span`,{className:`wui-bell-title`,children:y}),_&&m(`button`,{type:`button`,className:`wui-bell-markall`,onClick:_,children:`Mark all read`})]}),m(`div`,{className:`wui-bell-list`,"aria-busy":u||void 0,children:T}),v&&m(`a`,{className:`wui-bell-foot`,href:v,children:`View all`})]})]})}var j=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function M({config:e}){let t=l(),{value:r=``,onChange:i,results:a=null,loading:o=!1,onSelect:s,onSubmit:p,placeholder:g=`Search`}=e,[_,v]=f(!1),[y,b]=f(!1),[x,S]=f({results:null,index:-1}),C=x.results===a?x.index:-1,w=e=>S({results:a,index:e}),T=d(null),E=d(null),D=d([]),O=u(()=>(a??[]).flatMap(e=>e.hits??[]),[a]),k=a!=null&&!y,A=O.length;c(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||j(e.target)||(e.preventDefault(),v(!0),E.current?.focus())},t=e=>{T.current?.contains(e.target)||(b(!0),v(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let M=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!k||A===0)return;e.preventDefault(),w((C+(e.key===`ArrowDown`?1:-1)+A)%A)}else e.key===`Enter`?k&&C>=0&&D.current[C]?(e.preventDefault(),D.current[C].click()):p&&r.trim()!==``&&(e.preventDefault(),p(r.trim())):e.key===`Escape`&&(k?(e.preventDefault(),b(!0)):_&&(e.preventDefault(),v(!1)))},N=-1;return D.current=[],h(`div`,{className:`wui-topsearch${_?` is-open`:``}${o?` is-loading`:``}`,ref:T,children:[m(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":g,"aria-expanded":_,"aria-controls":`${t}-panel`,onClick:()=>{let e=!_;v(e),e&&E.current?.focus()},children:m(n,{name:`search`,size:20})}),h(`div`,{className:`wui-topsearch-panel`,id:`${t}-panel`,children:[h(`div`,{className:`search-wrap`,children:[m(n,{name:`search`,size:18,className:`search-icon`}),m(`input`,{ref:E,type:`search`,className:`form-control input search-input`,id:`${t}-input`,placeholder:g,"aria-label":g,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":k,"aria-controls":`${t}-list`,"aria-activedescendant":k&&C>=0?`${t}-opt-${C}`:void 0,autoComplete:`off`,value:r,onChange:e=>{b(!1),i?.(e.target.value)},onKeyDown:M})]}),m(`div`,{className:`wui-topsearch-results`,id:`${t}-list`,role:`listbox`,"aria-label":`Search results`,hidden:!k,children:k&&h(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[A===0&&h(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:[`No results for “`,r,`”`]}),a.filter(e=>e.hits?.length).map((e,r)=>h(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&m(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{N+=1;let r=N;return h(`a`,{className:`wui-topsearch-hit${r===C?` is-active`:``}`,role:`option`,"aria-selected":r===C,id:`${t}-opt-${r}`,href:e.href,ref:e=>{D.current[r]=e},onClick:t=>s?.(e,t),children:[e.icon&&m(`span`,{className:`wui-topsearch-hit-icon`,children:m(n,{name:e.icon,size:18})}),h(`span`,{className:`wui-topsearch-hit-text`,children:[m(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&m(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${r}`)})]},e.label??r))]})})]}),m(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k?A===0?`No results`:`${A} ${A===1?`result`:`results`}`:``})]})}export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppRecordPager.js";import r from"./AppShortcutLegend.js";import{LIST_KEYS as i,SELECT_KEY as a,shortcutKey as o}from"@webority/ui-elements/helpers";import{useEffect as s,useRef as c}from"react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";var f={sm:576,md:768,lg:992,xl:1200,xxl:1400},p=Object.keys(f),m=[3,4,5,6,7,8],h=6,g=`.wui-split-items > .wui-split-item > .wui-split-link`,_=(e,t)=>e!=null&&String(e)===String(t),v=e=>{let t=window.matchMedia?.(`(min-width: ${f[e]}px)`);return!t||t.matches},ee=e=>typeof e==`string`||typeof e==`number`?String(e):`item`;function y({items:y=[],currentKey:b,onSelect:x,selectable:S=!1,selectedKeys:C,onToggle:w,onToggleAll:T,bulkActions:E,header:D,chips:O,pane:k,paneHeader:A,pager:j=!0,shortcuts:te,shortcutsEnabled:M=!0,empty:ne=`Nothing here yet.`,loading:N=!1,listWidth:P=5,stackBelow:F=`xl`,className:I=``,...L}){t(`AppSplitView`,L),e(`AppSplitView`,`stackBelow`,F,p),e(`AppSplitView`,`listWidth`,P,m);let R=f[F]?F:`xl`,z=m.includes(P)?P:5,B=c(null),V=b!=null,H=S?C?.size??0:0,U=H>0,W=S&&y.length>0&&y.every(e=>C?.has(e.key)),G=S&&!W&&y.some(e=>C?.has(e.key)),K=e=>{e&&(e.indeterminate=G)},q=c(!1);s(()=>{if(!q.current){q.current=!0;return}b!=null&&B.current?.querySelector(`.wui-split-link[aria-current="true"]`)?.scrollIntoView?.({block:`nearest`})},[b]);let J=(e,t)=>{t.button>0||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey||x&&(e.href&&!v(R)||(t.preventDefault(),x(e.key)))},Y=e=>{let t=[...B.current?.querySelectorAll(g)??[]];t[t.findIndex(e=>e.getAttribute(`aria-current`)===`true`)+e]?.click()},X=[`wui-split-view`,V?`wui-split-reading`:``,I].filter(Boolean).join(` `),re=S?[...i,a]:i,ie=new Set([`J`,`K`,`Enter`,`?`,...S?[`X`]:[]]),ae=[...re,...(te??[]).filter(e=>!ie.has(o(e.key))).map(e=>({key:e.key,label:e.label,onPress:()=>e.onPress?.(b)}))],Z=y.findIndex(e=>_(b,e.key)),Q=j&&!N&&y.length>0?u(n,{"data-split-pager":``,index:Z>=0?Z+1:void 0,total:y.length,onPrev:()=>Y(-1),onNext:()=>Y(1),prevLabel:`Previous item`,nextLabel:`Next item`}):null,oe=e=>{let t=_(b,e.key),n=S&&!!C?.has(e.key),r=e.badge!==void 0&&e.badge!==null&&e.badge!==``,i=d(l,{children:[d(`span`,{className:`wui-split-item-main`,children:[u(`span`,{className:`wui-split-item-title`,children:e.title}),e.meta!==void 0&&e.meta!==null&&u(`span`,{className:`wui-split-item-meta`,children:e.meta})]}),(e.trailing||r)&&d(`span`,{className:`wui-split-item-end`,children:[e.trailing,r&&u(`span`,{className:`wui-split-badge`,children:e.badge})]})]});return d(`li`,{className:[`wui-split-item`,t?`is-active`:``,n?`is-selected`:``].filter(Boolean).join(` `),"data-key":e.key,children:[S&&u(`input`,{type:`checkbox`,className:`wui-check wui-split-check`,checked:n,onChange:()=>w?.(e.key),"aria-label":`Select ${ee(e.title)}`}),e.href?u(`a`,{className:`wui-split-link`,href:e.href,"aria-current":t?`true`:void 0,onClick:t=>J(e,t),children:i}):u(`button`,{type:`button`,className:`wui-split-link`,"aria-current":t?`true`:void 0,onClick:t=>J(e,t),children:i})]},e.key)},$;return $=N?d(`div`,{className:`wui-split-items`,"aria-busy":`true`,children:[u(`span`,{className:`visually-hidden`,children:`Loading`}),Array.from({length:h},(e,t)=>d(`div`,{className:`wui-split-skeleton`,"aria-hidden":`true`,children:[u(`span`,{className:`skeleton wui-split-skeleton-title`}),u(`span`,{className:`skeleton wui-split-skeleton-meta`})]},t))]}):y.length?u(`ul`,{className:`wui-split-items`,"aria-label":`Items`,children:y.map(oe)}):u(`div`,{className:`wui-split-empty`,children:ne}),d(`div`,{ref:B,className:X,"data-stack-below":R,"data-list-width":z,"data-shortcut-scope":M?``:void 0,...L,children:[d(`div`,{className:`wui-split-list`,children:[(D||S)&&d(`div`,{className:`wui-split-head`,children:[S&&u(`input`,{ref:K,type:`checkbox`,className:`wui-check wui-split-all`,checked:W,onChange:e=>T?.(e.target.checked),"aria-label":`Select all items`}),u(`div`,{className:`wui-split-head-main`,hidden:U,children:D}),S&&d(`div`,{className:`wui-split-head-bulk`,hidden:!U,children:[d(`span`,{className:`wui-split-count`,"aria-live":`polite`,children:[H,` selected`]}),E]})]}),O&&u(`div`,{className:`wui-split-chips`,children:O}),$,M&&d(`div`,{className:`wui-split-legend`,children:[d(`span`,{children:[u(`kbd`,{className:`wui-kbd`,children:`J`}),` `,u(`kbd`,{className:`wui-kbd`,children:`K`}),` Move`]}),d(`span`,{children:[u(`kbd`,{className:`wui-kbd`,children:`Enter`}),` Open`]}),u(r,{items:g,shortcuts:ae})]})]}),d(`div`,{className:`wui-split-pane`,children:[(A||Q)&&d(`div`,{className:`wui-split-pane-head`,children:[A,Q]}),u(`section`,{className:`wui-split-pane-body`,"aria-label":`Reading pane`,tabIndex:0,children:k})]})]})}export{y as default};
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppRecordPager.js";import r from"./AppShortcutLegend.js";import{LIST_KEYS as i,SELECT_KEY as a,shortcutKey as o}from"@webority/ui-elements/helpers";import{useEffect as s,useRef as c}from"react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";var f={sm:576,md:768,lg:992,xl:1200,xxl:1400},p=Object.keys(f),m=[3,4,5,6,7,8],h=6,g=`.wui-split-items > .wui-split-item > .wui-split-link`,_=(e,t)=>e!=null&&String(e)===String(t),v=e=>{let t=window.matchMedia?.(`(min-width: ${f[e]}px)`);return!t||t.matches},ee=e=>typeof e==`string`||typeof e==`number`?String(e):`item`;function y({items:y=[],currentKey:b,onSelect:x,selectable:S=!1,selectedKeys:C,onToggle:w,onToggleAll:T,bulkActions:E,header:D,chips:O,pane:k,paneHeader:A,pager:j=!0,shortcuts:te,shortcutsEnabled:M=!0,empty:ne=`Nothing here yet.`,loading:N=!1,listWidth:P=5,stackBelow:F=`xl`,className:I=``,...L}){t(`AppSplitView`,L),e(`AppSplitView`,`stackBelow`,F,p),e(`AppSplitView`,`listWidth`,P,m);let R=f[F]?F:`xl`,z=m.includes(P)?P:5,B=c(null),V=b!=null,H=S?C?.size??0:0,U=H>0,W=S&&y.length>0&&y.every(e=>C?.has(e.key)),G=S&&!W&&y.some(e=>C?.has(e.key)),K=e=>{e&&(e.indeterminate=G)},q=c(!1);s(()=>{if(!q.current){q.current=!0;return}b!=null&&B.current?.querySelector(`.wui-split-link[aria-current="true"]`)?.scrollIntoView?.({block:`nearest`})},[b]);let J=(e,t)=>{t.button>0||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey||x&&(e.href&&!v(R)||(t.preventDefault(),x(e.key)))},Y=e=>{let t=[...B.current?.querySelectorAll(g)??[]];t[t.findIndex(e=>e.getAttribute(`aria-current`)===`true`)+e]?.click()},X=[`wui-split-view`,V?`wui-split-reading`:``,I].filter(Boolean).join(` `),re=S?[...i,a]:i,ie=new Set([`J`,`K`,`Enter`,`?`,...S?[`X`]:[]]),ae=[...re,...(te??[]).filter(e=>!ie.has(o(e.key))).map(e=>({key:e.key,label:e.label,onPress:()=>e.onPress?.(b)}))],Z=y.findIndex(e=>_(b,e.key)),Q=j&&!N&&y.length>0?u(n,{"data-split-pager":``,index:Z>=0?Z+1:void 0,total:y.length,onPrev:()=>Y(-1),onNext:()=>Y(1),prevLabel:`Previous item`,nextLabel:`Next item`}):null,oe=e=>{let t=_(b,e.key),n=S&&!!C?.has(e.key),r=e.badge!==void 0&&e.badge!==null&&e.badge!==``,i=d(l,{children:[d(`span`,{className:`wui-split-item-main`,children:[u(`span`,{className:`wui-split-item-title`,children:e.title}),e.meta!==void 0&&e.meta!==null&&u(`span`,{className:`wui-split-item-meta`,children:e.meta})]}),(e.trailing||r)&&d(`span`,{className:`wui-split-item-end`,children:[e.trailing,r&&u(`span`,{className:`wui-split-badge`,children:e.badge})]})]});return d(`li`,{className:[`wui-split-item`,t?`is-active`:``,n?`is-selected`:``].filter(Boolean).join(` `),"data-key":e.key,children:[S&&u(`input`,{type:`checkbox`,className:`wui-check wui-split-check`,checked:n,onChange:()=>w?.(e.key),"aria-label":`Select ${ee(e.title)}`}),e.href?u(`a`,{className:`wui-split-link`,href:e.href,"aria-current":t?`true`:void 0,onClick:t=>J(e,t),children:i}):u(`button`,{type:`button`,className:`wui-split-link`,"aria-current":t?`true`:void 0,onClick:t=>J(e,t),children:i})]},e.key)},$;return $=N?d(`div`,{className:`wui-split-items`,"aria-busy":`true`,tabIndex:0,children:[u(`span`,{className:`visually-hidden`,children:`Loading`}),Array.from({length:h},(e,t)=>d(`div`,{className:`wui-split-skeleton`,"aria-hidden":`true`,children:[u(`span`,{className:`skeleton wui-split-skeleton-title`}),u(`span`,{className:`skeleton wui-split-skeleton-meta`})]},t))]}):y.length?u(`ul`,{className:`wui-split-items`,"aria-label":`Items`,children:y.map(oe)}):u(`div`,{className:`wui-split-empty`,children:ne}),d(`div`,{ref:B,className:X,"data-stack-below":R,"data-list-width":z,"data-shortcut-scope":M?``:void 0,...L,children:[d(`div`,{className:`wui-split-list`,children:[(D||S)&&d(`div`,{className:`wui-split-head`,children:[S&&u(`input`,{ref:K,type:`checkbox`,className:`wui-check wui-split-all`,checked:W,onChange:e=>T?.(e.target.checked),"aria-label":`Select all items`}),u(`div`,{className:`wui-split-head-main`,hidden:U,children:D}),S&&d(`div`,{className:`wui-split-head-bulk`,hidden:!U,children:[d(`span`,{className:`wui-split-count`,"aria-live":`polite`,children:[H,` selected`]}),E]})]}),O&&u(`div`,{className:`wui-split-chips`,children:O}),$,M&&d(`div`,{className:`wui-split-legend`,children:[d(`span`,{children:[u(`kbd`,{className:`wui-kbd`,children:`J`}),` `,u(`kbd`,{className:`wui-kbd`,children:`K`}),` Move`]}),d(`span`,{children:[u(`kbd`,{className:`wui-kbd`,children:`Enter`}),` Open`]}),u(r,{items:g,shortcuts:ae})]})]}),d(`div`,{className:`wui-split-pane`,children:[(A||Q)&&d(`div`,{className:`wui-split-pane-head`,children:[A,Q]}),u(`section`,{className:`wui-split-pane-body`,"aria-label":`Reading pane`,tabIndex:0,children:k})]})]})}export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";var o=[`steps`,`journey`],s=[`horizontal`,`vertical`],c=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],l=[`sm`,`md`,`lg`],u={sm:12,md:14,lg:18},
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";var o=[`steps`,`journey`],s=[`horizontal`,`vertical`],c=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],l=[`sm`,`md`,`lg`],u=[`primary`,`info`],d={sm:12,md:14,lg:18},f=[`done`,`active`,`pending`,`error`];function p({steps:p=[],variant:h=`steps`,orientation:g=`horizontal`,iconVariant:_,size:v=`md`,iconSize:y,activeStep:b,onStepClick:x,label:S=`Progress`,tone:C=`primary`,linkComponent:w,className:T=``,...E}){t(`AppStepper`,E),e(`AppStepper`,`variant`,h,o),e(`AppStepper`,`orientation`,g,s),e(`AppStepper`,`iconVariant`,_,c),e(`AppStepper`,`size`,v,l),e(`AppStepper`,`tone`,C,u);let D=y>0?y:d[v]??d.md;for(let t of p)e(`AppStepper`,`steps[].status`,t.status,f);let O=h===`journey`;return i(`nav`,{className:[`stepper`,O&&`stepper-journey`,g===`vertical`&&`stepper-vertical`,v!==`md`&&l.includes(v)&&`wui-step-size-${v}`,C!==`primary`&&u.includes(C)&&`wui-step-tone-${C}`,T].filter(Boolean).join(` `),"aria-label":S,...E,children:p.map((e,t)=>{let o=e.status||m(t,b),s=`step${o===`pending`?``:` ${o}`}`,c;c=o===`done`?i(n,{name:`check`,size:D,variant:_}):o===`error`?i(n,{name:`alert-triangle`,size:D,variant:_}):e.icon?i(n,{name:e.icon,size:D,variant:_}):t+1;let l=a(r,{children:[i(`span`,{className:`step-circle`,children:c}),O?a(`span`,{className:`step-text`,children:[i(`span`,{className:`step-index`,children:`Step ${t+1}`}),i(`span`,{className:`step-label`,children:e.label}),e.description?i(`span`,{className:`step-desc`,children:e.description}):null]}):a(r,{children:[i(`span`,{className:`step-label`,children:e.label}),e.description?i(`span`,{className:`step-desc`,children:e.description}):null]})]}),u=o===`active`?`step`:void 0,d=e.key??`${e.label}-${t}`,f;return f=x?i(`button`,{type:`button`,className:s,"aria-current":u,onClick:()=>x(e,t),children:l},d):e.href?w?i(w,{className:s,to:e.href,"aria-current":u,children:l},d):i(`a`,{className:s,href:e.href,"aria-current":u,children:l},d):i(`div`,{className:s,"aria-current":u,children:l},d),O&&t<p.length-1?[f,i(`span`,{className:`step-line${o===`done`?` done`:``}`,"aria-hidden":`true`},`${d}-line`)]:f})})}function m(e,t){return typeof t==`number`?e<t?`done`:e===t?`active`:`pending`:`pending`}export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppTooltip.js";import r from"./AppIcon.js";import i from"./renderIconProp.js";import{useCallback as a,useEffect as o,useLayoutEffect as s,useRef as c,useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/overflow";var p=[`underline`,`pills`],m=[`horizontal`,`vertical`],
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppTooltip.js";import r from"./AppIcon.js";import i from"./renderIconProp.js";import{useCallback as a,useEffect as o,useLayoutEffect as s,useRef as c,useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/overflow";var p=[`underline`,`pills`],m=[`horizontal`,`vertical`],h=[`sm`,`md`,`lg`],g=[`automatic`,`manual`],_=[`scroll`,`menu`],v=[`success`,`warning`,`danger`,`info`],y=1,b=28,x=.7;function S({tabs:S,value:C,onChange:w,linkComponent:T,variant:E=`underline`,orientation:D=`horizontal`,size:O=`md`,fitted:k=!1,overflow:A=`scroll`,moreLabel:j=`More`,maxVisible:M,activation:N=`automatic`,ariaLabel:P,className:ee=``,style:te,...F}){t(`AppTabs`,F),e(`AppTabs`,`variant`,E,p),e(`AppTabs`,`orientation`,D,m),e(`AppTabs`,`size`,O,h),e(`AppTabs`,`activation`,N,g),e(`AppTabs`,`overflow`,A,_);for(let t of S)e(`AppTabs`,`tabs[].tone`,t.tone,v);let I=c(null),L=c(null),R=D===`vertical`,z=(A===`menu`||M!=null)&&!R,[B,V]=l(C);o(()=>{V(C)},[C]);let H=S.find(e=>!e.disabled)?.key,U=S.some(e=>e.key===B&&!e.disabled)?B:void 0,W=S.some(e=>e.key===C&&!e.disabled)?C:void 0,G=U??W??H,K=e=>{I.current?.querySelector(`[data-key="${CSS.escape(String(e))}"]`)?.focus()},q=a(()=>{let e=I.current,t=L.current;if(!e||!t||R||z)return;let n=e.scrollWidth-e.clientWidth;t.classList.toggle(`is-overflow-start`,e.scrollLeft>y),t.classList.toggle(`is-overflow-end`,n>y&&e.scrollLeft<n-y)},[R,z]),J=a(()=>{let e=I.current;if(!e)return;let t=e.querySelector(`.app-tab.active`);t?(R?(e.style.setProperty(`--wui-tab-y`,`${t.offsetTop}px`),e.style.setProperty(`--wui-tab-h`,`${t.offsetHeight}px`)):(e.style.setProperty(`--wui-tab-x`,`${t.offsetLeft}px`),e.style.setProperty(`--wui-tab-w`,`${t.offsetWidth}px`)),e.toggleAttribute(`data-active-danger`,!!S.find(e=>e.key===C)?.danger)):e.style.setProperty(R?`--wui-tab-h`:`--wui-tab-w`,`0px`),e.setAttribute(`data-wui-tabs`,``),q()},[R,S,C,q]),Y=e=>!z||!I.current?.querySelector(`[data-key="${CSS.escape(String(e))}"][data-wui-overflow-hidden]`),X=a(()=>{let e=I.current;if(!e||R)return;let t=e.querySelector(`.app-tab.active`);if(!t)return;let n=b,r=t.offsetLeft,i=r+t.offsetWidth;r-n<e.scrollLeft?e.scrollLeft=Math.max(0,r-n):i+n>e.scrollLeft+e.clientWidth&&(e.scrollLeft=i+n-e.clientWidth)},[R]);s(()=>{J()},[J]),s(()=>{X()},[C,X]);let Z=c(J);o(()=>{Z.current=J},[J]),o(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>Z.current());return I.current&&e.observe(I.current),L.current&&e.observe(L.current),()=>e.disconnect()},[R,z]),o(()=>{let e=L.current;if(!z||!e)return;let t=()=>Z.current();return e.addEventListener(`wui-overflow-change`,t),()=>e.removeEventListener(`wui-overflow-change`,t)},[z]);function ne(e){let t=e.target?.dataset?.key;if(t==null)return;let n=S.findIndex(e=>e.key===t);if(n<0)return;let r=S.length,i=(e,t)=>{for(let n=1;n<=r;n++){let i=S[((e+t*n)%r+r)%r];if(!i.disabled&&Y(i.key))return i}return null},a=R?`ArrowDown`:`ArrowRight`,o=R?`ArrowUp`:`ArrowLeft`,s=null;if(e.key===a?s=i(n,1):e.key===o?s=i(n,-1):e.key===`Home`?s=S.find(e=>!e.disabled&&Y(e.key))??null:e.key===`End`&&(s=[...S].reverse().find(e=>!e.disabled&&Y(e.key))??null),!s)return;e.preventDefault(),V(s.key),K(s.key);let c=s.href!=null||s.to!=null;N===`automatic`&&!c&&w?.(s.key)}let Q=e=>{let t=I.current;t&&t.scrollBy({left:e*t.clientWidth*x})},re=[`app-tabs`,E===`pills`?`app-tabs-pills`:``,R?`app-tabs-vertical`:``,O===`sm`?`app-tabs-sm`:``,O===`lg`?`app-tabs-lg`:``,k?`app-tabs-fitted`:``,ee].filter(Boolean).join(` `),$=f(`div`,{ref:I,role:`tablist`,"aria-orientation":R?`vertical`:void 0,"aria-label":P,className:re,style:te,"data-wui-overflow-list":z?``:void 0,...F,onKeyDown:ne,onScroll:q,children:[S.map(e=>{let t=e.key===C,r=e.href!=null||e.to!=null,a={role:`tab`,"data-key":e.key,"aria-selected":t,tabIndex:e.key===G?0:-1,className:`app-tab${t?` active`:``}${e.danger?` danger`:``}${r&&e.disabled?` disabled`:``}`},o=f(u,{children:[e.image?d(`img`,{className:`app-tab-img`,src:e.image,alt:e.imageAlt??``}):i(e.icon,{size:16,className:`app-tab-icon`}),e.label,(e.countLabel||e.count!=null)&&d(`span`,{className:`app-tab-count${e.tone?` ${e.tone}`:``}`,children:e.countLabel||e.count})]}),s;if(r){let t=e.to!=null&&T?T:`a`,n=e.rel??(e.target===`_blank`?`noopener noreferrer`:void 0),r=e.disabled?{"aria-disabled":!0}:t===`a`?{href:e.href??e.to,target:e.target,rel:n}:{to:e.to,target:e.target,rel:n},i=t=>{if(e.disabled){t.preventDefault();return}t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(V(e.key),w?.(e.key))};s=d(t,{...a,...r,onClick:i,children:o},e.key)}else s=d(`button`,{type:`button`,...a,disabled:e.disabled,onClick:()=>{e.disabled||(V(e.key),w?.(e.key))},children:o},e.key);return e.tooltip?d(n,{content:e.tooltip,children:s},e.key):s}),d(`span`,{className:`app-tab-indicator`,"aria-hidden":`true`,"data-wui-overflow-skip":``})]});return R?$:z?d(`wui-overflow`,{ref:L,class:`app-tabs-wrap`,label:j,children:$}):f(`div`,{ref:L,className:`app-tabs-wrap`,children:[d(`button`,{type:`button`,className:`app-tabs-scroll-btn prev`,"aria-label":`Scroll tabs backward`,tabIndex:-1,onClick:()=>Q(-1),children:d(r,{name:`chevron-left`,size:16})}),$,d(`button`,{type:`button`,className:`app-tabs-scroll-btn next`,"aria-label":`Scroll tabs forward`,tabIndex:-1,onClick:()=>Q(1),children:d(r,{name:`chevron-right`,size:16})})]})}export{S as default};
|
package/dist/lib/initials.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=new Set([`pvt`,`private`,`ltd`,`limited`,`llp`,`llc`,`inc`,`corp`,`co`]),t=/\p{L}/u;function
|
|
1
|
+
var e=new Set([`pvt`,`private`,`ltd`,`limited`,`llp`,`llc`,`inc`,`corp`,`co`]),t=/\p{L}/u,n=/\p{N}/u;function r(e){let t=``,n=0;for(let r of e)r===`(`?(n+=1,t+=` `):r===`)`?(n=Math.max(0,n-1),t+=` `):n===0&&(t+=r);return t}function i(e){return e.map(e=>{let t=e.toUpperCase();return Array.from(t).length===1?t:e}).join(``)}function a(a,o=2){let s=r(String(a??``)).split(/\s+/),c=e=>s.map(t=>Array.from(t).filter(t=>e.test(t))).filter(e=>e.length>0),l=c(t).filter(t=>!e.has(t.join(``).toLowerCase()));return l.length===0&&!s.some(e=>t.test(e))&&(l=c(n)),l.length===0?``:l.length===1?i(l[0].slice(0,o)):i([l[0][0],l[1][0]])}export{a as initialsOf};
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
* compact is one line per row (the identity subline is hidden). An avatar with no size of its own
|
|
32
32
|
* follows the density (32 / 28 / 24px).
|
|
33
33
|
* @param {boolean} [props.striped=false] Alternate-row shading in place of divider lines.
|
|
34
|
+
* @param {boolean} [props.flush=false] No wrapper padding above the column header row.
|
|
34
35
|
* @param {string|number} [props.maxHeight] Caps the table's height; the body scrolls inside it with
|
|
35
36
|
* the header pinned. Without it there is no scroll box for the header to stick to.
|
|
36
37
|
* @param {string[]} [props.hiddenColumns] Keys of `hideable` columns to leave out (from useTableView).
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
* A sort or reorder of up to 200 rows glides each row to its new place; not under reduced motion, and not
|
|
90
91
|
* on a `virtual` table.
|
|
91
92
|
*/
|
|
92
|
-
export default function AppDataTable({ columns, rows, rowKey, sort, onSort, loading, skeletonRows, empty, emptyFiltered, sourceCount, rowActions, rowActionsLabel, pagination, ariaLabel, className, wrapperClassName, selectable, selectedIds, onToggleRow, onToggleAll, onSelectRange, renderExpanded, density, striped, maxHeight, stickyFirstColumn, stickyActions, stackOnMobile, hiddenColumns, rowStatus, rowHref, onRowClick, activeRowKey, resizableColumns, viewKey, groupBy, groupLabel, virtual, rowSaving, rowSaveError, ...rest }: {
|
|
93
|
+
export default function AppDataTable({ columns, rows, rowKey, sort, onSort, loading, skeletonRows, empty, emptyFiltered, sourceCount, rowActions, rowActionsLabel, pagination, ariaLabel, className, wrapperClassName, selectable, selectedIds, onToggleRow, onToggleAll, onSelectRange, renderExpanded, density, striped, flush, maxHeight, stickyFirstColumn, stickyActions, stackOnMobile, hiddenColumns, rowStatus, rowHref, onRowClick, activeRowKey, resizableColumns, viewKey, groupBy, groupLabel, virtual, rowSaving, rowSaveError, ...rest }: {
|
|
93
94
|
columns: object[];
|
|
94
95
|
rows: object[];
|
|
95
96
|
rowKey?: (row: object, index: number) => string | number;
|
|
@@ -111,6 +112,7 @@ export default function AppDataTable({ columns, rows, rowKey, sort, onSort, load
|
|
|
111
112
|
wrapperClassName?: string;
|
|
112
113
|
density?: 'comfortable' | 'cozy' | 'compact';
|
|
113
114
|
striped?: boolean;
|
|
115
|
+
flush?: boolean;
|
|
114
116
|
maxHeight?: string | number;
|
|
115
117
|
hiddenColumns?: string[];
|
|
116
118
|
stackOnMobile?: boolean;
|
|
@@ -7,24 +7,28 @@
|
|
|
7
7
|
* render as a muted em-dash so a missing fact reads as "no value", not a broken row.
|
|
8
8
|
*
|
|
9
9
|
* @param {object} props
|
|
10
|
-
* @param {{ label: string, value: import('react').ReactNode, span?: 1|2|3, key?: string }[]} props.items
|
|
10
|
+
* @param {{ label: string, value: import('react').ReactNode, span?: 1|2|3, key?: string, emphasis?: boolean }[]} props.items
|
|
11
11
|
* The rows — each with a label and a value. A `span` of 2 or 3 makes the item span multiple columns.
|
|
12
|
+
* `emphasis` marks the total row: bold, with a rule above.
|
|
12
13
|
* @param {1|2|3} [props.columns=2] How many columns the grid should have (before media-breakpoint collapse).
|
|
13
14
|
* @param {"sm"|"md"} [props.size="md"] Item padding / font size.
|
|
14
15
|
* @param {boolean} [props.bordered=false] Add horizontal dividing lines between rows.
|
|
16
|
+
* @param {"grid"|"summary"} [props.layout="grid"] `summary` puts each label left of its value, with tabular figures.
|
|
15
17
|
* @param {import('react').ReactNode} [props.title] Optional heading above the grid.
|
|
16
18
|
* @param {string} [props.className] Extra classes on the grid container.
|
|
17
19
|
*/
|
|
18
|
-
export default function AppDescriptions({ items, columns, size, bordered, title, className, ...rest }: {
|
|
20
|
+
export default function AppDescriptions({ items, columns, size, bordered, layout, title, className, ...rest }: {
|
|
19
21
|
items: {
|
|
20
22
|
label: string;
|
|
21
23
|
value: import('react').ReactNode;
|
|
22
24
|
span?: 1 | 2 | 3;
|
|
23
25
|
key?: string;
|
|
26
|
+
emphasis?: boolean;
|
|
24
27
|
}[];
|
|
25
28
|
columns?: 1 | 2 | 3;
|
|
26
29
|
size?: "sm" | "md";
|
|
27
30
|
bordered?: boolean;
|
|
31
|
+
layout?: "grid" | "summary";
|
|
28
32
|
title?: import('react').ReactNode;
|
|
29
33
|
className?: string;
|
|
30
34
|
}): import("react").JSX.Element;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* @param {string} [props.label] Tooltip + accessible-name fallback for the toggle.
|
|
16
16
|
* @param {"start"|"end"} [props.align="end"] Menu alignment.
|
|
17
17
|
* @param {string} [props.ariaLabel]
|
|
18
|
-
* @param {{ key: string, label?: string, icon?: string|import('react').ReactNode, image?: string, to?: string, onClick?: () => void, danger?: boolean, shortcut?: string, divider?: true, header?: string }[]} [props.items]
|
|
18
|
+
* @param {{ key: string, label?: string, icon?: string|import('react').ReactNode, image?: string, to?: string, onClick?: () => void, danger?: boolean, shortcut?: string, divider?: true, header?: string, hiddenFrom?: 'sm'|'md'|'lg'|'xl' }[]} [props.items]
|
|
19
19
|
* `icon` is a glyph name OR a custom node (e.g. an iconsax glyph); `image` is a picture URL (external logo/avatar) — pass one.
|
|
20
20
|
* `shortcut` is the key that runs the item ("E"), drawn as a key chip at the end of the row; the
|
|
21
21
|
* page binds the key itself (useListShortcuts).
|
|
@@ -60,6 +60,7 @@ export default function AppDropdown({ icon, iconSize, toggleClassName, label, ar
|
|
|
60
60
|
shortcut?: string;
|
|
61
61
|
divider?: true;
|
|
62
62
|
header?: string;
|
|
63
|
+
hiddenFrom?: 'sm' | 'md' | 'lg' | 'xl';
|
|
63
64
|
}[];
|
|
64
65
|
menuClassName?: string;
|
|
65
66
|
linkComponent?: import('react').ElementType;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A due date that never wraps. An overdue date shows in danger with its title "Overdue since dd-MMM-yyyy"
|
|
3
|
+
* and the danger glyph; a date within `soonDays` shows "N days left" in warning; no date shows the muted "Not set".
|
|
4
|
+
* Dates are read in India Standard Time. The Razor `<app-due-date>` renders the same markup and classes.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @param {Date} [props.date] The due date.
|
|
8
|
+
* @param {number} [props.soonDays] Within this many days of the date, the text reads "N days left" in warning.
|
|
9
|
+
* @param {boolean} [props.overdue=false] Set by the caller from its own rule. Done items are never overdue.
|
|
10
|
+
* @param {string} [props.overdueLabel] Replaces the date text when overdue, for example "Validity ended".
|
|
11
|
+
* @param {string} [props.className]
|
|
12
|
+
*/
|
|
13
|
+
export default function AppDueDate({ date, soonDays, overdue, overdueLabel, className, ...rest }: {
|
|
14
|
+
date?: Date;
|
|
15
|
+
soonDays?: number;
|
|
16
|
+
overdue?: boolean;
|
|
17
|
+
overdueLabel?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "@webority/ui-elements/elements/filter-popover";
|
|
1
2
|
/**
|
|
2
3
|
* The filters above a list, driven by one facet list: a control per facet, then a removable chip for
|
|
3
4
|
* each active filter and a Clear all button. Built for `AppTableToolbar`'s `filters` slot and
|
|
@@ -25,9 +26,10 @@
|
|
|
25
26
|
* @param {(key: string, value: string|string[]|{ from: string, to: string }) => void} props.onChange
|
|
26
27
|
* Called with the facet key and its new value. Clear all calls it once per active facet, with the empty value.
|
|
27
28
|
* @param {number} [props.inline=3] How many facets stay in the row; the rest fold into the Filters button.
|
|
29
|
+
* @param {boolean} [props.floating=false] A floating panel: hover, click or F opens the facets in a non-modal panel under the Filters button, with a chip summary in the row.
|
|
28
30
|
* @param {string} [props.className]
|
|
29
31
|
*/
|
|
30
|
-
export default function AppFilterBar({ facets: allFacets, value, onChange, inline, className, ...rest }: {
|
|
32
|
+
export default function AppFilterBar({ facets: allFacets, value, onChange, inline, floating, className, ...rest }: {
|
|
31
33
|
facets: {
|
|
32
34
|
key: string;
|
|
33
35
|
label: string;
|
|
@@ -47,5 +49,6 @@ export default function AppFilterBar({ facets: allFacets, value, onChange, inlin
|
|
|
47
49
|
to: string;
|
|
48
50
|
}) => void;
|
|
49
51
|
inline?: number;
|
|
52
|
+
floating?: boolean;
|
|
50
53
|
className?: string;
|
|
51
54
|
}): import("react").JSX.Element;
|
|
@@ -16,14 +16,16 @@
|
|
|
16
16
|
* (one field per row) from md up; below that labels sit on top.
|
|
17
17
|
* @param {'comfortable'|'compact'} [props.density='comfortable'] `compact` uses 36px controls and
|
|
18
18
|
* tighter gaps, for admin screens and dialogs.
|
|
19
|
+
* @param {2|3|4} [props.headingLevel=3] Heading level of the section title, so it nests under the page or drawer heading.
|
|
19
20
|
* @param {string} [props.className]
|
|
20
21
|
*/
|
|
21
|
-
export default function AppFormSection({ children, title, description, layout, labels, density, className, ...rest }: {
|
|
22
|
+
export default function AppFormSection({ children, title, description, layout, labels, density, headingLevel, className, ...rest }: {
|
|
22
23
|
children: import('react').ReactNode;
|
|
23
24
|
title?: import('react').ReactNode;
|
|
24
25
|
description?: import('react').ReactNode;
|
|
25
26
|
layout?: 'stacked' | 'side';
|
|
26
27
|
labels?: 'top' | 'start';
|
|
27
28
|
density?: 'comfortable' | 'compact';
|
|
29
|
+
headingLevel?: 2 | 3 | 4;
|
|
28
30
|
className?: string;
|
|
29
31
|
}): import("react").JSX.Element;
|
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
* @param {string} [props.emptyText='Nothing here'] Text of an empty column.
|
|
50
50
|
* @param {boolean} [props.readOnly=false] No card can move.
|
|
51
51
|
* @param {boolean} [props.swipeHint=false] On phones, a "Swipe sideways or tap a column" line under the switcher.
|
|
52
|
+
* @param {number} [props.columnWidth] Width of each column in px.
|
|
53
|
+
* @param {number} [props.fillOffset] Px taken off the viewport height when the board fills the screen, in place of the 240px default.
|
|
54
|
+
* @param {string} [props.activeCardKey] The key of the card just added, highlighted until the next render.
|
|
55
|
+
* @param {'inline'|'stacked'} [props.headLayout='inline'] Stacked puts each stage name on its own line, with no tone dot.
|
|
52
56
|
* @param {boolean} [props.fill=false] From md up, the board fits the screen: it is the viewport's height
|
|
53
57
|
* less `--wui-kanban-fill-offset` (240px by default; set it on the board for the page around it), and
|
|
54
58
|
* each column's cards scroll inside the column under its fixed head, so a long column never scrolls
|
|
@@ -60,7 +64,7 @@
|
|
|
60
64
|
* @param {string} [props.className]
|
|
61
65
|
* @param {string} [props.id] The board's id; the column, body and help ids derive from it. Generated when omitted.
|
|
62
66
|
*/
|
|
63
|
-
export default function AppKanban({ columns, cards, renderCard, renderColumnActions, getCardKey, getCardColumn, getCardValue, cardLabel, isCardLocked, onLocked, onMove, accept, filter, boardId, ariaLabel, emptyText, readOnly, swipeHint, fill, summaryFormat, summaryUnit, className, id, ...rest }: {
|
|
67
|
+
export default function AppKanban({ columns, cards, renderCard, renderColumnActions, getCardKey, getCardColumn, getCardValue, cardLabel, isCardLocked, onLocked, onMove, accept, filter, boardId, ariaLabel, emptyText, readOnly, swipeHint, fill, columnWidth, fillOffset, activeCardKey, headLayout, summaryFormat, summaryUnit, className, id, ...rest }: {
|
|
64
68
|
columns: {
|
|
65
69
|
key: string;
|
|
66
70
|
title: string;
|
|
@@ -100,6 +104,10 @@ export default function AppKanban({ columns, cards, renderCard, renderColumnActi
|
|
|
100
104
|
emptyText?: string;
|
|
101
105
|
readOnly?: boolean;
|
|
102
106
|
swipeHint?: boolean;
|
|
107
|
+
columnWidth?: number;
|
|
108
|
+
fillOffset?: number;
|
|
109
|
+
activeCardKey?: string;
|
|
110
|
+
headLayout?: 'inline' | 'stacked';
|
|
103
111
|
fill?: boolean;
|
|
104
112
|
summaryFormat?: 'number' | 'currency' | 'compact';
|
|
105
113
|
summaryUnit?: 'rupees' | 'paise';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A row of three to five linked values, each with a label and a note, with no card chrome.
|
|
3
|
+
* The Razor `<app-metric-strip>` renders the same markup and classes.
|
|
4
|
+
*
|
|
5
|
+
* @param {object} props
|
|
6
|
+
* @param {{ label: string, value: import('react').ReactNode, note?: string, href?: string, tone?: 'neutral'|'success'|'warning'|'danger'|'info' }[]} props.items
|
|
7
|
+
* @param {3|4|5} [props.columns=4] How many values sit in a row.
|
|
8
|
+
* @param {'sm'|'md'} [props.size='md'] The value and label scale.
|
|
9
|
+
* @param {string} [props.className]
|
|
10
|
+
*/
|
|
11
|
+
export default function AppMetricStrip({ items, columns, size, className, ...rest }: {
|
|
12
|
+
items: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: import('react').ReactNode;
|
|
15
|
+
note?: string;
|
|
16
|
+
href?: string;
|
|
17
|
+
tone?: 'neutral' | 'success' | 'warning' | 'danger' | 'info';
|
|
18
|
+
}[];
|
|
19
|
+
columns?: 3 | 4 | 5;
|
|
20
|
+
size?: 'sm' | 'md';
|
|
21
|
+
className?: string;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
* root `.page-header` stacks the breadcrumbs above that row. A header with no actions
|
|
13
13
|
* is still a single-item row — visually the same left-aligned block as before.
|
|
14
14
|
*
|
|
15
|
+
* `size="bar"` is a different shape: one 40px header row with the breadcrumbs as an
|
|
16
|
+
* inline prefix, then the title, status, views, meta, tools and actions. It shows no
|
|
17
|
+
* icon, eyebrow or subtitle.
|
|
18
|
+
*
|
|
15
19
|
* @param {object} props
|
|
16
20
|
* @param {import('react').ReactNode} props.title Rendered as the screen heading.
|
|
17
21
|
* @param {"h1"|"h2"|"h3"|"h4"|"h5"|"h6"} [props.as="h1"] The heading element for the title. Keep one h1 per page.
|
|
@@ -22,13 +26,19 @@
|
|
|
22
26
|
* @param {import('react').ReactNode} [props.status] Inline slot beside the title (e.g. an AppStatusBadge).
|
|
23
27
|
* @param {import('react').ReactNode} [props.breadcrumbs] A breadcrumbs row above the masthead (usually AppBreadcrumbs).
|
|
24
28
|
* @param {import('react').ReactNode} [props.actions] Right-aligned page-level actions (usually an AppButton).
|
|
25
|
-
* @param {
|
|
29
|
+
* @param {import('react').ReactNode} [props.views] Saved views after the title (size "bar" only).
|
|
30
|
+
* @param {import('react').ReactNode} [props.tools] Search, filters and display, before the actions (size "bar" only).
|
|
31
|
+
* @param {import('react').ReactNode} [props.meta] One short facts line or summary (size "bar" only).
|
|
32
|
+
* @param {"inline"|"below"} [props.metaPlacement="inline"] Where the meta line sits: inside the bar, or under it (size "bar" only).
|
|
33
|
+
* @param {string} [props.bulkFor] Id of the data table whose selection swaps views and tools for its bulk bar (size "bar" only).
|
|
34
|
+
* @param {import('react').ReactNode} [props.bulk] Bulk actions shown in the bar while the table named by bulkFor has rows ticked (size "bar" only).
|
|
35
|
+
* @param {"sm"|"md"|"lg"|"bar"} [props.size="md"] Title / spacing scale. "bar" is one 40px row.
|
|
26
36
|
* @param {"start"|"center"} [props.align="start"] Centre the masthead — for empty states and wizards.
|
|
27
37
|
* @param {boolean} [props.divider=false] A bottom border under the masthead.
|
|
28
38
|
* @param {boolean} [props.sticky=false] Stick the masthead to the top of the scroll container.
|
|
29
39
|
* @param {string} [props.className]
|
|
30
40
|
*/
|
|
31
|
-
export default function AppPageHeader({ title, as, subtitle, eyebrow, icon, tone, status, breadcrumbs, actions, size, align, divider, sticky, className, ...rest }: {
|
|
41
|
+
export default function AppPageHeader({ title, as, subtitle, eyebrow, icon, tone, status, breadcrumbs, actions, views, tools, meta, metaPlacement, bulkFor, bulk, size, align, divider, sticky, className, ...rest }: {
|
|
32
42
|
title: import('react').ReactNode;
|
|
33
43
|
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
34
44
|
subtitle?: import('react').ReactNode;
|
|
@@ -38,7 +48,13 @@ export default function AppPageHeader({ title, as, subtitle, eyebrow, icon, tone
|
|
|
38
48
|
status?: import('react').ReactNode;
|
|
39
49
|
breadcrumbs?: import('react').ReactNode;
|
|
40
50
|
actions?: import('react').ReactNode;
|
|
41
|
-
|
|
51
|
+
views?: import('react').ReactNode;
|
|
52
|
+
tools?: import('react').ReactNode;
|
|
53
|
+
meta?: import('react').ReactNode;
|
|
54
|
+
metaPlacement?: "inline" | "below";
|
|
55
|
+
bulkFor?: string;
|
|
56
|
+
bulk?: import('react').ReactNode;
|
|
57
|
+
size?: "sm" | "md" | "lg" | "bar";
|
|
42
58
|
align?: "start" | "center";
|
|
43
59
|
divider?: boolean;
|
|
44
60
|
sticky?: boolean;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single-choice scale from `min` to `max` (0 to 10 by default) for a question such as "How likely are you to
|
|
3
|
+
* recommend us?": one value per radio, the chosen value marked, and optional text under the lowest and highest
|
|
4
|
+
* values. It is a labelled radiogroup laid out like any other field; the arrow keys move and choose, and it posts
|
|
5
|
+
* with its form through `name`. Razor `<app-score-scale>` renders the same markup.
|
|
6
|
+
*
|
|
7
|
+
* Controlled: the parent holds `value`, and `null` means no choice yet. The chosen value is reported through `onChange`.
|
|
8
|
+
*
|
|
9
|
+
* @param {object} props
|
|
10
|
+
* @param {number|null} [props.value=null] The chosen value, or null for none (controlled).
|
|
11
|
+
* @param {(value: number) => void} [props.onChange] Called with the value the person chose.
|
|
12
|
+
* @param {number} [props.min=0] The lowest value on the scale.
|
|
13
|
+
* @param {number} [props.max=10] The highest value on the scale.
|
|
14
|
+
* @param {import('react').ReactNode} [props.label] The visible group label; names the group.
|
|
15
|
+
* @param {string} [props.lowLabel] Text under the lowest value, such as "Not likely".
|
|
16
|
+
* @param {string} [props.highLabel] Text under the highest value, such as "Very likely".
|
|
17
|
+
* @param {string} [props.name] The form field name carried by every radio. Defaults to a generated one.
|
|
18
|
+
* @param {boolean} [props.disabled=false]
|
|
19
|
+
* @param {string} [props.error] Message below the scale. Replaces the hint.
|
|
20
|
+
* @param {string} [props.hint] Helper text below the scale.
|
|
21
|
+
* @param {string} [props.id]
|
|
22
|
+
* @param {string} [props.className] Class on the scale (the control).
|
|
23
|
+
* @param {string} [props.fieldClassName] Class on the `.field` wrapper.
|
|
24
|
+
*/
|
|
25
|
+
export default function AppScoreScale({ value, onChange, min, max, label, lowLabel, highLabel, name, disabled, error, hint, id, className, fieldClassName, }: {
|
|
26
|
+
value?: number | null;
|
|
27
|
+
onChange?: (value: number) => void;
|
|
28
|
+
min?: number;
|
|
29
|
+
max?: number;
|
|
30
|
+
label?: import('react').ReactNode;
|
|
31
|
+
lowLabel?: string;
|
|
32
|
+
highLabel?: string;
|
|
33
|
+
name?: string;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
error?: string;
|
|
36
|
+
hint?: string;
|
|
37
|
+
id?: string;
|
|
38
|
+
className?: string;
|
|
39
|
+
fieldClassName?: string;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export default function AppSegmented({ options, value, onChange, label, name, size, fullWidth, bordered, disabled, className, ...rest }: {
|
|
1
|
+
export default function AppSegmented({ options, value, onChange, label, name, size, fullWidth, bordered, disabled, labelVisible, className, ...rest }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
bordered?: boolean;
|
|
4
4
|
className?: string;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
fullWidth?: boolean;
|
|
7
7
|
label: any;
|
|
8
|
+
labelVisible?: boolean;
|
|
8
9
|
name: any;
|
|
9
10
|
onChange: any;
|
|
10
11
|
options?: any[];
|
|
@@ -185,6 +185,7 @@ export type SearchShape = {
|
|
|
185
185
|
* @param {boolean} [props.collapsed] Controlled rail state. Omit to let the shell own it.
|
|
186
186
|
* @param {(collapsed: boolean) => void} [props.onCollapsedChange]
|
|
187
187
|
* @param {boolean} [props.noSidebar=false] Full-width, no side nav — a focused wizard. No tab bar either.
|
|
188
|
+
* @param {'comfortable'|'compact'} [props.density='comfortable'] Compact sets the content's top padding to 12px.
|
|
188
189
|
* @param {string} [props.navLabel='Main navigation']
|
|
189
190
|
* @param {string} [props.currentPath] The current location; items without `active` are matched against it.
|
|
190
191
|
* @param {boolean} [props.rememberCollapsed=false] Remember the uncontrolled rail state in a cookie.
|
|
@@ -196,7 +197,7 @@ export type SearchShape = {
|
|
|
196
197
|
* @param {SearchShape} [props.search] The topbar search.
|
|
197
198
|
* @param {string} [props.className]
|
|
198
199
|
*/
|
|
199
|
-
export default function AppShell({ groups, brand, sidebarStart, sidebarStartCompact, sidebarFooter, topbarStart, topbarEnd, footer, children, collapsed, onCollapsedChange, noSidebar, navLabel, linkComponent: Link, currentPath, rememberCollapsed, collapsedCookie, tabBarLabel, moreLabel, userMenu, notifications, search, className, ...rest }: {
|
|
200
|
+
export default function AppShell({ groups, brand, sidebarStart, sidebarStartCompact, sidebarFooter, topbarStart, topbarEnd, footer, children, collapsed, onCollapsedChange, noSidebar, density, navLabel, linkComponent: Link, currentPath, rememberCollapsed, collapsedCookie, tabBarLabel, moreLabel, userMenu, notifications, search, className, ...rest }: {
|
|
200
201
|
groups: {
|
|
201
202
|
label?: string;
|
|
202
203
|
items: NavItemShape[];
|
|
@@ -213,6 +214,7 @@ export default function AppShell({ groups, brand, sidebarStart, sidebarStartComp
|
|
|
213
214
|
collapsed?: boolean;
|
|
214
215
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
215
216
|
noSidebar?: boolean;
|
|
217
|
+
density?: 'comfortable' | 'compact';
|
|
216
218
|
navLabel?: string;
|
|
217
219
|
currentPath?: string;
|
|
218
220
|
rememberCollapsed?: boolean;
|
|
@@ -33,11 +33,12 @@
|
|
|
33
33
|
* @param {(step: object, index: number) => void} [props.onStepClick] Makes each step a
|
|
34
34
|
* button that reports the step it stands for. React-only (no Razor counterpart).
|
|
35
35
|
* @param {string} [props.label='Progress'] Accessible name for the list.
|
|
36
|
+
* @param {'primary'|'info'} [props.tone='primary'] The accent of the active and done steps.
|
|
36
37
|
* @param {import('react').ElementType} [props.linkComponent] Router link for a revisitable
|
|
37
38
|
* step; it receives `to` instead of `href`.
|
|
38
39
|
* @param {string} [props.className]
|
|
39
40
|
*/
|
|
40
|
-
export default function AppStepper({ steps, variant, orientation, iconVariant, size, iconSize, activeStep, onStepClick, label, linkComponent: Link, className, ...rest }: {
|
|
41
|
+
export default function AppStepper({ steps, variant, orientation, iconVariant, size, iconSize, activeStep, onStepClick, label, tone, linkComponent: Link, className, ...rest }: {
|
|
41
42
|
steps: {
|
|
42
43
|
key?: string;
|
|
43
44
|
label: string;
|
|
@@ -54,6 +55,7 @@ export default function AppStepper({ steps, variant, orientation, iconVariant, s
|
|
|
54
55
|
activeStep?: number;
|
|
55
56
|
onStepClick?: (step: object, index: number) => void;
|
|
56
57
|
label?: string;
|
|
58
|
+
tone?: 'primary' | 'info';
|
|
57
59
|
linkComponent?: import('react').ElementType;
|
|
58
60
|
className?: string;
|
|
59
61
|
}): import("react").JSX.Element;
|
|
@@ -23,7 +23,7 @@ import "@webority/ui-elements/elements/overflow";
|
|
|
23
23
|
* caller passes as `value`.
|
|
24
24
|
*
|
|
25
25
|
* @param {object} props
|
|
26
|
-
* @param {{ key: string, label: import('react').ReactNode, count?: number, tone?: string, icon?: string|import('react').ReactNode, image?: string, imageAlt?: string, tooltip?: import('react').ReactNode, danger?: boolean, disabled?: boolean, href?: string, to?: string, target?: string, rel?: string }[]} props.tabs
|
|
26
|
+
* @param {{ key: string, label: import('react').ReactNode, count?: number, countLabel?: string, tone?: string, icon?: string|import('react').ReactNode, image?: string, imageAlt?: string, tooltip?: import('react').ReactNode, danger?: boolean, disabled?: boolean, href?: string, to?: string, target?: string, rel?: string }[]} props.tabs
|
|
27
27
|
* `icon` is an iconsax name from the library catalogue OR a custom node (e.g. an iconsax glyph); `image` is a
|
|
28
28
|
* picture URL (logo/avatar) rendered before the label — `image` wins over `icon`. `tooltip`
|
|
29
29
|
* is a hover/focus hint (text or node) shown on the tab via AppTooltip — the same branded
|
|
@@ -40,17 +40,19 @@ import "@webority/ui-elements/elements/overflow";
|
|
|
40
40
|
* `scroll` scrolls it (chevrons and edge fades); `menu` moves the tabs that do not fit into a More menu
|
|
41
41
|
* (`<wui-overflow>`), always keeping the selected tab visible. Ignored when `orientation="vertical"`.
|
|
42
42
|
* @param {string} [props.moreLabel="More"] The More button's text when `overflow="menu"`.
|
|
43
|
+
* @param {number} [props.maxVisible] Puts the tabs that do not fit the row in a More menu, as overflow="menu" does; the selected tab always stays visible.
|
|
43
44
|
* @param {"automatic"|"manual"} [props.activation="automatic"] Whether arrow keys also select.
|
|
44
45
|
* @param {string} [props.ariaLabel]
|
|
45
46
|
* @param {string} [props.className]
|
|
46
47
|
* @param {import('react').CSSProperties} [props.style]
|
|
47
48
|
* @param {"success"|"warning"|"danger"|"info"} [props.tone] Per-tab count-pill tint (set as `tabs[].tone`).
|
|
48
49
|
*/
|
|
49
|
-
export default function AppTabs({ tabs, value, onChange, linkComponent, variant, orientation, size, fitted, overflow, moreLabel, activation, ariaLabel, className, style, ...rest }: {
|
|
50
|
+
export default function AppTabs({ tabs, value, onChange, linkComponent, variant, orientation, size, fitted, overflow, moreLabel, maxVisible, activation, ariaLabel, className, style, ...rest }: {
|
|
50
51
|
tabs: {
|
|
51
52
|
key: string;
|
|
52
53
|
label: import('react').ReactNode;
|
|
53
54
|
count?: number;
|
|
55
|
+
countLabel?: string;
|
|
54
56
|
tone?: string;
|
|
55
57
|
icon?: string | import('react').ReactNode;
|
|
56
58
|
image?: string;
|
|
@@ -72,6 +74,7 @@ export default function AppTabs({ tabs, value, onChange, linkComponent, variant,
|
|
|
72
74
|
fitted?: boolean;
|
|
73
75
|
overflow?: "scroll" | "menu";
|
|
74
76
|
moreLabel?: string;
|
|
77
|
+
maxVisible?: number;
|
|
75
78
|
activation?: "automatic" | "manual";
|
|
76
79
|
ariaLabel?: string;
|
|
77
80
|
className?: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export { default as AppDescriptions } from "./components/AppDescriptions.jsx";
|
|
|
43
43
|
export { default as AppDrawer } from "./components/AppDrawer.jsx";
|
|
44
44
|
export { default as AppDropdown } from "./components/AppDropdown.jsx";
|
|
45
45
|
export { default as AppDropZone } from "./components/AppDropZone.jsx";
|
|
46
|
+
export { default as AppDueDate } from "./components/AppDueDate.jsx";
|
|
46
47
|
export { default as AppEmptyState } from "./components/AppEmptyState.jsx";
|
|
47
48
|
export { default as AppErrorSummary } from "./components/AppErrorSummary.jsx";
|
|
48
49
|
export { default as AppFileAttachment } from "./components/AppFileAttachment.jsx";
|
|
@@ -69,6 +70,7 @@ export { default as AppLogoPicker } from "./components/AppLogoPicker.jsx";
|
|
|
69
70
|
export { default as AppMentionInput } from "./components/AppMentionInput.jsx";
|
|
70
71
|
export { default as AppMenubar } from "./components/AppMenubar.jsx";
|
|
71
72
|
export { default as AppMeter } from "./components/AppMeter.jsx";
|
|
73
|
+
export { default as AppMetricStrip } from "./components/AppMetricStrip.jsx";
|
|
72
74
|
export { default as AppModal } from "./components/AppModal.jsx";
|
|
73
75
|
export { default as AppMultiSelect } from "./components/AppMultiSelect.jsx";
|
|
74
76
|
export { default as AppNavigationMenu } from "./components/AppNavigationMenu.jsx";
|
|
@@ -98,6 +100,7 @@ export { default as AppResult } from "./components/AppResult.jsx";
|
|
|
98
100
|
export { default as AppRichText } from "./components/AppRichText.jsx";
|
|
99
101
|
export { default as AppRollingNumber } from "./components/AppRollingNumber.jsx";
|
|
100
102
|
export { default as AppRouteError } from "./components/AppRouteError.jsx";
|
|
103
|
+
export { default as AppScoreScale } from "./components/AppScoreScale.jsx";
|
|
101
104
|
export { default as AppScrollbar } from "./components/AppScrollbar.jsx";
|
|
102
105
|
export { default as AppSearch } from "./components/AppSearch.jsx";
|
|
103
106
|
export { default as AppSectionCallToAction } from "./components/AppSectionCallToAction.jsx";
|
package/dist/ui-react.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./components/AppTooltip.js";import t,{iconNames as n,registerIcons as r}from"./components/AppIcon.js";import i from"./components/AppAccordion.js";import a from"./components/AppActionIcon.js";import o from"./components/AppAlert.js";import s from"./components/AppButton.js";import c from"./components/AppEmptyState.js";import l from"./components/AppSpinner.js";import u from"./components/AppAsyncBlock.js";import d from"./components/AppPopover.js";import f from"./components/AppInfoTip.js";import p from"./components/AppRequiredMark.js";import m from"./components/AppAutocomplete.js";import h from"./components/AppAvatar.js";import g from"./components/AppAvatarGroup.js";import _ from"./components/AppModal.js";import v from"./components/AppAvatarPicker.js";import y from"./components/AppBadge.js";import b from"./components/AppBanner.js";import x from"./components/AppBreadcrumbs.js";import S from"./components/AppButtonGroup.js";import C from"./components/AppCalendar.js";import w from"./components/AppCard.js";import T from"./components/AppCarousel.js";import E from"./components/AppChart.js";import D from"./components/AppDropdown.js";import O from"./components/AppSegmented.js";import k from"./components/AppChartCard.js";import A from"./components/AppCheckbox.js";import j from"./components/AppChip.js";import M from"./components/AppChipGroup.js";import N from"./components/AppChoiceCard.js";import P from"./components/AppChoiceChip.js";import F from"./components/AppCodeBlock.js";import I from"./components/AppColorField.js";import L from"./components/AppColumnMenu.js";import R from"./components/AppCommandPalette.js";import z from"./components/AppCommentThread.js";import B from"./components/AppCompareTable.js";import V from"./components/AppInput.js";import{MODAL_ICONS as H}from"./components/ModalIcons.js";import U from"./components/AppConfirmDialog.js";import W from"./components/AppConsentBanner.js";import G from"./components/AppContextMenu.js";import K from"./components/AppCopyButton.js";import q from"./components/AppCountrySelect.js";import J from"./components/AppDashboardCell.js";import Y from"./components/AppDashboardGrid.js";import X,{AppSkeletonRows as Z}from"./components/AppSkeleton.js";import Q from"./components/AppSelectMini.js";import $ from"./components/AppTablePagination.js";import ee from"./components/AppDataTable.js";import te from"./components/AppDatePicker.js";import ne from"./components/AppDateRangePicker.js";import re from"./components/AppDescriptions.js";import ie from"./components/AppDrawer.js";import ae from"./components/AppDropZone.js";import oe from"./components/AppErrorSummary.js";import se from"./components/AppFileAttachment.js";import ce from"./components/AppFilePicker.js";import le from"./components/AppFileViewer.js";import{buildListQuery as ue,parseListQuery as de}from"./lib/listQuery.js";import fe from"./components/AppMultiSelect.js";import pe from"./components/AppSearch.js";import me from"./components/AppSelect.js";import he from"./components/AppFilterBar.js";import ge from"./components/AppFloatingDock.js";import _e from"./components/AppFormActions.js";import ve from"./components/AppFormRow.js";import ye from"./components/AppFormSection.js";import be from"./components/AppHoverCard.js";import xe from"./components/AppInfoList.js";import Se from"./components/AppInlineEdit.js";import Ce from"./components/AppInputGroup.js";import{dismissAll as we,errorToast as Te,toast as Ee}from"./components/toast.js";import De from"./components/AppKanban.js";import Oe from"./components/AppKbd.js";import ke from"./components/AppSparkline.js";import Ae from"./components/AppKpiTile.js";import je from"./components/AppLightbox.js";import Me from"./components/AppLink.js";import Ne from"./components/AppLogoPicker.js";import Pe from"./components/AppMentionInput.js";import Fe from"./components/AppMenubar.js";import Ie from"./components/AppMeter.js";import Le from"./components/AppNavigationMenu.js";import Re from"./components/AppNotificationCenter.js";import ze from"./components/AppNumberInput.js";import Be from"./components/AppOnboardingChecklist.js";import Ve from"./components/AppOtpInput.js";import He from"./components/AppPageHeader.js";import Ue from"./components/AppPagination.js";import We from"./components/AppPhoneNumberInput.js";import Ge from"./components/AppPricingCard.js";import Ke from"./components/AppProgress.js";import qe from"./components/AppQrCode.js";import Je from"./components/AppRadio.js";import Ye from"./components/AppRadioGroup.js";import Xe from"./components/AppRating.js";import Ze from"./components/AppRecordPager.js";import Qe from"./components/AppRelativeTime.js";import $e from"./components/AppRepeater.js";import et from"./components/AppResizable.js";import tt from"./components/AppResizableHandle.js";import nt from"./components/AppResizablePanel.js";import rt from"./components/AppResourceCard.js";import it from"./components/AppResult.js";import at from"./components/AppRichText.js";import ot from"./components/AppRollingNumber.js";import st from"./components/AppRouteError.js";import ct from"./components/AppScrollbar.js";import lt from"./components/AppSectionCallToAction.js";import ut from"./components/AppSectionFaq.js";import dt from"./components/AppSectionFeatures.js";import ft from"./components/AppSectionHero.js";import pt from"./components/AppSectionLogos.js";import mt from"./components/AppSectionPricing.js";import ht from"./components/AppSectionTestimonials.js";import gt from"./components/AppShell.js";import _t from"./components/AppShortcutLegend.js";import vt from"./components/AppShowMore.js";import yt from"./components/AppSidebarMenu.js";import bt from"./components/AppSlider.js";import xt from"./components/AppSortableList.js";import St from"./components/AppSplash.js";import Ct from"./components/AppSplitButton.js";import wt from"./components/AppSplitView.js";import Tt from"./components/AppStatusBadge.js";import Et from"./components/AppStepper.js";import Dt from"./components/AppSwitch.js";import Ot from"./components/AppTableEmptyState.js";import kt from"./components/AppTableToolbar.js";import At from"./components/AppTabs.js";import jt from"./components/AppTagInput.js";import Mt from"./components/AppTextarea.js";import Nt from"./components/AppThemeToggle.js";import Pt from"./components/AppTimeline.js";import Ft from"./components/AppTimePicker.js";import It from"./components/AppToast.js";import Lt from"./components/AppToolbar.js";import Rt from"./components/AppTour.js";import zt from"./components/AppTreeView.js";import Bt from"./components/AppTruncate.js";import Vt from"./components/AppUpdateBar.js";import Ht from"./components/AppWhatsNew.js";import Ut from"./components/AppWizard.js";import Wt from"./components/AppWorkspaceSwitcher.js";import{useCommandPaletteShortcut as Gt}from"./lib/useCommandPaletteShortcut.js";import{useFloatingStack as Kt}from"./lib/useFloatingStack.js";import{useListQuery as qt}from"./lib/useListQuery.js";import{useListShortcuts as Jt}from"./lib/useListShortcuts.js";import{usePagination as Yt}from"./lib/usePagination.js";import{useTableView as Xt}from"./lib/useTableView.js";import{createLocalSeenStore as Zt}from"@webority/ui-elements/elements/tour";import{postedMasked as Qt,themeBootScript as $t}from"@webority/ui-elements/helpers";export{i as AppAccordion,a as AppActionIcon,o as AppAlert,u as AppAsyncBlock,m as AppAutocomplete,h as AppAvatar,g as AppAvatarGroup,v as AppAvatarPicker,y as AppBadge,b as AppBanner,x as AppBreadcrumbs,s as AppButton,S as AppButtonGroup,C as AppCalendar,w as AppCard,T as AppCarousel,E as AppChart,k as AppChartCard,A as AppCheckbox,j as AppChip,M as AppChipGroup,N as AppChoiceCard,P as AppChoiceChip,F as AppCodeBlock,I as AppColorField,L as AppColumnMenu,R as AppCommandPalette,z as AppCommentThread,B as AppCompareTable,U as AppConfirmDialog,W as AppConsentBanner,G as AppContextMenu,K as AppCopyButton,q as AppCountrySelect,J as AppDashboardCell,Y as AppDashboardGrid,ee as AppDataTable,te as AppDatePicker,ne as AppDateRangePicker,re as AppDescriptions,ie as AppDrawer,ae as AppDropZone,D as AppDropdown,c as AppEmptyState,oe as AppErrorSummary,se as AppFileAttachment,ce as AppFilePicker,le as AppFileViewer,he as AppFilterBar,ge as AppFloatingDock,_e as AppFormActions,ve as AppFormRow,ye as AppFormSection,be as AppHoverCard,t as AppIcon,xe as AppInfoList,f as AppInfoTip,Se as AppInlineEdit,V as AppInput,Ce as AppInputGroup,De as AppKanban,Oe as AppKbd,Ae as AppKpiTile,je as AppLightbox,Me as AppLink,Ne as AppLogoPicker,Pe as AppMentionInput,Fe as AppMenubar,Ie as AppMeter,_ as AppModal,fe as AppMultiSelect,Le as AppNavigationMenu,Re as AppNotificationCenter,ze as AppNumberInput,Be as AppOnboardingChecklist,Ve as AppOtpInput,He as AppPageHeader,Ue as AppPagination,We as AppPhoneNumberInput,d as AppPopover,Ge as AppPricingCard,Ke as AppProgress,qe as AppQrCode,Je as AppRadio,Ye as AppRadioGroup,Xe as AppRating,Ze as AppRecordPager,Qe as AppRelativeTime,$e as AppRepeater,p as AppRequiredMark,et as AppResizable,tt as AppResizableHandle,nt as AppResizablePanel,rt as AppResourceCard,it as AppResult,at as AppRichText,ot as AppRollingNumber,st as AppRouteError,ct as AppScrollbar,pe as AppSearch,lt as AppSectionCallToAction,ut as AppSectionFaq,dt as AppSectionFeatures,ft as AppSectionHero,pt as AppSectionLogos,mt as AppSectionPricing,ht as AppSectionTestimonials,O as AppSegmented,me as AppSelect,Q as AppSelectMini,gt as AppShell,_t as AppShortcutLegend,vt as AppShowMore,yt as AppSidebarMenu,X as AppSkeleton,Z as AppSkeletonRows,bt as AppSlider,xt as AppSortableList,ke as AppSparkline,l as AppSpinner,St as AppSplash,Ct as AppSplitButton,wt as AppSplitView,Tt as AppStatusBadge,Et as AppStepper,Dt as AppSwitch,Ot as AppTableEmptyState,$ as AppTablePagination,kt as AppTableToolbar,At as AppTabs,jt as AppTagInput,Mt as AppTextarea,Nt as AppThemeToggle,Ft as AppTimePicker,Pt as AppTimeline,It as AppToast,Lt as AppToolbar,e as AppTooltip,Rt as AppTour,zt as AppTreeView,Bt as AppTruncate,Vt as AppUpdateBar,Ht as AppWhatsNew,Ut as AppWizard,Wt as AppWorkspaceSwitcher,H as MODAL_ICONS,ue as buildListQuery,Zt as createLocalSeenStore,we as dismissAll,Te as errorToast,n as iconNames,de as parseListQuery,Qt as postedMasked,r as registerIcons,$t as themeBootScript,Ee as toast,Gt as useCommandPaletteShortcut,Kt as useFloatingStack,qt as useListQuery,Jt as useListShortcuts,Yt as usePagination,Xt as useTableView};
|
|
1
|
+
import e from"./components/AppTooltip.js";import t,{iconNames as n,registerIcons as r}from"./components/AppIcon.js";import i from"./components/AppAccordion.js";import a from"./components/AppActionIcon.js";import o from"./components/AppAlert.js";import s from"./components/AppButton.js";import c from"./components/AppEmptyState.js";import l from"./components/AppSpinner.js";import u from"./components/AppAsyncBlock.js";import d from"./components/AppPopover.js";import f from"./components/AppInfoTip.js";import p from"./components/AppRequiredMark.js";import m from"./components/AppAutocomplete.js";import h from"./components/AppAvatar.js";import g from"./components/AppAvatarGroup.js";import _ from"./components/AppModal.js";import v from"./components/AppAvatarPicker.js";import y from"./components/AppBadge.js";import b from"./components/AppBanner.js";import x from"./components/AppBreadcrumbs.js";import S from"./components/AppButtonGroup.js";import C from"./components/AppCalendar.js";import w from"./components/AppCard.js";import T from"./components/AppCarousel.js";import E from"./components/AppChart.js";import D from"./components/AppDropdown.js";import O from"./components/AppSegmented.js";import k from"./components/AppChartCard.js";import A from"./components/AppCheckbox.js";import j from"./components/AppChip.js";import M from"./components/AppChipGroup.js";import N from"./components/AppChoiceCard.js";import P from"./components/AppChoiceChip.js";import F from"./components/AppCodeBlock.js";import I from"./components/AppColorField.js";import L from"./components/AppColumnMenu.js";import R from"./components/AppCommandPalette.js";import z from"./components/AppCommentThread.js";import B from"./components/AppCompareTable.js";import V from"./components/AppInput.js";import{MODAL_ICONS as H}from"./components/ModalIcons.js";import U from"./components/AppConfirmDialog.js";import W from"./components/AppConsentBanner.js";import G from"./components/AppContextMenu.js";import K from"./components/AppCopyButton.js";import q from"./components/AppCountrySelect.js";import J from"./components/AppDashboardCell.js";import Y from"./components/AppDashboardGrid.js";import X,{AppSkeletonRows as Z}from"./components/AppSkeleton.js";import Q from"./components/AppSelectMini.js";import $ from"./components/AppTablePagination.js";import ee from"./components/AppDataTable.js";import te from"./components/AppDatePicker.js";import ne from"./components/AppDateRangePicker.js";import re from"./components/AppDescriptions.js";import ie from"./components/AppDrawer.js";import ae from"./components/AppDropZone.js";import oe from"./components/AppDueDate.js";import se from"./components/AppErrorSummary.js";import ce from"./components/AppFileAttachment.js";import le from"./components/AppFilePicker.js";import ue from"./components/AppFileViewer.js";import{buildListQuery as de,parseListQuery as fe}from"./lib/listQuery.js";import pe from"./components/AppMultiSelect.js";import me from"./components/AppSearch.js";import he from"./components/AppSelect.js";import ge from"./components/AppSwitch.js";import _e from"./components/AppFilterBar.js";import ve from"./components/AppFloatingDock.js";import ye from"./components/AppFormActions.js";import be from"./components/AppFormRow.js";import xe from"./components/AppFormSection.js";import Se from"./components/AppHoverCard.js";import Ce from"./components/AppInfoList.js";import we from"./components/AppInlineEdit.js";import Te from"./components/AppInputGroup.js";import{dismissAll as Ee,errorToast as De,toast as Oe}from"./components/toast.js";import ke from"./components/AppKanban.js";import Ae from"./components/AppKbd.js";import je from"./components/AppSparkline.js";import Me from"./components/AppKpiTile.js";import Ne from"./components/AppLightbox.js";import Pe from"./components/AppLink.js";import Fe from"./components/AppLogoPicker.js";import Ie from"./components/AppMentionInput.js";import Le from"./components/AppMenubar.js";import Re from"./components/AppMeter.js";import ze from"./components/AppMetricStrip.js";import Be from"./components/AppNavigationMenu.js";import Ve from"./components/AppNotificationCenter.js";import He from"./components/AppNumberInput.js";import Ue from"./components/AppOnboardingChecklist.js";import We from"./components/AppOtpInput.js";import Ge from"./components/AppPageHeader.js";import Ke from"./components/AppPagination.js";import qe from"./components/AppPhoneNumberInput.js";import Je from"./components/AppPricingCard.js";import Ye from"./components/AppProgress.js";import Xe from"./components/AppQrCode.js";import Ze from"./components/AppRadio.js";import Qe from"./components/AppRadioGroup.js";import $e from"./components/AppRating.js";import et from"./components/AppRecordPager.js";import tt from"./components/AppRelativeTime.js";import nt from"./components/AppRepeater.js";import rt from"./components/AppResizable.js";import it from"./components/AppResizableHandle.js";import at from"./components/AppResizablePanel.js";import ot from"./components/AppResourceCard.js";import st from"./components/AppResult.js";import ct from"./components/AppRichText.js";import lt from"./components/AppRollingNumber.js";import ut from"./components/AppRouteError.js";import dt from"./components/AppScoreScale.js";import ft from"./components/AppScrollbar.js";import pt from"./components/AppSectionCallToAction.js";import mt from"./components/AppSectionFaq.js";import ht from"./components/AppSectionFeatures.js";import gt from"./components/AppSectionHero.js";import _t from"./components/AppSectionLogos.js";import vt from"./components/AppSectionPricing.js";import yt from"./components/AppSectionTestimonials.js";import bt from"./components/AppShell.js";import xt from"./components/AppShortcutLegend.js";import St from"./components/AppShowMore.js";import Ct from"./components/AppSidebarMenu.js";import wt from"./components/AppSlider.js";import Tt from"./components/AppSortableList.js";import Et from"./components/AppSplash.js";import Dt from"./components/AppSplitButton.js";import Ot from"./components/AppSplitView.js";import kt from"./components/AppStatusBadge.js";import At from"./components/AppStepper.js";import jt from"./components/AppTableEmptyState.js";import Mt from"./components/AppTableToolbar.js";import Nt from"./components/AppTabs.js";import Pt from"./components/AppTagInput.js";import Ft from"./components/AppTextarea.js";import It from"./components/AppThemeToggle.js";import Lt from"./components/AppTimeline.js";import Rt from"./components/AppTimePicker.js";import zt from"./components/AppToast.js";import Bt from"./components/AppToolbar.js";import Vt from"./components/AppTour.js";import Ht from"./components/AppTreeView.js";import Ut from"./components/AppTruncate.js";import Wt from"./components/AppUpdateBar.js";import Gt from"./components/AppWhatsNew.js";import Kt from"./components/AppWizard.js";import qt from"./components/AppWorkspaceSwitcher.js";import{useCommandPaletteShortcut as Jt}from"./lib/useCommandPaletteShortcut.js";import{useFloatingStack as Yt}from"./lib/useFloatingStack.js";import{useListQuery as Xt}from"./lib/useListQuery.js";import{useListShortcuts as Zt}from"./lib/useListShortcuts.js";import{usePagination as Qt}from"./lib/usePagination.js";import{useTableView as $t}from"./lib/useTableView.js";import{createLocalSeenStore as en}from"@webority/ui-elements/elements/tour";import{postedMasked as tn,themeBootScript as nn}from"@webority/ui-elements/helpers";export{i as AppAccordion,a as AppActionIcon,o as AppAlert,u as AppAsyncBlock,m as AppAutocomplete,h as AppAvatar,g as AppAvatarGroup,v as AppAvatarPicker,y as AppBadge,b as AppBanner,x as AppBreadcrumbs,s as AppButton,S as AppButtonGroup,C as AppCalendar,w as AppCard,T as AppCarousel,E as AppChart,k as AppChartCard,A as AppCheckbox,j as AppChip,M as AppChipGroup,N as AppChoiceCard,P as AppChoiceChip,F as AppCodeBlock,I as AppColorField,L as AppColumnMenu,R as AppCommandPalette,z as AppCommentThread,B as AppCompareTable,U as AppConfirmDialog,W as AppConsentBanner,G as AppContextMenu,K as AppCopyButton,q as AppCountrySelect,J as AppDashboardCell,Y as AppDashboardGrid,ee as AppDataTable,te as AppDatePicker,ne as AppDateRangePicker,re as AppDescriptions,ie as AppDrawer,ae as AppDropZone,D as AppDropdown,oe as AppDueDate,c as AppEmptyState,se as AppErrorSummary,ce as AppFileAttachment,le as AppFilePicker,ue as AppFileViewer,_e as AppFilterBar,ve as AppFloatingDock,ye as AppFormActions,be as AppFormRow,xe as AppFormSection,Se as AppHoverCard,t as AppIcon,Ce as AppInfoList,f as AppInfoTip,we as AppInlineEdit,V as AppInput,Te as AppInputGroup,ke as AppKanban,Ae as AppKbd,Me as AppKpiTile,Ne as AppLightbox,Pe as AppLink,Fe as AppLogoPicker,Ie as AppMentionInput,Le as AppMenubar,Re as AppMeter,ze as AppMetricStrip,_ as AppModal,pe as AppMultiSelect,Be as AppNavigationMenu,Ve as AppNotificationCenter,He as AppNumberInput,Ue as AppOnboardingChecklist,We as AppOtpInput,Ge as AppPageHeader,Ke as AppPagination,qe as AppPhoneNumberInput,d as AppPopover,Je as AppPricingCard,Ye as AppProgress,Xe as AppQrCode,Ze as AppRadio,Qe as AppRadioGroup,$e as AppRating,et as AppRecordPager,tt as AppRelativeTime,nt as AppRepeater,p as AppRequiredMark,rt as AppResizable,it as AppResizableHandle,at as AppResizablePanel,ot as AppResourceCard,st as AppResult,ct as AppRichText,lt as AppRollingNumber,ut as AppRouteError,dt as AppScoreScale,ft as AppScrollbar,me as AppSearch,pt as AppSectionCallToAction,mt as AppSectionFaq,ht as AppSectionFeatures,gt as AppSectionHero,_t as AppSectionLogos,vt as AppSectionPricing,yt as AppSectionTestimonials,O as AppSegmented,he as AppSelect,Q as AppSelectMini,bt as AppShell,xt as AppShortcutLegend,St as AppShowMore,Ct as AppSidebarMenu,X as AppSkeleton,Z as AppSkeletonRows,wt as AppSlider,Tt as AppSortableList,je as AppSparkline,l as AppSpinner,Et as AppSplash,Dt as AppSplitButton,Ot as AppSplitView,kt as AppStatusBadge,At as AppStepper,ge as AppSwitch,jt as AppTableEmptyState,$ as AppTablePagination,Mt as AppTableToolbar,Nt as AppTabs,Pt as AppTagInput,Ft as AppTextarea,It as AppThemeToggle,Rt as AppTimePicker,Lt as AppTimeline,zt as AppToast,Bt as AppToolbar,e as AppTooltip,Vt as AppTour,Ht as AppTreeView,Ut as AppTruncate,Wt as AppUpdateBar,Gt as AppWhatsNew,Kt as AppWizard,qt as AppWorkspaceSwitcher,H as MODAL_ICONS,de as buildListQuery,en as createLocalSeenStore,Ee as dismissAll,De as errorToast,n as iconNames,fe as parseListQuery,tn as postedMasked,r as registerIcons,nn as themeBootScript,Oe as toast,Jt as useCommandPaletteShortcut,Yt as useFloatingStack,Xt as useListQuery,Zt as useListShortcuts,Qt as usePagination,$t as useTableView};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.0",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@webority/theme": "0.
|
|
31
|
-
"@webority/ui-elements": "0.
|
|
30
|
+
"@webority/theme": "0.66.0",
|
|
31
|
+
"@webority/ui-elements": "0.66.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@webority/analytics": "^0.23.0",
|