@daryasidorovich/modsen-datepicker 1.0.17 → 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.js
CHANGED
|
@@ -2,13 +2,14 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { createContext, useState, useCallback, useEffect, useContext, useRef, useId } from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
|
-
import {
|
|
5
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
6
|
+
import { useForm } from 'react-hook-form';
|
|
6
7
|
import { IMask, useIMask } from 'react-imask';
|
|
7
8
|
|
|
8
|
-
var e=[],t
|
|
9
|
+
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}}
|
|
9
10
|
|
|
10
11
|
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}";
|
|
11
|
-
n
|
|
12
|
+
n(css$e,{});
|
|
12
13
|
|
|
13
14
|
const FIRST_DAY_OF_WEEK = {
|
|
14
15
|
MONDAY: 1,
|
|
@@ -243,6 +244,7 @@ var classnames = {exports: {}};
|
|
|
243
244
|
Licensed under the MIT License (MIT), see
|
|
244
245
|
http://jedwatson.github.io/classnames
|
|
245
246
|
*/
|
|
247
|
+
classnames.exports;
|
|
246
248
|
|
|
247
249
|
var hasRequiredClassnames;
|
|
248
250
|
|
|
@@ -325,7 +327,7 @@ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
|
325
327
|
|
|
326
328
|
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}";
|
|
327
329
|
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"};
|
|
328
|
-
n
|
|
330
|
+
n(css$d,{});
|
|
329
331
|
|
|
330
332
|
const Day = ({ date, isSelected = false, isCurrentMonth, isDisabled = false, isHoliday = false, hasTasks = false, isRangeStart = false, isRangeEnd = false, isRangeMiddle = false, onClick, onDoubleClick, onMouseEnter, onMouseLeave, }) => {
|
|
331
333
|
const dayNumber = date.getDate();
|
|
@@ -374,7 +376,7 @@ const Day = ({ date, isSelected = false, isCurrentMonth, isDisabled = false, isH
|
|
|
374
376
|
|
|
375
377
|
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}";
|
|
376
378
|
var modules_efc4e723$c = {"week":"styles_module_week__5d817eab"};
|
|
377
|
-
n
|
|
379
|
+
n(css$c,{});
|
|
378
380
|
|
|
379
381
|
const Week = ({ weekDays, selectedDate, getIsHoliday, getIsDisabled, getIsCurrentMonth, rangeStart, rangeEnd, hasTasks, onDateClick, onDateDoubleClick, onMouseEnter, onMouseLeave, }) => {
|
|
380
382
|
return (jsx("div", { className: modules_efc4e723$c.week, children: weekDays.map((date) => {
|
|
@@ -626,7 +628,7 @@ function useCalendar(props) {
|
|
|
626
628
|
|
|
627
629
|
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}";
|
|
628
630
|
var modules_efc4e723$b = {"calendar":"styles_module_calendar__131b64c5","errorMessage":"styles_module_errorMessage__131b64c5"};
|
|
629
|
-
n
|
|
631
|
+
n(css$b,{});
|
|
630
632
|
|
|
631
633
|
const CalendarGridWithoutTasks = ({ children, ...props }) => {
|
|
632
634
|
const { calendar, loading, error } = useCalendar(props);
|
|
@@ -720,7 +722,7 @@ const useLockBodyScroll = (isLocked) => {
|
|
|
720
722
|
|
|
721
723
|
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}";
|
|
722
724
|
var modules_efc4e723$a = {"overlay":"styles_module_overlay__337f9387","overlayColor":"styles_module_overlayColor__337f9387","modal":"styles_module_modal__337f9387","closeButton":"styles_module_closeButton__337f9387"};
|
|
723
|
-
n
|
|
725
|
+
n(css$a,{});
|
|
724
726
|
|
|
725
727
|
const Modal = ({ isOpen, onClose, children, showOverlay = true, showCloseButton = true, className = '', classNameOverlay = '', style = {}, }) => {
|
|
726
728
|
const modalRoot = document.body;
|
|
@@ -740,10 +742,6 @@ const Modal = ({ isOpen, onClose, children, showOverlay = true, showCloseButton
|
|
|
740
742
|
return createPortal(modalContent, targetElement);
|
|
741
743
|
};
|
|
742
744
|
|
|
743
|
-
const t$1=(r,t,s)=>{if(r&&"reportValidity"in r){const o=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=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({},get(n,s));set(t,"root",c),set(n,s,t);}else 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,"")}
|
|
744
|
-
|
|
745
|
-
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]=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]=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")}
|
|
746
|
-
|
|
747
745
|
var _path$3;
|
|
748
746
|
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); }
|
|
749
747
|
var SvgCalendar = function SvgCalendar(props) {
|
|
@@ -772,9 +770,9 @@ var SvgClear = function SvgClear(props) {
|
|
|
772
770
|
})));
|
|
773
771
|
};
|
|
774
772
|
|
|
775
|
-
var css$9 = ".theme-light .
|
|
776
|
-
var modules_efc4e723$9 = {"wrapper":"
|
|
777
|
-
n
|
|
773
|
+
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}";
|
|
774
|
+
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"};
|
|
775
|
+
n(css$9,{});
|
|
778
776
|
|
|
779
777
|
const Input = ({ label, error, className = '', id, onReset, placeholder, type = 'text', isDateInput = false, ref = null, ...restProps }) => {
|
|
780
778
|
const generatedId = useId();
|
|
@@ -786,7 +784,7 @@ const Input = ({ label, error, className = '', id, onReset, placeholder, type =
|
|
|
786
784
|
|
|
787
785
|
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}";
|
|
788
786
|
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"};
|
|
789
|
-
n
|
|
787
|
+
n(css$8,{});
|
|
790
788
|
|
|
791
789
|
const CrudModal = ({ isOpen, onClose, onConfirm, title, cancelText = 'No', confirmText = 'Yes', isLoading = false, children, showCloseButton = false, }) => {
|
|
792
790
|
return (jsxs(Modal, { isOpen: isOpen, onClose: onClose, showCloseButton: showCloseButton, children: [jsx("div", { className: modules_efc4e723$8.header, children: jsx("h1", { className: modules_efc4e723$8.title, children: title }) }), children && jsx("div", { className: modules_efc4e723$8.children, children: children }), jsxs("div", { className: modules_efc4e723$8.footer, children: [jsx("button", { className: modules_efc4e723$8.modalButtons, onClick: onClose, disabled: isLoading, children: cancelText }), jsx("button", { className: classNames(modules_efc4e723$8.confirm, modules_efc4e723$8.modalButtons), onClick: onConfirm, children: confirmText })] })] }));
|
|
@@ -6176,7 +6174,7 @@ const formSchema = object({
|
|
|
6176
6174
|
const AddModal = ({ isOpen, onClose, date }) => {
|
|
6177
6175
|
const { addTask } = useTasks();
|
|
6178
6176
|
const { register, handleSubmit, reset, formState: { errors }, } = useForm({
|
|
6179
|
-
resolver:
|
|
6177
|
+
resolver: zodResolver(formSchema),
|
|
6180
6178
|
defaultValues: {
|
|
6181
6179
|
title: '',
|
|
6182
6180
|
date: formatDate(date),
|
|
@@ -6208,7 +6206,7 @@ const DeleteModal = ({ id, isOpen, onClose }) => {
|
|
|
6208
6206
|
const EditModal = ({ isOpen, onClose, id, date }) => {
|
|
6209
6207
|
const { editTask, tasks } = useTasks();
|
|
6210
6208
|
const { register, handleSubmit, reset, formState: { errors }, } = useForm({
|
|
6211
|
-
resolver:
|
|
6209
|
+
resolver: zodResolver(formSchema),
|
|
6212
6210
|
defaultValues: {
|
|
6213
6211
|
title: '',
|
|
6214
6212
|
date: formatDate(date),
|
|
@@ -6255,7 +6253,7 @@ const EditModal = ({ isOpen, onClose, id, date }) => {
|
|
|
6255
6253
|
|
|
6256
6254
|
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}";
|
|
6257
6255
|
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"};
|
|
6258
|
-
n
|
|
6256
|
+
n(css$7,{});
|
|
6259
6257
|
|
|
6260
6258
|
const TasksManager = ({ onClose, isOpen, tasks, selectedDate, }) => {
|
|
6261
6259
|
const addModal = useModal();
|
|
@@ -6317,7 +6315,7 @@ const useTooltip = () => {
|
|
|
6317
6315
|
|
|
6318
6316
|
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}";
|
|
6319
6317
|
var modules_efc4e723$6 = {"tooltip":"styles_module_tooltip__ac28d9b8"};
|
|
6320
|
-
n
|
|
6318
|
+
n(css$6,{});
|
|
6321
6319
|
|
|
6322
6320
|
const Tooltip = ({ isVisible, text, x, y }) => {
|
|
6323
6321
|
if (!isVisible)
|
|
@@ -6401,7 +6399,7 @@ var SvgPrev = function SvgPrev(props) {
|
|
|
6401
6399
|
|
|
6402
6400
|
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}";
|
|
6403
6401
|
var modules_efc4e723$5 = {"month":"styles_module_month__0a69a8ca","arrow":"styles_module_arrow__0a69a8ca"};
|
|
6404
|
-
n
|
|
6402
|
+
n(css$5,{});
|
|
6405
6403
|
|
|
6406
6404
|
const Month = ({ date, onPrev, onNext }) => {
|
|
6407
6405
|
const year = date.getFullYear();
|
|
@@ -6422,7 +6420,7 @@ const getOrderedDays = (firstDayOfWeek) => {
|
|
|
6422
6420
|
|
|
6423
6421
|
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}";
|
|
6424
6422
|
var modules_efc4e723$4 = {"weekDay":"styles_module_weekDay__a9cd2130","dayName":"styles_module_dayName__a9cd2130"};
|
|
6425
|
-
n
|
|
6423
|
+
n(css$4,{});
|
|
6426
6424
|
|
|
6427
6425
|
const WeekDay = ({ firstDayOfWeek = 1, className = '', hideWeekends = false, }) => {
|
|
6428
6426
|
let days = getOrderedDays(firstDayOfWeek);
|
|
@@ -6436,7 +6434,7 @@ const WeekDay = ({ firstDayOfWeek = 1, className = '', hideWeekends = false, })
|
|
|
6436
6434
|
|
|
6437
6435
|
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}";
|
|
6438
6436
|
var modules_efc4e723$3 = {"calendarGrid":"styles_module_calendarGrid__eeb1dea8"};
|
|
6439
|
-
n
|
|
6437
|
+
n(css$3,{});
|
|
6440
6438
|
|
|
6441
6439
|
const BaseCalendar = ({ mode = MODES.MONTH, monthDate, firstDayOfWeek = 1, hideWeekends = false, ...props }) => {
|
|
6442
6440
|
const [baseDate, setBaseDate] = useState(monthDate);
|
|
@@ -6556,7 +6554,7 @@ function useValidate(selectedDate) {
|
|
|
6556
6554
|
|
|
6557
6555
|
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}";
|
|
6558
6556
|
var modules_efc4e723$2 = {"datepicker":"styles_module_datepicker__c32ee18d"};
|
|
6559
|
-
n
|
|
6557
|
+
n(css$2,{});
|
|
6560
6558
|
|
|
6561
6559
|
const DatePicker = ({ selectedDate, monthDate = new Date(), onChange, ...props }) => {
|
|
6562
6560
|
const { currentDate, value, handleDateSelect, error, ref, handleDateValidation, handleClearInput, } = useValidate(selectedDate);
|
|
@@ -6579,7 +6577,7 @@ const DatePicker = ({ selectedDate, monthDate = new Date(), onChange, ...props }
|
|
|
6579
6577
|
|
|
6580
6578
|
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}";
|
|
6581
6579
|
var modules_efc4e723$1 = {"clear":"styles_module_clear__8e986404"};
|
|
6582
|
-
n
|
|
6580
|
+
n(css$1,{});
|
|
6583
6581
|
|
|
6584
6582
|
const Clear = ({ onClick }) => {
|
|
6585
6583
|
return (jsx("button", { className: modules_efc4e723$1.clear, type: "button", onClick: onClick, children: "Clear" }));
|
|
@@ -6587,7 +6585,7 @@ const Clear = ({ onClick }) => {
|
|
|
6587
6585
|
|
|
6588
6586
|
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}";
|
|
6589
6587
|
var modules_efc4e723 = {"rangePicker":"styles_module_rangePicker__42a840f2","calendar":"styles_module_calendar__42a840f2","inputs":"styles_module_inputs__42a840f2"};
|
|
6590
|
-
n
|
|
6588
|
+
n(css,{});
|
|
6591
6589
|
|
|
6592
6590
|
const RangePicker = ({ rangeStart, rangeEnd, monthDate = new Date(), onChangeStart, onChangeEnd, ...props }) => {
|
|
6593
6591
|
const { currentDate: startDate, value: startValue, error: startError, ref: startRef, handleDateSelect: handleStartDateSelect, handleDateValidation: handleStartDateValidation, handleClearInput: handleStartClearInput, } = useValidate(rangeStart);
|