@ansible/ansible-ui-framework 2.4.2651 → 2.4.2653
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -0
- package/index.umd.cjs +1 -1
- package/package.json +1 -1
- package/utils/queryString.test.d.ts +1 -0
package/index.js
CHANGED
@@ -31566,6 +31566,11 @@ class eae {
|
|
31566
31566
|
for (; t; )
|
31567
31567
|
yield t.value, t = t.next;
|
31568
31568
|
}
|
31569
|
+
*drain() {
|
31570
|
+
let t;
|
31571
|
+
for (; (t = this.dequeue()) !== void 0; )
|
31572
|
+
yield t;
|
31573
|
+
}
|
31569
31574
|
}
|
31570
31575
|
Zn = new WeakMap(), Oa = new WeakMap(), Ta = new WeakMap();
|
31571
31576
|
function tae(e) {
|
package/index.umd.cjs
CHANGED
@@ -379,7 +379,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[lc]+=1);const cc=Ae.button`
|
|
379
379
|
* LICENSE file in the root directory of this source tree.
|
380
380
|
*/var cj;function Pte(){return cj||(cj=1,process.env.NODE_ENV!=="production"&&function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),m=!1,p=!1,y=!1,x=!1,b=!1,S;S=Symbol.for("react.module.reference");function w(oe){return!!(typeof oe=="string"||typeof oe=="function"||oe===n||oe===i||b||oe===r||oe===c||oe===u||x||oe===h||m||p||y||typeof oe=="object"&&oe!==null&&(oe.$$typeof===f||oe.$$typeof===d||oe.$$typeof===a||oe.$$typeof===o||oe.$$typeof===l||oe.$$typeof===S||oe.getModuleId!==void 0))}function _(oe){if(typeof oe=="object"&&oe!==null){var ve=oe.$$typeof;switch(ve){case e:var Me=oe.type;switch(Me){case n:case i:case r:case c:case u:return Me;default:var be=Me&&Me.$$typeof;switch(be){case s:case o:case l:case f:case d:case a:return be;default:return ve}}case t:return ve}}}var E=o,k=a,T=e,j=l,A=n,O=f,P=d,D=t,M=i,I=r,V=c,K=u,H=!1,z=!1;function $(oe){return H||(H=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function U(oe){return z||(z=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Q(oe){return _(oe)===o}function re(oe){return _(oe)===a}function te(oe){return typeof oe=="object"&&oe!==null&&oe.$$typeof===e}function ne(oe){return _(oe)===l}function ce(oe){return _(oe)===n}function de(oe){return _(oe)===f}function ue(oe){return _(oe)===d}function W(oe){return _(oe)===t}function J(oe){return _(oe)===i}function fe(oe){return _(oe)===r}function N(oe){return _(oe)===c}function Ce(oe){return _(oe)===u}Ke.ContextConsumer=E,Ke.ContextProvider=k,Ke.Element=T,Ke.ForwardRef=j,Ke.Fragment=A,Ke.Lazy=O,Ke.Memo=P,Ke.Portal=D,Ke.Profiler=M,Ke.StrictMode=I,Ke.Suspense=V,Ke.SuspenseList=K,Ke.isAsyncMode=$,Ke.isConcurrentMode=U,Ke.isContextConsumer=Q,Ke.isContextProvider=re,Ke.isElement=te,Ke.isForwardRef=ne,Ke.isFragment=ce,Ke.isLazy=de,Ke.isMemo=ue,Ke.isPortal=W,Ke.isProfiler=J,Ke.isStrictMode=fe,Ke.isSuspense=N,Ke.isSuspenseList=Ce,Ke.isValidElementType=w,Ke.typeOf=_}()),Ke}var uj;function Mte(){return uj||(uj=1,process.env.NODE_ENV==="production"?Od.exports=Dte():Od.exports=Pte()),Od.exports}var qb=Mte();function Lte(e,t,n){var r=B.useRef({});return(!("value"in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}var Ite=Number(v.version.split(".")[0]),Fte=function(t,n){typeof t=="function"?t(n):Ar(t)==="object"&&t&&"current"in t&&(t.current=n)},Nte=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);return i.length<=1?i[0]:function(a){n.forEach(function(o){Fte(o,a)})}},$te=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Lte(function(){return Nte.apply(void 0,n)},n,function(i,a){return i.length!==a.length||i.every(function(o,s){return o!==a[s]})})},qte=function(t){var n,r;if(!t)return!1;if(dj(t)&&Ite>=19)return!0;var i=qb.isMemo(t)?t.type.type:t.type;return!(typeof i=="function"&&!((n=i.prototype)!==null&&n!==void 0&&n.render)&&i.$$typeof!==qb.ForwardRef||typeof t=="function"&&!((r=t.prototype)!==null&&r!==void 0&&r.render)&&t.$$typeof!==qb.ForwardRef)};function dj(e){return v.isValidElement(e)&&!nj(e)}var Rte=function(t){if(t&&dj(t)){var n=t;return n.props.propertyIsEnumerable("ref")?n.props.ref:n.ref}return null},Rb=B.createContext(null);function zte(e){var t=e.children,n=e.onBatchResize,r=B.useRef(0),i=B.useRef([]),a=B.useContext(Rb),o=B.useCallback(function(s,l,c){r.current+=1;var u=r.current;i.current.push({size:s,element:l,data:c}),Promise.resolve().then(function(){u===r.current&&(n==null||n(i.current),i.current=[])}),a==null||a(s,l,c)},[n,a]);return B.createElement(Rb.Provider,{value:o},t)}var fj=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(i,a){return i[0]===n?(r=a,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,a=this.__entries__;i<a.length;i++){var o=a[i];n.call(r,o[1],o[0])}},t}()}(),zb=typeof window<"u"&&typeof document<"u"&&window.document===document,Ad=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Bte=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ad):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Wte=2;function Vte(e,t){var n=!1,r=!1,i=0;function a(){n&&(n=!1,e()),r&&s()}function o(){Bte(a)}function s(){var l=Date.now();if(n){if(l-i<Wte)return;r=!0}else n=!0,r=!1,setTimeout(o,t);i=l}return s}var Ute=20,Hte=["top","right","bottom","left","width","height","size","weight"],Gte=typeof MutationObserver<"u",Yte=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Vte(this.refresh.bind(this),Ute)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!zb||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Gte?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!zb||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=Hte.some(function(a){return!!~r.indexOf(a)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),hj=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},Jo=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Ad},gj=Dd(0,0,0,0);function jd(e){return parseFloat(e)||0}function mj(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,i){var a=e["border-"+i+"-width"];return r+jd(a)},0)}function Kte(e){for(var t=["top","right","bottom","left"],n={},r=0,i=t;r<i.length;r++){var a=i[r],o=e["padding-"+a];n[a]=jd(o)}return n}function Zte(e){var t=e.getBBox();return Dd(0,0,t.width,t.height)}function Xte(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return gj;var r=Jo(e).getComputedStyle(e),i=Kte(r),a=i.left+i.right,o=i.top+i.bottom,s=jd(r.width),l=jd(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+a)!==t&&(s-=mj(r,"left","right")+a),Math.round(l+o)!==n&&(l-=mj(r,"top","bottom")+o)),!Qte(e)){var c=Math.round(s+a)-t,u=Math.round(l+o)-n;Math.abs(c)!==1&&(s-=c),Math.abs(u)!==1&&(l-=u)}return Dd(i.left,i.top,s,l)}var Jte=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Jo(e).SVGGraphicsElement}:function(e){return e instanceof Jo(e).SVGElement&&typeof e.getBBox=="function"}}();function Qte(e){return e===Jo(e).document.documentElement}function ene(e){return zb?Jte(e)?Zte(e):Xte(e):gj}function tne(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(a.prototype);return hj(o,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),o}function Dd(e,t,n,r){return{x:e,y:t,width:n,height:r}}var nne=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Dd(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=ene(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),rne=function(){function e(t,n){var r=tne(n);hj(this,{target:t,contentRect:r})}return e}(),ine=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new fj,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Jo(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new nne(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Jo(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new rne(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),pj=typeof WeakMap<"u"?new WeakMap:new fj,yj=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Yte.getInstance(),r=new ine(t,n,this);pj.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){yj.prototype[e]=function(){var t;return(t=pj.get(this))[e].apply(t,arguments)}});var ane=function(){return typeof Ad.ResizeObserver<"u"?Ad.ResizeObserver:yj}(),ui=new Map;function vj(e){e.forEach(function(t){var n,r=t.target;(n=ui.get(r))===null||n===void 0||n.forEach(function(i){return i(r)})})}var bj=new ane(vj);process.env.NODE_ENV,process.env.NODE_ENV;function one(e,t){ui.has(e)||(ui.set(e,new Set),bj.observe(e)),ui.get(e).add(t)}function sne(e,t){ui.has(e)&&(ui.get(e).delete(t),ui.get(e).size||(bj.unobserve(e),ui.delete(e)))}function lne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ij(r.key),r)}}function une(e,t,n){return t&&cne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bb(e,t){return Bb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Bb(e,t)}function dne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bb(e,t)}function Pd(e){return Pd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pd(e)}function xj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xj=function(){return!!e})()}function fne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hne(e,t){if(t&&(Ar(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fne(e)}function gne(e){var t=xj();return function(){var n,r=Pd(e);if(t){var i=Pd(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return hne(this,n)}}var mne=function(e){dne(n,e);var t=gne(n);function n(){return lne(this,n),t.apply(this,arguments)}return une(n,[{key:"render",value:function(){return this.props.children}}]),n}(B.Component);function pne(e,t){var n=e.children,r=e.disabled,i=B.useRef(null),a=B.useRef(null),o=B.useContext(Rb),s=typeof n=="function",l=s?n(i):n,c=B.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!s&&B.isValidElement(l)&&qte(l),d=u?Rte(l):null,f=$te(d,i),h=function(){var x;return $b(i.current)||(i.current&&Ar(i.current)==="object"?$b((x=i.current)===null||x===void 0?void 0:x.nativeElement):null)||$b(a.current)};B.useImperativeHandle(t,function(){return h()});var m=B.useRef(e);m.current=e;var p=B.useCallback(function(y){var x=m.current,b=x.onResize,S=x.data,w=y.getBoundingClientRect(),_=w.width,E=w.height,k=y.offsetWidth,T=y.offsetHeight,j=Math.floor(_),A=Math.floor(E);if(c.current.width!==j||c.current.height!==A||c.current.offsetWidth!==k||c.current.offsetHeight!==T){var O={width:j,height:A,offsetWidth:k,offsetHeight:T};c.current=O;var P=k===Math.round(_)?_:k,D=T===Math.round(E)?E:T,M=oj(oj({},O),{},{offsetWidth:P,offsetHeight:D});o==null||o(M,y,S),b&&Promise.resolve().then(function(){b(M,y)})}},[]);return B.useEffect(function(){var y=h();return y&&!r&&one(y,p),function(){return sne(y,p)}},[i.current,r]),B.createElement(mne,{ref:a},u?B.cloneElement(l,{ref:f}):l)}var _j=B.forwardRef(pne);process.env.NODE_ENV!=="production"&&(_j.displayName="SingleObserver");var yne="rc-observer-key";function vne(e,t){var n=e.children,r=typeof n=="function"?[n]:Nb(n);return process.env.NODE_ENV!=="production"&&(r.length>1?rj(!1,"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead."):r.length===0&&rj(!1,"`children` of ResizeObserver is empty. Nothing is in observe.")),r.map(function(i,a){var o=(i==null?void 0:i.key)||"".concat(yne,"-").concat(a);return B.createElement(_j,Fb({},e,{key:o,ref:a===0?t:void 0}),i)})}var Wb=B.forwardRef(vne);process.env.NODE_ENV!=="production"&&(Wb.displayName="ResizeObserver"),Wb.Collection=zte;function Sj(e){const{disablePadding:t,alertPrompts:n}=e,r=ca(),i=e.labelOrientation??r.formLayout,a=e.numberOfColumns?e.numberOfColumns:r.formColumns,o=e.isCompact,[s,l]=v.useState("1fr"),c=v.useCallback(({width:d})=>{let f=Math.max(1+Math.floor((d-350)/374),1);switch(f<1&&(f=1),a){case"multiple":break;case"two":f=Math.min(f,2);break;default:f=1}switch(i){case"horizontal":f=1;break}l(()=>new Array(f).fill("1fr").join(" "))},[a,i]);let u=g.jsxs(bne,{variant:"light",padding:{default:"noPadding"},children:[n&&n.length>0&&n.map((d,f)=>g.jsx(C.Alert,{style:{margin:12},isInline:!0,title:d,variant:"warning","data-cy":d},f)),g.jsx(Wb,{onResize:c,children:g.jsx(C.DescriptionList,{style:{padding:t?void 0:24,gridTemplateColumns:s},isCompact:o,children:e.children})})]});return e.disableScroll||(u=g.jsx(qn,{children:u})),u}const bne=Ae(C.PageSection)`
|
381
381
|
background-color: transparent;
|
382
|
-
`;var Ze=(e=>(e.Table="table",e.List="list",e.Cards="cards",e))(Ze||{}),Vi=(e=>(e.description="description",e.expanded="expanded",e.hidden="hidden",e))(Vi||{}),wj=(e=>(e.name="name",e.subtitle="subtitle",e.description="description",e.hidden="hidden",e.primary="primary",e.secondary="secondary",e))(wj||{}),Cj=(e=>(e.name="name",e.subtitle="subtitle",e.description="description",e.hidden="hidden",e))(Cj||{}),Ej=(e=>(e.hidden="hidden",e))(Ej||{}),kj=(e=>(e.hidden="hidden",e))(kj||{}),Md=(e=>(e.last="last",e))(Md||{});function Kt(e){var r;const{item:t,column:n}=e;if(!n)return g.jsx(g.Fragment,{});switch(n.type){case"text":return g.jsx(i2,{text:n.value(t),to:(r=n.to)==null?void 0:r.call(n,t)});case"description":return g.jsx("div",{style:{minWidth:200,whiteSpace:"normal"},children:n.value(t)});case"datetime":return g.jsx(n2,{value:n.value(t)});case"count":return g.jsx(g.Fragment,{children:n.value(t)??"-"});case"labels":return g.jsx(r2,{labels:n.value(t)??[]});default:return g.jsx(g.Fragment,{children:n.cell(t)})}}function Vb(e){return v.useMemo(()=>e.filter(t=>!(t.table==="hidden"||t.table==="description"||t.table==="expanded")),[e])}function Tj(e){return v.useMemo(()=>e.filter(t=>t.list!=="hidden"),[e])}function Oj(e){return v.useMemo(()=>e.filter(t=>t.card!=="hidden"),[e])}function Ld(e){return v.useMemo(()=>e.filter(t=>t.modal!=="hidden"),[e])}function xne(e){return e=v.useMemo(()=>e.filter(t=>t.dashboard!=="hidden"),[e]),e=Dj(e),e=Pj(e),e}function _ne(e,t){const n=Vb(e),r=Tj(e),i=Oj(e);switch(t){case Ze.Table:return n;case Ze.List:return r;case Ze.Cards:return i}}function Aj(e){return v.useMemo(()=>e.filter(t=>t.table==="hidden"?!1:t.table==="description"),[e])}function jj(e){return v.useMemo(()=>e.filter(t=>t.table==="hidden"?!1:t.table==="expanded"),[e])}function Dj(e){return v.useMemo(()=>e.map(t=>({...t,sort:void 0})),[e])}function Pj(e){return v.useMemo(()=>e.map(t=>({...t,table:t.table==="expanded"?void 0:t.table})),[e])}function Mj(e){const{item:t,columns:n,children:r}=e,i=v.useMemo(()=>n.filter(s=>{if(!t)return!1;if("value"in s&&s.value){const l=s.value(t);if(l==null||typeof l=="string"&&l.trim().length===0)return!1}return!0}),[n,t]),a=v.useMemo(()=>i.filter(s=>s.priority!==Md.last),[i]),o=v.useMemo(()=>i.filter(s=>s.priority===Md.last),[i]);return!t||!i.length?null:g.jsxs(g.Fragment,{children:[a.map(s=>g.jsx(Xo,{helpText:s.helpText,label:s.header,children:g.jsx(Kt,{column:s,item:t})},s.id??s.header)),r||null,o.map(s=>g.jsx(Xo,{label:s.header,children:g.jsx(Kt,{column:s,item:t})},s.id??s.header))]})}class Sne{constructor(t){ae(this,"value");ae(this,"next");this.value=t}}class wne{constructor(){hf(this,nr);hf(this,Va);hf(this,Ua);this.clear()}enqueue(t){const n=new Sne(t);Rr(this,nr)?(Rr(this,Va).next=n,vi(this,Va,n)):(vi(this,nr,n),vi(this,Va,n)),Jx(this,Ua)._++}dequeue(){const t=Rr(this,nr);if(t)return vi(this,nr,Rr(this,nr).next),Jx(this,Ua)._--,t.value}peek(){if(Rr(this,nr))return Rr(this,nr).value}clear(){vi(this,nr,void 0),vi(this,Va,void 0),vi(this,Ua,0)}get size(){return Rr(this,Ua)}*[Symbol.iterator](){let t=Rr(this,nr);for(;t;)yield t.value,t=t.next}}nr=new WeakMap,Va=new WeakMap,Ua=new WeakMap;function Cne(e){Lj(e);const t=new wne;let n=0;const r=()=>{n<e&&t.size>0&&(t.dequeue()(),n++)},i=()=>{n--,r()},a=async(l,c,u)=>{const d=(async()=>l(...u))();c(d);try{await d}catch{}i()},o=(l,c,u)=>{new Promise(d=>{t.enqueue(d)}).then(a.bind(void 0,l,c,u)),(async()=>(await Promise.resolve(),n<e&&r()))()},s=(l,...c)=>new Promise(u=>{o(l,u,c)});return Object.defineProperties(s,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value(){t.clear()}},concurrency:{get:()=>e,set(l){Lj(l),e=l,queueMicrotask(()=>{for(;n<e&&t.size>0;)r()})}}}),s}function Lj(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const _l=e=>{const t=["json"],n=["non_field_errors"],r=[],i=[];switch(typeof e){case"string":r.push({message:e});break;case"object":if(e===null)break;if(Array.isArray(e)){for(const a of e)typeof a=="string"&&r.push({message:a});break}for(const a of t)if(a in e&&typeof e[a]=="object"&&e[a]!==null)for(const o in e[a]){const s=e[a][o];if(n.includes(o)){if(typeof s=="string")r.push({message:s});else if(Array.isArray(s))for(const l of s)typeof l=="string"&&r.push({message:l})}else if(typeof s=="string")o==="detail"?r.push({message:s}):i.push({name:o,message:s});else if(Array.isArray(s))for(const l of s)typeof l=="string"&&i.push({name:o,message:l})}else e instanceof Error&&r.push({message:e.message});break}return{genericErrors:r,fieldErrors:i}};function Id(e,t){const[n,r]=v.useState(()=>e);v.useEffect(()=>r(e),[e]);const i=v.useCallback(a=>{t?t(a):r(a)},[t]);return[n,i]}function Ij(e){const{t}=De(),{id:n,icon:r,placeholder:i,values:a,onSelect:o,options:s,variant:l,disableClearSelection:c,maxChipSize:u,queryLabel:d,compareOptionValues:f}=e,[h,m]=Id(e.open??!1,e.setOpen),[p,y]=Id(e.searchValue??"",e.setSearchValue),x=v.useRef(null),b=v.useMemo(()=>{const j=[];for(const A of a??[]){const O=s.find(P=>f?f(P.value,A):P.value===A);O?j.push(O):d&&A!==void 0&&j.push({label:d(A),value:A})}return j},[s,d,a,f]),S=j=>g.jsx(C.Tooltip,{content:e.isDisabled,trigger:e.isDisabled?void 0:"manual",children:g.jsx(C.MenuToggle,{id:n,ref:j,onClick:()=>m(!h),isExpanded:h,onKeyDown:A=>{switch(A.key){case"Tab":case"Enter":case"Shift":break;default:m(!0),setTimeout(()=>{E.current&&(E.current.focus(),E.current.value=A.key)},1);break}},"data-cy":n,icon:r,isDisabled:!!e.isDisabled,isFullWidth:!0,style:{paddingTop:2,paddingBottom:4,minHeight:36},children:b.length>0?g.jsx(g.Fragment,{children:l==="count"?g.jsx(C.Chip,{isReadOnly:c,onClick:()=>o(()=>[]),style:{marginTop:-4,marginBottom:-4},children:b.length}):g.jsxs(C.ChipGroup,{numChips:99,children:[b.map(A=>g.jsx(C.Chip,{isReadOnly:e.disableClearChips,textMaxWidth:u,style:{marginTop:-2,marginBottom:-2},onClick:()=>o(O=>O==null?void 0:O.filter(P=>P!==A.value)),children:A.label},A.label)),!c&&g.jsx(pe.TimesIcon,{role:"button","aria-hidden":!0,onClick:()=>o(()=>[]),style:{verticalAlign:"middle",marginLeft:8}})]})}):g.jsx("span",{style:{opacity:.7},children:i})})}),w=v.useMemo(()=>b.map(j=>j.label),[b]),_=v.useCallback((j,A)=>{o(O=>{const P=s.find(D=>D.key!==void 0?D.key===A:D.label===A);return P&&((O==null?void 0:O.find(D=>f?f(D,P.value):D===P.value))!==void 0?O=O.filter(D=>f?!f(D,P.value):D!==P.value):(O=O?[...O]:[],O.push(P.value))),O})},[o,s,f]),E=v.useRef(null);v.useEffect(()=>{h||y("")},[h,y]);const k=v.useMemo(()=>{const j=s.filter(A=>p===""?!0:A.label.toLowerCase().includes(p.toLowerCase()));return e.disableSortOptions||j.sort((A,O)=>A.label.toLowerCase().localeCompare(O.label.toLowerCase())),j},[s,e.disableSortOptions,p]),T=v.useMemo(()=>{if(s.some(A=>!!A.group)){const A={};for(const O of k){const P=O.group??"";A[P]||(A[P]=[]),A[P].push(O)}return A}},[s,k]);return g.jsxs(C.Select,{id:`${n}-select`,selected:w,onSelect:_,isOpen:h,onOpenChange:m,toggle:S,popperProps:{appendTo:()=>document.body,preventOverflow:!0,enableFlip:!0,maxWidth:e.disableMaxDropdownWidth?void 0:"trigger"},innerRef:x,children:[g.jsx(C.MenuSearch,{children:g.jsx(C.MenuSearchInput,{"data-cy":"search-input",children:g.jsx(C.SearchInput,{id:`${n}-search`,ref:E,value:p,onChange:(j,A)=>y(A),onClear:j=>{j.stopPropagation(),y("")},resultsCount:k.length!==s.length?`${k.length} / ${s.length}`:void 0,onKeyDown:j=>{var A;switch(j.key){case"ArrowDown":case"Tab":{j.preventDefault(),j.stopPropagation();const O=(A=x==null?void 0:x.current)==null?void 0:A.querySelector("li button:not(:disabled),li input:not(:disabled)");O&&O.focus();break}}}})})}),g.jsx(C.Divider,{}),k.length===0?g.jsx(g.Fragment,{children:e.isLoading?g.jsx(C.Bullseye,{style:{padding:16},children:g.jsx(C.Spinner,{size:"lg"})}):g.jsx(C.SelectOption,{isDisabled:!0,children:t("No results found")},"no result")}):g.jsx(Ene,{children:T?g.jsx(g.Fragment,{children:Object.keys(T).map(j=>g.jsx(C.SelectGroup,{label:j,children:g.jsx(Fj,{searchRef:E,options:k,selectedOptions:b})},j))}):g.jsx(Fj,{searchRef:E,options:k,selectedOptions:b})}),e.footer&&g.jsx(C.MenuFooter,{children:e.footer})]})}function Fj(e){return g.jsx(C.SelectList,{onKeyDown:t=>{var n;switch(t.key){case"Tab":t.preventDefault(),t.stopPropagation(),(n=e.searchRef.current)==null||n.focus();break}},children:e.options.map(t=>{const n=br(t);return g.jsx(C.SelectOption,{id:n,icon:t.icon,value:t.key!==void 0?t.key:t.label,description:t.description?g.jsx("div",{style:{maxWidth:300},children:t.description}):void 0,hasCheckbox:!0,isSelected:e.selectedOptions.includes(t),"data-cy":n,children:t.label},t.key!==void 0?t.key:t.label)})})}const Ene=Ae(qn)`
|
382
|
+
`;var Ze=(e=>(e.Table="table",e.List="list",e.Cards="cards",e))(Ze||{}),Vi=(e=>(e.description="description",e.expanded="expanded",e.hidden="hidden",e))(Vi||{}),wj=(e=>(e.name="name",e.subtitle="subtitle",e.description="description",e.hidden="hidden",e.primary="primary",e.secondary="secondary",e))(wj||{}),Cj=(e=>(e.name="name",e.subtitle="subtitle",e.description="description",e.hidden="hidden",e))(Cj||{}),Ej=(e=>(e.hidden="hidden",e))(Ej||{}),kj=(e=>(e.hidden="hidden",e))(kj||{}),Md=(e=>(e.last="last",e))(Md||{});function Kt(e){var r;const{item:t,column:n}=e;if(!n)return g.jsx(g.Fragment,{});switch(n.type){case"text":return g.jsx(i2,{text:n.value(t),to:(r=n.to)==null?void 0:r.call(n,t)});case"description":return g.jsx("div",{style:{minWidth:200,whiteSpace:"normal"},children:n.value(t)});case"datetime":return g.jsx(n2,{value:n.value(t)});case"count":return g.jsx(g.Fragment,{children:n.value(t)??"-"});case"labels":return g.jsx(r2,{labels:n.value(t)??[]});default:return g.jsx(g.Fragment,{children:n.cell(t)})}}function Vb(e){return v.useMemo(()=>e.filter(t=>!(t.table==="hidden"||t.table==="description"||t.table==="expanded")),[e])}function Tj(e){return v.useMemo(()=>e.filter(t=>t.list!=="hidden"),[e])}function Oj(e){return v.useMemo(()=>e.filter(t=>t.card!=="hidden"),[e])}function Ld(e){return v.useMemo(()=>e.filter(t=>t.modal!=="hidden"),[e])}function xne(e){return e=v.useMemo(()=>e.filter(t=>t.dashboard!=="hidden"),[e]),e=Dj(e),e=Pj(e),e}function _ne(e,t){const n=Vb(e),r=Tj(e),i=Oj(e);switch(t){case Ze.Table:return n;case Ze.List:return r;case Ze.Cards:return i}}function Aj(e){return v.useMemo(()=>e.filter(t=>t.table==="hidden"?!1:t.table==="description"),[e])}function jj(e){return v.useMemo(()=>e.filter(t=>t.table==="hidden"?!1:t.table==="expanded"),[e])}function Dj(e){return v.useMemo(()=>e.map(t=>({...t,sort:void 0})),[e])}function Pj(e){return v.useMemo(()=>e.map(t=>({...t,table:t.table==="expanded"?void 0:t.table})),[e])}function Mj(e){const{item:t,columns:n,children:r}=e,i=v.useMemo(()=>n.filter(s=>{if(!t)return!1;if("value"in s&&s.value){const l=s.value(t);if(l==null||typeof l=="string"&&l.trim().length===0)return!1}return!0}),[n,t]),a=v.useMemo(()=>i.filter(s=>s.priority!==Md.last),[i]),o=v.useMemo(()=>i.filter(s=>s.priority===Md.last),[i]);return!t||!i.length?null:g.jsxs(g.Fragment,{children:[a.map(s=>g.jsx(Xo,{helpText:s.helpText,label:s.header,children:g.jsx(Kt,{column:s,item:t})},s.id??s.header)),r||null,o.map(s=>g.jsx(Xo,{label:s.header,children:g.jsx(Kt,{column:s,item:t})},s.id??s.header))]})}class Sne{constructor(t){ae(this,"value");ae(this,"next");this.value=t}}class wne{constructor(){hf(this,nr);hf(this,Va);hf(this,Ua);this.clear()}enqueue(t){const n=new Sne(t);Rr(this,nr)?(Rr(this,Va).next=n,vi(this,Va,n)):(vi(this,nr,n),vi(this,Va,n)),Jx(this,Ua)._++}dequeue(){const t=Rr(this,nr);if(t)return vi(this,nr,Rr(this,nr).next),Jx(this,Ua)._--,t.value}peek(){if(Rr(this,nr))return Rr(this,nr).value}clear(){vi(this,nr,void 0),vi(this,Va,void 0),vi(this,Ua,0)}get size(){return Rr(this,Ua)}*[Symbol.iterator](){let t=Rr(this,nr);for(;t;)yield t.value,t=t.next}*drain(){let t;for(;(t=this.dequeue())!==void 0;)yield t}}nr=new WeakMap,Va=new WeakMap,Ua=new WeakMap;function Cne(e){Lj(e);const t=new wne;let n=0;const r=()=>{n<e&&t.size>0&&(t.dequeue()(),n++)},i=()=>{n--,r()},a=async(l,c,u)=>{const d=(async()=>l(...u))();c(d);try{await d}catch{}i()},o=(l,c,u)=>{new Promise(d=>{t.enqueue(d)}).then(a.bind(void 0,l,c,u)),(async()=>(await Promise.resolve(),n<e&&r()))()},s=(l,...c)=>new Promise(u=>{o(l,u,c)});return Object.defineProperties(s,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value(){t.clear()}},concurrency:{get:()=>e,set(l){Lj(l),e=l,queueMicrotask(()=>{for(;n<e&&t.size>0;)r()})}}}),s}function Lj(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const _l=e=>{const t=["json"],n=["non_field_errors"],r=[],i=[];switch(typeof e){case"string":r.push({message:e});break;case"object":if(e===null)break;if(Array.isArray(e)){for(const a of e)typeof a=="string"&&r.push({message:a});break}for(const a of t)if(a in e&&typeof e[a]=="object"&&e[a]!==null)for(const o in e[a]){const s=e[a][o];if(n.includes(o)){if(typeof s=="string")r.push({message:s});else if(Array.isArray(s))for(const l of s)typeof l=="string"&&r.push({message:l})}else if(typeof s=="string")o==="detail"?r.push({message:s}):i.push({name:o,message:s});else if(Array.isArray(s))for(const l of s)typeof l=="string"&&i.push({name:o,message:l})}else e instanceof Error&&r.push({message:e.message});break}return{genericErrors:r,fieldErrors:i}};function Id(e,t){const[n,r]=v.useState(()=>e);v.useEffect(()=>r(e),[e]);const i=v.useCallback(a=>{t?t(a):r(a)},[t]);return[n,i]}function Ij(e){const{t}=De(),{id:n,icon:r,placeholder:i,values:a,onSelect:o,options:s,variant:l,disableClearSelection:c,maxChipSize:u,queryLabel:d,compareOptionValues:f}=e,[h,m]=Id(e.open??!1,e.setOpen),[p,y]=Id(e.searchValue??"",e.setSearchValue),x=v.useRef(null),b=v.useMemo(()=>{const j=[];for(const A of a??[]){const O=s.find(P=>f?f(P.value,A):P.value===A);O?j.push(O):d&&A!==void 0&&j.push({label:d(A),value:A})}return j},[s,d,a,f]),S=j=>g.jsx(C.Tooltip,{content:e.isDisabled,trigger:e.isDisabled?void 0:"manual",children:g.jsx(C.MenuToggle,{id:n,ref:j,onClick:()=>m(!h),isExpanded:h,onKeyDown:A=>{switch(A.key){case"Tab":case"Enter":case"Shift":break;default:m(!0),setTimeout(()=>{E.current&&(E.current.focus(),E.current.value=A.key)},1);break}},"data-cy":n,icon:r,isDisabled:!!e.isDisabled,isFullWidth:!0,style:{paddingTop:2,paddingBottom:4,minHeight:36},children:b.length>0?g.jsx(g.Fragment,{children:l==="count"?g.jsx(C.Chip,{isReadOnly:c,onClick:()=>o(()=>[]),style:{marginTop:-4,marginBottom:-4},children:b.length}):g.jsxs(C.ChipGroup,{numChips:99,children:[b.map(A=>g.jsx(C.Chip,{isReadOnly:e.disableClearChips,textMaxWidth:u,style:{marginTop:-2,marginBottom:-2},onClick:()=>o(O=>O==null?void 0:O.filter(P=>P!==A.value)),children:A.label},A.label)),!c&&g.jsx(pe.TimesIcon,{role:"button","aria-hidden":!0,onClick:()=>o(()=>[]),style:{verticalAlign:"middle",marginLeft:8}})]})}):g.jsx("span",{style:{opacity:.7},children:i})})}),w=v.useMemo(()=>b.map(j=>j.label),[b]),_=v.useCallback((j,A)=>{o(O=>{const P=s.find(D=>D.key!==void 0?D.key===A:D.label===A);return P&&((O==null?void 0:O.find(D=>f?f(D,P.value):D===P.value))!==void 0?O=O.filter(D=>f?!f(D,P.value):D!==P.value):(O=O?[...O]:[],O.push(P.value))),O})},[o,s,f]),E=v.useRef(null);v.useEffect(()=>{h||y("")},[h,y]);const k=v.useMemo(()=>{const j=s.filter(A=>p===""?!0:A.label.toLowerCase().includes(p.toLowerCase()));return e.disableSortOptions||j.sort((A,O)=>A.label.toLowerCase().localeCompare(O.label.toLowerCase())),j},[s,e.disableSortOptions,p]),T=v.useMemo(()=>{if(s.some(A=>!!A.group)){const A={};for(const O of k){const P=O.group??"";A[P]||(A[P]=[]),A[P].push(O)}return A}},[s,k]);return g.jsxs(C.Select,{id:`${n}-select`,selected:w,onSelect:_,isOpen:h,onOpenChange:m,toggle:S,popperProps:{appendTo:()=>document.body,preventOverflow:!0,enableFlip:!0,maxWidth:e.disableMaxDropdownWidth?void 0:"trigger"},innerRef:x,children:[g.jsx(C.MenuSearch,{children:g.jsx(C.MenuSearchInput,{"data-cy":"search-input",children:g.jsx(C.SearchInput,{id:`${n}-search`,ref:E,value:p,onChange:(j,A)=>y(A),onClear:j=>{j.stopPropagation(),y("")},resultsCount:k.length!==s.length?`${k.length} / ${s.length}`:void 0,onKeyDown:j=>{var A;switch(j.key){case"ArrowDown":case"Tab":{j.preventDefault(),j.stopPropagation();const O=(A=x==null?void 0:x.current)==null?void 0:A.querySelector("li button:not(:disabled),li input:not(:disabled)");O&&O.focus();break}}}})})}),g.jsx(C.Divider,{}),k.length===0?g.jsx(g.Fragment,{children:e.isLoading?g.jsx(C.Bullseye,{style:{padding:16},children:g.jsx(C.Spinner,{size:"lg"})}):g.jsx(C.SelectOption,{isDisabled:!0,children:t("No results found")},"no result")}):g.jsx(Ene,{children:T?g.jsx(g.Fragment,{children:Object.keys(T).map(j=>g.jsx(C.SelectGroup,{label:j,children:g.jsx(Fj,{searchRef:E,options:k,selectedOptions:b})},j))}):g.jsx(Fj,{searchRef:E,options:k,selectedOptions:b})}),e.footer&&g.jsx(C.MenuFooter,{children:e.footer})]})}function Fj(e){return g.jsx(C.SelectList,{onKeyDown:t=>{var n;switch(t.key){case"Tab":t.preventDefault(),t.stopPropagation(),(n=e.searchRef.current)==null||n.focus();break}},children:e.options.map(t=>{const n=br(t);return g.jsx(C.SelectOption,{id:n,icon:t.icon,value:t.key!==void 0?t.key:t.label,description:t.description?g.jsx("div",{style:{maxWidth:300},children:t.description}):void 0,hasCheckbox:!0,isSelected:e.selectedOptions.includes(t),"data-cy":n,children:t.label},t.key!==void 0?t.key:t.label)})})}const Ene=Ae(qn)`
|
383
383
|
max-height: 40vh;
|
384
384
|
`;function kne(e){const{t}=De(),[n,r]=v.useState(!1),[i,a]=v.useState(!1),[o,s]=v.useState(),[l,c]=v.useState(0),[u,d]=v.useState(),[f,h]=v.useState(!1),m=v.useRef(),[p,y]=v.useState(""),x=v.useCallback(C.debounce(T=>y(T),200),[]),b=v.useRef(e.queryOptions).current,S=v.useRef(null),w=v.useCallback(()=>{S.current&&S.current.abort();const T=new AbortController;return S.current=T,r(()=>(a(!1),s(void 0),d(j=>{if(j)return j}),b({next:m.current,signal:T.signal,search:p}).then(j=>{T.signal.aborted||(m.current=j.next,j.remaining||a(!0),d(A=>{if(T.signal.aborted)return A;let O=[...A??[],...j.options];const P=new Set;return O=O.filter(D=>P.has(D.value)?!1:(P.add(D.value),!0)),O.sort((D,M)=>{const I=D.label.toLowerCase(),V=M.label.toLowerCase();return I<V?-1:I>V?1:0}),c(j.remaining+O.length),O}))}).catch(j=>{T.signal.aborted||s(j instanceof Error?j:new Error(t("Unknown error")))}).finally(()=>{T.signal.aborted||r(!1)}),!0)),()=>T.abort()},[b,p,t]),_=v.useCallback(T=>{T.preventDefault(),T.stopPropagation(),w()},[w]),E=v.useCallback(T=>{T.preventDefault(),T.stopPropagation(),c(0),d([]),m.current=void 0,w()},[w]);v.useEffect(()=>{f&&(c(0),d([]),m.current=void 0,w())},[f,w]);const k=g.jsxs(C.Stack,{hasGutter:!0,children:[g.jsxs(C.Flex,{children:[g.jsx(C.FlexItem,{grow:{default:"grow"},children:g.jsxs(C.ActionList,{children:[e.onBrowse&&g.jsx(C.ActionListItem,{children:g.jsx(C.Button,{id:"browse",onClick:T=>{var j;T.preventDefault(),T.stopPropagation(),h(!1),(j=e.onBrowse)==null||j.call(e)},children:t("Browse")})}),!i&&g.jsx(C.ActionListItem,{children:g.jsx(C.Button,{id:"load-more",isLoading:n,onClick:_,isDisabled:n,children:t(n?"Loading...":"Load more")})})]})}),!i&&l!==0&&g.jsx(C.FlexItem,{children:t("Loaded {{count}} of {{total}}",{count:(u==null?void 0:u.length)??0,total:l})})]}),e.footer]});return o?g.jsx(Tne,{id:e.id,variant:"secondary",isDanger:!0,icon:g.jsx(pe.SyncAltIcon,{}),iconPosition:"right",onClick:E,children:typeof e.queryErrorText=="function"?e.queryErrorText(o):e.queryErrorText??t("Error loading options")}):g.jsx(Ij,{id:e.id,icon:e.icon,placeholder:e.placeholder,options:u??[],values:e.values,onSelect:e.onSelect,variant:e.variant,footer:k,open:f,setOpen:h,searchValue:p,setSearchValue:x,isLoading:n,disableClearSelection:e.disableClearSelection,disableClearChips:e.disableClearChips,queryLabel:e.queryLabel,compareOptionValues:e.compareOptionValues,disableMaxDropdownWidth:e.disableMaxDropdownWidth})}const Tne=Ae(C.Button)`
|
385
385
|
width: 100%;
|
package/package.json
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|