@daryasidorovich/modsen-datepicker 1.0.24 → 1.0.26
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 +26 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -26
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/Button/Button.d.ts +0 -5
- package/dist/components/Button/index.d.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -2,14 +2,13 @@ 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 {
|
|
6
|
-
import { useForm } from 'react-hook-form';
|
|
5
|
+
import { get, set, appendErrors, useForm } from 'react-hook-form';
|
|
7
6
|
import { IMask, useIMask } from 'react-imask';
|
|
8
7
|
|
|
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}}
|
|
8
|
+
var e=[],t$2=[];function n$1(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$2[u]={}),a=t$2[u]&&t$2[u][s]?t$2[u][s]:t$2[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}}
|
|
10
9
|
|
|
11
10
|
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}";
|
|
12
|
-
n(css$e,{});
|
|
11
|
+
n$1(css$e,{});
|
|
13
12
|
|
|
14
13
|
const FIRST_DAY_OF_WEEK = {
|
|
15
14
|
MONDAY: 1,
|
|
@@ -327,7 +326,7 @@ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
|
327
326
|
|
|
328
327
|
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}";
|
|
329
328
|
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"};
|
|
330
|
-
n(css$d,{});
|
|
329
|
+
n$1(css$d,{});
|
|
331
330
|
|
|
332
331
|
const Day = ({ date, isSelected = false, isCurrentMonth, isDisabled = false, isHoliday = false, hasTasks = false, isRangeStart = false, isRangeEnd = false, isRangeMiddle = false, onClick, onDoubleClick, onMouseEnter, onMouseLeave, }) => {
|
|
333
332
|
const dayNumber = date.getDate();
|
|
@@ -376,7 +375,7 @@ const Day = ({ date, isSelected = false, isCurrentMonth, isDisabled = false, isH
|
|
|
376
375
|
|
|
377
376
|
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}";
|
|
378
377
|
var modules_efc4e723$c = {"week":"styles_module_week__5d817eab"};
|
|
379
|
-
n(css$c,{});
|
|
378
|
+
n$1(css$c,{});
|
|
380
379
|
|
|
381
380
|
const Week = ({ weekDays, selectedDate, getIsHoliday, getIsDisabled, getIsCurrentMonth, rangeStart, rangeEnd, hasTasks, onDateClick, onDateDoubleClick, onMouseEnter, onMouseLeave, }) => {
|
|
382
381
|
return (jsx("div", { className: modules_efc4e723$c.week, children: weekDays.map((date) => {
|
|
@@ -547,8 +546,7 @@ function withMinMax(calendar, minDate, maxDate) {
|
|
|
547
546
|
return calendar;
|
|
548
547
|
}
|
|
549
548
|
|
|
550
|
-
const HOLIDAY_API_URL = 'https://
|
|
551
|
-
const API_KEY = 'f36f54be-e335-4957-9c64-fde814074428';
|
|
549
|
+
const HOLIDAY_API_URL = 'https://date.nager.at/api/v3/PublicHolidays';
|
|
552
550
|
const getHolidays = async (year = new Date().getFullYear(), signal) => {
|
|
553
551
|
try {
|
|
554
552
|
let holidayDates;
|
|
@@ -557,15 +555,14 @@ const getHolidays = async (year = new Date().getFullYear(), signal) => {
|
|
|
557
555
|
if (!countryCode) {
|
|
558
556
|
throw new Error('Cannot get your country code');
|
|
559
557
|
}
|
|
560
|
-
|
|
561
|
-
const url = `${HOLIDAY_API_URL}?key=${API_KEY}&country=${countryCode}&year=${year}`;
|
|
558
|
+
const url = `${HOLIDAY_API_URL}/${year}/${countryCode}`;
|
|
562
559
|
const response = await fetch(url, { signal });
|
|
563
560
|
if (!response.ok) {
|
|
564
561
|
throw new Error(`Error while loading holidays`);
|
|
565
562
|
}
|
|
566
563
|
const data = await response.json();
|
|
567
|
-
if (data
|
|
568
|
-
holidayDates = data.
|
|
564
|
+
if (data) {
|
|
565
|
+
holidayDates = data.map((holiday) => {
|
|
569
566
|
const date = new Date(holiday.date);
|
|
570
567
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
571
568
|
});
|
|
@@ -626,7 +623,7 @@ function useCalendar(props) {
|
|
|
626
623
|
|
|
627
624
|
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
625
|
var modules_efc4e723$b = {"calendar":"styles_module_calendar__131b64c5","errorMessage":"styles_module_errorMessage__131b64c5"};
|
|
629
|
-
n(css$b,{});
|
|
626
|
+
n$1(css$b,{});
|
|
630
627
|
|
|
631
628
|
const CalendarGridWithoutTasks = ({ children, ...props }) => {
|
|
632
629
|
const { calendar, loading, error } = useCalendar(props);
|
|
@@ -720,7 +717,7 @@ const useLockBodyScroll = (isLocked) => {
|
|
|
720
717
|
|
|
721
718
|
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
719
|
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(css$a,{});
|
|
720
|
+
n$1(css$a,{});
|
|
724
721
|
|
|
725
722
|
const Modal = ({ isOpen, onClose, children, showOverlay = true, showCloseButton = true, className = '', classNameOverlay = '', style = {}, }) => {
|
|
726
723
|
const modalRoot = document.body;
|
|
@@ -740,6 +737,10 @@ const Modal = ({ isOpen, onClose, children, showOverlay = true, showCloseButton
|
|
|
740
737
|
return createPortal(modalContent, targetElement);
|
|
741
738
|
};
|
|
742
739
|
|
|
740
|
+
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,"")}
|
|
741
|
+
|
|
742
|
+
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")}
|
|
743
|
+
|
|
743
744
|
var _path$3;
|
|
744
745
|
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); }
|
|
745
746
|
var SvgCalendar = function SvgCalendar(props) {
|
|
@@ -770,7 +771,7 @@ var SvgClear = function SvgClear(props) {
|
|
|
770
771
|
|
|
771
772
|
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}";
|
|
772
773
|
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"};
|
|
773
|
-
n(css$9,{});
|
|
774
|
+
n$1(css$9,{});
|
|
774
775
|
|
|
775
776
|
const Input = ({ label, error, className = '', id, onReset, placeholder, type = 'text', isDateInput = false, ref = null, ...restProps }) => {
|
|
776
777
|
const generatedId = useId();
|
|
@@ -782,7 +783,7 @@ const Input = ({ label, error, className = '', id, onReset, placeholder, type =
|
|
|
782
783
|
|
|
783
784
|
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}";
|
|
784
785
|
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"};
|
|
785
|
-
n(css$8,{});
|
|
786
|
+
n$1(css$8,{});
|
|
786
787
|
|
|
787
788
|
const CrudModal = ({ isOpen, onClose, onConfirm, title, cancelText = 'No', confirmText = 'Yes', isLoading = false, children, showCloseButton = false, }) => {
|
|
788
789
|
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 })] })] }));
|
|
@@ -6172,7 +6173,7 @@ const formSchema = object({
|
|
|
6172
6173
|
const AddModal = ({ isOpen, onClose, date }) => {
|
|
6173
6174
|
const { addTask } = useTasks();
|
|
6174
6175
|
const { register, handleSubmit, reset, formState: { errors }, } = useForm({
|
|
6175
|
-
resolver:
|
|
6176
|
+
resolver: u(formSchema),
|
|
6176
6177
|
defaultValues: {
|
|
6177
6178
|
title: '',
|
|
6178
6179
|
date: formatDate(date),
|
|
@@ -6204,7 +6205,7 @@ const DeleteModal = ({ id, isOpen, onClose }) => {
|
|
|
6204
6205
|
const EditModal = ({ isOpen, onClose, id, date }) => {
|
|
6205
6206
|
const { editTask, tasks } = useTasks();
|
|
6206
6207
|
const { register, handleSubmit, reset, formState: { errors }, } = useForm({
|
|
6207
|
-
resolver:
|
|
6208
|
+
resolver: u(formSchema),
|
|
6208
6209
|
defaultValues: {
|
|
6209
6210
|
title: '',
|
|
6210
6211
|
date: formatDate(date),
|
|
@@ -6251,7 +6252,7 @@ const EditModal = ({ isOpen, onClose, id, date }) => {
|
|
|
6251
6252
|
|
|
6252
6253
|
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}";
|
|
6253
6254
|
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"};
|
|
6254
|
-
n(css$7,{});
|
|
6255
|
+
n$1(css$7,{});
|
|
6255
6256
|
|
|
6256
6257
|
const TasksManager = ({ onClose, isOpen, tasks, selectedDate, }) => {
|
|
6257
6258
|
const addModal = useModal();
|
|
@@ -6313,7 +6314,7 @@ const useTooltip = () => {
|
|
|
6313
6314
|
|
|
6314
6315
|
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}";
|
|
6315
6316
|
var modules_efc4e723$6 = {"tooltip":"styles_module_tooltip__ac28d9b8"};
|
|
6316
|
-
n(css$6,{});
|
|
6317
|
+
n$1(css$6,{});
|
|
6317
6318
|
|
|
6318
6319
|
const Tooltip = ({ isVisible, text, x, y }) => {
|
|
6319
6320
|
if (!isVisible)
|
|
@@ -6397,7 +6398,7 @@ var SvgPrev = function SvgPrev(props) {
|
|
|
6397
6398
|
|
|
6398
6399
|
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}";
|
|
6399
6400
|
var modules_efc4e723$5 = {"month":"styles_module_month__0a69a8ca","arrow":"styles_module_arrow__0a69a8ca"};
|
|
6400
|
-
n(css$5,{});
|
|
6401
|
+
n$1(css$5,{});
|
|
6401
6402
|
|
|
6402
6403
|
const Month = ({ date, onPrev, onNext }) => {
|
|
6403
6404
|
const year = date.getFullYear();
|
|
@@ -6418,7 +6419,7 @@ const getOrderedDays = (firstDayOfWeek) => {
|
|
|
6418
6419
|
|
|
6419
6420
|
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}";
|
|
6420
6421
|
var modules_efc4e723$4 = {"weekDay":"styles_module_weekDay__a9cd2130","dayName":"styles_module_dayName__a9cd2130"};
|
|
6421
|
-
n(css$4,{});
|
|
6422
|
+
n$1(css$4,{});
|
|
6422
6423
|
|
|
6423
6424
|
const WeekDay = ({ firstDayOfWeek = 1, className = '', hideWeekends = false, }) => {
|
|
6424
6425
|
let days = getOrderedDays(firstDayOfWeek);
|
|
@@ -6432,7 +6433,7 @@ const WeekDay = ({ firstDayOfWeek = 1, className = '', hideWeekends = false, })
|
|
|
6432
6433
|
|
|
6433
6434
|
var css$3 = ".styles_module_calendarGrid__a4a27900 {\n border-style: solid;\n border-width: 1px;\n}\n.theme-light .styles_module_calendarGrid__a4a27900 {\n border-color: #e1e1e1;\n background-color: #ffffff;\n}\n.theme-dark .styles_module_calendarGrid__a4a27900 {\n border-color: #aaaaaa;\n background-color: #333333;\n}\n.styles_module_calendarGrid__a4a27900 {\n padding: 10px;\n border-radius: 8px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n align-items: center;\n width: 262px;\n}";
|
|
6434
6435
|
var modules_efc4e723$3 = {"calendarGrid":"styles_module_calendarGrid__a4a27900"};
|
|
6435
|
-
n(css$3,{});
|
|
6436
|
+
n$1(css$3,{});
|
|
6436
6437
|
|
|
6437
6438
|
const BaseCalendar = ({ mode = MODES.MONTH, monthDate, firstDayOfWeek = 1, hideWeekends = false, ...props }) => {
|
|
6438
6439
|
const [baseDate, setBaseDate] = useState(monthDate);
|
|
@@ -6552,7 +6553,7 @@ function useValidate(selectedDate) {
|
|
|
6552
6553
|
|
|
6553
6554
|
var css$2 = ".styles_module_datepicker__56a414ad {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 8px;\n width: 262px;\n}\n.theme-light .styles_module_datepicker__56a414ad {\n background-color: #ffffff;\n}\n.theme-dark .styles_module_datepicker__56a414ad {\n background-color: #333333;\n}";
|
|
6554
6555
|
var modules_efc4e723$2 = {"datepicker":"styles_module_datepicker__56a414ad"};
|
|
6555
|
-
n(css$2,{});
|
|
6556
|
+
n$1(css$2,{});
|
|
6556
6557
|
|
|
6557
6558
|
const DatePicker = ({ selectedDate, monthDate = new Date(), onChange, ...props }) => {
|
|
6558
6559
|
const { currentDate, value, handleDateSelect, error, ref, handleDateValidation, handleClearInput, } = useValidate(selectedDate);
|
|
@@ -6575,7 +6576,7 @@ const DatePicker = ({ selectedDate, monthDate = new Date(), onChange, ...props }
|
|
|
6575
6576
|
|
|
6576
6577
|
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}";
|
|
6577
6578
|
var modules_efc4e723$1 = {"clear":"styles_module_clear__8e986404"};
|
|
6578
|
-
n(css$1,{});
|
|
6579
|
+
n$1(css$1,{});
|
|
6579
6580
|
|
|
6580
6581
|
const Clear = ({ onClick }) => {
|
|
6581
6582
|
return (jsx("button", { className: modules_efc4e723$1.clear, type: "button", onClick: onClick, children: "Clear" }));
|
|
@@ -6583,7 +6584,7 @@ const Clear = ({ onClick }) => {
|
|
|
6583
6584
|
|
|
6584
6585
|
var css = ".styles_module_rangePicker__2a1e1dc4 {\n display: flex;\n flex-direction: column;\n padding: 8px;\n width: 262px;\n}\n.theme-light .styles_module_rangePicker__2a1e1dc4 {\n background-color: #ffffff;\n}\n.theme-dark .styles_module_rangePicker__2a1e1dc4 {\n background-color: #333333;\n}\n\n.styles_module_calendar__2a1e1dc4 {\n margin-top: 15px;\n}\n\n.styles_module_inputs__2a1e1dc4 {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}";
|
|
6585
6586
|
var modules_efc4e723 = {"rangePicker":"styles_module_rangePicker__2a1e1dc4","calendar":"styles_module_calendar__2a1e1dc4","inputs":"styles_module_inputs__2a1e1dc4"};
|
|
6586
|
-
n(css,{});
|
|
6587
|
+
n$1(css,{});
|
|
6587
6588
|
|
|
6588
6589
|
const RangePicker = ({ rangeStart, rangeEnd, monthDate = new Date(), onChangeStart, onChangeEnd, ...props }) => {
|
|
6589
6590
|
const { currentDate: startDate, value: startValue, error: startError, ref: startRef, handleDateSelect: handleStartDateSelect, handleDateValidation: handleStartDateValidation, handleClearInput: handleStartClearInput, } = useValidate(rangeStart);
|