pesona-ui 1.0.23 → 1.0.25

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/index.esm.js CHANGED
@@ -7807,8 +7807,19 @@ const Popover = ({ className, children, text }) => {
7807
7807
  const ModalHeader = ({ children, className = '', ...rest }) => (React.createElement("div", { className: `modal-header ${className}`, ...rest }, children));
7808
7808
  const ModalBody = ({ children, className = '', ...rest }) => (React.createElement("div", { className: `modal-body ${className}`, ...rest }, children));
7809
7809
  const ModalFooter = ({ children, className = '', ...rest }) => (React.createElement("div", { className: `modal-footer ${className}`, ...rest }, children));
7810
- const Modal = ({ children, className = '', ...rest }) => createPortal(React.createElement("div", { className: "modal", ...rest },
7811
- React.createElement("div", { className: `modal-dialog ${className}` }, children)), document.body);
7810
+ const Modal = ({ children, className = '', ...rest }) => {
7811
+ // Lock scroll on mount
7812
+ useEffect(() => {
7813
+ // Lock scroll
7814
+ document.body.style.overflow = 'hidden';
7815
+ // Cleanup on unmount
7816
+ return () => {
7817
+ document.body.style.overflow = '';
7818
+ };
7819
+ }, []);
7820
+ return createPortal(React.createElement("div", { className: "modal", ...rest },
7821
+ React.createElement("div", { className: `modal-dialog ${className}` }, children)), document.body);
7822
+ };
7812
7823
 
7813
7824
  const Accordion = ({ defaultIndex = 0, children }) => {
7814
7825
  const [activeIndex, setActiveIndex] = useState(defaultIndex);
@@ -8310,6 +8321,22 @@ const Input = React.forwardRef(({ className, name, label, message, floatingLabel
8310
8321
  error ? (React.createElement("small", { className: "form-message text-danger" }, error)) : (message && React.createElement("small", { className: "form-message text-muted" }, message))));
8311
8322
  });
8312
8323
 
8324
+ const InputWithAction = React.forwardRef(({ className, name, label, message, floatingLabel, error, actionIcon, actionButtonLabel, actionButtonHandler, ...rest }, ref) => {
8325
+ return (React.createElement(React.Fragment, null,
8326
+ !floatingLabel && label && (React.createElement("label", { htmlFor: name },
8327
+ label,
8328
+ " ",
8329
+ rest.required && React.createElement("span", { className: "text-danger" }, "*"))),
8330
+ React.createElement("div", { className: "input-group-icon" },
8331
+ React.createElement("input", { type: "text", className: `form-control ${className}`, id: name, name: name, placeholder: !floatingLabel ? ' ' : '', ref: ref, ...rest }),
8332
+ actionIcon && (React.createElement(Button, { role: "button", className: "icon", onClick: actionButtonHandler, tabIndex: 0, "aria-label": actionButtonLabel, disabled: rest.disabled }, actionIcon))),
8333
+ floatingLabel && label && (React.createElement("label", { htmlFor: name },
8334
+ label,
8335
+ " ",
8336
+ rest.required && React.createElement("span", { className: "text-danger" }, "*"))),
8337
+ error ? (React.createElement("small", { className: "form-message text-danger" }, error)) : (message && React.createElement("small", { className: "form-message text-muted" }, message))));
8338
+ });
8339
+
8313
8340
  const InputDate = React.forwardRef(({ name, label, message, floatingLabel, value = '', error, ...rest }, ref) => {
8314
8341
  const [showDatePicker, setShowDatePicker] = useState(false);
8315
8342
  const [selectedDate, setSelectedDate] = useState(value ?? '');
@@ -8344,7 +8371,7 @@ const InputDate = React.forwardRef(({ name, label, message, floatingLabel, value
8344
8371
  rest.required && React.createElement("span", { className: "text-danger" }, "*"))),
8345
8372
  React.createElement("div", { className: "input-group-icon" },
8346
8373
  React.createElement(Input, { type: "text", className: "form-control", id: name, name: name, placeholder: !floatingLabel ? ' ' : '', ref: ref, value: selectedDate, ...rest }),
8347
- React.createElement("span", { role: "button", className: "icon", onClick: toggleDatePicker },
8374
+ React.createElement(Button, { role: "button", className: "icon", onClick: toggleDatePicker, tabIndex: 0, "aria-label": "Open date picker", disabled: rest.disabled },
8348
8375
  React.createElement(MdCalendarMonth, null)),
8349
8376
  showDatePicker && (React.createElement("div", { ref: datePickerRef },
8350
8377
  React.createElement(DatePicker, { onSelect: handleDateSelect, defaultDate: selectedDate })))),
@@ -8742,5 +8769,5 @@ const TablePickSelectedItems = ({ count, selectedItem, selectedRows, }) => {
8742
8769
  " Gunakan")));
8743
8770
  };
8744
8771
 
8745
- export { Accordion, AccordionSection, AccordionSectionBody, AccordionSectionFooter, Alert, Badge, Box, Button, Callout, Card, CardBody, CardFooter, CardHeader, Checkbox, CheckboxAgreement, CircularProgress, CircularProgressWithLabel, ClearInput, ConfirmationAlert, DatePicker, DivTable, DivTableBody, DivTableCell, DivTableFooter, DivTableHeader, DivTableRow, Dropdown, DropdownContent, DropdownDatePicker, DropdownMenu, DropdownToggle, FormCheckbox, FormContainer, FormGroup, FormRadio, Input, InputDate, InputFile, InputImageSize, InputTextArea, InputWysiwyg, LinearProgress, ListItem, ListView, LoadingBar, Modal, ModalBody, ModalFooter, ModalHeader, Popover, Radio, RadioButtonGroup, Select, SelectMultiple, SelectWithSearch, Spinner, Switch, Tab, TabGroup, Table, TableBody, TableCell, TableDeleteSelectedItems, TableFooter, TableHeader, TablePaginating, TablePickSelectedItems, TableRow, Tabs, Tooltip };
8772
+ export { Accordion, AccordionSection, AccordionSectionBody, AccordionSectionFooter, Alert, Badge, Box, Button, Callout, Card, CardBody, CardFooter, CardHeader, Checkbox, CheckboxAgreement, CircularProgress, CircularProgressWithLabel, ClearInput, ConfirmationAlert, DatePicker, DivTable, DivTableBody, DivTableCell, DivTableFooter, DivTableHeader, DivTableRow, Dropdown, DropdownContent, DropdownDatePicker, DropdownMenu, DropdownToggle, FormCheckbox, FormContainer, FormGroup, FormRadio, Input, InputDate, InputFile, InputImageSize, InputTextArea, InputWithAction, InputWysiwyg, LinearProgress, ListItem, ListView, LoadingBar, Modal, ModalBody, ModalFooter, ModalHeader, Popover, Radio, RadioButtonGroup, Select, SelectMultiple, SelectWithSearch, Spinner, Switch, Tab, TabGroup, Table, TableBody, TableCell, TableDeleteSelectedItems, TableFooter, TableHeader, TablePaginating, TablePickSelectedItems, TableRow, Tabs, Tooltip };
8746
8773
  //# sourceMappingURL=index.esm.js.map