@oliasoft-open-source/react-ui-library 4.2.2 → 4.2.3-beta-2
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/assets/{index-26f804a8.js → index-e2c255b3.js} +39 -2
- package/dist/index.d.ts +7 -1
- package/dist/index.html +1 -1
- package/dist/index.js +40 -8
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/{Color-6VNJS4EI-176a0637.js → Color-6VNJS4EI-2ce5af2e.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-NNNQARDV-d6b1a926.js → DocsRenderer-NNNQARDV-0da6ab6e.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-4HIR6TLV-01fcb383.js → WithTooltip-4HIR6TLV-ba578862.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-0f8af16e.js → accordion.stories-befc735f.js} +1 -1
- package/dist/storybook/assets/{afe.stories-afb9be07.js → afe.stories-fd3b3dd5.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-9b4c48c7.js → buttons-and-links-9814deea.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-cfbab702.js → casing-loads.stories-7135a74a.js} +1 -1
- package/dist/storybook/assets/{cell.stories-524a7418.js → cell.stories-73db565e.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-efbdedb9.js → chunk-HLWAVYOI-84e971fb.js} +1 -1
- package/dist/storybook/assets/{color-bdf2c712.js → color-886c701d.js} +1 -1
- package/dist/storybook/assets/{field.stories-f1318053.js → field.stories-f09d9510.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-1c6ce0ea.js → file-input.stories-2b00c795.js} +1 -1
- package/dist/storybook/assets/{footer.stories-57f07ea2.js → footer.stories-cb9b4319.js} +1 -1
- package/dist/storybook/assets/{form.stories-45c0cd59.js → form.stories-469b1bf0.js} +1 -1
- package/dist/storybook/assets/{formation.stories-5eeaa826.js → formation.stories-f3d9d325.js} +1 -1
- package/dist/storybook/assets/{formatter-SWP5E3XI-a62ef2ff.js → formatter-SWP5E3XI-300692b1.js} +1 -1
- package/dist/storybook/assets/iframe-140c1ff6.js +1 -0
- package/dist/storybook/assets/{index-5306dda7.js → index-af2b80fd.js} +4 -4
- package/dist/storybook/assets/input-5cef4984.js +1 -0
- package/dist/storybook/assets/{input-group.stories-a2a3400e.js → input-group.stories-dfb154d6.js} +1 -1
- package/dist/storybook/assets/{input-validation-cad6ba98.js → input-validation-b942a333.js} +1 -1
- package/dist/storybook/assets/input.stories-9eef5629.js +50 -0
- package/dist/storybook/assets/{inputs-b36361a7.js → inputs-a4e515cb.js} +1 -1
- package/dist/storybook/assets/{layout-forms-500f50e3.js → layout-forms-e02f6a9e.js} +1 -1
- package/dist/storybook/assets/{layout-general-6fcc0bac.js → layout-general-4dfd915f.js} +1 -1
- package/dist/storybook/assets/{modal.stories-0e068cc1.js → modal.stories-320bf290.js} +1 -1
- package/dist/storybook/assets/{number-input-7d49b0b3.js → number-input-f176ca08.js} +1 -1
- package/dist/storybook/assets/{number-input.stories-02528124.js → number-input.stories-8a6836f4.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-b4b4aa42.js → padding-and-spacing-b0b6ba6e.js} +1 -1
- package/dist/storybook/assets/{pagination-8aade846.js → pagination-1cee6de3.js} +1 -1
- package/dist/storybook/assets/{pagination.stories-423b4938.js → pagination.stories-d5817a5e.js} +1 -1
- package/dist/storybook/assets/{popover.stories-f651a81c.js → popover.stories-b9f8439d.js} +1 -1
- package/dist/storybook/assets/{preview-6eef7a6c.js → preview-0042f359.js} +1 -1
- package/dist/storybook/assets/preview-be75d582.js +1 -0
- package/dist/storybook/assets/{reservoirs.stories-6b14a37f.js → reservoirs.stories-b1d07230.js} +1 -1
- package/dist/storybook/assets/{row.stories-d5b6b4a6.js → row.stories-95a83b12.js} +1 -1
- package/dist/storybook/assets/{site.stories-dee8ce1c.js → site.stories-bb7ecfc7.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-NMPM6SWI-2c058518.js → syntaxhighlighter-NMPM6SWI-3f1d798b.js} +1 -1
- package/dist/storybook/assets/{table-da6f6045.js → table-1d715a6a.js} +1 -1
- package/dist/storybook/assets/{table.stories-67a3023a.js → table.stories-ea943dd3.js} +1 -1
- package/dist/storybook/assets/{title.stories-5b4a226c.js → title.stories-0f0c181b.js} +1 -1
- package/dist/storybook/assets/{unit-input.stories-65984064.js → unit-input.stories-22860deb.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/storybook/stories.json +1 -1
- package/package.json +1 -1
- package/dist/404.html +0 -1
- package/dist/storybook/assets/iframe-3b8c9505.js +0 -1
- package/dist/storybook/assets/input-d68625a5.js +0 -1
- package/dist/storybook/assets/input.stories-164d93ab.js +0 -41
- package/dist/storybook/assets/preview-c280dfa3.js +0 -1
|
@@ -22954,6 +22954,43 @@ reactExports.forwardRef(
|
|
|
22954
22954
|
//use width instead
|
|
22955
22955
|
}, ref2) => {
|
|
22956
22956
|
const disabledContext = reactExports.useContext(DisabledContext);
|
|
22957
|
+
const inputRef = reactExports.useRef(null);
|
|
22958
|
+
const position2 = reactExports.useRef({
|
|
22959
|
+
beforeStart: 0,
|
|
22960
|
+
beforeEnd: 0
|
|
22961
|
+
});
|
|
22962
|
+
const handleChange = (e2) => {
|
|
22963
|
+
const beforeStart = e2.target.selectionStart || 0;
|
|
22964
|
+
const beforeEnd = e2.target.selectionEnd || 0;
|
|
22965
|
+
position2.current = {
|
|
22966
|
+
beforeStart,
|
|
22967
|
+
beforeEnd
|
|
22968
|
+
};
|
|
22969
|
+
onChange(e2);
|
|
22970
|
+
};
|
|
22971
|
+
reactExports.useLayoutEffect(() => {
|
|
22972
|
+
var _a;
|
|
22973
|
+
if (type2 !== "text")
|
|
22974
|
+
return;
|
|
22975
|
+
(_a = inputRef.current) == null ? void 0 : _a.setSelectionRange(
|
|
22976
|
+
position2.current.beforeStart,
|
|
22977
|
+
position2.current.beforeEnd
|
|
22978
|
+
);
|
|
22979
|
+
}, [value]);
|
|
22980
|
+
reactExports.useImperativeHandle(ref2, () => ({
|
|
22981
|
+
blur: () => {
|
|
22982
|
+
var _a;
|
|
22983
|
+
(_a = inputRef.current) == null ? void 0 : _a.blur();
|
|
22984
|
+
},
|
|
22985
|
+
click: () => {
|
|
22986
|
+
var _a;
|
|
22987
|
+
(_a = inputRef.current) == null ? void 0 : _a.click();
|
|
22988
|
+
},
|
|
22989
|
+
focus: () => {
|
|
22990
|
+
var _a;
|
|
22991
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
22992
|
+
}
|
|
22993
|
+
}));
|
|
22957
22994
|
const order2 = (() => {
|
|
22958
22995
|
if (groupOrder) {
|
|
22959
22996
|
switch (groupOrder) {
|
|
@@ -22981,12 +23018,12 @@ reactExports.forwardRef(
|
|
|
22981
23018
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
22982
23019
|
"input",
|
|
22983
23020
|
{
|
|
22984
|
-
ref:
|
|
23021
|
+
ref: inputRef,
|
|
22985
23022
|
type: type2 || "text",
|
|
22986
23023
|
size: size2 || 20,
|
|
22987
23024
|
placeholder: placeholder2 ?? "",
|
|
22988
23025
|
value: value ?? "",
|
|
22989
|
-
onChange,
|
|
23026
|
+
onChange: handleChange,
|
|
22990
23027
|
onKeyPress,
|
|
22991
23028
|
onFocus,
|
|
22992
23029
|
onBlur,
|
package/dist/index.d.ts
CHANGED
|
@@ -848,7 +848,7 @@ export declare interface INativeSelectProps {
|
|
|
848
848
|
maxTooltipWidth?: TStringOrNumber;
|
|
849
849
|
}
|
|
850
850
|
|
|
851
|
-
export declare const Input: React_2.ForwardRefExoticComponent<IInputProps & React_2.RefAttributes<
|
|
851
|
+
export declare const Input: React_2.ForwardRefExoticComponent<IInputProps & React_2.RefAttributes<InputRef>>;
|
|
852
852
|
|
|
853
853
|
export declare const InputGroup: ({ children, small, width, }: IInputGroupProps) => ReactElement;
|
|
854
854
|
|
|
@@ -861,6 +861,12 @@ export declare enum InputReaderMethods {
|
|
|
861
861
|
READ_AS_BINARY_STRING = "readAsBinaryString"
|
|
862
862
|
}
|
|
863
863
|
|
|
864
|
+
declare type InputRef = {
|
|
865
|
+
blur: () => void;
|
|
866
|
+
click: () => void;
|
|
867
|
+
focus: () => void;
|
|
868
|
+
} | null;
|
|
869
|
+
|
|
864
870
|
export declare enum InputType {
|
|
865
871
|
TEXT = "text",
|
|
866
872
|
RADIO = "radio",
|
package/dist/index.html
CHANGED
|
@@ -1 +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-
|
|
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-e2c255b3.js"></script><link rel="stylesheet" href="/react-ui-library/assets/index-0d78a198.css"></head><body><div id="content"></div></body>
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var __publicField = (obj, key2, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
8
8
|
import * as React$4 from "react";
|
|
9
|
-
import React__default, { useContext, isValidElement, useState, useRef, useEffect, useCallback as useCallback$1, createElement, forwardRef, useMemo as useMemo$1, useLayoutEffect as useLayoutEffect$1, createContext, useReducer, useDebugValue, Fragment as Fragment$2, Component as Component$1, PureComponent,
|
|
9
|
+
import React__default, { useContext, isValidElement, useState, useRef, useEffect, useCallback as useCallback$1, createElement, forwardRef, useMemo as useMemo$1, useLayoutEffect as useLayoutEffect$1, createContext, useReducer, useDebugValue, Fragment as Fragment$2, useImperativeHandle, Component as Component$1, PureComponent, memo, cloneElement as cloneElement$1 } from "react";
|
|
10
10
|
import * as PropTypes from "prop-types";
|
|
11
11
|
import PropTypes__default from "prop-types";
|
|
12
12
|
import ReactDOM, { createPortal, unstable_batchedUpdates, render } from "react-dom";
|
|
@@ -9162,8 +9162,44 @@ const Input$1 = forwardRef(
|
|
|
9162
9162
|
size: size2 = null
|
|
9163
9163
|
//use width instead
|
|
9164
9164
|
}, ref2) => {
|
|
9165
|
-
const [valueState, setValueState] = useState(value);
|
|
9166
9165
|
const disabledContext = useContext(DisabledContext);
|
|
9166
|
+
const inputRef = useRef(null);
|
|
9167
|
+
const position3 = useRef({
|
|
9168
|
+
beforeStart: 0,
|
|
9169
|
+
beforeEnd: 0
|
|
9170
|
+
});
|
|
9171
|
+
const handleChange = (e2) => {
|
|
9172
|
+
const beforeStart = e2.target.selectionStart || 0;
|
|
9173
|
+
const beforeEnd = e2.target.selectionEnd || 0;
|
|
9174
|
+
position3.current = {
|
|
9175
|
+
beforeStart,
|
|
9176
|
+
beforeEnd
|
|
9177
|
+
};
|
|
9178
|
+
onChange(e2);
|
|
9179
|
+
};
|
|
9180
|
+
useLayoutEffect$1(() => {
|
|
9181
|
+
var _a;
|
|
9182
|
+
if (type !== "text")
|
|
9183
|
+
return;
|
|
9184
|
+
(_a = inputRef.current) == null ? void 0 : _a.setSelectionRange(
|
|
9185
|
+
position3.current.beforeStart,
|
|
9186
|
+
position3.current.beforeEnd
|
|
9187
|
+
);
|
|
9188
|
+
}, [value]);
|
|
9189
|
+
useImperativeHandle(ref2, () => ({
|
|
9190
|
+
blur: () => {
|
|
9191
|
+
var _a;
|
|
9192
|
+
(_a = inputRef.current) == null ? void 0 : _a.blur();
|
|
9193
|
+
},
|
|
9194
|
+
click: () => {
|
|
9195
|
+
var _a;
|
|
9196
|
+
(_a = inputRef.current) == null ? void 0 : _a.click();
|
|
9197
|
+
},
|
|
9198
|
+
focus: () => {
|
|
9199
|
+
var _a;
|
|
9200
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
9201
|
+
}
|
|
9202
|
+
}));
|
|
9167
9203
|
const order2 = (() => {
|
|
9168
9204
|
if (groupOrder) {
|
|
9169
9205
|
switch (groupOrder) {
|
|
@@ -9178,10 +9214,6 @@ const Input$1 = forwardRef(
|
|
|
9178
9214
|
return "";
|
|
9179
9215
|
})();
|
|
9180
9216
|
const width2 = propWidth || (size2 ? "auto" : "100%");
|
|
9181
|
-
const handleChange = (e2) => {
|
|
9182
|
-
setValueState(e2.target.value);
|
|
9183
|
-
onChange(e2);
|
|
9184
|
-
};
|
|
9185
9217
|
return /* @__PURE__ */ jsx("div", { style: { width: width2 }, className: order2, children: /* @__PURE__ */ jsx(
|
|
9186
9218
|
Tooltip,
|
|
9187
9219
|
{
|
|
@@ -9195,11 +9227,11 @@ const Input$1 = forwardRef(
|
|
|
9195
9227
|
children: /* @__PURE__ */ jsx(
|
|
9196
9228
|
"input",
|
|
9197
9229
|
{
|
|
9198
|
-
ref:
|
|
9230
|
+
ref: inputRef,
|
|
9199
9231
|
type: type || "text",
|
|
9200
9232
|
size: size2 || 20,
|
|
9201
9233
|
placeholder: placeholder3 ?? "",
|
|
9202
|
-
value:
|
|
9234
|
+
value: value ?? "",
|
|
9203
9235
|
onChange: handleChange,
|
|
9204
9236
|
onKeyPress,
|
|
9205
9237
|
onFocus,
|