@telia/teddy 0.2.13 → 0.2.14
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/components/input/index.d.ts +1 -0
- package/dist/components/input/input-group.cjs +3 -1
- package/dist/components/input/input-group.d.ts +2 -0
- package/dist/components/input/input-group.js +3 -1
- package/dist/components/text-field/index.d.ts +1 -0
- package/dist/components/text-field/text-field-input-group.d.ts +1 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { ClearButtonProps } from './input-clear-button';
|
|
|
5
5
|
|
|
6
6
|
declare const InputGroup: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
7
7
|
frameClassName?: string | undefined;
|
|
8
|
+
preventGroupClickSelect?: boolean | undefined;
|
|
8
9
|
} & import('react').RefAttributes<HTMLDivElement>> & {
|
|
9
10
|
Input: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "children"> & {
|
|
10
11
|
validationState?: ("invalid" | "valid") | undefined;
|
|
@@ -43,7 +43,7 @@ function setCursorOnInput(e) {
|
|
|
43
43
|
}
|
|
44
44
|
const InputGroupContext = React.createContext(void 0);
|
|
45
45
|
const Root = React.forwardRef(
|
|
46
|
-
({ className, children, frameClassName, ...props }, forwardRef) => {
|
|
46
|
+
({ className, preventGroupClickSelect, children, frameClassName, ...props }, forwardRef) => {
|
|
47
47
|
const classes = clsx([styles[`${rootClassName}`]], className);
|
|
48
48
|
const inputRef = React.useRef(null);
|
|
49
49
|
const [isDirty, setIsDirty] = React.useState(false);
|
|
@@ -54,6 +54,8 @@ const Root = React.forwardRef(
|
|
|
54
54
|
onPointerDown: (e) => {
|
|
55
55
|
var _a;
|
|
56
56
|
(_a = props.onPointerDown) == null ? void 0 : _a.call(props, e);
|
|
57
|
+
if (preventGroupClickSelect)
|
|
58
|
+
return;
|
|
57
59
|
setCursorOnInput(e);
|
|
58
60
|
},
|
|
59
61
|
ref: forwardRef,
|
|
@@ -2,6 +2,7 @@ import { default as React } from 'react';
|
|
|
2
2
|
|
|
3
3
|
export type InputGroupRootProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
4
4
|
frameClassName?: string;
|
|
5
|
+
preventGroupClickSelect?: boolean;
|
|
5
6
|
};
|
|
6
7
|
type InputGroupContextValue = {
|
|
7
8
|
isDirty: boolean;
|
|
@@ -12,5 +13,6 @@ export declare const InputGroupContext: React.Context<InputGroupContextValue | u
|
|
|
12
13
|
/** This is the element that wraps the input element gives the outline effect */
|
|
13
14
|
export declare const Root: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
14
15
|
frameClassName?: string | undefined;
|
|
16
|
+
preventGroupClickSelect?: boolean | undefined;
|
|
15
17
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
18
|
export {};
|
|
@@ -41,7 +41,7 @@ function setCursorOnInput(e) {
|
|
|
41
41
|
}
|
|
42
42
|
const InputGroupContext = React__default.createContext(void 0);
|
|
43
43
|
const Root = React__default.forwardRef(
|
|
44
|
-
({ className, children, frameClassName, ...props }, forwardRef) => {
|
|
44
|
+
({ className, preventGroupClickSelect, children, frameClassName, ...props }, forwardRef) => {
|
|
45
45
|
const classes = clsx([styles[`${rootClassName}`]], className);
|
|
46
46
|
const inputRef = React__default.useRef(null);
|
|
47
47
|
const [isDirty, setIsDirty] = React__default.useState(false);
|
|
@@ -52,6 +52,8 @@ const Root = React__default.forwardRef(
|
|
|
52
52
|
onPointerDown: (e) => {
|
|
53
53
|
var _a;
|
|
54
54
|
(_a = props.onPointerDown) == null ? void 0 : _a.call(props, e);
|
|
55
|
+
if (preventGroupClickSelect)
|
|
56
|
+
return;
|
|
55
57
|
setCursorOnInput(e);
|
|
56
58
|
},
|
|
57
59
|
ref: forwardRef,
|
|
@@ -21,6 +21,7 @@ export declare const TextField: import('react').ForwardRefExoticComponent<Omit<i
|
|
|
21
21
|
} & import('react').RefAttributes<HTMLLabelElement>>;
|
|
22
22
|
InputGroup: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
23
23
|
frameClassName?: string | undefined;
|
|
24
|
+
preventGroupClickSelect?: boolean | undefined;
|
|
24
25
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
25
26
|
HelperText: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
26
27
|
ErrorList: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref">, "children"> & {
|
|
@@ -4,4 +4,5 @@ import { InputGroupProps } from '../input';
|
|
|
4
4
|
export type TextFieldInputGroupProps = InputGroupProps['Root'];
|
|
5
5
|
export declare const InputGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
6
|
frameClassName?: string | undefined;
|
|
7
|
+
preventGroupClickSelect?: boolean | undefined;
|
|
7
8
|
} & React.RefAttributes<HTMLDivElement>>;
|