ngx-tethys 20.0.1 → 20.0.2
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 +17 -0
- package/action/index.d.ts +3 -3
- package/affix/index.d.ts +1 -1
- package/alert/index.d.ts +3 -3
- package/anchor/index.d.ts +3 -3
- package/arrow-switcher/index.d.ts +6 -6
- package/autocomplete/index.d.ts +7 -7
- package/avatar/index.d.ts +9 -9
- package/back-top/index.d.ts +3 -3
- package/badge/index.d.ts +6 -6
- package/breadcrumb/index.d.ts +7 -7
- package/button/index.d.ts +19 -19
- package/calendar/index.d.ts +8 -8
- package/card/index.d.ts +6 -6
- package/carousel/index.d.ts +4 -4
- package/cascader/index.d.ts +24 -24
- package/collapse/index.d.ts +4 -4
- package/color-picker/index.d.ts +16 -16
- package/comment/index.d.ts +3 -3
- package/copy/index.d.ts +2 -2
- package/core/index.d.ts +22 -22
- package/date-picker/index.d.ts +111 -111
- package/date-range/index.d.ts +5 -5
- package/dialog/index.d.ts +18 -18
- package/divider/index.d.ts +3 -3
- package/drag-drop/index.d.ts +7 -7
- package/dropdown/index.d.ts +10 -10
- package/empty/index.d.ts +12 -12
- package/fesm2022/ngx-tethys-action.mjs +14 -12
- package/fesm2022/ngx-tethys-action.mjs.map +1 -1
- package/fesm2022/ngx-tethys-affix.mjs +7 -7
- package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
- package/fesm2022/ngx-tethys-alert.mjs +10 -10
- package/fesm2022/ngx-tethys-anchor.mjs +11 -11
- package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
- package/fesm2022/ngx-tethys-arrow-switcher.mjs +7 -7
- package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
- package/fesm2022/ngx-tethys-autocomplete.mjs +19 -18
- package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
- package/fesm2022/ngx-tethys-avatar.mjs +23 -22
- package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-back-top.mjs +7 -7
- package/fesm2022/ngx-tethys-badge.mjs +7 -7
- package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
- package/fesm2022/ngx-tethys-breadcrumb.mjs +10 -10
- package/fesm2022/ngx-tethys-breadcrumb.mjs.map +1 -1
- package/fesm2022/ngx-tethys-button.mjs +16 -16
- package/fesm2022/ngx-tethys-button.mjs.map +1 -1
- package/fesm2022/ngx-tethys-calendar.mjs +16 -16
- package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-card.mjs +13 -13
- package/fesm2022/ngx-tethys-card.mjs.map +1 -1
- package/fesm2022/ngx-tethys-carousel.mjs +15 -15
- package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
- package/fesm2022/ngx-tethys-cascader.mjs +41 -34
- package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
- package/fesm2022/ngx-tethys-checkbox.mjs +7 -7
- package/fesm2022/ngx-tethys-collapse.mjs +10 -10
- package/fesm2022/ngx-tethys-color-picker.mjs +65 -57
- package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-comment.mjs +13 -13
- package/fesm2022/ngx-tethys-copy.mjs +10 -10
- package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
- package/fesm2022/ngx-tethys-core.mjs +30 -25
- package/fesm2022/ngx-tethys-core.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-picker.mjs +184 -174
- package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-range.mjs +16 -16
- package/fesm2022/ngx-tethys-date-range.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dialog.mjs +24 -24
- package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
- package/fesm2022/ngx-tethys-divider.mjs +7 -7
- package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dot.mjs +7 -7
- package/fesm2022/ngx-tethys-drag-drop.mjs +24 -24
- package/fesm2022/ngx-tethys-drag-drop.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dropdown.mjs +48 -47
- package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-tethys-empty.mjs +13 -13
- package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
- package/fesm2022/ngx-tethys-flexible-text.mjs +7 -7
- package/fesm2022/ngx-tethys-flexible-text.mjs.map +1 -1
- package/fesm2022/ngx-tethys-form.mjs +64 -61
- package/fesm2022/ngx-tethys-form.mjs.map +1 -1
- package/fesm2022/ngx-tethys-fullscreen.mjs +18 -15
- package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
- package/fesm2022/ngx-tethys-grid.mjs +34 -33
- package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
- package/fesm2022/ngx-tethys-guider.mjs +25 -24
- package/fesm2022/ngx-tethys-guider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-i18n.mjs +3 -3
- package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
- package/fesm2022/ngx-tethys-icon.mjs +15 -13
- package/fesm2022/ngx-tethys-icon.mjs.map +1 -1
- package/fesm2022/ngx-tethys-image.mjs +31 -29
- package/fesm2022/ngx-tethys-image.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input-number.mjs +17 -10
- package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input.mjs +28 -27
- package/fesm2022/ngx-tethys-input.mjs.map +1 -1
- package/fesm2022/ngx-tethys-layout.mjs +63 -63
- package/fesm2022/ngx-tethys-layout.mjs.map +1 -1
- package/fesm2022/ngx-tethys-list.mjs +21 -18
- package/fesm2022/ngx-tethys-list.mjs.map +1 -1
- package/fesm2022/ngx-tethys-loading.mjs +7 -7
- package/fesm2022/ngx-tethys-mention.mjs +35 -31
- package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
- package/fesm2022/ngx-tethys-menu.mjs +26 -26
- package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
- package/fesm2022/ngx-tethys-message.mjs +24 -24
- package/fesm2022/ngx-tethys-message.mjs.map +1 -1
- package/fesm2022/ngx-tethys-nav.mjs +27 -27
- package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
- package/fesm2022/ngx-tethys-notify.mjs +20 -20
- package/fesm2022/ngx-tethys-notify.mjs.map +1 -1
- package/fesm2022/ngx-tethys-pagination.mjs +18 -18
- package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
- package/fesm2022/ngx-tethys-popover.mjs +22 -21
- package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
- package/fesm2022/ngx-tethys-progress.mjs +17 -17
- package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property-operation.mjs +11 -11
- package/fesm2022/ngx-tethys-property-operation.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property.mjs +12 -11
- package/fesm2022/ngx-tethys-property.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +17 -17
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-rate.mjs +12 -12
- package/fesm2022/ngx-tethys-rate.mjs.map +1 -1
- package/fesm2022/ngx-tethys-resizable.mjs +21 -18
- package/fesm2022/ngx-tethys-resizable.mjs.map +1 -1
- package/fesm2022/ngx-tethys-result.mjs +11 -11
- package/fesm2022/ngx-tethys-result.mjs.map +1 -1
- package/fesm2022/ngx-tethys-segment.mjs +19 -16
- package/fesm2022/ngx-tethys-segment.mjs.map +1 -1
- package/fesm2022/ngx-tethys-select.mjs +60 -38
- package/fesm2022/ngx-tethys-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-shared.mjs +82 -79
- package/fesm2022/ngx-tethys-shared.mjs.map +1 -1
- package/fesm2022/ngx-tethys-skeleton.mjs +32 -32
- package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slide.mjs +37 -36
- package/fesm2022/ngx-tethys-slide.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slider.mjs +11 -11
- package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-space.mjs +10 -10
- package/fesm2022/ngx-tethys-statistic.mjs +7 -7
- package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
- package/fesm2022/ngx-tethys-stepper.mjs +22 -22
- package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
- package/fesm2022/ngx-tethys-strength.mjs +7 -7
- package/fesm2022/ngx-tethys-strength.mjs.map +1 -1
- package/fesm2022/ngx-tethys-switch.mjs +7 -7
- package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
- package/fesm2022/ngx-tethys-table.mjs +28 -28
- package/fesm2022/ngx-tethys-table.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tabs.mjs +13 -13
- package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tag.mjs +11 -11
- package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
- package/fesm2022/ngx-tethys-testing.mjs +1 -1
- package/fesm2022/ngx-tethys-testing.mjs.map +1 -1
- package/fesm2022/ngx-tethys-time-picker.mjs +22 -22
- package/fesm2022/ngx-tethys-time-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-timeline.mjs +14 -14
- package/fesm2022/ngx-tethys-timeline.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tooltip.mjs +19 -16
- package/fesm2022/ngx-tethys-tooltip.mjs.map +1 -1
- package/fesm2022/ngx-tethys-transfer.mjs +15 -15
- package/fesm2022/ngx-tethys-transfer.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree-select.mjs +17 -17
- package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree.mjs +50 -43
- package/fesm2022/ngx-tethys-tree.mjs.map +1 -1
- package/fesm2022/ngx-tethys-typography.mjs +16 -16
- package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
- package/fesm2022/ngx-tethys-upload.mjs +26 -25
- package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
- package/fesm2022/ngx-tethys-util.mjs +11 -5
- package/fesm2022/ngx-tethys-util.mjs.map +1 -1
- package/fesm2022/ngx-tethys-vote.mjs +7 -7
- package/fesm2022/ngx-tethys-watermark.mjs +18 -15
- package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/flexible-text/index.d.ts +5 -5
- package/form/index.d.ts +26 -22
- package/fullscreen/index.d.ts +4 -4
- package/grid/index.d.ts +12 -12
- package/guider/index.d.ts +10 -10
- package/i18n/index.d.ts +1 -1
- package/icon/index.d.ts +3 -3
- package/image/index.d.ts +12 -12
- package/input/index.d.ts +22 -22
- package/input-number/index.d.ts +4 -4
- package/layout/index.d.ts +16 -16
- package/list/index.d.ts +16 -15
- package/mention/index.d.ts +4 -4
- package/menu/index.d.ts +7 -7
- package/message/index.d.ts +5 -5
- package/nav/index.d.ts +12 -12
- package/notify/index.d.ts +1 -1
- package/package.json +1 -1
- package/pagination/index.d.ts +21 -17
- package/popover/index.d.ts +8 -8
- package/progress/index.d.ts +18 -18
- package/property/index.d.ts +6 -6
- package/property-operation/index.d.ts +3 -3
- package/radio/index.d.ts +6 -6
- package/rate/index.d.ts +5 -5
- package/resizable/index.d.ts +2 -2
- package/result/index.d.ts +8 -8
- package/schematics/testing/test-workspace.js +1 -0
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/segment/index.d.ts +9 -9
- package/select/index.d.ts +21 -21
- package/shared/index.d.ts +29 -29
- package/skeleton/index.d.ts +52 -52
- package/slide/index.d.ts +5 -5
- package/slider/index.d.ts +6 -6
- package/space/index.d.ts +1 -1
- package/statistic/index.d.ts +18 -18
- package/stepper/index.d.ts +8 -8
- package/switch/index.d.ts +2 -2
- package/table/index.d.ts +24 -24
- package/tabs/index.d.ts +6 -6
- package/testing/index.d.ts +1 -1
- package/time-picker/index.d.ts +21 -21
- package/timeline/index.d.ts +8 -8
- package/tooltip/index.d.ts +12 -12
- package/transfer/index.d.ts +16 -16
- package/tree/index.d.ts +28 -28
- package/tree-select/index.d.ts +13 -13
- package/typography/index.d.ts +3 -3
- package/upload/index.d.ts +4 -4
- package/util/index.d.ts +17 -7
- package/vote/index.d.ts +2 -2
- package/watermark/index.d.ts +2 -2
|
@@ -25,10 +25,10 @@ class ThyLoading {
|
|
|
25
25
|
this.thyIsMask = input(false, ...(ngDevMode ? [{ debugName: "thyIsMask", transform: coerceBooleanProperty }] : [{ transform: coerceBooleanProperty }]));
|
|
26
26
|
this.loadingClassName = true;
|
|
27
27
|
}
|
|
28
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
29
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
28
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyLoading, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
29
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ThyLoading, isStandalone: true, selector: "thy-loading", inputs: { thyDone: { classPropertyName: "thyDone", publicName: "thyDone", isSignal: true, isRequired: false, transformFunction: null }, thyTip: { classPropertyName: "thyTip", publicName: "thyTip", isSignal: true, isRequired: false, transformFunction: null }, thyIsMask: { classPropertyName: "thyIsMask", publicName: "thyIsMask", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.thy-loading": "this.loadingClassName" } }, ngImport: i0, template: "<div [class.thy-loading-mask]=\"thyIsMask() && !thyDone()\">\n @if (!thyDone()) {\n <div class=\"thy-loading-indicator\">\n <h4>\n <span [style.display]=\"thyTip() ? 'inline' : 'none'\">{{ thyTip() }}</span>\n <div class=\"thy-loading-ellipsis\">\n <span class=\"thy-spot\"></span>\n </div>\n </h4>\n </div>\n }\n @if (thyIsMask() || thyDone()) {\n <ng-content></ng-content>\n }\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
30
30
|
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyLoading, decorators: [{
|
|
32
32
|
type: Component,
|
|
33
33
|
args: [{ selector: 'thy-loading', changeDetection: ChangeDetectionStrategy.OnPush, imports: [], template: "<div [class.thy-loading-mask]=\"thyIsMask() && !thyDone()\">\n @if (!thyDone()) {\n <div class=\"thy-loading-indicator\">\n <h4>\n <span [style.display]=\"thyTip() ? 'inline' : 'none'\">{{ thyTip() }}</span>\n <div class=\"thy-loading-ellipsis\">\n <span class=\"thy-spot\"></span>\n </div>\n </h4>\n </div>\n }\n @if (thyIsMask() || thyDone()) {\n <ng-content></ng-content>\n }\n</div>\n" }]
|
|
34
34
|
}], propDecorators: { thyDone: [{ type: i0.Input, args: [{ isSignal: true, alias: "thyDone", required: false }] }], thyTip: [{ type: i0.Input, args: [{ isSignal: true, alias: "thyTip", required: false }] }], thyIsMask: [{ type: i0.Input, args: [{ isSignal: true, alias: "thyIsMask", required: false }] }], loadingClassName: [{
|
|
@@ -37,11 +37,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
37
37
|
}] } });
|
|
38
38
|
|
|
39
39
|
class ThyLoadingModule {
|
|
40
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
41
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
42
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
40
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyLoadingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
41
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: ThyLoadingModule, imports: [CommonModule, ThyLoading], exports: [ThyLoading] }); }
|
|
42
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyLoadingModule, imports: [CommonModule] }); }
|
|
43
43
|
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyLoadingModule, decorators: [{
|
|
45
45
|
type: NgModule,
|
|
46
46
|
args: [{
|
|
47
47
|
imports: [CommonModule, ThyLoading],
|
|
@@ -12,6 +12,7 @@ import { ThyListOption } from 'ngx-tethys/shared';
|
|
|
12
12
|
|
|
13
13
|
class MentionAdapter {
|
|
14
14
|
constructor(inputor) {
|
|
15
|
+
this.matchedMention = null;
|
|
15
16
|
this.inputor = inputor;
|
|
16
17
|
}
|
|
17
18
|
lookup(event, mentions) {
|
|
@@ -71,11 +72,11 @@ class TextareaMentionAdapter extends MentionAdapter {
|
|
|
71
72
|
return newValue;
|
|
72
73
|
}
|
|
73
74
|
getInsertValue(item) {
|
|
74
|
-
if (this.matchedMention
|
|
75
|
-
return this.matchedMention.mention.insertTransform(item).trim()
|
|
75
|
+
if (this.matchedMention?.mention.insertTransform) {
|
|
76
|
+
return `${this.matchedMention.mention.insertTransform(item).trim()} `;
|
|
76
77
|
}
|
|
77
78
|
else {
|
|
78
|
-
return `${this.matchedMention
|
|
79
|
+
return `${`${this.matchedMention?.mention.trigger}${item['name']}`.trim()} `;
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
focus(caretPosition) {
|
|
@@ -92,7 +93,7 @@ class EditableMentionAdapter extends MentionAdapter {
|
|
|
92
93
|
super(inputor);
|
|
93
94
|
}
|
|
94
95
|
seekQuery(event, mention) {
|
|
95
|
-
const selectionStart = getSelection()
|
|
96
|
+
const selectionStart = getSelection()?.focusOffset;
|
|
96
97
|
const value = this.inputor.innerText.replace(/[\r\n]/g, ' ');
|
|
97
98
|
const start = value.lastIndexOf(mention.trigger, selectionStart);
|
|
98
99
|
const fistSpaceIndexFromStart = value.indexOf(' ', selectionStart);
|
|
@@ -125,11 +126,11 @@ class EditableMentionAdapter extends MentionAdapter {
|
|
|
125
126
|
return newValue;
|
|
126
127
|
}
|
|
127
128
|
getInsertValue(item) {
|
|
128
|
-
if (this.matchedMention
|
|
129
|
-
return this.matchedMention.mention.insertTransform(item).trim()
|
|
129
|
+
if (this.matchedMention?.mention.insertTransform) {
|
|
130
|
+
return `${this.matchedMention.mention.insertTransform(item).trim()} `;
|
|
130
131
|
}
|
|
131
132
|
else {
|
|
132
|
-
return `${this.matchedMention
|
|
133
|
+
return `${`${this.matchedMention?.mention.trigger}${item['name']}`.trim()} `;
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
136
|
}
|
|
@@ -183,6 +184,7 @@ const properties = [
|
|
|
183
184
|
'MozTabSize'
|
|
184
185
|
];
|
|
185
186
|
const isBrowser = typeof window !== 'undefined';
|
|
187
|
+
// @ts-ignore
|
|
186
188
|
const isFirefox = isBrowser && window['mozInnerScreenX'] != null;
|
|
187
189
|
class CaretPositioner {
|
|
188
190
|
// get caret coordinates in input or textarea
|
|
@@ -195,7 +197,7 @@ class CaretPositioner {
|
|
|
195
197
|
if (debug) {
|
|
196
198
|
const el = document.querySelector('#input-textarea-caret-position-mirror-div');
|
|
197
199
|
if (el) {
|
|
198
|
-
el.parentNode
|
|
200
|
+
el.parentNode?.removeChild(el);
|
|
199
201
|
}
|
|
200
202
|
}
|
|
201
203
|
// The mirror div will replicate the textarea's style
|
|
@@ -203,6 +205,7 @@ class CaretPositioner {
|
|
|
203
205
|
div.id = 'input-textarea-caret-position-mirror-div';
|
|
204
206
|
document.body.appendChild(div);
|
|
205
207
|
const style = div.style;
|
|
208
|
+
// @ts-ignore
|
|
206
209
|
const computed = window.getComputedStyle ? window.getComputedStyle(element) : element['currentStyle']; // currentStyle for IE < 9
|
|
207
210
|
const isInput = element.nodeName === 'INPUT';
|
|
208
211
|
// Default textarea styles
|
|
@@ -227,7 +230,7 @@ class CaretPositioner {
|
|
|
227
230
|
parseInt(computed.borderBottomWidth, 10);
|
|
228
231
|
const targetHeight = outerHeight + parseInt(computed.lineHeight, 10);
|
|
229
232
|
if (height > targetHeight) {
|
|
230
|
-
style.lineHeight = height - outerHeight
|
|
233
|
+
style.lineHeight = `${height - outerHeight}px`;
|
|
231
234
|
}
|
|
232
235
|
else if (height === targetHeight) {
|
|
233
236
|
style.lineHeight = computed.lineHeight;
|
|
@@ -281,7 +284,7 @@ class CaretPositioner {
|
|
|
281
284
|
return coordinates;
|
|
282
285
|
}
|
|
283
286
|
static getEditableCaretCoordinates(element) {
|
|
284
|
-
if (window.getSelection()
|
|
287
|
+
if (window.getSelection()?.rangeCount) {
|
|
285
288
|
const range = window.getSelection().getRangeAt(0);
|
|
286
289
|
const rect = range.getBoundingClientRect();
|
|
287
290
|
// using the start or endcontainer is... uhm yeah... difficult...? :D
|
|
@@ -297,7 +300,7 @@ class CaretPositioner {
|
|
|
297
300
|
node.style.lineHeight = '1em';
|
|
298
301
|
height = parseInt(getComputedStyle(node).lineHeight, 10);
|
|
299
302
|
node.style.lineHeight = current != null ? current : '';
|
|
300
|
-
if (!node.getAttribute('style')
|
|
303
|
+
if (!node.getAttribute('style')?.length) {
|
|
301
304
|
// clean up if empty
|
|
302
305
|
node.removeAttribute('style');
|
|
303
306
|
}
|
|
@@ -330,10 +333,12 @@ class CaretPositioner {
|
|
|
330
333
|
static getCaretPosition(element, position, options) {
|
|
331
334
|
const coordinates = CaretPositioner.getCaretCoordinates(element, position, options);
|
|
332
335
|
const elementOffset = getElementOffset(element);
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
336
|
+
if (elementOffset) {
|
|
337
|
+
return {
|
|
338
|
+
top: coordinates.top + elementOffset.top,
|
|
339
|
+
left: coordinates.left + elementOffset.left
|
|
340
|
+
};
|
|
341
|
+
}
|
|
337
342
|
}
|
|
338
343
|
}
|
|
339
344
|
|
|
@@ -353,7 +358,7 @@ class ThyMentionSuggestions {
|
|
|
353
358
|
this.popoverRef = inject(ThyPopoverRef);
|
|
354
359
|
this.search$
|
|
355
360
|
.pipe(switchMap(query => {
|
|
356
|
-
const data = this.mention().search(query.term, this.mention()
|
|
361
|
+
const data = this.mention().search(query.term, this.mention()?.data);
|
|
357
362
|
if (data instanceof Observable) {
|
|
358
363
|
this.loadingDone.set(false);
|
|
359
364
|
return data.pipe(debounceTime(this.debounce));
|
|
@@ -369,7 +374,7 @@ class ThyMentionSuggestions {
|
|
|
369
374
|
this.loadingDone.set(true);
|
|
370
375
|
this.data.set(data || []);
|
|
371
376
|
if (this.popoverRef) {
|
|
372
|
-
if (this.mention()
|
|
377
|
+
if (this.mention()?.autoClose && this.data().length === 0) {
|
|
373
378
|
this.popoverRef.close();
|
|
374
379
|
}
|
|
375
380
|
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
@@ -379,7 +384,7 @@ class ThyMentionSuggestions {
|
|
|
379
384
|
});
|
|
380
385
|
}
|
|
381
386
|
ngOnInit() {
|
|
382
|
-
if (this.mention()
|
|
387
|
+
if (this.mention()?.popoverClass) {
|
|
383
388
|
this.elementRef.nativeElement.classList.add(this.mention().popoverClass);
|
|
384
389
|
}
|
|
385
390
|
}
|
|
@@ -395,12 +400,12 @@ class ThyMentionSuggestions {
|
|
|
395
400
|
ngOnDestroy() {
|
|
396
401
|
this.search$.complete();
|
|
397
402
|
}
|
|
398
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
399
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
403
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyMentionSuggestions, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
404
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ThyMentionSuggestions, isStandalone: true, selector: "thy-mention-suggestions", inputs: { mention: { classPropertyName: "mention", publicName: "mention", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "thy-mention-suggestions" }, ngImport: i0, template: "@if (mention()?.suggestionsTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"mention().suggestionsTemplateRef\" [ngTemplateOutletContext]=\"{ data: data() }\"></ng-container>\n} @else {\n <thy-loading [thyDone]=\"loadingDone()\"></thy-loading>\n @if (loadingDone()) {\n @if (data()?.length > 0) {\n <thy-selection-list\n thyBindKeyEventContainer=\"body\"\n thyMultiple=\"false\"\n thyAutoActiveFirstItem=\"true\"\n thySpaceKeyEnabled=\"false\"\n [thyScrollContainer]=\"elementRef\"\n (thySelectionChange)=\"selectionChange($event)\">\n @for (item of data() | slice: 0 : mention().limit; track $index) {\n <thy-list-option [thyValue]=\"item\">\n @if (mention().displayTemplateRef) {\n <ng-template *ngTemplateOutlet=\"mention().displayTemplateRef; context: { $implicit: item }\"></ng-template>\n } @else {\n {{ item['name'] || '' }}\n }\n </thy-list-option>\n }\n </thy-selection-list>\n } @else {\n <div class=\"text-desc p-3\">\n {{ mention().emptyText }}\n </div>\n }\n }\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyLoading, selector: "thy-loading", inputs: ["thyDone", "thyTip", "thyIsMask"] }, { kind: "component", type: ThySelectionList, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { kind: "component", type: ThyListOption, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { kind: "pipe", type: SlicePipe, name: "slice" }] }); }
|
|
400
405
|
}
|
|
401
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
406
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyMentionSuggestions, decorators: [{
|
|
402
407
|
type: Component,
|
|
403
|
-
args: [{ selector: 'thy-mention-suggestions', imports: [NgTemplateOutlet, ThyLoading, ThySelectionList, ThyListOption, SlicePipe], host: { class: 'thy-mention-suggestions' }, template: "@if (mention()
|
|
408
|
+
args: [{ selector: 'thy-mention-suggestions', imports: [NgTemplateOutlet, ThyLoading, ThySelectionList, ThyListOption, SlicePipe], host: { class: 'thy-mention-suggestions' }, template: "@if (mention()?.suggestionsTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"mention().suggestionsTemplateRef\" [ngTemplateOutletContext]=\"{ data: data() }\"></ng-container>\n} @else {\n <thy-loading [thyDone]=\"loadingDone()\"></thy-loading>\n @if (loadingDone()) {\n @if (data()?.length > 0) {\n <thy-selection-list\n thyBindKeyEventContainer=\"body\"\n thyMultiple=\"false\"\n thyAutoActiveFirstItem=\"true\"\n thySpaceKeyEnabled=\"false\"\n [thyScrollContainer]=\"elementRef\"\n (thySelectionChange)=\"selectionChange($event)\">\n @for (item of data() | slice: 0 : mention().limit; track $index) {\n <thy-list-option [thyValue]=\"item\">\n @if (mention().displayTemplateRef) {\n <ng-template *ngTemplateOutlet=\"mention().displayTemplateRef; context: { $implicit: item }\"></ng-template>\n } @else {\n {{ item['name'] || '' }}\n }\n </thy-list-option>\n }\n </thy-selection-list>\n } @else {\n <div class=\"text-desc p-3\">\n {{ mention().emptyText }}\n </div>\n }\n }\n}\n" }]
|
|
404
409
|
}], ctorParameters: () => [], propDecorators: { mention: [{ type: i0.Input, args: [{ isSignal: true, alias: "mention", required: false }] }] } });
|
|
405
410
|
|
|
406
411
|
const SUGGESTION_BACKDROP_CLASS = 'thy-mention-suggestions-backdrop';
|
|
@@ -409,7 +414,7 @@ const DEFAULT_MENTION_CONFIG = {
|
|
|
409
414
|
autoClose: true,
|
|
410
415
|
emptyText: '无匹配数据,按空格完成输入',
|
|
411
416
|
search: (term, data) => {
|
|
412
|
-
return data.filter(item => {
|
|
417
|
+
return (data || []).filter(item => {
|
|
413
418
|
return !item.name || item.name.toLowerCase().includes(term.toLowerCase());
|
|
414
419
|
});
|
|
415
420
|
}
|
|
@@ -426,7 +431,6 @@ class ThyMentionDirective {
|
|
|
426
431
|
this.elementRef = inject(ElementRef);
|
|
427
432
|
this.thyPopover = inject(ThyPopover);
|
|
428
433
|
this.ngControl = inject(NgControl, { optional: true, self: true });
|
|
429
|
-
this.adapter = null;
|
|
430
434
|
/**
|
|
431
435
|
* 提及输入配置参数,同时支持多个提及规则
|
|
432
436
|
* @type Mention<any>[]
|
|
@@ -527,20 +531,20 @@ class ThyMentionDirective {
|
|
|
527
531
|
this.openedSuggestionsRef.close();
|
|
528
532
|
}
|
|
529
533
|
}
|
|
530
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
531
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.
|
|
534
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyMentionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
535
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.15", type: ThyMentionDirective, isStandalone: true, selector: "[thyMention]", inputs: { thyMention: { classPropertyName: "thyMention", publicName: "thyMention", isSignal: true, isRequired: false, transformFunction: null }, thyPopoverConfig: { classPropertyName: "thyPopoverConfig", publicName: "thyPopoverConfig", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thySelectSuggestion: "thySelectSuggestion" }, ngImport: i0 }); }
|
|
532
536
|
}
|
|
533
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
537
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyMentionDirective, decorators: [{
|
|
534
538
|
type: Directive,
|
|
535
539
|
args: [{ selector: '[thyMention]' }]
|
|
536
540
|
}], ctorParameters: () => [], propDecorators: { thyMention: [{ type: i0.Input, args: [{ isSignal: true, alias: "thyMention", required: false }] }], thyPopoverConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "thyPopoverConfig", required: false }] }], thySelectSuggestion: [{ type: i0.Output, args: ["thySelectSuggestion"] }] } });
|
|
537
541
|
|
|
538
542
|
class ThyMentionModule {
|
|
539
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
540
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
541
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
543
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyMentionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
544
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: ThyMentionModule, imports: [CommonModule, FormsModule, ThyPopoverModule, ThyListModule, ThyLoadingModule, ThyMentionDirective, ThyMentionSuggestions], exports: [ThyMentionDirective] }); }
|
|
545
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyMentionModule, imports: [CommonModule, FormsModule, ThyPopoverModule, ThyListModule, ThyLoadingModule, ThyMentionSuggestions] }); }
|
|
542
546
|
}
|
|
543
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
547
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyMentionModule, decorators: [{
|
|
544
548
|
type: NgModule,
|
|
545
549
|
args: [{
|
|
546
550
|
imports: [CommonModule, FormsModule, ThyPopoverModule, ThyListModule, ThyLoadingModule, ThyMentionDirective, ThyMentionSuggestions],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-mention.mjs","sources":["../../../src/mention/adapter/adapter.ts","../../../src/mention/adapter/textarea.adapter.ts","../../../src/mention/adapter/editable.adapter.ts","../../../src/mention/adapter/index.ts","../../../src/mention/caret-positioner.ts","../../../src/mention/suggestions/suggestions.component.ts","../../../src/mention/suggestions/suggestions.component.html","../../../src/mention/mention.directive.ts","../../../src/mention/mention.module.ts","../../../src/mention/ngx-tethys-mention.ts"],"sourcesContent":["import { MentionDefaultDataItem, Mention } from '../interfaces';\n\nexport interface SeekQueryResult {\n term: string;\n start: number;\n end: number;\n}\n\nexport interface MatchedMention<T = MentionDefaultDataItem> {\n query: SeekQueryResult;\n mention: Mention<T>;\n}\n\nexport type MentionInputorElement = HTMLTextAreaElement | HTMLInputElement;\nexport abstract class MentionAdapter {\n inputor: MentionInputorElement;\n\n matchedMention: MatchedMention;\n\n constructor(inputor: MentionInputorElement) {\n this.inputor = inputor;\n }\n\n abstract seekQuery(event: Event, mention: Mention): SeekQueryResult;\n\n abstract insertMention(item: MentionDefaultDataItem): string;\n\n lookup(event: Event, mentions: Mention[]) {\n this.matchedMention = null;\n for (const mention of mentions) {\n const query = this.seekQuery(event, mention);\n if (query) {\n this.matchedMention = {\n query: query,\n mention: mention\n };\n break;\n }\n }\n return this.matchedMention;\n }\n}\n","import { MentionAdapter, MentionInputorElement, SeekQueryResult } from './adapter';\nimport { Mention, MentionDefaultDataItem } from '../interfaces';\n\nexport class TextareaMentionAdapter extends MentionAdapter {\n inputor: MentionInputorElement;\n\n constructor(inputor: MentionInputorElement) {\n super(inputor);\n }\n\n public seekQuery(event: Event, mention: Mention): SeekQueryResult {\n const selectionStart = this.inputor.selectionStart;\n const value = this.inputor.value.replace(/[\\r\\n]/g, ' ');\n // @123 | @456 => 0(start) => @123\n // @123 @456 | => 5(start) => @456\n const start = value.lastIndexOf(mention.trigger, selectionStart);\n const fistSpaceIndexFromStart = value.indexOf(' ', selectionStart);\n const end = fistSpaceIndexFromStart > -1 ? fistSpaceIndexFromStart : value.length;\n const termWithTrigger = value.substring(start, end);\n const startBeforeHasSpace = start > 0 && value[start - 1] === ' ';\n if ((startBeforeHasSpace || start === 0) && !termWithTrigger.includes(' ') && !termWithTrigger.includes(mention.trigger, 1)) {\n return {\n start: start,\n end: end,\n term: termWithTrigger.substring(mention.trigger.length)\n };\n } else {\n return null;\n }\n }\n\n public insertMention(item: MentionDefaultDataItem): string {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !this.matchedMention) {\n throw new Error(`matchedMention is null`);\n }\n const insertValue = this.getInsertValue(item);\n const value: string = this.inputor.value;\n const newValue = [\n value.slice(0, this.matchedMention.query.start),\n insertValue,\n value.slice(this.matchedMention.query.end, value.length)\n ].join('');\n this.inputor.value = newValue;\n this.focus(this.matchedMention.query.start + insertValue.length);\n return newValue;\n }\n\n private getInsertValue(item: MentionDefaultDataItem) {\n if (this.matchedMention.mention.insertTransform) {\n return this.matchedMention.mention.insertTransform(item).trim() + ' ';\n } else {\n return `${this.matchedMention.mention.trigger}${item['name']}`.trim() + ' ';\n }\n }\n\n private focus(caretPosition?: number): void {\n this.inputor.focus();\n this.inputor.setSelectionRange(caretPosition, caretPosition);\n }\n\n private isEditable() {\n return !this.inputor.readOnly && !this.inputor.disabled;\n }\n}\n","import { MentionAdapter, MentionInputorElement, SeekQueryResult } from './adapter';\nimport { Mention, MentionDefaultDataItem } from '../interfaces';\n\nexport class EditableMentionAdapter extends MentionAdapter {\n inputor: MentionInputorElement;\n\n constructor(inputor: MentionInputorElement) {\n super(inputor);\n }\n\n seekQuery(event: Event, mention: Mention): SeekQueryResult {\n const selectionStart = getSelection().focusOffset;\n const value = this.inputor.innerText.replace(/[\\r\\n]/g, ' ');\n const start = value.lastIndexOf(mention.trigger, selectionStart);\n const fistSpaceIndexFromStart = value.indexOf(' ', selectionStart);\n const end = fistSpaceIndexFromStart > -1 ? fistSpaceIndexFromStart : value.length;\n const termWithTrigger = value.substring(start, end);\n const startBeforeHasSpace = start > 0 && value[start - 1] === ' ';\n if ((startBeforeHasSpace || start === 0) && !termWithTrigger.includes(' ') && !termWithTrigger.includes(mention.trigger, 1)) {\n return {\n start: start,\n end: end,\n term: termWithTrigger.substring(mention.trigger.length)\n };\n } else {\n return null;\n }\n }\n\n insertMention(item: MentionDefaultDataItem): string {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !this.matchedMention) {\n throw new Error(`matchedMention is null`);\n }\n const insertValue = this.getInsertValue(item);\n const value: string = this.inputor.innerText;\n const newValue = [\n value.slice(0, this.matchedMention.query.start),\n insertValue,\n value.slice(this.matchedMention.query.end, value.length)\n ].join('');\n this.inputor.value = newValue;\n return newValue;\n }\n\n private getInsertValue(item: MentionDefaultDataItem) {\n if (this.matchedMention.mention.insertTransform) {\n return this.matchedMention.mention.insertTransform(item).trim() + ' ';\n } else {\n return `${this.matchedMention.mention.trigger}${item['name']}`.trim() + ' ';\n }\n }\n}\n","import { isInputOrTextarea } from 'ngx-tethys/util';\nimport { TextareaMentionAdapter } from './textarea.adapter';\nimport { EditableMentionAdapter } from './editable.adapter';\nimport { MentionInputorElement } from './adapter';\n\nexport function createMentionAdapter(element: MentionInputorElement) {\n if (isInputOrTextarea(element)) {\n return new TextareaMentionAdapter(element);\n } else {\n element.contentEditable = 'true';\n return new EditableMentionAdapter(element);\n }\n}\n\nexport * from './editable.adapter';\nexport * from './textarea.adapter';\nexport * from './adapter';\n","import { Injectable } from '@angular/core';\nimport { getElementOffset } from 'ngx-tethys/util';\n\nexport interface CaretCoordinates {\n top: number;\n left: number;\n height: number;\n}\n\nexport interface CaretOptions {\n debug: boolean;\n}\n\n// We'll copy the properties below into the mirror div.\n// Note that some browsers, such as Firefox, do not concatenate properties\n// into their shorthand (e.g. padding-top, padding-bottom etc. -> padding),\n// so we have to list every single property explicitly.\nconst properties = [\n 'direction', // RTL support\n 'boxSizing',\n 'width', // on Chrome and IE, exclude the scrollbar, so the mirror div wraps exactly as the textarea does\n 'height',\n 'overflowX',\n 'overflowY', // copy the scrollbar for IE\n\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderStyle',\n\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/font\n 'fontStyle',\n 'fontVariant',\n 'fontWeight',\n 'fontStretch',\n 'fontSize',\n 'fontSizeAdjust',\n 'lineHeight',\n 'fontFamily',\n\n 'textAlign',\n 'textTransform',\n 'textIndent',\n 'textDecoration', // might not make a difference, but better be safe\n\n 'letterSpacing',\n 'wordSpacing',\n\n 'tabSize',\n 'MozTabSize'\n];\n\nconst isBrowser = typeof window !== 'undefined';\nconst isFirefox = isBrowser && window['mozInnerScreenX'] != null;\n\nexport type InputOrTextAreaElement = HTMLInputElement | HTMLTextAreaElement;\nexport type AllElement = InputOrTextAreaElement | HTMLElement;\n\nexport class CaretPositioner {\n // get caret coordinates in input or textarea\n // copy from repo: https://github.com/component/textarea-caret-position\n static getTextareaCaretCoordinates(element: InputOrTextAreaElement, position: number, options?: CaretOptions): CaretCoordinates {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !isBrowser) {\n throw new Error('textarea-caret-position#getCaretCoordinates should only be called in a browser');\n }\n\n const debug = (options && options.debug) || false;\n if (debug) {\n const el = document.querySelector('#input-textarea-caret-position-mirror-div');\n if (el) {\n el.parentNode.removeChild(el);\n }\n }\n\n // The mirror div will replicate the textarea's style\n const div = document.createElement('div');\n div.id = 'input-textarea-caret-position-mirror-div';\n document.body.appendChild(div);\n\n const style = div.style;\n const computed = window.getComputedStyle ? window.getComputedStyle(element) : element['currentStyle']; // currentStyle for IE < 9\n const isInput = element.nodeName === 'INPUT';\n\n // Default textarea styles\n style.whiteSpace = 'pre-wrap';\n if (!isInput) {\n style.wordWrap = 'break-word'; // only for textarea-s\n }\n\n // Position off-screen\n style.position = 'absolute'; // required to return coordinates properly\n if (!debug) {\n style.visibility = 'hidden'; // not 'display: none' because we want rendering\n }\n // Transfer the element's properties to the div\n properties.forEach(function (prop) {\n if (isInput && prop === 'lineHeight') {\n // Special case for <input>s because text is rendered centered and line height may be != height\n if (computed.boxSizing === 'border-box') {\n const height = parseInt(computed.height, 10);\n const outerHeight =\n parseInt(computed.paddingTop, 10) +\n parseInt(computed.paddingBottom, 10) +\n parseInt(computed.borderTopWidth, 10) +\n parseInt(computed.borderBottomWidth, 10);\n const targetHeight = outerHeight + parseInt(computed.lineHeight, 10);\n if (height > targetHeight) {\n style.lineHeight = height - outerHeight + 'px';\n } else if (height === targetHeight) {\n style.lineHeight = computed.lineHeight;\n } else {\n style.lineHeight = '0';\n }\n } else {\n style.lineHeight = computed.height;\n }\n } else {\n style[prop] = computed[prop];\n }\n });\n\n if (isFirefox) {\n // Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275\n if (element.scrollHeight > parseInt(computed.height, 10)) {\n style.overflowY = 'scroll';\n }\n } else {\n style.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll'\n }\n\n div.textContent = element.value.substring(0, position);\n // The second special handling for input type=\"text\" vs textarea:\n // spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037\n if (isInput) {\n div.textContent = div.textContent.replace(/\\s/g, '\\u00a0');\n }\n\n const span = document.createElement('span');\n // Wrapping must be replicated *exactly*, including when a long word gets\n // onto the next line, with whitespace at the end of the line before (#7).\n // The *only* reliable way to do that is to copy the *entire* rest of the\n // textarea's content into the <span> created at the caret position.\n // For inputs, just '.' would be enough, but no need to bother.\n span.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all\n div.appendChild(span);\n\n const coordinates = {\n top: span.offsetTop + parseInt(computed['borderTopWidth'], 10),\n left: span.offsetLeft + parseInt(computed['borderLeftWidth'], 10),\n height: parseInt(computed['lineHeight'], 10)\n };\n\n if (debug) {\n span.style.backgroundColor = '#aaa';\n } else {\n document.body.removeChild(div);\n }\n\n return coordinates;\n }\n\n static getEditableCaretCoordinates(element: HTMLElement): CaretCoordinates {\n if (window.getSelection().rangeCount) {\n const range = window.getSelection().getRangeAt(0);\n const rect = range.getBoundingClientRect();\n // using the start or endcontainer is... uhm yeah... difficult...? :D\n let height: string | number =\n range.startContainer.nodeType === 1\n ? getComputedStyle(range.startContainer as Element).lineHeight\n : getComputedStyle(range.startContainer.parentNode as Element).lineHeight;\n if (isNaN(height as any)) {\n let node = range.startContainer as HTMLElement;\n if (range.startContainer.nodeType !== 1) {\n node = node.parentNode as HTMLElement;\n }\n const current = node.style.lineHeight;\n node.style.lineHeight = '1em';\n height = parseInt(getComputedStyle(node).lineHeight, 10);\n node.style.lineHeight = current != null ? current : '';\n if (!node.getAttribute('style').length) {\n // clean up if empty\n node.removeAttribute('style');\n }\n }\n const editableRect = element.getBoundingClientRect();\n return {\n top: rect.top - editableRect.top,\n left: rect.left - editableRect.left,\n height: height as number\n };\n } else {\n return {\n top: 0,\n left: 0,\n height: 0\n };\n }\n }\n\n static getCaretCoordinates(element: AllElement, position: number, options?: CaretOptions) {\n const isInput = ['INPUT', 'TEXTAREA'].indexOf(element.nodeName) >= 0;\n if (isInput) {\n return this.getTextareaCaretCoordinates(element as InputOrTextAreaElement, position, options);\n } else {\n return this.getEditableCaretCoordinates(element);\n }\n }\n\n // get caret position in view window\n static getCaretPosition(element: AllElement, position: number, options?: CaretOptions) {\n const coordinates = CaretPositioner.getCaretCoordinates(element, position, options);\n const elementOffset = getElementOffset(element);\n return {\n top: coordinates.top + elementOffset.top,\n left: coordinates.left + elementOffset.left\n };\n }\n}\n","import { ThySelectionListChange, ThySelectionList } from 'ngx-tethys/list';\nimport { ThyPopoverRef } from 'ngx-tethys/popover';\nimport { Observable, of, Subject } from 'rxjs';\nimport { catchError, debounceTime, switchMap, take } from 'rxjs/operators';\nimport { Component, ElementRef, NgZone, OnDestroy, OnInit, inject, signal, input } from '@angular/core';\nimport { SeekQueryResult } from '../adapter/adapter';\nimport { Mention, MentionDefaultDataItem, MentionSuggestionSelectEvent } from '../interfaces';\nimport { ThyListOption } from 'ngx-tethys/shared';\nimport { ThyLoading } from 'ngx-tethys/loading';\nimport { NgTemplateOutlet, SlicePipe } from '@angular/common';\n\n/**\n * @private\n */\n@Component({\n selector: 'thy-mention-suggestions',\n templateUrl: './suggestions.component.html',\n imports: [NgTemplateOutlet, ThyLoading, ThySelectionList, ThyListOption, SlicePipe],\n host: { class: 'thy-mention-suggestions' }\n})\nexport class ThyMentionSuggestions<TItem = MentionDefaultDataItem> implements OnInit, OnDestroy {\n readonly mention = input<Mention<TItem>>();\n\n data = signal<TItem[]>([]);\n\n suggestionSelect$ = new Subject<MentionSuggestionSelectEvent>();\n\n debounce = 150;\n\n loadingDone = signal(true);\n\n private search$ = new Subject<SeekQueryResult>();\n\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n private ngZone = inject(NgZone);\n\n private popoverRef = inject<ThyPopoverRef<any>>(ThyPopoverRef);\n\n constructor() {\n this.search$\n .pipe(\n switchMap(query => {\n const data = this.mention().search(query.term, this.mention().data);\n if (data instanceof Observable) {\n this.loadingDone.set(false);\n return (data as Observable<TItem[]>).pipe(debounceTime(this.debounce));\n } else {\n return of(data as TItem[]);\n }\n }),\n catchError(() => {\n this.loadingDone.set(false);\n return of([]);\n })\n )\n .subscribe(data => {\n this.loadingDone.set(true);\n this.data.set(data || []);\n\n if (this.popoverRef) {\n if (this.mention().autoClose && this.data().length === 0) {\n this.popoverRef.close();\n }\n this.ngZone.onStable.pipe(take(1)).subscribe(() => {\n this.popoverRef.updatePosition();\n });\n }\n });\n }\n\n ngOnInit(): void {\n if (this.mention().popoverClass) {\n this.elementRef.nativeElement.classList.add(this.mention().popoverClass);\n }\n }\n\n search(query: SeekQueryResult) {\n this.search$.next(query);\n }\n\n select(item: TItem, event: Event) {\n this.suggestionSelect$.next({ event, item });\n }\n\n selectionChange(event: ThySelectionListChange<TItem>) {\n this.select(event.value, event.event);\n }\n\n ngOnDestroy() {\n this.search$.complete();\n }\n}\n","@if (mention().suggestionsTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"mention().suggestionsTemplateRef\" [ngTemplateOutletContext]=\"{ data: data() }\"></ng-container>\n} @else {\n <thy-loading [thyDone]=\"loadingDone()\"></thy-loading>\n @if (loadingDone()) {\n @if (data()?.length > 0) {\n <thy-selection-list\n thyBindKeyEventContainer=\"body\"\n thyMultiple=\"false\"\n thyAutoActiveFirstItem=\"true\"\n thySpaceKeyEnabled=\"false\"\n [thyScrollContainer]=\"elementRef\"\n (thySelectionChange)=\"selectionChange($event)\">\n @for (item of data() | slice: 0 : mention().limit; track $index) {\n <thy-list-option [thyValue]=\"item\">\n @if (mention().displayTemplateRef) {\n <ng-template *ngTemplateOutlet=\"mention().displayTemplateRef; context: { $implicit: item }\"></ng-template>\n } @else {\n {{ item['name'] || '' }}\n }\n </thy-list-option>\n }\n </thy-selection-list>\n } @else {\n <div class=\"text-desc p-3\">\n {{ mention().emptyText }}\n </div>\n }\n }\n}\n","import { ThyPopover, ThyPopoverConfig, ThyPopoverRef } from 'ngx-tethys/popover';\nimport { EMPTY, fromEvent, Subject } from 'rxjs';\nimport { switchMap, takeUntil } from 'rxjs/operators';\n\nimport { Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, computed, inject, input, output } from '@angular/core';\nimport { NgControl } from '@angular/forms';\n\nimport { createMentionAdapter, MatchedMention, MentionAdapter, MentionInputorElement } from './adapter';\nimport { CaretPositioner } from './caret-positioner';\nimport { Mention, MentionDefaultDataItem, MentionSuggestionSelectEvent } from './interfaces';\nimport { ThyMentionSuggestions } from './suggestions/suggestions.component';\nimport { isInputOrTextarea } from 'ngx-tethys/util';\n\nconst SUGGESTION_BACKDROP_CLASS = 'thy-mention-suggestions-backdrop';\n\nconst POPOVER_DEFAULT_CONFIG = { backdropClass: SUGGESTION_BACKDROP_CLASS, placement: 'bottomLeft' };\n\nconst DEFAULT_MENTION_CONFIG: Partial<Mention> = {\n autoClose: true,\n emptyText: '无匹配数据,按空格完成输入',\n search: (term: string, data: MentionDefaultDataItem[]) => {\n return data.filter(item => {\n return !item.name || item.name.toLowerCase().includes(term.toLowerCase());\n });\n }\n};\n\n/**\n * @name thyMention\n * @order 10\n */\n@Directive({ selector: '[thyMention]' })\nexport class ThyMentionDirective implements OnInit, OnDestroy {\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private thyPopover = inject(ThyPopover);\n private ngControl = inject(NgControl, { optional: true, self: true })!;\n\n private adapter: MentionAdapter = null;\n\n public openedSuggestionsRef: ThyPopoverRef<ThyMentionSuggestions>;\n\n /**\n * 提及输入配置参数,同时支持多个提及规则\n * @type Mention<any>[]\n */\n readonly thyMention = input<Mention<any>[]>([]);\n\n /**\n * Popover 弹出层参数配置\n */\n readonly thyPopoverConfig = input<ThyPopoverConfig>();\n\n /**\n * 选择后的回调函数\n */\n readonly thySelectSuggestion = output<MentionSuggestionSelectEvent>();\n\n get isOpened() {\n return !!this.openedSuggestionsRef;\n }\n\n mentions = computed(() => {\n if (this.thyMention()) {\n return this.thyMention().map(mention => {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !mention.trigger) {\n throw new Error(`mention trigger is required`);\n }\n return Object.assign({}, DEFAULT_MENTION_CONFIG, mention);\n });\n } else {\n return [];\n }\n });\n\n private destroy$ = new Subject<void>();\n\n private openedSuggestionsRef$ = new Subject<ThyPopoverRef<ThyMentionSuggestions> | null>();\n\n constructor() {\n const elementRef = this.elementRef;\n\n this.adapter = createMentionAdapter(elementRef.nativeElement as MentionInputorElement);\n }\n\n ngOnInit() {\n fromEvent(this.elementRef.nativeElement, 'input')\n .pipe(takeUntil(this.destroy$))\n .subscribe(event => this.onInput(event));\n\n fromEvent(this.elementRef.nativeElement, 'click')\n .pipe(takeUntil(this.destroy$))\n .subscribe(event => this.onClick(event));\n\n this.openedSuggestionsRef$\n .pipe(\n switchMap(openedSuggestionsRef =>\n // Re-subscribe to `suggestionSelect$` every time the suggestions component is re-created,\n // otherwise, unsubscribe, if it gets closed.\n openedSuggestionsRef ? openedSuggestionsRef.componentInstance.suggestionSelect$ : EMPTY\n ),\n takeUntil(this.destroy$)\n )\n .subscribe(event => {\n const newValue = this.adapter.insertMention(event.item);\n if (isInputOrTextarea(this.elementRef.nativeElement)) {\n if (this.ngControl && this.ngControl.control) {\n this.ngControl.control.setValue(newValue);\n }\n } else {\n this.elementRef.nativeElement.innerText = newValue;\n }\n this.openedSuggestionsRef.close();\n this.thySelectSuggestion.emit(event);\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n }\n\n onClick(event: Event) {\n this.lookup(event);\n }\n\n onInput(event: Event) {\n this.lookup(event);\n }\n\n private lookup(event: Event) {\n const matched = this.adapter.lookup(event, this.mentions());\n if (matched) {\n this.openSuggestions(matched);\n } else {\n this.closeSuggestions();\n }\n }\n\n private openSuggestions(matched: MatchedMention) {\n if (!this.openedSuggestionsRef) {\n const inputElement = this.elementRef.nativeElement as HTMLInputElement;\n const position = CaretPositioner.getCaretPosition(inputElement, matched.query.start);\n const fontSize = parseInt(getComputedStyle(this.elementRef.nativeElement).fontSize, 10);\n this.openedSuggestionsRef = this.thyPopover.open(\n ThyMentionSuggestions,\n Object.assign(\n {},\n POPOVER_DEFAULT_CONFIG,\n {\n origin: this.elementRef,\n originPosition: { x: position.left, y: position.top, width: fontSize, height: fontSize },\n initialState: { mention: matched.mention }\n },\n this.thyPopoverConfig()\n )\n );\n this.openedSuggestionsRef.afterClosed().subscribe(() => {\n this.openedSuggestionsRef = null;\n this.openedSuggestionsRef$.next(null);\n });\n\n this.openedSuggestionsRef$.next(this.openedSuggestionsRef);\n }\n\n if (this.openedSuggestionsRef) {\n this.openedSuggestionsRef.componentInstance.search(matched.query);\n }\n }\n\n private closeSuggestions() {\n if (this.openedSuggestionsRef) {\n this.openedSuggestionsRef.close();\n }\n }\n}\n","import { ThyListModule } from 'ngx-tethys/list';\nimport { ThyLoadingModule } from 'ngx-tethys/loading';\nimport { ThyPopoverModule } from 'ngx-tethys/popover';\n\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { ThyMentionDirective } from './mention.directive';\nimport { ThyMentionSuggestions } from './suggestions/suggestions.component';\n\n@NgModule({\n imports: [CommonModule, FormsModule, ThyPopoverModule, ThyListModule, ThyLoadingModule, ThyMentionDirective, ThyMentionSuggestions],\n exports: [ThyMentionDirective],\n providers: []\n})\nexport class ThyMentionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAcsB,cAAc,CAAA;AAKhC,IAAA,WAAA,CAAY,OAA8B,EAAA;AACtC,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;IAC1B;IAMA,MAAM,CAAC,KAAY,EAAE,QAAmB,EAAA;AACpC,QAAA,IAAI,CAAC,cAAc,GAAG,IAAI;AAC1B,QAAA,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC;YAC5C,IAAI,KAAK,EA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ys-mention.mjs","sources":["../../../src/mention/adapter/adapter.ts","../../../src/mention/adapter/textarea.adapter.ts","../../../src/mention/adapter/editable.adapter.ts","../../../src/mention/adapter/index.ts","../../../src/mention/caret-positioner.ts","../../../src/mention/suggestions/suggestions.component.ts","../../../src/mention/suggestions/suggestions.component.html","../../../src/mention/mention.directive.ts","../../../src/mention/mention.module.ts","../../../src/mention/ngx-tethys-mention.ts"],"sourcesContent":["import { SafeAny } from 'ngx-tethys/types';\nimport { MentionDefaultDataItem, Mention } from '../interfaces';\n\nexport interface SeekQueryResult {\n term: string;\n start: number;\n end: number;\n}\n\nexport interface MatchedMention<T = MentionDefaultDataItem> {\n query: SeekQueryResult;\n mention: Mention<T>;\n}\n\nexport type MentionInputorElement = HTMLTextAreaElement | HTMLInputElement;\nexport abstract class MentionAdapter {\n inputor: MentionInputorElement;\n\n matchedMention: MatchedMention | null = null;\n\n constructor(inputor: MentionInputorElement) {\n this.inputor = inputor;\n }\n\n abstract seekQuery(event: Event, mention: Mention): SeekQueryResult | null;\n\n abstract insertMention(item: MentionDefaultDataItem): string;\n\n lookup(event: Event, mentions: Mention[]) {\n this.matchedMention = null;\n for (const mention of mentions) {\n const query = this.seekQuery(event, mention);\n if (query) {\n this.matchedMention = {\n query: query,\n mention: mention as SafeAny\n };\n break;\n }\n }\n return this.matchedMention;\n }\n}\n","import { MentionAdapter, MentionInputorElement, SeekQueryResult } from './adapter';\nimport { Mention, MentionDefaultDataItem } from '../interfaces';\n\nexport class TextareaMentionAdapter extends MentionAdapter {\n inputor!: MentionInputorElement;\n\n constructor(inputor: MentionInputorElement) {\n super(inputor);\n }\n\n public seekQuery(event: Event, mention: Mention): SeekQueryResult | null {\n const selectionStart = this.inputor.selectionStart;\n const value = this.inputor.value.replace(/[\\r\\n]/g, ' ');\n // @123 | @456 => 0(start) => @123\n // @123 @456 | => 5(start) => @456\n const start = value.lastIndexOf(mention.trigger, selectionStart!);\n const fistSpaceIndexFromStart = value.indexOf(' ', selectionStart!);\n const end = fistSpaceIndexFromStart > -1 ? fistSpaceIndexFromStart : value.length;\n const termWithTrigger = value.substring(start, end);\n const startBeforeHasSpace = start > 0 && value[start - 1] === ' ';\n if ((startBeforeHasSpace || start === 0) && !termWithTrigger.includes(' ') && !termWithTrigger.includes(mention.trigger, 1)) {\n return {\n start: start,\n end: end,\n term: termWithTrigger.substring(mention.trigger.length)\n };\n } else {\n return null;\n }\n }\n\n public insertMention(item: MentionDefaultDataItem): string {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !this.matchedMention) {\n throw new Error(`matchedMention is null`);\n }\n const insertValue = this.getInsertValue(item);\n const value: string = this.inputor.value;\n const newValue = [\n value.slice(0, this.matchedMention!.query.start),\n insertValue,\n value.slice(this.matchedMention!.query.end, value.length)\n ].join('');\n this.inputor.value = newValue;\n this.focus(this.matchedMention!.query.start + insertValue.length);\n return newValue;\n }\n\n private getInsertValue(item: MentionDefaultDataItem) {\n if (this.matchedMention?.mention.insertTransform) {\n return `${this.matchedMention.mention.insertTransform(item).trim() } `;\n } else {\n return `${`${this.matchedMention?.mention.trigger}${item['name']}`.trim() } `;\n }\n }\n\n private focus(caretPosition: number): void {\n this.inputor.focus();\n this.inputor.setSelectionRange(caretPosition, caretPosition);\n }\n\n private isEditable() {\n return !this.inputor.readOnly && !this.inputor.disabled;\n }\n}\n","import { MentionAdapter, MentionInputorElement, SeekQueryResult } from './adapter';\nimport { Mention, MentionDefaultDataItem } from '../interfaces';\n\nexport class EditableMentionAdapter extends MentionAdapter {\n inputor!: MentionInputorElement;\n\n constructor(inputor: MentionInputorElement) {\n super(inputor);\n }\n\n seekQuery(event: Event, mention: Mention): SeekQueryResult | null {\n const selectionStart = getSelection()?.focusOffset;\n const value = this.inputor.innerText.replace(/[\\r\\n]/g, ' ');\n const start = value.lastIndexOf(mention.trigger, selectionStart);\n const fistSpaceIndexFromStart = value.indexOf(' ', selectionStart);\n const end = fistSpaceIndexFromStart > -1 ? fistSpaceIndexFromStart : value.length;\n const termWithTrigger = value.substring(start, end);\n const startBeforeHasSpace = start > 0 && value[start - 1] === ' ';\n if ((startBeforeHasSpace || start === 0) && !termWithTrigger.includes(' ') && !termWithTrigger.includes(mention.trigger, 1)) {\n return {\n start: start,\n end: end,\n term: termWithTrigger.substring(mention.trigger.length)\n };\n } else {\n return null;\n }\n }\n\n insertMention(item: MentionDefaultDataItem): string {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !this.matchedMention) {\n throw new Error(`matchedMention is null`);\n }\n const insertValue = this.getInsertValue(item);\n const value: string = this.inputor.innerText;\n const newValue = [\n value.slice(0, this.matchedMention!.query.start),\n insertValue,\n value.slice(this.matchedMention!.query.end, value.length)\n ].join('');\n this.inputor.value = newValue;\n return newValue;\n }\n\n private getInsertValue(item: MentionDefaultDataItem) {\n if (this.matchedMention?.mention.insertTransform) {\n return `${this.matchedMention!.mention.insertTransform(item).trim() } `;\n } else {\n return `${`${this.matchedMention?.mention.trigger}${item['name']}`.trim() } `;\n }\n }\n}\n","import { isInputOrTextarea } from 'ngx-tethys/util';\nimport { TextareaMentionAdapter } from './textarea.adapter';\nimport { EditableMentionAdapter } from './editable.adapter';\nimport { MentionInputorElement } from './adapter';\n\nexport function createMentionAdapter(element: MentionInputorElement) {\n if (isInputOrTextarea(element)) {\n return new TextareaMentionAdapter(element);\n } else {\n element.contentEditable = 'true';\n return new EditableMentionAdapter(element);\n }\n}\n\nexport * from './editable.adapter';\nexport * from './textarea.adapter';\nexport * from './adapter';\n","import { Injectable } from '@angular/core';\nimport { getElementOffset } from 'ngx-tethys/util';\nimport { SafeAny } from 'ngx-tethys/types';\n\nexport interface CaretCoordinates {\n top: number;\n left: number;\n height: number;\n}\n\nexport interface CaretOptions {\n debug: boolean;\n}\n\n// We'll copy the properties below into the mirror div.\n// Note that some browsers, such as Firefox, do not concatenate properties\n// into their shorthand (e.g. padding-top, padding-bottom etc. -> padding),\n// so we have to list every single property explicitly.\nconst properties: string[] = [\n 'direction', // RTL support\n 'boxSizing',\n 'width', // on Chrome and IE, exclude the scrollbar, so the mirror div wraps exactly as the textarea does\n 'height',\n 'overflowX',\n 'overflowY', // copy the scrollbar for IE\n\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderStyle',\n\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/font\n 'fontStyle',\n 'fontVariant',\n 'fontWeight',\n 'fontStretch',\n 'fontSize',\n 'fontSizeAdjust',\n 'lineHeight',\n 'fontFamily',\n\n 'textAlign',\n 'textTransform',\n 'textIndent',\n 'textDecoration', // might not make a difference, but better be safe\n\n 'letterSpacing',\n 'wordSpacing',\n\n 'tabSize',\n 'MozTabSize'\n];\n\nconst isBrowser = typeof window !== 'undefined';\n// @ts-ignore\nconst isFirefox = isBrowser && window['mozInnerScreenX'] != null;\n\nexport type InputOrTextAreaElement = HTMLInputElement | HTMLTextAreaElement;\nexport type AllElement = InputOrTextAreaElement | HTMLElement;\n\nexport class CaretPositioner {\n // get caret coordinates in input or textarea\n // copy from repo: https://github.com/component/textarea-caret-position\n static getTextareaCaretCoordinates(element: InputOrTextAreaElement, position: number, options?: CaretOptions): CaretCoordinates {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !isBrowser) {\n throw new Error('textarea-caret-position#getCaretCoordinates should only be called in a browser');\n }\n\n const debug = (options && options.debug) || false;\n if (debug) {\n const el = document.querySelector('#input-textarea-caret-position-mirror-div');\n if (el) {\n el.parentNode?.removeChild(el);\n }\n }\n\n // The mirror div will replicate the textarea's style\n const div = document.createElement('div');\n div.id = 'input-textarea-caret-position-mirror-div';\n document.body.appendChild(div);\n\n const style = div.style;\n // @ts-ignore\n const computed = window.getComputedStyle ? window.getComputedStyle(element) : element['currentStyle']; // currentStyle for IE < 9\n const isInput = element.nodeName === 'INPUT';\n\n // Default textarea styles\n style.whiteSpace = 'pre-wrap';\n if (!isInput) {\n style.wordWrap = 'break-word'; // only for textarea-s\n }\n\n // Position off-screen\n style.position = 'absolute'; // required to return coordinates properly\n if (!debug) {\n style.visibility = 'hidden'; // not 'display: none' because we want rendering\n }\n // Transfer the element's properties to the div\n properties.forEach(function (prop) {\n if (isInput && prop === 'lineHeight') {\n // Special case for <input>s because text is rendered centered and line height may be != height\n if (computed.boxSizing === 'border-box') {\n const height = parseInt(computed.height, 10);\n const outerHeight =\n parseInt(computed.paddingTop, 10) +\n parseInt(computed.paddingBottom, 10) +\n parseInt(computed.borderTopWidth, 10) +\n parseInt(computed.borderBottomWidth, 10);\n const targetHeight = outerHeight + parseInt(computed.lineHeight, 10);\n if (height > targetHeight) {\n style.lineHeight = `${height - outerHeight}px`;\n } else if (height === targetHeight) {\n style.lineHeight = computed.lineHeight;\n } else {\n style.lineHeight = '0';\n }\n } else {\n style.lineHeight = computed.height;\n }\n } else {\n (style as Record<string, SafeAny>)[prop] = computed[prop];\n }\n });\n\n if (isFirefox) {\n // Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275\n if (element.scrollHeight > parseInt(computed.height, 10)) {\n style.overflowY = 'scroll';\n }\n } else {\n style.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll'\n }\n\n div.textContent = element.value.substring(0, position);\n // The second special handling for input type=\"text\" vs textarea:\n // spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037\n if (isInput) {\n div.textContent = div.textContent.replace(/\\s/g, '\\u00a0');\n }\n\n const span = document.createElement('span');\n // Wrapping must be replicated *exactly*, including when a long word gets\n // onto the next line, with whitespace at the end of the line before (#7).\n // The *only* reliable way to do that is to copy the *entire* rest of the\n // textarea's content into the <span> created at the caret position.\n // For inputs, just '.' would be enough, but no need to bother.\n span.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all\n div.appendChild(span);\n\n const coordinates = {\n top: span.offsetTop + parseInt(computed['borderTopWidth'], 10),\n left: span.offsetLeft + parseInt(computed['borderLeftWidth'], 10),\n height: parseInt(computed['lineHeight'], 10)\n };\n\n if (debug) {\n span.style.backgroundColor = '#aaa';\n } else {\n document.body.removeChild(div);\n }\n\n return coordinates;\n }\n\n static getEditableCaretCoordinates(element: HTMLElement): CaretCoordinates {\n if (window.getSelection()?.rangeCount) {\n const range = window.getSelection()!.getRangeAt(0)!;\n const rect = range.getBoundingClientRect();\n // using the start or endcontainer is... uhm yeah... difficult...? :D\n let height: string | number =\n range.startContainer.nodeType === 1\n ? getComputedStyle(range.startContainer as Element).lineHeight\n : getComputedStyle(range.startContainer.parentNode as Element).lineHeight;\n if (isNaN(height as any)) {\n let node = range.startContainer as HTMLElement;\n if (range.startContainer.nodeType !== 1) {\n node = node.parentNode as HTMLElement;\n }\n const current = node.style.lineHeight;\n node.style.lineHeight = '1em';\n height = parseInt(getComputedStyle(node).lineHeight, 10);\n node.style.lineHeight = current != null ? current : '';\n if (!node.getAttribute('style')?.length) {\n // clean up if empty\n node.removeAttribute('style');\n }\n }\n const editableRect = element.getBoundingClientRect();\n return {\n top: rect.top - editableRect.top,\n left: rect.left - editableRect.left,\n height: height as number\n };\n } else {\n return {\n top: 0,\n left: 0,\n height: 0\n };\n }\n }\n\n static getCaretCoordinates(element: AllElement, position: number, options?: CaretOptions) {\n const isInput = ['INPUT', 'TEXTAREA'].indexOf(element.nodeName) >= 0;\n if (isInput) {\n return this.getTextareaCaretCoordinates(element as InputOrTextAreaElement, position, options);\n } else {\n return this.getEditableCaretCoordinates(element);\n }\n }\n\n // get caret position in view window\n static getCaretPosition(element: AllElement, position: number, options?: CaretOptions) {\n const coordinates = CaretPositioner.getCaretCoordinates(element, position, options);\n const elementOffset = getElementOffset(element);\n if (elementOffset) {\n return {\n top: coordinates.top + elementOffset.top,\n left: coordinates.left + elementOffset.left\n };\n }\n }\n}\n","import { ThySelectionListChange, ThySelectionList } from 'ngx-tethys/list';\nimport { ThyPopoverRef } from 'ngx-tethys/popover';\nimport { Observable, of, Subject } from 'rxjs';\nimport { catchError, debounceTime, switchMap, take } from 'rxjs/operators';\nimport { Component, ElementRef, NgZone, OnDestroy, OnInit, inject, signal, input } from '@angular/core';\nimport { SeekQueryResult } from '../adapter/adapter';\nimport { Mention, MentionDefaultDataItem, MentionSuggestionSelectEvent } from '../interfaces';\nimport { ThyListOption } from 'ngx-tethys/shared';\nimport { ThyLoading } from 'ngx-tethys/loading';\nimport { NgTemplateOutlet, SlicePipe } from '@angular/common';\n\n/**\n * @private\n */\n@Component({\n selector: 'thy-mention-suggestions',\n templateUrl: './suggestions.component.html',\n imports: [NgTemplateOutlet, ThyLoading, ThySelectionList, ThyListOption, SlicePipe],\n host: { class: 'thy-mention-suggestions' }\n})\nexport class ThyMentionSuggestions<TItem = MentionDefaultDataItem> implements OnInit, OnDestroy {\n readonly mention = input<Mention<TItem>>();\n\n data = signal<TItem[]>([]);\n\n suggestionSelect$ = new Subject<MentionSuggestionSelectEvent>();\n\n debounce = 150;\n\n loadingDone = signal(true);\n\n private search$ = new Subject<SeekQueryResult>();\n\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n private ngZone = inject(NgZone);\n\n private popoverRef = inject<ThyPopoverRef<any>>(ThyPopoverRef);\n\n constructor() {\n this.search$\n .pipe(\n switchMap(query => {\n const data = this.mention()!.search!(query.term, this.mention()?.data);\n if (data instanceof Observable) {\n this.loadingDone.set(false);\n return (data as Observable<TItem[]>).pipe(debounceTime(this.debounce));\n } else {\n return of(data as TItem[]);\n }\n }),\n catchError(() => {\n this.loadingDone.set(false);\n return of([]);\n })\n )\n .subscribe(data => {\n this.loadingDone.set(true);\n this.data.set(data || []);\n\n if (this.popoverRef) {\n if (this.mention()?.autoClose && this.data().length === 0) {\n this.popoverRef.close();\n }\n this.ngZone.onStable.pipe(take(1)).subscribe(() => {\n this.popoverRef.updatePosition();\n });\n }\n });\n }\n\n ngOnInit(): void {\n if (this.mention()?.popoverClass) {\n this.elementRef.nativeElement.classList.add(this.mention()!.popoverClass!);\n }\n }\n\n search(query: SeekQueryResult) {\n this.search$.next(query);\n }\n\n select(item: TItem, event: Event) {\n this.suggestionSelect$.next({ event, item });\n }\n\n selectionChange(event: ThySelectionListChange<TItem>) {\n this.select(event.value, event.event);\n }\n\n ngOnDestroy() {\n this.search$.complete();\n }\n}\n","@if (mention()?.suggestionsTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"mention().suggestionsTemplateRef\" [ngTemplateOutletContext]=\"{ data: data() }\"></ng-container>\n} @else {\n <thy-loading [thyDone]=\"loadingDone()\"></thy-loading>\n @if (loadingDone()) {\n @if (data()?.length > 0) {\n <thy-selection-list\n thyBindKeyEventContainer=\"body\"\n thyMultiple=\"false\"\n thyAutoActiveFirstItem=\"true\"\n thySpaceKeyEnabled=\"false\"\n [thyScrollContainer]=\"elementRef\"\n (thySelectionChange)=\"selectionChange($event)\">\n @for (item of data() | slice: 0 : mention().limit; track $index) {\n <thy-list-option [thyValue]=\"item\">\n @if (mention().displayTemplateRef) {\n <ng-template *ngTemplateOutlet=\"mention().displayTemplateRef; context: { $implicit: item }\"></ng-template>\n } @else {\n {{ item['name'] || '' }}\n }\n </thy-list-option>\n }\n </thy-selection-list>\n } @else {\n <div class=\"text-desc p-3\">\n {{ mention().emptyText }}\n </div>\n }\n }\n}\n","import { ThyPopover, ThyPopoverConfig, ThyPopoverRef } from 'ngx-tethys/popover';\nimport { EMPTY, fromEvent, Subject } from 'rxjs';\nimport { switchMap, takeUntil } from 'rxjs/operators';\n\nimport { Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, computed, inject, input, output } from '@angular/core';\nimport { NgControl } from '@angular/forms';\n\nimport { createMentionAdapter, MatchedMention, MentionAdapter, MentionInputorElement } from './adapter';\nimport { CaretPositioner } from './caret-positioner';\nimport { Mention, MentionDefaultDataItem, MentionSuggestionSelectEvent } from './interfaces';\nimport { ThyMentionSuggestions } from './suggestions/suggestions.component';\nimport { isInputOrTextarea } from 'ngx-tethys/util';\n\nconst SUGGESTION_BACKDROP_CLASS = 'thy-mention-suggestions-backdrop';\n\nconst POPOVER_DEFAULT_CONFIG = { backdropClass: SUGGESTION_BACKDROP_CLASS, placement: 'bottomLeft' };\n\nconst DEFAULT_MENTION_CONFIG: Partial<Mention<MentionDefaultDataItem>> = {\n autoClose: true,\n emptyText: '无匹配数据,按空格完成输入',\n search: (term: string, data?: MentionDefaultDataItem[]) => {\n return (data || []).filter(item => {\n return !item.name || item.name.toLowerCase().includes(term.toLowerCase());\n });\n }\n};\n\n/**\n * @name thyMention\n * @order 10\n */\n@Directive({ selector: '[thyMention]' })\nexport class ThyMentionDirective implements OnInit, OnDestroy {\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private thyPopover = inject(ThyPopover);\n private ngControl = inject(NgControl, { optional: true, self: true })!;\n\n private adapter!: MentionAdapter;\n\n public openedSuggestionsRef?: ThyPopoverRef<ThyMentionSuggestions> | null;\n\n /**\n * 提及输入配置参数,同时支持多个提及规则\n * @type Mention<any>[]\n */\n readonly thyMention = input<Mention<any>[]>([]);\n\n /**\n * Popover 弹出层参数配置\n */\n readonly thyPopoverConfig = input<ThyPopoverConfig>();\n\n /**\n * 选择后的回调函数\n */\n readonly thySelectSuggestion = output<MentionSuggestionSelectEvent>();\n\n get isOpened() {\n return !!this.openedSuggestionsRef;\n }\n\n mentions = computed(() => {\n if (this.thyMention()) {\n return this.thyMention().map(mention => {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !mention.trigger) {\n throw new Error(`mention trigger is required`);\n }\n return Object.assign({}, DEFAULT_MENTION_CONFIG, mention);\n });\n } else {\n return [];\n }\n });\n\n private destroy$ = new Subject<void>();\n\n private openedSuggestionsRef$ = new Subject<ThyPopoverRef<ThyMentionSuggestions> | null>();\n\n constructor() {\n const elementRef = this.elementRef;\n\n this.adapter = createMentionAdapter(elementRef.nativeElement as MentionInputorElement);\n }\n\n ngOnInit() {\n fromEvent(this.elementRef.nativeElement, 'input')\n .pipe(takeUntil(this.destroy$))\n .subscribe(event => this.onInput(event));\n\n fromEvent(this.elementRef.nativeElement, 'click')\n .pipe(takeUntil(this.destroy$))\n .subscribe(event => this.onClick(event));\n\n this.openedSuggestionsRef$\n .pipe(\n switchMap(openedSuggestionsRef =>\n // Re-subscribe to `suggestionSelect$` every time the suggestions component is re-created,\n // otherwise, unsubscribe, if it gets closed.\n openedSuggestionsRef ? openedSuggestionsRef.componentInstance.suggestionSelect$ : EMPTY\n ),\n takeUntil(this.destroy$)\n )\n .subscribe(event => {\n const newValue = this.adapter.insertMention(event.item);\n if (isInputOrTextarea(this.elementRef.nativeElement)) {\n if (this.ngControl && this.ngControl.control) {\n this.ngControl.control.setValue(newValue);\n }\n } else {\n this.elementRef.nativeElement.innerText = newValue;\n }\n this.openedSuggestionsRef!.close();\n this.thySelectSuggestion.emit(event);\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n }\n\n onClick(event: Event) {\n this.lookup(event);\n }\n\n onInput(event: Event) {\n this.lookup(event);\n }\n\n private lookup(event: Event) {\n const matched = this.adapter.lookup(event, this.mentions());\n if (matched) {\n this.openSuggestions(matched);\n } else {\n this.closeSuggestions();\n }\n }\n\n private openSuggestions(matched: MatchedMention) {\n if (!this.openedSuggestionsRef) {\n const inputElement = this.elementRef.nativeElement as HTMLInputElement;\n const position = CaretPositioner.getCaretPosition(inputElement, matched.query.start)!;\n const fontSize = parseInt(getComputedStyle(this.elementRef.nativeElement).fontSize, 10);\n this.openedSuggestionsRef = this.thyPopover.open<ThyMentionSuggestions>(\n ThyMentionSuggestions,\n Object.assign(\n {},\n POPOVER_DEFAULT_CONFIG,\n {\n origin: this.elementRef,\n originPosition: { x: position.left, y: position.top, width: fontSize, height: fontSize },\n initialState: { mention: matched.mention }\n },\n this.thyPopoverConfig()\n )\n );\n this.openedSuggestionsRef!.afterClosed().subscribe(() => {\n this.openedSuggestionsRef = null;\n this.openedSuggestionsRef$.next(null);\n });\n\n this.openedSuggestionsRef$.next(this.openedSuggestionsRef!);\n }\n\n if (this.openedSuggestionsRef) {\n this.openedSuggestionsRef.componentInstance.search(matched.query);\n }\n }\n\n private closeSuggestions() {\n if (this.openedSuggestionsRef) {\n this.openedSuggestionsRef.close();\n }\n }\n}\n","import { ThyListModule } from 'ngx-tethys/list';\nimport { ThyLoadingModule } from 'ngx-tethys/loading';\nimport { ThyPopoverModule } from 'ngx-tethys/popover';\n\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { ThyMentionDirective } from './mention.directive';\nimport { ThyMentionSuggestions } from './suggestions/suggestions.component';\n\n@NgModule({\n imports: [CommonModule, FormsModule, ThyPopoverModule, ThyListModule, ThyLoadingModule, ThyMentionDirective, ThyMentionSuggestions],\n exports: [ThyMentionDirective],\n providers: []\n})\nexport class ThyMentionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAesB,cAAc,CAAA;AAKhC,IAAA,WAAA,CAAY,OAA8B,EAAA;QAF1C,IAAA,CAAA,cAAc,GAA0B,IAAI;AAGxC,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;IAC1B;IAMA,MAAM,CAAC,KAAY,EAAE,QAAmB,EAAA;AACpC,QAAA,IAAI,CAAC,cAAc,GAAG,IAAI;AAC1B,QAAA,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC;YAC5C,IAAI,KAAK,EAAE;gBACP,IAAI,CAAC,cAAc,GAAG;AAClB,oBAAA,KAAK,EAAE,KAAK;AACZ,oBAAA,OAAO,EAAE;iBACZ;gBACD;YACJ;QACJ;QACA,OAAO,IAAI,CAAC,cAAc;IAC9B;AACH;;ACvCK,MAAO,sBAAuB,SAAQ,cAAc,CAAA;AAGtD,IAAA,WAAA,CAAY,OAA8B,EAAA;QACtC,KAAK,CAAC,OAAO,CAAC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