You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-2
Original file line number
Diff line number
Diff line change
@@ -137,12 +137,48 @@ Example with only bottom borders:
137
137
| <b>`isCharsCode`</b> | boolean | false | When `true` inputted code can contain any char and not only digits from 0 to 9. If the input parameter <b>`code`</b> contains non digits chars and `isCharsCode` is `false` the value will be ignored |
138
138
| <b>`isPrevFocusableAfterClearing`</b> | boolean | true | When `true` after the input value deletion the caret will be moved to the previous input immediately. If `false` then after the input value deletion the caret will stay on the current input and be moved to the previous input only if the current input is empty |
139
139
| <b>`isFocusingOnLastByClickIfFilled`</b> | boolean | false | When `true` and the code is filled then the focus will be moved to the last input element when clicked |
140
-
| <b>`initialFocusField`</b> | number | - | The index of the input box for initial focusing. When the component will appear the focus will be placed on the input with this index. <br/> Note: If you need to dynamically hide the component it is needed to use <b>*ngIf</b> directive instead of the `[hidden]` attribute.|
141
-
| <b>`code`</b> | string / number | - | The input code value for the component. If the parameter contains non digits chars and `isCharsCode` is `false` the value will be <b>ignored |
140
+
| <b>`initialFocusField`</b> | number | - | The index of the input box for initial focusing. When the component will appear the focus will be placed on the input with this index. <br/> Note: If you need to dynamically hide the component it is needed to use <b>*ngIf</b> directive instead of the `[hidden]` attribute |
141
+
| <b>`code`</b> | string / number | - | The input code value for the component. If the parameter contains non digits chars and `isCharsCode` is `false` the value will be <b>ignored</b>|
142
142
143
143
#### Events
144
144
145
145
| Event | Description |
146
146
|----------|--------------------|
147
147
|`codeChanged`| Will be called every time when a user changed the code |
148
148
|`codeCompleted`| Will be called only if a user entered full code |
149
+
150
+
## Methods
151
+
152
+
For calling the component's methods it is required to access the component inside the template or page script.
// calling the component's methods somewhere in the page.
177
+
// IMPORTANT: it will be accessible only after the view initialization!
178
+
this.codeInput.reset();
179
+
```
180
+
181
+
| Method | Description |
182
+
|----------------|--------------------|
183
+
| <b>`focusOnField(index: number): void`</b> | Focuses the input caret on the input box with the passed index |
184
+
| <b>`reset(isChangesEmitting = false): void`</b> | <p>Resets the component values in the following way:</p><p>if the `code` option is supplied then the value will be reset to the `code` option value. If the `code` option is not supplied then the component will be reset to empty values.</p><p>if the `initialFocusField` option is supplied then the caret will be focused in that filed after reset.</p><p>if the `isChangesEmitting` param is passed then changes will be emitted</p>|
Copy file name to clipboardExpand all lines: angular-code-input/CHANGELOG.md
+6
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
# 1.4.0 (09.02.2021)
2
+
**Note:** The following changes have been made:
3
+
- Have fixed the issue 'initialFocusField not working for 0 as index bug' [#26](https://github.com/AlexMiniApps/angular-code-input/issues/26)
4
+
- Have implemented the feature 'Clear the inputs?' [#27](https://github.com/AlexMiniApps/angular-code-input/issues/27)
5
+
- Have added the method for an input field focusing
Copy file name to clipboardExpand all lines: angular-code-input/README.md
+38-2
Original file line number
Diff line number
Diff line change
@@ -137,12 +137,48 @@ Example with only bottom borders:
137
137
| <b>`isCharsCode`</b> | boolean | false | When `true` inputted code can contain any char and not only digits from 0 to 9. If the input parameter <b>`code`</b> contains non digits chars and `isCharsCode` is `false` the value will be ignored |
138
138
| <b>`isPrevFocusableAfterClearing`</b> | boolean | true | When `true` after the input value deletion the caret will be moved to the previous input immediately. If `false` then after the input value deletion the caret will stay on the current input and be moved to the previous input only if the current input is empty |
139
139
| <b>`isFocusingOnLastByClickIfFilled`</b> | boolean | false | When `true` and the code is filled then the focus will be moved to the last input element when clicked |
140
-
| <b>`initialFocusField`</b> | number | - | The index of the input box for initial focusing. When the component will appear the focus will be placed on the input with this index. <br/> Note: If you need to dynamically hide the component it is needed to use <b>*ngIf</b> directive instead of the `[hidden]` attribute.|
141
-
| <b>`code`</b> | string / number | - | The input code value for the component. If the parameter contains non digits chars and `isCharsCode` is `false` the value will be <b>ignored |
140
+
| <b>`initialFocusField`</b> | number | - | The index of the input box for initial focusing. When the component will appear the focus will be placed on the input with this index. <br/> Note: If you need to dynamically hide the component it is needed to use <b>*ngIf</b> directive instead of the `[hidden]` attribute |
141
+
| <b>`code`</b> | string / number | - | The input code value for the component. If the parameter contains non digits chars and `isCharsCode` is `false` the value will be <b>ignored</b>|
142
142
143
143
#### Events
144
144
145
145
| Event | Description |
146
146
|----------|--------------------|
147
147
|`codeChanged`| Will be called every time when a user changed the code |
148
148
|`codeCompleted`| Will be called only if a user entered full code |
149
+
150
+
## Methods
151
+
152
+
For calling the component's methods it is required to access the component inside the template or page script.
// calling the component's methods somewhere in the page.
177
+
// IMPORTANT: it will be accessible only after the view initialization!
178
+
this.codeInput.reset();
179
+
```
180
+
181
+
| Method | Description |
182
+
|----------------|--------------------|
183
+
| <b>`focusOnField(index: number): void`</b> | Focuses the input caret on the input box with the passed index |
184
+
| <b>`reset(isChangesEmitting = false): void`</b> | <p>Resets the component values in the following way:</p><p>if the `code` option is supplied then the value will be reset to the `code` option value. If the `code` option is not supplied then the component will be reset to empty values.</p><p>if the `initialFocusField` option is supplied then the caret will be focused in that filed after reset.</p><p>if the `isChangesEmitting` param is passed then changes will be emitted</p>|
0 commit comments