adb-shared 7.0.13 → 7.0.14
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/fesm2022/adb-shared.mjs
CHANGED
|
@@ -1144,7 +1144,7 @@ class RichTextComponent {
|
|
|
1144
1144
|
const textEnd = input.indexOf(']', i);
|
|
1145
1145
|
const linkStart = input.indexOf('(', textEnd);
|
|
1146
1146
|
const linkEnd = input.indexOf(')', linkStart);
|
|
1147
|
-
if (textEnd !== -1 && linkStart
|
|
1147
|
+
if (textEnd !== -1 && linkStart === textEnd + 1 && linkEnd !== -1) {
|
|
1148
1148
|
const label = input.slice(i + 1, textEnd);
|
|
1149
1149
|
const link = input.slice(linkStart + 1, linkEnd);
|
|
1150
1150
|
const [type, id] = link.split(':');
|
|
@@ -1157,6 +1157,9 @@ class RichTextComponent {
|
|
|
1157
1157
|
i = linkEnd + 1;
|
|
1158
1158
|
continue;
|
|
1159
1159
|
}
|
|
1160
|
+
parts.push({ type: 'link', content: label, url: link });
|
|
1161
|
+
i = linkEnd + 1;
|
|
1162
|
+
continue;
|
|
1160
1163
|
}
|
|
1161
1164
|
}
|
|
1162
1165
|
let next = input.length;
|
|
@@ -1176,11 +1179,11 @@ class RichTextComponent {
|
|
|
1176
1179
|
return parts;
|
|
1177
1180
|
}
|
|
1178
1181
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: RichTextComponent, deps: [{ token: RICH_MODULE_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
1179
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: RichTextComponent, isStandalone: false, selector: "adb-rich-text", inputs: { text: "text" }, usesOnChanges: true, ngImport: i0, template: "<div style=\"white-space: pre-wrap;\">\r\n @for (part of parts; track $index) {\r\n @switch (part.type) {\r\n @case ('text') { <span>{{ part.content }}</span> }\r\n @case ('italic') { <em>{{ part.content }}</em> }\r\n @case ('bold') { <b>{{ part.content }}</b> }\r\n @case ('taxon') { <a [href]=\"taxonUrl + part.id\">{{ part.content }}</a> }\r\n @default { <span>{{ part.content }}</span> }\r\n }\r\n}\r\n</div
|
|
1182
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: RichTextComponent, isStandalone: false, selector: "adb-rich-text", inputs: { text: "text" }, usesOnChanges: true, ngImport: i0, template: "<div style=\"white-space: pre-wrap;\">\r\n @for (part of parts; track $index) {\r\n @switch (part.type) {\r\n @case ('text') { <span>{{ part.content }}</span> }\r\n @case ('italic') { <em>{{ part.content }}</em> }\r\n @case ('bold') { <b>{{ part.content }}</b> }\r\n @case ('taxon') { <a [href]=\"taxonUrl + part.id\">{{ part.content }}</a> }\r\n @case ('link') { <a [href]=\"part.url\">{{ part.content }}</a> }\r\n @default { <span>{{ part.content }}</span> }\r\n }\r\n}\r\n</div>\r\n", changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
1180
1183
|
}
|
|
1181
1184
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: RichTextComponent, decorators: [{
|
|
1182
1185
|
type: Component,
|
|
1183
|
-
args: [{ selector: 'adb-rich-text', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<div style=\"white-space: pre-wrap;\">\r\n @for (part of parts; track $index) {\r\n @switch (part.type) {\r\n @case ('text') { <span>{{ part.content }}</span> }\r\n @case ('italic') { <em>{{ part.content }}</em> }\r\n @case ('bold') { <b>{{ part.content }}</b> }\r\n @case ('taxon') { <a [href]=\"taxonUrl + part.id\">{{ part.content }}</a> }\r\n @default { <span>{{ part.content }}</span> }\r\n }\r\n}\r\n</div
|
|
1186
|
+
args: [{ selector: 'adb-rich-text', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<div style=\"white-space: pre-wrap;\">\r\n @for (part of parts; track $index) {\r\n @switch (part.type) {\r\n @case ('text') { <span>{{ part.content }}</span> }\r\n @case ('italic') { <em>{{ part.content }}</em> }\r\n @case ('bold') { <b>{{ part.content }}</b> }\r\n @case ('taxon') { <a [href]=\"taxonUrl + part.id\">{{ part.content }}</a> }\r\n @case ('link') { <a [href]=\"part.url\">{{ part.content }}</a> }\r\n @default { <span>{{ part.content }}</span> }\r\n }\r\n}\r\n</div>\r\n" }]
|
|
1184
1187
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1185
1188
|
type: Inject,
|
|
1186
1189
|
args: [RICH_MODULE_CONFIG]
|