react-table-edit 1.5.43 → 1.5.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component/sidebar-setting-column/index.d.ts +0 -2
- package/dist/component/table/toolbar-bottom.d.ts +1 -1
- package/dist/component/table-view/header.d.ts +3 -3
- package/dist/index.js +941 -480
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +941 -480
- 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,
|
|
@@ -19936,45 +19959,46 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19936
19959
|
};
|
|
19937
19960
|
const applySetting = (cols) => {
|
|
19938
19961
|
return cols.map((cell) => {
|
|
19939
|
-
const
|
|
19962
|
+
const newCell = { ...cell };
|
|
19963
|
+
const setting = settingColumns?.find((s) => s.field === newCell.field);
|
|
19940
19964
|
if (setting) {
|
|
19941
|
-
|
|
19942
|
-
if (!
|
|
19943
|
-
|
|
19965
|
+
newCell.sortOrder = setting.sortOrder;
|
|
19966
|
+
if (!newCell.visibleLocked) {
|
|
19967
|
+
newCell.visible = setting.visible ?? true;
|
|
19944
19968
|
}
|
|
19945
|
-
|
|
19969
|
+
newCell.fixedType = setting.fixedType;
|
|
19946
19970
|
if (setting.width !== undefined && setting.width !== null) {
|
|
19947
|
-
|
|
19971
|
+
newCell.width = setting.width;
|
|
19948
19972
|
}
|
|
19949
19973
|
if (setting.fraction !== undefined && setting.fraction !== null) {
|
|
19950
|
-
if (
|
|
19951
|
-
|
|
19974
|
+
if (newCell.numericSettings) {
|
|
19975
|
+
newCell.numericSettings.fraction = setting.fraction;
|
|
19952
19976
|
}
|
|
19953
19977
|
else {
|
|
19954
|
-
|
|
19978
|
+
newCell.numericSettings = { fraction: setting.fraction };
|
|
19955
19979
|
}
|
|
19956
19980
|
}
|
|
19957
|
-
|
|
19981
|
+
newCell.headerDisplay = setting.headerText || (newCell.headerDisplay ?? newCell.headerText);
|
|
19958
19982
|
}
|
|
19959
19983
|
else {
|
|
19960
|
-
if (
|
|
19961
|
-
|
|
19962
|
-
|
|
19963
|
-
if (
|
|
19964
|
-
|
|
19984
|
+
if (newCell.columns?.length) {
|
|
19985
|
+
newCell.columns = applySetting(newCell.columns);
|
|
19986
|
+
newCell.sortOrder = newCell.columns[0].sortOrder;
|
|
19987
|
+
if (newCell.columns.some((x) => x.visible !== false)) {
|
|
19988
|
+
newCell.visible = true;
|
|
19965
19989
|
}
|
|
19966
19990
|
else {
|
|
19967
|
-
|
|
19991
|
+
newCell.visible = false;
|
|
19968
19992
|
}
|
|
19969
19993
|
}
|
|
19970
19994
|
else {
|
|
19971
|
-
if (!
|
|
19972
|
-
|
|
19995
|
+
if (!newCell.visibleLocked) {
|
|
19996
|
+
newCell.visible = false;
|
|
19973
19997
|
}
|
|
19974
19998
|
}
|
|
19975
19999
|
}
|
|
19976
|
-
|
|
19977
|
-
return
|
|
20000
|
+
newCell.isGroup = groupColumns?.includes(newCell.field);
|
|
20001
|
+
return newCell;
|
|
19978
20002
|
});
|
|
19979
20003
|
};
|
|
19980
20004
|
const traverse = (cols, level = 0) => {
|
|
@@ -20018,10 +20042,8 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20018
20042
|
}, 0);
|
|
20019
20043
|
};
|
|
20020
20044
|
calcTotalRightWidth(columns);
|
|
20021
|
-
|
|
20022
|
-
|
|
20023
|
-
}
|
|
20024
|
-
traverse(columns);
|
|
20045
|
+
const newColumns = (settingColumns?.length ?? 0) > 0 ? applySetting(columns) : columns;
|
|
20046
|
+
traverse(newColumns);
|
|
20025
20047
|
// Danh sách các cột được hiển thị
|
|
20026
20048
|
// const flatVisble = flat.filter((e) => e.visible !== false)
|
|
20027
20049
|
const flatVisbleContent = flat.filter((x) => x.visible !== false && x.field !== 'command' && x.field !== '#' && x.field !== 'checkbox');
|
|
@@ -20246,7 +20268,7 @@ const TableElement$1 = React__default.memo((props) => {
|
|
|
20246
20268
|
|
|
20247
20269
|
const defaultMaxHeight$1 = 250;
|
|
20248
20270
|
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
|
|
20271
|
+
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
20272
|
const selectTableRef = useRef(null);
|
|
20251
20273
|
const selectMenuTableRef = useRef(null);
|
|
20252
20274
|
const inputRef = useRef(null);
|
|
@@ -20263,8 +20285,8 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20263
20285
|
{
|
|
20264
20286
|
headerText: 'Name',
|
|
20265
20287
|
field: fieldLabel ?? 'label',
|
|
20266
|
-
width: menuWidth
|
|
20267
|
-
}
|
|
20288
|
+
width: menuWidth
|
|
20289
|
+
}
|
|
20268
20290
|
];
|
|
20269
20291
|
const closeMenu = () => {
|
|
20270
20292
|
setDropdownOpen(false);
|
|
@@ -20278,7 +20300,7 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20278
20300
|
...val,
|
|
20279
20301
|
[fieldLabel ?? 'label']: val.valueCreate,
|
|
20280
20302
|
isCreated: undefined,
|
|
20281
|
-
isCreatedItem: true
|
|
20303
|
+
isCreatedItem: true
|
|
20282
20304
|
};
|
|
20283
20305
|
options.unshift(newVal);
|
|
20284
20306
|
onChange(newVal);
|
|
@@ -20288,9 +20310,7 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20288
20310
|
};
|
|
20289
20311
|
useEffect(() => {
|
|
20290
20312
|
if (dropdownOpen && value && !isMulti && selectMenuTableRef) {
|
|
20291
|
-
const index = currentOptions?.findIndex((row) => compareFunction
|
|
20292
|
-
? compareFunction(row)
|
|
20293
|
-
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']);
|
|
20313
|
+
const index = currentOptions?.findIndex((row) => (compareFunction ? compareFunction(row) : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']));
|
|
20294
20314
|
if (index >= 0) {
|
|
20295
20315
|
selectMenuTableRef.current.scrollTo({ top: (index - 1) * 30 });
|
|
20296
20316
|
}
|
|
@@ -20337,28 +20357,14 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20337
20357
|
}
|
|
20338
20358
|
}
|
|
20339
20359
|
};
|
|
20340
|
-
const listKeyUse = [
|
|
20341
|
-
'Escape',
|
|
20342
|
-
'Space',
|
|
20343
|
-
'Enter',
|
|
20344
|
-
'Tab',
|
|
20345
|
-
'NumpadEnter',
|
|
20346
|
-
'ArrowDown',
|
|
20347
|
-
'ArrowUp',
|
|
20348
|
-
'F9',
|
|
20349
|
-
];
|
|
20360
|
+
const listKeyUse = ['Escape', 'Space', 'Enter', 'Tab', 'NumpadEnter', 'ArrowDown', 'ArrowUp', 'F9'];
|
|
20350
20361
|
const handleOnKeyDown = (e) => {
|
|
20351
20362
|
let key = '';
|
|
20352
20363
|
if (onKeyDown &&
|
|
20353
20364
|
(!dropdownOpen ||
|
|
20354
20365
|
!listKeyUse.includes(e.code) ||
|
|
20355
|
-
((e.code === 'Enter' ||
|
|
20356
|
-
|
|
20357
|
-
e.code === 'NumpadEnter' ||
|
|
20358
|
-
e.code === 'Space') &&
|
|
20359
|
-
!(currentOptions[indexFocus] || haveCreateNew)) ||
|
|
20360
|
-
((e.code === 'ArrowDown' || e.code === 'ArrowUp') &&
|
|
20361
|
-
currentOptions.length === 0) ||
|
|
20366
|
+
((e.code === 'Enter' || e.code === 'Tab' || e.code === 'NumpadEnter' || e.code === 'Space') && !(currentOptions[indexFocus] || haveCreateNew)) ||
|
|
20367
|
+
((e.code === 'ArrowDown' || e.code === 'ArrowUp') && currentOptions.length === 0) ||
|
|
20362
20368
|
(e.code === 'Escape' && !(isClearable && value && !isDisabled)))) {
|
|
20363
20369
|
key = onKeyDown(e);
|
|
20364
20370
|
}
|
|
@@ -20375,7 +20381,7 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20375
20381
|
valueCreate: searchTerm,
|
|
20376
20382
|
[fieldValue ?? 'value']: searchTerm,
|
|
20377
20383
|
[fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`,
|
|
20378
|
-
isCreated: true
|
|
20384
|
+
isCreated: true
|
|
20379
20385
|
};
|
|
20380
20386
|
}
|
|
20381
20387
|
else {
|
|
@@ -20397,16 +20403,14 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20397
20403
|
flag = true;
|
|
20398
20404
|
}
|
|
20399
20405
|
}
|
|
20400
|
-
else if (e.code === 'Enter' ||
|
|
20401
|
-
e.code === 'Tab' ||
|
|
20402
|
-
e.code === 'NumpadEnter') {
|
|
20406
|
+
else if (e.code === 'Enter' || e.code === 'Tab' || e.code === 'NumpadEnter') {
|
|
20403
20407
|
let newItem;
|
|
20404
20408
|
if (haveCreateNew && indexFocus === 0) {
|
|
20405
20409
|
newItem = {
|
|
20406
20410
|
valueCreate: searchTerm,
|
|
20407
20411
|
[fieldValue ?? 'value']: searchTerm,
|
|
20408
20412
|
[fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`,
|
|
20409
|
-
isCreated: true
|
|
20413
|
+
isCreated: true
|
|
20410
20414
|
};
|
|
20411
20415
|
}
|
|
20412
20416
|
else {
|
|
@@ -20425,10 +20429,7 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20425
20429
|
newIndex = indexFocus + 1;
|
|
20426
20430
|
}
|
|
20427
20431
|
else if (value) {
|
|
20428
|
-
newIndex =
|
|
20429
|
-
currentOptions?.findIndex((row) => compareFunction
|
|
20430
|
-
? compareFunction(row)
|
|
20431
|
-
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']) + 1;
|
|
20432
|
+
newIndex = currentOptions?.findIndex((row) => (compareFunction ? compareFunction(row) : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value'])) + 1;
|
|
20432
20433
|
}
|
|
20433
20434
|
if (newIndex < currentOptions.length) {
|
|
20434
20435
|
setIndexFocus(newIndex);
|
|
@@ -20452,10 +20453,7 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20452
20453
|
newIndex = indexFocus - 1;
|
|
20453
20454
|
}
|
|
20454
20455
|
else if (value) {
|
|
20455
|
-
newIndex =
|
|
20456
|
-
currentOptions?.findIndex((row) => compareFunction
|
|
20457
|
-
? compareFunction(row)
|
|
20458
|
-
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']) - 1;
|
|
20456
|
+
newIndex = currentOptions?.findIndex((row) => (compareFunction ? compareFunction(row) : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value'])) - 1;
|
|
20459
20457
|
}
|
|
20460
20458
|
if (newIndex >= 0) {
|
|
20461
20459
|
setIndexFocus(newIndex);
|
|
@@ -20488,11 +20486,7 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20488
20486
|
scrollToElement(selectMenuTableRef.current, selectMenuTableRef.current.scrollHeight);
|
|
20489
20487
|
}
|
|
20490
20488
|
else if (flag === 0 && rect.bottom + 30 > parentRect.bottom) {
|
|
20491
|
-
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop -
|
|
20492
|
-
selectMenuTableRef.current.offsetTop -
|
|
20493
|
-
parentRect.height +
|
|
20494
|
-
rect.height +
|
|
20495
|
-
50);
|
|
20489
|
+
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - selectMenuTableRef.current.offsetTop - parentRect.height + rect.height + 50);
|
|
20496
20490
|
}
|
|
20497
20491
|
else if (flag === 2 && rect.top < parentRect.top + 50) {
|
|
20498
20492
|
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - 65);
|
|
@@ -20506,7 +20500,7 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20506
20500
|
timeOutElement = setTimeout(() => {
|
|
20507
20501
|
elemment.scrollTo({
|
|
20508
20502
|
top,
|
|
20509
|
-
behavior: 'smooth'
|
|
20503
|
+
behavior: 'smooth'
|
|
20510
20504
|
});
|
|
20511
20505
|
}, 100);
|
|
20512
20506
|
};
|
|
@@ -20516,12 +20510,7 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20516
20510
|
}
|
|
20517
20511
|
for (let index = 0; index < columnsSearch.length; index++) {
|
|
20518
20512
|
const key = columnsSearch[index].field.trim();
|
|
20519
|
-
if (data[key] &&
|
|
20520
|
-
data[key]
|
|
20521
|
-
.toString()
|
|
20522
|
-
.trim()
|
|
20523
|
-
.toLowerCase()
|
|
20524
|
-
.includes(keyword.trim().toLowerCase())) {
|
|
20513
|
+
if (data[key] && data[key].toString().trim().toLowerCase().includes(keyword.trim().toLowerCase())) {
|
|
20525
20514
|
return true;
|
|
20526
20515
|
}
|
|
20527
20516
|
}
|
|
@@ -20537,8 +20526,7 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20537
20526
|
if (!searchTerm) {
|
|
20538
20527
|
setOptionsLoad(undefined);
|
|
20539
20528
|
}
|
|
20540
|
-
else if (allowCreate &&
|
|
20541
|
-
!currentOptions?.find((x) => x[fieldLabel ?? 'label'] === searchTerm)) {
|
|
20529
|
+
else if (allowCreate && !currentOptions?.find((x) => x[fieldLabel ?? 'label'] === searchTerm)) {
|
|
20542
20530
|
setHaveCreateNew(true);
|
|
20543
20531
|
return;
|
|
20544
20532
|
}
|
|
@@ -20552,22 +20540,15 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20552
20540
|
const { indexRow, row, isSelected, level = 0 } = props;
|
|
20553
20541
|
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`, {
|
|
20554
20542
|
'r-select-move': indexFocus === indexRow,
|
|
20555
|
-
'r-select-active': !isMulti &&
|
|
20556
|
-
value &&
|
|
20557
|
-
(compareFunction
|
|
20558
|
-
? compareFunction(row)
|
|
20559
|
-
: value[fieldValue ?? 'value'] ===
|
|
20560
|
-
row[fieldValue ?? 'value']),
|
|
20543
|
+
'r-select-active': !isMulti && value && (compareFunction ? compareFunction(row) : value[fieldValue ?? 'value'] === row[fieldValue ?? 'value'])
|
|
20561
20544
|
}), style: {
|
|
20562
20545
|
width: 40,
|
|
20563
20546
|
textAlign: 'center',
|
|
20564
20547
|
padding: 0,
|
|
20565
|
-
paddingBottom: 6
|
|
20548
|
+
paddingBottom: 6
|
|
20566
20549
|
}, onClick: (e) => {
|
|
20567
20550
|
if (isMulti) {
|
|
20568
|
-
const index = value?.findIndex((x) => compareFunction
|
|
20569
|
-
? compareFunction(row)
|
|
20570
|
-
: x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']);
|
|
20551
|
+
const index = value?.findIndex((x) => (compareFunction ? compareFunction(row) : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']));
|
|
20571
20552
|
if (index > -1) {
|
|
20572
20553
|
value?.splice(index, 1);
|
|
20573
20554
|
handChange([...value]);
|
|
@@ -20585,42 +20566,28 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20585
20566
|
}
|
|
20586
20567
|
}, children: jsx(Input$1, { checked: isSelected, type: "checkbox", className: "cursor-pointer", onChange: () => { }, style: { textAlign: 'center', marginTop: 6 } }) })), (columns ? columns : defaultColumns).map((col, indexCol) => {
|
|
20587
20568
|
let valueDisplay = row[col.field];
|
|
20588
|
-
if (col.type === 'numeric' ||
|
|
20589
|
-
(col.
|
|
20590
|
-
valueDisplay =
|
|
20591
|
-
formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? '.', formatSetting?.thousandSeparator ?? ',', col.fraction ?? 0, true, false) ?? 0;
|
|
20569
|
+
if (col.type === 'numeric' || (col.typeCondition && col.typeCondition(row) === 'numeric')) {
|
|
20570
|
+
valueDisplay = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? '.', formatSetting?.thousandSeparator ?? ',', col.fraction ?? 0, true, false) ?? 0;
|
|
20592
20571
|
}
|
|
20593
20572
|
else if (col.type === 'date') {
|
|
20594
|
-
valueDisplay = valueDisplay
|
|
20595
|
-
? formatDateTime(valueDisplay, formatSetting?.dateFormat)
|
|
20596
|
-
: '';
|
|
20573
|
+
valueDisplay = valueDisplay ? formatDateTime(valueDisplay, formatSetting?.dateFormat) : '';
|
|
20597
20574
|
}
|
|
20598
20575
|
else if (col.type === 'datetime') {
|
|
20599
|
-
valueDisplay = valueDisplay
|
|
20600
|
-
? formatDateTime(valueDisplay, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
20601
|
-
: '';
|
|
20576
|
+
valueDisplay = valueDisplay ? formatDateTime(valueDisplay, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
|
|
20602
20577
|
}
|
|
20603
20578
|
return (jsxs(Fragment, { children: [col.visible !== false && (jsx("td", { id: `select-${id}-${indexRow}-${indexCol}`,
|
|
20604
20579
|
// ref={refRow}
|
|
20605
20580
|
className: classNames$1(`r-select-rowcell`, {
|
|
20606
20581
|
'r-select-move': indexFocus === indexRow,
|
|
20607
|
-
'r-select-active': !isMulti &&
|
|
20608
|
-
value &&
|
|
20609
|
-
(compareFunction
|
|
20610
|
-
? compareFunction(row)
|
|
20611
|
-
: value[fieldValue ?? 'value'] ===
|
|
20612
|
-
row[fieldValue ?? 'value']),
|
|
20582
|
+
'r-select-active': !isMulti && value && (compareFunction ? compareFunction(row) : value[fieldValue ?? 'value'] === row[fieldValue ?? 'value'])
|
|
20613
20583
|
}), style: {
|
|
20614
20584
|
minWidth: col.minWidth,
|
|
20615
20585
|
width: col.width,
|
|
20616
20586
|
maxWidth: col.maxWidth,
|
|
20617
|
-
textAlign: col.textAlign ? col.textAlign : 'left'
|
|
20587
|
+
textAlign: col.textAlign ? col.textAlign : 'left'
|
|
20618
20588
|
}, onClick: (e) => {
|
|
20619
20589
|
if (isMulti) {
|
|
20620
|
-
const index = value?.findIndex((x) => compareFunction
|
|
20621
|
-
? compareFunction(row)
|
|
20622
|
-
: x[fieldValue ?? 'value'] ===
|
|
20623
|
-
row[fieldValue ?? 'value']);
|
|
20590
|
+
const index = value?.findIndex((x) => (compareFunction ? compareFunction(row) : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']));
|
|
20624
20591
|
if (index > -1) {
|
|
20625
20592
|
value?.splice(index, 1);
|
|
20626
20593
|
handChange([...value]);
|
|
@@ -20647,7 +20614,7 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20647
20614
|
setIndexFocus(indexRow);
|
|
20648
20615
|
}
|
|
20649
20616
|
e.stopPropagation();
|
|
20650
|
-
}, children: col.template ?
|
|
20617
|
+
}, 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));
|
|
20651
20618
|
})] }, `row-${indexRow}`));
|
|
20652
20619
|
});
|
|
20653
20620
|
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) => {
|
|
@@ -20657,26 +20624,14 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20657
20624
|
}
|
|
20658
20625
|
e.preventDefault();
|
|
20659
20626
|
}, tag: "div", style: {
|
|
20660
|
-
width: width
|
|
20661
|
-
? width
|
|
20662
|
-
: selectTableRef?.current?.clientWidth
|
|
20663
|
-
? selectTableRef?.current?.clientWidth
|
|
20664
|
-
: 'auto',
|
|
20627
|
+
width: width ? width : selectTableRef?.current?.clientWidth ? selectTableRef?.current?.clientWidth : 'auto'
|
|
20665
20628
|
}, 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', {
|
|
20666
|
-
'd-none': searchTerm
|
|
20629
|
+
'd-none': searchTerm
|
|
20667
20630
|
}), children: value?.map((ele, index) => {
|
|
20668
|
-
return (jsxs("span", { children: [index === 0 ? '' : ', ', formatOptionLabel
|
|
20669
|
-
? formatOptionLabel(ele)
|
|
20670
|
-
: ele[fieldLabel ?? 'label']] }, index));
|
|
20631
|
+
return (jsxs("span", { children: [index === 0 ? '' : ', ', formatOptionLabel ? formatOptionLabel(ele) : ele[fieldLabel ?? 'label']] }, index));
|
|
20671
20632
|
}) })) : (jsxs("div", { className: classNames$1('select-value', {
|
|
20672
|
-
'd-none': searchTerm
|
|
20673
|
-
}), children: [value
|
|
20674
|
-
? formatOptionLabel
|
|
20675
|
-
? formatOptionLabel(value)
|
|
20676
|
-
: value[fieldLabel ?? 'label']
|
|
20677
|
-
: '', ' '] })), !((isMulti ? value?.length > 0 : value) ||
|
|
20678
|
-
isDisabled ||
|
|
20679
|
-
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) => {
|
|
20633
|
+
'd-none': searchTerm
|
|
20634
|
+
}), children: [value ? (formatOptionLabel ? formatOptionLabel(value) : value[fieldLabel ?? 'label']) : '', ' '] })), !((isMulti ? value?.length > 0 : value) || isDisabled || 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) => {
|
|
20680
20635
|
if (val.target.value) {
|
|
20681
20636
|
if (loadOptions && val.target.value) {
|
|
20682
20637
|
setIsLoading(true);
|
|
@@ -20698,23 +20653,21 @@ const SelectTable = forwardRef((props, ref) => {
|
|
|
20698
20653
|
width: width ? width + 2 : 'min-content',
|
|
20699
20654
|
position: 'fixed',
|
|
20700
20655
|
borderRadius: 4,
|
|
20701
|
-
zIndex: 9999
|
|
20656
|
+
zIndex: 9999
|
|
20702
20657
|
}, 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) => {
|
|
20703
20658
|
if (!isDisabled) {
|
|
20704
20659
|
inputRef?.current.focus();
|
|
20705
20660
|
e.preventDefault();
|
|
20706
20661
|
}
|
|
20707
20662
|
}, children: jsxs("div", { className: "r-select-grid", children: [jsx("div", { className: classNames$1('r-select-gridtable', {
|
|
20708
|
-
'no-header': noHeader || (columns?.length ?? 0) === 0
|
|
20663
|
+
'no-header': noHeader || (columns?.length ?? 0) === 0
|
|
20709
20664
|
}), ref: selectMenuTableRef, style: {
|
|
20710
20665
|
width: menuWidth,
|
|
20711
20666
|
minWidth: selectTableRef?.current?.clientWidth,
|
|
20712
|
-
maxHeight: maxHeight ?? defaultMaxHeight$1
|
|
20667
|
+
maxHeight: maxHeight ?? defaultMaxHeight$1
|
|
20713
20668
|
}, 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', {
|
|
20714
|
-
'd-none': !(showFooter === true ||
|
|
20715
|
-
|
|
20716
|
-
isMulti),
|
|
20717
|
-
}), 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] })] }) })) }) })] }) }) }));
|
|
20669
|
+
'd-none': !(showFooter === true || handleAdd || isMulti)
|
|
20670
|
+
}), 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] })] }) })) }) })] }) }) }));
|
|
20718
20671
|
});
|
|
20719
20672
|
|
|
20720
20673
|
const PagingComponent = ({ totalItem, gridRef, pageSize, currentPage, onChangePage, pageOptions, onChangePageSize }) => {
|
|
@@ -25640,6 +25593,72 @@ function startOfYear(date, options) {
|
|
|
25640
25593
|
return date_;
|
|
25641
25594
|
}
|
|
25642
25595
|
|
|
25596
|
+
/**
|
|
25597
|
+
* The {@link eachYearOfInterval} function options.
|
|
25598
|
+
*/
|
|
25599
|
+
|
|
25600
|
+
/**
|
|
25601
|
+
* The {@link eachYearOfInterval} function result type. It resolves the proper data type.
|
|
25602
|
+
* It uses the first argument date object type, starting from the date argument,
|
|
25603
|
+
* then the start interval date, and finally the end interval date. If
|
|
25604
|
+
* a context function is passed, it uses the context function return type.
|
|
25605
|
+
*/
|
|
25606
|
+
|
|
25607
|
+
/**
|
|
25608
|
+
* @name eachYearOfInterval
|
|
25609
|
+
* @category Interval Helpers
|
|
25610
|
+
* @summary Return the array of yearly timestamps within the specified time interval.
|
|
25611
|
+
*
|
|
25612
|
+
* @description
|
|
25613
|
+
* Return the array of yearly timestamps within the specified time interval.
|
|
25614
|
+
*
|
|
25615
|
+
* @typeParam IntervalType - Interval type.
|
|
25616
|
+
* @typeParam Options - Options type.
|
|
25617
|
+
*
|
|
25618
|
+
* @param interval - The interval.
|
|
25619
|
+
* @param options - An object with options.
|
|
25620
|
+
*
|
|
25621
|
+
* @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
|
|
25622
|
+
*
|
|
25623
|
+
* @example
|
|
25624
|
+
* // Each year between 6 February 2014 and 10 August 2017:
|
|
25625
|
+
* const result = eachYearOfInterval({
|
|
25626
|
+
* start: new Date(2014, 1, 6),
|
|
25627
|
+
* end: new Date(2017, 7, 10)
|
|
25628
|
+
* })
|
|
25629
|
+
* //=> [
|
|
25630
|
+
* // Wed Jan 01 2014 00:00:00,
|
|
25631
|
+
* // Thu Jan 01 2015 00:00:00,
|
|
25632
|
+
* // Fri Jan 01 2016 00:00:00,
|
|
25633
|
+
* // Sun Jan 01 2017 00:00:00
|
|
25634
|
+
* // ]
|
|
25635
|
+
*/
|
|
25636
|
+
function eachYearOfInterval(interval, options) {
|
|
25637
|
+
const { start, end } = normalizeInterval(options?.in, interval);
|
|
25638
|
+
|
|
25639
|
+
let reversed = +start > +end;
|
|
25640
|
+
const endTime = reversed ? +start : +end;
|
|
25641
|
+
const date = reversed ? end : start;
|
|
25642
|
+
date.setHours(0, 0, 0, 0);
|
|
25643
|
+
date.setMonth(0, 1);
|
|
25644
|
+
|
|
25645
|
+
let step = options?.step ?? 1;
|
|
25646
|
+
if (!step) return [];
|
|
25647
|
+
if (step < 0) {
|
|
25648
|
+
step = -step;
|
|
25649
|
+
reversed = !reversed;
|
|
25650
|
+
}
|
|
25651
|
+
|
|
25652
|
+
const dates = [];
|
|
25653
|
+
|
|
25654
|
+
while (+date <= endTime) {
|
|
25655
|
+
dates.push(constructFrom(start, date));
|
|
25656
|
+
date.setFullYear(date.getFullYear() + step);
|
|
25657
|
+
}
|
|
25658
|
+
|
|
25659
|
+
return reversed ? dates.reverse() : dates;
|
|
25660
|
+
}
|
|
25661
|
+
|
|
25643
25662
|
/**
|
|
25644
25663
|
* The {@link endOfWeek} function options.
|
|
25645
25664
|
*/
|
|
@@ -26348,7 +26367,7 @@ const match = {
|
|
|
26348
26367
|
* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
|
|
26349
26368
|
* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
|
|
26350
26369
|
*/
|
|
26351
|
-
const enUS = {
|
|
26370
|
+
const enUS$1 = {
|
|
26352
26371
|
code: "en-US",
|
|
26353
26372
|
formatDistance: formatDistance,
|
|
26354
26373
|
formatLong: formatLong,
|
|
@@ -27865,7 +27884,7 @@ const unescapedLatinCharacterRegExp$1 = /[a-zA-Z]/;
|
|
|
27865
27884
|
*/
|
|
27866
27885
|
function format(date, formatStr, options) {
|
|
27867
27886
|
const defaultOptions = getDefaultOptions$1();
|
|
27868
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
27887
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS$1;
|
|
27869
27888
|
|
|
27870
27889
|
const firstWeekContainsDate =
|
|
27871
27890
|
options?.firstWeekContainsDate ??
|
|
@@ -30558,7 +30577,7 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
30558
30577
|
function parse(dateStr, formatStr, referenceDate, options) {
|
|
30559
30578
|
const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);
|
|
30560
30579
|
const defaultOptions = getDefaultOptions();
|
|
30561
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
30580
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS$1;
|
|
30562
30581
|
|
|
30563
30582
|
const firstWeekContainsDate =
|
|
30564
30583
|
options?.firstWeekContainsDate ??
|
|
@@ -31364,6 +31383,69 @@ function endOfBroadcastWeek(date, dateLib) {
|
|
|
31364
31383
|
return endDate;
|
|
31365
31384
|
}
|
|
31366
31385
|
|
|
31386
|
+
/** English (United States) locale extended with DayPicker-specific translations. */
|
|
31387
|
+
const enUS = {
|
|
31388
|
+
...enUS$1,
|
|
31389
|
+
labels: {
|
|
31390
|
+
labelDayButton: (date, modifiers, options, dateLib) => {
|
|
31391
|
+
let formatDate;
|
|
31392
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31393
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31394
|
+
}
|
|
31395
|
+
else {
|
|
31396
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31397
|
+
}
|
|
31398
|
+
let label = formatDate(date, "PPPP");
|
|
31399
|
+
if (modifiers.today)
|
|
31400
|
+
label = `Today, ${label}`;
|
|
31401
|
+
if (modifiers.selected)
|
|
31402
|
+
label = `${label}, selected`;
|
|
31403
|
+
return label;
|
|
31404
|
+
},
|
|
31405
|
+
labelMonthDropdown: "Choose the Month",
|
|
31406
|
+
labelNext: "Go to the Next Month",
|
|
31407
|
+
labelPrevious: "Go to the Previous Month",
|
|
31408
|
+
labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
|
|
31409
|
+
labelYearDropdown: "Choose the Year",
|
|
31410
|
+
labelGrid: (date, options, dateLib) => {
|
|
31411
|
+
let formatDate;
|
|
31412
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31413
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31414
|
+
}
|
|
31415
|
+
else {
|
|
31416
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31417
|
+
}
|
|
31418
|
+
return formatDate(date, "LLLL yyyy");
|
|
31419
|
+
},
|
|
31420
|
+
labelGridcell: (date, modifiers, options, dateLib) => {
|
|
31421
|
+
let formatDate;
|
|
31422
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31423
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31424
|
+
}
|
|
31425
|
+
else {
|
|
31426
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31427
|
+
}
|
|
31428
|
+
let label = formatDate(date, "PPPP");
|
|
31429
|
+
if (modifiers?.today) {
|
|
31430
|
+
label = `Today, ${label}`;
|
|
31431
|
+
}
|
|
31432
|
+
return label;
|
|
31433
|
+
},
|
|
31434
|
+
labelNav: "Navigation bar",
|
|
31435
|
+
labelWeekNumberHeader: "Week Number",
|
|
31436
|
+
labelWeekday: (date, options, dateLib) => {
|
|
31437
|
+
let formatDate;
|
|
31438
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31439
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31440
|
+
}
|
|
31441
|
+
else {
|
|
31442
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31443
|
+
}
|
|
31444
|
+
return formatDate(date, "cccc");
|
|
31445
|
+
},
|
|
31446
|
+
},
|
|
31447
|
+
};
|
|
31448
|
+
|
|
31367
31449
|
/**
|
|
31368
31450
|
* A wrapper class around [date-fns](http://date-fns.org) that provides utility
|
|
31369
31451
|
* methods for date manipulation and formatting.
|
|
@@ -31502,6 +31584,31 @@ class DateLib {
|
|
|
31502
31584
|
? this.overrides.eachMonthOfInterval(interval)
|
|
31503
31585
|
: eachMonthOfInterval(interval);
|
|
31504
31586
|
};
|
|
31587
|
+
/**
|
|
31588
|
+
* Returns the years between the given dates.
|
|
31589
|
+
*
|
|
31590
|
+
* @since 9.11.1
|
|
31591
|
+
* @param interval The interval to get the years for.
|
|
31592
|
+
* @returns The array of years in the interval.
|
|
31593
|
+
*/
|
|
31594
|
+
this.eachYearOfInterval = (interval) => {
|
|
31595
|
+
const years = this.overrides?.eachYearOfInterval
|
|
31596
|
+
? this.overrides.eachYearOfInterval(interval)
|
|
31597
|
+
: eachYearOfInterval(interval);
|
|
31598
|
+
// Remove duplicates that may happen across DST transitions (e.g., "America/Sao_Paulo")
|
|
31599
|
+
// See https://github.com/date-fns/tz/issues/72
|
|
31600
|
+
const uniqueYears = new Set(years.map((d) => this.getYear(d)));
|
|
31601
|
+
if (uniqueYears.size === years.length) {
|
|
31602
|
+
// No duplicates, return as is
|
|
31603
|
+
return years;
|
|
31604
|
+
}
|
|
31605
|
+
// Rebuild the array to ensure one date per year
|
|
31606
|
+
const yearsArray = [];
|
|
31607
|
+
uniqueYears.forEach((y) => {
|
|
31608
|
+
yearsArray.push(new Date(y, 0, 1));
|
|
31609
|
+
});
|
|
31610
|
+
return yearsArray;
|
|
31611
|
+
};
|
|
31505
31612
|
/**
|
|
31506
31613
|
* Returns the end of the broadcast week for the given date.
|
|
31507
31614
|
*
|
|
@@ -31840,7 +31947,63 @@ class DateLib {
|
|
|
31840
31947
|
formatNumber(value) {
|
|
31841
31948
|
return this.replaceDigits(value.toString());
|
|
31842
31949
|
}
|
|
31843
|
-
|
|
31950
|
+
/**
|
|
31951
|
+
* Returns the preferred ordering for month and year labels for the current
|
|
31952
|
+
* locale.
|
|
31953
|
+
*/
|
|
31954
|
+
getMonthYearOrder() {
|
|
31955
|
+
const code = this.options.locale?.code;
|
|
31956
|
+
if (!code) {
|
|
31957
|
+
return "month-first";
|
|
31958
|
+
}
|
|
31959
|
+
return DateLib.yearFirstLocales.has(code) ? "year-first" : "month-first";
|
|
31960
|
+
}
|
|
31961
|
+
/**
|
|
31962
|
+
* Formats the month/year pair respecting locale conventions.
|
|
31963
|
+
*
|
|
31964
|
+
* @since 9.11.0
|
|
31965
|
+
*/
|
|
31966
|
+
formatMonthYear(date) {
|
|
31967
|
+
const { locale, timeZone, numerals } = this.options;
|
|
31968
|
+
const localeCode = locale?.code;
|
|
31969
|
+
if (localeCode && DateLib.yearFirstLocales.has(localeCode)) {
|
|
31970
|
+
try {
|
|
31971
|
+
const intl = new Intl.DateTimeFormat(localeCode, {
|
|
31972
|
+
month: "long",
|
|
31973
|
+
year: "numeric",
|
|
31974
|
+
timeZone,
|
|
31975
|
+
numberingSystem: numerals,
|
|
31976
|
+
});
|
|
31977
|
+
const formatted = intl.format(date);
|
|
31978
|
+
return formatted;
|
|
31979
|
+
}
|
|
31980
|
+
catch {
|
|
31981
|
+
// Fallback to date-fns formatting below.
|
|
31982
|
+
}
|
|
31983
|
+
}
|
|
31984
|
+
const pattern = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
31985
|
+
return this.format(date, pattern);
|
|
31986
|
+
}
|
|
31987
|
+
}
|
|
31988
|
+
DateLib.yearFirstLocales = new Set([
|
|
31989
|
+
"eu",
|
|
31990
|
+
"hu",
|
|
31991
|
+
"ja",
|
|
31992
|
+
"ja-Hira",
|
|
31993
|
+
"ja-JP",
|
|
31994
|
+
"ko",
|
|
31995
|
+
"ko-KR",
|
|
31996
|
+
"lt",
|
|
31997
|
+
"lt-LT",
|
|
31998
|
+
"lv",
|
|
31999
|
+
"lv-LV",
|
|
32000
|
+
"mn",
|
|
32001
|
+
"mn-MN",
|
|
32002
|
+
"zh",
|
|
32003
|
+
"zh-CN",
|
|
32004
|
+
"zh-HK",
|
|
32005
|
+
"zh-TW",
|
|
32006
|
+
]);
|
|
31844
32007
|
/**
|
|
31845
32008
|
* The default date library with English locale.
|
|
31846
32009
|
*
|
|
@@ -31861,6 +32024,9 @@ class CalendarDay {
|
|
|
31861
32024
|
this.displayMonth = displayMonth;
|
|
31862
32025
|
this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
|
|
31863
32026
|
this.dateLib = dateLib;
|
|
32027
|
+
this.isoDate = dateLib.format(date, "yyyy-MM-dd");
|
|
32028
|
+
this.displayMonthId = dateLib.format(displayMonth, "yyyy-MM");
|
|
32029
|
+
this.dateMonthId = dateLib.format(date, "yyyy-MM");
|
|
31864
32030
|
}
|
|
31865
32031
|
/**
|
|
31866
32032
|
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
@@ -32036,7 +32202,7 @@ var UI;
|
|
|
32036
32202
|
/** The dropdown with the years. */
|
|
32037
32203
|
UI["YearsDropdown"] = "years_dropdown";
|
|
32038
32204
|
})(UI || (UI = {}));
|
|
32039
|
-
/** Enum representing flags for the {@link UI.Day} element. */
|
|
32205
|
+
/** Enum representing flags for the {@link UI | UI.Day} element. */
|
|
32040
32206
|
var DayFlag;
|
|
32041
32207
|
(function (DayFlag) {
|
|
32042
32208
|
/** The day is disabled. */
|
|
@@ -32051,8 +32217,8 @@ var DayFlag;
|
|
|
32051
32217
|
DayFlag["today"] = "today";
|
|
32052
32218
|
})(DayFlag || (DayFlag = {}));
|
|
32053
32219
|
/**
|
|
32054
|
-
* Enum representing selection states that can be applied to the
|
|
32055
|
-
* element in selection mode.
|
|
32220
|
+
* Enum representing selection states that can be applied to the
|
|
32221
|
+
* {@link UI | UI.Day} element in selection mode.
|
|
32056
32222
|
*/
|
|
32057
32223
|
var SelectionState;
|
|
32058
32224
|
(function (SelectionState) {
|
|
@@ -32502,7 +32668,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32502
32668
|
return isSameDay(date, matcher);
|
|
32503
32669
|
}
|
|
32504
32670
|
if (isDatesArray(matcher, dateLib)) {
|
|
32505
|
-
return matcher.
|
|
32671
|
+
return matcher.some((matcherDate) => isSameDay(date, matcherDate));
|
|
32506
32672
|
}
|
|
32507
32673
|
if (isDateRange(matcher)) {
|
|
32508
32674
|
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
@@ -32553,7 +32719,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32553
32719
|
* @returns A function that retrieves the modifiers for a given `CalendarDay`.
|
|
32554
32720
|
*/
|
|
32555
32721
|
function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
32556
|
-
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today, } = props;
|
|
32722
|
+
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today = dateLib.today(), } = props;
|
|
32557
32723
|
const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter, } = dateLib;
|
|
32558
32724
|
const computedNavStart = navStart && startOfMonth(navStart);
|
|
32559
32725
|
const computedNavEnd = navEnd && endOfMonth(navEnd);
|
|
@@ -32577,7 +32743,7 @@ function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
|
32577
32743
|
// Broadcast calendar will show outside days as default
|
|
32578
32744
|
(!broadcastCalendar && !showOutsideDays && isOutside) ||
|
|
32579
32745
|
(broadcastCalendar && showOutsideDays === false && isOutside);
|
|
32580
|
-
const isToday = isSameDay(date, today
|
|
32746
|
+
const isToday = isSameDay(date, today);
|
|
32581
32747
|
if (isOutside)
|
|
32582
32748
|
internalModifiersMap.outside.push(day);
|
|
32583
32749
|
if (isDisabled)
|
|
@@ -32736,7 +32902,7 @@ function getDefaultClassNames() {
|
|
|
32736
32902
|
/**
|
|
32737
32903
|
* Formats the caption of the month.
|
|
32738
32904
|
*
|
|
32739
|
-
* @defaultValue
|
|
32905
|
+
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
|
|
32740
32906
|
* @param month The date representing the month.
|
|
32741
32907
|
* @param options Configuration options for the date library.
|
|
32742
32908
|
* @param dateLib The date library to use for formatting. If not provided, a new
|
|
@@ -32746,7 +32912,8 @@ function getDefaultClassNames() {
|
|
|
32746
32912
|
* @see https://daypicker.dev/docs/translation#custom-formatters
|
|
32747
32913
|
*/
|
|
32748
32914
|
function formatCaption(month, options, dateLib) {
|
|
32749
|
-
|
|
32915
|
+
const lib = dateLib ?? new DateLib(options);
|
|
32916
|
+
return lib.formatMonthYear(month);
|
|
32750
32917
|
}
|
|
32751
32918
|
/**
|
|
32752
32919
|
* @private
|
|
@@ -32886,127 +33053,6 @@ function getFormatters(customFormatters) {
|
|
|
32886
33053
|
};
|
|
32887
33054
|
}
|
|
32888
33055
|
|
|
32889
|
-
/**
|
|
32890
|
-
* Returns the months to show in the dropdown.
|
|
32891
|
-
*
|
|
32892
|
-
* This function generates a list of months for the current year, formatted
|
|
32893
|
-
* using the provided formatter, and determines whether each month should be
|
|
32894
|
-
* disabled based on the navigation range.
|
|
32895
|
-
*
|
|
32896
|
-
* @param displayMonth The currently displayed month.
|
|
32897
|
-
* @param navStart The start date for navigation.
|
|
32898
|
-
* @param navEnd The end date for navigation.
|
|
32899
|
-
* @param formatters The formatters to use for formatting the month labels.
|
|
32900
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32901
|
-
* @returns An array of dropdown options representing the months, or `undefined`
|
|
32902
|
-
* if no months are available.
|
|
32903
|
-
*/
|
|
32904
|
-
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
32905
|
-
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
32906
|
-
const months = eachMonthOfInterval({
|
|
32907
|
-
start: startOfYear(displayMonth),
|
|
32908
|
-
end: endOfYear(displayMonth),
|
|
32909
|
-
});
|
|
32910
|
-
const options = months.map((month) => {
|
|
32911
|
-
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
32912
|
-
const value = getMonth(month);
|
|
32913
|
-
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
32914
|
-
(navEnd && month > startOfMonth(navEnd)) ||
|
|
32915
|
-
false;
|
|
32916
|
-
return { value, label, disabled };
|
|
32917
|
-
});
|
|
32918
|
-
return options;
|
|
32919
|
-
}
|
|
32920
|
-
|
|
32921
|
-
/**
|
|
32922
|
-
* Returns the computed style for a day based on its modifiers.
|
|
32923
|
-
*
|
|
32924
|
-
* This function merges the base styles for the day with any styles associated
|
|
32925
|
-
* with active modifiers.
|
|
32926
|
-
*
|
|
32927
|
-
* @param dayModifiers The modifiers applied to the day.
|
|
32928
|
-
* @param styles The base styles for the calendar elements.
|
|
32929
|
-
* @param modifiersStyles The styles associated with specific modifiers.
|
|
32930
|
-
* @returns The computed style for the day.
|
|
32931
|
-
*/
|
|
32932
|
-
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
32933
|
-
let style = { ...styles?.[UI.Day] };
|
|
32934
|
-
Object.entries(dayModifiers)
|
|
32935
|
-
.filter(([, active]) => active === true)
|
|
32936
|
-
.forEach(([modifier]) => {
|
|
32937
|
-
style = {
|
|
32938
|
-
...style,
|
|
32939
|
-
...modifiersStyles?.[modifier],
|
|
32940
|
-
};
|
|
32941
|
-
});
|
|
32942
|
-
return style;
|
|
32943
|
-
}
|
|
32944
|
-
|
|
32945
|
-
/**
|
|
32946
|
-
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
32947
|
-
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
32948
|
-
*
|
|
32949
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32950
|
-
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
32951
|
-
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
32952
|
-
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
32953
|
-
* @returns An array of 7 dates representing the weekdays.
|
|
32954
|
-
*/
|
|
32955
|
-
function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {
|
|
32956
|
-
const today = dateLib.today();
|
|
32957
|
-
const start = broadcastCalendar
|
|
32958
|
-
? dateLib.startOfBroadcastWeek(today, dateLib)
|
|
32959
|
-
: ISOWeek
|
|
32960
|
-
? dateLib.startOfISOWeek(today)
|
|
32961
|
-
: dateLib.startOfWeek(today);
|
|
32962
|
-
const days = [];
|
|
32963
|
-
for (let i = 0; i < 7; i++) {
|
|
32964
|
-
const day = dateLib.addDays(start, i);
|
|
32965
|
-
days.push(day);
|
|
32966
|
-
}
|
|
32967
|
-
return days;
|
|
32968
|
-
}
|
|
32969
|
-
|
|
32970
|
-
/**
|
|
32971
|
-
* Returns the years to display in the dropdown.
|
|
32972
|
-
*
|
|
32973
|
-
* This function generates a list of years between the navigation start and end
|
|
32974
|
-
* dates, formatted using the provided formatter.
|
|
32975
|
-
*
|
|
32976
|
-
* @param navStart The start date for navigation.
|
|
32977
|
-
* @param navEnd The end date for navigation.
|
|
32978
|
-
* @param formatters The formatters to use for formatting the year labels.
|
|
32979
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32980
|
-
* @param reverse If true, reverses the order of the years (descending).
|
|
32981
|
-
* @returns An array of dropdown options representing the years, or `undefined`
|
|
32982
|
-
* if `navStart` or `navEnd` is not provided.
|
|
32983
|
-
*/
|
|
32984
|
-
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
32985
|
-
if (!navStart)
|
|
32986
|
-
return undefined;
|
|
32987
|
-
if (!navEnd)
|
|
32988
|
-
return undefined;
|
|
32989
|
-
const { startOfYear, endOfYear, addYears, getYear, isBefore, isSameYear } = dateLib;
|
|
32990
|
-
const firstNavYear = startOfYear(navStart);
|
|
32991
|
-
const lastNavYear = endOfYear(navEnd);
|
|
32992
|
-
const years = [];
|
|
32993
|
-
let year = firstNavYear;
|
|
32994
|
-
while (isBefore(year, lastNavYear) || isSameYear(year, lastNavYear)) {
|
|
32995
|
-
years.push(year);
|
|
32996
|
-
year = addYears(year, 1);
|
|
32997
|
-
}
|
|
32998
|
-
if (reverse)
|
|
32999
|
-
years.reverse();
|
|
33000
|
-
return years.map((year) => {
|
|
33001
|
-
const label = formatters.formatYearDropdown(year, dateLib);
|
|
33002
|
-
return {
|
|
33003
|
-
value: getYear(year),
|
|
33004
|
-
label,
|
|
33005
|
-
disabled: false,
|
|
33006
|
-
};
|
|
33007
|
-
});
|
|
33008
|
-
}
|
|
33009
|
-
|
|
33010
33056
|
/**
|
|
33011
33057
|
* Generates the ARIA label for a day button.
|
|
33012
33058
|
*
|
|
@@ -33040,7 +33086,7 @@ const labelDay = labelDayButton;
|
|
|
33040
33086
|
* Generates the ARIA label for the month grid, which is announced when entering
|
|
33041
33087
|
* the grid.
|
|
33042
33088
|
*
|
|
33043
|
-
* @defaultValue
|
|
33089
|
+
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
|
|
33044
33090
|
* @param date - The date representing the month.
|
|
33045
33091
|
* @param options - Optional configuration for the date formatting library.
|
|
33046
33092
|
* @param dateLib - An optional instance of the date formatting library.
|
|
@@ -33049,7 +33095,8 @@ const labelDay = labelDayButton;
|
|
|
33049
33095
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
33050
33096
|
*/
|
|
33051
33097
|
function labelGrid(date, options, dateLib) {
|
|
33052
|
-
|
|
33098
|
+
const lib = dateLib ?? new DateLib(options);
|
|
33099
|
+
return lib.formatMonthYear(date);
|
|
33053
33100
|
}
|
|
33054
33101
|
/**
|
|
33055
33102
|
* @ignore
|
|
@@ -33101,6 +33148,7 @@ function labelNav() {
|
|
|
33101
33148
|
return "";
|
|
33102
33149
|
}
|
|
33103
33150
|
|
|
33151
|
+
const defaultLabel = "Go to the Next Month";
|
|
33104
33152
|
/**
|
|
33105
33153
|
* Generates the ARIA label for the "next month" button.
|
|
33106
33154
|
*
|
|
@@ -33111,8 +33159,8 @@ function labelNav() {
|
|
|
33111
33159
|
* @group Labels
|
|
33112
33160
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
33113
33161
|
*/
|
|
33114
|
-
function labelNext(_month) {
|
|
33115
|
-
return
|
|
33162
|
+
function labelNext(_month, _options) {
|
|
33163
|
+
return defaultLabel;
|
|
33116
33164
|
}
|
|
33117
33165
|
|
|
33118
33166
|
/**
|
|
@@ -33201,6 +33249,316 @@ var defaultLabels = /*#__PURE__*/Object.freeze({
|
|
|
33201
33249
|
labelYearDropdown: labelYearDropdown
|
|
33202
33250
|
});
|
|
33203
33251
|
|
|
33252
|
+
const resolveLabel = (defaultLabel, customLabel, localeLabel) => {
|
|
33253
|
+
if (customLabel)
|
|
33254
|
+
return customLabel;
|
|
33255
|
+
if (localeLabel) {
|
|
33256
|
+
return (typeof localeLabel === "function"
|
|
33257
|
+
? localeLabel
|
|
33258
|
+
: (..._args) => localeLabel);
|
|
33259
|
+
}
|
|
33260
|
+
return defaultLabel;
|
|
33261
|
+
};
|
|
33262
|
+
/**
|
|
33263
|
+
* Merges custom labels from the props with the default labels.
|
|
33264
|
+
*
|
|
33265
|
+
* When available, uses the locale-provided translation for `labelNext`.
|
|
33266
|
+
*
|
|
33267
|
+
* @param customLabels The custom labels provided in the DayPicker props.
|
|
33268
|
+
* @param options Options from the date library, used to resolve locale
|
|
33269
|
+
* translations.
|
|
33270
|
+
* @returns The merged labels object with locale-aware defaults.
|
|
33271
|
+
*/
|
|
33272
|
+
function getLabels(customLabels, options) {
|
|
33273
|
+
const localeLabels = options.locale?.labels ?? {};
|
|
33274
|
+
return {
|
|
33275
|
+
...defaultLabels,
|
|
33276
|
+
...(customLabels ?? {}),
|
|
33277
|
+
labelDayButton: resolveLabel(labelDayButton, customLabels?.labelDayButton, localeLabels.labelDayButton),
|
|
33278
|
+
labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels?.labelMonthDropdown, localeLabels.labelMonthDropdown),
|
|
33279
|
+
labelNext: resolveLabel(labelNext, customLabels?.labelNext, localeLabels.labelNext),
|
|
33280
|
+
labelPrevious: resolveLabel(labelPrevious, customLabels?.labelPrevious, localeLabels.labelPrevious),
|
|
33281
|
+
labelWeekNumber: resolveLabel(labelWeekNumber, customLabels?.labelWeekNumber, localeLabels.labelWeekNumber),
|
|
33282
|
+
labelYearDropdown: resolveLabel(labelYearDropdown, customLabels?.labelYearDropdown, localeLabels.labelYearDropdown),
|
|
33283
|
+
labelGrid: resolveLabel(labelGrid, customLabels?.labelGrid, localeLabels.labelGrid),
|
|
33284
|
+
labelGridcell: resolveLabel(labelGridcell, customLabels?.labelGridcell, localeLabels.labelGridcell),
|
|
33285
|
+
labelNav: resolveLabel(labelNav, customLabels?.labelNav, localeLabels.labelNav),
|
|
33286
|
+
labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels?.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
|
|
33287
|
+
labelWeekday: resolveLabel(labelWeekday, customLabels?.labelWeekday, localeLabels.labelWeekday),
|
|
33288
|
+
};
|
|
33289
|
+
}
|
|
33290
|
+
|
|
33291
|
+
/**
|
|
33292
|
+
* Returns the months to show in the dropdown.
|
|
33293
|
+
*
|
|
33294
|
+
* This function generates a list of months for the current year, formatted
|
|
33295
|
+
* using the provided formatter, and determines whether each month should be
|
|
33296
|
+
* disabled based on the navigation range.
|
|
33297
|
+
*
|
|
33298
|
+
* @param displayMonth The currently displayed month.
|
|
33299
|
+
* @param navStart The start date for navigation.
|
|
33300
|
+
* @param navEnd The end date for navigation.
|
|
33301
|
+
* @param formatters The formatters to use for formatting the month labels.
|
|
33302
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33303
|
+
* @returns An array of dropdown options representing the months, or `undefined`
|
|
33304
|
+
* if no months are available.
|
|
33305
|
+
*/
|
|
33306
|
+
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
33307
|
+
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
33308
|
+
const months = eachMonthOfInterval({
|
|
33309
|
+
start: startOfYear(displayMonth),
|
|
33310
|
+
end: endOfYear(displayMonth),
|
|
33311
|
+
});
|
|
33312
|
+
const options = months.map((month) => {
|
|
33313
|
+
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
33314
|
+
const value = getMonth(month);
|
|
33315
|
+
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
33316
|
+
(navEnd && month > startOfMonth(navEnd)) ||
|
|
33317
|
+
false;
|
|
33318
|
+
return { value, label, disabled };
|
|
33319
|
+
});
|
|
33320
|
+
return options;
|
|
33321
|
+
}
|
|
33322
|
+
|
|
33323
|
+
/**
|
|
33324
|
+
* Returns the computed style for a day based on its modifiers.
|
|
33325
|
+
*
|
|
33326
|
+
* This function merges the base styles for the day with any styles associated
|
|
33327
|
+
* with active modifiers.
|
|
33328
|
+
*
|
|
33329
|
+
* @param dayModifiers The modifiers applied to the day.
|
|
33330
|
+
* @param styles The base styles for the calendar elements.
|
|
33331
|
+
* @param modifiersStyles The styles associated with specific modifiers.
|
|
33332
|
+
* @returns The computed style for the day.
|
|
33333
|
+
*/
|
|
33334
|
+
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
33335
|
+
let style = { ...styles?.[UI.Day] };
|
|
33336
|
+
Object.entries(dayModifiers)
|
|
33337
|
+
.filter(([, active]) => active === true)
|
|
33338
|
+
.forEach(([modifier]) => {
|
|
33339
|
+
style = {
|
|
33340
|
+
...style,
|
|
33341
|
+
...modifiersStyles?.[modifier],
|
|
33342
|
+
};
|
|
33343
|
+
});
|
|
33344
|
+
return style;
|
|
33345
|
+
}
|
|
33346
|
+
|
|
33347
|
+
/**
|
|
33348
|
+
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
33349
|
+
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
33350
|
+
*
|
|
33351
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33352
|
+
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
33353
|
+
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
33354
|
+
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
33355
|
+
* @returns An array of 7 dates representing the weekdays.
|
|
33356
|
+
*/
|
|
33357
|
+
function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
|
|
33358
|
+
const referenceToday = today ?? dateLib.today();
|
|
33359
|
+
const start = broadcastCalendar
|
|
33360
|
+
? dateLib.startOfBroadcastWeek(referenceToday, dateLib)
|
|
33361
|
+
: ISOWeek
|
|
33362
|
+
? dateLib.startOfISOWeek(referenceToday)
|
|
33363
|
+
: dateLib.startOfWeek(referenceToday);
|
|
33364
|
+
const days = [];
|
|
33365
|
+
for (let i = 0; i < 7; i++) {
|
|
33366
|
+
const day = dateLib.addDays(start, i);
|
|
33367
|
+
days.push(day);
|
|
33368
|
+
}
|
|
33369
|
+
return days;
|
|
33370
|
+
}
|
|
33371
|
+
|
|
33372
|
+
/**
|
|
33373
|
+
* Returns the years to display in the dropdown.
|
|
33374
|
+
*
|
|
33375
|
+
* This function generates a list of years between the navigation start and end
|
|
33376
|
+
* dates, formatted using the provided formatter.
|
|
33377
|
+
*
|
|
33378
|
+
* @param navStart The start date for navigation.
|
|
33379
|
+
* @param navEnd The end date for navigation.
|
|
33380
|
+
* @param formatters The formatters to use for formatting the year labels.
|
|
33381
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33382
|
+
* @param reverse If true, reverses the order of the years (descending).
|
|
33383
|
+
* @returns An array of dropdown options representing the years, or `undefined`
|
|
33384
|
+
* if `navStart` or `navEnd` is not provided.
|
|
33385
|
+
*/
|
|
33386
|
+
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
33387
|
+
if (!navStart)
|
|
33388
|
+
return undefined;
|
|
33389
|
+
if (!navEnd)
|
|
33390
|
+
return undefined;
|
|
33391
|
+
const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
|
|
33392
|
+
const firstNavYear = startOfYear(navStart);
|
|
33393
|
+
const lastNavYear = endOfYear(navEnd);
|
|
33394
|
+
const years = eachYearOfInterval({ start: firstNavYear, end: lastNavYear });
|
|
33395
|
+
if (reverse)
|
|
33396
|
+
years.reverse();
|
|
33397
|
+
return years.map((year) => {
|
|
33398
|
+
const label = formatters.formatYearDropdown(year, dateLib);
|
|
33399
|
+
return {
|
|
33400
|
+
value: getYear(year),
|
|
33401
|
+
label,
|
|
33402
|
+
disabled: false,
|
|
33403
|
+
};
|
|
33404
|
+
});
|
|
33405
|
+
}
|
|
33406
|
+
|
|
33407
|
+
/**
|
|
33408
|
+
* Creates `dateLib` overrides that keep all calendar math at noon in the target
|
|
33409
|
+
* time zone. This avoids second-level offset changes (e.g., historical zones
|
|
33410
|
+
* with +03:41:12) from pushing dates backward across midnight.
|
|
33411
|
+
*/
|
|
33412
|
+
function createNoonOverrides(timeZone, options = {}) {
|
|
33413
|
+
const { weekStartsOn, locale } = options;
|
|
33414
|
+
const fallbackWeekStartsOn = (weekStartsOn ??
|
|
33415
|
+
locale?.options?.weekStartsOn ??
|
|
33416
|
+
0);
|
|
33417
|
+
// Keep all internal math anchored at noon in the target zone to avoid
|
|
33418
|
+
// historical second-level offsets from crossing midnight.
|
|
33419
|
+
const toNoonTZDate = (date) => {
|
|
33420
|
+
const normalizedDate = typeof date === "number" || typeof date === "string"
|
|
33421
|
+
? new Date(date)
|
|
33422
|
+
: date;
|
|
33423
|
+
return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
|
|
33424
|
+
};
|
|
33425
|
+
// Convert a value into a host `Date` that represents the same calendar day
|
|
33426
|
+
// as the target-zone noon. This is useful for helpers (e.g., date-fns week
|
|
33427
|
+
// utilities) that expect local `Date` instances rather than `TZDate`s.
|
|
33428
|
+
const toCalendarDate = (date) => {
|
|
33429
|
+
const zoned = toNoonTZDate(date);
|
|
33430
|
+
return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
|
|
33431
|
+
};
|
|
33432
|
+
return {
|
|
33433
|
+
today: () => {
|
|
33434
|
+
return toNoonTZDate(TZDate.tz(timeZone));
|
|
33435
|
+
},
|
|
33436
|
+
newDate: (year, monthIndex, date) => {
|
|
33437
|
+
return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
|
|
33438
|
+
},
|
|
33439
|
+
startOfDay: (date) => {
|
|
33440
|
+
return toNoonTZDate(date);
|
|
33441
|
+
},
|
|
33442
|
+
startOfWeek: (date, options) => {
|
|
33443
|
+
const base = toNoonTZDate(date);
|
|
33444
|
+
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33445
|
+
fallbackWeekStartsOn);
|
|
33446
|
+
const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
|
|
33447
|
+
base.setDate(base.getDate() - diff);
|
|
33448
|
+
return base;
|
|
33449
|
+
},
|
|
33450
|
+
startOfISOWeek: (date) => {
|
|
33451
|
+
const base = toNoonTZDate(date);
|
|
33452
|
+
const diff = (base.getDay() - 1 + 7) % 7;
|
|
33453
|
+
base.setDate(base.getDate() - diff);
|
|
33454
|
+
return base;
|
|
33455
|
+
},
|
|
33456
|
+
startOfMonth: (date) => {
|
|
33457
|
+
const base = toNoonTZDate(date);
|
|
33458
|
+
base.setDate(1);
|
|
33459
|
+
return base;
|
|
33460
|
+
},
|
|
33461
|
+
startOfYear: (date) => {
|
|
33462
|
+
const base = toNoonTZDate(date);
|
|
33463
|
+
base.setMonth(0, 1);
|
|
33464
|
+
return base;
|
|
33465
|
+
},
|
|
33466
|
+
endOfWeek: (date, options) => {
|
|
33467
|
+
const base = toNoonTZDate(date);
|
|
33468
|
+
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33469
|
+
fallbackWeekStartsOn);
|
|
33470
|
+
const endDow = (weekStartsOnValue + 6) % 7;
|
|
33471
|
+
const diff = (endDow - base.getDay() + 7) % 7;
|
|
33472
|
+
base.setDate(base.getDate() + diff);
|
|
33473
|
+
return base;
|
|
33474
|
+
},
|
|
33475
|
+
endOfISOWeek: (date) => {
|
|
33476
|
+
const base = toNoonTZDate(date);
|
|
33477
|
+
const diff = (7 - base.getDay()) % 7;
|
|
33478
|
+
base.setDate(base.getDate() + diff);
|
|
33479
|
+
return base;
|
|
33480
|
+
},
|
|
33481
|
+
endOfMonth: (date) => {
|
|
33482
|
+
const base = toNoonTZDate(date);
|
|
33483
|
+
base.setMonth(base.getMonth() + 1, 0);
|
|
33484
|
+
return base;
|
|
33485
|
+
},
|
|
33486
|
+
endOfYear: (date) => {
|
|
33487
|
+
const base = toNoonTZDate(date);
|
|
33488
|
+
base.setMonth(11, 31);
|
|
33489
|
+
return base;
|
|
33490
|
+
},
|
|
33491
|
+
eachMonthOfInterval: (interval) => {
|
|
33492
|
+
const start = toNoonTZDate(interval.start);
|
|
33493
|
+
const end = toNoonTZDate(interval.end);
|
|
33494
|
+
const result = [];
|
|
33495
|
+
const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
|
|
33496
|
+
const endKey = end.getFullYear() * 12 + end.getMonth();
|
|
33497
|
+
while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
|
|
33498
|
+
result.push(new TZDate(cursor, timeZone));
|
|
33499
|
+
cursor.setMonth(cursor.getMonth() + 1, 1);
|
|
33500
|
+
}
|
|
33501
|
+
return result;
|
|
33502
|
+
},
|
|
33503
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
33504
|
+
// mutate the same TZDate, and return it.
|
|
33505
|
+
addDays: (date, amount) => {
|
|
33506
|
+
const base = toNoonTZDate(date);
|
|
33507
|
+
base.setDate(base.getDate() + amount);
|
|
33508
|
+
return base;
|
|
33509
|
+
},
|
|
33510
|
+
addWeeks: (date, amount) => {
|
|
33511
|
+
const base = toNoonTZDate(date);
|
|
33512
|
+
base.setDate(base.getDate() + amount * 7);
|
|
33513
|
+
return base;
|
|
33514
|
+
},
|
|
33515
|
+
addMonths: (date, amount) => {
|
|
33516
|
+
const base = toNoonTZDate(date);
|
|
33517
|
+
base.setMonth(base.getMonth() + amount);
|
|
33518
|
+
return base;
|
|
33519
|
+
},
|
|
33520
|
+
addYears: (date, amount) => {
|
|
33521
|
+
const base = toNoonTZDate(date);
|
|
33522
|
+
base.setFullYear(base.getFullYear() + amount);
|
|
33523
|
+
return base;
|
|
33524
|
+
},
|
|
33525
|
+
eachYearOfInterval: (interval) => {
|
|
33526
|
+
const start = toNoonTZDate(interval.start);
|
|
33527
|
+
const end = toNoonTZDate(interval.end);
|
|
33528
|
+
const years = [];
|
|
33529
|
+
const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
|
|
33530
|
+
while (cursor.getFullYear() <= end.getFullYear()) {
|
|
33531
|
+
years.push(new TZDate(cursor, timeZone));
|
|
33532
|
+
cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
|
|
33533
|
+
}
|
|
33534
|
+
return years;
|
|
33535
|
+
},
|
|
33536
|
+
getWeek: (date, options) => {
|
|
33537
|
+
const base = toCalendarDate(date);
|
|
33538
|
+
return getWeek(base, {
|
|
33539
|
+
weekStartsOn: options?.weekStartsOn ?? fallbackWeekStartsOn,
|
|
33540
|
+
firstWeekContainsDate: options?.firstWeekContainsDate ??
|
|
33541
|
+
locale?.options?.firstWeekContainsDate ??
|
|
33542
|
+
1,
|
|
33543
|
+
});
|
|
33544
|
+
},
|
|
33545
|
+
getISOWeek: (date) => {
|
|
33546
|
+
const base = toCalendarDate(date);
|
|
33547
|
+
return getISOWeek(base);
|
|
33548
|
+
},
|
|
33549
|
+
differenceInCalendarDays: (dateLeft, dateRight) => {
|
|
33550
|
+
const left = toCalendarDate(dateLeft);
|
|
33551
|
+
const right = toCalendarDate(dateRight);
|
|
33552
|
+
return differenceInCalendarDays(left, right);
|
|
33553
|
+
},
|
|
33554
|
+
differenceInCalendarMonths: (dateLeft, dateRight) => {
|
|
33555
|
+
const left = toCalendarDate(dateLeft);
|
|
33556
|
+
const right = toCalendarDate(dateRight);
|
|
33557
|
+
return differenceInCalendarMonths(left, right);
|
|
33558
|
+
},
|
|
33559
|
+
};
|
|
33560
|
+
}
|
|
33561
|
+
|
|
33204
33562
|
const asHtmlElement = (element) => {
|
|
33205
33563
|
if (element instanceof HTMLElement)
|
|
33206
33564
|
return element;
|
|
@@ -33393,19 +33751,27 @@ function getDates(displayMonths, maxDate, props, dateLib) {
|
|
|
33393
33751
|
: ISOWeek
|
|
33394
33752
|
? startOfISOWeek(firstMonth)
|
|
33395
33753
|
: startOfWeek(firstMonth);
|
|
33396
|
-
const
|
|
33754
|
+
const displayMonthsWeekEnd = broadcastCalendar
|
|
33397
33755
|
? endOfBroadcastWeek(lastMonth)
|
|
33398
33756
|
: ISOWeek
|
|
33399
33757
|
? endOfISOWeek(endOfMonth(lastMonth))
|
|
33400
33758
|
: endOfWeek(endOfMonth(lastMonth));
|
|
33401
|
-
|
|
33759
|
+
// If maxDate is set, clamp the grid to the end of that week.
|
|
33760
|
+
const constraintWeekEnd = maxDate &&
|
|
33761
|
+
(broadcastCalendar
|
|
33762
|
+
? endOfBroadcastWeek(maxDate)
|
|
33763
|
+
: ISOWeek
|
|
33764
|
+
? endOfISOWeek(maxDate)
|
|
33765
|
+
: endOfWeek(maxDate));
|
|
33766
|
+
// Pick the earliest week end between the displayed months and the constraint.
|
|
33767
|
+
const gridEndDate = constraintWeekEnd && isAfter(displayMonthsWeekEnd, constraintWeekEnd)
|
|
33768
|
+
? constraintWeekEnd
|
|
33769
|
+
: displayMonthsWeekEnd;
|
|
33770
|
+
const nOfDays = differenceInCalendarDays(gridEndDate, startWeekFirstDate);
|
|
33402
33771
|
const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;
|
|
33403
33772
|
const dates = [];
|
|
33404
33773
|
for (let i = 0; i <= nOfDays; i++) {
|
|
33405
33774
|
const date = addDays(startWeekFirstDate, i);
|
|
33406
|
-
if (maxDate && isAfter(date, maxDate)) {
|
|
33407
|
-
break;
|
|
33408
|
-
}
|
|
33409
33775
|
dates.push(date);
|
|
33410
33776
|
}
|
|
33411
33777
|
// If fixed weeks is enabled, add the extra dates to the array
|
|
@@ -33736,17 +34102,45 @@ function useCalendar(props, dateLib) {
|
|
|
33736
34102
|
setFirstMonth(newInitialMonth);
|
|
33737
34103
|
}, [props.timeZone]);
|
|
33738
34104
|
/** The months displayed in the calendar. */
|
|
33739
|
-
|
|
33740
|
-
|
|
33741
|
-
|
|
33742
|
-
|
|
33743
|
-
|
|
33744
|
-
|
|
33745
|
-
|
|
33746
|
-
|
|
33747
|
-
|
|
33748
|
-
|
|
33749
|
-
|
|
34105
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: We want to recompute only when specific props change.
|
|
34106
|
+
const { months, weeks, days, previousMonth, nextMonth } = useMemo(() => {
|
|
34107
|
+
const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);
|
|
34108
|
+
const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, {
|
|
34109
|
+
ISOWeek: props.ISOWeek,
|
|
34110
|
+
fixedWeeks: props.fixedWeeks,
|
|
34111
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
34112
|
+
}, dateLib);
|
|
34113
|
+
const months = getMonths(displayMonths, dates, {
|
|
34114
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
34115
|
+
fixedWeeks: props.fixedWeeks,
|
|
34116
|
+
ISOWeek: props.ISOWeek,
|
|
34117
|
+
reverseMonths: props.reverseMonths,
|
|
34118
|
+
}, dateLib);
|
|
34119
|
+
const weeks = getWeeks(months);
|
|
34120
|
+
const days = getDays(months);
|
|
34121
|
+
const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
34122
|
+
const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
34123
|
+
return {
|
|
34124
|
+
months,
|
|
34125
|
+
weeks,
|
|
34126
|
+
days,
|
|
34127
|
+
previousMonth,
|
|
34128
|
+
nextMonth,
|
|
34129
|
+
};
|
|
34130
|
+
}, [
|
|
34131
|
+
dateLib,
|
|
34132
|
+
firstMonth.getTime(),
|
|
34133
|
+
navEnd?.getTime(),
|
|
34134
|
+
navStart?.getTime(),
|
|
34135
|
+
props.disableNavigation,
|
|
34136
|
+
props.broadcastCalendar,
|
|
34137
|
+
props.endMonth?.getTime(),
|
|
34138
|
+
props.fixedWeeks,
|
|
34139
|
+
props.ISOWeek,
|
|
34140
|
+
props.numberOfMonths,
|
|
34141
|
+
props.pagedNavigation,
|
|
34142
|
+
props.reverseMonths,
|
|
34143
|
+
]);
|
|
33750
34144
|
const { disableNavigation, onMonthChange } = props;
|
|
33751
34145
|
const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
|
|
33752
34146
|
const goToMonth = (date) => {
|
|
@@ -33965,6 +34359,12 @@ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
|
33965
34359
|
const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
|
|
33966
34360
|
if (!nextFocus)
|
|
33967
34361
|
return;
|
|
34362
|
+
if (props.disableNavigation) {
|
|
34363
|
+
const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
|
|
34364
|
+
if (!isNextInCalendar) {
|
|
34365
|
+
return;
|
|
34366
|
+
}
|
|
34367
|
+
}
|
|
33968
34368
|
calendar.goToDay(nextFocus);
|
|
33969
34369
|
setFocused(nextFocus);
|
|
33970
34370
|
};
|
|
@@ -34247,15 +34647,33 @@ function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
|
|
|
34247
34647
|
* range, and a function to check if a date is within the range.
|
|
34248
34648
|
*/
|
|
34249
34649
|
function useRange(props, dateLib) {
|
|
34250
|
-
const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect, } = props;
|
|
34650
|
+
const { disabled, excludeDisabled, resetOnSelect, selected: initiallySelected, required, onSelect, } = props;
|
|
34251
34651
|
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
|
|
34252
34652
|
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
34253
34653
|
const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
|
|
34254
34654
|
const select = (triggerDate, modifiers, e) => {
|
|
34255
34655
|
const { min, max } = props;
|
|
34256
|
-
|
|
34257
|
-
|
|
34258
|
-
|
|
34656
|
+
let newRange;
|
|
34657
|
+
if (triggerDate) {
|
|
34658
|
+
const selectedFrom = selected?.from;
|
|
34659
|
+
const selectedTo = selected?.to;
|
|
34660
|
+
const hasFullRange = !!selectedFrom && !!selectedTo;
|
|
34661
|
+
const isClickingSingleDayRange = !!selectedFrom &&
|
|
34662
|
+
!!selectedTo &&
|
|
34663
|
+
dateLib.isSameDay(selectedFrom, selectedTo) &&
|
|
34664
|
+
dateLib.isSameDay(triggerDate, selectedFrom);
|
|
34665
|
+
if (resetOnSelect && (hasFullRange || !selected?.from)) {
|
|
34666
|
+
if (!required && isClickingSingleDayRange) {
|
|
34667
|
+
newRange = undefined;
|
|
34668
|
+
}
|
|
34669
|
+
else {
|
|
34670
|
+
newRange = { from: triggerDate, to: undefined };
|
|
34671
|
+
}
|
|
34672
|
+
}
|
|
34673
|
+
else {
|
|
34674
|
+
newRange = addToRange(triggerDate, selected, min, max, required, dateLib);
|
|
34675
|
+
}
|
|
34676
|
+
}
|
|
34259
34677
|
if (excludeDisabled && disabled && newRange?.from && newRange.to) {
|
|
34260
34678
|
if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {
|
|
34261
34679
|
// if a disabled days is found, the range is reset
|
|
@@ -34343,6 +34761,78 @@ function useSelection(props, dateLib) {
|
|
|
34343
34761
|
}
|
|
34344
34762
|
}
|
|
34345
34763
|
|
|
34764
|
+
/**
|
|
34765
|
+
* Convert a {@link Date} or {@link TZDate} instance to the given time zone.
|
|
34766
|
+
* Reuses the same instance when it is already a {@link TZDate} using the target
|
|
34767
|
+
* time zone to avoid extra allocations.
|
|
34768
|
+
*/
|
|
34769
|
+
function toTimeZone(date, timeZone) {
|
|
34770
|
+
if (date instanceof TZDate && date.timeZone === timeZone) {
|
|
34771
|
+
return date;
|
|
34772
|
+
}
|
|
34773
|
+
return new TZDate(date, timeZone);
|
|
34774
|
+
}
|
|
34775
|
+
|
|
34776
|
+
function toZoneNoon(date, timeZone, noonSafe) {
|
|
34777
|
+
if (!noonSafe)
|
|
34778
|
+
return toTimeZone(date, timeZone);
|
|
34779
|
+
const zoned = toTimeZone(date, timeZone);
|
|
34780
|
+
const noonZoned = new TZDate(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 12, 0, 0, timeZone);
|
|
34781
|
+
return new Date(noonZoned.getTime());
|
|
34782
|
+
}
|
|
34783
|
+
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
34784
|
+
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
34785
|
+
return matcher;
|
|
34786
|
+
}
|
|
34787
|
+
if (matcher instanceof Date) {
|
|
34788
|
+
return toZoneNoon(matcher, timeZone, noonSafe);
|
|
34789
|
+
}
|
|
34790
|
+
if (Array.isArray(matcher)) {
|
|
34791
|
+
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone, noonSafe) : value);
|
|
34792
|
+
}
|
|
34793
|
+
if (isDateRange(matcher)) {
|
|
34794
|
+
return {
|
|
34795
|
+
...matcher,
|
|
34796
|
+
from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
|
|
34797
|
+
to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to,
|
|
34798
|
+
};
|
|
34799
|
+
}
|
|
34800
|
+
if (isDateInterval(matcher)) {
|
|
34801
|
+
return {
|
|
34802
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34803
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34804
|
+
};
|
|
34805
|
+
}
|
|
34806
|
+
if (isDateAfterType(matcher)) {
|
|
34807
|
+
return {
|
|
34808
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34809
|
+
};
|
|
34810
|
+
}
|
|
34811
|
+
if (isDateBeforeType(matcher)) {
|
|
34812
|
+
return {
|
|
34813
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34814
|
+
};
|
|
34815
|
+
}
|
|
34816
|
+
return matcher;
|
|
34817
|
+
}
|
|
34818
|
+
/**
|
|
34819
|
+
* Convert any {@link Matcher} or array of matchers to the specified time zone.
|
|
34820
|
+
*
|
|
34821
|
+
* @param matchers - The matcher or matchers to convert.
|
|
34822
|
+
* @param timeZone - The target IANA time zone.
|
|
34823
|
+
* @returns The converted matcher(s).
|
|
34824
|
+
* @group Utilities
|
|
34825
|
+
*/
|
|
34826
|
+
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
34827
|
+
if (!matchers) {
|
|
34828
|
+
return matchers;
|
|
34829
|
+
}
|
|
34830
|
+
if (Array.isArray(matchers)) {
|
|
34831
|
+
return matchers.map((matcher) => convertMatcher(matcher, timeZone, noonSafe));
|
|
34832
|
+
}
|
|
34833
|
+
return convertMatcher(matchers, timeZone, noonSafe);
|
|
34834
|
+
}
|
|
34835
|
+
|
|
34346
34836
|
/**
|
|
34347
34837
|
* Renders the DayPicker calendar component.
|
|
34348
34838
|
*
|
|
@@ -34353,58 +34843,83 @@ function useSelection(props, dateLib) {
|
|
|
34353
34843
|
*/
|
|
34354
34844
|
function DayPicker(initialProps) {
|
|
34355
34845
|
let props = initialProps;
|
|
34356
|
-
|
|
34846
|
+
const timeZone = props.timeZone;
|
|
34847
|
+
if (timeZone) {
|
|
34357
34848
|
props = {
|
|
34358
34849
|
...initialProps,
|
|
34850
|
+
timeZone,
|
|
34359
34851
|
};
|
|
34360
34852
|
if (props.today) {
|
|
34361
|
-
props.today =
|
|
34853
|
+
props.today = toTimeZone(props.today, timeZone);
|
|
34362
34854
|
}
|
|
34363
34855
|
if (props.month) {
|
|
34364
|
-
props.month =
|
|
34856
|
+
props.month = toTimeZone(props.month, timeZone);
|
|
34365
34857
|
}
|
|
34366
34858
|
if (props.defaultMonth) {
|
|
34367
|
-
props.defaultMonth =
|
|
34859
|
+
props.defaultMonth = toTimeZone(props.defaultMonth, timeZone);
|
|
34368
34860
|
}
|
|
34369
34861
|
if (props.startMonth) {
|
|
34370
|
-
props.startMonth =
|
|
34862
|
+
props.startMonth = toTimeZone(props.startMonth, timeZone);
|
|
34371
34863
|
}
|
|
34372
34864
|
if (props.endMonth) {
|
|
34373
|
-
props.endMonth =
|
|
34865
|
+
props.endMonth = toTimeZone(props.endMonth, timeZone);
|
|
34374
34866
|
}
|
|
34375
34867
|
if (props.mode === "single" && props.selected) {
|
|
34376
|
-
props.selected =
|
|
34868
|
+
props.selected = toTimeZone(props.selected, timeZone);
|
|
34377
34869
|
}
|
|
34378
34870
|
else if (props.mode === "multiple" && props.selected) {
|
|
34379
|
-
props.selected = props.selected?.map((date) =>
|
|
34871
|
+
props.selected = props.selected?.map((date) => toTimeZone(date, timeZone));
|
|
34380
34872
|
}
|
|
34381
34873
|
else if (props.mode === "range" && props.selected) {
|
|
34382
34874
|
props.selected = {
|
|
34383
34875
|
from: props.selected.from
|
|
34384
|
-
?
|
|
34385
|
-
:
|
|
34876
|
+
? toTimeZone(props.selected.from, timeZone)
|
|
34877
|
+
: props.selected.from,
|
|
34386
34878
|
to: props.selected.to
|
|
34387
|
-
?
|
|
34388
|
-
:
|
|
34879
|
+
? toTimeZone(props.selected.to, timeZone)
|
|
34880
|
+
: props.selected.to,
|
|
34389
34881
|
};
|
|
34390
34882
|
}
|
|
34883
|
+
if (props.disabled !== undefined) {
|
|
34884
|
+
props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
|
|
34885
|
+
}
|
|
34886
|
+
if (props.hidden !== undefined) {
|
|
34887
|
+
props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
|
|
34888
|
+
}
|
|
34889
|
+
if (props.modifiers) {
|
|
34890
|
+
const nextModifiers = {};
|
|
34891
|
+
Object.keys(props.modifiers).forEach((key) => {
|
|
34892
|
+
nextModifiers[key] = convertMatchersToTimeZone(props.modifiers?.[key], timeZone);
|
|
34893
|
+
});
|
|
34894
|
+
props.modifiers = nextModifiers;
|
|
34895
|
+
}
|
|
34391
34896
|
}
|
|
34392
34897
|
const { components, formatters, labels, dateLib, locale, classNames } = useMemo(() => {
|
|
34393
34898
|
const locale = { ...enUS, ...props.locale };
|
|
34899
|
+
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
34900
|
+
const noonOverrides = props.noonSafe && props.timeZone
|
|
34901
|
+
? createNoonOverrides(props.timeZone, {
|
|
34902
|
+
weekStartsOn,
|
|
34903
|
+
locale,
|
|
34904
|
+
})
|
|
34905
|
+
: undefined;
|
|
34906
|
+
const overrides = props.dateLib && noonOverrides
|
|
34907
|
+
? { ...noonOverrides, ...props.dateLib }
|
|
34908
|
+
: (props.dateLib ?? noonOverrides);
|
|
34394
34909
|
const dateLib = new DateLib({
|
|
34395
34910
|
locale,
|
|
34396
|
-
weekStartsOn
|
|
34911
|
+
weekStartsOn,
|
|
34397
34912
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
34398
34913
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
34399
34914
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
34400
34915
|
timeZone: props.timeZone,
|
|
34401
34916
|
numerals: props.numerals,
|
|
34402
|
-
},
|
|
34917
|
+
}, overrides);
|
|
34403
34918
|
return {
|
|
34404
34919
|
dateLib,
|
|
34405
34920
|
components: getComponents(props.components),
|
|
34406
34921
|
formatters: getFormatters(props.formatters),
|
|
34407
|
-
labels:
|
|
34922
|
+
labels: getLabels(props.labels, dateLib.options),
|
|
34408
34923
|
locale,
|
|
34409
34924
|
classNames: { ...getDefaultClassNames(), ...props.classNames },
|
|
34410
34925
|
};
|
|
@@ -34418,11 +34933,15 @@ function DayPicker(initialProps) {
|
|
|
34418
34933
|
props.timeZone,
|
|
34419
34934
|
props.numerals,
|
|
34420
34935
|
props.dateLib,
|
|
34936
|
+
props.noonSafe,
|
|
34421
34937
|
props.components,
|
|
34422
34938
|
props.formatters,
|
|
34423
34939
|
props.labels,
|
|
34424
34940
|
props.classNames,
|
|
34425
34941
|
]);
|
|
34942
|
+
if (!props.today) {
|
|
34943
|
+
props = { ...props, today: dateLib.today() };
|
|
34944
|
+
}
|
|
34426
34945
|
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles, } = props;
|
|
34427
34946
|
const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown, } = formatters;
|
|
34428
34947
|
const calendar = useCalendar(props, dateLib);
|
|
@@ -34431,7 +34950,7 @@ function DayPicker(initialProps) {
|
|
|
34431
34950
|
const { isSelected, select, selected: selectedValue, } = useSelection(props, dateLib) ?? {};
|
|
34432
34951
|
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
|
|
34433
34952
|
const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown, } = labels;
|
|
34434
|
-
const weekdays = useMemo(() => getWeekdays(dateLib, props.ISOWeek), [dateLib, props.ISOWeek]);
|
|
34953
|
+
const weekdays = useMemo(() => getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [dateLib, props.ISOWeek, props.broadcastCalendar, props.today]);
|
|
34435
34954
|
const isInteractive = mode !== undefined || onDayClick !== undefined;
|
|
34436
34955
|
const handlePreviousClick = useCallback(() => {
|
|
34437
34956
|
if (!previousMonth)
|
|
@@ -34449,6 +34968,9 @@ function DayPicker(initialProps) {
|
|
|
34449
34968
|
e.preventDefault();
|
|
34450
34969
|
e.stopPropagation();
|
|
34451
34970
|
setFocused(day);
|
|
34971
|
+
if (m.disabled) {
|
|
34972
|
+
return;
|
|
34973
|
+
}
|
|
34452
34974
|
select?.(day.date, m, e);
|
|
34453
34975
|
onDayClick?.(day.date, m, e);
|
|
34454
34976
|
}, [select, onDayClick, setFocused]);
|
|
@@ -34532,7 +35054,7 @@ function DayPicker(initialProps) {
|
|
|
34532
35054
|
formatters,
|
|
34533
35055
|
};
|
|
34534
35056
|
return (React__default.createElement(dayPickerContext.Provider, { value: contextValue },
|
|
34535
|
-
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 },
|
|
35057
|
+
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 },
|
|
34536
35058
|
React__default.createElement(components.Months, { className: classNames[UI.Months], style: styles?.[UI.Months] },
|
|
34537
35059
|
!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 })),
|
|
34538
35060
|
months.map((calendarMonth, displayIndex) => {
|
|
@@ -34544,10 +35066,16 @@ function DayPicker(initialProps) {
|
|
|
34544
35066
|
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 },
|
|
34545
35067
|
React__default.createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" }))),
|
|
34546
35068
|
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] },
|
|
34547
|
-
|
|
34548
|
-
captionLayout === "dropdown
|
|
34549
|
-
|
|
34550
|
-
captionLayout === "dropdown
|
|
35069
|
+
(() => {
|
|
35070
|
+
const monthControl = captionLayout === "dropdown" ||
|
|
35071
|
+
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)));
|
|
35072
|
+
const yearControl = captionLayout === "dropdown" ||
|
|
35073
|
+
captionLayout === "dropdown-years" ? (React__default.createElement(components.YearsDropdown, { key: "year", className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown(dateLib.options), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: getYearOptions(navStart, navEnd, formatters, dateLib, Boolean(props.reverseYears)), style: styles?.[UI.Dropdown], value: dateLib.getYear(calendarMonth.date) })) : (React__default.createElement("span", { key: "year" }, formatYearDropdown(calendarMonth.date, dateLib)));
|
|
35074
|
+
const controls = dateLib.getMonthYearOrder() === "year-first"
|
|
35075
|
+
? [yearControl, monthControl]
|
|
35076
|
+
: [monthControl, yearControl];
|
|
35077
|
+
return controls;
|
|
35078
|
+
})(),
|
|
34551
35079
|
React__default.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
34552
35080
|
border: 0,
|
|
34553
35081
|
clip: "rect(0 0 0 0)",
|
|
@@ -34559,9 +35087,7 @@ function DayPicker(initialProps) {
|
|
|
34559
35087
|
width: "1px",
|
|
34560
35088
|
whiteSpace: "nowrap",
|
|
34561
35089
|
wordWrap: "normal",
|
|
34562
|
-
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
|
|
34563
|
-
// biome-ignore lint/a11y/useSemanticElements: breaking change
|
|
34564
|
-
React__default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
|
|
35090
|
+
} }, 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)))),
|
|
34565
35091
|
navLayout === "around" &&
|
|
34566
35092
|
!props.hideNavigation &&
|
|
34567
35093
|
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 },
|
|
@@ -34576,9 +35102,7 @@ function DayPicker(initialProps) {
|
|
|
34576
35102
|
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)))))),
|
|
34577
35103
|
React__default.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : undefined, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
|
|
34578
35104
|
return (React__default.createElement(components.Week, { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week: week },
|
|
34579
|
-
showWeekNumber && (
|
|
34580
|
-
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34581
|
-
React__default.createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
35105
|
+
showWeekNumber && (React__default.createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
34582
35106
|
locale,
|
|
34583
35107
|
}), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber(week.weekNumber, dateLib))),
|
|
34584
35108
|
week.days.map((day) => {
|
|
@@ -34602,18 +35126,16 @@ function DayPicker(initialProps) {
|
|
|
34602
35126
|
const ariaLabel = !isInteractive && !modifiers.hidden
|
|
34603
35127
|
? labelGridcell(date, modifiers, dateLib.options, dateLib)
|
|
34604
35128
|
: undefined;
|
|
34605
|
-
return (
|
|
34606
|
-
|
|
34607
|
-
|
|
34608
|
-
|
|
34609
|
-
|
|
35129
|
+
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 &&
|
|
35130
|
+
modifiers.disabled) ||
|
|
35131
|
+
undefined, "aria-disabled": (modifiers.focused &&
|
|
35132
|
+
modifiers.disabled) ||
|
|
35133
|
+
undefined, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay(date, dateLib.options, dateLib))) : (!modifiers.hidden &&
|
|
34610
35134
|
formatDay(day.date, dateLib.options, dateLib))));
|
|
34611
35135
|
})));
|
|
34612
35136
|
})))));
|
|
34613
35137
|
})),
|
|
34614
|
-
props.footer && (
|
|
34615
|
-
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34616
|
-
React__default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
35138
|
+
props.footer && (React__default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
34617
35139
|
}
|
|
34618
35140
|
|
|
34619
35141
|
function styleInject(css, ref) {
|
|
@@ -34643,7 +35165,7 @@ function styleInject(css, ref) {
|
|
|
34643
35165
|
}
|
|
34644
35166
|
}
|
|
34645
35167
|
|
|
34646
|
-
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";
|
|
35168
|
+
var css_248z$3 = "/* Variables declaration */\n.rdp-root {\n --rdp-accent-color: blue; /* The accent color used for selected days and UI elements. */\n --rdp-accent-background-color: #f0f0ff; /* The accent background color used for selected days and UI elements. */\n\n --rdp-day-height: 44px; /* The height of the day cells. */\n --rdp-day-width: 44px; /* The width of the day cells. */\n\n --rdp-day_button-border-radius: 100%; /* The border radius of the day cells. */\n --rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */\n --rdp-day_button-height: 42px; /* The height of the day cells. */\n --rdp-day_button-width: 42px; /* The width of the day cells. */\n\n --rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */\n --rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */\n --rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */\n --rdp-today-color: var(--rdp-accent-color); /* The color of the today's date. */\n\n --rdp-dropdown-gap: 0.5rem; /* The gap between the dropdowns used in the month captons. */\n\n --rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */\n\n --rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */\n --rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */\n --rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */\n --rdp-nav-height: 2.75rem; /* The height of the navigation bar. */\n\n --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */\n --rdp-range_middle-color: inherit; /* The color of the range text. */\n\n --rdp-range_start-color: white; /* The color of the range text. */\n --rdp-range_start-background: linear-gradient(\n var(--rdp-gradient-direction),\n transparent 50%,\n var(--rdp-range_middle-background-color) 50%\n ); /* Used for the background of the start of the selected range. */\n --rdp-range_start-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the start of the selected range. */\n\n --rdp-range_end-background: linear-gradient(\n var(--rdp-gradient-direction),\n var(--rdp-range_middle-background-color) 50%,\n transparent 50%\n ); /* Used for the background of the end of the selected range. */\n --rdp-range_end-color: white; /* The color of the range text. */\n --rdp-range_end-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the end of the selected range. */\n\n --rdp-week_number-border-radius: 100%; /* The border radius of the week number. */\n --rdp-week_number-border: 2px solid transparent; /* The border of the week number. */\n\n --rdp-week_number-height: var(--rdp-day-height); /* The height of the week number cells. */\n --rdp-week_number-opacity: 0.75; /* The opacity of the week number. */\n --rdp-week_number-width: var(--rdp-day-width); /* The width of the week number cells. */\n --rdp-weeknumber-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */\n --rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */\n --rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-gradient-direction: 90deg;\n\n --rdp-animation_duration: 0.3s;\n --rdp-animation_timing: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.rdp-root[dir=\"rtl\"] {\n --rdp-gradient-direction: -90deg;\n}\n\n.rdp-root[data-broadcast-calendar=\"true\"] {\n --rdp-outside-opacity: unset;\n}\n\n/* Root of the component. */\n.rdp-root {\n position: relative; /* Required to position the navigation toolbar. */\n box-sizing: border-box;\n}\n\n.rdp-root * {\n box-sizing: border-box;\n}\n\n.rdp-day {\n width: var(--rdp-day-width);\n height: var(--rdp-day-height);\n text-align: center;\n}\n\n.rdp-day_button {\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n justify-content: center;\n align-items: center;\n display: flex;\n\n width: var(--rdp-day_button-width);\n height: var(--rdp-day_button-height);\n border: var(--rdp-day_button-border);\n border-radius: var(--rdp-day_button-border-radius);\n}\n\n.rdp-day_button:disabled {\n cursor: revert;\n}\n\n.rdp-caption_label {\n z-index: 1;\n\n position: relative;\n display: inline-flex;\n align-items: center;\n\n white-space: nowrap;\n border: 0;\n}\n\n.rdp-dropdown:focus-visible ~ .rdp-caption_label {\n outline: 5px auto Highlight;\n /* biome-ignore lint/suspicious/noDuplicateProperties: backward compatibility */\n outline: 5px auto -webkit-focus-ring-color;\n}\n\n.rdp-button_next,\n.rdp-button_previous {\n border: none;\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n -moz-appearance: none;\n -webkit-appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n appearance: none;\n\n width: var(--rdp-nav_button-width);\n height: var(--rdp-nav_button-height);\n}\n\n.rdp-button_next:disabled,\n.rdp-button_next[aria-disabled=\"true\"],\n.rdp-button_previous:disabled,\n.rdp-button_previous[aria-disabled=\"true\"] {\n cursor: revert;\n\n opacity: var(--rdp-nav_button-disabled-opacity);\n}\n\n.rdp-chevron {\n display: inline-block;\n fill: var(--rdp-accent-color);\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-nav .rdp-chevron {\n transform: rotate(180deg);\n transform-origin: 50%;\n}\n\n.rdp-dropdowns {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: var(--rdp-dropdown-gap);\n}\n.rdp-dropdown {\n z-index: 2;\n\n /* Reset */\n opacity: 0;\n appearance: none;\n position: absolute;\n inset-block-start: 0;\n inset-block-end: 0;\n inset-inline-start: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n cursor: inherit;\n border: none;\n line-height: inherit;\n}\n\n.rdp-dropdown_root {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.rdp-dropdown_root[data-disabled=\"true\"] .rdp-chevron {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-month_caption {\n display: flex;\n align-content: center;\n height: var(--rdp-nav-height);\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month,\n.rdp-root[data-nav-layout=\"after\"] .rdp-month {\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month_caption {\n justify-content: center;\n margin-inline-start: var(--rdp-nav_button-width);\n margin-inline-end: var(--rdp-nav_button-width);\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_previous {\n position: absolute;\n inset-inline-start: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_next {\n position: absolute;\n inset-inline-end: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n justify-content: center;\n}\n\n.rdp-months {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n gap: var(--rdp-months-gap);\n max-width: fit-content;\n}\n\n.rdp-month_grid {\n border-collapse: collapse;\n}\n\n.rdp-nav {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n\n display: flex;\n align-items: center;\n\n height: var(--rdp-nav-height);\n}\n\n.rdp-weekday {\n opacity: var(--rdp-weekday-opacity);\n padding: var(--rdp-weekday-padding);\n font-weight: 500;\n font-size: smaller;\n text-align: var(--rdp-weekday-text-align);\n text-transform: var(--rdp-weekday-text-transform);\n}\n\n.rdp-week_number {\n opacity: var(--rdp-week_number-opacity);\n font-weight: 400;\n font-size: small;\n height: var(--rdp-week_number-height);\n width: var(--rdp-week_number-width);\n border: var(--rdp-week_number-border);\n border-radius: var(--rdp-week_number-border-radius);\n text-align: var(--rdp-weeknumber-text-align);\n}\n\n/* DAY MODIFIERS */\n.rdp-today:not(.rdp-outside) {\n color: var(--rdp-today-color);\n}\n\n.rdp-selected {\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-selected .rdp-day_button {\n border: var(--rdp-selected-border);\n}\n\n.rdp-outside {\n opacity: var(--rdp-outside-opacity);\n}\n\n.rdp-disabled:not(.rdp-selected) {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-hidden {\n visibility: hidden;\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_start {\n background: var(--rdp-range_start-background);\n}\n\n.rdp-range_start .rdp-day_button {\n background-color: var(--rdp-range_start-date-background-color);\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_middle {\n background-color: var(--rdp-range_middle-background-color);\n}\n\n.rdp-range_middle .rdp-day_button {\n border: unset;\n border-radius: unset;\n color: var(--rdp-range_middle-color);\n}\n\n.rdp-range_end {\n background: var(--rdp-range_end-background);\n color: var(--rdp-range_end-color);\n}\n\n.rdp-range_end .rdp-day_button {\n color: var(--rdp-range_start-color);\n background-color: var(--rdp-range_end-date-background-color);\n}\n\n.rdp-range_start.rdp-range_end {\n background: revert;\n}\n\n.rdp-focusable {\n cursor: pointer;\n}\n\n@keyframes rdp-slide_in_left {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_in_right {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_out_left {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100%);\n }\n}\n\n@keyframes rdp-slide_out_right {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n}\n\n.rdp-weeks_before_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_before_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n@keyframes rdp-fade_in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes rdp-fade_out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.rdp-caption_after_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_after_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n";
|
|
34647
35169
|
styleInject(css_248z$3);
|
|
34648
35170
|
|
|
34649
35171
|
var reactInputMask = {exports: {}};
|
|
@@ -39144,6 +39666,8 @@ const NumberFilterComponent = ({ column, filterBy, fieldFilter, handleSave, form
|
|
|
39144
39666
|
allowNegative: column.numericSettings?.allowNegative ?? false,
|
|
39145
39667
|
decimalScale: column.numericSettings?.fraction ?? 0
|
|
39146
39668
|
};
|
|
39669
|
+
console.log(column.numericSettings?.fraction);
|
|
39670
|
+
console.log(column.field);
|
|
39147
39671
|
let floatValue = parseFloat(valueFilter ?? '0');
|
|
39148
39672
|
return (jsx(Fragment$1, { children: jsxs("div", { className: "r-filter-popup", onKeyDown: (e) => {
|
|
39149
39673
|
if (e.code === 'Enter' || e.code === 'NumpadEnter') {
|
|
@@ -39325,11 +39849,11 @@ const TableComponent = ({ idTable, dataSource, contentColumns, headerColumns, se
|
|
|
39325
39849
|
}, []);
|
|
39326
39850
|
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) => {
|
|
39327
39851
|
return (jsx("tr", { className: "r-row", role: "row", children: element?.map((col, index) => {
|
|
39328
|
-
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) => {
|
|
39852
|
+
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) => {
|
|
39329
39853
|
setFilterBy([...val]);
|
|
39330
39854
|
}, changeOrder: (val) => {
|
|
39331
39855
|
setOrderBy([...val]);
|
|
39332
|
-
}, columns: contentColumns, setContentColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft
|
|
39856
|
+
}, columns: contentColumns, setContentColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft }, `header-${indexParent}-${index}`));
|
|
39333
39857
|
}) }, `header-${-indexParent}`));
|
|
39334
39858
|
}) }), jsxs("tbody", { className: "r-gridcontent", role: "rowgroup", children: [jsx("tr", { style: { height: offsetY } }), filteredData.slice(startIndex, endIndex).map((row) => {
|
|
39335
39859
|
const indexRow = row.indexRow;
|
|
@@ -40042,17 +40566,35 @@ const SettingColumn = React__default.memo((props) => {
|
|
|
40042
40566
|
}) }) })] }), 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') })] })] })] }));
|
|
40043
40567
|
});
|
|
40044
40568
|
|
|
40045
|
-
const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, focusRow, editDisable, addDisable, buttonSetting, toolbarSetting }) => {
|
|
40569
|
+
const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, focusRow, editDisable, addDisable, buttonSetting, toolbarSetting, }) => {
|
|
40046
40570
|
const { t } = useTranslation();
|
|
40047
|
-
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', {
|
|
40571
|
+
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', {
|
|
40572
|
+
'd-none': editDisable || addDisable,
|
|
40573
|
+
}), "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', {
|
|
40574
|
+
'd-none': editDisable ||
|
|
40575
|
+
addDisable ||
|
|
40576
|
+
buttonSetting?.duplicateDisable,
|
|
40577
|
+
}), "aria-disabled": "false", children: jsx(Button$1$1, { color: "success", outline: true, onClick: () => {
|
|
40048
40578
|
handleDuplicate();
|
|
40049
|
-
}, className: "d-flex", children: t('Duplicate') }) }), jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40579
|
+
}, className: "d-flex", children: t('Duplicate') }) }), jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40580
|
+
'd-none': editDisable ||
|
|
40581
|
+
addDisable ||
|
|
40582
|
+
buttonSetting?.insertBeforeDisable,
|
|
40583
|
+
}), "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', {
|
|
40584
|
+
'd-none': editDisable ||
|
|
40585
|
+
addDisable ||
|
|
40586
|
+
buttonSetting?.insertAfterDisable,
|
|
40587
|
+
}), "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', {
|
|
40588
|
+
'd-none': editDisable || buttonSetting?.deleteAllDisable,
|
|
40589
|
+
}), "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) => {
|
|
40050
40590
|
return (item.align === 'left' && (jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`)));
|
|
40051
40591
|
})] }), jsx("div", { className: "r-toolbar-center", children: toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
40052
40592
|
return (item.align === 'center' && (jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-center-${index}`)));
|
|
40053
40593
|
}) }), jsxs("div", { className: "r-toolbar-right", children: [toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
40054
40594
|
return (item.align === 'right' && (jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-right-${index}`)));
|
|
40055
|
-
}), !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', {
|
|
40595
|
+
}), !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', {
|
|
40596
|
+
'd-none': editDisable || addDisable,
|
|
40597
|
+
}), "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" })] }) })] }) })] }))] })] }) }));
|
|
40056
40598
|
};
|
|
40057
40599
|
|
|
40058
40600
|
const RenderToolbarTop = ({ toolbarTopOption, maximize, setMaximize }) => {
|
|
@@ -68973,7 +69515,7 @@ const UnExpandAllIcon = ({ className, color = '#7F7F7F', size = 24, onClick, sty
|
|
|
68973
69515
|
};
|
|
68974
69516
|
|
|
68975
69517
|
const RenderContentCol = React__default.memo((props) => {
|
|
68976
|
-
const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, handleCellClick, fieldKey, isMulti
|
|
69518
|
+
const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, handleCellClick, fieldKey, isMulti } = props;
|
|
68977
69519
|
const cellId = `content-${idTable}-row${indexRow}col-${indexCol}`;
|
|
68978
69520
|
const checkOverflow = () => {
|
|
68979
69521
|
const element = document.getElementById(cellId);
|
|
@@ -68995,12 +69537,10 @@ const RenderContentCol = React__default.memo((props) => {
|
|
|
68995
69537
|
const RenderElement = () => {
|
|
68996
69538
|
if (col.field === '#' || col.type === '#') {
|
|
68997
69539
|
return (jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer text-center', {
|
|
68998
|
-
'r-active-cell': isSelected
|
|
69540
|
+
'r-active-cell': isSelected
|
|
68999
69541
|
}), style: {
|
|
69000
|
-
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
69001
|
-
|
|
69002
|
-
: 400,
|
|
69003
|
-
fontStyle: row.haveItalicType ? 'italic' : 'normal',
|
|
69542
|
+
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType ? 600 : 400,
|
|
69543
|
+
fontStyle: row.haveItalicType ? 'italic' : 'normal'
|
|
69004
69544
|
}, onDoubleClick: (e) => {
|
|
69005
69545
|
e.preventDefault();
|
|
69006
69546
|
handleCloseContext();
|
|
@@ -69009,15 +69549,11 @@ const RenderContentCol = React__default.memo((props) => {
|
|
|
69009
69549
|
}
|
|
69010
69550
|
else if (col.type === 'checkbox' || col.field === 'checkbox') {
|
|
69011
69551
|
return (jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
|
|
69012
|
-
'r-active-cell': isSelected
|
|
69552
|
+
'r-active-cell': isSelected
|
|
69013
69553
|
}), style: {
|
|
69014
69554
|
display: 'flex',
|
|
69015
|
-
justifyContent: col.textAlign === 'center'
|
|
69016
|
-
|
|
69017
|
-
: col.textAlign === 'right'
|
|
69018
|
-
? 'flex-end'
|
|
69019
|
-
: 'flex-start',
|
|
69020
|
-
alignItems: 'center',
|
|
69555
|
+
justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start',
|
|
69556
|
+
alignItems: 'center'
|
|
69021
69557
|
}, onClick: (e) => {
|
|
69022
69558
|
setSelectedRows(toggleSelect());
|
|
69023
69559
|
e.stopPropagation();
|
|
@@ -69027,12 +69563,8 @@ const RenderContentCol = React__default.memo((props) => {
|
|
|
69027
69563
|
let value = row[col.field];
|
|
69028
69564
|
// ✅ Format dữ liệu theo loại cột
|
|
69029
69565
|
if (col.type === 'numeric') {
|
|
69030
|
-
value =
|
|
69031
|
-
|
|
69032
|
-
if (!zeroVisiable &&
|
|
69033
|
-
!col.zeroVisiable &&
|
|
69034
|
-
!(row?.sortOrder < 0 || row?.sortOrder > 100000) &&
|
|
69035
|
-
(value === '0' || value === 0)) {
|
|
69566
|
+
value = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
|
|
69567
|
+
if (!zeroVisiable && !col.zeroVisiable && !(row?.sortOrder < 0 || row?.sortOrder > 100000) && (value === '0' || value === 0)) {
|
|
69036
69568
|
value = '';
|
|
69037
69569
|
}
|
|
69038
69570
|
}
|
|
@@ -69040,43 +69572,31 @@ const RenderContentCol = React__default.memo((props) => {
|
|
|
69040
69572
|
value = value ? formatDateTime(value, formatSetting?.dateFormat) : '';
|
|
69041
69573
|
}
|
|
69042
69574
|
else if (col.type === 'datetime') {
|
|
69043
|
-
value = value
|
|
69044
|
-
? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
69045
|
-
: '';
|
|
69575
|
+
value = value ? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
|
|
69046
69576
|
}
|
|
69047
69577
|
if (col.template) {
|
|
69048
69578
|
value = col.template(row, indexRow) ?? '';
|
|
69049
69579
|
}
|
|
69050
69580
|
const isNegative = col.type === 'numeric' && Number(row[col.field]) < 0;
|
|
69051
|
-
const textColor = isNegative
|
|
69052
|
-
|
|
69053
|
-
|
|
69054
|
-
const
|
|
69055
|
-
const suffix = isNegative ? (formatSetting?.suffixNegative ?? '') : '';
|
|
69056
|
-
const displayText = isNegative
|
|
69057
|
-
? `${prefix}${value}${suffix}`
|
|
69058
|
-
: (value ?? '');
|
|
69581
|
+
const textColor = isNegative ? formatSetting?.colorNegative ?? 'red' : undefined;
|
|
69582
|
+
const prefix = isNegative ? formatSetting?.prefixNegative ?? '-' : '';
|
|
69583
|
+
const suffix = isNegative ? formatSetting?.suffixNegative ?? '' : '';
|
|
69584
|
+
const displayText = isNegative ? `${prefix}${value}${suffix}` : value ?? '';
|
|
69059
69585
|
return (jsxs("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
|
|
69060
|
-
'r-active-cell': isSelected
|
|
69586
|
+
'r-active-cell': isSelected
|
|
69061
69587
|
}), style: {
|
|
69062
|
-
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
69063
|
-
|
|
69064
|
-
: 400,
|
|
69065
|
-
fontStyle: row.haveItalicType ? 'italic' : 'normal',
|
|
69588
|
+
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType ? 600 : 400,
|
|
69589
|
+
fontStyle: row.haveItalicType ? 'italic' : 'normal'
|
|
69066
69590
|
}, children: [jsx("div", { className: "r-cell-text", style: {
|
|
69067
69591
|
display: 'flex',
|
|
69068
|
-
justifyContent: col.textAlign === 'center'
|
|
69069
|
-
|
|
69070
|
-
: col.textAlign === 'right'
|
|
69071
|
-
? 'flex-end'
|
|
69072
|
-
: 'flex-start',
|
|
69073
|
-
alignItems: 'center',
|
|
69592
|
+
justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start',
|
|
69593
|
+
alignItems: 'center'
|
|
69074
69594
|
}, children: jsx("div", { id: cellId, style: {
|
|
69075
69595
|
color: textColor,
|
|
69076
69596
|
overflow: 'hidden',
|
|
69077
69597
|
textOverflow: 'ellipsis',
|
|
69078
69598
|
whiteSpace: 'pre',
|
|
69079
|
-
maxWidth: '100%'
|
|
69599
|
+
maxWidth: '100%'
|
|
69080
69600
|
}, children: displayText }) }), checkOverflow() && (jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: cellId, placement: "top", children: jsx("div", { style: { color: textColor }, onClick: (e) => {
|
|
69081
69601
|
e.stopPropagation();
|
|
69082
69602
|
e.preventDefault();
|
|
@@ -69085,15 +69605,10 @@ const RenderContentCol = React__default.memo((props) => {
|
|
|
69085
69605
|
};
|
|
69086
69606
|
const clickTimerRef = useRef(null);
|
|
69087
69607
|
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 }, {
|
|
69088
|
-
'fixed-last': (col.fixedType === 'left' &&
|
|
69089
|
-
indexCol === lastObjWidthFixLeft) ||
|
|
69090
|
-
(col.fixedType === 'right' &&
|
|
69091
|
-
indexCol === fisrtObjWidthFixRight),
|
|
69608
|
+
'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight)
|
|
69092
69609
|
}, { 'r-active': isSelected }), style: {
|
|
69093
69610
|
left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
|
|
69094
|
-
right: col.fixedType === 'right'
|
|
69095
|
-
? objWidthFixRight[indexCol]
|
|
69096
|
-
: undefined,
|
|
69611
|
+
right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined
|
|
69097
69612
|
}, onClick: (e) => {
|
|
69098
69613
|
const tag = e.target?.nodeName;
|
|
69099
69614
|
if (tag !== 'DIV' && tag !== 'TD') {
|
|
@@ -69127,7 +69642,7 @@ const RenderContentCol = React__default.memo((props) => {
|
|
|
69127
69642
|
});
|
|
69128
69643
|
|
|
69129
69644
|
const TableElement = React__default.memo((props) => {
|
|
69130
|
-
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
|
|
69645
|
+
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;
|
|
69131
69646
|
const { t } = useTranslation();
|
|
69132
69647
|
const [context, setContext] = useState(null);
|
|
69133
69648
|
const virtualDivRef = useRef(null);
|
|
@@ -69173,10 +69688,7 @@ const TableElement = React__default.memo((props) => {
|
|
|
69173
69688
|
if (searchTerm) {
|
|
69174
69689
|
datas = datas.filter((row) => {
|
|
69175
69690
|
return searchSetting?.keyField?.some((key) => {
|
|
69176
|
-
return row[key]
|
|
69177
|
-
?.toString()
|
|
69178
|
-
.toLowerCase()
|
|
69179
|
-
.includes(searchTerm.trim().toLowerCase());
|
|
69691
|
+
return row[key]?.toString().toLowerCase().includes(searchTerm.trim().toLowerCase());
|
|
69180
69692
|
});
|
|
69181
69693
|
});
|
|
69182
69694
|
}
|
|
@@ -69185,10 +69697,7 @@ const TableElement = React__default.memo((props) => {
|
|
|
69185
69697
|
return filterBy.every((filter) => {
|
|
69186
69698
|
const { key, value, ope } = filter;
|
|
69187
69699
|
const rowValue = row[key];
|
|
69188
|
-
if (rowValue === undefined ||
|
|
69189
|
-
rowValue === null ||
|
|
69190
|
-
value === undefined ||
|
|
69191
|
-
value === null) {
|
|
69700
|
+
if (rowValue === undefined || rowValue === null || value === undefined || value === null) {
|
|
69192
69701
|
return false;
|
|
69193
69702
|
}
|
|
69194
69703
|
const valStr = String(rowValue).toLowerCase();
|
|
@@ -69254,68 +69763,52 @@ const TableElement = React__default.memo((props) => {
|
|
|
69254
69763
|
}
|
|
69255
69764
|
let value = row[col.field];
|
|
69256
69765
|
if (col.type === 'numeric') {
|
|
69257
|
-
value =
|
|
69258
|
-
formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
|
|
69766
|
+
value = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
|
|
69259
69767
|
}
|
|
69260
69768
|
else if (col.type === 'date') {
|
|
69261
|
-
value = value
|
|
69262
|
-
? formatDateTime(value, formatSetting?.dateFormat)
|
|
69263
|
-
: '';
|
|
69769
|
+
value = value ? formatDateTime(value, formatSetting?.dateFormat) : '';
|
|
69264
69770
|
}
|
|
69265
69771
|
else if (col.type === 'datetime') {
|
|
69266
|
-
value = value
|
|
69267
|
-
? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
69268
|
-
: '';
|
|
69772
|
+
value = value ? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
|
|
69269
69773
|
}
|
|
69270
69774
|
if (col.template) {
|
|
69271
69775
|
value = col.template(row, indexRow) ?? '';
|
|
69272
69776
|
}
|
|
69273
69777
|
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: {
|
|
69274
69778
|
marginLeft: level * 20,
|
|
69275
|
-
transform: expand ? 'rotate(90deg)' : 'rotate(0deg)'
|
|
69779
|
+
transform: expand ? 'rotate(90deg)' : 'rotate(0deg)'
|
|
69276
69780
|
}, fontSize: 15, onClick: () => {
|
|
69277
69781
|
setExpand(!expand);
|
|
69278
69782
|
setExpandsAll(undefined);
|
|
69279
69783
|
row.expand = !expand;
|
|
69280
69784
|
} }), t(col.headerDisplay ?? col.headerText ?? ''), ": ", value, " (", row.children.length, ")"] }) }), contentColumns.map((colSum, indexCol) => {
|
|
69281
|
-
if (indexCol <= firstColSpan ||
|
|
69282
|
-
colSum.visible === false ||
|
|
69283
|
-
colSum.isGroup === true) {
|
|
69785
|
+
if (indexCol <= firstColSpan || colSum.visible === false || colSum.isGroup === true) {
|
|
69284
69786
|
return;
|
|
69285
69787
|
}
|
|
69286
69788
|
let sumValue = row[colSum.field];
|
|
69287
|
-
const haveSum = row[colSum.field] !== undefined &&
|
|
69288
|
-
|
|
69289
|
-
if (!haveSum &&
|
|
69290
|
-
colSum.haveSum === true &&
|
|
69291
|
-
colSum.type === 'numeric') {
|
|
69789
|
+
const haveSum = row[colSum.field] !== undefined && row[colSum.field] !== null;
|
|
69790
|
+
if (!haveSum && colSum.haveSum === true && colSum.type === 'numeric') {
|
|
69292
69791
|
sumValue = row.children.reduce(function (accumulator, currentValue) {
|
|
69293
|
-
return
|
|
69294
|
-
Number(currentValue[colSum.field] ?? 0));
|
|
69792
|
+
return Number(accumulator ?? 0) + Number(currentValue[colSum.field] ?? 0);
|
|
69295
69793
|
}, 0);
|
|
69296
69794
|
}
|
|
69297
69795
|
if (colSum.type === 'numeric') {
|
|
69298
69796
|
sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', colSum.numericSettings?.fraction, true, false);
|
|
69299
|
-
if (!zeroVisiable &&
|
|
69300
|
-
!col.zeroVisiable &&
|
|
69301
|
-
(sumValue === '0' || sumValue === 0)) {
|
|
69797
|
+
if (!zeroVisiable && !col.zeroVisiable && (sumValue === '0' || sumValue === 0)) {
|
|
69302
69798
|
sumValue = '';
|
|
69303
69799
|
}
|
|
69304
69800
|
}
|
|
69305
69801
|
return (jsx("td", { className: "r-rowcell r-cell-sum-group", children: jsx("div", { className: "r-rowcell-div", style: {
|
|
69306
|
-
justifyContent: colSum.textAlign
|
|
69307
|
-
|
|
69308
|
-
: '
|
|
69309
|
-
}, children: (haveSum || colSum.haveSum === true) &&
|
|
69310
|
-
Number(row[colSum.field] ?? '0') < 0 ? (jsxs("div", { style: {
|
|
69311
|
-
color: formatSetting?.colorNegative ?? 'red',
|
|
69802
|
+
justifyContent: colSum.textAlign ? colSum.textAlign : 'left'
|
|
69803
|
+
}, children: (haveSum || colSum.haveSum === true) && Number(row[colSum.field] ?? '0') < 0 ? (jsxs("div", { style: {
|
|
69804
|
+
color: formatSetting?.colorNegative ?? 'red'
|
|
69312
69805
|
}, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `group-sum-cell-${level}-${indexRow}-${indexCol}`));
|
|
69313
|
-
})] }), expand &&
|
|
69806
|
+
})] }), expand && jsx(RenderContent, { datas: row.children, level: level + 1 })] }, `row-${level}-${indexRow}`));
|
|
69314
69807
|
}
|
|
69315
69808
|
else {
|
|
69316
69809
|
const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
|
|
69317
69810
|
return (jsx("tr", { id: `row-content-${indexRow}`, "aria-rowindex": indexRow + 1, role: "row", className: classNames$1('r-row', {
|
|
69318
|
-
'r-last-row': level === 0 && indexRow === viewData.length - 1
|
|
69811
|
+
'r-last-row': level === 0 && indexRow === viewData.length - 1
|
|
69319
69812
|
}), onContextMenu: (e) => {
|
|
69320
69813
|
e.preventDefault();
|
|
69321
69814
|
handleContextMenu(e, row);
|
|
@@ -69331,7 +69824,7 @@ const TableElement = React__default.memo((props) => {
|
|
|
69331
69824
|
x: e.clientX,
|
|
69332
69825
|
y: e.clientY,
|
|
69333
69826
|
row,
|
|
69334
|
-
show: true
|
|
69827
|
+
show: true
|
|
69335
69828
|
});
|
|
69336
69829
|
}, 100);
|
|
69337
69830
|
};
|
|
@@ -69355,28 +69848,20 @@ const TableElement = React__default.memo((props) => {
|
|
|
69355
69848
|
let sumValue = item?.value;
|
|
69356
69849
|
if (!item && col.haveSum === true && col.type === 'numeric') {
|
|
69357
69850
|
sumValue = viewData.reduce(function (accumulator, currentValue) {
|
|
69358
|
-
return
|
|
69359
|
-
Number(currentValue[col.field] ?? 0));
|
|
69851
|
+
return Number(accumulator ?? 0) + Number(currentValue[col.field] ?? 0);
|
|
69360
69852
|
}, 0);
|
|
69361
69853
|
}
|
|
69362
69854
|
if (col.type === 'numeric') {
|
|
69363
69855
|
sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false);
|
|
69364
69856
|
}
|
|
69365
69857
|
return (jsx("td", { className: classNames$1(`p-0 px-50 r-footer fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }), style: {
|
|
69366
|
-
left: col.fixedType === 'left'
|
|
69367
|
-
|
|
69368
|
-
|
|
69369
|
-
|
|
69370
|
-
|
|
69371
|
-
: undefined,
|
|
69372
|
-
textAlign: col.textAlign ? col.textAlign : 'left',
|
|
69373
|
-
}, children: jsx("div", { className: "r-footer-div", children: (item || col.haveSum === true) &&
|
|
69374
|
-
Number(item?.value ?? '0') < 0 ? (jsxs("div", { style: {
|
|
69375
|
-
color: formatSetting?.colorNegative ?? 'red',
|
|
69858
|
+
left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
|
|
69859
|
+
right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined,
|
|
69860
|
+
textAlign: col.textAlign ? col.textAlign : 'left'
|
|
69861
|
+
}, children: jsx("div", { className: "r-footer-div", children: (item || col.haveSum === true) && Number(item?.value ?? '0') < 0 ? (jsxs("div", { style: {
|
|
69862
|
+
color: formatSetting?.colorNegative ?? 'red'
|
|
69376
69863
|
}, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `summarycell-${indexCol}`));
|
|
69377
|
-
}) })) })] }), jsx("div", { ref: virtualDivRef }), context &&
|
|
69378
|
-
(contextMenuItems?.length ?? 0) > 0 &&
|
|
69379
|
-
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) => {
|
|
69864
|
+
}) })) })] }), jsx("div", { ref: virtualDivRef }), context && (contextMenuItems?.length ?? 0) > 0 && 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) => {
|
|
69380
69865
|
return (jsxs("div", { className: "r-context-item", onClick: () => {
|
|
69381
69866
|
handleCloseContext();
|
|
69382
69867
|
handleContextMenuClick?.(item, context.row);
|
|
@@ -69384,7 +69869,7 @@ const TableElement = React__default.memo((props) => {
|
|
|
69384
69869
|
}) }) })), (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.')] }))] }));
|
|
69385
69870
|
});
|
|
69386
69871
|
|
|
69387
|
-
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
|
|
69872
|
+
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 }) => {
|
|
69388
69873
|
const { t } = useTranslation();
|
|
69389
69874
|
const gridRef = useRef(null);
|
|
69390
69875
|
const [openPopupSetupColumn, setOpenPopupSetupColumn] = useState(false);
|
|
@@ -69397,8 +69882,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69397
69882
|
const [expandsAll, setExpandsAll] = useState(true);
|
|
69398
69883
|
const [maximize, setMaximize] = useState(false);
|
|
69399
69884
|
const [windowHeight, setWindowHeight] = useState(window.innerHeight);
|
|
69400
|
-
const fieldKey = columns.find((item) => item.isPrimarykey === true)?.field ??
|
|
69401
|
-
'id';
|
|
69885
|
+
const fieldKey = columns.find((item) => item.isPrimarykey === true)?.field ?? 'id';
|
|
69402
69886
|
useEffect(() => {
|
|
69403
69887
|
const handleResize = () => {
|
|
69404
69888
|
setWindowHeight(window.innerHeight);
|
|
@@ -69408,19 +69892,14 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69408
69892
|
}, []);
|
|
69409
69893
|
const heightTable = useMemo(() => {
|
|
69410
69894
|
if (maximize) {
|
|
69411
|
-
return
|
|
69412
|
-
(pagingSetting?.allowPaging ? 50 : 0) -
|
|
69413
|
-
(haveSum ? 30 : 0) -
|
|
69414
|
-
(headerHeight ?? 59) -
|
|
69415
|
-
(toolbarSetting?.showBottomToolbar ? 42 : 0) -
|
|
69416
|
-
(toolbarSetting?.showTopToolbar ? 42 : 0));
|
|
69895
|
+
return windowHeight - (pagingSetting?.allowPaging ? 50 : 0) - (haveSum ? 30 : 0) - (headerHeight ?? 59) - (toolbarSetting?.showBottomToolbar ? 42 : 0) - (toolbarSetting?.showTopToolbar ? 42 : 0);
|
|
69417
69896
|
}
|
|
69418
69897
|
return height;
|
|
69419
69898
|
}, [height, maximize, windowHeight]);
|
|
69420
69899
|
const optionsGroupColumn = useMemo(() => {
|
|
69421
69900
|
return contentColumns.map((col) => ({
|
|
69422
69901
|
...col,
|
|
69423
|
-
headerText: t(col.headerText)
|
|
69902
|
+
headerText: t(col.headerText)
|
|
69424
69903
|
}));
|
|
69425
69904
|
}, [contentColumns]);
|
|
69426
69905
|
useEffect(() => {
|
|
@@ -69429,7 +69908,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69429
69908
|
}
|
|
69430
69909
|
setExpandsAll(true);
|
|
69431
69910
|
}, [groupSetting?.groupColumns]);
|
|
69432
|
-
const { levels: headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight
|
|
69911
|
+
const { levels: headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight } = useMemo(() => {
|
|
69433
69912
|
const rs = calculateTableStructure(columns, settingColumns?.value, groupSetting?.groupColumns);
|
|
69434
69913
|
setContentColumns(rs.flat);
|
|
69435
69914
|
return rs;
|
|
@@ -69447,17 +69926,12 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69447
69926
|
}
|
|
69448
69927
|
};
|
|
69449
69928
|
const searchTemplate = () => {
|
|
69450
|
-
return (jsx("div", { className: "me-50 r-search", children: jsx(ReactInput, { style: { width: '230px' }, value: searchSetting?.searchTerm !== undefined
|
|
69451
|
-
? searchSetting?.searchTerm
|
|
69452
|
-
: searchTerm, setSearchTerm: searchSetting?.setSearchTerm
|
|
69453
|
-
? searchSetting?.setSearchTerm
|
|
69454
|
-
: setSearchTerm, placeholder: t('Search'), onKeyPress: handleKeyPress }) }));
|
|
69929
|
+
return (jsx("div", { className: "me-50 r-search", children: jsx(ReactInput, { style: { width: '230px' }, value: searchSetting?.searchTerm !== undefined ? searchSetting?.searchTerm : searchTerm, setSearchTerm: searchSetting?.setSearchTerm ? searchSetting?.setSearchTerm : setSearchTerm, placeholder: t('Search'), onKeyPress: handleKeyPress }) }));
|
|
69455
69930
|
};
|
|
69456
69931
|
const groupbtnTemplate = () => {
|
|
69457
69932
|
return (jsxs(UncontrolledDropdown, { children: [jsx(DropdownToggle$1, { tag: "div", id: "group-dropdown-toggle", style: { position: 'relative' }, onClick: (e) => e.preventDefault(), children: jsx(GroupIcon, { color: "#7F7F7F", size: 24 }) }), jsxs(DropdownMenu$1, { className: "formula-dropdown icon-dropdown p-1", children: [jsx("div", { className: "mb-1", style: { fontSize: 16, fontWeight: 500 }, children: "Nh\u00F3m d\u1EEF li\u1EC7u theo c\u1ED9t" }), jsxs("div", { className: 'form-group', children: [jsx(Label$1, { id: `label-group-1`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 1" }), jsx("div", { className: "form-input", children: jsx(SelectTable, { options: optionsGroupColumn, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[0]
|
|
69458
69933
|
? {
|
|
69459
|
-
headerText: t(contentColumns.find((x) => x.field === groupColumns[0])?.headerText ??
|
|
69460
|
-
contentColumns.find((x) => x.field === groupColumns[0])?.headerText),
|
|
69934
|
+
headerText: t(contentColumns.find((x) => x.field === groupColumns[0])?.headerText ?? contentColumns.find((x) => x.field === groupColumns[0])?.headerText)
|
|
69461
69935
|
}
|
|
69462
69936
|
: undefined, onChange: (val) => {
|
|
69463
69937
|
if (val) {
|
|
@@ -69469,8 +69943,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69469
69943
|
setGroupColumns([...groupColumns]);
|
|
69470
69944
|
}, isClearable: groupColumns?.length === 1 }) })] }), jsxs("div", { className: 'form-group', children: [jsx(Label$1, { id: `label-group-2`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 2" }), jsx("div", { className: "form-input", children: jsx(SelectTable, { options: optionsGroupColumn, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[1]
|
|
69471
69945
|
? {
|
|
69472
|
-
headerText: t(contentColumns.find((x) => x.field === groupColumns[1])?.headerText ??
|
|
69473
|
-
contentColumns.find((x) => x.field === groupColumns[1])?.headerText),
|
|
69946
|
+
headerText: t(contentColumns.find((x) => x.field === groupColumns[1])?.headerText ?? contentColumns.find((x) => x.field === groupColumns[1])?.headerText)
|
|
69474
69947
|
}
|
|
69475
69948
|
: undefined, onChange: (val) => {
|
|
69476
69949
|
if (val) {
|
|
@@ -69482,8 +69955,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69482
69955
|
setGroupColumns([...groupColumns]);
|
|
69483
69956
|
}, isClearable: groupColumns?.length === 2 }) })] }), jsxs("div", { className: 'form-group', children: [jsx(Label$1, { id: `label-group-3`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 3" }), jsx("div", { className: "form-input", children: jsx(SelectTable, { options: optionsGroupColumn, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[2]
|
|
69484
69957
|
? {
|
|
69485
|
-
headerText: t(contentColumns.find((x) => x.field === groupColumns[2])?.headerText ??
|
|
69486
|
-
contentColumns.find((x) => x.field === groupColumns[2])?.headerText),
|
|
69958
|
+
headerText: t(contentColumns.find((x) => x.field === groupColumns[2])?.headerText ?? contentColumns.find((x) => x.field === groupColumns[2])?.headerText)
|
|
69487
69959
|
}
|
|
69488
69960
|
: undefined, onChange: (val) => {
|
|
69489
69961
|
if (groupSetting) {
|
|
@@ -69497,7 +69969,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69497
69969
|
}
|
|
69498
69970
|
}, isClearable: groupColumns?.length === 3 }) })] }), jsxs("div", { className: "border-top d-flex justify-content-end mt-1", children: [jsx(Button$1$1, { color: "primary", className: "mt-1 me-50 rounded", size: "sm", onClick: () => {
|
|
69499
69971
|
groupSetting?.onGroup({
|
|
69500
|
-
columnGrouped: groupColumns.filter((x) => x)
|
|
69972
|
+
columnGrouped: groupColumns.filter((x) => x)
|
|
69501
69973
|
});
|
|
69502
69974
|
document.getElementById('group-dropdown-toggle')?.click();
|
|
69503
69975
|
}, children: `${t('Apply')}` }), jsx(Button$1$1, { color: "secondary", outline: true, className: "mt-1 rounded", size: "sm", onClick: () => {
|
|
@@ -69506,16 +69978,14 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69506
69978
|
}, children: `${t('Delete')}` })] })] })] }));
|
|
69507
69979
|
};
|
|
69508
69980
|
const chooseColumnsTemplate = () => {
|
|
69509
|
-
return
|
|
69981
|
+
return jsx(SvgSettings, { className: "r-toolbar-icon", fontSize: 20, color: "#7F7F7F", onClick: () => setOpenPopupSetupColumn(true) });
|
|
69510
69982
|
};
|
|
69511
69983
|
const expandTemplate = () => {
|
|
69512
69984
|
return (jsxs(Fragment$1, { children: [!expandsAll && (jsx(ExpandAllIcon, { onClick: () => {
|
|
69513
69985
|
setExpandsAll(true);
|
|
69514
|
-
}, color: "#7F7F7F", size: 24 })), expandsAll &&
|
|
69986
|
+
}, color: "#7F7F7F", size: 24 })), expandsAll && jsx(UnExpandAllIcon, { onClick: () => setExpandsAll(false), color: "#7F7F7F", size: 24 })] }));
|
|
69515
69987
|
};
|
|
69516
|
-
const defaultToolbarOption = searchSetting?.searchEnable
|
|
69517
|
-
? [{ template: searchTemplate, align: 'left' }]
|
|
69518
|
-
: [];
|
|
69988
|
+
const defaultToolbarOption = searchSetting?.searchEnable ? [{ template: searchTemplate, align: 'left' }] : [];
|
|
69519
69989
|
if (groupSetting) {
|
|
69520
69990
|
defaultToolbarOption.push({ template: groupbtnTemplate, align: 'left' });
|
|
69521
69991
|
}
|
|
@@ -69524,10 +69994,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69524
69994
|
}
|
|
69525
69995
|
let toolbarTopOption = [];
|
|
69526
69996
|
if (toolbarSetting?.toolbarOptions) {
|
|
69527
|
-
toolbarTopOption = [
|
|
69528
|
-
...defaultToolbarOption,
|
|
69529
|
-
...toolbarSetting?.toolbarOptions,
|
|
69530
|
-
];
|
|
69997
|
+
toolbarTopOption = [...defaultToolbarOption, ...toolbarSetting?.toolbarOptions];
|
|
69531
69998
|
}
|
|
69532
69999
|
else {
|
|
69533
70000
|
toolbarTopOption = [...defaultToolbarOption];
|
|
@@ -69558,9 +70025,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69558
70025
|
useEffect(() => {
|
|
69559
70026
|
if (setSelectedItem) {
|
|
69560
70027
|
if (isMulti) {
|
|
69561
|
-
if (dataSource &&
|
|
69562
|
-
selectedRows &&
|
|
69563
|
-
selectedRows?.length !== selectedItem?.length) {
|
|
70028
|
+
if (dataSource && selectedRows && selectedRows?.length !== selectedItem?.length) {
|
|
69564
70029
|
setSelectedItem([...selectedRows]);
|
|
69565
70030
|
if (handleSelect) {
|
|
69566
70031
|
handleSelect([...selectedRows]);
|
|
@@ -69569,8 +70034,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69569
70034
|
}
|
|
69570
70035
|
else {
|
|
69571
70036
|
if (dataSource && selectedRows?.length > 0) {
|
|
69572
|
-
if (!selectedItem ||
|
|
69573
|
-
selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
70037
|
+
if (!selectedItem || selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
69574
70038
|
setSelectedItem({ ...selectedRows[0] });
|
|
69575
70039
|
if (handleSelect) {
|
|
69576
70040
|
handleSelect({ ...selectedRows[0] });
|
|
@@ -69589,8 +70053,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69589
70053
|
useEffect(() => {
|
|
69590
70054
|
if (!isMulti) {
|
|
69591
70055
|
if (dataSource && selectedItem && selectedItem[fieldKey]) {
|
|
69592
|
-
if (selectedRows?.length === 0 ||
|
|
69593
|
-
selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
70056
|
+
if (selectedRows?.length === 0 || selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
69594
70057
|
setSelectedRows([selectedItem]);
|
|
69595
70058
|
}
|
|
69596
70059
|
}
|
|
@@ -69599,18 +70062,16 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69599
70062
|
}
|
|
69600
70063
|
}
|
|
69601
70064
|
else {
|
|
69602
|
-
if (dataSource &&
|
|
69603
|
-
selectedItem &&
|
|
69604
|
-
selectedRows?.length !== selectedItem.length) {
|
|
70065
|
+
if (dataSource && selectedItem && selectedRows?.length !== selectedItem.length) {
|
|
69605
70066
|
setSelectedRows(selectedItem ? [...selectedItem] : []);
|
|
69606
70067
|
}
|
|
69607
70068
|
}
|
|
69608
70069
|
}, [selectedItem]);
|
|
69609
70070
|
return (jsxs("div", { className: classNames$1('r-table-edit r-virtualized-table', {
|
|
69610
|
-
'is-maximized': maximize
|
|
69611
|
-
}), children: [jsxs("div", { className: "r-grid", children: [toolbarSetting?.showTopToolbar &&
|
|
70071
|
+
'is-maximized': maximize
|
|
70072
|
+
}), 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: {
|
|
69612
70073
|
height: `${heightTable ? `${heightTable}px` : 'auto'}`,
|
|
69613
|
-
position: 'relative'
|
|
70074
|
+
position: 'relative'
|
|
69614
70075
|
}, 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: () => {
|
|
69615
70076
|
setOpenPopupSetupColumn(!openPopupSetupColumn);
|
|
69616
70077
|
}, settingColumns: settingColumns, openSidebar: openPopupSetupColumn, column: [...contentColumns], resetDefaultColumns: resetDefaultColumns, setColumn: (newColumns) => {
|
|
@@ -69621,7 +70082,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69621
70082
|
visible: x.visible,
|
|
69622
70083
|
fixedType: x.fixedType,
|
|
69623
70084
|
width: x.width,
|
|
69624
|
-
sortOrder: index + 1
|
|
70085
|
+
sortOrder: index + 1
|
|
69625
70086
|
})));
|
|
69626
70087
|
}
|
|
69627
70088
|
} })] }));
|