react-table-edit 1.5.43 → 1.5.44
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/sidebar-setting-column/index.d.ts +0 -2
- package/dist/component/table/toolbar-bottom.d.ts +1 -1
- package/dist/component/table-view/header.d.ts +3 -3
- package/dist/index.js +880 -238
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +880 -238
- package/dist/index.mjs.map +1 -1
- package/dist/styles/date-picker.css +771 -74
- package/dist/styles/date-picker.css.map +1 -1
- package/dist/styles/form-wizard.css.map +1 -1
- package/dist/styles/index.css +840 -296
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/select-table.css.map +1 -1
- package/dist/styles/sidebar.css +0 -14
- package/dist/styles/sidebar.css.map +1 -1
- package/dist/styles/tab-menu.css.map +1 -1
- package/package.json +1 -1
- package/dist/component/calendar/index.d.ts +0 -8
package/dist/index.js
CHANGED
|
@@ -9085,6 +9085,20 @@ 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
|
+
|
|
9088
9102
|
var SvgQuoteRight = function (_a) {
|
|
9089
9103
|
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9090
9104
|
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),
|
|
@@ -9253,6 +9267,13 @@ var SvgSettings = function (_a) {
|
|
|
9253
9267
|
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" })));
|
|
9254
9268
|
};
|
|
9255
9269
|
|
|
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
|
+
|
|
9256
9277
|
var SvgShare2 = function (_a) {
|
|
9257
9278
|
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9258
9279
|
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),
|
|
@@ -10480,6 +10501,7 @@ var Icon = /*#__PURE__*/Object.freeze({
|
|
|
10480
10501
|
Power: SvgPower,
|
|
10481
10502
|
Printer: SvgPrinter,
|
|
10482
10503
|
Process: SvgProcess,
|
|
10504
|
+
ProjectSetting: SvgProjectSetting,
|
|
10483
10505
|
QuoteRight: SvgQuoteRight,
|
|
10484
10506
|
Radio: SvgRadio,
|
|
10485
10507
|
RefreshCcw: SvgRefreshCcw,
|
|
@@ -10499,6 +10521,7 @@ var Icon = /*#__PURE__*/Object.freeze({
|
|
|
10499
10521
|
SendHorFill: SvgSendHorFill,
|
|
10500
10522
|
Server: SvgServer,
|
|
10501
10523
|
Settings: SvgSettings,
|
|
10524
|
+
ShapeGroup: SvgShapeGroup,
|
|
10502
10525
|
Share: SvgShare,
|
|
10503
10526
|
Share2: SvgShare2,
|
|
10504
10527
|
Share3: SvgShare3,
|
|
@@ -19813,17 +19836,20 @@ const isNullOrUndefined$1 = (d) => {
|
|
|
19813
19836
|
const generateUUID = () => {
|
|
19814
19837
|
// Public Domain/MIT
|
|
19815
19838
|
let d = new Date().getTime(); //Timestamp
|
|
19816
|
-
let d2 = (typeof performance !== 'undefined' &&
|
|
19839
|
+
let d2 = (typeof performance !== 'undefined' &&
|
|
19840
|
+
performance.now &&
|
|
19841
|
+
performance.now() * 1000) ||
|
|
19842
|
+
0; //Time in microseconds since page-load or 0 if unsupported
|
|
19817
19843
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
19818
19844
|
let r = Math.random() * 16; //random number between 0 and 16
|
|
19819
19845
|
if (d > 0) {
|
|
19820
19846
|
//Use timestamp until depleted
|
|
19821
|
-
r = (d + r) % 16 | 0;
|
|
19847
|
+
r = ((d + r) % 16) | 0;
|
|
19822
19848
|
d = Math.floor(d / 16);
|
|
19823
19849
|
}
|
|
19824
19850
|
else {
|
|
19825
19851
|
//Use microseconds since page-load if supported
|
|
19826
|
-
r = (d2 + r) % 16 | 0;
|
|
19852
|
+
r = ((d2 + r) % 16) | 0;
|
|
19827
19853
|
d2 = Math.floor(d2 / 16);
|
|
19828
19854
|
}
|
|
19829
19855
|
return (c === 'x' ? r : 0x3).toString(16);
|
|
@@ -19845,12 +19871,16 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2,
|
|
|
19845
19871
|
// eslint-disable-next-line
|
|
19846
19872
|
if (str || str == '0') {
|
|
19847
19873
|
str = str.toString();
|
|
19848
|
-
const value = decimalSeparator !== '.'
|
|
19874
|
+
const value = decimalSeparator !== '.'
|
|
19875
|
+
? str.toString().replaceAll('.', decimalSeparator ?? '')
|
|
19876
|
+
: str;
|
|
19849
19877
|
const arr = value.toString().split(decimalSeparator ?? '', 2);
|
|
19850
19878
|
let flag = value.toString().includes(decimalSeparator ?? '');
|
|
19851
19879
|
if (arr[0].length < 3) {
|
|
19852
19880
|
const intergerArr = haveNegative ? arr[0] : arr[0].replace('-', '');
|
|
19853
|
-
return flag
|
|
19881
|
+
return flag
|
|
19882
|
+
? `${intergerArr}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19883
|
+
: intergerArr;
|
|
19854
19884
|
}
|
|
19855
19885
|
else {
|
|
19856
19886
|
let flagNegative = false;
|
|
@@ -19874,7 +19904,9 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2,
|
|
|
19874
19904
|
if (flagNegative && haveNegative) {
|
|
19875
19905
|
arr[0] = '-'.concat(arr[0]);
|
|
19876
19906
|
}
|
|
19877
|
-
return flag
|
|
19907
|
+
return flag
|
|
19908
|
+
? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19909
|
+
: arr[0];
|
|
19878
19910
|
}
|
|
19879
19911
|
}
|
|
19880
19912
|
else {
|
|
@@ -19897,7 +19929,7 @@ const formatDateTime = (data, format = 'dd/MM/yyyy') => {
|
|
|
19897
19929
|
MM: String(date.getMonth() + 1).padStart(2, '0'),
|
|
19898
19930
|
yyyy: date.getFullYear(),
|
|
19899
19931
|
HH: String(date.getHours()).padStart(2, '0'),
|
|
19900
|
-
mm: String(date.getMinutes()).padStart(2, '0')
|
|
19932
|
+
mm: String(date.getMinutes()).padStart(2, '0'),
|
|
19901
19933
|
};
|
|
19902
19934
|
return format.replace(/dd|DD|MM|yyyy|HH|mm/g, (match) => map[match]);
|
|
19903
19935
|
};
|
|
@@ -19918,7 +19950,7 @@ const FindNodeByPath = (tree, path) => {
|
|
|
19918
19950
|
parent: current,
|
|
19919
19951
|
lastIndex: levels.at(-1),
|
|
19920
19952
|
firstIndex: levels.length === 1 ? levels[0] : -1,
|
|
19921
|
-
node
|
|
19953
|
+
node,
|
|
19922
19954
|
};
|
|
19923
19955
|
};
|
|
19924
19956
|
/**
|
|
@@ -19946,7 +19978,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19946
19978
|
const objHeaderWidthFixLeft = {};
|
|
19947
19979
|
let maxDepth = 0;
|
|
19948
19980
|
// Tính depth tối đa
|
|
19949
|
-
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) =>
|
|
19981
|
+
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) => col.columns?.length ? calculateDepth(col.columns, depth + 1) : depth));
|
|
19950
19982
|
maxDepth = calculateDepth(columns);
|
|
19951
19983
|
let leftTotal = 0;
|
|
19952
19984
|
let rightTotal = 0;
|
|
@@ -19965,45 +19997,47 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19965
19997
|
};
|
|
19966
19998
|
const applySetting = (cols) => {
|
|
19967
19999
|
return cols.map((cell) => {
|
|
19968
|
-
const
|
|
20000
|
+
const newCell = { ...cell };
|
|
20001
|
+
const setting = settingColumns?.find((s) => s.field === newCell.field);
|
|
19969
20002
|
if (setting) {
|
|
19970
|
-
|
|
19971
|
-
if (!
|
|
19972
|
-
|
|
20003
|
+
newCell.sortOrder = setting.sortOrder;
|
|
20004
|
+
if (!newCell.visibleLocked) {
|
|
20005
|
+
newCell.visible = setting.visible ?? true;
|
|
19973
20006
|
}
|
|
19974
|
-
|
|
20007
|
+
newCell.fixedType = setting.fixedType;
|
|
19975
20008
|
if (setting.width !== undefined && setting.width !== null) {
|
|
19976
|
-
|
|
20009
|
+
newCell.width = setting.width;
|
|
19977
20010
|
}
|
|
19978
20011
|
if (setting.fraction !== undefined && setting.fraction !== null) {
|
|
19979
|
-
if (
|
|
19980
|
-
|
|
20012
|
+
if (newCell.numericSettings) {
|
|
20013
|
+
newCell.numericSettings.fraction = setting.fraction;
|
|
19981
20014
|
}
|
|
19982
20015
|
else {
|
|
19983
|
-
|
|
20016
|
+
newCell.numericSettings = { fraction: setting.fraction };
|
|
19984
20017
|
}
|
|
19985
20018
|
}
|
|
19986
|
-
|
|
20019
|
+
newCell.headerDisplay =
|
|
20020
|
+
setting.headerText || (newCell.headerDisplay ?? newCell.headerText);
|
|
19987
20021
|
}
|
|
19988
20022
|
else {
|
|
19989
|
-
if (
|
|
19990
|
-
|
|
19991
|
-
|
|
19992
|
-
if (
|
|
19993
|
-
|
|
20023
|
+
if (newCell.columns?.length) {
|
|
20024
|
+
newCell.columns = applySetting(newCell.columns);
|
|
20025
|
+
newCell.sortOrder = newCell.columns[0].sortOrder;
|
|
20026
|
+
if (newCell.columns.some((x) => x.visible !== false)) {
|
|
20027
|
+
newCell.visible = true;
|
|
19994
20028
|
}
|
|
19995
20029
|
else {
|
|
19996
|
-
|
|
20030
|
+
newCell.visible = false;
|
|
19997
20031
|
}
|
|
19998
20032
|
}
|
|
19999
20033
|
else {
|
|
20000
|
-
if (!
|
|
20001
|
-
|
|
20034
|
+
if (!newCell.visibleLocked) {
|
|
20035
|
+
newCell.visible = false;
|
|
20002
20036
|
}
|
|
20003
20037
|
}
|
|
20004
20038
|
}
|
|
20005
|
-
|
|
20006
|
-
return
|
|
20039
|
+
newCell.isGroup = groupColumns?.includes(newCell.field);
|
|
20040
|
+
return newCell;
|
|
20007
20041
|
});
|
|
20008
20042
|
};
|
|
20009
20043
|
const traverse = (cols, level = 0) => {
|
|
@@ -20019,11 +20053,13 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20019
20053
|
...col,
|
|
20020
20054
|
columns: col.columns ?? [],
|
|
20021
20055
|
colspan,
|
|
20022
|
-
rowspan: hasChildren ? 1 : maxDepth - level
|
|
20056
|
+
rowspan: hasChildren ? 1 : maxDepth - level,
|
|
20023
20057
|
};
|
|
20024
20058
|
levels[level].push(cell);
|
|
20025
20059
|
const headerKey = `${level}-${indexCol}`;
|
|
20026
|
-
if (cell.fixedType === 'left' &&
|
|
20060
|
+
if (cell.fixedType === 'left' &&
|
|
20061
|
+
cell.visible !== false &&
|
|
20062
|
+
cell.isGroup !== true) {
|
|
20027
20063
|
objHeaderWidthFixLeft[headerKey] = leftTotal;
|
|
20028
20064
|
}
|
|
20029
20065
|
if (!hasChildren) {
|
|
@@ -20031,16 +20067,22 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20031
20067
|
const width = cell.width ?? 40;
|
|
20032
20068
|
cell.index = index;
|
|
20033
20069
|
flat.push(cell);
|
|
20034
|
-
if (cell.fixedType === 'left' &&
|
|
20070
|
+
if (cell.fixedType === 'left' &&
|
|
20071
|
+
cell.visible !== false &&
|
|
20072
|
+
cell.isGroup !== true) {
|
|
20035
20073
|
objWidthFixLeft[index] = leftTotal;
|
|
20036
20074
|
leftTotal += width;
|
|
20037
20075
|
}
|
|
20038
|
-
if (cell.fixedType === 'right' &&
|
|
20076
|
+
if (cell.fixedType === 'right' &&
|
|
20077
|
+
cell.visible !== false &&
|
|
20078
|
+
cell.isGroup !== true) {
|
|
20039
20079
|
rightTotal -= width;
|
|
20040
20080
|
objWidthFixRight[index] = rightTotal;
|
|
20041
20081
|
}
|
|
20042
20082
|
}
|
|
20043
|
-
if (cell.fixedType === 'right' &&
|
|
20083
|
+
if (cell.fixedType === 'right' &&
|
|
20084
|
+
cell.visible !== false &&
|
|
20085
|
+
cell.isGroup !== true) {
|
|
20044
20086
|
objHeaderWidthFixRight[headerKey] = rightTotal;
|
|
20045
20087
|
}
|
|
20046
20088
|
return colspanSum + colspan;
|
|
@@ -20053,13 +20095,20 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20053
20095
|
traverse(columns);
|
|
20054
20096
|
// Danh sách các cột được hiển thị
|
|
20055
20097
|
// const flatVisble = flat.filter((e) => e.visible !== false)
|
|
20056
|
-
const flatVisbleContent = flat.filter((x) => x.visible !== false &&
|
|
20098
|
+
const flatVisbleContent = flat.filter((x) => x.visible !== false &&
|
|
20099
|
+
x.field !== 'command' &&
|
|
20100
|
+
x.field !== '#' &&
|
|
20101
|
+
x.field !== 'checkbox');
|
|
20057
20102
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột cố định
|
|
20058
20103
|
const lastObjWidthFixLeft = Math.max(...Object.keys(objWidthFixLeft).map(Number), 0);
|
|
20059
20104
|
const fisrtObjWidthFixRight = Math.min(...Object.keys(objWidthFixRight).map(Number), flat.length);
|
|
20060
20105
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột có thể sửa
|
|
20061
20106
|
const indexFirstEdit = flat.findIndex((item) => item.editEnable && item.visible !== false && !item.disabledCondition);
|
|
20062
|
-
const indexLastEdit = flat
|
|
20107
|
+
const indexLastEdit = flat
|
|
20108
|
+
.map((item, idx) => item.editEnable && item.visible !== false && !item.disabledCondition
|
|
20109
|
+
? idx
|
|
20110
|
+
: -1)
|
|
20111
|
+
.reduce((acc, val) => (val > acc ? val : acc), -1);
|
|
20063
20112
|
return {
|
|
20064
20113
|
levels,
|
|
20065
20114
|
flat,
|
|
@@ -20072,7 +20121,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20072
20121
|
objHeaderWidthFixRight,
|
|
20073
20122
|
objHeaderWidthFixLeft,
|
|
20074
20123
|
indexFirstEdit,
|
|
20075
|
-
indexLastEdit
|
|
20124
|
+
indexLastEdit,
|
|
20076
20125
|
};
|
|
20077
20126
|
};
|
|
20078
20127
|
/**
|
|
@@ -20082,7 +20131,10 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20082
20131
|
const isFilterMatch = filters.every((filter) => {
|
|
20083
20132
|
const { key, value, ope } = filter;
|
|
20084
20133
|
const rowValue = row[key];
|
|
20085
|
-
if (rowValue === undefined ||
|
|
20134
|
+
if (rowValue === undefined ||
|
|
20135
|
+
rowValue === null ||
|
|
20136
|
+
value === undefined ||
|
|
20137
|
+
value === null) {
|
|
20086
20138
|
return false;
|
|
20087
20139
|
}
|
|
20088
20140
|
const valStr = String(rowValue).toLowerCase();
|
|
@@ -20115,7 +20167,10 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20115
20167
|
const isSearchMatch = !keyword ||
|
|
20116
20168
|
searchKeys.some((key) => {
|
|
20117
20169
|
const val = row[key];
|
|
20118
|
-
return val
|
|
20170
|
+
return val
|
|
20171
|
+
?.toString()
|
|
20172
|
+
.toLowerCase()
|
|
20173
|
+
.includes(keyword.trim().toLowerCase());
|
|
20119
20174
|
});
|
|
20120
20175
|
return isFilterMatch && isSearchMatch;
|
|
20121
20176
|
};
|
|
@@ -25669,6 +25724,72 @@ function startOfYear(date, options) {
|
|
|
25669
25724
|
return date_;
|
|
25670
25725
|
}
|
|
25671
25726
|
|
|
25727
|
+
/**
|
|
25728
|
+
* The {@link eachYearOfInterval} function options.
|
|
25729
|
+
*/
|
|
25730
|
+
|
|
25731
|
+
/**
|
|
25732
|
+
* The {@link eachYearOfInterval} function result type. It resolves the proper data type.
|
|
25733
|
+
* It uses the first argument date object type, starting from the date argument,
|
|
25734
|
+
* then the start interval date, and finally the end interval date. If
|
|
25735
|
+
* a context function is passed, it uses the context function return type.
|
|
25736
|
+
*/
|
|
25737
|
+
|
|
25738
|
+
/**
|
|
25739
|
+
* @name eachYearOfInterval
|
|
25740
|
+
* @category Interval Helpers
|
|
25741
|
+
* @summary Return the array of yearly timestamps within the specified time interval.
|
|
25742
|
+
*
|
|
25743
|
+
* @description
|
|
25744
|
+
* Return the array of yearly timestamps within the specified time interval.
|
|
25745
|
+
*
|
|
25746
|
+
* @typeParam IntervalType - Interval type.
|
|
25747
|
+
* @typeParam Options - Options type.
|
|
25748
|
+
*
|
|
25749
|
+
* @param interval - The interval.
|
|
25750
|
+
* @param options - An object with options.
|
|
25751
|
+
*
|
|
25752
|
+
* @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
|
|
25753
|
+
*
|
|
25754
|
+
* @example
|
|
25755
|
+
* // Each year between 6 February 2014 and 10 August 2017:
|
|
25756
|
+
* const result = eachYearOfInterval({
|
|
25757
|
+
* start: new Date(2014, 1, 6),
|
|
25758
|
+
* end: new Date(2017, 7, 10)
|
|
25759
|
+
* })
|
|
25760
|
+
* //=> [
|
|
25761
|
+
* // Wed Jan 01 2014 00:00:00,
|
|
25762
|
+
* // Thu Jan 01 2015 00:00:00,
|
|
25763
|
+
* // Fri Jan 01 2016 00:00:00,
|
|
25764
|
+
* // Sun Jan 01 2017 00:00:00
|
|
25765
|
+
* // ]
|
|
25766
|
+
*/
|
|
25767
|
+
function eachYearOfInterval(interval, options) {
|
|
25768
|
+
const { start, end } = normalizeInterval(options?.in, interval);
|
|
25769
|
+
|
|
25770
|
+
let reversed = +start > +end;
|
|
25771
|
+
const endTime = reversed ? +start : +end;
|
|
25772
|
+
const date = reversed ? end : start;
|
|
25773
|
+
date.setHours(0, 0, 0, 0);
|
|
25774
|
+
date.setMonth(0, 1);
|
|
25775
|
+
|
|
25776
|
+
let step = options?.step ?? 1;
|
|
25777
|
+
if (!step) return [];
|
|
25778
|
+
if (step < 0) {
|
|
25779
|
+
step = -step;
|
|
25780
|
+
reversed = !reversed;
|
|
25781
|
+
}
|
|
25782
|
+
|
|
25783
|
+
const dates = [];
|
|
25784
|
+
|
|
25785
|
+
while (+date <= endTime) {
|
|
25786
|
+
dates.push(constructFrom(start, date));
|
|
25787
|
+
date.setFullYear(date.getFullYear() + step);
|
|
25788
|
+
}
|
|
25789
|
+
|
|
25790
|
+
return reversed ? dates.reverse() : dates;
|
|
25791
|
+
}
|
|
25792
|
+
|
|
25672
25793
|
/**
|
|
25673
25794
|
* The {@link endOfWeek} function options.
|
|
25674
25795
|
*/
|
|
@@ -26377,7 +26498,7 @@ const match = {
|
|
|
26377
26498
|
* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
|
|
26378
26499
|
* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
|
|
26379
26500
|
*/
|
|
26380
|
-
const enUS = {
|
|
26501
|
+
const enUS$1 = {
|
|
26381
26502
|
code: "en-US",
|
|
26382
26503
|
formatDistance: formatDistance,
|
|
26383
26504
|
formatLong: formatLong,
|
|
@@ -27894,7 +28015,7 @@ const unescapedLatinCharacterRegExp$1 = /[a-zA-Z]/;
|
|
|
27894
28015
|
*/
|
|
27895
28016
|
function format(date, formatStr, options) {
|
|
27896
28017
|
const defaultOptions = getDefaultOptions$1();
|
|
27897
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
28018
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS$1;
|
|
27898
28019
|
|
|
27899
28020
|
const firstWeekContainsDate =
|
|
27900
28021
|
options?.firstWeekContainsDate ??
|
|
@@ -30587,7 +30708,7 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
30587
30708
|
function parse(dateStr, formatStr, referenceDate, options) {
|
|
30588
30709
|
const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);
|
|
30589
30710
|
const defaultOptions = getDefaultOptions();
|
|
30590
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
30711
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS$1;
|
|
30591
30712
|
|
|
30592
30713
|
const firstWeekContainsDate =
|
|
30593
30714
|
options?.firstWeekContainsDate ??
|
|
@@ -31393,6 +31514,69 @@ function endOfBroadcastWeek(date, dateLib) {
|
|
|
31393
31514
|
return endDate;
|
|
31394
31515
|
}
|
|
31395
31516
|
|
|
31517
|
+
/** English (United States) locale extended with DayPicker-specific translations. */
|
|
31518
|
+
const enUS = {
|
|
31519
|
+
...enUS$1,
|
|
31520
|
+
labels: {
|
|
31521
|
+
labelDayButton: (date, modifiers, options, dateLib) => {
|
|
31522
|
+
let formatDate;
|
|
31523
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31524
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31525
|
+
}
|
|
31526
|
+
else {
|
|
31527
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31528
|
+
}
|
|
31529
|
+
let label = formatDate(date, "PPPP");
|
|
31530
|
+
if (modifiers.today)
|
|
31531
|
+
label = `Today, ${label}`;
|
|
31532
|
+
if (modifiers.selected)
|
|
31533
|
+
label = `${label}, selected`;
|
|
31534
|
+
return label;
|
|
31535
|
+
},
|
|
31536
|
+
labelMonthDropdown: "Choose the Month",
|
|
31537
|
+
labelNext: "Go to the Next Month",
|
|
31538
|
+
labelPrevious: "Go to the Previous Month",
|
|
31539
|
+
labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
|
|
31540
|
+
labelYearDropdown: "Choose the Year",
|
|
31541
|
+
labelGrid: (date, options, dateLib) => {
|
|
31542
|
+
let formatDate;
|
|
31543
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31544
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31545
|
+
}
|
|
31546
|
+
else {
|
|
31547
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31548
|
+
}
|
|
31549
|
+
return formatDate(date, "LLLL yyyy");
|
|
31550
|
+
},
|
|
31551
|
+
labelGridcell: (date, modifiers, options, dateLib) => {
|
|
31552
|
+
let formatDate;
|
|
31553
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31554
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31555
|
+
}
|
|
31556
|
+
else {
|
|
31557
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31558
|
+
}
|
|
31559
|
+
let label = formatDate(date, "PPPP");
|
|
31560
|
+
if (modifiers?.today) {
|
|
31561
|
+
label = `Today, ${label}`;
|
|
31562
|
+
}
|
|
31563
|
+
return label;
|
|
31564
|
+
},
|
|
31565
|
+
labelNav: "Navigation bar",
|
|
31566
|
+
labelWeekNumberHeader: "Week Number",
|
|
31567
|
+
labelWeekday: (date, options, dateLib) => {
|
|
31568
|
+
let formatDate;
|
|
31569
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31570
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31571
|
+
}
|
|
31572
|
+
else {
|
|
31573
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31574
|
+
}
|
|
31575
|
+
return formatDate(date, "cccc");
|
|
31576
|
+
},
|
|
31577
|
+
},
|
|
31578
|
+
};
|
|
31579
|
+
|
|
31396
31580
|
/**
|
|
31397
31581
|
* A wrapper class around [date-fns](http://date-fns.org) that provides utility
|
|
31398
31582
|
* methods for date manipulation and formatting.
|
|
@@ -31531,6 +31715,31 @@ class DateLib {
|
|
|
31531
31715
|
? this.overrides.eachMonthOfInterval(interval)
|
|
31532
31716
|
: eachMonthOfInterval(interval);
|
|
31533
31717
|
};
|
|
31718
|
+
/**
|
|
31719
|
+
* Returns the years between the given dates.
|
|
31720
|
+
*
|
|
31721
|
+
* @since 9.11.1
|
|
31722
|
+
* @param interval The interval to get the years for.
|
|
31723
|
+
* @returns The array of years in the interval.
|
|
31724
|
+
*/
|
|
31725
|
+
this.eachYearOfInterval = (interval) => {
|
|
31726
|
+
const years = this.overrides?.eachYearOfInterval
|
|
31727
|
+
? this.overrides.eachYearOfInterval(interval)
|
|
31728
|
+
: eachYearOfInterval(interval);
|
|
31729
|
+
// Remove duplicates that may happen across DST transitions (e.g., "America/Sao_Paulo")
|
|
31730
|
+
// See https://github.com/date-fns/tz/issues/72
|
|
31731
|
+
const uniqueYears = new Set(years.map((d) => this.getYear(d)));
|
|
31732
|
+
if (uniqueYears.size === years.length) {
|
|
31733
|
+
// No duplicates, return as is
|
|
31734
|
+
return years;
|
|
31735
|
+
}
|
|
31736
|
+
// Rebuild the array to ensure one date per year
|
|
31737
|
+
const yearsArray = [];
|
|
31738
|
+
uniqueYears.forEach((y) => {
|
|
31739
|
+
yearsArray.push(new Date(y, 0, 1));
|
|
31740
|
+
});
|
|
31741
|
+
return yearsArray;
|
|
31742
|
+
};
|
|
31534
31743
|
/**
|
|
31535
31744
|
* Returns the end of the broadcast week for the given date.
|
|
31536
31745
|
*
|
|
@@ -31869,7 +32078,63 @@ class DateLib {
|
|
|
31869
32078
|
formatNumber(value) {
|
|
31870
32079
|
return this.replaceDigits(value.toString());
|
|
31871
32080
|
}
|
|
31872
|
-
|
|
32081
|
+
/**
|
|
32082
|
+
* Returns the preferred ordering for month and year labels for the current
|
|
32083
|
+
* locale.
|
|
32084
|
+
*/
|
|
32085
|
+
getMonthYearOrder() {
|
|
32086
|
+
const code = this.options.locale?.code;
|
|
32087
|
+
if (!code) {
|
|
32088
|
+
return "month-first";
|
|
32089
|
+
}
|
|
32090
|
+
return DateLib.yearFirstLocales.has(code) ? "year-first" : "month-first";
|
|
32091
|
+
}
|
|
32092
|
+
/**
|
|
32093
|
+
* Formats the month/year pair respecting locale conventions.
|
|
32094
|
+
*
|
|
32095
|
+
* @since 9.11.0
|
|
32096
|
+
*/
|
|
32097
|
+
formatMonthYear(date) {
|
|
32098
|
+
const { locale, timeZone, numerals } = this.options;
|
|
32099
|
+
const localeCode = locale?.code;
|
|
32100
|
+
if (localeCode && DateLib.yearFirstLocales.has(localeCode)) {
|
|
32101
|
+
try {
|
|
32102
|
+
const intl = new Intl.DateTimeFormat(localeCode, {
|
|
32103
|
+
month: "long",
|
|
32104
|
+
year: "numeric",
|
|
32105
|
+
timeZone,
|
|
32106
|
+
numberingSystem: numerals,
|
|
32107
|
+
});
|
|
32108
|
+
const formatted = intl.format(date);
|
|
32109
|
+
return formatted;
|
|
32110
|
+
}
|
|
32111
|
+
catch {
|
|
32112
|
+
// Fallback to date-fns formatting below.
|
|
32113
|
+
}
|
|
32114
|
+
}
|
|
32115
|
+
const pattern = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
32116
|
+
return this.format(date, pattern);
|
|
32117
|
+
}
|
|
32118
|
+
}
|
|
32119
|
+
DateLib.yearFirstLocales = new Set([
|
|
32120
|
+
"eu",
|
|
32121
|
+
"hu",
|
|
32122
|
+
"ja",
|
|
32123
|
+
"ja-Hira",
|
|
32124
|
+
"ja-JP",
|
|
32125
|
+
"ko",
|
|
32126
|
+
"ko-KR",
|
|
32127
|
+
"lt",
|
|
32128
|
+
"lt-LT",
|
|
32129
|
+
"lv",
|
|
32130
|
+
"lv-LV",
|
|
32131
|
+
"mn",
|
|
32132
|
+
"mn-MN",
|
|
32133
|
+
"zh",
|
|
32134
|
+
"zh-CN",
|
|
32135
|
+
"zh-HK",
|
|
32136
|
+
"zh-TW",
|
|
32137
|
+
]);
|
|
31873
32138
|
/**
|
|
31874
32139
|
* The default date library with English locale.
|
|
31875
32140
|
*
|
|
@@ -31890,6 +32155,9 @@ class CalendarDay {
|
|
|
31890
32155
|
this.displayMonth = displayMonth;
|
|
31891
32156
|
this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
|
|
31892
32157
|
this.dateLib = dateLib;
|
|
32158
|
+
this.isoDate = dateLib.format(date, "yyyy-MM-dd");
|
|
32159
|
+
this.displayMonthId = dateLib.format(displayMonth, "yyyy-MM");
|
|
32160
|
+
this.dateMonthId = dateLib.format(date, "yyyy-MM");
|
|
31893
32161
|
}
|
|
31894
32162
|
/**
|
|
31895
32163
|
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
@@ -32065,7 +32333,7 @@ var UI;
|
|
|
32065
32333
|
/** The dropdown with the years. */
|
|
32066
32334
|
UI["YearsDropdown"] = "years_dropdown";
|
|
32067
32335
|
})(UI || (UI = {}));
|
|
32068
|
-
/** Enum representing flags for the {@link UI.Day} element. */
|
|
32336
|
+
/** Enum representing flags for the {@link UI | UI.Day} element. */
|
|
32069
32337
|
var DayFlag;
|
|
32070
32338
|
(function (DayFlag) {
|
|
32071
32339
|
/** The day is disabled. */
|
|
@@ -32080,8 +32348,8 @@ var DayFlag;
|
|
|
32080
32348
|
DayFlag["today"] = "today";
|
|
32081
32349
|
})(DayFlag || (DayFlag = {}));
|
|
32082
32350
|
/**
|
|
32083
|
-
* Enum representing selection states that can be applied to the
|
|
32084
|
-
* element in selection mode.
|
|
32351
|
+
* Enum representing selection states that can be applied to the
|
|
32352
|
+
* {@link UI | UI.Day} element in selection mode.
|
|
32085
32353
|
*/
|
|
32086
32354
|
var SelectionState;
|
|
32087
32355
|
(function (SelectionState) {
|
|
@@ -32531,7 +32799,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32531
32799
|
return isSameDay(date, matcher);
|
|
32532
32800
|
}
|
|
32533
32801
|
if (isDatesArray(matcher, dateLib)) {
|
|
32534
|
-
return matcher.
|
|
32802
|
+
return matcher.some((matcherDate) => isSameDay(date, matcherDate));
|
|
32535
32803
|
}
|
|
32536
32804
|
if (isDateRange(matcher)) {
|
|
32537
32805
|
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
@@ -32582,7 +32850,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32582
32850
|
* @returns A function that retrieves the modifiers for a given `CalendarDay`.
|
|
32583
32851
|
*/
|
|
32584
32852
|
function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
32585
|
-
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today, } = props;
|
|
32853
|
+
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today = dateLib.today(), } = props;
|
|
32586
32854
|
const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter, } = dateLib;
|
|
32587
32855
|
const computedNavStart = navStart && startOfMonth(navStart);
|
|
32588
32856
|
const computedNavEnd = navEnd && endOfMonth(navEnd);
|
|
@@ -32606,7 +32874,7 @@ function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
|
32606
32874
|
// Broadcast calendar will show outside days as default
|
|
32607
32875
|
(!broadcastCalendar && !showOutsideDays && isOutside) ||
|
|
32608
32876
|
(broadcastCalendar && showOutsideDays === false && isOutside);
|
|
32609
|
-
const isToday = isSameDay(date, today
|
|
32877
|
+
const isToday = isSameDay(date, today);
|
|
32610
32878
|
if (isOutside)
|
|
32611
32879
|
internalModifiersMap.outside.push(day);
|
|
32612
32880
|
if (isDisabled)
|
|
@@ -32765,7 +33033,7 @@ function getDefaultClassNames() {
|
|
|
32765
33033
|
/**
|
|
32766
33034
|
* Formats the caption of the month.
|
|
32767
33035
|
*
|
|
32768
|
-
* @defaultValue
|
|
33036
|
+
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
|
|
32769
33037
|
* @param month The date representing the month.
|
|
32770
33038
|
* @param options Configuration options for the date library.
|
|
32771
33039
|
* @param dateLib The date library to use for formatting. If not provided, a new
|
|
@@ -32775,7 +33043,8 @@ function getDefaultClassNames() {
|
|
|
32775
33043
|
* @see https://daypicker.dev/docs/translation#custom-formatters
|
|
32776
33044
|
*/
|
|
32777
33045
|
function formatCaption(month, options, dateLib) {
|
|
32778
|
-
|
|
33046
|
+
const lib = dateLib ?? new DateLib(options);
|
|
33047
|
+
return lib.formatMonthYear(month);
|
|
32779
33048
|
}
|
|
32780
33049
|
/**
|
|
32781
33050
|
* @private
|
|
@@ -32915,127 +33184,6 @@ function getFormatters(customFormatters) {
|
|
|
32915
33184
|
};
|
|
32916
33185
|
}
|
|
32917
33186
|
|
|
32918
|
-
/**
|
|
32919
|
-
* Returns the months to show in the dropdown.
|
|
32920
|
-
*
|
|
32921
|
-
* This function generates a list of months for the current year, formatted
|
|
32922
|
-
* using the provided formatter, and determines whether each month should be
|
|
32923
|
-
* disabled based on the navigation range.
|
|
32924
|
-
*
|
|
32925
|
-
* @param displayMonth The currently displayed month.
|
|
32926
|
-
* @param navStart The start date for navigation.
|
|
32927
|
-
* @param navEnd The end date for navigation.
|
|
32928
|
-
* @param formatters The formatters to use for formatting the month labels.
|
|
32929
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32930
|
-
* @returns An array of dropdown options representing the months, or `undefined`
|
|
32931
|
-
* if no months are available.
|
|
32932
|
-
*/
|
|
32933
|
-
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
32934
|
-
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
32935
|
-
const months = eachMonthOfInterval({
|
|
32936
|
-
start: startOfYear(displayMonth),
|
|
32937
|
-
end: endOfYear(displayMonth),
|
|
32938
|
-
});
|
|
32939
|
-
const options = months.map((month) => {
|
|
32940
|
-
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
32941
|
-
const value = getMonth(month);
|
|
32942
|
-
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
32943
|
-
(navEnd && month > startOfMonth(navEnd)) ||
|
|
32944
|
-
false;
|
|
32945
|
-
return { value, label, disabled };
|
|
32946
|
-
});
|
|
32947
|
-
return options;
|
|
32948
|
-
}
|
|
32949
|
-
|
|
32950
|
-
/**
|
|
32951
|
-
* Returns the computed style for a day based on its modifiers.
|
|
32952
|
-
*
|
|
32953
|
-
* This function merges the base styles for the day with any styles associated
|
|
32954
|
-
* with active modifiers.
|
|
32955
|
-
*
|
|
32956
|
-
* @param dayModifiers The modifiers applied to the day.
|
|
32957
|
-
* @param styles The base styles for the calendar elements.
|
|
32958
|
-
* @param modifiersStyles The styles associated with specific modifiers.
|
|
32959
|
-
* @returns The computed style for the day.
|
|
32960
|
-
*/
|
|
32961
|
-
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
32962
|
-
let style = { ...styles?.[UI.Day] };
|
|
32963
|
-
Object.entries(dayModifiers)
|
|
32964
|
-
.filter(([, active]) => active === true)
|
|
32965
|
-
.forEach(([modifier]) => {
|
|
32966
|
-
style = {
|
|
32967
|
-
...style,
|
|
32968
|
-
...modifiersStyles?.[modifier],
|
|
32969
|
-
};
|
|
32970
|
-
});
|
|
32971
|
-
return style;
|
|
32972
|
-
}
|
|
32973
|
-
|
|
32974
|
-
/**
|
|
32975
|
-
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
32976
|
-
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
32977
|
-
*
|
|
32978
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32979
|
-
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
32980
|
-
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
32981
|
-
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
32982
|
-
* @returns An array of 7 dates representing the weekdays.
|
|
32983
|
-
*/
|
|
32984
|
-
function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {
|
|
32985
|
-
const today = dateLib.today();
|
|
32986
|
-
const start = broadcastCalendar
|
|
32987
|
-
? dateLib.startOfBroadcastWeek(today, dateLib)
|
|
32988
|
-
: ISOWeek
|
|
32989
|
-
? dateLib.startOfISOWeek(today)
|
|
32990
|
-
: dateLib.startOfWeek(today);
|
|
32991
|
-
const days = [];
|
|
32992
|
-
for (let i = 0; i < 7; i++) {
|
|
32993
|
-
const day = dateLib.addDays(start, i);
|
|
32994
|
-
days.push(day);
|
|
32995
|
-
}
|
|
32996
|
-
return days;
|
|
32997
|
-
}
|
|
32998
|
-
|
|
32999
|
-
/**
|
|
33000
|
-
* Returns the years to display in the dropdown.
|
|
33001
|
-
*
|
|
33002
|
-
* This function generates a list of years between the navigation start and end
|
|
33003
|
-
* dates, formatted using the provided formatter.
|
|
33004
|
-
*
|
|
33005
|
-
* @param navStart The start date for navigation.
|
|
33006
|
-
* @param navEnd The end date for navigation.
|
|
33007
|
-
* @param formatters The formatters to use for formatting the year labels.
|
|
33008
|
-
* @param dateLib The date library to use for date manipulation.
|
|
33009
|
-
* @param reverse If true, reverses the order of the years (descending).
|
|
33010
|
-
* @returns An array of dropdown options representing the years, or `undefined`
|
|
33011
|
-
* if `navStart` or `navEnd` is not provided.
|
|
33012
|
-
*/
|
|
33013
|
-
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
33014
|
-
if (!navStart)
|
|
33015
|
-
return undefined;
|
|
33016
|
-
if (!navEnd)
|
|
33017
|
-
return undefined;
|
|
33018
|
-
const { startOfYear, endOfYear, addYears, getYear, isBefore, isSameYear } = dateLib;
|
|
33019
|
-
const firstNavYear = startOfYear(navStart);
|
|
33020
|
-
const lastNavYear = endOfYear(navEnd);
|
|
33021
|
-
const years = [];
|
|
33022
|
-
let year = firstNavYear;
|
|
33023
|
-
while (isBefore(year, lastNavYear) || isSameYear(year, lastNavYear)) {
|
|
33024
|
-
years.push(year);
|
|
33025
|
-
year = addYears(year, 1);
|
|
33026
|
-
}
|
|
33027
|
-
if (reverse)
|
|
33028
|
-
years.reverse();
|
|
33029
|
-
return years.map((year) => {
|
|
33030
|
-
const label = formatters.formatYearDropdown(year, dateLib);
|
|
33031
|
-
return {
|
|
33032
|
-
value: getYear(year),
|
|
33033
|
-
label,
|
|
33034
|
-
disabled: false,
|
|
33035
|
-
};
|
|
33036
|
-
});
|
|
33037
|
-
}
|
|
33038
|
-
|
|
33039
33187
|
/**
|
|
33040
33188
|
* Generates the ARIA label for a day button.
|
|
33041
33189
|
*
|
|
@@ -33069,7 +33217,7 @@ const labelDay = labelDayButton;
|
|
|
33069
33217
|
* Generates the ARIA label for the month grid, which is announced when entering
|
|
33070
33218
|
* the grid.
|
|
33071
33219
|
*
|
|
33072
|
-
* @defaultValue
|
|
33220
|
+
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
|
|
33073
33221
|
* @param date - The date representing the month.
|
|
33074
33222
|
* @param options - Optional configuration for the date formatting library.
|
|
33075
33223
|
* @param dateLib - An optional instance of the date formatting library.
|
|
@@ -33078,7 +33226,8 @@ const labelDay = labelDayButton;
|
|
|
33078
33226
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
33079
33227
|
*/
|
|
33080
33228
|
function labelGrid(date, options, dateLib) {
|
|
33081
|
-
|
|
33229
|
+
const lib = dateLib ?? new DateLib(options);
|
|
33230
|
+
return lib.formatMonthYear(date);
|
|
33082
33231
|
}
|
|
33083
33232
|
/**
|
|
33084
33233
|
* @ignore
|
|
@@ -33130,6 +33279,7 @@ function labelNav() {
|
|
|
33130
33279
|
return "";
|
|
33131
33280
|
}
|
|
33132
33281
|
|
|
33282
|
+
const defaultLabel = "Go to the Next Month";
|
|
33133
33283
|
/**
|
|
33134
33284
|
* Generates the ARIA label for the "next month" button.
|
|
33135
33285
|
*
|
|
@@ -33140,8 +33290,8 @@ function labelNav() {
|
|
|
33140
33290
|
* @group Labels
|
|
33141
33291
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
33142
33292
|
*/
|
|
33143
|
-
function labelNext(_month) {
|
|
33144
|
-
return
|
|
33293
|
+
function labelNext(_month, _options) {
|
|
33294
|
+
return defaultLabel;
|
|
33145
33295
|
}
|
|
33146
33296
|
|
|
33147
33297
|
/**
|
|
@@ -33230,6 +33380,316 @@ var defaultLabels = /*#__PURE__*/Object.freeze({
|
|
|
33230
33380
|
labelYearDropdown: labelYearDropdown
|
|
33231
33381
|
});
|
|
33232
33382
|
|
|
33383
|
+
const resolveLabel = (defaultLabel, customLabel, localeLabel) => {
|
|
33384
|
+
if (customLabel)
|
|
33385
|
+
return customLabel;
|
|
33386
|
+
if (localeLabel) {
|
|
33387
|
+
return (typeof localeLabel === "function"
|
|
33388
|
+
? localeLabel
|
|
33389
|
+
: (..._args) => localeLabel);
|
|
33390
|
+
}
|
|
33391
|
+
return defaultLabel;
|
|
33392
|
+
};
|
|
33393
|
+
/**
|
|
33394
|
+
* Merges custom labels from the props with the default labels.
|
|
33395
|
+
*
|
|
33396
|
+
* When available, uses the locale-provided translation for `labelNext`.
|
|
33397
|
+
*
|
|
33398
|
+
* @param customLabels The custom labels provided in the DayPicker props.
|
|
33399
|
+
* @param options Options from the date library, used to resolve locale
|
|
33400
|
+
* translations.
|
|
33401
|
+
* @returns The merged labels object with locale-aware defaults.
|
|
33402
|
+
*/
|
|
33403
|
+
function getLabels(customLabels, options) {
|
|
33404
|
+
const localeLabels = options.locale?.labels ?? {};
|
|
33405
|
+
return {
|
|
33406
|
+
...defaultLabels,
|
|
33407
|
+
...(customLabels ?? {}),
|
|
33408
|
+
labelDayButton: resolveLabel(labelDayButton, customLabels?.labelDayButton, localeLabels.labelDayButton),
|
|
33409
|
+
labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels?.labelMonthDropdown, localeLabels.labelMonthDropdown),
|
|
33410
|
+
labelNext: resolveLabel(labelNext, customLabels?.labelNext, localeLabels.labelNext),
|
|
33411
|
+
labelPrevious: resolveLabel(labelPrevious, customLabels?.labelPrevious, localeLabels.labelPrevious),
|
|
33412
|
+
labelWeekNumber: resolveLabel(labelWeekNumber, customLabels?.labelWeekNumber, localeLabels.labelWeekNumber),
|
|
33413
|
+
labelYearDropdown: resolveLabel(labelYearDropdown, customLabels?.labelYearDropdown, localeLabels.labelYearDropdown),
|
|
33414
|
+
labelGrid: resolveLabel(labelGrid, customLabels?.labelGrid, localeLabels.labelGrid),
|
|
33415
|
+
labelGridcell: resolveLabel(labelGridcell, customLabels?.labelGridcell, localeLabels.labelGridcell),
|
|
33416
|
+
labelNav: resolveLabel(labelNav, customLabels?.labelNav, localeLabels.labelNav),
|
|
33417
|
+
labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels?.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
|
|
33418
|
+
labelWeekday: resolveLabel(labelWeekday, customLabels?.labelWeekday, localeLabels.labelWeekday),
|
|
33419
|
+
};
|
|
33420
|
+
}
|
|
33421
|
+
|
|
33422
|
+
/**
|
|
33423
|
+
* Returns the months to show in the dropdown.
|
|
33424
|
+
*
|
|
33425
|
+
* This function generates a list of months for the current year, formatted
|
|
33426
|
+
* using the provided formatter, and determines whether each month should be
|
|
33427
|
+
* disabled based on the navigation range.
|
|
33428
|
+
*
|
|
33429
|
+
* @param displayMonth The currently displayed month.
|
|
33430
|
+
* @param navStart The start date for navigation.
|
|
33431
|
+
* @param navEnd The end date for navigation.
|
|
33432
|
+
* @param formatters The formatters to use for formatting the month labels.
|
|
33433
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33434
|
+
* @returns An array of dropdown options representing the months, or `undefined`
|
|
33435
|
+
* if no months are available.
|
|
33436
|
+
*/
|
|
33437
|
+
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
33438
|
+
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
33439
|
+
const months = eachMonthOfInterval({
|
|
33440
|
+
start: startOfYear(displayMonth),
|
|
33441
|
+
end: endOfYear(displayMonth),
|
|
33442
|
+
});
|
|
33443
|
+
const options = months.map((month) => {
|
|
33444
|
+
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
33445
|
+
const value = getMonth(month);
|
|
33446
|
+
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
33447
|
+
(navEnd && month > startOfMonth(navEnd)) ||
|
|
33448
|
+
false;
|
|
33449
|
+
return { value, label, disabled };
|
|
33450
|
+
});
|
|
33451
|
+
return options;
|
|
33452
|
+
}
|
|
33453
|
+
|
|
33454
|
+
/**
|
|
33455
|
+
* Returns the computed style for a day based on its modifiers.
|
|
33456
|
+
*
|
|
33457
|
+
* This function merges the base styles for the day with any styles associated
|
|
33458
|
+
* with active modifiers.
|
|
33459
|
+
*
|
|
33460
|
+
* @param dayModifiers The modifiers applied to the day.
|
|
33461
|
+
* @param styles The base styles for the calendar elements.
|
|
33462
|
+
* @param modifiersStyles The styles associated with specific modifiers.
|
|
33463
|
+
* @returns The computed style for the day.
|
|
33464
|
+
*/
|
|
33465
|
+
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
33466
|
+
let style = { ...styles?.[UI.Day] };
|
|
33467
|
+
Object.entries(dayModifiers)
|
|
33468
|
+
.filter(([, active]) => active === true)
|
|
33469
|
+
.forEach(([modifier]) => {
|
|
33470
|
+
style = {
|
|
33471
|
+
...style,
|
|
33472
|
+
...modifiersStyles?.[modifier],
|
|
33473
|
+
};
|
|
33474
|
+
});
|
|
33475
|
+
return style;
|
|
33476
|
+
}
|
|
33477
|
+
|
|
33478
|
+
/**
|
|
33479
|
+
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
33480
|
+
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
33481
|
+
*
|
|
33482
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33483
|
+
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
33484
|
+
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
33485
|
+
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
33486
|
+
* @returns An array of 7 dates representing the weekdays.
|
|
33487
|
+
*/
|
|
33488
|
+
function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
|
|
33489
|
+
const referenceToday = today ?? dateLib.today();
|
|
33490
|
+
const start = broadcastCalendar
|
|
33491
|
+
? dateLib.startOfBroadcastWeek(referenceToday, dateLib)
|
|
33492
|
+
: ISOWeek
|
|
33493
|
+
? dateLib.startOfISOWeek(referenceToday)
|
|
33494
|
+
: dateLib.startOfWeek(referenceToday);
|
|
33495
|
+
const days = [];
|
|
33496
|
+
for (let i = 0; i < 7; i++) {
|
|
33497
|
+
const day = dateLib.addDays(start, i);
|
|
33498
|
+
days.push(day);
|
|
33499
|
+
}
|
|
33500
|
+
return days;
|
|
33501
|
+
}
|
|
33502
|
+
|
|
33503
|
+
/**
|
|
33504
|
+
* Returns the years to display in the dropdown.
|
|
33505
|
+
*
|
|
33506
|
+
* This function generates a list of years between the navigation start and end
|
|
33507
|
+
* dates, formatted using the provided formatter.
|
|
33508
|
+
*
|
|
33509
|
+
* @param navStart The start date for navigation.
|
|
33510
|
+
* @param navEnd The end date for navigation.
|
|
33511
|
+
* @param formatters The formatters to use for formatting the year labels.
|
|
33512
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33513
|
+
* @param reverse If true, reverses the order of the years (descending).
|
|
33514
|
+
* @returns An array of dropdown options representing the years, or `undefined`
|
|
33515
|
+
* if `navStart` or `navEnd` is not provided.
|
|
33516
|
+
*/
|
|
33517
|
+
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
33518
|
+
if (!navStart)
|
|
33519
|
+
return undefined;
|
|
33520
|
+
if (!navEnd)
|
|
33521
|
+
return undefined;
|
|
33522
|
+
const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
|
|
33523
|
+
const firstNavYear = startOfYear(navStart);
|
|
33524
|
+
const lastNavYear = endOfYear(navEnd);
|
|
33525
|
+
const years = eachYearOfInterval({ start: firstNavYear, end: lastNavYear });
|
|
33526
|
+
if (reverse)
|
|
33527
|
+
years.reverse();
|
|
33528
|
+
return years.map((year) => {
|
|
33529
|
+
const label = formatters.formatYearDropdown(year, dateLib);
|
|
33530
|
+
return {
|
|
33531
|
+
value: getYear(year),
|
|
33532
|
+
label,
|
|
33533
|
+
disabled: false,
|
|
33534
|
+
};
|
|
33535
|
+
});
|
|
33536
|
+
}
|
|
33537
|
+
|
|
33538
|
+
/**
|
|
33539
|
+
* Creates `dateLib` overrides that keep all calendar math at noon in the target
|
|
33540
|
+
* time zone. This avoids second-level offset changes (e.g., historical zones
|
|
33541
|
+
* with +03:41:12) from pushing dates backward across midnight.
|
|
33542
|
+
*/
|
|
33543
|
+
function createNoonOverrides(timeZone, options = {}) {
|
|
33544
|
+
const { weekStartsOn, locale } = options;
|
|
33545
|
+
const fallbackWeekStartsOn = (weekStartsOn ??
|
|
33546
|
+
locale?.options?.weekStartsOn ??
|
|
33547
|
+
0);
|
|
33548
|
+
// Keep all internal math anchored at noon in the target zone to avoid
|
|
33549
|
+
// historical second-level offsets from crossing midnight.
|
|
33550
|
+
const toNoonTZDate = (date) => {
|
|
33551
|
+
const normalizedDate = typeof date === "number" || typeof date === "string"
|
|
33552
|
+
? new Date(date)
|
|
33553
|
+
: date;
|
|
33554
|
+
return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
|
|
33555
|
+
};
|
|
33556
|
+
// Convert a value into a host `Date` that represents the same calendar day
|
|
33557
|
+
// as the target-zone noon. This is useful for helpers (e.g., date-fns week
|
|
33558
|
+
// utilities) that expect local `Date` instances rather than `TZDate`s.
|
|
33559
|
+
const toCalendarDate = (date) => {
|
|
33560
|
+
const zoned = toNoonTZDate(date);
|
|
33561
|
+
return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
|
|
33562
|
+
};
|
|
33563
|
+
return {
|
|
33564
|
+
today: () => {
|
|
33565
|
+
return toNoonTZDate(TZDate.tz(timeZone));
|
|
33566
|
+
},
|
|
33567
|
+
newDate: (year, monthIndex, date) => {
|
|
33568
|
+
return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
|
|
33569
|
+
},
|
|
33570
|
+
startOfDay: (date) => {
|
|
33571
|
+
return toNoonTZDate(date);
|
|
33572
|
+
},
|
|
33573
|
+
startOfWeek: (date, options) => {
|
|
33574
|
+
const base = toNoonTZDate(date);
|
|
33575
|
+
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33576
|
+
fallbackWeekStartsOn);
|
|
33577
|
+
const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
|
|
33578
|
+
base.setDate(base.getDate() - diff);
|
|
33579
|
+
return base;
|
|
33580
|
+
},
|
|
33581
|
+
startOfISOWeek: (date) => {
|
|
33582
|
+
const base = toNoonTZDate(date);
|
|
33583
|
+
const diff = (base.getDay() - 1 + 7) % 7;
|
|
33584
|
+
base.setDate(base.getDate() - diff);
|
|
33585
|
+
return base;
|
|
33586
|
+
},
|
|
33587
|
+
startOfMonth: (date) => {
|
|
33588
|
+
const base = toNoonTZDate(date);
|
|
33589
|
+
base.setDate(1);
|
|
33590
|
+
return base;
|
|
33591
|
+
},
|
|
33592
|
+
startOfYear: (date) => {
|
|
33593
|
+
const base = toNoonTZDate(date);
|
|
33594
|
+
base.setMonth(0, 1);
|
|
33595
|
+
return base;
|
|
33596
|
+
},
|
|
33597
|
+
endOfWeek: (date, options) => {
|
|
33598
|
+
const base = toNoonTZDate(date);
|
|
33599
|
+
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33600
|
+
fallbackWeekStartsOn);
|
|
33601
|
+
const endDow = (weekStartsOnValue + 6) % 7;
|
|
33602
|
+
const diff = (endDow - base.getDay() + 7) % 7;
|
|
33603
|
+
base.setDate(base.getDate() + diff);
|
|
33604
|
+
return base;
|
|
33605
|
+
},
|
|
33606
|
+
endOfISOWeek: (date) => {
|
|
33607
|
+
const base = toNoonTZDate(date);
|
|
33608
|
+
const diff = (7 - base.getDay()) % 7;
|
|
33609
|
+
base.setDate(base.getDate() + diff);
|
|
33610
|
+
return base;
|
|
33611
|
+
},
|
|
33612
|
+
endOfMonth: (date) => {
|
|
33613
|
+
const base = toNoonTZDate(date);
|
|
33614
|
+
base.setMonth(base.getMonth() + 1, 0);
|
|
33615
|
+
return base;
|
|
33616
|
+
},
|
|
33617
|
+
endOfYear: (date) => {
|
|
33618
|
+
const base = toNoonTZDate(date);
|
|
33619
|
+
base.setMonth(11, 31);
|
|
33620
|
+
return base;
|
|
33621
|
+
},
|
|
33622
|
+
eachMonthOfInterval: (interval) => {
|
|
33623
|
+
const start = toNoonTZDate(interval.start);
|
|
33624
|
+
const end = toNoonTZDate(interval.end);
|
|
33625
|
+
const result = [];
|
|
33626
|
+
const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
|
|
33627
|
+
const endKey = end.getFullYear() * 12 + end.getMonth();
|
|
33628
|
+
while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
|
|
33629
|
+
result.push(new TZDate(cursor, timeZone));
|
|
33630
|
+
cursor.setMonth(cursor.getMonth() + 1, 1);
|
|
33631
|
+
}
|
|
33632
|
+
return result;
|
|
33633
|
+
},
|
|
33634
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
33635
|
+
// mutate the same TZDate, and return it.
|
|
33636
|
+
addDays: (date, amount) => {
|
|
33637
|
+
const base = toNoonTZDate(date);
|
|
33638
|
+
base.setDate(base.getDate() + amount);
|
|
33639
|
+
return base;
|
|
33640
|
+
},
|
|
33641
|
+
addWeeks: (date, amount) => {
|
|
33642
|
+
const base = toNoonTZDate(date);
|
|
33643
|
+
base.setDate(base.getDate() + amount * 7);
|
|
33644
|
+
return base;
|
|
33645
|
+
},
|
|
33646
|
+
addMonths: (date, amount) => {
|
|
33647
|
+
const base = toNoonTZDate(date);
|
|
33648
|
+
base.setMonth(base.getMonth() + amount);
|
|
33649
|
+
return base;
|
|
33650
|
+
},
|
|
33651
|
+
addYears: (date, amount) => {
|
|
33652
|
+
const base = toNoonTZDate(date);
|
|
33653
|
+
base.setFullYear(base.getFullYear() + amount);
|
|
33654
|
+
return base;
|
|
33655
|
+
},
|
|
33656
|
+
eachYearOfInterval: (interval) => {
|
|
33657
|
+
const start = toNoonTZDate(interval.start);
|
|
33658
|
+
const end = toNoonTZDate(interval.end);
|
|
33659
|
+
const years = [];
|
|
33660
|
+
const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
|
|
33661
|
+
while (cursor.getFullYear() <= end.getFullYear()) {
|
|
33662
|
+
years.push(new TZDate(cursor, timeZone));
|
|
33663
|
+
cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
|
|
33664
|
+
}
|
|
33665
|
+
return years;
|
|
33666
|
+
},
|
|
33667
|
+
getWeek: (date, options) => {
|
|
33668
|
+
const base = toCalendarDate(date);
|
|
33669
|
+
return getWeek(base, {
|
|
33670
|
+
weekStartsOn: options?.weekStartsOn ?? fallbackWeekStartsOn,
|
|
33671
|
+
firstWeekContainsDate: options?.firstWeekContainsDate ??
|
|
33672
|
+
locale?.options?.firstWeekContainsDate ??
|
|
33673
|
+
1,
|
|
33674
|
+
});
|
|
33675
|
+
},
|
|
33676
|
+
getISOWeek: (date) => {
|
|
33677
|
+
const base = toCalendarDate(date);
|
|
33678
|
+
return getISOWeek(base);
|
|
33679
|
+
},
|
|
33680
|
+
differenceInCalendarDays: (dateLeft, dateRight) => {
|
|
33681
|
+
const left = toCalendarDate(dateLeft);
|
|
33682
|
+
const right = toCalendarDate(dateRight);
|
|
33683
|
+
return differenceInCalendarDays(left, right);
|
|
33684
|
+
},
|
|
33685
|
+
differenceInCalendarMonths: (dateLeft, dateRight) => {
|
|
33686
|
+
const left = toCalendarDate(dateLeft);
|
|
33687
|
+
const right = toCalendarDate(dateRight);
|
|
33688
|
+
return differenceInCalendarMonths(left, right);
|
|
33689
|
+
},
|
|
33690
|
+
};
|
|
33691
|
+
}
|
|
33692
|
+
|
|
33233
33693
|
const asHtmlElement = (element) => {
|
|
33234
33694
|
if (element instanceof HTMLElement)
|
|
33235
33695
|
return element;
|
|
@@ -33422,19 +33882,27 @@ function getDates(displayMonths, maxDate, props, dateLib) {
|
|
|
33422
33882
|
: ISOWeek
|
|
33423
33883
|
? startOfISOWeek(firstMonth)
|
|
33424
33884
|
: startOfWeek(firstMonth);
|
|
33425
|
-
const
|
|
33885
|
+
const displayMonthsWeekEnd = broadcastCalendar
|
|
33426
33886
|
? endOfBroadcastWeek(lastMonth)
|
|
33427
33887
|
: ISOWeek
|
|
33428
33888
|
? endOfISOWeek(endOfMonth(lastMonth))
|
|
33429
33889
|
: endOfWeek(endOfMonth(lastMonth));
|
|
33430
|
-
|
|
33890
|
+
// If maxDate is set, clamp the grid to the end of that week.
|
|
33891
|
+
const constraintWeekEnd = maxDate &&
|
|
33892
|
+
(broadcastCalendar
|
|
33893
|
+
? endOfBroadcastWeek(maxDate)
|
|
33894
|
+
: ISOWeek
|
|
33895
|
+
? endOfISOWeek(maxDate)
|
|
33896
|
+
: endOfWeek(maxDate));
|
|
33897
|
+
// Pick the earliest week end between the displayed months and the constraint.
|
|
33898
|
+
const gridEndDate = constraintWeekEnd && isAfter(displayMonthsWeekEnd, constraintWeekEnd)
|
|
33899
|
+
? constraintWeekEnd
|
|
33900
|
+
: displayMonthsWeekEnd;
|
|
33901
|
+
const nOfDays = differenceInCalendarDays(gridEndDate, startWeekFirstDate);
|
|
33431
33902
|
const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;
|
|
33432
33903
|
const dates = [];
|
|
33433
33904
|
for (let i = 0; i <= nOfDays; i++) {
|
|
33434
33905
|
const date = addDays(startWeekFirstDate, i);
|
|
33435
|
-
if (maxDate && isAfter(date, maxDate)) {
|
|
33436
|
-
break;
|
|
33437
|
-
}
|
|
33438
33906
|
dates.push(date);
|
|
33439
33907
|
}
|
|
33440
33908
|
// If fixed weeks is enabled, add the extra dates to the array
|
|
@@ -33765,17 +34233,45 @@ function useCalendar(props, dateLib) {
|
|
|
33765
34233
|
setFirstMonth(newInitialMonth);
|
|
33766
34234
|
}, [props.timeZone]);
|
|
33767
34235
|
/** The months displayed in the calendar. */
|
|
33768
|
-
|
|
33769
|
-
|
|
33770
|
-
|
|
33771
|
-
|
|
33772
|
-
|
|
33773
|
-
|
|
33774
|
-
|
|
33775
|
-
|
|
33776
|
-
|
|
33777
|
-
|
|
33778
|
-
|
|
34236
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: We want to recompute only when specific props change.
|
|
34237
|
+
const { months, weeks, days, previousMonth, nextMonth } = React$5.useMemo(() => {
|
|
34238
|
+
const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);
|
|
34239
|
+
const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, {
|
|
34240
|
+
ISOWeek: props.ISOWeek,
|
|
34241
|
+
fixedWeeks: props.fixedWeeks,
|
|
34242
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
34243
|
+
}, dateLib);
|
|
34244
|
+
const months = getMonths(displayMonths, dates, {
|
|
34245
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
34246
|
+
fixedWeeks: props.fixedWeeks,
|
|
34247
|
+
ISOWeek: props.ISOWeek,
|
|
34248
|
+
reverseMonths: props.reverseMonths,
|
|
34249
|
+
}, dateLib);
|
|
34250
|
+
const weeks = getWeeks(months);
|
|
34251
|
+
const days = getDays(months);
|
|
34252
|
+
const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
34253
|
+
const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
34254
|
+
return {
|
|
34255
|
+
months,
|
|
34256
|
+
weeks,
|
|
34257
|
+
days,
|
|
34258
|
+
previousMonth,
|
|
34259
|
+
nextMonth,
|
|
34260
|
+
};
|
|
34261
|
+
}, [
|
|
34262
|
+
dateLib,
|
|
34263
|
+
firstMonth.getTime(),
|
|
34264
|
+
navEnd?.getTime(),
|
|
34265
|
+
navStart?.getTime(),
|
|
34266
|
+
props.disableNavigation,
|
|
34267
|
+
props.broadcastCalendar,
|
|
34268
|
+
props.endMonth?.getTime(),
|
|
34269
|
+
props.fixedWeeks,
|
|
34270
|
+
props.ISOWeek,
|
|
34271
|
+
props.numberOfMonths,
|
|
34272
|
+
props.pagedNavigation,
|
|
34273
|
+
props.reverseMonths,
|
|
34274
|
+
]);
|
|
33779
34275
|
const { disableNavigation, onMonthChange } = props;
|
|
33780
34276
|
const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
|
|
33781
34277
|
const goToMonth = (date) => {
|
|
@@ -33994,6 +34490,12 @@ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
|
33994
34490
|
const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
|
|
33995
34491
|
if (!nextFocus)
|
|
33996
34492
|
return;
|
|
34493
|
+
if (props.disableNavigation) {
|
|
34494
|
+
const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
|
|
34495
|
+
if (!isNextInCalendar) {
|
|
34496
|
+
return;
|
|
34497
|
+
}
|
|
34498
|
+
}
|
|
33997
34499
|
calendar.goToDay(nextFocus);
|
|
33998
34500
|
setFocused(nextFocus);
|
|
33999
34501
|
};
|
|
@@ -34276,15 +34778,33 @@ function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
|
|
|
34276
34778
|
* range, and a function to check if a date is within the range.
|
|
34277
34779
|
*/
|
|
34278
34780
|
function useRange(props, dateLib) {
|
|
34279
|
-
const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect, } = props;
|
|
34781
|
+
const { disabled, excludeDisabled, resetOnSelect, selected: initiallySelected, required, onSelect, } = props;
|
|
34280
34782
|
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
|
|
34281
34783
|
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
34282
34784
|
const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
|
|
34283
34785
|
const select = (triggerDate, modifiers, e) => {
|
|
34284
34786
|
const { min, max } = props;
|
|
34285
|
-
|
|
34286
|
-
|
|
34287
|
-
|
|
34787
|
+
let newRange;
|
|
34788
|
+
if (triggerDate) {
|
|
34789
|
+
const selectedFrom = selected?.from;
|
|
34790
|
+
const selectedTo = selected?.to;
|
|
34791
|
+
const hasFullRange = !!selectedFrom && !!selectedTo;
|
|
34792
|
+
const isClickingSingleDayRange = !!selectedFrom &&
|
|
34793
|
+
!!selectedTo &&
|
|
34794
|
+
dateLib.isSameDay(selectedFrom, selectedTo) &&
|
|
34795
|
+
dateLib.isSameDay(triggerDate, selectedFrom);
|
|
34796
|
+
if (resetOnSelect && (hasFullRange || !selected?.from)) {
|
|
34797
|
+
if (!required && isClickingSingleDayRange) {
|
|
34798
|
+
newRange = undefined;
|
|
34799
|
+
}
|
|
34800
|
+
else {
|
|
34801
|
+
newRange = { from: triggerDate, to: undefined };
|
|
34802
|
+
}
|
|
34803
|
+
}
|
|
34804
|
+
else {
|
|
34805
|
+
newRange = addToRange(triggerDate, selected, min, max, required, dateLib);
|
|
34806
|
+
}
|
|
34807
|
+
}
|
|
34288
34808
|
if (excludeDisabled && disabled && newRange?.from && newRange.to) {
|
|
34289
34809
|
if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {
|
|
34290
34810
|
// if a disabled days is found, the range is reset
|
|
@@ -34372,6 +34892,78 @@ function useSelection(props, dateLib) {
|
|
|
34372
34892
|
}
|
|
34373
34893
|
}
|
|
34374
34894
|
|
|
34895
|
+
/**
|
|
34896
|
+
* Convert a {@link Date} or {@link TZDate} instance to the given time zone.
|
|
34897
|
+
* Reuses the same instance when it is already a {@link TZDate} using the target
|
|
34898
|
+
* time zone to avoid extra allocations.
|
|
34899
|
+
*/
|
|
34900
|
+
function toTimeZone(date, timeZone) {
|
|
34901
|
+
if (date instanceof TZDate && date.timeZone === timeZone) {
|
|
34902
|
+
return date;
|
|
34903
|
+
}
|
|
34904
|
+
return new TZDate(date, timeZone);
|
|
34905
|
+
}
|
|
34906
|
+
|
|
34907
|
+
function toZoneNoon(date, timeZone, noonSafe) {
|
|
34908
|
+
if (!noonSafe)
|
|
34909
|
+
return toTimeZone(date, timeZone);
|
|
34910
|
+
const zoned = toTimeZone(date, timeZone);
|
|
34911
|
+
const noonZoned = new TZDate(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 12, 0, 0, timeZone);
|
|
34912
|
+
return new Date(noonZoned.getTime());
|
|
34913
|
+
}
|
|
34914
|
+
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
34915
|
+
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
34916
|
+
return matcher;
|
|
34917
|
+
}
|
|
34918
|
+
if (matcher instanceof Date) {
|
|
34919
|
+
return toZoneNoon(matcher, timeZone, noonSafe);
|
|
34920
|
+
}
|
|
34921
|
+
if (Array.isArray(matcher)) {
|
|
34922
|
+
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone, noonSafe) : value);
|
|
34923
|
+
}
|
|
34924
|
+
if (isDateRange(matcher)) {
|
|
34925
|
+
return {
|
|
34926
|
+
...matcher,
|
|
34927
|
+
from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
|
|
34928
|
+
to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to,
|
|
34929
|
+
};
|
|
34930
|
+
}
|
|
34931
|
+
if (isDateInterval(matcher)) {
|
|
34932
|
+
return {
|
|
34933
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34934
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34935
|
+
};
|
|
34936
|
+
}
|
|
34937
|
+
if (isDateAfterType(matcher)) {
|
|
34938
|
+
return {
|
|
34939
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34940
|
+
};
|
|
34941
|
+
}
|
|
34942
|
+
if (isDateBeforeType(matcher)) {
|
|
34943
|
+
return {
|
|
34944
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34945
|
+
};
|
|
34946
|
+
}
|
|
34947
|
+
return matcher;
|
|
34948
|
+
}
|
|
34949
|
+
/**
|
|
34950
|
+
* Convert any {@link Matcher} or array of matchers to the specified time zone.
|
|
34951
|
+
*
|
|
34952
|
+
* @param matchers - The matcher or matchers to convert.
|
|
34953
|
+
* @param timeZone - The target IANA time zone.
|
|
34954
|
+
* @returns The converted matcher(s).
|
|
34955
|
+
* @group Utilities
|
|
34956
|
+
*/
|
|
34957
|
+
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
34958
|
+
if (!matchers) {
|
|
34959
|
+
return matchers;
|
|
34960
|
+
}
|
|
34961
|
+
if (Array.isArray(matchers)) {
|
|
34962
|
+
return matchers.map((matcher) => convertMatcher(matcher, timeZone, noonSafe));
|
|
34963
|
+
}
|
|
34964
|
+
return convertMatcher(matchers, timeZone, noonSafe);
|
|
34965
|
+
}
|
|
34966
|
+
|
|
34375
34967
|
/**
|
|
34376
34968
|
* Renders the DayPicker calendar component.
|
|
34377
34969
|
*
|
|
@@ -34382,58 +34974,83 @@ function useSelection(props, dateLib) {
|
|
|
34382
34974
|
*/
|
|
34383
34975
|
function DayPicker(initialProps) {
|
|
34384
34976
|
let props = initialProps;
|
|
34385
|
-
|
|
34977
|
+
const timeZone = props.timeZone;
|
|
34978
|
+
if (timeZone) {
|
|
34386
34979
|
props = {
|
|
34387
34980
|
...initialProps,
|
|
34981
|
+
timeZone,
|
|
34388
34982
|
};
|
|
34389
34983
|
if (props.today) {
|
|
34390
|
-
props.today =
|
|
34984
|
+
props.today = toTimeZone(props.today, timeZone);
|
|
34391
34985
|
}
|
|
34392
34986
|
if (props.month) {
|
|
34393
|
-
props.month =
|
|
34987
|
+
props.month = toTimeZone(props.month, timeZone);
|
|
34394
34988
|
}
|
|
34395
34989
|
if (props.defaultMonth) {
|
|
34396
|
-
props.defaultMonth =
|
|
34990
|
+
props.defaultMonth = toTimeZone(props.defaultMonth, timeZone);
|
|
34397
34991
|
}
|
|
34398
34992
|
if (props.startMonth) {
|
|
34399
|
-
props.startMonth =
|
|
34993
|
+
props.startMonth = toTimeZone(props.startMonth, timeZone);
|
|
34400
34994
|
}
|
|
34401
34995
|
if (props.endMonth) {
|
|
34402
|
-
props.endMonth =
|
|
34996
|
+
props.endMonth = toTimeZone(props.endMonth, timeZone);
|
|
34403
34997
|
}
|
|
34404
34998
|
if (props.mode === "single" && props.selected) {
|
|
34405
|
-
props.selected =
|
|
34999
|
+
props.selected = toTimeZone(props.selected, timeZone);
|
|
34406
35000
|
}
|
|
34407
35001
|
else if (props.mode === "multiple" && props.selected) {
|
|
34408
|
-
props.selected = props.selected?.map((date) =>
|
|
35002
|
+
props.selected = props.selected?.map((date) => toTimeZone(date, timeZone));
|
|
34409
35003
|
}
|
|
34410
35004
|
else if (props.mode === "range" && props.selected) {
|
|
34411
35005
|
props.selected = {
|
|
34412
35006
|
from: props.selected.from
|
|
34413
|
-
?
|
|
34414
|
-
:
|
|
35007
|
+
? toTimeZone(props.selected.from, timeZone)
|
|
35008
|
+
: props.selected.from,
|
|
34415
35009
|
to: props.selected.to
|
|
34416
|
-
?
|
|
34417
|
-
:
|
|
35010
|
+
? toTimeZone(props.selected.to, timeZone)
|
|
35011
|
+
: props.selected.to,
|
|
34418
35012
|
};
|
|
34419
35013
|
}
|
|
35014
|
+
if (props.disabled !== undefined) {
|
|
35015
|
+
props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
|
|
35016
|
+
}
|
|
35017
|
+
if (props.hidden !== undefined) {
|
|
35018
|
+
props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
|
|
35019
|
+
}
|
|
35020
|
+
if (props.modifiers) {
|
|
35021
|
+
const nextModifiers = {};
|
|
35022
|
+
Object.keys(props.modifiers).forEach((key) => {
|
|
35023
|
+
nextModifiers[key] = convertMatchersToTimeZone(props.modifiers?.[key], timeZone);
|
|
35024
|
+
});
|
|
35025
|
+
props.modifiers = nextModifiers;
|
|
35026
|
+
}
|
|
34420
35027
|
}
|
|
34421
35028
|
const { components, formatters, labels, dateLib, locale, classNames } = React$5.useMemo(() => {
|
|
34422
35029
|
const locale = { ...enUS, ...props.locale };
|
|
35030
|
+
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
35031
|
+
const noonOverrides = props.noonSafe && props.timeZone
|
|
35032
|
+
? createNoonOverrides(props.timeZone, {
|
|
35033
|
+
weekStartsOn,
|
|
35034
|
+
locale,
|
|
35035
|
+
})
|
|
35036
|
+
: undefined;
|
|
35037
|
+
const overrides = props.dateLib && noonOverrides
|
|
35038
|
+
? { ...noonOverrides, ...props.dateLib }
|
|
35039
|
+
: (props.dateLib ?? noonOverrides);
|
|
34423
35040
|
const dateLib = new DateLib({
|
|
34424
35041
|
locale,
|
|
34425
|
-
weekStartsOn
|
|
35042
|
+
weekStartsOn,
|
|
34426
35043
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
34427
35044
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
34428
35045
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
34429
35046
|
timeZone: props.timeZone,
|
|
34430
35047
|
numerals: props.numerals,
|
|
34431
|
-
},
|
|
35048
|
+
}, overrides);
|
|
34432
35049
|
return {
|
|
34433
35050
|
dateLib,
|
|
34434
35051
|
components: getComponents(props.components),
|
|
34435
35052
|
formatters: getFormatters(props.formatters),
|
|
34436
|
-
labels:
|
|
35053
|
+
labels: getLabels(props.labels, dateLib.options),
|
|
34437
35054
|
locale,
|
|
34438
35055
|
classNames: { ...getDefaultClassNames(), ...props.classNames },
|
|
34439
35056
|
};
|
|
@@ -34447,11 +35064,15 @@ function DayPicker(initialProps) {
|
|
|
34447
35064
|
props.timeZone,
|
|
34448
35065
|
props.numerals,
|
|
34449
35066
|
props.dateLib,
|
|
35067
|
+
props.noonSafe,
|
|
34450
35068
|
props.components,
|
|
34451
35069
|
props.formatters,
|
|
34452
35070
|
props.labels,
|
|
34453
35071
|
props.classNames,
|
|
34454
35072
|
]);
|
|
35073
|
+
if (!props.today) {
|
|
35074
|
+
props = { ...props, today: dateLib.today() };
|
|
35075
|
+
}
|
|
34455
35076
|
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles, } = props;
|
|
34456
35077
|
const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown, } = formatters;
|
|
34457
35078
|
const calendar = useCalendar(props, dateLib);
|
|
@@ -34460,7 +35081,7 @@ function DayPicker(initialProps) {
|
|
|
34460
35081
|
const { isSelected, select, selected: selectedValue, } = useSelection(props, dateLib) ?? {};
|
|
34461
35082
|
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
|
|
34462
35083
|
const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown, } = labels;
|
|
34463
|
-
const weekdays = React$5.useMemo(() => getWeekdays(dateLib, props.ISOWeek), [dateLib, props.ISOWeek]);
|
|
35084
|
+
const weekdays = React$5.useMemo(() => getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [dateLib, props.ISOWeek, props.broadcastCalendar, props.today]);
|
|
34464
35085
|
const isInteractive = mode !== undefined || onDayClick !== undefined;
|
|
34465
35086
|
const handlePreviousClick = React$5.useCallback(() => {
|
|
34466
35087
|
if (!previousMonth)
|
|
@@ -34478,6 +35099,9 @@ function DayPicker(initialProps) {
|
|
|
34478
35099
|
e.preventDefault();
|
|
34479
35100
|
e.stopPropagation();
|
|
34480
35101
|
setFocused(day);
|
|
35102
|
+
if (m.disabled) {
|
|
35103
|
+
return;
|
|
35104
|
+
}
|
|
34481
35105
|
select?.(day.date, m, e);
|
|
34482
35106
|
onDayClick?.(day.date, m, e);
|
|
34483
35107
|
}, [select, onDayClick, setFocused]);
|
|
@@ -34561,7 +35185,7 @@ function DayPicker(initialProps) {
|
|
|
34561
35185
|
formatters,
|
|
34562
35186
|
};
|
|
34563
35187
|
return (React__default["default"].createElement(dayPickerContext.Provider, { value: contextValue },
|
|
34564
|
-
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 },
|
|
35188
|
+
React__default["default"].createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang ?? locale.code, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], "aria-labelledby": props["aria-labelledby"], ...dataAttributes },
|
|
34565
35189
|
React__default["default"].createElement(components.Months, { className: classNames[UI.Months], style: styles?.[UI.Months] },
|
|
34566
35190
|
!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 })),
|
|
34567
35191
|
months.map((calendarMonth, displayIndex) => {
|
|
@@ -34573,10 +35197,16 @@ function DayPicker(initialProps) {
|
|
|
34573
35197
|
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 },
|
|
34574
35198
|
React__default["default"].createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" }))),
|
|
34575
35199
|
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] },
|
|
34576
|
-
|
|
34577
|
-
captionLayout === "dropdown
|
|
34578
|
-
|
|
34579
|
-
captionLayout === "dropdown
|
|
35200
|
+
(() => {
|
|
35201
|
+
const monthControl = captionLayout === "dropdown" ||
|
|
35202
|
+
captionLayout === "dropdown-months" ? (React__default["default"].createElement(components.MonthsDropdown, { key: "month", 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", { key: "month" }, formatMonthDropdown(calendarMonth.date, dateLib)));
|
|
35203
|
+
const yearControl = captionLayout === "dropdown" ||
|
|
35204
|
+
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)));
|
|
35205
|
+
const controls = dateLib.getMonthYearOrder() === "year-first"
|
|
35206
|
+
? [yearControl, monthControl]
|
|
35207
|
+
: [monthControl, yearControl];
|
|
35208
|
+
return controls;
|
|
35209
|
+
})(),
|
|
34580
35210
|
React__default["default"].createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
34581
35211
|
border: 0,
|
|
34582
35212
|
clip: "rect(0 0 0 0)",
|
|
@@ -34588,9 +35218,7 @@ function DayPicker(initialProps) {
|
|
|
34588
35218
|
width: "1px",
|
|
34589
35219
|
whiteSpace: "nowrap",
|
|
34590
35220
|
wordWrap: "normal",
|
|
34591
|
-
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
|
|
34592
|
-
// biome-ignore lint/a11y/useSemanticElements: breaking change
|
|
34593
|
-
React__default["default"].createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
|
|
35221
|
+
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (React__default["default"].createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
|
|
34594
35222
|
navLayout === "around" &&
|
|
34595
35223
|
!props.hideNavigation &&
|
|
34596
35224
|
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 },
|
|
@@ -34605,9 +35233,7 @@ function DayPicker(initialProps) {
|
|
|
34605
35233
|
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)))))),
|
|
34606
35234
|
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) => {
|
|
34607
35235
|
return (React__default["default"].createElement(components.Week, { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week: week },
|
|
34608
|
-
showWeekNumber && (
|
|
34609
|
-
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34610
|
-
React__default["default"].createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
35236
|
+
showWeekNumber && (React__default["default"].createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
34611
35237
|
locale,
|
|
34612
35238
|
}), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber(week.weekNumber, dateLib))),
|
|
34613
35239
|
week.days.map((day) => {
|
|
@@ -34631,18 +35257,16 @@ function DayPicker(initialProps) {
|
|
|
34631
35257
|
const ariaLabel = !isInteractive && !modifiers.hidden
|
|
34632
35258
|
? labelGridcell(date, modifiers, dateLib.options, dateLib)
|
|
34633
35259
|
: undefined;
|
|
34634
|
-
return (
|
|
34635
|
-
|
|
34636
|
-
|
|
34637
|
-
|
|
34638
|
-
|
|
35260
|
+
return (React__default["default"].createElement(components.Day, { key: `${day.isoDate}_${day.displayMonthId}`, day: day, modifiers: modifiers, className: className.join(" "), style: style, role: "gridcell", "aria-selected": modifiers.selected || undefined, "aria-label": ariaLabel, "data-day": day.isoDate, "data-month": day.outside ? day.dateMonthId : 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.focused &&
|
|
35261
|
+
modifiers.disabled) ||
|
|
35262
|
+
undefined, "aria-disabled": (modifiers.focused &&
|
|
35263
|
+
modifiers.disabled) ||
|
|
35264
|
+
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 &&
|
|
34639
35265
|
formatDay(day.date, dateLib.options, dateLib))));
|
|
34640
35266
|
})));
|
|
34641
35267
|
})))));
|
|
34642
35268
|
})),
|
|
34643
|
-
props.footer && (
|
|
34644
|
-
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34645
|
-
React__default["default"].createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
35269
|
+
props.footer && (React__default["default"].createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
34646
35270
|
}
|
|
34647
35271
|
|
|
34648
35272
|
function styleInject(css, ref) {
|
|
@@ -34672,7 +35296,7 @@ function styleInject(css, ref) {
|
|
|
34672
35296
|
}
|
|
34673
35297
|
}
|
|
34674
35298
|
|
|
34675
|
-
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";
|
|
35299
|
+
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";
|
|
34676
35300
|
styleInject(css_248z$3);
|
|
34677
35301
|
|
|
34678
35302
|
var reactInputMask = {exports: {}};
|
|
@@ -39354,11 +39978,11 @@ const TableComponent = ({ idTable, dataSource, contentColumns, headerColumns, se
|
|
|
39354
39978
|
}, []);
|
|
39355
39979
|
return (jsxRuntime.jsx("div", { ref: containerRef, className: "r-gridtable", style: { maxHeight: `${height ? `${height}px` : 'auto'}` }, children: jsxRuntime.jsxs("table", { style: { width: '100%' }, role: "presentation", children: [jsxRuntime.jsx(RenderColGroup, { contentColumns: contentColumns }), jsxRuntime.jsx("thead", { className: "r-gridheader", role: "rowgroup", children: headerColumns.map((element, indexParent) => {
|
|
39356
39980
|
return (jsxRuntime.jsx("tr", { className: "r-row", role: "row", children: element?.map((col, index) => {
|
|
39357
|
-
return (jsxRuntime.jsx(HeaderTableCol, { col: col, idTable: idTable ?? '', dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: containerRef, filterBy: filterBy, orderBy: orderBy, optionsFilter: optionsFilter, allowFiltering: allowFiltering, allowSorting: allowSorting, formatSetting: formatSetting, changeFilter: (val) => {
|
|
39981
|
+
return (jsxRuntime.jsx(HeaderTableCol, { col: col, idTable: idTable ?? '', dataSource: dataSource, fieldKey: fieldKey, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: containerRef, filterBy: filterBy, orderBy: orderBy, optionsFilter: optionsFilter, allowFiltering: allowFiltering, allowSorting: allowSorting, formatSetting: formatSetting, changeFilter: (val) => {
|
|
39358
39982
|
setFilterBy([...val]);
|
|
39359
39983
|
}, changeOrder: (val) => {
|
|
39360
39984
|
setOrderBy([...val]);
|
|
39361
|
-
}, columns: contentColumns, setContentColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft
|
|
39985
|
+
}, columns: contentColumns, setContentColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft }, `header-${indexParent}-${index}`));
|
|
39362
39986
|
}) }, `header-${-indexParent}`));
|
|
39363
39987
|
}) }), jsxRuntime.jsxs("tbody", { className: "r-gridcontent", role: "rowgroup", children: [jsxRuntime.jsx("tr", { style: { height: offsetY } }), filteredData.slice(startIndex, endIndex).map((row) => {
|
|
39364
39988
|
const indexRow = row.indexRow;
|
|
@@ -40071,17 +40695,35 @@ const SettingColumn = React__default["default"].memo((props) => {
|
|
|
40071
40695
|
}) }) })] }), jsxRuntime.jsxs("div", { style: { boxShadow: '0 4px 24px 0 rgb(34 41 47 / 10%)' }, className: "d-flex justify-content-between align-items-center w-100 py-75 px-1", children: [jsxRuntime.jsx("div", { children: settingColumns?.updatedDate && (jsxRuntime.jsxs("p", { children: [jsxRuntime.jsxs("strong", { children: [t('Update date'), ": "] }), " ", jsxRuntime.jsx("span", { children: settingColumns.updatedDate ? formatDateTime(settingColumns.updatedDate, 'DD/MM/yyyy HH:mm') : '' }), jsxRuntime.jsxs("strong", { className: "ms-2", children: [t('Editor'), ": "] }), " ", jsxRuntime.jsx("span", { children: settingColumns.updatedByName })] })) }), jsxRuntime.jsxs("div", { children: [resetDefaultColumns && (jsxRuntime.jsx(Button$1$1, { color: "primary", onClick: () => messageBoxConfirm(t, handleResetColumns, {}, 'Do you want to reset the default settings?'), className: "me-1", children: t('Reset') })), jsxRuntime.jsx(Button$1$1, { color: "primary", onClick: handleSubmit, className: "me-1", children: t('Confirm') }), jsxRuntime.jsx(Button$1$1, { color: "secondary", onClick: handleCancel, outline: true, children: t('Close') })] })] })] }));
|
|
40072
40696
|
});
|
|
40073
40697
|
|
|
40074
|
-
const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, focusRow, editDisable, addDisable, buttonSetting, toolbarSetting }) => {
|
|
40698
|
+
const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, focusRow, editDisable, addDisable, buttonSetting, toolbarSetting, }) => {
|
|
40075
40699
|
const { t } = reactI18next.useTranslation();
|
|
40076
|
-
return (jsxRuntime.jsx("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: jsxRuntime.jsxs("div", { className: "r-toolbar-items", children: [jsxRuntime.jsxs("div", { className: "r-toolbar-left", children: [jsxRuntime.jsxs("div", { className: classNames$1('r-toolbar-item d-flex', {
|
|
40700
|
+
return (jsxRuntime.jsx("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: jsxRuntime.jsxs("div", { className: "r-toolbar-items", children: [jsxRuntime.jsxs("div", { className: "r-toolbar-left", children: [jsxRuntime.jsxs("div", { className: classNames$1('r-toolbar-item d-flex', {
|
|
40701
|
+
'd-none': editDisable || addDisable,
|
|
40702
|
+
}), "aria-disabled": "false", children: [jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: () => handleAdd(1), className: "d-flex", children: t('Add item') }), buttonSetting?.disableAddMulti === true && (jsxRuntime.jsxs(UncontrolledDropdown, { className: "nav-item", children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", className: "me-0 d-flex", children: jsxRuntime.jsx(Button$1$1, { type: "button", color: "success", outline: true, style: { marginLeft: -1 }, className: "px-25", children: jsxRuntime.jsx("svg", { fill: "#28c76f", height: "15", width: "20", viewBox: "0 0 20 20", children: jsxRuntime.jsx("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" }) }) }) }), jsxRuntime.jsxs(DropdownMenu$1, { className: "formula-dropdown icon-dropdown p-0", children: [jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(10), children: "10 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(20), children: "20 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(30), children: "30 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(40), children: "40 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(50), children: "50 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(100), children: "100 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(1000), children: "1000 h\u00E0ng" })] })] }))] }), (focusRow ?? -1) > -1 ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40703
|
+
'd-none': editDisable ||
|
|
40704
|
+
addDisable ||
|
|
40705
|
+
buttonSetting?.duplicateDisable,
|
|
40706
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: () => {
|
|
40077
40707
|
handleDuplicate();
|
|
40078
|
-
}, className: "d-flex", children: t('Duplicate') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40708
|
+
}, className: "d-flex", children: t('Duplicate') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40709
|
+
'd-none': editDisable ||
|
|
40710
|
+
addDisable ||
|
|
40711
|
+
buttonSetting?.insertBeforeDisable,
|
|
40712
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: handleInsertBefore, className: "d-flex", children: t('Insert item before') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40713
|
+
'd-none': editDisable ||
|
|
40714
|
+
addDisable ||
|
|
40715
|
+
buttonSetting?.insertAfterDisable,
|
|
40716
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: handleInsertAfter, className: "d-flex", children: t('Insert item after') }) })] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: " " })), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40717
|
+
'd-none': editDisable || buttonSetting?.deleteAllDisable,
|
|
40718
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "primary", outline: true, onClick: handleDeleteAll, className: "d-flex", children: t('Delete all item') }) }), toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
40079
40719
|
return (item.align === 'left' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`)));
|
|
40080
40720
|
})] }), jsxRuntime.jsx("div", { className: "r-toolbar-center", children: toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
40081
40721
|
return (item.align === 'center' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-center-${index}`)));
|
|
40082
40722
|
}) }), jsxRuntime.jsxs("div", { className: "r-toolbar-right", children: [toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
40083
40723
|
return (item.align === 'right' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-right-${index}`)));
|
|
40084
|
-
}), !toolbarSetting?.hiddenSetting && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsxRuntime.jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25', {
|
|
40724
|
+
}), !toolbarSetting?.hiddenSetting && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsxRuntime.jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25', {
|
|
40725
|
+
'd-none': editDisable || addDisable,
|
|
40726
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsxs(UncontrolledDropdown, { className: "dropdown-user nav-item", children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", color: "primary", onClick: (e) => e.preventDefault(), children: jsxRuntime.jsx(SvgInfo, { className: "cursor-pointer text-primary" }) }), jsxRuntime.jsx(DropdownMenu$1, { className: "formula-dropdown icon-dropdown", children: jsxRuntime.jsxs("ul", { className: "mb-0 pe-50", children: [jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + D \u0111\u1EC3 nh\u00E2n b\u1EA3n" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Ch\u1ECDn \u00F4 v\u00E0 Ctrl + V \u0111\u1EC3 d\u00E1n th\u00F4ng tin t\u1EEB excel" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + C \u0111\u1EC3 sao ch\u00E9p h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + V \u0111\u1EC3 d\u00E1n h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2193 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng d\u01B0\u1EDBi" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2191 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng tr\u00EAn" })] }) })] }) })] }))] })] }) }));
|
|
40085
40727
|
};
|
|
40086
40728
|
|
|
40087
40729
|
const RenderToolbarTop = ({ toolbarTopOption, maximize, setMaximize }) => {
|