@oliasoft-open-source/react-ui-library 4.6.15-beta-1 → 4.6.16

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.
Files changed (44) hide show
  1. package/README.md +12 -11
  2. package/dist/404.html +1 -0
  3. package/dist/index.d.ts +5 -0
  4. package/dist/index.js +28 -19
  5. package/dist/index.js.map +1 -1
  6. package/dist/storybook/assets/{Color-6VNJS4EI-zsSkOkZZ.js → Color-6VNJS4EI-YEDm9gbz.js} +1 -1
  7. package/dist/storybook/assets/{DocsRenderer-NNNQARDV-qG6IOFhG.js → DocsRenderer-NNNQARDV-NmCW-oyQ.js} +1 -1
  8. package/dist/storybook/assets/{WithTooltip-V3YHNWJZ-yOnEAyhN.js → WithTooltip-V3YHNWJZ-3DZ-8kE7.js} +1 -1
  9. package/dist/storybook/assets/{accordion.stories-dq4cVL-x.js → accordion.stories-lXs4IRds.js} +1 -1
  10. package/dist/storybook/assets/{buttons-and-links-A0m53_zo.js → buttons-and-links-2FBaBkFc.js} +1 -1
  11. package/dist/storybook/assets/{casing-loads.stories-_FNbyeeA.js → casing-loads.stories-g4yBGv5b.js} +1 -1
  12. package/dist/storybook/assets/{cell.stories-3MAfxgx0.js → cell.stories-sVyam_bx.js} +1 -1
  13. package/dist/storybook/assets/{chunk-HLWAVYOI-GsXUOgxA.js → chunk-HLWAVYOI-tHzaOxem.js} +1 -1
  14. package/dist/storybook/assets/{color-q6tTUpFY.js → color-7OzxGyA_.js} +1 -1
  15. package/dist/storybook/assets/{file-input.stories-Ry6pP1Zp.js → file-input.stories-5kyAKS_C.js} +1 -1
  16. package/dist/storybook/assets/{footer.stories-qmAGeGs1.js → footer.stories-ZEZ_We0f.js} +1 -1
  17. package/dist/storybook/assets/{form.stories-Ey59t61k.js → form.stories-rXc4fhX5.js} +1 -1
  18. package/dist/storybook/assets/{formation.stories-Keaqq-1Z.js → formation.stories-062BdtdZ.js} +1 -1
  19. package/dist/storybook/assets/{formatter-SWP5E3XI-cZ_FW1kO.js → formatter-SWP5E3XI-_Igw7BUr.js} +1 -1
  20. package/dist/storybook/assets/{iframe-SjYxkjL0.js → iframe-CpYMK6kb.js} +2 -2
  21. package/dist/storybook/assets/{index-eZm9jYMB.js → index-K-0S6d15.js} +5 -5
  22. package/dist/storybook/assets/{input-validation-cA6NMipU.js → input-validation-gD2VptJq.js} +1 -1
  23. package/dist/storybook/assets/{inputs-HhHtsFTZ.js → inputs-xtYro1Lt.js} +1 -1
  24. package/dist/storybook/assets/{layout-forms-6ESvGeNK.js → layout-forms-NhJIOV9y.js} +1 -1
  25. package/dist/storybook/assets/{layout-general-45XaQyoR.js → layout-general-wuAEAmS1.js} +1 -1
  26. package/dist/storybook/assets/{modal.stories-VdULKoni.js → modal.stories-aZGhb1Cl.js} +1 -1
  27. package/dist/storybook/assets/{padding-and-spacing-kcyE8npU.js → padding-and-spacing-h7UETkPK.js} +1 -1
  28. package/dist/storybook/assets/{pop-confirm.stories-VnMlv9V7.js → pop-confirm.stories-6V_XrhKa.js} +1 -1
  29. package/dist/storybook/assets/popover-N9B8JT3G.js +1 -0
  30. package/dist/storybook/assets/{popover.stories-c_ZOMOy7.js → popover.stories-goIrT_jy.js} +1 -1
  31. package/dist/storybook/assets/{preview-l_O2seEt.js → preview-T-saggOw.js} +1 -1
  32. package/dist/storybook/assets/{preview-5sJhlF6_.js → preview-f-BBQod4.js} +2 -2
  33. package/dist/storybook/assets/{row.stories-uLjS3aLm.js → row.stories-ZibxnXR9.js} +1 -1
  34. package/dist/storybook/assets/{syntaxhighlighter-B5GMVT5T-4O5JDV7T.js → syntaxhighlighter-B5GMVT5T-d9li6xQn.js} +1 -1
  35. package/dist/storybook/assets/{table-ZBqRpa7M.js → table-kSTipYE0.js} +1 -1
  36. package/dist/storybook/assets/{table.stories-3JSl8GYJ.js → table.stories-zdRM5AV8.js} +1 -1
  37. package/dist/storybook/assets/{textarea-U_i0cI7f.js → textarea-JE26Eekm.js} +1 -1
  38. package/dist/storybook/assets/{textarea.stories-pGEjF8nH.js → textarea.stories-c1mkQU4s.js} +1 -1
  39. package/dist/storybook/assets/{title.stories-JpJGF0vE.js → title.stories-tcfNoA6z.js} +1 -1
  40. package/dist/storybook/assets/{unit-table.stories-kapwCHI6.js → unit-table.stories-9k8rllRh.js} +1 -1
  41. package/dist/storybook/iframe.html +1 -1
  42. package/dist/storybook/project.json +1 -1
  43. package/package.json +1 -1
  44. package/dist/storybook/assets/popover-1CwIRm4P.js +0 -1
