@webority/ui-react 0.178.4 → 0.180.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/canvas-kit/kit.js +143 -143
- package/dist/canvas-kit/manifest.json +2583 -111
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppAccordion.js +1 -1
- package/dist/components/AppAgenda.js +1 -0
- package/dist/components/AppAsyncBlock.js +1 -1
- package/dist/components/AppButton.js +1 -1
- package/dist/components/AppCalendar.js +1 -1
- package/dist/components/AppCalendarViews.js +1 -0
- package/dist/components/AppChangeList.js +1 -0
- package/dist/components/AppChart.js +1 -1
- package/dist/components/AppColorField.js +1 -1
- package/dist/components/AppCommandPalette.js +1 -1
- package/dist/components/AppDashboardCell.js +1 -1
- package/dist/components/AppDashboardGrid.js +1 -1
- package/dist/components/AppDashboardHeader.js +1 -0
- package/dist/components/AppDataTable.js +1 -1
- package/dist/components/AppDatePicker.js +1 -1
- package/dist/components/AppDateRangePicker.js +1 -1
- package/dist/components/AppDateTimePicker.js +1 -1
- package/dist/components/AppDescriptions.js +1 -1
- package/dist/components/AppDropdown.js +1 -1
- package/dist/components/AppEntryGrid.js +1 -1
- package/dist/components/AppFileViewer.js +1 -1
- package/dist/components/AppForm.js +1 -1
- package/dist/components/AppFormActions.js +1 -1
- package/dist/components/AppFormRow.js +1 -1
- package/dist/components/AppGantt.js +1 -1
- package/dist/components/AppInput.js +1 -1
- package/dist/components/AppKanban.js +1 -1
- package/dist/components/AppKpiTile.js +1 -1
- package/dist/components/AppListCard.js +1 -0
- package/dist/components/AppMentionInput.js +1 -1
- package/dist/components/AppMiniCalendar.js +1 -0
- package/dist/components/AppNavigationMenu.js +1 -1
- package/dist/components/AppNotificationCenter.js +1 -1
- package/dist/components/AppNumberInput.js +1 -1
- package/dist/components/AppOfflineBanner.js +1 -0
- package/dist/components/AppOtpInput.js +1 -1
- package/dist/components/AppPageHeader.js +1 -1
- package/dist/components/AppPhoneNumberInput.js +1 -1
- package/dist/components/AppQueueBundle.js +1 -0
- package/dist/components/AppResultBlock.js +1 -0
- package/dist/components/AppRouteError.js +1 -1
- package/dist/components/AppSearch.js +1 -1
- package/dist/components/AppSegmented.js +1 -1
- package/dist/components/AppSelect.js +1 -1
- package/dist/components/AppSettingRow.js +1 -0
- package/dist/components/AppSettingSection.js +1 -0
- package/dist/components/AppShell.js +1 -1
- package/dist/components/AppStepper.js +1 -1
- package/dist/components/AppTabs.js +1 -1
- package/dist/components/AppTextarea.js +1 -1
- package/dist/components/AppTimePicker.js +1 -1
- package/dist/components/AppWizard.js +1 -1
- package/dist/guidance.json +987 -9
- package/dist/lib/formStatusContext.js +1 -0
- package/dist/lib/useStickyLayer.js +1 -0
- package/dist/types/components/AppAccordion.d.ts +5 -3
- package/dist/types/components/AppAgenda.d.ts +69 -0
- package/dist/types/components/AppAsyncBlock.d.ts +5 -0
- package/dist/types/components/AppButton.d.ts +18 -2
- package/dist/types/components/AppCalendar.d.ts +14 -0
- package/dist/types/components/AppCalendarViews.d.ts +69 -0
- package/dist/types/components/AppChangeList.d.ts +30 -0
- package/dist/types/components/AppChart.d.ts +5 -0
- package/dist/types/components/AppColorField.d.ts +2 -0
- package/dist/types/components/AppCommandPalette.d.ts +12 -0
- package/dist/types/components/AppDashboardCell.d.ts +17 -1
- package/dist/types/components/AppDashboardGrid.d.ts +39 -5
- package/dist/types/components/AppDashboardHeader.d.ts +21 -0
- package/dist/types/components/AppDataTable.d.ts +28 -2
- package/dist/types/components/AppDatePicker.d.ts +2 -0
- package/dist/types/components/AppDateRangePicker.d.ts +2 -0
- package/dist/types/components/AppDescriptions.d.ts +2 -0
- package/dist/types/components/AppDropdown.d.ts +2 -2
- package/dist/types/components/AppEntryGrid.d.ts +15 -0
- package/dist/types/components/AppFileViewer.d.ts +7 -0
- package/dist/types/components/AppForm.d.ts +5 -0
- package/dist/types/components/AppFormActions.d.ts +28 -4
- package/dist/types/components/AppFormRow.d.ts +5 -0
- package/dist/types/components/AppGantt.d.ts +10 -2
- package/dist/types/components/AppInput.d.ts +5 -0
- package/dist/types/components/AppKanban.d.ts +4 -0
- package/dist/types/components/AppKpiTile.d.ts +14 -1
- package/dist/types/components/AppListCard.d.ts +32 -0
- package/dist/types/components/AppMentionInput.d.ts +2 -0
- package/dist/types/components/AppMiniCalendar.d.ts +78 -0
- package/dist/types/components/AppNavigationMenu.d.ts +10 -0
- package/dist/types/components/AppNotificationCenter.d.ts +20 -0
- package/dist/types/components/AppNumberInput.d.ts +7 -0
- package/dist/types/components/AppOfflineBanner.d.ts +28 -0
- package/dist/types/components/AppOtpInput.d.ts +2 -0
- package/dist/types/components/AppPhoneNumberInput.d.ts +7 -0
- package/dist/types/components/AppQueueBundle.d.ts +35 -0
- package/dist/types/components/AppResultBlock.d.ts +62 -0
- package/dist/types/components/AppRouteError.d.ts +76 -4
- package/dist/types/components/AppSearch.d.ts +3 -0
- package/dist/types/components/AppSegmented.d.ts +14 -0
- package/dist/types/components/AppSelect.d.ts +2 -0
- package/dist/types/components/AppSettingRow.d.ts +61 -0
- package/dist/types/components/AppSettingSection.d.ts +23 -0
- package/dist/types/components/AppShell.d.ts +10 -62
- package/dist/types/components/AppStepper.d.ts +6 -1
- package/dist/types/components/AppTabs.d.ts +5 -0
- package/dist/types/components/AppTextarea.d.ts +19 -0
- package/dist/types/components/AppTimePicker.d.ts +2 -0
- package/dist/types/components/AppWizard.d.ts +31 -2
- package/dist/types/index.d.ts +17 -2
- package/dist/types/lib/focusField.d.ts +1 -2
- package/dist/types/lib/formStatusContext.d.ts +15 -0
- package/dist/types/lib/useStickyLayer.d.ts +7 -0
- package/dist/ui-react.js +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../lib/useElementEntry.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnUnknownProps.js";import{createElement as r,useCallback as i,useEffect as a,useLayoutEffect as o,useRef as s,useState as c}from"react";import{createPortal as l}from"react-dom";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";var p=`wui-file-viewer:load`,m=`wui-file-viewer:error`,h=`wui-file-viewer:prefs-change`,g=()=>import(`@webority/ui-elements/file-viewer`);function _({ref:_,...v}){let{marker:y,props:b}=t(`AppFileViewer`,v),{src:x,name:S,type:C,prefs:w,onPrefsChange:T,viewKey:E,download:D=!1,
|
|
1
|
+
import e from"../lib/useElementEntry.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnUnknownProps.js";import{createElement as r,useCallback as i,useEffect as a,useLayoutEffect as o,useRef as s,useState as c}from"react";import{createPortal as l}from"react-dom";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";var p=`wui-file-viewer:load`,m=`wui-file-viewer:error`,h=`wui-file-viewer:prefs-change`,g=()=>import(`@webority/ui-elements/file-viewer`);function _({ref:_,...v}){let{marker:y,props:b}=t(`AppFileViewer`,v),{src:x,name:S,type:C,prefs:w,onPrefsChange:T,viewKey:E,download:D=!1,fill:O=!1,print:k=!0,workerSrc:A,assetBase:j,captions:M,actions:N,onLoad:P,onError:F,className:I=``,style:L,...R}=b;n(`AppFileViewer`,R);let z=e(`wui-file-viewer`,g),B=s(null),V=s(P),H=s(F),U=s(T),[W,G]=c(null),K=i(e=>{B.current=e,typeof _==`function`?_(e):_&&(_.current=e)},[_]);return o(()=>{if(!z||w===void 0)return;let e=B.current;if(!e)throw Error(`AppFileViewer: the viewer element is not mounted`);e.prefs=w},[w,z]),a(()=>{V.current=P,H.current=F,U.current=T}),a(()=>{let e=B.current;if(!e)throw Error(`AppFileViewer: the viewer element is not mounted`);let t=e=>{if(!(e instanceof CustomEvent))throw Error(`wui-file-viewer:load arrived without a CustomEvent`);V.current?.(e.detail)},n=e=>{if(!(e instanceof CustomEvent))throw Error(`wui-file-viewer:error arrived without a CustomEvent`);H.current?.(e.detail)},r=e=>{if(!(e instanceof CustomEvent))throw Error(`wui-file-viewer:prefs-change arrived without a CustomEvent`);U.current?.(e.detail)};return e.addEventListener(p,t),e.addEventListener(m,n),e.addEventListener(h,r),()=>{e.removeEventListener(p,t),e.removeEventListener(m,n),e.removeEventListener(h,r)}},[]),a(()=>{if(!z)return;let e=B.current;e?.isConnected&&G(e.actionsContainer)},[z]),/* @__PURE__ */ f(u,{children:[r(`wui-file-viewer`,{ref:K,src:x,name:S||void 0,type:C||void 0,"view-key":E||void 0,download:D?``:void 0,fill:O?``:void 0,print:k?void 0:`false`,"worker-src":A||void 0,"asset-base":j||void 0,captions:M||void 0,className:I||void 0,style:L,...y,...R}),W&&N!=null&&l(/* @__PURE__ */ d(`div`,{slot:`actions`,className:`wui-file-viewer-slot`,children:N}),W)]})}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{newIdempotencyKey as e}from"../web-core/dist/api/idempotencyKey.js";import t from"../lib/focusField.js";import{FormFieldsContext as n,toFieldName as r}from"../lib/formFields.js";import i from"../lib/useWuiText.js";import{splitMarkerProps as
|
|
1
|
+
import{newIdempotencyKey as e}from"../web-core/dist/api/idempotencyKey.js";import t from"../lib/focusField.js";import{FormFieldsContext as n,toFieldName as r}from"../lib/formFields.js";import{FormStatusContext as i}from"../lib/formStatusContext.js";import a from"../lib/useWuiText.js";import{splitMarkerProps as o}from"../lib/wuiMarker.js";import s from"./AppConfirmDialog.js";import c from"./AppIcon.js";import l from"./assertValidValue.js";import{MODAL_ICONS as u}from"./ModalIcons.js";import d from"./warnUnknownProps.js";import{createContext as f,useCallback as p,useContext as m,useEffect as h,useMemo as g,useRef as ee,useState as _}from"react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{UNSAVED_CHANGES_TEXT as te}from"@webority/ui-elements/text";var b=f(null);function x(){let e=m(b);if(e===null)throw Error(`useFormSubmit must be called inside an AppForm`);return e}var S=/* @__PURE__ */ new Set,ne=/* @__PURE__ */ new Map,re=[`top`,`status`];function C(e,t,n){let r=t.id;return(r===``?void 0:[...e.querySelectorAll(`label[for]`)].find(e=>e.getAttribute(`for`)===r))?.textContent?.trim()||n}function ie(e,t){let n=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set,a=[];for(let o of[...e.querySelectorAll(`[name]`)]){let s=o.getAttribute(`name`);if(s===null)continue;let c=r(s);if(!t.has(c)||n.has(c))continue;n.add(c);let l=o.closest(`section.form-section`),u=l?.querySelector(`:scope > .form-section-head > .form-section-title`)?.textContent?.trim(),d=l!==null&&u?l:o;i.has(d)||(i.add(d),a.push({label:u||C(e,o,s),fieldName:s}))}return n.size===0?null:{errorCount:n.size,links:a}}function w(f){let{marker:m,props:x}=o(`AppForm`,f),C=a(`unsavedChanges`,te),{onSubmit:w,onChange:T,className:ae,children:E,noValidate:D,action:O,method:k,encType:A,acceptCharset:j,fieldErrors:M,formErrors:oe,unsavedChanges:N,unsavedChangesMessage:se,errorSummary:P,...F}=x;d(`AppForm`,F),l(`AppForm`,`errorSummary`,P,re);let[I,L]=_(!1),[R,z]=_(e),B=ee(!1),[V,H]=_(null),[U,W]=_(null),G=g(()=>new Map(Object.entries(M??{}).map(([e,t])=>[r(e),t])),[M]),K=JSON.stringify([...G].sort(([e],[t])=>e<t?-1:+(e>t))),[q,ce]=_({key:K,names:S}),J=q.key===K?q.names:S,le=p(e=>{T?.(e);let t=e.target;if(!(t instanceof HTMLElement)||!(`name`in t)||typeof t.name!=`string`||t.name===``)return;let n=r(t.name);G.has(n)&&ce(e=>{let t=e.key===K?e.names:S;return t.has(n)?e:{key:K,names:/* @__PURE__ */ new Set([...t,n])}})},[T,G,K]),[ue,Y]=_(ne),X=p(e=>(Y(t=>new Map(t).set(e,(t.get(e)??0)+1)),()=>{Y(t=>{let n=new Map(t),r=(t.get(e)??0)-1;return r>0?n.set(e,r):n.delete(e),n})}),[]),Z=p(e=>J.has(e)?void 0:G.get(e),[J,G]),Q=g(()=>({errorOf:Z,claim:X}),[Z,X]),$=[.../* @__PURE__ */ new Set([...oe??[],...[...G].filter(([e])=>!ue.has(e)).map(([,e])=>e)])],de=p(async t=>{if(t.preventDefault(),B.current)return;B.current=!0,L(!0);let n=t.currentTarget;try{let r=await w(t,{idempotencyKey:R});r!==!1&&z(e()),r!==!0&&H({form:n})}finally{B.current=!1,L(!1)}},[w,R]);h(()=>{if(V===null)return;let{form:e}=V;if(H(null),P===`status`&&W(ie(e,G)),e.querySelector(`.wui-error-summary`)!==null)return;let n=[...e.querySelectorAll(`[name]`)].map(e=>e.getAttribute(`name`)).find(e=>e!==null&&G.has(r(e)));n!==void 0&&t(n)},[V,G,P]),h(()=>{G.size===0&&W(null)},[G]);let fe=g(()=>({submitting:I,idempotencyKey:R}),[I,R]);return/* @__PURE__ */ v(n,{value:Q,children:/* @__PURE__ */ y(b,{value:fe,children:[/* @__PURE__ */ v(i,{value:P===`status`?U:null,children:/* @__PURE__ */ y(`form`,{...m,...F,noValidate:D,action:O,method:k,encType:A,acceptCharset:j,className:ae,onChange:le,onSubmit:de,"aria-busy":I||void 0,children:[$.length>0?/* @__PURE__ */ y(`div`,{role:`alert`,className:`alert alert-danger alert-has-icon`,"data-wui-form-errors":``,children:[/* @__PURE__ */ v(`span`,{className:`alert-icon`,children:/* @__PURE__ */ v(c,{name:`x`,size:11})}),/* @__PURE__ */ v(`div`,{className:`alert-content`,children:$.length===1?$[0]:$.map(e=>/* @__PURE__ */ v(`div`,{children:e},e))})]}):null,E]})}),N?.blocked?/* @__PURE__ */ v(s,{open:!0,title:C.title,description:se??C.message,confirmLabel:C.leaveLabel,cancelLabel:C.keepLabel,tone:`danger`,icon:/* @__PURE__ */ v(u.warning,{size:120}),onConfirm:N.discard,onClose:N.keep}):null]})})}export{b as FormSubmitContext,w as default,x as useFormSubmit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as
|
|
1
|
+
import e from"../lib/focusField.js";import{FormStatusContext as t}from"../lib/formStatusContext.js";import n from"../lib/useWuiText.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppButton.js";import a from"./AppIcon.js";import o from"./assertValidValue.js";import s from"./warnUnknownProps.js";import{formatDate as c}from"@webority/ui-elements/helpers";import{use as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{FORM_ACTIONS_TEXT as f,fillText as p,pluralText as m}from"@webority/ui-elements/text";var h=[`end`,`start`,`between`],g=[`surface`],_=[`neutral`,`success`,`warning`,`danger`,`info`],v=[`pristine`,`dirty`,`saving`,`saved`,`invalid`],y={pristine:{tone:`neutral`,icon:null},dirty:{tone:`warning`,icon:`edit`},saving:{tone:`neutral`,icon:null},saved:{tone:`success`,icon:`tick-circle`},invalid:{tone:`danger`,icon:`warning-2`}};function b(b){let{marker:x,props:S}=r(`AppFormActions`,b),C=n(`formActions`,f),w=l(t),{children:T,sticky:E=!1,align:D=`end`,status:O,statusTone:k,saveState:A,savedAt:j,invalidCount:M,className:N=``,...P}=S;if(s(`AppFormActions`,P),o(`AppFormActions`,`align`,D,h),o(`AppFormActions`,`sticky`,typeof E==`string`?E:null,g),o(`AppFormActions`,`statusTone`,k,_),o(`AppFormActions`,`saveState`,A,v),O!=null&&A!==void 0)throw RangeError(`[@webority/ui-react] <AppFormActions> received both status and saveState. Pass one of them.`);if((O!=null||A!==void 0)&&D!==`end`)throw RangeError(`[@webority/ui-react] <AppFormActions> received align="${D}" with a status. The status sits at the start and the buttons at the end, so align must be "end".`);if(A===`saved`&&j===void 0)throw RangeError(`[@webority/ui-react] <AppFormActions> received saveState="saved" without savedAt. Pass the time of the save.`);if(A===`invalid`&&M===void 0)throw RangeError(`[@webority/ui-react] <AppFormActions> received saveState="invalid" without invalidCount. Pass how many fields need attention.`);let F=[`form-actions`,E?`form-actions-sticky`:``,E===`surface`?`wui-form-actions-surface`:``,D&&D!==`end`?`form-actions-${D}`:``,N].filter(Boolean).join(` `);return/* @__PURE__ */ d(`div`,{className:F,...x,...P,children:[L(),T]});function I(e){return m(C,`invalid`,e)}function L(){if(w!==null&&w.errorCount>0)return/* @__PURE__ */ d(`div`,{className:`wui-form-actions-status`,role:`status`,"aria-live":`polite`,"data-tone":`danger`,children:[/* @__PURE__ */ u(a,{name:`warning-2`}),/* @__PURE__ */ u(`span`,{children:I(w.errorCount)}),w.links.length>0&&/* @__PURE__ */ u(`span`,{className:`wui-form-actions-status-links`,children:w.links.map(t=>/* @__PURE__ */ u(i,{type:`button`,variant:`link`,size:`sm`,onClick:()=>e(t.fieldName),children:t.label},t.fieldName))})]});if(A!==void 0){let e=y[A],t;return t=A===`saved`?p(C.saved,{time:`${c(j,{pattern:`time`})} IST`}):A===`invalid`?I(M??0):C[A],/* @__PURE__ */ d(`div`,{className:`wui-form-actions-status`,role:`status`,"aria-live":`polite`,"data-tone":e?.tone,children:[A===`saving`&&/* @__PURE__ */ u(`span`,{className:`spinner-border spinner-border-sm`,"aria-hidden":`true`,"data-wui":`AppSpinner`}),e?.icon!=null&&/* @__PURE__ */ u(a,{name:e.icon}),/* @__PURE__ */ u(`span`,{children:t})]})}return O==null?null:/* @__PURE__ */ u(`div`,{className:`wui-form-actions-status`,role:`status`,"aria-live":`polite`,"data-tone":k??`neutral`,children:O})}}export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./assertValidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i=[1,2,3,4,5,6,7,8,9,10,11,12];function a(a){let{marker:o,props:s}=e(`AppFormRow`,a),{children:c,columns:l=2,collapse:u=!0,className:
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./assertValidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i=[1,2,3,4,5,6,7,8,9,10,11,12];function a(a){let{marker:o,props:s}=e(`AppFormRow`,a),{children:c,columns:l=2,collapse:u=!0,reserveMessage:d=!1,className:f=``,...p}=s;n(`AppFormRow`,p),t(`AppFormRow`,`columns`,l,i);let{style:m,...h}=p,g=[`form-row-grid`,`wui-form-cols-${Math.min(12,Math.max(1,Number(l)||2))}`,u===!1&&`wui-form-row-keep`,d&&`wui-form-row-reserve`,f].filter(Boolean).join(` `);return/* @__PURE__ */ r(`div`,{className:g,style:m,...o,...h,children:c})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../lib/useElementEntry.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{validateGantt as i}from"@webority/ui-elements/helpers";import{useCallback as
|
|
1
|
+
import e from"../lib/useElementEntry.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{validateGantt as i}from"@webority/ui-elements/helpers";import{useCallback as ee,useEffect as a,useLayoutEffect as te,useMemo as ne,useRef as o,useState as s}from"react";import{jsx as c}from"react/jsx-runtime";var l=()=>import(`@webority/ui-elements/elements/gantt`),u=[`table`,`lanes`],re=[`day`,`week`,`month`],ie=[`ready`,`loading`,`empty`,`error`],ae=[1,2],d=`wui-gantt:zoom-change`,f=`wui-gantt:from-change`,p=`wui-gantt:fold-change`,m=`wui-gantt:select`,h=`wui-gantt:add-task`,g=`wui-gantt:retry`,_=(e,t)=>{if(!(e instanceof CustomEvent))throw Error(`${t} arrived without a CustomEvent`);return e.detail},v=e=>e===``?void 0:e,y=e=>({title:e.title,rows:e.rows,layout:e.layout,zoom:e.zoom,from:v(e.from),folded:e.folded,selected:e.selected,today:v(e.today),state:e.state,emptyText:v(e.emptyText),errorText:v(e.errorText),loadingText:v(e.loadingText),addTask:e.addTask?!0:void 0,holidays:e.holidays,weeks:e.weeks,countLabel:v(e.countLabel),clashLabel:v(e.clashLabel),controlled:!0}),b=(e,t)=>t!=null&&Object.keys(e).every(n=>Object.is(e[n],t[n])),x=e=>{try{return JSON.stringify(e)}catch{return null}};function S(v){e(`wui-gantt`,l);let{marker:S,props:C}=t(`AppGantt`,v),{rows:w,title:oe,layout:T,zoom:E,onZoomChange:D,from:O,onFromChange:k,folded:A,onFoldedChange:j,selected:M,onSelectedChange:N,today:P,state:F,loading:I,error:L,emptyText:R,errorText:z,loadingText:B,onAddTask:V,onRetry:H,holidays:U,weeks:W,countLabel:G,clashLabel:K,className:q=``,style:se,ref:J,...Y}=C;r(`AppGantt`,Y),n(`AppGantt`,`layout`,T,u),n(`AppGantt`,`zoom`,E,re),n(`AppGantt`,`state`,F,ie),n(`AppGantt`,`weeks`,W,ae);let ce=ne(()=>{if(!Array.isArray(w))throw Error(`<AppGantt> rows is required: pass the list of tasks.`);return i({rows:w,zoom:E,layout:T,weeks:W,holidays:U}),w},[w,E,T,W,U]),[le,ue]=s(`week`),[de,fe]=s(void 0),[pe,me]=s([]),[he,ge]=s(null),X=E??le,_e=O??de,ve=A??pe,ye=M===void 0?he:M,be=L?`error`:I?`loading`:F,xe=L||z,Z=o(null),Q=o({props:null,signature:null}),$=o({zoom:E,from:O,folded:A,selected:M,onZoomChange:D,onFromChange:k,onFoldedChange:j,onSelectedChange:N,onAddTask:V,onRetry:H}),Se=ee(e=>{Z.current=e,typeof J==`function`?J(e):J&&(J.current=e)},[J]);return a(()=>{$.current={zoom:E,from:O,folded:A,selected:M,onZoomChange:D,onFromChange:k,onFoldedChange:j,onSelectedChange:N,onAddTask:V,onRetry:H}}),te(()=>{let e=Z.current;if(!e)return;let t={title:oe,rows:ce,layout:T,zoom:X,from:_e,folded:ve,selected:ye??null,today:P,state:be,emptyText:R,errorText:xe,loadingText:B,addTask:!!V,holidays:U,weeks:W,countLabel:G,clashLabel:K};if(b(t,Q.current.props))return;Q.current.props=t;let n=y(t),r=x(n);(r===null||r!==Q.current.signature)&&(Q.current.signature=r,e.spec=n)}),a(()=>{let e=Z.current;if(!e)throw Error(`AppGantt: the <wui-gantt> element is not mounted`);let t=[[d,e=>{let{zoom:t}=_(e,d),n=$.current;n.onZoomChange?.(t),n.zoom===void 0&&ue(t)}],[f,e=>{let{from:t}=_(e,f),n=$.current;n.onFromChange?.(t),n.from===void 0&&fe(t)}],[p,e=>{let{folded:t}=_(e,p),n=$.current;n.onFoldedChange?.(t),n.folded===void 0&&me(t)}],[m,e=>{let{key:t}=_(e,m),n=$.current;n.onSelectedChange?.(t),n.selected===void 0&&ge(t)}],[h,()=>$.current.onAddTask?.()],[g,()=>$.current.onRetry?.()]];for(let[n,r]of t)e.addEventListener(n,r);return()=>{for(let[n,r]of t)e.removeEventListener(n,r)}},[]),/* @__PURE__ */ c(`wui-gantt`,{ref:Se,className:q||void 0,style:se,...S,...Y})}export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{FIELD_BUSY_CLASS as n,blockWhenReadOnly as ee}from"../lib/fieldState.js";import{useFieldError as te}from"../lib/formFields.js";import ne from"../lib/useWuiText.js";import{splitMarkerProps as re}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import ie from"./AppInfoTip.js";import ae from"./AppPopover.js";import i from"./AppRequiredMark.js";import a from"./assertValidValue.js";import oe from"./warnUnknownProps.js";import{MASK_INPUT_TYPES as se,MASK_NAMES as ce,attachInputMask as le,evaluatePassword as ue,formatMasked as de,isMaskPattern as fe,postedMasked as pe}from"@webority/ui-elements/helpers";import{cloneElement as me,useEffect as o,useId as he,useRef as ge,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{INPUT_TEXT as _e}from"@webority/ui-elements/text";import{Form as u}from"react-bootstrap";var ve=[`sm`,`md`,`lg`,`xl`],ye=[`bare`,`underline`],be=[`off`,`border`,`above`],xe=[`off`,`shown`];function d(e,t){if(t!=null&&t!==``&&t!==!1)throw Error(`<AppInput> controlOnly draws no field, so it takes no ${e}; draw the label or message on the page.`)}function
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{FIELD_BUSY_CLASS as n,blockWhenReadOnly as ee}from"../lib/fieldState.js";import{useFieldError as te}from"../lib/formFields.js";import ne from"../lib/useWuiText.js";import{splitMarkerProps as re}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import ie from"./AppInfoTip.js";import ae from"./AppPopover.js";import i from"./AppRequiredMark.js";import a from"./assertValidValue.js";import oe from"./warnUnknownProps.js";import{MASK_INPUT_TYPES as se,MASK_NAMES as ce,attachInputMask as le,evaluatePassword as ue,formatMasked as de,isMaskPattern as fe,postedMasked as pe}from"@webority/ui-elements/helpers";import{cloneElement as me,useEffect as o,useId as he,useRef as ge,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{INPUT_TEXT as _e}from"@webority/ui-elements/text";import{Form as u}from"react-bootstrap";var ve=[`sm`,`md`,`lg`,`xl`],ye=[`bare`,`underline`],be=[`off`,`border`,`above`],xe=[`off`,`shown`],Se=[`reserve`,`none`];function d(e,t){if(t!=null&&t!==``&&t!==!1)throw Error(`<AppInput> controlOnly draws no field, so it takes no ${e}; draw the label or message on the page.`)}function Ce(e){return e==null||{...`minLength`in e&&{minLength:e.minLength??0},...`uppercase`in e&&{uppercase:e.uppercase??!1},...`lowercase`in e&&{lowercase:e.lowercase??!1},...`digit`in e&&{digit:e.digit??!1},...`special`in e&&{special:e.special??!1},...`uniqueChars`in e&&{uniqueChars:e.uniqueChars??0},...`customRules`in e&&{customRules:e.customRules??[]}}}function f({ref:f,...we}){let{marker:Te,props:Ee}=re(`AppInput`,we),p=ne(`input`,_e),{label:m,required:h=!1,optional:g=!1,error:De,valid:Oe=!1,helperText:_,messageRoom:v=`reserve`,help:y,helpLabel:ke=p.helpLabel,type:b=`text`,size:x=`md`,leftIcon:S,rightIcon:C,onRightIconClick:Ae,rightIconLabel:je,unit:w,id:Me,name:Ne,className:Pe=``,fieldClassName:T=``,disabled:Fe=!1,readOnly:E=!1,loading:D=!1,clearable:O=!1,clearLabel:Ie=p.clearLabel,optionalLabel:Le=p.optionalLabel,requirementsTitle:Re=p.requirementsTitle,showPasswordLabel:ze=p.showPasswordLabel,hidePasswordLabel:Be=p.hidePasswordLabel,showCount:k=!1,maxLength:A,monospace:Ve=!1,prefix:j,suffix:M,action:He,floatingLabel:N=`off`,variant:P,passwordRequirements:F=`off`,passwordPolicy:Ue,requirementsPlacement:I=`auto`,mask:L,postFormatted:R=!1,onMaskChange:We,controlOnly:Ge=!1,value:z,...B}=Ee,Ke=te(Ne);oe(`AppInput`,B);let{onChange:qe,onBlur:Je,onClick:Ye,onInput:V,...Xe}=B;a(`AppInput`,`size`,x,ve),a(`AppInput`,`variant`,P,ye),a(`AppInput`,`floatingLabel`,N,be),a(`AppInput`,`passwordRequirements`,F,xe),a(`AppInput`,`messageRoom`,v,Se),Ge&&(d(`label`,m),d(`error`,De),d(`helperText`,_),d(`messageRoom`,v===`reserve`?void 0:v),d(`fieldClassName`,T),d(`showCount`,k),d(`help`,y),d(`optional`,g),d(`floatingLabel`,N===`off`?void 0:N),d(`passwordRequirements`,F===`shown`?F:void 0)),o(()=>{g&&h&&typeof process<`u`&&process.env.NODE_ENV!==`production`&&e(`AppInput: optional and required together; optional ignored`)},[g,h]),L!=null&&!fe(L)&&a(`AppInput`,`mask`,L,ce),L!=null&&a(`AppInput`,`type`,b,se);let[H,Ze]=s(!1),[Qe,$e]=s(``),U=De||Qe||Ke,et=he(),W=Me||et,G=b===`password`,tt=G&&H?`text`:b,K=ge(null),nt=e=>{K.current=e,typeof f==`function`?f(e):f&&(f.current=e)},q=String(z??B.defaultValue??``),[rt,J]=s(()=>!!q),[it,at]=s(()=>q.length),ot=O&&!Fe&&!E&&!D,Y=O||k,X=G&&F===`shown`,[st,ct]=s(q);o(()=>{X&&z!==void 0&&ct(String(z??``))},[z,X]),o(()=>{if(!Y||z===void 0)return;let e=String(z??``);J(!!e),at(e.length)},[z,Y]);let lt=e=>{let t=e.currentTarget;J(!!t.value),at(t.value.length),V?.(e)},ut=e=>{X&&ct(e.currentTarget.value),Y?lt(e):V?.(e)},dt=L?{...z!==void 0&&{value:de(L,z)},...B.defaultValue!==void 0&&{defaultValue:de(L,B.defaultValue)}}:null,ft=ge(We);ft.current=We,o(()=>{let e=K.current;if(!L||!e)return;let t,n=le(e,{mask:L,postFormatted:R,onChange:(e,t)=>ft.current?.(e,t),onInvalidChange:e=>{clearTimeout(t),t=setTimeout(()=>$e(e),0)}});return()=>{n(),clearTimeout(t),$e(``)}},[L,R]);let pt=e=>L&&!R&&e?t=>{let n=t.currentTarget,ee=new Proxy(n,{get:(e,t)=>{if(t===`value`)return pe(L,e.value);let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}});e(Object.create(t,{target:{value:ee}}))}:e,mt=ot?/* @__PURE__ */ c(`button`,{type:`button`,className:`input-clear`,onClick:()=>{let e=K.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set;t?t.call(e,``):e.value=``,e.dispatchEvent(new Event(`input`,{bubbles:!0})),J(!1),e.focus()},"aria-label":Ie,tabIndex:-1,hidden:!rt,children:/* @__PURE__ */ c(r,{name:`x`,size:16})}):null,ht=U&&W?`${W}-error`:void 0,gt=_&&W?`${W}-hint`:void 0,Z=X&&I===`inline`,_t=Z&&W?`${W}-requirements`:void 0,vt=ht||(Z?_t:gt),yt=[`input`,x===`sm`?`wui-input-sm`:``,x===`lg`?`wui-input-lg`:``,x===`xl`?`wui-input-xl`:``,U?`error`:``,Oe&&!U?`wui-valid`:``,G?`pw`:``,w?`num-input`:``,!(N!==`off`&&m||j||M||w||G||C)&&O&&ot?`has-clear`:``,P===`underline`?`wui-input-underline`:P?`input-${P}`:``,Ve?`wui-mono`:``,D?n:``,Pe].filter(Boolean).join(` `),bt=ee(E||D),xt=bt?e=>{bt(e),Ye?.(e)}:Ye,St=pt(qe),Ct=pt(Je),wt=Y||X?ut:V,Q=/* @__PURE__ */ c(u.Control,{id:W,name:Ne,type:tt,className:yt,disabled:Fe,readOnly:E||D,"aria-busy":D||void 0,required:h,"aria-invalid":U?`true`:`false`,"aria-describedby":vt,maxLength:A,...z===void 0?null:{value:z},...Xe,...xt?{onClick:xt}:null,...St?{onChange:St}:null,...Ct?{onBlur:Ct}:null,...dt,placeholder:N===`off`?B.placeholder:` `,ref:nt,...wt?{onInput:wt}:null}),Tt=Ue??!0,Et=Tt&&typeof Tt==`object`&&Tt.title||Re,Dt=X?ue(st,Ce(Ue)):null,Ot=X?/* @__PURE__ */ c(`ul`,{className:`pw-criteria`,"aria-live":`polite`,id:_t,"aria-label":Z?Et:void 0,children:Dt?.map(e=>/* @__PURE__ */ l(`li`,{className:`pw-rule ${e.met?`met`:`unmet`}`,children:[/* @__PURE__ */ c(`span`,{className:`pw-mark`,"aria-hidden":`true`}),/* @__PURE__ */ c(`span`,{className:`pw-rule-text`,children:e.label}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:e.met?p.requirementMetLabel:p.requirementNotMetLabel})]},e.key))}):null,$;if(N!==`off`&&m&&!G)$=/* @__PURE__ */ l(`div`,{className:N===`above`?`field-float wui-float-above`:`field-float`,children:[Q,/* @__PURE__ */ l(`label`,{className:`float-label`,htmlFor:W,children:[m,h&&/* @__PURE__ */ c(i,{})]})]});else if(He)$=/* @__PURE__ */ l(`div`,{className:`input-action-row`,children:[/* @__PURE__ */ l(`div`,{className:S?`input-icon`:`input-wrap`,children:[S&&/* @__PURE__ */ c(`span`,{className:`ic`,children:/* @__PURE__ */ c(r,{name:S,size:16})}),Q]}),/* @__PURE__ */ c(`div`,{className:`input-action`,children:He})]});else if(j||M)$=/* @__PURE__ */ l(`div`,{className:`input-affixed`,children:[j!=null&&/* @__PURE__ */ c(`span`,{className:`affix affix-pre`,children:j}),Q,M!=null&&/* @__PURE__ */ c(`span`,{className:`affix affix-suf`,children:M})]});else if(w)$=/* @__PURE__ */ l(`div`,{className:`input-with-unit`,children:[Q,/* @__PURE__ */ c(`span`,{className:`unit`,children:w})]});else if(G){let e=/* @__PURE__ */ l(`button`,{type:`button`,className:`pw-toggle${H?` pw-revealed`:``}`,onClick:()=>Ze(e=>!e),"aria-label":H?Be:ze,tabIndex:-1,children:[/* @__PURE__ */ c(r,{name:`eye`,size:18,className:`pw-eye`}),/* @__PURE__ */ c(r,{name:`eye-off`,size:18,className:`pw-eye-off`})]}),t=N!==`off`&&m?/* @__PURE__ */ c(`div`,{className:N===`above`?`field-float wui-float-above`:`field-float`,children:/* @__PURE__ */ l(`div`,{className:`input-wrap`,children:[Q,e,/* @__PURE__ */ l(`label`,{className:`float-label`,htmlFor:W,children:[m,h&&/* @__PURE__ */ c(i,{})]})]})}):/* @__PURE__ */ l(`div`,{className:S?`input-icon`:`input-wrap`,children:[S&&/* @__PURE__ */ c(`span`,{className:`ic`,children:/* @__PURE__ */ c(r,{name:S,size:16})}),Q,e]});$=X&&!Z&&I!==`inline`?/* @__PURE__ */ c(ae,{trigger:t,triggerType:`focus`,placement:I,title:Et,className:`pw-popover`,children:Ot}):t}else $=C?/* @__PURE__ */ l(`div`,{className:`input-wrap`,children:[Q,/* @__PURE__ */ c(`button`,{type:`button`,className:`pw-toggle`,onClick:Ae,disabled:!Ae,tabIndex:-1,"aria-label":je||C,children:/* @__PURE__ */ c(r,{name:C,size:18})})]}):O?/* @__PURE__ */ l(`div`,{className:S?`input-icon`:`input-wrap`,children:[S&&/* @__PURE__ */ c(`span`,{className:`ic`,children:/* @__PURE__ */ c(r,{name:S,size:16})}),Q,mt]}):S?/* @__PURE__ */ l(`div`,{className:`input-icon`,children:[/* @__PURE__ */ c(`span`,{className:`ic`,children:/* @__PURE__ */ c(r,{name:S,size:16})}),Q]}):Q;return Ge?me($,Te):/* @__PURE__ */ l(u.Group,{...Te,className:`field${T?` ${T}`:``}`,children:[m&&N===`off`&&/* @__PURE__ */ l(u.Label,{className:`label`,htmlFor:W,children:[m,g&&!h&&/* @__PURE__ */ c(`span`,{className:`label-optional`,children:` ${Le}`}),h&&/* @__PURE__ */ c(i,{}),y&&/* @__PURE__ */ c(ie,{label:ke,children:y})]}),$,Z&&/* @__PURE__ */ c(`div`,{className:`wui-pw-inline`,children:Ot}),v===`none`&&!U&&(Z||!_)?null:/* @__PURE__ */ c(t,{error:U,hint:Z?null:_,errorId:ht,hintId:gt}),k&&/* @__PURE__ */ l(`div`,{className:`field-count${A&&it>=A?` at-limit`:``}`,children:[it,A?` / ${A}`:``]})]})}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{linkTarget as e}from"../lib/linkTarget.js";import{TargetLink as t}from"../lib/TargetLink.js";import n from"../lib/useElementEntry.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppIcon.js";import o from"./assertValidValue.js";import{errorToast as s}from"./toast.js";import c from"./warnUnknownProps.js";import{KANBAN_SUMMARY_FORMATS as l,KANBAN_TONES as u,formatValue as ee,kanbanOverflow as te,kanbanSummaryFormat as d,kanbanVisibleLimit as ne,sumKanbanValues as re}from"@webority/ui-elements/helpers";import{useEffect as f,useId as p,useMemo as m,useRef as h,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{KANBAN_TEXT as ie,fillText as y}from"@webority/ui-elements/text";var ae=()=>import(`@webority/ui-elements/elements/kanban`),oe=e=>e.key??e.id,se=e=>e.column,b=[`rupees`,`paise`],ce=[`inline`,`stacked`];function
|
|
1
|
+
import{linkTarget as e}from"../lib/linkTarget.js";import{TargetLink as t}from"../lib/TargetLink.js";import n from"../lib/useElementEntry.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppIcon.js";import o from"./assertValidValue.js";import{errorToast as s}from"./toast.js";import c from"./warnUnknownProps.js";import{KANBAN_SUMMARY_FORMATS as l,KANBAN_TONES as u,formatValue as ee,kanbanOverflow as te,kanbanSummaryFormat as d,kanbanVisibleLimit as ne,sumKanbanValues as re}from"@webority/ui-elements/helpers";import{useEffect as f,useId as p,useMemo as m,useRef as h,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{KANBAN_TEXT as ie,fillText as y}from"@webority/ui-elements/text";var ae=()=>import(`@webority/ui-elements/elements/kanban`),oe=e=>e.key??e.id,se=e=>e.column,b=[`rupees`,`paise`],ce=[`inline`,`stacked`],le=[`rail`,`strip`];function ue(e){return typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`?e.message:void 0}function x(x){let S=n(`wui-kanban`,ae),C=r(`kanban`,ie),{marker:de,props:fe}=i(`AppKanban`,x),{columns:w,cards:T,renderCard:pe,renderColumnActions:me,getCardKey:E=oe,getCardColumn:D=se,getCardValue:O,cardLabel:k,isCardLocked:he,lockedReason:A,onLocked:j,onMove:M,accept:N,filter:ge,boardId:_e,ariaLabel:ve=C.ariaLabel,columnsLabel:ye=C.columnsLabel,expandLabel:be=C.expandLabel,collapseLabel:xe=C.collapseLabel,emptyText:Se=C.emptyText,helpText:Ce=C.helpText,readOnly:we=!1,swipeHint:Te=!1,swipeHintText:Ee=C.swipeHintText,fill:De=!1,columnWidth:P,fillOffset:F,activeCardKey:I,headLayout:L=`inline`,truncateHeads:R=!1,summaryFormat:z,summaryUnit:B,className:V=``,id:Oe,linkComponent:ke,...H}=fe;if(!Array.isArray(w))throw Error(`<AppKanban> columns is required: pass the board's stage columns.`);if(!Array.isArray(T))throw Error(`<AppKanban> cards is required: pass the cards, an empty array for an empty board.`);c(`AppKanban`,H),o(`AppKanban`,`summaryFormat`,z,l),o(`AppKanban`,`summaryUnit`,B,b),o(`AppKanban`,`headLayout`,L,ce);for(let e of w)o(`AppKanban`,`columns[].tone`,e.tone,u),o(`AppKanban`,`columns[].collapsedLayout`,e.collapsedLayout,le);let Ae=p(),U=Oe||`kanban-${Ae.replace(/[^a-zA-Z0-9_-]/g,``)}`,W=h(null),[G,K]=g(()=>/* @__PURE__ */ new Map),[q,je]=g(()=>/* @__PURE__ */ new Set),[Me,J]=g(()=>/* @__PURE__ */ new Set),Y=m(()=>new Map(T.map(e=>[String(E(e)),e])),[T,E]),X=h({accept:N,onMove:M,onLocked:j,byKey:Y,columns:w});X.current={accept:N,onMove:M,onLocked:j,byKey:Y,columns:w};let Z=z&&l.includes(z)&&(B==null||b.includes(B))?d(z,B):null,Ne=m(()=>{let e=new Map(w.map(e=>[e.key,[]])),t=[];for(let n of T){let r=String(E(n)),i=G.get(r);i?t.push([n,i]):e.get(D(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},[w,T,G,E,D]);f(()=>{let e=W.current;if(!e||!S)return;e.accept=(e,t,n)=>{let r=X.current.accept;return!r||r(X.current.byKey.get(e.getAttribute(`data-wui-card`)??``),t,n)};let t=e=>{if(!(e instanceof CustomEvent))throw Error(`wui:kanban:move arrived without a CustomEvent`);let{key:t,from:n,to:r,index:i}=e.detail,a=X.current.onMove,o=X.current.byKey.get(t);if(!a||!o)return;let c=X.current.columns.find(e=>e.key===r)?.visibleLimit!=null;c&&J(e=>new Set(e).add(t)),K(e=>new Map(e).set(t,{to:r,index:i}));let l=()=>K(e=>{let n=new Map(e);return n.delete(t),n}),u;try{u=a({card:o,key:t,from:n,to:r,index:i})}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}),s(ue(e)||C.serverMessage)})},n=e=>{if(!(e instanceof CustomEvent))throw Error(`wui:kanban:locked arrived without a CustomEvent`);let{key:t,reason:n}=e.detail,r=X.current.byKey.get(t);r&&X.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}},[S,C.serverMessage]);let Q=e=>ge?.(e)!==!1,Pe=(e,t)=>{q.has(e)&&J(e=>{let n=new Set(e);for(let e of t)n.delete(String(E(e)));return n}),je(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},$={};return P!=null&&($[`--wui-kanban-column-width`]=`${P}px`),F!=null&&($[`--wui-kanban-fill-offset`]=`${F}px`),/* @__PURE__ */ v(`wui-kanban`,{ref:W,id:U,class:V?`wui-kanban ${V}`:`wui-kanban`,role:`region`,"aria-label":ve,"board-id":_e||void 0,"summary-format":Z?z:void 0,"summary-unit":Z&&B?B:void 0,readonly:we?``:void 0,fill:De?``:void 0,"data-head-layout":L===`stacked`?`stacked`:void 0,"data-head-truncate":R?``:void 0,style:$,controlled:``,...de,...H,children:[/* @__PURE__ */ _(`nav`,{className:`wui-kanban-switcher`,"aria-label":ye,children:w.map((e,t)=>/* @__PURE__ */ v(`button`,{type:`button`,className:`wui-kanban-switch`,"data-wui-switch":e.key,"aria-controls":`${U}-${e.key}`,"aria-current":t===0?`true`:void 0,children:[/* @__PURE__ */ _(`span`,{className:`wui-kanban-switch-title`,children:e.title}),/* @__PURE__ */ _(`span`,{className:`wui-kanban-count`,"data-wui-count":``,children:(Ne.get(e.key)||[]).filter(Q).length})]},e.key))}),Te&&/* @__PURE__ */ v(`p`,{className:`wui-kanban-hint`,"aria-hidden":`true`,children:[/* @__PURE__ */ _(a,{name:`arrow-swap-horizontal`,size:14}),Ee]}),/* @__PURE__ */ _(`div`,{className:`wui-kanban-board`,"data-wui-scroller":``,children:w.map(n=>{let r=e(ke,{href:n.href}),i=`${U}-${n.key}`,o=Ne.get(n.key)||[],s=o.filter(Q),c=!!(n.collapsible&&n.collapsed),l=ne(n.visibleLimit),d=q.has(n.key),f=te(s.map(e=>String(E(e))),l,d,Me),p=typeof n.summary==`function`?n.summary(s):n.summary;Z&&(p=ee(re(s.map(e=>O?.(e))),Z));let m=me?.(n,s);return/* @__PURE__ */ v(`section`,{className:`wui-kanban-column`,id:i,"data-wui-column":n.key,"data-tone":n.tone&&u.includes(n.tone)?n.tone:`neutral`,"aria-labelledby":`${i}-title`,"data-accept-from":n.acceptFrom?n.acceptFrom.join(` `):void 0,"data-collapsible":n.collapsible?``:void 0,"data-collapsed":c?``:void 0,"data-collapsed-layout":n.collapsedLayout===`strip`?`strip`:void 0,children:[/* @__PURE__ */ v(`header`,{className:`wui-kanban-head`,children:[/* @__PURE__ */ _(`span`,{className:`wui-kanban-dot`,"aria-hidden":`true`}),/* @__PURE__ */ _(`h2`,{className:`wui-kanban-title`,id:`${i}-title`,title:R?n.title:void 0,children:n.href?/* @__PURE__ */ _(t,{link:r,children:n.title}):n.title}),/* @__PURE__ */ _(`span`,{className:`wui-kanban-count`,"data-wui-count":``,children:s.length}),n.collapsible&&/* @__PURE__ */ _(`span`,{className:`wui-kanban-lock`,"aria-hidden":`true`,children:/* @__PURE__ */ _(a,{name:`lock`,size:14})}),m!=null&&m!==!1&&/* @__PURE__ */ _(`div`,{className:`wui-kanban-actions`,"data-wui-no-drag":``,children:m}),n.collapsible&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-kanban-collapse`,"data-wui-collapse":``,"aria-expanded":c?`false`:`true`,"aria-controls":`${i}-body`,"aria-label":y(c?be:xe,{title:n.title}),children:/* @__PURE__ */ _(a,{name:`chevron-left`,size:16})}),p!=null&&/* @__PURE__ */ _(`div`,{className:`wui-kanban-summary`,"data-wui-summary":``,children:p})]}),/* @__PURE__ */ _(`p`,{className:`wui-kanban-drop-note`,"data-wui-drop-note":``,hidden:!0}),/* @__PURE__ */ _(`div`,{className:`wui-kanban-body`,id:`${i}-body`,"data-wui-body":``,children:o.map(e=>{let t=String(E(e)),n=G.has(t),r=!!he?.(e),i=r&&A?A(e):void 0;return/* @__PURE__ */ v(`article`,{className:`wui-kanban-card`,"data-wui-card":t,tabIndex:0,"aria-label":k?k(e):void 0,"data-wui-locked":r?``:void 0,"data-wui-value":O?O(e)??void 0:void 0,"aria-current":I!=null&&t===String(I)?`true`:void 0,"aria-busy":n?`true`:void 0,"data-wui-saving":n?``:void 0,"data-wui-overflow":f.has(t)?``:void 0,hidden:!Q(e),children:[!!i&&/* @__PURE__ */ v(`span`,{className:`wui-kanban-card-lock`,title:i,children:[/* @__PURE__ */ _(`span`,{"aria-hidden":`true`,children:/* @__PURE__ */ _(a,{name:`lock`,size:14})}),/* @__PURE__ */ _(`span`,{className:`visually-hidden`,children:i})]}),pe?.(e)]},t)})}),l!=null&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-kanban-more`,"data-wui-more":``,"aria-controls":`${i}-body`,"aria-expanded":d?`true`:`false`,hidden:d?s.length<=l:f.size===0,onClick:()=>Pe(n.key,o),children:d?C.fewerLabel:y(C.moreText,{count:f.size})}),/* @__PURE__ */ _(`p`,{className:`wui-kanban-empty`,"data-wui-empty":``,hidden:s.length>0,children:n.emptyText??Se})]},n.key)})}),/* @__PURE__ */ _(`p`,{className:`visually-hidden`,id:`${U}-help`,"data-wui-help":``,children:Ce}),/* @__PURE__ */ _(`div`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{linkTarget as e}from"../lib/linkTarget.js";import{TargetLink as t}from"../lib/TargetLink.js";import{TONES as
|
|
1
|
+
import{linkTarget as e}from"../lib/linkTarget.js";import{TargetLink as t}from"../lib/TargetLink.js";import n from"../lib/useWuiText.js";import{TONES as r}from"../lib/vocabulary.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import ee from"./AppIcon.js";import a from"./AppSparkline.js";import o from"./assertValidValue.js";import s from"./renderIconProp.js";import c from"./textOf.js";import l from"./warnUnknownProps.js";import{Fragment as te,jsx as u,jsxs as d}from"react/jsx-runtime";import{KPI_TILE_TEXT as ne}from"@webority/ui-elements/text";var re=[`plain`,`filled`,`accent`,`spotlight`],ie=[`sm`,`md`,`lg`],ae=r,oe=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],se=[`up`,`down`,`flat`],f=[`above`,`below`],ce=[1,2,3,4,5,6,7,8],le=r.filter(e=>[`success`,`danger`,`neutral`].includes(e)),p={success:` wui-kpi-delta--success`,danger:` wui-kpi-delta--danger`,neutral:` wui-kpi-delta--neutral`};function ue(e){let t=c(e).trim();return t.startsWith(`+`)?`up`:t.startsWith(`-`)||t.startsWith(`−`)?`down`:`flat`}function m(r){let{marker:c,props:m}=i(`AppKpiTile`,r),h=n(`kpiTile`,ne),{label:g,value:_,caption:v,icon:y,iconTone:b,iconVariant:x=`twotone`,delta:S,deltaDirection:C,deltaTone:w,sparkline:T,variant:E=`plain`,size:D=`md`,valueSize:O,inline:de=!1,stacked:fe=!1,iconSlot:k,attention:pe=!1,href:A,linkComponent:me,className:j=``,style:M,iconClassName:N=``,labelClassName:P=``,valueClassName:F=``,captionClassName:I=``,deltaClassName:L=``,sparklineClassName:R=``,loading:z=!1,labelPosition:B=`above`,sparklineLabel:he,...V}=m;l(`AppKpiTile`,V),o(`AppKpiTile`,`variant`,E,re),o(`AppKpiTile`,`size`,D,ie),o(`AppKpiTile`,`iconTone`,b,ae),o(`AppKpiTile`,`iconVariant`,x,oe),o(`AppKpiTile`,`deltaDirection`,C,se),o(`AppKpiTile`,`deltaTone`,w,le),o(`AppKpiTile`,`iconSlot`,k,ce),o(`AppKpiTile`,`labelPosition`,B,f);let ge=E===`filled`?` kpi-filled`:E===`accent`?` kpi-accent`:E===`spotlight`?` kpi-spotlight`:``,_e=D===`lg`?` kpi-lg`:D===`sm`?` kpi-sm`:``,ve=de?` kpi-inline`:fe||E===`spotlight`?``:` wui-kpi-picked`,H=B===`below`,U=`kpi${ve}${ge}${_e}${pe?` kpi-attention`:``}${H?` wui-kpi-label-below`:``}${j?` ${j}`:``}`,W=typeof O==`number`&&O>0?{...M,"--wui-kpi-value-size":`${O}px`}:M,G=C??ue(S),K=G===`up`?`arrow-up`:G===`down`?`arrow-down`:null,ye=w!==void 0&&Object.hasOwn(p,w)?p[w]:``,q=A==null?null:e(me,{href:A}),J=k==null?``:` wui-kpi-icon-chart-${k}`,Y=!z&&_===null,X=z?{"aria-busy":!0}:{},be=z?/* @__PURE__ */ u(`span`,{className:`skeleton wui-kpi-skeleton`,"aria-hidden":`true`}):Y?h.noData:_,Z=/* @__PURE__ */ u(`div`,{className:`kpi-label${P?` ${P}`:``}`,children:g}),Q=/* @__PURE__ */ u(`div`,{className:`kpi-value${Y?` wui-kpi-nodata`:``}${F?` ${F}`:``}`,children:be}),$=/* @__PURE__ */ d(te,{children:[y&&/* @__PURE__ */ u(`span`,{className:`kpi-icon${J}${b?` kpi-icon-${b}`:``}${N?` ${N}`:``}`,children:s(y,{size:20,variant:x})}),H?Q:Z,H?Z:Q,!z&&v&&/* @__PURE__ */ u(`div`,{className:`kpi-caption${I?` ${I}`:``}`,children:v}),!z&&S&&/* @__PURE__ */ d(`div`,{className:`kpi-delta${G===`flat`?``:` ${G}`}${ye}${L?` ${L}`:``}`,children:[K&&/* @__PURE__ */ u(ee,{name:K,size:13}),S]}),!z&&T&&T.length>0&&/* @__PURE__ */ u(a,{data:T,label:he,className:`kpi-sparkline${R?` ${R}`:``}`})]});return q===null?/* @__PURE__ */ u(`div`,{className:U,style:W,...c,...X,...V,children:$}):/* @__PURE__ */ u(t,{link:q,className:U,style:W,...c,...X,...V,children:$})}export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../lib/useWuiText.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppBadge.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{DATA_TABLE_TEXT as s}from"@webority/ui-elements/text";var c=[`none`,`md`],l=[`saving`,`saved`,`error`],u=new Intl.NumberFormat(`en-IN`,{maximumFractionDigits:0});function d(d){let f=e(`dataTable`,s),{marker:p,props:m}=t(`AppListCard`,d),{title:h,subtitle:g,count:_,padding:v=`none`,actions:y,filters:b,saveState:x,className:S=``,children:C,...w}=m;i(`AppListCard`,w),r(`AppListCard`,`padding`,v,c),r(`AppListCard`,`saveState`,x,l);let T=[v===`none`?`card card-pad-none wui-list-card`:`card wui-list-card`,S].filter(Boolean).join(` `),E=!!h||y!==void 0||!!x,D=x===`saving`?f.saveBusyLabel:x===`saved`?f.saveDoneLabel:f.saveFailedLabel;return/* @__PURE__ */ o(`div`,{className:T,"data-wui-save-state":x||void 0,"aria-busy":x===`saving`?`true`:void 0,...p,...w,children:[E&&/* @__PURE__ */ o(`div`,{className:`card-header`,children:[/* @__PURE__ */ a(`div`,{className:`card-header-main`,children:/* @__PURE__ */ o(`div`,{className:`card-header-titles`,children:[h&&/* @__PURE__ */ o(`div`,{className:`card-title`,children:[h,_!==void 0&&/* @__PURE__ */ a(n,{className:`wui-list-card-count`,children:u.format(_)})]}),g&&/* @__PURE__ */ a(`div`,{className:`card-subtitle`,children:g})]})}),y!==void 0&&x!==`saving`&&/* @__PURE__ */ a(`div`,{className:`card-header-actions`,children:y}),x&&/* @__PURE__ */ a(`span`,{className:`wui-row-status wui-row-status-${x}`,role:`status`,children:D})]}),b!==void 0&&/* @__PURE__ */ a(`div`,{className:`wui-list-card-filters`,children:b}),/* @__PURE__ */ a(`div`,{className:`card-body`,children:C})]})}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../lib/FieldMessage.js";import{FIELD_SIZES as t}from"../lib/fieldState.js";import{useFieldError as n}from"../lib/formFields.js";import r from"../lib/useElementEntry.js";import i from"../lib/useWuiText.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppInfoTip.js";import s from"./AppRequiredMark.js";import c from"./assertValidValue.js";import l from"./useWuiControl.js";import u from"./warnUnknownProps.js";import{useEffect as d,useId as f,useRef as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{MENTION_INPUT_TEXT as ee}from"@webority/ui-elements/text";var te=()=>import(`@webority/ui-elements/elements/mention-input`),ne=e=>typeof e==`object`&&!!e&&`query`in e&&typeof e.query==`string`;function g({ref:g,..._}){let v=r(`wui-mention-input`,te),y=i(`mentionInput`,ee),{marker:b,props:x}=a(`AppMentionInput`,_),{value:S,defaultValue:C,onChange:w,people:T,loadPeople:E,minChars:D,debounce:O,onSubmit:k,rows:A=3,placeholder:
|
|
1
|
+
import e from"../lib/FieldMessage.js";import{FIELD_SIZES as t}from"../lib/fieldState.js";import{useFieldError as n}from"../lib/formFields.js";import r from"../lib/useElementEntry.js";import i from"../lib/useWuiText.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppInfoTip.js";import s from"./AppRequiredMark.js";import c from"./assertValidValue.js";import l from"./useWuiControl.js";import u from"./warnUnknownProps.js";import{useEffect as d,useId as f,useRef as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{MENTION_INPUT_TEXT as ee}from"@webority/ui-elements/text";var te=()=>import(`@webority/ui-elements/elements/mention-input`),ne=[`underline`],re=e=>typeof e==`object`&&!!e&&`query`in e&&typeof e.query==`string`;function g({ref:g,..._}){let v=r(`wui-mention-input`,te),y=i(`mentionInput`,ee),{marker:b,props:x}=a(`AppMentionInput`,_),{value:S,defaultValue:C,onChange:w,people:T,loadPeople:E,minChars:D,debounce:O,onSubmit:k,rows:A=3,placeholder:ie,disabled:j=!1,readOnly:M=!1,loading:N=!1,size:P=`md`,variant:F,name:I,id:L,label:R,error:z,helperText:B,required:V=!1,help:H,helpLabel:U=y.helpLabel,className:W=``,fieldClassName:G=``,...K}=x,q=n(I),J=z??q;u(`AppMentionInput`,K),c(`AppMentionInput`,`size`,P,t),c(`AppMentionInput`,`variant`,F,ne);let Y=typeof E==`function`,ae=f(),X=L||`mention-${ae.replace(/[^a-zA-Z0-9_-]/g,``)}`,oe=J?`${X}-error`:B?`${X}-hint`:void 0,Z=p(N),Q=p(!1),{setRef:se,innerRef:$}=l({ready:v,ref:g,value:S??(C===void 0?``:void 0),defaultValue:C,on:{change:e=>{let t=$.current;if(e.target===e.currentTarget&&t){if(typeof t.value!=`string`||!Array.isArray(t.mentions))throw TypeError(`<wui-mention-input> reported a change without its value and mentions.`);w?.(t.value,{mentions:t.mentions})}},"wui:mention-input:submit":()=>k?.()}});return d(()=>{let e=$.current;e&&v&&!Y&&(e.people=T||[])},[T,Y,v,$]),d(()=>{Z.current=N;let e=$.current;e&&v&&!Q.current&&(e.loading=N)},[N,v,$]),d(()=>{let e=$.current;if(!e||!v||!Y)return;let t=0,n=null,r=async r=>{if(!(r instanceof CustomEvent))throw TypeError(`<wui-mention-input> search arrived without its query.`);let i=r.detail;if(!re(i))throw TypeError(`<wui-mention-input> search arrived without its query.`);let a=i.query,o=++t;n?.abort(),n=typeof AbortController==`function`?new AbortController:null,Q.current=!0,e.loading=!0;try{let r=await E(a,{signal:n?.signal});o===t&&(e.people=r||[])}catch(r){if((r instanceof DOMException||r instanceof Error)&&r.name===`AbortError`)return;o===t&&(e.people=[],e.searchFailed=!0,n?.signal.aborted||reportError(r))}finally{o===t&&(Q.current=!1,e.loading=Z.current)}};return e.addEventListener(`search`,r),()=>{t=-1,n?.abort(),e.removeEventListener(`search`,r),Q.current=!1,e.loading=Z.current}},[Y,E,v,$]),/* @__PURE__ */ h(`div`,{...b,className:`field${G?` ${G}`:``}`,children:[R&&/* @__PURE__ */ h(`label`,{className:`label`,htmlFor:`${X}-text`,children:[R,V&&/* @__PURE__ */ m(s,{}),H&&/* @__PURE__ */ m(o,{label:U,children:H})]}),/* @__PURE__ */ m(`wui-mention-input`,{ref:se,id:X,class:`wui-mention-input${F===`underline`?` wui-input-underline`:``}${W?` ${W}`:``}`,label:typeof R==`string`?R:void 0,placeholder:ie||void 0,rows:String(A),name:I||void 0,remote:Y?``:void 0,"min-chars":D==null?void 0:String(D),debounce:O==null?void 0:String(O),disabled:j?``:void 0,readonly:M?``:void 0,loading:N?``:void 0,size:P===`md`?void 0:P,"aria-describedby":oe,"aria-invalid":J?`true`:void 0,...K}),/* @__PURE__ */ m(e,{error:J,hint:B,errorId:`${X}-error`,hintId:`${X}-hint`})]})}export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../lib/useElementEntry.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{useCallback as a,useEffect as o,useRef as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{DATE_PICKER_TEXT as u,MINI_CALENDAR_TEXT as d}from"@webority/ui-elements/text";var f=()=>import(`@webority/ui-elements/elements/mini-calendar`),p=[`monday`,`sunday`],m=[`neutral`,`warning`],h=/^(\d{4})-(\d{2})$/,g=864e5,_=e=>Date.UTC(Number(e.slice(0,4)),Number(e.slice(5,7))-1,Number(e.slice(8,10)))/g,v=e=>(/* @__PURE__ */ new Date(e*g)).toISOString().slice(0,10),y=e=>(/* @__PURE__ */ new Date(e*g)).getUTCDay(),b=()=>new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}).format(/* @__PURE__ */ new Date),x=(e,t)=>new Intl.DateTimeFormat(`en`,{...t,timeZone:`UTC`}).format(/* @__PURE__ */ new Date(e*g));function S({ref:g,...S}){e(`wui-mini-calendar`,f);let{marker:C,props:w}=n(`AppMiniCalendar`,S),T=t(`datePicker`,u),E=t(`miniCalendar`,d),{month:D,onMonthChange:O,value:k,onChange:A,markers:j=[],rangeStart:M=null,rangeEnd:N=null,firstDay:P=`monday`,label:F=E.label,className:I=``,...L}=w;i(`AppMiniCalendar`,L),r(`AppMiniCalendar`,`firstDay`,P,p);let R=s(null),z=a(e=>{R.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]);o(()=>{let e=R.current;if(!e)return;let t=e=>{let t=e instanceof CustomEvent?e.detail?.value:void 0;typeof t==`string`&&A?.(t)},n=e=>{let t=e instanceof CustomEvent?e.detail?.month:void 0;typeof t==`string`&&O?.(t)};return e.addEventListener(`wui-mini-calendar:select`,t),e.addEventListener(`wui-mini-calendar:navigate`,n),()=>{e.removeEventListener(`wui-mini-calendar:select`,t),e.removeEventListener(`wui-mini-calendar:navigate`,n)}},[A,O]);let B=D??b().slice(0,7),V=h.exec(B);if(!V)throw Error(`AppMiniCalendar: month must be YYYY-MM, got "${B}".`);let H=Number(V[1]),U=Number(V[2])-1,W=/* @__PURE__ */ new Map;for(let e of j){r(`AppMiniCalendar`,`markers.tone`,e.tone??`neutral`,m);let t=W.get(e.date),n=e.tone??`neutral`,i=[...t?.labels??[],...e.label?[e.label]:[]];W.set(e.date,{tone:t?.tone===`warning`||n===`warning`?`warning`:`neutral`,labels:i})}let G=_(`${H}-${String(U+1).padStart(2,`0`)}-01`),K=new Date(Date.UTC(H,U+1,0)).getUTCDate(),q=(y(G)-(P===`sunday`?0:1)+7)%7,J=Math.ceil((q+K)/7)*7,Y=b(),X=Array.from({length:J},(e,t)=>{let n=G-q+t,r=v(n),i=W.get(r),a=r.slice(0,7)===B,o=y(n)===0||y(n)===6,s=M!==null&&N!==null&&r>=M&&r<=N,u=k===r,d=r===Y,f=x(n,{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`}),p=i?.labels.length?`${f}, ${i.labels.join(`; `)}`:f,m=[`wui-mini-calendar-day`,a?``:`is-outside`,o?`wui-mini-calendar-day--weekend`:``,d?`is-today`:``,u?`is-selected`:``,s?`wui-mini-calendar-day--in-range`:``,i?`has-marker`:``].filter(Boolean).join(` `);return/* @__PURE__ */ l(`button`,{type:`button`,className:m,"data-date":r,"aria-label":p,"aria-pressed":u||void 0,"aria-current":d?`date`:void 0,children:[/* @__PURE__ */ c(`span`,{className:`wui-mini-calendar-day-number`,"aria-hidden":`true`,children:Number(r.slice(8,10))}),i&&/* @__PURE__ */ c(`span`,{className:`wui-mini-calendar-marker wui-mini-calendar-marker--${i.tone}`,"aria-hidden":`true`})]},r)}),Z=X.slice(0,7).map((e,t)=>x(G-q+t,{weekday:`short`})),Q=x(G,{month:`long`,year:`numeric`});return/* @__PURE__ */ l(`wui-mini-calendar`,{...C,...L,ref:z,className:`wui-mini-calendar${I?` ${I}`:``}`,role:`group`,"aria-label":F,"data-month":B,children:[/* @__PURE__ */ l(`div`,{className:`wui-mini-calendar-head`,children:[/* @__PURE__ */ c(`button`,{type:`button`,className:`wui-mini-calendar-nav`,"data-nav":`-1`,"aria-label":T.previousMonth,children:/* @__PURE__ */ c(`span`,{"aria-hidden":`true`,children:`‹`})}),/* @__PURE__ */ c(`div`,{className:`wui-mini-calendar-title`,"aria-live":`polite`,children:Q}),/* @__PURE__ */ c(`button`,{type:`button`,className:`wui-mini-calendar-nav`,"data-nav":`1`,"aria-label":T.nextMonth,children:/* @__PURE__ */ c(`span`,{"aria-hidden":`true`,children:`›`})})]}),/* @__PURE__ */ c(`div`,{className:`wui-mini-calendar-weekdays`,"aria-hidden":`true`,children:Z.map(e=>/* @__PURE__ */ c(`span`,{children:e},e))}),/* @__PURE__ */ c(`div`,{className:`wui-mini-calendar-grid`,children:X})]})}export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{linkTarget as e}from"../lib/linkTarget.js";import{TargetLink as t}from"../lib/TargetLink.js";import n from"../lib/useElementEntry.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./
|
|
1
|
+
import{linkTarget as e}from"../lib/linkTarget.js";import{TargetLink as t}from"../lib/TargetLink.js";import n from"../lib/useElementEntry.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./assertValidValue.js";import o from"./renderIconProp.js";import s from"./warnUnknownProps.js";import{Fragment as c,useId as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{NAVIGATION_MENU_TEXT as f}from"@webority/ui-elements/text";var p=[`pills`,`underline`,`text`],m=()=>import(`@webority/ui-elements/elements/navigation-menu`);function h(h){n(`wui-navigation-menu`,m);let g=r(`navigationMenu`,f),{marker:_,props:v}=i(`AppNavigationMenu`,h),{items:y=[],ariaLabel:b=g.ariaLabel,variant:x=`pills`,flush:S=!1,linkComponent:C,className:w=``,...T}=v;if(s(`AppNavigationMenu`,T),a(`AppNavigationMenu`,`variant`,x,p),S&&x!==`underline`)throw Error(`AppNavigationMenu: flush works only with variant="underline", not "${x}".`);let E=l();return/* @__PURE__ */ u(`wui-navigation-menu`,{class:[`wui-nav-menu`,x===`pills`?``:`wui-nav-menu-${x}`,S?`wui-nav-menu-flush`:``,w].filter(Boolean).join(` `),..._,...T,children:/* @__PURE__ */ u(`nav`,{"aria-label":b,children:/* @__PURE__ */ u(`ul`,{className:`wui-nav-menu-list`,children:y.map((n,r)=>{let i=n.group&&n.group!==y[r-1]?.group?/* @__PURE__ */ u(`li`,{className:`wui-nav-menu-group`,role:`presentation`,children:n.group},`${n.key}-group`):null;if(!n.links?.length)return/* @__PURE__ */ d(c,{children:[i,/* @__PURE__ */ u(`li`,{className:`wui-nav-menu-item`,children:/* @__PURE__ */ u(t,{link:e(C,{href:n.to}),className:`wui-nav-menu-toplink`,"aria-current":n.current?`page`:void 0,children:n.label})})]},n.key);let a=`${E}-${n.key}`;return/* @__PURE__ */ d(c,{children:[i,/* @__PURE__ */ d(`li`,{className:`wui-nav-menu-item`,children:[/* @__PURE__ */ d(`button`,{type:`button`,className:n.current||n.links.some(e=>e.current)?`wui-nav-menu-trigger is-current`:`wui-nav-menu-trigger`,"aria-expanded":`false`,"aria-controls":a,"data-key":n.key,children:[n.label,o(`chevron-down`,{size:14,className:`wui-nav-menu-chevron`})]}),/* @__PURE__ */ u(`div`,{className:`wui-nav-menu-panel`,id:a,children:/* @__PURE__ */ u(`ul`,{className:`wui-nav-menu-links`,children:n.links.map(n=>/* @__PURE__ */ u(`li`,{children:/* @__PURE__ */ d(t,{link:e(C,{href:n.to}),className:`wui-nav-menu-link`,"aria-current":n.current?`page`:void 0,children:[o(n.icon,{size:18}),/* @__PURE__ */ d(`span`,{className:`wui-nav-menu-link-text`,children:[/* @__PURE__ */ u(`span`,{className:`wui-nav-menu-link-label`,children:n.label}),n.description?/* @__PURE__ */ u(`span`,{className:`wui-nav-menu-link-desc`,children:n.description}):null]})]})},n.key))})})]})]},n.key)})})})})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{linkTarget as e}from"../lib/linkTarget.js";import{TargetLink as t}from"../lib/TargetLink.js";import n from"../lib/useElementEntry.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppIcon.js";import o from"./AppTabs.js";import s from"./assertValidValue.js";import c from"./warnUnknownProps.js";import{groupNotificationsByDay as l,notificationCountText as u,notificationTime as d,notificationTriggerLabel as f,notificationUnreadAnnouncement as p}from"@webority/ui-elements/helpers";import{useEffect as m,useId as h,useLayoutEffect as
|
|
1
|
+
import{linkTarget as e}from"../lib/linkTarget.js";import{TargetLink as t}from"../lib/TargetLink.js";import n from"../lib/useElementEntry.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppIcon.js";import o from"./AppTabs.js";import s from"./assertValidValue.js";import c from"./warnUnknownProps.js";import{groupNotificationsByDay as l,notificationCountText as u,notificationTime as d,notificationTriggerLabel as f,notificationUnreadAnnouncement as p}from"@webority/ui-elements/helpers";import{useEffect as m,useId as h,useLayoutEffect as ee,useRef as g,useState as _}from"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{NOTIFICATION_CENTRE_TEXT as x}from"@webority/ui-elements/text";var S=[`all`,`unread`,`archived`],C=`a, button, input, select, textarea`,w=[`relative`,`exact`],te=()=>import(`@webority/ui-elements/elements/notification-center`);function T(e){n(`wui-notification-center`,te);let t=r(`notificationCentre`,x),{marker:d,props:v}=i(`AppNotificationCenter`,e),{items:S,unread:C,label:T=t.label,emptyText:D=t.emptyText,loading:k=!1,error:A,dayLabels:j=`relative`,earlierHref:M,viewAllHref:N,defaultOpen:P=!1,now:F,onMarkAllRead:I,onItemClick:L,renderItem:ae,tabs:oe,onTabChange:se,onOpenChange:R,linkComponent:z,className:B=``,...V}=v;if(c(`AppNotificationCenter`,V),!Array.isArray(S))throw Error(`<AppNotificationCenter> items is required: pass the notifications, newest first.`);s(`AppNotificationCenter`,`dayLabels`,j,w);let H=ne(oe,t),[U,W]=_(H[0]?.key),G=H.some(e=>e.key===U)?U:H[0]?.key,ce=e=>{e!==G&&(W(e),se?.(e))},K=h(),q=h(),J=g(null),Y=g(R);Y.current=R,m(()=>{let e=J.current;if(!e)return;let t=e=>{if(!(e instanceof CustomEvent))throw Error(`wui:notification-center:toggle carried no CustomEvent`);let t=e.detail;if(typeof t!=`object`||!t||!(`open`in t))throw Error(`wui:notification-center:toggle carried no open flag in its detail`);Y.current?.(!!t.open)};return e.addEventListener(`wui:notification-center:toggle`,t),()=>e.removeEventListener(`wui:notification-center:toggle`,t)},[]);let X=g(P);ee(()=>{if(!X.current)return;let e=J.current;e&&(e.setAttribute(`open`,``),e.querySelector(`.wui-notification-center-trigger`)?.setAttribute(`aria-expanded`,`true`))},[]);let Z=C??S.filter(e=>!e.read&&!e.archived).length,[le,ue]=_(``),Q=g(Z);m(()=>{Q.current!==Z&&(Q.current=Z,ue(p(Z)))},[Z]);let $=l(H.length>0?re(S,G):S,F),de=[`wui-notification-center`,B].filter(Boolean).join(` `);return/* @__PURE__ */ b(`wui-notification-center`,{ref:J,class:de,label:T,controlled:``,...d,...V,children:[/* @__PURE__ */ b(`button`,{type:`button`,className:`topbar-icon-btn wui-notification-center-trigger`,"aria-expanded":X.current?`true`:`false`,"aria-controls":K,"aria-haspopup":`dialog`,"aria-label":f(T,Z),children:[/* @__PURE__ */ y(a,{name:`notification`,size:20}),/* @__PURE__ */ y(`span`,{className:`wui-notification-center-count`,"aria-hidden":`true`,hidden:Z===0,children:u(Z)})]}),/* @__PURE__ */ y(`span`,{className:`visually-hidden wui-notification-center-live`,"aria-live":`polite`,children:le}),/* @__PURE__ */ b(`div`,{className:`wui-notification-center-panel`,popover:`auto`,id:K,role:`dialog`,"aria-labelledby":q,tabIndex:-1,children:[/* @__PURE__ */ b(`div`,{className:`wui-notification-center-head`,children:[/* @__PURE__ */ y(`h2`,{className:`wui-notification-center-title`,id:q,children:T}),I&&/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-notification-center-markall`,disabled:Z===0,onClick:I,children:t.markAllLabel})]}),G!==void 0&&/* @__PURE__ */ y(`div`,{className:`wui-notification-center-tabs`,children:/* @__PURE__ */ y(o,{tabs:H,value:G,onChange:ce,size:`sm`,fitted:!0,ariaLabel:T})}),A?/* @__PURE__ */ b(`div`,{className:`wui-notification-center-error`,role:`alert`,children:[/* @__PURE__ */ y(`p`,{className:`wui-notification-center-error-text`,children:A.text??t.errorText}),/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-notification-center-retry`,onClick:A.onRetry,children:t.retryLabel})]}):k?/* @__PURE__ */ y(`p`,{className:`wui-notification-center-loading`,role:`status`,children:t.loadingText}):$.length===0?/* @__PURE__ */ y(`p`,{className:`wui-notification-center-empty`,children:D}):/* @__PURE__ */ y(`div`,{className:`wui-notification-center-list`,children:$.map(e=>/* @__PURE__ */ b(`section`,{"aria-labelledby":`${K}-${e.key}`,children:[/* @__PURE__ */ y(`h3`,{className:`wui-notification-center-day`,id:`${K}-${e.key}`,children:j===`exact`?e.key:e.heading}),/* @__PURE__ */ y(`ul`,{className:`wui-notification-center-items`,children:e.items.map(e=>/* @__PURE__ */ y(`li`,{children:/* @__PURE__ */ y(O,{item:e,onItemClick:L,renderItem:ae,linkComponent:z})},e.id))})]},e.key))}),H.length>0&&!A&&!k&&M&&/* @__PURE__ */ y(ie,{href:M,hidden:G!==`unread`,linkComponent:z}),N&&/* @__PURE__ */ y(E,{href:N,linkComponent:z})]})]})}function ne(e,t){let n={all:t.allLabel,unread:t.unreadLabel,archived:t.archivedLabel};return e===!0?S.map(e=>({key:e,label:n[e]})):Array.isArray(e)?e.map(e=>(s(`AppNotificationCenter`,`tabs[].key`,e.key,S),{key:e.key,label:e.label??n[e.key]})):[]}function re(e,t){if(t===`archived`)return e.filter(e=>e.archived);let n=e.filter(e=>!e.archived);return t===`unread`?n.filter(e=>!e.read):n}function ie({href:n,hidden:i,linkComponent:a}){let o=r(`notificationCentre`,x),s=e(a,{href:n}),c=s.Tag===`a`?void 0:e=>D(e.currentTarget);return/* @__PURE__ */ y(t,{link:s,className:`wui-notification-center-earlier`,hidden:i,onClick:c,children:o.earlierLabel})}function E({href:n,linkComponent:i}){let a=r(`notificationCentre`,x),o=e(i,{href:n}),s=o.Tag===`a`?void 0:e=>D(e.currentTarget);return/* @__PURE__ */ y(t,{link:o,className:`wui-notification-center-foot`,onClick:s,children:a.viewAllLabel})}function D(e){e.closest(`wui-notification-center`)?.close?.()}function O({item:n,onItemClick:i,renderItem:o,linkComponent:s}){let c=r(`notificationCentre`,x),l=`wui-notification-center-item${n.read?` wui-notification-center-item-read`:``}`,u=!n.read&&/* @__PURE__ */ y(`span`,{className:`visually-hidden wui-notification-center-unread-label`,children:`${c.unreadPrefixText} `}),f=/* @__PURE__ */ y(`span`,{className:`wui-notification-center-dot`,"aria-hidden":`true`});if(o){let e=i?e=>{let t=e.target;t instanceof Element&&!t.closest(C)&&i(n,e)}:void 0;return/* @__PURE__ */ b(`div`,{className:l,"data-id":n.id,tabIndex:-1,onClick:e,children:[f,/* @__PURE__ */ b(`span`,{className:`wui-notification-center-body`,children:[u,o(n)]})]})}let p=d(n.at),m=/* @__PURE__ */ b(v,{children:[f,n.icon&&/* @__PURE__ */ y(`span`,{className:`wui-notification-center-icon`,children:/* @__PURE__ */ y(a,{name:n.icon,size:18})}),/* @__PURE__ */ b(`span`,{className:`wui-notification-center-body`,children:[u,/* @__PURE__ */ y(`span`,{className:`wui-notification-center-item-title`,children:n.title}),n.text&&/* @__PURE__ */ y(`span`,{className:`wui-notification-center-item-text`,children:n.text}),p&&/* @__PURE__ */ y(`time`,{className:`wui-notification-center-when`,dateTime:String(n.at),children:p})]})]}),h=i?e=>i(n,e):void 0;if(n.href){let r=e(s,{href:n.href});return/* @__PURE__ */ y(t,{link:r,className:l,"data-id":n.id,onClick:e=>{i?.(n,e),r.Tag!==`a`&&D(e.currentTarget)},children:m})}return/* @__PURE__ */ y(`button`,{type:`button`,className:l,"data-id":n.id,onClick:h,children:m})}export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../lib/FieldMessage.js";import{FIELD_BUSY_CLASS as t}from"../lib/fieldState.js";import{useFieldError as n}from"../lib/formFields.js";import{groupIndianText as r}from"../lib/indianGrouping.js";import i from"../lib/useWuiText.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import
|
|
1
|
+
import e from"../lib/FieldMessage.js";import{FIELD_BUSY_CLASS as t}from"../lib/fieldState.js";import{useFieldError as n}from"../lib/formFields.js";import{groupIndianText as r}from"../lib/indianGrouping.js";import i from"../lib/useWuiText.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppIcon.js";import ee from"./AppInfoTip.js";import te from"./AppRequiredMark.js";import s from"./assertValidValue.js";import ne from"./warnUnknownProps.js";import{cloneElement as re,useCallback as ie,useEffect as ae,useId as oe,useLayoutEffect as se,useRef as c,useState as l}from"react";import{Fragment as ce,jsx as u,jsxs as d}from"react/jsx-runtime";import{NUMBER_INPUT_TEXT as le}from"@webority/ui-elements/text";import{Form as f}from"react-bootstrap";var ue=[`sm`,`md`,`lg`,`xl`],de=[`none`,`indian`],fe=[`underline`],p=e=>{if(e===``||e==null)return null;let t=parseFloat(e.replace(/,/g,``));return Number.isNaN(t)?null:t};function m(e,t){if(t!=null&&t!==``&&t!==!1)throw Error(`<AppNumberInput> controlOnly draws no field, so it takes no ${e}; draw the label or message on the page.`)}var h=(e,t)=>e.slice(0,t).replace(/\D/g,``).length,g=(e,t)=>{if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(/\d/.test(e.charAt(r))&&++n===t)return r+1;return e.length},_=(e,t,n)=>{let i=t>0&&typeof e==`number`&&Number.isFinite(e)?e.toFixed(t):String(e??``);return n===`indian`?r(i):i};function v({ref:v,...pe}){let{marker:me,props:he}=a(`AppNumberInput`,pe),y=i(`numberInput`,le),{label:b,required:x=!1,optional:ge=!1,error:_e,helperText:S,help:C,helpLabel:ve=y.helpLabel,decreaseLabel:ye=y.decreaseLabel,increaseLabel:be=y.increaseLabel,optionalLabel:xe=y.optionalLabel,value:w,onChange:T,min:E,max:D,step:Se=1,precision:O=0,grouping:k=`none`,unit:A,size:j=`md`,variant:M,id:Ce,name:N,className:we=``,fieldClassName:P=``,disabled:F=!1,readOnly:I=!1,loading:L=!1,steppers:R=!0,controlOnly:Te=!1,defaultValue:z,...B}=he,Ee=n(N),V=_e??Ee,H=I||L;ne(`AppNumberInput`,B),s(`AppNumberInput`,`size`,j,ue),s(`AppNumberInput`,`grouping`,k,de),s(`AppNumberInput`,`variant`,M,fe),Te&&(m(`label`,b),m(`error`,_e),m(`helperText`,S),m(`help`,C),m(`optional`,ge),m(`fieldClassName`,P));let De=oe(),U=Ce||De,Oe=e=>{if(O===0)return Math.round(e);let t=10**O;return Math.round(e*t)/t},W=e=>{let t=e;return typeof E==`number`&&(t=Math.max(t,E)),typeof D==`number`&&(t=Math.min(t,D)),t},G=e=>_(e,O,k),[K,q]=l(()=>G(w??z)),ke=c(k);ae(()=>{let e=w??z,t=ke.current!==k;ke.current=k,q(n=>!t&&p(n)===(e??null)?n:_(t&&w===void 0?p(n):e,O,k))},[w,z,O,k]);let J=c(null),Y=c(null),[,Ae]=l(0),je=ie(e=>{J.current=e,typeof v==`function`?v(e):v&&(v.current=e)},[v]);se(()=>{let e=Y.current,t=J.current;if(e===null||t===null)return;Y.current=null;let n=g(K,e);t.setSelectionRange(n,n)});let X=e=>{let t=(p(K)??W(0))+e*Se,n=W(Oe(t));q(G(n)),T?.(n)},Z=p(K),Me=F||I||L||Z!==null&&typeof E==`number`&&Z<=E,Ne=F||I||L||Z!==null&&typeof D==`number`&&Z>=D,Pe=V&&U?`${U}-error`:void 0,Q=S&&U?`${U}-hint`:void 0,Fe=Pe||Q,Ie=[`input`,j===`sm`?`wui-input-sm`:``,j===`lg`?`wui-input-lg`:``,j===`xl`?`wui-input-xl`:``,V?`error`:``,`num-input`,we,L?t:``].filter(Boolean).join(` `),Le=RegExp(`^${typeof E==`number`&&E>=0?``:`-?`}\\d*${O>0?`(\\.\\d*)?`:``}$`),Re=(e,t)=>{let n=k===`indian`?e.replace(/,/g,``):e;if(!Le.test(n))return;let i=k===`indian`?r(n):n;if(i!==e&&i===K){let e=g(i,t);queueMicrotask(()=>J.current?.setSelectionRange(e,e))}else i!==e&&(Y.current=t,Ae(e=>e+1));q(i);let a=p(n);n===``?T?.(null):a!==null&&T?.(a)},ze=e=>{let t=e.target.value;Re(t,h(t,e.target.selectionStart??t.length))},Be=e=>{if(H){B.onBlur?.(e);return}let t=p(e.target.value);if(t===null)q(``),T?.(null);else{let e=W(Oe(t));q(G(e)),T?.(e)}B.onBlur?.(e)},Ve=e=>{if(H)B.onKeyDown?.(e);else{if(k===`indian`&&(e.key===`Backspace`||e.key===`Delete`)){let t=e.currentTarget.value,n=e.currentTarget.selectionStart;if(n!==null&&e.currentTarget.selectionEnd===n){let r=e.key===`Backspace`?n-1:n,i=e.key===`Backspace`?n-2:n+1;i>=0&&t.charAt(r)===`,`&&/\d/.test(t.charAt(i))&&(e.preventDefault(),Re(t.slice(0,i)+t.slice(i+1),h(t,i)))}}e.ctrlKey||e.metaKey||e.altKey||(e.key===`ArrowUp`?(e.preventDefault(),X(1)):e.key===`ArrowDown`&&(e.preventDefault(),X(-1))),B.onKeyDown?.(e)}},He=/* @__PURE__ */ u(f.Control,{"aria-invalid":V?`true`:`false`,...B,id:U,name:k===`indian`?void 0:N,type:`text`,inputMode:O>0?`decimal`:`numeric`,className:Ie,disabled:F,readOnly:H,"aria-busy":L||void 0,required:x,"aria-describedby":Fe,value:K,ref:je,onChange:ze,onBlur:Be,onKeyDown:Ve}),Ue=[`num-wrap`,j===`sm`?`wui-num-wrap-sm`:``,j===`lg`?`wui-num-wrap-lg`:``,j===`xl`?`wui-num-wrap-xl`:``,M===`underline`?`wui-input-underline`:``].filter(Boolean).join(` `),We=/* @__PURE__ */ d(`div`,{className:Ue,children:[R&&/* @__PURE__ */ u(`button`,{type:`button`,className:`num-btn`,"aria-label":ye,tabIndex:-1,disabled:Me,onClick:()=>X(-1),children:/* @__PURE__ */ u(o,{name:`minus`,size:16})}),He,A&&/* @__PURE__ */ u(`span`,{className:`affix`,children:A}),R&&/* @__PURE__ */ u(`button`,{type:`button`,className:`num-btn`,"aria-label":be,tabIndex:-1,disabled:Ne,onClick:()=>X(1),children:/* @__PURE__ */ u(o,{name:`plus`,size:16})})]}),$=k===`indian`&&N?/* @__PURE__ */ u(`input`,{type:`hidden`,name:N,value:K.replace(/,/g,``),disabled:F,"data-wui-number-plain":``}):null;return Te?/* @__PURE__ */ d(ce,{children:[re(We,me),$]}):/* @__PURE__ */ d(f.Group,{...me,"data-grouping":k===`indian`?k:void 0,className:`field${P?` ${P}`:``}`,children:[b&&/* @__PURE__ */ d(f.Label,{className:`label`,htmlFor:U,children:[b,ge&&!x&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` ${xe}`}),x&&/* @__PURE__ */ u(te,{}),C&&/* @__PURE__ */ u(ee,{label:ve,children:C})]}),We,$,/* @__PURE__ */ u(e,{error:V,hint:S,errorId:Pe,hintId:Q})]})}export{v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../lib/useElementEntry.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppButton.js";import i from"./AppIcon.js";import a from"./warnUnknownProps.js";import{useEffect as o,useRef as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{OFFLINE_BANNER_TEXT as u}from"@webority/ui-elements/text";var d=()=>import(`@webority/ui-elements/elements/offline-banner`),f=`wui:offline-banner:check-again`;function p(p){e(`wui-offline-banner`,d);let{marker:m,props:h}=n(`AppOfflineBanner`,p),{offline:g,loadedAt:_,onCheckAgain:v,className:y=``,...b}=h;a(`AppOfflineBanner`,b);let x=t(`offlineBanner`,u),S=s(null);o(()=>{let e=S.current;if(e&&v)return e.addEventListener(f,v),()=>e.removeEventListener(f,v)},[v]);let C=_?x.loadedAtText.replace(`{time}`,()=>_):x.loadedText,w=[`wui-offline-banner`,y].filter(Boolean).join(` `);return/* @__PURE__ */ l(`wui-offline-banner`,{ref:S,class:w,role:`status`,hidden:!0,offline:g===void 0?void 0:String(g),...m,...b,children:[/* @__PURE__ */ c(`span`,{className:`wui-offline-banner-icon`,children:/* @__PURE__ */ c(i,{name:`wifi`,size:18})}),/* @__PURE__ */ l(`div`,{className:`wui-offline-banner-body`,children:[/* @__PURE__ */ c(`span`,{className:`wui-offline-banner-offline`,children:`${x.offlineText} ${C}`}),/* @__PURE__ */ c(`span`,{className:`wui-offline-banner-back`,children:x.backOnlineText})]}),v&&/* @__PURE__ */ c(`div`,{className:`wui-offline-banner-action`,children:/* @__PURE__ */ c(r,{className:`wui-offline-banner-check`,variant:`solid`,leftIcon:`refresh-cw`,children:x.checkAgainLabel})})]})}export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../lib/FieldMessage.js";import{BOX_SIZES as t}from"../lib/fieldState.js";import{useFieldError as ee}from"../lib/formFields.js";import n from"../lib/useElementEntry.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppInfoTip.js";import o from"./AppRequiredMark.js";import s from"./assertValidValue.js";import c from"./useWuiControl.js";import l from"./warnUnknownProps.js";import{cloneElement as u,useId as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{OTP_INPUT_TEXT as m}from"@webority/ui-elements/text";var h=[`numeric`,`alphanumeric`],g=()=>import(`@webority/ui-elements/elements/otp`);function
|
|
1
|
+
import e from"../lib/FieldMessage.js";import{BOX_SIZES as t}from"../lib/fieldState.js";import{useFieldError as ee}from"../lib/formFields.js";import n from"../lib/useElementEntry.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppInfoTip.js";import o from"./AppRequiredMark.js";import s from"./assertValidValue.js";import c from"./useWuiControl.js";import l from"./warnUnknownProps.js";import{cloneElement as u,useId as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{OTP_INPUT_TEXT as m}from"@webority/ui-elements/text";var h=[`numeric`,`alphanumeric`],g=[`underline`],_=()=>import(`@webority/ui-elements/elements/otp`);function v({ref:v,...y}){let b=n(`wui-otp`,_),{marker:x,props:S}=i(`AppOtpInput`,y),C=r(`otpInput`,m),{value:w,defaultValue:T,onChange:E,onComplete:D,length:O=6,mode:k=`numeric`,size:A=`md`,variant:j,label:M,required:N=!1,optional:P=!1,optionalLabel:F=C.optionalLabel,helperText:I,help:L,helpLabel:R=C.helpLabel,error:z,disabled:te=!1,readOnly:B=!1,loading:V=!1,name:H,id:U,className:W=``,fieldClassName:G=``,...K}=S,q=ee(H),J=z??q;l(`AppOtpInput`,K),s(`AppOtpInput`,`mode`,k,h),s(`AppOtpInput`,`size`,A,t),s(`AppOtpInput`,`variant`,j,g);let Y=d(),X=U||Y,Z=J?`${X}-error`:void 0,Q=I?`${X}-hint`:void 0,ne=Z||Q,{setRef:re}=c({ready:b,ref:v,value:w??(T===void 0?``:void 0),onChange:E,on:{complete:e=>D?.(e.detail)}}),ie=[j===`underline`?`wui-input-underline`:void 0,W].filter(Boolean).join(` `),$=/* @__PURE__ */ f(`wui-otp`,{"aria-label":typeof M==`string`?M:void 0,ref:re,id:X,name:H,length:String(O),mode:k,size:A===`md`?void 0:A,value:(w??T)||void 0,"aria-describedby":ne,"aria-invalid":J?`true`:void 0,disabled:te?``:void 0,readonly:B?``:void 0,loading:V?``:void 0,required:N?``:void 0,className:ie||void 0,...K});return!M&&!J&&!I?u($,x):/* @__PURE__ */ p(`div`,{...x,className:`field${G?` ${G}`:``}`,children:[M&&/* @__PURE__ */ p(`label`,{className:`label`,htmlFor:X,children:[M,P&&!N&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` ${F}`}),N&&/* @__PURE__ */ f(o,{}),L&&/* @__PURE__ */ f(a,{label:R,children:L})]}),$,/* @__PURE__ */ f(e,{error:J,hint:I,errorId:Z,hintId:Q})]})}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{devError as e}from"../lib/devWarn.js";import t from"../lib/useElementEntry.js";import n from"../lib/useWuiText.js";import{TONES as
|
|
1
|
+
import{devError as e}from"../lib/devWarn.js";import t from"../lib/useElementEntry.js";import n from"../lib/useStickyLayer.js";import r from"../lib/useWuiText.js";import{TONES as i}from"../lib/vocabulary.js";import{splitMarkerProps as ee}from"../lib/wuiMarker.js";import{BreadcrumbTrailContext as te}from"./AppBreadcrumbs.js";import ne from"./AppIcon.js";import a from"./assertValidValue.js";import re from"./warnUnknownProps.js";import{formatNumber as ie}from"@webority/ui-elements/helpers";import{useEffect as ae,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{PAGE_HEADER_TEXT as u,fillText as oe}from"@webority/ui-elements/text";var se=[`sm`,`md`,`lg`,`bar`],d=[`start`,`center`],f=[`inline`,`below`],ce=[`below`,`inline`],p=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],m=`.btn-primary`,h=()=>import(`@webority/ui-elements/elements/overflow`),le=[`views`,`tools`,`meta`,`bulk`],ue={views:`tabs (app-tabs) under the header`,tools:`filters in the table toolbar (app-table-toolbar)`,meta:`facts in the header's description or a fact list below it`,bulk:`bulk actions in the table toolbar's bulk slot`},de=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},g=e=>e!=null&&e!==!1&&e!==``;function _({children:e}){t(`wui-overflow`,h);let n=r(`pageHeader`,u);return/* @__PURE__ */ c(`wui-overflow`,{class:`wui-page-header-actions`,label:n.moreLabel,keep:m,children:/* @__PURE__ */ c(`div`,{className:`page-actions`,"data-wui-overflow-list":``,children:e})})}function v(t){let{marker:m,props:h}=ee(`AppPageHeader`,t),v=r(`pageHeader`,u),{title:y,titleSlot:b,as:x=`h1`,subtitle:S,eyebrow:C,icon:w,tone:T=`primary`,status:E,breadcrumbs:D,actions:O,views:k,tools:A,meta:j,metaPlacement:M=`inline`,subtitlePlacement:N=`below`,bulkFor:P,bulk:F,size:I=`md`,align:L=`start`,divider:R=!1,sticky:z=!1,foldActions:B=!1,className:V=``,...H}=h;if(re(`AppPageHeader`,H),a(`AppPageHeader`,`tone`,T,i.filter(e=>e!==`neutral`)),a(`AppPageHeader`,`size`,I,se),a(`AppPageHeader`,`align`,L,d),a(`AppPageHeader`,`as`,x,p),a(`AppPageHeader`,`metaPlacement`,M,f),a(`AppPageHeader`,`subtitlePlacement`,N,ce),I!==`bar`&&de()){let t={views:k,tools:A,meta:j,bulk:F};for(let n of le)g(t[n])&&e(`app-page-header-${n} is drawn only when size="bar". On a ${I} header, put ${ue[n]} instead.`);B&&e(`foldActions works only when size="bar". On a ${I} header it has no effect; drop it or use size="bar".`)}let fe=p.includes(x)?x:`h1`,U=I===`bar`,W=U&&M===`below`,G=!U&&N===`inline`,K=[`page-header`,I&&I!==`md`?`page-header-${I}`:``,L===`center`?`page-header-center`:``,R?`page-header-divider`:``,z?`page-header-sticky`:``,T&&T!==`primary`?`tone-${T}`:``,W?`wui-page-header-meta-below`:``,G?`wui-page-header-subtitle-inline`:``,V].filter(Boolean).join(` `),q=o(null),J=o(null);n(q,z&&U),n(J,z&&!U);let[Y,pe]=s(0),X=U?P:void 0;ae(()=>{if(!X)return;document.getElementById(X)?.setAttribute(`data-wui-bulk-in-bar`,``);let e=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail;typeof t?.selected==`number`&&e.target instanceof Node&&document.getElementById(X)?.contains(e.target)&&pe(t.selected)};return document.addEventListener(`selectionchange`,e),()=>{document.removeEventListener(`selectionchange`,e),document.getElementById(X)?.removeAttribute(`data-wui-bulk-in-bar`)}},[X]);let Z=y!=null||b!=null?/* @__PURE__ */ c(fe,{className:b==null?`page-title`:`page-title wui-page-title-slot`,"aria-label":b!=null&&typeof y==`string`&&y!==``?y:void 0,children:b??y}):null;if(U)return/* @__PURE__ */ l(`header`,{ref:q,className:K,"data-wui-sticky-layer":z?``:void 0,"data-wui-page-header-bar":``,"data-wui-bulk-for":P||void 0,...m,...H,children:[D!=null&&/* @__PURE__ */ c(te,{value:!0,children:/* @__PURE__ */ c(`div`,{className:`page-header-bar-crumbs`,children:D})}),Z,E!=null&&/* @__PURE__ */ c(`span`,{className:`page-status`,children:E}),k!=null&&/* @__PURE__ */ c(`div`,{className:`page-header-bar-views`,"data-wui-bar-swap":``,hidden:P&&Y>0?!0:void 0,children:k}),/* @__PURE__ */ c(`span`,{className:`page-header-bar-spacer`,"aria-hidden":`true`}),j!=null&&!W&&/* @__PURE__ */ c(`div`,{className:`page-header-bar-meta`,children:j}),A!=null&&/* @__PURE__ */ c(`div`,{className:`page-header-bar-tools`,"data-wui-bar-swap":``,hidden:P&&Y>0?!0:void 0,children:A}),P?/* @__PURE__ */ l(`div`,{className:`page-header-bar-bulk`,"data-wui-bar-bulk":``,hidden:Y===0||void 0,children:[/* @__PURE__ */ c(`span`,{className:`page-header-bar-bulk-count`,"aria-live":`polite`,children:Y>0?oe(v.selectedText,{count:ie(Y,{decimals:0})}):``}),F]}):null,O!=null&&(B?/* @__PURE__ */ c(_,{children:O}):/* @__PURE__ */ c(`div`,{className:`page-actions`,children:O})),j!=null&&W&&/* @__PURE__ */ c(`div`,{className:`page-header-bar-meta`,children:j})]});let Q=w==null?null:typeof w==`string`?/* @__PURE__ */ c(ne,{name:w,size:20}):w,$=S==null?null:/* @__PURE__ */ c(`div`,{className:`page-subtitle`,children:S});return/* @__PURE__ */ l(`div`,{ref:J,className:K,"data-wui-sticky-layer":z?``:void 0,...m,...H,children:[D!=null&&/* @__PURE__ */ c(`div`,{className:`page-breadcrumbs`,children:D}),/* @__PURE__ */ l(`div`,{className:`page-header-bar`,children:[/* @__PURE__ */ l(`div`,{className:`page-header-lead`,children:[Q!=null&&/* @__PURE__ */ c(`span`,{className:`page-header-icon`,children:Q}),/* @__PURE__ */ l(`div`,{className:`page-header-titles`,children:[C!=null&&/* @__PURE__ */ c(`div`,{className:`page-eyebrow`,children:C}),/* @__PURE__ */ l(`div`,{className:`page-titlebar`,children:[Z,E!=null&&/* @__PURE__ */ c(`span`,{className:`page-status`,children:E}),G&&$]}),!G&&$]})]}),O!=null&&/* @__PURE__ */ c(`div`,{className:`page-actions`,children:O})]})]})}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../lib/FieldMessage.js";import{FIELD_SIZES as t}from"../lib/fieldState.js";import{loadFlagStyles as n}from"../lib/flagStyles.js";import{useFieldError as r}from"../lib/formFields.js";import i from"../lib/useElementEntry.js";import a from"../lib/useWuiText.js";import{splitMarkerProps as o}from"../lib/wuiMarker.js";import s from"./AppInfoTip.js";import c from"./AppRequiredMark.js";import l from"./assertValidValue.js";import
|
|
1
|
+
import e from"../lib/FieldMessage.js";import{FIELD_SIZES as t}from"../lib/fieldState.js";import{loadFlagStyles as n}from"../lib/flagStyles.js";import{useFieldError as r}from"../lib/formFields.js";import i from"../lib/useElementEntry.js";import a from"../lib/useWuiText.js";import{splitMarkerProps as o}from"../lib/wuiMarker.js";import s from"./AppInfoTip.js";import c from"./AppRequiredMark.js";import l from"./assertValidValue.js";import u from"./useWuiControl.js";import d from"./warnUnknownProps.js";import{useEffect as f,useId as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{PHONE_NUMBER_INPUT_TEXT as g}from"@webority/ui-elements/text";var _=()=>import(`@webority/ui-elements/elements/phone`),v=[`underline`];function y({ref:y,...ee}){let te=i(`wui-phone`,_),{marker:ne,props:b}=o(`AppPhoneNumberInput`,ee),x=a(`phoneNumberInput`,g),{value:S,onChange:C,country:w,lockedCountry:T,disabled:E=!1,readOnly:D=!1,loading:O=!1,defaultValue:k,help:A,helpLabel:j=x.helpLabel,name:M,id:N,label:P=x.label,placeholder:re,required:F=!1,optional:I=!1,optionalLabel:L=x.optionalLabel,helperText:R,error:z,showFlag:B=!0,showDialCode:V=!0,size:H=`md`,fieldClassName:U=``,className:W=``,valid:G=!1,variant:K,...q}=b,J=r(M),Y=z??J;d(`AppPhoneNumberInput`,q),l(`AppPhoneNumberInput`,`size`,H,t),l(`AppPhoneNumberInput`,`variant`,K,v);let X=[W,K===`underline`?`wui-input-underline`:``,G&&!Y?`wui-valid`:``].filter(Boolean).join(` `);f(()=>{B&&n()},[B]);let ie=p(),Z=N||ie,Q=Y&&Z?`${Z}-error`:void 0,$=!Y&&R&&Z?`${Z}-hint`:void 0,{setRef:ae}=u({ready:te,ref:y,value:S??(k===void 0?``:void 0),defaultValue:k,onChange:C,events:[`input`,`change`]});return/* @__PURE__ */ h(`div`,{...ne,className:`field app-phone-number-input${H===`sm`?` wui-phone-sm`:``}${H===`lg`?` wui-phone-lg`:``}${H===`xl`?` wui-phone-xl`:``}${U?` ${U}`:``}`,children:[P&&/* @__PURE__ */ h(`label`,{className:`label`,htmlFor:Z,children:[P,I&&!F&&/* @__PURE__ */ m(`span`,{className:`label-optional`,children:` ${L}`}),F&&/* @__PURE__ */ m(c,{}),A&&/* @__PURE__ */ m(s,{label:j,children:A})]}),/* @__PURE__ */ m(`wui-phone`,{ref:ae,id:Z,name:M,"aria-label":typeof P==`string`?P:void 0,"aria-describedby":Q||$,"aria-invalid":Y?`true`:void 0,country:T||w,"locked-country":T||void 0,placeholder:re,required:F?``:void 0,disabled:E?``:void 0,readonly:D?``:void 0,loading:O?``:void 0,"hide-flag":B?void 0:``,"hide-dial":V?void 0:``,className:X||void 0,"external-error":``,...q}),/* @__PURE__ */ m(e,{error:Y,hint:R,errorId:Q,hintId:$})]})}export{y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../lib/useWuiText.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppAccordion.js";import r from"./AppButton.js";import i from"./AppCheckbox.js";import a from"./AppProgress.js";import o from"./assertValidValue.js";import s from"./warnUnknownProps.js";import{useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{QUEUE_BUNDLE_TEXT as d}from"@webority/ui-elements/text";var f=[`idle`,`busy`,`done`,`failed`];function p(p){let{marker:m,props:h}=t(`AppQueueBundle`,p),g=e(`queueBundle`,d),{title:_,reason:v,rows:y,onApprove:b,running:x,className:S=``,...C}=h;s(`AppQueueBundle`,C);for(let e of y)e.status!==void 0&&o(`AppQueueBundle`,`rows.status`,e.status,f);let[w,T]=c(()=>new Set(y.filter(e=>e.checked===!1).map(e=>e.key))),E={busy:g.statusBusyLabel,done:g.statusDoneLabel,failed:g.statusFailedLabel},D=e=>e.status??`idle`,O=e=>{let t=D(e);return t===`idle`||t===`failed`},k=x!==void 0,A=y.length>0&&y.every(e=>D(e)===`done`),j=y.some(e=>D(e)===`failed`),M=y.filter(e=>O(e)&&!w.has(e.key)).map(e=>e.key),N=k?`running`:A?`done`:j?`partly-failed`:`ready`,P=e=>{T(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},F=(j?g.approveMoreLabel:g.approveLabel).replace(`{count}`,()=>String(M.length));return/* @__PURE__ */ u(`section`,{className:`wui-queue-bundle${S?` ${S}`:``}`,"data-state":N,...m,...C,children:[/* @__PURE__ */ u(`div`,{className:`wui-queue-bundle-head`,children:[/* @__PURE__ */ l(`h3`,{className:`wui-queue-bundle-title`,children:_}),v?/* @__PURE__ */ l(`p`,{className:`wui-queue-bundle-reason`,children:v}):null]}),A?/* @__PURE__ */ l(`p`,{className:`wui-queue-bundle-done`,children:g.allApprovedLabel}):null,!A&&y.length>0?/* @__PURE__ */ l(n,{className:`wui-queue-bundle-list`,variant:`flat`,items:[{key:`rows`,title:g.checkListLabel,count:y.length,content:/* @__PURE__ */ l(`ul`,{className:`wui-queue-bundle-rows`,children:y.map(e=>{let t=D(e);return/* @__PURE__ */ u(`li`,{className:`wui-queue-bundle-row`,children:[O(e)?/* @__PURE__ */ l(i,{checked:!w.has(e.key),disabled:k,onChange:()=>P(e.key),label:/* @__PURE__ */ u(`span`,{className:`wui-queue-bundle-text`,children:[/* @__PURE__ */ l(`span`,{className:`wui-queue-bundle-primary`,children:e.primary}),e.secondary?/* @__PURE__ */ l(`span`,{className:`wui-queue-bundle-secondary`,children:e.secondary}):null]})}):/* @__PURE__ */ u(`span`,{className:`wui-queue-bundle-text`,children:[/* @__PURE__ */ l(`span`,{className:`wui-queue-bundle-primary`,children:e.primary}),e.secondary?/* @__PURE__ */ l(`span`,{className:`wui-queue-bundle-secondary`,children:e.secondary}):null]}),e.trailing?/* @__PURE__ */ l(`span`,{className:`wui-queue-bundle-trailing`,children:e.trailing}):null,t===`idle`?null:/* @__PURE__ */ l(`span`,{className:`wui-queue-bundle-status wui-queue-bundle-status-${t}`,children:E[t]})]},e.key)})})}]}):null,k?/* @__PURE__ */ l(a,{value:x.done,max:x.total,label:g.runningLabel.replace(`{done}`,()=>String(x.done)).replace(`{total}`,()=>String(x.total)),showLabel:!0}):null,A?null:/* @__PURE__ */ l(r,{tone:`primary`,loading:k,disabled:k||M.length===0,onClick:()=>b(M),children:F})]})}export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../lib/useWuiText.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppCopyButton.js";import r from"./assertValidValue.js";import i from"./renderIconProp.js";import a from"./warnUnknownProps.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{RESULT_BLOCK_TEXT as c}from"@webority/ui-elements/text";var l=[`danger`,`warning`,`info`,`secondary`],u={danger:`alert-circle`,warning:`alert-triangle`,info:`info`,secondary:void 0};function d(d){let{marker:f,props:p}=t(`AppResultBlock`,d),m=e(`resultBlock`,c),{tone:h=`danger`,icon:g,title:_,headingLevel:v=2,children:y,field:b,actions:x,reference:S,referenceLabel:C=m.referenceLabel,copyLabel:w=m.copyLabel,copiedLabel:T=m.copiedLabel,facts:E,className:D=``,...O}=p;a(`AppResultBlock`,O),r(`AppResultBlock`,`tone`,h,l),r(`AppResultBlock`,`headingLevel`,v,[1,2,3]);let k=v===1?`h1`:v===3?`h3`:`h2`,A=g??u[h],j=[`wui-result-block`,`wui-result-block-${h}`,D].filter(Boolean).join(` `);return/* @__PURE__ */ s(`div`,{className:j,...f,...O,children:[A?/* @__PURE__ */ o(`div`,{className:`wui-result-block-icon`,"aria-hidden":`true`,children:i(A,{size:20})}):null,/* @__PURE__ */ s(`div`,{className:`wui-result-block-body`,children:[/* @__PURE__ */ o(k,{className:`wui-result-block-title`,children:_}),y!=null&&/* @__PURE__ */ o(`div`,{className:`wui-result-block-sentence`,children:y}),E&&E.length>0&&/* @__PURE__ */ o(`dl`,{className:`wui-result-block-facts`,children:E.map(e=>/* @__PURE__ */ s(`div`,{className:`wui-result-block-fact`,children:[/* @__PURE__ */ o(`dt`,{children:e.label}),/* @__PURE__ */ o(`dd`,{children:e.value})]},e.key))}),b!=null&&/* @__PURE__ */ o(`div`,{className:`wui-result-block-field`,children:b}),x!=null&&/* @__PURE__ */ o(`div`,{className:`wui-result-block-actions`,children:x}),S!=null&&/* @__PURE__ */ s(`div`,{className:`wui-result-block-reference`,children:[/* @__PURE__ */ s(`span`,{className:`wui-result-block-reference-text`,children:[C,` `,/* @__PURE__ */ o(`code`,{className:`wui-result-block-code`,children:S})]}),/* @__PURE__ */ o(n,{text:S,label:w,copiedLabel:T,size:`sm`})]})]})]})}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../lib/useWuiText.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppButton.js";import r from"./
|
|
1
|
+
import e from"../lib/useWuiText.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppButton.js";import r from"./AppCopyButton.js";import i from"./AppResult.js";import a from"./assertValidValue.js";import ee from"./warnUnknownProps.js";import{formatDate as o}from"@webority/ui-elements/helpers";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{ROUTE_ERROR_TEXT as u,fillText as d}from"@webority/ui-elements/text";var f=[`error`,`stale-build`,`not-found`,`forbidden`,`signed-out`,`maintenance`,`offline`],te=()=>window.location.reload();function p(p){let{marker:m,props:h}=t(`AppRouteError`,p),g=e(`routeError`,u),{kind:_=`error`,homeHref:v=`/`,onRetry:y=te,brand:b,fullPage:x=!0,reference:S,expectedBack:C,requestAccessHref:w,homeLabel:T=g.homeLabel,reloadLabel:E=g.reloadLabel,retryLabel:D=g.retryLabel,staleTitle:O=g.staleTitle,staleText:k=g.staleText,notFoundTitle:A=g.notFoundTitle,notFoundText:j=g.notFoundText,errorTitle:M=g.errorTitle,errorText:N=g.errorText,forbiddenTitle:P=g.forbiddenTitle,forbiddenText:F=g.forbiddenText,signedOutTitle:ne=g.signedOutTitle,signedOutText:I=g.signedOutText,signInLabel:L=g.signInLabel,maintenanceTitle:R=g.maintenanceTitle,maintenanceText:z=g.maintenanceText,checkAgainLabel:B=g.checkAgainLabel,offlineTitle:V=g.offlineTitle,offlineText:H=g.offlineText,referenceLabel:U=g.referenceLabel,copyReferenceLabel:W=g.copyReferenceLabel,requestAccessLabel:G=g.requestAccessLabel,children:K,className:q=``,...J}=h;if(ee(`AppRouteError`,J),a(`AppRouteError`,`kind`,_,f),C!==void 0&&_!==`maintenance`)throw RangeError(`[@webority/ui-react] <AppRouteError> received expectedBack with kind="${_}". Pass it with kind="maintenance".`);if(w!==void 0&&_!==`forbidden`)throw RangeError(`[@webority/ui-react] <AppRouteError> received requestAccessHref with kind="${_}". Pass it with kind="forbidden".`);let Y=e=>/* @__PURE__ */ c(n,{variant:e,leftIcon:`home`,href:v,children:T}),X=C===void 0?z:`${z} ${d(g.maintenanceBackBy,{time:o(C,{pattern:`time`})})}`,Z=w===void 0?Y(`solid`):/* @__PURE__ */ l(s,{children:[Y(`solid`),/* @__PURE__ */ c(n,{variant:`outline`,href:w,children:G})]}),Q=S?/* @__PURE__ */ l(`p`,{className:`small text-body-secondary mb-0 mt-3`,children:[/* @__PURE__ */ l(`span`,{children:[U,`: `]}),/* @__PURE__ */ c(`code`,{className:`user-select-all`,children:S}),` `,/* @__PURE__ */ c(r,{text:S,label:W,size:`sm`,variant:`link`})]}):null,$;switch(_){case`stale-build`:$=/* @__PURE__ */ l(i,{status:`info`,icon:`refresh-cw`,title:O,subtitle:k,actions:/* @__PURE__ */ c(n,{leftIcon:`refresh-cw`,onClick:y,children:E}),children:[Q,K]});break;case`not-found`:$=/* @__PURE__ */ l(i,{status:`404`,title:A,subtitle:j,actions:Y(`solid`),children:[Q,K]});break;case`forbidden`:$=/* @__PURE__ */ l(i,{status:`403`,title:P,subtitle:F,actions:Z,children:[Q,K]});break;case`signed-out`:$=/* @__PURE__ */ l(i,{status:`info`,icon:`login`,title:ne,subtitle:I,actions:/* @__PURE__ */ c(n,{onClick:y,children:L}),children:[Q,K]});break;case`maintenance`:$=/* @__PURE__ */ l(i,{status:`warning`,icon:`settings`,title:R,subtitle:X,actions:/* @__PURE__ */ c(n,{leftIcon:`refresh-cw`,onClick:y,children:B}),children:[Q,K]});break;case`offline`:$=/* @__PURE__ */ l(i,{status:`warning`,icon:`cloud-cross`,title:V,subtitle:H,actions:/* @__PURE__ */ c(n,{leftIcon:`refresh-cw`,onClick:y,children:D}),children:[Q,K]});break;case`error`:$=/* @__PURE__ */ l(i,{status:`500`,title:M,subtitle:N,actions:/* @__PURE__ */ l(s,{children:[/* @__PURE__ */ c(n,{leftIcon:`refresh-cw`,onClick:y,children:D}),Y(`outline`)]}),children:[Q,K]});break;default:throw RangeError(`[@webority/ui-react] <AppRouteError> has no screen for kind="${String(_)}".`)}return/* @__PURE__ */ l(`div`,{className:[x?`d-flex flex-column align-items-center justify-content-center min-vh-100 px-3`:`d-flex flex-column align-items-center py-5 px-3`,q].filter(Boolean).join(` `),...m,...J,children:[b&&/* @__PURE__ */ c(`div`,{className:`mb-4`,children:b}),/* @__PURE__ */ c(`div`,{className:`col-12 col-md-8 col-lg-6`,children:$})]})}export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FIELD_SIZES as e}from"../lib/fieldState.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./assertValidValue.js";import a from"./warnUnknownProps.js";import{isTypingTarget as o}from"@webority/ui-elements/helpers";import{useCallback as s,useEffect as c,useRef as l,useState as u}from"react";import{flushSync as d}from"react-dom";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{SEARCH_TEXT as m}from"@webority/ui-elements/text";import{Form as h}from"react-bootstrap";function
|
|
1
|
+
import{FIELD_SIZES as e}from"../lib/fieldState.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./assertValidValue.js";import a from"./warnUnknownProps.js";import{isTypingTarget as o}from"@webority/ui-elements/helpers";import{useCallback as s,useEffect as c,useRef as l,useState as u}from"react";import{flushSync as d}from"react-dom";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{SEARCH_TEXT as m}from"@webority/ui-elements/text";import{Form as h}from"react-bootstrap";var g=[`underline`];function _(_){let{marker:v,props:y}=n(`AppSearch`,_),b=t(`search`,m),{value:x,defaultValue:S,onChange:C,placeholder:w=b.placeholder,ariaLabel:T,clearLabel:E=b.clearLabel,searchLabel:D=b.searchLabel,iconSize:O,size:k,loading:A=!1,collapsible:j=!1,disabled:M=!1,readOnly:N,className:P=``,form:F,onKeyDown:I,variant:L,...R}=y;a(`AppSearch`,R),i(`AppSearch`,`size`,k,e),i(`AppSearch`,`variant`,L,g);let z=O??18,[B,V]=u(S??``),H=x===void 0?B:x,[U,W]=u(!!H),G=l(null),K=l(null),q=!j||U||!!H,J=s(()=>{W(!0),requestAnimationFrame(()=>G.current?.focus())},[]),Y=()=>{V(``),d(()=>C?.(``)),G.current?.form?.requestSubmit()};c(()=>{if(!j)return;let e=e=>{e.key!==`/`||e.ctrlKey||e.altKey||e.metaKey||o(e.target instanceof Node?e.target:null)||[...document.querySelectorAll(`.search-wrap.wui-search-collapsible`)].find(e=>e.offsetParent!==null)===K.current&&(e.preventDefault(),J())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[j,J]);let X=[`search-wrap`,H?`has-value`:``,k===`sm`?`wui-search-sm`:k===`lg`?`wui-search-lg`:k===`xl`?`wui-search-xl`:``,A?`is-loading`:``,j?`wui-search-collapsible`:``,j&&!q?`is-collapsed`:``,P].filter(Boolean).join(` `),Z=O==null?void 0:{"--wui-search-icon-size":`${O}px`};return/* @__PURE__ */ p(`div`,{...v,className:X,style:Z,ref:K,onBlur:e=>{j&&!e.currentTarget.contains(e.relatedTarget)&&!H&&W(!1)},children:[j&&/* @__PURE__ */ f(`button`,{type:`button`,className:`wui-search-toggle`,"aria-label":T||w||D,"aria-expanded":q?`true`:`false`,onClick:J,children:/* @__PURE__ */ f(r,{name:`search`,size:z})}),A&&/* @__PURE__ */ f(`span`,{className:`search-spinner`,"aria-hidden":`true`}),/* @__PURE__ */ f(r,{name:`search`,size:z,className:`search-icon`}),/* @__PURE__ */ f(h.Control,{ref:G,type:`search`,className:L===`underline`?`input search-input wui-input-underline`:`input search-input`,placeholder:w,value:H,onChange:e=>{V(e.target.value),C?.(e.target.value)},onKeyDown:e=>{I?.(e),j&&e.key===`Escape`&&!H&&W(!1)},"aria-label":T,form:F,disabled:M,...N===void 0?null:{readOnly:N},...R}),!M&&!N&&/* @__PURE__ */ f(`button`,{type:`button`,className:`search-clear`,"aria-label":E,onClick:Y,hidden:!H,children:/* @__PURE__ */ f(r,{name:`x`,size:16})})]})}export{_ as default};
|