@omnic/widget-locations 1.0.46 → 1.0.48
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/README.md +12 -10
- package/dist/lib/components/Input/Input.d.ts +3 -2
- package/dist/lib/components/TextArea/TextArea.d.ts +6 -2
- package/dist/lib/hooks/useInputValueHandler.d.ts +1 -1
- package/dist/lib/types/config.d.ts +10 -10
- package/dist/lib/widget.es.js +2702 -2645
- package/dist/lib/widget.umd.js +13 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -132,36 +132,38 @@ Then `OMNIC_WIDGET_LOCATIONS_CONFIG` has the following structure:
|
|
|
132
132
|
`WidgetInputs` type has the following structure:
|
|
133
133
|
|
|
134
134
|
```typescript
|
|
135
|
-
export
|
|
135
|
+
export interface ForwardedInputElement extends Pick<HTMLInputElement, "focus" | "blur"> {
|
|
136
136
|
setValue: (value: string) => void;
|
|
137
|
-
}
|
|
137
|
+
}
|
|
138
138
|
|
|
139
|
-
export interface InputConfig
|
|
139
|
+
export interface InputConfig {
|
|
140
140
|
name: string;
|
|
141
|
-
ref: RefObject<ForwardedInputElement
|
|
142
|
-
onClick
|
|
141
|
+
ref: RefObject<ForwardedInputElement>;
|
|
142
|
+
onClick?: (name: string) => void;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
export interface WidgetInputs {
|
|
146
146
|
/**
|
|
147
|
-
|
|
147
|
+
Widget Map address input
|
|
148
148
|
*/
|
|
149
|
-
address: InputConfig
|
|
149
|
+
address: InputConfig;
|
|
150
150
|
/**
|
|
151
151
|
* Widget city input
|
|
152
152
|
*/
|
|
153
|
-
city: InputConfig
|
|
153
|
+
city: InputConfig;
|
|
154
154
|
/**
|
|
155
155
|
* Courier delivery apartment input
|
|
156
156
|
*/
|
|
157
|
-
apartment: InputConfig
|
|
157
|
+
apartment: InputConfig;
|
|
158
158
|
/**
|
|
159
159
|
* Courier delivery comment input
|
|
160
160
|
*/
|
|
161
|
-
comment: InputConfig
|
|
161
|
+
comment: InputConfig;
|
|
162
162
|
}
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
+
**NOTE:** when using screen keyboard do not forget to call `focus()` method for `address` and `city` inputs, so that autocomplete will appear.
|
|
166
|
+
|
|
165
167
|
Include `styles.css` and `widget.umd.js` in your page:
|
|
166
168
|
|
|
167
169
|
```html
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { ReactNode, RefObject } from "react";
|
|
2
2
|
import { ForwardedInputElement } from '../../types/config';
|
|
3
3
|
interface InputProps extends React.AllHTMLAttributes<HTMLInputElement> {
|
|
4
4
|
label?: string;
|
|
5
5
|
className?: string;
|
|
6
6
|
startAdornment?: ReactNode;
|
|
7
7
|
endAdornment?: ReactNode;
|
|
8
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
8
9
|
}
|
|
9
|
-
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<ForwardedInputElement
|
|
10
|
+
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<ForwardedInputElement>>;
|
|
10
11
|
export {};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { RefObject } from "react";
|
|
2
2
|
import { ForwardedInputElement } from '../../types/config';
|
|
3
|
-
|
|
3
|
+
interface TextAreaProps extends React.ComponentProps<"textarea"> {
|
|
4
|
+
inputRef?: RefObject<HTMLTextAreaElement>;
|
|
5
|
+
}
|
|
6
|
+
export declare const TextArea: import("react").ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & import("react").RefAttributes<ForwardedInputElement>>;
|
|
7
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InputConfig } from '../types/config';
|
|
2
|
-
export declare const useInputValueHandler: <T extends InputConfig
|
|
2
|
+
export declare const useInputValueHandler: <T extends InputConfig>(input: Nullable<T>) => {
|
|
3
3
|
readonly ref: T["ref"];
|
|
4
4
|
readonly name: string | undefined;
|
|
5
5
|
readonly onClick: () => void;
|
|
@@ -11,31 +11,31 @@ export interface MapConfig {
|
|
|
11
11
|
center?: Coordinates;
|
|
12
12
|
provider?: MapProvider;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export interface ForwardedInputElement extends Pick<HTMLInputElement, "focus" | "blur"> {
|
|
15
15
|
setValue: (value: string) => void;
|
|
16
|
-
}
|
|
17
|
-
export interface InputConfig
|
|
16
|
+
}
|
|
17
|
+
export interface InputConfig {
|
|
18
18
|
name: string;
|
|
19
|
-
ref: RefObject<ForwardedInputElement
|
|
20
|
-
onClick
|
|
19
|
+
ref: RefObject<ForwardedInputElement>;
|
|
20
|
+
onClick?: (name: string) => void;
|
|
21
21
|
}
|
|
22
22
|
export interface WidgetInputs {
|
|
23
23
|
/**
|
|
24
|
-
|
|
24
|
+
Widget Map address input
|
|
25
25
|
*/
|
|
26
|
-
address: InputConfig
|
|
26
|
+
address: InputConfig;
|
|
27
27
|
/**
|
|
28
28
|
* Widget city input
|
|
29
29
|
*/
|
|
30
|
-
city: InputConfig
|
|
30
|
+
city: InputConfig;
|
|
31
31
|
/**
|
|
32
32
|
* Courier delivery apartment input
|
|
33
33
|
*/
|
|
34
|
-
apartment: InputConfig
|
|
34
|
+
apartment: InputConfig;
|
|
35
35
|
/**
|
|
36
36
|
* Courier delivery comment input
|
|
37
37
|
*/
|
|
38
|
-
comment: InputConfig
|
|
38
|
+
comment: InputConfig;
|
|
39
39
|
}
|
|
40
40
|
export interface WidgetConfig {
|
|
41
41
|
INN: INNType;
|