package/README.md CHANGED
@@ -1460,17 +1460,18 @@ The `Popover` component displays additional content or options related to a spec
1460
1460
 
1461
1461
  ### Props
1462
1462
 
1463
- | Prop | Description | Default Value |
1464
- |------------------------|----------------------------------------------------------------------------------------------------------------------|---------------|
1465
- | `children` | The element that triggers the display of the popover content. | - |
1466
- | `content` | The content to be displayed inside the popover. | - |
1467
- | `placement` | The placement of the popover relative to its trigger element. | `'top-center'`|
1468
- | `closeOnOutsideClick` | A boolean indicating whether the popover should close when clicking outside of it. | `true` |
1469
- | `fullWidth` | A boolean indicating whether the popover should take up the full width of its container. | `false` |
1470
- | `showCloseButton` | A boolean indicating whether to display a close button within the popover. | `false` |
1471
- | `testId` | A test ID for the popover component, used for testing purposes. | - |
1472
- | `disabled` | A boolean indicating whether the popover is disabled and should not be triggered. | `false` |
1473
- | `overflowContainer` | A boolean indicating whether the popover content should be constrained within its container if it overflows. | `false` |
1463
+ | Prop | Description | Default Value |
1464
+ |-----------------------|--------------------------------------------------------------------------------------------------------------|----------------|
1465
+ | `children` | The element that triggers the display of the popover content. | - |
1466
+ | `content` | The content to be displayed inside the popover. | - |
1467
+ | `placement` | The placement of the popover relative to its trigger element. | `'top-center'` |
1468
+ | `closeOnOutsideClick` | A boolean indicating whether the popover should close when clicking outside of it. | `true` |
1469
+ | `fullWidth` | A boolean indicating whether the popover should take up the full width of its container. | `false` |
1470
+ | `showCloseButton` | A boolean indicating whether to display a close button within the popover. | `false` |
1471
+ | `testId` | A test ID for the popover component, used for testing purposes. | - |
1472
+ | `disabled` | A boolean indicating whether the popover is disabled and should not be triggered. | `false` |
1473
+ | `isOpen` | Controls the visibility of the popover. If defined, the popover is in controlled mode. | - |
1474
+ | `onToggle` | Callback function that is called when the popover is opened or closed. Receives the new state as an argument.| - |
1474
1475
 
1475
1476
  ### Usage Example
1476
1477
 
