@loomui-ng/ui 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +46 -2
- package/accordion/README.md +38 -0
- package/alert/README.md +32 -0
- package/alert-dialog/README.md +37 -0
- package/aspect-ratio/README.md +24 -0
- package/attachment/README.md +40 -0
- package/avatar/README.md +34 -0
- package/badge/README.md +29 -0
- package/breadcrumb/README.md +33 -0
- package/bubble/README.md +32 -0
- package/button/README.md +31 -0
- package/button-group/README.md +30 -0
- package/calendar/README.md +35 -0
- package/card/README.md +41 -0
- package/carousel/README.md +41 -0
- package/chart/README.md +25 -0
- package/checkbox/README.md +31 -0
- package/collapsible/README.md +31 -0
- package/combobox/README.md +47 -0
- package/command/README.md +44 -0
- package/context-menu/README.md +36 -0
- package/data-table/README.md +39 -0
- package/date-picker/README.md +23 -0
- package/dialog/README.md +52 -0
- package/direction/README.md +19 -0
- package/drawer/README.md +37 -0
- package/dropdown-menu/README.md +46 -0
- package/empty/README.md +38 -0
- package/fesm2022/loomui-ng-ui-accordion.mjs +555 -0
- package/fesm2022/loomui-ng-ui-accordion.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-alert-dialog.mjs +652 -0
- package/fesm2022/loomui-ng-ui-alert-dialog.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-alert.mjs +286 -0
- package/fesm2022/loomui-ng-ui-alert.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-aspect-ratio.mjs +97 -0
- package/fesm2022/loomui-ng-ui-aspect-ratio.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-attachment.mjs +713 -0
- package/fesm2022/loomui-ng-ui-attachment.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-avatar.mjs +561 -0
- package/fesm2022/loomui-ng-ui-avatar.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-badge.mjs +102 -0
- package/fesm2022/loomui-ng-ui-badge.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-breadcrumb.mjs +520 -0
- package/fesm2022/loomui-ng-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-bubble.mjs +386 -0
- package/fesm2022/loomui-ng-ui-bubble.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-button-group.mjs +193 -0
- package/fesm2022/loomui-ng-ui-button-group.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-button.mjs +162 -0
- package/fesm2022/loomui-ng-ui-button.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-calendar.mjs +681 -0
- package/fesm2022/loomui-ng-ui-calendar.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-card.mjs +461 -0
- package/fesm2022/loomui-ng-ui-card.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-carousel.mjs +532 -0
- package/fesm2022/loomui-ng-ui-carousel.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-chart.mjs +373 -0
- package/fesm2022/loomui-ng-ui-chart.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-checkbox.mjs +265 -0
- package/fesm2022/loomui-ng-ui-checkbox.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-collapsible.mjs +274 -0
- package/fesm2022/loomui-ng-ui-collapsible.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-combobox.mjs +971 -0
- package/fesm2022/loomui-ng-ui-combobox.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-command.mjs +982 -0
- package/fesm2022/loomui-ng-ui-command.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-context-menu.mjs +1359 -0
- package/fesm2022/loomui-ng-ui-context-menu.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-data-table.mjs +535 -0
- package/fesm2022/loomui-ng-ui-data-table.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-date-picker.mjs +312 -0
- package/fesm2022/loomui-ng-ui-date-picker.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-dialog.mjs +508 -0
- package/fesm2022/loomui-ng-ui-dialog.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-direction.mjs +112 -0
- package/fesm2022/loomui-ng-ui-direction.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-drawer.mjs +590 -0
- package/fesm2022/loomui-ng-ui-drawer.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-dropdown-menu.mjs +1322 -0
- package/fesm2022/loomui-ng-ui-dropdown-menu.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-empty.mjs +408 -0
- package/fesm2022/loomui-ng-ui-empty.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-field.mjs +630 -0
- package/fesm2022/loomui-ng-ui-field.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-hover-card.mjs +230 -0
- package/fesm2022/loomui-ng-ui-hover-card.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-icon.mjs +498 -0
- package/fesm2022/loomui-ng-ui-icon.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-input-group.mjs +463 -0
- package/fesm2022/loomui-ng-ui-input-group.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-input-otp.mjs +586 -0
- package/fesm2022/loomui-ng-ui-input-otp.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-input.mjs +289 -0
- package/fesm2022/loomui-ng-ui-input.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-item.mjs +598 -0
- package/fesm2022/loomui-ng-ui-item.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-kbd.mjs +129 -0
- package/fesm2022/loomui-ng-ui-kbd.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-label.mjs +68 -0
- package/fesm2022/loomui-ng-ui-label.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-marker.mjs +234 -0
- package/fesm2022/loomui-ng-ui-marker.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-menubar.mjs +1523 -0
- package/fesm2022/loomui-ng-ui-menubar.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-message-scroller.mjs +519 -0
- package/fesm2022/loomui-ng-ui-message-scroller.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-message.mjs +408 -0
- package/fesm2022/loomui-ng-ui-message.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-native-select.mjs +389 -0
- package/fesm2022/loomui-ng-ui-native-select.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-navigation-menu.mjs +609 -0
- package/fesm2022/loomui-ng-ui-navigation-menu.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-pagination.mjs +611 -0
- package/fesm2022/loomui-ng-ui-pagination.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-popover.mjs +358 -0
- package/fesm2022/loomui-ng-ui-popover.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-progress.mjs +159 -0
- package/fesm2022/loomui-ng-ui-progress.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-questionnaire.mjs +1012 -0
- package/fesm2022/loomui-ng-ui-questionnaire.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-radio-group.mjs +399 -0
- package/fesm2022/loomui-ng-ui-radio-group.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-resizable.mjs +518 -0
- package/fesm2022/loomui-ng-ui-resizable.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-scroll-area.mjs +135 -0
- package/fesm2022/loomui-ng-ui-scroll-area.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-select.mjs +863 -0
- package/fesm2022/loomui-ng-ui-select.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-separator.mjs +114 -0
- package/fesm2022/loomui-ng-ui-separator.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-sheet.mjs +530 -0
- package/fesm2022/loomui-ng-ui-sheet.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-sidebar.mjs +1918 -0
- package/fesm2022/loomui-ng-ui-sidebar.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-skeleton.mjs +69 -0
- package/fesm2022/loomui-ng-ui-skeleton.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-slider.mjs +390 -0
- package/fesm2022/loomui-ng-ui-slider.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-spinner.mjs +85 -0
- package/fesm2022/loomui-ng-ui-spinner.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-switch.mjs +212 -0
- package/fesm2022/loomui-ng-ui-switch.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-table.mjs +559 -0
- package/fesm2022/loomui-ng-ui-table.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-tabs.mjs +544 -0
- package/fesm2022/loomui-ng-ui-tabs.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-textarea.mjs +206 -0
- package/fesm2022/loomui-ng-ui-textarea.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-toast.mjs +432 -0
- package/fesm2022/loomui-ng-ui-toast.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-toggle-group.mjs +477 -0
- package/fesm2022/loomui-ng-ui-toggle-group.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-toggle.mjs +219 -0
- package/fesm2022/loomui-ng-ui-toggle.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-tooltip.mjs +240 -0
- package/fesm2022/loomui-ng-ui-tooltip.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-typography.mjs +129 -0
- package/fesm2022/loomui-ng-ui-typography.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui-utils.mjs +1533 -0
- package/fesm2022/loomui-ng-ui-utils.mjs.map +1 -0
- package/fesm2022/loomui-ng-ui.mjs +4 -0
- package/fesm2022/loomui-ng-ui.mjs.map +1 -0
- package/field/README.md +43 -0
- package/hover-card/README.md +31 -0
- package/icon/README.md +42 -0
- package/input/README.md +26 -0
- package/input-group/README.md +40 -0
- package/input-otp/README.md +35 -0
- package/item/README.md +33 -0
- package/kbd/README.md +21 -0
- package/label/README.md +24 -0
- package/marker/README.md +24 -0
- package/menubar/README.md +40 -0
- package/message/README.md +32 -0
- package/message-scroller/README.md +40 -0
- package/native-select/README.md +26 -0
- package/navigation-menu/README.md +39 -0
- package/package.json +325 -3
- package/pagination/README.md +37 -0
- package/popover/README.md +37 -0
- package/progress/README.md +25 -0
- package/questionnaire/README.md +52 -0
- package/radio-group/README.md +33 -0
- package/resizable/README.md +37 -0
- package/scroll-area/README.md +25 -0
- package/select/README.md +45 -0
- package/separator/README.md +28 -0
- package/sheet/README.md +38 -0
- package/sidebar/README.md +60 -0
- package/skeleton/README.md +21 -0
- package/slider/README.md +29 -0
- package/spinner/README.md +15 -0
- package/styles/loomui.css +330 -0
- package/switch/README.md +29 -0
- package/table/README.md +31 -0
- package/tabs/README.md +42 -0
- package/textarea/README.md +28 -0
- package/toast/README.md +27 -0
- package/toggle/README.md +27 -0
- package/toggle-group/README.md +37 -0
- package/tooltip/README.md +31 -0
- package/types/loomui-ng-ui-accordion.d.ts +141 -0
- package/types/loomui-ng-ui-alert-dialog.d.ts +175 -0
- package/types/loomui-ng-ui-alert.d.ts +77 -0
- package/types/loomui-ng-ui-aspect-ratio.d.ts +31 -0
- package/types/loomui-ng-ui-attachment.d.ts +192 -0
- package/types/loomui-ng-ui-avatar.d.ts +147 -0
- package/types/loomui-ng-ui-badge.d.ts +32 -0
- package/types/loomui-ng-ui-breadcrumb.d.ts +118 -0
- package/types/loomui-ng-ui-bubble.d.ts +100 -0
- package/types/loomui-ng-ui-button-group.d.ts +51 -0
- package/types/loomui-ng-ui-button.d.ts +57 -0
- package/types/loomui-ng-ui-calendar.d.ts +171 -0
- package/types/loomui-ng-ui-card.d.ts +123 -0
- package/types/loomui-ng-ui-carousel.d.ts +140 -0
- package/types/loomui-ng-ui-chart.d.ts +95 -0
- package/types/loomui-ng-ui-checkbox.d.ts +62 -0
- package/types/loomui-ng-ui-collapsible.d.ts +74 -0
- package/types/loomui-ng-ui-combobox.d.ts +229 -0
- package/types/loomui-ng-ui-command.d.ts +231 -0
- package/types/loomui-ng-ui-context-menu.d.ts +288 -0
- package/types/loomui-ng-ui-data-table.d.ts +111 -0
- package/types/loomui-ng-ui-date-picker.d.ts +63 -0
- package/types/loomui-ng-ui-dialog.d.ts +127 -0
- package/types/loomui-ng-ui-direction.d.ts +42 -0
- package/types/loomui-ng-ui-drawer.d.ts +149 -0
- package/types/loomui-ng-ui-dropdown-menu.d.ts +258 -0
- package/types/loomui-ng-ui-empty.d.ts +109 -0
- package/types/loomui-ng-ui-field.d.ts +169 -0
- package/types/loomui-ng-ui-hover-card.d.ts +62 -0
- package/types/loomui-ng-ui-icon.d.ts +156 -0
- package/types/loomui-ng-ui-input-group.d.ts +130 -0
- package/types/loomui-ng-ui-input-otp.d.ts +149 -0
- package/types/loomui-ng-ui-input.d.ts +89 -0
- package/types/loomui-ng-ui-item.d.ts +157 -0
- package/types/loomui-ng-ui-kbd.d.ts +36 -0
- package/types/loomui-ng-ui-label.d.ts +19 -0
- package/types/loomui-ng-ui-marker.d.ts +61 -0
- package/types/loomui-ng-ui-menubar.d.ts +321 -0
- package/types/loomui-ng-ui-message-scroller.d.ts +138 -0
- package/types/loomui-ng-ui-message.d.ts +109 -0
- package/types/loomui-ng-ui-native-select.d.ts +84 -0
- package/types/loomui-ng-ui-navigation-menu.d.ts +160 -0
- package/types/loomui-ng-ui-pagination.d.ts +130 -0
- package/types/loomui-ng-ui-popover.d.ts +90 -0
- package/types/loomui-ng-ui-progress.d.ts +39 -0
- package/types/loomui-ng-ui-questionnaire.d.ts +274 -0
- package/types/loomui-ng-ui-radio-group.d.ts +109 -0
- package/types/loomui-ng-ui-resizable.d.ts +121 -0
- package/types/loomui-ng-ui-scroll-area.d.ts +44 -0
- package/types/loomui-ng-ui-select.d.ts +204 -0
- package/types/loomui-ng-ui-separator.d.ts +35 -0
- package/types/loomui-ng-ui-sheet.d.ts +124 -0
- package/types/loomui-ng-ui-sidebar.d.ts +485 -0
- package/types/loomui-ng-ui-skeleton.d.ts +20 -0
- package/types/loomui-ng-ui-slider.d.ts +103 -0
- package/types/loomui-ng-ui-spinner.d.ts +19 -0
- package/types/loomui-ng-ui-switch.d.ts +56 -0
- package/types/loomui-ng-ui-table.d.ts +148 -0
- package/types/loomui-ng-ui-tabs.d.ts +148 -0
- package/types/loomui-ng-ui-textarea.d.ts +52 -0
- package/types/loomui-ng-ui-toast.d.ts +97 -0
- package/types/loomui-ng-ui-toggle-group.d.ts +138 -0
- package/types/loomui-ng-ui-toggle.d.ts +63 -0
- package/types/loomui-ng-ui-tooltip.d.ts +63 -0
- package/types/loomui-ng-ui-typography.d.ts +42 -0
- package/types/loomui-ng-ui-utils.d.ts +392 -0
- package/types/loomui-ng-ui.d.ts +5 -0
- package/typography/README.md +29 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Directive, computed, forwardRef, input } from "@angular/core";
|
|
3
|
+
import { UiNativeControl, cn } from "@loomui-ng/ui/utils";
|
|
4
|
+
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
5
|
+
var UiTextarea = class UiTextarea {
|
|
6
|
+
userClass = input("", {
|
|
7
|
+
...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
|
|
8
|
+
alias: "class"
|
|
9
|
+
});
|
|
10
|
+
classes = computed(() => cn("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
12
|
+
minVersion: "12.0.0",
|
|
13
|
+
version: "22.2.2",
|
|
14
|
+
ngImport: i0,
|
|
15
|
+
type: UiTextarea,
|
|
16
|
+
deps: [],
|
|
17
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
18
|
+
});
|
|
19
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
20
|
+
minVersion: "17.1.0",
|
|
21
|
+
version: "22.2.2",
|
|
22
|
+
type: UiTextarea,
|
|
23
|
+
isStandalone: true,
|
|
24
|
+
selector: "textarea[uiTextarea]",
|
|
25
|
+
inputs: { userClass: {
|
|
26
|
+
classPropertyName: "userClass",
|
|
27
|
+
publicName: "class",
|
|
28
|
+
isSignal: true,
|
|
29
|
+
isRequired: false,
|
|
30
|
+
transformFunction: null
|
|
31
|
+
} },
|
|
32
|
+
host: {
|
|
33
|
+
attributes: { "data-slot": "textarea" },
|
|
34
|
+
properties: { "attr.class": "classes()" }
|
|
35
|
+
},
|
|
36
|
+
ngImport: i0
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
40
|
+
minVersion: "12.0.0",
|
|
41
|
+
version: "22.2.2",
|
|
42
|
+
ngImport: i0,
|
|
43
|
+
type: UiTextarea,
|
|
44
|
+
decorators: [{
|
|
45
|
+
type: Directive,
|
|
46
|
+
args: [{
|
|
47
|
+
selector: "textarea[uiTextarea]",
|
|
48
|
+
host: {
|
|
49
|
+
"data-slot": "textarea",
|
|
50
|
+
"[attr.class]": "classes()"
|
|
51
|
+
}
|
|
52
|
+
}]
|
|
53
|
+
}],
|
|
54
|
+
propDecorators: { userClass: [{
|
|
55
|
+
type: i0.Input,
|
|
56
|
+
args: [{
|
|
57
|
+
isSignal: true,
|
|
58
|
+
alias: "class",
|
|
59
|
+
required: false
|
|
60
|
+
}]
|
|
61
|
+
}] }
|
|
62
|
+
});
|
|
63
|
+
const UI_TEXTAREA_GENERATED = [UiTextarea];
|
|
64
|
+
var UiTextareaElement = class UiTextareaElement extends UiNativeControl {
|
|
65
|
+
rows = input(null, ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
66
|
+
cols = input(null, ...ngDevMode ? [{ debugName: "cols" }] : /* istanbul ignore next */ []);
|
|
67
|
+
maxlength = input(null, ...ngDevMode ? [{ debugName: "maxlength" }] : /* istanbul ignore next */ []);
|
|
68
|
+
minlength = input(null, ...ngDevMode ? [{ debugName: "minlength" }] : /* istanbul ignore next */ []);
|
|
69
|
+
wrap = input("", ...ngDevMode ? [{ debugName: "wrap" }] : /* istanbul ignore next */ []);
|
|
70
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
71
|
+
minVersion: "12.0.0",
|
|
72
|
+
version: "22.2.2",
|
|
73
|
+
ngImport: i0,
|
|
74
|
+
type: UiTextareaElement,
|
|
75
|
+
deps: null,
|
|
76
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
77
|
+
});
|
|
78
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
79
|
+
minVersion: "17.1.0",
|
|
80
|
+
version: "22.2.2",
|
|
81
|
+
type: UiTextareaElement,
|
|
82
|
+
isStandalone: true,
|
|
83
|
+
selector: "ui-textarea",
|
|
84
|
+
inputs: {
|
|
85
|
+
rows: {
|
|
86
|
+
classPropertyName: "rows",
|
|
87
|
+
publicName: "rows",
|
|
88
|
+
isSignal: true,
|
|
89
|
+
isRequired: false,
|
|
90
|
+
transformFunction: null
|
|
91
|
+
},
|
|
92
|
+
cols: {
|
|
93
|
+
classPropertyName: "cols",
|
|
94
|
+
publicName: "cols",
|
|
95
|
+
isSignal: true,
|
|
96
|
+
isRequired: false,
|
|
97
|
+
transformFunction: null
|
|
98
|
+
},
|
|
99
|
+
maxlength: {
|
|
100
|
+
classPropertyName: "maxlength",
|
|
101
|
+
publicName: "maxlength",
|
|
102
|
+
isSignal: true,
|
|
103
|
+
isRequired: false,
|
|
104
|
+
transformFunction: null
|
|
105
|
+
},
|
|
106
|
+
minlength: {
|
|
107
|
+
classPropertyName: "minlength",
|
|
108
|
+
publicName: "minlength",
|
|
109
|
+
isSignal: true,
|
|
110
|
+
isRequired: false,
|
|
111
|
+
transformFunction: null
|
|
112
|
+
},
|
|
113
|
+
wrap: {
|
|
114
|
+
classPropertyName: "wrap",
|
|
115
|
+
publicName: "wrap",
|
|
116
|
+
isSignal: true,
|
|
117
|
+
isRequired: false,
|
|
118
|
+
transformFunction: null
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
host: { classAttribute: "contents" },
|
|
122
|
+
providers: [{
|
|
123
|
+
provide: NG_VALUE_ACCESSOR,
|
|
124
|
+
useExisting: forwardRef(() => UiTextareaElement),
|
|
125
|
+
multi: true
|
|
126
|
+
}],
|
|
127
|
+
usesInheritance: true,
|
|
128
|
+
ngImport: i0,
|
|
129
|
+
template: `<textarea #control uiTextarea [class]="userClass()" [attr.id]="id() || null" [attr.name]="name() || null" [attr.placeholder]="placeholder() || null" [value]="current()" [disabled]="isDisabled()" [readOnly]="readonly()" [required]="required()" [attr.autocomplete]="autocomplete() || null" [attr.aria-label]="ariaLabel() || null" [attr.aria-describedby]="ariaDescribedby() || null" [attr.aria-invalid]="invalid() ? 'true' : null" (input)="onInput($event)" (blur)="onTouched()" [attr.rows]="rows() ?? null" [attr.cols]="cols() ?? null" [attr.maxlength]="maxlength() ?? null" [attr.minlength]="minlength() ?? null" [attr.wrap]="wrap() || null"></textarea>`,
|
|
130
|
+
isInline: true,
|
|
131
|
+
dependencies: [{
|
|
132
|
+
kind: "directive",
|
|
133
|
+
type: UiTextarea,
|
|
134
|
+
selector: "textarea[uiTextarea]",
|
|
135
|
+
inputs: ["class"]
|
|
136
|
+
}],
|
|
137
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
141
|
+
minVersion: "12.0.0",
|
|
142
|
+
version: "22.2.2",
|
|
143
|
+
ngImport: i0,
|
|
144
|
+
type: UiTextareaElement,
|
|
145
|
+
decorators: [{
|
|
146
|
+
type: Component,
|
|
147
|
+
args: [{
|
|
148
|
+
selector: "ui-textarea",
|
|
149
|
+
imports: [UiTextarea],
|
|
150
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
151
|
+
providers: [{
|
|
152
|
+
provide: NG_VALUE_ACCESSOR,
|
|
153
|
+
useExisting: forwardRef(() => UiTextareaElement),
|
|
154
|
+
multi: true
|
|
155
|
+
}],
|
|
156
|
+
host: { class: "contents" },
|
|
157
|
+
template: `<textarea #control uiTextarea [class]="userClass()" [attr.id]="id() || null" [attr.name]="name() || null" [attr.placeholder]="placeholder() || null" [value]="current()" [disabled]="isDisabled()" [readOnly]="readonly()" [required]="required()" [attr.autocomplete]="autocomplete() || null" [attr.aria-label]="ariaLabel() || null" [attr.aria-describedby]="ariaDescribedby() || null" [attr.aria-invalid]="invalid() ? 'true' : null" (input)="onInput($event)" (blur)="onTouched()" [attr.rows]="rows() ?? null" [attr.cols]="cols() ?? null" [attr.maxlength]="maxlength() ?? null" [attr.minlength]="minlength() ?? null" [attr.wrap]="wrap() || null"></textarea>`
|
|
158
|
+
}]
|
|
159
|
+
}],
|
|
160
|
+
propDecorators: {
|
|
161
|
+
rows: [{
|
|
162
|
+
type: i0.Input,
|
|
163
|
+
args: [{
|
|
164
|
+
isSignal: true,
|
|
165
|
+
alias: "rows",
|
|
166
|
+
required: false
|
|
167
|
+
}]
|
|
168
|
+
}],
|
|
169
|
+
cols: [{
|
|
170
|
+
type: i0.Input,
|
|
171
|
+
args: [{
|
|
172
|
+
isSignal: true,
|
|
173
|
+
alias: "cols",
|
|
174
|
+
required: false
|
|
175
|
+
}]
|
|
176
|
+
}],
|
|
177
|
+
maxlength: [{
|
|
178
|
+
type: i0.Input,
|
|
179
|
+
args: [{
|
|
180
|
+
isSignal: true,
|
|
181
|
+
alias: "maxlength",
|
|
182
|
+
required: false
|
|
183
|
+
}]
|
|
184
|
+
}],
|
|
185
|
+
minlength: [{
|
|
186
|
+
type: i0.Input,
|
|
187
|
+
args: [{
|
|
188
|
+
isSignal: true,
|
|
189
|
+
alias: "minlength",
|
|
190
|
+
required: false
|
|
191
|
+
}]
|
|
192
|
+
}],
|
|
193
|
+
wrap: [{
|
|
194
|
+
type: i0.Input,
|
|
195
|
+
args: [{
|
|
196
|
+
isSignal: true,
|
|
197
|
+
alias: "wrap",
|
|
198
|
+
required: false
|
|
199
|
+
}]
|
|
200
|
+
}]
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
const UI_TEXTAREA = [...UI_TEXTAREA_GENERATED, UiTextareaElement];
|
|
204
|
+
export { UI_TEXTAREA, UI_TEXTAREA_GENERATED, UiTextarea, UiTextareaElement };
|
|
205
|
+
|
|
206
|
+
//# sourceMappingURL=loomui-ng-ui-textarea.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loomui-ng-ui-textarea.mjs","names":[],"sources":["../../../libs/ui/textarea/textarea.ts","../../../libs/ui/textarea/textarea.manual.ts"],"sourcesContent":["// GENERATED by tools/gen-ui.mjs from docs/evidence/slots/textarea.json.\n// Change tools/ui-specs.mjs and regenerate; hand-written parts live in ./textarea.manual.ts.\nimport { Directive, computed, input } from '@angular/core';\nimport { cn } from '@loomui-ng/ui/utils';\n\n@Directive({\n selector: 'textarea[uiTextarea]',\n host: {\n 'data-slot': 'textarea',\n '[attr.class]': 'classes()',\n },\n})\nexport class UiTextarea {\n readonly userClass = input<string>('', { alias: 'class' });\n protected readonly classes = computed(() => cn('flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40', this.userClass()));\n}\n\nexport const UI_TEXTAREA_GENERATED = [UiTextarea] as const;\n","import { ChangeDetectionStrategy, Component, forwardRef, input } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { UiNativeControl } from '@loomui-ng/ui/utils';\nimport { UI_TEXTAREA_GENERATED, UiTextarea } from './textarea';\n\n/** <ui-textarea rows=\"4\" [(ngModel)]=\"bio\" /> — custom-element form of `<textarea uiTextarea>` (a real textarea lives inside). */\n@Component({\n selector: 'ui-textarea',\n imports: [UiTextarea],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiTextareaElement), multi: true }],\n host: { class: 'contents' },\n template: `<textarea #control uiTextarea [class]=\"userClass()\" [attr.id]=\"id() || null\" [attr.name]=\"name() || null\" [attr.placeholder]=\"placeholder() || null\" [value]=\"current()\" [disabled]=\"isDisabled()\" [readOnly]=\"readonly()\" [required]=\"required()\" [attr.autocomplete]=\"autocomplete() || null\" [attr.aria-label]=\"ariaLabel() || null\" [attr.aria-describedby]=\"ariaDescribedby() || null\" [attr.aria-invalid]=\"invalid() ? 'true' : null\" (input)=\"onInput($event)\" (blur)=\"onTouched()\" [attr.rows]=\"rows() ?? null\" [attr.cols]=\"cols() ?? null\" [attr.maxlength]=\"maxlength() ?? null\" [attr.minlength]=\"minlength() ?? null\" [attr.wrap]=\"wrap() || null\"></textarea>`,\n})\nexport class UiTextareaElement extends UiNativeControl {\n readonly rows = input<number | string | null>(null);\n readonly cols = input<number | string | null>(null);\n readonly maxlength = input<number | null>(null);\n readonly minlength = input<number | null>(null);\n readonly wrap = input<string>('');\n}\n\nexport const UI_TEXTAREA = [...UI_TEXTAREA_GENERATED, UiTextareaElement] as const;\n"],"mappings":";;;;AAYA,IAAa,aAAb,MAAa,WAAU;CACZ,YAAY,MAAc,IAAE;EAAA,GAAA,YAAA,EA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B,aAAa,iBAAgB,iBAAkB;IAAG,OAAO;GAAI,CAAE;GACzG,MAAM,EAAE,OAAO,WAAU;GACzB,UAAU;EACX,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASD,MAAa,cAAc,CAAC,GAAG,uBAAuB,iBAAiB"}
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { isPlatformBrowser } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Injectable, PLATFORM_ID, computed, effect, inject, input, signal, untracked, viewChildren } from "@angular/core";
|
|
4
|
+
import { LIB_ICONS, iconChildren } from "@loomui-ng/ui/icon";
|
|
5
|
+
let counter = 0;
|
|
6
|
+
var UiToastService = class UiToastService {
|
|
7
|
+
toasts = signal([], ...ngDevMode ? [{ debugName: "toasts" }] : /* istanbul ignore next */ []);
|
|
8
|
+
show(title, opts = {}) {
|
|
9
|
+
const id = opts.id ?? `ui-toast-${counter++}`;
|
|
10
|
+
const item = {
|
|
11
|
+
id,
|
|
12
|
+
title,
|
|
13
|
+
description: opts.description,
|
|
14
|
+
type: opts.type ?? "normal",
|
|
15
|
+
duration: opts.duration,
|
|
16
|
+
action: opts.action,
|
|
17
|
+
removed: false
|
|
18
|
+
};
|
|
19
|
+
this.toasts.update((l) => l.some((t) => t.id === id) ? l.map((t) => t.id === id ? item : t) : [...l, item]);
|
|
20
|
+
return id;
|
|
21
|
+
}
|
|
22
|
+
success(title, o = {}) {
|
|
23
|
+
return this.show(title, {
|
|
24
|
+
...o,
|
|
25
|
+
type: "success"
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
error(title, o = {}) {
|
|
29
|
+
return this.show(title, {
|
|
30
|
+
...o,
|
|
31
|
+
type: "error"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
info(title, o = {}) {
|
|
35
|
+
return this.show(title, {
|
|
36
|
+
...o,
|
|
37
|
+
type: "info"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
warning(title, o = {}) {
|
|
41
|
+
return this.show(title, {
|
|
42
|
+
...o,
|
|
43
|
+
type: "warning"
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
loading(title, o = {}) {
|
|
47
|
+
return this.show(title, {
|
|
48
|
+
...o,
|
|
49
|
+
type: "loading",
|
|
50
|
+
duration: o.duration ?? Infinity
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
dismiss(id) {
|
|
54
|
+
this.toasts.update((l) => l.map((t) => id === void 0 || t.id === id ? {
|
|
55
|
+
...t,
|
|
56
|
+
removed: true
|
|
57
|
+
} : t));
|
|
58
|
+
setTimeout(() => this.toasts.update((l) => l.filter((t) => !t.removed)), 250);
|
|
59
|
+
}
|
|
60
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
61
|
+
minVersion: "12.0.0",
|
|
62
|
+
version: "22.2.2",
|
|
63
|
+
ngImport: i0,
|
|
64
|
+
type: UiToastService,
|
|
65
|
+
deps: [],
|
|
66
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
67
|
+
});
|
|
68
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
69
|
+
minVersion: "12.0.0",
|
|
70
|
+
version: "22.2.2",
|
|
71
|
+
ngImport: i0,
|
|
72
|
+
type: UiToastService,
|
|
73
|
+
providedIn: "root"
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
77
|
+
minVersion: "12.0.0",
|
|
78
|
+
version: "22.2.2",
|
|
79
|
+
ngImport: i0,
|
|
80
|
+
type: UiToastService,
|
|
81
|
+
decorators: [{
|
|
82
|
+
type: Injectable,
|
|
83
|
+
args: [{ providedIn: "root" }]
|
|
84
|
+
}]
|
|
85
|
+
});
|
|
86
|
+
const ICONS = {
|
|
87
|
+
success: iconChildren(LIB_ICONS["CircleCheck"]),
|
|
88
|
+
error: iconChildren(LIB_ICONS["OctagonX"]),
|
|
89
|
+
info: iconChildren(LIB_ICONS["Info"]),
|
|
90
|
+
warning: iconChildren(LIB_ICONS["TriangleAlert"]),
|
|
91
|
+
loading: iconChildren(LIB_ICONS["LoaderCircle"])
|
|
92
|
+
};
|
|
93
|
+
var UiToaster = class UiToaster {
|
|
94
|
+
svc = inject(UiToastService);
|
|
95
|
+
platformId = inject(PLATFORM_ID);
|
|
96
|
+
position = input("bottom-right", ...ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []);
|
|
97
|
+
visibleToasts = input(3, ...ngDevMode ? [{ debugName: "visibleToasts" }] : /* istanbul ignore next */ []);
|
|
98
|
+
duration = input(4e3, ...ngDevMode ? [{ debugName: "duration" }] : /* istanbul ignore next */ []);
|
|
99
|
+
theme = input("system", ...ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []);
|
|
100
|
+
hotkeyLabel = "alt+T";
|
|
101
|
+
toasts = this.svc.toasts;
|
|
102
|
+
y = computed(() => this.position().startsWith("top") ? "top" : "bottom", ...ngDevMode ? [{ debugName: "y" }] : /* istanbul ignore next */ []);
|
|
103
|
+
x = computed(() => this.position().split("-")[1], ...ngDevMode ? [{ debugName: "x" }] : /* istanbul ignore next */ []);
|
|
104
|
+
expanded = signal(false, ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
|
|
105
|
+
mounted = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "mounted" }] : /* istanbul ignore next */ []);
|
|
106
|
+
offsets = signal([], ...ngDevMode ? [{ debugName: "offsets" }] : /* istanbul ignore next */ []);
|
|
107
|
+
toastEls = viewChildren("toastEl", ...ngDevMode ? [{ debugName: "toastEls" }] : /* istanbul ignore next */ []);
|
|
108
|
+
region = viewChildren("region", ...ngDevMode ? [{ debugName: "region" }] : /* istanbul ignore next */ []);
|
|
109
|
+
timers = /* @__PURE__ */ new Map();
|
|
110
|
+
resolvedTheme = computed(() => {
|
|
111
|
+
const t = this.theme();
|
|
112
|
+
if (t !== "system") return t;
|
|
113
|
+
return isPlatformBrowser(this.platformId) && document.documentElement.classList.contains("dark") ? "dark" : "light";
|
|
114
|
+
}, ...ngDevMode ? [{ debugName: "resolvedTheme" }] : /* istanbul ignore next */ []);
|
|
115
|
+
dir() {
|
|
116
|
+
return isPlatformBrowser(this.platformId) ? document.documentElement.dir || "ltr" : "ltr";
|
|
117
|
+
}
|
|
118
|
+
constructor() {
|
|
119
|
+
inject(DestroyRef).onDestroy(() => this.timers.forEach((t) => clearTimeout(t.handle)));
|
|
120
|
+
let known = /* @__PURE__ */ new Set();
|
|
121
|
+
effect(() => {
|
|
122
|
+
const list = this.toasts();
|
|
123
|
+
untracked(() => {
|
|
124
|
+
for (const t of list) if (!known.has(t.id)) {
|
|
125
|
+
known.add(t.id);
|
|
126
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
127
|
+
requestAnimationFrame(() => this.mounted.update((s) => new Set(s).add(t.id)));
|
|
128
|
+
this.startTimer(t);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
known = new Set([...known].filter((id) => list.some((t) => t.id === id)));
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
indexOf(i) {
|
|
136
|
+
return this.toasts().length - 1 - i;
|
|
137
|
+
}
|
|
138
|
+
icon(type) {
|
|
139
|
+
return type === "normal" ? "" : ICONS[type];
|
|
140
|
+
}
|
|
141
|
+
startTimer(t) {
|
|
142
|
+
const d = t.duration ?? this.duration();
|
|
143
|
+
if (!isFinite(d)) return;
|
|
144
|
+
this.timers.set(t.id, {
|
|
145
|
+
handle: setTimeout(() => this.svc.dismiss(t.id), d),
|
|
146
|
+
started: Date.now(),
|
|
147
|
+
remaining: d
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
expand() {
|
|
151
|
+
if (this.expanded()) return;
|
|
152
|
+
this.expanded.set(true);
|
|
153
|
+
const heights = this.toastEls().map((e) => e.nativeElement).map((el) => el.offsetHeight).reverse();
|
|
154
|
+
const out = [];
|
|
155
|
+
let acc = 0;
|
|
156
|
+
heights.forEach((h, i) => {
|
|
157
|
+
out[i] = acc;
|
|
158
|
+
acc += h + 14;
|
|
159
|
+
});
|
|
160
|
+
this.offsets.set(out);
|
|
161
|
+
this.timers.forEach((t, id) => {
|
|
162
|
+
clearTimeout(t.handle);
|
|
163
|
+
t.remaining -= Date.now() - t.started;
|
|
164
|
+
this.timers.set(id, t);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
collapse() {
|
|
168
|
+
if (!this.expanded()) return;
|
|
169
|
+
this.expanded.set(false);
|
|
170
|
+
this.timers.forEach((t, id) => {
|
|
171
|
+
t.started = Date.now();
|
|
172
|
+
t.handle = setTimeout(() => this.svc.dismiss(id), Math.max(t.remaining, 1e3));
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
runAction(t) {
|
|
176
|
+
t.action?.onClick?.();
|
|
177
|
+
this.svc.dismiss(t.id);
|
|
178
|
+
}
|
|
179
|
+
onDocKeydown(e) {
|
|
180
|
+
if (e.altKey && e.code === "KeyT") {
|
|
181
|
+
e.preventDefault();
|
|
182
|
+
this.region()[0]?.nativeElement.focus();
|
|
183
|
+
this.expand();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
187
|
+
minVersion: "12.0.0",
|
|
188
|
+
version: "22.2.2",
|
|
189
|
+
ngImport: i0,
|
|
190
|
+
type: UiToaster,
|
|
191
|
+
deps: [],
|
|
192
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
193
|
+
});
|
|
194
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
195
|
+
minVersion: "17.0.0",
|
|
196
|
+
version: "22.2.2",
|
|
197
|
+
type: UiToaster,
|
|
198
|
+
isStandalone: true,
|
|
199
|
+
selector: "ui-toaster",
|
|
200
|
+
inputs: {
|
|
201
|
+
position: {
|
|
202
|
+
classPropertyName: "position",
|
|
203
|
+
publicName: "position",
|
|
204
|
+
isSignal: true,
|
|
205
|
+
isRequired: false,
|
|
206
|
+
transformFunction: null
|
|
207
|
+
},
|
|
208
|
+
visibleToasts: {
|
|
209
|
+
classPropertyName: "visibleToasts",
|
|
210
|
+
publicName: "visibleToasts",
|
|
211
|
+
isSignal: true,
|
|
212
|
+
isRequired: false,
|
|
213
|
+
transformFunction: null
|
|
214
|
+
},
|
|
215
|
+
duration: {
|
|
216
|
+
classPropertyName: "duration",
|
|
217
|
+
publicName: "duration",
|
|
218
|
+
isSignal: true,
|
|
219
|
+
isRequired: false,
|
|
220
|
+
transformFunction: null
|
|
221
|
+
},
|
|
222
|
+
theme: {
|
|
223
|
+
classPropertyName: "theme",
|
|
224
|
+
publicName: "theme",
|
|
225
|
+
isSignal: true,
|
|
226
|
+
isRequired: false,
|
|
227
|
+
transformFunction: null
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
host: { listeners: { "document:keydown": "onDocKeydown($event)" } },
|
|
231
|
+
viewQueries: [{
|
|
232
|
+
propertyName: "toastEls",
|
|
233
|
+
predicate: ["toastEl"],
|
|
234
|
+
descendants: true,
|
|
235
|
+
isSignal: true
|
|
236
|
+
}, {
|
|
237
|
+
propertyName: "region",
|
|
238
|
+
predicate: ["region"],
|
|
239
|
+
descendants: true,
|
|
240
|
+
isSignal: true
|
|
241
|
+
}],
|
|
242
|
+
ngImport: i0,
|
|
243
|
+
template: `
|
|
244
|
+
<section
|
|
245
|
+
#region
|
|
246
|
+
[attr.aria-label]="'Notifications ' + hotkeyLabel"
|
|
247
|
+
tabindex="-1"
|
|
248
|
+
aria-live="polite"
|
|
249
|
+
aria-relevant="additions text"
|
|
250
|
+
aria-atomic="false"
|
|
251
|
+
>
|
|
252
|
+
<ol
|
|
253
|
+
class="toaster group"
|
|
254
|
+
data-sonner-toaster="true"
|
|
255
|
+
[attr.data-sonner-theme]="resolvedTheme()"
|
|
256
|
+
[attr.data-y-position]="y()"
|
|
257
|
+
[attr.data-x-position]="x()"
|
|
258
|
+
[attr.dir]="dir()"
|
|
259
|
+
tabindex="-1"
|
|
260
|
+
style="--width: 356px; --gap: 14px; --normal-bg: var(--popover); --normal-text: var(--popover-foreground); --normal-border: var(--border); --border-radius: var(--radius); --offset-top: 24px; --offset-right: 24px; --offset-bottom: 24px; --offset-left: 24px;"
|
|
261
|
+
(pointerenter)="expand()"
|
|
262
|
+
(pointerleave)="collapse()"
|
|
263
|
+
(focusin)="expand()"
|
|
264
|
+
(focusout)="collapse()"
|
|
265
|
+
>
|
|
266
|
+
@for (t of toasts(); track t.id; let i = $index) {
|
|
267
|
+
<li
|
|
268
|
+
#toastEl
|
|
269
|
+
tabindex="0"
|
|
270
|
+
data-sonner-toast=""
|
|
271
|
+
data-styled="true"
|
|
272
|
+
[attr.data-type]="t.type"
|
|
273
|
+
[attr.data-mounted]="mounted().has(t.id)"
|
|
274
|
+
[attr.data-removed]="t.removed"
|
|
275
|
+
[attr.data-visible]="indexOf(i) < visibleToasts()"
|
|
276
|
+
[attr.data-front]="indexOf(i) === 0"
|
|
277
|
+
[attr.data-index]="indexOf(i)"
|
|
278
|
+
[attr.data-y-position]="y()"
|
|
279
|
+
[attr.data-x-position]="x()"
|
|
280
|
+
[attr.data-expanded]="expanded()"
|
|
281
|
+
data-dismissible="true"
|
|
282
|
+
[style.--index]="indexOf(i)"
|
|
283
|
+
[style.--offset.px]="offsets()[indexOf(i)] ?? 0"
|
|
284
|
+
[style.--z-index]="toasts().length - indexOf(i)"
|
|
285
|
+
(keydown.escape)="svc.dismiss(t.id)"
|
|
286
|
+
>
|
|
287
|
+
@if (t.type !== 'normal') {
|
|
288
|
+
<div data-icon="" aria-hidden="true">
|
|
289
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" [attr.data-spin]="t.type === 'loading'" [innerHTML]="icon(t.type)"></svg>
|
|
290
|
+
</div>
|
|
291
|
+
}
|
|
292
|
+
<div data-content="">
|
|
293
|
+
<div data-title="">{{ t.title }}</div>
|
|
294
|
+
@if (t.description) {
|
|
295
|
+
<div data-description="">{{ t.description }}</div>
|
|
296
|
+
}
|
|
297
|
+
</div>
|
|
298
|
+
@if (t.action) {
|
|
299
|
+
<button data-button="true" data-action="true" type="button" (click)="runAction(t)">{{ t.action.label }}</button>
|
|
300
|
+
}
|
|
301
|
+
</li>
|
|
302
|
+
}
|
|
303
|
+
</ol>
|
|
304
|
+
</section>
|
|
305
|
+
`,
|
|
306
|
+
isInline: true,
|
|
307
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
308
|
+
});
|
|
309
|
+
};
|
|
310
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
311
|
+
minVersion: "12.0.0",
|
|
312
|
+
version: "22.2.2",
|
|
313
|
+
ngImport: i0,
|
|
314
|
+
type: UiToaster,
|
|
315
|
+
decorators: [{
|
|
316
|
+
type: Component,
|
|
317
|
+
args: [{
|
|
318
|
+
selector: "ui-toaster",
|
|
319
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
320
|
+
host: { "(document:keydown)": "onDocKeydown($event)" },
|
|
321
|
+
template: `
|
|
322
|
+
<section
|
|
323
|
+
#region
|
|
324
|
+
[attr.aria-label]="'Notifications ' + hotkeyLabel"
|
|
325
|
+
tabindex="-1"
|
|
326
|
+
aria-live="polite"
|
|
327
|
+
aria-relevant="additions text"
|
|
328
|
+
aria-atomic="false"
|
|
329
|
+
>
|
|
330
|
+
<ol
|
|
331
|
+
class="toaster group"
|
|
332
|
+
data-sonner-toaster="true"
|
|
333
|
+
[attr.data-sonner-theme]="resolvedTheme()"
|
|
334
|
+
[attr.data-y-position]="y()"
|
|
335
|
+
[attr.data-x-position]="x()"
|
|
336
|
+
[attr.dir]="dir()"
|
|
337
|
+
tabindex="-1"
|
|
338
|
+
style="--width: 356px; --gap: 14px; --normal-bg: var(--popover); --normal-text: var(--popover-foreground); --normal-border: var(--border); --border-radius: var(--radius); --offset-top: 24px; --offset-right: 24px; --offset-bottom: 24px; --offset-left: 24px;"
|
|
339
|
+
(pointerenter)="expand()"
|
|
340
|
+
(pointerleave)="collapse()"
|
|
341
|
+
(focusin)="expand()"
|
|
342
|
+
(focusout)="collapse()"
|
|
343
|
+
>
|
|
344
|
+
@for (t of toasts(); track t.id; let i = $index) {
|
|
345
|
+
<li
|
|
346
|
+
#toastEl
|
|
347
|
+
tabindex="0"
|
|
348
|
+
data-sonner-toast=""
|
|
349
|
+
data-styled="true"
|
|
350
|
+
[attr.data-type]="t.type"
|
|
351
|
+
[attr.data-mounted]="mounted().has(t.id)"
|
|
352
|
+
[attr.data-removed]="t.removed"
|
|
353
|
+
[attr.data-visible]="indexOf(i) < visibleToasts()"
|
|
354
|
+
[attr.data-front]="indexOf(i) === 0"
|
|
355
|
+
[attr.data-index]="indexOf(i)"
|
|
356
|
+
[attr.data-y-position]="y()"
|
|
357
|
+
[attr.data-x-position]="x()"
|
|
358
|
+
[attr.data-expanded]="expanded()"
|
|
359
|
+
data-dismissible="true"
|
|
360
|
+
[style.--index]="indexOf(i)"
|
|
361
|
+
[style.--offset.px]="offsets()[indexOf(i)] ?? 0"
|
|
362
|
+
[style.--z-index]="toasts().length - indexOf(i)"
|
|
363
|
+
(keydown.escape)="svc.dismiss(t.id)"
|
|
364
|
+
>
|
|
365
|
+
@if (t.type !== 'normal') {
|
|
366
|
+
<div data-icon="" aria-hidden="true">
|
|
367
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" [attr.data-spin]="t.type === 'loading'" [innerHTML]="icon(t.type)"></svg>
|
|
368
|
+
</div>
|
|
369
|
+
}
|
|
370
|
+
<div data-content="">
|
|
371
|
+
<div data-title="">{{ t.title }}</div>
|
|
372
|
+
@if (t.description) {
|
|
373
|
+
<div data-description="">{{ t.description }}</div>
|
|
374
|
+
}
|
|
375
|
+
</div>
|
|
376
|
+
@if (t.action) {
|
|
377
|
+
<button data-button="true" data-action="true" type="button" (click)="runAction(t)">{{ t.action.label }}</button>
|
|
378
|
+
}
|
|
379
|
+
</li>
|
|
380
|
+
}
|
|
381
|
+
</ol>
|
|
382
|
+
</section>
|
|
383
|
+
`
|
|
384
|
+
}]
|
|
385
|
+
}],
|
|
386
|
+
ctorParameters: () => [],
|
|
387
|
+
propDecorators: {
|
|
388
|
+
position: [{
|
|
389
|
+
type: i0.Input,
|
|
390
|
+
args: [{
|
|
391
|
+
isSignal: true,
|
|
392
|
+
alias: "position",
|
|
393
|
+
required: false
|
|
394
|
+
}]
|
|
395
|
+
}],
|
|
396
|
+
visibleToasts: [{
|
|
397
|
+
type: i0.Input,
|
|
398
|
+
args: [{
|
|
399
|
+
isSignal: true,
|
|
400
|
+
alias: "visibleToasts",
|
|
401
|
+
required: false
|
|
402
|
+
}]
|
|
403
|
+
}],
|
|
404
|
+
duration: [{
|
|
405
|
+
type: i0.Input,
|
|
406
|
+
args: [{
|
|
407
|
+
isSignal: true,
|
|
408
|
+
alias: "duration",
|
|
409
|
+
required: false
|
|
410
|
+
}]
|
|
411
|
+
}],
|
|
412
|
+
theme: [{
|
|
413
|
+
type: i0.Input,
|
|
414
|
+
args: [{
|
|
415
|
+
isSignal: true,
|
|
416
|
+
alias: "theme",
|
|
417
|
+
required: false
|
|
418
|
+
}]
|
|
419
|
+
}],
|
|
420
|
+
toastEls: [{
|
|
421
|
+
type: i0.ViewChildren,
|
|
422
|
+
args: ["toastEl", { isSignal: true }]
|
|
423
|
+
}],
|
|
424
|
+
region: [{
|
|
425
|
+
type: i0.ViewChildren,
|
|
426
|
+
args: ["region", { isSignal: true }]
|
|
427
|
+
}]
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
export { UiToastService, UiToaster };
|
|
431
|
+
|
|
432
|
+
//# sourceMappingURL=loomui-ng-ui-toast.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loomui-ng-ui-toast.mjs","names":[],"sources":["../../../libs/ui/toast/toast.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n Injectable,\n input,\n PLATFORM_ID,\n signal,\n untracked,\n viewChildren,\n} from '@angular/core';\nimport { iconChildren, LIB_ICONS } from '@loomui-ng/ui/icon';\n\nexport type ToastType = 'normal' | 'success' | 'error' | 'info' | 'warning' | 'loading';\nexport type ToastPosition =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right';\n\nexport interface ToastAction {\n label: string;\n onClick?: () => void;\n}\n\nexport interface ToastOptions {\n description?: string;\n type?: ToastType;\n /** ms; `Infinity` keeps it until dismissed. */\n duration?: number;\n action?: ToastAction;\n id?: string;\n}\n\nexport interface ToastItem extends Required<Pick<ToastOptions, 'type'>> {\n id: string;\n title: string;\n description?: string;\n duration?: number;\n action?: ToastAction;\n removed: boolean;\n}\n\nlet counter = 0;\n\n/**\n * Sonner-style toast API. Inject it anywhere and call `toast.show('Saved', { description })`.\n * Render once: <ui-toaster />.\n */\n@Injectable({ providedIn: 'root' })\nexport class UiToastService {\n readonly toasts = signal<ToastItem[]>([]);\n\n show(title: string, opts: ToastOptions = {}): string {\n const id = opts.id ?? `ui-toast-${counter++}`;\n const item: ToastItem = {\n id,\n title,\n description: opts.description,\n type: opts.type ?? 'normal',\n duration: opts.duration,\n action: opts.action,\n removed: false,\n };\n this.toasts.update((l) => (l.some((t) => t.id === id) ? l.map((t) => (t.id === id ? item : t)) : [...l, item]));\n return id;\n }\n success(title: string, o: ToastOptions = {}) {\n return this.show(title, { ...o, type: 'success' });\n }\n error(title: string, o: ToastOptions = {}) {\n return this.show(title, { ...o, type: 'error' });\n }\n info(title: string, o: ToastOptions = {}) {\n return this.show(title, { ...o, type: 'info' });\n }\n warning(title: string, o: ToastOptions = {}) {\n return this.show(title, { ...o, type: 'warning' });\n }\n loading(title: string, o: ToastOptions = {}) {\n return this.show(title, { ...o, type: 'loading', duration: o.duration ?? Infinity });\n }\n\n dismiss(id?: string): void {\n this.toasts.update((l) => l.map((t) => (id === undefined || t.id === id ? { ...t, removed: true } : t)));\n setTimeout(() => this.toasts.update((l) => l.filter((t) => !t.removed)), 250);\n }\n}\n\nconst ICONS: Record<Exclude<ToastType, 'normal'>, string> = {\n success: iconChildren(LIB_ICONS['CircleCheck']),\n error: iconChildren(LIB_ICONS['OctagonX']),\n info: iconChildren(LIB_ICONS['Info']),\n warning: iconChildren(LIB_ICONS['TriangleAlert']),\n loading: iconChildren(LIB_ICONS['LoaderCircle']),\n};\n\n/**\n * Mirrors Sonner's DOM (observed): section[aria-label=\"Notifications alt+T\"] > ol[data-sonner-toaster] >\n * li[data-sonner-toast …] > div[data-content] > div[data-title] + div[data-description], button[data-button][data-action].\n * Behavior: newest toast in front, stack collapses/expands on hover, auto-dismiss (4000ms), Alt+T focuses the region.\n * NOT implemented: swipe-to-dismiss, promise toasts, close button, rich colors (UNKNOWN on live site).\n */\n@Component({\n selector: 'ui-toaster',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:keydown)': 'onDocKeydown($event)',\n },\n template: `\n <section\n #region\n [attr.aria-label]=\"'Notifications ' + hotkeyLabel\"\n tabindex=\"-1\"\n aria-live=\"polite\"\n aria-relevant=\"additions text\"\n aria-atomic=\"false\"\n >\n <ol\n class=\"toaster group\"\n data-sonner-toaster=\"true\"\n [attr.data-sonner-theme]=\"resolvedTheme()\"\n [attr.data-y-position]=\"y()\"\n [attr.data-x-position]=\"x()\"\n [attr.dir]=\"dir()\"\n tabindex=\"-1\"\n style=\"--width: 356px; --gap: 14px; --normal-bg: var(--popover); --normal-text: var(--popover-foreground); --normal-border: var(--border); --border-radius: var(--radius); --offset-top: 24px; --offset-right: 24px; --offset-bottom: 24px; --offset-left: 24px;\"\n (pointerenter)=\"expand()\"\n (pointerleave)=\"collapse()\"\n (focusin)=\"expand()\"\n (focusout)=\"collapse()\"\n >\n @for (t of toasts(); track t.id; let i = $index) {\n <li\n #toastEl\n tabindex=\"0\"\n data-sonner-toast=\"\"\n data-styled=\"true\"\n [attr.data-type]=\"t.type\"\n [attr.data-mounted]=\"mounted().has(t.id)\"\n [attr.data-removed]=\"t.removed\"\n [attr.data-visible]=\"indexOf(i) < visibleToasts()\"\n [attr.data-front]=\"indexOf(i) === 0\"\n [attr.data-index]=\"indexOf(i)\"\n [attr.data-y-position]=\"y()\"\n [attr.data-x-position]=\"x()\"\n [attr.data-expanded]=\"expanded()\"\n data-dismissible=\"true\"\n [style.--index]=\"indexOf(i)\"\n [style.--offset.px]=\"offsets()[indexOf(i)] ?? 0\"\n [style.--z-index]=\"toasts().length - indexOf(i)\"\n (keydown.escape)=\"svc.dismiss(t.id)\"\n >\n @if (t.type !== 'normal') {\n <div data-icon=\"\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" [attr.data-spin]=\"t.type === 'loading'\" [innerHTML]=\"icon(t.type)\"></svg>\n </div>\n }\n <div data-content=\"\">\n <div data-title=\"\">{{ t.title }}</div>\n @if (t.description) {\n <div data-description=\"\">{{ t.description }}</div>\n }\n </div>\n @if (t.action) {\n <button data-button=\"true\" data-action=\"true\" type=\"button\" (click)=\"runAction(t)\">{{ t.action.label }}</button>\n }\n </li>\n }\n </ol>\n </section>\n `,\n})\nexport class UiToaster {\n protected readonly svc = inject(UiToastService);\n private readonly platformId = inject(PLATFORM_ID);\n\n readonly position = input<ToastPosition>('bottom-right');\n readonly visibleToasts = input(3);\n readonly duration = input(4000);\n readonly theme = input<'light' | 'dark' | 'system'>('system');\n readonly hotkeyLabel = 'alt+T';\n\n protected readonly toasts = this.svc.toasts;\n protected readonly y = computed(() => (this.position().startsWith('top') ? 'top' : 'bottom'));\n protected readonly x = computed(() => this.position().split('-')[1] as 'left' | 'center' | 'right');\n protected readonly expanded = signal(false);\n protected readonly mounted = signal<Set<string>>(new Set());\n protected readonly offsets = signal<number[]>([]);\n protected readonly toastEls = viewChildren<ElementRef<HTMLElement>>('toastEl');\n private readonly region = viewChildren<ElementRef<HTMLElement>>('region');\n private readonly timers = new Map<string, { handle: ReturnType<typeof setTimeout>; started: number; remaining: number }>();\n\n protected readonly resolvedTheme = computed(() => {\n const t = this.theme();\n if (t !== 'system') return t;\n return isPlatformBrowser(this.platformId) && document.documentElement.classList.contains('dark') ? 'dark' : 'light';\n });\n protected dir(): string {\n return isPlatformBrowser(this.platformId) ? document.documentElement.dir || 'ltr' : 'ltr';\n }\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.timers.forEach((t) => clearTimeout(t.handle)));\n let known = new Set<string>();\n effect(() => {\n const list = this.toasts();\n untracked(() => {\n for (const t of list) {\n if (!known.has(t.id)) {\n known.add(t.id);\n if (isPlatformBrowser(this.platformId)) {\n requestAnimationFrame(() => this.mounted.update((s) => new Set(s).add(t.id)));\n this.startTimer(t);\n }\n }\n }\n known = new Set([...known].filter((id) => list.some((t) => t.id === id)));\n });\n });\n }\n\n protected indexOf(i: number): number {\n return this.toasts().length - 1 - i;\n }\n\n protected icon(type: ToastType): string {\n return type === 'normal' ? '' : ICONS[type];\n }\n\n private startTimer(t: ToastItem): void {\n const d = t.duration ?? this.duration();\n if (!isFinite(d)) return;\n this.timers.set(t.id, {\n handle: setTimeout(() => this.svc.dismiss(t.id), d),\n started: Date.now(),\n remaining: d,\n });\n }\n\n protected expand(): void {\n if (this.expanded()) return;\n this.expanded.set(true);\n // Measure heights for the expanded layout (index 0 = newest).\n const els = this.toastEls().map((e) => e.nativeElement);\n const heights = els.map((el) => el.offsetHeight).reverse();\n const out: number[] = [];\n let acc = 0;\n heights.forEach((h, i) => {\n out[i] = acc;\n acc += h + 14;\n });\n this.offsets.set(out);\n // Pause timers while expanded.\n this.timers.forEach((t, id) => {\n clearTimeout(t.handle);\n t.remaining -= Date.now() - t.started;\n this.timers.set(id, t);\n });\n }\n\n protected collapse(): void {\n if (!this.expanded()) return;\n this.expanded.set(false);\n this.timers.forEach((t, id) => {\n t.started = Date.now();\n t.handle = setTimeout(() => this.svc.dismiss(id), Math.max(t.remaining, 1000));\n });\n }\n\n protected runAction(t: ToastItem): void {\n t.action?.onClick?.();\n this.svc.dismiss(t.id);\n }\n\n protected onDocKeydown(e: KeyboardEvent): void {\n if (e.altKey && e.code === 'KeyT') {\n e.preventDefault();\n this.region()[0]?.nativeElement.focus();\n this.expand();\n }\n }\n}\n"],"mappings":";;;;AAkDA,IAAI,UAAU;AAOd,IAAa,iBAAb,MAAa,eAAc;CAChB,SAAS,OAAoB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAEzC,KAAK,OAAe,OAAqB,CAAA,GAAE;EACzC,MAAM,KAAK,KAAK,MAAM,YAAY;EAClC,MAAM,OAAkB;GACtB;GACA;GACA,aAAa,KAAK;GAClB,MAAM,KAAK,QAAQ;GACnB,UAAU,KAAK;GACf,QAAQ,KAAK;GACb,SAAS;EACV;EACD,KAAK,OAAO,QAAQ,MAAO,EAAE,MAAM,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,MAAO,EAAE,OAAO,KAAK,OAAO,CAAE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAE;EAC9G,OAAO;CACT;CACA,QAAQ,OAAe,IAAkB,CAAA,GAAE;EACzC,OAAO,KAAK,KAAK,OAAO;GAAE,GAAG;GAAG,MAAM;EAAS,CAAE;CACnD;CACA,MAAM,OAAe,IAAkB,CAAA,GAAE;EACvC,OAAO,KAAK,KAAK,OAAO;GAAE,GAAG;GAAG,MAAM;EAAO,CAAE;CACjD;CACA,KAAK,OAAe,IAAkB,CAAA,GAAE;EACtC,OAAO,KAAK,KAAK,OAAO;GAAE,GAAG;GAAG,MAAM;EAAM,CAAE;CAChD;CACA,QAAQ,OAAe,IAAkB,CAAA,GAAE;EAC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