@oliasoft-open-source/react-ui-library 4.7.3-beta-3 → 4.7.3-beta-5

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 (130) hide show
  1. package/dist/index.d.ts +3 -2
  2. package/dist/index.js +14 -29
  3. package/dist/index.js.map +1 -1
  4. package/dist/storybook/assets/Color-KGDBMAHA-D2T5boCW.js +1 -0
  5. package/dist/storybook/assets/DocsRenderer-PKQXORMH-w69sYCI5.js +1 -0
  6. package/dist/storybook/assets/{accordion-6ouB0WTt.js → accordion-BiuI_LCA.js} +1 -1
  7. package/dist/storybook/assets/{accordion.stories-DlFZNmdv.js → accordion.stories-sb-Y7MMb.js} +2 -2
  8. package/dist/storybook/assets/{actions-Cu_0szZ4.js → actions-4w-EOz3m.js} +1 -1
  9. package/dist/storybook/assets/{actions.stories-SCPuAp0T.js → actions.stories-CtocfSW4.js} +1 -1
  10. package/dist/storybook/assets/{afe.stories-G3SzS3sg.js → afe.stories--E_j7kET.js} +2 -2
  11. package/dist/storybook/assets/{badge.stories-DGYA6_1I.js → badge.stories-CKnNQLZ5.js} +1 -1
  12. package/dist/storybook/assets/{blowout.stories-P0LHuXSY.js → blowout.stories-AxiXaQQ-.js} +1 -1
  13. package/dist/storybook/assets/{button-_0DiND6h.js → button-CdEIDAx8.js} +1 -1
  14. package/dist/storybook/assets/{button-group-BYiHMljF.js → button-group-BIUVa0X9.js} +1 -1
  15. package/dist/storybook/assets/{button-group.stories-Bz6NHaeB.js → button-group.stories-B0Gb9kNs.js} +1 -1
  16. package/dist/storybook/assets/{button.stories-vVBGddVf.js → button.stories-CHt71NKu.js} +2 -2
  17. package/dist/storybook/assets/{buttons-and-links-DsIYBu4t.js → buttons-and-links-BcO2Jtqa.js} +2 -2
  18. package/dist/storybook/assets/{card.stories-DIlqxO94.js → card.stories-Cddrprok.js} +1 -1
  19. package/dist/storybook/assets/{casing-loads.stories-0T--WlaD.js → casing-loads.stories-EZlP6XsN.js} +2 -2
  20. package/dist/storybook/assets/{cell.stories-C5Tkxyfr.js → cell.stories-D9KrTmCA.js} +2 -2
  21. package/dist/storybook/assets/{check-box-DkdQxC5c.js → check-box-2fHPdAZG.js} +1 -1
  22. package/dist/storybook/assets/{check-box.stories-D8C12IQo.js → check-box.stories-Do-GOmLf.js} +1 -1
  23. package/dist/storybook/assets/{chunk-HLWAVYOI-CtLnxQiQ.js → chunk-HLWAVYOI-CObbrU6C.js} +1 -1
  24. package/dist/storybook/assets/color-O3ltvEIz.js +25 -0
  25. package/dist/storybook/assets/{column.stories-C1Sxwh4f.js → column.stories-rKyxUTAG.js} +1 -1
  26. package/dist/storybook/assets/{dialog-CAWCUmp3.js → dialog-B-R6eAnf.js} +1 -1
  27. package/dist/storybook/assets/{drawer-vbDFqa4U.js → drawer-BOl7GxGI.js} +1 -1
  28. package/dist/storybook/assets/{drawer.stories-CmbGsKmS.js → drawer.stories-qH2nYW2a.js} +4 -4
  29. package/dist/storybook/assets/{empty.stories-iHPKKy4z.js → empty.stories-BKEXzh9o.js} +1 -1
  30. package/dist/storybook/assets/{field-DwLk_uWj.js → field-nInV3MuR.js} +1 -1
  31. package/dist/storybook/assets/{field.stories-s-0LQVbp.js → field.stories-eRSYmEtA.js} +1 -1
  32. package/dist/storybook/assets/{file-button.stories-C90kcfbw.js → file-button.stories-CH6kxEKM.js} +1 -1
  33. package/dist/storybook/assets/{file-input-C_2w1dKj.js → file-input-Amcc9o5I.js} +1 -1
  34. package/dist/storybook/assets/{file-input.stories-BEsZox6U.js → file-input.stories-aiTQE5UN.js} +1 -1
  35. package/dist/storybook/assets/{flex.stories-D-QN0gkk.js → flex.stories-CT6o2gii.js} +1 -1
  36. package/dist/storybook/assets/footer.stories-B5zvZawz.js +3 -0
  37. package/dist/storybook/assets/form.stories-D58sdhOk.js +49 -0
  38. package/dist/storybook/assets/formation.stories-OtA8Hcp6.js +74 -0
  39. package/dist/storybook/assets/{heading-DkSFysAb.js → heading-EzI5s4VN.js} +1 -1
  40. package/dist/storybook/assets/{heading.stories-Dtq7LNlB.js → heading.stories-D5x1-mKs.js} +1 -1
  41. package/dist/storybook/assets/{help-icon-LfPZiYla.js → help-icon-CfV3_Ais.js} +1 -1
  42. package/dist/storybook/assets/{help-icon.stories-Dh2ylnGq.js → help-icon.stories-D4KS1wlT.js} +1 -1
  43. package/dist/storybook/assets/icon-BSFY3vDO.js +8 -0
  44. package/dist/storybook/assets/{icon.stories-B-tKaIKA.js → icon.stories-C1hZXIMX.js} +1 -1
  45. package/dist/storybook/assets/iframe-DrtDBpjG.js +2 -0
  46. package/dist/storybook/assets/index-BPZtj4lP.js +1 -0
  47. package/dist/storybook/assets/{index-BuBRmFoY.js → index-CWYiT1Tz.js} +8 -8
  48. package/dist/storybook/assets/{index.es-D2piFfFj.js → index.es-DazXb-ul.js} +4 -4
  49. package/dist/storybook/assets/inheritsLoose-DP0QEDDI.js +1 -0
  50. package/dist/storybook/assets/{input-group.stories-BcoORZ9x.js → input-group.stories-hHCmTbtu.js} +2 -2
  51. package/dist/storybook/assets/{input-validation-DHXUjjTW.js → input-validation-D1e6Mmav.js} +2 -2
  52. package/dist/storybook/assets/{inputs-DOBN-gBG.js → inputs-r3EGmdxF.js} +4 -4
  53. package/dist/storybook/assets/{label-tWjEmTQJ.js → label-Cz6TT90s.js} +1 -1
  54. package/dist/storybook/assets/{label.stories-BTA8N7tD.js → label.stories-BzSzxxM-.js} +1 -1
  55. package/dist/storybook/assets/layout-forms-DnuHX_gj.js +16 -0
  56. package/dist/storybook/assets/{layout-general-DIKhH47g.js → layout-general-FzT8-ags.js} +2 -2
  57. package/dist/storybook/assets/{list-BpVed6Pw.js → list-BtA0jYMp.js} +1 -1
  58. package/dist/storybook/assets/{list.stories-CiT9J_FH.js → list.stories-CmJsmJZJ.js} +2 -2
  59. package/dist/storybook/assets/{list.stories-data-CnVYk3eo.js → list.stories-data-C_w1DX5i.js} +1 -1
  60. package/dist/storybook/assets/{loader.stories-BKBFctQ1.js → loader.stories-CA2m3EFj.js} +1 -1
  61. package/dist/storybook/assets/{menu.stories-Bp8L83xx.js → menu.stories-Bc2kf356.js} +2 -2
  62. package/dist/storybook/assets/{message-ttrR1AaP.js → message-ZenLdkrf.js} +1 -1
  63. package/dist/storybook/assets/{message.stories-C8YRT7nL.js → message.stories-CXOrrAOR.js} +1 -1
  64. package/dist/storybook/assets/{meta-content-Djgg-tiF.js → meta-content-BdypOdcN.js} +1 -1
  65. package/dist/storybook/assets/{modal.stories-BoVj2EsX.js → modal.stories-ChRLG9ud.js} +2 -2
  66. package/dist/storybook/assets/{number-input.stories-CcNTeD25.js → number-input.stories-COWyMRAs.js} +2 -2
  67. package/dist/storybook/assets/{option-dropdown.stories-COGmMWEl.js → option-dropdown.stories-DvgAgTHQ.js} +1 -1
  68. package/dist/storybook/assets/{padding-and-spacing-2bE7HUNT.js → padding-and-spacing-TynMKdns.js} +2 -2
  69. package/dist/storybook/assets/{page.stories-BB3g1zwB.js → page.stories-DdAfcsOc.js} +1 -1
  70. package/dist/storybook/assets/{pagination-DSQeMPG_.js → pagination-0wY_w1xz.js} +1 -1
  71. package/dist/storybook/assets/{pagination.stories-DjIohcDx.js → pagination.stories-BagAIIz3.js} +2 -2
  72. package/dist/storybook/assets/{pop-confirm.stories-Cr_ZBbLn.js → pop-confirm.stories-D4L3erpj.js} +1 -1
  73. package/dist/storybook/assets/{popover-Dq3iC_lM.js → popover-CvS_kBVF.js} +1 -1
  74. package/dist/storybook/assets/popover.stories-ChwzGOlc.js +10 -0
  75. package/dist/storybook/assets/preview-CHIn4EYc.js +2 -0
  76. package/dist/storybook/assets/{preview-C7oeNNbC.js → preview-D-jxt18Q.js} +2 -2
  77. package/dist/storybook/assets/projects.stories-ApHyZURX.js +47 -0
  78. package/dist/storybook/assets/{radio-button-BD7pi0ao.js → radio-button-J4oEQdxt.js} +1 -1
  79. package/dist/storybook/assets/{radio-button.stories-B84Ip3NV.js → radio-button.stories-BFp_qyyE.js} +1 -1
  80. package/dist/storybook/assets/react-router-dom-Ck2Y_Fzc.js +8 -0
  81. package/dist/storybook/assets/{reservoirs.stories-kxVBoa7Y.js → reservoirs.stories-DywuU8EY.js} +2 -2
  82. package/dist/storybook/assets/{rich-text-input.stories-C5pcIbSa.js → rich-text-input.stories-Cw_6EJx8.js} +3 -3
  83. package/dist/storybook/assets/{row.stories-ATsrjumb.js → row.stories-D7V0fxhq.js} +2 -2
  84. package/dist/storybook/assets/{select-78sreKsp.js → select-yqiMF9-4.js} +2 -2
  85. package/dist/storybook/assets/{select.stories-CZwsHVDB.js → select.stories-VMcOn7Ri.js} +2 -2
  86. package/dist/storybook/assets/{side-bar-WsK6pkmj.js → side-bar-DAMfASqb.js} +1 -1
  87. package/dist/storybook/assets/{side-bar.stories-Bu2q_b_w.js → side-bar.stories-BlEIOckL.js} +1 -1
  88. package/dist/storybook/assets/{site.stories-Yh4uNi3Q.js → site.stories-Kk57nhAn.js} +2 -2
  89. package/dist/storybook/assets/{slider-CxVlS0fh.js → slider-BLU39INk.js} +4 -4
  90. package/dist/storybook/assets/{slider.stories-_wS70xsm.js → slider.stories-DdVxUAfH.js} +2 -2
  91. package/dist/storybook/assets/{smart-upload-modal.stories-DDlO9y2j.js → smart-upload-modal.stories-Cot88l9r.js} +1 -1
  92. package/dist/storybook/assets/{spacer.stories-B3LrTr7b.js → spacer.stories-Dd1QMhoc.js} +1 -1
  93. package/dist/storybook/assets/{table-DPvzYjoq.js → table-DmwpXp_Q.js} +1 -1
  94. package/dist/storybook/assets/{table.stories-BGQ1O9nw.js → table.stories-DKcZk5JR.js} +2 -2
  95. package/dist/storybook/assets/{table.stories-data-2STKbgzG.js → table.stories-data-C6x-UHeN.js} +1 -1
  96. package/dist/storybook/assets/text-link.stories-BQAkVO-W.js +14 -0
  97. package/dist/storybook/assets/{title.stories-CVRTXggL.js → title.stories-CKbl0CB2.js} +2 -2
  98. package/dist/storybook/assets/{toaster-DPbde9Mi.js → toaster-B8A3xIYu.js} +1 -1
  99. package/dist/storybook/assets/{toaster.stories-DfbfDavp.js → toaster.stories-DuE6vvV6.js} +1 -1
  100. package/dist/storybook/assets/{toggle-t1iTuSL7.js → toggle-D0yzyALV.js} +1 -1
  101. package/dist/storybook/assets/{toggle.stories-D44S3Nix.js → toggle.stories-Cre2gnIB.js} +1 -1
  102. package/dist/storybook/assets/{tooltip.test-case.stories-BtrJUImB.js → tooltip.test-case.stories-BWJhZQg8.js} +1 -1
  103. package/dist/storybook/assets/{top-bar-R-CjhJ21.js → top-bar-mKg-xcLh.js} +1 -1
  104. package/dist/storybook/assets/top-bar.stories-CFZoJq-r.js +21 -0
  105. package/dist/storybook/assets/{top-bar.testcase.stories-ZPaSRyIh.js → top-bar.testcase.stories-BlbsX9By.js} +1 -1
  106. package/dist/storybook/assets/{tree.stories-Ghxps-dL.js → tree.stories-CkYwGe0X.js} +1 -1
  107. package/dist/storybook/assets/{unit-input.stories-BaU6h22E.js → unit-input.stories-CNQsBPnT.js} +24 -24
  108. package/dist/storybook/assets/unit-table.stories-BoNWlaAe.js +150 -0
  109. package/dist/storybook/iframe.html +1 -1
  110. package/dist/storybook/project.json +1 -1
  111. package/package.json +1 -1
  112. package/dist/storybook/assets/Color-KGDBMAHA-Ck2diywb.js +0 -1
  113. package/dist/storybook/assets/DocsRenderer-PKQXORMH-CO2Q7pkj.js +0 -1
  114. package/dist/storybook/assets/color-Cm4zop4f.js +0 -25
  115. package/dist/storybook/assets/extends-CF3RwP-h.js +0 -1
  116. package/dist/storybook/assets/footer.stories-U_zMDmxF.js +0 -3
  117. package/dist/storybook/assets/form.stories-1L75MGpX.js +0 -49
  118. package/dist/storybook/assets/formation.stories-YHpXrXvC.js +0 -74
  119. package/dist/storybook/assets/icon-BP4BO6-k.js +0 -8
  120. package/dist/storybook/assets/iframe-BRbyeatW.js +0 -2
  121. package/dist/storybook/assets/index-DknIsB0y.js +0 -1
  122. package/dist/storybook/assets/inheritsLoose-DR8r8Ogv.js +0 -1
  123. package/dist/storybook/assets/layout-forms-CWJU-MMJ.js +0 -16
  124. package/dist/storybook/assets/popover.stories-CoWCb2Mn.js +0 -10
  125. package/dist/storybook/assets/preview-DP1caVnC.js +0 -2
  126. package/dist/storybook/assets/projects.stories-BesbPJ8Z.js +0 -47
  127. package/dist/storybook/assets/react-router-dom-CMITYWBH.js +0 -8
  128. package/dist/storybook/assets/text-link.stories-BsuVBOWo.js +0 -14
  129. package/dist/storybook/assets/top-bar.stories-BYN9rcUw.js +0 -21
  130. package/dist/storybook/assets/unit-table.stories-DXies3fA.js +0 -150
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ChangeEvent } from 'react';
2
+ import { Context } from 'react';
2
3
  import { CSSProperties } from 'react';
