akeyless-client-commons 1.1.94 → 1.1.95
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/components/index.css.map +1 -1
- package/dist/components/index.d.mts +15 -2
- package/dist/components/index.d.ts +15 -2
- package/dist/components/index.js +248 -129
- package/dist/components/index.mjs +234 -119
- package/dist/types/index.d.mts +14 -2
- package/dist/types/index.d.ts +14 -2
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -440,6 +440,9 @@ __export(index_exports, {
|
|
|
440
440
|
ConfirmForm: function() {
|
|
441
441
|
return ConfirmForm;
|
|
442
442
|
},
|
|
443
|
+
DateInputContainer: function() {
|
|
444
|
+
return DateInputContainer;
|
|
445
|
+
},
|
|
443
446
|
DatePicker: function() {
|
|
444
447
|
return DatePicker;
|
|
445
448
|
},
|
|
@@ -5972,6 +5975,7 @@ function useDeepCompareEffect(effect, dependencies) {
|
|
|
5972
5975
|
}
|
|
5973
5976
|
// src/components/forms/ModularForm/formElements.tsx
|
|
5974
5977
|
var import_react15 = require("react");
|
|
5978
|
+
var import_react_aria_components2 = require("react-aria-components");
|
|
5975
5979
|
// src/components/forms/ModularForm/InternationalPhonePicker.tsx
|
|
5976
5980
|
var import_lucide_react5 = require("lucide-react");
|
|
5977
5981
|
var import_react13 = require("react");
|
|
@@ -6162,7 +6166,44 @@ var FlagComponent = function(param) {
|
|
|
6162
6166
|
});
|
|
6163
6167
|
};
|
|
6164
6168
|
// src/components/forms/ModularForm/formElements.tsx
|
|
6169
|
+
var import_react_aria_components3 = require("react-aria-components");
|
|
6170
|
+
// src/components/ui/datefield-rac.tsx
|
|
6171
|
+
var import_react_aria_components = require("react-aria-components");
|
|
6165
6172
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
6173
|
+
function DateSegment(_param) {
|
|
6174
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
6175
|
+
"className"
|
|
6176
|
+
]);
|
|
6177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_aria_components.DateSegment, _object_spread_props(_object_spread({
|
|
6178
|
+
className: (0, import_react_aria_components.composeRenderProps)(className, function(className2) {
|
|
6179
|
+
return cn("inline rounded p-0.5 text-foreground caret-transparent outline-hidden data-invalid:data-focused:bg-destructive data-focused:data-placeholder:text-foreground data-invalid:data-focused:text-white data-invalid:data-placeholder:text-destructive data-disabled:cursor-not-allowed data-focused:bg-accent data-[type=literal]:px-0 data-[type=literal]:text-muted-foreground/70 data-focused:text-foreground data-invalid:data-focused:data-placeholder:text-white data-invalid:text-destructive data-placeholder:text-muted-foreground/70 data-disabled:opacity-50", className2);
|
|
6180
|
+
})
|
|
6181
|
+
}, props), {
|
|
6182
|
+
"data-invalid": true
|
|
6183
|
+
}));
|
|
6184
|
+
}
|
|
6185
|
+
var dateInputStyle = "relative inline-flex h-9 w-full items-center overflow-hidden whitespace-nowrap rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none data-focus-within:border-ring data-focus-within:ring-ring/50 data-focus-within:ring-[3px] data-focus-within:has-aria-invalid:ring-destructive/20 dark:data-focus-within:has-aria-invalid:ring-destructive/40 data-focus-within:has-aria-invalid:border-destructive";
|
|
6186
|
+
function DateInput(_param) {
|
|
6187
|
+
var className = _param.className, _param_unstyled = _param.unstyled, unstyled = _param_unstyled === void 0 ? false : _param_unstyled, props = _object_without_properties(_param, [
|
|
6188
|
+
"className",
|
|
6189
|
+
"unstyled"
|
|
6190
|
+
]);
|
|
6191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_aria_components.DateInput, _object_spread_props(_object_spread({
|
|
6192
|
+
className: (0, import_react_aria_components.composeRenderProps)(className, function(className2) {
|
|
6193
|
+
return cn(!unstyled && dateInputStyle, className2);
|
|
6194
|
+
})
|
|
6195
|
+
}, props), {
|
|
6196
|
+
children: function(segment) {
|
|
6197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DateSegment, {
|
|
6198
|
+
segment: segment
|
|
6199
|
+
});
|
|
6200
|
+
}
|
|
6201
|
+
}));
|
|
6202
|
+
}
|
|
6203
|
+
// src/components/forms/ModularForm/formElements.tsx
|
|
6204
|
+
var import_lucide_react6 = require("lucide-react");
|
|
6205
|
+
var import_date = require("@internationalized/date");
|
|
6206
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
6166
6207
|
var defaultFormElementContainerClassName = "flex justify-start items-center gap-3 w-full";
|
|
6167
6208
|
var defaultFormElementBorderClassName = "border-[1px] border-gray-300 hover:border-black rounded-sm";
|
|
6168
6209
|
var useSortValues = function(options, sortDirection, sortAsNumber) {
|
|
@@ -6220,8 +6261,8 @@ var InputContainer = function(param) {
|
|
|
6220
6261
|
labelStyle,
|
|
6221
6262
|
elementsCommonClassName
|
|
6222
6263
|
]);
|
|
6223
|
-
return /* @__PURE__ */ (0,
|
|
6224
|
-
children: /* @__PURE__ */ (0,
|
|
6264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6265
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, props), {
|
|
6225
6266
|
title: title,
|
|
6226
6267
|
minLength: minLength,
|
|
6227
6268
|
placeholder: placeholder,
|
|
@@ -6239,6 +6280,109 @@ var InputContainer = function(param) {
|
|
|
6239
6280
|
}))
|
|
6240
6281
|
}));
|
|
6241
6282
|
};
|
|
6283
|
+
var DateInputContainer = function(param) {
|
|
6284
|
+
var _param_name = param.name, name = _param_name === void 0 ? "" : _param_name, _param_labelContent = param.labelContent, labelContent = _param_labelContent === void 0 ? "" : _param_labelContent, _param_defaultValue = param.defaultValue, defaultValue = _param_defaultValue === void 0 ? "" : _param_defaultValue, _param_containerClassName = param.containerClassName, containerClassName = _param_containerClassName === void 0 ? "" : _param_containerClassName, _param_labelClassName = param.labelClassName, labelClassName = _param_labelClassName === void 0 ? "" : _param_labelClassName, _param_elementClassName = param.elementClassName, elementClassName = _param_elementClassName === void 0 ? "" : _param_elementClassName, _param_required = param.required, required = _param_required === void 0 ? false : _param_required, placeholder = param.placeholder, props = param.props, onKeyDown = param.onKeyDown, onChange = param.onChange, direction = param.direction, value = param.value, labelWithDots = param.labelWithDots, labelsCommonClassName = param.labelsCommonClassName, elementsCommonClassName = param.elementsCommonClassName, title = param.title, labelStyle = param.labelStyle, _param_calendarIconClassName = param.calendarIconClassName, calendarIconClassName = _param_calendarIconClassName === void 0 ? "" : _param_calendarIconClassName;
|
|
6285
|
+
var containerProps = (0, import_react15.useMemo)(function() {
|
|
6286
|
+
return {
|
|
6287
|
+
containerClassName: containerClassName,
|
|
6288
|
+
direction: direction,
|
|
6289
|
+
labelClassName: labelClassName,
|
|
6290
|
+
labelContent: labelContent,
|
|
6291
|
+
labelWithDots: labelWithDots,
|
|
6292
|
+
labelsCommonClassName: labelsCommonClassName,
|
|
6293
|
+
name: name,
|
|
6294
|
+
required: required,
|
|
6295
|
+
labelStyle: labelStyle,
|
|
6296
|
+
elementsCommonClassName: elementsCommonClassName
|
|
6297
|
+
};
|
|
6298
|
+
}, [
|
|
6299
|
+
containerClassName,
|
|
6300
|
+
direction,
|
|
6301
|
+
labelClassName,
|
|
6302
|
+
labelContent,
|
|
6303
|
+
labelWithDots,
|
|
6304
|
+
labelsCommonClassName,
|
|
6305
|
+
name,
|
|
6306
|
+
required,
|
|
6307
|
+
labelStyle,
|
|
6308
|
+
elementsCommonClassName
|
|
6309
|
+
]);
|
|
6310
|
+
var getDefaultValue = function(dateStr) {
|
|
6311
|
+
if (dateStr) {
|
|
6312
|
+
try {
|
|
6313
|
+
return (0, import_date.parseDate)(dateStr);
|
|
6314
|
+
} catch (e) {
|
|
6315
|
+
return (0, import_date.today)((0, import_date.getLocalTimeZone)());
|
|
6316
|
+
}
|
|
6317
|
+
}
|
|
6318
|
+
return (0, import_date.today)((0, import_date.getLocalTimeZone)());
|
|
6319
|
+
};
|
|
6320
|
+
var handleDateChange = (0, import_react15.useCallback)(function(date) {
|
|
6321
|
+
if (!onChange) {
|
|
6322
|
+
return;
|
|
6323
|
+
}
|
|
6324
|
+
var valueStr = date ? date.toString() : "";
|
|
6325
|
+
var syntheticEvent = {
|
|
6326
|
+
target: {
|
|
6327
|
+
name: name,
|
|
6328
|
+
value: valueStr
|
|
6329
|
+
}
|
|
6330
|
+
};
|
|
6331
|
+
onChange(syntheticEvent);
|
|
6332
|
+
}, [
|
|
6333
|
+
onChange,
|
|
6334
|
+
name
|
|
6335
|
+
]);
|
|
6336
|
+
var pickerValue = value ? getDefaultValue(value) : void 0;
|
|
6337
|
+
var pickerDefaultValue = !pickerValue && defaultValue ? getDefaultValue(defaultValue) : void 0;
|
|
6338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6339
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components2.I18nProvider, {
|
|
6340
|
+
locale: "en-GB",
|
|
6341
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_aria_components3.DatePicker, {
|
|
6342
|
+
className: cn("flex items-center gap-2"),
|
|
6343
|
+
name: name,
|
|
6344
|
+
defaultValue: pickerDefaultValue,
|
|
6345
|
+
value: pickerValue,
|
|
6346
|
+
onChange: handleDateChange,
|
|
6347
|
+
onKeyDown: onKeyDown,
|
|
6348
|
+
children: [
|
|
6349
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
6350
|
+
title: title,
|
|
6351
|
+
className: "flex flex-1",
|
|
6352
|
+
children: [
|
|
6353
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components3.Group, {
|
|
6354
|
+
className: cn("flex-1 bg-background", defaultFormElementBorderClassName, elementClassName),
|
|
6355
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DateInput, _object_spread_props(_object_spread({}, props), {
|
|
6356
|
+
unstyled: true,
|
|
6357
|
+
style: {
|
|
6358
|
+
direction: "ltr"
|
|
6359
|
+
},
|
|
6360
|
+
className: cn("flex-1 h-9 px-3 py-2 text-sm", direction === "rtl" ? "justify-end text-right" : "justify-start text-left")
|
|
6361
|
+
}))
|
|
6362
|
+
}),
|
|
6363
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components3.Button, {
|
|
6364
|
+
className: "-ms-9 -me-px z-10 flex w-9 items-center justify-center rounded-e-md text-muted-foreground/80 outline-none transition-[color,box-shadow] hover:text-foreground data-focus-visible:border-ring data-focus-visible:ring-[3px] data-focus-visible:ring-ring/50",
|
|
6365
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react6.CalendarIcon, {
|
|
6366
|
+
size: 16
|
|
6367
|
+
})
|
|
6368
|
+
})
|
|
6369
|
+
]
|
|
6370
|
+
}),
|
|
6371
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components3.Popover, {
|
|
6372
|
+
className: "data-[entering]:fade-in-0 data-[entering]:zoom-in-95 data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95 data-[placement=bottom]:slide-in-from-top-2 data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2 z-50 rounded-lg border bg-background text-popover-foreground shadow-lg outline-hidden data-entering:animate-in data-exiting:animate-out",
|
|
6373
|
+
offset: 4,
|
|
6374
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components3.Dialog, {
|
|
6375
|
+
className: "max-h-[inherit] overflow-auto p-2",
|
|
6376
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react6.Calendar, {
|
|
6377
|
+
className: cn("bg-white", calendarIconClassName)
|
|
6378
|
+
})
|
|
6379
|
+
})
|
|
6380
|
+
})
|
|
6381
|
+
]
|
|
6382
|
+
})
|
|
6383
|
+
})
|
|
6384
|
+
}));
|
|
6385
|
+
};
|
|
6242
6386
|
var SelectContainer = function(param) {
|
|
6243
6387
|
var _param_name = param.name, name = _param_name === void 0 ? "" : _param_name, _param_labelContent = param.labelContent, labelContent = _param_labelContent === void 0 ? "" : _param_labelContent, _param_containerClassName = param.containerClassName, containerClassName = _param_containerClassName === void 0 ? "" : _param_containerClassName, _param_labelClassName = param.labelClassName, labelClassName = _param_labelClassName === void 0 ? "" : _param_labelClassName, _param_defaultValue = param.defaultValue, defaultValue = _param_defaultValue === void 0 ? "" : _param_defaultValue, _param_elementClassName = param.elementClassName, elementClassName = _param_elementClassName === void 0 ? "" : _param_elementClassName, _param_optionClassName = param.optionClassName, optionClassName = _param_optionClassName === void 0 ? "" : _param_optionClassName, _param_required = param.required, required = _param_required === void 0 ? false : _param_required, _param_options = param.options, options = _param_options === void 0 ? [] : _param_options, _param_selectClassName = param.selectClassName, selectClassName = _param_selectClassName === void 0 ? "" : _param_selectClassName, _param_optionsContainerClassName = param.optionsContainerClassName, optionsContainerClassName = _param_optionsContainerClassName === void 0 ? "" : _param_optionsContainerClassName, _param_sortDirection = param.sortDirection, sortDirection = _param_sortDirection === void 0 ? "abc" : _param_sortDirection, sortAsNumber = param.sortAsNumber, direction = param.direction, onChange = param.onChange, labelWithDots = param.labelWithDots, iconClassName = param.iconClassName, labelsCommonClassName = param.labelsCommonClassName, elementsCommonClassName = param.elementsCommonClassName, title = param.title, labelStyle = param.labelStyle;
|
|
6244
6388
|
var _sortOptions_, _options_find;
|
|
@@ -6275,8 +6419,8 @@ var SelectContainer = function(param) {
|
|
|
6275
6419
|
labelStyle,
|
|
6276
6420
|
elementsCommonClassName
|
|
6277
6421
|
]);
|
|
6278
|
-
return /* @__PURE__ */ (0,
|
|
6279
|
-
children: /* @__PURE__ */ (0,
|
|
6422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6423
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
6280
6424
|
title: title,
|
|
6281
6425
|
style: {
|
|
6282
6426
|
direction: direction
|
|
@@ -6286,21 +6430,21 @@ var SelectContainer = function(param) {
|
|
|
6286
6430
|
return setIsOpen(!isOpen);
|
|
6287
6431
|
},
|
|
6288
6432
|
children: [
|
|
6289
|
-
/* @__PURE__ */ (0,
|
|
6433
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6290
6434
|
className: cn("h-9 max-h-9 py-2 px-3 flex items-center justify-center cursor-pointer", defaultFormElementBorderClassName, selectClassName),
|
|
6291
6435
|
children: ((_options_find = options.find(function(opt) {
|
|
6292
6436
|
return opt.value === selectedValue;
|
|
6293
6437
|
})) === null || _options_find === void 0 ? void 0 : _options_find.label) || selectedValue
|
|
6294
6438
|
}),
|
|
6295
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
6439
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", {
|
|
6296
6440
|
className: cn("fa-light fa-chevron-up absolute top-3 ".concat(direction === "ltr" ? "right-2" : "left-2", " cursor-pointer"), iconClassName)
|
|
6297
|
-
}) : /* @__PURE__ */ (0,
|
|
6441
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", {
|
|
6298
6442
|
className: cn("fa-light fa-chevron-down absolute top-3 ".concat(direction === "ltr" ? "right-2" : "left-2", " cursor-pointer"), iconClassName)
|
|
6299
6443
|
}),
|
|
6300
|
-
isOpen && /* @__PURE__ */ (0,
|
|
6444
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6301
6445
|
className: cn("absolute w-full bg-white border border-gray-300 max-h-32 overflow-y-auto z-10", optionsContainerClassName),
|
|
6302
6446
|
children: sortOptions.map(function(option) {
|
|
6303
|
-
return /* @__PURE__ */ (0,
|
|
6447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6304
6448
|
className: "p-2 cursor-pointer hover:bg-gray-200 ".concat(optionClassName),
|
|
6305
6449
|
onClick: function() {
|
|
6306
6450
|
return handleOptionClick(option.value);
|
|
@@ -6309,7 +6453,7 @@ var SelectContainer = function(param) {
|
|
|
6309
6453
|
}, option.value);
|
|
6310
6454
|
})
|
|
6311
6455
|
}),
|
|
6312
|
-
/* @__PURE__ */ (0,
|
|
6456
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", {
|
|
6313
6457
|
value: selectedValue,
|
|
6314
6458
|
type: "hidden",
|
|
6315
6459
|
name: name,
|
|
@@ -6348,8 +6492,8 @@ function MultiSelect(param) {
|
|
|
6348
6492
|
labelStyle,
|
|
6349
6493
|
elementsCommonClassName
|
|
6350
6494
|
]);
|
|
6351
|
-
return /* @__PURE__ */ (0,
|
|
6352
|
-
children: /* @__PURE__ */ (0,
|
|
6495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6496
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(multiselect_default, {
|
|
6353
6497
|
closeDropdownOnSelect: closeDropdownOnSelect,
|
|
6354
6498
|
commandProps: {
|
|
6355
6499
|
label: placeholder
|
|
@@ -6371,7 +6515,7 @@ function MultiSelect(param) {
|
|
|
6371
6515
|
className: cn(defaultFormElementBorderClassName, styles.className),
|
|
6372
6516
|
dropdownClassName: styles.dropdownClassName,
|
|
6373
6517
|
dropdownOptionClassName: styles.dropdownOptionClassName,
|
|
6374
|
-
emptyIndicator: emptyOptionsElement || /* @__PURE__ */ (0,
|
|
6518
|
+
emptyIndicator: emptyOptionsElement || /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", {
|
|
6375
6519
|
className: "text-center text-sm",
|
|
6376
6520
|
children: "all options selected."
|
|
6377
6521
|
}),
|
|
@@ -6409,8 +6553,8 @@ var SelectWithSearch = function(param) {
|
|
|
6409
6553
|
labelStyle,
|
|
6410
6554
|
elementsCommonClassName
|
|
6411
6555
|
]);
|
|
6412
|
-
return /* @__PURE__ */ (0,
|
|
6413
|
-
children: /* @__PURE__ */ (0,
|
|
6556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SearchSelect, {
|
|
6414
6558
|
direction: direction,
|
|
6415
6559
|
createNewOptionLabel: createNewOptionLabel,
|
|
6416
6560
|
createNewOptionContainerClassName: createNewOptionContainerClassName,
|
|
@@ -6461,8 +6605,8 @@ var TextAreaContainer = function(param) {
|
|
|
6461
6605
|
labelStyle,
|
|
6462
6606
|
elementsCommonClassName
|
|
6463
6607
|
]);
|
|
6464
|
-
return /* @__PURE__ */ (0,
|
|
6465
|
-
children: /* @__PURE__ */ (0,
|
|
6608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("textarea", _object_spread_props(_object_spread({}, props), {
|
|
6466
6610
|
defaultValue: value ? void 0 : defaultValue,
|
|
6467
6611
|
value: defaultValue ? void 0 : value,
|
|
6468
6612
|
onChange: onChange,
|
|
@@ -6478,7 +6622,7 @@ var TextAreaContainer = function(param) {
|
|
|
6478
6622
|
};
|
|
6479
6623
|
var FormSeparator = function(param) {
|
|
6480
6624
|
var props = param.props, children = param.children;
|
|
6481
|
-
return /* @__PURE__ */ (0,
|
|
6625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", _object_spread_props(_object_spread({}, props), {
|
|
6482
6626
|
className: cn("border-b-[1px] border-gray-300 h-[1px]", props === null || props === void 0 ? void 0 : props.className),
|
|
6483
6627
|
children: children
|
|
6484
6628
|
}));
|
|
@@ -6510,8 +6654,8 @@ var CheckboxContainer = function(param) {
|
|
|
6510
6654
|
labelStyle,
|
|
6511
6655
|
elementsCommonClassName
|
|
6512
6656
|
]);
|
|
6513
|
-
return /* @__PURE__ */ (0,
|
|
6514
|
-
children: /* @__PURE__ */ (0,
|
|
6657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6658
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Checkbox, {
|
|
6515
6659
|
id: id,
|
|
6516
6660
|
name: name,
|
|
6517
6661
|
checked: checked,
|
|
@@ -6575,21 +6719,21 @@ var DurationPicker = function(param) {
|
|
|
6575
6719
|
onChange === null || onChange === void 0 ? void 0 : onChange(durationToSeconds(update));
|
|
6576
6720
|
};
|
|
6577
6721
|
};
|
|
6578
|
-
return /* @__PURE__ */ (0,
|
|
6579
|
-
children: /* @__PURE__ */ (0,
|
|
6722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FormElementContainer, _object_spread_props(_object_spread({}, containerProps), {
|
|
6723
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
6580
6724
|
title: title,
|
|
6581
6725
|
className: cn("flex gap-1.5 text-sm", elementClassName),
|
|
6582
6726
|
dir: "ltr",
|
|
6583
6727
|
children: [
|
|
6584
6728
|
Array.from(new Set(options)).map(function(field) {
|
|
6585
|
-
return /* @__PURE__ */ (0,
|
|
6729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
6586
6730
|
className: "flex flex-col border p-0.5 rounded-md",
|
|
6587
6731
|
children: [
|
|
6588
|
-
!hideLabels && /* @__PURE__ */ (0,
|
|
6732
|
+
!hideLabels && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", {
|
|
6589
6733
|
className: "mb-1 ps-1 capitalize text-start border-b-[1px] border-b-gray-300",
|
|
6590
6734
|
children: field.slice(0, 1)
|
|
6591
6735
|
}),
|
|
6592
|
-
/* @__PURE__ */ (0,
|
|
6736
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", {
|
|
6593
6737
|
type: "number",
|
|
6594
6738
|
inputMode: "numeric",
|
|
6595
6739
|
min: 0,
|
|
@@ -6607,7 +6751,7 @@ var DurationPicker = function(param) {
|
|
|
6607
6751
|
]
|
|
6608
6752
|
}, field);
|
|
6609
6753
|
}),
|
|
6610
|
-
/* @__PURE__ */ (0,
|
|
6754
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", {
|
|
6611
6755
|
name: name,
|
|
6612
6756
|
type: "hidden",
|
|
6613
6757
|
value: durationToSeconds(duration)
|
|
@@ -6618,10 +6762,10 @@ var DurationPicker = function(param) {
|
|
|
6618
6762
|
};
|
|
6619
6763
|
var FormElementContainer = function(param) {
|
|
6620
6764
|
var containerClassName = param.containerClassName, direction = param.direction, labelClassName = param.labelClassName, labelContent = param.labelContent, labelWithDots = param.labelWithDots, labelsCommonClassName = param.labelsCommonClassName, name = param.name, required = param.required, children = param.children, _param_defaultContainerClassName = param.defaultContainerClassName, defaultContainerClassName = _param_defaultContainerClassName === void 0 ? true : _param_defaultContainerClassName, _param_elementsCommonClassName = param.elementsCommonClassName, elementsCommonClassName = _param_elementsCommonClassName === void 0 ? "" : _param_elementsCommonClassName, labelStyle = param.labelStyle;
|
|
6621
|
-
return /* @__PURE__ */ (0,
|
|
6765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
6622
6766
|
className: cn(defaultContainerClassName ? defaultFormElementContainerClassName : "", containerClassName, elementsCommonClassName),
|
|
6623
6767
|
children: [
|
|
6624
|
-
labelContent && /* @__PURE__ */ (0,
|
|
6768
|
+
labelContent && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ElementLabel, {
|
|
6625
6769
|
labelStyle: labelStyle,
|
|
6626
6770
|
labelsCommonClassName: labelsCommonClassName,
|
|
6627
6771
|
withDots: labelWithDots,
|
|
@@ -6637,7 +6781,7 @@ var FormElementContainer = function(param) {
|
|
|
6637
6781
|
};
|
|
6638
6782
|
var ElementLabel = function(param) {
|
|
6639
6783
|
var labelContent = param.labelContent, labelClassName = param.labelClassName, name = param.name, required = param.required, _param_withDots = param.withDots, withDots = _param_withDots === void 0 ? false : _param_withDots, direction = param.direction, labelsCommonClassName = param.labelsCommonClassName, _param_labelStyle = param.labelStyle, labelStyle = _param_labelStyle === void 0 ? {} : _param_labelStyle;
|
|
6640
|
-
return /* @__PURE__ */ (0,
|
|
6784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", {
|
|
6641
6785
|
style: _object_spread({
|
|
6642
6786
|
direction: direction
|
|
6643
6787
|
}, labelStyle),
|
|
@@ -6646,11 +6790,11 @@ var ElementLabel = function(param) {
|
|
|
6646
6790
|
title: labelContent,
|
|
6647
6791
|
children: [
|
|
6648
6792
|
labelContent,
|
|
6649
|
-
required && /* @__PURE__ */ (0,
|
|
6793
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6650
6794
|
className: "text-red-500",
|
|
6651
6795
|
children: "*"
|
|
6652
6796
|
}),
|
|
6653
|
-
withDots && /* @__PURE__ */ (0,
|
|
6797
|
+
withDots && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6654
6798
|
children: ":"
|
|
6655
6799
|
})
|
|
6656
6800
|
]
|
|
@@ -6712,15 +6856,15 @@ var ElementsContainer = (0, import_react15.memo)(function(props) {
|
|
|
6712
6856
|
containerClassName,
|
|
6713
6857
|
elementProps
|
|
6714
6858
|
]);
|
|
6715
|
-
return /* @__PURE__ */ (0,
|
|
6859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", {
|
|
6716
6860
|
ref: containerRef,
|
|
6717
6861
|
className: cn("flex flex-col gap-1", className),
|
|
6718
6862
|
children: [
|
|
6719
|
-
headline && /* @__PURE__ */ (0,
|
|
6863
|
+
headline && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6720
6864
|
className: cn("text-start text-primary font-bold border-b-[1px] border-gray-400 pb-0.5", headlineClassName),
|
|
6721
6865
|
children: headline
|
|
6722
6866
|
}),
|
|
6723
|
-
/* @__PURE__ */ (0,
|
|
6867
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", {
|
|
6724
6868
|
className: cn("flex flex-col gap-1.5", childrenContainerClassName),
|
|
6725
6869
|
children: enhancedChildren
|
|
6726
6870
|
})
|
|
@@ -6729,7 +6873,7 @@ var ElementsContainer = (0, import_react15.memo)(function(props) {
|
|
|
6729
6873
|
}, propsAreEqual);
|
|
6730
6874
|
ElementsContainer.displayName = "ElementsContainer";
|
|
6731
6875
|
// src/components/forms/ModularForm/ModularForm.tsx
|
|
6732
|
-
var
|
|
6876
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
6733
6877
|
var ModularForm = function(param) {
|
|
6734
6878
|
var _param_submitFunction = param.submitFunction, submitFunction = _param_submitFunction === void 0 ? /*#__PURE__*/ function() {
|
|
6735
6879
|
var _ref = _async_to_generator(function(form) {
|
|
@@ -6836,7 +6980,7 @@ var ModularForm = function(param) {
|
|
|
6836
6980
|
return _ref.apply(this, arguments);
|
|
6837
6981
|
};
|
|
6838
6982
|
}();
|
|
6839
|
-
return /* @__PURE__ */ (0,
|
|
6983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("form", {
|
|
6840
6984
|
ref: formRef,
|
|
6841
6985
|
onSubmit: onSubmit,
|
|
6842
6986
|
style: {
|
|
@@ -6844,72 +6988,79 @@ var ModularForm = function(param) {
|
|
|
6844
6988
|
},
|
|
6845
6989
|
className: cn("w-[350px] px-5 py-5 flex flex-col gap-4", className),
|
|
6846
6990
|
children: [
|
|
6847
|
-
headerContent && /* @__PURE__ */ (0,
|
|
6991
|
+
headerContent && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6848
6992
|
className: cn("border-b-2 border-[#547f22] pb-2 text-start font-bold text-[20px]", headerClassName),
|
|
6849
6993
|
children: headerContent
|
|
6850
6994
|
}),
|
|
6851
|
-
/* @__PURE__ */ (0,
|
|
6995
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6852
6996
|
className: cn("w-full flex flex-col gap-5", elementsContainerClassName),
|
|
6853
6997
|
children: elements.map(function(element, index2) {
|
|
6854
6998
|
switch(element.type){
|
|
6855
6999
|
case "input":
|
|
6856
|
-
return /* @__PURE__ */ (0,
|
|
7000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(InputContainer, _object_spread_props(_object_spread({
|
|
7001
|
+
direction: direction
|
|
7002
|
+
}, element), {
|
|
7003
|
+
labelsCommonClassName: labelsCommonClassName,
|
|
7004
|
+
elementsCommonClassName: elementsCommonClassName
|
|
7005
|
+
}), index2);
|
|
7006
|
+
case "dateInput":
|
|
7007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DateInputContainer, _object_spread_props(_object_spread({
|
|
6857
7008
|
direction: direction
|
|
6858
7009
|
}, element), {
|
|
6859
7010
|
labelsCommonClassName: labelsCommonClassName,
|
|
6860
7011
|
elementsCommonClassName: elementsCommonClassName
|
|
6861
7012
|
}), index2);
|
|
6862
7013
|
case "textarea":
|
|
6863
|
-
return /* @__PURE__ */ (0,
|
|
7014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TextAreaContainer, _object_spread_props(_object_spread({
|
|
6864
7015
|
direction: element.direction || direction
|
|
6865
7016
|
}, element), {
|
|
6866
7017
|
labelsCommonClassName: labelsCommonClassName,
|
|
6867
7018
|
elementsCommonClassName: elementsCommonClassName
|
|
6868
7019
|
}), index2);
|
|
6869
7020
|
case "select":
|
|
6870
|
-
return /* @__PURE__ */ (0,
|
|
7021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectContainer, _object_spread_props(_object_spread({
|
|
6871
7022
|
direction: direction
|
|
6872
7023
|
}, element), {
|
|
6873
7024
|
labelsCommonClassName: labelsCommonClassName,
|
|
6874
7025
|
elementsCommonClassName: elementsCommonClassName
|
|
6875
7026
|
}), index2);
|
|
6876
7027
|
case "checkbox":
|
|
6877
|
-
return /* @__PURE__ */ (0,
|
|
7028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CheckboxContainer, _object_spread_props(_object_spread({
|
|
6878
7029
|
direction: direction
|
|
6879
7030
|
}, element), {
|
|
6880
7031
|
labelsCommonClassName: labelsCommonClassName,
|
|
6881
7032
|
elementsCommonClassName: elementsCommonClassName
|
|
6882
7033
|
}), index2);
|
|
6883
7034
|
case "multiSelect":
|
|
6884
|
-
return /* @__PURE__ */ (0,
|
|
7035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MultiSelect, _object_spread_props(_object_spread({
|
|
6885
7036
|
direction: direction
|
|
6886
7037
|
}, element), {
|
|
6887
7038
|
labelsCommonClassName: labelsCommonClassName,
|
|
6888
7039
|
elementsCommonClassName: elementsCommonClassName
|
|
6889
7040
|
}), index2);
|
|
6890
7041
|
case "selectWithSearch":
|
|
6891
|
-
return /* @__PURE__ */ (0,
|
|
7042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SelectWithSearch, _object_spread_props(_object_spread({
|
|
6892
7043
|
direction: direction
|
|
6893
7044
|
}, element), {
|
|
6894
7045
|
labelsCommonClassName: labelsCommonClassName,
|
|
6895
7046
|
elementsCommonClassName: elementsCommonClassName
|
|
6896
7047
|
}), index2);
|
|
6897
7048
|
case "internationalPhoneInput":
|
|
6898
|
-
return /* @__PURE__ */ (0,
|
|
7049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(InternationalPhonePicker, _object_spread_props(_object_spread({
|
|
6899
7050
|
direction: direction
|
|
6900
7051
|
}, element), {
|
|
6901
7052
|
labelsCommonClassName: labelsCommonClassName,
|
|
6902
7053
|
elementsCommonClassName: elementsCommonClassName
|
|
6903
7054
|
}), index2);
|
|
6904
7055
|
case "duration":
|
|
6905
|
-
return /* @__PURE__ */ (0,
|
|
7056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DurationPicker, _object_spread_props(_object_spread({
|
|
6906
7057
|
direction: direction
|
|
6907
7058
|
}, element), {
|
|
6908
7059
|
labelsCommonClassName: labelsCommonClassName,
|
|
6909
7060
|
elementsCommonClassName: elementsCommonClassName
|
|
6910
7061
|
}), index2);
|
|
6911
7062
|
case "separator":
|
|
6912
|
-
return /* @__PURE__ */ (0,
|
|
7063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormSeparator, _object_spread_props(_object_spread({
|
|
6913
7064
|
direction: direction
|
|
6914
7065
|
}, element), {
|
|
6915
7066
|
children: element.children
|
|
@@ -6924,15 +7075,15 @@ var ModularForm = function(param) {
|
|
|
6924
7075
|
}
|
|
6925
7076
|
})
|
|
6926
7077
|
}),
|
|
6927
|
-
/* @__PURE__ */ (0,
|
|
7078
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", {
|
|
6928
7079
|
className: cn("flex justify-between w-full", footerClassName),
|
|
6929
7080
|
children: [
|
|
6930
|
-
/* @__PURE__ */ (0,
|
|
7081
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", {
|
|
6931
7082
|
title: errorMsg,
|
|
6932
7083
|
className: cn("text-[#f22] text-[18px] max-w-[80%] ellipsis", errorClassName),
|
|
6933
7084
|
children: errorMsg
|
|
6934
7085
|
}),
|
|
6935
|
-
/* @__PURE__ */ (0,
|
|
7086
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", {
|
|
6936
7087
|
ref: submitRef,
|
|
6937
7088
|
disabled: isLoading,
|
|
6938
7089
|
onClick: function(e) {
|
|
@@ -6940,7 +7091,7 @@ var ModularForm = function(param) {
|
|
|
6940
7091
|
},
|
|
6941
7092
|
className: cn("bg-[#547f22] px-3 py-1.5 rounded-lg text-white min-w-20", buttonClassName),
|
|
6942
7093
|
type: "submit",
|
|
6943
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
7094
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Loader, _object_spread({
|
|
6944
7095
|
size: 18,
|
|
6945
7096
|
color: "#fff"
|
|
6946
7097
|
}, loaderProps)) : buttonContent
|
|
@@ -6954,32 +7105,32 @@ var ModularForm_default = ModularForm;
|
|
|
6954
7105
|
// src/components/forms/index.tsx
|
|
6955
7106
|
var import_react18 = require("react");
|
|
6956
7107
|
var import_moment2 = __toESM(require("moment"));
|
|
6957
|
-
var
|
|
6958
|
-
var
|
|
6959
|
-
var
|
|
7108
|
+
var import_lucide_react8 = require("lucide-react");
|
|
7109
|
+
var import_react_aria_components5 = require("react-aria-components");
|
|
7110
|
+
var import_date3 = require("@internationalized/date");
|
|
6960
7111
|
// src/components/ui/calendar-rac.tsx
|
|
6961
|
-
var
|
|
6962
|
-
var
|
|
6963
|
-
var
|
|
6964
|
-
var
|
|
7112
|
+
var import_date2 = require("@internationalized/date");
|
|
7113
|
+
var import_lucide_react7 = require("lucide-react");
|
|
7114
|
+
var import_react_aria_components4 = require("react-aria-components");
|
|
7115
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
6965
7116
|
function CalendarHeader() {
|
|
6966
|
-
return /* @__PURE__ */ (0,
|
|
7117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("header", {
|
|
6967
7118
|
className: "flex w-full items-center gap-1 pb-1",
|
|
6968
7119
|
children: [
|
|
6969
|
-
/* @__PURE__ */ (0,
|
|
7120
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.Button, {
|
|
6970
7121
|
className: "flex size-9 items-center justify-center rounded-md text-muted-foreground/80 outline-none transition-[color,box-shadow] hover:bg-accent hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
6971
7122
|
slot: "previous",
|
|
6972
|
-
children: /* @__PURE__ */ (0,
|
|
7123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react7.ChevronLeftIcon, {
|
|
6973
7124
|
size: 16
|
|
6974
7125
|
})
|
|
6975
7126
|
}),
|
|
6976
|
-
/* @__PURE__ */ (0,
|
|
7127
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.Heading, {
|
|
6977
7128
|
className: "grow text-center font-medium text-sm"
|
|
6978
7129
|
}),
|
|
6979
|
-
/* @__PURE__ */ (0,
|
|
7130
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.Button, {
|
|
6980
7131
|
className: "flex size-9 items-center justify-center rounded-md text-muted-foreground/80 outline-none transition-[color,box-shadow] hover:bg-accent hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
6981
7132
|
slot: "next",
|
|
6982
|
-
children: /* @__PURE__ */ (0,
|
|
7133
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react7.ChevronRightIcon, {
|
|
6983
7134
|
size: 16
|
|
6984
7135
|
})
|
|
6985
7136
|
})
|
|
@@ -6988,21 +7139,21 @@ function CalendarHeader() {
|
|
|
6988
7139
|
}
|
|
6989
7140
|
function CalendarGridComponent(param) {
|
|
6990
7141
|
var _param_isRange = param.isRange, isRange = _param_isRange === void 0 ? false : _param_isRange;
|
|
6991
|
-
var now = (0,
|
|
6992
|
-
return /* @__PURE__ */ (0,
|
|
7142
|
+
var now = (0, import_date2.today)((0, import_date2.getLocalTimeZone)());
|
|
7143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react_aria_components4.CalendarGrid, {
|
|
6993
7144
|
children: [
|
|
6994
|
-
/* @__PURE__ */ (0,
|
|
7145
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.CalendarGridHeader, {
|
|
6995
7146
|
children: function(day) {
|
|
6996
|
-
return /* @__PURE__ */ (0,
|
|
7147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.CalendarHeaderCell, {
|
|
6997
7148
|
className: "size-9 rounded-md p-0 font-medium text-muted-foreground/80 text-xs",
|
|
6998
7149
|
children: day
|
|
6999
7150
|
});
|
|
7000
7151
|
}
|
|
7001
7152
|
}),
|
|
7002
|
-
/* @__PURE__ */ (0,
|
|
7153
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.CalendarGridBody, {
|
|
7003
7154
|
className: "[&_td]:px-0 [&_td]:py-px",
|
|
7004
7155
|
children: function(date) {
|
|
7005
|
-
return /* @__PURE__ */ (0,
|
|
7156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components4.CalendarCell, {
|
|
7006
7157
|
className: cn("relative flex size-9 items-center justify-center whitespace-nowrap rounded-md p-0 font-normal text-foreground text-sm outline-none duration-150 [transition-property:color,background-color,border-radius,box-shadow] data-disabled:pointer-events-none data-unavailable:pointer-events-none data-focus-visible:z-10 data-hovered:bg-accent data-selected:bg-primary data-hovered:text-foreground data-selected:text-primary-foreground data-unavailable:line-through data-disabled:opacity-30 data-unavailable:opacity-30 data-focus-visible:ring-[3px] data-focus-visible:ring-ring/50", // Range-specific styles
|
|
7007
7158
|
isRange && "data-invalid:data-selection-end:bg-destructive data-invalid:data-selection-start:bg-destructive data-invalid:data-selection-end:text-white data-invalid:data-selection-start:text-white data-selected:rounded-none data-selection-start:rounded-s-md data-selection-end:rounded-e-md data-invalid:bg-red-100 data-selected:bg-accent data-selection-end:bg-primary data-selection-start:bg-primary data-selected:text-foreground data-selection-end:text-primary-foreground data-selection-start:text-primary-foreground", // Today indicator styles
|
|
7008
7159
|
date.compare(now) === 0 && cn("after:-translate-x-1/2 after:pointer-events-none after:absolute after:start-1/2 after:bottom-1 after:z-10 after:size-[3px] after:rounded-full after:bg-primary", isRange ? "data-selection-end:after:bg-background data-selection-start:after:bg-background" : "data-selected:after:bg-background")),
|
|
@@ -7013,55 +7164,22 @@ function CalendarGridComponent(param) {
|
|
|
7013
7164
|
]
|
|
7014
7165
|
});
|
|
7015
7166
|
}
|
|
7016
|
-
function
|
|
7167
|
+
function Calendar2(_param) {
|
|
7017
7168
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7018
7169
|
"className"
|
|
7019
7170
|
]);
|
|
7020
|
-
return /* @__PURE__ */ (0,
|
|
7021
|
-
className: (0,
|
|
7171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react_aria_components4.Calendar, _object_spread_props(_object_spread({}, props), {
|
|
7172
|
+
className: (0, import_react_aria_components4.composeRenderProps)(className, function(className2) {
|
|
7022
7173
|
return cn("w-fit", className2);
|
|
7023
7174
|
}),
|
|
7024
7175
|
children: [
|
|
7025
|
-
/* @__PURE__ */ (0,
|
|
7026
|
-
/* @__PURE__ */ (0,
|
|
7176
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CalendarHeader, {}),
|
|
7177
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CalendarGridComponent, {})
|
|
7027
7178
|
]
|
|
7028
7179
|
}));
|
|
7029
7180
|
}
|
|
7030
|
-
// src/components/ui/datefield-rac.tsx
|
|
7031
|
-
var import_react_aria_components2 = require("react-aria-components");
|
|
7032
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
7033
|
-
function DateSegment(_param) {
|
|
7034
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
7035
|
-
"className"
|
|
7036
|
-
]);
|
|
7037
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components2.DateSegment, _object_spread_props(_object_spread({
|
|
7038
|
-
className: (0, import_react_aria_components2.composeRenderProps)(className, function(className2) {
|
|
7039
|
-
return cn("inline rounded p-0.5 text-foreground caret-transparent outline-hidden data-invalid:data-focused:bg-destructive data-focused:data-placeholder:text-foreground data-invalid:data-focused:text-white data-invalid:data-placeholder:text-destructive data-disabled:cursor-not-allowed data-focused:bg-accent data-[type=literal]:px-0 data-[type=literal]:text-muted-foreground/70 data-focused:text-foreground data-invalid:data-focused:data-placeholder:text-white data-invalid:text-destructive data-placeholder:text-muted-foreground/70 data-disabled:opacity-50", className2);
|
|
7040
|
-
})
|
|
7041
|
-
}, props), {
|
|
7042
|
-
"data-invalid": true
|
|
7043
|
-
}));
|
|
7044
|
-
}
|
|
7045
|
-
var dateInputStyle = "relative inline-flex h-9 w-full items-center overflow-hidden whitespace-nowrap rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none data-focus-within:border-ring data-focus-within:ring-ring/50 data-focus-within:ring-[3px] data-focus-within:has-aria-invalid:ring-destructive/20 dark:data-focus-within:has-aria-invalid:ring-destructive/40 data-focus-within:has-aria-invalid:border-destructive";
|
|
7046
|
-
function DateInput(_param) {
|
|
7047
|
-
var className = _param.className, _param_unstyled = _param.unstyled, unstyled = _param_unstyled === void 0 ? false : _param_unstyled, props = _object_without_properties(_param, [
|
|
7048
|
-
"className",
|
|
7049
|
-
"unstyled"
|
|
7050
|
-
]);
|
|
7051
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components2.DateInput, _object_spread_props(_object_spread({
|
|
7052
|
-
className: (0, import_react_aria_components2.composeRenderProps)(className, function(className2) {
|
|
7053
|
-
return cn(!unstyled && dateInputStyle, className2);
|
|
7054
|
-
})
|
|
7055
|
-
}, props), {
|
|
7056
|
-
children: function(segment) {
|
|
7057
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DateSegment, {
|
|
7058
|
-
segment: segment
|
|
7059
|
-
});
|
|
7060
|
-
}
|
|
7061
|
-
}));
|
|
7062
|
-
}
|
|
7063
7181
|
// src/components/forms/index.tsx
|
|
7064
|
-
var
|
|
7182
|
+
var import_react_aria_components6 = require("react-aria-components");
|
|
7065
7183
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
7066
7184
|
var ConfirmForm = function(param) {
|
|
7067
7185
|
var onV = param.onV, onX = param.onX, _param_headline = param.headline, headline = _param_headline === void 0 ? "" : _param_headline, _param_direction = param.direction, direction = _param_direction === void 0 ? "rtl" : _param_direction, _param_containerClassName = param.containerClassName, containerClassName = _param_containerClassName === void 0 ? "" : _param_containerClassName, _param_buttonsContainerClassName = param.buttonsContainerClassName, buttonsContainerClassName = _param_buttonsContainerClassName === void 0 ? "" : _param_buttonsContainerClassName, _param_headlineClassName = param.headlineClassName, headlineClassName = _param_headlineClassName === void 0 ? "" : _param_headlineClassName, _param_cancelButtonClassName = param.cancelButtonClassName, cancelButtonClassName = _param_cancelButtonClassName === void 0 ? "" : _param_cancelButtonClassName, _param_confirmButtonClassName = param.confirmButtonClassName, confirmButtonClassName = _param_confirmButtonClassName === void 0 ? "" : _param_confirmButtonClassName, _param_cancelButtonProps = param.cancelButtonProps, cancelButtonProps = _param_cancelButtonProps === void 0 ? {} : _param_cancelButtonProps, _param_confirmButtonProps = param.confirmButtonProps, confirmButtonProps = _param_confirmButtonProps === void 0 ? {} : _param_confirmButtonProps, cancelElement = param.cancelElement, confirmElement = param.confirmElement;
|
|
@@ -7221,14 +7339,14 @@ function DatePicker2(param) {
|
|
|
7221
7339
|
var getDefaultValue = function(dateStr) {
|
|
7222
7340
|
if (dateStr) {
|
|
7223
7341
|
try {
|
|
7224
|
-
return (0,
|
|
7342
|
+
return (0, import_date3.parseDate)(dateStr);
|
|
7225
7343
|
} catch (e) {
|
|
7226
|
-
return (0,
|
|
7344
|
+
return (0, import_date3.today)((0, import_date3.getLocalTimeZone)());
|
|
7227
7345
|
}
|
|
7228
7346
|
}
|
|
7229
|
-
return (0,
|
|
7347
|
+
return (0, import_date3.today)((0, import_date3.getLocalTimeZone)());
|
|
7230
7348
|
};
|
|
7231
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components6.I18nProvider, {
|
|
7232
7350
|
locale: "en-GB",
|
|
7233
7351
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("form", {
|
|
7234
7352
|
style: {
|
|
@@ -7237,19 +7355,19 @@ function DatePicker2(param) {
|
|
|
7237
7355
|
onSubmit: onSubmit,
|
|
7238
7356
|
className: cn("w-full h-10 flex justify-start gap-3 items-center", formClassName),
|
|
7239
7357
|
children: [
|
|
7240
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
7358
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_aria_components5.DatePicker, {
|
|
7241
7359
|
className: cn("flex items-center gap-2", labelsClassName),
|
|
7242
7360
|
name: "from",
|
|
7243
7361
|
defaultValue: getDefaultValue(defaultFrom),
|
|
7244
7362
|
children: [
|
|
7245
|
-
fromText && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7363
|
+
fromText && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Label, {
|
|
7246
7364
|
className: "font-medium text-foreground text-sm whitespace-nowrap",
|
|
7247
7365
|
children: fromText
|
|
7248
7366
|
}),
|
|
7249
7367
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", {
|
|
7250
7368
|
className: "flex",
|
|
7251
7369
|
children: [
|
|
7252
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7370
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Group, {
|
|
7253
7371
|
className: cn("w-32 border rounded-md bg-background ", inputsClassName),
|
|
7254
7372
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DateInput, {
|
|
7255
7373
|
style: {
|
|
@@ -7258,39 +7376,39 @@ function DatePicker2(param) {
|
|
|
7258
7376
|
className: cn("px-2 py-1", direction === "rtl" ? "justify-end" : "justify-start")
|
|
7259
7377
|
})
|
|
7260
7378
|
}),
|
|
7261
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7379
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Button, {
|
|
7262
7380
|
className: "-ms-9 -me-px z-10 flex w-9 items-center justify-center rounded-e-md text-muted-foreground/80 outline-none transition-[color,box-shadow] hover:text-foreground data-focus-visible:border-ring data-focus-visible:ring-[3px] data-focus-visible:ring-ring/50",
|
|
7263
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7381
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react8.CalendarIcon, {
|
|
7264
7382
|
size: 16
|
|
7265
7383
|
})
|
|
7266
7384
|
})
|
|
7267
7385
|
]
|
|
7268
7386
|
}),
|
|
7269
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7387
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Popover, {
|
|
7270
7388
|
className: "data-[entering]:fade-in-0 data-[entering]:zoom-in-95 data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95 data-[placement=bottom]:slide-in-from-top-2 data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2 z-50 rounded-lg border bg-background text-popover-foreground shadow-lg outline-hidden data-entering:animate-in data-exiting:animate-out",
|
|
7271
7389
|
offset: 4,
|
|
7272
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7390
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Dialog, {
|
|
7273
7391
|
className: "max-h-[inherit] overflow-auto p-2",
|
|
7274
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7392
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Calendar2, {
|
|
7275
7393
|
className: cn("bg-white", calendarClassName)
|
|
7276
7394
|
})
|
|
7277
7395
|
})
|
|
7278
7396
|
})
|
|
7279
7397
|
]
|
|
7280
7398
|
}),
|
|
7281
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
7399
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_aria_components5.DatePicker, {
|
|
7282
7400
|
className: cn("flex items-center gap-2", labelsClassName),
|
|
7283
7401
|
name: "to",
|
|
7284
7402
|
defaultValue: getDefaultValue(defaultTo),
|
|
7285
7403
|
children: [
|
|
7286
|
-
toText && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7404
|
+
toText && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Label, {
|
|
7287
7405
|
className: "font-medium text-foreground text-sm whitespace-nowrap",
|
|
7288
7406
|
children: toText
|
|
7289
7407
|
}),
|
|
7290
7408
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", {
|
|
7291
7409
|
className: "flex",
|
|
7292
7410
|
children: [
|
|
7293
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7411
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Group, {
|
|
7294
7412
|
className: cn("w-32 border rounded-md bg-background", inputsClassName),
|
|
7295
7413
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DateInput, {
|
|
7296
7414
|
style: {
|
|
@@ -7299,20 +7417,20 @@ function DatePicker2(param) {
|
|
|
7299
7417
|
className: cn("px-2 py-1", direction === "rtl" ? "justify-end" : "justify-start")
|
|
7300
7418
|
})
|
|
7301
7419
|
}),
|
|
7302
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7420
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Button, {
|
|
7303
7421
|
className: "-ms-9 -me-px z-10 flex w-9 items-center justify-center rounded-e-md text-muted-foreground/80 outline-none transition-[color,box-shadow] hover:text-foreground data-focus-visible:border-ring data-focus-visible:ring-[3px] data-focus-visible:ring-ring/50",
|
|
7304
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7422
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react8.CalendarIcon, {
|
|
7305
7423
|
size: 16
|
|
7306
7424
|
})
|
|
7307
7425
|
})
|
|
7308
7426
|
]
|
|
7309
7427
|
}),
|
|
7310
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7428
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Popover, {
|
|
7311
7429
|
className: "data-[entering]:fade-in-0 data-[entering]:zoom-in-95 data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95 data-[placement=bottom]:slide-in-from-top-2 data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2 z-50 rounded-lg border bg-background text-popover-foreground shadow-lg outline-hidden data-entering:animate-in data-exiting:animate-out",
|
|
7312
7430
|
offset: 4,
|
|
7313
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7431
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components5.Dialog, {
|
|
7314
7432
|
className: "max-h-[inherit] overflow-auto p-2",
|
|
7315
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7433
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Calendar2, {
|
|
7316
7434
|
className: cn("bg-white", calendarClassName)
|
|
7317
7435
|
})
|
|
7318
7436
|
})
|
|
@@ -7390,6 +7508,7 @@ function Slot2(props) {
|
|
|
7390
7508
|
CheckboxContainer: CheckboxContainer,
|
|
7391
7509
|
CodeInput: CodeInput,
|
|
7392
7510
|
ConfirmForm: ConfirmForm,
|
|
7511
|
+
DateInputContainer: DateInputContainer,
|
|
7393
7512
|
DatePicker: DatePicker,
|
|
7394
7513
|
DatePicker2: DatePicker2,
|
|
7395
7514
|
DisplayAllRowsButton: DisplayAllRowsButton,
|