@valtimo/components 13.40.0 → 13.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,11 +51,11 @@ import { trigger, transition, style, animate } from '@angular/animations';
51
51
  import * as i1$6 from '@angular/cdk/overlay';
52
52
  import { OverlayModule, Overlay } from '@angular/cdk/overlay';
53
53
  import Currency from '@tadashi/currency';
54
+ import flatpickr from 'flatpickr';
55
+ import { Dutch } from 'flatpickr/dist/l10n/nl';
54
56
  import * as i2$4 from 'ngx-spinner';
55
57
  import { NgxSpinnerModule } from 'ngx-spinner';
56
58
  import Search16 from '@carbon/icons/es/search/16';
57
- import flatpickr from 'flatpickr';
58
- import { Dutch } from 'flatpickr/dist/l10n/nl';
59
59
  import { German } from 'flatpickr/dist/l10n/de';
60
60
  import { english } from 'flatpickr/dist/l10n/default';
61
61
  import * as i2$5 from 'ng-multiselect-dropdown';
@@ -6235,6 +6235,10 @@ class ViewContentService {
6235
6235
  if (!definition.viewType) {
6236
6236
  definition.viewType = typeof value;
6237
6237
  }
6238
+ // converters render '-' for an empty value, which a definition can opt out of
6239
+ if (!value && definition.emptyPlaceholder !== undefined) {
6240
+ return definition.emptyPlaceholder;
6241
+ }
6238
6242
  if (definition.viewType.includes(separator)) {
6239
6243
  // Get the substring of the string after the separator (:) and assign it to a new key
6240
6244
  definition.format = definition.viewType.slice(this.getSeparatorIndex(definition, separator) + 1);
@@ -11550,6 +11554,68 @@ function applyDataGridPatch() {
11550
11554
  Components.setComponent('datagrid', PatchedDataGrid);
11551
11555
  }
11552
11556
 
11557
+ /*
11558
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
11559
+ *
11560
+ * Licensed under EUPL, Version 1.2 (the "License");
11561
+ * you may not use this file except in compliance with the License.
11562
+ * You may obtain a copy of the License at
11563
+ *
11564
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
11565
+ *
11566
+ * Unless required by applicable law or agreed to in writing, software
11567
+ * distributed under the License is distributed on an "AS IS" basis,
11568
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11569
+ * See the License for the specific language governing permissions and
11570
+ * limitations under the License.
11571
+ */
11572
+ /**
11573
+ * Formio only set the language on the first load.
11574
+ * This script can change the language of all active datepickers.
11575
+ * For all active datepickers, the new language is set and the component instance is reloaded.
11576
+ * The new language is immediately visible without a window reload.
11577
+ */
11578
+ const DEFAULT_LOCALE_KEY = 'en';
11579
+ const SUPPORTED_LOCALES = new Proxy({
11580
+ en: flatpickr.l10ns.default,
11581
+ nl: Dutch,
11582
+ }, {
11583
+ get: (target, prop) => target[prop] ?? target[DEFAULT_LOCALE_KEY],
11584
+ });
11585
+ let activeLocale = DEFAULT_LOCALE_KEY;
11586
+ const activeInstances = new Set();
11587
+ function getLocaleConfig(locale) {
11588
+ return SUPPORTED_LOCALES[locale];
11589
+ }
11590
+ function setFormioFlatpickrLocale(langKey) {
11591
+ activeLocale = langKey in SUPPORTED_LOCALES ? langKey : DEFAULT_LOCALE_KEY;
11592
+ const localeConfig = getLocaleConfig(activeLocale);
11593
+ activeInstances.forEach(instance => instance.set('locale', localeConfig));
11594
+ }
11595
+ function registerFormioFlatpickr() {
11596
+ Object.entries(SUPPORTED_LOCALES).forEach(([key, config]) => {
11597
+ flatpickr.l10ns[key] = config;
11598
+ });
11599
+ const formioFlatpickr = function (element, config) {
11600
+ const result = flatpickr(element, { ...config, locale: activeLocale });
11601
+ const instances = Array.isArray(result) ? result : [result];
11602
+ instances.forEach(instance => {
11603
+ if (!instance) {
11604
+ return;
11605
+ }
11606
+ activeInstances.add(instance);
11607
+ instance.config.onDestroy.push(() => activeInstances.delete(instance));
11608
+ });
11609
+ return result;
11610
+ };
11611
+ Object.assign(formioFlatpickr, flatpickr);
11612
+ window.flatpickr = formioFlatpickr;
11613
+ Formio.libraries['flatpickr-nl'] = {
11614
+ loaded: true,
11615
+ ready: Promise.resolve(Dutch),
11616
+ };
11617
+ }
11618
+
11553
11619
  /*
11554
11620
  * Copyright 2015-2026 Ritense BV, the Netherlands.
11555
11621
  *
@@ -11568,7 +11634,13 @@ function applyDataGridPatch() {
11568
11634
  // Apply FormIO patches before any form renders
11569
11635
  applyDataGridPatch();
11570
11636
  class FormIoModule {
11571
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormIoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
11637
+ constructor(translateService) {
11638
+ this.translateService = translateService;
11639
+ registerFormioFlatpickr();
11640
+ setFormioFlatpickrLocale((this.translateService.currentLang));
11641
+ this.translateService.onLangChange.subscribe(({ lang }) => setFormioFlatpickrLocale(lang));
11642
+ }
11643
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormIoModule, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.NgModule }); }
11572
11644
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: FormIoModule, declarations: [FormioComponent,
11573
11645
  FormioBuilderComponent,
11574
11646
  FormIoUploaderComponent,
@@ -11652,7 +11724,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
11652
11724
  },
11653
11725
  ],
11654
11726
  }]
11655
- }] });
11727
+ }], ctorParameters: () => [{ type: i1.TranslateService }] });
11656
11728
 
11657
11729
  /*
11658
11730
  * Copyright 2015-2025 Ritense BV, the Netherlands.