@ojiepermana/angular-component 22.0.27
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 +82 -0
- package/accordion/README.md +193 -0
- package/alert/README.md +180 -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 +208 -0
- package/calendar/README.md +135 -0
- package/card/README.md +220 -0
- package/carousel/README.md +276 -0
- package/checkbox/README.md +149 -0
- package/collapsible/README.md +195 -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 +179 -0
- package/dialog/README.md +235 -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/ojiepermana-angular-component-accordion.mjs +186 -0
- package/fesm2022/ojiepermana-angular-component-accordion.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +276 -0
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-alert.mjs +99 -0
- package/fesm2022/ojiepermana-angular-component-alert.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +37 -0
- package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-avatar.mjs +139 -0
- package/fesm2022/ojiepermana-angular-component-avatar.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-badge.mjs +50 -0
- package/fesm2022/ojiepermana-angular-component-badge.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +200 -0
- package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-button-group.mjs +103 -0
- package/fesm2022/ojiepermana-angular-component-button-group.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-button.mjs +68 -0
- package/fesm2022/ojiepermana-angular-component-button.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-calendar.mjs +103 -0
- package/fesm2022/ojiepermana-angular-component-calendar.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-card.mjs +152 -0
- package/fesm2022/ojiepermana-angular-component-card.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-carousel.mjs +334 -0
- package/fesm2022/ojiepermana-angular-component-carousel.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-checkbox.mjs +165 -0
- package/fesm2022/ojiepermana-angular-component-checkbox.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-collapsible.mjs +121 -0
- package/fesm2022/ojiepermana-angular-component-collapsible.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-combobox.mjs +274 -0
- package/fesm2022/ojiepermana-angular-component-combobox.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-command.mjs +297 -0
- package/fesm2022/ojiepermana-angular-component-command.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-composer.mjs +352 -0
- package/fesm2022/ojiepermana-angular-component-composer.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-context-menu.mjs +108 -0
- package/fesm2022/ojiepermana-angular-component-context-menu.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-date-picker.mjs +186 -0
- package/fesm2022/ojiepermana-angular-component-date-picker.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-dialog.mjs +283 -0
- package/fesm2022/ojiepermana-angular-component-dialog.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-drawer.mjs +6 -0
- package/fesm2022/ojiepermana-angular-component-drawer.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +494 -0
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-editor.mjs +680 -0
- package/fesm2022/ojiepermana-angular-component-editor.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-empty.mjs +145 -0
- package/fesm2022/ojiepermana-angular-component-empty.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-form.mjs +364 -0
- package/fesm2022/ojiepermana-angular-component-form.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-hover-card.mjs +275 -0
- package/fesm2022/ojiepermana-angular-component-hover-card.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-icon.mjs +86 -0
- package/fesm2022/ojiepermana-angular-component-icon.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-input-group.mjs +179 -0
- package/fesm2022/ojiepermana-angular-component-input-group.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-input-otp.mjs +517 -0
- package/fesm2022/ojiepermana-angular-component-input-otp.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-input.mjs +45 -0
- package/fesm2022/ojiepermana-angular-component-input.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-item.mjs +264 -0
- package/fesm2022/ojiepermana-angular-component-item.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-kanban.mjs +314 -0
- package/fesm2022/ojiepermana-angular-component-kanban.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-kbd.mjs +55 -0
- package/fesm2022/ojiepermana-angular-component-kbd.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-label.mjs +33 -0
- package/fesm2022/ojiepermana-angular-component-label.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-menubar.mjs +311 -0
- package/fesm2022/ojiepermana-angular-component-menubar.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-native-select.mjs +67 -0
- package/fesm2022/ojiepermana-angular-component-native-select.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +408 -0
- package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-pagination.mjs +226 -0
- package/fesm2022/ojiepermana-angular-component-pagination.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-pillbox.mjs +810 -0
- package/fesm2022/ojiepermana-angular-component-pillbox.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-popover.mjs +145 -0
- package/fesm2022/ojiepermana-angular-component-popover.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-progress.mjs +60 -0
- package/fesm2022/ojiepermana-angular-component-progress.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-radio.mjs +173 -0
- package/fesm2022/ojiepermana-angular-component-radio.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-resizable.mjs +478 -0
- package/fesm2022/ojiepermana-angular-component-resizable.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +54 -0
- package/fesm2022/ojiepermana-angular-component-scroll-area.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-select.mjs +297 -0
- package/fesm2022/ojiepermana-angular-component-select.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-separator.mjs +37 -0
- package/fesm2022/ojiepermana-angular-component-separator.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-sheet.mjs +297 -0
- package/fesm2022/ojiepermana-angular-component-sheet.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-skeleton.mjs +31 -0
- package/fesm2022/ojiepermana-angular-component-skeleton.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-slider.mjs +423 -0
- package/fesm2022/ojiepermana-angular-component-slider.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-spinner.mjs +60 -0
- package/fesm2022/ojiepermana-angular-component-spinner.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-switch.mjs +140 -0
- package/fesm2022/ojiepermana-angular-component-switch.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-table.mjs +155 -0
- package/fesm2022/ojiepermana-angular-component-table.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-tabs.mjs +271 -0
- package/fesm2022/ojiepermana-angular-component-tabs.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-textarea.mjs +39 -0
- package/fesm2022/ojiepermana-angular-component-textarea.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-timeline.mjs +237 -0
- package/fesm2022/ojiepermana-angular-component-timeline.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-toast.mjs +161 -0
- package/fesm2022/ojiepermana-angular-component-toast.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +289 -0
- package/fesm2022/ojiepermana-angular-component-toggle-group.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-toggle.mjs +82 -0
- package/fesm2022/ojiepermana-angular-component-toggle.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs +410 -0
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component-utils.mjs +81 -0
- package/fesm2022/ojiepermana-angular-component-utils.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-component.mjs +11 -0
- package/fesm2022/ojiepermana-angular-component.mjs.map +1 -0
- package/form/README.md +210 -0
- package/hover-card/README.md +142 -0
- package/icon/README.md +25 -0
- package/input/README.md +159 -0
- package/input-group/README.md +237 -0
- package/input-otp/README.md +278 -0
- package/item/README.md +247 -0
- package/kanban/README.md +81 -0
- package/kbd/README.md +139 -0
- package/label/README.md +135 -0
- package/menubar/README.md +269 -0
- package/native-select/README.md +176 -0
- package/navigation-menu/README.md +160 -0
- package/package.json +291 -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 +168 -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 +153 -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 +207 -0
- package/types/ojiepermana-angular-component-accordion.d.ts +51 -0
- package/types/ojiepermana-angular-component-alert-dialog.d.ts +93 -0
- package/types/ojiepermana-angular-component-alert.d.ts +37 -0
- package/types/ojiepermana-angular-component-aspect-ratio.d.ts +12 -0
- package/types/ojiepermana-angular-component-avatar.d.ts +51 -0
- package/types/ojiepermana-angular-component-badge.d.ts +19 -0
- package/types/ojiepermana-angular-component-breadcrumb.d.ts +46 -0
- package/types/ojiepermana-angular-component-button-group.d.ts +26 -0
- package/types/ojiepermana-angular-component-button.d.ts +22 -0
- package/types/ojiepermana-angular-component-calendar.d.ts +39 -0
- package/types/ojiepermana-angular-component-card.d.ts +60 -0
- package/types/ojiepermana-angular-component-carousel.d.ts +86 -0
- package/types/ojiepermana-angular-component-checkbox.d.ts +42 -0
- package/types/ojiepermana-angular-component-collapsible.d.ts +42 -0
- package/types/ojiepermana-angular-component-combobox.d.ts +53 -0
- package/types/ojiepermana-angular-component-command.d.ts +102 -0
- package/types/ojiepermana-angular-component-composer.d.ts +90 -0
- package/types/ojiepermana-angular-component-context-menu.d.ts +36 -0
- package/types/ojiepermana-angular-component-date-picker.d.ts +48 -0
- package/types/ojiepermana-angular-component-dialog.d.ts +87 -0
- package/types/ojiepermana-angular-component-drawer.d.ts +1 -0
- package/types/ojiepermana-angular-component-dropdown-menu.d.ts +140 -0
- package/types/ojiepermana-angular-component-editor.d.ts +126 -0
- package/types/ojiepermana-angular-component-empty.d.ts +50 -0
- package/types/ojiepermana-angular-component-form.d.ts +140 -0
- package/types/ojiepermana-angular-component-hover-card.d.ts +75 -0
- package/types/ojiepermana-angular-component-icon.d.ts +31 -0
- package/types/ojiepermana-angular-component-input-group.d.ts +51 -0
- package/types/ojiepermana-angular-component-input-otp.d.ts +142 -0
- package/types/ojiepermana-angular-component-input.d.ts +16 -0
- package/types/ojiepermana-angular-component-item.d.ts +88 -0
- package/types/ojiepermana-angular-component-kanban.d.ts +70 -0
- package/types/ojiepermana-angular-component-kbd.d.ts +16 -0
- package/types/ojiepermana-angular-component-label.d.ts +11 -0
- package/types/ojiepermana-angular-component-menubar.d.ts +69 -0
- package/types/ojiepermana-angular-component-native-select.d.ts +26 -0
- package/types/ojiepermana-angular-component-navigation-menu.d.ts +98 -0
- package/types/ojiepermana-angular-component-pagination.d.ts +33 -0
- package/types/ojiepermana-angular-component-pillbox.d.ts +156 -0
- package/types/ojiepermana-angular-component-popover.d.ts +50 -0
- package/types/ojiepermana-angular-component-progress.d.ts +17 -0
- package/types/ojiepermana-angular-component-radio.d.ts +57 -0
- package/types/ojiepermana-angular-component-resizable.d.ts +99 -0
- package/types/ojiepermana-angular-component-scroll-area.d.ts +19 -0
- package/types/ojiepermana-angular-component-select.d.ts +56 -0
- package/types/ojiepermana-angular-component-separator.d.ts +14 -0
- package/types/ojiepermana-angular-component-sheet.d.ts +78 -0
- package/types/ojiepermana-angular-component-skeleton.d.ts +10 -0
- package/types/ojiepermana-angular-component-slider.d.ts +74 -0
- package/types/ojiepermana-angular-component-spinner.d.ts +13 -0
- package/types/ojiepermana-angular-component-switch.d.ts +44 -0
- package/types/ojiepermana-angular-component-table.d.ts +52 -0
- package/types/ojiepermana-angular-component-tabs.d.ts +92 -0
- package/types/ojiepermana-angular-component-textarea.d.ts +12 -0
- package/types/ojiepermana-angular-component-timeline.d.ts +63 -0
- package/types/ojiepermana-angular-component-toast.d.ts +51 -0
- package/types/ojiepermana-angular-component-toggle-group.d.ts +89 -0
- package/types/ojiepermana-angular-component-toggle.d.ts +25 -0
- package/types/ojiepermana-angular-component-tooltip.d.ts +101 -0
- package/types/ojiepermana-angular-component-utils.d.ts +30 -0
- package/types/ojiepermana-angular-component.d.ts +2 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { model, input, output, signal, computed, ChangeDetectionStrategy, Component, inject, effect, ElementRef } from '@angular/core';
|
|
3
|
+
import { cn } from '@ojiepermana/angular-component/utils';
|
|
4
|
+
import { DialogComponent } from '@ojiepermana/angular-component/dialog';
|
|
5
|
+
import { buttonVariants } from '@ojiepermana/angular-component/button';
|
|
6
|
+
|
|
7
|
+
const ALERT_DIALOG_SIZE_CLASSES = {
|
|
8
|
+
default: 'sm:max-w-lg',
|
|
9
|
+
sm: 'sm:max-w-sm',
|
|
10
|
+
};
|
|
11
|
+
class AlertDialogComponent {
|
|
12
|
+
open = model(false, /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
14
|
+
closeOnEscape = input(true, /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "closeOnEscape" }] : /* istanbul ignore next */ []));
|
|
16
|
+
closeOnBackdropClick = input(false, /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "closeOnBackdropClick" }] : /* istanbul ignore next */ []));
|
|
18
|
+
showCloseButton = input(false, /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "showCloseButton" }] : /* istanbul ignore next */ []));
|
|
20
|
+
closeButtonLabel = input('Close', /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "closeButtonLabel" }] : /* istanbul ignore next */ []));
|
|
22
|
+
labelledBy = input(null, { ...(ngDevMode ? { debugName: "labelledBy" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
23
|
+
describedBy = input(null, { ...(ngDevMode ? { debugName: "describedBy" } : /* istanbul ignore next */ {}), alias: 'aria-describedby' });
|
|
24
|
+
class = input('', /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
26
|
+
openedChange = output();
|
|
27
|
+
contentSize = signal('default', /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "contentSize" }] : /* istanbul ignore next */ []));
|
|
29
|
+
resolvedSize = computed(() => this.contentSize(), /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "resolvedSize" }] : /* istanbul ignore next */ []));
|
|
31
|
+
surfaceClasses = computed(() => cn(ALERT_DIALOG_SIZE_CLASSES[this.resolvedSize()], this.class()), /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "surfaceClasses" }] : /* istanbul ignore next */ []));
|
|
33
|
+
setContentSize(size) {
|
|
34
|
+
this.contentSize.set(size);
|
|
35
|
+
}
|
|
36
|
+
close() {
|
|
37
|
+
this.open.set(false);
|
|
38
|
+
}
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
40
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertDialogComponent, isStandalone: true, selector: "AlertDialog", inputs: { open: { classPropertyName: "open", publicName: "open", 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" }, ngImport: i0, template: `
|
|
41
|
+
<Dialog
|
|
42
|
+
[(open)]="open"
|
|
43
|
+
[closeOnEscape]="closeOnEscape()"
|
|
44
|
+
[closeOnBackdropClick]="closeOnBackdropClick()"
|
|
45
|
+
[showCloseButton]="showCloseButton()"
|
|
46
|
+
[closeButtonLabel]="closeButtonLabel()"
|
|
47
|
+
[aria-labelledby]="labelledBy()"
|
|
48
|
+
[aria-describedby]="describedBy()"
|
|
49
|
+
[class]="surfaceClasses()"
|
|
50
|
+
(openedChange)="openedChange.emit($event)">
|
|
51
|
+
<ng-content />
|
|
52
|
+
</Dialog>
|
|
53
|
+
`, isInline: true, dependencies: [{ kind: "component", type: DialogComponent, selector: "Dialog", inputs: ["open", "closeOnEscape", "closeOnBackdropClick", "showCloseButton", "closeButtonLabel", "aria-labelledby", "aria-describedby", "class"], outputs: ["openChange", "openedChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
54
|
+
}
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogComponent, decorators: [{
|
|
56
|
+
type: Component,
|
|
57
|
+
args: [{
|
|
58
|
+
selector: 'AlertDialog',
|
|
59
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
60
|
+
imports: [DialogComponent],
|
|
61
|
+
template: `
|
|
62
|
+
<Dialog
|
|
63
|
+
[(open)]="open"
|
|
64
|
+
[closeOnEscape]="closeOnEscape()"
|
|
65
|
+
[closeOnBackdropClick]="closeOnBackdropClick()"
|
|
66
|
+
[showCloseButton]="showCloseButton()"
|
|
67
|
+
[closeButtonLabel]="closeButtonLabel()"
|
|
68
|
+
[aria-labelledby]="labelledBy()"
|
|
69
|
+
[aria-describedby]="describedBy()"
|
|
70
|
+
[class]="surfaceClasses()"
|
|
71
|
+
(openedChange)="openedChange.emit($event)">
|
|
72
|
+
<ng-content />
|
|
73
|
+
</Dialog>
|
|
74
|
+
`,
|
|
75
|
+
}]
|
|
76
|
+
}], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], 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"] }] } });
|
|
77
|
+
|
|
78
|
+
const ALERT_DIALOG_MEDIA_SIZE_CLASSES = {
|
|
79
|
+
default: 'h-12 w-12 [&_svg]:h-5 [&_svg]:w-5',
|
|
80
|
+
sm: 'h-10 w-10 [&_svg]:h-4.5 [&_svg]:w-4.5',
|
|
81
|
+
};
|
|
82
|
+
class AlertDialogContentComponent {
|
|
83
|
+
size = input('default', /* @ts-ignore */
|
|
84
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
85
|
+
class = input('', /* @ts-ignore */
|
|
86
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
87
|
+
alertDialog = inject(AlertDialogComponent, { optional: true });
|
|
88
|
+
classes = computed(() => cn('grid gap-4', this.class()), /* @ts-ignore */
|
|
89
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
90
|
+
constructor() {
|
|
91
|
+
effect(() => this.alertDialog?.setContentSize(this.size()));
|
|
92
|
+
}
|
|
93
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
94
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertDialogContentComponent, isStandalone: true, selector: "AlertDialogContent", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.data-size": "size()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
95
|
+
}
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogContentComponent, decorators: [{
|
|
97
|
+
type: Component,
|
|
98
|
+
args: [{
|
|
99
|
+
selector: 'AlertDialogContent',
|
|
100
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
101
|
+
host: {
|
|
102
|
+
'[class]': 'classes()',
|
|
103
|
+
'[attr.data-size]': 'size()',
|
|
104
|
+
},
|
|
105
|
+
template: `<ng-content />`,
|
|
106
|
+
}]
|
|
107
|
+
}], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
108
|
+
class AlertDialogHeaderComponent {
|
|
109
|
+
class = input('', /* @ts-ignore */
|
|
110
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
111
|
+
classes = computed(() => cn('flex flex-col gap-2 text-center sm:text-left', this.class()), /* @ts-ignore */
|
|
112
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
113
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
114
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertDialogHeaderComponent, isStandalone: true, selector: "AlertDialogHeader", 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 });
|
|
115
|
+
}
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogHeaderComponent, decorators: [{
|
|
117
|
+
type: Component,
|
|
118
|
+
args: [{
|
|
119
|
+
selector: 'AlertDialogHeader',
|
|
120
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
121
|
+
host: { '[class]': 'classes()' },
|
|
122
|
+
template: `<ng-content />`,
|
|
123
|
+
}]
|
|
124
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
125
|
+
class AlertDialogTitleComponent {
|
|
126
|
+
class = input('', /* @ts-ignore */
|
|
127
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
128
|
+
classes = computed(() => cn('text-lg font-semibold leading-none tracking-tight', this.class()), /* @ts-ignore */
|
|
129
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
130
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
131
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertDialogTitleComponent, isStandalone: true, selector: "AlertDialogTitle, h2[AlertDialogTitle]", 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 });
|
|
132
|
+
}
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogTitleComponent, decorators: [{
|
|
134
|
+
type: Component,
|
|
135
|
+
args: [{
|
|
136
|
+
selector: 'AlertDialogTitle, h2[AlertDialogTitle]',
|
|
137
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
138
|
+
host: { '[class]': 'classes()' },
|
|
139
|
+
template: `<ng-content />`,
|
|
140
|
+
}]
|
|
141
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
142
|
+
class AlertDialogDescriptionComponent {
|
|
143
|
+
class = input('', /* @ts-ignore */
|
|
144
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
145
|
+
classes = computed(() => cn('text-sm leading-6 text-muted-foreground', this.class()), /* @ts-ignore */
|
|
146
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
147
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogDescriptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
148
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertDialogDescriptionComponent, isStandalone: true, selector: "AlertDialogDescription, p[AlertDialogDescription]", 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 });
|
|
149
|
+
}
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogDescriptionComponent, decorators: [{
|
|
151
|
+
type: Component,
|
|
152
|
+
args: [{
|
|
153
|
+
selector: 'AlertDialogDescription, p[AlertDialogDescription]',
|
|
154
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
155
|
+
host: { '[class]': 'classes()' },
|
|
156
|
+
template: `<ng-content />`,
|
|
157
|
+
}]
|
|
158
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
159
|
+
class AlertDialogMediaComponent {
|
|
160
|
+
class = input('', /* @ts-ignore */
|
|
161
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
162
|
+
alertDialog = inject(AlertDialogComponent, { optional: true });
|
|
163
|
+
classes = computed(() => cn('mx-auto flex shrink-0 items-center justify-center rounded-full border border-border bg-muted/60 text-foreground sm:mx-0', ALERT_DIALOG_MEDIA_SIZE_CLASSES[this.alertDialog?.resolvedSize() ?? 'default'], this.class()), /* @ts-ignore */
|
|
164
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
165
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogMediaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
166
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertDialogMediaComponent, isStandalone: true, selector: "AlertDialogMedia", 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 });
|
|
167
|
+
}
|
|
168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogMediaComponent, decorators: [{
|
|
169
|
+
type: Component,
|
|
170
|
+
args: [{
|
|
171
|
+
selector: 'AlertDialogMedia',
|
|
172
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
173
|
+
host: { '[class]': 'classes()' },
|
|
174
|
+
template: `<ng-content />`,
|
|
175
|
+
}]
|
|
176
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
177
|
+
class AlertDialogFooterComponent {
|
|
178
|
+
class = input('', /* @ts-ignore */
|
|
179
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
180
|
+
classes = computed(() => cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:gap-2', this.class()), /* @ts-ignore */
|
|
181
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
182
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
183
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertDialogFooterComponent, isStandalone: true, selector: "AlertDialogFooter", 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 });
|
|
184
|
+
}
|
|
185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogFooterComponent, decorators: [{
|
|
186
|
+
type: Component,
|
|
187
|
+
args: [{
|
|
188
|
+
selector: 'AlertDialogFooter',
|
|
189
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
190
|
+
host: { '[class]': 'classes()' },
|
|
191
|
+
template: `<ng-content />`,
|
|
192
|
+
}]
|
|
193
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
194
|
+
class AlertDialogCancelComponent {
|
|
195
|
+
variant = input('outline', /* @ts-ignore */
|
|
196
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
197
|
+
size = input('default', /* @ts-ignore */
|
|
198
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
199
|
+
closeOnClick = input(true, /* @ts-ignore */
|
|
200
|
+
...(ngDevMode ? [{ debugName: "closeOnClick" }] : /* istanbul ignore next */ []));
|
|
201
|
+
class = input('', /* @ts-ignore */
|
|
202
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
203
|
+
host = inject(ElementRef);
|
|
204
|
+
alertDialog = inject(AlertDialogComponent, { optional: true });
|
|
205
|
+
classes = computed(() => cn(buttonVariants({ variant: this.variant(), size: this.size() }), this.class()), /* @ts-ignore */
|
|
206
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
207
|
+
buttonType = computed(() => this.host.nativeElement.tagName.toLowerCase() === 'button' ? 'button' : null, /* @ts-ignore */
|
|
208
|
+
...(ngDevMode ? [{ debugName: "buttonType" }] : /* istanbul ignore next */ []));
|
|
209
|
+
handleClick() {
|
|
210
|
+
if (this.closeOnClick()) {
|
|
211
|
+
this.alertDialog?.close();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogCancelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
215
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertDialogCancelComponent, isStandalone: true, selector: "button[AlertDialogCancel], a[AlertDialogCancel]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closeOnClick: { classPropertyName: "closeOnClick", publicName: "closeOnClick", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "handleClick()" }, properties: { "class": "classes()", "attr.data-size": "size()", "attr.data-variant": "variant()", "attr.type": "buttonType()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
216
|
+
}
|
|
217
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogCancelComponent, decorators: [{
|
|
218
|
+
type: Component,
|
|
219
|
+
args: [{
|
|
220
|
+
selector: 'button[AlertDialogCancel], a[AlertDialogCancel]',
|
|
221
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
222
|
+
host: {
|
|
223
|
+
'[class]': 'classes()',
|
|
224
|
+
'[attr.data-size]': 'size()',
|
|
225
|
+
'[attr.data-variant]': 'variant()',
|
|
226
|
+
'[attr.type]': 'buttonType()',
|
|
227
|
+
'(click)': 'handleClick()',
|
|
228
|
+
},
|
|
229
|
+
template: `<ng-content />`,
|
|
230
|
+
}]
|
|
231
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closeOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnClick", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
232
|
+
class AlertDialogActionComponent {
|
|
233
|
+
variant = input('default', /* @ts-ignore */
|
|
234
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
235
|
+
size = input('default', /* @ts-ignore */
|
|
236
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
237
|
+
closeOnClick = input(true, /* @ts-ignore */
|
|
238
|
+
...(ngDevMode ? [{ debugName: "closeOnClick" }] : /* istanbul ignore next */ []));
|
|
239
|
+
class = input('', /* @ts-ignore */
|
|
240
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
241
|
+
host = inject(ElementRef);
|
|
242
|
+
alertDialog = inject(AlertDialogComponent, { optional: true });
|
|
243
|
+
classes = computed(() => cn(buttonVariants({ variant: this.variant(), size: this.size() }), this.class()), /* @ts-ignore */
|
|
244
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
245
|
+
buttonType = computed(() => this.host.nativeElement.tagName.toLowerCase() === 'button' ? 'button' : null, /* @ts-ignore */
|
|
246
|
+
...(ngDevMode ? [{ debugName: "buttonType" }] : /* istanbul ignore next */ []));
|
|
247
|
+
handleClick() {
|
|
248
|
+
if (this.closeOnClick()) {
|
|
249
|
+
this.alertDialog?.close();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
253
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertDialogActionComponent, isStandalone: true, selector: "button[AlertDialogAction], a[AlertDialogAction]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closeOnClick: { classPropertyName: "closeOnClick", publicName: "closeOnClick", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "handleClick()" }, properties: { "class": "classes()", "attr.data-size": "size()", "attr.data-variant": "variant()", "attr.type": "buttonType()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
254
|
+
}
|
|
255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDialogActionComponent, decorators: [{
|
|
256
|
+
type: Component,
|
|
257
|
+
args: [{
|
|
258
|
+
selector: 'button[AlertDialogAction], a[AlertDialogAction]',
|
|
259
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
260
|
+
host: {
|
|
261
|
+
'[class]': 'classes()',
|
|
262
|
+
'[attr.data-size]': 'size()',
|
|
263
|
+
'[attr.data-variant]': 'variant()',
|
|
264
|
+
'[attr.type]': 'buttonType()',
|
|
265
|
+
'(click)': 'handleClick()',
|
|
266
|
+
},
|
|
267
|
+
template: `<ng-content />`,
|
|
268
|
+
}]
|
|
269
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closeOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnClick", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Generated bundle index. Do not edit.
|
|
273
|
+
*/
|
|
274
|
+
|
|
275
|
+
export { AlertDialogActionComponent, AlertDialogCancelComponent, AlertDialogComponent, AlertDialogContentComponent, AlertDialogDescriptionComponent, AlertDialogFooterComponent, AlertDialogHeaderComponent, AlertDialogMediaComponent, AlertDialogTitleComponent };
|
|
276
|
+
//# sourceMappingURL=ojiepermana-angular-component-alert-dialog.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ojiepermana-angular-component-alert-dialog.mjs","sources":["../../../library/component/alert-dialog/alert-dialog.component.ts","../../../library/component/alert-dialog/alert-dialog-parts.component.ts","../../../library/component/alert-dialog/ojiepermana-angular-component-alert-dialog.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, model, output, signal } from '@angular/core';\n\nimport { cn } from '@ojiepermana/angular-component/utils';\nimport { DialogComponent } from '@ojiepermana/angular-component/dialog';\nimport type { AlertDialogSize } from './alert-dialog.types';\n\nconst ALERT_DIALOG_SIZE_CLASSES: Record<AlertDialogSize, string> = {\n default: 'sm:max-w-lg',\n sm: 'sm:max-w-sm',\n};\n\n@Component({\n selector: 'AlertDialog',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [DialogComponent],\n template: `\n <Dialog\n [(open)]=\"open\"\n [closeOnEscape]=\"closeOnEscape()\"\n [closeOnBackdropClick]=\"closeOnBackdropClick()\"\n [showCloseButton]=\"showCloseButton()\"\n [closeButtonLabel]=\"closeButtonLabel()\"\n [aria-labelledby]=\"labelledBy()\"\n [aria-describedby]=\"describedBy()\"\n [class]=\"surfaceClasses()\"\n (openedChange)=\"openedChange.emit($event)\">\n <ng-content />\n </Dialog>\n `,\n})\nexport class AlertDialogComponent {\n readonly open = model<boolean>(false);\n readonly closeOnEscape = input<boolean>(true);\n readonly closeOnBackdropClick = input<boolean>(false);\n readonly showCloseButton = input<boolean>(false);\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 contentSize = signal<AlertDialogSize>('default');\n\n readonly resolvedSize = computed<AlertDialogSize>(() => this.contentSize());\n protected readonly surfaceClasses = computed(() => cn(ALERT_DIALOG_SIZE_CLASSES[this.resolvedSize()], this.class()));\n\n setContentSize(size: AlertDialogSize): void {\n this.contentSize.set(size);\n }\n\n close(): void {\n this.open.set(false);\n }\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, computed, effect, inject, input } from '@angular/core';\n\nimport { cn } from '@ojiepermana/angular-component/utils';\nimport { buttonVariants, type ButtonSize, type ButtonVariant } from '@ojiepermana/angular-component/button';\nimport { AlertDialogComponent } from './alert-dialog.component';\nimport type { AlertDialogSize } from './alert-dialog.types';\n\nconst ALERT_DIALOG_MEDIA_SIZE_CLASSES: Record<AlertDialogSize, string> = {\n default: 'h-12 w-12 [&_svg]:h-5 [&_svg]:w-5',\n sm: 'h-10 w-10 [&_svg]:h-4.5 [&_svg]:w-4.5',\n};\n\n@Component({\n selector: 'AlertDialogContent',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.data-size]': 'size()',\n },\n template: `<ng-content />`,\n})\nexport class AlertDialogContentComponent {\n readonly size = input<AlertDialogSize>('default');\n readonly class = input<string>('');\n\n private readonly alertDialog = inject(AlertDialogComponent, { optional: true });\n\n protected readonly classes = computed(() => cn('grid gap-4', this.class()));\n\n constructor() {\n effect(() => this.alertDialog?.setContentSize(this.size()));\n }\n}\n\n@Component({\n selector: 'AlertDialogHeader',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class AlertDialogHeaderComponent {\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: 'AlertDialogTitle, h2[AlertDialogTitle]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class AlertDialogTitleComponent {\n readonly class = input<string>('');\n protected readonly classes = computed(() => cn('text-lg font-semibold leading-none tracking-tight', this.class()));\n}\n\n@Component({\n selector: 'AlertDialogDescription, p[AlertDialogDescription]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class AlertDialogDescriptionComponent {\n readonly class = input<string>('');\n protected readonly classes = computed(() => cn('text-sm leading-6 text-muted-foreground', this.class()));\n}\n\n@Component({\n selector: 'AlertDialogMedia',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class AlertDialogMediaComponent {\n readonly class = input<string>('');\n\n private readonly alertDialog = inject(AlertDialogComponent, { optional: true });\n\n protected readonly classes = computed(() =>\n cn(\n 'mx-auto flex shrink-0 items-center justify-center rounded-full border border-border bg-muted/60 text-foreground sm:mx-0',\n ALERT_DIALOG_MEDIA_SIZE_CLASSES[this.alertDialog?.resolvedSize() ?? 'default'],\n this.class(),\n ),\n );\n}\n\n@Component({\n selector: 'AlertDialogFooter',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class AlertDialogFooterComponent {\n readonly class = input<string>('');\n protected readonly classes = computed(() =>\n cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:gap-2', this.class()),\n );\n}\n\n@Component({\n selector: 'button[AlertDialogCancel], a[AlertDialogCancel]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.data-size]': 'size()',\n '[attr.data-variant]': 'variant()',\n '[attr.type]': 'buttonType()',\n '(click)': 'handleClick()',\n },\n template: `<ng-content />`,\n})\nexport class AlertDialogCancelComponent {\n readonly variant = input<ButtonVariant>('outline');\n readonly size = input<ButtonSize>('default');\n readonly closeOnClick = input<boolean>(true);\n readonly class = input<string>('');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly alertDialog = inject(AlertDialogComponent, { optional: true });\n\n protected readonly classes = computed(() =>\n cn(buttonVariants({ variant: this.variant(), size: this.size() }), this.class()),\n );\n protected readonly buttonType = computed(() =>\n this.host.nativeElement.tagName.toLowerCase() === 'button' ? 'button' : null,\n );\n\n protected handleClick(): void {\n if (this.closeOnClick()) {\n this.alertDialog?.close();\n }\n }\n}\n\n@Component({\n selector: 'button[AlertDialogAction], a[AlertDialogAction]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.data-size]': 'size()',\n '[attr.data-variant]': 'variant()',\n '[attr.type]': 'buttonType()',\n '(click)': 'handleClick()',\n },\n template: `<ng-content />`,\n})\nexport class AlertDialogActionComponent {\n readonly variant = input<ButtonVariant>('default');\n readonly size = input<ButtonSize>('default');\n readonly closeOnClick = input<boolean>(true);\n readonly class = input<string>('');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly alertDialog = inject(AlertDialogComponent, { optional: true });\n\n protected readonly classes = computed(() =>\n cn(buttonVariants({ variant: this.variant(), size: this.size() }), this.class()),\n );\n protected readonly buttonType = computed(() =>\n this.host.nativeElement.tagName.toLowerCase() === 'button' ? 'button' : null,\n );\n\n protected handleClick(): void {\n if (this.closeOnClick()) {\n this.alertDialog?.close();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAMA,MAAM,yBAAyB,GAAoC;AACjE,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,EAAE,EAAE,aAAa;CAClB;MAqBY,oBAAoB,CAAA;IACtB,IAAI,GAAG,KAAK,CAAU,KAAK;6EAAC;IAC5B,aAAa,GAAG,KAAK,CAAU,IAAI;sFAAC;IACpC,oBAAoB,GAAG,KAAK,CAAU,KAAK;6FAAC;IAC5C,eAAe,GAAG,KAAK,CAAU,KAAK;wFAAC;IACvC,gBAAgB,GAAG,KAAK,CAAS,OAAO;yFAAC;IACzC,UAAU,GAAG,KAAK,CAAgB,IAAI,kFAAI,KAAK,EAAE,iBAAiB,EAAA,CAAG;IACrE,WAAW,GAAG,KAAK,CAAgB,IAAI,mFAAI,KAAK,EAAE,kBAAkB,EAAA,CAAG;IACvE,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;IAEzB,YAAY,GAAG,MAAM,EAAW;IAExB,WAAW,GAAG,MAAM,CAAkB,SAAS;oFAAC;IAExD,YAAY,GAAG,QAAQ,CAAkB,MAAM,IAAI,CAAC,WAAW,EAAE;qFAAC;IACxD,cAAc,GAAG,QAAQ,CAAC,MAAM,EAAE,C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|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { cn } from '@ojiepermana/angular-component/utils';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
const alertVariants = cva([
|
|
7
|
+
'relative block w-full rounded-lg border p-4 [&:has(AlertAction)]:pr-20',
|
|
8
|
+
'[&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px]',
|
|
9
|
+
'[&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground',
|
|
10
|
+
].join(' '), {
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default: 'bg-background text-foreground',
|
|
14
|
+
destructive: 'border-destructive/50 text-destructive [&>svg]:text-destructive dark:border-destructive',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: { variant: 'default' },
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
class AlertComponent {
|
|
21
|
+
variant = input('default', /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
23
|
+
class = input('', /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
25
|
+
classes = computed(() => cn(alertVariants({ variant: this.variant() }), this.class()), /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
27
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertComponent, isStandalone: true, selector: "Alert", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.role": "\"alert\"" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
29
|
+
}
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertComponent, decorators: [{
|
|
31
|
+
type: Component,
|
|
32
|
+
args: [{
|
|
33
|
+
selector: 'Alert',
|
|
34
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
35
|
+
host: {
|
|
36
|
+
'[class]': 'classes()',
|
|
37
|
+
'[attr.role]': '"alert"',
|
|
38
|
+
},
|
|
39
|
+
template: `<ng-content />`,
|
|
40
|
+
}]
|
|
41
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
42
|
+
class AlertTitleComponent {
|
|
43
|
+
class = input('', /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
45
|
+
classes = computed(() => cn('mb-1 block font-medium leading-none tracking-tight', this.class()), /* @ts-ignore */
|
|
46
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
47
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
48
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertTitleComponent, isStandalone: true, selector: "AlertTitle, h5[AlertTitle]", 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 });
|
|
49
|
+
}
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertTitleComponent, decorators: [{
|
|
51
|
+
type: Component,
|
|
52
|
+
args: [{
|
|
53
|
+
selector: 'AlertTitle, h5[AlertTitle]',
|
|
54
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
55
|
+
host: { '[class]': 'classes()' },
|
|
56
|
+
template: `<ng-content />`,
|
|
57
|
+
}]
|
|
58
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
59
|
+
class AlertDescriptionComponent {
|
|
60
|
+
class = input('', /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
62
|
+
classes = computed(() => cn('block text-sm [&_p]:leading-relaxed', this.class()), /* @ts-ignore */
|
|
63
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
64
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDescriptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
65
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertDescriptionComponent, isStandalone: true, selector: "AlertDescription", 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 });
|
|
66
|
+
}
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertDescriptionComponent, decorators: [{
|
|
68
|
+
type: Component,
|
|
69
|
+
args: [{
|
|
70
|
+
selector: 'AlertDescription',
|
|
71
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
72
|
+
host: { '[class]': 'classes()' },
|
|
73
|
+
template: `<ng-content />`,
|
|
74
|
+
}]
|
|
75
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
76
|
+
class AlertActionComponent {
|
|
77
|
+
class = input('', /* @ts-ignore */
|
|
78
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
79
|
+
classes = computed(() => cn('mt-3 flex items-center justify-end sm:absolute sm:right-4 sm:top-4 sm:mt-0', this.class()), /* @ts-ignore */
|
|
80
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
81
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
82
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AlertActionComponent, isStandalone: true, selector: "AlertAction", 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 });
|
|
83
|
+
}
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AlertActionComponent, decorators: [{
|
|
85
|
+
type: Component,
|
|
86
|
+
args: [{
|
|
87
|
+
selector: 'AlertAction',
|
|
88
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
89
|
+
host: { '[class]': 'classes()' },
|
|
90
|
+
template: `<ng-content />`,
|
|
91
|
+
}]
|
|
92
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Generated bundle index. Do not edit.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
export { AlertActionComponent, AlertComponent, AlertDescriptionComponent, AlertTitleComponent, alertVariants };
|
|
99
|
+
//# sourceMappingURL=ojiepermana-angular-component-alert.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ojiepermana-angular-component-alert.mjs","sources":["../../../library/component/alert/alert.variants.ts","../../../library/component/alert/alert.component.ts","../../../library/component/alert/ojiepermana-angular-component-alert.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const alertVariants = cva(\n [\n 'relative block w-full rounded-lg border p-4 [&:has(AlertAction)]:pr-20',\n '[&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px]',\n '[&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground',\n ].join(' '),\n {\n variants: {\n variant: {\n default: 'bg-background text-foreground',\n destructive: 'border-destructive/50 text-destructive [&>svg]:text-destructive dark:border-destructive',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nexport type AlertVariant = NonNullable<VariantProps<typeof alertVariants>['variant']>;\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { cn } from '@ojiepermana/angular-component/utils';\nimport { alertVariants, type AlertVariant } from './alert.variants';\n\n@Component({\n selector: 'Alert',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.role]': '\"alert\"',\n },\n template: `<ng-content />`,\n})\nexport class AlertComponent {\n readonly variant = input<AlertVariant>('default');\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn(alertVariants({ variant: this.variant() }), this.class()));\n}\n\n@Component({\n selector: 'AlertTitle, h5[AlertTitle]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class AlertTitleComponent {\n readonly class = input<string>('');\n protected readonly classes = computed(() => cn('mb-1 block font-medium leading-none tracking-tight', this.class()));\n}\n\n@Component({\n selector: 'AlertDescription',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class AlertDescriptionComponent {\n readonly class = input<string>('');\n protected readonly classes = computed(() => cn('block text-sm [&_p]:leading-relaxed', this.class()));\n}\n\n@Component({\n selector: 'AlertAction',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class AlertActionComponent {\n readonly class = input<string>('');\n protected readonly classes = computed(() =>\n cn('mt-3 flex items-center justify-end sm:absolute sm:right-4 sm:top-4 sm:mt-0', this.class()),\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEO,MAAM,aAAa,GAAG,GAAG,CAC9B;IACE,wEAAwE;IACxE,+CAA+C;IAC/C,uEAAuE;AACxE,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC,EACX;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,+BAA+B;AACxC,YAAA,WAAW,EAAE,yFAAyF;AACvG,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;AACxC,CAAA;;MCHU,cAAc,CAAA;IAChB,OAAO,GAAG,KAAK,CAAe,SAAS;gFAAC;IACxC,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;IAEf,OAAO,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;gFAAC;uGAJ9F,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,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,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAEf,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBANhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;oBACvB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE;AAChC,oBAAA,QAAQ,EAAE,CAAA,cAAA,CAAgB;AAC3B,iBAAA;;;AC/CD;;AAEG;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { cn } from '@ojiepermana/angular-component/utils';
|
|
4
|
+
|
|
5
|
+
class AspectRatioComponent {
|
|
6
|
+
ratio = input.required(/* @ts-ignore */
|
|
7
|
+
...(ngDevMode ? [{ debugName: "ratio" }] : /* istanbul ignore next */ []));
|
|
8
|
+
class = input('', /* @ts-ignore */
|
|
9
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
10
|
+
classes = computed(() => cn('relative block w-full', this.class()), /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
12
|
+
paddingBottom = computed(() => {
|
|
13
|
+
const ratio = this.ratio();
|
|
14
|
+
return Number.isFinite(ratio) && ratio > 0 ? `${100 / ratio}%` : '100%';
|
|
15
|
+
}, /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "paddingBottom" }] : /* istanbul ignore next */ []));
|
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AspectRatioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
18
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: AspectRatioComponent, isStandalone: true, selector: "AspectRatio", inputs: { ratio: { classPropertyName: "ratio", publicName: "ratio", isSignal: true, isRequired: true, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: '<div [style.padding-bottom]="paddingBottom()" class="block w-full"></div><div class="absolute inset-0"><ng-content /></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
19
|
+
}
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: AspectRatioComponent, decorators: [{
|
|
21
|
+
type: Component,
|
|
22
|
+
args: [{
|
|
23
|
+
selector: 'AspectRatio',
|
|
24
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
25
|
+
host: {
|
|
26
|
+
'[class]': 'classes()',
|
|
27
|
+
},
|
|
28
|
+
template: '<div [style.padding-bottom]="paddingBottom()" class="block w-full"></div><div class="absolute inset-0"><ng-content /></div>',
|
|
29
|
+
}]
|
|
30
|
+
}], propDecorators: { ratio: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratio", required: true }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Generated bundle index. Do not edit.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
export { AspectRatioComponent };
|
|
37
|
+
//# sourceMappingURL=ojiepermana-angular-component-aspect-ratio.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ojiepermana-angular-component-aspect-ratio.mjs","sources":["../../../library/component/aspect-ratio/aspect-ratio.component.ts","../../../library/component/aspect-ratio/ojiepermana-angular-component-aspect-ratio.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { cn } from '@ojiepermana/angular-component/utils';\n\n@Component({\n selector: 'AspectRatio',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n },\n template:\n '<div [style.padding-bottom]=\"paddingBottom()\" class=\"block w-full\"></div><div class=\"absolute inset-0\"><ng-content /></div>',\n})\nexport class AspectRatioComponent {\n readonly ratio = input.required<number>();\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn('relative block w-full', this.class()));\n\n protected readonly paddingBottom = computed(() => {\n const ratio = this.ratio();\n\n return Number.isFinite(ratio) && ratio > 0 ? `${100 / ratio}%` : '100%';\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAYa,oBAAoB,CAAA;IACtB,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU;IAChC,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;AAEf,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,uBAAuB,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;gFAAC;AAEnE,IAAA,aAAa,GAAG,QAAQ,CAAC,MAAK;AAC/C,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;QAE1B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,CAAA,EAAG,GAAG,GAAG,KAAK,GAAG,GAAG,MAAM;IACzE,CAAC;sFAAC;uGAVS,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,oBAAoB,kXAF7B,6HAA6H,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAEpH,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAThC,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;AACvB,qBAAA;AACD,oBAAA,QAAQ,EACN,6HAA6H;AAChI,iBAAA;;;ACXD;;AAEG;;;;"}
|