@edsis/ui 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/accordion/README.md +195 -0
- package/alert/README.md +177 -0
- package/alert-dialog/README.md +239 -0
- package/aspect-ratio/README.md +112 -0
- package/avatar/README.md +176 -0
- package/badge/README.md +133 -0
- package/breadcrumb/README.md +216 -0
- package/button/README.md +139 -0
- package/button-group/README.md +204 -0
- package/calendar/README.md +132 -0
- package/card/README.md +220 -0
- package/carousel/README.md +276 -0
- package/chart/README.md +249 -0
- package/checkbox/README.md +149 -0
- package/collapsible/README.md +191 -0
- package/combobox/README.md +198 -0
- package/command/README.md +275 -0
- package/composer/README.md +235 -0
- package/context-menu/README.md +267 -0
- package/date-picker/README.md +177 -0
- package/dialog/README.md +237 -0
- package/drawer/README.md +145 -0
- package/dropdown-menu/README.md +311 -0
- package/editor/README.md +136 -0
- package/empty/README.md +183 -0
- package/fesm2022/edsis-ui-accordion.mjs +174 -0
- package/fesm2022/edsis-ui-accordion.mjs.map +1 -0
- package/fesm2022/edsis-ui-alert-dialog.mjs +242 -0
- package/fesm2022/edsis-ui-alert-dialog.mjs.map +1 -0
- package/fesm2022/edsis-ui-alert.mjs +90 -0
- package/fesm2022/edsis-ui-alert.mjs.map +1 -0
- package/fesm2022/edsis-ui-aspect-ratio.mjs +33 -0
- package/fesm2022/edsis-ui-aspect-ratio.mjs.map +1 -0
- package/fesm2022/edsis-ui-avatar.mjs +123 -0
- package/fesm2022/edsis-ui-avatar.mjs.map +1 -0
- package/fesm2022/edsis-ui-badge.mjs +47 -0
- package/fesm2022/edsis-ui-badge.mjs.map +1 -0
- package/fesm2022/edsis-ui-breadcrumb.mjs +186 -0
- package/fesm2022/edsis-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/edsis-ui-button-group.mjs +95 -0
- package/fesm2022/edsis-ui-button-group.mjs.map +1 -0
- package/fesm2022/edsis-ui-button.mjs +64 -0
- package/fesm2022/edsis-ui-button.mjs.map +1 -0
- package/fesm2022/edsis-ui-calendar.mjs +78 -0
- package/fesm2022/edsis-ui-calendar.mjs.map +1 -0
- package/fesm2022/edsis-ui-card.mjs +137 -0
- package/fesm2022/edsis-ui-card.mjs.map +1 -0
- package/fesm2022/edsis-ui-carousel.mjs +310 -0
- package/fesm2022/edsis-ui-carousel.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-area.mjs +6 -0
- package/fesm2022/edsis-ui-chart-area.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-bar.mjs +6 -0
- package/fesm2022/edsis-ui-chart-bar.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-line.mjs +6 -0
- package/fesm2022/edsis-ui-chart-line.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-pie.mjs +6 -0
- package/fesm2022/edsis-ui-chart-pie.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-radar.mjs +6 -0
- package/fesm2022/edsis-ui-chart-radar.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-radial.mjs +6 -0
- package/fesm2022/edsis-ui-chart-radial.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart-scatter.mjs +6 -0
- package/fesm2022/edsis-ui-chart-scatter.mjs.map +1 -0
- package/fesm2022/edsis-ui-chart.mjs +3714 -0
- package/fesm2022/edsis-ui-chart.mjs.map +1 -0
- package/fesm2022/edsis-ui-checkbox.mjs +104 -0
- package/fesm2022/edsis-ui-checkbox.mjs.map +1 -0
- package/fesm2022/edsis-ui-collapsible.mjs +116 -0
- package/fesm2022/edsis-ui-collapsible.mjs.map +1 -0
- package/fesm2022/edsis-ui-combobox.mjs +263 -0
- package/fesm2022/edsis-ui-combobox.mjs.map +1 -0
- package/fesm2022/edsis-ui-command.mjs +268 -0
- package/fesm2022/edsis-ui-command.mjs.map +1 -0
- package/fesm2022/edsis-ui-composer.mjs +329 -0
- package/fesm2022/edsis-ui-composer.mjs.map +1 -0
- package/fesm2022/edsis-ui-context-menu.mjs +100 -0
- package/fesm2022/edsis-ui-context-menu.mjs.map +1 -0
- package/fesm2022/edsis-ui-date-picker.mjs +155 -0
- package/fesm2022/edsis-ui-date-picker.mjs.map +1 -0
- package/fesm2022/edsis-ui-dialog.mjs +262 -0
- package/fesm2022/edsis-ui-dialog.mjs.map +1 -0
- package/fesm2022/edsis-ui-drawer.mjs +6 -0
- package/fesm2022/edsis-ui-drawer.mjs.map +1 -0
- package/fesm2022/edsis-ui-dropdown-menu.mjs +466 -0
- package/fesm2022/edsis-ui-dropdown-menu.mjs.map +1 -0
- package/fesm2022/edsis-ui-editor.mjs +692 -0
- package/fesm2022/edsis-ui-editor.mjs.map +1 -0
- package/fesm2022/edsis-ui-empty.mjs +132 -0
- package/fesm2022/edsis-ui-empty.mjs.map +1 -0
- package/fesm2022/edsis-ui-form.mjs +334 -0
- package/fesm2022/edsis-ui-form.mjs.map +1 -0
- package/fesm2022/edsis-ui-hover-card.mjs +284 -0
- package/fesm2022/edsis-ui-hover-card.mjs.map +1 -0
- package/fesm2022/edsis-ui-input-group.mjs +164 -0
- package/fesm2022/edsis-ui-input-group.mjs.map +1 -0
- package/fesm2022/edsis-ui-input-otp.mjs +485 -0
- package/fesm2022/edsis-ui-input-otp.mjs.map +1 -0
- package/fesm2022/edsis-ui-input.mjs +43 -0
- package/fesm2022/edsis-ui-input.mjs.map +1 -0
- package/fesm2022/edsis-ui-item.mjs +241 -0
- package/fesm2022/edsis-ui-item.mjs.map +1 -0
- package/fesm2022/edsis-ui-kanban.mjs +289 -0
- package/fesm2022/edsis-ui-kanban.mjs.map +1 -0
- package/fesm2022/edsis-ui-kbd.mjs +51 -0
- package/fesm2022/edsis-ui-kbd.mjs.map +1 -0
- package/fesm2022/edsis-ui-label.mjs +30 -0
- package/fesm2022/edsis-ui-label.mjs.map +1 -0
- package/fesm2022/edsis-ui-menubar.mjs +302 -0
- package/fesm2022/edsis-ui-menubar.mjs.map +1 -0
- package/fesm2022/edsis-ui-native-select.mjs +61 -0
- package/fesm2022/edsis-ui-native-select.mjs.map +1 -0
- package/fesm2022/edsis-ui-navigation-menu.mjs +399 -0
- package/fesm2022/edsis-ui-navigation-menu.mjs.map +1 -0
- package/fesm2022/edsis-ui-pagination.mjs +216 -0
- package/fesm2022/edsis-ui-pagination.mjs.map +1 -0
- package/fesm2022/edsis-ui-pillbox.mjs +777 -0
- package/fesm2022/edsis-ui-pillbox.mjs.map +1 -0
- package/fesm2022/edsis-ui-popover.mjs +163 -0
- package/fesm2022/edsis-ui-popover.mjs.map +1 -0
- package/fesm2022/edsis-ui-progress.mjs +53 -0
- package/fesm2022/edsis-ui-progress.mjs.map +1 -0
- package/fesm2022/edsis-ui-radio.mjs +111 -0
- package/fesm2022/edsis-ui-radio.mjs.map +1 -0
- package/fesm2022/edsis-ui-resizable.mjs +454 -0
- package/fesm2022/edsis-ui-resizable.mjs.map +1 -0
- package/fesm2022/edsis-ui-scroll-area.mjs +48 -0
- package/fesm2022/edsis-ui-scroll-area.mjs.map +1 -0
- package/fesm2022/edsis-ui-select.mjs +164 -0
- package/fesm2022/edsis-ui-select.mjs.map +1 -0
- package/fesm2022/edsis-ui-separator.mjs +33 -0
- package/fesm2022/edsis-ui-separator.mjs.map +1 -0
- package/fesm2022/edsis-ui-sheet.mjs +264 -0
- package/fesm2022/edsis-ui-sheet.mjs.map +1 -0
- package/fesm2022/edsis-ui-skeleton.mjs +29 -0
- package/fesm2022/edsis-ui-skeleton.mjs.map +1 -0
- package/fesm2022/edsis-ui-slider.mjs +405 -0
- package/fesm2022/edsis-ui-slider.mjs.map +1 -0
- package/fesm2022/edsis-ui-spinner.mjs +58 -0
- package/fesm2022/edsis-ui-spinner.mjs.map +1 -0
- package/fesm2022/edsis-ui-switch.mjs +107 -0
- package/fesm2022/edsis-ui-switch.mjs.map +1 -0
- package/fesm2022/edsis-ui-table.mjs +139 -0
- package/fesm2022/edsis-ui-table.mjs.map +1 -0
- package/fesm2022/edsis-ui-tabs.mjs +252 -0
- package/fesm2022/edsis-ui-tabs.mjs.map +1 -0
- package/fesm2022/edsis-ui-textarea.mjs +37 -0
- package/fesm2022/edsis-ui-textarea.mjs.map +1 -0
- package/fesm2022/edsis-ui-timeline.mjs +213 -0
- package/fesm2022/edsis-ui-timeline.mjs.map +1 -0
- package/fesm2022/edsis-ui-toast.mjs +71 -0
- package/fesm2022/edsis-ui-toast.mjs.map +1 -0
- package/fesm2022/edsis-ui-toggle-group.mjs +269 -0
- package/fesm2022/edsis-ui-toggle-group.mjs.map +1 -0
- package/fesm2022/edsis-ui-toggle.mjs +76 -0
- package/fesm2022/edsis-ui-toggle.mjs.map +1 -0
- package/fesm2022/edsis-ui-tooltip.mjs +339 -0
- package/fesm2022/edsis-ui-tooltip.mjs.map +1 -0
- package/fesm2022/edsis-ui-utils.mjs +13 -0
- package/fesm2022/edsis-ui-utils.mjs.map +1 -0
- package/fesm2022/edsis-ui.mjs +11 -0
- package/fesm2022/edsis-ui.mjs.map +1 -0
- package/form/README.md +210 -0
- package/hover-card/README.md +146 -0
- package/input/README.md +159 -0
- package/input-group/README.md +234 -0
- package/input-otp/README.md +273 -0
- package/item/README.md +247 -0
- package/kanban/README.md +81 -0
- package/kbd/README.md +139 -0
- package/label/README.md +136 -0
- package/menubar/README.md +269 -0
- package/native-select/README.md +176 -0
- package/navigation-menu/README.md +160 -0
- package/package.json +310 -0
- package/pagination/README.md +144 -0
- package/pillbox/README.md +67 -0
- package/popover/README.md +43 -0
- package/progress/README.md +160 -0
- package/radio/README.md +209 -0
- package/resizable/README.md +164 -0
- package/scroll-area/README.md +143 -0
- package/select/README.md +174 -0
- package/separator/README.md +170 -0
- package/sheet/README.md +183 -0
- package/skeleton/README.md +158 -0
- package/slider/README.md +207 -0
- package/spinner/README.md +160 -0
- package/switch/README.md +166 -0
- package/table/README.md +291 -0
- package/tabs/README.md +214 -0
- package/textarea/README.md +154 -0
- package/timeline/README.md +94 -0
- package/toast/README.md +321 -0
- package/toggle/README.md +131 -0
- package/toggle-group/README.md +206 -0
- package/tooltip/README.md +211 -0
- package/types/edsis-ui-accordion.d.ts +51 -0
- package/types/edsis-ui-alert-dialog.d.ts +93 -0
- package/types/edsis-ui-alert.d.ts +37 -0
- package/types/edsis-ui-aspect-ratio.d.ts +12 -0
- package/types/edsis-ui-avatar.d.ts +51 -0
- package/types/edsis-ui-badge.d.ts +19 -0
- package/types/edsis-ui-breadcrumb.d.ts +46 -0
- package/types/edsis-ui-button-group.d.ts +26 -0
- package/types/edsis-ui-button.d.ts +22 -0
- package/types/edsis-ui-calendar.d.ts +33 -0
- package/types/edsis-ui-card.d.ts +60 -0
- package/types/edsis-ui-carousel.d.ts +86 -0
- package/types/edsis-ui-chart-area.d.ts +1 -0
- package/types/edsis-ui-chart-bar.d.ts +1 -0
- package/types/edsis-ui-chart-line.d.ts +1 -0
- package/types/edsis-ui-chart-pie.d.ts +1 -0
- package/types/edsis-ui-chart-radar.d.ts +1 -0
- package/types/edsis-ui-chart-radial.d.ts +1 -0
- package/types/edsis-ui-chart-scatter.d.ts +1 -0
- package/types/edsis-ui-chart.d.ts +1094 -0
- package/types/edsis-ui-checkbox.d.ts +35 -0
- package/types/edsis-ui-collapsible.d.ts +42 -0
- package/types/edsis-ui-combobox.d.ts +51 -0
- package/types/edsis-ui-command.d.ts +99 -0
- package/types/edsis-ui-composer.d.ts +90 -0
- package/types/edsis-ui-context-menu.d.ts +35 -0
- package/types/edsis-ui-date-picker.d.ts +41 -0
- package/types/edsis-ui-dialog.d.ts +87 -0
- package/types/edsis-ui-drawer.d.ts +1 -0
- package/types/edsis-ui-dropdown-menu.d.ts +136 -0
- package/types/edsis-ui-editor.d.ts +123 -0
- package/types/edsis-ui-empty.d.ts +50 -0
- package/types/edsis-ui-form.d.ts +141 -0
- package/types/edsis-ui-hover-card.d.ts +74 -0
- package/types/edsis-ui-input-group.d.ts +51 -0
- package/types/edsis-ui-input-otp.d.ts +136 -0
- package/types/edsis-ui-input.d.ts +16 -0
- package/types/edsis-ui-item.d.ts +88 -0
- package/types/edsis-ui-kanban.d.ts +70 -0
- package/types/edsis-ui-kbd.d.ts +16 -0
- package/types/edsis-ui-label.d.ts +11 -0
- package/types/edsis-ui-menubar.d.ts +67 -0
- package/types/edsis-ui-native-select.d.ts +26 -0
- package/types/edsis-ui-navigation-menu.d.ts +96 -0
- package/types/edsis-ui-pagination.d.ts +34 -0
- package/types/edsis-ui-pillbox.d.ts +157 -0
- package/types/edsis-ui-popover.d.ts +43 -0
- package/types/edsis-ui-progress.d.ts +17 -0
- package/types/edsis-ui-radio.d.ts +40 -0
- package/types/edsis-ui-resizable.d.ts +99 -0
- package/types/edsis-ui-scroll-area.d.ts +19 -0
- package/types/edsis-ui-select.d.ts +57 -0
- package/types/edsis-ui-separator.d.ts +14 -0
- package/types/edsis-ui-sheet.d.ts +76 -0
- package/types/edsis-ui-skeleton.d.ts +10 -0
- package/types/edsis-ui-slider.d.ts +74 -0
- package/types/edsis-ui-spinner.d.ts +13 -0
- package/types/edsis-ui-switch.d.ts +40 -0
- package/types/edsis-ui-table.d.ts +52 -0
- package/types/edsis-ui-tabs.d.ts +92 -0
- package/types/edsis-ui-textarea.d.ts +12 -0
- package/types/edsis-ui-timeline.d.ts +63 -0
- package/types/edsis-ui-toast.d.ts +38 -0
- package/types/edsis-ui-toggle-group.d.ts +89 -0
- package/types/edsis-ui-toggle.d.ts +25 -0
- package/types/edsis-ui-tooltip.d.ts +89 -0
- package/types/edsis-ui-utils.d.ts +5 -0
- package/types/edsis-ui.d.ts +2 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injector, input, booleanAttribute, output, viewChild, signal, computed, effect, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { MatFormField } from '@angular/material/form-field';
|
|
5
|
+
import { FormFieldContext } from '@edsis/ui/form';
|
|
6
|
+
import { MatSelect } from '@angular/material/select';
|
|
7
|
+
import { cn } from '@edsis/ui/utils';
|
|
8
|
+
import { MatOption } from '@angular/material/core';
|
|
9
|
+
|
|
10
|
+
let nextId = 0;
|
|
11
|
+
class SelectComponent {
|
|
12
|
+
injector = inject(Injector);
|
|
13
|
+
formFieldContext = inject(FormFieldContext, { optional: true });
|
|
14
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
15
|
+
id = input(null, { ...(ngDevMode ? { debugName: "id" } : /* istanbul ignore next */ {}), alias: 'id' });
|
|
16
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
17
|
+
multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
18
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
19
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
20
|
+
ariaDescribedby = input(null, { ...(ngDevMode ? { debugName: "ariaDescribedby" } : /* istanbul ignore next */ {}), alias: 'aria-describedby' });
|
|
21
|
+
ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
22
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
23
|
+
valueChange = output();
|
|
24
|
+
openedChange = output();
|
|
25
|
+
ref = viewChild.required('ref');
|
|
26
|
+
generatedId = `ui-select-${++nextId}`;
|
|
27
|
+
value = signal(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
28
|
+
disabledFromControl = signal(false, ...(ngDevMode ? [{ debugName: "disabledFromControl" }] : /* istanbul ignore next */ []));
|
|
29
|
+
disabledState = computed(() => this.disabled() || this.disabledFromControl(), ...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
|
|
30
|
+
resolvedId = computed(() => this.id() ?? this.formFieldContext?.controlId ?? this.generatedId, ...(ngDevMode ? [{ debugName: "resolvedId" }] : /* istanbul ignore next */ []));
|
|
31
|
+
describedBy = computed(() => {
|
|
32
|
+
const values = [this.ariaDescribedby(), this.formFieldContext?.describedBy() ?? null].filter((value) => !!value && value.trim().length > 0);
|
|
33
|
+
return values.length > 0 ? values.join(' ') : null;
|
|
34
|
+
}, ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
35
|
+
classes = computed(() => cn('ui-select-field w-full', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
36
|
+
ngControl = null;
|
|
37
|
+
onChange = () => { };
|
|
38
|
+
onTouched = () => { };
|
|
39
|
+
constructor() {
|
|
40
|
+
effect(() => {
|
|
41
|
+
const invalid = this.formFieldContext?.invalid() ?? false;
|
|
42
|
+
const ref = this.ref();
|
|
43
|
+
ref.errorState = invalid;
|
|
44
|
+
ref.stateChanges.next();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
ngOnInit() {
|
|
48
|
+
this.ngControl = this.injector.get(NgControl, null, { optional: true, self: true });
|
|
49
|
+
if (this.formFieldContext) {
|
|
50
|
+
this.formFieldContext.control.set(this.ngControl?.control ?? null);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
handleChange(e) {
|
|
54
|
+
this.value.set(e.value);
|
|
55
|
+
this.onChange(e.value);
|
|
56
|
+
this.onTouched();
|
|
57
|
+
this.valueChange.emit(e.value);
|
|
58
|
+
}
|
|
59
|
+
open() {
|
|
60
|
+
this.ref().open();
|
|
61
|
+
}
|
|
62
|
+
close() {
|
|
63
|
+
this.ref().close();
|
|
64
|
+
}
|
|
65
|
+
focus() {
|
|
66
|
+
this.ref().focus();
|
|
67
|
+
}
|
|
68
|
+
writeValue(v) {
|
|
69
|
+
this.value.set(v);
|
|
70
|
+
}
|
|
71
|
+
registerOnChange(fn) {
|
|
72
|
+
this.onChange = fn;
|
|
73
|
+
}
|
|
74
|
+
registerOnTouched(fn) {
|
|
75
|
+
this.onTouched = fn;
|
|
76
|
+
}
|
|
77
|
+
setDisabledState(d) {
|
|
78
|
+
this.disabledFromControl.set(d);
|
|
79
|
+
}
|
|
80
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
81
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.14", type: SelectComponent, isStandalone: true, selector: "ui-select", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", openedChange: "openedChange" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectComponent), multi: true }], viewQueries: [{ propertyName: "ref", first: true, predicate: ["ref"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
82
|
+
<mat-form-field [class]="classes()" subscriptSizing="dynamic">
|
|
83
|
+
<mat-select
|
|
84
|
+
#ref
|
|
85
|
+
[id]="resolvedId()"
|
|
86
|
+
disableRipple
|
|
87
|
+
panelClass="ui-select-panel"
|
|
88
|
+
[value]="value()"
|
|
89
|
+
[disabled]="disabledState()"
|
|
90
|
+
[multiple]="multiple()"
|
|
91
|
+
[placeholder]="placeholder()"
|
|
92
|
+
[required]="required()"
|
|
93
|
+
[attr.aria-label]="ariaLabel()"
|
|
94
|
+
[attr.aria-describedby]="describedBy()"
|
|
95
|
+
[attr.aria-labelledby]="ariaLabelledby()"
|
|
96
|
+
(selectionChange)="handleChange($event)"
|
|
97
|
+
(openedChange)="openedChange.emit($event)">
|
|
98
|
+
<ng-content />
|
|
99
|
+
</mat-select>
|
|
100
|
+
</mat-form-field>
|
|
101
|
+
`, isInline: true, styles: [":host{display:block;width:100%}:host ::ng-deep .mat-mdc-form-field{--mat-form-field-container-height: 2.25rem;--mat-form-field-container-vertical-padding: 0;--mat-form-field-filled-with-label-container-padding-top: 0;--mat-form-field-filled-with-label-container-padding-bottom: 0;--mdc-outlined-text-field-container-shape: calc(var(--radius) - .125rem);--mdc-outlined-text-field-outline-color: hsl(var(--input));--mdc-outlined-text-field-hover-outline-color: hsl(var(--input));--mdc-outlined-text-field-focus-outline-color: hsl(var(--ring));--mdc-outlined-text-field-input-text-color: hsl(var(--foreground));--mdc-outlined-text-field-label-text-color: hsl(var(--muted-foreground));--mdc-outlined-text-field-hover-label-text-color: hsl(var(--muted-foreground));--mdc-outlined-text-field-focus-label-text-color: hsl(var(--muted-foreground));--mdc-outlined-text-field-disabled-outline-color: hsl(var(--input) / .5);--mdc-outlined-text-field-disabled-input-text-color: hsl(var(--muted-foreground));font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--text-sm--line-height);width:100%}:host ::ng-deep .mat-mdc-text-field-wrapper{background:transparent;display:flex;align-items:center;height:2.25rem;padding:0 .75rem}:host ::ng-deep .mat-mdc-form-field-flex{align-items:center;height:2.25rem}:host ::ng-deep .mat-mdc-form-field-infix{display:flex;align-items:center;min-height:2.25rem;height:2.25rem;padding:0;width:auto}:host ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}:host ::ng-deep .mdc-floating-label,:host ::ng-deep .mat-mdc-floating-label,:host ::ng-deep .mdc-notched-outline__notch .mdc-floating-label{display:none}:host ::ng-deep .mdc-notched-outline__notch{padding:0;border-left:none;border-right:none}:host ::ng-deep .mat-mdc-select-value{display:flex;align-items:center;color:hsl(var(--foreground))}:host ::ng-deep .mat-mdc-select-trigger{display:flex;align-items:center;min-height:inherit}:host ::ng-deep .mat-mdc-select-placeholder{color:hsl(var(--muted-foreground))}:host ::ng-deep .mat-mdc-select-arrow{color:hsl(var(--muted-foreground))}\n"], dependencies: [{ kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
102
|
+
}
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SelectComponent, decorators: [{
|
|
104
|
+
type: Component,
|
|
105
|
+
args: [{ selector: 'ui-select', imports: [MatFormField, MatSelect], changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectComponent), multi: true }], template: `
|
|
106
|
+
<mat-form-field [class]="classes()" subscriptSizing="dynamic">
|
|
107
|
+
<mat-select
|
|
108
|
+
#ref
|
|
109
|
+
[id]="resolvedId()"
|
|
110
|
+
disableRipple
|
|
111
|
+
panelClass="ui-select-panel"
|
|
112
|
+
[value]="value()"
|
|
113
|
+
[disabled]="disabledState()"
|
|
114
|
+
[multiple]="multiple()"
|
|
115
|
+
[placeholder]="placeholder()"
|
|
116
|
+
[required]="required()"
|
|
117
|
+
[attr.aria-label]="ariaLabel()"
|
|
118
|
+
[attr.aria-describedby]="describedBy()"
|
|
119
|
+
[attr.aria-labelledby]="ariaLabelledby()"
|
|
120
|
+
(selectionChange)="handleChange($event)"
|
|
121
|
+
(openedChange)="openedChange.emit($event)">
|
|
122
|
+
<ng-content />
|
|
123
|
+
</mat-select>
|
|
124
|
+
</mat-form-field>
|
|
125
|
+
`, styles: [":host{display:block;width:100%}:host ::ng-deep .mat-mdc-form-field{--mat-form-field-container-height: 2.25rem;--mat-form-field-container-vertical-padding: 0;--mat-form-field-filled-with-label-container-padding-top: 0;--mat-form-field-filled-with-label-container-padding-bottom: 0;--mdc-outlined-text-field-container-shape: calc(var(--radius) - .125rem);--mdc-outlined-text-field-outline-color: hsl(var(--input));--mdc-outlined-text-field-hover-outline-color: hsl(var(--input));--mdc-outlined-text-field-focus-outline-color: hsl(var(--ring));--mdc-outlined-text-field-input-text-color: hsl(var(--foreground));--mdc-outlined-text-field-label-text-color: hsl(var(--muted-foreground));--mdc-outlined-text-field-hover-label-text-color: hsl(var(--muted-foreground));--mdc-outlined-text-field-focus-label-text-color: hsl(var(--muted-foreground));--mdc-outlined-text-field-disabled-outline-color: hsl(var(--input) / .5);--mdc-outlined-text-field-disabled-input-text-color: hsl(var(--muted-foreground));font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--text-sm--line-height);width:100%}:host ::ng-deep .mat-mdc-text-field-wrapper{background:transparent;display:flex;align-items:center;height:2.25rem;padding:0 .75rem}:host ::ng-deep .mat-mdc-form-field-flex{align-items:center;height:2.25rem}:host ::ng-deep .mat-mdc-form-field-infix{display:flex;align-items:center;min-height:2.25rem;height:2.25rem;padding:0;width:auto}:host ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}:host ::ng-deep .mdc-floating-label,:host ::ng-deep .mat-mdc-floating-label,:host ::ng-deep .mdc-notched-outline__notch .mdc-floating-label{display:none}:host ::ng-deep .mdc-notched-outline__notch{padding:0;border-left:none;border-right:none}:host ::ng-deep .mat-mdc-select-value{display:flex;align-items:center;color:hsl(var(--foreground))}:host ::ng-deep .mat-mdc-select-trigger{display:flex;align-items:center;min-height:inherit}:host ::ng-deep .mat-mdc-select-placeholder{color:hsl(var(--muted-foreground))}:host ::ng-deep .mat-mdc-select-arrow{color:hsl(var(--muted-foreground))}\n"] }]
|
|
126
|
+
}], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], openedChange: [{ type: i0.Output, args: ["openedChange"] }], ref: [{ type: i0.ViewChild, args: ['ref', { isSignal: true }] }] } });
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Option for `<ui-select>`. Wraps `mat-option` so the underlying `mat-select`
|
|
130
|
+
* can still discover it via `@ContentChildren(MatOption, { descendants: true })`.
|
|
131
|
+
*/
|
|
132
|
+
class OptionComponent {
|
|
133
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
134
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
135
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
136
|
+
classes = computed(() => cn('contents', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
137
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
138
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: OptionComponent, isStandalone: true, selector: "ui-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
|
|
139
|
+
<mat-option [value]="value()" [disabled]="disabled()">
|
|
140
|
+
<ng-content />
|
|
141
|
+
</mat-option>
|
|
142
|
+
`, isInline: true, dependencies: [{ kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
143
|
+
}
|
|
144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: OptionComponent, decorators: [{
|
|
145
|
+
type: Component,
|
|
146
|
+
args: [{
|
|
147
|
+
selector: 'ui-option',
|
|
148
|
+
imports: [MatOption],
|
|
149
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
150
|
+
host: { '[class]': 'classes()' },
|
|
151
|
+
template: `
|
|
152
|
+
<mat-option [value]="value()" [disabled]="disabled()">
|
|
153
|
+
<ng-content />
|
|
154
|
+
</mat-option>
|
|
155
|
+
`,
|
|
156
|
+
}]
|
|
157
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Generated bundle index. Do not edit.
|
|
161
|
+
*/
|
|
162
|
+
|
|
163
|
+
export { OptionComponent, SelectComponent };
|
|
164
|
+
//# sourceMappingURL=edsis-ui-select.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edsis-ui-select.mjs","sources":["../../../library/ui/select/select.component.ts","../../../library/ui/select/option.component.ts","../../../library/ui/select/edsis-ui-select.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n forwardRef,\n inject,\n Injector,\n input,\n OnInit,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';\nimport { MatFormField } from '@angular/material/form-field';\nimport { FormFieldContext } from '@edsis/ui/form';\nimport { MatSelect, MatSelectChange } from '@angular/material/select';\nimport { cn } from '@edsis/ui/utils';\n\nlet nextId = 0;\n\n@Component({\n selector: 'ui-select',\n imports: [MatFormField, MatSelect],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectComponent), multi: true }],\n template: `\n <mat-form-field [class]=\"classes()\" subscriptSizing=\"dynamic\">\n <mat-select\n #ref\n [id]=\"resolvedId()\"\n disableRipple\n panelClass=\"ui-select-panel\"\n [value]=\"value()\"\n [disabled]=\"disabledState()\"\n [multiple]=\"multiple()\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n (selectionChange)=\"handleChange($event)\"\n (openedChange)=\"openedChange.emit($event)\">\n <ng-content />\n </mat-select>\n </mat-form-field>\n `,\n styleUrl: './select.component.css',\n})\nexport class SelectComponent implements ControlValueAccessor {\n private readonly injector = inject(Injector);\n private readonly formFieldContext = inject(FormFieldContext, { optional: true });\n\n readonly placeholder = input<string>('');\n readonly id = input<string | null>(null, { alias: 'id' });\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly multiple = input(false, { transform: booleanAttribute });\n readonly required = input(false, { transform: booleanAttribute });\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaDescribedby = input<string | null>(null, { alias: 'aria-describedby' });\n readonly ariaLabelledby = input<string | null>(null, { alias: 'aria-labelledby' });\n readonly class = input<string>('');\n\n readonly valueChange = output<unknown>();\n readonly openedChange = output<boolean>();\n\n private readonly ref = viewChild.required<MatSelect>('ref');\n private readonly generatedId = `ui-select-${++nextId}`;\n\n protected readonly value = signal<unknown>(null);\n private readonly disabledFromControl = signal(false);\n protected readonly disabledState = computed(() => this.disabled() || this.disabledFromControl());\n protected readonly resolvedId = computed(() => this.id() ?? this.formFieldContext?.controlId ?? this.generatedId);\n protected readonly describedBy = computed(() => {\n const values = [this.ariaDescribedby(), this.formFieldContext?.describedBy() ?? null].filter(\n (value): value is string => !!value && value.trim().length > 0,\n );\n\n return values.length > 0 ? values.join(' ') : null;\n });\n protected readonly classes = computed(() => cn('ui-select-field w-full', this.class()));\n\n private ngControl: NgControl | null = null;\n private onChange: (v: unknown) => void = () => {};\n private onTouched: () => void = () => {};\n\n constructor() {\n effect(() => {\n const invalid = this.formFieldContext?.invalid() ?? false;\n const ref = this.ref();\n\n ref.errorState = invalid;\n ref.stateChanges.next();\n });\n }\n\n ngOnInit(): void {\n this.ngControl = this.injector.get(NgControl, null, { optional: true, self: true });\n\n if (this.formFieldContext) {\n this.formFieldContext.control.set(this.ngControl?.control ?? null);\n }\n }\n\n protected handleChange(e: MatSelectChange): void {\n this.value.set(e.value);\n this.onChange(e.value);\n this.onTouched();\n this.valueChange.emit(e.value);\n }\n\n open(): void {\n this.ref().open();\n }\n\n close(): void {\n this.ref().close();\n }\n\n focus(): void {\n this.ref().focus();\n }\n\n writeValue(v: unknown): void {\n this.value.set(v);\n }\n registerOnChange(fn: (v: unknown) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(d: boolean): void {\n this.disabledFromControl.set(d);\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { MatOption } from '@angular/material/core';\nimport { cn } from '@edsis/ui/utils';\n\n/**\n * Option for `<ui-select>`. Wraps `mat-option` so the underlying `mat-select`\n * can still discover it via `@ContentChildren(MatOption, { descendants: true })`.\n */\n@Component({\n selector: 'ui-option',\n imports: [MatOption],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `\n <mat-option [value]=\"value()\" [disabled]=\"disabled()\">\n <ng-content />\n </mat-option>\n `,\n})\nexport class OptionComponent {\n readonly value = input.required<unknown>();\n readonly disabled = input<boolean>(false);\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn('contents', this.class()));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAqBA,IAAI,MAAM,GAAG,CAAC;MA8BD,eAAe,CAAA;AACT,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC3B,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAEvE,IAAA,WAAW,GAAG,KAAK,CAAS,EAAE,kFAAC;IAC/B,EAAE,GAAG,KAAK,CAAgB,IAAI,0EAAI,KAAK,EAAE,IAAI,EAAA,CAAG;IAChD,QAAQ,GAAG,KAAK,CAA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,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EANhB;;;;AAIT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAPS,SAAS,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,IAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FASR,eAAe,EAAA,UAAA,EAAA,CAAA;kBAX3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;oBACrB,OAAO,EAAE,CAAC,SAAS,CAAC;oBACpB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE;AAChC,oBAAA,QAAQ,EAAE;;;;AAIT,EAAA,CAAA;AACF,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { cn } from '@edsis/ui/utils';
|
|
4
|
+
|
|
5
|
+
class SeparatorComponent {
|
|
6
|
+
orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
7
|
+
decorative = input(true, ...(ngDevMode ? [{ debugName: "decorative" }] : /* istanbul ignore next */ []));
|
|
8
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
9
|
+
classes = computed(() => cn('block shrink-0 bg-border', this.orientation() === 'horizontal' ? 'h-px w-full' : 'h-full w-px', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
10
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SeparatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: SeparatorComponent, isStandalone: true, selector: "ui-separator", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, decorative: { classPropertyName: "decorative", publicName: "decorative", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.role": "decorative() ? \"none\" : \"separator\"", "attr.aria-orientation": "decorative() ? null : orientation()", "attr.data-orientation": "orientation()" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12
|
+
}
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SeparatorComponent, decorators: [{
|
|
14
|
+
type: Component,
|
|
15
|
+
args: [{
|
|
16
|
+
selector: 'ui-separator',
|
|
17
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
+
host: {
|
|
19
|
+
'[class]': 'classes()',
|
|
20
|
+
'[attr.role]': 'decorative() ? "none" : "separator"',
|
|
21
|
+
'[attr.aria-orientation]': 'decorative() ? null : orientation()',
|
|
22
|
+
'[attr.data-orientation]': 'orientation()',
|
|
23
|
+
},
|
|
24
|
+
template: '',
|
|
25
|
+
}]
|
|
26
|
+
}], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], decorative: [{ type: i0.Input, args: [{ isSignal: true, alias: "decorative", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Generated bundle index. Do not edit.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
export { SeparatorComponent };
|
|
33
|
+
//# sourceMappingURL=edsis-ui-separator.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edsis-ui-separator.mjs","sources":["../../../library/ui/separator/separator.component.ts","../../../library/ui/separator/edsis-ui-separator.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { cn } from '@edsis/ui/utils';\n\nexport type SeparatorOrientation = 'horizontal' | 'vertical';\n\n@Component({\n selector: 'ui-separator',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.role]': 'decorative() ? \"none\" : \"separator\"',\n '[attr.aria-orientation]': 'decorative() ? null : orientation()',\n '[attr.data-orientation]': 'orientation()',\n },\n template: '',\n})\nexport class SeparatorComponent {\n readonly orientation = input<SeparatorOrientation>('horizontal');\n readonly decorative = input<boolean>(true);\n readonly class = input<string>('');\n\n protected readonly classes = computed(() =>\n cn('block shrink-0 bg-border', this.orientation() === 'horizontal' ? 'h-px w-full' : 'h-full w-px', this.class()),\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAgBa,kBAAkB,CAAA;AACpB,IAAA,WAAW,GAAG,KAAK,CAAuB,YAAY,kFAAC;AACvD,IAAA,UAAU,GAAG,KAAK,CAAU,IAAI,iFAAC;AACjC,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AAEf,IAAA,OAAO,GAAG,QAAQ,CAAC,MACpC,EAAE,CAAC,0BAA0B,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,YAAY,GAAG,aAAa,GAAG,aAAa,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,8EAClH;wGAPU,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,kBAAkB,+qBAFnB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAED,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAX9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;oBACxB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,aAAa,EAAE,qCAAqC;AACpD,wBAAA,yBAAyB,EAAE,qCAAqC;AAChE,wBAAA,yBAAyB,EAAE,eAAe;AAC3C,qBAAA;AACD,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;;ACfD;;AAEG;;;;"}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ViewContainerRef, DestroyRef, ElementRef, model, input, output, viewChild, computed, effect, ChangeDetectionStrategy, Component, Directive } from '@angular/core';
|
|
3
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
4
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
5
|
+
import { FocusTrapFactory } from '@angular/cdk/a11y';
|
|
6
|
+
import { DOCUMENT } from '@angular/common';
|
|
7
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
|
+
import { filter } from 'rxjs/operators';
|
|
9
|
+
import { ButtonComponent } from '@edsis/ui/button';
|
|
10
|
+
import { cn } from '@edsis/ui/utils';
|
|
11
|
+
|
|
12
|
+
const SIDE_BASE = {
|
|
13
|
+
top: 'inset-x-0 top-0 border-b border-border',
|
|
14
|
+
bottom: 'inset-x-0 bottom-0 border-t border-border',
|
|
15
|
+
left: 'inset-y-0 left-0 h-full w-3/4 border-r border-border sm:max-w-sm',
|
|
16
|
+
right: 'inset-y-0 right-0 h-full w-3/4 border-l border-border sm:max-w-sm',
|
|
17
|
+
};
|
|
18
|
+
const DRAWER_SIDE_CLASSES = {
|
|
19
|
+
top: 'max-h-[85vh] rounded-b-lg',
|
|
20
|
+
bottom: 'max-h-[85vh] rounded-t-lg',
|
|
21
|
+
left: 'rounded-r-lg',
|
|
22
|
+
right: 'rounded-l-lg',
|
|
23
|
+
};
|
|
24
|
+
const SIDE_ENTER_FROM = {
|
|
25
|
+
top: 'translateY(-100%)',
|
|
26
|
+
bottom: 'translateY(100%)',
|
|
27
|
+
left: 'translateX(-100%)',
|
|
28
|
+
right: 'translateX(100%)',
|
|
29
|
+
};
|
|
30
|
+
class SheetComponent {
|
|
31
|
+
overlay = inject(Overlay);
|
|
32
|
+
vcr = inject(ViewContainerRef);
|
|
33
|
+
trapFactory = inject(FocusTrapFactory);
|
|
34
|
+
doc = inject(DOCUMENT);
|
|
35
|
+
destroyRef = inject(DestroyRef);
|
|
36
|
+
host = inject((ElementRef));
|
|
37
|
+
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
38
|
+
side = input(undefined, ...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
39
|
+
closeOnEscape = input(true, ...(ngDevMode ? [{ debugName: "closeOnEscape" }] : /* istanbul ignore next */ []));
|
|
40
|
+
closeOnBackdropClick = input(true, ...(ngDevMode ? [{ debugName: "closeOnBackdropClick" }] : /* istanbul ignore next */ []));
|
|
41
|
+
showCloseButton = input(true, ...(ngDevMode ? [{ debugName: "showCloseButton" }] : /* istanbul ignore next */ []));
|
|
42
|
+
closeButtonLabel = input('Close', ...(ngDevMode ? [{ debugName: "closeButtonLabel" }] : /* istanbul ignore next */ []));
|
|
43
|
+
labelledBy = input(null, { ...(ngDevMode ? { debugName: "labelledBy" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
44
|
+
describedBy = input(null, { ...(ngDevMode ? { debugName: "describedBy" } : /* istanbul ignore next */ {}), alias: 'aria-describedby' });
|
|
45
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
46
|
+
openedChange = output();
|
|
47
|
+
tpl = viewChild.required('tpl');
|
|
48
|
+
overlayRef = null;
|
|
49
|
+
focusTrap = null;
|
|
50
|
+
previousFocus = null;
|
|
51
|
+
resolvedSide = computed(() => this.side() ?? (this.isDrawerHost() ? 'bottom' : 'right'), ...(ngDevMode ? [{ debugName: "resolvedSide" }] : /* istanbul ignore next */ []));
|
|
52
|
+
surfaceClasses = computed(() => cn('gap-4 p-6 flex flex-col', SIDE_BASE[this.resolvedSide()], this.isDrawerHost() ? DRAWER_SIDE_CLASSES[this.resolvedSide()] : '', this.class()), ...(ngDevMode ? [{ debugName: "surfaceClasses" }] : /* istanbul ignore next */ []));
|
|
53
|
+
enterFrom = computed(() => SIDE_ENTER_FROM[this.resolvedSide()], ...(ngDevMode ? [{ debugName: "enterFrom" }] : /* istanbul ignore next */ []));
|
|
54
|
+
constructor() {
|
|
55
|
+
effect(() => {
|
|
56
|
+
this.open() ? this.attach() : this.detach();
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
attach() {
|
|
60
|
+
if (this.overlayRef)
|
|
61
|
+
return;
|
|
62
|
+
this.previousFocus = this.doc.activeElement;
|
|
63
|
+
this.overlayRef = this.overlay.create({
|
|
64
|
+
hasBackdrop: true,
|
|
65
|
+
backdropClass: 'ui-dialog-backdrop',
|
|
66
|
+
panelClass: 'ui-sheet-panel',
|
|
67
|
+
scrollStrategy: this.overlay.scrollStrategies.block(),
|
|
68
|
+
positionStrategy: this.overlay.position().global(),
|
|
69
|
+
});
|
|
70
|
+
const portal = new TemplatePortal(this.tpl(), this.vcr);
|
|
71
|
+
this.overlayRef.attach(portal);
|
|
72
|
+
this.focusTrap = this.trapFactory.create(this.overlayRef.hostElement);
|
|
73
|
+
this.focusTrap.focusInitialElementWhenReady();
|
|
74
|
+
if (this.closeOnBackdropClick()) {
|
|
75
|
+
this.overlayRef
|
|
76
|
+
.backdropClick()
|
|
77
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
78
|
+
.subscribe(() => this.open.set(false));
|
|
79
|
+
}
|
|
80
|
+
this.overlayRef
|
|
81
|
+
.keydownEvents()
|
|
82
|
+
.pipe(takeUntilDestroyed(this.destroyRef), filter((e) => e.key === 'Escape' && this.closeOnEscape()))
|
|
83
|
+
.subscribe((e) => {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
this.open.set(false);
|
|
86
|
+
});
|
|
87
|
+
this.openedChange.emit(true);
|
|
88
|
+
}
|
|
89
|
+
detach() {
|
|
90
|
+
if (!this.overlayRef)
|
|
91
|
+
return;
|
|
92
|
+
this.focusTrap?.destroy();
|
|
93
|
+
this.focusTrap = null;
|
|
94
|
+
this.overlayRef.dispose();
|
|
95
|
+
this.overlayRef = null;
|
|
96
|
+
this.previousFocus?.focus?.();
|
|
97
|
+
this.openedChange.emit(false);
|
|
98
|
+
}
|
|
99
|
+
close() {
|
|
100
|
+
this.open.set(false);
|
|
101
|
+
}
|
|
102
|
+
isDrawerHost() {
|
|
103
|
+
return this.host.nativeElement.localName === 'ui-drawer';
|
|
104
|
+
}
|
|
105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: SheetComponent, isStandalone: true, selector: "ui-sheet, ui-drawer", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdropClick: { classPropertyName: "closeOnBackdropClick", publicName: "closeOnBackdropClick", isSignal: true, isRequired: false, transformFunction: null }, showCloseButton: { classPropertyName: "showCloseButton", publicName: "showCloseButton", isSignal: true, isRequired: false, transformFunction: null }, closeButtonLabel: { classPropertyName: "closeButtonLabel", publicName: "closeButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, labelledBy: { classPropertyName: "labelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, describedBy: { classPropertyName: "describedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", openedChange: "openedChange" }, viewQueries: [{ propertyName: "tpl", first: true, predicate: ["tpl"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
107
|
+
<ng-template #tpl>
|
|
108
|
+
<div
|
|
109
|
+
class="ui-sheet-surface fixed z-50 bg-background shadow-lg transition ease-in-out"
|
|
110
|
+
role="dialog"
|
|
111
|
+
aria-modal="true"
|
|
112
|
+
[attr.aria-labelledby]="labelledBy()"
|
|
113
|
+
[attr.aria-describedby]="describedBy()"
|
|
114
|
+
[class]="surfaceClasses()"
|
|
115
|
+
[style.--ui-sheet-from]="enterFrom()">
|
|
116
|
+
@if (showCloseButton()) {
|
|
117
|
+
<button
|
|
118
|
+
type="button"
|
|
119
|
+
ui-button
|
|
120
|
+
variant="ghost"
|
|
121
|
+
size="icon-sm"
|
|
122
|
+
class="ui-sheet-close-button absolute right-4 top-4 h-8 w-8 rounded-md p-0 text-muted-foreground opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring"
|
|
123
|
+
[attr.aria-label]="closeButtonLabel()"
|
|
124
|
+
(click)="close()">
|
|
125
|
+
<span aria-hidden="true">X</span>
|
|
126
|
+
<span class="sr-only">{{ closeButtonLabel() }}</span>
|
|
127
|
+
</button>
|
|
128
|
+
}
|
|
129
|
+
<ng-content />
|
|
130
|
+
</div>
|
|
131
|
+
</ng-template>
|
|
132
|
+
`, isInline: true, styles: [".ui-sheet-surface{animation:ui-sheet-in .3s cubic-bezier(.2,0,0,1)}@keyframes ui-sheet-in{0%{transform:var(--ui-sheet-from)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){.ui-sheet-surface{animation-duration:0ms}}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[ui-button], a[ui-button]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
133
|
+
}
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetComponent, decorators: [{
|
|
135
|
+
type: Component,
|
|
136
|
+
args: [{ selector: 'ui-sheet, ui-drawer', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ButtonComponent], template: `
|
|
137
|
+
<ng-template #tpl>
|
|
138
|
+
<div
|
|
139
|
+
class="ui-sheet-surface fixed z-50 bg-background shadow-lg transition ease-in-out"
|
|
140
|
+
role="dialog"
|
|
141
|
+
aria-modal="true"
|
|
142
|
+
[attr.aria-labelledby]="labelledBy()"
|
|
143
|
+
[attr.aria-describedby]="describedBy()"
|
|
144
|
+
[class]="surfaceClasses()"
|
|
145
|
+
[style.--ui-sheet-from]="enterFrom()">
|
|
146
|
+
@if (showCloseButton()) {
|
|
147
|
+
<button
|
|
148
|
+
type="button"
|
|
149
|
+
ui-button
|
|
150
|
+
variant="ghost"
|
|
151
|
+
size="icon-sm"
|
|
152
|
+
class="ui-sheet-close-button absolute right-4 top-4 h-8 w-8 rounded-md p-0 text-muted-foreground opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring"
|
|
153
|
+
[attr.aria-label]="closeButtonLabel()"
|
|
154
|
+
(click)="close()">
|
|
155
|
+
<span aria-hidden="true">X</span>
|
|
156
|
+
<span class="sr-only">{{ closeButtonLabel() }}</span>
|
|
157
|
+
</button>
|
|
158
|
+
}
|
|
159
|
+
<ng-content />
|
|
160
|
+
</div>
|
|
161
|
+
</ng-template>
|
|
162
|
+
`, styles: [".ui-sheet-surface{animation:ui-sheet-in .3s cubic-bezier(.2,0,0,1)}@keyframes ui-sheet-in{0%{transform:var(--ui-sheet-from)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){.ui-sheet-surface{animation-duration:0ms}}\n"] }]
|
|
163
|
+
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], closeOnBackdropClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBackdropClick", required: false }] }], showCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCloseButton", required: false }] }], closeButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeButtonLabel", required: false }] }], labelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], describedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], openedChange: [{ type: i0.Output, args: ["openedChange"] }], tpl: [{ type: i0.ViewChild, args: ['tpl', { isSignal: true }] }] } });
|
|
164
|
+
|
|
165
|
+
class SheetCloseDirective {
|
|
166
|
+
sheet = inject(SheetComponent);
|
|
167
|
+
closeSheet() {
|
|
168
|
+
this.sheet.close();
|
|
169
|
+
}
|
|
170
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetCloseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
171
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.14", type: SheetCloseDirective, isStandalone: true, selector: "button[ui-sheet-close], a[ui-sheet-close], button[ui-drawer-close], a[ui-drawer-close]", host: { listeners: { "click": "closeSheet()" } }, ngImport: i0 });
|
|
172
|
+
}
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetCloseDirective, decorators: [{
|
|
174
|
+
type: Directive,
|
|
175
|
+
args: [{
|
|
176
|
+
selector: 'button[ui-sheet-close], a[ui-sheet-close], button[ui-drawer-close], a[ui-drawer-close]',
|
|
177
|
+
host: {
|
|
178
|
+
'(click)': 'closeSheet()',
|
|
179
|
+
},
|
|
180
|
+
}]
|
|
181
|
+
}] });
|
|
182
|
+
|
|
183
|
+
class SheetHeaderComponent {
|
|
184
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
185
|
+
classes = computed(() => cn('flex flex-col gap-2 text-center sm:text-left', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
186
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
187
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: SheetHeaderComponent, isStandalone: true, selector: "ui-sheet-header, ui-drawer-header", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
188
|
+
}
|
|
189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetHeaderComponent, decorators: [{
|
|
190
|
+
type: Component,
|
|
191
|
+
args: [{
|
|
192
|
+
selector: 'ui-sheet-header, ui-drawer-header',
|
|
193
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
194
|
+
host: { '[class]': 'classes()' },
|
|
195
|
+
template: `<ng-content />`,
|
|
196
|
+
}]
|
|
197
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
198
|
+
class SheetTitleComponent {
|
|
199
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
200
|
+
classes = computed(() => cn('text-lg font-semibold text-foreground', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
201
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
202
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: SheetTitleComponent, isStandalone: true, selector: "ui-sheet-title, ui-drawer-title, h2[ui-sheet-title], h2[ui-drawer-title]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
203
|
+
}
|
|
204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetTitleComponent, decorators: [{
|
|
205
|
+
type: Component,
|
|
206
|
+
args: [{
|
|
207
|
+
selector: 'ui-sheet-title, ui-drawer-title, h2[ui-sheet-title], h2[ui-drawer-title]',
|
|
208
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
209
|
+
host: { '[class]': 'classes()' },
|
|
210
|
+
template: `<ng-content />`,
|
|
211
|
+
}]
|
|
212
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
213
|
+
class SheetDescriptionComponent {
|
|
214
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
215
|
+
classes = computed(() => cn('text-sm text-muted-foreground', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
216
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetDescriptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
217
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: SheetDescriptionComponent, isStandalone: true, selector: "ui-sheet-description, ui-drawer-description, p[ui-sheet-description], p[ui-drawer-description]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
218
|
+
}
|
|
219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetDescriptionComponent, decorators: [{
|
|
220
|
+
type: Component,
|
|
221
|
+
args: [{
|
|
222
|
+
selector: 'ui-sheet-description, ui-drawer-description, p[ui-sheet-description], p[ui-drawer-description]',
|
|
223
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
224
|
+
host: { '[class]': 'classes()' },
|
|
225
|
+
template: `<ng-content />`,
|
|
226
|
+
}]
|
|
227
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
228
|
+
class SheetContentComponent {
|
|
229
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
230
|
+
classes = computed(() => cn('flex-1 overflow-auto', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
231
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
232
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: SheetContentComponent, isStandalone: true, selector: "ui-sheet-content, ui-drawer-content", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
233
|
+
}
|
|
234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetContentComponent, decorators: [{
|
|
235
|
+
type: Component,
|
|
236
|
+
args: [{
|
|
237
|
+
selector: 'ui-sheet-content, ui-drawer-content',
|
|
238
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
239
|
+
host: { '[class]': 'classes()' },
|
|
240
|
+
template: `<ng-content />`,
|
|
241
|
+
}]
|
|
242
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
243
|
+
class SheetFooterComponent {
|
|
244
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
245
|
+
classes = computed(() => cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
246
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
247
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: SheetFooterComponent, isStandalone: true, selector: "ui-sheet-footer, ui-drawer-footer", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
248
|
+
}
|
|
249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SheetFooterComponent, decorators: [{
|
|
250
|
+
type: Component,
|
|
251
|
+
args: [{
|
|
252
|
+
selector: 'ui-sheet-footer, ui-drawer-footer',
|
|
253
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
254
|
+
host: { '[class]': 'classes()' },
|
|
255
|
+
template: `<ng-content />`,
|
|
256
|
+
}]
|
|
257
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Generated bundle index. Do not edit.
|
|
261
|
+
*/
|
|
262
|
+
|
|
263
|
+
export { SheetCloseDirective, SheetComponent, SheetContentComponent, SheetDescriptionComponent, SheetFooterComponent, SheetHeaderComponent, SheetTitleComponent };
|
|
264
|
+
//# sourceMappingURL=edsis-ui-sheet.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edsis-ui-sheet.mjs","sources":["../../../library/ui/sheet/sheet.component.ts","../../../library/ui/sheet/sheet-close.directive.ts","../../../library/ui/sheet/sheet-parts.component.ts","../../../library/ui/sheet/edsis-ui-sheet.ts"],"sourcesContent":["import { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { FocusTrap, FocusTrapFactory } from '@angular/cdk/a11y';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n TemplateRef,\n ViewContainerRef,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { filter } from 'rxjs/operators';\nimport { ButtonComponent } from '@edsis/ui/button';\nimport { cn } from '@edsis/ui/utils';\n\nexport type SheetSide = 'top' | 'right' | 'bottom' | 'left';\n\nconst SIDE_BASE: Record<SheetSide, string> = {\n top: 'inset-x-0 top-0 border-b border-border',\n bottom: 'inset-x-0 bottom-0 border-t border-border',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r border-border sm:max-w-sm',\n right: 'inset-y-0 right-0 h-full w-3/4 border-l border-border sm:max-w-sm',\n};\n\nconst DRAWER_SIDE_CLASSES: Record<SheetSide, string> = {\n top: 'max-h-[85vh] rounded-b-lg',\n bottom: 'max-h-[85vh] rounded-t-lg',\n left: 'rounded-r-lg',\n right: 'rounded-l-lg',\n};\n\nconst SIDE_ENTER_FROM: Record<SheetSide, string> = {\n top: 'translateY(-100%)',\n bottom: 'translateY(100%)',\n left: 'translateX(-100%)',\n right: 'translateX(100%)',\n};\n\n@Component({\n selector: 'ui-sheet, ui-drawer',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ButtonComponent],\n template: `\n <ng-template #tpl>\n <div\n class=\"ui-sheet-surface fixed z-50 bg-background shadow-lg transition ease-in-out\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [class]=\"surfaceClasses()\"\n [style.--ui-sheet-from]=\"enterFrom()\">\n @if (showCloseButton()) {\n <button\n type=\"button\"\n ui-button\n variant=\"ghost\"\n size=\"icon-sm\"\n class=\"ui-sheet-close-button absolute right-4 top-4 h-8 w-8 rounded-md p-0 text-muted-foreground opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring\"\n [attr.aria-label]=\"closeButtonLabel()\"\n (click)=\"close()\">\n <span aria-hidden=\"true\">X</span>\n <span class=\"sr-only\">{{ closeButtonLabel() }}</span>\n </button>\n }\n <ng-content />\n </div>\n </ng-template>\n `,\n styles: [\n `\n .ui-sheet-surface {\n animation: ui-sheet-in 300ms cubic-bezier(0.2, 0, 0, 1);\n }\n @keyframes ui-sheet-in {\n from {\n transform: var(--ui-sheet-from);\n }\n to {\n transform: translate(0, 0);\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .ui-sheet-surface {\n animation-duration: 0ms;\n }\n }\n `,\n ],\n})\nexport class SheetComponent {\n private readonly overlay = inject(Overlay);\n private readonly vcr = inject(ViewContainerRef);\n private readonly trapFactory = inject(FocusTrapFactory);\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n private readonly host = inject(ElementRef<HTMLElement>);\n\n readonly open = model<boolean>(false);\n readonly side = input<SheetSide | undefined>(undefined);\n readonly closeOnEscape = input<boolean>(true);\n readonly closeOnBackdropClick = input<boolean>(true);\n readonly showCloseButton = input<boolean>(true);\n readonly closeButtonLabel = input<string>('Close');\n readonly labelledBy = input<string | null>(null, { alias: 'aria-labelledby' });\n readonly describedBy = input<string | null>(null, { alias: 'aria-describedby' });\n readonly class = input<string>('');\n\n readonly openedChange = output<boolean>();\n\n private readonly tpl = viewChild.required<TemplateRef<unknown>>('tpl');\n private overlayRef: OverlayRef | null = null;\n private focusTrap: FocusTrap | null = null;\n private previousFocus: HTMLElement | null = null;\n\n private readonly resolvedSide = computed<SheetSide>(() => this.side() ?? (this.isDrawerHost() ? 'bottom' : 'right'));\n\n protected readonly surfaceClasses = computed(() =>\n cn(\n 'gap-4 p-6 flex flex-col',\n SIDE_BASE[this.resolvedSide()],\n this.isDrawerHost() ? DRAWER_SIDE_CLASSES[this.resolvedSide()] : '',\n this.class(),\n ),\n );\n\n protected readonly enterFrom = computed(() => SIDE_ENTER_FROM[this.resolvedSide()]);\n\n constructor() {\n effect(() => {\n this.open() ? this.attach() : this.detach();\n });\n }\n\n private attach(): void {\n if (this.overlayRef) return;\n this.previousFocus = this.doc.activeElement as HTMLElement | null;\n\n this.overlayRef = this.overlay.create({\n hasBackdrop: true,\n backdropClass: 'ui-dialog-backdrop',\n panelClass: 'ui-sheet-panel',\n scrollStrategy: this.overlay.scrollStrategies.block(),\n positionStrategy: this.overlay.position().global(),\n });\n\n const portal = new TemplatePortal(this.tpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n this.focusTrap = this.trapFactory.create(this.overlayRef.hostElement);\n this.focusTrap.focusInitialElementWhenReady();\n\n if (this.closeOnBackdropClick()) {\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.open.set(false));\n }\n\n this.overlayRef\n .keydownEvents()\n .pipe(\n takeUntilDestroyed(this.destroyRef),\n filter((e) => e.key === 'Escape' && this.closeOnEscape()),\n )\n .subscribe((e) => {\n e.preventDefault();\n this.open.set(false);\n });\n\n this.openedChange.emit(true);\n }\n\n private detach(): void {\n if (!this.overlayRef) return;\n this.focusTrap?.destroy();\n this.focusTrap = null;\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.previousFocus?.focus?.();\n this.openedChange.emit(false);\n }\n\n close(): void {\n this.open.set(false);\n }\n\n private isDrawerHost(): boolean {\n return this.host.nativeElement.localName === 'ui-drawer';\n }\n}\n","import { Directive, inject } from '@angular/core';\n\nimport { SheetComponent } from './sheet.component';\n\n@Directive({\n selector: 'button[ui-sheet-close], a[ui-sheet-close], button[ui-drawer-close], a[ui-drawer-close]',\n host: {\n '(click)': 'closeSheet()',\n },\n})\nexport class SheetCloseDirective {\n private readonly sheet = inject(SheetComponent);\n\n closeSheet(): void {\n this.sheet.close();\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { cn } from '@edsis/ui/utils';\n\n@Component({\n selector: 'ui-sheet-header, ui-drawer-header',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class SheetHeaderComponent {\n readonly class = input<string>('');\n protected readonly classes = computed(() => cn('flex flex-col gap-2 text-center sm:text-left', this.class()));\n}\n\n@Component({\n selector: 'ui-sheet-title, ui-drawer-title, h2[ui-sheet-title], h2[ui-drawer-title]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class SheetTitleComponent {\n readonly class = input<string>('');\n protected readonly classes = computed(() => cn('text-lg font-semibold text-foreground', this.class()));\n}\n\n@Component({\n selector: 'ui-sheet-description, ui-drawer-description, p[ui-sheet-description], p[ui-drawer-description]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class SheetDescriptionComponent {\n readonly class = input<string>('');\n protected readonly classes = computed(() => cn('text-sm text-muted-foreground', this.class()));\n}\n\n@Component({\n selector: 'ui-sheet-content, ui-drawer-content',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class SheetContentComponent {\n readonly class = input<string>('');\n protected readonly classes = computed(() => cn('flex-1 overflow-auto', this.class()));\n}\n\n@Component({\n selector: 'ui-sheet-footer, ui-drawer-footer',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class SheetFooterComponent {\n readonly class = input<string>('');\n protected readonly classes = computed(() =>\n cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', this.class()),\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AA0BA,MAAM,SAAS,GAA8B;AAC3C,IAAA,GAAG,EAAE,wCAAwC;AAC7C,IAAA,MAAM,EAAE,2CAA2C;AACnD,IAAA,IAAI,EAAE,kEAAkE;AACxE,IAAA,KAAK,EAAE,mEAAmE;CAC3E;AAED,MAAM,mBAAmB,GAA8B;AACrD,IAAA,GAAG,EAAE,2BAA2B;AAChC,IAAA,MAAM,EAAE,2BAA2B;AACnC,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,KAAK,EAAE,cAAc;CACtB;AAED,MAAM,eAAe,GAA8B;AAC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1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { cn } from '@edsis/ui/utils';
|
|
4
|
+
|
|
5
|
+
class SkeletonComponent {
|
|
6
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
7
|
+
classes = computed(() => cn('block animate-pulse rounded-md bg-muted', this.class()), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
8
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.14", type: SkeletonComponent, isStandalone: true, selector: "ui-skeleton", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.aria-hidden": "\"true\"" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10
|
+
}
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SkeletonComponent, decorators: [{
|
|
12
|
+
type: Component,
|
|
13
|
+
args: [{
|
|
14
|
+
selector: 'ui-skeleton',
|
|
15
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
|
+
host: {
|
|
17
|
+
'[class]': 'classes()',
|
|
18
|
+
'[attr.aria-hidden]': '"true"',
|
|
19
|
+
},
|
|
20
|
+
template: '',
|
|
21
|
+
}]
|
|
22
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Generated bundle index. Do not edit.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
export { SkeletonComponent };
|
|
29
|
+
//# sourceMappingURL=edsis-ui-skeleton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edsis-ui-skeleton.mjs","sources":["../../../library/ui/skeleton/skeleton.component.ts","../../../library/ui/skeleton/edsis-ui-skeleton.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { cn } from '@edsis/ui/utils';\n\n@Component({\n selector: 'ui-skeleton',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.aria-hidden]': '\"true\"',\n },\n template: '',\n})\nexport class SkeletonComponent {\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn('block animate-pulse rounded-md bg-muted', this.class()));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAYa,iBAAiB,CAAA;AACnB,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AAEf,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,yCAAyC,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,8EAAC;wGAH7F,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,2RAFlB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAED,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAT7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;oBACvB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,oBAAoB,EAAE,QAAQ;AAC/B,qBAAA;AACD,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;;ACXD;;AAEG;;;;"}
|