@corp-products/ui-components 2.0.9 → 3.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/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, TemplateRef, OnInit, OnDestroy, PipeTransform, Type, EnvironmentInjector, ApplicationRef } from '@angular/core';
2
+ import { EventEmitter, TemplateRef, OnInit, PipeTransform, OnDestroy, Type, EnvironmentInjector, ApplicationRef } from '@angular/core';
3
3
  import { ActivatedRoute, Router, Params } from '@angular/router';
4
4
  import { DialogService, DynamicDialogConfig } from 'primeng/dynamicdialog';
5
- import { FormControl, FormGroup, ValidationErrors, AbstractControl } from '@angular/forms';
5
+ import { FormGroup, FormControl, ValidationErrors, AbstractControl } from '@angular/forms';
6
+ import { AutoCompleteSelectEvent, AutoCompleteCompleteEvent } from 'primeng/autocomplete';
6
7
  import * as rxjs from 'rxjs';
7
8
  import { Subject } from 'rxjs';
8
- import { SelectChangeEvent } from 'primeng/select';
9
- import { AutoCompleteSelectEvent, AutoCompleteCompleteEvent } from 'primeng/autocomplete';
10
9
  import { SelectButtonChangeEvent } from 'primeng/selectbutton';
10
+ import { SelectChangeEvent } from 'primeng/select';
11
11
  import { MenuItem } from 'primeng/api';
12
12
 
13
13
  type AppButtonSeverity = 'success' | 'info' | 'warn' | 'danger' | 'help' | 'primary' | 'secondary' | 'contrast';
@@ -131,6 +131,53 @@ declare class UserInfoComponent {
131
131
  static ɵcmp: i0.ɵɵComponentDeclaration<UserInfoComponent, "user-info", never, { "profileImage": { "alias": "profileImage"; "required": false; }; "name": { "alias": "name"; "required": false; }; }, {}, never, never, true, never>;
132
132
  }
133
133
 
