@oliasoft-open-source/react-ui-library 4.2.1 → 4.2.3-beta-1
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-ba2c9337.js} +37 -2
- package/dist/index.d.ts +7 -1
- package/dist/index.html +1 -1
- package/dist/index.js +38 -3
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/{Color-6VNJS4EI-11a1508d.js → Color-6VNJS4EI-109d00cb.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-NNNQARDV-8f214a0a.js → DocsRenderer-NNNQARDV-57791a91.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-4HIR6TLV-bcdb019a.js → WithTooltip-4HIR6TLV-07d0c73b.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-0f8af16e.js → accordion.stories-ec7ce7ab.js} +1 -1
- package/dist/storybook/assets/{afe.stories-afb9be07.js → afe.stories-aa20e8fa.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-72daa9ae.js → buttons-and-links-15f30fad.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-cfbab702.js → casing-loads.stories-24e601d0.js} +1 -1
- package/dist/storybook/assets/{cell.stories-524a7418.js → cell.stories-7e0061fc.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-6a96cff0.js → chunk-HLWAVYOI-4a6cc95d.js} +1 -1
- package/dist/storybook/assets/{color-9bdf643a.js → color-fe547aff.js} +1 -1
- package/dist/storybook/assets/{field.stories-f1318053.js → field.stories-d04ee257.js} +1 -1
- package/dist/storybook/assets/{file-input.stories-1c6ce0ea.js → file-input.stories-4fa8c5c9.js} +1 -1
- package/dist/storybook/assets/{footer.stories-57f07ea2.js → footer.stories-ef24c912.js} +1 -1
- package/dist/storybook/assets/{form.stories-45c0cd59.js → form.stories-22baf624.js} +1 -1
- package/dist/storybook/assets/{formation.stories-5eeaa826.js → formation.stories-1ec6dc0a.js} +1 -1
- package/dist/storybook/assets/{formatter-SWP5E3XI-06c7911e.js → formatter-SWP5E3XI-5ec029d6.js} +1 -1
- package/dist/storybook/assets/iframe-4c03ff96.js +1 -0
- package/dist/storybook/assets/{index-97b8789c.js → index-a0d3f7bb.js} +4 -4
- package/dist/storybook/assets/input-fe343103.js +1 -0
- package/dist/storybook/assets/{input-group.stories-a2a3400e.js → input-group.stories-c101bacb.js} +1 -1
- package/dist/storybook/assets/{input-validation-64e7abcc.js → input-validation-eea0b47d.js} +1 -1
- package/dist/storybook/assets/input.stories-8d8f98aa.js +50 -0
- package/dist/storybook/assets/{inputs-e48e1acb.js → inputs-d6bc877d.js} +1 -1
- package/dist/storybook/assets/{layout-forms-289235b9.js → layout-forms-97653cfa.js} +1 -1
- package/dist/storybook/assets/{layout-general-545e69b0.js → layout-general-561efbf4.js} +1 -1
- package/dist/storybook/assets/{modal.stories-0e068cc1.js → modal.stories-8417b5f6.js} +1 -1
- package/dist/storybook/assets/{number-input-7d49b0b3.js → number-input-ee6b7bed.js} +1 -1
- package/dist/storybook/assets/{number-input.stories-02528124.js → number-input.stories-c7a6eb78.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-7aefd342.js → padding-and-spacing-d79ae7a0.js} +1 -1
- package/dist/storybook/assets/{pagination-8aade846.js → pagination-08085c70.js} +1 -1
- package/dist/storybook/assets/{pagination.stories-423b4938.js → pagination.stories-30aca97a.js} +1 -1
- package/dist/storybook/assets/{popover.stories-f651a81c.js → popover.stories-22fb507f.js} +1 -1
- package/dist/storybook/assets/{preview-88cc5d68.js → preview-4f7f6858.js} +1 -1
- package/dist/storybook/assets/preview-6beb9e30.js +1 -0
- package/dist/storybook/assets/{reservoirs.stories-6b14a37f.js → reservoirs.stories-c51ca4fc.js} +1 -1
- package/dist/storybook/assets/{row.stories-d5b6b4a6.js → row.stories-5b606129.js} +1 -1
- package/dist/storybook/assets/{site.stories-dee8ce1c.js → site.stories-c00ab913.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-NMPM6SWI-5e884b35.js → syntaxhighlighter-NMPM6SWI-0a6b1a80.js} +1 -1
- package/dist/storybook/assets/{table-da6f6045.js → table-638f74db.js} +1 -1
- package/dist/storybook/assets/{table.stories-67a3023a.js → table.stories-8d26ab59.js} +1 -1
- package/dist/storybook/assets/{textarea-d48efea2.js → textarea-26522344.js} +1 -1
- package/dist/storybook/assets/{textarea.stories-89c8afd7.js → textarea.stories-2e69ebc1.js} +1 -1
- package/dist/storybook/assets/{title.stories-5b4a226c.js → title.stories-d21eaa33.js} +1 -1
- package/dist/storybook/assets/unit-input.stories-bab08471.js +273 -0
- 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-c1fab5c5.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-5405e1e8.js +0 -1
- package/dist/storybook/assets/unit-input.stories-50ac8b0f.js +0 -257
|
@@ -22954,6 +22954,41 @@ 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
|
+
(_a = inputRef.current) == null ? void 0 : _a.setSelectionRange(
|
|
22974
|
+
position2.current.beforeStart,
|
|
22975
|
+
position2.current.beforeEnd
|
|
22976
|
+
);
|
|
22977
|
+
}, [value]);
|
|
22978
|
+
reactExports.useImperativeHandle(ref2, () => ({
|
|
22979
|
+
blur: () => {
|
|
22980
|
+
var _a;
|
|
22981
|
+
(_a = inputRef.current) == null ? void 0 : _a.blur();
|
|
22982
|
+
},
|
|
22983
|
+
click: () => {
|
|
22984
|
+
var _a;
|
|
22985
|
+
(_a = inputRef.current) == null ? void 0 : _a.click();
|
|
22986
|
+
},
|
|
22987
|
+
focus: () => {
|
|
22988
|
+
var _a;
|
|
22989
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
22990
|
+
}
|
|
22991
|
+
}));
|
|
22957
22992
|
const order2 = (() => {
|
|
22958
22993
|
if (groupOrder) {
|
|
22959
22994
|
switch (groupOrder) {
|
|
@@ -22981,12 +23016,12 @@ reactExports.forwardRef(
|
|
|
22981
23016
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
22982
23017
|
"input",
|
|
22983
23018
|
{
|
|
22984
|
-
ref:
|
|
23019
|
+
ref: inputRef,
|
|
22985
23020
|
type: type2 || "text",
|
|
22986
23021
|
size: size2 || 20,
|
|
22987
23022
|
placeholder: placeholder2 ?? "",
|
|
22988
23023
|
value: value ?? "",
|
|
22989
|
-
onChange,
|
|
23024
|
+
onChange: handleChange,
|
|
22990
23025
|
onKeyPress,
|
|
22991
23026
|
onFocus,
|
|
22992
23027
|
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-ba2c9337.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";
|
|
@@ -9163,6 +9163,41 @@ const Input$1 = forwardRef(
|
|
|
9163
9163
|
//use width instead
|
|
9164
9164
|
}, ref2) => {
|
|
9165
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
|
+
(_a = inputRef.current) == null ? void 0 : _a.setSelectionRange(
|
|
9183
|
+
position3.current.beforeStart,
|
|
9184
|
+
position3.current.beforeEnd
|
|
9185
|
+
);
|
|
9186
|
+
}, [value]);
|
|
9187
|
+
useImperativeHandle(ref2, () => ({
|
|
9188
|
+
blur: () => {
|
|
9189
|
+
var _a;
|
|
9190
|
+
(_a = inputRef.current) == null ? void 0 : _a.blur();
|
|
9191
|
+
},
|
|
9192
|
+
click: () => {
|
|
9193
|
+
var _a;
|
|
9194
|
+
(_a = inputRef.current) == null ? void 0 : _a.click();
|
|
9195
|
+
},
|
|
9196
|
+
focus: () => {
|
|
9197
|
+
var _a;
|
|
9198
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
9199
|
+
}
|
|
9200
|
+
}));
|
|
9166
9201
|
const order2 = (() => {
|
|
9167
9202
|
if (groupOrder) {
|
|
9168
9203
|
switch (groupOrder) {
|
|
@@ -9190,12 +9225,12 @@ const Input$1 = forwardRef(
|
|
|
9190
9225
|
children: /* @__PURE__ */ jsx(
|
|
9191
9226
|
"input",
|
|
9192
9227
|
{
|
|
9193
|
-
ref:
|
|
9228
|
+
ref: inputRef,
|
|
9194
9229
|
type: type || "text",
|
|
9195
9230
|
size: size2 || 20,
|
|
9196
9231
|
placeholder: placeholder3 ?? "",
|
|
9197
9232
|
value: value ?? "",
|
|
9198
|
-
onChange,
|
|
9233
|
+
onChange: handleChange,
|
|
9199
9234
|
onKeyPress,
|
|
9200
9235
|
onFocus,
|
|
9201
9236
|
onBlur,
|