@vadem/ui 0.0.0-stage → 0.0.1
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/LICENSE-lucide.txt +43 -0
- package/README.md +19 -2
- package/fesm2022/vadem-ui-accordion.mjs +139 -0
- package/fesm2022/vadem-ui-accordion.mjs.map +1 -0
- package/fesm2022/vadem-ui-active-filters.mjs +355 -0
- package/fesm2022/vadem-ui-active-filters.mjs.map +1 -0
- package/fesm2022/vadem-ui-alert-dialog.mjs +433 -0
- package/fesm2022/vadem-ui-alert-dialog.mjs.map +1 -0
- package/fesm2022/vadem-ui-alert.mjs +266 -0
- package/fesm2022/vadem-ui-alert.mjs.map +1 -0
- package/fesm2022/vadem-ui-autocomplete.mjs +715 -0
- package/fesm2022/vadem-ui-autocomplete.mjs.map +1 -0
- package/fesm2022/vadem-ui-avatar.mjs +219 -0
- package/fesm2022/vadem-ui-avatar.mjs.map +1 -0
- package/fesm2022/vadem-ui-badge.mjs +86 -0
- package/fesm2022/vadem-ui-badge.mjs.map +1 -0
- package/fesm2022/vadem-ui-breadcrumbs.mjs +61 -0
- package/fesm2022/vadem-ui-breadcrumbs.mjs.map +1 -0
- package/fesm2022/vadem-ui-button.mjs +220 -0
- package/fesm2022/vadem-ui-button.mjs.map +1 -0
- package/fesm2022/vadem-ui-calendar.mjs +1314 -0
- package/fesm2022/vadem-ui-calendar.mjs.map +1 -0
- package/fesm2022/vadem-ui-card.mjs +271 -0
- package/fesm2022/vadem-ui-card.mjs.map +1 -0
- package/fesm2022/vadem-ui-character-count.mjs +269 -0
- package/fesm2022/vadem-ui-character-count.mjs.map +1 -0
- package/fesm2022/vadem-ui-chart.mjs +1984 -0
- package/fesm2022/vadem-ui-chart.mjs.map +1 -0
- package/fesm2022/vadem-ui-checkbox.mjs +67 -0
- package/fesm2022/vadem-ui-checkbox.mjs.map +1 -0
- package/fesm2022/vadem-ui-color-picker.mjs +815 -0
- package/fesm2022/vadem-ui-color-picker.mjs.map +1 -0
- package/fesm2022/vadem-ui-command.mjs +735 -0
- package/fesm2022/vadem-ui-command.mjs.map +1 -0
- package/fesm2022/vadem-ui-copy-button.mjs +375 -0
- package/fesm2022/vadem-ui-copy-button.mjs.map +1 -0
- package/fesm2022/vadem-ui-date-range-picker.mjs +1011 -0
- package/fesm2022/vadem-ui-date-range-picker.mjs.map +1 -0
- package/fesm2022/vadem-ui-description-list.mjs +59 -0
- package/fesm2022/vadem-ui-description-list.mjs.map +1 -0
- package/fesm2022/vadem-ui-dialog.mjs +587 -0
- package/fesm2022/vadem-ui-dialog.mjs.map +1 -0
- package/fesm2022/vadem-ui-dropzone.mjs +176 -0
- package/fesm2022/vadem-ui-dropzone.mjs.map +1 -0
- package/fesm2022/vadem-ui-editable-text.mjs +641 -0
- package/fesm2022/vadem-ui-editable-text.mjs.map +1 -0
- package/fesm2022/vadem-ui-empty-state.mjs +175 -0
- package/fesm2022/vadem-ui-empty-state.mjs.map +1 -0
- package/fesm2022/vadem-ui-expandable-text.mjs +244 -0
- package/fesm2022/vadem-ui-expandable-text.mjs.map +1 -0
- package/fesm2022/vadem-ui-field.mjs +583 -0
- package/fesm2022/vadem-ui-field.mjs.map +1 -0
- package/fesm2022/vadem-ui-file-preview.mjs +532 -0
- package/fesm2022/vadem-ui-file-preview.mjs.map +1 -0
- package/fesm2022/vadem-ui-file-size.mjs +83 -0
- package/fesm2022/vadem-ui-file-size.mjs.map +1 -0
- package/fesm2022/vadem-ui-form-error-summary.mjs +201 -0
- package/fesm2022/vadem-ui-form-error-summary.mjs.map +1 -0
- package/fesm2022/vadem-ui-icon.mjs +303 -0
- package/fesm2022/vadem-ui-icon.mjs.map +1 -0
- package/fesm2022/vadem-ui-input.mjs +120 -0
- package/fesm2022/vadem-ui-input.mjs.map +1 -0
- package/fesm2022/vadem-ui-kbd.mjs +286 -0
- package/fesm2022/vadem-ui-kbd.mjs.map +1 -0
- package/fesm2022/vadem-ui-keyboard.mjs +105 -0
- package/fesm2022/vadem-ui-keyboard.mjs.map +1 -0
- package/fesm2022/vadem-ui-locale.mjs +443 -0
- package/fesm2022/vadem-ui-locale.mjs.map +1 -0
- package/fesm2022/vadem-ui-menu.mjs +637 -0
- package/fesm2022/vadem-ui-menu.mjs.map +1 -0
- package/fesm2022/vadem-ui-navigation-list.mjs +130 -0
- package/fesm2022/vadem-ui-navigation-list.mjs.map +1 -0
- package/fesm2022/vadem-ui-number-input.mjs +264 -0
- package/fesm2022/vadem-ui-number-input.mjs.map +1 -0
- package/fesm2022/vadem-ui-otp-input.mjs +86 -0
- package/fesm2022/vadem-ui-otp-input.mjs.map +1 -0
- package/fesm2022/vadem-ui-pagination.mjs +353 -0
- package/fesm2022/vadem-ui-pagination.mjs.map +1 -0
- package/fesm2022/vadem-ui-password-input.mjs +213 -0
- package/fesm2022/vadem-ui-password-input.mjs.map +1 -0
- package/fesm2022/vadem-ui-popover.mjs +178 -0
- package/fesm2022/vadem-ui-popover.mjs.map +1 -0
- package/fesm2022/vadem-ui-progress.mjs +331 -0
- package/fesm2022/vadem-ui-progress.mjs.map +1 -0
- package/fesm2022/vadem-ui-radio.mjs +39 -0
- package/fesm2022/vadem-ui-radio.mjs.map +1 -0
- package/fesm2022/vadem-ui-range-slider.mjs +561 -0
- package/fesm2022/vadem-ui-range-slider.mjs.map +1 -0
- package/fesm2022/vadem-ui-rating.mjs +404 -0
- package/fesm2022/vadem-ui-rating.mjs.map +1 -0
- package/fesm2022/vadem-ui-relative-time.mjs +217 -0
- package/fesm2022/vadem-ui-relative-time.mjs.map +1 -0
- package/fesm2022/vadem-ui-reorder-list.mjs +601 -0
- package/fesm2022/vadem-ui-reorder-list.mjs.map +1 -0
- package/fesm2022/vadem-ui-scroll-area.mjs +65 -0
- package/fesm2022/vadem-ui-scroll-area.mjs.map +1 -0
- package/fesm2022/vadem-ui-search-input.mjs +307 -0
- package/fesm2022/vadem-ui-search-input.mjs.map +1 -0
- package/fesm2022/vadem-ui-segmented.mjs +297 -0
- package/fesm2022/vadem-ui-segmented.mjs.map +1 -0
- package/fesm2022/vadem-ui-select.mjs +1462 -0
- package/fesm2022/vadem-ui-select.mjs.map +1 -0
- package/fesm2022/vadem-ui-sidebar.mjs +493 -0
- package/fesm2022/vadem-ui-sidebar.mjs.map +1 -0
- package/fesm2022/vadem-ui-skeleton.mjs +106 -0
- package/fesm2022/vadem-ui-skeleton.mjs.map +1 -0
- package/fesm2022/vadem-ui-slider.mjs +60 -0
- package/fesm2022/vadem-ui-slider.mjs.map +1 -0
- package/fesm2022/vadem-ui-splitter.mjs +438 -0
- package/fesm2022/vadem-ui-splitter.mjs.map +1 -0
- package/fesm2022/vadem-ui-stat.mjs +369 -0
- package/fesm2022/vadem-ui-stat.mjs.map +1 -0
- package/fesm2022/vadem-ui-stepper.mjs +483 -0
- package/fesm2022/vadem-ui-stepper.mjs.map +1 -0
- package/fesm2022/vadem-ui-switch.mjs +45 -0
- package/fesm2022/vadem-ui-switch.mjs.map +1 -0
- package/fesm2022/vadem-ui-table.mjs +593 -0
- package/fesm2022/vadem-ui-table.mjs.map +1 -0
- package/fesm2022/vadem-ui-tabs.mjs +405 -0
- package/fesm2022/vadem-ui-tabs.mjs.map +1 -0
- package/fesm2022/vadem-ui-tag-input.mjs +685 -0
- package/fesm2022/vadem-ui-tag-input.mjs.map +1 -0
- package/fesm2022/vadem-ui-text-highlight.mjs +126 -0
- package/fesm2022/vadem-ui-text-highlight.mjs.map +1 -0
- package/fesm2022/vadem-ui-time-input.mjs +430 -0
- package/fesm2022/vadem-ui-time-input.mjs.map +1 -0
- package/fesm2022/vadem-ui-timeline.mjs +313 -0
- package/fesm2022/vadem-ui-timeline.mjs.map +1 -0
- package/fesm2022/vadem-ui-toast.mjs +397 -0
- package/fesm2022/vadem-ui-toast.mjs.map +1 -0
- package/fesm2022/vadem-ui-toolbar.mjs +396 -0
- package/fesm2022/vadem-ui-toolbar.mjs.map +1 -0
- package/fesm2022/vadem-ui-tooltip.mjs +218 -0
- package/fesm2022/vadem-ui-tooltip.mjs.map +1 -0
- package/fesm2022/vadem-ui-tree.mjs +551 -0
- package/fesm2022/vadem-ui-tree.mjs.map +1 -0
- package/fesm2022/vadem-ui-upload-list.mjs +408 -0
- package/fesm2022/vadem-ui-upload-list.mjs.map +1 -0
- package/fesm2022/vadem-ui.mjs +4 -0
- package/fesm2022/vadem-ui.mjs.map +1 -0
- package/fonts/jetbrains-mono/OFL.txt +93 -0
- package/fonts/jetbrains-mono/jetbrains-mono-cyrillic.woff2 +0 -0
- package/fonts/jetbrains-mono/jetbrains-mono-latin.woff2 +0 -0
- package/fonts/manrope/OFL.txt +93 -0
- package/fonts/manrope/manrope-cyrillic.woff2 +0 -0
- package/fonts/manrope/manrope-latin.woff2 +0 -0
- package/package.json +306 -3
- package/styles/base.css +160 -0
- package/styles/components/accordion.css +130 -0
- package/styles/components/active-filters.css +42 -0
- package/styles/components/alert-dialog.css +34 -0
- package/styles/components/alert.css +159 -0
- package/styles/components/autocomplete.css +97 -0
- package/styles/components/avatar.css +90 -0
- package/styles/components/badge.css +91 -0
- package/styles/components/breadcrumbs.css +94 -0
- package/styles/components/button.css +174 -0
- package/styles/components/calendar.css +186 -0
- package/styles/components/card.css +206 -0
- package/styles/components/character-count.css +41 -0
- package/styles/components/chart.css +308 -0
- package/styles/components/checkbox.css +115 -0
- package/styles/components/color-picker.css +158 -0
- package/styles/components/command.css +175 -0
- package/styles/components/copy-button.css +58 -0
- package/styles/components/date-range-picker.css +153 -0
- package/styles/components/description-list.css +69 -0
- package/styles/components/dialog.css +334 -0
- package/styles/components/dropzone.css +89 -0
- package/styles/components/editable-text.css +58 -0
- package/styles/components/empty-state.css +72 -0
- package/styles/components/expandable-text.css +24 -0
- package/styles/components/field.css +148 -0
- package/styles/components/file-preview.css +65 -0
- package/styles/components/form-error-summary.css +71 -0
- package/styles/components/icon.css +38 -0
- package/styles/components/index.css +80 -0
- package/styles/components/input.css +171 -0
- package/styles/components/kbd.css +42 -0
- package/styles/components/menu.css +168 -0
- package/styles/components/multi-select.css +156 -0
- package/styles/components/navigation-list.css +147 -0
- package/styles/components/number-input.css +33 -0
- package/styles/components/otp-input.css +26 -0
- package/styles/components/pagination.css +127 -0
- package/styles/components/password-input.css +20 -0
- package/styles/components/popover.css +93 -0
- package/styles/components/progress-ring.css +112 -0
- package/styles/components/progress.css +162 -0
- package/styles/components/radio.css +117 -0
- package/styles/components/range-slider.css +158 -0
- package/styles/components/rating.css +100 -0
- package/styles/components/reorder-list.css +143 -0
- package/styles/components/scroll-area.css +39 -0
- package/styles/components/search-input.css +25 -0
- package/styles/components/segmented.css +136 -0
- package/styles/components/select.css +257 -0
- package/styles/components/sidebar.css +105 -0
- package/styles/components/skeleton.css +83 -0
- package/styles/components/slider.css +132 -0
- package/styles/components/splitter.css +83 -0
- package/styles/components/stat.css +62 -0
- package/styles/components/stepper.css +236 -0
- package/styles/components/switch.css +107 -0
- package/styles/components/table.css +195 -0
- package/styles/components/tabs.css +198 -0
- package/styles/components/tag-input.css +138 -0
- package/styles/components/text-highlight.css +22 -0
- package/styles/components/time-input.css +96 -0
- package/styles/components/timeline.css +182 -0
- package/styles/components/toast.css +146 -0
- package/styles/components/toolbar.css +72 -0
- package/styles/components/tooltip.css +93 -0
- package/styles/components/tree.css +88 -0
- package/styles/components/upload-list.css +113 -0
- package/styles/fonts.css +67 -0
- package/styles/index.css +14 -0
- package/styles/reset.css +57 -0
- package/styles/tokens/primitives.css +364 -0
- package/styles/tokens/semantic.css +233 -0
- package/types/vadem-ui-accordion.d.ts +43 -0
- package/types/vadem-ui-active-filters.d.ts +73 -0
- package/types/vadem-ui-alert-dialog.d.ts +87 -0
- package/types/vadem-ui-alert.d.ts +64 -0
- package/types/vadem-ui-autocomplete.d.ts +156 -0
- package/types/vadem-ui-avatar.d.ts +59 -0
- package/types/vadem-ui-badge.d.ts +25 -0
- package/types/vadem-ui-breadcrumbs.d.ts +22 -0
- package/types/vadem-ui-button.d.ts +52 -0
- package/types/vadem-ui-calendar.d.ts +327 -0
- package/types/vadem-ui-card.d.ts +58 -0
- package/types/vadem-ui-character-count.d.ts +71 -0
- package/types/vadem-ui-chart.d.ts +452 -0
- package/types/vadem-ui-checkbox.d.ts +20 -0
- package/types/vadem-ui-color-picker.d.ts +171 -0
- package/types/vadem-ui-command.d.ts +145 -0
- package/types/vadem-ui-copy-button.d.ts +90 -0
- package/types/vadem-ui-date-range-picker.d.ts +216 -0
- package/types/vadem-ui-description-list.d.ts +15 -0
- package/types/vadem-ui-dialog.d.ts +174 -0
- package/types/vadem-ui-dropzone.d.ts +73 -0
- package/types/vadem-ui-editable-text.d.ts +141 -0
- package/types/vadem-ui-empty-state.d.ts +34 -0
- package/types/vadem-ui-expandable-text.d.ts +52 -0
- package/types/vadem-ui-field.d.ts +180 -0
- package/types/vadem-ui-file-preview.d.ts +108 -0
- package/types/vadem-ui-file-size.d.ts +18 -0
- package/types/vadem-ui-form-error-summary.d.ts +46 -0
- package/types/vadem-ui-icon.d.ts +152 -0
- package/types/vadem-ui-input.d.ts +31 -0
- package/types/vadem-ui-kbd.d.ts +66 -0
- package/types/vadem-ui-keyboard.d.ts +61 -0
- package/types/vadem-ui-locale.d.ts +241 -0
- package/types/vadem-ui-menu.d.ts +132 -0
- package/types/vadem-ui-navigation-list.d.ts +28 -0
- package/types/vadem-ui-number-input.d.ts +39 -0
- package/types/vadem-ui-otp-input.d.ts +15 -0
- package/types/vadem-ui-pagination.d.ts +96 -0
- package/types/vadem-ui-password-input.d.ts +36 -0
- package/types/vadem-ui-popover.d.ts +48 -0
- package/types/vadem-ui-progress.d.ts +95 -0
- package/types/vadem-ui-radio.d.ts +11 -0
- package/types/vadem-ui-range-slider.d.ts +136 -0
- package/types/vadem-ui-rating.d.ts +95 -0
- package/types/vadem-ui-relative-time.d.ts +58 -0
- package/types/vadem-ui-reorder-list.d.ts +120 -0
- package/types/vadem-ui-scroll-area.d.ts +13 -0
- package/types/vadem-ui-search-input.d.ts +58 -0
- package/types/vadem-ui-segmented.d.ts +76 -0
- package/types/vadem-ui-select.d.ts +303 -0
- package/types/vadem-ui-sidebar.d.ts +70 -0
- package/types/vadem-ui-skeleton.d.ts +28 -0
- package/types/vadem-ui-slider.d.ts +17 -0
- package/types/vadem-ui-splitter.d.ts +99 -0
- package/types/vadem-ui-stat.d.ts +101 -0
- package/types/vadem-ui-stepper.d.ts +108 -0
- package/types/vadem-ui-switch.d.ts +10 -0
- package/types/vadem-ui-table.d.ts +172 -0
- package/types/vadem-ui-tabs.d.ts +101 -0
- package/types/vadem-ui-tag-input.d.ts +170 -0
- package/types/vadem-ui-text-highlight.d.ts +27 -0
- package/types/vadem-ui-time-input.d.ts +47 -0
- package/types/vadem-ui-timeline.d.ts +54 -0
- package/types/vadem-ui-toast.d.ts +104 -0
- package/types/vadem-ui-toolbar.d.ts +80 -0
- package/types/vadem-ui-tooltip.d.ts +71 -0
- package/types/vadem-ui-tree.d.ts +123 -0
- package/types/vadem-ui-upload-list.d.ts +70 -0
- package/types/vadem-ui.d.ts +1 -0
|
@@ -0,0 +1,1011 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injector, LOCALE_ID, ViewEncapsulation, afterNextRender, afterRenderEffect, booleanAttribute, computed, inject, input, model, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { NgControl } from "@angular/forms";
|
|
4
|
+
import { FormField, transformedValue } from "@angular/forms/signals";
|
|
5
|
+
import { VD_FIELD, vdNgControlState, vdUniqueId } from "@vadem/ui/field";
|
|
6
|
+
import { VdCalendar, vdClampDate, vdFormatShort, vdParseDate, vdParseIso, vdToday } from "@vadem/ui/calendar";
|
|
7
|
+
import { VdPopover } from "@vadem/ui/popover";
|
|
8
|
+
import { VdButton } from "@vadem/ui/button";
|
|
9
|
+
import { VdIcon } from "@vadem/ui/icon";
|
|
10
|
+
import { vdTexts } from "@vadem/ui/locale";
|
|
11
|
+
function vdValidRange(value) {
|
|
12
|
+
if (!value || typeof value !== "object") return null;
|
|
13
|
+
const range = value;
|
|
14
|
+
return typeof range.start === "string" && typeof range.end === "string" && vdParseIso(range.start) && vdParseIso(range.end) && range.start <= range.end ? {
|
|
15
|
+
start: range.start,
|
|
16
|
+
end: range.end
|
|
17
|
+
} : null;
|
|
18
|
+
}
|
|
19
|
+
function vdRangeAllowed(range, min, max) {
|
|
20
|
+
return (!min || range.start >= min) && (!max || range.end <= max) && (!min || !max || min <= max);
|
|
21
|
+
}
|
|
22
|
+
function vdRangeBetween(a, b) {
|
|
23
|
+
return a <= b ? {
|
|
24
|
+
start: a,
|
|
25
|
+
end: b
|
|
26
|
+
} : {
|
|
27
|
+
start: b,
|
|
28
|
+
end: a
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function vdParseRangeDate(text, locale) {
|
|
32
|
+
return vdParseDate(text.replace(/[٠-٩۰-۹]/g, (char) => String(char.charCodeAt(0) - (char >= "۰" ? 1776 : 1632))), locale);
|
|
33
|
+
}
|
|
34
|
+
var VdDateRangePicker = class VdDateRangePicker {
|
|
35
|
+
value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
36
|
+
minDate = input(null, ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
|
|
37
|
+
maxDate = input(null, ...ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []);
|
|
38
|
+
locale = input(inject(LOCALE_ID), ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
39
|
+
firstDayOfWeek = input(void 0, ...ngDevMode ? [{ debugName: "firstDayOfWeek" }] : /* istanbul ignore next */ []);
|
|
40
|
+
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
41
|
+
disabled = input(false, {
|
|
42
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
43
|
+
transform: booleanAttribute
|
|
44
|
+
});
|
|
45
|
+
readonly = input(false, {
|
|
46
|
+
...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
|
|
47
|
+
transform: booleanAttribute
|
|
48
|
+
});
|
|
49
|
+
invalid = input(false, {
|
|
50
|
+
...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
|
|
51
|
+
transform: booleanAttribute
|
|
52
|
+
});
|
|
53
|
+
touched = input(false, {
|
|
54
|
+
...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
|
|
55
|
+
transform: booleanAttribute
|
|
56
|
+
});
|
|
57
|
+
required = input(false, {
|
|
58
|
+
...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
|
|
59
|
+
transform: booleanAttribute
|
|
60
|
+
});
|
|
61
|
+
groupLabel = input(...ngDevMode ? [void 0, { debugName: "groupLabel" }] : /* istanbul ignore next */ []);
|
|
62
|
+
startLabel = input(...ngDevMode ? [void 0, { debugName: "startLabel" }] : /* istanbul ignore next */ []);
|
|
63
|
+
endLabel = input(...ngDevMode ? [void 0, { debugName: "endLabel" }] : /* istanbul ignore next */ []);
|
|
64
|
+
openLabel = input(...ngDevMode ? [void 0, { debugName: "openLabel" }] : /* istanbul ignore next */ []);
|
|
65
|
+
pickerLabel = input(...ngDevMode ? [void 0, { debugName: "pickerLabel" }] : /* istanbul ignore next */ []);
|
|
66
|
+
previousLabel = input(...ngDevMode ? [void 0, { debugName: "previousLabel" }] : /* istanbul ignore next */ []);
|
|
67
|
+
nextLabel = input(...ngDevMode ? [void 0, { debugName: "nextLabel" }] : /* istanbul ignore next */ []);
|
|
68
|
+
startInstruction = input(...ngDevMode ? [void 0, { debugName: "startInstruction" }] : /* istanbul ignore next */ []);
|
|
69
|
+
endInstruction = input(...ngDevMode ? [void 0, { debugName: "endInstruction" }] : /* istanbul ignore next */ []);
|
|
70
|
+
errorLabel = input(...ngDevMode ? [void 0, { debugName: "errorLabel" }] : /* istanbul ignore next */ []);
|
|
71
|
+
t = vdTexts("dateRangePicker", {
|
|
72
|
+
groupLabel: this.groupLabel,
|
|
73
|
+
startLabel: this.startLabel,
|
|
74
|
+
endLabel: this.endLabel,
|
|
75
|
+
openLabel: this.openLabel,
|
|
76
|
+
pickerLabel: this.pickerLabel,
|
|
77
|
+
previousLabel: this.previousLabel,
|
|
78
|
+
nextLabel: this.nextLabel,
|
|
79
|
+
startInstruction: this.startInstruction,
|
|
80
|
+
endInstruction: this.endInstruction,
|
|
81
|
+
errorLabel: this.errorLabel
|
|
82
|
+
});
|
|
83
|
+
touch = output();
|
|
84
|
+
controlId = vdUniqueId("vd-date-range-picker");
|
|
85
|
+
endId = `${this.controlId}-end`;
|
|
86
|
+
errorId = `${this.controlId}-error`;
|
|
87
|
+
safeMin = computed(() => vdParseIso(this.minDate()) ? this.minDate() : null, ...ngDevMode ? [{ debugName: "safeMin" }] : /* istanbul ignore next */ []);
|
|
88
|
+
safeMax = computed(() => vdParseIso(this.maxDate()) ? this.maxDate() : null, ...ngDevMode ? [{ debugName: "safeMax" }] : /* istanbul ignore next */ []);
|
|
89
|
+
range = computed(() => vdValidRange(this.value()), ...ngDevMode ? [{ debugName: "range" }] : /* istanbul ignore next */ []);
|
|
90
|
+
raw = transformedValue(this.value, {
|
|
91
|
+
format: (value) => {
|
|
92
|
+
const range = vdValidRange(value);
|
|
93
|
+
return {
|
|
94
|
+
start: this.format(range?.start ?? null),
|
|
95
|
+
end: this.format(range?.end ?? null),
|
|
96
|
+
commit: true
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
parse: (text) => {
|
|
100
|
+
const start = text.start.trim(), end = text.end.trim();
|
|
101
|
+
if (!start && !end) return { value: null };
|
|
102
|
+
const a = vdParseRangeDate(start, this.locale()), b = vdParseRangeDate(end, this.locale());
|
|
103
|
+
const range = a && b && a <= b ? {
|
|
104
|
+
start: a,
|
|
105
|
+
end: b
|
|
106
|
+
} : null;
|
|
107
|
+
if (!range || !vdRangeAllowed(range, this.safeMin(), this.safeMax())) return {
|
|
108
|
+
value: null,
|
|
109
|
+
error: {
|
|
110
|
+
kind: "dateRange",
|
|
111
|
+
message: this.t().errorLabel
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
return { value: text.commit ? range : null };
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
startText = computed(() => this.raw().start, ...ngDevMode ? [{ debugName: "startText" }] : /* istanbul ignore next */ []);
|
|
118
|
+
endText = computed(() => this.raw().end, ...ngDevMode ? [{ debugName: "endText" }] : /* istanbul ignore next */ []);
|
|
119
|
+
placeholder = computed(() => vdFormatShort("2026-12-31", this.locale()), ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
120
|
+
feedback = signal(false, ...ngDevMode ? [{ debugName: "feedback" }] : /* istanbul ignore next */ []);
|
|
121
|
+
parseError = computed(() => this.feedback() && this.raw.parseErrors().length > 0, ...ngDevMode ? [{ debugName: "parseError" }] : /* istanbul ignore next */ []);
|
|
122
|
+
draftStart = signal(null, ...ngDevMode ? [{ debugName: "draftStart" }] : /* istanbul ignore next */ []);
|
|
123
|
+
draftEnd = signal(null, ...ngDevMode ? [{ debugName: "draftEnd" }] : /* istanbul ignore next */ []);
|
|
124
|
+
selectingEnd = signal(false, ...ngDevMode ? [{ debugName: "selectingEnd" }] : /* istanbul ignore next */ []);
|
|
125
|
+
open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
126
|
+
field = inject(VD_FIELD, { optional: true });
|
|
127
|
+
host = inject(ElementRef).nativeElement;
|
|
128
|
+
popup = viewChild.required(VdPopover, ...ngDevMode ? [{ debugName: "popup" }] : /* istanbul ignore next */ []);
|
|
129
|
+
trigger = viewChild.required("trigger", {
|
|
130
|
+
...ngDevMode ? { debugName: "trigger" } : /* istanbul ignore next */ {},
|
|
131
|
+
read: ElementRef
|
|
132
|
+
});
|
|
133
|
+
startInput = viewChild.required("start", ...ngDevMode ? [{ debugName: "startInput" }] : /* istanbul ignore next */ []);
|
|
134
|
+
focus(options) {
|
|
135
|
+
this.startInput().nativeElement.focus(options);
|
|
136
|
+
}
|
|
137
|
+
calendar = viewChild.required(VdCalendar, ...ngDevMode ? [{ debugName: "calendar" }] : /* istanbul ignore next */ []);
|
|
138
|
+
injector = inject(Injector);
|
|
139
|
+
destroyRef = inject(DestroyRef);
|
|
140
|
+
formBound = signal(false, ...ngDevMode ? [{ debugName: "formBound" }] : /* istanbul ignore next */ []);
|
|
141
|
+
ngSource = signal(null, ...ngDevMode ? [{ debugName: "ngSource" }] : /* istanbul ignore next */ []);
|
|
142
|
+
ngState = computed(() => this.ngSource()?.() ?? {
|
|
143
|
+
invalid: false,
|
|
144
|
+
touched: false,
|
|
145
|
+
disabled: false,
|
|
146
|
+
required: false
|
|
147
|
+
}, ...ngDevMode ? [{ debugName: "ngState" }] : /* istanbul ignore next */ []);
|
|
148
|
+
isDisabled = computed(() => this.disabled() || this.ngState().disabled, ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
149
|
+
locked = computed(() => this.isDisabled() || this.readonly(), ...ngDevMode ? [{ debugName: "locked" }] : /* istanbul ignore next */ []);
|
|
150
|
+
isRequired = computed(() => this.required() || this.ngState().required, ...ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []);
|
|
151
|
+
boundsError = computed(() => !!this.value() && (!this.range() || !vdRangeAllowed(this.range(), this.safeMin(), this.safeMax())), ...ngDevMode ? [{ debugName: "boundsError" }] : /* istanbul ignore next */ []);
|
|
152
|
+
showInvalid = computed(() => this.parseError() || this.boundsError() || this.invalid() && (!this.formBound() || this.touched()) || this.ngState().invalid && this.ngState().touched, ...ngDevMode ? [{ debugName: "showInvalid" }] : /* istanbul ignore next */ []);
|
|
153
|
+
describedBy = computed(() => [this.field?.describedBy(), this.parseError() ? this.errorId : null].filter(Boolean).join(" ") || null, ...ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []);
|
|
154
|
+
unavailable = () => this.locked() || !!this.safeMin() && !!this.safeMax() && this.safeMin() > this.safeMax();
|
|
155
|
+
wasOpen = null;
|
|
156
|
+
lastValue;
|
|
157
|
+
lastMin;
|
|
158
|
+
lastMax;
|
|
159
|
+
editedValue;
|
|
160
|
+
constructor() {
|
|
161
|
+
const control = {
|
|
162
|
+
id: signal(this.controlId),
|
|
163
|
+
invalid: this.showInvalid,
|
|
164
|
+
required: this.isRequired,
|
|
165
|
+
disabled: this.isDisabled
|
|
166
|
+
};
|
|
167
|
+
this.field?.register(control);
|
|
168
|
+
this.destroyRef.onDestroy(() => this.field?.unregister(control));
|
|
169
|
+
afterNextRender(() => {
|
|
170
|
+
const anchor = `--${this.popup().id}`;
|
|
171
|
+
this.trigger().nativeElement.style.setProperty("anchor-name", anchor);
|
|
172
|
+
this.popup().el.style.setProperty("position-anchor", anchor);
|
|
173
|
+
});
|
|
174
|
+
afterRenderEffect(() => {
|
|
175
|
+
const value = this.value(), min = this.safeMin(), max = this.safeMax();
|
|
176
|
+
if (this.lastValue !== void 0 && this.lastValue !== value) {
|
|
177
|
+
this.popup().hide();
|
|
178
|
+
if (value !== this.editedValue) this.feedback.set(false);
|
|
179
|
+
}
|
|
180
|
+
if (this.locked() || this.lastMin !== min || this.lastMax !== max) this.popup().hide();
|
|
181
|
+
this.lastValue = value;
|
|
182
|
+
this.lastMin = min;
|
|
183
|
+
this.lastMax = max;
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
ngOnInit() {
|
|
187
|
+
const ng = this.injector.get(NgControl, null, {
|
|
188
|
+
self: true,
|
|
189
|
+
optional: true
|
|
190
|
+
});
|
|
191
|
+
this.formBound.set(!!ng || !!this.injector.get(FormField, null, {
|
|
192
|
+
self: true,
|
|
193
|
+
optional: true
|
|
194
|
+
}));
|
|
195
|
+
this.ngSource.set(vdNgControlState(ng, this.destroyRef));
|
|
196
|
+
}
|
|
197
|
+
format(date) {
|
|
198
|
+
return date ? vdFormatShort(date, this.locale()) : "";
|
|
199
|
+
}
|
|
200
|
+
edit(event, part) {
|
|
201
|
+
if (this.locked()) return;
|
|
202
|
+
const text = event.target.value;
|
|
203
|
+
const start = part === "start" ? text : this.startText();
|
|
204
|
+
const end = part === "end" ? text : this.endText();
|
|
205
|
+
this.editedValue = null;
|
|
206
|
+
this.raw.set({
|
|
207
|
+
start,
|
|
208
|
+
end,
|
|
209
|
+
commit: false
|
|
210
|
+
});
|
|
211
|
+
this.feedback.set(false);
|
|
212
|
+
}
|
|
213
|
+
commitText(incomplete = false) {
|
|
214
|
+
if (this.locked()) return;
|
|
215
|
+
const start = this.startText().trim(), end = this.endText().trim();
|
|
216
|
+
if (!start && !end) {
|
|
217
|
+
this.feedback.set(false);
|
|
218
|
+
this.setRange(null);
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const a = start ? vdParseRangeDate(start, this.locale()) : null;
|
|
222
|
+
const b = end ? vdParseRangeDate(end, this.locale()) : null;
|
|
223
|
+
const allowed = (date) => (!this.safeMin() || date >= this.safeMin()) && (!this.safeMax() || date <= this.safeMax());
|
|
224
|
+
if (start && (!a || !allowed(a)) || end && (!b || !allowed(b)) || a && b && a > b) {
|
|
225
|
+
this.feedback.set(true);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (!a || !b) {
|
|
229
|
+
if (incomplete) this.feedback.set(true);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const range = {
|
|
233
|
+
start: a,
|
|
234
|
+
end: b
|
|
235
|
+
};
|
|
236
|
+
if (!vdRangeAllowed(range, this.safeMin(), this.safeMax())) {
|
|
237
|
+
this.feedback.set(true);
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
this.feedback.set(false);
|
|
241
|
+
this.setRange(range);
|
|
242
|
+
}
|
|
243
|
+
setRange(range) {
|
|
244
|
+
this.editedValue = range;
|
|
245
|
+
this.value.set(range);
|
|
246
|
+
this.raw.set({
|
|
247
|
+
start: this.format(range?.start ?? null),
|
|
248
|
+
end: this.format(range?.end ?? null),
|
|
249
|
+
commit: true
|
|
250
|
+
});
|
|
251
|
+
this.editedValue = this.value();
|
|
252
|
+
}
|
|
253
|
+
inputKey(event) {
|
|
254
|
+
if (event.isComposing || event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
255
|
+
if (event.key === "Enter" && !event.altKey) {
|
|
256
|
+
event.preventDefault();
|
|
257
|
+
this.commitText(true);
|
|
258
|
+
}
|
|
259
|
+
if (event.altKey && event.key === "ArrowDown" && !this.popup().el.matches(":popover-open")) {
|
|
260
|
+
event.preventDefault();
|
|
261
|
+
this.wasOpen = false;
|
|
262
|
+
this.toggle();
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
rememberState() {
|
|
266
|
+
this.wasOpen = this.popup().el.matches(":popover-open");
|
|
267
|
+
}
|
|
268
|
+
toggle() {
|
|
269
|
+
const wasOpen = this.wasOpen ?? this.popup().el.matches(":popover-open");
|
|
270
|
+
this.wasOpen = null;
|
|
271
|
+
if (this.locked()) return;
|
|
272
|
+
if (wasOpen) {
|
|
273
|
+
this.popup().hide();
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
const range = this.range();
|
|
277
|
+
this.draftStart.set(range?.start ?? null);
|
|
278
|
+
this.draftEnd.set(range?.end ?? null);
|
|
279
|
+
this.selectingEnd.set(false);
|
|
280
|
+
this.calendar().focused.set(vdClampDate(range?.start ?? vdToday(), this.safeMin(), this.safeMax()));
|
|
281
|
+
this.popup().el.showPopover({ source: this.trigger().nativeElement });
|
|
282
|
+
}
|
|
283
|
+
onToggle(event) {
|
|
284
|
+
const opened = event.newState === "open";
|
|
285
|
+
this.open.set(opened);
|
|
286
|
+
if (opened && !this.locked()) this.calendar().focus();
|
|
287
|
+
}
|
|
288
|
+
pick(date) {
|
|
289
|
+
if (this.locked() || this.calendar().isDisabled(date)) return;
|
|
290
|
+
if (!this.selectingEnd() || !this.draftStart()) {
|
|
291
|
+
this.draftStart.set(date);
|
|
292
|
+
this.draftEnd.set(null);
|
|
293
|
+
this.selectingEnd.set(true);
|
|
294
|
+
this.calendar().focus();
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const range = vdRangeBetween(this.draftStart(), date);
|
|
298
|
+
if (!vdRangeAllowed(range, this.safeMin(), this.safeMax())) return;
|
|
299
|
+
this.feedback.set(false);
|
|
300
|
+
this.setRange(range);
|
|
301
|
+
this.popup().hide();
|
|
302
|
+
this.trigger().nativeElement.focus();
|
|
303
|
+
}
|
|
304
|
+
leavePopup(event) {
|
|
305
|
+
if (event.relatedTarget && !this.popup().el.contains(event.relatedTarget)) this.popup().hide();
|
|
306
|
+
}
|
|
307
|
+
leaveControl(event) {
|
|
308
|
+
if (!event.relatedTarget || !this.host.contains(event.relatedTarget)) {
|
|
309
|
+
this.commitText(true);
|
|
310
|
+
this.touch.emit();
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
314
|
+
minVersion: "12.0.0",
|
|
315
|
+
version: "22.2.1",
|
|
316
|
+
ngImport: i0,
|
|
317
|
+
type: VdDateRangePicker,
|
|
318
|
+
deps: [],
|
|
319
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
320
|
+
});
|
|
321
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
322
|
+
minVersion: "17.0.0",
|
|
323
|
+
version: "22.2.1",
|
|
324
|
+
type: VdDateRangePicker,
|
|
325
|
+
isStandalone: true,
|
|
326
|
+
selector: "vd-date-range-picker",
|
|
327
|
+
inputs: {
|
|
328
|
+
value: {
|
|
329
|
+
classPropertyName: "value",
|
|
330
|
+
publicName: "value",
|
|
331
|
+
isSignal: true,
|
|
332
|
+
isRequired: false,
|
|
333
|
+
transformFunction: null
|
|
334
|
+
},
|
|
335
|
+
minDate: {
|
|
336
|
+
classPropertyName: "minDate",
|
|
337
|
+
publicName: "minDate",
|
|
338
|
+
isSignal: true,
|
|
339
|
+
isRequired: false,
|
|
340
|
+
transformFunction: null
|
|
341
|
+
},
|
|
342
|
+
maxDate: {
|
|
343
|
+
classPropertyName: "maxDate",
|
|
344
|
+
publicName: "maxDate",
|
|
345
|
+
isSignal: true,
|
|
346
|
+
isRequired: false,
|
|
347
|
+
transformFunction: null
|
|
348
|
+
},
|
|
349
|
+
locale: {
|
|
350
|
+
classPropertyName: "locale",
|
|
351
|
+
publicName: "locale",
|
|
352
|
+
isSignal: true,
|
|
353
|
+
isRequired: false,
|
|
354
|
+
transformFunction: null
|
|
355
|
+
},
|
|
356
|
+
firstDayOfWeek: {
|
|
357
|
+
classPropertyName: "firstDayOfWeek",
|
|
358
|
+
publicName: "firstDayOfWeek",
|
|
359
|
+
isSignal: true,
|
|
360
|
+
isRequired: false,
|
|
361
|
+
transformFunction: null
|
|
362
|
+
},
|
|
363
|
+
size: {
|
|
364
|
+
classPropertyName: "size",
|
|
365
|
+
publicName: "size",
|
|
366
|
+
isSignal: true,
|
|
367
|
+
isRequired: false,
|
|
368
|
+
transformFunction: null
|
|
369
|
+
},
|
|
370
|
+
disabled: {
|
|
371
|
+
classPropertyName: "disabled",
|
|
372
|
+
publicName: "disabled",
|
|
373
|
+
isSignal: true,
|
|
374
|
+
isRequired: false,
|
|
375
|
+
transformFunction: null
|
|
376
|
+
},
|
|
377
|
+
readonly: {
|
|
378
|
+
classPropertyName: "readonly",
|
|
379
|
+
publicName: "readonly",
|
|
380
|
+
isSignal: true,
|
|
381
|
+
isRequired: false,
|
|
382
|
+
transformFunction: null
|
|
383
|
+
},
|
|
384
|
+
invalid: {
|
|
385
|
+
classPropertyName: "invalid",
|
|
386
|
+
publicName: "invalid",
|
|
387
|
+
isSignal: true,
|
|
388
|
+
isRequired: false,
|
|
389
|
+
transformFunction: null
|
|
390
|
+
},
|
|
391
|
+
touched: {
|
|
392
|
+
classPropertyName: "touched",
|
|
393
|
+
publicName: "touched",
|
|
394
|
+
isSignal: true,
|
|
395
|
+
isRequired: false,
|
|
396
|
+
transformFunction: null
|
|
397
|
+
},
|
|
398
|
+
required: {
|
|
399
|
+
classPropertyName: "required",
|
|
400
|
+
publicName: "required",
|
|
401
|
+
isSignal: true,
|
|
402
|
+
isRequired: false,
|
|
403
|
+
transformFunction: null
|
|
404
|
+
},
|
|
405
|
+
groupLabel: {
|
|
406
|
+
classPropertyName: "groupLabel",
|
|
407
|
+
publicName: "groupLabel",
|
|
408
|
+
isSignal: true,
|
|
409
|
+
isRequired: false,
|
|
410
|
+
transformFunction: null
|
|
411
|
+
},
|
|
412
|
+
startLabel: {
|
|
413
|
+
classPropertyName: "startLabel",
|
|
414
|
+
publicName: "startLabel",
|
|
415
|
+
isSignal: true,
|
|
416
|
+
isRequired: false,
|
|
417
|
+
transformFunction: null
|
|
418
|
+
},
|
|
419
|
+
endLabel: {
|
|
420
|
+
classPropertyName: "endLabel",
|
|
421
|
+
publicName: "endLabel",
|
|
422
|
+
isSignal: true,
|
|
423
|
+
isRequired: false,
|
|
424
|
+
transformFunction: null
|
|
425
|
+
},
|
|
426
|
+
openLabel: {
|
|
427
|
+
classPropertyName: "openLabel",
|
|
428
|
+
publicName: "openLabel",
|
|
429
|
+
isSignal: true,
|
|
430
|
+
isRequired: false,
|
|
431
|
+
transformFunction: null
|
|
432
|
+
},
|
|
433
|
+
pickerLabel: {
|
|
434
|
+
classPropertyName: "pickerLabel",
|
|
435
|
+
publicName: "pickerLabel",
|
|
436
|
+
isSignal: true,
|
|
437
|
+
isRequired: false,
|
|
438
|
+
transformFunction: null
|
|
439
|
+
},
|
|
440
|
+
previousLabel: {
|
|
441
|
+
classPropertyName: "previousLabel",
|
|
442
|
+
publicName: "previousLabel",
|
|
443
|
+
isSignal: true,
|
|
444
|
+
isRequired: false,
|
|
445
|
+
transformFunction: null
|
|
446
|
+
},
|
|
447
|
+
nextLabel: {
|
|
448
|
+
classPropertyName: "nextLabel",
|
|
449
|
+
publicName: "nextLabel",
|
|
450
|
+
isSignal: true,
|
|
451
|
+
isRequired: false,
|
|
452
|
+
transformFunction: null
|
|
453
|
+
},
|
|
454
|
+
startInstruction: {
|
|
455
|
+
classPropertyName: "startInstruction",
|
|
456
|
+
publicName: "startInstruction",
|
|
457
|
+
isSignal: true,
|
|
458
|
+
isRequired: false,
|
|
459
|
+
transformFunction: null
|
|
460
|
+
},
|
|
461
|
+
endInstruction: {
|
|
462
|
+
classPropertyName: "endInstruction",
|
|
463
|
+
publicName: "endInstruction",
|
|
464
|
+
isSignal: true,
|
|
465
|
+
isRequired: false,
|
|
466
|
+
transformFunction: null
|
|
467
|
+
},
|
|
468
|
+
errorLabel: {
|
|
469
|
+
classPropertyName: "errorLabel",
|
|
470
|
+
publicName: "errorLabel",
|
|
471
|
+
isSignal: true,
|
|
472
|
+
isRequired: false,
|
|
473
|
+
transformFunction: null
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
outputs: {
|
|
477
|
+
value: "valueChange",
|
|
478
|
+
touch: "touch"
|
|
479
|
+
},
|
|
480
|
+
host: {
|
|
481
|
+
listeners: { "focusout": "leaveControl($event)" },
|
|
482
|
+
properties: {
|
|
483
|
+
"attr.data-size": "size()",
|
|
484
|
+
"attr.data-disabled": "isDisabled() ? \"\" : null",
|
|
485
|
+
"attr.data-readonly": "readonly() ? \"\" : null",
|
|
486
|
+
"attr.data-invalid": "showInvalid() ? \"\" : null",
|
|
487
|
+
"attr.data-open": "open() ? \"\" : null"
|
|
488
|
+
},
|
|
489
|
+
classAttribute: "vd-date-range-picker"
|
|
490
|
+
},
|
|
491
|
+
viewQueries: [
|
|
492
|
+
{
|
|
493
|
+
propertyName: "popup",
|
|
494
|
+
first: true,
|
|
495
|
+
predicate: VdPopover,
|
|
496
|
+
descendants: true,
|
|
497
|
+
isSignal: true
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
propertyName: "trigger",
|
|
501
|
+
first: true,
|
|
502
|
+
predicate: ["trigger"],
|
|
503
|
+
descendants: true,
|
|
504
|
+
read: ElementRef,
|
|
505
|
+
isSignal: true
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
propertyName: "startInput",
|
|
509
|
+
first: true,
|
|
510
|
+
predicate: ["start"],
|
|
511
|
+
descendants: true,
|
|
512
|
+
isSignal: true
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
propertyName: "calendar",
|
|
516
|
+
first: true,
|
|
517
|
+
predicate: VdCalendar,
|
|
518
|
+
descendants: true,
|
|
519
|
+
isSignal: true
|
|
520
|
+
}
|
|
521
|
+
],
|
|
522
|
+
ngImport: i0,
|
|
523
|
+
template: `
|
|
524
|
+
<div class="vd-date-range-picker__fields" role="group" [attr.aria-label]="t().groupLabel">
|
|
525
|
+
<div class="vd-date-range-picker__field">
|
|
526
|
+
<label [for]="controlId">{{ t().startLabel }}</label>
|
|
527
|
+
<input
|
|
528
|
+
#start
|
|
529
|
+
class="vd-input"
|
|
530
|
+
type="text"
|
|
531
|
+
inputmode="numeric"
|
|
532
|
+
autocomplete="off"
|
|
533
|
+
[id]="controlId"
|
|
534
|
+
[attr.data-size]="size()"
|
|
535
|
+
[value]="startText()"
|
|
536
|
+
[placeholder]="placeholder()"
|
|
537
|
+
[disabled]="isDisabled()"
|
|
538
|
+
[readOnly]="readonly()"
|
|
539
|
+
[required]="isRequired()"
|
|
540
|
+
[attr.aria-invalid]="showInvalid() || null"
|
|
541
|
+
[attr.data-invalid]="showInvalid() ? '' : null"
|
|
542
|
+
[attr.aria-describedby]="describedBy()"
|
|
543
|
+
(input)="edit($event, 'start')"
|
|
544
|
+
(blur)="commitText()"
|
|
545
|
+
(keydown)="inputKey($event)"
|
|
546
|
+
/>
|
|
547
|
+
</div>
|
|
548
|
+
<div class="vd-date-range-picker__field">
|
|
549
|
+
<label [for]="endId">{{ t().endLabel }}</label>
|
|
550
|
+
<input
|
|
551
|
+
#end
|
|
552
|
+
class="vd-input"
|
|
553
|
+
type="text"
|
|
554
|
+
inputmode="numeric"
|
|
555
|
+
autocomplete="off"
|
|
556
|
+
[id]="endId"
|
|
557
|
+
[attr.data-size]="size()"
|
|
558
|
+
[value]="endText()"
|
|
559
|
+
[placeholder]="placeholder()"
|
|
560
|
+
[disabled]="isDisabled()"
|
|
561
|
+
[readOnly]="readonly()"
|
|
562
|
+
[required]="isRequired()"
|
|
563
|
+
[attr.aria-invalid]="showInvalid() || null"
|
|
564
|
+
[attr.data-invalid]="showInvalid() ? '' : null"
|
|
565
|
+
[attr.aria-describedby]="describedBy()"
|
|
566
|
+
(input)="edit($event, 'end')"
|
|
567
|
+
(blur)="commitText()"
|
|
568
|
+
(keydown)="inputKey($event)"
|
|
569
|
+
/>
|
|
570
|
+
</div>
|
|
571
|
+
<button
|
|
572
|
+
#trigger
|
|
573
|
+
vdButton
|
|
574
|
+
type="button"
|
|
575
|
+
variant="secondary"
|
|
576
|
+
iconOnly
|
|
577
|
+
[size]="size()"
|
|
578
|
+
[disabled]="locked()"
|
|
579
|
+
class="vd-date-range-picker__trigger"
|
|
580
|
+
[attr.aria-label]="t().openLabel"
|
|
581
|
+
aria-haspopup="dialog"
|
|
582
|
+
[attr.aria-controls]="popup.id"
|
|
583
|
+
[attr.aria-expanded]="open()"
|
|
584
|
+
(pointerdown)="rememberState()"
|
|
585
|
+
(click)="toggle()"
|
|
586
|
+
>
|
|
587
|
+
<vd-icon name="calendar" />
|
|
588
|
+
</button>
|
|
589
|
+
</div>
|
|
590
|
+
@if (parseError()) {
|
|
591
|
+
<p class="vd-date-range-picker__error" [id]="errorId">
|
|
592
|
+
<vd-icon name="alert-circle" />{{ t().errorLabel }}
|
|
593
|
+
</p>
|
|
594
|
+
}
|
|
595
|
+
<div
|
|
596
|
+
vdPopover
|
|
597
|
+
#popup="vdPopover"
|
|
598
|
+
class="vd-date-range-picker__popup"
|
|
599
|
+
[attr.aria-label]="t().pickerLabel"
|
|
600
|
+
(toggle)="onToggle($event)"
|
|
601
|
+
(focusout)="leavePopup($event)"
|
|
602
|
+
>
|
|
603
|
+
<p class="vd-date-range-picker__instruction" role="status">
|
|
604
|
+
{{ selectingEnd() ? t().endInstruction : t().startInstruction }}
|
|
605
|
+
</p>
|
|
606
|
+
<vd-calendar
|
|
607
|
+
selectionMode="range"
|
|
608
|
+
[rangeStart]="draftStart()"
|
|
609
|
+
[rangeEnd]="draftEnd()"
|
|
610
|
+
[min]="safeMin()"
|
|
611
|
+
[max]="safeMax()"
|
|
612
|
+
[dateDisabled]="unavailable"
|
|
613
|
+
[locale]="locale()"
|
|
614
|
+
[firstDayOfWeek]="firstDayOfWeek()"
|
|
615
|
+
[previousLabel]="t().previousLabel"
|
|
616
|
+
[nextLabel]="t().nextLabel"
|
|
617
|
+
(dateSelected)="pick($event)"
|
|
618
|
+
/>
|
|
619
|
+
@if (draftStart()) {
|
|
620
|
+
<p class="vd-date-range-picker__summary">
|
|
621
|
+
{{ t().startLabel }}: {{ format(draftStart()) }}<br />{{ t().endLabel }}:
|
|
622
|
+
{{ draftEnd() ? format(draftEnd()) : '—' }}
|
|
623
|
+
</p>
|
|
624
|
+
}
|
|
625
|
+
</div>
|
|
626
|
+
`,
|
|
627
|
+
isInline: true,
|
|
628
|
+
dependencies: [
|
|
629
|
+
{
|
|
630
|
+
kind: "component",
|
|
631
|
+
type: VdCalendar,
|
|
632
|
+
selector: "vd-calendar",
|
|
633
|
+
inputs: [
|
|
634
|
+
"value",
|
|
635
|
+
"selectionMode",
|
|
636
|
+
"rangeStart",
|
|
637
|
+
"rangeEnd",
|
|
638
|
+
"min",
|
|
639
|
+
"max",
|
|
640
|
+
"dateDisabled",
|
|
641
|
+
"locale",
|
|
642
|
+
"firstDayOfWeek",
|
|
643
|
+
"previousLabel",
|
|
644
|
+
"nextLabel"
|
|
645
|
+
],
|
|
646
|
+
outputs: ["valueChange", "dateSelected"]
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
kind: "directive",
|
|
650
|
+
type: VdPopover,
|
|
651
|
+
selector: "[vdPopover]",
|
|
652
|
+
inputs: ["placement"],
|
|
653
|
+
exportAs: ["vdPopover"]
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
kind: "component",
|
|
657
|
+
type: VdButton,
|
|
658
|
+
selector: "button[vdButton], a[vdButton]",
|
|
659
|
+
inputs: [
|
|
660
|
+
"variant",
|
|
661
|
+
"size",
|
|
662
|
+
"disabled",
|
|
663
|
+
"loading",
|
|
664
|
+
"iconOnly",
|
|
665
|
+
"type"
|
|
666
|
+
]
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
kind: "component",
|
|
670
|
+
type: VdIcon,
|
|
671
|
+
selector: "vd-icon",
|
|
672
|
+
inputs: ["name", "label"]
|
|
673
|
+
}
|
|
674
|
+
],
|
|
675
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
676
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
677
|
+
});
|
|
678
|
+
};
|
|
679
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
680
|
+
minVersion: "12.0.0",
|
|
681
|
+
version: "22.2.1",
|
|
682
|
+
ngImport: i0,
|
|
683
|
+
type: VdDateRangePicker,
|
|
684
|
+
decorators: [{
|
|
685
|
+
type: Component,
|
|
686
|
+
args: [{
|
|
687
|
+
selector: "vd-date-range-picker",
|
|
688
|
+
imports: [
|
|
689
|
+
VdCalendar,
|
|
690
|
+
VdPopover,
|
|
691
|
+
VdButton,
|
|
692
|
+
VdIcon
|
|
693
|
+
],
|
|
694
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
695
|
+
encapsulation: ViewEncapsulation.None,
|
|
696
|
+
host: {
|
|
697
|
+
class: "vd-date-range-picker",
|
|
698
|
+
"[attr.data-size]": "size()",
|
|
699
|
+
"[attr.data-disabled]": "isDisabled() ? \"\" : null",
|
|
700
|
+
"[attr.data-readonly]": "readonly() ? \"\" : null",
|
|
701
|
+
"[attr.data-invalid]": "showInvalid() ? \"\" : null",
|
|
702
|
+
"[attr.data-open]": "open() ? \"\" : null",
|
|
703
|
+
"(focusout)": "leaveControl($event)"
|
|
704
|
+
},
|
|
705
|
+
template: `
|
|
706
|
+
<div class="vd-date-range-picker__fields" role="group" [attr.aria-label]="t().groupLabel">
|
|
707
|
+
<div class="vd-date-range-picker__field">
|
|
708
|
+
<label [for]="controlId">{{ t().startLabel }}</label>
|
|
709
|
+
<input
|
|
710
|
+
#start
|
|
711
|
+
class="vd-input"
|
|
712
|
+
type="text"
|
|
713
|
+
inputmode="numeric"
|
|
714
|
+
autocomplete="off"
|
|
715
|
+
[id]="controlId"
|
|
716
|
+
[attr.data-size]="size()"
|
|
717
|
+
[value]="startText()"
|
|
718
|
+
[placeholder]="placeholder()"
|
|
719
|
+
[disabled]="isDisabled()"
|
|
720
|
+
[readOnly]="readonly()"
|
|
721
|
+
[required]="isRequired()"
|
|
722
|
+
[attr.aria-invalid]="showInvalid() || null"
|
|
723
|
+
[attr.data-invalid]="showInvalid() ? '' : null"
|
|
724
|
+
[attr.aria-describedby]="describedBy()"
|
|
725
|
+
(input)="edit($event, 'start')"
|
|
726
|
+
(blur)="commitText()"
|
|
727
|
+
(keydown)="inputKey($event)"
|
|
728
|
+
/>
|
|
729
|
+
</div>
|
|
730
|
+
<div class="vd-date-range-picker__field">
|
|
731
|
+
<label [for]="endId">{{ t().endLabel }}</label>
|
|
732
|
+
<input
|
|
733
|
+
#end
|
|
734
|
+
class="vd-input"
|
|
735
|
+
type="text"
|
|
736
|
+
inputmode="numeric"
|
|
737
|
+
autocomplete="off"
|
|
738
|
+
[id]="endId"
|
|
739
|
+
[attr.data-size]="size()"
|
|
740
|
+
[value]="endText()"
|
|
741
|
+
[placeholder]="placeholder()"
|
|
742
|
+
[disabled]="isDisabled()"
|
|
743
|
+
[readOnly]="readonly()"
|
|
744
|
+
[required]="isRequired()"
|
|
745
|
+
[attr.aria-invalid]="showInvalid() || null"
|
|
746
|
+
[attr.data-invalid]="showInvalid() ? '' : null"
|
|
747
|
+
[attr.aria-describedby]="describedBy()"
|
|
748
|
+
(input)="edit($event, 'end')"
|
|
749
|
+
(blur)="commitText()"
|
|
750
|
+
(keydown)="inputKey($event)"
|
|
751
|
+
/>
|
|
752
|
+
</div>
|
|
753
|
+
<button
|
|
754
|
+
#trigger
|
|
755
|
+
vdButton
|
|
756
|
+
type="button"
|
|
757
|
+
variant="secondary"
|
|
758
|
+
iconOnly
|
|
759
|
+
[size]="size()"
|
|
760
|
+
[disabled]="locked()"
|
|
761
|
+
class="vd-date-range-picker__trigger"
|
|
762
|
+
[attr.aria-label]="t().openLabel"
|
|
763
|
+
aria-haspopup="dialog"
|
|
764
|
+
[attr.aria-controls]="popup.id"
|
|
765
|
+
[attr.aria-expanded]="open()"
|
|
766
|
+
(pointerdown)="rememberState()"
|
|
767
|
+
(click)="toggle()"
|
|
768
|
+
>
|
|
769
|
+
<vd-icon name="calendar" />
|
|
770
|
+
</button>
|
|
771
|
+
</div>
|
|
772
|
+
@if (parseError()) {
|
|
773
|
+
<p class="vd-date-range-picker__error" [id]="errorId">
|
|
774
|
+
<vd-icon name="alert-circle" />{{ t().errorLabel }}
|
|
775
|
+
</p>
|
|
776
|
+
}
|
|
777
|
+
<div
|
|
778
|
+
vdPopover
|
|
779
|
+
#popup="vdPopover"
|
|
780
|
+
class="vd-date-range-picker__popup"
|
|
781
|
+
[attr.aria-label]="t().pickerLabel"
|
|
782
|
+
(toggle)="onToggle($event)"
|
|
783
|
+
(focusout)="leavePopup($event)"
|
|
784
|
+
>
|
|
785
|
+
<p class="vd-date-range-picker__instruction" role="status">
|
|
786
|
+
{{ selectingEnd() ? t().endInstruction : t().startInstruction }}
|
|
787
|
+
</p>
|
|
788
|
+
<vd-calendar
|
|
789
|
+
selectionMode="range"
|
|
790
|
+
[rangeStart]="draftStart()"
|
|
791
|
+
[rangeEnd]="draftEnd()"
|
|
792
|
+
[min]="safeMin()"
|
|
793
|
+
[max]="safeMax()"
|
|
794
|
+
[dateDisabled]="unavailable"
|
|
795
|
+
[locale]="locale()"
|
|
796
|
+
[firstDayOfWeek]="firstDayOfWeek()"
|
|
797
|
+
[previousLabel]="t().previousLabel"
|
|
798
|
+
[nextLabel]="t().nextLabel"
|
|
799
|
+
(dateSelected)="pick($event)"
|
|
800
|
+
/>
|
|
801
|
+
@if (draftStart()) {
|
|
802
|
+
<p class="vd-date-range-picker__summary">
|
|
803
|
+
{{ t().startLabel }}: {{ format(draftStart()) }}<br />{{ t().endLabel }}:
|
|
804
|
+
{{ draftEnd() ? format(draftEnd()) : '—' }}
|
|
805
|
+
</p>
|
|
806
|
+
}
|
|
807
|
+
</div>
|
|
808
|
+
`
|
|
809
|
+
}]
|
|
810
|
+
}],
|
|
811
|
+
ctorParameters: () => [],
|
|
812
|
+
propDecorators: {
|
|
813
|
+
value: [{
|
|
814
|
+
type: i0.Input,
|
|
815
|
+
args: [{
|
|
816
|
+
isSignal: true,
|
|
817
|
+
alias: "value",
|
|
818
|
+
required: false
|
|
819
|
+
}]
|
|
820
|
+
}, {
|
|
821
|
+
type: i0.Output,
|
|
822
|
+
args: ["valueChange"]
|
|
823
|
+
}],
|
|
824
|
+
minDate: [{
|
|
825
|
+
type: i0.Input,
|
|
826
|
+
args: [{
|
|
827
|
+
isSignal: true,
|
|
828
|
+
alias: "minDate",
|
|
829
|
+
required: false
|
|
830
|
+
}]
|
|
831
|
+
}],
|
|
832
|
+
maxDate: [{
|
|
833
|
+
type: i0.Input,
|
|
834
|
+
args: [{
|
|
835
|
+
isSignal: true,
|
|
836
|
+
alias: "maxDate",
|
|
837
|
+
required: false
|
|
838
|
+
}]
|
|
839
|
+
}],
|
|
840
|
+
locale: [{
|
|
841
|
+
type: i0.Input,
|
|
842
|
+
args: [{
|
|
843
|
+
isSignal: true,
|
|
844
|
+
alias: "locale",
|
|
845
|
+
required: false
|
|
846
|
+
}]
|
|
847
|
+
}],
|
|
848
|
+
firstDayOfWeek: [{
|
|
849
|
+
type: i0.Input,
|
|
850
|
+
args: [{
|
|
851
|
+
isSignal: true,
|
|
852
|
+
alias: "firstDayOfWeek",
|
|
853
|
+
required: false
|
|
854
|
+
}]
|
|
855
|
+
}],
|
|
856
|
+
size: [{
|
|
857
|
+
type: i0.Input,
|
|
858
|
+
args: [{
|
|
859
|
+
isSignal: true,
|
|
860
|
+
alias: "size",
|
|
861
|
+
required: false
|
|
862
|
+
}]
|
|
863
|
+
}],
|
|
864
|
+
disabled: [{
|
|
865
|
+
type: i0.Input,
|
|
866
|
+
args: [{
|
|
867
|
+
isSignal: true,
|
|
868
|
+
alias: "disabled",
|
|
869
|
+
required: false
|
|
870
|
+
}]
|
|
871
|
+
}],
|
|
872
|
+
readonly: [{
|
|
873
|
+
type: i0.Input,
|
|
874
|
+
args: [{
|
|
875
|
+
isSignal: true,
|
|
876
|
+
alias: "readonly",
|
|
877
|
+
required: false
|
|
878
|
+
}]
|
|
879
|
+
}],
|
|
880
|
+
invalid: [{
|
|
881
|
+
type: i0.Input,
|
|
882
|
+
args: [{
|
|
883
|
+
isSignal: true,
|
|
884
|
+
alias: "invalid",
|
|
885
|
+
required: false
|
|
886
|
+
}]
|
|
887
|
+
}],
|
|
888
|
+
touched: [{
|
|
889
|
+
type: i0.Input,
|
|
890
|
+
args: [{
|
|
891
|
+
isSignal: true,
|
|
892
|
+
alias: "touched",
|
|
893
|
+
required: false
|
|
894
|
+
}]
|
|
895
|
+
}],
|
|
896
|
+
required: [{
|
|
897
|
+
type: i0.Input,
|
|
898
|
+
args: [{
|
|
899
|
+
isSignal: true,
|
|
900
|
+
alias: "required",
|
|
901
|
+
required: false
|
|
902
|
+
}]
|
|
903
|
+
}],
|
|
904
|
+
groupLabel: [{
|
|
905
|
+
type: i0.Input,
|
|
906
|
+
args: [{
|
|
907
|
+
isSignal: true,
|
|
908
|
+
alias: "groupLabel",
|
|
909
|
+
required: false
|
|
910
|
+
}]
|
|
911
|
+
}],
|
|
912
|
+
startLabel: [{
|
|
913
|
+
type: i0.Input,
|
|
914
|
+
args: [{
|
|
915
|
+
isSignal: true,
|
|
916
|
+
alias: "startLabel",
|
|
917
|
+
required: false
|
|
918
|
+
}]
|
|
919
|
+
}],
|
|
920
|
+
endLabel: [{
|
|
921
|
+
type: i0.Input,
|
|
922
|
+
args: [{
|
|
923
|
+
isSignal: true,
|
|
924
|
+
alias: "endLabel",
|
|
925
|
+
required: false
|
|
926
|
+
}]
|
|
927
|
+
}],
|
|
928
|
+
openLabel: [{
|
|
929
|
+
type: i0.Input,
|
|
930
|
+
args: [{
|
|
931
|
+
isSignal: true,
|
|
932
|
+
alias: "openLabel",
|
|
933
|
+
required: false
|
|
934
|
+
}]
|
|
935
|
+
}],
|
|
936
|
+
pickerLabel: [{
|
|
937
|
+
type: i0.Input,
|
|
938
|
+
args: [{
|
|
939
|
+
isSignal: true,
|
|
940
|
+
alias: "pickerLabel",
|
|
941
|
+
required: false
|
|
942
|
+
}]
|
|
943
|
+
}],
|
|
944
|
+
previousLabel: [{
|
|
945
|
+
type: i0.Input,
|
|
946
|
+
args: [{
|
|
947
|
+
isSignal: true,
|
|
948
|
+
alias: "previousLabel",
|
|
949
|
+
required: false
|
|
950
|
+
}]
|
|
951
|
+
}],
|
|
952
|
+
nextLabel: [{
|
|
953
|
+
type: i0.Input,
|
|
954
|
+
args: [{
|
|
955
|
+
isSignal: true,
|
|
956
|
+
alias: "nextLabel",
|
|
957
|
+
required: false
|
|
958
|
+
}]
|
|
959
|
+
}],
|
|
960
|
+
startInstruction: [{
|
|
961
|
+
type: i0.Input,
|
|
962
|
+
args: [{
|
|
963
|
+
isSignal: true,
|
|
964
|
+
alias: "startInstruction",
|
|
965
|
+
required: false
|
|
966
|
+
}]
|
|
967
|
+
}],
|
|
968
|
+
endInstruction: [{
|
|
969
|
+
type: i0.Input,
|
|
970
|
+
args: [{
|
|
971
|
+
isSignal: true,
|
|
972
|
+
alias: "endInstruction",
|
|
973
|
+
required: false
|
|
974
|
+
}]
|
|
975
|
+
}],
|
|
976
|
+
errorLabel: [{
|
|
977
|
+
type: i0.Input,
|
|
978
|
+
args: [{
|
|
979
|
+
isSignal: true,
|
|
980
|
+
alias: "errorLabel",
|
|
981
|
+
required: false
|
|
982
|
+
}]
|
|
983
|
+
}],
|
|
984
|
+
touch: [{
|
|
985
|
+
type: i0.Output,
|
|
986
|
+
args: ["touch"]
|
|
987
|
+
}],
|
|
988
|
+
popup: [{
|
|
989
|
+
type: i0.ViewChild,
|
|
990
|
+
args: [i0.forwardRef(() => VdPopover), { isSignal: true }]
|
|
991
|
+
}],
|
|
992
|
+
trigger: [{
|
|
993
|
+
type: i0.ViewChild,
|
|
994
|
+
args: ["trigger", {
|
|
995
|
+
read: ElementRef,
|
|
996
|
+
isSignal: true
|
|
997
|
+
}]
|
|
998
|
+
}],
|
|
999
|
+
startInput: [{
|
|
1000
|
+
type: i0.ViewChild,
|
|
1001
|
+
args: ["start", { isSignal: true }]
|
|
1002
|
+
}],
|
|
1003
|
+
calendar: [{
|
|
1004
|
+
type: i0.ViewChild,
|
|
1005
|
+
args: [i0.forwardRef(() => VdCalendar), { isSignal: true }]
|
|
1006
|
+
}]
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
export { VdDateRangePicker };
|
|
1010
|
+
|
|
1011
|
+
//# sourceMappingURL=vadem-ui-date-range-picker.mjs.map
|