@daryasidorovich/modsen-datepicker 1.0.16 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +28 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -25
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
6
|
var React = require('react');
|
|
5
7
|
var reactDom = require('react-dom');
|
|
8
|
+
var zod = require('@hookform/resolvers/zod');
|
|
6
9
|
var reactHookForm = require('react-hook-form');
|
|
7
10
|
var reactImask = require('react-imask');
|
|
8
11
|
|
|
9
|
-
function
|
|
12
|
+
function _interopNamespace(e) {
|
|
13
|
+
if (e && e.__esModule) return e;
|
|
10
14
|
var n = Object.create(null);
|
|
11
15
|
if (e) {
|
|
12
16
|
Object.keys(e).forEach(function (k) {
|
|
@@ -19,16 +23,16 @@ function _interopNamespaceDefault(e) {
|
|
|
19
23
|
}
|
|
20
24
|
});
|
|
21
25
|
}
|
|
22
|
-
n
|
|
26
|
+
n["default"] = e;
|
|
23
27
|
return Object.freeze(n);
|
|
24
28
|
}
|
|
25
29
|
|
|
26
|
-
var React__namespace = /*#__PURE__*/
|
|
30
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
31
|
|
|
28
|
-
var e=[],t
|
|
32
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
29
33
|
|
|
30
34
|
var css$e = "*,\n::before,\n::after {\n box-sizing: border-box;\n}\n\n:where(ul, ol):where([class]) {\n padding-left: 0;\n}\n\nbody,\n:where(blockquote, figure):where([class]) {\n margin: 0;\n}\n\n:where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl):where([class]) {\n margin-block: 0;\n}\n\n:where(dd[class]) {\n margin-left: 0;\n}\n\n:where(fieldset[class]) {\n margin-left: 0;\n padding: 0;\n border: none;\n}\n\n:where(ul[class]) {\n list-style: none;\n}\n\n:where(address[class]) {\n font-style: normal;\n}\n\np {\n margin-block: 0;\n}\n\nimg,\nvideo {\n display: block;\n max-width: 100%;\n height: auto;\n}\n\ninput,\ntextarea,\nselect,\nbutton {\n font: inherit;\n}\n\nhtml {\n height: 100%;\n scrollbar-gutter: stable;\n}\n\nhtml,\n:has(:target) {\n scroll-behavior: smooth;\n}\n\nbody {\n min-height: 100%;\n line-height: 1.5;\n}\n\na:where([class]) {\n display: inline-flex;\n}\n\nbutton,\nlabel {\n cursor: pointer;\n}\n\n[stroke] {\n stroke: currentColor;\n}\n\nsvg * {\n transition-property: fill, stroke;\n}\n\n@media (prefers-reduced-motion: reduce) {\n *,\n ::before,\n ::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n scroll-behavior: auto !important;\n }\n}\nhtml.main_isLock__423dfe15 {\n overflow: hidden;\n}\n\nbody {\n font-weight: 400;\n font-family: \"Open Sans\", sans-serif;\n font-size: 14px;\n}\n.main_themeLight__423dfe15 body {\n color: #333333;\n}\n.main_themeDark__423dfe15 body {\n color: #ffffff;\n}\n\nh1,\nh2 {\n margin: 0;\n}\n\nh1 {\n font-size: 15px;\n font-weight: 600;\n}\n\nh2 {\n font-weight: 700;\n}\n\na,\nbutton,\nlabel,\ninput,\ntextarea,\nselect,\nsvg * {\n transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, fill 0.2s ease, opacity 0.2s ease;\n}\n\na:has(svg),\nbutton:has(svg) {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.main_grid__423dfe15 {\n display: grid;\n width: 100%;\n grid-template-columns: repeat(7, 1fr);\n}";
|
|
31
|
-
n
|
|
35
|
+
n(css$e,{});
|
|
32
36
|
|
|
33
37
|
const FIRST_DAY_OF_WEEK = {
|
|
34
38
|
MONDAY: 1,
|
|
@@ -263,6 +267,7 @@ var classnames = {exports: {}};
|
|
|
263
267
|
Licensed under the MIT License (MIT), see
|
|
264
268
|
http://jedwatson.github.io/classnames
|
|
265
269
|
*/
|
|
270
|
+
classnames.exports;
|
|
266
271
|
|
|
267
272
|
var hasRequiredClassnames;
|
|
268
273
|
|
|
@@ -345,7 +350,7 @@ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
|
345
350
|
|
|
346
351
|
var css$d = ".styles_module_day__0d250405 {\n width: 32px;\n height: 32px;\n}\n.theme-light .styles_module_day__0d250405 {\n background-color: #ffffff;\n color: #333333;\n}\n.theme-dark .styles_module_day__0d250405 {\n background-color: #333333;\n color: #ffffff;\n}\n.styles_module_day__0d250405 {\n font-size: 13px;\n padding: 10px;\n border-radius: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n border: none;\n position: relative;\n}\n\n.theme-light .styles_module_holiday__0d250405 {\n color: #ff383c;\n}\n.theme-dark .styles_module_holiday__0d250405 {\n color: #ff383c;\n}\n\n.theme-light .styles_module_today__0d250405 {\n color: #2f80ed;\n}\n.theme-dark .styles_module_today__0d250405 {\n color: #2f80ed;\n}\n\n.theme-light .styles_module_selected__0d250405 {\n background-color: #2f80ed;\n color: #ffffff;\n}\n.theme-dark .styles_module_selected__0d250405 {\n background-color: #2f80ed;\n color: #e1e1e1;\n}\n\n.theme-light .styles_module_disabled__0d250405 {\n color: #aaaaaa;\n}\n.theme-dark .styles_module_disabled__0d250405 {\n color: #aaaaaa;\n}\n.styles_module_disabled__0d250405 {\n cursor: not-allowed;\n}\n\n.theme-light .styles_module_otherMonth__0d250405 {\n color: #aaaaaa;\n}\n.theme-dark .styles_module_otherMonth__0d250405 {\n color: #aaaaaa;\n}\n\n.theme-light .styles_module_rangeStart__0d250405 {\n color: #ffffff;\n background-color: rgba(47, 129, 237, 0.5764705882);\n}\n.theme-dark .styles_module_rangeStart__0d250405 {\n color: #e1e1e1;\n background-color: rgba(47, 129, 237, 0.5764705882);\n}\n.styles_module_rangeStart__0d250405 {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.theme-light .styles_module_rangeMiddle__0d250405 {\n background-color: rgba(47, 129, 237, 0.1647058824);\n}\n.theme-dark .styles_module_rangeMiddle__0d250405 {\n background-color: rgba(47, 129, 237, 0.1647058824);\n}\n.styles_module_rangeMiddle__0d250405 {\n border-radius: 0;\n}\n\n.theme-light .styles_module_rangeEnd__0d250405 {\n color: #ffffff;\n background-color: #2f80ed;\n}\n.theme-dark .styles_module_rangeEnd__0d250405 {\n color: #e1e1e1;\n background-color: #2f80ed;\n}\n.styles_module_rangeEnd__0d250405 {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.styles_module_hasTasks__0d250405 {\n position: relative;\n}\n.styles_module_hasTasks__0d250405::after {\n width: 4px;\n height: 4px;\n}\n.theme-light .styles_module_hasTasks__0d250405::after {\n background-color: #62d0a2;\n}\n.theme-dark .styles_module_hasTasks__0d250405::after {\n background-color: #62d0a2;\n}\n.styles_module_hasTasks__0d250405::after {\n content: \"\";\n position: absolute;\n top: 12%;\n right: 12%;\n border-radius: 100%;\n}";
|
|
347
352
|
var modules_efc4e723$d = {"day":"styles_module_day__0d250405","holiday":"styles_module_holiday__0d250405","today":"styles_module_today__0d250405","selected":"styles_module_selected__0d250405","disabled":"styles_module_disabled__0d250405","otherMonth":"styles_module_otherMonth__0d250405","rangeStart":"styles_module_rangeStart__0d250405","rangeMiddle":"styles_module_rangeMiddle__0d250405","rangeEnd":"styles_module_rangeEnd__0d250405","hasTasks":"styles_module_hasTasks__0d250405"};
|
|
348
|
-
n
|
|
353
|
+
n(css$d,{});
|
|
349
354
|
|
|
350
355
|
const Day = ({ date, isSelected = false, isCurrentMonth, isDisabled = false, isHoliday = false, hasTasks = false, isRangeStart = false, isRangeEnd = false, isRangeMiddle = false, onClick, onDoubleClick, onMouseEnter, onMouseLeave, }) => {
|
|
351
356
|
const dayNumber = date.getDate();
|
|
@@ -394,7 +399,7 @@ const Day = ({ date, isSelected = false, isCurrentMonth, isDisabled = false, isH
|
|
|
394
399
|
|
|
395
400
|
var css$c = ".styles_module_week__5d817eab {\n display: flex;\n}\n.theme-light .styles_module_week__5d817eab {\n background-color: #ffffff;\n}\n.theme-dark .styles_module_week__5d817eab {\n background-color: #333333;\n}";
|
|
396
401
|
var modules_efc4e723$c = {"week":"styles_module_week__5d817eab"};
|
|
397
|
-
n
|
|
402
|
+
n(css$c,{});
|
|
398
403
|
|
|
399
404
|
const Week = ({ weekDays, selectedDate, getIsHoliday, getIsDisabled, getIsCurrentMonth, rangeStart, rangeEnd, hasTasks, onDateClick, onDateDoubleClick, onMouseEnter, onMouseLeave, }) => {
|
|
400
405
|
return (jsxRuntime.jsx("div", { className: modules_efc4e723$c.week, children: weekDays.map((date) => {
|
|
@@ -646,7 +651,7 @@ function useCalendar(props) {
|
|
|
646
651
|
|
|
647
652
|
var css$b = ".styles_module_calendar__131b64c5 {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.theme-light .styles_module_errorMessage__131b64c5 {\n color: #ff383c;\n}\n.theme-dark .styles_module_errorMessage__131b64c5 {\n color: #ff383c;\n}";
|
|
648
653
|
var modules_efc4e723$b = {"calendar":"styles_module_calendar__131b64c5","errorMessage":"styles_module_errorMessage__131b64c5"};
|
|
649
|
-
n
|
|
654
|
+
n(css$b,{});
|
|
650
655
|
|
|
651
656
|
const CalendarGridWithoutTasks = ({ children, ...props }) => {
|
|
652
657
|
const { calendar, loading, error } = useCalendar(props);
|
|
@@ -740,7 +745,7 @@ const useLockBodyScroll = (isLocked) => {
|
|
|
740
745
|
|
|
741
746
|
var css$a = ".styles_module_overlay__337f9387 {\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10;\n}\n\n.theme-light .styles_module_overlayColor__337f9387 {\n background-color: rgba(44, 49, 68, 0.4);\n}\n.theme-dark .styles_module_overlayColor__337f9387 {\n background-color: rgba(44, 49, 68, 0.4);\n}\n\n.styles_module_modal__337f9387 {\n position: relative;\n}\n.theme-light .styles_module_modal__337f9387 {\n background-color: #ffffff;\n border-color: #e1e1e1;\n}\n.theme-dark .styles_module_modal__337f9387 {\n background-color: #333333;\n border-color: #aaaaaa;\n}\n.styles_module_modal__337f9387 {\n border-style: solid;\n border-width: 1px;\n border-radius: 8px;\n padding: 24px;\n}\n\n.styles_module_closeButton__337f9387 {\n border: none;\n background-color: transparent;\n position: absolute;\n right: 8px;\n top: 0;\n font-size: 24px;\n line-height: normal;\n}\n.theme-light .styles_module_closeButton__337f9387 {\n color: #333333;\n}\n.theme-dark .styles_module_closeButton__337f9387 {\n color: #ffffff;\n}";
|
|
742
747
|
var modules_efc4e723$a = {"overlay":"styles_module_overlay__337f9387","overlayColor":"styles_module_overlayColor__337f9387","modal":"styles_module_modal__337f9387","closeButton":"styles_module_closeButton__337f9387"};
|
|
743
|
-
n
|
|
748
|
+
n(css$a,{});
|
|
744
749
|
|
|
745
750
|
const Modal = ({ isOpen, onClose, children, showOverlay = true, showCloseButton = true, className = '', classNameOverlay = '', style = {}, }) => {
|
|
746
751
|
const modalRoot = document.body;
|
|
@@ -760,10 +765,6 @@ const Modal = ({ isOpen, onClose, children, showOverlay = true, showCloseButton
|
|
|
760
765
|
return reactDom.createPortal(modalContent, targetElement);
|
|
761
766
|
};
|
|
762
767
|
|
|
763
|
-
const t$1=(r,t,s)=>{if(r&&"reportValidity"in r){const o=reactHookForm.get(s,t);r.setCustomValidity(o&&o.message||""),r.reportValidity();}},s$1=(e,r)=>{for(const s in r.fields){const o=r.fields[s];o&&o.ref&&"reportValidity"in o.ref?t$1(o.ref,s,e):o&&o.refs&&o.refs.forEach(r=>t$1(r,s,e));}},o$1=(t,o)=>{o.shouldUseNativeValidation&&s$1(t,o);const n={};for(const s in t){const f=reactHookForm.get(o.fields,s),c=Object.assign(t[s]||{},{ref:f&&f.refs?f.refs[0]:f&&f.ref});if(i$1(o.names||Object.keys(t),s)){const t=Object.assign({},reactHookForm.get(n,s));reactHookForm.set(t,"root",c),reactHookForm.set(n,s,t);}else reactHookForm.set(n,s,c);}return n},i$1=(e,r)=>{const t=n(r).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(e=>n(e).match(`^${t}\\.\\d+`))};function n(e){return e.replace(/\[(\d+)]/g,".$1").replace(/[[\]]/g,"")}
|
|
764
|
-
|
|
765
|
-
function o(){return o=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)({}).hasOwnProperty.call(n,o)&&(r[o]=n[o]);}return r},o.apply(null,arguments)}function t(r,e){try{var n=r();}catch(r){return e(r)}return n&&n.then?n.then(void 0,e):n}function s(r,e){for(var o=Object.create(null);r.length;){var t=r[0],s=t.code,i=t.message,u=t.path.join(".");if(!o[u])if("unionErrors"in t){var a,c,l=t.unionErrors.reduce(function(r,e){return e.errors.length<r.errors.length?e:r}).errors[0];o[u]={message:null!=(a=null==l?void 0:l.message)?a:i,type:null!=(c=null==l?void 0:l.code)?c:s};}else o[u]={message:i,type:s};if("unionErrors"in t&&t.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var f=o[u].types,d=f&&f[t.code];o[u]=reactHookForm.appendErrors(u,e,o,s,d?[].concat(d,t.message):t.message);}r.shift();}return o}function i(r,e){for(var t=Object.create(null),s=function(){var s=r[0],i=s.code,u=s.message,a=s.path.join(".");if(!t[a])if("invalid_union"===s.code&&s.errors.length>0){var c,l,f=s.errors.reduce(function(r,e){return e.length<r.length?e:r})[0];t[a]={message:null!=(c=null==f?void 0:f.message)?c:u,type:null!=(l=null==f?void 0:f.code)?l:i};}else t[a]={message:u,type:i};if("invalid_union"===s.code&&s.errors.forEach(function(e){return e.forEach(function(e){return r.push(o({},e,{path:[].concat(s.path,e.path)}))})}),e){var d=t[a].types,h=d&&d[s.code];t[a]=reactHookForm.appendErrors(a,e,t,i,h?[].concat(h,s.message):s.message);}r.shift();};r.length;)s();return t}function u(n,o,u){if(void 0===u&&(u={}),function(r){return "_zod"in r&&"object"==typeof r._zod}(n))return function(s,a,c){try{return Promise.resolve(t(function(){function e(e){return c.shouldUseNativeValidation&&s$1({},c),{errors:{},values:u.raw?Object.assign({},s):e}}var t=n;return "sync"===u.mode?e(t.parse(s,o)):Promise.resolve(t.parseAsync(s,o)).then(e)},function(r){if(function(r){var e;return !(null==r||null==(e=r._zod)||null==(e=e.traits)||!e.has("$ZodError"))}(r))return {values:{},errors:o$1(i(r.issues,!c.shouldUseNativeValidation&&"all"===c.criteriaMode),c)};throw r}))}catch(r){return Promise.reject(r)}};if(function(r){return "_def"in r&&"object"==typeof r._def}(n))return function(i,a,c){try{return Promise.resolve(t(function(){return Promise.resolve(n["sync"===u.mode?"parse":"parseAsync"](i,o)).then(function(e){return c.shouldUseNativeValidation&&s$1({},c),{errors:{},values:u.raw?Object.assign({},i):e}})},function(r){if(function(r){return Array.isArray(null==r?void 0:r.issues)}(r))return {values:{},errors:o$1(s(r.errors,!c.shouldUseNativeValidation&&"all"===c.criteriaMode),c)};throw r}))}catch(r){return Promise.reject(r)}};throw new Error("Invalid input: not a Zod schema")}
|
|
766
|
-
|
|
767
768
|
var _path$3;
|
|
768
769
|
function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
|
|
769
770
|
var SvgCalendar = function SvgCalendar(props) {
|
|
@@ -792,9 +793,9 @@ var SvgClear = function SvgClear(props) {
|
|
|
792
793
|
})));
|
|
793
794
|
};
|
|
794
795
|
|
|
795
|
-
var css$9 = ".theme-light .
|
|
796
|
-
var modules_efc4e723$9 = {"wrapper":"
|
|
797
|
-
n
|
|
796
|
+
var css$9 = ".theme-light .styles_module_wrapper__ef28f65c {\n color: #333333;\n background-color: #ffffff;\n}\n.theme-dark .styles_module_wrapper__ef28f65c {\n color: #ffffff;\n background-color: #333333;\n}\n.styles_module_wrapper__ef28f65c {\n display: flex;\n flex-direction: column;\n align-items: start;\n gap: 2px;\n width: 100%;\n}\n\n.styles_module_label__ef28f65c {\n font-size: 15px;\n font-weight: 600;\n margin-bottom: 8px;\n}\n\n.theme-light .styles_module_inputWrapper__ef28f65c {\n color: #333333;\n background-color: #ffffff;\n border-color: #e1e1e1;\n}\n.theme-dark .styles_module_inputWrapper__ef28f65c {\n color: #ffffff;\n background-color: #333333;\n border-color: #aaaaaa;\n}\n.styles_module_inputWrapper__ef28f65c {\n border-style: solid;\n border-width: 1px;\n padding: 8px 15px;\n border-radius: 8px;\n display: flex;\n gap: 8px;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n box-sizing: border-box;\n}\n\n.theme-light .styles_module_errorWrapper__ef28f65c {\n border-color: #ff383c;\n}\n.theme-dark .styles_module_errorWrapper__ef28f65c {\n border-color: #ff383c;\n}\n\n.styles_module_input__ef28f65c {\n border: none;\n outline: none;\n background-color: transparent;\n width: 100%;\n}\n.theme-light .styles_module_input__ef28f65c {\n color: #333333;\n}\n.theme-dark .styles_module_input__ef28f65c {\n color: #ffffff;\n}\n.theme-light .styles_module_input__ef28f65c::placeholder {\n color: #e1e1e1;\n}\n.theme-dark .styles_module_input__ef28f65c::placeholder {\n color: #aaaaaa;\n}\n\n.styles_module_clear__ef28f65c {\n border: none;\n background-color: transparent;\n width: max-content;\n padding: 0;\n}\n\n.styles_module_icon__ef28f65c {\n flex-shrink: 0;\n}\n.theme-light .styles_module_icon__ef28f65c {\n color: #aaaaaa;\n}\n.theme-dark .styles_module_icon__ef28f65c {\n color: #aaaaaa;\n}\n\n.theme-light .styles_module_error__ef28f65c {\n color: #ff383c;\n}\n.theme-dark .styles_module_error__ef28f65c {\n color: #ff383c;\n}\n.styles_module_error__ef28f65c {\n height: 15px;\n}";
|
|
797
|
+
var modules_efc4e723$9 = {"wrapper":"styles_module_wrapper__ef28f65c","label":"styles_module_label__ef28f65c","inputWrapper":"styles_module_inputWrapper__ef28f65c","errorWrapper":"styles_module_errorWrapper__ef28f65c","input":"styles_module_input__ef28f65c","clear":"styles_module_clear__ef28f65c","icon":"styles_module_icon__ef28f65c","error":"styles_module_error__ef28f65c"};
|
|
798
|
+
n(css$9,{});
|
|
798
799
|
|
|
799
800
|
const Input = ({ label, error, className = '', id, onReset, placeholder, type = 'text', isDateInput = false, ref = null, ...restProps }) => {
|
|
800
801
|
const generatedId = React.useId();
|
|
@@ -806,7 +807,7 @@ const Input = ({ label, error, className = '', id, onReset, placeholder, type =
|
|
|
806
807
|
|
|
807
808
|
var css$8 = ".styles_module_header__2145d314 {\n margin-bottom: 24px;\n margin-top: 8px;\n}\n\n.styles_module_title__2145d314 {\n font-size: 18px;\n}\n\n.styles_module_footer__2145d314 {\n display: flex;\n width: 100%;\n gap: 10px;\n justify-content: end;\n}\n\n.styles_module_children__2145d314 {\n display: flex;\n gap: 8px;\n flex-direction: column;\n min-width: 300px;\n width: fit-content;\n margin-bottom: 24px;\n}\n\n.theme-light .styles_module_modalButtons__2145d314 {\n background-color: rgba(47, 129, 237, 0.1647058824);\n border-color: #e1e1e1;\n color: #333333;\n}\n.theme-dark .styles_module_modalButtons__2145d314 {\n background-color: rgba(47, 129, 237, 0.1647058824);\n border-color: #aaaaaa;\n color: #ffffff;\n}\n.styles_module_modalButtons__2145d314 {\n border-style: solid;\n border-width: 1px;\n padding: 5px 10px;\n border-radius: 8px;\n}\n\n.theme-light .styles_module_confirm__2145d314 {\n background-color: rgba(47, 129, 237, 0.5764705882);\n border-color: #e1e1e1;\n color: #ffffff;\n}\n.theme-dark .styles_module_confirm__2145d314 {\n background-color: rgba(47, 129, 237, 0.5764705882);\n border-color: #aaaaaa;\n color: #e1e1e1;\n}";
|
|
808
809
|
var modules_efc4e723$8 = {"header":"styles_module_header__2145d314","title":"styles_module_title__2145d314","footer":"styles_module_footer__2145d314","children":"styles_module_children__2145d314","modalButtons":"styles_module_modalButtons__2145d314","confirm":"styles_module_confirm__2145d314"};
|
|
809
|
-
n
|
|
810
|
+
n(css$8,{});
|
|
810
811
|
|
|
811
812
|
const CrudModal = ({ isOpen, onClose, onConfirm, title, cancelText = 'No', confirmText = 'Yes', isLoading = false, children, showCloseButton = false, }) => {
|
|
812
813
|
return (jsxRuntime.jsxs(Modal, { isOpen: isOpen, onClose: onClose, showCloseButton: showCloseButton, children: [jsxRuntime.jsx("div", { className: modules_efc4e723$8.header, children: jsxRuntime.jsx("h1", { className: modules_efc4e723$8.title, children: title }) }), children && jsxRuntime.jsx("div", { className: modules_efc4e723$8.children, children: children }), jsxRuntime.jsxs("div", { className: modules_efc4e723$8.footer, children: [jsxRuntime.jsx("button", { className: modules_efc4e723$8.modalButtons, onClick: onClose, disabled: isLoading, children: cancelText }), jsxRuntime.jsx("button", { className: classNames(modules_efc4e723$8.confirm, modules_efc4e723$8.modalButtons), onClick: onConfirm, children: confirmText })] })] }));
|
|
@@ -6196,7 +6197,7 @@ const formSchema = object({
|
|
|
6196
6197
|
const AddModal = ({ isOpen, onClose, date }) => {
|
|
6197
6198
|
const { addTask } = useTasks();
|
|
6198
6199
|
const { register, handleSubmit, reset, formState: { errors }, } = reactHookForm.useForm({
|
|
6199
|
-
resolver:
|
|
6200
|
+
resolver: zod.zodResolver(formSchema),
|
|
6200
6201
|
defaultValues: {
|
|
6201
6202
|
title: '',
|
|
6202
6203
|
date: formatDate(date),
|
|
@@ -6228,7 +6229,7 @@ const DeleteModal = ({ id, isOpen, onClose }) => {
|
|
|
6228
6229
|
const EditModal = ({ isOpen, onClose, id, date }) => {
|
|
6229
6230
|
const { editTask, tasks } = useTasks();
|
|
6230
6231
|
const { register, handleSubmit, reset, formState: { errors }, } = reactHookForm.useForm({
|
|
6231
|
-
resolver:
|
|
6232
|
+
resolver: zod.zodResolver(formSchema),
|
|
6232
6233
|
defaultValues: {
|
|
6233
6234
|
title: '',
|
|
6234
6235
|
date: formatDate(date),
|
|
@@ -6275,7 +6276,7 @@ const EditModal = ({ isOpen, onClose, id, date }) => {
|
|
|
6275
6276
|
|
|
6276
6277
|
var css$7 = ".styles_module_tasksManager__2b8e4ddb {\n min-width: 300px;\n width: fit-content;\n display: flex;\n flex-direction: column;\n gap: 24px;\n max-height: 70%;\n}\n\n.styles_module_tasks__2b8e4ddb {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.styles_module_task__2b8e4ddb {\n display: flex;\n gap: 8px;\n justify-content: space-between;\n align-items: center;\n}\n\n.theme-light .styles_module_checked__2b8e4ddb {\n color: #aaaaaa;\n}\n.theme-dark .styles_module_checked__2b8e4ddb {\n color: #aaaaaa;\n}\n\n.styles_module_title__2b8e4ddb {\n margin-right: auto;\n}\n\n.styles_module_action__2b8e4ddb {\n border: none;\n background-color: transparent;\n}\n.theme-light .styles_module_action__2b8e4ddb {\n color: #333333;\n}\n.theme-dark .styles_module_action__2b8e4ddb {\n color: #ffffff;\n}\n\n.theme-light .styles_module_delete__2b8e4ddb {\n color: #ff383c;\n}\n.theme-dark .styles_module_delete__2b8e4ddb {\n color: #ff383c;\n}\n\n.theme-light .styles_module_add__2b8e4ddb {\n background-color: rgba(47, 129, 237, 0.5764705882);\n border-color: #e1e1e1;\n color: #ffffff;\n}\n.theme-dark .styles_module_add__2b8e4ddb {\n background-color: rgba(47, 129, 237, 0.5764705882);\n border-color: #aaaaaa;\n color: #e1e1e1;\n}\n.styles_module_add__2b8e4ddb {\n border-style: solid;\n border-width: 1px;\n border-radius: 8px;\n}\n\n.styles_module_header__2b8e4ddb {\n font-size: 18px;\n}";
|
|
6277
6278
|
var modules_efc4e723$7 = {"tasksManager":"styles_module_tasksManager__2b8e4ddb","tasks":"styles_module_tasks__2b8e4ddb","task":"styles_module_task__2b8e4ddb","checked":"styles_module_checked__2b8e4ddb","title":"styles_module_title__2b8e4ddb","action":"styles_module_action__2b8e4ddb","delete":"styles_module_delete__2b8e4ddb","add":"styles_module_add__2b8e4ddb","header":"styles_module_header__2b8e4ddb"};
|
|
6278
|
-
n
|
|
6279
|
+
n(css$7,{});
|
|
6279
6280
|
|
|
6280
6281
|
const TasksManager = ({ onClose, isOpen, tasks, selectedDate, }) => {
|
|
6281
6282
|
const addModal = useModal();
|
|
@@ -6337,7 +6338,7 @@ const useTooltip = () => {
|
|
|
6337
6338
|
|
|
6338
6339
|
var css$6 = ".theme-light .styles_module_tooltip__ac28d9b8 {\n background-color: #e1e1e1;\n}\n.theme-dark .styles_module_tooltip__ac28d9b8 {\n background-color: #aaaaaa;\n}\n.styles_module_tooltip__ac28d9b8 {\n border-radius: 8px;\n padding: 2px 8px;\n position: absolute;\n}";
|
|
6339
6340
|
var modules_efc4e723$6 = {"tooltip":"styles_module_tooltip__ac28d9b8"};
|
|
6340
|
-
n
|
|
6341
|
+
n(css$6,{});
|
|
6341
6342
|
|
|
6342
6343
|
const Tooltip = ({ isVisible, text, x, y }) => {
|
|
6343
6344
|
if (!isVisible)
|
|
@@ -6421,7 +6422,7 @@ var SvgPrev = function SvgPrev(props) {
|
|
|
6421
6422
|
|
|
6422
6423
|
var css$5 = ".theme-light .styles_module_month__0a69a8ca {\n color: #333333;\n background-color: #ffffff;\n}\n.theme-dark .styles_module_month__0a69a8ca {\n color: #ffffff;\n background-color: #333333;\n}\n.styles_module_month__0a69a8ca {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n padding-block: 5px;\n gap: 2px;\n font-weight: 700;\n}\n\n.theme-light .styles_module_arrow__0a69a8ca {\n color: #333333;\n}\n.theme-dark .styles_module_arrow__0a69a8ca {\n color: #ffffff;\n}\n.styles_module_arrow__0a69a8ca {\n width: max-content;\n border: none;\n background-color: transparent;\n}\n.theme-light .styles_module_arrow__0a69a8ca:hover {\n color: rgba(47, 129, 237, 0.5764705882);\n}\n.theme-dark .styles_module_arrow__0a69a8ca:hover {\n color: rgba(47, 129, 237, 0.5764705882);\n}";
|
|
6423
6424
|
var modules_efc4e723$5 = {"month":"styles_module_month__0a69a8ca","arrow":"styles_module_arrow__0a69a8ca"};
|
|
6424
|
-
n
|
|
6425
|
+
n(css$5,{});
|
|
6425
6426
|
|
|
6426
6427
|
const Month = ({ date, onPrev, onNext }) => {
|
|
6427
6428
|
const year = date.getFullYear();
|
|
@@ -6442,7 +6443,7 @@ const getOrderedDays = (firstDayOfWeek) => {
|
|
|
6442
6443
|
|
|
6443
6444
|
var css$4 = ".styles_module_weekDay__a9cd2130 {\n display: flex;\n}\n\n.styles_module_dayName__a9cd2130 {\n width: 32px;\n height: 32px;\n}\n.theme-light .styles_module_dayName__a9cd2130 {\n background-color: #ffffff;\n}\n.theme-dark .styles_module_dayName__a9cd2130 {\n background-color: #333333;\n}\n.styles_module_dayName__a9cd2130 {\n font-size: 13px;\n padding: 10px;\n border-radius: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n}";
|
|
6444
6445
|
var modules_efc4e723$4 = {"weekDay":"styles_module_weekDay__a9cd2130","dayName":"styles_module_dayName__a9cd2130"};
|
|
6445
|
-
n
|
|
6446
|
+
n(css$4,{});
|
|
6446
6447
|
|
|
6447
6448
|
const WeekDay = ({ firstDayOfWeek = 1, className = '', hideWeekends = false, }) => {
|
|
6448
6449
|
let days = getOrderedDays(firstDayOfWeek);
|
|
@@ -6456,7 +6457,7 @@ const WeekDay = ({ firstDayOfWeek = 1, className = '', hideWeekends = false, })
|
|
|
6456
6457
|
|
|
6457
6458
|
var css$3 = ".styles_module_calendarGrid__eeb1dea8 {\n border-style: solid;\n border-width: 1px;\n}\n.theme-light .styles_module_calendarGrid__eeb1dea8 {\n border-color: #e1e1e1;\n background-color: #ffffff;\n}\n.theme-dark .styles_module_calendarGrid__eeb1dea8 {\n border-color: #aaaaaa;\n background-color: #333333;\n}\n.styles_module_calendarGrid__eeb1dea8 {\n padding: 10px;\n border-radius: 8px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n align-items: center;\n}";
|
|
6458
6459
|
var modules_efc4e723$3 = {"calendarGrid":"styles_module_calendarGrid__eeb1dea8"};
|
|
6459
|
-
n
|
|
6460
|
+
n(css$3,{});
|
|
6460
6461
|
|
|
6461
6462
|
const BaseCalendar = ({ mode = MODES.MONTH, monthDate, firstDayOfWeek = 1, hideWeekends = false, ...props }) => {
|
|
6462
6463
|
const [baseDate, setBaseDate] = React.useState(monthDate);
|
|
@@ -6576,7 +6577,7 @@ function useValidate(selectedDate) {
|
|
|
6576
6577
|
|
|
6577
6578
|
var css$2 = ".styles_module_datepicker__c32ee18d {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 8px;\n}\n.theme-light .styles_module_datepicker__c32ee18d {\n background-color: #ffffff;\n}\n.theme-dark .styles_module_datepicker__c32ee18d {\n background-color: #333333;\n}";
|
|
6578
6579
|
var modules_efc4e723$2 = {"datepicker":"styles_module_datepicker__c32ee18d"};
|
|
6579
|
-
n
|
|
6580
|
+
n(css$2,{});
|
|
6580
6581
|
|
|
6581
6582
|
const DatePicker = ({ selectedDate, monthDate = new Date(), onChange, ...props }) => {
|
|
6582
6583
|
const { currentDate, value, handleDateSelect, error, ref, handleDateValidation, handleClearInput, } = useValidate(selectedDate);
|
|
@@ -6599,7 +6600,7 @@ const DatePicker = ({ selectedDate, monthDate = new Date(), onChange, ...props }
|
|
|
6599
6600
|
|
|
6600
6601
|
var css$1 = ".styles_module_clear__8e986404 {\n border-style: solid;\n border-width: 1px;\n}\n.theme-light .styles_module_clear__8e986404 {\n border-color: #e1e1e1;\n background-color: #ffffff;\n color: #333333;\n}\n.theme-dark .styles_module_clear__8e986404 {\n border-color: #aaaaaa;\n background-color: #333333;\n color: #ffffff;\n}\n.styles_module_clear__8e986404 {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 10px;\n width: 100%;\n font-weight: 600;\n border-bottom-right-radius: 8px;\n border-bottom-left-radius: 8px;\n}\n.theme-light .styles_module_clear__8e986404:hover {\n background-color: rgba(47, 129, 237, 0.5764705882);\n color: #ffffff;\n}\n.theme-dark .styles_module_clear__8e986404:hover {\n background-color: #aaaaaa;\n color: #e1e1e1;\n}\n.styles_module_clear__8e986404:active {\n transform: scale(0.98);\n}\n.theme-light .styles_module_clear__8e986404:active {\n background-color: #2f80ed;\n color: #ffffff;\n}\n.theme-dark .styles_module_clear__8e986404:active {\n background-color: #2f80ed;\n color: #e1e1e1;\n}";
|
|
6601
6602
|
var modules_efc4e723$1 = {"clear":"styles_module_clear__8e986404"};
|
|
6602
|
-
n
|
|
6603
|
+
n(css$1,{});
|
|
6603
6604
|
|
|
6604
6605
|
const Clear = ({ onClick }) => {
|
|
6605
6606
|
return (jsxRuntime.jsx("button", { className: modules_efc4e723$1.clear, type: "button", onClick: onClick, children: "Clear" }));
|
|
@@ -6607,7 +6608,7 @@ const Clear = ({ onClick }) => {
|
|
|
6607
6608
|
|
|
6608
6609
|
var css = ".styles_module_rangePicker__42a840f2 {\n display: flex;\n flex-direction: column;\n padding: 8px;\n}\n.theme-light .styles_module_rangePicker__42a840f2 {\n background-color: #ffffff;\n}\n.theme-dark .styles_module_rangePicker__42a840f2 {\n background-color: #333333;\n}\n\n.styles_module_calendar__42a840f2 {\n margin-top: 15px;\n}\n\n.styles_module_inputs__42a840f2 {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}";
|
|
6609
6610
|
var modules_efc4e723 = {"rangePicker":"styles_module_rangePicker__42a840f2","calendar":"styles_module_calendar__42a840f2","inputs":"styles_module_inputs__42a840f2"};
|
|
6610
|
-
n
|
|
6611
|
+
n(css,{});
|
|
6611
6612
|
|
|
6612
6613
|
const RangePicker = ({ rangeStart, rangeEnd, monthDate = new Date(), onChangeStart, onChangeEnd, ...props }) => {
|
|
6613
6614
|
const { currentDate: startDate, value: startValue, error: startError, ref: startRef, handleDateSelect: handleStartDateSelect, handleDateValidation: handleStartDateValidation, handleClearInput: handleStartClearInput, } = useValidate(rangeStart);
|