@eagami/ui 5.81.1 → 5.82.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/fesm2022/eagami-ui.mjs +106 -26
- package/fesm2022/eagami-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eagami-ui.d.ts +16 -7
package/fesm2022/eagami-ui.mjs
CHANGED
|
@@ -14774,10 +14774,36 @@ function clampAlpha(value) {
|
|
|
14774
14774
|
if (value.endsWith("%")) return clamp01(parseFloat(value) / 100);
|
|
14775
14775
|
return clamp01(parseFloat(value));
|
|
14776
14776
|
}
|
|
14777
|
+
let latestRequest = 0;
|
|
14778
|
+
function focusOnReveal(isOpen, popover, focus) {
|
|
14779
|
+
const pending = signal(0, ...ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []);
|
|
14780
|
+
let focusedAtRequest = null;
|
|
14781
|
+
afterRenderEffect(() => {
|
|
14782
|
+
const request = pending();
|
|
14783
|
+
if (request === 0) return;
|
|
14784
|
+
if (!isOpen() || request !== latestRequest) {
|
|
14785
|
+
pending.set(0);
|
|
14786
|
+
return;
|
|
14787
|
+
}
|
|
14788
|
+
if (!popover()?.isPositioned()) return;
|
|
14789
|
+
untracked(() => {
|
|
14790
|
+
pending.set(0);
|
|
14791
|
+
const active = document.activeElement;
|
|
14792
|
+
if (active === focusedAtRequest || active === null || active === document.body) focus();
|
|
14793
|
+
});
|
|
14794
|
+
});
|
|
14795
|
+
return () => {
|
|
14796
|
+
latestRequest += 1;
|
|
14797
|
+
focusedAtRequest = typeof document === "undefined" ? null : document.activeElement;
|
|
14798
|
+
pending.set(latestRequest);
|
|
14799
|
+
};
|
|
14800
|
+
}
|
|
14777
14801
|
var MenuComponent = class MenuComponent {
|
|
14778
14802
|
injector = inject(Injector);
|
|
14779
14803
|
i18n = inject(EagamiI18nService);
|
|
14780
14804
|
listEl = viewChild("listEl", ...ngDevMode ? [{ debugName: "listEl" }] : /* istanbul ignore next */ []);
|
|
14805
|
+
popover = viewChild(PopoverComponent, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
|
|
14806
|
+
focusFirstItemOnReveal = focusOnReveal(() => this.open(), () => this.popover(), () => this.focusFirstItem());
|
|
14781
14807
|
placement = input("bottom-start", ...ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []);
|
|
14782
14808
|
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
14783
14809
|
maxHeight = input("20rem", ...ngDevMode ? [{ debugName: "maxHeight" }] : /* istanbul ignore next */ []);
|
|
@@ -14836,7 +14862,7 @@ var MenuComponent = class MenuComponent {
|
|
|
14836
14862
|
this.triggerEl.set(triggerEl);
|
|
14837
14863
|
this.open.set(true);
|
|
14838
14864
|
this.opened.emit();
|
|
14839
|
-
|
|
14865
|
+
this.focusFirstItemOnReveal();
|
|
14840
14866
|
}
|
|
14841
14867
|
close(restoreFocus = false) {
|
|
14842
14868
|
if (!this.open()) return;
|
|
@@ -14974,6 +15000,12 @@ var MenuComponent = class MenuComponent {
|
|
|
14974
15000
|
predicate: ["listEl"],
|
|
14975
15001
|
descendants: true,
|
|
14976
15002
|
isSignal: true
|
|
15003
|
+
}, {
|
|
15004
|
+
propertyName: "popover",
|
|
15005
|
+
first: true,
|
|
15006
|
+
predicate: PopoverComponent,
|
|
15007
|
+
descendants: true,
|
|
15008
|
+
isSignal: true
|
|
14977
15009
|
}],
|
|
14978
15010
|
ngImport: i0,
|
|
14979
15011
|
template: "<ea-popover\n [anchor]=\"triggerEl()\"\n [open]=\"open()\"\n [placement]=\"placement()\"\n [anchorPoint]=\"anchorPoint()\"\n [contextMenu]=\"asContextMenu()\"\n role=\"menu\"\n [surfaceId]=\"id()\"\n [aria-label]=\"resolvedAriaLabel()\"\n [closeOnEscape]=\"false\"\n scrollBehavior=\"reposition\"\n (closeRequested)=\"onPopoverCloseRequested()\">\n <div\n #listEl\n class=\"ea-menu__list ea-menu__list--{{ size() }}\"\n [style.max-height]=\"maxHeight()\">\n <ng-content />\n </div>\n</ea-popover>\n",
|
|
@@ -15028,6 +15060,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
15028
15060
|
type: i0.ViewChild,
|
|
15029
15061
|
args: ["listEl", { isSignal: true }]
|
|
15030
15062
|
}],
|
|
15063
|
+
popover: [{
|
|
15064
|
+
type: i0.ViewChild,
|
|
15065
|
+
args: [i0.forwardRef(() => PopoverComponent), { isSignal: true }]
|
|
15066
|
+
}],
|
|
15031
15067
|
placement: [{
|
|
15032
15068
|
type: i0.Input,
|
|
15033
15069
|
args: [{
|
|
@@ -16958,6 +16994,8 @@ function build(year, month, day) {
|
|
|
16958
16994
|
var DatePickerComponent = class DatePickerComponent extends LabelledFieldControlBase {
|
|
16959
16995
|
fieldEl = viewChild("fieldEl", ...ngDevMode ? [{ debugName: "fieldEl" }] : /* istanbul ignore next */ []);
|
|
16960
16996
|
inputEl = viewChild("inputEl", ...ngDevMode ? [{ debugName: "inputEl" }] : /* istanbul ignore next */ []);
|
|
16997
|
+
popover = viewChild(PopoverComponent, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
|
|
16998
|
+
focusDayCellOnReveal = focusOnReveal(() => this.isOpen(), () => this.popover(), () => this.focusFocusedDayCell());
|
|
16961
16999
|
injector = inject(Injector);
|
|
16962
17000
|
i18n = inject(EagamiI18nService);
|
|
16963
17001
|
placeholder = input(void 0, ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
@@ -17110,7 +17148,7 @@ var DatePickerComponent = class DatePickerComponent extends LabelledFieldControl
|
|
|
17110
17148
|
this.viewMonth.set(current.getMonth());
|
|
17111
17149
|
this.focusedDate.set(this.startOfDay(current));
|
|
17112
17150
|
this.isOpen.set(true);
|
|
17113
|
-
|
|
17151
|
+
this.focusDayCellOnReveal();
|
|
17114
17152
|
}
|
|
17115
17153
|
close() {
|
|
17116
17154
|
this.isOpen.set(false);
|
|
@@ -17462,19 +17500,29 @@ var DatePickerComponent = class DatePickerComponent extends LabelledFieldControl
|
|
|
17462
17500
|
useExisting: forwardRef(() => DatePickerComponent),
|
|
17463
17501
|
multi: true
|
|
17464
17502
|
}],
|
|
17465
|
-
viewQueries: [
|
|
17466
|
-
|
|
17467
|
-
|
|
17468
|
-
|
|
17469
|
-
|
|
17470
|
-
|
|
17471
|
-
|
|
17472
|
-
|
|
17473
|
-
|
|
17474
|
-
|
|
17475
|
-
|
|
17476
|
-
|
|
17477
|
-
|
|
17503
|
+
viewQueries: [
|
|
17504
|
+
{
|
|
17505
|
+
propertyName: "fieldEl",
|
|
17506
|
+
first: true,
|
|
17507
|
+
predicate: ["fieldEl"],
|
|
17508
|
+
descendants: true,
|
|
17509
|
+
isSignal: true
|
|
17510
|
+
},
|
|
17511
|
+
{
|
|
17512
|
+
propertyName: "inputEl",
|
|
17513
|
+
first: true,
|
|
17514
|
+
predicate: ["inputEl"],
|
|
17515
|
+
descendants: true,
|
|
17516
|
+
isSignal: true
|
|
17517
|
+
},
|
|
17518
|
+
{
|
|
17519
|
+
propertyName: "popover",
|
|
17520
|
+
first: true,
|
|
17521
|
+
predicate: PopoverComponent,
|
|
17522
|
+
descendants: true,
|
|
17523
|
+
isSignal: true
|
|
17524
|
+
}
|
|
17525
|
+
],
|
|
17478
17526
|
usesInheritance: true,
|
|
17479
17527
|
ngImport: i0,
|
|
17480
17528
|
template: "<div class=\"ea-date-picker-field ea-date-picker-field--{{ size() }}\">\n @if (label(); as labelText) {\n <ea-field-label\n [text]=\"labelText\"\n [icon]=\"labelIcon()\"\n [help]=\"labelHelp()\"\n [forId]=\"id()\"\n [labelId]=\"id() + '-label'\"\n [required]=\"required()\"\n [optional]=\"optional()\" />\n }\n\n <div class=\"ea-date-picker\">\n <div\n #fieldEl\n class=\"ea-date-picker__field\"\n [ngClass]=\"fieldClasses()\">\n <button\n type=\"button\"\n class=\"ea-date-picker__calendar-button\"\n [disabled]=\"isDisabled() || readonly()\"\n [attr.aria-label]=\"i18n.messages().datePicker.dialogLabel\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? dialogId() : null\"\n (click)=\"toggle()\">\n <ea-icon-calendar aria-hidden=\"true\" />\n </button>\n <input\n #inputEl\n type=\"text\"\n dir=\"auto\"\n autocomplete=\"off\"\n class=\"ea-date-picker__input\"\n [id]=\"id()\"\n [value]=\"inputText()\"\n [placeholder]=\"resolvedPlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-label]=\"label() || ariaLabelledby() ? null : fallbackLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby() || null\"\n [attr.aria-required]=\"required() || null\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"\n showError() ? id() + '-error' : showHint() ? id() + '-hint' : null\n \"\n (input)=\"onInput($event)\"\n (keydown)=\"handleInputKeydown($event)\"\n (focus)=\"onInputFocus()\"\n (blur)=\"onInputBlur()\" />\n @if (value() && !isDisabled() && !readonly()) {\n <button\n type=\"button\"\n class=\"ea-date-picker__clear\"\n [attr.aria-label]=\"i18n.messages().datePicker.clear\"\n (click)=\"clear($event)\">\n <ea-icon-x\n class=\"ea-date-picker__clear-icon\"\n aria-hidden=\"true\" />\n </button>\n }\n </div>\n\n <ea-popover\n [anchor]=\"fieldEl\"\n [open]=\"isOpen()\"\n placement=\"bottom-start\"\n role=\"dialog\"\n [surfaceId]=\"dialogId()\"\n [aria-label]=\"i18n.messages().datePicker.dialogLabel\"\n [trapFocus]=\"true\"\n [closeOnEscape]=\"false\"\n scrollBehavior=\"close\"\n (closeRequested)=\"onPopoverCloseRequested()\">\n <div\n class=\"ea-date-picker__popover\"\n [ngClass]=\"popoverClasses()\"\n (keydown)=\"handleGridKeydown($event)\">\n <div class=\"ea-date-picker__header\">\n <button\n type=\"button\"\n class=\"ea-date-picker__nav-btn\"\n [attr.aria-label]=\"i18n.messages().datePicker.previousYear\"\n (click)=\"goToPrevYear()\">\n <ea-icon-chevron-left\n class=\"ea-rtl-flip\"\n aria-hidden=\"true\" />\n <ea-icon-chevron-left\n class=\"ea-rtl-flip\"\n aria-hidden=\"true\" />\n </button>\n <button\n type=\"button\"\n class=\"ea-date-picker__nav-btn\"\n [attr.aria-label]=\"i18n.messages().datePicker.previousMonth\"\n (click)=\"goToPrevMonth()\">\n <ea-icon-chevron-left\n class=\"ea-rtl-flip\"\n aria-hidden=\"true\" />\n </button>\n <span\n class=\"ea-date-picker__month-label\"\n aria-live=\"polite\">\n {{ monthYearLabel() }}\n </span>\n <button\n type=\"button\"\n class=\"ea-date-picker__nav-btn\"\n [attr.aria-label]=\"i18n.messages().datePicker.nextMonth\"\n (click)=\"goToNextMonth()\">\n <ea-icon-chevron-right\n class=\"ea-rtl-flip\"\n aria-hidden=\"true\" />\n </button>\n <button\n type=\"button\"\n class=\"ea-date-picker__nav-btn\"\n [attr.aria-label]=\"i18n.messages().datePicker.nextYear\"\n (click)=\"goToNextYear()\">\n <ea-icon-chevron-right\n class=\"ea-rtl-flip\"\n aria-hidden=\"true\" />\n <ea-icon-chevron-right\n class=\"ea-rtl-flip\"\n aria-hidden=\"true\" />\n </button>\n </div>\n\n <div\n class=\"ea-date-picker__grid\"\n role=\"grid\">\n <div\n class=\"ea-date-picker__weekday-row\"\n role=\"row\">\n @for (label of weekdayLabels(); track label) {\n <div\n class=\"ea-date-picker__weekday\"\n role=\"columnheader\">\n {{ label }}\n </div>\n }\n </div>\n @for (week of weeks(); track $index) {\n <div\n class=\"ea-date-picker__week\"\n role=\"row\">\n @for (day of week; track day.date.getTime()) {\n <div\n class=\"ea-date-picker__cell\"\n role=\"gridcell\"\n [attr.aria-selected]=\"day.isSelected\">\n <button\n type=\"button\"\n class=\"ea-date-picker__day\"\n [class.ea-date-picker__day--outside]=\"!day.isCurrentMonth\"\n [class.ea-date-picker__day--today]=\"day.isToday\"\n [class.ea-date-picker__day--selected]=\"day.isSelected\"\n [class.ea-date-picker__day--focused]=\"day.isFocused\"\n [class.ea-date-picker__day--disabled]=\"day.isDisabled\"\n [attr.aria-disabled]=\"day.isDisabled || null\"\n [attr.aria-current]=\"day.isToday ? 'date' : null\"\n [attr.tabindex]=\"day.isFocused ? 0 : -1\"\n (click)=\"selectDay(day)\">\n {{ day.day }}\n </button>\n </div>\n }\n </div>\n }\n </div>\n\n <div class=\"ea-date-picker__footer\">\n <button\n type=\"button\"\n class=\"ea-date-picker__today-btn\"\n (click)=\"goToToday()\">\n {{ i18n.messages().datePicker.today }}\n </button>\n </div>\n </div>\n </ea-popover>\n </div>\n\n <ea-field-messages\n [id]=\"id()\"\n [error]=\"errorText()\"\n [hint]=\"showHint() ? hint() : null\" />\n</div>\n",
|
|
@@ -17599,6 +17647,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
17599
17647
|
type: i0.ViewChild,
|
|
17600
17648
|
args: ["inputEl", { isSignal: true }]
|
|
17601
17649
|
}],
|
|
17650
|
+
popover: [{
|
|
17651
|
+
type: i0.ViewChild,
|
|
17652
|
+
args: [i0.forwardRef(() => PopoverComponent), { isSignal: true }]
|
|
17653
|
+
}],
|
|
17602
17654
|
placeholder: [{
|
|
17603
17655
|
type: i0.Input,
|
|
17604
17656
|
args: [{
|
|
@@ -21700,6 +21752,7 @@ var LineChartComponent = class LineChartComponent {
|
|
|
21700
21752
|
curve = input("linear", ...ngDevMode ? [{ debugName: "curve" }] : /* istanbul ignore next */ []);
|
|
21701
21753
|
showArea = input(false, ...ngDevMode ? [{ debugName: "showArea" }] : /* istanbul ignore next */ []);
|
|
21702
21754
|
showPoints = input(true, ...ngDevMode ? [{ debugName: "showPoints" }] : /* istanbul ignore next */ []);
|
|
21755
|
+
connectGaps = input(false, ...ngDevMode ? [{ debugName: "connectGaps" }] : /* istanbul ignore next */ []);
|
|
21703
21756
|
showGrid = input(true, ...ngDevMode ? [{ debugName: "showGrid" }] : /* istanbul ignore next */ []);
|
|
21704
21757
|
showLegend = input(true, ...ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []);
|
|
21705
21758
|
yMin = input(void 0, ...ngDevMode ? [{ debugName: "yMin" }] : /* istanbul ignore next */ []);
|
|
@@ -21791,14 +21844,17 @@ var LineChartComponent = class LineChartComponent {
|
|
|
21791
21844
|
}), ...ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []);
|
|
21792
21845
|
runs = computed(() => {
|
|
21793
21846
|
const positions = this.positions();
|
|
21847
|
+
const connectGaps = this.connectGaps();
|
|
21794
21848
|
return this.series().map((s) => {
|
|
21795
21849
|
const runs = [];
|
|
21796
21850
|
let run = [];
|
|
21797
21851
|
positions.forEach((position, index) => {
|
|
21798
21852
|
const value = s.data[index];
|
|
21799
21853
|
if (!this.isValue(value) || !isFinite(position)) {
|
|
21800
|
-
if (run.length)
|
|
21801
|
-
|
|
21854
|
+
if (!connectGaps && run.length) {
|
|
21855
|
+
runs.push(run);
|
|
21856
|
+
run = [];
|
|
21857
|
+
}
|
|
21802
21858
|
return;
|
|
21803
21859
|
}
|
|
21804
21860
|
run.push({
|
|
@@ -22481,6 +22537,13 @@ var LineChartComponent = class LineChartComponent {
|
|
|
22481
22537
|
isRequired: false,
|
|
22482
22538
|
transformFunction: null
|
|
22483
22539
|
},
|
|
22540
|
+
connectGaps: {
|
|
22541
|
+
classPropertyName: "connectGaps",
|
|
22542
|
+
publicName: "connectGaps",
|
|
22543
|
+
isSignal: true,
|
|
22544
|
+
isRequired: false,
|
|
22545
|
+
transformFunction: null
|
|
22546
|
+
},
|
|
22484
22547
|
showGrid: {
|
|
22485
22548
|
classPropertyName: "showGrid",
|
|
22486
22549
|
publicName: "showGrid",
|
|
@@ -22718,6 +22781,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
22718
22781
|
required: false
|
|
22719
22782
|
}]
|
|
22720
22783
|
}],
|
|
22784
|
+
connectGaps: [{
|
|
22785
|
+
type: i0.Input,
|
|
22786
|
+
args: [{
|
|
22787
|
+
isSignal: true,
|
|
22788
|
+
alias: "connectGaps",
|
|
22789
|
+
required: false
|
|
22790
|
+
}]
|
|
22791
|
+
}],
|
|
22721
22792
|
showGrid: [{
|
|
22722
22793
|
type: i0.Input,
|
|
22723
22794
|
args: [{
|
|
@@ -30260,7 +30331,12 @@ var TimePickerComponent = class TimePickerComponent extends LabelledFieldControl
|
|
|
30260
30331
|
secondsEl = viewChild("secondsEl", ...ngDevMode ? [{ debugName: "secondsEl" }] : /* istanbul ignore next */ []);
|
|
30261
30332
|
i18n = inject(EagamiI18nService);
|
|
30262
30333
|
destroyRef = inject(DestroyRef);
|
|
30263
|
-
|
|
30334
|
+
popover = viewChild(PopoverComponent, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
|
|
30335
|
+
focusHoursOnReveal = focusOnReveal(() => this.isOpen(), () => this.popover(), () => {
|
|
30336
|
+
const el = this.hoursEl()?.nativeElement;
|
|
30337
|
+
el?.focus();
|
|
30338
|
+
el?.select();
|
|
30339
|
+
});
|
|
30264
30340
|
placeholder = input(void 0, ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
30265
30341
|
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
30266
30342
|
disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
@@ -30364,13 +30440,6 @@ var TimePickerComponent = class TimePickerComponent extends LabelledFieldControl
|
|
|
30364
30440
|
if (this.isDisabled() || this.readonly() || this.isOpen()) return;
|
|
30365
30441
|
this.isOpen.set(true);
|
|
30366
30442
|
}
|
|
30367
|
-
focusHoursWhenReady() {
|
|
30368
|
-
afterNextRender(() => {
|
|
30369
|
-
const el = this.hoursEl()?.nativeElement;
|
|
30370
|
-
el?.focus();
|
|
30371
|
-
el?.select();
|
|
30372
|
-
}, { injector: this.injector });
|
|
30373
|
-
}
|
|
30374
30443
|
close() {
|
|
30375
30444
|
this.isOpen.set(false);
|
|
30376
30445
|
}
|
|
@@ -30391,7 +30460,7 @@ var TimePickerComponent = class TimePickerComponent extends LabelledFieldControl
|
|
|
30391
30460
|
if (event.key === "ArrowDown") {
|
|
30392
30461
|
event.preventDefault();
|
|
30393
30462
|
if (!this.isOpen()) this.isOpen.set(true);
|
|
30394
|
-
this.
|
|
30463
|
+
this.focusHoursOnReveal();
|
|
30395
30464
|
} else if (event.key === "Enter") {
|
|
30396
30465
|
event.preventDefault();
|
|
30397
30466
|
this.commitTyped();
|
|
@@ -30740,6 +30809,13 @@ var TimePickerComponent = class TimePickerComponent extends LabelledFieldControl
|
|
|
30740
30809
|
predicate: ["secondsEl"],
|
|
30741
30810
|
descendants: true,
|
|
30742
30811
|
isSignal: true
|
|
30812
|
+
},
|
|
30813
|
+
{
|
|
30814
|
+
propertyName: "popover",
|
|
30815
|
+
first: true,
|
|
30816
|
+
predicate: PopoverComponent,
|
|
30817
|
+
descendants: true,
|
|
30818
|
+
isSignal: true
|
|
30743
30819
|
}
|
|
30744
30820
|
],
|
|
30745
30821
|
usesInheritance: true,
|
|
@@ -30878,6 +30954,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
30878
30954
|
type: i0.ViewChild,
|
|
30879
30955
|
args: ["secondsEl", { isSignal: true }]
|
|
30880
30956
|
}],
|
|
30957
|
+
popover: [{
|
|
30958
|
+
type: i0.ViewChild,
|
|
30959
|
+
args: [i0.forwardRef(() => PopoverComponent), { isSignal: true }]
|
|
30960
|
+
}],
|
|
30881
30961
|
placeholder: [{
|
|
30882
30962
|
type: i0.Input,
|
|
30883
30963
|
args: [{
|