hplx-feature-library 1.0.99 → 1.0.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Attachments/index.js +12192 -10805
- package/dist/PediatricsCalculator/index.js +1 -1
- package/dist/PediatricsCalculatorTable-BSfspmzA.cjs +40 -0
- package/dist/PediatricsCalculatorTable-CEIcs8fu.js +2163 -0
- package/dist/components/{customDropdown/CustomDropdown.d.ts → CustomDropdown.d.ts} +1 -1
- package/dist/components/{toggleButtons/ToggleButtons.d.ts → ToggleButtons.d.ts} +1 -1
- package/dist/hplx-feature-library.css +1 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.js +2 -12
- package/dist/useOutsideClick-DDF4hEI5.js +6684 -0
- package/dist/useOutsideClick-t7zJNned.cjs +84 -0
- package/package.json +2 -31
- package/dist/AlertPopup/index.js +0 -5
- package/dist/AlertPopup-BNDuLUqA.js +0 -1069
- package/dist/AlertPopup-CyDKrt43.cjs +0 -32
- package/dist/AllInvestigations/components/AllInvestigationsTable.d.ts +0 -11
- package/dist/AllInvestigations/index.d.ts +0 -1
- package/dist/AllInvestigations/index.js +0 -4
- package/dist/AllInvestigationsTable-C-tfS-lo.js +0 -91
- package/dist/AllInvestigationsTable-CpD4wv_W.cjs +0 -1
- package/dist/CustomDropdown/index.js +0 -256
- package/dist/DateTimePicker/DateAndTimePicker/index.js +0 -6167
- package/dist/PediatricsCalculatorTable-CGrZz303.cjs +0 -1
- package/dist/PediatricsCalculatorTable-DelYgJEq.js +0 -832
- package/dist/ToggleButtons/index.js +0 -17
- package/dist/components/alertPopup/index.d.ts +0 -1
- package/dist/components/customDropdown/index.d.ts +0 -1
- package/dist/components/dateTimePicker/DateAndTimePicker.d.ts +0 -21
- package/dist/components/dateTimePicker/index.d.ts +0 -1
- package/dist/components/toggleButtons/index.d.ts +0 -1
- package/dist/index-D-wXK-PO.cjs +0 -84
- package/dist/index-D6vi5Sgs.js +0 -6768
- package/dist/parseISO-AwyR5Nhg.cjs +0 -1
- package/dist/parseISO-Cso9HWPX.js +0 -1414
- package/dist/types/AllInvestigationTypes/index.js +0 -1
- package/dist/types/AllInvestigationTypes.d.ts +0 -30
- package/dist/useClickOutside-BjJyGTec.js +0 -14
- package/dist/useClickOutside-DsVG12Cs.cjs +0 -1
- package/dist/useOutsideClick-C4Q0aGuf.js +0 -15
- package/dist/useOutsideClick-CicUjzPP.cjs +0 -1
- /package/dist/components/{alertPopup/AlertPopup.d.ts → AlertPopup.d.ts} +0 -0
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";const R=require("./index-D-wXK-PO.cjs"),me=require("react"),Ne=require("react-dom");var G={exports:{}},k={},J={exports:{}},T={},Q={exports:{}},ne;function he(){return ne||(ne=1,function(d,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=s;/*!
|
|
2
|
-
* Adapted from jQuery UI core
|
|
3
|
-
*
|
|
4
|
-
* http://jqueryui.com
|
|
5
|
-
*
|
|
6
|
-
* Copyright 2014 jQuery Foundation and other contributors
|
|
7
|
-
* Released under the MIT license.
|
|
8
|
-
* http://jquery.org/license
|
|
9
|
-
*
|
|
10
|
-
* http://api.jqueryui.com/category/ui-core/
|
|
11
|
-
*/var h="none",l="contents",u=/^(input|select|textarea|button|object|iframe)$/;function f(n,c){return c.getPropertyValue("overflow")!=="visible"||n.scrollWidth<=0&&n.scrollHeight<=0}function g(n){var c=n.offsetWidth<=0&&n.offsetHeight<=0;if(c&&!n.innerHTML)return!0;try{var i=window.getComputedStyle(n),y=i.getPropertyValue("display");return c?y!==l&&f(n,i):y===h}catch{return console.warn("Failed to inspect element style"),!1}}function e(n){for(var c=n,i=n.getRootNode&&n.getRootNode();c&&c!==document.body;){if(i&&c===i&&(c=i.host.parentNode),g(c))return!1;c=c.parentNode}return!0}function O(n,c){var i=n.nodeName.toLowerCase(),y=u.test(i)&&!n.disabled||i==="a"&&n.href||c;return y&&e(n)}function p(n){var c=n.getAttribute("tabindex");c===null&&(c=void 0);var i=isNaN(c);return(i||c>=0)&&O(n,!i)}function s(n){var c=[].slice.call(n.querySelectorAll("*"),0).reduce(function(i,y){return i.concat(y.shadowRoot?s(y.shadowRoot):[y])},[]);return c.filter(p)}d.exports=a.default}(Q,Q.exports)),Q.exports}var oe;function Me(){if(oe)return T;oe=1,Object.defineProperty(T,"__esModule",{value:!0}),T.resetState=g,T.log=e,T.handleBlur=O,T.handleFocus=p,T.markForFocusLater=s,T.returnFocus=n,T.popWithoutFocus=c,T.setupScopedFocus=i,T.teardownScopedFocus=y;var d=he(),a=h(d);function h(_){return _&&_.__esModule?_:{default:_}}var l=[],u=null,f=!1;function g(){l=[]}function e(){process.env.NODE_ENV!=="production"&&(console.log("focusManager ----------"),l.forEach(function(_){var w=_||{};console.log(w.nodeName,w.className,w.id)}),console.log("end focusManager ----------"))}function O(){f=!0}function p(){if(f){if(f=!1,!u)return;setTimeout(function(){if(!u.contains(document.activeElement)){var _=(0,a.default)(u)[0]||u;_.focus()}},0)}}function s(){l.push(document.activeElement)}function n(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=null;try{l.length!==0&&(w=l.pop(),w.focus({preventScroll:_}));return}catch{console.warn(["You tried to return focus to",w,"but it is not in the DOM anymore"].join(" "))}}function c(){l.length>0&&l.pop()}function i(_){u=_,window.addEventListener?(window.addEventListener("blur",O,!1),document.addEventListener("focus",p,!0)):(window.attachEvent("onBlur",O),document.attachEvent("onFocus",p))}function y(){u=null,window.addEventListener?(window.removeEventListener("blur",O),document.removeEventListener("focus",p)):(window.detachEvent("onBlur",O),document.detachEvent("onFocus",p))}return T}var X={exports:{}},re;function xe(){return re||(re=1,function(d,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=g;var h=he(),l=u(h);function u(e){return e&&e.__esModule?e:{default:e}}function f(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return e.activeElement.shadowRoot?f(e.activeElement.shadowRoot):e.activeElement}function g(e,O){var p=(0,l.default)(e);if(!p.length){O.preventDefault();return}var s=void 0,n=O.shiftKey,c=p[0],i=p[p.length-1],y=f();if(e===y){if(!n)return;s=i}if(i===y&&!n&&(s=c),c===y&&n&&(s=i),s){O.preventDefault(),s.focus();return}var _=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),w=_!=null&&_[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(w){var x=p.indexOf(y);if(x>-1&&(x+=n?-1:1),s=p[x],typeof s>"u"){O.preventDefault(),s=n?i:c,s.focus();return}O.preventDefault(),s.focus()}}d.exports=a.default}(X,X.exports)),X.exports}var A={},Z,ae;function Re(){if(ae)return Z;ae=1;var d=process.env.NODE_ENV!=="production",a=function(){};if(d){var h=function(u,f){var g=arguments.length;f=new Array(g>1?g-1:0);for(var e=1;e<g;e++)f[e-1]=arguments[e];var O=0,p="Warning: "+u.replace(/%s/g,function(){return f[O++]});typeof console<"u"&&console.error(p);try{throw new Error(p)}catch{}};a=function(l,u,f){var g=arguments.length;f=new Array(g>2?g-2:0);for(var e=2;e<g;e++)f[e-2]=arguments[e];if(u===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");l||h.apply(null,[u].concat(f))}}return Z=a,Z}var D={},ee={exports:{}};/*!
|
|
12
|
-
Copyright (c) 2015 Jed Watson.
|
|
13
|
-
Based on code that is Copyright 2013-2015, Facebook, Inc.
|
|
14
|
-
All rights reserved.
|
|
15
|
-
*/var le;function Te(){return le||(le=1,function(d){(function(){var a=!!(typeof window<"u"&&window.document&&window.document.createElement),h={canUseDOM:a,canUseWorkers:typeof Worker<"u",canUseEventListeners:a&&!!(window.addEventListener||window.attachEvent),canUseViewport:a&&!!window.screen};d.exports?d.exports=h:window.ExecutionEnvironment=h})()}(ee)),ee.exports}var se;function te(){if(se)return D;se=1,Object.defineProperty(D,"__esModule",{value:!0}),D.canUseDOM=D.SafeNodeList=D.SafeHTMLCollection=void 0;var d=Te(),a=h(d);function h(f){return f&&f.__esModule?f:{default:f}}var l=a.default,u=l.canUseDOM?window.HTMLElement:{};return D.SafeHTMLCollection=l.canUseDOM?window.HTMLCollection:{},D.SafeNodeList=l.canUseDOM?window.NodeList:{},D.canUseDOM=l.canUseDOM,D.default=u,D}var ie;function ye(){if(ie)return A;ie=1,Object.defineProperty(A,"__esModule",{value:!0}),A.resetState=f,A.log=g,A.assertNodeList=e,A.setElement=O,A.validateElement=p,A.hide=s,A.show=n,A.documentNotReadyOrSSRTesting=c;var d=Re(),a=l(d),h=te();function l(i){return i&&i.__esModule?i:{default:i}}var u=null;function f(){u&&(u.removeAttribute?u.removeAttribute("aria-hidden"):u.length!=null?u.forEach(function(i){return i.removeAttribute("aria-hidden")}):document.querySelectorAll(u).forEach(function(i){return i.removeAttribute("aria-hidden")})),u=null}function g(){if(process.env.NODE_ENV!=="production"){var i=u||{};console.log("ariaAppHider ----------"),console.log(i.nodeName,i.className,i.id),console.log("end ariaAppHider ----------")}}function e(i,y){if(!i||!i.length)throw new Error("react-modal: No elements were found for selector "+y+".")}function O(i){var y=i;if(typeof y=="string"&&h.canUseDOM){var _=document.querySelectorAll(y);e(_,y),y=_}return u=y||u,u}function p(i){var y=i||u;return y?Array.isArray(y)||y instanceof HTMLCollection||y instanceof NodeList?y:[y]:((0,a.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}function s(i){var y=!0,_=!1,w=void 0;try{for(var x=p(i)[Symbol.iterator](),P;!(y=(P=x.next()).done);y=!0){var U=P.value;U.setAttribute("aria-hidden","true")}}catch(q){_=!0,w=q}finally{try{!y&&x.return&&x.return()}finally{if(_)throw w}}}function n(i){var y=!0,_=!1,w=void 0;try{for(var x=p(i)[Symbol.iterator](),P;!(y=(P=x.next()).done);y=!0){var U=P.value;U.removeAttribute("aria-hidden")}}catch(q){_=!0,w=q}finally{try{!y&&x.return&&x.return()}finally{if(_)throw w}}}function c(){u=null}return A}var j={},ue;function Ae(){if(ue)return j;ue=1,Object.defineProperty(j,"__esModule",{value:!0}),j.resetState=l,j.log=u;var d={},a={};function h(p,s){p.classList.remove(s)}function l(){var p=document.getElementsByTagName("html")[0];for(var s in d)h(p,d[s]);var n=document.body;for(var c in a)h(n,a[c]);d={},a={}}function u(){if(process.env.NODE_ENV!=="production"){var p=document.getElementsByTagName("html")[0].className,s=`Show tracked classes:
|
|
16
|
-
|
|
17
|
-
`;s+="<html /> ("+p+`):
|
|
18
|
-
`;for(var n in d)s+=" "+n+" "+d[n]+`
|
|
19
|
-
`;p=document.body.className,s+=`
|
|
20
|
-
|
|
21
|
-
doc.body (`+p+`):
|
|
22
|
-
`;for(var c in a)s+=" "+c+" "+a[c]+`
|
|
23
|
-
`;s+=`
|
|
24
|
-
`,console.log(s)}}var f=function(s,n){return s[n]||(s[n]=0),s[n]+=1,n},g=function(s,n){return s[n]&&(s[n]-=1),n},e=function(s,n,c){c.forEach(function(i){f(n,i),s.add(i)})},O=function(s,n,c){c.forEach(function(i){g(n,i),n[i]===0&&s.remove(i)})};return j.add=function(s,n){return e(s.classList,s.nodeName.toLowerCase()=="html"?d:a,n.split(" "))},j.remove=function(s,n){return O(s.classList,s.nodeName.toLowerCase()=="html"?d:a,n.split(" "))},j}var V={},ce;function be(){if(ce)return V;ce=1,Object.defineProperty(V,"__esModule",{value:!0}),V.log=l,V.resetState=u;function d(f,g){if(!(f instanceof g))throw new TypeError("Cannot call a class as a function")}var a=function f(){var g=this;d(this,f),this.register=function(e){if(g.openInstances.indexOf(e)!==-1){process.env.NODE_ENV!=="production"&&console.warn("React-Modal: Cannot register modal instance that's already open");return}g.openInstances.push(e),g.emit("register")},this.deregister=function(e){var O=g.openInstances.indexOf(e);if(O===-1){process.env.NODE_ENV!=="production"&&console.warn("React-Modal: Unable to deregister "+e+" as it was never registered");return}g.openInstances.splice(O,1),g.emit("deregister")},this.subscribe=function(e){g.subscribers.push(e)},this.emit=function(e){g.subscribers.forEach(function(O){return O(e,g.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},h=new a;function l(){console.log("portalOpenInstances ----------"),console.log(h.openInstances.length),h.openInstances.forEach(function(f){return console.log(f)}),console.log("end portalOpenInstances ----------")}function u(){h=new a}return V.default=h,V}var z={},fe;function Pe(){if(fe)return z;fe=1,Object.defineProperty(z,"__esModule",{value:!0}),z.resetState=g,z.log=e;var d=be(),a=h(d);function h(s){return s&&s.__esModule?s:{default:s}}var l=void 0,u=void 0,f=[];function g(){for(var s=[l,u],n=0;n<s.length;n++){var c=s[n];c&&c.parentNode&&c.parentNode.removeChild(c)}l=u=null,f=[]}function e(){console.log("bodyTrap ----------"),console.log(f.length);for(var s=[l,u],n=0;n<s.length;n++){var c=s[n],i=c||{};console.log(i.nodeName,i.className,i.id)}console.log("edn bodyTrap ----------")}function O(){if(f.length===0){process.env.NODE_ENV!=="production"&&console.warn("React-Modal: Open instances > 0 expected");return}f[f.length-1].focusContent()}function p(s,n){!l&&!u&&(l=document.createElement("div"),l.setAttribute("data-react-modal-body-trap",""),l.style.position="absolute",l.style.opacity="0",l.setAttribute("tabindex","0"),l.addEventListener("focus",O),u=l.cloneNode(),u.addEventListener("focus",O)),f=n,f.length>0?(document.body.firstChild!==l&&document.body.insertBefore(l,document.body.firstChild),document.body.lastChild!==u&&document.body.appendChild(u)):(l.parentElement&&l.parentElement.removeChild(l),u.parentElement&&u.parentElement.removeChild(u))}return a.default.subscribe(p),z}var de;function De(){return de||(de=1,function(d,a){Object.defineProperty(a,"__esModule",{value:!0});var h=Object.assign||function(r){for(var o=1;o<arguments.length;o++){var E=arguments[o];for(var t in E)Object.prototype.hasOwnProperty.call(E,t)&&(r[t]=E[t])}return r},l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},u=function(){function r(o,E){for(var t=0;t<E.length;t++){var v=E[t];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(o,v.key,v)}}return function(o,E,t){return E&&r(o.prototype,E),t&&r(o,t),o}}(),f=me,g=R.requirePropTypes(),e=B(g),O=Me(),p=q(O),s=xe(),n=B(s),c=ye(),i=q(c),y=Ae(),_=q(y),w=te(),x=B(w),P=be(),U=B(P);Pe();function q(r){if(r&&r.__esModule)return r;var o={};if(r!=null)for(var E in r)Object.prototype.hasOwnProperty.call(r,E)&&(o[E]=r[E]);return o.default=r,o}function B(r){return r&&r.__esModule?r:{default:r}}function F(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function K(r,o){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o&&(typeof o=="object"||typeof o=="function")?o:r}function $(r,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof o);r.prototype=Object.create(o&&o.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(r,o):r.__proto__=o)}var W={overlay:"ReactModal__Overlay",content:"ReactModal__Content"},H=function(o){return o.code==="Tab"||o.keyCode===9},b=function(o){return o.code==="Escape"||o.keyCode===27},m=0,C=function(r){$(o,r);function o(E){F(this,o);var t=K(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,E));return t.setOverlayRef=function(v){t.overlay=v,t.props.overlayRef&&t.props.overlayRef(v)},t.setContentRef=function(v){t.content=v,t.props.contentRef&&t.props.contentRef(v)},t.afterClose=function(){var v=t.props,N=v.appElement,S=v.ariaHideApp,M=v.htmlOpenClassName,L=v.bodyOpenClassName,I=v.parentSelector,Y=I&&I().ownerDocument||document;L&&_.remove(Y.body,L),M&&_.remove(Y.getElementsByTagName("html")[0],M),S&&m>0&&(m-=1,m===0&&i.show(N)),t.props.shouldFocusAfterRender&&(t.props.shouldReturnFocusAfterClose?(p.returnFocus(t.props.preventScroll),p.teardownScopedFocus()):p.popWithoutFocus()),t.props.onAfterClose&&t.props.onAfterClose(),U.default.deregister(t)},t.open=function(){t.beforeOpen(),t.state.afterOpen&&t.state.beforeClose?(clearTimeout(t.closeTimer),t.setState({beforeClose:!1})):(t.props.shouldFocusAfterRender&&(p.setupScopedFocus(t.node),p.markForFocusLater()),t.setState({isOpen:!0},function(){t.openAnimationFrame=requestAnimationFrame(function(){t.setState({afterOpen:!0}),t.props.isOpen&&t.props.onAfterOpen&&t.props.onAfterOpen({overlayEl:t.overlay,contentEl:t.content})})}))},t.close=function(){t.props.closeTimeoutMS>0?t.closeWithTimeout():t.closeWithoutTimeout()},t.focusContent=function(){return t.content&&!t.contentHasFocus()&&t.content.focus({preventScroll:!0})},t.closeWithTimeout=function(){var v=Date.now()+t.props.closeTimeoutMS;t.setState({beforeClose:!0,closesAt:v},function(){t.closeTimer=setTimeout(t.closeWithoutTimeout,t.state.closesAt-Date.now())})},t.closeWithoutTimeout=function(){t.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},t.afterClose)},t.handleKeyDown=function(v){H(v)&&(0,n.default)(t.content,v),t.props.shouldCloseOnEsc&&b(v)&&(v.stopPropagation(),t.requestClose(v))},t.handleOverlayOnClick=function(v){t.shouldClose===null&&(t.shouldClose=!0),t.shouldClose&&t.props.shouldCloseOnOverlayClick&&(t.ownerHandlesClose()?t.requestClose(v):t.focusContent()),t.shouldClose=null},t.handleContentOnMouseUp=function(){t.shouldClose=!1},t.handleOverlayOnMouseDown=function(v){!t.props.shouldCloseOnOverlayClick&&v.target==t.overlay&&v.preventDefault()},t.handleContentOnClick=function(){t.shouldClose=!1},t.handleContentOnMouseDown=function(){t.shouldClose=!1},t.requestClose=function(v){return t.ownerHandlesClose()&&t.props.onRequestClose(v)},t.ownerHandlesClose=function(){return t.props.onRequestClose},t.shouldBeClosed=function(){return!t.state.isOpen&&!t.state.beforeClose},t.contentHasFocus=function(){return document.activeElement===t.content||t.content.contains(document.activeElement)},t.buildClassName=function(v,N){var S=(typeof N>"u"?"undefined":l(N))==="object"?N:{base:W[v],afterOpen:W[v]+"--after-open",beforeClose:W[v]+"--before-close"},M=S.base;return t.state.afterOpen&&(M=M+" "+S.afterOpen),t.state.beforeClose&&(M=M+" "+S.beforeClose),typeof N=="string"&&N?M+" "+N:M},t.attributesFromObject=function(v,N){return Object.keys(N).reduce(function(S,M){return S[v+"-"+M]=N[M],S},{})},t.state={afterOpen:!1,beforeClose:!1},t.shouldClose=null,t.moveFromContentToOverlay=null,t}return u(o,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(t,v){process.env.NODE_ENV!=="production"&&(t.bodyOpenClassName!==this.props.bodyOpenClassName&&console.warn('React-Modal: "bodyOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.'),t.htmlOpenClassName!==this.props.htmlOpenClassName&&console.warn('React-Modal: "htmlOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.')),this.props.isOpen&&!t.isOpen?this.open():!this.props.isOpen&&t.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!v.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var t=this.props,v=t.appElement,N=t.ariaHideApp,S=t.htmlOpenClassName,M=t.bodyOpenClassName,L=t.parentSelector,I=L&&L().ownerDocument||document;M&&_.add(I.body,M),S&&_.add(I.getElementsByTagName("html")[0],S),N&&(m+=1,i.hide(v)),U.default.register(this)}},{key:"render",value:function(){var t=this.props,v=t.id,N=t.className,S=t.overlayClassName,M=t.defaultStyles,L=t.children,I=N?{}:M.content,Y=S?{}:M.overlay;if(this.shouldBeClosed())return null;var Ce={ref:this.setOverlayRef,className:this.buildClassName("overlay",S),style:h({},Y,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},we=h({id:v,ref:this.setContentRef,style:h({},I,this.props.style.content),className:this.buildClassName("content",N),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",h({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),Se=this.props.contentElement(we,L);return this.props.overlayElement(Ce,Se)}}]),o}(f.Component);C.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},C.propTypes={isOpen:e.default.bool.isRequired,defaultStyles:e.default.shape({content:e.default.object,overlay:e.default.object}),style:e.default.shape({content:e.default.object,overlay:e.default.object}),className:e.default.oneOfType([e.default.string,e.default.object]),overlayClassName:e.default.oneOfType([e.default.string,e.default.object]),parentSelector:e.default.func,bodyOpenClassName:e.default.string,htmlOpenClassName:e.default.string,ariaHideApp:e.default.bool,appElement:e.default.oneOfType([e.default.instanceOf(x.default),e.default.instanceOf(w.SafeHTMLCollection),e.default.instanceOf(w.SafeNodeList),e.default.arrayOf(e.default.instanceOf(x.default))]),onAfterOpen:e.default.func,onAfterClose:e.default.func,onRequestClose:e.default.func,closeTimeoutMS:e.default.number,shouldFocusAfterRender:e.default.bool,shouldCloseOnOverlayClick:e.default.bool,shouldReturnFocusAfterClose:e.default.bool,preventScroll:e.default.bool,role:e.default.string,contentLabel:e.default.string,aria:e.default.object,data:e.default.object,children:e.default.node,shouldCloseOnEsc:e.default.bool,overlayRef:e.default.func,contentRef:e.default.func,id:e.default.string,overlayElement:e.default.func,contentElement:e.default.func,testId:e.default.string},a.default=C,d.exports=a.default}(J,J.exports)),J.exports}function ge(){var d=this.constructor.getDerivedStateFromProps(this.props,this.state);d!=null&&this.setState(d)}function Oe(d){function a(h){var l=this.constructor.getDerivedStateFromProps(d,h);return l??null}this.setState(a.bind(this))}function _e(d,a){try{var h=this.props,l=this.state;this.props=d,this.state=a,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(h,l)}finally{this.props=h,this.state=l}}ge.__suppressDeprecationWarning=!0;Oe.__suppressDeprecationWarning=!0;_e.__suppressDeprecationWarning=!0;function qe(d){var a=d.prototype;if(!a||!a.isReactComponent)throw new Error("Can only polyfill class components");if(typeof d.getDerivedStateFromProps!="function"&&typeof a.getSnapshotBeforeUpdate!="function")return d;var h=null,l=null,u=null;if(typeof a.componentWillMount=="function"?h="componentWillMount":typeof a.UNSAFE_componentWillMount=="function"&&(h="UNSAFE_componentWillMount"),typeof a.componentWillReceiveProps=="function"?l="componentWillReceiveProps":typeof a.UNSAFE_componentWillReceiveProps=="function"&&(l="UNSAFE_componentWillReceiveProps"),typeof a.componentWillUpdate=="function"?u="componentWillUpdate":typeof a.UNSAFE_componentWillUpdate=="function"&&(u="UNSAFE_componentWillUpdate"),h!==null||l!==null||u!==null){var f=d.displayName||d.name,g=typeof d.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
25
|
-
|
|
26
|
-
`+f+" uses "+g+" but also contains the following legacy lifecycles:"+(h!==null?`
|
|
27
|
-
`+h:"")+(l!==null?`
|
|
28
|
-
`+l:"")+(u!==null?`
|
|
29
|
-
`+u:"")+`
|
|
30
|
-
|
|
31
|
-
The above lifecycles should be removed. Learn more about this warning here:
|
|
32
|
-
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof d.getDerivedStateFromProps=="function"&&(a.componentWillMount=ge,a.componentWillReceiveProps=Oe),typeof a.getSnapshotBeforeUpdate=="function"){if(typeof a.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");a.componentWillUpdate=_e;var e=a.componentDidUpdate;a.componentDidUpdate=function(p,s,n){var c=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;e.call(this,p,s,c)}}return d}const Fe=Object.freeze(Object.defineProperty({__proto__:null,polyfill:qe},Symbol.toStringTag,{value:"Module"})),Le=R.getAugmentedNamespace(Fe);var pe;function Ue(){if(pe)return k;pe=1,Object.defineProperty(k,"__esModule",{value:!0}),k.bodyOpenClassName=k.portalClassName=void 0;var d=Object.assign||function(b){for(var m=1;m<arguments.length;m++){var C=arguments[m];for(var r in C)Object.prototype.hasOwnProperty.call(C,r)&&(b[r]=C[r])}return b},a=function(){function b(m,C){for(var r=0;r<C.length;r++){var o=C[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}return function(m,C,r){return C&&b(m.prototype,C),r&&b(m,r),m}}(),h=me,l=w(h),u=Ne,f=w(u),g=R.requirePropTypes(),e=w(g),O=De(),p=w(O),s=ye(),n=_(s),c=te(),i=w(c),y=Le;function _(b){if(b&&b.__esModule)return b;var m={};if(b!=null)for(var C in b)Object.prototype.hasOwnProperty.call(b,C)&&(m[C]=b[C]);return m.default=b,m}function w(b){return b&&b.__esModule?b:{default:b}}function x(b,m){if(!(b instanceof m))throw new TypeError("Cannot call a class as a function")}function P(b,m){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:b}function U(b,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);b.prototype=Object.create(m&&m.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(b,m):b.__proto__=m)}var q=k.portalClassName="ReactModalPortal",B=k.bodyOpenClassName="ReactModal__Body--open",F=c.canUseDOM&&f.default.createPortal!==void 0,K=function(m){return document.createElement(m)},$=function(){return F?f.default.createPortal:f.default.unstable_renderSubtreeIntoContainer};function W(b){return b()}var H=function(b){U(m,b);function m(){var C,r,o,E;x(this,m);for(var t=arguments.length,v=Array(t),N=0;N<t;N++)v[N]=arguments[N];return E=(r=(o=P(this,(C=m.__proto__||Object.getPrototypeOf(m)).call.apply(C,[this].concat(v))),o),o.removePortal=function(){!F&&f.default.unmountComponentAtNode(o.node);var S=W(o.props.parentSelector);S&&S.contains(o.node)?S.removeChild(o.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},o.portalRef=function(S){o.portal=S},o.renderPortal=function(S){var M=$(),L=M(o,l.default.createElement(p.default,d({defaultStyles:m.defaultStyles},S)),o.node);o.portalRef(L)},r),P(o,E)}return a(m,[{key:"componentDidMount",value:function(){if(c.canUseDOM){F||(this.node=K("div")),this.node.className=this.props.portalClassName;var r=W(this.props.parentSelector);r.appendChild(this.node),!F&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(r){var o=W(r.parentSelector),E=W(this.props.parentSelector);return{prevParent:o,nextParent:E}}},{key:"componentDidUpdate",value:function(r,o,E){if(c.canUseDOM){var t=this.props,v=t.isOpen,N=t.portalClassName;r.portalClassName!==N&&(this.node.className=N);var S=E.prevParent,M=E.nextParent;M!==S&&(S.removeChild(this.node),M.appendChild(this.node)),!(!r.isOpen&&!v)&&!F&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!c.canUseDOM||!this.node||!this.portal)){var r=this.portal.state,o=Date.now(),E=r.isOpen&&this.props.closeTimeoutMS&&(r.closesAt||o+this.props.closeTimeoutMS);E?(r.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,E-o)):this.removePortal()}}},{key:"render",value:function(){if(!c.canUseDOM||!F)return null;!this.node&&F&&(this.node=K("div"));var r=$();return r(l.default.createElement(p.default,d({ref:this.portalRef,defaultStyles:m.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(r){n.setElement(r)}}]),m}(h.Component);return H.propTypes={isOpen:e.default.bool.isRequired,style:e.default.shape({content:e.default.object,overlay:e.default.object}),portalClassName:e.default.string,bodyOpenClassName:e.default.string,htmlOpenClassName:e.default.string,className:e.default.oneOfType([e.default.string,e.default.shape({base:e.default.string.isRequired,afterOpen:e.default.string.isRequired,beforeClose:e.default.string.isRequired})]),overlayClassName:e.default.oneOfType([e.default.string,e.default.shape({base:e.default.string.isRequired,afterOpen:e.default.string.isRequired,beforeClose:e.default.string.isRequired})]),appElement:e.default.oneOfType([e.default.instanceOf(i.default),e.default.instanceOf(c.SafeHTMLCollection),e.default.instanceOf(c.SafeNodeList),e.default.arrayOf(e.default.instanceOf(i.default))]),onAfterOpen:e.default.func,onRequestClose:e.default.func,closeTimeoutMS:e.default.number,ariaHideApp:e.default.bool,shouldFocusAfterRender:e.default.bool,shouldCloseOnOverlayClick:e.default.bool,shouldReturnFocusAfterClose:e.default.bool,preventScroll:e.default.bool,parentSelector:e.default.func,aria:e.default.object,data:e.default.object,role:e.default.string,contentLabel:e.default.string,shouldCloseOnEsc:e.default.bool,overlayRef:e.default.func,contentRef:e.default.func,id:e.default.string,overlayElement:e.default.func,contentElement:e.default.func},H.defaultProps={isOpen:!1,portalClassName:q,bodyOpenClassName:B,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(m,C){return l.default.createElement("div",m,C)},contentElement:function(m,C){return l.default.createElement("div",m,C)}},H.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,y.polyfill)(H),process.env.NODE_ENV!=="production"&&(H.setCreateHTMLElement=function(b){return K=b}),k.default=H,k}var ve;function We(){return ve||(ve=1,function(d,a){Object.defineProperty(a,"__esModule",{value:!0});var h=Ue(),l=u(h);function u(f){return f&&f.__esModule?f:{default:f}}a.default=l.default,d.exports=a.default}(G,G.exports)),G.exports}var He=We();const Ee=R.getDefaultExportFromCjs(He),ke=d=>{const{openState:a,closePopupCallback:h,headingIconFile:l,headingText:u,subHeadingText:f,positiveButtonText:g,negativeButtonText:e,classNamePositiveBtn:O,classNameNegativeBtn:p,positiveActionCallback:s,negativeActionCallback:n}=d;return R.jsxRuntimeExports.jsxs(Ee,{isOpen:a,onRequestClose:h,shouldCloseOnOverlayClick:!1,style:{overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",position:"fixed",alignContent:"center",justifyContent:"center",zIndex:1030,display:a?"block":"none"},content:{zIndex:1030,padding:"24px",maxWidth:"750px",maxHeight:"600px",width:"400px",height:"fit-content",margin:"auto",borderRadius:"12px",overflow:"unset",display:a?"block":"none"}},children:[l=="warning"&&R.jsxRuntimeExports.jsx("div",{className:"hfl-hx_warning hfl-mb-4 hfl-flex hfl-h-12 hfl-w-12 hfl-items-center hfl-justify-center hfl-rounded-full hfl-border-8 hfl-border-Warning-50 hfl-bg-Warning-100 hfl-text-Warning-600",children:R.jsxRuntimeExports.jsx("i",{className:"hx_warning hfl-text-5"})}),R.jsxRuntimeExports.jsx(R.Pc,{variant:"Medium",type:"Text xl",className:"hfl-mt-5 hfl-text-Gray-900",children:u}),f&&R.jsxRuntimeExports.jsx(R.Pc,{variant:"Regular",type:"Text sm",className:"hfl-mt-1 hfl-text-Gray-500 ",children:f}),R.jsxRuntimeExports.jsxs("div",{className:"hfl-mt-4 hfl-flex hfl-items-center hfl-justify-center hfl-gap-4",children:[e&&R.jsxRuntimeExports.jsx(R.Yu,{size:"md",textField:e,hierarchy:"Primary",className:p||"",onClick:n,"data-qa":"negative-action"}),g&&R.jsxRuntimeExports.jsx(R.Yu,{size:"md",textField:g,hierarchy:"Secondary",className:O||"",onClick:s,"data-qa":"positive-action"})]})]})};exports.AlertPopup=ke;exports.Modal=Ee;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { I_InvestigationTestWithPrint, I_TestRanges } from '../../types/AllInvestigationTypes';
|
|
2
|
-
interface InvestigationsTableProps {
|
|
3
|
-
data: I_InvestigationTestWithPrint[];
|
|
4
|
-
testDetails: I_TestRanges[];
|
|
5
|
-
enableColumnCheckbox: boolean;
|
|
6
|
-
tableHeaderRowClasses?: string;
|
|
7
|
-
investigationCheckBoxMap: Map<string, boolean>;
|
|
8
|
-
onColumnCheckboxClickHandler: (key: string, isClicked: boolean) => void;
|
|
9
|
-
}
|
|
10
|
-
declare const AllInvestigationsTable: ({ data, testDetails, enableColumnCheckbox, tableHeaderRowClasses, investigationCheckBoxMap, onColumnCheckboxClickHandler, }: InvestigationsTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default AllInvestigationsTable;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './components/AllInvestigationsTable';
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { j as i, u as N } from "./index-D6vi5Sgs.js";
|
|
2
|
-
import { useState as f, useRef as R, useEffect as h } from "react";
|
|
3
|
-
const I = ({
|
|
4
|
-
data: a = [],
|
|
5
|
-
testDetails: m = [],
|
|
6
|
-
enableColumnCheckbox: l = !1,
|
|
7
|
-
tableHeaderRowClasses: p,
|
|
8
|
-
investigationCheckBoxMap: o,
|
|
9
|
-
onColumnCheckboxClickHandler: d
|
|
10
|
-
}) => {
|
|
11
|
-
const [x, g] = f([]), [c, w] = f([]), [v, C] = f([]), b = R(null);
|
|
12
|
-
return h(() => {
|
|
13
|
-
if (!a.length) return;
|
|
14
|
-
const t = [...new Set(a.map((e) => e.test_date))];
|
|
15
|
-
w(t);
|
|
16
|
-
const s = /* @__PURE__ */ new Map();
|
|
17
|
-
a.forEach((e) => {
|
|
18
|
-
const n = m.find((_) => _?.test_id?.toString() === e?.test_id?.toString());
|
|
19
|
-
s.has(e.test_id) || s.set(e.test_id, {
|
|
20
|
-
created_on: e.created_on,
|
|
21
|
-
out_of_range: e.out_of_range,
|
|
22
|
-
test_date: e.test_date,
|
|
23
|
-
test_id: e.test_id,
|
|
24
|
-
test_name: n?.test_names || e.test_name,
|
|
25
|
-
test_value: e.test_value,
|
|
26
|
-
test_unit: n?.test_units || e.test_unit
|
|
27
|
-
});
|
|
28
|
-
const u = s.get(e.test_id);
|
|
29
|
-
u[e.test_date] = e.test_value;
|
|
30
|
-
});
|
|
31
|
-
const r = Array.from(s.values());
|
|
32
|
-
g(r);
|
|
33
|
-
}, [a, m]), h(() => {
|
|
34
|
-
const t = "hfl-text-1", s = [
|
|
35
|
-
{
|
|
36
|
-
field: "#",
|
|
37
|
-
fieldHeaderName: "No.",
|
|
38
|
-
renderCell: (e, n, u, _) => /* @__PURE__ */ i.jsx(i.Fragment, { children: _ + 1 }),
|
|
39
|
-
pinned: "left",
|
|
40
|
-
width: "60px",
|
|
41
|
-
minWidth: "60px",
|
|
42
|
-
cellClasses: `${t}`
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
field: "test_name",
|
|
46
|
-
fieldHeaderName: "Tests / Investigations",
|
|
47
|
-
pinned: "left",
|
|
48
|
-
width: "250px",
|
|
49
|
-
minWidth: "250px",
|
|
50
|
-
cellClasses: `${t}`,
|
|
51
|
-
enabledColumnCheckbox: l,
|
|
52
|
-
isCheckboxMarked: o.get("test_name"),
|
|
53
|
-
onColumnCheckboxClick: (e) => {
|
|
54
|
-
d("test_name", e);
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
field: "test_unit",
|
|
59
|
-
fieldHeaderName: "Units",
|
|
60
|
-
pinned: "left",
|
|
61
|
-
width: "80px",
|
|
62
|
-
minWidth: "80px",
|
|
63
|
-
cellClasses: `${t}`
|
|
64
|
-
}
|
|
65
|
-
], r = c.map((e) => ({
|
|
66
|
-
field: e,
|
|
67
|
-
fieldHeaderName: e,
|
|
68
|
-
width: "150px",
|
|
69
|
-
minWidth: "150px",
|
|
70
|
-
cellClasses: `${t}`,
|
|
71
|
-
enabledColumnCheckbox: l,
|
|
72
|
-
isCheckboxMarked: o.get(e),
|
|
73
|
-
onColumnCheckboxClick: (n) => {
|
|
74
|
-
d(e, n);
|
|
75
|
-
}
|
|
76
|
-
}));
|
|
77
|
-
C([...s, ...r]);
|
|
78
|
-
}, [c, l, o, d]), /* @__PURE__ */ i.jsx("div", { className: "", children: /* @__PURE__ */ i.jsx(
|
|
79
|
-
N,
|
|
80
|
-
{
|
|
81
|
-
headerRowClasses: `hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border ${p}`,
|
|
82
|
-
tableRef: b,
|
|
83
|
-
columns: v,
|
|
84
|
-
tableName: "Investigations",
|
|
85
|
-
rows: x
|
|
86
|
-
}
|
|
87
|
-
) });
|
|
88
|
-
};
|
|
89
|
-
export {
|
|
90
|
-
I as A
|
|
91
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("./index-D-wXK-PO.cjs"),n=require("react"),R=({data:l=[],testDetails:c=[],enableColumnCheckbox:o=!1,tableHeaderRowClasses:x,investigationCheckBoxMap:d,onColumnCheckboxClickHandler:r})=>{const[h,g]=n.useState([]),[f,p]=n.useState([]),[v,w]=n.useState([]),C=n.useRef(null);return n.useEffect(()=>{if(!l.length)return;const t=[...new Set(l.map(e=>e.test_date))];p(t);const s=new Map;l.forEach(e=>{const i=c.find(_=>_?.test_id?.toString()===e?.test_id?.toString());s.has(e.test_id)||s.set(e.test_id,{created_on:e.created_on,out_of_range:e.out_of_range,test_date:e.test_date,test_id:e.test_id,test_name:i?.test_names||e.test_name,test_value:e.test_value,test_unit:i?.test_units||e.test_unit});const m=s.get(e.test_id);m[e.test_date]=e.test_value});const u=Array.from(s.values());g(u)},[l,c]),n.useEffect(()=>{const t="hfl-text-1",s=[{field:"#",fieldHeaderName:"No.",renderCell:(e,i,m,_)=>a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:_+1}),pinned:"left",width:"60px",minWidth:"60px",cellClasses:`${t}`},{field:"test_name",fieldHeaderName:"Tests / Investigations",pinned:"left",width:"250px",minWidth:"250px",cellClasses:`${t}`,enabledColumnCheckbox:o,isCheckboxMarked:d.get("test_name"),onColumnCheckboxClick:e=>{r("test_name",e)}},{field:"test_unit",fieldHeaderName:"Units",pinned:"left",width:"80px",minWidth:"80px",cellClasses:`${t}`}],u=f.map(e=>({field:e,fieldHeaderName:e,width:"150px",minWidth:"150px",cellClasses:`${t}`,enabledColumnCheckbox:o,isCheckboxMarked:d.get(e),onColumnCheckboxClick:i=>{r(e,i)}}));w([...s,...u])},[f,o,d,r]),a.jsxRuntimeExports.jsx("div",{className:"",children:a.jsxRuntimeExports.jsx(a.uO,{headerRowClasses:`hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border ${x}`,tableRef:C,columns:v,tableName:"Investigations",rows:h})})};exports.AllInvestigationsTable=R;
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { j as l, P as ye, a as Ce, M as $e } from "../index-D6vi5Sgs.js";
|
|
2
|
-
import { useState as I, useRef as v, useMemo as je, useCallback as O, useEffect as J } from "react";
|
|
3
|
-
import { u as Ne } from "../useClickOutside-BjJyGTec.js";
|
|
4
|
-
import { u as ke } from "../useOutsideClick-C4Q0aGuf.js";
|
|
5
|
-
import Le from "../ToggleButtons/index.js";
|
|
6
|
-
const Se = "data:image/svg+xml,%3csvg%20width='10'%20height='6'%20viewBox='0%200%2010%206'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0.480062%200.819173C0.650418%200.648817%200.92662%200.648817%201.09698%200.819173L4.71454%204.43674L8.3321%200.819173C8.50246%200.648817%208.77866%200.648817%208.94902%200.819173C9.11937%200.98953%209.11937%201.26573%208.94902%201.43609L5.023%205.36211C4.85264%205.53246%204.57644%205.53246%204.40608%205.36211L0.480062%201.43609C0.309706%201.26573%200.309706%200.98953%200.480062%200.819173Z'%20fill='%23667085'/%3e%3c/svg%3e";
|
|
7
|
-
function Pe(D) {
|
|
8
|
-
const {
|
|
9
|
-
label: E,
|
|
10
|
-
labelClassName: B,
|
|
11
|
-
hideDropdownIcon: Q,
|
|
12
|
-
showClearOption: P,
|
|
13
|
-
isRequiredField: U,
|
|
14
|
-
btnClassName: X,
|
|
15
|
-
placeholder: F,
|
|
16
|
-
options: i,
|
|
17
|
-
selectedOption: p,
|
|
18
|
-
onChangeHandler: H,
|
|
19
|
-
inputValue: n,
|
|
20
|
-
inputChangeHandler: a,
|
|
21
|
-
onInputFocusOutEvent: M,
|
|
22
|
-
inputClassName: ee,
|
|
23
|
-
isSearchable: le,
|
|
24
|
-
inputType: te,
|
|
25
|
-
showInput: y,
|
|
26
|
-
inputSuffix: T,
|
|
27
|
-
selectedLabel: _,
|
|
28
|
-
suffixPadding: oe,
|
|
29
|
-
disableInputAutoSize: se,
|
|
30
|
-
selectedOptions: C,
|
|
31
|
-
isMulti: h,
|
|
32
|
-
dropDownItemClickHandler: G,
|
|
33
|
-
showToggle: ne,
|
|
34
|
-
toggleChangeHandler: re,
|
|
35
|
-
selectedToggleOption: ie,
|
|
36
|
-
toggleOptionsList: ae,
|
|
37
|
-
border: m,
|
|
38
|
-
height: x,
|
|
39
|
-
disabled: f,
|
|
40
|
-
fieldColor: g,
|
|
41
|
-
errorMsg: $,
|
|
42
|
-
showErrorMsg: he,
|
|
43
|
-
placeholderStyle: o,
|
|
44
|
-
onInputKeyDown: R,
|
|
45
|
-
showEmptyDropdownPopup: fe = !0,
|
|
46
|
-
isDropdownFixed: w = !1,
|
|
47
|
-
dropdownClassName: ce = "",
|
|
48
|
-
wrapperClass: z = "",
|
|
49
|
-
maxInputLength: W,
|
|
50
|
-
alternateListBgStyle: de,
|
|
51
|
-
showLabelTooltip: ue = !1,
|
|
52
|
-
labelToolTipContent: pe = "",
|
|
53
|
-
inputContainerClasses: V = "",
|
|
54
|
-
onInputFocus: j
|
|
55
|
-
} = D, [r, c] = I(!1), [d, me] = I(null), b = v(null), N = v(null), K = v(null), k = v([]), xe = je(() => i?.filter((e) => e ? e.label.toLowerCase().includes((n ?? "").toLowerCase()) : void 0), [n, i]), [ge, L] = I(!1), we = () => {
|
|
56
|
-
c(!1), h && a && a(""), me(null);
|
|
57
|
-
}, Y = O(
|
|
58
|
-
(e) => {
|
|
59
|
-
e.stopPropagation(), f || c((t) => !t);
|
|
60
|
-
},
|
|
61
|
-
[f]
|
|
62
|
-
), q = (n?.length || 0) + 2 + Number(oe || 0);
|
|
63
|
-
ke(b, we), J(() => {
|
|
64
|
-
d !== null && k.current[d] && k.current[d].scrollIntoView({ block: "nearest" });
|
|
65
|
-
}, [d]);
|
|
66
|
-
const u = O(() => {
|
|
67
|
-
if (w && r) {
|
|
68
|
-
const e = y ? N.current : K.current, t = b.current;
|
|
69
|
-
if (e && t) {
|
|
70
|
-
const s = e.getBoundingClientRect();
|
|
71
|
-
t.style.position = "fixed", t.style.top = `${window.scrollY ? s.bottom + window.scrollY : s.bottom}px`, t.style.left = `${s.left}px`, t.style.width = `${s.width}px`;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}, [w, r, y]);
|
|
75
|
-
J(() => {
|
|
76
|
-
if (w)
|
|
77
|
-
return r ? (u(), window.addEventListener("scroll", u, !0)) : window.removeEventListener("scroll", u, !0), () => {
|
|
78
|
-
window.removeEventListener("scroll", u, !0);
|
|
79
|
-
};
|
|
80
|
-
}, [w, u, r]), Ne(b, () => {
|
|
81
|
-
ge && M && M();
|
|
82
|
-
});
|
|
83
|
-
const A = (e) => {
|
|
84
|
-
if (h && G) {
|
|
85
|
-
const t = C?.some((s) => s.value === e.value);
|
|
86
|
-
G(!!t, e);
|
|
87
|
-
}
|
|
88
|
-
}, be = O(
|
|
89
|
-
async (e) => {
|
|
90
|
-
e.stopPropagation(), r || c(!0), j && await j();
|
|
91
|
-
},
|
|
92
|
-
[j, r]
|
|
93
|
-
);
|
|
94
|
-
return /* @__PURE__ */ l.jsxs("div", { className: `hfl-relative hfl-inline-block hfl-text-left ${z || ""}`, children: [
|
|
95
|
-
!!E && /* @__PURE__ */ l.jsxs("div", { className: "hfl-text-Gray-700 hfl-mb-1 hfl-flex", children: [
|
|
96
|
-
/* @__PURE__ */ l.jsx(ye, { type: "Text sm", variant: "Medium", className: B || "", children: `${E}` }),
|
|
97
|
-
U && /* @__PURE__ */ l.jsx("span", { className: "hfl-ml-1 hfl-text-Error-600", children: "*" }),
|
|
98
|
-
ue && /* @__PURE__ */ l.jsx(Ce, { variant: "Right", text: pe, theme: "dark", children: /* @__PURE__ */ l.jsx("i", { className: "hx_info-filled" }) })
|
|
99
|
-
] }),
|
|
100
|
-
y ? /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
101
|
-
/* @__PURE__ */ l.jsxs(
|
|
102
|
-
"div",
|
|
103
|
-
{
|
|
104
|
-
className: `hfl-flex hfl-items-center hfl-shadow-xs hfl-px-2 ${V || ""} ${m || "hfl-border-1"} hfl-rounded-lg hfl-overflow-x-auto ${$ ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${x || "hfl-h-10"} ${f ? "!hfl-bg-Gray-50 !hfl-pointer-events-none" : g || "hfl-bg-White"} hover:hfl-border-Primary-300 hover:hfl-shadow-xs-primary`,
|
|
105
|
-
onClick: f ? () => {
|
|
106
|
-
} : Y,
|
|
107
|
-
children: [
|
|
108
|
-
C?.map((e, t) => /* @__PURE__ */ l.jsxs(
|
|
109
|
-
"div",
|
|
110
|
-
{
|
|
111
|
-
className: "hfl-flex hfl-items-center hfl-bg-Blue-100 hfl-mr-2 hfl-py-1 hfl-px-2 hfl-rounded-sm hfl-font-inter-0 hfl-text-nowrap",
|
|
112
|
-
children: [
|
|
113
|
-
/* @__PURE__ */ l.jsx("span", { className: "hfl-pointer-events-none", children: e.label }),
|
|
114
|
-
/* @__PURE__ */ l.jsx(
|
|
115
|
-
"span",
|
|
116
|
-
{
|
|
117
|
-
onClick: (s) => {
|
|
118
|
-
s.stopPropagation(), A(e);
|
|
119
|
-
},
|
|
120
|
-
className: "hx_close hfl-text-Gray-500 hfl-my-0 hfl-text-[14px] hfl-ml-[1px] hfl-cursor-pointer"
|
|
121
|
-
}
|
|
122
|
-
)
|
|
123
|
-
]
|
|
124
|
-
},
|
|
125
|
-
`${e.label}-${t}`
|
|
126
|
-
)),
|
|
127
|
-
Object.keys(o || {}).length > 0 && /* @__PURE__ */ l.jsx("style", { children: `
|
|
128
|
-
input.input-placeholder::placeholder {
|
|
129
|
-
font-family: ${o?.fontFamily};
|
|
130
|
-
font-weight: ${o?.fontWeight};
|
|
131
|
-
line-height: ${o?.lineHeight};
|
|
132
|
-
font-size: ${o?.fontSize};
|
|
133
|
-
color: ${o?.color};
|
|
134
|
-
}
|
|
135
|
-
` }),
|
|
136
|
-
/* @__PURE__ */ l.jsx(
|
|
137
|
-
"input",
|
|
138
|
-
{
|
|
139
|
-
ref: N,
|
|
140
|
-
style: se ? {} : { width: `${Number(n?.length) > 4 ? (n?.length || 0) + 5 : 12}ch` },
|
|
141
|
-
type: te,
|
|
142
|
-
placeholder: F,
|
|
143
|
-
value: n,
|
|
144
|
-
className: `input-placeholder hfl-flex-1 hfl-pl-2 hfl-placeholder hfl-py-1 focus-visible:hfl-outline-0 focus-visible:hfl-outline-none hfl-border-0 focus:hfl-border-0 ${f ? "!hfl-bg-Gray-50 !hfl-cursor-not-allowed" : g || "hfl-bg-White"} ${ee || ""}`,
|
|
145
|
-
onChange: (e) => {
|
|
146
|
-
a && a(e.target.value), L(!0);
|
|
147
|
-
},
|
|
148
|
-
onClick: be,
|
|
149
|
-
onKeyDown: (e) => R && R(e, c, N),
|
|
150
|
-
maxLength: W ?? W,
|
|
151
|
-
...D.inputProps || {}
|
|
152
|
-
}
|
|
153
|
-
),
|
|
154
|
-
!Q && !P && /* @__PURE__ */ l.jsx("i", { className: "hx_down hfl-mx-2" }),
|
|
155
|
-
P && /* @__PURE__ */ l.jsx(
|
|
156
|
-
"i",
|
|
157
|
-
{
|
|
158
|
-
className: `${n ? "hx_close hfl-cursor-pointer" : "hx_down"} hfl-mx-2`,
|
|
159
|
-
onClick: () => {
|
|
160
|
-
(p?.value || n) && (a && a(""), L(!0));
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
),
|
|
164
|
-
T ? /* @__PURE__ */ l.jsx(
|
|
165
|
-
"span",
|
|
166
|
-
{
|
|
167
|
-
style: { left: `${q < 2 ? "3" : q}ch` },
|
|
168
|
-
className: "hfl-absolute hfl-top-1/2 hfl--translate-y-1/2 hfl-pointer-events-none",
|
|
169
|
-
children: T
|
|
170
|
-
}
|
|
171
|
-
) : null
|
|
172
|
-
]
|
|
173
|
-
}
|
|
174
|
-
),
|
|
175
|
-
he && /* @__PURE__ */ l.jsx("span", { className: "hfl-text-0 hfl-text-Error-600", children: $ })
|
|
176
|
-
] }) : /* @__PURE__ */ l.jsxs(
|
|
177
|
-
"button",
|
|
178
|
-
{
|
|
179
|
-
ref: K,
|
|
180
|
-
onClick: Y,
|
|
181
|
-
className: `hfl-w-full hfl-bg-White hfl-py-[6px] hfl-px-4 hfl-rounded-lg hfl-inline-flex hfl-justify-between hfl-items-center ${X || ""} ${m || "hfl-border-1"} ${$ ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${x || "hfl-h-[40px]"} ${f ? "!hfl-bg-Gray-50 !hfl-cursor-not-allowed" : ""}`,
|
|
182
|
-
style: _ || p?.label ? {} : o ? {
|
|
183
|
-
fontFamily: o?.fontFamily,
|
|
184
|
-
fontSize: o?.fontSize,
|
|
185
|
-
fontWeight: o?.fontWeight,
|
|
186
|
-
lineHeight: o?.lineHeight,
|
|
187
|
-
color: o?.color
|
|
188
|
-
} : {},
|
|
189
|
-
children: [
|
|
190
|
-
/* @__PURE__ */ l.jsx("span", { className: "hfl-pr-4", children: _ || p?.label || F || "Select an option" }),
|
|
191
|
-
/* @__PURE__ */ l.jsx("img", { src: Se, alt: "down arrow" })
|
|
192
|
-
]
|
|
193
|
-
}
|
|
194
|
-
),
|
|
195
|
-
i && i?.length >= 0 && /* @__PURE__ */ l.jsxs(
|
|
196
|
-
"ul",
|
|
197
|
-
{
|
|
198
|
-
ref: b,
|
|
199
|
-
className: `custom-dropdown-menu ${r ? "hfl-visible" : "hfl-invisible"} hfl-absolute hfl-z-50 hfl-grid hfl-gap-1 hfl-mt-3 hfl-w-full hfl-rounded-lg hfl-shadow-lg hfl-bg-White hfl-font-inter-0 hfl-p-1 hfl-px-2 ${h ? "hfl-min-w-[20em]" : "hfl-min-w-[16em]"} hfl-max-h-[330px] hfl-overflow-y-scroll ${ce}`,
|
|
200
|
-
role: "menu",
|
|
201
|
-
"aria-orientation": "vertical",
|
|
202
|
-
"aria-labelledby": "options-menu",
|
|
203
|
-
children: [
|
|
204
|
-
ne ? /* @__PURE__ */ l.jsx(
|
|
205
|
-
Le,
|
|
206
|
-
{
|
|
207
|
-
onChangeHandler: re,
|
|
208
|
-
selectedOption: ie,
|
|
209
|
-
options: ae
|
|
210
|
-
}
|
|
211
|
-
) : !1,
|
|
212
|
-
(le ? xe : i)?.map((e, t) => {
|
|
213
|
-
const s = h ? !!C?.some((S) => S.value === e?.value) : !1, Z = p?.value === e?.value, ve = d === t;
|
|
214
|
-
return e ? /* @__PURE__ */ l.jsx(
|
|
215
|
-
"li",
|
|
216
|
-
{
|
|
217
|
-
onClick: () => {
|
|
218
|
-
h ? A(e) : (H && H(e), c(!1), L(!1));
|
|
219
|
-
},
|
|
220
|
-
className: `hfl-text-1 hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item ${de ? "odd:hfl-bg-Gray-100" : ""} ${Z ? "hfl-bg-Blue-50 hfl-text-Blue-500" : ""}`,
|
|
221
|
-
role: "menuitem",
|
|
222
|
-
"aria-selected": Z,
|
|
223
|
-
tabIndex: ve ? 0 : -1,
|
|
224
|
-
ref: (S) => {
|
|
225
|
-
k.current[t] = S;
|
|
226
|
-
},
|
|
227
|
-
children: h ? /* @__PURE__ */ l.jsx(
|
|
228
|
-
$e,
|
|
229
|
-
{
|
|
230
|
-
size: "sm",
|
|
231
|
-
disabled: !1,
|
|
232
|
-
text: /* @__PURE__ */ l.jsx("span", { children: e.label }),
|
|
233
|
-
secondaryText: "",
|
|
234
|
-
id: `${e.label}-${t}`,
|
|
235
|
-
isMarked: s
|
|
236
|
-
}
|
|
237
|
-
) : e.label
|
|
238
|
-
},
|
|
239
|
-
`${e.label}-${t}`
|
|
240
|
-
) : null;
|
|
241
|
-
}),
|
|
242
|
-
i?.length === 0 && fe && /* @__PURE__ */ l.jsx(
|
|
243
|
-
"li",
|
|
244
|
-
{
|
|
245
|
-
className: "hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item",
|
|
246
|
-
children: "No items found, please change the search criteria"
|
|
247
|
-
}
|
|
248
|
-
)
|
|
249
|
-
]
|
|
250
|
-
}
|
|
251
|
-
)
|
|
252
|
-
] });
|
|
253
|
-
}
|
|
254
|
-
export {
|
|
255
|
-
Pe as default
|
|
256
|
-
};
|