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.js
CHANGED
|
@@ -9085,20 +9085,6 @@ var SvgProcess = function (_a) {
|
|
|
9085
9085
|
React__namespace.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" })));
|
|
9086
9086
|
};
|
|
9087
9087
|
|
|
9088
|
-
var SvgProjectSetting = function (_a) {
|
|
9089
|
-
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9090
|
-
return (React__namespace.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),
|
|
9091
|
-
title ? React__namespace.createElement("title", { id: titleId }, title) : null,
|
|
9092
|
-
React__namespace.createElement("g", { clipPath: "url(#project-setting_svg__a)", fill: props.color || "currentColor" },
|
|
9093
|
-
React__namespace.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" }),
|
|
9094
|
-
React__namespace.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" }),
|
|
9095
|
-
React__namespace.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" }),
|
|
9096
|
-
React__namespace.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" })),
|
|
9097
|
-
React__namespace.createElement("defs", null,
|
|
9098
|
-
React__namespace.createElement("clipPath", { id: "project-setting_svg__a" },
|
|
9099
|
-
React__namespace.createElement("path", { fill: "#fff", d: "M0 0h24v24H0z" })))));
|
|
9100
|
-
};
|
|
9101
|
-
|
|
9102
9088
|
var SvgQuoteRight = function (_a) {
|
|
9103
9089
|
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9104
9090
|
return (React__namespace.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),
|
|
@@ -9267,13 +9253,6 @@ var SvgSettings = function (_a) {
|
|
|
9267
9253
|
React__namespace.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" })));
|
|
9268
9254
|
};
|
|
9269
9255
|
|
|
9270
|
-
var SvgShapeGroup = function (_a) {
|
|
9271
|
-
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9272
|
-
return (React__namespace.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),
|
|
9273
|
-
title ? React__namespace.createElement("title", { id: titleId }, title) : null,
|
|
9274
|
-
React__namespace.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" })));
|
|
9275
|
-
};
|
|
9276
|
-
|
|
9277
9256
|
var SvgShare2 = function (_a) {
|
|
9278
9257
|
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9279
9258
|
return (React__namespace.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),
|
|
@@ -10501,7 +10480,6 @@ var Icon = /*#__PURE__*/Object.freeze({
|
|
|
10501
10480
|
Power: SvgPower,
|
|
10502
10481
|
Printer: SvgPrinter,
|
|
10503
10482
|
Process: SvgProcess,
|
|
10504
|
-
ProjectSetting: SvgProjectSetting,
|
|
10505
10483
|
QuoteRight: SvgQuoteRight,
|
|
10506
10484
|
Radio: SvgRadio,
|
|
10507
10485
|
RefreshCcw: SvgRefreshCcw,
|
|
@@ -10521,7 +10499,6 @@ var Icon = /*#__PURE__*/Object.freeze({
|
|
|
10521
10499
|
SendHorFill: SvgSendHorFill,
|
|
10522
10500
|
Server: SvgServer,
|
|
10523
10501
|
Settings: SvgSettings,
|
|
10524
|
-
ShapeGroup: SvgShapeGroup,
|
|
10525
10502
|
Share: SvgShare,
|
|
10526
10503
|
Share2: SvgShare2,
|
|
10527
10504
|
Share3: SvgShare3,
|
|
@@ -19836,17 +19813,20 @@ const isNullOrUndefined$1 = (d) => {
|
|
|
19836
19813
|
const generateUUID = () => {
|
|
19837
19814
|
// Public Domain/MIT
|
|
19838
19815
|
let d = new Date().getTime(); //Timestamp
|
|
19839
|
-
let d2 = (typeof performance !== 'undefined' &&
|
|
19816
|
+
let d2 = (typeof performance !== 'undefined' &&
|
|
19817
|
+
performance.now &&
|
|
19818
|
+
performance.now() * 1000) ||
|
|
19819
|
+
0; //Time in microseconds since page-load or 0 if unsupported
|
|
19840
19820
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
19841
19821
|
let r = Math.random() * 16; //random number between 0 and 16
|
|
19842
19822
|
if (d > 0) {
|
|
19843
19823
|
//Use timestamp until depleted
|
|
19844
|
-
r = (d + r) % 16 | 0;
|
|
19824
|
+
r = ((d + r) % 16) | 0;
|
|
19845
19825
|
d = Math.floor(d / 16);
|
|
19846
19826
|
}
|
|
19847
19827
|
else {
|
|
19848
19828
|
//Use microseconds since page-load if supported
|
|
19849
|
-
r = (d2 + r) % 16 | 0;
|
|
19829
|
+
r = ((d2 + r) % 16) | 0;
|
|
19850
19830
|
d2 = Math.floor(d2 / 16);
|
|
19851
19831
|
}
|
|
19852
19832
|
return (c === 'x' ? r : 0x3).toString(16);
|
|
@@ -19868,12 +19848,16 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2,
|
|
|
19868
19848
|
// eslint-disable-next-line
|
|
19869
19849
|
if (str || str == '0') {
|
|
19870
19850
|
str = str.toString();
|
|
19871
|
-
const value = decimalSeparator !== '.'
|
|
19851
|
+
const value = decimalSeparator !== '.'
|
|
19852
|
+
? str.toString().replaceAll('.', decimalSeparator ?? '')
|
|
19853
|
+
: str;
|
|
19872
19854
|
const arr = value.toString().split(decimalSeparator ?? '', 2);
|
|
19873
19855
|
let flag = value.toString().includes(decimalSeparator ?? '');
|
|
19874
19856
|
if (arr[0].length < 3) {
|
|
19875
19857
|
const intergerArr = haveNegative ? arr[0] : arr[0].replace('-', '');
|
|
19876
|
-
return flag
|
|
19858
|
+
return flag
|
|
19859
|
+
? `${intergerArr}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19860
|
+
: intergerArr;
|
|
19877
19861
|
}
|
|
19878
19862
|
else {
|
|
19879
19863
|
let flagNegative = false;
|
|
@@ -19897,7 +19881,9 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2,
|
|
|
19897
19881
|
if (flagNegative && haveNegative) {
|
|
19898
19882
|
arr[0] = '-'.concat(arr[0]);
|
|
19899
19883
|
}
|
|
19900
|
-
return flag
|
|
19884
|
+
return flag
|
|
19885
|
+
? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19886
|
+
: arr[0];
|
|
19901
19887
|
}
|
|
19902
19888
|
}
|
|
19903
19889
|
else {
|
|
@@ -19920,7 +19906,7 @@ const formatDateTime = (data, format = 'dd/MM/yyyy') => {
|
|
|
19920
19906
|
MM: String(date.getMonth() + 1).padStart(2, '0'),
|
|
19921
19907
|
yyyy: date.getFullYear(),
|
|
19922
19908
|
HH: String(date.getHours()).padStart(2, '0'),
|
|
19923
|
-
mm: String(date.getMinutes()).padStart(2, '0')
|
|
19909
|
+
mm: String(date.getMinutes()).padStart(2, '0'),
|
|
19924
19910
|
};
|
|
19925
19911
|
return format.replace(/dd|DD|MM|yyyy|HH|mm/g, (match) => map[match]);
|
|
19926
19912
|
};
|
|
@@ -19941,7 +19927,7 @@ const FindNodeByPath = (tree, path) => {
|
|
|
19941
19927
|
parent: current,
|
|
19942
19928
|
lastIndex: levels.at(-1),
|
|
19943
19929
|
firstIndex: levels.length === 1 ? levels[0] : -1,
|
|
19944
|
-
node
|
|
19930
|
+
node,
|
|
19945
19931
|
};
|
|
19946
19932
|
};
|
|
19947
19933
|
/**
|
|
@@ -19969,7 +19955,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19969
19955
|
const objHeaderWidthFixLeft = {};
|
|
19970
19956
|
let maxDepth = 0;
|
|
19971
19957
|
// Tính depth tối đa
|
|
19972
|
-
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) =>
|
|
19958
|
+
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) => col.columns?.length ? calculateDepth(col.columns, depth + 1) : depth));
|
|
19973
19959
|
maxDepth = calculateDepth(columns);
|
|
19974
19960
|
let leftTotal = 0;
|
|
19975
19961
|
let rightTotal = 0;
|
|
@@ -20007,7 +19993,8 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20007
19993
|
newCell.numericSettings = { fraction: setting.fraction };
|
|
20008
19994
|
}
|
|
20009
19995
|
}
|
|
20010
|
-
newCell.headerDisplay =
|
|
19996
|
+
newCell.headerDisplay =
|
|
19997
|
+
setting.headerText || (newCell.headerDisplay ?? newCell.headerText);
|
|
20011
19998
|
}
|
|
20012
19999
|
else {
|
|
20013
20000
|
if (newCell.columns?.length) {
|
|
@@ -20034,7 +20021,20 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20034
20021
|
levels[level] = levels[level] || [];
|
|
20035
20022
|
let columns = [...cols];
|
|
20036
20023
|
if (settingColumns?.some((c) => c.sortOrder !== undefined && c.sortOrder !== null)) {
|
|
20037
|
-
columns = columns.sort((a, b) =>
|
|
20024
|
+
columns = columns.sort((a, b) => {
|
|
20025
|
+
const aOrder = a.sortOrder ?? null;
|
|
20026
|
+
const bOrder = b.sortOrder ?? null;
|
|
20027
|
+
if (aOrder === null && bOrder === null) {
|
|
20028
|
+
return 0;
|
|
20029
|
+
}
|
|
20030
|
+
if (aOrder === null) {
|
|
20031
|
+
return 1;
|
|
20032
|
+
}
|
|
20033
|
+
if (bOrder === null) {
|
|
20034
|
+
return -1;
|
|
20035
|
+
}
|
|
20036
|
+
return aOrder - bOrder;
|
|
20037
|
+
});
|
|
20038
20038
|
}
|
|
20039
20039
|
return columns.reduce((colspanSum, col, indexCol) => {
|
|
20040
20040
|
const hasChildren = (col.columns?.length ?? 0) > 0;
|
|
@@ -20043,11 +20043,13 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20043
20043
|
...col,
|
|
20044
20044
|
columns: col.columns ?? [],
|
|
20045
20045
|
colspan,
|
|
20046
|
-
rowspan: hasChildren ? 1 : maxDepth - level
|
|
20046
|
+
rowspan: hasChildren ? 1 : maxDepth - level,
|
|
20047
20047
|
};
|
|
20048
20048
|
levels[level].push(cell);
|
|
20049
20049
|
const headerKey = `${level}-${indexCol}`;
|
|
20050
|
-
if (cell.fixedType === 'left' &&
|
|
20050
|
+
if (cell.fixedType === 'left' &&
|
|
20051
|
+
cell.visible !== false &&
|
|
20052
|
+
cell.isGroup !== true) {
|
|
20051
20053
|
objHeaderWidthFixLeft[headerKey] = leftTotal;
|
|
20052
20054
|
}
|
|
20053
20055
|
if (!hasChildren) {
|
|
@@ -20055,16 +20057,22 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20055
20057
|
const width = cell.width ?? 40;
|
|
20056
20058
|
cell.index = index;
|
|
20057
20059
|
flat.push(cell);
|
|
20058
|
-
if (cell.fixedType === 'left' &&
|
|
20060
|
+
if (cell.fixedType === 'left' &&
|
|
20061
|
+
cell.visible !== false &&
|
|
20062
|
+
cell.isGroup !== true) {
|
|
20059
20063
|
objWidthFixLeft[index] = leftTotal;
|
|
20060
20064
|
leftTotal += width;
|
|
20061
20065
|
}
|
|
20062
|
-
if (cell.fixedType === 'right' &&
|
|
20066
|
+
if (cell.fixedType === 'right' &&
|
|
20067
|
+
cell.visible !== false &&
|
|
20068
|
+
cell.isGroup !== true) {
|
|
20063
20069
|
rightTotal -= width;
|
|
20064
20070
|
objWidthFixRight[index] = rightTotal;
|
|
20065
20071
|
}
|
|
20066
20072
|
}
|
|
20067
|
-
if (cell.fixedType === 'right' &&
|
|
20073
|
+
if (cell.fixedType === 'right' &&
|
|
20074
|
+
cell.visible !== false &&
|
|
20075
|
+
cell.isGroup !== true) {
|
|
20068
20076
|
objHeaderWidthFixRight[headerKey] = rightTotal;
|
|
20069
20077
|
}
|
|
20070
20078
|
return colspanSum + colspan;
|
|
@@ -20075,13 +20083,20 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20075
20083
|
traverse(newColumns);
|
|
20076
20084
|
// Danh sách các cột được hiển thị
|
|
20077
20085
|
// const flatVisble = flat.filter((e) => e.visible !== false)
|
|
20078
|
-
const flatVisbleContent = flat.filter((x) => x.visible !== false &&
|
|
20086
|
+
const flatVisbleContent = flat.filter((x) => x.visible !== false &&
|
|
20087
|
+
x.field !== 'command' &&
|
|
20088
|
+
x.field !== '#' &&
|
|
20089
|
+
x.field !== 'checkbox');
|
|
20079
20090
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột cố định
|
|
20080
20091
|
const lastObjWidthFixLeft = Math.max(...Object.keys(objWidthFixLeft).map(Number), 0);
|
|
20081
20092
|
const fisrtObjWidthFixRight = Math.min(...Object.keys(objWidthFixRight).map(Number), flat.length);
|
|
20082
20093
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột có thể sửa
|
|
20083
20094
|
const indexFirstEdit = flat.findIndex((item) => item.editEnable && item.visible !== false && !item.disabledCondition);
|
|
20084
|
-
const indexLastEdit = flat
|
|
20095
|
+
const indexLastEdit = flat
|
|
20096
|
+
.map((item, idx) => item.editEnable && item.visible !== false && !item.disabledCondition
|
|
20097
|
+
? idx
|
|
20098
|
+
: -1)
|
|
20099
|
+
.reduce((acc, val) => (val > acc ? val : acc), -1);
|
|
20085
20100
|
return {
|
|
20086
20101
|
levels,
|
|
20087
20102
|
flat,
|
|
@@ -20094,7 +20109,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20094
20109
|
objHeaderWidthFixRight,
|
|
20095
20110
|
objHeaderWidthFixLeft,
|
|
20096
20111
|
indexFirstEdit,
|
|
20097
|
-
indexLastEdit
|
|
20112
|
+
indexLastEdit,
|
|
20098
20113
|
};
|
|
20099
20114
|
};
|
|
20100
20115
|
/**
|
|
@@ -20104,7 +20119,10 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20104
20119
|
const isFilterMatch = filters.every((filter) => {
|
|
20105
20120
|
const { key, value, ope } = filter;
|
|
20106
20121
|
const rowValue = row[key];
|
|
20107
|
-
if (rowValue === undefined ||
|
|
20122
|
+
if (rowValue === undefined ||
|
|
20123
|
+
rowValue === null ||
|
|
20124
|
+
value === undefined ||
|
|
20125
|
+
value === null) {
|
|
20108
20126
|
return false;
|
|
20109
20127
|
}
|
|
20110
20128
|
const valStr = String(rowValue).toLowerCase();
|
|
@@ -20137,7 +20155,10 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20137
20155
|
const isSearchMatch = !keyword ||
|
|
20138
20156
|
searchKeys.some((key) => {
|
|
20139
20157
|
const val = row[key];
|
|
20140
|
-
return val
|
|
20158
|
+
return val
|
|
20159
|
+
?.toString()
|
|
20160
|
+
.toLowerCase()
|
|
20161
|
+
.includes(keyword.trim().toLowerCase());
|
|
20141
20162
|
});
|
|
20142
20163
|
return isFilterMatch && isSearchMatch;
|
|
20143
20164
|
};
|
|
@@ -25622,72 +25643,6 @@ function startOfYear(date, options) {
|
|
|
25622
25643
|
return date_;
|
|
25623
25644
|
}
|
|
25624
25645
|
|
|
25625
|
-
/**
|
|
25626
|
-
* The {@link eachYearOfInterval} function options.
|
|
25627
|
-
*/
|
|
25628
|
-
|
|
25629
|
-
/**
|
|
25630
|
-
* The {@link eachYearOfInterval} function result type. It resolves the proper data type.
|
|
25631
|
-
* It uses the first argument date object type, starting from the date argument,
|
|
25632
|
-
* then the start interval date, and finally the end interval date. If
|
|
25633
|
-
* a context function is passed, it uses the context function return type.
|
|
25634
|
-
*/
|
|
25635
|
-
|
|
25636
|
-
/**
|
|
25637
|
-
* @name eachYearOfInterval
|
|
25638
|
-
* @category Interval Helpers
|
|
25639
|
-
* @summary Return the array of yearly timestamps within the specified time interval.
|
|
25640
|
-
*
|
|
25641
|
-
* @description
|
|
25642
|
-
* Return the array of yearly timestamps within the specified time interval.
|
|
25643
|
-
*
|
|
25644
|
-
* @typeParam IntervalType - Interval type.
|
|
25645
|
-
* @typeParam Options - Options type.
|
|
25646
|
-
*
|
|
25647
|
-
* @param interval - The interval.
|
|
25648
|
-
* @param options - An object with options.
|
|
25649
|
-
*
|
|
25650
|
-
* @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
|
|
25651
|
-
*
|
|
25652
|
-
* @example
|
|
25653
|
-
* // Each year between 6 February 2014 and 10 August 2017:
|
|
25654
|
-
* const result = eachYearOfInterval({
|
|
25655
|
-
* start: new Date(2014, 1, 6),
|
|
25656
|
-
* end: new Date(2017, 7, 10)
|
|
25657
|
-
* })
|
|
25658
|
-
* //=> [
|
|
25659
|
-
* // Wed Jan 01 2014 00:00:00,
|
|
25660
|
-
* // Thu Jan 01 2015 00:00:00,
|
|
25661
|
-
* // Fri Jan 01 2016 00:00:00,
|
|
25662
|
-
* // Sun Jan 01 2017 00:00:00
|
|
25663
|
-
* // ]
|
|
25664
|
-
*/
|
|
25665
|
-
function eachYearOfInterval(interval, options) {
|
|
25666
|
-
const { start, end } = normalizeInterval(options?.in, interval);
|
|
25667
|
-
|
|
25668
|
-
let reversed = +start > +end;
|
|
25669
|
-
const endTime = reversed ? +start : +end;
|
|
25670
|
-
const date = reversed ? end : start;
|
|
25671
|
-
date.setHours(0, 0, 0, 0);
|
|
25672
|
-
date.setMonth(0, 1);
|
|
25673
|
-
|
|
25674
|
-
let step = options?.step ?? 1;
|
|
25675
|
-
if (!step) return [];
|
|
25676
|
-
if (step < 0) {
|
|
25677
|
-
step = -step;
|
|
25678
|
-
reversed = !reversed;
|
|
25679
|
-
}
|
|
25680
|
-
|
|
25681
|
-
const dates = [];
|
|
25682
|
-
|
|
25683
|
-
while (+date <= endTime) {
|
|
25684
|
-
dates.push(constructFrom(start, date));
|
|
25685
|
-
date.setFullYear(date.getFullYear() + step);
|
|
25686
|
-
}
|
|
25687
|
-
|
|
25688
|
-
return reversed ? dates.reverse() : dates;
|
|
25689
|
-
}
|
|
25690
|
-
|
|
25691
25646
|
/**
|
|
25692
25647
|
* The {@link endOfWeek} function options.
|
|
25693
25648
|
*/
|
|
@@ -26396,7 +26351,7 @@ const match = {
|
|
|
26396
26351
|
* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
|
|
26397
26352
|
* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
|
|
26398
26353
|
*/
|
|
26399
|
-
const enUS
|
|
26354
|
+
const enUS = {
|
|
26400
26355
|
code: "en-US",
|
|
26401
26356
|
formatDistance: formatDistance,
|
|
26402
26357
|
formatLong: formatLong,
|
|
@@ -27913,7 +27868,7 @@ const unescapedLatinCharacterRegExp$1 = /[a-zA-Z]/;
|
|
|
27913
27868
|
*/
|
|
27914
27869
|
function format(date, formatStr, options) {
|
|
27915
27870
|
const defaultOptions = getDefaultOptions$1();
|
|
27916
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS
|
|
27871
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
27917
27872
|
|
|
27918
27873
|
const firstWeekContainsDate =
|
|
27919
27874
|
options?.firstWeekContainsDate ??
|
|
@@ -30606,7 +30561,7 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
30606
30561
|
function parse(dateStr, formatStr, referenceDate, options) {
|
|
30607
30562
|
const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);
|
|
30608
30563
|
const defaultOptions = getDefaultOptions();
|
|
30609
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS
|
|
30564
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
30610
30565
|
|
|
30611
30566
|
const firstWeekContainsDate =
|
|
30612
30567
|
options?.firstWeekContainsDate ??
|
|
@@ -31412,69 +31367,6 @@ function endOfBroadcastWeek(date, dateLib) {
|
|
|
31412
31367
|
return endDate;
|
|
31413
31368
|
}
|
|
31414
31369
|
|
|
31415
|
-
/** English (United States) locale extended with DayPicker-specific translations. */
|
|
31416
|
-
const enUS = {
|
|
31417
|
-
...enUS$1,
|
|
31418
|
-
labels: {
|
|
31419
|
-
labelDayButton: (date, modifiers, options, dateLib) => {
|
|
31420
|
-
let formatDate;
|
|
31421
|
-
if (dateLib && typeof dateLib.format === "function") {
|
|
31422
|
-
formatDate = dateLib.format.bind(dateLib);
|
|
31423
|
-
}
|
|
31424
|
-
else {
|
|
31425
|
-
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31426
|
-
}
|
|
31427
|
-
let label = formatDate(date, "PPPP");
|
|
31428
|
-
if (modifiers.today)
|
|
31429
|
-
label = `Today, ${label}`;
|
|
31430
|
-
if (modifiers.selected)
|
|
31431
|
-
label = `${label}, selected`;
|
|
31432
|
-
return label;
|
|
31433
|
-
},
|
|
31434
|
-
labelMonthDropdown: "Choose the Month",
|
|
31435
|
-
labelNext: "Go to the Next Month",
|
|
31436
|
-
labelPrevious: "Go to the Previous Month",
|
|
31437
|
-
labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
|
|
31438
|
-
labelYearDropdown: "Choose the Year",
|
|
31439
|
-
labelGrid: (date, options, dateLib) => {
|
|
31440
|
-
let formatDate;
|
|
31441
|
-
if (dateLib && typeof dateLib.format === "function") {
|
|
31442
|
-
formatDate = dateLib.format.bind(dateLib);
|
|
31443
|
-
}
|
|
31444
|
-
else {
|
|
31445
|
-
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31446
|
-
}
|
|
31447
|
-
return formatDate(date, "LLLL yyyy");
|
|
31448
|
-
},
|
|
31449
|
-
labelGridcell: (date, modifiers, options, dateLib) => {
|
|
31450
|
-
let formatDate;
|
|
31451
|
-
if (dateLib && typeof dateLib.format === "function") {
|
|
31452
|
-
formatDate = dateLib.format.bind(dateLib);
|
|
31453
|
-
}
|
|
31454
|
-
else {
|
|
31455
|
-
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31456
|
-
}
|
|
31457
|
-
let label = formatDate(date, "PPPP");
|
|
31458
|
-
if (modifiers?.today) {
|
|
31459
|
-
label = `Today, ${label}`;
|
|
31460
|
-
}
|
|
31461
|
-
return label;
|
|
31462
|
-
},
|
|
31463
|
-
labelNav: "Navigation bar",
|
|
31464
|
-
labelWeekNumberHeader: "Week Number",
|
|
31465
|
-
labelWeekday: (date, options, dateLib) => {
|
|
31466
|
-
let formatDate;
|
|
31467
|
-
if (dateLib && typeof dateLib.format === "function") {
|
|
31468
|
-
formatDate = dateLib.format.bind(dateLib);
|
|
31469
|
-
}
|
|
31470
|
-
else {
|
|
31471
|
-
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31472
|
-
}
|
|
31473
|
-
return formatDate(date, "cccc");
|
|
31474
|
-
},
|
|
31475
|
-
},
|
|
31476
|
-
};
|
|
31477
|
-
|
|
31478
31370
|
/**
|
|
31479
31371
|
* A wrapper class around [date-fns](http://date-fns.org) that provides utility
|
|
31480
31372
|
* methods for date manipulation and formatting.
|
|
@@ -31613,31 +31505,6 @@ class DateLib {
|
|
|
31613
31505
|
? this.overrides.eachMonthOfInterval(interval)
|
|
31614
31506
|
: eachMonthOfInterval(interval);
|
|
31615
31507
|
};
|
|
31616
|
-
/**
|
|
31617
|
-
* Returns the years between the given dates.
|
|
31618
|
-
*
|
|
31619
|
-
* @since 9.11.1
|
|
31620
|
-
* @param interval The interval to get the years for.
|
|
31621
|
-
* @returns The array of years in the interval.
|
|
31622
|
-
*/
|
|
31623
|
-
this.eachYearOfInterval = (interval) => {
|
|
31624
|
-
const years = this.overrides?.eachYearOfInterval
|
|
31625
|
-
? this.overrides.eachYearOfInterval(interval)
|
|
31626
|
-
: eachYearOfInterval(interval);
|
|
31627
|
-
// Remove duplicates that may happen across DST transitions (e.g., "America/Sao_Paulo")
|
|
31628
|
-
// See https://github.com/date-fns/tz/issues/72
|
|
31629
|
-
const uniqueYears = new Set(years.map((d) => this.getYear(d)));
|
|
31630
|
-
if (uniqueYears.size === years.length) {
|
|
31631
|
-
// No duplicates, return as is
|
|
31632
|
-
return years;
|
|
31633
|
-
}
|
|
31634
|
-
// Rebuild the array to ensure one date per year
|
|
31635
|
-
const yearsArray = [];
|
|
31636
|
-
uniqueYears.forEach((y) => {
|
|
31637
|
-
yearsArray.push(new Date(y, 0, 1));
|
|
31638
|
-
});
|
|
31639
|
-
return yearsArray;
|
|
31640
|
-
};
|
|
31641
31508
|
/**
|
|
31642
31509
|
* Returns the end of the broadcast week for the given date.
|
|
31643
31510
|
*
|
|
@@ -31976,63 +31843,7 @@ class DateLib {
|
|
|
31976
31843
|
formatNumber(value) {
|
|
31977
31844
|
return this.replaceDigits(value.toString());
|
|
31978
31845
|
}
|
|
31979
|
-
|
|
31980
|
-
* Returns the preferred ordering for month and year labels for the current
|
|
31981
|
-
* locale.
|
|
31982
|
-
*/
|
|
31983
|
-
getMonthYearOrder() {
|
|
31984
|
-
const code = this.options.locale?.code;
|
|
31985
|
-
if (!code) {
|
|
31986
|
-
return "month-first";
|
|
31987
|
-
}
|
|
31988
|
-
return DateLib.yearFirstLocales.has(code) ? "year-first" : "month-first";
|
|
31989
|
-
}
|
|
31990
|
-
/**
|
|
31991
|
-
* Formats the month/year pair respecting locale conventions.
|
|
31992
|
-
*
|
|
31993
|
-
* @since 9.11.0
|
|
31994
|
-
*/
|
|
31995
|
-
formatMonthYear(date) {
|
|
31996
|
-
const { locale, timeZone, numerals } = this.options;
|
|
31997
|
-
const localeCode = locale?.code;
|
|
31998
|
-
if (localeCode && DateLib.yearFirstLocales.has(localeCode)) {
|
|
31999
|
-
try {
|
|
32000
|
-
const intl = new Intl.DateTimeFormat(localeCode, {
|
|
32001
|
-
month: "long",
|
|
32002
|
-
year: "numeric",
|
|
32003
|
-
timeZone,
|
|
32004
|
-
numberingSystem: numerals,
|
|
32005
|
-
});
|
|
32006
|
-
const formatted = intl.format(date);
|
|
32007
|
-
return formatted;
|
|
32008
|
-
}
|
|
32009
|
-
catch {
|
|
32010
|
-
// Fallback to date-fns formatting below.
|
|
32011
|
-
}
|
|
32012
|
-
}
|
|
32013
|
-
const pattern = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
32014
|
-
return this.format(date, pattern);
|
|
32015
|
-
}
|
|
32016
|
-
}
|
|
32017
|
-
DateLib.yearFirstLocales = new Set([
|
|
32018
|
-
"eu",
|
|
32019
|
-
"hu",
|
|
32020
|
-
"ja",
|
|
32021
|
-
"ja-Hira",
|
|
32022
|
-
"ja-JP",
|
|
32023
|
-
"ko",
|
|
32024
|
-
"ko-KR",
|
|
32025
|
-
"lt",
|
|
32026
|
-
"lt-LT",
|
|
32027
|
-
"lv",
|
|
32028
|
-
"lv-LV",
|
|
32029
|
-
"mn",
|
|
32030
|
-
"mn-MN",
|
|
32031
|
-
"zh",
|
|
32032
|
-
"zh-CN",
|
|
32033
|
-
"zh-HK",
|
|
32034
|
-
"zh-TW",
|
|
32035
|
-
]);
|
|
31846
|
+
}
|
|
32036
31847
|
/**
|
|
32037
31848
|
* The default date library with English locale.
|
|
32038
31849
|
*
|
|
@@ -32053,9 +31864,6 @@ class CalendarDay {
|
|
|
32053
31864
|
this.displayMonth = displayMonth;
|
|
32054
31865
|
this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
|
|
32055
31866
|
this.dateLib = dateLib;
|
|
32056
|
-
this.isoDate = dateLib.format(date, "yyyy-MM-dd");
|
|
32057
|
-
this.displayMonthId = dateLib.format(displayMonth, "yyyy-MM");
|
|
32058
|
-
this.dateMonthId = dateLib.format(date, "yyyy-MM");
|
|
32059
31867
|
}
|
|
32060
31868
|
/**
|
|
32061
31869
|
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
@@ -32231,7 +32039,7 @@ var UI;
|
|
|
32231
32039
|
/** The dropdown with the years. */
|
|
32232
32040
|
UI["YearsDropdown"] = "years_dropdown";
|
|
32233
32041
|
})(UI || (UI = {}));
|
|
32234
|
-
/** Enum representing flags for the {@link UI
|
|
32042
|
+
/** Enum representing flags for the {@link UI.Day} element. */
|
|
32235
32043
|
var DayFlag;
|
|
32236
32044
|
(function (DayFlag) {
|
|
32237
32045
|
/** The day is disabled. */
|
|
@@ -32246,8 +32054,8 @@ var DayFlag;
|
|
|
32246
32054
|
DayFlag["today"] = "today";
|
|
32247
32055
|
})(DayFlag || (DayFlag = {}));
|
|
32248
32056
|
/**
|
|
32249
|
-
* Enum representing selection states that can be applied to the
|
|
32250
|
-
*
|
|
32057
|
+
* Enum representing selection states that can be applied to the {@link UI.Day}
|
|
32058
|
+
* element in selection mode.
|
|
32251
32059
|
*/
|
|
32252
32060
|
var SelectionState;
|
|
32253
32061
|
(function (SelectionState) {
|
|
@@ -32697,7 +32505,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32697
32505
|
return isSameDay(date, matcher);
|
|
32698
32506
|
}
|
|
32699
32507
|
if (isDatesArray(matcher, dateLib)) {
|
|
32700
|
-
return matcher.
|
|
32508
|
+
return matcher.includes(date);
|
|
32701
32509
|
}
|
|
32702
32510
|
if (isDateRange(matcher)) {
|
|
32703
32511
|
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
@@ -32748,7 +32556,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32748
32556
|
* @returns A function that retrieves the modifiers for a given `CalendarDay`.
|
|
32749
32557
|
*/
|
|
32750
32558
|
function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
32751
|
-
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today
|
|
32559
|
+
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today, } = props;
|
|
32752
32560
|
const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter, } = dateLib;
|
|
32753
32561
|
const computedNavStart = navStart && startOfMonth(navStart);
|
|
32754
32562
|
const computedNavEnd = navEnd && endOfMonth(navEnd);
|
|
@@ -32772,7 +32580,7 @@ function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
|
32772
32580
|
// Broadcast calendar will show outside days as default
|
|
32773
32581
|
(!broadcastCalendar && !showOutsideDays && isOutside) ||
|
|
32774
32582
|
(broadcastCalendar && showOutsideDays === false && isOutside);
|
|
32775
|
-
const isToday = isSameDay(date, today);
|
|
32583
|
+
const isToday = isSameDay(date, today ?? dateLib.today());
|
|
32776
32584
|
if (isOutside)
|
|
32777
32585
|
internalModifiersMap.outside.push(day);
|
|
32778
32586
|
if (isDisabled)
|
|
@@ -32931,7 +32739,7 @@ function getDefaultClassNames() {
|
|
|
32931
32739
|
/**
|
|
32932
32740
|
* Formats the caption of the month.
|
|
32933
32741
|
*
|
|
32934
|
-
* @defaultValue
|
|
32742
|
+
* @defaultValue `LLLL y` (e.g., "November 2022").
|
|
32935
32743
|
* @param month The date representing the month.
|
|
32936
32744
|
* @param options Configuration options for the date library.
|
|
32937
32745
|
* @param dateLib The date library to use for formatting. If not provided, a new
|
|
@@ -32941,8 +32749,7 @@ function getDefaultClassNames() {
|
|
|
32941
32749
|
* @see https://daypicker.dev/docs/translation#custom-formatters
|
|
32942
32750
|
*/
|
|
32943
32751
|
function formatCaption(month, options, dateLib) {
|
|
32944
|
-
|
|
32945
|
-
return lib.formatMonthYear(month);
|
|
32752
|
+
return (dateLib ?? new DateLib(options)).format(month, "LLLL y");
|
|
32946
32753
|
}
|
|
32947
32754
|
/**
|
|
32948
32755
|
* @private
|
|
@@ -33082,6 +32889,127 @@ function getFormatters(customFormatters) {
|
|
|
33082
32889
|
};
|
|
33083
32890
|
}
|
|
33084
32891
|
|
|
32892
|
+
/**
|
|
32893
|
+
* Returns the months to show in the dropdown.
|
|
32894
|
+
*
|
|
32895
|
+
* This function generates a list of months for the current year, formatted
|
|
32896
|
+
* using the provided formatter, and determines whether each month should be
|
|
32897
|
+
* disabled based on the navigation range.
|
|
32898
|
+
*
|
|
32899
|
+
* @param displayMonth The currently displayed month.
|
|
32900
|
+
* @param navStart The start date for navigation.
|
|
32901
|
+
* @param navEnd The end date for navigation.
|
|
32902
|
+
* @param formatters The formatters to use for formatting the month labels.
|
|
32903
|
+
* @param dateLib The date library to use for date manipulation.
|
|
32904
|
+
* @returns An array of dropdown options representing the months, or `undefined`
|
|
32905
|
+
* if no months are available.
|
|
32906
|
+
*/
|
|
32907
|
+
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
32908
|
+
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
32909
|
+
const months = eachMonthOfInterval({
|
|
32910
|
+
start: startOfYear(displayMonth),
|
|
32911
|
+
end: endOfYear(displayMonth),
|
|
32912
|
+
});
|
|
32913
|
+
const options = months.map((month) => {
|
|
32914
|
+
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
32915
|
+
const value = getMonth(month);
|
|
32916
|
+
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
32917
|
+
(navEnd && month > startOfMonth(navEnd)) ||
|
|
32918
|
+
false;
|
|
32919
|
+
return { value, label, disabled };
|
|
32920
|
+
});
|
|
32921
|
+
return options;
|
|
32922
|
+
}
|
|
32923
|
+
|
|
32924
|
+
/**
|
|
32925
|
+
* Returns the computed style for a day based on its modifiers.
|
|
32926
|
+
*
|
|
32927
|
+
* This function merges the base styles for the day with any styles associated
|
|
32928
|
+
* with active modifiers.
|
|
32929
|
+
*
|
|
32930
|
+
* @param dayModifiers The modifiers applied to the day.
|
|
32931
|
+
* @param styles The base styles for the calendar elements.
|
|
32932
|
+
* @param modifiersStyles The styles associated with specific modifiers.
|
|
32933
|
+
* @returns The computed style for the day.
|
|
32934
|
+
*/
|
|
32935
|
+
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
32936
|
+
let style = { ...styles?.[UI.Day] };
|
|
32937
|
+
Object.entries(dayModifiers)
|
|
32938
|
+
.filter(([, active]) => active === true)
|
|
32939
|
+
.forEach(([modifier]) => {
|
|
32940
|
+
style = {
|
|
32941
|
+
...style,
|
|
32942
|
+
...modifiersStyles?.[modifier],
|
|
32943
|
+
};
|
|
32944
|
+
});
|
|
32945
|
+
return style;
|
|
32946
|
+
}
|
|
32947
|
+
|
|
32948
|
+
/**
|
|
32949
|
+
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
32950
|
+
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
32951
|
+
*
|
|
32952
|
+
* @param dateLib The date library to use for date manipulation.
|
|
32953
|
+
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
32954
|
+
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
32955
|
+
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
32956
|
+
* @returns An array of 7 dates representing the weekdays.
|
|
32957
|
+
*/
|
|
32958
|
+
function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {
|
|
32959
|
+
const today = dateLib.today();
|
|
32960
|
+
const start = broadcastCalendar
|
|
32961
|
+
? dateLib.startOfBroadcastWeek(today, dateLib)
|
|
32962
|
+
: ISOWeek
|
|
32963
|
+
? dateLib.startOfISOWeek(today)
|
|
32964
|
+
: dateLib.startOfWeek(today);
|
|
32965
|
+
const days = [];
|
|
32966
|
+
for (let i = 0; i < 7; i++) {
|
|
32967
|
+
const day = dateLib.addDays(start, i);
|
|
32968
|
+
days.push(day);
|
|
32969
|
+
}
|
|
32970
|
+
return days;
|
|
32971
|
+
}
|
|
32972
|
+
|
|
32973
|
+
/**
|
|
32974
|
+
* Returns the years to display in the dropdown.
|
|
32975
|
+
*
|
|
32976
|
+
* This function generates a list of years between the navigation start and end
|
|
32977
|
+
* dates, formatted using the provided formatter.
|
|
32978
|
+
*
|
|
32979
|
+
* @param navStart The start date for navigation.
|
|
32980
|
+
* @param navEnd The end date for navigation.
|
|
32981
|
+
* @param formatters The formatters to use for formatting the year labels.
|
|
32982
|
+
* @param dateLib The date library to use for date manipulation.
|
|
32983
|
+
* @param reverse If true, reverses the order of the years (descending).
|
|
32984
|
+
* @returns An array of dropdown options representing the years, or `undefined`
|
|
32985
|
+
* if `navStart` or `navEnd` is not provided.
|
|
32986
|
+
*/
|
|
32987
|
+
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
32988
|
+
if (!navStart)
|
|
32989
|
+
return undefined;
|
|
32990
|
+
if (!navEnd)
|
|
32991
|
+
return undefined;
|
|
32992
|
+
const { startOfYear, endOfYear, addYears, getYear, isBefore, isSameYear } = dateLib;
|
|
32993
|
+
const firstNavYear = startOfYear(navStart);
|
|
32994
|
+
const lastNavYear = endOfYear(navEnd);
|
|
32995
|
+
const years = [];
|
|
32996
|
+
let year = firstNavYear;
|
|
32997
|
+
while (isBefore(year, lastNavYear) || isSameYear(year, lastNavYear)) {
|
|
32998
|
+
years.push(year);
|
|
32999
|
+
year = addYears(year, 1);
|
|
33000
|
+
}
|
|
33001
|
+
if (reverse)
|
|
33002
|
+
years.reverse();
|
|
33003
|
+
return years.map((year) => {
|
|
33004
|
+
const label = formatters.formatYearDropdown(year, dateLib);
|
|
33005
|
+
return {
|
|
33006
|
+
value: getYear(year),
|
|
33007
|
+
label,
|
|
33008
|
+
disabled: false,
|
|
33009
|
+
};
|
|
33010
|
+
});
|
|
33011
|
+
}
|
|
33012
|
+
|
|
33085
33013
|
/**
|
|
33086
33014
|
* Generates the ARIA label for a day button.
|
|
33087
33015
|
*
|
|
@@ -33115,7 +33043,7 @@ const labelDay = labelDayButton;
|
|
|
33115
33043
|
* Generates the ARIA label for the month grid, which is announced when entering
|
|
33116
33044
|
* the grid.
|
|
33117
33045
|
*
|
|
33118
|
-
* @defaultValue
|
|
33046
|
+
* @defaultValue `LLLL y` (e.g., "November 2022").
|
|
33119
33047
|
* @param date - The date representing the month.
|
|
33120
33048
|
* @param options - Optional configuration for the date formatting library.
|
|
33121
33049
|
* @param dateLib - An optional instance of the date formatting library.
|
|
@@ -33124,8 +33052,7 @@ const labelDay = labelDayButton;
|
|
|
33124
33052
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
33125
33053
|
*/
|
|
33126
33054
|
function labelGrid(date, options, dateLib) {
|
|
33127
|
-
|
|
33128
|
-
return lib.formatMonthYear(date);
|
|
33055
|
+
return (dateLib ?? new DateLib(options)).format(date, "LLLL y");
|
|
33129
33056
|
}
|
|
33130
33057
|
/**
|
|
33131
33058
|
* @ignore
|
|
@@ -33177,7 +33104,6 @@ function labelNav() {
|
|
|
33177
33104
|
return "";
|
|
33178
33105
|
}
|
|
33179
33106
|
|
|
33180
|
-
const defaultLabel = "Go to the Next Month";
|
|
33181
33107
|
/**
|
|
33182
33108
|
* Generates the ARIA label for the "next month" button.
|
|
33183
33109
|
*
|
|
@@ -33188,8 +33114,8 @@ const defaultLabel = "Go to the Next Month";
|
|
|
33188
33114
|
* @group Labels
|
|
33189
33115
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
33190
33116
|
*/
|
|
33191
|
-
function labelNext(_month
|
|
33192
|
-
return
|
|
33117
|
+
function labelNext(_month) {
|
|
33118
|
+
return "Go to the Next Month";
|
|
33193
33119
|
}
|
|
33194
33120
|
|
|
33195
33121
|
/**
|
|
@@ -33278,316 +33204,6 @@ var defaultLabels = /*#__PURE__*/Object.freeze({
|
|
|
33278
33204
|
labelYearDropdown: labelYearDropdown
|
|
33279
33205
|
});
|
|
33280
33206
|
|
|
33281
|
-
const resolveLabel = (defaultLabel, customLabel, localeLabel) => {
|
|
33282
|
-
if (customLabel)
|
|
33283
|
-
return customLabel;
|
|
33284
|
-
if (localeLabel) {
|
|
33285
|
-
return (typeof localeLabel === "function"
|
|
33286
|
-
? localeLabel
|
|
33287
|
-
: (..._args) => localeLabel);
|
|
33288
|
-
}
|
|
33289
|
-
return defaultLabel;
|
|
33290
|
-
};
|
|
33291
|
-
/**
|
|
33292
|
-
* Merges custom labels from the props with the default labels.
|
|
33293
|
-
*
|
|
33294
|
-
* When available, uses the locale-provided translation for `labelNext`.
|
|
33295
|
-
*
|
|
33296
|
-
* @param customLabels The custom labels provided in the DayPicker props.
|
|
33297
|
-
* @param options Options from the date library, used to resolve locale
|
|
33298
|
-
* translations.
|
|
33299
|
-
* @returns The merged labels object with locale-aware defaults.
|
|
33300
|
-
*/
|
|
33301
|
-
function getLabels(customLabels, options) {
|
|
33302
|
-
const localeLabels = options.locale?.labels ?? {};
|
|
33303
|
-
return {
|
|
33304
|
-
...defaultLabels,
|
|
33305
|
-
...(customLabels ?? {}),
|
|
33306
|
-
labelDayButton: resolveLabel(labelDayButton, customLabels?.labelDayButton, localeLabels.labelDayButton),
|
|
33307
|
-
labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels?.labelMonthDropdown, localeLabels.labelMonthDropdown),
|
|
33308
|
-
labelNext: resolveLabel(labelNext, customLabels?.labelNext, localeLabels.labelNext),
|
|
33309
|
-
labelPrevious: resolveLabel(labelPrevious, customLabels?.labelPrevious, localeLabels.labelPrevious),
|
|
33310
|
-
labelWeekNumber: resolveLabel(labelWeekNumber, customLabels?.labelWeekNumber, localeLabels.labelWeekNumber),
|
|
33311
|
-
labelYearDropdown: resolveLabel(labelYearDropdown, customLabels?.labelYearDropdown, localeLabels.labelYearDropdown),
|
|
33312
|
-
labelGrid: resolveLabel(labelGrid, customLabels?.labelGrid, localeLabels.labelGrid),
|
|
33313
|
-
labelGridcell: resolveLabel(labelGridcell, customLabels?.labelGridcell, localeLabels.labelGridcell),
|
|
33314
|
-
labelNav: resolveLabel(labelNav, customLabels?.labelNav, localeLabels.labelNav),
|
|
33315
|
-
labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels?.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
|
|
33316
|
-
labelWeekday: resolveLabel(labelWeekday, customLabels?.labelWeekday, localeLabels.labelWeekday),
|
|
33317
|
-
};
|
|
33318
|
-
}
|
|
33319
|
-
|
|
33320
|
-
/**
|
|
33321
|
-
* Returns the months to show in the dropdown.
|
|
33322
|
-
*
|
|
33323
|
-
* This function generates a list of months for the current year, formatted
|
|
33324
|
-
* using the provided formatter, and determines whether each month should be
|
|
33325
|
-
* disabled based on the navigation range.
|
|
33326
|
-
*
|
|
33327
|
-
* @param displayMonth The currently displayed month.
|
|
33328
|
-
* @param navStart The start date for navigation.
|
|
33329
|
-
* @param navEnd The end date for navigation.
|
|
33330
|
-
* @param formatters The formatters to use for formatting the month labels.
|
|
33331
|
-
* @param dateLib The date library to use for date manipulation.
|
|
33332
|
-
* @returns An array of dropdown options representing the months, or `undefined`
|
|
33333
|
-
* if no months are available.
|
|
33334
|
-
*/
|
|
33335
|
-
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
33336
|
-
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
33337
|
-
const months = eachMonthOfInterval({
|
|
33338
|
-
start: startOfYear(displayMonth),
|
|
33339
|
-
end: endOfYear(displayMonth),
|
|
33340
|
-
});
|
|
33341
|
-
const options = months.map((month) => {
|
|
33342
|
-
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
33343
|
-
const value = getMonth(month);
|
|
33344
|
-
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
33345
|
-
(navEnd && month > startOfMonth(navEnd)) ||
|
|
33346
|
-
false;
|
|
33347
|
-
return { value, label, disabled };
|
|
33348
|
-
});
|
|
33349
|
-
return options;
|
|
33350
|
-
}
|
|
33351
|
-
|
|
33352
|
-
/**
|
|
33353
|
-
* Returns the computed style for a day based on its modifiers.
|
|
33354
|
-
*
|
|
33355
|
-
* This function merges the base styles for the day with any styles associated
|
|
33356
|
-
* with active modifiers.
|
|
33357
|
-
*
|
|
33358
|
-
* @param dayModifiers The modifiers applied to the day.
|
|
33359
|
-
* @param styles The base styles for the calendar elements.
|
|
33360
|
-
* @param modifiersStyles The styles associated with specific modifiers.
|
|
33361
|
-
* @returns The computed style for the day.
|
|
33362
|
-
*/
|
|
33363
|
-
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
33364
|
-
let style = { ...styles?.[UI.Day] };
|
|
33365
|
-
Object.entries(dayModifiers)
|
|
33366
|
-
.filter(([, active]) => active === true)
|
|
33367
|
-
.forEach(([modifier]) => {
|
|
33368
|
-
style = {
|
|
33369
|
-
...style,
|
|
33370
|
-
...modifiersStyles?.[modifier],
|
|
33371
|
-
};
|
|
33372
|
-
});
|
|
33373
|
-
return style;
|
|
33374
|
-
}
|
|
33375
|
-
|
|
33376
|
-
/**
|
|
33377
|
-
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
33378
|
-
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
33379
|
-
*
|
|
33380
|
-
* @param dateLib The date library to use for date manipulation.
|
|
33381
|
-
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
33382
|
-
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
33383
|
-
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
33384
|
-
* @returns An array of 7 dates representing the weekdays.
|
|
33385
|
-
*/
|
|
33386
|
-
function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
|
|
33387
|
-
const referenceToday = today ?? dateLib.today();
|
|
33388
|
-
const start = broadcastCalendar
|
|
33389
|
-
? dateLib.startOfBroadcastWeek(referenceToday, dateLib)
|
|
33390
|
-
: ISOWeek
|
|
33391
|
-
? dateLib.startOfISOWeek(referenceToday)
|
|
33392
|
-
: dateLib.startOfWeek(referenceToday);
|
|
33393
|
-
const days = [];
|
|
33394
|
-
for (let i = 0; i < 7; i++) {
|
|
33395
|
-
const day = dateLib.addDays(start, i);
|
|
33396
|
-
days.push(day);
|
|
33397
|
-
}
|
|
33398
|
-
return days;
|
|
33399
|
-
}
|
|
33400
|
-
|
|
33401
|
-
/**
|
|
33402
|
-
* Returns the years to display in the dropdown.
|
|
33403
|
-
*
|
|
33404
|
-
* This function generates a list of years between the navigation start and end
|
|
33405
|
-
* dates, formatted using the provided formatter.
|
|
33406
|
-
*
|
|
33407
|
-
* @param navStart The start date for navigation.
|
|
33408
|
-
* @param navEnd The end date for navigation.
|
|
33409
|
-
* @param formatters The formatters to use for formatting the year labels.
|
|
33410
|
-
* @param dateLib The date library to use for date manipulation.
|
|
33411
|
-
* @param reverse If true, reverses the order of the years (descending).
|
|
33412
|
-
* @returns An array of dropdown options representing the years, or `undefined`
|
|
33413
|
-
* if `navStart` or `navEnd` is not provided.
|
|
33414
|
-
*/
|
|
33415
|
-
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
33416
|
-
if (!navStart)
|
|
33417
|
-
return undefined;
|
|
33418
|
-
if (!navEnd)
|
|
33419
|
-
return undefined;
|
|
33420
|
-
const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
|
|
33421
|
-
const firstNavYear = startOfYear(navStart);
|
|
33422
|
-
const lastNavYear = endOfYear(navEnd);
|
|
33423
|
-
const years = eachYearOfInterval({ start: firstNavYear, end: lastNavYear });
|
|
33424
|
-
if (reverse)
|
|
33425
|
-
years.reverse();
|
|
33426
|
-
return years.map((year) => {
|
|
33427
|
-
const label = formatters.formatYearDropdown(year, dateLib);
|
|
33428
|
-
return {
|
|
33429
|
-
value: getYear(year),
|
|
33430
|
-
label,
|
|
33431
|
-
disabled: false,
|
|
33432
|
-
};
|
|
33433
|
-
});
|
|
33434
|
-
}
|
|
33435
|
-
|
|
33436
|
-
/**
|
|
33437
|
-
* Creates `dateLib` overrides that keep all calendar math at noon in the target
|
|
33438
|
-
* time zone. This avoids second-level offset changes (e.g., historical zones
|
|
33439
|
-
* with +03:41:12) from pushing dates backward across midnight.
|
|
33440
|
-
*/
|
|
33441
|
-
function createNoonOverrides(timeZone, options = {}) {
|
|
33442
|
-
const { weekStartsOn, locale } = options;
|
|
33443
|
-
const fallbackWeekStartsOn = (weekStartsOn ??
|
|
33444
|
-
locale?.options?.weekStartsOn ??
|
|
33445
|
-
0);
|
|
33446
|
-
// Keep all internal math anchored at noon in the target zone to avoid
|
|
33447
|
-
// historical second-level offsets from crossing midnight.
|
|
33448
|
-
const toNoonTZDate = (date) => {
|
|
33449
|
-
const normalizedDate = typeof date === "number" || typeof date === "string"
|
|
33450
|
-
? new Date(date)
|
|
33451
|
-
: date;
|
|
33452
|
-
return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
|
|
33453
|
-
};
|
|
33454
|
-
// Convert a value into a host `Date` that represents the same calendar day
|
|
33455
|
-
// as the target-zone noon. This is useful for helpers (e.g., date-fns week
|
|
33456
|
-
// utilities) that expect local `Date` instances rather than `TZDate`s.
|
|
33457
|
-
const toCalendarDate = (date) => {
|
|
33458
|
-
const zoned = toNoonTZDate(date);
|
|
33459
|
-
return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
|
|
33460
|
-
};
|
|
33461
|
-
return {
|
|
33462
|
-
today: () => {
|
|
33463
|
-
return toNoonTZDate(TZDate.tz(timeZone));
|
|
33464
|
-
},
|
|
33465
|
-
newDate: (year, monthIndex, date) => {
|
|
33466
|
-
return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
|
|
33467
|
-
},
|
|
33468
|
-
startOfDay: (date) => {
|
|
33469
|
-
return toNoonTZDate(date);
|
|
33470
|
-
},
|
|
33471
|
-
startOfWeek: (date, options) => {
|
|
33472
|
-
const base = toNoonTZDate(date);
|
|
33473
|
-
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33474
|
-
fallbackWeekStartsOn);
|
|
33475
|
-
const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
|
|
33476
|
-
base.setDate(base.getDate() - diff);
|
|
33477
|
-
return base;
|
|
33478
|
-
},
|
|
33479
|
-
startOfISOWeek: (date) => {
|
|
33480
|
-
const base = toNoonTZDate(date);
|
|
33481
|
-
const diff = (base.getDay() - 1 + 7) % 7;
|
|
33482
|
-
base.setDate(base.getDate() - diff);
|
|
33483
|
-
return base;
|
|
33484
|
-
},
|
|
33485
|
-
startOfMonth: (date) => {
|
|
33486
|
-
const base = toNoonTZDate(date);
|
|
33487
|
-
base.setDate(1);
|
|
33488
|
-
return base;
|
|
33489
|
-
},
|
|
33490
|
-
startOfYear: (date) => {
|
|
33491
|
-
const base = toNoonTZDate(date);
|
|
33492
|
-
base.setMonth(0, 1);
|
|
33493
|
-
return base;
|
|
33494
|
-
},
|
|
33495
|
-
endOfWeek: (date, options) => {
|
|
33496
|
-
const base = toNoonTZDate(date);
|
|
33497
|
-
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33498
|
-
fallbackWeekStartsOn);
|
|
33499
|
-
const endDow = (weekStartsOnValue + 6) % 7;
|
|
33500
|
-
const diff = (endDow - base.getDay() + 7) % 7;
|
|
33501
|
-
base.setDate(base.getDate() + diff);
|
|
33502
|
-
return base;
|
|
33503
|
-
},
|
|
33504
|
-
endOfISOWeek: (date) => {
|
|
33505
|
-
const base = toNoonTZDate(date);
|
|
33506
|
-
const diff = (7 - base.getDay()) % 7;
|
|
33507
|
-
base.setDate(base.getDate() + diff);
|
|
33508
|
-
return base;
|
|
33509
|
-
},
|
|
33510
|
-
endOfMonth: (date) => {
|
|
33511
|
-
const base = toNoonTZDate(date);
|
|
33512
|
-
base.setMonth(base.getMonth() + 1, 0);
|
|
33513
|
-
return base;
|
|
33514
|
-
},
|
|
33515
|
-
endOfYear: (date) => {
|
|
33516
|
-
const base = toNoonTZDate(date);
|
|
33517
|
-
base.setMonth(11, 31);
|
|
33518
|
-
return base;
|
|
33519
|
-
},
|
|
33520
|
-
eachMonthOfInterval: (interval) => {
|
|
33521
|
-
const start = toNoonTZDate(interval.start);
|
|
33522
|
-
const end = toNoonTZDate(interval.end);
|
|
33523
|
-
const result = [];
|
|
33524
|
-
const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
|
|
33525
|
-
const endKey = end.getFullYear() * 12 + end.getMonth();
|
|
33526
|
-
while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
|
|
33527
|
-
result.push(new TZDate(cursor, timeZone));
|
|
33528
|
-
cursor.setMonth(cursor.getMonth() + 1, 1);
|
|
33529
|
-
}
|
|
33530
|
-
return result;
|
|
33531
|
-
},
|
|
33532
|
-
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
33533
|
-
// mutate the same TZDate, and return it.
|
|
33534
|
-
addDays: (date, amount) => {
|
|
33535
|
-
const base = toNoonTZDate(date);
|
|
33536
|
-
base.setDate(base.getDate() + amount);
|
|
33537
|
-
return base;
|
|
33538
|
-
},
|
|
33539
|
-
addWeeks: (date, amount) => {
|
|
33540
|
-
const base = toNoonTZDate(date);
|
|
33541
|
-
base.setDate(base.getDate() + amount * 7);
|
|
33542
|
-
return base;
|
|
33543
|
-
},
|
|
33544
|
-
addMonths: (date, amount) => {
|
|
33545
|
-
const base = toNoonTZDate(date);
|
|
33546
|
-
base.setMonth(base.getMonth() + amount);
|
|
33547
|
-
return base;
|
|
33548
|
-
},
|
|
33549
|
-
addYears: (date, amount) => {
|
|
33550
|
-
const base = toNoonTZDate(date);
|
|
33551
|
-
base.setFullYear(base.getFullYear() + amount);
|
|
33552
|
-
return base;
|
|
33553
|
-
},
|
|
33554
|
-
eachYearOfInterval: (interval) => {
|
|
33555
|
-
const start = toNoonTZDate(interval.start);
|
|
33556
|
-
const end = toNoonTZDate(interval.end);
|
|
33557
|
-
const years = [];
|
|
33558
|
-
const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
|
|
33559
|
-
while (cursor.getFullYear() <= end.getFullYear()) {
|
|
33560
|
-
years.push(new TZDate(cursor, timeZone));
|
|
33561
|
-
cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
|
|
33562
|
-
}
|
|
33563
|
-
return years;
|
|
33564
|
-
},
|
|
33565
|
-
getWeek: (date, options) => {
|
|
33566
|
-
const base = toCalendarDate(date);
|
|
33567
|
-
return getWeek(base, {
|
|
33568
|
-
weekStartsOn: options?.weekStartsOn ?? fallbackWeekStartsOn,
|
|
33569
|
-
firstWeekContainsDate: options?.firstWeekContainsDate ??
|
|
33570
|
-
locale?.options?.firstWeekContainsDate ??
|
|
33571
|
-
1,
|
|
33572
|
-
});
|
|
33573
|
-
},
|
|
33574
|
-
getISOWeek: (date) => {
|
|
33575
|
-
const base = toCalendarDate(date);
|
|
33576
|
-
return getISOWeek(base);
|
|
33577
|
-
},
|
|
33578
|
-
differenceInCalendarDays: (dateLeft, dateRight) => {
|
|
33579
|
-
const left = toCalendarDate(dateLeft);
|
|
33580
|
-
const right = toCalendarDate(dateRight);
|
|
33581
|
-
return differenceInCalendarDays(left, right);
|
|
33582
|
-
},
|
|
33583
|
-
differenceInCalendarMonths: (dateLeft, dateRight) => {
|
|
33584
|
-
const left = toCalendarDate(dateLeft);
|
|
33585
|
-
const right = toCalendarDate(dateRight);
|
|
33586
|
-
return differenceInCalendarMonths(left, right);
|
|
33587
|
-
},
|
|
33588
|
-
};
|
|
33589
|
-
}
|
|
33590
|
-
|
|
33591
33207
|
const asHtmlElement = (element) => {
|
|
33592
33208
|
if (element instanceof HTMLElement)
|
|
33593
33209
|
return element;
|
|
@@ -33780,27 +33396,19 @@ function getDates(displayMonths, maxDate, props, dateLib) {
|
|
|
33780
33396
|
: ISOWeek
|
|
33781
33397
|
? startOfISOWeek(firstMonth)
|
|
33782
33398
|
: startOfWeek(firstMonth);
|
|
33783
|
-
const
|
|
33399
|
+
const endWeekLastDate = broadcastCalendar
|
|
33784
33400
|
? endOfBroadcastWeek(lastMonth)
|
|
33785
33401
|
: ISOWeek
|
|
33786
33402
|
? endOfISOWeek(endOfMonth(lastMonth))
|
|
33787
33403
|
: endOfWeek(endOfMonth(lastMonth));
|
|
33788
|
-
|
|
33789
|
-
const constraintWeekEnd = maxDate &&
|
|
33790
|
-
(broadcastCalendar
|
|
33791
|
-
? endOfBroadcastWeek(maxDate)
|
|
33792
|
-
: ISOWeek
|
|
33793
|
-
? endOfISOWeek(maxDate)
|
|
33794
|
-
: endOfWeek(maxDate));
|
|
33795
|
-
// Pick the earliest week end between the displayed months and the constraint.
|
|
33796
|
-
const gridEndDate = constraintWeekEnd && isAfter(displayMonthsWeekEnd, constraintWeekEnd)
|
|
33797
|
-
? constraintWeekEnd
|
|
33798
|
-
: displayMonthsWeekEnd;
|
|
33799
|
-
const nOfDays = differenceInCalendarDays(gridEndDate, startWeekFirstDate);
|
|
33404
|
+
const nOfDays = differenceInCalendarDays(endWeekLastDate, startWeekFirstDate);
|
|
33800
33405
|
const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;
|
|
33801
33406
|
const dates = [];
|
|
33802
33407
|
for (let i = 0; i <= nOfDays; i++) {
|
|
33803
33408
|
const date = addDays(startWeekFirstDate, i);
|
|
33409
|
+
if (maxDate && isAfter(date, maxDate)) {
|
|
33410
|
+
break;
|
|
33411
|
+
}
|
|
33804
33412
|
dates.push(date);
|
|
33805
33413
|
}
|
|
33806
33414
|
// If fixed weeks is enabled, add the extra dates to the array
|
|
@@ -34131,45 +33739,17 @@ function useCalendar(props, dateLib) {
|
|
|
34131
33739
|
setFirstMonth(newInitialMonth);
|
|
34132
33740
|
}, [props.timeZone]);
|
|
34133
33741
|
/** The months displayed in the calendar. */
|
|
34134
|
-
|
|
34135
|
-
|
|
34136
|
-
|
|
34137
|
-
|
|
34138
|
-
|
|
34139
|
-
|
|
34140
|
-
|
|
34141
|
-
|
|
34142
|
-
|
|
34143
|
-
|
|
34144
|
-
|
|
34145
|
-
ISOWeek: props.ISOWeek,
|
|
34146
|
-
reverseMonths: props.reverseMonths,
|
|
34147
|
-
}, dateLib);
|
|
34148
|
-
const weeks = getWeeks(months);
|
|
34149
|
-
const days = getDays(months);
|
|
34150
|
-
const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
34151
|
-
const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
34152
|
-
return {
|
|
34153
|
-
months,
|
|
34154
|
-
weeks,
|
|
34155
|
-
days,
|
|
34156
|
-
previousMonth,
|
|
34157
|
-
nextMonth,
|
|
34158
|
-
};
|
|
34159
|
-
}, [
|
|
34160
|
-
dateLib,
|
|
34161
|
-
firstMonth.getTime(),
|
|
34162
|
-
navEnd?.getTime(),
|
|
34163
|
-
navStart?.getTime(),
|
|
34164
|
-
props.disableNavigation,
|
|
34165
|
-
props.broadcastCalendar,
|
|
34166
|
-
props.endMonth?.getTime(),
|
|
34167
|
-
props.fixedWeeks,
|
|
34168
|
-
props.ISOWeek,
|
|
34169
|
-
props.numberOfMonths,
|
|
34170
|
-
props.pagedNavigation,
|
|
34171
|
-
props.reverseMonths,
|
|
34172
|
-
]);
|
|
33742
|
+
const displayMonths = getDisplayMonths(firstMonth, navEnd, props, dateLib);
|
|
33743
|
+
/** The dates displayed in the calendar. */
|
|
33744
|
+
const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, props, dateLib);
|
|
33745
|
+
/** The Months displayed in the calendar. */
|
|
33746
|
+
const months = getMonths(displayMonths, dates, props, dateLib);
|
|
33747
|
+
/** The Weeks displayed in the calendar. */
|
|
33748
|
+
const weeks = getWeeks(months);
|
|
33749
|
+
/** The Days displayed in the calendar. */
|
|
33750
|
+
const days = getDays(months);
|
|
33751
|
+
const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
33752
|
+
const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
34173
33753
|
const { disableNavigation, onMonthChange } = props;
|
|
34174
33754
|
const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
|
|
34175
33755
|
const goToMonth = (date) => {
|
|
@@ -34388,12 +33968,6 @@ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
|
34388
33968
|
const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
|
|
34389
33969
|
if (!nextFocus)
|
|
34390
33970
|
return;
|
|
34391
|
-
if (props.disableNavigation) {
|
|
34392
|
-
const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
|
|
34393
|
-
if (!isNextInCalendar) {
|
|
34394
|
-
return;
|
|
34395
|
-
}
|
|
34396
|
-
}
|
|
34397
33971
|
calendar.goToDay(nextFocus);
|
|
34398
33972
|
setFocused(nextFocus);
|
|
34399
33973
|
};
|
|
@@ -34676,33 +34250,15 @@ function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
|
|
|
34676
34250
|
* range, and a function to check if a date is within the range.
|
|
34677
34251
|
*/
|
|
34678
34252
|
function useRange(props, dateLib) {
|
|
34679
|
-
const { disabled, excludeDisabled,
|
|
34253
|
+
const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect, } = props;
|
|
34680
34254
|
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
|
|
34681
34255
|
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
34682
34256
|
const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
|
|
34683
34257
|
const select = (triggerDate, modifiers, e) => {
|
|
34684
34258
|
const { min, max } = props;
|
|
34685
|
-
|
|
34686
|
-
|
|
34687
|
-
|
|
34688
|
-
const selectedTo = selected?.to;
|
|
34689
|
-
const hasFullRange = !!selectedFrom && !!selectedTo;
|
|
34690
|
-
const isClickingSingleDayRange = !!selectedFrom &&
|
|
34691
|
-
!!selectedTo &&
|
|
34692
|
-
dateLib.isSameDay(selectedFrom, selectedTo) &&
|
|
34693
|
-
dateLib.isSameDay(triggerDate, selectedFrom);
|
|
34694
|
-
if (resetOnSelect && (hasFullRange || !selected?.from)) {
|
|
34695
|
-
if (!required && isClickingSingleDayRange) {
|
|
34696
|
-
newRange = undefined;
|
|
34697
|
-
}
|
|
34698
|
-
else {
|
|
34699
|
-
newRange = { from: triggerDate, to: undefined };
|
|
34700
|
-
}
|
|
34701
|
-
}
|
|
34702
|
-
else {
|
|
34703
|
-
newRange = addToRange(triggerDate, selected, min, max, required, dateLib);
|
|
34704
|
-
}
|
|
34705
|
-
}
|
|
34259
|
+
const newRange = triggerDate
|
|
34260
|
+
? addToRange(triggerDate, selected, min, max, required, dateLib)
|
|
34261
|
+
: undefined;
|
|
34706
34262
|
if (excludeDisabled && disabled && newRange?.from && newRange.to) {
|
|
34707
34263
|
if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {
|
|
34708
34264
|
// if a disabled days is found, the range is reset
|
|
@@ -34790,78 +34346,6 @@ function useSelection(props, dateLib) {
|
|
|
34790
34346
|
}
|
|
34791
34347
|
}
|
|
34792
34348
|
|
|
34793
|
-
/**
|
|
34794
|
-
* Convert a {@link Date} or {@link TZDate} instance to the given time zone.
|
|
34795
|
-
* Reuses the same instance when it is already a {@link TZDate} using the target
|
|
34796
|
-
* time zone to avoid extra allocations.
|
|
34797
|
-
*/
|
|
34798
|
-
function toTimeZone(date, timeZone) {
|
|
34799
|
-
if (date instanceof TZDate && date.timeZone === timeZone) {
|
|
34800
|
-
return date;
|
|
34801
|
-
}
|
|
34802
|
-
return new TZDate(date, timeZone);
|
|
34803
|
-
}
|
|
34804
|
-
|
|
34805
|
-
function toZoneNoon(date, timeZone, noonSafe) {
|
|
34806
|
-
if (!noonSafe)
|
|
34807
|
-
return toTimeZone(date, timeZone);
|
|
34808
|
-
const zoned = toTimeZone(date, timeZone);
|
|
34809
|
-
const noonZoned = new TZDate(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 12, 0, 0, timeZone);
|
|
34810
|
-
return new Date(noonZoned.getTime());
|
|
34811
|
-
}
|
|
34812
|
-
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
34813
|
-
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
34814
|
-
return matcher;
|
|
34815
|
-
}
|
|
34816
|
-
if (matcher instanceof Date) {
|
|
34817
|
-
return toZoneNoon(matcher, timeZone, noonSafe);
|
|
34818
|
-
}
|
|
34819
|
-
if (Array.isArray(matcher)) {
|
|
34820
|
-
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone, noonSafe) : value);
|
|
34821
|
-
}
|
|
34822
|
-
if (isDateRange(matcher)) {
|
|
34823
|
-
return {
|
|
34824
|
-
...matcher,
|
|
34825
|
-
from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
|
|
34826
|
-
to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to,
|
|
34827
|
-
};
|
|
34828
|
-
}
|
|
34829
|
-
if (isDateInterval(matcher)) {
|
|
34830
|
-
return {
|
|
34831
|
-
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34832
|
-
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34833
|
-
};
|
|
34834
|
-
}
|
|
34835
|
-
if (isDateAfterType(matcher)) {
|
|
34836
|
-
return {
|
|
34837
|
-
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34838
|
-
};
|
|
34839
|
-
}
|
|
34840
|
-
if (isDateBeforeType(matcher)) {
|
|
34841
|
-
return {
|
|
34842
|
-
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34843
|
-
};
|
|
34844
|
-
}
|
|
34845
|
-
return matcher;
|
|
34846
|
-
}
|
|
34847
|
-
/**
|
|
34848
|
-
* Convert any {@link Matcher} or array of matchers to the specified time zone.
|
|
34849
|
-
*
|
|
34850
|
-
* @param matchers - The matcher or matchers to convert.
|
|
34851
|
-
* @param timeZone - The target IANA time zone.
|
|
34852
|
-
* @returns The converted matcher(s).
|
|
34853
|
-
* @group Utilities
|
|
34854
|
-
*/
|
|
34855
|
-
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
34856
|
-
if (!matchers) {
|
|
34857
|
-
return matchers;
|
|
34858
|
-
}
|
|
34859
|
-
if (Array.isArray(matchers)) {
|
|
34860
|
-
return matchers.map((matcher) => convertMatcher(matcher, timeZone, noonSafe));
|
|
34861
|
-
}
|
|
34862
|
-
return convertMatcher(matchers, timeZone, noonSafe);
|
|
34863
|
-
}
|
|
34864
|
-
|
|
34865
34349
|
/**
|
|
34866
34350
|
* Renders the DayPicker calendar component.
|
|
34867
34351
|
*
|
|
@@ -34872,83 +34356,58 @@ function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
|
34872
34356
|
*/
|
|
34873
34357
|
function DayPicker(initialProps) {
|
|
34874
34358
|
let props = initialProps;
|
|
34875
|
-
|
|
34876
|
-
if (timeZone) {
|
|
34359
|
+
if (props.timeZone) {
|
|
34877
34360
|
props = {
|
|
34878
34361
|
...initialProps,
|
|
34879
|
-
timeZone,
|
|
34880
34362
|
};
|
|
34881
34363
|
if (props.today) {
|
|
34882
|
-
props.today =
|
|
34364
|
+
props.today = new TZDate(props.today, props.timeZone);
|
|
34883
34365
|
}
|
|
34884
34366
|
if (props.month) {
|
|
34885
|
-
props.month =
|
|
34367
|
+
props.month = new TZDate(props.month, props.timeZone);
|
|
34886
34368
|
}
|
|
34887
34369
|
if (props.defaultMonth) {
|
|
34888
|
-
props.defaultMonth =
|
|
34370
|
+
props.defaultMonth = new TZDate(props.defaultMonth, props.timeZone);
|
|
34889
34371
|
}
|
|
34890
34372
|
if (props.startMonth) {
|
|
34891
|
-
props.startMonth =
|
|
34373
|
+
props.startMonth = new TZDate(props.startMonth, props.timeZone);
|
|
34892
34374
|
}
|
|
34893
34375
|
if (props.endMonth) {
|
|
34894
|
-
props.endMonth =
|
|
34376
|
+
props.endMonth = new TZDate(props.endMonth, props.timeZone);
|
|
34895
34377
|
}
|
|
34896
34378
|
if (props.mode === "single" && props.selected) {
|
|
34897
|
-
props.selected =
|
|
34379
|
+
props.selected = new TZDate(props.selected, props.timeZone);
|
|
34898
34380
|
}
|
|
34899
34381
|
else if (props.mode === "multiple" && props.selected) {
|
|
34900
|
-
props.selected = props.selected?.map((date) =>
|
|
34382
|
+
props.selected = props.selected?.map((date) => new TZDate(date, props.timeZone));
|
|
34901
34383
|
}
|
|
34902
34384
|
else if (props.mode === "range" && props.selected) {
|
|
34903
34385
|
props.selected = {
|
|
34904
34386
|
from: props.selected.from
|
|
34905
|
-
?
|
|
34906
|
-
:
|
|
34387
|
+
? new TZDate(props.selected.from, props.timeZone)
|
|
34388
|
+
: undefined,
|
|
34907
34389
|
to: props.selected.to
|
|
34908
|
-
?
|
|
34909
|
-
:
|
|
34390
|
+
? new TZDate(props.selected.to, props.timeZone)
|
|
34391
|
+
: undefined,
|
|
34910
34392
|
};
|
|
34911
34393
|
}
|
|
34912
|
-
if (props.disabled !== undefined) {
|
|
34913
|
-
props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
|
|
34914
|
-
}
|
|
34915
|
-
if (props.hidden !== undefined) {
|
|
34916
|
-
props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
|
|
34917
|
-
}
|
|
34918
|
-
if (props.modifiers) {
|
|
34919
|
-
const nextModifiers = {};
|
|
34920
|
-
Object.keys(props.modifiers).forEach((key) => {
|
|
34921
|
-
nextModifiers[key] = convertMatchersToTimeZone(props.modifiers?.[key], timeZone);
|
|
34922
|
-
});
|
|
34923
|
-
props.modifiers = nextModifiers;
|
|
34924
|
-
}
|
|
34925
34394
|
}
|
|
34926
34395
|
const { components, formatters, labels, dateLib, locale, classNames } = React$5.useMemo(() => {
|
|
34927
34396
|
const locale = { ...enUS, ...props.locale };
|
|
34928
|
-
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
34929
|
-
const noonOverrides = props.noonSafe && props.timeZone
|
|
34930
|
-
? createNoonOverrides(props.timeZone, {
|
|
34931
|
-
weekStartsOn,
|
|
34932
|
-
locale,
|
|
34933
|
-
})
|
|
34934
|
-
: undefined;
|
|
34935
|
-
const overrides = props.dateLib && noonOverrides
|
|
34936
|
-
? { ...noonOverrides, ...props.dateLib }
|
|
34937
|
-
: (props.dateLib ?? noonOverrides);
|
|
34938
34397
|
const dateLib = new DateLib({
|
|
34939
34398
|
locale,
|
|
34940
|
-
weekStartsOn,
|
|
34399
|
+
weekStartsOn: props.broadcastCalendar ? 1 : props.weekStartsOn,
|
|
34941
34400
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
34942
34401
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
34943
34402
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
34944
34403
|
timeZone: props.timeZone,
|
|
34945
34404
|
numerals: props.numerals,
|
|
34946
|
-
},
|
|
34405
|
+
}, props.dateLib);
|
|
34947
34406
|
return {
|
|
34948
34407
|
dateLib,
|
|
34949
34408
|
components: getComponents(props.components),
|
|
34950
34409
|
formatters: getFormatters(props.formatters),
|
|
34951
|
-
labels:
|
|
34410
|
+
labels: { ...defaultLabels, ...props.labels },
|
|
34952
34411
|
locale,
|
|
34953
34412
|
classNames: { ...getDefaultClassNames(), ...props.classNames },
|
|
34954
34413
|
};
|
|
@@ -34962,15 +34421,11 @@ function DayPicker(initialProps) {
|
|
|
34962
34421
|
props.timeZone,
|
|
34963
34422
|
props.numerals,
|
|
34964
34423
|
props.dateLib,
|
|
34965
|
-
props.noonSafe,
|
|
34966
34424
|
props.components,
|
|
34967
34425
|
props.formatters,
|
|
34968
34426
|
props.labels,
|
|
34969
34427
|
props.classNames,
|
|
34970
34428
|
]);
|
|
34971
|
-
if (!props.today) {
|
|
34972
|
-
props = { ...props, today: dateLib.today() };
|
|
34973
|
-
}
|
|
34974
34429
|
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles, } = props;
|
|
34975
34430
|
const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown, } = formatters;
|
|
34976
34431
|
const calendar = useCalendar(props, dateLib);
|
|
@@ -34979,7 +34434,7 @@ function DayPicker(initialProps) {
|
|
|
34979
34434
|
const { isSelected, select, selected: selectedValue, } = useSelection(props, dateLib) ?? {};
|
|
34980
34435
|
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
|
|
34981
34436
|
const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown, } = labels;
|
|
34982
|
-
const weekdays = React$5.useMemo(() => getWeekdays(dateLib, props.ISOWeek
|
|
34437
|
+
const weekdays = React$5.useMemo(() => getWeekdays(dateLib, props.ISOWeek), [dateLib, props.ISOWeek]);
|
|
34983
34438
|
const isInteractive = mode !== undefined || onDayClick !== undefined;
|
|
34984
34439
|
const handlePreviousClick = React$5.useCallback(() => {
|
|
34985
34440
|
if (!previousMonth)
|
|
@@ -34997,9 +34452,6 @@ function DayPicker(initialProps) {
|
|
|
34997
34452
|
e.preventDefault();
|
|
34998
34453
|
e.stopPropagation();
|
|
34999
34454
|
setFocused(day);
|
|
35000
|
-
if (m.disabled) {
|
|
35001
|
-
return;
|
|
35002
|
-
}
|
|
35003
34455
|
select?.(day.date, m, e);
|
|
35004
34456
|
onDayClick?.(day.date, m, e);
|
|
35005
34457
|
}, [select, onDayClick, setFocused]);
|
|
@@ -35083,7 +34535,7 @@ function DayPicker(initialProps) {
|
|
|
35083
34535
|
formatters,
|
|
35084
34536
|
};
|
|
35085
34537
|
return (React__default["default"].createElement(dayPickerContext.Provider, { value: contextValue },
|
|
35086
|
-
React__default["default"].createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang
|
|
34538
|
+
React__default["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 },
|
|
35087
34539
|
React__default["default"].createElement(components.Months, { className: classNames[UI.Months], style: styles?.[UI.Months] },
|
|
35088
34540
|
!props.hideNavigation && !navLayout && (React__default["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 })),
|
|
35089
34541
|
months.map((calendarMonth, displayIndex) => {
|
|
@@ -35095,16 +34547,10 @@ function DayPicker(initialProps) {
|
|
|
35095
34547
|
displayIndex === 0 && (React__default["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 },
|
|
35096
34548
|
React__default["default"].createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" }))),
|
|
35097
34549
|
React__default["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["default"].createElement(components.DropdownNav, { className: classNames[UI.Dropdowns], style: styles?.[UI.Dropdowns] },
|
|
35098
|
-
|
|
35099
|
-
|
|
35100
|
-
|
|
35101
|
-
|
|
35102
|
-
captionLayout === "dropdown-years" ? (React__default["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["default"].createElement("span", { key: "year" }, formatYearDropdown(calendarMonth.date, dateLib)));
|
|
35103
|
-
const controls = dateLib.getMonthYearOrder() === "year-first"
|
|
35104
|
-
? [yearControl, monthControl]
|
|
35105
|
-
: [monthControl, yearControl];
|
|
35106
|
-
return controls;
|
|
35107
|
-
})(),
|
|
34550
|
+
captionLayout === "dropdown" ||
|
|
34551
|
+
captionLayout === "dropdown-months" ? (React__default["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["default"].createElement("span", null, formatMonthDropdown(calendarMonth.date, dateLib))),
|
|
34552
|
+
captionLayout === "dropdown" ||
|
|
34553
|
+
captionLayout === "dropdown-years" ? (React__default["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["default"].createElement("span", null, formatYearDropdown(calendarMonth.date, dateLib))),
|
|
35108
34554
|
React__default["default"].createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
35109
34555
|
border: 0,
|
|
35110
34556
|
clip: "rect(0 0 0 0)",
|
|
@@ -35116,7 +34562,9 @@ function DayPicker(initialProps) {
|
|
|
35116
34562
|
width: "1px",
|
|
35117
34563
|
whiteSpace: "nowrap",
|
|
35118
34564
|
wordWrap: "normal",
|
|
35119
|
-
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
|
|
34565
|
+
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
|
|
34566
|
+
// biome-ignore lint/a11y/useSemanticElements: breaking change
|
|
34567
|
+
React__default["default"].createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
|
|
35120
34568
|
navLayout === "around" &&
|
|
35121
34569
|
!props.hideNavigation &&
|
|
35122
34570
|
displayIndex === numberOfMonths - 1 && (React__default["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 },
|
|
@@ -35131,7 +34579,9 @@ function DayPicker(initialProps) {
|
|
|
35131
34579
|
weekdays.map((weekday) => (React__default["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)))))),
|
|
35132
34580
|
React__default["default"].createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : undefined, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
|
|
35133
34581
|
return (React__default["default"].createElement(components.Week, { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week: week },
|
|
35134
|
-
showWeekNumber && (
|
|
34582
|
+
showWeekNumber && (
|
|
34583
|
+
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34584
|
+
React__default["default"].createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
35135
34585
|
locale,
|
|
35136
34586
|
}), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber(week.weekNumber, dateLib))),
|
|
35137
34587
|
week.days.map((day) => {
|
|
@@ -35155,16 +34605,18 @@ function DayPicker(initialProps) {
|
|
|
35155
34605
|
const ariaLabel = !isInteractive && !modifiers.hidden
|
|
35156
34606
|
? labelGridcell(date, modifiers, dateLib.options, dateLib)
|
|
35157
34607
|
: undefined;
|
|
35158
|
-
return (
|
|
35159
|
-
|
|
35160
|
-
|
|
35161
|
-
|
|
35162
|
-
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 &&
|
|
34608
|
+
return (
|
|
34609
|
+
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34610
|
+
React__default["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
|
|
34611
|
+
? dateLib.format(date, "yyyy-MM")
|
|
34612
|
+
: 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["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 &&
|
|
35163
34613
|
formatDay(day.date, dateLib.options, dateLib))));
|
|
35164
34614
|
})));
|
|
35165
34615
|
})))));
|
|
35166
34616
|
})),
|
|
35167
|
-
props.footer && (
|
|
34617
|
+
props.footer && (
|
|
34618
|
+
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34619
|
+
React__default["default"].createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
35168
34620
|
}
|
|
35169
34621
|
|
|
35170
34622
|
function styleInject(css, ref) {
|
|
@@ -35194,7 +34646,7 @@ function styleInject(css, ref) {
|
|
|
35194
34646
|
}
|
|
35195
34647
|
}
|
|
35196
34648
|
|
|
35197
|
-
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";
|
|
34649
|
+
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";
|
|
35198
34650
|
styleInject(css_248z$3);
|
|
35199
34651
|
|
|
35200
34652
|
var reactInputMask = {exports: {}};
|
|
@@ -39586,7 +39038,7 @@ const DateRangePicker = React$5.forwardRef((props, ref) => {
|
|
|
39586
39038
|
}, children: t('Last month') })] })] })] }) }));
|
|
39587
39039
|
});
|
|
39588
39040
|
|
|
39589
|
-
const FilterComponent = ({ optionsFilter, formatSetting, filterBy, setOpenFilter, changeFilter, column }) => {
|
|
39041
|
+
const FilterComponent = ({ optionsFilter, formatSetting, filterBy, setOpenFilter, changeFilter, column, }) => {
|
|
39590
39042
|
const { t } = reactI18next.useTranslation();
|
|
39591
39043
|
const fieldFilter = column.fieldFilter ?? column.field;
|
|
39592
39044
|
let typeFilter = column.filterType;
|
|
@@ -39613,14 +39065,22 @@ const FilterComponent = ({ optionsFilter, formatSetting, filterBy, setOpenFilter
|
|
|
39613
39065
|
from.value = filterValue?.from;
|
|
39614
39066
|
}
|
|
39615
39067
|
else {
|
|
39616
|
-
filterBy.push({
|
|
39068
|
+
filterBy.push({
|
|
39069
|
+
key: fieldFilter,
|
|
39070
|
+
ope: 'greaterthanorequal',
|
|
39071
|
+
value: filterValue?.from,
|
|
39072
|
+
});
|
|
39617
39073
|
}
|
|
39618
39074
|
const to = filterBy.find((item) => item.key === fieldFilter && item.ope === 'lessthanorequal');
|
|
39619
39075
|
if (to) {
|
|
39620
39076
|
to.value = filterValue?.to;
|
|
39621
39077
|
}
|
|
39622
39078
|
else {
|
|
39623
|
-
filterBy.push({
|
|
39079
|
+
filterBy.push({
|
|
39080
|
+
key: fieldFilter,
|
|
39081
|
+
ope: 'lessthanorequal',
|
|
39082
|
+
value: filterValue?.to,
|
|
39083
|
+
});
|
|
39624
39084
|
}
|
|
39625
39085
|
}
|
|
39626
39086
|
else {
|
|
@@ -39630,7 +39090,11 @@ const FilterComponent = ({ optionsFilter, formatSetting, filterBy, setOpenFilter
|
|
|
39630
39090
|
filter.value = filterValue ?? '';
|
|
39631
39091
|
}
|
|
39632
39092
|
else {
|
|
39633
|
-
filterBy.push({
|
|
39093
|
+
filterBy.push({
|
|
39094
|
+
key: fieldFilter,
|
|
39095
|
+
ope: operator ?? 'equal',
|
|
39096
|
+
value: filterValue ?? '',
|
|
39097
|
+
});
|
|
39634
39098
|
}
|
|
39635
39099
|
}
|
|
39636
39100
|
changeFilter([...filterBy]);
|
|
@@ -39639,19 +39103,19 @@ const FilterComponent = ({ optionsFilter, formatSetting, filterBy, setOpenFilter
|
|
|
39639
39103
|
/* eslint-disable */
|
|
39640
39104
|
switch (typeFilter) {
|
|
39641
39105
|
case 'text':
|
|
39642
|
-
return jsxRuntime.jsx(StringFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave });
|
|
39106
|
+
return (jsxRuntime.jsx(StringFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave }));
|
|
39643
39107
|
case 'numeric':
|
|
39644
|
-
return jsxRuntime.jsx(NumberFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave, formatSetting: formatSetting });
|
|
39108
|
+
return (jsxRuntime.jsx(NumberFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave, formatSetting: formatSetting }));
|
|
39645
39109
|
case 'select':
|
|
39646
|
-
return jsxRuntime.jsx(SelectFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave });
|
|
39110
|
+
return (jsxRuntime.jsx(SelectFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave }));
|
|
39647
39111
|
case 'date':
|
|
39648
|
-
return jsxRuntime.jsx(DateRangeFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave });
|
|
39112
|
+
return (jsxRuntime.jsx(DateRangeFilterComponent, { fieldFilter: fieldFilter, optionsFilter: optionsFilter, filterBy: filterBy, column: column, handleSave: handleSave }));
|
|
39649
39113
|
default:
|
|
39650
39114
|
return jsxRuntime.jsx("div", { children: t('No filter available') });
|
|
39651
39115
|
}
|
|
39652
39116
|
/* eslint-enable */
|
|
39653
39117
|
};
|
|
39654
|
-
const StringFilterComponent = ({ fieldFilter, filterBy, handleSave }) => {
|
|
39118
|
+
const StringFilterComponent = ({ fieldFilter, filterBy, handleSave, }) => {
|
|
39655
39119
|
const { t } = reactI18next.useTranslation();
|
|
39656
39120
|
const filter = filterBy.find((item) => item.key === fieldFilter);
|
|
39657
39121
|
const [operator, setOperator] = React$5.useState(filter?.ope ?? 'contains');
|
|
@@ -39661,7 +39125,7 @@ const StringFilterComponent = ({ fieldFilter, filterBy, handleSave }) => {
|
|
|
39661
39125
|
{ label: 'Kết thúc bởi', value: 'endswith' },
|
|
39662
39126
|
{ label: 'Chứa', value: 'contains' },
|
|
39663
39127
|
{ label: 'Bằng', value: 'equal' },
|
|
39664
|
-
{ label: 'Không bằng', value: 'notequal' }
|
|
39128
|
+
{ label: 'Không bằng', value: 'notequal' },
|
|
39665
39129
|
];
|
|
39666
39130
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "r-filter-popup", onKeyDown: (e) => {
|
|
39667
39131
|
if (e.code === 'Enter' || e.code === 'NumpadEnter') {
|
|
@@ -39676,7 +39140,7 @@ const StringFilterComponent = ({ fieldFilter, filterBy, handleSave }) => {
|
|
|
39676
39140
|
setValueFilter(val.target.value);
|
|
39677
39141
|
} }), jsxRuntime.jsxs("div", { className: "d-flex justify-content-end", children: [jsxRuntime.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') }), jsxRuntime.jsx(Button$1$1, { className: "py-25 px-50 fw-bold", outline: true, style: { borderRadius: 3 }, onClick: () => handleSave(), children: t('Clear') })] })] }) }));
|
|
39678
39142
|
};
|
|
39679
|
-
const NumberFilterComponent = ({ column, filterBy, fieldFilter, handleSave, formatSetting }) => {
|
|
39143
|
+
const NumberFilterComponent = ({ column, filterBy, fieldFilter, handleSave, formatSetting, }) => {
|
|
39680
39144
|
const { t } = reactI18next.useTranslation();
|
|
39681
39145
|
const filter = filterBy.find((item) => item.key === fieldFilter);
|
|
39682
39146
|
const [operator, setOperator] = React$5.useState(filter?.ope ?? 'equal');
|
|
@@ -39686,17 +39150,15 @@ const NumberFilterComponent = ({ column, filterBy, fieldFilter, handleSave, form
|
|
|
39686
39150
|
{ label: 'Lớn hơn hoặc bằng', value: 'greaterthanorequal' },
|
|
39687
39151
|
{ label: 'Bằng', value: 'equal' },
|
|
39688
39152
|
{ label: 'Bé hơn', value: 'lessthan' },
|
|
39689
|
-
{ label: 'Bé hơn hoặc bằng', value: 'lessthanorequal' }
|
|
39153
|
+
{ label: 'Bé hơn hoặc bằng', value: 'lessthanorequal' },
|
|
39690
39154
|
];
|
|
39691
39155
|
const numericFormatProps = {
|
|
39692
39156
|
value: !isNullOrUndefined$1(valueFilter) ? valueFilter.toString() : '',
|
|
39693
39157
|
thousandSeparator: checkThousandSeparator(formatSetting?.thousandSeparator, formatSetting?.decimalSeparator),
|
|
39694
39158
|
decimalSeparator: checkDecimalSeparator(formatSetting?.thousandSeparator, formatSetting?.decimalSeparator),
|
|
39695
39159
|
allowNegative: column.numericSettings?.allowNegative ?? false,
|
|
39696
|
-
decimalScale: column.numericSettings?.fraction ?? 0
|
|
39160
|
+
decimalScale: column.numericSettings?.fraction ?? 0,
|
|
39697
39161
|
};
|
|
39698
|
-
console.log(column.numericSettings?.fraction);
|
|
39699
|
-
console.log(column.field);
|
|
39700
39162
|
let floatValue = parseFloat(valueFilter ?? '0');
|
|
39701
39163
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "r-filter-popup", onKeyDown: (e) => {
|
|
39702
39164
|
if (e.code === 'Enter' || e.code === 'NumpadEnter') {
|
|
@@ -39717,7 +39179,7 @@ const NumberFilterComponent = ({ column, filterBy, fieldFilter, handleSave, form
|
|
|
39717
39179
|
}
|
|
39718
39180
|
} }), jsxRuntime.jsxs("div", { className: "d-flex justify-content-end", children: [jsxRuntime.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') }), jsxRuntime.jsx(Button$1$1, { className: "py-25 px-50 fw-bold", outline: true, style: { borderRadius: 3 }, onClick: () => handleSave(), children: t('Clear') })] })] }) }));
|
|
39719
39181
|
};
|
|
39720
|
-
const SelectFilterComponent = ({ column, filterBy, handleSave, fieldFilter, optionsFilter }) => {
|
|
39182
|
+
const SelectFilterComponent = ({ column, filterBy, handleSave, fieldFilter, optionsFilter, }) => {
|
|
39721
39183
|
const { t } = reactI18next.useTranslation();
|
|
39722
39184
|
const filter = filterBy.find((item) => item.key === fieldFilter);
|
|
39723
39185
|
const [valueFilter, setValueFilter] = React$5.useState(filter?.value ?? '');
|
|
@@ -39728,15 +39190,22 @@ const SelectFilterComponent = ({ column, filterBy, handleSave, fieldFilter, opti
|
|
|
39728
39190
|
}, 100);
|
|
39729
39191
|
e.stopPropagation();
|
|
39730
39192
|
}
|
|
39731
|
-
}, children: [jsxRuntime.jsx("div", { className: "mb-1", children: jsxRuntime.jsx(SelectTable, { value: optionsFilter
|
|
39193
|
+
}, children: [jsxRuntime.jsx("div", { className: "mb-1", children: jsxRuntime.jsx(SelectTable, { value: optionsFilter
|
|
39194
|
+
? optionsFilter[column.fieldFilter ?? column.field]?.find((x) => x.value === valueFilter)
|
|
39195
|
+
: undefined, options: (optionsFilter &&
|
|
39196
|
+
optionsFilter[column.fieldFilter ?? column.field]) ??
|
|
39197
|
+
[], isClearable: true, onChange: (val) => {
|
|
39732
39198
|
setValueFilter(val?.value);
|
|
39733
39199
|
}, placeholder: t('Select') }) }), jsxRuntime.jsxs("div", { className: "d-flex justify-content-end", children: [jsxRuntime.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') }), jsxRuntime.jsx(Button$1$1, { className: "py-25 px-50 fw-bold", outline: true, style: { borderRadius: 3 }, onClick: () => handleSave(), children: t('Clear') })] })] }) }));
|
|
39734
39200
|
};
|
|
39735
|
-
const DateRangeFilterComponent = ({ fieldFilter, filterBy, handleSave }) => {
|
|
39201
|
+
const DateRangeFilterComponent = ({ fieldFilter, filterBy, handleSave, }) => {
|
|
39736
39202
|
const { t } = reactI18next.useTranslation();
|
|
39737
39203
|
const from = filterBy.find((item) => item.key === fieldFilter && item.ope === 'greaterthanorequal')?.value;
|
|
39738
39204
|
const to = filterBy.find((item) => item.key === fieldFilter && item.ope === 'lessthanorequal')?.value;
|
|
39739
|
-
const [valueFilter, setValueFilter] = React$5.useState({
|
|
39205
|
+
const [valueFilter, setValueFilter] = React$5.useState({
|
|
39206
|
+
from: from ?? undefined,
|
|
39207
|
+
to: to ?? undefined,
|
|
39208
|
+
});
|
|
39740
39209
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "r-filter-popup", onKeyDown: (e) => {
|
|
39741
39210
|
if (e.code === 'Enter' || e.code === 'NumpadEnter') {
|
|
39742
39211
|
setTimeout(() => {
|