@js-smart/ng-kit 18.0.0
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 +297 -0
- package/esm2022/js-smart-ng-kit.mjs +5 -0
- package/esm2022/lib/components/alert/alert.component.mjs +95 -0
- package/esm2022/lib/components/autocomplete/autocomplete.component.mjs +172 -0
- package/esm2022/lib/components/buttons/base-button/base-button.component.mjs +72 -0
- package/esm2022/lib/components/buttons/bs-link-button/bs-link-button.component.mjs +52 -0
- package/esm2022/lib/components/buttons/delete-button/delete-button.component.mjs +62 -0
- package/esm2022/lib/components/buttons/edit-bs-button/edit-bs-button.component.mjs +55 -0
- package/esm2022/lib/components/buttons/edit-button/edit-button.component.mjs +49 -0
- package/esm2022/lib/components/buttons/edit-svg-icon-button/edit-svg-icon-button.component.mjs +51 -0
- package/esm2022/lib/components/buttons/excel-export-button/excel-export-button.component.mjs +14 -0
- package/esm2022/lib/components/buttons/manage-button/manage-button.component.mjs +49 -0
- package/esm2022/lib/components/buttons/pdf-export-button/pdf-export-button.component.mjs +13 -0
- package/esm2022/lib/components/buttons/primary-button/primary-button.component.mjs +61 -0
- package/esm2022/lib/components/buttons/save-primary-button/save-primary-button.component.mjs +60 -0
- package/esm2022/lib/components/buttons/search-button/search-button.component.mjs +52 -0
- package/esm2022/lib/components/buttons/success-button/success-button.component.mjs +65 -0
- package/esm2022/lib/components/buttons/view-button/view-button.component.mjs +41 -0
- package/esm2022/lib/components/buttons/view-primary-button/view-primary-button.component.mjs +49 -0
- package/esm2022/lib/components/confirm-dialog/confirm-dialog.component.mjs +63 -0
- package/esm2022/lib/components/ngx-spinner/ngx-spinner.component.mjs +195 -0
- package/esm2022/lib/components/ngx-spinner/ngx-spinner.enum.mjs +16 -0
- package/esm2022/lib/components/ngx-spinner/ngx-spinner.service.mjs +71 -0
- package/esm2022/lib/components/ngx-spinner/safe-html.pipe.mjs +24 -0
- package/esm2022/lib/components/snack-bar/error-snack-bar/error-snack-bar.component.mjs +50 -0
- package/esm2022/lib/components/snack-bar/success-snack-bar/success-snack-bar.component.mjs +50 -0
- package/esm2022/lib/components/spinner/spinner.component.mjs +31 -0
- package/esm2022/lib/directives/ngx-print.directive.mjs +255 -0
- package/esm2022/lib/directives/prevent-multiple-clicks.directive.mjs +44 -0
- package/esm2022/lib/pipes/type-of.pipe.mjs +17 -0
- package/esm2022/lib/services/mat-snack-bar.service.mjs +82 -0
- package/esm2022/lib/svg-icons/edit-solid-svg/edit-solid-svg.component.mjs +22 -0
- package/esm2022/lib/types/progress-state.mjs +2 -0
- package/esm2022/lib/util/progress-util.mjs +80 -0
- package/esm2022/public-api.mjs +33 -0
- package/fesm2022/js-smart-ng-kit.mjs +1872 -0
- package/fesm2022/js-smart-ng-kit.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/alert/alert.component.d.ts +73 -0
- package/lib/components/autocomplete/autocomplete.component.d.ts +115 -0
- package/lib/components/buttons/base-button/base-button.component.d.ts +63 -0
- package/lib/components/buttons/bs-link-button/bs-link-button.component.d.ts +10 -0
- package/lib/components/buttons/delete-button/delete-button.component.d.ts +11 -0
- package/lib/components/buttons/edit-bs-button/edit-bs-button.component.d.ts +9 -0
- package/lib/components/buttons/edit-button/edit-button.component.d.ts +10 -0
- package/lib/components/buttons/edit-svg-icon-button/edit-svg-icon-button.component.d.ts +10 -0
- package/lib/components/buttons/excel-export-button/excel-export-button.component.d.ts +5 -0
- package/lib/components/buttons/manage-button/manage-button.component.d.ts +10 -0
- package/lib/components/buttons/pdf-export-button/pdf-export-button.component.d.ts +5 -0
- package/lib/components/buttons/primary-button/primary-button.component.d.ts +12 -0
- package/lib/components/buttons/save-primary-button/save-primary-button.component.d.ts +11 -0
- package/lib/components/buttons/search-button/search-button.component.d.ts +11 -0
- package/lib/components/buttons/success-button/success-button.component.d.ts +11 -0
- package/lib/components/buttons/view-button/view-button.component.d.ts +9 -0
- package/lib/components/buttons/view-primary-button/view-primary-button.component.d.ts +10 -0
- package/lib/components/confirm-dialog/confirm-dialog.component.d.ts +20 -0
- package/lib/components/ngx-spinner/ngx-spinner.component.d.ts +109 -0
- package/lib/components/ngx-spinner/ngx-spinner.enum.d.ts +37 -0
- package/lib/components/ngx-spinner/ngx-spinner.service.d.ts +34 -0
- package/lib/components/ngx-spinner/safe-html.pipe.d.ts +10 -0
- package/lib/components/snack-bar/error-snack-bar/error-snack-bar.component.d.ts +22 -0
- package/lib/components/snack-bar/success-snack-bar/success-snack-bar.component.d.ts +22 -0
- package/lib/components/spinner/spinner.component.d.ts +22 -0
- package/lib/directives/ngx-print.directive.d.ts +157 -0
- package/lib/directives/prevent-multiple-clicks.directive.d.ts +21 -0
- package/lib/pipes/type-of.pipe.d.ts +7 -0
- package/lib/services/mat-snack-bar.service.d.ts +61 -0
- package/lib/svg-icons/edit-solid-svg/edit-solid-svg.component.d.ts +8 -0
- package/lib/types/progress-state.d.ts +7 -0
- package/lib/util/progress-util.d.ts +45 -0
- package/package.json +47 -0
- package/public-api.d.ts +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
# NGX Smart utilities
|
|
2
|
+
Reusable Angular components built with Angular Material and Bootstrap 5.x, Utility classes/functions for Date, Form and String operations
|
|
3
|
+
|
|
4
|
+
<p align="center">
|
|
5
|
+
|
|
6
|
+
[](https://github.com/ng-kit/ng-kit/actions/workflows/build.yml)
|
|
7
|
+
<a href="https://www.npmjs.com/@js-smart/ng-kit">
|
|
8
|
+
<img src="https://img.shields.io/npm/v/@js-smart/ng-kit" alt="Ngx Cookie Service on npm" />
|
|
9
|
+
</a>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
### Installation
|
|
13
|
+
Install the library
|
|
14
|
+
```shell
|
|
15
|
+
npm install @js-smart/ng-kit
|
|
16
|
+
```
|
|
17
|
+
and use it as shown below in each section
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Technologies
|
|
21
|
+
1. Angular 17+
|
|
22
|
+
2. Bootstrap 5+ (if applicable)
|
|
23
|
+
|
|
24
|
+
## Auto Complete
|
|
25
|
+
Reusable Auto Complete that extends Mat Auto Complete component
|
|
26
|
+
### Demo
|
|
27
|
+
https://main--js-smart-ng-kit.netlify.app/autocomplete-demo
|
|
28
|
+
### Usage
|
|
29
|
+
|
|
30
|
+
The library has one `autocomplete` component. To use the Auto Complete component, add the following code to the HTML page
|
|
31
|
+
|
|
32
|
+
**app.component.html**
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
<!-- Auto Complete with Objects -->
|
|
36
|
+
|
|
37
|
+
<form [formGroup]="genericFormGroup">
|
|
38
|
+
<autocomplete
|
|
39
|
+
[data]="cities"
|
|
40
|
+
[inputFormGroup]="genericFormGroup"
|
|
41
|
+
[required]="true"
|
|
42
|
+
[displayWith]="displayFn"
|
|
43
|
+
bindLabel="location"
|
|
44
|
+
bindValue="id"
|
|
45
|
+
label="City"
|
|
46
|
+
placeHolder="Select City">
|
|
47
|
+
</autocomplete>
|
|
48
|
+
</form>
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**app.component.ts**
|
|
53
|
+
|
|
54
|
+
Then define form group instances and object array (cities) and names (for string array)
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
// Define objects
|
|
58
|
+
cities = [{id: 1001, location: 'New York'}, {id: 1002, location: 'Boston'}, {id: 1001, location: 'Washington DC'}];
|
|
59
|
+
|
|
60
|
+
// Define Form Groups
|
|
61
|
+
inputFormGroup = this.fb.group({
|
|
62
|
+
autocomplete: ['']
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
//Display function
|
|
66
|
+
displayFn(object: any): string {
|
|
67
|
+
if (typeof object === "string") return object;
|
|
68
|
+
return object && object["location"] ? object["location"] : "";
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If you are using strings rather than objects, do not provide `bindLabel`, `bindValue` and `displayWith` inputs. See below sample
|
|
73
|
+
```
|
|
74
|
+
<!-- Auto Complete with Strings -->
|
|
75
|
+
<form [formGroup]="inputFormGroup">
|
|
76
|
+
<autocomplete
|
|
77
|
+
[data]="names"
|
|
78
|
+
[inputFormGroup]="inputFormGroup"
|
|
79
|
+
[required]="true"
|
|
80
|
+
label="City"
|
|
81
|
+
placeHolder="Select City">
|
|
82
|
+
</autocomplete>
|
|
83
|
+
</form>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
### Auto Complete API
|
|
88
|
+
|
|
89
|
+
#### List of selectors that can be used to select the component(s)
|
|
90
|
+
|
|
91
|
+
| AutoComplete Selector |
|
|
92
|
+
| ----------- |
|
|
93
|
+
| autocomplete, lib-autocomplete |
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
#### Properties
|
|
97
|
+
|
|
98
|
+
| Property | Description | Type | Default Value |
|
|
99
|
+
| ----------- | ----------- |----------- |----------- |
|
|
100
|
+
| inputFormGroup | Input Form Group |FormGroup||
|
|
101
|
+
| label | Label of the AutoComplete|string||
|
|
102
|
+
| placeHolder | PlaceHolder of the AutoComplete|string||
|
|
103
|
+
| appearance | Appearance of the AutoComplete, defaults to `fill` |string|fill|
|
|
104
|
+
| classes | List of CSS classes that need to applied to autocomplete|string||
|
|
105
|
+
| bindLabel | Applies only to AutoComplete with Objects. Attribute of the Object whose value would be shown when searching for data |string|id|
|
|
106
|
+
| bindValue | Applies only to AutoComplete with Objects. Attribute of the Object whose value would be used for search. Defaults to `ID` |string|id|
|
|
107
|
+
| displayWith | Applies only to AutoComplete with Objects. A function used to show display value in Input |boolean|false|
|
|
108
|
+
| required | Provide `true` if AutoComplete is required, otherwise provide `false` |boolean|false|
|
|
109
|
+
| data | List of Objects or String values that need to be bind and searched for |any[] or string[]|false|
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
## Alert
|
|
113
|
+
Reusable alert component created with Bootstrap 5+ and Angular 17+
|
|
114
|
+
### Auto Complete API
|
|
115
|
+
#### List of selectors that can be used to select the component
|
|
116
|
+
|
|
117
|
+
| Selector |
|
|
118
|
+
| ----------- |
|
|
119
|
+
| alert,lib-alert |
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
#### Properties
|
|
123
|
+
|
|
124
|
+
| Property | Description | Type | Default Value |
|
|
125
|
+
| ----------- | ----------- |----------- |----------- |
|
|
126
|
+
| dismissible | If set, displays an inline "Close" button |boolean|false|
|
|
127
|
+
| dismissOnTimeout | If set, dismisses the alert after Dismiss Timeout|boolean|true|
|
|
128
|
+
| dismissTimeout | Number in milliseconds, after which alert will be closed|string or number|5000|
|
|
129
|
+
| isOpen | Is alert visible |boolean|false|
|
|
130
|
+
| type | Alert type. Provides one of four bootstrap supported contextual classes: success, info, warning and danger|string|info|
|
|
131
|
+
|
|
132
|
+
## Spinner
|
|
133
|
+
Reusable Spinner component created with Bootstrap 5.x and Angular 17.x
|
|
134
|
+
|
|
135
|
+
### Demo
|
|
136
|
+
https://main--js-smart-ng-kit.netlify.app/alert-demo
|
|
137
|
+
### API
|
|
138
|
+
#### List of selectors that can be used to select the component
|
|
139
|
+
|
|
140
|
+
| Selector |
|
|
141
|
+
| ----------- |
|
|
142
|
+
| spinner,lib-spinner |
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
#### Properties
|
|
146
|
+
|
|
147
|
+
| Property | Description | Type | Default Value |
|
|
148
|
+
| ----------- | ----------- |----------- |----------- |
|
|
149
|
+
| bootstrapSpinner | Use Boostrap Spinner. Default `true` |boolean|false|
|
|
150
|
+
| diameter | Diameter of the Angular Material spinner|boolean|true|
|
|
151
|
+
| color | Color of the Angular Material spinner|string or `ThemePalette`|5000|
|
|
152
|
+
| strokeWidth | Stroke Width of the Angular Material spinner|boolean|false|
|
|
153
|
+
|
|
154
|
+
## Print
|
|
155
|
+
Angular (2++) directive that prints HTML section
|
|
156
|
+
### Usage
|
|
157
|
+
Import the main module `NgxPrintModule` :
|
|
158
|
+
|
|
159
|
+
```js
|
|
160
|
+
import {NgxPrintModule} from '@js-smart/print';
|
|
161
|
+
|
|
162
|
+
@NgModule({
|
|
163
|
+
...
|
|
164
|
+
imports:
|
|
165
|
+
[NgxPrintModule, ...],
|
|
166
|
+
...
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
export class YourAppModule {
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**3-** Then plug n' play with it:
|
|
174
|
+
|
|
175
|
+
- Assuming you want to print the following HTML section:
|
|
176
|
+
|
|
177
|
+
```html
|
|
178
|
+
|
|
179
|
+
<div>
|
|
180
|
+
<!--Your html stuff that you want to print-->
|
|
181
|
+
</div>
|
|
182
|
+
<button>print</button> <!--Your relevant print button-->
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
- Now, what you have to do is tagging your *wanted-to-print* section by an `id` attribute, then link that `id` to a
|
|
187
|
+
directive parameter in your button :
|
|
188
|
+
|
|
189
|
+
```html
|
|
190
|
+
<!--
|
|
191
|
+
1)- Add an ID here
|
|
192
|
+
-->
|
|
193
|
+
<div id="print-section">
|
|
194
|
+
<!--Your html stuff that you want to print-->
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<!--
|
|
198
|
+
2)- Add the directive name in your button (ngxPrint),
|
|
199
|
+
3)- Affect your ID to printSectionId
|
|
200
|
+
-->
|
|
201
|
+
<button printSectionId="print-section" ngxPrint>print</button>
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Optional properties
|
|
206
|
+
|
|
207
|
+
- You want a customized title for your printing window ? you have the choice by adding a new attribute to your print
|
|
208
|
+
button `printTitle`:
|
|
209
|
+
|
|
210
|
+
```html
|
|
211
|
+
|
|
212
|
+
<div id="print-section">
|
|
213
|
+
|
|
214
|
+
<!-- ... -->
|
|
215
|
+
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<button
|
|
219
|
+
printTitle="MyTitle"
|
|
220
|
+
printSectionId="print-section"
|
|
221
|
+
ngxPrint>print
|
|
222
|
+
</button>
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
- Also, would you like to customize the printing window style sheet (CSS) ? Hence you can do so by adding infinite
|
|
227
|
+
styles to another attribute called `printStyle`:
|
|
228
|
+
|
|
229
|
+
```html
|
|
230
|
+
|
|
231
|
+
<div id="print-section">
|
|
232
|
+
|
|
233
|
+
<!-- ... -->
|
|
234
|
+
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
<button
|
|
238
|
+
[printStyle]="{h1 : {'color': 'red'}, h2 : {'border': 'solid 1px'}}"
|
|
239
|
+
printSectionId="print-section"
|
|
240
|
+
ngxPrint>print
|
|
241
|
+
</button>
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Here some simple styles were added to every `h1` & `h2` tags within the `div` where `print-section` is tagged to
|
|
246
|
+
its `id` attribute.
|
|
247
|
+
|
|
248
|
+
- If you would like to use your existing CSS with media print you can add the `useExistingCss` attribute:
|
|
249
|
+
|
|
250
|
+
```html
|
|
251
|
+
|
|
252
|
+
<div id="print-section">
|
|
253
|
+
|
|
254
|
+
<!-- ... -->
|
|
255
|
+
|
|
256
|
+
</div>
|
|
257
|
+
|
|
258
|
+
<button
|
|
259
|
+
[useExistingCss]="true"
|
|
260
|
+
printSectionId="print-section"
|
|
261
|
+
ngxPrint>print
|
|
262
|
+
</button>
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
- If you want to customize the printing window style sheet (CSS) by importing the css provided in assets/css
|
|
267
|
+
use `styleSheetFile`:
|
|
268
|
+
|
|
269
|
+
```html
|
|
270
|
+
|
|
271
|
+
<div id="print-section">
|
|
272
|
+
|
|
273
|
+
<!-- ... -->
|
|
274
|
+
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
<button
|
|
278
|
+
styleSheetFile="assets/css/custom1.css,assets/css/custom2.css"
|
|
279
|
+
printSectionId="print-section"
|
|
280
|
+
ngxPrint>print
|
|
281
|
+
</button>
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
### Publish library to NPM
|
|
285
|
+
1. Build the library
|
|
286
|
+
```shell
|
|
287
|
+
nx build ng-kit
|
|
288
|
+
```
|
|
289
|
+
2. If the NPM token is not configured, open `~/.npmrc` and add the following line:
|
|
290
|
+
```shell
|
|
291
|
+
//registry.npmjs.org/:_authToken=<your npm token>
|
|
292
|
+
```
|
|
293
|
+
3. Then navigate to `dist` directory anf publish the library to NPM. If prompted, enter the 2fa auth code from the Authenticator app.
|
|
294
|
+
```shell
|
|
295
|
+
cd dist/libs/ng-kit && npm publish --tag latest
|
|
296
|
+
```
|
|
297
|
+
For beta releases use tag `--tag beta`
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public-api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianMtc21hcnQtbmcta2l0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvbmcta2l0L3NyYy9qcy1zbWFydC1uZy1raXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Component, input, signal } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Boostrap Alert component that can be used to alert messages to the user
|
|
6
|
+
*
|
|
7
|
+
* @author Pavan Kumar Jadda
|
|
8
|
+
* @since 12.0.0
|
|
9
|
+
*/
|
|
10
|
+
export class AlertComponent {
|
|
11
|
+
constructor(cdr) {
|
|
12
|
+
this.cdr = cdr;
|
|
13
|
+
/**
|
|
14
|
+
* Type of the BootStrap Alert. Following values are supported. See BootStrap docs for more information
|
|
15
|
+
* <pre>
|
|
16
|
+
* 1. info
|
|
17
|
+
* 2. primary
|
|
18
|
+
* 3. secondary
|
|
19
|
+
* 4. success
|
|
20
|
+
* 5. warning
|
|
21
|
+
* 6. danger
|
|
22
|
+
* 7. dark
|
|
23
|
+
* 8. light
|
|
24
|
+
* </pre>
|
|
25
|
+
*/
|
|
26
|
+
this.type = input('info');
|
|
27
|
+
/**
|
|
28
|
+
* Is alert visible or open
|
|
29
|
+
*/
|
|
30
|
+
this.isOpen = input(true);
|
|
31
|
+
/**
|
|
32
|
+
* Writable signal for isOpen
|
|
33
|
+
*/
|
|
34
|
+
this.open = signal(this.isOpen());
|
|
35
|
+
/**
|
|
36
|
+
* If set, displays an inline “Close” button
|
|
37
|
+
*/
|
|
38
|
+
this.dismissible = input(true);
|
|
39
|
+
/**
|
|
40
|
+
* If set, dismisses the alert after Dismiss Timeout
|
|
41
|
+
*/
|
|
42
|
+
this.dismissOnTimeout = input(true);
|
|
43
|
+
/**
|
|
44
|
+
* Number in milliseconds, after which alert will be closed. Default value is 5000 ms
|
|
45
|
+
*/
|
|
46
|
+
this.dismissTimeout = input(5000);
|
|
47
|
+
/**
|
|
48
|
+
* Additional classes to be added to the alert. This can be used to add custom styles to the alert
|
|
49
|
+
*/
|
|
50
|
+
this.class = input('');
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Initialize the component and settings
|
|
54
|
+
*
|
|
55
|
+
* @author Pavan Kumar Jadda
|
|
56
|
+
* @since 12.0.0
|
|
57
|
+
*/
|
|
58
|
+
ngOnInit() {
|
|
59
|
+
this.openAlert();
|
|
60
|
+
if (this.dismissOnTimeout()) {
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
this.closeAlert();
|
|
63
|
+
this.cdr.markForCheck();
|
|
64
|
+
}, this.dismissTimeout());
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Closes BootStrap Alert if not open
|
|
69
|
+
*
|
|
70
|
+
* @author Pavan Kumar Jadda
|
|
71
|
+
* @since 12.0.0
|
|
72
|
+
*/
|
|
73
|
+
closeAlert() {
|
|
74
|
+
if (!this.isOpen()) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
this.open.set(false);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Opens Bootstrap Alert
|
|
81
|
+
*
|
|
82
|
+
* @author Pavan Kumar Jadda
|
|
83
|
+
* @since 12.0.0
|
|
84
|
+
*/
|
|
85
|
+
openAlert() {
|
|
86
|
+
this.open.set(true);
|
|
87
|
+
}
|
|
88
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AlertComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
89
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.0", type: AlertComponent, isStandalone: true, selector: "lib-alert, alert", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, dismissOnTimeout: { classPropertyName: "dismissOnTimeout", publicName: "dismissOnTimeout", isSignal: true, isRequired: false, transformFunction: null }, dismissTimeout: { classPropertyName: "dismissTimeout", publicName: "dismissTimeout", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (open()) {\n\t<div class=\"row {{ class() }}\">\n\t\t<div class=\"col-xs-12 col-sm-12 col-md-auto mx-auto\">\n\t\t\t<div class=\"alert alert-{{ type() }} alert-dismissible alert_div\" role=\"alert\">\n\t\t\t\t<ng-content></ng-content>\n\t\t\t\t@if (dismissible()) {\n\t\t\t\t\t<button (click)=\"closeAlert()\" aria-label=\"Close\" class=\"btn-close\" data-bs-dismiss=\"alert\" type=\"button\"></button>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n}\n", styles: [".alert_div{display:flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
|
|
90
|
+
}
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AlertComponent, decorators: [{
|
|
92
|
+
type: Component,
|
|
93
|
+
args: [{ selector: 'lib-alert, alert', standalone: true, imports: [CommonModule], template: "@if (open()) {\n\t<div class=\"row {{ class() }}\">\n\t\t<div class=\"col-xs-12 col-sm-12 col-md-auto mx-auto\">\n\t\t\t<div class=\"alert alert-{{ type() }} alert-dismissible alert_div\" role=\"alert\">\n\t\t\t\t<ng-content></ng-content>\n\t\t\t\t@if (dismissible()) {\n\t\t\t\t\t<button (click)=\"closeAlert()\" aria-label=\"Close\" class=\"btn-close\" data-bs-dismiss=\"alert\" type=\"button\"></button>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n}\n", styles: [".alert_div{display:flex;align-items:center;justify-content:center}\n"] }]
|
|
94
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
|
|
95
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxlcnQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmcta2l0L3NyYy9saWIvY29tcG9uZW50cy9hbGVydC9hbGVydC5jb21wb25lbnQudHMiLCIuLi8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cdFx0XHQ8L2Rpdj5cblx0XHQ8L2Rpdj5cblx0PC9kaXY+XG59XG4iXX0=
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Component, Input, input, Optional, output, ViewChild, } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { map, startWith } from 'rxjs/operators';
|
|
5
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
6
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
7
|
+
import { MatInputModule } from '@angular/material/input';
|
|
8
|
+
import { TypeOfPipe } from '../../pipes/type-of.pipe';
|
|
9
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
10
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
11
|
+
import { AsyncPipe } from '@angular/common';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
import * as i1 from "@angular/forms";
|
|
14
|
+
import * as i2 from "@angular/material/form-field";
|
|
15
|
+
import * as i3 from "@angular/material/autocomplete";
|
|
16
|
+
import * as i4 from "@angular/material/core";
|
|
17
|
+
import * as i5 from "@angular/material/input";
|
|
18
|
+
import * as i6 from "@angular/material/button";
|
|
19
|
+
import * as i7 from "@angular/material/icon";
|
|
20
|
+
/**
|
|
21
|
+
* Reusable Auto Complete component that extends MatAutoComplete to show Clear icon and Arrow buttons
|
|
22
|
+
*
|
|
23
|
+
* @author Pavan Kumar Jadda
|
|
24
|
+
* @since 12.0.0
|
|
25
|
+
*/
|
|
26
|
+
export class AutocompleteComponent {
|
|
27
|
+
constructor(cdRef) {
|
|
28
|
+
this.cdRef = cdRef;
|
|
29
|
+
/**
|
|
30
|
+
* Label of the AutoComplete
|
|
31
|
+
*/
|
|
32
|
+
this.label = input('');
|
|
33
|
+
/**
|
|
34
|
+
* Placeholder of the AutoComplete
|
|
35
|
+
*/
|
|
36
|
+
this.placeHolder = input('');
|
|
37
|
+
/**
|
|
38
|
+
* Appearance of the AutoComplete, defaults to `fill`
|
|
39
|
+
*/
|
|
40
|
+
this.appearance = input('fill');
|
|
41
|
+
/**
|
|
42
|
+
* List of CSS classes that need to applied to autocomplete
|
|
43
|
+
*/
|
|
44
|
+
this.classes = input('');
|
|
45
|
+
/**
|
|
46
|
+
* Attribute of the Object whose value would be shown when searching for data. Defaults to `ID`
|
|
47
|
+
*/
|
|
48
|
+
this.bindLabel = input('');
|
|
49
|
+
/**
|
|
50
|
+
* Attribute of the Object whose value would be used for search
|
|
51
|
+
*/
|
|
52
|
+
this.bindValue = input('id');
|
|
53
|
+
/**
|
|
54
|
+
* Function that maps an option's control value to its display value in the trigger.
|
|
55
|
+
*/
|
|
56
|
+
this.displayWith = null;
|
|
57
|
+
/**
|
|
58
|
+
* Specifies if the autocomplete is required. Default is not required.
|
|
59
|
+
*/
|
|
60
|
+
this.required = input(false);
|
|
61
|
+
/**
|
|
62
|
+
* List of Objects that need to be bind and searched for
|
|
63
|
+
*/
|
|
64
|
+
this.data = input();
|
|
65
|
+
/**
|
|
66
|
+
* Emit selected value on selection changes
|
|
67
|
+
*
|
|
68
|
+
* @author Pavan Kumar Jadda
|
|
69
|
+
* @since 13.0.3
|
|
70
|
+
*/
|
|
71
|
+
this.onSelectionChange = output();
|
|
72
|
+
/**
|
|
73
|
+
* BehaviorSubject that shows the current active arrow icon
|
|
74
|
+
*/
|
|
75
|
+
this.arrowIconSubject = new BehaviorSubject('arrow_drop_down');
|
|
76
|
+
}
|
|
77
|
+
ngAfterContentChecked() {
|
|
78
|
+
this.cdRef.detectChanges();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Define autocomplete search filter on search text changes
|
|
82
|
+
*
|
|
83
|
+
* @author Pavan Kumar Jadda
|
|
84
|
+
* @since 12.0.0
|
|
85
|
+
*/
|
|
86
|
+
ngOnInit() {
|
|
87
|
+
this.filteredOptions = this.inputFormGroup?.get('autocomplete')?.valueChanges.pipe(startWith(''), map((value) => (typeof value === 'string' ? value : value !== null ? value[this.bindLabel()] : '')), map((propertyName) => this.data()?.filter((option) => {
|
|
88
|
+
return typeof option === 'string'
|
|
89
|
+
? option?.toLowerCase().indexOf(propertyName.toLowerCase()) === 0
|
|
90
|
+
: option[this.bindLabel()]?.toLowerCase().indexOf(propertyName.toLowerCase()) === 0;
|
|
91
|
+
}) ?? this.data()?.slice()));
|
|
92
|
+
}
|
|
93
|
+
ngOnChanges(_changes) {
|
|
94
|
+
this.displayFn = this.displayFn.bind(this);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Clear input and Reset autocomplete form control
|
|
98
|
+
*
|
|
99
|
+
* @author Pavan Kumar Jadda
|
|
100
|
+
* @since 12.0.0
|
|
101
|
+
*/
|
|
102
|
+
clearInput(evt) {
|
|
103
|
+
evt.stopPropagation();
|
|
104
|
+
this.inputFormGroup.get('autocomplete')?.reset();
|
|
105
|
+
this.inputAutoComplete?.nativeElement.focus();
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Open or Close panel
|
|
109
|
+
*
|
|
110
|
+
* @author Pavan Kumar Jadda
|
|
111
|
+
* @since 12.0.0
|
|
112
|
+
*/
|
|
113
|
+
openOrClosePanel(evt, trigger) {
|
|
114
|
+
evt.stopPropagation();
|
|
115
|
+
if (trigger.panelOpen)
|
|
116
|
+
trigger.closePanel();
|
|
117
|
+
else
|
|
118
|
+
trigger.openPanel();
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Display function that is used to show the values
|
|
122
|
+
*
|
|
123
|
+
* @author Pavan Kumar Jadda
|
|
124
|
+
* @since 12.0.0
|
|
125
|
+
*/
|
|
126
|
+
displayFn(object) {
|
|
127
|
+
if (this.displayWith !== undefined && this.displayWith !== null && typeof this.displayWith === 'function') {
|
|
128
|
+
this.displayFn = this.displayWith.bind(this);
|
|
129
|
+
return this.displayWith(object);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
if (typeof object === 'string')
|
|
133
|
+
return object;
|
|
134
|
+
return object && object[this.bindLabel()] ? object[this.bindLabel()] : '';
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Emit selected value
|
|
139
|
+
* @param $event - Event emitted by autocomplete
|
|
140
|
+
*
|
|
141
|
+
* @author Pavan Kumar Jadda
|
|
142
|
+
* @since 13.0.3
|
|
143
|
+
*/
|
|
144
|
+
emitSelectedValue($event) {
|
|
145
|
+
this.onSelectionChange.emit($event.source.value);
|
|
146
|
+
}
|
|
147
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AutocompleteComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
148
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.0", type: AutocompleteComponent, isStandalone: true, selector: "autocomplete, lib-autocomplete", inputs: { inputFormGroup: { classPropertyName: "inputFormGroup", publicName: "inputFormGroup", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeHolder: { classPropertyName: "placeHolder", publicName: "placeHolder", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", isSignal: true, isRequired: false, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: true, isRequired: false, transformFunction: null }, displayWith: { classPropertyName: "displayWith", publicName: "displayWith", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSelectionChange: "onSelectionChange" }, viewQueries: [{ propertyName: "inputAutoComplete", first: true, predicate: ["inputAutoComplete"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [formGroup]=\"inputFormGroup\">\n\t<mat-form-field appearance=\"fill\" class=\"{{ classes() }}\">\n\t\t<mat-label>{{ label() }}</mat-label>\n\t\t<input\n\t\t\t#inputAutoComplete\n\t\t\t#trigger=\"matAutocompleteTrigger\"\n\t\t\t[matAutocomplete]=\"auto\"\n\t\t\t[placeholder]=\"placeHolder()\"\n\t\t\t[required]=\"required()\"\n\t\t\tformControlName=\"autocomplete\"\n\t\t\tmatInput\n\t\t\ttype=\"text\" />\n\n\t\t<div matSuffix style=\"display: flex\">\n\t\t\t@if (!!inputFormGroup.get('autocomplete')?.value) {\n\t\t\t\t<button (click)=\"clearInput($event)\" aria-label=\"Clear\" mat-icon-button type=\"button\">\n\t\t\t\t\t<mat-icon>clear</mat-icon>\n\t\t\t\t</button>\n\t\t\t}\n\t\t\t<button (click)=\"openOrClosePanel($event, trigger)\" aria-label=\"Clear\" mat-icon-button type=\"button\">\n\t\t\t\t<mat-icon>{{ arrowIconSubject.getValue() }}</mat-icon>\n\t\t\t</button>\n\t\t</div>\n\n\t\t<mat-autocomplete\n\t\t\t#auto=\"matAutocomplete\"\n\t\t\t(closed)=\"arrowIconSubject.next('arrow_drop_down')\"\n\t\t\t(opened)=\"arrowIconSubject.next('arrow_drop_up')\"\n\t\t\t(optionSelected)=\"arrowIconSubject.next('arrow_drop_down')\"\n\t\t\t[displayWith]=\"displayFn\">\n\t\t\t@for (option of filteredOptions | async; track option[bindValue()]) {\n\t\t\t\t<mat-option (onSelectionChange)=\"emitSelectedValue($event)\" [value]=\"option\">\n\t\t\t\t\t@if ((option | typeOf) === 'string') {\n\t\t\t\t\t\t<ng-container>{{ option }}</ng-container>\n\t\t\t\t\t} @else if ((option | typeOf) === 'object') {\n\t\t\t\t\t\t<ng-container>{{ option[bindLabel()] }}</ng-container>\n\t\t\t\t\t}\n\t\t\t\t</mat-option>\n\t\t\t}\n\t\t</mat-autocomplete>\n\t</mat-form-field>\n</div>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: TypeOfPipe, name: "typeOf" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i3.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i3.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i6.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] }); }
|
|
149
|
+
}
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
151
|
+
type: Component,
|
|
152
|
+
args: [{ selector: 'autocomplete, lib-autocomplete', standalone: true, imports: [
|
|
153
|
+
ReactiveFormsModule,
|
|
154
|
+
TypeOfPipe,
|
|
155
|
+
MatFormFieldModule,
|
|
156
|
+
MatAutocompleteModule,
|
|
157
|
+
MatInputModule,
|
|
158
|
+
MatButtonModule,
|
|
159
|
+
MatIconModule,
|
|
160
|
+
AsyncPipe,
|
|
161
|
+
], template: "<div [formGroup]=\"inputFormGroup\">\n\t<mat-form-field appearance=\"fill\" class=\"{{ classes() }}\">\n\t\t<mat-label>{{ label() }}</mat-label>\n\t\t<input\n\t\t\t#inputAutoComplete\n\t\t\t#trigger=\"matAutocompleteTrigger\"\n\t\t\t[matAutocomplete]=\"auto\"\n\t\t\t[placeholder]=\"placeHolder()\"\n\t\t\t[required]=\"required()\"\n\t\t\tformControlName=\"autocomplete\"\n\t\t\tmatInput\n\t\t\ttype=\"text\" />\n\n\t\t<div matSuffix style=\"display: flex\">\n\t\t\t@if (!!inputFormGroup.get('autocomplete')?.value) {\n\t\t\t\t<button (click)=\"clearInput($event)\" aria-label=\"Clear\" mat-icon-button type=\"button\">\n\t\t\t\t\t<mat-icon>clear</mat-icon>\n\t\t\t\t</button>\n\t\t\t}\n\t\t\t<button (click)=\"openOrClosePanel($event, trigger)\" aria-label=\"Clear\" mat-icon-button type=\"button\">\n\t\t\t\t<mat-icon>{{ arrowIconSubject.getValue() }}</mat-icon>\n\t\t\t</button>\n\t\t</div>\n\n\t\t<mat-autocomplete\n\t\t\t#auto=\"matAutocomplete\"\n\t\t\t(closed)=\"arrowIconSubject.next('arrow_drop_down')\"\n\t\t\t(opened)=\"arrowIconSubject.next('arrow_drop_up')\"\n\t\t\t(optionSelected)=\"arrowIconSubject.next('arrow_drop_down')\"\n\t\t\t[displayWith]=\"displayFn\">\n\t\t\t@for (option of filteredOptions | async; track option[bindValue()]) {\n\t\t\t\t<mat-option (onSelectionChange)=\"emitSelectedValue($event)\" [value]=\"option\">\n\t\t\t\t\t@if ((option | typeOf) === 'string') {\n\t\t\t\t\t\t<ng-container>{{ option }}</ng-container>\n\t\t\t\t\t} @else if ((option | typeOf) === 'object') {\n\t\t\t\t\t\t<ng-container>{{ option[bindLabel()] }}</ng-container>\n\t\t\t\t\t}\n\t\t\t\t</mat-option>\n\t\t\t}\n\t\t</mat-autocomplete>\n\t</mat-form-field>\n</div>\n" }]
|
|
162
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { inputAutoComplete: [{
|
|
163
|
+
type: ViewChild,
|
|
164
|
+
args: ['inputAutoComplete']
|
|
165
|
+
}], inputFormGroup: [{
|
|
166
|
+
type: Input
|
|
167
|
+
}], displayWith: [{
|
|
168
|
+
type: Input
|
|
169
|
+
}, {
|
|
170
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