@webority/ui-react 0.83.4 → 0.84.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/dist/components/AppAccordion.js +1 -1
  2. package/dist/components/AppActionIcon.js +1 -1
  3. package/dist/components/AppAlert.js +1 -1
  4. package/dist/components/AppAsyncBlock.js +1 -1
  5. package/dist/components/AppAutocomplete.js +1 -1
  6. package/dist/components/AppAvatar.js +1 -1
  7. package/dist/components/AppAvatarGroup.js +1 -1
  8. package/dist/components/AppAvatarPicker.js +1 -1
  9. package/dist/components/AppBadge.js +1 -1
  10. package/dist/components/AppBanner.js +1 -1
  11. package/dist/components/AppBreadcrumbs.js +1 -1
  12. package/dist/components/AppButton.js +1 -1
  13. package/dist/components/AppButtonGroup.js +1 -1
  14. package/dist/components/AppCalendar.js +1 -1
  15. package/dist/components/AppCard.js +1 -1
  16. package/dist/components/AppCarousel.js +1 -1
  17. package/dist/components/AppChart.js +1 -1
  18. package/dist/components/AppChartCard.js +1 -1
  19. package/dist/components/AppCheckbox.js +1 -1
  20. package/dist/components/AppChip.js +1 -1
  21. package/dist/components/AppChipGroup.js +1 -1
  22. package/dist/components/AppChoiceCard.js +1 -1
  23. package/dist/components/AppChoiceChip.js +1 -1
  24. package/dist/components/AppCodeBlock.js +1 -1
  25. package/dist/components/AppColorField.js +1 -1
  26. package/dist/components/AppColumnMenu.js +1 -1
  27. package/dist/components/AppCommandPalette.js +1 -1
  28. package/dist/components/AppCommentThread.js +1 -1
  29. package/dist/components/AppCompareTable.js +1 -1
  30. package/dist/components/AppConfirmDialog.js +1 -1
  31. package/dist/components/AppConsentBanner.js +1 -1
  32. package/dist/components/AppContextMenu.js +1 -1
  33. package/dist/components/AppCopyButton.js +1 -1
  34. package/dist/components/AppCountrySelect.js +1 -1
  35. package/dist/components/AppDashboardCell.js +1 -1
  36. package/dist/components/AppDashboardGrid.js +1 -1
  37. package/dist/components/AppDataTable.js +1 -1
  38. package/dist/components/AppDatePicker.js +1 -1
  39. package/dist/components/AppDateRangePicker.js +1 -1
  40. package/dist/components/AppDescriptions.js +1 -1
  41. package/dist/components/AppDrawer.js +1 -1
  42. package/dist/components/AppDropZone.js +1 -1
  43. package/dist/components/AppDropdown.js +1 -1
  44. package/dist/components/AppDueDate.js +1 -1
  45. package/dist/components/AppEmptyState.js +1 -1
  46. package/dist/components/AppErrorSummary.js +1 -1
  47. package/dist/components/AppFileAttachment.js +1 -1
  48. package/dist/components/AppFilePicker.js +1 -1
  49. package/dist/components/AppFileViewer.js +1 -1
  50. package/dist/components/AppFilterBar.js +1 -1
  51. package/dist/components/AppFloatingDock.js +1 -1
  52. package/dist/components/AppFormActions.js +1 -1
  53. package/dist/components/AppFormRow.js +1 -1
  54. package/dist/components/AppFormSection.js +1 -1
  55. package/dist/components/AppHoverCard.js +1 -1
  56. package/dist/components/AppIcon.js +1 -1
  57. package/dist/components/AppInfoList.js +1 -1
  58. package/dist/components/AppInfoTip.js +1 -1
  59. package/dist/components/AppInlineEdit.js +1 -1
  60. package/dist/components/AppInput.js +1 -1
  61. package/dist/components/AppInputGroup.js +1 -1
  62. package/dist/components/AppKanban.js +1 -1
  63. package/dist/components/AppKbd.js +1 -1
  64. package/dist/components/AppKpiTile.js +1 -1
  65. package/dist/components/AppLightbox.js +1 -1
  66. package/dist/components/AppLink.js +1 -1
  67. package/dist/components/AppLogoPicker.js +1 -1
  68. package/dist/components/AppMarkdown.js +1 -0
  69. package/dist/components/AppMentionInput.js +1 -1
  70. package/dist/components/AppMenubar.js +1 -1
  71. package/dist/components/AppMeter.js +1 -1
  72. package/dist/components/AppMetricStrip.js +1 -1
  73. package/dist/components/AppModal.js +1 -1
  74. package/dist/components/AppMultiSelect.js +1 -1
  75. package/dist/components/AppNavigationMenu.js +1 -1
  76. package/dist/components/AppNotificationCenter.js +1 -1
  77. package/dist/components/AppNumberInput.js +1 -1
  78. package/dist/components/AppOnboardingChecklist.js +1 -1
  79. package/dist/components/AppOtpInput.js +1 -1
  80. package/dist/components/AppPageHeader.js +1 -1
  81. package/dist/components/AppPagination.js +1 -1
  82. package/dist/components/AppPhoneNumberInput.js +1 -1
  83. package/dist/components/AppPricingCard.js +1 -1
  84. package/dist/components/AppProgress.js +1 -1
  85. package/dist/components/AppQrCode.js +1 -1
  86. package/dist/components/AppRadio.js +1 -1
  87. package/dist/components/AppRadioGroup.js +1 -1
  88. package/dist/components/AppRating.js +1 -1
  89. package/dist/components/AppRecordPager.js +1 -1
  90. package/dist/components/AppRelativeTime.js +1 -1
  91. package/dist/components/AppRepeater.js +1 -1
  92. package/dist/components/AppRequiredMark.js +1 -1
  93. package/dist/components/AppResizable.js +1 -1
  94. package/dist/components/AppResizableHandle.js +1 -1
  95. package/dist/components/AppResizablePanel.js +1 -1
  96. package/dist/components/AppResourceCard.js +1 -1
  97. package/dist/components/AppResult.js +1 -1
  98. package/dist/components/AppRichText.js +1 -1
  99. package/dist/components/AppRollingNumber.js +1 -1
  100. package/dist/components/AppRouteError.js +1 -1
  101. package/dist/components/AppScoreScale.js +1 -1
  102. package/dist/components/AppScrollbar.js +1 -1
  103. package/dist/components/AppSearch.js +1 -1
  104. package/dist/components/AppSectionCallToAction.js +1 -1
  105. package/dist/components/AppSectionFaq.js +1 -1
  106. package/dist/components/AppSectionFeatures.js +1 -1
  107. package/dist/components/AppSectionHero.js +1 -1
  108. package/dist/components/AppSectionLogos.js +1 -1
  109. package/dist/components/AppSectionPricing.js +1 -1
  110. package/dist/components/AppSectionTestimonials.js +1 -1
  111. package/dist/components/AppSegmented.js +1 -1
  112. package/dist/components/AppSelect.js +1 -1
  113. package/dist/components/AppSelectMini.js +1 -1
  114. package/dist/components/AppShell.js +1 -1
  115. package/dist/components/AppShortcutLegend.js +1 -1
  116. package/dist/components/AppShowMore.js +1 -1
  117. package/dist/components/AppSidebarMenu.js +1 -1
  118. package/dist/components/AppSkeleton.js +1 -1
  119. package/dist/components/AppSlider.js +1 -1
  120. package/dist/components/AppSortableList.js +1 -1
  121. package/dist/components/AppSparkline.js +1 -1
  122. package/dist/components/AppSpinner.js +1 -1
  123. package/dist/components/AppSplash.js +1 -1
  124. package/dist/components/AppSplitButton.js +1 -1
  125. package/dist/components/AppSplitView.js +1 -1
  126. package/dist/components/AppStatusBadge.js +1 -1
  127. package/dist/components/AppStepper.js +1 -1
  128. package/dist/components/AppSwitch.js +1 -1
  129. package/dist/components/AppTableEmptyState.js +1 -1
  130. package/dist/components/AppTablePagination.js +1 -1
  131. package/dist/components/AppTableToolbar.js +1 -1
  132. package/dist/components/AppTabs.js +1 -1
  133. package/dist/components/AppTagInput.js +1 -1
  134. package/dist/components/AppTextarea.js +1 -1
  135. package/dist/components/AppThemeToggle.js +1 -1
  136. package/dist/components/AppTimePicker.js +1 -1
  137. package/dist/components/AppTimeline.js +1 -1
  138. package/dist/components/AppToast.js +1 -1
  139. package/dist/components/AppToolbar.js +1 -1
  140. package/dist/components/AppTour.js +1 -1
  141. package/dist/components/AppTreeView.js +1 -1
  142. package/dist/components/AppTruncate.js +1 -1
  143. package/dist/components/AppUpdateBar.js +1 -1
  144. package/dist/components/AppWhatsNew.js +1 -1
  145. package/dist/components/AppWizard.js +1 -1
  146. package/dist/components/AppWorkspaceSwitcher.js +1 -1
  147. package/dist/lib/CheckField.js +1 -1
  148. package/dist/lib/wuiMarker.js +1 -0
  149. package/dist/types/components/AppAccordion.d.ts +1 -1
  150. package/dist/types/components/AppActionIcon.d.ts +1 -1
  151. package/dist/types/components/AppAlert.d.ts +1 -1
  152. package/dist/types/components/AppAsyncBlock.d.ts +1 -1
  153. package/dist/types/components/AppAvatar.d.ts +1 -1
  154. package/dist/types/components/AppAvatarGroup.d.ts +1 -8
  155. package/dist/types/components/AppAvatarPicker.d.ts +1 -1
  156. package/dist/types/components/AppBadge.d.ts +1 -1
  157. package/dist/types/components/AppBanner.d.ts +1 -1
  158. package/dist/types/components/AppBreadcrumbs.d.ts +1 -1
  159. package/dist/types/components/AppButton.d.ts +1 -1
  160. package/dist/types/components/AppButtonGroup.d.ts +1 -1
  161. package/dist/types/components/AppCard.d.ts +1 -1
  162. package/dist/types/components/AppCarousel.d.ts +1 -1
  163. package/dist/types/components/AppChartCard.d.ts +1 -1
  164. package/dist/types/components/AppChip.d.ts +1 -1
  165. package/dist/types/components/AppChipGroup.d.ts +1 -1
  166. package/dist/types/components/AppChoiceCard.d.ts +1 -4
  167. package/dist/types/components/AppChoiceChip.d.ts +1 -1
  168. package/dist/types/components/AppCodeBlock.d.ts +1 -1
  169. package/dist/types/components/AppColorField.d.ts +1 -1
  170. package/dist/types/components/AppColumnMenu.d.ts +1 -1
  171. package/dist/types/components/AppCommandPalette.d.ts +1 -1
  172. package/dist/types/components/AppCommentThread.d.ts +1 -1
  173. package/dist/types/components/AppCompareTable.d.ts +1 -1
  174. package/dist/types/components/AppConfirmDialog.d.ts +1 -20
  175. package/dist/types/components/AppConsentBanner.d.ts +1 -1
  176. package/dist/types/components/AppContextMenu.d.ts +1 -1
  177. package/dist/types/components/AppCopyButton.d.ts +1 -1
  178. package/dist/types/components/AppDashboardCell.d.ts +1 -1
  179. package/dist/types/components/AppDashboardGrid.d.ts +1 -1
  180. package/dist/types/components/AppDataTable.d.ts +1 -1
  181. package/dist/types/components/AppDescriptions.d.ts +1 -1
  182. package/dist/types/components/AppDrawer.d.ts +1 -1
  183. package/dist/types/components/AppDropZone.d.ts +1 -1
  184. package/dist/types/components/AppDropdown.d.ts +1 -1
  185. package/dist/types/components/AppDueDate.d.ts +1 -1
  186. package/dist/types/components/AppEmptyState.d.ts +1 -1
  187. package/dist/types/components/AppErrorSummary.d.ts +1 -1
  188. package/dist/types/components/AppFileAttachment.d.ts +1 -3
  189. package/dist/types/components/AppFilePicker.d.ts +1 -1
  190. package/dist/types/components/AppFilterBar.d.ts +1 -1
  191. package/dist/types/components/AppFloatingDock.d.ts +1 -1
  192. package/dist/types/components/AppFormActions.d.ts +1 -1
  193. package/dist/types/components/AppFormRow.d.ts +1 -1
  194. package/dist/types/components/AppFormSection.d.ts +1 -1
  195. package/dist/types/components/AppHoverCard.d.ts +1 -1
  196. package/dist/types/components/AppIcon.d.ts +1 -1
  197. package/dist/types/components/AppInfoList.d.ts +1 -1
  198. package/dist/types/components/AppInfoTip.d.ts +1 -8
  199. package/dist/types/components/AppInlineEdit.d.ts +1 -1
  200. package/dist/types/components/AppInputGroup.d.ts +1 -1
  201. package/dist/types/components/AppKanban.d.ts +1 -1
  202. package/dist/types/components/AppKbd.d.ts +1 -1
  203. package/dist/types/components/AppKpiTile.d.ts +1 -1
  204. package/dist/types/components/AppLightbox.d.ts +1 -1
  205. package/dist/types/components/AppLink.d.ts +1 -15
  206. package/dist/types/components/AppLogoPicker.d.ts +1 -33
  207. package/dist/types/components/AppMarkdown.d.ts +24 -0
  208. package/dist/types/components/AppMenubar.d.ts +1 -1
  209. package/dist/types/components/AppMeter.d.ts +1 -1
  210. package/dist/types/components/AppMetricStrip.d.ts +1 -1
  211. package/dist/types/components/AppModal.d.ts +1 -1
  212. package/dist/types/components/AppNavigationMenu.d.ts +1 -1
  213. package/dist/types/components/AppNotificationCenter.d.ts +1 -1
  214. package/dist/types/components/AppOnboardingChecklist.d.ts +1 -1
  215. package/dist/types/components/AppPageHeader.d.ts +1 -1
  216. package/dist/types/components/AppPagination.d.ts +1 -1
  217. package/dist/types/components/AppPricingCard.d.ts +1 -1
  218. package/dist/types/components/AppProgress.d.ts +1 -1
  219. package/dist/types/components/AppQrCode.d.ts +1 -1
  220. package/dist/types/components/AppRadioGroup.d.ts +1 -1
  221. package/dist/types/components/AppRating.d.ts +1 -1
  222. package/dist/types/components/AppRecordPager.d.ts +1 -1
  223. package/dist/types/components/AppRelativeTime.d.ts +1 -1
  224. package/dist/types/components/AppRepeater.d.ts +1 -1
  225. package/dist/types/components/AppRequiredMark.d.ts +1 -1
  226. package/dist/types/components/AppResizable.d.ts +1 -1
  227. package/dist/types/components/AppResizableHandle.d.ts +1 -1
  228. package/dist/types/components/AppResizablePanel.d.ts +1 -1
  229. package/dist/types/components/AppResourceCard.d.ts +1 -1
  230. package/dist/types/components/AppResult.d.ts +1 -1
  231. package/dist/types/components/AppRollingNumber.d.ts +1 -1
  232. package/dist/types/components/AppRouteError.d.ts +1 -1
  233. package/dist/types/components/AppScoreScale.d.ts +1 -1
  234. package/dist/types/components/AppScrollbar.d.ts +1 -1
  235. package/dist/types/components/AppSearch.d.ts +1 -2
  236. package/dist/types/components/AppSectionCallToAction.d.ts +1 -1
  237. package/dist/types/components/AppSectionFaq.d.ts +1 -1
  238. package/dist/types/components/AppSectionFeatures.d.ts +1 -1
  239. package/dist/types/components/AppSectionHero.d.ts +1 -1
  240. package/dist/types/components/AppSectionLogos.d.ts +1 -1
  241. package/dist/types/components/AppSectionPricing.d.ts +1 -1
  242. package/dist/types/components/AppSectionTestimonials.d.ts +1 -1
  243. package/dist/types/components/AppSegmented.d.ts +1 -1
  244. package/dist/types/components/AppSelectMini.d.ts +1 -15
  245. package/dist/types/components/AppShell.d.ts +1 -1
  246. package/dist/types/components/AppShortcutLegend.d.ts +1 -1
  247. package/dist/types/components/AppShowMore.d.ts +1 -1
  248. package/dist/types/components/AppSidebarMenu.d.ts +1 -22
  249. package/dist/types/components/AppSkeleton.d.ts +1 -1
  250. package/dist/types/components/AppSparkline.d.ts +1 -1
  251. package/dist/types/components/AppSpinner.d.ts +1 -1
  252. package/dist/types/components/AppSplash.d.ts +1 -1
  253. package/dist/types/components/AppSplitButton.d.ts +1 -1
  254. package/dist/types/components/AppSplitView.d.ts +1 -1
  255. package/dist/types/components/AppStatusBadge.d.ts +1 -1
  256. package/dist/types/components/AppStepper.d.ts +1 -1
  257. package/dist/types/components/AppTableEmptyState.d.ts +1 -1
  258. package/dist/types/components/AppTablePagination.d.ts +1 -1
  259. package/dist/types/components/AppTableToolbar.d.ts +1 -1
  260. package/dist/types/components/AppTabs.d.ts +1 -1
  261. package/dist/types/components/AppThemeToggle.d.ts +1 -1
  262. package/dist/types/components/AppTimeline.d.ts +1 -1
  263. package/dist/types/components/AppToast.d.ts +1 -1
  264. package/dist/types/components/AppToolbar.d.ts +1 -1
  265. package/dist/types/components/AppTruncate.d.ts +1 -1
  266. package/dist/types/components/AppUpdateBar.d.ts +1 -1
  267. package/dist/types/components/AppWhatsNew.d.ts +1 -1
  268. package/dist/types/components/AppWorkspaceSwitcher.d.ts +1 -1
  269. package/dist/types/index.d.ts +1 -0
  270. package/dist/types/lib/wuiMarker.d.ts +26 -0
  271. package/dist/ui-react.js +1 -1
  272. package/package.json +3 -3
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./withTooltip.js";import r from"./AppActionIcon.js";import i from"./AppButton.js";import{COPY_FEEDBACK_MS as a,copyTextToClipboard as o}from"@webority/ui-elements/helpers";import{useCallback as s,useEffect as c,useRef as l,useState as u}from"react";import{jsx as d}from"react/jsx-runtime";var f={sm:14,md:16,lg:20};function p({text:p,label:m=`Copy`,copiedLabel:h=`Copied`,iconOnly:g=!1,size:_=`md`,variant:v=`ghost`,onCopied:y,className:b=``,tooltip:x,tooltipPlacement:S,...C}){t(`AppCopyButton`,C),e(`AppCopyButton`,`size`,_,Object.keys(f));let[w,T]=u(!1),E=l(null);c(()=>()=>clearTimeout(E.current),[]);let D=s(async()=>{await o(p)&&(T(!0),clearTimeout(E.current),E.current=setTimeout(()=>T(!1),a),y?.())},[p,y]),O=w?h:m,k=w?`check`:`files`;return n(g?d(r,{icon:k,label:O,size:f[_]??f.md,onClick:D,className:b,...C}):d(i,{leftIcon:k,variant:v,size:_,onClick:D,className:b,"aria-live":`polite`,...C,children:O}),x,S)}export{p as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./withTooltip.js";import i from"./AppActionIcon.js";import a from"./AppButton.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{text:h,label:g=`Copy`,copiedLabel:_=`Copied`,iconOnly:v=!1,size:y=`md`,variant:b=`ghost`,onCopied:x,className:S=``,tooltip:C,tooltipPlacement:w,...T}=m;n(`AppCopyButton`,T),t(`AppCopyButton`,`size`,y,Object.keys(p));let[E,D]=d(!1),O=u(null);l(()=>()=>clearTimeout(O.current),[]);let k=c(async()=>{await s(h)&&(D(!0),clearTimeout(O.current),O.current=setTimeout(()=>D(!1),o),x?.())},[h,x]),A=E?_:g,j=E?`check`:`files`;return r(v?f(i,{icon:j,label:A,size:p[y]??p.md,onClick:k,className:S,...T,...e(`AppCopyButton`,m)}):f(a,{leftIcon:j,variant:b,size:y,onClick:k,className:S,"aria-live":`polite`,...T,...e(`AppCopyButton`,m),children:A}),C,w)}export{m as default};
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"../lib/FieldMessage.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import a from"./useWuiControl.js";import{forwardRef as o,useId as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import"@webority/ui-elements/elements/country-select";var u=[`sm`,`md`,`lg`],d=o(function({value:o,onChange:d,countries:f,placeholder:p=`Select country`,searchPlaceholder:m=`Search countries...`,searchable:h=!0,clearable:g=!1,size:_=`md`,floatingLabel:v=!1,disabled:y,label:b,required:x=!1,error:S,hint:C,help:w,helpLabel:T=`More information`,id:E,name:D,className:O=``,fieldClassName:k=``,"aria-label":A,"aria-labelledby":j,"aria-describedby":M,...N},P){t(`AppCountrySelect`,N),e(`AppCountrySelect`,`size`,_,u);let F=s(),{setRef:I}=a({ref:P,value:o??``,onChange:d}),L=E||F,R=v&&b,z=S&&L?`${L}-error`:void 0,B=C&&L?`${L}-hint`:void 0,V=c(`wui-country-select`,{"aria-label":A||(typeof b==`string`?b:void 0),"aria-labelledby":j||void 0,"aria-describedby":z||B||M||void 0,"aria-invalid":S?`true`:void 0,ref:I,id:L,name:D,countries:Array.isArray(f)?f.join(`,`):void 0,placeholder:R?` `:p,"search-placeholder":m,searchable:h?``:void 0,clearable:g?``:void 0,size:_===`sm`||_===`lg`?_:void 0,disabled:y?``:void 0,required:x?``:void 0,className:O||void 0,...N});return!b&&!S&&!C?V:l(`div`,{className:[`field`,k].filter(Boolean).join(` `),children:[b&&!R&&l(`label`,{className:`label`,htmlFor:L,children:[b,x&&c(i,{}),w&&c(r,{label:T,children:w})]}),R?l(`div`,{className:`field-float`,children:[V,l(`label`,{className:`float-label`,htmlFor:L,children:[b,x&&c(i,{})]})]}):V,c(n,{error:S,hint:C,errorId:z,hintId:B})]})});export{d as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"../lib/FieldMessage.js";import i from"./AppInfoTip.js";import a from"./AppRequiredMark.js";import o from"./useWuiControl.js";import{cloneElement as s,forwardRef as c,useId as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/country-select";var f=[`sm`,`md`,`lg`],p=c(function(c,p){let{value:m,onChange:h,countries:g,placeholder:_=`Select country`,searchPlaceholder:v=`Search countries...`,searchable:y=!0,clearable:b=!1,size:x=`md`,floatingLabel:S=!1,disabled:C,label:w,required:T=!1,error:E,hint:D,help:O,helpLabel:k=`More information`,id:A,name:j,className:M=``,fieldClassName:N=``,"aria-label":P,"aria-labelledby":F,"aria-describedby":I,...L}=c;n(`AppCountrySelect`,L),t(`AppCountrySelect`,`size`,x,f);let R=l(),{setRef:z}=o({ref:p,value:m??``,onChange:h}),B=A||R,V=S&&w,H=E&&B?`${B}-error`:void 0,U=D&&B?`${B}-hint`:void 0,W=u(`wui-country-select`,{"aria-label":P||(typeof w==`string`?w:void 0),"aria-labelledby":F||void 0,"aria-describedby":H||U||I||void 0,"aria-invalid":E?`true`:void 0,ref:z,id:B,name:j,countries:Array.isArray(g)?g.join(`,`):void 0,placeholder:V?` `:_,"search-placeholder":v,searchable:y?``:void 0,clearable:b?``:void 0,size:x===`sm`||x===`lg`?x:void 0,disabled:C?``:void 0,required:T?``:void 0,className:M||void 0,...L});if(!w&&!E&&!D)return s(W,e(`AppCountrySelect`,c));let G=[`field`,N].filter(Boolean).join(` `);return d(`div`,{...e(`AppCountrySelect`,c),className:G,children:[w&&!V&&d(`label`,{className:`label`,htmlFor:B,children:[w,T&&u(a,{}),O&&u(i,{label:k,children:O})]}),V?d(`div`,{className:`field-float`,children:[W,d(`label`,{className:`float-label`,htmlFor:B,children:[w,T&&u(a,{})]})]}):W,u(r,{error:E,hint:D,errorId:H,hintId:U})]})});export{p as default};
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{jsx as n}from"react/jsx-runtime";var r=[3,4,6,12];function i({span:i=12,children:a,className:o=``,...s}){return t(`AppDashboardCell`,s),e(`AppDashboardCell`,`span`,i,r),n(`div`,{className:`wui-dashboard-cell${i===12||!r.includes(i)?``:` wui-dashboard-cell-${i}`}${o?` ${o}`:``}`,...s,children:a})}export{i as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i=[3,4,6,12];function a(a){let{span:o=12,children:s,className:c=``,...l}=a;return n(`AppDashboardCell`,l),t(`AppDashboardCell`,`span`,o,i),r(`div`,{className:`wui-dashboard-cell${o===12||!i.includes(o)?``:` wui-dashboard-cell-${o}`}${c?` ${c}`:``}`,...e(`AppDashboardCell`,a),...l,children:s})}export{a as default};
@@ -1 +1 @@
1
- import e from"./warnUnknownProps.js";import{jsx as t}from"react/jsx-runtime";function n({children:n,className:r=``,...i}){return e(`AppDashboardGrid`,i),t(`div`,{className:`wui-dashboard-grid${r?` ${r}`:``}`,...i,children:n})}export{n as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{jsx as n}from"react/jsx-runtime";function r(r){let{children:i,className:a=``,...o}=r;return t(`AppDashboardGrid`,o),n(`div`,{className:`wui-dashboard-grid${a?` ${a}`:``}`,...e(`AppDashboardGrid`,r),...o,children:i})}export{r as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{AppSkeletonRows as i}from"./AppSkeleton.js";import a from"./AppTablePagination.js";import{attachRowDrag as o,attachScrollEdges as s,syncTargets as c}from"@webority/ui-elements/helpers";import{Fragment as ee,useEffect as l,useLayoutEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{Fragment as te,jsx as m,jsxs as h}from"react/jsx-runtime";import{COLUMN_MAX_WIDTH as ne,COLUMN_MIN_WIDTH as re,DATA_TABLE_TEXT as ie,PIN_AT_VAR as ae,PIN_SIDES as oe,ROW_HEIGHTS as se,ROW_MOVE_LIMIT as ce,ROW_SAVE_ERROR_CLASS as le,groupCount as ue,groupItems as de,measureRows as fe,pinAtValue as pe,pinClasses as me,planPins as he,playRowMoves as ge,rowOrderChanged as _e,saveOutcomeText as ve,settledRows as ye,virtualRange as be}from"@webority/ui-elements/elements/data-table";var xe=[`comfortable`,`cozy`,`compact`],g=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},_=new Set;function v(t,n){_.has(t)||!g()||(_.add(t),e(`[@webority/ui-react] <AppDataTable> ${n}`))}var Se=100,Ce=e=>e.id,we=(e,t,n)=>{let r=!!t?.(e),i=r?``:n?.(e)||``;return{state:r?`saving`:i?`error`:null,message:i}};function y(e){return e===`end`?`wui-cell-end`:e===`num`?`num`:e===`center`?`text-center`:``}function Te(e){return e==null||e===``?`-`:typeof e==`boolean`?String(e):e}function Ee(e){if(!e||!(e.total>0))return!1;let t=e.pageSizes?.length?e.pageSizes:[e.pageSize];return e.total>Math.min(...t)}function b({columns:e,rows:g,rowKey:_=Ce,sort:b,onSort:x,loading:S=!1,skeletonRows:De=5,empty:Oe=`No records found.`,emptyFiltered:ke,sourceCount:Ae,rowActions:C,rowActionsLabel:je,pagination:w,ariaLabel:Me,className:Ne=``,wrapperClassName:Pe=``,selectable:T=!1,selectedIds:E,isRowSelectable:D,onToggleRow:O,onToggleAll:Fe,onSelectRange:Ie,renderExpanded:Le,density:k=`comfortable`,striped:Re=!1,flush:ze=!1,rowDrag:A=!1,maxHeight:Be,stickyFirstColumn:Ve=!1,stickyActions:He=!1,stackOnMobile:j=!1,hiddenColumns:Ue,rowStatus:We,rowHref:M,onRowClick:Ge,activeRowKey:Ke,resizableColumns:N=!1,viewKey:qe,groupBy:P,groupLabel:Je,virtual:F=!1,rowSaving:I,rowSaveError:L,...Ye}){n(`AppDataTable`,Ye);let Xe=Ue?.length?new Set(Ue):null;e=Xe?e.filter(e=>!(e.hideable&&Xe.has(e.key))):e,t(`AppDataTable`,`density`,k,xe);for(let n of e)t(`AppDataTable`,`column.pin`,n.pin,oe);let Ze=[`table table-ledger`,k===`cozy`||k===`compact`?`wui-table-${k}`:``,Re?`wui-table-striped`:``,Ve?`wui-table-sticky-first`:``,He?`wui-table-sticky-actions`:``,j?`wui-table-stack`:``,Ne].filter(Boolean).join(` `),R=typeof Le==`function`,[Qe,$e]=p(()=>new Set),et=e=>$e(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),tt=e.some(e=>typeof e.footer==`function`),z=typeof M==`function`||typeof Ge==`function`,nt=e=>!!e.target.closest(`a, button, input, select, textarea, label, [role='menu'], [role='menuitem'], .dropdown`),rt=(e,t)=>{if(nt(t)||(Ge&&Ge(e),!M))return;let n=M(e);n&&(t.ctrlKey||t.metaKey||t.button===1?window.open(n,`_blank`,`noopener`):window.location.assign(n))},B=Be!==void 0,it=[`table-wrap`,B?`wui-table-scroll`:``,ze?`wui-table-flush`:``,Pe].filter(Boolean).join(` `),at=B?{maxHeight:Be}:void 0,V=Math.max(1,e.length+ +!!C+ +!!T+ +!!R),ot=e.some(e=>e.pin===`start`||e.pin===`end`),H=ot||N||!!P||F,U=+!!R+ +!!T,st=ot?he([...R?[`lead`]:[],...T?[`lead`]:[],...e.map(e=>e.pin===`start`||e.pin===`end`?e.pin:null),...C?[null]:[]]):[],W=(e,t=``)=>{let n=st[e];return n?{className:`${t.trim()} ${me(n)}`.trim(),style:{[ae]:pe(n.side,n.ordinal)}}:{className:t,style:void 0}},ct=(e,t)=>st[e]?{...t,...W(e).style}:t,lt=e.length-1+ +!!C;qe&&!N&&v(`view-key`,"`viewKey` remembers resized widths: add `resizableColumns`."),F&&!B&&v(`virtual-height`,"`virtual` needs `maxHeight`: without a scroll box every row renders."),F&&(R||j)&&v(`virtual-shape`,"`virtual` takes rows of one height, so it is off with `renderExpanded` or `stackOnMobile`."),!F&&g?.length>500&&v(`rows-without-virtual`,`renders more than 500 rows without virtual: add virtual with maxHeight, or page the data.`);let G=F&&B&&!R&&!j&&!S&&g?.length>0,K=(e,t)=>!D||!!D(e,t),ut=T&&g?g.reduce((e,t,n)=>e+ +!!K(t,n),0):0,q=T&&g?g.reduce((e,t,n)=>e+(K(t,n)&&E?.has(_(t,n))?1:0),0):0,dt=ut>0&&q===ut,ft=q>0&&!dt,pt=e=>{e&&(e.indeterminate=ft)},mt=f(null),ht=(e,t)=>{let n=mt.current;mt.current=e;let r=t&&n!==null?g.findIndex((e,t)=>_(e,t)===n):-1,i=g.findIndex((t,n)=>_(t,n)===e);if(r<0||i<0||r===i){O?.(e);return}let a=!E?.has(e),o=Math.min(r,i),s=g.slice(o,Math.max(r,i)+1).map((e,t)=>[e,o+t]).filter(([e,t])=>K(e,t)).map(([e,t])=>_(e,t)).filter(e=>(E?.has(e)||!1)!==a);if(Ie)Ie(s,a);else for(let e of s)O?.(e)},gt=e=>{if(!D){Fe?.(e);return}(g||[]).forEach((t,n)=>{let r=_(t,n);K(t,n)&&(E?.has(r)||!1)!==e&&O?.(r)})},[_t,vt]=p(()=>new Set),yt=e=>vt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),J=d(()=>{let e=(g||[]).map((e,t)=>({row:e,i:t}));return P?de(e,({row:e})=>String(e[P]??``)).flatMap(e=>[{group:e,open:!_t.has(e.key)},..._t.has(e.key)?[]:e.items]):e},[g,P,_t]),Y=f(null),bt=f(null);l(()=>{let e=Y.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`);bt.current=t?Number(t)-2:null},r=t=>{e.contains(t.relatedTarget)||(bt.current=null)};e.addEventListener(`mouseover`,t),e.addEventListener(`focusin`,t),e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,r);let i=s(e);return()=>{e.removeEventListener(`mouseover`,t),e.removeEventListener(`focusin`,t),e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,r),i()}},[H]),l(()=>{if(!A||!Y.current)return;let e=o(Y.current);return c(document),e},[A,H]);let xt=f(!1);l(()=>{!xt.current&&(xt.current=!0,q===0)||Y.current?.querySelector(`table`)?.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:{selected:q,total:g?.length??0,keys:g?g.flatMap((e,t)=>{let n=_(e,t);return K(e,t)&&E?.has(n)?[String(n)]:[]}):[]}}))},[T,q]);let[St,Ct]=p({top:0,height:0}),[X,wt]=p(se[k]??se.comfortable);l(()=>{let e=Y.current;if(!G||!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};Ct(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)}},[G,H]),u(()=>{if(!G)return;let e=(Y.current?.querySelector(`:scope > table > tbody > tr:not(.wui-virtual-spacer, .wui-group-row)`))?.getBoundingClientRect().height;e>0&&Math.abs(e-X)>.5&&wt(e)},[k,g?.length,F,G]);let Z={start:0,end:J.length,before:0,after:0};if(G){Z=be({scrollTop:St.top,viewport:St.height||Number.parseFloat(Be)||0,rowHeight:X,count:J.length});let e=bt.current;e!==null&&e>=0&&e<J.length&&(e<Z.start&&Z.start-e<=Se&&(Z={...Z,start:e,before:e*X}),e>=Z.end&&e-Z.end<Se&&(Z={...Z,end:e+1,after:(J.length-e-1)*X}))}let Tt=f(null),Et=f(null),Dt=f(null),Ot=!F&&!S&&g?.length>0&&g.length<=ce;u(()=>{let e=Tt.current;if(!Ot||!e){Et.current=null,Dt.current=null;return}let t=g.map((e,t)=>_(e,t));_e(Dt.current,t)&&ge(e.rows,Et.current),Et.current=fe(e.rows),Dt.current=t});let kt=typeof I==`function`||typeof L==`function`,At=f(null),jt=f(null);l(()=>{if(!kt){jt.current=null;return}let t=e[0]?.key,n=new Map;(g||[]).forEach((e,r)=>{let i=t===void 0?void 0:e[t],a=typeof i==`string`||typeof i==`number`?String(i):``;n.set(_(e,r),{...we(e,I,L),label:a})});let r=ve(ye(jt.current,n));jt.current=n,r&&At.current&&(At.current.textContent=r)},[g,I,L,_]);let Mt=ke!==void 0&&Ae>0?ke:Oe,Nt=({group:e,open:t},n)=>{let i=e.items[0].row[P],a=e.items.map(e=>e.row);return m(`tr`,{className:`wui-group-row`,"data-group-key":e.key,"aria-rowindex":G?n+2:void 0,children:m(`th`,{className:`wui-group-cell`,scope:`rowgroup`,colSpan:V,children:h(`button`,{type:`button`,className:`wui-group-toggle`,"aria-expanded":t,onClick:()=>yt(e.key),children:[m(r,{name:`chevron-down`,size:16}),m(`span`,{className:`wui-group-label`,children:Je?Je(i,a):Te(i)}),m(`span`,{className:`wui-group-count`,"aria-hidden":`true`,children:ue(e.items.length)}),m(`span`,{className:`visually-hidden wui-group-rows`,children:`, ${ie.rows(e.items.length)}`})]})})},`group:${e.key}`)},Pt=({row:t,i:n},i)=>{let a=_(t,n),o=R&&Qe.has(a),s=Ke!=null&&String(Ke)===String(a),c=String(a).replace(/[^a-z0-9]/gi,`_`),l=W(0,`wui-expand-cell`),u=W(+!!R,`wui-select-cell`),d=kt?we(t,I,L):null,f=K(t,n);return h(ee,{children:[h(`tr`,{className:[T&&f&&E?.has(a)?`is-selected`:``,z?`wui-row-link`:``,s?`wui-row-active`:``].filter(Boolean).join(` `)||void 0,"aria-current":s?`true`:void 0,"aria-rowindex":G?i+2:void 0,"aria-busy":d?.state===`saving`?`true`:void 0,"data-wui-save-state":d?.state||void 0,"data-status":We?.(t)||void 0,"data-href":M?.(t)||void 0,"data-row-key":A?String(a):void 0,tabIndex:z?0:void 0,onClick:z?e=>rt(t,e):void 0,onAuxClick:z&&M?e=>e.button===1&&rt(t,e):void 0,onKeyDown:z?e=>{e.key===`Enter`&&e.target===e.currentTarget&&rt(t,e)}:void 0,children:[R&&m(`td`,{className:l.className,style:l.style,children:m(`button`,{type:`button`,className:`wui-expand-toggle${o?` is-open`:``}`,"aria-expanded":o,"aria-controls":o?`${c}-expanded`:void 0,"aria-label":o?`Collapse row`:`Expand row`,onClick:()=>et(a),children:m(r,{name:`chevron-down`,size:16})})}),T&&m(`td`,{className:u.className,style:u.style,children:m(`input`,{type:`checkbox`,className:`wui-check`,checked:f&&(E?.has(a)||!1),disabled:!f,onChange:e=>ht(a,e.nativeEvent.shiftKey),onMouseDown:e=>{e.shiftKey&&e.preventDefault()},"aria-label":`Select row`})}),e.map((e,n)=>h(`td`,{className:W(U+n,(n===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+y(e.align)+(e.cellClassName?` ${e.cellClassName}`:``)).className,style:ct(U+n,e.cellStyle),"data-label":j&&typeof e.label==`string`?e.label:void 0,children:[e.render?e.render(t):Te(t[e.key]),n===0&&d?.state===`error`&&m(`span`,{className:le,children:d.message})]},e.key)),C&&m(`td`,{children:m(`div`,{className:`u-row-actions`,children:C(t)})})]}),o&&m(`tr`,{className:`wui-row-expanded`,children:m(`td`,{id:`${c}-expanded`,colSpan:V,children:Le(t)})})]},a)},Ft=(e,t)=>e.group?Nt(e,t):Pt(e,t),It=(e,t)=>G?m(`tr`,{className:`wui-virtual-spacer`,"aria-hidden":`true`,hidden:t===0,children:m(`td`,{colSpan:V,style:{height:t}})},e):null,Q=W(0,`wui-expand-cell`),$=W(+!!R,`wui-select-cell`);return h(te,{children:[h(H?`wui-data-table`:`div`,{ref:Y,...H?{class:it,resizable:N?``:void 0,"view-key":qe||void 0,"data-wui-row-drag":A?``:void 0}:{className:it,"data-wui-row-drag":A?``:void 0},style:at,tabIndex:0,...Ye,children:[h(`table`,{className:Ze,"aria-label":Me,"aria-rowcount":G?J.length+1:void 0,children:[m(`thead`,{children:h(`tr`,{"aria-rowindex":G?1:void 0,children:[R&&m(`th`,{className:Q.className,style:Q.style,children:m(`span`,{className:`visually-hidden`,children:`Expand`})}),T&&m(`th`,{className:$.className,style:$.style,children:m(`input`,{ref:pt,type:`checkbox`,className:`wui-check`,checked:dt,onChange:e=>gt(e.target.checked),"aria-label":`Select all rows`})}),e.map((e,t)=>{let n=!!(e.sortable&&x),i=b&&b.key===e.key,a=e.align===`num`||e.align===`end`,o=n&&m(`span`,{className:`sort-icon${a?` wui-sort-lead`:``}`,children:m(r,{name:`chevrons-up-down`,size:14})}),s=N&&t!==lt,c=e.width||e.minWidth?{width:e.width,minWidth:e.minWidth}:void 0;return h(`th`,{className:W(U+t,(n?`sortable `:``)+(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+(e.grow?`wui-col-grow `:``)+(s?`wui-col-resizable `:``)+y(e.align)).className,style:ct(U+t,c),"data-key":H?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":i?b.dir===`asc`?`ascending`:`descending`:n?`none`:void 0,onClick:n?()=>x(e.key):void 0,onKeyDown:n?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),x(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":re,"aria-valuemax":ne,tabIndex:0,"aria-label":ie.resize(typeof e.label==`string`?e.label:e.key)})]},e.key)}),C&&(je?m(`th`,{className:`wui-cell-end`,children:je}):m(`th`,{className:`wui-cell-end`,children:m(`span`,{className:`visually-hidden`,children:`Actions`})}))]})}),m(`tbody`,{ref:Tt,children:S?m(i,{rows:De,cols:V}):g?.length?h(te,{children:[It(`before`,Z.before),J.slice(Z.start,Z.end).map((e,t)=>Ft(e,Z.start+t)),It(`after`,Z.after)]}):null}),tt&&!S&&g?.length>0&&m(`tfoot`,{children:h(`tr`,{children:[R&&m(`td`,{className:Q.className,style:Q.style}),T&&m(`td`,{className:$.className,style:$.style}),e.map((e,t)=>m(`td`,{className:W(U+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+y(e.align)).className,style:ct(U+t,void 0),children:e.footer?e.footer(g):null},e.key)),C&&m(`td`,{})]})})]}),!S&&!g?.length&&m(`div`,{className:`tbl-empty-block`,children:typeof Mt==`string`?m(`div`,{className:`tbl-empty-plain`,children:Mt}):Mt})]}),Ee(w)&&m(a,{page:w.page,totalPages:w.totalPages,pageSize:w.pageSize,onPageChange:w.setPage,onPageSizeChange:w.setPageSize,pageSizes:w.pageSizes,mode:w.mode}),kt&&m(`div`,{ref:At,className:`visually-hidden`,role:`status`,"aria-live":`polite`,"data-wui-table-status":``})]})}export{b as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import i from"./AppIcon.js";import{AppSkeletonRows as a}from"./AppSkeleton.js";import o from"./AppTablePagination.js";import{attachRowDrag as s,attachScrollEdges as c,syncTargets as ee}from"@webority/ui-elements/helpers";import{Fragment as te,useEffect as l,useLayoutEffect as u,useMemo as ne,useRef as d,useState as f}from"react";import{Fragment as re,jsx as p,jsxs as m}from"react/jsx-runtime";import{COLUMN_MAX_WIDTH as ie,COLUMN_MIN_WIDTH as ae,DATA_TABLE_TEXT as oe,PIN_AT_VAR as se,PIN_SIDES as ce,ROW_HEIGHTS as le,ROW_MOVE_LIMIT as ue,ROW_SAVE_ERROR_CLASS as de,groupCount as fe,groupItems as pe,measureRows as me,pinAtValue as he,pinClasses as ge,planPins as _e,playRowMoves as ve,rowOrderChanged as ye,saveOutcomeText as be,settledRows as xe,virtualRange as Se}from"@webority/ui-elements/elements/data-table";var Ce=[`comfortable`,`cozy`,`compact`],h=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},g=new Set;function _(e,n){g.has(e)||!h()||(g.add(e),t(`[@webority/ui-react] <AppDataTable> ${n}`))}var we=100,Te=e=>e.id,Ee=(e,t,n)=>{let r=!!t?.(e),i=r?``:n?.(e)||``;return{state:r?`saving`:i?`error`:null,message:i}};function v(e){return e===`end`?`wui-cell-end`:e===`num`?`num`:e===`center`?`text-center`:``}function De(e){return e==null||e===``?`-`:typeof e==`boolean`?String(e):e}function Oe(e){if(!e||!(e.total>0))return!1;let t=e.pageSizes?.length?e.pageSizes:[e.pageSize];return e.total>Math.min(...t)}function y(t){let{columns:h,rows:g,rowKey:y=Te,sort:ke,onSort:b,loading:x=!1,skeletonRows:Ae=5,empty:je=`No records found.`,emptyFiltered:Me,sourceCount:Ne,rowActions:S,rowActionsLabel:Pe,pagination:C,ariaLabel:Fe,className:Ie=``,wrapperClassName:Le=``,selectable:w=!1,selectedIds:T,isRowSelectable:Re,onToggleRow:ze,onToggleAll:Be,onSelectRange:Ve,renderExpanded:He,density:E=`comfortable`,striped:Ue=!1,flush:We=!1,rowDrag:D=!1,maxHeight:O,stickyFirstColumn:Ge=!1,stickyActions:Ke=!1,stackOnMobile:k=!1,hiddenColumns:qe,rowStatus:Je,rowHref:A,onRowClick:j,activeRowKey:Ye,resizableColumns:M=!1,viewKey:Xe,groupBy:N,groupLabel:Ze,virtual:P=!1,rowSaving:F,rowSaveError:I,...Qe}=t;r(`AppDataTable`,Qe);let $e=qe?.length?new Set(qe):null;h=$e?h.filter(e=>!(e.hideable&&$e.has(e.key))):h,n(`AppDataTable`,`density`,E,Ce);for(let e of h)n(`AppDataTable`,`column.pin`,e.pin,ce);let et=[`table table-ledger`,E===`cozy`||E===`compact`?`wui-table-${E}`:``,Ue?`wui-table-striped`:``,Ge?`wui-table-sticky-first`:``,Ke?`wui-table-sticky-actions`:``,k?`wui-table-stack`:``,Ie].filter(Boolean).join(` `),L=typeof He==`function`,[tt,nt]=f(()=>new Set),rt=e=>nt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),it=h.some(e=>typeof e.footer==`function`),R=typeof A==`function`||typeof j==`function`,at=e=>!!e.target.closest(`a, button, input, select, textarea, label, [role='menu'], [role='menuitem'], .dropdown`),ot=(e,t)=>{if(at(t)||(j&&j(e),!A))return;let n=A(e);n&&(t.ctrlKey||t.metaKey||t.button===1?window.open(n,`_blank`,`noopener`):window.location.assign(n))},z=O!==void 0,st=[`table-wrap`,z?`wui-table-scroll`:``,We?`wui-table-flush`:``,Le].filter(Boolean).join(` `),ct=z?{maxHeight:O}:void 0,B=Math.max(1,h.length+ +!!S+ +!!w+ +!!L),lt=h.some(e=>e.pin===`start`||e.pin===`end`),V=lt||M||!!N||P,H=+!!L+ +!!w,ut=lt?_e([...L?[`lead`]:[],...w?[`lead`]:[],...h.map(e=>e.pin===`start`||e.pin===`end`?e.pin:null),...S?[null]:[]]):[],U=(e,t=``)=>{let n=ut[e];return n?{className:`${t.trim()} ${ge(n)}`.trim(),style:{[se]:he(n.side,n.ordinal)}}:{className:t,style:void 0}},dt=(e,t)=>ut[e]?{...t,...U(e).style}:t,ft=h.length-1+ +!!S;Xe&&!M&&_(`view-key`,"`viewKey` remembers resized widths: add `resizableColumns`."),P&&!z&&_(`virtual-height`,"`virtual` needs `maxHeight`: without a scroll box every row renders."),P&&(L||k)&&_(`virtual-shape`,"`virtual` takes rows of one height, so it is off with `renderExpanded` or `stackOnMobile`."),!P&&g?.length>500&&_(`rows-without-virtual`,`renders more than 500 rows without virtual: add virtual with maxHeight, or page the data.`);let W=P&&z&&!L&&!k&&!x&&g?.length>0,G=(e,t)=>!Re||!!Re(e,t),pt=w&&g?g.reduce((e,t,n)=>e+ +!!G(t,n),0):0,K=w&&g?g.reduce((e,t,n)=>e+(G(t,n)&&T?.has(y(t,n))?1:0),0):0,mt=pt>0&&K===pt,ht=K>0&&!mt,gt=e=>{e&&(e.indeterminate=ht)},_t=d(null),vt=(e,t)=>{let n=_t.current;_t.current=e;let r=t&&n!==null?g.findIndex((e,t)=>y(e,t)===n):-1,i=g.findIndex((t,n)=>y(t,n)===e);if(r<0||i<0||r===i){ze?.(e);return}let a=!T?.has(e),o=Math.min(r,i),s=g.slice(o,Math.max(r,i)+1).map((e,t)=>[e,o+t]).filter(([e,t])=>G(e,t)).map(([e,t])=>y(e,t)).filter(e=>(T?.has(e)||!1)!==a);if(Ve)Ve(s,a);else for(let e of s)ze?.(e)},yt=e=>{if(!Re){Be?.(e);return}(g||[]).forEach((t,n)=>{let r=y(t,n);G(t,n)&&(T?.has(r)||!1)!==e&&ze?.(r)})},[bt,xt]=f(()=>new Set),St=e=>xt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),q=ne(()=>{let e=(g||[]).map((e,t)=>({row:e,i:t}));return N?pe(e,({row:e})=>String(e[N]??``)).flatMap(e=>[{group:e,open:!bt.has(e.key)},...bt.has(e.key)?[]:e.items]):e},[g,N,bt]),J=d(null),Y=d(null);l(()=>{let e=J.current;if(!e)return;let t=e=>{let t=e.target.closest?.(`.u-name`);t&&!t.title&&(t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight)&&(t.title=t.textContent.trim())},n=e=>{let t=e.target.closest?.(`tbody > tr[aria-rowindex]`)?.getAttribute(`aria-rowindex`);Y.current=t?Number(t)-2:null},r=t=>{e.contains(t.relatedTarget)||(Y.current=null)};e.addEventListener(`mouseover`,t),e.addEventListener(`focusin`,t),e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,r);let i=c(e);return()=>{e.removeEventListener(`mouseover`,t),e.removeEventListener(`focusin`,t),e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,r),i()}},[V]),l(()=>{if(!D||!J.current)return;let e=s(J.current);return ee(document),e},[D,V]);let Ct=d(!1);l(()=>{!Ct.current&&(Ct.current=!0,K===0)||J.current?.querySelector(`table`)?.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:{selected:K,total:g?.length??0,keys:g?g.flatMap((e,t)=>{let n=y(e,t);return G(e,t)&&T?.has(n)?[String(n)]:[]}):[]}}))},[w,K]);let[wt,Tt]=f({top:0,height:0}),[X,Et]=f(le[E]??le.comfortable);l(()=>{let e=J.current;if(!W||!e)return;let t=0,n=()=>{t=0;let n=e.querySelector(`:scope > table > thead`)?.getBoundingClientRect().height||0,r={top:Math.max(0,e.scrollTop-n),height:e.clientHeight};Tt(e=>e.top===r.top&&e.height===r.height?e:r)},r=()=>{t||=requestAnimationFrame(n)};e.addEventListener(`scroll`,r,{passive:!0});let i=typeof ResizeObserver<`u`?new ResizeObserver(r):null;return i?.observe(e),n(),()=>{e.removeEventListener(`scroll`,r),i?.disconnect(),t&&cancelAnimationFrame(t)}},[W,V]),u(()=>{if(!W)return;let e=(J.current?.querySelector(`:scope > table > tbody > tr:not(.wui-virtual-spacer, .wui-group-row)`))?.getBoundingClientRect().height;e>0&&Math.abs(e-X)>.5&&Et(e)},[E,g?.length,P,W]);let Z={start:0,end:q.length,before:0,after:0};if(W){Z=Se({scrollTop:wt.top,viewport:wt.height||Number.parseFloat(O)||0,rowHeight:X,count:q.length});let e=Y.current;e!==null&&e>=0&&e<q.length&&(e<Z.start&&Z.start-e<=we&&(Z={...Z,start:e,before:e*X}),e>=Z.end&&e-Z.end<we&&(Z={...Z,end:e+1,after:(q.length-e-1)*X}))}let Dt=d(null),Ot=d(null),kt=d(null),At=!P&&!x&&g?.length>0&&g.length<=ue;u(()=>{let e=Dt.current;if(!At||!e){Ot.current=null,kt.current=null;return}let t=g.map((e,t)=>y(e,t));ye(kt.current,t)&&ve(e.rows,Ot.current),Ot.current=me(e.rows),kt.current=t});let jt=typeof F==`function`||typeof I==`function`,Mt=d(null),Nt=d(null);l(()=>{if(!jt){Nt.current=null;return}let e=h[0]?.key,t=new Map;(g||[]).forEach((n,r)=>{let i=e===void 0?void 0:n[e],a=typeof i==`string`||typeof i==`number`?String(i):``;t.set(y(n,r),{...Ee(n,F,I),label:a})});let n=be(xe(Nt.current,t));Nt.current=t,n&&Mt.current&&(Mt.current.textContent=n)},[g,F,I,y]);let Pt=Me!==void 0&&Ne>0?Me:je,Ft=({group:e,open:t},n)=>{let r=e.items[0].row[N],a=e.items.map(e=>e.row);return p(`tr`,{className:`wui-group-row`,"data-group-key":e.key,"aria-rowindex":W?n+2:void 0,children:p(`th`,{className:`wui-group-cell`,scope:`rowgroup`,colSpan:B,children:m(`button`,{type:`button`,className:`wui-group-toggle`,"aria-expanded":t,onClick:()=>St(e.key),children:[p(i,{name:`chevron-down`,size:16}),p(`span`,{className:`wui-group-label`,children:Ze?Ze(r,a):De(r)}),p(`span`,{className:`wui-group-count`,"aria-hidden":`true`,children:fe(e.items.length)}),p(`span`,{className:`visually-hidden wui-group-rows`,children:`, ${oe.rows(e.items.length)}`})]})})},`group:${e.key}`)},It=({row:e,i:t},n)=>{let r=y(e,t),a=L&&tt.has(r),o=Ye!=null&&String(Ye)===String(r),s=String(r).replace(/[^a-z0-9]/gi,`_`),c=U(0,`wui-expand-cell`),ee=U(+!!L,`wui-select-cell`),l=jt?Ee(e,F,I):null,u=G(e,t);return m(te,{children:[m(`tr`,{className:[w&&u&&T?.has(r)?`is-selected`:``,R?`wui-row-link`:``,o?`wui-row-active`:``].filter(Boolean).join(` `)||void 0,"aria-current":o?`true`:void 0,"aria-rowindex":W?n+2:void 0,"aria-busy":l?.state===`saving`?`true`:void 0,"data-wui-save-state":l?.state||void 0,"data-status":Je?.(e)||void 0,"data-href":A?.(e)||void 0,"data-row-key":D?String(r):void 0,tabIndex:R?0:void 0,onClick:R?t=>ot(e,t):void 0,onAuxClick:R&&A?t=>t.button===1&&ot(e,t):void 0,onKeyDown:R?t=>{t.key===`Enter`&&t.target===t.currentTarget&&ot(e,t)}:void 0,children:[L&&p(`td`,{className:c.className,style:c.style,children:p(`button`,{type:`button`,className:`wui-expand-toggle${a?` is-open`:``}`,"aria-expanded":a,"aria-controls":a?`${s}-expanded`:void 0,"aria-label":a?`Collapse row`:`Expand row`,onClick:()=>rt(r),children:p(i,{name:`chevron-down`,size:16})})}),w&&p(`td`,{className:ee.className,style:ee.style,children:p(`input`,{type:`checkbox`,className:`wui-check`,checked:u&&(T?.has(r)||!1),disabled:!u,onChange:e=>vt(r,e.nativeEvent.shiftKey),onMouseDown:e=>{e.shiftKey&&e.preventDefault()},"aria-label":`Select row`})}),h.map((t,n)=>m(`td`,{className:U(H+n,(n===0?`wui-name-cell `:``)+(t.nowrap?`text-nowrap `:``)+v(t.align)+(t.cellClassName?` ${t.cellClassName}`:``)).className,style:dt(H+n,t.cellStyle),"data-label":k&&typeof t.label==`string`?t.label:void 0,children:[t.render?t.render(e):De(e[t.key]),n===0&&l?.state===`error`&&p(`span`,{className:de,children:l.message})]},t.key)),S&&p(`td`,{children:p(`div`,{className:`u-row-actions`,children:S(e)})})]}),a&&p(`tr`,{className:`wui-row-expanded`,children:p(`td`,{id:`${s}-expanded`,colSpan:B,children:He(e)})})]},r)},Lt=(e,t)=>e.group?Ft(e,t):It(e,t),Rt=(e,t)=>W?p(`tr`,{className:`wui-virtual-spacer`,"aria-hidden":`true`,hidden:t===0,children:p(`td`,{colSpan:B,style:{height:t}})},e):null,Q=U(0,`wui-expand-cell`),$=U(+!!L,`wui-select-cell`);return m(re,{children:[m(V?`wui-data-table`:`div`,{ref:J,...V?{class:st,resizable:M?``:void 0,"view-key":Xe||void 0,"data-wui-row-drag":D?``:void 0}:{className:st,"data-wui-row-drag":D?``:void 0},style:ct,tabIndex:0,...e(`AppDataTable`,t),...Qe,children:[m(`table`,{className:et,"aria-label":Fe,"aria-rowcount":W?q.length+1:void 0,children:[p(`thead`,{children:m(`tr`,{"aria-rowindex":W?1:void 0,children:[L&&p(`th`,{className:Q.className,style:Q.style,children:p(`span`,{className:`visually-hidden`,children:`Expand`})}),w&&p(`th`,{className:$.className,style:$.style,children:p(`input`,{ref:gt,type:`checkbox`,className:`wui-check`,checked:mt,onChange:e=>yt(e.target.checked),"aria-label":`Select all rows`})}),h.map((e,t)=>{let n=!!(e.sortable&&b),r=ke&&ke.key===e.key,a=e.align===`num`||e.align===`end`,o=n&&p(`span`,{className:`sort-icon${a?` wui-sort-lead`:``}`,children:p(i,{name:`chevrons-up-down`,size:14})}),s=M&&t!==ft,c=e.width||e.minWidth?{width:e.width,minWidth:e.minWidth}:void 0;return m(`th`,{className:U(H+t,(n?`sortable `:``)+(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+(e.grow?`wui-col-grow `:``)+(s?`wui-col-resizable `:``)+v(e.align)).className,style:dt(H+t,c),"data-key":V?e.key:void 0,"aria-label":s&&typeof e.label==`string`?e.label:void 0,"data-pin":e.pin===`start`||e.pin===`end`?e.pin:void 0,tabIndex:n?0:void 0,"aria-sort":r?ke.dir===`asc`?`ascending`:`descending`:n?`none`:void 0,onClick:n?()=>b(e.key):void 0,onKeyDown:n?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),b(e.key))}:void 0,children:[a&&o,e.label,!a&&o,s&&p(`span`,{className:`wui-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":ae,"aria-valuemax":ie,tabIndex:0,"aria-label":oe.resize(typeof e.label==`string`?e.label:e.key)})]},e.key)}),S&&(Pe?p(`th`,{className:`wui-cell-end`,children:Pe}):p(`th`,{className:`wui-cell-end`,children:p(`span`,{className:`visually-hidden`,children:`Actions`})}))]})}),p(`tbody`,{ref:Dt,children:x?p(a,{rows:Ae,cols:B}):g?.length?m(re,{children:[Rt(`before`,Z.before),q.slice(Z.start,Z.end).map((e,t)=>Lt(e,Z.start+t)),Rt(`after`,Z.after)]}):null}),it&&!x&&g?.length>0&&p(`tfoot`,{children:m(`tr`,{children:[L&&p(`td`,{className:Q.className,style:Q.style}),w&&p(`td`,{className:$.className,style:$.style}),h.map((e,t)=>p(`td`,{className:U(H+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+v(e.align)).className,style:dt(H+t,void 0),children:e.footer?e.footer(g):null},e.key)),S&&p(`td`,{})]})})]}),!x&&!g?.length&&p(`div`,{className:`tbl-empty-block`,children:typeof Pt==`string`?p(`div`,{className:`tbl-empty-plain`,children:Pt}):Pt})]}),Oe(C)&&p(o,{page:C.page,totalPages:C.totalPages,pageSize:C.pageSize,onPageChange:C.setPage,onPageSizeChange:C.setPageSize,pageSizes:C.pageSizes,mode:C.mode}),jt&&p(`div`,{ref:Mt,className:`visually-hidden`,role:`status`,"aria-live":`polite`,"data-wui-table-status":``})]})}export{y as default};
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"../lib/FieldMessage.js";import r from"./AppRequiredMark.js";import i from"./useWuiControl.js";import{forwardRef as a,useId as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import"@webority/ui-elements/elements/datepicker";var l=[`sm`,`md`,`lg`],u=a(function({value:a,onChange:u,label:d,required:f=!1,hint:p,error:m,name:h,min:g,max:_,placeholder:v=`Choose a date`,disabled:y,size:b,firstDay:x,displayFormat:S,id:C,ariaLabel:w,className:T=``,fieldClassName:E=``,...D},O){t(`AppDatePicker`,D),e(`AppDatePicker`,`size`,b,l);let k=o(),A=C||k,{setRef:j}=i({ref:O,value:a??``,onChange:u}),M=!d&&!m&&!p,N=m?`${A}-error`:void 0,P=p?`${A}-hint`:void 0,F=s(`wui-datepicker`,{ref:j,id:A,name:h,min:g,max:_,placeholder:v,size:b||void 0,"first-day":x==null?void 0:String(x),"display-format":S||void 0,"aria-label":w||(typeof d==`string`?d:void 0),"aria-describedby":N||P,"aria-invalid":m?`true`:void 0,disabled:y?``:void 0,required:f?``:void 0,className:T||void 0,...D});return M?F:c(`div`,{className:`field${E?` ${E}`:``}`,children:[d&&c(`label`,{className:`label`,htmlFor:A,children:[d,f&&s(r,{})]}),F,s(n,{error:m,hint:p,errorId:N,hintId:P})]})});export{u as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"../lib/FieldMessage.js";import i from"./AppRequiredMark.js";import a from"./useWuiControl.js";import{cloneElement as o,forwardRef as s,useId as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import"@webority/ui-elements/elements/datepicker";var d=[`sm`,`md`,`lg`],f=s(function(s,f){let{value:p,onChange:m,label:h,required:g=!1,hint:_,error:v,name:y,min:b,max:x,placeholder:S=`Choose a date`,disabled:C,size:w,firstDay:T,displayFormat:E,id:D,ariaLabel:O,className:k=``,fieldClassName:A=``,...j}=s;n(`AppDatePicker`,j),t(`AppDatePicker`,`size`,w,d);let M=c(),N=D||M,{setRef:P}=a({ref:f,value:p??``,onChange:m}),F=!h&&!v&&!_,I=v?`${N}-error`:void 0,L=_?`${N}-hint`:void 0,R=l(`wui-datepicker`,{ref:P,id:N,name:y,min:b,max:x,placeholder:S,size:w||void 0,"first-day":T==null?void 0:String(T),"display-format":E||void 0,"aria-label":O||(typeof h==`string`?h:void 0),"aria-describedby":I||L,"aria-invalid":v?`true`:void 0,disabled:C?``:void 0,required:g?``:void 0,className:k||void 0,...j});return F?o(R,e(`AppDatePicker`,s)):u(`div`,{...e(`AppDatePicker`,s),className:`field${A?` ${A}`:``}`,children:[h&&u(`label`,{className:`label`,htmlFor:N,children:[h,g&&l(i,{})]}),R,l(r,{error:v,hint:_,errorId:I,hintId:L})]})});export{f as default};
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"../lib/FieldMessage.js";import r from"./AppRequiredMark.js";import i from"./useWuiControl.js";import{forwardRef as a,useEffect as o,useId as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import"@webority/ui-elements/elements/date-range";var u=[`sm`,`md`,`lg`],d=e=>{if(e?.length)return e.every(e=>typeof e==`string`)?e.join(`,`):JSON.stringify(e)},f=a(function({start:a,end:f,onChange:p,label:m,required:h=!1,hint:g,error:_,startName:v,endName:y,min:b,max:x,placeholder:S=`Start to End`,disabled:C,size:w,firstDay:T,presets:E,id:D,ariaLabel:O,className:k=``,fieldClassName:A=``,...j},M){t(`AppDateRangePicker`,j),e(`AppDateRangePicker`,`size`,w,u);let N=s(),P=D||N,{setRef:F,innerRef:I}=i({ref:M,onChange:p});o(()=>{let e=I.current;if(!e)return;let t=a===void 0?e.value.start:a,n=f===void 0?e.value.end:f;(e.value.start!==t||e.value.end!==n)&&(e.value={start:t,end:n})},[a,f,I]);let L=!m&&!_&&!g,R=_?`${P}-error`:void 0,z=g?`${P}-hint`:void 0,B=R||z,V=c(`wui-date-range`,{ref:F,id:P,"start-name":v,"end-name":y,min:b,max:x,placeholder:S,size:w||void 0,"first-day":T==null?void 0:String(T),presets:d(E),"aria-label":O||(typeof m==`string`?m:void 0),"aria-describedby":B,"aria-invalid":_?`true`:void 0,disabled:C?``:void 0,required:h?``:void 0,className:k||void 0,...j});return L?V:l(`div`,{className:`field${A?` ${A}`:``}`,children:[m&&l(`label`,{className:`label`,htmlFor:P,children:[m,h&&c(r,{})]}),V,c(n,{error:_,hint:g,errorId:R,hintId:z})]})});export{f as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"../lib/FieldMessage.js";import i from"./AppRequiredMark.js";import a from"./useWuiControl.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{start:h,end:g,onChange:_,label:v,required:y=!1,hint:b,error:x,startName:S,endName:C,min:w,max:T,placeholder:E=`Start to End`,disabled:D,size:O,firstDay:k,presets:A,id:j,ariaLabel:M,className:N=``,fieldClassName:P=``,...F}=s;n(`AppDateRangePicker`,F),t(`AppDateRangePicker`,`size`,O,f);let I=l(),L=j||I,{setRef:R,innerRef:z}=a({ref:m,onChange:_});c(()=>{let e=z.current;if(!e)return;let t=h===void 0?e.value.start:h,n=g===void 0?e.value.end:g;(e.value.start!==t||e.value.end!==n)&&(e.value={start:t,end:n})},[h,g,z]);let B=!v&&!x&&!b,V=x?`${L}-error`:void 0,H=b?`${L}-hint`:void 0,U=V||H,W=u(`wui-date-range`,{ref:R,id:L,"start-name":S,"end-name":C,min:w,max:T,placeholder:E,size:O||void 0,"first-day":k==null?void 0:String(k),presets:p(A),"aria-label":M||(typeof v==`string`?v:void 0),"aria-describedby":U,"aria-invalid":x?`true`:void 0,disabled:D?``:void 0,required:y?``:void 0,className:N||void 0,...F});return B?o(W,e(`AppDateRangePicker`,s)):d(`div`,{...e(`AppDateRangePicker`,s),className:`field${P?` ${P}`:``}`,children:[v&&d(`label`,{className:`label`,htmlFor:L,children:[v,y&&u(i,{})]}),W,u(r,{error:x,hint:b,errorId:V,hintId:H})]})});export{m as default};
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{isEmpty as n}from"../lib/emptyValue.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`sm`,`md`],o=[`grid`,`summary`];function s({items:s=[],columns:c=2,size:l=`md`,bordered:u=!1,layout:d=`grid`,title:f,className:p=``,...m}){return t(`AppDescriptions`,m),e(`AppDescriptions`,`size`,l,a),e(`AppDescriptions`,`layout`,d,o),i(`div`,{className:[`descs`,`descs-col-${c}`,l&&l!==`md`?`descs-${l}`:``,u?`descs-bordered`:``,d===`summary`?`wui-descs-summary`:``,p].filter(Boolean).join(` `)||void 0,...m,children:[f&&r(`div`,{className:`descs-title`,children:f}),r(`dl`,{className:`descs-list`,children:s.map((e,t)=>{let a=n(e.value),o=Math.min(12,Math.max(1,e.span??1)),s=e.key??`${e.label}-${t}`;return i(`div`,{className:`descs-item${e.emphasis?` wui-descs-emphasis`:``} wui-descs-span-${o}`,children:[r(`dt`,{className:`descs-label`,children:e.label}),r(`dd`,{className:`descs-value${a?` is-empty`:``}`,children:a?`-`:e.value})]},s)})})]})}export{s as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{isEmpty as r}from"../lib/emptyValue.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=[`sm`,`md`],s=[`grid`,`summary`];function c(c){let{items:l=[],columns:u=2,size:d=`md`,bordered:f=!1,layout:p=`grid`,title:m,className:h=``,...g}=c;return n(`AppDescriptions`,g),t(`AppDescriptions`,`size`,d,o),t(`AppDescriptions`,`layout`,p,s),a(`div`,{className:[`descs`,`descs-col-${u}`,d&&d!==`md`?`descs-${d}`:``,f?`descs-bordered`:``,p===`summary`?`wui-descs-summary`:``,h].filter(Boolean).join(` `)||void 0,...e(`AppDescriptions`,c),...g,children:[m&&i(`div`,{className:`descs-title`,children:m}),i(`dl`,{className:`descs-list`,children:l.map((e,t)=>{let n=r(e.value),o=Math.min(12,Math.max(1,e.span??1)),s=e.key??`${e.label}-${t}`;return a(`div`,{className:`descs-item${e.emphasis?` wui-descs-emphasis`:``} wui-descs-span-${o}`,children:[i(`dt`,{className:`descs-label`,children:e.label}),i(`dd`,{className:`descs-value${n?` is-empty`:``}`,children:n?`-`:e.value})]},s)})})]})}export{c as default};
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"../lib/DiscardPrompt.js";import{useEffect as r,useRef as i,useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import"@webority/ui-elements/elements/drawer";var c=[`end`,`start`],l=[`sm`,`md`,`lg`],u=[50,90],d=e=>Array.isArray(e)&&e.length>0&&e.every(e=>Number.isFinite(e)&&e>=10&&e<=100);function f({open:f=!1,onClose:p,title:m,subtitle:h,ariaLabel:g,side:_=`end`,size:v=`md`,snapPoints:y=u,defaultSnap:b=0,onSnapChange:x,dismissible:S=!0,staticBackdrop:C=!1,confirmDiscard:w,dirty:T=!1,footer:E,className:D=``,children:O,...k}){t(`AppDrawer`,k),e(`AppDrawer`,`side`,_,c),e(`AppDrawer`,`size`,v,l),e(`AppDrawer`,`snapPoints`,d(y)?void 0:JSON.stringify(y),[`an array of numbers from 10 to 100`]);let A=i(null),j=i(null),M=i(null),[N,P]=a(!1);j.current={onClose:p,onSnapChange:x,confirmDiscard:w,dirty:T},r(()=>{f||P(!1)},[f]),r(()=>{N&&M.current?.focus()},[N]),r(()=>{let e=A.current;if(!e)return;let t=t=>{if(t.target===e){if(t.preventDefault(),j.current.confirmDiscard&&j.current.dirty){P(!0);return}j.current.onClose?.()}},n=t=>{t.target===e&&j.current.onSnapChange?.(t.detail.index,t.detail.percent)},r=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(`click`,r),()=>{e.removeEventListener(`wui-drawer-close`,t),e.removeEventListener(`wui-drawer-snap`,n),e.removeEventListener(`click`,r)}},[]);let F=()=>{P(!1),A.current?.dispatchEvent(new CustomEvent(`wui:drawer:discard`,{bubbles:!0})),j.current.onClose?.()},I=d(y)?y:u;return s(`wui-drawer`,{ref:A,...k,class:[`wui-drawer`,D].filter(Boolean).join(` `),side:_,size:v,"snap-points":I.join(`,`),"default-snap":String(b),static:C?``:void 0,"confirm-discard":w||void 0,open:f?``:void 0,children:[o(`div`,{className:`wui-drawer-backdrop`,"data-wui-drawer-backdrop":``,"aria-hidden":`true`}),s(`div`,{className:`wui-drawer-panel`,role:`dialog`,"aria-modal":`true`,"aria-label":g||m||void 0,tabIndex:-1,children:[o(`div`,{className:`wui-drawer-grip`,"data-wui-drawer-grip":``,children:o(`div`,{className:`wui-drawer-handle`,role:`slider`,tabIndex:0,"aria-orientation":`vertical`,"aria-label":`Sheet height`})}),s(`div`,{className:`wui-drawer-header`,"data-wui-drawer-grip":``,children:[s(`div`,{className:`wui-drawer-headtext`,children:[m&&o(`div`,{className:`wui-drawer-title`,children:m}),h&&o(`div`,{className:`wui-drawer-subtitle`,children:h})]}),S&&o(`button`,{type:`button`,className:`wui-drawer-close`,"data-wui-drawer-close":``,"aria-label":`Close`,children:o(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:o(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),o(`div`,{className:`wui-drawer-body`,children:O}),(E||N)&&s(`div`,{className:N?`wui-drawer-footer wui-drawer-discarding`:`wui-drawer-footer`,children:[N&&o(n,{text:w,confirmRef:M,onDiscard:F,onKeep:()=>P(!1)}),E]})]})]})}export{f as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"../lib/DiscardPrompt.js";import{useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import"@webority/ui-elements/elements/drawer";var l=[`end`,`start`],u=[`sm`,`md`,`lg`],d=[50,90],f=e=>Array.isArray(e)&&e.length>0&&e.every(e=>Number.isFinite(e)&&e>=10&&e<=100);function p(p){let{open:m=!1,onClose:h,title:g,subtitle:_,ariaLabel:v,side:y=`end`,size:b=`md`,snapPoints:x=d,defaultSnap:S=0,onSnapChange:C,dismissible:w=!0,staticBackdrop:T=!1,confirmDiscard:E,dirty:D=!1,footer:O,className:k=``,children:A,...j}=p;n(`AppDrawer`,j),t(`AppDrawer`,`side`,y,l),t(`AppDrawer`,`size`,b,u),t(`AppDrawer`,`snapPoints`,f(x)?void 0:JSON.stringify(x),[`an array of numbers from 10 to 100`]);let M=a(null),N=a(null),P=a(null),[F,I]=o(!1);N.current={onClose:h,onSnapChange:C,confirmDiscard:E,dirty:D},i(()=>{m||I(!1)},[m]),i(()=>{F&&P.current?.focus()},[F]),i(()=>{let e=M.current;if(!e)return;let t=t=>{if(t.target===e){if(t.preventDefault(),N.current.confirmDiscard&&N.current.dirty){I(!0);return}N.current.onClose?.()}},n=t=>{t.target===e&&N.current.onSnapChange?.(t.detail.index,t.detail.percent)},r=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(`click`,r),()=>{e.removeEventListener(`wui-drawer-close`,t),e.removeEventListener(`wui-drawer-snap`,n),e.removeEventListener(`click`,r)}},[]);let L=()=>{I(!1),M.current?.dispatchEvent(new CustomEvent(`wui:drawer:discard`,{bubbles:!0})),N.current.onClose?.()},R=f(x)?x:d;return c(`wui-drawer`,{ref:M,...e(`AppDrawer`,p),...j,class:[`wui-drawer`,k].filter(Boolean).join(` `),side:y,size:b,"snap-points":R.join(`,`),"default-snap":String(S),static:T?``:void 0,"confirm-discard":E||void 0,open:m?``:void 0,children:[s(`div`,{className:`wui-drawer-backdrop`,"data-wui-drawer-backdrop":``,"aria-hidden":`true`}),c(`div`,{className:`wui-drawer-panel`,role:`dialog`,"aria-modal":`true`,"aria-label":v||g||void 0,tabIndex:-1,children:[s(`div`,{className:`wui-drawer-grip`,"data-wui-drawer-grip":``,children:s(`div`,{className:`wui-drawer-handle`,role:`slider`,tabIndex:0,"aria-orientation":`vertical`,"aria-label":`Sheet height`})}),c(`div`,{className:`wui-drawer-header`,"data-wui-drawer-grip":``,children:[c(`div`,{className:`wui-drawer-headtext`,children:[g&&s(`div`,{className:`wui-drawer-title`,children:g}),_&&s(`div`,{className:`wui-drawer-subtitle`,children:_})]}),w&&s(`button`,{type:`button`,className:`wui-drawer-close`,"data-wui-drawer-close":``,"aria-label":`Close`,children:s(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:s(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),s(`div`,{className:`wui-drawer-body`,children:A}),(O||F)&&c(`div`,{className:F?`wui-drawer-footer wui-drawer-discarding`:`wui-drawer-footer`,children:[F&&s(r,{text:E,confirmRef:P,onDiscard:L,onKeep:()=>I(!1)}),O]})]})]})}export{p as default};
@@ -1 +1 @@
1
- import e from"./warnUnknownProps.js";import t from"./AppIcon.js";import n from"../lib/FieldMessage.js";import{DEFAULT_MAX_SIZE_MB as r,acceptLabel as i,validateFile as a}from"@webority/ui-elements/helpers";import{useId as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u({label:u,id:d,onChange:f,multiple:p=!1,accept:m=``,maxSizeMb:h=r,error:g,hint:_,disabled:v=!1,className:y=``,fieldClassName:b=``,style:x,...S}){e(`AppDropZone`,S);let[C,w]=s(!1),[T,E]=s(``),D=o(),O=d||D,k=g||T,A=k?`${O}-error`:void 0,j=_&&!k?`${O}-hint`:void 0,M=A||j,N=m?i(m):`Any file type`,P=e=>{let t=Array.from(e||[]);if(!t.length)return;if(!p){let e=a(t[0],{accept:m,maxSizeMb:h});E(e||``),e||f(t[0]);return}let n=``,r=[];for(let e of t){let t=a(e,{accept:m,maxSizeMb:h});if(t){n||=t;continue}r.push(e)}E(n),r.length&&f(r)};return l(`div`,{className:`field${b?` ${b}`:``}`,children:[u?c(`label`,{className:`label`,htmlFor:O,children:u}):null,l(`div`,{className:`file-input file-input-tall${C?` dragging`:``}${k?` error`:``}${y?` ${y}`:``}`,style:x,"aria-disabled":v||void 0,onDragOver:e=>{e.preventDefault(),!v&&!C&&w(!0)},onDragLeave:e=>{e.preventDefault(),w(!1)},onDrop:e=>{e.preventDefault(),w(!1),v||P(e.dataTransfer.files)},children:[l(`label`,{htmlFor:O,className:`file-input-zone-label`,children:[c(`span`,{className:`file-input-icon`,children:c(t,{name:`upload`,size:24})}),l(`span`,{className:`file-input-title`,children:[c(`span`,{className:`browse`,children:`Click to upload`}),` or drag & drop`]}),c(`span`,{className:`file-input-text`,children:h>0?`${N}, up to ${h} MB`:N})]}),c(`input`,{id:O,type:`file`,"aria-describedby":M,accept:m,multiple:p||void 0,disabled:v||void 0,className:`visually-hidden`,onClick:e=>{e.currentTarget.value=``},onChange:e=>P(e.target.files),...S})]}),c(n,{error:k,hint:_,errorId:A,hintId:j})]})}export{u as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import r from"../lib/FieldMessage.js";import{DEFAULT_MAX_SIZE_MB as i,acceptLabel as a,validateFile as o}from"@webority/ui-elements/helpers";import{useId as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";function d(d){let{label:f,id:p,onChange:m,multiple:h=!1,accept:g=``,maxSizeMb:_=i,error:v,hint:y,disabled:b=!1,className:x=``,fieldClassName:S=``,style:C,...w}=d;t(`AppDropZone`,w);let[T,E]=c(!1),[D,O]=c(``),k=s(),A=p||k,j=v||D,M=j?`${A}-error`:void 0,N=y&&!j?`${A}-hint`:void 0,P=M||N,F=g?a(g):`Any file type`,I=e=>{let t=Array.from(e||[]);if(!t.length)return;if(!h){let e=o(t[0],{accept:g,maxSizeMb:_});O(e||``),e||m(t[0]);return}let n=``,r=[];for(let e of t){let t=o(e,{accept:g,maxSizeMb:_});if(t){n||=t;continue}r.push(e)}O(n),r.length&&m(r)};return u(`div`,{...e(`AppDropZone`,d),className:`field${S?` ${S}`:``}`,children:[f?l(`label`,{className:`label`,htmlFor:A,children:f}):null,u(`div`,{className:`file-input file-input-tall${T?` dragging`:``}${j?` error`:``}${x?` ${x}`:``}`,style:C,"aria-disabled":b||void 0,onDragOver:e=>{e.preventDefault(),!b&&!T&&E(!0)},onDragLeave:e=>{e.preventDefault(),E(!1)},onDrop:e=>{e.preventDefault(),E(!1),b||I(e.dataTransfer.files)},children:[u(`label`,{htmlFor:A,className:`file-input-zone-label`,children:[l(`span`,{className:`file-input-icon`,children:l(n,{name:`upload`,size:24})}),u(`span`,{className:`file-input-title`,children:[l(`span`,{className:`browse`,children:`Click to upload`}),` or drag & drop`]}),l(`span`,{className:`file-input-text`,children:_>0?`${F}, up to ${_} MB`:F})]}),l(`input`,{id:A,type:`file`,"aria-describedby":P,accept:g,multiple:h||void 0,disabled:b||void 0,className:`visually-hidden`,onClick:e=>{e.currentTarget.value=``},onChange:e=>I(e.target.files),...w})]}),l(r,{error:j,hint:y,errorId:M,hintId:N})]})}export{d as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{shortcutAria as r,shortcutChip as i}from"../lib/shortcutChip.js";import a from"./AppIcon.js";import o from"./renderIconProp.js";import{forwardRef as s,useEffect as c,useRef as l,useState as u}from"react";import{Dropdown as d}from"react-bootstrap";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`sm`,`md`,`lg`,`xl`],h=!1;function g(){let t=!0;try{t=process.env.NODE_ENV!==`production`}catch{t=!0}!t||h||(h=!0,e("[@webority/ui-react] <AppDropdown> icon-only toggle has no accessible name — pass `label` or `ariaLabel`."))}function _({icon:e,iconSize:a,toggleClassName:s,label:h,ariaLabel:_,align:y=`end`,items:b=[],menuClassName:x=``,linkComponent:S,children:C,trigger:w,show:T,onToggle:E,...D}){n(`AppDropdown`,D);for(let e of b)t(`AppDropdown`,`items[].hiddenFrom`,e.hiddenFrom,m);!w&&!_&&!h&&g();let O=s??(w?`wui-dropdown-trigger`:`topbar-icon-btn`),k=T!==void 0,[A,j]=u(!1),M=k?!!T:A,N=l(null);N.current=(e,t)=>{k||j(e),E?.(e,t)};let P=l(null);return c(()=>{if(!M)return;let e=P.current?.getBoundingClientRect(),t=()=>{let t=P.current?.getBoundingClientRect();(!e||!t||Math.abs(t.top-e.top)>2||Math.abs(t.left-e.left)>2)&&N.current(!1,{source:`scroll`})},n=()=>N.current(!1,{source:`resize`});return window.addEventListener(`scroll`,t,{capture:!0,passive:!0}),window.addEventListener(`resize`,n),()=>{window.removeEventListener(`scroll`,t,{capture:!0}),window.removeEventListener(`resize`,n)}},[M]),p(d,{ref:P,align:y,show:M,onToggle:(e,t)=>N.current(e,t),...D,children:[f(d.Toggle,{as:v,icon:e,iconSize:a,btnClassName:O,trigger:w,title:h,"aria-label":_??(w?void 0:h)}),f(d.Menu,{className:x,renderOnMount:!0,popperConfig:{strategy:`fixed`},children:C??b.map(e=>{if(e.header!=null)return f(`div`,{className:`dropdown-header`,children:e.header},e.key);if(e.divider)return f(d.Divider,{},e.key);let t=e.to?S?{as:S,to:e.to}:{as:`a`,href:e.to}:{as:`button`,type:`button`},n=[e.danger&&`danger`,m.includes(e.hiddenFrom)&&`wui-hidden-from-${e.hiddenFrom}`].filter(Boolean).join(` `)||void 0;return p(d.Item,{...t,onClick:e.onClick,className:n,"aria-keyshortcuts":r(e.shortcut),children:[e.image?f(`img`,{src:e.image,alt:``}):o(e.icon,{size:16}),e.label,i(e.shortcut)]},e.key)})})]})}var v=s(function({icon:e,iconSize:t=20,btnClassName:n=`topbar-icon-btn`,trigger:r,"aria-label":i,className:o,...s},c){return f(`button`,{ref:c,type:`button`,className:n,"aria-label":i,...s,children:r??f(a,{name:e,size:t})})});export{_ as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{shortcutAria as i,shortcutChip as a}from"../lib/shortcutChip.js";import o from"./AppIcon.js";import s from"./renderIconProp.js";import{forwardRef as c,useEffect as l,useRef as u,useState as d}from"react";import{Dropdown as f}from"react-bootstrap";import{jsx as p,jsxs as m}from"react/jsx-runtime";var h=[`sm`,`md`,`lg`,`xl`],g=!1;function _(){let e=!0;try{e=process.env.NODE_ENV!==`production`}catch{e=!0}!e||g||(g=!0,t("[@webority/ui-react] <AppDropdown> icon-only toggle has no accessible name — pass `label` or `ariaLabel`."))}function v(t){let{icon:o,iconSize:c,toggleClassName:g,label:v,ariaLabel:b,align:x=`end`,items:S=[],menuClassName:C=``,linkComponent:w,children:T,trigger:E,show:D,onToggle:O,...k}=t;r(`AppDropdown`,k);for(let e of S)n(`AppDropdown`,`items[].hiddenFrom`,e.hiddenFrom,h);!E&&!b&&!v&&_();let A=g??(E?`wui-dropdown-trigger`:`topbar-icon-btn`),j=D!==void 0,[M,N]=d(!1),P=j?!!D:M,F=u(null);F.current=(e,t)=>{j||N(e),O?.(e,t)};let I=u(null);return l(()=>{if(!P)return;let e=I.current?.getBoundingClientRect(),t=()=>{let t=I.current?.getBoundingClientRect();(!e||!t||Math.abs(t.top-e.top)>2||Math.abs(t.left-e.left)>2)&&F.current(!1,{source:`scroll`})},n=()=>F.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)}},[P]),m(f,{ref:I,align:x,show:P,onToggle:(e,t)=>F.current(e,t),...e(`AppDropdown`,t),...k,children:[p(f.Toggle,{as:y,icon:o,iconSize:c,btnClassName:A,trigger:E,title:v,"aria-label":b??(E?void 0:v)}),p(f.Menu,{className:C,renderOnMount:!0,popperConfig:{strategy:`fixed`},children:T??S.map(e=>{if(e.header!=null)return p(`div`,{className:`dropdown-header`,children:e.header},e.key);if(e.divider)return p(f.Divider,{},e.key);let t=e.to?w?{as:w,to:e.to}:{as:`a`,href:e.to}:{as:`button`,type:`button`},n=[e.danger&&`danger`,h.includes(e.hiddenFrom)&&`wui-hidden-from-${e.hiddenFrom}`].filter(Boolean).join(` `)||void 0;return m(f.Item,{...t,onClick:e.onClick,className:n,"aria-keyshortcuts":i(e.shortcut),children:[e.image?p(`img`,{src:e.image,alt:``}):s(e.icon,{size:16}),e.label,a(e.shortcut)]},e.key)})})]})}var y=c(function({icon:e,iconSize:t=20,btnClassName:n=`topbar-icon-btn`,trigger:r,"aria-label":i,className:a,...s},c){return p(`button`,{ref:c,type:`button`,className:n,"aria-label":i,...s,children:r??p(o,{name:e,size:t})})});export{v as default};
@@ -1 +1 @@
1
- import e from"./warnUnknownProps.js";import t from"./AppIcon.js";import{formatDate as n,toInstant as r}from"@webority/ui-elements/helpers";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=864e5,s=330*6e4,c=14,l=e=>Math.floor((e+s)/o),u=(...e)=>e.filter(Boolean).join(` `);function d({date:s,soonDays:d,overdue:f=!1,overdueLabel:p,className:m=``,...h}){e(`AppDueDate`,h);let g=r(s);if(!Number.isFinite(g))return i(`wui-due-date`,{class:u(`wui-due-date`,`wui-due-date-empty`,m),...h,children:i(`time`,{children:`Not set`})});let _=l(g),v=new Date(_*o).toISOString().slice(0,10),y=_-l(Date.now());if(f){let e=n(g);return a(`wui-due-date`,{class:u(`wui-due-date`,`wui-due-date-danger`,m),title:`Overdue since ${e}`,...h,children:[i(t,{name:`danger`,size:c}),i(`time`,{dateTime:v,children:p||e})]})}if(Number.isFinite(d)&&y>=0&&y<=d){let e=y===1?`1 day left`:`${y} days left`;return i(`wui-due-date`,{class:u(`wui-due-date`,`wui-due-date-warning`,m),...h,children:i(`time`,{dateTime:v,children:e})})}return i(`wui-due-date`,{class:u(`wui-due-date`,m),...h,children:i(`time`,{dateTime:v,children:n(g)})})}export{d as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{formatDate as r,toInstant as i}from"@webority/ui-elements/helpers";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s=864e5,c=330*6e4,l=14,u=e=>Math.floor((e+c)/s),d=(...e)=>e.filter(Boolean).join(` `);function f(c){let{date:f,soonDays:p,overdue:m=!1,overdueLabel:h,className:g=``,..._}=c;t(`AppDueDate`,_);let v=i(f);if(!Number.isFinite(v))return a(`wui-due-date`,{class:d(`wui-due-date`,`wui-due-date-empty`,g),...e(`AppDueDate`,c),..._,children:a(`time`,{children:`Not set`})});let y=u(v),b=new Date(y*s).toISOString().slice(0,10),x=y-u(Date.now());if(m){let t=r(v);return o(`wui-due-date`,{class:d(`wui-due-date`,`wui-due-date-danger`,g),title:`Overdue since ${t}`,...e(`AppDueDate`,c),..._,children:[a(n,{name:`danger`,size:l}),a(`time`,{dateTime:b,children:h||t})]})}if(Number.isFinite(p)&&x>=0&&x<=p){let t=x===1?`1 day left`:`${x} days left`;return a(`wui-due-date`,{class:d(`wui-due-date`,`wui-due-date-warning`,g),...e(`AppDueDate`,c),..._,children:a(`time`,{dateTime:b,children:t})})}return a(`wui-due-date`,{class:d(`wui-due-date`,g),...e(`AppDueDate`,c),..._,children:a(`time`,{dateTime:b,children:r(v)})})}export{f as default};
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./renderIconProp.js";import r,{ILLUSTRATION_NAMES as i}from"../lib/emptyIllustration.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s=[`md`,`sm`];function c({icon:c,illustration:l,iconSize:u=24,size:d=`md`,title:f,text:p,action:m,className:h=``,style:g,..._}){t(`AppEmptyState`,_),e(`AppEmptyState`,`size`,d,s),typeof l==`string`&&e(`AppEmptyState`,`illustration`,l,i);let v=typeof l==`string`&&i.includes(l),y=l!=null&&typeof l!=`string`?l:null;return o(`div`,{className:[`empty-state`,d===`sm`?`empty-state-sm`:``,h].filter(Boolean).join(` `),style:g,..._,children:[v?a(r,{name:l,className:`wui-empty-illustration`}):null,y?a(`span`,{className:`wui-empty-illustration wui-empty-illustration-custom`,"aria-hidden":`true`,children:y}):null,c&&!v&&!y?a(`div`,{className:`empty-state-icon`,children:n(c,{size:u})}):null,f!=null&&a(`div`,{className:`empty-state-title`,children:f}),p!=null&&a(`div`,{className:`empty-state-message`,children:p}),m&&a(`div`,{className:`empty-state-action`,children:m})]})}export{c as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./renderIconProp.js";import i,{ILLUSTRATION_NAMES as a}from"../lib/emptyIllustration.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`md`,`sm`];function l(l){let{icon:u,illustration:d,iconSize:f=24,size:p=`md`,title:m,text:h,action:g,className:_=``,style:v,...y}=l;n(`AppEmptyState`,y),t(`AppEmptyState`,`size`,p,c),typeof d==`string`&&t(`AppEmptyState`,`illustration`,d,a);let b=typeof d==`string`&&a.includes(d),x=d!=null&&typeof d!=`string`?d:null;return s(`div`,{className:[`empty-state`,p===`sm`?`empty-state-sm`:``,_].filter(Boolean).join(` `),style:v,...e(`AppEmptyState`,l),...y,children:[b?o(i,{name:d,className:`wui-empty-illustration`}):null,x?o(`span`,{className:`wui-empty-illustration wui-empty-illustration-custom`,"aria-hidden":`true`,children:x}):null,u&&!b&&!x?o(`div`,{className:`empty-state-icon`,children:r(u,{size:f})}):null,m!=null&&o(`div`,{className:`empty-state-title`,children:m}),h!=null&&o(`div`,{className:`empty-state-message`,children:h}),g&&o(`div`,{className:`empty-state-action`,children:g})]})}export{l as default};
@@ -1 +1 @@
1
- import e from"./warnUnknownProps.js";import t from"../lib/focusField.js";import{useEffect as n,useId as r,useRef as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s({errors:s=[],title:c,autoFocus:l=!0,id:u,className:d=``,...f}){e(`AppErrorSummary`,f);let p=r(),m=u||p,h=i(null),g=i(0),_=s.length;return n(()=>{l&&_>0&&g.current===0&&h.current?.focus(),g.current=_},[_,l]),_?o(`div`,{ref:h,className:[`alert alert-danger wui-error-summary`,d].filter(Boolean).join(` `),role:`alert`,tabIndex:-1,"aria-labelledby":`${m}-title`,id:m,"data-autofocus":l?``:void 0,...f,children:[a(`h2`,{className:`wui-error-summary-title`,id:`${m}-title`,children:c??`Fix ${_} field${_>1?`s`:``} to continue`}),a(`ul`,{className:`wui-error-summary-list`,children:s.map(e=>a(`li`,{children:a(`a`,{href:`#${e.field}`,onClick:n=>{n.preventDefault(),t(e.field)},children:e.message})},`${e.field}:${e.message}`))})]}):null}export{s as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"../lib/focusField.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{errors:l=[],title:u,autoFocus:d=!0,id:f,className:p=``,...m}=c;t(`AppErrorSummary`,m);let h=i(),g=f||h,_=a(null),v=a(0),y=l.length;return r(()=>{d&&y>0&&v.current===0&&_.current?.focus(),v.current=y},[y,d]),y?s(`div`,{ref:_,className:[`alert alert-danger wui-error-summary`,p].filter(Boolean).join(` `),role:`alert`,tabIndex:-1,"aria-labelledby":`${g}-title`,id:g,"data-autofocus":d?``:void 0,...e(`AppErrorSummary`,c),...m,children:[o(`h2`,{className:`wui-error-summary-title`,id:`${g}-title`,children:u??`Fix ${y} field${y>1?`s`:``} to continue`}),o(`ul`,{className:`wui-error-summary-list`,children:l.map(e=>o(`li`,{children:o(`a`,{href:`#${e.field}`,onClick:t=>{t.preventDefault(),n(e.field)},children:e.message})},`${e.field}:${e.message}`))})]}):null}export{c as default};
@@ -1 +1 @@
1
- import e from"./warnUnknownProps.js";import t from"./AppIcon.js";import n from"./AppProgress.js";import r from"../lib/FieldMessage.js";import{keyOf as i,linkOf as a,nameOf as o,sizeLabelOf as s,uploadErrorOf as c,uploadProgressOf as l,useItemUrl as u}from"../lib/fileItem.js";import d from"../lib/FileItemRow.js";import{DEFAULT_IMAGE_ACCEPT as f,DEFAULT_MAX_SIZE_MB as p,acceptLabel as m,isImageFile as h,isImageOnlyAccept as g,validateFile as _}from"@webority/ui-elements/helpers";import{useId as v,useState as y}from"react";import{Fragment as b,jsx as x,jsxs as S}from"react/jsx-runtime";function C({label:n=`Attachment`,value:o,name:s,onChange:c,multiple:l=!1,accept:u=f,maxSizeMb:m=p,optional:C=!1,validate:E=!0,error:D,id:O,...k}){e(`AppFileAttachment`,k);let A=v(),j=O||A,[M,N]=y(``),[P,F]=y(!1),I=l&&Array.isArray(o)?o:o?[o]:[],L=g(u),R=e=>e instanceof File?h(e):L||h(e),z=!l&&I.length===1&&R(I[0])&&(I[0]instanceof File||a(I[0])!==null),B=w(u,m);function V(e){if(!e.length)return;let t=[],n=``;for(let r of e){let e=E?_(r,{accept:u,maxSizeMb:m}):null;if(e){n||=e;continue}t.push(r)}if(N(n),t.length)if(l){let e=Array.isArray(o)?o:o?[o]:[],n=new Set(e.map(i));c(e.concat(t.filter(e=>!n.has(i(e)))))}else c(t[0])}function H(e){let t=Array.from(e.target.files||[]);e.target.value=``,V(t)}function U(e){N(``),c(l?I.filter((t,n)=>n!==e):null)}let W=D||M,G=W?`${j}-error`:void 0,K=l||I.length===0,q=L?`image`:`file`,J=l?`Add ${q}s`:`Add ${L?`an`:`a`} ${q}`;return S(`div`,{className:`field`,children:[S(`label`,{className:`label`,htmlFor:j,children:[n,C&&x(`span`,{className:`label-optional`,children:` (optional)`})]}),K&&S(b,{children:[S(`label`,{className:`attach-drop${P?` dragging`:``}`,htmlFor:j,onDragEnter:e=>{e.preventDefault(),k.disabled||F(!0)},onDragOver:e=>{e.preventDefault(),k.disabled||F(!0)},onDragLeave:e=>{e.preventDefault(),F(!1)},onDrop:e=>{e.preventDefault(),F(!1),!k.disabled&&V(Array.from(e.dataTransfer?.files||[]))},children:[x(`span`,{className:`attach-drop-icon`,children:x(t,{name:L?`image`:`file-text`,size:18})}),S(`span`,{className:`attach-drop-copy`,children:[x(`span`,{className:`attach-drop-title`,children:J}),B&&x(`span`,{className:`attach-drop-hint`,children:B})]}),x(`span`,{className:`attach-drop-cta`,children:`Browse`})]}),x(`input`,{id:j,type:`file`,className:`visually-hidden`,name:s,accept:u||void 0,multiple:l||void 0,"aria-describedby":G,onChange:H,...k})]}),z?x(T,{item:I[0],isImage:!0,onRemove:()=>U(0)}):I.length>0&&x(`div`,{className:`attach-list`,children:I.map((e,t)=>x(d,{item:e,isImage:R(e),onRemove:()=>U(t)},i(e)))}),x(r,{error:W,errorId:`${j}-error`})]})}function w(e,t){let n=e?.trim()?m(e):``,r=t>0?`up to ${t} MB`:``;return n&&r?`${n}, ${r}`:r?`Up to ${t} MB`:n}function T({item:e,isImage:r,onRemove:i}){let d=u(e,r),f=o(e),p=s(e),m=l(e),h=c(e),g=a(e);return S(`div`,{className:h?`attach-preview wui-attach-failed`:`attach-preview`,children:[S(`div`,{className:`attach-figure`,children:[x(`img`,{src:d,alt:f}),x(`button`,{type:`button`,className:`attach-remove`,"aria-label":`Remove attachment`,onClick:i,children:x(t,{name:`x`,size:18})})]}),S(`div`,{className:`attach-meta`,children:[x(`div`,{className:`attach-name`,children:g?x(`a`,{href:g,children:f}):f}),p&&x(`div`,{className:`attach-size`,children:p})]}),m!==null&&x(n,{value:m,size:`sm`,label:`Uploading ${f}`,className:`wui-attach-progress`}),h&&x(`div`,{className:`wui-attach-error`,children:h})]})}export{C as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import r from"./AppProgress.js";import i from"../lib/FieldMessage.js";import{keyOf as a,linkOf as o,nameOf as s,sizeLabelOf as c,uploadErrorOf as l,uploadProgressOf as u,useItemUrl as d}from"../lib/fileItem.js";import f from"../lib/FileItemRow.js";import{DEFAULT_IMAGE_ACCEPT as p,DEFAULT_MAX_SIZE_MB as m,acceptLabel as h,isImageFile as g,isImageOnlyAccept as _,validateFile as v}from"@webority/ui-elements/helpers";import{useId as y,useState as b}from"react";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";function w(r){let{label:s=`Attachment`,value:c,name:l,onChange:u,multiple:d=!1,accept:h=p,maxSizeMb:w=m,optional:D=!1,validate:O=!0,error:k,id:A,...j}=r;t(`AppFileAttachment`,j);let M=y(),N=A||M,[P,F]=b(``),[I,L]=b(!1),R=d&&Array.isArray(c)?c:c?[c]:[],z=_(h),B=e=>e instanceof File?g(e):z||g(e),V=!d&&R.length===1&&B(R[0])&&(R[0]instanceof File||o(R[0])!==null),H=T(h,w);function U(e){if(!e.length)return;let t=[],n=``;for(let r of e){let e=O?v(r,{accept:h,maxSizeMb:w}):null;if(e){n||=e;continue}t.push(r)}if(F(n),t.length)if(d){let e=Array.isArray(c)?c:c?[c]:[],n=new Set(e.map(a)),r=e.concat(t.filter(e=>!n.has(a(e))));u(r)}else u(t[0])}function W(e){let t=Array.from(e.target.files||[]);e.target.value=``,U(t)}function G(e){F(``),u(d?R.filter((t,n)=>n!==e):null)}let K=k||P,q=K?`${N}-error`:void 0,J=d||R.length===0,Y=z?`image`:`file`,X=d?`Add ${Y}s`:`Add ${z?`an`:`a`} ${Y}`;return C(`div`,{...e(`AppFileAttachment`,r),className:`field`,children:[C(`label`,{className:`label`,htmlFor:N,children:[s,D&&S(`span`,{className:`label-optional`,children:` (optional)`})]}),J&&C(x,{children:[C(`label`,{className:`attach-drop${I?` dragging`:``}`,htmlFor:N,onDragEnter:e=>{e.preventDefault(),j.disabled||L(!0)},onDragOver:e=>{e.preventDefault(),j.disabled||L(!0)},onDragLeave:e=>{e.preventDefault(),L(!1)},onDrop:e=>{e.preventDefault(),L(!1),!j.disabled&&U(Array.from(e.dataTransfer?.files||[]))},children:[S(`span`,{className:`attach-drop-icon`,children:S(n,{name:z?`image`:`file-text`,size:18})}),C(`span`,{className:`attach-drop-copy`,children:[S(`span`,{className:`attach-drop-title`,children:X}),H&&S(`span`,{className:`attach-drop-hint`,children:H})]}),S(`span`,{className:`attach-drop-cta`,children:`Browse`})]}),S(`input`,{id:N,type:`file`,className:`visually-hidden`,name:l,accept:h||void 0,multiple:d||void 0,"aria-describedby":q,onChange:W,...j})]}),V?S(E,{item:R[0],isImage:!0,onRemove:()=>G(0)}):R.length>0&&S(`div`,{className:`attach-list`,children:R.map((e,t)=>S(f,{item:e,isImage:B(e),onRemove:()=>G(t)},a(e)))}),S(i,{error:K,errorId:`${N}-error`})]})}function T(e,t){let n=e?.trim()?h(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:i}){let a=d(e,t),f=s(e),p=c(e),m=u(e),h=l(e),g=o(e);return C(`div`,{className:h?`attach-preview wui-attach-failed`:`attach-preview`,children:[C(`div`,{className:`attach-figure`,children:[S(`img`,{src:a,alt:f}),S(`button`,{type:`button`,className:`attach-remove`,"aria-label":`Remove attachment`,onClick:i,children:S(n,{name:`x`,size:18})})]}),C(`div`,{className:`attach-meta`,children:[S(`div`,{className:`attach-name`,children:g?S(`a`,{href:g,children:f}):f}),p&&S(`div`,{className:`attach-size`,children:p})]}),m!==null&&S(r,{value:m,size:`sm`,label:`Uploading ${f}`,className:`wui-attach-progress`}),h&&S(`div`,{className:`wui-attach-error`,children:h})]})}export{w as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"./warnUnknownProps.js";import n from"./withTooltip.js";import r from"./AppIcon.js";import i from"../lib/FieldMessage.js";import a from"./AppRequiredMark.js";import{keyOf as o}from"../lib/fileItem.js";import s from"../lib/FileItemRow.js";import{DEFAULT_MAX_SIZE_MB as ee,acceptLabel as c,isImageFile as l,isImageOnlyAccept as u,isPdfFile as te,validateFile as d}from"@webority/ui-elements/helpers";import{useEffect as f,useId as ne,useRef as re,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";function g({label:g,value:_,name:v,id:ie,onPick:y,multiple:b=!1,maxFiles:x,accept:S=`.jpg,.jpeg,.png`,maxSizeMb:C=ee,required:ae,error:oe,hint:w,loading:T=!1,className:E=``,fieldClassName:D=``,style:O,...k}){t(`AppFilePicker`,k);let[se,A]=p(null),[ce,j]=p(null),[M,N]=p(!1),[P,F]=p(``),I=re(null),le=ne(),L=ie||le;f(()=>{if(!b&&_ instanceof File&&l(_)){let e=URL.createObjectURL(_);return A(e),()=>URL.revokeObjectURL(e)}A(null)},[_,b]);let R=!b&&_&&!l(_)&&te(_)?_ instanceof File?_:_.url:null;f(()=>{if(!R){j(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),j(n))}).catch(t=>e(`[AppFilePicker] the PDF preview failed:`,t?.message)),()=>{t=!1,j(null),n&&URL.revokeObjectURL(n)}},[R]);let z=b?Array.isArray(_)?_:_?[_]:[]:[],B=oe||P,V=B?`${L}-error`:void 0,H=w&&!B?`${L}-hint`:void 0,U=V||H,W=u(S),G=!b&&!!_,K=G&&(_ instanceof File?l(_):W||l(_)),ue=_?.name,q=K?_?.url||se:ce,J=K?`image`:`file`,de=g?`Change ${g}`:`Change ${J}`,Y=g?`Remove ${g}`:`Remove ${J}`,fe=g?`${g} preview`:`Selected ${J} preview`,X=e=>{let t=d(e,{accept:S,maxSizeMb:C});return t?(F(t),!1):(F(``),y(e),!0)},Z=e=>{let t=Array.from(e||[]);if(!t.length)return;let n=Array.isArray(_)?_:_?[_]:[],r=new Set(n.map(o)),i=``,a=[];for(let e of t){let t=d(e,{accept:S,maxSizeMb:C});if(t){i||=t;continue}r.has(o(e))||(r.add(o(e)),a.push(e))}let s=n.concat(a);x&&s.length>x&&(s=s.slice(0,x),i||=`Up to ${x} files.`),F(i),y(s)},pe=e=>{if(b){Z(e.target.files);return}let t=e.target.files?.[0]||null;t&&(X(t)||(e.target.value=``))},me=e=>{if(e.preventDefault(),N(!1),T)return;if(b){Z(e.dataTransfer.files);return}let t=e.dataTransfer.files?.[0];t&&X(t)},he=e=>{F(``),y(z.filter((t,n)=>n!==e))},ge=()=>I.current?.click(),Q=T?m(`span`,{className:`wui-file-busy`,children:m(`span`,{className:`spinner-border spinner-border-sm`,role:`status`,"aria-label":`Loading`})}):null,$=m(`input`,{id:L,name:v,ref:I,type:`file`,"aria-describedby":U,accept:S,multiple:b||void 0,disabled:T||void 0,className:`visually-hidden`,onClick:e=>{e.currentTarget.value=``},onChange:pe,...k});return h(`div`,{className:`field${D?` ${D}`:``}`,children:[h(`label`,{className:`label`,htmlFor:L,children:[g,ae&&m(a,{})]}),G?h(`div`,{className:`file-preview${B?` error`:``}${E?` ${E}`:``}`,style:O,"aria-busy":T||void 0,children:[h(`button`,{type:`button`,className:`file-preview-open`,"aria-label":de,onClick:ge,disabled:T,children:[q?m(`img`,{src:q,alt:fe,className:`file-preview-img`}):h(`span`,{className:`file-preview-file`,children:[m(r,{name:`file-text`,size:28}),m(`span`,{className:`file-preview-file-name`,children:ue})]}),m(`span`,{className:`file-preview-overlay`,children:h(`span`,{className:`file-preview-cta`,children:[m(r,{name:K?`image`:`file-text`,size:16}),` `,K?`Change image`:`Change file`]})})]}),n(m(`button`,{type:`button`,className:`file-preview-remove`,"aria-label":Y,onClick:()=>y(null),disabled:T,children:m(r,{name:`x`,size:16})}),Y),$,Q]}):h(`div`,{className:`file-input file-input-tall${M?` dragging`:``}${B?` error`:``}${b&&z.length>0?` has-files`:``}${E?` ${E}`:``}`,style:O,"aria-busy":T||void 0,onDragOver:e=>{e.preventDefault(),!T&&!M&&N(!0)},onDragLeave:e=>{e.preventDefault(),N(!1)},onDrop:me,children:[h(`label`,{htmlFor:L,className:`file-input-zone-label`,children:[m(`span`,{className:`file-input-icon`,children:m(r,{name:`upload`,size:24})}),h(`span`,{className:`file-input-title`,children:[m(`span`,{className:`browse`,children:`Click to upload`}),` or drag & drop`]}),m(`span`,{className:`file-input-text`,children:C>0?`${c(S)}, up to ${C} MB`:c(S)})]}),$,Q,b&&z.length>0&&m(`div`,{className:`attach-list`,children:z.map((e,t)=>m(s,{item:e,isImage:e instanceof File?l(e):W||l(e),noun:`file`,onRemove:()=>he(t)},o(e)))})]}),m(i,{error:B,hint:w,errorId:V,hintId:H})]})}export{g as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnUnknownProps.js";import r from"./withTooltip.js";import i from"./AppIcon.js";import a from"../lib/FieldMessage.js";import o from"./AppRequiredMark.js";import{keyOf as s}from"../lib/fileItem.js";import ee from"../lib/FileItemRow.js";import{DEFAULT_MAX_SIZE_MB as c,acceptLabel as l,isImageFile as u,isImageOnlyAccept as te,isPdfFile as ne,validateFile as d}from"@webority/ui-elements/helpers";import{useEffect as f,useId as re,useRef as ie,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";function g(g){let{label:_,value:v,name:ae,id:oe,onPick:y,multiple:b=!1,maxFiles:x,accept:S=`.jpg,.jpeg,.png`,maxSizeMb:C=c,required:se,error:w,hint:T,loading:E=!1,className:D=``,fieldClassName:O=``,style:k,...A}=g;n(`AppFilePicker`,A);let[ce,j]=p(null),[M,N]=p(null),[P,F]=p(!1),[le,I]=p(``),L=ie(null),ue=re(),R=oe||ue;f(()=>{if(!b&&v instanceof File&&u(v)){let e=URL.createObjectURL(v);return j(e),()=>URL.revokeObjectURL(e)}j(null)},[v,b]);let z=!b&&v&&!u(v)&&ne(v)?v instanceof File?v:v.url:null;f(()=>{if(!z){N(null);return}let e=!0,n=null;return import(`@webority/ui-elements/file-viewer`).then(e=>e.renderPdfFirstPage(typeof z==`string`?{url:z}:z)).then(t=>{e&&(n=URL.createObjectURL(t),N(n))}).catch(e=>t(`[AppFilePicker] the PDF preview failed:`,e?.message)),()=>{e=!1,N(null),n&&URL.revokeObjectURL(n)}},[z]);let B=b?Array.isArray(v)?v:v?[v]:[]:[],V=w||le,H=V?`${R}-error`:void 0,U=T&&!V?`${R}-hint`:void 0,de=H||U,W=te(S),G=!b&&!!v,K=G&&(v instanceof File?u(v):W||u(v)),fe=v?.name,q=K?v?.url||ce:M,J=K?`image`:`file`,pe=_?`Change ${_}`:`Change ${J}`,Y=_?`Remove ${_}`:`Remove ${J}`,me=_?`${_} preview`:`Selected ${J} preview`,X=e=>{let t=d(e,{accept:S,maxSizeMb:C});return t?(I(t),!1):(I(``),y(e),!0)},Z=e=>{let t=Array.from(e||[]);if(!t.length)return;let n=Array.isArray(v)?v:v?[v]:[],r=new Set(n.map(s)),i=``,a=[];for(let e of t){let t=d(e,{accept:S,maxSizeMb:C});if(t){i||=t;continue}r.has(s(e))||(r.add(s(e)),a.push(e))}let o=n.concat(a);x&&o.length>x&&(o=o.slice(0,x),i||=`Up to ${x} files.`),I(i),y(o)},he=e=>{if(b){Z(e.target.files);return}let t=e.target.files?.[0]||null;t&&(X(t)||(e.target.value=``))},ge=e=>{if(e.preventDefault(),F(!1),E)return;if(b){Z(e.dataTransfer.files);return}let t=e.dataTransfer.files?.[0];t&&X(t)},_e=e=>{I(``),y(B.filter((t,n)=>n!==e))},ve=()=>L.current?.click(),Q=E?m(`span`,{className:`wui-file-busy`,children:m(`span`,{className:`spinner-border spinner-border-sm`,role:`status`,"aria-label":`Loading`})}):null,$=m(`input`,{id:R,name:ae,ref:L,type:`file`,"aria-describedby":de,accept:S,multiple:b||void 0,disabled:E||void 0,className:`visually-hidden`,onClick:e=>{e.currentTarget.value=``},onChange:he,...A});return h(`div`,{...e(`AppFilePicker`,g),className:`field${O?` ${O}`:``}`,children:[h(`label`,{className:`label`,htmlFor:R,children:[_,se&&m(o,{})]}),G?h(`div`,{className:`file-preview${V?` error`:``}${D?` ${D}`:``}`,style:k,"aria-busy":E||void 0,children:[h(`button`,{type:`button`,className:`file-preview-open`,"aria-label":pe,onClick:ve,disabled:E,children:[q?m(`img`,{src:q,alt:me,className:`file-preview-img`}):h(`span`,{className:`file-preview-file`,children:[m(i,{name:`file-text`,size:28}),m(`span`,{className:`file-preview-file-name`,children:fe})]}),m(`span`,{className:`file-preview-overlay`,children:h(`span`,{className:`file-preview-cta`,children:[m(i,{name:K?`image`:`file-text`,size:16}),` `,K?`Change image`:`Change file`]})})]}),r(m(`button`,{type:`button`,className:`file-preview-remove`,"aria-label":Y,onClick:()=>y(null),disabled:E,children:m(i,{name:`x`,size:16})}),Y),$,Q]}):h(`div`,{className:`file-input file-input-tall${P?` dragging`:``}${V?` error`:``}${b&&B.length>0?` has-files`:``}${D?` ${D}`:``}`,style:k,"aria-busy":E||void 0,onDragOver:e=>{e.preventDefault(),!E&&!P&&F(!0)},onDragLeave:e=>{e.preventDefault(),F(!1)},onDrop:ge,children:[h(`label`,{htmlFor:R,className:`file-input-zone-label`,children:[m(`span`,{className:`file-input-icon`,children:m(i,{name:`upload`,size:24})}),h(`span`,{className:`file-input-title`,children:[m(`span`,{className:`browse`,children:`Click to upload`}),` or drag & drop`]}),m(`span`,{className:`file-input-text`,children:C>0?`${l(S)}, up to ${C} MB`:l(S)})]}),$,Q,b&&B.length>0&&m(`div`,{className:`attach-list`,children:B.map((e,t)=>m(ee,{item:e,isImage:e instanceof File?u(e):W||u(e),noun:`file`,onRemove:()=>_e(t)},s(e)))})]}),m(a,{error:V,hint:T,errorId:H,hintId:U})]})}export{g as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.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";var f=`wui-file-viewer:load`,p=`wui-file-viewer:error`,m=`wui-file-viewer:prefs-change`,h=n(function({src:n,name:h,type:g,prefs:_,onPrefsChange:v,viewKey:y,download:b=!1,print:x=!0,workerSrc:S,assetBase:C,captions:w,actions:T,onLoad:E,onError:D,className:O=``,style:k,...A},j){t(`AppFileViewer`,A);let M=o(null),N=o(E),P=o(D),F=o(v),[I,L]=s(null),R=r(e=>{M.current=e,typeof j==`function`?j(e):j&&(j.current=e)},[j]);return a(()=>{_!==void 0&&(M.current.prefs=_)},[_]),i(()=>{N.current=E,P.current=D,F.current=v}),i(()=>{let e=M.current,t=e=>N.current?.(e.detail),n=e=>P.current?.(e.detail),r=e=>F.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 t=!0;return import(`@webority/ui-elements/file-viewer`).then(()=>{let e=M.current;t&&e?.isConnected&&L(e.actionsContainer)}).catch(n=>{e(`[AppFileViewer] the viewer failed to load:`,n?.message),t&&P.current?.({message:n?.message??String(n)})}),()=>{t=!1}},[]),u(c,{children:[l(`wui-file-viewer`,{ref:R,src:n,name:h||void 0,type:g||void 0,"view-key":y||void 0,download:b?``:void 0,print:x?void 0:`false`,"worker-src":S||void 0,"asset-base":C||void 0,captions:w||void 0,className:O||void 0,style:k,...A}),I&&T!=null&&d(l(`div`,{slot:`actions`,className:`wui-file-viewer-slot`,children:T}),I)]})});export{h as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnUnknownProps.js";import{forwardRef as r,useCallback as i,useEffect as a,useLayoutEffect as o,useRef as s,useState as c}from"react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{createPortal as f}from"react-dom";var p=`wui-file-viewer:load`,m=`wui-file-viewer:error`,h=`wui-file-viewer:prefs-change`,g=r(function(r,g){let{src:_,name:v,type:y,prefs:b,onPrefsChange:x,viewKey:S,download:C=!1,print:w=!0,workerSrc:T,assetBase:E,captions:D,actions:O,onLoad:k,onError:A,className:j=``,style:M,...N}=r;n(`AppFileViewer`,N);let P=s(null),F=s(k),I=s(A),L=s(x),[R,z]=c(null),B=i(e=>{P.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]);return o(()=>{b!==void 0&&(P.current.prefs=b)},[b]),a(()=>{F.current=k,I.current=A,L.current=x}),a(()=>{let e=P.current,t=e=>F.current?.(e.detail),n=e=>I.current?.(e.detail),r=e=>L.current?.(e.detail);return e.addEventListener(p,t),e.addEventListener(m,n),e.addEventListener(h,r),()=>{e.removeEventListener(p,t),e.removeEventListener(m,n),e.removeEventListener(h,r)}},[]),a(()=>{let e=!0;return import(`@webority/ui-elements/file-viewer`).then(()=>{let t=P.current;e&&t?.isConnected&&z(t.actionsContainer)}).catch(n=>{t(`[AppFileViewer] the viewer failed to load:`,n?.message),e&&I.current?.({message:n?.message??String(n)})}),()=>{e=!1}},[]),d(l,{children:[u(`wui-file-viewer`,{ref:B,src:_,name:v||void 0,type:y||void 0,"view-key":S||void 0,download:C?``:void 0,print:w?void 0:`false`,"worker-src":T||void 0,"asset-base":E||void 0,captions:D||void 0,className:j||void 0,style:M,...e(`AppFileViewer`,r),...N}),R&&O!=null&&f(u(`div`,{slot:`actions`,className:`wui-file-viewer-slot`,children:O}),R)]})});export{g as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"./AppButton.js";import a from"./AppSegmented.js";import ee from"./AppChip.js";import o from"./AppDateRangePicker.js";import{emptyFacetValue as s,isFacetActive as c}from"../lib/listQuery.js";import l from"./AppMultiSelect.js";import u from"./AppSearch.js";import d from"./AppSelect.js";import f from"./AppSwitch.js";import{Fragment as te,useEffect as p,useId as m,useRef as h,useState as ne,useSyncExternalStore as re}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import"@webority/ui-elements/elements/filter-popover";var y=`(max-width: 575.98px)`,b=3,x=2,ie=e=>{let t=window.matchMedia?.(y);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},ae=()=>window.matchMedia?.(y).matches??!1,S=[`enum`,`multiEnum`,`dateRange`,`text`],C=4,w=e=>(e.type===`enum`||e.type===`multiEnum`)&&!e.options?.length,T=(e,t)=>e.options?.find(e=>e.value===t)?.label??t,oe=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function se(e,t){if(!c(e,t))return[];if(e.type===`enum`)return[{id:e.key,text:T(e,t),clear:()=>s(e)}];if(e.type===`multiEnum`)return t.map(n=>({id:`${e.key}:${n}`,text:T(e,n),clear:()=>t.filter(e=>e!==n)}));if(e.type===`dateRange`){let n=t.from&&t.to?`${t.from} to ${t.to}`:t.from?`From ${t.from}`:`Until ${t.to}`;return[{id:e.key,text:n,clear:()=>s(e)}]}return[]}var E=new Set;function D(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 O=new Set;function k(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 presets, which only a dateRange facet uses.`))}function A({facets:e,value:a,onChange:o,inline:l=b,floating:u=!1,apply:d=!1,className:y=``,...C}){n(`AppFilterBar`,C);let T=re(ie,ae,()=>!1),E=h(null),O=m(),[A,M]=ne({}),N=h(a);for(let n of e)t(`AppFilterBar`,`facets[].type`,n.type,S);for(let t of e)t.allLabel!=null&&t.type!==`enum`&&D(t.key),t.presets!=null&&t.type!==`dateRange`&&k(t.key);let P=e.filter(e=>!w(e)),F=P.flatMap(e=>se(e,a[e.key]).map(t=>({...t,facet:e}))),I=P.filter(e=>c(e,a[e.key])),L=u||T?0:Math.max(0,l),R=P.slice(L),z=R.filter(e=>I.includes(e)).length,B=!u&&R.length>0;p(()=>{if(!B)return;let e=e=>{let t=E.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)}},[B]),p(()=>{let e=N.current;N.current=a,M(t=>{let n=Object.entries(t).filter(([t])=>oe(e[t],a[t]));return n.length===Object.keys(t).length?t:Object.fromEntries(n)})},[a]);let V=e=>d&&!u&&(e.type===`text`||e.type===`dateRange`),H=e=>V(e)&&Object.hasOwn(A,e.key)?A[e.key]:a[e.key],U=e=>t=>V(e)?M(n=>({...n,[e.key]:t})):o(e.key,t),W=()=>{for(let[e,t]of Object.entries(A))o(e,t);M({})},G=e=>{e.key===`Enter`&&W()},ce=e=>{e.preventDefault(),W()},K=(e,t)=>e.type===`text`&&V(e)?_(`span`,{onKeyDownCapture:G,children:t}):t,le=e=>_(te,{children:K(e,_(j,{facet:e,value:H(e),onChange:U(e)}))},e.key),q=e=>v(`div`,{className:`wui-filter-popover-field`,children:[_(`span`,{className:`label`,"aria-hidden":`true`,children:e.label}),K(e,_(j,{facet:e,value:H(e),onChange:U(e),floating:!0}))]},e.key),J=(e,t)=>t>0&&_(`span`,{className:e,children:` (${t})`}),Y=e=>_(ee,{size:`sm`,label:`${e.facet.label}: ${e.text}`,removeLabel:`Remove ${e.facet.label} filter ${e.text}`,onRemove:()=>o(e.facet.key,e.clear()),className:!u&&P.indexOf(e.facet)<L?`wui-filter-chip-inline`:void 0},e.id),X=_(i,{variant:`ghost`,size:`sm`,onClick:()=>{for(let e of I)o(e.key,s(e));M({})},children:`Clear all`});if(u){let e=F.slice(x),t=I.length;return v(`div`,{className:`wui-filter-bar d-flex flex-wrap align-items-center gap-2${y?` ${y}`:``}`,...C,children:[v(`wui-filter-popover`,{class:`wui-filter-popover`,children:[v(`button`,{type:`button`,className:`btn ${t>0?`btn-outline-primary`:`btn-ghost`} btn-sm wui-filter-popover-trigger`,"aria-expanded":`false`,"aria-controls":O,"aria-label":t>0?`Filters, ${t} active`:void 0,children:[_(r,{name:`filter`,size:14,className:`me-2`}),`Filters`,t>0&&_(`span`,{className:`badge rounded-pill text-bg-primary ms-1`,children:t})]}),v(`div`,{id:O,className:`wui-filter-popover-panel`,role:`dialog`,"aria-label":`Filters`,hidden:!0,children:[v(`div`,{className:`wui-filter-popover-head`,children:[_(`span`,{className:`wui-filter-popover-title`,children:`Filters`}),_(f,{label:`Keep open`,id:`${O}-pin`})]}),_(`div`,{className:`wui-filter-popover-grid`,children:P.map(q)}),v(`div`,{className:`wui-filter-popover-foot`,children:[_(`span`,{className:`wui-filter-popover-note`,children:`Changes apply at once.`}),t>0&&X]})]})]}),F.slice(0,x).map(Y),e.length>0&&v(`span`,{className:`chip chip-sm wui-filter-popover-more`,title:e.map(e=>`${e.facet.label}: ${e.text}`).join(`, `),children:[`+`,e.length]})]})}let Z=`wui-filter-bar d-flex flex-wrap align-items-center gap-2${T&&B?` wui-filter-bar--folded`:``}`,Q=e=>`${e}${y?` ${y}`:``}`,$=v(g,{children:[P.slice(0,L).map(le),B&&v(`details`,{ref:E,className:`wui-filter-more`,children:[v(`summary`,{className:`btn btn-outline-primary btn-sm wui-filter-more-trigger`,children:[_(r,{name:`filter`,size:14,className:`me-2`}),`Filters`,J(`wui-filter-count-desktop`,z),J(`wui-filter-count-phone`,I.length)]}),v(`div`,{className:`wui-filter-more-panel`,children:[_(`div`,{className:`wui-filter-more-head`,children:`Filters`}),R.map(q)]})]}),F.map(Y),I.length>0&&X]});return!d||!P.some(e=>e.type===`text`||e.type===`dateRange`)?_(`div`,{className:Q(Z),...C,children:$}):v(`div`,{className:Q(`wui-filter-form d-flex flex-wrap align-items-center gap-2`),...C,children:[_(`div`,{className:Z,children:$}),_(i,{type:`submit`,size:`sm`,onClick:ce,children:`Apply`})]})}function j({facet:e,value:t,onChange:n,floating:r=!1}){if(e.type===`enum`){let i=e.options??[];return i.length<C?_(a,{label:e.label,name:e.key,size:`sm`,value:t??``,onChange:n,options:[{value:``,label:e.allLabel||`All`},...i]}):_(d,{"aria-label":e.label,name:e.key,placeholder:r?`Any`:e.label,size:`sm`,clearable:!0,value:t??``,onChange:n,options:i})}return e.type===`multiEnum`?_(l,{"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`?_(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??``})}):_(u,{ariaLabel:e.label,name:e.key,placeholder:e.label,size:`sm`,value:t??``,onChange:n})}export{A as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import i from"./AppIcon.js";import a from"./AppButton.js";import o from"./AppSegmented.js";import ee from"./AppChip.js";import s from"./AppDateRangePicker.js";import{emptyFacetValue as c,isFacetActive as l}from"../lib/listQuery.js";import u from"./AppMultiSelect.js";import d from"./AppSearch.js";import f from"./AppSelect.js";import te from"./AppSwitch.js";import{Fragment as ne,useEffect as p,useId as re,useRef as m,useState as ie,useSyncExternalStore as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import"@webority/ui-elements/elements/filter-popover";var y=`(max-width: 575.98px)`,ae=3,b=2,x=e=>{let t=window.matchMedia?.(y);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},S=()=>window.matchMedia?.(y).matches??!1,C=[`enum`,`multiEnum`,`dateRange`,`text`],w=4,oe=e=>(e.type===`enum`||e.type===`multiEnum`)&&!e.options?.length,T=(e,t)=>e.options?.find(e=>e.value===t)?.label??t,se=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function ce(e,t){if(!l(e,t))return[];if(e.type===`enum`)return[{id:e.key,text:T(e,t),clear:()=>c(e)}];if(e.type===`multiEnum`)return t.map(n=>({id:`${e.key}:${n}`,text:T(e,n),clear:()=>t.filter(e=>e!==n)}));if(e.type===`dateRange`){let n=t.from&&t.to?`${t.from} to ${t.to}`:t.from?`From ${t.from}`:`Until ${t.to}`;return[{id:e.key,text:n,clear:()=>c(e)}]}return[]}var E=new Set;function D(e){let n=!0;try{n=process.env.NODE_ENV!==`production`}catch{n=!0}!n||E.has(e)||(E.add(e),t(`[@webority/ui-react] <AppFilterBar> facet "${e}" sets allLabel, which only an enum facet uses.`))}var O=new Set;function le(e){let n=!0;try{n=process.env.NODE_ENV!==`production`}catch{n=!0}!n||O.has(e)||(O.add(e),t(`[@webority/ui-react] <AppFilterBar> facet "${e}" sets presets, which only a dateRange facet uses.`))}function k(t){let{facets:o,value:s,onChange:u,inline:d=ae,floating:f=!1,apply:y=!1,className:w=``,...T}=t;r(`AppFilterBar`,T);let E=h(x,S,()=>!1),O=m(null),k=re(),[j,M]=ie({}),N=m(s);for(let e of o)n(`AppFilterBar`,`facets[].type`,e.type,C);for(let e of o)e.allLabel!=null&&e.type!==`enum`&&D(e.key),e.presets!=null&&e.type!==`dateRange`&&le(e.key);let P=o.filter(e=>!oe(e)),F=P.flatMap(e=>ce(e,s[e.key]).map(t=>({...t,facet:e}))),I=P.filter(e=>l(e,s[e.key])),L=f||E?0:Math.max(0,d),R=P.slice(L),z=R.filter(e=>I.includes(e)).length,B=!f&&R.length>0;p(()=>{if(!B)return;let e=e=>{let t=O.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)}},[B]),p(()=>{let e=N.current;N.current=s,M(t=>{let n=Object.entries(t).filter(([t])=>se(e[t],s[t]));return n.length===Object.keys(t).length?t:Object.fromEntries(n)})},[s]);let V=e=>y&&!f&&(e.type===`text`||e.type===`dateRange`),H=e=>V(e)&&Object.hasOwn(j,e.key)?j[e.key]:s[e.key],U=e=>t=>V(e)?M(n=>({...n,[e.key]:t})):u(e.key,t),W=()=>{for(let[e,t]of Object.entries(j))u(e,t);M({})},ue=e=>{e.key===`Enter`&&W()},G=e=>{e.preventDefault(),W()},K=(e,t)=>e.type===`text`&&V(e)?_(`span`,{onKeyDownCapture:ue,children:t}):t,de=e=>_(ne,{children:K(e,_(A,{facet:e,value:H(e),onChange:U(e)}))},e.key),q=e=>v(`div`,{className:`wui-filter-popover-field`,children:[_(`span`,{className:`label`,"aria-hidden":`true`,children:e.label}),K(e,_(A,{facet:e,value:H(e),onChange:U(e),floating:!0}))]},e.key),J=(e,t)=>t>0&&_(`span`,{className:e,children:` (${t})`}),Y=e=>_(ee,{size:`sm`,label:`${e.facet.label}: ${e.text}`,removeLabel:`Remove ${e.facet.label} filter ${e.text}`,onRemove:()=>u(e.facet.key,e.clear()),className:!f&&P.indexOf(e.facet)<L?`wui-filter-chip-inline`:void 0},e.id),X=_(a,{variant:`ghost`,size:`sm`,onClick:()=>{for(let e of I)u(e.key,c(e));M({})},children:`Clear all`});if(f){let n=F.slice(b),r=I.length;return v(`div`,{className:`wui-filter-bar d-flex flex-wrap align-items-center gap-2${w?` ${w}`:``}`,...e(`AppFilterBar`,t),...T,children:[v(`wui-filter-popover`,{class:`wui-filter-popover`,children:[v(`button`,{type:`button`,className:`btn ${r>0?`btn-outline-primary`:`btn-ghost`} btn-sm wui-filter-popover-trigger`,"aria-expanded":`false`,"aria-controls":k,"aria-label":r>0?`Filters, ${r} active`:void 0,children:[_(i,{name:`filter`,size:14,className:`me-2`}),`Filters`,r>0&&_(`span`,{className:`badge rounded-pill text-bg-primary ms-1`,children:r})]}),v(`div`,{id:k,className:`wui-filter-popover-panel`,role:`dialog`,"aria-label":`Filters`,hidden:!0,children:[v(`div`,{className:`wui-filter-popover-head`,children:[_(`span`,{className:`wui-filter-popover-title`,children:`Filters`}),_(te,{label:`Keep open`,id:`${k}-pin`})]}),_(`div`,{className:`wui-filter-popover-grid`,children:P.map(q)}),v(`div`,{className:`wui-filter-popover-foot`,children:[_(`span`,{className:`wui-filter-popover-note`,children:`Changes apply at once.`}),r>0&&X]})]})]}),F.slice(0,b).map(Y),n.length>0&&v(`span`,{className:`chip chip-sm wui-filter-popover-more`,title:n.map(e=>`${e.facet.label}: ${e.text}`).join(`, `),children:[`+`,n.length]})]})}let Z=`wui-filter-bar d-flex flex-wrap align-items-center gap-2${E&&B?` wui-filter-bar--folded`:``}`,Q=e=>`${e}${w?` ${w}`:``}`,$=v(g,{children:[P.slice(0,L).map(de),B&&v(`details`,{ref:O,className:`wui-filter-more`,children:[v(`summary`,{className:`btn btn-outline-primary btn-sm wui-filter-more-trigger`,children:[_(i,{name:`filter`,size:14,className:`me-2`}),`Filters`,J(`wui-filter-count-desktop`,z),J(`wui-filter-count-phone`,I.length)]}),v(`div`,{className:`wui-filter-more-panel`,children:[_(`div`,{className:`wui-filter-more-head`,children:`Filters`}),R.map(q)]})]}),F.map(Y),I.length>0&&X]});return!y||!P.some(e=>e.type===`text`||e.type===`dateRange`)?_(`div`,{className:Q(Z),...e(`AppFilterBar`,t),...T,children:$}):v(`div`,{className:Q(`wui-filter-form d-flex flex-wrap align-items-center gap-2`),...e(`AppFilterBar`,t),...T,children:[_(`div`,{className:Z,children:$}),_(a,{type:`submit`,size:`sm`,onClick:G,children:`Apply`})]})}function A({facet:e,value:t,onChange:n,floating:r=!1}){if(e.type===`enum`){let i=e.options??[];return i.length<w?_(o,{label:e.label,name:e.key,size:`sm`,value:t??``,onChange:n,options:[{value:``,label:e.allLabel||`All`},...i]}):_(f,{"aria-label":e.label,name:e.key,placeholder:r?`Any`:e.label,size:`sm`,clearable:!0,value:t??``,onChange:n,options:i})}return e.type===`multiEnum`?_(u,{"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`?_(s,{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??``})}):_(d,{ariaLabel:e.label,name:e.key,placeholder:e.label,size:`sm`,value:t??``,onChange:n})}export{k as default};
@@ -1 +1 @@
1
- import e from"./warnUnknownProps.js";import t from"./renderIconProp.js";import{Fragment as n,jsx as r,jsxs as i}from"react/jsx-runtime";import"@webority/ui-elements/elements/dock";function a({items:a=[],linkComponent:o,ariaLabel:s=`Quick navigation`,magnify:c=!0,maxScale:l,radius:u,className:d=``,...f}){return e(`AppFloatingDock`,f),r(`wui-dock`,{role:`navigation`,"aria-label":s,static:c?void 0:``,"max-scale":l??void 0,radius:u??void 0,class:d||void 0,...f,children:a.map((e,a)=>{let s=e.key??`${e.title}-${a}`,c=i(n,{children:[r(`span`,{className:`dock-item-tip`,"aria-hidden":`true`,children:e.title}),r(`span`,{className:`dock-item-icon`,children:t(e.icon,{size:18})})]});if(e.to&&o)return r(o,{className:`dock-item`,to:e.to,"aria-label":e.title,children:c},s);let l=e.href??e.to;return l?r(`a`,{className:`dock-item`,href:l,"aria-label":e.title,children:c},s):r(`button`,{type:`button`,className:`dock-item`,onClick:e.onClick,"aria-label":e.title,children:c},s)})})}export{a as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./renderIconProp.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{items:s=[],linkComponent:c,ariaLabel:l=`Quick navigation`,magnify:u=!0,maxScale:d,radius:f,className:p=``,...m}=o;return t(`AppFloatingDock`,m),i(`wui-dock`,{role:`navigation`,"aria-label":l,static:u?void 0:``,"max-scale":d??void 0,radius:f??void 0,class:p||void 0,...e(`AppFloatingDock`,o),...m,children:s.map((e,t)=>{let o=e.key??`${e.title}-${t}`,s=a(r,{children:[i(`span`,{className:`dock-item-tip`,"aria-hidden":`true`,children:e.title}),i(`span`,{className:`dock-item-icon`,children:n(e.icon,{size:18})})]});if(e.to&&c)return i(c,{className:`dock-item`,to:e.to,"aria-label":e.title,children:s},o);let l=e.href??e.to;return l?i(`a`,{className:`dock-item`,href:l,"aria-label":e.title,children:s},o):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 e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{jsx as n}from"react/jsx-runtime";var r=[`end`,`start`,`between`];function i({children:i,sticky:a=!1,align:o=`end`,className:s=``,...c}){return t(`AppFormActions`,c),e(`AppFormActions`,`align`,o,r),n(`div`,{className:[`form-actions`,a?`form-actions-sticky`:``,o&&o!==`end`?`form-actions-${o}`:``,s].filter(Boolean).join(` `),...c,children:i})}export{i as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i=[`end`,`start`,`between`];function a(a){let{children:o,sticky:s=!1,align:c=`end`,className:l=``,...u}=a;return n(`AppFormActions`,u),t(`AppFormActions`,`align`,c,i),r(`div`,{className:[`form-actions`,s?`form-actions-sticky`:``,c&&c!==`end`?`form-actions-${c}`:``,l].filter(Boolean).join(` `),...e(`AppFormActions`,a),...u,children:o})}export{a as default};
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{jsx as n}from"react/jsx-runtime";var r=[1,2,3];function i({children:i,columns:a=2,className:o=``,...s}){t(`AppFormRow`,s),e(`AppFormRow`,`columns`,a,r);let{style:c,...l}=s;return n(`div`,{className:[`form-row-grid`,`wui-form-cols-${Math.min(12,Math.max(1,a))}`,o].filter(Boolean).join(` `),style:c,...l,children:i})}export{i as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i=[1,2,3];function a(a){let{children:o,columns:s=2,className:c=``,...l}=a;n(`AppFormRow`,l),t(`AppFormRow`,`columns`,s,i);let{style:u,...d}=l;return r(`div`,{className:[`form-row-grid`,`wui-form-cols-${Math.min(12,Math.max(1,s))}`,c].filter(Boolean).join(` `),style:u,...e(`AppFormRow`,a),...d,children:o})}export{a as default};
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";var i=[`stacked`,`side`],a=[`top`,`start`],o=[`comfortable`,`compact`],s=[2,3,4];function c({children:c,title:l,description:u,layout:d=`stacked`,labels:f=`top`,density:p=`comfortable`,headingLevel:m=3,className:h=``,...g}){t(`AppFormSection`,g),e(`AppFormSection`,`layout`,d,i),e(`AppFormSection`,`labels`,f,a),e(`AppFormSection`,`density`,p,o),e(`AppFormSection`,`headingLevel`,m,s);let _=s.includes(m)?`h${m}`:`h3`;return r(`section`,{className:[`form-section`,d===`side`?`wui-form-side`:``,f===`start`?`wui-form-labels-start`:``,p===`compact`?`wui-form-compact`:``,h].filter(Boolean).join(` `),...g,children:[(l!=null||u!=null)&&r(`div`,{className:`form-section-head`,children:[l!=null&&n(_,{className:`form-section-title`,children:l}),u!=null&&n(`p`,{className:`form-section-desc`,children:u})]}),n(`div`,{className:`form-section-body`,children:c})]})}export{c as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`stacked`,`side`],o=[`top`,`start`],s=[`comfortable`,`compact`],c=[2,3,4];function l(l){let{children:u,title:d,description:f,layout:p=`stacked`,labels:m=`top`,density:h=`comfortable`,headingLevel:g=3,className:_=``,...v}=l;n(`AppFormSection`,v),t(`AppFormSection`,`layout`,p,a),t(`AppFormSection`,`labels`,m,o),t(`AppFormSection`,`density`,h,s),t(`AppFormSection`,`headingLevel`,g,c);let y=c.includes(g)?`h${g}`:`h3`;return i(`section`,{className:[`form-section`,p===`side`?`wui-form-side`:``,m===`start`?`wui-form-labels-start`:``,h===`compact`?`wui-form-compact`:``,_].filter(Boolean).join(` `),...e(`AppFormSection`,l),...v,children:[(d!=null||f!=null)&&i(`div`,{className:`form-section-head`,children:[d!=null&&r(y,{className:`form-section-title`,children:d}),f!=null&&r(`p`,{className:`form-section-desc`,children:f})]}),r(`div`,{className:`form-section-body`,children:u})]})}export{l as default};
@@ -1 +1 @@
1
- import e from"./warnUnknownProps.js";import{useEffect as t,useRef as n}from"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";import"@webority/ui-elements/elements/hover-card";function a({trigger:a,children:o,loading:s=!1,loadingLabel:c=`Loading`,label:l,openDelay:u,closeDelay:d,onOpenChange:f,className:p=``,...m}){e(`AppHoverCard`,m);let h=n(null),g=n(f);return g.current=f,t(()=>{let e=h.current;if(!e)return;let t=()=>g.current?.(!0),n=()=>g.current?.(!1);return e.addEventListener(`wui:hover-card:open`,t),e.addEventListener(`wui:hover-card:close`,n),()=>{e.removeEventListener(`wui:hover-card:open`,t),e.removeEventListener(`wui:hover-card:close`,n)}},[]),i(`wui-hover-card`,{ref:h,class:[`wui-hover-card`,p].filter(Boolean).join(` `),"open-delay":Number.isFinite(u)?u:void 0,"close-delay":Number.isFinite(d)?d:void 0,...m,children:[r(`span`,{className:`wui-hover-card-trigger`,children:a}),r(`span`,{className:`wui-hover-card-panel`,role:`group`,"aria-label":l||void 0,"aria-busy":s?`true`:void 0,children:s?i(`span`,{className:`wui-hover-card-loading`,role:`status`,children:[r(`span`,{className:`wui-spinner wui-spinner-sm`,"aria-hidden":`true`}),r(`span`,{children:c})]}):o})]})}export{a as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{useEffect as n,useRef as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import"@webority/ui-elements/elements/hover-card";function o(o){let{trigger:s,children:c,loading:l=!1,loadingLabel:u=`Loading`,label:d,openDelay:f,closeDelay:p,onOpenChange:m,className:h=``,...g}=o;t(`AppHoverCard`,g);let _=r(null),v=r(m);return v.current=m,n(()=>{let e=_.current;if(!e)return;let t=()=>v.current?.(!0),n=()=>v.current?.(!1);return e.addEventListener(`wui:hover-card:open`,t),e.addEventListener(`wui:hover-card:close`,n),()=>{e.removeEventListener(`wui:hover-card:open`,t),e.removeEventListener(`wui:hover-card:close`,n)}},[]),a(`wui-hover-card`,{ref:_,class:[`wui-hover-card`,h].filter(Boolean).join(` `),"open-delay":Number.isFinite(f)?f:void 0,"close-delay":Number.isFinite(p)?p:void 0,...e(`AppHoverCard`,o),...g,children:[i(`span`,{className:`wui-hover-card-trigger`,children:s}),i(`span`,{className:`wui-hover-card-panel`,role:`group`,"aria-label":d||void 0,"aria-busy":l?`true`:void 0,children:l?a(`span`,{className:`wui-hover-card-loading`,role:`status`,children:[i(`span`,{className:`wui-spinner wui-spinner-sm`,"aria-hidden":`true`}),i(`span`,{children:u})]}):c})]})}export{o as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import{FULL_LINEAR_LOADERS as t,FULL_VARIANT_LOADERS as n,shardKey as r}from"./iconCatalogLoaders.g.js";import{ICON_NAMES as i}from"./iconCatalogNames.g.js";import{GLYPHS as a}from"./iconGlyphs.g.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import c from"./withTooltip.js";import{useEffect as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var p=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],m=new Set;function h(t,n){m.has(t)||(m.add(t),e(`[@webority/ui-react] The ${t} failed to load (${n?.message??n}); icons fall back to the linear default until a later render retries it.`))}var g=null,_=null,v=!1,y=new Set;function b(){return _||=import(`./iconVariants.g.js`).then(e=>{g=e.VARIANT_GLYPHS,v=!1;for(let e of y)e();y.clear()}).catch(e=>{_=null,h(`curated icon variants chunk`,e),v?y.clear():(v=!0,setTimeout(()=>{for(let e of[...y])e()},1e3))}),_}var x=new Set(i),S=Object.create(null),C=Object.create(null),w=Object.create(null),T=Object.create(null);function E(e){let n=r(e),i=t[n];return i?(C[n]||=i().then(e=>{Object.assign(S,e.FULL_GLYPHS),T[n]=!1;let t=w[n];if(t){for(let e of t)e();t.clear()}}).catch(e=>{C[n]=null,h(`full icon catalogue '${n}' shard`,e),T[n]?w[n]?.clear():(T[n]=!0,setTimeout(()=>{for(let e of[...w[n]||[]])e()},1e3))}),C[n]):null}var D=Object.create(null),O=Object.create(null),k=Object.create(null),A=Object.create(null);function j(e,t){let i=n[e];if(!i)return null;let a=r(t),o=i[a];if(!o)return null;let s=`${e}:${a}`;return O[s]||=o().then(t=>{let n=D[e]||(D[e]=Object.create(null));Object.assign(n,t.FULL_VARIANT_GLYPHS),A[s]=!1;let r=k[s];if(r){for(let e of r)e();r.clear()}}).catch(t=>{O[s]=null,h(`${e} icon catalogue '${a}' shard`,t),A[s]?k[s]?.clear():(A[s]=!0,setTimeout(()=>{for(let e of[...k[s]||[]])e()},1e3))}),O[s]}var M=i,N=new Map;function P(e){for(let[t,n]of Object.entries(e))N.set(t,n)}function F({name:e,size:t=16,variant:n,tooltip:i,tooltipPlacement:m,className:h,color:_,style:v,...C}){s(`AppIcon`,C),o(`AppIcon`,`variant`,n,p);let T=!!n&&n!==`linear`,O=i!=null&&i!==``,A=e=>O?c(d(`span`,{className:`wui-icon-tip`,role:`img`,"aria-label":i,children:e}),i,m):e,M=a[e]!==void 0,P=!M&&x.has(e),[,F]=u(0);l(()=>{let t=()=>F(e=>e+1);T&&M&&!g&&(y.add(t),b());let i=P?r(e):null;P&&S[e]===void 0&&((w[i]||=new Set).add(t),E(e));let a=T&&P?`${n}:${r(e)}`:null;return T&&P&&D[n]?.[e]===void 0&&((k[a]||=new Set).add(t),j(n,e)),()=>{y.delete(t),i&&w[i]?.delete(t),a&&k[a]?.delete(t)}},[e,T,M,P,n]);let I=N.get(e);if(I)return A(I({size:t,color:_,className:h,style:v}));if(e===`hard-hat`)return A(d(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,className:h?`wui-icon ${h}`:`wui-icon`,"data-icon":e,"aria-hidden":`true`,style:{color:_,...v},...C,children:f(`g`,{fill:`currentColor`,children:[d(`circle`,{cx:`12`,cy:`7.5`,r:`4.2`}),d(`path`,{d:`M3.2 22.5C3.2 17.4 7.5 14.9 11 14.7L12 17.4l1-2.7C16.5 14.9 20.8 17.4 20.8 22.5z`})]})}));let L=T&&(g?.[n]?.[e]||P&&D?.[n]?.[e])||a[e]||S[e];return L?A(d(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,className:h?`wui-icon ${h}`:`wui-icon`,"data-icon":e,"aria-hidden":`true`,style:{color:_,...v},dangerouslySetInnerHTML:{__html:L},...C})):null}export{F as default,M as iconNames,P as registerIcons};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import{FULL_LINEAR_LOADERS as n,FULL_VARIANT_LOADERS as r,shardKey as i}from"./iconCatalogLoaders.g.js";import{ICON_NAMES as a}from"./iconCatalogNames.g.js";import{GLYPHS as o}from"./iconGlyphs.g.js";import s from"./warnInvalidValue.js";import c from"./warnUnknownProps.js";import l from"./withTooltip.js";import{useEffect as u,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],h=new Set;function g(e,n){h.has(e)||(h.add(e),t(`[@webority/ui-react] The ${e} failed to load (${n?.message??n}); icons fall back to the linear default until a later render retries it.`))}var _=null,v=null,y=!1,b=new Set;function x(){return v||=import(`./iconVariants.g.js`).then(e=>{_=e.VARIANT_GLYPHS,y=!1;for(let e of b)e();b.clear()}).catch(e=>{v=null,g(`curated icon variants chunk`,e),y?b.clear():(y=!0,setTimeout(()=>{for(let e of[...b])e()},1e3))}),v}var S=new Set(a),C=Object.create(null),w=Object.create(null),T=Object.create(null),E=Object.create(null);function D(e){let t=i(e),r=n[t];return r?(w[t]||=r().then(e=>{Object.assign(C,e.FULL_GLYPHS),E[t]=!1;let n=T[t];if(n){for(let e of n)e();n.clear()}}).catch(e=>{w[t]=null,g(`full icon catalogue '${t}' shard`,e),E[t]?T[t]?.clear():(E[t]=!0,setTimeout(()=>{for(let e of[...T[t]||[]])e()},1e3))}),w[t]):null}var O=Object.create(null),k=Object.create(null),A=Object.create(null),j=Object.create(null);function M(e,t){let n=r[e];if(!n)return null;let a=i(t),o=n[a];if(!o)return null;let s=`${e}:${a}`;return k[s]||=o().then(t=>{let n=O[e]||(O[e]=Object.create(null));Object.assign(n,t.FULL_VARIANT_GLYPHS),j[s]=!1;let r=A[s];if(r){for(let e of r)e();r.clear()}}).catch(t=>{k[s]=null,g(`${e} icon catalogue '${a}' shard`,t),j[s]?A[s]?.clear():(j[s]=!0,setTimeout(()=>{for(let e of[...A[s]||[]])e()},1e3))}),k[s]}var N=a,P=new Map;function F(e){for(let[t,n]of Object.entries(e))P.set(t,n)}function I(t){let{name:n,size:r=16,variant:a,tooltip:h,tooltipPlacement:g,className:v,color:y,style:w,...E}=t;c(`AppIcon`,E),s(`AppIcon`,`variant`,a,m);let k=!!a&&a!==`linear`,j=h!=null&&h!==``,N=e(`AppIcon`,t),F=(e,t=!0)=>j?l(f(`span`,{className:`wui-icon-tip`,role:`img`,"aria-label":h,...t?N:void 0,children:e}),h,g):e,I=o[n]!==void 0,L=!I&&S.has(n),[,R]=d(0);u(()=>{let e=()=>R(e=>e+1);k&&I&&!_&&(b.add(e),x());let t=L?i(n):null;L&&C[n]===void 0&&((T[t]||=new Set).add(e),D(n));let r=k&&L?`${a}:${i(n)}`:null;return k&&L&&O[a]?.[n]===void 0&&((A[r]||=new Set).add(e),M(a,n)),()=>{b.delete(e),t&&T[t]?.delete(e),r&&A[r]?.delete(e)}},[n,k,I,L,a]);let z=P.get(n);if(z)return F(z({size:r,color:y,className:v,style:w}),!1);if(n===`hard-hat`)return F(f(`svg`,{width:r,height:r,viewBox:`0 0 24 24`,fill:`none`,className:v?`wui-icon ${v}`:`wui-icon`,"data-icon":n,"aria-hidden":`true`,style:{color:y,...w},...j?void 0:N,...E,children:p(`g`,{fill:`currentColor`,children:[f(`circle`,{cx:`12`,cy:`7.5`,r:`4.2`}),f(`path`,{d:`M3.2 22.5C3.2 17.4 7.5 14.9 11 14.7L12 17.4l1-2.7C16.5 14.9 20.8 17.4 20.8 22.5z`})]})}));let B=k&&(_?.[a]?.[n]||L&&O?.[a]?.[n])||o[n]||C[n];return B?F(f(`svg`,{width:r,height:r,viewBox:`0 0 24 24`,fill:`none`,className:v?`wui-icon ${v}`:`wui-icon`,"data-icon":n,"aria-hidden":`true`,style:{color:y,...w},dangerouslySetInnerHTML:{__html:B},...j?void 0:N,...E})):null}export{I as default,N as iconNames,F as registerIcons};
@@ -1 +1 @@
1
- import e from"./warnUnknownProps.js";import t from"./renderIconProp.js";import{isEmpty as n}from"../lib/emptyValue.js";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";function o({items:o=[],className:s=``,...c}){return e(`AppInfoList`,c),i(`div`,{className:`info-list${s?` ${s}`:``}`,...c,children:o.map((e,o)=>{let s=n(e.value),c=a(r,{children:[i(`span`,{className:`info-icon`,children:t(e.icon,{size:16})}),a(`span`,{className:`info-meta`,children:[i(`span`,{className:`info-key`,children:e.label}),i(`span`,{className:`info-value${s?` is-empty`:``}`,children:s?`-`:e.value})]})]}),l=e.key??`${e.label}-${o}`;return e.href?i(`a`,{className:`info-row`,href:e.href,children:c},l):i(`div`,{className:`info-row`,children:c},l)})})}export{o as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./renderIconProp.js";import{isEmpty as r}from"../lib/emptyValue.js";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";function s(s){let{items:c=[],className:l=``,...u}=s;return t(`AppInfoList`,u),a(`div`,{className:`info-list${l?` ${l}`:``}`,...e(`AppInfoList`,s),...u,children:c.map((e,t)=>{let s=r(e.value),c=o(i,{children:[a(`span`,{className:`info-icon`,children:n(e.icon,{size:16})}),o(`span`,{className:`info-meta`,children:[a(`span`,{className:`info-key`,children:e.label}),a(`span`,{className:`info-value${s?` is-empty`:``}`,children:s?`-`:e.value})]})]}),l=e.key??`${e.label}-${t}`;return e.href?a(`a`,{className:`info-row`,href:e.href,children:c},l):a(`div`,{className:`info-row`,children:c},l)})})}export{s as default};
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import r from"./AppPopover.js";import{useState as i}from"react";import{jsx as a}from"react/jsx-runtime";var o={sm:` infotip-popover-sm`,md:``,lg:` infotip-popover-lg`,xl:` infotip-popover-xl`};function s({label:s,children:c,placement:l=`auto`,width:u=`md`,className:d=``,...f}){t(`AppInfoTip`,f),e(`AppInfoTip`,`width`,u,Object.keys(o));let[p,m]=i(!1),h=!!s;return!h&&!c?null:a(`span`,{className:`infotip${d?` ${d}`:``}`,...f,children:a(r,{trigger:a(`button`,{type:`button`,className:`infotip-btn`,"aria-label":s||`More information`,children:a(n,{name:`info`,size:16})}),title:h?s:void 0,placement:l,triggerType:[`hover`,`focus`],className:`infotip-popover${o[u]??``}`,onToggle:m,"aria-expanded":p,children:c})})}export{s as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"./AppPopover.js";import{useState as a}from"react";import{jsx as o}from"react/jsx-runtime";var s={sm:` infotip-popover-sm`,md:``,lg:` infotip-popover-lg`,xl:` infotip-popover-xl`};function c(c){let{label:l,children:u,placement:d=`auto`,width:f=`md`,className:p=``,...m}=c;n(`AppInfoTip`,m),t(`AppInfoTip`,`width`,f,Object.keys(s));let[h,g]=a(!1),_=!!l;return!_&&!u?null:o(`span`,{className:`infotip${p?` ${p}`:``}`,...e(`AppInfoTip`,c),...m,children:o(i,{trigger:o(`button`,{type:`button`,className:`infotip-btn`,"aria-label":l||`More information`,children:o(r,{name:`info`,size:16})}),title:_?l:void 0,placement:d,triggerType:[`hover`,`focus`],className:`infotip-popover${s[f]??``}`,onToggle:g,"aria-expanded":h,children:u})})}export{c as default};
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{optionsEqual as r}from"./useWuiControl.js";import{useEffect as i,useId as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import"@webority/ui-elements/elements/select";import"@webority/ui-elements/elements/datepicker";import{INLINE_EDIT_TEXT as u,INLINE_EDIT_TYPES as d,inlineEditText as f}from"@webority/ui-elements/elements/inline-edit";var p=e=>e==null?``:String(e),m=(e,t)=>t===`number`?e===``?null:Number(e):e;function h({value:h,onSave:g,type:_,options:v=[],label:y,placeholder:b,validate:x,renderValue:S,disabled:C=!1,className:w=``,id:T,...E}){t(`AppInlineEdit`,E),e(`AppInlineEdit`,`type`,_,d);let D=d.includes(_)?_:`text`,O=a(),k=T||`inline-edit-${O.replace(/[^a-zA-Z0-9_-]/g,``)}`,A=`${k}-error`,j=`${k}-control`,M=o(null),N=o(null),P=p(h),[F,I]=s(P),[L,R]=s(P);F!==P&&(I(P),R(P));let[z,B]=s(null),V=o(null);V.current={onSave:g,validate:x,kind:D},i(()=>{let e=M.current;if(e)return e.save=async e=>{B(e);try{await V.current.onSave?.(m(e,V.current.kind)),R(e)}finally{B(null)}},e.validate=e=>V.current.validate?.(m(e,V.current.kind))||null,()=>{e.save=void 0,e.validate=void 0}},[]),i(()=>{let e=N.current;if(!e)return;let t=v.map(e=>({value:String(e.value),label:p(e.label??e.value)}));r(t,e.options)||(e.options=t)});let H=z??L,U=f(H,{type:D,options:v,placeholder:b}),W=S&&!U.empty?S(m(H,D)):U.text,G={id:j,"data-wui-control":``,"aria-label":y},K;return K=D===`select`?c(`wui-select`,{ref:N,...G,size:`sm`,placeholder:b||void 0}):D===`date`?c(`wui-datepicker`,{...G,size:`sm`,"aria-describedby":A,placeholder:b||void 0}):D===`textarea`?c(`textarea`,{...G,className:`form-control textarea`,rows:3,"aria-describedby":A,placeholder:b||void 0}):c(`input`,{...G,type:D===`number`?`number`:`text`,inputMode:D===`number`?`decimal`:void 0,className:`form-control input input-sm`,"aria-describedby":A,placeholder:b||void 0}),l(`wui-inline-edit`,{ref:M,id:k,class:w?`wui-inline-edit ${w}`:`wui-inline-edit`,type:D,label:y,value:L,placeholder:b||void 0,disabled:C?``:void 0,controlled:``,...E,children:[l(`button`,{type:`button`,className:`wui-inline-edit-display`,"data-wui-display":``,"aria-describedby":A,disabled:C,children:[c(`span`,{className:`visually-hidden`,children:C?u.readOnly(y):u.edit(y)}),c(`span`,{className:`wui-inline-edit-value`,"data-wui-value":``,"data-wui-empty":U.empty?``:void 0,children:W}),c(`span`,{className:`wui-inline-edit-icon`,"aria-hidden":`true`,children:c(n,{name:`edit`,size:14})})]}),c(`span`,{className:`wui-inline-edit-editor`,"data-wui-editor":``,hidden:!0,children:K}),l(`span`,{className:`wui-inline-edit-status`,"aria-hidden":`true`,children:[c(`span`,{className:`wui-inline-edit-spinner spinner-border spinner-border-sm`}),c(`span`,{className:`wui-inline-edit-saved`,children:c(n,{name:`tick-circle`,size:16})})]}),c(`span`,{className:`wui-inline-edit-error`,id:A,"data-wui-error":``,hidden:!0}),c(`span`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}export{h as default};
1
+ import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{optionsEqual as i}from"./useWuiControl.js";import{useEffect as a,useId 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/select";import"@webority/ui-elements/elements/datepicker";import{INLINE_EDIT_TEXT as d,INLINE_EDIT_TYPES as f,inlineEditText as p}from"@webority/ui-elements/elements/inline-edit";var m=e=>e==null?``:String(e),h=(e,t)=>t===`number`?e===``?null:Number(e):e;function g(g){let{value:_,onSave:v,type:y,options:b=[],label:x,placeholder:S,validate:C,renderValue:w,disabled:T=!1,className:E=``,id:D,...O}=g;n(`AppInlineEdit`,O),t(`AppInlineEdit`,`type`,y,f);let k=f.includes(y)?y:`text`,A=o(),j=D||`inline-edit-${A.replace(/[^a-zA-Z0-9_-]/g,``)}`,M=`${j}-error`,N=`${j}-control`,P=s(null),F=s(null),I=m(_),[L,R]=c(I),[z,B]=c(I);L!==I&&(R(I),B(I));let[V,H]=c(null),U=s(null);U.current={onSave:v,validate:C,kind:k},a(()=>{let e=P.current;if(e)return e.save=async e=>{H(e);try{await U.current.onSave?.(h(e,U.current.kind)),B(e)}finally{H(null)}},e.validate=e=>U.current.validate?.(h(e,U.current.kind))||null,()=>{e.save=void 0,e.validate=void 0}},[]),a(()=>{let e=F.current;if(!e)return;let t=b.map(e=>({value:String(e.value),label:m(e.label??e.value)}));i(t,e.options)||(e.options=t)});let W=V??z,G=p(W,{type:k,options:b,placeholder:S}),K=w&&!G.empty?w(h(W,k)):G.text,q={id:N,"data-wui-control":``,"aria-label":x},J;return J=k===`select`?l(`wui-select`,{ref:F,...q,size:`sm`,placeholder:S||void 0}):k===`date`?l(`wui-datepicker`,{...q,size:`sm`,"aria-describedby":M,placeholder:S||void 0}):k===`textarea`?l(`textarea`,{...q,className:`form-control textarea`,rows:3,"aria-describedby":M,placeholder:S||void 0}):l(`input`,{...q,type:k===`number`?`number`:`text`,inputMode:k===`number`?`decimal`:void 0,className:`form-control input input-sm`,"aria-describedby":M,placeholder:S||void 0}),u(`wui-inline-edit`,{ref:P,id:j,class:E?`wui-inline-edit ${E}`:`wui-inline-edit`,type:k,label:x,value:z,placeholder:S||void 0,disabled:T?``:void 0,controlled:``,...e(`AppInlineEdit`,g),...O,children:[u(`button`,{type:`button`,className:`wui-inline-edit-display`,"data-wui-display":``,"aria-describedby":M,disabled:T,children:[l(`span`,{className:`visually-hidden`,children:T?d.readOnly(x):d.edit(x)}),l(`span`,{className:`wui-inline-edit-value`,"data-wui-value":``,"data-wui-empty":G.empty?``:void 0,children:K}),l(`span`,{className:`wui-inline-edit-icon`,"aria-hidden":`true`,children:l(r,{name:`edit`,size:14})})]}),l(`span`,{className:`wui-inline-edit-editor`,"data-wui-editor":``,hidden:!0,children:J}),u(`span`,{className:`wui-inline-edit-status`,"aria-hidden":`true`,children:[l(`span`,{className:`wui-inline-edit-spinner spinner-border spinner-border-sm`}),l(`span`,{className:`wui-inline-edit-saved`,children:l(r,{name:`tick-circle`,size:16})})]}),l(`span`,{className:`wui-inline-edit-error`,id:M,"data-wui-error":``,hidden:!0}),l(`span`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}export{g as default};