@component-hook/picker 1.1.2 → 1.1.3
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/react/index.css +1 -1
- package/dist/react/picker.es.js +1137 -1141
- package/dist/react/picker.umd.js +15 -15
- package/dist/vue/index.css +1 -1
- package/dist/vue/picker.es.js +288 -291
- package/dist/vue/picker.umd.js +2 -2
- package/package.json +1 -1
package/dist/react/picker.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(ve,
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(nr);function Gr(
|
|
1
|
+
(function(ve,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],_):(ve=typeof globalThis<"u"?globalThis:ve||self,_(ve.picker={},ve.React,ve.ReactDOM))})(this,function(ve,_,_e){"use strict";var nr=document.createElement("style");nr.textContent=`:root{--chook-picker-background: #fff;--chook-picker-border-radius: .5rem;--chook-picker-padding-bottom: 1.25rem;--chook-picker-z-index: 2147483646;--chook-picker-mask-background: rgba(0, 0, 0, .2);--chook-picker-header-padding: .75rem 0;--chook-picker-header-margin-bottom: 1.25rem;--chook-picker-title-font-size: 1rem;--chook-picker-title-font-weight: 500;--chook-picker-title-color: #323233;--chook-picker-title-padding: 0 1rem;--chook-picker-confirm-color: #1989fa;--chook-picker-confirm-font-size: .875rem;--chook-picker-confirm-padding: 0 1rem 0 0;--chook-picker-cancel-color: #969799;--chook-picker-cancel-font-size: .875rem;--chook-picker-cancel-padding: 0 0 0 1rem;--chook-picker-active-opacity: .6;--chook-picker-columns-margin: 0 1rem;--chook-picker-columns-backdrop: linear-gradient( to bottom, #f2f2f2 0px, #f2f2f2 .0625rem, transparent .0625rem, transparent calc(100% - .0625rem) , #f2f2f2 calc(100% - .0625rem) , #f2f2f2 100% );--chook-picker-mask-backdrop: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4)), linear-gradient(0deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4));--chook-picker-column-label-color: #323233;--chook-picker-column-label-padding: 0 .25rem;--chook-picker-column-font-size: 1rem;--chook-picker-column-font-weight: 500}.chook-picker-mask{position:fixed;inset:0;background:var(--chook-picker-mask-background);z-index:calc(var(--chook-picker-z-index) - 1)}.chook-picker-container{position:fixed;left:0;bottom:0;width:100vw;z-index:var(--chook-picker-z-index);-webkit-user-select:none;user-select:none;padding-bottom:var(--chook-picker-padding-bottom);background:var(--chook-picker-background);border-top-left-radius:var(--chook-picker-border-radius);border-top-right-radius:var(--chook-picker-border-radius)}.chook-picker-header{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;justify-content:space-between;padding:var(--chook-picker-header-padding);margin-bottom:var(--chook-picker-header-margin-bottom)}.chook-picker-title{grid-column:span 2;text-align:center;font-size:var(--chook-picker-title-font-size);font-weight:var(--chook-picker-title-font-weight);color:var(--chook-picker-title-color);padding:var(--chook-picker-title-padding);text-overflow:ellipsis;overflow:hidden;white-space:nowrap;margin:0}.chook-picker-columns{width:calc(100% - var(--chook-picker-columns-margin) * 2);height:13.5rem;overflow:hidden;position:relative;display:flex;margin:var(--chook-picker-columns-margin)}.chook-picker-columns-backdrop{background-image:var(--chook-picker-columns-backdrop);background-repeat:no-repeat;background-position:center;background-size:100% 3rem}.chook-picker-mask-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;background-image:var(--chook-picker-mask-backdrop);background-repeat:no-repeat;background-position:top,bottom;background-size:100% 5.25rem}.chook-picker-loading{height:100%;width:100%;position:absolute;top:0;left:0}.chook-picker-column{flex:1 1 0%;overflow:hidden;padding:5.375rem 0;cursor:grab}.chook-picker-column ul{margin:0;padding:0;list-style:none}.chook-picker-column-item{height:3rem;display:flex;justify-content:center;align-items:center;cursor:grab}.chook-picker-column-label{color:var(--chook-picker-column-label-color);font-size:var(--chook-picker-column-font-size);font-weight:var(--chook-picker-column-font-weight);padding:var(--chook-picker-column-label-padding);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}button.chook-picker-confirm{color:var(--chook-picker-confirm-color);font-size:var(--chook-picker-confirm-font-size);background-color:transparent;padding:var(--chook-picker-confirm-padding);text-align:right;border:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}button.chook-picker-confirm:active{opacity:var(--chook-picker-active-opacity)}button.chook-picker-confirm:hover{color:var(--chook-picker-confirm-color);background-color:transparent}button.chook-picker-cancel{color:var(--chook-picker-cancel-color);font-size:var(--chook-picker-cancel-font-size);background-color:transparent;padding:var(--chook-picker-cancel-padding);text-align:left;border:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}button.chook-picker-cancel:active{opacity:var(--chook-picker-active-opacity)}button.chook-picker-cancel:hover{color:var(--chook-picker-cancel-color);background-color:transparent}.chook-picker-fade-enter{opacity:0}.chook-picker-fade-enter-active{opacity:1;transition:all .3s ease}.chook-picker-fade-exit-active{opacity:0;transition:all .3s ease}.chook-picker-slide-enter{opacity:.5;transform:translate3d(0,100%,0)}.chook-picker-slide-enter-active{transition:all .3s ease;opacity:1;transform:translateZ(0)}.chook-picker-slide-exit-active{transition:all .3s ease;opacity:.5;transform:translate3d(0,100%,0)}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(nr);function Gr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ae={exports:{}},Oe={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.min.js
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var or;function Jr(){if(or)return
|
|
10
|
+
*/var or;function Jr(){if(or)return Oe;or=1;var r=_,o=Symbol.for("react.element"),c=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,u){var p,m={},E=null,b=null;u!==void 0&&(E=""+u),l.key!==void 0&&(E=""+l.key),l.ref!==void 0&&(b=l.ref);for(p in l)t.call(l,p)&&!n.hasOwnProperty(p)&&(m[p]=l[p]);if(a&&a.defaultProps)for(p in l=a.defaultProps,l)m[p]===void 0&&(m[p]=l[p]);return{$$typeof:o,type:a,key:E,ref:b,props:m,_owner:i.current}}return Oe.Fragment=c,Oe.jsx=s,Oe.jsxs=s,Oe}var Re={};/**
|
|
11
11
|
* @license React
|
|
12
12
|
* react-jsx-runtime.development.js
|
|
13
13
|
*
|
|
@@ -15,36 +15,36 @@
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var ir;function Kr(){return ir||(ir=1,process.env.NODE_ENV!=="production"&&function(){var
|
|
19
|
-
`+P+
|
|
20
|
-
`),ce=
|
|
21
|
-
`),ie
|
|
22
|
-
|
|
18
|
+
*/var ir;function Kr(){return ir||(ir=1,process.env.NODE_ENV!=="production"&&function(){var r=_,o=Symbol.for("react.element"),c=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),q=Symbol.iterator,O="@@iterator";function U(e){if(e===null||typeof e!="object")return null;var d=q&&e[q]||e[O];return typeof d=="function"?d:null}var W=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function H(e){{for(var d=arguments.length,y=new Array(d>1?d-1:0),C=1;C<d;C++)y[C-1]=arguments[C];$("error",e,y)}}function $(e,d,y){{var C=W.ReactDebugCurrentFrame,B=C.getStackAddendum();B!==""&&(d+="%s",y=y.concat([B]));var K=y.map(function(F){return String(F)});K.unshift("Warning: "+d),Function.prototype.apply.call(console[e],console,K)}}var w=!1,h=!1,re=!1,fe=!1,ue=!1,ee;ee=Symbol.for("react.module.reference");function L(e){return!!(typeof e=="string"||typeof e=="function"||e===t||e===n||ue||e===i||e===u||e===p||fe||e===b||w||h||re||typeof e=="object"&&e!==null&&(e.$$typeof===E||e.$$typeof===m||e.$$typeof===s||e.$$typeof===a||e.$$typeof===l||e.$$typeof===ee||e.getModuleId!==void 0))}function Y(e,d,y){var C=e.displayName;if(C)return C;var B=d.displayName||d.name||"";return B!==""?y+"("+B+")":y}function Q(e){return e.displayName||"Context"}function te(e){if(e==null)return null;if(typeof e.tag=="number"&&H("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case t:return"Fragment";case c:return"Portal";case n:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case a:var d=e;return Q(d)+".Consumer";case s:var y=e;return Q(y._context)+".Provider";case l:return Y(e,e.render,"ForwardRef");case m:var C=e.displayName||null;return C!==null?C:te(e.type)||"Memo";case E:{var B=e,K=B._payload,F=B._init;try{return te(F(K))}catch{return null}}}return null}var A=Object.assign,G=0,j,ne,J,oe,f,v,T;function k(){}k.__reactDisabledLog=!0;function x(){{if(G===0){j=console.log,ne=console.info,J=console.warn,oe=console.error,f=console.group,v=console.groupCollapsed,T=console.groupEnd;var e={configurable:!0,enumerable:!0,value:k,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}G++}}function M(){{if(G--,G===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:j}),info:A({},e,{value:ne}),warn:A({},e,{value:J}),error:A({},e,{value:oe}),group:A({},e,{value:f}),groupCollapsed:A({},e,{value:v}),groupEnd:A({},e,{value:T})})}G<0&&H("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var R=W.ReactCurrentDispatcher,P;function I(e,d,y){{if(P===void 0)try{throw Error()}catch(B){var C=B.stack.trim().match(/\n( *(at )?)/);P=C&&C[1]||""}return`
|
|
19
|
+
`+P+e}}var V=!1,D;{var se=typeof WeakMap=="function"?WeakMap:Map;D=new se}function g(e,d){if(!e||V)return"";{var y=D.get(e);if(y!==void 0)return y}var C;V=!0;var B=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var K;K=R.current,R.current=null,x();try{if(d){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(le){C=le}Reflect.construct(e,[],F)}else{try{F.call()}catch(le){C=le}e.call(F.prototype)}}else{try{throw Error()}catch(le){C=le}e()}}catch(le){if(le&&C&&typeof le.stack=="string"){for(var N=le.stack.split(`
|
|
20
|
+
`),ce=C.stack.split(`
|
|
21
|
+
`),ie=N.length-1,ae=ce.length-1;ie>=1&&ae>=0&&N[ie]!==ce[ae];)ae--;for(;ie>=1&&ae>=0;ie--,ae--)if(N[ie]!==ce[ae]){if(ie!==1||ae!==1)do if(ie--,ae--,ae<0||N[ie]!==ce[ae]){var pe=`
|
|
22
|
+
`+N[ie].replace(" at new "," at ");return e.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",e.displayName)),typeof e=="function"&&D.set(e,pe),pe}while(ie>=1&&ae>=0);break}}}finally{V=!1,R.current=K,M(),Error.prepareStackTrace=B}var Se=e?e.displayName||e.name:"",Ee=Se?I(Se):"";return typeof e=="function"&&D.set(e,Ee),Ee}function de(e,d,y){return g(e,!1)}function Te(e){var d=e.prototype;return!!(d&&d.isReactComponent)}function ye(e,d,y){if(e==null)return"";if(typeof e=="function")return g(e,Te(e));if(typeof e=="string")return I(e);switch(e){case u:return I("Suspense");case p:return I("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return de(e.render);case m:return ye(e.type,d,y);case E:{var C=e,B=C._payload,K=C._init;try{return ye(K(B),d,y)}catch{}}}return""}var Pe=Object.prototype.hasOwnProperty,Dr={},Nr=W.ReactDebugCurrentFrame;function Ye(e){if(e){var d=e._owner,y=ye(e.type,e._source,d?d.type:null);Nr.setExtraStackFrame(y)}else Nr.setExtraStackFrame(null)}function Lt(e,d,y,C,B){{var K=Function.call.bind(Pe);for(var F in e)if(K(e,F)){var N=void 0;try{if(typeof e[F]!="function"){var ce=Error((C||"React class")+": "+y+" type `"+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[F]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ce.name="Invariant Violation",ce}N=e[F](d,F,C,y,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ie){N=ie}N&&!(N instanceof Error)&&(Ye(B),H("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",C||"React class",y,F,typeof N),Ye(null)),N instanceof Error&&!(N.message in Dr)&&(Dr[N.message]=!0,Ye(B),H("Failed %s type: %s",y,N.message),Ye(null))}}}var Vt=Array.isArray;function Ze(e){return Vt(e)}function Ut(e){{var d=typeof Symbol=="function"&&Symbol.toStringTag,y=d&&e[Symbol.toStringTag]||e.constructor.name||"Object";return y}}function Wt(e){try{return Yr(e),!1}catch{return!0}}function Yr(e){return""+e}function $r(e){if(Wt(e))return H("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ut(e)),Yr(e)}var Fr=W.ReactCurrentOwner,qt={key:!0,ref:!0,__self:!0,__source:!0},Lr,Vr;function zt(e){if(Pe.call(e,"ref")){var d=Object.getOwnPropertyDescriptor(e,"ref").get;if(d&&d.isReactWarning)return!1}return e.ref!==void 0}function Xt(e){if(Pe.call(e,"key")){var d=Object.getOwnPropertyDescriptor(e,"key").get;if(d&&d.isReactWarning)return!1}return e.key!==void 0}function Ht(e,d){typeof e.ref=="string"&&Fr.current}function Bt(e,d){{var y=function(){Lr||(Lr=!0,H("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};y.isReactWarning=!0,Object.defineProperty(e,"key",{get:y,configurable:!0})}}function Gt(e,d){{var y=function(){Vr||(Vr=!0,H("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};y.isReactWarning=!0,Object.defineProperty(e,"ref",{get:y,configurable:!0})}}var Jt=function(e,d,y,C,B,K,F){var N={$$typeof:o,type:e,key:d,ref:y,props:F,_owner:K};return N._store={},Object.defineProperty(N._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(N,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(N,"_source",{configurable:!1,enumerable:!1,writable:!1,value:B}),Object.freeze&&(Object.freeze(N.props),Object.freeze(N)),N};function Kt(e,d,y,C,B){{var K,F={},N=null,ce=null;y!==void 0&&($r(y),N=""+y),Xt(d)&&($r(d.key),N=""+d.key),zt(d)&&(ce=d.ref,Ht(d,B));for(K in d)Pe.call(d,K)&&!qt.hasOwnProperty(K)&&(F[K]=d[K]);if(e&&e.defaultProps){var ie=e.defaultProps;for(K in ie)F[K]===void 0&&(F[K]=ie[K])}if(N||ce){var ae=typeof e=="function"?e.displayName||e.name||"Unknown":e;N&&Bt(F,ae),ce&&Gt(F,ae)}return Jt(e,N,ce,B,C,Fr.current,F)}}var Qe=W.ReactCurrentOwner,Ur=W.ReactDebugCurrentFrame;function Ce(e){if(e){var d=e._owner,y=ye(e.type,e._source,d?d.type:null);Ur.setExtraStackFrame(y)}else Ur.setExtraStackFrame(null)}var er;er=!1;function rr(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function Wr(){{if(Qe.current){var e=te(Qe.current.type);if(e)return`
|
|
23
23
|
|
|
24
|
-
Check the render method of \``+
|
|
24
|
+
Check the render method of \``+e+"`."}return""}}function Zt(e){return""}var qr={};function Qt(e){{var d=Wr();if(!d){var y=typeof e=="string"?e:e.displayName||e.name;y&&(d=`
|
|
25
25
|
|
|
26
|
-
Check the top-level render call using <`+y+">.")}return d}}function zr(
|
|
26
|
+
Check the top-level render call using <`+y+">.")}return d}}function zr(e,d){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var y=Qt(d);if(qr[y])return;qr[y]=!0;var C="";e&&e._owner&&e._owner!==Qe.current&&(C=" It was passed a child from "+te(e._owner.type)+"."),Ce(e),H('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',y,C),Ce(null)}}function Xr(e,d){{if(typeof e!="object")return;if(Ze(e))for(var y=0;y<e.length;y++){var C=e[y];rr(C)&&zr(C,d)}else if(rr(e))e._store&&(e._store.validated=!0);else if(e){var B=U(e);if(typeof B=="function"&&B!==e.entries)for(var K=B.call(e),F;!(F=K.next()).done;)rr(F.value)&&zr(F.value,d)}}}function en(e){{var d=e.type;if(d==null||typeof d=="string")return;var y;if(typeof d=="function")y=d.propTypes;else if(typeof d=="object"&&(d.$$typeof===l||d.$$typeof===m))y=d.propTypes;else return;if(y){var C=te(d);Lt(y,e.props,"prop",C,e)}else if(d.PropTypes!==void 0&&!er){er=!0;var B=te(d);H("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",B||"Unknown")}typeof d.getDefaultProps=="function"&&!d.getDefaultProps.isReactClassApproved&&H("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function rn(e){{for(var d=Object.keys(e.props),y=0;y<d.length;y++){var C=d[y];if(C!=="children"&&C!=="key"){Ce(e),H("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",C),Ce(null);break}}e.ref!==null&&(Ce(e),H("Invalid attribute `ref` supplied to `React.Fragment`."),Ce(null))}}var Hr={};function Br(e,d,y,C,B,K){{var F=L(e);if(!F){var N="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(N+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ce=Zt();ce?N+=ce:N+=Wr();var ie;e===null?ie="null":Ze(e)?ie="array":e!==void 0&&e.$$typeof===o?(ie="<"+(te(e.type)||"Unknown")+" />",N=" Did you accidentally export a JSX literal instead of a component?"):ie=typeof e,H("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ie,N)}var ae=Kt(e,d,y,B,K);if(ae==null)return ae;if(F){var pe=d.children;if(pe!==void 0)if(C)if(Ze(pe)){for(var Se=0;Se<pe.length;Se++)Xr(pe[Se],e);Object.freeze&&Object.freeze(pe)}else H("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Xr(pe,e)}if(Pe.call(d,"key")){var Ee=te(e),le=Object.keys(d).filter(function(cn){return cn!=="key"}),tr=le.length>0?"{key: someKey, "+le.join(": ..., ")+": ...}":"{key: someKey}";if(!Hr[Ee+tr]){var sn=le.length>0?"{"+le.join(": ..., ")+": ...}":"{}";H(`A props object containing a "key" prop is being spread into JSX:
|
|
27
27
|
let props = %s;
|
|
28
28
|
<%s {...props} />
|
|
29
29
|
React keys must be passed directly to JSX without using spread:
|
|
30
30
|
let props = %s;
|
|
31
|
-
<%s key={someKey} {...props} />`,tr,Ee,sn,Ee),Hr[Ee+tr]=!0}}return
|
|
31
|
+
<%s key={someKey} {...props} />`,tr,Ee,sn,Ee),Hr[Ee+tr]=!0}}return e===t?rn(ae):en(ae),ae}}function tn(e,d,y){return Br(e,d,y,!0)}function nn(e,d,y){return Br(e,d,y,!1)}var on=nn,an=tn;Re.Fragment=t,Re.jsx=on,Re.jsxs=an}()),Re}var ar;function Zr(){return ar||(ar=1,process.env.NODE_ENV==="production"?Ae.exports=Jr():Ae.exports=Kr()),Ae.exports}var Z=Zr();const Qr=Array.isArray;function et(r,o){if(cr(r))return"multiple";const[c]=r;return c?.[o.children]?"cascade":"single"}function rt(r){return{children:r?.children||"children",label:r?.label||"label",value:r?.value||"value"}}function tt(r,o,c){if(cr(r))return[];const t=[];let i=r,n=0;for(;i;){const s=o[n];let a=sr(i,s,c);a===-1&&(a=0),t.push(i),n+=1,i=i[a]?.[c.children]}return t}function nt(r,o,c,t){const i=[...c];let n=r,s=o+1;for(;n?.[t.children];){const a=n[t.children][0];i[s]=a.value,n=a,s+=1}return i}function sr(r,o,c){return r.findIndex(t=>t?.[c.value]===o)}function cr(r){const[o]=r;return Qr(o)}function ot(r,o){return r>o?"horizontal":o>r?"vertical":""}function be(r,o,c){const t=[];for(let i=r;i<=o;i++){const n=c(`${i}`);t.push({label:n,value:i})}return t}function ur(r,o){return r===o.getFullYear()}function lr(r,o){return r===o.getFullYear()}function it(r,o){return r===o.getMonth()+1}function at(r,o){return r===o.getMonth()+1}function st(r,o){return new Date(r,o,0).getDate()}function ct(r,o,c){const t=new Date,i=Date.now(),n=r.getTime(),s=o.getTime(),a=i>=n&&i<=s;return c==="year"?a?t.getFullYear():r.getFullYear():c==="month"?a?t.getMonth()+1:r.getMonth()+1:a?t.getDate():r.getDate()}function $e(r){return r}function ut(r){return/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(r)}function fr(r){if(!ut(r))return null;const[o,c,t]=r.split(":");return{hour:Number(o),minute:Number(c),second:Number(t)}}function Fe(r){return r.padStart(2,"0")}function lt(r,o,c){const t=Date.now(),{hour:i,minute:n,second:s}=r,{hour:a,minute:l,second:u}=o,p=new Date().setHours(i,n,s),m=new Date().setHours(a,l,u),E=t>=p&&t<=m;return c==="hour"?E?new Date().getHours():i:c==="minute"?E?new Date().getMinutes():n:E?new Date().getSeconds():s}function dr(r){return _.forwardRef(r)}const ft=16,je=48,dt=.52,pr=150,Le=300,pt=15,vt=.008,vr=5,ht="Select Date",mt=["year","month","day"],gt="Select Time",yt=["hour","minute","second"];function Et(){const r={startX:0,startY:0,deltaX:0,deltaY:0,offsetX:0,offsetY:0};let o="",c=!0;const t=()=>o==="vertical",i=()=>o==="horizontal";function n(){r.deltaX=0,r.deltaY=0,r.offsetX=0,r.offsetY=0,o="",c=!0}function s(u){const p="touches"in u?u.touches[0]:u;n(),r.startX=p.clientX,r.startY=p.clientY}function a(u){if(!r.startX||!r.startY)return!0;const p="touches"in u?u.touches[0]:u;r.deltaX=Math.max(p.clientX,0)-r.startX,r.deltaY=p.clientY-r.startY,r.offsetX=Math.abs(r.deltaX),r.offsetY=Math.abs(r.deltaY);const m=10;(!o||r.offsetX<m&&r.offsetY<m)&&(o=ot(r.offsetX,r.offsetY)),c&&(r.offsetX>vr||r.offsetY>vr)&&(c=!1)}function l(){r.startX=0,r.startY=0}return{pointer:r,move:a,start:s,stop:l,reset:n,isVertical:t,isHorizontal:i}}function bt({column:r,onChange:o}){const t=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)/ft,[i,n]=_.useState(0),[s,a]=_.useState(0),l=_.useRef(0),u=_.useRef(0),p=_.useRef(0),m=_.useRef(!1),E=_.useRef(null),{pointer:b,start:q,move:O,stop:U}=_.useMemo(()=>Et(),[]);function W(L){return L*t}function H(L){const Y=r.length,Q=Math.round(-L/W(je));return Q<0?0:Q>=Y?Y-1:Q}function $(L){const Y=-L*W(je),Q=()=>o?.(L);m.current&&Y!==i?E.current=Q:Q(),n(Y)}function w(L){q(L),m.current=!0,a(0),u.current=Date.now(),l.current=i,p.current=l.current,E.current=null}function h(L){if(O(L))return;const Q=r.length,te=l.current+b.deltaY,A=W((Q-1)*-je),G=Math.min(Math.max(te,A),0),j=Date.now();n(G),!(j-u.current<=Le)&&(u.current=j,p.current=G)}function re(){U();const L=i-p.current,Y=Date.now()-u.current;if(Y<Le&&Math.abs(L)>pt){fe(L,Y);return}const Q=H(i);a(pr),$(Q),m.current=!1}function fe(L,Y){const Q=Math.abs(L/Y),te=i+Q/vt*(L<0?-1:1),A=H(te);a(Le),$(A)}function ue(){a(0),m.current=!1,E.current&&(E.current(),E.current=null)}function ee(L,Y="auto"){m.current&&Y==="smooth"||(E.current=null,m.current=Y==="smooth",a(Y==="smooth"?pr:0),$(L))}return{offsetY:i,transitionDuration:s,onPointerDown:w,onPointerMove:h,onPointerUp:re,stopInertialSliding:ue,scrollToIndex:ee}}function kt({column:r,fields:o,selectedIndex:c=0,onChange:t},i){const{offsetY:n,transitionDuration:s,onPointerDown:a,onPointerMove:l,onPointerUp:u,stopInertialSliding:p,scrollToIndex:m}=bt({column:r,onChange:E});_.useImperativeHandle(i,()=>({scrollToSelected:b}));function E(O){O!==c&&t(O)}function b(O=c,U){m(O,U)}function q(O){O!==c&&b(O,"smooth")}return Z.jsx("div",{role:"presentation",className:"chook-picker-column",onTouchStart:a,onTouchMove:l,onTouchEnd:u,onTouchCancel:u,onMouseDown:a,onMouseMove:l,onMouseUp:u,children:Z.jsx("ul",{style:{overflowY:"hidden",transform:`translate3d(0, ${n}px, 0)`,transitionDuration:`${s}ms`,transitionProperty:s?"all":"none"},onTransitionEnd:p,children:r.map((O,U)=>Z.jsx("div",{tabIndex:0,role:"button","aria-label":"Select option",className:"chook-picker-column-item",onClick:()=>q(U),onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&q(U)},children:Z.jsx("p",{className:"chook-picker-column-label",style:{transform:`rotate3d(1, 0, 0, ${(U*je+n)*dt}deg)`},children:O?.[o.label]})},O?.[o.value]))})})}const hr=dr(kt);hr.displayName="Column";function xt(r,o){const{loading:c,loadingSlot:t,columns:i,emptySlot:n,currentColumns:s,fields:a,selectedIndices:l,updateSelectedValueByIndex:u}=r,p=_.useRef([]);_.useImperativeHandle(o,()=>({scrollColumnToSelected:m}));function m(E,b){p.current[E]?.scrollToSelected(b)}return c?Z.jsxs(Z.Fragment,{children:[Z.jsx("div",{className:"chook-picker-loading",children:t}),Z.jsx("div",{className:"chook-picker-columns"})]}):i.length?Z.jsxs("div",{className:"chook-picker-columns chook-picker-columns-backdrop",onTouchMove:E=>E.stopPropagation(),children:[s.map((E,b)=>Z.jsx(hr,{ref:q=>p.current[b]=q,column:E,fields:a,selectedIndex:l[b],onChange:q=>u(b,q)},b)),Z.jsx("div",{className:"chook-picker-mask-backdrop"})]}):Z.jsx("div",{className:"chook-picker-columns",children:n})}const mr=dr(xt);mr.displayName="Columns";function Me(){return Me=Object.assign?Object.assign.bind():function(r){for(var o=1;o<arguments.length;o++){var c=arguments[o];for(var t in c)({}).hasOwnProperty.call(c,t)&&(r[t]=c[t])}return r},Me.apply(null,arguments)}function gr(r,o){if(r==null)return{};var c={};for(var t in r)if({}.hasOwnProperty.call(r,t)){if(o.indexOf(t)!==-1)continue;c[t]=r[t]}return c}function Ve(r,o){return Ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,t){return c.__proto__=t,c},Ve(r,o)}function yr(r,o){r.prototype=Object.create(o.prototype),r.prototype.constructor=r,Ve(r,o)}var Ie={exports:{}},De={exports:{}},z={};/** @license React v16.13.1
|
|
32
32
|
* react-is.production.min.js
|
|
33
33
|
*
|
|
34
34
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
35
35
|
*
|
|
36
36
|
* This source code is licensed under the MIT license found in the
|
|
37
37
|
* LICENSE file in the root directory of this source tree.
|
|
38
|
-
*/var Er;function Tt(){if(Er)return z;Er=1;var
|
|
38
|
+
*/var Er;function Tt(){if(Er)return z;Er=1;var r=typeof Symbol=="function"&&Symbol.for,o=r?Symbol.for("react.element"):60103,c=r?Symbol.for("react.portal"):60106,t=r?Symbol.for("react.fragment"):60107,i=r?Symbol.for("react.strict_mode"):60108,n=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,a=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,u=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,E=r?Symbol.for("react.suspense_list"):60120,b=r?Symbol.for("react.memo"):60115,q=r?Symbol.for("react.lazy"):60116,O=r?Symbol.for("react.block"):60121,U=r?Symbol.for("react.fundamental"):60117,W=r?Symbol.for("react.responder"):60118,H=r?Symbol.for("react.scope"):60119;function $(h){if(typeof h=="object"&&h!==null){var re=h.$$typeof;switch(re){case o:switch(h=h.type,h){case l:case u:case t:case n:case i:case m:return h;default:switch(h=h&&h.$$typeof,h){case a:case p:case q:case b:case s:return h;default:return re}}case c:return re}}}function w(h){return $(h)===u}return z.AsyncMode=l,z.ConcurrentMode=u,z.ContextConsumer=a,z.ContextProvider=s,z.Element=o,z.ForwardRef=p,z.Fragment=t,z.Lazy=q,z.Memo=b,z.Portal=c,z.Profiler=n,z.StrictMode=i,z.Suspense=m,z.isAsyncMode=function(h){return w(h)||$(h)===l},z.isConcurrentMode=w,z.isContextConsumer=function(h){return $(h)===a},z.isContextProvider=function(h){return $(h)===s},z.isElement=function(h){return typeof h=="object"&&h!==null&&h.$$typeof===o},z.isForwardRef=function(h){return $(h)===p},z.isFragment=function(h){return $(h)===t},z.isLazy=function(h){return $(h)===q},z.isMemo=function(h){return $(h)===b},z.isPortal=function(h){return $(h)===c},z.isProfiler=function(h){return $(h)===n},z.isStrictMode=function(h){return $(h)===i},z.isSuspense=function(h){return $(h)===m},z.isValidElementType=function(h){return typeof h=="string"||typeof h=="function"||h===t||h===u||h===n||h===i||h===m||h===E||typeof h=="object"&&h!==null&&(h.$$typeof===q||h.$$typeof===b||h.$$typeof===s||h.$$typeof===a||h.$$typeof===p||h.$$typeof===U||h.$$typeof===W||h.$$typeof===H||h.$$typeof===O)},z.typeOf=$,z}var X={};/** @license React v16.13.1
|
|
39
39
|
* react-is.development.js
|
|
40
40
|
*
|
|
41
41
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the MIT license found in the
|
|
44
44
|
* LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/var br;function
|
|
45
|
+
*/var br;function Ct(){return br||(br=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,o=r?Symbol.for("react.element"):60103,c=r?Symbol.for("react.portal"):60106,t=r?Symbol.for("react.fragment"):60107,i=r?Symbol.for("react.strict_mode"):60108,n=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,a=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,u=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,E=r?Symbol.for("react.suspense_list"):60120,b=r?Symbol.for("react.memo"):60115,q=r?Symbol.for("react.lazy"):60116,O=r?Symbol.for("react.block"):60121,U=r?Symbol.for("react.fundamental"):60117,W=r?Symbol.for("react.responder"):60118,H=r?Symbol.for("react.scope"):60119;function $(g){return typeof g=="string"||typeof g=="function"||g===t||g===u||g===n||g===i||g===m||g===E||typeof g=="object"&&g!==null&&(g.$$typeof===q||g.$$typeof===b||g.$$typeof===s||g.$$typeof===a||g.$$typeof===p||g.$$typeof===U||g.$$typeof===W||g.$$typeof===H||g.$$typeof===O)}function w(g){if(typeof g=="object"&&g!==null){var de=g.$$typeof;switch(de){case o:var Te=g.type;switch(Te){case l:case u:case t:case n:case i:case m:return Te;default:var ye=Te&&Te.$$typeof;switch(ye){case a:case p:case q:case b:case s:return ye;default:return de}}case c:return de}}}var h=l,re=u,fe=a,ue=s,ee=o,L=p,Y=t,Q=q,te=b,A=c,G=n,j=i,ne=m,J=!1;function oe(g){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),f(g)||w(g)===l}function f(g){return w(g)===u}function v(g){return w(g)===a}function T(g){return w(g)===s}function k(g){return typeof g=="object"&&g!==null&&g.$$typeof===o}function x(g){return w(g)===p}function M(g){return w(g)===t}function R(g){return w(g)===q}function P(g){return w(g)===b}function I(g){return w(g)===c}function V(g){return w(g)===n}function D(g){return w(g)===i}function se(g){return w(g)===m}X.AsyncMode=h,X.ConcurrentMode=re,X.ContextConsumer=fe,X.ContextProvider=ue,X.Element=ee,X.ForwardRef=L,X.Fragment=Y,X.Lazy=Q,X.Memo=te,X.Portal=A,X.Profiler=G,X.StrictMode=j,X.Suspense=ne,X.isAsyncMode=oe,X.isConcurrentMode=f,X.isContextConsumer=v,X.isContextProvider=T,X.isElement=k,X.isForwardRef=x,X.isFragment=M,X.isLazy=R,X.isMemo=P,X.isPortal=I,X.isProfiler=V,X.isStrictMode=D,X.isSuspense=se,X.isValidElementType=$,X.typeOf=w}()),X}var kr;function xr(){return kr||(kr=1,process.env.NODE_ENV==="production"?De.exports=Tt():De.exports=Ct()),De.exports}/*
|
|
46
46
|
object-assign
|
|
47
47
|
(c) Sindre Sorhus
|
|
48
48
|
@license MIT
|
|
49
|
-
*/var Ue,Tr;function
|
|
50
|
-
Valid keys: `+JSON.stringify(Object.keys(l),null," "));var g=se(P,Y,S,j,O+"."+Y,c);if(g)return g}return null}return D(m)}function M(l){switch(typeof l){case"number":case"string":case"undefined":return!0;case"boolean":return!l;case"object":if(Array.isArray(l))return l.every(M);if(l===null||a(l))return!0;var m=h(l);if(m){var b=m.call(l),x;if(m!==l.entries){for(;!(x=b.next()).done;)if(!M(x.value))return!1}else for(;!(x=b.next()).done;){var S=x.value;if(S&&!M(S[1]))return!1}}else return!1;return!0;default:return!1}}function G(l,m){return l==="symbol"?!0:m?m["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&m instanceof Symbol:!1}function I(l){var m=typeof l;return Array.isArray(l)?"array":l instanceof RegExp?"object":G(m,l)?"symbol":m}function ne(l){if(typeof l>"u"||l===null)return""+l;var m=I(l);if(m==="object"){if(l instanceof Date)return"date";if(l instanceof RegExp)return"regexp"}return m}function J(l){var m=ne(l);switch(m){case"array":case"object":return"an "+m;case"boolean":case"date":case"regexp":return"a "+m;default:return m}}function oe(l){return!l.constructor||!l.constructor.name?E:l.constructor.name}return T.checkPropTypes=i,T.resetWarningCache=i.resetWarningCache,T.PropTypes=T,T},He}var Be,wr;function Rt(){if(wr)return Be;wr=1;var e=qe();function o(){}function c(){}return c.resetWarningCache=o,Be=function(){function t(s,a,u,f,p,h){if(h!==e){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}t.isRequired=t;function i(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:i,element:t,elementType:t,instanceOf:i,node:t,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n},Be}var Pr;function wt(){if(Pr)return Ie.exports;if(Pr=1,process.env.NODE_ENV!=="production"){var e=xr(),o=!0;Ie.exports=Ct()(e.isElement,o)}else Ie.exports=Rt()();return Ie.exports}var Pt=wt();const C=Gr(Pt);function At(e,o){return e.classList?!!o&&e.classList.contains(o):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+o+" ")!==-1}function jt(e,o){e.classList?e.classList.add(o):At(e,o)||(typeof e.className=="string"?e.className=e.className+" "+o:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+o))}function Ar(e,o){return e.replace(new RegExp("(^|\\s)"+o+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Mt(e,o){e.classList?e.classList.remove(o):typeof e.className=="string"?e.className=Ar(e.className,o):e.setAttribute("class",Ar(e.className&&e.className.baseVal||"",o))}const jr={disabled:!1};var It=process.env.NODE_ENV!=="production"?C.oneOfType([C.number,C.shape({enter:C.number,exit:C.number,appear:C.number}).isRequired]):null,Dt=process.env.NODE_ENV!=="production"?C.oneOfType([C.string,C.shape({enter:C.string,exit:C.string,active:C.string}),C.shape({enter:C.string,enterDone:C.string,enterActive:C.string,exit:C.string,exitDone:C.string,exitActive:C.string})]):null;const Mr=R.createContext(null);var Ir=function(o){return o.scrollTop},we="unmounted",me="exited",ge="entering",ke="entered",Ge="exiting",he=function(e){yr(o,e);function o(t,i){var n;n=e.call(this,t,i)||this;var s=i,a=s&&!s.isMounting?t.enter:t.appear,u;return n.appearStatus=null,t.in?a?(u=me,n.appearStatus=ge):u=ke:t.unmountOnExit||t.mountOnEnter?u=we:u=me,n.state={status:u},n.nextCallback=null,n}o.getDerivedStateFromProps=function(i,n){var s=i.in;return s&&n.status===we?{status:me}:null};var c=o.prototype;return c.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},c.componentDidUpdate=function(i){var n=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==ge&&s!==ke&&(n=ge):(s===ge||s===ke)&&(n=Ge)}this.updateStatus(!1,n)},c.componentWillUnmount=function(){this.cancelNextCallback()},c.getTimeouts=function(){var i=this.props.timeout,n,s,a;return n=s=a=i,i!=null&&typeof i!="number"&&(n=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:n,enter:s,appear:a}},c.updateStatus=function(i,n){if(i===void 0&&(i=!1),n!==null)if(this.cancelNextCallback(),n===ge){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:Oe.findDOMNode(this);s&&Ir(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===me&&this.setState({status:we})},c.performEnter=function(i){var n=this,s=this.props.enter,a=this.context?this.context.isMounting:i,u=this.props.nodeRef?[a]:[Oe.findDOMNode(this),a],f=u[0],p=u[1],h=this.getTimeouts(),E=a?h.appear:h.enter;if(!i&&!s||jr.disabled){this.safeSetState({status:ke},function(){n.props.onEntered(f)});return}this.props.onEnter(f,p),this.safeSetState({status:ge},function(){n.props.onEntering(f,p),n.onTransitionEnd(E,function(){n.safeSetState({status:ke},function(){n.props.onEntered(f,p)})})})},c.performExit=function(){var i=this,n=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:Oe.findDOMNode(this);if(!n||jr.disabled){this.safeSetState({status:me},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:Ge},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:me},function(){i.props.onExited(a)})})})},c.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},c.safeSetState=function(i,n){n=this.setNextCallback(n),this.setState(i,n)},c.setNextCallback=function(i){var n=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,n.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},c.onTransitionEnd=function(i,n){this.setNextCallback(n);var s=this.props.nodeRef?this.props.nodeRef.current:Oe.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],f=u[0],p=u[1];this.props.addEndListener(f,p)}i!=null&&setTimeout(this.nextCallback,i)},c.render=function(){var i=this.state.status;if(i===we)return null;var n=this.props,s=n.children;n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef;var a=gr(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return R.createElement(Mr.Provider,{value:null},typeof s=="function"?s(i,a):R.cloneElement(R.Children.only(s),a))},o}(R.Component);he.contextType=Mr,he.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:C.shape({current:typeof Element>"u"?C.any:function(e,o,c,t,i,n){var s=e[o];return C.instanceOf(s&&"ownerDocument"in s?s.ownerDocument.defaultView.Element:Element)(e,o,c,t,i,n)}}),children:C.oneOfType([C.func.isRequired,C.element.isRequired]).isRequired,in:C.bool,mountOnEnter:C.bool,unmountOnExit:C.bool,appear:C.bool,enter:C.bool,exit:C.bool,timeout:function(o){var c=It;o.addEndListener||(c=c.isRequired);for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return c.apply(void 0,[o].concat(i))},addEndListener:C.func,onEnter:C.func,onEntering:C.func,onEntered:C.func,onExit:C.func,onExiting:C.func,onExited:C.func}:{};function xe(){}he.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:xe,onEntering:xe,onEntered:xe,onExit:xe,onExiting:xe,onExited:xe},he.UNMOUNTED=we,he.EXITED=me,he.ENTERING=ge,he.ENTERED=ke,he.EXITING=Ge;var Nt=function(o,c){return o&&c&&c.split(" ").forEach(function(t){return jt(o,t)})},Je=function(o,c){return o&&c&&c.split(" ").forEach(function(t){return Mt(o,t)})},Ne=function(e){yr(o,e);function o(){for(var t,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];return t=e.call.apply(e,[this].concat(n))||this,t.appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(a,u){var f=t.resolveArguments(a,u),p=f[0],h=f[1];t.removeClasses(p,"exit"),t.addClass(p,h?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(a,u)},t.onEntering=function(a,u){var f=t.resolveArguments(a,u),p=f[0],h=f[1],E=h?"appear":"enter";t.addClass(p,E,"active"),t.props.onEntering&&t.props.onEntering(a,u)},t.onEntered=function(a,u){var f=t.resolveArguments(a,u),p=f[0],h=f[1],E=h?"appear":"enter";t.removeClasses(p,E),t.addClass(p,E,"done"),t.props.onEntered&&t.props.onEntered(a,u)},t.onExit=function(a){var u=t.resolveArguments(a),f=u[0];t.removeClasses(f,"appear"),t.removeClasses(f,"enter"),t.addClass(f,"exit","base"),t.props.onExit&&t.props.onExit(a)},t.onExiting=function(a){var u=t.resolveArguments(a),f=u[0];t.addClass(f,"exit","active"),t.props.onExiting&&t.props.onExiting(a)},t.onExited=function(a){var u=t.resolveArguments(a),f=u[0];t.removeClasses(f,"exit"),t.addClass(f,"exit","done"),t.props.onExited&&t.props.onExited(a)},t.resolveArguments=function(a,u){return t.props.nodeRef?[t.props.nodeRef.current,a]:[a,u]},t.getClassNames=function(a){var u=t.props.classNames,f=typeof u=="string",p=f&&u?u+"-":"",h=f?""+p+a:u[a],E=f?h+"-active":u[a+"Active"],T=f?h+"-done":u[a+"Done"];return{baseClassName:h,activeClassName:E,doneClassName:T}},t}var c=o.prototype;return c.addClass=function(i,n,s){var a=this.getClassNames(n)[s+"ClassName"],u=this.getClassNames("enter"),f=u.doneClassName;n==="appear"&&s==="done"&&f&&(a+=" "+f),s==="active"&&i&&Ir(i),a&&(this.appliedClasses[n][s]=a,Nt(i,a))},c.removeClasses=function(i,n){var s=this.appliedClasses[n],a=s.base,u=s.active,f=s.done;this.appliedClasses[n]={},a&&Je(i,a),u&&Je(i,u),f&&Je(i,f)},c.render=function(){var i=this.props;i.classNames;var n=gr(i,["classNames"]);return R.createElement(he,Me({},n,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},o}(R.Component);Ne.defaultProps={classNames:""},Ne.propTypes=process.env.NODE_ENV!=="production"?Me({},he.propTypes,{classNames:Dt,onEnter:C.func,onEntering:C.func,onEntered:C.func,onExit:C.func,onExiting:C.func,onExited:C.func}):{};function Yt({show:e,onClose:o,onOpen:c,onClosed:t,children:i,teleport:n=document.body}){const s=R.useRef(null),a=R.useRef(null);R.useEffect(()=>(e?(document.body.style.overflow="hidden",c==null||c()):document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]);function u(f){s.current&&(s.current.style.setProperty("display",f),f==="none"&&(t==null||t()))}return Oe.createPortal(Z.jsxs(Z.Fragment,{children:[Z.jsx(Ne,{in:e,timeout:300,nodeRef:a,classNames:"chook-picker-fade",unmountOnExit:!0,children:Z.jsx("div",{ref:a,role:"presentation",className:"chook-picker-mask",onClick:o,onKeyDown:f=>{f.key==="Escape"&&o()}})}),Z.jsx(Ne,{in:e,timeout:300,nodeRef:s,classNames:"chook-picker-slide",onEnter:()=>u(""),onExited:()=>u("none"),children:Z.jsx("div",{ref:s,className:"chook-picker-container",style:{display:"none"},children:i})})]}),n)}function Ke({show:e,values:o,title:c,columns:t,linkage:i=!1,loading:n=!1,loadingSlot:s,emptySlot:a,teleport:u,confirmButtonText:f="Confirm",cancelButtonText:p="Cancel",columnsFieldNames:h,onConfirm:E,onClose:T,onChange:A,onCancel:k,onOpen:D,onClosed:L}){const[H,V]=R.useState([]),[w,v]=R.useState([]),[re,le]=R.useState([]),ue=R.useRef(null),ee=rt(h),W=et(t,ee),F=R.useMemo(()=>W==="single"?[t]:W==="multiple"?t:tt(t,w,ee),[t,W,w,ee]);R.useEffect(()=>{!o||o.every((oe,l)=>oe===w[l])||v(o)},[o]),R.useEffect(()=>{var m;const J=F.length,oe=[];let l=!1;for(let b=0;b<J;b++){const x=F[b],S=w[b],j=sr(x,S,ee);if(j===-1){const P=(re[b]??0)>=x.length?Math.max(x.length-1,0):0;oe[b]=P}else oe[b]=j;oe[b]!==re[b]&&((m=ue.current)==null||m.scrollColumnToSelected(b,oe[b]),l=!0)}l&&le(oe)},[w,F,ee]);function Q(J,oe){var S;const l=F[J],m=(S=l[oe])==null?void 0:S[ee.value],b=w[J];if(m===b)return;const x=[...w];if(x[J]=m,W==="cascade"){const j=l[oe],O=nt(j,J,x,ee);v(O),te(O)}else v(x),te(x)}function te(J){A==null||A(J),i&&V(J)}function M(){V(w),T(),E==null||E(w)}function G(){T(),k==null||k()}function I(){D==null||D()}function ne(){v(o?[...o]:[...H]),L==null||L()}return Z.jsxs(Yt,{show:e,teleport:u,onOpen:I,onClose:T,onClosed:ne,children:[Z.jsxs("div",{className:"chook-picker-header",children:[Z.jsx("button",{className:"chook-picker-cancel",onClick:G,children:p}),Z.jsx("p",{className:"chook-picker-title",children:c}),Z.jsx("button",{className:"chook-picker-confirm",onClick:M,children:f})]}),Z.jsx(mr,{ref:ue,loading:n,loadingSlot:s,columns:t,emptySlot:a,currentColumns:F,fields:ee,selectedIndices:re,updateSelectedValueByIndex:Q})]})}function $t({show:e,values:o,title:c=ht,columnsType:t=mt,minDate:i=new Date(new Date().getFullYear()-10,0,1),maxDate:n=new Date(new Date().getFullYear()+10,11,31),teleport:s,confirmButtonText:a,cancelButtonText:u,formatYearLabel:f=$e,formatMonthLabel:p=$e,formatDayLabel:h=$e,onConfirm:E,onClose:T,onCancel:A,onOpen:k,onClosed:D}){const[L,H]=R.useState([]),[V,w]=R.useState([]),v=R.useMemo(()=>{const M={year:re,month:le,day:ue};return t.map(G=>M[G]())},[t,i,n,V,f,p,h]);function re(){const M=i.getFullYear(),G=n.getFullYear();return be(M,G,f)}function le(){const M=ee("year"),G=ur(M,i)?i.getMonth()+1:1,I=fr(M,n)?n.getMonth()+1:12;return be(G,I,p)}function ue(){const M=ee("year"),G=ee("month"),I=ur(M,i)&&it(G,i),ne=fr(M,n)&&at(G,n),J=I?i.getDate():1,oe=ne?n.getDate():st(M,G);return be(J,oe,h)}function ee(M){const G=t.indexOf(M),I=V[G];return I?Number(I):ct(i,n,M)}function W(M){H(M),T(),E==null||E(M)}function F(){T(),A==null||A()}function Q(){k==null||k(),o&&o.length?w([...o]):w(t.map(ee))}function te(){w(o?[...o]:[...L]),D==null||D()}return Z.jsx(Ke,{values:V,show:e,title:c,columns:v,teleport:s,confirmButtonText:a,cancelButtonText:u,linkage:!0,onConfirm:W,onClose:T,onChange:w,onCancel:F,onOpen:Q,onClosed:te})}function Ft({show:e,values:o,title:c=gt,columnsType:t=yt,minTime:i,maxTime:n,teleport:s,confirmButtonText:a,cancelButtonText:u,formatHourLabel:f=Fe,formatMinuteLabel:p=Fe,formatSecondLabel:h=Fe,onConfirm:E,onClose:T,onCancel:A,onOpen:k,onClosed:D}){const[L,H]=R.useState([]),[V,w]=R.useState([]),v=R.useMemo(()=>lr(i??"")??{hour:0,minute:0,second:0},[i]),re=R.useMemo(()=>lr(n??"")??{hour:23,minute:59,second:59},[n]),le=R.useMemo(()=>{const I={hour:ue,minute:ee,second:W};return t.map(ne=>I[ne]())},[t,v,re,V,f,p,h]);function ue(){return be(v.hour,re.hour,f)}function ee(){const I=F("hour"),{hour:ne,minute:J}=v,{hour:oe,minute:l}=re;return be(I===ne?J:0,I===oe?l:59,p)}function W(){const I=F("hour"),ne=F("minute"),{hour:J,minute:oe,second:l}=v,{hour:m,minute:b,second:x}=re;return be(I===J&&ne===oe?l:0,I===m&&ne===b?x:59,h)}function F(I){const ne=t.indexOf(I),J=V[ne];return J!==void 0?Number(J):ft(v,re,I)}function Q(I){H(I),T(),E==null||E(I)}function te(){T(),A==null||A()}function M(){k==null||k(),o&&o.length?w([...o]):w(t.map(F))}function G(){w(o?[...o]:[...L]),D==null||D()}return Z.jsx(Ke,{values:V,show:e,title:c,columns:le,teleport:s,confirmButtonText:a,cancelButtonText:u,linkage:!0,onConfirm:Q,onClose:T,onChange:w,onCancel:te,onOpen:M,onClosed:G})}ve.DatePicker=$t,ve.Picker=Ke,ve.TimePicker=Ft,Object.defineProperty(ve,Symbol.toStringTag,{value:"Module"})});
|
|
49
|
+
*/var Ue,Tr;function St(){if(Tr)return Ue;Tr=1;var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;function t(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function i(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(p){return s[p]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(p){u[p]=p}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Ue=i()?Object.assign:function(n,s){for(var a,l=t(n),u,p=1;p<arguments.length;p++){a=Object(arguments[p]);for(var m in a)o.call(a,m)&&(l[m]=a[m]);if(r){u=r(a);for(var E=0;E<u.length;E++)c.call(a,u[E])&&(l[u[E]]=a[u[E]])}}return l},Ue}var We,Cr;function qe(){if(Cr)return We;Cr=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return We=r,We}var ze,Sr;function _r(){return Sr||(Sr=1,ze=Function.call.bind(Object.prototype.hasOwnProperty)),ze}var Xe,Or;function _t(){if(Or)return Xe;Or=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var o=qe(),c={},t=_r();r=function(n){var s="Warning: "+n;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(n,s,a,l,u){if(process.env.NODE_ENV!=="production"){for(var p in n)if(t(n,p)){var m;try{if(typeof n[p]!="function"){var E=Error((l||"React class")+": "+a+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof n[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw E.name="Invariant Violation",E}m=n[p](s,p,l,a,null,o)}catch(q){m=q}if(m&&!(m instanceof Error)&&r((l||"React class")+": type specification of "+a+" `"+p+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof m+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),m instanceof Error&&!(m.message in c)){c[m.message]=!0;var b=u?u():"";r("Failed "+a+" type: "+m.message+(b??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(c={})},Xe=i,Xe}var He,Rr;function Ot(){if(Rr)return He;Rr=1;var r=xr(),o=St(),c=qe(),t=_r(),i=_t(),n=function(){};process.env.NODE_ENV!=="production"&&(n=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return He=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,p="@@iterator";function m(f){var v=f&&(u&&f[u]||f[p]);if(typeof v=="function")return v}var E="<<anonymous>>",b={array:W("array"),bigint:W("bigint"),bool:W("boolean"),func:W("function"),number:W("number"),object:W("object"),string:W("string"),symbol:W("symbol"),any:H(),arrayOf:$,element:w(),elementType:h(),instanceOf:re,node:L(),objectOf:ue,oneOf:fe,oneOfType:ee,shape:Q,exact:te};function q(f,v){return f===v?f!==0||1/f===1/v:f!==f&&v!==v}function O(f,v){this.message=f,this.data=v&&typeof v=="object"?v:{},this.stack=""}O.prototype=Error.prototype;function U(f){if(process.env.NODE_ENV!=="production")var v={},T=0;function k(M,R,P,I,V,D,se){if(I=I||E,D=D||P,se!==c){if(l){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var de=I+":"+P;!v[de]&&T<3&&(n("You are manually calling a React.PropTypes validation function for the `"+D+"` prop on `"+I+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),v[de]=!0,T++)}}return R[P]==null?M?R[P]===null?new O("The "+V+" `"+D+"` is marked as required "+("in `"+I+"`, but its value is `null`.")):new O("The "+V+" `"+D+"` is marked as required in "+("`"+I+"`, but its value is `undefined`.")):null:f(R,P,I,V,D)}var x=k.bind(null,!1);return x.isRequired=k.bind(null,!0),x}function W(f){function v(T,k,x,M,R,P){var I=T[k],V=j(I);if(V!==f){var D=ne(I);return new O("Invalid "+M+" `"+R+"` of type "+("`"+D+"` supplied to `"+x+"`, expected ")+("`"+f+"`."),{expectedType:f})}return null}return U(v)}function H(){return U(s)}function $(f){function v(T,k,x,M,R){if(typeof f!="function")return new O("Property `"+R+"` of component `"+x+"` has invalid PropType notation inside arrayOf.");var P=T[k];if(!Array.isArray(P)){var I=j(P);return new O("Invalid "+M+" `"+R+"` of type "+("`"+I+"` supplied to `"+x+"`, expected an array."))}for(var V=0;V<P.length;V++){var D=f(P,V,x,M,R+"["+V+"]",c);if(D instanceof Error)return D}return null}return U(v)}function w(){function f(v,T,k,x,M){var R=v[T];if(!a(R)){var P=j(R);return new O("Invalid "+x+" `"+M+"` of type "+("`"+P+"` supplied to `"+k+"`, expected a single ReactElement."))}return null}return U(f)}function h(){function f(v,T,k,x,M){var R=v[T];if(!r.isValidElementType(R)){var P=j(R);return new O("Invalid "+x+" `"+M+"` of type "+("`"+P+"` supplied to `"+k+"`, expected a single ReactElement type."))}return null}return U(f)}function re(f){function v(T,k,x,M,R){if(!(T[k]instanceof f)){var P=f.name||E,I=oe(T[k]);return new O("Invalid "+M+" `"+R+"` of type "+("`"+I+"` supplied to `"+x+"`, expected ")+("instance of `"+P+"`."))}return null}return U(v)}function fe(f){if(!Array.isArray(f))return process.env.NODE_ENV!=="production"&&(arguments.length>1?n("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):n("Invalid argument supplied to oneOf, expected an array.")),s;function v(T,k,x,M,R){for(var P=T[k],I=0;I<f.length;I++)if(q(P,f[I]))return null;var V=JSON.stringify(f,function(se,g){var de=ne(g);return de==="symbol"?String(g):g});return new O("Invalid "+M+" `"+R+"` of value `"+String(P)+"` "+("supplied to `"+x+"`, expected one of "+V+"."))}return U(v)}function ue(f){function v(T,k,x,M,R){if(typeof f!="function")return new O("Property `"+R+"` of component `"+x+"` has invalid PropType notation inside objectOf.");var P=T[k],I=j(P);if(I!=="object")return new O("Invalid "+M+" `"+R+"` of type "+("`"+I+"` supplied to `"+x+"`, expected an object."));for(var V in P)if(t(P,V)){var D=f(P,V,x,M,R+"."+V,c);if(D instanceof Error)return D}return null}return U(v)}function ee(f){if(!Array.isArray(f))return process.env.NODE_ENV!=="production"&&n("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var v=0;v<f.length;v++){var T=f[v];if(typeof T!="function")return n("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(T)+" at index "+v+"."),s}function k(x,M,R,P,I){for(var V=[],D=0;D<f.length;D++){var se=f[D],g=se(x,M,R,P,I,c);if(g==null)return null;g.data&&t(g.data,"expectedType")&&V.push(g.data.expectedType)}var de=V.length>0?", expected one of type ["+V.join(", ")+"]":"";return new O("Invalid "+P+" `"+I+"` supplied to "+("`"+R+"`"+de+"."))}return U(k)}function L(){function f(v,T,k,x,M){return A(v[T])?null:new O("Invalid "+x+" `"+M+"` supplied to "+("`"+k+"`, expected a ReactNode."))}return U(f)}function Y(f,v,T,k,x){return new O((f||"React class")+": "+v+" type `"+T+"."+k+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+x+"`.")}function Q(f){function v(T,k,x,M,R){var P=T[k],I=j(P);if(I!=="object")return new O("Invalid "+M+" `"+R+"` of type `"+I+"` "+("supplied to `"+x+"`, expected `object`."));for(var V in f){var D=f[V];if(typeof D!="function")return Y(x,M,R,V,ne(D));var se=D(P,V,x,M,R+"."+V,c);if(se)return se}return null}return U(v)}function te(f){function v(T,k,x,M,R){var P=T[k],I=j(P);if(I!=="object")return new O("Invalid "+M+" `"+R+"` of type `"+I+"` "+("supplied to `"+x+"`, expected `object`."));var V=o({},T[k],f);for(var D in V){var se=f[D];if(t(f,D)&&typeof se!="function")return Y(x,M,R,D,ne(se));if(!se)return new O("Invalid "+M+" `"+R+"` key `"+D+"` supplied to `"+x+"`.\nBad object: "+JSON.stringify(T[k],null," ")+`
|
|
50
|
+
Valid keys: `+JSON.stringify(Object.keys(f),null," "));var g=se(P,D,x,M,R+"."+D,c);if(g)return g}return null}return U(v)}function A(f){switch(typeof f){case"number":case"string":case"undefined":return!0;case"boolean":return!f;case"object":if(Array.isArray(f))return f.every(A);if(f===null||a(f))return!0;var v=m(f);if(v){var T=v.call(f),k;if(v!==f.entries){for(;!(k=T.next()).done;)if(!A(k.value))return!1}else for(;!(k=T.next()).done;){var x=k.value;if(x&&!A(x[1]))return!1}}else return!1;return!0;default:return!1}}function G(f,v){return f==="symbol"?!0:v?v["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&v instanceof Symbol:!1}function j(f){var v=typeof f;return Array.isArray(f)?"array":f instanceof RegExp?"object":G(v,f)?"symbol":v}function ne(f){if(typeof f>"u"||f===null)return""+f;var v=j(f);if(v==="object"){if(f instanceof Date)return"date";if(f instanceof RegExp)return"regexp"}return v}function J(f){var v=ne(f);switch(v){case"array":case"object":return"an "+v;case"boolean":case"date":case"regexp":return"a "+v;default:return v}}function oe(f){return!f.constructor||!f.constructor.name?E:f.constructor.name}return b.checkPropTypes=i,b.resetWarningCache=i.resetWarningCache,b.PropTypes=b,b},He}var Be,wr;function Rt(){if(wr)return Be;wr=1;var r=qe();function o(){}function c(){}return c.resetWarningCache=o,Be=function(){function t(s,a,l,u,p,m){if(m!==r){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}t.isRequired=t;function i(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:i,element:t,elementType:t,instanceOf:i,node:t,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n},Be}var Pr;function wt(){if(Pr)return Ie.exports;if(Pr=1,process.env.NODE_ENV!=="production"){var r=xr(),o=!0;Ie.exports=Ot()(r.isElement,o)}else Ie.exports=Rt()();return Ie.exports}var Pt=wt();const S=Gr(Pt);function At(r,o){return r.classList?!!o&&r.classList.contains(o):(" "+(r.className.baseVal||r.className)+" ").indexOf(" "+o+" ")!==-1}function jt(r,o){r.classList?r.classList.add(o):At(r,o)||(typeof r.className=="string"?r.className=r.className+" "+o:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+o))}function Ar(r,o){return r.replace(new RegExp("(^|\\s)"+o+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Mt(r,o){r.classList?r.classList.remove(o):typeof r.className=="string"?r.className=Ar(r.className,o):r.setAttribute("class",Ar(r.className&&r.className.baseVal||"",o))}const jr={disabled:!1};var It=process.env.NODE_ENV!=="production"?S.oneOfType([S.number,S.shape({enter:S.number,exit:S.number,appear:S.number}).isRequired]):null,Dt=process.env.NODE_ENV!=="production"?S.oneOfType([S.string,S.shape({enter:S.string,exit:S.string,active:S.string}),S.shape({enter:S.string,enterDone:S.string,enterActive:S.string,exit:S.string,exitDone:S.string,exitActive:S.string})]):null;const Mr=_.createContext(null);var Ir=function(o){return o.scrollTop},we="unmounted",me="exited",ge="entering",ke="entered",Ge="exiting",he=function(r){yr(o,r);function o(t,i){var n;n=r.call(this,t,i)||this;var s=i,a=s&&!s.isMounting?t.enter:t.appear,l;return n.appearStatus=null,t.in?a?(l=me,n.appearStatus=ge):l=ke:t.unmountOnExit||t.mountOnEnter?l=we:l=me,n.state={status:l},n.nextCallback=null,n}o.getDerivedStateFromProps=function(i,n){var s=i.in;return s&&n.status===we?{status:me}:null};var c=o.prototype;return c.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},c.componentDidUpdate=function(i){var n=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==ge&&s!==ke&&(n=ge):(s===ge||s===ke)&&(n=Ge)}this.updateStatus(!1,n)},c.componentWillUnmount=function(){this.cancelNextCallback()},c.getTimeouts=function(){var i=this.props.timeout,n,s,a;return n=s=a=i,i!=null&&typeof i!="number"&&(n=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:n,enter:s,appear:a}},c.updateStatus=function(i,n){if(i===void 0&&(i=!1),n!==null)if(this.cancelNextCallback(),n===ge){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:_e.findDOMNode(this);s&&Ir(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===me&&this.setState({status:we})},c.performEnter=function(i){var n=this,s=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[_e.findDOMNode(this),a],u=l[0],p=l[1],m=this.getTimeouts(),E=a?m.appear:m.enter;if(!i&&!s||jr.disabled){this.safeSetState({status:ke},function(){n.props.onEntered(u)});return}this.props.onEnter(u,p),this.safeSetState({status:ge},function(){n.props.onEntering(u,p),n.onTransitionEnd(E,function(){n.safeSetState({status:ke},function(){n.props.onEntered(u,p)})})})},c.performExit=function(){var i=this,n=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:_e.findDOMNode(this);if(!n||jr.disabled){this.safeSetState({status:me},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:Ge},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:me},function(){i.props.onExited(a)})})})},c.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},c.safeSetState=function(i,n){n=this.setNextCallback(n),this.setState(i,n)},c.setNextCallback=function(i){var n=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,n.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},c.onTransitionEnd=function(i,n){this.setNextCallback(n);var s=this.props.nodeRef?this.props.nodeRef.current:_e.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],u=l[0],p=l[1];this.props.addEndListener(u,p)}i!=null&&setTimeout(this.nextCallback,i)},c.render=function(){var i=this.state.status;if(i===we)return null;var n=this.props,s=n.children;n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef;var a=gr(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return _.createElement(Mr.Provider,{value:null},typeof s=="function"?s(i,a):_.cloneElement(_.Children.only(s),a))},o}(_.Component);he.contextType=Mr,he.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:S.shape({current:typeof Element>"u"?S.any:function(r,o,c,t,i,n){var s=r[o];return S.instanceOf(s&&"ownerDocument"in s?s.ownerDocument.defaultView.Element:Element)(r,o,c,t,i,n)}}),children:S.oneOfType([S.func.isRequired,S.element.isRequired]).isRequired,in:S.bool,mountOnEnter:S.bool,unmountOnExit:S.bool,appear:S.bool,enter:S.bool,exit:S.bool,timeout:function(o){var c=It;o.addEndListener||(c=c.isRequired);for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return c.apply(void 0,[o].concat(i))},addEndListener:S.func,onEnter:S.func,onEntering:S.func,onEntered:S.func,onExit:S.func,onExiting:S.func,onExited:S.func}:{};function xe(){}he.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:xe,onEntering:xe,onEntered:xe,onExit:xe,onExiting:xe,onExited:xe},he.UNMOUNTED=we,he.EXITED=me,he.ENTERING=ge,he.ENTERED=ke,he.EXITING=Ge;var Nt=function(o,c){return o&&c&&c.split(" ").forEach(function(t){return jt(o,t)})},Je=function(o,c){return o&&c&&c.split(" ").forEach(function(t){return Mt(o,t)})},Ne=function(r){yr(o,r);function o(){for(var t,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];return t=r.call.apply(r,[this].concat(n))||this,t.appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(a,l){var u=t.resolveArguments(a,l),p=u[0],m=u[1];t.removeClasses(p,"exit"),t.addClass(p,m?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(a,l)},t.onEntering=function(a,l){var u=t.resolveArguments(a,l),p=u[0],m=u[1],E=m?"appear":"enter";t.addClass(p,E,"active"),t.props.onEntering&&t.props.onEntering(a,l)},t.onEntered=function(a,l){var u=t.resolveArguments(a,l),p=u[0],m=u[1],E=m?"appear":"enter";t.removeClasses(p,E),t.addClass(p,E,"done"),t.props.onEntered&&t.props.onEntered(a,l)},t.onExit=function(a){var l=t.resolveArguments(a),u=l[0];t.removeClasses(u,"appear"),t.removeClasses(u,"enter"),t.addClass(u,"exit","base"),t.props.onExit&&t.props.onExit(a)},t.onExiting=function(a){var l=t.resolveArguments(a),u=l[0];t.addClass(u,"exit","active"),t.props.onExiting&&t.props.onExiting(a)},t.onExited=function(a){var l=t.resolveArguments(a),u=l[0];t.removeClasses(u,"exit"),t.addClass(u,"exit","done"),t.props.onExited&&t.props.onExited(a)},t.resolveArguments=function(a,l){return t.props.nodeRef?[t.props.nodeRef.current,a]:[a,l]},t.getClassNames=function(a){var l=t.props.classNames,u=typeof l=="string",p=u&&l?l+"-":"",m=u?""+p+a:l[a],E=u?m+"-active":l[a+"Active"],b=u?m+"-done":l[a+"Done"];return{baseClassName:m,activeClassName:E,doneClassName:b}},t}var c=o.prototype;return c.addClass=function(i,n,s){var a=this.getClassNames(n)[s+"ClassName"],l=this.getClassNames("enter"),u=l.doneClassName;n==="appear"&&s==="done"&&u&&(a+=" "+u),s==="active"&&i&&Ir(i),a&&(this.appliedClasses[n][s]=a,Nt(i,a))},c.removeClasses=function(i,n){var s=this.appliedClasses[n],a=s.base,l=s.active,u=s.done;this.appliedClasses[n]={},a&&Je(i,a),l&&Je(i,l),u&&Je(i,u)},c.render=function(){var i=this.props;i.classNames;var n=gr(i,["classNames"]);return _.createElement(he,Me({},n,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},o}(_.Component);Ne.defaultProps={classNames:""},Ne.propTypes=process.env.NODE_ENV!=="production"?Me({},he.propTypes,{classNames:Dt,onEnter:S.func,onEntering:S.func,onEntered:S.func,onExit:S.func,onExiting:S.func,onExited:S.func}):{};function Yt({show:r,onClose:o,onOpen:c,onClosed:t,children:i,teleport:n=document.body}){const s=_.useRef(null),a=_.useRef(null);_.useEffect(()=>(r?(document.body.style.overflow="hidden",c?.()):document.body.style.overflow="",()=>{document.body.style.overflow=""}),[r]);function l(u){s.current&&(s.current.style.setProperty("display",u),u==="none"&&t?.())}return _e.createPortal(Z.jsxs(Z.Fragment,{children:[Z.jsx(Ne,{in:r,timeout:300,nodeRef:a,classNames:"chook-picker-fade",unmountOnExit:!0,children:Z.jsx("div",{ref:a,role:"presentation",className:"chook-picker-mask",onClick:o,onKeyDown:u=>{u.key==="Escape"&&o()}})}),Z.jsx(Ne,{in:r,timeout:300,nodeRef:s,classNames:"chook-picker-slide",onEnter:()=>l(""),onExited:()=>l("none"),children:Z.jsx("div",{ref:s,className:"chook-picker-container",style:{display:"none"},children:i})})]}),n)}function Ke({show:r,values:o,title:c,columns:t,linkage:i=!1,loading:n=!1,loadingSlot:s,emptySlot:a,teleport:l,confirmButtonText:u="Confirm",cancelButtonText:p="Cancel",columnsFieldNames:m,onConfirm:E,onClose:b,onChange:q,onCancel:O,onOpen:U,onClosed:W}){const[H,$]=_.useState([]),[w,h]=_.useState([]),[re,fe]=_.useState([]),ue=_.useRef(null),ee=rt(m),L=et(t,ee),Y=_.useMemo(()=>L==="single"?[t]:L==="multiple"?t:tt(t,w,ee),[t,L,w,ee]);_.useEffect(()=>{!o||o.every((oe,f)=>oe===w[f])||h(o)},[o]),_.useEffect(()=>{const J=Y.length,oe=[];let f=!1;for(let v=0;v<J;v++){const T=Y[v],k=w[v],x=sr(T,k,ee);if(x===-1){const R=(re[v]??0)>=T.length?Math.max(T.length-1,0):0;oe[v]=R}else oe[v]=x;oe[v]!==re[v]&&(ue.current?.scrollColumnToSelected(v,oe[v]),f=!0)}f&&fe(oe)},[w,Y,ee]);function Q(J,oe){const f=Y[J],v=f[oe]?.[ee.value],T=w[J];if(v===T)return;const k=[...w];if(k[J]=v,L==="cascade"){const x=f[oe],M=nt(x,J,k,ee);h(M),te(M)}else h(k),te(k)}function te(J){q?.(J),i&&$(J)}function A(){$(w),b(),E?.(w)}function G(){b(),O?.()}function j(){U?.()}function ne(){h(o?[...o]:[...H]),W?.()}return Z.jsxs(Yt,{show:r,teleport:l,onOpen:j,onClose:b,onClosed:ne,children:[Z.jsxs("div",{className:"chook-picker-header",children:[Z.jsx("button",{className:"chook-picker-cancel",onClick:G,children:p}),Z.jsx("p",{className:"chook-picker-title",children:c}),Z.jsx("button",{className:"chook-picker-confirm",onClick:A,children:u})]}),Z.jsx(mr,{ref:ue,loading:n,loadingSlot:s,columns:t,emptySlot:a,currentColumns:Y,fields:ee,selectedIndices:re,updateSelectedValueByIndex:Q})]})}function $t({show:r,values:o,title:c=ht,columnsType:t=mt,minDate:i=new Date(new Date().getFullYear()-10,0,1),maxDate:n=new Date(new Date().getFullYear()+10,11,31),teleport:s,confirmButtonText:a,cancelButtonText:l,formatYearLabel:u=$e,formatMonthLabel:p=$e,formatDayLabel:m=$e,onConfirm:E,onClose:b,onCancel:q,onOpen:O,onClosed:U}){const[W,H]=_.useState([]),[$,w]=_.useState([]),h=_.useMemo(()=>{const A={year:re,month:fe,day:ue};return t.map(G=>A[G]())},[t,i,n,$,u,p,m]);function re(){const A=i.getFullYear(),G=n.getFullYear();return be(A,G,u)}function fe(){const A=ee("year"),G=ur(A,i)?i.getMonth()+1:1,j=lr(A,n)?n.getMonth()+1:12;return be(G,j,p)}function ue(){const A=ee("year"),G=ee("month"),j=ur(A,i)&&it(G,i),ne=lr(A,n)&&at(G,n),J=j?i.getDate():1,oe=ne?n.getDate():st(A,G);return be(J,oe,m)}function ee(A){const G=t.indexOf(A),j=$[G];return j?Number(j):ct(i,n,A)}function L(A){H(A),b(),E?.(A)}function Y(){b(),q?.()}function Q(){O?.(),o&&o.length?w([...o]):w(t.map(ee))}function te(){w(o?[...o]:[...W]),U?.()}return Z.jsx(Ke,{values:$,show:r,title:c,columns:h,teleport:s,confirmButtonText:a,cancelButtonText:l,linkage:!0,onConfirm:L,onClose:b,onChange:w,onCancel:Y,onOpen:Q,onClosed:te})}function Ft({show:r,values:o,title:c=gt,columnsType:t=yt,minTime:i,maxTime:n,teleport:s,confirmButtonText:a,cancelButtonText:l,formatHourLabel:u=Fe,formatMinuteLabel:p=Fe,formatSecondLabel:m=Fe,onConfirm:E,onClose:b,onCancel:q,onOpen:O,onClosed:U}){const[W,H]=_.useState([]),[$,w]=_.useState([]),h=_.useMemo(()=>fr(i??"")??{hour:0,minute:0,second:0},[i]),re=_.useMemo(()=>fr(n??"")??{hour:23,minute:59,second:59},[n]),fe=_.useMemo(()=>{const j={hour:ue,minute:ee,second:L};return t.map(ne=>j[ne]())},[t,h,re,$,u,p,m]);function ue(){return be(h.hour,re.hour,u)}function ee(){const j=Y("hour"),{hour:ne,minute:J}=h,{hour:oe,minute:f}=re;return be(j===ne?J:0,j===oe?f:59,p)}function L(){const j=Y("hour"),ne=Y("minute"),{hour:J,minute:oe,second:f}=h,{hour:v,minute:T,second:k}=re;return be(j===J&&ne===oe?f:0,j===v&&ne===T?k:59,m)}function Y(j){const ne=t.indexOf(j),J=$[ne];return J!==void 0?Number(J):lt(h,re,j)}function Q(j){H(j),b(),E?.(j)}function te(){b(),q?.()}function A(){O?.(),o&&o.length?w([...o]):w(t.map(Y))}function G(){w(o?[...o]:[...W]),U?.()}return Z.jsx(Ke,{values:$,show:r,title:c,columns:fe,teleport:s,confirmButtonText:a,cancelButtonText:l,linkage:!0,onConfirm:Q,onClose:b,onChange:w,onCancel:te,onOpen:A,onClosed:G})}ve.DatePicker=$t,ve.Picker=Ke,ve.TimePicker=Ft,Object.defineProperty(ve,Symbol.toStringTag,{value:"Module"})});
|
package/dist/vue/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--chook-picker-background: #fff;--chook-picker-border-radius: .5rem;--chook-picker-padding-bottom: 1.25rem;--chook-picker-z-index: 2147483646;--chook-picker-mask-background: rgba(0, 0, 0, .2);--chook-picker-header-padding: .75rem 0;--chook-picker-header-margin-bottom: 1.25rem;--chook-picker-title-font-size: 1rem;--chook-picker-title-font-weight: 500;--chook-picker-title-color: #323233;--chook-picker-title-padding: 0 1rem;--chook-picker-confirm-color: #1989fa;--chook-picker-confirm-font-size: .875rem;--chook-picker-confirm-padding: 0 1rem 0 0;--chook-picker-cancel-color: #969799;--chook-picker-cancel-font-size: .875rem;--chook-picker-cancel-padding: 0 0 0 1rem;--chook-picker-active-opacity: .6;--chook-picker-columns-margin: 0 1rem;--chook-picker-columns-backdrop: linear-gradient( to bottom, #f2f2f2 0px, #f2f2f2 .0625rem, transparent .0625rem, transparent calc(100% - .0625rem) , #f2f2f2 calc(100% - .0625rem) , #f2f2f2 100% );--chook-picker-mask-backdrop: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4)), linear-gradient(0deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4));--chook-picker-column-label-color: #323233;--chook-picker-column-label-padding: 0 .25rem;--chook-picker-column-font-size: 1rem;--chook-picker-column-font-weight: 500}.chook-picker-mask{position:fixed;
|
|
1
|
+
:root{--chook-picker-background: #fff;--chook-picker-border-radius: .5rem;--chook-picker-padding-bottom: 1.25rem;--chook-picker-z-index: 2147483646;--chook-picker-mask-background: rgba(0, 0, 0, .2);--chook-picker-header-padding: .75rem 0;--chook-picker-header-margin-bottom: 1.25rem;--chook-picker-title-font-size: 1rem;--chook-picker-title-font-weight: 500;--chook-picker-title-color: #323233;--chook-picker-title-padding: 0 1rem;--chook-picker-confirm-color: #1989fa;--chook-picker-confirm-font-size: .875rem;--chook-picker-confirm-padding: 0 1rem 0 0;--chook-picker-cancel-color: #969799;--chook-picker-cancel-font-size: .875rem;--chook-picker-cancel-padding: 0 0 0 1rem;--chook-picker-active-opacity: .6;--chook-picker-columns-margin: 0 1rem;--chook-picker-columns-backdrop: linear-gradient( to bottom, #f2f2f2 0px, #f2f2f2 .0625rem, transparent .0625rem, transparent calc(100% - .0625rem) , #f2f2f2 calc(100% - .0625rem) , #f2f2f2 100% );--chook-picker-mask-backdrop: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4)), linear-gradient(0deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4));--chook-picker-column-label-color: #323233;--chook-picker-column-label-padding: 0 .25rem;--chook-picker-column-font-size: 1rem;--chook-picker-column-font-weight: 500}.chook-picker-mask{position:fixed;inset:0;background:var(--chook-picker-mask-background);z-index:calc(var(--chook-picker-z-index) - 1)}.chook-picker-container{position:fixed;left:0;bottom:0;width:100vw;z-index:var(--chook-picker-z-index);-webkit-user-select:none;user-select:none;padding-bottom:var(--chook-picker-padding-bottom);background:var(--chook-picker-background);border-top-left-radius:var(--chook-picker-border-radius);border-top-right-radius:var(--chook-picker-border-radius)}.chook-picker-header{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;justify-content:space-between;padding:var(--chook-picker-header-padding);margin-bottom:var(--chook-picker-header-margin-bottom)}.chook-picker-title{grid-column:span 2;text-align:center;font-size:var(--chook-picker-title-font-size);font-weight:var(--chook-picker-title-font-weight);color:var(--chook-picker-title-color);padding:var(--chook-picker-title-padding);text-overflow:ellipsis;overflow:hidden;white-space:nowrap;margin:0}.chook-picker-columns{width:calc(100% - var(--chook-picker-columns-margin) * 2);height:13.5rem;overflow:hidden;position:relative;display:flex;margin:var(--chook-picker-columns-margin)}.chook-picker-columns-backdrop{background-image:var(--chook-picker-columns-backdrop);background-repeat:no-repeat;background-position:center;background-size:100% 3rem}.chook-picker-mask-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;background-image:var(--chook-picker-mask-backdrop);background-repeat:no-repeat;background-position:top,bottom;background-size:100% 5.25rem}.chook-picker-loading{height:100%;width:100%;position:absolute;top:0;left:0}.chook-picker-column{flex:1 1 0%;overflow:hidden;padding:5.375rem 0;cursor:grab}.chook-picker-column ul{margin:0;padding:0;list-style:none}.chook-picker-column-item{height:3rem;display:flex;justify-content:center;align-items:center;cursor:grab}.chook-picker-column-label{color:var(--chook-picker-column-label-color);font-size:var(--chook-picker-column-font-size);font-weight:var(--chook-picker-column-font-weight);padding:var(--chook-picker-column-label-padding);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}button.chook-picker-confirm{color:var(--chook-picker-confirm-color);font-size:var(--chook-picker-confirm-font-size);background-color:transparent;padding:var(--chook-picker-confirm-padding);text-align:right;border:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}button.chook-picker-confirm:active{opacity:var(--chook-picker-active-opacity)}button.chook-picker-confirm:hover{color:var(--chook-picker-confirm-color);background-color:transparent}button.chook-picker-cancel{color:var(--chook-picker-cancel-color);font-size:var(--chook-picker-cancel-font-size);background-color:transparent;padding:var(--chook-picker-cancel-padding);text-align:left;border:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}button.chook-picker-cancel:active{opacity:var(--chook-picker-active-opacity)}button.chook-picker-cancel:hover{color:var(--chook-picker-cancel-color);background-color:transparent}.chook-picker-fade-enter-active,.chook-picker-fade-leave-active,.chook-picker-slide-enter-active,.chook-picker-slide-leave-active{transition:all .3s ease}.chook-picker-fade-enter-from,.chook-picker-fade-leave-to{opacity:0}.chook-picker-slide-enter-from,.chook-picker-slide-leave-to{opacity:.5;transform:translate3d(0,100%,0)}
|