3
4
  import { default as default_2 } from 'react';
4
5
  import { DependencyList } from 'react';
@@ -866,7 +867,7 @@ export declare interface INativeSelectProps {
866
867
  maxTooltipWidth?: TStringOrNumber;
867
868
  }
868
869
 
869
- export declare const initializeContext: (value: UnitContextType) => void;
870
+ export declare const initializeContext: (context: Context<UnitContextType | null>) => void;
870
871
 
871
872
  export declare const Input: default_2.ForwardRefExoticComponent<IInputProps & default_2.RefAttributes<HTMLInputElement>>;
872
873
 
@@ -1856,7 +1857,7 @@ declare type TUnitTableCellShape = TCellShape | IUnitTableStaticCell | IUnitTabl
1856
1857
 
1857
1858
  declare type UnitContextType = any;
1858
1859
 
1859
- export declare const UnitInput: default_2.FC<IUnitInputProps>;
1860
+ export declare const UnitInput: ({ name, placeholder, disabled, disabledUnit, error, left, small, width, value, unitkey, initUnit, noConversion, onChange, onClick, onFocus, onSwitchUnit, unitTemplate, doNotConvertValue, testId, warning, predefinedOptions, initialPredefinedOption, shouldLinkAutomaticly, selectedPredefinedOptionKey, validationCallback, disabledValidation, allowEmpty, autoValue, }: IUnitInputProps) => JSX_2.Element;
1860
1861
 
