@dmsi/wedgekit-react 0.0.476 → 0.0.477
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-HSJ34DOK.js → chunk-WIDUWFLX.js} +748 -34
- package/dist/components/CalendarRange.cjs +452 -152
- package/dist/components/CalendarRange.js +1 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +916 -151
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +1 -1
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +926 -161
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +1 -1
- package/dist/components/DataGrid/PinnedColumns.cjs +941 -176
- package/dist/components/DataGrid/PinnedColumns.js +1 -1
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +917 -152
- package/dist/components/DataGrid/TableBody/LoadingCell.js +1 -1
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +923 -158
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +1 -1
- package/dist/components/DataGrid/TableBody/index.cjs +938 -173
- package/dist/components/DataGrid/TableBody/index.js +1 -1
- package/dist/components/DataGrid/index.cjs +1027 -262
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/DataGrid/utils.cjs +917 -152
- package/dist/components/DataGrid/utils.js +1 -1
- package/dist/components/DateInput.js +7 -254
- package/dist/components/DateRangeInput.cjs +406 -176
- package/dist/components/DateRangeInput.js +1 -2
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +923 -158
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +1 -1
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +921 -156
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +1 -1
- package/dist/components/MobileDataGrid/index.cjs +971 -206
- package/dist/components/MobileDataGrid/index.js +1 -1
- package/dist/components/index.cjs +1145 -378
- package/dist/components/index.js +3 -1
- package/package.json +1 -1
- package/src/components/index.ts +1 -0
- package/dist/chunk-X35NLL3N.js +0 -493
|
@@ -62,8 +62,8 @@ __export(DateRangeInput_exports, {
|
|
|
62
62
|
DateRangeInput: () => DateRangeInput
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(DateRangeInput_exports);
|
|
65
|
-
var
|
|
66
|
-
var
|
|
65
|
+
var import_react40 = require("react");
|
|
66
|
+
var import_react_dom5 = require("react-dom");
|
|
67
67
|
|
|
68
68
|
// src/components/Input.tsx
|
|
69
69
|
var import_react = require("react");
|
|
@@ -729,7 +729,7 @@ Percentage.displayName = "Percentage";
|
|
|
729
729
|
|
|
730
730
|
// src/components/CalendarRange.tsx
|
|
731
731
|
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
732
|
-
var
|
|
732
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
733
733
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
734
734
|
|
|
735
735
|
// src/components/DataGridCell.tsx
|
|
@@ -4141,23 +4141,253 @@ var Tooltip = ({
|
|
|
4141
4141
|
};
|
|
4142
4142
|
Tooltip.displayName = "Tooltip";
|
|
4143
4143
|
|
|
4144
|
+
// src/components/DateInput.tsx
|
|
4145
|
+
var import_react19 = require("react");
|
|
4146
|
+
var import_react_dom3 = require("react-dom");
|
|
4147
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4148
|
+
var DateInput = (_a) => {
|
|
4149
|
+
var _b = _a, {
|
|
4150
|
+
id,
|
|
4151
|
+
testid,
|
|
4152
|
+
value,
|
|
4153
|
+
onChange,
|
|
4154
|
+
placeholder = "MM/DD/YYYY",
|
|
4155
|
+
disabled,
|
|
4156
|
+
readOnly = false,
|
|
4157
|
+
label
|
|
4158
|
+
} = _b, props = __objRest(_b, [
|
|
4159
|
+
"id",
|
|
4160
|
+
"testid",
|
|
4161
|
+
"value",
|
|
4162
|
+
"onChange",
|
|
4163
|
+
"placeholder",
|
|
4164
|
+
"disabled",
|
|
4165
|
+
"readOnly",
|
|
4166
|
+
"label"
|
|
4167
|
+
]);
|
|
4168
|
+
const [visible, setVisible] = (0, import_react19.useState)(false);
|
|
4169
|
+
const [inputValue, setInputValue] = (0, import_react19.useState)("");
|
|
4170
|
+
const [isTyping, setIsTyping] = (0, import_react19.useState)(false);
|
|
4171
|
+
const popoverRef = (0, import_react19.useRef)(null);
|
|
4172
|
+
const triggerRef = (0, import_react19.useRef)(null);
|
|
4173
|
+
const rootRef = (0, import_react19.useRef)(null);
|
|
4174
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react19.useState)({
|
|
4175
|
+
top: 0,
|
|
4176
|
+
left: 0,
|
|
4177
|
+
width: 0
|
|
4178
|
+
});
|
|
4179
|
+
const [from, to] = [value, ""];
|
|
4180
|
+
(0, import_react19.useEffect)(() => {
|
|
4181
|
+
if (!isTyping) {
|
|
4182
|
+
setInputValue(formatDisplayValue(from));
|
|
4183
|
+
}
|
|
4184
|
+
}, [from, isTyping]);
|
|
4185
|
+
(0, import_react19.useLayoutEffect)(() => {
|
|
4186
|
+
if (visible) {
|
|
4187
|
+
updatePosition();
|
|
4188
|
+
}
|
|
4189
|
+
}, [visible]);
|
|
4190
|
+
const updatePosition = () => {
|
|
4191
|
+
if (rootRef.current) {
|
|
4192
|
+
const rect = rootRef.current.getBoundingClientRect();
|
|
4193
|
+
setCalendarPosition({
|
|
4194
|
+
top: rect.bottom + window.scrollY,
|
|
4195
|
+
left: rect.left + window.scrollX,
|
|
4196
|
+
width: rect.width
|
|
4197
|
+
});
|
|
4198
|
+
}
|
|
4199
|
+
};
|
|
4200
|
+
(0, import_react19.useEffect)(() => {
|
|
4201
|
+
updatePosition();
|
|
4202
|
+
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4203
|
+
if (triggerRef.current) {
|
|
4204
|
+
resizeObserver.observe(triggerRef.current);
|
|
4205
|
+
}
|
|
4206
|
+
window.addEventListener("scroll", updatePosition);
|
|
4207
|
+
return () => {
|
|
4208
|
+
resizeObserver.disconnect();
|
|
4209
|
+
window.removeEventListener("scroll", updatePosition);
|
|
4210
|
+
};
|
|
4211
|
+
}, []);
|
|
4212
|
+
(0, import_react19.useEffect)(() => {
|
|
4213
|
+
const handleKeyDown2 = (event) => {
|
|
4214
|
+
var _a2;
|
|
4215
|
+
if (event.key === "Escape" && popoverRef.current) {
|
|
4216
|
+
setVisible(false);
|
|
4217
|
+
(_a2 = triggerRef.current) == null ? void 0 : _a2.blur();
|
|
4218
|
+
}
|
|
4219
|
+
};
|
|
4220
|
+
document.addEventListener("keydown", handleKeyDown2);
|
|
4221
|
+
return () => {
|
|
4222
|
+
document.removeEventListener("keydown", handleKeyDown2);
|
|
4223
|
+
};
|
|
4224
|
+
});
|
|
4225
|
+
(0, import_react19.useEffect)(() => {
|
|
4226
|
+
const handleClickOutside = (event) => {
|
|
4227
|
+
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4228
|
+
setVisible(false);
|
|
4229
|
+
}
|
|
4230
|
+
};
|
|
4231
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
4232
|
+
return () => {
|
|
4233
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
4234
|
+
};
|
|
4235
|
+
}, []);
|
|
4236
|
+
function handleDateChange(fromValue) {
|
|
4237
|
+
onChange(fromValue);
|
|
4238
|
+
setVisible(false);
|
|
4239
|
+
setIsTyping(false);
|
|
4240
|
+
}
|
|
4241
|
+
const handleFocus = () => {
|
|
4242
|
+
if (readOnly) return;
|
|
4243
|
+
setVisible(true);
|
|
4244
|
+
};
|
|
4245
|
+
const handleClick = () => {
|
|
4246
|
+
handleFocus();
|
|
4247
|
+
};
|
|
4248
|
+
const handleInputChange = (event) => {
|
|
4249
|
+
if (readOnly) return;
|
|
4250
|
+
const rawValue = event.target.value;
|
|
4251
|
+
const cursorPosition = event.target.selectionStart || 0;
|
|
4252
|
+
setIsTyping(true);
|
|
4253
|
+
const formattedValue = formatInputValue(rawValue);
|
|
4254
|
+
setInputValue(formattedValue);
|
|
4255
|
+
requestAnimationFrame(() => {
|
|
4256
|
+
if (triggerRef.current) {
|
|
4257
|
+
const newPosition = calculateCursorPosition(
|
|
4258
|
+
rawValue,
|
|
4259
|
+
formattedValue,
|
|
4260
|
+
cursorPosition
|
|
4261
|
+
);
|
|
4262
|
+
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
4263
|
+
}
|
|
4264
|
+
});
|
|
4265
|
+
const parsedDate = parseInputDate(formattedValue);
|
|
4266
|
+
if (parsedDate && isValidDate(parsedDate)) {
|
|
4267
|
+
onChange(parsedDate);
|
|
4268
|
+
}
|
|
4269
|
+
};
|
|
4270
|
+
const handleBlur = () => {
|
|
4271
|
+
setIsTyping(false);
|
|
4272
|
+
const parsedDate = parseInputDate(inputValue);
|
|
4273
|
+
if (!parsedDate || !isValidDate(parsedDate)) {
|
|
4274
|
+
setInputValue(formatDisplayValue(from));
|
|
4275
|
+
}
|
|
4276
|
+
};
|
|
4277
|
+
const handleKeyDown = (event) => {
|
|
4278
|
+
if (event.key === "Backspace") {
|
|
4279
|
+
const input = event.target;
|
|
4280
|
+
const cursorPosition = input.selectionStart || 0;
|
|
4281
|
+
const value2 = input.value;
|
|
4282
|
+
if (cursorPosition > 0 && value2[cursorPosition - 1] === "/") {
|
|
4283
|
+
event.preventDefault();
|
|
4284
|
+
const newValue = value2.slice(0, cursorPosition - 2) + value2.slice(cursorPosition);
|
|
4285
|
+
const formattedValue = formatInputValue(newValue);
|
|
4286
|
+
setInputValue(formattedValue);
|
|
4287
|
+
requestAnimationFrame(() => {
|
|
4288
|
+
if (triggerRef.current) {
|
|
4289
|
+
const newPosition = Math.max(0, cursorPosition - 2);
|
|
4290
|
+
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
4291
|
+
}
|
|
4292
|
+
});
|
|
4293
|
+
setIsTyping(true);
|
|
4294
|
+
return;
|
|
4295
|
+
}
|
|
4296
|
+
}
|
|
4297
|
+
if (event.key === "Enter") {
|
|
4298
|
+
const parsedDate = parseInputDate(inputValue);
|
|
4299
|
+
if (parsedDate && isValidDate(parsedDate)) {
|
|
4300
|
+
onChange(parsedDate);
|
|
4301
|
+
setVisible(false);
|
|
4302
|
+
setIsTyping(false);
|
|
4303
|
+
}
|
|
4304
|
+
}
|
|
4305
|
+
};
|
|
4306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "relative", children: [
|
|
4307
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4308
|
+
InputBase,
|
|
4309
|
+
__spreadProps(__spreadValues({
|
|
4310
|
+
id,
|
|
4311
|
+
testid,
|
|
4312
|
+
ref: (el) => {
|
|
4313
|
+
triggerRef.current = el;
|
|
4314
|
+
}
|
|
4315
|
+
}, props), {
|
|
4316
|
+
wrapperRef: rootRef,
|
|
4317
|
+
value: inputValue,
|
|
4318
|
+
placeholder,
|
|
4319
|
+
disabled,
|
|
4320
|
+
readOnly,
|
|
4321
|
+
after: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "calendar_month" }),
|
|
4322
|
+
onFocus: handleFocus,
|
|
4323
|
+
onClick: handleClick,
|
|
4324
|
+
onChange: handleInputChange,
|
|
4325
|
+
onBlur: handleBlur,
|
|
4326
|
+
onKeyDown: handleKeyDown,
|
|
4327
|
+
label,
|
|
4328
|
+
secondaryIconColor: true
|
|
4329
|
+
})
|
|
4330
|
+
),
|
|
4331
|
+
visible && !readOnly && (0, import_react_dom3.createPortal)(
|
|
4332
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4333
|
+
"div",
|
|
4334
|
+
{
|
|
4335
|
+
ref: (el) => {
|
|
4336
|
+
popoverRef.current = el;
|
|
4337
|
+
},
|
|
4338
|
+
className: "absolute z-40 bg-white",
|
|
4339
|
+
style: {
|
|
4340
|
+
top: `${calendarPosition.top + 4}px`,
|
|
4341
|
+
left: `${calendarPosition.left}px`,
|
|
4342
|
+
minWidth: `${calendarPosition.width}px`
|
|
4343
|
+
},
|
|
4344
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4345
|
+
CalendarRange,
|
|
4346
|
+
{
|
|
4347
|
+
id: id ? `${id}-calendar` : void 0,
|
|
4348
|
+
testid: testid ? `${testid}-calendar` : void 0,
|
|
4349
|
+
from,
|
|
4350
|
+
to: to || from,
|
|
4351
|
+
onChange: handleDateChange,
|
|
4352
|
+
cardStyle: true,
|
|
4353
|
+
mode: "single",
|
|
4354
|
+
disableRange: true
|
|
4355
|
+
}
|
|
4356
|
+
)
|
|
4357
|
+
}
|
|
4358
|
+
),
|
|
4359
|
+
findDocumentRoot(popoverRef.current)
|
|
4360
|
+
)
|
|
4361
|
+
] });
|
|
4362
|
+
};
|
|
4363
|
+
DateInput.displayName = "DateInput";
|
|
4364
|
+
function formatDisplayValue(from) {
|
|
4365
|
+
if (!from) {
|
|
4366
|
+
return "";
|
|
4367
|
+
}
|
|
4368
|
+
if (!isValidDate(from)) {
|
|
4369
|
+
return "";
|
|
4370
|
+
}
|
|
4371
|
+
return formatDate(from);
|
|
4372
|
+
}
|
|
4373
|
+
|
|
4144
4374
|
// src/components/Accordion.tsx
|
|
4145
4375
|
var import_clsx21 = __toESM(require("clsx"), 1);
|
|
4146
4376
|
|
|
4147
4377
|
// src/components/Card.tsx
|
|
4148
4378
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4149
|
-
var
|
|
4379
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4150
4380
|
|
|
4151
4381
|
// src/components/Stack.tsx
|
|
4152
4382
|
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
4153
|
-
var
|
|
4383
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4154
4384
|
|
|
4155
4385
|
// src/components/Accordion.tsx
|
|
4156
|
-
var
|
|
4386
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4157
4387
|
|
|
4158
4388
|
// src/components/Heading.tsx
|
|
4159
4389
|
var import_clsx22 = __toESM(require("clsx"), 1);
|
|
4160
|
-
var
|
|
4390
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4161
4391
|
var Heading = (_a) => {
|
|
4162
4392
|
var _b = _a, {
|
|
4163
4393
|
className,
|
|
@@ -4180,7 +4410,7 @@ var Heading = (_a) => {
|
|
|
4180
4410
|
]);
|
|
4181
4411
|
const defaultElement = variant === "heading1" ? "h1" : variant === "heading2" ? "h2" : "h3";
|
|
4182
4412
|
const Element = as != null ? as : defaultElement;
|
|
4183
|
-
return /* @__PURE__ */ (0,
|
|
4413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4184
4414
|
Element,
|
|
4185
4415
|
__spreadProps(__spreadValues({
|
|
4186
4416
|
id,
|
|
@@ -4201,43 +4431,43 @@ var Heading = (_a) => {
|
|
|
4201
4431
|
);
|
|
4202
4432
|
};
|
|
4203
4433
|
Heading.displayName = "Heading";
|
|
4204
|
-
var Heading1 = (props) => /* @__PURE__ */ (0,
|
|
4205
|
-
var Heading2 = (props) => /* @__PURE__ */ (0,
|
|
4206
|
-
var Heading3 = (props) => /* @__PURE__ */ (0,
|
|
4434
|
+
var Heading1 = (props) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading1" }));
|
|
4435
|
+
var Heading2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading2" }));
|
|
4436
|
+
var Heading3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading3" }));
|
|
4207
4437
|
Heading1.displayName = "Heading1";
|
|
4208
4438
|
Heading2.displayName = "Heading2";
|
|
4209
4439
|
Heading3.displayName = "Heading3";
|
|
4210
4440
|
|
|
4211
4441
|
// src/components/Theme.tsx
|
|
4212
|
-
var
|
|
4442
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4213
4443
|
|
|
4214
4444
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4215
|
-
var
|
|
4445
|
+
var import_react22 = require("react");
|
|
4216
4446
|
|
|
4217
4447
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
4218
|
-
var
|
|
4448
|
+
var import_react21 = require("react");
|
|
4219
4449
|
|
|
4220
4450
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
4221
|
-
var
|
|
4222
|
-
var GridContext = (0,
|
|
4451
|
+
var import_react20 = require("react");
|
|
4452
|
+
var GridContext = (0, import_react20.createContext)(null);
|
|
4223
4453
|
|
|
4224
4454
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4225
|
-
var
|
|
4455
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4226
4456
|
|
|
4227
4457
|
// src/components/MobileDataGrid/MobileDataGridHeader.tsx
|
|
4228
|
-
var
|
|
4458
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4229
4459
|
|
|
4230
4460
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
4231
|
-
var
|
|
4232
|
-
var
|
|
4461
|
+
var import_react23 = require("react");
|
|
4462
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4233
4463
|
|
|
4234
4464
|
// src/components/Modal.tsx
|
|
4235
4465
|
var import_clsx27 = __toESM(require("clsx"), 1);
|
|
4236
|
-
var
|
|
4466
|
+
var import_react25 = require("react");
|
|
4237
4467
|
|
|
4238
4468
|
// src/components/ModalHeader.tsx
|
|
4239
4469
|
var import_clsx23 = __toESM(require("clsx"), 1);
|
|
4240
|
-
var
|
|
4470
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4241
4471
|
var ModalHeader = ({
|
|
4242
4472
|
title,
|
|
4243
4473
|
hideCloseIcon,
|
|
@@ -4248,7 +4478,7 @@ var ModalHeader = ({
|
|
|
4248
4478
|
testid,
|
|
4249
4479
|
headerClassname
|
|
4250
4480
|
}) => {
|
|
4251
|
-
return /* @__PURE__ */ (0,
|
|
4481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4252
4482
|
"div",
|
|
4253
4483
|
{
|
|
4254
4484
|
id,
|
|
@@ -4263,9 +4493,9 @@ var ModalHeader = ({
|
|
|
4263
4493
|
headerClassname
|
|
4264
4494
|
),
|
|
4265
4495
|
children: [
|
|
4266
|
-
/* @__PURE__ */ (0,
|
|
4496
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0, import_clsx23.default)("flex items-center flex-1", layoutGroupGap), children: [
|
|
4267
4497
|
headerIcon,
|
|
4268
|
-
title && /* @__PURE__ */ (0,
|
|
4498
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4269
4499
|
Heading2,
|
|
4270
4500
|
{
|
|
4271
4501
|
id: id ? `${id}-title` : void 0,
|
|
@@ -4275,7 +4505,7 @@ var ModalHeader = ({
|
|
|
4275
4505
|
}
|
|
4276
4506
|
)
|
|
4277
4507
|
] }),
|
|
4278
|
-
!hideCloseIcon && /* @__PURE__ */ (0,
|
|
4508
|
+
!hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4279
4509
|
Button,
|
|
4280
4510
|
{
|
|
4281
4511
|
id: id ? `${id}-close-button` : void 0,
|
|
@@ -4283,7 +4513,7 @@ var ModalHeader = ({
|
|
|
4283
4513
|
iconOnly: true,
|
|
4284
4514
|
variant: "tertiary",
|
|
4285
4515
|
onClick: onClose,
|
|
4286
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
4516
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { name: "close", size: 24 }) })
|
|
4287
4517
|
}
|
|
4288
4518
|
)
|
|
4289
4519
|
]
|
|
@@ -4294,14 +4524,14 @@ ModalHeader.displayName = "ModalHeader";
|
|
|
4294
4524
|
|
|
4295
4525
|
// src/components/ModalContent.tsx
|
|
4296
4526
|
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
4297
|
-
var
|
|
4527
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4298
4528
|
function ModalContent({
|
|
4299
4529
|
fixedHeightScrolling,
|
|
4300
4530
|
children,
|
|
4301
4531
|
id,
|
|
4302
4532
|
testid
|
|
4303
4533
|
}) {
|
|
4304
|
-
return /* @__PURE__ */ (0,
|
|
4534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4305
4535
|
"div",
|
|
4306
4536
|
{
|
|
4307
4537
|
id,
|
|
@@ -4319,7 +4549,7 @@ ModalContent.displayName = "ModalContent";
|
|
|
4319
4549
|
|
|
4320
4550
|
// src/components/ModalButtons.tsx
|
|
4321
4551
|
var import_clsx25 = __toESM(require("clsx"), 1);
|
|
4322
|
-
var
|
|
4552
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4323
4553
|
var ModalButtons = ({
|
|
4324
4554
|
onClose,
|
|
4325
4555
|
onContinue,
|
|
@@ -4327,7 +4557,7 @@ var ModalButtons = ({
|
|
|
4327
4557
|
id,
|
|
4328
4558
|
testid
|
|
4329
4559
|
}) => {
|
|
4330
|
-
return /* @__PURE__ */ (0,
|
|
4560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4331
4561
|
"div",
|
|
4332
4562
|
{
|
|
4333
4563
|
id,
|
|
@@ -4337,26 +4567,26 @@ var ModalButtons = ({
|
|
|
4337
4567
|
layoutPaddding,
|
|
4338
4568
|
layoutGroupGap
|
|
4339
4569
|
),
|
|
4340
|
-
children: customActions != null ? customActions : /* @__PURE__ */ (0,
|
|
4341
|
-
/* @__PURE__ */ (0,
|
|
4570
|
+
children: customActions != null ? customActions : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
4571
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4342
4572
|
Button,
|
|
4343
4573
|
{
|
|
4344
4574
|
id: id ? `${id}-close-button` : void 0,
|
|
4345
4575
|
testid: testid ? `${testid}-close-button` : void 0,
|
|
4346
4576
|
variant: "secondary",
|
|
4347
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
4577
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { name: "close", size: 24 }),
|
|
4348
4578
|
onClick: onClose,
|
|
4349
4579
|
className: "max-sm:w-full",
|
|
4350
4580
|
children: "Close"
|
|
4351
4581
|
}
|
|
4352
4582
|
),
|
|
4353
|
-
/* @__PURE__ */ (0,
|
|
4583
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4354
4584
|
Button,
|
|
4355
4585
|
{
|
|
4356
4586
|
id: id ? `${id}-continue-button` : void 0,
|
|
4357
4587
|
testid: testid ? `${testid}-continue-button` : void 0,
|
|
4358
4588
|
variant: "primary",
|
|
4359
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
4589
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { name: "check", size: 24 }),
|
|
4360
4590
|
className: "max-sm:w-full",
|
|
4361
4591
|
onClick: onContinue,
|
|
4362
4592
|
children: "Continue"
|
|
@@ -4370,7 +4600,7 @@ ModalButtons.displayName = "ModalButtons";
|
|
|
4370
4600
|
|
|
4371
4601
|
// src/components/ModalScrim.tsx
|
|
4372
4602
|
var import_clsx26 = __toESM(require("clsx"), 1);
|
|
4373
|
-
var
|
|
4603
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4374
4604
|
var ModalScrim = ({
|
|
4375
4605
|
show = false,
|
|
4376
4606
|
size = "small",
|
|
@@ -4380,7 +4610,7 @@ var ModalScrim = ({
|
|
|
4380
4610
|
id,
|
|
4381
4611
|
testid
|
|
4382
4612
|
}) => {
|
|
4383
|
-
return /* @__PURE__ */ (0,
|
|
4613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4384
4614
|
"div",
|
|
4385
4615
|
{
|
|
4386
4616
|
id,
|
|
@@ -4401,14 +4631,14 @@ var ModalScrim = ({
|
|
|
4401
4631
|
ModalScrim.displayName = "ModalScrim";
|
|
4402
4632
|
|
|
4403
4633
|
// src/components/Modal.tsx
|
|
4404
|
-
var
|
|
4634
|
+
var import_react_dom4 = require("react-dom");
|
|
4405
4635
|
var import_react_use = require("react-use");
|
|
4406
4636
|
|
|
4407
4637
|
// src/components/useMounted.tsx
|
|
4408
|
-
var
|
|
4638
|
+
var import_react24 = require("react");
|
|
4409
4639
|
var useMounted = () => {
|
|
4410
|
-
const [isMounted, setIsMounted] = (0,
|
|
4411
|
-
(0,
|
|
4640
|
+
const [isMounted, setIsMounted] = (0, import_react24.useState)(false);
|
|
4641
|
+
(0, import_react24.useEffect)(() => {
|
|
4412
4642
|
setIsMounted(true);
|
|
4413
4643
|
return () => setIsMounted(false);
|
|
4414
4644
|
}, []);
|
|
@@ -4416,7 +4646,7 @@ var useMounted = () => {
|
|
|
4416
4646
|
};
|
|
4417
4647
|
|
|
4418
4648
|
// src/components/Modal.tsx
|
|
4419
|
-
var
|
|
4649
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4420
4650
|
var fadeInScale = (element, duration = 300) => element.animate(
|
|
4421
4651
|
[
|
|
4422
4652
|
{ opacity: 0, transform: "scale(0.95)" },
|
|
@@ -4500,12 +4730,12 @@ var Modal = ({
|
|
|
4500
4730
|
}) => {
|
|
4501
4731
|
var _a;
|
|
4502
4732
|
const mounted = useMounted();
|
|
4503
|
-
const modalRef = (0,
|
|
4504
|
-
const bgRef = (0,
|
|
4733
|
+
const modalRef = (0, import_react25.useRef)(null);
|
|
4734
|
+
const bgRef = (0, import_react25.useRef)(null);
|
|
4505
4735
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
4506
4736
|
const isMobile = useMatchesMobile();
|
|
4507
4737
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
4508
|
-
(0,
|
|
4738
|
+
(0, import_react25.useEffect)(() => {
|
|
4509
4739
|
if (!mounted) return;
|
|
4510
4740
|
if (!modalRef.current || !bgRef.current) {
|
|
4511
4741
|
console.error("Modal or background reference is not set.");
|
|
@@ -4525,7 +4755,7 @@ var Modal = ({
|
|
|
4525
4755
|
bgFadeIn(bgRef.current);
|
|
4526
4756
|
}
|
|
4527
4757
|
}, [mounted, onClose, open, wasOpen]);
|
|
4528
|
-
const handleKeyDown = (0,
|
|
4758
|
+
const handleKeyDown = (0, import_react25.useCallback)(
|
|
4529
4759
|
(e) => {
|
|
4530
4760
|
if (e.key === "Escape") {
|
|
4531
4761
|
if (onClose) {
|
|
@@ -4536,12 +4766,12 @@ var Modal = ({
|
|
|
4536
4766
|
},
|
|
4537
4767
|
[onClose]
|
|
4538
4768
|
);
|
|
4539
|
-
const handleClose = (0,
|
|
4769
|
+
const handleClose = (0, import_react25.useCallback)(() => {
|
|
4540
4770
|
if (onClose) {
|
|
4541
4771
|
onClose();
|
|
4542
4772
|
}
|
|
4543
4773
|
}, [onClose]);
|
|
4544
|
-
(0,
|
|
4774
|
+
(0, import_react25.useEffect)(() => {
|
|
4545
4775
|
if (open) {
|
|
4546
4776
|
document.addEventListener("keyup", handleKeyDown);
|
|
4547
4777
|
}
|
|
@@ -4549,7 +4779,7 @@ var Modal = ({
|
|
|
4549
4779
|
document.removeEventListener("keyup", handleKeyDown);
|
|
4550
4780
|
};
|
|
4551
4781
|
}, [open, handleKeyDown]);
|
|
4552
|
-
(0,
|
|
4782
|
+
(0, import_react25.useEffect)(() => {
|
|
4553
4783
|
if (!open) return;
|
|
4554
4784
|
const scrollY = window.scrollY;
|
|
4555
4785
|
const body = document.body;
|
|
@@ -4570,7 +4800,7 @@ var Modal = ({
|
|
|
4570
4800
|
};
|
|
4571
4801
|
}, [open]);
|
|
4572
4802
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
4573
|
-
const backgroundClickHandler = (0,
|
|
4803
|
+
const backgroundClickHandler = (0, import_react25.useCallback)(
|
|
4574
4804
|
(e) => {
|
|
4575
4805
|
const target = e.target;
|
|
4576
4806
|
const currentTarget = e.currentTarget;
|
|
@@ -4587,8 +4817,8 @@ var Modal = ({
|
|
|
4587
4817
|
if (!mounted) {
|
|
4588
4818
|
return null;
|
|
4589
4819
|
}
|
|
4590
|
-
return (0,
|
|
4591
|
-
/* @__PURE__ */ (0,
|
|
4820
|
+
return (0, import_react_dom4.createPortal)(
|
|
4821
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4592
4822
|
ModalScrim,
|
|
4593
4823
|
{
|
|
4594
4824
|
id: id ? `${id}-scrim` : void 0,
|
|
@@ -4597,7 +4827,7 @@ var Modal = ({
|
|
|
4597
4827
|
ref: bgRef,
|
|
4598
4828
|
show: open,
|
|
4599
4829
|
onClick: backgroundClickHandler,
|
|
4600
|
-
children: /* @__PURE__ */ (0,
|
|
4830
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4601
4831
|
"div",
|
|
4602
4832
|
{
|
|
4603
4833
|
id,
|
|
@@ -4612,7 +4842,7 @@ var Modal = ({
|
|
|
4612
4842
|
),
|
|
4613
4843
|
onClick: (e) => e.stopPropagation(),
|
|
4614
4844
|
children: [
|
|
4615
|
-
/* @__PURE__ */ (0,
|
|
4845
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4616
4846
|
ModalHeader,
|
|
4617
4847
|
{
|
|
4618
4848
|
id: id ? `${id}-header` : void 0,
|
|
@@ -4625,7 +4855,7 @@ var Modal = ({
|
|
|
4625
4855
|
headerClassname
|
|
4626
4856
|
}
|
|
4627
4857
|
),
|
|
4628
|
-
children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0,
|
|
4858
|
+
children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4629
4859
|
ModalContent,
|
|
4630
4860
|
{
|
|
4631
4861
|
id: id ? `${id}-content` : void 0,
|
|
@@ -4634,7 +4864,7 @@ var Modal = ({
|
|
|
4634
4864
|
children
|
|
4635
4865
|
}
|
|
4636
4866
|
) : children,
|
|
4637
|
-
showButtons ? customFooter ? customActions : /* @__PURE__ */ (0,
|
|
4867
|
+
showButtons ? customFooter ? customActions : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4638
4868
|
ModalButtons,
|
|
4639
4869
|
{
|
|
4640
4870
|
id: id ? `${id}-buttons` : void 0,
|
|
@@ -4655,51 +4885,51 @@ var Modal = ({
|
|
|
4655
4885
|
Modal.displayName = "Modal";
|
|
4656
4886
|
|
|
4657
4887
|
// src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx
|
|
4658
|
-
var
|
|
4888
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4659
4889
|
|
|
4660
4890
|
// src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx
|
|
4661
|
-
var
|
|
4891
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4662
4892
|
|
|
4663
4893
|
// src/components/MobileDataGrid/RowDetailModalProvider/index.tsx
|
|
4664
|
-
var
|
|
4894
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4665
4895
|
|
|
4666
4896
|
// src/components/MobileDataGrid/ColumnList.tsx
|
|
4667
4897
|
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
4668
4898
|
|
|
4669
4899
|
// src/components/MobileDataGrid/MobileDataGridCard/index.tsx
|
|
4670
4900
|
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
4671
|
-
var
|
|
4901
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4672
4902
|
|
|
4673
4903
|
// src/components/MobileDataGrid/ColumnList.tsx
|
|
4674
|
-
var
|
|
4904
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4675
4905
|
|
|
4676
4906
|
// src/components/MobileDataGrid/index.tsx
|
|
4677
|
-
var
|
|
4907
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4678
4908
|
|
|
4679
4909
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
4680
|
-
var
|
|
4910
|
+
var import_react27 = require("react");
|
|
4681
4911
|
|
|
4682
4912
|
// src/components/ImagePlaceholder.tsx
|
|
4683
|
-
var
|
|
4684
|
-
var
|
|
4913
|
+
var import_react26 = require("react");
|
|
4914
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4685
4915
|
|
|
4686
4916
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
4687
|
-
var
|
|
4917
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4688
4918
|
|
|
4689
4919
|
// src/components/Grid.tsx
|
|
4690
4920
|
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
4691
|
-
var
|
|
4921
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4692
4922
|
|
|
4693
4923
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
4694
|
-
var
|
|
4695
|
-
var
|
|
4924
|
+
var import_react28 = require("react");
|
|
4925
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4696
4926
|
|
|
4697
4927
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
4698
|
-
var
|
|
4928
|
+
var import_react29 = require("react");
|
|
4699
4929
|
|
|
4700
4930
|
// src/components/Surface.tsx
|
|
4701
4931
|
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
4702
|
-
var
|
|
4932
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4703
4933
|
var Surface = (_a) => {
|
|
4704
4934
|
var _b = _a, {
|
|
4705
4935
|
children,
|
|
@@ -4712,7 +4942,7 @@ var Surface = (_a) => {
|
|
|
4712
4942
|
"elevation",
|
|
4713
4943
|
"id"
|
|
4714
4944
|
]);
|
|
4715
|
-
return /* @__PURE__ */ (0,
|
|
4945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4716
4946
|
"div",
|
|
4717
4947
|
__spreadProps(__spreadValues({
|
|
4718
4948
|
id,
|
|
@@ -4733,43 +4963,43 @@ var Surface = (_a) => {
|
|
|
4733
4963
|
Surface.displayName = "Surface";
|
|
4734
4964
|
|
|
4735
4965
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
4736
|
-
var
|
|
4966
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4737
4967
|
|
|
4738
4968
|
// src/components/ProductImagePreview/CarouselPagination.tsx
|
|
4739
4969
|
var import_clsx32 = require("clsx");
|
|
4740
|
-
var
|
|
4970
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4741
4971
|
|
|
4742
4972
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
4743
|
-
var
|
|
4744
|
-
var
|
|
4973
|
+
var import_react30 = require("react");
|
|
4974
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4745
4975
|
|
|
4746
4976
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
4747
|
-
var
|
|
4977
|
+
var import_react31 = require("react");
|
|
4748
4978
|
|
|
4749
4979
|
// src/components/ProductImagePreview/index.tsx
|
|
4750
|
-
var
|
|
4980
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4751
4981
|
|
|
4752
4982
|
// src/components/CompactImagesPreview.tsx
|
|
4753
|
-
var
|
|
4983
|
+
var import_react32 = require("react");
|
|
4754
4984
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
4755
|
-
var
|
|
4985
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4756
4986
|
|
|
4757
4987
|
// src/components/SimpleTable.tsx
|
|
4758
4988
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
4759
|
-
var
|
|
4989
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4760
4990
|
|
|
4761
4991
|
// src/components/PDFViewer/index.tsx
|
|
4762
|
-
var
|
|
4992
|
+
var import_react35 = require("react");
|
|
4763
4993
|
|
|
4764
4994
|
// src/components/PDFViewer/PDFElement.tsx
|
|
4765
4995
|
var import_react_pdf2 = require("@mikecousins/react-pdf");
|
|
4766
|
-
var
|
|
4996
|
+
var import_react34 = require("react");
|
|
4767
4997
|
|
|
4768
4998
|
// src/components/Spinner.tsx
|
|
4769
|
-
var
|
|
4999
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4770
5000
|
var Spinner = ({ size = "small", testid }) => {
|
|
4771
5001
|
const dimension = size === "large" ? 48 : 24;
|
|
4772
|
-
return /* @__PURE__ */ (0,
|
|
5002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
4773
5003
|
"svg",
|
|
4774
5004
|
{
|
|
4775
5005
|
"data-testid": testid,
|
|
@@ -4781,14 +5011,14 @@ var Spinner = ({ size = "small", testid }) => {
|
|
|
4781
5011
|
className: "spinner",
|
|
4782
5012
|
"aria-label": "Loading",
|
|
4783
5013
|
children: [
|
|
4784
|
-
/* @__PURE__ */ (0,
|
|
4785
|
-
/* @__PURE__ */ (0,
|
|
4786
|
-
/* @__PURE__ */ (0,
|
|
4787
|
-
/* @__PURE__ */ (0,
|
|
4788
|
-
/* @__PURE__ */ (0,
|
|
4789
|
-
/* @__PURE__ */ (0,
|
|
4790
|
-
/* @__PURE__ */ (0,
|
|
4791
|
-
/* @__PURE__ */ (0,
|
|
5014
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1" }),
|
|
5015
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125" }),
|
|
5016
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25" }),
|
|
5017
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375" }),
|
|
5018
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5" }),
|
|
5019
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625" }),
|
|
5020
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75" }),
|
|
5021
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875" })
|
|
4792
5022
|
]
|
|
4793
5023
|
}
|
|
4794
5024
|
);
|
|
@@ -4797,31 +5027,31 @@ Spinner.displayName = "Spinner";
|
|
|
4797
5027
|
|
|
4798
5028
|
// src/components/PDFViewer/PDFPage.tsx
|
|
4799
5029
|
var import_react_pdf = require("@mikecousins/react-pdf");
|
|
4800
|
-
var
|
|
4801
|
-
var
|
|
5030
|
+
var import_react33 = require("react");
|
|
5031
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4802
5032
|
|
|
4803
5033
|
// src/components/PDFViewer/PDFElement.tsx
|
|
4804
5034
|
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
4805
|
-
var
|
|
5035
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4806
5036
|
|
|
4807
5037
|
// src/components/PDFViewer/DownloadIcon.tsx
|
|
4808
|
-
var
|
|
5038
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4809
5039
|
|
|
4810
5040
|
// src/components/PDFViewer/PDFNavigation.tsx
|
|
4811
|
-
var
|
|
5041
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4812
5042
|
|
|
4813
5043
|
// src/components/PDFViewer/index.tsx
|
|
4814
|
-
var
|
|
5044
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4815
5045
|
|
|
4816
5046
|
// src/components/ListGroup.tsx
|
|
4817
|
-
var
|
|
5047
|
+
var import_react36 = require("react");
|
|
4818
5048
|
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
4819
|
-
var
|
|
5049
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4820
5050
|
|
|
4821
5051
|
// src/components/Pagination.tsx
|
|
4822
|
-
var
|
|
5052
|
+
var import_react37 = require("react");
|
|
4823
5053
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
4824
|
-
var
|
|
5054
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4825
5055
|
var Pagination = ({
|
|
4826
5056
|
totalPages,
|
|
4827
5057
|
currentPage,
|
|
@@ -4831,7 +5061,7 @@ var Pagination = ({
|
|
|
4831
5061
|
className,
|
|
4832
5062
|
disabled
|
|
4833
5063
|
}) => {
|
|
4834
|
-
const goTo = (0,
|
|
5064
|
+
const goTo = (0, import_react37.useCallback)(
|
|
4835
5065
|
(page) => {
|
|
4836
5066
|
if (disabled) return;
|
|
4837
5067
|
onPageChange(page);
|
|
@@ -4848,7 +5078,7 @@ var Pagination = ({
|
|
|
4848
5078
|
goTo(currentPage + 1);
|
|
4849
5079
|
}
|
|
4850
5080
|
};
|
|
4851
|
-
const pageTokens = (0,
|
|
5081
|
+
const pageTokens = (0, import_react37.useMemo)(() => {
|
|
4852
5082
|
if (totalPages <= 5) {
|
|
4853
5083
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
4854
5084
|
}
|
|
@@ -4896,7 +5126,7 @@ var Pagination = ({
|
|
|
4896
5126
|
"focus:bg-background-grouped-secondary-normal focus:outline-0",
|
|
4897
5127
|
"disabled:bg-transparent disabled:text-text-action-primary-disabled"
|
|
4898
5128
|
);
|
|
4899
|
-
return /* @__PURE__ */ (0,
|
|
5129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
4900
5130
|
"nav",
|
|
4901
5131
|
{
|
|
4902
5132
|
id,
|
|
@@ -4911,19 +5141,19 @@ var Pagination = ({
|
|
|
4911
5141
|
className
|
|
4912
5142
|
),
|
|
4913
5143
|
children: [
|
|
4914
|
-
/* @__PURE__ */ (0,
|
|
5144
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4915
5145
|
"button",
|
|
4916
5146
|
{
|
|
4917
5147
|
disabled: disabled || currentPage <= 1,
|
|
4918
5148
|
"aria-label": "Previous page",
|
|
4919
5149
|
onClick: () => goTo(currentPage - 1),
|
|
4920
5150
|
className: (0, import_clsx37.default)(buttonClass, "border-r-1 border-border-primary-normal"),
|
|
4921
|
-
children: /* @__PURE__ */ (0,
|
|
5151
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: "keyboard_arrow_left" })
|
|
4922
5152
|
}
|
|
4923
5153
|
),
|
|
4924
|
-
/* @__PURE__ */ (0,
|
|
5154
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("ul", { className: (0, import_clsx37.default)("flex items-center"), children: pageTokens.map((token, index) => {
|
|
4925
5155
|
if (token === "ellipsis") {
|
|
4926
|
-
return /* @__PURE__ */ (0,
|
|
5156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4927
5157
|
"li",
|
|
4928
5158
|
{
|
|
4929
5159
|
className: "w-8 h-8 select-none text-text-action-primary-disabled",
|
|
@@ -4933,7 +5163,7 @@ var Pagination = ({
|
|
|
4933
5163
|
);
|
|
4934
5164
|
}
|
|
4935
5165
|
const selected = token === currentPage;
|
|
4936
|
-
return /* @__PURE__ */ (0,
|
|
5166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4937
5167
|
"button",
|
|
4938
5168
|
{
|
|
4939
5169
|
"aria-label": `Page ${token}`,
|
|
@@ -4944,18 +5174,18 @@ var Pagination = ({
|
|
|
4944
5174
|
buttonClass,
|
|
4945
5175
|
selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
|
|
4946
5176
|
),
|
|
4947
|
-
children: /* @__PURE__ */ (0,
|
|
5177
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Subheader, { align: "center", weight: "bold", children: token })
|
|
4948
5178
|
}
|
|
4949
5179
|
) }, token);
|
|
4950
5180
|
}) }),
|
|
4951
|
-
/* @__PURE__ */ (0,
|
|
5181
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4952
5182
|
"button",
|
|
4953
5183
|
{
|
|
4954
5184
|
disabled: disabled || currentPage >= totalPages,
|
|
4955
5185
|
"aria-label": "Next page",
|
|
4956
5186
|
onClick: () => goTo(currentPage + 1),
|
|
4957
5187
|
className: (0, import_clsx37.default)(buttonClass, "border-l-1 border-border-primary-normal"),
|
|
4958
|
-
children: /* @__PURE__ */ (0,
|
|
5188
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: "keyboard_arrow_right" })
|
|
4959
5189
|
}
|
|
4960
5190
|
)
|
|
4961
5191
|
]
|
|
@@ -4965,18 +5195,18 @@ var Pagination = ({
|
|
|
4965
5195
|
Pagination.displayName = "Pagination";
|
|
4966
5196
|
|
|
4967
5197
|
// src/components/SkeletonParagraph.tsx
|
|
4968
|
-
var
|
|
5198
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4969
5199
|
|
|
4970
5200
|
// src/components/EmptyCartIcon.tsx
|
|
4971
|
-
var
|
|
5201
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4972
5202
|
|
|
4973
5203
|
// src/components/Alert.tsx
|
|
4974
5204
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
4975
|
-
var
|
|
4976
|
-
var
|
|
5205
|
+
var import_react38 = require("react");
|
|
5206
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4977
5207
|
|
|
4978
5208
|
// src/components/CalendarRange.tsx
|
|
4979
|
-
var
|
|
5209
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4980
5210
|
function DateCell(_a) {
|
|
4981
5211
|
var _b = _a, {
|
|
4982
5212
|
date,
|
|
@@ -5011,7 +5241,7 @@ function DateCell(_a) {
|
|
|
5011
5241
|
"id",
|
|
5012
5242
|
"testid"
|
|
5013
5243
|
]);
|
|
5014
|
-
return /* @__PURE__ */ (0,
|
|
5244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5015
5245
|
"span",
|
|
5016
5246
|
__spreadProps(__spreadValues({}, props), {
|
|
5017
5247
|
id,
|
|
@@ -5086,20 +5316,20 @@ function CalendarRange({
|
|
|
5086
5316
|
const fromDate = parseDate(from);
|
|
5087
5317
|
const toDate = parseDate(to);
|
|
5088
5318
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
5089
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
5319
|
+
const [baseMonth, setBaseMonth] = (0, import_react39.useState)(
|
|
5090
5320
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
5091
5321
|
);
|
|
5092
|
-
const [selecting, setSelecting] = (0,
|
|
5093
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
5094
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
5095
|
-
(0,
|
|
5322
|
+
const [selecting, setSelecting] = (0, import_react39.useState)("from");
|
|
5323
|
+
const [pendingFrom, setPendingFrom] = (0, import_react39.useState)(void 0);
|
|
5324
|
+
const [hoveredDate, setHoveredDate] = (0, import_react39.useState)(void 0);
|
|
5325
|
+
(0, import_react39.useEffect)(() => {
|
|
5096
5326
|
if (fromDate) {
|
|
5097
5327
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
5098
5328
|
} else if (toDate) {
|
|
5099
5329
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
5100
5330
|
}
|
|
5101
5331
|
}, [from, to]);
|
|
5102
|
-
(0,
|
|
5332
|
+
(0, import_react39.useEffect)(() => {
|
|
5103
5333
|
if (fromDate && toDate) {
|
|
5104
5334
|
setSelecting("from");
|
|
5105
5335
|
setPendingFrom(void 0);
|
|
@@ -5165,7 +5395,7 @@ function CalendarRange({
|
|
|
5165
5395
|
}
|
|
5166
5396
|
return false;
|
|
5167
5397
|
}
|
|
5168
|
-
return /* @__PURE__ */ (0,
|
|
5398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5169
5399
|
"div",
|
|
5170
5400
|
{
|
|
5171
5401
|
id,
|
|
@@ -5178,7 +5408,7 @@ function CalendarRange({
|
|
|
5178
5408
|
// baseTransition,
|
|
5179
5409
|
"overflow-hidden"
|
|
5180
5410
|
),
|
|
5181
|
-
children: /* @__PURE__ */ (0,
|
|
5411
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5182
5412
|
"div",
|
|
5183
5413
|
{
|
|
5184
5414
|
className: (0, import_clsx39.default)(
|
|
@@ -5186,7 +5416,7 @@ function CalendarRange({
|
|
|
5186
5416
|
layoutGap
|
|
5187
5417
|
),
|
|
5188
5418
|
children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
|
|
5189
|
-
return /* @__PURE__ */ (0,
|
|
5419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5190
5420
|
CalendarPane,
|
|
5191
5421
|
{
|
|
5192
5422
|
getMonthData,
|
|
@@ -5244,20 +5474,20 @@ function CalendarPane({
|
|
|
5244
5474
|
const years = Array.from({ length: 100 }).map(
|
|
5245
5475
|
(_, i) => baseMonth.year - 50 + i
|
|
5246
5476
|
);
|
|
5247
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
5248
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
5249
|
-
const monthMenuRef = (0,
|
|
5250
|
-
const yearMenuRef = (0,
|
|
5477
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react39.useState)(false);
|
|
5478
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react39.useState)(false);
|
|
5479
|
+
const monthMenuRef = (0, import_react39.useRef)(null);
|
|
5480
|
+
const yearMenuRef = (0, import_react39.useRef)(null);
|
|
5251
5481
|
const month = getMonthData(offset);
|
|
5252
5482
|
const totalCells = 42;
|
|
5253
5483
|
const emptyCells = month.firstDayOffset;
|
|
5254
|
-
return /* @__PURE__ */ (0,
|
|
5255
|
-
/* @__PURE__ */ (0,
|
|
5484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_react39.default.Fragment, { children: [
|
|
5485
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
5256
5486
|
"div",
|
|
5257
5487
|
{
|
|
5258
5488
|
className: (0, import_clsx39.default)("flex flex-col"),
|
|
5259
5489
|
children: [
|
|
5260
|
-
/* @__PURE__ */ (0,
|
|
5490
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
5261
5491
|
"div",
|
|
5262
5492
|
{
|
|
5263
5493
|
className: (0, import_clsx39.default)(
|
|
@@ -5266,7 +5496,7 @@ function CalendarPane({
|
|
|
5266
5496
|
"text-text-action-primary-normal"
|
|
5267
5497
|
),
|
|
5268
5498
|
children: [
|
|
5269
|
-
idx === 0 ? /* @__PURE__ */ (0,
|
|
5499
|
+
idx === 0 ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5270
5500
|
"button",
|
|
5271
5501
|
{
|
|
5272
5502
|
id: id ? `${id}-prev-month-button` : void 0,
|
|
@@ -5278,11 +5508,11 @@ function CalendarPane({
|
|
|
5278
5508
|
),
|
|
5279
5509
|
"aria-label": "Previous month",
|
|
5280
5510
|
onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
|
|
5281
|
-
children: /* @__PURE__ */ (0,
|
|
5511
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Icon, { name: "chevron_left", size: 24 })
|
|
5282
5512
|
}
|
|
5283
|
-
) : /* @__PURE__ */ (0,
|
|
5284
|
-
/* @__PURE__ */ (0,
|
|
5285
|
-
/* @__PURE__ */ (0,
|
|
5513
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: (0, import_clsx39.default)(componentPadding, "mr-1") }),
|
|
5514
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex gap-desktop-compact-component-padding", children: [
|
|
5515
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5286
5516
|
"button",
|
|
5287
5517
|
{
|
|
5288
5518
|
ref: (el) => {
|
|
@@ -5297,13 +5527,13 @@ function CalendarPane({
|
|
|
5297
5527
|
children: month.name
|
|
5298
5528
|
}
|
|
5299
5529
|
),
|
|
5300
|
-
/* @__PURE__ */ (0,
|
|
5530
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5301
5531
|
Menu,
|
|
5302
5532
|
{
|
|
5303
5533
|
show: monthMenuOpen,
|
|
5304
5534
|
positionTo: monthMenuRef,
|
|
5305
5535
|
setShow: () => setMonthMenuOpen(false),
|
|
5306
|
-
children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0,
|
|
5536
|
+
children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5307
5537
|
MenuOption,
|
|
5308
5538
|
{
|
|
5309
5539
|
selected: baseMonth.month === x + 1,
|
|
@@ -5317,7 +5547,7 @@ function CalendarPane({
|
|
|
5317
5547
|
))
|
|
5318
5548
|
}
|
|
5319
5549
|
),
|
|
5320
|
-
/* @__PURE__ */ (0,
|
|
5550
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5321
5551
|
"button",
|
|
5322
5552
|
{
|
|
5323
5553
|
ref: (el) => {
|
|
@@ -5332,13 +5562,13 @@ function CalendarPane({
|
|
|
5332
5562
|
children: month.year
|
|
5333
5563
|
}
|
|
5334
5564
|
),
|
|
5335
|
-
/* @__PURE__ */ (0,
|
|
5565
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5336
5566
|
Menu,
|
|
5337
5567
|
{
|
|
5338
5568
|
show: yearMenuOpen,
|
|
5339
5569
|
positionTo: yearMenuRef,
|
|
5340
5570
|
setShow: () => setYearMenuOpen(false),
|
|
5341
|
-
children: years.map((y) => /* @__PURE__ */ (0,
|
|
5571
|
+
children: years.map((y) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5342
5572
|
MenuOption,
|
|
5343
5573
|
{
|
|
5344
5574
|
selected: baseMonth.year === y,
|
|
@@ -5353,7 +5583,7 @@ function CalendarPane({
|
|
|
5353
5583
|
}
|
|
5354
5584
|
)
|
|
5355
5585
|
] }),
|
|
5356
|
-
(mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0,
|
|
5586
|
+
(mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5357
5587
|
"button",
|
|
5358
5588
|
{
|
|
5359
5589
|
id: id ? `${id}-next-month-button` : void 0,
|
|
@@ -5365,13 +5595,13 @@ function CalendarPane({
|
|
|
5365
5595
|
),
|
|
5366
5596
|
"aria-label": "Next month",
|
|
5367
5597
|
onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
|
|
5368
|
-
children: /* @__PURE__ */ (0,
|
|
5598
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Icon, { name: "chevron_right", size: 24 })
|
|
5369
5599
|
}
|
|
5370
|
-
) : /* @__PURE__ */ (0,
|
|
5600
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: (0, import_clsx39.default)(componentPadding, "ml-1") })
|
|
5371
5601
|
]
|
|
5372
5602
|
}
|
|
5373
5603
|
),
|
|
5374
|
-
/* @__PURE__ */ (0,
|
|
5604
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: (0, import_clsx39.default)("grid grid-cols-7"), children: weekDays.map((d) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5375
5605
|
"span",
|
|
5376
5606
|
{
|
|
5377
5607
|
className: (0, import_clsx39.default)(
|
|
@@ -5383,7 +5613,7 @@ function CalendarPane({
|
|
|
5383
5613
|
},
|
|
5384
5614
|
d
|
|
5385
5615
|
)) }),
|
|
5386
|
-
/* @__PURE__ */ (0,
|
|
5616
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: (0, import_clsx39.default)("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
|
|
5387
5617
|
const day = i - emptyCells + 1;
|
|
5388
5618
|
const date = month.date.with({ day: 1 }).add({
|
|
5389
5619
|
days: i - emptyCells
|
|
@@ -5397,7 +5627,7 @@ function CalendarPane({
|
|
|
5397
5627
|
const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
|
|
5398
5628
|
const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
|
|
5399
5629
|
const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
|
|
5400
|
-
return /* @__PURE__ */ (0,
|
|
5630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5401
5631
|
DateCell,
|
|
5402
5632
|
{
|
|
5403
5633
|
id: id ? `${id}-date-${date.toString()}` : void 0,
|
|
@@ -5422,7 +5652,7 @@ function CalendarPane({
|
|
|
5422
5652
|
]
|
|
5423
5653
|
}
|
|
5424
5654
|
),
|
|
5425
|
-
mode === "double" && idx === 0 && /* @__PURE__ */ (0,
|
|
5655
|
+
mode === "double" && idx === 0 && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5426
5656
|
"div",
|
|
5427
5657
|
{
|
|
5428
5658
|
className: (0, import_clsx39.default)(
|
|
@@ -5436,7 +5666,7 @@ function CalendarPane({
|
|
|
5436
5666
|
}
|
|
5437
5667
|
|
|
5438
5668
|
// src/components/DateRangeInput.tsx
|
|
5439
|
-
var
|
|
5669
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5440
5670
|
var DateRangeInput = (_a) => {
|
|
5441
5671
|
var _b = _a, {
|
|
5442
5672
|
id,
|
|
@@ -5461,27 +5691,27 @@ var DateRangeInput = (_a) => {
|
|
|
5461
5691
|
"disableRange",
|
|
5462
5692
|
"label"
|
|
5463
5693
|
]);
|
|
5464
|
-
const [visible, setVisible] = (0,
|
|
5465
|
-
const [inputValue, setInputValue] = (0,
|
|
5466
|
-
const [isTyping, setIsTyping] = (0,
|
|
5467
|
-
const popoverRef = (0,
|
|
5468
|
-
const rootRef = (0,
|
|
5469
|
-
const triggerRef = (0,
|
|
5470
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
5694
|
+
const [visible, setVisible] = (0, import_react40.useState)(false);
|
|
5695
|
+
const [inputValue, setInputValue] = (0, import_react40.useState)("");
|
|
5696
|
+
const [isTyping, setIsTyping] = (0, import_react40.useState)(false);
|
|
5697
|
+
const popoverRef = (0, import_react40.useRef)(null);
|
|
5698
|
+
const rootRef = (0, import_react40.useRef)(null);
|
|
5699
|
+
const triggerRef = (0, import_react40.useRef)(null);
|
|
5700
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react40.useState)({
|
|
5471
5701
|
top: 0,
|
|
5472
5702
|
left: 0,
|
|
5473
5703
|
width: 0
|
|
5474
5704
|
});
|
|
5475
5705
|
const [from, to] = value.split("|");
|
|
5476
|
-
(0,
|
|
5706
|
+
(0, import_react40.useEffect)(() => {
|
|
5477
5707
|
if (!isTyping) {
|
|
5478
|
-
const displayValue =
|
|
5708
|
+
const displayValue = formatDisplayValue2(from, to);
|
|
5479
5709
|
if (displayValue) {
|
|
5480
5710
|
setInputValue(displayValue);
|
|
5481
5711
|
}
|
|
5482
5712
|
}
|
|
5483
5713
|
}, [from, to, isTyping, disableRange]);
|
|
5484
|
-
(0,
|
|
5714
|
+
(0, import_react40.useLayoutEffect)(() => {
|
|
5485
5715
|
if (visible) {
|
|
5486
5716
|
updatePosition();
|
|
5487
5717
|
}
|
|
@@ -5496,7 +5726,7 @@ var DateRangeInput = (_a) => {
|
|
|
5496
5726
|
});
|
|
5497
5727
|
}
|
|
5498
5728
|
};
|
|
5499
|
-
(0,
|
|
5729
|
+
(0, import_react40.useEffect)(() => {
|
|
5500
5730
|
updatePosition();
|
|
5501
5731
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
5502
5732
|
if (triggerRef.current) {
|
|
@@ -5508,7 +5738,7 @@ var DateRangeInput = (_a) => {
|
|
|
5508
5738
|
window.removeEventListener("scroll", updatePosition);
|
|
5509
5739
|
};
|
|
5510
5740
|
}, []);
|
|
5511
|
-
(0,
|
|
5741
|
+
(0, import_react40.useEffect)(() => {
|
|
5512
5742
|
const handleKeyDown2 = (event) => {
|
|
5513
5743
|
var _a2;
|
|
5514
5744
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -5521,7 +5751,7 @@ var DateRangeInput = (_a) => {
|
|
|
5521
5751
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
5522
5752
|
};
|
|
5523
5753
|
}, []);
|
|
5524
|
-
(0,
|
|
5754
|
+
(0, import_react40.useEffect)(() => {
|
|
5525
5755
|
const handleClickOutside = (event) => {
|
|
5526
5756
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
5527
5757
|
setVisible(false);
|
|
@@ -5658,7 +5888,7 @@ var DateRangeInput = (_a) => {
|
|
|
5658
5888
|
if (disableRange) {
|
|
5659
5889
|
const parsedDate = parseInputDate(inputValue);
|
|
5660
5890
|
if (!parsedDate || !isValidDate(parsedDate)) {
|
|
5661
|
-
const lastValidValue =
|
|
5891
|
+
const lastValidValue = formatDisplayValue2(from, to);
|
|
5662
5892
|
setInputValue(lastValidValue || "");
|
|
5663
5893
|
}
|
|
5664
5894
|
} else {
|
|
@@ -5856,8 +6086,8 @@ var DateRangeInput = (_a) => {
|
|
|
5856
6086
|
}
|
|
5857
6087
|
}
|
|
5858
6088
|
};
|
|
5859
|
-
return /* @__PURE__ */ (0,
|
|
5860
|
-
/* @__PURE__ */ (0,
|
|
6089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
6090
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5861
6091
|
InputBase,
|
|
5862
6092
|
__spreadProps(__spreadValues({
|
|
5863
6093
|
id,
|
|
@@ -5871,7 +6101,7 @@ var DateRangeInput = (_a) => {
|
|
|
5871
6101
|
placeholder: disableRange ? "MM/DD/YYYY" : placeholder,
|
|
5872
6102
|
disabled,
|
|
5873
6103
|
readOnly,
|
|
5874
|
-
after: /* @__PURE__ */ (0,
|
|
6104
|
+
after: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Icon, { name: "calendar_month" }),
|
|
5875
6105
|
onFocus: handleFocus,
|
|
5876
6106
|
onClick: handleClick,
|
|
5877
6107
|
onChange: handleInputChange,
|
|
@@ -5881,8 +6111,8 @@ var DateRangeInput = (_a) => {
|
|
|
5881
6111
|
secondaryIconColor: true
|
|
5882
6112
|
})
|
|
5883
6113
|
),
|
|
5884
|
-
visible && !readOnly && (0,
|
|
5885
|
-
/* @__PURE__ */ (0,
|
|
6114
|
+
visible && !readOnly && (0, import_react_dom5.createPortal)(
|
|
6115
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5886
6116
|
"div",
|
|
5887
6117
|
{
|
|
5888
6118
|
ref: (el) => {
|
|
@@ -5894,7 +6124,7 @@ var DateRangeInput = (_a) => {
|
|
|
5894
6124
|
left: `${calendarPosition.left}px`,
|
|
5895
6125
|
minWidth: `${calendarPosition.width}px`
|
|
5896
6126
|
},
|
|
5897
|
-
children: /* @__PURE__ */ (0,
|
|
6127
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5898
6128
|
CalendarRange,
|
|
5899
6129
|
{
|
|
5900
6130
|
id: id ? `${id}-calendar` : void 0,
|
|
@@ -5915,7 +6145,7 @@ var DateRangeInput = (_a) => {
|
|
|
5915
6145
|
function formatInputValue2(value2) {
|
|
5916
6146
|
return formatInputValueHelper(value2, disableRange);
|
|
5917
6147
|
}
|
|
5918
|
-
function
|
|
6148
|
+
function formatDisplayValue2(from2, to2) {
|
|
5919
6149
|
return formatDisplayValueHelper(from2, to2, disableRange);
|
|
5920
6150
|
}
|
|
5921
6151
|
};
|