@ferrlabs/ui-ng 1.52.0 → 1.52.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.
|
@@ -8151,6 +8151,7 @@ const ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
8151
8151
|
]);
|
|
8152
8152
|
const TAG = /<\/?([a-zA-Z][a-zA-Z0-9-]*)((?:[\t\n\f\r ][^<>]*)?)\/?>/g;
|
|
8153
8153
|
const ATTRIBUTE = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)[\t\n\f\r ]*=[\t\n\f\r ]*"([^"<>]*)"/g;
|
|
8154
|
+
const BLANK = /^[\t\n\f\r ]*$/;
|
|
8154
8155
|
const NON_HTML_WHITESPACE = /[^\S\t\n\f\r ]/;
|
|
8155
8156
|
function attributesAreSafe(raw) {
|
|
8156
8157
|
let rest = raw;
|
|
@@ -8170,7 +8171,9 @@ function isTrustedIconMarkup(markup) {
|
|
|
8170
8171
|
const [tag, name, attributes] = match;
|
|
8171
8172
|
if (value.slice(cursor, match.index).includes("<")) return false;
|
|
8172
8173
|
if (!ELEMENTS.has(name)) return false;
|
|
8173
|
-
|
|
8174
|
+
const closing = tag.startsWith("</");
|
|
8175
|
+
if (closing && !BLANK.test(attributes ?? "")) return false;
|
|
8176
|
+
if (!closing && !attributesAreSafe(attributes ?? "")) return false;
|
|
8174
8177
|
cursor = match.index + tag.length;
|
|
8175
8178
|
}
|
|
8176
8179
|
return !value.slice(cursor).includes("<");
|
|
@@ -10708,11 +10711,15 @@ var UserMenuComponent = class UserMenuComponent {
|
|
|
10708
10711
|
this.items = input([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
10709
10712
|
this.showName = input(true, ...ngDevMode ? [{ debugName: "showName" }] : /* istanbul ignore next */ []);
|
|
10710
10713
|
this.select = output();
|
|
10714
|
+
this.sanitizer = inject(DomSanitizer);
|
|
10711
10715
|
this.shell = inject(SHELL_CONTEXT, { optional: true });
|
|
10712
10716
|
this.inRail = this.shell !== null;
|
|
10713
10717
|
this.compact = computed(() => this.shell?.collapsed() ?? false, ...ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []);
|
|
10714
10718
|
this.nameShown = computed(() => this.inRail ? !this.compact() : this.showName(), ...ngDevMode ? [{ debugName: "nameShown" }] : /* istanbul ignore next */ []);
|
|
10715
10719
|
}
|
|
10720
|
+
trustedIcon(markup) {
|
|
10721
|
+
return markup && isTrustedIconMarkup(markup) ? this.sanitizer.bypassSecurityTrustHtml(markup) : null;
|
|
10722
|
+
}
|
|
10716
10723
|
static {
|
|
10717
10724
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
10718
10725
|
minVersion: "12.0.0",
|
|
@@ -10834,7 +10841,12 @@ var UserMenuComponent = class UserMenuComponent {
|
|
|
10834
10841
|
(selected)="select.emit(item)"
|
|
10835
10842
|
>
|
|
10836
10843
|
@if (item.icon) {
|
|
10837
|
-
|
|
10844
|
+
@let icon = trustedIcon(item.icon);
|
|
10845
|
+
@if (icon) {
|
|
10846
|
+
<span menu-item-icon [innerHTML]="icon"></span>
|
|
10847
|
+
} @else {
|
|
10848
|
+
<span menu-item-icon>{{ item.icon }}</span>
|
|
10849
|
+
}
|
|
10838
10850
|
}
|
|
10839
10851
|
{{ item.label }}
|
|
10840
10852
|
</flr-menu-item>
|
|
@@ -10966,7 +10978,12 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
10966
10978
|
(selected)="select.emit(item)"
|
|
10967
10979
|
>
|
|
10968
10980
|
@if (item.icon) {
|
|
10969
|
-
|
|
10981
|
+
@let icon = trustedIcon(item.icon);
|
|
10982
|
+
@if (icon) {
|
|
10983
|
+
<span menu-item-icon [innerHTML]="icon"></span>
|
|
10984
|
+
} @else {
|
|
10985
|
+
<span menu-item-icon>{{ item.icon }}</span>
|
|
10986
|
+
}
|
|
10970
10987
|
}
|
|
10971
10988
|
{{ item.label }}
|
|
10972
10989
|
</flr-menu-item>
|