@valtimo/components 10.8.0 → 10.8.2
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/esm2020/lib/components/dropzone/dropzone.component.mjs +18 -5
- package/esm2020/lib/components/form-io/documenten-api-uploader/documenten-api-uploader-edit-form.mjs +11 -1
- package/esm2020/lib/components/form-io/documenten-api-uploader/documenten-api-uploader.formio.mjs +4 -2
- package/esm2020/lib/components/form-io/form-io-uploader/form-io-uploader-edit-form.mjs +11 -1
- package/esm2020/lib/components/form-io/form-io-uploader/form-io-uploader.formio.mjs +3 -4
- package/esm2020/lib/components/form-io/form-io.component.mjs +68 -36
- package/fesm2015/valtimo-components.mjs +105 -41
- package/fesm2015/valtimo-components.mjs.map +1 -1
- package/fesm2020/valtimo-components.mjs +106 -41
- package/fesm2020/valtimo-components.mjs.map +1 -1
- package/lib/components/dropzone/dropzone.component.d.ts +5 -2
- package/lib/components/dropzone/dropzone.component.d.ts.map +1 -1
- package/lib/components/form-io/documenten-api-uploader/documenten-api-uploader-edit-form.d.ts +10 -10
- package/lib/components/form-io/documenten-api-uploader/documenten-api-uploader-edit-form.d.ts.map +1 -1
- package/lib/components/form-io/documenten-api-uploader/documenten-api-uploader.formio.d.ts.map +1 -1
- package/lib/components/form-io/form-io-uploader/form-io-uploader-edit-form.d.ts +9 -9
- package/lib/components/form-io/form-io-uploader/form-io-uploader-edit-form.d.ts.map +1 -1
- package/lib/components/form-io/form-io-uploader/form-io-uploader.formio.d.ts.map +1 -1
- package/lib/components/form-io/form-io.component.d.ts +19 -13
- package/lib/components/form-io/form-io.component.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -4872,47 +4872,58 @@ class FormioComponent {
|
|
|
4872
4872
|
this.route = route;
|
|
4873
4873
|
this.translateService = translateService;
|
|
4874
4874
|
this.modalService = modalService;
|
|
4875
|
-
this.submission = {};
|
|
4876
4875
|
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
4877
4876
|
this.submit = new EventEmitter();
|
|
4878
4877
|
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
4879
4878
|
this.change = new EventEmitter();
|
|
4880
4879
|
this.refreshForm = new EventEmitter();
|
|
4881
|
-
this.
|
|
4880
|
+
this.submission$ = new BehaviorSubject(undefined);
|
|
4881
|
+
this.form$ = new BehaviorSubject(undefined);
|
|
4882
|
+
this.options$ = new BehaviorSubject(undefined);
|
|
4883
|
+
this.readOnly$ = new BehaviorSubject(false);
|
|
4884
|
+
this.errors$ = new BehaviorSubject([]);
|
|
4882
4885
|
this.currentLanguage$ = this.translateService.stream('key').pipe(map$1(() => this.translateService.currentLang), distinctUntilChanged());
|
|
4883
|
-
this.formioOptions$ =
|
|
4886
|
+
this.formioOptions$ = combineLatest([
|
|
4887
|
+
this.currentLanguage$,
|
|
4888
|
+
this.options$,
|
|
4889
|
+
]).pipe(map$1(([language, options]) => {
|
|
4884
4890
|
const formioTranslations = this.translateService.instant('formioTranslations');
|
|
4885
4891
|
return typeof formioTranslations === 'object'
|
|
4886
4892
|
? {
|
|
4887
|
-
...
|
|
4888
|
-
language,
|
|
4893
|
+
...options,
|
|
4889
4894
|
i18n: {
|
|
4890
4895
|
[language]: this.stateService.flattenTranslationsObject(formioTranslations),
|
|
4891
4896
|
},
|
|
4897
|
+
language,
|
|
4892
4898
|
}
|
|
4893
|
-
:
|
|
4899
|
+
: {
|
|
4900
|
+
...options,
|
|
4901
|
+
language,
|
|
4902
|
+
};
|
|
4894
4903
|
}));
|
|
4904
|
+
this._subscriptions = new Subscription();
|
|
4905
|
+
}
|
|
4906
|
+
set options(optionsValue) {
|
|
4907
|
+
this.options$.next(optionsValue);
|
|
4908
|
+
}
|
|
4909
|
+
set submission(submissionValue) {
|
|
4910
|
+
this.submission$.next(submissionValue);
|
|
4911
|
+
}
|
|
4912
|
+
set form(formValue) {
|
|
4913
|
+
this.form$.next(formValue);
|
|
4914
|
+
}
|
|
4915
|
+
set readOnly(readOnlyValue) {
|
|
4916
|
+
this.readOnly$.next(readOnlyValue);
|
|
4895
4917
|
}
|
|
4896
4918
|
ngOnInit() {
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
this.formDefinition = this.form;
|
|
4900
|
-
this.errors = [];
|
|
4919
|
+
this.openRouteSubscription();
|
|
4920
|
+
this.errors$.next([]);
|
|
4901
4921
|
this.setInitialToken();
|
|
4902
|
-
if (documentDefinitionName) {
|
|
4903
|
-
this.stateService.setDocumentDefinitionName(documentDefinitionName);
|
|
4904
|
-
}
|
|
4905
|
-
if (documentId) {
|
|
4906
|
-
this.stateService.setDocumentId(documentId);
|
|
4907
|
-
}
|
|
4908
4922
|
this.subscribeFormRefresh();
|
|
4923
|
+
this.openReloadFormSubscription();
|
|
4924
|
+
this.openReloadSubmissionSubscription();
|
|
4909
4925
|
}
|
|
4910
4926
|
ngOnChanges(changes) {
|
|
4911
|
-
const currentForm = changes?.form?.currentValue;
|
|
4912
|
-
if (currentForm) {
|
|
4913
|
-
this.formDefinition = currentForm;
|
|
4914
|
-
this.reloadForm();
|
|
4915
|
-
}
|
|
4916
4927
|
this.setInitialToken();
|
|
4917
4928
|
if (changes.formDefinitionRefresh$) {
|
|
4918
4929
|
this.unsubscribeFormRefresh();
|
|
@@ -4922,21 +4933,16 @@ class FormioComponent {
|
|
|
4922
4933
|
ngOnDestroy() {
|
|
4923
4934
|
this.unsubscribeFormRefresh();
|
|
4924
4935
|
this.tokenRefreshTimerSubscription?.unsubscribe();
|
|
4925
|
-
|
|
4926
|
-
reloadForm() {
|
|
4927
|
-
this.refreshForm.emit({
|
|
4928
|
-
form: this.formDefinition,
|
|
4929
|
-
});
|
|
4936
|
+
this._subscriptions.unsubscribe();
|
|
4930
4937
|
}
|
|
4931
4938
|
showErrors(errors) {
|
|
4932
|
-
this.errors
|
|
4939
|
+
this.errors$.next(errors);
|
|
4933
4940
|
}
|
|
4934
4941
|
onSubmit(submission) {
|
|
4935
|
-
this.errors
|
|
4942
|
+
this.errors$.next([]);
|
|
4936
4943
|
this.submit.emit(submission);
|
|
4937
4944
|
}
|
|
4938
4945
|
formReady(form) {
|
|
4939
|
-
this.reloadForm();
|
|
4940
4946
|
this.stateService.currentForm = form;
|
|
4941
4947
|
}
|
|
4942
4948
|
onChange(object) {
|
|
@@ -4948,6 +4954,20 @@ class FormioComponent {
|
|
|
4948
4954
|
prevPage() {
|
|
4949
4955
|
this.scrollToTop();
|
|
4950
4956
|
}
|
|
4957
|
+
openReloadFormSubscription() {
|
|
4958
|
+
this._subscriptions.add(this.form$.subscribe(form => {
|
|
4959
|
+
this.refreshForm.emit({
|
|
4960
|
+
form,
|
|
4961
|
+
});
|
|
4962
|
+
}));
|
|
4963
|
+
}
|
|
4964
|
+
openReloadSubmissionSubscription() {
|
|
4965
|
+
this._subscriptions.add(this.submission$.subscribe(submission => {
|
|
4966
|
+
this.refreshForm.emit({
|
|
4967
|
+
submission,
|
|
4968
|
+
});
|
|
4969
|
+
}));
|
|
4970
|
+
}
|
|
4951
4971
|
scrollToTop() {
|
|
4952
4972
|
this.modalService.scrollToTop();
|
|
4953
4973
|
}
|
|
@@ -4993,18 +5013,30 @@ class FormioComponent {
|
|
|
4993
5013
|
this.formRefreshSubscription.unsubscribe();
|
|
4994
5014
|
}
|
|
4995
5015
|
}
|
|
5016
|
+
openRouteSubscription() {
|
|
5017
|
+
this._subscriptions.add(this.route.params.subscribe(params => {
|
|
5018
|
+
const documentDefinitionName = params.documentDefinitionName;
|
|
5019
|
+
const documentId = params.documentId;
|
|
5020
|
+
if (documentDefinitionName) {
|
|
5021
|
+
this.stateService.setDocumentDefinitionName(documentDefinitionName);
|
|
5022
|
+
}
|
|
5023
|
+
if (documentId) {
|
|
5024
|
+
this.stateService.setDocumentId(documentId);
|
|
5025
|
+
}
|
|
5026
|
+
}));
|
|
5027
|
+
}
|
|
4996
5028
|
}
|
|
4997
5029
|
FormioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormioComponent, deps: [{ token: i3$1.UserProviderService }, { token: i4.NGXLogger }, { token: FormIoStateService }, { token: i1$1.ActivatedRoute }, { token: i1.TranslateService }, { token: ValtimoModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4998
|
-
FormioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FormioComponent, selector: "valtimo-form-io", inputs: {
|
|
5030
|
+
FormioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FormioComponent, selector: "valtimo-form-io", inputs: { options: "options", submission: "submission", form: "form", readOnly: "readOnly", formRefresh$: "formRefresh$" }, outputs: { submit: "submit", change: "change" }, usesOnChanges: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n *ngIf=\"{\n currentLanguage: currentLanguage$ | async,\n formioOptions: formioOptions$ | async,\n submission: submission$ | async,\n readOnly: readOnly$ | async,\n form: form$ | async,\n errors: errors$ | async\n } as obs\"\n>\n <div *ngIf=\"obs.errors.length > 0\" class=\"alert alert-danger pt-5 pb-5 mb-2\">\n <ol>\n <li *ngFor=\"let error of obs.errors\">\n {{ error }}\n </li>\n </ol>\n </div>\n <formio\n *ngIf=\"obs.formioOptions && obs.form\"\n [submission]=\"obs.submission\"\n [form]=\"obs.form\"\n [refresh]=\"refreshForm\"\n [options]=\"obs.formioOptions\"\n [readOnly]=\"obs.readOnly\"\n (submit)=\"onSubmit($event)\"\n (ready)=\"formReady($event)\"\n (change)=\"onChange($event)\"\n (nextPage)=\"nextPage()\"\n (prevPage)=\"prevPage()\"\n ></formio>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i8.FormioComponent, selector: "formio" }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }] });
|
|
4999
5031
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormioComponent, decorators: [{
|
|
5000
5032
|
type: Component,
|
|
5001
|
-
args: [{ selector: 'valtimo-form-io', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div>\n <div *ngIf=\"errors.length > 0\" class=\"alert alert-danger pt-5 pb-5 mb-2\">\n <ol>\n <li *ngFor=\"let error of errors\">\n {{ error }}\n </li>\n </ol>\n </div>\n <formio\n *ngIf=\"
|
|
5002
|
-
}], ctorParameters: function () { return [{ type: i3$1.UserProviderService }, { type: i4.NGXLogger }, { type: FormIoStateService }, { type: i1$1.ActivatedRoute }, { type: i1.TranslateService }, { type: ValtimoModalService }]; }, propDecorators: {
|
|
5003
|
-
type: Input
|
|
5004
|
-
}], options: [{
|
|
5033
|
+
args: [{ selector: 'valtimo-form-io', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n *ngIf=\"{\n currentLanguage: currentLanguage$ | async,\n formioOptions: formioOptions$ | async,\n submission: submission$ | async,\n readOnly: readOnly$ | async,\n form: form$ | async,\n errors: errors$ | async\n } as obs\"\n>\n <div *ngIf=\"obs.errors.length > 0\" class=\"alert alert-danger pt-5 pb-5 mb-2\">\n <ol>\n <li *ngFor=\"let error of obs.errors\">\n {{ error }}\n </li>\n </ol>\n </div>\n <formio\n *ngIf=\"obs.formioOptions && obs.form\"\n [submission]=\"obs.submission\"\n [form]=\"obs.form\"\n [refresh]=\"refreshForm\"\n [options]=\"obs.formioOptions\"\n [readOnly]=\"obs.readOnly\"\n (submit)=\"onSubmit($event)\"\n (ready)=\"formReady($event)\"\n (change)=\"onChange($event)\"\n (nextPage)=\"nextPage()\"\n (prevPage)=\"prevPage()\"\n ></formio>\n</div>\n" }]
|
|
5034
|
+
}], ctorParameters: function () { return [{ type: i3$1.UserProviderService }, { type: i4.NGXLogger }, { type: FormIoStateService }, { type: i1$1.ActivatedRoute }, { type: i1.TranslateService }, { type: ValtimoModalService }]; }, propDecorators: { options: [{
|
|
5005
5035
|
type: Input
|
|
5006
5036
|
}], submission: [{
|
|
5007
5037
|
type: Input
|
|
5038
|
+
}], form: [{
|
|
5039
|
+
type: Input
|
|
5008
5040
|
}], readOnly: [{
|
|
5009
5041
|
type: Input
|
|
5010
5042
|
}], formRefresh$: [{
|
|
@@ -5271,8 +5303,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
5271
5303
|
* limitations under the License.
|
|
5272
5304
|
*/
|
|
5273
5305
|
class DropzoneComponent {
|
|
5274
|
-
constructor(translateService) {
|
|
5306
|
+
constructor(translateService, renderer, document) {
|
|
5275
5307
|
this.translateService = translateService;
|
|
5308
|
+
this.renderer = renderer;
|
|
5309
|
+
this.document = document;
|
|
5276
5310
|
this.externalError$ = new BehaviorSubject('');
|
|
5277
5311
|
this.maxFileSize = 5;
|
|
5278
5312
|
this.showMaxFileSize = true;
|
|
@@ -5317,6 +5351,7 @@ class DropzoneComponent {
|
|
|
5317
5351
|
}
|
|
5318
5352
|
ngOnDestroy() {
|
|
5319
5353
|
this.clearSubscription.unsubscribe();
|
|
5354
|
+
this.destroyHiddenInputs();
|
|
5320
5355
|
}
|
|
5321
5356
|
showCamera() {
|
|
5322
5357
|
this.showingCamera$.next(true);
|
|
@@ -5361,13 +5396,22 @@ class DropzoneComponent {
|
|
|
5361
5396
|
this.clearError();
|
|
5362
5397
|
this.fileSelected.emit(file);
|
|
5363
5398
|
}
|
|
5399
|
+
destroyHiddenInputs() {
|
|
5400
|
+
const hiddenElements = this.document.getElementsByClassName('dz-hidden-input');
|
|
5401
|
+
Array.from(hiddenElements).forEach(element => {
|
|
5402
|
+
element.remove();
|
|
5403
|
+
});
|
|
5404
|
+
}
|
|
5364
5405
|
}
|
|
5365
|
-
DropzoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DropzoneComponent, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5406
|
+
DropzoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DropzoneComponent, deps: [{ token: i1.TranslateService }, { token: i0.Renderer2 }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
|
|
5366
5407
|
DropzoneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: DropzoneComponent, selector: "valtimo-dropzone", inputs: { title: "title", hideTitle: "hideTitle", subtitle: "subtitle", externalError$: "externalError$", maxFileSize: "maxFileSize", showMaxFileSize: "showMaxFileSize", acceptedFiles: "acceptedFiles", clear$: "clear$", disabled: "disabled", hideFilePreview: "hideFilePreview", uploading: "uploading", camera: "camera", maxFiles: "maxFiles" }, outputs: { fileSelected: "fileSelected" }, viewQueries: [{ propertyName: "dropzoneRef", first: true, predicate: ["dropzone"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<form #dropzone [ngClass]=\"{disabled: disabled || uploading}\" class=\"dropzone dz-clickable\">\n <div class=\"dz-message\">\n <div class=\"icon large-icon\"><span class=\"mdi mdi-cloud-upload\"></span></div>\n <ng-container *ngTemplateOutlet=\"body\"></ng-container>\n <ng-container *ngIf=\"uploading\">\n <ng-container *ngTemplateOutlet=\"progressBar\"></ng-container>\n </ng-container>\n <div class=\"dropzone-mobile-trigger needsclick\"></div>\n </div>\n <button\n (click)=\"showCamera()\"\n *ngIf=\"camera\"\n type=\"button\"\n class=\"btn btn-primary px-3 webcam-button\"\n >\n <i class=\"icon mdi mdi-camera\" aria-hidden=\"true\"></i>\n </button>\n <ng-container *ngIf=\"showingCamera$ | async\">\n <ng-container *ngTemplateOutlet=\"webcam\"></ng-container>\n </ng-container>\n</form>\n\n<ng-template #body>\n <h2 *ngIf=\"!hideTitle\" class=\"mb-4 mt-2\">{{ title || ('dropzone.drop' | translate) }}</h2>\n <span *ngIf=\"subtitle\" class=\"note mb-3\">{{ subtitle }}</span>\n <span *ngIf=\"showMaxFileSize\" class=\"note mb-3 small-font\"\n >{{ 'dropzone.maxFileSize' | translate }}<b>{{ maxFileSize }}mb</b></span\n >\n <ng-container *ngTemplateOutlet=\"preview\"></ng-container>\n</ng-template>\n\n<ng-template #preview>\n <ng-container\n *ngIf=\"{\n errorMessage: errorMessage$ | async,\n externalError: externalError$ | async,\n file: file$ | async\n } as obs\"\n >\n <ng-container *ngIf=\"obs.externalError || obs.errorMessage\">\n <div class=\"alert alert-danger mt-2 mb-0\">\n <div class=\"message\">\n {{ obs.externalError || obs.errorMessage }}\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!hideFilePreview && obs.file && !obs.externalError && !obs.errorMessage\">\n <div class=\"file\">\n <i class=\"icon mdi mdi-file-text mr-2\"></i>\n <span class=\"note\">{{ obs.file.name }}</span>\n <span class=\"note file-size\">- {{ obs.file.size | filesize : 2 }}</span>\n </div>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #progressBar>\n <div class=\"progress-bar-container\">\n <valtimo-progress-bar></valtimo-progress-bar>\n </div>\n</ng-template>\n\n<ng-template #webcam>\n <valtimo-webcam (imageSaved)=\"webcamImageSaved($event)\"></valtimo-webcam>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */form.dropzone{padding:30px 20px}form.dropzone h2{text-align:center;font-size:1.69rem}form.dropzone.disabled{opacity:.7;pointer-events:none;cursor:default}form.dropzone.preview{padding:15px 20px;border:none}.dz-message{display:flex;flex-direction:column;align-items:center}.dropzone-mobile-trigger{cursor:pointer}.alert-light{display:flex;align-items:center}form.dropzone .mdi{background-color:transparent;border-radius:0;display:inline-block;height:auto;width:auto;margin-bottom:0;padding:0}form.dropzone .message{padding:1.385rem 2.1542rem}.file{font-size:1.5rem;display:flex;flex-direction:row;align-items:center}.small-font{font-size:1rem;color:#959595}.file-size{margin-left:5px}.progress-bar-container{height:auto;width:100%;position:absolute;bottom:0}.webcam-button{position:absolute;top:10px;right:10px}.large-icon,.large-icon .mdi{line-height:60px;font-size:60px}\n"], dependencies: [{ kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ProgressBarComponent, selector: "valtimo-progress-bar" }, { kind: "component", type: WebcamComponent, selector: "valtimo-webcam", outputs: ["imageSaved"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: FileSizePipe, name: "filesize" }] });
|
|
5367
5408
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DropzoneComponent, decorators: [{
|
|
5368
5409
|
type: Component,
|
|
5369
5410
|
args: [{ selector: 'valtimo-dropzone', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<form #dropzone [ngClass]=\"{disabled: disabled || uploading}\" class=\"dropzone dz-clickable\">\n <div class=\"dz-message\">\n <div class=\"icon large-icon\"><span class=\"mdi mdi-cloud-upload\"></span></div>\n <ng-container *ngTemplateOutlet=\"body\"></ng-container>\n <ng-container *ngIf=\"uploading\">\n <ng-container *ngTemplateOutlet=\"progressBar\"></ng-container>\n </ng-container>\n <div class=\"dropzone-mobile-trigger needsclick\"></div>\n </div>\n <button\n (click)=\"showCamera()\"\n *ngIf=\"camera\"\n type=\"button\"\n class=\"btn btn-primary px-3 webcam-button\"\n >\n <i class=\"icon mdi mdi-camera\" aria-hidden=\"true\"></i>\n </button>\n <ng-container *ngIf=\"showingCamera$ | async\">\n <ng-container *ngTemplateOutlet=\"webcam\"></ng-container>\n </ng-container>\n</form>\n\n<ng-template #body>\n <h2 *ngIf=\"!hideTitle\" class=\"mb-4 mt-2\">{{ title || ('dropzone.drop' | translate) }}</h2>\n <span *ngIf=\"subtitle\" class=\"note mb-3\">{{ subtitle }}</span>\n <span *ngIf=\"showMaxFileSize\" class=\"note mb-3 small-font\"\n >{{ 'dropzone.maxFileSize' | translate }}<b>{{ maxFileSize }}mb</b></span\n >\n <ng-container *ngTemplateOutlet=\"preview\"></ng-container>\n</ng-template>\n\n<ng-template #preview>\n <ng-container\n *ngIf=\"{\n errorMessage: errorMessage$ | async,\n externalError: externalError$ | async,\n file: file$ | async\n } as obs\"\n >\n <ng-container *ngIf=\"obs.externalError || obs.errorMessage\">\n <div class=\"alert alert-danger mt-2 mb-0\">\n <div class=\"message\">\n {{ obs.externalError || obs.errorMessage }}\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!hideFilePreview && obs.file && !obs.externalError && !obs.errorMessage\">\n <div class=\"file\">\n <i class=\"icon mdi mdi-file-text mr-2\"></i>\n <span class=\"note\">{{ obs.file.name }}</span>\n <span class=\"note file-size\">- {{ obs.file.size | filesize : 2 }}</span>\n </div>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #progressBar>\n <div class=\"progress-bar-container\">\n <valtimo-progress-bar></valtimo-progress-bar>\n </div>\n</ng-template>\n\n<ng-template #webcam>\n <valtimo-webcam (imageSaved)=\"webcamImageSaved($event)\"></valtimo-webcam>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */form.dropzone{padding:30px 20px}form.dropzone h2{text-align:center;font-size:1.69rem}form.dropzone.disabled{opacity:.7;pointer-events:none;cursor:default}form.dropzone.preview{padding:15px 20px;border:none}.dz-message{display:flex;flex-direction:column;align-items:center}.dropzone-mobile-trigger{cursor:pointer}.alert-light{display:flex;align-items:center}form.dropzone .mdi{background-color:transparent;border-radius:0;display:inline-block;height:auto;width:auto;margin-bottom:0;padding:0}form.dropzone .message{padding:1.385rem 2.1542rem}.file{font-size:1.5rem;display:flex;flex-direction:row;align-items:center}.small-font{font-size:1rem;color:#959595}.file-size{margin-left:5px}.progress-bar-container{height:auto;width:100%;position:absolute;bottom:0}.webcam-button{position:absolute;top:10px;right:10px}.large-icon,.large-icon .mdi{line-height:60px;font-size:60px}\n"] }]
|
|
5370
|
-
}], ctorParameters: function () { return [{ type: i1.TranslateService }
|
|
5411
|
+
}], ctorParameters: function () { return [{ type: i1.TranslateService }, { type: i0.Renderer2 }, { type: Document, decorators: [{
|
|
5412
|
+
type: Inject,
|
|
5413
|
+
args: [DOCUMENT]
|
|
5414
|
+
}] }]; }, propDecorators: { dropzoneRef: [{
|
|
5371
5415
|
type: ViewChild,
|
|
5372
5416
|
args: ['dropzone']
|
|
5373
5417
|
}], title: [{
|
|
@@ -6519,6 +6563,16 @@ const formIoUploaderEditForm = () => ({
|
|
|
6519
6563
|
required: true,
|
|
6520
6564
|
},
|
|
6521
6565
|
},
|
|
6566
|
+
{
|
|
6567
|
+
type: 'checkbox',
|
|
6568
|
+
input: true,
|
|
6569
|
+
inputType: 'checkbox',
|
|
6570
|
+
key: 'validate.required',
|
|
6571
|
+
label: 'Required',
|
|
6572
|
+
validate: {
|
|
6573
|
+
required: false,
|
|
6574
|
+
},
|
|
6575
|
+
},
|
|
6522
6576
|
{
|
|
6523
6577
|
type: 'textfield',
|
|
6524
6578
|
input: true,
|
|
@@ -6627,9 +6681,8 @@ function registerFormioUploadComponent(injector) {
|
|
|
6627
6681
|
// override setValue function to allow for setting an array value
|
|
6628
6682
|
class UploaderComponent extends originalUploadComponent {
|
|
6629
6683
|
setValue(value) {
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
componentValue = value;
|
|
6684
|
+
if (this._customAngularElement?.value) {
|
|
6685
|
+
this._customAngularElement.value = value;
|
|
6633
6686
|
}
|
|
6634
6687
|
return true;
|
|
6635
6688
|
}
|
|
@@ -6667,6 +6720,16 @@ const documentenApiUploaderEditForm = () => ({
|
|
|
6667
6720
|
required: true,
|
|
6668
6721
|
},
|
|
6669
6722
|
},
|
|
6723
|
+
{
|
|
6724
|
+
type: 'checkbox',
|
|
6725
|
+
input: true,
|
|
6726
|
+
inputType: 'checkbox',
|
|
6727
|
+
key: 'validate.required',
|
|
6728
|
+
label: 'Required',
|
|
6729
|
+
validate: {
|
|
6730
|
+
required: false,
|
|
6731
|
+
},
|
|
6732
|
+
},
|
|
6670
6733
|
{
|
|
6671
6734
|
type: 'textfield',
|
|
6672
6735
|
input: true,
|
|
@@ -6965,7 +7028,9 @@ function registerDocumentenApiFormioUploadComponent(injector) {
|
|
|
6965
7028
|
// override setValue function to allow for setting an array value
|
|
6966
7029
|
class UploaderComponent extends originalUploadComponent {
|
|
6967
7030
|
setValue(value) {
|
|
6968
|
-
this._customAngularElement
|
|
7031
|
+
if (this._customAngularElement?.value) {
|
|
7032
|
+
this._customAngularElement.value = value;
|
|
7033
|
+
}
|
|
6969
7034
|
return true;
|
|
6970
7035
|
}
|
|
6971
7036
|
}
|