zavadil-react-common 1.2.116 → 1.2.118

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.
@@ -0,0 +1,8 @@
1
+ import { PlaceholderSize } from "react-bootstrap/usePlaceholder";
2
+ export type TablePlaceholderProps = {
3
+ cols?: number;
4
+ rows?: number;
5
+ size?: PlaceholderSize;
6
+ };
7
+ export declare function TablePlaceholder({ cols, rows, size }: TablePlaceholderProps): import("react/jsx-runtime").JSX.Element;
8
+ export default TablePlaceholder;
@@ -2,3 +2,4 @@ export * from './AdvancedTable';
2
2
  export * from './TableTypes';
3
3
  export * from './TableWithSelect';
4
4
  export * from './TablePagination';
5
+ export * from './TablePlaceholder';
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { PagingRequest, EntityBase, LookupTableEntity, EntityClient, EntityClientWithStub, LookupClient, UserAlertType, UserAlerts, UserAlert, JavaHeapStats, CacheStats, QueueStats, Localization } from 'zavadil-ts-common';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, PropsWithChildren } from 'react';
6
+ import { PlaceholderSize } from 'react-bootstrap/usePlaceholder';
6
7
  import { ButtonVariant } from 'react-bootstrap/types';
7
8
 
8
9
  type RenderResult = undefined | string | ReactNode;
@@ -50,6 +51,13 @@ type TablePaginationProps = {
50
51
  };
51
52
  declare function TablePagination({ paging, totalItems, onPagingChanged }: TablePaginationProps): react_jsx_runtime.JSX.Element;
52
53
 
