@klippa/ngx-enhancy-forms 7.2.1 → 7.5.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.
@@ -16,12 +16,6 @@
16
16
  function isValueSet(value) {
17
17
  return value !== null && value !== undefined;
18
18
  }
19
- function removeDuplicatesFromArray(array) {
20
- return array.filter(function (c, i) {
21
- var firstOccurrenceIndex = array.findIndex(function (c2) { return c2 === c; });
22
- return i === firstOccurrenceIndex;
23
- });
24
- }
25
19
  function stringOrArrayIsSetAndEmpty(value) {
26
20
  return value !== null && value !== undefined && value.length === 0;
27
21
  }
@@ -31,9 +25,6 @@
31
25
  }
32
26
  return s.substring(0, length) + '...';
33
27
  }
34
- function arrayIsSetAndFilled(arr) {
35
- return Array.isArray(arr) && arr !== null && arr !== undefined && arr.length > 0;
36
- }
37
28
 
38
29
  var invalidFieldsSymbol = Symbol('Not all fields are valid');
39
30
  var SubFormDirective = /** @class */ (function () {
@@ -325,152 +316,6 @@
325
316
  internalComponentRef: [{ type: core.ViewChild, args: ['internalComponentRef',] }]
326
317
  };
327
318
 
328
- /**
329
- * This component is a base in order to create a component that supports ngModel.
330
- * Some important things to know about it:
331
- *
332
- * innerValue = your own inner state, which you should use to store the current state of what ngModel should be.
333
- * writeValue() = called by angular, when ngModel is changed from OUTSIDE of the component. Feel free to patch this method if you need inner logic to happen when ngModel is altered from the outside. Always remember to also call the super.writeValue if you do!
334
- * setInnerValueAndNotify() = call this when you want your ngModel to be updated from INSIDE of your component, and provide it to the OUTSIDE.
335
- * ngOnInit() = Used to support the angular reactive forms framework. If you use ngOnInit in your own component (which happens fairly often) you must not forget to call the super.ngOnInit() method.
336
- */
337
- var ValueAccessorBase = /** @class */ (function () {
338
- function ValueAccessorBase(parent, controlContainer) {
339
- this.parent = parent;
340
- this.controlContainer = controlContainer;
341
- this.changed = new Array();
342
- this.touched = new Array();
343
- this.disabled = false;
344
- // we support both providing just the formControlName and the full formControl
345
- this.formControlName = null;
346
- this.formControl = null;
347
- this.onTouch = new core.EventEmitter();
348
- this.validators = [];
349
- }
350
- ValueAccessorBase.prototype.ngOnInit = function () {
351
- var _this = this;
352
- var _a, _b, _c, _d;
353
- if (this.formControl) {
354
- this.attachedFormControl = this.formControl;
355
- }
356
- else if (stringIsSetAndFilled(this.formControlName)) {
357
- this.attachedFormControl = (_a = this.controlContainer) === null || _a === void 0 ? void 0 : _a.control.get(this.formControlName);
358
- if (isNullOrUndefined(this.attachedFormControl)) {
359
- throw new Error("Form element '" + this.formControlName + "' with caption '" + ((_b = this.parent) === null || _b === void 0 ? void 0 : _b.caption) + "' is not declared in your FormGroup.");
360
- }
361
- }
362
- if (this.attachedFormControl) {
363
- this.disabled = this.attachedFormControl.disabled;
364
- this.attachedFormControl.statusChanges.subscribe(function () {
365
- _this.disabled = _this.attachedFormControl.disabled;
366
- });
367
- (_c = this.parent) === null || _c === void 0 ? void 0 : _c.registerControl(this.attachedFormControl, this);
368
- if ((_d = this.attachedFormControl) === null || _d === void 0 ? void 0 : _d.validator) {
369
- var vals = this.attachedFormControl.validator({});
370
- if (isValueSet(vals)) {
371
- this.validators = Object.keys(vals);
372
- }
373
- else {
374
- this.validators = [];
375
- }
376
- }
377
- }
378
- };
379
- ValueAccessorBase.prototype.isInErrorState = function () {
380
- return this.attachedFormControl && this.attachedFormControl.status === 'INVALID' && this.attachedFormControl.touched;
381
- };
382
- ValueAccessorBase.prototype.ngOnDestroy = function () {
383
- var _a;
384
- if (this.attachedFormControl) {
385
- (_a = this.parent) === null || _a === void 0 ? void 0 : _a.unregisterControl(this.attachedFormControl);
386
- }
387
- };
388
- ValueAccessorBase.prototype.touch = function () {
389
- this.touched.forEach(function (f) { return f(); });
390
- };
391
- ValueAccessorBase.prototype.writeValue = function (value) {
392
- this.innerValue = value;
393
- };
394
- ValueAccessorBase.prototype.registerOnChange = function (fn) {
395
- this.changed.push(fn);
396
- };
397
- ValueAccessorBase.prototype.registerOnTouched = function (fn) {
398
- this.touched.push(fn);
399
- };
400
- ValueAccessorBase.prototype.setInnerValueAndNotify = function (value) {
401
- this.innerValue = value;
402
- this.changed.forEach(function (fn) { return fn(value); });
403
- };
404
- ValueAccessorBase.prototype.resetToNull = function () {
405
- this.setInnerValueAndNotify(null);
406
- };
407
- ValueAccessorBase.prototype.hasValidator = function (validatorName) {
408
- if (arrayIsSetAndFilled(this.validators)) {
409
- return this.validators.includes(validatorName);
410
- }
411
- return false;
412
- };
413
- return ValueAccessorBase;
414
- }());
415
- ValueAccessorBase.decorators = [
416
- { type: core.Component, args: [{
417
- selector: '',
418
- template: ''
419
- },] }
420
- ];
421
- ValueAccessorBase.ctorParameters = function () { return [
422
- { type: FormElementComponent, decorators: [{ type: core.Host }, { type: core.Optional }] },
423
- { type: forms.ControlContainer, decorators: [{ type: core.Host }, { type: core.Optional }] }
424
- ]; };
425
- ValueAccessorBase.propDecorators = {
426
- disabled: [{ type: core.Input }],
427
- formControlName: [{ type: core.Input }],
428
- formControl: [{ type: core.Input }],
429
- onTouch: [{ type: core.Output }]
430
- };
431
-
432
- var ButtonComponent = /** @class */ (function () {
433
- function ButtonComponent() {
434
- this.variant = 'white';
435
- this.size = 'medium';
436
- this.fullWidth = false;
437
- this.hasBorder = true;
438
- this.disabled = false;
439
- this.isLoading = false;
440
- this.type = 'button';
441
- }
442
- Object.defineProperty(ButtonComponent.prototype, "_", {
443
- get: function () {
444
- return this.fullWidth;
445
- },
446
- enumerable: false,
447
- configurable: true
448
- });
449
- ButtonComponent.prototype.onClick = function (event) {
450
- if (this.disabled) {
451
- event.stopPropagation();
452
- }
453
- };
454
- return ButtonComponent;
455
- }());
456
- ButtonComponent.decorators = [
457
- { type: core.Component, args: [{
458
- selector: 'klp-form-button',
459
- template: "<button class=\"buttonFundamentals\"\n\t[ngClass]=\"[\n\t\tvariant,\n\t\tsize,\n\t\tfullWidth ? 'fullWidth' : '',\n\t\thasBorder ? '' : 'no-border',\n\t\tdisabled ? 'disabled' : ''\n\t]\"\n\t[type]=\"type\"\n\t(click)=\"onClick($event)\"\n>\n\t<div class=\"caption\" [ngClass]=\"{invisible: isLoading}\">\n\t\t<ng-content></ng-content>\n\t</div>\n\t<div class=\"loadingSpinnerContainer\" *ngIf=\"isLoading\">\n\t\t<klp-form-loading-indicator variant=\"spinner\" size=\"small\"></klp-form-loading-indicator>\n\t</div>\n</button>\n",
460
- styles: [":host{display:inline-block}:host._fullWidth{display:block}.buttonFundamentals{border:1px solid #e6ecf5;border-radius:5px;color:#888da8;cursor:pointer;font-size:13px;font-weight:700;letter-spacing:1px;padding:10px 20px}.fullWidth{width:100%}.no-border{border:none}.caption.invisible{visibility:hidden}button{position:relative}.loadingSpinnerContainer{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.small{padding-bottom:.375rem;padding-top:.375rem}.large{line-height:2}.white{background-color:#fff;border-color:#d4deee;color:#515365;font-weight:500}.white:active,.white:hover{background-color:#edf2f8;border-color:#edf2f8;color:#515365}.white:focus{text-decoration:underline}.greenFilled{background-color:#27bb5f;border-color:#27bb5f;color:#fff}.greenFilled:hover{background-color:#2bd06a;border-color:#2bd06a;color:#fff}.greenFilled:focus{text-decoration:underline}.greenFilled:active{background-color:#23a654;border-color:#23a654}.greenOutlined{background-color:#fff;border-color:#27bb5f;color:#27bb5f}.greenOutlined:hover{background-color:#2bd06a;border-color:#2bd06a;color:#fff}.greenOutlined:focus{text-decoration:underline}.greenOutlined:active{background-color:#23a654;border-color:#23a654}.greenLink{background:none;border:none;color:#27bb5f;padding:0}.greenLink:focus,.greenLink:hover{text-decoration:underline}.contextMenuItem{background-color:#fff;border-color:#fff;color:#888da8}.contextMenuItem:hover{background-color:#f6f7fb;border-color:#f6f7fb}.contextMenuItem:active,.contextMenuItem:focus{text-decoration:underline}.redFilled{background-color:#dc3545;border-color:#dc3545;color:#fff}.redFilled:hover{background-color:#e04b59;border-color:#e04b59;color:#fff}.redFilled:focus{text-decoration:underline}.redFilled:active{background-color:#d32535;border-color:#d32535}.redOutlined{background-color:#fff;border-color:#dc3545;color:#dc3545}.redOutlined:hover{background-color:#e04b59;border-color:#e04b59;color:#fff}.redOutlined:focus{text-decoration:underline}.redOutlined:active{background-color:#d32535;border-color:#d32535}.orangeFilled{background-color:#ff8000;border-color:#ff8000;color:#fff}.orangeFilled:hover{background-color:#ff8d1a;border-color:#ff8d1a;color:#fff}.orangeFilled:focus{text-decoration:underline}.orangeFilled:active{background-color:#e67300;border-color:#e67300}"]
461
- },] }
462
- ];
463
- ButtonComponent.propDecorators = {
464
- variant: [{ type: core.Input }],
465
- size: [{ type: core.Input }],
466
- fullWidth: [{ type: core.Input }],
467
- hasBorder: [{ type: core.Input }],
468
- disabled: [{ type: core.Input }],
469
- isLoading: [{ type: core.Input }],
470
- type: [{ type: core.Input }],
471
- _: [{ type: core.HostBinding, args: ['class._fullWidth',] }]
472
- };
473
-
474
319
  /*! *****************************************************************************
475
320
  Copyright (c) Microsoft Corporation.
476
321
 
@@ -789,6 +634,239 @@
789
634
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
790
635
  }
791
636
 
637
+ function removeDuplicatesFromArraysWithComparator(comparator) {
638
+ var e_1, _a;
639
+ var arrays = [];
640
+ for (var _i = 1; _i < arguments.length; _i++) {
641
+ arrays[_i - 1] = arguments[_i];
642
+ }
643
+ var combined = [];
644
+ try {
645
+ for (var arrays_1 = __values(arrays), arrays_1_1 = arrays_1.next(); !arrays_1_1.done; arrays_1_1 = arrays_1.next()) {
646
+ var array = arrays_1_1.value;
647
+ combined = combined.concat(array);
648
+ }
649
+ }
650
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
651
+ finally {
652
+ try {
653
+ if (arrays_1_1 && !arrays_1_1.done && (_a = arrays_1.return)) _a.call(arrays_1);
654
+ }
655
+ finally { if (e_1) throw e_1.error; }
656
+ }
657
+ return combined.filter(function (c, i) {
658
+ var firstOccurrenceIndex = combined.findIndex(function (c2) { return comparator(c, c2); });
659
+ return i === firstOccurrenceIndex;
660
+ });
661
+ }
662
+ function removeDuplicatesFromArray(array) {
663
+ return array.filter(function (c, i) {
664
+ var firstOccurrenceIndex = array.findIndex(function (c2) { return c2 === c; });
665
+ return i === firstOccurrenceIndex;
666
+ });
667
+ }
668
+ function insertAtIndex(arr, index, item) {
669
+ arr.splice(index, 0, item);
670
+ }
671
+ function arrayIsSetAndFilled(arr) {
672
+ return lodash.isArray(arr) && arr !== null && arr !== undefined && arr.length > 0;
673
+ }
674
+ function asArray(value) {
675
+ if (isValueSet(value)) {
676
+ if (Array.isArray(value)) {
677
+ return value;
678
+ }
679
+ return [value];
680
+ }
681
+ return [];
682
+ }
683
+ function splitArrayByCondition(value, condition) {
684
+ return value.reduce(function (acc, cur) {
685
+ if (condition(cur)) {
686
+ acc.push([]);
687
+ }
688
+ else {
689
+ acc[acc.length - 1].push(cur);
690
+ }
691
+ return acc;
692
+ }, [[]]);
693
+ }
694
+
695
+ /**
696
+ * This component is a base in order to create a component that supports ngModel.
697
+ * Some important things to know about it:
698
+ *
699
+ * innerValue = your own inner state, which you should use to store the current state of what ngModel should be.
700
+ * writeValue() = called by angular, when ngModel is changed from OUTSIDE of the component. Feel free to patch this method if you need inner logic to happen when ngModel is altered from the outside. Always remember to also call the super.writeValue if you do!
701
+ * setInnerValueAndNotify() = call this when you want your ngModel to be updated from INSIDE of your component, and provide it to the OUTSIDE.
702
+ * ngOnInit() = Used to support the angular reactive forms framework. If you use ngOnInit in your own component (which happens fairly often) you must not forget to call the super.ngOnInit() method.
703
+ */
704
+ var ValueAccessorBase = /** @class */ (function () {
705
+ function ValueAccessorBase(parent, controlContainer) {
706
+ this.parent = parent;
707
+ this.controlContainer = controlContainer;
708
+ this.changed = new Array();
709
+ this.touched = new Array();
710
+ this.prevValue = null;
711
+ this.disabled = false;
712
+ // we support both providing just the formControlName and the full formControl
713
+ this.formControlName = null;
714
+ this.formControl = null;
715
+ this.onTouch = new core.EventEmitter();
716
+ this.validators = [];
717
+ }
718
+ ValueAccessorBase.prototype.ngOnInit = function () {
719
+ var _this = this;
720
+ var _a, _b, _c, _d;
721
+ if (this.formControl) {
722
+ this.attachedFormControl = this.formControl;
723
+ }
724
+ else if (stringIsSetAndFilled(this.formControlName)) {
725
+ this.attachedFormControl = (_a = this.controlContainer) === null || _a === void 0 ? void 0 : _a.control.get(this.formControlName);
726
+ if (isNullOrUndefined(this.attachedFormControl)) {
727
+ throw new Error("Form element '" + this.formControlName + "' with caption '" + ((_b = this.parent) === null || _b === void 0 ? void 0 : _b.caption) + "' is not declared in your FormGroup.");
728
+ }
729
+ }
730
+ if (this.attachedFormControl) {
731
+ this.disabled = this.attachedFormControl.disabled;
732
+ this.attachedFormControl.statusChanges.subscribe(function () {
733
+ _this.disabled = _this.attachedFormControl.disabled;
734
+ });
735
+ (_c = this.parent) === null || _c === void 0 ? void 0 : _c.registerControl(this.attachedFormControl, this);
736
+ if ((_d = this.attachedFormControl) === null || _d === void 0 ? void 0 : _d.validator) {
737
+ var vals = this.attachedFormControl.validator({});
738
+ if (isValueSet(vals)) {
739
+ this.validators = Object.keys(vals);
740
+ }
741
+ else {
742
+ this.validators = [];
743
+ }
744
+ }
745
+ }
746
+ };
747
+ ValueAccessorBase.prototype.isInErrorState = function () {
748
+ return this.attachedFormControl && this.attachedFormControl.status === 'INVALID' && this.attachedFormControl.touched;
749
+ };
750
+ ValueAccessorBase.prototype.ngOnDestroy = function () {
751
+ var _a;
752
+ if (this.attachedFormControl) {
753
+ (_a = this.parent) === null || _a === void 0 ? void 0 : _a.unregisterControl(this.attachedFormControl);
754
+ }
755
+ };
756
+ ValueAccessorBase.prototype.touch = function () {
757
+ this.touched.forEach(function (f) { return f(); });
758
+ };
759
+ ValueAccessorBase.prototype.writeValue = function (value) {
760
+ this.innerValue = value;
761
+ this.prevValue = value;
762
+ };
763
+ ValueAccessorBase.prototype.registerOnChange = function (fn) {
764
+ this.changed.push(fn);
765
+ };
766
+ ValueAccessorBase.prototype.registerOnTouched = function (fn) {
767
+ this.touched.push(fn);
768
+ };
769
+ ValueAccessorBase.prototype.setInnerValueAndNotify = function (value) {
770
+ var _this = this;
771
+ var actuallySetValue = function (valueToSet) {
772
+ _this.innerValue = valueToSet;
773
+ _this.prevValue = valueToSet;
774
+ _this.changed.forEach(function (fn) { return fn(valueToSet); });
775
+ };
776
+ if (isValueSet(this.innerValueChangeInterceptor)) {
777
+ this.latestInnerValueChangedInterceptorPromise = this.innerValueChangeInterceptor();
778
+ var myPromise_1 = this.latestInnerValueChangedInterceptorPromise;
779
+ this.latestInnerValueChangedInterceptorPromise.then(function () {
780
+ if (_this.latestInnerValueChangedInterceptorPromise === myPromise_1) {
781
+ actuallySetValue(value);
782
+ }
783
+ else {
784
+ // ignore outdated promises
785
+ }
786
+ }).catch(function () {
787
+ if (_this.latestInnerValueChangedInterceptorPromise === myPromise_1) {
788
+ actuallySetValue(_this.prevValue);
789
+ }
790
+ else {
791
+ // ignore outdated promises
792
+ }
793
+ });
794
+ }
795
+ else {
796
+ actuallySetValue(value);
797
+ }
798
+ };
799
+ ValueAccessorBase.prototype.resetToNull = function () {
800
+ this.setInnerValueAndNotify(null);
801
+ };
802
+ ValueAccessorBase.prototype.hasValidator = function (validatorName) {
803
+ if (arrayIsSetAndFilled(this.validators)) {
804
+ return this.validators.includes(validatorName);
805
+ }
806
+ return false;
807
+ };
808
+ return ValueAccessorBase;
809
+ }());
810
+ ValueAccessorBase.decorators = [
811
+ { type: core.Component, args: [{
812
+ selector: '',
813
+ template: ''
814
+ },] }
815
+ ];
816
+ ValueAccessorBase.ctorParameters = function () { return [
817
+ { type: FormElementComponent, decorators: [{ type: core.Host }, { type: core.Optional }] },
818
+ { type: forms.ControlContainer, decorators: [{ type: core.Host }, { type: core.Optional }] }
819
+ ]; };
820
+ ValueAccessorBase.propDecorators = {
821
+ disabled: [{ type: core.Input }],
822
+ innerValueChangeInterceptor: [{ type: core.Input }],
823
+ formControlName: [{ type: core.Input }],
824
+ formControl: [{ type: core.Input }],
825
+ onTouch: [{ type: core.Output }]
826
+ };
827
+
828
+ var ButtonComponent = /** @class */ (function () {
829
+ function ButtonComponent() {
830
+ this.variant = 'white';
831
+ this.size = 'medium';
832
+ this.fullWidth = false;
833
+ this.hasBorder = true;
834
+ this.disabled = false;
835
+ this.isLoading = false;
836
+ this.type = 'button';
837
+ }
838
+ Object.defineProperty(ButtonComponent.prototype, "_", {
839
+ get: function () {
840
+ return this.fullWidth;
841
+ },
842
+ enumerable: false,
843
+ configurable: true
844
+ });
845
+ ButtonComponent.prototype.onClick = function (event) {
846
+ if (this.disabled) {
847
+ event.stopPropagation();
848
+ }
849
+ };
850
+ return ButtonComponent;
851
+ }());
852
+ ButtonComponent.decorators = [
853
+ { type: core.Component, args: [{
854
+ selector: 'klp-form-button',
855
+ template: "<button class=\"buttonFundamentals\"\n\t[ngClass]=\"[\n\t\tvariant,\n\t\tsize,\n\t\tfullWidth ? 'fullWidth' : '',\n\t\thasBorder ? '' : 'no-border',\n\t\tdisabled ? 'disabled' : ''\n\t]\"\n\t[type]=\"type\"\n\t(click)=\"onClick($event)\"\n>\n\t<div class=\"caption\" [ngClass]=\"{invisible: isLoading}\">\n\t\t<ng-content></ng-content>\n\t</div>\n\t<div class=\"loadingSpinnerContainer\" *ngIf=\"isLoading\">\n\t\t<klp-form-loading-indicator variant=\"spinner\" size=\"small\"></klp-form-loading-indicator>\n\t</div>\n</button>\n",
856
+ styles: [":host{display:inline-block}:host._fullWidth{display:block}.buttonFundamentals{border:1px solid #e6ecf5;border-radius:5px;color:#888da8;cursor:pointer;font-size:13px;font-weight:700;letter-spacing:1px;padding:10px 20px}.fullWidth{width:100%}.no-border{border:none}.caption.invisible{visibility:hidden}button{position:relative}.loadingSpinnerContainer{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.small{padding-bottom:.375rem;padding-top:.375rem}.large{line-height:2}.white{background-color:#fff;border-color:#d4deee;color:#515365;font-weight:500}.white:active,.white:hover{background-color:#edf2f8;border-color:#edf2f8;color:#515365}.white:focus{text-decoration:underline}.greenFilled{background-color:#27bb5f;border-color:#27bb5f;color:#fff}.greenFilled:hover{background-color:#2bd06a;border-color:#2bd06a;color:#fff}.greenFilled:focus{text-decoration:underline}.greenFilled:active{background-color:#23a654;border-color:#23a654}.greenOutlined{background-color:#fff;border-color:#27bb5f;color:#27bb5f}.greenOutlined:hover{background-color:#2bd06a;border-color:#2bd06a;color:#fff}.greenOutlined:focus{text-decoration:underline}.greenOutlined:active{background-color:#23a654;border-color:#23a654}.greenLink{background:none;border:none;color:#27bb5f;padding:0}.greenLink:focus,.greenLink:hover{text-decoration:underline}.contextMenuItem{background-color:#fff;border-color:#fff;color:#888da8}.contextMenuItem:hover{background-color:#f6f7fb;border-color:#f6f7fb}.contextMenuItem:active,.contextMenuItem:focus{text-decoration:underline}.redFilled{background-color:#dc3545;border-color:#dc3545;color:#fff}.redFilled:hover{background-color:#e04b59;border-color:#e04b59;color:#fff}.redFilled:focus{text-decoration:underline}.redFilled:active{background-color:#d32535;border-color:#d32535}.redOutlined{background-color:#fff;border-color:#dc3545;color:#dc3545}.redOutlined:hover{background-color:#e04b59;border-color:#e04b59;color:#fff}.redOutlined:focus{text-decoration:underline}.redOutlined:active{background-color:#d32535;border-color:#d32535}.orangeFilled{background-color:#ff8000;border-color:#ff8000;color:#fff}.orangeFilled:hover{background-color:#ff8d1a;border-color:#ff8d1a;color:#fff}.orangeFilled:focus{text-decoration:underline}.orangeFilled:active{background-color:#e67300;border-color:#e67300}"]
857
+ },] }
858
+ ];
859
+ ButtonComponent.propDecorators = {
860
+ variant: [{ type: core.Input }],
861
+ size: [{ type: core.Input }],
862
+ fullWidth: [{ type: core.Input }],
863
+ hasBorder: [{ type: core.Input }],
864
+ disabled: [{ type: core.Input }],
865
+ isLoading: [{ type: core.Input }],
866
+ type: [{ type: core.Input }],
867
+ _: [{ type: core.HostBinding, args: ['class._fullWidth',] }]
868
+ };
869
+
792
870
  var CheckboxComponent = /** @class */ (function (_super) {
793
871
  __extends(CheckboxComponent, _super);
794
872
  function CheckboxComponent() {
@@ -946,7 +1024,7 @@
946
1024
  SelectComponent.decorators = [
947
1025
  { type: core.Component, args: [{
948
1026
  selector: 'klp-form-select',
949
- template: "<ng-select\n\t#ngSelect\n\t[placeholder]=\"getTranslation('placeholder')\"\n\tbindLabel=\"name\"\n\tbindValue=\"id\"\n\t[items]=\"options\"\n\t[clearable]=\"clearable\"\n\t[(ngModel)]=\"innerValue\"\n\t[ngClass]=\"{showErrors: isInErrorState()}\"\n\t(change)=\"setInnerValueAndNotify(innerValue)\"\n\t[multiple]=\"multiple\"\n\t[disabled]=\"disabled\"\n\t(blur)=\"touch()\"\n\t(search)=\"searchQueryChanged($event.term)\"\n\t[dropdownPosition]=\"dropdownPosition\"\n\t[searchFn]=\"customSearchFn\"\n\t[selectOnTab]=\"true\"\n\t[virtualScroll]=\"true\"\n\t(scroll)=\"onScroll($event.end)\"\n>\n\t<ng-template let-item=\"item\" ng-option-tmp>\n\t\t{{ item.name }}\n\t\t<div *ngIf=\"item.description\" class=\"dropdown-item-description\">\n\t\t\t{{ item.description }}\n\t\t</div>\n\t</ng-template>\n\t<ng-container *ngIf=\"multiple && multipleDisplayedAsAmount && innerValue?.length > 1\">\n\t\t<ng-template ng-multi-label-tmp>\n\t\t\t<div class=\"ng-value\">\n\t\t\t\t<span class=\"ng-value-label\">{{getTranslation('amountSelected', innerValue?.length)}}</span>\n\t\t\t</div>\n\t\t</ng-template>\n\t</ng-container>\n\t<ng-template ng-footer-tmp *ngIf=\"footerElement\">\n\t\t<ng-container [ngTemplateOutlet]=\"footerElement\"></ng-container>\n\t</ng-template>\n</ng-select>\n",
1027
+ template: "<ng-select\n\t#ngSelect\n\t[placeholder]=\"getTranslation('placeholder')\"\n\tbindLabel=\"name\"\n\tbindValue=\"id\"\n\t[items]=\"options\"\n\t[clearable]=\"clearable\"\n\t[(ngModel)]=\"innerValue\"\n\t[ngClass]=\"{showErrors: isInErrorState()}\"\n\t(change)=\"setInnerValueAndNotify(innerValue)\"\n\t[multiple]=\"multiple\"\n\t[disabled]=\"disabled\"\n\t(blur)=\"touch()\"\n\t(search)=\"searchQueryChanged($event.term)\"\n\t[dropdownPosition]=\"dropdownPosition\"\n\t[searchFn]=\"customSearchFn\"\n\t[selectOnTab]=\"true\"\n\t[virtualScroll]=\"true\"\n\t(scroll)=\"onScroll($event.end)\"\n>\n\t<ng-template let-item=\"item\" ng-option-tmp>\n\t\t<div [attr.data-cy]=\"item.id\">\n\t\t\t{{ item.name }}\n\t\t\t<div *ngIf=\"item.description\" class=\"dropdown-item-description\">\n\t\t\t\t{{ item.description }}\n\t\t\t</div>\n\t\t</div>\n\t</ng-template>\n\t<ng-container *ngIf=\"multiple && multipleDisplayedAsAmount && innerValue?.length > 1\">\n\t\t<ng-template ng-multi-label-tmp>\n\t\t\t<div class=\"ng-value\">\n\t\t\t\t<span class=\"ng-value-label\">{{getTranslation('amountSelected', innerValue?.length)}}</span>\n\t\t\t</div>\n\t\t</ng-template>\n\t</ng-container>\n\t<ng-template ng-footer-tmp *ngIf=\"footerElement\">\n\t\t<ng-container [ngTemplateOutlet]=\"footerElement\"></ng-container>\n\t</ng-template>\n</ng-select>\n",
950
1028
  providers: [{ provide: forms.NG_VALUE_ACCESSOR, useExisting: SelectComponent, multi: true }],
951
1029
  styles: [":host{display:block}ng-select.showErrors::ng-deep .ng-select-container{border-color:#ff8000}:host ::ng-deep ng-select.ng-select .ng-select-container{color:#888da8}:host ::ng-deep .ng-select.ng-select-opened>.ng-select-container{background:#fff;border-color:#3ed778}:host ::ng-deep .ng-select.ng-select-opened>.ng-select-container:hover{box-shadow:none}:host ::ng-deep .ng-select.ng-select-opened>.ng-select-container .ng-arrow{border-color:transparent transparent #999;border-width:0 5px 5px;top:-2px}:host ::ng-deep .ng-select.ng-select-opened>.ng-select-container .ng-arrow:hover{border-color:transparent transparent #666}:host ::ng-deep .ng-select.ng-select-opened.ng-select-bottom>.ng-select-container{border-bottom-left-radius:0;border-bottom-right-radius:0}:host ::ng-deep .ng-select.ng-select-opened.ng-select-top>.ng-select-container{border-top-left-radius:0;border-top-right-radius:0}:host ::ng-deep .ng-select.ng-select-disabled>.ng-select-container{background-color:#f9f9f9}:host ::ng-deep .ng-select .ng-has-value .ng-placeholder{display:none}:host ::ng-deep .ng-select .ng-select-container{align-items:center;background-clip:padding-box;background-color:#fff;border:1px solid #e6ecf5;border-radius:4px;border-radius:2px;box-shadow:none;box-sizing:border-box;color:#888da8;display:flex;flex-direction:row;font-size:1rem;font-size:14px;line-height:1.5;margin:0;min-height:42px;outline:none;overflow:visible;padding:.375rem .75rem;transition-delay:0s;transition-duration:.2s;transition-property:all;transition-timing-function:ease-in;width:100%}:host ::ng-deep .ng-select .ng-select-container:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}:host ::ng-deep .ng-select .ng-select-container .ng-value-container{align-items:center;overflow:hidden;padding-left:10px}:host ::ng-deep .ng-select .ng-select-container .ng-value-container .ng-placeholder{color:#aaa}:host ::ng-deep .ng-select.ng-select-single .ng-select-container{height:42px}:host ::ng-deep .ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{left:0;padding-left:10px;padding-right:50px;top:5px}:host ::ng-deep .ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value{background-color:#f9f9f9;border:1px solid #e3e3e3}:host ::ng-deep .ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-label{padding:0 5px}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{background-color:#e7faee;border:1px solid #93e8b3;border-radius:2px;display:flex;font-size:.9em;margin-bottom:3px;margin-right:5px;margin-top:3px;overflow:hidden}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled{background-color:#f9f9f9;border:1px solid #e3e3e3}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-label{padding-left:5px}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-label{display:inline-block;overflow:hidden;padding:0 5px;text-overflow:ellipsis}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:inline-block;padding:0 5px}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon:hover{background-color:#93e8b3}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left{border-right:1px solid #93e8b3}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.right{border-left:1px solid #c2e0ff}:host ::ng-deep .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{padding-bottom:3px;padding-left:3px}:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{padding-bottom:3px;padding-left:3px;position:static;top:5px}:host ::ng-deep .ng-select .ng-clear-wrapper{color:#999}:host ::ng-deep .ng-select .ng-clear-wrapper .ng-clear:hover{color:#dc3545}:host ::ng-deep .ng-select .ng-spinner-zone{padding-right:5px;padding-top:5px}:host ::ng-deep .ng-select .ng-arrow-wrapper{padding-right:5px;width:25px}:host ::ng-deep .ng-select .ng-arrow-wrapper:hover .ng-arrow{border-top-color:#666}:host ::ng-deep .ng-select .ng-arrow-wrapper .ng-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px}:host ::ng-deep .ng-dropdown-panel{background-color:#fff;border:1px solid #3ed778;box-shadow:0 1px 0 rgba(0,0,0,.06)}:host ::ng-deep .ng-dropdown-panel.ng-select-bottom{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-top-color:#e6e6e6;margin-top:-1px;top:100%}:host ::ng-deep .ng-dropdown-panel.ng-select-bottom .ng-dropdown-panel-items .ng-option:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px}:host ::ng-deep .ng-dropdown-panel.ng-select-top{border-bottom-color:#e6e6e6;border-top-left-radius:4px;border-top-right-radius:4px;bottom:100%;margin-bottom:-1px}:host ::ng-deep .ng-dropdown-panel.ng-select-top .ng-dropdown-panel-items .ng-option:first-child{border-top-left-radius:4px;border-top-right-radius:4px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-header{border-bottom:1px solid #ccc;padding:5px 7px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-footer{border-top:1px solid #ccc;padding:5px 7px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items{margin-bottom:1px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;color:rgba(0,0,0,.54);cursor:default;cursor:pointer;font-weight:500;padding:8px 10px;user-select:none}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-disabled{cursor:default}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-marked{background-color:#ebf5ff}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup.ng-option-selected{background-color:#f5faff;font-weight:600}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{background-color:#fff;color:rgba(0,0,0,.87);padding:8px 10px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected{background-color:#e7faee;color:#333}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected .ng-option-label{font-weight:600}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-marked{background-color:#e7faee;color:#333}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-disabled{color:#ccc}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-child{padding-left:22px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-tag-label{font-size:80%;font-weight:400;padding-right:5px}:host ::ng-deep ng-select.ng-select .ng-select-container .ng-value-container{padding-left:0}:host ::ng-deep ng-select.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{color:#888da8;top:9px}:host ::ng-deep .ng-dropdown-panel .ng-dropdown-panel-items .ng-option,:host ::ng-deep .ng-select .ng-select-container .ng-value-container .ng-input>input{color:#888da8}:host ::ng-deep .ng-select.ng-select-auto-grow{max-width:inherit}:host ::ng-deep .ng-select.ng-select-auto-grow .ng-dropdown-panel{width:auto}"]
952
1030
  },] }
@@ -1771,6 +1849,56 @@
1771
1849
  clearable: [{ type: core.Input }]
1772
1850
  };
1773
1851
 
1852
+ var SortableGroupedItemsComponent = /** @class */ (function (_super) {
1853
+ __extends(SortableGroupedItemsComponent, _super);
1854
+ function SortableGroupedItemsComponent() {
1855
+ var _this = _super.apply(this, __spread(arguments)) || this;
1856
+ _this.reloader = true; // sortable items doesnt correctly update, so we have this boolean that flips to rerender the sortable items comp
1857
+ return _this;
1858
+ }
1859
+ SortableGroupedItemsComponent.prototype.writeValue = function (value) {
1860
+ var _this = this;
1861
+ _super.prototype.writeValue.call(this, value);
1862
+ this.reloader = false;
1863
+ setTimeout(function () {
1864
+ if (arrayIsSetAndFilled(value)) {
1865
+ _this.items = value.flatMap(function (e) { return __spread(e, ['']); });
1866
+ }
1867
+ else {
1868
+ _this.items = [];
1869
+ }
1870
+ _this.reloader = true;
1871
+ });
1872
+ };
1873
+ SortableGroupedItemsComponent.prototype.onItemsRearranged = function (value) {
1874
+ var _this = this;
1875
+ var result = splitArrayByCondition(value, function (e) { return e === ''; }).filter(arrayIsSetAndFilled);
1876
+ this.setInnerValueAndNotify(result);
1877
+ this.reloader = false;
1878
+ setTimeout(function () {
1879
+ _this.items = __spread(_this.items, ['']).filter(function (e, i) {
1880
+ if (i === 0 && e === '') {
1881
+ return false;
1882
+ }
1883
+ if (e === '' && _this.items[i - 1] === '') {
1884
+ return false;
1885
+ }
1886
+ return true;
1887
+ });
1888
+ _this.reloader = true;
1889
+ });
1890
+ };
1891
+ return SortableGroupedItemsComponent;
1892
+ }(ValueAccessorBase));
1893
+ SortableGroupedItemsComponent.decorators = [
1894
+ { type: core.Component, args: [{
1895
+ selector: 'klp-form-sortable-grouped-items',
1896
+ template: "<ng-container *ngIf=\"reloader\">\n\t<klp-form-sortable-items\n\t\t[(ngModel)]=\"items\"\n\t\t(ngModelChange)=\"onItemsRearranged($event)\"\n\t>\n\t\t<ng-template let-item=\"item\">\n\t\t\t<div>{{item}}</div>\n\t\t</ng-template>\n\t</klp-form-sortable-items>\n</ng-container>\n",
1897
+ providers: [{ provide: forms.NG_VALUE_ACCESSOR, useExisting: SortableGroupedItemsComponent, multi: true }],
1898
+ styles: [":host{display:block}"]
1899
+ },] }
1900
+ ];
1901
+
1774
1902
  var NgxEnhancyFormsModule = /** @class */ (function () {
1775
1903
  function NgxEnhancyFormsModule() {
1776
1904
  }
@@ -1799,6 +1927,7 @@
1799
1927
  SelectComponent,
1800
1928
  SelectFooterComponent,
1801
1929
  SortableItemsComponent,
1930
+ SortableGroupedItemsComponent,
1802
1931
  TextInputComponent,
1803
1932
  ToggleComponent,
1804
1933
  FileInputComponent,
@@ -1823,6 +1952,7 @@
1823
1952
  SelectComponent,
1824
1953
  SelectFooterComponent,
1825
1954
  SortableItemsComponent,
1955
+ SortableGroupedItemsComponent,
1826
1956
  TextInputComponent,
1827
1957
  ToggleComponent,
1828
1958
  FileInputComponent,
@@ -1854,6 +1984,7 @@
1854
1984
  exports.DateTimePickerComponent = DateTimePickerComponent;
1855
1985
  exports.EmailInputComponent = EmailInputComponent;
1856
1986
  exports.FORM_ERROR_MESSAGES = FORM_ERROR_MESSAGES;
1987
+ exports.FileInputComponent = FileInputComponent;
1857
1988
  exports.FormCaptionComponent = FormCaptionComponent;
1858
1989
  exports.FormComponent = FormComponent;
1859
1990
  exports.FormElementComponent = FormElementComponent;
@@ -1868,6 +1999,7 @@
1868
1999
  exports.SELECT_TRANSLATIONS = SELECT_TRANSLATIONS;
1869
2000
  exports.SelectComponent = SelectComponent;
1870
2001
  exports.SelectFooterComponent = SelectFooterComponent;
2002
+ exports.SortableGroupedItemsComponent = SortableGroupedItemsComponent;
1871
2003
  exports.SortableItemsComponent = SortableItemsComponent;
1872
2004
  exports.SubFormDirective = SubFormDirective;
1873
2005
  exports.TextInputComponent = TextInputComponent;
@@ -1878,7 +2010,6 @@
1878
2010
  exports.invalidFieldsSymbol = invalidFieldsSymbol;
1879
2011
  exports.matDateFormatsFactory = matDateFormatsFactory;
1880
2012
  exports["ɵa"] = MaterialModule;
1881
- exports["ɵb"] = FileInputComponent;
1882
2013
 
1883
2014
  Object.defineProperty(exports, '__esModule', { value: true });
1884
2015