react-table-edit 1.5.42 → 1.5.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component/sidebar-setting-column/index.d.ts +0 -2
- package/dist/component/table/toolbar-bottom.d.ts +1 -1
- package/dist/component/table-view/content.d.ts +1 -0
- package/dist/component/table-view/header.d.ts +3 -3
- package/dist/component/table-view/index.d.ts +1 -0
- package/dist/component/table-view/table.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1129 -320
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1129 -320
- package/dist/index.mjs.map +1 -1
- package/dist/styles/date-picker.css +771 -74
- package/dist/styles/date-picker.css.map +1 -1
- package/dist/styles/form-wizard.css.map +1 -1
- package/dist/styles/index.css +840 -296
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/select-table.css.map +1 -1
- package/dist/styles/sidebar.css +0 -14
- package/dist/styles/sidebar.css.map +1 -1
- package/dist/styles/tab-menu.css.map +1 -1
- package/package.json +1 -1
- package/dist/component/calendar/index.d.ts +0 -8
package/dist/index.js
CHANGED
|
@@ -9085,6 +9085,20 @@ var SvgProcess = function (_a) {
|
|
|
9085
9085
|
React__namespace.createElement("path", { d: "M22.43 3.87a1.302 1.302 0 0 0-2.545-.374H9.886V1.874a.375.375 0 0 0-.375-.375H2.858a.375.375 0 0 0-.375.375v3.992a.375.375 0 0 0 .375.375h6.653a.375.375 0 0 0 .375-.375V4.245h9.999a1.301 1.301 0 0 0 .867.868v6.344h-.902v-1.62a.376.376 0 0 0-.375-.376h-6.653a.375.375 0 0 0-.375.375v1.62H4.115a1.3 1.3 0 1 0-1.617 1.618v7.055a.375.375 0 0 0 .375.375H5.81v1.621a.375.375 0 0 0 .375.375h6.652a.376.376 0 0 0 .375-.375v-1.62h5.327l-.695.674a.375.375 0 1 0 .522.538l1.357-1.316a.377.377 0 0 0 .006-.544l-1.357-1.316a.375.375 0 1 0-.522.539l.695.674h-5.333v-1.62a.376.376 0 0 0-.375-.376H6.185a.376.376 0 0 0-.375.375v1.621H3.248v-6.68a1.301 1.301 0 0 0 .867-.867h8.332v1.62a.374.374 0 0 0 .375.376h6.653a.374.374 0 0 0 .375-.375v-1.621h1.277a.376.376 0 0 0 .375-.375v-6.72a1.3 1.3 0 0 0 .929-1.242ZM9.137 5.492H3.233V2.25h5.903v3.242ZM6.56 18.508h5.902v3.242H6.56v-3.242Zm-3.687-6.122a.554.554 0 0 1 0-1.108.554.554 0 0 1 0 1.108ZM19.1 13.453h-5.903V10.21H19.1v3.242Zm2.027-9.029a.554.554 0 0 1 0-1.107.554.554 0 0 1 0 1.107Z", fill: props.color || "currentColor" })));
|
|
9086
9086
|
};
|
|
9087
9087
|
|
|
9088
|
+
var SvgProjectSetting = function (_a) {
|
|
9089
|
+
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9090
|
+
return (React__namespace.createElement("svg", __assign({ width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", strokeWidth: props.strokeWidth || 1.5, "aria-labelledby": titleId }, props),
|
|
9091
|
+
title ? React__namespace.createElement("title", { id: titleId }, title) : null,
|
|
9092
|
+
React__namespace.createElement("g", { clipPath: "url(#project-setting_svg__a)", fill: props.color || "currentColor" },
|
|
9093
|
+
React__namespace.createElement("path", { d: "M1.266.042C.9.155.53.506.43.834.394.961.375 1.528.375 2.616v1.598l.122.094c.201.16.403.122.51-.094.057-.108.071-.408.071-1.655V1.031l.136-.15.136-.155H19.275l.136.155.136.15v8.916l.14.14c.118.113.17.136.272.108a.533.533 0 0 0 .207-.103c.08-.07.084-.347.084-4.575 0-3.314-.014-4.547-.056-4.683-.07-.234-.366-.572-.619-.708l-.192-.103-9-.009C5.433.009 1.33.024 1.266.042Z" }),
|
|
9094
|
+
React__namespace.createElement("path", { d: "M2.03 2.156a.351.351 0 0 0-.15.136c-.033.061-.052.586-.052 1.481v1.388l.117.112c.061.066.17.118.235.118a.386.386 0 0 0 .234-.118c.108-.103.117-.15.117-.562v-.445h.263c.398 0 .623-.085.862-.329.347-.346.422-.778.206-1.209-.224-.45-.585-.619-1.303-.614-.234 0-.473.019-.53.042Zm1.106.778c.183.155.192.347.028.511-.094.099-.16.118-.375.118h-.258v-.75h.23c.183 0 .262.028.375.121ZM4.477 2.227l-.118.112V5.2l.122.093c.155.122.305.127.446.01.093-.075.112-.141.136-.474l.023-.389.323.37c.446.511.53.582.68.582.169 0 .333-.178.333-.361 0-.108-.075-.225-.328-.511-.178-.202-.328-.385-.328-.403 0-.02.037-.043.084-.057.131-.042.38-.304.483-.506.108-.206.117-.581.023-.806-.098-.24-.389-.488-.651-.567-.136-.042-.422-.07-.675-.07-.403 0-.45.009-.553.117Zm1.12.684c.272.216.07.558-.328.558h-.207v-.657h.207c.136 0 .244.033.328.099ZM7.876 2.184A1.619 1.619 0 0 0 6.84 4.472c.67 1.364 2.657 1.139 3.032-.342.211-.844-.323-1.725-1.185-1.95-.329-.085-.479-.085-.811.004Zm.68.68c.257.07.562.385.632.647.164.614-.356 1.228-.989 1.167a.98.98 0 0 1-.736-.506c-.21-.394-.07-.947.3-1.172.295-.183.492-.216.792-.136ZM11.08 2.166c-.187.089-.206.225-.206 1.378 0 1.232.005 1.218-.323 1.045-.169-.084-.216-.094-.328-.042a.402.402 0 0 0-.197.197c-.075.178 0 .337.234.492.418.281.961.15 1.21-.29.103-.184.108-.23.108-1.398V2.34l-.118-.113c-.122-.126-.22-.14-.38-.06ZM15.3 2.175c-.484.122-.873.445-1.107.914-.15.305-.155 1.003-.005 1.327.14.309.478.651.797.81.235.118.328.136.67.141.343 0 .436-.019.666-.131.488-.24.656-.61.384-.825-.173-.136-.253-.127-.501.07-.638.497-1.505-.01-1.43-.83.066-.642.746-.998 1.36-.707.271.126.323.126.478.004.145-.112.169-.365.042-.492-.258-.258-.914-.393-1.355-.281ZM17.19 2.203a.29.29 0 0 0-.128.263c0 .243.132.346.446.346h.258v2.386l.122.094c.154.122.304.127.445.01.112-.09.112-.094.126-1.29l.014-1.2h.254c.215 0 .262-.018.346-.121.122-.155.127-.305.01-.446-.09-.108-.113-.112-.928-.126-.797-.014-.844-.01-.966.084ZM12.268 2.212a.55.55 0 0 0-.127.193c-.06.178-.065 2.56 0 2.733.09.23.16.248.872.253.628 0 .661-.005.76-.108.145-.155.135-.375-.02-.497-.107-.084-.191-.098-.538-.098h-.418v-.563h.352c.403 0 .558-.056.633-.23.056-.14.005-.342-.103-.412-.033-.019-.24-.047-.46-.061l-.398-.024-.014-.271-.014-.268h.417c.351 0 .436-.014.544-.098a.35.35 0 0 0 .028-.511c-.085-.084-.155-.094-.764-.094-.464 0-.694.019-.75.056ZM.478 5.452l-.103.112.01 8.456.013 8.457.15.318c.179.37.535.764.849.938.501.272.408.267 4.945.267h4.163l.112-.117c.15-.145.15-.324 0-.469l-.112-.117H3.938l.14-.22c.277-.432.338-.68.366-1.44.023-.68.023-.703.154-.843l.127-.146H22.65l.14.16.141.154-.018.713c-.015.675-.02.717-.141.928-.174.29-.455.52-.745.614-.216.07-.718.08-5.185.08h-4.94l-.113.117c-.15.145-.15.323 0 .469l.113.117h4.959c5.414 0 5.236.01 5.742-.267.314-.174.67-.567.849-.938.145-.31.15-.337.164-1.064.018-.876-.02-1.064-.286-1.369-.357-.407-.394-.417-1.824-.43l-1.256-.015v-.539l.295.019c.53.033.77-.174 1.252-1.083.16-.295.192-.408.192-.614 0-.417-.197-.712-.652-.966l-.178-.103v-1.153l.178-.103c.46-.258.647-.54.647-.966 0-.22-.032-.323-.192-.623-.478-.895-.717-1.106-1.247-1.073l-.295.018v-.694c0-.632-.01-.703-.094-.787-.126-.127-.38-.122-.497.005-.08.089-.089.187-.103.867-.01.422-.023.769-.028.769-.01 0-.14-.075-.29-.165a2.169 2.169 0 0 0-.38-.192c-.099-.028-.108-.056-.108-.318 0-.385-.07-.605-.248-.811-.249-.286-.436-.342-1.14-.342-.346 0-.684.023-.773.056-.436.15-.651.482-.651 1.012v.338l-.291.145c-.164.08-.385.211-.497.286l-.202.14-.323-.168c-.24-.127-.375-.169-.544-.169-.272 0-.558.122-.726.31-.178.192-.647 1.04-.68 1.228-.08.417.131.82.558 1.068l.29.174v1.144l-.29.173c-.427.248-.638.651-.558 1.069.033.187.502 1.036.68 1.228.168.187.454.31.726.31.169 0 .305-.043.544-.17l.323-.168.202.14c.112.075.333.207.497.286.258.131.29.164.29.286v.14l-5.657.01-5.663.014-.192.103c-.21.113-.51.422-.59.615-.029.07-.066.454-.085.857-.023.67-.038.75-.16.994-.482.994-1.8 1.04-2.362.09l-.126-.221-.024-8.428-.023-8.433-.113-.09c-.15-.121-.342-.112-.464.02Zm17.494 6.417c.056.08.075.225.075.553 0 .408.01.46.108.548a.67.67 0 0 0 .22.131c.22.066.727.352.956.54.122.103.267.187.319.187.052 0 .277-.098.502-.22.539-.286.567-.277.886.267.351.595.337.656-.17.96-.215.127-.412.273-.44.32-.028.056-.028.215.01.487.037.305.037.511 0 .82-.066.511-.061.526.445.826.492.295.501.356.155.946-.32.544-.347.553-.886.267-.225-.121-.45-.22-.502-.22-.052 0-.197.085-.319.192a4.262 4.262 0 0 1-.675.404c-.618.3-.61.29-.61.703v.342H16.642v-.296c0-.417-.057-.492-.493-.675a4.13 4.13 0 0 1-.721-.412c-.193-.14-.39-.258-.441-.258-.052 0-.258.099-.46.216-.52.305-.562.29-.895-.263-.15-.243-.272-.487-.272-.543 0-.122.132-.24.525-.464.361-.207.422-.32.361-.638a4.085 4.085 0 0 1-.037-.534c0-.183.019-.422.037-.535.061-.319 0-.431-.36-.637-.394-.225-.526-.342-.526-.464 0-.056.122-.3.272-.544.333-.553.366-.563.89-.262.202.117.413.215.465.215.051 0 .248-.117.44-.258.193-.14.516-.328.722-.412.254-.108.394-.197.432-.272.033-.066.06-.29.06-.53 0-.586.005-.59.708-.59.516 0 .558.004.624.103Zm1.575 7.701v.352h-.797v-.155c0-.131.023-.16.202-.234.112-.042.276-.132.365-.197a.953.953 0 0 1 .197-.117c.019 0 .033.16.033.351Z" }),
|
|
9095
|
+
React__namespace.createElement("path", { d: "M16.683 14.358c-.478.201-.811.515-1.022.965-.103.23-.122.324-.122.732 0 .436.01.492.15.778.183.375.52.703.895.876.235.113.324.127.76.127.45 0 .515-.014.773-.136a1.867 1.867 0 0 0 1.013-1.378c.13-.745-.305-1.566-1.013-1.908-.234-.112-.351-.136-.726-.15-.385-.014-.483 0-.708.094Zm1.106.684c.413.188.647.558.647 1.013 0 .633-.469 1.097-1.106 1.101-.46 0-.807-.215-.999-.633a1.129 1.129 0 0 1 .567-1.504c.207-.09.67-.08.891.023ZM2.742 6.21a.386.386 0 0 0-.117.235c0 .066.052.174.117.235l.113.117H17.77l.113-.117c.15-.146.15-.324 0-.47l-.113-.116H2.855l-.113.117ZM2.892 7.753c-.422.155-.764.506-.876.919-.028.094-.047.928-.047 1.955 0 1.678.004 1.809.093 2.043.113.296.39.59.694.746l.22.107h6.516l.267-.13c.15-.076.343-.216.432-.324.304-.352.309-.403.309-2.494 0-1.875 0-1.88-.113-2.114-.14-.305-.487-.614-.792-.703-.333-.099-6.426-.103-6.703-.005Zm6.553.703c.09.038.207.14.258.225.09.15.094.235.094 1.932 0 1.706-.005 1.78-.094 1.93-.192.31-.14.305-3.539.291-3.394-.014-3.197.005-3.398-.332-.09-.141-.094-.249-.094-1.885 0-1.94.005-1.964.333-2.142.15-.08.342-.084 3.22-.084 2.555 0 3.084.009 3.22.065Z" }),
|
|
9096
|
+
React__namespace.createElement("path", { d: "M6.623 9.047a.351.351 0 0 0-.15.136c-.032.06-.051.604-.051 1.542 0 1.36.005 1.458.089 1.56.089.113.094.113 1.275.127 1.266.014 1.397-.004 1.49-.206.07-.16.07-2.826 0-2.986a.368.368 0 0 0-.168-.169c-.136-.06-2.33-.065-2.485-.004Zm2.002 1.664v1.008h-1.5V9.703h1.5v1.008ZM3.281 10.406c-.089.09-.094.155-.094.957v.867l.122.093c.118.094.183.099 1.308.099s1.19-.005 1.308-.099l.122-.093v-.867c0-.802-.005-.868-.094-.957-.089-.089-.155-.094-1.336-.094s-1.247.005-1.336.094Zm2.063.961v.352H3.89v-.703H5.344v.351ZM11.587 9.08c-.032.014-.089.08-.126.154-.09.17-.019.39.145.464.085.038 1.064.052 3.469.052h3.351l.113-.117a.386.386 0 0 0 .117-.235.386.386 0 0 0-.117-.234l-.113-.117-3.389.005c-1.865 0-3.417.014-3.45.028ZM11.526 10.49c-.155.127-.14.366.024.512l.126.107H15.895l.112-.117c.15-.145.155-.347.01-.483-.108-.103-.117-.103-2.245-.103-2.007 0-2.143.005-2.246.085ZM2.063 14.54c-.183.198-.075.512.197.577.061.014 2.25.019 4.87.014 4.613-.014 4.772-.018 4.866-.103.127-.117.131-.37.005-.497-.094-.094-.155-.094-4.969-.094h-4.87l-.099.104ZM2.062 15.89c-.202.202-.066.53.244.587.084.014 2.419.023 5.184.014l5.034-.014.09-.113c.117-.14.112-.356-.005-.473-.094-.094-.155-.094-5.274-.094-5.118 0-5.18 0-5.273.094ZM2.175 17.175a.332.332 0 0 0-.112.544c.094.093.155.093 4.987.093h4.899l.07-.103c.108-.15.094-.38-.023-.487-.094-.085-.253-.09-4.89-.099-3.946-.009-4.809 0-4.93.052ZM2.17 18.563c-.215.089-.267.389-.093.553.108.103.108.103 2.503.103 2.212 0 2.4-.005 2.489-.085a.435.435 0 0 0 .131-.206c.024-.103 0-.155-.112-.272l-.141-.14-2.339.004c-1.284 0-2.381.02-2.438.043Z" })),
|
|
9097
|
+
React__namespace.createElement("defs", null,
|
|
9098
|
+
React__namespace.createElement("clipPath", { id: "project-setting_svg__a" },
|
|
9099
|
+
React__namespace.createElement("path", { fill: "#fff", d: "M0 0h24v24H0z" })))));
|
|
9100
|
+
};
|
|
9101
|
+
|
|
9088
9102
|
var SvgQuoteRight = function (_a) {
|
|
9089
9103
|
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9090
9104
|
return (React__namespace.createElement("svg", __assign({ width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", strokeWidth: props.strokeWidth || 1.5, "aria-labelledby": titleId }, props),
|
|
@@ -9253,6 +9267,13 @@ var SvgSettings = function (_a) {
|
|
|
9253
9267
|
React__namespace.createElement("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })));
|
|
9254
9268
|
};
|
|
9255
9269
|
|
|
9270
|
+
var SvgShapeGroup = function (_a) {
|
|
9271
|
+
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9272
|
+
return (React__namespace.createElement("svg", __assign({ width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", strokeWidth: props.strokeWidth || 1.5, "aria-labelledby": titleId }, props),
|
|
9273
|
+
title ? React__namespace.createElement("title", { id: titleId }, title) : null,
|
|
9274
|
+
React__namespace.createElement("path", { d: "M24 15h-4.91l4.336 7.5H6.973l3.129-5.426a6.965 6.965 0 0 1-1.618.68A6.784 6.784 0 0 1 6.75 18a6.677 6.677 0 0 1-4.77-1.98 6.952 6.952 0 0 1-1.44-2.145A6.681 6.681 0 0 1 0 11.25a6.677 6.677 0 0 1 1.98-4.77 6.952 6.952 0 0 1 2.145-1.44A6.681 6.681 0 0 1 6.75 4.5c.664 0 1.313.094 1.945.281a6.579 6.579 0 0 1 1.805.856V1.5H24V15ZM6.75 16.5c.727 0 1.406-.137 2.04-.41a5.208 5.208 0 0 0 1.663-1.137 5.488 5.488 0 0 0 1.125-1.664A5.17 5.17 0 0 0 12 11.25c0-.719-.137-1.395-.41-2.027a5.448 5.448 0 0 0-1.125-1.676A5.054 5.054 0 0 0 8.8 6.422 5.555 5.555 0 0 0 6.75 6c-.727 0-1.406.137-2.04.41A5.305 5.305 0 0 0 1.923 9.2a5.258 5.258 0 0 0-.422 2.05c0 .727.137 1.406.41 2.04a5.305 5.305 0 0 0 2.79 2.788 5.257 5.257 0 0 0 2.05.422ZM20.824 21a1846.92 1846.92 0 0 1-2.812-4.875 1846.92 1846.92 0 0 0-2.813-4.875 1846.92 1846.92 0 0 0-2.812 4.875c-.93 1.617-1.867 3.242-2.813 4.875h11.25ZM22.5 3H12v4.066A6.7 6.7 0 0 1 13.102 9c.257.703.39 1.438.398 2.203l1.7-2.953 3.023 5.25H22.5V3Z", fill: props.color || "currentColor" })));
|
|
9275
|
+
};
|
|
9276
|
+
|
|
9256
9277
|
var SvgShare2 = function (_a) {
|
|
9257
9278
|
var title = _a.title, titleId = _a.titleId, props = __rest$1(_a, ["title", "titleId"]);
|
|
9258
9279
|
return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: props.fontSize || 24, height: props.fontSize || 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: props.strokeWidth || 1.5, strokeLinecap: "round", strokeLinejoin: "round", className: "share-2_svg__feather share-2_svg__feather-share-2", "aria-labelledby": titleId }, props),
|
|
@@ -10480,6 +10501,7 @@ var Icon = /*#__PURE__*/Object.freeze({
|
|
|
10480
10501
|
Power: SvgPower,
|
|
10481
10502
|
Printer: SvgPrinter,
|
|
10482
10503
|
Process: SvgProcess,
|
|
10504
|
+
ProjectSetting: SvgProjectSetting,
|
|
10483
10505
|
QuoteRight: SvgQuoteRight,
|
|
10484
10506
|
Radio: SvgRadio,
|
|
10485
10507
|
RefreshCcw: SvgRefreshCcw,
|
|
@@ -10499,6 +10521,7 @@ var Icon = /*#__PURE__*/Object.freeze({
|
|
|
10499
10521
|
SendHorFill: SvgSendHorFill,
|
|
10500
10522
|
Server: SvgServer,
|
|
10501
10523
|
Settings: SvgSettings,
|
|
10524
|
+
ShapeGroup: SvgShapeGroup,
|
|
10502
10525
|
Share: SvgShare,
|
|
10503
10526
|
Share2: SvgShare2,
|
|
10504
10527
|
Share3: SvgShare3,
|
|
@@ -19813,17 +19836,20 @@ const isNullOrUndefined$1 = (d) => {
|
|
|
19813
19836
|
const generateUUID = () => {
|
|
19814
19837
|
// Public Domain/MIT
|
|
19815
19838
|
let d = new Date().getTime(); //Timestamp
|
|
19816
|
-
let d2 = (typeof performance !== 'undefined' &&
|
|
19839
|
+
let d2 = (typeof performance !== 'undefined' &&
|
|
19840
|
+
performance.now &&
|
|
19841
|
+
performance.now() * 1000) ||
|
|
19842
|
+
0; //Time in microseconds since page-load or 0 if unsupported
|
|
19817
19843
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
19818
19844
|
let r = Math.random() * 16; //random number between 0 and 16
|
|
19819
19845
|
if (d > 0) {
|
|
19820
19846
|
//Use timestamp until depleted
|
|
19821
|
-
r = (d + r) % 16 | 0;
|
|
19847
|
+
r = ((d + r) % 16) | 0;
|
|
19822
19848
|
d = Math.floor(d / 16);
|
|
19823
19849
|
}
|
|
19824
19850
|
else {
|
|
19825
19851
|
//Use microseconds since page-load if supported
|
|
19826
|
-
r = (d2 + r) % 16 | 0;
|
|
19852
|
+
r = ((d2 + r) % 16) | 0;
|
|
19827
19853
|
d2 = Math.floor(d2 / 16);
|
|
19828
19854
|
}
|
|
19829
19855
|
return (c === 'x' ? r : 0x3).toString(16);
|
|
@@ -19845,12 +19871,16 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2,
|
|
|
19845
19871
|
// eslint-disable-next-line
|
|
19846
19872
|
if (str || str == '0') {
|
|
19847
19873
|
str = str.toString();
|
|
19848
|
-
const value = decimalSeparator !== '.'
|
|
19874
|
+
const value = decimalSeparator !== '.'
|
|
19875
|
+
? str.toString().replaceAll('.', decimalSeparator ?? '')
|
|
19876
|
+
: str;
|
|
19849
19877
|
const arr = value.toString().split(decimalSeparator ?? '', 2);
|
|
19850
19878
|
let flag = value.toString().includes(decimalSeparator ?? '');
|
|
19851
19879
|
if (arr[0].length < 3) {
|
|
19852
19880
|
const intergerArr = haveNegative ? arr[0] : arr[0].replace('-', '');
|
|
19853
|
-
return flag
|
|
19881
|
+
return flag
|
|
19882
|
+
? `${intergerArr}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19883
|
+
: intergerArr;
|
|
19854
19884
|
}
|
|
19855
19885
|
else {
|
|
19856
19886
|
let flagNegative = false;
|
|
@@ -19874,7 +19904,9 @@ const formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 2,
|
|
|
19874
19904
|
if (flagNegative && haveNegative) {
|
|
19875
19905
|
arr[0] = '-'.concat(arr[0]);
|
|
19876
19906
|
}
|
|
19877
|
-
return flag
|
|
19907
|
+
return flag
|
|
19908
|
+
? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ''}`
|
|
19909
|
+
: arr[0];
|
|
19878
19910
|
}
|
|
19879
19911
|
}
|
|
19880
19912
|
else {
|
|
@@ -19897,7 +19929,7 @@ const formatDateTime = (data, format = 'dd/MM/yyyy') => {
|
|
|
19897
19929
|
MM: String(date.getMonth() + 1).padStart(2, '0'),
|
|
19898
19930
|
yyyy: date.getFullYear(),
|
|
19899
19931
|
HH: String(date.getHours()).padStart(2, '0'),
|
|
19900
|
-
mm: String(date.getMinutes()).padStart(2, '0')
|
|
19932
|
+
mm: String(date.getMinutes()).padStart(2, '0'),
|
|
19901
19933
|
};
|
|
19902
19934
|
return format.replace(/dd|DD|MM|yyyy|HH|mm/g, (match) => map[match]);
|
|
19903
19935
|
};
|
|
@@ -19918,7 +19950,7 @@ const FindNodeByPath = (tree, path) => {
|
|
|
19918
19950
|
parent: current,
|
|
19919
19951
|
lastIndex: levels.at(-1),
|
|
19920
19952
|
firstIndex: levels.length === 1 ? levels[0] : -1,
|
|
19921
|
-
node
|
|
19953
|
+
node,
|
|
19922
19954
|
};
|
|
19923
19955
|
};
|
|
19924
19956
|
/**
|
|
@@ -19946,7 +19978,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19946
19978
|
const objHeaderWidthFixLeft = {};
|
|
19947
19979
|
let maxDepth = 0;
|
|
19948
19980
|
// Tính depth tối đa
|
|
19949
|
-
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) =>
|
|
19981
|
+
const calculateDepth = (cols, depth = 1) => Math.max(...cols.map((col) => col.columns?.length ? calculateDepth(col.columns, depth + 1) : depth));
|
|
19950
19982
|
maxDepth = calculateDepth(columns);
|
|
19951
19983
|
let leftTotal = 0;
|
|
19952
19984
|
let rightTotal = 0;
|
|
@@ -19965,45 +19997,47 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
19965
19997
|
};
|
|
19966
19998
|
const applySetting = (cols) => {
|
|
19967
19999
|
return cols.map((cell) => {
|
|
19968
|
-
const
|
|
20000
|
+
const newCell = { ...cell };
|
|
20001
|
+
const setting = settingColumns?.find((s) => s.field === newCell.field);
|
|
19969
20002
|
if (setting) {
|
|
19970
|
-
|
|
19971
|
-
if (!
|
|
19972
|
-
|
|
20003
|
+
newCell.sortOrder = setting.sortOrder;
|
|
20004
|
+
if (!newCell.visibleLocked) {
|
|
20005
|
+
newCell.visible = setting.visible ?? true;
|
|
19973
20006
|
}
|
|
19974
|
-
|
|
20007
|
+
newCell.fixedType = setting.fixedType;
|
|
19975
20008
|
if (setting.width !== undefined && setting.width !== null) {
|
|
19976
|
-
|
|
20009
|
+
newCell.width = setting.width;
|
|
19977
20010
|
}
|
|
19978
20011
|
if (setting.fraction !== undefined && setting.fraction !== null) {
|
|
19979
|
-
if (
|
|
19980
|
-
|
|
20012
|
+
if (newCell.numericSettings) {
|
|
20013
|
+
newCell.numericSettings.fraction = setting.fraction;
|
|
19981
20014
|
}
|
|
19982
20015
|
else {
|
|
19983
|
-
|
|
20016
|
+
newCell.numericSettings = { fraction: setting.fraction };
|
|
19984
20017
|
}
|
|
19985
20018
|
}
|
|
19986
|
-
|
|
20019
|
+
newCell.headerDisplay =
|
|
20020
|
+
setting.headerText || (newCell.headerDisplay ?? newCell.headerText);
|
|
19987
20021
|
}
|
|
19988
20022
|
else {
|
|
19989
|
-
if (
|
|
19990
|
-
|
|
19991
|
-
|
|
19992
|
-
if (
|
|
19993
|
-
|
|
20023
|
+
if (newCell.columns?.length) {
|
|
20024
|
+
newCell.columns = applySetting(newCell.columns);
|
|
20025
|
+
newCell.sortOrder = newCell.columns[0].sortOrder;
|
|
20026
|
+
if (newCell.columns.some((x) => x.visible !== false)) {
|
|
20027
|
+
newCell.visible = true;
|
|
19994
20028
|
}
|
|
19995
20029
|
else {
|
|
19996
|
-
|
|
20030
|
+
newCell.visible = false;
|
|
19997
20031
|
}
|
|
19998
20032
|
}
|
|
19999
20033
|
else {
|
|
20000
|
-
if (!
|
|
20001
|
-
|
|
20034
|
+
if (!newCell.visibleLocked) {
|
|
20035
|
+
newCell.visible = false;
|
|
20002
20036
|
}
|
|
20003
20037
|
}
|
|
20004
20038
|
}
|
|
20005
|
-
|
|
20006
|
-
return
|
|
20039
|
+
newCell.isGroup = groupColumns?.includes(newCell.field);
|
|
20040
|
+
return newCell;
|
|
20007
20041
|
});
|
|
20008
20042
|
};
|
|
20009
20043
|
const traverse = (cols, level = 0) => {
|
|
@@ -20019,11 +20053,13 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20019
20053
|
...col,
|
|
20020
20054
|
columns: col.columns ?? [],
|
|
20021
20055
|
colspan,
|
|
20022
|
-
rowspan: hasChildren ? 1 : maxDepth - level
|
|
20056
|
+
rowspan: hasChildren ? 1 : maxDepth - level,
|
|
20023
20057
|
};
|
|
20024
20058
|
levels[level].push(cell);
|
|
20025
20059
|
const headerKey = `${level}-${indexCol}`;
|
|
20026
|
-
if (cell.fixedType === 'left' &&
|
|
20060
|
+
if (cell.fixedType === 'left' &&
|
|
20061
|
+
cell.visible !== false &&
|
|
20062
|
+
cell.isGroup !== true) {
|
|
20027
20063
|
objHeaderWidthFixLeft[headerKey] = leftTotal;
|
|
20028
20064
|
}
|
|
20029
20065
|
if (!hasChildren) {
|
|
@@ -20031,16 +20067,22 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20031
20067
|
const width = cell.width ?? 40;
|
|
20032
20068
|
cell.index = index;
|
|
20033
20069
|
flat.push(cell);
|
|
20034
|
-
if (cell.fixedType === 'left' &&
|
|
20070
|
+
if (cell.fixedType === 'left' &&
|
|
20071
|
+
cell.visible !== false &&
|
|
20072
|
+
cell.isGroup !== true) {
|
|
20035
20073
|
objWidthFixLeft[index] = leftTotal;
|
|
20036
20074
|
leftTotal += width;
|
|
20037
20075
|
}
|
|
20038
|
-
if (cell.fixedType === 'right' &&
|
|
20076
|
+
if (cell.fixedType === 'right' &&
|
|
20077
|
+
cell.visible !== false &&
|
|
20078
|
+
cell.isGroup !== true) {
|
|
20039
20079
|
rightTotal -= width;
|
|
20040
20080
|
objWidthFixRight[index] = rightTotal;
|
|
20041
20081
|
}
|
|
20042
20082
|
}
|
|
20043
|
-
if (cell.fixedType === 'right' &&
|
|
20083
|
+
if (cell.fixedType === 'right' &&
|
|
20084
|
+
cell.visible !== false &&
|
|
20085
|
+
cell.isGroup !== true) {
|
|
20044
20086
|
objHeaderWidthFixRight[headerKey] = rightTotal;
|
|
20045
20087
|
}
|
|
20046
20088
|
return colspanSum + colspan;
|
|
@@ -20053,13 +20095,20 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20053
20095
|
traverse(columns);
|
|
20054
20096
|
// Danh sách các cột được hiển thị
|
|
20055
20097
|
// const flatVisble = flat.filter((e) => e.visible !== false)
|
|
20056
|
-
const flatVisbleContent = flat.filter((x) => x.visible !== false &&
|
|
20098
|
+
const flatVisbleContent = flat.filter((x) => x.visible !== false &&
|
|
20099
|
+
x.field !== 'command' &&
|
|
20100
|
+
x.field !== '#' &&
|
|
20101
|
+
x.field !== 'checkbox');
|
|
20057
20102
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột cố định
|
|
20058
20103
|
const lastObjWidthFixLeft = Math.max(...Object.keys(objWidthFixLeft).map(Number), 0);
|
|
20059
20104
|
const fisrtObjWidthFixRight = Math.min(...Object.keys(objWidthFixRight).map(Number), flat.length);
|
|
20060
20105
|
// Tính toán vị trí đầu tiên và cuối cùng của các cột có thể sửa
|
|
20061
20106
|
const indexFirstEdit = flat.findIndex((item) => item.editEnable && item.visible !== false && !item.disabledCondition);
|
|
20062
|
-
const indexLastEdit = flat
|
|
20107
|
+
const indexLastEdit = flat
|
|
20108
|
+
.map((item, idx) => item.editEnable && item.visible !== false && !item.disabledCondition
|
|
20109
|
+
? idx
|
|
20110
|
+
: -1)
|
|
20111
|
+
.reduce((acc, val) => (val > acc ? val : acc), -1);
|
|
20063
20112
|
return {
|
|
20064
20113
|
levels,
|
|
20065
20114
|
flat,
|
|
@@ -20072,7 +20121,7 @@ const calculateTableStructure = (columns, settingColumns, groupColumns) => {
|
|
|
20072
20121
|
objHeaderWidthFixRight,
|
|
20073
20122
|
objHeaderWidthFixLeft,
|
|
20074
20123
|
indexFirstEdit,
|
|
20075
|
-
indexLastEdit
|
|
20124
|
+
indexLastEdit,
|
|
20076
20125
|
};
|
|
20077
20126
|
};
|
|
20078
20127
|
/**
|
|
@@ -20082,7 +20131,10 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20082
20131
|
const isFilterMatch = filters.every((filter) => {
|
|
20083
20132
|
const { key, value, ope } = filter;
|
|
20084
20133
|
const rowValue = row[key];
|
|
20085
|
-
if (rowValue === undefined ||
|
|
20134
|
+
if (rowValue === undefined ||
|
|
20135
|
+
rowValue === null ||
|
|
20136
|
+
value === undefined ||
|
|
20137
|
+
value === null) {
|
|
20086
20138
|
return false;
|
|
20087
20139
|
}
|
|
20088
20140
|
const valStr = String(rowValue).toLowerCase();
|
|
@@ -20115,7 +20167,10 @@ const CheckRowMatch = (row, filters, keyword, searchKeys) => {
|
|
|
20115
20167
|
const isSearchMatch = !keyword ||
|
|
20116
20168
|
searchKeys.some((key) => {
|
|
20117
20169
|
const val = row[key];
|
|
20118
|
-
return val
|
|
20170
|
+
return val
|
|
20171
|
+
?.toString()
|
|
20172
|
+
.toLowerCase()
|
|
20173
|
+
.includes(keyword.trim().toLowerCase());
|
|
20119
20174
|
});
|
|
20120
20175
|
return isFilterMatch && isSearchMatch;
|
|
20121
20176
|
};
|
|
@@ -20275,7 +20330,7 @@ const TableElement$1 = React__default["default"].memo((props) => {
|
|
|
20275
20330
|
|
|
20276
20331
|
const defaultMaxHeight$1 = 250;
|
|
20277
20332
|
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 } = props;
|
|
20333
|
+
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
20334
|
const selectTableRef = React$5.useRef(null);
|
|
20280
20335
|
const selectMenuTableRef = React$5.useRef(null);
|
|
20281
20336
|
const inputRef = React$5.useRef(null);
|
|
@@ -20292,8 +20347,8 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20292
20347
|
{
|
|
20293
20348
|
headerText: 'Name',
|
|
20294
20349
|
field: fieldLabel ?? 'label',
|
|
20295
|
-
width: menuWidth
|
|
20296
|
-
}
|
|
20350
|
+
width: menuWidth,
|
|
20351
|
+
},
|
|
20297
20352
|
];
|
|
20298
20353
|
const closeMenu = () => {
|
|
20299
20354
|
setDropdownOpen(false);
|
|
@@ -20303,7 +20358,12 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20303
20358
|
};
|
|
20304
20359
|
const handChange = (val) => {
|
|
20305
20360
|
if (val && val.isCreated) {
|
|
20306
|
-
const newVal = {
|
|
20361
|
+
const newVal = {
|
|
20362
|
+
...val,
|
|
20363
|
+
[fieldLabel ?? 'label']: val.valueCreate,
|
|
20364
|
+
isCreated: undefined,
|
|
20365
|
+
isCreatedItem: true,
|
|
20366
|
+
};
|
|
20307
20367
|
options.unshift(newVal);
|
|
20308
20368
|
onChange(newVal);
|
|
20309
20369
|
return;
|
|
@@ -20312,7 +20372,9 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20312
20372
|
};
|
|
20313
20373
|
React$5.useEffect(() => {
|
|
20314
20374
|
if (dropdownOpen && value && !isMulti && selectMenuTableRef) {
|
|
20315
|
-
const index = currentOptions?.findIndex((row) =>
|
|
20375
|
+
const index = currentOptions?.findIndex((row) => compareFunction
|
|
20376
|
+
? compareFunction(row)
|
|
20377
|
+
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']);
|
|
20316
20378
|
if (index >= 0) {
|
|
20317
20379
|
selectMenuTableRef.current.scrollTo({ top: (index - 1) * 30 });
|
|
20318
20380
|
}
|
|
@@ -20359,14 +20421,28 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20359
20421
|
}
|
|
20360
20422
|
}
|
|
20361
20423
|
};
|
|
20362
|
-
const listKeyUse = [
|
|
20424
|
+
const listKeyUse = [
|
|
20425
|
+
'Escape',
|
|
20426
|
+
'Space',
|
|
20427
|
+
'Enter',
|
|
20428
|
+
'Tab',
|
|
20429
|
+
'NumpadEnter',
|
|
20430
|
+
'ArrowDown',
|
|
20431
|
+
'ArrowUp',
|
|
20432
|
+
'F9',
|
|
20433
|
+
];
|
|
20363
20434
|
const handleOnKeyDown = (e) => {
|
|
20364
20435
|
let key = '';
|
|
20365
20436
|
if (onKeyDown &&
|
|
20366
20437
|
(!dropdownOpen ||
|
|
20367
20438
|
!listKeyUse.includes(e.code) ||
|
|
20368
|
-
((e.code === 'Enter' ||
|
|
20369
|
-
|
|
20439
|
+
((e.code === 'Enter' ||
|
|
20440
|
+
e.code === 'Tab' ||
|
|
20441
|
+
e.code === 'NumpadEnter' ||
|
|
20442
|
+
e.code === 'Space') &&
|
|
20443
|
+
!(currentOptions[indexFocus] || haveCreateNew)) ||
|
|
20444
|
+
((e.code === 'ArrowDown' || e.code === 'ArrowUp') &&
|
|
20445
|
+
currentOptions.length === 0) ||
|
|
20370
20446
|
(e.code === 'Escape' && !(isClearable && value && !isDisabled)))) {
|
|
20371
20447
|
key = onKeyDown(e);
|
|
20372
20448
|
}
|
|
@@ -20379,7 +20455,12 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20379
20455
|
else if (e.code === 'Space') {
|
|
20380
20456
|
let newItem;
|
|
20381
20457
|
if (haveCreateNew && indexFocus === 0) {
|
|
20382
|
-
newItem = {
|
|
20458
|
+
newItem = {
|
|
20459
|
+
valueCreate: searchTerm,
|
|
20460
|
+
[fieldValue ?? 'value']: searchTerm,
|
|
20461
|
+
[fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`,
|
|
20462
|
+
isCreated: true,
|
|
20463
|
+
};
|
|
20383
20464
|
}
|
|
20384
20465
|
else {
|
|
20385
20466
|
newItem = currentOptions[indexFocus];
|
|
@@ -20400,10 +20481,17 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20400
20481
|
flag = true;
|
|
20401
20482
|
}
|
|
20402
20483
|
}
|
|
20403
|
-
else if (e.code === 'Enter' ||
|
|
20484
|
+
else if (e.code === 'Enter' ||
|
|
20485
|
+
e.code === 'Tab' ||
|
|
20486
|
+
e.code === 'NumpadEnter') {
|
|
20404
20487
|
let newItem;
|
|
20405
20488
|
if (haveCreateNew && indexFocus === 0) {
|
|
20406
|
-
newItem = {
|
|
20489
|
+
newItem = {
|
|
20490
|
+
valueCreate: searchTerm,
|
|
20491
|
+
[fieldValue ?? 'value']: searchTerm,
|
|
20492
|
+
[fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`,
|
|
20493
|
+
isCreated: true,
|
|
20494
|
+
};
|
|
20407
20495
|
}
|
|
20408
20496
|
else {
|
|
20409
20497
|
newItem = currentOptions[indexFocus];
|
|
@@ -20421,7 +20509,10 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20421
20509
|
newIndex = indexFocus + 1;
|
|
20422
20510
|
}
|
|
20423
20511
|
else if (value) {
|
|
20424
|
-
newIndex =
|
|
20512
|
+
newIndex =
|
|
20513
|
+
currentOptions?.findIndex((row) => compareFunction
|
|
20514
|
+
? compareFunction(row)
|
|
20515
|
+
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']) + 1;
|
|
20425
20516
|
}
|
|
20426
20517
|
if (newIndex < currentOptions.length) {
|
|
20427
20518
|
setIndexFocus(newIndex);
|
|
@@ -20445,7 +20536,10 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20445
20536
|
newIndex = indexFocus - 1;
|
|
20446
20537
|
}
|
|
20447
20538
|
else if (value) {
|
|
20448
|
-
newIndex =
|
|
20539
|
+
newIndex =
|
|
20540
|
+
currentOptions?.findIndex((row) => compareFunction
|
|
20541
|
+
? compareFunction(row)
|
|
20542
|
+
: row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']) - 1;
|
|
20449
20543
|
}
|
|
20450
20544
|
if (newIndex >= 0) {
|
|
20451
20545
|
setIndexFocus(newIndex);
|
|
@@ -20478,7 +20572,11 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20478
20572
|
scrollToElement(selectMenuTableRef.current, selectMenuTableRef.current.scrollHeight);
|
|
20479
20573
|
}
|
|
20480
20574
|
else if (flag === 0 && rect.bottom + 30 > parentRect.bottom) {
|
|
20481
|
-
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop -
|
|
20575
|
+
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop -
|
|
20576
|
+
selectMenuTableRef.current.offsetTop -
|
|
20577
|
+
parentRect.height +
|
|
20578
|
+
rect.height +
|
|
20579
|
+
50);
|
|
20482
20580
|
}
|
|
20483
20581
|
else if (flag === 2 && rect.top < parentRect.top + 50) {
|
|
20484
20582
|
scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - 65);
|
|
@@ -20492,7 +20590,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20492
20590
|
timeOutElement = setTimeout(() => {
|
|
20493
20591
|
elemment.scrollTo({
|
|
20494
20592
|
top,
|
|
20495
|
-
behavior: 'smooth'
|
|
20593
|
+
behavior: 'smooth',
|
|
20496
20594
|
});
|
|
20497
20595
|
}, 100);
|
|
20498
20596
|
};
|
|
@@ -20502,7 +20600,12 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20502
20600
|
}
|
|
20503
20601
|
for (let index = 0; index < columnsSearch.length; index++) {
|
|
20504
20602
|
const key = columnsSearch[index].field.trim();
|
|
20505
|
-
if (data[key] &&
|
|
20603
|
+
if (data[key] &&
|
|
20604
|
+
data[key]
|
|
20605
|
+
.toString()
|
|
20606
|
+
.trim()
|
|
20607
|
+
.toLowerCase()
|
|
20608
|
+
.includes(keyword.trim().toLowerCase())) {
|
|
20506
20609
|
return true;
|
|
20507
20610
|
}
|
|
20508
20611
|
}
|
|
@@ -20518,7 +20621,8 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20518
20621
|
if (!searchTerm) {
|
|
20519
20622
|
setOptionsLoad(undefined);
|
|
20520
20623
|
}
|
|
20521
|
-
else if (allowCreate &&
|
|
20624
|
+
else if (allowCreate &&
|
|
20625
|
+
!currentOptions?.find((x) => x[fieldLabel ?? 'label'] === searchTerm)) {
|
|
20522
20626
|
setHaveCreateNew(true);
|
|
20523
20627
|
return;
|
|
20524
20628
|
}
|
|
@@ -20530,9 +20634,24 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20530
20634
|
};
|
|
20531
20635
|
React__default["default"].memo((props) => {
|
|
20532
20636
|
const { indexRow, row, isSelected, level = 0 } = props;
|
|
20533
|
-
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`, {
|
|
20637
|
+
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`, {
|
|
20638
|
+
'r-select-move': indexFocus === indexRow,
|
|
20639
|
+
'r-select-active': !isMulti &&
|
|
20640
|
+
value &&
|
|
20641
|
+
(compareFunction
|
|
20642
|
+
? compareFunction(row)
|
|
20643
|
+
: value[fieldValue ?? 'value'] ===
|
|
20644
|
+
row[fieldValue ?? 'value']),
|
|
20645
|
+
}), style: {
|
|
20646
|
+
width: 40,
|
|
20647
|
+
textAlign: 'center',
|
|
20648
|
+
padding: 0,
|
|
20649
|
+
paddingBottom: 6,
|
|
20650
|
+
}, onClick: (e) => {
|
|
20534
20651
|
if (isMulti) {
|
|
20535
|
-
const index = value?.findIndex((x) =>
|
|
20652
|
+
const index = value?.findIndex((x) => compareFunction
|
|
20653
|
+
? compareFunction(row)
|
|
20654
|
+
: x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']);
|
|
20536
20655
|
if (index > -1) {
|
|
20537
20656
|
value?.splice(index, 1);
|
|
20538
20657
|
handChange([...value]);
|
|
@@ -20550,25 +20669,42 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20550
20669
|
}
|
|
20551
20670
|
}, children: jsxRuntime.jsx(Input$1, { checked: isSelected, type: "checkbox", className: "cursor-pointer", onChange: () => { }, style: { textAlign: 'center', marginTop: 6 } }) })), (columns ? columns : defaultColumns).map((col, indexCol) => {
|
|
20552
20671
|
let valueDisplay = row[col.field];
|
|
20553
|
-
if (col.type === 'numeric' ||
|
|
20554
|
-
|
|
20672
|
+
if (col.type === 'numeric' ||
|
|
20673
|
+
(col.typeCondition && col.typeCondition(row) === 'numeric')) {
|
|
20674
|
+
valueDisplay =
|
|
20675
|
+
formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? '.', formatSetting?.thousandSeparator ?? ',', col.fraction ?? 0, true, false) ?? 0;
|
|
20555
20676
|
}
|
|
20556
20677
|
else if (col.type === 'date') {
|
|
20557
|
-
valueDisplay = valueDisplay
|
|
20678
|
+
valueDisplay = valueDisplay
|
|
20679
|
+
? formatDateTime(valueDisplay, formatSetting?.dateFormat)
|
|
20680
|
+
: '';
|
|
20558
20681
|
}
|
|
20559
20682
|
else if (col.type === 'datetime') {
|
|
20560
|
-
valueDisplay = valueDisplay
|
|
20683
|
+
valueDisplay = valueDisplay
|
|
20684
|
+
? formatDateTime(valueDisplay, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
20685
|
+
: '';
|
|
20561
20686
|
}
|
|
20562
20687
|
return (jsxRuntime.jsxs(React$5.Fragment, { children: [col.visible !== false && (jsxRuntime.jsx("td", { id: `select-${id}-${indexRow}-${indexCol}`,
|
|
20563
20688
|
// ref={refRow}
|
|
20564
|
-
className: classNames$1(`r-select-rowcell`, {
|
|
20689
|
+
className: classNames$1(`r-select-rowcell`, {
|
|
20690
|
+
'r-select-move': indexFocus === indexRow,
|
|
20691
|
+
'r-select-active': !isMulti &&
|
|
20692
|
+
value &&
|
|
20693
|
+
(compareFunction
|
|
20694
|
+
? compareFunction(row)
|
|
20695
|
+
: value[fieldValue ?? 'value'] ===
|
|
20696
|
+
row[fieldValue ?? 'value']),
|
|
20697
|
+
}), style: {
|
|
20565
20698
|
minWidth: col.minWidth,
|
|
20566
20699
|
width: col.width,
|
|
20567
20700
|
maxWidth: col.maxWidth,
|
|
20568
|
-
textAlign: col.textAlign ? col.textAlign : 'left'
|
|
20701
|
+
textAlign: col.textAlign ? col.textAlign : 'left',
|
|
20569
20702
|
}, onClick: (e) => {
|
|
20570
20703
|
if (isMulti) {
|
|
20571
|
-
const index = value?.findIndex((x) =>
|
|
20704
|
+
const index = value?.findIndex((x) => compareFunction
|
|
20705
|
+
? compareFunction(row)
|
|
20706
|
+
: x[fieldValue ?? 'value'] ===
|
|
20707
|
+
row[fieldValue ?? 'value']);
|
|
20572
20708
|
if (index > -1) {
|
|
20573
20709
|
value?.splice(index, 1);
|
|
20574
20710
|
handChange([...value]);
|
|
@@ -20595,7 +20731,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20595
20731
|
setIndexFocus(indexRow);
|
|
20596
20732
|
}
|
|
20597
20733
|
e.stopPropagation();
|
|
20598
|
-
}, children: col.template ? col.template(row, indexRow) : col.type === 'numeric' && Number(row[col.field]) < 0 ? jsxRuntime.jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [
|
|
20734
|
+
}, 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));
|
|
20599
20735
|
})] }, `row-${indexRow}`));
|
|
20600
20736
|
});
|
|
20601
20737
|
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) => {
|
|
@@ -20604,9 +20740,27 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20604
20740
|
handleOpenClose();
|
|
20605
20741
|
}
|
|
20606
20742
|
e.preventDefault();
|
|
20607
|
-
}, tag: "div", style: {
|
|
20608
|
-
|
|
20609
|
-
|
|
20743
|
+
}, tag: "div", style: {
|
|
20744
|
+
width: width
|
|
20745
|
+
? width
|
|
20746
|
+
: selectTableRef?.current?.clientWidth
|
|
20747
|
+
? selectTableRef?.current?.clientWidth
|
|
20748
|
+
: 'auto',
|
|
20749
|
+
}, 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', {
|
|
20750
|
+
'd-none': searchTerm,
|
|
20751
|
+
}), children: value?.map((ele, index) => {
|
|
20752
|
+
return (jsxRuntime.jsxs("span", { children: [index === 0 ? '' : ', ', formatOptionLabel
|
|
20753
|
+
? formatOptionLabel(ele)
|
|
20754
|
+
: ele[fieldLabel ?? 'label']] }, index));
|
|
20755
|
+
}) })) : (jsxRuntime.jsxs("div", { className: classNames$1('select-value', {
|
|
20756
|
+
'd-none': searchTerm,
|
|
20757
|
+
}), children: [value
|
|
20758
|
+
? formatOptionLabel
|
|
20759
|
+
? formatOptionLabel(value)
|
|
20760
|
+
: value[fieldLabel ?? 'label']
|
|
20761
|
+
: '', ' '] })), !((isMulti ? value?.length > 0 : value) ||
|
|
20762
|
+
isDisabled ||
|
|
20763
|
+
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) => {
|
|
20610
20764
|
if (val.target.value) {
|
|
20611
20765
|
if (loadOptions && val.target.value) {
|
|
20612
20766
|
setIsLoading(true);
|
|
@@ -20628,13 +20782,23 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
20628
20782
|
width: width ? width + 2 : 'min-content',
|
|
20629
20783
|
position: 'fixed',
|
|
20630
20784
|
borderRadius: 4,
|
|
20631
|
-
zIndex: 9999
|
|
20785
|
+
zIndex: 9999,
|
|
20632
20786
|
}, 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) => {
|
|
20633
20787
|
if (!isDisabled) {
|
|
20634
20788
|
inputRef?.current.focus();
|
|
20635
20789
|
e.preventDefault();
|
|
20636
20790
|
}
|
|
20637
|
-
}, children: jsxRuntime.jsxs("div", { className: "r-select-grid", children: [jsxRuntime.jsx("div", { className: classNames$1('r-select-gridtable', {
|
|
20791
|
+
}, children: jsxRuntime.jsxs("div", { className: "r-select-grid", children: [jsxRuntime.jsx("div", { className: classNames$1('r-select-gridtable', {
|
|
20792
|
+
'no-header': noHeader || (columns?.length ?? 0) === 0,
|
|
20793
|
+
}), ref: selectMenuTableRef, style: {
|
|
20794
|
+
width: menuWidth,
|
|
20795
|
+
minWidth: selectTableRef?.current?.clientWidth,
|
|
20796
|
+
maxHeight: maxHeight ?? defaultMaxHeight$1,
|
|
20797
|
+
}, 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', {
|
|
20798
|
+
'd-none': !(showFooter === true ||
|
|
20799
|
+
handleAdd ||
|
|
20800
|
+
isMulti),
|
|
20801
|
+
}), 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] })] }) })) }) })] }) }) }));
|
|
20638
20802
|
});
|
|
20639
20803
|
|
|
20640
20804
|
const PagingComponent = ({ totalItem, gridRef, pageSize, currentPage, onChangePage, pageOptions, onChangePageSize }) => {
|
|
@@ -25560,6 +25724,72 @@ function startOfYear(date, options) {
|
|
|
25560
25724
|
return date_;
|
|
25561
25725
|
}
|
|
25562
25726
|
|
|
25727
|
+
/**
|
|
25728
|
+
* The {@link eachYearOfInterval} function options.
|
|
25729
|
+
*/
|
|
25730
|
+
|
|
25731
|
+
/**
|
|
25732
|
+
* The {@link eachYearOfInterval} function result type. It resolves the proper data type.
|
|
25733
|
+
* It uses the first argument date object type, starting from the date argument,
|
|
25734
|
+
* then the start interval date, and finally the end interval date. If
|
|
25735
|
+
* a context function is passed, it uses the context function return type.
|
|
25736
|
+
*/
|
|
25737
|
+
|
|
25738
|
+
/**
|
|
25739
|
+
* @name eachYearOfInterval
|
|
25740
|
+
* @category Interval Helpers
|
|
25741
|
+
* @summary Return the array of yearly timestamps within the specified time interval.
|
|
25742
|
+
*
|
|
25743
|
+
* @description
|
|
25744
|
+
* Return the array of yearly timestamps within the specified time interval.
|
|
25745
|
+
*
|
|
25746
|
+
* @typeParam IntervalType - Interval type.
|
|
25747
|
+
* @typeParam Options - Options type.
|
|
25748
|
+
*
|
|
25749
|
+
* @param interval - The interval.
|
|
25750
|
+
* @param options - An object with options.
|
|
25751
|
+
*
|
|
25752
|
+
* @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
|
|
25753
|
+
*
|
|
25754
|
+
* @example
|
|
25755
|
+
* // Each year between 6 February 2014 and 10 August 2017:
|
|
25756
|
+
* const result = eachYearOfInterval({
|
|
25757
|
+
* start: new Date(2014, 1, 6),
|
|
25758
|
+
* end: new Date(2017, 7, 10)
|
|
25759
|
+
* })
|
|
25760
|
+
* //=> [
|
|
25761
|
+
* // Wed Jan 01 2014 00:00:00,
|
|
25762
|
+
* // Thu Jan 01 2015 00:00:00,
|
|
25763
|
+
* // Fri Jan 01 2016 00:00:00,
|
|
25764
|
+
* // Sun Jan 01 2017 00:00:00
|
|
25765
|
+
* // ]
|
|
25766
|
+
*/
|
|
25767
|
+
function eachYearOfInterval(interval, options) {
|
|
25768
|
+
const { start, end } = normalizeInterval(options?.in, interval);
|
|
25769
|
+
|
|
25770
|
+
let reversed = +start > +end;
|
|
25771
|
+
const endTime = reversed ? +start : +end;
|
|
25772
|
+
const date = reversed ? end : start;
|
|
25773
|
+
date.setHours(0, 0, 0, 0);
|
|
25774
|
+
date.setMonth(0, 1);
|
|
25775
|
+
|
|
25776
|
+
let step = options?.step ?? 1;
|
|
25777
|
+
if (!step) return [];
|
|
25778
|
+
if (step < 0) {
|
|
25779
|
+
step = -step;
|
|
25780
|
+
reversed = !reversed;
|
|
25781
|
+
}
|
|
25782
|
+
|
|
25783
|
+
const dates = [];
|
|
25784
|
+
|
|
25785
|
+
while (+date <= endTime) {
|
|
25786
|
+
dates.push(constructFrom(start, date));
|
|
25787
|
+
date.setFullYear(date.getFullYear() + step);
|
|
25788
|
+
}
|
|
25789
|
+
|
|
25790
|
+
return reversed ? dates.reverse() : dates;
|
|
25791
|
+
}
|
|
25792
|
+
|
|
25563
25793
|
/**
|
|
25564
25794
|
* The {@link endOfWeek} function options.
|
|
25565
25795
|
*/
|
|
@@ -26268,7 +26498,7 @@ const match = {
|
|
|
26268
26498
|
* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
|
|
26269
26499
|
* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
|
|
26270
26500
|
*/
|
|
26271
|
-
const enUS = {
|
|
26501
|
+
const enUS$1 = {
|
|
26272
26502
|
code: "en-US",
|
|
26273
26503
|
formatDistance: formatDistance,
|
|
26274
26504
|
formatLong: formatLong,
|
|
@@ -27785,7 +28015,7 @@ const unescapedLatinCharacterRegExp$1 = /[a-zA-Z]/;
|
|
|
27785
28015
|
*/
|
|
27786
28016
|
function format(date, formatStr, options) {
|
|
27787
28017
|
const defaultOptions = getDefaultOptions$1();
|
|
27788
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
28018
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS$1;
|
|
27789
28019
|
|
|
27790
28020
|
const firstWeekContainsDate =
|
|
27791
28021
|
options?.firstWeekContainsDate ??
|
|
@@ -30478,7 +30708,7 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
30478
30708
|
function parse(dateStr, formatStr, referenceDate, options) {
|
|
30479
30709
|
const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);
|
|
30480
30710
|
const defaultOptions = getDefaultOptions();
|
|
30481
|
-
const locale = options?.locale ?? defaultOptions.locale ?? enUS;
|
|
30711
|
+
const locale = options?.locale ?? defaultOptions.locale ?? enUS$1;
|
|
30482
30712
|
|
|
30483
30713
|
const firstWeekContainsDate =
|
|
30484
30714
|
options?.firstWeekContainsDate ??
|
|
@@ -31284,6 +31514,69 @@ function endOfBroadcastWeek(date, dateLib) {
|
|
|
31284
31514
|
return endDate;
|
|
31285
31515
|
}
|
|
31286
31516
|
|
|
31517
|
+
/** English (United States) locale extended with DayPicker-specific translations. */
|
|
31518
|
+
const enUS = {
|
|
31519
|
+
...enUS$1,
|
|
31520
|
+
labels: {
|
|
31521
|
+
labelDayButton: (date, modifiers, options, dateLib) => {
|
|
31522
|
+
let formatDate;
|
|
31523
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31524
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31525
|
+
}
|
|
31526
|
+
else {
|
|
31527
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31528
|
+
}
|
|
31529
|
+
let label = formatDate(date, "PPPP");
|
|
31530
|
+
if (modifiers.today)
|
|
31531
|
+
label = `Today, ${label}`;
|
|
31532
|
+
if (modifiers.selected)
|
|
31533
|
+
label = `${label}, selected`;
|
|
31534
|
+
return label;
|
|
31535
|
+
},
|
|
31536
|
+
labelMonthDropdown: "Choose the Month",
|
|
31537
|
+
labelNext: "Go to the Next Month",
|
|
31538
|
+
labelPrevious: "Go to the Previous Month",
|
|
31539
|
+
labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
|
|
31540
|
+
labelYearDropdown: "Choose the Year",
|
|
31541
|
+
labelGrid: (date, options, dateLib) => {
|
|
31542
|
+
let formatDate;
|
|
31543
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31544
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31545
|
+
}
|
|
31546
|
+
else {
|
|
31547
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31548
|
+
}
|
|
31549
|
+
return formatDate(date, "LLLL yyyy");
|
|
31550
|
+
},
|
|
31551
|
+
labelGridcell: (date, modifiers, options, dateLib) => {
|
|
31552
|
+
let formatDate;
|
|
31553
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31554
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31555
|
+
}
|
|
31556
|
+
else {
|
|
31557
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31558
|
+
}
|
|
31559
|
+
let label = formatDate(date, "PPPP");
|
|
31560
|
+
if (modifiers?.today) {
|
|
31561
|
+
label = `Today, ${label}`;
|
|
31562
|
+
}
|
|
31563
|
+
return label;
|
|
31564
|
+
},
|
|
31565
|
+
labelNav: "Navigation bar",
|
|
31566
|
+
labelWeekNumberHeader: "Week Number",
|
|
31567
|
+
labelWeekday: (date, options, dateLib) => {
|
|
31568
|
+
let formatDate;
|
|
31569
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
31570
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
31571
|
+
}
|
|
31572
|
+
else {
|
|
31573
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
31574
|
+
}
|
|
31575
|
+
return formatDate(date, "cccc");
|
|
31576
|
+
},
|
|
31577
|
+
},
|
|
31578
|
+
};
|
|
31579
|
+
|
|
31287
31580
|
/**
|
|
31288
31581
|
* A wrapper class around [date-fns](http://date-fns.org) that provides utility
|
|
31289
31582
|
* methods for date manipulation and formatting.
|
|
@@ -31422,6 +31715,31 @@ class DateLib {
|
|
|
31422
31715
|
? this.overrides.eachMonthOfInterval(interval)
|
|
31423
31716
|
: eachMonthOfInterval(interval);
|
|
31424
31717
|
};
|
|
31718
|
+
/**
|
|
31719
|
+
* Returns the years between the given dates.
|
|
31720
|
+
*
|
|
31721
|
+
* @since 9.11.1
|
|
31722
|
+
* @param interval The interval to get the years for.
|
|
31723
|
+
* @returns The array of years in the interval.
|
|
31724
|
+
*/
|
|
31725
|
+
this.eachYearOfInterval = (interval) => {
|
|
31726
|
+
const years = this.overrides?.eachYearOfInterval
|
|
31727
|
+
? this.overrides.eachYearOfInterval(interval)
|
|
31728
|
+
: eachYearOfInterval(interval);
|
|
31729
|
+
// Remove duplicates that may happen across DST transitions (e.g., "America/Sao_Paulo")
|
|
31730
|
+
// See https://github.com/date-fns/tz/issues/72
|
|
31731
|
+
const uniqueYears = new Set(years.map((d) => this.getYear(d)));
|
|
31732
|
+
if (uniqueYears.size === years.length) {
|
|
31733
|
+
// No duplicates, return as is
|
|
31734
|
+
return years;
|
|
31735
|
+
}
|
|
31736
|
+
// Rebuild the array to ensure one date per year
|
|
31737
|
+
const yearsArray = [];
|
|
31738
|
+
uniqueYears.forEach((y) => {
|
|
31739
|
+
yearsArray.push(new Date(y, 0, 1));
|
|
31740
|
+
});
|
|
31741
|
+
return yearsArray;
|
|
31742
|
+
};
|
|
31425
31743
|
/**
|
|
31426
31744
|
* Returns the end of the broadcast week for the given date.
|
|
31427
31745
|
*
|
|
@@ -31760,7 +32078,63 @@ class DateLib {
|
|
|
31760
32078
|
formatNumber(value) {
|
|
31761
32079
|
return this.replaceDigits(value.toString());
|
|
31762
32080
|
}
|
|
31763
|
-
|
|
32081
|
+
/**
|
|
32082
|
+
* Returns the preferred ordering for month and year labels for the current
|
|
32083
|
+
* locale.
|
|
32084
|
+
*/
|
|
32085
|
+
getMonthYearOrder() {
|
|
32086
|
+
const code = this.options.locale?.code;
|
|
32087
|
+
if (!code) {
|
|
32088
|
+
return "month-first";
|
|
32089
|
+
}
|
|
32090
|
+
return DateLib.yearFirstLocales.has(code) ? "year-first" : "month-first";
|
|
32091
|
+
}
|
|
32092
|
+
/**
|
|
32093
|
+
* Formats the month/year pair respecting locale conventions.
|
|
32094
|
+
*
|
|
32095
|
+
* @since 9.11.0
|
|
32096
|
+
*/
|
|
32097
|
+
formatMonthYear(date) {
|
|
32098
|
+
const { locale, timeZone, numerals } = this.options;
|
|
32099
|
+
const localeCode = locale?.code;
|
|
32100
|
+
if (localeCode && DateLib.yearFirstLocales.has(localeCode)) {
|
|
32101
|
+
try {
|
|
32102
|
+
const intl = new Intl.DateTimeFormat(localeCode, {
|
|
32103
|
+
month: "long",
|
|
32104
|
+
year: "numeric",
|
|
32105
|
+
timeZone,
|
|
32106
|
+
numberingSystem: numerals,
|
|
32107
|
+
});
|
|
32108
|
+
const formatted = intl.format(date);
|
|
32109
|
+
return formatted;
|
|
32110
|
+
}
|
|
32111
|
+
catch {
|
|
32112
|
+
// Fallback to date-fns formatting below.
|
|
32113
|
+
}
|
|
32114
|
+
}
|
|
32115
|
+
const pattern = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
32116
|
+
return this.format(date, pattern);
|
|
32117
|
+
}
|
|
32118
|
+
}
|
|
32119
|
+
DateLib.yearFirstLocales = new Set([
|
|
32120
|
+
"eu",
|
|
32121
|
+
"hu",
|
|
32122
|
+
"ja",
|
|
32123
|
+
"ja-Hira",
|
|
32124
|
+
"ja-JP",
|
|
32125
|
+
"ko",
|
|
32126
|
+
"ko-KR",
|
|
32127
|
+
"lt",
|
|
32128
|
+
"lt-LT",
|
|
32129
|
+
"lv",
|
|
32130
|
+
"lv-LV",
|
|
32131
|
+
"mn",
|
|
32132
|
+
"mn-MN",
|
|
32133
|
+
"zh",
|
|
32134
|
+
"zh-CN",
|
|
32135
|
+
"zh-HK",
|
|
32136
|
+
"zh-TW",
|
|
32137
|
+
]);
|
|
31764
32138
|
/**
|
|
31765
32139
|
* The default date library with English locale.
|
|
31766
32140
|
*
|
|
@@ -31781,6 +32155,9 @@ class CalendarDay {
|
|
|
31781
32155
|
this.displayMonth = displayMonth;
|
|
31782
32156
|
this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
|
|
31783
32157
|
this.dateLib = dateLib;
|
|
32158
|
+
this.isoDate = dateLib.format(date, "yyyy-MM-dd");
|
|
32159
|
+
this.displayMonthId = dateLib.format(displayMonth, "yyyy-MM");
|
|
32160
|
+
this.dateMonthId = dateLib.format(date, "yyyy-MM");
|
|
31784
32161
|
}
|
|
31785
32162
|
/**
|
|
31786
32163
|
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
@@ -31956,7 +32333,7 @@ var UI;
|
|
|
31956
32333
|
/** The dropdown with the years. */
|
|
31957
32334
|
UI["YearsDropdown"] = "years_dropdown";
|
|
31958
32335
|
})(UI || (UI = {}));
|
|
31959
|
-
/** Enum representing flags for the {@link UI.Day} element. */
|
|
32336
|
+
/** Enum representing flags for the {@link UI | UI.Day} element. */
|
|
31960
32337
|
var DayFlag;
|
|
31961
32338
|
(function (DayFlag) {
|
|
31962
32339
|
/** The day is disabled. */
|
|
@@ -31971,8 +32348,8 @@ var DayFlag;
|
|
|
31971
32348
|
DayFlag["today"] = "today";
|
|
31972
32349
|
})(DayFlag || (DayFlag = {}));
|
|
31973
32350
|
/**
|
|
31974
|
-
* Enum representing selection states that can be applied to the
|
|
31975
|
-
* element in selection mode.
|
|
32351
|
+
* Enum representing selection states that can be applied to the
|
|
32352
|
+
* {@link UI | UI.Day} element in selection mode.
|
|
31976
32353
|
*/
|
|
31977
32354
|
var SelectionState;
|
|
31978
32355
|
(function (SelectionState) {
|
|
@@ -32422,7 +32799,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32422
32799
|
return isSameDay(date, matcher);
|
|
32423
32800
|
}
|
|
32424
32801
|
if (isDatesArray(matcher, dateLib)) {
|
|
32425
|
-
return matcher.
|
|
32802
|
+
return matcher.some((matcherDate) => isSameDay(date, matcherDate));
|
|
32426
32803
|
}
|
|
32427
32804
|
if (isDateRange(matcher)) {
|
|
32428
32805
|
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
@@ -32473,7 +32850,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
32473
32850
|
* @returns A function that retrieves the modifiers for a given `CalendarDay`.
|
|
32474
32851
|
*/
|
|
32475
32852
|
function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
32476
|
-
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today, } = props;
|
|
32853
|
+
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today = dateLib.today(), } = props;
|
|
32477
32854
|
const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter, } = dateLib;
|
|
32478
32855
|
const computedNavStart = navStart && startOfMonth(navStart);
|
|
32479
32856
|
const computedNavEnd = navEnd && endOfMonth(navEnd);
|
|
@@ -32497,7 +32874,7 @@ function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
|
32497
32874
|
// Broadcast calendar will show outside days as default
|
|
32498
32875
|
(!broadcastCalendar && !showOutsideDays && isOutside) ||
|
|
32499
32876
|
(broadcastCalendar && showOutsideDays === false && isOutside);
|
|
32500
|
-
const isToday = isSameDay(date, today
|
|
32877
|
+
const isToday = isSameDay(date, today);
|
|
32501
32878
|
if (isOutside)
|
|
32502
32879
|
internalModifiersMap.outside.push(day);
|
|
32503
32880
|
if (isDisabled)
|
|
@@ -32656,7 +33033,7 @@ function getDefaultClassNames() {
|
|
|
32656
33033
|
/**
|
|
32657
33034
|
* Formats the caption of the month.
|
|
32658
33035
|
*
|
|
32659
|
-
* @defaultValue
|
|
33036
|
+
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
|
|
32660
33037
|
* @param month The date representing the month.
|
|
32661
33038
|
* @param options Configuration options for the date library.
|
|
32662
33039
|
* @param dateLib The date library to use for formatting. If not provided, a new
|
|
@@ -32666,7 +33043,8 @@ function getDefaultClassNames() {
|
|
|
32666
33043
|
* @see https://daypicker.dev/docs/translation#custom-formatters
|
|
32667
33044
|
*/
|
|
32668
33045
|
function formatCaption(month, options, dateLib) {
|
|
32669
|
-
|
|
33046
|
+
const lib = dateLib ?? new DateLib(options);
|
|
33047
|
+
return lib.formatMonthYear(month);
|
|
32670
33048
|
}
|
|
32671
33049
|
/**
|
|
32672
33050
|
* @private
|
|
@@ -32806,127 +33184,6 @@ function getFormatters(customFormatters) {
|
|
|
32806
33184
|
};
|
|
32807
33185
|
}
|
|
32808
33186
|
|
|
32809
|
-
/**
|
|
32810
|
-
* Returns the months to show in the dropdown.
|
|
32811
|
-
*
|
|
32812
|
-
* This function generates a list of months for the current year, formatted
|
|
32813
|
-
* using the provided formatter, and determines whether each month should be
|
|
32814
|
-
* disabled based on the navigation range.
|
|
32815
|
-
*
|
|
32816
|
-
* @param displayMonth The currently displayed month.
|
|
32817
|
-
* @param navStart The start date for navigation.
|
|
32818
|
-
* @param navEnd The end date for navigation.
|
|
32819
|
-
* @param formatters The formatters to use for formatting the month labels.
|
|
32820
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32821
|
-
* @returns An array of dropdown options representing the months, or `undefined`
|
|
32822
|
-
* if no months are available.
|
|
32823
|
-
*/
|
|
32824
|
-
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
32825
|
-
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
32826
|
-
const months = eachMonthOfInterval({
|
|
32827
|
-
start: startOfYear(displayMonth),
|
|
32828
|
-
end: endOfYear(displayMonth),
|
|
32829
|
-
});
|
|
32830
|
-
const options = months.map((month) => {
|
|
32831
|
-
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
32832
|
-
const value = getMonth(month);
|
|
32833
|
-
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
32834
|
-
(navEnd && month > startOfMonth(navEnd)) ||
|
|
32835
|
-
false;
|
|
32836
|
-
return { value, label, disabled };
|
|
32837
|
-
});
|
|
32838
|
-
return options;
|
|
32839
|
-
}
|
|
32840
|
-
|
|
32841
|
-
/**
|
|
32842
|
-
* Returns the computed style for a day based on its modifiers.
|
|
32843
|
-
*
|
|
32844
|
-
* This function merges the base styles for the day with any styles associated
|
|
32845
|
-
* with active modifiers.
|
|
32846
|
-
*
|
|
32847
|
-
* @param dayModifiers The modifiers applied to the day.
|
|
32848
|
-
* @param styles The base styles for the calendar elements.
|
|
32849
|
-
* @param modifiersStyles The styles associated with specific modifiers.
|
|
32850
|
-
* @returns The computed style for the day.
|
|
32851
|
-
*/
|
|
32852
|
-
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
32853
|
-
let style = { ...styles?.[UI.Day] };
|
|
32854
|
-
Object.entries(dayModifiers)
|
|
32855
|
-
.filter(([, active]) => active === true)
|
|
32856
|
-
.forEach(([modifier]) => {
|
|
32857
|
-
style = {
|
|
32858
|
-
...style,
|
|
32859
|
-
...modifiersStyles?.[modifier],
|
|
32860
|
-
};
|
|
32861
|
-
});
|
|
32862
|
-
return style;
|
|
32863
|
-
}
|
|
32864
|
-
|
|
32865
|
-
/**
|
|
32866
|
-
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
32867
|
-
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
32868
|
-
*
|
|
32869
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32870
|
-
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
32871
|
-
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
32872
|
-
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
32873
|
-
* @returns An array of 7 dates representing the weekdays.
|
|
32874
|
-
*/
|
|
32875
|
-
function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {
|
|
32876
|
-
const today = dateLib.today();
|
|
32877
|
-
const start = broadcastCalendar
|
|
32878
|
-
? dateLib.startOfBroadcastWeek(today, dateLib)
|
|
32879
|
-
: ISOWeek
|
|
32880
|
-
? dateLib.startOfISOWeek(today)
|
|
32881
|
-
: dateLib.startOfWeek(today);
|
|
32882
|
-
const days = [];
|
|
32883
|
-
for (let i = 0; i < 7; i++) {
|
|
32884
|
-
const day = dateLib.addDays(start, i);
|
|
32885
|
-
days.push(day);
|
|
32886
|
-
}
|
|
32887
|
-
return days;
|
|
32888
|
-
}
|
|
32889
|
-
|
|
32890
|
-
/**
|
|
32891
|
-
* Returns the years to display in the dropdown.
|
|
32892
|
-
*
|
|
32893
|
-
* This function generates a list of years between the navigation start and end
|
|
32894
|
-
* dates, formatted using the provided formatter.
|
|
32895
|
-
*
|
|
32896
|
-
* @param navStart The start date for navigation.
|
|
32897
|
-
* @param navEnd The end date for navigation.
|
|
32898
|
-
* @param formatters The formatters to use for formatting the year labels.
|
|
32899
|
-
* @param dateLib The date library to use for date manipulation.
|
|
32900
|
-
* @param reverse If true, reverses the order of the years (descending).
|
|
32901
|
-
* @returns An array of dropdown options representing the years, or `undefined`
|
|
32902
|
-
* if `navStart` or `navEnd` is not provided.
|
|
32903
|
-
*/
|
|
32904
|
-
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
32905
|
-
if (!navStart)
|
|
32906
|
-
return undefined;
|
|
32907
|
-
if (!navEnd)
|
|
32908
|
-
return undefined;
|
|
32909
|
-
const { startOfYear, endOfYear, addYears, getYear, isBefore, isSameYear } = dateLib;
|
|
32910
|
-
const firstNavYear = startOfYear(navStart);
|
|
32911
|
-
const lastNavYear = endOfYear(navEnd);
|
|
32912
|
-
const years = [];
|
|
32913
|
-
let year = firstNavYear;
|
|
32914
|
-
while (isBefore(year, lastNavYear) || isSameYear(year, lastNavYear)) {
|
|
32915
|
-
years.push(year);
|
|
32916
|
-
year = addYears(year, 1);
|
|
32917
|
-
}
|
|
32918
|
-
if (reverse)
|
|
32919
|
-
years.reverse();
|
|
32920
|
-
return years.map((year) => {
|
|
32921
|
-
const label = formatters.formatYearDropdown(year, dateLib);
|
|
32922
|
-
return {
|
|
32923
|
-
value: getYear(year),
|
|
32924
|
-
label,
|
|
32925
|
-
disabled: false,
|
|
32926
|
-
};
|
|
32927
|
-
});
|
|
32928
|
-
}
|
|
32929
|
-
|
|
32930
33187
|
/**
|
|
32931
33188
|
* Generates the ARIA label for a day button.
|
|
32932
33189
|
*
|
|
@@ -32960,7 +33217,7 @@ const labelDay = labelDayButton;
|
|
|
32960
33217
|
* Generates the ARIA label for the month grid, which is announced when entering
|
|
32961
33218
|
* the grid.
|
|
32962
33219
|
*
|
|
32963
|
-
* @defaultValue
|
|
33220
|
+
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
|
|
32964
33221
|
* @param date - The date representing the month.
|
|
32965
33222
|
* @param options - Optional configuration for the date formatting library.
|
|
32966
33223
|
* @param dateLib - An optional instance of the date formatting library.
|
|
@@ -32969,7 +33226,8 @@ const labelDay = labelDayButton;
|
|
|
32969
33226
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
32970
33227
|
*/
|
|
32971
33228
|
function labelGrid(date, options, dateLib) {
|
|
32972
|
-
|
|
33229
|
+
const lib = dateLib ?? new DateLib(options);
|
|
33230
|
+
return lib.formatMonthYear(date);
|
|
32973
33231
|
}
|
|
32974
33232
|
/**
|
|
32975
33233
|
* @ignore
|
|
@@ -33021,6 +33279,7 @@ function labelNav() {
|
|
|
33021
33279
|
return "";
|
|
33022
33280
|
}
|
|
33023
33281
|
|
|
33282
|
+
const defaultLabel = "Go to the Next Month";
|
|
33024
33283
|
/**
|
|
33025
33284
|
* Generates the ARIA label for the "next month" button.
|
|
33026
33285
|
*
|
|
@@ -33031,8 +33290,8 @@ function labelNav() {
|
|
|
33031
33290
|
* @group Labels
|
|
33032
33291
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
33033
33292
|
*/
|
|
33034
|
-
function labelNext(_month) {
|
|
33035
|
-
return
|
|
33293
|
+
function labelNext(_month, _options) {
|
|
33294
|
+
return defaultLabel;
|
|
33036
33295
|
}
|
|
33037
33296
|
|
|
33038
33297
|
/**
|
|
@@ -33121,6 +33380,316 @@ var defaultLabels = /*#__PURE__*/Object.freeze({
|
|
|
33121
33380
|
labelYearDropdown: labelYearDropdown
|
|
33122
33381
|
});
|
|
33123
33382
|
|
|
33383
|
+
const resolveLabel = (defaultLabel, customLabel, localeLabel) => {
|
|
33384
|
+
if (customLabel)
|
|
33385
|
+
return customLabel;
|
|
33386
|
+
if (localeLabel) {
|
|
33387
|
+
return (typeof localeLabel === "function"
|
|
33388
|
+
? localeLabel
|
|
33389
|
+
: (..._args) => localeLabel);
|
|
33390
|
+
}
|
|
33391
|
+
return defaultLabel;
|
|
33392
|
+
};
|
|
33393
|
+
/**
|
|
33394
|
+
* Merges custom labels from the props with the default labels.
|
|
33395
|
+
*
|
|
33396
|
+
* When available, uses the locale-provided translation for `labelNext`.
|
|
33397
|
+
*
|
|
33398
|
+
* @param customLabels The custom labels provided in the DayPicker props.
|
|
33399
|
+
* @param options Options from the date library, used to resolve locale
|
|
33400
|
+
* translations.
|
|
33401
|
+
* @returns The merged labels object with locale-aware defaults.
|
|
33402
|
+
*/
|
|
33403
|
+
function getLabels(customLabels, options) {
|
|
33404
|
+
const localeLabels = options.locale?.labels ?? {};
|
|
33405
|
+
return {
|
|
33406
|
+
...defaultLabels,
|
|
33407
|
+
...(customLabels ?? {}),
|
|
33408
|
+
labelDayButton: resolveLabel(labelDayButton, customLabels?.labelDayButton, localeLabels.labelDayButton),
|
|
33409
|
+
labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels?.labelMonthDropdown, localeLabels.labelMonthDropdown),
|
|
33410
|
+
labelNext: resolveLabel(labelNext, customLabels?.labelNext, localeLabels.labelNext),
|
|
33411
|
+
labelPrevious: resolveLabel(labelPrevious, customLabels?.labelPrevious, localeLabels.labelPrevious),
|
|
33412
|
+
labelWeekNumber: resolveLabel(labelWeekNumber, customLabels?.labelWeekNumber, localeLabels.labelWeekNumber),
|
|
33413
|
+
labelYearDropdown: resolveLabel(labelYearDropdown, customLabels?.labelYearDropdown, localeLabels.labelYearDropdown),
|
|
33414
|
+
labelGrid: resolveLabel(labelGrid, customLabels?.labelGrid, localeLabels.labelGrid),
|
|
33415
|
+
labelGridcell: resolveLabel(labelGridcell, customLabels?.labelGridcell, localeLabels.labelGridcell),
|
|
33416
|
+
labelNav: resolveLabel(labelNav, customLabels?.labelNav, localeLabels.labelNav),
|
|
33417
|
+
labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels?.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
|
|
33418
|
+
labelWeekday: resolveLabel(labelWeekday, customLabels?.labelWeekday, localeLabels.labelWeekday),
|
|
33419
|
+
};
|
|
33420
|
+
}
|
|
33421
|
+
|
|
33422
|
+
/**
|
|
33423
|
+
* Returns the months to show in the dropdown.
|
|
33424
|
+
*
|
|
33425
|
+
* This function generates a list of months for the current year, formatted
|
|
33426
|
+
* using the provided formatter, and determines whether each month should be
|
|
33427
|
+
* disabled based on the navigation range.
|
|
33428
|
+
*
|
|
33429
|
+
* @param displayMonth The currently displayed month.
|
|
33430
|
+
* @param navStart The start date for navigation.
|
|
33431
|
+
* @param navEnd The end date for navigation.
|
|
33432
|
+
* @param formatters The formatters to use for formatting the month labels.
|
|
33433
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33434
|
+
* @returns An array of dropdown options representing the months, or `undefined`
|
|
33435
|
+
* if no months are available.
|
|
33436
|
+
*/
|
|
33437
|
+
function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
33438
|
+
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
|
|
33439
|
+
const months = eachMonthOfInterval({
|
|
33440
|
+
start: startOfYear(displayMonth),
|
|
33441
|
+
end: endOfYear(displayMonth),
|
|
33442
|
+
});
|
|
33443
|
+
const options = months.map((month) => {
|
|
33444
|
+
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
33445
|
+
const value = getMonth(month);
|
|
33446
|
+
const disabled = (navStart && month < startOfMonth(navStart)) ||
|
|
33447
|
+
(navEnd && month > startOfMonth(navEnd)) ||
|
|
33448
|
+
false;
|
|
33449
|
+
return { value, label, disabled };
|
|
33450
|
+
});
|
|
33451
|
+
return options;
|
|
33452
|
+
}
|
|
33453
|
+
|
|
33454
|
+
/**
|
|
33455
|
+
* Returns the computed style for a day based on its modifiers.
|
|
33456
|
+
*
|
|
33457
|
+
* This function merges the base styles for the day with any styles associated
|
|
33458
|
+
* with active modifiers.
|
|
33459
|
+
*
|
|
33460
|
+
* @param dayModifiers The modifiers applied to the day.
|
|
33461
|
+
* @param styles The base styles for the calendar elements.
|
|
33462
|
+
* @param modifiersStyles The styles associated with specific modifiers.
|
|
33463
|
+
* @returns The computed style for the day.
|
|
33464
|
+
*/
|
|
33465
|
+
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
33466
|
+
let style = { ...styles?.[UI.Day] };
|
|
33467
|
+
Object.entries(dayModifiers)
|
|
33468
|
+
.filter(([, active]) => active === true)
|
|
33469
|
+
.forEach(([modifier]) => {
|
|
33470
|
+
style = {
|
|
33471
|
+
...style,
|
|
33472
|
+
...modifiersStyles?.[modifier],
|
|
33473
|
+
};
|
|
33474
|
+
});
|
|
33475
|
+
return style;
|
|
33476
|
+
}
|
|
33477
|
+
|
|
33478
|
+
/**
|
|
33479
|
+
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
33480
|
+
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
33481
|
+
*
|
|
33482
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33483
|
+
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
33484
|
+
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
33485
|
+
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
33486
|
+
* @returns An array of 7 dates representing the weekdays.
|
|
33487
|
+
*/
|
|
33488
|
+
function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
|
|
33489
|
+
const referenceToday = today ?? dateLib.today();
|
|
33490
|
+
const start = broadcastCalendar
|
|
33491
|
+
? dateLib.startOfBroadcastWeek(referenceToday, dateLib)
|
|
33492
|
+
: ISOWeek
|
|
33493
|
+
? dateLib.startOfISOWeek(referenceToday)
|
|
33494
|
+
: dateLib.startOfWeek(referenceToday);
|
|
33495
|
+
const days = [];
|
|
33496
|
+
for (let i = 0; i < 7; i++) {
|
|
33497
|
+
const day = dateLib.addDays(start, i);
|
|
33498
|
+
days.push(day);
|
|
33499
|
+
}
|
|
33500
|
+
return days;
|
|
33501
|
+
}
|
|
33502
|
+
|
|
33503
|
+
/**
|
|
33504
|
+
* Returns the years to display in the dropdown.
|
|
33505
|
+
*
|
|
33506
|
+
* This function generates a list of years between the navigation start and end
|
|
33507
|
+
* dates, formatted using the provided formatter.
|
|
33508
|
+
*
|
|
33509
|
+
* @param navStart The start date for navigation.
|
|
33510
|
+
* @param navEnd The end date for navigation.
|
|
33511
|
+
* @param formatters The formatters to use for formatting the year labels.
|
|
33512
|
+
* @param dateLib The date library to use for date manipulation.
|
|
33513
|
+
* @param reverse If true, reverses the order of the years (descending).
|
|
33514
|
+
* @returns An array of dropdown options representing the years, or `undefined`
|
|
33515
|
+
* if `navStart` or `navEnd` is not provided.
|
|
33516
|
+
*/
|
|
33517
|
+
function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
33518
|
+
if (!navStart)
|
|
33519
|
+
return undefined;
|
|
33520
|
+
if (!navEnd)
|
|
33521
|
+
return undefined;
|
|
33522
|
+
const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
|
|
33523
|
+
const firstNavYear = startOfYear(navStart);
|
|
33524
|
+
const lastNavYear = endOfYear(navEnd);
|
|
33525
|
+
const years = eachYearOfInterval({ start: firstNavYear, end: lastNavYear });
|
|
33526
|
+
if (reverse)
|
|
33527
|
+
years.reverse();
|
|
33528
|
+
return years.map((year) => {
|
|
33529
|
+
const label = formatters.formatYearDropdown(year, dateLib);
|
|
33530
|
+
return {
|
|
33531
|
+
value: getYear(year),
|
|
33532
|
+
label,
|
|
33533
|
+
disabled: false,
|
|
33534
|
+
};
|
|
33535
|
+
});
|
|
33536
|
+
}
|
|
33537
|
+
|
|
33538
|
+
/**
|
|
33539
|
+
* Creates `dateLib` overrides that keep all calendar math at noon in the target
|
|
33540
|
+
* time zone. This avoids second-level offset changes (e.g., historical zones
|
|
33541
|
+
* with +03:41:12) from pushing dates backward across midnight.
|
|
33542
|
+
*/
|
|
33543
|
+
function createNoonOverrides(timeZone, options = {}) {
|
|
33544
|
+
const { weekStartsOn, locale } = options;
|
|
33545
|
+
const fallbackWeekStartsOn = (weekStartsOn ??
|
|
33546
|
+
locale?.options?.weekStartsOn ??
|
|
33547
|
+
0);
|
|
33548
|
+
// Keep all internal math anchored at noon in the target zone to avoid
|
|
33549
|
+
// historical second-level offsets from crossing midnight.
|
|
33550
|
+
const toNoonTZDate = (date) => {
|
|
33551
|
+
const normalizedDate = typeof date === "number" || typeof date === "string"
|
|
33552
|
+
? new Date(date)
|
|
33553
|
+
: date;
|
|
33554
|
+
return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
|
|
33555
|
+
};
|
|
33556
|
+
// Convert a value into a host `Date` that represents the same calendar day
|
|
33557
|
+
// as the target-zone noon. This is useful for helpers (e.g., date-fns week
|
|
33558
|
+
// utilities) that expect local `Date` instances rather than `TZDate`s.
|
|
33559
|
+
const toCalendarDate = (date) => {
|
|
33560
|
+
const zoned = toNoonTZDate(date);
|
|
33561
|
+
return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
|
|
33562
|
+
};
|
|
33563
|
+
return {
|
|
33564
|
+
today: () => {
|
|
33565
|
+
return toNoonTZDate(TZDate.tz(timeZone));
|
|
33566
|
+
},
|
|
33567
|
+
newDate: (year, monthIndex, date) => {
|
|
33568
|
+
return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
|
|
33569
|
+
},
|
|
33570
|
+
startOfDay: (date) => {
|
|
33571
|
+
return toNoonTZDate(date);
|
|
33572
|
+
},
|
|
33573
|
+
startOfWeek: (date, options) => {
|
|
33574
|
+
const base = toNoonTZDate(date);
|
|
33575
|
+
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33576
|
+
fallbackWeekStartsOn);
|
|
33577
|
+
const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
|
|
33578
|
+
base.setDate(base.getDate() - diff);
|
|
33579
|
+
return base;
|
|
33580
|
+
},
|
|
33581
|
+
startOfISOWeek: (date) => {
|
|
33582
|
+
const base = toNoonTZDate(date);
|
|
33583
|
+
const diff = (base.getDay() - 1 + 7) % 7;
|
|
33584
|
+
base.setDate(base.getDate() - diff);
|
|
33585
|
+
return base;
|
|
33586
|
+
},
|
|
33587
|
+
startOfMonth: (date) => {
|
|
33588
|
+
const base = toNoonTZDate(date);
|
|
33589
|
+
base.setDate(1);
|
|
33590
|
+
return base;
|
|
33591
|
+
},
|
|
33592
|
+
startOfYear: (date) => {
|
|
33593
|
+
const base = toNoonTZDate(date);
|
|
33594
|
+
base.setMonth(0, 1);
|
|
33595
|
+
return base;
|
|
33596
|
+
},
|
|
33597
|
+
endOfWeek: (date, options) => {
|
|
33598
|
+
const base = toNoonTZDate(date);
|
|
33599
|
+
const weekStartsOnValue = (options?.weekStartsOn ??
|
|
33600
|
+
fallbackWeekStartsOn);
|
|
33601
|
+
const endDow = (weekStartsOnValue + 6) % 7;
|
|
33602
|
+
const diff = (endDow - base.getDay() + 7) % 7;
|
|
33603
|
+
base.setDate(base.getDate() + diff);
|
|
33604
|
+
return base;
|
|
33605
|
+
},
|
|
33606
|
+
endOfISOWeek: (date) => {
|
|
33607
|
+
const base = toNoonTZDate(date);
|
|
33608
|
+
const diff = (7 - base.getDay()) % 7;
|
|
33609
|
+
base.setDate(base.getDate() + diff);
|
|
33610
|
+
return base;
|
|
33611
|
+
},
|
|
33612
|
+
endOfMonth: (date) => {
|
|
33613
|
+
const base = toNoonTZDate(date);
|
|
33614
|
+
base.setMonth(base.getMonth() + 1, 0);
|
|
33615
|
+
return base;
|
|
33616
|
+
},
|
|
33617
|
+
endOfYear: (date) => {
|
|
33618
|
+
const base = toNoonTZDate(date);
|
|
33619
|
+
base.setMonth(11, 31);
|
|
33620
|
+
return base;
|
|
33621
|
+
},
|
|
33622
|
+
eachMonthOfInterval: (interval) => {
|
|
33623
|
+
const start = toNoonTZDate(interval.start);
|
|
33624
|
+
const end = toNoonTZDate(interval.end);
|
|
33625
|
+
const result = [];
|
|
33626
|
+
const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
|
|
33627
|
+
const endKey = end.getFullYear() * 12 + end.getMonth();
|
|
33628
|
+
while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
|
|
33629
|
+
result.push(new TZDate(cursor, timeZone));
|
|
33630
|
+
cursor.setMonth(cursor.getMonth() + 1, 1);
|
|
33631
|
+
}
|
|
33632
|
+
return result;
|
|
33633
|
+
},
|
|
33634
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
33635
|
+
// mutate the same TZDate, and return it.
|
|
33636
|
+
addDays: (date, amount) => {
|
|
33637
|
+
const base = toNoonTZDate(date);
|
|
33638
|
+
base.setDate(base.getDate() + amount);
|
|
33639
|
+
return base;
|
|
33640
|
+
},
|
|
33641
|
+
addWeeks: (date, amount) => {
|
|
33642
|
+
const base = toNoonTZDate(date);
|
|
33643
|
+
base.setDate(base.getDate() + amount * 7);
|
|
33644
|
+
return base;
|
|
33645
|
+
},
|
|
33646
|
+
addMonths: (date, amount) => {
|
|
33647
|
+
const base = toNoonTZDate(date);
|
|
33648
|
+
base.setMonth(base.getMonth() + amount);
|
|
33649
|
+
return base;
|
|
33650
|
+
},
|
|
33651
|
+
addYears: (date, amount) => {
|
|
33652
|
+
const base = toNoonTZDate(date);
|
|
33653
|
+
base.setFullYear(base.getFullYear() + amount);
|
|
33654
|
+
return base;
|
|
33655
|
+
},
|
|
33656
|
+
eachYearOfInterval: (interval) => {
|
|
33657
|
+
const start = toNoonTZDate(interval.start);
|
|
33658
|
+
const end = toNoonTZDate(interval.end);
|
|
33659
|
+
const years = [];
|
|
33660
|
+
const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
|
|
33661
|
+
while (cursor.getFullYear() <= end.getFullYear()) {
|
|
33662
|
+
years.push(new TZDate(cursor, timeZone));
|
|
33663
|
+
cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
|
|
33664
|
+
}
|
|
33665
|
+
return years;
|
|
33666
|
+
},
|
|
33667
|
+
getWeek: (date, options) => {
|
|
33668
|
+
const base = toCalendarDate(date);
|
|
33669
|
+
return getWeek(base, {
|
|
33670
|
+
weekStartsOn: options?.weekStartsOn ?? fallbackWeekStartsOn,
|
|
33671
|
+
firstWeekContainsDate: options?.firstWeekContainsDate ??
|
|
33672
|
+
locale?.options?.firstWeekContainsDate ??
|
|
33673
|
+
1,
|
|
33674
|
+
});
|
|
33675
|
+
},
|
|
33676
|
+
getISOWeek: (date) => {
|
|
33677
|
+
const base = toCalendarDate(date);
|
|
33678
|
+
return getISOWeek(base);
|
|
33679
|
+
},
|
|
33680
|
+
differenceInCalendarDays: (dateLeft, dateRight) => {
|
|
33681
|
+
const left = toCalendarDate(dateLeft);
|
|
33682
|
+
const right = toCalendarDate(dateRight);
|
|
33683
|
+
return differenceInCalendarDays(left, right);
|
|
33684
|
+
},
|
|
33685
|
+
differenceInCalendarMonths: (dateLeft, dateRight) => {
|
|
33686
|
+
const left = toCalendarDate(dateLeft);
|
|
33687
|
+
const right = toCalendarDate(dateRight);
|
|
33688
|
+
return differenceInCalendarMonths(left, right);
|
|
33689
|
+
},
|
|
33690
|
+
};
|
|
33691
|
+
}
|
|
33692
|
+
|
|
33124
33693
|
const asHtmlElement = (element) => {
|
|
33125
33694
|
if (element instanceof HTMLElement)
|
|
33126
33695
|
return element;
|
|
@@ -33313,19 +33882,27 @@ function getDates(displayMonths, maxDate, props, dateLib) {
|
|
|
33313
33882
|
: ISOWeek
|
|
33314
33883
|
? startOfISOWeek(firstMonth)
|
|
33315
33884
|
: startOfWeek(firstMonth);
|
|
33316
|
-
const
|
|
33885
|
+
const displayMonthsWeekEnd = broadcastCalendar
|
|
33317
33886
|
? endOfBroadcastWeek(lastMonth)
|
|
33318
33887
|
: ISOWeek
|
|
33319
33888
|
? endOfISOWeek(endOfMonth(lastMonth))
|
|
33320
33889
|
: endOfWeek(endOfMonth(lastMonth));
|
|
33321
|
-
|
|
33890
|
+
// If maxDate is set, clamp the grid to the end of that week.
|
|
33891
|
+
const constraintWeekEnd = maxDate &&
|
|
33892
|
+
(broadcastCalendar
|
|
33893
|
+
? endOfBroadcastWeek(maxDate)
|
|
33894
|
+
: ISOWeek
|
|
33895
|
+
? endOfISOWeek(maxDate)
|
|
33896
|
+
: endOfWeek(maxDate));
|
|
33897
|
+
// Pick the earliest week end between the displayed months and the constraint.
|
|
33898
|
+
const gridEndDate = constraintWeekEnd && isAfter(displayMonthsWeekEnd, constraintWeekEnd)
|
|
33899
|
+
? constraintWeekEnd
|
|
33900
|
+
: displayMonthsWeekEnd;
|
|
33901
|
+
const nOfDays = differenceInCalendarDays(gridEndDate, startWeekFirstDate);
|
|
33322
33902
|
const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;
|
|
33323
33903
|
const dates = [];
|
|
33324
33904
|
for (let i = 0; i <= nOfDays; i++) {
|
|
33325
33905
|
const date = addDays(startWeekFirstDate, i);
|
|
33326
|
-
if (maxDate && isAfter(date, maxDate)) {
|
|
33327
|
-
break;
|
|
33328
|
-
}
|
|
33329
33906
|
dates.push(date);
|
|
33330
33907
|
}
|
|
33331
33908
|
// If fixed weeks is enabled, add the extra dates to the array
|
|
@@ -33656,17 +34233,45 @@ function useCalendar(props, dateLib) {
|
|
|
33656
34233
|
setFirstMonth(newInitialMonth);
|
|
33657
34234
|
}, [props.timeZone]);
|
|
33658
34235
|
/** The months displayed in the calendar. */
|
|
33659
|
-
|
|
33660
|
-
|
|
33661
|
-
|
|
33662
|
-
|
|
33663
|
-
|
|
33664
|
-
|
|
33665
|
-
|
|
33666
|
-
|
|
33667
|
-
|
|
33668
|
-
|
|
33669
|
-
|
|
34236
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: We want to recompute only when specific props change.
|
|
34237
|
+
const { months, weeks, days, previousMonth, nextMonth } = React$5.useMemo(() => {
|
|
34238
|
+
const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);
|
|
34239
|
+
const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, {
|
|
34240
|
+
ISOWeek: props.ISOWeek,
|
|
34241
|
+
fixedWeeks: props.fixedWeeks,
|
|
34242
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
34243
|
+
}, dateLib);
|
|
34244
|
+
const months = getMonths(displayMonths, dates, {
|
|
34245
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
34246
|
+
fixedWeeks: props.fixedWeeks,
|
|
34247
|
+
ISOWeek: props.ISOWeek,
|
|
34248
|
+
reverseMonths: props.reverseMonths,
|
|
34249
|
+
}, dateLib);
|
|
34250
|
+
const weeks = getWeeks(months);
|
|
34251
|
+
const days = getDays(months);
|
|
34252
|
+
const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
34253
|
+
const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
34254
|
+
return {
|
|
34255
|
+
months,
|
|
34256
|
+
weeks,
|
|
34257
|
+
days,
|
|
34258
|
+
previousMonth,
|
|
34259
|
+
nextMonth,
|
|
34260
|
+
};
|
|
34261
|
+
}, [
|
|
34262
|
+
dateLib,
|
|
34263
|
+
firstMonth.getTime(),
|
|
34264
|
+
navEnd?.getTime(),
|
|
34265
|
+
navStart?.getTime(),
|
|
34266
|
+
props.disableNavigation,
|
|
34267
|
+
props.broadcastCalendar,
|
|
34268
|
+
props.endMonth?.getTime(),
|
|
34269
|
+
props.fixedWeeks,
|
|
34270
|
+
props.ISOWeek,
|
|
34271
|
+
props.numberOfMonths,
|
|
34272
|
+
props.pagedNavigation,
|
|
34273
|
+
props.reverseMonths,
|
|
34274
|
+
]);
|
|
33670
34275
|
const { disableNavigation, onMonthChange } = props;
|
|
33671
34276
|
const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
|
|
33672
34277
|
const goToMonth = (date) => {
|
|
@@ -33885,6 +34490,12 @@ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
|
33885
34490
|
const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
|
|
33886
34491
|
if (!nextFocus)
|
|
33887
34492
|
return;
|
|
34493
|
+
if (props.disableNavigation) {
|
|
34494
|
+
const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
|
|
34495
|
+
if (!isNextInCalendar) {
|
|
34496
|
+
return;
|
|
34497
|
+
}
|
|
34498
|
+
}
|
|
33888
34499
|
calendar.goToDay(nextFocus);
|
|
33889
34500
|
setFocused(nextFocus);
|
|
33890
34501
|
};
|
|
@@ -34167,15 +34778,33 @@ function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
|
|
|
34167
34778
|
* range, and a function to check if a date is within the range.
|
|
34168
34779
|
*/
|
|
34169
34780
|
function useRange(props, dateLib) {
|
|
34170
|
-
const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect, } = props;
|
|
34781
|
+
const { disabled, excludeDisabled, resetOnSelect, selected: initiallySelected, required, onSelect, } = props;
|
|
34171
34782
|
const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);
|
|
34172
34783
|
const selected = !onSelect ? internallySelected : initiallySelected;
|
|
34173
34784
|
const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);
|
|
34174
34785
|
const select = (triggerDate, modifiers, e) => {
|
|
34175
34786
|
const { min, max } = props;
|
|
34176
|
-
|
|
34177
|
-
|
|
34178
|
-
|
|
34787
|
+
let newRange;
|
|
34788
|
+
if (triggerDate) {
|
|
34789
|
+
const selectedFrom = selected?.from;
|
|
34790
|
+
const selectedTo = selected?.to;
|
|
34791
|
+
const hasFullRange = !!selectedFrom && !!selectedTo;
|
|
34792
|
+
const isClickingSingleDayRange = !!selectedFrom &&
|
|
34793
|
+
!!selectedTo &&
|
|
34794
|
+
dateLib.isSameDay(selectedFrom, selectedTo) &&
|
|
34795
|
+
dateLib.isSameDay(triggerDate, selectedFrom);
|
|
34796
|
+
if (resetOnSelect && (hasFullRange || !selected?.from)) {
|
|
34797
|
+
if (!required && isClickingSingleDayRange) {
|
|
34798
|
+
newRange = undefined;
|
|
34799
|
+
}
|
|
34800
|
+
else {
|
|
34801
|
+
newRange = { from: triggerDate, to: undefined };
|
|
34802
|
+
}
|
|
34803
|
+
}
|
|
34804
|
+
else {
|
|
34805
|
+
newRange = addToRange(triggerDate, selected, min, max, required, dateLib);
|
|
34806
|
+
}
|
|
34807
|
+
}
|
|
34179
34808
|
if (excludeDisabled && disabled && newRange?.from && newRange.to) {
|
|
34180
34809
|
if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {
|
|
34181
34810
|
// if a disabled days is found, the range is reset
|
|
@@ -34263,6 +34892,78 @@ function useSelection(props, dateLib) {
|
|
|
34263
34892
|
}
|
|
34264
34893
|
}
|
|
34265
34894
|
|
|
34895
|
+
/**
|
|
34896
|
+
* Convert a {@link Date} or {@link TZDate} instance to the given time zone.
|
|
34897
|
+
* Reuses the same instance when it is already a {@link TZDate} using the target
|
|
34898
|
+
* time zone to avoid extra allocations.
|
|
34899
|
+
*/
|
|
34900
|
+
function toTimeZone(date, timeZone) {
|
|
34901
|
+
if (date instanceof TZDate && date.timeZone === timeZone) {
|
|
34902
|
+
return date;
|
|
34903
|
+
}
|
|
34904
|
+
return new TZDate(date, timeZone);
|
|
34905
|
+
}
|
|
34906
|
+
|
|
34907
|
+
function toZoneNoon(date, timeZone, noonSafe) {
|
|
34908
|
+
if (!noonSafe)
|
|
34909
|
+
return toTimeZone(date, timeZone);
|
|
34910
|
+
const zoned = toTimeZone(date, timeZone);
|
|
34911
|
+
const noonZoned = new TZDate(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 12, 0, 0, timeZone);
|
|
34912
|
+
return new Date(noonZoned.getTime());
|
|
34913
|
+
}
|
|
34914
|
+
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
34915
|
+
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
34916
|
+
return matcher;
|
|
34917
|
+
}
|
|
34918
|
+
if (matcher instanceof Date) {
|
|
34919
|
+
return toZoneNoon(matcher, timeZone, noonSafe);
|
|
34920
|
+
}
|
|
34921
|
+
if (Array.isArray(matcher)) {
|
|
34922
|
+
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone, noonSafe) : value);
|
|
34923
|
+
}
|
|
34924
|
+
if (isDateRange(matcher)) {
|
|
34925
|
+
return {
|
|
34926
|
+
...matcher,
|
|
34927
|
+
from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
|
|
34928
|
+
to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to,
|
|
34929
|
+
};
|
|
34930
|
+
}
|
|
34931
|
+
if (isDateInterval(matcher)) {
|
|
34932
|
+
return {
|
|
34933
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34934
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34935
|
+
};
|
|
34936
|
+
}
|
|
34937
|
+
if (isDateAfterType(matcher)) {
|
|
34938
|
+
return {
|
|
34939
|
+
after: toZoneNoon(matcher.after, timeZone, noonSafe),
|
|
34940
|
+
};
|
|
34941
|
+
}
|
|
34942
|
+
if (isDateBeforeType(matcher)) {
|
|
34943
|
+
return {
|
|
34944
|
+
before: toZoneNoon(matcher.before, timeZone, noonSafe),
|
|
34945
|
+
};
|
|
34946
|
+
}
|
|
34947
|
+
return matcher;
|
|
34948
|
+
}
|
|
34949
|
+
/**
|
|
34950
|
+
* Convert any {@link Matcher} or array of matchers to the specified time zone.
|
|
34951
|
+
*
|
|
34952
|
+
* @param matchers - The matcher or matchers to convert.
|
|
34953
|
+
* @param timeZone - The target IANA time zone.
|
|
34954
|
+
* @returns The converted matcher(s).
|
|
34955
|
+
* @group Utilities
|
|
34956
|
+
*/
|
|
34957
|
+
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
34958
|
+
if (!matchers) {
|
|
34959
|
+
return matchers;
|
|
34960
|
+
}
|
|
34961
|
+
if (Array.isArray(matchers)) {
|
|
34962
|
+
return matchers.map((matcher) => convertMatcher(matcher, timeZone, noonSafe));
|
|
34963
|
+
}
|
|
34964
|
+
return convertMatcher(matchers, timeZone, noonSafe);
|
|
34965
|
+
}
|
|
34966
|
+
|
|
34266
34967
|
/**
|
|
34267
34968
|
* Renders the DayPicker calendar component.
|
|
34268
34969
|
*
|
|
@@ -34273,58 +34974,83 @@ function useSelection(props, dateLib) {
|
|
|
34273
34974
|
*/
|
|
34274
34975
|
function DayPicker(initialProps) {
|
|
34275
34976
|
let props = initialProps;
|
|
34276
|
-
|
|
34977
|
+
const timeZone = props.timeZone;
|
|
34978
|
+
if (timeZone) {
|
|
34277
34979
|
props = {
|
|
34278
34980
|
...initialProps,
|
|
34981
|
+
timeZone,
|
|
34279
34982
|
};
|
|
34280
34983
|
if (props.today) {
|
|
34281
|
-
props.today =
|
|
34984
|
+
props.today = toTimeZone(props.today, timeZone);
|
|
34282
34985
|
}
|
|
34283
34986
|
if (props.month) {
|
|
34284
|
-
props.month =
|
|
34987
|
+
props.month = toTimeZone(props.month, timeZone);
|
|
34285
34988
|
}
|
|
34286
34989
|
if (props.defaultMonth) {
|
|
34287
|
-
props.defaultMonth =
|
|
34990
|
+
props.defaultMonth = toTimeZone(props.defaultMonth, timeZone);
|
|
34288
34991
|
}
|
|
34289
34992
|
if (props.startMonth) {
|
|
34290
|
-
props.startMonth =
|
|
34993
|
+
props.startMonth = toTimeZone(props.startMonth, timeZone);
|
|
34291
34994
|
}
|
|
34292
34995
|
if (props.endMonth) {
|
|
34293
|
-
props.endMonth =
|
|
34996
|
+
props.endMonth = toTimeZone(props.endMonth, timeZone);
|
|
34294
34997
|
}
|
|
34295
34998
|
if (props.mode === "single" && props.selected) {
|
|
34296
|
-
props.selected =
|
|
34999
|
+
props.selected = toTimeZone(props.selected, timeZone);
|
|
34297
35000
|
}
|
|
34298
35001
|
else if (props.mode === "multiple" && props.selected) {
|
|
34299
|
-
props.selected = props.selected?.map((date) =>
|
|
35002
|
+
props.selected = props.selected?.map((date) => toTimeZone(date, timeZone));
|
|
34300
35003
|
}
|
|
34301
35004
|
else if (props.mode === "range" && props.selected) {
|
|
34302
35005
|
props.selected = {
|
|
34303
35006
|
from: props.selected.from
|
|
34304
|
-
?
|
|
34305
|
-
:
|
|
35007
|
+
? toTimeZone(props.selected.from, timeZone)
|
|
35008
|
+
: props.selected.from,
|
|
34306
35009
|
to: props.selected.to
|
|
34307
|
-
?
|
|
34308
|
-
:
|
|
35010
|
+
? toTimeZone(props.selected.to, timeZone)
|
|
35011
|
+
: props.selected.to,
|
|
34309
35012
|
};
|
|
34310
35013
|
}
|
|
35014
|
+
if (props.disabled !== undefined) {
|
|
35015
|
+
props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
|
|
35016
|
+
}
|
|
35017
|
+
if (props.hidden !== undefined) {
|
|
35018
|
+
props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
|
|
35019
|
+
}
|
|
35020
|
+
if (props.modifiers) {
|
|
35021
|
+
const nextModifiers = {};
|
|
35022
|
+
Object.keys(props.modifiers).forEach((key) => {
|
|
35023
|
+
nextModifiers[key] = convertMatchersToTimeZone(props.modifiers?.[key], timeZone);
|
|
35024
|
+
});
|
|
35025
|
+
props.modifiers = nextModifiers;
|
|
35026
|
+
}
|
|
34311
35027
|
}
|
|
34312
35028
|
const { components, formatters, labels, dateLib, locale, classNames } = React$5.useMemo(() => {
|
|
34313
35029
|
const locale = { ...enUS, ...props.locale };
|
|
35030
|
+
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
35031
|
+
const noonOverrides = props.noonSafe && props.timeZone
|
|
35032
|
+
? createNoonOverrides(props.timeZone, {
|
|
35033
|
+
weekStartsOn,
|
|
35034
|
+
locale,
|
|
35035
|
+
})
|
|
35036
|
+
: undefined;
|
|
35037
|
+
const overrides = props.dateLib && noonOverrides
|
|
35038
|
+
? { ...noonOverrides, ...props.dateLib }
|
|
35039
|
+
: (props.dateLib ?? noonOverrides);
|
|
34314
35040
|
const dateLib = new DateLib({
|
|
34315
35041
|
locale,
|
|
34316
|
-
weekStartsOn
|
|
35042
|
+
weekStartsOn,
|
|
34317
35043
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
34318
35044
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
34319
35045
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
34320
35046
|
timeZone: props.timeZone,
|
|
34321
35047
|
numerals: props.numerals,
|
|
34322
|
-
},
|
|
35048
|
+
}, overrides);
|
|
34323
35049
|
return {
|
|
34324
35050
|
dateLib,
|
|
34325
35051
|
components: getComponents(props.components),
|
|
34326
35052
|
formatters: getFormatters(props.formatters),
|
|
34327
|
-
labels:
|
|
35053
|
+
labels: getLabels(props.labels, dateLib.options),
|
|
34328
35054
|
locale,
|
|
34329
35055
|
classNames: { ...getDefaultClassNames(), ...props.classNames },
|
|
34330
35056
|
};
|
|
@@ -34338,11 +35064,15 @@ function DayPicker(initialProps) {
|
|
|
34338
35064
|
props.timeZone,
|
|
34339
35065
|
props.numerals,
|
|
34340
35066
|
props.dateLib,
|
|
35067
|
+
props.noonSafe,
|
|
34341
35068
|
props.components,
|
|
34342
35069
|
props.formatters,
|
|
34343
35070
|
props.labels,
|
|
34344
35071
|
props.classNames,
|
|
34345
35072
|
]);
|
|
35073
|
+
if (!props.today) {
|
|
35074
|
+
props = { ...props, today: dateLib.today() };
|
|
35075
|
+
}
|
|
34346
35076
|
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles, } = props;
|
|
34347
35077
|
const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown, } = formatters;
|
|
34348
35078
|
const calendar = useCalendar(props, dateLib);
|
|
@@ -34351,7 +35081,7 @@ function DayPicker(initialProps) {
|
|
|
34351
35081
|
const { isSelected, select, selected: selectedValue, } = useSelection(props, dateLib) ?? {};
|
|
34352
35082
|
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);
|
|
34353
35083
|
const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown, } = labels;
|
|
34354
|
-
const weekdays = React$5.useMemo(() => getWeekdays(dateLib, props.ISOWeek), [dateLib, props.ISOWeek]);
|
|
35084
|
+
const weekdays = React$5.useMemo(() => getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [dateLib, props.ISOWeek, props.broadcastCalendar, props.today]);
|
|
34355
35085
|
const isInteractive = mode !== undefined || onDayClick !== undefined;
|
|
34356
35086
|
const handlePreviousClick = React$5.useCallback(() => {
|
|
34357
35087
|
if (!previousMonth)
|
|
@@ -34369,6 +35099,9 @@ function DayPicker(initialProps) {
|
|
|
34369
35099
|
e.preventDefault();
|
|
34370
35100
|
e.stopPropagation();
|
|
34371
35101
|
setFocused(day);
|
|
35102
|
+
if (m.disabled) {
|
|
35103
|
+
return;
|
|
35104
|
+
}
|
|
34372
35105
|
select?.(day.date, m, e);
|
|
34373
35106
|
onDayClick?.(day.date, m, e);
|
|
34374
35107
|
}, [select, onDayClick, setFocused]);
|
|
@@ -34452,7 +35185,7 @@ function DayPicker(initialProps) {
|
|
|
34452
35185
|
formatters,
|
|
34453
35186
|
};
|
|
34454
35187
|
return (React__default["default"].createElement(dayPickerContext.Provider, { value: contextValue },
|
|
34455
|
-
React__default["default"].createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], ...dataAttributes },
|
|
35188
|
+
React__default["default"].createElement(components.Root, { rootRef: props.animate ? rootElRef : undefined, className: className, style: style, dir: props.dir, id: props.id, lang: props.lang ?? locale.code, nonce: props.nonce, title: props.title, role: props.role, "aria-label": props["aria-label"], "aria-labelledby": props["aria-labelledby"], ...dataAttributes },
|
|
34456
35189
|
React__default["default"].createElement(components.Months, { className: classNames[UI.Months], style: styles?.[UI.Months] },
|
|
34457
35190
|
!props.hideNavigation && !navLayout && (React__default["default"].createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : undefined, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),
|
|
34458
35191
|
months.map((calendarMonth, displayIndex) => {
|
|
@@ -34464,10 +35197,16 @@ function DayPicker(initialProps) {
|
|
|
34464
35197
|
displayIndex === 0 && (React__default["default"].createElement(components.PreviousMonthButton, { type: "button", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, "aria-disabled": previousMonth ? undefined : true, "aria-label": labelPrevious(previousMonth), onClick: handlePreviousClick, "data-animated-button": props.animate ? "true" : undefined },
|
|
34465
35198
|
React__default["default"].createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI.Chevron], orientation: props.dir === "rtl" ? "right" : "left" }))),
|
|
34466
35199
|
React__default["default"].createElement(components.MonthCaption, { "data-animated-caption": props.animate ? "true" : undefined, className: classNames[UI.MonthCaption], style: styles?.[UI.MonthCaption], calendarMonth: calendarMonth, displayIndex: displayIndex }, captionLayout?.startsWith("dropdown") ? (React__default["default"].createElement(components.DropdownNav, { className: classNames[UI.Dropdowns], style: styles?.[UI.Dropdowns] },
|
|
34467
|
-
|
|
34468
|
-
captionLayout === "dropdown
|
|
34469
|
-
|
|
34470
|
-
captionLayout === "dropdown
|
|
35200
|
+
(() => {
|
|
35201
|
+
const monthControl = captionLayout === "dropdown" ||
|
|
35202
|
+
captionLayout === "dropdown-months" ? (React__default["default"].createElement(components.MonthsDropdown, { key: "month", className: classNames[UI.MonthsDropdown], "aria-label": labelMonthDropdown(), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters, dateLib), style: styles?.[UI.Dropdown], value: dateLib.getMonth(calendarMonth.date) })) : (React__default["default"].createElement("span", { key: "month" }, formatMonthDropdown(calendarMonth.date, dateLib)));
|
|
35203
|
+
const yearControl = captionLayout === "dropdown" ||
|
|
35204
|
+
captionLayout === "dropdown-years" ? (React__default["default"].createElement(components.YearsDropdown, { key: "year", className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown(dateLib.options), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: getYearOptions(navStart, navEnd, formatters, dateLib, Boolean(props.reverseYears)), style: styles?.[UI.Dropdown], value: dateLib.getYear(calendarMonth.date) })) : (React__default["default"].createElement("span", { key: "year" }, formatYearDropdown(calendarMonth.date, dateLib)));
|
|
35205
|
+
const controls = dateLib.getMonthYearOrder() === "year-first"
|
|
35206
|
+
? [yearControl, monthControl]
|
|
35207
|
+
: [monthControl, yearControl];
|
|
35208
|
+
return controls;
|
|
35209
|
+
})(),
|
|
34471
35210
|
React__default["default"].createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
34472
35211
|
border: 0,
|
|
34473
35212
|
clip: "rect(0 0 0 0)",
|
|
@@ -34479,9 +35218,7 @@ function DayPicker(initialProps) {
|
|
|
34479
35218
|
width: "1px",
|
|
34480
35219
|
whiteSpace: "nowrap",
|
|
34481
35220
|
wordWrap: "normal",
|
|
34482
|
-
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (
|
|
34483
|
-
// biome-ignore lint/a11y/useSemanticElements: breaking change
|
|
34484
|
-
React__default["default"].createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
|
|
35221
|
+
} }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))) : (React__default["default"].createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),
|
|
34485
35222
|
navLayout === "around" &&
|
|
34486
35223
|
!props.hideNavigation &&
|
|
34487
35224
|
displayIndex === numberOfMonths - 1 && (React__default["default"].createElement(components.NextMonthButton, { type: "button", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, "aria-disabled": nextMonth ? undefined : true, "aria-label": labelNext(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : undefined },
|
|
@@ -34496,9 +35233,7 @@ function DayPicker(initialProps) {
|
|
|
34496
35233
|
weekdays.map((weekday) => (React__default["default"].createElement(components.Weekday, { "aria-label": labelWeekday(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles?.[UI.Weekday], scope: "col" }, formatWeekdayName(weekday, dateLib.options, dateLib)))))),
|
|
34497
35234
|
React__default["default"].createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : undefined, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
|
|
34498
35235
|
return (React__default["default"].createElement(components.Week, { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week: week },
|
|
34499
|
-
showWeekNumber && (
|
|
34500
|
-
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34501
|
-
React__default["default"].createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
35236
|
+
showWeekNumber && (React__default["default"].createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber(week.weekNumber, {
|
|
34502
35237
|
locale,
|
|
34503
35238
|
}), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber(week.weekNumber, dateLib))),
|
|
34504
35239
|
week.days.map((day) => {
|
|
@@ -34522,18 +35257,16 @@ function DayPicker(initialProps) {
|
|
|
34522
35257
|
const ariaLabel = !isInteractive && !modifiers.hidden
|
|
34523
35258
|
? labelGridcell(date, modifiers, dateLib.options, dateLib)
|
|
34524
35259
|
: undefined;
|
|
34525
|
-
return (
|
|
34526
|
-
|
|
34527
|
-
|
|
34528
|
-
|
|
34529
|
-
|
|
35260
|
+
return (React__default["default"].createElement(components.Day, { key: `${day.isoDate}_${day.displayMonthId}`, day: day, modifiers: modifiers, className: className.join(" "), style: style, role: "gridcell", "aria-selected": modifiers.selected || undefined, "aria-label": ariaLabel, "data-day": day.isoDate, "data-month": day.outside ? day.dateMonthId : undefined, "data-selected": modifiers.selected || undefined, "data-disabled": modifiers.disabled || undefined, "data-hidden": modifiers.hidden || undefined, "data-outside": day.outside || undefined, "data-focused": modifiers.focused || undefined, "data-today": modifiers.today || undefined }, !modifiers.hidden && isInteractive ? (React__default["default"].createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles?.[UI.DayButton], type: "button", day: day, modifiers: modifiers, disabled: (!modifiers.focused &&
|
|
35261
|
+
modifiers.disabled) ||
|
|
35262
|
+
undefined, "aria-disabled": (modifiers.focused &&
|
|
35263
|
+
modifiers.disabled) ||
|
|
35264
|
+
undefined, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay(date, dateLib.options, dateLib))) : (!modifiers.hidden &&
|
|
34530
35265
|
formatDay(day.date, dateLib.options, dateLib))));
|
|
34531
35266
|
})));
|
|
34532
35267
|
})))));
|
|
34533
35268
|
})),
|
|
34534
|
-
props.footer && (
|
|
34535
|
-
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
34536
|
-
React__default["default"].createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
35269
|
+
props.footer && (React__default["default"].createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)))));
|
|
34537
35270
|
}
|
|
34538
35271
|
|
|
34539
35272
|
function styleInject(css, ref) {
|
|
@@ -34563,7 +35296,7 @@ function styleInject(css, ref) {
|
|
|
34563
35296
|
}
|
|
34564
35297
|
}
|
|
34565
35298
|
|
|
34566
|
-
var css_248z$3 = "/* Variables declaration */\n.rdp-root {\n --rdp-accent-color: blue; /* The accent color used for selected days and UI elements. */\n --rdp-accent-background-color: #f0f0ff; /* The accent background color used for selected days and UI elements. */\n\n --rdp-day-height: 44px; /* The height of the day cells. */\n --rdp-day-width: 44px; /* The width of the day cells. */\n\n --rdp-day_button-border-radius: 100%; /* The border radius of the day cells. */\n --rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */\n --rdp-day_button-height: 42px; /* The height of the day cells. */\n --rdp-day_button-width: 42px; /* The width of the day cells. */\n\n --rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */\n --rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */\n --rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */\n --rdp-today-color: var(--rdp-accent-color); /* The color of the today's date. */\n\n --rdp-dropdown-gap: 0.5rem; /* The gap between the dropdowns used in the month captons. */\n\n --rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */\n\n --rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */\n --rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */\n --rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */\n --rdp-nav-height: 2.75rem; /* The height of the navigation bar. */\n\n --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */\n --rdp-range_middle-color: inherit; /* The color of the range text. */\n\n --rdp-range_start-color: white; /* The color of the range text. */\n --rdp-range_start-background: linear-gradient(\n var(--rdp-gradient-direction),\n transparent 50%,\n var(--rdp-range_middle-background-color) 50%\n ); /* Used for the background of the start of the selected range. */\n --rdp-range_start-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the start of the selected range. */\n\n --rdp-range_end-background: linear-gradient(\n var(--rdp-gradient-direction),\n var(--rdp-range_middle-background-color) 50%,\n transparent 50%\n ); /* Used for the background of the end of the selected range. */\n --rdp-range_end-color: white; /* The color of the range text. */\n --rdp-range_end-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the end of the selected range. */\n\n --rdp-week_number-border-radius: 100%; /* The border radius of the week number. */\n --rdp-week_number-border: 2px solid transparent; /* The border of the week number. */\n\n --rdp-week_number-height: var(--rdp-day-height); /* The height of the week number cells. */\n --rdp-week_number-opacity: 0.75; /* The opacity of the week number. */\n --rdp-week_number-width: var(--rdp-day-width); /* The width of the week number cells. */\n --rdp-weeknumber-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */\n --rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */\n --rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-gradient-direction: 90deg;\n\n --rdp-animation_duration: 0.3s;\n --rdp-animation_timing: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.rdp-root[dir=\"rtl\"] {\n --rdp-gradient-direction: -90deg;\n}\n\n.rdp-root[data-broadcast-calendar=\"true\"] {\n --rdp-outside-opacity: unset;\n}\n\n/* Root of the component. */\n.rdp-root {\n position: relative; /* Required to position the navigation toolbar. */\n box-sizing: border-box;\n}\n\n.rdp-root * {\n box-sizing: border-box;\n}\n\n.rdp-day {\n width: var(--rdp-day-width);\n height: var(--rdp-day-height);\n text-align: center;\n}\n\n.rdp-day_button {\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n justify-content: center;\n align-items: center;\n display: flex;\n\n width: var(--rdp-day_button-width);\n height: var(--rdp-day_button-height);\n border: var(--rdp-day_button-border);\n border-radius: var(--rdp-day_button-border-radius);\n}\n\n.rdp-day_button:disabled {\n cursor: revert;\n}\n\n.rdp-caption_label {\n z-index: 1;\n\n position: relative;\n display: inline-flex;\n align-items: center;\n\n white-space: nowrap;\n border: 0;\n}\n\n.rdp-dropdown:focus-visible ~ .rdp-caption_label {\n outline: 5px auto Highlight;\n /* biome-ignore lint/suspicious/noDuplicateProperties: backward compatibility */\n outline: 5px auto -webkit-focus-ring-color;\n}\n\n.rdp-button_next,\n.rdp-button_previous {\n border: none;\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n -moz-appearance: none;\n -webkit-appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n appearance: none;\n\n width: var(--rdp-nav_button-width);\n height: var(--rdp-nav_button-height);\n}\n\n.rdp-button_next:disabled,\n.rdp-button_next[aria-disabled=\"true\"],\n.rdp-button_previous:disabled,\n.rdp-button_previous[aria-disabled=\"true\"] {\n cursor: revert;\n\n opacity: var(--rdp-nav_button-disabled-opacity);\n}\n\n.rdp-chevron {\n display: inline-block;\n fill: var(--rdp-accent-color);\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-nav .rdp-chevron {\n transform: rotate(180deg);\n transform-origin: 50%;\n}\n\n.rdp-dropdowns {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: var(--rdp-dropdown-gap);\n}\n.rdp-dropdown {\n z-index: 2;\n\n /* Reset */\n opacity: 0;\n appearance: none;\n position: absolute;\n inset-block-start: 0;\n inset-block-end: 0;\n inset-inline-start: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n cursor: inherit;\n border: none;\n line-height: inherit;\n}\n\n.rdp-dropdown_root {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.rdp-dropdown_root[data-disabled=\"true\"] .rdp-chevron {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-month_caption {\n display: flex;\n align-content: center;\n height: var(--rdp-nav-height);\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month,\n.rdp-root[data-nav-layout=\"after\"] .rdp-month {\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month_caption {\n justify-content: center;\n margin-inline-start: var(--rdp-nav_button-width);\n margin-inline-end: var(--rdp-nav_button-width);\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_previous {\n position: absolute;\n inset-inline-start: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_next {\n position: absolute;\n inset-inline-end: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n justify-content: center;\n}\n\n.rdp-months {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n gap: var(--rdp-months-gap);\n max-width: fit-content;\n}\n\n.rdp-month_grid {\n border-collapse: collapse;\n}\n\n.rdp-nav {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n\n display: flex;\n align-items: center;\n\n height: var(--rdp-nav-height);\n}\n\n.rdp-weekday {\n opacity: var(--rdp-weekday-opacity);\n padding: var(--rdp-weekday-padding);\n font-weight: 500;\n font-size: smaller;\n text-align: var(--rdp-weekday-text-align);\n text-transform: var(--rdp-weekday-text-transform);\n}\n\n.rdp-week_number {\n opacity: var(--rdp-week_number-opacity);\n font-weight: 400;\n font-size: small;\n height: var(--rdp-week_number-height);\n width: var(--rdp-week_number-width);\n border: var(--rdp-week_number-border);\n border-radius: var(--rdp-week_number-border-radius);\n text-align: var(--rdp-weeknumber-text-align);\n}\n\n/* DAY MODIFIERS */\n.rdp-today:not(.rdp-outside) {\n color: var(--rdp-today-color);\n}\n\n.rdp-selected {\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-selected .rdp-day_button {\n border: var(--rdp-selected-border);\n}\n\n.rdp-outside {\n opacity: var(--rdp-outside-opacity);\n}\n\n.rdp-disabled {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-hidden {\n visibility: hidden;\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_start {\n background: var(--rdp-range_start-background);\n}\n\n.rdp-range_start .rdp-day_button {\n background-color: var(--rdp-range_start-date-background-color);\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_middle {\n background-color: var(--rdp-range_middle-background-color);\n}\n\n.rdp-range_middle .rdp-day_button {\n border: unset;\n border-radius: unset;\n color: var(--rdp-range_middle-color);\n}\n\n.rdp-range_end {\n background: var(--rdp-range_end-background);\n color: var(--rdp-range_end-color);\n}\n\n.rdp-range_end .rdp-day_button {\n color: var(--rdp-range_start-color);\n background-color: var(--rdp-range_end-date-background-color);\n}\n\n.rdp-range_start.rdp-range_end {\n background: revert;\n}\n\n.rdp-focusable {\n cursor: pointer;\n}\n\n@keyframes rdp-slide_in_left {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_in_right {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_out_left {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100%);\n }\n}\n\n@keyframes rdp-slide_out_right {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n}\n\n.rdp-weeks_before_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_before_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n@keyframes rdp-fade_in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes rdp-fade_out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.rdp-caption_after_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_after_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n";
|
|
35299
|
+
var css_248z$3 = "/* Variables declaration */\n.rdp-root {\n --rdp-accent-color: blue; /* The accent color used for selected days and UI elements. */\n --rdp-accent-background-color: #f0f0ff; /* The accent background color used for selected days and UI elements. */\n\n --rdp-day-height: 44px; /* The height of the day cells. */\n --rdp-day-width: 44px; /* The width of the day cells. */\n\n --rdp-day_button-border-radius: 100%; /* The border radius of the day cells. */\n --rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */\n --rdp-day_button-height: 42px; /* The height of the day cells. */\n --rdp-day_button-width: 42px; /* The width of the day cells. */\n\n --rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */\n --rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */\n --rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */\n --rdp-today-color: var(--rdp-accent-color); /* The color of the today's date. */\n\n --rdp-dropdown-gap: 0.5rem; /* The gap between the dropdowns used in the month captons. */\n\n --rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */\n\n --rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */\n --rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */\n --rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */\n --rdp-nav-height: 2.75rem; /* The height of the navigation bar. */\n\n --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */\n --rdp-range_middle-color: inherit; /* The color of the range text. */\n\n --rdp-range_start-color: white; /* The color of the range text. */\n --rdp-range_start-background: linear-gradient(\n var(--rdp-gradient-direction),\n transparent 50%,\n var(--rdp-range_middle-background-color) 50%\n ); /* Used for the background of the start of the selected range. */\n --rdp-range_start-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the start of the selected range. */\n\n --rdp-range_end-background: linear-gradient(\n var(--rdp-gradient-direction),\n var(--rdp-range_middle-background-color) 50%,\n transparent 50%\n ); /* Used for the background of the end of the selected range. */\n --rdp-range_end-color: white; /* The color of the range text. */\n --rdp-range_end-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the end of the selected range. */\n\n --rdp-week_number-border-radius: 100%; /* The border radius of the week number. */\n --rdp-week_number-border: 2px solid transparent; /* The border of the week number. */\n\n --rdp-week_number-height: var(--rdp-day-height); /* The height of the week number cells. */\n --rdp-week_number-opacity: 0.75; /* The opacity of the week number. */\n --rdp-week_number-width: var(--rdp-day-width); /* The width of the week number cells. */\n --rdp-weeknumber-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */\n --rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */\n --rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */\n\n --rdp-gradient-direction: 90deg;\n\n --rdp-animation_duration: 0.3s;\n --rdp-animation_timing: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.rdp-root[dir=\"rtl\"] {\n --rdp-gradient-direction: -90deg;\n}\n\n.rdp-root[data-broadcast-calendar=\"true\"] {\n --rdp-outside-opacity: unset;\n}\n\n/* Root of the component. */\n.rdp-root {\n position: relative; /* Required to position the navigation toolbar. */\n box-sizing: border-box;\n}\n\n.rdp-root * {\n box-sizing: border-box;\n}\n\n.rdp-day {\n width: var(--rdp-day-width);\n height: var(--rdp-day-height);\n text-align: center;\n}\n\n.rdp-day_button {\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n justify-content: center;\n align-items: center;\n display: flex;\n\n width: var(--rdp-day_button-width);\n height: var(--rdp-day_button-height);\n border: var(--rdp-day_button-border);\n border-radius: var(--rdp-day_button-border-radius);\n}\n\n.rdp-day_button:disabled {\n cursor: revert;\n}\n\n.rdp-caption_label {\n z-index: 1;\n\n position: relative;\n display: inline-flex;\n align-items: center;\n\n white-space: nowrap;\n border: 0;\n}\n\n.rdp-dropdown:focus-visible ~ .rdp-caption_label {\n outline: 5px auto Highlight;\n /* biome-ignore lint/suspicious/noDuplicateProperties: backward compatibility */\n outline: 5px auto -webkit-focus-ring-color;\n}\n\n.rdp-button_next,\n.rdp-button_previous {\n border: none;\n background: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font: inherit;\n color: inherit;\n -moz-appearance: none;\n -webkit-appearance: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n appearance: none;\n\n width: var(--rdp-nav_button-width);\n height: var(--rdp-nav_button-height);\n}\n\n.rdp-button_next:disabled,\n.rdp-button_next[aria-disabled=\"true\"],\n.rdp-button_previous:disabled,\n.rdp-button_previous[aria-disabled=\"true\"] {\n cursor: revert;\n\n opacity: var(--rdp-nav_button-disabled-opacity);\n}\n\n.rdp-chevron {\n display: inline-block;\n fill: var(--rdp-accent-color);\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-nav .rdp-chevron {\n transform: rotate(180deg);\n transform-origin: 50%;\n}\n\n.rdp-dropdowns {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: var(--rdp-dropdown-gap);\n}\n.rdp-dropdown {\n z-index: 2;\n\n /* Reset */\n opacity: 0;\n appearance: none;\n position: absolute;\n inset-block-start: 0;\n inset-block-end: 0;\n inset-inline-start: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n cursor: inherit;\n border: none;\n line-height: inherit;\n}\n\n.rdp-dropdown_root {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.rdp-dropdown_root[data-disabled=\"true\"] .rdp-chevron {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-month_caption {\n display: flex;\n align-content: center;\n height: var(--rdp-nav-height);\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month,\n.rdp-root[data-nav-layout=\"after\"] .rdp-month {\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-month_caption {\n justify-content: center;\n margin-inline-start: var(--rdp-nav_button-width);\n margin-inline-end: var(--rdp-nav_button-width);\n position: relative;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_previous {\n position: absolute;\n inset-inline-start: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n}\n\n.rdp-root[data-nav-layout=\"around\"] .rdp-button_next {\n position: absolute;\n inset-inline-end: 0;\n top: 0;\n height: var(--rdp-nav-height);\n display: inline-flex;\n justify-content: center;\n}\n\n.rdp-months {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n gap: var(--rdp-months-gap);\n max-width: fit-content;\n}\n\n.rdp-month_grid {\n border-collapse: collapse;\n}\n\n.rdp-nav {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n\n display: flex;\n align-items: center;\n\n height: var(--rdp-nav-height);\n}\n\n.rdp-weekday {\n opacity: var(--rdp-weekday-opacity);\n padding: var(--rdp-weekday-padding);\n font-weight: 500;\n font-size: smaller;\n text-align: var(--rdp-weekday-text-align);\n text-transform: var(--rdp-weekday-text-transform);\n}\n\n.rdp-week_number {\n opacity: var(--rdp-week_number-opacity);\n font-weight: 400;\n font-size: small;\n height: var(--rdp-week_number-height);\n width: var(--rdp-week_number-width);\n border: var(--rdp-week_number-border);\n border-radius: var(--rdp-week_number-border-radius);\n text-align: var(--rdp-weeknumber-text-align);\n}\n\n/* DAY MODIFIERS */\n.rdp-today:not(.rdp-outside) {\n color: var(--rdp-today-color);\n}\n\n.rdp-selected {\n font-weight: bold;\n font-size: large;\n}\n\n.rdp-selected .rdp-day_button {\n border: var(--rdp-selected-border);\n}\n\n.rdp-outside {\n opacity: var(--rdp-outside-opacity);\n}\n\n.rdp-disabled:not(.rdp-selected) {\n opacity: var(--rdp-disabled-opacity);\n}\n\n.rdp-hidden {\n visibility: hidden;\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_start {\n background: var(--rdp-range_start-background);\n}\n\n.rdp-range_start .rdp-day_button {\n background-color: var(--rdp-range_start-date-background-color);\n color: var(--rdp-range_start-color);\n}\n\n.rdp-range_middle {\n background-color: var(--rdp-range_middle-background-color);\n}\n\n.rdp-range_middle .rdp-day_button {\n border: unset;\n border-radius: unset;\n color: var(--rdp-range_middle-color);\n}\n\n.rdp-range_end {\n background: var(--rdp-range_end-background);\n color: var(--rdp-range_end-color);\n}\n\n.rdp-range_end .rdp-day_button {\n color: var(--rdp-range_start-color);\n background-color: var(--rdp-range_end-date-background-color);\n}\n\n.rdp-range_start.rdp-range_end {\n background: revert;\n}\n\n.rdp-focusable {\n cursor: pointer;\n}\n\n@keyframes rdp-slide_in_left {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_in_right {\n 0% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(0);\n }\n}\n\n@keyframes rdp-slide_out_left {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(-100%);\n }\n}\n\n@keyframes rdp-slide_out_right {\n 0% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(100%);\n }\n}\n\n.rdp-weeks_before_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_before_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-weeks_after_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_enter {\n animation: rdp-slide_in_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_exit {\n animation: rdp-slide_out_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_before_enter {\n animation: rdp-slide_in_right var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-root[dir=\"rtl\"] .rdp-weeks_after_exit {\n animation: rdp-slide_out_left var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n@keyframes rdp-fade_in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes rdp-fade_out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.rdp-caption_after_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_after_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_enter {\n animation: rdp-fade_in var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n\n.rdp-caption_before_exit {\n animation: rdp-fade_out var(--rdp-animation_duration)\n var(--rdp-animation_timing) forwards;\n}\n";
|
|
34567
35300
|
styleInject(css_248z$3);
|
|
34568
35301
|
|
|
34569
35302
|
var reactInputMask = {exports: {}};
|
|
@@ -39245,11 +39978,11 @@ const TableComponent = ({ idTable, dataSource, contentColumns, headerColumns, se
|
|
|
39245
39978
|
}, []);
|
|
39246
39979
|
return (jsxRuntime.jsx("div", { ref: containerRef, className: "r-gridtable", style: { maxHeight: `${height ? `${height}px` : 'auto'}` }, children: jsxRuntime.jsxs("table", { style: { width: '100%' }, role: "presentation", children: [jsxRuntime.jsx(RenderColGroup, { contentColumns: contentColumns }), jsxRuntime.jsx("thead", { className: "r-gridheader", role: "rowgroup", children: headerColumns.map((element, indexParent) => {
|
|
39247
39980
|
return (jsxRuntime.jsx("tr", { className: "r-row", role: "row", children: element?.map((col, index) => {
|
|
39248
|
-
return (jsxRuntime.jsx(HeaderTableCol, { col: col, idTable: idTable ?? '', dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: containerRef, filterBy: filterBy, orderBy: orderBy, optionsFilter: optionsFilter, allowFiltering: allowFiltering, allowSorting: allowSorting, formatSetting: formatSetting, changeFilter: (val) => {
|
|
39981
|
+
return (jsxRuntime.jsx(HeaderTableCol, { col: col, idTable: idTable ?? '', dataSource: dataSource, fieldKey: fieldKey, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: containerRef, filterBy: filterBy, orderBy: orderBy, optionsFilter: optionsFilter, allowFiltering: allowFiltering, allowSorting: allowSorting, formatSetting: formatSetting, changeFilter: (val) => {
|
|
39249
39982
|
setFilterBy([...val]);
|
|
39250
39983
|
}, changeOrder: (val) => {
|
|
39251
39984
|
setOrderBy([...val]);
|
|
39252
|
-
}, columns: contentColumns, setContentColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft
|
|
39985
|
+
}, columns: contentColumns, setContentColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft }, `header-${indexParent}-${index}`));
|
|
39253
39986
|
}) }, `header-${-indexParent}`));
|
|
39254
39987
|
}) }), jsxRuntime.jsxs("tbody", { className: "r-gridcontent", role: "rowgroup", children: [jsxRuntime.jsx("tr", { style: { height: offsetY } }), filteredData.slice(startIndex, endIndex).map((row) => {
|
|
39255
39988
|
const indexRow = row.indexRow;
|
|
@@ -39962,17 +40695,35 @@ const SettingColumn = React__default["default"].memo((props) => {
|
|
|
39962
40695
|
}) }) })] }), jsxRuntime.jsxs("div", { style: { boxShadow: '0 4px 24px 0 rgb(34 41 47 / 10%)' }, className: "d-flex justify-content-between align-items-center w-100 py-75 px-1", children: [jsxRuntime.jsx("div", { children: settingColumns?.updatedDate && (jsxRuntime.jsxs("p", { children: [jsxRuntime.jsxs("strong", { children: [t('Update date'), ": "] }), " ", jsxRuntime.jsx("span", { children: settingColumns.updatedDate ? formatDateTime(settingColumns.updatedDate, 'DD/MM/yyyy HH:mm') : '' }), jsxRuntime.jsxs("strong", { className: "ms-2", children: [t('Editor'), ": "] }), " ", jsxRuntime.jsx("span", { children: settingColumns.updatedByName })] })) }), jsxRuntime.jsxs("div", { children: [resetDefaultColumns && (jsxRuntime.jsx(Button$1$1, { color: "primary", onClick: () => messageBoxConfirm(t, handleResetColumns, {}, 'Do you want to reset the default settings?'), className: "me-1", children: t('Reset') })), jsxRuntime.jsx(Button$1$1, { color: "primary", onClick: handleSubmit, className: "me-1", children: t('Confirm') }), jsxRuntime.jsx(Button$1$1, { color: "secondary", onClick: handleCancel, outline: true, children: t('Close') })] })] })] }));
|
|
39963
40696
|
});
|
|
39964
40697
|
|
|
39965
|
-
const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, focusRow, editDisable, addDisable, buttonSetting, toolbarSetting }) => {
|
|
40698
|
+
const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, focusRow, editDisable, addDisable, buttonSetting, toolbarSetting, }) => {
|
|
39966
40699
|
const { t } = reactI18next.useTranslation();
|
|
39967
|
-
return (jsxRuntime.jsx("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: jsxRuntime.jsxs("div", { className: "r-toolbar-items", children: [jsxRuntime.jsxs("div", { className: "r-toolbar-left", children: [jsxRuntime.jsxs("div", { className: classNames$1('r-toolbar-item d-flex', {
|
|
40700
|
+
return (jsxRuntime.jsx("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: jsxRuntime.jsxs("div", { className: "r-toolbar-items", children: [jsxRuntime.jsxs("div", { className: "r-toolbar-left", children: [jsxRuntime.jsxs("div", { className: classNames$1('r-toolbar-item d-flex', {
|
|
40701
|
+
'd-none': editDisable || addDisable,
|
|
40702
|
+
}), "aria-disabled": "false", children: [jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: () => handleAdd(1), className: "d-flex", children: t('Add item') }), buttonSetting?.disableAddMulti === true && (jsxRuntime.jsxs(UncontrolledDropdown, { className: "nav-item", children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", className: "me-0 d-flex", children: jsxRuntime.jsx(Button$1$1, { type: "button", color: "success", outline: true, style: { marginLeft: -1 }, className: "px-25", children: jsxRuntime.jsx("svg", { fill: "#28c76f", height: "15", width: "20", viewBox: "0 0 20 20", children: jsxRuntime.jsx("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" }) }) }) }), jsxRuntime.jsxs(DropdownMenu$1, { className: "formula-dropdown icon-dropdown p-0", children: [jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(10), children: "10 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(20), children: "20 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(30), children: "30 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(40), children: "40 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(50), children: "50 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(100), children: "100 h\u00E0ng" }), jsxRuntime.jsx(DropdownItem$1, { className: "py-25", tag: "div", onClick: () => handleAdd(1000), children: "1000 h\u00E0ng" })] })] }))] }), (focusRow ?? -1) > -1 ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40703
|
+
'd-none': editDisable ||
|
|
40704
|
+
addDisable ||
|
|
40705
|
+
buttonSetting?.duplicateDisable,
|
|
40706
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: () => {
|
|
39968
40707
|
handleDuplicate();
|
|
39969
|
-
}, className: "d-flex", children: t('Duplicate') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40708
|
+
}, className: "d-flex", children: t('Duplicate') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40709
|
+
'd-none': editDisable ||
|
|
40710
|
+
addDisable ||
|
|
40711
|
+
buttonSetting?.insertBeforeDisable,
|
|
40712
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: handleInsertBefore, className: "d-flex", children: t('Insert item before') }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40713
|
+
'd-none': editDisable ||
|
|
40714
|
+
addDisable ||
|
|
40715
|
+
buttonSetting?.insertAfterDisable,
|
|
40716
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "success", outline: true, onClick: handleInsertAfter, className: "d-flex", children: t('Insert item after') }) })] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: " " })), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item', {
|
|
40717
|
+
'd-none': editDisable || buttonSetting?.deleteAllDisable,
|
|
40718
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsx(Button$1$1, { color: "primary", outline: true, onClick: handleDeleteAll, className: "d-flex", children: t('Delete all item') }) }), toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
39970
40719
|
return (item.align === 'left' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`)));
|
|
39971
40720
|
})] }), jsxRuntime.jsx("div", { className: "r-toolbar-center", children: toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
39972
40721
|
return (item.align === 'center' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-center-${index}`)));
|
|
39973
40722
|
}) }), jsxRuntime.jsxs("div", { className: "r-toolbar-right", children: [toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
39974
40723
|
return (item.align === 'right' && (jsxRuntime.jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-right-${index}`)));
|
|
39975
|
-
}), !toolbarSetting?.hiddenSetting && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsxRuntime.jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25', {
|
|
40724
|
+
}), !toolbarSetting?.hiddenSetting && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsxRuntime.jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsxRuntime.jsx("div", { className: classNames$1('r-toolbar-item me-25', {
|
|
40725
|
+
'd-none': editDisable || addDisable,
|
|
40726
|
+
}), "aria-disabled": "false", children: jsxRuntime.jsxs(UncontrolledDropdown, { className: "dropdown-user nav-item", children: [jsxRuntime.jsx(DropdownToggle$1, { tag: "div", color: "primary", onClick: (e) => e.preventDefault(), children: jsxRuntime.jsx(SvgInfo, { className: "cursor-pointer text-primary" }) }), jsxRuntime.jsx(DropdownMenu$1, { className: "formula-dropdown icon-dropdown", children: jsxRuntime.jsxs("ul", { className: "mb-0 pe-50", children: [jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + D \u0111\u1EC3 nh\u00E2n b\u1EA3n" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Ch\u1ECDn \u00F4 v\u00E0 Ctrl + V \u0111\u1EC3 d\u00E1n th\u00F4ng tin t\u1EEB excel" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + C \u0111\u1EC3 sao ch\u00E9p h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + V \u0111\u1EC3 d\u00E1n h\u00E0ng" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2193 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng d\u01B0\u1EDBi" }), jsxRuntime.jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2191 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng tr\u00EAn" })] }) })] }) })] }))] })] }) }));
|
|
39976
40727
|
};
|
|
39977
40728
|
|
|
39978
40729
|
const RenderToolbarTop = ({ toolbarTopOption, maximize, setMaximize }) => {
|
|
@@ -68893,7 +69644,7 @@ const UnExpandAllIcon = ({ className, color = '#7F7F7F', size = 24, onClick, sty
|
|
|
68893
69644
|
};
|
|
68894
69645
|
|
|
68895
69646
|
const RenderContentCol = React__default["default"].memo((props) => {
|
|
68896
|
-
const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, fieldKey, isMulti } = props;
|
|
69647
|
+
const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, handleCellClick, fieldKey, isMulti, } = props;
|
|
68897
69648
|
const cellId = `content-${idTable}-row${indexRow}col-${indexCol}`;
|
|
68898
69649
|
const checkOverflow = () => {
|
|
68899
69650
|
const element = document.getElementById(cellId);
|
|
@@ -68915,10 +69666,12 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
68915
69666
|
const RenderElement = () => {
|
|
68916
69667
|
if (col.field === '#' || col.type === '#') {
|
|
68917
69668
|
return (jsxRuntime.jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer text-center', {
|
|
68918
|
-
'r-active-cell': isSelected
|
|
69669
|
+
'r-active-cell': isSelected,
|
|
68919
69670
|
}), style: {
|
|
68920
|
-
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
68921
|
-
|
|
69671
|
+
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
69672
|
+
? 600
|
|
69673
|
+
: 400,
|
|
69674
|
+
fontStyle: row.haveItalicType ? 'italic' : 'normal',
|
|
68922
69675
|
}, onDoubleClick: (e) => {
|
|
68923
69676
|
e.preventDefault();
|
|
68924
69677
|
handleCloseContext();
|
|
@@ -68927,11 +69680,15 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
68927
69680
|
}
|
|
68928
69681
|
else if (col.type === 'checkbox' || col.field === 'checkbox') {
|
|
68929
69682
|
return (jsxRuntime.jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
|
|
68930
|
-
'r-active-cell': isSelected
|
|
69683
|
+
'r-active-cell': isSelected,
|
|
68931
69684
|
}), style: {
|
|
68932
69685
|
display: 'flex',
|
|
68933
|
-
justifyContent: col.textAlign === 'center'
|
|
68934
|
-
|
|
69686
|
+
justifyContent: col.textAlign === 'center'
|
|
69687
|
+
? 'center'
|
|
69688
|
+
: col.textAlign === 'right'
|
|
69689
|
+
? 'flex-end'
|
|
69690
|
+
: 'flex-start',
|
|
69691
|
+
alignItems: 'center',
|
|
68935
69692
|
}, onClick: (e) => {
|
|
68936
69693
|
setSelectedRows(toggleSelect());
|
|
68937
69694
|
e.stopPropagation();
|
|
@@ -68941,8 +69698,12 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
68941
69698
|
let value = row[col.field];
|
|
68942
69699
|
// ✅ Format dữ liệu theo loại cột
|
|
68943
69700
|
if (col.type === 'numeric') {
|
|
68944
|
-
value =
|
|
68945
|
-
|
|
69701
|
+
value =
|
|
69702
|
+
formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
|
|
69703
|
+
if (!zeroVisiable &&
|
|
69704
|
+
!col.zeroVisiable &&
|
|
69705
|
+
!(row?.sortOrder < 0 || row?.sortOrder > 100000) &&
|
|
69706
|
+
(value === '0' || value === 0)) {
|
|
68946
69707
|
value = '';
|
|
68947
69708
|
}
|
|
68948
69709
|
}
|
|
@@ -68950,31 +69711,43 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
68950
69711
|
value = value ? formatDateTime(value, formatSetting?.dateFormat) : '';
|
|
68951
69712
|
}
|
|
68952
69713
|
else if (col.type === 'datetime') {
|
|
68953
|
-
value = value
|
|
69714
|
+
value = value
|
|
69715
|
+
? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
69716
|
+
: '';
|
|
68954
69717
|
}
|
|
68955
69718
|
if (col.template) {
|
|
68956
69719
|
value = col.template(row, indexRow) ?? '';
|
|
68957
69720
|
}
|
|
68958
69721
|
const isNegative = col.type === 'numeric' && Number(row[col.field]) < 0;
|
|
68959
|
-
const textColor = isNegative
|
|
68960
|
-
|
|
68961
|
-
|
|
68962
|
-
const
|
|
69722
|
+
const textColor = isNegative
|
|
69723
|
+
? (formatSetting?.colorNegative ?? 'red')
|
|
69724
|
+
: undefined;
|
|
69725
|
+
const prefix = isNegative ? (formatSetting?.prefixNegative ?? '-') : '';
|
|
69726
|
+
const suffix = isNegative ? (formatSetting?.suffixNegative ?? '') : '';
|
|
69727
|
+
const displayText = isNegative
|
|
69728
|
+
? `${prefix}${value}${suffix}`
|
|
69729
|
+
: (value ?? '');
|
|
68963
69730
|
return (jsxRuntime.jsxs("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
|
|
68964
|
-
'r-active-cell': isSelected
|
|
69731
|
+
'r-active-cell': isSelected,
|
|
68965
69732
|
}), style: {
|
|
68966
|
-
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
68967
|
-
|
|
69733
|
+
fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
|
|
69734
|
+
? 600
|
|
69735
|
+
: 400,
|
|
69736
|
+
fontStyle: row.haveItalicType ? 'italic' : 'normal',
|
|
68968
69737
|
}, children: [jsxRuntime.jsx("div", { className: "r-cell-text", style: {
|
|
68969
69738
|
display: 'flex',
|
|
68970
|
-
justifyContent: col.textAlign === 'center'
|
|
68971
|
-
|
|
69739
|
+
justifyContent: col.textAlign === 'center'
|
|
69740
|
+
? 'center'
|
|
69741
|
+
: col.textAlign === 'right'
|
|
69742
|
+
? 'flex-end'
|
|
69743
|
+
: 'flex-start',
|
|
69744
|
+
alignItems: 'center',
|
|
68972
69745
|
}, children: jsxRuntime.jsx("div", { id: cellId, style: {
|
|
68973
69746
|
color: textColor,
|
|
68974
69747
|
overflow: 'hidden',
|
|
68975
69748
|
textOverflow: 'ellipsis',
|
|
68976
69749
|
whiteSpace: 'pre',
|
|
68977
|
-
maxWidth: '100%'
|
|
69750
|
+
maxWidth: '100%',
|
|
68978
69751
|
}, children: displayText }) }), checkOverflow() && (jsxRuntime.jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: cellId, placement: "top", children: jsxRuntime.jsx("div", { style: { color: textColor }, onClick: (e) => {
|
|
68979
69752
|
e.stopPropagation();
|
|
68980
69753
|
e.preventDefault();
|
|
@@ -68983,15 +69756,21 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
68983
69756
|
};
|
|
68984
69757
|
const clickTimerRef = React$5.useRef(null);
|
|
68985
69758
|
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 }, {
|
|
68986
|
-
'fixed-last': (col.fixedType === 'left' &&
|
|
69759
|
+
'fixed-last': (col.fixedType === 'left' &&
|
|
69760
|
+
indexCol === lastObjWidthFixLeft) ||
|
|
69761
|
+
(col.fixedType === 'right' &&
|
|
69762
|
+
indexCol === fisrtObjWidthFixRight),
|
|
68987
69763
|
}, { 'r-active': isSelected }), style: {
|
|
68988
69764
|
left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
|
|
68989
|
-
right: col.fixedType === 'right'
|
|
69765
|
+
right: col.fixedType === 'right'
|
|
69766
|
+
? objWidthFixRight[indexCol]
|
|
69767
|
+
: undefined,
|
|
68990
69768
|
}, onClick: (e) => {
|
|
68991
69769
|
const tag = e.target?.nodeName;
|
|
68992
69770
|
if (tag !== 'DIV' && tag !== 'TD') {
|
|
68993
69771
|
return;
|
|
68994
69772
|
}
|
|
69773
|
+
handleCellClick?.(row, col);
|
|
68995
69774
|
if (clickTimerRef.current) {
|
|
68996
69775
|
window.clearTimeout(clickTimerRef.current);
|
|
68997
69776
|
}
|
|
@@ -69019,7 +69798,7 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69019
69798
|
});
|
|
69020
69799
|
|
|
69021
69800
|
const TableElement = React__default["default"].memo((props) => {
|
|
69022
|
-
const { contentColumns, dataSource, fieldKey, filterBy, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, orderBy, selectedRows, setContentColumns, setSelectedRows, formatSetting, gridRef, idTable, headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, isMulti, querySetting, searchSetting, searchTerm, columnsAggregate, haveSum, expandsAll, zeroVisiable, setFilterBy, setOrderBy, setExpandsAll, handleDoubleClick, contextMenuItems, handleContextMenuClick, isLoading } = props;
|
|
69801
|
+
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;
|
|
69023
69802
|
const { t } = reactI18next.useTranslation();
|
|
69024
69803
|
const [context, setContext] = React$5.useState(null);
|
|
69025
69804
|
const virtualDivRef = React$5.useRef(null);
|
|
@@ -69065,7 +69844,10 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69065
69844
|
if (searchTerm) {
|
|
69066
69845
|
datas = datas.filter((row) => {
|
|
69067
69846
|
return searchSetting?.keyField?.some((key) => {
|
|
69068
|
-
return row[key]
|
|
69847
|
+
return row[key]
|
|
69848
|
+
?.toString()
|
|
69849
|
+
.toLowerCase()
|
|
69850
|
+
.includes(searchTerm.trim().toLowerCase());
|
|
69069
69851
|
});
|
|
69070
69852
|
});
|
|
69071
69853
|
}
|
|
@@ -69074,7 +69856,10 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69074
69856
|
return filterBy.every((filter) => {
|
|
69075
69857
|
const { key, value, ope } = filter;
|
|
69076
69858
|
const rowValue = row[key];
|
|
69077
|
-
if (rowValue === undefined ||
|
|
69859
|
+
if (rowValue === undefined ||
|
|
69860
|
+
rowValue === null ||
|
|
69861
|
+
value === undefined ||
|
|
69862
|
+
value === null) {
|
|
69078
69863
|
return false;
|
|
69079
69864
|
}
|
|
69080
69865
|
const valStr = String(rowValue).toLowerCase();
|
|
@@ -69140,56 +69925,72 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69140
69925
|
}
|
|
69141
69926
|
let value = row[col.field];
|
|
69142
69927
|
if (col.type === 'numeric') {
|
|
69143
|
-
value =
|
|
69928
|
+
value =
|
|
69929
|
+
formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
|
|
69144
69930
|
}
|
|
69145
69931
|
else if (col.type === 'date') {
|
|
69146
|
-
value = value
|
|
69932
|
+
value = value
|
|
69933
|
+
? formatDateTime(value, formatSetting?.dateFormat)
|
|
69934
|
+
: '';
|
|
69147
69935
|
}
|
|
69148
69936
|
else if (col.type === 'datetime') {
|
|
69149
|
-
value = value
|
|
69937
|
+
value = value
|
|
69938
|
+
? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
69939
|
+
: '';
|
|
69150
69940
|
}
|
|
69151
69941
|
if (col.template) {
|
|
69152
69942
|
value = col.template(row, indexRow) ?? '';
|
|
69153
69943
|
}
|
|
69154
69944
|
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: {
|
|
69155
69945
|
marginLeft: level * 20,
|
|
69156
|
-
transform: expand ? 'rotate(90deg)' : 'rotate(0deg)'
|
|
69946
|
+
transform: expand ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
69157
69947
|
}, fontSize: 15, onClick: () => {
|
|
69158
69948
|
setExpand(!expand);
|
|
69159
69949
|
setExpandsAll(undefined);
|
|
69160
69950
|
row.expand = !expand;
|
|
69161
69951
|
} }), t(col.headerDisplay ?? col.headerText ?? ''), ": ", value, " (", row.children.length, ")"] }) }), contentColumns.map((colSum, indexCol) => {
|
|
69162
|
-
if (indexCol <= firstColSpan ||
|
|
69952
|
+
if (indexCol <= firstColSpan ||
|
|
69953
|
+
colSum.visible === false ||
|
|
69954
|
+
colSum.isGroup === true) {
|
|
69163
69955
|
return;
|
|
69164
69956
|
}
|
|
69165
69957
|
let sumValue = row[colSum.field];
|
|
69166
|
-
const haveSum = row[colSum.field] !== undefined &&
|
|
69167
|
-
|
|
69958
|
+
const haveSum = row[colSum.field] !== undefined &&
|
|
69959
|
+
row[colSum.field] !== null;
|
|
69960
|
+
if (!haveSum &&
|
|
69961
|
+
colSum.haveSum === true &&
|
|
69962
|
+
colSum.type === 'numeric') {
|
|
69168
69963
|
sumValue = row.children.reduce(function (accumulator, currentValue) {
|
|
69169
|
-
return Number(accumulator ?? 0) +
|
|
69964
|
+
return (Number(accumulator ?? 0) +
|
|
69965
|
+
Number(currentValue[colSum.field] ?? 0));
|
|
69170
69966
|
}, 0);
|
|
69171
69967
|
}
|
|
69172
69968
|
if (colSum.type === 'numeric') {
|
|
69173
69969
|
sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', colSum.numericSettings?.fraction, true, false);
|
|
69174
|
-
if (!zeroVisiable &&
|
|
69970
|
+
if (!zeroVisiable &&
|
|
69971
|
+
!col.zeroVisiable &&
|
|
69972
|
+
(sumValue === '0' || sumValue === 0)) {
|
|
69175
69973
|
sumValue = '';
|
|
69176
69974
|
}
|
|
69177
69975
|
}
|
|
69178
69976
|
return (jsxRuntime.jsx("td", { className: "r-rowcell r-cell-sum-group", children: jsxRuntime.jsx("div", { className: "r-rowcell-div", style: {
|
|
69179
|
-
justifyContent: colSum.textAlign
|
|
69180
|
-
|
|
69181
|
-
|
|
69977
|
+
justifyContent: colSum.textAlign
|
|
69978
|
+
? colSum.textAlign
|
|
69979
|
+
: 'left',
|
|
69980
|
+
}, children: (haveSum || colSum.haveSum === true) &&
|
|
69981
|
+
Number(row[colSum.field] ?? '0') < 0 ? (jsxRuntime.jsxs("div", { style: {
|
|
69982
|
+
color: formatSetting?.colorNegative ?? 'red',
|
|
69182
69983
|
}, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `group-sum-cell-${level}-${indexRow}-${indexCol}`));
|
|
69183
|
-
})] }), expand && jsxRuntime.jsx(RenderContent, { datas: row.children, level: level + 1 })] }, `row-${level}-${indexRow}`));
|
|
69984
|
+
})] }), expand && (jsxRuntime.jsx(RenderContent, { datas: row.children, level: level + 1 }))] }, `row-${level}-${indexRow}`));
|
|
69184
69985
|
}
|
|
69185
69986
|
else {
|
|
69186
69987
|
const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
|
|
69187
69988
|
return (jsxRuntime.jsx("tr", { id: `row-content-${indexRow}`, "aria-rowindex": indexRow + 1, role: "row", className: classNames$1('r-row', {
|
|
69188
|
-
'r-last-row': level === 0 && indexRow === viewData.length - 1
|
|
69989
|
+
'r-last-row': level === 0 && indexRow === viewData.length - 1,
|
|
69189
69990
|
}), onContextMenu: (e) => {
|
|
69190
69991
|
e.preventDefault();
|
|
69191
69992
|
handleContextMenu(e, row);
|
|
69192
|
-
}, children: contentColumns.map((column, indexCol) => (jsxRuntime.jsx(RenderContentCol, { idTable: idTable, col: column, fieldKey: fieldKey, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, isMulti: isMulti, selectedRows: selectedRows, setSelectedRows: setSelectedRows, formatSetting: formatSetting, indexCol: indexCol, indexRow: indexRow, isSelected: isSelected, row: row, zeroVisiable: zeroVisiable, handleCloseContext: handleCloseContext, handleDoubleClick: handleDoubleClick }, indexCol))) }, `row-content-${indexRow}`));
|
|
69993
|
+
}, children: contentColumns.map((column, indexCol) => (jsxRuntime.jsx(RenderContentCol, { idTable: idTable, col: column, fieldKey: fieldKey, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, isMulti: isMulti, selectedRows: selectedRows, setSelectedRows: setSelectedRows, formatSetting: formatSetting, indexCol: indexCol, indexRow: indexRow, isSelected: isSelected, row: row, zeroVisiable: zeroVisiable, handleCloseContext: handleCloseContext, handleDoubleClick: handleDoubleClick, handleCellClick: handleCellClick }, indexCol))) }, `row-content-${indexRow}`));
|
|
69193
69994
|
}
|
|
69194
69995
|
}) }));
|
|
69195
69996
|
});
|
|
@@ -69201,7 +70002,7 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69201
70002
|
x: e.clientX,
|
|
69202
70003
|
y: e.clientY,
|
|
69203
70004
|
row,
|
|
69204
|
-
show: true
|
|
70005
|
+
show: true,
|
|
69205
70006
|
});
|
|
69206
70007
|
}, 100);
|
|
69207
70008
|
};
|
|
@@ -69225,20 +70026,28 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69225
70026
|
let sumValue = item?.value;
|
|
69226
70027
|
if (!item && col.haveSum === true && col.type === 'numeric') {
|
|
69227
70028
|
sumValue = viewData.reduce(function (accumulator, currentValue) {
|
|
69228
|
-
return Number(accumulator ?? 0) +
|
|
70029
|
+
return (Number(accumulator ?? 0) +
|
|
70030
|
+
Number(currentValue[col.field] ?? 0));
|
|
69229
70031
|
}, 0);
|
|
69230
70032
|
}
|
|
69231
70033
|
if (col.type === 'numeric') {
|
|
69232
70034
|
sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false);
|
|
69233
70035
|
}
|
|
69234
70036
|
return (jsxRuntime.jsx("td", { className: classNames$1(`p-0 px-50 r-footer fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }), style: {
|
|
69235
|
-
left: col.fixedType === 'left'
|
|
69236
|
-
|
|
69237
|
-
|
|
69238
|
-
|
|
69239
|
-
|
|
70037
|
+
left: col.fixedType === 'left'
|
|
70038
|
+
? objWidthFixLeft[indexCol]
|
|
70039
|
+
: undefined,
|
|
70040
|
+
right: col.fixedType === 'right'
|
|
70041
|
+
? objWidthFixRight[indexCol]
|
|
70042
|
+
: undefined,
|
|
70043
|
+
textAlign: col.textAlign ? col.textAlign : 'left',
|
|
70044
|
+
}, children: jsxRuntime.jsx("div", { className: "r-footer-div", children: (item || col.haveSum === true) &&
|
|
70045
|
+
Number(item?.value ?? '0') < 0 ? (jsxRuntime.jsxs("div", { style: {
|
|
70046
|
+
color: formatSetting?.colorNegative ?? 'red',
|
|
69240
70047
|
}, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `summarycell-${indexCol}`));
|
|
69241
|
-
}) })) })] }), jsxRuntime.jsx("div", { ref: virtualDivRef }), context &&
|
|
70048
|
+
}) })) })] }), jsxRuntime.jsx("div", { ref: virtualDivRef }), context &&
|
|
70049
|
+
(contextMenuItems?.length ?? 0) > 0 &&
|
|
70050
|
+
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) => {
|
|
69242
70051
|
return (jsxRuntime.jsxs("div", { className: "r-context-item", onClick: () => {
|
|
69243
70052
|
handleCloseContext();
|
|
69244
70053
|
handleContextMenuClick?.(item, context.row);
|
|
@@ -69246,7 +70055,7 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69246
70055
|
}) }) })), (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.')] }))] }));
|
|
69247
70056
|
});
|
|
69248
70057
|
|
|
69249
|
-
const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoading, formatSetting, querySetting, pagingSetting, searchSetting, columnsAggregate, toolbarSetting, selectedItem, setSelectedItem, handleSelect, saveSettingColumn, resetDefaultColumns, settingColumns, headerComponent, groupSetting, zeroVisiable, isMulti, handleDoubleClick, contextMenuItems, headerHeight, handleContextMenuClick, }) => {
|
|
70058
|
+
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, }) => {
|
|
69250
70059
|
const { t } = reactI18next.useTranslation();
|
|
69251
70060
|
const gridRef = React$5.useRef(null);
|
|
69252
70061
|
const [openPopupSetupColumn, setOpenPopupSetupColumn] = React$5.useState(false);
|
|
@@ -69473,7 +70282,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
|
|
|
69473
70282
|
}), 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: {
|
|
69474
70283
|
height: `${heightTable ? `${heightTable}px` : 'auto'}`,
|
|
69475
70284
|
position: 'relative',
|
|
69476
|
-
}, 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, 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: () => {
|
|
70285
|
+
}, 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: () => {
|
|
69477
70286
|
setOpenPopupSetupColumn(!openPopupSetupColumn);
|
|
69478
70287
|
}, settingColumns: settingColumns, openSidebar: openPopupSetupColumn, column: [...contentColumns], resetDefaultColumns: resetDefaultColumns, setColumn: (newColumns) => {
|
|
69479
70288
|
if (saveSettingColumn) {
|