pge-front-common 14.0.17 → 14.0.19
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/lib/components/Select/index.d.ts +1 -1
- package/lib/components/SkeletonLoader/index.d.ts +6 -0
- package/lib/components/SkeletonLoader/skeletonloader.stories.d.ts +8 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.esm.js +18 -4
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +18 -4
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { SelectDefaultProps } from "./index.types";
|
|
3
|
-
declare const SelectDefault: ({ name, control, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, }: SelectDefaultProps) => React.JSX.Element;
|
|
3
|
+
declare const SelectDefault: ({ name, control, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, handleInputChange, }: SelectDefaultProps) => React.JSX.Element;
|
|
4
4
|
export default SelectDefault;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { SkeletonLoader } from "./index";
|
|
3
|
+
declare const meta: Meta<typeof SkeletonLoader>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Avatar: Story;
|
|
8
|
+
export declare const Card: Story;
|
package/lib/index.d.ts
CHANGED
|
@@ -381,7 +381,7 @@ type OptionsProps = {
|
|
|
381
381
|
value: string;
|
|
382
382
|
};
|
|
383
383
|
|
|
384
|
-
declare const SelectDefault: ({ name, control, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, }: SelectDefaultProps) => React$1.JSX.Element;
|
|
384
|
+
declare const SelectDefault: ({ name, control, optionsSelect, placeholder, isDisabled, label, hasError, handleChange, isRequired, value, handleInputChange, }: SelectDefaultProps) => React$1.JSX.Element;
|
|
385
385
|
|
|
386
386
|
interface ModalProps$1 {
|
|
387
387
|
isModalOpen: boolean;
|
package/lib/index.esm.js
CHANGED
|
@@ -1105,10 +1105,20 @@ var SelectPagination = function (_a) {
|
|
|
1105
1105
|
setIsOpen(false);
|
|
1106
1106
|
};
|
|
1107
1107
|
return (React__default.createElement("div", { ref: selectRef, className: "".concat(styles$e.selectContainerPagination, " ").concat(className) },
|
|
1108
|
-
React__default.createElement("div", { className: styles$e.selectTrigger
|
|
1108
|
+
React__default.createElement("div", { className: styles$e.selectTrigger, tabIndex: 0, onKeyDown: function (e) {
|
|
1109
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1110
|
+
e.preventDefault();
|
|
1111
|
+
setIsOpen(function (prev) { return !prev; });
|
|
1112
|
+
}
|
|
1113
|
+
} },
|
|
1109
1114
|
React__default.createElement("span", { className: styles$e.selectedValue }, selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label.padStart(2, "0")),
|
|
1110
1115
|
React__default.createElement(IconTriangleRecall, { onClick: function () { return setIsOpen(!isOpen); }, className: "".concat(styles$e.icon, " ").concat(isOpen ? styles$e.iconOpen : ""), fill: "#005A92" })),
|
|
1111
|
-
isOpen && (React__default.createElement("div", { className: styles$e.optionsList }, options.map(function (option) { return (React__default.createElement("div", { key: option.value, className: "".concat(styles$e.option, " ").concat(option.value === value ? styles$e.selected : ""), onClick: function () { return handleSelect(option.value); }
|
|
1116
|
+
isOpen && (React__default.createElement("div", { className: styles$e.optionsList }, options.map(function (option) { return (React__default.createElement("div", { key: option.value, tabIndex: 0, className: "".concat(styles$e.option, " ").concat(option.value === value ? styles$e.selected : ""), onClick: function () { return handleSelect(option.value); }, onKeyDown: function (e) {
|
|
1117
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1118
|
+
e.preventDefault();
|
|
1119
|
+
handleSelect(option.value);
|
|
1120
|
+
}
|
|
1121
|
+
} }, option.label.padStart(2, "0"))); })))));
|
|
1112
1122
|
};
|
|
1113
1123
|
|
|
1114
1124
|
var IconArrowLeft = function (props) {
|
|
@@ -21380,7 +21390,7 @@ var selectColourStyles = function (isInvalid) { return ({
|
|
|
21380
21390
|
},
|
|
21381
21391
|
}); };
|
|
21382
21392
|
var SelectDefault = function (_a) {
|
|
21383
|
-
var name = _a.name, control = _a.control, optionsSelect = _a.optionsSelect, placeholder = _a.placeholder, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, label = _a.label, _c = _a.hasError, hasError = _c === void 0 ? false : _c, handleChange = _a.handleChange, isRequired = _a.isRequired, value = _a.value;
|
|
21393
|
+
var name = _a.name, control = _a.control, optionsSelect = _a.optionsSelect, placeholder = _a.placeholder, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, label = _a.label, _c = _a.hasError, hasError = _c === void 0 ? false : _c, handleChange = _a.handleChange, isRequired = _a.isRequired, value = _a.value, handleInputChange = _a.handleInputChange;
|
|
21384
21394
|
var _d = useController({ name: name, control: control }), _e = _d.field; _e.onChange; _e.value; var rest = __rest(_e, ["onChange", "value"]), error = _d.fieldState.error;
|
|
21385
21395
|
var CustomDropdownIndicator = function () {
|
|
21386
21396
|
return (React.createElement("div", { className: styles$3.contentIcon },
|
|
@@ -21392,7 +21402,11 @@ var SelectDefault = function (_a) {
|
|
|
21392
21402
|
" ",
|
|
21393
21403
|
isRequired ? React.createElement("span", { className: styles$3.errorRequired }, "*") : null)),
|
|
21394
21404
|
React.createElement("div", { className: styles$3.selectElement },
|
|
21395
|
-
React.createElement(StateManagedSelect$1, __assign({ isMulti: false, isDisabled: isDisabled, options: optionsSelect, value: optionsSelect.find(function (opt) { return opt.value === value; }) || value, onChange: handleChange,
|
|
21405
|
+
React.createElement(StateManagedSelect$1, __assign({ isMulti: false, isDisabled: isDisabled, options: optionsSelect, value: optionsSelect.find(function (opt) { return opt.value === value; }) || value, onChange: handleChange, onInputChange: function (inputValue) {
|
|
21406
|
+
if (inputValue) {
|
|
21407
|
+
handleInputChange === null || handleInputChange === void 0 ? void 0 : handleInputChange(inputValue);
|
|
21408
|
+
}
|
|
21409
|
+
}, placeholder: placeholder, styles: selectColourStyles(hasError || !!error), isClearable: true, isSearchable: true, noOptionsMessage: function () { return "Nenhuma opção disponível"; }, components: { DropdownIndicator: CustomDropdownIndicator } }, rest))),
|
|
21396
21410
|
error && React.createElement("span", { className: styles$3.errorText }, error.message)));
|
|
21397
21411
|
};
|
|
21398
21412
|
|