134
+ declare class FormUtils {
135
+ static getFormControl(controlName: string, form: FormGroup): FormControl;
136
+ }
137
+
138
+ declare enum BasicErrorKeysEnum {
139
+ required = "REQUIRED",
140
+ email = "EMAIL",
141
+ pattern = "PATTERN",
142
+ invalidArFormat = "INVALID_AR_FORMAT",
143
+ invalidLink = "INVALID_LINK",
144
+ endDateBeforeStartDate = "END_DATE_BEFORE_START_DATE",
145
+ startDateEqualsEndDate = "START_DATE_EQUALS_END_DATE",
146
+ endTimeBeforeStartTime = "END_TIME_BEFORE_START_TIME",
147
+ startTimeEqualsEndTime = "START_TIME_EQUALS_END_TIME",
148
+ integer = "INTEGER",
149
+ positiveNumber = "POSITIVE_NUMBER",
150
+ fileSelected = "FILE_SELECTED",
151
+ default = "DEFAULT"
152
+ }
153
+ declare enum ErrorsWithValuesKeysEnum {
154
+ minlength = "MIN_LENGTH",
155
+ maxlength = "MAX_LENGTH",
156
+ min = "MIN",
157
+ max = "MAX",
158
+ maxSize = "MAX_SIZE",
159
+ maxFiles = "MAX_FILES",
160
+ allowedTypes = "ALLOWED_TYPES"
161
+ }
162
+
163
+ declare class ValidationErrorsPipe implements PipeTransform {
164
+ private formValidationService;
165
+ transform(errors: ValidationErrors | null, allowedKeys?: string[]): string[];
166
+ static ɵfac: i0.ɵɵFactoryDeclaration<ValidationErrorsPipe, never>;
167
+ static ɵpipe: i0.ɵɵPipeDeclaration<ValidationErrorsPipe, "validationErrors", true>;
168
+ }
169
+
170
+ declare class FormValidationService {
171
+ private translate;
172
+ private getTranslation;
173
+ getErrorMessage(errorKey: string, errorValue: any): string;
174
+ private isBasicErrorKey;
175
+ private isErrorWithValueKey;
176
+ private getErrorWithValueMessage;
177
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormValidationService, never>;
178
+ static ɵprov: i0.ɵɵInjectableDeclaration<FormValidationService>;
179
+ }
180
+
134
181
  declare abstract class BaseInputComponent implements OnInit, OnDestroy {
135
182
  control: FormControl;
136
183
  name: string;
@@ -149,41 +196,19 @@ declare abstract class BaseInputComponent implements OnInit, OnDestroy {
149
196
  static ɵcmp: i0.ɵɵComponentDeclaration<BaseInputComponent, "ng-component", never, { "control": { "alias": "control"; "required": true; }; "name": { "alias": "name"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "inputId": { "alias": "inputId"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; }, {}, never, never, true, never>;
150
197
  }
151
198
 
152
- declare class InputComponent extends BaseInputComponent {
153
- type: 'text' | 'textarea' | 'text-floating';
154
- contentType: 'text' | 'email' | 'number';
155
- prefix: string;
156
- rows: number;
157
- cols: number;
158
- autoResize: boolean;
159
- basicInput: boolean;
160
- noStyle: boolean;
161
- hideOptionalLabel: boolean;
162
- inputDirection: 'ltr' | 'rtl' | 'inherit';
163
- variant: 'in' | 'over' | 'on';
164
- constructor();
165
- static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, never>;
166
- static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "stc-input", never, { "type": { "alias": "type"; "required": false; }; "contentType": { "alias": "contentType"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "autoResize": { "alias": "autoResize"; "required": false; }; "basicInput": { "alias": "basicInput"; "required": false; }; "noStyle": { "alias": "noStyle"; "required": false; }; "hideOptionalLabel": { "alias": "hideOptionalLabel"; "required": false; }; "inputDirection": { "alias": "inputDirection"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; }, {}, never, never, true, never>;
167
- }
168
-
169
- declare class SelectComponent extends BaseInputComponent {
199
+ declare class AutoCompleteComponent extends BaseInputComponent {
170
200
  selectedItemTemplate: TemplateRef<unknown> | null;
171
- optionTemplate: TemplateRef<unknown> | null;
172
- options: unknown[];
173
- optionLabel: string;
174
- checkmark: boolean;
175
- showClear: boolean;
176
- editable: boolean;
177
- filter: boolean;
178
- multiple: boolean;
179
- filterBy: string;
180
- selectedItemsLabel: string;
201
+ onSearch: EventEmitter<string>;
202
+ selectOption: EventEmitter<AutoCompleteSelectEvent>;
203
+ items: any[];
204
+ minLengthToSearch: number;
205
+ delay: number;
181
206
  basicInput: boolean;
182
- change: EventEmitter<any>;
183
207
  constructor();
184
- onChange(e: SelectChangeEvent): void;
185
- static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent, never>;
186
- static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "stc-select", never, { "selectedItemTemplate": { "alias": "selectedItemTemplate"; "required": false; }; "optionTemplate": { "alias": "optionTemplate"; "required": false; }; "options": { "alias": "options"; "required": false; }; "optionLabel": { "alias": "optionLabel"; "required": false; }; "checkmark": { "alias": "checkmark"; "required": false; }; "showClear": { "alias": "showClear"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; "filter": { "alias": "filter"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "filterBy": { "alias": "filterBy"; "required": false; }; "selectedItemsLabel": { "alias": "selectedItemsLabel"; "required": false; }; "basicInput": { "alias": "basicInput"; "required": false; }; }, { "change": "change"; }, never, never, true, never>;
208
+ search(event: AutoCompleteCompleteEvent): void;
209
+ onSelect(event: AutoCompleteSelectEvent): void;
210
+ static ɵfac: i0.ɵɵFactoryDeclaration<AutoCompleteComponent, never>;
211
+ static ɵcmp: i0.ɵɵComponentDeclaration<AutoCompleteComponent, "stc-auto-complete", never, { "selectedItemTemplate": { "alias": "selectedItemTemplate"; "required": false; }; "items": { "alias": "items"; "required": false; }; "minLengthToSearch": { "alias": "minLengthToSearch"; "required": false; }; "delay": { "alias": "delay"; "required": false; }; "basicInput": { "alias": "basicInput"; "required": false; }; }, { "onSearch": "onSearch"; "selectOption": "selectOption"; }, never, never, true, never>;
187
212
  }
188
213
 
189
214
  declare class DatePickerComponent extends BaseInputComponent {
@@ -197,27 +222,30 @@ declare class DatePickerComponent extends BaseInputComponent {
197
222
  nowTime: Date;
198
223
  selectionMode: 'single' | 'range';
199
224
  onAfterClearDate: EventEmitter<void>;
225
+ variant: 'in' | 'over' | 'on';
200
226
  constructor();
201
227
  selectCurrentTime(e: any): void;
202
228
  clearButtonClick(e: any): void;
203
229
  afterClearDate(): void;
204
230
  static ɵfac: i0.ɵɵFactoryDeclaration<DatePickerComponent, never>;
205
- static ɵcmp: i0.ɵɵComponentDeclaration<DatePickerComponent, "stc-date-picker", never, { "showIcon": { "alias": "showIcon"; "required": false; }; "showClear": { "alias": "showClear"; "required": false; }; "basicInput": { "alias": "basicInput"; "required": false; }; "isTimeOnly": { "alias": "isTimeOnly"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "hourFormat": { "alias": "hourFormat"; "required": false; }; "selectionMode": { "alias": "selectionMode"; "required": false; }; }, { "onAfterClearDate": "onAfterClearDate"; }, never, never, true, never>;
231
+ static ɵcmp: i0.ɵɵComponentDeclaration<DatePickerComponent, "stc-date-picker", never, { "showIcon": { "alias": "showIcon"; "required": false; }; "showClear": { "alias": "showClear"; "required": false; }; "basicInput": { "alias": "basicInput"; "required": false; }; "isTimeOnly": { "alias": "isTimeOnly"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "hourFormat": { "alias": "hourFormat"; "required": false; }; "selectionMode": { "alias": "selectionMode"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; }, { "onAfterClearDate": "onAfterClearDate"; }, never, never, true, never>;
206
232
  }
207
233
 
208
- declare class AutoCompleteComponent extends BaseInputComponent {
209
- selectedItemTemplate: TemplateRef<unknown> | null;
210
- onSearch: EventEmitter<string>;
211
- selectOption: EventEmitter<AutoCompleteSelectEvent>;
212
- items: any[];
213
- minLengthToSearch: number;
214
- delay: number;
234
+ declare class InputComponent extends BaseInputComponent {
235
+ type: 'text' | 'textarea';
236
+ contentType: 'text' | 'email' | 'number';
237
+ prefix: string;
238
+ rows: number;
239
+ cols: number;
240
+ autoResize: boolean;
215
241
  basicInput: boolean;
242
+ noStyle: boolean;
243
+ hideOptionalLabel: boolean;
244
+ inputDirection: 'ltr' | 'rtl' | 'inherit';
245
+ variant: 'in' | 'over' | 'on';
216
246
  constructor();
217
- search(event: AutoCompleteCompleteEvent): void;
218
- onSelect(event: AutoCompleteSelectEvent): void;
219
- static ɵfac: i0.ɵɵFactoryDeclaration<AutoCompleteComponent, never>;
220
- static ɵcmp: i0.ɵɵComponentDeclaration<AutoCompleteComponent, "stc-auto-complete", never, { "selectedItemTemplate": { "alias": "selectedItemTemplate"; "required": false; }; "items": { "alias": "items"; "required": false; }; "minLengthToSearch": { "alias": "minLengthToSearch"; "required": false; }; "delay": { "alias": "delay"; "required": false; }; "basicInput": { "alias": "basicInput"; "required": false; }; }, { "onSearch": "onSearch"; "selectOption": "selectOption"; }, never, never, true, never>;
247
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, never>;
248
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "stc-input", never, { "type": { "alias": "type"; "required": false; }; "contentType": { "alias": "contentType"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "autoResize": { "alias": "autoResize"; "required": false; }; "basicInput": { "alias": "basicInput"; "required": false; }; "noStyle": { "alias": "noStyle"; "required": false; }; "hideOptionalLabel": { "alias": "hideOptionalLabel"; "required": false; }; "inputDirection": { "alias": "inputDirection"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; }, {}, never, never, true, never>;
221
249
  }
222
250
 
223
251
  interface LabelValue<T> {
@@ -234,6 +262,27 @@ declare class SelectButtonComponent extends BaseInputComponent {
234
262
  static ɵcmp: i0.ɵɵComponentDeclaration<SelectButtonComponent, "stc-select-button", never, { "options": { "alias": "options"; "required": false; }; "title": { "alias": "title"; "required": false; }; }, { "onChange": "onChange"; }, never, never, true, never>;
235
263
  }
236
264
 
265
+ declare class SelectComponent extends BaseInputComponent {
266
+ selectedItemTemplate: TemplateRef<unknown> | null;
267
+ optionTemplate: TemplateRef<unknown> | null;
268
+ options: unknown[];
269
+ optionLabel: string;
270
+ checkmark: boolean;
271
+ showClear: boolean;
272
+ editable: boolean;
273
+ filter: boolean;
274
+ multiple: boolean;
275
+ filterBy: string;
276
+ selectedItemsLabel: string;
277
+ basicInput: boolean;
278
+ variant: 'in' | 'over' | 'on';
279
+ change: EventEmitter<any>;
280
+ constructor();
281
+ onChange(e: SelectChangeEvent): void;
282
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent, never>;
283
+ static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "stc-select", never, { "selectedItemTemplate": { "alias": "selectedItemTemplate"; "required": false; }; "optionTemplate": { "alias": "optionTemplate"; "required": false; }; "options": { "alias": "options"; "required": false; }; "optionLabel": { "alias": "optionLabel"; "required": false; }; "checkmark": { "alias": "checkmark"; "required": false; }; "showClear": { "alias": "showClear"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; "filter": { "alias": "filter"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "filterBy": { "alias": "filterBy"; "required": false; }; "selectedItemsLabel": { "alias": "selectedItemsLabel"; "required": false; }; "basicInput": { "alias": "basicInput"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; }, { "change": "change"; }, never, never, true, never>;
284
+ }
285
+
237
286
  declare class SwitchComponent {
238
287
  label: string;
239
288
  key: string;
@@ -244,53 +293,6 @@ declare class SwitchComponent {
244
293
  static ɵcmp: i0.ɵɵComponentDeclaration<SwitchComponent, "stc-switch", never, { "label": { "alias": "label"; "required": false; }; "key": { "alias": "key"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; }, { "onChange": "onChange"; }, never, never, true, never>;
245
294
  }
246
295
 
247
- declare class FormUtils {
248
- static getFormControl(controlName: string, form: FormGroup): FormControl;
249
- }
250
-
251
- declare enum BasicErrorKeysEnum {
252
- required = "REQUIRED",
253
- email = "EMAIL",
254
- pattern = "PATTERN",
255
- invalidArFormat = "INVALID_AR_FORMAT",
256
- invalidLink = "INVALID_LINK",
257
- endDateBeforeStartDate = "END_DATE_BEFORE_START_DATE",
258
- startDateEqualsEndDate = "START_DATE_EQUALS_END_DATE",
259
- endTimeBeforeStartTime = "END_TIME_BEFORE_START_TIME",
260
- startTimeEqualsEndTime = "START_TIME_EQUALS_END_TIME",
261
- integer = "INTEGER",
262
- positiveNumber = "POSITIVE_NUMBER",
263
- fileSelected = "FILE_SELECTED",
264
- default = "DEFAULT"
265
- }
266
- declare enum ErrorsWithValuesKeysEnum {
267
- minlength = "MIN_LENGTH",
268
- maxlength = "MAX_LENGTH",
269
- min = "MIN",
270
- max = "MAX",
271
- maxSize = "MAX_SIZE",
272
- maxFiles = "MAX_FILES",
273
- allowedTypes = "ALLOWED_TYPES"
274
- }
275
-
276
- declare class ValidationErrorsPipe implements PipeTransform {
277
- private formValidationService;
278
- transform(errors: ValidationErrors | null, allowedKeys?: string[]): string[];
279
- static ɵfac: i0.ɵɵFactoryDeclaration<ValidationErrorsPipe, never>;
280
- static ɵpipe: i0.ɵɵPipeDeclaration<ValidationErrorsPipe, "validationErrors", true>;
281
- }
282
-
283
- declare class FormValidationService {
284
- private translate;
285
- private getTranslation;
286
- getErrorMessage(errorKey: string, errorValue: any): string;
287
- private isBasicErrorKey;
288
- private isErrorWithValueKey;
289
- private getErrorWithValueMessage;
290
- static ɵfac: i0.ɵɵFactoryDeclaration<FormValidationService, never>;
291
- static ɵprov: i0.ɵɵInjectableDeclaration<FormValidationService>;
292
- }
293
-
294
296
  type InputType = "text" | "textarea";
295
297
  type InputContentType = "text" | "email" | "password" | "number";
296
298
  interface Dropdown<T = unknown> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corp-products/ui-components",
3
- "version": "2.0.9",
3
+ "version": "3.0.0",
4
4
  "author": "shireen Omar",
5
5
  "description": "shared UI components across our apps",
6
6
  "peerDependencies": {