@kirbydesign/designsystem 11.4.2 → 11.5.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.
- package/fesm2022/kirbydesign-designsystem-accordion.mjs +11 -11
- package/fesm2022/kirbydesign-designsystem-accordion.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-action-group.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-action-group.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-avatar.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-avatar.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-badge.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-badge.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-button.mjs +4 -4
- package/fesm2022/kirbydesign-designsystem-button.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-calendar.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-calendar.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-card.mjs +17 -17
- package/fesm2022/kirbydesign-designsystem-card.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-chart.mjs +22 -22
- package/fesm2022/kirbydesign-designsystem-chart.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-checkbox.mjs +5 -5
- package/fesm2022/kirbydesign-designsystem-checkbox.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-data-table.mjs +7 -7
- package/fesm2022/kirbydesign-designsystem-data-table.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-divider.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-divider.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-dropdown.mjs +12 -12
- package/fesm2022/kirbydesign-designsystem-dropdown.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-empty-state.mjs +7 -7
- package/fesm2022/kirbydesign-designsystem-empty-state.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-fab-sheet.mjs +4 -4
- package/fesm2022/kirbydesign-designsystem-fab-sheet.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-flag.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-flag.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-form-field.mjs +132 -113
- package/fesm2022/kirbydesign-designsystem-form-field.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-header.mjs +20 -20
- package/fesm2022/kirbydesign-designsystem-header.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-helpers.mjs +73 -10
- package/fesm2022/kirbydesign-designsystem-helpers.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-icon.mjs +10 -10
- package/fesm2022/kirbydesign-designsystem-icon.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-item-group.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-item-group.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-item-sliding.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-item-sliding.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-item.mjs +11 -11
- package/fesm2022/kirbydesign-designsystem-item.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-kirby-app.mjs +7 -7
- package/fesm2022/kirbydesign-designsystem-kirby-app.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-list.mjs +40 -40
- package/fesm2022/kirbydesign-designsystem-list.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-loading-overlay.mjs +6 -6
- package/fesm2022/kirbydesign-designsystem-loading-overlay.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-menu.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-menu.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-modal.mjs +51 -51
- package/fesm2022/kirbydesign-designsystem-modal.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-page.mjs +41 -41
- package/fesm2022/kirbydesign-designsystem-page.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-popover.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-popover.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-progress-circle.mjs +6 -6
- package/fesm2022/kirbydesign-designsystem-progress-circle.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-radio.mjs +11 -11
- package/fesm2022/kirbydesign-designsystem-radio.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-range.mjs +5 -5
- package/fesm2022/kirbydesign-designsystem-range.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-reorder-list.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-reorder-list.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-router-outlet.mjs +7 -7
- package/fesm2022/kirbydesign-designsystem-router-outlet.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-section-header.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-section-header.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-shared-floating.mjs +4 -4
- package/fesm2022/kirbydesign-designsystem-shared-floating.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-shared-portal.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-shared-portal.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-shared.mjs +18 -18
- package/fesm2022/kirbydesign-designsystem-shared.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-slide-button.mjs +4 -4
- package/fesm2022/kirbydesign-designsystem-slide-button.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-slide.mjs +14 -14
- package/fesm2022/kirbydesign-designsystem-slide.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-spinner.mjs +7 -7
- package/fesm2022/kirbydesign-designsystem-spinner.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-tab-navigation.mjs +11 -11
- package/fesm2022/kirbydesign-designsystem-tab-navigation.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-tabs.mjs +15 -15
- package/fesm2022/kirbydesign-designsystem-tabs.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-testing-base.mjs +294 -287
- package/fesm2022/kirbydesign-designsystem-testing-base.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-testing-jasmine.mjs +4 -4
- package/fesm2022/kirbydesign-designsystem-testing-jasmine.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-testing-jest.mjs +4 -4
- package/fesm2022/kirbydesign-designsystem-testing-jest.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-testing.mjs +4 -4
- package/fesm2022/kirbydesign-designsystem-testing.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-toast.mjs +6 -6
- package/fesm2022/kirbydesign-designsystem-toast.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-toggle-button.mjs +7 -7
- package/fesm2022/kirbydesign-designsystem-toggle-button.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-toggle.mjs +5 -5
- package/fesm2022/kirbydesign-designsystem-toggle.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-types.mjs +3 -3
- package/fesm2022/kirbydesign-designsystem-types.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem.mjs +15 -15
- package/fesm2022/kirbydesign-designsystem.mjs.map +1 -1
- package/package.json +63 -63
- package/{accordion/index.d.ts → types/kirbydesign-designsystem-accordion.d.ts} +1 -1
- package/types/kirbydesign-designsystem-accordion.d.ts.map +1 -0
- package/{action-group/index.d.ts → types/kirbydesign-designsystem-action-group.d.ts} +1 -1
- package/types/kirbydesign-designsystem-action-group.d.ts.map +1 -0
- package/{avatar/index.d.ts → types/kirbydesign-designsystem-avatar.d.ts} +2 -2
- package/types/kirbydesign-designsystem-avatar.d.ts.map +1 -0
- package/{badge/index.d.ts → types/kirbydesign-designsystem-badge.d.ts} +1 -1
- package/types/kirbydesign-designsystem-badge.d.ts.map +1 -0
- package/{button/index.d.ts → types/kirbydesign-designsystem-button.d.ts} +2 -2
- package/types/kirbydesign-designsystem-button.d.ts.map +1 -0
- package/{calendar/index.d.ts → types/kirbydesign-designsystem-calendar.d.ts} +1 -1
- package/types/kirbydesign-designsystem-calendar.d.ts.map +1 -0
- package/{card/index.d.ts → types/kirbydesign-designsystem-card.d.ts} +2 -2
- package/types/kirbydesign-designsystem-card.d.ts.map +1 -0
- package/{chart/index.d.ts → types/kirbydesign-designsystem-chart.d.ts} +1 -1
- package/types/kirbydesign-designsystem-chart.d.ts.map +1 -0
- package/{checkbox/index.d.ts → types/kirbydesign-designsystem-checkbox.d.ts} +1 -1
- package/types/kirbydesign-designsystem-checkbox.d.ts.map +1 -0
- package/{config/index.d.ts → types/kirbydesign-designsystem-config.d.ts} +1 -1
- package/types/kirbydesign-designsystem-config.d.ts.map +1 -0
- package/{data-table/index.d.ts → types/kirbydesign-designsystem-data-table.d.ts} +1 -1
- package/types/kirbydesign-designsystem-data-table.d.ts.map +1 -0
- package/{divider/index.d.ts → types/kirbydesign-designsystem-divider.d.ts} +1 -1
- package/types/kirbydesign-designsystem-divider.d.ts.map +1 -0
- package/{dropdown/index.d.ts → types/kirbydesign-designsystem-dropdown.d.ts} +1 -1
- package/types/kirbydesign-designsystem-dropdown.d.ts.map +1 -0
- package/{empty-state/index.d.ts → types/kirbydesign-designsystem-empty-state.d.ts} +1 -1
- package/types/kirbydesign-designsystem-empty-state.d.ts.map +1 -0
- package/{fab-sheet/index.d.ts → types/kirbydesign-designsystem-fab-sheet.d.ts} +1 -1
- package/types/kirbydesign-designsystem-fab-sheet.d.ts.map +1 -0
- package/{flag/index.d.ts → types/kirbydesign-designsystem-flag.d.ts} +1 -1
- package/types/kirbydesign-designsystem-flag.d.ts.map +1 -0
- package/{form-field/index.d.ts → types/kirbydesign-designsystem-form-field.d.ts} +21 -24
- package/types/kirbydesign-designsystem-form-field.d.ts.map +1 -0
- package/{header/index.d.ts → types/kirbydesign-designsystem-header.d.ts} +1 -1
- package/types/kirbydesign-designsystem-header.d.ts.map +1 -0
- package/{helpers/scss/index.d.ts → types/kirbydesign-designsystem-helpers-scss.d.ts} +1 -1
- package/types/kirbydesign-designsystem-helpers-scss.d.ts.map +1 -0
- package/{helpers/index.d.ts → types/kirbydesign-designsystem-helpers.d.ts} +81 -13
- package/types/kirbydesign-designsystem-helpers.d.ts.map +1 -0
- package/{icon/index.d.ts → types/kirbydesign-designsystem-icon.d.ts} +1 -1
- package/types/kirbydesign-designsystem-icon.d.ts.map +1 -0
- package/{item-group/index.d.ts → types/kirbydesign-designsystem-item-group.d.ts} +1 -1
- package/types/kirbydesign-designsystem-item-group.d.ts.map +1 -0
- package/{item-sliding/index.d.ts → types/kirbydesign-designsystem-item-sliding.d.ts} +1 -1
- package/types/kirbydesign-designsystem-item-sliding.d.ts.map +1 -0
- package/{item/index.d.ts → types/kirbydesign-designsystem-item.d.ts} +1 -1
- package/types/kirbydesign-designsystem-item.d.ts.map +1 -0
- package/{kirby-app/index.d.ts → types/kirbydesign-designsystem-kirby-app.d.ts} +1 -1
- package/types/kirbydesign-designsystem-kirby-app.d.ts.map +1 -0
- package/{list/index.d.ts → types/kirbydesign-designsystem-list.d.ts} +1 -1
- package/types/kirbydesign-designsystem-list.d.ts.map +1 -0
- package/{loading-overlay/index.d.ts → types/kirbydesign-designsystem-loading-overlay.d.ts} +1 -1
- package/types/kirbydesign-designsystem-loading-overlay.d.ts.map +1 -0
- package/{menu/index.d.ts → types/kirbydesign-designsystem-menu.d.ts} +1 -1
- package/types/kirbydesign-designsystem-menu.d.ts.map +1 -0
- package/{modal/index.d.ts → types/kirbydesign-designsystem-modal.d.ts} +2 -2
- package/types/kirbydesign-designsystem-modal.d.ts.map +1 -0
- package/{page/index.d.ts → types/kirbydesign-designsystem-page.d.ts} +1 -1
- package/types/kirbydesign-designsystem-page.d.ts.map +1 -0
- package/{popover/index.d.ts → types/kirbydesign-designsystem-popover.d.ts} +1 -1
- package/types/kirbydesign-designsystem-popover.d.ts.map +1 -0
- package/{progress-circle/index.d.ts → types/kirbydesign-designsystem-progress-circle.d.ts} +1 -1
- package/types/kirbydesign-designsystem-progress-circle.d.ts.map +1 -0
- package/{radio/index.d.ts → types/kirbydesign-designsystem-radio.d.ts} +1 -1
- package/types/kirbydesign-designsystem-radio.d.ts.map +1 -0
- package/{range/index.d.ts → types/kirbydesign-designsystem-range.d.ts} +1 -1
- package/types/kirbydesign-designsystem-range.d.ts.map +1 -0
- package/{reorder-list/index.d.ts → types/kirbydesign-designsystem-reorder-list.d.ts} +1 -1
- package/types/kirbydesign-designsystem-reorder-list.d.ts.map +1 -0
- package/{router-outlet/index.d.ts → types/kirbydesign-designsystem-router-outlet.d.ts} +1 -1
- package/types/kirbydesign-designsystem-router-outlet.d.ts.map +1 -0
- package/{section-header/index.d.ts → types/kirbydesign-designsystem-section-header.d.ts} +1 -1
- package/types/kirbydesign-designsystem-section-header.d.ts.map +1 -0
- package/{shared/floating/index.d.ts → types/kirbydesign-designsystem-shared-floating.d.ts} +1 -1
- package/types/kirbydesign-designsystem-shared-floating.d.ts.map +1 -0
- package/{shared/portal/index.d.ts → types/kirbydesign-designsystem-shared-portal.d.ts} +1 -1
- package/types/kirbydesign-designsystem-shared-portal.d.ts.map +1 -0
- package/{shared/index.d.ts → types/kirbydesign-designsystem-shared.d.ts} +1 -1
- package/types/kirbydesign-designsystem-shared.d.ts.map +1 -0
- package/{slide-button/index.d.ts → types/kirbydesign-designsystem-slide-button.d.ts} +1 -1
- package/types/kirbydesign-designsystem-slide-button.d.ts.map +1 -0
- package/{slide/index.d.ts → types/kirbydesign-designsystem-slide.d.ts} +1 -1
- package/types/kirbydesign-designsystem-slide.d.ts.map +1 -0
- package/{spinner/index.d.ts → types/kirbydesign-designsystem-spinner.d.ts} +1 -1
- package/types/kirbydesign-designsystem-spinner.d.ts.map +1 -0
- package/{tab-navigation/index.d.ts → types/kirbydesign-designsystem-tab-navigation.d.ts} +1 -1
- package/types/kirbydesign-designsystem-tab-navigation.d.ts.map +1 -0
- package/{tabs/index.d.ts → types/kirbydesign-designsystem-tabs.d.ts} +1 -1
- package/types/kirbydesign-designsystem-tabs.d.ts.map +1 -0
- package/{testing-base/index.d.ts → types/kirbydesign-designsystem-testing-base.d.ts} +5 -3
- package/types/kirbydesign-designsystem-testing-base.d.ts.map +1 -0
- package/{testing-jasmine/index.d.ts → types/kirbydesign-designsystem-testing-jasmine.d.ts} +1 -1
- package/types/kirbydesign-designsystem-testing-jasmine.d.ts.map +1 -0
- package/{testing-jest/index.d.ts → types/kirbydesign-designsystem-testing-jest.d.ts} +1 -1
- package/types/kirbydesign-designsystem-testing-jest.d.ts.map +1 -0
- package/{testing/index.d.ts → types/kirbydesign-designsystem-testing.d.ts} +1 -1
- package/types/kirbydesign-designsystem-testing.d.ts.map +1 -0
- package/{toast/index.d.ts → types/kirbydesign-designsystem-toast.d.ts} +1 -1
- package/types/kirbydesign-designsystem-toast.d.ts.map +1 -0
- package/{toggle-button/index.d.ts → types/kirbydesign-designsystem-toggle-button.d.ts} +1 -1
- package/types/kirbydesign-designsystem-toggle-button.d.ts.map +1 -0
- package/{toggle/index.d.ts → types/kirbydesign-designsystem-toggle.d.ts} +1 -1
- package/types/kirbydesign-designsystem-toggle.d.ts.map +1 -0
- package/types/{index.d.ts → kirbydesign-designsystem-types.d.ts} +1 -1
- package/types/kirbydesign-designsystem-types.d.ts.map +1 -0
- package/{index.d.ts → types/kirbydesign-designsystem.d.ts} +1 -1
- package/types/kirbydesign-designsystem.d.ts.map +1 -0
- package/accordion/index.d.ts.map +0 -1
- package/action-group/index.d.ts.map +0 -1
- package/avatar/index.d.ts.map +0 -1
- package/badge/index.d.ts.map +0 -1
- package/button/index.d.ts.map +0 -1
- package/calendar/index.d.ts.map +0 -1
- package/card/index.d.ts.map +0 -1
- package/chart/index.d.ts.map +0 -1
- package/checkbox/index.d.ts.map +0 -1
- package/config/index.d.ts.map +0 -1
- package/data-table/index.d.ts.map +0 -1
- package/divider/index.d.ts.map +0 -1
- package/dropdown/index.d.ts.map +0 -1
- package/empty-state/index.d.ts.map +0 -1
- package/fab-sheet/index.d.ts.map +0 -1
- package/flag/index.d.ts.map +0 -1
- package/form-field/index.d.ts.map +0 -1
- package/header/index.d.ts.map +0 -1
- package/helpers/index.d.ts.map +0 -1
- package/helpers/scss/index.d.ts.map +0 -1
- package/icon/index.d.ts.map +0 -1
- package/index.d.ts.map +0 -1
- package/item/index.d.ts.map +0 -1
- package/item-group/index.d.ts.map +0 -1
- package/item-sliding/index.d.ts.map +0 -1
- package/kirby-app/index.d.ts.map +0 -1
- package/list/index.d.ts.map +0 -1
- package/loading-overlay/index.d.ts.map +0 -1
- package/menu/index.d.ts.map +0 -1
- package/modal/index.d.ts.map +0 -1
- package/page/index.d.ts.map +0 -1
- package/popover/index.d.ts.map +0 -1
- package/progress-circle/index.d.ts.map +0 -1
- package/radio/index.d.ts.map +0 -1
- package/range/index.d.ts.map +0 -1
- package/reorder-list/index.d.ts.map +0 -1
- package/router-outlet/index.d.ts.map +0 -1
- package/section-header/index.d.ts.map +0 -1
- package/shared/floating/index.d.ts.map +0 -1
- package/shared/index.d.ts.map +0 -1
- package/shared/portal/index.d.ts.map +0 -1
- package/slide/index.d.ts.map +0 -1
- package/slide-button/index.d.ts.map +0 -1
- package/spinner/index.d.ts.map +0 -1
- package/tab-navigation/index.d.ts.map +0 -1
- package/tabs/index.d.ts.map +0 -1
- package/testing/index.d.ts.map +0 -1
- package/testing-base/index.d.ts.map +0 -1
- package/testing-jasmine/index.d.ts.map +0 -1
- package/testing-jest/index.d.ts.map +0 -1
- package/toast/index.d.ts.map +0 -1
- package/toggle/index.d.ts.map +0 -1
- package/toggle-button/index.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Input, Directive, LOCALE_ID, HostListener, Inject, ChangeDetectionStrategy, Component, EventEmitter, Output, HostBinding,
|
|
2
|
+
import { Input, Directive, LOCALE_ID, HostListener, Inject, Optional, ChangeDetectionStrategy, Component, EventEmitter, Output, HostBinding, ElementRef, ContentChild, ContentChildren, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@kirbydesign/designsystem/helpers';
|
|
4
|
-
import { UniqueIdGenerator, DesignTokenHelper } from '@kirbydesign/designsystem/helpers';
|
|
4
|
+
import { extendValueAccessors, UniqueIdGenerator, DesignTokenHelper } from '@kirbydesign/designsystem/helpers';
|
|
5
5
|
import { RadioGroupComponent } from '@kirbydesign/designsystem/radio';
|
|
6
6
|
import { getLocaleDateFormat, FormatWidth, NgTemplateOutlet, getLocaleNumberSymbol, NumberSymbol, CommonModule } from '@angular/common';
|
|
7
7
|
import { IconComponent, IconModule } from '@kirbydesign/designsystem/icon';
|
|
8
8
|
import { DropdownComponent } from '@kirbydesign/designsystem/dropdown';
|
|
9
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
10
|
import Inputmask from 'inputmask/dist/inputmask.es6.js';
|
|
10
11
|
import { tap, filter, debounceTime } from 'rxjs';
|
|
11
12
|
import * as i1 from '@kirbydesign/designsystem/shared';
|
|
12
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
13
13
|
import * as i2 from '@kirbydesign/designsystem/types';
|
|
14
14
|
|
|
15
15
|
class AffixDirective {
|
|
16
16
|
constructor(el) {
|
|
17
17
|
this.el = el;
|
|
18
18
|
}
|
|
19
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
20
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
19
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AffixDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
20
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: AffixDirective, isStandalone: true, selector: "[kirby-affix]", inputs: { type: ["kirby-affix", "type"] }, ngImport: i0 }); }
|
|
21
21
|
}
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AffixDirective, decorators: [{
|
|
23
23
|
type: Directive,
|
|
24
24
|
args: [{
|
|
25
25
|
// eslint-disable-next-line
|
|
@@ -38,7 +38,7 @@ class DateInputDirective {
|
|
|
38
38
|
this.updateMask(this.elementRef.nativeElement.value);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
constructor(elementRef, renderer, locale) {
|
|
41
|
+
constructor(elementRef, renderer, locale, valueAccessors) {
|
|
42
42
|
this.elementRef = elementRef;
|
|
43
43
|
this.renderer = renderer;
|
|
44
44
|
this.locale = locale;
|
|
@@ -71,6 +71,20 @@ class DateInputDirective {
|
|
|
71
71
|
// Remove type to avoid user-agent specific behaviour for [type="date"]
|
|
72
72
|
// Has to be done in constructor to avoid browser behavior kicking in
|
|
73
73
|
this.elementRef.nativeElement.removeAttribute('type');
|
|
74
|
+
extendValueAccessors(valueAccessors, {
|
|
75
|
+
writeValue: {
|
|
76
|
+
afterWriteValue: (value) => this.updateMask(value),
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
ngOnChanges(changes) {
|
|
82
|
+
if (changes.dateValue && this.isDateInput && this.maskingElement) {
|
|
83
|
+
const newValue = changes.dateValue.currentValue;
|
|
84
|
+
this.updateMask(newValue);
|
|
85
|
+
if (newValue != null) {
|
|
86
|
+
this.inputmask?.setValue(newValue);
|
|
87
|
+
}
|
|
74
88
|
}
|
|
75
89
|
}
|
|
76
90
|
ngAfterViewInit() {
|
|
@@ -81,6 +95,11 @@ class DateInputDirective {
|
|
|
81
95
|
// option was introduced
|
|
82
96
|
if (this.enableInputMask) {
|
|
83
97
|
this.initMask();
|
|
98
|
+
// Update mask with initial value if set via [value] binding on input
|
|
99
|
+
if (this.dateValue && this.inputmask) {
|
|
100
|
+
this.updateMask(this.dateValue);
|
|
101
|
+
this.inputmask.setValue(this.dateValue);
|
|
102
|
+
}
|
|
84
103
|
}
|
|
85
104
|
if (this.useNativeDatePicker) {
|
|
86
105
|
this.elementRef.nativeElement.setAttribute('type', 'date');
|
|
@@ -97,6 +116,7 @@ class DateInputDirective {
|
|
|
97
116
|
placeholder,
|
|
98
117
|
prefillYear: this.prefillYear,
|
|
99
118
|
}).mask(this.elementRef.nativeElement);
|
|
119
|
+
this.inputmask = this.elementRef.nativeElement.inputmask;
|
|
100
120
|
// Append input overlay, so it's possible to style typed date differntly than the date-mask
|
|
101
121
|
this.appendMaskingElement();
|
|
102
122
|
}
|
|
@@ -129,20 +149,29 @@ class DateInputDirective {
|
|
|
129
149
|
updateMask(value) {
|
|
130
150
|
if (!this.maskingElement)
|
|
131
151
|
return;
|
|
152
|
+
if (!value) {
|
|
153
|
+
this.maskingElement.innerHTML = '';
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
132
156
|
const lastNumber = value.match(/.*?(\d)[^\d]*$/); // get last number in string
|
|
133
|
-
this.maskingElement.innerHTML =
|
|
157
|
+
this.maskingElement.innerHTML = lastNumber
|
|
134
158
|
? value.slice(0, value.lastIndexOf(lastNumber[1]) + 1)
|
|
135
159
|
: '';
|
|
136
160
|
}
|
|
137
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
138
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
161
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DateInputDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: LOCALE_ID }, { token: NG_VALUE_ACCESSOR, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
162
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: DateInputDirective, isStandalone: true, inputs: { prefillYear: "prefillYear", useNativeDatePicker: "useNativeDatePicker", dateValue: "dateValue" }, host: { listeners: { "input": "onInput()" } }, usesOnChanges: true, ngImport: i0 }); }
|
|
139
163
|
}
|
|
140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DateInputDirective, decorators: [{
|
|
141
165
|
type: Directive,
|
|
142
166
|
args: [{}]
|
|
143
167
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
|
|
144
168
|
type: Inject,
|
|
145
169
|
args: [LOCALE_ID]
|
|
170
|
+
}] }, { type: undefined, decorators: [{
|
|
171
|
+
type: Optional
|
|
172
|
+
}, {
|
|
173
|
+
type: Inject,
|
|
174
|
+
args: [NG_VALUE_ACCESSOR]
|
|
146
175
|
}] }], propDecorators: { onInput: [{
|
|
147
176
|
type: HostListener,
|
|
148
177
|
args: ['input']
|
|
@@ -150,16 +179,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
150
179
|
type: Input
|
|
151
180
|
}], useNativeDatePicker: [{
|
|
152
181
|
type: Input
|
|
182
|
+
}], dateValue: [{
|
|
183
|
+
type: Input
|
|
153
184
|
}] } });
|
|
154
185
|
|
|
155
186
|
class FormFieldMessageComponent {
|
|
156
187
|
constructor() {
|
|
157
188
|
this.position = 'left';
|
|
158
189
|
}
|
|
159
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
160
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
190
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FormFieldMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
191
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: FormFieldMessageComponent, isStandalone: true, selector: "kirby-form-field-message", inputs: { text: "text", position: "position" }, ngImport: i0, template: "{{ text }}\n<ng-content></ng-content>\n", styles: [":host{font-style:italic;font-size:12px;font-weight:400;font-stretch:normal;line-height:16px;min-height:16px;letter-spacing:normal;color:var(--kirby-text-color-black)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
161
192
|
}
|
|
162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
193
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FormFieldMessageComponent, decorators: [{
|
|
163
194
|
type: Component,
|
|
164
195
|
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'kirby-form-field-message', template: "{{ text }}\n<ng-content></ng-content>\n", styles: [":host{font-style:italic;font-size:12px;font-weight:400;font-stretch:normal;line-height:16px;min-height:16px;letter-spacing:normal;color:var(--kirby-text-color-black)}\n"] }]
|
|
165
196
|
}], propDecorators: { text: [{
|
|
@@ -176,17 +207,20 @@ class InputCounterComponent {
|
|
|
176
207
|
const ofMaxlength = this.maxlength ? `/${this.maxlength}` : '';
|
|
177
208
|
return `${this.length}${ofMaxlength}`;
|
|
178
209
|
}
|
|
179
|
-
constructor(translations) {
|
|
210
|
+
constructor(translations, cdr) {
|
|
180
211
|
this.translations = translations;
|
|
212
|
+
this.cdr = cdr;
|
|
181
213
|
this.skipNextAnnouncement = false;
|
|
182
214
|
}
|
|
183
|
-
|
|
215
|
+
ngAfterViewInit() {
|
|
184
216
|
if (this.listenTo) {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
217
|
+
// A FormControl initialized with a value writes directly to the nativeElement.
|
|
218
|
+
// Check for this scenario first, before checking for listenTo's value @Input.
|
|
219
|
+
const initialValue = this.listenTo.nativeValue ?? this.listenTo.value ?? '';
|
|
220
|
+
this.length = initialValue.length;
|
|
221
|
+
this.skipNextAnnouncement = this.length > 0; // If there is already text in the input, skip the first announcement so we don't announce on refresh or prefilled text fields.
|
|
222
|
+
this.maxlength = this.listenTo.maxlength ? +this.listenTo.maxlength : undefined;
|
|
223
|
+
this.cdr.detectChanges();
|
|
190
224
|
this._inputChangeSubscription = this.listenTo.kirbyChange
|
|
191
225
|
.pipe(tap((value) => (this.length = value?.length || 0)), filter(() => this.skipAnnouncement()), debounceTime(1000))
|
|
192
226
|
.subscribe(() => {
|
|
@@ -215,13 +249,13 @@ class InputCounterComponent {
|
|
|
215
249
|
this.textToAnnounce = `${characters} ${this.length} ${outOf} ${this.maxlength} ${entered}`;
|
|
216
250
|
}
|
|
217
251
|
}
|
|
218
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
219
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
252
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: InputCounterComponent, deps: [{ token: i1.TranslationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
253
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: InputCounterComponent, isStandalone: true, selector: "kirby-input-counter", inputs: { listenTo: "listenTo" }, ngImport: i0, template: "<kirby-form-field-message [text]=\"text\"></kirby-form-field-message>\n<div class=\"kirby-visually-hidden\" aria-live=\"polite\">{{ textToAnnounce }}</div>\n", dependencies: [{ kind: "component", type: FormFieldMessageComponent, selector: "kirby-form-field-message", inputs: ["text", "position"] }] }); }
|
|
220
254
|
}
|
|
221
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: InputCounterComponent, decorators: [{
|
|
222
256
|
type: Component,
|
|
223
257
|
args: [{ selector: 'kirby-input-counter', imports: [FormFieldMessageComponent], template: "<kirby-form-field-message [text]=\"text\"></kirby-form-field-message>\n<div class=\"kirby-visually-hidden\" aria-live=\"polite\">{{ textToAnnounce }}</div>\n" }]
|
|
224
|
-
}], ctorParameters: () => [{ type: i1.TranslationService }], propDecorators: { listenTo: [{
|
|
258
|
+
}], ctorParameters: () => [{ type: i1.TranslationService }, { type: i0.ChangeDetectorRef }], propDecorators: { listenTo: [{
|
|
225
259
|
type: Input
|
|
226
260
|
}] } });
|
|
227
261
|
|
|
@@ -246,16 +280,22 @@ class InputComponent {
|
|
|
246
280
|
this.hasErrorChange.emit(this._hasError);
|
|
247
281
|
}
|
|
248
282
|
}
|
|
283
|
+
get nativeValue() {
|
|
284
|
+
return this.elementRef?.nativeElement?.value;
|
|
285
|
+
}
|
|
249
286
|
constructor(elementRef, builtInValueAccessors) {
|
|
250
287
|
this.elementRef = elementRef;
|
|
251
|
-
this.builtInValueAccessors = builtInValueAccessors;
|
|
252
288
|
this.kirbyChange = new EventEmitter();
|
|
253
289
|
this._hasError = false;
|
|
254
290
|
this.size = InputSize.large;
|
|
255
291
|
this.autocomplete = 'off';
|
|
256
292
|
this.autocorrect = 'off';
|
|
257
293
|
this.hasErrorChange = new EventEmitter();
|
|
258
|
-
|
|
294
|
+
extendValueAccessors(builtInValueAccessors, {
|
|
295
|
+
writeValue: {
|
|
296
|
+
afterWriteValue: (value) => this.kirbyChange.emit(value),
|
|
297
|
+
},
|
|
298
|
+
});
|
|
259
299
|
}
|
|
260
300
|
ngOnInit() {
|
|
261
301
|
// The native input value is emitted here to make sure that
|
|
@@ -273,19 +313,6 @@ class InputComponent {
|
|
|
273
313
|
this.kirbyChange.emit(changes.value.currentValue);
|
|
274
314
|
}
|
|
275
315
|
}
|
|
276
|
-
extendBuiltinValueAccessor() {
|
|
277
|
-
if (this.builtInValueAccessors) {
|
|
278
|
-
this.builtInValueAccessors.forEach((accessor) => {
|
|
279
|
-
const originalWriteValue = accessor.writeValue?.bind(accessor);
|
|
280
|
-
accessor.writeValue = (value) => {
|
|
281
|
-
if (originalWriteValue) {
|
|
282
|
-
originalWriteValue(value);
|
|
283
|
-
}
|
|
284
|
-
this.kirbyChange.emit(value);
|
|
285
|
-
};
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
316
|
static { this.typeToInputmodeMap = {
|
|
290
317
|
number: 'decimal',
|
|
291
318
|
search: 'search',
|
|
@@ -297,17 +324,21 @@ class InputComponent {
|
|
|
297
324
|
//Value of input element is updated after cut/paste:
|
|
298
325
|
setTimeout(() => this.kirbyChange.emit(target.value));
|
|
299
326
|
}
|
|
300
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
301
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
327
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: InputComponent, deps: [{ token: i0.ElementRef }, { token: NG_VALUE_ACCESSOR, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
328
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: InputComponent, isStandalone: true, selector: "input[kirby-input]", inputs: { type: "type", size: "size", borderless: "borderless", hasError: "hasError", autocomplete: "autocomplete", autocorrect: "autocorrect", value: "value", maxlength: "maxlength", inputmode: "inputmode" }, outputs: { hasErrorChange: "hasErrorChange" }, host: { listeners: { "keyup": "_onKeyUp($event.target.value)", "paste": "_onCutPaste($event.target)", "cut": "_onCutPaste($event.target)" }, properties: { "class": "this.size", "class.borderless": "this.borderless", "attr.aria-invalid": "this.hasError", "class.error": "this.hasError", "attr.autocomplete": "this.autocomplete", "attr.autocorrect": "this.autocorrect", "attr.value": "this.value", "attr.maxlength": "this.maxlength", "attr.inputmode": "this.inputmode" } }, usesOnChanges: true, hostDirectives: [{ directive: DateInputDirective, inputs: ["prefillYear", "prefillYear", "useNativeDatePicker", "useNativeDatePicker", "dateValue", "value"] }], ngImport: i0, template: '', isInline: true, styles: [":host(.error){border:1px solid var(--kirby-danger);padding:calc(1em - 1px)}:host(.cloned-input){pointer-events:none;position:absolute;top:0;left:0}:host-context(label).cloned-input{top:24px}@media(hover:hover)and (pointer:fine){:host:focus{transition:all 80ms linear 0ms;box-shadow:0 1px 24px #1c1c1c0a,0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}:host:focus:not(:focus-visible){box-shadow:0 1px 24px #1c1c1c0a,0 0 0 0 transparent}:host:focus-visible{transition:all 80ms linear 0ms;box-shadow:0 1px 24px #1c1c1c0a,0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}}:host{background-color:var(--kirby-inputs-background-color);color:var(--kirby-inputs-color);border:none;box-sizing:border-box;font-family:var(--kirby-font-family);font-size:1rem;line-height:1.5;outline:none;margin:0;-webkit-appearance:none;appearance:none;border-radius:16px;box-shadow:var(--kirby-inputs-elevation);padding:1em;width:100%}:host:host-context(kirby-item),:host.borderless{border-radius:0;box-shadow:none;padding-inline:0;width:auto}:host:disabled{background-color:var(--kirby-light-tint);color:var(--kirby-text-color-semi-dark);box-shadow:none}:host::placeholder{color:var(--kirby-inputs-placeholder-color)}@supports not (selector(::-webkit-date-and-time-value)){:host(input[type=date]::-webkit-date-and-time-value){min-height:1.5em;text-align:start}}@media(hover:hover){:host:not(:disabled):hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer;background-color:var(--kirby-inputs-background-color-hover);cursor:text}}:host:not(:disabled):active,:host:not(:disabled).interaction-state-active{--state-layer-opacity: .12;--state-layer-background-color: var(--kirby-black);background-color:var(--kirby-inputs-background-color-active)}:host:not(:disabled){transition:all 80ms linear 0ms;transition-property:background-color}:host[type=date]{background-color:var(--date-input-background-color)}:host[type=number]{-webkit-appearance:textfield;appearance:textfield}:host::-webkit-outer-spin-button,:host::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;margin:0}:host(.md){border-radius:24px;padding-block:.5em}:host(.md).error{padding-block:calc(.5em - 1px)}:host-context(kirby-item kirby-form-field[slot=end])[type=number]{font-weight:700}.date-mask-wrapper{position:relative}:host-context(.date-mask-wrapper){color:var(--kirby-text-color-semi-dark)}.date-mask{font-family:var(--kirby-font-family);line-height:1.5;font-size:var(--kirby-font-size-n);color:var(--kirby-white-contrast);position:absolute;top:0;left:0;padding:1em}:host(.md)+.date-mask{padding-block:.5em}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
302
329
|
}
|
|
303
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: InputComponent, decorators: [{
|
|
304
331
|
type: Component,
|
|
305
332
|
args: [{ hostDirectives: [
|
|
306
333
|
{
|
|
307
334
|
directive: DateInputDirective,
|
|
308
|
-
inputs: [
|
|
335
|
+
inputs: [
|
|
336
|
+
'prefillYear',
|
|
337
|
+
'useNativeDatePicker',
|
|
338
|
+
'dateValue: value' /* sync input value updates with date-input mask */,
|
|
339
|
+
],
|
|
309
340
|
},
|
|
310
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, selector: 'input[kirby-input]', template: '', styles: [":host(.error){border:1px solid var(--kirby-danger);padding:calc(1em - 1px)}:host(.cloned-input){pointer-events:none;position:absolute;top:0;left:0}:host-context(label).cloned-input{top:24px}@media
|
|
341
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, selector: 'input[kirby-input]', template: '', styles: [":host(.error){border:1px solid var(--kirby-danger);padding:calc(1em - 1px)}:host(.cloned-input){pointer-events:none;position:absolute;top:0;left:0}:host-context(label).cloned-input{top:24px}@media(hover:hover)and (pointer:fine){:host:focus{transition:all 80ms linear 0ms;box-shadow:0 1px 24px #1c1c1c0a,0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}:host:focus:not(:focus-visible){box-shadow:0 1px 24px #1c1c1c0a,0 0 0 0 transparent}:host:focus-visible{transition:all 80ms linear 0ms;box-shadow:0 1px 24px #1c1c1c0a,0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}}:host{background-color:var(--kirby-inputs-background-color);color:var(--kirby-inputs-color);border:none;box-sizing:border-box;font-family:var(--kirby-font-family);font-size:1rem;line-height:1.5;outline:none;margin:0;-webkit-appearance:none;appearance:none;border-radius:16px;box-shadow:var(--kirby-inputs-elevation);padding:1em;width:100%}:host:host-context(kirby-item),:host.borderless{border-radius:0;box-shadow:none;padding-inline:0;width:auto}:host:disabled{background-color:var(--kirby-light-tint);color:var(--kirby-text-color-semi-dark);box-shadow:none}:host::placeholder{color:var(--kirby-inputs-placeholder-color)}@supports not (selector(::-webkit-date-and-time-value)){:host(input[type=date]::-webkit-date-and-time-value){min-height:1.5em;text-align:start}}@media(hover:hover){:host:not(:disabled):hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer;background-color:var(--kirby-inputs-background-color-hover);cursor:text}}:host:not(:disabled):active,:host:not(:disabled).interaction-state-active{--state-layer-opacity: .12;--state-layer-background-color: var(--kirby-black);background-color:var(--kirby-inputs-background-color-active)}:host:not(:disabled){transition:all 80ms linear 0ms;transition-property:background-color}:host[type=date]{background-color:var(--date-input-background-color)}:host[type=number]{-webkit-appearance:textfield;appearance:textfield}:host::-webkit-outer-spin-button,:host::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;margin:0}:host(.md){border-radius:24px;padding-block:.5em}:host(.md).error{padding-block:calc(.5em - 1px)}:host-context(kirby-item kirby-form-field[slot=end])[type=number]{font-weight:700}.date-mask-wrapper{position:relative}:host-context(.date-mask-wrapper){color:var(--kirby-text-color-semi-dark)}.date-mask{font-family:var(--kirby-font-family);line-height:1.5;font-size:var(--kirby-font-size-n);color:var(--kirby-white-contrast);position:absolute;top:0;left:0;padding:1em}:host(.md)+.date-mask{padding-block:.5em}\n"] }]
|
|
311
342
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
312
343
|
type: Optional
|
|
313
344
|
}, {
|
|
@@ -381,15 +412,21 @@ class TextareaComponent {
|
|
|
381
412
|
this.hasErrorChange.emit(this._hasError);
|
|
382
413
|
}
|
|
383
414
|
}
|
|
415
|
+
get nativeValue() {
|
|
416
|
+
return this.elementRef?.nativeElement?.value;
|
|
417
|
+
}
|
|
384
418
|
constructor(elementRef, builtInValueAccessors) {
|
|
385
419
|
this.elementRef = elementRef;
|
|
386
|
-
this.builtInValueAccessors = builtInValueAccessors;
|
|
387
420
|
this.kirbyChange = new EventEmitter();
|
|
388
421
|
this._hasError = false;
|
|
389
422
|
this.autocomplete = 'off';
|
|
390
423
|
this.autocorrect = 'off';
|
|
391
424
|
this.hasErrorChange = new EventEmitter();
|
|
392
|
-
|
|
425
|
+
extendValueAccessors(builtInValueAccessors, {
|
|
426
|
+
writeValue: {
|
|
427
|
+
afterWriteValue: (value) => this.kirbyChange.emit(value),
|
|
428
|
+
},
|
|
429
|
+
});
|
|
393
430
|
}
|
|
394
431
|
ngOnInit() {
|
|
395
432
|
// The native input value is emitted here to make sure that
|
|
@@ -407,19 +444,6 @@ class TextareaComponent {
|
|
|
407
444
|
this.kirbyChange.emit(changes.value.currentValue);
|
|
408
445
|
}
|
|
409
446
|
}
|
|
410
|
-
extendBuiltinValueAccessor() {
|
|
411
|
-
if (this.builtInValueAccessors) {
|
|
412
|
-
this.builtInValueAccessors.forEach((accessor) => {
|
|
413
|
-
const originalWriteValue = accessor.writeValue?.bind(accessor);
|
|
414
|
-
accessor.writeValue = (value) => {
|
|
415
|
-
if (originalWriteValue) {
|
|
416
|
-
originalWriteValue(value);
|
|
417
|
-
}
|
|
418
|
-
this.kirbyChange.emit(value);
|
|
419
|
-
};
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
447
|
_onKeyUp(value) {
|
|
424
448
|
this.kirbyChange.emit(value);
|
|
425
449
|
}
|
|
@@ -427,18 +451,21 @@ class TextareaComponent {
|
|
|
427
451
|
//Value of textarea element is updated after cut/paste:
|
|
428
452
|
setTimeout(() => this.kirbyChange.emit(target.value));
|
|
429
453
|
}
|
|
430
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
431
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
454
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TextareaComponent, deps: [{ token: i0.ElementRef }, { token: NG_VALUE_ACCESSOR, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
455
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: TextareaComponent, isStandalone: true, selector: "textarea[kirby-textarea]", inputs: { value: "value", borderless: "borderless", hasError: "hasError", autocomplete: "autocomplete", autocorrect: "autocorrect", maxlength: "maxlength" }, outputs: { hasErrorChange: "hasErrorChange" }, host: { listeners: { "keyup": "_onKeyUp($event.target.value)", "paste": "_onCutPaste($event.target)", "cut": "_onCutPaste($event.target)" }, properties: { "attr.value": "this.value", "class.borderless": "this.borderless", "attr.aria-invalid": "this.hasError", "class.error": "this.hasError", "attr.autocomplete": "this.autocomplete", "attr.autocorrect": "this.autocorrect", "attr.maxlength": "this.maxlength" } }, usesOnChanges: true, ngImport: i0, template: "@if (!value) {\n <ng-content></ng-content>\n}\n<!-- prettier-ignore -->\n@if (value) {{{value}}}\n", styles: [":host(.error){border:1px solid var(--kirby-danger);padding:calc(1em - 1px)}:host(.cloned-input){pointer-events:none;position:absolute;top:0;left:0}:host-context(label).cloned-input{top:24px}@media(hover:hover)and (pointer:fine){:host:focus{transition:all 80ms linear 0ms;box-shadow:0 1px 24px #1c1c1c0a,0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}:host:focus:not(:focus-visible){box-shadow:0 1px 24px #1c1c1c0a,0 0 0 0 transparent}:host:focus-visible{transition:all 80ms linear 0ms;box-shadow:0 1px 24px #1c1c1c0a,0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}}:host{background-color:var(--kirby-inputs-background-color);color:var(--kirby-inputs-color);border:none;box-sizing:border-box;font-family:var(--kirby-font-family);font-size:1rem;line-height:1.5;outline:none;margin:0;-webkit-appearance:none;appearance:none;border-radius:16px;box-shadow:var(--kirby-inputs-elevation);padding:1em;width:100%}:host:host-context(kirby-item),:host.borderless{border-radius:0;box-shadow:none;padding-inline:0;width:auto}:host:disabled{background-color:var(--kirby-light-tint);color:var(--kirby-text-color-semi-dark);box-shadow:none}:host::placeholder{color:var(--kirby-inputs-placeholder-color)}@supports not (selector(::-webkit-date-and-time-value)){:host(input[type=date]::-webkit-date-and-time-value){min-height:1.5em;text-align:start}}@media(hover:hover){:host:not(:disabled):hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer;background-color:#f5f5f5;cursor:text}}:host:not(:disabled):active,:host:not(:disabled).interaction-state-active{--state-layer-opacity: .12;--state-layer-background-color: var(--kirby-black);background-color:#ebebeb}:host:not(:disabled){transition:all 80ms linear 0ms;transition-property:background-color}:host{position:relative;font-family:var(--kirby-font-family);resize:none}@media(min-width:768px){:host{resize:vertical}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
432
456
|
}
|
|
433
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
457
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
434
458
|
type: Component,
|
|
435
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'textarea[kirby-textarea]', template: "@if (!value) {\n <ng-content></ng-content>\n}\n<!-- prettier-ignore -->\n@if (value) {{{value}}}\n", styles: [":host(.error){border:1px solid var(--kirby-danger);padding:calc(1em - 1px)}:host(.cloned-input){pointer-events:none;position:absolute;top:0;left:0}:host-context(label).cloned-input{top:24px}@media
|
|
459
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'textarea[kirby-textarea]', template: "@if (!value) {\n <ng-content></ng-content>\n}\n<!-- prettier-ignore -->\n@if (value) {{{value}}}\n", styles: [":host(.error){border:1px solid var(--kirby-danger);padding:calc(1em - 1px)}:host(.cloned-input){pointer-events:none;position:absolute;top:0;left:0}:host-context(label).cloned-input{top:24px}@media(hover:hover)and (pointer:fine){:host:focus{transition:all 80ms linear 0ms;box-shadow:0 1px 24px #1c1c1c0a,0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}:host:focus:not(:focus-visible){box-shadow:0 1px 24px #1c1c1c0a,0 0 0 0 transparent}:host:focus-visible{transition:all 80ms linear 0ms;box-shadow:0 1px 24px #1c1c1c0a,0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}}:host{background-color:var(--kirby-inputs-background-color);color:var(--kirby-inputs-color);border:none;box-sizing:border-box;font-family:var(--kirby-font-family);font-size:1rem;line-height:1.5;outline:none;margin:0;-webkit-appearance:none;appearance:none;border-radius:16px;box-shadow:var(--kirby-inputs-elevation);padding:1em;width:100%}:host:host-context(kirby-item),:host.borderless{border-radius:0;box-shadow:none;padding-inline:0;width:auto}:host:disabled{background-color:var(--kirby-light-tint);color:var(--kirby-text-color-semi-dark);box-shadow:none}:host::placeholder{color:var(--kirby-inputs-placeholder-color)}@supports not (selector(::-webkit-date-and-time-value)){:host(input[type=date]::-webkit-date-and-time-value){min-height:1.5em;text-align:start}}@media(hover:hover){:host:not(:disabled):hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer;background-color:#f5f5f5;cursor:text}}:host:not(:disabled):active,:host:not(:disabled).interaction-state-active{--state-layer-opacity: .12;--state-layer-background-color: var(--kirby-black);background-color:#ebebeb}:host:not(:disabled){transition:all 80ms linear 0ms;transition-property:background-color}:host{position:relative;font-family:var(--kirby-font-family);resize:none}@media(min-width:768px){:host{resize:vertical}}\n"] }]
|
|
436
460
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
437
461
|
type: Optional
|
|
438
462
|
}, {
|
|
439
463
|
type: Inject,
|
|
440
464
|
args: [NG_VALUE_ACCESSOR]
|
|
441
465
|
}] }], propDecorators: { value: [{
|
|
466
|
+
type: HostBinding,
|
|
467
|
+
args: ['attr.value']
|
|
468
|
+
}, {
|
|
442
469
|
type: Input
|
|
443
470
|
}], borderless: [{
|
|
444
471
|
type: HostBinding,
|
|
@@ -655,12 +682,12 @@ class FormFieldComponent {
|
|
|
655
682
|
});
|
|
656
683
|
}
|
|
657
684
|
}
|
|
658
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
659
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
685
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FormFieldComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.PlatformService }, { token: i0.Renderer2 }, { token: i2.WindowRef }, { token: i1.ResizeObserverService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
686
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: FormFieldComponent, isStandalone: true, selector: "kirby-form-field", inputs: { label: "label", message: "message" }, host: { listeners: { "kirbyRegisterFormField": "_onRegisterFormField()" }, properties: { "class.wrap-content-in-label": "this._wrapContentInLabel" } }, queries: [{ propertyName: "counter", first: true, predicate: InputCounterComponent, descendants: true }, { propertyName: "radioGroupComponent", first: true, predicate: RadioGroupComponent, descendants: true }, { propertyName: "inputComponent", first: true, predicate: InputComponent, descendants: true }, { propertyName: "dropdownComponent", first: true, predicate: DropdownComponent, descendants: true }, { propertyName: "textareaComponent", first: true, predicate: TextareaComponent, descendants: true }, { propertyName: "radioGroupElement", first: true, predicate: RadioGroupComponent, descendants: true, read: ElementRef }, { propertyName: "input", first: true, predicate: InputComponent, descendants: true, read: ElementRef }, { propertyName: "dropdown", first: true, predicate: DropdownComponent, descendants: true, read: ElementRef }, { propertyName: "textarea", first: true, predicate: TextareaComponent, descendants: true, read: ElementRef }, { propertyName: "dateInput", first: true, predicate: DateInputDirective, descendants: true }, { propertyName: "affixElements", predicate: AffixDirective }], ngImport: i0, template: "@if (_wrapContentInLabel) {\n <label>\n <ng-container *ngTemplateOutlet=\"labelTextTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"slottedInputTemplate\"></ng-container>\n <!-- add error message inside label if nested interative is in error state -->\n @if (_nestedInteractiveHasError) {\n <ng-container *ngTemplateOutlet=\"messageTemplate\"></ng-container>\n }\n </label>\n}\n\n<!-- add message outside label if nested interative is in valid state -->\n@if (!_nestedInteractiveHasError && _wrapContentInLabel) {\n <ng-container *ngTemplateOutlet=\"messageTemplate\"></ng-container>\n}\n\n@if (!_wrapContentInLabel) {\n <ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"slottedInputTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"messageTemplate\"></ng-container>\n}\n\n<ng-template #messageTemplate>\n @if (message !== undefined || counter) {\n <div class=\"texts\">\n <div\n aria-live=\"polite\"\n class=\"message\"\n [id]=\"_nestedInteractiveHasError ? _errorMessageId : _messageId\"\n >\n @if (message !== undefined) {\n <kirby-form-field-message [text]=\"message\"></kirby-form-field-message>\n }\n </div>\n @if (counter) {\n <div class=\"counter\">\n <ng-content select=\"kirby-input-counter\"></ng-content>\n </div>\n }\n </div>\n }\n</ng-template>\n\n<ng-template #slottedInputTemplate>\n <div class=\"affix-container\">\n <div class=\"prefix vertical-align semi-dark-text\">\n <ng-content select=\"[kirby-affix='prefix']\"></ng-content>\n </div>\n <ng-content select=\"input[kirby-input]\"></ng-content>\n <ng-content select=\"textarea[kirby-textarea]\"></ng-content>\n <ng-content select=\"kirby-radio-group\"></ng-content>\n <ng-content select=\"kirby-dropdown\"></ng-content>\n <div class=\"suffix vertical-align semi-dark-text\">\n <ng-content select=\"[kirby-affix='suffix']\"></ng-content>\n @if (showDefaultCalendarIcon) {\n <kirby-icon name=\"calendar\"></kirby-icon>\n }\n </div>\n </div>\n</ng-template>\n\n<ng-template #labelTextTemplate>\n @if (label) {\n <span class=\"text\">{{ label }}</span>\n }\n</ng-template>\n\n<ng-template #labelTemplate>\n @if (label) {\n <label class=\"text\" [id]=\"_labelId\" (click)=\"onLabelClick()\">{{ label }}</label>\n }\n</ng-template>\n", styles: [":host{display:block;position:relative;margin-bottom:16px}:host-context(kirby-item){margin-bottom:0}.texts{display:flex;justify-content:space-between;padding:2px 16px 0}.texts .message{flex:75%}.texts .message:only-child{flex-basis:auto}.texts .message>kirby-form-field-message{width:100%;display:flex}.texts .counter{flex:25%;text-align:right}label{display:block}.text{display:block;font-size:14px;font-weight:300;line-height:20px;margin-bottom:4px;padding:0 16px}.affix-container{position:relative}.affix-container .vertical-align{display:flex;align-items:center;position:absolute;top:0;bottom:0}.affix-container .prefix{left:12px;z-index:1}.affix-container .suffix{right:12px}.affix-container .semi-dark-text ::ng-deep>span,.affix-container .semi-dark-text ::ng-deep>h1,.affix-container .semi-dark-text ::ng-deep>h2,.affix-container .semi-dark-text ::ng-deep>h3,.affix-container .semi-dark-text ::ng-deep>h4,.affix-container .semi-dark-text ::ng-deep>h5,.affix-container .semi-dark-text ::ng-deep>h6,.affix-container .semi-dark-text ::ng-deep>p,.affix-container .semi-dark-text ::ng-deep>data{color:var(--kirby-text-color-semi-dark)}:host:not(.wrap-content-in-label) .affix-container:has(input[type=date]),:host(.wrap-content-in-label) label:has(input[type=date]){--date-input-background-color: var(--kirby-inputs-background-color)}@media(hover:hover){:host:not(.wrap-content-in-label) .affix-container:has(input[type=date]):hover,:host(.wrap-content-in-label) label:has(input[type=date]):hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer;--date-input-background-color: #e0e0e0}}:host:not(.wrap-content-in-label) .affix-container:has(input[type=date]):active,:host:not(.wrap-content-in-label) .affix-container:has(input[type=date]).interaction-state-active,:host(.wrap-content-in-label) label:has(input[type=date]):active,:host(.wrap-content-in-label) label:has(input[type=date]).interaction-state-active{--state-layer-opacity: .12;--state-layer-background-color: var(--kirby-black);--date-input-background-color: #cbcbcb}:host:not(.wrap-content-in-label) .affix-container:has(input[type=date]) .suffix:not(:empty),:host(.wrap-content-in-label) label:has(input[type=date]) .suffix:not(:empty){top:8px;bottom:8px;padding-inline-start:12px;pointer-events:none;background-color:var(--date-input-background-color);transition:all 80ms linear 0ms;transition-property:background-color}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FormFieldMessageComponent, selector: "kirby-form-field-message", inputs: ["text", "position"] }, { kind: "component", type: IconComponent, selector: "kirby-icon", inputs: ["size", "name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
660
687
|
}
|
|
661
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
688
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
662
689
|
type: Component,
|
|
663
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'kirby-form-field', imports: [NgTemplateOutlet, FormFieldMessageComponent, IconComponent], template: "@if (_wrapContentInLabel) {\n <label>\n <ng-container *ngTemplateOutlet=\"labelTextTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"slottedInputTemplate\"></ng-container>\n <!-- add error message inside label if nested interative is in error state -->\n @if (_nestedInteractiveHasError) {\n <ng-container *ngTemplateOutlet=\"messageTemplate\"></ng-container>\n }\n </label>\n}\n\n<!-- add message outside label if nested interative is in valid state -->\n@if (!_nestedInteractiveHasError && _wrapContentInLabel) {\n <ng-container *ngTemplateOutlet=\"messageTemplate\"></ng-container>\n}\n\n@if (!_wrapContentInLabel) {\n <ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"slottedInputTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"messageTemplate\"></ng-container>\n}\n\n<ng-template #messageTemplate>\n @if (message !== undefined || counter) {\n <div class=\"texts\">\n <div\n aria-live=\"polite\"\n class=\"message\"\n [id]=\"_nestedInteractiveHasError ? _errorMessageId : _messageId\"\n >\n @if (message !== undefined) {\n <kirby-form-field-message [text]=\"message\"></kirby-form-field-message>\n }\n </div>\n @if (counter) {\n <div class=\"counter\">\n <ng-content select=\"kirby-input-counter\"></ng-content>\n </div>\n }\n </div>\n }\n</ng-template>\n\n<ng-template #slottedInputTemplate>\n <div class=\"affix-container\">\n <div class=\"prefix vertical-align semi-dark-text\">\n <ng-content select=\"[kirby-affix='prefix']\"></ng-content>\n </div>\n <ng-content select=\"input[kirby-input]\"></ng-content>\n <ng-content select=\"textarea[kirby-textarea]\"></ng-content>\n <ng-content select=\"kirby-radio-group\"></ng-content>\n <ng-content select=\"kirby-dropdown\"></ng-content>\n <div class=\"suffix vertical-align semi-dark-text\">\n <ng-content select=\"[kirby-affix='suffix']\"></ng-content>\n @if (showDefaultCalendarIcon) {\n <kirby-icon name=\"calendar\"></kirby-icon>\n }\n </div>\n </div>\n</ng-template>\n\n<ng-template #labelTextTemplate>\n @if (label) {\n <span class=\"text\">{{ label }}</span>\n }\n</ng-template>\n\n<ng-template #labelTemplate>\n @if (label) {\n <label class=\"text\" [id]=\"_labelId\" (click)=\"onLabelClick()\">{{ label }}</label>\n }\n</ng-template>\n", styles: [":host{display:block;position:relative;margin-bottom:16px}:host-context(kirby-item){margin-bottom:0}.texts{display:flex;justify-content:space-between;padding:2px 16px 0}.texts .message{flex:75%}.texts .message:only-child{flex-basis:auto}.texts .message>kirby-form-field-message{width:100%;display:flex}.texts .counter{flex:25%;text-align:right}label{display:block}.text{display:block;font-size:14px;font-weight:300;line-height:20px;margin-bottom:4px;padding:0 16px}.affix-container{position:relative}.affix-container .vertical-align{display:flex;align-items:center;position:absolute;top:0;bottom:0}.affix-container .prefix{left:12px;z-index:1}.affix-container .suffix{right:12px}.affix-container .semi-dark-text ::ng-deep>span,.affix-container .semi-dark-text ::ng-deep>h1,.affix-container .semi-dark-text ::ng-deep>h2,.affix-container .semi-dark-text ::ng-deep>h3,.affix-container .semi-dark-text ::ng-deep>h4,.affix-container .semi-dark-text ::ng-deep>h5,.affix-container .semi-dark-text ::ng-deep>h6,.affix-container .semi-dark-text ::ng-deep>p,.affix-container .semi-dark-text ::ng-deep>data{color:var(--kirby-text-color-semi-dark)}:host:not(.wrap-content-in-label) .affix-container:has(input[type=date]),:host(.wrap-content-in-label) label:has(input[type=date]){--date-input-background-color: var(--kirby-inputs-background-color)}@media
|
|
690
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'kirby-form-field', imports: [NgTemplateOutlet, FormFieldMessageComponent, IconComponent], template: "@if (_wrapContentInLabel) {\n <label>\n <ng-container *ngTemplateOutlet=\"labelTextTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"slottedInputTemplate\"></ng-container>\n <!-- add error message inside label if nested interative is in error state -->\n @if (_nestedInteractiveHasError) {\n <ng-container *ngTemplateOutlet=\"messageTemplate\"></ng-container>\n }\n </label>\n}\n\n<!-- add message outside label if nested interative is in valid state -->\n@if (!_nestedInteractiveHasError && _wrapContentInLabel) {\n <ng-container *ngTemplateOutlet=\"messageTemplate\"></ng-container>\n}\n\n@if (!_wrapContentInLabel) {\n <ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"slottedInputTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"messageTemplate\"></ng-container>\n}\n\n<ng-template #messageTemplate>\n @if (message !== undefined || counter) {\n <div class=\"texts\">\n <div\n aria-live=\"polite\"\n class=\"message\"\n [id]=\"_nestedInteractiveHasError ? _errorMessageId : _messageId\"\n >\n @if (message !== undefined) {\n <kirby-form-field-message [text]=\"message\"></kirby-form-field-message>\n }\n </div>\n @if (counter) {\n <div class=\"counter\">\n <ng-content select=\"kirby-input-counter\"></ng-content>\n </div>\n }\n </div>\n }\n</ng-template>\n\n<ng-template #slottedInputTemplate>\n <div class=\"affix-container\">\n <div class=\"prefix vertical-align semi-dark-text\">\n <ng-content select=\"[kirby-affix='prefix']\"></ng-content>\n </div>\n <ng-content select=\"input[kirby-input]\"></ng-content>\n <ng-content select=\"textarea[kirby-textarea]\"></ng-content>\n <ng-content select=\"kirby-radio-group\"></ng-content>\n <ng-content select=\"kirby-dropdown\"></ng-content>\n <div class=\"suffix vertical-align semi-dark-text\">\n <ng-content select=\"[kirby-affix='suffix']\"></ng-content>\n @if (showDefaultCalendarIcon) {\n <kirby-icon name=\"calendar\"></kirby-icon>\n }\n </div>\n </div>\n</ng-template>\n\n<ng-template #labelTextTemplate>\n @if (label) {\n <span class=\"text\">{{ label }}</span>\n }\n</ng-template>\n\n<ng-template #labelTemplate>\n @if (label) {\n <label class=\"text\" [id]=\"_labelId\" (click)=\"onLabelClick()\">{{ label }}</label>\n }\n</ng-template>\n", styles: [":host{display:block;position:relative;margin-bottom:16px}:host-context(kirby-item){margin-bottom:0}.texts{display:flex;justify-content:space-between;padding:2px 16px 0}.texts .message{flex:75%}.texts .message:only-child{flex-basis:auto}.texts .message>kirby-form-field-message{width:100%;display:flex}.texts .counter{flex:25%;text-align:right}label{display:block}.text{display:block;font-size:14px;font-weight:300;line-height:20px;margin-bottom:4px;padding:0 16px}.affix-container{position:relative}.affix-container .vertical-align{display:flex;align-items:center;position:absolute;top:0;bottom:0}.affix-container .prefix{left:12px;z-index:1}.affix-container .suffix{right:12px}.affix-container .semi-dark-text ::ng-deep>span,.affix-container .semi-dark-text ::ng-deep>h1,.affix-container .semi-dark-text ::ng-deep>h2,.affix-container .semi-dark-text ::ng-deep>h3,.affix-container .semi-dark-text ::ng-deep>h4,.affix-container .semi-dark-text ::ng-deep>h5,.affix-container .semi-dark-text ::ng-deep>h6,.affix-container .semi-dark-text ::ng-deep>p,.affix-container .semi-dark-text ::ng-deep>data{color:var(--kirby-text-color-semi-dark)}:host:not(.wrap-content-in-label) .affix-container:has(input[type=date]),:host(.wrap-content-in-label) label:has(input[type=date]){--date-input-background-color: var(--kirby-inputs-background-color)}@media(hover:hover){:host:not(.wrap-content-in-label) .affix-container:has(input[type=date]):hover,:host(.wrap-content-in-label) label:has(input[type=date]):hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer;--date-input-background-color: #e0e0e0}}:host:not(.wrap-content-in-label) .affix-container:has(input[type=date]):active,:host:not(.wrap-content-in-label) .affix-container:has(input[type=date]).interaction-state-active,:host(.wrap-content-in-label) label:has(input[type=date]):active,:host(.wrap-content-in-label) label:has(input[type=date]).interaction-state-active{--state-layer-opacity: .12;--state-layer-background-color: var(--kirby-black);--date-input-background-color: #cbcbcb}:host:not(.wrap-content-in-label) .affix-container:has(input[type=date]) .suffix:not(:empty),:host(.wrap-content-in-label) label:has(input[type=date]) .suffix:not(:empty){top:8px;bottom:8px;padding-inline-start:12px;pointer-events:none;background-color:var(--date-input-background-color);transition:all 80ms linear 0ms;transition-property:background-color}\n"] }]
|
|
664
691
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.PlatformService }, { type: i0.Renderer2 }, { type: i2.WindowRef }, { type: i1.ResizeObserverService }, { type: i0.ChangeDetectorRef }], propDecorators: { label: [{
|
|
665
692
|
type: Input
|
|
666
693
|
}], message: [{
|
|
@@ -719,12 +746,10 @@ class DecimalMaskDirective {
|
|
|
719
746
|
this.max = this.getMax(maxlengthValue);
|
|
720
747
|
this.min = this.getMin(maxlengthValue);
|
|
721
748
|
}
|
|
722
|
-
|
|
723
|
-
this._onTouched();
|
|
724
|
-
}
|
|
725
|
-
constructor(elementRef, locale) {
|
|
749
|
+
constructor(elementRef, locale, valueAccessors) {
|
|
726
750
|
this.elementRef = elementRef;
|
|
727
751
|
this.locale = locale;
|
|
752
|
+
this.valueAccessors = valueAccessors;
|
|
728
753
|
this.precision = 2;
|
|
729
754
|
this.setMaxOnOverflow = false;
|
|
730
755
|
this.alignment = 'right';
|
|
@@ -732,8 +757,7 @@ class DecimalMaskDirective {
|
|
|
732
757
|
this.groupSeparator = getLocaleNumberSymbol(this.locale, NumberSymbol.Group);
|
|
733
758
|
this.radixPoint = getLocaleNumberSymbol(this.locale, NumberSymbol.Decimal);
|
|
734
759
|
this._allowMinus = false;
|
|
735
|
-
this.
|
|
736
|
-
this._onTouched = () => { };
|
|
760
|
+
this.extendBuiltinValueAccessor();
|
|
737
761
|
}
|
|
738
762
|
ngOnInit() {
|
|
739
763
|
// Set type="text", because functionality like 'setSelectionRange' are not supported on type="number"
|
|
@@ -742,21 +766,6 @@ class DecimalMaskDirective {
|
|
|
742
766
|
this.elementRef.nativeElement.removeAttribute('maxlength');
|
|
743
767
|
this.initMask();
|
|
744
768
|
}
|
|
745
|
-
writeValue(val) {
|
|
746
|
-
if (!this.inputmask)
|
|
747
|
-
return;
|
|
748
|
-
const formattedValue = String(val).replace('.', this.radixPoint);
|
|
749
|
-
this.inputmask.setValue(formattedValue);
|
|
750
|
-
}
|
|
751
|
-
registerOnChange(onChange) {
|
|
752
|
-
this._onChange = onChange;
|
|
753
|
-
}
|
|
754
|
-
registerOnTouched(fn) {
|
|
755
|
-
this._onTouched = fn;
|
|
756
|
-
}
|
|
757
|
-
setDisabledState(isDisabled) {
|
|
758
|
-
this.elementRef.nativeElement.disabled = isDisabled;
|
|
759
|
-
}
|
|
760
769
|
initMask() {
|
|
761
770
|
new Inputmask('decimal', {
|
|
762
771
|
groupSeparator: this._groupSeperatorDisabled ? '' : this.groupSeparator,
|
|
@@ -778,8 +787,6 @@ class DecimalMaskDirective {
|
|
|
778
787
|
onBeforeWrite: () => {
|
|
779
788
|
if (!this.inputmask)
|
|
780
789
|
return;
|
|
781
|
-
const unmaskedValue = this.inputmask.unmaskedvalue();
|
|
782
|
-
this._onChange(unmaskedValue.replace(this.radixPoint, '.'));
|
|
783
790
|
},
|
|
784
791
|
}).mask(this.elementRef.nativeElement);
|
|
785
792
|
this.inputmask = this.elementRef.nativeElement.inputmask;
|
|
@@ -793,31 +800,46 @@ class DecimalMaskDirective {
|
|
|
793
800
|
maxlengthValue = -Math.abs(maxlengthValue);
|
|
794
801
|
return this.min === undefined ? maxlengthValue : -Math.abs(Math.max(this.min, maxlengthValue));
|
|
795
802
|
}
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
{
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
803
|
+
extendBuiltinValueAccessor() {
|
|
804
|
+
extendValueAccessors(this.valueAccessors, {
|
|
805
|
+
writeValue: {
|
|
806
|
+
afterWriteValue: (value) => {
|
|
807
|
+
// Update the inputmask display when value is set programmatically
|
|
808
|
+
if (this.inputmask && value != null) {
|
|
809
|
+
const formattedValue = String(value).replace('.', this.radixPoint);
|
|
810
|
+
this.inputmask.setValue(formattedValue);
|
|
811
|
+
}
|
|
812
|
+
},
|
|
802
813
|
},
|
|
803
|
-
|
|
814
|
+
registerOnChange: {
|
|
815
|
+
transformValue: (value) => {
|
|
816
|
+
// Provide unmasked and normalized values to the form control
|
|
817
|
+
if (this.inputmask) {
|
|
818
|
+
const unmaskedValue = this.inputmask.unmaskedvalue();
|
|
819
|
+
return unmaskedValue.replace(this.radixPoint, '.');
|
|
820
|
+
}
|
|
821
|
+
return value;
|
|
822
|
+
},
|
|
823
|
+
},
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DecimalMaskDirective, deps: [{ token: i0.ElementRef }, { token: LOCALE_ID }, { token: NG_VALUE_ACCESSOR, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
827
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: DecimalMaskDirective, isStandalone: true, selector: "[kirby-decimal-mask]", inputs: { min: "min", max: "max", precision: "precision", setMaxOnOverflow: "setMaxOnOverflow", alignment: "alignment", padPrecisionDigits: "padPrecisionDigits", allowMinus: "allowMinus", disableGroupSeperator: "disableGroupSeperator", maxlength: "maxlength" }, ngImport: i0 }); }
|
|
804
828
|
}
|
|
805
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
829
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DecimalMaskDirective, decorators: [{
|
|
806
830
|
type: Directive,
|
|
807
831
|
args: [{
|
|
808
832
|
// eslint-disable-next-line
|
|
809
833
|
selector: '[kirby-decimal-mask]',
|
|
810
|
-
providers: [
|
|
811
|
-
{
|
|
812
|
-
provide: NG_VALUE_ACCESSOR,
|
|
813
|
-
multi: true,
|
|
814
|
-
useExisting: DecimalMaskDirective,
|
|
815
|
-
},
|
|
816
|
-
],
|
|
817
834
|
}]
|
|
818
835
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
819
836
|
type: Inject,
|
|
820
837
|
args: [LOCALE_ID]
|
|
838
|
+
}] }, { type: undefined, decorators: [{
|
|
839
|
+
type: Optional
|
|
840
|
+
}, {
|
|
841
|
+
type: Inject,
|
|
842
|
+
args: [NG_VALUE_ACCESSOR]
|
|
821
843
|
}] }], propDecorators: { min: [{
|
|
822
844
|
type: Input
|
|
823
845
|
}], max: [{
|
|
@@ -836,18 +858,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
836
858
|
type: Input
|
|
837
859
|
}], maxlength: [{
|
|
838
860
|
type: Input
|
|
839
|
-
}], onTouched: [{
|
|
840
|
-
type: HostListener,
|
|
841
|
-
args: ['blur']
|
|
842
861
|
}] } });
|
|
843
862
|
|
|
844
863
|
const imports = [FormFieldComponent, FormFieldMessageComponent, InputCounterComponent];
|
|
845
864
|
class FormFieldModule {
|
|
846
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
847
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
848
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
865
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
866
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: FormFieldModule, imports: [CommonModule, DecimalMaskDirective, IconModule, AffixDirective, FormFieldComponent, FormFieldMessageComponent, InputCounterComponent], exports: [FormFieldComponent, FormFieldMessageComponent, InputCounterComponent, DecimalMaskDirective, AffixDirective] }); }
|
|
867
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FormFieldModule, imports: [CommonModule, IconModule, FormFieldComponent] }); }
|
|
849
868
|
}
|
|
850
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
869
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FormFieldModule, decorators: [{
|
|
851
870
|
type: NgModule,
|
|
852
871
|
args: [{
|
|
853
872
|
imports: [CommonModule, DecimalMaskDirective, IconModule, AffixDirective, ...imports],
|