impact-ui 5.0.0-alpha.3 → 5.0.0-alpha.5
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/_virtual/initialize.js +4 -0
- package/dist/components/DateRangePicker/dateRangePickerDropdown.d.ts.map +1 -1
- package/dist/components/DateRangePicker/dateRangePickerDropdown.js +26 -8
- package/dist/mcp-component-registry.json +8 -1
- package/dist/node_modules/react-dates/initialize.js +29 -0
- package/dist/node_modules/react-dates/lib/components/CalendarDay.js +27 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateRangePickerDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/dateRangePickerDropdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"dateRangePickerDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/dateRangePickerDropdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+C,MAAM,OAAO,CAAC;AA0BpE,wBAAgB,uBAAuB,CAAC,EACtC,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,SAAS,EACT,OAAO,EACP,eAAe,EACf,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,yBAAyB,EACzB,SAAS,EACT,eAAe,EACf,aAAa,EACb,cAAc,EACd,cAAc,EACd,OAAO,EACP,OAAO,EACP,eAAe,EACf,GAAG,IAAI,EACR,EAAE,GAAG,4BA0XL"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React__default, { useState, useEffect, useLayoutEffect } from "react";
|
|
3
3
|
import { DayPickerRangeController } from "react-dates";
|
|
4
|
-
import CalendarDay from "../../node_modules/react-dates/lib/components/CalendarDay.js";
|
|
5
4
|
import { DateRangePickerCustom } from "./dateRangePickerCustom.js";
|
|
6
5
|
import { DateRangePickerFooter } from "./dateRangePickerFooter.js";
|
|
7
6
|
import { ShowMonthYearSelect } from "./showMonthYearSelect.js";
|
|
8
7
|
import { calculatePosition, shouldHideDayForWeekAlignedMonth, formatMomentDate } from "./utils.js";
|
|
9
8
|
import { Portal } from "../Portal/index.js";
|
|
9
|
+
import("../../node_modules/react-dates/initialize.js").then((n) => n.i).catch(() => {
|
|
10
|
+
});
|
|
10
11
|
function DateRangePickerDropdown({
|
|
11
12
|
dropDownContainerRef,
|
|
12
13
|
withPortal,
|
|
@@ -46,6 +47,7 @@ function DateRangePickerDropdown({
|
|
|
46
47
|
...args
|
|
47
48
|
}) {
|
|
48
49
|
const [moment, setMoment] = useState(null);
|
|
50
|
+
const [CalendarDay, setCalendarDay] = useState(null);
|
|
49
51
|
const [position, setPosition] = useState({
|
|
50
52
|
x: 0,
|
|
51
53
|
y: 0,
|
|
@@ -67,6 +69,18 @@ function DateRangePickerDropdown({
|
|
|
67
69
|
cancelled = true;
|
|
68
70
|
};
|
|
69
71
|
}, []);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (!alignWeeksAcrossMonths) return;
|
|
74
|
+
let cancelled = false;
|
|
75
|
+
import("../../node_modules/react-dates/initialize.js").then((n) => n.i).then(() => import("../../node_modules/react-dates/lib/components/CalendarDay.js").then((n) => n.C)).then((mod) => {
|
|
76
|
+
if (!cancelled) {
|
|
77
|
+
setCalendarDay(() => mod.default);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return () => {
|
|
81
|
+
cancelled = true;
|
|
82
|
+
};
|
|
83
|
+
}, [alignWeeksAcrossMonths]);
|
|
70
84
|
const isValidDate = (date) => Boolean(date == null ? void 0 : date._isAMomentObject) && date.isValid() && (!minDate || !date.isBefore(minDate, "day")) && (!maxDate || !date.isAfter(maxDate, "day")) && !(isOutsideRange == null ? void 0 : isOutsideRange(date));
|
|
71
85
|
const hasValidRange = isValidDate(startDate) && isValidDate(endDate) && !endDate.isBefore(startDate, "day");
|
|
72
86
|
const isClearDisabled = startDate == null && endDate == null && !hasInputErrors;
|
|
@@ -99,12 +113,16 @@ function DateRangePickerDropdown({
|
|
|
99
113
|
});
|
|
100
114
|
}
|
|
101
115
|
}, [containerRef.current, dropDownContainerRef.current, withPortal, showRangeSelector]);
|
|
102
|
-
const renderCalendarDay = React__default.useCallback(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
116
|
+
const renderCalendarDay = React__default.useCallback(
|
|
117
|
+
(props) => {
|
|
118
|
+
if (props.day && shouldHideDayForWeekAlignedMonth(props.day, props.isOutsideDay)) {
|
|
119
|
+
return /* @__PURE__ */ jsx("td", { className: "CalendarDay__weekAlignedHidden", "aria-hidden": "true" });
|
|
120
|
+
}
|
|
121
|
+
if (!CalendarDay) return null;
|
|
122
|
+
return /* @__PURE__ */ jsx(CalendarDay, { ...props });
|
|
123
|
+
},
|
|
124
|
+
[CalendarDay]
|
|
125
|
+
);
|
|
108
126
|
const renderDayContents = React__default.useCallback((momentInstance, modifiers) => {
|
|
109
127
|
let currentWeek = null;
|
|
110
128
|
let currentWeekNumber = null;
|
|
@@ -170,7 +188,7 @@ function DateRangePickerDropdown({
|
|
|
170
188
|
if (endDate) return endDate;
|
|
171
189
|
return moment();
|
|
172
190
|
};
|
|
173
|
-
if (!moment) {
|
|
191
|
+
if (!moment || alignWeeksAcrossMonths && !CalendarDay) {
|
|
174
192
|
return null;
|
|
175
193
|
}
|
|
176
194
|
if (withPortal) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"generatedAt": "2026-10-
|
|
3
|
+
"generatedAt": "2026-10-12T14:31:45.632Z",
|
|
4
4
|
"components": {
|
|
5
5
|
"Menu": {
|
|
6
6
|
"title": "Components/Menu",
|
|
@@ -2535,6 +2535,13 @@
|
|
|
2535
2535
|
}
|
|
2536
2536
|
},
|
|
2537
2537
|
"storyArgs": {
|
|
2538
|
+
"AlignWeeksAcrossMonths": {
|
|
2539
|
+
"label": "Align Weeks Across Months",
|
|
2540
|
+
"alignWeeksAcrossMonths": true,
|
|
2541
|
+
"showWeekNumbers": true,
|
|
2542
|
+
"startDate": "null",
|
|
2543
|
+
"endDate": "null"
|
|
2544
|
+
},
|
|
2538
2545
|
"Default": {
|
|
2539
2546
|
"label": "Date Range Selector",
|
|
2540
2547
|
"isRequired": false,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __exports as initialize$1 } from "../../_virtual/initialize.js";
|
|
2
|
+
import "./lib/initialize.js";
|
|
3
|
+
function _mergeNamespaces(n, m) {
|
|
4
|
+
for (var i = 0; i < m.length; i++) {
|
|
5
|
+
const e = m[i];
|
|
6
|
+
if (typeof e !== "string" && !Array.isArray(e)) {
|
|
7
|
+
for (const k in e) {
|
|
8
|
+
if (k !== "default" && !(k in n)) {
|
|
9
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
+
if (d) {
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: () => e[k]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
|
|
21
|
+
}
|
|
22
|
+
const initialize = /* @__PURE__ */ _mergeNamespaces({
|
|
23
|
+
__proto__: null,
|
|
24
|
+
default: initialize$1
|
|
25
|
+
}, [initialize$1]);
|
|
26
|
+
export {
|
|
27
|
+
initialize$1 as default,
|
|
28
|
+
initialize as i
|
|
29
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs } from "../../../../_virtual/_commonjsHelpers.js";
|
|
2
|
-
import { __exports as CalendarDay$
|
|
2
|
+
import { __exports as CalendarDay$2 } from "../../../../_virtual/CalendarDay.js";
|
|
3
3
|
import require$$0 from "@babel/runtime/helpers/interopRequireDefault";
|
|
4
4
|
import { __require as requireBuild } from "../../../enzyme-shallow-equal/build/index.js";
|
|
5
5
|
import require$$2 from "@babel/runtime/helpers/extends";
|
|
@@ -18,6 +18,25 @@ import { __require as requireGetPhrasePropTypes } from "../utils/getPhrasePropTy
|
|
|
18
18
|
import { __require as requireGetCalendarDaySettings } from "../utils/getCalendarDaySettings.js";
|
|
19
19
|
import { __require as requireModifiersShape } from "../shapes/ModifiersShape.js";
|
|
20
20
|
import { __require as requireConstants } from "../constants.js";
|
|
21
|
+
function _mergeNamespaces(n, m) {
|
|
22
|
+
for (var i = 0; i < m.length; i++) {
|
|
23
|
+
const e = m[i];
|
|
24
|
+
if (typeof e !== "string" && !Array.isArray(e)) {
|
|
25
|
+
for (const k in e) {
|
|
26
|
+
if (k !== "default" && !(k in n)) {
|
|
27
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
28
|
+
if (d) {
|
|
29
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: () => e[k]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
|
|
39
|
+
}
|
|
21
40
|
(function(exports) {
|
|
22
41
|
var _interopRequireDefault = require$$0;
|
|
23
42
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -348,8 +367,13 @@ import { __require as requireConstants } from "../constants.js";
|
|
|
348
367
|
pureComponent: typeof _react["default"].PureComponent !== "undefined"
|
|
349
368
|
})(CalendarDay2);
|
|
350
369
|
exports["default"] = _default;
|
|
351
|
-
})(CalendarDay$
|
|
352
|
-
const CalendarDay = /* @__PURE__ */ getDefaultExportFromCjs(CalendarDay$
|
|
370
|
+
})(CalendarDay$2);
|
|
371
|
+
const CalendarDay = /* @__PURE__ */ getDefaultExportFromCjs(CalendarDay$2);
|
|
372
|
+
const CalendarDay$1 = /* @__PURE__ */ _mergeNamespaces({
|
|
373
|
+
__proto__: null,
|
|
374
|
+
default: CalendarDay
|
|
375
|
+
}, [CalendarDay$2]);
|
|
353
376
|
export {
|
|
377
|
+
CalendarDay$1 as C,
|
|
354
378
|
CalendarDay as default
|
|
355
379
|
};
|