package/dist/404.html ADDED
@@ -0,0 +1 @@
1
+ <!doctype html><head><title>React UI Library</title><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1" user-scalable="no"><meta name="apple-mobile-web-app-capable" content="yes"><script type="module" crossorigin src="/react-ui-library/assets/index-noRhVNRn.js"></script><link rel="stylesheet" crossorigin href="/react-ui-library/assets/index-UHom3TOS.css"></head><body><div id="content"></div></body>
package/dist/index.d.ts CHANGED
@@ -1536,6 +1536,11 @@ export declare interface ITreeProps {
1536
1536
  }
1537
1537
 
1538
1538
  declare interface IUnitConfigItem {
1539
+ onChange?: (params: {
1540
+ oldUnit: string;
1541
+ newUnit: string;
1542
+ unitKey: string;
1543
+ }) => void;
1539
1544
  unitKey: string;
1540
1545
  storageUnit: string;
1541
1546
  preferredUnit: string;
package/dist/index.js CHANGED
@@ -22023,27 +22023,18 @@ const Popover = ({
22023
22023
  onToggle: externalOnToggle
22024
22024
  }) => {
22025
22025
  const disabledContext = useContext(DisabledContext);
22026
- const [internalIsOpen, setInternalIsOpen] = useState(false);
22027
- const isControlled = externalIsOpen !== void 0;
22028
- const isOpen2 = isControlled ? externalIsOpen : internalIsOpen;
22026
+ const [isOpen2, setOpen] = externalIsOpen !== void 0 ? [externalIsOpen, externalOnToggle] : useState(false);
22029
22027
  const close2 = () => {
22030
22028
  if (!disabled2 && !disabledContext) {
22031
- if (!isControlled) {
22032
- setInternalIsOpen(false);
22033
- }
22034
- if (externalOnToggle) {
22035
- externalOnToggle(false);
22029
+ if (setOpen) {
22030
+ setOpen(false);
22036
22031
  }
22037
22032
  }
22038
22033
  };
22039
22034
  const toggle2 = () => {
22040
22035
  if (!(disabled2 || disabledContext)) {
22041
- const newIsOpen = !isOpen2;
22042
- if (!isControlled) {
22043
- setInternalIsOpen(newIsOpen);
22044
- }
22045
- if (externalOnToggle) {
22046
- externalOnToggle(newIsOpen);
22036
+ if (setOpen) {
22037
+ setOpen(!isOpen2);
22047
22038
  }
22048
22039
  }
22049
22040
  };
@@ -70821,10 +70812,22 @@ const UnitTable = ({
70821
70812
  const onChangeUnit = ({
70822
70813
  unitKey,
70823
70814
  value
70824
- }) => setSelectedUnits({
70825
- ...selectedUnits,
70826
- [unitKey]: value
70827
- });
70815
+ }) => {
70816
+ setSelectedUnits({
70817
+ ...selectedUnits,
70818
+ [unitKey]: value
70819
+ });
70820
+ const specificUnitConfiguration = unitConfig.find(
70821
+ (configuration) => configuration.unitKey === unitKey
70822
+ );
70823
+ if (specificUnitConfiguration && typeof specificUnitConfiguration.onChange === "function") {
70824
+ specificUnitConfiguration.onChange({
70825
+ oldUnit: selectedUnits[unitKey],
70826
+ newUnit: value,
70827
+ unitKey
70828
+ });
70829
+ }
70830
+ };
70828
70831
  const convertViewData = (selectedUnits2) => convertVisibleRows({
70829
70832
  headers,
70830
70833
  rows,
@@ -70840,7 +70843,13 @@ const UnitTable = ({
70840
70843
  useEffect(() => {
70841
70844
  const templateChanged = !isEqual$4(preferredUnits, previousPreferredUnits);
70842
70845
  if (templateChanged) {
70843
- setSelectedUnits(preferredUnits);
70846
+ Object.keys(preferredUnits).forEach((unitKey) => {
70847
+ const oldUnit = previousPreferredUnits == null ? void 0 : previousPreferredUnits[unitKey];
70848
+ const newUnit = preferredUnits[unitKey];
70849
+ if (oldUnit !== newUnit) {
70850
+ onChangeUnit({ unitKey, value: newUnit });
70851
+ }
70852
+ });
70844
70853
  setViewData(convertViewData(preferredUnits));
70845
70854
  }
70846
70855
  }, [unitConfig]);