@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.
- package/dist/index.d.ts +3 -2
- package/dist/index.js +14 -29
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/Color-KGDBMAHA-D2T5boCW.js +1 -0
- package/dist/storybook/assets/DocsRenderer-PKQXORMH-w69sYCI5.js +1 -0
- package/dist/storybook/assets/{accordion-6ouB0WTt.js → accordion-BiuI_LCA.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-DlFZNmdv.js → accordion.stories-sb-Y7MMb.js} +2 -2
- package/dist/storybook/assets/{actions-Cu_0szZ4.js → actions-4w-EOz3m.js} +1 -1
- package/dist/storybook/assets/{actions.stories-SCPuAp0T.js → actions.stories-CtocfSW4.js} +1 -1
- package/dist/storybook/assets/{afe.stories-G3SzS3sg.js → afe.stories--E_j7kET.js} +2 -2
- package/dist/storybook/assets/{badge.stories-DGYA6_1I.js → badge.stories-CKnNQLZ5.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-P0LHuXSY.js → blowout.stories-AxiXaQQ-.js} +1 -1
- package/dist/storybook/assets/{button-_0DiND6h.js → button-CdEIDAx8.js} +1 -1
- package/dist/storybook/assets/{button-group-BYiHMljF.js → button-group-BIUVa0X9.js} +1 -1
- package/dist/storybook/assets/{button-group.stories-Bz6NHaeB.js → button-group.stories-B0Gb9kNs.js} +1 -1
- package/dist/storybook/assets/{button.stories-vVBGddVf.js → button.stories-CHt71NKu.js} +2 -2
- package/dist/storybook/assets/{buttons-and-links-DsIYBu4t.js → buttons-and-links-BcO2Jtqa.js} +2 -2
- package/dist/storybook/assets/{card.stories-DIlqxO94.js → card.stories-Cddrprok.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-0T--WlaD.js → casing-loads.stories-EZlP6XsN.js} +2 -2
- package/dist/storybook/assets/{cell.stories-C5Tkxyfr.js → cell.stories-D9KrTmCA.js} +2 -2
- package/dist/storybook/assets/{check-box-DkdQxC5c.js → check-box-2fHPdAZG.js} +1 -1
- package/dist/storybook/assets/{check-box.stories-D8C12IQo.js → check-box.stories-Do-GOmLf.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-CtLnxQiQ.js → chunk-HLWAVYOI-CObbrU6C.js} +1 -1
- package/dist/storybook/assets/color-O3ltvEIz.js +25 -0
- package/dist/storybook/assets/{column.stories-C1Sxwh4f.js → column.stories-rKyxUTAG.js} +1 -1
- package/dist/storybook/assets/{dialog-CAWCUmp3.js → dialog-B-R6eAnf.js} +1 -1
- package/dist/storybook/assets/{drawer-vbDFqa4U.js → drawer-BOl7GxGI.js} +1 -1
- package/dist/storybook/assets/{drawer.stories-CmbGsKmS.js → drawer.stories-qH2nYW2a.js} +4 -4
- package/dist/storybook/assets/{empty.stories-iHPKKy4z.js → empty.stories-BKEXzh9o.js} +1 -1
- package/dist/storybook/assets/{field-DwLk_uWj.js → field-nInV3MuR.js} +1 -1
- package/dist/storybook/assets/{field.stories-s-0LQVbp.js → field.stories-eRSYmEtA.js} +1 -1
- package/dist/storybook/assets/{file-button.stories-C90kcfbw.js → file-button.stories-CH6kxEKM.js} +1 -1
- package/dist/storybook/assets/{file-input-C_2w1dKj.js → file-input-Amcc9o5I.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-BEsZox6U.js → file-input.stories-aiTQE5UN.js} +1 -1
- package/dist/storybook/assets/{flex.stories-D-QN0gkk.js → flex.stories-CT6o2gii.js} +1 -1
- package/dist/storybook/assets/footer.stories-B5zvZawz.js +3 -0
- package/dist/storybook/assets/form.stories-D58sdhOk.js +49 -0
- package/dist/storybook/assets/formation.stories-OtA8Hcp6.js +74 -0
- package/dist/storybook/assets/{heading-DkSFysAb.js → heading-EzI5s4VN.js} +1 -1
- package/dist/storybook/assets/{heading.stories-Dtq7LNlB.js → heading.stories-D5x1-mKs.js} +1 -1
- package/dist/storybook/assets/{help-icon-LfPZiYla.js → help-icon-CfV3_Ais.js} +1 -1
- package/dist/storybook/assets/{help-icon.stories-Dh2ylnGq.js → help-icon.stories-D4KS1wlT.js} +1 -1
- package/dist/storybook/assets/icon-BSFY3vDO.js +8 -0
- package/dist/storybook/assets/{icon.stories-B-tKaIKA.js → icon.stories-C1hZXIMX.js} +1 -1
- package/dist/storybook/assets/iframe-DrtDBpjG.js +2 -0
- package/dist/storybook/assets/index-BPZtj4lP.js +1 -0
- package/dist/storybook/assets/{index-BuBRmFoY.js → index-CWYiT1Tz.js} +8 -8
- package/dist/storybook/assets/{index.es-D2piFfFj.js → index.es-DazXb-ul.js} +4 -4
- package/dist/storybook/assets/inheritsLoose-DP0QEDDI.js +1 -0
- package/dist/storybook/assets/{input-group.stories-BcoORZ9x.js → input-group.stories-hHCmTbtu.js} +2 -2
- package/dist/storybook/assets/{input-validation-DHXUjjTW.js → input-validation-D1e6Mmav.js} +2 -2
- package/dist/storybook/assets/{inputs-DOBN-gBG.js → inputs-r3EGmdxF.js} +4 -4
- package/dist/storybook/assets/{label-tWjEmTQJ.js → label-Cz6TT90s.js} +1 -1
- package/dist/storybook/assets/{label.stories-BTA8N7tD.js → label.stories-BzSzxxM-.js} +1 -1
- package/dist/storybook/assets/layout-forms-DnuHX_gj.js +16 -0
- package/dist/storybook/assets/{layout-general-DIKhH47g.js → layout-general-FzT8-ags.js} +2 -2
- package/dist/storybook/assets/{list-BpVed6Pw.js → list-BtA0jYMp.js} +1 -1
- package/dist/storybook/assets/{list.stories-CiT9J_FH.js → list.stories-CmJsmJZJ.js} +2 -2
- package/dist/storybook/assets/{list.stories-data-CnVYk3eo.js → list.stories-data-C_w1DX5i.js} +1 -1
- package/dist/storybook/assets/{loader.stories-BKBFctQ1.js → loader.stories-CA2m3EFj.js} +1 -1
- package/dist/storybook/assets/{menu.stories-Bp8L83xx.js → menu.stories-Bc2kf356.js} +2 -2
- package/dist/storybook/assets/{message-ttrR1AaP.js → message-ZenLdkrf.js} +1 -1
- package/dist/storybook/assets/{message.stories-C8YRT7nL.js → message.stories-CXOrrAOR.js} +1 -1
- package/dist/storybook/assets/{meta-content-Djgg-tiF.js → meta-content-BdypOdcN.js} +1 -1
- package/dist/storybook/assets/{modal.stories-BoVj2EsX.js → modal.stories-ChRLG9ud.js} +2 -2
- package/dist/storybook/assets/{number-input.stories-CcNTeD25.js → number-input.stories-COWyMRAs.js} +2 -2
- package/dist/storybook/assets/{option-dropdown.stories-COGmMWEl.js → option-dropdown.stories-DvgAgTHQ.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-2bE7HUNT.js → padding-and-spacing-TynMKdns.js} +2 -2
- package/dist/storybook/assets/{page.stories-BB3g1zwB.js → page.stories-DdAfcsOc.js} +1 -1
- package/dist/storybook/assets/{pagination-DSQeMPG_.js → pagination-0wY_w1xz.js} +1 -1
- package/dist/storybook/assets/{pagination.stories-DjIohcDx.js → pagination.stories-BagAIIz3.js} +2 -2
- package/dist/storybook/assets/{pop-confirm.stories-Cr_ZBbLn.js → pop-confirm.stories-D4L3erpj.js} +1 -1
- package/dist/storybook/assets/{popover-Dq3iC_lM.js → popover-CvS_kBVF.js} +1 -1
- package/dist/storybook/assets/popover.stories-ChwzGOlc.js +10 -0
- package/dist/storybook/assets/preview-CHIn4EYc.js +2 -0
- package/dist/storybook/assets/{preview-C7oeNNbC.js → preview-D-jxt18Q.js} +2 -2
- package/dist/storybook/assets/projects.stories-ApHyZURX.js +47 -0
- package/dist/storybook/assets/{radio-button-BD7pi0ao.js → radio-button-J4oEQdxt.js} +1 -1
- package/dist/storybook/assets/{radio-button.stories-B84Ip3NV.js → radio-button.stories-BFp_qyyE.js} +1 -1
- package/dist/storybook/assets/react-router-dom-Ck2Y_Fzc.js +8 -0
- package/dist/storybook/assets/{reservoirs.stories-kxVBoa7Y.js → reservoirs.stories-DywuU8EY.js} +2 -2
- package/dist/storybook/assets/{rich-text-input.stories-C5pcIbSa.js → rich-text-input.stories-Cw_6EJx8.js} +3 -3
- package/dist/storybook/assets/{row.stories-ATsrjumb.js → row.stories-D7V0fxhq.js} +2 -2
- package/dist/storybook/assets/{select-78sreKsp.js → select-yqiMF9-4.js} +2 -2
- package/dist/storybook/assets/{select.stories-CZwsHVDB.js → select.stories-VMcOn7Ri.js} +2 -2
- package/dist/storybook/assets/{side-bar-WsK6pkmj.js → side-bar-DAMfASqb.js} +1 -1
- package/dist/storybook/assets/{side-bar.stories-Bu2q_b_w.js → side-bar.stories-BlEIOckL.js} +1 -1
- package/dist/storybook/assets/{site.stories-Yh4uNi3Q.js → site.stories-Kk57nhAn.js} +2 -2
- package/dist/storybook/assets/{slider-CxVlS0fh.js → slider-BLU39INk.js} +4 -4
- package/dist/storybook/assets/{slider.stories-_wS70xsm.js → slider.stories-DdVxUAfH.js} +2 -2
- package/dist/storybook/assets/{smart-upload-modal.stories-DDlO9y2j.js → smart-upload-modal.stories-Cot88l9r.js} +1 -1
- package/dist/storybook/assets/{spacer.stories-B3LrTr7b.js → spacer.stories-Dd1QMhoc.js} +1 -1
- package/dist/storybook/assets/{table-DPvzYjoq.js → table-DmwpXp_Q.js} +1 -1
- package/dist/storybook/assets/{table.stories-BGQ1O9nw.js → table.stories-DKcZk5JR.js} +2 -2
- package/dist/storybook/assets/{table.stories-data-2STKbgzG.js → table.stories-data-C6x-UHeN.js} +1 -1
- package/dist/storybook/assets/text-link.stories-BQAkVO-W.js +14 -0
- package/dist/storybook/assets/{title.stories-CVRTXggL.js → title.stories-CKbl0CB2.js} +2 -2
- package/dist/storybook/assets/{toaster-DPbde9Mi.js → toaster-B8A3xIYu.js} +1 -1
- package/dist/storybook/assets/{toaster.stories-DfbfDavp.js → toaster.stories-DuE6vvV6.js} +1 -1
- package/dist/storybook/assets/{toggle-t1iTuSL7.js → toggle-D0yzyALV.js} +1 -1
- package/dist/storybook/assets/{toggle.stories-D44S3Nix.js → toggle.stories-Cre2gnIB.js} +1 -1
- package/dist/storybook/assets/{tooltip.test-case.stories-BtrJUImB.js → tooltip.test-case.stories-BWJhZQg8.js} +1 -1
- package/dist/storybook/assets/{top-bar-R-CjhJ21.js → top-bar-mKg-xcLh.js} +1 -1
- package/dist/storybook/assets/top-bar.stories-CFZoJq-r.js +21 -0
- package/dist/storybook/assets/{top-bar.testcase.stories-ZPaSRyIh.js → top-bar.testcase.stories-BlbsX9By.js} +1 -1
- package/dist/storybook/assets/{tree.stories-Ghxps-dL.js → tree.stories-CkYwGe0X.js} +1 -1
- package/dist/storybook/assets/{unit-input.stories-BaU6h22E.js → unit-input.stories-CNQsBPnT.js} +24 -24
- package/dist/storybook/assets/unit-table.stories-BoNWlaAe.js +150 -0
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +1 -1
- package/dist/storybook/assets/Color-KGDBMAHA-Ck2diywb.js +0 -1
- package/dist/storybook/assets/DocsRenderer-PKQXORMH-CO2Q7pkj.js +0 -1
- package/dist/storybook/assets/color-Cm4zop4f.js +0 -25
- package/dist/storybook/assets/extends-CF3RwP-h.js +0 -1
- package/dist/storybook/assets/footer.stories-U_zMDmxF.js +0 -3
- package/dist/storybook/assets/form.stories-1L75MGpX.js +0 -49
- package/dist/storybook/assets/formation.stories-YHpXrXvC.js +0 -74
- package/dist/storybook/assets/icon-BP4BO6-k.js +0 -8
- package/dist/storybook/assets/iframe-BRbyeatW.js +0 -2
- package/dist/storybook/assets/index-DknIsB0y.js +0 -1
- package/dist/storybook/assets/inheritsLoose-DR8r8Ogv.js +0 -1
- package/dist/storybook/assets/layout-forms-CWJU-MMJ.js +0 -16
- package/dist/storybook/assets/popover.stories-CoWCb2Mn.js +0 -10
- package/dist/storybook/assets/preview-DP1caVnC.js +0 -2
- package/dist/storybook/assets/projects.stories-BesbPJ8Z.js +0 -47
- package/dist/storybook/assets/react-router-dom-CMITYWBH.js +0 -8
- package/dist/storybook/assets/text-link.stories-BsuVBOWo.js +0 -14
- package/dist/storybook/assets/top-bar.stories-BYN9rcUw.js +0 -21
- 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: (
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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,
|
|
70207
|
-
[unitkey,
|
|
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;
|