react-table-edit 1.5.46 → 1.5.48
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/component/calendar/index.d.ts +8 -0
- package/dist/component/sidebar-setting-column/index.d.ts +2 -0
- package/dist/component/table/filter-element.d.ts +1 -1
- package/dist/component/table-view/header.d.ts +3 -3
- package/dist/index.js +294 -825
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +294 -825
- package/dist/index.mjs.map +1 -1
- package/dist/styles/index.css +1 -46
- package/dist/styles/index.css.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9056,20 +9056,6 @@ var SvgProcess = function (_a) {
|
|
|
9056
9056
|
React$5.createElement("path", { d: "M22.43 3.87a1.302 1.302 0 0 0-2.545-.374H9.886V1.874a.375.375 0 0 0-.375-.375H2.858a.375.375 0 0 0-.375.375v3.992a.375.375 0 0 0 .375.375h6.653a.375.375 0 0 0 .375-.375V4.245h9.999a1.301 1.301 0 0 0 .867.868v6.344h-.902v-1.62a.376.376 0 0 0-.375-.376h-6.653a.375.375 0 0 0-.375.375v1.62H4.115a1.3 1.3 0 1 0-1.617 1.618v7.055a.375.375 0 0 0 .375.375H5.81v1.621a.375.375 0 0 0 .375.375h6.652a.376.376 0 0 0 .375-.375v-1.62h5.327l-.695.674a.375.375 0 1 0 .522.538l1.357-1.316a.377.377 0 0 0 .006-.544l-1.357-1.316a.375.375 0 1 0-.522.539l.695.674h-5.333v-1.62a.376.376 0 0 0-.375-.376H6.185a.376.376 0 0 0-.375.375v1.621H3.248v-6.68a1.301 1.301 0 0 0 .867-.867h8.332v1.62a.374.374 0 0 0 .375.376h6.653a.374.374 0 0 0 .375-.375v-1.621h1.277a.376.376 0 0 0 .375-.375v-6.72a1.3 1.3 0 0 0 .929-1.242ZM9.137 5.492H3.233V2.25h5.903v3.242ZM6.56 18.508h5.902v3.242H6.56v-3.242Zm-3.687-6.122a.554.554 0 0 1 0-1.108.554.554 0 0 1 0 1.108ZM19.1 13.453h-5.903V10.21H19.1v3.242Zm2.027-9.029a.554.554 0 0 1 0-1.107.554.554 0 0 1 0 1.107Z", fill: props.color || "currentColor" })));
|
|
9057
9057
|
};
|
|
9058
9058
|
|
|
9059
|
-
var SvgProjectSetting = function (_a) {
|
|
9060
|
-
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9061
|
-
return (React$5.createElement("svg", __assign({ width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", strokeWidth: props.strokeWidth || 1.5, "aria-labelledby": titleId }, props),
|
|
9062
|
-
title ? React$5.createElement("title", { id: titleId }, title) : null,
|
|
9063
|
-
React$5.createElement("g", { clipPath: "url(#project-setting_svg__a)", fill: props.color || "currentColor" },
|
|
9064
|
-
React$5.createElement("path", { d: "M1.266.042C.9.155.53.506.43.834.394.961.375 1.528.375 2.616v1.598l.122.094c.201.16.403.122.51-.094.057-.108.071-.408.071-1.655V1.031l.136-.15.136-.155H19.275l.136.155.136.15v8.916l.14.14c.118.113.17.136.272.108a.533.533 0 0 0 .207-.103c.08-.07.084-.347.084-4.575 0-3.314-.014-4.547-.056-4.683-.07-.234-.366-.572-.619-.708l-.192-.103-9-.009C5.433.009 1.33.024 1.266.042Z" }),
|
|
9065
|
-
React$5.createElement("path", { d: "M2.03 2.156a.351.351 0 0 0-.15.136c-.033.061-.052.586-.052 1.481v1.388l.117.112c.061.066.17.118.235.118a.386.386 0 0 0 .234-.118c.108-.103.117-.15.117-.562v-.445h.263c.398 0 .623-.085.862-.329.347-.346.422-.778.206-1.209-.224-.45-.585-.619-1.303-.614-.234 0-.473.019-.53.042Zm1.106.778c.183.155.192.347.028.511-.094.099-.16.118-.375.118h-.258v-.75h.23c.183 0 .262.028.375.121ZM4.477 2.227l-.118.112V5.2l.122.093c.155.122.305.127.446.01.093-.075.112-.141.136-.474l.023-.389.323.37c.446.511.53.582.68.582.169 0 .333-.178.333-.361 0-.108-.075-.225-.328-.511-.178-.202-.328-.385-.328-.403 0-.02.037-.043.084-.057.131-.042.38-.304.483-.506.108-.206.117-.581.023-.806-.098-.24-.389-.488-.651-.567-.136-.042-.422-.07-.675-.07-.403 0-.45.009-.553.117Zm1.12.684c.272.216.07.558-.328.558h-.207v-.657h.207c.136 0 .244.033.328.099ZM7.876 2.184A1.619 1.619 0 0 0 6.84 4.472c.67 1.364 2.657 1.139 3.032-.342.211-.844-.323-1.725-1.185-1.95-.329-.085-.479-.085-.811.004Zm.68.68c.257.07.562.385.632.647.164.614-.356 1.228-.989 1.167a.98.98 0 0 1-.736-.506c-.21-.394-.07-.947.3-1.172.295-.183.492-.216.792-.136ZM11.08 2.166c-.187.089-.206.225-.206 1.378 0 1.232.005 1.218-.323 1.045-.169-.084-.216-.094-.328-.042a.402.402 0 0 0-.197.197c-.075.178 0 .337.234.492.418.281.961.15 1.21-.29.103-.184.108-.23.108-1.398V2.34l-.118-.113c-.122-.126-.22-.14-.38-.06ZM15.3 2.175c-.484.122-.873.445-1.107.914-.15.305-.155 1.003-.005 1.327.14.309.478.651.797.81.235.118.328.136.67.141.343 0 .436-.019.666-.131.488-.24.656-.61.384-.825-.173-.136-.253-.127-.501.07-.638.497-1.505-.01-1.43-.83.066-.642.746-.998 1.36-.707.271.126.323.126.478.004.145-.112.169-.365.042-.492-.258-.258-.914-.393-1.355-.281ZM17.19 2.203a.29.29 0 0 0-.128.263c0 .243.132.346.446.346h.258v2.386l.122.094c.154.122.304.127.445.01.112-.09.112-.094.126-1.29l.014-1.2h.254c.215 0 .262-.018.346-.121.122-.155.127-.305.01-.446-.09-.108-.113-.112-.928-.126-.797-.014-.844-.01-.966.084ZM12.268 2.212a.55.55 0 0 0-.127.193c-.06.178-.065 2.56 0 2.733.09.23.16.248.872.253.628 0 .661-.005.76-.108.145-.155.135-.375-.02-.497-.107-.084-.191-.098-.538-.098h-.418v-.563h.352c.403 0 .558-.056.633-.23.056-.14.005-.342-.103-.412-.033-.019-.24-.047-.46-.061l-.398-.024-.014-.271-.014-.268h.417c.351 0 .436-.014.544-.098a.35.35 0 0 0 .028-.511c-.085-.084-.155-.094-.764-.094-.464 0-.694.019-.75.056ZM.478 5.452l-.103.112.01 8.456.013 8.457.15.318c.179.37.535.764.849.938.501.272.408.267 4.945.267h4.163l.112-.117c.15-.145.15-.324 0-.469l-.112-.117H3.938l.14-.22c.277-.432.338-.68.366-1.44.023-.68.023-.703.154-.843l.127-.146H22.65l.14.16.141.154-.018.713c-.015.675-.02.717-.141.928-.174.29-.455.52-.745.614-.216.07-.718.08-5.185.08h-4.94l-.113.117c-.15.145-.15.323 0 .469l.113.117h4.959c5.414 0 5.236.01 5.742-.267.314-.174.67-.567.849-.938.145-.31.15-.337.164-1.064.018-.876-.02-1.064-.286-1.369-.357-.407-.394-.417-1.824-.43l-1.256-.015v-.539l.295.019c.53.033.77-.174 1.252-1.083.16-.295.192-.408.192-.614 0-.417-.197-.712-.652-.966l-.178-.103v-1.153l.178-.103c.46-.258.647-.54.647-.966 0-.22-.032-.323-.192-.623-.478-.895-.717-1.106-1.247-1.073l-.295.018v-.694c0-.632-.01-.703-.094-.787-.126-.127-.38-.122-.497.005-.08.089-.089.187-.103.867-.01.422-.023.769-.028.769-.01 0-.14-.075-.29-.165a2.169 2.169 0 0 0-.38-.192c-.099-.028-.108-.056-.108-.318 0-.385-.07-.605-.248-.811-.249-.286-.436-.342-1.14-.342-.346 0-.684.023-.773.056-.436.15-.651.482-.651 1.012v.338l-.291.145c-.164.08-.385.211-.497.286l-.202.14-.323-.168c-.24-.127-.375-.169-.544-.169-.272 0-.558.122-.726.31-.178.192-.647 1.04-.68 1.228-.08.417.131.82.558 1.068l.29.174v1.144l-.29.173c-.427.248-.638.651-.558 1.069.033.187.502 1.036.68 1.228.168.187.454.31.726.31.169 0 .305-.043.544-.17l.323-.168.202.14c.112.075.333.207.497.286.258.131.29.164.29.286v.14l-5.657.01-5.663.014-.192.103c-.21.113-.51.422-.59.615-.029.07-.066.454-.085.857-.023.67-.038.75-.16.994-.482.994-1.8 1.04-2.362.09l-.126-.221-.024-8.428-.023-8.433-.113-.09c-.15-.121-.342-.112-.464.02Zm17.494 6.417c.056.08.075.225.075.553 0 .408.01.46.108.548a.67.67 0 0 0 .22.131c.22.066.727.352.956.54.122.103.267.187.319.187.052 0 .277-.098.502-.22.539-.286.567-.277.886.267.351.595.337.656-.17.96-.215.127-.412.273-.44.32-.028.056-.028.215.01.487.037.305.037.511 0 .82-.066.511-.061.526.445.826.492.295.501.356.155.946-.32.544-.347.553-.886.267-.225-.121-.45-.22-.502-.22-.052 0-.197.085-.319.192a4.262 4.262 0 0 1-.675.404c-.618.3-.61.29-.61.703v.342H16.642v-.296c0-.417-.057-.492-.493-.675a4.13 4.13 0 0 1-.721-.412c-.193-.14-.39-.258-.441-.258-.052 0-.258.099-.46.216-.52.305-.562.29-.895-.263-.15-.243-.272-.487-.272-.543 0-.122.132-.24.525-.464.361-.207.422-.32.361-.638a4.085 4.085 0 0 1-.037-.534c0-.183.019-.422.037-.535.061-.319 0-.431-.36-.637-.394-.225-.526-.342-.526-.464 0-.056.122-.3.272-.544.333-.553.366-.563.89-.262.202.117.413.215.465.215.051 0 .248-.117.44-.258.193-.14.516-.328.722-.412.254-.108.394-.197.432-.272.033-.066.06-.29.06-.53 0-.586.005-.59.708-.59.516 0 .558.004.624.103Zm1.575 7.701v.352h-.797v-.155c0-.131.023-.16.202-.234.112-.042.276-.132.365-.197a.953.953 0 0 1 .197-.117c.019 0 .033.16.033.351Z" }),
|
|
9066
|
-
React$5.createElement("path", { d: "M16.683 14.358c-.478.201-.811.515-1.022.965-.103.23-.122.324-.122.732 0 .436.01.492.15.778.183.375.52.703.895.876.235.113.324.127.76.127.45 0 .515-.014.773-.136a1.867 1.867 0 0 0 1.013-1.378c.13-.745-.305-1.566-1.013-1.908-.234-.112-.351-.136-.726-.15-.385-.014-.483 0-.708.094Zm1.106.684c.413.188.647.558.647 1.013 0 .633-.469 1.097-1.106 1.101-.46 0-.807-.215-.999-.633a1.129 1.129 0 0 1 .567-1.504c.207-.09.67-.08.891.023ZM2.742 6.21a.386.386 0 0 0-.117.235c0 .066.052.174.117.235l.113.117H17.77l.113-.117c.15-.146.15-.324 0-.47l-.113-.116H2.855l-.113.117ZM2.892 7.753c-.422.155-.764.506-.876.919-.028.094-.047.928-.047 1.955 0 1.678.004 1.809.093 2.043.113.296.39.59.694.746l.22.107h6.516l.267-.13c.15-.076.343-.216.432-.324.304-.352.309-.403.309-2.494 0-1.875 0-1.88-.113-2.114-.14-.305-.487-.614-.792-.703-.333-.099-6.426-.103-6.703-.005Zm6.553.703c.09.038.207.14.258.225.09.15.094.235.094 1.932 0 1.706-.005 1.78-.094 1.93-.192.31-.14.305-3.539.291-3.394-.014-3.197.005-3.398-.332-.09-.141-.094-.249-.094-1.885 0-1.94.005-1.964.333-2.142.15-.08.342-.084 3.22-.084 2.555 0 3.084.009 3.22.065Z" }),
|
|
9067
|
-
React$5.createElement("path", { d: "M6.623 9.047a.351.351 0 0 0-.15.136c-.032.06-.051.604-.051 1.542 0 1.36.005 1.458.089 1.56.089.113.094.113 1.275.127 1.266.014 1.397-.004 1.49-.206.07-.16.07-2.826 0-2.986a.368.368 0 0 0-.168-.169c-.136-.06-2.33-.065-2.485-.004Zm2.002 1.664v1.008h-1.5V9.703h1.5v1.008ZM3.281 10.406c-.089.09-.094.155-.094.957v.867l.122.093c.118.094.183.099 1.308.099s1.19-.005 1.308-.099l.122-.093v-.867c0-.802-.005-.868-.094-.957-.089-.089-.155-.094-1.336-.094s-1.247.005-1.336.094Zm2.063.961v.352H3.89v-.703H5.344v.351ZM11.587 9.08c-.032.014-.089.08-.126.154-.09.17-.019.39.145.464.085.038 1.064.052 3.469.052h3.351l.113-.117a.386.386 0 0 0 .117-.235.386.386 0 0 0-.117-.234l-.113-.117-3.389.005c-1.865 0-3.417.014-3.45.028ZM11.526 10.49c-.155.127-.14.366.024.512l.126.107H15.895l.112-.117c.15-.145.155-.347.01-.483-.108-.103-.117-.103-2.245-.103-2.007 0-2.143.005-2.246.085ZM2.063 14.54c-.183.198-.075.512.197.577.061.014 2.25.019 4.87.014 4.613-.014 4.772-.018 4.866-.103.127-.117.131-.37.005-.497-.094-.094-.155-.094-4.969-.094h-4.87l-.099.104ZM2.062 15.89c-.202.202-.066.53.244.587.084.014 2.419.023 5.184.014l5.034-.014.09-.113c.117-.14.112-.356-.005-.473-.094-.094-.155-.094-5.274-.094-5.118 0-5.18 0-5.273.094ZM2.175 17.175a.332.332 0 0 0-.112.544c.094.093.155.093 4.987.093h4.899l.07-.103c.108-.15.094-.38-.023-.487-.094-.085-.253-.09-4.89-.099-3.946-.009-4.809 0-4.93.052ZM2.17 18.563c-.215.089-.267.389-.093.553.108.103.108.103 2.503.103 2.212 0 2.4-.005 2.489-.085a.435.435 0 0 0 .131-.206c.024-.103 0-.155-.112-.272l-.141-.14-2.339.004c-1.284 0-2.381.02-2.438.043Z" })),
|
|
9068
|
-
React$5.createElement("defs", null,
|
|
9069
|
-
React$5.createElement("clipPath", { id: "project-setting_svg__a" },
|
|
9070
|
-
React$5.createElement("path", { fill: "#fff", d: "M0 0h24v24H0z" })))));
|
|
9071
|
-
};
|
|
9072
|
-
|
|
9073
9059
|
var SvgQuoteRight = function (_a) {
|
|
9074
9060
|
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9075
9061
|
return (React$5.createElement("svg", __assign({ width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", strokeWidth: props.strokeWidth || 1.5, "aria-labelledby": titleId }, props),
|
|
@@ -9238,13 +9224,6 @@ var SvgSettings = function (_a) {
|
|
|
9238
9224
|
React$5.createElement("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })));
|
|
9239
9225
|
};
|
|
9240
9226
|
|
|
9241
|
-
var SvgShapeGroup = function (_a) {
|
|
9242
|
-
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9243
|
-
return (React$5.createElement("svg", __assign({ width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", strokeWidth: props.strokeWidth || 1.5, "aria-labelledby": titleId }, props),
|
|
9244
|
-
title ? React$5.createElement("title", { id: titleId }, title) : null,
|
|
9245
|
-
React$5.createElement("path", { d: "M24 15h-4.91l4.336 7.5H6.973l3.129-5.426a6.965 6.965 0 0 1-1.618.68A6.784 6.784 0 0 1 6.75 18a6.677 6.677 0 0 1-4.77-1.98 6.952 6.952 0 0 1-1.44-2.145A6.681 6.681 0 0 1 0 11.25a6.677 6.677 0 0 1 1.98-4.77 6.952 6.952 0 0 1 2.145-1.44A6.681 6.681 0 0 1 6.75 4.5c.664 0 1.313.094 1.945.281a6.579 6.579 0 0 1 1.805.856V1.5H24V15ZM6.75 16.5c.727 0 1.406-.137 2.04-.41a5.208 5.208 0 0 0 1.663-1.137 5.488 5.488 0 0 0 1.125-1.664A5.17 5.17 0 0 0 12 11.25c0-.719-.137-1.395-.41-2.027a5.448 5.448 0 0 0-1.125-1.676A5.054 5.054 0 0 0 8.8 6.422 5.555 5.555 0 0 0 6.75 6c-.727 0-1.406.137-2.04.41A5.305 5.305 0 0 0 1.923 9.2a5.258 5.258 0 0 0-.422 2.05c0 .727.137 1.406.41 2.04a5.305 5.305 0 0 0 2.79 2.788 5.257 5.257 0 0 0 2.05.422ZM20.824 21a1846.92 1846.92 0 0 1-2.812-4.875 1846.92 1846.92 0 0 0-2.813-4.875 1846.92 1846.92 0 0 0-2.812 4.875c-.93 1.617-1.867 3.242-2.813 4.875h11.25ZM22.5 3H12v4.066A6.7 6.7 0 0 1 13.102 9c.257.703.39 1.438.398 2.203l1.7-2.953 3.023 5.25H22.5V3Z", fill: props.color || "currentColor" })));
|
|
9246
|
-
};
|
|
9247
|
-
|
|
9248
9227
|
var SvgShare2 = function (_a) {
|
|
9249
9228
|
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9250
9229
|
return (React$5.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: props.strokeWidth || 1.5, strokeLinecap: "round", strokeLinejoin: "round", className: "share-2_svg__feather share-2_svg__feather-share-2", "aria-labelledby": titleId }, props),
|
|
@@ -10472,7 +10451,6 @@ var Icon = /*#__PURE__*/Object.freeze({
|
|
|
10472
10451
|
Power: SvgPower,
|
|
10473
10452
|
Printer: SvgPrinter,
|
|
10474
10453
|
Process: SvgProcess,
|
|
10475
|
-
ProjectSetting: SvgProjectSetting,
|
|
10476
10454
|
QuoteRight: SvgQuoteRight,
|
|
10477
10455
|
Radio: SvgRadio,
|
|
10478
10456
|
RefreshCcw: SvgRefreshCcw,
|
|
@@ -10492,7 +10470,6 @@ var Icon = /*#__PURE__*/Object.freeze({
|
|
|
10492
10470
|
SendHorFill: SvgSendHorFill,
|
|
10493
10471
|
Server: SvgServer,
|
|
10494
10472
|
Settings: SvgSettings,
|
|
10495
|
-
ShapeGroup: SvgShapeGroup,
|
|
10496
10473
|
Share: SvgShare,
|
|
10497
10474
|
Share2: SvgShare2,
|
|
10498
10475
|
Share3: SvgShare3,
|
|
@@ -19807,17 +19784,20 @@ const isNullOrUndefined$1 = (d) => {
|
|
|
19807
19784
|
const generateUUID = () => {
|
|
19808
19785
|
// Public Domain/MIT
|
|
19809
19786
|
let d = new Date().getTime(); //Timestamp
|
|
19810
|
-
let d2 = (typeof performance !== 'undefined' &&
|
|
19787
|
+
let d2 = (typeof performance !== 'undefined' &&
|
|
19788
|
+
performance.now &&
|
|
19789
|
+
performance.now() * 1000) ||
|
|
19790
|
+
0; //Time in microseconds since page-load or 0 if unsupported
|
|
19811
19791
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
19812
19792
|
let r = Math.random() * 16; //random number between 0 and 16
|
|
19813
19793
|
if (d > 0) {
|
|
19814
19794
|
//Use timestamp until depleted
|
|
19815
|
-
r = (d + r) % 16 | 0;
|
|
19795
|
+
r = ((d + r) % 16) | 0;
|
|
19816
19796
|
d = Math.floor(d / 16);
|
|
19817
19797
|
}
|
|
19818
19798
|
else {
|
|
19819
19799
|
//Use microseconds since page-load if supported
|
|
19820
|
-
r = (d2 + r) % 16 | 0;
|
|
19800
|
+
r = ((d2 + r) % 16) | 0;
|
|
19821
19801
|
d2 = Math.floor(d2 / 16);
|
|
19822
19802
|
}
|
|
19823
19803
|
return (c === 'x' ? r : 0x3).toString(16);
|
|
@@ -19839,12 +19819,16 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2,
|
|
|
19839
19819
|
// eslint-disable-next-line
|
|
19840
19820
|
if (str || str == '0') {
|
|
19841
19821
|
str = str.toString();
|
|
19842
|
-
const value = decimalSeparator !== '.'
|
|
19822
|
+
const value = decimalSeparator !== '.'
|
|
19823
|
+
? str.toString().replaceAll('.', decimalSeparator ?? '')
|
|
19824
|
+
: str;
|
|
19843
19825
|
const arr = value.toString().split(decimalSeparator ?? '', 2);
|
|
19844
19826
|
let flag = value.toString().includes(decimalSeparator ?? '');
|
|
19845
19827
|
if (arr[0].length < 3) {
|
|
19846
19828
|
const intergerArr = haveNegative ? arr[0] : arr[0].replace('-', '');
|
|
19847
|
-
return flag
|
|
19829
|
+
return flag
|
|
19830
|
+
? `${intergerArr}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19831
|
+
: intergerArr;
|
|
19848
19832
|
}
|
|
19849
19833
|
else {
|
|
19850
19834
|
let flagNegative = false;
|
|
@@ -19868,7 +19852,9 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2,
|
|
|
19868
19852
|
if (flagNegative && haveNegative) {
|
|
19869
19853
|
arr[0] = '-'.concat(arr[0]);
|
|
19870
19854
|
}
|
|
19871
|
-
return flag
|
|
19855
|
+
return flag
|
|
19856
|
+
? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19857
|
+
: arr[0];
|
|
19872
19858
|
}
|
|
19873
19859
|
}
|
|
19874
19860
|
else {
|
|
@@ -19891,7 +19877,7 @@ const formatDateTime = (data, format = 'dd/MM/yyyy') => {
|
|
|
19891
19877
|
MM: String(date.getMonth() + 1).padStart(2, '0'),
|
|
19892
19878
|
yyyy: date.getFullYear(),
|
|
19893
19879
|
HH: String(date.getHours()).padStart(2, '0'),
|
|
19894
|
-
mm: String(date.getMinutes()).padStart(2, '0')
|
|
19880
|
+
mm: String(date.getMinutes()).padStart(2, '0'),
|
|
19895
19881
|
};
|
|
19896
19882
|
return format.replace(/dd|DD|MM|yyyy|HH|mm/g, (match) => map[match]);
|
|
19897
19883
|
};
|
|
@@ -19912,7 +19898,7 @@ const FindNodeByPath = (tree, path) => {
|
|
|
19912
19898
|
parent: current,
|
|
19913
19899
|
lastIndex: levels.at(-1),
|
|
19914
19900
|
firstIndex: levels.length === 1 ? levels[0] : -1,
|
|
19915
|
-
node
|
|
19901
|
+
node,
|
|
19916
19902
|
};
|
|
19917
19903
|
};
|
|
19918
19904
|
/**
|
|
@@ -19940,7 +19926,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19940
19926
|
const objHeaderWidthFixLeft = {};
|
|
19941
19927
|
let maxDepth = 0;
|
|
19942
19928
|
// Tính depth tối đa
|
|
19943
|
-
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) =>
|
|
19929
|
+
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) => col.columns?.length ? calculateDepth(col.columns, depth + 1) : depth));
|
|
19944
19930
|
maxDepth = calculateDepth(columns);
|
|
19945
19931
|
let leftTotal = 0;
|
|
19946
19932
|
let rightTotal = 0;
|
|
@@ -19978,7 +19964,8 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19978
19964
|
newCell.numericSettings = { fraction: setting.fraction };
|
|
19979
19965
|
}
|
|
19980
19966
|
}
|
|
19981
|
-
newCell.headerDisplay =
|
|
19967
|
+
newCell.headerDisplay =
|
|
19968
|
+
setting.headerText || (newCell.headerDisplay ?? newCell.headerText);
|
|
19982
19969
|
}
|
|
19983
19970
|
else {
|
|
19984
19971
|
if (newCell.columns?.length) {
|
|
@@ -20005,7 +19992,20 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20005
19992
|
levels[level] = levels[level] || [];
|
|
20006
19993
|
let columns = [...cols];
|
|
20007
19994
|
if (settingColumns?.some((c) => c.sortOrder !== undefined && c.sortOrder !== null)) {
|
|
20008
|
-
columns = columns.sort((a, b) =>
|
|
19995
|
+
columns = columns.sort((a, b) => {
|
|
19996
|
+
const aOrder = a.sortOrder ?? null;
|
|
19997
|
+
const bOrder = b.sortOrder ?? null;
|
|
19998
|
+
if (aOrder === null && bOrder === null) {
|
|
19999
|
+
return 0;
|
|
20000
|
+
}
|
|
20001
|
+
if (aOrder === null) {
|
|
20002
|
+
return 1;
|
|
20003
|
+
}
|
|
20004
|
+
if (bOrder === null) {
|
|
20005
|
+
return -1;
|
|
20006
|
+
}
|
|
20007
|
+
return aOrder - bOrder;
|
|
20008
|
+
});
|
|
20009
20009
|
}
|
|
20010
20010
|
return columns.reduce((colspanSum, col, indexCol) => {
|
|
20011
20011
|
const hasChildren = (col.columns?.length ?? 0) > 0;
|
|
@@ -20014,11 +20014,13 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20014
20014
|
...col,
|
|
20015
20015
|
columns: col.columns ?? [],
|
|
20016
20016
|
colspan,
|
|
20017
|
-
rowspan: hasChildren ? 1 : maxDepth - level
|
|
20017
|
+
rowspan: hasChildren ? 1 : maxDepth - level,
|
|
20018
20018
|
};
|
|
20019
20019
|
levels[level].push(cell);
|
|
20020
20020
|
const headerKey = `${level}-${indexCol}`;
|
|
20021
|
-
if (cell.fixedType === 'left' &&
|
|
20021
|
+
if (cell.fixedType === 'left' &&
|
|
20022
|
+
cell.visible !== false &&
|
|
20023
|
+
cell.isGroup !== true) {
|
|
20022
20024
|
objHeaderWidthFixLeft[headerKey] = leftTotal;
|
|
20023
20025
|
}
|
|
20024
20026
|
if (!hasChildren) {
|
|
@@ -20026,16 +20028,22 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20026
20028
|
const width = cell.width ?? 40;
|
|
20027
20029
|
cell.index = index;
|
|
20028
20030
|
flat.push(cell);
|
|
20029
|
-
if (cell.fixedType === 'left' &&
|
|
20031
|
+
if (cell.fixedType === 'left' &&
|
|
20032
|
+
cell.visible !== false &&
|
|
20033
|
+
cell.isGroup !== true) {
|
|
20030
20034
|
objWidthFixLeft[index] = leftTotal;
|
|
20031
20035
|
leftTotal += width;
|
|
20032
20036
|
}
|
|
20033
|
-
if (cell.fixedType === 'right' &&
|
|
20037
|
+
if (cell.fixedType === 'right' &&
|
|
20038
|
+
cell.visible !== false &&
|
|
20039
|
+
cell.isGroup !== true) {
|
|
20034
20040
|
rightTotal -= width;
|
|
20035
20041
|
objWidthFixRight[index] = rightTotal;
|
|
20036
20042
|
}
|
|
20037
20043
|
}
|
|
20038
|
-
if (cell.fixedType === 'right' &&
|
|
20044
|
+
if (cell.fixedType === 'right' &&
|
|
20045
|
+
cell.visible !== false &&
|
|
20046
|
+
cell.isGroup !== true) {
|
|
20039
20047
|
objHeaderWidthFixRight[headerKey] = rightTotal;
|
|
20040
20048
|
}
|
|
20041
20049
|
return colspanSum + colspan;
|
|
@@ -20046,13 +20054,20 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20046
20054
|
traverse(newColumns);
|
|
20047
20055
|
// Danh sách các cột được hiển thị
|
|
20048
20056
|
// const flatVisble = flat.filter((e) => e.visible !== false)
|
|
20049
|
-
const flatVisbleContent = flat.filter((x) => x.visible !== false &&
|
|
20057
|
+
const flatVisbleContent = flat.filter((x) => x.visible !== false &&
|
|
20058
|
+
x.field !== 'command' &&
|
|
20059
|
+
x.field !== '#' &&
|
|
20060
|
+
x.field !== 'checkbox');
|
|
20050
20061
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột cố định
|
|
20051
20062
|
const lastObjWidthFixLeft = Math.max(...Object.keys(objWidthFixLeft).map(Number), 0);
|
|
20052
20063
|
const fisrtObjWidthFixRight = Math.min(...Object.keys(objWidthFixRight).map(Number), flat.length);
|
|
20053
20064
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột có thể sửa
|
|
20054
20065
|
const indexFirstEdit = flat.findIndex((item) => item.editEnable && item.visible !== false && !item.disabledCondition);
|
|
20055
|
-
const indexLastEdit = flat
|
|
20066
|
+
const indexLastEdit = flat
|
|
20067
|
+
.map((item, idx) => item.editEnable && item.visible !== false && !item.disabledCondition
|
|
20068
|
+
? idx
|
|
20069
|
+
: -1)
|
|
20070
|
+
.reduce((acc, val) => (val > acc ? val : acc), -1);
|
|
20056
20071
|
return {
|
|
20057
20072
|
levels,
|
|
20058
20073
|
flat,
|
|
@@ -20065,7 +20080,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20065
20080
|
objHeaderWidthFixRight,
|
|
20066
20081
|
objHeaderWidthFixLeft,
|
|
20067
20082
|
indexFirstEdit,
|
|
20068
|
-
indexLastEdit
|
|
20083
|
+
indexLastEdit,
|
|
20069
20084
|
};
|
|
20070
20085
|
};
|
|
20071
20086
|
/**
|
|
@@ -20075,7 +20090,10 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20075
20090
|
const isFilterMatch = filters.every((filter) => {
|
|
20076
20091
|
const { key, value, ope } = filter;
|
|
20077
20092
|
const rowValue = row[key];
|
|
20078
|
-
if (rowValue === undefined ||
|
|
20093
|
+
if (rowValue === undefined ||
|
|
20094
|
+
rowValue === null ||
|
|
20095
|
+
value === undefined ||
|
|
20096
|
+
value === null) {
|
|
20079
20097
|
return false;
|
|
20080
20098
|
}
|
|
20081
20099
|
const valStr = String(rowValue).toLowerCase();
|
|
@@ -20108,7 +20126,10 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20108
20126
|
const isSearchMatch = !keyword ||
|
|
20109
20127
|
searchKeys.some((key) => {
|
|
20110
20128
|
const val = row[key];
|
|
20111
|
-
return val
|
|
20129
|
+
return val
|
|
20130
|
+
?.toString()
|
|
20131
|
+
.toLowerCase()
|
|
20132
|
+
.includes(keyword.trim().toLowerCase());
|
|
20112
20133
|
});
|
|
20113
20134
|
return isFilterMatch && isSearchMatch;
|
|
20114
20135
|
};
|
|
@@ -25593,72 +25614,6 @@ function startOfYear(date, options) {
|
|
|
25593
25614
|
return date_;
|
|
25594
25615
|
}
|
|
25595
25616
|
|
|
25596
|
-
/**
|
|
25597
|
-
* The {@link eachYearOfInterval} function options.
|
|
25598
|
-
*/
|
|
25599
|
-
|
|
25600
|
-
/**
|
|
25601
|
-
* The {@link eachYearOfInterval} function result type. It resolves the proper data type.
|
|
25602
|
-
* It uses the first argument date object type, starting from the date argument,
|
|
25603
|
-
* then the start interval date, and finally the end interval date. If
|
|
25604
|
-
* a context function is passed, it uses the context function return type.
|
|
25605
|
-
*/
|
|
25606
|
-
|
|
25607
|
-
/**
|
|
25608
|
-
* @name eachYearOfInterval
|
|
25609
|
-
* @category Interval Helpers
|
|
25610
|
-
* @summary Return the array of yearly timestamps within the specified time interval.
|
|
25611
|
-
*
|
|
25612
|
-
* @description
|
|
25613
|
-
* Return the array of yearly timestamps within the specified time interval.
|
|
25614
|
-
*
|
|
25615
|
-
* @typeParam IntervalType - Interval type.
|
|
25616
|
-
* @typeParam Options - Options type.
|
|
25617
|
-
*
|
|
25618
|
-
* @param interval - The interval.
|
|
25619
|
-
* @param options - An object with options.
|
|
25620
|
-
*
|
|
25621
|
-
* @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
|
|
25622
|
-
*
|
|
25623
|
-
* @example
|
|
25624
|
-
* // Each year between 6 February 2014 and 10 August 2017:
|
|
25625
|
-
* const result = eachYearOfInterval({
|
|
25626
|
-
* start: new Date(2014, 1, 6),
|
|
25627
|
-
* end: new Date(2017, 7, 10)
|
|
25628
|
-
* })
|
|
25629
|
-
* //=> [
|
|
25630
|
-
* // Wed Jan 01 2014 00:00:00,
|
|
25631
|
-
* // Thu Jan 01 2015 00:00:00,
|
|
25632
|
-
* // Fri Jan 01 2016 00:00:00,
|
|
25633
|
-
* // Sun Jan 01 2017 00:00:00
|
|
25634
|
-
* // ]
|
|
25635
|
-
*/
|
|
25636
|
-
function eachYearOfInterval(interval, options) {
|
|
25637
|
-
const { start, end } = normalizeInterval(options?.in, interval);
|
|
25638
|
-
|
|
25639
|
-
let reversed = +start > +end;
|
|
25640
|
-
const endTime = reversed ? +start : +end;
|
|
25641
|
-
const date = reversed ? end : start;
|
|
25642
|
-
date.setHours(0, 0, 0, 0);
|
|
25643
|
-
date.setMonth(0, 1);
|
|
25644
|
-
|
|
25645
|
-
let step = options?.step ?? 1;
|
|
25646
|
-
if (!step) return [];
|
|
25647
|
-
if (step < 0) {
|
|
25648
|
-
step = -step;
|
|
25649
|
-
reversed = !reversed;
|
|
25650
|
-
}
|
|
25651
|
-
|
|
25652
|
-
const dates = [];
|
|
25653
|
-
|
|
25654
|
-
while (+date <= endTime) {
|
|
25655
|
-
dates.push(constructFrom(start, date));
|
|
25656
|
-
date.setFullYear(date.getFullYear() + step);
|
|
25657
|
-
}
|
|
25658
|
-
|
|
25659
|
-
return reversed ? dates.reverse() : dates;
|
|
25660
|
-
}
|
|
25661
|
-
|
|
25662
25617
|
/**
|
|
25663
25618
|
* The {@link endOfWeek} function options.
|
|
25664
25619
|
*/
|
|
@@ -26367,7 +26322,7 @@ const match = {
|
|
|
26367
26322
|
* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
|
|
26368
26323
|
* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
|
|
26369
26324
|
*/
|
|
26370
|
-
const enUS
|
|
26325
|
+
const enUS = {
|
|
26371
26326
|
code: "en-US",
|
|
26372
26327
|
formatDistance: formatDistance,
|
|
26373
26328
|
formatLong: formatLong,
|
|
@@ -27884,7 +27839,7 @@ const unescapedLatinCharacterRegExp$1 = /[a-zA-Z]/;
|
|
|
27884
27839
|
*/
|
|
27885
27840
|
function format(date, formatStr, options) {
|
|
27886
27841
|
const defaultOptions = getDefaultOptions$1();
|
|
27887
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS
|
|
27842
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
27888
27843
|
|
|
27889
27844
|
const firstWeekContainsDate =
|
|
27890
27845
|
options?.firstWeekContainsDate ??
|
|
@@ -30577,7 +30532,7 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
30577
30532
|
function parse(dateStr, formatStr, referenceDate, options) {
|
|
30578
30533
|
const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);
|
|
30579
30534
|
const defaultOptions = getDefaultOptions();
|
|
30580
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS
|
|
30535
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
30581
30536
|
|
|
30582
30537
|
const firstWeekContainsDate =
|
|
30583
30538
|
options?.firstWeekContainsDate ??
|
|
@@ -31383,69 +31338,6 @@ function endOfBroadcastWeek(date, dateLib) {
|
|
|
31383
31338
|
return endDate;
|
|
31384
31339
|
}
|
|
31385
31340
|
|
|
31386
|
-
/** English (United States) locale extended with DayPicker-specific translations. */
|
|
31387
|
-
const enUS = {
|
|
31388
|
-
...enUS$1,
|
|
31389
|
-
labels: {
|
|
31390
|
-
labelDayButton: (date, modifiers, options, dateLib) => {
|
|
31391
|
-
let formatDate;
|
|
31392
|
-
if (dateLib && typeof dateLib.format === "function") {
|
|
31393
|
-
formatDate = dateLib.format.bind(dateLib);
|
|
31394
|
-
}
|
|
31395
|
-
else {
|
|
31396
|
-
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31397
|
-
}
|
|
31398
|
-
let label = formatDate(date, "PPPP");
|
|
31399
|
-
if (modifiers.today)
|
|
31400
|
-
label = `Today, ${label}`;
|
|
31401
|
-
if (modifiers.selected)
|
|
31402
|
-
label = `${label}, selected`;
|
|
31403
|
-
return label;
|
|
31404
|
-
},
|
|
31405
|
-
labelMonthDropdown: "Choose the Month",
|
|
31406
|
-
labelNext: "Go to the Next Month",
|
|
31407
|
-
labelPrevious: "Go to the Previous Month",
|
|
31408
|
-
labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
|
|
31409
|
-
labelYearDropdown: "Choose the Year",
|
|
31410
|
-
labelGrid: (date, options, dateLib) => {
|
|
31411
|
-
let formatDate;
|
|
31412
|
-
if (dateLib && typeof dateLib.format === "function") {
|
|
31413
|
-
formatDate = dateLib.format.bind(dateLib);
|
|
31414
|
-
}
|
|
31415
|
-
else {
|
|
31416
|
-
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31417
|
-
}
|
|
31418
|
-
return formatDate(date, "LLLL yyyy");
|
|
31419
|
-
},
|
|
31420
|
-
labelGridcell: (date, modifiers, options, dateLib) => {
|
|
31421
|
-
let formatDate;
|
|
31422
|
-
if (dateLib && typeof dateLib.format === "function") {
|
|
31423
|
-
formatDate = dateLib.format.bind(dateLib);
|
|
31424
|
-
}
|
|
31425
|
-
else {
|
|
31426
|
-
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31427
|
-
}
|
|
31428
|
-
let label = formatDate(date, "PPPP");
|
|
31429
|
-
if (modifiers?.today) {
|
|
31430
|
-
label = `Today, ${label}`;
|
|
31431
|
-
}
|
|
31432
|
-
return label;
|
|
31433
|
-
},
|
|
31434
|
-
labelNav: "Navigation bar",
|
|
31435
|
-
labelWeekNumberHeader: "Week Number",
|
|
31436
|
-
labelWeekday: (date, options, dateLib) => {
|
|
31437
|
-
let formatDate;
|
|
31438
|
-
if (dateLib && typeof dateLib.format === "function") {
|
|
31439
|
-
formatDate = dateLib.format.bind(dateLib);
|
|
31440
|
-
}
|
|
31441
|
-
else {
|
|
31442
|
-
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31443
|
-
}
|
|
31444
|
-
return formatDate(date, "cccc");
|
|
31445
|
-
},
|
|
31446
|
-
},
|
|
31447
|
-
};
|
|
31448
|
-
|
|
31449
31341
|
/**
|
|
31450
31342
|
* A wrapper class around [date-fns](http://date-fns.org) that provides utility
|
|
31451
31343
|
* methods for date manipulation and formatting.
|
|
@@ -31584,31 +31476,6 @@ class DateLib {
|
|
|
31584
31476
|
? this.overrides.eachMonthOfInterval(interval)
|
|
31585
31477
|
: eachMonthOfInterval(interval);
|
|
31586
31478
|
};
|
|
31587
|
-
/**
|
|
31588
|
-
* Returns the years between the given dates.
|
|
31589
|
-
*
|
|
31590
|
-
* @since 9.11.1
|
|
31591
|
-
* @param interval The interval to get the years for.
|
|
31592
|
-
* @returns The array of years in the interval.
|
|
31593
|
-
*/
|
|
31594
|
-
this.eachYearOfInterval = (interval) => {
|
|
31595
|
-
const years = this.overrides?.eachYearOfInterval
|
|
31596
|
-
? this.overrides.eachYearOfInterval(interval)
|
|
31597
|
-
: eachYearOfInterval(interval);
|
|
31598
|
-
// Remove duplicates that may happen across DST transitions (e.g., "America/Sao_Paulo")
|
|
31599
|
-
// See https://github.com/date-fns/tz/issues/72
|
|
31600
|
-
const uniqueYears = new Set(years.map((d) => this.getYear(d)));
|
|
31601
|
-
if (uniqueYears.size === years.length) {
|
|
31602
|
-
// No duplicates, return as is
|
|
31603
|
-
return years;
|
|
31604
|
-
}
|
|
31605
|
-
// Rebuild the array to ensure one date per year
|
|
31606
|
-
const yearsArray = [];
|
|
31607
|
-
uniqueYears.forEach((y) => {
|
|
31608
|
-
yearsArray.push(new Date(y, 0, 1));
|
|
31609
|
-
});
|
|
31610
|
-
return yearsArray;
|
|
31611
|
-
};
|
|
31612
31479
|
/**
|
|
31613
31480
|
* Returns the end of the broadcast week for the given date.
|
|
31614
31481
|
*
|
|
@@ -31947,63 +31814,7 @@ class DateLib {
|
|
|
31947
31814
|
formatNumber(value) {
|
|
31948
31815
|
return this.replaceDigits(value.toString());
|
|
31949
31816
|
}
|
|
31950
|
-
|
|
31951
|
-
* Returns the preferred ordering for month and year labels for the current
|
|
31952
|
-
* locale.
|
|
31953
|
-
*/
|
|
31954
|
-
getMonthYearOrder() {
|
|
31955
|
-
const code = this.options.locale?.code;
|
|
31956
|
-
if (!code) {
|
|
31957
|
-
return "month-first";
|
|
31958
|
-
}
|
|
31959
|
-
return DateLib.yearFirstLocales.has(code) ? "year-first" : "month-first";
|
|
31960
|
-
}
|
|
31961
|
-
/**
|
|
31962
|
-
* Formats the month/year pair respecting locale conventions.
|
|
31963
|
-
*
|
|
31964
|
-
* @since 9.11.0
|
|
31965
|
-
*/
|
|
31966
|
-
formatMonthYear(date) {
|
|
31967
|
-
const { locale, timeZone, numerals } = this.options;
|
|
31968
|
-
const localeCode = locale?.code;
|
|
31969
|
-
if (localeCode && DateLib.yearFirstLocales.has(localeCode)) {
|
|
31970
|
-
try {
|
|
31971
|
-
const intl = new Intl.DateTimeFormat(localeCode, {
|
|
31972
|
-
month: "long",
|
|
31973
|
-
year: "numeric",
|
|
31974
|
-
timeZone,
|
|
31975
|
-
numberingSystem: numerals,
|
|
31976
|
-
});
|
|
31977
|
-
const formatted = intl.format(date);
|
|
31978
|
-
return formatted;
|
|
31979
|
-
}
|
|
31980
|
-
catch {
|
|
31981
|
-
// Fallback to date-fns formatting below.
|
|
31982
|
-
}
|
|
31983
|
-
}
|
|
31984
|
-
const pattern = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
31985
|
-
return this.format(date, pattern);
|
|
31986
|
-
}
|
|
31987
|
-
}
|
|
31988
|
-
DateLib.yearFirstLocales = new Set([
|
|
31989
|
-
"eu",
|
|
31990
|
-
"hu",
|
|
31991
|
-
"ja",
|
|
31992
|
-
"ja-Hira",
|
|
31993
|
-
"ja-JP",
|
|
31994
|
-
"ko",
|
|
31995
|
-
"ko-KR",
|
|
31996
|
-
"lt",
|
|
31997
|
-
"lt-LT",
|
|
31998
|
-
"lv",
|
|
31999
|
-
"lv-LV",
|
|
32000
|
-
"mn",
|
|
32001
|
-
"mn-MN",
|
|
32002
|
-
"zh",
|
|
32003
|
-
"zh-CN",
|
|
32004
|
-
"zh-HK",
|
|
32005
|
-
"zh-TW",
|
|
32006
|
-
]);
|
|
31817
|
+
}
|
|
32007
31818
|
/**
|
|
32008
31819
|
* The default date library with English locale.
|
|
32009
31820
|
*
|
|
@@ -32024,9 +31835,6 @@ class CalendarDay {
|
|
|
32024
31835
|
this.displayMonth = displayMonth;
|
|
32025
31836
|
this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
|
|
32026
31837
|
this.dateLib = dateLib;
|
|
32027
|
-
this.isoDate = dateLib.format(date, "yyyy-MM-dd");
|
|
32028
|
-
this.displayMonthId = dateLib.format(displayMonth, "yyyy-MM");
|
|
32029
|
-
this.dateMonthId = dateLib.format(date, "yyyy-MM");
|
|
32030
31838
|
}
|
|
32031
31839
|
/**
|
|
32032
31840
|
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
@@ -32202,7 +32010,7 @@ var UI;
|
|
|
32202
32010
|
/** The dropdown with the years. */
|
|
32203
32011
|
UI["YearsDropdown"] = "years_dropdown";
|
|
32204
32012
|
})(UI || (UI = {}));
|
|
32205
|
-
/** Enum representing flags for the {@link UI
|
|
32013
|
+
/** Enum representing flags for the {@link UI.Day} element. */
|
|
32206
32014
|
var DayFlag;
|
|
32207
32015
|
(function (DayFlag) {
|
|
32208
32016
|
/** The day is disabled. */
|
|
@@ -32217,8 +32025,8 @@ var DayFlag;
|
|
|
32217
32025
|
DayFlag["today"] = "today";
|
|
32218
32026
|
})(DayFlag || (DayFlag = {}));
|
|
32219
32027
|
/**
|
|
32220
|
-
* Enum representing selection states that can be applied to the
|
|
32221
|
-
*
|
|
32028
|
+
* Enum representing selection states that can be applied to the {@link UI.Day}
|
|
32029
|
+
* element in selection mode.
|
|
32222
32030
|
*/
|
|
32223
32031
|
var SelectionState;
|
|
32224
32032
|
(function (SelectionState) {
|
|
@@ -32668,7 +32476,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32668
32476
|
return isSameDay(date, matcher);
|
|
32669
32477
|
}
|
|
32670
32478
|
if (isDatesArray(matcher, dateLib)) {
|
|
32671
|
-
return matcher.
|
|
32479
|
+
return matcher.includes(date);
|
|
32672
32480
|
}
|
|
32673
32481
|
if (isDateRange(matcher)) {
|
|
32674
32482
|
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
@@ -32719,7 +32527,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32719
32527
|
* @returns A function that retrieves the modifiers for a given `CalendarDay`.
|
|
32720
32528
|
*/
|
|
32721
32529
|
function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
32722
|
-
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today
|
|
32530
|
+
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today, } = props;
|
|
32723
32531
|
const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter, } = dateLib;
|
|
32724
32532
|
const computedNavStart = navStart && startOfMonth(navStart);
|
|
32725
32533
|
const computedNavEnd = navEnd && endOfMonth(navEnd);
|
|
@@ -32743,7 +32551,7 @@ function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
|
32743
32551
|
// Broadcast calendar will show outside days as default
|
|
32744
32552
|
(!broadcastCalendar && !showOutsideDays && isOutside) ||
|
|
32745
32553
|
(broadcastCalendar && showOutsideDays === false && isOutside);
|
|
32746
|
-
const isToday = isSameDay(date, today);
|
|
32554
|
+
const isToday = isSameDay(date, today ?? dateLib.today());
|
|
32747
32555
|
if (isOutside)
|
|
32748
32556
|
internalModifiersMap.outside.push(day);
|
|
32749
32557
|
if (isDisabled)
|
|
@@ -32902,7 +32710,7 @@ function getDefaultClassNames() {
|
|
|
32902
32710
|
/**
|
|
32903
32711
|
* Formats the caption of the month.
|
|
32904
32712
|
*
|
|
32905
|
-
* @defaultValue
|
|
32713
|
+
* @defaultValue `LLLL y` (e.g., "November 2022").
|
|
32906
32714
|
* @param month The date representing the month.
|
|
32907
32715
|
* @param options Configuration options for the date library.
|
|
32908
32716
|
* @param dateLib The date library to use for formatting. If not provided, a new
|
|
@@ -32912,8 +32720,7 @@ function getDefaultClassNames() {
|
|
|
32912
32720
|
* @see https://daypicker.dev/docs/translation#custom-formatters
|
|
32913
32721
|
*/
|
|
32914
32722
|
function formatCaption(month, options, dateLib) {
|
|
32915
|
-
|
|
32916
|
-
return lib.formatMonthYear(month);
|
|
32723
|
+
return (dateLib ?? new DateLib(options)).format(month, "LLLL y");
|
|
32917
32724
|
}
|
|
32918
32725
|
/**
|
|
32919
32726
|
* @private
|
|
@@ -33053,6 +32860,127 @@ function getFormatters(customFormatters) {
|
|
|
33053
32860
|
};
|
|
33054
32861
|
}
|
|
33055
32862
|
|
|
32863
|
+
/**
|
|
32864
|
+
* Returns the months to show in the dropdown.
|
|
32865
|
+
*
|
|
32866
|
+
* This function generates a list of months for the current year, formatted
|
|
32867
|
+
* using the provided formatter, and determines whether each month should be
|
|
32868
|
+
* disabled based on the navigation range.
|
|
32869
|
+
*
|
|
32870
|
+
* @param displayMonth The currently displayed month.
|
|
32871
|
+
* @param navStart The start date for navigation.
|
|
32872
|
+
* @param navEnd The end date for navigation.
|
|
32873
|
+
* @param formatters The formatters to use for formatting the month labels.
|
|
32874
|
+
* @param dateLib The date library to use for date manipulation.
|
|
32875
|
+
* @returns An array of dropdown options representing the months, or `undefined`
|
|
32876
|
+
* if no months are available.
|
|
32877
|
+
*/
|
|
32878
|
+
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
32879
|
+
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
32880
|
+
const months = eachMonthOfInterval({
|
|
32881
|
+
start: startOfYear(displayMonth),
|
|
32882
|
+
end: endOfYear(displayMonth),
|
|
32883
|
+
});
|
|
32884
|
+
const options = months.map((month) => {
|
|
32885
|
+
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
32886
|
+
const value = getMonth(month);
|
|
32887
|
+
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
32888
|
+
(navEnd && month > startOfMonth(navEnd)) ||
|
|
32889
|
+
false;
|
|
32890
|
+
return { value, label, disabled };
|
|
32891
|
+
});
|
|
32892
|
+
return options;
|
|
32893
|
+
}
|
|
32894
|
+
|
|
32895
|
+
/**
|
|
32896
|
+
* Returns the computed style for a day based on its modifiers.
|
|
32897
|
+
*
|
|
32898
|
+
* This function merges the base styles for the day with any styles associated
|
|
32899
|
+
* with active modifiers.
|
|
32900
|
+
*
|
|
32901
|
+
* @param dayModifiers The modifiers applied to the day.
|
|
32902
|
+
* @param styles The base styles for the calendar elements.
|
|
32903
|
+
* @param modifiersStyles The styles associated with specific modifiers.
|
|
32904
|
+
* @returns The computed style for the day.
|
|
32905
|
+
*/
|
|
32906
|
+
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
32907
|
+
let style = { ...styles?.[UI.Day] };
|
|
32908
|
+
Object.entries(dayModifiers)
|
|
32909
|
+
.filter(([, active]) => active === true)
|
|
32910
|
+
.forEach(([modifier]) => {
|
|
32911
|
+
style = {
|
|
32912
|
+
...style,
|
|
32913
|
+
...modifiersStyles?.[modifier],
|
|
32914
|
+
};
|
|
32915
|
+
});
|
|
32916
|
+
return style;
|
|
32917
|
+
}
|
|
32918
|
+
|
|
32919
|
+
/**
|
|
32920
|
+
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
32921
|
+
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
32922
|
+
*
|
|
32923
|
+
* @param dateLib The date library to use for date manipulation.
|
|
32924
|
+
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
32925
|
+
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
32926
|
+
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
32927
|
+
* @returns An array of 7 dates representing the weekdays.
|
|
32928
|
+
*/
|
|
32929
|
+
function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {
|
|
32930
|
+
const today = dateLib.today();
|
|
32931
|
+
const start = broadcastCalendar
|
|
32932
|
+
? dateLib.startOfBroadcastWeek(today, dateLib)
|
|
32933
|
+
: ISOWeek
|
|
32934
|
+
? dateLib.startOfISOWeek(today)
|
|
32935
|
+
: dateLib.startOfWeek(today);
|
|
32936
|
+
const days = [];
|
|
32937
|
+
for (let i = 0; i < 7; i++) {
|
|
32938
|
+
const day = dateLib.addDays(start, i);
|
|
32939
|
+
days.push(day);
|
|
32940
|
+
}
|
|
32941
|
+
return days;
|
|
32942
|
+
}
|
|
32943
|
+
|
|
32944
|
+
/**
|
|
32945
|
+
* Returns the years to display in the dropdown.
|
|
32946
|
+
*
|
|
32947
|
+
* This function generates a list of years between the navigation start and end
|
|
32948
|
+
* dates, formatted using the provided formatter.
|
|
32949
|
+
*
|
|
32950
|
+
* @param navStart The start date for navigation.
|
|
32951
|
+
* @param navEnd The end date for navigation.
|
|
32952
|
+
* @param formatters The formatters to use for formatting the year labels.
|
|
32953
|
+
* @param dateLib The date library to use for date manipulation.
|
|
32954
|
+
* @param reverse If true, reverses the order of the years (descending).
|
|
32955
|
+
* @returns An array of dropdown options representing the years, or `undefined`
|
|
32956
|
+
* if `navStart` or `navEnd` is not provided.
|
|
32957
|
+
*/
|
|
32958
|
+
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
32959
|
+
if (!navStart)
|
|
32960
|
+
return undefined;
|
|
32961
|
+
if (!navEnd)
|
|
32962
|
+
return undefined;
|
|
32963
|
+
const { startOfYear, endOfYear, addYears, getYear, isBefore, isSameYear } = dateLib;
|
|
32964
|
+
const firstNavYear = startOfYear(navStart);
|
|
32965
|
+
const lastNavYear = endOfYear(navEnd);
|
|
32966
|
+
const years = [];
|
|
32967
|
+
let year = firstNavYear;
|
|
32968
|
+
while (isBefore(year, lastNavYear) || isSameYear(year, lastNavYear)) {
|
|
32969
|
+
years.push(year);
|
|
32970
|
+
year = addYears(year, 1);
|
|
32971
|
+
}
|
|
32972
|
+
if (reverse)
|
|
32973
|
+
years.reverse();
|
|
32974
|
+
return years.map((year) => {
|
|
32975
|
+
const label = formatters.formatYearDropdown(year, dateLib);
|
|
32976
|
+
return {
|
|
32977
|
+
value: getYear(year),
|
|
32978
|
+
label,
|
|
32979
|
+
disabled: false,
|
|
32980
|
+
};
|
|
32981
|
+
});
|
|
32982
|
+
}
|
|
32983
|
+
|
|
33056
32984
|
/**
|
|
33057
32985
|
* Generates the ARIA label for a day button.
|
|
33058
32986
|
*
|
|
@@ -33086,7 +33014,7 @@ const labelDay = labelDayButton;
|
|
|
33086
33014
|
* Generates the ARIA label for the month grid, which is announced when entering
|
|
33087
33015
|
* the grid.
|
|
33088
33016
|
*
|
|
33089
|
-
* @defaultValue
|
|
33017
|
+
* @defaultValue `LLLL y` (e.g., "November 2022").
|
|
33090
33018
|
* @param date - The date representing the month.
|
|
33091
33019
|
* @param options - Optional configuration for the date formatting library.
|
|
33092
33020
|
* @param dateLib - An optional instance of the date formatting library.
|
|
@@ -33095,8 +33023,7 @@ const labelDay = labelDayButton;
|
|
|
33095
33023
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
33096
33024
|
*/
|
|
33097
33025
|
function labelGrid(date, options, dateLib) {
|
|
33098
|
-
|
|
33099
|
-
return lib.formatMonthYear(date);
|
|
33026
|
+
return (dateLib ?? new DateLib(options)).format(date, "LLLL y");
|
|
33100
33027
|
}
|
|
33101
33028
|
/**
|
|
33102
33029
|
* @ignore
|
|
@@ -33148,7 +33075,6 @@ function labelNav() {
|
|
|
33148
33075
|
return "";
|
|
33149
33076
|
}
|
|
33150
33077
|
|
|
33151
|
-
const defaultLabel = "Go to the Next Month";
|
|
33152
33078
|
/**
|
|
33153
33079
|
* Generates the ARIA label for the "next month" button.
|
|
33154
33080
|
*
|
|
@@ -33159,8 +33085,8 @@ const defaultLabel = "Go to the Next Month";
|
|
|
33159
33085
|
* @group Labels
|
|
33160
33086
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
33161
33087
|
*/
|
|
33162
|
-
function labelNext(_month
|
|
33163
|
-
return
|
|
33088
|
+
function labelNext(_month) {
|
|
33089
|
+
return "Go to the Next Month";
|
|
33164
33090
|
}
|
|
33165
33091
|
|
|
33166
33092
|
/**
|
|
@@ -33249,316 +33175,6 @@ var defaultLabels = /*#__PURE__*/Object.freeze({
|
|
|
33249
33175
|
labelYearDropdown: labelYearDropdown
|
|
33250
33176
|
});
|
|
33251
33177
|
|
|
33252
|
-
const resolveLabel = (defaultLabel, customLabel, localeLabel) => {
|
|
33253
|
-
if (customLabel)
|
|
33254
|
-
return customLabel;
|
|
33255
|
-
if (localeLabel) {
|
|
33256
|
-
return (typeof localeLabel === "function"
|
|
33257
|
-
? localeLabel
|
|
33258
|
-
: (..._args) => localeLabel);
|
|
33259
|
-
}
|
|
33260
|
-
return defaultLabel;
|
|
33261
|
-
};
|
|
33262
|
-
/**
|
|
33263
|
-
* Merges custom labels from the props with the default labels.
|
|
33264
|
-
*
|
|
33265
|
-
* When available, uses the locale-provided translation for `labelNext`.
|
|
33266
|
-
*
|
|
33267
|
-
* @param customLabels The custom labels provided in the DayPicker props.
|
|
33268
|
-
* @param options Options from the date library, used to resolve locale
|
|
33269
|
-
* translations.
|
|
33270
|
-
* @returns The merged labels object with locale-aware defaults.
|
|
33271
|
-
*/
|
|
33272
|
-
function getLabels(customLabels, options) {
|
|
33273
|
-
const localeLabels = options.locale?.labels ?? {};
|
|
33274
|
-
return {
|
|
33275
|
-
...defaultLabels,
|
|
33276
|
-
...(customLabels ?? {}),
|
|
33277
|
-
labelDayButton: resolveLabel(labelDayButton, customLabels?.labelDayButton, localeLabels.labelDayButton),
|
|
33278
|
-
labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels?.labelMonthDropdown, localeLabels.labelMonthDropdown),
|
|
33279
|
-
labelNext: resolveLabel(labelNext, customLabels?.labelNext, localeLabels.labelNext),
|
|
33280
|
-
labelPrevious: resolveLabel(labelPrevious, customLabels?.labelPrevious, localeLabels.labelPrevious),
|
|
33281
|
-
labelWeekNumber: resolveLabel(labelWeekNumber, customLabels?.labelWeekNumber, localeLabels.labelWeekNumber),
|
|
33282
|
-
labelYearDropdown: resolveLabel(labelYearDropdown, customLabels?.labelYearDropdown, localeLabels.labelYearDropdown),
|
|
33283
|
-
labelGrid: resolveLabel(labelGrid, customLabels?.labelGrid, localeLabels.labelGrid),
|
|
33284
|
-
labelGridcell: resolveLabel(labelGridcell, customLabels?.labelGridcell, localeLabels.labelGridcell),
|
|
33285
|
-
labelNav: resolveLabel(labelNav, customLabels?.labelNav, localeLabels.labelNav),
|
|
33286
|
-
labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels?.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
|
|
33287
|
-
labelWeekday: resolveLabel(labelWeekday, customLabels?.labelWeekday, localeLabels.labelWeekday),
|
|
33288
|
-
};
|
|
33289
|
-
}
|
|
33290
|
-
|
|
33291
|
-
/**
|
|
33292
|
-
* Returns the months to show in the dropdown.
|
|
33293
|
-
*
|
|
33294
|
-
* This function generates a list of months for the current year, formatted
|
|
33295
|
-
* using the provided formatter, and determines whether each month should be
|
|
33296
|
-
* disabled based on the navigation range.
|
|
33297
|
-
*
|
|
33298
|
-
* @param displayMonth The currently displayed month.
|
|
33299
|
-
* @param navStart The start date for navigation.
|
|
33300
|
-
* @param navEnd The end date for navigation.
|
|
33301
|
-
* @param formatters The formatters to use for formatting the month labels.
|
|
33302
|
-
* @param dateLib The date library to use for date manipulation.
|
|
33303
|
-
* @returns An array of dropdown options representing the months, or `undefined`
|
|
33304
|
-
* if no months are available.
|
|
33305
|
-
*/
|
|
33306
|
-
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
33307
|
-
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
33308
|
-
const months = eachMonthOfInterval({
|
|
33309
|
-
start: startOfYear(displayMonth),
|
|
33310
|
-
end: endOfYear(displayMonth),
|
|
33311
|
-
});
|
|
33312
|
-
const options = months.map((month) => {
|
|
33313
|
-
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
33314
|
-
const value = getMonth(month);
|
|
33315
|
-
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
33316
|
-
(navEnd && month > startOfMonth(navEnd)) ||
|
|
33317
|
-
false;
|
|
33318
|
-
return { value, label, disabled };
|
|
33319
|
-
});
|
|
33320
|
-
return options;
|
|
33321
|
-
}
|
|
33322
|
-
|
|
33323
|
-
/**
|
|
33324
|
-
* Returns the computed style for a day based on its modifiers.
|
|
33325
|
-
*
|
|
33326
|
-
* This function merges the base styles for the day with any styles associated
|
|
33327
|
-
* with active modifiers.
|
|
33328
|
-
*
|
|
33329
|
-
* @param dayModifiers The modifiers applied to the day.
|
|
33330
|
-
* @param styles The base styles for the calendar elements.
|
|
33331
|
-
* @param modifiersStyles The styles associated with specific modifiers.
|
|
33332
|
-
* @returns The computed style for the day.
|
|
33333
|
-
*/
|
|
33334
|
-
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
33335
|
-
let style = { ...styles?.[UI.Day] };
|
|
33336
|
-
Object.entries(dayModifiers)
|
|
33337
|
-
.filter(([, active]) => active === true)
|
|
33338
|
-
.forEach(([modifier]) => {
|
|
33339
|
-
style = {
|
|
33340
|
-
...style,
|
|
33341
|
-
...modifiersStyles?.[modifier],
|
|
33342
|
-
};
|
|
33343
|
-
});
|
|
33344
|
-
return style;
|
|
33345
|
-
}
|
|
33346
|
-
|
|
33347
|
-
/**
|
|
33348
|
-
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
33349
|
-
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
33350
|
-
*
|
|
33351
|
-
* @param dateLib The date library to use for date manipulation.
|
|
33352
|
-
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
33353
|
-
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
33354
|
-
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
33355
|
-
* @returns An array of 7 dates representing the weekdays.
|
|
33356
|
-
*/
|
|
33357
|
-
function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
|
|
33358
|
-
const referenceToday = today ?? dateLib.today();
|
|
33359
|
-
const start = broadcastCalendar
|
|
33360
|
-
? dateLib.startOfBroadcastWeek(referenceToday, dateLib)
|
|
33361
|
-
: ISOWeek
|
|
33362
|
-
? dateLib.startOfISOWeek(referenceToday)
|
|
33363
|
-
: dateLib.startOfWeek(referenceToday);
|
|
33364
|
-
const days = [];
|
|
33365
|
-
for (let i = 0; i < 7; i++) {
|
|
33366
|
-
const day = dateLib.addDays(start, i);
|
|
33367
|
-
days.push(day);
|
|
33368
|
-
}
|
|
33369
|
-
return days;
|
|
33370
|
-
}
|
|
33371
|
-
|
|
33372
|
-
/**
|
|
33373
|
-
* Returns the years to display in the dropdown.
|
|
33374
|
-
*
|
|
33375
|
-
* This function generates a list of years between the navigation start and end
|
|
33376
|
-
* dates, formatted using the provided formatter.
|
|
33377
|
-
*
|
|
33378
|
-
* @param navStart The start date for navigation.
|
|
33379
|
-
* @param navEnd The end date for navigation.
|
|
33380
|
-
* @param formatters The formatters to use for formatting the year labels.
|
|
33381
|
-
* @param dateLib The date library to use for date manipulation.
|
|
33382
|
-
* @param reverse If true, reverses the order of the years (descending).
|
|
33383
|
-
* @returns An array of dropdown options representing the years, or `undefined`
|
|
33384
|
-
* if `navStart` or `navEnd` is not provided.
|
|
33385
|
-
*/
|
|
33386
|
-
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
33387
|
-
if (!navStart)
|
|
33388
|
-
return undefined;
|
|
33389
|
-
if (!navEnd)
|
|
33390
|
-
return undefined;
|
|
33391
|
-
const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
|
|
33392
|
-
const firstNavYear = startOfYear(navStart);
|
|
33393
|
-
const lastNavYear = endOfYear(navEnd);
|
|
33394
|
-
const years = eachYearOfInterval({ start: firstNavYear, end: lastNavYear });
|
|
33395
|
-
if (reverse)
|
|
33396
|
-
years.reverse();
|
|
33397
|
-
return years.map((year) => {
|
|
33398
|
-
const label = formatters.formatYearDropdown(year, dateLib);
|
|
33399
|
-
return {
|
|
33400
|
-
value: getYear(year),
|
|
33401
|
-
label,
|
|
33402
|
-
disabled: false,
|
|
33403
|
-
};
|
|
33404
|
-
});
|
|
33405
|
-
}
|
|
33406
|
-
|
|
33407
|
-
/**
|
|
33408
|
-
* Creates `dateLib` overrides that keep all calendar math at noon in the target
|
|
33409
|
-
* time zone. This avoids second-level offset changes (e.g., historical zones
|
|
33410
|
-
* with +03:41:12) from pushing dates backward across midnight.
|
|
33411
|
-
*/
|
|
33412
|
-
function createNoonOverrides(timeZone, options = {}) {
|
|
33413
|
-
const { weekStartsOn, locale } = options;
|
|
33414
|
-
const fallbackWeekStartsOn = (weekStartsOn ??
|
|
33415
|
-
locale?.options?.weekStartsOn ??
|
|
33416
|
-
0);
|
|
33417
|
-
// Keep all internal math anchored at noon in the target zone to avoid
|
|
33418
|
-
// historical second-level offsets from crossing midnight.
|
|
33419
|
-
const toNoonTZDate = (date) => {
|
|
33420
|
-
const normalizedDate = typeof date === "number" || typeof date === "string"
|
|
33421
|
-
? new Date(date)
|
|
33422
|
-
: date;
|
|
33423
|
-
return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
|
|
33424
|
-
};
|
|
33425
|
-
// Convert a value into a host `Date` that represents the same calendar day
|
|
33426
|
-
// as the target-zone noon. This is useful for helpers (e.g., date-fns week
|
|
33427
|
-
// utilities) that expect local `Date` instances rather than `TZDate`s.
|
|
33428
|
-
const toCalendarDate = (date) => {
|
|
33429
|
-
const zoned = toNoonTZDate(date);
|
|
33430
|
-
return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
|
|
33431
|
-
};
|
|
33432
|
-
return {
|
|
33433
|
-
today: () => {
|
|
33434
|
-
return toNoonTZDate(TZDate.tz(timeZone));
|
|
33435
|
-
},
|
|
33436
|
-
newDate: (year, monthIndex, date) => {
|
|
33437
|
-
return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
|
|
33438
|
-
},
|
|
33439
|
-
startOfDay: (date) => {
|
|
33440
|
-
return toNoonTZDate(date);
|
|
33441
|
-
},
|
|
33442
|
-
startOfWeek: (date, options) => {
|
|
33443
|
-
const base = toNoonTZDate(date);
|
|
33444
|
-
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33445
|
-
fallbackWeekStartsOn);
|
|
33446
|
-
const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
|
|
33447
|
-
base.setDate(base.getDate() - diff);
|
|
33448
|
-
return base;
|
|
33449
|
-
},
|
|
33450
|
-
startOfISOWeek: (date) => {
|
|
33451
|
-
const base = toNoonTZDate(date);
|
|
33452
|
-
const diff = (base.getDay() - 1 + 7) % 7;
|
|
33453
|
-
base.setDate(base.getDate() - diff);
|
|
33454
|
-
return base;
|
|
33455
|
-
},
|
|
33456
|
-
startOfMonth: (date) => {
|
|
33457
|
-
const base = toNoonTZDate(date);
|
|
33458
|
-
base.setDate(1);
|
|
33459
|
-
return base;
|
|
33460
|
-
},
|
|
33461
|
-
startOfYear: (date) => {
|
|
33462
|
-
const base = toNoonTZDate(date);
|
|
33463
|
-
base.setMonth(0, 1);
|
|
33464
|
-
return base;
|
|
33465
|
-
},
|
|
33466
|
-
endOfWeek: (date, options) => {
|
|
33467
|
-
const base = toNoonTZDate(date);
|
|
33468
|
-
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33469
|
-
fallbackWeekStartsOn);
|
|
33470
|
-
const endDow = (weekStartsOnValue + 6) % 7;
|
|
33471
|
-
const diff = (endDow - base.getDay() + 7) % 7;
|
|
33472
|
-
base.setDate(base.getDate() + diff);
|
|
33473
|
-
return base;
|
|
33474
|
-
},
|
|
33475
|
-
endOfISOWeek: (date) => {
|
|
33476
|
-
const base = toNoonTZDate(date);
|
|
33477
|
-
const diff = (7 - base.getDay()) % 7;
|
|
33478
|
-
base.setDate(base.getDate() + diff);
|
|
33479
|
-
return base;
|
|
33480
|
-
},
|
|
33481
|
-
endOfMonth: (date) => {
|
|
33482
|
-
const base = toNoonTZDate(date);
|
|
33483
|
-
base.setMonth(base.getMonth() + 1, 0);
|
|
33484
|
-
return base;
|
|
33485
|
-
},
|
|
33486
|
-
endOfYear: (date) => {
|
|
33487
|
-
const base = toNoonTZDate(date);
|
|
33488
|
-
base.setMonth(11, 31);
|
|
33489
|
-
return base;
|
|
33490
|
-
},
|
|
33491
|
-
eachMonthOfInterval: (interval) => {
|
|
33492
|
-
const start = toNoonTZDate(interval.start);
|
|
33493
|
-
const end = toNoonTZDate(interval.end);
|
|
33494
|
-
const result = [];
|
|
33495
|
-
const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
|
|
33496
|
-
const endKey = end.getFullYear() * 12 + end.getMonth();
|
|
33497
|
-
while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
|
|
33498
|
-
result.push(new TZDate(cursor, timeZone));
|
|
33499
|
-
cursor.setMonth(cursor.getMonth() + 1, 1);
|
|
33500
|
-
}
|
|
33501
|
-
return result;
|
|
33502
|
-
},
|
|
33503
|
-
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
33504
|
-
// mutate the same TZDate, and return it.
|
|
33505
|
-
addDays: (date, amount) => {
|
|
33506
|
-
const base = toNoonTZDate(date);
|
|
33507
|
-
base.setDate(base.getDate() + amount);
|
|
33508
|
-
return base;
|
|
33509
|
-
},
|
|
33510
|
-
addWeeks: (date, amount) => {
|
|
33511
|
-
const base = toNoonTZDate(date);
|
|
33512
|
-
base.setDate(base.getDate() + amount * 7);
|
|
33513
|
-
return base;
|
|
33514
|
-
},
|
|
33515
|
-
addMonths: (date, amount) => {
|
|
33516
|
-
const base = toNoonTZDate(date);
|
|
33517
|
-
base.setMonth(base.getMonth() + amount);
|
|
33518
|
-
return base;
|
|
33519
|
-
},
|
|
33520
|
-
addYears: (date, amount) => {
|
|
33521
|
-
const base = toNoonTZDate(date);
|
|
33522
|
-
base.setFullYear(base.getFullYear() + amount);
|
|
33523
|
-
return base;
|
|
33524
|
-
},
|
|
33525
|
-
eachYearOfInterval: (interval) => {
|
|
33526
|
-
const start = toNoonTZDate(interval.start);
|
|
33527
|
-
const end = toNoonTZDate(interval.end);
|
|
33528
|
-
const years = [];
|
|
33529
|
-
const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
|
|
33530
|
-
while (cursor.getFullYear() <= end.getFullYear()) {
|
|
33531
|
-
years.push(new TZDate(cursor, timeZone));
|
|
33532
|
-
cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
|
|
33533
|
-
}
|
|
33534
|
-
return years;
|
|
33535
|
-
},
|
|
33536
|
-
getWeek: (date, options) => {
|
|
33537
|
-
const base = toCalendarDate(date);
|
|
33538
|
-
return getWeek(base, {
|
|
33539
|
-
weekStartsOn: options?.weekStartsOn ?? fallbackWeekStartsOn,
|
|
33540
|
-
firstWeekContainsDate: options?.firstWeekContainsDate ??
|
|
33541
|
-
locale?.options?.firstWeekContainsDate ??
|
|
33542
|
-
1,
|
|
33543
|
-
});
|
|
33544
|
-
},
|
|
33545
|
-
getISOWeek: (date) => {
|
|
33546
|
-
const base = toCalendarDate(date);
|
|
33547
|
-
return getISOWeek(base);
|
|
33548
|
-
},
|
|
33549
|
-
differenceInCalendarDays: (dateLeft, dateRight) => {
|
|
33550
|
-
const left = toCalendarDate(dateLeft);
|
|
33551
|
-
const right = toCalendarDate(dateRight);
|
|
33552
|
-
return differenceInCalendarDays(left, right);
|
|
33553
|
-
},
|
|
33554
|
-
differenceInCalendarMonths: (dateLeft, dateRight) => {
|
|
33555
|
-
const left = toCalendarDate(dateLeft);
|
|
33556
|
-
const right = toCalendarDate(dateRight);
|
|
33557
|
-
return differenceInCalendarMonths(left, right);
|
|
33558
|
-
},
|
|
33559
|
-
};
|
|
33560
|
-
}
|
|
33561
|
-
|
|
33562
33178
|
const asHtmlElement = (element) => {
|
|
33563
33179
|
if (element instanceof HTMLElement)
|
|
33564
33180
|
return element;
|
|
@@ -33751,27 +33367,19 @@ function getDates(displayMonths, maxDate, props, dateLib) {
|
|
|
33751
33367
|
: ISOWeek
|
|
33752
33368
|
? startOfISOWeek(firstMonth)
|
|
33753
33369
|
: startOfWeek(firstMonth);
|
|
33754
|
-
const
|
|
33370
|
+
const endWeekLastDate = broadcastCalendar
|
|
33755
33371
|
? endOfBroadcastWeek(lastMonth)
|
|
33756
33372
|
: ISOWeek
|
|
33757
33373
|
? endOfISOWeek(endOfMonth(lastMonth))
|
|
33758
33374
|
: endOfWeek(endOfMonth(lastMonth));
|
|
33759
|
-
|
|
33760
|
-
const constraintWeekEnd = maxDate &&
|
|
33761
|
-
(broadcastCalendar
|
|
33762
|
-
? endOfBroadcastWeek(maxDate)
|
|
33763
|
-
: ISOWeek
|
|
33764
|
-
? endOfISOWeek(maxDate)
|
|
33765
|
-
: endOfWeek(maxDate));
|
|
33766
|
-
// Pick the earliest week end between the displayed months and the constraint.
|
|
33767
|
-
const gridEndDate = constraintWeekEnd && isAfter(displayMonthsWeekEnd, constraintWeekEnd)
|
|
33768
|
-
? constraintWeekEnd
|
|
33769
|
-
: displayMonthsWeekEnd;
|
|
33770
|
-
const nOfDays = differenceInCalendarDays(gridEndDate, startWeekFirstDate);
|
|
33375
|
+
const nOfDays = differenceInCalendarDays(endWeekLastDate, startWeekFirstDate);
|
|
33771
33376
|
const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;
|
|
33772
33377
|
const dates = [];
|
|
33773
33378
|
for (let i = 0; i <= nOfDays; i++) {
|
|
33774
33379
|
const date = addDays(startWeekFirstDate, i);
|
|
33380
|
+
if (maxDate && isAfter(date, maxDate)) {
|
|
33381
|
+
break;
|
|
33382
|
+
}
|
|
33775
33383
|
dates.push(date);
|
|
33776
33384
|
}
|
|
33777
33385
|
// If fixed weeks is enabled, add the extra dates to the array
|
|
@@ -34102,45 +33710,17 @@ function useCalendar(props, dateLib) {
|
|
|
34102
33710
|
setFirstMonth(newInitialMonth);
|
|
34103
33711
|
}, [props.timeZone]);
|
|
34104
33712
|
/** The months displayed in the calendar. */
|
|
34105
|
-
|
|
34106
|
-
|
|
34107
|
-
|
|
34108
|
-
|
|
34109
|
-
|
|
34110
|
-
|
|
34111
|
-
|
|
34112
|
-
|
|
34113
|
-
|
|
34114
|
-
|
|
34115
|
-
|
|
34116
|
-
ISOWeek: props.ISOWeek,
|
|
34117
|
-
reverseMonths: props.reverseMonths,
|
|
34118
|
-
}, dateLib);
|
|
34119
|
-
const weeks = getWeeks(months);
|
|
34120
|
-
const days = getDays(months);
|
|
34121
|
-
const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
34122
|
-
const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
34123
|
-
return {
|
|
34124
|
-
months,
|
|
34125
|
-
weeks,
|
|
34126
|
-
days,
|
|
34127
|
-
previousMonth,
|
|
34128
|
-
nextMonth,
|
|
34129
|
-
};
|
|
34130
|
-
}, [
|
|
34131
|
-
dateLib,
|
|
34132
|
-
firstMonth.getTime(),
|
|
34133
|
-
navEnd?.getTime(),
|
|
34134
|
-
navStart?.getTime(),
|
|
34135
|
-
props.disableNavigation,
|
|
34136
|
-
props.broadcastCalendar,
|
|
34137
|
-
props.endMonth?.getTime(),
|
|
34138
|
-
props.fixedWeeks,
|
|
34139
|
-
props.ISOWeek,
|
|
34140
|
-
props.numberOfMonths,
|
|
34141
|
-
props.pagedNavigation,
|
|
34142
|
-
props.reverseMonths,
|
|
34143
|
-
]);
|
|
33713
|
+
const displayMonths = getDisplayMonths(firstMonth, navEnd, props, dateLib);
|
|
33714
|
+
/** The dates displayed in the calendar. */
|
|
33715
|
+
const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, props, dateLib);
|
|
33716
|
+
/** The Months displayed in the calendar. */
|
|
33717
|
+
const months = getMonths(displayMonths, dates, props, dateLib);
|
|
33718
|
+
/** The Weeks displayed in the calendar. */
|
|
33719
|
+
const weeks = getWeeks(months);
|
|
33720
|
+
/** The Days displayed in the calendar. */
|
|
33721
|
+
const days = getDays(months);
|
|
33722
|
+
const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
33723
|
+
const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
34144
33724
|
const { disableNavigation, onMonthChange } = props;
|
|
34145
33725
|
const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
|
|
34146
33726
|
const goToMonth = (date) => {
|
|
@@ -34359,12 +33939,6 @@ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
|
34359
33939
|
const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
|
|
34360
33940
|
if (!nextFocus)
|
|
34361
33941
|
return;
|
|
34362
|
-
if (props.disableNavigation) {
|
|
34363
|
-
const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
|
|
34364
|
-
if (!isNextInCalendar) {
|
|
34365
|
-
return;
|
|
34366
|
-
}
|
|
34367
|
-
}
|
|
34368
33942
|
calendar.goToDay(nextFocus);
|
|
34369
33943
|
setFocused(nextFocus);
|
|
34370
33944
|
};
|
|
@@ -34647,33 +34221,15 @@ function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
|
|
|
34647
34221
|
* range, and a function to check if a date is within the range.
|
|
34648
34222
|
*/
|
|
34649
34223
|
function useRange(props, dateLib) {
|
|
34650
|
-
const { disabled, excludeDisabled,
|
|
34224
|
+
const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect, } = props;
|
|
34651
34225
|
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
|
|
34652
34226
|
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
34653
34227
|
const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
|
|
34654
34228
|
const select = (triggerDate, modifiers, e) => {
|
|
34655
34229
|
const { min, max } = props;
|
|
34656
|
-
|
|
34657
|
-
|
|
34658
|
-
|
|
34659
|
-
const selectedTo = selected?.to;
|
|
34660
|
-
const hasFullRange = !!selectedFrom && !!selectedTo;
|
|
34661
|
-
const isClickingSingleDayRange = !!selectedFrom &&
|
|
34662
|
-
!!selectedTo &&
|
|
34663
|
-
dateLib.isSameDay(selectedFrom, selectedTo) &&
|
|
34664
|
-
dateLib.isSameDay(triggerDate, selectedFrom);
|
|
34665
|
-
if (resetOnSelect && (hasFullRange || !selected?.from)) {
|
|
34666
|
-
if (!required && isClickingSingleDayRange) {
|
|
34667
|
-
newRange = undefined;
|
|
34668
|
-
}
|
|
34669
|
-
else {
|
|
34670
|
-
newRange = { from: triggerDate, to: undefined };
|
|
34671
|
-
}
|
|
34672
|
-
}
|
|
34673
|
-
else {
|
|
34674
|
-
newRange = addToRange(triggerDate, selected, min, max, required, dateLib);
|
|
34675
|
-
}
|
|
34676
|
-
}
|
|
34230
|
+
const newRange = triggerDate
|
|
34231
|
+
? addToRange(triggerDate, selected, min, max, required, dateLib)
|
|
34232
|
+
: undefined;
|
|
34677
34233
|
if (excludeDisabled && disabled && newRange?.from && newRange.to) {
|
|
34678
34234
|
if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {
|
|
34679
34235
|
// if a disabled days is found, the range is reset
|
|
@@ -34761,78 +34317,6 @@ function useSelection(props, dateLib) {
|
|
|
34761
34317
|
}
|
|
34762
34318
|
}
|
|
34763
34319
|
|
|
34764
|
-
/**
|
|
34765
|
-
* Convert a {@link Date} or {@link TZDate} instance to the given time zone.
|
|
34766
|
-
* Reuses the same instance when it is already a {@link TZDate} using the target
|
|
34767
|
-
* time zone to avoid extra allocations.
|
|
34768
|
-
*/
|
|
34769
|
-
function toTimeZone(date, timeZone) {
|
|
34770
|
-
if (date instanceof TZDate && date.timeZone === timeZone) {
|
|
34771
|
-
return date;
|
|
34772
|
-
}
|
|
34773
|
-
return new TZDate(date, timeZone);
|
|
34774
|
-
}
|
|
34775
|
-
|
|
34776
|
-
function toZoneNoon(date, timeZone, noonSafe) {
|
|
34777
|
-
if (!noonSafe)
|
|
34778
|
-
return toTimeZone(date, timeZone);
|
|
34779
|
-
const zoned = toTimeZone(date, timeZone);
|
|
34780
|
-
const noonZoned = new TZDate(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 12, 0, 0, timeZone);
|
|
34781
|
-
return new Date(noonZoned.getTime());
|
|
34782
|
-
}
|
|
34783
|
-
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
34784
|
-
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
34785
|
-
return matcher;
|
|
34786
|
-
}
|
|
34787
|
-
if (matcher instanceof Date) {
|
|
34788
|
-
return toZoneNoon(matcher, timeZone, noonSafe);
|
|
34789
|
-
}
|
|
34790
|
-
if (Array.isArray(matcher)) {
|
|
34791
|
-
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone, noonSafe) : value);
|
|
34792
|
-
}
|
|
34793
|
-
if (isDateRange(matcher)) {
|
|
34794
|
-
return {
|
|
34795
|
-
...matcher,
|
|
34796
|
-
from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
|
|
34797
|
-
to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to,
|
|
34798
|
-
};
|
|
34799
|
-
}
|
|
34800
|
-
if (isDateInterval(matcher)) {
|
|
34801
|
-
return {
|
|
34802
|
-
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34803
|
-
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34804
|
-
};
|
|
34805
|
-
}
|
|
34806
|
-
if (isDateAfterType(matcher)) {
|
|
34807
|
-
return {
|
|
34808
|
-
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34809
|
-
};
|
|
34810
|
-
}
|
|
34811
|
-
if (isDateBeforeType(matcher)) {
|
|
34812
|
-
return {
|
|
34813
|
-
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34814
|
-
};
|
|
34815
|
-
}
|
|
34816
|
-
return matcher;
|
|
34817
|
-
}
|
|
34818
|
-
/**
|
|
34819
|
-
* Convert any {@link Matcher} or array of matchers to the specified time zone.
|
|
34820
|
-
*
|
|
34821
|
-
* @param matchers - The matcher or matchers to convert.
|
|
34822
|
-
* @param timeZone - The target IANA time zone.
|
|
34823
|
-
* @returns The converted matcher(s).
|
|
34824
|
-
* @group Utilities
|
|
34825
|
-
*/
|
|
34826
|
-
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
34827
|
-
if (!matchers) {
|
|
34828
|
-
return matchers;
|
|
34829
|
-
}
|
|
34830
|
-
if (Array.isArray(matchers)) {
|
|
34831
|
-
return matchers.map((matcher) => convertMatcher(matcher, timeZone, noonSafe));
|
|
34832
|
-
}
|
|
34833
|
-
return convertMatcher(matchers, timeZone, noonSafe);
|
|
34834
|
-
}
|
|
34835
|
-
|
|
34836
34320
|
/**
|
|
34837
34321
|
* Renders the DayPicker calendar component.
|
|
34838
34322
|
*
|
|
@@ -34843,83 +34327,58 @@ function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
|
34843
34327
|
*/
|
|
34844
34328
|
function DayPicker(initialProps) {
|
|
34845
34329
|
let props = initialProps;
|
|
34846
|
-
|
|
34847
|
-
if (timeZone) {
|
|
34330
|
+
if (props.timeZone) {
|
|
34848
34331
|
props = {
|
|
34849
34332
|
...initialProps,
|
|
34850
|
-
timeZone,
|
|
34851
34333
|
};
|
|
34852
34334
|
if (props.today) {
|
|
34853
|
-
props.today =
|
|
34335
|
+
props.today = new TZDate(props.today, props.timeZone);
|
|
34854
34336
|
}
|
|
34855
34337
|
if (props.month) {
|
|
34856
|
-
props.month =
|
|
34338
|
+
props.month = new TZDate(props.month, props.timeZone);
|
|
34857
34339
|
}
|
|
34858
34340
|
if (props.defaultMonth) {
|
|
34859
|
-
props.defaultMonth =
|
|
34341
|
+
props.defaultMonth = new TZDate(props.defaultMonth, props.timeZone);
|
|
34860
34342
|
}
|
|
34861
34343
|
if (props.startMonth) {
|
|
34862
|
-
props.startMonth =
|
|
34344
|
+
props.startMonth = new TZDate(props.startMonth, props.timeZone);
|
|
34863
34345
|
}
|
|
34864
34346
|
if (props.endMonth) {
|
|
34865
|
-
props.endMonth =
|
|
34347
|
+
props.endMonth = new TZDate(props.endMonth, props.timeZone);
|
|
34866
34348
|
}
|
|
34867
34349
|
if (props.mode === "single" && props.selected) {
|
|
34868
|
-
props.selected =
|
|
34350
|
+
props.selected = new TZDate(props.selected, props.timeZone);
|
|
34869
34351
|
}
|
|
34870
34352
|
else if (props.mode === "multiple" && props.selected) {
|
|
34871
|
-
props.selected = props.selected?.map((date) =>
|
|
34353
|
+
props.selected = props.selected?.map((date) => new TZDate(date, props.timeZone));
|
|
34872
34354
|
}
|
|
34873
34355
|
else if (props.mode === "range" && props.selected) {
|
|
34874
34356
|
props.selected = {
|
|
34875
34357
|
from: props.selected.from
|
|
34876
|
-
?
|
|
34877
|
-
:
|
|
34358
|
+
? new TZDate(props.selected.from, props.timeZone)
|
|
34359
|
+
: undefined,
|
|
34878
34360
|
to: props.selected.to
|
|
34879
|
-
?
|
|
34880
|
-
:
|
|
34361
|
+
? new TZDate(props.selected.to, props.timeZone)
|
|
34362
|
+
: undefined,
|
|
34881
34363
|
};
|
|
34882
34364
|
}
|
|
34883
|
-
if (props.disabled !== undefined) {
|
|
34884
|
-
props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
|
|
34885
|
-
}
|
|
34886
|
-
if (props.hidden !== undefined) {
|
|
34887
|
-
props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
|
|
34888
|
-
}
|
|
34889
|
-
if (props.modifiers) {
|
|
34890
|
-
const nextModifiers = {};
|
|
34891
|
-
Object.keys(props.modifiers).forEach((key) => {
|
|
34892
|
-
nextModifiers[key] = convertMatchersToTimeZone(props.modifiers?.[key], timeZone);
|
|
34893
|
-
});
|
|
34894
|
-
props.modifiers = nextModifiers;
|
|
34895
|
-
}
|
|
34896
34365
|
}
|
|
34897
34366
|
const { components, formatters, labels, dateLib, locale, classNames } = useMemo(() => {
|
|
34898
34367
|
const locale = { ...enUS, ...props.locale };
|
|
34899
|
-
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
34900
|
-
const noonOverrides = props.noonSafe && props.timeZone
|
|
34901
|
-
? createNoonOverrides(props.timeZone, {
|
|
34902
|
-
weekStartsOn,
|
|
34903
|
-
locale,
|
|
34904
|
-
})
|
|
34905
|
-
: undefined;
|
|
34906
|
-
const overrides = props.dateLib && noonOverrides
|
|
34907
|
-
? { ...noonOverrides, ...props.dateLib }
|
|
34908
|
-
: (props.dateLib ?? noonOverrides);
|
|
34909
34368
|
const dateLib = new DateLib({
|
|
34910
34369
|
locale,
|
|
34911
|
-
weekStartsOn,
|
|
34370
|
+
weekStartsOn: props.broadcastCalendar ? 1 : props.weekStartsOn,
|
|
34912
34371
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
34913
34372
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
34914
34373
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
34915
34374
|
timeZone: props.timeZone,
|
|
34916
34375
|
numerals: props.numerals,
|
|
34917
|
-
},
|
|
34376
|
+
}, props.dateLib);
|
|
34918
34377
|
return {
|
|
34919
34378
|
dateLib,
|
|
34920
34379
|
components: getComponents(props.components),
|
|
34921
34380
|
formatters: getFormatters(props.formatters),
|
|
34922
|
-
labels:
|
|
34381
|
+
labels: { ...defaultLabels, ...props.labels },
|
|
34923
34382
|
locale,
|
|
34924
34383
|
classNames: { ...getDefaultClassNames(), ...props.classNames },
|
|
34925
34384
|
};
|
|
@@ -34933,15 +34392,11 @@ function DayPicker(initialProps) {
|
|
|
34933
34392
|
props.timeZone,
|
|
34934
34393
|
props.numerals,
|
|
34935
34394
|
props.dateLib,
|
|
34936
|
-
props.noonSafe,
|
|
34937
34395
|
props.components,
|
|
34938
34396
|
props.formatters,
|
|
34939
34397
|
props.labels,
|
|
34940
34398
|
props.classNames,
|
|
34941
34399
|
]);
|
|
34942
|
-
if (!props.today) {
|
|
34943
|
-
props = { ...props, today: dateLib.today() };
|
|
34944
|
-
}
|
|
34945
34400
|
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles, } = props;
|
|
34946
34401
|
const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown, } = formatters;
|
|
34947
34402
|
const calendar = useCalendar(props, dateLib);
|
|
@@ -34950,7 +34405,7 @@ function DayPicker(initialProps) {
|
|
|
34950
34405
|
const { isSelected, select, selected: selectedValue, } = useSelection(props, dateLib) ?? {};
|
|
34951
34406
|
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
|
|
34952
34407
|
const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown, } = labels;
|
|
34953
|
-
const weekdays = useMemo(() => getWeekdays(dateLib, props.ISOWeek
|
|
34408
|
+
const weekdays = useMemo(() => getWeekdays(dateLib, props.ISOWeek), [dateLib, props.ISOWeek]);
|
|
34954
34409
|
const isInteractive = mode !== undefined || onDayClick !== undefined;
|
|
34955
34410
|
const handlePreviousClick = useCallback(() => {
|
|
34956
34411
|
if (!previousMonth)
|
|
@@ -34968,9 +34423,6 @@ function DayPicker(initialProps) {
|
|
|
34968
34423
|
e.preventDefault();
|
|
34969
34424
|
e.stopPropagation();
|
|
34970
34425
|
setFocused(day);
|
|
34971
|
-
if (m.disabled) {
|
|
34972
|
-
return;
|
|
34973
|
-
}
|
|
34974
34426
|
select?.(day.date, m, e);
|
|
34975
34427
|
onDayClick?.(day.date, m, e);
|
|
34976
34428
|
}, [select, onDayClick, setFocused]);
|
|
@@ -35054,7 +34506,7 @@ function DayPicker(initialProps) {
|
|
|
35054
34506
|
formatters,
|
|
35055
34507
|
};
|
|
35056
34508
|
return (React__default.createElement(dayPickerContext.Provider, { value: contextValue },
|
|
35057
|
-
React__default.createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang
|
|
34509
|
+
React__default.createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], ...dataAttributes },
|
|
35058
34510
|
React__default.createElement(components.Months, { className: classNames[UI.Months], style: styles?.[UI.Months] },
|
|
35059
34511
|
!props.hideNavigation && !navLayout && (React__default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : undefined, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),
|
|
35060
34512
|
months.map((calendarMonth, displayIndex) => {
|
|
@@ -35066,16 +34518,10 @@ function DayPicker(initialProps) {
|
|
|
35066
34518
|
displayIndex === 0 && (React__default.createElement(components.PreviousMonthButton, { type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, "aria-disabled": previousMonth ? undefined : true, "aria-label": labelPrevious(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : undefined },
|
|
35067
34519
|
React__default.createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" }))),
|
|
35068
34520
|
React__default.createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : undefined, className: classNames[UI.MonthCaption], style: styles?.[UI.MonthCaption], calendarMonth: calendarMonth, displayIndex: displayIndex }, captionLayout?.startsWith("dropdown") ? (React__default.createElement(components.DropdownNav, { className: classNames[UI.Dropdowns], style: styles?.[UI.Dropdowns] },
|
|
35069
|
-
|
|
35070
|
-
|
|
35071
|
-
|
|
35072
|
-
|
|
35073
|
-
captionLayout === "dropdown-years" ? (React__default.createElement(components.YearsDropdown, { key: "year", className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown(dateLib.options), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: getYearOptions(navStart, navEnd, formatters, dateLib, Boolean(props.reverseYears)), style: styles?.[UI.Dropdown], value: dateLib.getYear(calendarMonth.date) })) : (React__default.createElement("span", { key: "year" }, formatYearDropdown(calendarMonth.date, dateLib)));
|
|
35074
|
-
const controls = dateLib.getMonthYearOrder() === "year-first"
|
|
35075
|
-
? [yearControl, monthControl]
|
|
35076
|
-
: [monthControl, yearControl];
|
|
35077
|
-
return controls;
|
|
35078
|
-
})(),
|
|
34521
|
+
captionLayout === "dropdown" ||
|
|
34522
|
+
captionLayout === "dropdown-months" ? (React__default.createElement(components.MonthsDropdown, { className: classNames[UI.MonthsDropdown], "aria-label": labelMonthDropdown(), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters, dateLib), style: styles?.[UI.Dropdown], value: dateLib.getMonth(calendarMonth.date) })) : (React__default.createElement("span", null, formatMonthDropdown(calendarMonth.date, dateLib))),
|
|
34523
|
+
captionLayout === "dropdown" ||
|
|
34524
|
+
captionLayout === "dropdown-years" ? (React__default.createElement(components.YearsDropdown, { className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown(dateLib.options), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: getYearOptions(navStart, navEnd, formatters, dateLib, Boolean(props.reverseYears)), style: styles?.[UI.Dropdown], value: dateLib.getYear(calendarMonth.date) })) : (React__default.createElement("span", null, formatYearDropdown(calendarMonth.date, dateLib))),
|
|
35079
34525
|
React__default.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
35080
34526
|
border: 0,
|
|
35081
34527
|
clip: "rect(0 0 0 0)",
|
|
@@ -35087,7 +34533,9 @@ function DayPicker(initialProps) {
|
|
|
35087
34533
|
width: "1px",
|
|
35088
34534
|
whiteSpace: "nowrap",
|
|
35089
34535
|
wordWrap: "normal",
|
|
35090
|
-
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
|
|
34536
|
+
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
|
|
34537
|
+
// biome-ignore lint/a11y/useSemanticElements: breaking change
|
|
34538
|
+
React__default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
|
|
35091
34539
|
navLayout === "around" &&
|
|
35092
34540
|
!props.hideNavigation &&
|
|
35093
34541
|
displayIndex === numberOfMonths - 1 && (React__default.createElement(components.NextMonthButton, { type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, "aria-disabled": nextMonth ? undefined : true, "aria-label": labelNext(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : undefined },
|
|
@@ -35102,7 +34550,9 @@ function DayPicker(initialProps) {
|
|
|
35102
34550
|
weekdays.map((weekday) => (React__default.createElement(components.Weekday, { "aria-label": labelWeekday(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles?.[UI.Weekday], scope: "col" }, formatWeekdayName(weekday, dateLib.options, dateLib)))))),
|
|
35103
34551
|
React__default.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : undefined, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
|
|
35104
34552
|
return (React__default.createElement(components.Week, { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week: week },
|
|
35105
|
-
showWeekNumber && (
|
|
34553
|
+
showWeekNumber && (
|
|
34554
|
+
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34555
|
+
React__default.createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
35106
34556
|
locale,
|
|
35107
34557
|
}), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber(week.weekNumber, dateLib))),
|
|
35108
34558
|
week.days.map((day) => {
|
|
@@ -35126,16 +34576,18 @@ function DayPicker(initialProps) {
|
|
|
35126
34576
|
const ariaLabel = !isInteractive && !modifiers.hidden
|
|
35127
34577
|
? labelGridcell(date, modifiers, dateLib.options, dateLib)
|
|
35128
34578
|
: undefined;
|
|
35129
|
-
return (
|
|
35130
|
-
|
|
35131
|
-
|
|
35132
|
-
|
|
35133
|
-
undefined, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay(date, dateLib.options, dateLib))) : (!modifiers.hidden &&
|
|
34579
|
+
return (
|
|
34580
|
+
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34581
|
+
React__default.createElement(components.Day, { key: `${dateLib.format(date, "yyyy-MM-dd")}_${dateLib.format(day.displayMonth, "yyyy-MM")}`, day: day, modifiers: modifiers, className: className.join(" "), style: style, role: "gridcell", "aria-selected": modifiers.selected || undefined, "aria-label": ariaLabel, "data-day": dateLib.format(date, "yyyy-MM-dd"), "data-month": day.outside
|
|
34582
|
+
? dateLib.format(date, "yyyy-MM")
|
|
34583
|
+
: undefined, "data-selected": modifiers.selected || undefined, "data-disabled": modifiers.disabled || undefined, "data-hidden": modifiers.hidden || undefined, "data-outside": day.outside || undefined, "data-focused": modifiers.focused || undefined, "data-today": modifiers.today || undefined }, !modifiers.hidden && isInteractive ? (React__default.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles?.[UI.DayButton], type: "button", day: day, modifiers: modifiers, disabled: modifiers.disabled || undefined, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay(date, dateLib.options, dateLib))) : (!modifiers.hidden &&
|
|
35134
34584
|
formatDay(day.date, dateLib.options, dateLib))));
|
|
35135
34585
|
})));
|
|
35136
34586
|
})))));
|
|
35137
34587
|
})),
|
|
35138
|
-
props.footer && (
|
|
34588
|
+
props.footer && (
|
|
34589
|
+
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34590
|
+
React__default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
35139
34591
|
}
|
|
35140
34592
|
|
|
35141
34593
|
function styleInject(css, ref) {
|
|
@@ -35165,7 +34617,7 @@ function styleInject(css, ref) {
|
|
|
35165
34617
|
}
|
|
35166
34618
|
}
|
|
35167
34619
|
|
|
35168
|
-
var css_248z$3 = "/* Variables declaration */\n.rdp-root {\n --rdp-accent-color: blue; /* The accent color used for selected days and UI elements. */\n --rdp-accent-background-color: #f0f0ff; /* The accent background color used for selected days and UI elements. */\n\n --rdp-day-height: 44px; /* The height of the day cells. */\n --rdp-day-width: 44px; /* The width of the day cells. */\n\n --rdp-day_button-border-radius: 100%; /* The border radius of the day cells. */\n --rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */\n --rdp-day_button-height: 42px; /* The height of the day cells. */\n --rdp-day_button-width: 42px; /* The width of the day cells. */\n\n --rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */\n --rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */\n --rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */\n --rdp-today-color: var(--rdp-accent-color); /* The color of the today's date. */\n\n --rdp-dropdown-gap: 0.5rem; /* The gap between the dropdowns used in the month captons. */\n\n --rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */\n\n --rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */\n --rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */\n --rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */\n --rdp-nav-height: 2.75rem; /* The height of the navigation bar. */\n\n --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */\n --rdp-range_middle-color: inherit; /* The color of the range text. */\n\n --rdp-range_start-color: white; /* The color of the range text. */\n --rdp-range_start-background: linear-gradient(\n var(--rdp-gradient-direction),\n transparent 50%,\n var(--rdp-range_middle-background-color) 50%\n ); /* Used for the background of the start of the selected range. */\n --rdp-range_start-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the start of the selected range. */\n\n --rdp-range_end-background: linear-gradient(\n var(--rdp-gradient-direction),\n var(--rdp-range_middle-background-color) 50%,\n transparent 50%\n ); /* Used for the background of the end of the selected range. */\n --rdp-range_end-color: white; /* The color of the range text. */\n --rdp-range_end-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the end of the selected range. */\n\n --rdp-week_number-border-radius: 100%; /* The border radius of the week number. */\n --rdp-week_number-border: 2px solid transparent; /* The border of the week number. */\n\n --rdp-week_number-height: var(--rdp-day-height); /* The height of the week number cells. */\n --rdp-week_number-opacity: 0.75; /* The opacity of the week number. */\n --rdp-week_number-width: var(--rdp-day-width); /* The width of the week number cells. */\n --rdp-weeknumber-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */\n --rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */\n --rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-gradient-direction: 90deg;\n\n --rdp-animation_duration: 0.3s;\n --rdp-animation_timing: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.rdp-root[dir=\"rtl\"] {\n --rdp-gradient-direction: -90deg;\n}\n\n.rdp-root[data-broadcast-calendar=\"true\"] {\n --rdp-outside-opacity: unset;\n}\n\n/* Root of the component. */\n.rdp-root {\n position: relative; /* Required to position the navigation toolbar. */\n box-sizing: border-box;\n}\n\n.rdp-root * {\n box-sizing: border-box;\n}\n\n.rdp-day {\n width: var(--rdp-day-width);\n height: var(--rdp-day-height);\n text-align: center;\n}\n\n.rdp-day_button {\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n justify-content: center;\n align-items: center;\n display: flex;\n\n width: var(--rdp-day_button-width);\n height: var(--rdp-day_button-height);\n border: var(--rdp-day_button-border);\n border-radius: var(--rdp-day_button-border-radius);\n}\n\n.rdp-day_button:disabled {\n cursor: revert;\n}\n\n.rdp-caption_label {\n z-index: 1;\n\n position: relative;\n display: inline-flex;\n align-items: center;\n\n white-space: nowrap;\n border: 0;\n}\n\n.rdp-dropdown:focus-visible ~ .rdp-caption_label {\n outline: 5px auto Highlight;\n /* biome-ignore lint/suspicious/noDuplicateProperties: backward compatibility */\n outline: 5px auto -webkit-focus-ring-color;\n}\n\n.rdp-button_next,\n.rdp-button_previous {\n border: none;\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n -moz-appearance: none;\n -webkit-appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n appearance: none;\n\n width: var(--rdp-nav_button-width);\n height: var(--rdp-nav_button-height);\n}\n\n.rdp-button_next:disabled,\n.rdp-button_next[aria-disabled=\"true\"],\n.rdp-button_previous:disabled,\n.rdp-button_previous[aria-disabled=\"true\"] {\n cursor: revert;\n\n opacity: var(--rdp-nav_button-disabled-opacity);\n}\n\n.rdp-chevron {\n display: inline-block;\n fill: var(--rdp-accent-color);\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-nav .rdp-chevron {\n transform: rotate(180deg);\n transform-origin: 50%;\n}\n\n.rdp-dropdowns {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: var(--rdp-dropdown-gap);\n}\n.rdp-dropdown {\n z-index: 2;\n\n /* Reset */\n opacity: 0;\n appearance: none;\n position: absolute;\n inset-block-start: 0;\n inset-block-end: 0;\n inset-inline-start: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n cursor: inherit;\n border: none;\n line-height: inherit;\n}\n\n.rdp-dropdown_root {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.rdp-dropdown_root[data-disabled=\"true\"] .rdp-chevron {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-month_caption {\n display: flex;\n align-content: center;\n height: var(--rdp-nav-height);\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month,\n.rdp-root[data-nav-layout=\"after\"] .rdp-month {\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month_caption {\n justify-content: center;\n margin-inline-start: var(--rdp-nav_button-width);\n margin-inline-end: var(--rdp-nav_button-width);\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_previous {\n position: absolute;\n inset-inline-start: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_next {\n position: absolute;\n inset-inline-end: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n justify-content: center;\n}\n\n.rdp-months {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n gap: var(--rdp-months-gap);\n max-width: fit-content;\n}\n\n.rdp-month_grid {\n border-collapse: collapse;\n}\n\n.rdp-nav {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n\n display: flex;\n align-items: center;\n\n height: var(--rdp-nav-height);\n}\n\n.rdp-weekday {\n opacity: var(--rdp-weekday-opacity);\n padding: var(--rdp-weekday-padding);\n font-weight: 500;\n font-size: smaller;\n text-align: var(--rdp-weekday-text-align);\n text-transform: var(--rdp-weekday-text-transform);\n}\n\n.rdp-week_number {\n opacity: var(--rdp-week_number-opacity);\n font-weight: 400;\n font-size: small;\n height: var(--rdp-week_number-height);\n width: var(--rdp-week_number-width);\n border: var(--rdp-week_number-border);\n border-radius: var(--rdp-week_number-border-radius);\n text-align: var(--rdp-weeknumber-text-align);\n}\n\n/* DAY MODIFIERS */\n.rdp-today:not(.rdp-outside) {\n color: var(--rdp-today-color);\n}\n\n.rdp-selected {\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-selected .rdp-day_button {\n border: var(--rdp-selected-border);\n}\n\n.rdp-outside {\n opacity: var(--rdp-outside-opacity);\n}\n\n.rdp-disabled:not(.rdp-selected) {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-hidden {\n visibility: hidden;\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_start {\n background: var(--rdp-range_start-background);\n}\n\n.rdp-range_start .rdp-day_button {\n background-color: var(--rdp-range_start-date-background-color);\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_middle {\n background-color: var(--rdp-range_middle-background-color);\n}\n\n.rdp-range_middle .rdp-day_button {\n border: unset;\n border-radius: unset;\n color: var(--rdp-range_middle-color);\n}\n\n.rdp-range_end {\n background: var(--rdp-range_end-background);\n color: var(--rdp-range_end-color);\n}\n\n.rdp-range_end .rdp-day_button {\n color: var(--rdp-range_start-color);\n background-color: var(--rdp-range_end-date-background-color);\n}\n\n.rdp-range_start.rdp-range_end {\n background: revert;\n}\n\n.rdp-focusable {\n cursor: pointer;\n}\n\n@keyframes rdp-slide_in_left {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_in_right {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_out_left {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100%);\n }\n}\n\n@keyframes rdp-slide_out_right {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n}\n\n.rdp-weeks_before_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_before_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n@keyframes rdp-fade_in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes rdp-fade_out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.rdp-caption_after_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_after_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n";
|
|
34620
|
+
var css_248z$3 = "/* Variables declaration */\n.rdp-root {\n --rdp-accent-color: blue; /* The accent color used for selected days and UI elements. */\n --rdp-accent-background-color: #f0f0ff; /* The accent background color used for selected days and UI elements. */\n\n --rdp-day-height: 44px; /* The height of the day cells. */\n --rdp-day-width: 44px; /* The width of the day cells. */\n\n --rdp-day_button-border-radius: 100%; /* The border radius of the day cells. */\n --rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */\n --rdp-day_button-height: 42px; /* The height of the day cells. */\n --rdp-day_button-width: 42px; /* The width of the day cells. */\n\n --rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */\n --rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */\n --rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */\n --rdp-today-color: var(--rdp-accent-color); /* The color of the today's date. */\n\n --rdp-dropdown-gap: 0.5rem; /* The gap between the dropdowns used in the month captons. */\n\n --rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */\n\n --rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */\n --rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */\n --rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */\n --rdp-nav-height: 2.75rem; /* The height of the navigation bar. */\n\n --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */\n --rdp-range_middle-color: inherit; /* The color of the range text. */\n\n --rdp-range_start-color: white; /* The color of the range text. */\n --rdp-range_start-background: linear-gradient(\n var(--rdp-gradient-direction),\n transparent 50%,\n var(--rdp-range_middle-background-color) 50%\n ); /* Used for the background of the start of the selected range. */\n --rdp-range_start-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the start of the selected range. */\n\n --rdp-range_end-background: linear-gradient(\n var(--rdp-gradient-direction),\n var(--rdp-range_middle-background-color) 50%,\n transparent 50%\n ); /* Used for the background of the end of the selected range. */\n --rdp-range_end-color: white; /* The color of the range text. */\n --rdp-range_end-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the end of the selected range. */\n\n --rdp-week_number-border-radius: 100%; /* The border radius of the week number. */\n --rdp-week_number-border: 2px solid transparent; /* The border of the week number. */\n\n --rdp-week_number-height: var(--rdp-day-height); /* The height of the week number cells. */\n --rdp-week_number-opacity: 0.75; /* The opacity of the week number. */\n --rdp-week_number-width: var(--rdp-day-width); /* The width of the week number cells. */\n --rdp-weeknumber-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */\n --rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */\n --rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-gradient-direction: 90deg;\n\n --rdp-animation_duration: 0.3s;\n --rdp-animation_timing: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.rdp-root[dir=\"rtl\"] {\n --rdp-gradient-direction: -90deg;\n}\n\n.rdp-root[data-broadcast-calendar=\"true\"] {\n --rdp-outside-opacity: unset;\n}\n\n/* Root of the component. */\n.rdp-root {\n position: relative; /* Required to position the navigation toolbar. */\n box-sizing: border-box;\n}\n\n.rdp-root * {\n box-sizing: border-box;\n}\n\n.rdp-day {\n width: var(--rdp-day-width);\n height: var(--rdp-day-height);\n text-align: center;\n}\n\n.rdp-day_button {\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n justify-content: center;\n align-items: center;\n display: flex;\n\n width: var(--rdp-day_button-width);\n height: var(--rdp-day_button-height);\n border: var(--rdp-day_button-border);\n border-radius: var(--rdp-day_button-border-radius);\n}\n\n.rdp-day_button:disabled {\n cursor: revert;\n}\n\n.rdp-caption_label {\n z-index: 1;\n\n position: relative;\n display: inline-flex;\n align-items: center;\n\n white-space: nowrap;\n border: 0;\n}\n\n.rdp-dropdown:focus-visible ~ .rdp-caption_label {\n outline: 5px auto Highlight;\n /* biome-ignore lint/suspicious/noDuplicateProperties: backward compatibility */\n outline: 5px auto -webkit-focus-ring-color;\n}\n\n.rdp-button_next,\n.rdp-button_previous {\n border: none;\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n -moz-appearance: none;\n -webkit-appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n appearance: none;\n\n width: var(--rdp-nav_button-width);\n height: var(--rdp-nav_button-height);\n}\n\n.rdp-button_next:disabled,\n.rdp-button_next[aria-disabled=\"true\"],\n.rdp-button_previous:disabled,\n.rdp-button_previous[aria-disabled=\"true\"] {\n cursor: revert;\n\n opacity: var(--rdp-nav_button-disabled-opacity);\n}\n\n.rdp-chevron {\n display: inline-block;\n fill: var(--rdp-accent-color);\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-nav .rdp-chevron {\n transform: rotate(180deg);\n transform-origin: 50%;\n}\n\n.rdp-dropdowns {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: var(--rdp-dropdown-gap);\n}\n.rdp-dropdown {\n z-index: 2;\n\n /* Reset */\n opacity: 0;\n appearance: none;\n position: absolute;\n inset-block-start: 0;\n inset-block-end: 0;\n inset-inline-start: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n cursor: inherit;\n border: none;\n line-height: inherit;\n}\n\n.rdp-dropdown_root {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.rdp-dropdown_root[data-disabled=\"true\"] .rdp-chevron {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-month_caption {\n display: flex;\n align-content: center;\n height: var(--rdp-nav-height);\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month,\n.rdp-root[data-nav-layout=\"after\"] .rdp-month {\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month_caption {\n justify-content: center;\n margin-inline-start: var(--rdp-nav_button-width);\n margin-inline-end: var(--rdp-nav_button-width);\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_previous {\n position: absolute;\n inset-inline-start: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_next {\n position: absolute;\n inset-inline-end: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n justify-content: center;\n}\n\n.rdp-months {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n gap: var(--rdp-months-gap);\n max-width: fit-content;\n}\n\n.rdp-month_grid {\n border-collapse: collapse;\n}\n\n.rdp-nav {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n\n display: flex;\n align-items: center;\n\n height: var(--rdp-nav-height);\n}\n\n.rdp-weekday {\n opacity: var(--rdp-weekday-opacity);\n padding: var(--rdp-weekday-padding);\n font-weight: 500;\n font-size: smaller;\n text-align: var(--rdp-weekday-text-align);\n text-transform: var(--rdp-weekday-text-transform);\n}\n\n.rdp-week_number {\n opacity: var(--rdp-week_number-opacity);\n font-weight: 400;\n font-size: small;\n height: var(--rdp-week_number-height);\n width: var(--rdp-week_number-width);\n border: var(--rdp-week_number-border);\n border-radius: var(--rdp-week_number-border-radius);\n text-align: var(--rdp-weeknumber-text-align);\n}\n\n/* DAY MODIFIERS */\n.rdp-today:not(.rdp-outside) {\n color: var(--rdp-today-color);\n}\n\n.rdp-selected {\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-selected .rdp-day_button {\n border: var(--rdp-selected-border);\n}\n\n.rdp-outside {\n opacity: var(--rdp-outside-opacity);\n}\n\n.rdp-disabled {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-hidden {\n visibility: hidden;\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_start {\n background: var(--rdp-range_start-background);\n}\n\n.rdp-range_start .rdp-day_button {\n background-color: var(--rdp-range_start-date-background-color);\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_middle {\n background-color: var(--rdp-range_middle-background-color);\n}\n\n.rdp-range_middle .rdp-day_button {\n border: unset;\n border-radius: unset;\n color: var(--rdp-range_middle-color);\n}\n\n.rdp-range_end {\n background: var(--rdp-range_end-background);\n color: var(--rdp-range_end-color);\n}\n\n.rdp-range_end .rdp-day_button {\n color: var(--rdp-range_start-color);\n background-color: var(--rdp-range_end-date-background-color);\n}\n\n.rdp-range_start.rdp-range_end {\n background: revert;\n}\n\n.rdp-focusable {\n cursor: pointer;\n}\n\n@keyframes rdp-slide_in_left {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_in_right {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_out_left {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100%);\n }\n}\n\n@keyframes rdp-slide_out_right {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n}\n\n.rdp-weeks_before_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_before_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n@keyframes rdp-fade_in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes rdp-fade_out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.rdp-caption_after_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_after_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n";
|
|
35169
34621
|
styleInject(css_248z$3);
|
|
35170
34622
|
|
|
35171
34623
|
var reactInputMask = {exports: {}};
|
|
@@ -39557,7 +39009,7 @@ const DateRangePicker = forwardRef((props, ref) => {
|
|
|
39557
39009
|
}, children: t('Last month') })] })] })] }) }));
|
|
39558
39010
|
});
|
|
39559
39011
|
|
|
39560
|
-
const FilterComponent = ({ optionsFilter, formatSetting, filterBy, setOpenFilter, changeFilter, column }) => {
|
|
39012
|
+
const FilterComponent = ({ optionsFilter, formatSetting, filterBy, setOpenFilter, changeFilter, column, }) => {
|
|
39561
39013
|
const { t } = useTranslation();
|
|
39562
39014
|
const fieldFilter = column.fieldFilter ?? column.field;
|
|
39563
39015
|
let typeFilter = column.filterType;
|
|
@@ -39584,14 +39036,22 @@ const FilterComponent = ({ optionsFilter, formatSetting, filterBy, setOpenFilter
|
|
|
39584
39036
|
from.value = filterValue?.from;
|
|
39585
39037
|
}
|
|
39586
39038
|
else {
|
|
39587
|
-
filterBy.push({
|
|
39039
|
+
filterBy.push({
|
|
39040
|
+
key: fieldFilter,
|
|
39041
|
+
ope: 'greaterthanorequal',
|
|
39042
|
+
value: filterValue?.from,
|
|
39043
|
+
});
|
|
39588
39044
|
}
|
|
39589
39045
|
const to = filterBy.find((item) => item.key === fieldFilter && item.ope === 'lessthanorequal');
|
|
39590
39046
|
if (to) {
|
|
39591
39047
|
to.value = filterValue?.to;
|
|
39592
39048
|
}
|
|
39593
39049
|
else {
|
|
39594
|
-
filterBy.push({
|
|
39050
|
+
filterBy.push({
|
|
39051
|
+
key: fieldFilter,
|
|
39052
|
+
ope: 'lessthanorequal',
|
|
39053
|
+
value: filterValue?.to,
|
|
39054
|
+
});
|
|
39595
39055
|
}
|
|
39596
39056
|
}
|
|
39597
39057
|
else {
|
|
@@ -39601,7 +39061,11 @@ const FilterComponent = ({ optionsFilter, formatSetting, filterBy, setOpenFilter
|
|
|
39601
39061
|
filter.value = filterValue ?? '';
|
|
39602
39062
|
}
|
|
39603
39063
|
else {
|
|
39604
|
-
filterBy.push({
|
|
39064
|
+
filterBy.push({
|
|
39065
|
+
key: fieldFilter,
|
|
39066
|
+
ope: operator ?? 'equal',
|
|
39067
|
+
value: filterValue ?? '',
|
|
39068
|
+
});
|
|
39605
39069
|
}
|
|
39606
39070
|
}
|
|
39607
39071
|
changeFilter([...filterBy]);
|
|
@@ -39610,19 +39074,19 @@ const FilterComponent = ({ optionsFilter, formatSetting, filterBy, setOpenFilter
|
|
|
39610
39074
|
/* eslint-disable */
|
|
39611
39075
|
switch (typeFilter) {
|
|
39612
39076
|
case 'text':
|
|
39613
|
-
return jsx(StringFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave });
|
|
39077
|
+
return (jsx(StringFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave }));
|
|
39614
39078
|
case 'numeric':
|
|
39615
|
-
return jsx(NumberFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave, formatSetting: formatSetting });
|
|
39079
|
+
return (jsx(NumberFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave, formatSetting: formatSetting }));
|
|
39616
39080
|
case 'select':
|
|
39617
|
-
return jsx(SelectFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave });
|
|
39081
|
+
return (jsx(SelectFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave }));
|
|
39618
39082
|
case 'date':
|
|
39619
|
-
return jsx(DateRangeFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave });
|
|
39083
|
+
return (jsx(DateRangeFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave }));
|
|
39620
39084
|
default:
|
|
39621
39085
|
return jsx("div", { children: t('No filter available') });
|
|
39622
39086
|
}
|
|
39623
39087
|
/* eslint-enable */
|
|
39624
39088
|
};
|
|
39625
|
-
const StringFilterComponent = ({ fieldFilter, filterBy, handleSave }) => {
|
|
39089
|
+
const StringFilterComponent = ({ fieldFilter, filterBy, handleSave, }) => {
|
|
39626
39090
|
const { t } = useTranslation();
|
|
39627
39091
|
const filter = filterBy.find((item) => item.key === fieldFilter);
|
|
39628
39092
|
const [operator, setOperator] = useState(filter?.ope ?? 'contains');
|
|
@@ -39632,7 +39096,7 @@ const StringFilterComponent = ({ fieldFilter, filterBy, handleSave }) => {
|
|
|
39632
39096
|
{ label: 'Kết thúc bởi', value: 'endswith' },
|
|
39633
39097
|
{ label: 'Chứa', value: 'contains' },
|
|
39634
39098
|
{ label: 'Bằng', value: 'equal' },
|
|
39635
|
-
{ label: 'Không bằng', value: 'notequal' }
|
|
39099
|
+
{ label: 'Không bằng', value: 'notequal' },
|
|
39636
39100
|
];
|
|
39637
39101
|
return (jsx(Fragment$1, { children: jsxs("div", { className: "r-filter-popup", onKeyDown: (e) => {
|
|
39638
39102
|
if (e.code === 'Enter' || e.code === 'NumpadEnter') {
|
|
@@ -39647,7 +39111,7 @@ const StringFilterComponent = ({ fieldFilter, filterBy, handleSave }) => {
|
|
|
39647
39111
|
setValueFilter(val.target.value);
|
|
39648
39112
|
} }), jsxs("div", { className: "d-flex justify-content-end", children: [jsx(Button$1$1, { color: "primary", style: { borderRadius: 3 }, className: "me-50 py-25 px-50 fw-bold", onClick: () => handleSave('text', valueFilter, operator), children: t('Filter') }), jsx(Button$1$1, { className: "py-25 px-50 fw-bold", outline: true, style: { borderRadius: 3 }, onClick: () => handleSave(), children: t('Clear') })] })] }) }));
|
|
39649
39113
|
};
|
|
39650
|
-
const NumberFilterComponent = ({ column, filterBy, fieldFilter, handleSave, formatSetting }) => {
|
|
39114
|
+
const NumberFilterComponent = ({ column, filterBy, fieldFilter, handleSave, formatSetting, }) => {
|
|
39651
39115
|
const { t } = useTranslation();
|
|
39652
39116
|
const filter = filterBy.find((item) => item.key === fieldFilter);
|
|
39653
39117
|
const [operator, setOperator] = useState(filter?.ope ?? 'equal');
|
|
@@ -39657,17 +39121,15 @@ const NumberFilterComponent = ({ column, filterBy, fieldFilter, handleSave, form
|
|
|
39657
39121
|
{ label: 'Lớn hơn hoặc bằng', value: 'greaterthanorequal' },
|
|
39658
39122
|
{ label: 'Bằng', value: 'equal' },
|
|
39659
39123
|
{ label: 'Bé hơn', value: 'lessthan' },
|
|
39660
|
-
{ label: 'Bé hơn hoặc bằng', value: 'lessthanorequal' }
|
|
39124
|
+
{ label: 'Bé hơn hoặc bằng', value: 'lessthanorequal' },
|
|
39661
39125
|
];
|
|
39662
39126
|
const numericFormatProps = {
|
|
39663
39127
|
value: !isNullOrUndefined$1(valueFilter) ? valueFilter.toString() : '',
|
|
39664
39128
|
thousandSeparator: checkThousandSeparator(formatSetting?.thousandSeparator, formatSetting?.decimalSeparator),
|
|
39665
39129
|
decimalSeparator: checkDecimalSeparator(formatSetting?.thousandSeparator, formatSetting?.decimalSeparator),
|
|
39666
39130
|
allowNegative: column.numericSettings?.allowNegative ?? false,
|
|
39667
|
-
decimalScale: column.numericSettings?.fraction ?? 0
|
|
39131
|
+
decimalScale: column.numericSettings?.fraction ?? 0,
|
|
39668
39132
|
};
|
|
39669
|
-
console.log(column.numericSettings?.fraction);
|
|
39670
|
-
console.log(column.field);
|
|
39671
39133
|
let floatValue = parseFloat(valueFilter ?? '0');
|
|
39672
39134
|
return (jsx(Fragment$1, { children: jsxs("div", { className: "r-filter-popup", onKeyDown: (e) => {
|
|
39673
39135
|
if (e.code === 'Enter' || e.code === 'NumpadEnter') {
|
|
@@ -39688,7 +39150,7 @@ const NumberFilterComponent = ({ column, filterBy, fieldFilter, handleSave, form
|
|
|
39688
39150
|
}
|
|
39689
39151
|
} }), jsxs("div", { className: "d-flex justify-content-end", children: [jsx(Button$1$1, { color: "primary", style: { borderRadius: 3 }, className: "me-50 py-25 px-50 fw-bold", onClick: () => handleSave('numeric', valueFilter, operator), children: t('Filter') }), jsx(Button$1$1, { className: "py-25 px-50 fw-bold", outline: true, style: { borderRadius: 3 }, onClick: () => handleSave(), children: t('Clear') })] })] }) }));
|
|
39690
39152
|
};
|
|
39691
|
-
const SelectFilterComponent = ({ column, filterBy, handleSave, fieldFilter, optionsFilter }) => {
|
|
39153
|
+
const SelectFilterComponent = ({ column, filterBy, handleSave, fieldFilter, optionsFilter, }) => {
|
|
39692
39154
|
const { t } = useTranslation();
|
|
39693
39155
|
const filter = filterBy.find((item) => item.key === fieldFilter);
|
|
39694
39156
|
const [valueFilter, setValueFilter] = useState(filter?.value ?? '');
|
|
@@ -39699,15 +39161,22 @@ const SelectFilterComponent = ({ column, filterBy, handleSave, fieldFilter, opti
|
|
|
39699
39161
|
}, 100);
|
|
39700
39162
|
e.stopPropagation();
|
|
39701
39163
|
}
|
|
39702
|
-
}, children: [jsx("div", { className: "mb-1", children: jsx(SelectTable, { value: optionsFilter
|
|
39164
|
+
}, children: [jsx("div", { className: "mb-1", children: jsx(SelectTable, { value: optionsFilter
|
|
39165
|
+
? optionsFilter[column.fieldFilter ?? column.field]?.find((x) => x.value === valueFilter)
|
|
39166
|
+
: undefined, options: (optionsFilter &&
|
|
39167
|
+
optionsFilter[column.fieldFilter ?? column.field]) ??
|
|
39168
|
+
[], isClearable: true, onChange: (val) => {
|
|
39703
39169
|
setValueFilter(val?.value);
|
|
39704
39170
|
}, placeholder: t('Select') }) }), jsxs("div", { className: "d-flex justify-content-end", children: [jsx(Button$1$1, { color: "primary", style: { borderRadius: 3 }, className: "me-50 py-25 px-50 fw-bold", onClick: () => handleSave('select', valueFilter, 'equal'), children: t('Filter') }), jsx(Button$1$1, { className: "py-25 px-50 fw-bold", outline: true, style: { borderRadius: 3 }, onClick: () => handleSave(), children: t('Clear') })] })] }) }));
|
|
39705
39171
|
};
|
|
39706
|
-
const DateRangeFilterComponent = ({ fieldFilter, filterBy, handleSave }) => {
|
|
39172
|
+
const DateRangeFilterComponent = ({ fieldFilter, filterBy, handleSave, }) => {
|
|
39707
39173
|
const { t } = useTranslation();
|
|
39708
39174
|
const from = filterBy.find((item) => item.key === fieldFilter && item.ope === 'greaterthanorequal')?.value;
|
|
39709
39175
|
const to = filterBy.find((item) => item.key === fieldFilter && item.ope === 'lessthanorequal')?.value;
|
|
39710
|
-
const [valueFilter, setValueFilter] = useState({
|
|
39176
|
+
const [valueFilter, setValueFilter] = useState({
|
|
39177
|
+
from: from ?? undefined,
|
|
39178
|
+
to: to ?? undefined,
|
|
39179
|
+
});
|
|
39711
39180
|
return (jsx(Fragment$1, { children: jsxs("div", { className: "r-filter-popup", onKeyDown: (e) => {
|
|
39712
39181
|
if (e.code === 'Enter' || e.code === 'NumpadEnter') {
|
|
39713
39182
|
setTimeout(() => {
|