@zimyo/ui 1.10.8 → 1.10.10
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/package.json +6 -2
- package/dist/chunks/Calender-3809e0ed.js +0 -1
- package/dist/chunks/Calender-af2588bc.esm.js +0 -1
- package/dist/chunks/Heading-54a5488c.js +0 -1
- package/dist/chunks/Heading-b91e2c5f.esm.js +0 -1
- package/dist/chunks/Muted-619e3b72.js +0 -1
- package/dist/chunks/Muted-bfc4985b.esm.js +0 -1
- package/dist/chunks/Text-8c4fb3f8.js +0 -1
- package/dist/chunks/Text-f18219bd.esm.js +0 -1
- package/dist/chunks/assertThisInitialized-406be690.esm.js +0 -1
- package/dist/chunks/assertThisInitialized-d31798d4.js +0 -1
- package/dist/chunks/index-32c3a4e2.esm.js +0 -1
- package/dist/chunks/index-5b35e7d9.esm.js +0 -1
- package/dist/chunks/index-76f24a60.js +0 -1
- package/dist/chunks/index-90b71f01.js +0 -1
- package/dist/chunks/index-a7c3d9a4.esm.js +0 -1
- package/dist/chunks/index-ca2c3710.js +0 -1
- package/dist/chunks/lucide-493ccaad.js +0 -26
- package/dist/chunks/lucide-8c9441ea.esm.js +0 -26
- package/dist/chunks/tslib.es6-49e5b83c.esm.js +0 -1
- package/dist/chunks/tslib.es6-fa3b2784.js +0 -1
- package/dist/chunks/typeof-b30b964a.js +0 -1
- package/dist/chunks/typeof-cc63ab7d.esm.js +0 -1
- package/dist/components/Accordion/index.d.ts +0 -34
- package/dist/components/Accordion/index.esm.js +0 -1
- package/dist/components/Accordion/index.js +0 -1
- package/dist/components/AppList/index.d.ts +0 -27
- package/dist/components/AppList/index.esm.js +0 -1
- package/dist/components/AppList/index.js +0 -1
- package/dist/components/Badge/index.d.ts +0 -29
- package/dist/components/Badge/index.esm.js +0 -1
- package/dist/components/Badge/index.js +0 -1
- package/dist/components/BulkActionsBar/index.d.ts +0 -23
- package/dist/components/BulkActionsBar/index.esm.js +0 -1
- package/dist/components/BulkActionsBar/index.js +0 -1
- package/dist/components/Button/index.d.ts +0 -15
- package/dist/components/Button/index.esm.js +0 -1
- package/dist/components/Button/index.js +0 -1
- package/dist/components/Card/index.d.ts +0 -69
- package/dist/components/Card/index.esm.js +0 -1
- package/dist/components/Card/index.js +0 -1
- package/dist/components/Checkbox/index.d.ts +0 -14
- package/dist/components/Checkbox/index.esm.js +0 -1
- package/dist/components/Checkbox/index.js +0 -1
- package/dist/components/CheckboxGroup/index.d.ts +0 -31
- package/dist/components/CheckboxGroup/index.esm.js +0 -1
- package/dist/components/CheckboxGroup/index.js +0 -1
- package/dist/components/DataTable/index.d.ts +0 -70
- package/dist/components/DataTable/index.esm.js +0 -23
- package/dist/components/DataTable/index.js +0 -22
- package/dist/components/DatePicker/index.d.ts +0 -40
- package/dist/components/DatePicker/index.esm.js +0 -1
- package/dist/components/DatePicker/index.js +0 -1
- package/dist/components/DateRangePicker/index.d.ts +0 -28
- package/dist/components/DateRangePicker/index.esm.js +0 -1
- package/dist/components/DateRangePicker/index.js +0 -1
- package/dist/components/Form/index.d.ts +0 -35
- package/dist/components/Form/index.esm.js +0 -1
- package/dist/components/Form/index.js +0 -1
- package/dist/components/GlobalMenuSearch/index.d.ts +0 -16
- package/dist/components/GlobalMenuSearch/index.esm.js +0 -1
- package/dist/components/GlobalMenuSearch/index.js +0 -1
- package/dist/components/Input/index.d.ts +0 -25
- package/dist/components/Input/index.esm.js +0 -1
- package/dist/components/Input/index.js +0 -1
- package/dist/components/Modal/index.d.ts +0 -20
- package/dist/components/Modal/index.esm.js +0 -1
- package/dist/components/Modal/index.js +0 -1
- package/dist/components/Notice/index.d.ts +0 -19
- package/dist/components/Notice/index.esm.js +0 -1
- package/dist/components/Notice/index.js +0 -1
- package/dist/components/Popover/index.d.ts +0 -19
- package/dist/components/Popover/index.esm.js +0 -1
- package/dist/components/Popover/index.js +0 -1
- package/dist/components/PopupConfirm/index.d.ts +0 -36
- package/dist/components/PopupConfirm/index.esm.js +0 -1
- package/dist/components/PopupConfirm/index.js +0 -1
- package/dist/components/Radio/index.d.ts +0 -24
- package/dist/components/Radio/index.esm.js +0 -1
- package/dist/components/Radio/index.js +0 -1
- package/dist/components/RadioGroup/index.d.ts +0 -31
- package/dist/components/RadioGroup/index.esm.js +0 -1
- package/dist/components/RadioGroup/index.js +0 -1
- package/dist/components/Select/index.d.ts +0 -28
- package/dist/components/Select/index.esm.js +0 -1
- package/dist/components/Select/index.js +0 -1
- package/dist/components/Switch/index.d.ts +0 -15
- package/dist/components/Switch/index.esm.js +0 -1
- package/dist/components/Switch/index.js +0 -1
- package/dist/components/Tab/index.d.ts +0 -40
- package/dist/components/Tab/index.esm.js +0 -1
- package/dist/components/Tab/index.js +0 -1
- package/dist/components/Table/index.d.ts +0 -80
- package/dist/components/Table/index.esm.js +0 -1
- package/dist/components/Table/index.js +0 -1
- package/dist/components/TimePicker/index.d.ts +0 -40
- package/dist/components/TimePicker/index.esm.js +0 -1
- package/dist/components/TimePicker/index.js +0 -1
- package/dist/components/Typography/index.d.ts +0 -30
- package/dist/components/Typography/index.esm.js +0 -1
- package/dist/components/Typography/index.js +0 -1
- package/dist/index.d.ts +0 -810
- package/dist/index.esm.js +0 -1
- package/dist/index.js +0 -1
- package/dist/theme/index.d.ts +0 -96
- package/dist/theme/index.esm.js +0 -1
- package/dist/theme/index.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-fa3b2784.js"),i=require("react/jsx-runtime"),t=require("react"),n=require("../../chunks/assertThisInitialized-d31798d4.js"),r=require("../Checkbox/index.js"),o=require("../../chunks/lucide-493ccaad.js");require("../../chunks/index-90b71f01.js");var s=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function l(e,i){return e===i||!(!s(e)||!s(i))}function a(e,i){if(e.length!==i.length)return!1;for(var t=0;t<e.length;t++)if(!l(e[t],i[t]))return!1;return!0}function u(e,i){var t;void 0===i&&(i=a);var n,r=[],o=!1;return function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return o&&t===this&&i(s,r)||(n=e.apply(this,s),o=!0,t=this,r=s),n}}var c="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function d(e){cancelAnimationFrame(e.id)}var h=-1;function f(e){if(void 0===e&&(e=!1),-1===h||e){var i=document.createElement("div"),t=i.style;t.width="50px",t.height="50px",t.overflow="scroll",document.body.appendChild(i),h=i.offsetWidth-i.clientWidth,document.body.removeChild(i)}return h}var z=null;function m(e){if(void 0===e&&(e=!1),null===z||e){var i=document.createElement("div"),t=i.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";var n=document.createElement("div"),r=n.style;return r.width="100px",r.height="100px",i.appendChild(n),document.body.appendChild(i),i.scrollLeft>0?z="positive-descending":(i.scrollLeft=1,z=0===i.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(i),z}return z}process.env.NODE_ENV;var g=function(e,i){return e},p=null,v=null;function x(e){var i,r=e.getItemOffset,o=e.getEstimatedTotalSize,s=e.getItemSize,l=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,h=e.getStopIndexForStartIndex,z=e.initInstanceProps,p=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return i=function(e){var i,x;function y(i){var t;return(t=e.call(this,i)||this)._instanceProps=z(t.props,n._assertThisInitialized(t)),t._outerRef=void 0,t._resetIsScrollingTimeoutId=null,t.state={instance:n._assertThisInitialized(t),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof t.props.initialScrollOffset?t.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},t._callOnItemsRendered=void 0,t._callOnItemsRendered=u(function(e,i,n,r){return t.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:i,visibleStartIndex:n,visibleStopIndex:r})}),t._callOnScroll=void 0,t._callOnScroll=u(function(e,i,n){return t.props.onScroll({scrollDirection:e,scrollOffset:i,scrollUpdateWasRequested:n})}),t._getItemStyle=void 0,t._getItemStyle=function(e){var i,n=t.props,o=n.direction,l=n.itemSize,a=n.layout,u=t._getItemStyleCache(p&&l,p&&a,p&&o);if(u.hasOwnProperty(e))i=u[e];else{var c=r(t.props,e,t._instanceProps),d=s(t.props,e,t._instanceProps),h="horizontal"===o||"horizontal"===a,f="rtl"===o,z=h?c:0;u[e]=i={position:"absolute",left:f?void 0:z,right:f?z:void 0,top:h?0:c,height:h?"100%":d,width:h?d:"100%"}}return i},t._getItemStyleCache=void 0,t._getItemStyleCache=u(function(e,i,t){return{}}),t._onScrollHorizontal=function(e){var i=e.currentTarget,n=i.clientWidth,r=i.scrollLeft,o=i.scrollWidth;t.setState(function(e){if(e.scrollOffset===r)return null;var i=t.props.direction,s=r;if("rtl"===i)switch(m()){case"negative":s=-r;break;case"positive-descending":s=o-n-r}return s=Math.max(0,Math.min(s,o-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<s?"forward":"backward",scrollOffset:s,scrollUpdateWasRequested:!1}},t._resetIsScrollingDebounced)},t._onScrollVertical=function(e){var i=e.currentTarget,n=i.clientHeight,r=i.scrollHeight,o=i.scrollTop;t.setState(function(e){if(e.scrollOffset===o)return null;var i=Math.max(0,Math.min(o,r-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<i?"forward":"backward",scrollOffset:i,scrollUpdateWasRequested:!1}},t._resetIsScrollingDebounced)},t._outerRefSetter=function(e){var i=t.props.outerRef;t._outerRef=e,"function"==typeof i?i(e):null!=i&&"object"==typeof i&&i.hasOwnProperty("current")&&(i.current=e)},t._resetIsScrollingDebounced=function(){var e,i,n,r;null!==t._resetIsScrollingTimeoutId&&d(t._resetIsScrollingTimeoutId),t._resetIsScrollingTimeoutId=(e=t._resetIsScrolling,i=150,n=c(),r={id:requestAnimationFrame(function t(){c()-n>=i?e.call(null):r.id=requestAnimationFrame(t)})})},t._resetIsScrolling=function(){t._resetIsScrollingTimeoutId=null,t.setState({isScrolling:!1},function(){t._getItemStyleCache(-1,null)})},t}x=e,(i=y).prototype=Object.create(x.prototype),i.prototype.constructor=i,n._setPrototypeOf(i,x),y.getDerivedStateFromProps=function(e,i){return _(e,i),v(e),null};var w=y.prototype;return w.scrollTo=function(e){e=Math.max(0,e),this.setState(function(i){return i.scrollOffset===e?null:{scrollDirection:i.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},w.scrollToItem=function(e,i){void 0===i&&(i="auto");var t=this.props,n=t.itemCount,r=t.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,n-1));var s=0;if(this._outerRef){var a=this._outerRef;s="vertical"===r?a.scrollWidth>a.clientWidth?f():0:a.scrollHeight>a.clientHeight?f():0}this.scrollTo(l(this.props,e,i,o,this._instanceProps,s))},w.componentDidMount=function(){var e=this.props,i=e.direction,t=e.initialScrollOffset,n=e.layout;if("number"==typeof t&&null!=this._outerRef){var r=this._outerRef;"horizontal"===i||"horizontal"===n?r.scrollLeft=t:r.scrollTop=t}this._callPropsCallbacks()},w.componentDidUpdate=function(){var e=this.props,i=e.direction,t=e.layout,n=this.state,r=n.scrollOffset;if(n.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===i||"horizontal"===t)if("rtl"===i)switch(m()){case"negative":o.scrollLeft=-r;break;case"positive-ascending":o.scrollLeft=r;break;default:var s=o.clientWidth,l=o.scrollWidth;o.scrollLeft=l-s-r}else o.scrollLeft=r;else o.scrollTop=r}this._callPropsCallbacks()},w.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&d(this._resetIsScrollingTimeoutId)},w.render=function(){var e=this.props,i=e.children,r=e.className,s=e.direction,l=e.height,a=e.innerRef,u=e.innerElementType,c=e.innerTagName,d=e.itemCount,h=e.itemData,f=e.itemKey,z=void 0===f?g:f,m=e.layout,p=e.outerElementType,v=e.outerTagName,x=e.style,_=e.useIsScrolling,y=e.width,w=this.state.isScrolling,b="horizontal"===s||"horizontal"===m,S=b?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),k=C[0],j=C[1],N=[];if(d>0)for(var R=k;R<=j;R++)N.push(t.createElement(i,{data:h,key:z(R,h),index:R,isScrolling:_?w:void 0,style:this._getItemStyle(R)}));var I=o(this.props,this._instanceProps);return t.createElement(p||v||"div",{className:r,onScroll:S,ref:this._outerRefSetter,style:n._extends({position:"relative",height:l,width:y,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:s},x)},t.createElement(u||c||"div",{children:N,ref:a,style:{height:b?"100%":I,pointerEvents:w?"none":void 0,width:b?I:"100%"}}))},w._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),i=e[0],t=e[1],n=e[2],r=e[3];this._callOnItemsRendered(i,t,n,r)}if("function"==typeof this.props.onScroll){var o=this.state,s=o.scrollDirection,l=o.scrollOffset,a=o.scrollUpdateWasRequested;this._callOnScroll(s,l,a)}},w._getRangeToRender=function(){var e=this.props,i=e.itemCount,t=e.overscanCount,n=this.state,r=n.isScrolling,o=n.scrollDirection,s=n.scrollOffset;if(0===i)return[0,0,0,0];var l=a(this.props,s,this._instanceProps),u=h(this.props,l,s,this._instanceProps),c=r&&"backward"!==o?1:Math.max(1,t),d=r&&"forward"!==o?1:Math.max(1,t);return[Math.max(0,l-c),Math.max(0,Math.min(i-1,u+d)),l,u]},y}(t.PureComponent),i.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},i}"production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&void 0!==window.WeakSet&&(p=new WeakSet,v=new WeakSet);var _=function(e,i){var t=e.children,n=e.direction,r=e.height,o=e.layout,s=e.innerTagName,l=e.outerTagName,a=e.width,u=i.instance;if("production"!==process.env.NODE_ENV){null==s&&null==l||v&&!v.has(u)&&(v.add(u),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var c="horizontal"===n||"horizontal"===o;switch(n){case"horizontal":case"vertical":p&&!p.has(u)&&(p.add(u),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". "'+n+'" was specified.')}switch(o){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". "'+o+'" was specified.')}if(null==t)throw Error('An invalid "children" prop has been specified. Value should be a React component. "'+(null===t?"null":typeof t)+'" was specified.');if(c&&"number"!=typeof a)throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. "'+(null===a?"null":typeof a)+'" was specified.');if(!c&&"number"!=typeof r)throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. "'+(null===r?"null":typeof r)+'" was specified.')}},y=x({getItemOffset:function(e,i){return i*e.itemSize},getItemSize:function(e,i){return e.itemSize},getEstimatedTotalSize:function(e){var i=e.itemCount;return e.itemSize*i},getOffsetForIndexAndAlignment:function(e,i,t,n,r,o){var s=e.direction,l=e.height,a=e.itemCount,u=e.itemSize,c=e.layout,d=e.width,h="horizontal"===s||"horizontal"===c?d:l,f=Math.max(0,a*u-h),z=Math.min(f,i*u),m=Math.max(0,i*u-h+u+o);switch("smart"===t&&(t=n>=m-h&&n<=z+h?"auto":"center"),t){case"start":return z;case"end":return m;case"center":var g=Math.round(m+(z-m)/2);return g<Math.ceil(h/2)?0:g>f+Math.floor(h/2)?f:g;default:return n>=m&&n<=z?n:n<m?m:z}},getStartIndexForOffset:function(e,i){var t=e.itemCount,n=e.itemSize;return Math.max(0,Math.min(t-1,Math.floor(i/n)))},getStopIndexForStartIndex:function(e,i,t){var n=e.direction,r=e.height,o=e.itemCount,s=e.itemSize,l=e.layout,a=e.width,u=i*s,c="horizontal"===n||"horizontal"===l?a:r,d=Math.ceil((c+t-u)/s);return Math.max(0,Math.min(o-1,i+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var i=e.itemSize;if("production"!==process.env.NODE_ENV&&"number"!=typeof i)throw Error('An invalid "itemSize" prop has been specified. Value should be a number. "'+(null===i?"null":typeof i)+'" was specified.')}});let w;w="undefined"!=typeof window?window:"undefined"!=typeof self?self:global;let b=null,S=null;const C=w.clearTimeout,k=w.setTimeout,j=w.cancelAnimationFrame||w.mozCancelAnimationFrame||w.webkitCancelAnimationFrame,N=w.requestAnimationFrame||w.mozRequestAnimationFrame||w.webkitRequestAnimationFrame;function R(e){let i,t,n,r,o,s,l;const a="undefined"!=typeof document&&document.attachEvent;if(!a){s=function(e){const i=e.__resizeTriggers__,t=i.firstElementChild,n=i.lastElementChild,r=t.firstElementChild;n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,r.style.width=t.offsetWidth+1+"px",r.style.height=t.offsetHeight+1+"px",t.scrollLeft=t.scrollWidth,t.scrollTop=t.scrollHeight},o=function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height},l=function(e){if(e.target.className&&"function"==typeof e.target.className.indexOf&&e.target.className.indexOf("contract-trigger")<0&&e.target.className.indexOf("expand-trigger")<0)return;const i=this;s(this),this.__resizeRAF__&&b(this.__resizeRAF__),this.__resizeRAF__=S(function(){o(i)&&(i.__resizeLast__.width=i.offsetWidth,i.__resizeLast__.height=i.offsetHeight,i.__resizeListeners__.forEach(function(t){t.call(i,e)}))})};let e=!1,a="";n="animationstart";const u="Webkit Moz O ms".split(" ");let c="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),d="";{const i=document.createElement("fakeelement");if(void 0!==i.style.animationName&&(e=!0),!1===e)for(let t=0;t<u.length;t++)if(void 0!==i.style[u[t]+"AnimationName"]){d=u[t],a="-"+d.toLowerCase()+"-",n=c[t],e=!0;break}}t="resizeanim",i="@"+a+"keyframes "+t+" { from { opacity: 0; } to { opacity: 0; } } ",r=a+"animation: 1ms "+t+"; "}return{addResizeListener:function(o,u){if(a)o.attachEvent("onresize",u);else{if(!o.__resizeTriggers__){const a=o.ownerDocument,u=w.getComputedStyle(o);u&&"static"===u.position&&(o.style.position="relative"),function(t){if(!t.getElementById("detectElementResize")){const n=(i||"")+".resize-triggers { "+(r||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',o=t.head||t.getElementsByTagName("head")[0],s=t.createElement("style");s.id="detectElementResize",s.type="text/css",null!=e&&s.setAttribute("nonce",e),s.styleSheet?s.styleSheet.cssText=n:s.appendChild(t.createTextNode(n)),o.appendChild(s)}}(a),o.__resizeLast__={},o.__resizeListeners__=[],(o.__resizeTriggers__=a.createElement("div")).className="resize-triggers";const c=a.createElement("div");c.className="expand-trigger",c.appendChild(a.createElement("div"));const d=a.createElement("div");d.className="contract-trigger",o.__resizeTriggers__.appendChild(c),o.__resizeTriggers__.appendChild(d),o.appendChild(o.__resizeTriggers__),s(o),o.addEventListener("scroll",l,!0),n&&(o.__resizeTriggers__.__animationListener__=function(e){e.animationName===t&&s(o)},o.__resizeTriggers__.addEventListener(n,o.__resizeTriggers__.__animationListener__))}o.__resizeListeners__.push(u)}},removeResizeListener:function(e,i){if(a)e.detachEvent("onresize",i);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(i),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",l,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(n,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}null==j||null==N?(b=C,S=function(e){return k(e,20)}):(b=function([e,i]){j(e),C(i)},S=function(e){const i=N(function(){C(t),e()}),t=k(function(){j(i),e()},20);return[i,t]});class I extends t.Component{constructor(...e){super(...e),this.state={height:this.props.defaultHeight||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._didLogDeprecationWarning=!1,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:e,disableWidth:i,onResize:t}=this.props;if(this._parentNode){const n=window.getComputedStyle(this._parentNode)||{},r=parseFloat(n.paddingLeft||"0"),o=parseFloat(n.paddingRight||"0"),s=parseFloat(n.paddingTop||"0"),l=parseFloat(n.paddingBottom||"0"),a=this._parentNode.getBoundingClientRect(),u=a.height-s-l,c=a.width-r-o;if(!e&&this.state.height!==u||!i&&this.state.width!==c){this.setState({height:u,width:c});const e=()=>{this._didLogDeprecationWarning||(this._didLogDeprecationWarning=!0,console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"))};"function"==typeof t&&t({height:u,width:c,get scaledHeight(){return e(),u},get scaledWidth(){return e(),c}})}}},this._setRef=e=>{this._autoSizer=e}}componentDidMount(){const{nonce:e}=this.props,i=this._autoSizer?this._autoSizer.parentNode:null;if(null!=i&&i.ownerDocument&&i.ownerDocument.defaultView&&i instanceof i.ownerDocument.defaultView.HTMLElement){this._parentNode=i;const t=i.ownerDocument.defaultView.ResizeObserver;null!=t?(this._resizeObserver=new t(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(i)):(this._detectElementResize=R(e),this._detectElementResize.addResizeListener(i,this._onResize)),this._onResize()}}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),null!==this._timeoutId&&clearTimeout(this._timeoutId),this._resizeObserver&&this._resizeObserver.disconnect())}render(){const{children:e,defaultHeight:i,defaultWidth:n,disableHeight:r=!1,disableWidth:o=!1,doNotBailOutOnEmptyChildren:s=!1,nonce:l,onResize:a,style:u={},tagName:c="div",...d}=this.props,{height:h,width:f}=this.state,z={overflow:"visible"},m={};let g=!1;return r||(0===h&&(g=!0),z.height=0,m.height=h,m.scaledHeight=h),o||(0===f&&(g=!0),z.width=0,m.width=f,m.scaledWidth=f),s&&(g=!1),t.createElement(c,{ref:this._setRef,style:{...z,...u},...d},!g&&e(m))}}var E=150,T=function(t){var n,r=t.column,o=t.width,s=t.sticky,l=t.stickyPosition,a=s?((n={position:"sticky"})[s]="".concat(l||0,"px"),n.zIndex=25,n.backgroundColor="white",n):{},u="center"===r.align?"zui:justify-center":"right"===r.align?"zui:justify-end":"zui:justify-start";return i.jsx("div",{className:"zui:flex zui:items-center zui:px-4 zui:py-4 zui:border-r zui:border-gray-200 zui:flex-shrink-0 zui:min-h-[60px] ".concat(u),style:e.__assign({width:"".concat(o,"px"),minWidth:"".concat(o,"px"),maxWidth:"".concat(o,"px")},a),children:i.jsx("div",{className:"zui:h-4 zui:bg-gray-200 zui:rounded zui:animate-pulse zui:w-3/4"})})},O=function(e){var t=e.leftStickyColumns,n=e.rightStickyColumns,r=e.regularColumns,o=e.selection,s=e.calculateStickyPosition,l=e.rowIndex;return i.jsxs("div",{className:"zui:flex zui:min-w-full zui:border-b zui:border-gray-200 zui:bg-white",children:[(null==o?void 0:o.enabled)&&i.jsx("div",{className:"zui:sticky zui:left-0 zui:z-30 zui:bg-white zui:border-r zui:border-gray-200 zui:w-12 zui:flex zui:items-center zui:justify-center zui:px-3 zui:py-4 zui:flex-shrink-0",children:i.jsx("div",{className:"zui:w-4 zui:h-4 zui:bg-gray-200 zui:rounded zui:animate-pulse"})}),t.map(function(e,n){return i.jsx(T,{column:e,width:e.width||E,sticky:"left",stickyPosition:s(t,n,"left")},"left-".concat(e.id,"-").concat(l))}),r.map(function(e,t){return i.jsx(T,{column:e,width:e.width||E},"regular-".concat(e.id,"-").concat(l))}),n.map(function(e,t){return i.jsx(T,{column:e,width:e.width||E,sticky:"right",stickyPosition:s(n,t,"right")},"right-".concat(e.id,"-").concat(l))})]})},L=function(e){var t=e.columns,n=e.leftStickyColumns,r=e.rightStickyColumns,o=e.regularColumns,s=e.selection,l=e.calculateStickyPosition,a=e.totalWidth;return i.jsx("div",{style:{minWidth:"".concat(a,"px")},children:Array.from({length:10},function(e,a){return i.jsx(O,{columns:t,leftStickyColumns:n,rightStickyColumns:r,regularColumns:o,selection:s,calculateStickyPosition:l,rowIndex:a},"skeleton-row-".concat(a))})})},M=function(n){var s,l,a=n.columns,u=n.data,c=n.loading,d=void 0!==c&&c,h=n.stickyColumns,f=n.pagination,z=n.selection,m=n.sorting,g=n.filtering,p=n.expansion,v=n.virtualization,x=void 0===v?{enabled:!1}:v,_=n.onRowClick;n.bulkActions;var w=n.isRowSelectable,b=n.className,S=void 0===b?"":b;n.variant;var C=t.useState(a),k=C[0],j=C[1],N=t.useState(""),R=N[0];N[1];var T=t.useState(!1),O=T[0];T[1];var M=t.useRef(null),A=t.useRef(null),D=t.useRef(null),F=t.useMemo(function(){return k.map(function(i){var t,n,r=i.sticky;return(null===(t=null==h?void 0:h.left)||void 0===t?void 0:t.includes(i.id))?r="left":(null===(n=null==h?void 0:h.right)||void 0===n?void 0:n.includes(i.id))&&(r="right"),e.__assign(e.__assign({},i),{sticky:r})})},[k,h]),H=t.useMemo(function(){return F.filter(function(e){return!e.hidden})},[F]),q=null!==(s=null==h?void 0:h.left)&&void 0!==s?s:[],V=null!==(l=null==h?void 0:h.right)&&void 0!==l?l:[],U=H.filter(function(e){return q.includes(e.id)}),B=H.filter(function(e){return V.includes(e.id)}),K=H.filter(function(e){return!q.includes(e.id)&&!V.includes(e.id)}),G=t.useMemo(function(){return K.reduce(function(e,i){return e+(i.width||E)},0)},[K]),J=t.useMemo(function(){var e=0;return(null==z?void 0:z.enabled)&&(e+=48),H.forEach(function(i){e+=i.width||E}),Math.max(e,800)},[H,z]),Q=t.useMemo(function(){var i=e.__spreadArray([],u,!0);return R&&(i=i.filter(function(e){return Object.values(e).some(function(e){return String(e).toLowerCase().includes(R.toLowerCase())})})),(null==g?void 0:g.filters)&&Object.entries(g.filters).forEach(function(e){var t=e[0],n=e[1];n&&(i=i.filter(function(e){return String(e[t]).toLowerCase().includes(String(n).toLowerCase())}))}),(null==m?void 0:m.sortBy)&&i.sort(function(e,i){var t=e[m.sortBy],n=i[m.sortBy];return t<n?"asc"===m.sortOrder?-1:1:t>n?"asc"===m.sortOrder?1:-1:0}),i},[u,R,null==g?void 0:g.filters,m]);t.useEffect(function(){var e=A.current,i=D.current;if(e&&i){var t=!1,n=!1,r=function(){n||(t=!0,i.scrollLeft=e.scrollLeft,setTimeout(function(){t=!1},0))},o=function(){t||(n=!0,e.scrollLeft=i.scrollLeft,setTimeout(function(){n=!1},0))};return e.addEventListener("scroll",r),i.addEventListener("scroll",o),function(){e.removeEventListener("scroll",r),i.removeEventListener("scroll",o)}}},[]);var X=t.useCallback(function(){if((null==z?void 0:z.enabled)&&Q){var i=Q.filter(function(e){return!w||w(e)}).map(function(e){return e.id});if(i.every(function(e){return z.selectedRows.includes(e)}))z.onSelectionChange(z.selectedRows.filter(function(e){return!i.includes(e)}));else{var t=Array.from(new Set(e.__spreadArray(e.__spreadArray([],z.selectedRows.filter(function(e){return!i.includes(e)}),!0),i,!0)));z.onSelectionChange(t)}}},[Q,z,w]),Y=t.useCallback(function(i){if(null==z?void 0:z.enabled){var t=z.selectedRows;t.includes(i)?z.onSelectionChange(t.filter(function(e){return e!==i})):z.onSelectionChange(e.__spreadArray(e.__spreadArray([],t,!0),[i],!1))}},[z]),Z=t.useCallback(function(i){if(p){var t=p.expandedRows;t.includes(i)?p.onExpansionChange(t.filter(function(e){return e!==i})):p.onExpansionChange(e.__spreadArray(e.__spreadArray([],t,!0),[i],!1))}},[p]),$=t.useCallback(function(i){j(function(t){return t.map(function(t){return t.id===i?e.__assign(e.__assign({},t),{hidden:!t.hidden}):t})})},[]),ee=t.useCallback(function(e,t,n){var r=t[e.accessor];return e.render?e.render(r,t,n):i.jsx("span",{className:"zui:truncate",children:String(r||"")})},[]),ie=t.useCallback(function(e,i,t){var n=0;return"left"===t?((null==z?void 0:z.enabled)&&(n+=48),e.slice(0,i).forEach(function(e){n+=e.width||E})):e.slice(i+1).forEach(function(e){n+=e.width||E}),n},[z]);return i.jsxs("div",{className:"zui:w-full zui:h-full zui:bg-white zui:flex zui:flex-col ".concat(S),children:[O&&!d&&i.jsxs("div",{className:"zui:absolute zui:right-4 zui:top-16 zui:z-50 zui:w-64 zui:bg-white zui:border zui:border-gray-200 zui:rounded-lg zui:shadow-lg zui:p-4",children:[i.jsx("h3",{className:"zui:text-sm zui:font-medium zui:text-gray-900 zui:mb-3",children:"Show/Hide Columns"}),a.map(function(e){return i.jsxs("label",{className:"zui:flex zui:items-center zui:space-x-2 zui:mb-2",children:[i.jsx("input",{type:"checkbox",checked:!e.hidden,onChange:function(){return $(e.id)},className:"zui:rounded zui:border-gray-300"}),i.jsx("span",{className:"zui:text-sm zui:text-gray-700",children:e.header})]},e.id)})]}),i.jsxs("div",{ref:M,className:"zui:relative zui:flex-1 zui:min-h-0 zui:overflow-hidden",children:[i.jsxs("div",{className:"zui:sticky zui:top-0 zui:z-40 zui:bg-gray-50 zui:border-b zui:border-gray-200 zui:flex",children:[(null==z?void 0:z.enabled)&&i.jsx("div",{className:"zui:sticky zui:left-0 zui:z-50 zui:bg-gray-200 zui:border-r zui:border-gray-200 zui:w-12 zui:flex zui:items-center zui:justify-center zui:px-2 zui:py-2 zui:flex-shrink-0",children:i.jsx(r.Checkbox,{checked:!d&&Q.length>0&&Q.every(function(e){return z.selectedRows.includes(e.id)}),onChange:X,disabled:d,className:"zui:rounded zui:border-gray-300 zui:w-4 zui:h-4 zui:disabled:opacity-50"})}),U.map(function(e,t){return i.jsx(W,{column:e,width:e.width||E,sticky:"left",stickyPosition:ie(U,t,"left"),sorting:m,loading:d},e.id)}),i.jsx("div",{ref:A,className:"zui:flex-1 zui:overflow-x-auto zui:scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:i.jsx("div",{className:"zui:flex",style:{minWidth:"".concat(G,"px")},children:K.map(function(e){return i.jsx(W,{column:e,width:e.width||E,sorting:m,loading:d},e.id)})})}),B.map(function(e,t){return i.jsx(W,{column:e,width:e.width||E,sticky:"right",stickyPosition:ie(B,t,"right"),sorting:m,loading:d},e.id)})]}),i.jsx("div",{ref:D,className:"zui:flex-1 zui:overflow-auto zui:h-[calc(100%_-_2.75rem)]",style:{minHeight:"200px"},children:(null==x?void 0:x.enabled)?i.jsx(I,{children:function(e){var t=e.height,n=e.width;return i.jsx(y,{height:t,width:n,itemCount:Q.length,itemSize:x.rowHeight||60,overscanCount:x.overscan||5,children:function(e){var t=e.index,n=e.style;return i.jsx("div",{style:n,children:i.jsx(P,{row:Q[t],rowIndex:t,columns:H,leftStickyColumns:U,rightStickyColumns:B,regularColumns:K,selection:z,expansion:p,onRowClick:_,onRowSelection:Y,onRowExpansion:Z,renderCell:ee,calculateStickyPosition:ie,isRowSelectable:w})},Q[t].id)}})}}):d?i.jsx(L,{columns:H,leftStickyColumns:U,rightStickyColumns:B,regularColumns:K,selection:z,calculateStickyPosition:ie,totalWidth:J}):0===Q.length?i.jsxs("div",{className:"zui:flex zui:flex-col zui:items-center zui:justify-center zui:py-12",children:[i.jsx("div",{className:"zui:text-gray-400 zui:text-lg zui:mb-2",children:"No data found"}),i.jsx("div",{className:"zui:text-gray-500 zui:text-sm",children:"Try adjusting your search or filters"})]}):i.jsx("div",{style:{minWidth:"".concat(J,"px")},children:Q.map(function(e,t){return i.jsx(P,{row:e,rowIndex:t,columns:H,leftStickyColumns:U,rightStickyColumns:B,regularColumns:K,selection:z,expansion:p,onRowClick:_,onRowSelection:Y,onRowExpansion:Z,renderCell:ee,calculateStickyPosition:ie,isRowSelectable:w},e.id)})})})]}),f&&i.jsxs("div",{className:"zui:flex zui:items-center zui:justify-between zui:px-4 zui:py-3 zui:border-t zui:border-gray-200 zui:flex-shrink-0 zui:bg-white",children:[d?"Loading...":function(){Math.max(1,Math.ceil(f.total/f.pageSize));var e=Math.min((f.page-1)*f.pageSize+1,Math.max(0,f.total)),i=Math.min(f.page*f.pageSize,f.total);return"Showing ".concat(0===f.total?0:e,"-").concat(i," of ").concat(f.total," entries")}(),i.jsx("div",{className:"zui:flex zui:items-center zui:space-x-2",children:d?i.jsx(i.Fragment,{children:Array.from({length:4},function(e,t){return i.jsx("div",{className:"zui:w-8 zui:h-8 zui:bg-gray-200 zui:rounded zui:animate-pulse"},t)})}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"zui:flex zui:items-center zui:space-x-1 zui:ml-2",children:[i.jsx("span",{className:"zui:text-sm zui:text-gray-700",children:"Per page:"}),i.jsx("select",{value:f.pageSize,onChange:function(e){var i=Number(e.target.value);f.onPageSizeChange(i),f.onPageChange(1)},className:"zui:border zui:border-gray-300 zui:rounded zui:px-2 zui:py-1 zui:text-sm",children:[5,10,20,50,100].map(function(e){return i.jsx("option",{value:e,children:e},e)})})]}),i.jsx("button",{onClick:function(){return f.onPageChange(1)},disabled:1===f.page,className:"zui:px-2 zui:py-1 zui:text-sm zui:border zui:rounded zui:disabled:opacity-50 zui:bg-white zui:text-gray-700 zui:border-gray-300 zui:hover:bg-gray-50",children:i.jsx(o.ChevronFirst,{size:18})}),i.jsx("button",{onClick:function(){return f.onPageChange(Math.max(1,f.page-1))},disabled:1===f.page,className:"zui:px-2 zui:py-1 zui:text-sm zui:border zui:rounded zui:disabled:opacity-50 zui:bg-white zui:text-gray-700 zui:border-gray-300 zui:hover:bg-gray-50",children:i.jsx(o.ChevronLeft,{size:18})}),i.jsx("button",{onClick:function(){return f.onPageChange(Math.min(Math.max(1,Math.ceil(f.total/f.pageSize)),f.page+1))},disabled:f.page>=Math.max(1,Math.ceil(f.total/f.pageSize)),className:"zui:px-2 zui:py-1 zui:text-sm zui:border zui:rounded zui:disabled:opacity-50 zui:bg-white zui:text-gray-700 zui:border-gray-300 zui:hover:bg-gray-50",children:i.jsx(o.ChevronRight,{size:18})}),i.jsx("button",{onClick:function(){return f.onPageChange(Math.max(1,Math.ceil(f.total/f.pageSize)))},disabled:f.page>=Math.max(1,Math.ceil(f.total/f.pageSize)),className:"zui:px-2 zui:py-1 zui:text-sm zui:border zui:rounded zui:disabled:opacity-50 zui:bg-white zui:text-gray-700 zui:border-gray-300 zui:hover:bg-gray-50",children:i.jsx(o.ChevronLast,{size:18})})]})})]})]})},W=function(t){var n,r=t.column,s=t.width,l=t.sticky,a=t.stickyPosition,u=t.sorting,c=t.loading,d=void 0!==c&&c,h=l?((n={position:"sticky"})[l]="".concat(a||0,"px"),n.zIndex=45,n.backgroundColor="#f9fafb",n):{},f="center"===r.align?"zui:justify-center":"right"===r.align?"zui:justify-end":"zui:justify-start";return i.jsx("div",{className:"zui:flex zui:items-center zui:px-2 zui:py-2 zui:text-left zui:text-sm zui:font-medium zui:text-gray-600 zui:tracking-wider zui:border-r zui:border-gray-300 zui:bg-gray-200 zui:flex-shrink-0 ".concat(f),style:e.__assign({width:"".concat(s,"px"),minWidth:"".concat(s,"px"),maxWidth:"".concat(s,"px")},h),children:i.jsxs("div",{className:"zui:flex zui:items-center zui:space-x-1 zui:flex-1 zui:min-w-0",children:[i.jsx("span",{className:"zui:truncate zui:flex-1",children:r.header}),r.sortable&&i.jsx("button",{onClick:function(){if(r.sortable&&u&&!d){var e="asc";u.sortBy===r.id&&(e="asc"===u.sortOrder?"desc":"asc"),u.onSortChange(r.id,e)}},disabled:d,className:"zui:p-1 zui:hover:bg-gray-200 zui:rounded zui:transition-colors zui:flex-shrink-0 zui:disabled:opacity-50 zui:disabled:cursor-not-allowed",children:d||(null==u?void 0:u.sortBy)!==r.id?i.jsx(o.ArrowUpDown,{className:"zui:w-4 zui:h-4 zui:text-gray-400"}):"asc"===u.sortOrder?i.jsx(o.ArrowUp,{className:"zui:w-4 zui:h-4 zui:text-blue-600"}):i.jsx(o.ArrowDown,{className:"zui:w-4 zui:h-4 zui:text-blue-600"})})]})})},P=function(e){var n=e.row,s=e.rowIndex,l=e.leftStickyColumns,a=e.rightStickyColumns,u=e.regularColumns,c=e.selection,d=e.expansion,h=e.onRowClick,f=e.onRowSelection,z=e.onRowExpansion,m=e.renderCell,g=e.calculateStickyPosition,p=e.isRowSelectable,v=(null==c?void 0:c.selectedRows.includes(n.id))||!1,x=(null==d?void 0:d.expandedRows.includes(n.id))||!1,_=n._children&&n._children.length>0,y=t.useCallback(function(){f(n.id)},[n.id,f]),w=t.useCallback(function(){z(n.id)},[n.id,z]),b=t.useCallback(function(e,t,n){var r=e.render?e.render(t[e.accessor],t,n):i.jsx("span",{className:"zui:truncate",children:String(t[e.accessor]||"")});return i.jsxs("div",{className:"zui:flex zui:items-center zui:w-full",children:[d&&i.jsx("div",{className:"zui:flex-shrink-0 zui:mr-2",children:_?i.jsx("button",{onClick:function(e){e.stopPropagation(),w()},className:"zui:p-1 zui:hover:bg-gray-200 zui:rounded zui:transition-colors",children:x?i.jsx(o.ChevronDown,{className:"zui:w-4 zui:h-4"}):i.jsx(o.ChevronRight,{className:"zui:w-4 zui:h-4"})}):i.jsx("div",{className:"zui:w-6 zui:h-6"})}),i.jsx("div",{className:"zui:flex-1 zui:min-w-0",children:r})]})},[d,_,x,w]);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"zui:flex zui:min-w-full zui:border-b zui:border-gray-200 zui:hover:bg-gray-50 zui:transition-colors zui:cursor-pointer ".concat(v?"zui:bg-blue-50":"zui:bg-white"),onClick:function(){return null==h?void 0:h(n)},children:[(null==c?void 0:c.enabled)&&(!p||p(n)?i.jsx("div",{className:"zui:sticky zui:left-0 zui:z-30 zui:bg-inherit zui:border-r zui:border-gray-200 zui:w-12 zui:flex zui:items-center zui:justify-center zui:px-3 zui:py-4 zui:flex-shrink-0",children:i.jsx(r.Checkbox,{checked:v,onChange:function(e){e.stopPropagation(),y()},className:"zui:rounded zui:border-gray-300 zui:w-4 zui:h-4"})}):i.jsx("div",{className:"zui:sticky zui:left-0 zui:z-30 zui:bg-inherit zui:border-r zui:border-gray-200 zui:w-12 zui:flex zui:items-center zui:justify-center zui:px-3 zui:py-4 zui:flex-shrink-0"})),l.map(function(e,t){return i.jsx(A,{column:e,row:n,rowIndex:s,width:e.width||E,sticky:"left",stickyPosition:g(l,t,"left"),renderCell:0===t?b:m},e.id)}),u.map(function(e,t){return i.jsx(A,{column:e,row:n,rowIndex:s,width:e.width||E,renderCell:0===l.length&&0===t?b:m},e.id)}),a.map(function(e,t){return i.jsx(A,{column:e,row:n,rowIndex:s,width:e.width||E,sticky:"right",stickyPosition:g(a,t,"right"),renderCell:m},e.id)})]}),x&&(null==d?void 0:d.renderExpandedRow)&&i.jsx("div",{className:"zui:border-b zui:border-gray-200 zui:bg-gray-50",children:d.renderExpandedRow(n)})]})},A=function(t){var n,r=t.column,o=t.row,s=t.rowIndex,l=t.width,a=t.sticky,u=t.stickyPosition,c=t.renderCell,d=a?((n={position:"sticky"})[a]="".concat(u||0,"px"),n.zIndex=25,n.backgroundColor="inherit",n):{},h="center"===r.align?"zui:justify-center":"right"===r.align?"zui:justify-end":"zui:justify-start";return i.jsx("div",{className:"zui:flex zui:items-center zui:px-3 zui:py-1 zui:text-sm zui:text-gray-900 zui:border-r zui:border-gray-200 zui:flex-shrink-0 zui:min-h-[50px] ".concat(h),style:e.__assign({width:"".concat(l,"px"),minWidth:"".concat(l,"px"),maxWidth:"".concat(l,"px")},d),children:i.jsx("div",{className:"zui:w-full zui:min-w-0",children:c(r,o,s)})})};exports.Table=M,exports.default=M;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Dayjs } from 'dayjs';
|
|
3
|
-
|
|
4
|
-
type InputSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
5
|
-
type InputVariant = 'outlined' | 'contained';
|
|
6
|
-
interface TimePickerProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'defaultValue'> {
|
|
7
|
-
label?: string;
|
|
8
|
-
floatingLabel?: boolean;
|
|
9
|
-
description?: string;
|
|
10
|
-
error?: string;
|
|
11
|
-
size?: InputSize;
|
|
12
|
-
variant?: InputVariant;
|
|
13
|
-
focusOutline?: boolean;
|
|
14
|
-
value?: Dayjs | null;
|
|
15
|
-
defaultValue?: Dayjs | null;
|
|
16
|
-
onChange?: (time: Dayjs | null, timeString: string) => void;
|
|
17
|
-
format?: string;
|
|
18
|
-
use12Hours?: boolean;
|
|
19
|
-
hourStep?: number;
|
|
20
|
-
minuteStep?: number;
|
|
21
|
-
secondStep?: number;
|
|
22
|
-
needConfirm?: boolean;
|
|
23
|
-
showNow?: boolean;
|
|
24
|
-
okText?: string;
|
|
25
|
-
closeText?: string;
|
|
26
|
-
nowText?: string;
|
|
27
|
-
amText?: string;
|
|
28
|
-
pmText?: string;
|
|
29
|
-
hourLabel?: string;
|
|
30
|
-
minuteLabel?: string;
|
|
31
|
-
secondLabel?: string;
|
|
32
|
-
disabledHours?: (h: number) => boolean;
|
|
33
|
-
disabledMinutes?: (m: number) => boolean;
|
|
34
|
-
disabledSeconds?: (s: number) => boolean;
|
|
35
|
-
allowClear?: boolean;
|
|
36
|
-
}
|
|
37
|
-
declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLInputElement>>;
|
|
38
|
-
|
|
39
|
-
export { TimePicker, TimePicker as default };
|
|
40
|
-
export type { TimePickerProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,a as t}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsxs as i,jsx as n}from"react/jsx-runtime";import*as r from"react";import u from"@mui/material/Popover";import{a as o}from"../../chunks/index-32c3a4e2.esm.js";import{X as a,m as s}from"../../chunks/lucide-8c9441ea.esm.js";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c={exports:{}},d=l(c.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",u="minute",o="hour",a="day",s="week",l="month",c="quarter",d="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},p=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},g={s:p,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+p(n,2,"0")+":"+p(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,l),u=i-r<0,o=t.clone().add(n+(u?-1:1),l);return+(-(n+(i-r)/(u?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:s,d:a,D:f,h:o,m:u,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",y={};y[b]=v;var x="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[x])},M=function e(t,i,n){var r;if(!t)return b;if("string"==typeof t){var u=t.toLowerCase();y[u]&&(r=u),i&&(y[u]=i,r=u);var o=t.split("-");if(!r&&o.length>1)return e(o[0])}else{var a=t.name;y[a]=t,r=a}return!n&&r&&(b=r),r||!n&&b},$=function(e,t){if(w(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new S(i)},D=g;D.l=M,D.i=w,D.w=function(e,t){return $(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function v(e){this.$L=M(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var p=v.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(D.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(m);if(n){var r=n[2]-1||0,u=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return D},p.isValid=function(){return!(this.$d.toString()===h)},p.isSame=function(e,t){var i=$(e);return this.startOf(t)<=i&&i<=this.endOf(t)},p.isAfter=function(e,t){return $(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<$(e)},p.$g=function(e,t,i){return D.u(e)?this[t]:this.set(i,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,t){var i=this,n=!!D.u(t)||t,c=D.p(e),h=function(e,t){var r=D.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(a)},m=function(e,t){return D.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},z=this.$W,v=this.$M,p=this.$D,g="set"+(this.$u?"UTC":"");switch(c){case d:return n?h(1,0):h(31,11);case l:return n?h(1,v):h(0,v+1);case s:var b=this.$locale().weekStart||0,y=(z<b?z+7:z)-b;return h(n?p-y:p+(6-y),v);case a:case f:return m(g+"Hours",0);case o:return m(g+"Minutes",1);case u:return m(g+"Seconds",2);case r:return m(g+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(e,t){var i,s=D.p(e),c="set"+(this.$u?"UTC":""),h=(i={},i[a]=c+"Date",i[f]=c+"Date",i[l]=c+"Month",i[d]=c+"FullYear",i[o]=c+"Hours",i[u]=c+"Minutes",i[r]=c+"Seconds",i[n]=c+"Milliseconds",i)[s],m=s===a?this.$D+(t-this.$W):t;if(s===l||s===d){var z=this.clone().set(f,1);z.$d[h](m),z.init(),this.$d=z.set(f,Math.min(this.$D,z.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[D.p(e)]()},p.add=function(n,c){var f,h=this;n=Number(n);var m=D.p(c),z=function(e){var t=$(h);return D.w(t.date(t.date()+Math.round(e*n)),h)};if(m===l)return this.set(l,this.$M+n);if(m===d)return this.set(d,this.$y+n);if(m===a)return z(1);if(m===s)return z(7);var v=(f={},f[u]=t,f[o]=i,f[r]=e,f)[m]||1,p=this.$d.getTime()+n*v;return D.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||h;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=D.z(this),u=this.$H,o=this.$m,a=this.$M,s=i.weekdays,l=i.months,c=i.meridiem,d=function(e,i,r,u){return e&&(e[i]||e(t,n))||r[i].slice(0,u)},f=function(e){return D.s(u%12||12,e,"0")},m=c||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(z,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return D.s(t.$y,4,"0");case"M":return a+1;case"MM":return D.s(a+1,2,"0");case"MMM":return d(i.monthsShort,a,l,3);case"MMMM":return d(l,a);case"D":return t.$D;case"DD":return D.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(i.weekdaysMin,t.$W,s,2);case"ddd":return d(i.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(u);case"HH":return D.s(u,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(u,o,!0);case"A":return m(u,o,!1);case"m":return String(o);case"mm":return D.s(o,2,"0");case"s":return String(t.$s);case"ss":return D.s(t.$s,2,"0");case"SSS":return D.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(n,f,h){var m,z=this,v=D.p(f),p=$(n),g=(p.utcOffset()-this.utcOffset())*t,b=this-p,y=function(){return D.m(z,p)};switch(v){case d:m=y()/12;break;case l:m=y();break;case c:m=y()/3;break;case s:m=(b-g)/6048e5;break;case a:m=(b-g)/864e5;break;case o:m=b/i;break;case u:m=b/t;break;case r:m=b/e;break;default:m=b}return h?m:D.a(m)},p.daysInMonth=function(){return this.endOf(l).$D},p.$locale=function(){return y[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=M(e,t,!0);return n&&(i.$L=n),i},p.clone=function(){return D.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},v}(),k=S.prototype;return $.prototype=k,[["$ms",n],["$s",r],["$m",u],["$H",o],["$W",a],["$M",l],["$y",d],["$D",f]].forEach(function(e){k[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),$.extend=function(e,t){return e.$i||(e(t,S,$),e.$i=!0),$},$.locale=M,$.isDayjs=w,$.unix=function(e){return $(1e3*e)},$.en=y[b],$.Ls=y,$.p={},$}()),f={exports:{}},h=l(f.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,n=/\d\d/,r=/\d\d?/,u=/\d*[^-_:/,()\s\d]+/,o={},a=function(e){return(e=+e)+(e>68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),i=60*t[1]+(+t[2]||0);return 0===i?0:"+"===t[0]?-i:i}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var i,n=o.meridiem;if(n){for(var r=1;r<=24;r+=1)if(e.indexOf(n(r,0,t))>-1){i=r>12;break}}else i=e===(t?"pm":"PM");return i},f={A:[u,function(e){this.afternoon=d(e,!1)}],a:[u,function(e){this.afternoon=d(e,!0)}],Q:[i,function(e){this.month=3*(e-1)+1}],S:[i,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,s("seconds")],ss:[r,s("seconds")],m:[r,s("minutes")],mm:[r,s("minutes")],H:[r,s("hours")],h:[r,s("hours")],HH:[r,s("hours")],hh:[r,s("hours")],D:[r,s("day")],DD:[n,s("day")],Do:[u,function(e){var t=o.ordinal,i=e.match(/\d+/);if(this.day=i[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],w:[r,s("week")],ww:[n,s("week")],M:[r,s("month")],MM:[n,s("month")],MMM:[u,function(e){var t=c("months"),i=(c("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(i<1)throw new Error;this.month=i%12||i}],MMMM:[u,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[n,function(e){this.year=a(e)}],YYYY:[/\d{4}/,s("year")],Z:l,ZZ:l};function h(i){var n,r;n=i,r=o&&o.formats;for(var u=(i=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,i,n){var u=n&&n.toUpperCase();return i||r[n]||e[n]||r[u].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,i){return t||i.slice(1)})})).match(t),a=u.length,s=0;s<a;s+=1){var l=u[s],c=f[l],d=c&&c[0],h=c&&c[1];u[s]=h?{regex:d,parser:h}:l.replace(/^\[|\]$/g,"")}return function(e){for(var t={},i=0,n=0;i<a;i+=1){var r=u[i];if("string"==typeof r)n+=r.length;else{var o=r.regex,s=r.parser,l=e.slice(n),c=o.exec(l)[0];s.call(t,c),e=e.replace(c,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var i=e.hours;t?i<12&&(e.hours+=12):12===i&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,i){i.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var n=t.prototype,r=n.parse;n.parse=function(e){var t=e.date,n=e.utc,u=e.args;this.$u=n;var a=u[1];if("string"==typeof a){var s=!0===u[2],l=!0===u[3],c=s||l,d=u[2];l&&(d=u[2]),o=this.$locale(),!s&&d&&(o=i.Ls[d]),this.$d=function(e,t,i,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),u=r.year,o=r.month,a=r.day,s=r.hours,l=r.minutes,c=r.seconds,d=r.milliseconds,f=r.zone,m=r.week,z=new Date,v=a||(u||o?1:z.getDate()),p=u||z.getFullYear(),g=0;u&&!o||(g=o>0?o-1:z.getMonth());var b,y=s||0,x=l||0,w=c||0,M=d||0;return f?new Date(Date.UTC(p,g,v,y,x,w,M+60*f.offset*1e3)):i?new Date(Date.UTC(p,g,v,y,x,w,M)):(b=new Date(p,g,v,y,x,w,M),m&&(b=n(b).week(m).toDate()),b)}catch(e){return new Date("")}}(t,a,n,i),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),c&&t!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var f=a.length,m=1;m<=f;m+=1){u[1]=a[m-1];var z=i.apply(this,u);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}m===f&&(this.$d=new Date(""))}else r.call(this,e)}}}());d.extend(h);var m={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},z={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},v={xs:"zui:min-w-[10rem]",sm:"zui:min-w-[12rem]",md:"zui:min-w-[12rem]",lg:"zui:min-w-[14rem]"};function p(e){return e<10?"0".concat(e):"".concat(e)}function g(e,t,i){void 0===i&&(i=0);for(var n=[],r=i;r<=t;r+=e)n.push(r);return n}var b=r.forwardRef(function(l,c){var f,h,b,y=l.label,x=l.floatingLabel,w=void 0!==x&&x,M=l.description,$=l.error,D=l.size,S=void 0===D?"md":D,k=l.variant,Y=void 0===k?"outlined":k,N=l.focusOutline,L=void 0===N||N,T=l.className,O=l.value,C=l.defaultValue,H=void 0===C?null:C,_=l.onChange,A=l.format,P=void 0===A?"HH:mm":A,j=l.use12Hours,E=l.hourStep,Z=void 0===E?1:E,U=l.minuteStep,W=void 0===U?1:U,F=l.secondStep,R=void 0===F?1:F,V=l.needConfirm,I=void 0===V||V,q=l.showNow,K=void 0===q||q,B=l.okText,J=void 0===B?"OK":B,Q=l.closeText,X=void 0===Q?"Close":Q,G=l.nowText,ee=void 0===G?"Now":G,te=l.amText,ie=void 0===te?"AM":te,ne=l.pmText,re=void 0===ne?"PM":ne,ue=l.hourLabel,oe=void 0===ue?"Hour":ue,ae=l.minuteLabel,se=void 0===ae?"Minute":ae,le=l.secondLabel,ce=void 0===le?"Second":le,de=l.disabledHours,fe=l.disabledMinutes,he=l.disabledSeconds,me=l.disabled,ze=l.placeholder,ve=l.required,pe=l.allowClear,ge=void 0===pe||pe,be=l.id,ye=e(l,["label","floatingLabel","description","error","size","variant","focusOutline","className","value","defaultValue","onChange","format","use12Hours","hourStep","minuteStep","secondStep","needConfirm","showNow","okText","closeText","nowText","amText","pmText","hourLabel","minuteLabel","secondLabel","disabledHours","disabledMinutes","disabledSeconds","disabled","placeholder","required","allowClear","id"]),xe=be||function(e){void 0===e&&(e="timepicker");var t=r.useRef();return t.current||(t.current="".concat(e,"-").concat(Math.random().toString(36).slice(2,9))),t.current}("timepicker"),we=(h=P,"boolean"==typeof(b=j)?b:/(^|[^H])h/.test(h)||/(\sa\b|\sA\b|a\b|A\b)/.test(h)),Me=function(e){return/\bss\b/.test(e)}(P),$e=r.useRef(void 0!==O).current,De=r.useState(H),Se=De[0],ke=De[1],Ye=$e?null!=O?O:null:null!=Se?Se:null,Ne=Ye?Ye.format(P):"",Le=r.useState(Ne),Te=Le[0],Oe=Le[1];r.useEffect(function(){Oe(Ne)},[Ne]);var Ce=r.useState(null),He=Ce[0],_e=Ce[1],Ae=Boolean(He),Pe=r.useRef(null),je=r.useRef(!1);function Ee(e,t){var i;_e(e&&null!==(i=null!=t?t:Pe.current)&&void 0!==i?i:null)}function Ze(){je.current=!0,Ee(!1),I&&(Oe(Ne),Fe(Ye)),Promise.resolve().then(function(){je.current=!1})}r.useEffect(function(){function e(e){"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),Ae&&_e(null))}return Ae&&document.addEventListener("keydown",e,!0),function(){return document.removeEventListener("keydown",e,!0)}},[Ae]);var Ue=r.useState(Ye),We=Ue[0],Fe=Ue[1];r.useEffect(function(){Ae&&(Fe(Ye),Oe(Ne))},[Ae,Ye,Ne]);var Re=r.useMemo(function(){return we?g(Z,12,1):g(Z,23,0)},[we,Z]),Ve=r.useMemo(function(){return g(W,59,0)},[W]),Ie=r.useMemo(function(){return g(R,59,0)},[R]);function qe(e){var t=e?e.format(P):"";null==_||_(e,t),$e||ke(e)}function Ke(e,t,i,n){var r;if(!(null==de?void 0:de(we?e%12||12:e))&&!((null==fe?void 0:fe(t))||Me&&(null==he?void 0:he(i)))){var u=we?function(e,t){return t?"am"===t?12===e?0:e:12===e?12:e+12:e}(e,n):e,o=(null!==(r=null!=We?We:Ye)&&void 0!==r?r:d()).hour(u).minute(t).second(Me?i:0).millisecond(0);Fe(o),Oe(o.format(P)),I||qe(o)}}var Be=We?We.format(P):"",Je=Ae&&""!==Be.trim()?Be:Ne;var Qe=r.useRef(null),Xe=r.useRef(null),Ge=r.useRef(null);function et(e,t){var i=e.current;if(i){var n=Array.from(i.querySelectorAll('button[role="option"]:not([aria-disabled="true"])'));if(0!==n.length){var r=n.findIndex(function(e){return e===document.activeElement});n[r<0?0:Math.max(0,Math.min(n.length-1,r+t))].focus()}}}function tt(e,t){"ArrowDown"===e.key?(e.preventDefault(),et(t,1)):"ArrowUp"===e.key&&(e.preventDefault(),et(t,-1))}var it="lg"===S?18:16,nt=y||"Time picker",rt=Boolean(Je)&&!me&&!!ge,ut="outlined"===Y?"zui:border-gray-300 focus:zui:border-gray-400":"zui:border-transparent",ot=null!==(f=null!=We?We:Ye)&&void 0!==f?f:null,at=ot?ot.hour():we?12:0,st=ot?ot.minute():0,lt=ot?ot.second():0,ct=at>=12?"pm":"am",dt=at%12==0?12:at%12;return i("div",{className:o("zui:flex zui:flex-col",v[S]),children:[!w&&y&&i("label",{htmlFor:xe,className:"zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",children:[y,ve&&n("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),i("div",{className:o("zui:relative zui:w-full zui:rounded-md zui:border zui:bg-background zui:text-sm zui:transition-colors",L&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===Y&&"zui:border-input","contained"===Y&&"zui:bg-muted zui:border-transparent",$&&"zui:border-destructive",$&&L&&"zui:focus-within:ring-destructive",T),children:[n("input",t({id:xe,ref:function(e){"function"==typeof c?c(e):c&&(c.current=e),Pe.current=e},value:Je,onChange:function(e){var t;Oe(null!==(t=e.target.value)&&void 0!==t?t:"")},onBlur:function(){var e=(null!=Te?Te:"").trim();if(I){if(!e)return Fe(null),void Oe(Ne);(t=d(e,P,!0)).isValid()?Fe(t.millisecond(0)):(Oe(Ne),Fe(Ye))}else{if(!e)return void qe(null);var t;(t=d(e,P,!0)).isValid()?qe(t.millisecond(0)):Oe(Ne)}},onFocus:function(e){me||je.current||Ee(!0,Pe.current||e.currentTarget)},onClick:function(e){me||je.current||Ee(!0,Pe.current||e.currentTarget)},placeholder:null!=ze?ze:we?Me?"h:mm:ss a":"h:mm a":Me?"HH:mm:ss":"HH:mm","aria-label":nt,disabled:me,required:ve,className:o("zui:relative zui:w-full zui:rounded-md zui:border zui:bg-background zui:text-sm zui:transition-colors zui:outline-none",ut,m[S],z[S],$?"zui:border-red-500":"","zui:pl-3",T)},ye)),rt?n("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),Fe(null),Oe(""),qe(null),je.current=!0,Ee(!1),Promise.resolve().then(function(){je.current=!1})},className:"zui:absolute zui:inset-y-0 zui:right-9 zui:flex zui:items-center zui:text-gray-500 hover:zui:text-gray-700 focus:zui:outline-none","aria-label":"Clear time",children:n(a,{size:it})}):null,n("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),function(e){me||Ee(!Ae,e.currentTarget)}(e)},className:"zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-gray-600 hover:zui:text-gray-800 disabled:zui:opacity-50 zui:pr-3",disabled:me,"aria-label":"Toggle time panel",children:n(s,{size:it})})]}),M&&!$&&n("p",{className:"zui:mt-1 zui:text-xs zui:text-gray-500",children:M}),$&&n("p",{className:"zui:mt-1 zui:text-xs zui:text-red-600",children:$}),n(u,{open:Ae,anchorEl:He,onClose:function(e,t){"backdropClick"!==t&&"escapeKeyDown"!==t&&Ze()},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{className:o("zui:rounded-md zui:border zui:border-gray-200 zui:shadow-lg zui:bg-white zui:p-2","zui:w-[22rem] sm:zui:w-[24rem]")}},children:i("div",{className:"zui:flex zui:flex-col zui:gap-2",children:[i("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2 zui:text-xs zui:text-gray-500 zui:sticky zui:top-0 zui:bg-white zui:z-10",children:[n("div",{className:"zui:text-center",children:oe}),n("div",{className:"zui:text-center",children:se}),n("div",{className:"zui:text-center",children:Me?ce:we?"AM/PM":""})]}),i("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2",children:[n("div",{ref:Qe,onKeyDown:function(e){return tt(e,Qe)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select hour",children:Re.map(function(e){var t,i=we?dt===e:at===e,r=null!==(t=null==de?void 0:de(we?e%12||12:e))&&void 0!==t&&t;return n("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":r,disabled:r,onClick:function(){r||Ke(e,st,lt,we?ct:void 0)},className:o("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:p(e)},e)})}),n("div",{ref:Xe,onKeyDown:function(e){return tt(e,Xe)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select minute",children:Ve.map(function(e){var t,i=st===e,r=null!==(t=null==fe?void 0:fe(e))&&void 0!==t&&t;return n("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":r,disabled:r,onClick:function(){r||Ke(we?dt:at,e,lt,we?ct:void 0)},className:o("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:p(e)},e)})}),Me?n("div",{ref:Ge,onKeyDown:function(e){return tt(e,Ge)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select second",children:Ie.map(function(e){var t,i=lt===e,r=null!==(t=null==he?void 0:he(e))&&void 0!==t&&t;return n("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":r,disabled:r,onClick:function(){r||Ke(we?dt:at,st,e,we?ct:void 0)},className:o("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:p(e)},e)})}):we?n("div",{className:"zui:flex zui:flex-col zui:gap-1",role:"listbox","aria-label":"Select AM/PM",children:["am","pm"].map(function(e){var t=ct===e;return n("button",{type:"button",role:"option","aria-selected":t,onClick:function(){Ke(dt||12,st,lt,e)},className:o("zui:flex-1 zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",t&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium"),"aria-pressed":t,children:"am"===e?ie:re},e)})}):null]}),i("div",{className:"zui:flex zui:items-center zui:justify-between zui:pt-1",children:[K?n("button",{type:"button",onClick:function(){var e=d(),t=e.second(Me?e.second():0).millisecond(0);Fe(t),Oe(t.format(P)),qe(t),je.current=!0,Ee(!1),Promise.resolve().then(function(){je.current=!1})},className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:ee}):n("span",{}),i("div",{className:"zui:flex zui:gap-2",children:[n("button",{type:"button",onClick:Ze,className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:X}),I&&n("button",{type:"button",onClick:function(){qe(null!=We?We:null),je.current=!0,Ee(!1),Promise.resolve().then(function(){je.current=!1})},className:"zui:text-white zui:bg-blue-600 hover:zui:bg-blue-700 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-3 zui:py-1",children:J})]})]})]})})]})});export{b as TimePicker,b as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-fa3b2784.js"),t=require("react/jsx-runtime"),n=require("react"),i=require("@mui/material/Popover"),r=require("../../chunks/index-90b71f01.js"),u=require("../../chunks/lucide-493ccaad.js");function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var s=o(n);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l={exports:{}},c=a(l.exports=function(){var e=1e3,t=6e4,n=36e5,i="millisecond",r="second",u="minute",o="hour",s="day",a="week",l="month",c="quarter",d="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},p=function(e,t,n){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(n)+e},g={s:p,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),i=Math.floor(n/60),r=n%60;return(t<=0?"+":"-")+p(i,2,"0")+":"+p(r,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var i=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(i,l),u=n-r<0,o=t.clone().add(i+(u?-1:1),l);return+(-(i+(n-r)/(u?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:a,d:s,D:f,h:o,m:u,s:r,ms:i,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",x={};x[b]=v;var y="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[y])},M=function e(t,n,i){var r;if(!t)return b;if("string"==typeof t){var u=t.toLowerCase();x[u]&&(r=u),n&&(x[u]=n,r=u);var o=t.split("-");if(!r&&o.length>1)return e(o[0])}else{var s=t.name;x[s]=t,r=s}return!i&&r&&(b=r),r||!i&&b},$=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new S(n)},D=g;D.l=M,D.i=w,D.w=function(e,t){return $(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function v(e){this.$L=M(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[y]=!0}var p=v.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(D.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(m);if(i){var r=i[2]-1||0,u=(i[7]||"0").substring(0,3);return n?new Date(Date.UTC(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,u)):new Date(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,u)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return D},p.isValid=function(){return!(this.$d.toString()===h)},p.isSame=function(e,t){var n=$(e);return this.startOf(t)<=n&&n<=this.endOf(t)},p.isAfter=function(e,t){return $(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<$(e)},p.$g=function(e,t,n){return D.u(e)?this[t]:this.set(n,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,t){var n=this,i=!!D.u(t)||t,c=D.p(e),h=function(e,t){var r=D.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return i?r:r.endOf(s)},m=function(e,t){return D.w(n.toDate()[e].apply(n.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},z=this.$W,v=this.$M,p=this.$D,g="set"+(this.$u?"UTC":"");switch(c){case d:return i?h(1,0):h(31,11);case l:return i?h(1,v):h(0,v+1);case a:var b=this.$locale().weekStart||0,x=(z<b?z+7:z)-b;return h(i?p-x:p+(6-x),v);case s:case f:return m(g+"Hours",0);case o:return m(g+"Minutes",1);case u:return m(g+"Seconds",2);case r:return m(g+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(e,t){var n,a=D.p(e),c="set"+(this.$u?"UTC":""),h=(n={},n[s]=c+"Date",n[f]=c+"Date",n[l]=c+"Month",n[d]=c+"FullYear",n[o]=c+"Hours",n[u]=c+"Minutes",n[r]=c+"Seconds",n[i]=c+"Milliseconds",n)[a],m=a===s?this.$D+(t-this.$W):t;if(a===l||a===d){var z=this.clone().set(f,1);z.$d[h](m),z.init(),this.$d=z.set(f,Math.min(this.$D,z.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[D.p(e)]()},p.add=function(i,c){var f,h=this;i=Number(i);var m=D.p(c),z=function(e){var t=$(h);return D.w(t.date(t.date()+Math.round(e*i)),h)};if(m===l)return this.set(l,this.$M+i);if(m===d)return this.set(d,this.$y+i);if(m===s)return z(1);if(m===a)return z(7);var v=(f={},f[u]=t,f[o]=n,f[r]=e,f)[m]||1,p=this.$d.getTime()+i*v;return D.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var i=e||"YYYY-MM-DDTHH:mm:ssZ",r=D.z(this),u=this.$H,o=this.$m,s=this.$M,a=n.weekdays,l=n.months,c=n.meridiem,d=function(e,n,r,u){return e&&(e[n]||e(t,i))||r[n].slice(0,u)},f=function(e){return D.s(u%12||12,e,"0")},m=c||function(e,t,n){var i=e<12?"AM":"PM";return n?i.toLowerCase():i};return i.replace(z,function(e,i){return i||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return D.s(t.$y,4,"0");case"M":return s+1;case"MM":return D.s(s+1,2,"0");case"MMM":return d(n.monthsShort,s,l,3);case"MMMM":return d(l,s);case"D":return t.$D;case"DD":return D.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,a,2);case"ddd":return d(n.weekdaysShort,t.$W,a,3);case"dddd":return a[t.$W];case"H":return String(u);case"HH":return D.s(u,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(u,o,!0);case"A":return m(u,o,!1);case"m":return String(o);case"mm":return D.s(o,2,"0");case"s":return String(t.$s);case"ss":return D.s(t.$s,2,"0");case"SSS":return D.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(i,f,h){var m,z=this,v=D.p(f),p=$(i),g=(p.utcOffset()-this.utcOffset())*t,b=this-p,x=function(){return D.m(z,p)};switch(v){case d:m=x()/12;break;case l:m=x();break;case c:m=x()/3;break;case a:m=(b-g)/6048e5;break;case s:m=(b-g)/864e5;break;case o:m=b/n;break;case u:m=b/t;break;case r:m=b/e;break;default:m=b}return h?m:D.a(m)},p.daysInMonth=function(){return this.endOf(l).$D},p.$locale=function(){return x[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),i=M(e,t,!0);return i&&(n.$L=i),n},p.clone=function(){return D.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},v}(),k=S.prototype;return $.prototype=k,[["$ms",i],["$s",r],["$m",u],["$H",o],["$W",s],["$M",l],["$y",d],["$D",f]].forEach(function(e){k[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),$.extend=function(e,t){return e.$i||(e(t,S,$),e.$i=!0),$},$.locale=M,$.isDayjs=w,$.unix=function(e){return $(1e3*e)},$.en=x[b],$.Ls=x,$.p={},$}()),d={exports:{}},f=a(d.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,i=/\d\d/,r=/\d\d?/,u=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,i=o.meridiem;if(i){for(var r=1;r<=24;r+=1)if(e.indexOf(i(r,0,t))>-1){n=r>12;break}}else n=e===(t?"pm":"PM");return n},f={A:[u,function(e){this.afternoon=d(e,!1)}],a:[u,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*+e}],SS:[i,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[i,a("day")],Do:[u,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var i=1;i<=31;i+=1)t(i).replace(/\[|\]/g,"")===e&&(this.day=i)}],w:[r,a("week")],ww:[i,a("week")],M:[r,a("month")],MM:[i,a("month")],MMM:[u,function(e){var t=c("months"),n=(c("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[u,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[i,function(e){this.year=s(e)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function h(n){var i,r;i=n,r=o&&o.formats;for(var u=(n=i.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,n,i){var u=i&&i.toUpperCase();return n||r[i]||e[i]||r[u].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,n){return t||n.slice(1)})})).match(t),s=u.length,a=0;a<s;a+=1){var l=u[a],c=f[l],d=c&&c[0],h=c&&c[1];u[a]=h?{regex:d,parser:h}:l.replace(/^\[|\]$/g,"")}return function(e){for(var t={},n=0,i=0;n<s;n+=1){var r=u[n];if("string"==typeof r)i+=r.length;else{var o=r.regex,a=r.parser,l=e.slice(i),c=o.exec(l)[0];a.call(t,c),e=e.replace(c,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var i=t.prototype,r=i.parse;i.parse=function(e){var t=e.date,i=e.utc,u=e.args;this.$u=i;var s=u[1];if("string"==typeof s){var a=!0===u[2],l=!0===u[3],c=a||l,d=u[2];l&&(d=u[2]),o=this.$locale(),!a&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,i){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),u=r.year,o=r.month,s=r.day,a=r.hours,l=r.minutes,c=r.seconds,d=r.milliseconds,f=r.zone,m=r.week,z=new Date,v=s||(u||o?1:z.getDate()),p=u||z.getFullYear(),g=0;u&&!o||(g=o>0?o-1:z.getMonth());var b,x=a||0,y=l||0,w=c||0,M=d||0;return f?new Date(Date.UTC(p,g,v,x,y,w,M+60*f.offset*1e3)):n?new Date(Date.UTC(p,g,v,x,y,w,M)):(b=new Date(p,g,v,x,y,w,M),m&&(b=i(b).week(m).toDate()),b)}catch(e){return new Date("")}}(t,s,i,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),c&&t!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){u[1]=s[m-1];var z=n.apply(this,u);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}m===f&&(this.$d=new Date(""))}else r.call(this,e)}}}());c.extend(f);var h={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},m={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},z={xs:"zui:min-w-[10rem]",sm:"zui:min-w-[12rem]",md:"zui:min-w-[12rem]",lg:"zui:min-w-[14rem]"};function v(e){return e<10?"0".concat(e):"".concat(e)}function p(e,t,n){void 0===n&&(n=0);for(var i=[],r=n;r<=t;r+=e)i.push(r);return i}var g=s.forwardRef(function(n,o){var a,l,d,f=n.label,g=n.floatingLabel,b=void 0!==g&&g,x=n.description,y=n.error,w=n.size,M=void 0===w?"md":w,$=n.variant,D=void 0===$?"outlined":$,S=n.focusOutline,k=void 0===S||S,j=n.className,Y=n.value,O=n.defaultValue,N=void 0===O?null:O,L=n.onChange,T=n.format,C=void 0===T?"HH:mm":T,H=n.use12Hours,_=n.hourStep,A=void 0===_?1:_,P=n.minuteStep,E=void 0===P?1:P,q=n.secondStep,Z=void 0===q?1:q,U=n.needConfirm,W=void 0===U||U,F=n.showNow,R=void 0===F||F,V=n.okText,I=void 0===V?"OK":V,K=n.closeText,B=void 0===K?"Close":K,J=n.nowText,Q=void 0===J?"Now":J,X=n.amText,G=void 0===X?"AM":X,ee=n.pmText,te=void 0===ee?"PM":ee,ne=n.hourLabel,ie=void 0===ne?"Hour":ne,re=n.minuteLabel,ue=void 0===re?"Minute":re,oe=n.secondLabel,se=void 0===oe?"Second":oe,ae=n.disabledHours,le=n.disabledMinutes,ce=n.disabledSeconds,de=n.disabled,fe=n.placeholder,he=n.required,me=n.allowClear,ze=void 0===me||me,ve=n.id,pe=e.__rest(n,["label","floatingLabel","description","error","size","variant","focusOutline","className","value","defaultValue","onChange","format","use12Hours","hourStep","minuteStep","secondStep","needConfirm","showNow","okText","closeText","nowText","amText","pmText","hourLabel","minuteLabel","secondLabel","disabledHours","disabledMinutes","disabledSeconds","disabled","placeholder","required","allowClear","id"]),ge=ve||function(e){void 0===e&&(e="timepicker");var t=s.useRef();return t.current||(t.current="".concat(e,"-").concat(Math.random().toString(36).slice(2,9))),t.current}("timepicker"),be=(l=C,"boolean"==typeof(d=H)?d:/(^|[^H])h/.test(l)||/(\sa\b|\sA\b|a\b|A\b)/.test(l)),xe=function(e){return/\bss\b/.test(e)}(C),ye=s.useRef(void 0!==Y).current,we=s.useState(N),Me=we[0],$e=we[1],De=ye?null!=Y?Y:null:null!=Me?Me:null,Se=De?De.format(C):"",ke=s.useState(Se),je=ke[0],Ye=ke[1];s.useEffect(function(){Ye(Se)},[Se]);var Oe=s.useState(null),Ne=Oe[0],Le=Oe[1],Te=Boolean(Ne),Ce=s.useRef(null),He=s.useRef(!1);function _e(e,t){var n;Le(e&&null!==(n=null!=t?t:Ce.current)&&void 0!==n?n:null)}function Ae(){He.current=!0,_e(!1),W&&(Ye(Se),qe(De)),Promise.resolve().then(function(){He.current=!1})}s.useEffect(function(){function e(e){"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),Te&&Le(null))}return Te&&document.addEventListener("keydown",e,!0),function(){return document.removeEventListener("keydown",e,!0)}},[Te]);var Pe=s.useState(De),Ee=Pe[0],qe=Pe[1];s.useEffect(function(){Te&&(qe(De),Ye(Se))},[Te,De,Se]);var Ze=s.useMemo(function(){return be?p(A,12,1):p(A,23,0)},[be,A]),Ue=s.useMemo(function(){return p(E,59,0)},[E]),We=s.useMemo(function(){return p(Z,59,0)},[Z]);function Fe(e){var t=e?e.format(C):"";null==L||L(e,t),ye||$e(e)}function Re(e,t,n,i){var r;if(!(null==ae?void 0:ae(be?e%12||12:e))&&!((null==le?void 0:le(t))||xe&&(null==ce?void 0:ce(n)))){var u=be?function(e,t){return t?"am"===t?12===e?0:e:12===e?12:e+12:e}(e,i):e,o=(null!==(r=null!=Ee?Ee:De)&&void 0!==r?r:c()).hour(u).minute(t).second(xe?n:0).millisecond(0);qe(o),Ye(o.format(C)),W||Fe(o)}}var Ve=Ee?Ee.format(C):"",Ie=Te&&""!==Ve.trim()?Ve:Se;var Ke=s.useRef(null),Be=s.useRef(null),Je=s.useRef(null);function Qe(e,t){var n=e.current;if(n){var i=Array.from(n.querySelectorAll('button[role="option"]:not([aria-disabled="true"])'));if(0!==i.length){var r=i.findIndex(function(e){return e===document.activeElement});i[r<0?0:Math.max(0,Math.min(i.length-1,r+t))].focus()}}}function Xe(e,t){"ArrowDown"===e.key?(e.preventDefault(),Qe(t,1)):"ArrowUp"===e.key&&(e.preventDefault(),Qe(t,-1))}var Ge="lg"===M?18:16,et=f||"Time picker",tt=Boolean(Ie)&&!de&&!!ze,nt="outlined"===D?"zui:border-gray-300 focus:zui:border-gray-400":"zui:border-transparent",it=null!==(a=null!=Ee?Ee:De)&&void 0!==a?a:null,rt=it?it.hour():be?12:0,ut=it?it.minute():0,ot=it?it.second():0,st=rt>=12?"pm":"am",at=rt%12==0?12:rt%12;return t.jsxs("div",{className:r.cn("zui:flex zui:flex-col",z[M]),children:[!b&&f&&t.jsxs("label",{htmlFor:ge,className:"zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",children:[f,he&&t.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),t.jsxs("div",{className:r.cn("zui:relative zui:w-full zui:rounded-md zui:border zui:bg-background zui:text-sm zui:transition-colors",k&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===D&&"zui:border-input","contained"===D&&"zui:bg-muted zui:border-transparent",y&&"zui:border-destructive",y&&k&&"zui:focus-within:ring-destructive",j),children:[t.jsx("input",e.__assign({id:ge,ref:function(e){"function"==typeof o?o(e):o&&(o.current=e),Ce.current=e},value:Ie,onChange:function(e){var t;Ye(null!==(t=e.target.value)&&void 0!==t?t:"")},onBlur:function(){var e=(null!=je?je:"").trim();if(W){if(!e)return qe(null),void Ye(Se);(t=c(e,C,!0)).isValid()?qe(t.millisecond(0)):(Ye(Se),qe(De))}else{if(!e)return void Fe(null);var t;(t=c(e,C,!0)).isValid()?Fe(t.millisecond(0)):Ye(Se)}},onFocus:function(e){de||He.current||_e(!0,Ce.current||e.currentTarget)},onClick:function(e){de||He.current||_e(!0,Ce.current||e.currentTarget)},placeholder:null!=fe?fe:be?xe?"h:mm:ss a":"h:mm a":xe?"HH:mm:ss":"HH:mm","aria-label":et,disabled:de,required:he,className:r.cn("zui:relative zui:w-full zui:rounded-md zui:border zui:bg-background zui:text-sm zui:transition-colors zui:outline-none",nt,h[M],m[M],y?"zui:border-red-500":"","zui:pl-3",j)},pe)),tt?t.jsx("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),qe(null),Ye(""),Fe(null),He.current=!0,_e(!1),Promise.resolve().then(function(){He.current=!1})},className:"zui:absolute zui:inset-y-0 zui:right-9 zui:flex zui:items-center zui:text-gray-500 hover:zui:text-gray-700 focus:zui:outline-none","aria-label":"Clear time",children:t.jsx(u.X,{size:Ge})}):null,t.jsx("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),function(e){de||_e(!Te,e.currentTarget)}(e)},className:"zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-gray-600 hover:zui:text-gray-800 disabled:zui:opacity-50 zui:pr-3",disabled:de,"aria-label":"Toggle time panel",children:t.jsx(u.Clock,{size:Ge})})]}),x&&!y&&t.jsx("p",{className:"zui:mt-1 zui:text-xs zui:text-gray-500",children:x}),y&&t.jsx("p",{className:"zui:mt-1 zui:text-xs zui:text-red-600",children:y}),t.jsx(i,{open:Te,anchorEl:Ne,onClose:function(e,t){"backdropClick"!==t&&"escapeKeyDown"!==t&&Ae()},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{className:r.cn("zui:rounded-md zui:border zui:border-gray-200 zui:shadow-lg zui:bg-white zui:p-2","zui:w-[22rem] sm:zui:w-[24rem]")}},children:t.jsxs("div",{className:"zui:flex zui:flex-col zui:gap-2",children:[t.jsxs("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2 zui:text-xs zui:text-gray-500 zui:sticky zui:top-0 zui:bg-white zui:z-10",children:[t.jsx("div",{className:"zui:text-center",children:ie}),t.jsx("div",{className:"zui:text-center",children:ue}),t.jsx("div",{className:"zui:text-center",children:xe?se:be?"AM/PM":""})]}),t.jsxs("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2",children:[t.jsx("div",{ref:Ke,onKeyDown:function(e){return Xe(e,Ke)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select hour",children:Ze.map(function(e){var n,i=be?at===e:rt===e,u=null!==(n=null==ae?void 0:ae(be?e%12||12:e))&&void 0!==n&&n;return t.jsx("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":u,disabled:u,onClick:function(){u||Re(e,ut,ot,be?st:void 0)},className:r.cn("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",u&&"zui:opacity-40 zui:cursor-not-allowed"),children:v(e)},e)})}),t.jsx("div",{ref:Be,onKeyDown:function(e){return Xe(e,Be)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select minute",children:Ue.map(function(e){var n,i=ut===e,u=null!==(n=null==le?void 0:le(e))&&void 0!==n&&n;return t.jsx("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":u,disabled:u,onClick:function(){u||Re(be?at:rt,e,ot,be?st:void 0)},className:r.cn("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",u&&"zui:opacity-40 zui:cursor-not-allowed"),children:v(e)},e)})}),xe?t.jsx("div",{ref:Je,onKeyDown:function(e){return Xe(e,Je)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select second",children:We.map(function(e){var n,i=ot===e,u=null!==(n=null==ce?void 0:ce(e))&&void 0!==n&&n;return t.jsx("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":u,disabled:u,onClick:function(){u||Re(be?at:rt,ut,e,be?st:void 0)},className:r.cn("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",u&&"zui:opacity-40 zui:cursor-not-allowed"),children:v(e)},e)})}):be?t.jsx("div",{className:"zui:flex zui:flex-col zui:gap-1",role:"listbox","aria-label":"Select AM/PM",children:["am","pm"].map(function(e){var n=st===e;return t.jsx("button",{type:"button",role:"option","aria-selected":n,onClick:function(){Re(at||12,ut,ot,e)},className:r.cn("zui:flex-1 zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",n&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium"),"aria-pressed":n,children:"am"===e?G:te},e)})}):null]}),t.jsxs("div",{className:"zui:flex zui:items-center zui:justify-between zui:pt-1",children:[R?t.jsx("button",{type:"button",onClick:function(){var e=c(),t=e.second(xe?e.second():0).millisecond(0);qe(t),Ye(t.format(C)),Fe(t),He.current=!0,_e(!1),Promise.resolve().then(function(){He.current=!1})},className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:Q}):t.jsx("span",{}),t.jsxs("div",{className:"zui:flex zui:gap-2",children:[t.jsx("button",{type:"button",onClick:Ae,className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:B}),W&&t.jsx("button",{type:"button",onClick:function(){Fe(null!=Ee?Ee:null),He.current=!0,_e(!1),Promise.resolve().then(function(){He.current=!1})},className:"zui:text-white zui:bg-blue-600 hover:zui:bg-blue-700 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-3 zui:py-1",children:I})]})]})]})})]})});exports.TimePicker=g,exports.default=g;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { TypographyProps, SxProps } from '@mui/material';
|
|
3
|
-
|
|
4
|
-
interface HeadingProps extends TypographyProps {
|
|
5
|
-
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
-
}
|
|
7
|
-
declare const Heading: ({ level, ...props }: HeadingProps) => react_jsx_runtime.JSX.Element;
|
|
8
|
-
|
|
9
|
-
interface TextProps extends TypographyProps {
|
|
10
|
-
size?: 'sm' | 'md' | 'lg';
|
|
11
|
-
}
|
|
12
|
-
declare const Text: ({ size, ...props }: TextProps) => react_jsx_runtime.JSX.Element;
|
|
13
|
-
|
|
14
|
-
declare const Lead: (props: TypographyProps) => react_jsx_runtime.JSX.Element;
|
|
15
|
-
|
|
16
|
-
declare const Muted: (props: TypographyProps) => react_jsx_runtime.JSX.Element;
|
|
17
|
-
|
|
18
|
-
declare const Strong: (props: TypographyProps) => react_jsx_runtime.JSX.Element;
|
|
19
|
-
|
|
20
|
-
declare const Caption: (props: TypographyProps) => react_jsx_runtime.JSX.Element;
|
|
21
|
-
|
|
22
|
-
declare const Blockquote: (props: TypographyProps) => react_jsx_runtime.JSX.Element;
|
|
23
|
-
|
|
24
|
-
interface CodeProps {
|
|
25
|
-
children: React.ReactNode;
|
|
26
|
-
sx?: SxProps;
|
|
27
|
-
}
|
|
28
|
-
declare const Code: ({ children, sx }: CodeProps) => react_jsx_runtime.JSX.Element;
|
|
29
|
-
|
|
30
|
-
export { Blockquote, Caption, Code, Heading, Lead, Muted, Strong, Text };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{H as Heading}from"../../chunks/Heading-b91e2c5f.esm.js";export{T as Text}from"../../chunks/Text-f18219bd.esm.js";import{a as o}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsx as n}from"react/jsx-runtime";import{Typography as t,Box as e}from"@mui/material";export{M as Muted}from"../../chunks/Muted-bfc4985b.esm.js";var r=function(e){return n(t,o({variant:"subtitle1",component:e.component||"p",fontWeight:400,color:"text.secondary"},e))},i=function(e){return n(t,o({component:e.component||"strong",fontWeight:500,display:"inline"},e))},c=function(e){return n(t,o({variant:"caption",color:"text.secondary",component:e.component||"span"},e))},s=function(e){return n(t,o({component:"blockquote",sx:{borderLeft:"4px solid",borderColor:"divider",pl:2,color:"text.secondary",fontStyle:"italic"}},e))},a=function(t){var r=t.children,i=t.sx;return n(e,{component:"code",sx:o({fontFamily:"monospace",backgroundColor:"grey.100",color:"primary.main",px:.5,py:.25,borderRadius:1,fontSize:"0.875rem"},i),children:r})};export{s as Blockquote,c as Caption,a as Code,r as Lead,i as Strong};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("../../chunks/Heading-54a5488c.js"),o=require("../../chunks/Text-8c4fb3f8.js"),r=require("../../chunks/tslib.es6-fa3b2784.js"),n=require("react/jsx-runtime"),t=require("@mui/material"),s=require("../../chunks/Muted-619e3b72.js");exports.Heading=e.Heading,exports.Text=o.Text,exports.Muted=s.Muted,exports.Blockquote=function(e){return n.jsx(t.Typography,r.__assign({component:"blockquote",sx:{borderLeft:"4px solid",borderColor:"divider",pl:2,color:"text.secondary",fontStyle:"italic"}},e))},exports.Caption=function(e){return n.jsx(t.Typography,r.__assign({variant:"caption",color:"text.secondary",component:e.component||"span"},e))},exports.Code=function(e){var o=e.children,s=e.sx;return n.jsx(t.Box,{component:"code",sx:r.__assign({fontFamily:"monospace",backgroundColor:"grey.100",color:"primary.main",px:.5,py:.25,borderRadius:1,fontSize:"0.875rem"},s),children:o})},exports.Lead=function(e){return n.jsx(t.Typography,r.__assign({variant:"subtitle1",component:e.component||"p",fontWeight:400,color:"text.secondary"},e))},exports.Strong=function(e){return n.jsx(t.Typography,r.__assign({component:e.component||"strong",fontWeight:500,display:"inline"},e))};
|