@dmsi/wedgekit-react 0.0.884 → 0.0.886
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/{chunk-E7XBOMT4.js → chunk-ZXP2GIWZ.js} +81 -22
- package/dist/components/CalendarRange.cjs +133 -77
- package/dist/components/CalendarRange.css +0 -3
- package/dist/components/CalendarRange.js +3 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +119 -63
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +0 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +3 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +119 -63
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +0 -3
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +3 -3
- package/dist/components/DataGrid/PinnedColumns.cjs +122 -66
- package/dist/components/DataGrid/PinnedColumns.css +0 -3
- package/dist/components/DataGrid/PinnedColumns.js +3 -3
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +119 -63
- package/dist/components/DataGrid/TableBody/LoadingCell.css +0 -3
- package/dist/components/DataGrid/TableBody/LoadingCell.js +3 -3
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +122 -66
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +0 -3
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +3 -3
- package/dist/components/DataGrid/TableBody/index.cjs +124 -68
- package/dist/components/DataGrid/TableBody/index.css +0 -3
- package/dist/components/DataGrid/TableBody/index.js +3 -3
- package/dist/components/DataGrid/index.cjs +133 -77
- package/dist/components/DataGrid/index.css +0 -3
- package/dist/components/DataGrid/index.js +3 -3
- package/dist/components/DataGrid/utils.cjs +121 -65
- package/dist/components/DataGrid/utils.css +0 -3
- package/dist/components/DataGrid/utils.js +3 -3
- package/dist/components/DateInput.cjs +73 -17
- package/dist/components/DateInput.css +0 -3
- package/dist/components/DateInput.js +3 -3
- package/dist/components/DateRangeInput.cjs +133 -77
- package/dist/components/DateRangeInput.css +0 -3
- package/dist/components/DateRangeInput.js +3 -3
- package/dist/components/MobileDataGrid/ColumnList.css +0 -3
- package/dist/components/MobileDataGrid/ColumnList.js +1 -1
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +119 -63
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +0 -3
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +3 -3
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +1 -1
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +116 -60
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +0 -3
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +3 -3
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +1 -1
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +1 -1
- package/dist/components/MobileDataGrid/index.cjs +120 -64
- package/dist/components/MobileDataGrid/index.css +0 -3
- package/dist/components/MobileDataGrid/index.js +3 -3
- package/dist/components/index.cjs +152 -96
- package/dist/components/index.css +0 -3
- package/dist/components/index.js +3 -3
- package/dist/index.css +0 -3
- package/package.json +1 -1
|
@@ -64,6 +64,7 @@ __export(DateInput_exports, {
|
|
|
64
64
|
module.exports = __toCommonJS(DateInput_exports);
|
|
65
65
|
var import_react43 = require("react");
|
|
66
66
|
var import_react_dom4 = require("react-dom");
|
|
67
|
+
var import_clsx44 = __toESM(require("clsx"), 1);
|
|
67
68
|
|
|
68
69
|
// src/components/Input.tsx
|
|
69
70
|
var import_react = require("react");
|
|
@@ -5920,10 +5921,12 @@ var DateInput = (_a) => {
|
|
|
5920
5921
|
const popoverRef = (0, import_react43.useRef)(null);
|
|
5921
5922
|
const triggerRef = (0, import_react43.useRef)(null);
|
|
5922
5923
|
const rootRef = (0, import_react43.useRef)(null);
|
|
5924
|
+
const isMobile = useMatchesMobile();
|
|
5923
5925
|
const [calendarPosition, setCalendarPosition] = (0, import_react43.useState)({
|
|
5924
5926
|
top: 0,
|
|
5925
5927
|
left: 0,
|
|
5926
|
-
width: 0
|
|
5928
|
+
width: 0,
|
|
5929
|
+
openAbove: false
|
|
5927
5930
|
});
|
|
5928
5931
|
const [from, to] = [value, ""];
|
|
5929
5932
|
(0, import_react43.useEffect)(() => {
|
|
@@ -5939,11 +5942,28 @@ var DateInput = (_a) => {
|
|
|
5939
5942
|
const updatePosition = () => {
|
|
5940
5943
|
if (rootRef.current) {
|
|
5941
5944
|
const rect = rootRef.current.getBoundingClientRect();
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5945
|
+
const viewportWidth = window.innerWidth;
|
|
5946
|
+
const viewportHeight = window.innerHeight;
|
|
5947
|
+
const calendarWidth = 340;
|
|
5948
|
+
const calendarHeight = 400;
|
|
5949
|
+
let viewportLeft = rect.left;
|
|
5950
|
+
if (viewportLeft + calendarWidth > viewportWidth) {
|
|
5951
|
+
viewportLeft = rect.right - calendarWidth;
|
|
5952
|
+
if (viewportLeft < 0) {
|
|
5953
|
+
viewportLeft = Math.max(0, (viewportWidth - calendarWidth) / 2);
|
|
5954
|
+
}
|
|
5955
|
+
}
|
|
5956
|
+
const left = viewportLeft + window.scrollX;
|
|
5957
|
+
const spaceBelow = viewportHeight - rect.bottom;
|
|
5958
|
+
const spaceAbove = rect.top;
|
|
5959
|
+
const openAbove = spaceBelow < calendarHeight && spaceAbove > spaceBelow;
|
|
5960
|
+
let top;
|
|
5961
|
+
if (openAbove) {
|
|
5962
|
+
top = rect.top + window.scrollY - calendarHeight - 4;
|
|
5963
|
+
} else {
|
|
5964
|
+
top = rect.bottom + window.scrollY + 4;
|
|
5965
|
+
}
|
|
5966
|
+
setCalendarPosition({ top, left, width: rect.width, openAbove });
|
|
5947
5967
|
}
|
|
5948
5968
|
};
|
|
5949
5969
|
(0, import_react43.useEffect)(() => {
|
|
@@ -6026,7 +6046,10 @@ var DateInput = (_a) => {
|
|
|
6026
6046
|
if (cursorPosition > 0 && value2[cursorPosition - 1] === sep) {
|
|
6027
6047
|
event.preventDefault();
|
|
6028
6048
|
const newValue = value2.slice(0, cursorPosition - 2) + value2.slice(cursorPosition);
|
|
6029
|
-
const formattedValue = formatInputValueWithDashes(
|
|
6049
|
+
const formattedValue = formatInputValueWithDashes(
|
|
6050
|
+
newValue,
|
|
6051
|
+
dateInDashes
|
|
6052
|
+
);
|
|
6030
6053
|
setInputValue(formattedValue);
|
|
6031
6054
|
requestAnimationFrame(() => {
|
|
6032
6055
|
if (triggerRef.current) {
|
|
@@ -6077,25 +6100,58 @@ var DateInput = (_a) => {
|
|
|
6077
6100
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6078
6101
|
"div",
|
|
6079
6102
|
{
|
|
6080
|
-
className:
|
|
6103
|
+
className: (0, import_clsx44.default)(
|
|
6104
|
+
"fixed inset-0 z-50",
|
|
6105
|
+
isMobile && "overflow-y-auto bg-neutral-600/50"
|
|
6106
|
+
),
|
|
6081
6107
|
onClick: () => setVisible(false),
|
|
6082
6108
|
onMouseDown: (e) => {
|
|
6083
|
-
|
|
6109
|
+
if (!isMobile) {
|
|
6110
|
+
e.preventDefault();
|
|
6111
|
+
}
|
|
6084
6112
|
},
|
|
6085
6113
|
onWheel: (e) => {
|
|
6086
6114
|
var _a2;
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6115
|
+
if (!isMobile) {
|
|
6116
|
+
const scrollableParent = (_a2 = document.scrollingElement) != null ? _a2 : document.documentElement;
|
|
6117
|
+
scrollableParent.scrollTop += e.deltaY;
|
|
6118
|
+
scrollableParent.scrollLeft += e.deltaX;
|
|
6119
|
+
}
|
|
6090
6120
|
},
|
|
6091
6121
|
onTouchMove: (e) => {
|
|
6092
|
-
|
|
6122
|
+
if (!isMobile) {
|
|
6123
|
+
e.stopPropagation();
|
|
6124
|
+
}
|
|
6093
6125
|
},
|
|
6094
|
-
style: { touchAction: "pan-y pan-x" },
|
|
6095
|
-
"aria-hidden": "true"
|
|
6126
|
+
style: { touchAction: isMobile ? "auto" : "pan-y pan-x" },
|
|
6127
|
+
"aria-hidden": "true",
|
|
6128
|
+
children: isMobile && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "min-h-full flex items-start justify-center py-4 px-2", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6129
|
+
"div",
|
|
6130
|
+
{
|
|
6131
|
+
ref: (el) => {
|
|
6132
|
+
popoverRef.current = el;
|
|
6133
|
+
},
|
|
6134
|
+
className: "bg-white rounded-base shadow-4 max-w-full",
|
|
6135
|
+
onClick: (e) => e.stopPropagation(),
|
|
6136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6137
|
+
CalendarRange,
|
|
6138
|
+
{
|
|
6139
|
+
id: id ? `${id}-calendar` : void 0,
|
|
6140
|
+
testid: testid ? `${testid}-calendar` : void 0,
|
|
6141
|
+
from,
|
|
6142
|
+
to: to || from,
|
|
6143
|
+
onChange: handleDateChange,
|
|
6144
|
+
cardStyle: true,
|
|
6145
|
+
mode: "single",
|
|
6146
|
+
disableRange: true,
|
|
6147
|
+
isDateAvailable
|
|
6148
|
+
}
|
|
6149
|
+
)
|
|
6150
|
+
}
|
|
6151
|
+
) })
|
|
6096
6152
|
}
|
|
6097
6153
|
),
|
|
6098
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6154
|
+
!isMobile && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6099
6155
|
"div",
|
|
6100
6156
|
{
|
|
6101
6157
|
ref: (el) => {
|
|
@@ -6103,7 +6159,7 @@ var DateInput = (_a) => {
|
|
|
6103
6159
|
},
|
|
6104
6160
|
className: "absolute z-50 bg-white",
|
|
6105
6161
|
style: {
|
|
6106
|
-
top: `${calendarPosition.top
|
|
6162
|
+
top: `${calendarPosition.top}px`,
|
|
6107
6163
|
left: `${calendarPosition.left}px`
|
|
6108
6164
|
},
|
|
6109
6165
|
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DateInput
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-ZXP2GIWZ.js";
|
|
4
|
+
import "../chunk-M7INAUAJ.js";
|
|
4
5
|
import "../chunk-4DPSNQCM.js";
|
|
5
6
|
import "../chunk-Q4YDNW7N.js";
|
|
6
|
-
import "../chunk-M7INAUAJ.js";
|
|
7
7
|
import "../chunk-KOKA2IJC.js";
|
|
8
8
|
import "../chunk-MBZ55T2D.js";
|
|
9
9
|
import "../chunk-2IKT6IHB.js";
|
|
@@ -15,8 +15,8 @@ import "../chunk-3N34VVYD.js";
|
|
|
15
15
|
import "../chunk-B4AE3DCA.js";
|
|
16
16
|
import "../chunk-FP3Y5JJN.js";
|
|
17
17
|
import "../chunk-5IFPG6TS.js";
|
|
18
|
-
import "../chunk-6EYMKEJ6.js";
|
|
19
18
|
import "../chunk-AJ5M6MVX.js";
|
|
19
|
+
import "../chunk-6EYMKEJ6.js";
|
|
20
20
|
import "../chunk-YV5FS7NV.js";
|
|
21
21
|
import "../chunk-Z2HPSFEQ.js";
|
|
22
22
|
import "../chunk-AT4AWD6B.js";
|