@raqm/ui 0.0.0-stage → 0.1.0
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/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/NOTICE.md +28 -0
- package/README.md +125 -3
- package/combobox/README.md +17 -0
- package/fesm2022/raqm-ui-accordion.mjs +414 -0
- package/fesm2022/raqm-ui-accordion.mjs.map +1 -0
- package/fesm2022/raqm-ui-alert-dialog.mjs +457 -0
- package/fesm2022/raqm-ui-alert-dialog.mjs.map +1 -0
- package/fesm2022/raqm-ui-alert.mjs +195 -0
- package/fesm2022/raqm-ui-alert.mjs.map +1 -0
- package/fesm2022/raqm-ui-aspect-ratio.mjs +66 -0
- package/fesm2022/raqm-ui-aspect-ratio.mjs.map +1 -0
- package/fesm2022/raqm-ui-attachment.mjs +435 -0
- package/fesm2022/raqm-ui-attachment.mjs.map +1 -0
- package/fesm2022/raqm-ui-avatar.mjs +337 -0
- package/fesm2022/raqm-ui-avatar.mjs.map +1 -0
- package/fesm2022/raqm-ui-badge.mjs +68 -0
- package/fesm2022/raqm-ui-badge.mjs.map +1 -0
- package/fesm2022/raqm-ui-breadcrumb.mjs +309 -0
- package/fesm2022/raqm-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/raqm-ui-button-group.mjs +138 -0
- package/fesm2022/raqm-ui-button-group.mjs.map +1 -0
- package/fesm2022/raqm-ui-button.mjs +295 -0
- package/fesm2022/raqm-ui-button.mjs.map +1 -0
- package/fesm2022/raqm-ui-calendar.mjs +1394 -0
- package/fesm2022/raqm-ui-calendar.mjs.map +1 -0
- package/fesm2022/raqm-ui-card.mjs +331 -0
- package/fesm2022/raqm-ui-card.mjs.map +1 -0
- package/fesm2022/raqm-ui-carousel.mjs +410 -0
- package/fesm2022/raqm-ui-carousel.mjs.map +1 -0
- package/fesm2022/raqm-ui-checkbox.mjs +86 -0
- package/fesm2022/raqm-ui-checkbox.mjs.map +1 -0
- package/fesm2022/raqm-ui-collapsible.mjs +266 -0
- package/fesm2022/raqm-ui-collapsible.mjs.map +1 -0
- package/fesm2022/raqm-ui-combobox.mjs +1584 -0
- package/fesm2022/raqm-ui-combobox.mjs.map +1 -0
- package/fesm2022/raqm-ui-command.mjs +1210 -0
- package/fesm2022/raqm-ui-command.mjs.map +1 -0
- package/fesm2022/raqm-ui-context-menu.mjs +723 -0
- package/fesm2022/raqm-ui-context-menu.mjs.map +1 -0
- package/fesm2022/raqm-ui-dialog.mjs +1214 -0
- package/fesm2022/raqm-ui-dialog.mjs.map +1 -0
- package/fesm2022/raqm-ui-drawer.mjs +687 -0
- package/fesm2022/raqm-ui-drawer.mjs.map +1 -0
- package/fesm2022/raqm-ui-dropdown-menu.mjs +1168 -0
- package/fesm2022/raqm-ui-dropdown-menu.mjs.map +1 -0
- package/fesm2022/raqm-ui-empty.mjs +272 -0
- package/fesm2022/raqm-ui-empty.mjs.map +1 -0
- package/fesm2022/raqm-ui-field.mjs +517 -0
- package/fesm2022/raqm-ui-field.mjs.map +1 -0
- package/fesm2022/raqm-ui-hover-card.mjs +828 -0
- package/fesm2022/raqm-ui-hover-card.mjs.map +1 -0
- package/fesm2022/raqm-ui-input-group.mjs +270 -0
- package/fesm2022/raqm-ui-input-group.mjs.map +1 -0
- package/fesm2022/raqm-ui-input-otp.mjs +788 -0
- package/fesm2022/raqm-ui-input-otp.mjs.map +1 -0
- package/fesm2022/raqm-ui-input.mjs +73 -0
- package/fesm2022/raqm-ui-input.mjs.map +1 -0
- package/fesm2022/raqm-ui-item.mjs +495 -0
- package/fesm2022/raqm-ui-item.mjs.map +1 -0
- package/fesm2022/raqm-ui-kbd.mjs +80 -0
- package/fesm2022/raqm-ui-kbd.mjs.map +1 -0
- package/fesm2022/raqm-ui-label.mjs +44 -0
- package/fesm2022/raqm-ui-label.mjs.map +1 -0
- package/fesm2022/raqm-ui-menubar.mjs +536 -0
- package/fesm2022/raqm-ui-menubar.mjs.map +1 -0
- package/fesm2022/raqm-ui-native-select.mjs +131 -0
- package/fesm2022/raqm-ui-native-select.mjs.map +1 -0
- package/fesm2022/raqm-ui-navigation-menu.mjs +1399 -0
- package/fesm2022/raqm-ui-navigation-menu.mjs.map +1 -0
- package/fesm2022/raqm-ui-overlay-internal.mjs +185 -0
- package/fesm2022/raqm-ui-overlay-internal.mjs.map +1 -0
- package/fesm2022/raqm-ui-pagination.mjs +440 -0
- package/fesm2022/raqm-ui-pagination.mjs.map +1 -0
- package/fesm2022/raqm-ui-popover.mjs +1495 -0
- package/fesm2022/raqm-ui-popover.mjs.map +1 -0
- package/fesm2022/raqm-ui-progress.mjs +369 -0
- package/fesm2022/raqm-ui-progress.mjs.map +1 -0
- package/fesm2022/raqm-ui-questionnaire.mjs +1005 -0
- package/fesm2022/raqm-ui-questionnaire.mjs.map +1 -0
- package/fesm2022/raqm-ui-radio-group.mjs +151 -0
- package/fesm2022/raqm-ui-radio-group.mjs.map +1 -0
- package/fesm2022/raqm-ui-resizable.mjs +439 -0
- package/fesm2022/raqm-ui-resizable.mjs.map +1 -0
- package/fesm2022/raqm-ui-scroll-area.mjs +510 -0
- package/fesm2022/raqm-ui-scroll-area.mjs.map +1 -0
- package/fesm2022/raqm-ui-select.mjs +1073 -0
- package/fesm2022/raqm-ui-select.mjs.map +1 -0
- package/fesm2022/raqm-ui-separator.mjs +103 -0
- package/fesm2022/raqm-ui-separator.mjs.map +1 -0
- package/fesm2022/raqm-ui-sheet.mjs +411 -0
- package/fesm2022/raqm-ui-sheet.mjs.map +1 -0
- package/fesm2022/raqm-ui-sidebar.mjs +1784 -0
- package/fesm2022/raqm-ui-sidebar.mjs.map +1 -0
- package/fesm2022/raqm-ui-skeleton.mjs +50 -0
- package/fesm2022/raqm-ui-skeleton.mjs.map +1 -0
- package/fesm2022/raqm-ui-slider.mjs +609 -0
- package/fesm2022/raqm-ui-slider.mjs.map +1 -0
- package/fesm2022/raqm-ui-spinner.mjs +137 -0
- package/fesm2022/raqm-ui-spinner.mjs.map +1 -0
- package/fesm2022/raqm-ui-switch.mjs +109 -0
- package/fesm2022/raqm-ui-switch.mjs.map +1 -0
- package/fesm2022/raqm-ui-table.mjs +271 -0
- package/fesm2022/raqm-ui-table.mjs.map +1 -0
- package/fesm2022/raqm-ui-tabs.mjs +536 -0
- package/fesm2022/raqm-ui-tabs.mjs.map +1 -0
- package/fesm2022/raqm-ui-textarea.mjs +37 -0
- package/fesm2022/raqm-ui-textarea.mjs.map +1 -0
- package/fesm2022/raqm-ui-toast.mjs +918 -0
- package/fesm2022/raqm-ui-toast.mjs.map +1 -0
- package/fesm2022/raqm-ui-toggle-group.mjs +462 -0
- package/fesm2022/raqm-ui-toggle-group.mjs.map +1 -0
- package/fesm2022/raqm-ui-toggle.mjs +158 -0
- package/fesm2022/raqm-ui-toggle.mjs.map +1 -0
- package/fesm2022/raqm-ui-tooltip.mjs +1226 -0
- package/fesm2022/raqm-ui-tooltip.mjs.map +1 -0
- package/fesm2022/raqm-ui.mjs +50 -0
- package/input-otp/README.md +12 -0
- package/package.json +275 -3
- package/styles/theme.css +4322 -0
- package/types/raqm-ui-accordion.d.ts +124 -0
- package/types/raqm-ui-alert-dialog.d.ts +81 -0
- package/types/raqm-ui-alert.d.ts +29 -0
- package/types/raqm-ui-aspect-ratio.d.ts +13 -0
- package/types/raqm-ui-attachment.d.ts +72 -0
- package/types/raqm-ui-avatar.d.ts +67 -0
- package/types/raqm-ui-badge.d.ts +20 -0
- package/types/raqm-ui-breadcrumb.d.ts +35 -0
- package/types/raqm-ui-button-group.d.ts +27 -0
- package/types/raqm-ui-button.d.ts +80 -0
- package/types/raqm-ui-calendar.d.ts +359 -0
- package/types/raqm-ui-card.d.ts +34 -0
- package/types/raqm-ui-carousel.d.ts +81 -0
- package/types/raqm-ui-checkbox.d.ts +24 -0
- package/types/raqm-ui-collapsible.d.ts +72 -0
- package/types/raqm-ui-combobox.d.ts +405 -0
- package/types/raqm-ui-command.d.ts +256 -0
- package/types/raqm-ui-context-menu.d.ts +196 -0
- package/types/raqm-ui-dialog.d.ts +232 -0
- package/types/raqm-ui-drawer.d.ts +121 -0
- package/types/raqm-ui-dropdown-menu.d.ts +319 -0
- package/types/raqm-ui-empty.d.ts +35 -0
- package/types/raqm-ui-field.d.ts +88 -0
- package/types/raqm-ui-hover-card.d.ts +139 -0
- package/types/raqm-ui-input-group.d.ts +45 -0
- package/types/raqm-ui-input-otp.d.ts +197 -0
- package/types/raqm-ui-input.d.ts +16 -0
- package/types/raqm-ui-item.d.ts +71 -0
- package/types/raqm-ui-kbd.d.ts +12 -0
- package/types/raqm-ui-label.d.ts +6 -0
- package/types/raqm-ui-menubar.d.ts +159 -0
- package/types/raqm-ui-native-select.d.ts +23 -0
- package/types/raqm-ui-navigation-menu.d.ts +230 -0
- package/types/raqm-ui-overlay-internal.d.ts +5 -0
- package/types/raqm-ui-pagination.d.ts +84 -0
- package/types/raqm-ui-popover.d.ts +235 -0
- package/types/raqm-ui-progress.d.ts +79 -0
- package/types/raqm-ui-questionnaire.d.ts +217 -0
- package/types/raqm-ui-radio-group.d.ts +48 -0
- package/types/raqm-ui-resizable.d.ts +98 -0
- package/types/raqm-ui-scroll-area.d.ts +132 -0
- package/types/raqm-ui-select.d.ts +205 -0
- package/types/raqm-ui-separator.d.ts +21 -0
- package/types/raqm-ui-sheet.d.ts +79 -0
- package/types/raqm-ui-sidebar.d.ts +285 -0
- package/types/raqm-ui-skeleton.d.ts +6 -0
- package/types/raqm-ui-slider.d.ts +129 -0
- package/types/raqm-ui-spinner.d.ts +32 -0
- package/types/raqm-ui-switch.d.ts +32 -0
- package/types/raqm-ui-table.d.ts +36 -0
- package/types/raqm-ui-tabs.d.ts +154 -0
- package/types/raqm-ui-textarea.d.ts +6 -0
- package/types/raqm-ui-toast.d.ts +190 -0
- package/types/raqm-ui-toggle-group.d.ts +167 -0
- package/types/raqm-ui-toggle.d.ts +42 -0
- package/types/raqm-ui-tooltip.d.ts +207 -0
- package/types/raqm-ui.d.ts +50 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Directive, ElementRef, InjectionToken, booleanAttribute, computed, effect, forwardRef, inject, input, signal } from "@angular/core";
|
|
3
|
+
const RAQM_AVATAR = new InjectionToken("raqm-avatar");
|
|
4
|
+
var RaqmAvatarDirective = class RaqmAvatarDirective {
|
|
5
|
+
small = input(false, {
|
|
6
|
+
...ngDevMode ? { debugName: "small" } : /* istanbul ignore next */ {},
|
|
7
|
+
transform: booleanAttribute
|
|
8
|
+
});
|
|
9
|
+
large = input(false, {
|
|
10
|
+
...ngDevMode ? { debugName: "large" } : /* istanbul ignore next */ {},
|
|
11
|
+
transform: booleanAttribute
|
|
12
|
+
});
|
|
13
|
+
activeSize = computed(() => {
|
|
14
|
+
const small = this.small();
|
|
15
|
+
const large = this.large();
|
|
16
|
+
if (small && large) throw new Error("raqm-avatar: use either small or large, not both.");
|
|
17
|
+
return large ? "large" : small ? "small" : "default";
|
|
18
|
+
}, ...ngDevMode ? [{ debugName: "activeSize" }] : /* istanbul ignore next */ []);
|
|
19
|
+
statusState = signal("idle", ...ngDevMode ? [{ debugName: "statusState" }] : /* istanbul ignore next */ []);
|
|
20
|
+
status = this.statusState.asReadonly();
|
|
21
|
+
setStatus(status) {
|
|
22
|
+
this.statusState.set(status);
|
|
23
|
+
}
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
25
|
+
minVersion: "12.0.0",
|
|
26
|
+
version: "22.2.2",
|
|
27
|
+
ngImport: i0,
|
|
28
|
+
type: RaqmAvatarDirective,
|
|
29
|
+
deps: [],
|
|
30
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
31
|
+
});
|
|
32
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
33
|
+
minVersion: "17.1.0",
|
|
34
|
+
version: "22.2.2",
|
|
35
|
+
type: RaqmAvatarDirective,
|
|
36
|
+
isStandalone: true,
|
|
37
|
+
selector: "span[raqm-avatar]",
|
|
38
|
+
inputs: {
|
|
39
|
+
small: {
|
|
40
|
+
classPropertyName: "small",
|
|
41
|
+
publicName: "small",
|
|
42
|
+
isSignal: true,
|
|
43
|
+
isRequired: false,
|
|
44
|
+
transformFunction: null
|
|
45
|
+
},
|
|
46
|
+
large: {
|
|
47
|
+
classPropertyName: "large",
|
|
48
|
+
publicName: "large",
|
|
49
|
+
isSignal: true,
|
|
50
|
+
isRequired: false,
|
|
51
|
+
transformFunction: null
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
host: {
|
|
55
|
+
properties: {
|
|
56
|
+
"attr.data-raqm-small": "activeSize() === \"small\" ? \"\" : null",
|
|
57
|
+
"attr.data-raqm-large": "activeSize() === \"large\" ? \"\" : null"
|
|
58
|
+
},
|
|
59
|
+
classAttribute: "raqm-avatar"
|
|
60
|
+
},
|
|
61
|
+
providers: [{
|
|
62
|
+
provide: RAQM_AVATAR,
|
|
63
|
+
useExisting: forwardRef(() => RaqmAvatarDirective)
|
|
64
|
+
}],
|
|
65
|
+
ngImport: i0
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
69
|
+
minVersion: "12.0.0",
|
|
70
|
+
version: "22.2.2",
|
|
71
|
+
ngImport: i0,
|
|
72
|
+
type: RaqmAvatarDirective,
|
|
73
|
+
decorators: [{
|
|
74
|
+
type: Directive,
|
|
75
|
+
args: [{
|
|
76
|
+
selector: "span[raqm-avatar]",
|
|
77
|
+
host: {
|
|
78
|
+
class: "raqm-avatar",
|
|
79
|
+
"[attr.data-raqm-small]": "activeSize() === \"small\" ? \"\" : null",
|
|
80
|
+
"[attr.data-raqm-large]": "activeSize() === \"large\" ? \"\" : null"
|
|
81
|
+
},
|
|
82
|
+
providers: [{
|
|
83
|
+
provide: RAQM_AVATAR,
|
|
84
|
+
useExisting: forwardRef(() => RaqmAvatarDirective)
|
|
85
|
+
}]
|
|
86
|
+
}]
|
|
87
|
+
}],
|
|
88
|
+
propDecorators: {
|
|
89
|
+
small: [{
|
|
90
|
+
type: i0.Input,
|
|
91
|
+
args: [{
|
|
92
|
+
isSignal: true,
|
|
93
|
+
alias: "small",
|
|
94
|
+
required: false
|
|
95
|
+
}]
|
|
96
|
+
}],
|
|
97
|
+
large: [{
|
|
98
|
+
type: i0.Input,
|
|
99
|
+
args: [{
|
|
100
|
+
isSignal: true,
|
|
101
|
+
alias: "large",
|
|
102
|
+
required: false
|
|
103
|
+
}]
|
|
104
|
+
}]
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
var RaqmAvatarImageDirective = class RaqmAvatarImageDirective {
|
|
108
|
+
host = inject(ElementRef);
|
|
109
|
+
avatar = inject(RAQM_AVATAR);
|
|
110
|
+
src = input("", ...ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []);
|
|
111
|
+
generation = 0;
|
|
112
|
+
isHidden = computed(() => this.avatar.status() !== "loaded", ...ngDevMode ? [{ debugName: "isHidden" }] : /* istanbul ignore next */ []);
|
|
113
|
+
constructor() {
|
|
114
|
+
effect((onCleanup) => {
|
|
115
|
+
const img = this.host.nativeElement;
|
|
116
|
+
const src = this.src();
|
|
117
|
+
const hasSource = src.length > 0 || img.hasAttribute("srcset");
|
|
118
|
+
const generation = ++this.generation;
|
|
119
|
+
this.avatar.setStatus(hasSource ? "loading" : "error");
|
|
120
|
+
const onLoad = () => this.resolve(generation);
|
|
121
|
+
const onError = () => this.resolve(generation);
|
|
122
|
+
img.addEventListener("load", onLoad);
|
|
123
|
+
img.addEventListener("error", onError);
|
|
124
|
+
onCleanup(() => {
|
|
125
|
+
img.removeEventListener("load", onLoad);
|
|
126
|
+
img.removeEventListener("error", onError);
|
|
127
|
+
});
|
|
128
|
+
if (src.length > 0) img.src = src;
|
|
129
|
+
else img.removeAttribute("src");
|
|
130
|
+
if (hasSource && img.complete) this.resolve(generation);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
resolve(generation) {
|
|
134
|
+
if (generation !== this.generation) return;
|
|
135
|
+
const img = this.host.nativeElement;
|
|
136
|
+
if (img.complete) this.avatar.setStatus(img.naturalWidth > 0 ? "loaded" : "error");
|
|
137
|
+
}
|
|
138
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
139
|
+
minVersion: "12.0.0",
|
|
140
|
+
version: "22.2.2",
|
|
141
|
+
ngImport: i0,
|
|
142
|
+
type: RaqmAvatarImageDirective,
|
|
143
|
+
deps: [],
|
|
144
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
145
|
+
});
|
|
146
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
147
|
+
minVersion: "17.1.0",
|
|
148
|
+
version: "22.2.2",
|
|
149
|
+
type: RaqmAvatarImageDirective,
|
|
150
|
+
isStandalone: true,
|
|
151
|
+
selector: "img[raqm-avatar-image]",
|
|
152
|
+
inputs: { src: {
|
|
153
|
+
classPropertyName: "src",
|
|
154
|
+
publicName: "src",
|
|
155
|
+
isSignal: true,
|
|
156
|
+
isRequired: false,
|
|
157
|
+
transformFunction: null
|
|
158
|
+
} },
|
|
159
|
+
host: {
|
|
160
|
+
properties: { "attr.hidden": "isHidden() ? \"\" : null" },
|
|
161
|
+
classAttribute: "raqm-avatar-image"
|
|
162
|
+
},
|
|
163
|
+
ngImport: i0
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
167
|
+
minVersion: "12.0.0",
|
|
168
|
+
version: "22.2.2",
|
|
169
|
+
ngImport: i0,
|
|
170
|
+
type: RaqmAvatarImageDirective,
|
|
171
|
+
decorators: [{
|
|
172
|
+
type: Directive,
|
|
173
|
+
args: [{
|
|
174
|
+
selector: "img[raqm-avatar-image]",
|
|
175
|
+
host: {
|
|
176
|
+
class: "raqm-avatar-image",
|
|
177
|
+
"[attr.hidden]": "isHidden() ? \"\" : null"
|
|
178
|
+
}
|
|
179
|
+
}]
|
|
180
|
+
}],
|
|
181
|
+
ctorParameters: () => [],
|
|
182
|
+
propDecorators: { src: [{
|
|
183
|
+
type: i0.Input,
|
|
184
|
+
args: [{
|
|
185
|
+
isSignal: true,
|
|
186
|
+
alias: "src",
|
|
187
|
+
required: false
|
|
188
|
+
}]
|
|
189
|
+
}] }
|
|
190
|
+
});
|
|
191
|
+
var RaqmAvatarFallbackDirective = class RaqmAvatarFallbackDirective {
|
|
192
|
+
avatar = inject(RAQM_AVATAR);
|
|
193
|
+
isHidden = computed(() => this.avatar.status() === "loaded", ...ngDevMode ? [{ debugName: "isHidden" }] : /* istanbul ignore next */ []);
|
|
194
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
195
|
+
minVersion: "12.0.0",
|
|
196
|
+
version: "22.2.2",
|
|
197
|
+
ngImport: i0,
|
|
198
|
+
type: RaqmAvatarFallbackDirective,
|
|
199
|
+
deps: [],
|
|
200
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
201
|
+
});
|
|
202
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
203
|
+
minVersion: "14.0.0",
|
|
204
|
+
version: "22.2.2",
|
|
205
|
+
type: RaqmAvatarFallbackDirective,
|
|
206
|
+
isStandalone: true,
|
|
207
|
+
selector: "span[raqm-avatar-fallback]",
|
|
208
|
+
host: {
|
|
209
|
+
properties: { "attr.hidden": "isHidden() ? \"\" : null" },
|
|
210
|
+
classAttribute: "raqm-avatar-fallback"
|
|
211
|
+
},
|
|
212
|
+
ngImport: i0
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
216
|
+
minVersion: "12.0.0",
|
|
217
|
+
version: "22.2.2",
|
|
218
|
+
ngImport: i0,
|
|
219
|
+
type: RaqmAvatarFallbackDirective,
|
|
220
|
+
decorators: [{
|
|
221
|
+
type: Directive,
|
|
222
|
+
args: [{
|
|
223
|
+
selector: "span[raqm-avatar-fallback]",
|
|
224
|
+
host: {
|
|
225
|
+
class: "raqm-avatar-fallback",
|
|
226
|
+
"[attr.hidden]": "isHidden() ? \"\" : null"
|
|
227
|
+
}
|
|
228
|
+
}]
|
|
229
|
+
}]
|
|
230
|
+
});
|
|
231
|
+
var RaqmAvatarBadgeDirective = class RaqmAvatarBadgeDirective {
|
|
232
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
233
|
+
minVersion: "12.0.0",
|
|
234
|
+
version: "22.2.2",
|
|
235
|
+
ngImport: i0,
|
|
236
|
+
type: RaqmAvatarBadgeDirective,
|
|
237
|
+
deps: [],
|
|
238
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
239
|
+
});
|
|
240
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
241
|
+
minVersion: "14.0.0",
|
|
242
|
+
version: "22.2.2",
|
|
243
|
+
type: RaqmAvatarBadgeDirective,
|
|
244
|
+
isStandalone: true,
|
|
245
|
+
selector: "span[raqm-avatar-badge]",
|
|
246
|
+
host: { classAttribute: "raqm-avatar-badge" },
|
|
247
|
+
ngImport: i0
|
|
248
|
+
});
|
|
249
|
+
};
|
|
250
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
251
|
+
minVersion: "12.0.0",
|
|
252
|
+
version: "22.2.2",
|
|
253
|
+
ngImport: i0,
|
|
254
|
+
type: RaqmAvatarBadgeDirective,
|
|
255
|
+
decorators: [{
|
|
256
|
+
type: Directive,
|
|
257
|
+
args: [{
|
|
258
|
+
selector: "span[raqm-avatar-badge]",
|
|
259
|
+
host: { class: "raqm-avatar-badge" }
|
|
260
|
+
}]
|
|
261
|
+
}]
|
|
262
|
+
});
|
|
263
|
+
var RaqmAvatarGroupDirective = class RaqmAvatarGroupDirective {
|
|
264
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
265
|
+
minVersion: "12.0.0",
|
|
266
|
+
version: "22.2.2",
|
|
267
|
+
ngImport: i0,
|
|
268
|
+
type: RaqmAvatarGroupDirective,
|
|
269
|
+
deps: [],
|
|
270
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
271
|
+
});
|
|
272
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
273
|
+
minVersion: "14.0.0",
|
|
274
|
+
version: "22.2.2",
|
|
275
|
+
type: RaqmAvatarGroupDirective,
|
|
276
|
+
isStandalone: true,
|
|
277
|
+
selector: "span[raqm-avatar-group]",
|
|
278
|
+
host: { classAttribute: "raqm-avatar-group" },
|
|
279
|
+
ngImport: i0
|
|
280
|
+
});
|
|
281
|
+
};
|
|
282
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
283
|
+
minVersion: "12.0.0",
|
|
284
|
+
version: "22.2.2",
|
|
285
|
+
ngImport: i0,
|
|
286
|
+
type: RaqmAvatarGroupDirective,
|
|
287
|
+
decorators: [{
|
|
288
|
+
type: Directive,
|
|
289
|
+
args: [{
|
|
290
|
+
selector: "span[raqm-avatar-group]",
|
|
291
|
+
host: { class: "raqm-avatar-group" }
|
|
292
|
+
}]
|
|
293
|
+
}]
|
|
294
|
+
});
|
|
295
|
+
var RaqmAvatarGroupCountDirective = class RaqmAvatarGroupCountDirective {
|
|
296
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
297
|
+
minVersion: "12.0.0",
|
|
298
|
+
version: "22.2.2",
|
|
299
|
+
ngImport: i0,
|
|
300
|
+
type: RaqmAvatarGroupCountDirective,
|
|
301
|
+
deps: [],
|
|
302
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
303
|
+
});
|
|
304
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
305
|
+
minVersion: "14.0.0",
|
|
306
|
+
version: "22.2.2",
|
|
307
|
+
type: RaqmAvatarGroupCountDirective,
|
|
308
|
+
isStandalone: true,
|
|
309
|
+
selector: "span[raqm-avatar-group-count]",
|
|
310
|
+
host: { classAttribute: "raqm-avatar-group-count" },
|
|
311
|
+
ngImport: i0
|
|
312
|
+
});
|
|
313
|
+
};
|
|
314
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
315
|
+
minVersion: "12.0.0",
|
|
316
|
+
version: "22.2.2",
|
|
317
|
+
ngImport: i0,
|
|
318
|
+
type: RaqmAvatarGroupCountDirective,
|
|
319
|
+
decorators: [{
|
|
320
|
+
type: Directive,
|
|
321
|
+
args: [{
|
|
322
|
+
selector: "span[raqm-avatar-group-count]",
|
|
323
|
+
host: { class: "raqm-avatar-group-count" }
|
|
324
|
+
}]
|
|
325
|
+
}]
|
|
326
|
+
});
|
|
327
|
+
const RaqmAvatar = [
|
|
328
|
+
RaqmAvatarDirective,
|
|
329
|
+
RaqmAvatarImageDirective,
|
|
330
|
+
RaqmAvatarFallbackDirective,
|
|
331
|
+
RaqmAvatarBadgeDirective,
|
|
332
|
+
RaqmAvatarGroupDirective,
|
|
333
|
+
RaqmAvatarGroupCountDirective
|
|
334
|
+
];
|
|
335
|
+
export { RaqmAvatar, RaqmAvatarBadgeDirective, RaqmAvatarDirective, RaqmAvatarFallbackDirective, RaqmAvatarGroupCountDirective, RaqmAvatarGroupDirective, RaqmAvatarImageDirective };
|
|
336
|
+
|
|
337
|
+
//# sourceMappingURL=raqm-ui-avatar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raqm-ui-avatar.mjs","names":[],"sources":["../../../projects/ui/avatar/avatar.ts","../../../projects/ui/avatar/public-api.ts"],"sourcesContent":["import {\r\n Directive,\r\n ElementRef,\r\n InjectionToken,\r\n booleanAttribute,\r\n computed,\r\n effect,\r\n forwardRef,\r\n inject,\r\n input,\r\n signal,\r\n type Signal,\r\n} from '@angular/core';\r\n\r\ntype RaqmAvatarStatus = 'idle' | 'loading' | 'loaded' | 'error';\r\n\r\ninterface RaqmAvatarContext {\r\n readonly status: Signal<RaqmAvatarStatus>;\r\n setStatus(status: RaqmAvatarStatus): void;\r\n}\r\n\r\n// Declared before its consumer: decorator metadata reads the token at class-definition time.\r\nconst RAQM_AVATAR = new InjectionToken<RaqmAvatarContext>('raqm-avatar');\r\n\r\n/** Attaches `raqm-avatar` and owns the load state; `small` and `large` together throw. */\r\n@Directive({\r\n selector: 'span[raqm-avatar]',\r\n host: {\r\n class: 'raqm-avatar',\r\n '[attr.data-raqm-small]': 'activeSize() === \"small\" ? \"\" : null',\r\n '[attr.data-raqm-large]': 'activeSize() === \"large\" ? \"\" : null',\r\n },\r\n providers: [\r\n // `forwardRef` breaks the class/selector cycle.\r\n { provide: RAQM_AVATAR, useExisting: forwardRef(() => RaqmAvatarDirective) },\r\n ],\r\n})\r\nexport class RaqmAvatarDirective implements RaqmAvatarContext {\r\n readonly small = input(false, { transform: booleanAttribute });\r\n readonly large = input(false, { transform: booleanAttribute });\r\n\r\n protected readonly activeSize = computed<'default' | 'small' | 'large'>(() => {\r\n const small = this.small();\r\n const large = this.large();\r\n if (small && large) {\r\n throw new Error('raqm-avatar: use either small or large, not both.');\r\n }\r\n return large ? 'large' : small ? 'small' : 'default';\r\n });\r\n\r\n // Owned here, so no child can create a competing state authority.\r\n private readonly statusState = signal<RaqmAvatarStatus>('idle');\r\n\r\n readonly status = this.statusState.asReadonly();\r\n\r\n // Called only by the image directive.\r\n setStatus(status: RaqmAvatarStatus): void {\r\n this.statusState.set(status);\r\n }\r\n}\r\n\r\n/** Resolves the current source; other image attributes stay application-authored. */\r\n@Directive({\r\n selector: 'img[raqm-avatar-image]',\r\n host: {\r\n class: 'raqm-avatar-image',\r\n // Removed from the a11y tree and layout until the current source loads.\r\n '[attr.hidden]': 'isHidden() ? \"\" : null',\r\n },\r\n})\r\nexport class RaqmAvatarImageDirective {\r\n private readonly host = inject<ElementRef<HTMLImageElement>>(ElementRef);\r\n\r\n // The image is the only status writer.\r\n private readonly avatar = inject(RAQM_AVATAR);\r\n\r\n // An empty value with no authored `srcset` means \"no source\", which shows the fallback.\r\n readonly src = input<string>('');\r\n\r\n // A result from an earlier source is recognisably obsolete.\r\n private generation = 0;\r\n\r\n protected readonly isHidden = computed(() => this.avatar.status() !== 'loaded');\r\n\r\n constructor() {\r\n effect((onCleanup) => {\r\n const img = this.host.nativeElement;\r\n const src = this.src();\r\n // A source exists when the input is non-empty or the app authored `srcset`.\r\n const hasSource = src.length > 0 || img.hasAttribute('srcset');\r\n const generation = ++this.generation;\r\n\r\n // Reset the old success before the new source can paint: no stale image, no jump.\r\n this.avatar.setStatus(hasSource ? 'loading' : 'error');\r\n\r\n // Each result re-reads the element's current resolution, so a stale event is harmless.\r\n const onLoad = () => this.resolve(generation);\r\n const onError = () => this.resolve(generation);\r\n img.addEventListener('load', onLoad);\r\n img.addEventListener('error', onError);\r\n onCleanup(() => {\r\n img.removeEventListener('load', onLoad);\r\n img.removeEventListener('error', onError);\r\n });\r\n\r\n if (src.length > 0) {\r\n img.src = src;\r\n } else {\r\n img.removeAttribute('src');\r\n }\r\n\r\n // Cached or already-decoded sources resolve synchronously, without an event.\r\n if (hasSource && img.complete) {\r\n this.resolve(generation);\r\n }\r\n });\r\n }\r\n\r\n private resolve(generation: number): void {\r\n if (generation !== this.generation) {\r\n return;\r\n }\r\n const img = this.host.nativeElement;\r\n // Complete with intrinsic size means loaded; complete without size means error.\r\n if (img.complete) {\r\n this.avatar.setStatus(img.naturalWidth > 0 ? 'loaded' : 'error');\r\n }\r\n }\r\n}\r\n\r\n@Directive({\r\n selector: 'span[raqm-avatar-fallback]',\r\n host: {\r\n class: 'raqm-avatar-fallback',\r\n '[attr.hidden]': 'isHidden() ? \"\" : null',\r\n },\r\n})\r\nexport class RaqmAvatarFallbackDirective {\r\n private readonly avatar = inject(RAQM_AVATAR);\r\n\r\n protected readonly isHidden = computed(() => this.avatar.status() === 'loaded');\r\n}\r\n\r\n@Directive({\r\n selector: 'span[raqm-avatar-badge]',\r\n host: {\r\n class: 'raqm-avatar-badge',\r\n },\r\n})\r\nexport class RaqmAvatarBadgeDirective {}\r\n\r\n@Directive({\r\n selector: 'span[raqm-avatar-group]',\r\n host: {\r\n class: 'raqm-avatar-group',\r\n },\r\n})\r\nexport class RaqmAvatarGroupDirective {}\r\n\r\n@Directive({\r\n selector: 'span[raqm-avatar-group-count]',\r\n host: {\r\n class: 'raqm-avatar-group-count',\r\n },\r\n})\r\nexport class RaqmAvatarGroupCountDirective {}\r\n","// Public API for the `@raqm/ui/avatar` secondary entry point.\r\nimport {\r\n RaqmAvatarBadgeDirective,\r\n RaqmAvatarDirective,\r\n RaqmAvatarFallbackDirective,\r\n RaqmAvatarGroupCountDirective,\r\n RaqmAvatarGroupDirective,\r\n RaqmAvatarImageDirective,\r\n} from './avatar';\r\n\r\nexport {\r\n RaqmAvatarBadgeDirective,\r\n RaqmAvatarDirective,\r\n RaqmAvatarFallbackDirective,\r\n RaqmAvatarGroupCountDirective,\r\n RaqmAvatarGroupDirective,\r\n RaqmAvatarImageDirective,\r\n};\r\n\r\n// A nested readonly array lets Angular imports accept `RaqmAvatar` directly.\r\nexport const RaqmAvatar = [\r\n RaqmAvatarDirective,\r\n RaqmAvatarImageDirective,\r\n RaqmAvatarFallbackDirective,\r\n RaqmAvatarBadgeDirective,\r\n RaqmAvatarGroupDirective,\r\n RaqmAvatarGroupCountDirective,\r\n] as const;\r\n"],"mappings":";;AAsBA,MAAM,cAAc,IAAI,eAAkC,aAAa;AAevE,IAAa,sBAAb,MAAa,oBAAmB;CACrB,QAAQ,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAClD,QAAQ,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAExC,aAAa,eAA6C;EAC3E,MAAM,QAAQ,KAAK,MAAK;EACxB,MAAM,QAAQ,KAAK,MAAK;EACxB,IAAI,SAAS,OACX,MAAM,IAAI,MAAM,mDAAmD;EAErE,OAAO,QAAQ,UAAU,QAAQ,UAAU;CAC7C,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAGe,cAAc,OAAyB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BA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etectionStrategy, Component, computed, input } from "@angular/core";
|
|
3
|
+
var RaqmBadge = class RaqmBadge {
|
|
4
|
+
appearance = input("", {
|
|
5
|
+
...ngDevMode ? { debugName: "appearance" } : /* istanbul ignore next */ {},
|
|
6
|
+
alias: "raqm-badge"
|
|
7
|
+
});
|
|
8
|
+
activeVariant = computed(() => this.appearance() || "default", ...ngDevMode ? [{ debugName: "activeVariant" }] : /* istanbul ignore next */ []);
|
|
9
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
10
|
+
minVersion: "12.0.0",
|
|
11
|
+
version: "22.2.2",
|
|
12
|
+
ngImport: i0,
|
|
13
|
+
type: RaqmBadge,
|
|
14
|
+
deps: [],
|
|
15
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
16
|
+
});
|
|
17
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
18
|
+
minVersion: "17.1.0",
|
|
19
|
+
version: "22.2.2",
|
|
20
|
+
type: RaqmBadge,
|
|
21
|
+
isStandalone: true,
|
|
22
|
+
selector: "span[raqm-badge], a[raqm-badge]",
|
|
23
|
+
inputs: { appearance: {
|
|
24
|
+
classPropertyName: "appearance",
|
|
25
|
+
publicName: "raqm-badge",
|
|
26
|
+
isSignal: true,
|
|
27
|
+
isRequired: false,
|
|
28
|
+
transformFunction: null
|
|
29
|
+
} },
|
|
30
|
+
host: {
|
|
31
|
+
properties: { "attr.data-raqm-variant": "activeVariant()" },
|
|
32
|
+
classAttribute: "raqm-badge"
|
|
33
|
+
},
|
|
34
|
+
ngImport: i0,
|
|
35
|
+
template: "<ng-content />",
|
|
36
|
+
isInline: true,
|
|
37
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
41
|
+
minVersion: "12.0.0",
|
|
42
|
+
version: "22.2.2",
|
|
43
|
+
ngImport: i0,
|
|
44
|
+
type: RaqmBadge,
|
|
45
|
+
decorators: [{
|
|
46
|
+
type: Component,
|
|
47
|
+
args: [{
|
|
48
|
+
selector: "span[raqm-badge], a[raqm-badge]",
|
|
49
|
+
template: "<ng-content />",
|
|
50
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
51
|
+
host: {
|
|
52
|
+
class: "raqm-badge",
|
|
53
|
+
"[attr.data-raqm-variant]": "activeVariant()"
|
|
54
|
+
}
|
|
55
|
+
}]
|
|
56
|
+
}],
|
|
57
|
+
propDecorators: { appearance: [{
|
|
58
|
+
type: i0.Input,
|
|
59
|
+
args: [{
|
|
60
|
+
isSignal: true,
|
|
61
|
+
alias: "raqm-badge",
|
|
62
|
+
required: false
|
|
63
|
+
}]
|
|
64
|
+
}] }
|
|
65
|
+
});
|
|
66
|
+
export { RaqmBadge };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=raqm-ui-badge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raqm-ui-badge.mjs","names":[],"sources":["../../../projects/ui/badge/badge.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\r\n\r\ntype BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline' | 'ghost';\r\n\r\n/**\r\n * Status pill on a native `<span>` or `<a>`; a real anchor keeps native navigation and focus.\r\n * `raqm-badge` selects the appearance; `--raqm-badge-background`/`-foreground`/`-border` override colours.\r\n */\r\n@Component({\r\n selector: 'span[raqm-badge], a[raqm-badge]',\r\n template: '<ng-content />',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n class: 'raqm-badge',\r\n '[attr.data-raqm-variant]': 'activeVariant()',\r\n },\r\n})\r\nexport class RaqmBadge {\r\n /** Bare marker uses the default appearance. */\r\n readonly appearance = input<BadgeVariant | ''>('', { alias: 'raqm-badge' });\r\n\r\n protected readonly activeVariant = computed(() => this.appearance() || 'default');\r\n}\r\n"],"mappings":";;AAiBA,IAAa,YAAb,MAAa,UAAS;CAEX,aAAa,MAAyB,IAAE;EAAA,GAAA,YAAA,EAAA,WAAA,aAAA,+BAAA,CAAA;EAAI,OAAO;CAAY,CAAA;CAErD,gBAAgB,eAAe,KAAK,WAAU,KAAM,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;CAJtE,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAS,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAT,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAS,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,YAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,0BAAA,kBAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UAPV;EAAgB,UAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAOf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EATrB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,iBAAiB,wBAAwB;GACzC,MAAM;IACJ,OAAO;IACP,4BAA4B;GAC7B;EACF,CAAA"}
|