@leanix/components 0.2.112 → 0.2.116
Sign up to get free protection for your applications and to get access to all the features.
- package/bundles/leanix-components.umd.js +53 -9
- package/bundles/leanix-components.umd.js.map +1 -1
- package/esm2015/index.js +1 -0
- package/esm2015/index.js.map +1 -1
- package/esm2015/lib/forms-ui/directives/form-error.directive.js +18 -8
- package/esm2015/lib/forms-ui/directives/form-error.directive.js.map +1 -1
- package/esm2015/lib/forms-ui/directives/form-submit.directive.js +27 -0
- package/esm2015/lib/forms-ui/directives/form-submit.directive.js.map +1 -0
- package/esm2015/lib/forms-ui/forms-ui.module.js +7 -2
- package/esm2015/lib/forms-ui/forms-ui.module.js.map +1 -1
- package/fesm2015/leanix-components.js +47 -12
- package/fesm2015/leanix-components.js.map +1 -1
- package/index.d.ts +1 -0
- package/lib/forms-ui/directives/form-error.directive.d.ts +12 -6
- package/lib/forms-ui/directives/form-submit.directive.d.ts +12 -0
- package/lib/forms-ui/forms-ui.module.d.ts +10 -9
- package/package.json +1 -1
@@ -5639,6 +5639,31 @@
|
|
5639
5639
|
type: i0.Output
|
5640
5640
|
}] } });
|
5641
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
|
+
|
5642
5667
|
var FORM_CONTROL_ERROR_NAMESPACE = new i0.InjectionToken('FORM_CONTROL_ERROR_NAMESPACE');
|
5643
5668
|
var FORM_CONTROL_ERROR_DISPLAY_STRATEGY = new i0.InjectionToken('FORM_CONTROL_ERROR_DISPLAY_STRATEGY');
|
5644
5669
|
var provideFormControlErrorNamespace = function (namespace) { return ({
|
@@ -5650,10 +5675,11 @@
|
|
5650
5675
|
useValue: fn
|
5651
5676
|
}); };
|
5652
5677
|
var FormErrorDirective = /** @class */ (function () {
|
5653
|
-
function FormErrorDirective(viewContainer, componentFactoryResolver, ngControl, namespace, strategy) {
|
5678
|
+
function FormErrorDirective(viewContainer, componentFactoryResolver, ngControl, formSubmitDirective, namespace, strategy) {
|
5654
5679
|
this.viewContainer = viewContainer;
|
5655
5680
|
this.componentFactoryResolver = componentFactoryResolver;
|
5656
5681
|
this.ngControl = ngControl;
|
5682
|
+
this.formSubmitDirective = formSubmitDirective;
|
5657
5683
|
this.namespace = namespace;
|
5658
5684
|
this.strategy = strategy;
|
5659
5685
|
}
|
@@ -5673,12 +5699,22 @@
|
|
5673
5699
|
enumerable: false,
|
5674
5700
|
configurable: true
|
5675
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
|
+
});
|
5676
5709
|
FormErrorDirective.prototype.ngOnInit = function () {
|
5677
5710
|
var _this = this;
|
5678
5711
|
var control = this.control;
|
5679
5712
|
if (isAbstractControl(control)) {
|
5680
|
-
this.subscritpion = control.valueChanges
|
5681
|
-
.pipe(operators.
|
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)))
|
5682
5718
|
.subscribe(function (display) {
|
5683
5719
|
var errors = control.errors;
|
5684
5720
|
if (errors && display) {
|
@@ -5714,7 +5750,7 @@
|
|
5714
5750
|
};
|
5715
5751
|
return FormErrorDirective;
|
5716
5752
|
}());
|
5717
|
-
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: FORM_CONTROL_ERROR_NAMESPACE, optional: true }, { token: FORM_CONTROL_ERROR_DISPLAY_STRATEGY, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
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 });
|
5718
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 });
|
5719
5755
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0__namespace, type: FormErrorDirective, decorators: [{
|
5720
5756
|
type: i0.Directive,
|
@@ -5726,6 +5762,10 @@
|
|
5726
5762
|
type: i0.Optional
|
5727
5763
|
}, {
|
5728
5764
|
type: i0.Self
|
5765
|
+
}] }, { type: FormSubmitDirective, decorators: [{
|
5766
|
+
type: i0.Optional
|
5767
|
+
}, {
|
5768
|
+
type: i0.Host
|
5729
5769
|
}] }, { type: undefined, decorators: [{
|
5730
5770
|
type: i0.Optional
|
5731
5771
|
}, {
|
@@ -5743,9 +5783,8 @@
|
|
5743
5783
|
}], controlName: [{
|
5744
5784
|
type: i0.Input
|
5745
5785
|
}] } });
|
5746
|
-
function
|
5747
|
-
|
5748
|
-
}
|
5786
|
+
var isAbstractControl = function (ctrl) { return !!ctrl; };
|
5787
|
+
var resolveStrategy = _.curry(function (strategy, control, submitted) { return strategy ? strategy({ control: control, submitted: submitted }) : true; });
|
5749
5788
|
|
5750
5789
|
var FilterSelectionPipe = /** @class */ (function () {
|
5751
5790
|
function FilterSelectionPipe() {
|
@@ -5910,7 +5949,8 @@
|
|
5910
5949
|
InputComponent,
|
5911
5950
|
FormatNumberPipe,
|
5912
5951
|
FormErrorDirective,
|
5913
|
-
ErrorMessageComponent
|
5952
|
+
ErrorMessageComponent,
|
5953
|
+
FormSubmitDirective], imports: [i2.CommonModule,
|
5914
5954
|
i3$3.DragDropModule,
|
5915
5955
|
i3$2.FormsModule,
|
5916
5956
|
i3$2.ReactiveFormsModule, i1__namespace$2.TranslateModule, i1$3.DatepickerModule,
|
@@ -5952,6 +5992,7 @@
|
|
5952
5992
|
SortingDropdownTriggerComponent,
|
5953
5993
|
FormatNumberPipe,
|
5954
5994
|
FormErrorDirective,
|
5995
|
+
FormSubmitDirective,
|
5955
5996
|
ErrorMessageComponent] });
|
5956
5997
|
LxFormsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0__namespace, type: LxFormsModule, imports: [[
|
5957
5998
|
i2.CommonModule,
|
@@ -6005,7 +6046,8 @@
|
|
6005
6046
|
InputComponent,
|
6006
6047
|
FormatNumberPipe,
|
6007
6048
|
FormErrorDirective,
|
6008
|
-
ErrorMessageComponent
|
6049
|
+
ErrorMessageComponent,
|
6050
|
+
FormSubmitDirective
|
6009
6051
|
],
|
6010
6052
|
imports: [
|
6011
6053
|
i2.CommonModule,
|
@@ -6055,6 +6097,7 @@
|
|
6055
6097
|
SortingDropdownTriggerComponent,
|
6056
6098
|
FormatNumberPipe,
|
6057
6099
|
FormErrorDirective,
|
6100
|
+
FormSubmitDirective,
|
6058
6101
|
ErrorMessageComponent
|
6059
6102
|
]
|
6060
6103
|
}]
|
@@ -6957,6 +7000,7 @@
|
|
6957
7000
|
exports.FilterTermPipe = FilterTermPipe;
|
6958
7001
|
exports.FormErrorComponent = FormErrorComponent;
|
6959
7002
|
exports.FormErrorDirective = FormErrorDirective;
|
7003
|
+
exports.FormSubmitDirective = FormSubmitDirective;
|
6960
7004
|
exports.FormatNumberPipe = FormatNumberPipe;
|
6961
7005
|
exports.GLOBAL_TRANSLATION_OPTIONS = GLOBAL_TRANSLATION_OPTIONS;
|
6962
7006
|
exports.HighlightRangePipe = HighlightRangePipe;
|