@leanix/components 0.2.109 → 0.2.113

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.
@@ -256,7 +256,7 @@
256
256
  return CollapsibleComponent;
257
257
  }());
258
258
  CollapsibleComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0__namespace, type: CollapsibleComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
259
- CollapsibleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.4", type: CollapsibleComponent, selector: "lx-collapsible", inputs: { disableSectionToggle: "disableSectionToggle", hideSectionToggle: "hideSectionToggle", toggleSize: "toggleSize", toggleTitle: "toggleTitle", collapsed: "collapsed" }, outputs: { collapsedChange: "collapsedChange" }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.notClickable": "this.notClickable" } }, ngImport: i0__namespace, template: "<button\n *ngIf=\"!hideSectionToggle\"\n lx-button\n mode=\"link\"\n [title]=\"toggleTitle\"\n [size]=\"toggleSize\"\n class=\"sectionToggle\"\n type=\"button\"\n [attr.disabled]=\"disableSectionToggle ? true : null\"\n [square]=\"true\"\n (click)=\"onToggleSection($event)\"\n>\n <i class=\"far fa-angle-down\" [class.collapsed]=\"collapsed\"></i>\n</button>\n<div class=\"collapsible-title\">\n <ng-content></ng-content>\n</div>\n", styles: [":root{--lx-color-danger:#f96464;--lx-color-grey80:#c2c9d6;--lx-color-grey90:#e1e5eb}:host{position:relative;cursor:pointer;display:flex;border-bottom:1px solid #e1e5eb;padding-bottom:2px;margin-bottom:4px}:host.notClickable{cursor:default}.sectionToggle{font-size:16px;width:32px}.sectionToggle .fa-angle-down{transition:transform .2s linear}.sectionToggle .fa-angle-down.collapsed{transform:rotate(-90deg)}.collapsible-title{align-self:center;width:100%}:host(.align-left) .sectionToggle{text-align:left;width:24px}"], components: [{ type: ButtonComponent, selector: "button[lx-button]", inputs: ["size", "color", "mode", "pressed", "selected", "square", "circle", "disabled", "showSpinner"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
259
+ CollapsibleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.4", type: CollapsibleComponent, selector: "lx-collapsible", inputs: { disableSectionToggle: "disableSectionToggle", hideSectionToggle: "hideSectionToggle", toggleSize: "toggleSize", toggleTitle: "toggleTitle", collapsed: "collapsed" }, outputs: { collapsedChange: "collapsedChange" }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.notClickable": "this.notClickable" } }, ngImport: i0__namespace, template: "<button\n *ngIf=\"!hideSectionToggle\"\n lx-button\n mode=\"link\"\n [title]=\"toggleTitle\"\n [size]=\"toggleSize\"\n class=\"sectionToggle\"\n type=\"button\"\n [disabled]=\"disableSectionToggle\"\n [square]=\"true\"\n (click)=\"onToggleSection($event)\"\n>\n <i class=\"far fa-angle-down\" [class.collapsed]=\"collapsed\"></i>\n</button>\n<div class=\"collapsible-title\">\n <ng-content></ng-content>\n</div>\n", styles: [":root{--lx-color-danger:#f96464;--lx-color-grey80:#c2c9d6;--lx-color-grey90:#e1e5eb}:host{position:relative;cursor:pointer;display:flex;border-bottom:1px solid #e1e5eb;padding-bottom:2px;margin-bottom:4px}:host.notClickable{cursor:default}.sectionToggle{font-size:16px;width:32px}.sectionToggle .fa-angle-down{transition:transform .2s linear}.sectionToggle .fa-angle-down.collapsed{transform:rotate(-90deg)}.collapsible-title{align-self:center;width:100%}:host(.align-left) .sectionToggle{text-align:left;width:24px}"], components: [{ type: ButtonComponent, selector: "button[lx-button]", inputs: ["size", "color", "mode", "pressed", "selected", "square", "circle", "disabled", "showSpinner"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
260
260
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0__namespace, type: CollapsibleComponent, decorators: [{
261
261
  type: i0.Component,
262
262
  args: [{
@@ -3607,6 +3607,36 @@
3607
3607
  args: ['itemTemplate']
3608
3608
  }] } });
3609
3609
 
3610
+ var ErrorMessageComponent = /** @class */ (function () {
3611
+ function ErrorMessageComponent(cd) {
3612
+ this.cd = cd;
3613
+ }
3614
+ Object.defineProperty(ErrorMessageComponent.prototype, "key", {
3615
+ set: function (value) {
3616
+ if (value !== this._key) {
3617
+ this._key = value;
3618
+ this.cd.detectChanges();
3619
+ }
3620
+ },
3621
+ enumerable: false,
3622
+ configurable: true
3623
+ });
3624
+ return ErrorMessageComponent;
3625
+ }());
3626
+ ErrorMessageComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0__namespace, type: ErrorMessageComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
3627
+ ErrorMessageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.4", type: ErrorMessageComponent, selector: "lx-error-message", inputs: { key: "key" }, ngImport: i0__namespace, template: "<div class=\"error\" *ngIf=\"_key\">{{ _key | translate }}</div>", isInline: true, styles: [".error{color:#f96464;padding:4px}"], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1__namespace$2.TranslatePipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
3628
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0__namespace, type: ErrorMessageComponent, decorators: [{
3629
+ type: i0.Component,
3630
+ args: [{
3631
+ selector: 'lx-error-message',
3632
+ template: "<div class=\"error\" *ngIf=\"_key\">{{ _key | translate }}</div>",
3633
+ styleUrls: ['./error-message.component.scss'],
3634
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
3635
+ }]
3636
+ }], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { key: [{
3637
+ type: i0.Input
3638
+ }] } });
3639
+
3610
3640
  var FormErrorComponent = /** @class */ (function () {
3611
3641
  function FormErrorComponent() {
3612
3642
  this.translationKeys = [];
@@ -5609,6 +5639,153 @@
5609
5639
  type: i0.Output
5610
5640
  }] } });
