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.js
CHANGED
|
@@ -9085,6 +9085,20 @@ var SvgProcess = function (_a) {
|
|
|
9085
9085
|
React__namespace.createElement("path", { d: "M22.43 3.87a1.302 1.302 0 0 0-2.545-.374H9.886V1.874a.375.375 0 0 0-.375-.375H2.858a.375.375 0 0 0-.375.375v3.992a.375.375 0 0 0 .375.375h6.653a.375.375 0 0 0 .375-.375V4.245h9.999a1.301 1.301 0 0 0 .867.868v6.344h-.902v-1.62a.376.376 0 0 0-.375-.376h-6.653a.375.375 0 0 0-.375.375v1.62H4.115a1.3 1.3 0 1 0-1.617 1.618v7.055a.375.375 0 0 0 .375.375H5.81v1.621a.375.375 0 0 0 .375.375h6.652a.376.376 0 0 0 .375-.375v-1.62h5.327l-.695.674a.375.375 0 1 0 .522.538l1.357-1.316a.377.377 0 0 0 .006-.544l-1.357-1.316a.375.375 0 1 0-.522.539l.695.674h-5.333v-1.62a.376.376 0 0 0-.375-.376H6.185a.376.376 0 0 0-.375.375v1.621H3.248v-6.68a1.301 1.301 0 0 0 .867-.867h8.332v1.62a.374.374 0 0 0 .375.376h6.653a.374.374 0 0 0 .375-.375v-1.621h1.277a.376.376 0 0 0 .375-.375v-6.72a1.3 1.3 0 0 0 .929-1.242ZM9.137 5.492H3.233V2.25h5.903v3.242ZM6.56 18.508h5.902v3.242H6.56v-3.242Zm-3.687-6.122a.554.554 0 0 1 0-1.108.554.554 0 0 1 0 1.108ZM19.1 13.453h-5.903V10.21H19.1v3.242Zm2.027-9.029a.554.554 0 0 1 0-1.107.554.554 0 0 1 0 1.107Z", fill: props.color || "currentColor" })));
|
|
9086
9086
|
};
|
|
9087
9087
|
|
|
9088
|
+
var SvgProjectSetting = function (_a) {
|
|
9089
|
+
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9090
|
+
return (React__namespace.createElement("svg", __assign({ width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", strokeWidth: props.strokeWidth || 1.5, "aria-labelledby": titleId }, props),
|
|
9091
|
+
title ? React__namespace.createElement("title", { id: titleId }, title) : null,
|
|
9092
|
+
React__namespace.createElement("g", { clipPath: "url(#project-setting_svg__a)", fill: props.color || "currentColor" },
|
|
9093
|
+
React__namespace.createElement("path", { d: "M1.266.042C.9.155.53.506.43.834.394.961.375 1.528.375 2.616v1.598l.122.094c.201.16.403.122.51-.094.057-.108.071-.408.071-1.655V1.031l.136-.15.136-.155H19.275l.136.155.136.15v8.916l.14.14c.118.113.17.136.272.108a.533.533 0 0 0 .207-.103c.08-.07.084-.347.084-4.575 0-3.314-.014-4.547-.056-4.683-.07-.234-.366-.572-.619-.708l-.192-.103-9-.009C5.433.009 1.33.024 1.266.042Z" }),
|
|
9094
|
+
React__namespace.createElement("path", { d: "M2.03 2.156a.351.351 0 0 0-.15.136c-.033.061-.052.586-.052 1.481v1.388l.117.112c.061.066.17.118.235.118a.386.386 0 0 0 .234-.118c.108-.103.117-.15.117-.562v-.445h.263c.398 0 .623-.085.862-.329.347-.346.422-.778.206-1.209-.224-.45-.585-.619-1.303-.614-.234 0-.473.019-.53.042Zm1.106.778c.183.155.192.347.028.511-.094.099-.16.118-.375.118h-.258v-.75h.23c.183 0 .262.028.375.121ZM4.477 2.227l-.118.112V5.2l.122.093c.155.122.305.127.446.01.093-.075.112-.141.136-.474l.023-.389.323.37c.446.511.53.582.68.582.169 0 .333-.178.333-.361 0-.108-.075-.225-.328-.511-.178-.202-.328-.385-.328-.403 0-.02.037-.043.084-.057.131-.042.38-.304.483-.506.108-.206.117-.581.023-.806-.098-.24-.389-.488-.651-.567-.136-.042-.422-.07-.675-.07-.403 0-.45.009-.553.117Zm1.12.684c.272.216.07.558-.328.558h-.207v-.657h.207c.136 0 .244.033.328.099ZM7.876 2.184A1.619 1.619 0 0 0 6.84 4.472c.67 1.364 2.657 1.139 3.032-.342.211-.844-.323-1.725-1.185-1.95-.329-.085-.479-.085-.811.004Zm.68.68c.257.07.562.385.632.647.164.614-.356 1.228-.989 1.167a.98.98 0 0 1-.736-.506c-.21-.394-.07-.947.3-1.172.295-.183.492-.216.792-.136ZM11.08 2.166c-.187.089-.206.225-.206 1.378 0 1.232.005 1.218-.323 1.045-.169-.084-.216-.094-.328-.042a.402.402 0 0 0-.197.197c-.075.178 0 .337.234.492.418.281.961.15 1.21-.29.103-.184.108-.23.108-1.398V2.34l-.118-.113c-.122-.126-.22-.14-.38-.06ZM15.3 2.175c-.484.122-.873.445-1.107.914-.15.305-.155 1.003-.005 1.327.14.309.478.651.797.81.235.118.328.136.67.141.343 0 .436-.019.666-.131.488-.24.656-.61.384-.825-.173-.136-.253-.127-.501.07-.638.497-1.505-.01-1.43-.83.066-.642.746-.998 1.36-.707.271.126.323.126.478.004.145-.112.169-.365.042-.492-.258-.258-.914-.393-1.355-.281ZM17.19 2.203a.29.29 0 0 0-.128.263c0 .243.132.346.446.346h.258v2.386l.122.094c.154.122.304.127.445.01.112-.09.112-.094.126-1.29l.014-1.2h.254c.215 0 .262-.018.346-.121.122-.155.127-.305.01-.446-.09-.108-.113-.112-.928-.126-.797-.014-.844-.01-.966.084ZM12.268 2.212a.55.55 0 0 0-.127.193c-.06.178-.065 2.56 0 2.733.09.23.16.248.872.253.628 0 .661-.005.76-.108.145-.155.135-.375-.02-.497-.107-.084-.191-.098-.538-.098h-.418v-.563h.352c.403 0 .558-.056.633-.23.056-.14.005-.342-.103-.412-.033-.019-.24-.047-.46-.061l-.398-.024-.014-.271-.014-.268h.417c.351 0 .436-.014.544-.098a.35.35 0 0 0 .028-.511c-.085-.084-.155-.094-.764-.094-.464 0-.694.019-.75.056ZM.478 5.452l-.103.112.01 8.456.013 8.457.15.318c.179.37.535.764.849.938.501.272.408.267 4.945.267h4.163l.112-.117c.15-.145.15-.324 0-.469l-.112-.117H3.938l.14-.22c.277-.432.338-.68.366-1.44.023-.68.023-.703.154-.843l.127-.146H22.65l.14.16.141.154-.018.713c-.015.675-.02.717-.141.928-.174.29-.455.52-.745.614-.216.07-.718.08-5.185.08h-4.94l-.113.117c-.15.145-.15.323 0 .469l.113.117h4.959c5.414 0 5.236.01 5.742-.267.314-.174.67-.567.849-.938.145-.31.15-.337.164-1.064.018-.876-.02-1.064-.286-1.369-.357-.407-.394-.417-1.824-.43l-1.256-.015v-.539l.295.019c.53.033.77-.174 1.252-1.083.16-.295.192-.408.192-.614 0-.417-.197-.712-.652-.966l-.178-.103v-1.153l.178-.103c.46-.258.647-.54.647-.966 0-.22-.032-.323-.192-.623-.478-.895-.717-1.106-1.247-1.073l-.295.018v-.694c0-.632-.01-.703-.094-.787-.126-.127-.38-.122-.497.005-.08.089-.089.187-.103.867-.01.422-.023.769-.028.769-.01 0-.14-.075-.29-.165a2.169 2.169 0 0 0-.38-.192c-.099-.028-.108-.056-.108-.318 0-.385-.07-.605-.248-.811-.249-.286-.436-.342-1.14-.342-.346 0-.684.023-.773.056-.436.15-.651.482-.651 1.012v.338l-.291.145c-.164.08-.385.211-.497.286l-.202.14-.323-.168c-.24-.127-.375-.169-.544-.169-.272 0-.558.122-.726.31-.178.192-.647 1.04-.68 1.228-.08.417.131.82.558 1.068l.29.174v1.144l-.29.173c-.427.248-.638.651-.558 1.069.033.187.502 1.036.68 1.228.168.187.454.31.726.31.169 0 .305-.043.544-.17l.323-.168.202.14c.112.075.333.207.497.286.258.131.29.164.29.286v.14l-5.657.01-5.663.014-.192.103c-.21.113-.51.422-.59.615-.029.07-.066.454-.085.857-.023.67-.038.75-.16.994-.482.994-1.8 1.04-2.362.09l-.126-.221-.024-8.428-.023-8.433-.113-.09c-.15-.121-.342-.112-.464.02Zm17.494 6.417c.056.08.075.225.075.553 0 .408.01.46.108.548a.67.67 0 0 0 .22.131c.22.066.727.352.956.54.122.103.267.187.319.187.052 0 .277-.098.502-.22.539-.286.567-.277.886.267.351.595.337.656-.17.96-.215.127-.412.273-.44.32-.028.056-.028.215.01.487.037.305.037.511 0 .82-.066.511-.061.526.445.826.492.295.501.356.155.946-.32.544-.347.553-.886.267-.225-.121-.45-.22-.502-.22-.052 0-.197.085-.319.192a4.262 4.262 0 0 1-.675.404c-.618.3-.61.29-.61.703v.342H16.642v-.296c0-.417-.057-.492-.493-.675a4.13 4.13 0 0 1-.721-.412c-.193-.14-.39-.258-.441-.258-.052 0-.258.099-.46.216-.52.305-.562.29-.895-.263-.15-.243-.272-.487-.272-.543 0-.122.132-.24.525-.464.361-.207.422-.32.361-.638a4.085 4.085 0 0 1-.037-.534c0-.183.019-.422.037-.535.061-.319 0-.431-.36-.637-.394-.225-.526-.342-.526-.464 0-.056.122-.3.272-.544.333-.553.366-.563.89-.262.202.117.413.215.465.215.051 0 .248-.117.44-.258.193-.14.516-.328.722-.412.254-.108.394-.197.432-.272.033-.066.06-.29.06-.53 0-.586.005-.59.708-.59.516 0 .558.004.624.103Zm1.575 7.701v.352h-.797v-.155c0-.131.023-.16.202-.234.112-.042.276-.132.365-.197a.953.953 0 0 1 .197-.117c.019 0 .033.16.033.351Z" }),
|
|
9095
|
+
React__namespace.createElement("path", { d: "M16.683 14.358c-.478.201-.811.515-1.022.965-.103.23-.122.324-.122.732 0 .436.01.492.15.778.183.375.52.703.895.876.235.113.324.127.76.127.45 0 .515-.014.773-.136a1.867 1.867 0 0 0 1.013-1.378c.13-.745-.305-1.566-1.013-1.908-.234-.112-.351-.136-.726-.15-.385-.014-.483 0-.708.094Zm1.106.684c.413.188.647.558.647 1.013 0 .633-.469 1.097-1.106 1.101-.46 0-.807-.215-.999-.633a1.129 1.129 0 0 1 .567-1.504c.207-.09.67-.08.891.023ZM2.742 6.21a.386.386 0 0 0-.117.235c0 .066.052.174.117.235l.113.117H17.77l.113-.117c.15-.146.15-.324 0-.47l-.113-.116H2.855l-.113.117ZM2.892 7.753c-.422.155-.764.506-.876.919-.028.094-.047.928-.047 1.955 0 1.678.004 1.809.093 2.043.113.296.39.59.694.746l.22.107h6.516l.267-.13c.15-.076.343-.216.432-.324.304-.352.309-.403.309-2.494 0-1.875 0-1.88-.113-2.114-.14-.305-.487-.614-.792-.703-.333-.099-6.426-.103-6.703-.005Zm6.553.703c.09.038.207.14.258.225.09.15.094.235.094 1.932 0 1.706-.005 1.78-.094 1.93-.192.31-.14.305-3.539.291-3.394-.014-3.197.005-3.398-.332-.09-.141-.094-.249-.094-1.885 0-1.94.005-1.964.333-2.142.15-.08.342-.084 3.22-.084 2.555 0 3.084.009 3.22.065Z" }),
|
|
9096
|
+
React__namespace.createElement("path", { d: "M6.623 9.047a.351.351 0 0 0-.15.136c-.032.06-.051.604-.051 1.542 0 1.36.005 1.458.089 1.56.089.113.094.113 1.275.127 1.266.014 1.397-.004 1.49-.206.07-.16.07-2.826 0-2.986a.368.368 0 0 0-.168-.169c-.136-.06-2.33-.065-2.485-.004Zm2.002 1.664v1.008h-1.5V9.703h1.5v1.008ZM3.281 10.406c-.089.09-.094.155-.094.957v.867l.122.093c.118.094.183.099 1.308.099s1.19-.005 1.308-.099l.122-.093v-.867c0-.802-.005-.868-.094-.957-.089-.089-.155-.094-1.336-.094s-1.247.005-1.336.094Zm2.063.961v.352H3.89v-.703H5.344v.351ZM11.587 9.08c-.032.014-.089.08-.126.154-.09.17-.019.39.145.464.085.038 1.064.052 3.469.052h3.351l.113-.117a.386.386 0 0 0 .117-.235.386.386 0 0 0-.117-.234l-.113-.117-3.389.005c-1.865 0-3.417.014-3.45.028ZM11.526 10.49c-.155.127-.14.366.024.512l.126.107H15.895l.112-.117c.15-.145.155-.347.01-.483-.108-.103-.117-.103-2.245-.103-2.007 0-2.143.005-2.246.085ZM2.063 14.54c-.183.198-.075.512.197.577.061.014 2.25.019 4.87.014 4.613-.014 4.772-.018 4.866-.103.127-.117.131-.37.005-.497-.094-.094-.155-.094-4.969-.094h-4.87l-.099.104ZM2.062 15.89c-.202.202-.066.53.244.587.084.014 2.419.023 5.184.014l5.034-.014.09-.113c.117-.14.112-.356-.005-.473-.094-.094-.155-.094-5.274-.094-5.118 0-5.18 0-5.273.094ZM2.175 17.175a.332.332 0 0 0-.112.544c.094.093.155.093 4.987.093h4.899l.07-.103c.108-.15.094-.38-.023-.487-.094-.085-.253-.09-4.89-.099-3.946-.009-4.809 0-4.93.052ZM2.17 18.563c-.215.089-.267.389-.093.553.108.103.108.103 2.503.103 2.212 0 2.4-.005 2.489-.085a.435.435 0 0 0 .131-.206c.024-.103 0-.155-.112-.272l-.141-.14-2.339.004c-1.284 0-2.381.02-2.438.043Z" })),
|
|
9097
|
+
React__namespace.createElement("defs", null,
|
|
9098
|
+
React__namespace.createElement("clipPath", { id: "project-setting_svg__a" },
|
|
9099
|
+
React__namespace.createElement("path", { fill: "#fff", d: "M0 0h24v24H0z" })))));
|
|
9100
|
+
};
|
|
9101
|
+
|
|
9088
9102
|
var SvgQuoteRight = function (_a) {
|
|
9089
9103
|
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9090
9104
|
return (React__namespace.createElement("svg", __assign({ width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", strokeWidth: props.strokeWidth || 1.5, "aria-labelledby": titleId }, props),
|
|
@@ -9253,6 +9267,13 @@ var SvgSettings = function (_a) {
|
|
|
9253
9267
|
React__namespace.createElement("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })));
|
|
9254
9268
|
};
|
|
9255
9269
|
|
|
9270
|
+
var SvgShapeGroup = function (_a) {
|
|
9271
|
+
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9272
|
+
return (React__namespace.createElement("svg", __assign({ width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", strokeWidth: props.strokeWidth || 1.5, "aria-labelledby": titleId }, props),
|
|
9273
|
+
title ? React__namespace.createElement("title", { id: titleId }, title) : null,
|
|
9274
|
+
React__namespace.createElement("path", { d: "M24 15h-4.91l4.336 7.5H6.973l3.129-5.426a6.965 6.965 0 0 1-1.618.68A6.784 6.784 0 0 1 6.75 18a6.677 6.677 0 0 1-4.77-1.98 6.952 6.952 0 0 1-1.44-2.145A6.681 6.681 0 0 1 0 11.25a6.677 6.677 0 0 1 1.98-4.77 6.952 6.952 0 0 1 2.145-1.44A6.681 6.681 0 0 1 6.75 4.5c.664 0 1.313.094 1.945.281a6.579 6.579 0 0 1 1.805.856V1.5H24V15ZM6.75 16.5c.727 0 1.406-.137 2.04-.41a5.208 5.208 0 0 0 1.663-1.137 5.488 5.488 0 0 0 1.125-1.664A5.17 5.17 0 0 0 12 11.25c0-.719-.137-1.395-.41-2.027a5.448 5.448 0 0 0-1.125-1.676A5.054 5.054 0 0 0 8.8 6.422 5.555 5.555 0 0 0 6.75 6c-.727 0-1.406.137-2.04.41A5.305 5.305 0 0 0 1.923 9.2a5.258 5.258 0 0 0-.422 2.05c0 .727.137 1.406.41 2.04a5.305 5.305 0 0 0 2.79 2.788 5.257 5.257 0 0 0 2.05.422ZM20.824 21a1846.92 1846.92 0 0 1-2.812-4.875 1846.92 1846.92 0 0 0-2.813-4.875 1846.92 1846.92 0 0 0-2.812 4.875c-.93 1.617-1.867 3.242-2.813 4.875h11.25ZM22.5 3H12v4.066A6.7 6.7 0 0 1 13.102 9c.257.703.39 1.438.398 2.203l1.7-2.953 3.023 5.25H22.5V3Z", fill: props.color || "currentColor" })));
|
|
9275
|
+
};
|
|
9276
|
+
|
|
9256
9277
|
var SvgShare2 = function (_a) {
|
|
9257
9278
|
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9258
9279
|
return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: props.strokeWidth || 1.5, strokeLinecap: "round", strokeLinejoin: "round", className: "share-2_svg__feather share-2_svg__feather-share-2", "aria-labelledby": titleId }, props),
|
|
@@ -10480,6 +10501,7 @@ var Icon = /*#__PURE__*/Object.freeze({
|
|
|
10480
10501
|
Power: SvgPower,
|
|
10481
10502
|
Printer: SvgPrinter,
|
|
10482
10503
|
Process: SvgProcess,
|
|
10504
|
+
ProjectSetting: SvgProjectSetting,
|
|
10483
10505
|
QuoteRight: SvgQuoteRight,
|
|
10484
10506
|
Radio: SvgRadio,
|
|
10485
10507
|
RefreshCcw: SvgRefreshCcw,
|
|
@@ -10499,6 +10521,7 @@ var Icon = /*#__PURE__*/Object.freeze({
|
|
|
10499
10521
|
SendHorFill: SvgSendHorFill,
|
|
10500
10522
|
Server: SvgServer,
|
|
10501
10523
|
Settings: SvgSettings,
|
|
10524
|
+
ShapeGroup: SvgShapeGroup,
|
|
10502
10525
|
Share: SvgShare,
|
|
10503
10526
|
Share2: SvgShare2,
|
|
10504
10527
|
Share3: SvgShare3,
|
|
@@ -19965,45 +19988,46 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19965
19988
|
};
|
|
19966
19989
|
const applySetting = (cols) => {
|
|
19967
19990
|
return cols.map((cell) => {
|
|
19968
|
-
const
|
|
19991
|
+
const newCell = { ...cell };
|
|
19992
|
+
const setting = settingColumns?.find((s) => s.field === newCell.field);
|
|
19969
19993
|
if (setting) {
|
|
19970
|
-
|
|
19971
|
-
if (!
|
|
19972
|
-
|
|
19994
|
+
newCell.sortOrder = setting.sortOrder;
|
|
19995
|
+
if (!newCell.visibleLocked) {
|
|
19996
|
+
newCell.visible = setting.visible ?? true;
|
|
19973
19997
|
}
|
|
19974
|
-
|
|
19998
|
+
newCell.fixedType = setting.fixedType;
|
|
19975
19999
|
if (setting.width !== undefined && setting.width !== null) {
|
|
19976
|
-
|
|
20000
|
+
newCell.width = setting.width;
|
|
19977
20001
|
}
|
|
19978
20002
|
if (setting.fraction !== undefined && setting.fraction !== null) {
|
|
19979
|
-
if (
|
|
19980
|
-
|
|
20003
|
+
if (newCell.numericSettings) {
|
|
20004
|
+
newCell.numericSettings.fraction = setting.fraction;
|
|
19981
20005
|
}
|
|
19982
20006
|
else {
|
|
19983
|
-
|
|
20007
|
+
newCell.numericSettings = { fraction: setting.fraction };
|
|
19984
20008
|
}
|
|
19985
20009
|
}
|
|
19986
|
-
|
|
20010
|
+
newCell.headerDisplay = setting.headerText || (newCell.headerDisplay ?? newCell.headerText);
|
|
19987
20011
|
}
|
|
19988
20012
|
else {
|
|
19989
|
-
if (
|
|
19990
|
-
|
|
19991
|
-
|
|
19992
|
-
if (
|
|
19993
|
-
|
|
20013
|
+
if (newCell.columns?.length) {
|
|
20014
|
+
newCell.columns = applySetting(newCell.columns);
|
|
20015
|
+
newCell.sortOrder = newCell.columns[0].sortOrder;
|
|
20016
|
+
if (newCell.columns.some((x) => x.visible !== false)) {
|
|
20017
|
+
newCell.visible = true;
|
|
19994
20018
|
}
|
|
19995
20019
|
else {
|
|
19996
|
-
|
|
20020
|
+
newCell.visible = false;
|
|
19997
20021
|
}
|
|
19998
20022
|
}
|
|
19999
20023
|
else {
|
|
20000
|
-
if (!
|
|
20001
|
-
|
|
20024
|
+
if (!newCell.visibleLocked) {
|
|
20025
|
+
newCell.visible = false;
|
|
20002
20026
|
}
|
|
20003
20027
|
}
|
|
20004
20028
|
}
|
|
20005
|
-
|
|
20006
|
-
return
|
|
20029
|
+
newCell.isGroup = groupColumns?.includes(newCell.field);
|
|
20030
|
+
return newCell;
|
|
20007
20031
|
});
|
|
20008
20032
|
};
|
|
20009
20033
|
const traverse = (cols, level = 0) => {
|
|
@@ -20047,10 +20071,8 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20047
20071
|
}, 0);
|
|
20048
20072
|
};
|
|
20049
20073
|
calcTotalRightWidth(columns);
|
|
20050
|
-
|
|
20051
|
-
|
|
20052
|
-
}
|
|
20053
|
-
traverse(columns);
|
|
20074
|
+
const newColumns = (settingColumns?.length ?? 0) > 0 ? applySetting(columns) : columns;
|
|
20075
|
+
traverse(newColumns);
|
|
20054
20076
|
// Danh sách các cột được hiển thị
|
|
20055
20077
|
// const flatVisble = flat.filter((e) => e.visible !== false)
|
|
20056
20078
|
const flatVisbleContent = flat.filter((x) => x.visible !== false && x.field !== 'command' && x.field !== '#' && x.field !== 'checkbox');
|
|
@@ -20275,7 +20297,7 @@ const TableElement$1 = React__default["default"].memo((props) => {
|
|
|
20275
20297
|
|
|
20276
20298
|
const defaultMaxHeight$1 = 250;
|
|
20277
20299
|
const SelectTable = React$5.forwardRef((props, ref) => {
|
|
20278
|
-
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
|
|
20300
|
+
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;
|
|
20279
20301
|
const selectTableRef = React$5.useRef(null);
|
|
20280
20302
|
const selectMenuTableRef = React$5.useRef(null);
|
|
20281
20303
|
const inputRef = React$5.useRef(null);
|
|
@@ -20292,8 +20314,8 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20292
20314
|
{
|
|
20293
20315
|
headerText: 'Name',
|
|
20294
20316
|
field: fieldLabel ?? 'label',
|
|
20295
|
-
width: menuWidth
|
|
20296
|
-
}
|
|
20317
|
+
width: menuWidth
|
|
20318
|
+
}
|
|
20297
20319
|
];
|
|
20298
20320
|
const closeMenu = () => {
|
|
20299
20321
|
setDropdownOpen(false);
|
|
@@ -20307,7 +20329,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20307
20329
|
...val,
|
|
20308
20330
|
[fieldLabel ?? 'label']: val.valueCreate,
|
|
20309
20331
|
isCreated: undefined,
|
|
20310
|
-
isCreatedItem: true
|
|
20332
|
+
isCreatedItem: true
|
|
20311
20333
|
};
|
|
20312
20334
|
options.unshift(newVal);
|
|
20313
20335
|
onChange(newVal);
|
|
@@ -20317,9 +20339,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20317
20339
|
};
|
|
20318
20340
|
React$5.useEffect(() => {
|
|
20319
20341
|
if (dropdownOpen && value && !isMulti && selectMenuTableRef) {
|
|
20320
|
-
const index = currentOptions?.findIndex((row) => compareFunction
|
|
20321
|
-
? compareFunction(row)
|
|
20322
|
-
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']);
|
|
20342
|
+
const index = currentOptions?.findIndex((row) => (compareFunction ? compareFunction(row) : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']));
|
|
20323
20343
|
if (index >= 0) {
|
|
20324
20344
|
selectMenuTableRef.current.scrollTo({ top: (index - 1) * 30 });
|
|
20325
20345
|
}
|
|
@@ -20366,28 +20386,14 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20366
20386
|
}
|
|
20367
20387
|
}
|
|
20368
20388
|
};
|
|
20369
|
-
const listKeyUse = [
|
|
20370
|
-
'Escape',
|
|
20371
|
-
'Space',
|
|
20372
|
-
'Enter',
|
|
20373
|
-
'Tab',
|
|
20374
|
-
'NumpadEnter',
|
|
20375
|
-
'ArrowDown',
|
|
20376
|
-
'ArrowUp',
|
|
20377
|
-
'F9',
|
|
20378
|
-
];
|
|
20389
|
+
const listKeyUse = ['Escape', 'Space', 'Enter', 'Tab', 'NumpadEnter', 'ArrowDown', 'ArrowUp', 'F9'];
|
|
20379
20390
|
const handleOnKeyDown = (e) => {
|
|
20380
20391
|
let key = '';
|
|
20381
20392
|
if (onKeyDown &&
|
|
20382
20393
|
(!dropdownOpen ||
|
|
20383
20394
|
!listKeyUse.includes(e.code) ||
|
|
20384
|
-
((e.code === 'Enter' ||
|
|
20385
|
-
|
|
20386
|
-
e.code === 'NumpadEnter' ||
|
|
20387
|
-
e.code === 'Space') &&
|
|
20388
|
-
!(currentOptions[indexFocus] || haveCreateNew)) ||
|
|
20389
|
-
((e.code === 'ArrowDown' || e.code === 'ArrowUp') &&
|
|
20390
|
-
currentOptions.length === 0) ||
|
|
20395
|
+
((e.code === 'Enter' || e.code === 'Tab' || e.code === 'NumpadEnter' || e.code === 'Space') && !(currentOptions[indexFocus] || haveCreateNew)) ||
|
|
20396
|
+
((e.code === 'ArrowDown' || e.code === 'ArrowUp') && currentOptions.length === 0) ||
|
|
20391
20397
|
(e.code === 'Escape' && !(isClearable && value && !isDisabled)))) {
|
|
20392
20398
|
key = onKeyDown(e);
|
|
20393
20399
|
}
|
|
@@ -20404,7 +20410,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20404
20410
|
valueCreate: searchTerm,
|
|
20405
20411
|
[fieldValue ?? 'value']: searchTerm,
|
|
20406
20412
|
[fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`,
|
|
20407
|
-
isCreated: true
|
|
20413
|
+
isCreated: true
|
|
20408
20414
|
};
|
|
20409
20415
|
}
|
|
20410
20416
|
else {
|
|
@@ -20426,16 +20432,14 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20426
20432
|
flag = true;
|
|
20427
20433
|
}
|
|
20428
20434
|
}
|
|
20429
|
-
else if (e.code === 'Enter' ||
|
|
20430
|
-
e.code === 'Tab' ||
|
|
20431
|
-
e.code === 'NumpadEnter') {
|
|
20435
|
+
else if (e.code === 'Enter' || e.code === 'Tab' || e.code === 'NumpadEnter') {
|
|
20432
20436
|
let newItem;
|
|
20433
20437
|
if (haveCreateNew && indexFocus === 0) {
|
|
20434
20438
|
newItem = {
|
|
20435
20439
|
valueCreate: searchTerm,
|
|
20436
20440
|
[fieldValue ?? 'value']: searchTerm,
|
|
20437
20441
|
[fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`,
|
|
20438
|
-
isCreated: true
|
|
20442
|
+
isCreated: true
|
|
20439
20443
|
};
|
|
20440
20444
|
}
|
|
20441
20445
|
else {
|
|
@@ -20454,10 +20458,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20454
20458
|
newIndex = indexFocus + 1;
|
|
20455
20459
|
}
|
|
20456
20460
|
else if (value) {
|
|
20457
|
-
newIndex =
|
|
20458
|
-
currentOptions?.findIndex((row) => compareFunction
|
|
20459
|
-
? compareFunction(row)
|
|
20460
|
-
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']) + 1;
|
|
20461
|
+
newIndex = currentOptions?.findIndex((row) => (compareFunction ? compareFunction(row) : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value'])) + 1;
|
|
20461
20462
|
}
|
|
20462
20463
|
if (newIndex < currentOptions.length) {
|
|
20463
20464
|
setIndexFocus(newIndex);
|
|
@@ -20481,10 +20482,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20481
20482
|
newIndex = indexFocus - 1;
|
|
20482
20483
|
}
|
|
20483
20484
|
else if (value) {
|
|
20484
|
-
newIndex =
|
|
20485
|
-
currentOptions?.findIndex((row) => compareFunction
|
|
20486
|
-
? compareFunction(row)
|
|
20487
|
-
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']) - 1;
|
|
20485
|
+
newIndex = currentOptions?.findIndex((row) => (compareFunction ? compareFunction(row) : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value'])) - 1;
|
|
20488
20486
|
}
|
|
20489
20487
|
if (newIndex >= 0) {
|
|
20490
20488
|
setIndexFocus(newIndex);
|
|
@@ -20517,11 +20515,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20517
20515
|
scrollToElement(selectMenuTableRef.current, selectMenuTableRef.current.scrollHeight);
|
|
20518
20516
|
}
|
|
20519
20517
|
else if (flag === 0 && rect.bottom + 30 > parentRect.bottom) {
|
|
20520
|
-
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop -
|
|
20521
|
-
selectMenuTableRef.current.offsetTop -
|
|
20522
|
-
parentRect.height +
|
|
20523
|
-
rect.height +
|
|
20524
|
-
50);
|
|
20518
|
+
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - selectMenuTableRef.current.offsetTop - parentRect.height + rect.height + 50);
|
|
20525
20519
|
}
|
|
20526
20520
|
else if (flag === 2 && rect.top < parentRect.top + 50) {
|
|
20527
20521
|
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - 65);
|
|
@@ -20535,7 +20529,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20535
20529
|
timeOutElement = setTimeout(() => {
|
|
20536
20530
|
elemment.scrollTo({
|
|
20537
20531
|
top,
|
|
20538
|
-
behavior: 'smooth'
|
|
20532
|
+
behavior: 'smooth'
|
|
20539
20533
|
});
|
|
20540
20534
|
}, 100);
|
|
20541
20535
|
};
|
|
@@ -20545,12 +20539,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20545
20539
|
}
|
|
20546
20540
|
for (let index = 0; index < columnsSearch.length; index++) {
|
|
20547
20541
|
const key = columnsSearch[index].field.trim();
|
|
20548
|
-
if (data[key] &&
|
|
20549
|
-
data[key]
|
|
20550
|
-
.toString()
|
|
20551
|
-
.trim()
|
|
20552
|
-
.toLowerCase()
|
|
20553
|
-
.includes(keyword.trim().toLowerCase())) {
|
|
20542
|
+
if (data[key] && data[key].toString().trim().toLowerCase().includes(keyword.trim().toLowerCase())) {
|
|
20554
20543
|
return true;
|
|
20555
20544
|
}
|
|
20556
20545
|
}
|
|
@@ -20566,8 +20555,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20566
20555
|
if (!searchTerm) {
|
|
20567
20556
|
setOptionsLoad(undefined);
|
|
20568
20557
|
}
|
|
20569
|
-
else if (allowCreate &&
|
|
20570
|
-
!currentOptions?.find((x) => x[fieldLabel ?? 'label'] === searchTerm)) {
|
|
20558
|
+
else if (allowCreate && !currentOptions?.find((x) => x[fieldLabel ?? 'label'] === searchTerm)) {
|
|
20571
20559
|
setHaveCreateNew(true);
|
|
20572
20560
|
return;
|
|
20573
20561
|
}
|
|
@@ -20581,22 +20569,15 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20581
20569
|
const { indexRow, row, isSelected, level = 0 } = props;
|
|
20582
20570
|
return (jsxRuntime.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 && (jsxRuntime.jsx("td", { className: classNames$1(`r-select-rowcell`, {
|
|
20583
20571
|
'r-select-move': indexFocus === indexRow,
|
|
20584
|
-
'r-select-active': !isMulti &&
|
|
20585
|
-
value &&
|
|
20586
|
-
(compareFunction
|
|
20587
|
-
? compareFunction(row)
|
|
20588
|
-
: value[fieldValue ?? 'value'] ===
|
|
20589
|
-
row[fieldValue ?? 'value']),
|
|
20572
|
+
'r-select-active': !isMulti && value && (compareFunction ? compareFunction(row) : value[fieldValue ?? 'value'] === row[fieldValue ?? 'value'])
|
|
20590
20573
|
}), style: {
|
|
20591
20574
|
width: 40,
|
|
20592
20575
|
textAlign: 'center',
|
|
20593
20576
|
padding: 0,
|
|
20594
|
-
paddingBottom: 6
|
|
20577
|
+
paddingBottom: 6
|
|
20595
20578
|
}, onClick: (e) => {
|
|
20596
20579
|
if (isMulti) {
|
|
20597
|
-
const index = value?.findIndex((x) => compareFunction
|
|
20598
|
-
? compareFunction(row)
|
|
20599
|
-
: x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']);
|
|
20580
|
+
const index = value?.findIndex((x) => (compareFunction ? compareFunction(row) : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']));
|
|
20600
20581
|
if (index > -1) {
|
|
20601
20582
|
value?.splice(index, 1);
|
|
20602
20583
|
handChange([...value]);
|
|
@@ -20614,42 +20595,28 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20614
20595
|
}
|
|
20615
20596
|
}, children: jsxRuntime.jsx(Input$1, { checked: isSelected, type: "checkbox", className: "cursor-pointer", onChange: () => { }, style: { textAlign: 'center', marginTop: 6 } }) })), (columns ? columns : defaultColumns).map((col, indexCol) => {
|
|
20616
20597
|
let valueDisplay = row[col.field];
|
|
20617
|
-
if (col.type === 'numeric' ||
|
|
20618
|
-
(col.
|
|
20619
|
-
valueDisplay =
|
|
20620
|
-
formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? '.', formatSetting?.thousandSeparator ?? ',', col.fraction ?? 0, true, false) ?? 0;
|
|
20598
|
+
if (col.type === 'numeric' || (col.typeCondition && col.typeCondition(row) === 'numeric')) {
|
|
20599
|
+
valueDisplay = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? '.', formatSetting?.thousandSeparator ?? ',', col.fraction ?? 0, true, false) ?? 0;
|
|
20621
20600
|
}
|
|
20622
20601
|
else if (col.type === 'date') {
|
|
20623
|
-
valueDisplay = valueDisplay
|
|
20624
|
-
? formatDateTime(valueDisplay, formatSetting?.dateFormat)
|
|
20625
|
-
: '';
|
|
20602
|
+
valueDisplay = valueDisplay ? formatDateTime(valueDisplay, formatSetting?.dateFormat) : '';
|
|
20626
20603
|
}
|
|
20627
20604
|
else if (col.type === 'datetime') {
|
|
20628
|
-
valueDisplay = valueDisplay
|
|
20629
|
-
? formatDateTime(valueDisplay, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
20630
|
-
: '';
|
|
20605
|
+
valueDisplay = valueDisplay ? formatDateTime(valueDisplay, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
|
|
20631
20606
|
}
|
|
20632
20607
|
return (jsxRuntime.jsxs(React$5.Fragment, { children: [col.visible !== false && (jsxRuntime.jsx("td", { id: `select-${id}-${indexRow}-${indexCol}`,
|
|
20633
20608
|
// ref={refRow}
|
|
20634
20609
|
className: classNames$1(`r-select-rowcell`, {
|
|
20635
20610
|
'r-select-move': indexFocus === indexRow,
|
|
20636
|
-
'r-select-active': !isMulti &&
|
|
20637
|
-
value &&
|
|
20638
|
-
(compareFunction
|
|
20639
|
-
? compareFunction(row)
|
|
20640
|
-
: value[fieldValue ?? 'value'] ===
|
|
20641
|
-
row[fieldValue ?? 'value']),
|
|
20611
|
+
'r-select-active': !isMulti && value && (compareFunction ? compareFunction(row) : value[fieldValue ?? 'value'] === row[fieldValue ?? 'value'])
|
|
20642
20612
|
}), style: {
|
|
20643
20613
|
minWidth: col.minWidth,
|
|
20644
20614
|
width: col.width,
|
|
20645
20615
|
maxWidth: col.maxWidth,
|
|
20646
|
-
textAlign: col.textAlign ? col.textAlign : 'left'
|
|
20616
|
+
textAlign: col.textAlign ? col.textAlign : 'left'
|
|
20647
20617
|
}, onClick: (e) => {
|
|
20648
20618
|
if (isMulti) {
|
|
20649
|
-
const index = value?.findIndex((x) => compareFunction
|
|
20650
|
-
? compareFunction(row)
|
|
20651
|
-
: x[fieldValue ?? 'value'] ===
|
|
20652
|
-
row[fieldValue ?? 'value']);
|
|
20619
|
+
const index = value?.findIndex((x) => (compareFunction ? compareFunction(row) : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']));
|
|
20653
20620
|
if (index > -1) {
|
|
20654
20621
|
value?.splice(index, 1);
|
|
20655
20622
|
handChange([...value]);
|
|
@@ -20676,7 +20643,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20676
20643
|
setIndexFocus(indexRow);
|
|
20677
20644
|
}
|
|
20678
20645
|
e.stopPropagation();
|
|
20679
|
-
}, children: col.template ?
|
|
20646
|
+
}, children: col.template ? col.template(row, indexRow) : col.type === 'numeric' && Number(row[col.field]) < 0 ? jsxRuntime.jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [" ", `${formatSetting?.prefixNegative ?? '-'}${value}${formatSetting?.suffixNegative ?? ''}`] }) : valueDisplay }, `col-${indexRow}-${indexCol}`)), checkOverflow(indexRow, indexCol) && (jsxRuntime.jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `select-${id}-${indexRow}-${indexCol}`, children: col.template ? col.template(row, indexRow) : valueDisplay }))] }, indexCol));
|
|
20680
20647
|
})] }, `row-${indexRow}`));
|
|
20681
20648
|
});
|
|
20682
20649
|
return (jsxRuntime.jsx("div", { className: classNames$1('react-select-table', { 'is-invalid': invalid }), ref: ref, id: id, children: jsxRuntime.jsx("div", { ref: selectTableRef, children: jsxRuntime.jsxs(Dropdown$1$1, { isOpen: dropdownOpen, toggle: () => { }, onMouseDown: (e) => e.preventDefault(), children: [jsxRuntime.jsxs(DropdownToggle$1, { onClick: (e) => {
|
|
@@ -20686,26 +20653,14 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20686
20653
|
}
|
|
20687
20654
|
e.preventDefault();
|
|
20688
20655
|
}, tag: "div", style: {
|
|
20689
|
-
width: width
|
|
20690
|
-
? width
|
|
20691
|
-
: selectTableRef?.current?.clientWidth
|
|
20692
|
-
? selectTableRef?.current?.clientWidth
|
|
20693
|
-
: 'auto',
|
|
20656
|
+
width: width ? width : selectTableRef?.current?.clientWidth ? selectTableRef?.current?.clientWidth : 'auto'
|
|
20694
20657
|
}, 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: [jsxRuntime.jsxs("div", { className: "select-table-container", children: [isMulti ? (jsxRuntime.jsx("div", { className: classNames$1('select-value is-mutil', {
|
|
20695
|
-
'd-none': searchTerm
|
|
20658
|
+
'd-none': searchTerm
|
|
20696
20659
|
}), children: value?.map((ele, index) => {
|
|
20697
|
-
return (jsxRuntime.jsxs("span", { children: [index === 0 ? '' : ', ', formatOptionLabel
|
|
20698
|
-
? formatOptionLabel(ele)
|
|
20699
|
-
: ele[fieldLabel ?? 'label']] }, index));
|
|
20660
|
+
return (jsxRuntime.jsxs("span", { children: [index === 0 ? '' : ', ', formatOptionLabel ? formatOptionLabel(ele) : ele[fieldLabel ?? 'label']] }, index));
|
|
20700
20661
|
}) })) : (jsxRuntime.jsxs("div", { className: classNames$1('select-value', {
|
|
20701
|
-
'd-none': searchTerm
|
|
20702
|
-
}), children: [value
|
|
20703
|
-
? formatOptionLabel
|
|
20704
|
-
? formatOptionLabel(value)
|
|
20705
|
-
: value[fieldLabel ?? 'label']
|
|
20706
|
-
: '', ' '] })), !((isMulti ? value?.length > 0 : value) ||
|
|
20707
|
-
isDisabled ||
|
|
20708
|
-
searchTerm) && (jsxRuntime.jsx("div", { className: classNames$1('select-placeholder'), children: placeholder })), jsxRuntime.jsx("div", { className: "input-container", children: jsxRuntime.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) => {
|
|
20662
|
+
'd-none': searchTerm
|
|
20663
|
+
}), children: [value ? (formatOptionLabel ? formatOptionLabel(value) : value[fieldLabel ?? 'label']) : '', ' '] })), !((isMulti ? value?.length > 0 : value) || isDisabled || searchTerm) && jsxRuntime.jsx("div", { className: classNames$1('select-placeholder'), children: placeholder }), jsxRuntime.jsx("div", { className: "input-container", children: jsxRuntime.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) => {
|
|
20709
20664
|
if (val.target.value) {
|
|
20710
20665
|
if (loadOptions && val.target.value) {
|
|
20711
20666
|
setIsLoading(true);
|
|
@@ -20727,23 +20682,21 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20727
20682
|
width: width ? width + 2 : 'min-content',
|
|
20728
20683
|
position: 'fixed',
|
|
20729
20684
|
borderRadius: 4,
|
|
20730
|
-
zIndex: 9999
|
|
20685
|
+
zIndex: 9999
|
|
20731
20686
|
}, children: jsxRuntime.jsx(DropdownItem$1, { className: classNames$1('p-0 menu-select-table'), tag: "div", header: true, children: dropdownOpen && (jsxRuntime.jsx("div", { style: { backgroundColor: 'none' }, onMouseDown: (e) => {
|
|
20732
20687
|
if (!isDisabled) {
|
|
20733
20688
|
inputRef?.current.focus();
|
|
20734
20689
|
e.preventDefault();
|
|
20735
20690
|
}
|
|
20736
20691
|
}, children: jsxRuntime.jsxs("div", { className: "r-select-grid", children: [jsxRuntime.jsx("div", { className: classNames$1('r-select-gridtable', {
|
|
20737
|
-
'no-header': noHeader || (columns?.length ?? 0) === 0
|
|
20692
|
+
'no-header': noHeader || (columns?.length ?? 0) === 0
|
|
20738
20693
|
}), ref: selectMenuTableRef, style: {
|
|
20739
20694
|
width: menuWidth,
|
|
20740
20695
|
minWidth: selectTableRef?.current?.clientWidth,
|
|
20741
|
-
maxHeight: maxHeight ?? defaultMaxHeight$1
|
|
20696
|
+
maxHeight: maxHeight ?? defaultMaxHeight$1
|
|
20742
20697
|
}, children: jsxRuntime.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 }) }), jsxRuntime.jsxs("div", { className: classNames$1('r-select-footer', {
|
|
20743
|
-
'd-none': !(showFooter === true ||
|
|
20744
|
-
|
|
20745
|
-
isMulti),
|
|
20746
|
-
}), children: [jsxRuntime.jsxs(Button$1$1, { outline: true, color: "primary", onClick: () => handleAdd?.(), className: classNames$1('r-btn d-flex align-items-center', { 'd-none': !handleAdd }), children: [jsxRuntime.jsx(SvgPlus, { className: "me-50", fontSize: 16 }), t('AddNew'), " (F9)"] }), isMulti && (jsxRuntime.jsx("div", { className: "ms-50 text-primary h-100 d-flex align-items-center", children: t('countSelected', { item: value?.length ?? 0 }) })), footerComponent ? footerComponent() : null] })] }) })) }) })] }) }) }));
|
|
20698
|
+
'd-none': !(showFooter === true || handleAdd || isMulti)
|
|
20699
|
+
}), children: [jsxRuntime.jsxs(Button$1$1, { outline: true, color: "primary", onClick: () => handleAdd?.(), className: classNames$1('r-btn d-flex align-items-center', { 'd-none': !handleAdd }), children: [jsxRuntime.jsx(SvgPlus, { className: "me-50", fontSize: 16 }), t('AddNew'), " (F9)"] }), isMulti && jsxRuntime.jsx("div", { className: "ms-50 text-primary h-100 d-flex align-items-center", children: t('countSelected', { item: value?.length ?? 0 }) }), footerComponent ? footerComponent() : null] })] }) })) }) })] }) }) }));
|
|
20747
20700
|
});
|
|
20748
20701
|
|
|
20749
20702
|
const PagingComponent = ({ totalItem, gridRef, pageSize, currentPage, onChangePage, pageOptions, onChangePageSize }) => {
|
|
@@ -25669,6 +25622,72 @@ function startOfYear(date, options) {
|
|
|
25669
25622
|
return date_;
|
|
25670
25623
|
}
|
|
25671
25624
|
|
|
25625
|
+
/**
|
|
25626
|
+
* The {@link eachYearOfInterval} function options.
|
|
25627
|
+
*/
|
|
25628
|
+
|
|
25629
|
+
/**
|
|
25630
|
+
* The {@link eachYearOfInterval} function result type. It resolves the proper data type.
|
|
25631
|
+
* It uses the first argument date object type, starting from the date argument,
|
|
25632
|
+
* then the start interval date, and finally the end interval date. If
|
|
25633
|
+
* a context function is passed, it uses the context function return type.
|
|
25634
|
+
*/
|
|
25635
|
+
|
|
25636
|
+
/**
|
|
25637
|
+
* @name eachYearOfInterval
|
|
25638
|
+
* @category Interval Helpers
|
|
25639
|
+
* @summary Return the array of yearly timestamps within the specified time interval.
|
|
25640
|
+
*
|
|
25641
|
+
* @description
|
|
25642
|
+
* Return the array of yearly timestamps within the specified time interval.
|
|
25643
|
+
*
|
|
25644
|
+
* @typeParam IntervalType - Interval type.
|
|
25645
|
+
* @typeParam Options - Options type.
|
|
25646
|
+
*
|
|
25647
|
+
* @param interval - The interval.
|
|
25648
|
+
* @param options - An object with options.
|
|
25649
|
+
*
|
|
25650
|
+
* @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
|
|
25651
|
+
*
|
|
25652
|
+
* @example
|
|
25653
|
+
* // Each year between 6 February 2014 and 10 August 2017:
|
|
25654
|
+
* const result = eachYearOfInterval({
|
|
25655
|
+
* start: new Date(2014, 1, 6),
|
|
25656
|
+
* end: new Date(2017, 7, 10)
|
|
25657
|
+
* })
|
|
25658
|
+
* //=> [
|
|
25659
|
+
* // Wed Jan 01 2014 00:00:00,
|
|
25660
|
+
* // Thu Jan 01 2015 00:00:00,
|
|
25661
|
+
* // Fri Jan 01 2016 00:00:00,
|
|
25662
|
+
* // Sun Jan 01 2017 00:00:00
|
|
25663
|
+
* // ]
|
|
25664
|
+
*/
|
|
25665
|
+
function eachYearOfInterval(interval, options) {
|
|
25666
|
+
const { start, end } = normalizeInterval(options?.in, interval);
|
|
25667
|
+
|
|
25668
|
+
let reversed = +start > +end;
|
|
25669
|
+
const endTime = reversed ? +start : +end;
|
|
25670
|
+
const date = reversed ? end : start;
|
|
25671
|
+
date.setHours(0, 0, 0, 0);
|
|
25672
|
+
date.setMonth(0, 1);
|
|
25673
|
+
|
|
25674
|
+
let step = options?.step ?? 1;
|
|
25675
|
+
if (!step) return [];
|
|
25676
|
+
if (step < 0) {
|
|
25677
|
+
step = -step;
|
|
25678
|
+
reversed = !reversed;
|
|
25679
|
+
}
|
|
25680
|
+
|
|
25681
|
+
const dates = [];
|
|
25682
|
+
|
|
25683
|
+
while (+date <= endTime) {
|
|
25684
|
+
dates.push(constructFrom(start, date));
|
|
25685
|
+
date.setFullYear(date.getFullYear() + step);
|
|
25686
|
+
}
|
|
25687
|
+
|
|
25688
|
+
return reversed ? dates.reverse() : dates;
|
|
25689
|
+
}
|
|
25690
|
+
|
|
25672
25691
|
/**
|
|
25673
25692
|
* The {@link endOfWeek} function options.
|
|
25674
25693
|
*/
|
|
@@ -26377,7 +26396,7 @@ const match = {
|
|
|
26377
26396
|
* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
|
|
26378
26397
|
* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
|
|
26379
26398
|
*/
|
|
26380
|
-
const enUS = {
|
|
26399
|
+
const enUS$1 = {
|
|
26381
26400
|
code: "en-US",
|
|
26382
26401
|
formatDistance: formatDistance,
|
|
26383
26402
|
formatLong: formatLong,
|
|
@@ -27894,7 +27913,7 @@ const unescapedLatinCharacterRegExp$1 = /[a-zA-Z]/;
|
|
|
27894
27913
|
*/
|
|
27895
27914
|
function format(date, formatStr, options) {
|
|
27896
27915
|
const defaultOptions = getDefaultOptions$1();
|
|
27897
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
27916
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS$1;
|
|
27898
27917
|
|
|
27899
27918
|
const firstWeekContainsDate =
|
|
27900
27919
|
options?.firstWeekContainsDate ??
|
|
@@ -30587,7 +30606,7 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
30587
30606
|
function parse(dateStr, formatStr, referenceDate, options) {
|
|
30588
30607
|
const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);
|
|
30589
30608
|
const defaultOptions = getDefaultOptions();
|
|
30590
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
30609
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS$1;
|
|
30591
30610
|
|
|
30592
30611
|
const firstWeekContainsDate =
|
|
30593
30612
|
options?.firstWeekContainsDate ??
|
|
@@ -31393,6 +31412,69 @@ function endOfBroadcastWeek(date, dateLib) {
|
|
|
31393
31412
|
return endDate;
|
|
31394
31413
|
}
|
|
31395
31414
|
|
|
31415
|
+
/** English (United States) locale extended with DayPicker-specific translations. */
|
|
31416
|
+
const enUS = {
|
|
31417
|
+
...enUS$1,
|
|
31418
|
+
labels: {
|
|
31419
|
+
labelDayButton: (date, modifiers, options, dateLib) => {
|
|
31420
|
+
let formatDate;
|
|
31421
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31422
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31423
|
+
}
|
|
31424
|
+
else {
|
|
31425
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31426
|
+
}
|
|
31427
|
+
let label = formatDate(date, "PPPP");
|
|
31428
|
+
if (modifiers.today)
|
|
31429
|
+
label = `Today, ${label}`;
|
|
31430
|
+
if (modifiers.selected)
|
|
31431
|
+
label = `${label}, selected`;
|
|
31432
|
+
return label;
|
|
31433
|
+
},
|
|
31434
|
+
labelMonthDropdown: "Choose the Month",
|
|
31435
|
+
labelNext: "Go to the Next Month",
|
|
31436
|
+
labelPrevious: "Go to the Previous Month",
|
|
31437
|
+
labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
|
|
31438
|
+
labelYearDropdown: "Choose the Year",
|
|
31439
|
+
labelGrid: (date, options, dateLib) => {
|
|
31440
|
+
let formatDate;
|
|
31441
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31442
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31443
|
+
}
|
|
31444
|
+
else {
|
|
31445
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31446
|
+
}
|
|
31447
|
+
return formatDate(date, "LLLL yyyy");
|
|
31448
|
+
},
|
|
31449
|
+
labelGridcell: (date, modifiers, options, dateLib) => {
|
|
31450
|
+
let formatDate;
|
|
31451
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31452
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31453
|
+
}
|
|
31454
|
+
else {
|
|
31455
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31456
|
+
}
|
|
31457
|
+
let label = formatDate(date, "PPPP");
|
|
31458
|
+
if (modifiers?.today) {
|
|
31459
|
+
label = `Today, ${label}`;
|
|
31460
|
+
}
|
|
31461
|
+
return label;
|
|
31462
|
+
},
|
|
31463
|
+
labelNav: "Navigation bar",
|
|
31464
|
+
labelWeekNumberHeader: "Week Number",
|
|
31465
|
+
labelWeekday: (date, options, dateLib) => {
|
|
31466
|
+
let formatDate;
|
|
31467
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31468
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31469
|
+
}
|
|
31470
|
+
else {
|
|
31471
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31472
|
+
}
|
|
31473
|
+
return formatDate(date, "cccc");
|
|
31474
|
+
},
|
|
31475
|
+
},
|
|
31476
|
+
};
|
|
31477
|
+
|
|
31396
31478
|
/**
|
|
31397
31479
|
* A wrapper class around [date-fns](http://date-fns.org) that provides utility
|
|
31398
31480
|
* methods for date manipulation and formatting.
|
|
@@ -31531,6 +31613,31 @@ class DateLib {
|
|
|
31531
31613
|
? this.overrides.eachMonthOfInterval(interval)
|
|
31532
31614
|
: eachMonthOfInterval(interval);
|
|
31533
31615
|
};
|
|
31616
|
+
/**
|
|
31617
|
+
* Returns the years between the given dates.
|
|
31618
|
+
*
|
|
31619
|
+
* @since 9.11.1
|
|
31620
|
+
* @param interval The interval to get the years for.
|
|
31621
|
+
* @returns The array of years in the interval.
|
|
31622
|
+
*/
|
|
31623
|
+
this.eachYearOfInterval = (interval) => {
|
|
31624
|
+
const years = this.overrides?.eachYearOfInterval
|
|
31625
|
+
? this.overrides.eachYearOfInterval(interval)
|
|
31626
|
+
: eachYearOfInterval(interval);
|
|
31627
|
+
// Remove duplicates that may happen across DST transitions (e.g., "America/Sao_Paulo")
|
|
31628
|
+
// See https://github.com/date-fns/tz/issues/72
|
|
31629
|
+
const uniqueYears = new Set(years.map((d) => this.getYear(d)));
|
|
31630
|
+
if (uniqueYears.size === years.length) {
|
|
31631
|
+
// No duplicates, return as is
|
|
31632
|
+
return years;
|
|
31633
|
+
}
|
|
31634
|
+
// Rebuild the array to ensure one date per year
|
|
31635
|
+
const yearsArray = [];
|
|
31636
|
+
uniqueYears.forEach((y) => {
|
|
31637
|
+
yearsArray.push(new Date(y, 0, 1));
|
|
31638
|
+
});
|
|
31639
|
+
return yearsArray;
|
|
31640
|
+
};
|
|
31534
31641
|
/**
|
|
31535
31642
|
* Returns the end of the broadcast week for the given date.
|
|
31536
31643
|
*
|
|
@@ -31869,7 +31976,63 @@ class DateLib {
|
|
|
31869
31976
|
formatNumber(value) {
|
|
31870
31977
|
return this.replaceDigits(value.toString());
|
|
31871
31978
|
}
|
|
31872
|
-
|
|
31979
|
+
/**
|
|
31980
|
+
* Returns the preferred ordering for month and year labels for the current
|
|
31981
|
+
* locale.
|
|
31982
|
+
*/
|
|
31983
|
+
getMonthYearOrder() {
|
|
31984
|
+
const code = this.options.locale?.code;
|
|
31985
|
+
if (!code) {
|
|
31986
|
+
return "month-first";
|
|
31987
|
+
}
|
|
31988
|
+
return DateLib.yearFirstLocales.has(code) ? "year-first" : "month-first";
|
|
31989
|
+
}
|
|
31990
|
+
/**
|
|
31991
|
+
* Formats the month/year pair respecting locale conventions.
|
|
31992
|
+
*
|
|
31993
|
+
* @since 9.11.0
|
|
31994
|
+
*/
|
|
31995
|
+
formatMonthYear(date) {
|
|
31996
|
+
const { locale, timeZone, numerals } = this.options;
|
|
31997
|
+
const localeCode = locale?.code;
|
|
31998
|
+
if (localeCode && DateLib.yearFirstLocales.has(localeCode)) {
|
|
31999
|
+
try {
|
|
32000
|
+
const intl = new Intl.DateTimeFormat(localeCode, {
|
|
32001
|
+
month: "long",
|
|
32002
|
+
year: "numeric",
|
|
32003
|
+
timeZone,
|
|
32004
|
+
numberingSystem: numerals,
|
|
32005
|
+
});
|
|
32006
|
+
const formatted = intl.format(date);
|
|
32007
|
+
return formatted;
|
|
32008
|
+
}
|
|
32009
|
+
catch {
|
|
32010
|
+
// Fallback to date-fns formatting below.
|
|
32011
|
+
}
|
|
32012
|
+
}
|
|
32013
|
+
const pattern = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
32014
|
+
return this.format(date, pattern);
|
|
32015
|
+
}
|
|
32016
|
+
}
|
|
32017
|
+
DateLib.yearFirstLocales = new Set([
|
|
32018
|
+
"eu",
|
|
32019
|
+
"hu",
|
|
32020
|
+
"ja",
|
|
32021
|
+
"ja-Hira",
|
|
32022
|
+
"ja-JP",
|
|
32023
|
+
"ko",
|
|
32024
|
+
"ko-KR",
|
|
32025
|
+
"lt",
|
|
32026
|
+
"lt-LT",
|
|
32027
|
+
"lv",
|
|
32028
|
+
"lv-LV",
|
|
32029
|
+
"mn",
|
|
32030
|
+
"mn-MN",
|
|
32031
|
+
"zh",
|
|
32032
|
+
"zh-CN",
|
|
32033
|
+
"zh-HK",
|
|
32034
|
+
"zh-TW",
|
|
32035
|
+
]);
|
|
31873
32036
|
/**
|
|
31874
32037
|
* The default date library with English locale.
|
|
31875
32038
|
*
|
|
@@ -31890,6 +32053,9 @@ class CalendarDay {
|
|
|
31890
32053
|
this.displayMonth = displayMonth;
|
|
31891
32054
|
this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
|
|
31892
32055
|
this.dateLib = dateLib;
|
|
32056
|
+
this.isoDate = dateLib.format(date, "yyyy-MM-dd");
|
|
32057
|
+
this.displayMonthId = dateLib.format(displayMonth, "yyyy-MM");
|
|
32058
|
+
this.dateMonthId = dateLib.format(date, "yyyy-MM");
|
|
31893
32059
|
}
|
|
31894
32060
|
/**
|
|
31895
32061
|
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
@@ -32065,7 +32231,7 @@ var UI;
|
|
|
32065
32231
|
/** The dropdown with the years. */
|
|
32066
32232
|
UI["YearsDropdown"] = "years_dropdown";
|
|
32067
32233
|
})(UI || (UI = {}));
|
|
32068
|
-
/** Enum representing flags for the {@link UI.Day} element. */
|
|
32234
|
+
/** Enum representing flags for the {@link UI | UI.Day} element. */
|
|
32069
32235
|
var DayFlag;
|
|
32070
32236
|
(function (DayFlag) {
|
|
32071
32237
|
/** The day is disabled. */
|
|
@@ -32080,8 +32246,8 @@ var DayFlag;
|
|
|
32080
32246
|
DayFlag["today"] = "today";
|
|
32081
32247
|
})(DayFlag || (DayFlag = {}));
|
|
32082
32248
|
/**
|
|
32083
|
-
* Enum representing selection states that can be applied to the
|
|
32084
|
-
* element in selection mode.
|
|
32249
|
+
* Enum representing selection states that can be applied to the
|
|
32250
|
+
* {@link UI | UI.Day} element in selection mode.
|
|
32085
32251
|
*/
|
|
32086
32252
|
var SelectionState;
|
|
32087
32253
|
(function (SelectionState) {
|
|
@@ -32531,7 +32697,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32531
32697
|
return isSameDay(date, matcher);
|
|
32532
32698
|
}
|
|
32533
32699
|
if (isDatesArray(matcher, dateLib)) {
|
|
32534
|
-
return matcher.
|
|
32700
|
+
return matcher.some((matcherDate) => isSameDay(date, matcherDate));
|
|
32535
32701
|
}
|
|
32536
32702
|
if (isDateRange(matcher)) {
|
|
32537
32703
|
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
@@ -32582,7 +32748,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32582
32748
|
* @returns A function that retrieves the modifiers for a given `CalendarDay`.
|
|
32583
32749
|
*/
|
|
32584
32750
|
function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
32585
|
-
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today, } = props;
|
|
32751
|
+
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today = dateLib.today(), } = props;
|
|
32586
32752
|
const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter, } = dateLib;
|
|
32587
32753
|
const computedNavStart = navStart && startOfMonth(navStart);
|
|
32588
32754
|
const computedNavEnd = navEnd && endOfMonth(navEnd);
|
|
@@ -32606,7 +32772,7 @@ function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
|
32606
32772
|
// Broadcast calendar will show outside days as default
|
|
32607
32773
|
(!broadcastCalendar && !showOutsideDays && isOutside) ||
|
|
32608
32774
|
(broadcastCalendar && showOutsideDays === false && isOutside);
|
|
32609
|
-
const isToday = isSameDay(date, today
|
|
32775
|
+
const isToday = isSameDay(date, today);
|
|
32610
32776
|
if (isOutside)
|
|
32611
32777
|
internalModifiersMap.outside.push(day);
|
|
32612
32778
|
if (isDisabled)
|
|
@@ -32765,7 +32931,7 @@ function getDefaultClassNames() {
|
|
|
32765
32931
|
/**
|
|
32766
32932
|
* Formats the caption of the month.
|
|
32767
32933
|
*
|
|
32768
|
-
* @defaultValue
|
|
32934
|
+
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
|
|
32769
32935
|
* @param month The date representing the month.
|
|
32770
32936
|
* @param options Configuration options for the date library.
|
|
32771
32937
|
* @param dateLib The date library to use for formatting. If not provided, a new
|
|
@@ -32775,7 +32941,8 @@ function getDefaultClassNames() {
|
|
|
32775
32941
|
* @see https://daypicker.dev/docs/translation#custom-formatters
|
|
32776
32942
|
*/
|
|
32777
32943
|
function formatCaption(month, options, dateLib) {
|
|
32778
|
-
|
|
32944
|
+
const lib = dateLib ?? new DateLib(options);
|
|
32945
|
+
return lib.formatMonthYear(month);
|
|
32779
32946
|
}
|
|
32780
32947
|
/**
|
|
32781
32948
|
* @private
|
|
@@ -32915,127 +33082,6 @@ function getFormatters(customFormatters) {
|
|
|
32915
33082
|
};
|
|
32916
33083
|
}
|
|
32917
33084
|
|
|
32918
|
-
/**
|
|
32919
|
-
* Returns the months to show in the dropdown.
|
|
32920
|
-
*
|
|
32921
|
-
* This function generates a list of months for the current year, formatted
|
|
32922
|
-
* using the provided formatter, and determines whether each month should be
|
|
32923
|
-
* disabled based on the navigation range.
|
|
32924
|
-
*
|
|
32925
|
-
* @param displayMonth The currently displayed month.
|
|
32926
|
-
* @param navStart The start date for navigation.
|
|
32927
|
-
* @param navEnd The end date for navigation.
|
|
32928
|
-
* @param formatters The formatters to use for formatting the month labels.
|
|
32929
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32930
|
-
* @returns An array of dropdown options representing the months, or `undefined`
|
|
32931
|
-
* if no months are available.
|
|
32932
|
-
*/
|
|
32933
|
-
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
32934
|
-
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
32935
|
-
const months = eachMonthOfInterval({
|
|
32936
|
-
start: startOfYear(displayMonth),
|
|
32937
|
-
end: endOfYear(displayMonth),
|
|
32938
|
-
});
|
|
32939
|
-
const options = months.map((month) => {
|
|
32940
|
-
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
32941
|
-
const value = getMonth(month);
|
|
32942
|
-
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
32943
|
-
(navEnd && month > startOfMonth(navEnd)) ||
|
|
32944
|
-
false;
|
|
32945
|
-
return { value, label, disabled };
|
|
32946
|
-
});
|
|
32947
|
-
return options;
|
|
32948
|
-
}
|
|
32949
|
-
|
|
32950
|
-
/**
|
|
32951
|
-
* Returns the computed style for a day based on its modifiers.
|
|
32952
|
-
*
|
|
32953
|
-
* This function merges the base styles for the day with any styles associated
|
|
32954
|
-
* with active modifiers.
|
|
32955
|
-
*
|
|
32956
|
-
* @param dayModifiers The modifiers applied to the day.
|
|
32957
|
-
* @param styles The base styles for the calendar elements.
|
|
32958
|
-
* @param modifiersStyles The styles associated with specific modifiers.
|
|
32959
|
-
* @returns The computed style for the day.
|
|
32960
|
-
*/
|
|
32961
|
-
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
32962
|
-
let style = { ...styles?.[UI.Day] };
|
|
32963
|
-
Object.entries(dayModifiers)
|
|
32964
|
-
.filter(([, active]) => active === true)
|
|
32965
|
-
.forEach(([modifier]) => {
|
|
32966
|
-
style = {
|
|
32967
|
-
...style,
|
|
32968
|
-
...modifiersStyles?.[modifier],
|
|
32969
|
-
};
|
|
32970
|
-
});
|
|
32971
|
-
return style;
|
|
32972
|
-
}
|
|
32973
|
-
|
|
32974
|
-
/**
|
|
32975
|
-
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
32976
|
-
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
32977
|
-
*
|
|
32978
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32979
|
-
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
32980
|
-
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
32981
|
-
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
32982
|
-
* @returns An array of 7 dates representing the weekdays.
|
|
32983
|
-
*/
|
|
32984
|
-
function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {
|
|
32985
|
-
const today = dateLib.today();
|
|
32986
|
-
const start = broadcastCalendar
|
|
32987
|
-
? dateLib.startOfBroadcastWeek(today, dateLib)
|
|
32988
|
-
: ISOWeek
|
|
32989
|
-
? dateLib.startOfISOWeek(today)
|
|
32990
|
-
: dateLib.startOfWeek(today);
|
|
32991
|
-
const days = [];
|
|
32992
|
-
for (let i = 0; i < 7; i++) {
|
|
32993
|
-
const day = dateLib.addDays(start, i);
|
|
32994
|
-
days.push(day);
|
|
32995
|
-
}
|
|
32996
|
-
return days;
|
|
32997
|
-
}
|
|
32998
|
-
|
|
32999
|
-
/**
|
|
33000
|
-
* Returns the years to display in the dropdown.
|
|
33001
|
-
*
|
|
33002
|
-
* This function generates a list of years between the navigation start and end
|
|
33003
|
-
* dates, formatted using the provided formatter.
|
|
33004
|
-
*
|
|
33005
|
-
* @param navStart The start date for navigation.
|
|
33006
|
-
* @param navEnd The end date for navigation.
|
|
33007
|
-
* @param formatters The formatters to use for formatting the year labels.
|
|
33008
|
-
* @param dateLib The date library to use for date manipulation.
|
|
33009
|
-
* @param reverse If true, reverses the order of the years (descending).
|
|
33010
|
-
* @returns An array of dropdown options representing the years, or `undefined`
|
|
33011
|
-
* if `navStart` or `navEnd` is not provided.
|
|
33012
|
-
*/
|
|
33013
|
-
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
33014
|
-
if (!navStart)
|
|
33015
|
-
return undefined;
|
|
33016
|
-
if (!navEnd)
|
|
33017
|
-
return undefined;
|
|
33018
|
-
const { startOfYear, endOfYear, addYears, getYear, isBefore, isSameYear } = dateLib;
|
|
33019
|
-
const firstNavYear = startOfYear(navStart);
|
|
33020
|
-
const lastNavYear = endOfYear(navEnd);
|
|
33021
|
-
const years = [];
|
|
33022
|
-
let year = firstNavYear;
|
|
33023
|
-
while (isBefore(year, lastNavYear) || isSameYear(year, lastNavYear)) {
|
|
33024
|
-
years.push(year);
|
|
33025
|
-
year = addYears(year, 1);
|
|
33026
|
-
}
|
|
33027
|
-
if (reverse)
|
|
33028
|
-
years.reverse();
|
|
33029
|
-
return years.map((year) => {
|
|
33030
|
-
const label = formatters.formatYearDropdown(year, dateLib);
|
|
33031
|
-
return {
|
|
33032
|
-
value: getYear(year),
|
|
33033
|
-
label,
|
|
33034
|
-
disabled: false,
|
|
33035
|
-
};
|
|
33036
|
-
});
|
|
33037
|
-
}
|
|
33038
|
-
|
|
33039
33085
|
/**
|
|
33040
33086
|
* Generates the ARIA label for a day button.
|
|
33041
33087
|
*
|
|
@@ -33069,7 +33115,7 @@ const labelDay = labelDayButton;
|
|
|
33069
33115
|
* Generates the ARIA label for the month grid, which is announced when entering
|
|
33070
33116
|
* the grid.
|
|
33071
33117
|
*
|
|
33072
|
-
* @defaultValue
|
|
33118
|
+
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
|
|
33073
33119
|
* @param date - The date representing the month.
|
|
33074
33120
|
* @param options - Optional configuration for the date formatting library.
|
|
33075
33121
|
* @param dateLib - An optional instance of the date formatting library.
|
|
@@ -33078,7 +33124,8 @@ const labelDay = labelDayButton;
|
|
|
33078
33124
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
33079
33125
|
*/
|
|
33080
33126
|
function labelGrid(date, options, dateLib) {
|
|
33081
|
-
|
|
33127
|
+
const lib = dateLib ?? new DateLib(options);
|
|
33128
|
+
return lib.formatMonthYear(date);
|
|
33082
33129
|
}
|
|
33083
33130
|
/**
|
|
33084
33131
|
* @ignore
|
|
@@ -33130,6 +33177,7 @@ function labelNav() {
|
|
|
33130
33177
|
return "";
|
|
33131
33178
|
}
|
|
33132
33179
|
|
|
33180
|
+
const defaultLabel = "Go to the Next Month";
|
|
33133
33181
|
/**
|
|
33134
33182
|
* Generates the ARIA label for the "next month" button.
|
|
33135
33183
|
*
|
|
@@ -33140,8 +33188,8 @@ function labelNav() {
|
|
|
33140
33188
|
* @group Labels
|
|
33141
33189
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
33142
33190
|
*/
|
|
33143
|
-
function labelNext(_month) {
|
|
33144
|
-
return
|
|
33191
|
+
function labelNext(_month, _options) {
|
|
33192
|
+
return defaultLabel;
|
|
33145
33193
|
}
|
|
33146
33194
|
|
|
33147
33195
|
/**
|
|
@@ -33230,6 +33278,316 @@ var defaultLabels = /*#__PURE__*/Object.freeze({
|
|
|
33230
33278
|
labelYearDropdown: labelYearDropdown
|
|
33231
33279
|
});
|
|
33232
33280
|
|
|
33281
|
+
const resolveLabel = (defaultLabel, customLabel, localeLabel) => {
|
|
33282
|
+
if (customLabel)
|
|
33283
|
+
return customLabel;
|
|
33284
|
+
if (localeLabel) {
|
|
33285
|
+
return (typeof localeLabel === "function"
|
|
33286
|
+
? localeLabel
|
|
33287
|
+
: (..._args) => localeLabel);
|
|
33288
|
+
}
|
|
33289
|
+
return defaultLabel;
|
|
33290
|
+
};
|
|
33291
|
+
/**
|
|
33292
|
+
* Merges custom labels from the props with the default labels.
|
|
33293
|
+
*
|
|
33294
|
+
* When available, uses the locale-provided translation for `labelNext`.
|
|
33295
|
+
*
|
|
33296
|
+
* @param customLabels The custom labels provided in the DayPicker props.
|
|
33297
|
+
* @param options Options from the date library, used to resolve locale
|
|
33298
|
+
* translations.
|
|
33299
|
+
* @returns The merged labels object with locale-aware defaults.
|
|
33300
|
+
*/
|
|
33301
|
+
function getLabels(customLabels, options) {
|
|
33302
|
+
const localeLabels = options.locale?.labels ?? {};
|
|
33303
|
+
return {
|
|
33304
|
+
...defaultLabels,
|
|
33305
|
+
...(customLabels ?? {}),
|
|
33306
|
+
labelDayButton: resolveLabel(labelDayButton, customLabels?.labelDayButton, localeLabels.labelDayButton),
|
|
33307
|
+
labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels?.labelMonthDropdown, localeLabels.labelMonthDropdown),
|
|
33308
|
+
labelNext: resolveLabel(labelNext, customLabels?.labelNext, localeLabels.labelNext),
|
|
33309
|
+
labelPrevious: resolveLabel(labelPrevious, customLabels?.labelPrevious, localeLabels.labelPrevious),
|
|
33310
|
+
labelWeekNumber: resolveLabel(labelWeekNumber, customLabels?.labelWeekNumber, localeLabels.labelWeekNumber),
|
|
33311
|
+
labelYearDropdown: resolveLabel(labelYearDropdown, customLabels?.labelYearDropdown, localeLabels.labelYearDropdown),
|
|
33312
|
+
labelGrid: resolveLabel(labelGrid, customLabels?.labelGrid, localeLabels.labelGrid),
|
|
33313
|
+
labelGridcell: resolveLabel(labelGridcell, customLabels?.labelGridcell, localeLabels.labelGridcell),
|
|
33314
|
+
labelNav: resolveLabel(labelNav, customLabels?.labelNav, localeLabels.labelNav),
|
|
33315
|
+
labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels?.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
|
|
33316
|
+
labelWeekday: resolveLabel(labelWeekday, customLabels?.labelWeekday, localeLabels.labelWeekday),
|
|
33317
|
+
};
|
|
33318
|
+
}
|
|
33319
|
+
|
|
33320
|
+
/**
|
|
33321
|
+
* Returns the months to show in the dropdown.
|
|
33322
|
+
*
|
|
33323
|
+
* This function generates a list of months for the current year, formatted
|
|
33324
|
+
* using the provided formatter, and determines whether each month should be
|
|
33325
|
+
* disabled based on the navigation range.
|
|
33326
|
+
*
|
|
33327
|
+
* @param displayMonth The currently displayed month.
|
|
33328
|
+
* @param navStart The start date for navigation.
|
|
33329
|
+
* @param navEnd The end date for navigation.
|
|
33330
|
+
* @param formatters The formatters to use for formatting the month labels.
|
|
33331
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33332
|
+
* @returns An array of dropdown options representing the months, or `undefined`
|
|
33333
|
+
* if no months are available.
|
|
33334
|
+
*/
|
|
33335
|
+
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
33336
|
+
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
33337
|
+
const months = eachMonthOfInterval({
|
|
33338
|
+
start: startOfYear(displayMonth),
|
|
33339
|
+
end: endOfYear(displayMonth),
|
|
33340
|
+
});
|
|
33341
|
+
const options = months.map((month) => {
|
|
33342
|
+
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
33343
|
+
const value = getMonth(month);
|
|
33344
|
+
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
33345
|
+
(navEnd && month > startOfMonth(navEnd)) ||
|
|
33346
|
+
false;
|
|
33347
|
+
return { value, label, disabled };
|
|
33348
|
+
});
|
|
33349
|
+
return options;
|
|
33350
|
+
}
|
|
33351
|
+
|
|
33352
|
+
/**
|
|
33353
|
+
* Returns the computed style for a day based on its modifiers.
|
|
33354
|
+
*
|
|
33355
|
+
* This function merges the base styles for the day with any styles associated
|
|
33356
|
+
* with active modifiers.
|
|
33357
|
+
*
|
|
33358
|
+
* @param dayModifiers The modifiers applied to the day.
|
|
33359
|
+
* @param styles The base styles for the calendar elements.
|
|
33360
|
+
* @param modifiersStyles The styles associated with specific modifiers.
|
|
33361
|
+
* @returns The computed style for the day.
|
|
33362
|
+
*/
|
|
33363
|
+
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
33364
|
+
let style = { ...styles?.[UI.Day] };
|
|
33365
|
+
Object.entries(dayModifiers)
|
|
33366
|
+
.filter(([, active]) => active === true)
|
|
33367
|
+
.forEach(([modifier]) => {
|
|
33368
|
+
style = {
|
|
33369
|
+
...style,
|
|
33370
|
+
...modifiersStyles?.[modifier],
|
|
33371
|
+
};
|
|
33372
|
+
});
|
|
33373
|
+
return style;
|
|
33374
|
+
}
|
|
33375
|
+
|
|
33376
|
+
/**
|
|
33377
|
+
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
33378
|
+
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
33379
|
+
*
|
|
33380
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33381
|
+
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
33382
|
+
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
33383
|
+
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
33384
|
+
* @returns An array of 7 dates representing the weekdays.
|
|
33385
|
+
*/
|
|
33386
|
+
function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
|
|
33387
|
+
const referenceToday = today ?? dateLib.today();
|
|
33388
|
+
const start = broadcastCalendar
|
|
33389
|
+
? dateLib.startOfBroadcastWeek(referenceToday, dateLib)
|
|
33390
|
+
: ISOWeek
|
|
33391
|
+
? dateLib.startOfISOWeek(referenceToday)
|
|
33392
|
+
: dateLib.startOfWeek(referenceToday);
|
|
33393
|
+
const days = [];
|
|
33394
|
+
for (let i = 0; i < 7; i++) {
|
|
33395
|
+
const day = dateLib.addDays(start, i);
|
|
33396
|
+
days.push(day);
|
|
33397
|
+
}
|
|
33398
|
+
return days;
|
|
33399
|
+
}
|
|
33400
|
+
|
|
33401
|
+
/**
|
|
33402
|
+
* Returns the years to display in the dropdown.
|
|
33403
|
+
*
|
|
33404
|
+
* This function generates a list of years between the navigation start and end
|
|
33405
|
+
* dates, formatted using the provided formatter.
|
|
33406
|
+
*
|
|
33407
|
+
* @param navStart The start date for navigation.
|
|
33408
|
+
* @param navEnd The end date for navigation.
|
|
33409
|
+
* @param formatters The formatters to use for formatting the year labels.
|
|
33410
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33411
|
+
* @param reverse If true, reverses the order of the years (descending).
|
|
33412
|
+
* @returns An array of dropdown options representing the years, or `undefined`
|
|
33413
|
+
* if `navStart` or `navEnd` is not provided.
|
|
33414
|
+
*/
|
|
33415
|
+
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
33416
|
+
if (!navStart)
|
|
33417
|
+
return undefined;
|
|
33418
|
+
if (!navEnd)
|
|
33419
|
+
return undefined;
|
|
33420
|
+
const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
|
|
33421
|
+
const firstNavYear = startOfYear(navStart);
|
|
33422
|
+
const lastNavYear = endOfYear(navEnd);
|
|
33423
|
+
const years = eachYearOfInterval({ start: firstNavYear, end: lastNavYear });
|
|
33424
|
+
if (reverse)
|
|
33425
|
+
years.reverse();
|
|
33426
|
+
return years.map((year) => {
|
|
33427
|
+
const label = formatters.formatYearDropdown(year, dateLib);
|
|
33428
|
+
return {
|
|
33429
|
+
value: getYear(year),
|
|
33430
|
+
label,
|
|
33431
|
+
disabled: false,
|
|
33432
|
+
};
|
|
33433
|
+
});
|
|
33434
|
+
}
|
|
33435
|
+
|
|
33436
|
+
/**
|
|
33437
|
+
* Creates `dateLib` overrides that keep all calendar math at noon in the target
|
|
33438
|
+
* time zone. This avoids second-level offset changes (e.g., historical zones
|
|
33439
|
+
* with +03:41:12) from pushing dates backward across midnight.
|
|
33440
|
+
*/
|
|
33441
|
+
function createNoonOverrides(timeZone, options = {}) {
|
|
33442
|
+
const { weekStartsOn, locale } = options;
|
|
33443
|
+
const fallbackWeekStartsOn = (weekStartsOn ??
|
|
33444
|
+
locale?.options?.weekStartsOn ??
|
|
33445
|
+
0);
|
|
33446
|
+
// Keep all internal math anchored at noon in the target zone to avoid
|
|
33447
|
+
// historical second-level offsets from crossing midnight.
|
|
33448
|
+
const toNoonTZDate = (date) => {
|
|
33449
|
+
const normalizedDate = typeof date === "number" || typeof date === "string"
|
|
33450
|
+
? new Date(date)
|
|
33451
|
+
: date;
|
|
33452
|
+
return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
|
|
33453
|
+
};
|
|
33454
|
+
// Convert a value into a host `Date` that represents the same calendar day
|
|
33455
|
+
// as the target-zone noon. This is useful for helpers (e.g., date-fns week
|
|
33456
|
+
// utilities) that expect local `Date` instances rather than `TZDate`s.
|
|
33457
|
+
const toCalendarDate = (date) => {
|
|
33458
|
+
const zoned = toNoonTZDate(date);
|
|
33459
|
+
return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
|
|
33460
|
+
};
|
|
33461
|
+
return {
|
|
33462
|
+
today: () => {
|
|
33463
|
+
return toNoonTZDate(TZDate.tz(timeZone));
|
|
33464
|
+
},
|
|
33465
|
+
newDate: (year, monthIndex, date) => {
|
|
33466
|
+
return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
|
|
33467
|
+
},
|
|
33468
|
+
startOfDay: (date) => {
|
|
33469
|
+
return toNoonTZDate(date);
|
|
33470
|
+
},
|
|
33471
|
+
startOfWeek: (date, options) => {
|
|
33472
|
+
const base = toNoonTZDate(date);
|
|
33473
|
+
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33474
|
+
fallbackWeekStartsOn);
|
|
33475
|
+
const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
|
|
33476
|
+
base.setDate(base.getDate() - diff);
|
|
33477
|
+
return base;
|
|
33478
|
+
},
|
|
33479
|
+
startOfISOWeek: (date) => {
|
|
33480
|
+
const base = toNoonTZDate(date);
|
|
33481
|
+
const diff = (base.getDay() - 1 + 7) % 7;
|
|
33482
|
+
base.setDate(base.getDate() - diff);
|
|
33483
|
+
return base;
|
|
33484
|
+
},
|
|
33485
|
+
startOfMonth: (date) => {
|
|
33486
|
+
const base = toNoonTZDate(date);
|
|
33487
|
+
base.setDate(1);
|
|
33488
|
+
return base;
|
|
33489
|
+
},
|
|
33490
|
+
startOfYear: (date) => {
|
|
33491
|
+
const base = toNoonTZDate(date);
|
|
33492
|
+
base.setMonth(0, 1);
|
|
33493
|
+
return base;
|
|
33494
|
+
},
|
|
33495
|
+
endOfWeek: (date, options) => {
|
|
33496
|
+
const base = toNoonTZDate(date);
|
|
33497
|
+
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33498
|
+
fallbackWeekStartsOn);
|
|
33499
|
+
const endDow = (weekStartsOnValue + 6) % 7;
|
|
33500
|
+
const diff = (endDow - base.getDay() + 7) % 7;
|
|
33501
|
+
base.setDate(base.getDate() + diff);
|
|
33502
|
+
return base;
|
|
33503
|
+
},
|
|
33504
|
+
endOfISOWeek: (date) => {
|
|
33505
|
+
const base = toNoonTZDate(date);
|
|
33506
|
+
const diff = (7 - base.getDay()) % 7;
|
|
33507
|
+
base.setDate(base.getDate() + diff);
|
|
33508
|
+
return base;
|
|
33509
|
+
},
|
|
33510
|
+
endOfMonth: (date) => {
|
|
33511
|
+
const base = toNoonTZDate(date);
|
|
33512
|
+
base.setMonth(base.getMonth() + 1, 0);
|
|
33513
|
+
return base;
|
|
33514
|
+
},
|
|
33515
|
+
endOfYear: (date) => {
|
|
33516
|
+
const base = toNoonTZDate(date);
|
|
33517
|
+
base.setMonth(11, 31);
|
|
33518
|
+
return base;
|
|
33519
|
+
},
|
|
33520
|
+
eachMonthOfInterval: (interval) => {
|
|
33521
|
+
const start = toNoonTZDate(interval.start);
|
|
33522
|
+
const end = toNoonTZDate(interval.end);
|
|
33523
|
+
const result = [];
|
|
33524
|
+
const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
|
|
33525
|
+
const endKey = end.getFullYear() * 12 + end.getMonth();
|
|
33526
|
+
while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
|
|
33527
|
+
result.push(new TZDate(cursor, timeZone));
|
|
33528
|
+
cursor.setMonth(cursor.getMonth() + 1, 1);
|
|
33529
|
+
}
|
|
33530
|
+
return result;
|
|
33531
|
+
},
|
|
33532
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
33533
|
+
// mutate the same TZDate, and return it.
|
|
33534
|
+
addDays: (date, amount) => {
|
|
33535
|
+
const base = toNoonTZDate(date);
|
|
33536
|
+
base.setDate(base.getDate() + amount);
|
|
33537
|
+
return base;
|
|
33538
|
+
},
|
|
33539
|
+
addWeeks: (date, amount) => {
|
|
33540
|
+
const base = toNoonTZDate(date);
|
|
33541
|
+
base.setDate(base.getDate() + amount * 7);
|
|
33542
|
+
return base;
|
|
33543
|
+
},
|
|
33544
|
+
addMonths: (date, amount) => {
|
|
33545
|
+
const base = toNoonTZDate(date);
|
|
33546
|
+
base.setMonth(base.getMonth() + amount);
|
|
33547
|
+
return base;
|
|
33548
|
+
},
|
|
33549
|
+
addYears: (date, amount) => {
|
|
33550
|
+
const base = toNoonTZDate(date);
|
|
33551
|
+
base.setFullYear(base.getFullYear() + amount);
|
|
33552
|
+
return base;
|
|
33553
|
+
},
|
|
33554
|
+
eachYearOfInterval: (interval) => {
|
|
33555
|
+
const start = toNoonTZDate(interval.start);
|
|
33556
|
+
const end = toNoonTZDate(interval.end);
|
|
33557
|
+
const years = [];
|
|
33558
|
+
const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
|
|
33559
|
+
while (cursor.getFullYear() <= end.getFullYear()) {
|
|
33560
|
+
years.push(new TZDate(cursor, timeZone));
|
|
33561
|
+
cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
|
|
33562
|
+
}
|
|
33563
|
+
return years;
|
|
33564
|
+
},
|
|
33565
|
+
getWeek: (date, options) => {
|
|
33566
|
+
const base = toCalendarDate(date);
|
|
33567
|
+
return getWeek(base, {
|
|
33568
|
+
weekStartsOn: options?.weekStartsOn ?? fallbackWeekStartsOn,
|
|
33569
|
+
firstWeekContainsDate: options?.firstWeekContainsDate ??
|
|
33570
|
+
locale?.options?.firstWeekContainsDate ??
|
|
33571
|
+
1,
|
|
33572
|
+
});
|
|
33573
|
+
},
|
|
33574
|
+
getISOWeek: (date) => {
|
|
33575
|
+
const base = toCalendarDate(date);
|
|
33576
|
+
return getISOWeek(base);
|
|
33577
|
+
},
|
|
33578
|
+
differenceInCalendarDays: (dateLeft, dateRight) => {
|
|
33579
|
+
const left = toCalendarDate(dateLeft);
|
|
33580
|
+
const right = toCalendarDate(dateRight);
|
|
33581
|
+
return differenceInCalendarDays(left, right);
|
|
33582
|
+
},
|
|
33583
|
+
differenceInCalendarMonths: (dateLeft, dateRight) => {
|
|
33584
|
+
const left = toCalendarDate(dateLeft);
|
|
33585
|
+
const right = toCalendarDate(dateRight);
|
|
33586
|
+
return differenceInCalendarMonths(left, right);
|
|
33587
|
+
},
|
|
33588
|
+
};
|
|
33589
|
+
}
|
|
33590
|
+
|
|
33233
33591
|
const asHtmlElement = (element) => {
|
|
33234
33592
|
if (element instanceof HTMLElement)
|
|
33235
33593
|
return element;
|
|
@@ -33422,19 +33780,27 @@ function getDates(displayMonths, maxDate, props, dateLib) {
|
|
|
33422
33780
|
: ISOWeek
|
|
33423
33781
|
? startOfISOWeek(firstMonth)
|
|
33424
33782
|
: startOfWeek(firstMonth);
|
|
33425
|
-
const
|
|
33783
|
+
const displayMonthsWeekEnd = broadcastCalendar
|
|
33426
33784
|
? endOfBroadcastWeek(lastMonth)
|
|
33427
33785
|
: ISOWeek
|
|
33428
33786
|
? endOfISOWeek(endOfMonth(lastMonth))
|
|
33429
33787
|
: endOfWeek(endOfMonth(lastMonth));
|
|
33430
|
-
|
|
33788
|
+
// If maxDate is set, clamp the grid to the end of that week.
|
|
33789
|
+
const constraintWeekEnd = maxDate &&
|
|
33790
|
+
(broadcastCalendar
|
|
33791
|
+
? endOfBroadcastWeek(maxDate)
|
|
33792
|
+
: ISOWeek
|
|
33793
|
+
? endOfISOWeek(maxDate)
|
|
33794
|
+
: endOfWeek(maxDate));
|
|
33795
|
+
// Pick the earliest week end between the displayed months and the constraint.
|
|
33796
|
+
const gridEndDate = constraintWeekEnd && isAfter(displayMonthsWeekEnd, constraintWeekEnd)
|
|
33797
|
+
? constraintWeekEnd
|
|
33798
|
+
: displayMonthsWeekEnd;
|
|
33799
|
+
const nOfDays = differenceInCalendarDays(gridEndDate, startWeekFirstDate);
|
|
33431
33800
|
const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;
|
|
33432
33801
|
const dates = [];
|
|
33433
33802
|
for (let i = 0; i <= nOfDays; i++) {
|
|
33434
33803
|
const date = addDays(startWeekFirstDate, i);
|
|
33435
|
-
if (maxDate && isAfter(date, maxDate)) {
|
|
33436
|
-
break;
|
|
33437
|
-
}
|
|
33438
33804
|
dates.push(date);
|
|
33439
33805
|
}
|
|
33440
33806
|
// If fixed weeks is enabled, add the extra dates to the array
|
|
@@ -33765,17 +34131,45 @@ function useCalendar(props, dateLib) {
|
|
|
33765
34131
|
setFirstMonth(newInitialMonth);
|
|
33766
34132
|
}, [props.timeZone]);
|
|
33767
34133
|
/** The months displayed in the calendar. */
|
|
33768
|
-
|
|
33769
|
-
|
|
33770
|
-
|
|
33771
|
-
|
|
33772
|
-
|
|
33773
|
-
|
|
33774
|
-
|
|
33775
|
-
|
|
33776
|
-
|
|
33777
|
-
|
|
33778
|
-
|
|
34134
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: We want to recompute only when specific props change.
|
|
34135
|
+
const { months, weeks, days, previousMonth, nextMonth } = React$5.useMemo(() => {
|
|
34136
|
+
const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);
|
|
34137
|
+
const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, {
|
|
34138
|
+
ISOWeek: props.ISOWeek,
|
|
34139
|
+
fixedWeeks: props.fixedWeeks,
|
|
34140
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
34141
|
+
}, dateLib);
|
|
34142
|
+
const months = getMonths(displayMonths, dates, {
|
|
34143
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
34144
|
+
fixedWeeks: props.fixedWeeks,
|
|
34145
|
+
ISOWeek: props.ISOWeek,
|
|
34146
|
+
reverseMonths: props.reverseMonths,
|
|
34147
|
+
}, dateLib);
|
|
34148
|
+
const weeks = getWeeks(months);
|
|
34149
|
+
const days = getDays(months);
|
|
34150
|
+
const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
34151
|
+
const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
34152
|
+
return {
|
|
34153
|
+
months,
|
|
34154
|
+
weeks,
|
|
34155
|
+
days,
|
|
34156
|
+
previousMonth,
|
|
34157
|
+
nextMonth,
|
|
34158
|
+
};
|
|
34159
|
+
}, [
|
|
34160
|
+
dateLib,
|
|
34161
|
+
firstMonth.getTime(),
|
|
34162
|
+
navEnd?.getTime(),
|
|
34163
|
+
navStart?.getTime(),
|
|
34164
|
+
props.disableNavigation,
|
|
34165
|
+
props.broadcastCalendar,
|
|
34166
|
+
props.endMonth?.getTime(),
|
|
34167
|
+
props.fixedWeeks,
|
|
34168
|
+
props.ISOWeek,
|
|
34169
|
+
props.numberOfMonths,
|
|
34170
|
+
props.pagedNavigation,
|
|
34171
|
+
props.reverseMonths,
|
|
34172
|
+
]);
|
|
33779
34173
|
const { disableNavigation, onMonthChange } = props;
|
|
33780
34174
|
const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
|
|
33781
34175
|
const goToMonth = (date) => {
|
|
@@ -33994,6 +34388,12 @@ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
|
33994
34388
|
const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
|
|
33995
34389
|
if (!nextFocus)
|
|
33996
34390
|
return;
|
|
34391
|
+
if (props.disableNavigation) {
|
|
34392
|
+
const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
|
|
34393
|
+
if (!isNextInCalendar) {
|
|
34394
|
+
return;
|
|
34395
|
+
}
|
|
34396
|
+
}
|
|
33997
34397
|
calendar.goToDay(nextFocus);
|
|
33998
34398
|
setFocused(nextFocus);
|
|
33999
34399
|
};
|
|
@@ -34276,15 +34676,33 @@ function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
|
|
|
34276
34676
|
* range, and a function to check if a date is within the range.
|
|
34277
34677
|
*/
|
|
34278
34678
|
function useRange(props, dateLib) {
|
|
34279
|
-
const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect, } = props;
|
|
34679
|
+
const { disabled, excludeDisabled, resetOnSelect, selected: initiallySelected, required, onSelect, } = props;
|
|
34280
34680
|
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
|
|
34281
34681
|
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
34282
34682
|
const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
|
|
34283
34683
|
const select = (triggerDate, modifiers, e) => {
|
|
34284
34684
|
const { min, max } = props;
|
|
34285
|
-
|
|
34286
|
-
|
|
34287
|
-
|
|
34685
|
+
let newRange;
|
|
34686
|
+
if (triggerDate) {
|
|
34687
|
+
const selectedFrom = selected?.from;
|
|
34688
|
+
const selectedTo = selected?.to;
|
|
34689
|
+
const hasFullRange = !!selectedFrom && !!selectedTo;
|
|
34690
|
+
const isClickingSingleDayRange = !!selectedFrom &&
|
|
34691
|
+
!!selectedTo &&
|
|
34692
|
+
dateLib.isSameDay(selectedFrom, selectedTo) &&
|
|
34693
|
+
dateLib.isSameDay(triggerDate, selectedFrom);
|
|
34694
|
+
if (resetOnSelect && (hasFullRange || !selected?.from)) {
|
|
34695
|
+
if (!required && isClickingSingleDayRange) {
|
|
34696
|
+
newRange = undefined;
|
|
34697
|
+
}
|
|
34698
|
+
else {
|
|
34699
|
+
newRange = { from: triggerDate, to: undefined };
|
|
34700
|
+
}
|
|
34701
|
+
}
|
|
34702
|
+
else {
|
|
34703
|
+
newRange = addToRange(triggerDate, selected, min, max, required, dateLib);
|
|
34704
|
+
}
|
|
34705
|
+
}
|
|
34288
34706
|
if (excludeDisabled && disabled && newRange?.from && newRange.to) {
|
|
34289
34707
|
if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {
|
|
34290
34708
|
// if a disabled days is found, the range is reset
|
|
@@ -34372,6 +34790,78 @@ function useSelection(props, dateLib) {
|
|
|
34372
34790
|
}
|
|
34373
34791
|
}
|
|
34374
34792
|
|
|
34793
|
+
/**
|
|
34794
|
+
* Convert a {@link Date} or {@link TZDate} instance to the given time zone.
|
|
34795
|
+
* Reuses the same instance when it is already a {@link TZDate} using the target
|
|
34796
|
+
* time zone to avoid extra allocations.
|
|
34797
|
+
*/
|
|
34798
|
+
function toTimeZone(date, timeZone) {
|
|
34799
|
+
if (date instanceof TZDate && date.timeZone === timeZone) {
|
|
34800
|
+
return date;
|
|
34801
|
+
}
|
|
34802
|
+
return new TZDate(date, timeZone);
|
|
34803
|
+
}
|
|
34804
|
+
|
|
34805
|
+
function toZoneNoon(date, timeZone, noonSafe) {
|
|
34806
|
+
if (!noonSafe)
|
|
34807
|
+
return toTimeZone(date, timeZone);
|
|
34808
|
+
const zoned = toTimeZone(date, timeZone);
|
|
34809
|
+
const noonZoned = new TZDate(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 12, 0, 0, timeZone);
|
|
34810
|
+
return new Date(noonZoned.getTime());
|
|
34811
|
+
}
|
|
34812
|
+
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
34813
|
+
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
34814
|
+
return matcher;
|
|
34815
|
+
}
|
|
34816
|
+
if (matcher instanceof Date) {
|
|
34817
|
+
return toZoneNoon(matcher, timeZone, noonSafe);
|
|
34818
|
+
}
|
|
34819
|
+
if (Array.isArray(matcher)) {
|
|
34820
|
+
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone, noonSafe) : value);
|
|
34821
|
+
}
|
|
34822
|
+
if (isDateRange(matcher)) {
|
|
34823
|
+
return {
|
|
34824
|
+
...matcher,
|
|
34825
|
+
from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
|
|
34826
|
+
to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to,
|
|
34827
|
+
};
|
|
34828
|
+
}
|
|
34829
|
+
if (isDateInterval(matcher)) {
|
|
34830
|
+
return {
|
|
34831
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34832
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34833
|
+
};
|
|
34834
|
+
}
|
|
34835
|
+
if (isDateAfterType(matcher)) {
|
|
34836
|
+
return {
|
|
34837
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34838
|
+
};
|
|
34839
|
+
}
|
|
34840
|
+
if (isDateBeforeType(matcher)) {
|
|
34841
|
+
return {
|
|
34842
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34843
|
+
};
|
|
34844
|
+
}
|
|
34845
|
+
return matcher;
|
|
34846
|
+
}
|
|
34847
|
+
/**
|
|
34848
|
+
* Convert any {@link Matcher} or array of matchers to the specified time zone.
|
|
34849
|
+
*
|
|
34850
|
+
* @param matchers - The matcher or matchers to convert.
|
|
34851
|
+
* @param timeZone - The target IANA time zone.
|
|
34852
|
+
* @returns The converted matcher(s).
|
|
34853
|
+
* @group Utilities
|
|
34854
|
+
*/
|
|
34855
|
+
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
34856
|
+
if (!matchers) {
|
|
34857
|
+
return matchers;
|
|
34858
|
+
}
|
|
34859
|
+
if (Array.isArray(matchers)) {
|
|
34860
|
+
return matchers.map((matcher) => convertMatcher(matcher, timeZone, noonSafe));
|
|
34861
|
+
}
|
|
34862
|
+
return convertMatcher(matchers, timeZone, noonSafe);
|
|
34863
|
+
}
|
|
34864
|
+
|
|
34375
34865
|
/**
|
|
34376
34866
|
* Renders the DayPicker calendar component.
|
|
34377
34867
|
*
|
|
@@ -34382,58 +34872,83 @@ function useSelection(props, dateLib) {
|
|
|
34382
34872
|
*/
|
|
34383
34873
|
function DayPicker(initialProps) {
|
|
34384
34874
|
let props = initialProps;
|
|
34385
|
-
|
|
34875
|
+
const timeZone = props.timeZone;
|
|
34876
|
+
if (timeZone) {
|
|
34386
34877
|
props = {
|
|
34387
34878
|
...initialProps,
|
|
34879
|
+
timeZone,
|
|
34388
34880
|
};
|
|
34389
34881
|
if (props.today) {
|
|
34390
|
-
props.today =
|
|
34882
|
+
props.today = toTimeZone(props.today, timeZone);
|
|
34391
34883
|
}
|
|
34392
34884
|
if (props.month) {
|
|
34393
|
-
props.month =
|
|
34885
|
+
props.month = toTimeZone(props.month, timeZone);
|
|
34394
34886
|
}
|
|
34395
34887
|
if (props.defaultMonth) {
|
|
34396
|
-
props.defaultMonth =
|
|
34888
|
+
props.defaultMonth = toTimeZone(props.defaultMonth, timeZone);
|
|
34397
34889
|
}
|
|
34398
34890
|
if (props.startMonth) {
|
|
34399
|
-
props.startMonth =
|
|
34891
|
+
props.startMonth = toTimeZone(props.startMonth, timeZone);
|
|
34400
34892
|
}
|
|
34401
34893
|
if (props.endMonth) {
|
|
34402
|
-
props.endMonth =
|
|
34894
|
+
props.endMonth = toTimeZone(props.endMonth, timeZone);
|
|
34403
34895
|
}
|
|
34404
34896
|
if (props.mode === "single" && props.selected) {
|
|
34405
|
-
props.selected =
|
|
34897
|
+
props.selected = toTimeZone(props.selected, timeZone);
|
|
34406
34898
|
}
|
|
34407
34899
|
else if (props.mode === "multiple" && props.selected) {
|
|
34408
|
-
props.selected = props.selected?.map((date) =>
|
|
34900
|
+
props.selected = props.selected?.map((date) => toTimeZone(date, timeZone));
|
|
34409
34901
|
}
|
|
34410
34902
|
else if (props.mode === "range" && props.selected) {
|
|
34411
34903
|
props.selected = {
|
|
34412
34904
|
from: props.selected.from
|
|
34413
|
-
?
|
|
34414
|
-
:
|
|
34905
|
+
? toTimeZone(props.selected.from, timeZone)
|
|
34906
|
+
: props.selected.from,
|
|
34415
34907
|
to: props.selected.to
|
|
34416
|
-
?
|
|
34417
|
-
:
|
|
34908
|
+
? toTimeZone(props.selected.to, timeZone)
|
|
34909
|
+
: props.selected.to,
|
|
34418
34910
|
};
|
|
34419
34911
|
}
|
|
34912
|
+
if (props.disabled !== undefined) {
|
|
34913
|
+
props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
|
|
34914
|
+
}
|
|
34915
|
+
if (props.hidden !== undefined) {
|
|
34916
|
+
props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
|
|
34917
|
+
}
|
|
34918
|
+
if (props.modifiers) {
|
|
34919
|
+
const nextModifiers = {};
|
|
34920
|
+
Object.keys(props.modifiers).forEach((key) => {
|
|
34921
|
+
nextModifiers[key] = convertMatchersToTimeZone(props.modifiers?.[key], timeZone);
|
|
34922
|
+
});
|
|
34923
|
+
props.modifiers = nextModifiers;
|
|
34924
|
+
}
|
|
34420
34925
|
}
|
|
34421
34926
|
const { components, formatters, labels, dateLib, locale, classNames } = React$5.useMemo(() => {
|
|
34422
34927
|
const locale = { ...enUS, ...props.locale };
|
|
34928
|
+
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
34929
|
+
const noonOverrides = props.noonSafe && props.timeZone
|
|
34930
|
+
? createNoonOverrides(props.timeZone, {
|
|
34931
|
+
weekStartsOn,
|
|
34932
|
+
locale,
|
|
34933
|
+
})
|
|
34934
|
+
: undefined;
|
|
34935
|
+
const overrides = props.dateLib && noonOverrides
|
|
34936
|
+
? { ...noonOverrides, ...props.dateLib }
|
|
34937
|
+
: (props.dateLib ?? noonOverrides);
|
|
34423
34938
|
const dateLib = new DateLib({
|
|
34424
34939
|
locale,
|
|
34425
|
-
weekStartsOn
|
|
34940
|
+
weekStartsOn,
|
|
34426
34941
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
34427
34942
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
34428
34943
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
34429
34944
|
timeZone: props.timeZone,
|
|
34430
34945
|
numerals: props.numerals,
|
|
34431
|
-
},
|
|
34946
|
+
}, overrides);
|
|
34432
34947
|
return {
|
|
34433
34948
|
dateLib,
|
|
34434
34949
|
components: getComponents(props.components),
|
|
34435
34950
|
formatters: getFormatters(props.formatters),
|
|
34436
|
-
labels:
|
|
34951
|
+
labels: getLabels(props.labels, dateLib.options),
|
|
34437
34952
|
locale,
|
|
34438
34953
|
classNames: { ...getDefaultClassNames(), ...props.classNames },
|
|
34439
34954
|
};
|
|
@@ -34447,11 +34962,15 @@ function DayPicker(initialProps) {
|
|
|
34447
34962
|
props.timeZone,
|
|
34448
34963
|
props.numerals,
|
|
34449
34964
|
props.dateLib,
|
|
34965
|
+
props.noonSafe,
|
|
34450
34966
|
props.components,
|
|
34451
34967
|
props.formatters,
|
|
34452
34968
|
props.labels,
|
|
34453
34969
|
props.classNames,
|
|
34454
34970
|
]);
|
|
34971
|
+
if (!props.today) {
|
|
34972
|
+
props = { ...props, today: dateLib.today() };
|
|
34973
|
+
}
|
|
34455
34974
|
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles, } = props;
|
|
34456
34975
|
const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown, } = formatters;
|
|
34457
34976
|
const calendar = useCalendar(props, dateLib);
|
|
@@ -34460,7 +34979,7 @@ function DayPicker(initialProps) {
|
|
|
34460
34979
|
const { isSelected, select, selected: selectedValue, } = useSelection(props, dateLib) ?? {};
|
|
34461
34980
|
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
|
|
34462
34981
|
const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown, } = labels;
|
|
34463
|
-
const weekdays = React$5.useMemo(() => getWeekdays(dateLib, props.ISOWeek), [dateLib, props.ISOWeek]);
|
|
34982
|
+
const weekdays = React$5.useMemo(() => getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [dateLib, props.ISOWeek, props.broadcastCalendar, props.today]);
|
|
34464
34983
|
const isInteractive = mode !== undefined || onDayClick !== undefined;
|
|
34465
34984
|
const handlePreviousClick = React$5.useCallback(() => {
|
|
34466
34985
|
if (!previousMonth)
|
|
@@ -34478,6 +34997,9 @@ function DayPicker(initialProps) {
|
|
|
34478
34997
|
e.preventDefault();
|
|
34479
34998
|
e.stopPropagation();
|
|
34480
34999
|
setFocused(day);
|
|
35000
|
+
if (m.disabled) {
|
|
35001
|
+
return;
|
|
35002
|
+
}
|
|
34481
35003
|
select?.(day.date, m, e);
|
|
34482
35004
|
onDayClick?.(day.date, m, e);
|
|
34483
35005
|
}, [select, onDayClick, setFocused]);
|
|
@@ -34561,7 +35083,7 @@ function DayPicker(initialProps) {
|
|
|
34561
35083
|
formatters,
|
|
34562
35084
|
};
|
|
34563
35085
|
return (React__default["default"].createElement(dayPickerContext.Provider, { value: contextValue },
|
|
34564
|
-
React__default["default"].createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], ...dataAttributes },
|
|
35086
|
+
React__default["default"].createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang ?? locale.code, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], "aria-labelledby": props["aria-labelledby"], ...dataAttributes },
|
|
34565
35087
|
React__default["default"].createElement(components.Months, { className: classNames[UI.Months], style: styles?.[UI.Months] },
|
|
34566
35088
|
!props.hideNavigation && !navLayout && (React__default["default"].createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : undefined, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),
|
|
34567
35089
|
months.map((calendarMonth, displayIndex) => {
|
|
@@ -34573,10 +35095,16 @@ function DayPicker(initialProps) {
|
|
|
34573
35095
|
displayIndex === 0 && (React__default["default"].createElement(components.PreviousMonthButton, { type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, "aria-disabled": previousMonth ? undefined : true, "aria-label": labelPrevious(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : undefined },
|
|
34574
35096
|
React__default["default"].createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" }))),
|
|
34575
35097
|
React__default["default"].createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : undefined, className: classNames[UI.MonthCaption], style: styles?.[UI.MonthCaption], calendarMonth: calendarMonth, displayIndex: displayIndex }, captionLayout?.startsWith("dropdown") ? (React__default["default"].createElement(components.DropdownNav, { className: classNames[UI.Dropdowns], style: styles?.[UI.Dropdowns] },
|
|
34576
|
-
|
|
34577
|
-
captionLayout === "dropdown
|
|
34578
|
-
|
|
34579
|
-
captionLayout === "dropdown
|
|
35098
|
+
(() => {
|
|
35099
|
+
const monthControl = captionLayout === "dropdown" ||
|
|
35100
|
+
captionLayout === "dropdown-months" ? (React__default["default"].createElement(components.MonthsDropdown, { key: "month", className: classNames[UI.MonthsDropdown], "aria-label": labelMonthDropdown(), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters, dateLib), style: styles?.[UI.Dropdown], value: dateLib.getMonth(calendarMonth.date) })) : (React__default["default"].createElement("span", { key: "month" }, formatMonthDropdown(calendarMonth.date, dateLib)));
|
|
35101
|
+
const yearControl = captionLayout === "dropdown" ||
|
|
35102
|
+
captionLayout === "dropdown-years" ? (React__default["default"].createElement(components.YearsDropdown, { key: "year", className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown(dateLib.options), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: getYearOptions(navStart, navEnd, formatters, dateLib, Boolean(props.reverseYears)), style: styles?.[UI.Dropdown], value: dateLib.getYear(calendarMonth.date) })) : (React__default["default"].createElement("span", { key: "year" }, formatYearDropdown(calendarMonth.date, dateLib)));
|
|
35103
|
+
const controls = dateLib.getMonthYearOrder() === "year-first"
|
|
35104
|
+
? [yearControl, monthControl]
|
|
35105
|
+
: [monthControl, yearControl];
|
|
35106
|
+
return controls;
|
|
35107
|
+
})(),
|
|
34580
35108
|
React__default["default"].createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
34581
35109
|
border: 0,
|
|
34582
35110
|
clip: "rect(0 0 0 0)",
|
|
@@ -34588,9 +35116,7 @@ function DayPicker(initialProps) {
|
|
|
34588
35116
|
width: "1px",
|
|
34589
35117
|
whiteSpace: "nowrap",
|
|
34590
35118
|
wordWrap: "normal",
|
|
34591
|
-
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
|
|
34592
|
-
// biome-ignore lint/a11y/useSemanticElements: breaking change
|
|
34593
|
-
React__default["default"].createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
|
|
35119
|
+
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (React__default["default"].createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
|
|
34594
35120
|
navLayout === "around" &&
|
|
34595
35121
|
!props.hideNavigation &&
|
|
34596
35122
|
displayIndex === numberOfMonths - 1 && (React__default["default"].createElement(components.NextMonthButton, { type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, "aria-disabled": nextMonth ? undefined : true, "aria-label": labelNext(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : undefined },
|
|
@@ -34605,9 +35131,7 @@ function DayPicker(initialProps) {
|
|
|
34605
35131
|
weekdays.map((weekday) => (React__default["default"].createElement(components.Weekday, { "aria-label": labelWeekday(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles?.[UI.Weekday], scope: "col" }, formatWeekdayName(weekday, dateLib.options, dateLib)))))),
|
|
34606
35132
|
React__default["default"].createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : undefined, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
|
|
34607
35133
|
return (React__default["default"].createElement(components.Week, { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week: week },
|
|
34608
|
-
showWeekNumber && (
|
|
34609
|
-
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34610
|
-
React__default["default"].createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
35134
|
+
showWeekNumber && (React__default["default"].createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
34611
35135
|
locale,
|
|
34612
35136
|
}), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber(week.weekNumber, dateLib))),
|
|
34613
35137
|
week.days.map((day) => {
|
|
@@ -34631,18 +35155,16 @@ function DayPicker(initialProps) {
|
|
|
34631
35155
|
const ariaLabel = !isInteractive && !modifiers.hidden
|
|
34632
35156
|
? labelGridcell(date, modifiers, dateLib.options, dateLib)
|
|
34633
35157
|
: undefined;
|
|
34634
|
-
return (
|
|
34635
|
-
|
|
34636
|
-
|
|
34637
|
-
|
|
34638
|
-
|
|
35158
|
+
return (React__default["default"].createElement(components.Day, { key: `${day.isoDate}_${day.displayMonthId}`, day: day, modifiers: modifiers, className: className.join(" "), style: style, role: "gridcell", "aria-selected": modifiers.selected || undefined, "aria-label": ariaLabel, "data-day": day.isoDate, "data-month": day.outside ? day.dateMonthId : undefined, "data-selected": modifiers.selected || undefined, "data-disabled": modifiers.disabled || undefined, "data-hidden": modifiers.hidden || undefined, "data-outside": day.outside || undefined, "data-focused": modifiers.focused || undefined, "data-today": modifiers.today || undefined }, !modifiers.hidden && isInteractive ? (React__default["default"].createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles?.[UI.DayButton], type: "button", day: day, modifiers: modifiers, disabled: (!modifiers.focused &&
|
|
35159
|
+
modifiers.disabled) ||
|
|
35160
|
+
undefined, "aria-disabled": (modifiers.focused &&
|
|
35161
|
+
modifiers.disabled) ||
|
|
35162
|
+
undefined, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay(date, dateLib.options, dateLib))) : (!modifiers.hidden &&
|
|
34639
35163
|
formatDay(day.date, dateLib.options, dateLib))));
|
|
34640
35164
|
})));
|
|
34641
35165
|
})))));
|
|
34642
35166
|
})),
|
|
34643
|
-
props.footer && (
|
|
34644
|
-
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34645
|
-
React__default["default"].createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
35167
|
+
props.footer && (React__default["default"].createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
34646
35168
|
}
|
|
34647
35169
|
|
|
34648
35170
|
function styleInject(css, ref) {
|
|
@@ -34672,7 +35194,7 @@ function styleInject(css, ref) {
|
|
|
34672
35194
|
}
|
|
34673
35195
|
}
|
|
34674
35196
|
|
|
34675
|
-
var css_248z$3 = "/* Variables declaration */\n.rdp-root {\n --rdp-accent-color: blue; /* The accent color used for selected days and UI elements. */\n --rdp-accent-background-color: #f0f0ff; /* The accent background color used for selected days and UI elements. */\n\n --rdp-day-height: 44px; /* The height of the day cells. */\n --rdp-day-width: 44px; /* The width of the day cells. */\n\n --rdp-day_button-border-radius: 100%; /* The border radius of the day cells. */\n --rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */\n --rdp-day_button-height: 42px; /* The height of the day cells. */\n --rdp-day_button-width: 42px; /* The width of the day cells. */\n\n --rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */\n --rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */\n --rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */\n --rdp-today-color: var(--rdp-accent-color); /* The color of the today's date. */\n\n --rdp-dropdown-gap: 0.5rem; /* The gap between the dropdowns used in the month captons. */\n\n --rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */\n\n --rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */\n --rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */\n --rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */\n --rdp-nav-height: 2.75rem; /* The height of the navigation bar. */\n\n --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */\n --rdp-range_middle-color: inherit; /* The color of the range text. */\n\n --rdp-range_start-color: white; /* The color of the range text. */\n --rdp-range_start-background: linear-gradient(\n var(--rdp-gradient-direction),\n transparent 50%,\n var(--rdp-range_middle-background-color) 50%\n ); /* Used for the background of the start of the selected range. */\n --rdp-range_start-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the start of the selected range. */\n\n --rdp-range_end-background: linear-gradient(\n var(--rdp-gradient-direction),\n var(--rdp-range_middle-background-color) 50%,\n transparent 50%\n ); /* Used for the background of the end of the selected range. */\n --rdp-range_end-color: white; /* The color of the range text. */\n --rdp-range_end-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the end of the selected range. */\n\n --rdp-week_number-border-radius: 100%; /* The border radius of the week number. */\n --rdp-week_number-border: 2px solid transparent; /* The border of the week number. */\n\n --rdp-week_number-height: var(--rdp-day-height); /* The height of the week number cells. */\n --rdp-week_number-opacity: 0.75; /* The opacity of the week number. */\n --rdp-week_number-width: var(--rdp-day-width); /* The width of the week number cells. */\n --rdp-weeknumber-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */\n --rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */\n --rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-gradient-direction: 90deg;\n\n --rdp-animation_duration: 0.3s;\n --rdp-animation_timing: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.rdp-root[dir=\"rtl\"] {\n --rdp-gradient-direction: -90deg;\n}\n\n.rdp-root[data-broadcast-calendar=\"true\"] {\n --rdp-outside-opacity: unset;\n}\n\n/* Root of the component. */\n.rdp-root {\n position: relative; /* Required to position the navigation toolbar. */\n box-sizing: border-box;\n}\n\n.rdp-root * {\n box-sizing: border-box;\n}\n\n.rdp-day {\n width: var(--rdp-day-width);\n height: var(--rdp-day-height);\n text-align: center;\n}\n\n.rdp-day_button {\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n justify-content: center;\n align-items: center;\n display: flex;\n\n width: var(--rdp-day_button-width);\n height: var(--rdp-day_button-height);\n border: var(--rdp-day_button-border);\n border-radius: var(--rdp-day_button-border-radius);\n}\n\n.rdp-day_button:disabled {\n cursor: revert;\n}\n\n.rdp-caption_label {\n z-index: 1;\n\n position: relative;\n display: inline-flex;\n align-items: center;\n\n white-space: nowrap;\n border: 0;\n}\n\n.rdp-dropdown:focus-visible ~ .rdp-caption_label {\n outline: 5px auto Highlight;\n /* biome-ignore lint/suspicious/noDuplicateProperties: backward compatibility */\n outline: 5px auto -webkit-focus-ring-color;\n}\n\n.rdp-button_next,\n.rdp-button_previous {\n border: none;\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n -moz-appearance: none;\n -webkit-appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n appearance: none;\n\n width: var(--rdp-nav_button-width);\n height: var(--rdp-nav_button-height);\n}\n\n.rdp-button_next:disabled,\n.rdp-button_next[aria-disabled=\"true\"],\n.rdp-button_previous:disabled,\n.rdp-button_previous[aria-disabled=\"true\"] {\n cursor: revert;\n\n opacity: var(--rdp-nav_button-disabled-opacity);\n}\n\n.rdp-chevron {\n display: inline-block;\n fill: var(--rdp-accent-color);\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-nav .rdp-chevron {\n transform: rotate(180deg);\n transform-origin: 50%;\n}\n\n.rdp-dropdowns {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: var(--rdp-dropdown-gap);\n}\n.rdp-dropdown {\n z-index: 2;\n\n /* Reset */\n opacity: 0;\n appearance: none;\n position: absolute;\n inset-block-start: 0;\n inset-block-end: 0;\n inset-inline-start: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n cursor: inherit;\n border: none;\n line-height: inherit;\n}\n\n.rdp-dropdown_root {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.rdp-dropdown_root[data-disabled=\"true\"] .rdp-chevron {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-month_caption {\n display: flex;\n align-content: center;\n height: var(--rdp-nav-height);\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month,\n.rdp-root[data-nav-layout=\"after\"] .rdp-month {\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month_caption {\n justify-content: center;\n margin-inline-start: var(--rdp-nav_button-width);\n margin-inline-end: var(--rdp-nav_button-width);\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_previous {\n position: absolute;\n inset-inline-start: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_next {\n position: absolute;\n inset-inline-end: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n justify-content: center;\n}\n\n.rdp-months {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n gap: var(--rdp-months-gap);\n max-width: fit-content;\n}\n\n.rdp-month_grid {\n border-collapse: collapse;\n}\n\n.rdp-nav {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n\n display: flex;\n align-items: center;\n\n height: var(--rdp-nav-height);\n}\n\n.rdp-weekday {\n opacity: var(--rdp-weekday-opacity);\n padding: var(--rdp-weekday-padding);\n font-weight: 500;\n font-size: smaller;\n text-align: var(--rdp-weekday-text-align);\n text-transform: var(--rdp-weekday-text-transform);\n}\n\n.rdp-week_number {\n opacity: var(--rdp-week_number-opacity);\n font-weight: 400;\n font-size: small;\n height: var(--rdp-week_number-height);\n width: var(--rdp-week_number-width);\n border: var(--rdp-week_number-border);\n border-radius: var(--rdp-week_number-border-radius);\n text-align: var(--rdp-weeknumber-text-align);\n}\n\n/* DAY MODIFIERS */\n.rdp-today:not(.rdp-outside) {\n color: var(--rdp-today-color);\n}\n\n.rdp-selected {\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-selected .rdp-day_button {\n border: var(--rdp-selected-border);\n}\n\n.rdp-outside {\n opacity: var(--rdp-outside-opacity);\n}\n\n.rdp-disabled {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-hidden {\n visibility: hidden;\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_start {\n background: var(--rdp-range_start-background);\n}\n\n.rdp-range_start .rdp-day_button {\n background-color: var(--rdp-range_start-date-background-color);\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_middle {\n background-color: var(--rdp-range_middle-background-color);\n}\n\n.rdp-range_middle .rdp-day_button {\n border: unset;\n border-radius: unset;\n color: var(--rdp-range_middle-color);\n}\n\n.rdp-range_end {\n background: var(--rdp-range_end-background);\n color: var(--rdp-range_end-color);\n}\n\n.rdp-range_end .rdp-day_button {\n color: var(--rdp-range_start-color);\n background-color: var(--rdp-range_end-date-background-color);\n}\n\n.rdp-range_start.rdp-range_end {\n background: revert;\n}\n\n.rdp-focusable {\n cursor: pointer;\n}\n\n@keyframes rdp-slide_in_left {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_in_right {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_out_left {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100%);\n }\n}\n\n@keyframes rdp-slide_out_right {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n}\n\n.rdp-weeks_before_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_before_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n@keyframes rdp-fade_in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes rdp-fade_out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.rdp-caption_after_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_after_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n";
|
|
35197
|
+
var css_248z$3 = "/* Variables declaration */\n.rdp-root {\n --rdp-accent-color: blue; /* The accent color used for selected days and UI elements. */\n --rdp-accent-background-color: #f0f0ff; /* The accent background color used for selected days and UI elements. */\n\n --rdp-day-height: 44px; /* The height of the day cells. */\n --rdp-day-width: 44px; /* The width of the day cells. */\n\n --rdp-day_button-border-radius: 100%; /* The border radius of the day cells. */\n --rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */\n --rdp-day_button-height: 42px; /* The height of the day cells. */\n --rdp-day_button-width: 42px; /* The width of the day cells. */\n\n --rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */\n --rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */\n --rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */\n --rdp-today-color: var(--rdp-accent-color); /* The color of the today's date. */\n\n --rdp-dropdown-gap: 0.5rem; /* The gap between the dropdowns used in the month captons. */\n\n --rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */\n\n --rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */\n --rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */\n --rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */\n --rdp-nav-height: 2.75rem; /* The height of the navigation bar. */\n\n --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */\n --rdp-range_middle-color: inherit; /* The color of the range text. */\n\n --rdp-range_start-color: white; /* The color of the range text. */\n --rdp-range_start-background: linear-gradient(\n var(--rdp-gradient-direction),\n transparent 50%,\n var(--rdp-range_middle-background-color) 50%\n ); /* Used for the background of the start of the selected range. */\n --rdp-range_start-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the start of the selected range. */\n\n --rdp-range_end-background: linear-gradient(\n var(--rdp-gradient-direction),\n var(--rdp-range_middle-background-color) 50%,\n transparent 50%\n ); /* Used for the background of the end of the selected range. */\n --rdp-range_end-color: white; /* The color of the range text. */\n --rdp-range_end-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the end of the selected range. */\n\n --rdp-week_number-border-radius: 100%; /* The border radius of the week number. */\n --rdp-week_number-border: 2px solid transparent; /* The border of the week number. */\n\n --rdp-week_number-height: var(--rdp-day-height); /* The height of the week number cells. */\n --rdp-week_number-opacity: 0.75; /* The opacity of the week number. */\n --rdp-week_number-width: var(--rdp-day-width); /* The width of the week number cells. */\n --rdp-weeknumber-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */\n --rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */\n --rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-gradient-direction: 90deg;\n\n --rdp-animation_duration: 0.3s;\n --rdp-animation_timing: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.rdp-root[dir=\"rtl\"] {\n --rdp-gradient-direction: -90deg;\n}\n\n.rdp-root[data-broadcast-calendar=\"true\"] {\n --rdp-outside-opacity: unset;\n}\n\n/* Root of the component. */\n.rdp-root {\n position: relative; /* Required to position the navigation toolbar. */\n box-sizing: border-box;\n}\n\n.rdp-root * {\n box-sizing: border-box;\n}\n\n.rdp-day {\n width: var(--rdp-day-width);\n height: var(--rdp-day-height);\n text-align: center;\n}\n\n.rdp-day_button {\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n justify-content: center;\n align-items: center;\n display: flex;\n\n width: var(--rdp-day_button-width);\n height: var(--rdp-day_button-height);\n border: var(--rdp-day_button-border);\n border-radius: var(--rdp-day_button-border-radius);\n}\n\n.rdp-day_button:disabled {\n cursor: revert;\n}\n\n.rdp-caption_label {\n z-index: 1;\n\n position: relative;\n display: inline-flex;\n align-items: center;\n\n white-space: nowrap;\n border: 0;\n}\n\n.rdp-dropdown:focus-visible ~ .rdp-caption_label {\n outline: 5px auto Highlight;\n /* biome-ignore lint/suspicious/noDuplicateProperties: backward compatibility */\n outline: 5px auto -webkit-focus-ring-color;\n}\n\n.rdp-button_next,\n.rdp-button_previous {\n border: none;\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n -moz-appearance: none;\n -webkit-appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n appearance: none;\n\n width: var(--rdp-nav_button-width);\n height: var(--rdp-nav_button-height);\n}\n\n.rdp-button_next:disabled,\n.rdp-button_next[aria-disabled=\"true\"],\n.rdp-button_previous:disabled,\n.rdp-button_previous[aria-disabled=\"true\"] {\n cursor: revert;\n\n opacity: var(--rdp-nav_button-disabled-opacity);\n}\n\n.rdp-chevron {\n display: inline-block;\n fill: var(--rdp-accent-color);\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-nav .rdp-chevron {\n transform: rotate(180deg);\n transform-origin: 50%;\n}\n\n.rdp-dropdowns {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: var(--rdp-dropdown-gap);\n}\n.rdp-dropdown {\n z-index: 2;\n\n /* Reset */\n opacity: 0;\n appearance: none;\n position: absolute;\n inset-block-start: 0;\n inset-block-end: 0;\n inset-inline-start: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n cursor: inherit;\n border: none;\n line-height: inherit;\n}\n\n.rdp-dropdown_root {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.rdp-dropdown_root[data-disabled=\"true\"] .rdp-chevron {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-month_caption {\n display: flex;\n align-content: center;\n height: var(--rdp-nav-height);\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month,\n.rdp-root[data-nav-layout=\"after\"] .rdp-month {\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month_caption {\n justify-content: center;\n margin-inline-start: var(--rdp-nav_button-width);\n margin-inline-end: var(--rdp-nav_button-width);\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_previous {\n position: absolute;\n inset-inline-start: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_next {\n position: absolute;\n inset-inline-end: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n justify-content: center;\n}\n\n.rdp-months {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n gap: var(--rdp-months-gap);\n max-width: fit-content;\n}\n\n.rdp-month_grid {\n border-collapse: collapse;\n}\n\n.rdp-nav {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n\n display: flex;\n align-items: center;\n\n height: var(--rdp-nav-height);\n}\n\n.rdp-weekday {\n opacity: var(--rdp-weekday-opacity);\n padding: var(--rdp-weekday-padding);\n font-weight: 500;\n font-size: smaller;\n text-align: var(--rdp-weekday-text-align);\n text-transform: var(--rdp-weekday-text-transform);\n}\n\n.rdp-week_number {\n opacity: var(--rdp-week_number-opacity);\n font-weight: 400;\n font-size: small;\n height: var(--rdp-week_number-height);\n width: var(--rdp-week_number-width);\n border: var(--rdp-week_number-border);\n border-radius: var(--rdp-week_number-border-radius);\n text-align: var(--rdp-weeknumber-text-align);\n}\n\n/* DAY MODIFIERS */\n.rdp-today:not(.rdp-outside) {\n color: var(--rdp-today-color);\n}\n\n.rdp-selected {\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-selected .rdp-day_button {\n border: var(--rdp-selected-border);\n}\n\n.rdp-outside {\n opacity: var(--rdp-outside-opacity);\n}\n\n.rdp-disabled:not(.rdp-selected) {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-hidden {\n visibility: hidden;\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_start {\n background: var(--rdp-range_start-background);\n}\n\n.rdp-range_start .rdp-day_button {\n background-color: var(--rdp-range_start-date-background-color);\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_middle {\n background-color: var(--rdp-range_middle-background-color);\n}\n\n.rdp-range_middle .rdp-day_button {\n border: unset;\n border-radius: unset;\n color: var(--rdp-range_middle-color);\n}\n\n.rdp-range_end {\n background: var(--rdp-range_end-background);\n color: var(--rdp-range_end-color);\n}\n\n.rdp-range_end .rdp-day_button {\n color: var(--rdp-range_start-color);\n background-color: var(--rdp-range_end-date-background-color);\n}\n\n.rdp-range_start.rdp-range_end {\n background: revert;\n}\n\n.rdp-focusable {\n cursor: pointer;\n}\n\n@keyframes rdp-slide_in_left {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_in_right {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_out_left {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100%);\n }\n}\n\n@keyframes rdp-slide_out_right {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n}\n\n.rdp-weeks_before_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_before_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n@keyframes rdp-fade_in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes rdp-fade_out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.rdp-caption_after_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_after_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n";
|
|
34676
35198
|
styleInject(css_248z$3);
|
|
34677
35199
|
|
|
34678
35200
|
var reactInputMask = {exports: {}};
|
|
@@ -39173,6 +39695,8 @@ const NumberFilterComponent = ({ column, filterBy, fieldFilter, handleSave, form
|
|
|
39173
39695
|
allowNegative: column.numericSettings?.allowNegative ?? false,
|
|
39174
39696
|
decimalScale: column.numericSettings?.fraction ?? 0
|
|
39175
39697
|
};
|
|
39698
|
+
console.log(column.numericSettings?.fraction);
|
|
39699
|
+
console.log(column.field);
|
|
39176
39700
|
let floatValue = parseFloat(valueFilter ?? '0');
|
|
39177
39701
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "r-filter-popup", onKeyDown: (e) => {
|
|
39178
39702
|
if (e.code === 'Enter' || e.code === 'NumpadEnter') {
|
|
@@ -39354,11 +39878,11 @@ const TableComponent = ({ idTable, dataSource, contentColumns, headerColumns, se
|
|
|
39354
39878
|
}, []);
|
|
39355
39879
|
return (jsxRuntime.jsx("div", { ref: containerRef, className: "r-gridtable", style: { maxHeight: `${height ? `${height}px` : 'auto'}` }, children: jsxRuntime.jsxs("table", { style: { width: '100%' }, role: "presentation", children: [jsxRuntime.jsx(RenderColGroup, { contentColumns: contentColumns }), jsxRuntime.jsx("thead", { className: "r-gridheader", role: "rowgroup", children: headerColumns.map((element, indexParent) => {
|
|
39356
39880
|
return (jsxRuntime.jsx("tr", { className: "r-row", role: "row", children: element?.map((col, index) => {
|
|
39357
|
-
return (jsxRuntime.jsx(HeaderTableCol, { col: col, idTable: idTable ?? '', dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: containerRef, filterBy: filterBy, orderBy: orderBy, optionsFilter: optionsFilter, allowFiltering: allowFiltering, allowSorting: allowSorting, formatSetting: formatSetting, changeFilter: (val) => {
|
|
39881
|
+
return (jsxRuntime.jsx(HeaderTableCol, { col: col, idTable: idTable ?? '', dataSource: dataSource, fieldKey: fieldKey, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: containerRef, filterBy: filterBy, orderBy: orderBy, optionsFilter: optionsFilter, allowFiltering: allowFiltering, allowSorting: allowSorting, formatSetting: formatSetting, changeFilter: (val) => {
|
|
39358
39882
|
setFilterBy([...val]);
|
|
39359
39883
|
}, changeOrder: (val) => {
|
|
39360
39884
|
setOrderBy([...val]);
|
|
39361
|
-
}, columns: contentColumns, setContentColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft
|
|
39885
|
+
}, columns: contentColumns, setContentColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft }, `header-${indexParent}-${index}`));
|
|
39362
39886
|
}) }, `header-${-indexParent}`));
|
|
39363
39887
|
}) }), jsxRuntime.jsxs("tbody", { className: "r-gridcontent", role: "rowgroup", children: [jsxRuntime.jsx("tr", { style: { height: offsetY } }), filteredData.slice(startIndex, endIndex).map((row) => {
|
|
39364
39888
|
const indexRow = row.indexRow;
|
|
@@ -40071,17 +40595,35 @@ const SettingColumn = React__default["default"].memo((props) => {
|
|
|
40071
40595
|
}) }) })] }), jsxRuntime.jsxs("div", { style: { boxShadow: '0 4px 24px 0 rgb(34 41 47 / 10%)' }, className: "d-flex justify-content-between align-items-center w-100 py-75 px-1", children: [jsxRuntime.jsx("div", { children: settingColumns?.updatedDate && (jsxRuntime.jsxs("p", { children: [jsxRuntime.jsxs("strong", { children: [t('Update date'), ": "] }), " ", jsxRuntime.jsx("span", { children: settingColumns.updatedDate ? formatDateTime(settingColumns.updatedDate, 'DD/MM/yyyy HH:mm') : '' }), jsxRuntime.jsxs("strong", { className: "ms-2", children: [t('Editor'), ": "] }), " ", jsxRuntime.jsx("span", { children: settingColumns.updatedByName })] })) }), jsxRuntime.jsxs("div", { children: [resetDefaultColumns && (jsxRuntime.jsx(Button$1$1, { color: "primary", onClick: () => messageBoxConfirm(t, handleResetColumns, {}, 'Do you want to reset the default settings?'), className: "me-1", children: t('Reset') })), jsxRuntime.jsx(Button$1$1, { color: "primary", onClick: handleSubmit, className: "me-1", children: t('Confirm') }), jsxRuntime.jsx(Button$1$1, { color: "secondary", onClick: handleCancel, outline: true, children: t('Close') })] })] })] }));
|
|
40072
40596
|
});
|
|
40073
40597
|
|
|
40074
|
-
const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, focusRow, editDisable, addDisable, buttonSetting, toolbarSetting }) => {
|
|
40598
|
+
const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, focusRow, editDisable, addDisable, buttonSetting, toolbarSetting, }) => {
|
|
40075
40599
|
const { t } = reactI18next.useTranslation();
|
|
40076
|
-
return (jsxRuntime.jsx("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: jsxRuntime.jsxs("div", { className: "r-toolbar-items", children: [jsxRuntime.jsxs("div", { className: "r-toolbar-left", children: [jsxRuntime.jsxs("div", { className: classNames$1('r-toolbar-item d-flex', {
|
|
40600
|
+
return (jsxRuntime.jsx("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: jsxRuntime.jsxs("div", { className: "r-toolbar-items", children: [jsxRuntime.jsxs("div", { className: "r-toolbar-left", children: [jsxRuntime.jsxs("div", { className: classNames$1('r-toolbar-item d-flex', {
|
|
40601
|
+
'd-none': editDisable || addDisable,
|
|
40602
|
+
}), "aria-disabled": "false", children: [jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: () => handleAdd(1), className: "d-flex", children: t('Add item') }), buttonSetting?.disableAddMulti === true && (jsxRuntime.jsxs(UncontrolledDropdown, { className: "nav-item", children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", className: "me-0 d-flex", children: jsxRuntime.jsx(Button$1$1, { type: "button", color: "success", outline: true, style: { marginLeft: -1 }, className: "px-25", children: jsxRuntime.jsx("svg", { fill: "#28c76f", height: "15", width: "20", viewBox: "0 0 20 20", children: jsxRuntime.jsx("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" }) }) }) }), jsxRuntime.jsxs(DropdownMenu$1, { className: "formula-dropdown icon-dropdown p-0", children: [jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(10), children: "10 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(20), children: "20 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(30), children: "30 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(40), children: "40 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(50), children: "50 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(100), children: "100 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(1000), children: "1000 h\u00E0ng" })] })] }))] }), (focusRow ?? -1) > -1 ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40603
|
+
'd-none': editDisable ||
|
|
40604
|
+
addDisable ||
|
|
40605
|
+
buttonSetting?.duplicateDisable,
|
|
40606
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: () => {
|
|
40077
40607
|
handleDuplicate();
|
|
40078
|
-
}, className: "d-flex", children: t('Duplicate') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40608
|
+
}, className: "d-flex", children: t('Duplicate') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40609
|
+
'd-none': editDisable ||
|
|
40610
|
+
addDisable ||
|
|
40611
|
+
buttonSetting?.insertBeforeDisable,
|
|
40612
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: handleInsertBefore, className: "d-flex", children: t('Insert item before') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40613
|
+
'd-none': editDisable ||
|
|
40614
|
+
addDisable ||
|
|
40615
|
+
buttonSetting?.insertAfterDisable,
|
|
40616
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: handleInsertAfter, className: "d-flex", children: t('Insert item after') }) })] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: " " })), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40617
|
+
'd-none': editDisable || buttonSetting?.deleteAllDisable,
|
|
40618
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "primary", outline: true, onClick: handleDeleteAll, className: "d-flex", children: t('Delete all item') }) }), toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
40079
40619
|
return (item.align === 'left' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`)));
|
|
40080
40620
|
})] }), jsxRuntime.jsx("div", { className: "r-toolbar-center", children: toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
40081
40621
|
return (item.align === 'center' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-center-${index}`)));
|
|
40082
40622
|
}) }), jsxRuntime.jsxs("div", { className: "r-toolbar-right", children: [toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
40083
40623
|
return (item.align === 'right' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-right-${index}`)));
|
|
40084
|
-
}), !toolbarSetting?.hiddenSetting && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsxRuntime.jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25', {
|
|
40624
|
+
}), !toolbarSetting?.hiddenSetting && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsxRuntime.jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25', {
|
|
40625
|
+
'd-none': editDisable || addDisable,
|
|
40626
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsxs(UncontrolledDropdown, { className: "dropdown-user nav-item", children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", color: "primary", onClick: (e) => e.preventDefault(), children: jsxRuntime.jsx(SvgInfo, { className: "cursor-pointer text-primary" }) }), jsxRuntime.jsx(DropdownMenu$1, { className: "formula-dropdown icon-dropdown", children: jsxRuntime.jsxs("ul", { className: "mb-0 pe-50", children: [jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + D \u0111\u1EC3 nh\u00E2n b\u1EA3n" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Ch\u1ECDn \u00F4 v\u00E0 Ctrl + V \u0111\u1EC3 d\u00E1n th\u00F4ng tin t\u1EEB excel" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + C \u0111\u1EC3 sao ch\u00E9p h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + V \u0111\u1EC3 d\u00E1n h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2193 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng d\u01B0\u1EDBi" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2191 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng tr\u00EAn" })] }) })] }) })] }))] })] }) }));
|
|
40085
40627
|
};
|
|
40086
40628
|
|
|
40087
40629
|
const RenderToolbarTop = ({ toolbarTopOption, maximize, setMaximize }) => {
|
|
@@ -69002,7 +69544,7 @@ const UnExpandAllIcon = ({ className, color = '#7F7F7F', size = 24, onClick, sty
|
|
|
69002
69544
|
};
|
|
69003
69545
|
|
|
69004
69546
|
const RenderContentCol = React__default["default"].memo((props) => {
|
|
69005
|
-
const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, handleCellClick, fieldKey, isMulti
|
|
69547
|
+
const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, handleCellClick, fieldKey, isMulti } = props;
|
|
69006
69548
|
const cellId = `content-${idTable}-row${indexRow}col-${indexCol}`;
|
|
69007
69549
|
const checkOverflow = () => {
|
|
69008
69550
|
const element = document.getElementById(cellId);
|
|
@@ -69024,12 +69566,10 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69024
69566
|
const RenderElement = () => {
|
|
69025
69567
|
if (col.field === '#' || col.type === '#') {
|
|
69026
69568
|
return (jsxRuntime.jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer text-center', {
|
|
69027
|
-
'r-active-cell': isSelected
|
|
69569
|
+
'r-active-cell': isSelected
|
|
69028
69570
|
}), style: {
|
|
69029
|
-
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
69030
|
-
|
|
69031
|
-
: 400,
|
|
69032
|
-
fontStyle: row.haveItalicType ? 'italic' : 'normal',
|
|
69571
|
+
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType ? 600 : 400,
|
|
69572
|
+
fontStyle: row.haveItalicType ? 'italic' : 'normal'
|
|
69033
69573
|
}, onDoubleClick: (e) => {
|
|
69034
69574
|
e.preventDefault();
|
|
69035
69575
|
handleCloseContext();
|
|
@@ -69038,15 +69578,11 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69038
69578
|
}
|
|
69039
69579
|
else if (col.type === 'checkbox' || col.field === 'checkbox') {
|
|
69040
69580
|
return (jsxRuntime.jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
|
|
69041
|
-
'r-active-cell': isSelected
|
|
69581
|
+
'r-active-cell': isSelected
|
|
69042
69582
|
}), style: {
|
|
69043
69583
|
display: 'flex',
|
|
69044
|
-
justifyContent: col.textAlign === 'center'
|
|
69045
|
-
|
|
69046
|
-
: col.textAlign === 'right'
|
|
69047
|
-
? 'flex-end'
|
|
69048
|
-
: 'flex-start',
|
|
69049
|
-
alignItems: 'center',
|
|
69584
|
+
justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start',
|
|
69585
|
+
alignItems: 'center'
|
|
69050
69586
|
}, onClick: (e) => {
|
|
69051
69587
|
setSelectedRows(toggleSelect());
|
|
69052
69588
|
e.stopPropagation();
|
|
@@ -69056,12 +69592,8 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69056
69592
|
let value = row[col.field];
|
|
69057
69593
|
// ✅ Format dữ liệu theo loại cột
|
|
69058
69594
|
if (col.type === 'numeric') {
|
|
69059
|
-
value =
|
|
69060
|
-
|
|
69061
|
-
if (!zeroVisiable &&
|
|
69062
|
-
!col.zeroVisiable &&
|
|
69063
|
-
!(row?.sortOrder < 0 || row?.sortOrder > 100000) &&
|
|
69064
|
-
(value === '0' || value === 0)) {
|
|
69595
|
+
value = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
|
|
69596
|
+
if (!zeroVisiable && !col.zeroVisiable && !(row?.sortOrder < 0 || row?.sortOrder > 100000) && (value === '0' || value === 0)) {
|
|
69065
69597
|
value = '';
|
|
69066
69598
|
}
|
|
69067
69599
|
}
|
|
@@ -69069,43 +69601,31 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69069
69601
|
value = value ? formatDateTime(value, formatSetting?.dateFormat) : '';
|
|
69070
69602
|
}
|
|
69071
69603
|
else if (col.type === 'datetime') {
|
|
69072
|
-
value = value
|
|
69073
|
-
? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
69074
|
-
: '';
|
|
69604
|
+
value = value ? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
|
|
69075
69605
|
}
|
|
69076
69606
|
if (col.template) {
|
|
69077
69607
|
value = col.template(row, indexRow) ?? '';
|
|
69078
69608
|
}
|
|
69079
69609
|
const isNegative = col.type === 'numeric' && Number(row[col.field]) < 0;
|
|
69080
|
-
const textColor = isNegative
|
|
69081
|
-
|
|
69082
|
-
|
|
69083
|
-
const
|
|
69084
|
-
const suffix = isNegative ? (formatSetting?.suffixNegative ?? '') : '';
|
|
69085
|
-
const displayText = isNegative
|
|
69086
|
-
? `${prefix}${value}${suffix}`
|
|
69087
|
-
: (value ?? '');
|
|
69610
|
+
const textColor = isNegative ? formatSetting?.colorNegative ?? 'red' : undefined;
|
|
69611
|
+
const prefix = isNegative ? formatSetting?.prefixNegative ?? '-' : '';
|
|
69612
|
+
const suffix = isNegative ? formatSetting?.suffixNegative ?? '' : '';
|
|
69613
|
+
const displayText = isNegative ? `${prefix}${value}${suffix}` : value ?? '';
|
|
69088
69614
|
return (jsxRuntime.jsxs("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
|
|
69089
|
-
'r-active-cell': isSelected
|
|
69615
|
+
'r-active-cell': isSelected
|
|
69090
69616
|
}), style: {
|
|
69091
|
-
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
69092
|
-
|
|
69093
|
-
: 400,
|
|
69094
|
-
fontStyle: row.haveItalicType ? 'italic' : 'normal',
|
|
69617
|
+
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType ? 600 : 400,
|
|
69618
|
+
fontStyle: row.haveItalicType ? 'italic' : 'normal'
|
|
69095
69619
|
}, children: [jsxRuntime.jsx("div", { className: "r-cell-text", style: {
|
|
69096
69620
|
display: 'flex',
|
|
69097
|
-
justifyContent: col.textAlign === 'center'
|
|
69098
|
-
|
|
69099
|
-
: col.textAlign === 'right'
|
|
69100
|
-
? 'flex-end'
|
|
69101
|
-
: 'flex-start',
|
|
69102
|
-
alignItems: 'center',
|
|
69621
|
+
justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start',
|
|
69622
|
+
alignItems: 'center'
|
|
69103
69623
|
}, children: jsxRuntime.jsx("div", { id: cellId, style: {
|
|
69104
69624
|
color: textColor,
|
|
69105
69625
|
overflow: 'hidden',
|
|
69106
69626
|
textOverflow: 'ellipsis',
|
|
69107
69627
|
whiteSpace: 'pre',
|
|
69108
|
-
maxWidth: '100%'
|
|
69628
|
+
maxWidth: '100%'
|
|
69109
69629
|
}, children: displayText }) }), checkOverflow() && (jsxRuntime.jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: cellId, placement: "top", children: jsxRuntime.jsx("div", { style: { color: textColor }, onClick: (e) => {
|
|
69110
69630
|
e.stopPropagation();
|
|
69111
69631
|
e.preventDefault();
|
|
@@ -69114,15 +69634,10 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69114
69634
|
};
|
|
69115
69635
|
const clickTimerRef = React$5.useRef(null);
|
|
69116
69636
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: col.visible !== false && col.isGroup !== true && (jsxRuntime.jsx("td", { className: classNames$1(`r-rowcell fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, {
|
|
69117
|
-
'fixed-last': (col.fixedType === 'left' &&
|
|
69118
|
-
indexCol === lastObjWidthFixLeft) ||
|
|
69119
|
-
(col.fixedType === 'right' &&
|
|
69120
|
-
indexCol === fisrtObjWidthFixRight),
|
|
69637
|
+
'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight)
|
|
69121
69638
|
}, { 'r-active': isSelected }), style: {
|
|
69122
69639
|
left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
|
|
69123
|
-
right: col.fixedType === 'right'
|
|
69124
|
-
? objWidthFixRight[indexCol]
|
|
69125
|
-
: undefined,
|
|
69640
|
+
right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined
|
|
69126
69641
|
}, onClick: (e) => {
|
|
69127
69642
|
const tag = e.target?.nodeName;
|
|
69128
69643
|
if (tag !== 'DIV' && tag !== 'TD') {
|
|
@@ -69156,7 +69671,7 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69156
69671
|
});
|
|
69157
69672
|
|
|
69158
69673
|
const TableElement = React__default["default"].memo((props) => {
|
|
69159
|
-
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
|
|
69674
|
+
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;
|
|
69160
69675
|
const { t } = reactI18next.useTranslation();
|
|
69161
69676
|
const [context, setContext] = React$5.useState(null);
|
|
69162
69677
|
const virtualDivRef = React$5.useRef(null);
|
|
@@ -69202,10 +69717,7 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69202
69717
|
if (searchTerm) {
|
|
69203
69718
|
datas = datas.filter((row) => {
|
|
69204
69719
|
return searchSetting?.keyField?.some((key) => {
|
|
69205
|
-
return row[key]
|
|
69206
|
-
?.toString()
|
|
69207
|
-
.toLowerCase()
|
|
69208
|
-
.includes(searchTerm.trim().toLowerCase());
|
|
69720
|
+
return row[key]?.toString().toLowerCase().includes(searchTerm.trim().toLowerCase());
|
|
69209
69721
|
});
|
|
69210
69722
|
});
|
|
69211
69723
|
}
|
|
@@ -69214,10 +69726,7 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69214
69726
|
return filterBy.every((filter) => {
|
|
69215
69727
|
const { key, value, ope } = filter;
|
|
69216
69728
|
const rowValue = row[key];
|
|
69217
|
-
if (rowValue === undefined ||
|
|
69218
|
-
rowValue === null ||
|
|
69219
|
-
value === undefined ||
|
|
69220
|
-
value === null) {
|
|
69729
|
+
if (rowValue === undefined || rowValue === null || value === undefined || value === null) {
|
|
69221
69730
|
return false;
|
|
69222
69731
|
}
|
|
69223
69732
|
const valStr = String(rowValue).toLowerCase();
|
|
@@ -69283,68 +69792,52 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69283
69792
|
}
|
|
69284
69793
|
let value = row[col.field];
|
|
69285
69794
|
if (col.type === 'numeric') {
|
|
69286
|
-
value =
|
|
69287
|
-
formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
|
|
69795
|
+
value = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
|
|
69288
69796
|
}
|
|
69289
69797
|
else if (col.type === 'date') {
|
|
69290
|
-
value = value
|
|
69291
|
-
? formatDateTime(value, formatSetting?.dateFormat)
|
|
69292
|
-
: '';
|
|
69798
|
+
value = value ? formatDateTime(value, formatSetting?.dateFormat) : '';
|
|
69293
69799
|
}
|
|
69294
69800
|
else if (col.type === 'datetime') {
|
|
69295
|
-
value = value
|
|
69296
|
-
? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
69297
|
-
: '';
|
|
69801
|
+
value = value ? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
|
|
69298
69802
|
}
|
|
69299
69803
|
if (col.template) {
|
|
69300
69804
|
value = col.template(row, indexRow) ?? '';
|
|
69301
69805
|
}
|
|
69302
69806
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("tr", { "aria-rowindex": indexRow + 1, role: "row", className: "r-row", children: [jsxRuntime.jsx("td", { className: "r-rowcell r-cell-group", colSpan: 3, children: jsxRuntime.jsxs("div", { className: "r-rowcell-div", children: [jsxRuntime.jsx(SvgChevronRight, { style: {
|
|
69303
69807
|
marginLeft: level * 20,
|
|
69304
|
-
transform: expand ? 'rotate(90deg)' : 'rotate(0deg)'
|
|
69808
|
+
transform: expand ? 'rotate(90deg)' : 'rotate(0deg)'
|
|
69305
69809
|
}, fontSize: 15, onClick: () => {
|
|
69306
69810
|
setExpand(!expand);
|
|
69307
69811
|
setExpandsAll(undefined);
|
|
69308
69812
|
row.expand = !expand;
|
|
69309
69813
|
} }), t(col.headerDisplay ?? col.headerText ?? ''), ": ", value, " (", row.children.length, ")"] }) }), contentColumns.map((colSum, indexCol) => {
|
|
69310
|
-
if (indexCol <= firstColSpan ||
|
|
69311
|
-
colSum.visible === false ||
|
|
69312
|
-
colSum.isGroup === true) {
|
|
69814
|
+
if (indexCol <= firstColSpan || colSum.visible === false || colSum.isGroup === true) {
|
|
69313
69815
|
return;
|
|
69314
69816
|
}
|
|
69315
69817
|
let sumValue = row[colSum.field];
|
|
69316
|
-
const haveSum = row[colSum.field] !== undefined &&
|
|
69317
|
-
|
|
69318
|
-
if (!haveSum &&
|
|
69319
|
-
colSum.haveSum === true &&
|
|
69320
|
-
colSum.type === 'numeric') {
|
|
69818
|
+
const haveSum = row[colSum.field] !== undefined && row[colSum.field] !== null;
|
|
69819
|
+
if (!haveSum && colSum.haveSum === true && colSum.type === 'numeric') {
|
|
69321
69820
|
sumValue = row.children.reduce(function (accumulator, currentValue) {
|
|
69322
|
-
return
|
|
69323
|
-
Number(currentValue[colSum.field] ?? 0));
|
|
69821
|
+
return Number(accumulator ?? 0) + Number(currentValue[colSum.field] ?? 0);
|
|
69324
69822
|
}, 0);
|
|
69325
69823
|
}
|
|
69326
69824
|
if (colSum.type === 'numeric') {
|
|
69327
69825
|
sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', colSum.numericSettings?.fraction, true, false);
|
|
69328
|
-
if (!zeroVisiable &&
|
|
69329
|
-
!col.zeroVisiable &&
|
|
69330
|
-
(sumValue === '0' || sumValue === 0)) {
|
|
69826
|
+
if (!zeroVisiable && !col.zeroVisiable && (sumValue === '0' || sumValue === 0)) {
|
|
69331
69827
|
sumValue = '';
|
|
69332
69828
|
}
|
|
69333
69829
|
}
|
|
69334
69830
|
return (jsxRuntime.jsx("td", { className: "r-rowcell r-cell-sum-group", children: jsxRuntime.jsx("div", { className: "r-rowcell-div", style: {
|
|
69335
|
-
justifyContent: colSum.textAlign
|
|
69336
|
-
|
|
69337
|
-
: '
|
|
69338
|
-
}, children: (haveSum || colSum.haveSum === true) &&
|
|
69339
|
-
Number(row[colSum.field] ?? '0') < 0 ? (jsxRuntime.jsxs("div", { style: {
|
|
69340
|
-
color: formatSetting?.colorNegative ?? 'red',
|
|
69831
|
+
justifyContent: colSum.textAlign ? colSum.textAlign : 'left'
|
|
69832
|
+
}, children: (haveSum || colSum.haveSum === true) && Number(row[colSum.field] ?? '0') < 0 ? (jsxRuntime.jsxs("div", { style: {
|
|
69833
|
+
color: formatSetting?.colorNegative ?? 'red'
|
|
69341
69834
|
}, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `group-sum-cell-${level}-${indexRow}-${indexCol}`));
|
|
69342
|
-
})] }), expand &&
|
|
69835
|
+
})] }), expand && jsxRuntime.jsx(RenderContent, { datas: row.children, level: level + 1 })] }, `row-${level}-${indexRow}`));
|
|
69343
69836
|
}
|
|
69344
69837
|
else {
|
|
69345
69838
|
const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
|
|
69346
69839
|
return (jsxRuntime.jsx("tr", { id: `row-content-${indexRow}`, "aria-rowindex": indexRow + 1, role: "row", className: classNames$1('r-row', {
|
|
69347
|
-
'r-last-row': level === 0 && indexRow === viewData.length - 1
|
|
69840
|
+
'r-last-row': level === 0 && indexRow === viewData.length - 1
|
|
69348
69841
|
}), onContextMenu: (e) => {
|
|
69349
69842
|
e.preventDefault();
|
|
69350
69843
|
handleContextMenu(e, row);
|
|
@@ -69360,7 +69853,7 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69360
69853
|
x: e.clientX,
|
|
69361
69854
|
y: e.clientY,
|
|
69362
69855
|
row,
|
|
69363
|
-
show: true
|
|
69856
|
+
show: true
|
|
69364
69857
|
});
|
|
69365
69858
|
}, 100);
|
|
69366
69859
|
};
|
|
@@ -69384,28 +69877,20 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69384
69877
|
let sumValue = item?.value;
|
|
69385
69878
|
if (!item && col.haveSum === true && col.type === 'numeric') {
|
|
69386
69879
|
sumValue = viewData.reduce(function (accumulator, currentValue) {
|
|
69387
|
-
return
|
|
69388
|
-
Number(currentValue[col.field] ?? 0));
|
|
69880
|
+
return Number(accumulator ?? 0) + Number(currentValue[col.field] ?? 0);
|
|
69389
69881
|
}, 0);
|
|
69390
69882
|
}
|
|
69391
69883
|
if (col.type === 'numeric') {
|
|
69392
69884
|
sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false);
|
|
69393
69885
|
}
|
|
69394
69886
|
return (jsxRuntime.jsx("td", { className: classNames$1(`p-0 px-50 r-footer fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }), style: {
|
|
69395
|
-
left: col.fixedType === 'left'
|
|
69396
|
-
|
|
69397
|
-
|
|
69398
|
-
|
|
69399
|
-
|
|
69400
|
-
: undefined,
|
|
69401
|
-
textAlign: col.textAlign ? col.textAlign : 'left',
|
|
69402
|
-
}, children: jsxRuntime.jsx("div", { className: "r-footer-div", children: (item || col.haveSum === true) &&
|
|
69403
|
-
Number(item?.value ?? '0') < 0 ? (jsxRuntime.jsxs("div", { style: {
|
|
69404
|
-
color: formatSetting?.colorNegative ?? 'red',
|
|
69887
|
+
left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
|
|
69888
|
+
right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined,
|
|
69889
|
+
textAlign: col.textAlign ? col.textAlign : 'left'
|
|
69890
|
+
}, children: jsxRuntime.jsx("div", { className: "r-footer-div", children: (item || col.haveSum === true) && Number(item?.value ?? '0') < 0 ? (jsxRuntime.jsxs("div", { style: {
|
|
69891
|
+
color: formatSetting?.colorNegative ?? 'red'
|
|
69405
69892
|
}, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `summarycell-${indexCol}`));
|
|
69406
|
-
}) })) })] }), jsxRuntime.jsx("div", { ref: virtualDivRef }), context &&
|
|
69407
|
-
(contextMenuItems?.length ?? 0) > 0 &&
|
|
69408
|
-
handleContextMenuClick && (jsxRuntime.jsx(Popover$1, { className: "r-context-popover", placement: "right-start", isOpen: context.show, target: virtualDivRef.current, toggle: handleCloseContext, fade: false, children: jsxRuntime.jsx(PopoverBody$1, { children: contextMenuItems?.map((item, index) => {
|
|
69893
|
+
}) })) })] }), jsxRuntime.jsx("div", { ref: virtualDivRef }), context && (contextMenuItems?.length ?? 0) > 0 && handleContextMenuClick && (jsxRuntime.jsx(Popover$1, { className: "r-context-popover", placement: "right-start", isOpen: context.show, target: virtualDivRef.current, toggle: handleCloseContext, fade: false, children: jsxRuntime.jsx(PopoverBody$1, { children: contextMenuItems?.map((item, index) => {
|
|
69409
69894
|
return (jsxRuntime.jsxs("div", { className: "r-context-item", onClick: () => {
|
|
69410
69895
|
handleCloseContext();
|
|
69411
69896
|
handleContextMenuClick?.(item, context.row);
|
|
@@ -69413,7 +69898,7 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69413
69898
|
}) }) })), (viewData.length ?? 0) === 0 && !isLoading && (jsxRuntime.jsxs("div", { className: "r-no-data", children: [jsxRuntime.jsx("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsxs("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [jsxRuntime.jsx("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }), jsxRuntime.jsxs("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [jsxRuntime.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" }), jsxRuntime.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.')] }))] }));
|
|
69414
69899
|
});
|
|
69415
69900
|
|
|
69416
|
-
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
|
|
69901
|
+
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 }) => {
|
|
69417
69902
|
const { t } = reactI18next.useTranslation();
|
|
69418
69903
|
const gridRef = React$5.useRef(null);
|
|
69419
69904
|
const [openPopupSetupColumn, setOpenPopupSetupColumn] = React$5.useState(false);
|
|
@@ -69426,8 +69911,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69426
69911
|
const [expandsAll, setExpandsAll] = React$5.useState(true);
|
|
69427
69912
|
const [maximize, setMaximize] = React$5.useState(false);
|
|
69428
69913
|
const [windowHeight, setWindowHeight] = React$5.useState(window.innerHeight);
|
|
69429
|
-
const fieldKey = columns.find((item) => item.isPrimarykey === true)?.field ??
|
|
69430
|
-
'id';
|
|
69914
|
+
const fieldKey = columns.find((item) => item.isPrimarykey === true)?.field ?? 'id';
|
|
69431
69915
|
React$5.useEffect(() => {
|
|
69432
69916
|
const handleResize = () => {
|
|
69433
69917
|
setWindowHeight(window.innerHeight);
|
|
@@ -69437,19 +69921,14 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69437
69921
|
}, []);
|
|
69438
69922
|
const heightTable = React$5.useMemo(() => {
|
|
69439
69923
|
if (maximize) {
|
|
69440
|
-
return
|
|
69441
|
-
(pagingSetting?.allowPaging ? 50 : 0) -
|
|
69442
|
-
(haveSum ? 30 : 0) -
|
|
69443
|
-
(headerHeight ?? 59) -
|
|
69444
|
-
(toolbarSetting?.showBottomToolbar ? 42 : 0) -
|
|
69445
|
-
(toolbarSetting?.showTopToolbar ? 42 : 0));
|
|
69924
|
+
return windowHeight - (pagingSetting?.allowPaging ? 50 : 0) - (haveSum ? 30 : 0) - (headerHeight ?? 59) - (toolbarSetting?.showBottomToolbar ? 42 : 0) - (toolbarSetting?.showTopToolbar ? 42 : 0);
|
|
69446
69925
|
}
|
|
69447
69926
|
return height;
|
|
69448
69927
|
}, [height, maximize, windowHeight]);
|
|
69449
69928
|
const optionsGroupColumn = React$5.useMemo(() => {
|
|
69450
69929
|
return contentColumns.map((col) => ({
|
|
69451
69930
|
...col,
|
|
69452
|
-
headerText: t(col.headerText)
|
|
69931
|
+
headerText: t(col.headerText)
|
|
69453
69932
|
}));
|
|
69454
69933
|
}, [contentColumns]);
|
|
69455
69934
|
React$5.useEffect(() => {
|
|
@@ -69458,7 +69937,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69458
69937
|
}
|
|
69459
69938
|
setExpandsAll(true);
|
|
69460
69939
|
}, [groupSetting?.groupColumns]);
|
|
69461
|
-
const { levels: headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight
|
|
69940
|
+
const { levels: headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight } = React$5.useMemo(() => {
|
|
69462
69941
|
const rs = calculateTableStructure(columns, settingColumns?.value, groupSetting?.groupColumns);
|
|
69463
69942
|
setContentColumns(rs.flat);
|
|
69464
69943
|
return rs;
|
|
@@ -69476,17 +69955,12 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69476
69955
|
}
|
|
69477
69956
|
};
|
|
69478
69957
|
const searchTemplate = () => {
|
|
69479
|
-
return (jsxRuntime.jsx("div", { className: "me-50 r-search", children: jsxRuntime.jsx(ReactInput, { style: { width: '230px' }, value: searchSetting?.searchTerm !== undefined
|
|
69480
|
-
? searchSetting?.searchTerm
|
|
69481
|
-
: searchTerm, setSearchTerm: searchSetting?.setSearchTerm
|
|
69482
|
-
? searchSetting?.setSearchTerm
|
|
69483
|
-
: setSearchTerm, placeholder: t('Search'), onKeyPress: handleKeyPress }) }));
|
|
69958
|
+
return (jsxRuntime.jsx("div", { className: "me-50 r-search", children: jsxRuntime.jsx(ReactInput, { style: { width: '230px' }, value: searchSetting?.searchTerm !== undefined ? searchSetting?.searchTerm : searchTerm, setSearchTerm: searchSetting?.setSearchTerm ? searchSetting?.setSearchTerm : setSearchTerm, placeholder: t('Search'), onKeyPress: handleKeyPress }) }));
|
|
69484
69959
|
};
|
|
69485
69960
|
const groupbtnTemplate = () => {
|
|
69486
69961
|
return (jsxRuntime.jsxs(UncontrolledDropdown, { children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", id: "group-dropdown-toggle", style: { position: 'relative' }, onClick: (e) => e.preventDefault(), children: jsxRuntime.jsx(GroupIcon, { color: "#7F7F7F", size: 24 }) }), jsxRuntime.jsxs(DropdownMenu$1, { className: "formula-dropdown icon-dropdown p-1", children: [jsxRuntime.jsx("div", { className: "mb-1", style: { fontSize: 16, fontWeight: 500 }, children: "Nh\u00F3m d\u1EEF li\u1EC7u theo c\u1ED9t" }), jsxRuntime.jsxs("div", { className: 'form-group', children: [jsxRuntime.jsx(Label$1, { id: `label-group-1`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 1" }), jsxRuntime.jsx("div", { className: "form-input", children: jsxRuntime.jsx(SelectTable, { options: optionsGroupColumn, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[0]
|
|
69487
69962
|
? {
|
|
69488
|
-
headerText: t(contentColumns.find((x) => x.field === groupColumns[0])?.headerText ??
|
|
69489
|
-
contentColumns.find((x) => x.field === groupColumns[0])?.headerText),
|
|
69963
|
+
headerText: t(contentColumns.find((x) => x.field === groupColumns[0])?.headerText ?? contentColumns.find((x) => x.field === groupColumns[0])?.headerText)
|
|
69490
69964
|
}
|
|
69491
69965
|
: undefined, onChange: (val) => {
|
|
69492
69966
|
if (val) {
|
|
@@ -69498,8 +69972,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69498
69972
|
setGroupColumns([...groupColumns]);
|
|
69499
69973
|
}, isClearable: groupColumns?.length === 1 }) })] }), jsxRuntime.jsxs("div", { className: 'form-group', children: [jsxRuntime.jsx(Label$1, { id: `label-group-2`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 2" }), jsxRuntime.jsx("div", { className: "form-input", children: jsxRuntime.jsx(SelectTable, { options: optionsGroupColumn, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[1]
|
|
69500
69974
|
? {
|
|
69501
|
-
headerText: t(contentColumns.find((x) => x.field === groupColumns[1])?.headerText ??
|
|
69502
|
-
contentColumns.find((x) => x.field === groupColumns[1])?.headerText),
|
|
69975
|
+
headerText: t(contentColumns.find((x) => x.field === groupColumns[1])?.headerText ?? contentColumns.find((x) => x.field === groupColumns[1])?.headerText)
|
|
69503
69976
|
}
|
|
69504
69977
|
: undefined, onChange: (val) => {
|
|
69505
69978
|
if (val) {
|
|
@@ -69511,8 +69984,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69511
69984
|
setGroupColumns([...groupColumns]);
|
|
69512
69985
|
}, isClearable: groupColumns?.length === 2 }) })] }), jsxRuntime.jsxs("div", { className: 'form-group', children: [jsxRuntime.jsx(Label$1, { id: `label-group-3`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 3" }), jsxRuntime.jsx("div", { className: "form-input", children: jsxRuntime.jsx(SelectTable, { options: optionsGroupColumn, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[2]
|
|
69513
69986
|
? {
|
|
69514
|
-
headerText: t(contentColumns.find((x) => x.field === groupColumns[2])?.headerText ??
|
|
69515
|
-
contentColumns.find((x) => x.field === groupColumns[2])?.headerText),
|
|
69987
|
+
headerText: t(contentColumns.find((x) => x.field === groupColumns[2])?.headerText ?? contentColumns.find((x) => x.field === groupColumns[2])?.headerText)
|
|
69516
69988
|
}
|
|
69517
69989
|
: undefined, onChange: (val) => {
|
|
69518
69990
|
if (groupSetting) {
|
|
@@ -69526,7 +69998,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69526
69998
|
}
|
|
69527
69999
|
}, isClearable: groupColumns?.length === 3 }) })] }), jsxRuntime.jsxs("div", { className: "border-top d-flex justify-content-end mt-1", children: [jsxRuntime.jsx(Button$1$1, { color: "primary", className: "mt-1 me-50 rounded", size: "sm", onClick: () => {
|
|
69528
70000
|
groupSetting?.onGroup({
|
|
69529
|
-
columnGrouped: groupColumns.filter((x) => x)
|
|
70001
|
+
columnGrouped: groupColumns.filter((x) => x)
|
|
69530
70002
|
});
|
|
69531
70003
|
document.getElementById('group-dropdown-toggle')?.click();
|
|
69532
70004
|
}, children: `${t('Apply')}` }), jsxRuntime.jsx(Button$1$1, { color: "secondary", outline: true, className: "mt-1 rounded", size: "sm", onClick: () => {
|
|
@@ -69535,16 +70007,14 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69535
70007
|
}, children: `${t('Delete')}` })] })] })] }));
|
|
69536
70008
|
};
|
|
69537
70009
|
const chooseColumnsTemplate = () => {
|
|
69538
|
-
return
|
|
70010
|
+
return jsxRuntime.jsx(SvgSettings, { className: "r-toolbar-icon", fontSize: 20, color: "#7F7F7F", onClick: () => setOpenPopupSetupColumn(true) });
|
|
69539
70011
|
};
|
|
69540
70012
|
const expandTemplate = () => {
|
|
69541
70013
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!expandsAll && (jsxRuntime.jsx(ExpandAllIcon, { onClick: () => {
|
|
69542
70014
|
setExpandsAll(true);
|
|
69543
|
-
}, color: "#7F7F7F", size: 24 })), expandsAll &&
|
|
70015
|
+
}, color: "#7F7F7F", size: 24 })), expandsAll && jsxRuntime.jsx(UnExpandAllIcon, { onClick: () => setExpandsAll(false), color: "#7F7F7F", size: 24 })] }));
|
|
69544
70016
|
};
|
|
69545
|
-
const defaultToolbarOption = searchSetting?.searchEnable
|
|
69546
|
-
? [{ template: searchTemplate, align: 'left' }]
|
|
69547
|
-
: [];
|
|
70017
|
+
const defaultToolbarOption = searchSetting?.searchEnable ? [{ template: searchTemplate, align: 'left' }] : [];
|
|
69548
70018
|
if (groupSetting) {
|
|
69549
70019
|
defaultToolbarOption.push({ template: groupbtnTemplate, align: 'left' });
|
|
69550
70020
|
}
|
|
@@ -69553,10 +70023,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69553
70023
|
}
|
|
69554
70024
|
let toolbarTopOption = [];
|
|
69555
70025
|
if (toolbarSetting?.toolbarOptions) {
|
|
69556
|
-
toolbarTopOption = [
|
|
69557
|
-
...defaultToolbarOption,
|
|
69558
|
-
...toolbarSetting?.toolbarOptions,
|
|
69559
|
-
];
|
|
70026
|
+
toolbarTopOption = [...defaultToolbarOption, ...toolbarSetting?.toolbarOptions];
|
|
69560
70027
|
}
|
|
69561
70028
|
else {
|
|
69562
70029
|
toolbarTopOption = [...defaultToolbarOption];
|
|
@@ -69587,9 +70054,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69587
70054
|
React$5.useEffect(() => {
|
|
69588
70055
|
if (setSelectedItem) {
|
|
69589
70056
|
if (isMulti) {
|
|
69590
|
-
if (dataSource &&
|
|
69591
|
-
selectedRows &&
|
|
69592
|
-
selectedRows?.length !== selectedItem?.length) {
|
|
70057
|
+
if (dataSource && selectedRows && selectedRows?.length !== selectedItem?.length) {
|
|
69593
70058
|
setSelectedItem([...selectedRows]);
|
|
69594
70059
|
if (handleSelect) {
|
|
69595
70060
|
handleSelect([...selectedRows]);
|
|
@@ -69598,8 +70063,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69598
70063
|
}
|
|
69599
70064
|
else {
|
|
69600
70065
|
if (dataSource && selectedRows?.length > 0) {
|
|
69601
|
-
if (!selectedItem ||
|
|
69602
|
-
selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
70066
|
+
if (!selectedItem || selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
69603
70067
|
setSelectedItem({ ...selectedRows[0] });
|
|
69604
70068
|
if (handleSelect) {
|
|
69605
70069
|
handleSelect({ ...selectedRows[0] });
|
|
@@ -69618,8 +70082,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69618
70082
|
React$5.useEffect(() => {
|
|
69619
70083
|
if (!isMulti) {
|
|
69620
70084
|
if (dataSource && selectedItem && selectedItem[fieldKey]) {
|
|
69621
|
-
if (selectedRows?.length === 0 ||
|
|
69622
|
-
selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
70085
|
+
if (selectedRows?.length === 0 || selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
|
|
69623
70086
|
setSelectedRows([selectedItem]);
|
|
69624
70087
|
}
|
|
69625
70088
|
}
|
|
@@ -69628,18 +70091,16 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69628
70091
|
}
|
|
69629
70092
|
}
|
|
69630
70093
|
else {
|
|
69631
|
-
if (dataSource &&
|
|
69632
|
-
selectedItem &&
|
|
69633
|
-
selectedRows?.length !== selectedItem.length) {
|
|
70094
|
+
if (dataSource && selectedItem && selectedRows?.length !== selectedItem.length) {
|
|
69634
70095
|
setSelectedRows(selectedItem ? [...selectedItem] : []);
|
|
69635
70096
|
}
|
|
69636
70097
|
}
|
|
69637
70098
|
}, [selectedItem]);
|
|
69638
70099
|
return (jsxRuntime.jsxs("div", { className: classNames$1('r-table-edit r-virtualized-table', {
|
|
69639
|
-
'is-maximized': maximize
|
|
69640
|
-
}), children: [jsxRuntime.jsxs("div", { className: "r-grid", children: [toolbarSetting?.showTopToolbar &&
|
|
70100
|
+
'is-maximized': maximize
|
|
70101
|
+
}), children: [jsxRuntime.jsxs("div", { className: "r-grid", children: [toolbarSetting?.showTopToolbar && jsxRuntime.jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption, maximize: maximize, setMaximize: setMaximize }), headerComponent && headerComponent(), jsxRuntime.jsxs("div", { ref: gridRef, className: "r-gridtable", style: {
|
|
69641
70102
|
height: `${heightTable ? `${heightTable}px` : 'auto'}`,
|
|
69642
|
-
position: 'relative'
|
|
70103
|
+
position: 'relative'
|
|
69643
70104
|
}, children: [jsxRuntime.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 && (jsxRuntime.jsx("div", { className: "r-loading-overlay", children: jsxRuntime.jsxs("div", { className: "r-loading", children: [jsxRuntime.jsx(Spinner$1, { className: "me-1" }), t('Loading...')] }) }))] })] }), pagingSetting?.allowPaging && (jsxRuntime.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 })), jsxRuntime.jsx(SettingColumn, { gridRef: gridRef, handleSidebar: () => {
|
|
69644
70105
|
setOpenPopupSetupColumn(!openPopupSetupColumn);
|
|
69645
70106
|
}, settingColumns: settingColumns, openSidebar: openPopupSetupColumn, column: [...contentColumns], resetDefaultColumns: resetDefaultColumns, setColumn: (newColumns) => {
|
|
@@ -69650,7 +70111,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69650
70111
|
visible: x.visible,
|
|
69651
70112
|
fixedType: x.fixedType,
|
|
69652
70113
|
width: x.width,
|
|
69653
|
-
sortOrder: index + 1
|
|
70114
|
+
sortOrder: index + 1
|
|
69654
70115
|
})));
|
|
69655
70116
|
}
|
|
69656
70117
|
} })] }));
|