react-table-edit 1.5.42 → 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/content.d.ts +1 -0
- package/dist/component/table-view/header.d.ts +3 -3
- package/dist/component/table-view/index.d.ts +1 -0
- package/dist/component/table-view/table.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1129 -320
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1129 -320
- 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.mjs
CHANGED
|
@@ -9056,6 +9056,20 @@ var SvgProcess = function (_a) {
|
|
|
9056
9056
|
React$5.createElement("path", { d: "M22.43 3.87a1.302 1.302 0 0 0-2.545-.374H9.886V1.874a.375.375 0 0 0-.375-.375H2.858a.375.375 0 0 0-.375.375v3.992a.375.375 0 0 0 .375.375h6.653a.375.375 0 0 0 .375-.375V4.245h9.999a1.301 1.301 0 0 0 .867.868v6.344h-.902v-1.62a.376.376 0 0 0-.375-.376h-6.653a.375.375 0 0 0-.375.375v1.62H4.115a1.3 1.3 0 1 0-1.617 1.618v7.055a.375.375 0 0 0 .375.375H5.81v1.621a.375.375 0 0 0 .375.375h6.652a.376.376 0 0 0 .375-.375v-1.62h5.327l-.695.674a.375.375 0 1 0 .522.538l1.357-1.316a.377.377 0 0 0 .006-.544l-1.357-1.316a.375.375 0 1 0-.522.539l.695.674h-5.333v-1.62a.376.376 0 0 0-.375-.376H6.185a.376.376 0 0 0-.375.375v1.621H3.248v-6.68a1.301 1.301 0 0 0 .867-.867h8.332v1.62a.374.374 0 0 0 .375.376h6.653a.374.374 0 0 0 .375-.375v-1.621h1.277a.376.376 0 0 0 .375-.375v-6.72a1.3 1.3 0 0 0 .929-1.242ZM9.137 5.492H3.233V2.25h5.903v3.242ZM6.56 18.508h5.902v3.242H6.56v-3.242Zm-3.687-6.122a.554.554 0 0 1 0-1.108.554.554 0 0 1 0 1.108ZM19.1 13.453h-5.903V10.21H19.1v3.242Zm2.027-9.029a.554.554 0 0 1 0-1.107.554.554 0 0 1 0 1.107Z", fill: props.color || "currentColor" })));
|
|
9057
9057
|
};
|
|
9058
9058
|
|
|
9059
|
+
var SvgProjectSetting = function (_a) {
|
|
9060
|
+
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9061
|
+
return (React$5.createElement("svg", __assign({ width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", strokeWidth: props.strokeWidth || 1.5, "aria-labelledby": titleId }, props),
|
|
9062
|
+
title ? React$5.createElement("title", { id: titleId }, title) : null,
|
|
9063
|
+
React$5.createElement("g", { clipPath: "url(#project-setting_svg__a)", fill: props.color || "currentColor" },
|
|
9064
|
+
React$5.createElement("path", { d: "M1.266.042C.9.155.53.506.43.834.394.961.375 1.528.375 2.616v1.598l.122.094c.201.16.403.122.51-.094.057-.108.071-.408.071-1.655V1.031l.136-.15.136-.155H19.275l.136.155.136.15v8.916l.14.14c.118.113.17.136.272.108a.533.533 0 0 0 .207-.103c.08-.07.084-.347.084-4.575 0-3.314-.014-4.547-.056-4.683-.07-.234-.366-.572-.619-.708l-.192-.103-9-.009C5.433.009 1.33.024 1.266.042Z" }),
|
|
9065
|
+
React$5.createElement("path", { d: "M2.03 2.156a.351.351 0 0 0-.15.136c-.033.061-.052.586-.052 1.481v1.388l.117.112c.061.066.17.118.235.118a.386.386 0 0 0 .234-.118c.108-.103.117-.15.117-.562v-.445h.263c.398 0 .623-.085.862-.329.347-.346.422-.778.206-1.209-.224-.45-.585-.619-1.303-.614-.234 0-.473.019-.53.042Zm1.106.778c.183.155.192.347.028.511-.094.099-.16.118-.375.118h-.258v-.75h.23c.183 0 .262.028.375.121ZM4.477 2.227l-.118.112V5.2l.122.093c.155.122.305.127.446.01.093-.075.112-.141.136-.474l.023-.389.323.37c.446.511.53.582.68.582.169 0 .333-.178.333-.361 0-.108-.075-.225-.328-.511-.178-.202-.328-.385-.328-.403 0-.02.037-.043.084-.057.131-.042.38-.304.483-.506.108-.206.117-.581.023-.806-.098-.24-.389-.488-.651-.567-.136-.042-.422-.07-.675-.07-.403 0-.45.009-.553.117Zm1.12.684c.272.216.07.558-.328.558h-.207v-.657h.207c.136 0 .244.033.328.099ZM7.876 2.184A1.619 1.619 0 0 0 6.84 4.472c.67 1.364 2.657 1.139 3.032-.342.211-.844-.323-1.725-1.185-1.95-.329-.085-.479-.085-.811.004Zm.68.68c.257.07.562.385.632.647.164.614-.356 1.228-.989 1.167a.98.98 0 0 1-.736-.506c-.21-.394-.07-.947.3-1.172.295-.183.492-.216.792-.136ZM11.08 2.166c-.187.089-.206.225-.206 1.378 0 1.232.005 1.218-.323 1.045-.169-.084-.216-.094-.328-.042a.402.402 0 0 0-.197.197c-.075.178 0 .337.234.492.418.281.961.15 1.21-.29.103-.184.108-.23.108-1.398V2.34l-.118-.113c-.122-.126-.22-.14-.38-.06ZM15.3 2.175c-.484.122-.873.445-1.107.914-.15.305-.155 1.003-.005 1.327.14.309.478.651.797.81.235.118.328.136.67.141.343 0 .436-.019.666-.131.488-.24.656-.61.384-.825-.173-.136-.253-.127-.501.07-.638.497-1.505-.01-1.43-.83.066-.642.746-.998 1.36-.707.271.126.323.126.478.004.145-.112.169-.365.042-.492-.258-.258-.914-.393-1.355-.281ZM17.19 2.203a.29.29 0 0 0-.128.263c0 .243.132.346.446.346h.258v2.386l.122.094c.154.122.304.127.445.01.112-.09.112-.094.126-1.29l.014-1.2h.254c.215 0 .262-.018.346-.121.122-.155.127-.305.01-.446-.09-.108-.113-.112-.928-.126-.797-.014-.844-.01-.966.084ZM12.268 2.212a.55.55 0 0 0-.127.193c-.06.178-.065 2.56 0 2.733.09.23.16.248.872.253.628 0 .661-.005.76-.108.145-.155.135-.375-.02-.497-.107-.084-.191-.098-.538-.098h-.418v-.563h.352c.403 0 .558-.056.633-.23.056-.14.005-.342-.103-.412-.033-.019-.24-.047-.46-.061l-.398-.024-.014-.271-.014-.268h.417c.351 0 .436-.014.544-.098a.35.35 0 0 0 .028-.511c-.085-.084-.155-.094-.764-.094-.464 0-.694.019-.75.056ZM.478 5.452l-.103.112.01 8.456.013 8.457.15.318c.179.37.535.764.849.938.501.272.408.267 4.945.267h4.163l.112-.117c.15-.145.15-.324 0-.469l-.112-.117H3.938l.14-.22c.277-.432.338-.68.366-1.44.023-.68.023-.703.154-.843l.127-.146H22.65l.14.16.141.154-.018.713c-.015.675-.02.717-.141.928-.174.29-.455.52-.745.614-.216.07-.718.08-5.185.08h-4.94l-.113.117c-.15.145-.15.323 0 .469l.113.117h4.959c5.414 0 5.236.01 5.742-.267.314-.174.67-.567.849-.938.145-.31.15-.337.164-1.064.018-.876-.02-1.064-.286-1.369-.357-.407-.394-.417-1.824-.43l-1.256-.015v-.539l.295.019c.53.033.77-.174 1.252-1.083.16-.295.192-.408.192-.614 0-.417-.197-.712-.652-.966l-.178-.103v-1.153l.178-.103c.46-.258.647-.54.647-.966 0-.22-.032-.323-.192-.623-.478-.895-.717-1.106-1.247-1.073l-.295.018v-.694c0-.632-.01-.703-.094-.787-.126-.127-.38-.122-.497.005-.08.089-.089.187-.103.867-.01.422-.023.769-.028.769-.01 0-.14-.075-.29-.165a2.169 2.169 0 0 0-.38-.192c-.099-.028-.108-.056-.108-.318 0-.385-.07-.605-.248-.811-.249-.286-.436-.342-1.14-.342-.346 0-.684.023-.773.056-.436.15-.651.482-.651 1.012v.338l-.291.145c-.164.08-.385.211-.497.286l-.202.14-.323-.168c-.24-.127-.375-.169-.544-.169-.272 0-.558.122-.726.31-.178.192-.647 1.04-.68 1.228-.08.417.131.82.558 1.068l.29.174v1.144l-.29.173c-.427.248-.638.651-.558 1.069.033.187.502 1.036.68 1.228.168.187.454.31.726.31.169 0 .305-.043.544-.17l.323-.168.202.14c.112.075.333.207.497.286.258.131.29.164.29.286v.14l-5.657.01-5.663.014-.192.103c-.21.113-.51.422-.59.615-.029.07-.066.454-.085.857-.023.67-.038.75-.16.994-.482.994-1.8 1.04-2.362.09l-.126-.221-.024-8.428-.023-8.433-.113-.09c-.15-.121-.342-.112-.464.02Zm17.494 6.417c.056.08.075.225.075.553 0 .408.01.46.108.548a.67.67 0 0 0 .22.131c.22.066.727.352.956.54.122.103.267.187.319.187.052 0 .277-.098.502-.22.539-.286.567-.277.886.267.351.595.337.656-.17.96-.215.127-.412.273-.44.32-.028.056-.028.215.01.487.037.305.037.511 0 .82-.066.511-.061.526.445.826.492.295.501.356.155.946-.32.544-.347.553-.886.267-.225-.121-.45-.22-.502-.22-.052 0-.197.085-.319.192a4.262 4.262 0 0 1-.675.404c-.618.3-.61.29-.61.703v.342H16.642v-.296c0-.417-.057-.492-.493-.675a4.13 4.13 0 0 1-.721-.412c-.193-.14-.39-.258-.441-.258-.052 0-.258.099-.46.216-.52.305-.562.29-.895-.263-.15-.243-.272-.487-.272-.543 0-.122.132-.24.525-.464.361-.207.422-.32.361-.638a4.085 4.085 0 0 1-.037-.534c0-.183.019-.422.037-.535.061-.319 0-.431-.36-.637-.394-.225-.526-.342-.526-.464 0-.056.122-.3.272-.544.333-.553.366-.563.89-.262.202.117.413.215.465.215.051 0 .248-.117.44-.258.193-.14.516-.328.722-.412.254-.108.394-.197.432-.272.033-.066.06-.29.06-.53 0-.586.005-.59.708-.59.516 0 .558.004.624.103Zm1.575 7.701v.352h-.797v-.155c0-.131.023-.16.202-.234.112-.042.276-.132.365-.197a.953.953 0 0 1 .197-.117c.019 0 .033.16.033.351Z" }),
|
|
9066
|
+
React$5.createElement("path", { d: "M16.683 14.358c-.478.201-.811.515-1.022.965-.103.23-.122.324-.122.732 0 .436.01.492.15.778.183.375.52.703.895.876.235.113.324.127.76.127.45 0 .515-.014.773-.136a1.867 1.867 0 0 0 1.013-1.378c.13-.745-.305-1.566-1.013-1.908-.234-.112-.351-.136-.726-.15-.385-.014-.483 0-.708.094Zm1.106.684c.413.188.647.558.647 1.013 0 .633-.469 1.097-1.106 1.101-.46 0-.807-.215-.999-.633a1.129 1.129 0 0 1 .567-1.504c.207-.09.67-.08.891.023ZM2.742 6.21a.386.386 0 0 0-.117.235c0 .066.052.174.117.235l.113.117H17.77l.113-.117c.15-.146.15-.324 0-.47l-.113-.116H2.855l-.113.117ZM2.892 7.753c-.422.155-.764.506-.876.919-.028.094-.047.928-.047 1.955 0 1.678.004 1.809.093 2.043.113.296.39.59.694.746l.22.107h6.516l.267-.13c.15-.076.343-.216.432-.324.304-.352.309-.403.309-2.494 0-1.875 0-1.88-.113-2.114-.14-.305-.487-.614-.792-.703-.333-.099-6.426-.103-6.703-.005Zm6.553.703c.09.038.207.14.258.225.09.15.094.235.094 1.932 0 1.706-.005 1.78-.094 1.93-.192.31-.14.305-3.539.291-3.394-.014-3.197.005-3.398-.332-.09-.141-.094-.249-.094-1.885 0-1.94.005-1.964.333-2.142.15-.08.342-.084 3.22-.084 2.555 0 3.084.009 3.22.065Z" }),
|
|
9067
|
+
React$5.createElement("path", { d: "M6.623 9.047a.351.351 0 0 0-.15.136c-.032.06-.051.604-.051 1.542 0 1.36.005 1.458.089 1.56.089.113.094.113 1.275.127 1.266.014 1.397-.004 1.49-.206.07-.16.07-2.826 0-2.986a.368.368 0 0 0-.168-.169c-.136-.06-2.33-.065-2.485-.004Zm2.002 1.664v1.008h-1.5V9.703h1.5v1.008ZM3.281 10.406c-.089.09-.094.155-.094.957v.867l.122.093c.118.094.183.099 1.308.099s1.19-.005 1.308-.099l.122-.093v-.867c0-.802-.005-.868-.094-.957-.089-.089-.155-.094-1.336-.094s-1.247.005-1.336.094Zm2.063.961v.352H3.89v-.703H5.344v.351ZM11.587 9.08c-.032.014-.089.08-.126.154-.09.17-.019.39.145.464.085.038 1.064.052 3.469.052h3.351l.113-.117a.386.386 0 0 0 .117-.235.386.386 0 0 0-.117-.234l-.113-.117-3.389.005c-1.865 0-3.417.014-3.45.028ZM11.526 10.49c-.155.127-.14.366.024.512l.126.107H15.895l.112-.117c.15-.145.155-.347.01-.483-.108-.103-.117-.103-2.245-.103-2.007 0-2.143.005-2.246.085ZM2.063 14.54c-.183.198-.075.512.197.577.061.014 2.25.019 4.87.014 4.613-.014 4.772-.018 4.866-.103.127-.117.131-.37.005-.497-.094-.094-.155-.094-4.969-.094h-4.87l-.099.104ZM2.062 15.89c-.202.202-.066.53.244.587.084.014 2.419.023 5.184.014l5.034-.014.09-.113c.117-.14.112-.356-.005-.473-.094-.094-.155-.094-5.274-.094-5.118 0-5.18 0-5.273.094ZM2.175 17.175a.332.332 0 0 0-.112.544c.094.093.155.093 4.987.093h4.899l.07-.103c.108-.15.094-.38-.023-.487-.094-.085-.253-.09-4.89-.099-3.946-.009-4.809 0-4.93.052ZM2.17 18.563c-.215.089-.267.389-.093.553.108.103.108.103 2.503.103 2.212 0 2.4-.005 2.489-.085a.435.435 0 0 0 .131-.206c.024-.103 0-.155-.112-.272l-.141-.14-2.339.004c-1.284 0-2.381.02-2.438.043Z" })),
|
|
9068
|
+
React$5.createElement("defs", null,
|
|
9069
|
+
React$5.createElement("clipPath", { id: "project-setting_svg__a" },
|
|
9070
|
+
React$5.createElement("path", { fill: "#fff", d: "M0 0h24v24H0z" })))));
|
|
9071
|
+
};
|
|
9072
|
+
|
|
9059
9073
|
var SvgQuoteRight = function (_a) {
|
|
9060
9074
|
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9061
9075
|
return (React$5.createElement("svg", __assign({ width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", strokeWidth: props.strokeWidth || 1.5, "aria-labelledby": titleId }, props),
|
|
@@ -9224,6 +9238,13 @@ var SvgSettings = function (_a) {
|
|
|
9224
9238
|
React$5.createElement("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })));
|
|
9225
9239
|
};
|
|
9226
9240
|
|
|
9241
|
+
var SvgShapeGroup = function (_a) {
|
|
9242
|
+
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9243
|
+
return (React$5.createElement("svg", __assign({ width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", strokeWidth: props.strokeWidth || 1.5, "aria-labelledby": titleId }, props),
|
|
9244
|
+
title ? React$5.createElement("title", { id: titleId }, title) : null,
|
|
9245
|
+
React$5.createElement("path", { d: "M24 15h-4.91l4.336 7.5H6.973l3.129-5.426a6.965 6.965 0 0 1-1.618.68A6.784 6.784 0 0 1 6.75 18a6.677 6.677 0 0 1-4.77-1.98 6.952 6.952 0 0 1-1.44-2.145A6.681 6.681 0 0 1 0 11.25a6.677 6.677 0 0 1 1.98-4.77 6.952 6.952 0 0 1 2.145-1.44A6.681 6.681 0 0 1 6.75 4.5c.664 0 1.313.094 1.945.281a6.579 6.579 0 0 1 1.805.856V1.5H24V15ZM6.75 16.5c.727 0 1.406-.137 2.04-.41a5.208 5.208 0 0 0 1.663-1.137 5.488 5.488 0 0 0 1.125-1.664A5.17 5.17 0 0 0 12 11.25c0-.719-.137-1.395-.41-2.027a5.448 5.448 0 0 0-1.125-1.676A5.054 5.054 0 0 0 8.8 6.422 5.555 5.555 0 0 0 6.75 6c-.727 0-1.406.137-2.04.41A5.305 5.305 0 0 0 1.923 9.2a5.258 5.258 0 0 0-.422 2.05c0 .727.137 1.406.41 2.04a5.305 5.305 0 0 0 2.79 2.788 5.257 5.257 0 0 0 2.05.422ZM20.824 21a1846.92 1846.92 0 0 1-2.812-4.875 1846.92 1846.92 0 0 0-2.813-4.875 1846.92 1846.92 0 0 0-2.812 4.875c-.93 1.617-1.867 3.242-2.813 4.875h11.25ZM22.5 3H12v4.066A6.7 6.7 0 0 1 13.102 9c.257.703.39 1.438.398 2.203l1.7-2.953 3.023 5.25H22.5V3Z", fill: props.color || "currentColor" })));
|
|
9246
|
+
};
|
|
9247
|
+
|
|
9227
9248
|
var SvgShare2 = function (_a) {
|
|
9228
9249
|
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9229
9250
|
return (React$5.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: props.strokeWidth || 1.5, strokeLinecap: "round", strokeLinejoin: "round", className: "share-2_svg__feather share-2_svg__feather-share-2", "aria-labelledby": titleId }, props),
|
|
@@ -10451,6 +10472,7 @@ var Icon = /*#__PURE__*/Object.freeze({
|
|
|
10451
10472
|
Power: SvgPower,
|
|
10452
10473
|
Printer: SvgPrinter,
|
|
10453
10474
|
Process: SvgProcess,
|
|
10475
|
+
ProjectSetting: SvgProjectSetting,
|
|
10454
10476
|
QuoteRight: SvgQuoteRight,
|
|
10455
10477
|
Radio: SvgRadio,
|
|
10456
10478
|
RefreshCcw: SvgRefreshCcw,
|
|
@@ -10470,6 +10492,7 @@ var Icon = /*#__PURE__*/Object.freeze({
|
|
|
10470
10492
|
SendHorFill: SvgSendHorFill,
|
|
10471
10493
|
Server: SvgServer,
|
|
10472
10494
|
Settings: SvgSettings,
|
|
10495
|
+
ShapeGroup: SvgShapeGroup,
|
|
10473
10496
|
Share: SvgShare,
|
|
10474
10497
|
Share2: SvgShare2,
|
|
10475
10498
|
Share3: SvgShare3,
|
|
@@ -19784,17 +19807,20 @@ const isNullOrUndefined$1 = (d) => {
|
|
|
19784
19807
|
const generateUUID = () => {
|
|
19785
19808
|
// Public Domain/MIT
|
|
19786
19809
|
let d = new Date().getTime(); //Timestamp
|
|
19787
|
-
let d2 = (typeof performance !== 'undefined' &&
|
|
19810
|
+
let d2 = (typeof performance !== 'undefined' &&
|
|
19811
|
+
performance.now &&
|
|
19812
|
+
performance.now() * 1000) ||
|
|
19813
|
+
0; //Time in microseconds since page-load or 0 if unsupported
|
|
19788
19814
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
19789
19815
|
let r = Math.random() * 16; //random number between 0 and 16
|
|
19790
19816
|
if (d > 0) {
|
|
19791
19817
|
//Use timestamp until depleted
|
|
19792
|
-
r = (d + r) % 16 | 0;
|
|
19818
|
+
r = ((d + r) % 16) | 0;
|
|
19793
19819
|
d = Math.floor(d / 16);
|
|
19794
19820
|
}
|
|
19795
19821
|
else {
|
|
19796
19822
|
//Use microseconds since page-load if supported
|
|
19797
|
-
r = (d2 + r) % 16 | 0;
|
|
19823
|
+
r = ((d2 + r) % 16) | 0;
|
|
19798
19824
|
d2 = Math.floor(d2 / 16);
|
|
19799
19825
|
}
|
|
19800
19826
|
return (c === 'x' ? r : 0x3).toString(16);
|
|
@@ -19816,12 +19842,16 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2,
|
|
|
19816
19842
|
// eslint-disable-next-line
|
|
19817
19843
|
if (str || str == '0') {
|
|
19818
19844
|
str = str.toString();
|
|
19819
|
-
const value = decimalSeparator !== '.'
|
|
19845
|
+
const value = decimalSeparator !== '.'
|
|
19846
|
+
? str.toString().replaceAll('.', decimalSeparator ?? '')
|
|
19847
|
+
: str;
|
|
19820
19848
|
const arr = value.toString().split(decimalSeparator ?? '', 2);
|
|
19821
19849
|
let flag = value.toString().includes(decimalSeparator ?? '');
|
|
19822
19850
|
if (arr[0].length < 3) {
|
|
19823
19851
|
const intergerArr = haveNegative ? arr[0] : arr[0].replace('-', '');
|
|
19824
|
-
return flag
|
|
19852
|
+
return flag
|
|
19853
|
+
? `${intergerArr}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19854
|
+
: intergerArr;
|
|
19825
19855
|
}
|
|
19826
19856
|
else {
|
|
19827
19857
|
let flagNegative = false;
|
|
@@ -19845,7 +19875,9 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2,
|
|
|
19845
19875
|
if (flagNegative && haveNegative) {
|
|
19846
19876
|
arr[0] = '-'.concat(arr[0]);
|
|
19847
19877
|
}
|
|
19848
|
-
return flag
|
|
19878
|
+
return flag
|
|
19879
|
+
? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19880
|
+
: arr[0];
|
|
19849
19881
|
}
|
|
19850
19882
|
}
|
|
19851
19883
|
else {
|
|
@@ -19868,7 +19900,7 @@ const formatDateTime = (data, format = 'dd/MM/yyyy') => {
|
|
|
19868
19900
|
MM: String(date.getMonth() + 1).padStart(2, '0'),
|
|
19869
19901
|
yyyy: date.getFullYear(),
|
|
19870
19902
|
HH: String(date.getHours()).padStart(2, '0'),
|
|
19871
|
-
mm: String(date.getMinutes()).padStart(2, '0')
|
|
19903
|
+
mm: String(date.getMinutes()).padStart(2, '0'),
|
|
19872
19904
|
};
|
|
19873
19905
|
return format.replace(/dd|DD|MM|yyyy|HH|mm/g, (match) => map[match]);
|
|
19874
19906
|
};
|
|
@@ -19889,7 +19921,7 @@ const FindNodeByPath = (tree, path) => {
|
|
|
19889
19921
|
parent: current,
|
|
19890
19922
|
lastIndex: levels.at(-1),
|
|
19891
19923
|
firstIndex: levels.length === 1 ? levels[0] : -1,
|
|
19892
|
-
node
|
|
19924
|
+
node,
|
|
19893
19925
|
};
|
|
19894
19926
|
};
|
|
19895
19927
|
/**
|
|
@@ -19917,7 +19949,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19917
19949
|
const objHeaderWidthFixLeft = {};
|
|
19918
19950
|
let maxDepth = 0;
|
|
19919
19951
|
// Tính depth tối đa
|
|
19920
|
-
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) =>
|
|
19952
|
+
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) => col.columns?.length ? calculateDepth(col.columns, depth + 1) : depth));
|
|
19921
19953
|
maxDepth = calculateDepth(columns);
|
|
19922
19954
|
let leftTotal = 0;
|
|
19923
19955
|
let rightTotal = 0;
|
|
@@ -19936,45 +19968,47 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19936
19968
|
};
|
|
19937
19969
|
const applySetting = (cols) => {
|
|
19938
19970
|
return cols.map((cell) => {
|
|
19939
|
-
const
|
|
19971
|
+
const newCell = { ...cell };
|
|
19972
|
+
const setting = settingColumns?.find((s) => s.field === newCell.field);
|
|
19940
19973
|
if (setting) {
|
|
19941
|
-
|
|
19942
|
-
if (!
|
|
19943
|
-
|
|
19974
|
+
newCell.sortOrder = setting.sortOrder;
|
|
19975
|
+
if (!newCell.visibleLocked) {
|
|
19976
|
+
newCell.visible = setting.visible ?? true;
|
|
19944
19977
|
}
|
|
19945
|
-
|
|
19978
|
+
newCell.fixedType = setting.fixedType;
|
|
19946
19979
|
if (setting.width !== undefined && setting.width !== null) {
|
|
19947
|
-
|
|
19980
|
+
newCell.width = setting.width;
|
|
19948
19981
|
}
|
|
19949
19982
|
if (setting.fraction !== undefined && setting.fraction !== null) {
|
|
19950
|
-
if (
|
|
19951
|
-
|
|
19983
|
+
if (newCell.numericSettings) {
|
|
19984
|
+
newCell.numericSettings.fraction = setting.fraction;
|
|
19952
19985
|
}
|
|
19953
19986
|
else {
|
|
19954
|
-
|
|
19987
|
+
newCell.numericSettings = { fraction: setting.fraction };
|
|
19955
19988
|
}
|
|
19956
19989
|
}
|
|
19957
|
-
|
|
19990
|
+
newCell.headerDisplay =
|
|
19991
|
+
setting.headerText || (newCell.headerDisplay ?? newCell.headerText);
|
|
19958
19992
|
}
|
|
19959
19993
|
else {
|
|
19960
|
-
if (
|
|
19961
|
-
|
|
19962
|
-
|
|
19963
|
-
if (
|
|
19964
|
-
|
|
19994
|
+
if (newCell.columns?.length) {
|
|
19995
|
+
newCell.columns = applySetting(newCell.columns);
|
|
19996
|
+
newCell.sortOrder = newCell.columns[0].sortOrder;
|
|
19997
|
+
if (newCell.columns.some((x) => x.visible !== false)) {
|
|
19998
|
+
newCell.visible = true;
|
|
19965
19999
|
}
|
|
19966
20000
|
else {
|
|
19967
|
-
|
|
20001
|
+
newCell.visible = false;
|
|
19968
20002
|
}
|
|
19969
20003
|
}
|
|
19970
20004
|
else {
|
|
19971
|
-
if (!
|
|
19972
|
-
|
|
20005
|
+
if (!newCell.visibleLocked) {
|
|
20006
|
+
newCell.visible = false;
|
|
19973
20007
|
}
|
|
19974
20008
|
}
|
|
19975
20009
|
}
|
|
19976
|
-
|
|
19977
|
-
return
|
|
20010
|
+
newCell.isGroup = groupColumns?.includes(newCell.field);
|
|
20011
|
+
return newCell;
|
|
19978
20012
|
});
|
|
19979
20013
|
};
|
|
19980
20014
|
const traverse = (cols, level = 0) => {
|
|
@@ -19990,11 +20024,13 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19990
20024
|
...col,
|
|
19991
20025
|
columns: col.columns ?? [],
|
|
19992
20026
|
colspan,
|
|
19993
|
-
rowspan: hasChildren ? 1 : maxDepth - level
|
|
20027
|
+
rowspan: hasChildren ? 1 : maxDepth - level,
|
|
19994
20028
|
};
|
|
19995
20029
|
levels[level].push(cell);
|
|
19996
20030
|
const headerKey = `${level}-${indexCol}`;
|
|
19997
|
-
if (cell.fixedType === 'left' &&
|
|
20031
|
+
if (cell.fixedType === 'left' &&
|
|
20032
|
+
cell.visible !== false &&
|
|
20033
|
+
cell.isGroup !== true) {
|
|
19998
20034
|
objHeaderWidthFixLeft[headerKey] = leftTotal;
|
|
19999
20035
|
}
|
|
20000
20036
|
if (!hasChildren) {
|
|
@@ -20002,16 +20038,22 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20002
20038
|
const width = cell.width ?? 40;
|
|
20003
20039
|
cell.index = index;
|
|
20004
20040
|
flat.push(cell);
|
|
20005
|
-
if (cell.fixedType === 'left' &&
|
|
20041
|
+
if (cell.fixedType === 'left' &&
|
|
20042
|
+
cell.visible !== false &&
|
|
20043
|
+
cell.isGroup !== true) {
|
|
20006
20044
|
objWidthFixLeft[index] = leftTotal;
|
|
20007
20045
|
leftTotal += width;
|
|
20008
20046
|
}
|
|
20009
|
-
if (cell.fixedType === 'right' &&
|
|
20047
|
+
if (cell.fixedType === 'right' &&
|
|
20048
|
+
cell.visible !== false &&
|
|
20049
|
+
cell.isGroup !== true) {
|
|
20010
20050
|
rightTotal -= width;
|
|
20011
20051
|
objWidthFixRight[index] = rightTotal;
|
|
20012
20052
|
}
|
|
20013
20053
|
}
|
|
20014
|
-
if (cell.fixedType === 'right' &&
|
|
20054
|
+
if (cell.fixedType === 'right' &&
|
|
20055
|
+
cell.visible !== false &&
|
|
20056
|
+
cell.isGroup !== true) {
|
|
20015
20057
|
objHeaderWidthFixRight[headerKey] = rightTotal;
|
|
20016
20058
|
}
|
|
20017
20059
|
return colspanSum + colspan;
|
|
@@ -20024,13 +20066,20 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20024
20066
|
traverse(columns);
|
|
20025
20067
|
// Danh sách các cột được hiển thị
|
|
20026
20068
|
// const flatVisble = flat.filter((e) => e.visible !== false)
|
|
20027
|
-
const flatVisbleContent = flat.filter((x) => x.visible !== false &&
|
|
20069
|
+
const flatVisbleContent = flat.filter((x) => x.visible !== false &&
|
|
20070
|
+
x.field !== 'command' &&
|
|
20071
|
+
x.field !== '#' &&
|
|
20072
|
+
x.field !== 'checkbox');
|
|
20028
20073
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột cố định
|
|
20029
20074
|
const lastObjWidthFixLeft = Math.max(...Object.keys(objWidthFixLeft).map(Number), 0);
|
|
20030
20075
|
const fisrtObjWidthFixRight = Math.min(...Object.keys(objWidthFixRight).map(Number), flat.length);
|
|
20031
20076
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột có thể sửa
|
|
20032
20077
|
const indexFirstEdit = flat.findIndex((item) => item.editEnable && item.visible !== false && !item.disabledCondition);
|
|
20033
|
-
const indexLastEdit = flat
|
|
20078
|
+
const indexLastEdit = flat
|
|
20079
|
+
.map((item, idx) => item.editEnable && item.visible !== false && !item.disabledCondition
|
|
20080
|
+
? idx
|
|
20081
|
+
: -1)
|
|
20082
|
+
.reduce((acc, val) => (val > acc ? val : acc), -1);
|
|
20034
20083
|
return {
|
|
20035
20084
|
levels,
|
|
20036
20085
|
flat,
|
|
@@ -20043,7 +20092,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20043
20092
|
objHeaderWidthFixRight,
|
|
20044
20093
|
objHeaderWidthFixLeft,
|
|
20045
20094
|
indexFirstEdit,
|
|
20046
|
-
indexLastEdit
|
|
20095
|
+
indexLastEdit,
|
|
20047
20096
|
};
|
|
20048
20097
|
};
|
|
20049
20098
|
/**
|
|
@@ -20053,7 +20102,10 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20053
20102
|
const isFilterMatch = filters.every((filter) => {
|
|
20054
20103
|
const { key, value, ope } = filter;
|
|
20055
20104
|
const rowValue = row[key];
|
|
20056
|
-
if (rowValue === undefined ||
|
|
20105
|
+
if (rowValue === undefined ||
|
|
20106
|
+
rowValue === null ||
|
|
20107
|
+
value === undefined ||
|
|
20108
|
+
value === null) {
|
|
20057
20109
|
return false;
|
|
20058
20110
|
}
|
|
20059
20111
|
const valStr = String(rowValue).toLowerCase();
|
|
@@ -20086,7 +20138,10 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20086
20138
|
const isSearchMatch = !keyword ||
|
|
20087
20139
|
searchKeys.some((key) => {
|
|
20088
20140
|
const val = row[key];
|
|
20089
|
-
return val
|
|
20141
|
+
return val
|
|
20142
|
+
?.toString()
|
|
20143
|
+
.toLowerCase()
|
|
20144
|
+
.includes(keyword.trim().toLowerCase());
|
|
20090
20145
|
});
|
|
20091
20146
|
return isFilterMatch && isSearchMatch;
|
|
20092
20147
|
};
|
|
@@ -20246,7 +20301,7 @@ const TableElement$1 = React__default.memo((props) => {
|
|
|
20246
20301
|
|
|
20247
20302
|
const defaultMaxHeight$1 = 250;
|
|
20248
20303
|
const SelectTable = forwardRef((props, ref) => {
|
|
20249
|
-
const { id, menuWidth, width, invalid, placeholder, textAlign, options, columns, value, fieldValue, fieldLabel, maxHeight, isClearable, component, isMulti, noHeader, isDisabled, showFooter, formatSetting, allowCreate, onPaste, onChange, handleAdd, onKeyDown, onOpenMenu, loadOptions, onCloseMenu, footerComponent, formatOptionLabel, compareFunction } = props;
|
|
20304
|
+
const { id, menuWidth, width, invalid, placeholder, textAlign, options, columns, value, fieldValue, fieldLabel, maxHeight, isClearable, component, isMulti, noHeader, isDisabled, showFooter, formatSetting, allowCreate, onPaste, onChange, handleAdd, onKeyDown, onOpenMenu, loadOptions, onCloseMenu, footerComponent, formatOptionLabel, compareFunction, } = props;
|
|
20250
20305
|
const selectTableRef = useRef(null);
|
|
20251
20306
|
const selectMenuTableRef = useRef(null);
|
|
20252
20307
|
const inputRef = useRef(null);
|
|
@@ -20263,8 +20318,8 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20263
20318
|
{
|
|
20264
20319
|
headerText: 'Name',
|
|
20265
20320
|
field: fieldLabel ?? 'label',
|
|
20266
|
-
width: menuWidth
|
|
20267
|
-
}
|
|
20321
|
+
width: menuWidth,
|
|
20322
|
+
},
|
|
20268
20323
|
];
|
|
20269
20324
|
const closeMenu = () => {
|
|
20270
20325
|
setDropdownOpen(false);
|
|
@@ -20274,7 +20329,12 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20274
20329
|
};
|
|
20275
20330
|
const handChange = (val) => {
|
|
20276
20331
|
if (val && val.isCreated) {
|
|
20277
|
-
const newVal = {
|
|
20332
|
+
const newVal = {
|
|
20333
|
+
...val,
|
|
20334
|
+
[fieldLabel ?? 'label']: val.valueCreate,
|
|
20335
|
+
isCreated: undefined,
|
|
20336
|
+
isCreatedItem: true,
|
|
20337
|
+
};
|
|
20278
20338
|
options.unshift(newVal);
|
|
20279
20339
|
onChange(newVal);
|
|
20280
20340
|
return;
|
|
@@ -20283,7 +20343,9 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20283
20343
|
};
|
|
20284
20344
|
useEffect(() => {
|
|
20285
20345
|
if (dropdownOpen && value && !isMulti && selectMenuTableRef) {
|
|
20286
|
-
const index = currentOptions?.findIndex((row) =>
|
|
20346
|
+
const index = currentOptions?.findIndex((row) => compareFunction
|
|
20347
|
+
? compareFunction(row)
|
|
20348
|
+
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']);
|
|
20287
20349
|
if (index >= 0) {
|
|
20288
20350
|
selectMenuTableRef.current.scrollTo({ top: (index - 1) * 30 });
|
|
20289
20351
|
}
|
|
@@ -20330,14 +20392,28 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20330
20392
|
}
|
|
20331
20393
|
}
|
|
20332
20394
|
};
|
|
20333
|
-
const listKeyUse = [
|
|
20395
|
+
const listKeyUse = [
|
|
20396
|
+
'Escape',
|
|
20397
|
+
'Space',
|
|
20398
|
+
'Enter',
|
|
20399
|
+
'Tab',
|
|
20400
|
+
'NumpadEnter',
|
|
20401
|
+
'ArrowDown',
|
|
20402
|
+
'ArrowUp',
|
|
20403
|
+
'F9',
|
|
20404
|
+
];
|
|
20334
20405
|
const handleOnKeyDown = (e) => {
|
|
20335
20406
|
let key = '';
|
|
20336
20407
|
if (onKeyDown &&
|
|
20337
20408
|
(!dropdownOpen ||
|
|
20338
20409
|
!listKeyUse.includes(e.code) ||
|
|
20339
|
-
((e.code === 'Enter' ||
|
|
20340
|
-
|
|
20410
|
+
((e.code === 'Enter' ||
|
|
20411
|
+
e.code === 'Tab' ||
|
|
20412
|
+
e.code === 'NumpadEnter' ||
|
|
20413
|
+
e.code === 'Space') &&
|
|
20414
|
+
!(currentOptions[indexFocus] || haveCreateNew)) ||
|
|
20415
|
+
((e.code === 'ArrowDown' || e.code === 'ArrowUp') &&
|
|
20416
|
+
currentOptions.length === 0) ||
|
|
20341
20417
|
(e.code === 'Escape' && !(isClearable && value && !isDisabled)))) {
|
|
20342
20418
|
key = onKeyDown(e);
|
|
20343
20419
|
}
|
|
@@ -20350,7 +20426,12 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20350
20426
|
else if (e.code === 'Space') {
|
|
20351
20427
|
let newItem;
|
|
20352
20428
|
if (haveCreateNew && indexFocus === 0) {
|
|
20353
|
-
newItem = {
|
|
20429
|
+
newItem = {
|
|
20430
|
+
valueCreate: searchTerm,
|
|
20431
|
+
[fieldValue ?? 'value']: searchTerm,
|
|
20432
|
+
[fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`,
|
|
20433
|
+
isCreated: true,
|
|
20434
|
+
};
|
|
20354
20435
|
}
|
|
20355
20436
|
else {
|
|
20356
20437
|
newItem = currentOptions[indexFocus];
|
|
@@ -20371,10 +20452,17 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20371
20452
|
flag = true;
|
|
20372
20453
|
}
|
|
20373
20454
|
}
|
|
20374
|
-
else if (e.code === 'Enter' ||
|
|
20455
|
+
else if (e.code === 'Enter' ||
|
|
20456
|
+
e.code === 'Tab' ||
|
|
20457
|
+
e.code === 'NumpadEnter') {
|
|
20375
20458
|
let newItem;
|
|
20376
20459
|
if (haveCreateNew && indexFocus === 0) {
|
|
20377
|
-
newItem = {
|
|
20460
|
+
newItem = {
|
|
20461
|
+
valueCreate: searchTerm,
|
|
20462
|
+
[fieldValue ?? 'value']: searchTerm,
|
|
20463
|
+
[fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`,
|
|
20464
|
+
isCreated: true,
|
|
20465
|
+
};
|
|
20378
20466
|
}
|
|
20379
20467
|
else {
|
|
20380
20468
|
newItem = currentOptions[indexFocus];
|
|
@@ -20392,7 +20480,10 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20392
20480
|
newIndex = indexFocus + 1;
|
|
20393
20481
|
}
|
|
20394
20482
|
else if (value) {
|
|
20395
|
-
newIndex =
|
|
20483
|
+
newIndex =
|
|
20484
|
+
currentOptions?.findIndex((row) => compareFunction
|
|
20485
|
+
? compareFunction(row)
|
|
20486
|
+
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']) + 1;
|
|
20396
20487
|
}
|
|
20397
20488
|
if (newIndex < currentOptions.length) {
|
|
20398
20489
|
setIndexFocus(newIndex);
|
|
@@ -20416,7 +20507,10 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20416
20507
|
newIndex = indexFocus - 1;
|
|
20417
20508
|
}
|
|
20418
20509
|
else if (value) {
|
|
20419
|
-
newIndex =
|
|
20510
|
+
newIndex =
|
|
20511
|
+
currentOptions?.findIndex((row) => compareFunction
|
|
20512
|
+
? compareFunction(row)
|
|
20513
|
+
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']) - 1;
|
|
20420
20514
|
}
|
|
20421
20515
|
if (newIndex >= 0) {
|
|
20422
20516
|
setIndexFocus(newIndex);
|
|
@@ -20449,7 +20543,11 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20449
20543
|
scrollToElement(selectMenuTableRef.current, selectMenuTableRef.current.scrollHeight);
|
|
20450
20544
|
}
|
|
20451
20545
|
else if (flag === 0 && rect.bottom + 30 > parentRect.bottom) {
|
|
20452
|
-
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop -
|
|
20546
|
+
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop -
|
|
20547
|
+
selectMenuTableRef.current.offsetTop -
|
|
20548
|
+
parentRect.height +
|
|
20549
|
+
rect.height +
|
|
20550
|
+
50);
|
|
20453
20551
|
}
|
|
20454
20552
|
else if (flag === 2 && rect.top < parentRect.top + 50) {
|
|
20455
20553
|
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - 65);
|
|
@@ -20463,7 +20561,7 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20463
20561
|
timeOutElement = setTimeout(() => {
|
|
20464
20562
|
elemment.scrollTo({
|
|
20465
20563
|
top,
|
|
20466
|
-
behavior: 'smooth'
|
|
20564
|
+
behavior: 'smooth',
|
|
20467
20565
|
});
|
|
20468
20566
|
}, 100);
|
|
20469
20567
|
};
|
|
@@ -20473,7 +20571,12 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20473
20571
|
}
|
|
20474
20572
|
for (let index = 0; index < columnsSearch.length; index++) {
|
|
20475
20573
|
const key = columnsSearch[index].field.trim();
|
|
20476
|
-
if (data[key] &&
|
|
20574
|
+
if (data[key] &&
|
|
20575
|
+
data[key]
|
|
20576
|
+
.toString()
|
|
20577
|
+
.trim()
|
|
20578
|
+
.toLowerCase()
|
|
20579
|
+
.includes(keyword.trim().toLowerCase())) {
|
|
20477
20580
|
return true;
|
|
20478
20581
|
}
|
|
20479
20582
|
}
|
|
@@ -20489,7 +20592,8 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20489
20592
|
if (!searchTerm) {
|
|
20490
20593
|
setOptionsLoad(undefined);
|
|
20491
20594
|
}
|
|
20492
|
-
else if (allowCreate &&
|
|
20595
|
+
else if (allowCreate &&
|
|
20596
|
+
!currentOptions?.find((x) => x[fieldLabel ?? 'label'] === searchTerm)) {
|
|
20493
20597
|
setHaveCreateNew(true);
|
|
20494
20598
|
return;
|
|
20495
20599
|
}
|
|
@@ -20501,9 +20605,24 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20501
20605
|
};
|
|
20502
20606
|
React__default.memo((props) => {
|
|
20503
20607
|
const { indexRow, row, isSelected, level = 0 } = props;
|
|
20504
|
-
return (jsxs("tr", { id: `row-select-table-${indexRow}`, style: { paddingLeft: 10 * level }, className: classNames$1('r-select-row', { 'last-row': indexRow === currentOptions.length - 1 }, { 'fisrt-row': indexRow === 0 }), children: [isMulti && (jsx("td", { className: classNames$1(`r-select-rowcell`, {
|
|
20608
|
+
return (jsxs("tr", { id: `row-select-table-${indexRow}`, style: { paddingLeft: 10 * level }, className: classNames$1('r-select-row', { 'last-row': indexRow === currentOptions.length - 1 }, { 'fisrt-row': indexRow === 0 }), children: [isMulti && (jsx("td", { className: classNames$1(`r-select-rowcell`, {
|
|
20609
|
+
'r-select-move': indexFocus === indexRow,
|
|
20610
|
+
'r-select-active': !isMulti &&
|
|
20611
|
+
value &&
|
|
20612
|
+
(compareFunction
|
|
20613
|
+
? compareFunction(row)
|
|
20614
|
+
: value[fieldValue ?? 'value'] ===
|
|
20615
|
+
row[fieldValue ?? 'value']),
|
|
20616
|
+
}), style: {
|
|
20617
|
+
width: 40,
|
|
20618
|
+
textAlign: 'center',
|
|
20619
|
+
padding: 0,
|
|
20620
|
+
paddingBottom: 6,
|
|
20621
|
+
}, onClick: (e) => {
|
|
20505
20622
|
if (isMulti) {
|
|
20506
|
-
const index = value?.findIndex((x) =>
|
|
20623
|
+
const index = value?.findIndex((x) => compareFunction
|
|
20624
|
+
? compareFunction(row)
|
|
20625
|
+
: x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']);
|
|
20507
20626
|
if (index > -1) {
|
|
20508
20627
|
value?.splice(index, 1);
|
|
20509
20628
|
handChange([...value]);
|
|
@@ -20521,25 +20640,42 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20521
20640
|
}
|
|
20522
20641
|
}, children: jsx(Input$1, { checked: isSelected, type: "checkbox", className: "cursor-pointer", onChange: () => { }, style: { textAlign: 'center', marginTop: 6 } }) })), (columns ? columns : defaultColumns).map((col, indexCol) => {
|
|
20523
20642
|
let valueDisplay = row[col.field];
|
|
20524
|
-
if (col.type === 'numeric' ||
|
|
20525
|
-
|
|
20643
|
+
if (col.type === 'numeric' ||
|
|
20644
|
+
(col.typeCondition && col.typeCondition(row) === 'numeric')) {
|
|
20645
|
+
valueDisplay =
|
|
20646
|
+
formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? '.', formatSetting?.thousandSeparator ?? ',', col.fraction ?? 0, true, false) ?? 0;
|
|
20526
20647
|
}
|
|
20527
20648
|
else if (col.type === 'date') {
|
|
20528
|
-
valueDisplay = valueDisplay
|
|
20649
|
+
valueDisplay = valueDisplay
|
|
20650
|
+
? formatDateTime(valueDisplay, formatSetting?.dateFormat)
|
|
20651
|
+
: '';
|
|
20529
20652
|
}
|
|
20530
20653
|
else if (col.type === 'datetime') {
|
|
20531
|
-
valueDisplay = valueDisplay
|
|
20654
|
+
valueDisplay = valueDisplay
|
|
20655
|
+
? formatDateTime(valueDisplay, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
20656
|
+
: '';
|
|
20532
20657
|
}
|
|
20533
20658
|
return (jsxs(Fragment, { children: [col.visible !== false && (jsx("td", { id: `select-${id}-${indexRow}-${indexCol}`,
|
|
20534
20659
|
// ref={refRow}
|
|
20535
|
-
className: classNames$1(`r-select-rowcell`, {
|
|
20660
|
+
className: classNames$1(`r-select-rowcell`, {
|
|
20661
|
+
'r-select-move': indexFocus === indexRow,
|
|
20662
|
+
'r-select-active': !isMulti &&
|
|
20663
|
+
value &&
|
|
20664
|
+
(compareFunction
|
|
20665
|
+
? compareFunction(row)
|
|
20666
|
+
: value[fieldValue ?? 'value'] ===
|
|
20667
|
+
row[fieldValue ?? 'value']),
|
|
20668
|
+
}), style: {
|
|
20536
20669
|
minWidth: col.minWidth,
|
|
20537
20670
|
width: col.width,
|
|
20538
20671
|
maxWidth: col.maxWidth,
|
|
20539
|
-
textAlign: col.textAlign ? col.textAlign : 'left'
|
|
20672
|
+
textAlign: col.textAlign ? col.textAlign : 'left',
|
|
20540
20673
|
}, onClick: (e) => {
|
|
20541
20674
|
if (isMulti) {
|
|
20542
|
-
const index = value?.findIndex((x) =>
|
|
20675
|
+
const index = value?.findIndex((x) => compareFunction
|
|
20676
|
+
? compareFunction(row)
|
|
20677
|
+
: x[fieldValue ?? 'value'] ===
|
|
20678
|
+
row[fieldValue ?? 'value']);
|
|
20543
20679
|
if (index > -1) {
|
|
20544
20680
|
value?.splice(index, 1);
|
|
20545
20681
|
handChange([...value]);
|
|
@@ -20566,7 +20702,7 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20566
20702
|
setIndexFocus(indexRow);
|
|
20567
20703
|
}
|
|
20568
20704
|
e.stopPropagation();
|
|
20569
|
-
}, children: col.template ? col.template(row, indexRow) : col.type === 'numeric' && Number(row[col.field]) < 0 ? jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [
|
|
20705
|
+
}, children: col.template ? (col.template(row, indexRow)) : col.type === 'numeric' && Number(row[col.field]) < 0 ? (jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${value}${formatSetting?.suffixNegative ?? ''}`] })) : (valueDisplay) }, `col-${indexRow}-${indexCol}`)), checkOverflow(indexRow, indexCol) && (jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `select-${id}-${indexRow}-${indexCol}`, children: col.template ? col.template(row, indexRow) : valueDisplay }))] }, indexCol));
|
|
20570
20706
|
})] }, `row-${indexRow}`));
|
|
20571
20707
|
});
|
|
20572
20708
|
return (jsx("div", { className: classNames$1('react-select-table', { 'is-invalid': invalid }), ref: ref, id: id, children: jsx("div", { ref: selectTableRef, children: jsxs(Dropdown$1$1, { isOpen: dropdownOpen, toggle: () => { }, onMouseDown: (e) => e.preventDefault(), children: [jsxs(DropdownToggle$1, { onClick: (e) => {
|
|
@@ -20575,9 +20711,27 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20575
20711
|
handleOpenClose();
|
|
20576
20712
|
}
|
|
20577
20713
|
e.preventDefault();
|
|
20578
|
-
}, tag: "div", style: {
|
|
20579
|
-
|
|
20580
|
-
|
|
20714
|
+
}, tag: "div", style: {
|
|
20715
|
+
width: width
|
|
20716
|
+
? width
|
|
20717
|
+
: selectTableRef?.current?.clientWidth
|
|
20718
|
+
? selectTableRef?.current?.clientWidth
|
|
20719
|
+
: 'auto',
|
|
20720
|
+
}, className: classNames$1('select-table-control', { 'r-select-is-disabled': isDisabled }, { 'r-select-is-open': dropdownOpen }, { 'r-select-is-focus': isFocus }, { 'r-select-is-invalid': invalid }), children: [jsxs("div", { className: "select-table-container", children: [isMulti ? (jsx("div", { className: classNames$1('select-value is-mutil', {
|
|
20721
|
+
'd-none': searchTerm,
|
|
20722
|
+
}), children: value?.map((ele, index) => {
|
|
20723
|
+
return (jsxs("span", { children: [index === 0 ? '' : ', ', formatOptionLabel
|
|
20724
|
+
? formatOptionLabel(ele)
|
|
20725
|
+
: ele[fieldLabel ?? 'label']] }, index));
|
|
20726
|
+
}) })) : (jsxs("div", { className: classNames$1('select-value', {
|
|
20727
|
+
'd-none': searchTerm,
|
|
20728
|
+
}), children: [value
|
|
20729
|
+
? formatOptionLabel
|
|
20730
|
+
? formatOptionLabel(value)
|
|
20731
|
+
: value[fieldLabel ?? 'label']
|
|
20732
|
+
: '', ' '] })), !((isMulti ? value?.length > 0 : value) ||
|
|
20733
|
+
isDisabled ||
|
|
20734
|
+
searchTerm) && (jsx("div", { className: classNames$1('select-placeholder'), children: placeholder })), jsx("div", { className: "input-container", children: jsx("input", { style: { textAlign: textAlign ?? 'left' }, ref: inputRef, className: classNames$1('select-input'), readOnly: isDisabled, value: searchTerm, onPaste: (e) => onPaste && !dropdownOpen && onPaste(e), onChange: (val) => {
|
|
20581
20735
|
if (val.target.value) {
|
|
20582
20736
|
if (loadOptions && val.target.value) {
|
|
20583
20737
|
setIsLoading(true);
|
|
@@ -20599,13 +20753,23 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20599
20753
|
width: width ? width + 2 : 'min-content',
|
|
20600
20754
|
position: 'fixed',
|
|
20601
20755
|
borderRadius: 4,
|
|
20602
|
-
zIndex: 9999
|
|
20756
|
+
zIndex: 9999,
|
|
20603
20757
|
}, children: jsx(DropdownItem$1, { className: classNames$1('p-0 menu-select-table'), tag: "div", header: true, children: dropdownOpen && (jsx("div", { style: { backgroundColor: 'none' }, onMouseDown: (e) => {
|
|
20604
20758
|
if (!isDisabled) {
|
|
20605
20759
|
inputRef?.current.focus();
|
|
20606
20760
|
e.preventDefault();
|
|
20607
20761
|
}
|
|
20608
|
-
}, children: jsxs("div", { className: "r-select-grid", children: [jsx("div", { className: classNames$1('r-select-gridtable', {
|
|
20762
|
+
}, children: jsxs("div", { className: "r-select-grid", children: [jsx("div", { className: classNames$1('r-select-gridtable', {
|
|
20763
|
+
'no-header': noHeader || (columns?.length ?? 0) === 0,
|
|
20764
|
+
}), ref: selectMenuTableRef, style: {
|
|
20765
|
+
width: menuWidth,
|
|
20766
|
+
minWidth: selectTableRef?.current?.clientWidth,
|
|
20767
|
+
maxHeight: maxHeight ?? defaultMaxHeight$1,
|
|
20768
|
+
}, children: jsx(TableElement$1, { haveCreateNew: haveCreateNew, isLoading: isLoading, searchTerm: searchTerm, fieldLabel: fieldLabel, noHeader: noHeader, closeMenu: closeMenu, value: value, isMulti: isMulti, currentOptions: currentOptions, fieldValue: fieldValue, columns: columns, defaultColumns: defaultColumns, indexFocus: indexFocus, formatSetting: formatSetting, handChange: handChange, compareFunction: compareFunction, setIndexFocus: setIndexFocus, setSearchTerm: setSearchTerm }) }), jsxs("div", { className: classNames$1('r-select-footer', {
|
|
20769
|
+
'd-none': !(showFooter === true ||
|
|
20770
|
+
handleAdd ||
|
|
20771
|
+
isMulti),
|
|
20772
|
+
}), children: [jsxs(Button$1$1, { outline: true, color: "primary", onClick: () => handleAdd?.(), className: classNames$1('r-btn d-flex align-items-center', { 'd-none': !handleAdd }), children: [jsx(SvgPlus, { className: "me-50", fontSize: 16 }), t('AddNew'), " (F9)"] }), isMulti && (jsx("div", { className: "ms-50 text-primary h-100 d-flex align-items-center", children: t('countSelected', { item: value?.length ?? 0 }) })), footerComponent ? footerComponent() : null] })] }) })) }) })] }) }) }));
|
|
20609
20773
|
});
|
|
20610
20774
|
|
|
20611
20775
|
const PagingComponent = ({ totalItem, gridRef, pageSize, currentPage, onChangePage, pageOptions, onChangePageSize }) => {
|
|
@@ -25531,6 +25695,72 @@ function startOfYear(date, options) {
|
|
|
25531
25695
|
return date_;
|
|
25532
25696
|
}
|
|
25533
25697
|
|
|
25698
|
+
/**
|
|
25699
|
+
* The {@link eachYearOfInterval} function options.
|
|
25700
|
+
*/
|
|
25701
|
+
|
|
25702
|
+
/**
|
|
25703
|
+
* The {@link eachYearOfInterval} function result type. It resolves the proper data type.
|
|
25704
|
+
* It uses the first argument date object type, starting from the date argument,
|
|
25705
|
+
* then the start interval date, and finally the end interval date. If
|
|
25706
|
+
* a context function is passed, it uses the context function return type.
|
|
25707
|
+
*/
|
|
25708
|
+
|
|
25709
|
+
/**
|
|
25710
|
+
* @name eachYearOfInterval
|
|
25711
|
+
* @category Interval Helpers
|
|
25712
|
+
* @summary Return the array of yearly timestamps within the specified time interval.
|
|
25713
|
+
*
|
|
25714
|
+
* @description
|
|
25715
|
+
* Return the array of yearly timestamps within the specified time interval.
|
|
25716
|
+
*
|
|
25717
|
+
* @typeParam IntervalType - Interval type.
|
|
25718
|
+
* @typeParam Options - Options type.
|
|
25719
|
+
*
|
|
25720
|
+
* @param interval - The interval.
|
|
25721
|
+
* @param options - An object with options.
|
|
25722
|
+
*
|
|
25723
|
+
* @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
|
|
25724
|
+
*
|
|
25725
|
+
* @example
|
|
25726
|
+
* // Each year between 6 February 2014 and 10 August 2017:
|
|
25727
|
+
* const result = eachYearOfInterval({
|
|
25728
|
+
* start: new Date(2014, 1, 6),
|
|
25729
|
+
* end: new Date(2017, 7, 10)
|
|
25730
|
+
* })
|
|
25731
|
+
* //=> [
|
|
25732
|
+
* // Wed Jan 01 2014 00:00:00,
|
|
25733
|
+
* // Thu Jan 01 2015 00:00:00,
|
|
25734
|
+
* // Fri Jan 01 2016 00:00:00,
|
|
25735
|
+
* // Sun Jan 01 2017 00:00:00
|
|
25736
|
+
* // ]
|
|
25737
|
+
*/
|
|
25738
|
+
function eachYearOfInterval(interval, options) {
|
|
25739
|
+
const { start, end } = normalizeInterval(options?.in, interval);
|
|
25740
|
+
|
|
25741
|
+
let reversed = +start > +end;
|
|
25742
|
+
const endTime = reversed ? +start : +end;
|
|
25743
|
+
const date = reversed ? end : start;
|
|
25744
|
+
date.setHours(0, 0, 0, 0);
|
|
25745
|
+
date.setMonth(0, 1);
|
|
25746
|
+
|
|
25747
|
+
let step = options?.step ?? 1;
|
|
25748
|
+
if (!step) return [];
|
|
25749
|
+
if (step < 0) {
|
|
25750
|
+
step = -step;
|
|
25751
|
+
reversed = !reversed;
|
|
25752
|
+
}
|
|
25753
|
+
|
|
25754
|
+
const dates = [];
|
|
25755
|
+
|
|
25756
|
+
while (+date <= endTime) {
|
|
25757
|
+
dates.push(constructFrom(start, date));
|
|
25758
|
+
date.setFullYear(date.getFullYear() + step);
|
|
25759
|
+
}
|
|
25760
|
+
|
|
25761
|
+
return reversed ? dates.reverse() : dates;
|
|
25762
|
+
}
|
|
25763
|
+
|
|
25534
25764
|
/**
|
|
25535
25765
|
* The {@link endOfWeek} function options.
|
|
25536
25766
|
*/
|
|
@@ -26239,7 +26469,7 @@ const match = {
|
|
|
26239
26469
|
* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
|
|
26240
26470
|
* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
|
|
26241
26471
|
*/
|
|
26242
|
-
const enUS = {
|
|
26472
|
+
const enUS$1 = {
|
|
26243
26473
|
code: "en-US",
|
|
26244
26474
|
formatDistance: formatDistance,
|
|
26245
26475
|
formatLong: formatLong,
|
|
@@ -27756,7 +27986,7 @@ const unescapedLatinCharacterRegExp$1 = /[a-zA-Z]/;
|
|
|
27756
27986
|
*/
|
|
27757
27987
|
function format(date, formatStr, options) {
|
|
27758
27988
|
const defaultOptions = getDefaultOptions$1();
|
|
27759
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
27989
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS$1;
|
|
27760
27990
|
|
|
27761
27991
|
const firstWeekContainsDate =
|
|
27762
27992
|
options?.firstWeekContainsDate ??
|
|
@@ -30449,7 +30679,7 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
30449
30679
|
function parse(dateStr, formatStr, referenceDate, options) {
|
|
30450
30680
|
const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);
|
|
30451
30681
|
const defaultOptions = getDefaultOptions();
|
|
30452
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
30682
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS$1;
|
|
30453
30683
|
|
|
30454
30684
|
const firstWeekContainsDate =
|
|
30455
30685
|
options?.firstWeekContainsDate ??
|
|
@@ -31255,6 +31485,69 @@ function endOfBroadcastWeek(date, dateLib) {
|
|
|
31255
31485
|
return endDate;
|
|
31256
31486
|
}
|
|
31257
31487
|
|
|
31488
|
+
/** English (United States) locale extended with DayPicker-specific translations. */
|
|
31489
|
+
const enUS = {
|
|
31490
|
+
...enUS$1,
|
|
31491
|
+
labels: {
|
|
31492
|
+
labelDayButton: (date, modifiers, options, dateLib) => {
|
|
31493
|
+
let formatDate;
|
|
31494
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31495
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31496
|
+
}
|
|
31497
|
+
else {
|
|
31498
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31499
|
+
}
|
|
31500
|
+
let label = formatDate(date, "PPPP");
|
|
31501
|
+
if (modifiers.today)
|
|
31502
|
+
label = `Today, ${label}`;
|
|
31503
|
+
if (modifiers.selected)
|
|
31504
|
+
label = `${label}, selected`;
|
|
31505
|
+
return label;
|
|
31506
|
+
},
|
|
31507
|
+
labelMonthDropdown: "Choose the Month",
|
|
31508
|
+
labelNext: "Go to the Next Month",
|
|
31509
|
+
labelPrevious: "Go to the Previous Month",
|
|
31510
|
+
labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
|
|
31511
|
+
labelYearDropdown: "Choose the Year",
|
|
31512
|
+
labelGrid: (date, options, dateLib) => {
|
|
31513
|
+
let formatDate;
|
|
31514
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31515
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31516
|
+
}
|
|
31517
|
+
else {
|
|
31518
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31519
|
+
}
|
|
31520
|
+
return formatDate(date, "LLLL yyyy");
|
|
31521
|
+
},
|
|
31522
|
+
labelGridcell: (date, modifiers, options, dateLib) => {
|
|
31523
|
+
let formatDate;
|
|
31524
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31525
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31526
|
+
}
|
|
31527
|
+
else {
|
|
31528
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31529
|
+
}
|
|
31530
|
+
let label = formatDate(date, "PPPP");
|
|
31531
|
+
if (modifiers?.today) {
|
|
31532
|
+
label = `Today, ${label}`;
|
|
31533
|
+
}
|
|
31534
|
+
return label;
|
|
31535
|
+
},
|
|
31536
|
+
labelNav: "Navigation bar",
|
|
31537
|
+
labelWeekNumberHeader: "Week Number",
|
|
31538
|
+
labelWeekday: (date, options, dateLib) => {
|
|
31539
|
+
let formatDate;
|
|
31540
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31541
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31542
|
+
}
|
|
31543
|
+
else {
|
|
31544
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31545
|
+
}
|
|
31546
|
+
return formatDate(date, "cccc");
|
|
31547
|
+
},
|
|
31548
|
+
},
|
|
31549
|
+
};
|
|
31550
|
+
|
|
31258
31551
|
/**
|
|
31259
31552
|
* A wrapper class around [date-fns](http://date-fns.org) that provides utility
|
|
31260
31553
|
* methods for date manipulation and formatting.
|
|
@@ -31393,6 +31686,31 @@ class DateLib {
|
|
|
31393
31686
|
? this.overrides.eachMonthOfInterval(interval)
|
|
31394
31687
|
: eachMonthOfInterval(interval);
|
|
31395
31688
|
};
|
|
31689
|
+
/**
|
|
31690
|
+
* Returns the years between the given dates.
|
|
31691
|
+
*
|
|
31692
|
+
* @since 9.11.1
|
|
31693
|
+
* @param interval The interval to get the years for.
|
|
31694
|
+
* @returns The array of years in the interval.
|
|
31695
|
+
*/
|
|
31696
|
+
this.eachYearOfInterval = (interval) => {
|
|
31697
|
+
const years = this.overrides?.eachYearOfInterval
|
|
31698
|
+
? this.overrides.eachYearOfInterval(interval)
|
|
31699
|
+
: eachYearOfInterval(interval);
|
|
31700
|
+
// Remove duplicates that may happen across DST transitions (e.g., "America/Sao_Paulo")
|
|
31701
|
+
// See https://github.com/date-fns/tz/issues/72
|
|
31702
|
+
const uniqueYears = new Set(years.map((d) => this.getYear(d)));
|
|
31703
|
+
if (uniqueYears.size === years.length) {
|
|
31704
|
+
// No duplicates, return as is
|
|
31705
|
+
return years;
|
|
31706
|
+
}
|
|
31707
|
+
// Rebuild the array to ensure one date per year
|
|
31708
|
+
const yearsArray = [];
|
|
31709
|
+
uniqueYears.forEach((y) => {
|
|
31710
|
+
yearsArray.push(new Date(y, 0, 1));
|
|
31711
|
+
});
|
|
31712
|
+
return yearsArray;
|
|
31713
|
+
};
|
|
31396
31714
|
/**
|
|
31397
31715
|
* Returns the end of the broadcast week for the given date.
|
|
31398
31716
|
*
|
|
@@ -31731,7 +32049,63 @@ class DateLib {
|
|
|
31731
32049
|
formatNumber(value) {
|
|
31732
32050
|
return this.replaceDigits(value.toString());
|
|
31733
32051
|
}
|
|
31734
|
-
|
|
32052
|
+
/**
|
|
32053
|
+
* Returns the preferred ordering for month and year labels for the current
|
|
32054
|
+
* locale.
|
|
32055
|
+
*/
|
|
32056
|
+
getMonthYearOrder() {
|
|
32057
|
+
const code = this.options.locale?.code;
|
|
32058
|
+
if (!code) {
|
|
32059
|
+
return "month-first";
|
|
32060
|
+
}
|
|
32061
|
+
return DateLib.yearFirstLocales.has(code) ? "year-first" : "month-first";
|
|
32062
|
+
}
|
|
32063
|
+
/**
|
|
32064
|
+
* Formats the month/year pair respecting locale conventions.
|
|
32065
|
+
*
|
|
32066
|
+
* @since 9.11.0
|
|
32067
|
+
*/
|
|
32068
|
+
formatMonthYear(date) {
|
|
32069
|
+
const { locale, timeZone, numerals } = this.options;
|
|
32070
|
+
const localeCode = locale?.code;
|
|
32071
|
+
if (localeCode && DateLib.yearFirstLocales.has(localeCode)) {
|
|
32072
|
+
try {
|
|
32073
|
+
const intl = new Intl.DateTimeFormat(localeCode, {
|
|
32074
|
+
month: "long",
|
|
32075
|
+
year: "numeric",
|
|
32076
|
+
timeZone,
|
|
32077
|
+
numberingSystem: numerals,
|
|
32078
|
+
});
|
|
32079
|
+
const formatted = intl.format(date);
|
|
32080
|
+
return formatted;
|
|
32081
|
+
}
|
|
32082
|
+
catch {
|
|
32083
|
+
// Fallback to date-fns formatting below.
|
|
32084
|
+
}
|
|
32085
|
+
}
|
|
32086
|
+
const pattern = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
32087
|
+
return this.format(date, pattern);
|
|
32088
|
+
}
|
|
32089
|
+
}
|
|
32090
|
+
DateLib.yearFirstLocales = new Set([
|
|
32091
|
+
"eu",
|
|
32092
|
+
"hu",
|
|
32093
|
+
"ja",
|
|
32094
|
+
"ja-Hira",
|
|
32095
|
+
"ja-JP",
|
|
32096
|
+
"ko",
|
|
32097
|
+
"ko-KR",
|
|
32098
|
+
"lt",
|
|
32099
|
+
"lt-LT",
|
|
32100
|
+
"lv",
|
|
32101
|
+
"lv-LV",
|
|
32102
|
+
"mn",
|
|
32103
|
+
"mn-MN",
|
|
32104
|
+
"zh",
|
|
32105
|
+
"zh-CN",
|
|
32106
|
+
"zh-HK",
|
|
32107
|
+
"zh-TW",
|
|
32108
|
+
]);
|
|
31735
32109
|
/**
|
|
31736
32110
|
* The default date library with English locale.
|
|
31737
32111
|
*
|
|
@@ -31752,6 +32126,9 @@ class CalendarDay {
|
|
|
31752
32126
|
this.displayMonth = displayMonth;
|
|
31753
32127
|
this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
|
|
31754
32128
|
this.dateLib = dateLib;
|
|
32129
|
+
this.isoDate = dateLib.format(date, "yyyy-MM-dd");
|
|
32130
|
+
this.displayMonthId = dateLib.format(displayMonth, "yyyy-MM");
|
|
32131
|
+
this.dateMonthId = dateLib.format(date, "yyyy-MM");
|
|
31755
32132
|
}
|
|
31756
32133
|
/**
|
|
31757
32134
|
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
@@ -31927,7 +32304,7 @@ var UI;
|
|
|
31927
32304
|
/** The dropdown with the years. */
|
|
31928
32305
|
UI["YearsDropdown"] = "years_dropdown";
|
|
31929
32306
|
})(UI || (UI = {}));
|
|
31930
|
-
/** Enum representing flags for the {@link UI.Day} element. */
|
|
32307
|
+
/** Enum representing flags for the {@link UI | UI.Day} element. */
|
|
31931
32308
|
var DayFlag;
|
|
31932
32309
|
(function (DayFlag) {
|
|
31933
32310
|
/** The day is disabled. */
|
|
@@ -31942,8 +32319,8 @@ var DayFlag;
|
|
|
31942
32319
|
DayFlag["today"] = "today";
|
|
31943
32320
|
})(DayFlag || (DayFlag = {}));
|
|
31944
32321
|
/**
|
|
31945
|
-
* Enum representing selection states that can be applied to the
|
|
31946
|
-
* element in selection mode.
|
|
32322
|
+
* Enum representing selection states that can be applied to the
|
|
32323
|
+
* {@link UI | UI.Day} element in selection mode.
|
|
31947
32324
|
*/
|
|
31948
32325
|
var SelectionState;
|
|
31949
32326
|
(function (SelectionState) {
|
|
@@ -32393,7 +32770,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32393
32770
|
return isSameDay(date, matcher);
|
|
32394
32771
|
}
|
|
32395
32772
|
if (isDatesArray(matcher, dateLib)) {
|
|
32396
|
-
return matcher.
|
|
32773
|
+
return matcher.some((matcherDate) => isSameDay(date, matcherDate));
|
|
32397
32774
|
}
|
|
32398
32775
|
if (isDateRange(matcher)) {
|
|
32399
32776
|
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
@@ -32444,7 +32821,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32444
32821
|
* @returns A function that retrieves the modifiers for a given `CalendarDay`.
|
|
32445
32822
|
*/
|
|
32446
32823
|
function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
32447
|
-
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today, } = props;
|
|
32824
|
+
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today = dateLib.today(), } = props;
|
|
32448
32825
|
const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter, } = dateLib;
|
|
32449
32826
|
const computedNavStart = navStart && startOfMonth(navStart);
|
|
32450
32827
|
const computedNavEnd = navEnd && endOfMonth(navEnd);
|
|
@@ -32468,7 +32845,7 @@ function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
|
32468
32845
|
// Broadcast calendar will show outside days as default
|
|
32469
32846
|
(!broadcastCalendar && !showOutsideDays && isOutside) ||
|
|
32470
32847
|
(broadcastCalendar && showOutsideDays === false && isOutside);
|
|
32471
|
-
const isToday = isSameDay(date, today
|
|
32848
|
+
const isToday = isSameDay(date, today);
|
|
32472
32849
|
if (isOutside)
|
|
32473
32850
|
internalModifiersMap.outside.push(day);
|
|
32474
32851
|
if (isDisabled)
|
|
@@ -32627,7 +33004,7 @@ function getDefaultClassNames() {
|
|
|
32627
33004
|
/**
|
|
32628
33005
|
* Formats the caption of the month.
|
|
32629
33006
|
*
|
|
32630
|
-
* @defaultValue
|
|
33007
|
+
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
|
|
32631
33008
|
* @param month The date representing the month.
|
|
32632
33009
|
* @param options Configuration options for the date library.
|
|
32633
33010
|
* @param dateLib The date library to use for formatting. If not provided, a new
|
|
@@ -32637,7 +33014,8 @@ function getDefaultClassNames() {
|
|
|
32637
33014
|
* @see https://daypicker.dev/docs/translation#custom-formatters
|
|
32638
33015
|
*/
|
|
32639
33016
|
function formatCaption(month, options, dateLib) {
|
|
32640
|
-
|
|
33017
|
+
const lib = dateLib ?? new DateLib(options);
|
|
33018
|
+
return lib.formatMonthYear(month);
|
|
32641
33019
|
}
|
|
32642
33020
|
/**
|
|
32643
33021
|
* @private
|
|
@@ -32777,127 +33155,6 @@ function getFormatters(customFormatters) {
|
|
|
32777
33155
|
};
|
|
32778
33156
|
}
|
|
32779
33157
|
|
|
32780
|
-
/**
|
|
32781
|
-
* Returns the months to show in the dropdown.
|
|
32782
|
-
*
|
|
32783
|
-
* This function generates a list of months for the current year, formatted
|
|
32784
|
-
* using the provided formatter, and determines whether each month should be
|
|
32785
|
-
* disabled based on the navigation range.
|
|
32786
|
-
*
|
|
32787
|
-
* @param displayMonth The currently displayed month.
|
|
32788
|
-
* @param navStart The start date for navigation.
|
|
32789
|
-
* @param navEnd The end date for navigation.
|
|
32790
|
-
* @param formatters The formatters to use for formatting the month labels.
|
|
32791
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32792
|
-
* @returns An array of dropdown options representing the months, or `undefined`
|
|
32793
|
-
* if no months are available.
|
|
32794
|
-
*/
|
|
32795
|
-
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
32796
|
-
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
32797
|
-
const months = eachMonthOfInterval({
|
|
32798
|
-
start: startOfYear(displayMonth),
|
|
32799
|
-
end: endOfYear(displayMonth),
|
|
32800
|
-
});
|
|
32801
|
-
const options = months.map((month) => {
|
|
32802
|
-
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
32803
|
-
const value = getMonth(month);
|
|
32804
|
-
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
32805
|
-
(navEnd && month > startOfMonth(navEnd)) ||
|
|
32806
|
-
false;
|
|
32807
|
-
return { value, label, disabled };
|
|
32808
|
-
});
|
|
32809
|
-
return options;
|
|
32810
|
-
}
|
|
32811
|
-
|
|
32812
|
-
/**
|
|
32813
|
-
* Returns the computed style for a day based on its modifiers.
|
|
32814
|
-
*
|
|
32815
|
-
* This function merges the base styles for the day with any styles associated
|
|
32816
|
-
* with active modifiers.
|
|
32817
|
-
*
|
|
32818
|
-
* @param dayModifiers The modifiers applied to the day.
|
|
32819
|
-
* @param styles The base styles for the calendar elements.
|
|
32820
|
-
* @param modifiersStyles The styles associated with specific modifiers.
|
|
32821
|
-
* @returns The computed style for the day.
|
|
32822
|
-
*/
|
|
32823
|
-
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
32824
|
-
let style = { ...styles?.[UI.Day] };
|
|
32825
|
-
Object.entries(dayModifiers)
|
|
32826
|
-
.filter(([, active]) => active === true)
|
|
32827
|
-
.forEach(([modifier]) => {
|
|
32828
|
-
style = {
|
|
32829
|
-
...style,
|
|
32830
|
-
...modifiersStyles?.[modifier],
|
|
32831
|
-
};
|
|
32832
|
-
});
|
|
32833
|
-
return style;
|
|
32834
|
-
}
|
|
32835
|
-
|
|
32836
|
-
/**
|
|
32837
|
-
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
32838
|
-
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
32839
|
-
*
|
|
32840
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32841
|
-
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
32842
|
-
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
32843
|
-
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
32844
|
-
* @returns An array of 7 dates representing the weekdays.
|
|
32845
|
-
*/
|
|
32846
|
-
function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {
|
|
32847
|
-
const today = dateLib.today();
|
|
32848
|
-
const start = broadcastCalendar
|
|
32849
|
-
? dateLib.startOfBroadcastWeek(today, dateLib)
|
|
32850
|
-
: ISOWeek
|
|
32851
|
-
? dateLib.startOfISOWeek(today)
|
|
32852
|
-
: dateLib.startOfWeek(today);
|
|
32853
|
-
const days = [];
|
|
32854
|
-
for (let i = 0; i < 7; i++) {
|
|
32855
|
-
const day = dateLib.addDays(start, i);
|
|
32856
|
-
days.push(day);
|
|
32857
|
-
}
|
|
32858
|
-
return days;
|
|
32859
|
-
}
|
|
32860
|
-
|
|
32861
|
-
/**
|
|
32862
|
-
* Returns the years to display in the dropdown.
|
|
32863
|
-
*
|
|
32864
|
-
* This function generates a list of years between the navigation start and end
|
|
32865
|
-
* dates, formatted using the provided formatter.
|
|
32866
|
-
*
|
|
32867
|
-
* @param navStart The start date for navigation.
|
|
32868
|
-
* @param navEnd The end date for navigation.
|
|
32869
|
-
* @param formatters The formatters to use for formatting the year labels.
|
|
32870
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32871
|
-
* @param reverse If true, reverses the order of the years (descending).
|
|
32872
|
-
* @returns An array of dropdown options representing the years, or `undefined`
|
|
32873
|
-
* if `navStart` or `navEnd` is not provided.
|
|
32874
|
-
*/
|
|
32875
|
-
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
32876
|
-
if (!navStart)
|
|
32877
|
-
return undefined;
|
|
32878
|
-
if (!navEnd)
|
|
32879
|
-
return undefined;
|
|
32880
|
-
const { startOfYear, endOfYear, addYears, getYear, isBefore, isSameYear } = dateLib;
|
|
32881
|
-
const firstNavYear = startOfYear(navStart);
|
|
32882
|
-
const lastNavYear = endOfYear(navEnd);
|
|
32883
|
-
const years = [];
|
|
32884
|
-
let year = firstNavYear;
|
|
32885
|
-
while (isBefore(year, lastNavYear) || isSameYear(year, lastNavYear)) {
|
|
32886
|
-
years.push(year);
|
|
32887
|
-
year = addYears(year, 1);
|
|
32888
|
-
}
|
|
32889
|
-
if (reverse)
|
|
32890
|
-
years.reverse();
|
|
32891
|
-
return years.map((year) => {
|
|
32892
|
-
const label = formatters.formatYearDropdown(year, dateLib);
|
|
32893
|
-
return {
|
|
32894
|
-
value: getYear(year),
|
|
32895
|
-
label,
|
|
32896
|
-
disabled: false,
|
|
32897
|
-
};
|
|
32898
|
-
});
|
|
32899
|
-
}
|
|
32900
|
-
|
|
32901
33158
|
/**
|
|
32902
33159
|
* Generates the ARIA label for a day button.
|
|
32903
33160
|
*
|
|
@@ -32931,7 +33188,7 @@ const labelDay = labelDayButton;
|
|
|
32931
33188
|
* Generates the ARIA label for the month grid, which is announced when entering
|
|
32932
33189
|
* the grid.
|
|
32933
33190
|
*
|
|
32934
|
-
* @defaultValue
|
|
33191
|
+
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
|
|
32935
33192
|
* @param date - The date representing the month.
|
|
32936
33193
|
* @param options - Optional configuration for the date formatting library.
|
|
32937
33194
|
* @param dateLib - An optional instance of the date formatting library.
|
|
@@ -32940,7 +33197,8 @@ const labelDay = labelDayButton;
|
|
|
32940
33197
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
32941
33198
|
*/
|
|
32942
33199
|
function labelGrid(date, options, dateLib) {
|
|
32943
|
-
|
|
33200
|
+
const lib = dateLib ?? new DateLib(options);
|
|
33201
|
+
return lib.formatMonthYear(date);
|
|
32944
33202
|
}
|
|
32945
33203
|
/**
|
|
32946
33204
|
* @ignore
|
|
@@ -32992,6 +33250,7 @@ function labelNav() {
|
|
|
32992
33250
|
return "";
|
|
32993
33251
|
}
|
|
32994
33252
|
|
|
33253
|
+
const defaultLabel = "Go to the Next Month";
|
|
32995
33254
|
/**
|
|
32996
33255
|
* Generates the ARIA label for the "next month" button.
|
|
32997
33256
|
*
|
|
@@ -33002,8 +33261,8 @@ function labelNav() {
|
|
|
33002
33261
|
* @group Labels
|
|
33003
33262
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
33004
33263
|
*/
|
|
33005
|
-
function labelNext(_month) {
|
|
33006
|
-
return
|
|
33264
|
+
function labelNext(_month, _options) {
|
|
33265
|
+
return defaultLabel;
|
|
33007
33266
|
}
|
|
33008
33267
|
|
|
33009
33268
|
/**
|
|
@@ -33092,6 +33351,316 @@ var defaultLabels = /*#__PURE__*/Object.freeze({
|
|
|
33092
33351
|
labelYearDropdown: labelYearDropdown
|
|
33093
33352
|
});
|
|
33094
33353
|
|
|
33354
|
+
const resolveLabel = (defaultLabel, customLabel, localeLabel) => {
|
|
33355
|
+
if (customLabel)
|
|
33356
|
+
return customLabel;
|
|
33357
|
+
if (localeLabel) {
|
|
33358
|
+
return (typeof localeLabel === "function"
|
|
33359
|
+
? localeLabel
|
|
33360
|
+
: (..._args) => localeLabel);
|
|
33361
|
+
}
|
|
33362
|
+
return defaultLabel;
|
|
33363
|
+
};
|
|
33364
|
+
/**
|
|
33365
|
+
* Merges custom labels from the props with the default labels.
|
|
33366
|
+
*
|
|
33367
|
+
* When available, uses the locale-provided translation for `labelNext`.
|
|
33368
|
+
*
|
|
33369
|
+
* @param customLabels The custom labels provided in the DayPicker props.
|
|
33370
|
+
* @param options Options from the date library, used to resolve locale
|
|
33371
|
+
* translations.
|
|
33372
|
+
* @returns The merged labels object with locale-aware defaults.
|
|
33373
|
+
*/
|
|
33374
|
+
function getLabels(customLabels, options) {
|
|
33375
|
+
const localeLabels = options.locale?.labels ?? {};
|
|
33376
|
+
return {
|
|
33377
|
+
...defaultLabels,
|
|
33378
|
+
...(customLabels ?? {}),
|
|
33379
|
+
labelDayButton: resolveLabel(labelDayButton, customLabels?.labelDayButton, localeLabels.labelDayButton),
|
|
33380
|
+
labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels?.labelMonthDropdown, localeLabels.labelMonthDropdown),
|
|
33381
|
+
labelNext: resolveLabel(labelNext, customLabels?.labelNext, localeLabels.labelNext),
|
|
33382
|
+
labelPrevious: resolveLabel(labelPrevious, customLabels?.labelPrevious, localeLabels.labelPrevious),
|
|
33383
|
+
labelWeekNumber: resolveLabel(labelWeekNumber, customLabels?.labelWeekNumber, localeLabels.labelWeekNumber),
|
|
33384
|
+
labelYearDropdown: resolveLabel(labelYearDropdown, customLabels?.labelYearDropdown, localeLabels.labelYearDropdown),
|
|
33385
|
+
labelGrid: resolveLabel(labelGrid, customLabels?.labelGrid, localeLabels.labelGrid),
|
|
33386
|
+
labelGridcell: resolveLabel(labelGridcell, customLabels?.labelGridcell, localeLabels.labelGridcell),
|
|
33387
|
+
labelNav: resolveLabel(labelNav, customLabels?.labelNav, localeLabels.labelNav),
|
|
33388
|
+
labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels?.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
|
|
33389
|
+
labelWeekday: resolveLabel(labelWeekday, customLabels?.labelWeekday, localeLabels.labelWeekday),
|
|
33390
|
+
};
|
|
33391
|
+
}
|
|
33392
|
+
|
|
33393
|
+
/**
|
|
33394
|
+
* Returns the months to show in the dropdown.
|
|
33395
|
+
*
|
|
33396
|
+
* This function generates a list of months for the current year, formatted
|
|
33397
|
+
* using the provided formatter, and determines whether each month should be
|
|
33398
|
+
* disabled based on the navigation range.
|
|
33399
|
+
*
|
|
33400
|
+
* @param displayMonth The currently displayed month.
|
|
33401
|
+
* @param navStart The start date for navigation.
|
|
33402
|
+
* @param navEnd The end date for navigation.
|
|
33403
|
+
* @param formatters The formatters to use for formatting the month labels.
|
|
33404
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33405
|
+
* @returns An array of dropdown options representing the months, or `undefined`
|
|
33406
|
+
* if no months are available.
|
|
33407
|
+
*/
|
|
33408
|
+
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
33409
|
+
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
33410
|
+
const months = eachMonthOfInterval({
|
|
33411
|
+
start: startOfYear(displayMonth),
|
|
33412
|
+
end: endOfYear(displayMonth),
|
|
33413
|
+
});
|
|
33414
|
+
const options = months.map((month) => {
|
|
33415
|
+
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
33416
|
+
const value = getMonth(month);
|
|
33417
|
+
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
33418
|
+
(navEnd && month > startOfMonth(navEnd)) ||
|
|
33419
|
+
false;
|
|
33420
|
+
return { value, label, disabled };
|
|
33421
|
+
});
|
|
33422
|
+
return options;
|
|
33423
|
+
}
|
|
33424
|
+
|
|
33425
|
+
/**
|
|
33426
|
+
* Returns the computed style for a day based on its modifiers.
|
|
33427
|
+
*
|
|
33428
|
+
* This function merges the base styles for the day with any styles associated
|
|
33429
|
+
* with active modifiers.
|
|
33430
|
+
*
|
|
33431
|
+
* @param dayModifiers The modifiers applied to the day.
|
|
33432
|
+
* @param styles The base styles for the calendar elements.
|
|
33433
|
+
* @param modifiersStyles The styles associated with specific modifiers.
|
|
33434
|
+
* @returns The computed style for the day.
|
|
33435
|
+
*/
|
|
33436
|
+
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
33437
|
+
let style = { ...styles?.[UI.Day] };
|
|
33438
|
+
Object.entries(dayModifiers)
|
|
33439
|
+
.filter(([, active]) => active === true)
|
|
33440
|
+
.forEach(([modifier]) => {
|
|
33441
|
+
style = {
|
|
33442
|
+
...style,
|
|
33443
|
+
...modifiersStyles?.[modifier],
|
|
33444
|
+
};
|
|
33445
|
+
});
|
|
33446
|
+
return style;
|
|
33447
|
+
}
|
|
33448
|
+
|
|
33449
|
+
/**
|
|
33450
|
+
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
33451
|
+
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
33452
|
+
*
|
|
33453
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33454
|
+
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
33455
|
+
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
33456
|
+
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
33457
|
+
* @returns An array of 7 dates representing the weekdays.
|
|
33458
|
+
*/
|
|
33459
|
+
function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
|
|
33460
|
+
const referenceToday = today ?? dateLib.today();
|
|
33461
|
+
const start = broadcastCalendar
|
|
33462
|
+
? dateLib.startOfBroadcastWeek(referenceToday, dateLib)
|
|
33463
|
+
: ISOWeek
|
|
33464
|
+
? dateLib.startOfISOWeek(referenceToday)
|
|
33465
|
+
: dateLib.startOfWeek(referenceToday);
|
|
33466
|
+
const days = [];
|
|
33467
|
+
for (let i = 0; i < 7; i++) {
|
|
33468
|
+
const day = dateLib.addDays(start, i);
|
|
33469
|
+
days.push(day);
|
|
33470
|
+
}
|
|
33471
|
+
return days;
|
|
33472
|
+
}
|
|
33473
|
+
|
|
33474
|
+
/**
|
|
33475
|
+
* Returns the years to display in the dropdown.
|
|
33476
|
+
*
|
|
33477
|
+
* This function generates a list of years between the navigation start and end
|
|
33478
|
+
* dates, formatted using the provided formatter.
|
|
33479
|
+
*
|
|
33480
|
+
* @param navStart The start date for navigation.
|
|
33481
|
+
* @param navEnd The end date for navigation.
|
|
33482
|
+
* @param formatters The formatters to use for formatting the year labels.
|
|
33483
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33484
|
+
* @param reverse If true, reverses the order of the years (descending).
|
|
33485
|
+
* @returns An array of dropdown options representing the years, or `undefined`
|
|
33486
|
+
* if `navStart` or `navEnd` is not provided.
|
|
33487
|
+
*/
|
|
33488
|
+
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
33489
|
+
if (!navStart)
|
|
33490
|
+
return undefined;
|
|
33491
|
+
if (!navEnd)
|
|
33492
|
+
return undefined;
|
|
33493
|
+
const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
|
|
33494
|
+
const firstNavYear = startOfYear(navStart);
|
|
33495
|
+
const lastNavYear = endOfYear(navEnd);
|
|
33496
|
+
const years = eachYearOfInterval({ start: firstNavYear, end: lastNavYear });
|
|
33497
|
+
if (reverse)
|
|
33498
|
+
years.reverse();
|
|
33499
|
+
return years.map((year) => {
|
|
33500
|
+
const label = formatters.formatYearDropdown(year, dateLib);
|
|
33501
|
+
return {
|
|
33502
|
+
value: getYear(year),
|
|
33503
|
+
label,
|
|
33504
|
+
disabled: false,
|
|
33505
|
+
};
|
|
33506
|
+
});
|
|
33507
|
+
}
|
|
33508
|
+
|
|
33509
|
+
/**
|
|
33510
|
+
* Creates `dateLib` overrides that keep all calendar math at noon in the target
|
|
33511
|
+
* time zone. This avoids second-level offset changes (e.g., historical zones
|
|
33512
|
+
* with +03:41:12) from pushing dates backward across midnight.
|
|
33513
|
+
*/
|
|
33514
|
+
function createNoonOverrides(timeZone, options = {}) {
|
|
33515
|
+
const { weekStartsOn, locale } = options;
|
|
33516
|
+
const fallbackWeekStartsOn = (weekStartsOn ??
|
|
33517
|
+
locale?.options?.weekStartsOn ??
|
|
33518
|
+
0);
|
|
33519
|
+
// Keep all internal math anchored at noon in the target zone to avoid
|
|
33520
|
+
// historical second-level offsets from crossing midnight.
|
|
33521
|
+
const toNoonTZDate = (date) => {
|
|
33522
|
+
const normalizedDate = typeof date === "number" || typeof date === "string"
|
|
33523
|
+
? new Date(date)
|
|
33524
|
+
: date;
|
|
33525
|
+
return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
|
|
33526
|
+
};
|
|
33527
|
+
// Convert a value into a host `Date` that represents the same calendar day
|
|
33528
|
+
// as the target-zone noon. This is useful for helpers (e.g., date-fns week
|
|
33529
|
+
// utilities) that expect local `Date` instances rather than `TZDate`s.
|
|
33530
|
+
const toCalendarDate = (date) => {
|
|
33531
|
+
const zoned = toNoonTZDate(date);
|
|
33532
|
+
return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
|
|
33533
|
+
};
|
|
33534
|
+
return {
|
|
33535
|
+
today: () => {
|
|
33536
|
+
return toNoonTZDate(TZDate.tz(timeZone));
|
|
33537
|
+
},
|
|
33538
|
+
newDate: (year, monthIndex, date) => {
|
|
33539
|
+
return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
|
|
33540
|
+
},
|
|
33541
|
+
startOfDay: (date) => {
|
|
33542
|
+
return toNoonTZDate(date);
|
|
33543
|
+
},
|
|
33544
|
+
startOfWeek: (date, options) => {
|
|
33545
|
+
const base = toNoonTZDate(date);
|
|
33546
|
+
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33547
|
+
fallbackWeekStartsOn);
|
|
33548
|
+
const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
|
|
33549
|
+
base.setDate(base.getDate() - diff);
|
|
33550
|
+
return base;
|
|
33551
|
+
},
|
|
33552
|
+
startOfISOWeek: (date) => {
|
|
33553
|
+
const base = toNoonTZDate(date);
|
|
33554
|
+
const diff = (base.getDay() - 1 + 7) % 7;
|
|
33555
|
+
base.setDate(base.getDate() - diff);
|
|
33556
|
+
return base;
|
|
33557
|
+
},
|
|
33558
|
+
startOfMonth: (date) => {
|
|
33559
|
+
const base = toNoonTZDate(date);
|
|
33560
|
+
base.setDate(1);
|
|
33561
|
+
return base;
|
|
33562
|
+
},
|
|
33563
|
+
startOfYear: (date) => {
|
|
33564
|
+
const base = toNoonTZDate(date);
|
|
33565
|
+
base.setMonth(0, 1);
|
|
33566
|
+
return base;
|
|
33567
|
+
},
|
|
33568
|
+
endOfWeek: (date, options) => {
|
|
33569
|
+
const base = toNoonTZDate(date);
|
|
33570
|
+
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33571
|
+
fallbackWeekStartsOn);
|
|
33572
|
+
const endDow = (weekStartsOnValue + 6) % 7;
|
|
33573
|
+
const diff = (endDow - base.getDay() + 7) % 7;
|
|
33574
|
+
base.setDate(base.getDate() + diff);
|
|
33575
|
+
return base;
|
|
33576
|
+
},
|
|
33577
|
+
endOfISOWeek: (date) => {
|
|
33578
|
+
const base = toNoonTZDate(date);
|
|
33579
|
+
const diff = (7 - base.getDay()) % 7;
|
|
33580
|
+
base.setDate(base.getDate() + diff);
|
|
33581
|
+
return base;
|
|
33582
|
+
},
|
|
33583
|
+
endOfMonth: (date) => {
|
|
33584
|
+
const base = toNoonTZDate(date);
|
|
33585
|
+
base.setMonth(base.getMonth() + 1, 0);
|
|
33586
|
+
return base;
|
|
33587
|
+
},
|
|
33588
|
+
endOfYear: (date) => {
|
|
33589
|
+
const base = toNoonTZDate(date);
|
|
33590
|
+
base.setMonth(11, 31);
|
|
33591
|
+
return base;
|
|
33592
|
+
},
|
|
33593
|
+
eachMonthOfInterval: (interval) => {
|
|
33594
|
+
const start = toNoonTZDate(interval.start);
|
|
33595
|
+
const end = toNoonTZDate(interval.end);
|
|
33596
|
+
const result = [];
|
|
33597
|
+
const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
|
|
33598
|
+
const endKey = end.getFullYear() * 12 + end.getMonth();
|
|
33599
|
+
while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
|
|
33600
|
+
result.push(new TZDate(cursor, timeZone));
|
|
33601
|
+
cursor.setMonth(cursor.getMonth() + 1, 1);
|
|
33602
|
+
}
|
|
33603
|
+
return result;
|
|
33604
|
+
},
|
|
33605
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
33606
|
+
// mutate the same TZDate, and return it.
|
|
33607
|
+
addDays: (date, amount) => {
|
|
33608
|
+
const base = toNoonTZDate(date);
|
|
33609
|
+
base.setDate(base.getDate() + amount);
|
|
33610
|
+
return base;
|
|
33611
|
+
},
|
|
33612
|
+
addWeeks: (date, amount) => {
|
|
33613
|
+
const base = toNoonTZDate(date);
|
|
33614
|
+
base.setDate(base.getDate() + amount * 7);
|
|
33615
|
+
return base;
|
|
33616
|
+
},
|
|
33617
|
+
addMonths: (date, amount) => {
|
|
33618
|
+
const base = toNoonTZDate(date);
|
|
33619
|
+
base.setMonth(base.getMonth() + amount);
|
|
33620
|
+
return base;
|
|
33621
|
+
},
|
|
33622
|
+
addYears: (date, amount) => {
|
|
33623
|
+
const base = toNoonTZDate(date);
|
|
33624
|
+
base.setFullYear(base.getFullYear() + amount);
|
|
33625
|
+
return base;
|
|
33626
|
+
},
|
|
33627
|
+
eachYearOfInterval: (interval) => {
|
|
33628
|
+
const start = toNoonTZDate(interval.start);
|
|
33629
|
+
const end = toNoonTZDate(interval.end);
|
|
33630
|
+
const years = [];
|
|
33631
|
+
const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
|
|
33632
|
+
while (cursor.getFullYear() <= end.getFullYear()) {
|
|
33633
|
+
years.push(new TZDate(cursor, timeZone));
|
|
33634
|
+
cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
|
|
33635
|
+
}
|
|
33636
|
+
return years;
|
|
33637
|
+
},
|
|
33638
|
+
getWeek: (date, options) => {
|
|
33639
|
+
const base = toCalendarDate(date);
|
|
33640
|
+
return getWeek(base, {
|
|
33641
|
+
weekStartsOn: options?.weekStartsOn ?? fallbackWeekStartsOn,
|
|
33642
|
+
firstWeekContainsDate: options?.firstWeekContainsDate ??
|
|
33643
|
+
locale?.options?.firstWeekContainsDate ??
|
|
33644
|
+
1,
|
|
33645
|
+
});
|
|
33646
|
+
},
|
|
33647
|
+
getISOWeek: (date) => {
|
|
33648
|
+
const base = toCalendarDate(date);
|
|
33649
|
+
return getISOWeek(base);
|
|
33650
|
+
},
|
|
33651
|
+
differenceInCalendarDays: (dateLeft, dateRight) => {
|
|
33652
|
+
const left = toCalendarDate(dateLeft);
|
|
33653
|
+
const right = toCalendarDate(dateRight);
|
|
33654
|
+
return differenceInCalendarDays(left, right);
|
|
33655
|
+
},
|
|
33656
|
+
differenceInCalendarMonths: (dateLeft, dateRight) => {
|
|
33657
|
+
const left = toCalendarDate(dateLeft);
|
|
33658
|
+
const right = toCalendarDate(dateRight);
|
|
33659
|
+
return differenceInCalendarMonths(left, right);
|
|
33660
|
+
},
|
|
33661
|
+
};
|
|
33662
|
+
}
|
|
33663
|
+
|
|
33095
33664
|
const asHtmlElement = (element) => {
|
|
33096
33665
|
if (element instanceof HTMLElement)
|
|
33097
33666
|
return element;
|
|
@@ -33284,19 +33853,27 @@ function getDates(displayMonths, maxDate, props, dateLib) {
|
|
|
33284
33853
|
: ISOWeek
|
|
33285
33854
|
? startOfISOWeek(firstMonth)
|
|
33286
33855
|
: startOfWeek(firstMonth);
|
|
33287
|
-
const
|
|
33856
|
+
const displayMonthsWeekEnd = broadcastCalendar
|
|
33288
33857
|
? endOfBroadcastWeek(lastMonth)
|
|
33289
33858
|
: ISOWeek
|
|
33290
33859
|
? endOfISOWeek(endOfMonth(lastMonth))
|
|
33291
33860
|
: endOfWeek(endOfMonth(lastMonth));
|
|
33292
|
-
|
|
33861
|
+
// If maxDate is set, clamp the grid to the end of that week.
|
|
33862
|
+
const constraintWeekEnd = maxDate &&
|
|
33863
|
+
(broadcastCalendar
|
|
33864
|
+
? endOfBroadcastWeek(maxDate)
|
|
33865
|
+
: ISOWeek
|
|
33866
|
+
? endOfISOWeek(maxDate)
|
|
33867
|
+
: endOfWeek(maxDate));
|
|
33868
|
+
// Pick the earliest week end between the displayed months and the constraint.
|
|
33869
|
+
const gridEndDate = constraintWeekEnd && isAfter(displayMonthsWeekEnd, constraintWeekEnd)
|
|
33870
|
+
? constraintWeekEnd
|
|
33871
|
+
: displayMonthsWeekEnd;
|
|
33872
|
+
const nOfDays = differenceInCalendarDays(gridEndDate, startWeekFirstDate);
|
|
33293
33873
|
const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;
|
|
33294
33874
|
const dates = [];
|
|
33295
33875
|
for (let i = 0; i <= nOfDays; i++) {
|
|
33296
33876
|
const date = addDays(startWeekFirstDate, i);
|
|
33297
|
-
if (maxDate && isAfter(date, maxDate)) {
|
|
33298
|
-
break;
|
|
33299
|
-
}
|
|
33300
33877
|
dates.push(date);
|
|
33301
33878
|
}
|
|
33302
33879
|
// If fixed weeks is enabled, add the extra dates to the array
|
|
@@ -33627,17 +34204,45 @@ function useCalendar(props, dateLib) {
|
|
|
33627
34204
|
setFirstMonth(newInitialMonth);
|
|
33628
34205
|
}, [props.timeZone]);
|
|
33629
34206
|
/** The months displayed in the calendar. */
|
|
33630
|
-
|
|
33631
|
-
|
|
33632
|
-
|
|
33633
|
-
|
|
33634
|
-
|
|
33635
|
-
|
|
33636
|
-
|
|
33637
|
-
|
|
33638
|
-
|
|
33639
|
-
|
|
33640
|
-
|
|
34207
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: We want to recompute only when specific props change.
|
|
34208
|
+
const { months, weeks, days, previousMonth, nextMonth } = useMemo(() => {
|
|
34209
|
+
const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);
|
|
34210
|
+
const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, {
|
|
34211
|
+
ISOWeek: props.ISOWeek,
|
|
34212
|
+
fixedWeeks: props.fixedWeeks,
|
|
34213
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
34214
|
+
}, dateLib);
|
|
34215
|
+
const months = getMonths(displayMonths, dates, {
|
|
34216
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
34217
|
+
fixedWeeks: props.fixedWeeks,
|
|
34218
|
+
ISOWeek: props.ISOWeek,
|
|
34219
|
+
reverseMonths: props.reverseMonths,
|
|
34220
|
+
}, dateLib);
|
|
34221
|
+
const weeks = getWeeks(months);
|
|
34222
|
+
const days = getDays(months);
|
|
34223
|
+
const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
34224
|
+
const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
34225
|
+
return {
|
|
34226
|
+
months,
|
|
34227
|
+
weeks,
|
|
34228
|
+
days,
|
|
34229
|
+
previousMonth,
|
|
34230
|
+
nextMonth,
|
|
34231
|
+
};
|
|
34232
|
+
}, [
|
|
34233
|
+
dateLib,
|
|
34234
|
+
firstMonth.getTime(),
|
|
34235
|
+
navEnd?.getTime(),
|
|
34236
|
+
navStart?.getTime(),
|
|
34237
|
+
props.disableNavigation,
|
|
34238
|
+
props.broadcastCalendar,
|
|
34239
|
+
props.endMonth?.getTime(),
|
|
34240
|
+
props.fixedWeeks,
|
|
34241
|
+
props.ISOWeek,
|
|
34242
|
+
props.numberOfMonths,
|
|
34243
|
+
props.pagedNavigation,
|
|
34244
|
+
props.reverseMonths,
|
|
34245
|
+
]);
|
|
33641
34246
|
const { disableNavigation, onMonthChange } = props;
|
|
33642
34247
|
const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
|
|
33643
34248
|
const goToMonth = (date) => {
|
|
@@ -33856,6 +34461,12 @@ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
|
33856
34461
|
const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
|
|
33857
34462
|
if (!nextFocus)
|
|
33858
34463
|
return;
|
|
34464
|
+
if (props.disableNavigation) {
|
|
34465
|
+
const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
|
|
34466
|
+
if (!isNextInCalendar) {
|
|
34467
|
+
return;
|
|
34468
|
+
}
|
|
34469
|
+
}
|
|
33859
34470
|
calendar.goToDay(nextFocus);
|
|
33860
34471
|
setFocused(nextFocus);
|
|
33861
34472
|
};
|
|
@@ -34138,15 +34749,33 @@ function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
|
|
|
34138
34749
|
* range, and a function to check if a date is within the range.
|
|
34139
34750
|
*/
|
|
34140
34751
|
function useRange(props, dateLib) {
|
|
34141
|
-
const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect, } = props;
|
|
34752
|
+
const { disabled, excludeDisabled, resetOnSelect, selected: initiallySelected, required, onSelect, } = props;
|
|
34142
34753
|
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
|
|
34143
34754
|
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
34144
34755
|
const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
|
|
34145
34756
|
const select = (triggerDate, modifiers, e) => {
|
|
34146
34757
|
const { min, max } = props;
|
|
34147
|
-
|
|
34148
|
-
|
|
34149
|
-
|
|
34758
|
+
let newRange;
|
|
34759
|
+
if (triggerDate) {
|
|
34760
|
+
const selectedFrom = selected?.from;
|
|
34761
|
+
const selectedTo = selected?.to;
|
|
34762
|
+
const hasFullRange = !!selectedFrom && !!selectedTo;
|
|
34763
|
+
const isClickingSingleDayRange = !!selectedFrom &&
|
|
34764
|
+
!!selectedTo &&
|
|
34765
|
+
dateLib.isSameDay(selectedFrom, selectedTo) &&
|
|
34766
|
+
dateLib.isSameDay(triggerDate, selectedFrom);
|
|
34767
|
+
if (resetOnSelect && (hasFullRange || !selected?.from)) {
|
|
34768
|
+
if (!required && isClickingSingleDayRange) {
|
|
34769
|
+
newRange = undefined;
|
|
34770
|
+
}
|
|
34771
|
+
else {
|
|
34772
|
+
newRange = { from: triggerDate, to: undefined };
|
|
34773
|
+
}
|
|
34774
|
+
}
|
|
34775
|
+
else {
|
|
34776
|
+
newRange = addToRange(triggerDate, selected, min, max, required, dateLib);
|
|
34777
|
+
}
|
|
34778
|
+
}
|
|
34150
34779
|
if (excludeDisabled && disabled && newRange?.from && newRange.to) {
|
|
34151
34780
|
if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {
|
|
34152
34781
|
// if a disabled days is found, the range is reset
|
|
@@ -34234,6 +34863,78 @@ function useSelection(props, dateLib) {
|
|
|
34234
34863
|
}
|
|
34235
34864
|
}
|
|
34236
34865
|
|
|
34866
|
+
/**
|
|
34867
|
+
* Convert a {@link Date} or {@link TZDate} instance to the given time zone.
|
|
34868
|
+
* Reuses the same instance when it is already a {@link TZDate} using the target
|
|
34869
|
+
* time zone to avoid extra allocations.
|
|
34870
|
+
*/
|
|
34871
|
+
function toTimeZone(date, timeZone) {
|
|
34872
|
+
if (date instanceof TZDate && date.timeZone === timeZone) {
|
|
34873
|
+
return date;
|
|
34874
|
+
}
|
|
34875
|
+
return new TZDate(date, timeZone);
|
|
34876
|
+
}
|
|
34877
|
+
|
|
34878
|
+
function toZoneNoon(date, timeZone, noonSafe) {
|
|
34879
|
+
if (!noonSafe)
|
|
34880
|
+
return toTimeZone(date, timeZone);
|
|
34881
|
+
const zoned = toTimeZone(date, timeZone);
|
|
34882
|
+
const noonZoned = new TZDate(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 12, 0, 0, timeZone);
|
|
34883
|
+
return new Date(noonZoned.getTime());
|
|
34884
|
+
}
|
|
34885
|
+
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
34886
|
+
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
34887
|
+
return matcher;
|
|
34888
|
+
}
|
|
34889
|
+
if (matcher instanceof Date) {
|
|
34890
|
+
return toZoneNoon(matcher, timeZone, noonSafe);
|
|
34891
|
+
}
|
|
34892
|
+
if (Array.isArray(matcher)) {
|
|
34893
|
+
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone, noonSafe) : value);
|
|
34894
|
+
}
|
|
34895
|
+
if (isDateRange(matcher)) {
|
|
34896
|
+
return {
|
|
34897
|
+
...matcher,
|
|
34898
|
+
from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
|
|
34899
|
+
to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to,
|
|
34900
|
+
};
|
|
34901
|
+
}
|
|
34902
|
+
if (isDateInterval(matcher)) {
|
|
34903
|
+
return {
|
|
34904
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34905
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34906
|
+
};
|
|
34907
|
+
}
|
|
34908
|
+
if (isDateAfterType(matcher)) {
|
|
34909
|
+
return {
|
|
34910
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34911
|
+
};
|
|
34912
|
+
}
|
|
34913
|
+
if (isDateBeforeType(matcher)) {
|
|
34914
|
+
return {
|
|
34915
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34916
|
+
};
|
|
34917
|
+
}
|
|
34918
|
+
return matcher;
|
|
34919
|
+
}
|
|
34920
|
+
/**
|
|
34921
|
+
* Convert any {@link Matcher} or array of matchers to the specified time zone.
|
|
34922
|
+
*
|
|
34923
|
+
* @param matchers - The matcher or matchers to convert.
|
|
34924
|
+
* @param timeZone - The target IANA time zone.
|
|
34925
|
+
* @returns The converted matcher(s).
|
|
34926
|
+
* @group Utilities
|
|
34927
|
+
*/
|
|
34928
|
+
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
34929
|
+
if (!matchers) {
|
|
34930
|
+
return matchers;
|
|
34931
|
+
}
|
|
34932
|
+
if (Array.isArray(matchers)) {
|
|
34933
|
+
return matchers.map((matcher) => convertMatcher(matcher, timeZone, noonSafe));
|
|
34934
|
+
}
|
|
34935
|
+
return convertMatcher(matchers, timeZone, noonSafe);
|
|
34936
|
+
}
|
|
34937
|
+
|
|
34237
34938
|
/**
|
|
34238
34939
|
* Renders the DayPicker calendar component.
|
|
34239
34940
|
*
|
|
@@ -34244,58 +34945,83 @@ function useSelection(props, dateLib) {
|
|
|
34244
34945
|
*/
|
|
34245
34946
|
function DayPicker(initialProps) {
|
|
34246
34947
|
let props = initialProps;
|
|
34247
|
-
|
|
34948
|
+
const timeZone = props.timeZone;
|
|
34949
|
+
if (timeZone) {
|
|
34248
34950
|
props = {
|
|
34249
34951
|
...initialProps,
|
|
34952
|
+
timeZone,
|
|
34250
34953
|
};
|
|
34251
34954
|
if (props.today) {
|
|
34252
|
-
props.today =
|
|
34955
|
+
props.today = toTimeZone(props.today, timeZone);
|
|
34253
34956
|
}
|
|
34254
34957
|
if (props.month) {
|
|
34255
|
-
props.month =
|
|
34958
|
+
props.month = toTimeZone(props.month, timeZone);
|
|
34256
34959
|
}
|
|
34257
34960
|
if (props.defaultMonth) {
|
|
34258
|
-
props.defaultMonth =
|
|
34961
|
+
props.defaultMonth = toTimeZone(props.defaultMonth, timeZone);
|
|
34259
34962
|
}
|
|
34260
34963
|
if (props.startMonth) {
|
|
34261
|
-
props.startMonth =
|
|
34964
|
+
props.startMonth = toTimeZone(props.startMonth, timeZone);
|
|
34262
34965
|
}
|
|
34263
34966
|
if (props.endMonth) {
|
|
34264
|
-
props.endMonth =
|
|
34967
|
+
props.endMonth = toTimeZone(props.endMonth, timeZone);
|
|
34265
34968
|
}
|
|
34266
34969
|
if (props.mode === "single" && props.selected) {
|
|
34267
|
-
props.selected =
|
|
34970
|
+
props.selected = toTimeZone(props.selected, timeZone);
|
|
34268
34971
|
}
|
|
34269
34972
|
else if (props.mode === "multiple" && props.selected) {
|
|
34270
|
-
props.selected = props.selected?.map((date) =>
|
|
34973
|
+
props.selected = props.selected?.map((date) => toTimeZone(date, timeZone));
|
|
34271
34974
|
}
|
|
34272
34975
|
else if (props.mode === "range" && props.selected) {
|
|
34273
34976
|
props.selected = {
|
|
34274
34977
|
from: props.selected.from
|
|
34275
|
-
?
|
|
34276
|
-
:
|
|
34978
|
+
? toTimeZone(props.selected.from, timeZone)
|
|
34979
|
+
: props.selected.from,
|
|
34277
34980
|
to: props.selected.to
|
|
34278
|
-
?
|
|
34279
|
-
:
|
|
34981
|
+
? toTimeZone(props.selected.to, timeZone)
|
|
34982
|
+
: props.selected.to,
|
|
34280
34983
|
};
|
|
34281
34984
|
}
|
|
34985
|
+
if (props.disabled !== undefined) {
|
|
34986
|
+
props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
|
|
34987
|
+
}
|
|
34988
|
+
if (props.hidden !== undefined) {
|
|
34989
|
+
props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
|
|
34990
|
+
}
|
|
34991
|
+
if (props.modifiers) {
|
|
34992
|
+
const nextModifiers = {};
|
|
34993
|
+
Object.keys(props.modifiers).forEach((key) => {
|
|
34994
|
+
nextModifiers[key] = convertMatchersToTimeZone(props.modifiers?.[key], timeZone);
|
|
34995
|
+
});
|
|
34996
|
+
props.modifiers = nextModifiers;
|
|
34997
|
+
}
|
|
34282
34998
|
}
|
|
34283
34999
|
const { components, formatters, labels, dateLib, locale, classNames } = useMemo(() => {
|
|
34284
35000
|
const locale = { ...enUS, ...props.locale };
|
|
35001
|
+
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
35002
|
+
const noonOverrides = props.noonSafe && props.timeZone
|
|
35003
|
+
? createNoonOverrides(props.timeZone, {
|
|
35004
|
+
weekStartsOn,
|
|
35005
|
+
locale,
|
|
35006
|
+
})
|
|
35007
|
+
: undefined;
|
|
35008
|
+
const overrides = props.dateLib && noonOverrides
|
|
35009
|
+
? { ...noonOverrides, ...props.dateLib }
|
|
35010
|
+
: (props.dateLib ?? noonOverrides);
|
|
34285
35011
|
const dateLib = new DateLib({
|
|
34286
35012
|
locale,
|
|
34287
|
-
weekStartsOn
|
|
35013
|
+
weekStartsOn,
|
|
34288
35014
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
34289
35015
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
34290
35016
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
34291
35017
|
timeZone: props.timeZone,
|
|
34292
35018
|
numerals: props.numerals,
|
|
34293
|
-
},
|
|
35019
|
+
}, overrides);
|
|
34294
35020
|
return {
|
|
34295
35021
|
dateLib,
|
|
34296
35022
|
components: getComponents(props.components),
|
|
34297
35023
|
formatters: getFormatters(props.formatters),
|
|
34298
|
-
labels:
|
|
35024
|
+
labels: getLabels(props.labels, dateLib.options),
|
|
34299
35025
|
locale,
|
|
34300
35026
|
classNames: { ...getDefaultClassNames(), ...props.classNames },
|
|
34301
35027
|
};
|
|
@@ -34309,11 +35035,15 @@ function DayPicker(initialProps) {
|
|
|
34309
35035
|
props.timeZone,
|
|
34310
35036
|
props.numerals,
|
|
34311
35037
|
props.dateLib,
|
|
35038
|
+
props.noonSafe,
|
|
34312
35039
|
props.components,
|
|
34313
35040
|
props.formatters,
|
|
34314
35041
|
props.labels,
|
|
34315
35042
|
props.classNames,
|
|
34316
35043
|
]);
|
|
35044
|
+
if (!props.today) {
|
|
35045
|
+
props = { ...props, today: dateLib.today() };
|
|
35046
|
+
}
|
|
34317
35047
|
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles, } = props;
|
|
34318
35048
|
const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown, } = formatters;
|
|
34319
35049
|
const calendar = useCalendar(props, dateLib);
|
|
@@ -34322,7 +35052,7 @@ function DayPicker(initialProps) {
|
|
|
34322
35052
|
const { isSelected, select, selected: selectedValue, } = useSelection(props, dateLib) ?? {};
|
|
34323
35053
|
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
|
|
34324
35054
|
const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown, } = labels;
|
|
34325
|
-
const weekdays = useMemo(() => getWeekdays(dateLib, props.ISOWeek), [dateLib, props.ISOWeek]);
|
|
35055
|
+
const weekdays = useMemo(() => getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [dateLib, props.ISOWeek, props.broadcastCalendar, props.today]);
|
|
34326
35056
|
const isInteractive = mode !== undefined || onDayClick !== undefined;
|
|
34327
35057
|
const handlePreviousClick = useCallback(() => {
|
|
34328
35058
|
if (!previousMonth)
|
|
@@ -34340,6 +35070,9 @@ function DayPicker(initialProps) {
|
|
|
34340
35070
|
e.preventDefault();
|
|
34341
35071
|
e.stopPropagation();
|
|
34342
35072
|
setFocused(day);
|
|
35073
|
+
if (m.disabled) {
|
|
35074
|
+
return;
|
|
35075
|
+
}
|
|
34343
35076
|
select?.(day.date, m, e);
|
|
34344
35077
|
onDayClick?.(day.date, m, e);
|
|
34345
35078
|
}, [select, onDayClick, setFocused]);
|
|
@@ -34423,7 +35156,7 @@ function DayPicker(initialProps) {
|
|
|
34423
35156
|
formatters,
|
|
34424
35157
|
};
|
|
34425
35158
|
return (React__default.createElement(dayPickerContext.Provider, { value: contextValue },
|
|
34426
|
-
React__default.createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], ...dataAttributes },
|
|
35159
|
+
React__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 },
|
|
34427
35160
|
React__default.createElement(components.Months, { className: classNames[UI.Months], style: styles?.[UI.Months] },
|
|
34428
35161
|
!props.hideNavigation && !navLayout && (React__default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : undefined, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),
|
|
34429
35162
|
months.map((calendarMonth, displayIndex) => {
|
|
@@ -34435,10 +35168,16 @@ function DayPicker(initialProps) {
|
|
|
34435
35168
|
displayIndex === 0 && (React__default.createElement(components.PreviousMonthButton, { type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, "aria-disabled": previousMonth ? undefined : true, "aria-label": labelPrevious(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : undefined },
|
|
34436
35169
|
React__default.createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" }))),
|
|
34437
35170
|
React__default.createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : undefined, className: classNames[UI.MonthCaption], style: styles?.[UI.MonthCaption], calendarMonth: calendarMonth, displayIndex: displayIndex }, captionLayout?.startsWith("dropdown") ? (React__default.createElement(components.DropdownNav, { className: classNames[UI.Dropdowns], style: styles?.[UI.Dropdowns] },
|
|
34438
|
-
|
|
34439
|
-
captionLayout === "dropdown
|
|
34440
|
-
|
|
34441
|
-
captionLayout === "dropdown
|
|
35171
|
+
(() => {
|
|
35172
|
+
const monthControl = captionLayout === "dropdown" ||
|
|
35173
|
+
captionLayout === "dropdown-months" ? (React__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.createElement("span", { key: "month" }, formatMonthDropdown(calendarMonth.date, dateLib)));
|
|
35174
|
+
const yearControl = captionLayout === "dropdown" ||
|
|
35175
|
+
captionLayout === "dropdown-years" ? (React__default.createElement(components.YearsDropdown, { key: "year", className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown(dateLib.options), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: getYearOptions(navStart, navEnd, formatters, dateLib, Boolean(props.reverseYears)), style: styles?.[UI.Dropdown], value: dateLib.getYear(calendarMonth.date) })) : (React__default.createElement("span", { key: "year" }, formatYearDropdown(calendarMonth.date, dateLib)));
|
|
35176
|
+
const controls = dateLib.getMonthYearOrder() === "year-first"
|
|
35177
|
+
? [yearControl, monthControl]
|
|
35178
|
+
: [monthControl, yearControl];
|
|
35179
|
+
return controls;
|
|
35180
|
+
})(),
|
|
34442
35181
|
React__default.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
34443
35182
|
border: 0,
|
|
34444
35183
|
clip: "rect(0 0 0 0)",
|
|
@@ -34450,9 +35189,7 @@ function DayPicker(initialProps) {
|
|
|
34450
35189
|
width: "1px",
|
|
34451
35190
|
whiteSpace: "nowrap",
|
|
34452
35191
|
wordWrap: "normal",
|
|
34453
|
-
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
|
|
34454
|
-
// biome-ignore lint/a11y/useSemanticElements: breaking change
|
|
34455
|
-
React__default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
|
|
35192
|
+
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (React__default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
|
|
34456
35193
|
navLayout === "around" &&
|
|
34457
35194
|
!props.hideNavigation &&
|
|
34458
35195
|
displayIndex === numberOfMonths - 1 && (React__default.createElement(components.NextMonthButton, { type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, "aria-disabled": nextMonth ? undefined : true, "aria-label": labelNext(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : undefined },
|
|
@@ -34467,9 +35204,7 @@ function DayPicker(initialProps) {
|
|
|
34467
35204
|
weekdays.map((weekday) => (React__default.createElement(components.Weekday, { "aria-label": labelWeekday(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles?.[UI.Weekday], scope: "col" }, formatWeekdayName(weekday, dateLib.options, dateLib)))))),
|
|
34468
35205
|
React__default.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : undefined, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
|
|
34469
35206
|
return (React__default.createElement(components.Week, { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week: week },
|
|
34470
|
-
showWeekNumber && (
|
|
34471
|
-
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34472
|
-
React__default.createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
35207
|
+
showWeekNumber && (React__default.createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
34473
35208
|
locale,
|
|
34474
35209
|
}), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber(week.weekNumber, dateLib))),
|
|
34475
35210
|
week.days.map((day) => {
|
|
@@ -34493,18 +35228,16 @@ function DayPicker(initialProps) {
|
|
|
34493
35228
|
const ariaLabel = !isInteractive && !modifiers.hidden
|
|
34494
35229
|
? labelGridcell(date, modifiers, dateLib.options, dateLib)
|
|
34495
35230
|
: undefined;
|
|
34496
|
-
return (
|
|
34497
|
-
|
|
34498
|
-
|
|
34499
|
-
|
|
34500
|
-
|
|
35231
|
+
return (React__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.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles?.[UI.DayButton], type: "button", day: day, modifiers: modifiers, disabled: (!modifiers.focused &&
|
|
35232
|
+
modifiers.disabled) ||
|
|
35233
|
+
undefined, "aria-disabled": (modifiers.focused &&
|
|
35234
|
+
modifiers.disabled) ||
|
|
35235
|
+
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 &&
|
|
34501
35236
|
formatDay(day.date, dateLib.options, dateLib))));
|
|
34502
35237
|
})));
|
|
34503
35238
|
})))));
|
|
34504
35239
|
})),
|
|
34505
|
-
props.footer && (
|
|
34506
|
-
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34507
|
-
React__default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
35240
|
+
props.footer && (React__default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
34508
35241
|
}
|
|
34509
35242
|
|
|
34510
35243
|
function styleInject(css, ref) {
|
|
@@ -34534,7 +35267,7 @@ function styleInject(css, ref) {
|
|
|
34534
35267
|
}
|
|
34535
35268
|
}
|
|
34536
35269
|
|
|
34537
|
-
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";
|
|
35270
|
+
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";
|
|
34538
35271
|
styleInject(css_248z$3);
|
|
34539
35272
|
|
|
34540
35273
|
var reactInputMask = {exports: {}};
|
|
@@ -39216,11 +39949,11 @@ const TableComponent = ({ idTable, dataSource, contentColumns, headerColumns, se
|
|
|
39216
39949
|
}, []);
|
|
39217
39950
|
return (jsx("div", { ref: containerRef, className: "r-gridtable", style: { maxHeight: `${height ? `${height}px` : 'auto'}` }, children: jsxs("table", { style: { width: '100%' }, role: "presentation", children: [jsx(RenderColGroup, { contentColumns: contentColumns }), jsx("thead", { className: "r-gridheader", role: "rowgroup", children: headerColumns.map((element, indexParent) => {
|
|
39218
39951
|
return (jsx("tr", { className: "r-row", role: "row", children: element?.map((col, index) => {
|
|
39219
|
-
return (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) => {
|
|
39952
|
+
return (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) => {
|
|
39220
39953
|
setFilterBy([...val]);
|
|
39221
39954
|
}, changeOrder: (val) => {
|
|
39222
39955
|
setOrderBy([...val]);
|
|
39223
|
-
}, columns: contentColumns, setContentColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft
|
|
39956
|
+
}, columns: contentColumns, setContentColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft }, `header-${indexParent}-${index}`));
|
|
39224
39957
|
}) }, `header-${-indexParent}`));
|
|
39225
39958
|
}) }), jsxs("tbody", { className: "r-gridcontent", role: "rowgroup", children: [jsx("tr", { style: { height: offsetY } }), filteredData.slice(startIndex, endIndex).map((row) => {
|
|
39226
39959
|
const indexRow = row.indexRow;
|
|
@@ -39933,17 +40666,35 @@ const SettingColumn = React__default.memo((props) => {
|
|
|
39933
40666
|
}) }) })] }), 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: [jsx("div", { children: settingColumns?.updatedDate && (jsxs("p", { children: [jsxs("strong", { children: [t('Update date'), ": "] }), " ", jsx("span", { children: settingColumns.updatedDate ? formatDateTime(settingColumns.updatedDate, 'DD/MM/yyyy HH:mm') : '' }), jsxs("strong", { className: "ms-2", children: [t('Editor'), ": "] }), " ", jsx("span", { children: settingColumns.updatedByName })] })) }), jsxs("div", { children: [resetDefaultColumns && (jsx(Button$1$1, { color: "primary", onClick: () => messageBoxConfirm(t, handleResetColumns, {}, 'Do you want to reset the default settings?'), className: "me-1", children: t('Reset') })), jsx(Button$1$1, { color: "primary", onClick: handleSubmit, className: "me-1", children: t('Confirm') }), jsx(Button$1$1, { color: "secondary", onClick: handleCancel, outline: true, children: t('Close') })] })] })] }));
|
|
39934
40667
|
});
|
|
39935
40668
|
|
|
39936
|
-
const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, focusRow, editDisable, addDisable, buttonSetting, toolbarSetting }) => {
|
|
40669
|
+
const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, focusRow, editDisable, addDisable, buttonSetting, toolbarSetting, }) => {
|
|
39937
40670
|
const { t } = useTranslation();
|
|
39938
|
-
return (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: jsxs("div", { className: "r-toolbar-items", children: [jsxs("div", { className: "r-toolbar-left", children: [jsxs("div", { className: classNames$1('r-toolbar-item d-flex', {
|
|
40671
|
+
return (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: jsxs("div", { className: "r-toolbar-items", children: [jsxs("div", { className: "r-toolbar-left", children: [jsxs("div", { className: classNames$1('r-toolbar-item d-flex', {
|
|
40672
|
+
'd-none': editDisable || addDisable,
|
|
40673
|
+
}), "aria-disabled": "false", children: [jsx(Button$1$1, { color: "success", outline: true, onClick: () => handleAdd(1), className: "d-flex", children: t('Add item') }), buttonSetting?.disableAddMulti === true && (jsxs(UncontrolledDropdown, { className: "nav-item", children: [jsx(DropdownToggle$1, { tag: "div", className: "me-0 d-flex", children: jsx(Button$1$1, { type: "button", color: "success", outline: true, style: { marginLeft: -1 }, className: "px-25", children: jsx("svg", { fill: "#28c76f", height: "15", width: "20", viewBox: "0 0 20 20", children: 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" }) }) }) }), jsxs(DropdownMenu$1, { className: "formula-dropdown icon-dropdown p-0", children: [jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(10), children: "10 h\u00E0ng" }), jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(20), children: "20 h\u00E0ng" }), jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(30), children: "30 h\u00E0ng" }), jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(40), children: "40 h\u00E0ng" }), jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(50), children: "50 h\u00E0ng" }), jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(100), children: "100 h\u00E0ng" }), jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(1000), children: "1000 h\u00E0ng" })] })] }))] }), (focusRow ?? -1) > -1 ? (jsxs(Fragment$1, { children: [jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40674
|
+
'd-none': editDisable ||
|
|
40675
|
+
addDisable ||
|
|
40676
|
+
buttonSetting?.duplicateDisable,
|
|
40677
|
+
}), "aria-disabled": "false", children: jsx(Button$1$1, { color: "success", outline: true, onClick: () => {
|
|
39939
40678
|
handleDuplicate();
|
|
39940
|
-
}, className: "d-flex", children: t('Duplicate') }) }), jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40679
|
+
}, className: "d-flex", children: t('Duplicate') }) }), jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40680
|
+
'd-none': editDisable ||
|
|
40681
|
+
addDisable ||
|
|
40682
|
+
buttonSetting?.insertBeforeDisable,
|
|
40683
|
+
}), "aria-disabled": "false", children: jsx(Button$1$1, { color: "success", outline: true, onClick: handleInsertBefore, className: "d-flex", children: t('Insert item before') }) }), jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40684
|
+
'd-none': editDisable ||
|
|
40685
|
+
addDisable ||
|
|
40686
|
+
buttonSetting?.insertAfterDisable,
|
|
40687
|
+
}), "aria-disabled": "false", children: jsx(Button$1$1, { color: "success", outline: true, onClick: handleInsertAfter, className: "d-flex", children: t('Insert item after') }) })] })) : (jsx(Fragment$1, { children: " " })), jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40688
|
+
'd-none': editDisable || buttonSetting?.deleteAllDisable,
|
|
40689
|
+
}), "aria-disabled": "false", children: jsx(Button$1$1, { color: "primary", outline: true, onClick: handleDeleteAll, className: "d-flex", children: t('Delete all item') }) }), toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
39941
40690
|
return (item.align === 'left' && (jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`)));
|
|
39942
40691
|
})] }), jsx("div", { className: "r-toolbar-center", children: toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
39943
40692
|
return (item.align === 'center' && (jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-center-${index}`)));
|
|
39944
40693
|
}) }), jsxs("div", { className: "r-toolbar-right", children: [toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
39945
40694
|
return (item.align === 'right' && (jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-right-${index}`)));
|
|
39946
|
-
}), !toolbarSetting?.hiddenSetting && (jsxs(Fragment$1, { children: [jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsx("div", { className: classNames$1('r-toolbar-item me-25', {
|
|
40695
|
+
}), !toolbarSetting?.hiddenSetting && (jsxs(Fragment$1, { children: [jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsx("div", { className: classNames$1('r-toolbar-item me-25', {
|
|
40696
|
+
'd-none': editDisable || addDisable,
|
|
40697
|
+
}), "aria-disabled": "false", children: jsxs(UncontrolledDropdown, { className: "dropdown-user nav-item", children: [jsx(DropdownToggle$1, { tag: "div", color: "primary", onClick: (e) => e.preventDefault(), children: jsx(SvgInfo, { className: "cursor-pointer text-primary" }) }), jsx(DropdownMenu$1, { className: "formula-dropdown icon-dropdown", children: jsxs("ul", { className: "mb-0 pe-50", children: [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" }), jsx("li", { style: { fontSize: 13 }, children: "Ch\u1ECDn \u00F4 v\u00E0 Ctrl + V \u0111\u1EC3 d\u00E1n th\u00F4ng tin t\u1EEB excel" }), 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" }), 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" }), 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" }), 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" })] }) })] }) })] }))] })] }) }));
|
|
39947
40698
|
};
|
|
39948
40699
|
|
|
39949
40700
|
const RenderToolbarTop = ({ toolbarTopOption, maximize, setMaximize }) => {
|
|
@@ -68864,7 +69615,7 @@ const UnExpandAllIcon = ({ className, color = '#7F7F7F', size = 24, onClick, sty
|
|
|
68864
69615
|
};
|
|
68865
69616
|
|
|
68866
69617
|
const RenderContentCol = React__default.memo((props) => {
|
|
68867
|
-
const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, fieldKey, isMulti } = props;
|
|
69618
|
+
const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, handleCellClick, fieldKey, isMulti, } = props;
|
|
68868
69619
|
const cellId = `content-${idTable}-row${indexRow}col-${indexCol}`;
|
|
68869
69620
|
const checkOverflow = () => {
|
|
68870
69621
|
const element = document.getElementById(cellId);
|
|
@@ -68886,10 +69637,12 @@ const RenderContentCol = React__default.memo((props) => {
|
|
|
68886
69637
|
const RenderElement = () => {
|
|
68887
69638
|
if (col.field === '#' || col.type === '#') {
|
|
68888
69639
|
return (jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer text-center', {
|
|
68889
|
-
'r-active-cell': isSelected
|
|
69640
|
+
'r-active-cell': isSelected,
|
|
68890
69641
|
}), style: {
|
|
68891
|
-
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
68892
|
-
|
|
69642
|
+
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
69643
|
+
? 600
|
|
69644
|
+
: 400,
|
|
69645
|
+
fontStyle: row.haveItalicType ? 'italic' : 'normal',
|
|
68893
69646
|
}, onDoubleClick: (e) => {
|
|
68894
69647
|
e.preventDefault();
|
|
68895
69648
|
handleCloseContext();
|
|
@@ -68898,11 +69651,15 @@ const RenderContentCol = React__default.memo((props) => {
|
|
|
68898
69651
|
}
|
|
68899
69652
|
else if (col.type === 'checkbox' || col.field === 'checkbox') {
|
|
68900
69653
|
return (jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
|
|
68901
|
-
'r-active-cell': isSelected
|
|
69654
|
+
'r-active-cell': isSelected,
|
|
68902
69655
|
}), style: {
|
|
68903
69656
|
display: 'flex',
|
|
68904
|
-
justifyContent: col.textAlign === 'center'
|
|
68905
|
-
|
|
69657
|
+
justifyContent: col.textAlign === 'center'
|
|
69658
|
+
? 'center'
|
|
69659
|
+
: col.textAlign === 'right'
|
|
69660
|
+
? 'flex-end'
|
|
69661
|
+
: 'flex-start',
|
|
69662
|
+
alignItems: 'center',
|
|
68906
69663
|
}, onClick: (e) => {
|
|
68907
69664
|
setSelectedRows(toggleSelect());
|
|
68908
69665
|
e.stopPropagation();
|
|
@@ -68912,8 +69669,12 @@ const RenderContentCol = React__default.memo((props) => {
|
|
|
68912
69669
|
let value = row[col.field];
|
|
68913
69670
|
// ✅ Format dữ liệu theo loại cột
|
|
68914
69671
|
if (col.type === 'numeric') {
|
|
68915
|
-
value =
|
|
68916
|
-
|
|
69672
|
+
value =
|
|
69673
|
+
formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
|
|
69674
|
+
if (!zeroVisiable &&
|
|
69675
|
+
!col.zeroVisiable &&
|
|
69676
|
+
!(row?.sortOrder < 0 || row?.sortOrder > 100000) &&
|
|
69677
|
+
(value === '0' || value === 0)) {
|
|
68917
69678
|
value = '';
|
|
68918
69679
|
}
|
|
68919
69680
|
}
|
|
@@ -68921,31 +69682,43 @@ const RenderContentCol = React__default.memo((props) => {
|
|
|
68921
69682
|
value = value ? formatDateTime(value, formatSetting?.dateFormat) : '';
|
|
68922
69683
|
}
|
|
68923
69684
|
else if (col.type === 'datetime') {
|
|
68924
|
-
value = value
|
|
69685
|
+
value = value
|
|
69686
|
+
? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
69687
|
+
: '';
|
|
68925
69688
|
}
|
|
68926
69689
|
if (col.template) {
|
|
68927
69690
|
value = col.template(row, indexRow) ?? '';
|
|
68928
69691
|
}
|
|
68929
69692
|
const isNegative = col.type === 'numeric' && Number(row[col.field]) < 0;
|
|
68930
|
-
const textColor = isNegative
|
|
68931
|
-
|
|
68932
|
-
|
|
68933
|
-
const
|
|
69693
|
+
const textColor = isNegative
|
|
69694
|
+
? (formatSetting?.colorNegative ?? 'red')
|
|
69695
|
+
: undefined;
|
|
69696
|
+
const prefix = isNegative ? (formatSetting?.prefixNegative ?? '-') : '';
|
|
69697
|
+
const suffix = isNegative ? (formatSetting?.suffixNegative ?? '') : '';
|
|
69698
|
+
const displayText = isNegative
|
|
69699
|
+
? `${prefix}${value}${suffix}`
|
|
69700
|
+
: (value ?? '');
|
|
68934
69701
|
return (jsxs("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
|
|
68935
|
-
'r-active-cell': isSelected
|
|
69702
|
+
'r-active-cell': isSelected,
|
|
68936
69703
|
}), style: {
|
|
68937
|
-
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
68938
|
-
|
|
69704
|
+
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
69705
|
+
? 600
|
|
69706
|
+
: 400,
|
|
69707
|
+
fontStyle: row.haveItalicType ? 'italic' : 'normal',
|
|
68939
69708
|
}, children: [jsx("div", { className: "r-cell-text", style: {
|
|
68940
69709
|
display: 'flex',
|
|
68941
|
-
justifyContent: col.textAlign === 'center'
|
|
68942
|
-
|
|
69710
|
+
justifyContent: col.textAlign === 'center'
|
|
69711
|
+
? 'center'
|
|
69712
|
+
: col.textAlign === 'right'
|
|
69713
|
+
? 'flex-end'
|
|
69714
|
+
: 'flex-start',
|
|
69715
|
+
alignItems: 'center',
|
|
68943
69716
|
}, children: jsx("div", { id: cellId, style: {
|
|
68944
69717
|
color: textColor,
|
|
68945
69718
|
overflow: 'hidden',
|
|
68946
69719
|
textOverflow: 'ellipsis',
|
|
68947
69720
|
whiteSpace: 'pre',
|
|
68948
|
-
maxWidth: '100%'
|
|
69721
|
+
maxWidth: '100%',
|
|
68949
69722
|
}, children: displayText }) }), checkOverflow() && (jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: cellId, placement: "top", children: jsx("div", { style: { color: textColor }, onClick: (e) => {
|
|
68950
69723
|
e.stopPropagation();
|
|
68951
69724
|
e.preventDefault();
|
|
@@ -68954,15 +69727,21 @@ const RenderContentCol = React__default.memo((props) => {
|
|
|
68954
69727
|
};
|
|
68955
69728
|
const clickTimerRef = useRef(null);
|
|
68956
69729
|
return (jsx(Fragment$1, { children: col.visible !== false && col.isGroup !== true && (jsx("td", { className: classNames$1(`r-rowcell fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, {
|
|
68957
|
-
'fixed-last': (col.fixedType === 'left' &&
|
|
69730
|
+
'fixed-last': (col.fixedType === 'left' &&
|
|
69731
|
+
indexCol === lastObjWidthFixLeft) ||
|
|
69732
|
+
(col.fixedType === 'right' &&
|
|
69733
|
+
indexCol === fisrtObjWidthFixRight),
|
|
68958
69734
|
}, { 'r-active': isSelected }), style: {
|
|
68959
69735
|
left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
|
|
68960
|
-
right: col.fixedType === 'right'
|
|
69736
|
+
right: col.fixedType === 'right'
|
|
69737
|
+
? objWidthFixRight[indexCol]
|
|
69738
|
+
: undefined,
|
|
68961
69739
|
}, onClick: (e) => {
|
|
68962
69740
|
const tag = e.target?.nodeName;
|
|
68963
69741
|
if (tag !== 'DIV' && tag !== 'TD') {
|
|
68964
69742
|
return;
|
|
68965
69743
|
}
|
|
69744
|
+
handleCellClick?.(row, col);
|
|
68966
69745
|
if (clickTimerRef.current) {
|
|
68967
69746
|
window.clearTimeout(clickTimerRef.current);
|
|
68968
69747
|
}
|
|
@@ -68990,7 +69769,7 @@ const RenderContentCol = React__default.memo((props) => {
|
|
|
68990
69769
|
});
|
|
68991
69770
|
|
|
68992
69771
|
const TableElement = React__default.memo((props) => {
|
|
68993
|
-
const { contentColumns, dataSource, fieldKey, filterBy, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, orderBy, selectedRows, setContentColumns, setSelectedRows, formatSetting, gridRef, idTable, headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, isMulti, querySetting, searchSetting, searchTerm, columnsAggregate, haveSum, expandsAll, zeroVisiable, setFilterBy, setOrderBy, setExpandsAll, handleDoubleClick, contextMenuItems, handleContextMenuClick, isLoading } = props;
|
|
69772
|
+
const { contentColumns, dataSource, fieldKey, filterBy, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, orderBy, selectedRows, setContentColumns, setSelectedRows, formatSetting, gridRef, idTable, headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, isMulti, querySetting, searchSetting, searchTerm, columnsAggregate, haveSum, expandsAll, zeroVisiable, setFilterBy, setOrderBy, setExpandsAll, handleDoubleClick, handleCellClick, contextMenuItems, handleContextMenuClick, isLoading, } = props;
|
|
68994
69773
|
const { t } = useTranslation();
|
|
68995
69774
|
const [context, setContext] = useState(null);
|
|
68996
69775
|
const virtualDivRef = useRef(null);
|
|
@@ -69036,7 +69815,10 @@ const TableElement = React__default.memo((props) => {
|
|
|
69036
69815
|
if (searchTerm) {
|
|
69037
69816
|
datas = datas.filter((row) => {
|
|
69038
69817
|
return searchSetting?.keyField?.some((key) => {
|
|
69039
|
-
return row[key]
|
|
69818
|
+
return row[key]
|
|
69819
|
+
?.toString()
|
|
69820
|
+
.toLowerCase()
|
|
69821
|
+
.includes(searchTerm.trim().toLowerCase());
|
|
69040
69822
|
});
|
|
69041
69823
|
});
|
|
69042
69824
|
}
|
|
@@ -69045,7 +69827,10 @@ const TableElement = React__default.memo((props) => {
|
|
|
69045
69827
|
return filterBy.every((filter) => {
|
|
69046
69828
|
const { key, value, ope } = filter;
|
|
69047
69829
|
const rowValue = row[key];
|
|
69048
|
-
if (rowValue === undefined ||
|
|
69830
|
+
if (rowValue === undefined ||
|
|
69831
|
+
rowValue === null ||
|
|
69832
|
+
value === undefined ||
|
|
69833
|
+
value === null) {
|
|
69049
69834
|
return false;
|
|
69050
69835
|
}
|
|
69051
69836
|
const valStr = String(rowValue).toLowerCase();
|
|
@@ -69111,56 +69896,72 @@ const TableElement = React__default.memo((props) => {
|
|
|
69111
69896
|
}
|
|
69112
69897
|
let value = row[col.field];
|
|
69113
69898
|
if (col.type === 'numeric') {
|
|
69114
|
-
value =
|
|
69899
|
+
value =
|
|
69900
|
+
formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
|
|
69115
69901
|
}
|
|
69116
69902
|
else if (col.type === 'date') {
|
|
69117
|
-
value = value
|
|
69903
|
+
value = value
|
|
69904
|
+
? formatDateTime(value, formatSetting?.dateFormat)
|
|
69905
|
+
: '';
|
|
69118
69906
|
}
|
|
69119
69907
|
else if (col.type === 'datetime') {
|
|
69120
|
-
value = value
|
|
69908
|
+
value = value
|
|
69909
|
+
? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
69910
|
+
: '';
|
|
69121
69911
|
}
|
|
69122
69912
|
if (col.template) {
|
|
69123
69913
|
value = col.template(row, indexRow) ?? '';
|
|
69124
69914
|
}
|
|
69125
69915
|
return (jsxs(Fragment$1, { children: [jsxs("tr", { "aria-rowindex": indexRow + 1, role: "row", className: "r-row", children: [jsx("td", { className: "r-rowcell r-cell-group", colSpan: 3, children: jsxs("div", { className: "r-rowcell-div", children: [jsx(SvgChevronRight, { style: {
|
|
69126
69916
|
marginLeft: level * 20,
|
|
69127
|
-
transform: expand ? 'rotate(90deg)' : 'rotate(0deg)'
|
|
69917
|
+
transform: expand ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
69128
69918
|
}, fontSize: 15, onClick: () => {
|
|
69129
69919
|
setExpand(!expand);
|
|
69130
69920
|
setExpandsAll(undefined);
|
|
69131
69921
|
row.expand = !expand;
|
|
69132
69922
|
} }), t(col.headerDisplay ?? col.headerText ?? ''), ": ", value, " (", row.children.length, ")"] }) }), contentColumns.map((colSum, indexCol) => {
|
|
69133
|
-
if (indexCol <= firstColSpan ||
|
|
69923
|
+
if (indexCol <= firstColSpan ||
|
|
69924
|
+
colSum.visible === false ||
|
|
69925
|
+
colSum.isGroup === true) {
|
|
69134
69926
|
return;
|
|
69135
69927
|
}
|
|
69136
69928
|
let sumValue = row[colSum.field];
|
|
69137
|
-
const haveSum = row[colSum.field] !== undefined &&
|
|
69138
|
-
|
|
69929
|
+
const haveSum = row[colSum.field] !== undefined &&
|
|
69930
|
+
row[colSum.field] !== null;
|
|
69931
|
+
if (!haveSum &&
|
|
69932
|
+
colSum.haveSum === true &&
|
|
69933
|
+
colSum.type === 'numeric') {
|
|
69139
69934
|
sumValue = row.children.reduce(function (accumulator, currentValue) {
|
|
69140
|
-
return Number(accumulator ?? 0) +
|
|
69935
|
+
return (Number(accumulator ?? 0) +
|
|
69936
|
+
Number(currentValue[colSum.field] ?? 0));
|
|
69141
69937
|
}, 0);
|
|
69142
69938
|
}
|
|
69143
69939
|
if (colSum.type === 'numeric') {
|
|
69144
69940
|
sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', colSum.numericSettings?.fraction, true, false);
|
|
69145
|
-
if (!zeroVisiable &&
|
|
69941
|
+
if (!zeroVisiable &&
|
|
69942
|
+
!col.zeroVisiable &&
|
|
69943
|
+
(sumValue === '0' || sumValue === 0)) {
|
|
69146
69944
|
sumValue = '';
|
|
69147
69945
|
}
|
|
69148
69946
|
}
|
|
69149
69947
|
return (jsx("td", { className: "r-rowcell r-cell-sum-group", children: jsx("div", { className: "r-rowcell-div", style: {
|
|
69150
|
-
justifyContent: colSum.textAlign
|
|
69151
|
-
|
|
69152
|
-
|
|
69948
|
+
justifyContent: colSum.textAlign
|
|
69949
|
+
? colSum.textAlign
|
|
69950
|
+
: 'left',
|
|
69951
|
+
}, children: (haveSum || colSum.haveSum === true) &&
|
|
69952
|
+
Number(row[colSum.field] ?? '0') < 0 ? (jsxs("div", { style: {
|
|
69953
|
+
color: formatSetting?.colorNegative ?? 'red',
|
|
69153
69954
|
}, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `group-sum-cell-${level}-${indexRow}-${indexCol}`));
|
|
69154
|
-
})] }), expand && jsx(RenderContent, { datas: row.children, level: level + 1 })] }, `row-${level}-${indexRow}`));
|
|
69955
|
+
})] }), expand && (jsx(RenderContent, { datas: row.children, level: level + 1 }))] }, `row-${level}-${indexRow}`));
|
|
69155
69956
|
}
|
|
69156
69957
|
else {
|
|
69157
69958
|
const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
|
|
69158
69959
|
return (jsx("tr", { id: `row-content-${indexRow}`, "aria-rowindex": indexRow + 1, role: "row", className: classNames$1('r-row', {
|
|
69159
|
-
'r-last-row': level === 0 && indexRow === viewData.length - 1
|
|
69960
|
+
'r-last-row': level === 0 && indexRow === viewData.length - 1,
|
|
69160
69961
|
}), onContextMenu: (e) => {
|
|
69161
69962
|
e.preventDefault();
|
|
69162
69963
|
handleContextMenu(e, row);
|
|
69163
|
-
}, children: contentColumns.map((column, indexCol) => (jsx(RenderContentCol, { idTable: idTable, col: column, fieldKey: fieldKey, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, isMulti: isMulti, selectedRows: selectedRows, setSelectedRows: setSelectedRows, formatSetting: formatSetting, indexCol: indexCol, indexRow: indexRow, isSelected: isSelected, row: row, zeroVisiable: zeroVisiable, handleCloseContext: handleCloseContext, handleDoubleClick: handleDoubleClick }, indexCol))) }, `row-content-${indexRow}`));
|
|
69964
|
+
}, children: contentColumns.map((column, indexCol) => (jsx(RenderContentCol, { idTable: idTable, col: column, fieldKey: fieldKey, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, isMulti: isMulti, selectedRows: selectedRows, setSelectedRows: setSelectedRows, formatSetting: formatSetting, indexCol: indexCol, indexRow: indexRow, isSelected: isSelected, row: row, zeroVisiable: zeroVisiable, handleCloseContext: handleCloseContext, handleDoubleClick: handleDoubleClick, handleCellClick: handleCellClick }, indexCol))) }, `row-content-${indexRow}`));
|
|
69164
69965
|
}
|
|
69165
69966
|
}) }));
|
|
69166
69967
|
});
|
|
@@ -69172,7 +69973,7 @@ const TableElement = React__default.memo((props) => {
|
|
|
69172
69973
|
x: e.clientX,
|
|
69173
69974
|
y: e.clientY,
|
|
69174
69975
|
row,
|
|
69175
|
-
show: true
|
|
69976
|
+
show: true,
|
|
69176
69977
|
});
|
|
69177
69978
|
}, 100);
|
|
69178
69979
|
};
|
|
@@ -69196,20 +69997,28 @@ const TableElement = React__default.memo((props) => {
|
|
|
69196
69997
|
let sumValue = item?.value;
|
|
69197
69998
|
if (!item && col.haveSum === true && col.type === 'numeric') {
|
|
69198
69999
|
sumValue = viewData.reduce(function (accumulator, currentValue) {
|
|
69199
|
-
return Number(accumulator ?? 0) +
|
|
70000
|
+
return (Number(accumulator ?? 0) +
|
|
70001
|
+
Number(currentValue[col.field] ?? 0));
|
|
69200
70002
|
}, 0);
|
|
69201
70003
|
}
|
|
69202
70004
|
if (col.type === 'numeric') {
|
|
69203
70005
|
sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false);
|
|
69204
70006
|
}
|
|
69205
70007
|
return (jsx("td", { className: classNames$1(`p-0 px-50 r-footer fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }), style: {
|
|
69206
|
-
left: col.fixedType === 'left'
|
|
69207
|
-
|
|
69208
|
-
|
|
69209
|
-
|
|
69210
|
-
|
|
70008
|
+
left: col.fixedType === 'left'
|
|
70009
|
+
? objWidthFixLeft[indexCol]
|
|
70010
|
+
: undefined,
|
|
70011
|
+
right: col.fixedType === 'right'
|
|
70012
|
+
? objWidthFixRight[indexCol]
|
|
70013
|
+
: undefined,
|
|
70014
|
+
textAlign: col.textAlign ? col.textAlign : 'left',
|
|
70015
|
+
}, children: jsx("div", { className: "r-footer-div", children: (item || col.haveSum === true) &&
|
|
70016
|
+
Number(item?.value ?? '0') < 0 ? (jsxs("div", { style: {
|
|
70017
|
+
color: formatSetting?.colorNegative ?? 'red',
|
|
69211
70018
|
}, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `summarycell-${indexCol}`));
|
|
69212
|
-
}) })) })] }), jsx("div", { ref: virtualDivRef }), context &&
|
|
70019
|
+
}) })) })] }), jsx("div", { ref: virtualDivRef }), context &&
|
|
70020
|
+
(contextMenuItems?.length ?? 0) > 0 &&
|
|
70021
|
+
handleContextMenuClick && (jsx(Popover$1, { className: "r-context-popover", placement: "right-start", isOpen: context.show, target: virtualDivRef.current, toggle: handleCloseContext, fade: false, children: jsx(PopoverBody$1, { children: contextMenuItems?.map((item, index) => {
|
|
69213
70022
|
return (jsxs("div", { className: "r-context-item", onClick: () => {
|
|
69214
70023
|
handleCloseContext();
|
|
69215
70024
|
handleContextMenuClick?.(item, context.row);
|
|
@@ -69217,7 +70026,7 @@ const TableElement = React__default.memo((props) => {
|
|
|
69217
70026
|
}) }) })), (viewData.length ?? 0) === 0 && !isLoading && (jsxs("div", { className: "r-no-data", children: [jsx("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [jsx("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }), jsxs("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [jsx("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), jsx("path", { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", fill: "#fafafa" })] })] }) }), t('No data available.')] }))] }));
|
|
69218
70027
|
});
|
|
69219
70028
|
|
|
69220
|
-
const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoading, formatSetting, querySetting, pagingSetting, searchSetting, columnsAggregate, toolbarSetting, selectedItem, setSelectedItem, handleSelect, saveSettingColumn, resetDefaultColumns, settingColumns, headerComponent, groupSetting, zeroVisiable, isMulti, handleDoubleClick, contextMenuItems, headerHeight, handleContextMenuClick, }) => {
|
|
70029
|
+
const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoading, formatSetting, querySetting, pagingSetting, searchSetting, columnsAggregate, toolbarSetting, selectedItem, setSelectedItem, handleSelect, saveSettingColumn, resetDefaultColumns, settingColumns, headerComponent, groupSetting, zeroVisiable, isMulti, handleDoubleClick, handleCellClick, contextMenuItems, headerHeight, handleContextMenuClick, }) => {
|
|
69221
70030
|
const { t } = useTranslation();
|
|
69222
70031
|
const gridRef = useRef(null);
|
|
69223
70032
|
const [openPopupSetupColumn, setOpenPopupSetupColumn] = useState(false);
|
|
@@ -69444,7 +70253,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69444
70253
|
}), children: [jsxs("div", { className: "r-grid", children: [toolbarSetting?.showTopToolbar && (jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption, maximize: maximize, setMaximize: setMaximize })), headerComponent && headerComponent(), jsxs("div", { ref: gridRef, className: "r-gridtable", style: {
|
|
69445
70254
|
height: `${heightTable ? `${heightTable}px` : 'auto'}`,
|
|
69446
70255
|
position: 'relative',
|
|
69447
|
-
}, children: [jsx(TableElement, { idTable: idTable, gridRef: gridRef, isLoading: isLoading, dataSource: dataSource, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, fieldKey: fieldKey, lastObjWidthFixLeft: lastObjWidthFixLeft, fisrtObjWidthFixRight: fisrtObjWidthFixRight, selectedRows: selectedRows, isMulti: isMulti, filterBy: filterBy, orderBy: orderBy, formatSetting: formatSetting, contentColumns: contentColumns, headerColumns: headerColumns, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, searchTerm: searchTerm, searchSetting: searchSetting, columnsAggregate: columnsAggregate, haveSum: haveSum, expandsAll: expandsAll, zeroVisiable: zeroVisiable, contextMenuItems: contextMenuItems, handleContextMenuClick: handleContextMenuClick, setFilterBy: setFilterBy, setSelectedRows: setSelectedRows, setOrderBy: setOrderBy, handleDoubleClick: handleDoubleClick, querySetting: querySetting, setContentColumns: setContentColumns, setExpandsAll: setExpandsAll }), isLoading && (jsx("div", { className: "r-loading-overlay", children: jsxs("div", { className: "r-loading", children: [jsx(Spinner$1, { className: "me-1" }), t('Loading...')] }) }))] })] }), pagingSetting?.allowPaging && (jsx(PagingComponent, { gridRef: gridRef, onChangePage: onChangePage, pageSize: pagingSetting?.pageSize ?? 0, currentPage: pagingSetting?.currentPage ?? 0, pageOptions: pagingSetting?.pageOptions ?? [20, 30, 50, 100], totalItem: pagingSetting?.totalItem ?? 0, onChangePageSize: onChangePageSize })), jsx(SettingColumn, { gridRef: gridRef, handleSidebar: () => {
|
|
70256
|
+
}, children: [jsx(TableElement, { idTable: idTable, gridRef: gridRef, isLoading: isLoading, dataSource: dataSource, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, fieldKey: fieldKey, lastObjWidthFixLeft: lastObjWidthFixLeft, fisrtObjWidthFixRight: fisrtObjWidthFixRight, selectedRows: selectedRows, isMulti: isMulti, filterBy: filterBy, orderBy: orderBy, formatSetting: formatSetting, contentColumns: contentColumns, headerColumns: headerColumns, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, searchTerm: searchTerm, searchSetting: searchSetting, columnsAggregate: columnsAggregate, haveSum: haveSum, expandsAll: expandsAll, zeroVisiable: zeroVisiable, contextMenuItems: contextMenuItems, handleContextMenuClick: handleContextMenuClick, setFilterBy: setFilterBy, setSelectedRows: setSelectedRows, setOrderBy: setOrderBy, handleDoubleClick: handleDoubleClick, handleCellClick: handleCellClick, querySetting: querySetting, setContentColumns: setContentColumns, setExpandsAll: setExpandsAll }), isLoading && (jsx("div", { className: "r-loading-overlay", children: jsxs("div", { className: "r-loading", children: [jsx(Spinner$1, { className: "me-1" }), t('Loading...')] }) }))] })] }), pagingSetting?.allowPaging && (jsx(PagingComponent, { gridRef: gridRef, onChangePage: onChangePage, pageSize: pagingSetting?.pageSize ?? 0, currentPage: pagingSetting?.currentPage ?? 0, pageOptions: pagingSetting?.pageOptions ?? [20, 30, 50, 100], totalItem: pagingSetting?.totalItem ?? 0, onChangePageSize: onChangePageSize })), jsx(SettingColumn, { gridRef: gridRef, handleSidebar: () => {
|
|
69448
70257
|
setOpenPopupSetupColumn(!openPopupSetupColumn);
|
|
69449
70258
|
}, settingColumns: settingColumns, openSidebar: openPopupSetupColumn, column: [...contentColumns], resetDefaultColumns: resetDefaultColumns, setColumn: (newColumns) => {
|
|
69450
70259
|
if (saveSettingColumn) {
|