@acpaas-ui/ngx-forms 4.4.0 → 4.6.3

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.
@@ -7,18 +7,18 @@
7
7
  Inputmask = Inputmask && Inputmask.hasOwnProperty('default') ? Inputmask['default'] : Inputmask;
8
8
 
9
9
  /*! *****************************************************************************
10
- Copyright (c) Microsoft Corporation. All rights reserved.
11
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
12
- this file except in compliance with the License. You may obtain a copy of the
13
- License at http://www.apache.org/licenses/LICENSE-2.0
10
+ Copyright (c) Microsoft Corporation.
14
11
 
15
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
17
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
18
- MERCHANTABLITY OR NON-INFRINGEMENT.
12
+ Permission to use, copy, modify, and/or distribute this software for any
13
+ purpose with or without fee is hereby granted.
19
14
 
20
- See the Apache Version 2.0 License for specific language governing permissions
21
- and limitations under the License.
15
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
16
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
17
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
18
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
19
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
+ PERFORMANCE OF THIS SOFTWARE.
22
22
  ***************************************************************************** */
23
23
  /* global Reflect, Promise */
24
24
 
@@ -111,8 +111,13 @@
111
111
  }
112
112
  }
113
113
 
114
+ function __createBinding(o, m, k, k2) {
115
+ if (k2 === undefined) k2 = k;
116
+ o[k2] = m[k];
117
+ }
118
+
114
119
  function __exportStar(m, exports) {
115
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
120
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
116
121
  }
117
122
 