54
+ type TablePlaceholderProps = {
55
+ cols?: number;
56
+ rows?: number;
57
+ size?: PlaceholderSize;
58
+ };
59
+ declare function TablePlaceholder({ cols, rows, size }: TablePlaceholderProps): react_jsx_runtime.JSX.Element;
60
+
53
61
  type TextInputWithResetProps = {
54
62
  value?: string | null;
55
63
  onChange: (s: string) => any;
@@ -266,4 +274,4 @@ type LocalizeProps = {
266
274
  };
267
275
  declare function Localize({ text, tag }: LocalizeProps): react_jsx_runtime.JSX.Element;
268
276
 
269
- export { type ActiveButtonProps, AdvancedTable, type AdvancedTableProps, AutocompleteEntityIdSelect, AutocompleteEntitySelect, type AutocompleteEntitySelectProps, type AutocompleteIdSelectProps, AutocompleteLookupIdSelect, type AutocompleteLookupIdSelectProps, AutocompleteLookupSelect, type AutocompleteLookupSelectProps, AutocompleteSelect, type AutocompleteSelectProps, type BasicDialogProps, CacheStatsControl, type CacheStatsControlProps, ConfirmDialog, ConfirmDialogContext, ConfirmDialogContextData, type ConfirmDialogProps, DateInput, type DateInputProps, DateTimeInput, type DateTimeInputProps, EnumSelect, type EnumSelectProps, type GenericSelectOption, type GenericSelectProps, type HeaderCol, IconButton, type IconButtonProps, IconSwitch, type IconSwitchProps, JavaHeapControl, LoadingButton, LocalizationContext, Localize, type LocalizeProps, LookupSelect, type LookupSelectProps, NumberSelect, type NumberSelectProps, QueueStateControl, type QueueStateControlProps, QueueStatsControl, type QueueStatsControlProps, type RenderFunc, type RenderResult, SaveButton, type SaveButtonProps, type SelectableHeaderCol, type SelectableItem, type SelectableTableHeader, Spread, type SpreadProps, StringSelect, type StringSelectProps, Switch, type SwitchProps, type TableHeader, TablePagination, type TablePaginationProps, TableWithSelect, type TableWithSelectProps, TextInputWithReset, type TextInputWithResetProps, UserAlertTypeIcon, type UserAlertTypeIconProps, UserAlertWidget, type UserAlertWidgetProps, UserAlertsWidget, type UserAlertsWidgetProps, type WorkerJavaHeapControlProps };
277
+ export { type ActiveButtonProps, AdvancedTable, type AdvancedTableProps, AutocompleteEntityIdSelect, AutocompleteEntitySelect, type AutocompleteEntitySelectProps, type AutocompleteIdSelectProps, AutocompleteLookupIdSelect, type AutocompleteLookupIdSelectProps, AutocompleteLookupSelect, type AutocompleteLookupSelectProps, AutocompleteSelect, type AutocompleteSelectProps, type BasicDialogProps, CacheStatsControl, type CacheStatsControlProps, ConfirmDialog, ConfirmDialogContext, ConfirmDialogContextData, type ConfirmDialogProps, DateInput, type DateInputProps, DateTimeInput, type DateTimeInputProps, EnumSelect, type EnumSelectProps, type GenericSelectOption, type GenericSelectProps, type HeaderCol, IconButton, type IconButtonProps, IconSwitch, type IconSwitchProps, JavaHeapControl, LoadingButton, LocalizationContext, Localize, type LocalizeProps, LookupSelect, type LookupSelectProps, NumberSelect, type NumberSelectProps, QueueStateControl, type QueueStateControlProps, QueueStatsControl, type QueueStatsControlProps, type RenderFunc, type RenderResult, SaveButton, type SaveButtonProps, type SelectableHeaderCol, type SelectableItem, type SelectableTableHeader, Spread, type SpreadProps, StringSelect, type StringSelectProps, Switch, type SwitchProps, type TableHeader, TablePagination, type TablePaginationProps, TablePlaceholder, type TablePlaceholderProps, TableWithSelect, type TableWithSelectProps, TextInputWithReset, type TextInputWithResetProps, UserAlertTypeIcon, type UserAlertTypeIconProps, UserAlertWidget, type UserAlertWidgetProps, UserAlertsWidget, type UserAlertsWidgetProps, type WorkerJavaHeapControlProps };
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{StringUtil as i,DateUtil as r,NumberUtil as a,CancellablePromise as o,EntityClientWithStub as l,BasicLocalization as c,ObjectUtil as s,UserAlertType as d,ByteUtil as u}from"zavadil-ts-common";import{useMemo as h,useCallback as p,useState as m,useRef as f,useEffect as g,createContext as v,useContext as b}from"react";import{InputGroup as y,Form as C,Button as x,Spinner as w,Dropdown as N,Pagination as z,Table as k,Stack as S,ProgressBar as O,Modal as P,Badge as I,Placeholder as E}from"react-bootstrap";import{BsXCircle as M,BsFillCaretDownFill as B,BsFillCaretUpFill as L,BsCheckCircle as A,BsCircle as G,BsCheckAll as j,BsBug as D,BsExclamationDiamond as F,BsInfo as H,BsQuestion as T,BsEye as V,BsTrash as R}from"react-icons/bs";import{FaFloppyDisk as U}from"react-icons/fa6";var J=function(){return J=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},J.apply(this,arguments)};function K(e,n,t){if(t||2===arguments.length)for(var i,r=0,a=n.length;r<a;r++)!i&&r in n||(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))}function Z(t){var r=t.value,a=t.onChange,o=t.onReset,l=t.onBlur,c=t.disabled,s=t.className,d=h((function(){return i.getNonEmpty(r)}),[r]),u=h((function(){return i.isBlank(r)}),[d]),m=p((function(){o?o():a("")}),[o,a]);return e(y,J({className:s},{children:[n(C.Control,{type:"text",disabled:c,value:d,onChange:function(e){return a(e.target.value)},onBlur:l}),n(x,J({onClick:m,disabled:u},{children:n("div",J({className:"d-flex align-items-center"},{children:n(M,{})}))}))]}))}function q(e){var t=e.value,i=e.onChange,a=e.disabled;return n(C.Control,{type:"date",disabled:a,value:r.formatDateForInput(t),onChange:function(e){i(r.parseDate(e.target.value))}})}function Q(e){var t=e.value,i=e.onChange,a=e.disabled;return n(C.Control,{type:"datetime-local",disabled:a,value:r.formatDateTimeForInput(t),onChange:function(e){i(r.parseDate(e.target.value))}})}function W(t){var i=t.disabled,r=t.variant,a=t.icon,o=t.size,l=t.children,c=t.onClick;return n(x,J({disabled:!0===i,size:o,onClick:c,variant:r},{children:e("div",J({className:"d-flex align-items-center gap-2"},{children:[a,l&&n("div",{children:l})]}))}))}function X(t){var i=t.disabled,r=t.checked,a=t.iconOn,o=t.iconOff,l=t.size,c=t.onChange;return e("div",J({className:"d-flex align-items-center gap-2 cursor-pointer",onClick:function(e){return c(!r)}},{children:[n(C.Switch,{disabled:i,size:l,type:"switch",checked:r,readOnly:!0,className:"cursor-pointer"}),r?a:o]}))}function Y(e){var t=e.disabled,i=e.icon,r=e.loading,a=e.children,o=e.size,l=e.onClick;return n(W,J(!0===r?{disabled:!0,onClick:l,size:o,icon:n(w,{size:"sm"})}:{disabled:t,onClick:l,icon:i,size:o},{children:a}))}function $(e){var t=e.disabled,i=e.icon,r=e.loading,a=e.children,o=e.size,l=e.onClick,c=e.isChanged,s=h((function(){return i||n(U,{})}),[i]),d=h((function(){return c?n("strong",{children:a}):a}),[c,a]);return n(Y,J({disabled:t||!1===c,onClick:l,icon:s,loading:r,size:o},{children:d}))}function _(t){var r=t.value,a=t.options,o=t.disabled,l=t.onChange,c=t.showEmptyOption,s=t.emptyOptionLabel;return i.isEmpty(r)&&a.length>0&&!0!==c?(l(a[0].id),e("span",{children:[r," - selecting default ",a[0].id]})):e(C.Select,J({value:r||"",onChange:function(e){return l(e.target.value)},disabled:o},{children:[!0===c&&n("option",J({value:""},{children:s||""}),""),a?a.map((function(e,t){return n("option",J({value:e.id||""},{children:e.label||""}),t)})):n("span",{children:n(w,{})})]}))}function ee(e){var t=e.value,i=e.options,r=e.disabled,o=e.onChange,l=e.showEmptyOption,c=e.emptyOptionLabel,s=h((function(){return t?String(t):""}),[t]),d=h((function(){return i?i.map((function(e){return{id:e.id?String(e.id):"",label:e.label}})):[]}),[i]),u=p((function(e){return o(a.parseNumber(e))}),[o]);return n(_,{disabled:r,value:s,options:d,onChange:u,showEmptyOption:l,emptyOptionLabel:c})}function ne(e){var t=e.id,i=e.sort,r=e.disabled,a=e.labelGetter,o=e.onChange,l=e.options,c=e.showEmptyOption,s=e.emptyOptionLabel,d=h((function(){var e=[];return l&&(e=i?l.sort((function(e,n){return e.name>n.name?1:-1})):l),e.map((function(e){return{id:e.id,label:a?a(e):e.name}}))}),[l]);return n(ee,{disabled:r,value:t,options:d,onChange:o,showEmptyOption:c,emptyOptionLabel:s})}function te(e){var t=e.value,i=e.options,r=e.onChange,a=e.showEmptyOption,o=e.emptyOptionLabel,l=h((function(){return i?i.map((function(e){return{id:e,label:e}})):[]}),[i]);return n(_,{value:t,options:l,onChange:r,showEmptyOption:a,emptyOptionLabel:o})}function ie(e){var t=e.id,i=e.disabled,r=e.checked,a=e.size,o=e.onChange;return n(C.Switch,{disabled:i,id:t,size:a,type:"switch",checked:r,onChange:function(e){return o(!r)},className:"cursor-pointer"})}function re(t){var i=t.selected,r=t.disabled,a=t.labelGetter,l=t.onChange,c=t.onSearch,s=m(),d=s[0],u=s[1],v=m(),b=v[0],y=v[1],C=m(),x=C[0],w=C[1],z=f(),k=p((function(e){return a?a(e):"name"in e&&"string"==typeof e.name?e.name:"[".concat(e.id,"]")}),[a]),S=h((function(){return i?"border rounded border-primary":void 0}),[i]),O=p((function(){console.log("user left control"),x&&(w(void 0),y(i?k(i):""))}),[l,x,i,k]),P=p((function(){z.current=window.setTimeout(O,100)}),[z,O]),I=p((function(){z.current&&clearTimeout(z.current)}),[z]);g((function(){return I}),[]),g((function(){y(i?k(i):""),d&&(d.cancel(),u(void 0)),w(void 0)}),[i]);var E=p((function(){l(null),y(""),d&&(d.cancel(),u(void 0)),w(void 0)}),[l,d]),M=p((function(e){y(e),d&&d.cancel();var n=new o(c(e));n.promise.then(w),u(n)}),[d,c]),B=p((function(e){console.log("user selected item"),w(void 0),l(J({},e))}),[l]);return n("div",J({onBlur:P,onFocus:I},{children:e(N,J({defaultShow:!1,show:null!==x},{children:[n(Z,{disabled:r,value:b,onChange:M,onReset:E,className:S}),x&&n(N.Menu,{children:x.map((function(e){return n(N.Item,J({onClick:function(n){I(),B(e)},active:e.id===(null==i?void 0:i.id)},{children:k(e)}),e.id)}))})]}))}))}function ae(e){var t=e.selected,r=e.disabled,a=e.labelGetter,o=e.onChange,l=e.entityClient,c=p((function(e){return l.loadPage({search:i.safeLowercase(e),page:0,size:10,sorting:[{name:"id"}]}).then((function(e){return e.content}))}),[a]);return n(re,{disabled:r,selected:t,labelGetter:a,onSearch:c,onChange:o})}function oe(e){var t=e.id,i=e.disabled,r=e.labelGetter,a=e.onChange,o=e.entityClient,c=m(null),s=c[0],d=c[1];g((function(){t?s&&s.id===t?d(J({},s)):o instanceof l?o.loadSingleStub(t).then(d):o.loadSingle(t).then(d):d(null)}),[t]);var u=p((function(e){var n=e?e.id:null;n!==t&&a(n),d(e)}),[t,a]);return n(ae,{disabled:i,selected:s,labelGetter:r,entityClient:o,onChange:u})}function le(e){var t=e.selected,r=e.disabled,a=e.labelGetter,o=e.onChange,l=e.lookupClient,c=h((function(){return a||function(e){return e.name}}),[a]),s=p((function(e){return l.loadPage({search:i.safeLowercase(e),page:0,size:10,sorting:[{name:"name"}]}).then((function(e){return e.content}))}),[a]);return n(re,{disabled:r,selected:t,labelGetter:c,onSearch:s,onChange:o})}function ce(e){var t=e.id,i=e.disabled,r=e.labelGetter,a=e.onChange,o=e.lookupClient,l=m(null),c=l[0],s=l[1];g((function(){t?c&&c.id===t?s(J({},c)):o.loadSingle(t).then(s):s(null)}),[t]);var d=p((function(e){var n=e?e.id:null;n!==t&&a(n),s(e)}),[t,c]);return n(le,{disabled:i,selected:c,labelGetter:r,lookupClient:o,onChange:d})}"function"==typeof SuppressedError&&SuppressedError;var se=v(new c);function de(e){var i=e.text,r=e.tag,a=b(se),o=h((function(){if(void 0!==r&&""!==r)return"string"==typeof r?{tags:[r]}:{tags:r}}),[r]),l=h((function(){return a.translate(i,o)}),[a,i,o]);return n(t,{children:l})}function ue(e){var t=e.paging,i=e.totalItems,r=e.onPagingChanged,a=Math.ceil(i/t.size),o=function(e){t.page=e,r(s.clone(t))},l=[];if(a>1){l.push(n(z.First,{onClick:function(){return o(0)},disabled:0===t.page},"first")),l.push(n(z.Prev,{onClick:function(){return o(t.page-1)},disabled:0===t.page},"prev"));var c=Math.round(3.5),d=t.page>c?t.page-c:0,u=d+10;u>=a&&(u=a-1),d>0&&l.push(n(z.Ellipsis,{disabled:!0},"ellipsisStart"));for(var h=function(e){l.push(n(z.Item,J({active:e===t.page,onClick:function(){return o(e)}},{children:e+1}),e))},p=d;p<=u;p++)h(p);u<a-1&&l.push(n(z.Ellipsis,{disabled:!0},"ellipsisEnd")),l.push(n(z.Next,{onClick:function(){return o(t.page+1)},disabled:t.page===a-1},"next")),l.push(n(z.Last,{onClick:function(){return o(a-1)},disabled:t.page===a-1},"last"))}return n(z,J({size:"sm",className:"flex-wrap m-0"},{children:l}))}var he=[{id:10,label:"10"},{id:100,label:"100"},{id:1e3,label:"1000"}];function pe(r){var a=r.hover,o=r.striped,l=r.bordered,c=r.header,d=r.children,u=r.paging,p=r.totalItems,m=r.onPagingChanged,f=Math.ceil(p/u.size),g=h((function(){var e=u.size;if(null===he.find((function(n){return n.id===e}))){var n=s.clone(he);return n.push({id:e,label:String(e)}),n}return he}),[u]);return n("div",{children:e(k,J({hover:a,striped:o,responsive:!0,bordered:l},{children:[e("thead",{children:[n("tr",{children:n("td",J({colSpan:c.length},{children:e("div",J({className:"d-flex justify-content-between align-items-center gap-2"},{children:[e("div",{children:[n(de,{text:"Page"}),": ",u.page+1," / ",f]}),n(ue,{paging:u,totalItems:p,onPagingChanged:m}),e("div",{children:[n(de,{text:"Total items"}),": ",p]})]}))}))}),n("tr",{children:c.map((function(r,a){var o=!1===r.sort?"":i.isBlank(r.sort)?r.name:r.sort;if(i.isBlank(o)||!o)return n("th",{children:r.label},a);var l=u.sorting&&u.sorting.find((function(e){return e.name===o}));return e("th",J({className:"user-select-none text-nowrap",role:"button",onClick:function(e){return function(e,n){u.sorting||(u.sorting=[]);var t=u.sorting.find((function(e){return e.name===n})),i=t&&1===u.sorting.length;e.ctrlKey||i||(u.sorting=[],t=void 0),t?t.desc=!t.desc:u.sorting.push({name:n}),m(s.clone(u))}(e,o)}},{children:[r.label,l?l.desc?n(B,{}):n(L,{}):n(t,{})]}),a)}))})]}),n("tbody",{children:d}),e("tfoot",{children:[n("tr",{children:n("td",J({colSpan:c.length},{children:e("div",J({className:"d-flex justify-content-between align-items-center gap-2"},{children:[e("div",{children:[n(de,{text:"Page"}),": ",u.page+1," / ",f]}),n(ue,{paging:u,totalItems:p,onPagingChanged:m}),e("div",{children:[n(de,{text:"Total items"}),": ",p]})]}))}))}),n("tr",{children:n("td",J({colSpan:c.length},{children:e("div",J({className:"d-flex align-items-center gap-2 justify-content-end"},{children:[e("div",J({className:"text-nowrap"},{children:[n(de,{text:"Page size"}),":"]})),n("div",{children:n(ee,{value:u.size,options:g,onChange:function(e){u.size=e||10,m(J({},u))},showEmptyOption:!1})})]}))}))})]})]}))})}function me(e){e.disabled;var t=e.checked,i=e.iconOn,r=e.iconOff,a=e.size,o=e.onChange,l=h((function(){return t?i||n(A,{size:a}):r||n(G,{size:a,className:"text-muted"})}),[t,i,r,a]);return n("div",J({className:"d-flex align-items-center cursor-pointer",onClick:function(e){e.stopPropagation(),e.preventDefault(),o(!t)}},{children:l}))}function fe(t){var i=t.showSelect,r=t.header,a=t.items,o=t.onSelect,l=t.onClick,c=t.totalItems,d=t.paging,u=t.onPagingChanged,f=m(!1),v=f[0],b=f[1],y=m(),C=y[0],x=y[1],w=p((function(e){C&&x(C.map((function(n){return{selected:e,item:n.item}}))),b(e)}),[C]),N=h((function(){var e=K([],r,!0);return!1!==i&&e.unshift({name:"",label:n("div",J({className:"py-1"},{children:n(me,{checked:v,onChange:function(){return w(!v)},iconOn:n(j,{})})}))}),e}),[r,v,w]);return g((function(){x(a?a.map((function(e){return{selected:v,item:e}})):void 0)}),[a]),g((function(){C&&o&&o(C.filter((function(e){return e.selected})).map((function(e){return e.item})))}),[C,o]),n(pe,J({header:N,hover:void 0!==l,paging:d,striped:!0,totalItems:c,onPagingChanged:u},{children:C&&C.map((function(t,a){return e("tr",J({className:"selectable ".concat(l?"cursor-pointer":""," ").concat(t.selected?"table-active table-primary":""),onClick:function(e){l&&l(t.item)}},{children:[!1!==i&&n("td",{children:n("div",J({className:"py-2 d-flex align-items-center"},{children:n(me,{checked:t.selected,onChange:function(){t.selected=!t.selected,v&&!t.selected&&b(!1),x(K([],C,!0))}})}))}),r.map((function(e,i){var r,a=e.renderer||(r=e.name,function(e){return s.getNestedValue(e,r)});return n("td",{children:a(t.item)},i)}))]}),a)}))}))}var ge=new Map([[d.error,D],[d.warning,F],[d.info,H]]);function ve(e){var t=e.type,i=e.size,r=e.customVariant,a=ge.get(t)||T;return n("div",J({className:"d-flex align-items-center text-".concat(void 0===r?t:r)},{children:a({size:i})}))}function be(t){var i=t.userAlert,a=t.maxDurationMs;return e(S,J({direction:"horizontal",gap:2,className:"align-items-center"},{children:[i.remainsMs&&n("div",J({style:{width:20}},{children:n(O,{min:0,max:a,now:i.remainsMs,variant:i.type})})),n("div",{children:r.formatDateForHumans(i.time)}),n(ve,{type:i.type}),n("div",{children:i.message})]}))}function ye(i){var r=i.userAlerts,a=m(r.alerts.length),o=a[0],l=a[1],c=m(K([],r.visibleAlerts,!0)),s=c[0],d=c[1],u=m(r.getSummary()),h=u[0],f=u[1],v=p((function(){l(r.alerts.length),d(K([],r.visibleAlerts,!0)),f(r.getSummary())}),[r]);return g((function(){r.addOnChangeHandler(v);var e=setInterval((function(){return r.updateVisibility()}),100);return function(){clearInterval(e),r.removeOnChangeHandler(v)}}),[r,v]),o<=0?n(t,{}):e("div",J({className:"user-alerts border rounded bg-body text-body position-fixed text-end",style:{bottom:15,right:15,zIndex:2147483647}},{children:[s.length>0&&n("div",J({className:"max-w-50 p-2 border-bottom"},{children:s.map((function(e,t){return n(be,{userAlert:e,maxDurationMs:r.maxVisibilityMs},t)}))})),n("div",J({className:"p-2"},{children:e(S,J({direction:"horizontal",gap:2,className:"justify-content-end align-items-center"},{children:[n(W,J({size:"sm",variant:"primary",onClick:function(){return r.hideAll()},icon:n(V,{})},{children:"Hide"})),Array.from(h.entries()).map((function(t,i){return e(S,J({direction:"horizontal",gap:1,className:"px-1 border rounded align-items-center"},{children:[n(ve,{type:t[0],customVariant:0===t[1]?"muted":void 0}),n("div",J({className:t[1]>0?"text-".concat(t[0]," fw-bold"):"text-muted"},{children:t[1]}))]}),i)})),n(W,J({size:"sm",variant:"danger",onClick:function(){return r.reset()},icon:n(R,{})},{children:"Reset"}))]}))}))]}))}var Ce=function(){function e(e){this.setProps=e}return e.prototype.confirm=function(e,n,t){var i=this;this.setProps({name:e,text:n,onConfirm:function(){t(),i.setProps(void 0)},onClose:function(){return i.setProps(void 0)}})},e}(),xe=v(new Ce((function(){})));function we(t){var i=t.name,r=t.text,a=t.onClose,o=t.onConfirm;return e(P,J({show:!0},{children:[n(P.Header,{children:i||"Confirm"}),n(P.Body,{children:r}),n(P.Footer,{children:e(S,J({direction:"horizontal"},{children:[n(x,J({variant:"link",onClick:a},{children:"Zpět"})),n(x,J({variant:"primary",onClick:o},{children:"Ano"}))]}))})]}))}function Ne(t){var i=t.stats,r=i.heapSize,a=i.heapMaxSize,o=i.heapFreeSize,l=r-o;return e("div",{children:[e("div",J({className:"d-flex align-items-center gap-2"},{children:[n("pre",{children:"Java Heap"}),e("pre",{children:["[",u.formatByteSize(r)," / ",u.formatByteSize(a),"]"]})]})),e("div",J({className:"d-flex align-items-center gap-2"},{children:[n("pre",{children:"Used:"}),n(I,J({className:"bg-warning text-bg-warning"},{children:u.formatByteSize(l)})),n("pre",{children:"Free:"}),n(I,J({className:"bg-success text-white"},{children:u.formatByteSize(o)}))]})),n("div",J({className:"p-1"},{children:e(O,J({min:0,max:a},{children:[n(O,{variant:"warning",min:0,now:l,max:a}),n(O,{variant:"success",min:0,now:o,max:a})]}))}))]})}function ze(t){var i=t.name,r=t.stats;return e("div",{children:[e("div",J({className:"d-flex align-items-center gap-2"},{children:[n("pre",{children:i}),e("pre",{children:["[",r.cachedItems,r.capacity>0&&" / ",r.capacity>0&&r.capacity,"]"]})]})),r.capacity>0&&n("div",J({className:"p-1"},{children:n(O,{now:r.cachedItems,min:0,max:r.capacity})}))]})}var ke=new Map([["Idle","secondary"],["Processing","success"],["Loading","warn"]]);function Se(e){var t=e.state,i=ke.get(t)||"light";return n(I,J({className:"bg-".concat(i," text-bg-").concat(i)},{children:t}))}function Oe(t){var i=t.name,r=t.stats,a=r?r.remaining+r.processed:void 0;return e("div",{children:[e("div",J({className:"d-flex align-items-center gap-2"},{children:[n("pre",{children:i}),e("pre",{children:["[",void 0!==(null==r?void 0:r.processed)?r.processed:"?"," / ",void 0!==a?a:"?","]"]}),n(Se,{state:r?r.state:"Unknown"})]})),n("div",J({className:"p-1"},{children:r?n(O,{variant:"primary",striped:!0,animated:!0,min:0,now:r.processed,max:a||1}):n(E,J({className:"w-100",animation:"glow"},{children:n(E,{className:"w-100"})}))}))]})}function Pe(e){var t=e.children,i=e.center,r=h((function(){return!1===i?"":"d-flex align-items-center justify-content-center"}),[i]);return n("div",J({className:"w-100 h-100 position-absolute ".concat(r),style:{left:0,right:0,top:0,bottom:0}},{children:t}))}export{pe as AdvancedTable,oe as AutocompleteEntityIdSelect,ae as AutocompleteEntitySelect,ce as AutocompleteLookupIdSelect,le as AutocompleteLookupSelect,re as AutocompleteSelect,ze as CacheStatsControl,we as ConfirmDialog,xe as ConfirmDialogContext,Ce as ConfirmDialogContextData,q as DateInput,Q as DateTimeInput,te as EnumSelect,W as IconButton,X as IconSwitch,Ne as JavaHeapControl,Y as LoadingButton,se as LocalizationContext,de as Localize,ne as LookupSelect,ee as NumberSelect,Se as QueueStateControl,Oe as QueueStatsControl,$ as SaveButton,Pe as Spread,_ as StringSelect,ie as Switch,ue as TablePagination,fe as TableWithSelect,Z as TextInputWithReset,ve as UserAlertTypeIcon,be as UserAlertWidget,ye as UserAlertsWidget};
1
+ import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{StringUtil as i,DateUtil as r,NumberUtil as a,CancellablePromise as o,EntityClientWithStub as l,BasicLocalization as c,ObjectUtil as s,UserAlertType as d,ByteUtil as u}from"zavadil-ts-common";import{useMemo as h,useCallback as p,useState as m,useRef as f,useEffect as g,createContext as v,useContext as b}from"react";import{InputGroup as y,Form as C,Button as w,Spinner as x,Dropdown as z,Pagination as N,Table as k,Placeholder as S,Stack as O,ProgressBar as P,Modal as I,Badge as E}from"react-bootstrap";import{BsXCircle as A,BsFillCaretDownFill as M,BsFillCaretUpFill as B,BsCheckCircle as L,BsCircle as G,BsCheckAll as j,BsBug as D,BsExclamationDiamond as F,BsInfo as H,BsQuestion as T,BsEye as V,BsTrash as R}from"react-icons/bs";import{FaFloppyDisk as U}from"react-icons/fa6";import{VscEyeClosed as J}from"react-icons/vsc";var K=function(){return K=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},K.apply(this,arguments)};function Z(e,n,t){if(t||2===arguments.length)for(var i,r=0,a=n.length;r<a;r++)!i&&r in n||(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))}function q(t){var r=t.value,a=t.onChange,o=t.onReset,l=t.onBlur,c=t.disabled,s=t.className,d=h((function(){return i.getNonEmpty(r)}),[r]),u=h((function(){return i.isBlank(r)}),[d]),m=p((function(){o?o():a("")}),[o,a]);return e(y,K({className:s},{children:[n(C.Control,{type:"text",disabled:c,value:d,onChange:function(e){return a(e.target.value)},onBlur:l}),n(w,K({onClick:m,disabled:u},{children:n("div",K({className:"d-flex align-items-center"},{children:n(A,{})}))}))]}))}function Q(e){var t=e.value,i=e.onChange,a=e.disabled;return n(C.Control,{type:"date",disabled:a,value:r.formatDateForInput(t),onChange:function(e){i(r.parseDate(e.target.value))}})}function W(e){var t=e.value,i=e.onChange,a=e.disabled;return n(C.Control,{type:"datetime-local",disabled:a,value:r.formatDateTimeForInput(t),onChange:function(e){i(r.parseDate(e.target.value))}})}function X(t){var i=t.disabled,r=t.variant,a=t.icon,o=t.size,l=t.children,c=t.onClick;return n(w,K({disabled:!0===i,size:o,onClick:c,variant:r},{children:e("div",K({className:"d-flex align-items-center gap-2"},{children:[a,l&&n("div",{children:l})]}))}))}function Y(t){var i=t.disabled,r=t.checked,a=t.iconOn,o=t.iconOff,l=t.size,c=t.onChange;return e("div",K({className:"d-flex align-items-center gap-2 cursor-pointer",onClick:function(e){return c(!r)}},{children:[n(C.Switch,{disabled:i,size:l,type:"switch",checked:r,readOnly:!0,className:"cursor-pointer"}),r?a:o]}))}function $(e){var t=e.disabled,i=e.icon,r=e.loading,a=e.children,o=e.size,l=e.onClick;return n(X,K(!0===r?{disabled:!0,onClick:l,size:o,icon:n(x,{size:"sm"})}:{disabled:t,onClick:l,icon:i,size:o},{children:a}))}function _(e){var t=e.disabled,i=e.icon,r=e.loading,a=e.children,o=e.size,l=e.onClick,c=e.isChanged,s=h((function(){return i||n(U,{})}),[i]),d=h((function(){return c?n("strong",{children:a}):a}),[c,a]);return n($,K({disabled:t||!1===c,onClick:l,icon:s,loading:r,size:o},{children:d}))}function ee(t){var r=t.value,a=t.options,o=t.disabled,l=t.onChange,c=t.showEmptyOption,s=t.emptyOptionLabel;return i.isEmpty(r)&&a.length>0&&!0!==c?(l(a[0].id),e("span",{children:[r," - selecting default ",a[0].id]})):e(C.Select,K({value:r||"",onChange:function(e){return l(e.target.value)},disabled:o},{children:[!0===c&&n("option",K({value:""},{children:s||""}),""),a?a.map((function(e,t){return n("option",K({value:e.id||""},{children:e.label||""}),t)})):n("span",{children:n(x,{})})]}))}function ne(e){var t=e.value,i=e.options,r=e.disabled,o=e.onChange,l=e.showEmptyOption,c=e.emptyOptionLabel,s=h((function(){return t?String(t):""}),[t]),d=h((function(){return i?i.map((function(e){return{id:e.id?String(e.id):"",label:e.label}})):[]}),[i]),u=p((function(e){return o(a.parseNumber(e))}),[o]);return n(ee,{disabled:r,value:s,options:d,onChange:u,showEmptyOption:l,emptyOptionLabel:c})}function te(e){var t=e.id,i=e.sort,r=e.disabled,a=e.labelGetter,o=e.onChange,l=e.options,c=e.showEmptyOption,s=e.emptyOptionLabel,d=h((function(){var e=[];return l&&(e=i?l.sort((function(e,n){return e.name>n.name?1:-1})):l),e.map((function(e){return{id:e.id,label:a?a(e):e.name}}))}),[l]);return n(ne,{disabled:r,value:t,options:d,onChange:o,showEmptyOption:c,emptyOptionLabel:s})}function ie(e){var t=e.value,i=e.options,r=e.onChange,a=e.showEmptyOption,o=e.emptyOptionLabel,l=h((function(){return i?i.map((function(e){return{id:e,label:e}})):[]}),[i]);return n(ee,{value:t,options:l,onChange:r,showEmptyOption:a,emptyOptionLabel:o})}function re(e){var t=e.id,i=e.disabled,r=e.checked,a=e.size,o=e.onChange;return n(C.Switch,{disabled:i,id:t,size:a,type:"switch",checked:r,onChange:function(e){return o(!r)},className:"cursor-pointer"})}function ae(t){var i=t.selected,r=t.disabled,a=t.labelGetter,l=t.onChange,c=t.onSearch,s=m(),d=s[0],u=s[1],v=m(),b=v[0],y=v[1],C=m(),w=C[0],x=C[1],N=f(),k=p((function(e){return a?a(e):"name"in e&&"string"==typeof e.name?e.name:"[".concat(e.id,"]")}),[a]),S=h((function(){return i?"border rounded border-primary":void 0}),[i]),O=p((function(){console.log("user left control"),w&&(x(void 0),y(i?k(i):""))}),[l,w,i,k]),P=p((function(){N.current=window.setTimeout(O,100)}),[N,O]),I=p((function(){N.current&&clearTimeout(N.current)}),[N]);g((function(){return I}),[]),g((function(){y(i?k(i):""),d&&(d.cancel(),u(void 0)),x(void 0)}),[i]);var E=p((function(){l(null),y(""),d&&(d.cancel(),u(void 0)),x(void 0)}),[l,d]),A=p((function(e){y(e),d&&d.cancel();var n=new o(c(e));n.promise.then(x),u(n)}),[d,c]),M=p((function(e){console.log("user selected item"),x(void 0),l(K({},e))}),[l]);return n("div",K({onBlur:P,onFocus:I},{children:e(z,K({defaultShow:!1,show:null!==w},{children:[n(q,{disabled:r,value:b,onChange:A,onReset:E,className:S}),w&&n(z.Menu,{children:w.map((function(e){return n(z.Item,K({onClick:function(n){I(),M(e)},active:e.id===(null==i?void 0:i.id)},{children:k(e)}),e.id)}))})]}))}))}function oe(e){var t=e.selected,r=e.disabled,a=e.labelGetter,o=e.onChange,l=e.entityClient,c=p((function(e){return l.loadPage({search:i.safeLowercase(e),page:0,size:10,sorting:[{name:"id"}]}).then((function(e){return e.content}))}),[a]);return n(ae,{disabled:r,selected:t,labelGetter:a,onSearch:c,onChange:o})}function le(e){var t=e.id,i=e.disabled,r=e.labelGetter,a=e.onChange,o=e.entityClient,c=m(null),s=c[0],d=c[1];g((function(){t?s&&s.id===t?d(K({},s)):o instanceof l?o.loadSingleStub(t).then(d):o.loadSingle(t).then(d):d(null)}),[t]);var u=p((function(e){var n=e?e.id:null;n!==t&&a(n),d(e)}),[t,a]);return n(oe,{disabled:i,selected:s,labelGetter:r,entityClient:o,onChange:u})}function ce(e){var t=e.selected,r=e.disabled,a=e.labelGetter,o=e.onChange,l=e.lookupClient,c=h((function(){return a||function(e){return e.name}}),[a]),s=p((function(e){return l.loadPage({search:i.safeLowercase(e),page:0,size:10,sorting:[{name:"name"}]}).then((function(e){return e.content}))}),[a]);return n(ae,{disabled:r,selected:t,labelGetter:c,onSearch:s,onChange:o})}function se(e){var t=e.id,i=e.disabled,r=e.labelGetter,a=e.onChange,o=e.lookupClient,l=m(null),c=l[0],s=l[1];g((function(){t?c&&c.id===t?s(K({},c)):o.loadSingle(t).then(s):s(null)}),[t]);var d=p((function(e){var n=e?e.id:null;n!==t&&a(n),s(e)}),[t,c]);return n(ce,{disabled:i,selected:c,labelGetter:r,lookupClient:o,onChange:d})}"function"==typeof SuppressedError&&SuppressedError;var de=v(new c);function ue(e){var i=e.text,r=e.tag,a=b(de),o=h((function(){if(void 0!==r&&""!==r)return"string"==typeof r?{tags:[r]}:{tags:r}}),[r]),l=h((function(){return a.translate(i,o)}),[a,i,o]);return n(t,{children:l})}function he(e){var t=e.paging,i=e.totalItems,r=e.onPagingChanged,a=Math.ceil(i/t.size),o=function(e){t.page=e,r(s.clone(t))},l=[];if(a>1){l.push(n(N.First,{onClick:function(){return o(0)},disabled:0===t.page},"first")),l.push(n(N.Prev,{onClick:function(){return o(t.page-1)},disabled:0===t.page},"prev"));var c=Math.round(3.5),d=t.page>c?t.page-c:0,u=d+10;u>=a&&(u=a-1),d>0&&l.push(n(N.Ellipsis,{disabled:!0},"ellipsisStart"));for(var h=function(e){l.push(n(N.Item,K({active:e===t.page,onClick:function(){return o(e)}},{children:e+1}),e))},p=d;p<=u;p++)h(p);u<a-1&&l.push(n(N.Ellipsis,{disabled:!0},"ellipsisEnd")),l.push(n(N.Next,{onClick:function(){return o(t.page+1)},disabled:t.page===a-1},"next")),l.push(n(N.Last,{onClick:function(){return o(a-1)},disabled:t.page===a-1},"last"))}return n(N,K({size:"sm",className:"flex-wrap m-0"},{children:l}))}var pe=[{id:10,label:"10"},{id:100,label:"100"},{id:1e3,label:"1000"}];function me(r){var a=r.hover,o=r.striped,l=r.bordered,c=r.header,d=r.children,u=r.paging,p=r.totalItems,m=r.onPagingChanged,f=Math.ceil(p/u.size),g=h((function(){var e=u.size;if(null===pe.find((function(n){return n.id===e}))){var n=s.clone(pe);return n.push({id:e,label:String(e)}),n}return pe}),[u]);return n("div",{children:e(k,K({hover:a,striped:o,responsive:!0,bordered:l},{children:[e("thead",{children:[n("tr",{children:n("td",K({colSpan:c.length},{children:e("div",K({className:"d-flex justify-content-between align-items-center gap-2"},{children:[e("div",{children:[n(ue,{text:"Page"}),": ",u.page+1," / ",f]}),n(he,{paging:u,totalItems:p,onPagingChanged:m}),e("div",{children:[n(ue,{text:"Total items"}),": ",p]})]}))}))}),n("tr",{children:c.map((function(r,a){var o=!1===r.sort?"":i.isBlank(r.sort)?r.name:r.sort;if(i.isBlank(o)||!o)return n("th",{children:r.label},a);var l=u.sorting&&u.sorting.find((function(e){return e.name===o}));return e("th",K({className:"user-select-none text-nowrap",role:"button",onClick:function(e){return function(e,n){u.sorting||(u.sorting=[]);var t=u.sorting.find((function(e){return e.name===n})),i=t&&1===u.sorting.length;e.ctrlKey||i||(u.sorting=[],t=void 0),t?t.desc=!t.desc:u.sorting.push({name:n}),m(s.clone(u))}(e,o)}},{children:[r.label,l?l.desc?n(M,{}):n(B,{}):n(t,{})]}),a)}))})]}),n("tbody",{children:d}),e("tfoot",{children:[n("tr",{children:n("td",K({colSpan:c.length},{children:e("div",K({className:"d-flex justify-content-between align-items-center gap-2"},{children:[e("div",{children:[n(ue,{text:"Page"}),": ",u.page+1," / ",f]}),n(he,{paging:u,totalItems:p,onPagingChanged:m}),e("div",{children:[n(ue,{text:"Total items"}),": ",p]})]}))}))}),n("tr",{children:n("td",K({colSpan:c.length},{children:e("div",K({className:"d-flex align-items-center gap-2 justify-content-end"},{children:[e("div",K({className:"text-nowrap"},{children:[n(ue,{text:"Page size"}),":"]})),n("div",{children:n(ne,{value:u.size,options:g,onChange:function(e){u.size=e||10,m(K({},u))},showEmptyOption:!1})})]}))}))})]})]}))})}function fe(e){e.disabled;var t=e.checked,i=e.iconOn,r=e.iconOff,a=e.size,o=e.onChange,l=h((function(){return t?i||n(L,{size:a}):r||n(G,{size:a,className:"text-muted"})}),[t,i,r,a]);return n("div",K({className:"d-flex align-items-center cursor-pointer",onClick:function(e){e.stopPropagation(),e.preventDefault(),o(!t)}},{children:l}))}function ge(t){var i=t.showSelect,r=t.header,a=t.items,o=t.onSelect,l=t.onClick,c=t.totalItems,d=t.paging,u=t.onPagingChanged,f=m(!1),v=f[0],b=f[1],y=m(),C=y[0],w=y[1],x=p((function(e){C&&w(C.map((function(n){return{selected:e,item:n.item}}))),b(e)}),[C]),z=h((function(){var e=Z([],r,!0);return!1!==i&&e.unshift({name:"",label:n("div",K({className:"py-1"},{children:n(fe,{checked:v,onChange:function(){return x(!v)},iconOn:n(j,{})})}))}),e}),[r,v,x]);return g((function(){w(a?a.map((function(e){return{selected:v,item:e}})):void 0)}),[a]),g((function(){C&&o&&o(C.filter((function(e){return e.selected})).map((function(e){return e.item})))}),[C,o]),n(me,K({header:z,hover:void 0!==l,paging:d,striped:!0,totalItems:c,onPagingChanged:u},{children:C&&C.map((function(t,a){return e("tr",K({className:"selectable ".concat(l?"cursor-pointer":""," ").concat(t.selected?"table-active table-primary":""),onClick:function(e){l&&l(t.item)}},{children:[!1!==i&&n("td",{children:n("div",K({className:"py-2 d-flex align-items-center"},{children:n(fe,{checked:t.selected,onChange:function(){t.selected=!t.selected,v&&!t.selected&&b(!1),w(Z([],C,!0))}})}))}),r.map((function(e,i){var r,a=e.renderer||(r=e.name,function(e){return s.getNestedValue(e,r)});return n("td",{children:a(t.item)},i)}))]}),a)}))}))}function ve(e){var t=e.cols,i=e.rows,r=e.size,a=h((function(){return void 0===t?5:t}),[t]),o=h((function(){return void 0===i?10:i}),[i]);return n("div",{children:n(k,K({responsive:!0},{children:n("tbody",{children:Array.from({length:o},(function(e,t){return n("tr",{children:Array.from({length:a},(function(e,t){return n("td",{children:n(S,{animation:"glow",size:r})},t)}))},t)}))})}))})}var be=new Map([[d.error,D],[d.warning,F],[d.info,H]]);function ye(e){var t=e.type,i=e.size,r=e.customVariant,a=be.get(t)||T;return n("div",K({className:"d-flex align-items-center text-".concat(void 0===r?t:r)},{children:a({size:i})}))}function Ce(t){var i=t.userAlert,a=t.maxDurationMs;return e(O,K({direction:"horizontal",gap:2,className:"align-items-center"},{children:[i.remainsMs&&n("div",K({style:{width:20}},{children:n(P,{min:0,max:a,now:i.remainsMs,variant:i.type})})),n("div",{children:r.formatDateForHumans(i.time)}),n(ye,{type:i.type}),n("div",{children:i.message})]}))}function we(i){var r=i.userAlerts,a=m(!1),o=a[0],l=a[1],c=m(r.alerts.length),s=c[0],d=c[1],u=m(Z([],r.visibleAlerts,!0)),h=u[0],f=u[1],v=m(r.getSummary()),b=v[0],y=v[1],C=p((function(){d(r.alerts.length),f(Z([],o?r.alerts:r.visibleAlerts,!0)),y(r.getSummary())}),[r,o]);return g((function(){r.addOnChangeHandler(C);var e=setInterval((function(){return r.updateVisibility()}),100);return function(){clearInterval(e),r.removeOnChangeHandler(C)}}),[r,C]),s<=0?n(t,{}):e("div",K({className:"user-alerts border rounded bg-body text-body position-fixed text-end",style:{bottom:15,right:15,zIndex:2147483647}},{children:[h.length>0&&n("div",K({className:"max-w-50 p-2 border-bottom"},{children:h.map((function(e,t){return n(Ce,{userAlert:e,maxDurationMs:r.maxVisibilityMs},t)}))})),n("div",K({className:"p-2"},{children:e(O,K({direction:"horizontal",gap:2,className:"justify-content-end align-items-center"},{children:[n(X,o?K({size:"sm",variant:"primary",onClick:function(){return l(!1)},icon:n(J,{})},{children:"Hide"}):K({size:"sm",variant:"primary",onClick:function(){return l(!0)},icon:n(V,{})},{children:"Show All"})),Array.from(b.entries()).map((function(t,i){return e(O,K({direction:"horizontal",gap:1,className:"px-1 border rounded align-items-center"},{children:[n(ye,{type:t[0],customVariant:0===t[1]?"muted":void 0}),n("div",K({className:t[1]>0?"text-".concat(t[0]," fw-bold"):"text-muted"},{children:t[1]}))]}),i)})),n(X,K({size:"sm",variant:"danger",onClick:function(){return r.reset()},icon:n(R,{})},{children:"Reset"}))]}))}))]}))}var xe=function(){function e(e){this.setProps=e}return e.prototype.confirm=function(e,n,t){var i=this;this.setProps({name:e,text:n,onConfirm:function(){t(),i.setProps(void 0)},onClose:function(){return i.setProps(void 0)}})},e}(),ze=v(new xe((function(){})));function Ne(t){var i=t.name,r=t.text,a=t.onClose,o=t.onConfirm;return e(I,K({show:!0},{children:[n(I.Header,{children:i||"Confirm"}),n(I.Body,{children:r}),n(I.Footer,{children:e(O,K({direction:"horizontal"},{children:[n(w,K({variant:"link",onClick:a},{children:"Zpět"})),n(w,K({variant:"primary",onClick:o},{children:"Ano"}))]}))})]}))}function ke(t){var i=t.stats,r=i.heapSize,a=i.heapMaxSize,o=i.heapFreeSize,l=r-o;return e("div",{children:[e("div",K({className:"d-flex align-items-center gap-2"},{children:[n("pre",{children:"Java Heap"}),e("pre",{children:["[",u.formatByteSize(r)," / ",u.formatByteSize(a),"]"]})]})),e("div",K({className:"d-flex align-items-center gap-2"},{children:[n("pre",{children:"Used:"}),n(E,K({className:"bg-warning text-bg-warning"},{children:u.formatByteSize(l)})),n("pre",{children:"Free:"}),n(E,K({className:"bg-success text-white"},{children:u.formatByteSize(o)}))]})),n("div",K({className:"p-1"},{children:e(P,K({min:0,max:a},{children:[n(P,{variant:"warning",min:0,now:l,max:a}),n(P,{variant:"success",min:0,now:o,max:a})]}))}))]})}function Se(t){var i=t.name,r=t.stats;return e("div",{children:[e("div",K({className:"d-flex align-items-center gap-2"},{children:[n("pre",{children:i}),e("pre",{children:["[",r.cachedItems,r.capacity>0&&" / ",r.capacity>0&&r.capacity,"]"]})]})),r.capacity>0&&n("div",K({className:"p-1"},{children:n(P,{now:r.cachedItems,min:0,max:r.capacity})}))]})}var Oe=new Map([["Idle","secondary"],["Processing","success"],["Loading","warn"]]);function Pe(e){var t=e.state,i=Oe.get(t)||"light";return n(E,K({className:"bg-".concat(i," text-bg-").concat(i)},{children:t}))}function Ie(t){var i=t.name,r=t.stats,a=r?r.remaining+r.processed:void 0;return e("div",{children:[e("div",K({className:"d-flex align-items-center gap-2"},{children:[n("pre",{children:i}),e("pre",{children:["[",void 0!==(null==r?void 0:r.processed)?r.processed:"?"," / ",void 0!==a?a:"?","]"]}),n(Pe,{state:r?r.state:"Unknown"})]})),n("div",K({className:"p-1"},{children:r?n(P,{variant:"primary",striped:!0,animated:!0,min:0,now:r.processed,max:a||1}):n(S,K({className:"w-100",animation:"glow"},{children:n(S,{className:"w-100"})}))}))]})}function Ee(e){var t=e.children,i=e.center,r=h((function(){return!1===i?"":"d-flex align-items-center justify-content-center"}),[i]);return n("div",K({className:"w-100 h-100 position-absolute ".concat(r),style:{left:0,right:0,top:0,bottom:0}},{children:t}))}export{me as AdvancedTable,le as AutocompleteEntityIdSelect,oe as AutocompleteEntitySelect,se as AutocompleteLookupIdSelect,ce as AutocompleteLookupSelect,ae as AutocompleteSelect,Se as CacheStatsControl,Ne as ConfirmDialog,ze as ConfirmDialogContext,xe as ConfirmDialogContextData,Q as DateInput,W as DateTimeInput,ie as EnumSelect,X as IconButton,Y as IconSwitch,ke as JavaHeapControl,$ as LoadingButton,de as LocalizationContext,ue as Localize,te as LookupSelect,ne as NumberSelect,Pe as QueueStateControl,Ie as QueueStatsControl,_ as SaveButton,Ee as Spread,ee as StringSelect,re as Switch,he as TablePagination,ve as TablePlaceholder,ge as TableWithSelect,q as TextInputWithReset,ye as UserAlertTypeIcon,Ce as UserAlertWidget,we as UserAlertsWidget};
2
2
  //# sourceMappingURL=index.esm.js.map