5611
5641
 
5642
+ var FormSubmitDirective = /** @class */ (function () {
5643
+ function FormSubmitDirective(elementRef) {
5644
+ var _this = this;
5645
+ this.elementRef = elementRef;
5646
+ this.submitted$ = new i6.BehaviorSubject(false);
5647
+ this.subscription = i6.fromEvent(this.elementRef.nativeElement, 'submit')
5648
+ .pipe(operators.take(1))
5649
+ .subscribe(function () { return _this.submitted$.next(true); });
5650
+ }
5651
+ FormSubmitDirective.prototype.ngOnDestroy = function () {
5652
+ if (this.subscription) {
5653
+ this.subscription.unsubscribe();
5654
+ }
5655
+ };
5656
+ return FormSubmitDirective;
5657
+ }());
5658
+ FormSubmitDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0__namespace, type: FormSubmitDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
5659
+ FormSubmitDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.4", type: FormSubmitDirective, selector: "[lxFormSubmit]", ngImport: i0__namespace });
5660
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0__namespace, type: FormSubmitDirective, decorators: [{
5661
+ type: i0.Directive,
5662
+ args: [{
5663
+ selector: '[lxFormSubmit]'
5664
+ }]
5665
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; } });
5666
+
5667
+ var FORM_CONTROL_ERROR_NAMESPACE = new i0.InjectionToken('FORM_CONTROL_ERROR_NAMESPACE');
5668
+ var FORM_CONTROL_ERROR_DISPLAY_STRATEGY = new i0.InjectionToken('FORM_CONTROL_ERROR_DISPLAY_STRATEGY');
5669
+ var provideFormControlErrorNamespace = function (namespace) { return ({
5670
+ provide: FORM_CONTROL_ERROR_NAMESPACE,
5671
+ useValue: namespace
5672
+ }); };
5673
+ var provideFormControlErrorDisplayStrategy = function (fn) { return ({
5674
+ provide: FORM_CONTROL_ERROR_DISPLAY_STRATEGY,
5675
+ useValue: fn
5676
+ }); };
5677
+ var FormErrorDirective = /** @class */ (function () {
5678
+ function FormErrorDirective(viewContainer, componentFactoryResolver, ngControl, formSubmitDirective, namespace, strategy) {
5679
+ this.viewContainer = viewContainer;
5680
+ this.componentFactoryResolver = componentFactoryResolver;
5681
+ this.ngControl = ngControl;
5682
+ this.formSubmitDirective = formSubmitDirective;
5683
+ this.namespace = namespace;
5684
+ this.strategy = strategy;
5685
+ }
5686
+ Object.defineProperty(FormErrorDirective.prototype, "control", {
5687
+ get: function () {
5688
+ var _a;
5689
+ return ((_a = this.ngControl) === null || _a === void 0 ? void 0 : _a.control) || this.ctrl;
5690
+ },
5691
+ enumerable: false,
5692
+ configurable: true
5693
+ });
5694
+ Object.defineProperty(FormErrorDirective.prototype, "name", {
5695
+ get: function () {
5696
+ var _a;
5697
+ return ((_a = this.ngControl) === null || _a === void 0 ? void 0 : _a.name) || this.controlName;
5698
+ },
5699
+ enumerable: false,
5700
+ configurable: true
5701
+ });
5702
+ Object.defineProperty(FormErrorDirective.prototype, "formSubmitted", {
5703
+ get: function () {
5704
+ return this.formSubmitDirective ? this.formSubmitDirective.submitted$ : i6.of(undefined);
5705
+ },
5706
+ enumerable: false,
5707
+ configurable: true
5708
+ });
5709
+ FormErrorDirective.prototype.ngOnInit = function () {
5710
+ var _this = this;
5711
+ var control = this.control;
5712
+ if (isAbstractControl(control)) {
5713
+ this.subscritpion = i6.combineLatest([control.valueChanges.pipe(operators.startWith(control.value)), this.formSubmitted])
5714
+ .pipe(operators.map(function (_b) {
5715
+ var _c = __read(_b, 2), submitted = _c[1];
5716
+ return submitted;
5717
+ }), operators.map(resolveStrategy(this.strategy, control)))
5718
+ .subscribe(function (display) {
5719
+ var errors = control.errors;
5720
+ if (errors && display) {
5721
+ var firstErrorKey = Object.keys(errors)[0];
5722
+ var translationKey = _this.buildTranslationKey(firstErrorKey);
5723
+ _this.setError(translationKey);
5724
+ }
5725
+ else if (_this.ref) {
5726
+ _this.setError();
5727
+ }
5728
+ });
5729
+ }
5730
+ };
5731
+ FormErrorDirective.prototype.buildTranslationKey = function (errorKey) {
5732
+ if (this.control) {
5733
+ return (this.namespace || 'form') + ".errors." + (this.name ? this.name + "." : '') + errorKey;
5734
+ }
5735
+ else {
5736
+ return '';
5737
+ }
5738
+ };
5739
+ FormErrorDirective.prototype.setError = function (key) {
5740
+ if (!this.ref) {
5741
+ var factory = this.componentFactoryResolver.resolveComponentFactory(ErrorMessageComponent);
5742
+ this.ref = this.viewContainer.createComponent(factory);
5743
+ }
5744
+ this.ref.instance.key = key;
5745
+ };
5746
+ FormErrorDirective.prototype.ngOnDestroy = function () {
5747
+ if (this.subscritpion) {
5748
+ this.subscritpion.unsubscribe();
5749
+ }
5750
+ };
5751
+ return FormErrorDirective;
5752
+ }());
5753
+ FormErrorDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0__namespace, type: FormErrorDirective, deps: [{ token: i0__namespace.ViewContainerRef }, { token: i0__namespace.ComponentFactoryResolver }, { token: i3__namespace$1.NgControl, optional: true, self: true }, { token: FormSubmitDirective, host: true, optional: true }, { token: FORM_CONTROL_ERROR_NAMESPACE, optional: true }, { token: FORM_CONTROL_ERROR_DISPLAY_STRATEGY, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
5754
+ FormErrorDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.4", type: FormErrorDirective, selector: "[lxFormError]", inputs: { ctrl: ["lxFormError", "ctrl"], controlName: "controlName" }, ngImport: i0__namespace });
5755
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0__namespace, type: FormErrorDirective, decorators: [{
5756
+ type: i0.Directive,
5757
+ args: [{
5758
+ selector: '[lxFormError]'
5759
+ }]
5760
+ }], ctorParameters: function () {
5761
+ return [{ type: i0__namespace.ViewContainerRef }, { type: i0__namespace.ComponentFactoryResolver }, { type: i3__namespace$1.NgControl, decorators: [{
5762
+ type: i0.Optional
5763
+ }, {
5764
+ type: i0.Self
5765
+ }] }, { type: FormSubmitDirective, decorators: [{
5766
+ type: i0.Optional
5767
+ }, {
5768
+ type: i0.Host
5769
+ }] }, { type: undefined, decorators: [{
5770
+ type: i0.Optional
5771
+ }, {
5772
+ type: i0.Inject,
5773
+ args: [FORM_CONTROL_ERROR_NAMESPACE]
5774
+ }] }, { type: undefined, decorators: [{
5775
+ type: i0.Optional
5776
+ }, {
5777
+ type: i0.Inject,
5778
+ args: [FORM_CONTROL_ERROR_DISPLAY_STRATEGY]
5779
+ }] }];
5780
+ }, propDecorators: { ctrl: [{
5781
+ type: i0.Input,
5782
+ args: ['lxFormError']
5783
+ }], controlName: [{
5784
+ type: i0.Input
5785
+ }] } });
5786
+ var isAbstractControl = function (ctrl) { return !!ctrl; };
5787
+ var resolveStrategy = _.curry(function (strategy, control, submitted) { return strategy ? strategy({ control: control, submitted: submitted }) : true; });
5788
+
5612
5789
  var FilterSelectionPipe = /** @class */ (function () {
5613
5790
  function FilterSelectionPipe() {
5614
5791
  }
@@ -5770,7 +5947,10 @@
5770
5947
  SortingDropdownComponent,
5771
5948
  SortingDropdownTriggerComponent,
5772
5949
  InputComponent,
5773
- FormatNumberPipe], imports: [i2.CommonModule,
5950
+ FormatNumberPipe,
5951
+ FormErrorDirective,
5952
+ ErrorMessageComponent,
5953
+ FormSubmitDirective], imports: [i2.CommonModule,
5774
5954
  i3$3.DragDropModule,
5775
5955
  i3$2.FormsModule,
5776
5956
  i3$2.ReactiveFormsModule, i1__namespace$2.TranslateModule, i1$3.DatepickerModule,
@@ -5810,7 +5990,10 @@
5810
5990
  SliderToggleComponent,
5811
5991
  SortingDropdownComponent,
5812
5992
  SortingDropdownTriggerComponent,
5813
- FormatNumberPipe] });
5993
+ FormatNumberPipe,
5994
+ FormErrorDirective,
5995
+ FormSubmitDirective,
5996
+ ErrorMessageComponent] });
5814
5997
  LxFormsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0__namespace, type: LxFormsModule, imports: [[
5815
5998
  i2.CommonModule,
5816
5999
  i3$3.DragDropModule,
@@ -5861,7 +6044,10 @@
5861
6044
  SortingDropdownComponent,
5862
6045
  SortingDropdownTriggerComponent,
5863
6046
  InputComponent,
5864
- FormatNumberPipe
6047
+ FormatNumberPipe,
6048
+ FormErrorDirective,
6049
+ ErrorMessageComponent,
6050
+ FormSubmitDirective
5865
6051
  ],
5866
6052
  imports: [
5867
6053
  i2.CommonModule,
@@ -5909,7 +6095,10 @@
5909
6095
  SliderToggleComponent,
5910
6096
  SortingDropdownComponent,
5911
6097
  SortingDropdownTriggerComponent,
5912
- FormatNumberPipe
6098
+ FormatNumberPipe,
6099
+ FormErrorDirective,
6100
+ FormSubmitDirective,
6101
+ ErrorMessageComponent
5913
6102
  ]
5914
6103
  }]
