@pnkx-lib/ui 1.9.478 → 1.9.480
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/es/fields/Input.js +10 -8
- package/es/ui/Tabs.js +2 -2
- package/package.json +1 -1
- package/types/components/fields/Input.d.ts +1 -1
package/es/fields/Input.js
CHANGED
|
@@ -1295,7 +1295,7 @@ const Input = (props) => {
|
|
|
1295
1295
|
subLabel,
|
|
1296
1296
|
classNameSubLabel,
|
|
1297
1297
|
maxValue,
|
|
1298
|
-
|
|
1298
|
+
toLowerCaseSafe,
|
|
1299
1299
|
...restProps
|
|
1300
1300
|
} = props;
|
|
1301
1301
|
const { name, value, onChange, onBlur } = field || {};
|
|
@@ -1311,6 +1311,12 @@ const Input = (props) => {
|
|
|
1311
1311
|
(match) => match.toUpperCase()
|
|
1312
1312
|
);
|
|
1313
1313
|
};
|
|
1314
|
+
const handleToLowerCaseSafe = (value2) => {
|
|
1315
|
+
if (typeof value2 === "string") {
|
|
1316
|
+
return value2.toLowerCase();
|
|
1317
|
+
}
|
|
1318
|
+
return value2 || void 0;
|
|
1319
|
+
};
|
|
1314
1320
|
//! Function
|
|
1315
1321
|
const handleChange = useCallback(
|
|
1316
1322
|
(e) => {
|
|
@@ -1364,7 +1370,6 @@ const Input = (props) => {
|
|
|
1364
1370
|
NumericFormatCustom,
|
|
1365
1371
|
{
|
|
1366
1372
|
maxValue,
|
|
1367
|
-
minValue,
|
|
1368
1373
|
name,
|
|
1369
1374
|
ref: inputRef,
|
|
1370
1375
|
type,
|
|
@@ -1381,6 +1386,7 @@ const Input = (props) => {
|
|
|
1381
1386
|
const InputComponent = inputPassword ? Input$1.Password : Input$1;
|
|
1382
1387
|
const customValue = toLowerCaseValue ? capitalizeAfterPeriod(value) : value;
|
|
1383
1388
|
const upperValue = toUpperCaseValue ? value?.toUpperCase() : customValue;
|
|
1389
|
+
const toLowerCaseSafeValue = toLowerCaseSafe ? handleToLowerCaseSafe(value) : upperValue;
|
|
1384
1390
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1385
1391
|
/* @__PURE__ */ jsx(
|
|
1386
1392
|
InputComponent,
|
|
@@ -1388,7 +1394,7 @@ const Input = (props) => {
|
|
|
1388
1394
|
ref: inputRef,
|
|
1389
1395
|
onCompositionStart: handleCompositionStart,
|
|
1390
1396
|
onCompositionEnd: handleCompositionEnd,
|
|
1391
|
-
value:
|
|
1397
|
+
value: toLowerCaseSafeValue,
|
|
1392
1398
|
onChange: handleChange,
|
|
1393
1399
|
onBlur,
|
|
1394
1400
|
prefix: iconStartInput,
|
|
@@ -1450,7 +1456,6 @@ const NumericFormatCustom = forwardRef((props, ref) => {
|
|
|
1450
1456
|
type,
|
|
1451
1457
|
prefix,
|
|
1452
1458
|
helperText,
|
|
1453
|
-
minValue,
|
|
1454
1459
|
maxValue = 999999999999999,
|
|
1455
1460
|
decimalScale,
|
|
1456
1461
|
thousandSeparator,
|
|
@@ -1491,10 +1496,7 @@ const NumericFormatCustom = forwardRef((props, ref) => {
|
|
|
1491
1496
|
prefix: isMoney ? "$" : prefix,
|
|
1492
1497
|
isAllowed: (values) => {
|
|
1493
1498
|
const { floatValue } = values;
|
|
1494
|
-
|
|
1495
|
-
if (minValue !== void 0 && floatValue < minValue) return false;
|
|
1496
|
-
if (maxValue !== void 0 && floatValue > maxValue) return false;
|
|
1497
|
-
return true;
|
|
1499
|
+
return floatValue === void 0 || floatValue.toString().length <= maxValue;
|
|
1498
1500
|
},
|
|
1499
1501
|
...restProps
|
|
1500
1502
|
}
|
package/es/ui/Tabs.js
CHANGED
|
@@ -23,7 +23,7 @@ const createStoreImpl = (createState) => {
|
|
|
23
23
|
const initialState = state = createState(setState, getState, api);
|
|
24
24
|
return api;
|
|
25
25
|
};
|
|
26
|
-
const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
26
|
+
const createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
|
|
27
27
|
|
|
28
28
|
const identity = (arg) => arg;
|
|
29
29
|
function useStore(api, selector = identity) {
|
|
@@ -41,7 +41,7 @@ const createImpl = (createState) => {
|
|
|
41
41
|
Object.assign(useBoundStore, api);
|
|
42
42
|
return useBoundStore;
|
|
43
43
|
};
|
|
44
|
-
const create = (createState) => createState ? createImpl(createState) : createImpl;
|
|
44
|
+
const create = ((createState) => createState ? createImpl(createState) : createImpl);
|
|
45
45
|
|
|
46
46
|
const useTabStore = create((set) => ({
|
|
47
47
|
activeTabKey: void 0,
|
package/package.json
CHANGED
|
@@ -24,9 +24,9 @@ export interface InputProps extends InputPropsAntd {
|
|
|
24
24
|
subLabel?: string;
|
|
25
25
|
classNameSubLabel?: string;
|
|
26
26
|
maxValue?: number;
|
|
27
|
-
minValue?: number;
|
|
28
27
|
thousandSeparator?: string;
|
|
29
28
|
decimalSeparator?: string;
|
|
29
|
+
toLowerCaseSafe?: boolean;
|
|
30
30
|
}
|
|
31
31
|
export declare const Input: (props: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
export interface PropsNumberFormat extends Omit<InputProps, "onChange" | "afterOnChange" | "value" | "defaultValue" | "iconStartInput" | "iconEndInput"> {
|