onshore-forms 1.1.8 → 1.1.10
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/fesm2022/onshore-forms.mjs +238 -42
- package/fesm2022/onshore-forms.mjs.map +1 -1
- package/package.json +1 -1
- package/types/onshore-forms.d.ts +54 -29
|
@@ -31,8 +31,10 @@ import { ColorPickerModule } from 'primeng/colorpicker';
|
|
|
31
31
|
import { updatePreset } from '@primeuix/themes';
|
|
32
32
|
import * as i3$3 from 'primeng/select';
|
|
33
33
|
import { SelectModule } from 'primeng/select';
|
|
34
|
-
import * as i5 from 'primeng/dialog';
|
|
34
|
+
import * as i5$1 from 'primeng/dialog';
|
|
35
35
|
import { DialogModule } from 'primeng/dialog';
|
|
36
|
+
import * as i5 from 'primeng/tag';
|
|
37
|
+
import { TagModule } from 'primeng/tag';
|
|
36
38
|
import { ImageCropperComponent } from 'ngx-image-cropper';
|
|
37
39
|
import * as i4$2 from 'ngx-webcam';
|
|
38
40
|
import { WebcamModule } from 'ngx-webcam';
|
|
@@ -49,7 +51,7 @@ import { KeyFilterModule } from 'primeng/keyfilter';
|
|
|
49
51
|
import * as i2$5 from 'primeng/toggleswitch';
|
|
50
52
|
import { ToggleSwitchModule } from 'primeng/toggleswitch';
|
|
51
53
|
import { DatePicker } from 'primeng/datepicker';
|
|
52
|
-
import * as i5$
|
|
54
|
+
import * as i5$2 from 'primeng/inputotp';
|
|
53
55
|
import { InputOtpModule } from 'primeng/inputotp';
|
|
54
56
|
import * as i4$4 from 'primeng/popover';
|
|
55
57
|
import { PopoverModule } from 'primeng/popover';
|
|
@@ -490,13 +492,13 @@ class OnshoreFormAutocompleteItemComponent {
|
|
|
490
492
|
showClear = false;
|
|
491
493
|
searchedData = [];
|
|
492
494
|
actionButtonDisabled = false;
|
|
493
|
-
optionLabel = '';
|
|
494
|
-
optionValue = '';
|
|
495
|
-
dataKey = '
|
|
495
|
+
optionLabel = 'label';
|
|
496
|
+
optionValue = 'value';
|
|
497
|
+
dataKey = 'value';
|
|
496
498
|
secondOptionLabel = '';
|
|
497
499
|
thirdOptionLabel = '';
|
|
498
500
|
optionLabelDivider = '-';
|
|
499
|
-
|
|
501
|
+
exclude = false;
|
|
500
502
|
onSearch = new EventEmitter();
|
|
501
503
|
onSelect = new EventEmitter();
|
|
502
504
|
actionButtonClick = new EventEmitter();
|
|
@@ -511,7 +513,6 @@ class OnshoreFormAutocompleteItemComponent {
|
|
|
511
513
|
}
|
|
512
514
|
}
|
|
513
515
|
unselect(event) {
|
|
514
|
-
console.log("unselect", event);
|
|
515
516
|
// @ts-ignore
|
|
516
517
|
const updatedItems = this.ngControl.value.filter((item) => event.value[this.dataKey] !== item[this.dataKey]) || [];
|
|
517
518
|
this.ngControl.control?.setValue(updatedItems);
|
|
@@ -560,7 +561,25 @@ class OnshoreFormAutocompleteItemComponent {
|
|
|
560
561
|
ngOnDestroy() {
|
|
561
562
|
this.ngControl.control?.disable();
|
|
562
563
|
}
|
|
564
|
+
checkExclude() {
|
|
565
|
+
setTimeout(() => {
|
|
566
|
+
if (this.exclude) {
|
|
567
|
+
this.ngControl.control?.disable();
|
|
568
|
+
}
|
|
569
|
+
else {
|
|
570
|
+
this.ngControl.control?.enable();
|
|
571
|
+
}
|
|
572
|
+
this.ngControl.control?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
|
|
573
|
+
this.cdr.markForCheck();
|
|
574
|
+
}, 10);
|
|
575
|
+
}
|
|
576
|
+
ngAfterViewInit() {
|
|
577
|
+
this.checkExclude();
|
|
578
|
+
}
|
|
563
579
|
ngOnChanges(changes) {
|
|
580
|
+
if (changes['exclude']) {
|
|
581
|
+
this.checkExclude();
|
|
582
|
+
}
|
|
564
583
|
this.cdr.markForCheck();
|
|
565
584
|
}
|
|
566
585
|
constructor(cdr, ngControl) {
|
|
@@ -569,11 +588,11 @@ class OnshoreFormAutocompleteItemComponent {
|
|
|
569
588
|
this.ngControl.valueAccessor = this;
|
|
570
589
|
}
|
|
571
590
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormAutocompleteItemComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
572
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: OnshoreFormAutocompleteItemComponent, isStandalone: true, selector: "onshore-form-autocomplete-item", inputs: { formTemplate: "formTemplate", multiple: "multiple", showClear: "showClear", searchedData: "searchedData", actionButtonDisabled: "actionButtonDisabled", optionLabel: "optionLabel", optionValue: "optionValue", dataKey: "dataKey", secondOptionLabel: "secondOptionLabel", thirdOptionLabel: "thirdOptionLabel", optionLabelDivider: "optionLabelDivider",
|
|
591
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: OnshoreFormAutocompleteItemComponent, isStandalone: true, selector: "onshore-form-autocomplete-item", inputs: { formTemplate: "formTemplate", multiple: "multiple", showClear: "showClear", searchedData: "searchedData", actionButtonDisabled: "actionButtonDisabled", optionLabel: "optionLabel", optionValue: "optionValue", dataKey: "dataKey", secondOptionLabel: "secondOptionLabel", thirdOptionLabel: "thirdOptionLabel", optionLabelDivider: "optionLabelDivider", exclude: "exclude" }, outputs: { onSearch: "onSearch", onSelect: "onSelect", actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n <p-fluid>\n <p-autoComplete [placeholder]=\"formTemplate.placeholder\"\n appendTo=\"body\"\n [formControl]=\"formControl\"\n [suggestions]=\"searchedData\"\n (completeMethod)=\"searchPrepare($event)\"\n [disabled]=\"disabled\"\n [showClear]=\"showClear\"\n [minLength]=\"2\"\n [multiple]=\"multiple\"\n [delay]=\"1000\"\n [unique]=\"true\"\n [dataKey]=\"dataKey\"\n [optionLabel]=\"optionLabel\"\n [optionValue]=\"optionValue\"\n (onUnselect)=\"unselect($event)\"\n class=\"w-full\">\n <ng-template let-item pTemplate=\"item\">\n <div class=\"flex gap-1\">\n @if (optionLabel) {\n <span>{{ findValue(item, optionLabel) }}</span>\n } @else {\n <span>{{ item }}</span>\n }\n @if (secondOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(item, secondOptionLabel) }}</span>\n }\n @if (thirdOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(item, thirdOptionLabel) }}</span>\n }\n </div>\n </ng-template>\n </p-autoComplete>\n </p-fluid>\n</onshore-form-item-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: AutoCompleteModule }, { kind: "component", type: i2$2.AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "minQueryLength", "delay", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "addOnTab", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "addOnBlur", "separator", "appendTo", "motionOptions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onAdd", "onFocus", "onBlur", "onDropdownClick", "onClear", "onInputKeydown", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ChipModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FluidModule }, { kind: "component", type: i4.Fluid, selector: "p-fluid" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
573
592
|
}
|
|
574
593
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormAutocompleteItemComponent, decorators: [{
|
|
575
594
|
type: Component,
|
|
576
|
-
args: [{ selector: 'onshore-form-autocomplete-item', imports: [CommonModule, OnshoreFormItemContainer, AutoCompleteModule, ChipModule, FormsModule, ReactiveFormsModule, FluidModule, MultiSelect], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"
|
|
595
|
+
args: [{ selector: 'onshore-form-autocomplete-item', imports: [CommonModule, OnshoreFormItemContainer, AutoCompleteModule, ChipModule, FormsModule, ReactiveFormsModule, FluidModule, MultiSelect], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n <p-fluid>\n <p-autoComplete [placeholder]=\"formTemplate.placeholder\"\n appendTo=\"body\"\n [formControl]=\"formControl\"\n [suggestions]=\"searchedData\"\n (completeMethod)=\"searchPrepare($event)\"\n [disabled]=\"disabled\"\n [showClear]=\"showClear\"\n [minLength]=\"2\"\n [multiple]=\"multiple\"\n [delay]=\"1000\"\n [unique]=\"true\"\n [dataKey]=\"dataKey\"\n [optionLabel]=\"optionLabel\"\n [optionValue]=\"optionValue\"\n (onUnselect)=\"unselect($event)\"\n class=\"w-full\">\n <ng-template let-item pTemplate=\"item\">\n <div class=\"flex gap-1\">\n @if (optionLabel) {\n <span>{{ findValue(item, optionLabel) }}</span>\n } @else {\n <span>{{ item }}</span>\n }\n @if (secondOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(item, secondOptionLabel) }}</span>\n }\n @if (thirdOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(item, thirdOptionLabel) }}</span>\n }\n </div>\n </ng-template>\n </p-autoComplete>\n </p-fluid>\n</onshore-form-item-container>\n" }]
|
|
577
596
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.NgControl, decorators: [{
|
|
578
597
|
type: Self
|
|
579
598
|
}, {
|
|
@@ -600,7 +619,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
600
619
|
type: Input
|
|
601
620
|
}], optionLabelDivider: [{
|
|
602
621
|
type: Input
|
|
603
|
-
}],
|
|
622
|
+
}], exclude: [{
|
|
604
623
|
type: Input
|
|
605
624
|
}], onSearch: [{
|
|
606
625
|
type: Output
|
|
@@ -615,7 +634,7 @@ class OnshoreFormCheckboxItemComponent {
|
|
|
615
634
|
cdr;
|
|
616
635
|
formTemplate;
|
|
617
636
|
actionButtonDisabled = false;
|
|
618
|
-
|
|
637
|
+
exclude = false;
|
|
619
638
|
actionButtonClick = new EventEmitter();
|
|
620
639
|
disabled = false;
|
|
621
640
|
// ControlValueAccessor interface
|
|
@@ -637,7 +656,25 @@ class OnshoreFormCheckboxItemComponent {
|
|
|
637
656
|
this.cdr.markForCheck();
|
|
638
657
|
}
|
|
639
658
|
}
|
|
659
|
+
checkExclude() {
|
|
660
|
+
setTimeout(() => {
|
|
661
|
+
if (this.exclude) {
|
|
662
|
+
this.ngControl.control?.disable();
|
|
663
|
+
}
|
|
664
|
+
else {
|
|
665
|
+
this.ngControl.control?.enable();
|
|
666
|
+
}
|
|
667
|
+
this.ngControl.control?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
|
|
668
|
+
this.cdr.markForCheck();
|
|
669
|
+
}, 10);
|
|
670
|
+
}
|
|
671
|
+
ngAfterViewInit() {
|
|
672
|
+
this.checkExclude();
|
|
673
|
+
}
|
|
640
674
|
ngOnChanges(changes) {
|
|
675
|
+
if (changes['exclude']) {
|
|
676
|
+
this.checkExclude();
|
|
677
|
+
}
|
|
641
678
|
this.cdr.markForCheck();
|
|
642
679
|
}
|
|
643
680
|
ngOnDestroy() {
|
|
@@ -649,11 +686,11 @@ class OnshoreFormCheckboxItemComponent {
|
|
|
649
686
|
this.ngControl.valueAccessor = this;
|
|
650
687
|
}
|
|
651
688
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormCheckboxItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
652
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormCheckboxItemComponent, isStandalone: true, selector: "onshore-form-checkbox-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled",
|
|
689
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormCheckboxItemComponent, isStandalone: true, selector: "onshore-form-checkbox-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled", exclude: "exclude" }, outputs: { actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n\n <div class=\"p-field-checkbox flex\">\n <p-checkbox\n class=\"align-self-start mt-1\"\n [name]=\"formTemplate.name\"\n [formControl]=\"formControl\"\n [binary]=\"true\"\n [disabled]=\"disabled\"\n [inputId]=\"formTemplate.name\"\n [value]=\"ngControl.control.value\"\n (onChange)=\"changeCheck($event)\">\n </p-checkbox>\n\n <label class=\"mb-0 ml-2 text-color\"\n [for]=\"formTemplate.name\">\n {{formTemplate.hint}}\n </label>\n </div>\n\n</onshore-form-item-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i2$3.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["hostName", "value", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "inputStyle", "styleClass", "inputClass", "indeterminate", "formControl", "checkboxIcon", "readonly", "autofocus", "trueValue", "falseValue", "variant", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
653
690
|
}
|
|
654
691
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormCheckboxItemComponent, decorators: [{
|
|
655
692
|
type: Component,
|
|
656
|
-
args: [{ selector: 'onshore-form-checkbox-item', imports: [CommonModule, OnshoreFormItemContainer, CheckboxModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"
|
|
693
|
+
args: [{ selector: 'onshore-form-checkbox-item', imports: [CommonModule, OnshoreFormItemContainer, CheckboxModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n\n <div class=\"p-field-checkbox flex\">\n <p-checkbox\n class=\"align-self-start mt-1\"\n [name]=\"formTemplate.name\"\n [formControl]=\"formControl\"\n [binary]=\"true\"\n [disabled]=\"disabled\"\n [inputId]=\"formTemplate.name\"\n [value]=\"ngControl.control.value\"\n (onChange)=\"changeCheck($event)\">\n </p-checkbox>\n\n <label class=\"mb-0 ml-2 text-color\"\n [for]=\"formTemplate.name\">\n {{formTemplate.hint}}\n </label>\n </div>\n\n</onshore-form-item-container>\n" }]
|
|
657
694
|
}], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
|
|
658
695
|
type: Self
|
|
659
696
|
}, {
|
|
@@ -662,7 +699,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
662
699
|
type: Input
|
|
663
700
|
}], actionButtonDisabled: [{
|
|
664
701
|
type: Input
|
|
665
|
-
}],
|
|
702
|
+
}], exclude: [{
|
|
666
703
|
type: Input
|
|
667
704
|
}], actionButtonClick: [{
|
|
668
705
|
type: Output
|
|
@@ -673,7 +710,7 @@ class OnshoreFormColorpickerItemComponent {
|
|
|
673
710
|
cdr;
|
|
674
711
|
formTemplate;
|
|
675
712
|
actionButtonDisabled = false;
|
|
676
|
-
|
|
713
|
+
exclude = false;
|
|
677
714
|
actionButtonClick = new EventEmitter();
|
|
678
715
|
disabled = false;
|
|
679
716
|
colorPickerValue = '';
|
|
@@ -717,8 +754,26 @@ class OnshoreFormColorpickerItemComponent {
|
|
|
717
754
|
ngOnDestroy() {
|
|
718
755
|
this.ngControl.control?.disable();
|
|
719
756
|
}
|
|
757
|
+
checkExclude() {
|
|
758
|
+
setTimeout(() => {
|
|
759
|
+
if (this.exclude) {
|
|
760
|
+
this.ngControl.control?.disable();
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
this.ngControl.control?.enable();
|
|
764
|
+
}
|
|
765
|
+
this.ngControl.control?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
|
|
766
|
+
this.cdr.markForCheck();
|
|
767
|
+
}, 10);
|
|
768
|
+
}
|
|
769
|
+
ngAfterViewInit() {
|
|
770
|
+
this.checkExclude();
|
|
771
|
+
}
|
|
720
772
|
ngOnChanges(changes) {
|
|
721
773
|
this.colorPickerValue = this.ngControl.control?.value;
|
|
774
|
+
if (changes['exclude']) {
|
|
775
|
+
this.checkExclude();
|
|
776
|
+
}
|
|
722
777
|
this.cdr.markForCheck();
|
|
723
778
|
}
|
|
724
779
|
constructor(ngControl, cdr) {
|
|
@@ -728,11 +783,11 @@ class OnshoreFormColorpickerItemComponent {
|
|
|
728
783
|
this.changeLayoutPreset();
|
|
729
784
|
}
|
|
730
785
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormColorpickerItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
731
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormColorpickerItemComponent, isStandalone: true, selector: "onshore-form-colorpicker-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled",
|
|
786
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormColorpickerItemComponent, isStandalone: true, selector: "onshore-form-colorpicker-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled", exclude: "exclude" }, outputs: { actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n <div class=\"flex w-full\">\n\n <input class=\"w-full mr-2\"\n type=\"text\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [formControl]=\"formControl\"\n [disabled]=\"disabled\"\n pInputText\n [value]=\"ngControl.control.value\"\n (input)=\"changeInput($event)\"/>\n\n <p-colorPicker [(ngModel)]=\"colorPickerValue\"\n format=\"hex\" [inline]=\"false\"\n appendTo=\"body\"\n [disabled]=\"disabled\"\n [autoZIndex]=\"true\"\n (onChange)=\"changeColor()\">\n </p-colorPicker>\n </div>\n</onshore-form-item-container>\n\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$4.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: ColorPickerModule }, { kind: "component", type: i3$2.ColorPicker, selector: "p-colorPicker, p-colorpicker, p-color-picker", inputs: ["styleClass", "showTransitionOptions", "hideTransitionOptions", "inline", "format", "tabindex", "inputId", "autoZIndex", "autofocus", "defaultColor", "appendTo", "overlayOptions", "motionOptions"], outputs: ["onChange", "onShow", "onHide"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
732
787
|
}
|
|
733
788
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormColorpickerItemComponent, decorators: [{
|
|
734
789
|
type: Component,
|
|
735
|
-
args: [{ selector: 'onshore-form-colorpicker-item', imports: [CommonModule, OnshoreFormItemContainer, InputTextModule, ColorPickerModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"
|
|
790
|
+
args: [{ selector: 'onshore-form-colorpicker-item', imports: [CommonModule, OnshoreFormItemContainer, InputTextModule, ColorPickerModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n <div class=\"flex w-full\">\n\n <input class=\"w-full mr-2\"\n type=\"text\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [formControl]=\"formControl\"\n [disabled]=\"disabled\"\n pInputText\n [value]=\"ngControl.control.value\"\n (input)=\"changeInput($event)\"/>\n\n <p-colorPicker [(ngModel)]=\"colorPickerValue\"\n format=\"hex\" [inline]=\"false\"\n appendTo=\"body\"\n [disabled]=\"disabled\"\n [autoZIndex]=\"true\"\n (onChange)=\"changeColor()\">\n </p-colorPicker>\n </div>\n</onshore-form-item-container>\n\n" }]
|
|
736
791
|
}], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
|
|
737
792
|
type: Self
|
|
738
793
|
}, {
|
|
@@ -741,7 +796,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
741
796
|
type: Input
|
|
742
797
|
}], actionButtonDisabled: [{
|
|
743
798
|
type: Input
|
|
744
|
-
}],
|
|
799
|
+
}], exclude: [{
|
|
745
800
|
type: Input
|
|
746
801
|
}], actionButtonClick: [{
|
|
747
802
|
type: Output
|
|
@@ -777,18 +832,23 @@ class OnshoreFormDropdownItemComponent {
|
|
|
777
832
|
cdr;
|
|
778
833
|
formTemplate;
|
|
779
834
|
multiple = false;
|
|
835
|
+
multipleItemSeverity = 'info';
|
|
780
836
|
showClear = false;
|
|
837
|
+
showMultiClear = true;
|
|
781
838
|
group = false;
|
|
782
839
|
selectionLimit = 0;
|
|
783
840
|
minLength = 0;
|
|
784
841
|
optionLabel = 'label';
|
|
785
842
|
optionValue = 'value';
|
|
786
843
|
dataKey = 'value';
|
|
844
|
+
secondOptionLabel = '';
|
|
845
|
+
thirdOptionLabel = '';
|
|
846
|
+
optionLabelDivider = '-';
|
|
787
847
|
optionGroupLabel = '';
|
|
788
848
|
actionButtonDisabled = false;
|
|
789
849
|
createEnabled = false;
|
|
790
850
|
options = [];
|
|
791
|
-
|
|
851
|
+
exclude = false;
|
|
792
852
|
valueChange = new EventEmitter();
|
|
793
853
|
actionButtonClick = new EventEmitter();
|
|
794
854
|
entryCreated = new EventEmitter();
|
|
@@ -816,6 +876,14 @@ class OnshoreFormDropdownItemComponent {
|
|
|
816
876
|
get formControl() {
|
|
817
877
|
return this.ngControl.control;
|
|
818
878
|
}
|
|
879
|
+
findValue(item, key) {
|
|
880
|
+
let result = '';
|
|
881
|
+
const parts = key.split(' ');
|
|
882
|
+
parts.forEach(part => {
|
|
883
|
+
result += part.split('.').reduce((acc, subpart) => acc && acc[subpart], item) + ' ';
|
|
884
|
+
});
|
|
885
|
+
return result;
|
|
886
|
+
}
|
|
819
887
|
ngOnInit() {
|
|
820
888
|
if ((!this.ngControl.control?.value || this.ngControl.control?.value == '' || this.ngControl.control?.value == undefined) && !this.multiple) {
|
|
821
889
|
this.ngControl.control?.setValue(this.formTemplate.default);
|
|
@@ -825,12 +893,40 @@ class OnshoreFormDropdownItemComponent {
|
|
|
825
893
|
ngOnDestroy() {
|
|
826
894
|
this.ngControl.control?.disable();
|
|
827
895
|
}
|
|
896
|
+
checkExclude() {
|
|
897
|
+
setTimeout(() => {
|
|
898
|
+
if (this.exclude) {
|
|
899
|
+
this.ngControl.control?.disable();
|
|
900
|
+
}
|
|
901
|
+
else {
|
|
902
|
+
this.ngControl.control?.enable();
|
|
903
|
+
}
|
|
904
|
+
this.ngControl.control?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
|
|
905
|
+
this.cdr.markForCheck();
|
|
906
|
+
}, 10);
|
|
907
|
+
}
|
|
908
|
+
removeSelected(value, event) {
|
|
909
|
+
event.preventDefault();
|
|
910
|
+
event.stopPropagation();
|
|
911
|
+
// @ts-ignore
|
|
912
|
+
const selected = this.ngControl.control?.value.filter((x) => x !== value[this.optionValue]);
|
|
913
|
+
this.ngControl.control?.setValue(selected);
|
|
914
|
+
this.ngControl?.control?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
|
|
915
|
+
this.ngControl?.control?.markAsDirty();
|
|
916
|
+
this.cdr.markForCheck();
|
|
917
|
+
}
|
|
918
|
+
ngAfterViewInit() {
|
|
919
|
+
this.checkExclude();
|
|
920
|
+
}
|
|
828
921
|
ngOnChanges(changes) {
|
|
829
922
|
const currentOptions = changes['options']?.currentValue ?? changes['formTemplate']?.currentValue?.options;
|
|
830
923
|
//const previousOptions = changes['options']?.previousValue ?? changes['formTemplate']?.previousValue?.options;
|
|
831
924
|
if (!this.options && currentOptions) {
|
|
832
925
|
this.options = currentOptions;
|
|
833
926
|
}
|
|
927
|
+
if (changes['exclude']) {
|
|
928
|
+
this.checkExclude();
|
|
929
|
+
}
|
|
834
930
|
this.cdr.markForCheck();
|
|
835
931
|
}
|
|
836
932
|
constructor(ngControl, cdr) {
|
|
@@ -840,11 +936,11 @@ class OnshoreFormDropdownItemComponent {
|
|
|
840
936
|
}
|
|
841
937
|
OnshoreFormTemplateType = OnshoreFormTemplateType;
|
|
842
938
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormDropdownItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
843
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormDropdownItemComponent, isStandalone: true, selector: "onshore-form-dropdown-item", inputs: { formTemplate: "formTemplate", multiple: "multiple", showClear: "showClear", group: "group", selectionLimit: "selectionLimit", minLength: "minLength", optionLabel: "optionLabel", optionValue: "optionValue", dataKey: "dataKey", optionGroupLabel: "optionGroupLabel", actionButtonDisabled: "actionButtonDisabled", createEnabled: "createEnabled", options: "options", hidden: "hidden" }, outputs: { valueChange: "valueChange", actionButtonClick: "actionButtonClick", entryCreated: "entryCreated" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"hidden\">\n\n <p-select *ngIf=\"!multiple\"\n class=\"w-full\"\n [options]=\"options\"\n [formControl]=\"formControl\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [optionLabel]=\"optionLabel\"\n [optionValue]=\"optionValue\"\n [dataKey]=\"dataKey\"\n [optionGroupLabel]=\"optionGroupLabel\"\n [group]=\"group\"\n [showClear]=\"showClear && formTemplate?.placeholder\"\n (onClear)=\"clearSelection()\"\n optionDisabled=\"disabled\"\n appendTo=\"body\">\n <ng-template #footer>\n <div *ngIf=\"createEnabled\" class=\"flex justify-content-center\">\n <onshore-inplace-input (created)=\"entryCreated.emit($event)\">\n </onshore-inplace-input>\n </div>\n </ng-template>\n </p-select>\n\n <p-multiSelect *ngIf=\"multiple\"\n class=\"w-full\"\n [options]=\"options\"\n [formControl]=\"formControl\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [showClear]=\"showClear\"\n [selectionLimit]=\"selectionLimit\"\n [minlength]=\"minLength\"\n [optionLabel]=\"optionLabel\"\n [optionValue]=\"optionValue\"\n [dataKey]=\"dataKey\"\n [optionGroupLabel]=\"optionGroupLabel\"\n [group]=\"group\"\n (onClear)=\"clearSelection()\"\n [selectedItemsLabel]=\"'form.dropdownControl.selectedItems' | translate\"\n optionDisabled=\"disabled\"\n appendTo=\"body\">\n <ng-template #footer>\n <div *ngIf=\"createEnabled\" class=\"flex justify-content-center\">\n <onshore-inplace-input (created)=\"entryCreated.emit($event)\">\n </onshore-inplace-input>\n </div>\n </ng-template>\n </p-multiSelect>\n</onshore-form-item-container>\n\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i3$3.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i4$1.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: OnshoreInplaceInputComponent, selector: "onshore-inplace-input", outputs: ["created"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
939
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: OnshoreFormDropdownItemComponent, isStandalone: true, selector: "onshore-form-dropdown-item", inputs: { formTemplate: "formTemplate", multiple: "multiple", multipleItemSeverity: "multipleItemSeverity", showClear: "showClear", showMultiClear: "showMultiClear", group: "group", selectionLimit: "selectionLimit", minLength: "minLength", optionLabel: "optionLabel", optionValue: "optionValue", dataKey: "dataKey", secondOptionLabel: "secondOptionLabel", thirdOptionLabel: "thirdOptionLabel", optionLabelDivider: "optionLabelDivider", optionGroupLabel: "optionGroupLabel", actionButtonDisabled: "actionButtonDisabled", createEnabled: "createEnabled", options: "options", exclude: "exclude" }, outputs: { valueChange: "valueChange", actionButtonClick: "actionButtonClick", entryCreated: "entryCreated" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n\n <p-select *ngIf=\"!multiple\"\n class=\"w-full\"\n [options]=\"options\"\n [formControl]=\"formControl\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [optionLabel]=\"optionLabel\"\n [optionValue]=\"optionValue\"\n [dataKey]=\"dataKey\"\n [optionGroupLabel]=\"optionGroupLabel\"\n [group]=\"group\"\n [showClear]=\"showClear && formTemplate?.placeholder\"\n (onClear)=\"clearSelection()\"\n optionDisabled=\"disabled\"\n appendTo=\"body\">\n <ng-template let-selectedItem #selectedItem>\n <div class=\"flex gap-1\">\n @if (optionLabel) {\n <span>{{ findValue(selectedItem, optionLabel) }}</span>\n } @else {\n <span>{{ selectedItem }}</span>\n }\n @if (secondOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(selectedItem, secondOptionLabel) }}</span>\n }\n @if (thirdOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(selectedItem, thirdOptionLabel) }}</span>\n }\n </div>\n </ng-template>\n\n <ng-template let-item #item>\n <div class=\"flex gap-1\">\n @if (optionLabel) {\n <span>{{ findValue(item, optionLabel) }}</span>\n } @else {\n <span>{{ item }}</span>\n }\n @if (secondOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(item, secondOptionLabel) }}</span>\n }\n @if (thirdOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(item, thirdOptionLabel) }}</span>\n }\n </div>\n </ng-template>\n\n <ng-template #footer>\n <div *ngIf=\"createEnabled\" class=\"flex justify-content-center\">\n <onshore-inplace-input (created)=\"entryCreated.emit($event)\">\n </onshore-inplace-input>\n </div>\n </ng-template>\n </p-select>\n\n <p-multiSelect *ngIf=\"multiple\"\n class=\"w-full\"\n [options]=\"options\"\n [formControl]=\"formControl\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [showClear]=\"showClear\"\n [selectionLimit]=\"selectionLimit\"\n [minlength]=\"minLength\"\n [optionLabel]=\"optionLabel\"\n [optionValue]=\"optionValue\"\n [dataKey]=\"dataKey\"\n [optionGroupLabel]=\"optionGroupLabel\"\n [group]=\"group\"\n (onClear)=\"clearSelection()\"\n [selectedItemsLabel]=\"'form.dropdownControl.selectedItems' | translate\"\n optionDisabled=\"disabled\"\n appendTo=\"body\">\n <ng-template let-selectedItems #selecteditems>\n <div class=\"flex gap-2\">\n @for (selectedItem of selectedItems; track selectedItem) {\n <p-tag [severity]=\"multipleItemSeverity\">\n <div class=\"flex gap-1 align-items-center\">\n @if (optionLabel) {\n <span>{{ findValue(selectedItem, optionLabel) }}</span>\n } @else {\n <span>{{ selectedItem }}</span>\n }\n @if (secondOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(selectedItem, secondOptionLabel) }}</span>\n }\n @if (thirdOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(selectedItem, thirdOptionLabel) }}</span>\n }\n @if (showMultiClear) {\n <i class=\"fa fa-times cursor-pointer\" (click)=\"removeSelected(selectedItem, $event)\"></i>\n }\n </div>\n </p-tag>\n }\n </div>\n </ng-template>\n\n <ng-template let-item #item>\n <div class=\"flex gap-1\">\n @if (optionLabel) {\n <span>{{ findValue(item, optionLabel) }}</span>\n } @else {\n <span>{{ item }}</span>\n }\n @if (secondOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(item, secondOptionLabel) }}</span>\n }\n @if (thirdOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(item, thirdOptionLabel) }}</span>\n }\n </div>\n </ng-template>\n\n <ng-template #footer>\n <div *ngIf=\"createEnabled\" class=\"flex justify-content-center\">\n <onshore-inplace-input (created)=\"entryCreated.emit($event)\">\n </onshore-inplace-input>\n </div>\n </ng-template>\n </p-multiSelect>\n</onshore-form-item-container>\n\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i3$3.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i4$1.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: OnshoreInplaceInputComponent, selector: "onshore-inplace-input", outputs: ["created"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i5.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
844
940
|
}
|
|
845
941
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormDropdownItemComponent, decorators: [{
|
|
846
942
|
type: Component,
|
|
847
|
-
args: [{ selector: 'onshore-form-dropdown-item', imports: [CommonModule, ButtonModule, OnshoreFormItemContainer, TranslateModule, SelectModule, MultiSelectModule, FormsModule, ReactiveFormsModule, DialogModule, OnshoreInplaceInputComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"
|
|
943
|
+
args: [{ selector: 'onshore-form-dropdown-item', imports: [CommonModule, ButtonModule, OnshoreFormItemContainer, TranslateModule, SelectModule, MultiSelectModule, FormsModule, ReactiveFormsModule, DialogModule, OnshoreInplaceInputComponent, TagModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n\n <p-select *ngIf=\"!multiple\"\n class=\"w-full\"\n [options]=\"options\"\n [formControl]=\"formControl\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [optionLabel]=\"optionLabel\"\n [optionValue]=\"optionValue\"\n [dataKey]=\"dataKey\"\n [optionGroupLabel]=\"optionGroupLabel\"\n [group]=\"group\"\n [showClear]=\"showClear && formTemplate?.placeholder\"\n (onClear)=\"clearSelection()\"\n optionDisabled=\"disabled\"\n appendTo=\"body\">\n <ng-template let-selectedItem #selectedItem>\n <div class=\"flex gap-1\">\n @if (optionLabel) {\n <span>{{ findValue(selectedItem, optionLabel) }}</span>\n } @else {\n <span>{{ selectedItem }}</span>\n }\n @if (secondOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(selectedItem, secondOptionLabel) }}</span>\n }\n @if (thirdOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(selectedItem, thirdOptionLabel) }}</span>\n }\n </div>\n </ng-template>\n\n <ng-template let-item #item>\n <div class=\"flex gap-1\">\n @if (optionLabel) {\n <span>{{ findValue(item, optionLabel) }}</span>\n } @else {\n <span>{{ item }}</span>\n }\n @if (secondOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(item, secondOptionLabel) }}</span>\n }\n @if (thirdOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(item, thirdOptionLabel) }}</span>\n }\n </div>\n </ng-template>\n\n <ng-template #footer>\n <div *ngIf=\"createEnabled\" class=\"flex justify-content-center\">\n <onshore-inplace-input (created)=\"entryCreated.emit($event)\">\n </onshore-inplace-input>\n </div>\n </ng-template>\n </p-select>\n\n <p-multiSelect *ngIf=\"multiple\"\n class=\"w-full\"\n [options]=\"options\"\n [formControl]=\"formControl\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [showClear]=\"showClear\"\n [selectionLimit]=\"selectionLimit\"\n [minlength]=\"minLength\"\n [optionLabel]=\"optionLabel\"\n [optionValue]=\"optionValue\"\n [dataKey]=\"dataKey\"\n [optionGroupLabel]=\"optionGroupLabel\"\n [group]=\"group\"\n (onClear)=\"clearSelection()\"\n [selectedItemsLabel]=\"'form.dropdownControl.selectedItems' | translate\"\n optionDisabled=\"disabled\"\n appendTo=\"body\">\n <ng-template let-selectedItems #selecteditems>\n <div class=\"flex gap-2\">\n @for (selectedItem of selectedItems; track selectedItem) {\n <p-tag [severity]=\"multipleItemSeverity\">\n <div class=\"flex gap-1 align-items-center\">\n @if (optionLabel) {\n <span>{{ findValue(selectedItem, optionLabel) }}</span>\n } @else {\n <span>{{ selectedItem }}</span>\n }\n @if (secondOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(selectedItem, secondOptionLabel) }}</span>\n }\n @if (thirdOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(selectedItem, thirdOptionLabel) }}</span>\n }\n @if (showMultiClear) {\n <i class=\"fa fa-times cursor-pointer\" (click)=\"removeSelected(selectedItem, $event)\"></i>\n }\n </div>\n </p-tag>\n }\n </div>\n </ng-template>\n\n <ng-template let-item #item>\n <div class=\"flex gap-1\">\n @if (optionLabel) {\n <span>{{ findValue(item, optionLabel) }}</span>\n } @else {\n <span>{{ item }}</span>\n }\n @if (secondOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(item, secondOptionLabel) }}</span>\n }\n @if (thirdOptionLabel) {\n @if (optionLabelDivider) {\n <span>{{optionLabelDivider}}</span>\n }\n <span>{{ findValue(item, thirdOptionLabel) }}</span>\n }\n </div>\n </ng-template>\n\n <ng-template #footer>\n <div *ngIf=\"createEnabled\" class=\"flex justify-content-center\">\n <onshore-inplace-input (created)=\"entryCreated.emit($event)\">\n </onshore-inplace-input>\n </div>\n </ng-template>\n </p-multiSelect>\n</onshore-form-item-container>\n\n" }]
|
|
848
944
|
}], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
|
|
849
945
|
type: Self
|
|
850
946
|
}, {
|
|
@@ -853,8 +949,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
853
949
|
type: Input
|
|
854
950
|
}], multiple: [{
|
|
855
951
|
type: Input
|
|
952
|
+
}], multipleItemSeverity: [{
|
|
953
|
+
type: Input
|
|
856
954
|
}], showClear: [{
|
|
857
955
|
type: Input
|
|
956
|
+
}], showMultiClear: [{
|
|
957
|
+
type: Input
|
|
858
958
|
}], group: [{
|
|
859
959
|
type: Input
|
|
860
960
|
}], selectionLimit: [{
|
|
@@ -867,6 +967,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
867
967
|
type: Input
|
|
868
968
|
}], dataKey: [{
|
|
869
969
|
type: Input
|
|
970
|
+
}], secondOptionLabel: [{
|
|
971
|
+
type: Input
|
|
972
|
+
}], thirdOptionLabel: [{
|
|
973
|
+
type: Input
|
|
974
|
+
}], optionLabelDivider: [{
|
|
975
|
+
type: Input
|
|
870
976
|
}], optionGroupLabel: [{
|
|
871
977
|
type: Input
|
|
872
978
|
}], actionButtonDisabled: [{
|
|
@@ -875,7 +981,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
875
981
|
type: Input
|
|
876
982
|
}], options: [{
|
|
877
983
|
type: Input
|
|
878
|
-
}],
|
|
984
|
+
}], exclude: [{
|
|
879
985
|
type: Input
|
|
880
986
|
}], valueChange: [{
|
|
881
987
|
type: Output
|
|
@@ -1068,7 +1174,7 @@ class OnshoreFormImageItemComponent {
|
|
|
1068
1174
|
formTemplate;
|
|
1069
1175
|
imageSettings = undefined;
|
|
1070
1176
|
actionButtonDisabled = false;
|
|
1071
|
-
|
|
1177
|
+
exclude = false;
|
|
1072
1178
|
imageDeleted = new EventEmitter();
|
|
1073
1179
|
imageCleared = new EventEmitter();
|
|
1074
1180
|
imageReady = new EventEmitter();
|
|
@@ -1178,6 +1284,21 @@ class OnshoreFormImageItemComponent {
|
|
|
1178
1284
|
this.ngControl?.control?.disable();
|
|
1179
1285
|
this.image = undefined;
|
|
1180
1286
|
}
|
|
1287
|
+
checkExclude() {
|
|
1288
|
+
setTimeout(() => {
|
|
1289
|
+
if (this.exclude) {
|
|
1290
|
+
this.ngControl.control?.disable();
|
|
1291
|
+
}
|
|
1292
|
+
else {
|
|
1293
|
+
this.ngControl.control?.enable();
|
|
1294
|
+
}
|
|
1295
|
+
this.ngControl.control?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
|
|
1296
|
+
this.cdr.markForCheck();
|
|
1297
|
+
}, 10);
|
|
1298
|
+
}
|
|
1299
|
+
ngAfterViewInit() {
|
|
1300
|
+
this.checkExclude();
|
|
1301
|
+
}
|
|
1181
1302
|
ngOnChanges(changes) {
|
|
1182
1303
|
const imageSettings = changes['imageSettings']?.currentValue;
|
|
1183
1304
|
this.imageSettings = {
|
|
@@ -1185,6 +1306,9 @@ class OnshoreFormImageItemComponent {
|
|
|
1185
1306
|
...imageSettings,
|
|
1186
1307
|
placeholderIcon: imageSettings?.placeholderImage ? '' : (imageSettings?.placeholderIcon ?? this.defaultImageSettings.placeholderIcon)
|
|
1187
1308
|
};
|
|
1309
|
+
if (changes['exclude']) {
|
|
1310
|
+
this.checkExclude();
|
|
1311
|
+
}
|
|
1188
1312
|
//this.removeImage();
|
|
1189
1313
|
this.cdr.markForCheck();
|
|
1190
1314
|
}
|
|
@@ -1194,11 +1318,11 @@ class OnshoreFormImageItemComponent {
|
|
|
1194
1318
|
this.ngControl.valueAccessor = this;
|
|
1195
1319
|
}
|
|
1196
1320
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormImageItemComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
1197
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormImageItemComponent, isStandalone: true, selector: "onshore-form-image-item", inputs: { formTemplate: "formTemplate", imageSettings: "imageSettings", actionButtonDisabled: "actionButtonDisabled",
|
|
1321
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormImageItemComponent, isStandalone: true, selector: "onshore-form-image-item", inputs: { formTemplate: "formTemplate", imageSettings: "imageSettings", actionButtonDisabled: "actionButtonDisabled", exclude: "exclude" }, outputs: { imageDeleted: "imageDeleted", imageCleared: "imageCleared", imageReady: "imageReady", selectFromMedia: "selectFromMedia", isLoading: "isLoading" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\" [hidden]=\"exclude\">\n <div class=\"w-full flex align-items-center gap-2\" [class.flex-column]=\"formTemplate.layout === OnshoreFormTemplateLayout.vertical\">\n\n <div class=\"border-solid border-1 border-300 border-round-md overflow-hidden\"\n [style]=\"'background-color: white; width: ' + imageSettings.containerWidth + 'px; height: ' + imageSettings.containerHeight + 'px'\">\n <onshore-image-placeholder\n class=\"w-full\"\n [image]=\"image\"\n [imageStyle]=\"'width: 100%; height: 100%'\"\n [placeholderIcon]=\"imageSettings.placeholderIcon\"\n [placeholderImage]=\"imageSettings.placeholderImage\"\n [placeholderStyle]=\"'width: 100%; height: 100%'\">\n </onshore-image-placeholder>\n </div>\n\n <div>\n <p-fluid class=\"flex flex-column\">\n <p-button *ngIf=\"imageSettings.imageSelectionEnabled\"\n [severity]=\"'secondary'\"\n icon=\"fa fa-image\"\n [label]=\"'form.imageControl.uploadImageButton' | translate\"\n class=\"mb-2 w-full\"\n [disabled]=\"disabled\"\n (click)=\"imageChooserDialogVisible = true; cdr.detectChanges()\">\n </p-button>\n\n <p-button *ngIf=\"imageSettings.webcamSelectionEnabled\"\n [severity]=\"'secondary'\"\n icon=\"fa fa-camera\"\n [label]=\"'form.imageControl.webcamImageButton' | translate\"\n class=\"mb-2 w-full\"\n [disabled]=\"disabled\"\n (click)=\"webcamDialogVisible = true\">\n </p-button>\n\n <p-button *ngIf=\"imageSettings.mediaSelectionEnabled\"\n [severity]=\"'secondary'\"\n icon=\"fa fa-photo-video\"\n [label]=\"'form.imageControl.mediaImageButton' | translate\"\n class=\"mb-2 w-full\"\n [disabled]=\"disabled\"\n (click)=\"selectFromMedia.emit()\">\n </p-button>\n\n <p-button *ngIf=\"imageSettings.deleteEnabled\"\n [severity]=\"'secondary'\"\n icon=\"fa fa-eraser\"\n [label]=\"'form.imageControl.removeImageButton' | translate\"\n (click)=\"removeImage()\"\n class=\"w-full\"\n [disabled]=\"!image || disabled\">\n </p-button>\n </p-fluid>\n </div>\n\n </div>\n</onshore-form-item-container>\n\n<p-dialog [header]=\"'form.imageControl.uploadImageTitle' | translate\" [(visible)]=\"imageChooserDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\" appendTo=\"body\">\n <onshore-image-chooser\n (choosen)=\"getFileImage($event)\"\n (canceled)=\"imageChooserDialogVisible = false\"\n [imageSettings]=\"imageSettings\">\n </onshore-image-chooser>\n</p-dialog>\n\n<p-dialog [header]=\"'form.imageControl.webacmImageTitle' | translate\" [(visible)]=\"webcamDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\" appendTo=\"body\">\n <onshore-webcam\n *ngIf=\"webcamDialogVisible\"\n (shot)=\"getWebcamImage($event)\"\n (canceled)=\"webcamDialogVisible = false\"\n [imageSettings]=\"imageSettings\"></onshore-webcam>\n</p-dialog>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: FluidModule }, { kind: "component", type: i4.Fluid, selector: "p-fluid" }, { kind: "component", type: OnshoreImagePlaceholderComponent, selector: "onshore-image-placeholder", inputs: ["placeholderIcon", "placeholderImage", "image", "imageStyle", "placeholderStyle", "showLoader"] }, { kind: "component", type: OnshoreImageChooserComponent, selector: "onshore-image-chooser", inputs: ["imageSettings"], outputs: ["choosen", "canceled"] }, { kind: "component", type: WebcamComponent, selector: "onshore-webcam", inputs: ["imageSettings"], outputs: ["shot", "canceled"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i5$1.Dialog, selector: "p-dialog", inputs: ["hostName", "header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "maskMotionOptions", "motionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1198
1322
|
}
|
|
1199
1323
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormImageItemComponent, decorators: [{
|
|
1200
1324
|
type: Component,
|
|
1201
|
-
args: [{ selector: 'onshore-form-image-item', imports: [CommonModule, OnshoreFormItemContainer, FluidModule, OnshoreImagePlaceholderComponent, OnshoreImageChooserComponent, WebcamComponent, TranslateModule, ButtonModule, DialogModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\" [hidden]=\"
|
|
1325
|
+
args: [{ selector: 'onshore-form-image-item', imports: [CommonModule, OnshoreFormItemContainer, FluidModule, OnshoreImagePlaceholderComponent, OnshoreImageChooserComponent, WebcamComponent, TranslateModule, ButtonModule, DialogModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\" [hidden]=\"exclude\">\n <div class=\"w-full flex align-items-center gap-2\" [class.flex-column]=\"formTemplate.layout === OnshoreFormTemplateLayout.vertical\">\n\n <div class=\"border-solid border-1 border-300 border-round-md overflow-hidden\"\n [style]=\"'background-color: white; width: ' + imageSettings.containerWidth + 'px; height: ' + imageSettings.containerHeight + 'px'\">\n <onshore-image-placeholder\n class=\"w-full\"\n [image]=\"image\"\n [imageStyle]=\"'width: 100%; height: 100%'\"\n [placeholderIcon]=\"imageSettings.placeholderIcon\"\n [placeholderImage]=\"imageSettings.placeholderImage\"\n [placeholderStyle]=\"'width: 100%; height: 100%'\">\n </onshore-image-placeholder>\n </div>\n\n <div>\n <p-fluid class=\"flex flex-column\">\n <p-button *ngIf=\"imageSettings.imageSelectionEnabled\"\n [severity]=\"'secondary'\"\n icon=\"fa fa-image\"\n [label]=\"'form.imageControl.uploadImageButton' | translate\"\n class=\"mb-2 w-full\"\n [disabled]=\"disabled\"\n (click)=\"imageChooserDialogVisible = true; cdr.detectChanges()\">\n </p-button>\n\n <p-button *ngIf=\"imageSettings.webcamSelectionEnabled\"\n [severity]=\"'secondary'\"\n icon=\"fa fa-camera\"\n [label]=\"'form.imageControl.webcamImageButton' | translate\"\n class=\"mb-2 w-full\"\n [disabled]=\"disabled\"\n (click)=\"webcamDialogVisible = true\">\n </p-button>\n\n <p-button *ngIf=\"imageSettings.mediaSelectionEnabled\"\n [severity]=\"'secondary'\"\n icon=\"fa fa-photo-video\"\n [label]=\"'form.imageControl.mediaImageButton' | translate\"\n class=\"mb-2 w-full\"\n [disabled]=\"disabled\"\n (click)=\"selectFromMedia.emit()\">\n </p-button>\n\n <p-button *ngIf=\"imageSettings.deleteEnabled\"\n [severity]=\"'secondary'\"\n icon=\"fa fa-eraser\"\n [label]=\"'form.imageControl.removeImageButton' | translate\"\n (click)=\"removeImage()\"\n class=\"w-full\"\n [disabled]=\"!image || disabled\">\n </p-button>\n </p-fluid>\n </div>\n\n </div>\n</onshore-form-item-container>\n\n<p-dialog [header]=\"'form.imageControl.uploadImageTitle' | translate\" [(visible)]=\"imageChooserDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\" appendTo=\"body\">\n <onshore-image-chooser\n (choosen)=\"getFileImage($event)\"\n (canceled)=\"imageChooserDialogVisible = false\"\n [imageSettings]=\"imageSettings\">\n </onshore-image-chooser>\n</p-dialog>\n\n<p-dialog [header]=\"'form.imageControl.webacmImageTitle' | translate\" [(visible)]=\"webcamDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\" appendTo=\"body\">\n <onshore-webcam\n *ngIf=\"webcamDialogVisible\"\n (shot)=\"getWebcamImage($event)\"\n (canceled)=\"webcamDialogVisible = false\"\n [imageSettings]=\"imageSettings\"></onshore-webcam>\n</p-dialog>\n" }]
|
|
1202
1326
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.NgControl, decorators: [{
|
|
1203
1327
|
type: Self
|
|
1204
1328
|
}, {
|
|
@@ -1209,7 +1333,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
1209
1333
|
type: Input
|
|
1210
1334
|
}], actionButtonDisabled: [{
|
|
1211
1335
|
type: Input
|
|
1212
|
-
}],
|
|
1336
|
+
}], exclude: [{
|
|
1213
1337
|
type: Input
|
|
1214
1338
|
}], imageDeleted: [{
|
|
1215
1339
|
type: Output
|
|
@@ -1336,7 +1460,7 @@ class OnshoreFormSwitchItemComponent {
|
|
|
1336
1460
|
cdr;
|
|
1337
1461
|
formTemplate;
|
|
1338
1462
|
actionButtonDisabled = false;
|
|
1339
|
-
|
|
1463
|
+
exclude = false;
|
|
1340
1464
|
valueChange = new EventEmitter();
|
|
1341
1465
|
actionButtonClick = new EventEmitter();
|
|
1342
1466
|
disabled = false;
|
|
@@ -1359,7 +1483,25 @@ class OnshoreFormSwitchItemComponent {
|
|
|
1359
1483
|
this.cdr.markForCheck();
|
|
1360
1484
|
}
|
|
1361
1485
|
}
|
|
1486
|
+
checkExclude() {
|
|
1487
|
+
setTimeout(() => {
|
|
1488
|
+
if (this.exclude) {
|
|
1489
|
+
this.ngControl.control?.disable();
|
|
1490
|
+
}
|
|
1491
|
+
else {
|
|
1492
|
+
this.ngControl.control?.enable();
|
|
1493
|
+
}
|
|
1494
|
+
this.ngControl.control?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
|
|
1495
|
+
this.cdr.markForCheck();
|
|
1496
|
+
}, 10);
|
|
1497
|
+
}
|
|
1498
|
+
ngAfterViewInit() {
|
|
1499
|
+
this.checkExclude();
|
|
1500
|
+
}
|
|
1362
1501
|
ngOnChanges(changes) {
|
|
1502
|
+
if (changes['exclude']) {
|
|
1503
|
+
this.checkExclude();
|
|
1504
|
+
}
|
|
1363
1505
|
this.cdr.markForCheck();
|
|
1364
1506
|
}
|
|
1365
1507
|
ngOnDestroy() {
|
|
@@ -1371,11 +1513,11 @@ class OnshoreFormSwitchItemComponent {
|
|
|
1371
1513
|
this.ngControl.valueAccessor = this;
|
|
1372
1514
|
}
|
|
1373
1515
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormSwitchItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1374
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormSwitchItemComponent, isStandalone: true, selector: "onshore-form-switch-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled",
|
|
1516
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormSwitchItemComponent, isStandalone: true, selector: "onshore-form-switch-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled", exclude: "exclude" }, outputs: { valueChange: "valueChange", actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n <div class=\"h-full align-items-center mt-1\">\n <p-toggleswitch [name]=\"formTemplate.name\"\n [formControl]=\"formControl\"\n [disabled]=\"disabled\"\n [inputId]=\"formTemplate.name\">\n </p-toggleswitch>\n </div>\n\n</onshore-form-item-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: ToggleSwitchModule }, { kind: "component", type: i2$5.ToggleSwitch, selector: "p-toggleswitch, p-toggleSwitch, p-toggle-switch", inputs: ["styleClass", "tabindex", "inputId", "readonly", "trueValue", "falseValue", "ariaLabel", "size", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1375
1517
|
}
|
|
1376
1518
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormSwitchItemComponent, decorators: [{
|
|
1377
1519
|
type: Component,
|
|
1378
|
-
args: [{ selector: 'onshore-form-switch-item', imports: [CommonModule, OnshoreFormItemContainer, TranslateModule, ToggleSwitchModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"
|
|
1520
|
+
args: [{ selector: 'onshore-form-switch-item', imports: [CommonModule, OnshoreFormItemContainer, TranslateModule, ToggleSwitchModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n <div class=\"h-full align-items-center mt-1\">\n <p-toggleswitch [name]=\"formTemplate.name\"\n [formControl]=\"formControl\"\n [disabled]=\"disabled\"\n [inputId]=\"formTemplate.name\">\n </p-toggleswitch>\n </div>\n\n</onshore-form-item-container>\n" }]
|
|
1379
1521
|
}], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
|
|
1380
1522
|
type: Self
|
|
1381
1523
|
}, {
|
|
@@ -1384,7 +1526,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
1384
1526
|
type: Input
|
|
1385
1527
|
}], actionButtonDisabled: [{
|
|
1386
1528
|
type: Input
|
|
1387
|
-
}],
|
|
1529
|
+
}], exclude: [{
|
|
1388
1530
|
type: Input
|
|
1389
1531
|
}], valueChange: [{
|
|
1390
1532
|
type: Output
|
|
@@ -1397,7 +1539,7 @@ class OnshoreFormDatetimeItemComponent {
|
|
|
1397
1539
|
cdr;
|
|
1398
1540
|
formTemplate;
|
|
1399
1541
|
actionButtonDisabled = false;
|
|
1400
|
-
|
|
1542
|
+
exclude = false;
|
|
1401
1543
|
actionButtonClick = new EventEmitter();
|
|
1402
1544
|
dateFormat = 'dd.mm.yy';
|
|
1403
1545
|
hourFormat = '24';
|
|
@@ -1420,7 +1562,25 @@ class OnshoreFormDatetimeItemComponent {
|
|
|
1420
1562
|
this.cdr.markForCheck();
|
|
1421
1563
|
}
|
|
1422
1564
|
}
|
|
1565
|
+
checkExclude() {
|
|
1566
|
+
setTimeout(() => {
|
|
1567
|
+
if (this.exclude) {
|
|
1568
|
+
this.ngControl.control?.disable();
|
|
1569
|
+
}
|
|
1570
|
+
else {
|
|
1571
|
+
this.ngControl.control?.enable();
|
|
1572
|
+
}
|
|
1573
|
+
this.ngControl.control?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
|
|
1574
|
+
this.cdr.markForCheck();
|
|
1575
|
+
}, 10);
|
|
1576
|
+
}
|
|
1577
|
+
ngAfterViewInit() {
|
|
1578
|
+
this.checkExclude();
|
|
1579
|
+
}
|
|
1423
1580
|
ngOnChanges(changes) {
|
|
1581
|
+
if (changes['exclude']) {
|
|
1582
|
+
this.checkExclude();
|
|
1583
|
+
}
|
|
1424
1584
|
this.cdr.markForCheck();
|
|
1425
1585
|
}
|
|
1426
1586
|
ngOnDestroy() {
|
|
@@ -1432,11 +1592,11 @@ class OnshoreFormDatetimeItemComponent {
|
|
|
1432
1592
|
this.ngControl.valueAccessor = this;
|
|
1433
1593
|
}
|
|
1434
1594
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormDatetimeItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1435
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormDatetimeItemComponent, isStandalone: true, selector: "onshore-form-datetime-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled",
|
|
1595
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormDatetimeItemComponent, isStandalone: true, selector: "onshore-form-datetime-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled", exclude: "exclude", dateFormat: "dateFormat", hourFormat: "hourFormat", dataType: "dataType" }, outputs: { actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n <p-fluid>\n <p-datePicker class=\"w-full\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [disabled]=\"disabled\"\n [formControl]=\"formControl\"\n [dateFormat]=\"dateFormat\"\n [dataType]=\"dataType\"\n [hourFormat]=\"hourFormat\"\n [timeOnly]=\"formTemplate.type == OnshoreFormTemplateType.time\"\n [showTime]=\"formTemplate.type == OnshoreFormTemplateType.datetime\"\n [defaultDate]=\"formTemplate.default\"\n appendTo=\"body\">\n </p-datePicker>\n </p-fluid>\n</onshore-form-item-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "component", type: DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FluidModule }, { kind: "component", type: i4.Fluid, selector: "p-fluid" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1436
1596
|
}
|
|
1437
1597
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormDatetimeItemComponent, decorators: [{
|
|
1438
1598
|
type: Component,
|
|
1439
|
-
args: [{ selector: 'onshore-form-datetime-item', imports: [CommonModule, OnshoreFormItemContainer, DatePicker, FormsModule, ReactiveFormsModule, FluidModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"
|
|
1599
|
+
args: [{ selector: 'onshore-form-datetime-item', imports: [CommonModule, OnshoreFormItemContainer, DatePicker, FormsModule, ReactiveFormsModule, FluidModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n <p-fluid>\n <p-datePicker class=\"w-full\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [disabled]=\"disabled\"\n [formControl]=\"formControl\"\n [dateFormat]=\"dateFormat\"\n [dataType]=\"dataType\"\n [hourFormat]=\"hourFormat\"\n [timeOnly]=\"formTemplate.type == OnshoreFormTemplateType.time\"\n [showTime]=\"formTemplate.type == OnshoreFormTemplateType.datetime\"\n [defaultDate]=\"formTemplate.default\"\n appendTo=\"body\">\n </p-datePicker>\n </p-fluid>\n</onshore-form-item-container>\n" }]
|
|
1440
1600
|
}], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
|
|
1441
1601
|
type: Self
|
|
1442
1602
|
}, {
|
|
@@ -1445,7 +1605,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
1445
1605
|
type: Input
|
|
1446
1606
|
}], actionButtonDisabled: [{
|
|
1447
1607
|
type: Input
|
|
1448
|
-
}],
|
|
1608
|
+
}], exclude: [{
|
|
1449
1609
|
type: Input
|
|
1450
1610
|
}], actionButtonClick: [{
|
|
1451
1611
|
type: Output
|
|
@@ -1462,7 +1622,7 @@ class OnshoreFormSortItemComponent {
|
|
|
1462
1622
|
cdr;
|
|
1463
1623
|
formTemplate;
|
|
1464
1624
|
actionButtonDisabled = false;
|
|
1465
|
-
|
|
1625
|
+
exclude = false;
|
|
1466
1626
|
actionButtonClick = new EventEmitter();
|
|
1467
1627
|
sortItems = [];
|
|
1468
1628
|
tempLockValue = [];
|
|
@@ -1513,7 +1673,25 @@ class OnshoreFormSortItemComponent {
|
|
|
1513
1673
|
}
|
|
1514
1674
|
this.cdr.markForCheck();
|
|
1515
1675
|
}
|
|
1676
|
+
checkExclude() {
|
|
1677
|
+
setTimeout(() => {
|
|
1678
|
+
if (this.exclude) {
|
|
1679
|
+
this.ngControl.control?.disable();
|
|
1680
|
+
}
|
|
1681
|
+
else {
|
|
1682
|
+
this.ngControl.control?.enable();
|
|
1683
|
+
}
|
|
1684
|
+
this.ngControl.control?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
|
|
1685
|
+
this.cdr.markForCheck();
|
|
1686
|
+
}, 10);
|
|
1687
|
+
}
|
|
1688
|
+
ngAfterViewInit() {
|
|
1689
|
+
this.checkExclude();
|
|
1690
|
+
}
|
|
1516
1691
|
ngOnChanges(changes) {
|
|
1692
|
+
if (changes['exclude']) {
|
|
1693
|
+
this.checkExclude();
|
|
1694
|
+
}
|
|
1517
1695
|
this.cdr.markForCheck();
|
|
1518
1696
|
}
|
|
1519
1697
|
ngOnDestroy() {
|
|
@@ -1525,11 +1703,11 @@ class OnshoreFormSortItemComponent {
|
|
|
1525
1703
|
this.ngControl.valueAccessor = this;
|
|
1526
1704
|
}
|
|
1527
1705
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormSortItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1528
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormSortItemComponent, isStandalone: true, selector: "onshore-form-sort-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled",
|
|
1706
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormSortItemComponent, isStandalone: true, selector: "onshore-form-sort-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled", exclude: "exclude" }, outputs: { actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n (lockIsChanged)=\"lockChanged($event)\"\n [hidden]=\"exclude\">\n\n <!--<div *ngIf=\"formTemplate.type == OnshoreFormTemplateType.sort\"\n class=\"w-full\" [dragula]=\"ngControl.enabled\"\n [dragulaModel]=\"sortItems\"\n (dragulaModelChange)=\"sortItemsChanged($event)\">\n <div [class.cursor-move]=\"ngControl.enabled\"\n style=\"border-radius: 3px\"\n class=\"onshore-sort-item flex justify-content-between align-items-center onshore-border-gray-4 border-solid border-1 p-2 mb-2 onshore-background-color-white\" *ngFor=\"let item of sortItems\">\n <span [class.onshore-color-blocked]=\"!ngControl.enabled\">{{ item.label }}</span>\n <i [class.onshore-color-blocked]=\"!ngControl.enabled\" class=\"fa fa-arrows-v\"></i>\n </div>\n </div>-->\n\n</onshore-form-item-container>\n\n", styles: ["onshore-form-sort-item .onshore-sort-item{font-family:Lato-Regular!important}.gu-mirror{position:fixed!important;margin:0!important;z-index:9999!important;opacity:.8;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)\";filter:alpha(opacity=80);pointer-events:none;font-family:Lato-Regular!important}.gu-hide{left:-9999px!important}.gu-unselectable{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.gu-transit{opacity:.2;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)\";filter:alpha(opacity=20)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1529
1707
|
}
|
|
1530
1708
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormSortItemComponent, decorators: [{
|
|
1531
1709
|
type: Component,
|
|
1532
|
-
args: [{ selector: 'onshore-form-sort-item', imports: [CommonModule, OnshoreFormItemContainer, TranslateModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n (lockIsChanged)=\"lockChanged($event)\"\n [hidden]=\"
|
|
1710
|
+
args: [{ selector: 'onshore-form-sort-item', imports: [CommonModule, OnshoreFormItemContainer, TranslateModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n (lockIsChanged)=\"lockChanged($event)\"\n [hidden]=\"exclude\">\n\n <!--<div *ngIf=\"formTemplate.type == OnshoreFormTemplateType.sort\"\n class=\"w-full\" [dragula]=\"ngControl.enabled\"\n [dragulaModel]=\"sortItems\"\n (dragulaModelChange)=\"sortItemsChanged($event)\">\n <div [class.cursor-move]=\"ngControl.enabled\"\n style=\"border-radius: 3px\"\n class=\"onshore-sort-item flex justify-content-between align-items-center onshore-border-gray-4 border-solid border-1 p-2 mb-2 onshore-background-color-white\" *ngFor=\"let item of sortItems\">\n <span [class.onshore-color-blocked]=\"!ngControl.enabled\">{{ item.label }}</span>\n <i [class.onshore-color-blocked]=\"!ngControl.enabled\" class=\"fa fa-arrows-v\"></i>\n </div>\n </div>-->\n\n</onshore-form-item-container>\n\n", styles: ["onshore-form-sort-item .onshore-sort-item{font-family:Lato-Regular!important}.gu-mirror{position:fixed!important;margin:0!important;z-index:9999!important;opacity:.8;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)\";filter:alpha(opacity=80);pointer-events:none;font-family:Lato-Regular!important}.gu-hide{left:-9999px!important}.gu-unselectable{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.gu-transit{opacity:.2;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)\";filter:alpha(opacity=20)}\n"] }]
|
|
1533
1711
|
}], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
|
|
1534
1712
|
type: Self
|
|
1535
1713
|
}, {
|
|
@@ -1538,7 +1716,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
1538
1716
|
type: Input
|
|
1539
1717
|
}], actionButtonDisabled: [{
|
|
1540
1718
|
type: Input
|
|
1541
|
-
}],
|
|
1719
|
+
}], exclude: [{
|
|
1542
1720
|
type: Input
|
|
1543
1721
|
}], actionButtonClick: [{
|
|
1544
1722
|
type: Output
|
|
@@ -1557,7 +1735,7 @@ class OnshoreFormScannerItemComponent {
|
|
|
1557
1735
|
integerOnly = true;
|
|
1558
1736
|
autofocus = false;
|
|
1559
1737
|
length = 4;
|
|
1560
|
-
|
|
1738
|
+
exclude = false;
|
|
1561
1739
|
actionButtonClick = new EventEmitter();
|
|
1562
1740
|
webcamClick = new EventEmitter();
|
|
1563
1741
|
scannerClick = new EventEmitter();
|
|
@@ -1584,7 +1762,25 @@ class OnshoreFormScannerItemComponent {
|
|
|
1584
1762
|
ngOnDestroy() {
|
|
1585
1763
|
this.ngControl.control?.disable();
|
|
1586
1764
|
}
|
|
1765
|
+
checkExclude() {
|
|
1766
|
+
setTimeout(() => {
|
|
1767
|
+
if (this.exclude) {
|
|
1768
|
+
this.ngControl.control?.disable();
|
|
1769
|
+
}
|
|
1770
|
+
else {
|
|
1771
|
+
this.ngControl.control?.enable();
|
|
1772
|
+
}
|
|
1773
|
+
this.ngControl.control?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
|
|
1774
|
+
this.cdr.markForCheck();
|
|
1775
|
+
}, 10);
|
|
1776
|
+
}
|
|
1777
|
+
ngAfterViewInit() {
|
|
1778
|
+
this.checkExclude();
|
|
1779
|
+
}
|
|
1587
1780
|
ngOnChanges(changes) {
|
|
1781
|
+
if (changes['exclude']) {
|
|
1782
|
+
this.checkExclude();
|
|
1783
|
+
}
|
|
1588
1784
|
this.cdr.markForCheck();
|
|
1589
1785
|
}
|
|
1590
1786
|
constructor(ngControl, cdr) {
|
|
@@ -1594,11 +1790,11 @@ class OnshoreFormScannerItemComponent {
|
|
|
1594
1790
|
}
|
|
1595
1791
|
OnshoreFormTemplateType = OnshoreFormTemplateType;
|
|
1596
1792
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormScannerItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1597
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormScannerItemComponent, isStandalone: true, selector: "onshore-form-scanner-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled", webcamDisabled: "webcamDisabled", scannerDisabled: "scannerDisabled", editDisabled: "editDisabled", editable: "editable", integerOnly: "integerOnly", autofocus: "autofocus", length: "length",
|
|
1793
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: OnshoreFormScannerItemComponent, isStandalone: true, selector: "onshore-form-scanner-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled", webcamDisabled: "webcamDisabled", scannerDisabled: "scannerDisabled", editDisabled: "editDisabled", editable: "editable", integerOnly: "integerOnly", autofocus: "autofocus", length: "length", exclude: "exclude" }, outputs: { actionButtonClick: "actionButtonClick", webcamClick: "webcamClick", scannerClick: "scannerClick" }, viewQueries: [{ propertyName: "scanPopover", first: true, predicate: ["scanPopover"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n\n <div class=\"flex gap-2\">\n <p-inputOtp [formControl]=\"formControl\"\n [disabled]=\"disabled || !editable\"\n [integerOnly]=\"integerOnly\"\n [length]=\"length\"\n [autofocus]=\"autofocus\">\n </p-inputOtp>\n\n <p-button *ngIf=\"!scannerDisabled\" (click)=\"scanPopover.toggle($event); webcamClick.emit()\" icon=\"fa fa-qrcode\" severity=\"secondary\" label=\"{{ 'form.scannerControl.labelScanner' | translate }}\" />\n <p-button *ngIf=\"!webcamDisabled\" (click)=\"scannerClick.emit()\" icon=\"fa fa-video\" severity=\"secondary\" label=\"{{ 'form.scannerControl.labelWebcam' | translate }}\" />\n <p-button *ngIf=\"!editDisabled\" icon=\"fa fa-pen\" severity=\"secondary\" (click)=\"editable = true\" label=\"{{ 'form.scannerControl.labelInput' | translate }}\" />\n </div>\n\n</onshore-form-item-container>\n\n<p-popover #scanPopover>\n <div class=\"flex flex-column justify-content-center align-items-center gap-2\">\n <i *ngIf=\"!ngControl.control?.value\" class=\"fa fa-qrcode fa-2x\"></i>\n <span *ngIf=\"!ngControl.control?.value\">{{'form.scannerControl.startScanLabel' | translate}}</span>\n <p-chip *ngIf=\"ngControl.control?.value\" [label]=\"ngControl.control?.value\" icon=\"fa fa fa-qrcode\" />\n </div>\n</p-popover>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: ChipModule }, { kind: "component", type: i3$5.Chip, selector: "p-chip", inputs: ["label", "icon", "image", "alt", "styleClass", "disabled", "removable", "removeIcon", "chipProps"], outputs: ["onRemove", "onImageError"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i4$4.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: InputOtpModule }, { kind: "component", type: i5$2.InputOtp, selector: "p-inputOtp, p-inputotp, p-input-otp", inputs: ["readonly", "tabindex", "length", "styleClass", "mask", "integerOnly", "autofocus", "variant", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1598
1794
|
}
|
|
1599
1795
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OnshoreFormScannerItemComponent, decorators: [{
|
|
1600
1796
|
type: Component,
|
|
1601
|
-
args: [{ selector: 'onshore-form-scanner-item', imports: [CommonModule, TranslateModule, OnshoreFormItemContainer, ChipModule, PopoverModule, FormsModule, ReactiveFormsModule, InputOtpModule, ButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"
|
|
1797
|
+
args: [{ selector: 'onshore-form-scanner-item', imports: [CommonModule, TranslateModule, OnshoreFormItemContainer, ChipModule, PopoverModule, FormsModule, ReactiveFormsModule, InputOtpModule, ButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n [hidden]=\"exclude\">\n\n <div class=\"flex gap-2\">\n <p-inputOtp [formControl]=\"formControl\"\n [disabled]=\"disabled || !editable\"\n [integerOnly]=\"integerOnly\"\n [length]=\"length\"\n [autofocus]=\"autofocus\">\n </p-inputOtp>\n\n <p-button *ngIf=\"!scannerDisabled\" (click)=\"scanPopover.toggle($event); webcamClick.emit()\" icon=\"fa fa-qrcode\" severity=\"secondary\" label=\"{{ 'form.scannerControl.labelScanner' | translate }}\" />\n <p-button *ngIf=\"!webcamDisabled\" (click)=\"scannerClick.emit()\" icon=\"fa fa-video\" severity=\"secondary\" label=\"{{ 'form.scannerControl.labelWebcam' | translate }}\" />\n <p-button *ngIf=\"!editDisabled\" icon=\"fa fa-pen\" severity=\"secondary\" (click)=\"editable = true\" label=\"{{ 'form.scannerControl.labelInput' | translate }}\" />\n </div>\n\n</onshore-form-item-container>\n\n<p-popover #scanPopover>\n <div class=\"flex flex-column justify-content-center align-items-center gap-2\">\n <i *ngIf=\"!ngControl.control?.value\" class=\"fa fa-qrcode fa-2x\"></i>\n <span *ngIf=\"!ngControl.control?.value\">{{'form.scannerControl.startScanLabel' | translate}}</span>\n <p-chip *ngIf=\"ngControl.control?.value\" [label]=\"ngControl.control?.value\" icon=\"fa fa fa-qrcode\" />\n </div>\n</p-popover>\n" }]
|
|
1602
1798
|
}], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
|
|
1603
1799
|
type: Self
|
|
1604
1800
|
}, {
|
|
@@ -1624,7 +1820,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
1624
1820
|
type: Input
|
|
1625
1821
|
}], length: [{
|
|
1626
1822
|
type: Input
|
|
1627
|
-
}],
|
|
1823
|
+
}], exclude: [{
|
|
1628
1824
|
type: Input
|
|
1629
1825
|
}], actionButtonClick: [{
|
|
1630
1826
|
type: Output
|