118
123
  function __values(o) {
@@ -1017,11 +1022,11 @@
1017
1022
  * @return {?}
1018
1023
  */
1019
1024
  function (value) {
1025
+ this.selectedDate = typeof value === 'string'
1026
+ ? this.isISODateFormat(value) ? new Date(value) : jsDateUtils.DateHelper.parseDate(value, 'DD/MM/YYYY', true)
1027
+ : value;
1020
1028
  /** @type {?} */
1021
- var date = jsDateUtils.DateHelper.parseDate(value, 'DD/MM/YYYY', true);
1022
- /** @type {?} */
1023
- var dateString = date ? this.formatDate(date) : '';
1024
- this.selectedDate = date;
1029
+ var dateString = this.selectedDate ? this.formatDate(this.selectedDate) : '';
1025
1030
  this.formControl.setValue(dateString);
1026
1031
  };
1027
1032
  /**
@@ -1139,6 +1144,22 @@
1139
1144
  this.blur.emit(e);
1140
1145
  this.onTouched(e);
1141
1146
  };
1147
+ /**
1148
+ * @private
1149
+ * @param {?} value
1150
+ * @return {?}
1151
+ */
1152
+ DatepickerComponent.prototype.isISODateFormat = /**
1153
+ * @private
1154
+ * @param {?} value
1155
+ * @return {?}
1156
+ */
1157
+ function (value) {
1158
+ if (typeof value !== 'string') {
1159
+ return false;
1160
+ }
1161
+ return value.match(/\d{4}-\d{2}-\d{2}T.*/);
1162
+ };
1142
1163
  DatepickerComponent.decorators = [
1143
1164
  { type: core.Component, args: [{
1144
1165
  selector: 'aui-datepicker',
@@ -2822,8 +2843,10 @@
2822
2843
  var UploadComponent = /** @class */ (function () {
2823
2844
  function UploadComponent() {
2824
2845
  this.id = '';
2846
+ this.accept = [];
2825
2847
  this.ariaLabelRemove = 'Verwijder';
2826
2848
  this.disabled = false;
2849
+ this.multiple = true;
2827
2850
  this.options = UPLOAD_OPTIONS_DEFAULT;
2828
2851
  this.selectUploadedFiles = new core.EventEmitter();
2829
2852
  this.uploadedFiles = [];
@@ -2879,14 +2902,16 @@
2879
2902
  UploadComponent.decorators = [
2880
2903
  { type: core.Component, args: [{
2881
2904
  selector: 'aui-upload',
2882
- template: "<div class=\"m-upload aui-upload\">\n <aui-upload-zone (invalidFiles)=\"onInvalidFiles($event)\" (queuedFiles)=\"onQueuedFiles($event)\" (uploadedFiles)=\"onUploadedFiles($event)\" [ariaId]=\"ariaId\"\n [disabled]=\"disabled\" [id]=\"id\"\n [uploader]=\"uploader\">\n <div class=\"m-upload__message\">\n <ng-content select=\".m-upload__message\"></ng-content>\n </div>\n <div class=\"m-upload__description\">\n <ng-content select=\".m-upload__description\"></ng-content>\n </div>\n <div class=\"m-upload__button\">\n <ng-content select=\".m-upload__button\"></ng-content>\n </div>\n </aui-upload-zone>\n <aui-validation-list [ariaLabelRemove]=\"ariaLabelRemove\" [invalidFiles]=\"invalidFiles\"></aui-validation-list>\n <aui-upload-queue (uploadedFiles)=\"onUploadedFiles($event)\" *ngIf=\"!options?.autoUpload\" [ariaLabelRemove]=\"ariaLabelRemove\"\n [files]=\"queuedFiles\" [uploader]=\"uploader\"></aui-upload-queue>\n</div>\n",
2905
+ template: "<div class=\"m-upload aui-upload\">\n <aui-upload-zone (invalidFiles)=\"onInvalidFiles($event)\" (queuedFiles)=\"onQueuedFiles($event)\" (uploadedFiles)=\"onUploadedFiles($event)\" [ariaId]=\"ariaId\"\n [disabled]=\"disabled\" [id]=\"id\" [accept]=\"accept\" [multiple]=\"multiple\"\n [uploader]=\"uploader\">\n <div class=\"m-upload__message\">\n <ng-content select=\".m-upload__message\"></ng-content>\n </div>\n <div class=\"m-upload__description\">\n <ng-content select=\".m-upload__description\"></ng-content>\n </div>\n <div class=\"m-upload__button\">\n <ng-content select=\".m-upload__button\"></ng-content>\n </div>\n </aui-upload-zone>\n <aui-validation-list [ariaLabelRemove]=\"ariaLabelRemove\" [invalidFiles]=\"invalidFiles\"></aui-validation-list>\n <aui-upload-queue (uploadedFiles)=\"onUploadedFiles($event)\" *ngIf=\"!options?.autoUpload\" [ariaLabelRemove]=\"ariaLabelRemove\"\n [files]=\"queuedFiles\" [uploader]=\"uploader\"></aui-upload-queue>\n</div>\n",
2883
2906
  styles: [".m-upload__button>.m-upload__input{display:none}"]
2884
2907
  }] }
2885
2908
  ];
2886
2909
  UploadComponent.propDecorators = {
2887
2910
  id: [{ type: core.Input }],
2911
+ accept: [{ type: core.Input }],
2888
2912
  ariaLabelRemove: [{ type: core.Input }],
2889
2913
  disabled: [{ type: core.Input }],
2914
+ multiple: [{ type: core.Input }],
2890
2915
  options: [{ type: core.Input }],
2891
2916
  selectUploadedFiles: [{ type: core.Output }]
2892
2917
  };
@@ -2896,10 +2921,14 @@
2896
2921
  /** @type {?} */
2897
2922
  UploadComponent.prototype.id;
2898
2923
  /** @type {?} */
2924
+ UploadComponent.prototype.accept;
2925
+ /** @type {?} */
2899
2926
  UploadComponent.prototype.ariaLabelRemove;
2900
2927
  /** @type {?} */
2901
2928
  UploadComponent.prototype.disabled;
2902
2929
  /** @type {?} */
2930
+ UploadComponent.prototype.multiple;
2931
+ /** @type {?} */
2903
2932
  UploadComponent.prototype.options;
2904
2933
  /** @type {?} */
2905
2934
  UploadComponent.prototype.selectUploadedFiles;
@@ -3077,11 +3106,13 @@
3077
3106
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3078
3107
  */
3079
3108
  var UploadZoneComponent = /** @class */ (function () {
3080
- function UploadZoneComponent() {
3109
+ function UploadZoneComponent(renderer) {
3110
+ this.renderer = renderer;
3081
3111
  this.disabled = false;
3082
3112
  this.multiple = true;
3083
3113
  this.id = '';
3084
3114
  this.ariaId = '';
3115
+ this.accept = [];
3085
3116
  this.uploadedFiles = new core.EventEmitter();
3086
3117
  this.queuedFiles = new core.EventEmitter();
3087
3118
  this.invalidFiles = new core.EventEmitter();
@@ -3147,6 +3178,36 @@
3147
3178
  var files = this.fileListToArray(this.fileInput.nativeElement.files);
3148
3179
  this.handleFiles(files);
3149
3180
  };
3181
+ /**
3182
+ * @param {?} event
3183
+ * @return {?}
3184
+ */
3185
+ UploadZoneComponent.prototype.onFileClick = /**
3186
+ * @param {?} event
3187
+ * @return {?}
3188
+ */
3189
+ function (event) {
3190
+ // When removing a file make sure you can add it again later
3191
+ // See: https://stackoverflow.com/questions/59870335/ng2-file-upload-not-allowing-me-to-add-same-doc-after-ive-removed-it-from-que
3192
+ event.target.value = '';
3193
+ };
3194
+ /**
3195
+ * @return {?}
3196
+ */
3197
+ UploadZoneComponent.prototype.ngAfterViewInit = /**
3198
+ * @return {?}
3199
+ */
3200
+ function () {
3201
+ if (this.multiple !== false) {
3202
+ this.renderer.setProperty(this.fileInput.nativeElement, 'multiple', 'multiple');
3203
+ }
3204
+ if (this.accept) {
3205
+ this.renderer.setProperty(this.fileInput.nativeElement, 'accept', this.accept.join());
3206
+ }
3207
+ if (this.disabled) {
3208
+ this.renderer.setProperty(this.fileInput.nativeElement, 'disabled', 'disabled');
3209
+ }
3210
+ };
3150
3211
  /**
3151
3212
  * @protected
3152
3213
  * @param {?} files
@@ -3233,9 +3294,13 @@
3233
3294
  UploadZoneComponent.decorators = [
3234
3295
  { type: core.Component, args: [{
3235
3296
  selector: 'aui-upload-zone',
3236
- template: "<div *ngIf=\"uploader.options.type === 'drop'\" [class.is-disabled]=\"disabled\" class=\"m-upload\">\n <div class=\"m-upload__inner\">\n <div class=\"m-upload__dropzone\">\n <input #fileInput (change)=\"updateFiles()\" *ngIf=\"multiple\" [attr.aria-labelledby]=\"ariaId\" [disabled]=\"disabled\" [id]=\"id\"\n class=\"m-upload__input\" multiple type=\"file\">\n <input #fileInput (change)=\"updateFiles()\" *ngIf=\"!multiple\" [attr.aria-labelledby]=\"ariaId\" [disabled]=\"disabled\"\n [id]=\"id\" class=\"m-upload__input\" type=\"file\">\n\n <div *ngIf=\"!uploadProgress || uploadProgress === 0\" class=\"m-upload__content\">\n <p [id]=\"ariaId\" class=\"m-upload__message\">\n <ng-content select=\".m-upload__message\"></ng-content>\n </p>\n </div>\n\n <ng-container *ngIf=\"uploadProgress > 0\">\n <p class=\"m-upload__uploads u-text-bold u-margin-bottom-xs\">\n <ng-container *ngFor=\"let file of uploadingFiles; let last = last\">\n {{ file.name }}\n <ng-container *ngIf=\"!last\">,</ng-container>\n </ng-container>\n </p>\n <aui-progress-bar [value]=\"uploadProgress\" max=\"100\"></aui-progress-bar>\n </ng-container>\n </div>\n </div>\n\n <small class=\"m-upload__description\">\n <ng-content select=\".m-upload__description\"></ng-content>\n </small>\n</div>\n\n<button (click)=\"triggerFile()\" *ngIf=\"uploader.options.type === 'button'\" [disabled]=\"disabled\" class=\"a-button m-upload__button\"\n type=\"button\">\n <span [id]=\"ariaId\"><ng-content select=\".m-upload__button\"></ng-content></span>\n <input #fileInput (change)=\"updateFiles()\" [attr.aria-labelledby]=\"ariaId\" [disabled]=\"disabled\" [id]=\"id\"\n class=\"m-upload__input\" multiple=\"multiple\" type=\"file\">\n</button>\n"
3297
+ template: "<div *ngIf=\"uploader.options.type === 'drop'\" [class.is-disabled]=\"disabled\" class=\"m-upload\">\n <div class=\"m-upload__inner\">\n <div class=\"m-upload__dropzone\">\n\n <input\n #fileInput\n type=\"file\"\n class=\"m-upload__input\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"ariaId\"\n (change)=\"updateFiles()\"\n (click)=\"onFileClick($event)\">\n\n <div *ngIf=\"!uploadProgress || uploadProgress === 0\" class=\"m-upload__content\">\n <p [id]=\"ariaId\" class=\"m-upload__message\">\n <ng-content select=\".m-upload__message\"></ng-content>\n </p>\n </div>\n\n <ng-container *ngIf=\"uploadProgress > 0\">\n <p class=\"m-upload__uploads u-text-bold u-margin-bottom-xs\">\n <ng-container *ngFor=\"let file of uploadingFiles; let last = last\">\n {{ file.name }}\n <ng-container *ngIf=\"!last\">,</ng-container>\n </ng-container>\n </p>\n <aui-progress-bar [value]=\"uploadProgress\" max=\"100\"></aui-progress-bar>\n </ng-container>\n </div>\n </div>\n\n <small class=\"m-upload__description\">\n <ng-content select=\".m-upload__description\"></ng-content>\n </small>\n</div>\n\n<button (click)=\"triggerFile()\" *ngIf=\"uploader.options.type === 'button'\" [disabled]=\"disabled\" class=\"a-button m-upload__button\"\n type=\"button\">\n <span [id]=\"ariaId\"><ng-content select=\".m-upload__button\"></ng-content></span>\n <input\n #fileInput\n type=\"file\"\n class=\"m-upload__input\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"ariaId\"\n (change)=\"updateFiles()\"\n (click)=\"onFileClick($event)\">\n</button>\n"
3237
3298
  }] }
3238
3299
  ];
3300
+ /** @nocollapse */
3301
+ UploadZoneComponent.ctorParameters = function () { return [
3302
+ { type: core.Renderer2 }
3303
+ ]; };
3239
3304
  UploadZoneComponent.propDecorators = {
3240
3305
  fileInput: [{ type: core.ViewChild, args: ['fileInput', { static: false },] }],
3241
3306
  uploader: [{ type: core.Input }],
@@ -3243,6 +3308,7 @@
3243
3308
  multiple: [{ type: core.Input }],
3244
3309
  id: [{ type: core.Input }],
3245
3310
  ariaId: [{ type: core.Input }],
3311
+ accept: [{ type: core.Input }],
3246
3312
  uploadedFiles: [{ type: core.Output }],
3247
3313
  queuedFiles: [{ type: core.Output }],
3248
3314
  invalidFiles: [{ type: core.Output }],
@@ -3266,6 +3332,8 @@
3266
3332
  /** @type {?} */
3267
3333
  UploadZoneComponent.prototype.ariaId;
3268
3334
  /** @type {?} */
3335
+ UploadZoneComponent.prototype.accept;
3336
+ /** @type {?} */
3269
3337
  UploadZoneComponent.prototype.uploadedFiles;
3270
3338
  /** @type {?} */
3271
3339
  UploadZoneComponent.prototype.queuedFiles;
@@ -3279,6 +3347,11 @@
3279
3347
  UploadZoneComponent.prototype.uploadProgress;
3280
3348
  /** @type {?} */
3281
3349
  UploadZoneComponent.prototype.uploadingFiles;
3350
+ /**
3351
+ * @type {?}
3352
+ * @private
3353
+ */
3354
+ UploadZoneComponent.prototype.renderer;
3282
3355
  }
3283
3356
 
3284
3357
  /**