@schedule-x/date-picker
Advanced tools
Comparing version 0.1.0-alpha.4 to 0.1.0-alpha.5
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var preact = require('preact'); | ||
var signals = require('@preact/signals'); | ||
var _$1=0;function o$2(o,e,n,t,f,l){var s,u,a={};for(u in e)"ref"==u?s=e[u]:a[u]=e[u];var i={type:o,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--_$1,__source:f,__self:l};if("function"==typeof o&&(s=o.defaultProps))for(u in s)void 0===a[u]&&(a[u]=s[u]);return preact.options.vnode&&preact.options.vnode(i),i} | ||
var _=0;function o$1(o,e,n,t,f,l){var s,u,a={};for(u in e)"ref"==u?s=e[u]:a[u]=e[u];var i={type:o,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--_,__source:f,__self:l};if("function"==typeof o&&(s=o.defaultProps))for(u in s)void 0===a[u]&&(a[u]=s[u]);return preact.options.vnode&&preact.options.vnode(i),i} | ||
const AppContext = preact.createContext({}); | ||
var t$1,r$1,u$1,i$1,o$1=0,f$1=[],c$2=[],e$1=preact.options.__b,a$2=preact.options.__r,v$1=preact.options.diffed,l$1=preact.options.__c,m=preact.options.unmount;function d$2(t,u){preact.options.__h&&preact.options.__h(r$1,t,o$1||u),o$1=0;var i=r$1.__H||(r$1.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c$2}),i.__[t]}function h$2(n){return o$1=1,s$1(B$1,n)}function s$1(n,u,i){var o=d$2(t$1++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r$1,!r$1.u)){var f=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r$1.u=!0;var c=r$1.shouldComponentUpdate,e=r$1.componentWillUpdate;r$1.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r$1.shouldComponentUpdate=f;}return o.__N||o.__}function p$2(u,i){var o=d$2(t$1++,3);!preact.options.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r$1.__H.__h.push(o));}function F$1(n,r){var u=d$2(t$1++,7);return z(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function q$1(n){var u=r$1.context[n.__c],i=d$2(t$1++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r$1)),u.props.value):n.__}function b$1(){for(var t;t=f$1.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w$2),t.__H.__h=[];}catch(r){t.__H.__h=[],preact.options.__e(r,t.__v);}}preact.options.__b=function(n){r$1=null,e$1&&e$1(n);},preact.options.__r=function(n){a$2&&a$2(n),t$1=0;var i=(r$1=n.__c).__H;i&&(u$1===r$1?(i.__h=[],r$1.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c$2,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w$2),i.__h=[],t$1=0)),u$1=r$1;},preact.options.diffed=function(t){v$1&&v$1(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f$1.push(o)&&i$1===preact.options.requestAnimationFrame||((i$1=preact.options.requestAnimationFrame)||j)(b$1)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c$2&&(n.__=n.__V),n.i=void 0,n.__V=c$2;})),u$1=r$1=null;},preact.options.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w$2(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],preact.options.__e(u,t.__v);}}),l$1&&l$1(t,r);},preact.options.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&preact.options.__e(r,u.__v));};var g$2="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g$2&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g$2&&(t=requestAnimationFrame(r));}function k(n){var t=r$1,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r$1=t;}function w$2(n){var t=r$1;n.__c=n.__(),r$1=t;}function z(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B$1(n,t){return "function"==typeof t?t(n):t} | ||
var t,r,u,i,o=0,f=[],c=[],e=preact.options.__b,a=preact.options.__r,v=preact.options.diffed,l=preact.options.__c,m=preact.options.unmount;function d(t,u){preact.options.__h&&preact.options.__h(r,t,o||u),o=0;var i=r.__H||(r.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c}),i.__[t]}function h(n){return o=1,s(B$1,n)}function s(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r.shouldComponentUpdate=f;}return o.__N||o.__}function p(u,i){var o=d(t++,3);!preact.options.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__H.__h.push(o));}function q$1(n){var u=r.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w$1),t.__H.__h=[];}catch(r){t.__H.__h=[],preact.options.__e(r,t.__v);}}preact.options.__b=function(n){r=null,e&&e(n);},preact.options.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w$1),i.__h=[],t=0)),u=r;},preact.options.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===preact.options.requestAnimationFrame||((i=preact.options.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c;})),u=r=null;},preact.options.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w$1(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],preact.options.__e(u,t.__v);}}),l&&l(t,r);},preact.options.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&preact.options.__e(r,u.__v));};var g$1="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g$1&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g$1&&(t=requestAnimationFrame(r));}function k(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function w$1(n){var t=r;n.__c=n.__(),r=t;}function z(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B$1(n,t){return "function"==typeof t?t(n):t} | ||
function g$1(n,t){for(var e in t)n[e]=t[e];return n}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function w$1(n){this.props=n;}(w$1.prototype=new preact.Component).isPureReactComponent=!0,w$1.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var R=preact.options.__b;preact.options.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),R&&R(n);};var T=preact.options.__e;preact.options.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);T(n,t,e,r);};var I=preact.options.unmount;function L(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g$1({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)})),n}function U(n,t,e){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return U(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function D(){this.__u=0,this.t=null,this.__b=null;}function F(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function V(){this.u=null,this.o=null;}preact.options.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),I&&I(n);},(D.prototype=new preact.Component).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=F(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=U(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate();}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},D.prototype.componentWillUnmount=function(){this.t=[];},D.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=L(this.__b,r,o.__O=o.__P);}this.__b=null;}var i=e.__a&&preact.createElement(preact.Fragment,null,n.fallback);return i&&(i.__h=null),[preact.createElement(preact.Fragment,null,e.__a?null:n.children),i]};var W=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};(V.prototype=new preact.Component).__a=function(n){var t=this,e=F(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),W(t,n,r)):u();};e?e(o):o();}},V.prototype.render=function(n){this.u=null,this.o=new Map;var t=preact.toChildArray(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){W(n,e,t);});};var B="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,H=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Z=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Y=/[A-Z0-9]/g,$="undefined"!=typeof document,q=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};preact.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(preact.Component.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n});}});});var K=preact.options.event;function Q(){}function X(){return this.cancelBubble}function nn(){return this.defaultPrevented}preact.options.event=function(n){return K&&(n=K(n)),n.persist=Q,n.isPropagationStopped=X,n.isDefaultPrevented=nn,n.nativeEvent=n};var en={enumerable:!1,configurable:!0,get:function(){return this.class}},rn=preact.options.vnode;preact.options.vnode=function(n){"string"==typeof n.type&&function(n){var t=n.props,e=n.type,u={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||$&&"children"===o&&"noscript"===e||"class"===o||"className"===o)){var l=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===l?o="ondblclick":"onchange"!==l||"input"!==e&&"textarea"!==e||q(t.type)?"onfocus"===l?o="onfocusin":"onblur"===l?o="onfocusout":Z.test(o)?o=l:-1===e.indexOf("-")&&H.test(o)?o=o.replace(Y,"-$&").toLowerCase():null===i&&(i=void 0):l=o="oninput","oninput"===l&&u[o=l]&&(o="oninputCapture"),u[o]=i;}}"select"==e&&u.multiple&&Array.isArray(u.value)&&(u.value=preact.toChildArray(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),"select"==e&&null!=u.defaultValue&&(u.value=preact.toChildArray(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;})),t.class&&!t.className?(u.class=t.class,Object.defineProperty(u,"className",en)):(t.className&&!t.class||t.class&&t.className)&&(u.class=u.className=t.className),n.props=u;}(n),n.$$typeof=B,rn&&rn(n);};var un=preact.options.__r;preact.options.__r=function(n){un&&un(n),n.__c;};var on=preact.options.diffed;preact.options.diffed=function(n){on&&on(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value);}; | ||
function g(n,t){for(var e in t)n[e]=t[e];return n}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function w(n){this.props=n;}(w.prototype=new preact.Component).isPureReactComponent=!0,w.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var R=preact.options.__b;preact.options.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),R&&R(n);};var T=preact.options.__e;preact.options.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);T(n,t,e,r);};var I=preact.options.unmount;function L(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)})),n}function U(n,t,e){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return U(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function D(){this.__u=0,this.t=null,this.__b=null;}function F(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function V(){this.u=null,this.o=null;}preact.options.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),I&&I(n);},(D.prototype=new preact.Component).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=F(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=U(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate();}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},D.prototype.componentWillUnmount=function(){this.t=[];},D.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=L(this.__b,r,o.__O=o.__P);}this.__b=null;}var i=e.__a&&preact.createElement(preact.Fragment,null,n.fallback);return i&&(i.__h=null),[preact.createElement(preact.Fragment,null,e.__a?null:n.children),i]};var W=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};(V.prototype=new preact.Component).__a=function(n){var t=this,e=F(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),W(t,n,r)):u();};e?e(o):o();}},V.prototype.render=function(n){this.u=null,this.o=new Map;var t=preact.toChildArray(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){W(n,e,t);});};var B="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,H=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Z=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Y=/[A-Z0-9]/g,$="undefined"!=typeof document,q=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};preact.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(preact.Component.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n});}});});var K=preact.options.event;function Q(){}function X(){return this.cancelBubble}function nn(){return this.defaultPrevented}preact.options.event=function(n){return K&&(n=K(n)),n.persist=Q,n.isPropagationStopped=X,n.isDefaultPrevented=nn,n.nativeEvent=n};var en={enumerable:!1,configurable:!0,get:function(){return this.class}},rn=preact.options.vnode;preact.options.vnode=function(n){"string"==typeof n.type&&function(n){var t=n.props,e=n.type,u={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||$&&"children"===o&&"noscript"===e||"class"===o||"className"===o)){var l=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===l?o="ondblclick":"onchange"!==l||"input"!==e&&"textarea"!==e||q(t.type)?"onfocus"===l?o="onfocusin":"onblur"===l?o="onfocusout":Z.test(o)?o=l:-1===e.indexOf("-")&&H.test(o)?o=o.replace(Y,"-$&").toLowerCase():null===i&&(i=void 0):l=o="oninput","oninput"===l&&u[o=l]&&(o="oninputCapture"),u[o]=i;}}"select"==e&&u.multiple&&Array.isArray(u.value)&&(u.value=preact.toChildArray(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),"select"==e&&null!=u.defaultValue&&(u.value=preact.toChildArray(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;})),t.class&&!t.className?(u.class=t.class,Object.defineProperty(u,"className",en)):(t.className&&!t.class||t.class&&t.className)&&(u.class=u.className=t.className),n.props=u;}(n),n.$$typeof=B,rn&&rn(n);};var un=preact.options.__r;preact.options.__r=function(n){un&&un(n),n.__c;};var on=preact.options.diffed;preact.options.diffed=function(n){on&&on(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value);}; | ||
@@ -61,7 +60,12 @@ const DateFormats = { | ||
}; | ||
const getDayNameShort = (date, locale) => date.toLocaleString(locale, { weekday: 'short' }); | ||
const getDayNamesShort = (week, locale) => { | ||
return week.map((date) => { | ||
return date.toLocaleString(locale, { weekday: 'short' }); | ||
}); | ||
return week.map((date) => getDayNameShort(date, locale)); | ||
}; | ||
const getOneLetterOrShortDayNames = (week, locale) => { | ||
if (['zh-cn'].includes(locale.toLowerCase())) { | ||
return getDayNamesShort(week, locale); | ||
} | ||
return getOneLetterDayNames(week, locale); | ||
}; | ||
@@ -77,7 +81,7 @@ var img = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3c!-- Uploaded to: SVG Repo%2c www.svgrepo.com%2c Generator: SVG Repo Mixer Tools --%3e%3csvg width='800px' height='800px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 9L12 15L18 9' stroke='%23DED8E1' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"; | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
$app.datePickerState.inputDisplayedValue.value = getLocalizedDate($app.datePickerState.selectedDate.value); | ||
}, [$app.datePickerState.selectedDate.value]); | ||
const [wrapperClasses, setWrapperClasses] = h$2([]); | ||
p$2(() => { | ||
const [wrapperClasses, setWrapperClasses] = h([]); | ||
p(() => { | ||
const newClasses = ['sx__date-input-wrapper']; | ||
@@ -102,3 +106,3 @@ if ($app.datePickerState.isOpen.value) | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
document.addEventListener('change', handleInputValue); // Preact onChange triggers on every input | ||
@@ -111,3 +115,3 @@ return () => document.removeEventListener('change', handleInputValue); | ||
}; | ||
return (o$2(preact.Fragment, { children: o$2("div", { class: wrapperClasses.join(' '), children: [o$2("label", { class: "sx__date-input-label", children: $app.translate('Date') }), o$2("input", { value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", class: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), o$2("img", { class: "sx__date-input-chevron", src: img, alt: "" })] }) })); | ||
return (o$1(preact.Fragment, { children: o$1("div", { class: wrapperClasses.join(' '), children: [o$1("label", { class: "sx__date-input-label", children: $app.translate('Date') }), o$1("input", { value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", class: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), o$1("img", { class: "sx__date-input-chevron", src: img, alt: "" })] }) })); | ||
} | ||
@@ -143,2 +147,8 @@ | ||
const doubleDigit = (number) => { | ||
if (number < 0 || number > 99) | ||
throw new NumberRangeError(0, 99); | ||
return String(number).padStart(2, '0'); | ||
}; | ||
const toDateString$1 = (date) => { | ||
@@ -165,7 +175,2 @@ return `${date.getFullYear()}-${doubleDigit(date.getMonth() + 1)}-${doubleDigit(date.getDate())}`; | ||
const doubleDigit = (number) => { | ||
if (number < 0 || number > 99) | ||
throw new NumberRangeError(0, 99); | ||
return String(number).padStart(2, '0'); | ||
}; | ||
const setDateOfMonth = (dateString, date) => { | ||
@@ -191,7 +196,6 @@ dateString = dateString.slice(0, 8) + doubleDigit(date) + dateString.slice(10); | ||
const getYearFrom = (datePickerDate) => { | ||
const { year } = toIntegers(datePickerDate); | ||
return year; | ||
return toIntegers(datePickerDate).year; | ||
}; | ||
const [selectedDateMonthName, setSelectedDateMonthName] = h$2(dateStringToLocalizedMonthName($app.datePickerState.datePickerDate.value)); | ||
const [datePickerYear, setDatePickerYear] = h$2(getYearFrom($app.datePickerState.datePickerDate.value)); | ||
const [selectedDateMonthName, setSelectedDateMonthName] = h(dateStringToLocalizedMonthName($app.datePickerState.datePickerDate.value)); | ||
const [datePickerYear, setDatePickerYear] = h(getYearFrom($app.datePickerState.datePickerDate.value)); | ||
const setPreviousMonth = () => { | ||
@@ -203,3 +207,3 @@ $app.datePickerState.datePickerDate.value = getFirstDayOPreviousMonth($app.datePickerState.datePickerDate.value); | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
setSelectedDateMonthName(dateStringToLocalizedMonthName($app.datePickerState.datePickerDate.value)); | ||
@@ -212,3 +216,3 @@ setDatePickerYear(getYearFrom($app.datePickerState.datePickerDate.value)); | ||
}; | ||
return (o$2(preact.Fragment, { children: o$2("header", { class: "sx__date-picker__month-view-header", children: [o$2("button", { className: "sx__date-picker__chevron-wrapper", onClick: () => setPreviousMonth(), children: o$2("i", { class: "sx__date-picker__chevron sx__date-picker__chevron--previous", children: $app.translate('Previous month') }) }), o$2("button", { className: "sx__date-picker__month-view-header__month-year", onClick: (event) => handleOpenYearsView(event), children: selectedDateMonthName + ' ' + datePickerYear }), o$2("button", { className: "sx__date-picker__chevron-wrapper", onClick: () => setNextMonth(), children: o$2("i", { class: "sx__date-picker__chevron sx__date-picker__chevron--next", children: $app.translate('Next month') }) })] }) })); | ||
return (o$1(preact.Fragment, { children: o$1("header", { class: "sx__date-picker__month-view-header", children: [o$1("button", { className: "sx__date-picker__chevron-wrapper sx__ripple", onClick: () => setPreviousMonth(), children: o$1("i", { class: "sx__date-picker__chevron sx__date-picker__chevron--previous", children: $app.translate('Previous month') }) }), o$1("button", { className: "sx__date-picker__month-view-header__month-year", onClick: (event) => handleOpenYearsView(event), children: selectedDateMonthName + ' ' + datePickerYear }), o$1("button", { className: "sx__date-picker__chevron-wrapper sx__ripple", onClick: () => setNextMonth(), children: o$1("i", { class: "sx__date-picker__chevron sx__date-picker__chevron--next", children: $app.translate('Next month') }) })] }) })); | ||
} | ||
@@ -219,10 +223,4 @@ | ||
const aWeek = $app.timeUnitsImpl.getWeekFor(toJSDate($app.datePickerState.datePickerDate.value)); | ||
let dayNames = []; | ||
if (['zh-cn'].includes($app.config.locale.toLowerCase())) { | ||
dayNames = getDayNamesShort(aWeek, $app.config.locale); | ||
} | ||
else { | ||
dayNames = getOneLetterDayNames(aWeek, $app.config.locale); | ||
} | ||
return (o$2("div", { class: "sx__date-picker__day-names", children: dayNames.map((dayName) => (o$2("span", { "data-testid": "day-name", class: "sx__date-picker__day-name", children: dayName }))) })); | ||
const dayNames = getOneLetterOrShortDayNames(aWeek, $app.config.locale); | ||
return (o$1("div", { class: "sx__date-picker__day-names", children: dayNames.map((dayName) => (o$1("span", { "data-testid": "day-name", class: "sx__date-picker__day-name", children: dayName }))) })); | ||
} | ||
@@ -264,3 +262,3 @@ | ||
}; | ||
return (o$2(preact.Fragment, { children: o$2("div", { "data-testid": DATE_PICKER_WEEK, class: "sx__date-picker__week", children: weekDays.map((weekDay) => (o$2("button", { disabled: !isDateSelectable(weekDay.day), class: weekDay.classes.join(' '), onClick: () => selectDate(weekDay.day), children: weekDay.day.getDate() }))) }) })); | ||
return (o$1(preact.Fragment, { children: o$1("div", { "data-testid": DATE_PICKER_WEEK, class: "sx__date-picker__week", children: weekDays.map((weekDay) => (o$1("button", { disabled: !isDateSelectable(weekDay.day), class: weekDay.classes.join(' '), onClick: () => selectDate(weekDay.day), children: weekDay.day.getDate() }))) }) })); | ||
} | ||
@@ -270,3 +268,3 @@ | ||
const $app = q$1(AppContext); | ||
const [month, setMonth] = h$2([]); | ||
const [month, setMonth] = h([]); | ||
const renderMonth = () => { | ||
@@ -276,6 +274,6 @@ const newDatePickerDate = toJSDate($app.datePickerState.datePickerDate.value); | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
renderMonth(); | ||
}, [$app.datePickerState.datePickerDate.value]); | ||
return (o$2(preact.Fragment, { children: o$2("div", { "data-testid": MONTH_VIEW, class: "sx__date-picker__month-view", children: [o$2(MonthViewHeader, { setYearsView: seatYearsView }), o$2(DayNames, {}), month.map((week) => (o$2(MonthViewWeek, { week: week })))] }) })); | ||
return (o$1(preact.Fragment, { children: o$1("div", { "data-testid": MONTH_VIEW, class: "sx__date-picker__month-view", children: [o$1(MonthViewHeader, { setYearsView: seatYearsView }), o$1(DayNames, {}), month.map((week) => (o$1(MonthViewWeek, { week: week })))] }) })); | ||
} | ||
@@ -290,3 +288,3 @@ | ||
}; | ||
return (o$2(preact.Fragment, { children: o$2("li", { class: isExpanded ? 'sx__is-expanded' : '', children: [o$2("button", { class: "sx__date-picker__years-accordion__expand-button", onClick: () => expand(year), children: year }), isExpanded && (o$2("div", { class: "sx__date-picker__years-view-accordion__panel", children: yearWithDates.map((month) => (o$2("button", { class: "sx__date-picker__years-view-accordion__month", onClick: (event) => handleClickOnMonth(event, month), children: toLocalizedMonth(month, $app.config.locale) }))) }))] }) })); | ||
return (o$1(preact.Fragment, { children: o$1("li", { class: isExpanded ? 'sx__is-expanded' : '', children: [o$1("button", { class: "sx__date-picker__years-accordion__expand-button sx__ripple--wide", onClick: () => expand(year), children: year }), isExpanded && (o$1("div", { class: "sx__date-picker__years-view-accordion__panel", children: yearWithDates.map((month) => (o$1("button", { class: "sx__date-picker__years-view-accordion__month", onClick: (event) => handleClickOnMonth(event, month), children: toLocalizedMonth(month, $app.config.locale) }))) }))] }) })); | ||
} | ||
@@ -299,3 +297,3 @@ | ||
const years = Array.from({ length: maxYear - minYear + 1 }, (_, i) => minYear + i); | ||
const [expandedYear, setExpandedYear] = h$2(new Date().getFullYear()); | ||
const [expandedYear, setExpandedYear] = h(new Date().getFullYear()); | ||
const setNewDatePickerDate = (year, month) => { | ||
@@ -305,3 +303,3 @@ $app.datePickerState.datePickerDate.value = toDateString$1(new Date(year, month, 1)); | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
var _a; | ||
@@ -316,3 +314,3 @@ const initiallyExpandedYear = (_a = document | ||
}, []); | ||
return (o$2(preact.Fragment, { children: o$2("ul", { class: "sx__date-picker__years-view", "data-testid": YEARS_VIEW, children: years.map((year) => (o$2(YearsViewAccordion, { year: year, setYearAndMonth: (year, month) => setNewDatePickerDate(year, month), isExpanded: expandedYear === year, expand: (year) => setExpandedYear(year) }))) }) })); | ||
return (o$1(preact.Fragment, { children: o$1("ul", { class: "sx__date-picker__years-view", "data-testid": YEARS_VIEW, children: years.map((year) => (o$1(YearsViewAccordion, { year: year, setYearAndMonth: (year, month) => setNewDatePickerDate(year, month), isExpanded: expandedYear === year, expand: (year) => setExpandedYear(year) }))) }) })); | ||
} | ||
@@ -323,3 +321,3 @@ | ||
const $app = q$1(AppContext); | ||
const [datePickerView, setDatePickerView] = h$2(DatePickerView.MONTH_DAYS); | ||
const [datePickerView, setDatePickerView] = h(DatePickerView.MONTH_DAYS); | ||
const popupClasses = [POPUP_CLASS_NAME, $app.config.placement]; | ||
@@ -331,7 +329,7 @@ const clickOutsideListener = (event) => { | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
document.addEventListener('click', clickOutsideListener); | ||
return () => document.removeEventListener('click', clickOutsideListener); | ||
}, []); | ||
return (o$2(preact.Fragment, { children: o$2("div", { "data-testid": "date-picker-popup", class: popupClasses.join(' '), children: datePickerView === DatePickerView.MONTH_DAYS ? (o$2(MonthView, { seatYearsView: () => setDatePickerView(DatePickerView.YEARS) })) : (o$2(YearsView, { setMonthView: () => setDatePickerView(DatePickerView.MONTH_DAYS) })) }) })); | ||
return (o$1(preact.Fragment, { children: o$1("div", { "data-testid": "date-picker-popup", class: popupClasses.join(' '), children: datePickerView === DatePickerView.MONTH_DAYS ? (o$1(MonthView, { seatYearsView: () => setDatePickerView(DatePickerView.YEARS) })) : (o$1(YearsView, { setMonthView: () => setDatePickerView(DatePickerView.MONTH_DAYS) })) }) })); | ||
} | ||
@@ -346,3 +344,3 @@ | ||
classes.push('has-full-width'); | ||
return (o$2(preact.Fragment, { children: o$2("div", { class: classes.join(' '), children: o$2(AppContext.Provider, { value: $app, children: [o$2(AppInput, {}), $app.datePickerState.isOpen.value && o$2(AppPopup, {})] }) }) })); | ||
return (o$1(preact.Fragment, { children: o$1("div", { class: classes.join(' '), children: o$1(AppContext.Provider, { value: $app, children: [o$1(AppInput, {}), $app.datePickerState.isOpen.value && o$1(AppPopup, {})] }) }) })); | ||
} | ||
@@ -509,6 +507,2 @@ | ||
function i(){throw new Error("Cycle detected")}function t(){if(h$1>1){h$1--;return}let i,t=!1;while(void 0!==s){let n=s;s=void 0;f++;while(void 0!==n){const o=n.o;n.o=void 0;n.f&=-3;if(!(8&n.f)&&d$1(n))try{n.c();}catch(n){if(!t){i=n;t=!0;}}n=o;}}f=0;h$1--;if(t)throw i}let o,s,h$1=0,f=0,r=0;function e(i){if(void 0===o)return;let t=i.n;if(void 0===t||t.t!==o){t={i:0,S:i,p:o.s,n:void 0,t:o,e:void 0,x:void 0,r:t};if(void 0!==o.s)o.s.n=t;o.s=t;i.n=t;if(32&o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=o.s;t.n=void 0;o.s.n=t;o.s=t;}return t}}function c$1(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0;}c$1.prototype.h=function(){return !0};c$1.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i;}};c$1.prototype.U=function(i){if(void 0!==this.t){const t=i.e,n=i.x;if(void 0!==t){t.x=n;i.e=void 0;}if(void 0!==n){n.e=t;i.x=void 0;}if(i===this.t)this.t=n;}};c$1.prototype.subscribe=function(i){const t=this;return b(function(){const n=t.value,o=32&this.f;this.f&=-33;try{i(n);}finally{this.f|=o;}})};c$1.prototype.valueOf=function(){return this.value};c$1.prototype.toString=function(){return this.value+""};c$1.prototype.toJSON=function(){return this.value};c$1.prototype.peek=function(){return this.v};Object.defineProperty(c$1.prototype,"value",{get(){const i=e(this);if(void 0!==i)i.i=this.i;return this.v},set(n){if(o instanceof a$1)!function(){throw new Error("Computed cannot have side-effects")}();if(n!==this.v){if(f>100)i();this.v=n;this.i++;r++;h$1++;try{for(let i=this.t;void 0!==i;i=i.x)i.t.N();}finally{t();}}}});function u(i){return new c$1(i)}function d$1(i){for(let t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return !0;return !1}function v(i){for(let t=i.s;void 0!==t;t=t.n){const n=t.S.n;if(void 0!==n)t.r=n;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function l(i){let t,n=i.s;while(void 0!==n){const i=n.p;if(-1===n.i){n.S.U(n);if(void 0!==i)i.n=n.n;if(void 0!==n.n)n.n.p=i;}else t=n;n.S.n=n.r;if(void 0!==n.r)n.r=void 0;n=i;}i.s=t;}function a$1(i){c$1.call(this,void 0);this.x=i;this.s=void 0;this.g=r-1;this.f=4;}(a$1.prototype=new c$1).h=function(){this.f&=-3;if(1&this.f)return !1;if(32==(36&this.f))return !0;this.f&=-5;if(this.g===r)return !0;this.g=r;this.f|=1;if(this.i>0&&!d$1(this)){this.f&=-2;return !0}const i=o;try{v(this);o=this;const i=this.x();if(16&this.f||this.v!==i||0===this.i){this.v=i;this.f&=-17;this.i++;}}catch(i){this.v=i;this.f|=16;this.i++;}o=i;l(this);this.f&=-2;return !0};a$1.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(let i=this.s;void 0!==i;i=i.n)i.S.S(i);}c$1.prototype.S.call(this,i);};a$1.prototype.U=function(i){if(void 0!==this.t){c$1.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(let i=this.s;void 0!==i;i=i.n)i.S.U(i);}}};a$1.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let i=this.t;void 0!==i;i=i.x)i.t.N();}};a$1.prototype.peek=function(){if(!this.h())i();if(16&this.f)throw this.v;return this.v};Object.defineProperty(a$1.prototype,"value",{get(){if(1&this.f)i();const t=e(this);this.h();if(void 0!==t)t.i=this.i;if(16&this.f)throw this.v;return this.v}});function w(i){return new a$1(i)}function y(i){const n=i.u;i.u=void 0;if("function"==typeof n){h$1++;const s=o;o=void 0;try{n();}catch(t){i.f&=-2;i.f|=8;_(i);throw t}finally{o=s;t();}}}function _(i){for(let t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;y(i);}function p$1(i){if(o!==this)throw new Error("Out-of-order effect");l(this);o=i;this.f&=-2;if(8&this.f)_(this);t();}function g(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;}g.prototype.c=function(){const i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const t=this.x();if("function"==typeof t)this.u=t;}finally{i();}};g.prototype.S=function(){if(1&this.f)i();this.f|=1;this.f&=-9;y(this);v(this);h$1++;const t=o;o=this;return p$1.bind(this,t)};g.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=s;s=this;}};g.prototype.d=function(){this.f|=8;if(!(1&this.f))_(this);};function b(i){const t=new g(i);try{t.c();}catch(i){t.d();throw i}return t.d.bind(t)} | ||
function c(t,e){preact.options[t]=e.bind(null,preact.options[t]||(()=>{}));}let a;function d(t){if(a)a();a=t&&t.S();}function p({data:t}){const i=useSignal(t);i.value=t;const n=F$1(()=>{let t=this.__v;while(t=t.__)if(t.__c){t.__c.__$f|=4;break}this.__$u.c=()=>{this.base.data=n.peek();};return w(()=>{let t=i.value.value;return 0===t?0:!0===t?"":t||""})},[]);return n.value}p.displayName="_st";Object.defineProperties(c$1.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:p},props:{configurable:!0,get(){return {data:this}}},__b:{configurable:!0,value:1}});c("__b",(t,i)=>{if("string"==typeof i.type){let t,e=i.props;for(let n in e){if("children"===n)continue;let o=e[n];if(o instanceof c$1){if(!t)i.__np=t={};t[n]=o;e[n]=o.peek();}}}t(i);});c("__r",(t,i)=>{d();let e,n=i.__c;if(n){n.__$f&=-2;e=n.__$u;if(void 0===e)n.__$u=e=function(t){let i;b(function(){i=this;});i.c=()=>{n.__$f|=1;n.setState({});};return i}();}d(e);t(i);});c("__e",(t,i,e,n)=>{d();t(i,e,n);});c("diffed",(t,i)=>{d();let e;if("string"==typeof i.type&&(e=i.__e)){let t=i.__np,n=i.props;if(t){let i=e.U;if(i)for(let e in i){let n=i[e];if(void 0!==n&&!(e in t)){n.d();i[e]=void 0;}}else {i={};e.U=i;}for(let o in t){let r=i[o],f=t[o];if(void 0===r){r=h(e,o,f,n);i[o]=r;}else r.o(f,n);}}}t(i);});function h(t,i,e,n){const o=i in t&&void 0===t.ownerSVGElement,r=u(e);return {o:(t,i)=>{r.value=t;n=i;},d:b(()=>{const e=r.value.value;if(n[i]!==e){n[i]=e;if(o)t[i]=e;else if(e)t.setAttribute(i,e);else t.removeAttribute(i);}})}}c("unmount",(t,i)=>{if("string"==typeof i.type){let t=i.__e;if(t){const i=t.U;if(i){t.U=void 0;for(let t in i){let e=i[t];if(e)e.d();}}}}else {let t=i.__c;if(t){const i=t.__$u;if(i){t.__$u=void 0;i.d();}}}t(i);});c("__h",(t,i,e,n)=>{if(n<3||9===n)i.__$f|=2;t(i,e,n);});preact.Component.prototype.shouldComponentUpdate=function(t,i){const e=this.__$u;if(!(e&&void 0!==e.s||4&this.__$f))return !0;if(3&this.__$f)return !0;for(let t in i)return !0;for(let i in t)if("__source"!==i&&t[i]!==this.props[i])return !0;for(let i in this.props)if(!(i in t))return !0;return !1};function useSignal(t){return F$1(()=>u(t),[])} | ||
var DateFormatDelimiter; | ||
@@ -614,8 +608,8 @@ (function (DateFormatDelimiter) { | ||
: currentDayDateString; | ||
const isOpen = u(false); | ||
const datePickerView = u(DatePickerView.MONTH_DAYS); | ||
const selectedDate = u(initialSelectedDate); | ||
const datePickerDate = u(initialSelectedDate || currentDayDateString); | ||
const inputDisplayedValue = u(selectedDateParam || ''); | ||
b(() => { | ||
const isOpen = signals.signal(false); | ||
const datePickerView = signals.signal(DatePickerView.MONTH_DAYS); | ||
const selectedDate = signals.signal(initialSelectedDate); | ||
const datePickerDate = signals.signal(initialSelectedDate || currentDayDateString); | ||
const inputDisplayedValue = signals.signal(selectedDateParam || ''); | ||
signals.effect(() => { | ||
try { | ||
@@ -630,3 +624,3 @@ const newValue = toDateString(inputDisplayedValue.value, config.locale); | ||
}); | ||
b(() => { | ||
signals.effect(() => { | ||
var _a; | ||
@@ -866,4 +860,15 @@ if ((_a = config.listeners) === null || _a === void 0 ? void 0 : _a.onChange) | ||
const calendarDeDE = { | ||
Today: 'Heute', | ||
Month: 'Monat', | ||
Week: 'Woche', | ||
Day: 'Tag', | ||
events: 'Ereignisse', | ||
event: 'Ereignis', | ||
'No events': 'Keine Ereignisse', | ||
}; | ||
const deDE = { | ||
...datePickerDeDE, | ||
...calendarDeDE, | ||
}; | ||
@@ -878,4 +883,15 @@ | ||
const calendarEnUS = { | ||
Today: 'Today', | ||
Month: 'Month', | ||
Week: 'Week', | ||
Day: 'Day', | ||
events: 'events', | ||
event: 'event', | ||
'No events': 'No events', | ||
}; | ||
const enUS = { | ||
...datePickerEnUS, | ||
...calendarEnUS, | ||
}; | ||
@@ -906,4 +922,15 @@ | ||
const calendarEnGB = { | ||
Today: 'Today', | ||
Month: 'Month', | ||
Week: 'Week', | ||
Day: 'Day', | ||
events: 'events', | ||
event: 'event', | ||
'No events': 'No events', | ||
}; | ||
const enGB = { | ||
...datePickerEnGB, | ||
...calendarEnGB, | ||
}; | ||
@@ -918,4 +945,15 @@ | ||
const calendarSvSE = { | ||
Today: 'Idag', | ||
Month: 'Månad', | ||
Week: 'Vecka', | ||
Day: 'Dag', | ||
events: 'händelser', | ||
event: 'händelse', | ||
'No events': 'Inga händelser', | ||
}; | ||
const svSE = { | ||
...datePickerSvSE, | ||
...calendarSvSE, | ||
}; | ||
@@ -930,4 +968,15 @@ | ||
const calendarZhCN = { | ||
Today: '今天', | ||
Month: '月', | ||
Week: '周', | ||
Day: '日', | ||
events: '场活动', | ||
event: '活动', | ||
'No events': '没有活动', | ||
}; | ||
const zhCN = { | ||
...datePickerZhCN, | ||
...calendarZhCN, | ||
}; | ||
@@ -934,0 +983,0 @@ |
157
dist/core.js
import { options, createContext, Component, createElement, Fragment, toChildArray, render } from 'preact'; | ||
import { signal, effect } from '@preact/signals'; | ||
var _$1=0;function o$2(o,e,n,t,f,l){var s,u,a={};for(u in e)"ref"==u?s=e[u]:a[u]=e[u];var i={type:o,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--_$1,__source:f,__self:l};if("function"==typeof o&&(s=o.defaultProps))for(u in s)void 0===a[u]&&(a[u]=s[u]);return options.vnode&&options.vnode(i),i} | ||
var _=0;function o$1(o,e,n,t,f,l){var s,u,a={};for(u in e)"ref"==u?s=e[u]:a[u]=e[u];var i={type:o,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--_,__source:f,__self:l};if("function"==typeof o&&(s=o.defaultProps))for(u in s)void 0===a[u]&&(a[u]=s[u]);return options.vnode&&options.vnode(i),i} | ||
const AppContext = createContext({}); | ||
var t$1,r$1,u$1,i$1,o$1=0,f$1=[],c$2=[],e$1=options.__b,a$2=options.__r,v$1=options.diffed,l$1=options.__c,m=options.unmount;function d$2(t,u){options.__h&&options.__h(r$1,t,o$1||u),o$1=0;var i=r$1.__H||(r$1.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c$2}),i.__[t]}function h$2(n){return o$1=1,s$1(B$1,n)}function s$1(n,u,i){var o=d$2(t$1++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r$1,!r$1.u)){var f=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r$1.u=!0;var c=r$1.shouldComponentUpdate,e=r$1.componentWillUpdate;r$1.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r$1.shouldComponentUpdate=f;}return o.__N||o.__}function p$2(u,i){var o=d$2(t$1++,3);!options.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r$1.__H.__h.push(o));}function F$1(n,r){var u=d$2(t$1++,7);return z(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function q$1(n){var u=r$1.context[n.__c],i=d$2(t$1++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r$1)),u.props.value):n.__}function b$1(){for(var t;t=f$1.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w$2),t.__H.__h=[];}catch(r){t.__H.__h=[],options.__e(r,t.__v);}}options.__b=function(n){r$1=null,e$1&&e$1(n);},options.__r=function(n){a$2&&a$2(n),t$1=0;var i=(r$1=n.__c).__H;i&&(u$1===r$1?(i.__h=[],r$1.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c$2,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w$2),i.__h=[],t$1=0)),u$1=r$1;},options.diffed=function(t){v$1&&v$1(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f$1.push(o)&&i$1===options.requestAnimationFrame||((i$1=options.requestAnimationFrame)||j)(b$1)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c$2&&(n.__=n.__V),n.i=void 0,n.__V=c$2;})),u$1=r$1=null;},options.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w$2(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],options.__e(u,t.__v);}}),l$1&&l$1(t,r);},options.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&options.__e(r,u.__v));};var g$2="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g$2&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g$2&&(t=requestAnimationFrame(r));}function k(n){var t=r$1,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r$1=t;}function w$2(n){var t=r$1;n.__c=n.__(),r$1=t;}function z(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B$1(n,t){return "function"==typeof t?t(n):t} | ||
var t,r,u,i,o=0,f=[],c=[],e=options.__b,a=options.__r,v=options.diffed,l=options.__c,m=options.unmount;function d(t,u){options.__h&&options.__h(r,t,o||u),o=0;var i=r.__H||(r.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c}),i.__[t]}function h(n){return o=1,s(B$1,n)}function s(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r.shouldComponentUpdate=f;}return o.__N||o.__}function p(u,i){var o=d(t++,3);!options.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__H.__h.push(o));}function q$1(n){var u=r.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w$1),t.__H.__h=[];}catch(r){t.__H.__h=[],options.__e(r,t.__v);}}options.__b=function(n){r=null,e&&e(n);},options.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w$1),i.__h=[],t=0)),u=r;},options.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===options.requestAnimationFrame||((i=options.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c;})),u=r=null;},options.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w$1(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],options.__e(u,t.__v);}}),l&&l(t,r);},options.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&options.__e(r,u.__v));};var g$1="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g$1&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g$1&&(t=requestAnimationFrame(r));}function k(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function w$1(n){var t=r;n.__c=n.__(),r=t;}function z(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B$1(n,t){return "function"==typeof t?t(n):t} | ||
function g$1(n,t){for(var e in t)n[e]=t[e];return n}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function w$1(n){this.props=n;}(w$1.prototype=new Component).isPureReactComponent=!0,w$1.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var R=options.__b;options.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),R&&R(n);};var T=options.__e;options.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);T(n,t,e,r);};var I=options.unmount;function L(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g$1({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)})),n}function U(n,t,e){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return U(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function D(){this.__u=0,this.t=null,this.__b=null;}function F(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function V(){this.u=null,this.o=null;}options.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),I&&I(n);},(D.prototype=new Component).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=F(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=U(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate();}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},D.prototype.componentWillUnmount=function(){this.t=[];},D.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=L(this.__b,r,o.__O=o.__P);}this.__b=null;}var i=e.__a&&createElement(Fragment,null,n.fallback);return i&&(i.__h=null),[createElement(Fragment,null,e.__a?null:n.children),i]};var W=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};(V.prototype=new Component).__a=function(n){var t=this,e=F(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),W(t,n,r)):u();};e?e(o):o();}},V.prototype.render=function(n){this.u=null,this.o=new Map;var t=toChildArray(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){W(n,e,t);});};var B="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,H=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Z=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Y=/[A-Z0-9]/g,$="undefined"!=typeof document,q=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Component.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n});}});});var K=options.event;function Q(){}function X(){return this.cancelBubble}function nn(){return this.defaultPrevented}options.event=function(n){return K&&(n=K(n)),n.persist=Q,n.isPropagationStopped=X,n.isDefaultPrevented=nn,n.nativeEvent=n};var en={enumerable:!1,configurable:!0,get:function(){return this.class}},rn=options.vnode;options.vnode=function(n){"string"==typeof n.type&&function(n){var t=n.props,e=n.type,u={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||$&&"children"===o&&"noscript"===e||"class"===o||"className"===o)){var l=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===l?o="ondblclick":"onchange"!==l||"input"!==e&&"textarea"!==e||q(t.type)?"onfocus"===l?o="onfocusin":"onblur"===l?o="onfocusout":Z.test(o)?o=l:-1===e.indexOf("-")&&H.test(o)?o=o.replace(Y,"-$&").toLowerCase():null===i&&(i=void 0):l=o="oninput","oninput"===l&&u[o=l]&&(o="oninputCapture"),u[o]=i;}}"select"==e&&u.multiple&&Array.isArray(u.value)&&(u.value=toChildArray(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),"select"==e&&null!=u.defaultValue&&(u.value=toChildArray(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;})),t.class&&!t.className?(u.class=t.class,Object.defineProperty(u,"className",en)):(t.className&&!t.class||t.class&&t.className)&&(u.class=u.className=t.className),n.props=u;}(n),n.$$typeof=B,rn&&rn(n);};var un=options.__r;options.__r=function(n){un&&un(n),n.__c;};var on=options.diffed;options.diffed=function(n){on&&on(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value);}; | ||
function g(n,t){for(var e in t)n[e]=t[e];return n}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function w(n){this.props=n;}(w.prototype=new Component).isPureReactComponent=!0,w.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var R=options.__b;options.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),R&&R(n);};var T=options.__e;options.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);T(n,t,e,r);};var I=options.unmount;function L(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)})),n}function U(n,t,e){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return U(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function D(){this.__u=0,this.t=null,this.__b=null;}function F(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function V(){this.u=null,this.o=null;}options.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),I&&I(n);},(D.prototype=new Component).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=F(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=U(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate();}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},D.prototype.componentWillUnmount=function(){this.t=[];},D.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=L(this.__b,r,o.__O=o.__P);}this.__b=null;}var i=e.__a&&createElement(Fragment,null,n.fallback);return i&&(i.__h=null),[createElement(Fragment,null,e.__a?null:n.children),i]};var W=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};(V.prototype=new Component).__a=function(n){var t=this,e=F(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),W(t,n,r)):u();};e?e(o):o();}},V.prototype.render=function(n){this.u=null,this.o=new Map;var t=toChildArray(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){W(n,e,t);});};var B="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,H=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Z=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Y=/[A-Z0-9]/g,$="undefined"!=typeof document,q=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Component.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n});}});});var K=options.event;function Q(){}function X(){return this.cancelBubble}function nn(){return this.defaultPrevented}options.event=function(n){return K&&(n=K(n)),n.persist=Q,n.isPropagationStopped=X,n.isDefaultPrevented=nn,n.nativeEvent=n};var en={enumerable:!1,configurable:!0,get:function(){return this.class}},rn=options.vnode;options.vnode=function(n){"string"==typeof n.type&&function(n){var t=n.props,e=n.type,u={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||$&&"children"===o&&"noscript"===e||"class"===o||"className"===o)){var l=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===l?o="ondblclick":"onchange"!==l||"input"!==e&&"textarea"!==e||q(t.type)?"onfocus"===l?o="onfocusin":"onblur"===l?o="onfocusout":Z.test(o)?o=l:-1===e.indexOf("-")&&H.test(o)?o=o.replace(Y,"-$&").toLowerCase():null===i&&(i=void 0):l=o="oninput","oninput"===l&&u[o=l]&&(o="oninputCapture"),u[o]=i;}}"select"==e&&u.multiple&&Array.isArray(u.value)&&(u.value=toChildArray(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),"select"==e&&null!=u.defaultValue&&(u.value=toChildArray(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;})),t.class&&!t.className?(u.class=t.class,Object.defineProperty(u,"className",en)):(t.className&&!t.class||t.class&&t.className)&&(u.class=u.className=t.className),n.props=u;}(n),n.$$typeof=B,rn&&rn(n);};var un=options.__r;options.__r=function(n){un&&un(n),n.__c;};var on=options.diffed;options.diffed=function(n){on&&on(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value);}; | ||
@@ -57,7 +58,12 @@ const DateFormats = { | ||
}; | ||
const getDayNameShort = (date, locale) => date.toLocaleString(locale, { weekday: 'short' }); | ||
const getDayNamesShort = (week, locale) => { | ||
return week.map((date) => { | ||
return date.toLocaleString(locale, { weekday: 'short' }); | ||
}); | ||
return week.map((date) => getDayNameShort(date, locale)); | ||
}; | ||
const getOneLetterOrShortDayNames = (week, locale) => { | ||
if (['zh-cn'].includes(locale.toLowerCase())) { | ||
return getDayNamesShort(week, locale); | ||
} | ||
return getOneLetterDayNames(week, locale); | ||
}; | ||
@@ -73,7 +79,7 @@ var img = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3c!-- Uploaded to: SVG Repo%2c www.svgrepo.com%2c Generator: SVG Repo Mixer Tools --%3e%3csvg width='800px' height='800px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 9L12 15L18 9' stroke='%23DED8E1' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"; | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
$app.datePickerState.inputDisplayedValue.value = getLocalizedDate($app.datePickerState.selectedDate.value); | ||
}, [$app.datePickerState.selectedDate.value]); | ||
const [wrapperClasses, setWrapperClasses] = h$2([]); | ||
p$2(() => { | ||
const [wrapperClasses, setWrapperClasses] = h([]); | ||
p(() => { | ||
const newClasses = ['sx__date-input-wrapper']; | ||
@@ -98,3 +104,3 @@ if ($app.datePickerState.isOpen.value) | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
document.addEventListener('change', handleInputValue); // Preact onChange triggers on every input | ||
@@ -107,3 +113,3 @@ return () => document.removeEventListener('change', handleInputValue); | ||
}; | ||
return (o$2(Fragment, { children: o$2("div", { class: wrapperClasses.join(' '), children: [o$2("label", { class: "sx__date-input-label", children: $app.translate('Date') }), o$2("input", { value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", class: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), o$2("img", { class: "sx__date-input-chevron", src: img, alt: "" })] }) })); | ||
return (o$1(Fragment, { children: o$1("div", { class: wrapperClasses.join(' '), children: [o$1("label", { class: "sx__date-input-label", children: $app.translate('Date') }), o$1("input", { value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", class: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), o$1("img", { class: "sx__date-input-chevron", src: img, alt: "" })] }) })); | ||
} | ||
@@ -139,2 +145,8 @@ | ||
const doubleDigit = (number) => { | ||
if (number < 0 || number > 99) | ||
throw new NumberRangeError(0, 99); | ||
return String(number).padStart(2, '0'); | ||
}; | ||
const toDateString$1 = (date) => { | ||
@@ -161,7 +173,2 @@ return `${date.getFullYear()}-${doubleDigit(date.getMonth() + 1)}-${doubleDigit(date.getDate())}`; | ||
const doubleDigit = (number) => { | ||
if (number < 0 || number > 99) | ||
throw new NumberRangeError(0, 99); | ||
return String(number).padStart(2, '0'); | ||
}; | ||
const setDateOfMonth = (dateString, date) => { | ||
@@ -187,7 +194,6 @@ dateString = dateString.slice(0, 8) + doubleDigit(date) + dateString.slice(10); | ||
const getYearFrom = (datePickerDate) => { | ||
const { year } = toIntegers(datePickerDate); | ||
return year; | ||
return toIntegers(datePickerDate).year; | ||
}; | ||
const [selectedDateMonthName, setSelectedDateMonthName] = h$2(dateStringToLocalizedMonthName($app.datePickerState.datePickerDate.value)); | ||
const [datePickerYear, setDatePickerYear] = h$2(getYearFrom($app.datePickerState.datePickerDate.value)); | ||
const [selectedDateMonthName, setSelectedDateMonthName] = h(dateStringToLocalizedMonthName($app.datePickerState.datePickerDate.value)); | ||
const [datePickerYear, setDatePickerYear] = h(getYearFrom($app.datePickerState.datePickerDate.value)); | ||
const setPreviousMonth = () => { | ||
@@ -199,3 +205,3 @@ $app.datePickerState.datePickerDate.value = getFirstDayOPreviousMonth($app.datePickerState.datePickerDate.value); | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
setSelectedDateMonthName(dateStringToLocalizedMonthName($app.datePickerState.datePickerDate.value)); | ||
@@ -208,3 +214,3 @@ setDatePickerYear(getYearFrom($app.datePickerState.datePickerDate.value)); | ||
}; | ||
return (o$2(Fragment, { children: o$2("header", { class: "sx__date-picker__month-view-header", children: [o$2("button", { className: "sx__date-picker__chevron-wrapper", onClick: () => setPreviousMonth(), children: o$2("i", { class: "sx__date-picker__chevron sx__date-picker__chevron--previous", children: $app.translate('Previous month') }) }), o$2("button", { className: "sx__date-picker__month-view-header__month-year", onClick: (event) => handleOpenYearsView(event), children: selectedDateMonthName + ' ' + datePickerYear }), o$2("button", { className: "sx__date-picker__chevron-wrapper", onClick: () => setNextMonth(), children: o$2("i", { class: "sx__date-picker__chevron sx__date-picker__chevron--next", children: $app.translate('Next month') }) })] }) })); | ||
return (o$1(Fragment, { children: o$1("header", { class: "sx__date-picker__month-view-header", children: [o$1("button", { className: "sx__date-picker__chevron-wrapper sx__ripple", onClick: () => setPreviousMonth(), children: o$1("i", { class: "sx__date-picker__chevron sx__date-picker__chevron--previous", children: $app.translate('Previous month') }) }), o$1("button", { className: "sx__date-picker__month-view-header__month-year", onClick: (event) => handleOpenYearsView(event), children: selectedDateMonthName + ' ' + datePickerYear }), o$1("button", { className: "sx__date-picker__chevron-wrapper sx__ripple", onClick: () => setNextMonth(), children: o$1("i", { class: "sx__date-picker__chevron sx__date-picker__chevron--next", children: $app.translate('Next month') }) })] }) })); | ||
} | ||
@@ -215,10 +221,4 @@ | ||
const aWeek = $app.timeUnitsImpl.getWeekFor(toJSDate($app.datePickerState.datePickerDate.value)); | ||
let dayNames = []; | ||
if (['zh-cn'].includes($app.config.locale.toLowerCase())) { | ||
dayNames = getDayNamesShort(aWeek, $app.config.locale); | ||
} | ||
else { | ||
dayNames = getOneLetterDayNames(aWeek, $app.config.locale); | ||
} | ||
return (o$2("div", { class: "sx__date-picker__day-names", children: dayNames.map((dayName) => (o$2("span", { "data-testid": "day-name", class: "sx__date-picker__day-name", children: dayName }))) })); | ||
const dayNames = getOneLetterOrShortDayNames(aWeek, $app.config.locale); | ||
return (o$1("div", { class: "sx__date-picker__day-names", children: dayNames.map((dayName) => (o$1("span", { "data-testid": "day-name", class: "sx__date-picker__day-name", children: dayName }))) })); | ||
} | ||
@@ -260,3 +260,3 @@ | ||
}; | ||
return (o$2(Fragment, { children: o$2("div", { "data-testid": DATE_PICKER_WEEK, class: "sx__date-picker__week", children: weekDays.map((weekDay) => (o$2("button", { disabled: !isDateSelectable(weekDay.day), class: weekDay.classes.join(' '), onClick: () => selectDate(weekDay.day), children: weekDay.day.getDate() }))) }) })); | ||
return (o$1(Fragment, { children: o$1("div", { "data-testid": DATE_PICKER_WEEK, class: "sx__date-picker__week", children: weekDays.map((weekDay) => (o$1("button", { disabled: !isDateSelectable(weekDay.day), class: weekDay.classes.join(' '), onClick: () => selectDate(weekDay.day), children: weekDay.day.getDate() }))) }) })); | ||
} | ||
@@ -266,3 +266,3 @@ | ||
const $app = q$1(AppContext); | ||
const [month, setMonth] = h$2([]); | ||
const [month, setMonth] = h([]); | ||
const renderMonth = () => { | ||
@@ -272,6 +272,6 @@ const newDatePickerDate = toJSDate($app.datePickerState.datePickerDate.value); | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
renderMonth(); | ||
}, [$app.datePickerState.datePickerDate.value]); | ||
return (o$2(Fragment, { children: o$2("div", { "data-testid": MONTH_VIEW, class: "sx__date-picker__month-view", children: [o$2(MonthViewHeader, { setYearsView: seatYearsView }), o$2(DayNames, {}), month.map((week) => (o$2(MonthViewWeek, { week: week })))] }) })); | ||
return (o$1(Fragment, { children: o$1("div", { "data-testid": MONTH_VIEW, class: "sx__date-picker__month-view", children: [o$1(MonthViewHeader, { setYearsView: seatYearsView }), o$1(DayNames, {}), month.map((week) => (o$1(MonthViewWeek, { week: week })))] }) })); | ||
} | ||
@@ -286,3 +286,3 @@ | ||
}; | ||
return (o$2(Fragment, { children: o$2("li", { class: isExpanded ? 'sx__is-expanded' : '', children: [o$2("button", { class: "sx__date-picker__years-accordion__expand-button", onClick: () => expand(year), children: year }), isExpanded && (o$2("div", { class: "sx__date-picker__years-view-accordion__panel", children: yearWithDates.map((month) => (o$2("button", { class: "sx__date-picker__years-view-accordion__month", onClick: (event) => handleClickOnMonth(event, month), children: toLocalizedMonth(month, $app.config.locale) }))) }))] }) })); | ||
return (o$1(Fragment, { children: o$1("li", { class: isExpanded ? 'sx__is-expanded' : '', children: [o$1("button", { class: "sx__date-picker__years-accordion__expand-button sx__ripple--wide", onClick: () => expand(year), children: year }), isExpanded && (o$1("div", { class: "sx__date-picker__years-view-accordion__panel", children: yearWithDates.map((month) => (o$1("button", { class: "sx__date-picker__years-view-accordion__month", onClick: (event) => handleClickOnMonth(event, month), children: toLocalizedMonth(month, $app.config.locale) }))) }))] }) })); | ||
} | ||
@@ -295,3 +295,3 @@ | ||
const years = Array.from({ length: maxYear - minYear + 1 }, (_, i) => minYear + i); | ||
const [expandedYear, setExpandedYear] = h$2(new Date().getFullYear()); | ||
const [expandedYear, setExpandedYear] = h(new Date().getFullYear()); | ||
const setNewDatePickerDate = (year, month) => { | ||
@@ -301,3 +301,3 @@ $app.datePickerState.datePickerDate.value = toDateString$1(new Date(year, month, 1)); | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
var _a; | ||
@@ -312,3 +312,3 @@ const initiallyExpandedYear = (_a = document | ||
}, []); | ||
return (o$2(Fragment, { children: o$2("ul", { class: "sx__date-picker__years-view", "data-testid": YEARS_VIEW, children: years.map((year) => (o$2(YearsViewAccordion, { year: year, setYearAndMonth: (year, month) => setNewDatePickerDate(year, month), isExpanded: expandedYear === year, expand: (year) => setExpandedYear(year) }))) }) })); | ||
return (o$1(Fragment, { children: o$1("ul", { class: "sx__date-picker__years-view", "data-testid": YEARS_VIEW, children: years.map((year) => (o$1(YearsViewAccordion, { year: year, setYearAndMonth: (year, month) => setNewDatePickerDate(year, month), isExpanded: expandedYear === year, expand: (year) => setExpandedYear(year) }))) }) })); | ||
} | ||
@@ -319,3 +319,3 @@ | ||
const $app = q$1(AppContext); | ||
const [datePickerView, setDatePickerView] = h$2(DatePickerView.MONTH_DAYS); | ||
const [datePickerView, setDatePickerView] = h(DatePickerView.MONTH_DAYS); | ||
const popupClasses = [POPUP_CLASS_NAME, $app.config.placement]; | ||
@@ -327,7 +327,7 @@ const clickOutsideListener = (event) => { | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
document.addEventListener('click', clickOutsideListener); | ||
return () => document.removeEventListener('click', clickOutsideListener); | ||
}, []); | ||
return (o$2(Fragment, { children: o$2("div", { "data-testid": "date-picker-popup", class: popupClasses.join(' '), children: datePickerView === DatePickerView.MONTH_DAYS ? (o$2(MonthView, { seatYearsView: () => setDatePickerView(DatePickerView.YEARS) })) : (o$2(YearsView, { setMonthView: () => setDatePickerView(DatePickerView.MONTH_DAYS) })) }) })); | ||
return (o$1(Fragment, { children: o$1("div", { "data-testid": "date-picker-popup", class: popupClasses.join(' '), children: datePickerView === DatePickerView.MONTH_DAYS ? (o$1(MonthView, { seatYearsView: () => setDatePickerView(DatePickerView.YEARS) })) : (o$1(YearsView, { setMonthView: () => setDatePickerView(DatePickerView.MONTH_DAYS) })) }) })); | ||
} | ||
@@ -342,3 +342,3 @@ | ||
classes.push('has-full-width'); | ||
return (o$2(Fragment, { children: o$2("div", { class: classes.join(' '), children: o$2(AppContext.Provider, { value: $app, children: [o$2(AppInput, {}), $app.datePickerState.isOpen.value && o$2(AppPopup, {})] }) }) })); | ||
return (o$1(Fragment, { children: o$1("div", { class: classes.join(' '), children: o$1(AppContext.Provider, { value: $app, children: [o$1(AppInput, {}), $app.datePickerState.isOpen.value && o$1(AppPopup, {})] }) }) })); | ||
} | ||
@@ -505,6 +505,2 @@ | ||
function i(){throw new Error("Cycle detected")}function t(){if(h$1>1){h$1--;return}let i,t=!1;while(void 0!==s){let n=s;s=void 0;f++;while(void 0!==n){const o=n.o;n.o=void 0;n.f&=-3;if(!(8&n.f)&&d$1(n))try{n.c();}catch(n){if(!t){i=n;t=!0;}}n=o;}}f=0;h$1--;if(t)throw i}let o,s,h$1=0,f=0,r=0;function e(i){if(void 0===o)return;let t=i.n;if(void 0===t||t.t!==o){t={i:0,S:i,p:o.s,n:void 0,t:o,e:void 0,x:void 0,r:t};if(void 0!==o.s)o.s.n=t;o.s=t;i.n=t;if(32&o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=o.s;t.n=void 0;o.s.n=t;o.s=t;}return t}}function c$1(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0;}c$1.prototype.h=function(){return !0};c$1.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i;}};c$1.prototype.U=function(i){if(void 0!==this.t){const t=i.e,n=i.x;if(void 0!==t){t.x=n;i.e=void 0;}if(void 0!==n){n.e=t;i.x=void 0;}if(i===this.t)this.t=n;}};c$1.prototype.subscribe=function(i){const t=this;return b(function(){const n=t.value,o=32&this.f;this.f&=-33;try{i(n);}finally{this.f|=o;}})};c$1.prototype.valueOf=function(){return this.value};c$1.prototype.toString=function(){return this.value+""};c$1.prototype.toJSON=function(){return this.value};c$1.prototype.peek=function(){return this.v};Object.defineProperty(c$1.prototype,"value",{get(){const i=e(this);if(void 0!==i)i.i=this.i;return this.v},set(n){if(o instanceof a$1)!function(){throw new Error("Computed cannot have side-effects")}();if(n!==this.v){if(f>100)i();this.v=n;this.i++;r++;h$1++;try{for(let i=this.t;void 0!==i;i=i.x)i.t.N();}finally{t();}}}});function u(i){return new c$1(i)}function d$1(i){for(let t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return !0;return !1}function v(i){for(let t=i.s;void 0!==t;t=t.n){const n=t.S.n;if(void 0!==n)t.r=n;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function l(i){let t,n=i.s;while(void 0!==n){const i=n.p;if(-1===n.i){n.S.U(n);if(void 0!==i)i.n=n.n;if(void 0!==n.n)n.n.p=i;}else t=n;n.S.n=n.r;if(void 0!==n.r)n.r=void 0;n=i;}i.s=t;}function a$1(i){c$1.call(this,void 0);this.x=i;this.s=void 0;this.g=r-1;this.f=4;}(a$1.prototype=new c$1).h=function(){this.f&=-3;if(1&this.f)return !1;if(32==(36&this.f))return !0;this.f&=-5;if(this.g===r)return !0;this.g=r;this.f|=1;if(this.i>0&&!d$1(this)){this.f&=-2;return !0}const i=o;try{v(this);o=this;const i=this.x();if(16&this.f||this.v!==i||0===this.i){this.v=i;this.f&=-17;this.i++;}}catch(i){this.v=i;this.f|=16;this.i++;}o=i;l(this);this.f&=-2;return !0};a$1.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(let i=this.s;void 0!==i;i=i.n)i.S.S(i);}c$1.prototype.S.call(this,i);};a$1.prototype.U=function(i){if(void 0!==this.t){c$1.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(let i=this.s;void 0!==i;i=i.n)i.S.U(i);}}};a$1.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let i=this.t;void 0!==i;i=i.x)i.t.N();}};a$1.prototype.peek=function(){if(!this.h())i();if(16&this.f)throw this.v;return this.v};Object.defineProperty(a$1.prototype,"value",{get(){if(1&this.f)i();const t=e(this);this.h();if(void 0!==t)t.i=this.i;if(16&this.f)throw this.v;return this.v}});function w(i){return new a$1(i)}function y(i){const n=i.u;i.u=void 0;if("function"==typeof n){h$1++;const s=o;o=void 0;try{n();}catch(t){i.f&=-2;i.f|=8;_(i);throw t}finally{o=s;t();}}}function _(i){for(let t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;y(i);}function p$1(i){if(o!==this)throw new Error("Out-of-order effect");l(this);o=i;this.f&=-2;if(8&this.f)_(this);t();}function g(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;}g.prototype.c=function(){const i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const t=this.x();if("function"==typeof t)this.u=t;}finally{i();}};g.prototype.S=function(){if(1&this.f)i();this.f|=1;this.f&=-9;y(this);v(this);h$1++;const t=o;o=this;return p$1.bind(this,t)};g.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=s;s=this;}};g.prototype.d=function(){this.f|=8;if(!(1&this.f))_(this);};function b(i){const t=new g(i);try{t.c();}catch(i){t.d();throw i}return t.d.bind(t)} | ||
function c(t,e){options[t]=e.bind(null,options[t]||(()=>{}));}let a;function d(t){if(a)a();a=t&&t.S();}function p({data:t}){const i=useSignal(t);i.value=t;const n=F$1(()=>{let t=this.__v;while(t=t.__)if(t.__c){t.__c.__$f|=4;break}this.__$u.c=()=>{this.base.data=n.peek();};return w(()=>{let t=i.value.value;return 0===t?0:!0===t?"":t||""})},[]);return n.value}p.displayName="_st";Object.defineProperties(c$1.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:p},props:{configurable:!0,get(){return {data:this}}},__b:{configurable:!0,value:1}});c("__b",(t,i)=>{if("string"==typeof i.type){let t,e=i.props;for(let n in e){if("children"===n)continue;let o=e[n];if(o instanceof c$1){if(!t)i.__np=t={};t[n]=o;e[n]=o.peek();}}}t(i);});c("__r",(t,i)=>{d();let e,n=i.__c;if(n){n.__$f&=-2;e=n.__$u;if(void 0===e)n.__$u=e=function(t){let i;b(function(){i=this;});i.c=()=>{n.__$f|=1;n.setState({});};return i}();}d(e);t(i);});c("__e",(t,i,e,n)=>{d();t(i,e,n);});c("diffed",(t,i)=>{d();let e;if("string"==typeof i.type&&(e=i.__e)){let t=i.__np,n=i.props;if(t){let i=e.U;if(i)for(let e in i){let n=i[e];if(void 0!==n&&!(e in t)){n.d();i[e]=void 0;}}else {i={};e.U=i;}for(let o in t){let r=i[o],f=t[o];if(void 0===r){r=h(e,o,f,n);i[o]=r;}else r.o(f,n);}}}t(i);});function h(t,i,e,n){const o=i in t&&void 0===t.ownerSVGElement,r=u(e);return {o:(t,i)=>{r.value=t;n=i;},d:b(()=>{const e=r.value.value;if(n[i]!==e){n[i]=e;if(o)t[i]=e;else if(e)t.setAttribute(i,e);else t.removeAttribute(i);}})}}c("unmount",(t,i)=>{if("string"==typeof i.type){let t=i.__e;if(t){const i=t.U;if(i){t.U=void 0;for(let t in i){let e=i[t];if(e)e.d();}}}}else {let t=i.__c;if(t){const i=t.__$u;if(i){t.__$u=void 0;i.d();}}}t(i);});c("__h",(t,i,e,n)=>{if(n<3||9===n)i.__$f|=2;t(i,e,n);});Component.prototype.shouldComponentUpdate=function(t,i){const e=this.__$u;if(!(e&&void 0!==e.s||4&this.__$f))return !0;if(3&this.__$f)return !0;for(let t in i)return !0;for(let i in t)if("__source"!==i&&t[i]!==this.props[i])return !0;for(let i in this.props)if(!(i in t))return !0;return !1};function useSignal(t){return F$1(()=>u(t),[])} | ||
var DateFormatDelimiter; | ||
@@ -610,8 +606,8 @@ (function (DateFormatDelimiter) { | ||
: currentDayDateString; | ||
const isOpen = u(false); | ||
const datePickerView = u(DatePickerView.MONTH_DAYS); | ||
const selectedDate = u(initialSelectedDate); | ||
const datePickerDate = u(initialSelectedDate || currentDayDateString); | ||
const inputDisplayedValue = u(selectedDateParam || ''); | ||
b(() => { | ||
const isOpen = signal(false); | ||
const datePickerView = signal(DatePickerView.MONTH_DAYS); | ||
const selectedDate = signal(initialSelectedDate); | ||
const datePickerDate = signal(initialSelectedDate || currentDayDateString); | ||
const inputDisplayedValue = signal(selectedDateParam || ''); | ||
effect(() => { | ||
try { | ||
@@ -626,3 +622,3 @@ const newValue = toDateString(inputDisplayedValue.value, config.locale); | ||
}); | ||
b(() => { | ||
effect(() => { | ||
var _a; | ||
@@ -862,4 +858,15 @@ if ((_a = config.listeners) === null || _a === void 0 ? void 0 : _a.onChange) | ||
const calendarDeDE = { | ||
Today: 'Heute', | ||
Month: 'Monat', | ||
Week: 'Woche', | ||
Day: 'Tag', | ||
events: 'Ereignisse', | ||
event: 'Ereignis', | ||
'No events': 'Keine Ereignisse', | ||
}; | ||
const deDE = { | ||
...datePickerDeDE, | ||
...calendarDeDE, | ||
}; | ||
@@ -874,4 +881,15 @@ | ||
const calendarEnUS = { | ||
Today: 'Today', | ||
Month: 'Month', | ||
Week: 'Week', | ||
Day: 'Day', | ||
events: 'events', | ||
event: 'event', | ||
'No events': 'No events', | ||
}; | ||
const enUS = { | ||
...datePickerEnUS, | ||
...calendarEnUS, | ||
}; | ||
@@ -902,4 +920,15 @@ | ||
const calendarEnGB = { | ||
Today: 'Today', | ||
Month: 'Month', | ||
Week: 'Week', | ||
Day: 'Day', | ||
events: 'events', | ||
event: 'event', | ||
'No events': 'No events', | ||
}; | ||
const enGB = { | ||
...datePickerEnGB, | ||
...calendarEnGB, | ||
}; | ||
@@ -914,4 +943,15 @@ | ||
const calendarSvSE = { | ||
Today: 'Idag', | ||
Month: 'Månad', | ||
Week: 'Vecka', | ||
Day: 'Dag', | ||
events: 'händelser', | ||
event: 'händelse', | ||
'No events': 'Inga händelser', | ||
}; | ||
const svSE = { | ||
...datePickerSvSE, | ||
...calendarSvSE, | ||
}; | ||
@@ -926,4 +966,15 @@ | ||
const calendarZhCN = { | ||
Today: '今天', | ||
Month: '月', | ||
Week: '周', | ||
Day: '日', | ||
events: '场活动', | ||
event: '活动', | ||
'No events': '没有活动', | ||
}; | ||
const zhCN = { | ||
...datePickerZhCN, | ||
...calendarZhCN, | ||
}; | ||
@@ -930,0 +981,0 @@ |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('preact')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'preact'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@schedule-x/date-picker"] = {}, global.preact)); | ||
})(this, (function (exports, preact) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('preact'), require('@preact/signals')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'preact', '@preact/signals'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@schedule-x/date-picker"] = {}, global.preact, global.signals)); | ||
})(this, (function (exports, preact, signals) { 'use strict'; | ||
var _$1=0;function o$2(o,e,n,t,f,l){var s,u,a={};for(u in e)"ref"==u?s=e[u]:a[u]=e[u];var i={type:o,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--_$1,__source:f,__self:l};if("function"==typeof o&&(s=o.defaultProps))for(u in s)void 0===a[u]&&(a[u]=s[u]);return preact.options.vnode&&preact.options.vnode(i),i} | ||
var _=0;function o$1(o,e,n,t,f,l){var s,u,a={};for(u in e)"ref"==u?s=e[u]:a[u]=e[u];var i={type:o,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--_,__source:f,__self:l};if("function"==typeof o&&(s=o.defaultProps))for(u in s)void 0===a[u]&&(a[u]=s[u]);return preact.options.vnode&&preact.options.vnode(i),i} | ||
const AppContext = preact.createContext({}); | ||
var t$1,r$1,u$1,i$1,o$1=0,f$1=[],c$2=[],e$1=preact.options.__b,a$2=preact.options.__r,v$1=preact.options.diffed,l$1=preact.options.__c,m=preact.options.unmount;function d$2(t,u){preact.options.__h&&preact.options.__h(r$1,t,o$1||u),o$1=0;var i=r$1.__H||(r$1.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c$2}),i.__[t]}function h$2(n){return o$1=1,s$1(B$1,n)}function s$1(n,u,i){var o=d$2(t$1++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r$1,!r$1.u)){var f=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r$1.u=!0;var c=r$1.shouldComponentUpdate,e=r$1.componentWillUpdate;r$1.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r$1.shouldComponentUpdate=f;}return o.__N||o.__}function p$2(u,i){var o=d$2(t$1++,3);!preact.options.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r$1.__H.__h.push(o));}function F$1(n,r){var u=d$2(t$1++,7);return z(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function q$1(n){var u=r$1.context[n.__c],i=d$2(t$1++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r$1)),u.props.value):n.__}function b$1(){for(var t;t=f$1.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w$2),t.__H.__h=[];}catch(r){t.__H.__h=[],preact.options.__e(r,t.__v);}}preact.options.__b=function(n){r$1=null,e$1&&e$1(n);},preact.options.__r=function(n){a$2&&a$2(n),t$1=0;var i=(r$1=n.__c).__H;i&&(u$1===r$1?(i.__h=[],r$1.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c$2,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w$2),i.__h=[],t$1=0)),u$1=r$1;},preact.options.diffed=function(t){v$1&&v$1(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f$1.push(o)&&i$1===preact.options.requestAnimationFrame||((i$1=preact.options.requestAnimationFrame)||j)(b$1)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c$2&&(n.__=n.__V),n.i=void 0,n.__V=c$2;})),u$1=r$1=null;},preact.options.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w$2(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],preact.options.__e(u,t.__v);}}),l$1&&l$1(t,r);},preact.options.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&preact.options.__e(r,u.__v));};var g$2="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g$2&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g$2&&(t=requestAnimationFrame(r));}function k(n){var t=r$1,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r$1=t;}function w$2(n){var t=r$1;n.__c=n.__(),r$1=t;}function z(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B$1(n,t){return "function"==typeof t?t(n):t} | ||
var t,r,u,i,o=0,f=[],c=[],e=preact.options.__b,a=preact.options.__r,v=preact.options.diffed,l=preact.options.__c,m=preact.options.unmount;function d(t,u){preact.options.__h&&preact.options.__h(r,t,o||u),o=0;var i=r.__H||(r.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c}),i.__[t]}function h(n){return o=1,s(B$1,n)}function s(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r.shouldComponentUpdate=f;}return o.__N||o.__}function p(u,i){var o=d(t++,3);!preact.options.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__H.__h.push(o));}function q$1(n){var u=r.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w$1),t.__H.__h=[];}catch(r){t.__H.__h=[],preact.options.__e(r,t.__v);}}preact.options.__b=function(n){r=null,e&&e(n);},preact.options.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w$1),i.__h=[],t=0)),u=r;},preact.options.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===preact.options.requestAnimationFrame||((i=preact.options.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c;})),u=r=null;},preact.options.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w$1(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],preact.options.__e(u,t.__v);}}),l&&l(t,r);},preact.options.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&preact.options.__e(r,u.__v));};var g$1="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g$1&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g$1&&(t=requestAnimationFrame(r));}function k(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function w$1(n){var t=r;n.__c=n.__(),r=t;}function z(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B$1(n,t){return "function"==typeof t?t(n):t} | ||
function g$1(n,t){for(var e in t)n[e]=t[e];return n}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function w$1(n){this.props=n;}(w$1.prototype=new preact.Component).isPureReactComponent=!0,w$1.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var R=preact.options.__b;preact.options.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),R&&R(n);};var T=preact.options.__e;preact.options.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);T(n,t,e,r);};var I=preact.options.unmount;function L(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g$1({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)})),n}function U(n,t,e){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return U(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function D(){this.__u=0,this.t=null,this.__b=null;}function F(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function V(){this.u=null,this.o=null;}preact.options.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),I&&I(n);},(D.prototype=new preact.Component).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=F(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=U(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate();}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},D.prototype.componentWillUnmount=function(){this.t=[];},D.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=L(this.__b,r,o.__O=o.__P);}this.__b=null;}var i=e.__a&&preact.createElement(preact.Fragment,null,n.fallback);return i&&(i.__h=null),[preact.createElement(preact.Fragment,null,e.__a?null:n.children),i]};var W=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};(V.prototype=new preact.Component).__a=function(n){var t=this,e=F(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),W(t,n,r)):u();};e?e(o):o();}},V.prototype.render=function(n){this.u=null,this.o=new Map;var t=preact.toChildArray(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){W(n,e,t);});};var B="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,H=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Z=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Y=/[A-Z0-9]/g,$="undefined"!=typeof document,q=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};preact.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(preact.Component.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n});}});});var K=preact.options.event;function Q(){}function X(){return this.cancelBubble}function nn(){return this.defaultPrevented}preact.options.event=function(n){return K&&(n=K(n)),n.persist=Q,n.isPropagationStopped=X,n.isDefaultPrevented=nn,n.nativeEvent=n};var en={enumerable:!1,configurable:!0,get:function(){return this.class}},rn=preact.options.vnode;preact.options.vnode=function(n){"string"==typeof n.type&&function(n){var t=n.props,e=n.type,u={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||$&&"children"===o&&"noscript"===e||"class"===o||"className"===o)){var l=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===l?o="ondblclick":"onchange"!==l||"input"!==e&&"textarea"!==e||q(t.type)?"onfocus"===l?o="onfocusin":"onblur"===l?o="onfocusout":Z.test(o)?o=l:-1===e.indexOf("-")&&H.test(o)?o=o.replace(Y,"-$&").toLowerCase():null===i&&(i=void 0):l=o="oninput","oninput"===l&&u[o=l]&&(o="oninputCapture"),u[o]=i;}}"select"==e&&u.multiple&&Array.isArray(u.value)&&(u.value=preact.toChildArray(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),"select"==e&&null!=u.defaultValue&&(u.value=preact.toChildArray(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;})),t.class&&!t.className?(u.class=t.class,Object.defineProperty(u,"className",en)):(t.className&&!t.class||t.class&&t.className)&&(u.class=u.className=t.className),n.props=u;}(n),n.$$typeof=B,rn&&rn(n);};var un=preact.options.__r;preact.options.__r=function(n){un&&un(n),n.__c;};var on=preact.options.diffed;preact.options.diffed=function(n){on&&on(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value);}; | ||
function g(n,t){for(var e in t)n[e]=t[e];return n}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function w(n){this.props=n;}(w.prototype=new preact.Component).isPureReactComponent=!0,w.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var R=preact.options.__b;preact.options.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),R&&R(n);};var T=preact.options.__e;preact.options.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);T(n,t,e,r);};var I=preact.options.unmount;function L(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)})),n}function U(n,t,e){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return U(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function D(){this.__u=0,this.t=null,this.__b=null;}function F(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function V(){this.u=null,this.o=null;}preact.options.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),I&&I(n);},(D.prototype=new preact.Component).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=F(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=U(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate();}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},D.prototype.componentWillUnmount=function(){this.t=[];},D.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=L(this.__b,r,o.__O=o.__P);}this.__b=null;}var i=e.__a&&preact.createElement(preact.Fragment,null,n.fallback);return i&&(i.__h=null),[preact.createElement(preact.Fragment,null,e.__a?null:n.children),i]};var W=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};(V.prototype=new preact.Component).__a=function(n){var t=this,e=F(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),W(t,n,r)):u();};e?e(o):o();}},V.prototype.render=function(n){this.u=null,this.o=new Map;var t=preact.toChildArray(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){W(n,e,t);});};var B="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,H=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Z=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Y=/[A-Z0-9]/g,$="undefined"!=typeof document,q=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};preact.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(preact.Component.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n});}});});var K=preact.options.event;function Q(){}function X(){return this.cancelBubble}function nn(){return this.defaultPrevented}preact.options.event=function(n){return K&&(n=K(n)),n.persist=Q,n.isPropagationStopped=X,n.isDefaultPrevented=nn,n.nativeEvent=n};var en={enumerable:!1,configurable:!0,get:function(){return this.class}},rn=preact.options.vnode;preact.options.vnode=function(n){"string"==typeof n.type&&function(n){var t=n.props,e=n.type,u={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||$&&"children"===o&&"noscript"===e||"class"===o||"className"===o)){var l=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===l?o="ondblclick":"onchange"!==l||"input"!==e&&"textarea"!==e||q(t.type)?"onfocus"===l?o="onfocusin":"onblur"===l?o="onfocusout":Z.test(o)?o=l:-1===e.indexOf("-")&&H.test(o)?o=o.replace(Y,"-$&").toLowerCase():null===i&&(i=void 0):l=o="oninput","oninput"===l&&u[o=l]&&(o="oninputCapture"),u[o]=i;}}"select"==e&&u.multiple&&Array.isArray(u.value)&&(u.value=preact.toChildArray(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),"select"==e&&null!=u.defaultValue&&(u.value=preact.toChildArray(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;})),t.class&&!t.className?(u.class=t.class,Object.defineProperty(u,"className",en)):(t.className&&!t.class||t.class&&t.className)&&(u.class=u.className=t.className),n.props=u;}(n),n.$$typeof=B,rn&&rn(n);};var un=preact.options.__r;preact.options.__r=function(n){un&&un(n),n.__c;};var on=preact.options.diffed;preact.options.diffed=function(n){on&&on(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value);}; | ||
@@ -61,7 +61,12 @@ const DateFormats = { | ||
}; | ||
const getDayNameShort = (date, locale) => date.toLocaleString(locale, { weekday: 'short' }); | ||
const getDayNamesShort = (week, locale) => { | ||
return week.map((date) => { | ||
return date.toLocaleString(locale, { weekday: 'short' }); | ||
}); | ||
return week.map((date) => getDayNameShort(date, locale)); | ||
}; | ||
const getOneLetterOrShortDayNames = (week, locale) => { | ||
if (['zh-cn'].includes(locale.toLowerCase())) { | ||
return getDayNamesShort(week, locale); | ||
} | ||
return getOneLetterDayNames(week, locale); | ||
}; | ||
@@ -77,7 +82,7 @@ var img = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3c!-- Uploaded to: SVG Repo%2c www.svgrepo.com%2c Generator: SVG Repo Mixer Tools --%3e%3csvg width='800px' height='800px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 9L12 15L18 9' stroke='%23DED8E1' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"; | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
$app.datePickerState.inputDisplayedValue.value = getLocalizedDate($app.datePickerState.selectedDate.value); | ||
}, [$app.datePickerState.selectedDate.value]); | ||
const [wrapperClasses, setWrapperClasses] = h$2([]); | ||
p$2(() => { | ||
const [wrapperClasses, setWrapperClasses] = h([]); | ||
p(() => { | ||
const newClasses = ['sx__date-input-wrapper']; | ||
@@ -102,3 +107,3 @@ if ($app.datePickerState.isOpen.value) | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
document.addEventListener('change', handleInputValue); // Preact onChange triggers on every input | ||
@@ -111,3 +116,3 @@ return () => document.removeEventListener('change', handleInputValue); | ||
}; | ||
return (o$2(preact.Fragment, { children: o$2("div", { class: wrapperClasses.join(' '), children: [o$2("label", { class: "sx__date-input-label", children: $app.translate('Date') }), o$2("input", { value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", class: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), o$2("img", { class: "sx__date-input-chevron", src: img, alt: "" })] }) })); | ||
return (o$1(preact.Fragment, { children: o$1("div", { class: wrapperClasses.join(' '), children: [o$1("label", { class: "sx__date-input-label", children: $app.translate('Date') }), o$1("input", { value: $app.datePickerState.inputDisplayedValue.value, "data-testid": "date-picker-input", class: "sx__date-input", onClick: handleClick, onKeyUp: handleKeyUp, type: "text" }), o$1("img", { class: "sx__date-input-chevron", src: img, alt: "" })] }) })); | ||
} | ||
@@ -143,2 +148,8 @@ | ||
const doubleDigit = (number) => { | ||
if (number < 0 || number > 99) | ||
throw new NumberRangeError(0, 99); | ||
return String(number).padStart(2, '0'); | ||
}; | ||
const toDateString$1 = (date) => { | ||
@@ -165,7 +176,2 @@ return `${date.getFullYear()}-${doubleDigit(date.getMonth() + 1)}-${doubleDigit(date.getDate())}`; | ||
const doubleDigit = (number) => { | ||
if (number < 0 || number > 99) | ||
throw new NumberRangeError(0, 99); | ||
return String(number).padStart(2, '0'); | ||
}; | ||
const setDateOfMonth = (dateString, date) => { | ||
@@ -191,7 +197,6 @@ dateString = dateString.slice(0, 8) + doubleDigit(date) + dateString.slice(10); | ||
const getYearFrom = (datePickerDate) => { | ||
const { year } = toIntegers(datePickerDate); | ||
return year; | ||
return toIntegers(datePickerDate).year; | ||
}; | ||
const [selectedDateMonthName, setSelectedDateMonthName] = h$2(dateStringToLocalizedMonthName($app.datePickerState.datePickerDate.value)); | ||
const [datePickerYear, setDatePickerYear] = h$2(getYearFrom($app.datePickerState.datePickerDate.value)); | ||
const [selectedDateMonthName, setSelectedDateMonthName] = h(dateStringToLocalizedMonthName($app.datePickerState.datePickerDate.value)); | ||
const [datePickerYear, setDatePickerYear] = h(getYearFrom($app.datePickerState.datePickerDate.value)); | ||
const setPreviousMonth = () => { | ||
@@ -203,3 +208,3 @@ $app.datePickerState.datePickerDate.value = getFirstDayOPreviousMonth($app.datePickerState.datePickerDate.value); | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
setSelectedDateMonthName(dateStringToLocalizedMonthName($app.datePickerState.datePickerDate.value)); | ||
@@ -212,3 +217,3 @@ setDatePickerYear(getYearFrom($app.datePickerState.datePickerDate.value)); | ||
}; | ||
return (o$2(preact.Fragment, { children: o$2("header", { class: "sx__date-picker__month-view-header", children: [o$2("button", { className: "sx__date-picker__chevron-wrapper", onClick: () => setPreviousMonth(), children: o$2("i", { class: "sx__date-picker__chevron sx__date-picker__chevron--previous", children: $app.translate('Previous month') }) }), o$2("button", { className: "sx__date-picker__month-view-header__month-year", onClick: (event) => handleOpenYearsView(event), children: selectedDateMonthName + ' ' + datePickerYear }), o$2("button", { className: "sx__date-picker__chevron-wrapper", onClick: () => setNextMonth(), children: o$2("i", { class: "sx__date-picker__chevron sx__date-picker__chevron--next", children: $app.translate('Next month') }) })] }) })); | ||
return (o$1(preact.Fragment, { children: o$1("header", { class: "sx__date-picker__month-view-header", children: [o$1("button", { className: "sx__date-picker__chevron-wrapper sx__ripple", onClick: () => setPreviousMonth(), children: o$1("i", { class: "sx__date-picker__chevron sx__date-picker__chevron--previous", children: $app.translate('Previous month') }) }), o$1("button", { className: "sx__date-picker__month-view-header__month-year", onClick: (event) => handleOpenYearsView(event), children: selectedDateMonthName + ' ' + datePickerYear }), o$1("button", { className: "sx__date-picker__chevron-wrapper sx__ripple", onClick: () => setNextMonth(), children: o$1("i", { class: "sx__date-picker__chevron sx__date-picker__chevron--next", children: $app.translate('Next month') }) })] }) })); | ||
} | ||
@@ -219,10 +224,4 @@ | ||
const aWeek = $app.timeUnitsImpl.getWeekFor(toJSDate($app.datePickerState.datePickerDate.value)); | ||
let dayNames = []; | ||
if (['zh-cn'].includes($app.config.locale.toLowerCase())) { | ||
dayNames = getDayNamesShort(aWeek, $app.config.locale); | ||
} | ||
else { | ||
dayNames = getOneLetterDayNames(aWeek, $app.config.locale); | ||
} | ||
return (o$2("div", { class: "sx__date-picker__day-names", children: dayNames.map((dayName) => (o$2("span", { "data-testid": "day-name", class: "sx__date-picker__day-name", children: dayName }))) })); | ||
const dayNames = getOneLetterOrShortDayNames(aWeek, $app.config.locale); | ||
return (o$1("div", { class: "sx__date-picker__day-names", children: dayNames.map((dayName) => (o$1("span", { "data-testid": "day-name", class: "sx__date-picker__day-name", children: dayName }))) })); | ||
} | ||
@@ -264,3 +263,3 @@ | ||
}; | ||
return (o$2(preact.Fragment, { children: o$2("div", { "data-testid": DATE_PICKER_WEEK, class: "sx__date-picker__week", children: weekDays.map((weekDay) => (o$2("button", { disabled: !isDateSelectable(weekDay.day), class: weekDay.classes.join(' '), onClick: () => selectDate(weekDay.day), children: weekDay.day.getDate() }))) }) })); | ||
return (o$1(preact.Fragment, { children: o$1("div", { "data-testid": DATE_PICKER_WEEK, class: "sx__date-picker__week", children: weekDays.map((weekDay) => (o$1("button", { disabled: !isDateSelectable(weekDay.day), class: weekDay.classes.join(' '), onClick: () => selectDate(weekDay.day), children: weekDay.day.getDate() }))) }) })); | ||
} | ||
@@ -270,3 +269,3 @@ | ||
const $app = q$1(AppContext); | ||
const [month, setMonth] = h$2([]); | ||
const [month, setMonth] = h([]); | ||
const renderMonth = () => { | ||
@@ -276,6 +275,6 @@ const newDatePickerDate = toJSDate($app.datePickerState.datePickerDate.value); | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
renderMonth(); | ||
}, [$app.datePickerState.datePickerDate.value]); | ||
return (o$2(preact.Fragment, { children: o$2("div", { "data-testid": MONTH_VIEW, class: "sx__date-picker__month-view", children: [o$2(MonthViewHeader, { setYearsView: seatYearsView }), o$2(DayNames, {}), month.map((week) => (o$2(MonthViewWeek, { week: week })))] }) })); | ||
return (o$1(preact.Fragment, { children: o$1("div", { "data-testid": MONTH_VIEW, class: "sx__date-picker__month-view", children: [o$1(MonthViewHeader, { setYearsView: seatYearsView }), o$1(DayNames, {}), month.map((week) => (o$1(MonthViewWeek, { week: week })))] }) })); | ||
} | ||
@@ -290,3 +289,3 @@ | ||
}; | ||
return (o$2(preact.Fragment, { children: o$2("li", { class: isExpanded ? 'sx__is-expanded' : '', children: [o$2("button", { class: "sx__date-picker__years-accordion__expand-button", onClick: () => expand(year), children: year }), isExpanded && (o$2("div", { class: "sx__date-picker__years-view-accordion__panel", children: yearWithDates.map((month) => (o$2("button", { class: "sx__date-picker__years-view-accordion__month", onClick: (event) => handleClickOnMonth(event, month), children: toLocalizedMonth(month, $app.config.locale) }))) }))] }) })); | ||
return (o$1(preact.Fragment, { children: o$1("li", { class: isExpanded ? 'sx__is-expanded' : '', children: [o$1("button", { class: "sx__date-picker__years-accordion__expand-button sx__ripple--wide", onClick: () => expand(year), children: year }), isExpanded && (o$1("div", { class: "sx__date-picker__years-view-accordion__panel", children: yearWithDates.map((month) => (o$1("button", { class: "sx__date-picker__years-view-accordion__month", onClick: (event) => handleClickOnMonth(event, month), children: toLocalizedMonth(month, $app.config.locale) }))) }))] }) })); | ||
} | ||
@@ -299,3 +298,3 @@ | ||
const years = Array.from({ length: maxYear - minYear + 1 }, (_, i) => minYear + i); | ||
const [expandedYear, setExpandedYear] = h$2(new Date().getFullYear()); | ||
const [expandedYear, setExpandedYear] = h(new Date().getFullYear()); | ||
const setNewDatePickerDate = (year, month) => { | ||
@@ -305,3 +304,3 @@ $app.datePickerState.datePickerDate.value = toDateString$1(new Date(year, month, 1)); | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
var _a; | ||
@@ -316,3 +315,3 @@ const initiallyExpandedYear = (_a = document | ||
}, []); | ||
return (o$2(preact.Fragment, { children: o$2("ul", { class: "sx__date-picker__years-view", "data-testid": YEARS_VIEW, children: years.map((year) => (o$2(YearsViewAccordion, { year: year, setYearAndMonth: (year, month) => setNewDatePickerDate(year, month), isExpanded: expandedYear === year, expand: (year) => setExpandedYear(year) }))) }) })); | ||
return (o$1(preact.Fragment, { children: o$1("ul", { class: "sx__date-picker__years-view", "data-testid": YEARS_VIEW, children: years.map((year) => (o$1(YearsViewAccordion, { year: year, setYearAndMonth: (year, month) => setNewDatePickerDate(year, month), isExpanded: expandedYear === year, expand: (year) => setExpandedYear(year) }))) }) })); | ||
} | ||
@@ -323,3 +322,3 @@ | ||
const $app = q$1(AppContext); | ||
const [datePickerView, setDatePickerView] = h$2(DatePickerView.MONTH_DAYS); | ||
const [datePickerView, setDatePickerView] = h(DatePickerView.MONTH_DAYS); | ||
const popupClasses = [POPUP_CLASS_NAME, $app.config.placement]; | ||
@@ -331,7 +330,7 @@ const clickOutsideListener = (event) => { | ||
}; | ||
p$2(() => { | ||
p(() => { | ||
document.addEventListener('click', clickOutsideListener); | ||
return () => document.removeEventListener('click', clickOutsideListener); | ||
}, []); | ||
return (o$2(preact.Fragment, { children: o$2("div", { "data-testid": "date-picker-popup", class: popupClasses.join(' '), children: datePickerView === DatePickerView.MONTH_DAYS ? (o$2(MonthView, { seatYearsView: () => setDatePickerView(DatePickerView.YEARS) })) : (o$2(YearsView, { setMonthView: () => setDatePickerView(DatePickerView.MONTH_DAYS) })) }) })); | ||
return (o$1(preact.Fragment, { children: o$1("div", { "data-testid": "date-picker-popup", class: popupClasses.join(' '), children: datePickerView === DatePickerView.MONTH_DAYS ? (o$1(MonthView, { seatYearsView: () => setDatePickerView(DatePickerView.YEARS) })) : (o$1(YearsView, { setMonthView: () => setDatePickerView(DatePickerView.MONTH_DAYS) })) }) })); | ||
} | ||
@@ -346,3 +345,3 @@ | ||
classes.push('has-full-width'); | ||
return (o$2(preact.Fragment, { children: o$2("div", { class: classes.join(' '), children: o$2(AppContext.Provider, { value: $app, children: [o$2(AppInput, {}), $app.datePickerState.isOpen.value && o$2(AppPopup, {})] }) }) })); | ||
return (o$1(preact.Fragment, { children: o$1("div", { class: classes.join(' '), children: o$1(AppContext.Provider, { value: $app, children: [o$1(AppInput, {}), $app.datePickerState.isOpen.value && o$1(AppPopup, {})] }) }) })); | ||
} | ||
@@ -509,6 +508,2 @@ | ||
function i(){throw new Error("Cycle detected")}function t(){if(h$1>1){h$1--;return}let i,t=!1;while(void 0!==s){let n=s;s=void 0;f++;while(void 0!==n){const o=n.o;n.o=void 0;n.f&=-3;if(!(8&n.f)&&d$1(n))try{n.c();}catch(n){if(!t){i=n;t=!0;}}n=o;}}f=0;h$1--;if(t)throw i}let o,s,h$1=0,f=0,r=0;function e(i){if(void 0===o)return;let t=i.n;if(void 0===t||t.t!==o){t={i:0,S:i,p:o.s,n:void 0,t:o,e:void 0,x:void 0,r:t};if(void 0!==o.s)o.s.n=t;o.s=t;i.n=t;if(32&o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=o.s;t.n=void 0;o.s.n=t;o.s=t;}return t}}function c$1(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0;}c$1.prototype.h=function(){return !0};c$1.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i;}};c$1.prototype.U=function(i){if(void 0!==this.t){const t=i.e,n=i.x;if(void 0!==t){t.x=n;i.e=void 0;}if(void 0!==n){n.e=t;i.x=void 0;}if(i===this.t)this.t=n;}};c$1.prototype.subscribe=function(i){const t=this;return b(function(){const n=t.value,o=32&this.f;this.f&=-33;try{i(n);}finally{this.f|=o;}})};c$1.prototype.valueOf=function(){return this.value};c$1.prototype.toString=function(){return this.value+""};c$1.prototype.toJSON=function(){return this.value};c$1.prototype.peek=function(){return this.v};Object.defineProperty(c$1.prototype,"value",{get(){const i=e(this);if(void 0!==i)i.i=this.i;return this.v},set(n){if(o instanceof a$1)!function(){throw new Error("Computed cannot have side-effects")}();if(n!==this.v){if(f>100)i();this.v=n;this.i++;r++;h$1++;try{for(let i=this.t;void 0!==i;i=i.x)i.t.N();}finally{t();}}}});function u(i){return new c$1(i)}function d$1(i){for(let t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return !0;return !1}function v(i){for(let t=i.s;void 0!==t;t=t.n){const n=t.S.n;if(void 0!==n)t.r=n;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function l(i){let t,n=i.s;while(void 0!==n){const i=n.p;if(-1===n.i){n.S.U(n);if(void 0!==i)i.n=n.n;if(void 0!==n.n)n.n.p=i;}else t=n;n.S.n=n.r;if(void 0!==n.r)n.r=void 0;n=i;}i.s=t;}function a$1(i){c$1.call(this,void 0);this.x=i;this.s=void 0;this.g=r-1;this.f=4;}(a$1.prototype=new c$1).h=function(){this.f&=-3;if(1&this.f)return !1;if(32==(36&this.f))return !0;this.f&=-5;if(this.g===r)return !0;this.g=r;this.f|=1;if(this.i>0&&!d$1(this)){this.f&=-2;return !0}const i=o;try{v(this);o=this;const i=this.x();if(16&this.f||this.v!==i||0===this.i){this.v=i;this.f&=-17;this.i++;}}catch(i){this.v=i;this.f|=16;this.i++;}o=i;l(this);this.f&=-2;return !0};a$1.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(let i=this.s;void 0!==i;i=i.n)i.S.S(i);}c$1.prototype.S.call(this,i);};a$1.prototype.U=function(i){if(void 0!==this.t){c$1.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(let i=this.s;void 0!==i;i=i.n)i.S.U(i);}}};a$1.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let i=this.t;void 0!==i;i=i.x)i.t.N();}};a$1.prototype.peek=function(){if(!this.h())i();if(16&this.f)throw this.v;return this.v};Object.defineProperty(a$1.prototype,"value",{get(){if(1&this.f)i();const t=e(this);this.h();if(void 0!==t)t.i=this.i;if(16&this.f)throw this.v;return this.v}});function w(i){return new a$1(i)}function y(i){const n=i.u;i.u=void 0;if("function"==typeof n){h$1++;const s=o;o=void 0;try{n();}catch(t){i.f&=-2;i.f|=8;_(i);throw t}finally{o=s;t();}}}function _(i){for(let t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;y(i);}function p$1(i){if(o!==this)throw new Error("Out-of-order effect");l(this);o=i;this.f&=-2;if(8&this.f)_(this);t();}function g(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;}g.prototype.c=function(){const i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const t=this.x();if("function"==typeof t)this.u=t;}finally{i();}};g.prototype.S=function(){if(1&this.f)i();this.f|=1;this.f&=-9;y(this);v(this);h$1++;const t=o;o=this;return p$1.bind(this,t)};g.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=s;s=this;}};g.prototype.d=function(){this.f|=8;if(!(1&this.f))_(this);};function b(i){const t=new g(i);try{t.c();}catch(i){t.d();throw i}return t.d.bind(t)} | ||
function c(t,e){preact.options[t]=e.bind(null,preact.options[t]||(()=>{}));}let a;function d(t){if(a)a();a=t&&t.S();}function p({data:t}){const i=useSignal(t);i.value=t;const n=F$1(()=>{let t=this.__v;while(t=t.__)if(t.__c){t.__c.__$f|=4;break}this.__$u.c=()=>{this.base.data=n.peek();};return w(()=>{let t=i.value.value;return 0===t?0:!0===t?"":t||""})},[]);return n.value}p.displayName="_st";Object.defineProperties(c$1.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:p},props:{configurable:!0,get(){return {data:this}}},__b:{configurable:!0,value:1}});c("__b",(t,i)=>{if("string"==typeof i.type){let t,e=i.props;for(let n in e){if("children"===n)continue;let o=e[n];if(o instanceof c$1){if(!t)i.__np=t={};t[n]=o;e[n]=o.peek();}}}t(i);});c("__r",(t,i)=>{d();let e,n=i.__c;if(n){n.__$f&=-2;e=n.__$u;if(void 0===e)n.__$u=e=function(t){let i;b(function(){i=this;});i.c=()=>{n.__$f|=1;n.setState({});};return i}();}d(e);t(i);});c("__e",(t,i,e,n)=>{d();t(i,e,n);});c("diffed",(t,i)=>{d();let e;if("string"==typeof i.type&&(e=i.__e)){let t=i.__np,n=i.props;if(t){let i=e.U;if(i)for(let e in i){let n=i[e];if(void 0!==n&&!(e in t)){n.d();i[e]=void 0;}}else {i={};e.U=i;}for(let o in t){let r=i[o],f=t[o];if(void 0===r){r=h(e,o,f,n);i[o]=r;}else r.o(f,n);}}}t(i);});function h(t,i,e,n){const o=i in t&&void 0===t.ownerSVGElement,r=u(e);return {o:(t,i)=>{r.value=t;n=i;},d:b(()=>{const e=r.value.value;if(n[i]!==e){n[i]=e;if(o)t[i]=e;else if(e)t.setAttribute(i,e);else t.removeAttribute(i);}})}}c("unmount",(t,i)=>{if("string"==typeof i.type){let t=i.__e;if(t){const i=t.U;if(i){t.U=void 0;for(let t in i){let e=i[t];if(e)e.d();}}}}else {let t=i.__c;if(t){const i=t.__$u;if(i){t.__$u=void 0;i.d();}}}t(i);});c("__h",(t,i,e,n)=>{if(n<3||9===n)i.__$f|=2;t(i,e,n);});preact.Component.prototype.shouldComponentUpdate=function(t,i){const e=this.__$u;if(!(e&&void 0!==e.s||4&this.__$f))return !0;if(3&this.__$f)return !0;for(let t in i)return !0;for(let i in t)if("__source"!==i&&t[i]!==this.props[i])return !0;for(let i in this.props)if(!(i in t))return !0;return !1};function useSignal(t){return F$1(()=>u(t),[])} | ||
var DateFormatDelimiter; | ||
@@ -614,8 +609,8 @@ (function (DateFormatDelimiter) { | ||
: currentDayDateString; | ||
const isOpen = u(false); | ||
const datePickerView = u(DatePickerView.MONTH_DAYS); | ||
const selectedDate = u(initialSelectedDate); | ||
const datePickerDate = u(initialSelectedDate || currentDayDateString); | ||
const inputDisplayedValue = u(selectedDateParam || ''); | ||
b(() => { | ||
const isOpen = signals.signal(false); | ||
const datePickerView = signals.signal(DatePickerView.MONTH_DAYS); | ||
const selectedDate = signals.signal(initialSelectedDate); | ||
const datePickerDate = signals.signal(initialSelectedDate || currentDayDateString); | ||
const inputDisplayedValue = signals.signal(selectedDateParam || ''); | ||
signals.effect(() => { | ||
try { | ||
@@ -630,3 +625,3 @@ const newValue = toDateString(inputDisplayedValue.value, config.locale); | ||
}); | ||
b(() => { | ||
signals.effect(() => { | ||
var _a; | ||
@@ -866,4 +861,15 @@ if ((_a = config.listeners) === null || _a === void 0 ? void 0 : _a.onChange) | ||
const calendarDeDE = { | ||
Today: 'Heute', | ||
Month: 'Monat', | ||
Week: 'Woche', | ||
Day: 'Tag', | ||
events: 'Ereignisse', | ||
event: 'Ereignis', | ||
'No events': 'Keine Ereignisse', | ||
}; | ||
const deDE = { | ||
...datePickerDeDE, | ||
...calendarDeDE, | ||
}; | ||
@@ -878,4 +884,15 @@ | ||
const calendarEnUS = { | ||
Today: 'Today', | ||
Month: 'Month', | ||
Week: 'Week', | ||
Day: 'Day', | ||
events: 'events', | ||
event: 'event', | ||
'No events': 'No events', | ||
}; | ||
const enUS = { | ||
...datePickerEnUS, | ||
...calendarEnUS, | ||
}; | ||
@@ -906,4 +923,15 @@ | ||
const calendarEnGB = { | ||
Today: 'Today', | ||
Month: 'Month', | ||
Week: 'Week', | ||
Day: 'Day', | ||
events: 'events', | ||
event: 'event', | ||
'No events': 'No events', | ||
}; | ||
const enGB = { | ||
...datePickerEnGB, | ||
...calendarEnGB, | ||
}; | ||
@@ -918,4 +946,15 @@ | ||
const calendarSvSE = { | ||
Today: 'Idag', | ||
Month: 'Månad', | ||
Week: 'Vecka', | ||
Day: 'Dag', | ||
events: 'händelser', | ||
event: 'händelse', | ||
'No events': 'Inga händelser', | ||
}; | ||
const svSE = { | ||
...datePickerSvSE, | ||
...calendarSvSE, | ||
}; | ||
@@ -930,4 +969,15 @@ | ||
const calendarZhCN = { | ||
Today: '今天', | ||
Month: '月', | ||
Week: '周', | ||
Day: '日', | ||
events: '场活动', | ||
event: '活动', | ||
'No events': '没有活动', | ||
}; | ||
const zhCN = { | ||
...datePickerZhCN, | ||
...calendarZhCN, | ||
}; | ||
@@ -974,4 +1024,2 @@ | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
})); |
{ | ||
"name": "@schedule-x/date-picker", | ||
"version": "0.1.0-alpha.4", | ||
"version": "0.1.0-alpha.5", | ||
"description": "Schedule-X date picker component", | ||
@@ -13,3 +13,3 @@ "author": { | ||
"umd": "./dist/core.umd.js", | ||
"types": "./dist/packages/date-picker/src/index.d.ts", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
@@ -19,3 +19,5 @@ "dist" | ||
"dependencies": { | ||
"@schedule-x/translations": "^0.1.0-alpha.4", | ||
"@preact/signals": "^1.1.5", | ||
"@schedule-x/shared": "^0.1.0-alpha.5", | ||
"@schedule-x/translations": "^0.1.0-alpha.5", | ||
"preact": "^10.16.0" | ||
@@ -28,3 +30,3 @@ }, | ||
}, | ||
"gitHead": "caa7027f520c68dad0e102a1c222e6b9694e021c" | ||
"gitHead": "e405a5a6c2a474bab8bf51bb39619098412024cb" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114
157767
4
3399
+ Added@preact/signals@^1.1.5
+ Added@preact/signals@1.3.1(transitive)
+ Added@preact/signals-core@1.8.0(transitive)