5915
6104
  }] });
@@ -6804,9 +6993,14 @@
6804
6993
  exports.ENTER = ENTER;
6805
6994
  exports.ESCAPE = ESCAPE;
6806
6995
  exports.EllipsisComponent = EllipsisComponent;
6996
+ exports.ErrorMessageComponent = ErrorMessageComponent;
6997
+ exports.FORM_CONTROL_ERROR_DISPLAY_STRATEGY = FORM_CONTROL_ERROR_DISPLAY_STRATEGY;
6998
+ exports.FORM_CONTROL_ERROR_NAMESPACE = FORM_CONTROL_ERROR_NAMESPACE;
6807
6999
  exports.FilterSelectionPipe = FilterSelectionPipe;
6808
7000
  exports.FilterTermPipe = FilterTermPipe;
6809
7001
  exports.FormErrorComponent = FormErrorComponent;
7002
+ exports.FormErrorDirective = FormErrorDirective;
7003
+ exports.FormSubmitDirective = FormSubmitDirective;
6810
7004
  exports.FormatNumberPipe = FormatNumberPipe;
6811
7005
  exports.GLOBAL_TRANSLATION_OPTIONS = GLOBAL_TRANSLATION_OPTIONS;
6812
7006
  exports.HighlightRangePipe = HighlightRangePipe;
@@ -6879,6 +7073,8 @@
6879
7073
  exports.isValidHexColor = isValidHexColor;
6880
7074
  exports.isValidX = isValidX;
6881
7075
  exports.isValidY = isValidY;
7076
+ exports.provideFormControlErrorDisplayStrategy = provideFormControlErrorDisplayStrategy;
7077
+ exports.provideFormControlErrorNamespace = provideFormControlErrorNamespace;
6882
7078
  exports.shorthandHexHandle = shorthandHexHandle;
6883
7079
 
6884
7080
  Object.defineProperty(exports, '__esModule', { value: true });