1861
1862
  export declare const UnitTable: ({ table, unitConfig, convertBackToStorageUnit, enableCosmeticRounding, enableDisplayRounding, }: IUnitTableProps) => JSX_2.Element;
1862
1863
 
package/dist/index.js CHANGED
@@ -70024,7 +70024,7 @@ const usePrevious = (value) => {
70024
70024
  };
70025
70025
  const getPreferredUnit = (unitkey, unitTemplate) => {
70026
70026
  const preferredUnit = unitTemplate == null ? void 0 : unitTemplate[unitkey];
70027
- console.log(unitTemplate, unitTemplate);
70027
+ console.log("unitTemplate", unitTemplate);
70028
70028
  console.log("unitTemplate?.[unitkey]", unitTemplate == null ? void 0 : unitTemplate[unitkey]);
70029
70029
  if (!preferredUnit) {
70030
70030
  console.log(
@@ -70127,33 +70127,22 @@ const isKnownUnit = (valueWithUnit, defaultUnit) => {
70127
70127
  const unitFromValue = getUnit(valueWithUnit || "");
70128
70128
  return isUnitKnown(defaultUnit) && isUnitKnown(unitFromValue);
70129
70129
  };
70130
- const UnitContext = createContext(null);
70131
- const UnitContextProvider = ({ children, value }) => {
70132
- return /* @__PURE__ */ jsx(UnitContext.Provider, { value, children });
70133
- };
70130
+ let UnitContext = createContext(null);
70134
70131
  const useUnitContext = () => {
70135
70132
  return useContext(UnitContext);
70136
70133
  };
70137
70134
  let isInitialized = false;
70138
- let providedValue = null;
70139
- const initializeContext = (value) => {
70135
+ const initializeContext = (context2) => {
70140
70136
  if (!isInitialized) {
70141
- providedValue = value;
70142
70137
  isInitialized = true;
70138
+ UnitContext = context2;
70143
70139
  }
70144
70140
  };
70145
- const WithUnitContext = (Component2) => (props) => {
70146
- if (!isInitialized) {
70147
- console.log("Context not initialized. Call initializeContext first.");
70148
- return /* @__PURE__ */ jsx(Component2, { ...props });
70149
- }
70150
- return /* @__PURE__ */ jsx(UnitContextProvider, { value: providedValue, children: /* @__PURE__ */ jsx(Component2, { ...props }) });
70151
- };
70152
70141
  const predefinedMenuActive = "_predefinedMenuActive_1yvt4_1";
70153
70142
  const styles = {
70154
70143
  predefinedMenuActive
70155
70144
  };
70156
- const UnitInputComponent = ({
70145
+ const UnitInput = ({
70157
70146
  name: name2,
70158
70147
  placeholder: placeholder3 = "",
70159
70148
  disabled: disabled2 = false,
@@ -70174,7 +70163,7 @@ const UnitInputComponent = ({
70174
70163
  },
70175
70164
  onSwitchUnit = () => {
70176
70165
  },
70177
- unitTemplate: externalUnitTemplate,
70166
+ unitTemplate,
70178
70167
  doNotConvertValue = false,
70179
70168
  testId,
70180
70169
  warning: warning2 = null,
@@ -70187,24 +70176,21 @@ const UnitInputComponent = ({
70187
70176
  allowEmpty = false,
70188
70177
  autoValue
70189
70178
  }) => {
70190
- const context2 = useUnitContext();
70191
- const unitTemplate = externalUnitTemplate ?? (context2 == null ? void 0 : context2.unitTemplate);
70192
- const [currentUnitTemplate, setCurrentUnitTemplate] = useState(unitTemplate);
70193
- console.log("currentUnitTemplate ->>>>", currentUnitTemplate);
70194
- useEffect(() => {
70195
- if (unitTemplate) {
70196
- setCurrentUnitTemplate(unitTemplate);
70197
- }
70198
- }, [unitTemplate]);
70199
70179
  if (typeof value === "number") {
70200
70180
  value = `${value}`;
70201
70181
  }
70182
+ const context2 = useUnitContext();
70183
+ console.log(
70184
+ "context in component ->>>>",
70185
+ unitTemplate || (context2 == null ? void 0 : context2.unitTemplate),
70186
+ context2 == null ? void 0 : context2.unitTemplate
70187
+ );
70202
70188
  const runAfterUpdate = useRunAfterUpdate();
70203
70189
  const [propValue = "", propUnit = ""] = value !== void 0 ? split$1(value) : [];
70204
70190
  const propAutoUnit = autoValue ? getUnit(autoValue) : "";
70205
70191
  const defaultUnit = useMemo$1(
70206
- () => getPreferredUnit(unitkey, currentUnitTemplate),
70207
- [unitkey, currentUnitTemplate]
70192
+ () => getPreferredUnit(unitkey, unitTemplate || (context2 == null ? void 0 : context2.unitTemplate)),
70193
+ [unitkey, unitTemplate, context2 == null ? void 0 : context2.unitTemplate]
70208
70194
  );
70209
70195
  const knownUnit = isKnownUnit(value, defaultUnit);
70210
70196
  const initDisplayUnit = initUnit || propUnit || defaultUnit;
@@ -70482,7 +70468,6 @@ const UnitInputComponent = ({
70482
70468
  }
70483
70469
  );
70484
70470
  };
70485
- const UnitInput = WithUnitContext(UnitInputComponent);
70486
70471
  const normalizeUnits = (unitConfig) => unitConfig.reduce(
70487
70472
  ({ preferredUnits, storageUnits }, { unitKey, preferredUnit, storageUnit }) => {
70488
70473
  preferredUnits[unitKey] = preferredUnit;