@beweco/aurora-ui 0.6.44 → 0.6.46
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/assets/css/styles.css +1 -1
- package/dist/index.cjs.js +38 -14
- package/dist/index.esm.js +38 -14
- package/dist/types/components/color-picker/ColorPicker.d.ts.map +1 -1
- package/dist/types/components/drawer-filters/_internal/DayMonthPicker.d.ts.map +1 -1
- package/dist/types/components/drawer-filters/index.d.ts +1 -1
- package/dist/types/components/drawer-filters/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -685,6 +685,11 @@ var normalizeHexColor = function (color) {
|
|
|
685
685
|
}
|
|
686
686
|
return color.toUpperCase();
|
|
687
687
|
};
|
|
688
|
+
/**
|
|
689
|
+
* Strips leading "#" characters so the text input shows only the hex digits.
|
|
690
|
+
* The "#" prefix is rendered as a fixed startContent in the Input.
|
|
691
|
+
*/
|
|
692
|
+
var stripHash = function (color) { return color.replace(/^#+/, ""); };
|
|
688
693
|
/**
|
|
689
694
|
* ColorPicker - Advanced color selection component
|
|
690
695
|
*
|
|
@@ -713,8 +718,9 @@ var ColorPicker = function (_a) {
|
|
|
713
718
|
var generatedId = React.useId();
|
|
714
719
|
var inputId = id || generatedId;
|
|
715
720
|
var t = __assign(__assign({}, defaultTranslations$d), translations);
|
|
716
|
-
// Local state for text input
|
|
717
|
-
|
|
721
|
+
// Local state for text input — holds the hex digits WITHOUT the leading "#".
|
|
722
|
+
// The "#" is rendered as a fixed startContent prefix.
|
|
723
|
+
var _m = React.useState(stripHash(value)), textValue = _m[0], setTextValue = _m[1];
|
|
718
724
|
var _o = React.useState(false), isInvalidFormat = _o[0], setIsInvalidFormat = _o[1];
|
|
719
725
|
// Recent colors state
|
|
720
726
|
var _p = React.useState([]), recentColors = _p[0], setRecentColors = _p[1];
|
|
@@ -756,7 +762,7 @@ var ColorPicker = function (_a) {
|
|
|
756
762
|
}, [value, enableRecentColors, maxRecentColors, recentColorsStorageKey]);
|
|
757
763
|
// Sync text value when prop value changes
|
|
758
764
|
React.useEffect(function () {
|
|
759
|
-
setTextValue(value);
|
|
765
|
+
setTextValue(stripHash(value));
|
|
760
766
|
setIsInvalidFormat(false);
|
|
761
767
|
}, [value]);
|
|
762
768
|
/**
|
|
@@ -764,7 +770,7 @@ var ColorPicker = function (_a) {
|
|
|
764
770
|
*/
|
|
765
771
|
var handleColorPickerChange = function (e) {
|
|
766
772
|
var newColor = normalizeHexColor(e.target.value);
|
|
767
|
-
setTextValue(newColor);
|
|
773
|
+
setTextValue(stripHash(newColor));
|
|
768
774
|
setIsInvalidFormat(false);
|
|
769
775
|
onChange(newColor);
|
|
770
776
|
};
|
|
@@ -772,14 +778,17 @@ var ColorPicker = function (_a) {
|
|
|
772
778
|
* Handle text input change
|
|
773
779
|
*/
|
|
774
780
|
var handleTextChange = function (newValue) {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
781
|
+
// Strip any "#" the user types or pastes — the prefix is fixed in the UI.
|
|
782
|
+
var cleaned = stripHash(newValue);
|
|
783
|
+
setTextValue(cleaned);
|
|
784
|
+
// Validate the candidate hex color with "#" prepended
|
|
785
|
+
var candidate = "#".concat(cleaned);
|
|
786
|
+
if (isValidHexColor(candidate)) {
|
|
787
|
+
var normalized = normalizeHexColor(candidate);
|
|
779
788
|
setIsInvalidFormat(false);
|
|
780
789
|
onChange(normalized);
|
|
781
790
|
}
|
|
782
|
-
else if (
|
|
791
|
+
else if (cleaned.length >= 3) {
|
|
783
792
|
// Show error only if user has typed enough characters
|
|
784
793
|
setIsInvalidFormat(true);
|
|
785
794
|
}
|
|
@@ -794,7 +803,7 @@ var ColorPicker = function (_a) {
|
|
|
794
803
|
if (disabled)
|
|
795
804
|
return;
|
|
796
805
|
var normalized = normalizeHexColor(colorValue);
|
|
797
|
-
setTextValue(normalized);
|
|
806
|
+
setTextValue(stripHash(normalized));
|
|
798
807
|
setIsInvalidFormat(false);
|
|
799
808
|
onChange(normalized);
|
|
800
809
|
};
|
|
@@ -804,9 +813,9 @@ var ColorPicker = function (_a) {
|
|
|
804
813
|
var renderColorCircle = function (colorValue, colorName, isSelected) { return (jsxRuntime.jsx("button", { type: "button", disabled: disabled, onClick: function () { return handlePredefinedColorClick(colorValue); }, className: "\n\t\t\t\tw-8 h-8 rounded-full border-2 cursor-pointer transition-all\n\t\t\t\tfocus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-1\n\t\t\t\t".concat(disabled ? "opacity-50 cursor-not-allowed" : "hover:scale-110", "\n\t\t\t\t").concat(isSelected
|
|
805
814
|
? "border-primary-500 scale-110 ring-2 ring-primary-500 ring-offset-1"
|
|
806
815
|
: "border-default-700", "\n\t\t\t"), style: { backgroundColor: colorValue }, title: colorName, "aria-label": colorName }, colorValue)); };
|
|
807
|
-
return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 ".concat(className), children: [label && (jsxRuntime.jsxs("label", { htmlFor: inputId, className: "block text-sm font-medium text-foreground", children: [label, required && jsxRuntime.jsx("span", { className: "text-danger ml-1", children: "*" })] })), jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("input", { type: "color", id: inputId, name: name, value: textValue, onChange: handleColorPickerChange, disabled: disabled, className: "\n\t\t\t\t\t\t\tw-10 h-10 rounded-lg cursor-pointer border-2 flex-shrink-0\n\t\t\t\t\t\t\ttransition-colors appearance-none bg-transparent p-0.5\n\t\t\t\t\t\t\tfocus:border-primary-500\n\t\t\t\t\t\t\t".concat(disabled ? "opacity-50 cursor-not-allowed" : "hover:border-default-400", "\n\t\t\t\t\t\t\t").concat(error
|
|
816
|
+
return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 ".concat(className), children: [label && (jsxRuntime.jsxs("label", { htmlFor: inputId, className: "block text-sm font-medium text-foreground", children: [label, required && jsxRuntime.jsx("span", { className: "text-danger ml-1", children: "*" })] })), jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("input", { type: "color", id: inputId, name: name, value: "#".concat(textValue), onChange: handleColorPickerChange, disabled: disabled, className: "\n\t\t\t\t\t\t\tw-10 h-10 rounded-lg cursor-pointer border-2 flex-shrink-0\n\t\t\t\t\t\t\ttransition-colors appearance-none bg-transparent p-0.5\n\t\t\t\t\t\t\tfocus:border-primary-500\n\t\t\t\t\t\t\t".concat(disabled ? "opacity-50 cursor-not-allowed" : "hover:border-default-400", "\n\t\t\t\t\t\t\t").concat(error
|
|
808
817
|
? "border-danger dark:border-danger-400"
|
|
809
|
-
: "border-default-300 dark:border-default-700", "\n\t\t\t\t\t\t"), "aria-label": t.customColorLabel, title: t.customColorLabel }), jsxRuntime.jsx(react.Input, { type: "text", value: textValue, onValueChange: handleTextChange, placeholder: t.placeholder, disabled: disabled, isInvalid: error || isInvalidFormat, size: "sm", variant: "bordered", classNames: {
|
|
818
|
+
: "border-default-300 dark:border-default-700", "\n\t\t\t\t\t\t"), "aria-label": t.customColorLabel, title: t.customColorLabel }), jsxRuntime.jsx(react.Input, { type: "text", value: textValue, onValueChange: handleTextChange, placeholder: t.placeholder, disabled: disabled, isInvalid: error || isInvalidFormat, size: "sm", variant: "bordered", maxLength: 6, classNames: {
|
|
810
819
|
input: "uppercase font-mono text-small",
|
|
811
820
|
inputWrapper: "min-h-8 h-8 focus-within:!border-primary-500",
|
|
812
821
|
}, startContent: jsxRuntime.jsx("span", { className: "text-default-400 text-sm", children: "#" }) })] }), (error || isInvalidFormat) && (jsxRuntime.jsx("p", { className: "text-tiny text-danger", children: isInvalidFormat ? t.invalidColorFormat : errorText }))] }), showPredefinedColors && predefinedColors.length > 0 && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("p", { className: "text-xs font-medium text-default-600 mb-2", children: t.predefinedColorsLabel }), jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: predefinedColors.map(function (color) {
|
|
@@ -6939,7 +6948,7 @@ var DrawerFiltersHeader = function (_a) {
|
|
|
6939
6948
|
return (jsxRuntime.jsxs("div", { className: "px-6 pt-10", children: [jsxRuntime.jsx(H2, { className: "text-xl font-semibold text-foreground mb-2", children: title }), jsxRuntime.jsx(P, { className: "text-default-500", children: description })] }));
|
|
6940
6949
|
};
|
|
6941
6950
|
|
|
6942
|
-
var NO_YEAR_CLASS = "[&_[data-type='year']]:
|
|
6951
|
+
var NO_YEAR_CLASS = "[&_[data-type='year']]:sr-only [&_[data-type='literal']:has(+[data-type='year'])]:hidden";
|
|
6943
6952
|
var DayMonthPicker = function (_a) {
|
|
6944
6953
|
var value = _a.value, onChange = _a.onChange, translations = _a.translations;
|
|
6945
6954
|
var t = __assign({ dayMonthAriaLabel: "Seleccionar mes y día", dayMonthRangeAriaLabel: "Seleccionar rango de mes y día", dayMonthSingleOption: "Día específico", dayMonthRangeOption: "Rango de fechas" }, translations);
|
|
@@ -6973,7 +6982,22 @@ var DayMonthPicker = function (_a) {
|
|
|
6973
6982
|
var currentYearDate = $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2());
|
|
6974
6983
|
var pickerValue = (value === null || value === void 0 ? void 0 : value.type) === "dayMonth" ? value.dayMonth : null;
|
|
6975
6984
|
var rangeValue = (value === null || value === void 0 ? void 0 : value.type) === "dayMonthRange" ? value.dayMonthRange : null;
|
|
6976
|
-
|
|
6985
|
+
// When the year segment (sr-only, focusable) receives focus after the user
|
|
6986
|
+
// types month and day, auto-type the current year so onChange can fire.
|
|
6987
|
+
// Only attached to uncontrolled pickers (no committed value yet).
|
|
6988
|
+
var autoFillYear = React.useCallback(function () {
|
|
6989
|
+
var year = $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2()).year.toString();
|
|
6990
|
+
setTimeout(function () {
|
|
6991
|
+
var target = document.activeElement;
|
|
6992
|
+
if ((target === null || target === void 0 ? void 0 : target.getAttribute("data-type")) === "year") {
|
|
6993
|
+
for (var _i = 0, year_1 = year; _i < year_1.length; _i++) {
|
|
6994
|
+
var char = year_1[_i];
|
|
6995
|
+
target.dispatchEvent(new KeyboardEvent("keydown", { key: char, bubbles: true, cancelable: true }));
|
|
6996
|
+
}
|
|
6997
|
+
}
|
|
6998
|
+
}, 0);
|
|
6999
|
+
}, []);
|
|
7000
|
+
return (jsxRuntime.jsxs("div", { className: "w-full flex flex-wrap xs:gap-5 justify-between items-center", children: [jsxRuntime.jsxs(react.RadioGroup, { color: "primary", orientation: "horizontal", size: "sm", value: mode, onValueChange: handleModeChange, children: [jsxRuntime.jsx(react.Radio, { value: "single", children: t.dayMonthSingleOption }), jsxRuntime.jsx(react.Radio, { value: "range", children: t.dayMonthRangeOption })] }), mode === "single" ? (pickerValue ? (jsxRuntime.jsx(DatePicker, { value: pickerValue, onChange: handleSingleChange, "aria-label": t.dayMonthAriaLabel, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-40 ".concat(NO_YEAR_CLASS) }, "dmp-c")) : (jsxRuntime.jsx(DatePicker, { placeholderValue: currentYearDate, onChange: handleSingleChange, onFocus: autoFillYear, "aria-label": t.dayMonthAriaLabel, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-40 ".concat(NO_YEAR_CLASS) }, "dmp-u"))) : (rangeValue ? (jsxRuntime.jsx(DateRangePicker, { value: rangeValue, onChange: handleRangeChange, "aria-label": t.dayMonthRangeAriaLabel, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-xs ".concat(NO_YEAR_CLASS) }, "dmpr-c")) : (jsxRuntime.jsx(DateRangePicker, { placeholderValue: currentYearDate, onChange: handleRangeChange, onFocus: autoFillYear, "aria-label": t.dayMonthRangeAriaLabel, endContent: jsxRuntime.jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-xs ".concat(NO_YEAR_CLASS) }, "dmpr-u")))] }));
|
|
6977
7001
|
};
|
|
6978
7002
|
|
|
6979
7003
|
/**
|
package/dist/index.esm.js
CHANGED
|
@@ -686,6 +686,11 @@ var normalizeHexColor = function (color) {
|
|
|
686
686
|
}
|
|
687
687
|
return color.toUpperCase();
|
|
688
688
|
};
|
|
689
|
+
/**
|
|
690
|
+
* Strips leading "#" characters so the text input shows only the hex digits.
|
|
691
|
+
* The "#" prefix is rendered as a fixed startContent in the Input.
|
|
692
|
+
*/
|
|
693
|
+
var stripHash = function (color) { return color.replace(/^#+/, ""); };
|
|
689
694
|
/**
|
|
690
695
|
* ColorPicker - Advanced color selection component
|
|
691
696
|
*
|
|
@@ -714,8 +719,9 @@ var ColorPicker = function (_a) {
|
|
|
714
719
|
var generatedId = useId();
|
|
715
720
|
var inputId = id || generatedId;
|
|
716
721
|
var t = __assign(__assign({}, defaultTranslations$d), translations);
|
|
717
|
-
// Local state for text input
|
|
718
|
-
|
|
722
|
+
// Local state for text input — holds the hex digits WITHOUT the leading "#".
|
|
723
|
+
// The "#" is rendered as a fixed startContent prefix.
|
|
724
|
+
var _m = useState(stripHash(value)), textValue = _m[0], setTextValue = _m[1];
|
|
719
725
|
var _o = useState(false), isInvalidFormat = _o[0], setIsInvalidFormat = _o[1];
|
|
720
726
|
// Recent colors state
|
|
721
727
|
var _p = useState([]), recentColors = _p[0], setRecentColors = _p[1];
|
|
@@ -757,7 +763,7 @@ var ColorPicker = function (_a) {
|
|
|
757
763
|
}, [value, enableRecentColors, maxRecentColors, recentColorsStorageKey]);
|
|
758
764
|
// Sync text value when prop value changes
|
|
759
765
|
useEffect(function () {
|
|
760
|
-
setTextValue(value);
|
|
766
|
+
setTextValue(stripHash(value));
|
|
761
767
|
setIsInvalidFormat(false);
|
|
762
768
|
}, [value]);
|
|
763
769
|
/**
|
|
@@ -765,7 +771,7 @@ var ColorPicker = function (_a) {
|
|
|
765
771
|
*/
|
|
766
772
|
var handleColorPickerChange = function (e) {
|
|
767
773
|
var newColor = normalizeHexColor(e.target.value);
|
|
768
|
-
setTextValue(newColor);
|
|
774
|
+
setTextValue(stripHash(newColor));
|
|
769
775
|
setIsInvalidFormat(false);
|
|
770
776
|
onChange(newColor);
|
|
771
777
|
};
|
|
@@ -773,14 +779,17 @@ var ColorPicker = function (_a) {
|
|
|
773
779
|
* Handle text input change
|
|
774
780
|
*/
|
|
775
781
|
var handleTextChange = function (newValue) {
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
782
|
+
// Strip any "#" the user types or pastes — the prefix is fixed in the UI.
|
|
783
|
+
var cleaned = stripHash(newValue);
|
|
784
|
+
setTextValue(cleaned);
|
|
785
|
+
// Validate the candidate hex color with "#" prepended
|
|
786
|
+
var candidate = "#".concat(cleaned);
|
|
787
|
+
if (isValidHexColor(candidate)) {
|
|
788
|
+
var normalized = normalizeHexColor(candidate);
|
|
780
789
|
setIsInvalidFormat(false);
|
|
781
790
|
onChange(normalized);
|
|
782
791
|
}
|
|
783
|
-
else if (
|
|
792
|
+
else if (cleaned.length >= 3) {
|
|
784
793
|
// Show error only if user has typed enough characters
|
|
785
794
|
setIsInvalidFormat(true);
|
|
786
795
|
}
|
|
@@ -795,7 +804,7 @@ var ColorPicker = function (_a) {
|
|
|
795
804
|
if (disabled)
|
|
796
805
|
return;
|
|
797
806
|
var normalized = normalizeHexColor(colorValue);
|
|
798
|
-
setTextValue(normalized);
|
|
807
|
+
setTextValue(stripHash(normalized));
|
|
799
808
|
setIsInvalidFormat(false);
|
|
800
809
|
onChange(normalized);
|
|
801
810
|
};
|
|
@@ -805,9 +814,9 @@ var ColorPicker = function (_a) {
|
|
|
805
814
|
var renderColorCircle = function (colorValue, colorName, isSelected) { return (jsx("button", { type: "button", disabled: disabled, onClick: function () { return handlePredefinedColorClick(colorValue); }, className: "\n\t\t\t\tw-8 h-8 rounded-full border-2 cursor-pointer transition-all\n\t\t\t\tfocus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-1\n\t\t\t\t".concat(disabled ? "opacity-50 cursor-not-allowed" : "hover:scale-110", "\n\t\t\t\t").concat(isSelected
|
|
806
815
|
? "border-primary-500 scale-110 ring-2 ring-primary-500 ring-offset-1"
|
|
807
816
|
: "border-default-700", "\n\t\t\t"), style: { backgroundColor: colorValue }, title: colorName, "aria-label": colorName }, colorValue)); };
|
|
808
|
-
return (jsxs("div", { className: "flex flex-col gap-3 ".concat(className), children: [label && (jsxs("label", { htmlFor: inputId, className: "block text-sm font-medium text-foreground", children: [label, required && jsx("span", { className: "text-danger ml-1", children: "*" })] })), jsxs("div", { className: "flex flex-col gap-1", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("input", { type: "color", id: inputId, name: name, value: textValue, onChange: handleColorPickerChange, disabled: disabled, className: "\n\t\t\t\t\t\t\tw-10 h-10 rounded-lg cursor-pointer border-2 flex-shrink-0\n\t\t\t\t\t\t\ttransition-colors appearance-none bg-transparent p-0.5\n\t\t\t\t\t\t\tfocus:border-primary-500\n\t\t\t\t\t\t\t".concat(disabled ? "opacity-50 cursor-not-allowed" : "hover:border-default-400", "\n\t\t\t\t\t\t\t").concat(error
|
|
817
|
+
return (jsxs("div", { className: "flex flex-col gap-3 ".concat(className), children: [label && (jsxs("label", { htmlFor: inputId, className: "block text-sm font-medium text-foreground", children: [label, required && jsx("span", { className: "text-danger ml-1", children: "*" })] })), jsxs("div", { className: "flex flex-col gap-1", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("input", { type: "color", id: inputId, name: name, value: "#".concat(textValue), onChange: handleColorPickerChange, disabled: disabled, className: "\n\t\t\t\t\t\t\tw-10 h-10 rounded-lg cursor-pointer border-2 flex-shrink-0\n\t\t\t\t\t\t\ttransition-colors appearance-none bg-transparent p-0.5\n\t\t\t\t\t\t\tfocus:border-primary-500\n\t\t\t\t\t\t\t".concat(disabled ? "opacity-50 cursor-not-allowed" : "hover:border-default-400", "\n\t\t\t\t\t\t\t").concat(error
|
|
809
818
|
? "border-danger dark:border-danger-400"
|
|
810
|
-
: "border-default-300 dark:border-default-700", "\n\t\t\t\t\t\t"), "aria-label": t.customColorLabel, title: t.customColorLabel }), jsx(Input$1, { type: "text", value: textValue, onValueChange: handleTextChange, placeholder: t.placeholder, disabled: disabled, isInvalid: error || isInvalidFormat, size: "sm", variant: "bordered", classNames: {
|
|
819
|
+
: "border-default-300 dark:border-default-700", "\n\t\t\t\t\t\t"), "aria-label": t.customColorLabel, title: t.customColorLabel }), jsx(Input$1, { type: "text", value: textValue, onValueChange: handleTextChange, placeholder: t.placeholder, disabled: disabled, isInvalid: error || isInvalidFormat, size: "sm", variant: "bordered", maxLength: 6, classNames: {
|
|
811
820
|
input: "uppercase font-mono text-small",
|
|
812
821
|
inputWrapper: "min-h-8 h-8 focus-within:!border-primary-500",
|
|
813
822
|
}, startContent: jsx("span", { className: "text-default-400 text-sm", children: "#" }) })] }), (error || isInvalidFormat) && (jsx("p", { className: "text-tiny text-danger", children: isInvalidFormat ? t.invalidColorFormat : errorText }))] }), showPredefinedColors && predefinedColors.length > 0 && (jsxs("div", { children: [jsx("p", { className: "text-xs font-medium text-default-600 mb-2", children: t.predefinedColorsLabel }), jsx("div", { className: "flex flex-wrap gap-2", children: predefinedColors.map(function (color) {
|
|
@@ -6940,7 +6949,7 @@ var DrawerFiltersHeader = function (_a) {
|
|
|
6940
6949
|
return (jsxs("div", { className: "px-6 pt-10", children: [jsx(H2, { className: "text-xl font-semibold text-foreground mb-2", children: title }), jsx(P, { className: "text-default-500", children: description })] }));
|
|
6941
6950
|
};
|
|
6942
6951
|
|
|
6943
|
-
var NO_YEAR_CLASS = "[&_[data-type='year']]:
|
|
6952
|
+
var NO_YEAR_CLASS = "[&_[data-type='year']]:sr-only [&_[data-type='literal']:has(+[data-type='year'])]:hidden";
|
|
6944
6953
|
var DayMonthPicker = function (_a) {
|
|
6945
6954
|
var value = _a.value, onChange = _a.onChange, translations = _a.translations;
|
|
6946
6955
|
var t = __assign({ dayMonthAriaLabel: "Seleccionar mes y día", dayMonthRangeAriaLabel: "Seleccionar rango de mes y día", dayMonthSingleOption: "Día específico", dayMonthRangeOption: "Rango de fechas" }, translations);
|
|
@@ -6974,7 +6983,22 @@ var DayMonthPicker = function (_a) {
|
|
|
6974
6983
|
var currentYearDate = $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2());
|
|
6975
6984
|
var pickerValue = (value === null || value === void 0 ? void 0 : value.type) === "dayMonth" ? value.dayMonth : null;
|
|
6976
6985
|
var rangeValue = (value === null || value === void 0 ? void 0 : value.type) === "dayMonthRange" ? value.dayMonthRange : null;
|
|
6977
|
-
|
|
6986
|
+
// When the year segment (sr-only, focusable) receives focus after the user
|
|
6987
|
+
// types month and day, auto-type the current year so onChange can fire.
|
|
6988
|
+
// Only attached to uncontrolled pickers (no committed value yet).
|
|
6989
|
+
var autoFillYear = useCallback(function () {
|
|
6990
|
+
var year = $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2()).year.toString();
|
|
6991
|
+
setTimeout(function () {
|
|
6992
|
+
var target = document.activeElement;
|
|
6993
|
+
if ((target === null || target === void 0 ? void 0 : target.getAttribute("data-type")) === "year") {
|
|
6994
|
+
for (var _i = 0, year_1 = year; _i < year_1.length; _i++) {
|
|
6995
|
+
var char = year_1[_i];
|
|
6996
|
+
target.dispatchEvent(new KeyboardEvent("keydown", { key: char, bubbles: true, cancelable: true }));
|
|
6997
|
+
}
|
|
6998
|
+
}
|
|
6999
|
+
}, 0);
|
|
7000
|
+
}, []);
|
|
7001
|
+
return (jsxs("div", { className: "w-full flex flex-wrap xs:gap-5 justify-between items-center", children: [jsxs(RadioGroup, { color: "primary", orientation: "horizontal", size: "sm", value: mode, onValueChange: handleModeChange, children: [jsx(Radio, { value: "single", children: t.dayMonthSingleOption }), jsx(Radio, { value: "range", children: t.dayMonthRangeOption })] }), mode === "single" ? (pickerValue ? (jsx(DatePicker, { value: pickerValue, onChange: handleSingleChange, "aria-label": t.dayMonthAriaLabel, endContent: jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-40 ".concat(NO_YEAR_CLASS) }, "dmp-c")) : (jsx(DatePicker, { placeholderValue: currentYearDate, onChange: handleSingleChange, onFocus: autoFillYear, "aria-label": t.dayMonthAriaLabel, endContent: jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-40 ".concat(NO_YEAR_CLASS) }, "dmp-u"))) : (rangeValue ? (jsx(DateRangePicker, { value: rangeValue, onChange: handleRangeChange, "aria-label": t.dayMonthRangeAriaLabel, endContent: jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-xs ".concat(NO_YEAR_CLASS) }, "dmpr-c")) : (jsx(DateRangePicker, { placeholderValue: currentYearDate, onChange: handleRangeChange, onFocus: autoFillYear, "aria-label": t.dayMonthRangeAriaLabel, endContent: jsx(IconComponent, { icon: "solar:calendar-outline" }), className: "w-full md:w-auto md:max-w-xs ".concat(NO_YEAR_CLASS) }, "dmpr-u")))] }));
|
|
6978
7002
|
};
|
|
6979
7003
|
|
|
6980
7004
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../../src/components/color-picker/ColorPicker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACX,gBAAgB,EAGhB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../../src/components/color-picker/ColorPicker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACX,gBAAgB,EAGhB,MAAM,qBAAqB,CAAC;AAkD7B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA2PlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DayMonthPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/drawer-filters/_internal/DayMonthPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAKxE,UAAU,mBAAmB;IAC5B,IAAI,EAAE,UAAU,GAAG,eAAe,CAAC;IACnC,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;CAC5C;AAED,UAAU,mBAAmB;IAC5B,KAAK,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC/C,YAAY,CAAC,EAAE,yBAAyB,CAAC;CACzC;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"DayMonthPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/drawer-filters/_internal/DayMonthPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAKxE,UAAU,mBAAmB;IAC5B,IAAI,EAAE,UAAU,GAAG,eAAe,CAAC;IACnC,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;CAC5C;AAED,UAAU,mBAAmB;IAC5B,KAAK,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC/C,YAAY,CAAC,EAAE,yBAAyB,CAAC;CACzC;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA8HxD,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { DrawerFilters } from "./DrawerFilters";
|
|
2
|
-
export type { DrawerFiltersProps, DrawerFiltersConfig, DrawerFiltersTranslations, FilterData, FilterType, FilterValues, SelectFilterData, MultiSelectFilterData, RangeFilterData, DateFilterData, DateFilterValue, } from "./DrawerFilters.types";
|
|
2
|
+
export type { DrawerFiltersProps, DrawerFiltersConfig, DrawerFiltersTranslations, FilterData, FilterType, FilterValues, SelectFilterData, SelectFilterValue, MultiSelectFilterData, MultiSelectFilterValue, RangeFilterData, RangeFilterValue, DateFilterData, DateFilterValue, TextFilterValue, NumberFilterValue, } from "./DrawerFilters.types";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer-filters/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,YAAY,EACX,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer-filters/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,YAAY,EACX,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,iBAAiB,GACjB,MAAM,uBAAuB,CAAC"}
|