@webority/ui-react 0.122.0 → 0.125.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 +31039 -32190
- package/dist/canvas-kit/manifest.json +115 -2
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppAccordion.js +1 -1
- package/dist/components/AppActionIcon.js +1 -1
- package/dist/components/AppAlert.js +1 -1
- package/dist/components/AppAsyncBlock.js +1 -1
- package/dist/components/AppAutocomplete.js +1 -1
- package/dist/components/AppAvatar.js +1 -1
- package/dist/components/AppAvatarGroup.js +1 -1
- package/dist/components/AppBadge.js +1 -1
- package/dist/components/AppBanner.js +1 -1
- package/dist/components/AppBreadcrumbs.js +1 -1
- package/dist/components/AppButton.js +1 -1
- package/dist/components/AppButtonGroup.js +1 -1
- package/dist/components/AppCalendar.js +1 -1
- package/dist/components/AppCard.js +1 -1
- package/dist/components/AppCarousel.js +1 -1
- package/dist/components/AppChart.js +1 -1
- package/dist/components/AppChartCard.js +1 -1
- package/dist/components/AppCheckbox.js +1 -1
- package/dist/components/AppChip.js +1 -1
- package/dist/components/AppChipGroup.js +1 -1
- package/dist/components/AppChoiceCard.js +1 -1
- package/dist/components/AppChoiceChip.js +1 -1
- package/dist/components/AppCodeBlock.js +1 -1
- package/dist/components/AppColorField.js +1 -1
- package/dist/components/AppColumnMenu.js +1 -1
- package/dist/components/AppCommandPalette.js +1 -1
- package/dist/components/AppCommentThread.js +1 -1
- package/dist/components/AppCompareTable.js +1 -1
- package/dist/components/AppConfirmDialog.js +1 -1
- package/dist/components/AppConfirmProvider.js +1 -1
- package/dist/components/AppConsentBanner.js +1 -1
- package/dist/components/AppContextMenu.js +1 -1
- package/dist/components/AppCopyButton.js +1 -1
- package/dist/components/AppCountryFlag.js +1 -1
- package/dist/components/AppCountrySelect.js +1 -1
- package/dist/components/AppDashboardCell.js +1 -1
- package/dist/components/AppDashboardGrid.js +1 -1
- package/dist/components/AppDataTable.js +1 -1
- package/dist/components/AppDatePicker.js +1 -1
- package/dist/components/AppDateRangePicker.js +1 -1
- package/dist/components/AppDescriptions.js +1 -1
- package/dist/components/AppDetailPane.js +1 -1
- package/dist/components/AppDrawer.js +1 -1
- package/dist/components/AppDropZone.js +1 -1
- package/dist/components/AppDropdown.js +1 -1
- package/dist/components/AppDueDate.js +1 -1
- package/dist/components/AppEmptyState.js +1 -1
- package/dist/components/AppErrorSummary.js +1 -1
- package/dist/components/AppFileAttachment.js +1 -1
- package/dist/components/AppFilePicker.js +1 -1
- package/dist/components/AppFileTiles.js +1 -1
- package/dist/components/AppFileViewer.js +1 -1
- package/dist/components/AppFilterBar.js +1 -1
- package/dist/components/AppFloatingDock.js +1 -1
- package/dist/components/AppFormActions.js +1 -1
- package/dist/components/AppFormRow.js +1 -1
- package/dist/components/AppFormSection.js +1 -1
- package/dist/components/AppHoverCard.js +1 -1
- package/dist/components/AppIcon.js +1 -1
- package/dist/components/AppImagePicker.js +1 -1
- package/dist/components/AppInfoTip.js +1 -1
- package/dist/components/AppInlineEdit.js +1 -1
- package/dist/components/AppInput.js +1 -1
- package/dist/components/AppInputGroup.js +1 -1
- package/dist/components/AppKanban.js +1 -1
- package/dist/components/AppKbd.js +1 -1
- package/dist/components/AppKpiTile.js +1 -1
- package/dist/components/AppLightbox.js +1 -1
- package/dist/components/AppLink.js +1 -1
- package/dist/components/AppMarkdown.js +1 -1
- package/dist/components/AppMentionInput.js +1 -1
- package/dist/components/AppMeter.js +1 -1
- package/dist/components/AppMetricStrip.js +1 -1
- package/dist/components/AppModal.js +1 -1
- package/dist/components/AppMultiSelect.js +1 -1
- package/dist/components/AppNavList.js +1 -1
- package/dist/components/AppNavigationMenu.js +1 -1
- package/dist/components/AppNotificationCenter.js +1 -1
- package/dist/components/AppNumberInput.js +1 -1
- package/dist/components/AppOnboardingChecklist.js +1 -1
- package/dist/components/AppOtpInput.js +1 -1
- package/dist/components/AppPageHeader.js +1 -1
- package/dist/components/AppPhoneNumberInput.js +1 -1
- package/dist/components/AppPopover.js +1 -1
- package/dist/components/AppPricingCard.js +1 -1
- package/dist/components/AppProgress.js +1 -1
- package/dist/components/AppQrCode.js +1 -1
- package/dist/components/AppRadio.js +1 -1
- package/dist/components/AppRadioGroup.js +1 -1
- package/dist/components/AppRating.js +1 -1
- package/dist/components/AppRecordPager.js +1 -1
- package/dist/components/AppRelativeTime.js +1 -1
- package/dist/components/AppRepeater.js +1 -1
- package/dist/components/AppRequiredMark.js +1 -1
- package/dist/components/AppResizable.js +1 -1
- package/dist/components/AppResizableHandle.js +1 -1
- package/dist/components/AppResizablePanel.js +1 -1
- package/dist/components/AppResourceCard.js +1 -1
- package/dist/components/AppResult.js +1 -1
- package/dist/components/AppRichText.js +1 -1
- package/dist/components/AppRollingNumber.js +1 -1
- package/dist/components/AppRouteError.js +1 -1
- package/dist/components/AppRowSwitch.js +1 -0
- package/dist/components/AppScoreScale.js +1 -1
- package/dist/components/AppScrollbar.js +1 -1
- package/dist/components/AppSearch.js +1 -1
- package/dist/components/AppSectionCallToAction.js +1 -1
- package/dist/components/AppSectionFaq.js +1 -1
- package/dist/components/AppSectionFeatures.js +1 -1
- package/dist/components/AppSectionHero.js +1 -1
- package/dist/components/AppSectionLeadCapture.js +1 -1
- package/dist/components/AppSectionLogos.js +1 -1
- package/dist/components/AppSectionPricing.js +1 -1
- package/dist/components/AppSectionTestimonials.js +1 -1
- package/dist/components/AppSegmented.js +1 -1
- package/dist/components/AppSelect.js +1 -1
- package/dist/components/AppSeoHead.js +1 -1
- package/dist/components/AppShell.js +1 -1
- package/dist/components/AppShortcutLegend.js +1 -1
- package/dist/components/AppShowMore.js +1 -1
- package/dist/components/AppSkeleton.js +1 -1
- package/dist/components/AppSkeletonLines.js +1 -1
- package/dist/components/AppSlider.js +1 -1
- package/dist/components/AppSortableList.js +1 -1
- package/dist/components/AppSparkline.js +1 -1
- package/dist/components/AppSpinner.js +1 -1
- package/dist/components/AppSplash.js +1 -1
- package/dist/components/AppSplitButton.js +1 -1
- package/dist/components/AppSplitView.js +1 -1
- package/dist/components/AppStatusBadge.js +1 -1
- package/dist/components/AppStepper.js +1 -1
- package/dist/components/AppSwitch.js +1 -1
- package/dist/components/AppTablePagination.js +1 -1
- package/dist/components/AppTableToolbar.js +1 -1
- package/dist/components/AppTabs.js +1 -1
- package/dist/components/AppTagInput.js +1 -1
- package/dist/components/AppTextarea.js +1 -1
- package/dist/components/AppThemeToggle.js +1 -1
- package/dist/components/AppTimePicker.js +1 -1
- package/dist/components/AppTimeline.js +1 -1
- package/dist/components/AppToast.js +1 -1
- package/dist/components/AppToolbar.js +1 -1
- package/dist/components/AppTooltip.js +1 -1
- package/dist/components/AppTour.js +1 -1
- package/dist/components/AppTreeView.js +1 -1
- package/dist/components/AppTruncate.js +1 -1
- package/dist/components/AppUpdateBar.js +1 -1
- package/dist/components/AppWhatsNew.js +1 -1
- package/dist/components/AppWizard.js +1 -1
- package/dist/components/AppWorkspaceSwitcher.js +1 -1
- package/dist/components/ModalIcons.js +1 -1
- package/dist/components/iconCatalogNames.g.js +1 -1
- package/dist/components/iconGlyphs.g.js +1 -1
- package/dist/components/iconVariants.g.js +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toastStore.js +1 -1
- package/dist/components/useWuiControl.js +1 -1
- package/dist/components/warnInvalidValue.js +1 -1
- package/dist/components/warnUnknownProps.js +1 -1
- package/dist/components/withTooltip.js +1 -1
- package/dist/guidance.json +60 -1
- package/dist/lib/CheckField.js +1 -1
- package/dist/lib/DiscardPrompt.js +1 -1
- package/dist/lib/FieldMessage.js +1 -1
- package/dist/lib/FileItemRow.js +1 -1
- package/dist/lib/FocusPanel.js +1 -1
- package/dist/lib/emptyIllustration.js +1 -1
- package/dist/lib/fileItem.js +1 -1
- package/dist/lib/initials.js +1 -1
- package/dist/lib/pageScrollLock.js +1 -1
- package/dist/lib/qrCode.js +1 -1
- package/dist/lib/sectionShell.js +1 -1
- package/dist/lib/shellCookie.js +1 -1
- package/dist/lib/shortcutChip.js +1 -1
- package/dist/lib/useFileDrop.js +1 -1
- package/dist/lib/useFloatingStack.js +1 -1
- package/dist/lib/useListQuery.js +1 -1
- package/dist/lib/wuiMarker.js +1 -1
- package/dist/markdown-core/dist/citations.js +1 -0
- package/dist/markdown-core/dist/inline.js +1 -1
- package/dist/types/components/AppAutocomplete.d.ts +7 -1
- package/dist/types/components/AppMarkdown.d.ts +4 -0
- package/dist/types/components/AppRowSwitch.d.ts +23 -0
- package/dist/types/components/iconGlyphs.g.d.ts +8 -0
- package/dist/types/components/iconVariants.g.d.ts +40 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/ui-react.js +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{initialsOf as e}from"../lib/initials.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppAvatar.js";import r from"./AppBadge.js";import i from"./AppButton.js";import a from"./AppIcon.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{parseMentionValue as c}from"@webority/ui-elements/elements/mention-input";import{formatDate as l,formatFileSize as u,formatNumber as d,toInstant as f}from"@webority/ui-elements/helpers";import{Fragment as p,useEffect as m,useId as h,useRef as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{COMMENT_REACTIONS as y,COMMENT_TEXT as b}from"@webority/ui-elements/elements/comment-thread";var x=[`stacked`,`inline`],S=[`list`,`conversation`];function C(e){let{marker:r,props:a}=t(`AppCommentThread`,e),{comments:c=[],onPost:l,onReply:u,onEdit:d,onDelete:f,onReact:p,people:C,loadPeople:T,reactionChoices:E,allowReplies:D=!0,allowReactions:O=!0,composerPlaceholder:k,variant:A=`list`,composer:j=`stacked`,author:M,postLabel:N=b.post,composerRows:P,readOnly:F=!1,label:I=b.listName,id:L,className:R=``,...z}=a;s(`AppCommentThread`,z),o(`AppCommentThread`,`variant`,A,S),o(`AppCommentThread`,`composer`,j,x);let B=h(),V=L||`comment-thread-${B.replace(/[^a-zA-Z0-9_-]/g,``)}`,H=g(null),U=typeof T==`function`,W=E?.length?E:y,G=j===`inline`,K=P??(G?1:3),q=g(null);return q.current={onPost:l,onReply:u,onEdit:d,onDelete:f,onReact:p,loadPeople:T},m(()=>{let e=H.current;if(e)return e.submit=async({intent:e,commentId:t,parentId:n,body:r,emoji:i})=>{let a=q.current;e===`post`?await a.onPost?.(r):e===`reply`?await a.onReply?.(n,r):e===`edit`?await a.onEdit?.(t,r):e===`delete`?await a.onDelete?.(t):e===`react`&&await a.onReact?.(t,i)},()=>{e.submit=void 0}},[]),m(()=>{let e=H.current;e&&!U&&(e.people=C||[])},[C,U]),m(()=>{let e=H.current;if(!e||!U)return;let t=/* @__PURE__ */ new WeakMap,n=async e=>{let n=e.target,r=(t.get(n)??0)+1;t.set(n,r),n.loading=!0;try{let i=await q.current.loadPeople(e.detail.query);t.get(n)===r&&(n.people=i||[])}catch{t.get(n)===r&&(n.people=[])}finally{t.get(n)===r&&(n.loading=!1)}};return e.addEventListener(`search`,n),()=>e.removeEventListener(`search`,n)},[U]),/* @__PURE__ */ v(`wui-comment-thread`,{ref:H,id:V,class:[`wui-comment-thread`,A===`conversation`&&`wui-comment-thread--conversation`,R].filter(Boolean).join(` `),controlled:``,"read-only":F?``:void 0,remote:U?``:void 0,"reaction-choices":E?.length?E.join(` `):void 0,"no-replies":D?void 0:``,"no-reactions":O?void 0:``,"composer-placeholder":k,...r,...z,children:[/* @__PURE__ */ _(`div`,{className:`wui-comment-items`,"data-wui-items":``,children:c.length?/* @__PURE__ */ _(`ol`,{className:`wui-comment-list`,"aria-label":I,children:c.map(e=>/* @__PURE__ */ _(w,{comment:e,topLevel:!0,readOnly:F,allowReplies:D,allowReactions:O},e.id))}):/* @__PURE__ */ _(`p`,{className:`wui-comment-empty`,children:b.empty})}),!F&&O&&/* @__PURE__ */ _(`div`,{className:`wui-reaction-picker`,role:`group`,"aria-label":b.pickerName,"data-wui-picker":``,hidden:!0,children:W.map(e=>/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-reaction-choice`,"data-wui-emoji":e,children:e},e))}),!F&&/* @__PURE__ */ v(`div`,{className:G?`wui-comment-composer wui-comment-composer-inline`:`wui-comment-composer`,"data-wui-composer":``,children:[G&&M?/* @__PURE__ */ _(n,{name:M,size:`sm`,tone:`auto`,className:`wui-comment-composer-avatar`}):null,/* @__PURE__ */ _(`wui-mention-input`,{id:`${V}-new`,class:`wui-mention-input`,label:b.composerLabel,placeholder:k??b.composerPlaceholder,rows:String(K),remote:U?``:void 0}),/* @__PURE__ */ _(`div`,{className:`wui-comment-form-actions`,children:/* @__PURE__ */ _(i,{variant:G?`outline`:`primary`,size:`sm`,"data-wui-action":`post`,children:N})}),/* @__PURE__ */ _(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]}),/* @__PURE__ */ _(`span`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}function w({comment:t,topLevel:n=!1,readOnly:o,allowReplies:s,allowReactions:m}){let{id:h,author:g,at:y,value:x,edited:S,mine:C,internal:T,attachments:E=[],deleted:D,canEdit:O,canDelete:k,reactions:A=[],replies:j=[]}=t,M=g?.name||``,N=f(y),P=!o&&!D&&O,F=!o&&!D&&k,I=n&&s,L=[`wui-comment`,T&&`wui-comment--internal`,C&&`wui-comment--mine`].filter(Boolean).join(` `);return/* @__PURE__ */ v(`li`,{className:L,"data-wui-comment":h,"data-value":x??``,"data-wui-deleted":D?``:void 0,children:[/* @__PURE__ */ v(`div`,{className:`wui-comment-row`,children:[/* @__PURE__ */ v(`span`,{className:`avatar avatar-sm wui-comment-avatar`,"aria-hidden":`true`,children:[/* @__PURE__ */ _(`span`,{className:`avatar-face`,children:e(M)||`?`}),g?.src&&/* @__PURE__ */ _(`img`,{className:`avatar-img`,src:g.src,alt:``,onError:e=>{e.currentTarget.hidden=!0}})]}),/* @__PURE__ */ v(`div`,{className:`wui-comment-main`,children:[/* @__PURE__ */ v(`div`,{className:`wui-comment-head`,children:[/* @__PURE__ */ _(`span`,{className:`wui-comment-author`,children:M}),/* @__PURE__ */ _(`time`,{className:`wui-comment-time`,dateTime:Number.isFinite(N)?new Date(N).toISOString():void 0,children:l(y,{pattern:`datetime`})}),S&&!D&&/* @__PURE__ */ _(`span`,{className:`wui-comment-edited`,children:b.edited}),T&&/* @__PURE__ */ _(r,{className:`wui-comment-internal-badge`,children:`Internal note`})]}),D?/* @__PURE__ */ _(`div`,{className:`wui-comment-text wui-comment-text-deleted`,children:b.deleted}):/* @__PURE__ */ _(`div`,{className:`wui-comment-text`,"data-wui-text":``,children:c(x).map((e,t)=>`text`in e?/* @__PURE__ */ _(p,{children:e.text},t):/* @__PURE__ */ v(`span`,{className:`wui-mention`,"data-mention-id":e.id,children:[`@`,e.label]},t))}),!D&&E.length>0&&/* @__PURE__ */ _(`ul`,{className:`wui-comment-attachments`,"aria-label":`Attachments`,children:E.map(e=>/* @__PURE__ */ v(`li`,{children:[/* @__PURE__ */ v(`a`,{className:`wui-comment-attachment`,href:e.href,download:!0,children:[/* @__PURE__ */ _(a,{name:`paperclip`,size:14}),e.name]}),typeof e.sizeBytes==`number`&&/* @__PURE__ */ _(`span`,{className:`wui-comment-attachment-size`,children:u(e.sizeBytes)})]},e.href))}),P&&/* @__PURE__ */ _(`div`,{className:`wui-comment-editor`,"data-wui-editor":``,hidden:!0}),m&&!D&&(A.length>0||!o)&&/* @__PURE__ */ v(`div`,{className:`wui-comment-reactions`,role:`group`,"aria-label":b.reactions,children:[A.map(e=>o?/* @__PURE__ */ v(`span`,{className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,children:[/* @__PURE__ */ _(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),/* @__PURE__ */ _(`span`,{className:`wui-reaction-count`,children:d(e.count,{decimals:0})})]},e.emoji):/* @__PURE__ */ v(`button`,{type:`button`,className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,"data-wui-emoji":e.emoji,"aria-pressed":e.mine?`true`:`false`,children:[/* @__PURE__ */ _(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),/* @__PURE__ */ _(`span`,{className:`wui-reaction-count`,children:d(e.count,{decimals:0})})]},e.emoji)),!o&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-reaction-add`,"data-wui-action":`react-menu`,"aria-label":b.addReaction,"aria-haspopup":`true`,"aria-expanded":`false`,children:/* @__PURE__ */ _(a,{name:`emoji-smile`,size:16})})]}),!o&&!D&&(I||P||F)&&/* @__PURE__ */ v(`div`,{className:`wui-comment-actions`,"data-wui-actions":``,children:[I&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`reply`,children:b.reply}),P&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`edit`,children:b.edit}),F&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`delete`,children:b.delete})]}),F&&/* @__PURE__ */ v(`div`,{className:`wui-comment-confirm`,"data-wui-confirm":``,hidden:!0,children:[/* @__PURE__ */ _(`span`,{className:`wui-comment-confirm-text`,children:b.confirmDelete}),/* @__PURE__ */ _(i,{variant:`danger`,size:`sm`,"data-wui-action":`confirm-delete`,children:b.delete}),/* @__PURE__ */ _(i,{variant:`ghost`,size:`sm`,"data-wui-action":`cancel-delete`,children:b.cancel})]}),!o&&/* @__PURE__ */ _(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]})]}),n&&j.length>0&&/* @__PURE__ */ _(`ol`,{className:`wui-comment-list wui-comment-replies`,"aria-label":b.repliesName(M),children:j.map(e=>/* @__PURE__ */ _(w,{comment:e,readOnly:o,allowReactions:m},e.id))}),I&&!o&&!D&&/* @__PURE__ */ _(`div`,{className:`wui-comment-reply`,"data-wui-reply":``,hidden:!0})]})}export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{isValidElement as i,useEffect as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u=[`stack`,`scroll`],d=[`comfortable`,`relaxed`],f=[`start`,`center`],p={yes:{icon:`tick-circle`,label:`Yes`},no:{icon:`close-circle`,label:`No`},warn:{icon:`danger`,label:`Warning`},partial:{icon:`minus-circle`,label:`Partial`}};function m(e){return typeof e==`object`&&!!e&&!i(e)}function h(e){return e.scrollLeft+e.clientWidth<e.scrollWidth-1}function g(...e){return e.filter(Boolean).join(` `)||void 0}function _(e){return g(e.highlight&&`is-highlight`,e.align===`center`&&`wui-compare-center`,e.nowrap&&`wui-compare-nowrap`)}function v(e){if(e===!0)return/* @__PURE__ */ l(`span`,{className:`compare-yes`,children:[/* @__PURE__ */ c(t,{name:`check`,size:16}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:`Yes`})]});if(e===!1)return/* @__PURE__ */ l(`span`,{className:`compare-no`,children:[/* @__PURE__ */ c(`span`,{"aria-hidden":`true`,children:`-`}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:`No`})]});if(m(e)&&`state`in e){let r=p[e.state];return n(`AppCompareTable`,`state`,e.state,Object.keys(p)),/* @__PURE__ */ l(`span`,{className:`wui-compare-state wui-compare-state-${e.state}`,children:[r&&/* @__PURE__ */ c(t,{name:r.icon,size:16,variant:`bulk`}),r&&/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:`${r.label}: `}),e.text]})}return m(e)&&`code`in e?/* @__PURE__ */ c(`span`,{className:`wui-compare-code`,children:e.code}):e}function y(e,t){let n=[],r=null;return t.forEach((t,i)=>{t.group!=null&&t.group!==r&&n.push(/* @__PURE__ */ c(`tr`,{className:`wui-compare-group-row`,children:/* @__PURE__ */ c(`th`,{colSpan:e.length,scope:`rowgroup`,className:`wui-compare-group`,children:t.group})},`group:${t.group}:${t.key??t.label}`)),r=t.group??null,n.push(/* @__PURE__ */ l(`tr`,{children:[/* @__PURE__ */ c(`th`,{scope:`row`,children:t.label}),t.values.map((t,n)=>{let r=e[n+1];return/* @__PURE__ */ c(`td`,{className:_(r??{}),"data-label":r?.label,children:v(t)},r?.label??n)})]},t.key??`${t.label}-${i}`))}),n}function b(t){let{marker:i,props:p}=e(`AppCompareTable`,t),{columns:m,rows:v,caption:b,mobile:x=`stack`,stickyFirstColumn:S=!1,stickyHeader:C=!1,density:w=`comfortable`,className:T=``,...E}=p,D=o(null),[O,k]=s(!1);if(a(()=>{let e=()=>{let e=D.current;e&&k(h(e))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),!Array.isArray(m))throw Error(`<AppCompareTable> columns is required: pass the feature-name column, then one per option.`);if(!Array.isArray(v))throw Error(`<AppCompareTable> rows is required: pass one row per capability.`);r(`AppCompareTable`,E),n(`AppCompareTable`,`mobile`,x,u),n(`AppCompareTable`,`density`,w,d);for(let e of m)n(`AppCompareTable`,`align`,e.align,f);let A=x===`scroll`,j=/* @__PURE__ */ l(`table`,{className:g(A&&`wui-compare-scroll-table`,A&&S&&`wui-compare-sticky-first`),children:[b&&/* @__PURE__ */ c(`caption`,{className:`visually-hidden`,children:b}),/* @__PURE__ */ c(`thead`,{children:/* @__PURE__ */ c(`tr`,{children:m.map((e,t)=>/* @__PURE__ */ c(`th`,{scope:`col`,className:_(e),children:e.label},e.label?`col-${t}-${e.label}`:`col-${t}`))})}),/* @__PURE__ */ c(`tbody`,{children:y(m,v)})]});return/* @__PURE__ */ c(`div`,{className:g(`compare-table`,w===`relaxed`&&`wui-compare-relaxed`,C&&`wui-compare-sticky-head`,T),"data-mobile":x,...i,...E,children:A?/* @__PURE__ */ c(`div`,{className:`wui-compare-scroll`,ref:D,tabIndex:0,role:b?`region`:void 0,"aria-label":b||void 0,"data-more":O?`end`:void 0,onScroll:e=>k(h(e.currentTarget)),children:j}):j})}export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppButton.js";import n from"./AppIcon.js";import r from"./AppInput.js";import i from"./AppModal.js";import{MODAL_ICONS as a}from"./ModalIcons.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{useEffect as c,useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";var p=[`sm`,`md`,`lg`,`xl`],m=[`default`,`plain`];function h(h){let{marker:g,props:_}=e(`AppConfirmDialog`,h),{open:v,title:y,variant:b=`default`,message:x,confirmLabel:S=`Confirm`,cancelLabel:C=`Cancel`,danger:w=!1,tone:T,image:E,icon:D,iconSize:O,confirmPhrase:k,onConfirm:A,onClose:j,loading:M=!1,staticBackdrop:N=!1,placement:P=`center`,size:F=`md`,className:I=``,children:L,...R}=_;s(`AppConfirmDialog`,R),o(`AppConfirmDialog`,`tone`,T,Object.keys(a)),o(`AppConfirmDialog`,`size`,typeof F==`string`?F:null,p),o(`AppConfirmDialog`,`variant`,b,m);let[z,B]=l(``);if(c(()=>{v||B(``)},[v]),!v)return null;let V=!!k&&z.trim()!==k,H=b===`plain`,U=H?`sm`:`md`,W=H||E||D?null:a[T||(w?`delete`:`info`)],G=O>0?{"--wui-confirm-icon-size":`${O}px`}:void 0,K=()=>{M||j?.()};return/* @__PURE__ */ d(i,{...g,...R,open:v,hideHeader:!0,title:y,onClose:K,staticBackdrop:N,placement:P,size:F,className:[`wui-confirm`,H&&`wui-confirm-plain`,I].filter(Boolean).join(` `),footer:/* @__PURE__ */ f(`div`,{className:`wui-confirm-actions`,children:[/* @__PURE__ */ d(t,{variant:H?`light`:`secondary`,size:U,disabled:M,onClick:K,children:C}),/* @__PURE__ */ d(t,{variant:w?`danger`:`primary`,size:U,disabled:V,loading:M,onClick:A,children:S})]}),children:/* @__PURE__ */ f(`div`,{className:`wui-confirm-content`,children:[!H&&E?/* @__PURE__ */ d(`span`,{className:`wui-confirm-icon`,style:G,children:/* @__PURE__ */ d(`img`,{src:E,alt:``,"aria-hidden":`true`})}):!H&&D?/* @__PURE__ */ d(`span`,{className:`wui-confirm-icon`,style:G,children:typeof D==`string`?/* @__PURE__ */ d(n,{name:D,size:80}):D}):W&&/* @__PURE__ */ d(`span`,{className:`wui-confirm-icon`,style:G,children:/* @__PURE__ */ d(W,{size:120})}),/* @__PURE__ */ d(`h3`,{className:`wui-confirm-title`,tabIndex:-1,"data-autofocus":``,children:y}),x&&/* @__PURE__ */ d(`p`,{className:`wui-confirm-msg`,children:x}),L!=null&&L!==!1&&/* @__PURE__ */ d(`div`,{className:`wui-confirm-body`,children:L}),k&&/* @__PURE__ */ d(r,{fieldClassName:`mt-3 mb-0 w-100 text-start`,label:/* @__PURE__ */ f(u,{children:[`Type `,/* @__PURE__ */ d(`strong`,{children:k}),` to confirm`]}),value:z,onChange:e=>B(e.target.value),"aria-label":`Type ${k} to confirm`,disabled:M})]})})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./AppConfirmDialog.js";import{createContext as t,useCallback as n,useContext as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=t(null);function u(t){let{children:r}=t,[u,d]=o(null),[f,p]=o(!1),m=a(null),h=n((e={})=>new Promise(t=>{m.current?.(!1),m.current=t,d({...e,title:e.title||`Are you sure?`})}),[]),g=e=>{m.current?.(e),m.current=null,p(!1),d(null)};return i(()=>()=>m.current?.(!1),[])
|
|
1
|
+
import e from"./AppConfirmDialog.js";import{createContext as t,useCallback as n,useContext as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=t(null);function u(t){let{children:r}=t,[u,d]=o(null),[f,p]=o(!1),m=a(null),h=n((e={})=>new Promise(t=>{m.current?.(!1),m.current=t,d({...e,title:e.title||`Are you sure?`})}),[]),g=e=>{m.current?.(e),m.current=null,p(!1),d(null)};return i(()=>()=>m.current?.(!1),[]),/* @__PURE__ */ c(l.Provider,{value:h,children:[r,/* @__PURE__ */ s(e,{open:!!u,title:u?.title,message:u?.message,confirmLabel:u?.confirmLabel,cancelLabel:u?.cancelLabel,danger:u?.danger,tone:u?.tone,icon:u?.icon,confirmPhrase:u?.confirmPhrase,loading:f,onConfirm:async()=>{let e=u?.onRun;if(typeof e!=`function`)g(!0);else{p(!0);try{await e(),g(!0)}catch{p(!1)}}},onClose:()=>g(!1)})]})}function d(){let e=r(l);if(!e)throw Error(`useConfirm needs an <AppConfirmProvider> above it.`);return e}export{u as default,d as useConfirm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./useWuiControl.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{useEffect as i}from"react";import{jsx as a}from"react/jsx-runtime";import"@webority/ui-elements/elements/consent-banner";import{getConsent as o,saveConsent as s}from"@webority/analytics/site";var c=[`bottom-left`,`bottom-right`,`bar`],l=[`analytics`,`functional`,`marketing`];function u(u){let{marker:d,props:f}=e(`AppConsentBanner`,u),{heading:p,description:m,policyHref:h,policyLabel:g,analyticsDescription:_,functionalDescription:v,marketingDescription:y,categories:b,position:x=`bottom-left`,standalone:S=!1,preview:C=!1,className:w=``,style:T,...E}=f;r(`AppConsentBanner`,E),n(`AppConsentBanner`,`position`,x,c);for(let e of b??[])n(`AppConsentBanner`,`categories`,e,l);let{setRef:D,innerRef:O}=t({on:{"wui-consent-save":e=>{C||(s(e.detail),O.current&&(O.current.preferences=o()))}}});return i(()=>{let e=O.current;if(!e)return;if(C){e.open();return}let t=o();e.preferences=t,t.decided||e.open()},[O,C]),/* @__PURE__ */ a(`wui-consent-banner`,{ref:D,position:x,heading:p||void 0,description:m||void 0,"policy-href":h||void 0,"policy-label":g||void 0,"analytics-description":_||void 0,"functional-description":v||void 0,"marketing-description":y||void 0,categories:b?.length?b.join(` `):void 0,standalone:S||void 0,preview:C||void 0,class:w||void 0,style:T,...d,...E})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{shortcutAria as e,shortcutChip as t}from"../lib/shortcutChip.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./renderIconProp.js";import i from"./warnUnknownProps.js";import{useEffect as a,useLayoutEffect as o,useRef as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import"@webority/ui-elements/elements/context-menu";function u(e){let{marker:t,props:r}=n(`AppContextMenu`,e),{items:u=[],target:d,trigger:p,children:m,ariaLabel:h=`Context menu`,disabled:g=!1,open:_,onOpen:v,onBeforeOpen:y,menuClassName:b=``,linkComponent:x,...S}=r;i(`AppContextMenu`,S);let C=s(null);return a(()=>{let e=C.current;if(!v)return;let t=e=>v(e.detail);return e.addEventListener(`wui-context-menu:open`,t),()=>e.removeEventListener(`wui-context-menu:open`,t)},[v]),a(()=>{let e=C.current;if(y)return e.addEventListener(`wui-context-menu:beforeopen`,y),()=>e.removeEventListener(`wui-context-menu:beforeopen`,y)},[y]),o(()=>{C.current.toggleAttribute(`open`,!!_)},[_]),/* @__PURE__ */ l(`wui-context-menu`,{ref:C,target:d,trigger:p,disabled:g,...t,...S,children:[m,/* @__PURE__ */ c(`div`,{className:`dropdown-menu wui-context-menu-panel${b?` ${b}`:``}`,role:`menu`,"aria-label":h,tabIndex:-1,children:f(u,x)})]})}var d=e=>`dropdown-item${e.danger?` danger`:``}${e.disabled?` disabled`:``}`;function f(n,i){return n.map(n=>{if(n.divider)return/* @__PURE__ */ c(`hr`,{className:`dropdown-divider`},n.key);if(n.items!=null){let e=n.searchPlaceholder||`Search`;return/* @__PURE__ */ l(`div`,{className:`wui-context-menu-sub`,role:`none`,"data-searchable":n.searchable?``:void 0,children:[/* @__PURE__ */ l(`button`,{type:`button`,className:d(n),role:`menuitem`,"aria-haspopup":`menu`,"aria-expanded":`false`,tabIndex:-1,"data-key":n.key,"aria-disabled":n.disabled?`true`:void 0,children:[r(n.icon,{size:16}),n.label,r(`chevron-right`,{size:14,className:`wui-context-menu-chevron`})]}),/* @__PURE__ */ l(`div`,{className:`dropdown-menu wui-context-menu-subpanel`,role:`menu`,"aria-label":n.label,tabIndex:-1,children:[n.searchable?/* @__PURE__ */ c(`input`,{type:`search`,className:`wui-context-menu-search`,autoComplete:`off`,placeholder:e,"aria-label":e}):null,f(n.items,i)]})]},n.key)}let a=!!n.to&&!n.disabled,o=a?i??`a`:`button`,s=a?i?{to:n.to}:{href:n.to}:{type:`button`};return/* @__PURE__ */ l(o,{...s,className:d(n),role:`menuitem`,tabIndex:-1,"data-key":n.key,"aria-checked":n.checked?`true`:void 0,"data-hint":n.hint||void 0,"aria-keyshortcuts":e(n.shortcut),"aria-disabled":n.disabled?`true`:void 0,onClick:n.disabled?void 0:n.onClick,children:[n.image?/* @__PURE__ */ c(`img`,{src:n.image,alt:``}):r(n.icon,{size:16}),n.label,t(n.shortcut)]},n.key)})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppActionIcon.js";import n from"./AppButton.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import a from"./withTooltip.js";import{COPY_FEEDBACK_MS as o,copyTextToClipboard as s}from"@webority/ui-elements/helpers";import{useCallback as c,useEffect as l,useRef as u,useState as d}from"react";import{jsx as f}from"react/jsx-runtime";var p={sm:14,md:16,lg:20};function m(m){let{marker:h,props:g}=e(`AppCopyButton`,m),{text:_,label:v=`Copy`,copiedLabel:y=`Copied`,iconOnly:b=!1,size:x=`md`,variant:S=`ghost`,onCopied:C,className:w=``,tooltip:T,tooltipPlacement:E,...D}=g;i(`AppCopyButton`,D),r(`AppCopyButton`,`size`,x,Object.keys(p));let[O,k]=d(!1),A=u(null);l(()=>()=>clearTimeout(A.current),[]);let j=c(async()=>{await s(_)&&(k(!0),clearTimeout(A.current),A.current=setTimeout(()=>k(!1),o),C?.())},[_,C]),M=O?y:v,N=O?`check`:`files`;return a(b?/* @__PURE__ */ f(t,{icon:N,label:M,size:p[x]??p.md,onClick:j,className:w,...D,...h}):/* @__PURE__ */ f(n,{leftIcon:N,variant:S,size:x,onClick:j,className:w,"aria-live":`polite`,...D,...h,children:M}),T,E)}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import{loadFlagStyles as t}from"../lib/flagStyles.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./warnUnknownProps.js";import{useEffect as i}from"react";import{jsx as a}from"react/jsx-runtime";function o(o){let{marker:s,props:c}=n(`AppCountryFlag`,o),{country:l,label:u,className:d=``,...f}=c;r(`AppCountryFlag`,f),i(()=>{t()},[]);let p=String(l??``).trim().toLowerCase();if(!/^[a-z]{2}$/.test(p))return e(`[@webority/ui-react] AppCountryFlag: country must be a two-letter ISO 3166-1 code, got`,l),null;let m=typeof u==`string`&&u.trim().length>0;return/* @__PURE__ */ a(`span`,{className:[`wui-flag`,`wui-flag-${p}`,d].filter(Boolean).join(` `),...m?{role:`img`,"aria-label":u}:{"aria-hidden":`true`},...s,...f})}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../lib/FieldMessage.js";import{loadFlagStyles as t}from"../lib/flagStyles.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import a from"./useWuiControl.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{cloneElement as c,forwardRef as l,useEffect as u,useId as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import"@webority/ui-elements/elements/country-select";var m=[`sm`,`md`,`lg`],h=[`off`,`border`],g=l(function(l,g){let{marker:_,props:v}=n(`AppCountrySelect`,l),{value:y,onChange:b,countries:x,placeholder:S=`Select country`,searchPlaceholder:C=`Search countries...`,searchable:w=!0,clearable:T=!1,size:E=`md`,floatingLabel:D=`off`,disabled:O,open:k,label:A,required:j=!1,optional:M=!1,error:N,hint:P,help:F,helpLabel:I=`More information`,id:L,name:R,className:z=``,fieldClassName:B=``,"aria-label":V,"aria-labelledby":H,"aria-describedby":U,...W}=v;s(`AppCountrySelect`,W),o(`AppCountrySelect`,`size`,E,m),o(`AppCountrySelect`,`floatingLabel`,D,h),u(()=>{t()},[]);let G=d(),{setRef:K}=a({ref:g,value:y??``,onChange:b}),q=L||G,J=D!==`off`&&A,Y=N&&q?`${q}-error`:void 0,X=P&&q?`${q}-hint`:void 0,Z=/* @__PURE__ */ f(`wui-country-select`,{"aria-label":V||(typeof A==`string`?A:void 0),"aria-labelledby":H||void 0,"aria-describedby":Y||X||U||void 0,"aria-invalid":N?`true`:void 0,ref:K,id:q,name:R,countries:Array.isArray(x)?x.join(`,`):void 0,placeholder:J?` `:S,"search-placeholder":C,searchable:w?``:void 0,clearable:T?``:void 0,size:E===`sm`||E===`lg`?E:void 0,disabled:O?``:void 0,open:k?``:void 0,required:j?``:void 0,className:z||void 0,...W});if(!A&&!N&&!P)return c(Z,_);let Q=[`field`,B].filter(Boolean).join(` `);return/* @__PURE__ */ p(`div`,{..._,className:Q,children:[A&&!J&&/* @__PURE__ */ p(`label`,{className:`label`,htmlFor:q,children:[A,M&&!j&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` (optional)`}),j&&/* @__PURE__ */ f(i,{}),F&&/* @__PURE__ */ f(r,{label:I,children:F})]}),J?/* @__PURE__ */ p(`div`,{className:`field-float`,children:[Z,/* @__PURE__ */ p(`label`,{className:`float-label`,htmlFor:q,children:[A,M&&!j&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` (optional)`}),j&&/* @__PURE__ */ f(i,{})]})]}):Z,/* @__PURE__ */ f(e,{error:N,hint:P,errorId:Y,hintId:X})]})});export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i=[3,4,6,12];function a(a){let{marker:o,props:s}=e(`AppDashboardCell`,a),{span:c=12,children:l,className:u=``,...d}=s;
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i=[3,4,6,12];function a(a){let{marker:o,props:s}=e(`AppDashboardCell`,a),{span:c=12,children:l,className:u=``,...d}=s;n(`AppDashboardCell`,d),t(`AppDashboardCell`,`span`,c,i);let f=c===12||!i.includes(c)?``:` wui-dashboard-cell-${c}`;return/* @__PURE__ */ r(`div`,{className:`wui-dashboard-cell${f}${u?` ${u}`:``}`,...o,...d,children:l})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{jsx as n}from"react/jsx-runtime";function r(r){let{marker:i,props:a}=e(`AppDashboardGrid`,r),{children:o,className:s=``,...c}=a;return t(`AppDashboardGrid`,c)
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{jsx as n}from"react/jsx-runtime";function r(r){let{marker:i,props:a}=e(`AppDashboardGrid`,r),{children:o,className:s=``,...c}=a;return t(`AppDashboardGrid`,c),/* @__PURE__ */ n(`div`,{className:`wui-dashboard-grid${s?` ${s}`:``}`,...i,...c,children:o})}export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import i from"./AppIcon.js";import a from"./AppSkeleton.js";import o from"./AppTablePagination.js";import{attachRowDrag as s,attachScrollEdges as c,syncTargets as ee}from"@webority/ui-elements/helpers";import{Children as l,Fragment as te,useEffect as u,useLayoutEffect as d,useMemo as ne,useRef as f,useState as p}from"react";import{Fragment as re,jsx as m,jsxs as h}from"react/jsx-runtime";import{FORCED_STATE_CLASSES as ie}from"@webority/theme/runtime";import{COLUMN_MAX_WIDTH as ae,COLUMN_MIN_WIDTH as oe,DATA_TABLE_TEXT as se,PIN_AT_VAR as ce,PIN_SIDES as le,ROW_HEIGHTS as ue,ROW_MOVE_LIMIT as de,ROW_SAVE_ERROR_CLASS as fe,groupCount as pe,groupItems as me,measureRows as he,pinAtValue as ge,pinClasses as _e,planPins as ve,playRowMoves as ye,rowOrderChanged as be,saveOutcomeText as xe,settledRows as Se,virtualRange as Ce}from"@webority/ui-elements/elements/data-table";var we=[`comfortable`,`cozy`,`compact`],Te=[`auto`,`fixed`],Ee=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},g=new Set;function _(e,n){g.has(e)||!Ee()||(g.add(e),t(`[@webority/ui-react] <AppDataTable> ${n}`))}var De=100,Oe=e=>e.id,ke=()=>{},Ae=(e,t,n)=>{let r=!!t?.(e),i=r?``:n?.(e)||``;return{state:r?`saving`:i?`error`:null,message:i}};function v(e){return e===`end`?`wui-cell-end`:e===`num`?`num`:e===`center`?`text-center`:``}function je(e){return e===`center`?`44%`:e===`end`||e===`num`?`56%`:`60%`}function Me(e){return e==null||e===``?`-`:Array.isArray(e)?l.toArray(e):typeof e==`boolean`?String(e):e}function Ne(e){if(!e||!(e.total>0))return!1;let t=e.pageSizes?.length?e.pageSizes:[e.pageSize];return e.total>Math.min(...t)}function y(t){let{marker:l,props:Ee}=e(`AppDataTable`,t),{columns:g,rows:y,rowKey:b=Oe,sort:x,onSort:S,loading:C=!1,skeletonRows:Pe=5,empty:Fe=`No records found.`,emptyFiltered:Ie,sourceCount:Le,rowActions:w,rowActionsLabel:Re,pagination:T,ariaLabel:ze,className:Be=``,wrapperClassName:Ve=``,selectable:E=!1,selectedIds:D,isRowSelectable:He,onToggleRow:Ue,onToggleAll:We,onSelectRange:Ge,renderExpanded:Ke,density:O=`comfortable`,tableLayout:qe=`auto`,striped:Je=!1,flush:Ye=!1,pad:Xe,headerTone:Ze,rowDrag:k=!1,maxHeight:Qe,stickyFirstColumn:$e=!1,stickyActions:et=!1,stackOnMobile:A=!1,hiddenColumns:tt,rowStatus:nt,rowHref:j,onRowClick:rt,activeRowKey:it,hoverRowKey:at,resizableColumns:M=!1,viewKey:ot,groupBy:N,groupLabel:st,virtual:P=!1,rowSaving:F,rowSaveError:I,...ct}=Ee;r(`AppDataTable`,ct);let{style:lt,...ut}=ct,dt=tt?.length?new Set(tt):null;g=dt?g.filter(e=>!(e.hideable&&dt.has(e.key))):g,n(`AppDataTable`,`density`,O,we),n(`AppDataTable`,`tableLayout`,qe,Te);for(let e of g)n(`AppDataTable`,`column.pin`,e.pin,le);let ft=[`table table-ledger`,O===`cozy`||O===`compact`?`wui-table-${O}`:``,Je?`wui-table-striped`:``,$e?`wui-table-sticky-first`:``,et?`wui-table-sticky-actions`:``,A?`wui-table-stack`:``,Be].filter(Boolean).join(` `),L=typeof Ke==`function`,[pt,mt]=p(()=>new Set),ht=e=>mt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),gt=g.some(e=>typeof e.footer==`function`),R=typeof j==`function`||typeof rt==`function`,_t=e=>!!e.target.closest(`a, button, input, select, textarea, label, [role='menu'], [role='menuitem'], .dropdown`),vt=(e,t)=>{if(_t(t)||(rt&&rt(e),!j))return;let n=j(e);n&&(t.ctrlKey||t.metaKey||t.button===1?window.open(n,`_blank`,`noopener`):window.location.assign(n))},z=Qe!==void 0,yt=[`table-wrap`,z?`wui-table-scroll`:``,Ye?`wui-table-flush`:``,Ve].filter(Boolean).join(` `),bt={maxHeight:z?Qe:void 0,"--wui-table-pad":Xe!=null&&!Ye?`${Xe}px`:void 0,"--wui-table-header-bg":Ze??void 0},xt=Object.values(bt).some(e=>e!==void 0)||lt!==void 0?{...bt,...lt}:void 0,St=Math.max(1,g.length+ +!!w+ +!!E+ +!!L),Ct=g.some(e=>e.pin===`start`||e.pin===`end`),B=Ct||M||!!N||P,V=+!!L+ +!!E,wt=Ct?ve([...L?[`lead`]:[],...E?[`lead`]:[],...g.map(e=>e.pin===`start`||e.pin===`end`?e.pin:null),...w?[null]:[]]):[],H=(e,t=``)=>{let n=wt[e];return n?{className:`${t.trim()} ${_e(n)}`.trim(),style:{[ce]:ge(n.side,n.ordinal)}}:{className:t,style:void 0}},U=(e,t)=>wt[e]?{...t,...H(e).style}:t,Tt=g.length-1+ +!!w;ot&&!M&&_(`view-key`,"`viewKey` remembers resized widths: add `resizableColumns`."),P&&!z&&_(`virtual-height`,"`virtual` needs `maxHeight`: without a scroll box every row renders."),P&&(L||A)&&_(`virtual-shape`,"`virtual` takes rows of one height, so it is off with `renderExpanded` or `stackOnMobile`."),!P&&y?.length>500&&_(`rows-without-virtual`,`renders more than 500 rows without virtual: add virtual with maxHeight, or page the data.`);let W=P&&z&&!L&&!A&&!C&&y?.length>0,G=(e,t)=>!He||!!He(e,t),Et=E&&y?y.reduce((e,t,n)=>e+ +!!G(t,n),0):0,K=E&&y?y.reduce((e,t,n)=>e+(G(t,n)&&D?.has(b(t,n))?1:0),0):0,Dt=Et>0&&K===Et,Ot=K>0&&!Dt,kt=e=>{e&&(e.indeterminate=Ot)},At=f(null),jt=(e,t)=>{let n=At.current;At.current=e;let r=t&&n!==null?y.findIndex((e,t)=>b(e,t)===n):-1,i=y.findIndex((t,n)=>b(t,n)===e);if(r<0||i<0||r===i){Ue?.(e);return}let a=!D?.has(e),o=Math.min(r,i),s=y.slice(o,Math.max(r,i)+1).map((e,t)=>[e,o+t]).filter(([e,t])=>G(e,t)).map(([e,t])=>b(e,t)).filter(e=>(D?.has(e)||!1)!==a);if(Ge)Ge(s,a);else for(let e of s)Ue?.(e)},Mt=e=>{if(!He){We?.(e);return}(y||[]).forEach((t,n)=>{let r=b(t,n);G(t,n)&&(D?.has(r)||!1)!==e&&Ue?.(r)})},[Nt,Pt]=p(()=>new Set),Ft=e=>Pt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),q=ne(()=>{let e=(y||[]).map((e,t)=>({row:e,i:t}));return N?me(e,({row:e})=>String(e[N]??``)).flatMap(e=>[{group:e,open:!Nt.has(e.key)},...Nt.has(e.key)?[]:e.items]):e},[y,N,Nt]),J=f(null),It=f(null);u(()=>{let e=J.current;if(!e)return;let t=e=>{let t=e.target.closest?.(`.u-name`);t&&!t.title&&(t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight)&&(t.title=t.textContent.trim())},n=e=>{let t=e.target.closest?.(`tbody > tr[aria-rowindex]`)?.getAttribute(`aria-rowindex`);It.current=t?Number(t)-2:null},r=t=>{e.contains(t.relatedTarget)||(It.current=null)};e.addEventListener(`mouseover`,t),e.addEventListener(`focusin`,t),e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,r);let i=c(e);return()=>{e.removeEventListener(`mouseover`,t),e.removeEventListener(`focusin`,t),e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,r),i()}},[B]),u(()=>{if(!k||!J.current)return;let e=s(J.current);return ee(document),e},[k,B]);let Lt=f(!1);u(()=>{!Lt.current&&(Lt.current=!0,K===0)||J.current?.querySelector(`table`)?.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:{selected:K,total:y?.length??0,keys:y?y.flatMap((e,t)=>{let n=b(e,t);return G(e,t)&&D?.has(n)?[String(n)]:[]}):[]}}))},[E,K]);let[Rt,zt]=p({top:0,height:0}),[Y,Bt]=p(ue[O]??ue.comfortable);u(()=>{let e=J.current;if(!W||!e)return;let t=0,n=()=>{t=0;let n=e.querySelector(`:scope > table > thead`)?.getBoundingClientRect().height||0,r={top:Math.max(0,e.scrollTop-n),height:e.clientHeight};zt(e=>e.top===r.top&&e.height===r.height?e:r)},r=()=>{t||=requestAnimationFrame(n)};e.addEventListener(`scroll`,r,{passive:!0});let i=typeof ResizeObserver<`u`?new ResizeObserver(r):null;return i?.observe(e),n(),()=>{e.removeEventListener(`scroll`,r),i?.disconnect(),t&&cancelAnimationFrame(t)}},[W,B]),d(()=>{if(!W)return;let e=(J.current?.querySelector(`:scope > table > tbody > tr:not(.wui-virtual-spacer, .wui-group-row)`))?.getBoundingClientRect().height;e>0&&Math.abs(e-Y)>.5&&Bt(e)},[O,y?.length,P,W]);let X={start:0,end:q.length,before:0,after:0};if(W){X=Ce({scrollTop:Rt.top,viewport:Rt.height||Number.parseFloat(Qe)||0,rowHeight:Y,count:q.length});let e=It.current;e!==null&&e>=0&&e<q.length&&(e<X.start&&X.start-e<=De&&(X={...X,start:e,before:e*Y}),e>=X.end&&e-X.end<De&&(X={...X,end:e+1,after:(q.length-e-1)*Y}))}let Vt=f(null),Ht=f(null),Ut=f(null),Wt=!P&&!C&&y?.length>0&&y.length<=de;d(()=>{let e=Vt.current;if(!Wt||!e){Ht.current=null,Ut.current=null;return}let t=y.map((e,t)=>b(e,t));be(Ut.current,t)&&ye(e.rows,Ht.current),Ht.current=he(e.rows),Ut.current=t});let Gt=typeof F==`function`||typeof I==`function`,Kt=f(null),qt=f(null);u(()=>{if(!Gt){qt.current=null;return}let e=g[0]?.key,t=new Map;(y||[]).forEach((n,r)=>{let i=e===void 0?void 0:n[e],a=typeof i==`string`||typeof i==`number`?String(i):``;t.set(b(n,r),{...Ae(n,F,I),label:a})});let n=xe(Se(qt.current,t));qt.current=t,n&&Kt.current&&(Kt.current.textContent=n)},[y,F,I,b]);let Z=Ie!==void 0&&(Le===void 0||Le>0)?Ie:Fe,Jt=({group:e,open:t},n)=>{let r=e.items[0].row[N],a=e.items.map(e=>e.row);return m(`tr`,{className:`wui-group-row`,"data-group-key":e.key,"aria-rowindex":W?n+2:void 0,children:m(`th`,{className:`wui-group-cell`,scope:`rowgroup`,colSpan:St,children:h(`button`,{type:`button`,className:`wui-group-toggle`,"aria-expanded":t,onClick:()=>Ft(e.key),children:[m(i,{name:`chevron-down`,size:16}),m(`span`,{className:`wui-group-label`,children:st?st(r,a):Me(r)}),m(`span`,{className:`wui-group-count`,"aria-hidden":`true`,children:pe(e.items.length)}),m(`span`,{className:`visually-hidden wui-group-rows`,children:`, ${se.rows(e.items.length)}`})]})})},`group:${e.key}`)},Yt=({row:e,i:t},n)=>{let r=b(e,t),a=L&&pt.has(r),o=it!=null&&String(it)===String(r),s=at!=null&&String(at)===String(r),c=String(r).replace(/[^a-z0-9]/gi,`_`),ee=H(0,`wui-expand-cell`),l=H(+!!L,`wui-select-cell`),u=Gt?Ae(e,F,I):null,d=G(e,t);return h(te,{children:[h(`tr`,{className:[E&&d&&D?.has(r)?`is-selected`:``,R?`wui-row-link`:``,o?`wui-row-active`:``,s?ie.hover:``].filter(Boolean).join(` `)||void 0,"aria-current":o?`true`:void 0,"aria-rowindex":W?n+2:void 0,"aria-busy":u?.state===`saving`?`true`:void 0,"data-wui-save-state":u?.state||void 0,"data-status":nt?.(e)||void 0,"data-href":j?.(e)||void 0,"data-row-key":k?String(r):void 0,tabIndex:R?0:void 0,onClick:R?t=>vt(e,t):void 0,onAuxClick:R&&j?t=>t.button===1&&vt(e,t):void 0,onKeyDown:R?t=>{t.key===`Enter`&&t.target===t.currentTarget&&vt(e,t)}:void 0,children:[L&&m(`td`,{className:ee.className,style:ee.style,children:m(`button`,{type:`button`,className:`wui-expand-toggle${a?` is-open`:``}`,"aria-expanded":a,"aria-controls":a?`${c}-expanded`:void 0,"aria-label":a?`Collapse row`:`Expand row`,onClick:()=>ht(r),children:m(i,{name:`chevron-down`,size:16})})}),E&&m(`td`,{className:l.className,style:l.style,children:m(`input`,{type:`checkbox`,className:`wui-check`,checked:d&&(D?.has(r)||!1),disabled:!d,onChange:e=>jt(r,e.nativeEvent.shiftKey),onMouseDown:e=>{e.shiftKey&&e.preventDefault()},"aria-label":`Select row`})}),g.map((t,n)=>h(`td`,{className:H(V+n,(n===0?`wui-name-cell `:``)+(t.nowrap?`text-nowrap `:``)+v(t.align)+(t.cellClassName?` ${t.cellClassName}`:``)).className,style:U(V+n,t.cellStyle),"data-label":A&&typeof t.label==`string`?t.label:void 0,children:[t.render?t.render(e):Me(e[t.key]),n===0&&u?.state===`error`&&m(`span`,{className:fe,children:u.message})]},t.key)),w&&m(`td`,{children:m(`div`,{className:`u-row-actions`,children:w(e)})})]}),a&&m(`tr`,{className:`wui-row-expanded`,children:m(`td`,{id:`${c}-expanded`,colSpan:St,children:Ke(e)})})]},r)},Xt=(e,t)=>e.group?Jt(e,t):Yt(e,t),Zt=(e,t)=>W?m(`tr`,{className:`wui-virtual-spacer`,"aria-hidden":`true`,hidden:t===0,children:m(`td`,{colSpan:St,style:{height:t}})},e):null,Q=H(0,`wui-expand-cell`),$=H(+!!L,`wui-select-cell`),Qt=()=>Array.from({length:Pe},(e,t)=>`skeleton-${t}`).map(e=>h(`tr`,{children:[L&&m(`td`,{className:Q.className,style:Q.style}),E&&m(`td`,{className:$.className,style:$.style}),g.map((e,t)=>m(`td`,{className:H(V+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+v(e.align)).className,style:U(V+t,void 0),"data-label":A&&typeof e.label==`string`?e.label:void 0,children:m(a,{width:je(e.align),height:12,radius:6})},e.key)),w&&m(`td`,{children:m(`div`,{className:`u-row-actions`,children:m(a,{width:`32px`,height:12,radius:6})})})]},e));return h(re,{children:[h(B?`wui-data-table`:`div`,{ref:J,...B?{class:yt,resizable:M?``:void 0,"view-key":ot||void 0,"data-wui-row-drag":k?``:void 0}:{className:yt,"data-wui-row-drag":k?``:void 0},style:xt,tabIndex:0,...l,...ut,children:[h(`table`,{className:ft,"aria-label":ze,"aria-rowcount":W?q.length+1:void 0,style:qe===`fixed`?{tableLayout:`fixed`}:void 0,children:[m(`thead`,{children:h(`tr`,{"aria-rowindex":W?1:void 0,children:[L&&m(`th`,{className:Q.className,style:Q.style,children:m(`span`,{className:`visually-hidden`,children:`Expand`})}),E&&m(`th`,{className:$.className,style:$.style,children:m(`input`,{ref:kt,type:`checkbox`,className:`wui-check`,checked:Dt,disabled:C,onChange:e=>Mt(e.target.checked),"aria-label":`Select all rows`})}),g.map((e,t)=>{let n=!!(e.sortable&&S),r=x&&x.key===e.key,a=e.align===`num`||e.align===`end`,o=n&&m(`span`,{className:`sort-icon${a?` wui-sort-lead`:``}`,children:m(i,{name:`chevrons-up-down`,size:14})}),s=M&&t!==Tt,c=e.width||e.minWidth?{width:e.width,minWidth:e.minWidth}:void 0;return h(`th`,{className:H(V+t,(n?`sortable `:``)+(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+(e.grow?`wui-col-grow `:``)+(s?`wui-col-resizable `:``)+v(e.align)).className,style:U(V+t,c),"data-key":B?e.key:void 0,"aria-label":s&&typeof e.label==`string`?e.label:void 0,"data-pin":e.pin===`start`||e.pin===`end`?e.pin:void 0,tabIndex:n?0:void 0,"aria-sort":r?x.dir===`asc`?`ascending`:`descending`:n?`none`:void 0,onClick:n?()=>{C||S(e.key)}:void 0,onKeyDown:n?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),C||S(e.key))}:void 0,children:[a&&o,e.label,!a&&o,s&&m(`span`,{className:`wui-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":oe,"aria-valuemax":ae,tabIndex:0,"aria-label":se.resize(typeof e.label==`string`?e.label:e.key)})]},e.key)}),w&&(Re?m(`th`,{className:`wui-cell-end`,children:Re}):m(`th`,{className:`wui-cell-end`,children:m(`span`,{className:`visually-hidden`,children:`Actions`})}))]})}),m(`tbody`,{ref:Vt,children:C?Qt():y?.length?h(re,{children:[Zt(`before`,X.before),q.slice(X.start,X.end).map((e,t)=>Xt(e,X.start+t)),Zt(`after`,X.after)]}):null}),gt&&!C&&y?.length>0&&m(`tfoot`,{children:h(`tr`,{children:[L&&m(`td`,{className:Q.className,style:Q.style}),E&&m(`td`,{className:$.className,style:$.style}),g.map((e,t)=>m(`td`,{className:H(V+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+v(e.align)).className,style:U(V+t,void 0),children:e.footer?e.footer(y):null},e.key)),w&&m(`td`,{})]})})]}),!C&&!y?.length&&m(`div`,{className:`tbl-empty-block`,children:typeof Z==`string`?m(`div`,{className:`tbl-empty-plain`,children:Z}):Z})]}),Ne(T)&&m(o,{page:T.page,totalPages:T.totalPages,pageSize:T.pageSize,onPageChange:C?ke:T.setPage,onPageSizeChange:C?ke:T.setPageSize,pageSizes:T.pageSizes,mode:T.mode}),Gt&&m(`div`,{ref:Kt,className:`visually-hidden`,role:`status`,"aria-live":`polite`,"data-wui-table-status":``})]})}export{y as default};
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./AppSkeleton.js";import i from"./AppTablePagination.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{attachRowDrag as s,attachScrollEdges as c,syncTargets as ee}from"@webority/ui-elements/helpers";import{Children as l,Fragment as te,useEffect as u,useLayoutEffect as d,useMemo as ne,useRef as f,useState as p}from"react";import{Fragment as re,jsx as m,jsxs as h}from"react/jsx-runtime";import{FORCED_STATE_CLASSES as ie}from"@webority/theme/runtime";import{COLUMN_MAX_WIDTH as ae,COLUMN_MIN_WIDTH as oe,DATA_TABLE_TEXT as se,PIN_AT_VAR as ce,PIN_SIDES as le,ROW_HEIGHTS as ue,ROW_MOVE_LIMIT as de,ROW_SAVE_ERROR_CLASS as fe,groupCount as pe,groupItems as me,measureRows as he,pinAtValue as ge,pinClasses as _e,planPins as ve,playRowMoves as ye,rowOrderChanged as be,saveOutcomeText as xe,settledRows as Se,virtualRange as Ce}from"@webority/ui-elements/elements/data-table";var we=[`comfortable`,`cozy`,`compact`],Te=[`auto`,`fixed`],Ee=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},g=/* @__PURE__ */ new Set;function _(t,n){!g.has(t)&&Ee()&&(g.add(t),e(`[@webority/ui-react] <AppDataTable> ${n}`))}var De=100,Oe=e=>e.id,ke=()=>{},Ae=(e,t,n)=>{let r=!!t?.(e),i=r?``:n?.(e)||``;return{state:r?`saving`:i?`error`:null,message:i}};function v(e){return e===`end`?`wui-cell-end`:e===`num`?`num`:e===`center`?`text-center`:``}function je(e){return e===`center`?`44%`:e===`end`||e===`num`?`56%`:`60%`}function Me(e){return e==null||e===``?`-`:Array.isArray(e)?l.toArray(e):typeof e==`boolean`?String(e):e}function Ne(e){if(!e||!(e.total>0))return!1;let t=e.pageSizes?.length?e.pageSizes:[e.pageSize];return e.total>Math.min(...t)}function y(e){let{marker:l,props:Ee}=t(`AppDataTable`,e),{columns:g,rows:y,rowKey:b=Oe,sort:x,onSort:S,loading:C=!1,skeletonRows:Pe=5,empty:Fe=`No records found.`,emptyFiltered:Ie,sourceCount:Le,rowActions:w,rowActionsLabel:Re,pagination:T,ariaLabel:ze,className:Be=``,wrapperClassName:Ve=``,selectable:E=!1,selectedIds:D,isRowSelectable:He,onToggleRow:Ue,onToggleAll:We,onSelectRange:Ge,renderExpanded:Ke,density:O=`comfortable`,tableLayout:qe=`auto`,striped:Je=!1,flush:Ye=!1,pad:Xe,headerTone:Ze,rowDrag:k=!1,maxHeight:Qe,stickyFirstColumn:$e=!1,stickyActions:et=!1,stackOnMobile:A=!1,hiddenColumns:tt,rowStatus:nt,rowHref:j,onRowClick:rt,activeRowKey:it,hoverRowKey:at,resizableColumns:M=!1,viewKey:ot,groupBy:N,groupLabel:st,virtual:P=!1,rowSaving:F,rowSaveError:I,...ct}=Ee;o(`AppDataTable`,ct);let{style:lt,...ut}=ct,dt=tt?.length?new Set(tt):null;g=dt?g.filter(e=>!(e.hideable&&dt.has(e.key))):g,a(`AppDataTable`,`density`,O,we),a(`AppDataTable`,`tableLayout`,qe,Te);for(let e of g)a(`AppDataTable`,`column.pin`,e.pin,le);let ft=[`table table-ledger`,O===`cozy`||O===`compact`?`wui-table-${O}`:``,Je?`wui-table-striped`:``,$e?`wui-table-sticky-first`:``,et?`wui-table-sticky-actions`:``,A?`wui-table-stack`:``,Be].filter(Boolean).join(` `),L=typeof Ke==`function`,[pt,mt]=p(()=>/* @__PURE__ */ new Set),ht=e=>mt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),gt=g.some(e=>typeof e.footer==`function`),R=typeof j==`function`||typeof rt==`function`,_t=e=>!!e.target.closest(`a, button, input, select, textarea, label, [role='menu'], [role='menuitem'], .dropdown`),vt=(e,t)=>{if(_t(t)||(rt&&rt(e),!j))return;let n=j(e);n&&(t.ctrlKey||t.metaKey||t.button===1?window.open(n,`_blank`,`noopener`):window.location.assign(n))},z=Qe!==void 0,yt=[`table-wrap`,z?`wui-table-scroll`:``,Ye?`wui-table-flush`:``,Ve].filter(Boolean).join(` `),bt={maxHeight:z?Qe:void 0,"--wui-table-pad":Xe!=null&&!Ye?`${Xe}px`:void 0,"--wui-table-header-bg":Ze??void 0},xt=Object.values(bt).some(e=>e!==void 0)||lt!==void 0?{...bt,...lt}:void 0,St=Math.max(1,g.length+ +!!w+ +!!E+ +!!L),Ct=g.some(e=>e.pin===`start`||e.pin===`end`),B=Ct||M||!!N||P,V=+!!L+ +!!E,wt=Ct?ve([...L?[`lead`]:[],...E?[`lead`]:[],...g.map(e=>e.pin===`start`||e.pin===`end`?e.pin:null),...w?[null]:[]]):[],H=(e,t=``)=>{let n=wt[e];return n?{className:`${t.trim()} ${_e(n)}`.trim(),style:{[ce]:ge(n.side,n.ordinal)}}:{className:t,style:void 0}},U=(e,t)=>wt[e]?{...t,...H(e).style}:t,Tt=g.length-1+ +!!w;ot&&!M&&_(`view-key`,"`viewKey` remembers resized widths: add `resizableColumns`."),P&&!z&&_(`virtual-height`,"`virtual` needs `maxHeight`: without a scroll box every row renders."),P&&(L||A)&&_(`virtual-shape`,"`virtual` takes rows of one height, so it is off with `renderExpanded` or `stackOnMobile`."),!P&&y?.length>500&&_(`rows-without-virtual`,`renders more than 500 rows without virtual: add virtual with maxHeight, or page the data.`);let W=P&&z&&!L&&!A&&!C&&y?.length>0,G=(e,t)=>!He||!!He(e,t),Et=E&&y?y.reduce((e,t,n)=>e+ +!!G(t,n),0):0,K=E&&y?y.reduce((e,t,n)=>e+(G(t,n)&&D?.has(b(t,n))?1:0),0):0,Dt=Et>0&&K===Et,Ot=K>0&&!Dt,kt=e=>{e&&(e.indeterminate=Ot)},At=f(null),jt=(e,t)=>{let n=At.current;At.current=e;let r=t&&n!==null?y.findIndex((e,t)=>b(e,t)===n):-1,i=y.findIndex((t,n)=>b(t,n)===e);if(r<0||i<0||r===i){Ue?.(e);return}let a=!D?.has(e),o=Math.min(r,i),s=y.slice(o,Math.max(r,i)+1).map((e,t)=>[e,o+t]).filter(([e,t])=>G(e,t)).map(([e,t])=>b(e,t)).filter(e=>(D?.has(e)||!1)!==a);if(Ge)Ge(s,a);else for(let e of s)Ue?.(e)},Mt=e=>{He?(y||[]).forEach((t,n)=>{let r=b(t,n);G(t,n)&&(D?.has(r)||!1)!==e&&Ue?.(r)}):We?.(e)},[Nt,Pt]=p(()=>/* @__PURE__ */ new Set),Ft=e=>Pt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),q=ne(()=>{let e=(y||[]).map((e,t)=>({row:e,i:t}));return N?me(e,({row:e})=>String(e[N]??``)).flatMap(e=>[{group:e,open:!Nt.has(e.key)},...Nt.has(e.key)?[]:e.items]):e},[y,N,Nt]),J=f(null),It=f(null);u(()=>{let e=J.current;if(!e)return;let t=e=>{let t=e.target.closest?.(`.u-name`);t&&!t.title&&(t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight)&&(t.title=t.textContent.trim())},n=e=>{let t=e.target.closest?.(`tbody > tr[aria-rowindex]`)?.getAttribute(`aria-rowindex`);It.current=t?Number(t)-2:null},r=t=>{e.contains(t.relatedTarget)||(It.current=null)};e.addEventListener(`mouseover`,t),e.addEventListener(`focusin`,t),e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,r);let i=c(e);return()=>{e.removeEventListener(`mouseover`,t),e.removeEventListener(`focusin`,t),e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,r),i()}},[B]),u(()=>{if(!k||!J.current)return;let e=s(J.current);return ee(document),e},[k,B]);let Lt=f(!1);u(()=>{!Lt.current&&(Lt.current=!0,K===0)||J.current?.querySelector(`table`)?.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:{selected:K,total:y?.length??0,keys:y?y.flatMap((e,t)=>{let n=b(e,t);return G(e,t)&&D?.has(n)?[String(n)]:[]}):[]}}))},[E,K]);let[Rt,zt]=p({top:0,height:0}),[Y,Bt]=p(ue[O]??ue.comfortable);u(()=>{let e=J.current;if(!W||!e)return;let t=0,n=()=>{t=0;let n=e.querySelector(`:scope > table > thead`)?.getBoundingClientRect().height||0,r={top:Math.max(0,e.scrollTop-n),height:e.clientHeight};zt(e=>e.top===r.top&&e.height===r.height?e:r)},r=()=>{t||=requestAnimationFrame(n)};e.addEventListener(`scroll`,r,{passive:!0});let i=typeof ResizeObserver<`u`?new ResizeObserver(r):null;return i?.observe(e),n(),()=>{e.removeEventListener(`scroll`,r),i?.disconnect(),t&&cancelAnimationFrame(t)}},[W,B]),d(()=>{if(!W)return;let e=(J.current?.querySelector(`:scope > table > tbody > tr:not(.wui-virtual-spacer, .wui-group-row)`))?.getBoundingClientRect().height;e>0&&Math.abs(e-Y)>.5&&Bt(e)},[O,y?.length,P,W]);let X={start:0,end:q.length,before:0,after:0};if(W){X=Ce({scrollTop:Rt.top,viewport:Rt.height||Number.parseFloat(Qe)||0,rowHeight:Y,count:q.length});let e=It.current;e!==null&&e>=0&&e<q.length&&(e<X.start&&X.start-e<=De&&(X={...X,start:e,before:e*Y}),e>=X.end&&e-X.end<De&&(X={...X,end:e+1,after:(q.length-e-1)*Y}))}let Vt=f(null),Ht=f(null),Ut=f(null),Wt=!P&&!C&&y?.length>0&&y.length<=de;d(()=>{let e=Vt.current;if(!Wt||!e){Ht.current=null,Ut.current=null;return}let t=y.map((e,t)=>b(e,t));be(Ut.current,t)&&ye(e.rows,Ht.current),Ht.current=he(e.rows),Ut.current=t});let Gt=typeof F==`function`||typeof I==`function`,Kt=f(null),qt=f(null);u(()=>{if(!Gt){qt.current=null;return}let e=g[0]?.key,t=/* @__PURE__ */ new Map;(y||[]).forEach((n,r)=>{let i=e===void 0?void 0:n[e],a=typeof i==`string`||typeof i==`number`?String(i):``;t.set(b(n,r),{...Ae(n,F,I),label:a})});let n=xe(Se(qt.current,t));qt.current=t,n&&Kt.current&&(Kt.current.textContent=n)},[y,F,I,b]);let Z=Ie!==void 0&&(Le===void 0||Le>0)?Ie:Fe,Jt=({group:e,open:t},r)=>{let i=e.items[0].row[N],a=e.items.map(e=>e.row);return/* @__PURE__ */ m(`tr`,{className:`wui-group-row`,"data-group-key":e.key,"aria-rowindex":W?r+2:void 0,children:/* @__PURE__ */ m(`th`,{className:`wui-group-cell`,scope:`rowgroup`,colSpan:St,children:/* @__PURE__ */ h(`button`,{type:`button`,className:`wui-group-toggle`,"aria-expanded":t,onClick:()=>Ft(e.key),children:[/* @__PURE__ */ m(n,{name:`chevron-down`,size:16}),/* @__PURE__ */ m(`span`,{className:`wui-group-label`,children:st?st(i,a):Me(i)}),/* @__PURE__ */ m(`span`,{className:`wui-group-count`,"aria-hidden":`true`,children:pe(e.items.length)}),/* @__PURE__ */ m(`span`,{className:`visually-hidden wui-group-rows`,children:`, ${se.rows(e.items.length)}`})]})})},`group:${e.key}`)},Yt=({row:e,i:t},r)=>{let i=b(e,t),a=L&&pt.has(i),o=it!=null&&String(it)===String(i),s=at!=null&&String(at)===String(i),c=String(i).replace(/[^a-z0-9]/gi,`_`),ee=H(0,`wui-expand-cell`),l=H(+!!L,`wui-select-cell`),u=Gt?Ae(e,F,I):null,d=G(e,t);return/* @__PURE__ */ h(te,{children:[/* @__PURE__ */ h(`tr`,{className:[E&&d&&D?.has(i)?`is-selected`:``,R?`wui-row-link`:``,o?`wui-row-active`:``,s?ie.hover:``].filter(Boolean).join(` `)||void 0,"aria-current":o?`true`:void 0,"aria-rowindex":W?r+2:void 0,"aria-busy":u?.state===`saving`?`true`:void 0,"data-wui-save-state":u?.state||void 0,"data-status":nt?.(e)||void 0,"data-href":j?.(e)||void 0,"data-row-key":k?String(i):void 0,tabIndex:R?0:void 0,onClick:R?t=>vt(e,t):void 0,onAuxClick:R&&j?t=>t.button===1&&vt(e,t):void 0,onKeyDown:R?t=>{t.key===`Enter`&&t.target===t.currentTarget&&vt(e,t)}:void 0,children:[L&&/* @__PURE__ */ m(`td`,{className:ee.className,style:ee.style,children:/* @__PURE__ */ m(`button`,{type:`button`,className:`wui-expand-toggle${a?` is-open`:``}`,"aria-expanded":a,"aria-controls":a?`${c}-expanded`:void 0,"aria-label":a?`Collapse row`:`Expand row`,onClick:()=>ht(i),children:/* @__PURE__ */ m(n,{name:`chevron-down`,size:16})})}),E&&/* @__PURE__ */ m(`td`,{className:l.className,style:l.style,children:/* @__PURE__ */ m(`input`,{type:`checkbox`,className:`wui-check`,checked:d&&(D?.has(i)||!1),disabled:!d,onChange:e=>jt(i,e.nativeEvent.shiftKey),onMouseDown:e=>{e.shiftKey&&e.preventDefault()},"aria-label":`Select row`})}),g.map((t,n)=>/* @__PURE__ */ h(`td`,{className:H(V+n,(n===0?`wui-name-cell `:``)+(t.nowrap?`text-nowrap `:``)+v(t.align)+(t.cellClassName?` ${t.cellClassName}`:``)).className,style:U(V+n,t.cellStyle),"data-label":A&&typeof t.label==`string`?t.label:void 0,children:[t.render?t.render(e):Me(e[t.key]),n===0&&u?.state===`error`&&/* @__PURE__ */ m(`span`,{className:fe,children:u.message})]},t.key)),w&&/* @__PURE__ */ m(`td`,{children:/* @__PURE__ */ m(`div`,{className:`u-row-actions`,children:w(e)})})]}),a&&/* @__PURE__ */ m(`tr`,{className:`wui-row-expanded`,children:/* @__PURE__ */ m(`td`,{id:`${c}-expanded`,colSpan:St,children:Ke(e)})})]},i)},Xt=(e,t)=>e.group?Jt(e,t):Yt(e,t),Zt=(e,t)=>W?/* @__PURE__ */ m(`tr`,{className:`wui-virtual-spacer`,"aria-hidden":`true`,hidden:t===0,children:/* @__PURE__ */ m(`td`,{colSpan:St,style:{height:t}})},e):null,Q=H(0,`wui-expand-cell`),$=H(+!!L,`wui-select-cell`),Qt=()=>Array.from({length:Pe},(e,t)=>`skeleton-${t}`).map(e=>/* @__PURE__ */ h(`tr`,{children:[L&&/* @__PURE__ */ m(`td`,{className:Q.className,style:Q.style}),E&&/* @__PURE__ */ m(`td`,{className:$.className,style:$.style}),g.map((e,t)=>/* @__PURE__ */ m(`td`,{className:H(V+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+v(e.align)).className,style:U(V+t,void 0),"data-label":A&&typeof e.label==`string`?e.label:void 0,children:/* @__PURE__ */ m(r,{width:je(e.align),height:12,radius:6})},e.key)),w&&/* @__PURE__ */ m(`td`,{children:/* @__PURE__ */ m(`div`,{className:`u-row-actions`,children:/* @__PURE__ */ m(r,{width:`32px`,height:12,radius:6})})})]},e));return/* @__PURE__ */ h(re,{children:[/* @__PURE__ */ h(B?`wui-data-table`:`div`,{ref:J,...B?{class:yt,resizable:M?``:void 0,"view-key":ot||void 0,"data-wui-row-drag":k?``:void 0}:{className:yt,"data-wui-row-drag":k?``:void 0},style:xt,tabIndex:0,...l,...ut,children:[/* @__PURE__ */ h(`table`,{className:ft,"aria-label":ze,"aria-rowcount":W?q.length+1:void 0,style:qe===`fixed`?{tableLayout:`fixed`}:void 0,children:[/* @__PURE__ */ m(`thead`,{children:/* @__PURE__ */ h(`tr`,{"aria-rowindex":W?1:void 0,children:[L&&/* @__PURE__ */ m(`th`,{className:Q.className,style:Q.style,children:/* @__PURE__ */ m(`span`,{className:`visually-hidden`,children:`Expand`})}),E&&/* @__PURE__ */ m(`th`,{className:$.className,style:$.style,children:/* @__PURE__ */ m(`input`,{ref:kt,type:`checkbox`,className:`wui-check`,checked:Dt,disabled:C,onChange:e=>Mt(e.target.checked),"aria-label":`Select all rows`})}),g.map((e,t)=>{let r=!!(e.sortable&&S),i=x&&x.key===e.key,a=e.align===`num`||e.align===`end`,o=r&&/* @__PURE__ */ m(`span`,{className:`sort-icon${a?` wui-sort-lead`:``}`,children:/* @__PURE__ */ m(n,{name:`chevrons-up-down`,size:14})}),s=M&&t!==Tt,c=e.width||e.minWidth?{width:e.width,minWidth:e.minWidth}:void 0;return/* @__PURE__ */ h(`th`,{className:H(V+t,(r?`sortable `:``)+(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+(e.grow?`wui-col-grow `:``)+(s?`wui-col-resizable `:``)+v(e.align)).className,style:U(V+t,c),"data-key":B?e.key:void 0,"aria-label":s&&typeof e.label==`string`?e.label:void 0,"data-pin":e.pin===`start`||e.pin===`end`?e.pin:void 0,tabIndex:r?0:void 0,"aria-sort":i?x.dir===`asc`?`ascending`:`descending`:r?`none`:void 0,onClick:r?()=>{C||S(e.key)}:void 0,onKeyDown:r?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),C||S(e.key))}:void 0,children:[a&&o,e.label,!a&&o,s&&/* @__PURE__ */ m(`span`,{className:`wui-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":oe,"aria-valuemax":ae,tabIndex:0,"aria-label":se.resize(typeof e.label==`string`?e.label:e.key)})]},e.key)}),w&&(Re?/* @__PURE__ */ m(`th`,{className:`wui-cell-end`,children:Re}):/* @__PURE__ */ m(`th`,{className:`wui-cell-end`,children:/* @__PURE__ */ m(`span`,{className:`visually-hidden`,children:`Actions`})}))]})}),/* @__PURE__ */ m(`tbody`,{ref:Vt,children:C?Qt():y?.length?/* @__PURE__ */ h(re,{children:[Zt(`before`,X.before),q.slice(X.start,X.end).map((e,t)=>Xt(e,X.start+t)),Zt(`after`,X.after)]}):null}),gt&&!C&&y?.length>0&&/* @__PURE__ */ m(`tfoot`,{children:/* @__PURE__ */ h(`tr`,{children:[L&&/* @__PURE__ */ m(`td`,{className:Q.className,style:Q.style}),E&&/* @__PURE__ */ m(`td`,{className:$.className,style:$.style}),g.map((e,t)=>/* @__PURE__ */ m(`td`,{className:H(V+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+v(e.align)).className,style:U(V+t,void 0),children:e.footer?e.footer(y):null},e.key)),w&&/* @__PURE__ */ m(`td`,{})]})})]}),!C&&!y?.length&&/* @__PURE__ */ m(`div`,{className:`tbl-empty-block`,children:typeof Z==`string`?/* @__PURE__ */ m(`div`,{className:`tbl-empty-plain`,children:Z}):Z})]}),Ne(T)&&/* @__PURE__ */ m(i,{page:T.page,totalPages:T.totalPages,pageSize:T.pageSize,onPageChange:C?ke:T.setPage,onPageSizeChange:C?ke:T.setPageSize,pageSizes:T.pageSizes,mode:T.mode}),Gt&&/* @__PURE__ */ m(`div`,{ref:Kt,className:`visually-hidden`,role:`status`,"aria-live":`polite`,"data-wui-table-status":``})]})}export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppRequiredMark.js";import i from"./useWuiControl.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{cloneElement as s,forwardRef as c,useId as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/datepicker";var f=[`sm`,`md`,`lg`],p=c(function(c,p){let{marker:m,props:h}=n(`AppDatePicker`,c),{value:g,onChange:_,label:v,required:y=!1,optional:b=!1,hint:x,error:S,name:C,min:w,max:T,placeholder:E=`Choose a date`,disabled:D,size:O,firstDay:k,displayFormat:A,id:j,ariaLabel:M,className:N=``,fieldClassName:P=``,...F}=h;o(`AppDatePicker`,F),a(`AppDatePicker`,`size`,O,f),typeof A==`string`&&A!==``&&/DD|YYYY|YY/.test(A)&&e(`[@webority/ui-react] <AppDatePicker> displayFormat "${A}" uses uppercase day or year tokens, which print as written; the tokens are yyyy, MMMM, MMM, MM, dd and d.`);let I=l(),L=j||I,{setRef:R}=i({ref:p,value:g??``,onChange:_}),z=!v&&!S&&!x,B=S?`${L}-error`:void 0,V=x?`${L}-hint`:void 0,H=/* @__PURE__ */ u(`wui-datepicker`,{ref:R,value:g||void 0,id:L,name:C,min:w,max:T,placeholder:E,size:O||void 0,"first-day":k==null?void 0:String(k),"display-format":A||void 0,"aria-label":M||(typeof v==`string`?v:void 0),"aria-describedby":B||V,"aria-invalid":S?`true`:void 0,disabled:D?``:void 0,required:y?``:void 0,className:N||void 0,...F});return z?s(H,m):/* @__PURE__ */ d(`div`,{...m,className:`field${P?` ${P}`:``}`,children:[v&&/* @__PURE__ */ d(`label`,{className:`label`,htmlFor:L,children:[v,b&&!y&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` (optional)`}),y&&/* @__PURE__ */ u(r,{})]}),H,/* @__PURE__ */ u(t,{error:S,hint:x,errorId:B,hintId:V})]})});export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppRequiredMark.js";import r from"./useWuiControl.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{cloneElement as o,forwardRef as s,useEffect as c,useId as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/date-range";var f=[`sm`,`md`,`lg`],p=e=>{if(e?.length)return e.every(e=>typeof e==`string`)?e.join(`,`):JSON.stringify(e)},m=s(function(s,m){let{marker:h,props:g}=t(`AppDateRangePicker`,s),{start:_,end:v,onChange:y,label:b,required:x=!1,optional:S=!1,hint:C,error:w,startName:T,endName:E,min:D,max:O,placeholder:k=`Start to End`,disabled:A,size:j,firstDay:M,presets:N,id:P,ariaLabel:F,className:I=``,fieldClassName:L=``,...R}=g;a(`AppDateRangePicker`,R),i(`AppDateRangePicker`,`size`,j,f);let z=l(),B=P||z,{setRef:V,innerRef:H}=r({ref:m,onChange:y});c(()=>{let e=H.current;if(!e)return;let t=_===void 0?e.value.start:_,n=v===void 0?e.value.end:v;(e.value.start!==t||e.value.end!==n)&&(e.value={start:t,end:n})},[_,v,H]);let U=!b&&!w&&!C,W=w?`${B}-error`:void 0,G=C?`${B}-hint`:void 0,K=W||G,q=/* @__PURE__ */ u(`wui-date-range`,{ref:V,id:B,"start-name":T,"end-name":E,min:D,max:O,placeholder:k,size:j||void 0,"first-day":M==null?void 0:String(M),presets:p(N),"aria-label":F||(typeof b==`string`?b:void 0),"aria-describedby":K,"aria-invalid":w?`true`:void 0,disabled:A?``:void 0,required:x?``:void 0,className:I||void 0,...R});return U?o(q,h):/* @__PURE__ */ d(`div`,{...h,className:`field${L?` ${L}`:``}`,children:[b&&/* @__PURE__ */ d(`label`,{className:`label`,htmlFor:B,children:[b,S&&!x&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` (optional)`}),x&&/* @__PURE__ */ u(n,{})]}),q,/* @__PURE__ */ u(e,{error:w,hint:C,errorId:W,hintId:G})]})});export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isEmpty as e}from"../lib/emptyValue.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./renderIconProp.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s=[`sm`,`md`],c=[`grid`,`summary`,`list`],l=[1,2,3,4];function u(u){let{marker:d,props:f}=t(`AppDescriptions`,u),{items:p=[],columns:m=2,size:h=`md`,bordered:g=!1,layout:_=`grid`,title:v,className:y=``,...b}=f;i(`AppDescriptions`,b),r(`AppDescriptions`,`columns`,m,l),r(`AppDescriptions`,`size`,h,s),r(`AppDescriptions`,`layout`,_,c);let x=[`descs`,`descs-col-${m}`,h&&h!==`md`?`descs-${h}`:``,g?`descs-bordered`:``,_===`summary`?`wui-descs-summary`:``,_===`list`?`wui-descs-list`:``,m===4?`wui-descs-col-4`:``,y].filter(Boolean).join(` `)||void 0;return/* @__PURE__ */ o(`div`,{className:x,...d,...b,children:[v&&/* @__PURE__ */ a(`div`,{className:`descs-title`,children:v}),/* @__PURE__ */ a(`dl`,{className:`descs-list`,children:p.map((t,r)=>{let i=e(t.value),s=Math.min(12,Math.max(1,t.span??1)),c=t.key??`${t.label}-${r}`,l=i?`-`:t.value;return/* @__PURE__ */ o(`div`,{className:`descs-item${t.emphasis?` wui-descs-emphasis`:``} wui-descs-span-${s}`,children:[t.icon&&/* @__PURE__ */ a(`span`,{className:`wui-descs-icon`,children:n(t.icon,{size:16})}),/* @__PURE__ */ a(`dt`,{className:`descs-label`,children:t.label}),/* @__PURE__ */ a(`dd`,{className:`descs-value${i?` is-empty`:``}`,children:t.href?/* @__PURE__ */ a(`a`,{className:`wui-descs-link`,href:t.href,children:l}):l})]},c)})})]})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{jsx as n}from"react/jsx-runtime";function r(r){let{marker:i,props:a}=e(`AppDetailPane`,r),{open:o=!1,onClose:s,label:c,sticky:l=!0,children:u,className:d=``,...f}=a;t(`AppDetailPane`,f);let p=e=>{f.onKeyDown?.(e),e.key===`Escape`&&s&&s()};return n(`aside`,{...i,...f,className:[`wui-detail-pane`,d].filter(Boolean).join(` `),"aria-label":c,"data-wui-pane-host":``,"data-sticky":l?``:void 0,hidden:!o,onKeyDown:p,children:u})}export{r as default};
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{jsx as n}from"react/jsx-runtime";function r(r){let{marker:i,props:a}=e(`AppDetailPane`,r),{open:o=!1,onClose:s,label:c,sticky:l=!0,children:u,className:d=``,...f}=a;t(`AppDetailPane`,f);let p=e=>{f.onKeyDown?.(e),e.key===`Escape`&&s&&s()};return/* @__PURE__ */ n(`aside`,{...i,...f,className:[`wui-detail-pane`,d].filter(Boolean).join(` `),"aria-label":c,"data-wui-pane-host":``,"data-sticky":l?``:void 0,hidden:!o,onKeyDown:p,children:u})}export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../lib/DiscardPrompt.js";import{lockPageScroll as t}from"../lib/pageScrollLock.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{useEffect as o,useRef as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import"@webority/ui-elements/elements/drawer";var d=[`end`,`start`],f=[`sm`,`md`,`lg`,`xl`],p=[50,90],m=e=>Array.isArray(e)&&e.length>0&&e.every(e=>Number.isFinite(e)&&e>=10&&e<=100);function h(h){let{marker:g,props:_}=n(`AppDrawer`,h),{open:v=!1,onClose:y,title:b,titleIcon:x,header:S,subtitle:C,ariaLabel:w,side:T=`end`,size:E=`md`,width:D,maxWidth:O,snapPoints:k=p,defaultSnap:A=0,sheet:j=!0,onSnapChange:M,onOpened:N,onClosed:P,dismissible:F=!0,closeLabel:I=`Close`,staticBackdrop:L=!1,confirmDiscard:R,dirty:z=!1,headerClassName:B=``,bodyClassName:V=``,footer:H,className:U=``,style:W,children:G,...K}=_;a(`AppDrawer`,K),i(`AppDrawer`,`side`,T,d),i(`AppDrawer`,`size`,E,f),i(`AppDrawer`,`snapPoints`,m(k)?void 0:JSON.stringify(k),[`an array of numbers from 10 to 100`]);let q=s(null),J=s(null),Y=s(null),[X,Z]=c(!1);J.current={onClose:y,onSnapChange:M,onOpened:N,onClosed:P,confirmDiscard:R,dirty:z},o(()=>{v||Z(!1)},[v]),o(()=>{X&&Y.current?.focus()},[X]),o(()=>{if(v)return t()},[v]),o(()=>{let e=q.current;if(!e)return;let t=t=>{t.target===e&&(t.preventDefault(),J.current.confirmDiscard&&J.current.dirty?Z(!0):J.current.onClose?.())},n=t=>{t.target===e&&J.current.onSnapChange?.(t.detail.index,t.detail.percent)},r=t=>{t.target===e&&J.current.onOpened?.()},i=t=>{t.target===e&&J.current.onClosed?.()},a=n=>{n.target.closest?.(`[data-wui-dismiss]`)&&t({target:e,preventDefault(){}})};return e.addEventListener(`wui-drawer-close`,t),e.addEventListener(`wui-drawer-snap`,n),e.addEventListener(`wui-drawer-opened`,r),e.addEventListener(`wui-drawer-closed`,i),e.addEventListener(`click`,a),()=>{e.removeEventListener(`wui-drawer-close`,t),e.removeEventListener(`wui-drawer-snap`,n),e.removeEventListener(`wui-drawer-opened`,r),e.removeEventListener(`wui-drawer-closed`,i),e.removeEventListener(`click`,a)}},[]);let Q=()=>{Z(!1),q.current?.dispatchEvent(new CustomEvent(`wui:drawer:discard`,{bubbles:!0})),J.current.onClose?.()},$=m(k)?k:p,ee={...D&&{"--wui-drawer-width":D},...O&&{"--wui-drawer-max-width":O},...W};return/* @__PURE__ */ u(`wui-drawer`,{ref:q,...g,...K,class:[`wui-drawer`,U].filter(Boolean).join(` `),side:T,size:E,"snap-points":$.join(`,`),"default-snap":String(A),static:L?``:void 0,"no-sheet":j?void 0:``,"confirm-discard":R||void 0,open:v?``:void 0,style:ee,children:[/* @__PURE__ */ l(`div`,{className:`wui-drawer-backdrop`,"data-wui-drawer-backdrop":``,"aria-hidden":`true`}),/* @__PURE__ */ u(`div`,{className:`wui-drawer-panel`,role:`dialog`,"aria-modal":`true`,"aria-label":w||b||void 0,tabIndex:-1,children:[j&&/* @__PURE__ */ l(`div`,{className:`wui-drawer-grip`,"data-wui-drawer-grip":``,children:/* @__PURE__ */ l(`div`,{className:`wui-drawer-handle`,role:`slider`,tabIndex:0,"aria-orientation":`vertical`,"aria-label":`Sheet height`})}),S===void 0?/* @__PURE__ */ u(`div`,{className:[`wui-drawer-header`,B].filter(Boolean).join(` `),"data-wui-drawer-grip":j?``:void 0,children:[/* @__PURE__ */ u(`div`,{className:`wui-drawer-headtext`,children:[b&&/* @__PURE__ */ u(`div`,{className:`wui-drawer-title`,children:[x&&/* @__PURE__ */ l(`span`,{className:`wui-drawer-title-ic`,children:/* @__PURE__ */ l(r,{name:x,size:18})}),b]}),C&&/* @__PURE__ */ l(`div`,{className:`wui-drawer-subtitle`,children:C})]}),F&&/* @__PURE__ */ l(`button`,{type:`button`,className:`wui-drawer-close`,"data-wui-drawer-close":``,"aria-label":I,children:/* @__PURE__ */ l(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:/* @__PURE__ */ l(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}):S,/* @__PURE__ */ l(`div`,{className:[`wui-drawer-body`,V].filter(Boolean).join(` `),children:G}),(H||X)&&/* @__PURE__ */ u(`div`,{className:X?`wui-drawer-footer wui-drawer-discarding`:`wui-drawer-footer`,children:[X&&/* @__PURE__ */ l(e,{text:R,confirmRef:Y,onDiscard:Q,onKeep:()=>Z(!1)}),H]})]})]})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../lib/FieldMessage.js";import t from"../lib/useFileDrop.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./warnUnknownProps.js";import{DEFAULT_MAX_SIZE_MB as a,acceptDroppedFiles as o,acceptLabel as s}from"@webority/ui-elements/helpers";import{useId as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(f){let{marker:p,props:m}=n(`AppDropZone`,f),{label:h,id:g,onChange:_,multiple:v=!1,accept:y=``,maxSizeMb:b=a,error:x,hint:S,disabled:C=!1,className:w=``,fieldClassName:T=``,style:E,...D}=m;i(`AppDropZone`,D);let[O,k]=l(``),A=c(),j=g||A,M=x||O,N=M?`${j}-error`:void 0,P=S&&!M?`${j}-hint`:void 0,F=N||P,I=y?s(y):`Any file type`,L={accept:y,maxSizeMb:b,multiple:v},R=e=>{k(``),_(v?e:e[0])},z=e=>k(e.message),{dragOver:B,dropProps:V}=t({...L,disabled:C,onFiles:R,onReject:z}),H=e=>{let{files:t,rejections:n}=o(e,L);(t.length||n.length)&&(t.length&&R(t),n.length&&z(n[0]))};return/* @__PURE__ */ d(`div`,{...p,className:`field${T?` ${T}`:``}`,children:[h?/* @__PURE__ */ u(`label`,{className:`label`,htmlFor:j,children:h}):null,/* @__PURE__ */ d(`div`,{className:`file-input file-input-tall${B?` dragging`:``}${M?` error`:``}${w?` ${w}`:``}`,style:E,"aria-disabled":C||void 0,...V,children:[/* @__PURE__ */ d(`label`,{htmlFor:j,className:`file-input-zone-label`,children:[/* @__PURE__ */ u(`span`,{className:`file-input-icon`,children:/* @__PURE__ */ u(r,{name:`upload`,size:24})}),/* @__PURE__ */ d(`span`,{className:`file-input-title`,children:[/* @__PURE__ */ u(`span`,{className:`browse`,children:`Click to upload`}),` or drag & drop`]}),/* @__PURE__ */ u(`span`,{className:`file-input-text`,children:b>0?`${I}, up to ${b} MB`:I})]}),/* @__PURE__ */ u(`input`,{id:j,type:`file`,"aria-describedby":F,accept:y,multiple:v||void 0,disabled:C||void 0,className:`visually-hidden`,onClick:e=>{e.currentTarget.value=``},onChange:e=>H(e.target.files),...D})]}),/* @__PURE__ */ u(e,{error:M,hint:S,errorId:N,hintId:P})]})}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import{shortcutAria as t,shortcutChip as n}from"../lib/shortcutChip.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./renderIconProp.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import c from"./withTooltip.js";import{Fragment as l,forwardRef as u,useEffect as d,useRef as f,useState as p}from"react";import{Dropdown as m}from"react-bootstrap";import{jsx as h,jsxs as g}from"react/jsx-runtime";var _=[`sm`,`md`,`lg`,`xl`],v=[`neutral`],y=[`sm`,`md`,`lg`],b=e=>{e.preventDefault(),e.stopPropagation()},x=u(function(e,t){return/* @__PURE__ */ h(`button`,{...e,ref:t,"aria-disabled":`true`})}),S=!1;function C(){let t=!0;try{t=process.env.NODE_ENV!==`production`}catch{t=!0}t&&!S&&(S=!0,e("[@webority/ui-react] <AppDropdown> icon-only toggle has no accessible name — pass `label` or `ariaLabel`."))}function w(i){let{marker:u,props:S}=r(`AppDropdown`,i),{icon:w,iconSize:E,toggleClassName:D,toggleVariant:O,menuWidth:k,label:A,ariaLabel:j,align:M=`end`,items:N=[],menuClassName:P=``,linkComponent:F,children:I,trigger:L,show:R,onToggle:z,...B}=S;s(`AppDropdown`,B);for(let e of N)o(`AppDropdown`,`items[].hiddenFrom`,e.hiddenFrom,_);L||j||A||C(),o(`AppDropdown`,`toggleVariant`,O,v),o(`AppDropdown`,`menuWidth`,k,y),O&&!L&&e(`AppDropdown: toggleVariant needs a trigger; the icon toggle ignores it.`);let V=(D??(L?`wui-dropdown-trigger`:`topbar-icon-btn`))+(L&&O===`neutral`?` wui-dropdown-trigger-neutral`:``),H=[P,y.includes(k)?`wui-dropdown-menu-${k}`:``].filter(Boolean).join(` `),U=R!==void 0,[W,G]=p(!1),K=U?!!R:W,q=f(null);q.current=(e,t)=>{U||G(e),z?.(e,t)};let J=f(null);return d(()=>{if(!K)return;let e=J.current?.getBoundingClientRect(),t=()=>{let t=J.current?.getBoundingClientRect();(!e||!t||Math.abs(t.top-e.top)>2||Math.abs(t.left-e.left)>2)&&q.current(!1,{source:`scroll`})},n=()=>q.current(!1,{source:`resize`});return window.addEventListener(`scroll`,t,{capture:!0,passive:!0}),window.addEventListener(`resize`,n),()=>{window.removeEventListener(`scroll`,t,{capture:!0}),window.removeEventListener(`resize`,n)}},[K]),/* @__PURE__ */ g(m,{ref:J,align:M,show:K,onToggle:(e,t)=>q.current(e,t),...u,...B,children:[/* @__PURE__ */ h(m.Toggle,{as:T,icon:w,iconSize:E,btnClassName:V,trigger:L,title:A,"aria-label":j??(L?void 0:A)}),/* @__PURE__ */ h(m.Menu,{className:H,renderOnMount:!0,popperConfig:{strategy:`fixed`},children:I??N.map(e=>{if(e.header!=null)return/* @__PURE__ */ h(`div`,{className:`dropdown-header`,children:e.header},e.key);if(e.divider)return/* @__PURE__ */ h(m.Divider,{},e.key);if(e.disabled)return/* @__PURE__ */ h(l,{children:c(/* @__PURE__ */ g(m.Item,{as:x,type:`button`,className:[e.danger&&`danger`,`wui-dropdown-item-disabled`].filter(Boolean).join(` `),onClick:b,children:[e.image?/* @__PURE__ */ h(`img`,{src:e.image,alt:``}):a(e.icon,{size:16}),e.label,e.disabledReason&&/* @__PURE__ */ g(`span`,{className:`visually-hidden wui-dropdown-item-reason`,children:[`: `,e.disabledReason]})]}),e.disabledReason,`auto`)},e.key);let r=e.to?F?{as:F,to:e.to}:{as:`a`,href:e.to}:{as:`button`,type:`button`},i=[e.danger&&`danger`,_.includes(e.hiddenFrom)&&`wui-hidden-from-${e.hiddenFrom}`].filter(Boolean).join(` `)||void 0;return/* @__PURE__ */ g(m.Item,{...r,onClick:e.onClick,className:i,"aria-keyshortcuts":t(e.shortcut),children:[e.image?/* @__PURE__ */ h(`img`,{src:e.image,alt:``}):a(e.icon,{size:16}),e.label,n(e.shortcut)]},e.key)})})]})}var T=u(function({icon:e,iconSize:t=20,btnClassName:n=`topbar-icon-btn`,trigger:r,"aria-label":a,className:o,...s},c){return/* @__PURE__ */ h(`button`,{ref:c,type:`button`,className:n,"aria-label":a,...s,children:r??/* @__PURE__ */ h(i,{name:e,size:t})})});export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{formatDate as i,toInstant as a}from"@webority/ui-elements/helpers";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=864e5,l=198e5,u=14,d=[`days`,`due`],f=e=>Math.floor((e+l)/c),p=(...e)=>e.filter(Boolean).join(` `),m=(e,t)=>e===`due`?t===0?`Due today`:t===1?`Due tomorrow`:`Due in ${t} days`:t===1?`1 day left`:`${t} days left`;function h(l){let{marker:h,props:g}=e(`AppDueDate`,l),{date:_,soonDays:v,soonWording:y=`days`,icon:b=!1,overdue:x=!1,overdueLabel:S,className:C=``,...w}=g;r(`AppDueDate`,w),n(`AppDueDate`,`soonWording`,y,d);let T=a(_);if(!Number.isFinite(T))return/* @__PURE__ */ o(`wui-due-date`,{class:p(`wui-due-date`,`wui-due-date-empty`,C),...h,...w,children:/* @__PURE__ */ o(`time`,{children:`Not set`})});let E=f(T),D=(/* @__PURE__ */ new Date(E*c)).toISOString().slice(0,10),O=E-f(Date.now()),k=b?/* @__PURE__ */ o(t,{name:`calendar`,size:u}):null;if(x){let e=i(T);return/* @__PURE__ */ s(`wui-due-date`,{class:p(`wui-due-date`,`wui-due-date-danger`,C),title:`Overdue since ${e}`,...h,...w,children:[/* @__PURE__ */ o(t,{name:`danger`,size:u}),k,/* @__PURE__ */ o(`time`,{dateTime:D,children:S||e})]})}return Number.isFinite(v)&&O>=0&&O<=v?/* @__PURE__ */ s(`wui-due-date`,{class:p(`wui-due-date`,`wui-due-date-warning`,C),...h,...w,children:[k,/* @__PURE__ */ o(`time`,{dateTime:D,children:m(y,O)})]}):/* @__PURE__ */ s(`wui-due-date`,{class:p(`wui-due-date`,C),...h,...w,children:[k,/* @__PURE__ */ o(`time`,{dateTime:D,children:i(T)})]})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import t,{ILLUSTRATION_NAMES as n}from"../lib/emptyIllustration.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./renderIconProp.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`md`,`sm`],u=[`card`,`table`],d=!1;function f(f){let{marker:p,props:m}=r(`AppEmptyState`,f),{icon:h,illustration:g,iconSize:_=24,size:v=`md`,variant:y=`card`,title:b,text:x,action:S,className:C=``,style:w,...T}=m;o(`AppEmptyState`,T),a(`AppEmptyState`,`size`,v,l),a(`AppEmptyState`,`variant`,y,u),y===`table`&&v===`sm`&&!d&&(d=!0,e(`[@webority/ui-react] <AppEmptyState> size="sm" has no table look; variant="table" uses the md scale.`)),typeof g==`string`&&a(`AppEmptyState`,`illustration`,g,n);let E=typeof g==`string`&&n.includes(g),D=g!=null&&typeof g!=`string`?g:null,O=[`empty-state`,v===`sm`?`empty-state-sm`:``,y===`table`?`wui-empty-state-table`:``,C].filter(Boolean).join(` `);return/* @__PURE__ */ c(`div`,{className:O,style:w,...p,...T,children:[E?/* @__PURE__ */ s(t,{name:g,className:`wui-empty-illustration`}):null,D?/* @__PURE__ */ s(`span`,{className:`wui-empty-illustration wui-empty-illustration-custom`,"aria-hidden":`true`,children:D}):null,h&&!E&&!D?/* @__PURE__ */ s(`div`,{className:`empty-state-icon`,children:i(h,{size:_})}):null,b!=null&&/* @__PURE__ */ s(`div`,{className:`empty-state-title`,children:b}),x!=null&&/* @__PURE__ */ s(`div`,{className:`empty-state-message`,children:x}),S&&/* @__PURE__ */ s(`div`,{className:`empty-state-action`,children:S})]})}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../lib/focusField.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnUnknownProps.js";import{useEffect as r,useId as i,useRef as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(c){let{marker:l,props:u}=t(`AppErrorSummary`,c),{errors:d=[],title:f,autoFocus:p=!0,id:m,className:h=``,...g}=u;n(`AppErrorSummary`,g);let _=i(),v=m||_,y=a(null),b=a(0),x=d.length;return r(()=>{p&&x>0&&b.current===0&&y.current?.focus(),b.current=x},[x,p]),x?/* @__PURE__ */ s(`div`,{ref:y,className:[`alert alert-danger wui-error-summary`,h].filter(Boolean).join(` `),role:`alert`,tabIndex:-1,"aria-labelledby":`${v}-title`,id:v,"data-autofocus":p?``:void 0,...l,...g,children:[/* @__PURE__ */ o(`h2`,{className:`wui-error-summary-title`,id:`${v}-title`,children:f??`Fix ${x} field${x>1?`s`:``} to continue`}),/* @__PURE__ */ o(`ul`,{className:`wui-error-summary-list`,children:d.map(t=>/* @__PURE__ */ o(`li`,{children:/* @__PURE__ */ o(`a`,{href:`#${t.field}`,onClick:n=>{n.preventDefault(),e(t.field)},children:t.message})},`${t.field}:${t.message}`))})]}):null}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../lib/FieldMessage.js";import t from"../lib/FileItemRow.js";import{keyOf as n,linkOf as r,nameOf as i,sizeLabelOf as a,uploadErrorOf as o,uploadProgressOf as s,useItemUrl as c}from"../lib/fileItem.js";import l from"../lib/useFileDrop.js";import{splitMarkerProps as u}from"../lib/wuiMarker.js";import d from"./AppIcon.js";import f from"./AppProgress.js";import p from"./warnUnknownProps.js";import{DEFAULT_IMAGE_ACCEPT as m,DEFAULT_MAX_SIZE_MB as h,acceptDroppedFiles as g,acceptLabel as _,isImageFile as v,isImageOnlyAccept as y}from"@webority/ui-elements/helpers";import{useId as b,useState as ee}from"react";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";function w(i){let{marker:a,props:o}=u(`AppFileAttachment`,i),{label:s=`Attachment`,value:c,name:f,onChange:_,multiple:w=!1,accept:D=m,maxSizeMb:O=h,optional:k=!1,validate:A=!0,error:j,id:M,...N}=o;p(`AppFileAttachment`,N);let P=b(),F=M||P,[I,L]=ee(``),R=w&&Array.isArray(c)?c:c?[c]:[],z=y(D),B=e=>e instanceof File?v(e):z||v(e),V=!w&&R.length===1&&B(R[0])&&(R[0]instanceof File||r(R[0])!==null),H=T(D,O),U=A?{accept:D,maxSizeMb:O,multiple:w}:{accept:``,maxSizeMb:0,multiple:w};function W(e){if(L(``),w){let t=Array.isArray(c)?c:c?[c]:[],r=new Set(t.map(n)),i=t.concat(e.filter(e=>!r.has(n(e))));_(i)}else _(e[0])}function G(e){if(!e.length)return;let{files:t,rejections:n}=g(e,U);t.length&&W(t),L(n[0]?.message??``)}let{dragOver:K,dropProps:q}=l({...U,disabled:N.disabled,onFiles:W,onReject:e=>L(e.message)});function J(e){let t=Array.from(e.target.files||[]);e.target.value=``,G(t)}function Y(e){L(``),_(w?R.filter((t,n)=>n!==e):null)}let X=j||I,Z=X?`${F}-error`:void 0,Q=w||R.length===0,$=z?`image`:`file`,te=w?`Add ${$}s`:`Add ${z?`an`:`a`} ${$}`;return/* @__PURE__ */ C(`div`,{...a,className:`field`,children:[/* @__PURE__ */ C(`label`,{className:`label`,htmlFor:F,children:[s,k&&/* @__PURE__ */ S(`span`,{className:`label-optional`,children:` (optional)`})]}),Q&&/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ C(`label`,{className:`attach-drop${K?` dragging`:``}`,htmlFor:F,...q,children:[/* @__PURE__ */ S(`span`,{className:`attach-drop-icon`,children:/* @__PURE__ */ S(d,{name:z?`image`:`file-text`,size:18})}),/* @__PURE__ */ C(`span`,{className:`attach-drop-copy`,children:[/* @__PURE__ */ S(`span`,{className:`attach-drop-title`,children:te}),H&&/* @__PURE__ */ S(`span`,{className:`attach-drop-hint`,children:H})]}),/* @__PURE__ */ S(`span`,{className:`attach-drop-cta`,children:`Browse`})]}),/* @__PURE__ */ S(`input`,{id:F,type:`file`,className:`visually-hidden`,name:f,accept:D||void 0,multiple:w||void 0,"aria-describedby":Z,onChange:J,...N})]}),V?/* @__PURE__ */ S(E,{item:R[0],isImage:!0,onRemove:()=>Y(0)}):R.length>0&&/* @__PURE__ */ S(`div`,{className:`attach-list`,children:R.map((e,r)=>/* @__PURE__ */ S(t,{item:e,isImage:B(e),onRemove:()=>Y(r)},n(e)))}),/* @__PURE__ */ S(e,{error:X,errorId:`${F}-error`})]})}function T(e,t){let n=e?.trim()?_(e):``,r=t>0?`up to ${t} MB`:``;return n&&r?`${n}, ${r}`:r?`Up to ${t} MB`:n}function E({item:e,isImage:t,onRemove:n}){let l=c(e,t),u=i(e),p=a(e),m=s(e),h=o(e),g=r(e);return/* @__PURE__ */ C(`div`,{className:h?`attach-preview wui-attach-failed`:`attach-preview`,children:[/* @__PURE__ */ C(`div`,{className:`attach-figure`,children:[/* @__PURE__ */ S(`img`,{src:l,alt:u}),/* @__PURE__ */ S(`button`,{type:`button`,className:`attach-remove`,"aria-label":`Remove attachment`,onClick:n,children:/* @__PURE__ */ S(d,{name:`x`,size:18})})]}),/* @__PURE__ */ C(`div`,{className:`attach-meta`,children:[/* @__PURE__ */ S(`div`,{className:`attach-name`,children:g?/* @__PURE__ */ S(`a`,{href:g,children:u}):u}),p&&/* @__PURE__ */ S(`div`,{className:`attach-size`,children:p})]}),m!==null&&/* @__PURE__ */ S(f,{value:m,size:`sm`,label:`Uploading ${u}`,className:`wui-attach-progress`}),h&&/* @__PURE__ */ S(`div`,{className:`wui-attach-error`,children:h})]})}export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import n from"../lib/FileItemRow.js";import{keyOf as r}from"../lib/fileItem.js";import i from"../lib/useFileDrop.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppIcon.js";import ee from"./AppRequiredMark.js";import te from"./AppSpinner.js";import ne from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import re from"./withTooltip.js";import{DEFAULT_MAX_SIZE_MB as ie,acceptDroppedFiles as ae,acceptLabel as c,isImageFile as l,isImageOnlyAccept as oe,isPdfFile as se}from"@webority/ui-elements/helpers";import{useEffect as u,useId as ce,useRef as le,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`dropzone`,`button`];function h(h){let{marker:ue,props:de}=a(`AppFilePicker`,h),{label:g,value:_,name:fe,id:pe,onPick:v,multiple:y=!1,variant:b=`dropzone`,buttonLabel:me=`Add file`,maxFiles:x,accept:S=`.jpg,.jpeg,.png`,maxSizeMb:C=ie,required:w,optional:T=!1,error:he,hint:E,loading:D=!1,className:O=``,fieldClassName:k=``,style:A,...j}=de;s(`AppFilePicker`,j),ne(`AppFilePicker`,`variant`,b,m);let[ge,M]=d(null),[_e,N]=d(null),[P,F]=d(``),I=le(null),ve=ce(),L=pe||ve;u(()=>{if(!y&&_ instanceof File&&l(_)){let e=URL.createObjectURL(_);return M(e),()=>URL.revokeObjectURL(e)}M(null)},[_,y]);let R=!y&&_&&!l(_)&&se(_)?_ instanceof File?_:_.url:null;u(()=>{if(!R){N(null);return}let t=!0,n=null;return import(`@webority/ui-elements/file-viewer`).then(e=>e.renderPdfFirstPage(typeof R==`string`?{url:R}:R)).then(e=>{t&&(n=URL.createObjectURL(e),N(n))}).catch(t=>e(`[AppFilePicker] the PDF preview failed:`,t?.message)),()=>{t=!1,N(null),n&&URL.revokeObjectURL(n)}},[R]);let z=y?Array.isArray(_)?_:_?[_]:[]:[],B=he||P,V=B?`${L}-error`:void 0,H=E&&!B?`${L}-hint`:void 0,ye=V||H,U=oe(S),be=b===`button`,W=!y&&!!_,G=W&&(_ instanceof File?l(_):U||l(_)),xe=_?.name,K=G?_?.url||ge:_e,q=G?`image`:`file`,Se=g?`Change ${g}`:`Change ${q}`,J=g?`Remove ${g}`:`Remove ${q}`,Ce=g?`${g} preview`:`Selected ${q} preview`,Y={accept:S,maxSizeMb:C,multiple:y},X=e=>{if(F(``),!y){v(e[0]);return}let t=Array.isArray(_)?_:_?[_]:[],n=new Set(t.map(r)),i=[];for(let t of e)n.has(r(t))||(n.add(r(t)),i.push(t));let a=t.concat(i);x&&a.length>x&&(a=a.slice(0,x),F(`Up to ${x} files.`)),v(a)},Z=e=>F(e.message),{dragOver:we,dropProps:Te}=i({...Y,disabled:D,onFiles:X,onReject:Z}),Ee=e=>{let{files:t,rejections:n}=ae(e,Y);t.length&&X(t),n.length&&Z(n[0])},De=e=>Ee(e.target.files),Oe=e=>{F(``),v(z.filter((t,n)=>n!==e))},ke=()=>I.current?.click(),Q=D?/* @__PURE__ */ f(`span`,{className:`wui-file-busy`,children:/* @__PURE__ */ f(te,{size:`sm`})}):null,$=/* @__PURE__ */ f(`input`,{id:L,name:fe,ref:I,type:`file`,"aria-describedby":ye,accept:S,multiple:y||void 0,disabled:D||void 0,className:`visually-hidden`,onClick:e=>{e.currentTarget.value=``},onChange:De,...j});return/* @__PURE__ */ p(`div`,{...ue,className:`field${k?` ${k}`:``}`,children:[/* @__PURE__ */ p(`label`,{className:`label`,htmlFor:L,children:[g,T&&!w&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` (optional)`}),w&&/* @__PURE__ */ f(ee,{})]}),be?/* @__PURE__ */ p(`div`,{className:`file-input wui-file-input-button-field${B?` error`:``}${O?` ${O}`:``}`,style:A,"aria-busy":D||void 0,children:[/* @__PURE__ */ p(`label`,{htmlFor:L,className:`btn btn-outline-primary btn-sm`,children:[/* @__PURE__ */ f(o,{name:`paperclip`,size:16}),me]}),$,Q]}):W?/* @__PURE__ */ p(`div`,{className:`file-preview${B?` error`:``}${O?` ${O}`:``}`,style:A,"aria-busy":D||void 0,children:[/* @__PURE__ */ p(`button`,{type:`button`,className:`file-preview-open`,"aria-label":Se,onClick:ke,disabled:D,children:[K?/* @__PURE__ */ f(`img`,{src:K,alt:Ce,className:`file-preview-img`}):/* @__PURE__ */ p(`span`,{className:`file-preview-file`,children:[/* @__PURE__ */ f(o,{name:`file-text`,size:28}),/* @__PURE__ */ f(`span`,{className:`file-preview-file-name`,children:xe})]}),/* @__PURE__ */ f(`span`,{className:`file-preview-overlay`,children:/* @__PURE__ */ p(`span`,{className:`file-preview-cta`,children:[/* @__PURE__ */ f(o,{name:G?`image`:`file-text`,size:16}),` `,G?`Change image`:`Change file`]})})]}),re(/* @__PURE__ */ f(`button`,{type:`button`,className:`file-preview-remove`,"aria-label":J,onClick:()=>v(null),disabled:D,children:/* @__PURE__ */ f(o,{name:`x`,size:16})}),J),$,Q]}):/* @__PURE__ */ p(`div`,{className:`file-input file-input-tall${we?` dragging`:``}${B?` error`:``}${y&&z.length>0?` has-files`:``}${O?` ${O}`:``}`,style:A,"aria-busy":D||void 0,...Te,children:[/* @__PURE__ */ p(`label`,{htmlFor:L,className:`file-input-zone-label`,children:[/* @__PURE__ */ f(`span`,{className:`file-input-icon`,children:/* @__PURE__ */ f(o,{name:`upload`,size:24})}),/* @__PURE__ */ p(`span`,{className:`file-input-title`,children:[/* @__PURE__ */ f(`span`,{className:`browse`,children:`Click to upload`}),` or drag & drop`]}),/* @__PURE__ */ f(`span`,{className:`file-input-text`,children:C>0?`${c(S)}, up to ${C} MB`:c(S)})]}),$,Q,y&&z.length>0&&/* @__PURE__ */ f(`div`,{className:`attach-list`,children:z.map((e,t)=>/* @__PURE__ */ f(n,{item:e,isImage:e instanceof File?l(e):U||l(e),noun:`file`,onRemove:()=>Oe(t)},r(e)))})]}),/* @__PURE__ */ f(t,{error:B,hint:E,errorId:V,hintId:H})]})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{sizeLabelOf as e}from"../lib/fileItem.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnUnknownProps.js";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";function o(e){let t=e.lastIndexOf(`.`),n=t>0?e.slice(t+1):``;return n.length>0?n.slice(0,4).toUpperCase():`FILE`}function s(t){let n=e({sizeBytes:t.sizeBytes});return n&&t.meta?/* @__PURE__ */ a(r,{children:[n,` · `,t.meta]}):n||t.meta||null}function c(e){let{marker:c,props:l}=t(`AppFileTiles`,e),{label:u,files:d=[],className:f=``,...p}=l;if(n(`AppFileTiles`,p),d.some(e=>!e.name))throw Error(`<AppFileTiles> each file needs a name.`);let m=[`wui-file-tiles`,f].filter(Boolean).join(` `);return/* @__PURE__ */ i(`ul`,{className:m,"aria-label":u,...c,...p,children:d.map(e=>{let t=s(e),n=/* @__PURE__ */ a(r,{children:[/* @__PURE__ */ i(`span`,{className:`wui-file-tile-ext`,"aria-hidden":`true`,children:o(e.name)}),/* @__PURE__ */ a(`span`,{className:`wui-file-tile-text`,children:[/* @__PURE__ */ i(`span`,{className:`wui-file-tile-name`,children:e.name}),t?/* @__PURE__ */ i(`span`,{className:`wui-file-tile-meta`,children:t}):null]})]});return/* @__PURE__ */ i(`li`,{children:e.href?/* @__PURE__ */ i(`a`,{className:`wui-file-tile`,href:e.href,children:n}):/* @__PURE__ */ i(`div`,{className:`wui-file-tile`,children:n})},e.key)})})}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{forwardRef as n,useCallback as r,useEffect as i,useLayoutEffect as a,useRef as o,useState as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import{createPortal as d}from"react-dom";import"@webority/ui-elements/file-viewer";var f=`wui-file-viewer:load`,p=`wui-file-viewer:error`,m=`wui-file-viewer:prefs-change`,h=n(function(n,h){let{marker:g,props:_}=e(`AppFileViewer`,n),{src:v,name:y,type:b,prefs:x,onPrefsChange:S,viewKey:C,download:w=!1,print:T=!0,workerSrc:E,assetBase:D,captions:O,actions:k,onLoad:A,onError:j,className:M=``,style:N,...P}=_;t(`AppFileViewer`,P);let F=o(null),I=o(A),L=o(j),R=o(S),[z,B]=s(null),V=r(e=>{F.current=e,typeof h==`function`?h(e):h&&(h.current=e)},[h]);a(()=>{x!==void 0&&(F.current.prefs=x)},[x]),i(()=>{I.current=A,L.current=j,R.current=S}),i(()=>{let e=F.current,t=e=>I.current?.(e.detail),n=e=>L.current?.(e.detail),r=e=>R.current?.(e.detail);return e.addEventListener(f,t),e.addEventListener(p,n),e.addEventListener(m,r),()=>{e.removeEventListener(f,t),e.removeEventListener(p,n),e.removeEventListener(m,r)}},[]),i(()=>{let e=F.current;e?.isConnected&&B(e.actionsContainer)},[]);let H=N&&N.height!==void 0&&N.minHeight===void 0?{...N,minHeight:0}:N;return u(c,{children:[l(`wui-file-viewer`,{ref:V,src:v,name:y||void 0,type:b||void 0,"view-key":C||void 0,download:w?``:void 0,print:T?void 0:`false`,"worker-src":E||void 0,"asset-base":D||void 0,captions:O||void 0,className:M||void 0,style:H,...g,...P}),z&&k!=null&&d(l(`div`,{slot:`actions`,className:`wui-file-viewer-slot`,children:k}),z)]})});export{h as default};
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{forwardRef as n,useCallback as r,useEffect as i,useLayoutEffect as a,useRef as o,useState as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import{createPortal as d}from"react-dom";import"@webority/ui-elements/file-viewer";var f=`wui-file-viewer:load`,p=`wui-file-viewer:error`,m=`wui-file-viewer:prefs-change`,h=n(function(n,h){let{marker:g,props:_}=e(`AppFileViewer`,n),{src:v,name:y,type:b,prefs:x,onPrefsChange:S,viewKey:C,download:w=!1,print:T=!0,workerSrc:E,assetBase:D,captions:O,actions:k,onLoad:A,onError:j,className:M=``,style:N,...P}=_;t(`AppFileViewer`,P);let F=o(null),I=o(A),L=o(j),R=o(S),[z,B]=s(null),V=r(e=>{F.current=e,typeof h==`function`?h(e):h&&(h.current=e)},[h]);a(()=>{x!==void 0&&(F.current.prefs=x)},[x]),i(()=>{I.current=A,L.current=j,R.current=S}),i(()=>{let e=F.current,t=e=>I.current?.(e.detail),n=e=>L.current?.(e.detail),r=e=>R.current?.(e.detail);return e.addEventListener(f,t),e.addEventListener(p,n),e.addEventListener(m,r),()=>{e.removeEventListener(f,t),e.removeEventListener(p,n),e.removeEventListener(m,r)}},[]),i(()=>{let e=F.current;e?.isConnected&&B(e.actionsContainer)},[]);let H=N&&N.height!==void 0&&N.minHeight===void 0?{...N,minHeight:0}:N;return/* @__PURE__ */ u(c,{children:[/* @__PURE__ */ l(`wui-file-viewer`,{ref:V,src:v,name:y||void 0,type:b||void 0,"view-key":C||void 0,download:w?``:void 0,print:T?void 0:`false`,"worker-src":E||void 0,"asset-base":D||void 0,captions:O||void 0,className:M||void 0,style:H,...g,...P}),z&&k!=null&&d(/* @__PURE__ */ l(`div`,{slot:`actions`,className:`wui-file-viewer-slot`,children:k}),z)]})});export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import{emptyFacetValue as t,isFacetActive as n}from"../lib/listQuery.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppButton.js";import a from"./AppChip.js";import o from"./AppDateRangePicker.js";import ee from"./AppIcon.js";import s from"./AppMultiSelect.js";import c from"./AppSearch.js";import l from"./AppSegmented.js";import u from"./AppSelect.js";import te from"./AppSwitch.js";import d from"./warnInvalidValue.js";import f from"./warnUnknownProps.js";import{Fragment as ne,useEffect as p,useId as m,useRef as h,useState as re,useSyncExternalStore as ie}from"react";import{Fragment as ae,jsx as g,jsxs as _}from"react/jsx-runtime";import"@webority/ui-elements/elements/filter-popover";var v=`(max-width: 575.98px)`,y=3,b=2,x=e=>{let t=window.matchMedia?.(v);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},oe=()=>window.matchMedia?.(v).matches??!1,se=[`enum`,`multiEnum`,`dateRange`,`text`],S=4,ce=e=>(e.type===`enum`||e.type===`multiEnum`)&&!e.options?.length,C=(e,t)=>e.options?.find(e=>e.value===t)?.label??t,w=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function T(e,r){if(e.required||!n(e,r))return[];if(e.type===`enum`)return[{id:e.key,text:C(e,r),clear:()=>t(e)}];if(e.type===`multiEnum`)return r.map(t=>({id:`${e.key}:${t}`,text:C(e,t),clear:()=>r.filter(e=>e!==t)}));if(e.type===`dateRange`){let n=r.from&&r.to?`${r.from} to ${r.to}`:r.from?`From ${r.from}`:`Until ${r.to}`;return[{id:e.key,text:n,clear:()=>t(e)}]}return[]}var E=/* @__PURE__ */ new Set;function le(t){let n=!0;try{n=process.env.NODE_ENV!==`production`}catch{n=!0}n&&!E.has(t)&&(E.add(t),e(`[@webority/ui-react] <AppFilterBar> facet "${t}" sets allLabel, which only an enum facet uses.`))}var D=/* @__PURE__ */ new Set;function ue(t){let n=!0;try{n=process.env.NODE_ENV!==`production`}catch{n=!0}n&&!D.has(t)&&(D.add(t),e(`[@webority/ui-react] <AppFilterBar> facet "${t}" sets required, which only an enum facet uses.`))}var O=/* @__PURE__ */ new Set;function de(t){let n=!0;try{n=process.env.NODE_ENV!==`production`}catch{n=!0}n&&!O.has(t)&&(O.add(t),e(`[@webority/ui-react] <AppFilterBar> facet "${t}" sets allLabel and required; a required facet has no All segment.`))}var k=/* @__PURE__ */ new Set;function fe(t){let n=!0;try{n=process.env.NODE_ENV!==`production`}catch{n=!0}n&&!k.has(t)&&(k.add(t),e(`[@webority/ui-react] <AppFilterBar> facet "${t}" sets presets, which only a dateRange facet uses.`))}function A(e){let{marker:o,props:s}=r(`AppFilterBar`,e),{facets:c,value:l,onChange:u,inline:v=y,floating:S=!1,apply:C=!1,className:E=``,...D}=s;f(`AppFilterBar`,D);let O=ie(x,oe,()=>!1),k=h(null),A=m(),[M,N]=re({}),P=h(l);for(let e of c)d(`AppFilterBar`,`facets[].type`,e.type,se);for(let e of c)e.allLabel!=null&&e.type!==`enum`&&le(e.key),e.required&&e.type!==`enum`&&ue(e.key),e.required&&e.allLabel!=null&&de(e.key),e.presets!=null&&e.type!==`dateRange`&&fe(e.key);let F=c.filter(e=>!ce(e)),I=F.flatMap(e=>T(e,l[e.key]).map(t=>({...t,facet:e}))),L=F.filter(e=>!e.required&&n(e,l[e.key])),R=S||O?0:Math.max(0,v),z=F.slice(R),B=z.filter(e=>L.includes(e)).length,V=!S&&z.length>0;p(()=>{if(!V)return;let e=e=>{let t=k.current;t?.open&&(e.type===`keydown`?e.key===`Escape`:!e.composedPath().includes(t))&&(t.open=!1)};return document.addEventListener(`click`,e),document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`click`,e),document.removeEventListener(`keydown`,e)}},[V]),p(()=>{let e=P.current;P.current=l,N(t=>{let n=Object.entries(t).filter(([t])=>w(e[t],l[t]));return n.length===Object.keys(t).length?t:Object.fromEntries(n)})},[l]);let H=e=>C&&!S&&(e.type===`text`||e.type===`dateRange`),U=e=>H(e)&&Object.hasOwn(M,e.key)?M[e.key]:l[e.key],W=e=>t=>H(e)?N(n=>({...n,[e.key]:t})):u(e.key,t),G=()=>{for(let[e,t]of Object.entries(M))u(e,t);N({})},pe=e=>{e.key===`Enter`&&G()},me=e=>{e.preventDefault(),G()},K=(e,t)=>e.type===`text`&&H(e)?/* @__PURE__ */ g(`span`,{onKeyDownCapture:pe,children:t}):t,he=e=>/* @__PURE__ */ g(ne,{children:K(e,/* @__PURE__ */ g(j,{facet:e,value:U(e),onChange:W(e)}))},e.key),q=e=>/* @__PURE__ */ _(`div`,{className:`wui-filter-popover-field`,children:[/* @__PURE__ */ g(`span`,{className:`label`,"aria-hidden":`true`,children:e.label}),K(e,/* @__PURE__ */ g(j,{facet:e,value:U(e),onChange:W(e),floating:!0}))]},e.key),J=(e,t)=>t>0&&/* @__PURE__ */ g(`span`,{className:e,children:` (${t})`}),Y=e=>/* @__PURE__ */ g(a,{size:`sm`,label:`${e.facet.label}: ${e.text}`,removeLabel:`Remove ${e.facet.label} filter ${e.text}`,onRemove:()=>u(e.facet.key,e.clear()),className:!S&&F.indexOf(e.facet)<R?`wui-filter-chip-inline`:void 0},e.id),X=/* @__PURE__ */ g(i,{variant:`ghost`,size:`sm`,onClick:()=>{for(let e of L)u(e.key,t(e));N({})},children:`Clear all`});if(S){let e=I.slice(b),t=L.length;return/* @__PURE__ */ _(`div`,{className:`wui-filter-bar d-flex flex-wrap align-items-center gap-2${E?` ${E}`:``}`,...o,...D,children:[/* @__PURE__ */ _(`wui-filter-popover`,{class:`wui-filter-popover`,children:[/* @__PURE__ */ _(i,{variant:t>0?`outline`:`ghost`,size:`sm`,leftIcon:`filter`,className:`wui-filter-popover-trigger`,"aria-expanded":`false`,"aria-controls":A,"aria-label":t>0?`Filters, ${t} active`:void 0,children:[`Filters`,t>0&&/* @__PURE__ */ g(`span`,{className:`badge rounded-pill text-bg-primary ms-1`,children:t})]}),/* @__PURE__ */ _(`div`,{id:A,className:`wui-filter-popover-panel`,role:`dialog`,"aria-label":`Filters`,hidden:!0,children:[/* @__PURE__ */ _(`div`,{className:`wui-filter-popover-head`,children:[/* @__PURE__ */ g(`span`,{className:`wui-filter-popover-title`,children:`Filters`}),/* @__PURE__ */ g(te,{label:`Keep open`,id:`${A}-pin`})]}),/* @__PURE__ */ g(`div`,{className:`wui-filter-popover-grid`,children:F.map(q)}),/* @__PURE__ */ _(`div`,{className:`wui-filter-popover-foot`,children:[/* @__PURE__ */ g(`span`,{className:`wui-filter-popover-note`,children:`Changes apply at once.`}),t>0&&X]})]})]}),I.slice(0,b).map(Y),e.length>0&&/* @__PURE__ */ _(`span`,{className:`chip chip-sm wui-filter-popover-more`,title:e.map(e=>`${e.facet.label}: ${e.text}`).join(`, `),children:[`+`,e.length]})]})}let Z=`wui-filter-bar d-flex flex-wrap align-items-center gap-2${O&&V?` wui-filter-bar--folded`:``}`,Q=e=>`${e}${E?` ${E}`:``}`,$=/* @__PURE__ */ _(ae,{children:[F.slice(0,R).map(he),V&&/* @__PURE__ */ _(`details`,{ref:k,className:`wui-filter-more`,children:[/* @__PURE__ */ _(`summary`,{className:`btn btn-outline-primary btn-sm wui-filter-more-trigger`,children:[/* @__PURE__ */ g(ee,{name:`filter`,size:14,className:`me-2`}),`Filters`,J(`wui-filter-count-desktop`,B),J(`wui-filter-count-phone`,L.length)]}),/* @__PURE__ */ _(`div`,{className:`wui-filter-more-panel`,children:[/* @__PURE__ */ g(`div`,{className:`wui-filter-more-head`,children:`Filters`}),z.map(q)]})]}),I.map(Y),L.length>0&&X]});return!C||!F.some(e=>e.type===`text`||e.type===`dateRange`)?/* @__PURE__ */ g(`div`,{className:Q(Z),...o,...D,children:$}):/* @__PURE__ */ _(`div`,{className:Q(`wui-filter-form d-flex flex-wrap align-items-center gap-2`),...o,...D,children:[/* @__PURE__ */ g(`div`,{className:Z,children:$}),/* @__PURE__ */ g(i,{type:`submit`,size:`sm`,onClick:me,children:`Apply`})]})}function j({facet:e,value:t,onChange:n,floating:r=!1}){if(e.type===`enum`){let i=e.options??[];return(e.required?i.length<=S:i.length<S)?/* @__PURE__ */ g(l,{label:e.label,name:e.key,size:`sm`,value:t??``,onChange:n,options:e.required?i:[{value:``,label:e.allLabel||`All`},...i]}):/* @__PURE__ */ g(u,{"aria-label":e.label,name:e.key,placeholder:r?`Any`:e.label,clearable:!e.required,size:`sm`,value:t??``,onChange:n,options:i})}return e.type===`multiEnum`?/* @__PURE__ */ g(s,{"aria-label":e.label,name:e.key,placeholder:r?`Any`:e.label,size:`sm`,collapseChips:!0,values:t??[],onChange:n,options:e.options??[]}):e.type===`dateRange`?/* @__PURE__ */ g(o,{ariaLabel:e.label,startName:`${e.key}From`,endName:`${e.key}To`,placeholder:r?`Any`:e.label,size:`sm`,presets:e.presets,start:t?.from??``,end:t?.to??``,onChange:e=>n({from:e.start??``,to:e.end??``})}):/* @__PURE__ */ g(c,{ariaLabel:e.label,name:e.key,placeholder:e.label,size:`sm`,value:t??``,onChange:n})}export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./renderIconProp.js";import n from"./warnUnknownProps.js";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";import"@webority/ui-elements/elements/dock";function o(o){let{marker:s,props:c}=e(`AppFloatingDock`,o),{items:l=[],linkComponent:u,ariaLabel:d=`Quick navigation`,magnify:f=!0,maxScale:p,radius:m,className:h=``,...g}=c;return n(`AppFloatingDock`,g),/* @__PURE__ */ i(`wui-dock`,{role:`navigation`,"aria-label":d,static:f?void 0:``,"max-scale":p??void 0,radius:m??void 0,class:h||void 0,...s,...g,children:l.map((e,n)=>{let o=e.key??`${e.title}-${n}`,s=/* @__PURE__ */ a(r,{children:[/* @__PURE__ */ i(`span`,{className:`dock-item-tip`,"aria-hidden":`true`,children:e.title}),/* @__PURE__ */ i(`span`,{className:`dock-item-icon`,children:t(e.icon,{size:18})})]});if(e.to&&u)return/* @__PURE__ */ i(u,{className:`dock-item`,to:e.to,"aria-label":e.title,children:s},o);let c=e.href??e.to;return c?/* @__PURE__ */ i(`a`,{className:`dock-item`,href:c,"aria-label":e.title,children:s},o):/* @__PURE__ */ i(`button`,{type:`button`,className:`dock-item`,onClick:e.onClick,"aria-label":e.title,children:s},o)})})}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i=[`end`,`start`,`between`];function a(a){let{marker:o,props:s}=e(`AppFormActions`,a),{children:c,sticky:l=!1,align:u=`end`,className:d=``,...f}=s;
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i=[`end`,`start`,`between`];function a(a){let{marker:o,props:s}=e(`AppFormActions`,a),{children:c,sticky:l=!1,align:u=`end`,className:d=``,...f}=s;n(`AppFormActions`,f),t(`AppFormActions`,`align`,u,i);let p=[`form-actions`,l?`form-actions-sticky`:``,u&&u!==`end`?`form-actions-${u}`:``,d].filter(Boolean).join(` `);return/* @__PURE__ */ r(`div`,{className:p,...o,...f,children:c})}export{a as default};
|