raise-common-lib 0.0.193 → 0.0.194
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/README.md +57 -57
- package/bundles/raise-common-lib.umd.js +1642 -1564
- package/bundles/raise-common-lib.umd.js.map +1 -1
- package/bundles/raise-common-lib.umd.min.js +1 -1
- package/bundles/raise-common-lib.umd.min.js.map +1 -1
- package/esm2015/lib/dialog/new-action-notification/new-action-notification.component.js +1 -1
- package/esm2015/lib/form/drawer-form/drawer-form.component.js +113 -45
- package/esm2015/lib/form/richtexteditor/index.component.js +4 -7
- package/esm2015/lib/layout/drawer/index.component.js +1 -1
- package/esm2015/lib/layout/page-tab/index.component.js +1 -1
- package/esm2015/public-api.js +1 -2
- package/esm2015/raise-common-lib.js +6 -5
- package/esm5/lib/dialog/new-action-notification/new-action-notification.component.js +1 -1
- package/esm5/lib/form/drawer-form/drawer-form.component.js +124 -46
- package/esm5/lib/form/richtexteditor/index.component.js +4 -7
- package/esm5/lib/layout/drawer/index.component.js +1 -1
- package/esm5/lib/layout/page-tab/index.component.js +1 -1
- package/esm5/public-api.js +1 -2
- package/esm5/raise-common-lib.js +6 -5
- package/fesm2015/raise-common-lib.js +1503 -1435
- package/fesm2015/raise-common-lib.js.map +1 -1
- package/fesm5/raise-common-lib.js +1640 -1562
- package/fesm5/raise-common-lib.js.map +1 -1
- package/lib/form/drawer-form/drawer-form.component.d.ts +10 -5
- package/package.json +1 -1
- package/public-api.d.ts +0 -1
- package/raise-common-lib.d.ts +4 -3
- package/raise-common-lib.metadata.json +1 -1
- package/src/assets/img/arrow_right.svg +4 -4
- package/src/assets/img/calendar-disabled.svg +6 -6
- package/src/assets/img/calendar.svg +6 -6
- package/src/assets/img/calendar_arrow_left.svg +3 -3
- package/src/assets/img/calendar_arrow_right.svg +3 -3
- package/src/assets/img/checked-vector.svg +3 -3
- package/src/assets/img/dialog-close.svg +4 -4
- package/src/assets/img/dialog-grow.svg +6 -6
- package/src/assets/img/dialog-shrink.svg +6 -6
- package/src/assets/img/plus.svg +4 -4
- package/src/assets/img/search.svg +4 -4
- package/src/assets/img/shrink-icon.svg +6 -6
- package/src/assets/img/time-disabled.svg +4 -4
- package/src/assets/img/time.svg +4 -4
- package/src/assets/img/toolbar-action-addFolder.svg +17 -17
- package/src/assets/img/toolbar-action-calculator.svg +11 -11
- package/src/assets/img/toolbar-action-collapse.svg +7 -7
- package/src/assets/img/toolbar-action-combine.svg +4 -4
- package/src/assets/img/toolbar-action-edit.svg +4 -4
- package/src/assets/img/toolbar-action-expand.svg +7 -7
- package/src/assets/img/toolbar-action-folderMove.svg +8 -8
- package/src/assets/img/toolbar-action-lock.svg +6 -6
- package/src/assets/img/toolbar-action-preview.svg +7 -7
- package/src/assets/img/toolbar-action-publish.svg +5 -5
- package/src/assets/img/toolbar-action-reminders.svg +10 -10
- package/src/assets/img/toolbar-action-rename.svg +7 -7
- package/src/assets/img/toolbar-action-saveSequence.svg +5 -5
- package/src/assets/img/toolbar-action-send-file.svg +5 -5
- package/src/assets/img/toolbar-action-settle.svg +7 -7
- package/src/assets/img/toolbar-action-share.svg +5 -5
- package/src/assets/img/toolbar-action-submitForApproval.svg +4 -4
- package/src/assets/img/toolbar-action-sync.svg +4 -4
- package/src/assets/img/toolbar-action-template.svg +6 -6
- package/src/assets/img/toolbar-action-workflow.svg +9 -9
- package/src/assets/style/reset/grid.scss +2 -1
|
@@ -15,22 +15,22 @@ import { setCulture, L10n } from '@syncfusion/ej2-base';
|
|
|
15
15
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
16
16
|
import { Query } from '@syncfusion/ej2-data';
|
|
17
17
|
import moment from 'moment';
|
|
18
|
-
import { DropDownListModule, DropDownTreeModule, MultiSelectAllModule, AutoCompleteModule, ListBoxModule } from '@syncfusion/ej2-angular-dropdowns';
|
|
19
|
-
import { RichTextEditorAllModule, HtmlEditorService, ToolbarService as ToolbarService$2 } from '@syncfusion/ej2-angular-richtexteditor';
|
|
20
|
-
import { SwitchModule, CheckBoxModule, RadioButtonModule, ButtonModule, ChipListModule } from '@syncfusion/ej2-angular-buttons';
|
|
21
|
-
import { DropDownButton, DropDownButtonModule, SplitButtonModule } from '@syncfusion/ej2-angular-splitbuttons';
|
|
22
|
-
import { TooltipModule, DialogModule } from '@syncfusion/ej2-angular-popups';
|
|
23
18
|
import { MatIconRegistry, MatIconModule } from '@angular/material/icon';
|
|
24
19
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
25
20
|
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
26
21
|
import { CommonModule } from '@angular/common';
|
|
22
|
+
import { SwitchModule, CheckBoxModule, RadioButtonModule, ButtonModule, ChipListModule } from '@syncfusion/ej2-angular-buttons';
|
|
27
23
|
import { DiagramModule } from '@syncfusion/ej2-angular-diagrams';
|
|
24
|
+
import { TooltipModule, DialogModule } from '@syncfusion/ej2-angular-popups';
|
|
28
25
|
import { DatePickerModule, DateRangePickerModule, DateTimePickerModule } from '@syncfusion/ej2-angular-calendars';
|
|
29
26
|
import { TextBoxModule, ColorPickerModule, UploaderModule, NumericTextBoxModule } from '@syncfusion/ej2-angular-inputs';
|
|
27
|
+
import { DropDownListModule, DropDownTreeModule, MultiSelectAllModule, AutoCompleteModule, ListBoxModule } from '@syncfusion/ej2-angular-dropdowns';
|
|
30
28
|
import { PivotViewAllModule, PivotFieldListAllModule } from '@syncfusion/ej2-angular-pivotview';
|
|
31
29
|
import { ChartAllModule, AccumulationChartAllModule, RangeNavigatorAllModule, AccumulationChartModule, PieSeriesService, AccumulationLegendService, AccumulationTooltipService, AccumulationAnnotationService, AccumulationDataLabelService } from '@syncfusion/ej2-angular-charts';
|
|
32
30
|
import { DashboardLayoutModule } from '@syncfusion/ej2-angular-layouts';
|
|
33
31
|
import { PdfViewerModule, LinkAnnotationService, BookmarkViewService, MagnificationService, ThumbnailViewService, ToolbarService as ToolbarService$1, NavigationService, TextSearchService, TextSelectionService, PrintService } from '@syncfusion/ej2-angular-pdfviewer';
|
|
32
|
+
import { DropDownButton, DropDownButtonModule, SplitButtonModule } from '@syncfusion/ej2-angular-splitbuttons';
|
|
33
|
+
import { RichTextEditorAllModule, HtmlEditorService, ToolbarService as ToolbarService$2 } from '@syncfusion/ej2-angular-richtexteditor';
|
|
34
34
|
import { MatMenuModule } from '@angular/material/menu';
|
|
35
35
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
36
36
|
|
|
@@ -1523,7 +1523,7 @@ NewActionNotificationComponent.decorators = [
|
|
|
1523
1523
|
{ type: Component, args: [{
|
|
1524
1524
|
selector: "kt-new-action-notification",
|
|
1525
1525
|
template: "<div class=\"new-action-notification-container\" [attr.data-collapse]=\"collapsed\">\r\n\t<span\r\n\t\tclass=\"notification-icon\"\r\n\t\t[attr.data-type]=\"config.type === 'Loading' ? 'loading' : 'default'\"\r\n\t\t[attr.data-status]=\"config.status?.toLowerCase()\"\r\n\t\t(click)=\"expandNotification()\"\r\n\t></span>\r\n\t<span\r\n\t\tclass=\"notification-icon notification-loading\"\r\n\t\t*ngIf=\"config.type === 'Progress'\"\r\n\t></span>\r\n\t<div class=\"notification-content\">\r\n\t\t<span *ngIf=\"config.type === 'Detail'\" class=\"notification-title\">\r\n\t\t\t{{ config.title }}\r\n\t\t</span>\r\n\t\t<span class=\"notification-text\">{{ config.message }}</span>\r\n\t\t<a *ngIf=\"config.type === 'Detail'\" class=\"notification-link\">View</a>\r\n\t</div>\r\n\t<button\r\n\t\ttype=\"button\"\r\n\t\tclass=\"notification-close\"\r\n\t\t[attr.data-type]=\"config.type === 'Loading' ? 'loading' : 'default'\"\r\n\t\t(click)=\"closeNotification()\"\r\n\t></button>\r\n</div>\r\n",
|
|
1526
|
-
styles: ["::ng-deep .new-action-notification{margin:0;padding:64px 12px;background-color:transparent!important;background-image:none!important;box-shadow:none}::ng-deep .mat-mdc-snack-bar-container .mdc-snackbar__surface{box-shadow:none;background-color:transparent}.new-action-notification-container{min-width:320px;max-width:400px;padding:12px;border-radius:10px;background-color:#fff;box-shadow:0 0 8px 0 #00000033;display:flex;flex-flow:row nowrap;align-items:flex-start;justify-content:flex-end}.new-action-notification-container .notification-icon{flex:none;width:24px;height:24px;margin-right:8px}.new-action-notification-container .notification-icon[data-type=default][data-status=success]::before{content:url(
|
|
1526
|
+
styles: ["::ng-deep .new-action-notification{margin:0;padding:64px 12px;background-color:transparent!important;background-image:none!important;box-shadow:none}::ng-deep .mat-mdc-snack-bar-container .mdc-snackbar__surface{box-shadow:none;background-color:transparent}.new-action-notification-container{min-width:320px;max-width:400px;padding:12px;border-radius:10px;background-color:#fff;box-shadow:0 0 8px 0 #00000033;display:flex;flex-flow:row nowrap;align-items:flex-start;justify-content:flex-end}.new-action-notification-container .notification-icon{flex:none;width:24px;height:24px;margin-right:8px}.new-action-notification-container .notification-icon[data-type=default][data-status=success]::before{content:url(../../../assets/img/notification-status-success.svg)}.new-action-notification-container .notification-icon[data-type=default][data-status=warning]::before{content:url(../../../assets/img/notification-status-warning.svg)}.new-action-notification-container .notification-icon[data-type=default][data-status=error]::before{content:url(../../../assets/img/notification-status-error.svg)}.new-action-notification-container .notification-icon[data-type=loading]{-webkit-animation:2s linear infinite rotate;animation:2s linear infinite rotate}@-webkit-keyframes rotate{from{transform:rotate(360deg)}to{transform:rotate(0)}}@keyframes rotate{from{transform:rotate(360deg)}to{transform:rotate(0)}}.new-action-notification-container .notification-icon[data-type=loading]::before{content:url(../../../assets/img/notification-status-loading.svg)}.new-action-notification-container .notification-close{flex:none;height:24px;margin-left:24px;padding:0;border:none;background-color:transparent}.new-action-notification-container .notification-close[data-type=default]::before{content:url(../../../assets/img/notification-close.svg)}.new-action-notification-container .notification-close[data-type=loading]::before{content:url(../../../assets/img/notification-collapse.svg)}.new-action-notification-container .notification-content{flex:auto;min-height:24px;padding-top:4px;display:flex;flex-flow:column nowrap}.new-action-notification-container .notification-content .notification-title{margin-bottom:8px;color:#44566c;font-family:Arial;font-size:13px;font-style:normal;font-weight:700;line-height:19px}.new-action-notification-container .notification-content .notification-text{color:#1f3f5c;font-family:Arial;font-size:12px;font-style:normal;font-weight:400;line-height:16px}.new-action-notification-container .notification-content .notification-link{margin-top:6px;cursor:pointer;color:#1364b3;font-family:Arial;font-size:12px;font-style:normal;font-weight:400;line-height:14px}.new-action-notification-container[data-collapse=true]{padding:0;background-color:transparent;box-shadow:none}.new-action-notification-container[data-collapse=true] .notification-icon{cursor:pointer}.new-action-notification-container[data-collapse=true] .notification-close,.new-action-notification-container[data-collapse=true] .notification-content{display:none}"]
|
|
1527
1527
|
}] }
|
|
1528
1528
|
];
|
|
1529
1529
|
/** @nocollapse */
|
|
@@ -2462,7 +2462,7 @@ RsPageTabComponent.decorators = [
|
|
|
2462
2462
|
{ type: Component, args: [{
|
|
2463
2463
|
selector: "rs-page-tab",
|
|
2464
2464
|
template: "<div class=\"rs-page-list-wrap\">\r\n <ng-container *ngIf=\"customPageTitle; else defaultTitle\">\r\n <ng-content select=\"[titleSlot]\"></ng-content>\r\n </ng-container>\r\n <ng-template #defaultTitle>\r\n <div class=\"rs-page-title\" *ngIf=\"pageTitle\">{{ pageTitle }}</div>\r\n </ng-template>\r\n <ejs-tab\r\n class=\"rs-tab\"\r\n #tabObj\r\n (selected)=\"onTabClick($event)\"\r\n [animation]=\"animation\"\r\n\t overflowMode=\"Popup\"\r\n heightAdjustMode=\"None\"\r\n [selectedItem]=\"selectedItemIndex\"\r\n >\r\n <e-tabitems>\r\n <e-tabitem *ngFor=\"let item of tabList\">\r\n <ng-template #headerText>\r\n <div>{{ item.title }}</div>\r\n </ng-template>\r\n </e-tabitem>\r\n </e-tabitems>\r\n </ejs-tab>\r\n <div class=\"rs-grid-wrap\">\r\n <ng-content select=\"[tabContentSlot]\"></ng-content>\r\n </div>\r\n</div>\r\n",
|
|
2465
|
-
styles: [".rs-page-list-wrap{height:100%;display:flex;flex-direction:column;position:relative;margin:0 auto;max-width:1885px}.rs-page-list-wrap .rs-page-title{font-family:var(--rs-font-family);font-size:var(--rs-page-title-font-size);font-weight:700;text-align:left;color:var(--rs-page-title-color);display:flex;align-items:center;padding:16px 8px 12px 20px}.rs-page-list-wrap .rs-tab{padding:0 20px}.rs-page-list-wrap .rs-tab .e-tab-header::before{display:none}.rs-page-list-wrap .rs-tab .e-toolbar-items{gap:32px;min-height:36px}.rs-page-list-wrap .rs-tab .e-toolbar-items .e-toolbar-item{border:0}.rs-page-list-wrap .rs-tab .e-toolbar-items .e-toolbar-item .e-tab-wrap{padding:0;border:0;position:relative;height:36px}.rs-page-list-wrap .rs-tab .e-toolbar-items .e-toolbar-item .e-tab-wrap::before{content:\" \";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:transparent}.rs-page-list-wrap .rs-tab .e-toolbar-items .e-toolbar-item .e-tab-text{color:#5f6f81;font-family:Arial;font-size:13px;font-style:normal;font-weight:400;line-height:16px}.rs-page-list-wrap .rs-tab .e-toolbar-items .e-toolbar-item.e-active .e-tab-wrap::before{background-color:#1f7bff}.rs-page-list-wrap .rs-tab .e-toolbar-items .e-toolbar-item.e-active .e-tab-text{color:#44566c}.rs-page-list-wrap .rs-tab .e-hor-nav{width:24px;height:24px;min-height:24px;top:3px;border-radius:4px;background-color:transparent!important;border:1px solid #eaedf0!important}.rs-page-list-wrap .rs-tab .e-hor-nav .e-icons{box-shadow:none;background-color:transparent!important;border-color:transparent!important;background-image:url(
|
|
2465
|
+
styles: [".rs-page-list-wrap{height:100%;display:flex;flex-direction:column;position:relative;margin:0 auto;max-width:1885px}.rs-page-list-wrap .rs-page-title{font-family:var(--rs-font-family);font-size:var(--rs-page-title-font-size);font-weight:700;text-align:left;color:var(--rs-page-title-color);display:flex;align-items:center;padding:16px 8px 12px 20px}.rs-page-list-wrap .rs-tab{padding:0 20px}.rs-page-list-wrap .rs-tab .e-tab-header::before{display:none}.rs-page-list-wrap .rs-tab .e-toolbar-items{gap:32px;min-height:36px}.rs-page-list-wrap .rs-tab .e-toolbar-items .e-toolbar-item{border:0}.rs-page-list-wrap .rs-tab .e-toolbar-items .e-toolbar-item .e-tab-wrap{padding:0;border:0;position:relative;height:36px}.rs-page-list-wrap .rs-tab .e-toolbar-items .e-toolbar-item .e-tab-wrap::before{content:\" \";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:transparent}.rs-page-list-wrap .rs-tab .e-toolbar-items .e-toolbar-item .e-tab-text{color:#5f6f81;font-family:Arial;font-size:13px;font-style:normal;font-weight:400;line-height:16px}.rs-page-list-wrap .rs-tab .e-toolbar-items .e-toolbar-item.e-active .e-tab-wrap::before{background-color:#1f7bff}.rs-page-list-wrap .rs-tab .e-toolbar-items .e-toolbar-item.e-active .e-tab-text{color:#44566c}.rs-page-list-wrap .rs-tab .e-hor-nav{width:24px;height:24px;min-height:24px;top:3px;border-radius:4px;background-color:transparent!important;border:1px solid #eaedf0!important}.rs-page-list-wrap .rs-tab .e-hor-nav .e-icons{box-shadow:none;background-color:transparent!important;border-color:transparent!important;background-image:url(../../../assets/img/icon-more.svg);background-size:14px 3px;background-repeat:no-repeat;background-position:4px 14px}.rs-page-list-wrap .rs-tab .e-hor-nav .e-icons::before{display:none}.rs-page-list-wrap .rs-tab .e-hor-nav .e-icons:hover{background-color:#eff5fb!important;border-color:#b1d0fc!important;background-image:url(../../../assets/img/icon-more-active.svg)}.rs-page-list-wrap .rs-tab .e-toolbar-pop{min-width:160px;border-radius:10px;background:#fff;box-shadow:0 0 8px 0 rgba(0,0,0,.25);padding:8px}.rs-page-list-wrap .rs-tab .e-toolbar-pop .e-toolbar-item .e-tab-wrap{padding:0 8px}.rs-page-list-wrap .rs-tab .e-toolbar-pop .e-toolbar-item .e-tab-wrap .e-tab-text{color:#44566c;font-family:Arial;font-size:13px;font-weight:400;line-height:16px}.rs-page-list-wrap .rs-tab .e-toolbar-pop .e-toolbar-item .e-tab-wrap:hover{border-radius:6px;background:rgba(31,123,255,.05)}.rs-page-list-wrap .rs-grid-wrap{flex:1;height:0}"]
|
|
2466
2466
|
}] }
|
|
2467
2467
|
];
|
|
2468
2468
|
RsPageTabComponent.propDecorators = {
|
|
@@ -3594,7 +3594,7 @@ DrawerComponent.decorators = [
|
|
|
3594
3594
|
{ type: Component, args: [{
|
|
3595
3595
|
selector: "rs-drawer",
|
|
3596
3596
|
template: "<div #element id=\"rs-drawer-container\" class=\"rs-drawer-container\">\r\n <div class=\"rs-drawer-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n <div\r\n #drawer\r\n class=\"rs-drawer\"\r\n [attr.data-mode]=\"config.mode\"\r\n [attr.data-opened]=\"isOpened ? 'yes' : 'no'\"\r\n [attr.data-animation]=\"useAnimation\"\r\n [hidden]=\"hiddenDrawer\"\r\n (animationend)=\"onAnimationEnd()\"\r\n >\r\n <div class=\"drawer-header\" #header>\r\n <button class=\"drawer-return-button\" (click)=\"hide()\">\r\n <span class=\"drawer-sub-title\" *ngIf=\"config.subTitle\">\r\n {{ config.subTitle }}\r\n </span>\r\n </button>\r\n <div class=\"drawer-title\">{{ config.title }}</div>\r\n <div class=\"drawer-header-slot\" #headerSlot></div>\r\n </div>\r\n <div class=\"drawer-top-slot\" #topSlot></div>\r\n <div class=\"drawer-content-box\">\r\n <div class=\"drawer-content\" #content>\r\n <div class=\"drawer-content-container\">\r\n <ng-template #dynamicComponentContainer></ng-template>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"drawer-toolbar-slot\" #toolbarSlot></div>\r\n </div>\r\n</div>\r\n",
|
|
3597
|
-
styles: [":host{display:block;height:100%}#rs-drawer-container{height:100%}.rs-drawer-container{height:100%;background-color:transparent;overflow:hidden;position:relative}.rs-drawer-container .rs-drawer-content{width:100%;height:100%;overflow:auto;margin-right:0!important}.rs-drawer-container .rs-drawer-content::-webkit-scrollbar{width:5px;height:5px;background:#fff;position:static;z-index:999;border-radius:10px}.rs-drawer-container .rs-drawer-content::-webkit-scrollbar-thumb{background:#eaedf0}.rs-drawer-container .rs-drawer{width:100%;height:100%;border-left:none;background-color:transparent;overflow:visible;pointer-events:none;opacity:0;display:flex;flex-flow:column nowrap;position:absolute;z-index:2;top:0;left:100%}.rs-drawer-container .rs-drawer[data-opened=yes]{left:0;opacity:1}.rs-drawer-container .rs-drawer[data-animation=yes][data-opened=yes]{-webkit-animation:.5s ease-in-out drawer-open;animation:.5s ease-in-out drawer-open}@-webkit-keyframes drawer-open{from{left:100%;opacity:0}to{left:0;opacity:1}}@keyframes drawer-open{from{left:100%;opacity:0}to{left:0;opacity:1}}.rs-drawer-container .rs-drawer[data-animation=yes][data-opened=no]{-webkit-animation:.5s ease-in-out drawer-close;animation:.5s ease-in-out drawer-close}@-webkit-keyframes drawer-close{from{left:0;opacity:1}to{left:100%;opacity:0}}@keyframes drawer-close{from{left:0;opacity:1}to{left:100%;opacity:0}}.rs-drawer-container .rs-drawer[hidden]{display:none}.rs-drawer-container .rs-drawer .drawer-header{flex:none;display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:center;box-sizing:content-box;pointer-events:auto}.rs-drawer-container .rs-drawer .drawer-header .drawer-return-button{flex:none;display:flex;flex-flow:row nowrap;align-items:center;padding:0;border:none;background-color:transparent;cursor:pointer}.rs-drawer-container .rs-drawer .drawer-header .drawer-return-button::before{content:url(
|
|
3597
|
+
styles: [":host{display:block;height:100%}#rs-drawer-container{height:100%}.rs-drawer-container{height:100%;background-color:transparent;overflow:hidden;position:relative}.rs-drawer-container .rs-drawer-content{width:100%;height:100%;overflow:auto;margin-right:0!important}.rs-drawer-container .rs-drawer-content::-webkit-scrollbar{width:5px;height:5px;background:#fff;position:static;z-index:999;border-radius:10px}.rs-drawer-container .rs-drawer-content::-webkit-scrollbar-thumb{background:#eaedf0}.rs-drawer-container .rs-drawer{width:100%;height:100%;border-left:none;background-color:transparent;overflow:visible;pointer-events:none;opacity:0;display:flex;flex-flow:column nowrap;position:absolute;z-index:2;top:0;left:100%}.rs-drawer-container .rs-drawer[data-opened=yes]{left:0;opacity:1}.rs-drawer-container .rs-drawer[data-animation=yes][data-opened=yes]{-webkit-animation:.5s ease-in-out drawer-open;animation:.5s ease-in-out drawer-open}@-webkit-keyframes drawer-open{from{left:100%;opacity:0}to{left:0;opacity:1}}@keyframes drawer-open{from{left:100%;opacity:0}to{left:0;opacity:1}}.rs-drawer-container .rs-drawer[data-animation=yes][data-opened=no]{-webkit-animation:.5s ease-in-out drawer-close;animation:.5s ease-in-out drawer-close}@-webkit-keyframes drawer-close{from{left:0;opacity:1}to{left:100%;opacity:0}}@keyframes drawer-close{from{left:0;opacity:1}to{left:100%;opacity:0}}.rs-drawer-container .rs-drawer[hidden]{display:none}.rs-drawer-container .rs-drawer .drawer-header{flex:none;display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:center;box-sizing:content-box;pointer-events:auto}.rs-drawer-container .rs-drawer .drawer-header .drawer-return-button{flex:none;display:flex;flex-flow:row nowrap;align-items:center;padding:0;border:none;background-color:transparent;cursor:pointer}.rs-drawer-container .rs-drawer .drawer-header .drawer-return-button::before{content:url(../../../assets/img/drawer-back.svg);width:24px;height:24px;margin-right:8px;transition:transform 125ms ease-in-out}.rs-drawer-container .rs-drawer .drawer-header .drawer-return-button:hover::before{transform:translateX(-2px)}.rs-drawer-container .rs-drawer .drawer-header .drawer-return-button .drawer-sub-title{margin-right:12px;font-family:Arial;font-style:normal;font-weight:400}.rs-drawer-container .rs-drawer .drawer-header .drawer-title{flex:none;min-height:14px;padding:0 12px;border-left:1px solid #bdc4ca;font-family:Arial;font-style:normal;font-weight:400}.rs-drawer-container .rs-drawer .drawer-header .drawer-title:empty{padding:0}.rs-drawer-container .rs-drawer .drawer-content-box{flex:auto;height:0;background-color:#f7fafb;pointer-events:auto}.rs-drawer-container .rs-drawer .drawer-content{height:100%;padding:0 20px;border:1px solid #ebedf0;border-radius:15px;background-color:#fff;display:flex;flex-flow:column nowrap}.rs-drawer-container .rs-drawer .drawer-content .drawer-content-container{flex:auto;overflow:hidden auto}.rs-drawer-container .rs-drawer .drawer-toolbar-slot{flex:none;height:32px;margin-left:auto;display:flex;flex-flow:row nowrap;justify-content:flex-end;align-items:center;pointer-events:auto}.rs-drawer-container .rs-drawer .drawer-toolbar-slot:empty{display:none}.rs-drawer-container .rs-drawer .drawer-top-slot{flex:none;pointer-events:auto}.rs-drawer-container .rs-drawer .drawer-top-slot:empty{height:var(--drawer-top,0);pointer-events:none}.rs-drawer-container .rs-drawer[data-mode=outer] .drawer-header{height:46px;padding:0 12px 0 8px;background-color:#f7fafb}.rs-drawer-container .rs-drawer[data-mode=outer] .drawer-header .drawer-sub-title,.rs-drawer-container .rs-drawer[data-mode=outer] .drawer-header .drawer-title{color:#1f3f5c;font-size:15px;font-weight:700;line-height:18px}.rs-drawer-container .rs-drawer[data-mode=outer] .drawer-content{padding-bottom:20px}.rs-drawer-container .rs-drawer[data-mode=outer] .drawer-content .drawer-content-container{margin-right:-20px;padding-right:20px}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-top-slot:empty+.drawer-content-box{padding-top:calc((var(--drawer-top,0) + 1) * 16px)}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-header{height:24px;padding:6px 0;border-bottom:1px solid #eaedf0}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-header .drawer-sub-title,.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-header .drawer-title{color:#44566c;font-size:12px;line-height:14px}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-header .drawer-title{font-weight:700}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-content .drawer-content-container{margin-right:-20px;padding-right:20px;padding-left:8px}.rs-drawer-container .rs-drawer[data-mode=inner] .drawer-toolbar-slot{width:100%;padding:16px 0;box-sizing:content-box;border-top:1px solid #eaedf0}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar]{display:flex;flex-flow:row nowrap;justify-content:flex-end;align-items:center;gap:12px}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button{display:flex;flex-flow:row nowrap;justify-content:center;align-items:center;gap:6px;min-width:80px;height:32px;padding:0 12px;border:1px solid #adb5bd;border-radius:4px;background-color:#fff;cursor:pointer;color:#44566c;font-size:13px;font-family:Arial;font-style:normal;font-weight:400;line-height:16px}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button:hover{border-color:#6c7c90}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button:disabled{opacity:1!important;border-color:#6c7c9066;color:#44566c66;cursor:unset}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button.primary{border:none;background-color:#1364b3;color:#fff}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button.primary:hover{background-color:#176bca}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button.primary:disabled{background-color:#1364b366}::ng-deep .rs-drawer-container .rs-drawer .drawer-toolbar-slot [drawer-toolbar] button img{width:16px;height:16px}::ng-deep .rs-drawer-container .rs-drawer[data-mode=outer] .drawer-toolbar-slot [drawer-toolbar] button{height:26px;font-size:12px;line-height:14px}::ng-deep .rs-drawer-container .rs-drawer[data-mode=inner] .drawer-toolbar-slot [drawer-toolbar] button img{display:none}"]
|
|
3598
3598
|
}] }
|
|
3599
3599
|
];
|
|
3600
3600
|
/** @nocollapse */
|
|
@@ -21459,12 +21459,15 @@ const EmailPattern = /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(
|
|
|
21459
21459
|
* Generated from: lib/form/drawer-form/drawer-form.component.ts
|
|
21460
21460
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
21461
21461
|
*/
|
|
21462
|
+
/** @type {?} */
|
|
21463
|
+
const FORM_PROXY_TAG = Symbol.for("form-proxy");
|
|
21462
21464
|
class DrawerFormComponent {
|
|
21463
21465
|
/**
|
|
21464
21466
|
* @param {?} ref
|
|
21465
21467
|
*/
|
|
21466
21468
|
constructor(ref) {
|
|
21467
21469
|
this.ref = ref;
|
|
21470
|
+
this._form = {};
|
|
21468
21471
|
this._sections = [];
|
|
21469
21472
|
this.optionsMap = {};
|
|
21470
21473
|
this.formDisabled = false;
|
|
@@ -21476,12 +21479,14 @@ class DrawerFormComponent {
|
|
|
21476
21479
|
groupBy: null,
|
|
21477
21480
|
};
|
|
21478
21481
|
this.showFilterNumber = 10;
|
|
21479
|
-
this.
|
|
21482
|
+
this.dateFormat = "yyyy-MM-dd";
|
|
21480
21483
|
this.formChange = new EventEmitter();
|
|
21481
21484
|
this.fieldChange = new EventEmitter();
|
|
21482
21485
|
this.sections = [];
|
|
21483
|
-
this.
|
|
21486
|
+
this.form = {};
|
|
21484
21487
|
this.fieldValidMap = {};
|
|
21488
|
+
// 存储 datepicker 的值
|
|
21489
|
+
this.dateForm = {};
|
|
21485
21490
|
this.dateValidMap = {};
|
|
21486
21491
|
this.scrollIndex = 0;
|
|
21487
21492
|
this.isClickAnchor = false;
|
|
@@ -21495,13 +21500,19 @@ class DrawerFormComponent {
|
|
|
21495
21500
|
* @return {?}
|
|
21496
21501
|
*/
|
|
21497
21502
|
ngOnChanges(changes) {
|
|
21503
|
+
if (changes._form) {
|
|
21504
|
+
if (!changes._form.currentValue[FORM_PROXY_TAG]) {
|
|
21505
|
+
this.form = this.getFormProxy(changes._form.currentValue);
|
|
21506
|
+
this.formChange.emit(this.form);
|
|
21507
|
+
}
|
|
21508
|
+
if (!changes._form.firstChange) {
|
|
21509
|
+
this.checkFormChange(changes._form.previousValue, changes._form.currentValue);
|
|
21510
|
+
}
|
|
21511
|
+
}
|
|
21498
21512
|
if (changes._sections) {
|
|
21499
21513
|
this.sections = filterShowSection(changes._sections.currentValue);
|
|
21500
21514
|
this.formatForm(this.sections);
|
|
21501
21515
|
}
|
|
21502
|
-
if (changes.form && !changes.form.firstChange) {
|
|
21503
|
-
this.checkFormChange(changes.form.previousValue, changes.form.currentValue);
|
|
21504
|
-
}
|
|
21505
21516
|
}
|
|
21506
21517
|
/**
|
|
21507
21518
|
* @return {?}
|
|
@@ -21612,6 +21623,18 @@ class DrawerFormComponent {
|
|
|
21612
21623
|
}
|
|
21613
21624
|
}));
|
|
21614
21625
|
}
|
|
21626
|
+
/**
|
|
21627
|
+
* @param {?} field
|
|
21628
|
+
* @param {?} value
|
|
21629
|
+
* @return {?}
|
|
21630
|
+
*/
|
|
21631
|
+
syncFormToDateForm(field, value) {
|
|
21632
|
+
if (value) {
|
|
21633
|
+
/** @type {?} */
|
|
21634
|
+
const date = moment(value);
|
|
21635
|
+
this.dateForm[field.formKey] = date.isValid() ? date.toDate() : null;
|
|
21636
|
+
}
|
|
21637
|
+
}
|
|
21615
21638
|
/**
|
|
21616
21639
|
* @param {?} sections
|
|
21617
21640
|
* @return {?}
|
|
@@ -21642,6 +21665,9 @@ class DrawerFormComponent {
|
|
|
21642
21665
|
case "Switch":
|
|
21643
21666
|
this.form[field.formKey] = false;
|
|
21644
21667
|
break;
|
|
21668
|
+
case "Datepicker":
|
|
21669
|
+
this.syncFormToDateForm(field, this.form[field.formKey]);
|
|
21670
|
+
break;
|
|
21645
21671
|
default:
|
|
21646
21672
|
this.form[field.formKey] = null;
|
|
21647
21673
|
}
|
|
@@ -21649,6 +21675,38 @@ class DrawerFormComponent {
|
|
|
21649
21675
|
}));
|
|
21650
21676
|
}));
|
|
21651
21677
|
}
|
|
21678
|
+
/**
|
|
21679
|
+
* @param {?} form
|
|
21680
|
+
* @return {?}
|
|
21681
|
+
*/
|
|
21682
|
+
getFormProxy(form) {
|
|
21683
|
+
// 现在除了 tag 之外不支持嵌套 form 属性,只对浅层进行处理
|
|
21684
|
+
/** @type {?} */
|
|
21685
|
+
const proxyForm = new Proxy(form, {
|
|
21686
|
+
set: (/**
|
|
21687
|
+
* @param {?} target
|
|
21688
|
+
* @param {?} prop
|
|
21689
|
+
* @param {?} value
|
|
21690
|
+
* @return {?}
|
|
21691
|
+
*/
|
|
21692
|
+
(target, prop, value) => {
|
|
21693
|
+
target[prop] = value;
|
|
21694
|
+
/** @type {?} */
|
|
21695
|
+
const field = this.getField(prop);
|
|
21696
|
+
if (field && field.fieldFormType === "Datepicker") {
|
|
21697
|
+
this.syncFormToDateForm(field, value);
|
|
21698
|
+
}
|
|
21699
|
+
return true;
|
|
21700
|
+
}),
|
|
21701
|
+
});
|
|
21702
|
+
Object.defineProperty(proxyForm, FORM_PROXY_TAG, {
|
|
21703
|
+
value: true,
|
|
21704
|
+
writable: false,
|
|
21705
|
+
enumerable: false,
|
|
21706
|
+
configurable: false,
|
|
21707
|
+
});
|
|
21708
|
+
return proxyForm;
|
|
21709
|
+
}
|
|
21652
21710
|
// 表单提交前会触发这个函数
|
|
21653
21711
|
/**
|
|
21654
21712
|
* @param {?} value
|
|
@@ -21656,11 +21714,8 @@ class DrawerFormComponent {
|
|
|
21656
21714
|
* @return {?}
|
|
21657
21715
|
*/
|
|
21658
21716
|
updateForm(value, field) {
|
|
21659
|
-
|
|
21660
|
-
|
|
21661
|
-
// 修复错误提示显示 bug,不设置一下有概率拿不到最新的值
|
|
21662
|
-
this.form = newForm;
|
|
21663
|
-
this.formChange.emit(newForm);
|
|
21717
|
+
this.form[field.formKey] = value;
|
|
21718
|
+
this.formChange.emit(this.form);
|
|
21664
21719
|
this.fieldChange.emit({ field, value });
|
|
21665
21720
|
}
|
|
21666
21721
|
/**
|
|
@@ -21784,13 +21839,14 @@ class DrawerFormComponent {
|
|
|
21784
21839
|
if (!event.isInteracted) {
|
|
21785
21840
|
return;
|
|
21786
21841
|
}
|
|
21787
|
-
|
|
21788
|
-
|
|
21789
|
-
|
|
21790
|
-
/** @type {?} */
|
|
21791
|
-
const date = moment(value);
|
|
21792
|
-
value = date.isValid() ? date.format("YYYY-MM-DD") : null;
|
|
21842
|
+
if (field.fieldFormType !== "Datepicker") {
|
|
21843
|
+
this.onChange(event.value, field);
|
|
21844
|
+
return;
|
|
21793
21845
|
}
|
|
21846
|
+
console.log("change", event);
|
|
21847
|
+
/** @type {?} */
|
|
21848
|
+
const value = event.value ? moment(event.value).format("YYYY-MM-DD") : null;
|
|
21849
|
+
this.dateForm[field.formKey] = event.value;
|
|
21794
21850
|
this.onChange(value, field);
|
|
21795
21851
|
}
|
|
21796
21852
|
/**
|
|
@@ -21809,16 +21865,19 @@ class DrawerFormComponent {
|
|
|
21809
21865
|
*/
|
|
21810
21866
|
onDatePickerBlur(event, field) {
|
|
21811
21867
|
this.onBlur(field);
|
|
21812
|
-
/**
|
|
21813
|
-
|
|
21814
|
-
|
|
21815
|
-
|
|
21816
|
-
|
|
21817
|
-
|
|
21818
|
-
|
|
21819
|
-
|
|
21820
|
-
|
|
21821
|
-
|
|
21868
|
+
setTimeout((/**
|
|
21869
|
+
* @return {?}
|
|
21870
|
+
*/
|
|
21871
|
+
() => {
|
|
21872
|
+
/** @type {?} */
|
|
21873
|
+
const $input = event.model.element.querySelector("input");
|
|
21874
|
+
if ($input && $input.value && !this.dateForm[field.formKey]) {
|
|
21875
|
+
this.dateValidMap[field.formKey] = false;
|
|
21876
|
+
}
|
|
21877
|
+
else {
|
|
21878
|
+
delete this.dateValidMap[field.formKey];
|
|
21879
|
+
}
|
|
21880
|
+
}), 50);
|
|
21822
21881
|
}
|
|
21823
21882
|
/**
|
|
21824
21883
|
* @param {?} field
|
|
@@ -21845,19 +21904,20 @@ class DrawerFormComponent {
|
|
|
21845
21904
|
if (event.text) {
|
|
21846
21905
|
query.where(this.optionFields.text, "contains", event.text, true);
|
|
21847
21906
|
}
|
|
21848
|
-
event.updateData(this.
|
|
21907
|
+
event.updateData(this.getOptions(field), query);
|
|
21849
21908
|
}
|
|
21850
21909
|
/**
|
|
21851
21910
|
* @param {?} field
|
|
21852
21911
|
* @return {?}
|
|
21853
21912
|
*/
|
|
21854
|
-
|
|
21855
|
-
if (
|
|
21856
|
-
|
|
21857
|
-
|
|
21858
|
-
|
|
21913
|
+
getOptions(field) {
|
|
21914
|
+
if (Array.isArray(this.optionsMap[field.optionKey])) {
|
|
21915
|
+
return this.optionsMap[field.optionKey];
|
|
21916
|
+
}
|
|
21917
|
+
if (Array.isArray(this.optionsMap[field.formKey])) {
|
|
21918
|
+
return this.optionsMap[field.formKey];
|
|
21859
21919
|
}
|
|
21860
|
-
return
|
|
21920
|
+
return [];
|
|
21861
21921
|
}
|
|
21862
21922
|
/**
|
|
21863
21923
|
* @param {?} field
|
|
@@ -21959,8 +22019,8 @@ class DrawerFormComponent {
|
|
|
21959
22019
|
DrawerFormComponent.decorators = [
|
|
21960
22020
|
{ type: Component, args: [{
|
|
21961
22021
|
selector: "rs-drawer-form",
|
|
21962
|
-
template: "<div #drawerFormEl class=\"rs-drawer-form-container\">\r\n <div class=\"section-container\">\r\n <div #sectionEl class=\"section-item\" *ngFor=\"let section of sections\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"section-expand-checkbox\"\r\n *ngIf=\"section.title\"\r\n />\r\n <div class=\"section-title\" *ngIf=\"section.title\">\r\n <span>{{ section.title }}</span>\r\n </div>\r\n <div class=\"section-form\" *ngIf=\"!section.customKey\">\r\n <div\r\n class=\"form-item\"\r\n *ngFor=\"let field of section.fields\"\r\n [attr.data-required]=\"field.required ? 'yes' : 'no'\"\r\n [attr.data-disabled]=\"field.disabled || formDisabled ? 'yes' : 'no'\"\r\n [attr.data-error]=\"\r\n fieldValidMap[field.formKey] === false ? 'yes' : 'no'\r\n \"\r\n >\r\n <div class=\"form-label\">\r\n <span>{{ field.label }}</span>\r\n <ejs-tooltip\r\n class=\"form-tooltip\"\r\n cssClass=\"rs-drawer-tooltip\"\r\n *ngIf=\"field.tooltip\"\r\n position=\"RightCenter\"\r\n [content]=\"field.tooltip\"\r\n >\r\n <span class=\"tooltip-icon\"></span>\r\n </ejs-tooltip>\r\n </div>\r\n <div class=\"form-content\">\r\n <!-- Radio -->\r\n <rs-radio-group\r\n *ngIf=\"field.fieldFormType === 'Radio'\"\r\n [value]=\"form[field.formKey]\"\r\n [dataSource]=\"
|
|
21963
|
-
styles: [":host{display:block;margin-top:16px}.rs-drawer-form-container{display:flex;flex-flow:row nowrap;align-items:flex-start;gap:32px}.rs-drawer-form-container .section-container{flex:auto;display:flex;flex-flow:column nowrap;max-width:1576px}.rs-drawer-form-container .section-item{position:relative}.rs-drawer-form-container .section-item:not(:first-child){border-top:1px solid #eaedf0}.rs-drawer-form-container .section-expand-checkbox{display:block;width:100%;height:28px;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;position:absolute;top:0;left:0}.rs-drawer-form-container .section-expand-checkbox:checked+.section-title::before{transform:rotate(-90deg)}.rs-drawer-form-container .section-expand-checkbox:checked+.section-title+.section-form{max-height:0;overflow:hidden}.rs-drawer-form-container .section-title{padding:6px 0;margin-bottom:12px;color:#44566c;font-family:Arial;font-size:13px;font-style:normal;font-weight:700;line-height:16px;display:flex;flex-flow:row nowrap;align-items:center;pointer-events:none}.rs-drawer-form-container .section-title::before{content:url(
|
|
22022
|
+
template: "<div #drawerFormEl class=\"rs-drawer-form-container\">\r\n <div class=\"section-container\">\r\n <div #sectionEl class=\"section-item\" *ngFor=\"let section of sections\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"section-expand-checkbox\"\r\n *ngIf=\"section.title\"\r\n />\r\n <div class=\"section-title\" *ngIf=\"section.title\">\r\n <span>{{ section.title }}</span>\r\n </div>\r\n <div class=\"section-form\" *ngIf=\"!section.customKey\">\r\n <div\r\n class=\"form-item\"\r\n *ngFor=\"let field of section.fields\"\r\n [attr.data-required]=\"field.required ? 'yes' : 'no'\"\r\n [attr.data-disabled]=\"field.disabled || formDisabled ? 'yes' : 'no'\"\r\n [attr.data-error]=\"\r\n fieldValidMap[field.formKey] === false ? 'yes' : 'no'\r\n \"\r\n >\r\n <div class=\"form-label\">\r\n <span>{{ field.label }}</span>\r\n <ejs-tooltip\r\n class=\"form-tooltip\"\r\n cssClass=\"rs-drawer-tooltip\"\r\n *ngIf=\"field.tooltip\"\r\n position=\"RightCenter\"\r\n [content]=\"field.tooltip\"\r\n >\r\n <span class=\"tooltip-icon\"></span>\r\n </ejs-tooltip>\r\n </div>\r\n <div class=\"form-content\">\r\n <!-- Radio -->\r\n <rs-radio-group\r\n *ngIf=\"field.fieldFormType === 'Radio'\"\r\n [value]=\"form[field.formKey]\"\r\n [dataSource]=\"getOptions(field)\"\r\n [fields]=\"getOptionFields(field)\"\r\n [disabled]=\"getDisabled(field)\"\r\n [error]=\"fieldValidMap[field.formKey] === false\"\r\n (valueChange)=\"onChange($event, field)\"\r\n ></rs-radio-group>\r\n <!-- Checkbox -->\r\n <rs-checkbox-group\r\n *ngIf=\"field.fieldFormType === 'Checkbox'\"\r\n [value]=\"form[field.formKey]\"\r\n [dataSource]=\"getOptions(field)\"\r\n [fields]=\"getOptionFields(field)\"\r\n [disabled]=\"getDisabled(field)\"\r\n [error]=\"fieldValidMap[field.formKey] === false\"\r\n (valueChange)=\"onChange($event, field)\"\r\n ></rs-checkbox-group>\r\n <!-- Switch -->\r\n <rs-switch-input\r\n *ngIf=\"field.fieldFormType === 'Switch'\"\r\n [value]=\"form[field.formKey]\"\r\n [disabled]=\"getDisabled(field)\"\r\n (valueChange)=\"onChange($event, field)\"\r\n ></rs-switch-input>\r\n <!-- Input -->\r\n <input\r\n class=\"e-input\"\r\n *ngIf=\"\r\n field.fieldFormType === 'Text' ||\r\n field.fieldFormType === 'Email'\r\n \"\r\n [value]=\"form[field.formKey]\"\r\n [disabled]=\"getDisabled(field)\"\r\n [required]=\"field.required\"\r\n [attr.maxlength]=\"field.maxlength\"\r\n [attr.minlength]=\"field.minlength\"\r\n [class.error]=\"fieldValidMap[field.formKey] === false\"\r\n (input)=\"onInput($event.target.value, field)\"\r\n (change)=\"onChange($event.target.value, field)\"\r\n (focus)=\"onFocus(field)\"\r\n (blur)=\"onBlur(field)\"\r\n autocomplete=\"off\"\r\n />\r\n <!-- Textarea -->\r\n <textarea\r\n class=\"e-input\"\r\n *ngIf=\"field.fieldFormType === 'Textarea'\"\r\n [value]=\"form[field.formKey]\"\r\n [disabled]=\"getDisabled(field)\"\r\n [required]=\"field.required\"\r\n [attr.maxlength]=\"field.maxlength\"\r\n [attr.minlength]=\"field.minlength\"\r\n [class.error]=\"fieldValidMap[field.formKey] === false\"\r\n (input)=\"onInput($event.target.value, field)\"\r\n (change)=\"onChange($event.target.value, field)\"\r\n (focus)=\"onFocus(field)\"\r\n (blur)=\"onBlur(field)\"\r\n autocomplete=\"off\"\r\n rows=\"3\"\r\n ></textarea>\r\n <!-- Number Input -->\r\n <ejs-numerictextbox\r\n *ngIf=\"field.fieldFormType === 'Number'\"\r\n [value]=\"form[field.formKey]\"\r\n [max]=\"field.max\"\r\n [min]=\"field.min\"\r\n [step]=\"field.step\"\r\n [decimals]=\"field.decimals\"\r\n [format]=\"field.format || numberFormat\"\r\n [enabled]=\"!getDisabled(field)\"\r\n [class.error]=\"fieldValidMap[field.formKey] === false\"\r\n (change)=\"onComponentChange($event, field)\"\r\n (focus)=\"onFocus(field)\"\r\n (blur)=\"onBlur(field)\"\r\n ></ejs-numerictextbox>\r\n <!-- Tags Input -->\r\n <rs-tag-input\r\n *ngIf=\"field.fieldFormType === 'Tags'\"\r\n [value]=\"form[field.formKey]\"\r\n [fields]=\"getOptionFields(field)\"\r\n [inputMaxlength]=\"field.maxlength\"\r\n [inputMinlength]=\"field.minlength\"\r\n [disabled]=\"getDisabled(field)\"\r\n [error]=\"fieldValidMap[field.formKey] === false\"\r\n (valueChange)=\"onChange($event, field)\"\r\n (focus)=\"onFocus(field)\"\r\n (blur)=\"onBlur(field)\"\r\n ></rs-tag-input>\r\n <!-- AutoComplete -->\r\n <ejs-autocomplete\r\n *ngIf=\"field.fieldFormType === 'AutoComplete'\"\r\n [value]=\"form[field.formKey]\"\r\n [dataSource]=\"getOptions(field)\"\r\n [fields]=\"getOptionFields(field)\"\r\n [enabled]=\"!getDisabled(field)\"\r\n [class.error]=\"fieldValidMap[field.formKey] === false\"\r\n (filtering)=\"onFiltering($event, field)\"\r\n (change)=\"onComponentChange($event, field)\"\r\n (focus)=\"onFocus(field)\"\r\n (blur)=\"onBlur(field)\"\r\n ></ejs-autocomplete>\r\n <!-- Dropdown -->\r\n <ejs-dropdownlist\r\n *ngIf=\"field.fieldFormType === 'Dropdown'\"\r\n [value]=\"form[field.formKey]\"\r\n [dataSource]=\"getOptions(field)\"\r\n [fields]=\"getOptionFields(field)\"\r\n [allowFiltering]=\"true\"\r\n [showClearButton]=\"true\"\r\n [enabled]=\"!getDisabled(field)\"\r\n [class.error]=\"fieldValidMap[field.formKey] === false\"\r\n (filtering)=\"onFiltering($event, field)\"\r\n (change)=\"onComponentChange($event, field)\"\r\n (focus)=\"onFocus(field)\"\r\n (blur)=\"onBlur(field)\"\r\n ></ejs-dropdownlist>\r\n <!-- MultiSelect -->\r\n <ejs-multiselect\r\n *ngIf=\"field.fieldFormType === 'MultiSelect'\"\r\n mode=\"CheckBox\"\r\n [ngModel]=\"form[field.formKey]\"\r\n [dataSource]=\"getOptions(field)\"\r\n [fields]=\"getOptionFields(field)\"\r\n [allowFiltering]=\"true\"\r\n [showDropDownIcon]=\"true\"\r\n [enabled]=\"!getDisabled(field)\"\r\n [class.error]=\"fieldValidMap[field.formKey] === false\"\r\n (filtering)=\"onFiltering($event, field)\"\r\n (change)=\"onComponentChange($event, field)\"\r\n (focus)=\"onFocus(field)\"\r\n (blur)=\"onBlur(field)\"\r\n >\r\n </ejs-multiselect>\r\n <!-- Datepicker -->\r\n <ejs-datepicker\r\n *ngIf=\"field.fieldFormType === 'Datepicker'\"\r\n [(value)]=\"dateForm[field.formKey]\"\r\n [format]=\"field.format || dateFormat\"\r\n [enabled]=\"!getDisabled(field)\"\r\n [class.error]=\"\r\n fieldValidMap[field.formKey] === false ||\r\n dateValidMap[field.formKey] === false\r\n \"\r\n (change)=\"onComponentChange($event, field)\"\r\n (focus)=\"onFocus(field)\"\r\n (blur)=\"onDatePickerBlur($event, field)\"\r\n ></ejs-datepicker>\r\n <ng-template\r\n #customTemplateContainer\r\n *ngIf=\"field.fieldFormType === 'Custom'\"\r\n ></ng-template>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"section-form\" *ngIf=\"section.customKey\">\r\n <ng-template #customSectionContainer></ng-template>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"sections.length > 1 && showAnchor\" class=\"anchor-container\">\r\n <div\r\n class=\"anchor-item\"\r\n *ngFor=\"let section of sections; let index = index\"\r\n [style.display]=\"section.title ? 'block' : 'none'\"\r\n [attr.data-active]=\"scrollIndex === index ? 'yes' : 'no'\"\r\n [attr.data-content]=\"section.title\"\r\n (click)=\"onClickAnchor(index)\"\r\n ></div>\r\n </div>\r\n</div>\r\n",
|
|
22023
|
+
styles: [":host{display:block;margin-top:16px}.rs-drawer-form-container{display:flex;flex-flow:row nowrap;align-items:flex-start;gap:32px}.rs-drawer-form-container .section-container{flex:auto;display:flex;flex-flow:column nowrap;max-width:1576px}.rs-drawer-form-container .section-item{position:relative}.rs-drawer-form-container .section-item:not(:first-child){border-top:1px solid #eaedf0}.rs-drawer-form-container .section-expand-checkbox{display:block;width:100%;height:28px;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;position:absolute;top:0;left:0}.rs-drawer-form-container .section-expand-checkbox:checked+.section-title::before{transform:rotate(-90deg)}.rs-drawer-form-container .section-expand-checkbox:checked+.section-title+.section-form{max-height:0;overflow:hidden}.rs-drawer-form-container .section-title{padding:6px 0;margin-bottom:12px;color:#44566c;font-family:Arial;font-size:13px;font-style:normal;font-weight:700;line-height:16px;display:flex;flex-flow:row nowrap;align-items:center;pointer-events:none}.rs-drawer-form-container .section-title::before{content:url(../../../assets/img/down-arrow.svg);display:block;height:16px;width:16px;margin-right:8px}.rs-drawer-form-container .section-form{display:flex;flex-flow:row wrap;justify-content:space-between;gap:12px 56px;max-width:1576px;padding:0 24px;margin-bottom:20px}.rs-drawer-form-container .section-form .form-item{min-height:28px;min-width:400px;max-width:700px;width:calc((100% - 56px)/ 2);display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:flex-start}.rs-drawer-form-container .section-form .form-item[data-required=yes] .form-label>span:first-child::after{content:\"*\";color:var(--rs-input-require-label-color)}.rs-drawer-form-container .section-form .form-item .form-label{flex:none;width:144px;height:28px;margin-right:16px;color:#43566c;font-family:Arial;font-size:12px;font-style:normal;font-weight:400;line-height:14px;display:flex;flex-flow:row nowrap;align-items:center}.rs-drawer-form-container .section-form .form-item .form-label .form-tooltip{margin-left:4px}.rs-drawer-form-container .section-form .form-item .form-label .form-tooltip .tooltip-icon::before{content:\" \";display:block;width:14px;height:14px;background-image:url(../../../assets/img/tooltip-icon.svg);background-size:contain;cursor:pointer}.rs-drawer-form-container .section-form .form-item .form-content{flex:auto}@media (max-width:1420px){.rs-drawer-form-container .section-form .form-item{width:100%}}.rs-drawer-form-container .anchor-container{flex:none;display:flex;flex-flow:column nowrap;gap:4px;min-width:120px;height:auto;position:-webkit-sticky;position:sticky;top:56px}.rs-drawer-form-container .anchor-item{min-width:120px;padding:4px 12px;border-left:1px solid #eaedf0;cursor:pointer;color:#44566c;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:16px;position:relative}.rs-drawer-form-container .anchor-item::before{content:attr(data-content);color:#44566c;font-weight:400;position:absolute;left:12px}.rs-drawer-form-container .anchor-item::after{content:attr(data-content);visibility:hidden;color:#1364b3;font-weight:700}.rs-drawer-form-container .anchor-item[data-active=yes]{border-color:#1f7bff}.rs-drawer-form-container .anchor-item[data-active=yes]::before{visibility:hidden}.rs-drawer-form-container .anchor-item[data-active=yes]::after{visibility:visible}.rs-drawer-tooltip.e-tooltip-wrap{border:none;background-color:#44566c}.rs-drawer-tooltip.e-tooltip-wrap .e-arrow-tip{height:4px;visibility:hidden}"]
|
|
21964
22024
|
}] }
|
|
21965
22025
|
];
|
|
21966
22026
|
/** @nocollapse */
|
|
@@ -21968,15 +22028,17 @@ DrawerFormComponent.ctorParameters = () => [
|
|
|
21968
22028
|
{ type: ChangeDetectorRef }
|
|
21969
22029
|
];
|
|
21970
22030
|
DrawerFormComponent.propDecorators = {
|
|
22031
|
+
_form: [{ type: Input, args: ["form",] }],
|
|
21971
22032
|
_sections: [{ type: Input, args: ["sections",] }],
|
|
21972
22033
|
optionsMap: [{ type: Input, args: ["optionsMap",] }],
|
|
21973
|
-
customTemplate: [{ type: Input, args: ["customTemplate",] }],
|
|
21974
|
-
customSectionTemplate: [{ type: Input, args: ["customSectionTemplate",] }],
|
|
21975
22034
|
formDisabled: [{ type: Input, args: ["disabled",] }],
|
|
21976
22035
|
showAnchor: [{ type: Input, args: ["showAnchor",] }],
|
|
22036
|
+
customTemplate: [{ type: Input, args: ["customTemplate",] }],
|
|
22037
|
+
customSectionTemplate: [{ type: Input, args: ["customSectionTemplate",] }],
|
|
21977
22038
|
optionFields: [{ type: Input, args: ["optionFields",] }],
|
|
21978
22039
|
showFilterNumber: [{ type: Input, args: ["showFilterNumber",] }],
|
|
21979
|
-
|
|
22040
|
+
numberFormat: [{ type: Input, args: ["numberFormat",] }],
|
|
22041
|
+
dateFormat: [{ type: Input, args: ["dateFormat",] }],
|
|
21980
22042
|
formChange: [{ type: Output, args: ["formChange",] }],
|
|
21981
22043
|
fieldChange: [{ type: Output, args: ["fieldChange",] }],
|
|
21982
22044
|
rootEl: [{ type: ViewChild, args: ["drawerFormEl", { static: false },] }],
|
|
@@ -21985,24 +22047,28 @@ DrawerFormComponent.propDecorators = {
|
|
|
21985
22047
|
sectionEls: [{ type: ViewChildren, args: ["sectionEl",] }]
|
|
21986
22048
|
};
|
|
21987
22049
|
if (false) {
|
|
22050
|
+
/** @type {?} */
|
|
22051
|
+
DrawerFormComponent.prototype._form;
|
|
21988
22052
|
/** @type {?} */
|
|
21989
22053
|
DrawerFormComponent.prototype._sections;
|
|
21990
22054
|
/** @type {?} */
|
|
21991
22055
|
DrawerFormComponent.prototype.optionsMap;
|
|
21992
22056
|
/** @type {?} */
|
|
21993
|
-
DrawerFormComponent.prototype.customTemplate;
|
|
21994
|
-
/** @type {?} */
|
|
21995
|
-
DrawerFormComponent.prototype.customSectionTemplate;
|
|
21996
|
-
/** @type {?} */
|
|
21997
22057
|
DrawerFormComponent.prototype.formDisabled;
|
|
21998
22058
|
/** @type {?} */
|
|
21999
22059
|
DrawerFormComponent.prototype.showAnchor;
|
|
22000
22060
|
/** @type {?} */
|
|
22061
|
+
DrawerFormComponent.prototype.customTemplate;
|
|
22062
|
+
/** @type {?} */
|
|
22063
|
+
DrawerFormComponent.prototype.customSectionTemplate;
|
|
22064
|
+
/** @type {?} */
|
|
22001
22065
|
DrawerFormComponent.prototype.optionFields;
|
|
22002
22066
|
/** @type {?} */
|
|
22003
22067
|
DrawerFormComponent.prototype.showFilterNumber;
|
|
22004
22068
|
/** @type {?} */
|
|
22005
|
-
DrawerFormComponent.prototype.
|
|
22069
|
+
DrawerFormComponent.prototype.numberFormat;
|
|
22070
|
+
/** @type {?} */
|
|
22071
|
+
DrawerFormComponent.prototype.dateFormat;
|
|
22006
22072
|
/** @type {?} */
|
|
22007
22073
|
DrawerFormComponent.prototype.formChange;
|
|
22008
22074
|
/** @type {?} */
|
|
@@ -22022,10 +22088,12 @@ if (false) {
|
|
|
22022
22088
|
/** @type {?} */
|
|
22023
22089
|
DrawerFormComponent.prototype.sections;
|
|
22024
22090
|
/** @type {?} */
|
|
22025
|
-
DrawerFormComponent.prototype.
|
|
22091
|
+
DrawerFormComponent.prototype.form;
|
|
22026
22092
|
/** @type {?} */
|
|
22027
22093
|
DrawerFormComponent.prototype.fieldValidMap;
|
|
22028
22094
|
/** @type {?} */
|
|
22095
|
+
DrawerFormComponent.prototype.dateForm;
|
|
22096
|
+
/** @type {?} */
|
|
22029
22097
|
DrawerFormComponent.prototype.dateValidMap;
|
|
22030
22098
|
/** @type {?} */
|
|
22031
22099
|
DrawerFormComponent.prototype.sectionEls;
|
|
@@ -22042,1587 +22110,1587 @@ if (false) {
|
|
|
22042
22110
|
|
|
22043
22111
|
/**
|
|
22044
22112
|
* @fileoverview added by tsickle
|
|
22045
|
-
* Generated from: lib/
|
|
22113
|
+
* Generated from: lib/dialog/common-dialog/index.component.ts
|
|
22046
22114
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
22047
22115
|
*/
|
|
22048
|
-
|
|
22049
|
-
|
|
22050
|
-
|
|
22051
|
-
|
|
22116
|
+
class CommonDialogComponent {
|
|
22117
|
+
/**
|
|
22118
|
+
* @param {?} dialogRef
|
|
22119
|
+
*/
|
|
22120
|
+
constructor(dialogRef) {
|
|
22121
|
+
this.dialogRef = dialogRef;
|
|
22122
|
+
// 隐藏元素相关属性
|
|
22123
|
+
this.hideHeader = false;
|
|
22124
|
+
this.hideCloseIcon = false;
|
|
22125
|
+
this.hideCloseBtn = false;
|
|
22126
|
+
this.hideSaveBtn = false;
|
|
22127
|
+
this.hideDiscardBtn = false;
|
|
22128
|
+
this.saveBtnLabel = "";
|
|
22129
|
+
this.cancelBtnLabel = "";
|
|
22130
|
+
this.discardBtnLabel = "";
|
|
22131
|
+
this.showErrorIcon = false;
|
|
22132
|
+
this.showZoomBtn = false;
|
|
22133
|
+
// 显示相关属性
|
|
22134
|
+
this.dialogStyle = {};
|
|
22135
|
+
this.size = "";
|
|
22136
|
+
this.title = "Dialog";
|
|
22137
|
+
this.loading = false;
|
|
22138
|
+
this.saveEmit = new EventEmitter();
|
|
22139
|
+
this.closeEmit = new EventEmitter();
|
|
22140
|
+
this.defaultSize = "";
|
|
22141
|
+
this.customFooter = false;
|
|
22142
|
+
}
|
|
22143
|
+
/**
|
|
22144
|
+
* @return {?}
|
|
22145
|
+
*/
|
|
22146
|
+
ngAfterContentInit() {
|
|
22147
|
+
this.customFooter = !!this.footerContent;
|
|
22148
|
+
}
|
|
22149
|
+
/**
|
|
22150
|
+
* @return {?}
|
|
22151
|
+
*/
|
|
22152
|
+
ngOnInit() {
|
|
22153
|
+
this.getInfo();
|
|
22154
|
+
}
|
|
22155
|
+
/**
|
|
22156
|
+
* @return {?}
|
|
22157
|
+
*/
|
|
22158
|
+
onClose() {
|
|
22159
|
+
if (this.onCloseRequest) {
|
|
22160
|
+
this.onCloseRequest().then((/**
|
|
22161
|
+
* @param {?} confirmed
|
|
22162
|
+
* @return {?}
|
|
22163
|
+
*/
|
|
22164
|
+
(confirmed) => {
|
|
22165
|
+
if (confirmed) {
|
|
22166
|
+
this.dialogRef.close("close");
|
|
22167
|
+
}
|
|
22168
|
+
}));
|
|
22169
|
+
}
|
|
22170
|
+
else {
|
|
22171
|
+
this.dialogRef.close("close");
|
|
22172
|
+
}
|
|
22173
|
+
}
|
|
22174
|
+
/**
|
|
22175
|
+
* @return {?}
|
|
22176
|
+
*/
|
|
22177
|
+
onZoom() {
|
|
22178
|
+
if (this.size === "largest") {
|
|
22179
|
+
this.size = this.defaultSize; // 恢复到原始大小
|
|
22180
|
+
}
|
|
22181
|
+
else {
|
|
22182
|
+
this.size = "largest"; // 设置为最大化
|
|
22183
|
+
}
|
|
22184
|
+
}
|
|
22185
|
+
/**
|
|
22186
|
+
* @return {?}
|
|
22187
|
+
*/
|
|
22188
|
+
onSave() {
|
|
22189
|
+
this.dialogRef.close("save");
|
|
22190
|
+
}
|
|
22191
|
+
/**
|
|
22192
|
+
* @return {?}
|
|
22193
|
+
*/
|
|
22194
|
+
onDiscard() {
|
|
22195
|
+
this.dialogRef.close("discard");
|
|
22196
|
+
}
|
|
22197
|
+
/**
|
|
22198
|
+
* @private
|
|
22199
|
+
* @return {?}
|
|
22200
|
+
*/
|
|
22201
|
+
getInfo() {
|
|
22202
|
+
this.translation = JSON.parse(localStorage.getItem("translation")) || {};
|
|
22203
|
+
this.saveBtnLabel = this.saveBtnLabel || this.translation.SAVE || ".SAVE";
|
|
22204
|
+
this.cancelBtnLabel =
|
|
22205
|
+
this.cancelBtnLabel || this.translation.CANCEL || ".CANCEL";
|
|
22206
|
+
this.defaultSize = this.size;
|
|
22207
|
+
}
|
|
22208
|
+
}
|
|
22209
|
+
CommonDialogComponent.decorators = [
|
|
22210
|
+
{ type: Component, args: [{
|
|
22211
|
+
selector: "rs-common-dialog",
|
|
22212
|
+
template: "<div class=\"dialog\" [ngClass]=\"size\" [ngStyle]=\"dialogStyle\">\r\n <!-- \u5934\u90E8 -->\r\n <div *ngIf=\"!hideHeader\" mat-dialog-title class=\"dialog__header\">\r\n <div class=\"header__title\">\r\n <img\r\n src=\"../../../assets/img/notification-status-warning.svg\"\r\n alt=\"\"\r\n *ngIf=\"showErrorIcon\"\r\n />\r\n {{ title }}\r\n </div>\r\n <div class=\"header__actions\">\r\n <div *ngIf=\"showZoomBtn\" class=\"header-btn\" (click)=\"onZoom()\">\r\n <img\r\n class=\"header-icon\"\r\n *ngIf=\"size === 'largest'\"\r\n src=\"../../../assets/img/dialog-shrink.svg\"\r\n />\r\n <img\r\n class=\"header-icon\"\r\n *ngIf=\"size !== 'largest'\"\r\n src=\"../../../assets/img/dialog-grow.svg\"\r\n />\r\n </div>\r\n <div *ngIf=\"!hideCloseIcon\" class=\"header-btn\" (click)=\"onClose()\">\r\n <img class=\"header-icon\" src=\"../../../assets/img/dialog-close.svg\" />\r\n </div>\r\n </div>\r\n </div>\r\n <!-- \u5185\u5BB9 -->\r\n <div class=\"dialog__content\" mat-dialog-content>\r\n <ng-content></ng-content>\r\n </div>\r\n <!-- \u5E95\u90E8\u6309\u94AE -->\r\n <div mat-dialog-actions class=\"dialog__footer\">\r\n <ng-content select=\"[footerSlot]\"></ng-content>\r\n <!-- \u9ED8\u8BA4\u5C55\u793A\u4FDD\u5B58/\u5173\u95ED\u6309\u94AE -->\r\n <ng-container *ngIf=\"!customFooter\">\r\n <ng-template [ngTemplateOutlet]=\"defaultTemplate\"></ng-template>\r\n </ng-container>\r\n <ng-template #defaultTemplate>\r\n <button\r\n *ngIf=\"!hideCloseBtn\"\r\n class=\"e-btn\"\r\n (click)=\"onClose()\"\r\n >\r\n {{ cancelBtnLabel }}\r\n </button>\r\n <button\r\n *ngIf=\"!hideDiscardBtn\"\r\n class=\"e-btn\"\r\n (click)=\"onDiscard()\"\r\n >\r\n {{ discardBtnLabel }}\r\n </button>\r\n <button\r\n *ngIf=\"!hideSaveBtn\"\r\n class=\"e-btn e-primary\"\r\n (click)=\"onSave()\"\r\n >\r\n {{ saveBtnLabel }}\r\n </button>\r\n </ng-template>\r\n </div>\r\n <!-- loading -->\r\n <div class=\"dialog__loading\" [hidden]=\"!loading\">\r\n <img src=\"../../../assets/img/raise_loading.gif\" alt=\"\" />\r\n </div>\r\n</div>\r\n",
|
|
22213
|
+
styles: [":host::ng-deep .dialog{position:relative;max-height:90vh;font-weight:400;padding:20px;overflow:hidden;display:flex;flex-direction:column}:host::ng-deep .dialog.largest{width:96vw!important;height:88vh!important;max-width:2100px;padding:20px}:host::ng-deep .dialog.medium{width:500px;padding:20px}:host::ng-deep .dialog.small{width:350px;padding:20px 16px}:host::ng-deep .dialog.small .dialog__header{color:#002c4f;margin-bottom:16px}:host::ng-deep .dialog.small .dialog__header .header__title{font-size:13px;line-height:16px}:host::ng-deep .dialog.small .dialog__content{font-size:12px;line-height:16px}:host::ng-deep .dialog.small .dialog__footer{min-height:42px;padding:16px 0 0;font-size:12px;line-height:14px}:host::ng-deep .dialog.small .dialog__footer button{padding:6px 12px;min-width:60px}:host::ng-deep .dialog.large{width:800px;padding:20px}:host::ng-deep .dialog .dialog__header{width:100%;display:flex;justify-content:space-between;align-items:center;padding:0}:host::ng-deep .dialog .dialog__header::before{display:none}:host::ng-deep .dialog .dialog__header .header__title{color:#002c4f;font-family:Arial;font-size:15px;font-weight:700;line-height:18px;flex:1;overflow:hidden;display:flex;align-items:center;gap:8px}:host::ng-deep .dialog .dialog__header .header__actions{display:flex;align-items:center;gap:20px}:host::ng-deep .dialog .dialog__header .header-icon{display:block}:host::ng-deep .dialog .dialog__header .header-btn{cursor:pointer;padding:2px;display:flex;justify-content:center;align-items:center}:host::ng-deep .dialog .dialog__content{width:100%;min-height:38px;position:relative;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;font-size:13px;line-height:19px;flex:1;height:0}:host::ng-deep .dialog .dialog__footer{position:relative;display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:20px 0 0;font-size:13px;line-height:16px;margin-bottom:0}:host::ng-deep .dialog .dialog__loading{height:100%;background:0 0;position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999}:host::ng-deep .dialog .dialog__loading img{position:absolute;left:50%;top:50%;width:40px;height:40px;transform:translate(-50%,-50%)}"]
|
|
22214
|
+
}] }
|
|
22215
|
+
];
|
|
22216
|
+
/** @nocollapse */
|
|
22217
|
+
CommonDialogComponent.ctorParameters = () => [
|
|
22218
|
+
{ type: MatDialogRef }
|
|
22219
|
+
];
|
|
22220
|
+
CommonDialogComponent.propDecorators = {
|
|
22221
|
+
hideHeader: [{ type: Input }],
|
|
22222
|
+
hideCloseIcon: [{ type: Input }],
|
|
22223
|
+
hideCloseBtn: [{ type: Input }],
|
|
22224
|
+
hideSaveBtn: [{ type: Input }],
|
|
22225
|
+
hideDiscardBtn: [{ type: Input }],
|
|
22226
|
+
saveBtnLabel: [{ type: Input }],
|
|
22227
|
+
cancelBtnLabel: [{ type: Input }],
|
|
22228
|
+
discardBtnLabel: [{ type: Input }],
|
|
22229
|
+
showErrorIcon: [{ type: Input }],
|
|
22230
|
+
showZoomBtn: [{ type: Input }],
|
|
22231
|
+
onCloseRequest: [{ type: Input }],
|
|
22232
|
+
dialogStyle: [{ type: Input }],
|
|
22233
|
+
size: [{ type: Input }],
|
|
22234
|
+
title: [{ type: Input }],
|
|
22235
|
+
loading: [{ type: Input }],
|
|
22236
|
+
saveEmit: [{ type: Output }],
|
|
22237
|
+
closeEmit: [{ type: Output }],
|
|
22238
|
+
footerContent: [{ type: ContentChild, args: ["footerSlot", { static: false },] }]
|
|
22239
|
+
};
|
|
22052
22240
|
if (false) {
|
|
22053
22241
|
/** @type {?} */
|
|
22054
|
-
|
|
22242
|
+
CommonDialogComponent.prototype.translation;
|
|
22055
22243
|
/** @type {?} */
|
|
22056
|
-
|
|
22244
|
+
CommonDialogComponent.prototype.hideHeader;
|
|
22057
22245
|
/** @type {?} */
|
|
22058
|
-
|
|
22246
|
+
CommonDialogComponent.prototype.hideCloseIcon;
|
|
22059
22247
|
/** @type {?} */
|
|
22060
|
-
|
|
22248
|
+
CommonDialogComponent.prototype.hideCloseBtn;
|
|
22061
22249
|
/** @type {?} */
|
|
22062
|
-
|
|
22063
|
-
}
|
|
22064
|
-
|
|
22250
|
+
CommonDialogComponent.prototype.hideSaveBtn;
|
|
22251
|
+
/** @type {?} */
|
|
22252
|
+
CommonDialogComponent.prototype.hideDiscardBtn;
|
|
22253
|
+
/** @type {?} */
|
|
22254
|
+
CommonDialogComponent.prototype.saveBtnLabel;
|
|
22255
|
+
/** @type {?} */
|
|
22256
|
+
CommonDialogComponent.prototype.cancelBtnLabel;
|
|
22257
|
+
/** @type {?} */
|
|
22258
|
+
CommonDialogComponent.prototype.discardBtnLabel;
|
|
22259
|
+
/** @type {?} */
|
|
22260
|
+
CommonDialogComponent.prototype.showErrorIcon;
|
|
22261
|
+
/** @type {?} */
|
|
22262
|
+
CommonDialogComponent.prototype.showZoomBtn;
|
|
22263
|
+
/** @type {?} */
|
|
22264
|
+
CommonDialogComponent.prototype.onCloseRequest;
|
|
22265
|
+
/** @type {?} */
|
|
22266
|
+
CommonDialogComponent.prototype.dialogStyle;
|
|
22267
|
+
/** @type {?} */
|
|
22268
|
+
CommonDialogComponent.prototype.size;
|
|
22269
|
+
/** @type {?} */
|
|
22270
|
+
CommonDialogComponent.prototype.title;
|
|
22271
|
+
/** @type {?} */
|
|
22272
|
+
CommonDialogComponent.prototype.loading;
|
|
22273
|
+
/** @type {?} */
|
|
22274
|
+
CommonDialogComponent.prototype.saveEmit;
|
|
22275
|
+
/** @type {?} */
|
|
22276
|
+
CommonDialogComponent.prototype.closeEmit;
|
|
22277
|
+
/** @type {?} */
|
|
22278
|
+
CommonDialogComponent.prototype.defaultSize;
|
|
22279
|
+
/** @type {?} */
|
|
22280
|
+
CommonDialogComponent.prototype.footerContent;
|
|
22281
|
+
/** @type {?} */
|
|
22282
|
+
CommonDialogComponent.prototype.customFooter;
|
|
22283
|
+
/** @type {?} */
|
|
22284
|
+
CommonDialogComponent.prototype.dialogRef;
|
|
22285
|
+
}
|
|
22286
|
+
|
|
22065
22287
|
/**
|
|
22066
|
-
* @
|
|
22067
|
-
|
|
22068
|
-
|
|
22069
|
-
return {
|
|
22070
|
-
endpoint: "https://aidevused.openai.azure.com/",
|
|
22071
|
-
apiKey: "ccba76e279f64653a50ac4fee90afe5c",
|
|
22072
|
-
deployment: "gpt-4",
|
|
22073
|
-
apiVersion: "2025-01-01-preview",
|
|
22074
|
-
enabled: true,
|
|
22075
|
-
};
|
|
22076
|
-
}
|
|
22077
|
-
// 检查配置是否有效
|
|
22078
|
-
/**
|
|
22079
|
-
* @param {?} config
|
|
22080
|
-
* @return {?}
|
|
22288
|
+
* @fileoverview added by tsickle
|
|
22289
|
+
* Generated from: lib/service/icon-loader.service.ts
|
|
22290
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
22081
22291
|
*/
|
|
22082
|
-
|
|
22083
|
-
|
|
22084
|
-
|
|
22085
|
-
|
|
22086
|
-
|
|
22087
|
-
|
|
22088
|
-
|
|
22089
|
-
|
|
22090
|
-
|
|
22292
|
+
class IconLoaderService {
|
|
22293
|
+
/**
|
|
22294
|
+
* @param {?} registry
|
|
22295
|
+
* @param {?} domSanitizer
|
|
22296
|
+
*/
|
|
22297
|
+
constructor(registry, domSanitizer) {
|
|
22298
|
+
this.registry = registry;
|
|
22299
|
+
this.domSanitizer = domSanitizer;
|
|
22300
|
+
}
|
|
22301
|
+
/**
|
|
22302
|
+
* @param {?} list
|
|
22303
|
+
* @return {?}
|
|
22304
|
+
*/
|
|
22305
|
+
registerIcons(list) {
|
|
22306
|
+
list.forEach((/**
|
|
22307
|
+
* @param {?} __0
|
|
22308
|
+
* @return {?}
|
|
22309
|
+
*/
|
|
22310
|
+
({ name, path }) => {
|
|
22311
|
+
this.registry.addSvgIcon(name, this.domSanitizer.bypassSecurityTrustResourceUrl(path));
|
|
22312
|
+
}));
|
|
22313
|
+
}
|
|
22091
22314
|
}
|
|
22092
|
-
|
|
22093
|
-
|
|
22094
|
-
|
|
22095
|
-
|
|
22096
|
-
|
|
22097
|
-
|
|
22098
|
-
|
|
22099
|
-
|
|
22100
|
-
|
|
22101
|
-
|
|
22102
|
-
|
|
22103
|
-
|
|
22104
|
-
|
|
22105
|
-
|
|
22106
|
-
|
|
22107
|
-
|
|
22108
|
-
|
|
22109
|
-
|
|
22315
|
+
IconLoaderService.decorators = [
|
|
22316
|
+
{ type: Injectable }
|
|
22317
|
+
];
|
|
22318
|
+
/** @nocollapse */
|
|
22319
|
+
IconLoaderService.ctorParameters = () => [
|
|
22320
|
+
{ type: MatIconRegistry },
|
|
22321
|
+
{ type: DomSanitizer }
|
|
22322
|
+
];
|
|
22323
|
+
if (false) {
|
|
22324
|
+
/**
|
|
22325
|
+
* @type {?}
|
|
22326
|
+
* @private
|
|
22327
|
+
*/
|
|
22328
|
+
IconLoaderService.prototype.registry;
|
|
22329
|
+
/**
|
|
22330
|
+
* @type {?}
|
|
22331
|
+
* @private
|
|
22332
|
+
*/
|
|
22333
|
+
IconLoaderService.prototype.domSanitizer;
|
|
22110
22334
|
}
|
|
22111
22335
|
|
|
22112
22336
|
/**
|
|
22113
22337
|
* @fileoverview added by tsickle
|
|
22114
|
-
* Generated from: lib/
|
|
22338
|
+
* Generated from: lib/service/keep-alive.service.ts
|
|
22115
22339
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
22116
22340
|
*/
|
|
22117
|
-
|
|
22118
|
-
|
|
22119
|
-
|
|
22120
|
-
|
|
22121
|
-
|
|
22122
|
-
|
|
22123
|
-
|
|
22124
|
-
|
|
22125
|
-
|
|
22126
|
-
|
|
22127
|
-
|
|
22128
|
-
|
|
22129
|
-
|
|
22130
|
-
|
|
22131
|
-
|
|
22132
|
-
|
|
22133
|
-
|
|
22134
|
-
|
|
22135
|
-
|
|
22136
|
-
|
|
22137
|
-
|
|
22138
|
-
|
|
22139
|
-
|
|
22140
|
-
|
|
22141
|
-
|
|
22142
|
-
|
|
22143
|
-
|
|
22144
|
-
top_p: 1,
|
|
22145
|
-
frequency_penalty: 0,
|
|
22146
|
-
presence_penalty: 0,
|
|
22147
|
-
}),
|
|
22148
|
-
});
|
|
22149
|
-
if (!response.ok) {
|
|
22150
|
-
/** @type {?} */
|
|
22151
|
-
const errorText = yield response.text();
|
|
22152
|
-
throw new Error(`HTTP error! status: ${response.status}, message: ${errorText}`);
|
|
22153
|
-
}
|
|
22154
|
-
/** @type {?} */
|
|
22155
|
-
const data = yield response.json();
|
|
22156
|
-
if (!data.choices || !data.choices[0] || !data.choices[0].message) {
|
|
22157
|
-
throw new Error('Invalid response format from AI service');
|
|
22341
|
+
/** @type {?} */
|
|
22342
|
+
const storedRoutes = new Map();
|
|
22343
|
+
/** @type {?} */
|
|
22344
|
+
let toBeDeleteUrl;
|
|
22345
|
+
/** @type {?} */
|
|
22346
|
+
let excludeRoutes = [];
|
|
22347
|
+
// 不需要缓存的url
|
|
22348
|
+
class KeepAliveService {
|
|
22349
|
+
/**
|
|
22350
|
+
* @param {?} routes
|
|
22351
|
+
* @return {?}
|
|
22352
|
+
*/
|
|
22353
|
+
setExcludeRoutes(routes) {
|
|
22354
|
+
excludeRoutes = routes; // 设置不缓存的路由
|
|
22355
|
+
}
|
|
22356
|
+
/**
|
|
22357
|
+
* @param {?} route
|
|
22358
|
+
* @return {?}
|
|
22359
|
+
*/
|
|
22360
|
+
shouldDetach(route) {
|
|
22361
|
+
/** @type {?} */
|
|
22362
|
+
let config = route.routeConfig;
|
|
22363
|
+
// console.log("shouldDetach", toBeDeleteUrl, this.getRoutePath(route));
|
|
22364
|
+
if (toBeDeleteUrl === this.getRoutePath(route)) {
|
|
22365
|
+
// 对于新开的又即将关闭的tab,不缓存
|
|
22366
|
+
if (route.children.length === 0) {
|
|
22367
|
+
toBeDeleteUrl = "";
|
|
22158
22368
|
}
|
|
22159
|
-
return
|
|
22369
|
+
return false;
|
|
22160
22370
|
}
|
|
22161
|
-
|
|
22162
|
-
|
|
22163
|
-
throw error;
|
|
22371
|
+
if (config && excludeRoutes.includes(this.getRoutePath(route))) {
|
|
22372
|
+
return false;
|
|
22164
22373
|
}
|
|
22165
|
-
|
|
22166
|
-
|
|
22167
|
-
|
|
22168
|
-
/**
|
|
22169
|
-
|
|
22170
|
-
|
|
22171
|
-
|
|
22172
|
-
|
|
22173
|
-
|
|
22174
|
-
|
|
22175
|
-
|
|
22176
|
-
|
|
22177
|
-
|
|
22178
|
-
|
|
22179
|
-
|
|
22180
|
-
|
|
22181
|
-
|
|
22182
|
-
|
|
22183
|
-
|
|
22184
|
-
|
|
22185
|
-
|
|
22374
|
+
//Don't store lazy loaded routes
|
|
22375
|
+
return config && !config.loadChildren;
|
|
22376
|
+
}
|
|
22377
|
+
/**
|
|
22378
|
+
* @param {?} route
|
|
22379
|
+
* @param {?} handle
|
|
22380
|
+
* @return {?}
|
|
22381
|
+
*/
|
|
22382
|
+
store(route, handle) {
|
|
22383
|
+
// console.log("store", this.getRoutePath(route));
|
|
22384
|
+
// console.log("store", storedRoutes);
|
|
22385
|
+
/** @type {?} */
|
|
22386
|
+
const key = this.getRoutePath(route);
|
|
22387
|
+
storedRoutes.set(key, handle);
|
|
22388
|
+
}
|
|
22389
|
+
/**
|
|
22390
|
+
* @param {?} route
|
|
22391
|
+
* @return {?}
|
|
22392
|
+
*/
|
|
22393
|
+
shouldAttach(route) {
|
|
22394
|
+
/** @type {?} */
|
|
22395
|
+
const key = this.getRoutePath(route);
|
|
22396
|
+
return !!route.routeConfig && storedRoutes.has(key);
|
|
22397
|
+
}
|
|
22398
|
+
/**
|
|
22399
|
+
* @param {?} route
|
|
22400
|
+
* @return {?}
|
|
22401
|
+
*/
|
|
22402
|
+
retrieve(route) {
|
|
22403
|
+
/** @type {?} */
|
|
22404
|
+
let config = route.routeConfig;
|
|
22405
|
+
/** @type {?} */
|
|
22406
|
+
const key = this.getRoutePath(route);
|
|
22407
|
+
//We don't store lazy loaded routes, so don't even bother trying to retrieve them
|
|
22408
|
+
if (!config || config.loadChildren) {
|
|
22409
|
+
return false;
|
|
22186
22410
|
}
|
|
22411
|
+
return storedRoutes.get(key) || null;
|
|
22187
22412
|
}
|
|
22188
|
-
|
|
22189
|
-
}
|
|
22190
|
-
|
|
22191
|
-
|
|
22192
|
-
|
|
22193
|
-
|
|
22194
|
-
|
|
22195
|
-
|
|
22196
|
-
|
|
22197
|
-
|
|
22198
|
-
|
|
22199
|
-
|
|
22200
|
-
/** @type {?} */
|
|
22201
|
-
const config = getAIConfig();
|
|
22202
|
-
// 检查配置是否有效
|
|
22203
|
-
if (!isAIConfigValid(config)) {
|
|
22204
|
-
console.warn('AI configuration is incomplete or disabled, using mock response');
|
|
22205
|
-
return getMockAIResponse(subQuery, promptQuery);
|
|
22413
|
+
/**
|
|
22414
|
+
* @param {?} future
|
|
22415
|
+
* @param {?} curr
|
|
22416
|
+
* @return {?}
|
|
22417
|
+
*/
|
|
22418
|
+
shouldReuseRoute(future, curr) {
|
|
22419
|
+
// console.log("shouldReuseRoute", future, curr);
|
|
22420
|
+
// return future.routeConfig === curr.routeConfig;
|
|
22421
|
+
if (future.routeConfig === curr.routeConfig) {
|
|
22422
|
+
if (future.children.length === 0 && curr.children.length === 0) {
|
|
22423
|
+
// 无子路由时, 通过params和queryParams判断是否复用路由
|
|
22424
|
+
return (JSON.stringify(future.params) === JSON.stringify(curr.params));
|
|
22206
22425
|
}
|
|
22207
|
-
|
|
22208
|
-
const messages = [
|
|
22209
|
-
{
|
|
22210
|
-
role: 'system',
|
|
22211
|
-
content: subQuery.includes('emoji followed by the sentiment in the format')
|
|
22212
|
-
? 'You are a helpful assistant. Please respond in string format.'
|
|
22213
|
-
: "NOTE: Return same html format just do changes content only. don't change html formats.",
|
|
22214
|
-
},
|
|
22215
|
-
{
|
|
22216
|
-
role: 'user',
|
|
22217
|
-
content: `${subQuery} ${promptQuery}`,
|
|
22218
|
-
},
|
|
22219
|
-
];
|
|
22220
|
-
/** @type {?} */
|
|
22221
|
-
const result = yield sendAIRequest(messages, config);
|
|
22222
|
-
return result;
|
|
22426
|
+
return true;
|
|
22223
22427
|
}
|
|
22224
|
-
|
|
22225
|
-
|
|
22226
|
-
|
|
22428
|
+
return false;
|
|
22429
|
+
}
|
|
22430
|
+
/**
|
|
22431
|
+
* @param {?} route
|
|
22432
|
+
* @return {?}
|
|
22433
|
+
*/
|
|
22434
|
+
getRoutePath(route) {
|
|
22435
|
+
if (route.routeConfig) {
|
|
22436
|
+
// const pathParams = JSON.stringify(route.params);
|
|
22437
|
+
// const queryParams = new URLSearchParams(route.queryParams).toString();
|
|
22438
|
+
/** @type {?} */
|
|
22439
|
+
const url = route._urlSegment.segments.map((/**
|
|
22440
|
+
* @param {?} v
|
|
22441
|
+
* @return {?}
|
|
22442
|
+
*/
|
|
22443
|
+
(v) => v.path)).join("/");
|
|
22444
|
+
return "/" + url;
|
|
22227
22445
|
}
|
|
22228
|
-
|
|
22446
|
+
return "";
|
|
22447
|
+
}
|
|
22448
|
+
/**
|
|
22449
|
+
* @param {?} path
|
|
22450
|
+
* @return {?}
|
|
22451
|
+
*/
|
|
22452
|
+
clearCache(path) {
|
|
22453
|
+
// console.log("clearCache", storedRoutes, path);
|
|
22454
|
+
toBeDeleteUrl = path;
|
|
22455
|
+
storedRoutes.delete(path);
|
|
22456
|
+
}
|
|
22457
|
+
/**
|
|
22458
|
+
* @return {?}
|
|
22459
|
+
*/
|
|
22460
|
+
clearAllCache() {
|
|
22461
|
+
storedRoutes.clear();
|
|
22462
|
+
}
|
|
22229
22463
|
}
|
|
22230
|
-
|
|
22464
|
+
KeepAliveService.decorators = [
|
|
22465
|
+
{ type: Injectable, args: [{
|
|
22466
|
+
providedIn: "root",
|
|
22467
|
+
},] }
|
|
22468
|
+
];
|
|
22469
|
+
/** @nocollapse */ KeepAliveService.ngInjectableDef = ɵɵdefineInjectable({ factory: function KeepAliveService_Factory() { return new KeepAliveService(); }, token: KeepAliveService, providedIn: "root" });
|
|
22470
|
+
|
|
22231
22471
|
/**
|
|
22232
|
-
* @
|
|
22233
|
-
*
|
|
22234
|
-
* @
|
|
22472
|
+
* @fileoverview added by tsickle
|
|
22473
|
+
* Generated from: lib/form/confirm-select/index.component.ts
|
|
22474
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
22235
22475
|
*/
|
|
22236
|
-
|
|
22237
|
-
|
|
22238
|
-
|
|
22239
|
-
|
|
22240
|
-
|
|
22241
|
-
|
|
22242
|
-
|
|
22243
|
-
|
|
22244
|
-
|
|
22245
|
-
|
|
22246
|
-
|
|
22476
|
+
class ConfirmSelectComponent {
|
|
22477
|
+
constructor() {
|
|
22478
|
+
this.dataSource = [];
|
|
22479
|
+
this.disabled = false;
|
|
22480
|
+
this.fields = { text: "Game", value: "Id" };
|
|
22481
|
+
this.showSelectAll = true;
|
|
22482
|
+
this.valueChange = new EventEmitter();
|
|
22483
|
+
this.selectedItems = [];
|
|
22484
|
+
this.isInteracted = false;
|
|
22485
|
+
}
|
|
22486
|
+
/**
|
|
22487
|
+
* @return {?}
|
|
22488
|
+
*/
|
|
22489
|
+
ngOnInit() {
|
|
22490
|
+
this.getInfo();
|
|
22491
|
+
this.resetSelectedItems();
|
|
22492
|
+
}
|
|
22493
|
+
/**
|
|
22494
|
+
* @param {?} changes
|
|
22495
|
+
* @return {?}
|
|
22496
|
+
*/
|
|
22497
|
+
ngOnChanges(changes) {
|
|
22498
|
+
if (changes.value && !changes.value.firstChange) {
|
|
22499
|
+
this.resetSelectedItems();
|
|
22247
22500
|
}
|
|
22248
|
-
|
|
22249
|
-
|
|
22250
|
-
|
|
22501
|
+
}
|
|
22502
|
+
/**
|
|
22503
|
+
* @return {?}
|
|
22504
|
+
*/
|
|
22505
|
+
getInfo() {
|
|
22506
|
+
this.translation = JSON.parse(localStorage.getItem("translation"));
|
|
22507
|
+
}
|
|
22508
|
+
/**
|
|
22509
|
+
* @return {?}
|
|
22510
|
+
*/
|
|
22511
|
+
resetSelectedItems() {
|
|
22512
|
+
this.selectedItems = JSON.parse(JSON.stringify(this.value || []));
|
|
22513
|
+
if (this.comfirmSelect) {
|
|
22514
|
+
this.comfirmSelect.value = this.selectedItems;
|
|
22251
22515
|
}
|
|
22252
|
-
}
|
|
22253
|
-
|
|
22254
|
-
|
|
22255
|
-
|
|
22256
|
-
|
|
22257
|
-
|
|
22258
|
-
|
|
22259
|
-
|
|
22260
|
-
|
|
22261
|
-
|
|
22262
|
-
|
|
22263
|
-
|
|
22264
|
-
|
|
22265
|
-
|
|
22266
|
-
|
|
22267
|
-
|
|
22268
|
-
|
|
22269
|
-
|
|
22270
|
-
|
|
22271
|
-
|
|
22272
|
-
|
|
22273
|
-
|
|
22274
|
-
|
|
22275
|
-
|
|
22276
|
-
|
|
22516
|
+
}
|
|
22517
|
+
/**
|
|
22518
|
+
* @return {?}
|
|
22519
|
+
*/
|
|
22520
|
+
onCancel() {
|
|
22521
|
+
this.isInteracted = true;
|
|
22522
|
+
this.resetSelectedItems();
|
|
22523
|
+
this.comfirmSelect.hidePopup();
|
|
22524
|
+
}
|
|
22525
|
+
/**
|
|
22526
|
+
* @return {?}
|
|
22527
|
+
*/
|
|
22528
|
+
onApply() {
|
|
22529
|
+
this.isInteracted = true;
|
|
22530
|
+
/** @type {?} */
|
|
22531
|
+
const val = this.comfirmSelect.value;
|
|
22532
|
+
this.valueChange.emit(val);
|
|
22533
|
+
this.comfirmSelect.hidePopup();
|
|
22534
|
+
}
|
|
22535
|
+
/**
|
|
22536
|
+
* @param {?} e
|
|
22537
|
+
* @return {?}
|
|
22538
|
+
*/
|
|
22539
|
+
onClose(e) {
|
|
22540
|
+
if (this.isInteracted) {
|
|
22541
|
+
this.isInteracted = false;
|
|
22277
22542
|
}
|
|
22278
|
-
|
|
22279
|
-
|
|
22280
|
-
return undefined;
|
|
22543
|
+
else {
|
|
22544
|
+
this.resetSelectedItems();
|
|
22281
22545
|
}
|
|
22282
|
-
}
|
|
22546
|
+
}
|
|
22547
|
+
}
|
|
22548
|
+
ConfirmSelectComponent.decorators = [
|
|
22549
|
+
{ type: Component, args: [{
|
|
22550
|
+
selector: "rs-confirm-select",
|
|
22551
|
+
template: "<div class=\"rs-confirm-select\">\r\n <ejs-multiselect\r\n #comfirmSelect\r\n [dataSource]=\"dataSource\"\r\n [showDropDownIcon]=\"true\"\r\n [placeholder]=\"placeholder\"\r\n [(ngModel)]=\"selectedItems\"\r\n [fields]=\"fields\"\r\n [showSelectAll]=\"showSelectAll\"\r\n mode=\"CheckBox\"\r\n [footerTemplate]=\"footerTemplate\"\r\n [showClearButton]=\"false\"\r\n (close)=\"onClose($event)\"\r\n filterType=\"Contains\"\r\n >\r\n <ng-template #footerTemplate=\"\" let-data=\"data\">\r\n <div class=\"confirm-select-footer\">\r\n <button class=\"e-btn\" (click)=\"onCancel()\">\r\n {{ translation.CANCEL }}\r\n </button>\r\n <button class=\"e-btn e-primary\" (click)=\"onApply()\">\r\n {{ translation.APPLY }}\r\n </button>\r\n </div>\r\n </ng-template>\r\n </ejs-multiselect>\r\n</div>\r\n",
|
|
22552
|
+
styles: [".confirm-select-footer{display:flex;align-items:center;justify-content:flex-end;padding:0 12px;gap:12px;height:40px;border-top:solid 1px var(--rs-border-color)}"]
|
|
22553
|
+
}] }
|
|
22554
|
+
];
|
|
22555
|
+
ConfirmSelectComponent.propDecorators = {
|
|
22556
|
+
comfirmSelect: [{ type: ViewChild, args: ["comfirmSelect", { static: false },] }],
|
|
22557
|
+
value: [{ type: Input }],
|
|
22558
|
+
dataSource: [{ type: Input }],
|
|
22559
|
+
disabled: [{ type: Input }],
|
|
22560
|
+
fields: [{ type: Input }],
|
|
22561
|
+
placeholder: [{ type: Input }],
|
|
22562
|
+
showSelectAll: [{ type: Input }],
|
|
22563
|
+
valueChange: [{ type: Output }]
|
|
22564
|
+
};
|
|
22565
|
+
if (false) {
|
|
22566
|
+
/** @type {?} */
|
|
22567
|
+
ConfirmSelectComponent.prototype.comfirmSelect;
|
|
22568
|
+
/** @type {?} */
|
|
22569
|
+
ConfirmSelectComponent.prototype.value;
|
|
22570
|
+
/** @type {?} */
|
|
22571
|
+
ConfirmSelectComponent.prototype.dataSource;
|
|
22572
|
+
/** @type {?} */
|
|
22573
|
+
ConfirmSelectComponent.prototype.disabled;
|
|
22574
|
+
/** @type {?} */
|
|
22575
|
+
ConfirmSelectComponent.prototype.fields;
|
|
22576
|
+
/** @type {?} */
|
|
22577
|
+
ConfirmSelectComponent.prototype.placeholder;
|
|
22578
|
+
/** @type {?} */
|
|
22579
|
+
ConfirmSelectComponent.prototype.showSelectAll;
|
|
22580
|
+
/** @type {?} */
|
|
22581
|
+
ConfirmSelectComponent.prototype.valueChange;
|
|
22582
|
+
/** @type {?} */
|
|
22583
|
+
ConfirmSelectComponent.prototype.translation;
|
|
22584
|
+
/** @type {?} */
|
|
22585
|
+
ConfirmSelectComponent.prototype.selectedItems;
|
|
22586
|
+
/** @type {?} */
|
|
22587
|
+
ConfirmSelectComponent.prototype.isInteracted;
|
|
22283
22588
|
}
|
|
22284
22589
|
|
|
22285
22590
|
/**
|
|
22286
22591
|
* @fileoverview added by tsickle
|
|
22287
|
-
* Generated from: lib/form/richtexteditor/
|
|
22592
|
+
* Generated from: lib/form/richtexteditor/ai-config.ts
|
|
22288
22593
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
22289
22594
|
*/
|
|
22290
|
-
// font family
|
|
22291
|
-
/** @type {?} */
|
|
22292
|
-
const fontFamily = {
|
|
22293
|
-
default: "Arial",
|
|
22294
|
-
items: [
|
|
22295
|
-
{
|
|
22296
|
-
text: "Arial",
|
|
22297
|
-
value: "Arial, Helvetica, sans-serif",
|
|
22298
|
-
cssClass: "e-arial",
|
|
22299
|
-
command: "Font",
|
|
22300
|
-
subCommand: "FontName",
|
|
22301
|
-
},
|
|
22302
|
-
{
|
|
22303
|
-
text: "Times New Roman",
|
|
22304
|
-
value: "Times New Roman,Times,serif",
|
|
22305
|
-
cssClass: "e-times-new-roman",
|
|
22306
|
-
command: "Font",
|
|
22307
|
-
subCommand: "FontName",
|
|
22308
|
-
},
|
|
22309
|
-
{
|
|
22310
|
-
text: "Helvetica",
|
|
22311
|
-
value: "Helvetica",
|
|
22312
|
-
cssClass: "e-helvetica",
|
|
22313
|
-
command: "Font",
|
|
22314
|
-
subCommand: "FontName",
|
|
22315
|
-
},
|
|
22316
|
-
{
|
|
22317
|
-
text: "Calibri",
|
|
22318
|
-
value: "Calibri, Helvetica, sans-serif",
|
|
22319
|
-
cssClass: "e-calibri",
|
|
22320
|
-
command: "Font",
|
|
22321
|
-
subCommand: "FontName",
|
|
22322
|
-
},
|
|
22323
|
-
{
|
|
22324
|
-
text: "Verdana",
|
|
22325
|
-
value: "Verdana,Geneva,sans-serif",
|
|
22326
|
-
cssClass: "e-verdana",
|
|
22327
|
-
command: "Font",
|
|
22328
|
-
subCommand: "FontName",
|
|
22329
|
-
},
|
|
22330
|
-
{
|
|
22331
|
-
text: "Georgia",
|
|
22332
|
-
value: "Georgia,serif",
|
|
22333
|
-
cssClass: "e-georgia",
|
|
22334
|
-
command: "Font",
|
|
22335
|
-
subCommand: "FontName",
|
|
22336
|
-
},
|
|
22337
|
-
{
|
|
22338
|
-
text: "Open Sans",
|
|
22339
|
-
value: "Open Sans, sans-serif",
|
|
22340
|
-
cssClass: "e-open-sans",
|
|
22341
|
-
command: "Font",
|
|
22342
|
-
subCommand: "FontName",
|
|
22343
|
-
},
|
|
22344
|
-
{
|
|
22345
|
-
text: "Roboto",
|
|
22346
|
-
value: "Roboto",
|
|
22347
|
-
cssClass: "e-roboto",
|
|
22348
|
-
command: "Font",
|
|
22349
|
-
subCommand: "FontName",
|
|
22350
|
-
},
|
|
22351
|
-
{
|
|
22352
|
-
text: "Lato",
|
|
22353
|
-
value: "Lato, sans-serif",
|
|
22354
|
-
cssClass: "e-lato",
|
|
22355
|
-
command: "Font",
|
|
22356
|
-
subCommand: "FontName",
|
|
22357
|
-
},
|
|
22358
|
-
{
|
|
22359
|
-
text: "Montserrat",
|
|
22360
|
-
value: "Montserrat, sans-serif",
|
|
22361
|
-
cssClass: "e-montserrat",
|
|
22362
|
-
command: "Font",
|
|
22363
|
-
subCommand: "FontName",
|
|
22364
|
-
},
|
|
22365
|
-
{
|
|
22366
|
-
text: "Segoe UI",
|
|
22367
|
-
value: "Segoe UI",
|
|
22368
|
-
cssClass: "e-segoe-ui",
|
|
22369
|
-
command: "Font",
|
|
22370
|
-
subCommand: "FontName",
|
|
22371
|
-
},
|
|
22372
|
-
{
|
|
22373
|
-
text: "Impact",
|
|
22374
|
-
value: "Impact,Charcoal,sans-serif",
|
|
22375
|
-
cssClass: "e-impact",
|
|
22376
|
-
command: "Font",
|
|
22377
|
-
subCommand: "FontName",
|
|
22378
|
-
},
|
|
22379
|
-
],
|
|
22380
|
-
};
|
|
22381
|
-
// line height配置
|
|
22382
|
-
/** @type {?} */
|
|
22383
|
-
const lineHeight_items = [
|
|
22384
|
-
{
|
|
22385
|
-
text: "1.0",
|
|
22386
|
-
},
|
|
22387
|
-
{
|
|
22388
|
-
text: "1.15",
|
|
22389
|
-
},
|
|
22390
|
-
{
|
|
22391
|
-
text: "1.5",
|
|
22392
|
-
},
|
|
22393
|
-
{
|
|
22394
|
-
text: "2.0",
|
|
22395
|
-
},
|
|
22396
|
-
{
|
|
22397
|
-
text: "2.5",
|
|
22398
|
-
},
|
|
22399
|
-
{
|
|
22400
|
-
text: "3.0",
|
|
22401
|
-
},
|
|
22402
|
-
];
|
|
22403
22595
|
/**
|
|
22404
22596
|
* @record
|
|
22405
22597
|
*/
|
|
22406
|
-
function
|
|
22598
|
+
function AIConfig() { }
|
|
22407
22599
|
if (false) {
|
|
22408
22600
|
/** @type {?} */
|
|
22409
|
-
|
|
22601
|
+
AIConfig.prototype.endpoint;
|
|
22410
22602
|
/** @type {?} */
|
|
22411
|
-
|
|
22603
|
+
AIConfig.prototype.apiKey;
|
|
22412
22604
|
/** @type {?} */
|
|
22413
|
-
|
|
22605
|
+
AIConfig.prototype.deployment;
|
|
22414
22606
|
/** @type {?} */
|
|
22415
|
-
|
|
22607
|
+
AIConfig.prototype.apiVersion;
|
|
22416
22608
|
/** @type {?} */
|
|
22417
|
-
|
|
22609
|
+
AIConfig.prototype.enabled;
|
|
22418
22610
|
}
|
|
22419
|
-
|
|
22420
|
-
const BULLET_STYLES = [
|
|
22421
|
-
{
|
|
22422
|
-
id: "disc",
|
|
22423
|
-
text: "● 实心圆点",
|
|
22424
|
-
symbol: "●",
|
|
22425
|
-
iconCss: "e-icons e-bullet-disc",
|
|
22426
|
-
description: "标准实心圆点",
|
|
22427
|
-
},
|
|
22428
|
-
{
|
|
22429
|
-
id: "circle",
|
|
22430
|
-
text: "○ 空心圆点",
|
|
22431
|
-
symbol: "○",
|
|
22432
|
-
iconCss: "e-icons e-bullet-circle",
|
|
22433
|
-
description: "空心圆点",
|
|
22434
|
-
},
|
|
22435
|
-
{
|
|
22436
|
-
id: "square",
|
|
22437
|
-
text: "■ 实心方块",
|
|
22438
|
-
symbol: "■",
|
|
22439
|
-
iconCss: "e-icons e-bullet-square",
|
|
22440
|
-
description: "实心方块",
|
|
22441
|
-
},
|
|
22442
|
-
{
|
|
22443
|
-
id: "diamond",
|
|
22444
|
-
text: "◆ 实心菱形",
|
|
22445
|
-
symbol: "◆",
|
|
22446
|
-
iconCss: "e-icons e-bullet-diamond",
|
|
22447
|
-
description: "实心菱形",
|
|
22448
|
-
},
|
|
22449
|
-
{
|
|
22450
|
-
id: "triangle",
|
|
22451
|
-
text: "► 实心三角",
|
|
22452
|
-
symbol: "►",
|
|
22453
|
-
iconCss: "e-icons e-bullet-triangle",
|
|
22454
|
-
description: "实心三角形",
|
|
22455
|
-
},
|
|
22456
|
-
{
|
|
22457
|
-
id: "arrow",
|
|
22458
|
-
text: "➤ 箭头",
|
|
22459
|
-
symbol: "➤",
|
|
22460
|
-
iconCss: "e-icons e-bullet-arrow",
|
|
22461
|
-
description: "箭头符号",
|
|
22462
|
-
},
|
|
22463
|
-
{
|
|
22464
|
-
id: "star",
|
|
22465
|
-
text: "★ 星形",
|
|
22466
|
-
symbol: "★",
|
|
22467
|
-
iconCss: "e-icons e-bullet-star",
|
|
22468
|
-
description: "星形符号",
|
|
22469
|
-
},
|
|
22470
|
-
{
|
|
22471
|
-
id: "check",
|
|
22472
|
-
text: "✓ 对勾",
|
|
22473
|
-
symbol: "✓",
|
|
22474
|
-
iconCss: "e-icons e-bullet-check",
|
|
22475
|
-
description: "对勾符号",
|
|
22476
|
-
},
|
|
22477
|
-
{
|
|
22478
|
-
id: "heart",
|
|
22479
|
-
text: "♥ 心形",
|
|
22480
|
-
symbol: "♥",
|
|
22481
|
-
iconCss: "e-icons e-bullet-heart",
|
|
22482
|
-
description: "心形符号",
|
|
22483
|
-
},
|
|
22484
|
-
{
|
|
22485
|
-
id: "bullet",
|
|
22486
|
-
text: "• 小圆点",
|
|
22487
|
-
symbol: "•",
|
|
22488
|
-
iconCss: "e-icons e-bullet-bullet",
|
|
22489
|
-
description: "小圆点",
|
|
22490
|
-
},
|
|
22491
|
-
];
|
|
22492
|
-
// 获取符号样式
|
|
22611
|
+
// 从环境配置获取AI配置
|
|
22493
22612
|
/**
|
|
22494
|
-
* @param {?} id
|
|
22495
22613
|
* @return {?}
|
|
22496
22614
|
*/
|
|
22497
|
-
function
|
|
22498
|
-
return
|
|
22499
|
-
|
|
22500
|
-
|
|
22501
|
-
|
|
22502
|
-
|
|
22615
|
+
function getAIConfig() {
|
|
22616
|
+
return {
|
|
22617
|
+
endpoint: "https://aidevused.openai.azure.com/",
|
|
22618
|
+
apiKey: "ccba76e279f64653a50ac4fee90afe5c",
|
|
22619
|
+
deployment: "gpt-4",
|
|
22620
|
+
apiVersion: "2025-01-01-preview",
|
|
22621
|
+
enabled: true,
|
|
22622
|
+
};
|
|
22503
22623
|
}
|
|
22504
|
-
//
|
|
22624
|
+
// 检查配置是否有效
|
|
22505
22625
|
/**
|
|
22626
|
+
* @param {?} config
|
|
22506
22627
|
* @return {?}
|
|
22507
22628
|
*/
|
|
22508
|
-
function
|
|
22509
|
-
|
|
22629
|
+
function isAIConfigValid(config) {
|
|
22630
|
+
// 检查是否为aidevused端点且有有效API密钥
|
|
22631
|
+
return !!((config.endpoint &&
|
|
22632
|
+
config.apiKey &&
|
|
22633
|
+
config.deployment &&
|
|
22634
|
+
config.enabled &&
|
|
22635
|
+
config.endpoint === "https://aidevused.openai.azure.com/" &&
|
|
22636
|
+
config.apiKey !== "your-api-key-here") // Azure OpenAI API密钥通常以sk-开头
|
|
22637
|
+
);
|
|
22510
22638
|
}
|
|
22511
|
-
//
|
|
22639
|
+
// 从后端API获取AI配置(推荐方式)
|
|
22512
22640
|
/**
|
|
22513
|
-
* @param {?} ul
|
|
22514
|
-
* @param {?} style
|
|
22515
22641
|
* @return {?}
|
|
22642
|
+
* @this {*}
|
|
22516
22643
|
*/
|
|
22517
|
-
function
|
|
22518
|
-
|
|
22519
|
-
|
|
22520
|
-
|
|
22521
|
-
|
|
22522
|
-
|
|
22523
|
-
|
|
22524
|
-
|
|
22525
|
-
|
|
22526
|
-
|
|
22527
|
-
|
|
22528
|
-
|
|
22529
|
-
|
|
22530
|
-
ul.style.listStyleType = "none";
|
|
22531
|
-
ul.setAttribute("data-bullet-style", style.id);
|
|
22532
|
-
/** @type {?} */
|
|
22533
|
-
const listItems = ul.querySelectorAll("li");
|
|
22534
|
-
listItems.forEach((/**
|
|
22535
|
-
* @param {?} li
|
|
22536
|
-
* @return {?}
|
|
22537
|
-
*/
|
|
22538
|
-
(li) => {
|
|
22539
|
-
// 移除现有的自定义符号
|
|
22540
|
-
/** @type {?} */
|
|
22541
|
-
const existingBullet = li.querySelector(".custom-bullet");
|
|
22542
|
-
if (existingBullet) {
|
|
22543
|
-
existingBullet.remove();
|
|
22544
|
-
}
|
|
22545
|
-
// 添加新的自定义符号
|
|
22546
|
-
/** @type {?} */
|
|
22547
|
-
const bullet = document.createElement("span");
|
|
22548
|
-
bullet.className = "custom-bullet";
|
|
22549
|
-
bullet.textContent = style.symbol;
|
|
22550
|
-
bullet.style.marginRight = "8px";
|
|
22551
|
-
bullet.style.color = "#666";
|
|
22552
|
-
// 将符号插入到列表项的开头
|
|
22553
|
-
li.insertBefore(bullet, li.firstChild);
|
|
22554
|
-
}));
|
|
22555
|
-
}
|
|
22644
|
+
function getAIConfigFromBackend() {
|
|
22645
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22646
|
+
try {
|
|
22647
|
+
// 这里应该调用你的后端API来获取AI配置
|
|
22648
|
+
// 例如:return await this.http.get('/api/ai-config');
|
|
22649
|
+
// 临时返回默认配置
|
|
22650
|
+
return getAIConfig();
|
|
22651
|
+
}
|
|
22652
|
+
catch (error) {
|
|
22653
|
+
console.error("Failed to get AI config from backend:", error);
|
|
22654
|
+
return getAIConfig();
|
|
22655
|
+
}
|
|
22656
|
+
});
|
|
22556
22657
|
}
|
|
22557
22658
|
|
|
22558
22659
|
/**
|
|
22559
22660
|
* @fileoverview added by tsickle
|
|
22560
|
-
* Generated from: lib/form/richtexteditor/
|
|
22661
|
+
* Generated from: lib/form/richtexteditor/openapi.ts
|
|
22561
22662
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
22562
22663
|
*/
|
|
22563
|
-
|
|
22564
|
-
|
|
22565
|
-
|
|
22566
|
-
|
|
22567
|
-
|
|
22568
|
-
|
|
22569
|
-
|
|
22570
|
-
|
|
22571
|
-
|
|
22572
|
-
|
|
22573
|
-
|
|
22574
|
-
|
|
22575
|
-
|
|
22576
|
-
|
|
22577
|
-
|
|
22578
|
-
|
|
22579
|
-
|
|
22580
|
-
|
|
22581
|
-
|
|
22582
|
-
|
|
22583
|
-
|
|
22584
|
-
|
|
22585
|
-
saveFormat: "Blob",
|
|
22586
|
-
allowedTypes: [".svg", ".png"],
|
|
22587
|
-
display: "none",
|
|
22588
|
-
};
|
|
22589
|
-
this.size = "";
|
|
22590
|
-
this.dropValIndex = 0;
|
|
22591
|
-
this.queryList = [
|
|
22592
|
-
{ id: "Rephrase", text: "Rephrase" },
|
|
22593
|
-
{ id: "Grammar", text: "Correct Grammar" },
|
|
22594
|
-
{ id: "Summarize", text: "Summarize" },
|
|
22595
|
-
{ id: "Elaborate", text: "Elaborate" },
|
|
22596
|
-
{ id: "Translate", text: "Translate" },
|
|
22597
|
-
{ id: "SentimentAnalysis", text: "Sentiment Analysis" },
|
|
22598
|
-
];
|
|
22599
|
-
this.rephraseTyleList = [
|
|
22600
|
-
{ text: "Standard", id: "Standard" },
|
|
22601
|
-
{ text: "Fluent", id: "Fluent" },
|
|
22602
|
-
{ text: "Professional", id: "Professional" },
|
|
22603
|
-
];
|
|
22604
|
-
this.languageList = [
|
|
22605
|
-
{ id: "EN", text: "English" },
|
|
22606
|
-
{ id: "ZH", text: "Chinese (Simplified)" },
|
|
22607
|
-
{ id: "ES", text: "Spanish" },
|
|
22608
|
-
{ id: "ZHT", text: "Chinese (Traditional)" },
|
|
22609
|
-
{ id: "HI", text: "Hindi" },
|
|
22610
|
-
{ id: "AR", text: "Arabic" },
|
|
22611
|
-
{ id: "BN", text: "Bengali" },
|
|
22612
|
-
{ id: "PT", text: "Portuguese" },
|
|
22613
|
-
{ id: "RU", text: "Russian" },
|
|
22614
|
-
{ id: "JA", text: "Japanese" },
|
|
22615
|
-
{ id: "DE", text: "German" },
|
|
22616
|
-
{ id: "KO", text: "Korean" },
|
|
22617
|
-
{ id: "FR", text: "French" },
|
|
22618
|
-
{ id: "IT", text: "Italian" },
|
|
22619
|
-
{ id: "TR", text: "Turkish" },
|
|
22620
|
-
];
|
|
22621
|
-
this.promptQuery = "";
|
|
22622
|
-
this.isSentimentCheck = false;
|
|
22623
|
-
this.subQuery = "";
|
|
22624
|
-
this.chipValue = "Standard";
|
|
22625
|
-
this.tools = {
|
|
22626
|
-
enableFloating: false,
|
|
22627
|
-
items: [
|
|
22628
|
-
{
|
|
22629
|
-
tooltipText: "AI Assist",
|
|
22630
|
-
template: '<button class="e-tbar-btn e-btn" tabindex="-1" id="ai_assistant_button_tbar" style="width:100%"><div class="e-rte-dropdown-btn-text">AI Assist</div></button>',
|
|
22664
|
+
// import { testAIFunction } from './ai-test';
|
|
22665
|
+
// testAIFunction();
|
|
22666
|
+
// 使用fetch API发送请求到Azure OpenAI
|
|
22667
|
+
/**
|
|
22668
|
+
* @param {?} messages
|
|
22669
|
+
* @param {?} config
|
|
22670
|
+
* @return {?}
|
|
22671
|
+
* @this {*}
|
|
22672
|
+
*/
|
|
22673
|
+
function sendAIRequest(messages, config) {
|
|
22674
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22675
|
+
try {
|
|
22676
|
+
/** @type {?} */
|
|
22677
|
+
const url = `${config.endpoint}/openai/deployments/${config.deployment}/chat/completions?api-version=${config.apiVersion}`;
|
|
22678
|
+
/** @type {?} */
|
|
22679
|
+
const url1 = `${config.endpoint}`;
|
|
22680
|
+
/** @type {?} */
|
|
22681
|
+
const response = yield fetch(url, {
|
|
22682
|
+
method: 'POST',
|
|
22683
|
+
headers: {
|
|
22684
|
+
'Content-Type': 'application/json',
|
|
22685
|
+
'api-key': config.apiKey,
|
|
22631
22686
|
},
|
|
22632
|
-
|
|
22633
|
-
|
|
22634
|
-
|
|
22635
|
-
|
|
22636
|
-
|
|
22637
|
-
|
|
22638
|
-
|
|
22639
|
-
|
|
22640
|
-
|
|
22641
|
-
|
|
22642
|
-
|
|
22643
|
-
|
|
22644
|
-
|
|
22645
|
-
|
|
22687
|
+
body: JSON.stringify({
|
|
22688
|
+
messages: messages,
|
|
22689
|
+
max_tokens: 1000,
|
|
22690
|
+
temperature: 0.7,
|
|
22691
|
+
top_p: 1,
|
|
22692
|
+
frequency_penalty: 0,
|
|
22693
|
+
presence_penalty: 0,
|
|
22694
|
+
}),
|
|
22695
|
+
});
|
|
22696
|
+
if (!response.ok) {
|
|
22697
|
+
/** @type {?} */
|
|
22698
|
+
const errorText = yield response.text();
|
|
22699
|
+
throw new Error(`HTTP error! status: ${response.status}, message: ${errorText}`);
|
|
22700
|
+
}
|
|
22701
|
+
/** @type {?} */
|
|
22702
|
+
const data = yield response.json();
|
|
22703
|
+
if (!data.choices || !data.choices[0] || !data.choices[0].message) {
|
|
22704
|
+
throw new Error('Invalid response format from AI service');
|
|
22705
|
+
}
|
|
22706
|
+
return data.choices[0].message.content;
|
|
22707
|
+
}
|
|
22708
|
+
catch (error) {
|
|
22709
|
+
console.error('AI request failed:', error);
|
|
22710
|
+
throw error;
|
|
22711
|
+
}
|
|
22712
|
+
});
|
|
22713
|
+
}
|
|
22714
|
+
// 备用方案:使用模拟数据(用于开发测试)
|
|
22715
|
+
/**
|
|
22716
|
+
* @param {?} subQuery
|
|
22717
|
+
* @param {?} promptQuery
|
|
22718
|
+
* @return {?}
|
|
22719
|
+
*/
|
|
22720
|
+
function getMockAIResponse(subQuery, promptQuery) {
|
|
22721
|
+
/** @type {?} */
|
|
22722
|
+
const mockResponses = {
|
|
22723
|
+
Rephrase: `Rephrased: ${promptQuery}`,
|
|
22724
|
+
Grammar: `Corrected: ${promptQuery}`,
|
|
22725
|
+
Summarize: `Summary: ${promptQuery.substring(0, 100)}...`,
|
|
22726
|
+
Elaborate: `Elaborated: ${promptQuery} with additional details and context.`,
|
|
22727
|
+
Translate: `Translated: ${promptQuery}`,
|
|
22728
|
+
SentimentAnalysis: '😊 Positive',
|
|
22729
|
+
};
|
|
22730
|
+
for (const [key, value] of Object.entries(mockResponses)) {
|
|
22731
|
+
if (subQuery.includes(key)) {
|
|
22732
|
+
return value;
|
|
22733
|
+
}
|
|
22734
|
+
}
|
|
22735
|
+
return `AI processed: ${promptQuery}`;
|
|
22736
|
+
}
|
|
22737
|
+
// 主要的AI请求方法
|
|
22738
|
+
/**
|
|
22739
|
+
* @param {?} subQuery
|
|
22740
|
+
* @param {?} promptQuery
|
|
22741
|
+
* @return {?}
|
|
22742
|
+
* @this {*}
|
|
22743
|
+
*/
|
|
22744
|
+
function OpenAiModelRTE(subQuery, promptQuery) {
|
|
22745
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22746
|
+
try {
|
|
22747
|
+
/** @type {?} */
|
|
22748
|
+
const config = getAIConfig();
|
|
22749
|
+
// 检查配置是否有效
|
|
22750
|
+
if (!isAIConfigValid(config)) {
|
|
22751
|
+
console.warn('AI configuration is incomplete or disabled, using mock response');
|
|
22752
|
+
return getMockAIResponse(subQuery, promptQuery);
|
|
22753
|
+
}
|
|
22754
|
+
/** @type {?} */
|
|
22755
|
+
const messages = [
|
|
22646
22756
|
{
|
|
22647
|
-
|
|
22648
|
-
|
|
22757
|
+
role: 'system',
|
|
22758
|
+
content: subQuery.includes('emoji followed by the sentiment in the format')
|
|
22759
|
+
? 'You are a helpful assistant. Please respond in string format.'
|
|
22760
|
+
: "NOTE: Return same html format just do changes content only. don't change html formats.",
|
|
22649
22761
|
},
|
|
22650
|
-
"OrderedList",
|
|
22651
|
-
"UnorderedList",
|
|
22652
|
-
"Outdent",
|
|
22653
|
-
"Indent",
|
|
22654
|
-
"|",
|
|
22655
|
-
"CreateLink",
|
|
22656
22762
|
{
|
|
22657
|
-
|
|
22658
|
-
|
|
22659
|
-
'<div class="e-tbar-btn-text" style="font-weight: 500;"><img src="/assets/img/file-icon.svg" style="position: relative;top: -2px;"/><div class="uploadActions"><div id="uploadFromUser">Computer File</div><div id="relationDom">Ticket Attachment</div></div></div></button>',
|
|
22763
|
+
role: 'user',
|
|
22764
|
+
content: `${subQuery} ${promptQuery}`,
|
|
22660
22765
|
},
|
|
22661
|
-
|
|
22662
|
-
"FormatPainter",
|
|
22663
|
-
"ClearFormat",
|
|
22664
|
-
"|",
|
|
22665
|
-
"Undo",
|
|
22666
|
-
"Redo",
|
|
22667
|
-
],
|
|
22668
|
-
};
|
|
22669
|
-
}
|
|
22670
|
-
/**
|
|
22671
|
-
* @return {?}
|
|
22672
|
-
*/
|
|
22673
|
-
ngOnInit() { }
|
|
22674
|
-
/**
|
|
22675
|
-
* @param {?} args
|
|
22676
|
-
* @return {?}
|
|
22677
|
-
*/
|
|
22678
|
-
onContentChange(args) {
|
|
22679
|
-
/** @type {?} */
|
|
22680
|
-
const tables = document.querySelectorAll("table.e-rte-table");
|
|
22681
|
-
tables.forEach((/**
|
|
22682
|
-
* @param {?} table
|
|
22683
|
-
* @return {?}
|
|
22684
|
-
*/
|
|
22685
|
-
(table) => {
|
|
22766
|
+
];
|
|
22686
22767
|
/** @type {?} */
|
|
22687
|
-
const
|
|
22688
|
-
|
|
22689
|
-
|
|
22690
|
-
|
|
22768
|
+
const result = yield sendAIRequest(messages, config);
|
|
22769
|
+
return result;
|
|
22770
|
+
}
|
|
22771
|
+
catch (error) {
|
|
22772
|
+
console.error('AI request failed, using mock response:', error);
|
|
22773
|
+
return getMockAIResponse(subQuery, promptQuery);
|
|
22774
|
+
}
|
|
22775
|
+
});
|
|
22776
|
+
}
|
|
22777
|
+
// 兼容性方法(保持向后兼容)
|
|
22778
|
+
/**
|
|
22779
|
+
* @param {?} options
|
|
22780
|
+
* @return {?}
|
|
22781
|
+
* @this {*}
|
|
22782
|
+
*/
|
|
22783
|
+
function getAzureChatAIRequest(options) {
|
|
22784
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22785
|
+
try {
|
|
22691
22786
|
/** @type {?} */
|
|
22692
|
-
const
|
|
22693
|
-
|
|
22694
|
-
|
|
22695
|
-
|
|
22696
|
-
*/
|
|
22697
|
-
(td) => {
|
|
22698
|
-
td.style.border = "1px solid #adb5bd";
|
|
22699
|
-
td.style.height = "20px";
|
|
22700
|
-
td.style.minWidth = "20px";
|
|
22701
|
-
td.style.padding = "2px 5px";
|
|
22702
|
-
td.style.boxSizing = "border-box";
|
|
22703
|
-
}));
|
|
22704
|
-
}));
|
|
22705
|
-
this.change.emit(args);
|
|
22706
|
-
}
|
|
22707
|
-
/**
|
|
22708
|
-
* @return {?}
|
|
22709
|
-
*/
|
|
22710
|
-
onCreate() {
|
|
22711
|
-
//bind the a click event
|
|
22712
|
-
// let editorContent = this.rteObj.contentModule.getEditPanel() as HTMLElement;
|
|
22713
|
-
// editorContent.addEventListener('click', this.OnClicked.bind(this));
|
|
22714
|
-
//add the line height
|
|
22715
|
-
this.editorManager = this.rteObj.formatter.editorManager;
|
|
22716
|
-
/** @type {?} */
|
|
22717
|
-
let splitButton = new DropDownButton({
|
|
22718
|
-
items: lineHeight_items,
|
|
22719
|
-
iconCss: "e-icons e-line-spacing",
|
|
22720
|
-
select: this.onSelect.bind(this),
|
|
22721
|
-
});
|
|
22722
|
-
splitButton.appendTo("#lineheight_tbar");
|
|
22723
|
-
// ai assist
|
|
22724
|
-
/** @type {?} */
|
|
22725
|
-
let aiassistantButton = new DropDownButton({
|
|
22726
|
-
items: this.queryList,
|
|
22727
|
-
// iconCss: "e-btn-icon e-icons e-assistview-icon e-icon-left",
|
|
22728
|
-
select: (/**
|
|
22729
|
-
* @param {?} args
|
|
22730
|
-
* @return {?}
|
|
22731
|
-
*/
|
|
22732
|
-
(args) => this.aiQuerySelectedMenu(args)),
|
|
22733
|
-
});
|
|
22734
|
-
aiassistantButton.appendTo("#ai_assistant_button_tbar");
|
|
22735
|
-
}
|
|
22736
|
-
/**
|
|
22737
|
-
* @private
|
|
22738
|
-
* @param {?} args
|
|
22739
|
-
* @return {?}
|
|
22740
|
-
*/
|
|
22741
|
-
onSelect(args) {
|
|
22742
|
-
if (this.rteObj.formatter.getUndoRedoStack().length === 0) {
|
|
22743
|
-
this.rteObj.formatter.saveData();
|
|
22744
|
-
}
|
|
22745
|
-
/** @type {?} */
|
|
22746
|
-
let nodes = this.editorManager.domNode.blockNodes();
|
|
22747
|
-
for (let i = 0; nodes.length > i; i++) {
|
|
22748
|
-
((/** @type {?} */ (nodes[i]))).style.lineHeight = args.item.text;
|
|
22749
|
-
}
|
|
22750
|
-
this.rteObj.formatter.saveData();
|
|
22751
|
-
this.rteObj.formatter.enableUndo(this.rteObj);
|
|
22752
|
-
}
|
|
22753
|
-
/**
|
|
22754
|
-
* @private
|
|
22755
|
-
* @param {?} args
|
|
22756
|
-
* @return {?}
|
|
22757
|
-
*/
|
|
22758
|
-
aiQuerySelectedMenu(args) {
|
|
22759
|
-
this.dialogueOpen(args.item.text);
|
|
22760
|
-
}
|
|
22761
|
-
/**
|
|
22762
|
-
* @param {?} selectedQuery
|
|
22763
|
-
* @return {?}
|
|
22764
|
-
*/
|
|
22765
|
-
dialogueOpen(selectedQuery) {
|
|
22766
|
-
/** @type {?} */
|
|
22767
|
-
var selectionText = this.rteObj.getSelectedHtml();
|
|
22768
|
-
this.selectedQuery = selectedQuery;
|
|
22769
|
-
if (selectionText) {
|
|
22787
|
+
const config = getAIConfig();
|
|
22788
|
+
if (!isAIConfigValid(config)) {
|
|
22789
|
+
return null;
|
|
22790
|
+
}
|
|
22770
22791
|
/** @type {?} */
|
|
22771
|
-
|
|
22772
|
-
|
|
22773
|
-
this.dropValIndex = this.queryList.findIndex((/**
|
|
22774
|
-
* @param {?} q
|
|
22775
|
-
* @return {?}
|
|
22776
|
-
*/
|
|
22777
|
-
(q) => q.text.toLowerCase() === selectedQuery.toLowerCase()));
|
|
22778
|
-
this.queryCategory.index = this.dropValIndex;
|
|
22779
|
-
this.leftRte.value = this.promptQuery = selectionText;
|
|
22780
|
-
this.leftRte.refreshUI();
|
|
22781
|
-
this.AIdialog.show();
|
|
22782
|
-
this.updateAISugesstionsData(selectedQuery);
|
|
22783
|
-
}
|
|
22784
|
-
else {
|
|
22785
|
-
this.showMsg = true;
|
|
22786
|
-
setTimeout((/**
|
|
22787
|
-
* @return {?}
|
|
22788
|
-
*/
|
|
22789
|
-
() => {
|
|
22790
|
-
this.showMsg = false;
|
|
22791
|
-
}), 3000);
|
|
22792
|
-
console.log("Please select the content to perform the AI operation.");
|
|
22792
|
+
const result = yield sendAIRequest(options.messages, config);
|
|
22793
|
+
return result;
|
|
22793
22794
|
}
|
|
22794
|
-
|
|
22795
|
-
|
|
22796
|
-
|
|
22797
|
-
* @return {?}
|
|
22798
|
-
*/
|
|
22799
|
-
updateAISugesstionsData(selectedQuery) {
|
|
22800
|
-
this.isSentimentCheck = false;
|
|
22801
|
-
switch (selectedQuery) {
|
|
22802
|
-
case "Summarize":
|
|
22803
|
-
this.subQuery = "Summarize the upcoming sentence shortly.";
|
|
22804
|
-
break;
|
|
22805
|
-
case "Elaborate":
|
|
22806
|
-
this.subQuery = "Elaborate on the upcoming sentence.";
|
|
22807
|
-
break;
|
|
22808
|
-
case "Rephrase":
|
|
22809
|
-
this.subQuery = this.chipValue + " rephrase the upcoming sentence.";
|
|
22810
|
-
break;
|
|
22811
|
-
case "Correct Grammar":
|
|
22812
|
-
this.subQuery = "Correct the grammar of the upcoming sentence.";
|
|
22813
|
-
break;
|
|
22814
|
-
case "Translate":
|
|
22815
|
-
this.subQuery =
|
|
22816
|
-
"Translate the upcoming sentence to " + this.translatelanguage + ".";
|
|
22817
|
-
break;
|
|
22818
|
-
case "Sentiment Analysis":
|
|
22819
|
-
this.isSentimentCheck = true;
|
|
22820
|
-
this.subQuery =
|
|
22821
|
-
'Analyze the sentiment and grammar of the following paragraphs and provide the expression score with an emoji followed by the sentiment in the format: "😊 Neutral". \n\nNOTE: Avoid any additional text or explanation:';
|
|
22822
|
-
break;
|
|
22795
|
+
catch (err) {
|
|
22796
|
+
console.error('Error occurred:', err);
|
|
22797
|
+
return null;
|
|
22823
22798
|
}
|
|
22824
|
-
|
|
22825
|
-
|
|
22826
|
-
|
|
22827
|
-
|
|
22828
|
-
|
|
22829
|
-
|
|
22799
|
+
});
|
|
22800
|
+
}
|
|
22801
|
+
/**
|
|
22802
|
+
* @param {?} prompt
|
|
22803
|
+
* @return {?}
|
|
22804
|
+
* @this {*}
|
|
22805
|
+
*/
|
|
22806
|
+
function getAzureTextAIRequest(prompt) {
|
|
22807
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22830
22808
|
try {
|
|
22831
|
-
|
|
22832
|
-
|
|
22833
|
-
|
|
22834
|
-
|
|
22835
|
-
"none";
|
|
22836
|
-
this.sentimentButton.element.style.display = "none";
|
|
22837
|
-
this.regenerateButton.disabled = true;
|
|
22838
|
-
this.copyButton.disabled = true;
|
|
22839
|
-
this.replaceButton.disabled = true;
|
|
22840
|
-
this.apiResultData = this.getResponseFromOpenAI(this.subQuery, this.promptQuery);
|
|
22841
|
-
this.apiResultData.then((/**
|
|
22842
|
-
* @param {?} result
|
|
22843
|
-
* @return {?}
|
|
22844
|
-
*/
|
|
22845
|
-
(result) => {
|
|
22846
|
-
this.AIResult = this.isSentimentCheck ? this.promptQuery : result;
|
|
22847
|
-
this.sentimentButton.content = result
|
|
22848
|
-
.toLowerCase()
|
|
22849
|
-
.includes("positive")
|
|
22850
|
-
? "😊 Positive"
|
|
22851
|
-
: result.toLowerCase().includes("negative")
|
|
22852
|
-
? "😞 Negative"
|
|
22853
|
-
: "😐 Neutral";
|
|
22854
|
-
this.sentimentButton.element.style.display = !this.isSentimentCheck
|
|
22855
|
-
? "none"
|
|
22856
|
-
: "";
|
|
22857
|
-
this.rightRte.value = this.AIResult;
|
|
22858
|
-
/** @type {?} */
|
|
22859
|
-
var noResultsFound = !(this.AIResult || this.promptQuery);
|
|
22860
|
-
((/** @type {?} */ (document.getElementById("no-results-found")))).style.display = noResultsFound ? "" : "none";
|
|
22861
|
-
this.regenerateButton.disabled = noResultsFound;
|
|
22862
|
-
this.copyButton.disabled = noResultsFound;
|
|
22863
|
-
this.replaceButton.disabled = noResultsFound;
|
|
22864
|
-
((/** @type {?} */ (document.getElementById("skeletonId")))).style.display =
|
|
22865
|
-
"none";
|
|
22866
|
-
((/** @type {?} */ (document.getElementById("rightRte")))).style.display =
|
|
22867
|
-
noResultsFound ? "none" : "";
|
|
22868
|
-
console.log(noResultsFound, ((/** @type {?} */ (document.getElementById("rightRte")))).style);
|
|
22869
|
-
// this.ref.markForCheck();
|
|
22870
|
-
}));
|
|
22809
|
+
/** @type {?} */
|
|
22810
|
+
const config = getAIConfig();
|
|
22811
|
+
if (!isAIConfigValid(config)) {
|
|
22812
|
+
return undefined;
|
|
22871
22813
|
}
|
|
22872
|
-
}
|
|
22873
|
-
catch (_a) {
|
|
22874
|
-
// this.toastObj.show();
|
|
22875
|
-
}
|
|
22876
|
-
}
|
|
22877
|
-
/**
|
|
22878
|
-
* @param {?} subQuery
|
|
22879
|
-
* @param {?} promptQuery
|
|
22880
|
-
* @return {?}
|
|
22881
|
-
*/
|
|
22882
|
-
getResponseFromOpenAI(subQuery, promptQuery) {
|
|
22883
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22884
22814
|
/** @type {?} */
|
|
22885
|
-
const
|
|
22886
|
-
|
|
22887
|
-
|
|
22888
|
-
|
|
22889
|
-
|
|
22890
|
-
|
|
22891
|
-
*/
|
|
22892
|
-
dialogShow() {
|
|
22893
|
-
(/** @type {?} */ (this.regenerateButton)).element.addEventListener("click", (/**
|
|
22894
|
-
* @return {?}
|
|
22895
|
-
*/
|
|
22896
|
-
() => {
|
|
22897
|
-
this.updateAISugesstions();
|
|
22898
|
-
}));
|
|
22899
|
-
(/** @type {?} */ (this.copyButton)).element.addEventListener("click", (/**
|
|
22900
|
-
* @return {?}
|
|
22901
|
-
*/
|
|
22902
|
-
() => {
|
|
22903
|
-
this.copyTextToClipboard(this.AIResult);
|
|
22904
|
-
}));
|
|
22905
|
-
(/** @type {?} */ (this.replaceButton)).element.addEventListener("click", (/**
|
|
22906
|
-
* @return {?}
|
|
22907
|
-
*/
|
|
22908
|
-
() => {
|
|
22815
|
+
const messages = [
|
|
22816
|
+
{
|
|
22817
|
+
role: 'user',
|
|
22818
|
+
content: prompt,
|
|
22819
|
+
},
|
|
22820
|
+
];
|
|
22909
22821
|
/** @type {?} */
|
|
22910
|
-
|
|
22911
|
-
|
|
22912
|
-
((/** @type {?} */ (this.rteObj))).executeCommand("insertHTML", this.AIResult, {
|
|
22913
|
-
undo: true,
|
|
22914
|
-
});
|
|
22915
|
-
this.closeDialog();
|
|
22916
|
-
}));
|
|
22917
|
-
((/** @type {?} */ (this.AIdialog))).element.style.display = "";
|
|
22918
|
-
}
|
|
22919
|
-
/**
|
|
22920
|
-
* @return {?}
|
|
22921
|
-
*/
|
|
22922
|
-
closeDialog() {
|
|
22923
|
-
this.AIdialog.hide();
|
|
22924
|
-
this.rightRte.value = "";
|
|
22925
|
-
this.leftRte.value = "";
|
|
22926
|
-
this.promptQuery = "";
|
|
22927
|
-
this.chipValue = "Standard";
|
|
22928
|
-
this.AIResult = "";
|
|
22929
|
-
this.dropValIndex = 0;
|
|
22930
|
-
this.selectedQuery = "Rephrase";
|
|
22931
|
-
this.sentimentButton.content = "😊 Neutral";
|
|
22932
|
-
}
|
|
22933
|
-
/**
|
|
22934
|
-
* @param {?} text
|
|
22935
|
-
* @return {?}
|
|
22936
|
-
*/
|
|
22937
|
-
copyTextToClipboard(text) {
|
|
22938
|
-
if (navigator.clipboard) {
|
|
22939
|
-
navigator.clipboard
|
|
22940
|
-
.writeText(text)
|
|
22941
|
-
.then((/**
|
|
22942
|
-
* @return {?}
|
|
22943
|
-
*/
|
|
22944
|
-
() => {
|
|
22945
|
-
console.log("Text copied to clipboard successfully!");
|
|
22946
|
-
}))
|
|
22947
|
-
.catch((/**
|
|
22948
|
-
* @param {?} err
|
|
22949
|
-
* @return {?}
|
|
22950
|
-
*/
|
|
22951
|
-
(err) => {
|
|
22952
|
-
console.error("Failed to copy text: ", err);
|
|
22953
|
-
}));
|
|
22954
|
-
}
|
|
22955
|
-
else {
|
|
22956
|
-
// Fallback for browsers that do not support the Clipboard API
|
|
22957
|
-
/** @type {?} */
|
|
22958
|
-
const textarea = document.createElement("textarea");
|
|
22959
|
-
textarea.value = text;
|
|
22960
|
-
document.body.appendChild(textarea);
|
|
22961
|
-
textarea.select();
|
|
22962
|
-
try {
|
|
22963
|
-
document.execCommand("copy");
|
|
22964
|
-
console.log("Text copied to clipboard using execCommand");
|
|
22965
|
-
}
|
|
22966
|
-
catch (err) {
|
|
22967
|
-
console.error("Failed to copy text: ", err);
|
|
22968
|
-
}
|
|
22969
|
-
finally {
|
|
22970
|
-
document.body.removeChild(textarea);
|
|
22971
|
-
}
|
|
22972
|
-
}
|
|
22973
|
-
}
|
|
22974
|
-
/**
|
|
22975
|
-
* @return {?}
|
|
22976
|
-
*/
|
|
22977
|
-
onOverlayClick() {
|
|
22978
|
-
/** @type {?} */
|
|
22979
|
-
let activeEle = this.AIdialog.element.querySelector(".char_block.e-active");
|
|
22980
|
-
if (activeEle) {
|
|
22981
|
-
activeEle.classList.remove("e-active");
|
|
22982
|
-
}
|
|
22983
|
-
this.closeDialog();
|
|
22984
|
-
}
|
|
22985
|
-
/**
|
|
22986
|
-
* @param {?} args
|
|
22987
|
-
* @return {?}
|
|
22988
|
-
*/
|
|
22989
|
-
onQuerySelect(args) {
|
|
22990
|
-
// this.chipList.selectedChips = 0;
|
|
22991
|
-
this.translatelanguage = "EN";
|
|
22992
|
-
this.selectedQuery = args.itemData.text;
|
|
22993
|
-
this.updateAISugesstionsData(args.itemData.text);
|
|
22994
|
-
}
|
|
22995
|
-
/**
|
|
22996
|
-
* @param {?} args
|
|
22997
|
-
* @return {?}
|
|
22998
|
-
*/
|
|
22999
|
-
onLanguageSelect(args) {
|
|
23000
|
-
this.translatelanguage = args.itemData.id;
|
|
23001
|
-
this.updateAISugesstionsData("Translate");
|
|
23002
|
-
}
|
|
23003
|
-
/**
|
|
23004
|
-
* @param {?} args
|
|
23005
|
-
* @return {?}
|
|
23006
|
-
*/
|
|
23007
|
-
onChipClick(args) {
|
|
23008
|
-
this.chipValue = args.itemData.text;
|
|
23009
|
-
// 事件会触发两次 必须判断args.text是否有值
|
|
23010
|
-
if (args.itemData.text)
|
|
23011
|
-
this.updateAISugesstionsData("Rephrase");
|
|
23012
|
-
}
|
|
23013
|
-
/**
|
|
23014
|
-
* @param {?} args
|
|
23015
|
-
* @return {?}
|
|
23016
|
-
*/
|
|
23017
|
-
_toolbarClick(args) {
|
|
23018
|
-
this.toolbarClick.emit(args);
|
|
23019
|
-
}
|
|
23020
|
-
/**
|
|
23021
|
-
* @return {?}
|
|
23022
|
-
*/
|
|
23023
|
-
hideToast() {
|
|
23024
|
-
this.showMsg = false;
|
|
23025
|
-
}
|
|
23026
|
-
/**
|
|
23027
|
-
* @return {?}
|
|
23028
|
-
*/
|
|
23029
|
-
onZoom() {
|
|
23030
|
-
if (this.size === "largest") {
|
|
23031
|
-
this.size = ""; // 恢复到原始大小
|
|
22822
|
+
const result = yield sendAIRequest(messages, config);
|
|
22823
|
+
return result;
|
|
23032
22824
|
}
|
|
23033
|
-
|
|
23034
|
-
|
|
22825
|
+
catch (err) {
|
|
22826
|
+
console.error('Error occurred:', err);
|
|
22827
|
+
return undefined;
|
|
23035
22828
|
}
|
|
23036
|
-
}
|
|
23037
|
-
}
|
|
23038
|
-
|
|
23039
|
-
|
|
23040
|
-
|
|
23041
|
-
|
|
23042
|
-
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
/** @
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
|
|
23049
|
-
|
|
23050
|
-
|
|
23051
|
-
|
|
23052
|
-
|
|
23053
|
-
|
|
23054
|
-
|
|
23055
|
-
|
|
23056
|
-
|
|
23057
|
-
|
|
23058
|
-
|
|
23059
|
-
|
|
23060
|
-
|
|
23061
|
-
|
|
23062
|
-
|
|
23063
|
-
|
|
23064
|
-
|
|
23065
|
-
|
|
22829
|
+
});
|
|
22830
|
+
}
|
|
22831
|
+
|
|
22832
|
+
/**
|
|
22833
|
+
* @fileoverview added by tsickle
|
|
22834
|
+
* Generated from: lib/form/richtexteditor/data-config.ts
|
|
22835
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
22836
|
+
*/
|
|
22837
|
+
// font family
|
|
22838
|
+
/** @type {?} */
|
|
22839
|
+
const fontFamily = {
|
|
22840
|
+
default: "Arial",
|
|
22841
|
+
items: [
|
|
22842
|
+
{
|
|
22843
|
+
text: "Arial",
|
|
22844
|
+
value: "Arial, Helvetica, sans-serif",
|
|
22845
|
+
cssClass: "e-arial",
|
|
22846
|
+
command: "Font",
|
|
22847
|
+
subCommand: "FontName",
|
|
22848
|
+
},
|
|
22849
|
+
{
|
|
22850
|
+
text: "Times New Roman",
|
|
22851
|
+
value: "Times New Roman,Times,serif",
|
|
22852
|
+
cssClass: "e-times-new-roman",
|
|
22853
|
+
command: "Font",
|
|
22854
|
+
subCommand: "FontName",
|
|
22855
|
+
},
|
|
22856
|
+
{
|
|
22857
|
+
text: "Helvetica",
|
|
22858
|
+
value: "Helvetica",
|
|
22859
|
+
cssClass: "e-helvetica",
|
|
22860
|
+
command: "Font",
|
|
22861
|
+
subCommand: "FontName",
|
|
22862
|
+
},
|
|
22863
|
+
{
|
|
22864
|
+
text: "Calibri",
|
|
22865
|
+
value: "Calibri, Helvetica, sans-serif",
|
|
22866
|
+
cssClass: "e-calibri",
|
|
22867
|
+
command: "Font",
|
|
22868
|
+
subCommand: "FontName",
|
|
22869
|
+
},
|
|
22870
|
+
{
|
|
22871
|
+
text: "Verdana",
|
|
22872
|
+
value: "Verdana,Geneva,sans-serif",
|
|
22873
|
+
cssClass: "e-verdana",
|
|
22874
|
+
command: "Font",
|
|
22875
|
+
subCommand: "FontName",
|
|
22876
|
+
},
|
|
22877
|
+
{
|
|
22878
|
+
text: "Georgia",
|
|
22879
|
+
value: "Georgia,serif",
|
|
22880
|
+
cssClass: "e-georgia",
|
|
22881
|
+
command: "Font",
|
|
22882
|
+
subCommand: "FontName",
|
|
22883
|
+
},
|
|
22884
|
+
{
|
|
22885
|
+
text: "Open Sans",
|
|
22886
|
+
value: "Open Sans, sans-serif",
|
|
22887
|
+
cssClass: "e-open-sans",
|
|
22888
|
+
command: "Font",
|
|
22889
|
+
subCommand: "FontName",
|
|
22890
|
+
},
|
|
22891
|
+
{
|
|
22892
|
+
text: "Roboto",
|
|
22893
|
+
value: "Roboto",
|
|
22894
|
+
cssClass: "e-roboto",
|
|
22895
|
+
command: "Font",
|
|
22896
|
+
subCommand: "FontName",
|
|
22897
|
+
},
|
|
22898
|
+
{
|
|
22899
|
+
text: "Lato",
|
|
22900
|
+
value: "Lato, sans-serif",
|
|
22901
|
+
cssClass: "e-lato",
|
|
22902
|
+
command: "Font",
|
|
22903
|
+
subCommand: "FontName",
|
|
22904
|
+
},
|
|
22905
|
+
{
|
|
22906
|
+
text: "Montserrat",
|
|
22907
|
+
value: "Montserrat, sans-serif",
|
|
22908
|
+
cssClass: "e-montserrat",
|
|
22909
|
+
command: "Font",
|
|
22910
|
+
subCommand: "FontName",
|
|
22911
|
+
},
|
|
22912
|
+
{
|
|
22913
|
+
text: "Segoe UI",
|
|
22914
|
+
value: "Segoe UI",
|
|
22915
|
+
cssClass: "e-segoe-ui",
|
|
22916
|
+
command: "Font",
|
|
22917
|
+
subCommand: "FontName",
|
|
22918
|
+
},
|
|
22919
|
+
{
|
|
22920
|
+
text: "Impact",
|
|
22921
|
+
value: "Impact,Charcoal,sans-serif",
|
|
22922
|
+
cssClass: "e-impact",
|
|
22923
|
+
command: "Font",
|
|
22924
|
+
subCommand: "FontName",
|
|
22925
|
+
},
|
|
22926
|
+
],
|
|
23066
22927
|
};
|
|
23067
|
-
|
|
23068
|
-
|
|
23069
|
-
|
|
23070
|
-
|
|
23071
|
-
|
|
23072
|
-
|
|
23073
|
-
|
|
23074
|
-
|
|
23075
|
-
|
|
23076
|
-
|
|
23077
|
-
|
|
23078
|
-
|
|
23079
|
-
|
|
23080
|
-
|
|
23081
|
-
|
|
23082
|
-
|
|
23083
|
-
|
|
23084
|
-
|
|
23085
|
-
|
|
23086
|
-
|
|
23087
|
-
|
|
23088
|
-
|
|
23089
|
-
|
|
23090
|
-
|
|
23091
|
-
|
|
23092
|
-
|
|
23093
|
-
|
|
23094
|
-
/** @type {?} */
|
|
23095
|
-
RichtexteditorComponent.prototype.target;
|
|
23096
|
-
/** @type {?} */
|
|
23097
|
-
RichtexteditorComponent.prototype.toolbarClick;
|
|
23098
|
-
/** @type {?} */
|
|
23099
|
-
RichtexteditorComponent.prototype.change;
|
|
23100
|
-
/** @type {?} */
|
|
23101
|
-
RichtexteditorComponent.prototype.family;
|
|
23102
|
-
/** @type {?} */
|
|
23103
|
-
RichtexteditorComponent.prototype.dialogWidth;
|
|
23104
|
-
/** @type {?} */
|
|
23105
|
-
RichtexteditorComponent.prototype.dialogHeight;
|
|
23106
|
-
/** @type {?} */
|
|
23107
|
-
RichtexteditorComponent.prototype.showZoomBtn;
|
|
23108
|
-
/** @type {?} */
|
|
23109
|
-
RichtexteditorComponent.prototype.showMsg;
|
|
23110
|
-
/** @type {?} */
|
|
23111
|
-
RichtexteditorComponent.prototype.insertImageSettings;
|
|
23112
|
-
/** @type {?} */
|
|
23113
|
-
RichtexteditorComponent.prototype.editorManager;
|
|
23114
|
-
/** @type {?} */
|
|
23115
|
-
RichtexteditorComponent.prototype.size;
|
|
23116
|
-
/** @type {?} */
|
|
23117
|
-
RichtexteditorComponent.prototype.selectedQuery;
|
|
23118
|
-
/** @type {?} */
|
|
23119
|
-
RichtexteditorComponent.prototype.dropValIndex;
|
|
23120
|
-
/** @type {?} */
|
|
23121
|
-
RichtexteditorComponent.prototype.queryList;
|
|
23122
|
-
/** @type {?} */
|
|
23123
|
-
RichtexteditorComponent.prototype.rephraseTyleList;
|
|
23124
|
-
/** @type {?} */
|
|
23125
|
-
RichtexteditorComponent.prototype.languageList;
|
|
23126
|
-
/** @type {?} */
|
|
23127
|
-
RichtexteditorComponent.prototype.promptQuery;
|
|
23128
|
-
/** @type {?} */
|
|
23129
|
-
RichtexteditorComponent.prototype.isSentimentCheck;
|
|
23130
|
-
/** @type {?} */
|
|
23131
|
-
RichtexteditorComponent.prototype.subQuery;
|
|
22928
|
+
// line height配置
|
|
22929
|
+
/** @type {?} */
|
|
22930
|
+
const lineHeight_items = [
|
|
22931
|
+
{
|
|
22932
|
+
text: "1.0",
|
|
22933
|
+
},
|
|
22934
|
+
{
|
|
22935
|
+
text: "1.15",
|
|
22936
|
+
},
|
|
22937
|
+
{
|
|
22938
|
+
text: "1.5",
|
|
22939
|
+
},
|
|
22940
|
+
{
|
|
22941
|
+
text: "2.0",
|
|
22942
|
+
},
|
|
22943
|
+
{
|
|
22944
|
+
text: "2.5",
|
|
22945
|
+
},
|
|
22946
|
+
{
|
|
22947
|
+
text: "3.0",
|
|
22948
|
+
},
|
|
22949
|
+
];
|
|
22950
|
+
/**
|
|
22951
|
+
* @record
|
|
22952
|
+
*/
|
|
22953
|
+
function BulletStyle() { }
|
|
22954
|
+
if (false) {
|
|
23132
22955
|
/** @type {?} */
|
|
23133
|
-
|
|
22956
|
+
BulletStyle.prototype.id;
|
|
23134
22957
|
/** @type {?} */
|
|
23135
|
-
|
|
22958
|
+
BulletStyle.prototype.text;
|
|
23136
22959
|
/** @type {?} */
|
|
23137
|
-
|
|
22960
|
+
BulletStyle.prototype.symbol;
|
|
23138
22961
|
/** @type {?} */
|
|
23139
|
-
|
|
22962
|
+
BulletStyle.prototype.iconCss;
|
|
23140
22963
|
/** @type {?} */
|
|
23141
|
-
|
|
23142
|
-
|
|
23143
|
-
|
|
23144
|
-
|
|
23145
|
-
|
|
23146
|
-
|
|
23147
|
-
|
|
23148
|
-
|
|
22964
|
+
BulletStyle.prototype.description;
|
|
22965
|
+
}
|
|
22966
|
+
/** @type {?} */
|
|
22967
|
+
const BULLET_STYLES = [
|
|
22968
|
+
{
|
|
22969
|
+
id: "disc",
|
|
22970
|
+
text: "● 实心圆点",
|
|
22971
|
+
symbol: "●",
|
|
22972
|
+
iconCss: "e-icons e-bullet-disc",
|
|
22973
|
+
description: "标准实心圆点",
|
|
22974
|
+
},
|
|
22975
|
+
{
|
|
22976
|
+
id: "circle",
|
|
22977
|
+
text: "○ 空心圆点",
|
|
22978
|
+
symbol: "○",
|
|
22979
|
+
iconCss: "e-icons e-bullet-circle",
|
|
22980
|
+
description: "空心圆点",
|
|
22981
|
+
},
|
|
22982
|
+
{
|
|
22983
|
+
id: "square",
|
|
22984
|
+
text: "■ 实心方块",
|
|
22985
|
+
symbol: "■",
|
|
22986
|
+
iconCss: "e-icons e-bullet-square",
|
|
22987
|
+
description: "实心方块",
|
|
22988
|
+
},
|
|
22989
|
+
{
|
|
22990
|
+
id: "diamond",
|
|
22991
|
+
text: "◆ 实心菱形",
|
|
22992
|
+
symbol: "◆",
|
|
22993
|
+
iconCss: "e-icons e-bullet-diamond",
|
|
22994
|
+
description: "实心菱形",
|
|
22995
|
+
},
|
|
22996
|
+
{
|
|
22997
|
+
id: "triangle",
|
|
22998
|
+
text: "► 实心三角",
|
|
22999
|
+
symbol: "►",
|
|
23000
|
+
iconCss: "e-icons e-bullet-triangle",
|
|
23001
|
+
description: "实心三角形",
|
|
23002
|
+
},
|
|
23003
|
+
{
|
|
23004
|
+
id: "arrow",
|
|
23005
|
+
text: "➤ 箭头",
|
|
23006
|
+
symbol: "➤",
|
|
23007
|
+
iconCss: "e-icons e-bullet-arrow",
|
|
23008
|
+
description: "箭头符号",
|
|
23009
|
+
},
|
|
23010
|
+
{
|
|
23011
|
+
id: "star",
|
|
23012
|
+
text: "★ 星形",
|
|
23013
|
+
symbol: "★",
|
|
23014
|
+
iconCss: "e-icons e-bullet-star",
|
|
23015
|
+
description: "星形符号",
|
|
23016
|
+
},
|
|
23017
|
+
{
|
|
23018
|
+
id: "check",
|
|
23019
|
+
text: "✓ 对勾",
|
|
23020
|
+
symbol: "✓",
|
|
23021
|
+
iconCss: "e-icons e-bullet-check",
|
|
23022
|
+
description: "对勾符号",
|
|
23023
|
+
},
|
|
23024
|
+
{
|
|
23025
|
+
id: "heart",
|
|
23026
|
+
text: "♥ 心形",
|
|
23027
|
+
symbol: "♥",
|
|
23028
|
+
iconCss: "e-icons e-bullet-heart",
|
|
23029
|
+
description: "心形符号",
|
|
23030
|
+
},
|
|
23031
|
+
{
|
|
23032
|
+
id: "bullet",
|
|
23033
|
+
text: "• 小圆点",
|
|
23034
|
+
symbol: "•",
|
|
23035
|
+
iconCss: "e-icons e-bullet-bullet",
|
|
23036
|
+
description: "小圆点",
|
|
23037
|
+
},
|
|
23038
|
+
];
|
|
23039
|
+
// 获取符号样式
|
|
23149
23040
|
/**
|
|
23150
|
-
* @
|
|
23151
|
-
*
|
|
23152
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
23041
|
+
* @param {?} id
|
|
23042
|
+
* @return {?}
|
|
23153
23043
|
*/
|
|
23154
|
-
|
|
23155
|
-
/**
|
|
23156
|
-
* @param {?}
|
|
23157
|
-
*/
|
|
23158
|
-
constructor(dialogRef) {
|
|
23159
|
-
this.dialogRef = dialogRef;
|
|
23160
|
-
// 隐藏元素相关属性
|
|
23161
|
-
this.hideHeader = false;
|
|
23162
|
-
this.hideCloseIcon = false;
|
|
23163
|
-
this.hideCloseBtn = false;
|
|
23164
|
-
this.hideSaveBtn = false;
|
|
23165
|
-
this.hideDiscardBtn = false;
|
|
23166
|
-
this.saveBtnLabel = "";
|
|
23167
|
-
this.cancelBtnLabel = "";
|
|
23168
|
-
this.discardBtnLabel = "";
|
|
23169
|
-
this.showErrorIcon = false;
|
|
23170
|
-
this.showZoomBtn = false;
|
|
23171
|
-
// 显示相关属性
|
|
23172
|
-
this.dialogStyle = {};
|
|
23173
|
-
this.size = "";
|
|
23174
|
-
this.title = "Dialog";
|
|
23175
|
-
this.loading = false;
|
|
23176
|
-
this.saveEmit = new EventEmitter();
|
|
23177
|
-
this.closeEmit = new EventEmitter();
|
|
23178
|
-
this.defaultSize = "";
|
|
23179
|
-
this.customFooter = false;
|
|
23180
|
-
}
|
|
23181
|
-
/**
|
|
23182
|
-
* @return {?}
|
|
23183
|
-
*/
|
|
23184
|
-
ngAfterContentInit() {
|
|
23185
|
-
this.customFooter = !!this.footerContent;
|
|
23186
|
-
}
|
|
23187
|
-
/**
|
|
23188
|
-
* @return {?}
|
|
23189
|
-
*/
|
|
23190
|
-
ngOnInit() {
|
|
23191
|
-
this.getInfo();
|
|
23192
|
-
}
|
|
23193
|
-
/**
|
|
23194
|
-
* @return {?}
|
|
23195
|
-
*/
|
|
23196
|
-
onClose() {
|
|
23197
|
-
if (this.onCloseRequest) {
|
|
23198
|
-
this.onCloseRequest().then((/**
|
|
23199
|
-
* @param {?} confirmed
|
|
23200
|
-
* @return {?}
|
|
23201
|
-
*/
|
|
23202
|
-
(confirmed) => {
|
|
23203
|
-
if (confirmed) {
|
|
23204
|
-
this.dialogRef.close("close");
|
|
23205
|
-
}
|
|
23206
|
-
}));
|
|
23207
|
-
}
|
|
23208
|
-
else {
|
|
23209
|
-
this.dialogRef.close("close");
|
|
23210
|
-
}
|
|
23211
|
-
}
|
|
23212
|
-
/**
|
|
23213
|
-
* @return {?}
|
|
23214
|
-
*/
|
|
23215
|
-
onZoom() {
|
|
23216
|
-
if (this.size === "largest") {
|
|
23217
|
-
this.size = this.defaultSize; // 恢复到原始大小
|
|
23218
|
-
}
|
|
23219
|
-
else {
|
|
23220
|
-
this.size = "largest"; // 设置为最大化
|
|
23221
|
-
}
|
|
23222
|
-
}
|
|
23223
|
-
/**
|
|
23224
|
-
* @return {?}
|
|
23225
|
-
*/
|
|
23226
|
-
onSave() {
|
|
23227
|
-
this.dialogRef.close("save");
|
|
23228
|
-
}
|
|
23229
|
-
/**
|
|
23044
|
+
function getBulletStyle(id) {
|
|
23045
|
+
return BULLET_STYLES.find((/**
|
|
23046
|
+
* @param {?} style
|
|
23230
23047
|
* @return {?}
|
|
23231
23048
|
*/
|
|
23232
|
-
|
|
23233
|
-
|
|
23049
|
+
(style) => style.id === id));
|
|
23050
|
+
}
|
|
23051
|
+
// 获取所有符号样式
|
|
23052
|
+
/**
|
|
23053
|
+
* @return {?}
|
|
23054
|
+
*/
|
|
23055
|
+
function getAllBulletStyles() {
|
|
23056
|
+
return BULLET_STYLES;
|
|
23057
|
+
}
|
|
23058
|
+
// 应用符号样式到列表
|
|
23059
|
+
/**
|
|
23060
|
+
* @param {?} ul
|
|
23061
|
+
* @param {?} style
|
|
23062
|
+
* @return {?}
|
|
23063
|
+
*/
|
|
23064
|
+
function applyBulletStyle(ul, style) {
|
|
23065
|
+
if (style.id === "disc" || style.id === "circle" || style.id === "square") {
|
|
23066
|
+
// 使用CSS list-style-type
|
|
23067
|
+
ul.style.listStyleType = style.id;
|
|
23068
|
+
// 移除自定义符号
|
|
23069
|
+
ul.querySelectorAll(".custom-bullet").forEach((/**
|
|
23070
|
+
* @param {?} bullet
|
|
23071
|
+
* @return {?}
|
|
23072
|
+
*/
|
|
23073
|
+
(bullet) => bullet.remove()));
|
|
23234
23074
|
}
|
|
23235
|
-
|
|
23236
|
-
|
|
23237
|
-
|
|
23238
|
-
|
|
23239
|
-
|
|
23240
|
-
|
|
23241
|
-
|
|
23242
|
-
|
|
23243
|
-
|
|
23244
|
-
|
|
23075
|
+
else {
|
|
23076
|
+
// 使用自定义符号
|
|
23077
|
+
ul.style.listStyleType = "none";
|
|
23078
|
+
ul.setAttribute("data-bullet-style", style.id);
|
|
23079
|
+
/** @type {?} */
|
|
23080
|
+
const listItems = ul.querySelectorAll("li");
|
|
23081
|
+
listItems.forEach((/**
|
|
23082
|
+
* @param {?} li
|
|
23083
|
+
* @return {?}
|
|
23084
|
+
*/
|
|
23085
|
+
(li) => {
|
|
23086
|
+
// 移除现有的自定义符号
|
|
23087
|
+
/** @type {?} */
|
|
23088
|
+
const existingBullet = li.querySelector(".custom-bullet");
|
|
23089
|
+
if (existingBullet) {
|
|
23090
|
+
existingBullet.remove();
|
|
23091
|
+
}
|
|
23092
|
+
// 添加新的自定义符号
|
|
23093
|
+
/** @type {?} */
|
|
23094
|
+
const bullet = document.createElement("span");
|
|
23095
|
+
bullet.className = "custom-bullet";
|
|
23096
|
+
bullet.textContent = style.symbol;
|
|
23097
|
+
bullet.style.marginRight = "8px";
|
|
23098
|
+
bullet.style.color = "#666";
|
|
23099
|
+
// 将符号插入到列表项的开头
|
|
23100
|
+
li.insertBefore(bullet, li.firstChild);
|
|
23101
|
+
}));
|
|
23245
23102
|
}
|
|
23246
|
-
}
|
|
23247
|
-
CommonDialogComponent.decorators = [
|
|
23248
|
-
{ type: Component, args: [{
|
|
23249
|
-
selector: "rs-common-dialog",
|
|
23250
|
-
template: "<div class=\"dialog\" [ngClass]=\"size\" [ngStyle]=\"dialogStyle\">\r\n <!-- \u5934\u90E8 -->\r\n <div *ngIf=\"!hideHeader\" mat-dialog-title class=\"dialog__header\">\r\n <div class=\"header__title\">\r\n <img\r\n src=\"../../../assets/img/notification-status-warning.svg\"\r\n alt=\"\"\r\n *ngIf=\"showErrorIcon\"\r\n />\r\n {{ title }}\r\n </div>\r\n <div class=\"header__actions\">\r\n <div *ngIf=\"showZoomBtn\" class=\"header-btn\" (click)=\"onZoom()\">\r\n <img\r\n class=\"header-icon\"\r\n *ngIf=\"size === 'largest'\"\r\n src=\"../../../assets/img/dialog-shrink.svg\"\r\n />\r\n <img\r\n class=\"header-icon\"\r\n *ngIf=\"size !== 'largest'\"\r\n src=\"../../../assets/img/dialog-grow.svg\"\r\n />\r\n </div>\r\n <div *ngIf=\"!hideCloseIcon\" class=\"header-btn\" (click)=\"onClose()\">\r\n <img class=\"header-icon\" src=\"../../../assets/img/dialog-close.svg\" />\r\n </div>\r\n </div>\r\n </div>\r\n <!-- \u5185\u5BB9 -->\r\n <div class=\"dialog__content\" mat-dialog-content>\r\n <ng-content></ng-content>\r\n </div>\r\n <!-- \u5E95\u90E8\u6309\u94AE -->\r\n <div mat-dialog-actions class=\"dialog__footer\">\r\n <ng-content select=\"[footerSlot]\"></ng-content>\r\n <!-- \u9ED8\u8BA4\u5C55\u793A\u4FDD\u5B58/\u5173\u95ED\u6309\u94AE -->\r\n <ng-container *ngIf=\"!customFooter\">\r\n <ng-template [ngTemplateOutlet]=\"defaultTemplate\"></ng-template>\r\n </ng-container>\r\n <ng-template #defaultTemplate>\r\n <button\r\n *ngIf=\"!hideCloseBtn\"\r\n class=\"e-btn\"\r\n (click)=\"onClose()\"\r\n >\r\n {{ cancelBtnLabel }}\r\n </button>\r\n <button\r\n *ngIf=\"!hideDiscardBtn\"\r\n class=\"e-btn\"\r\n (click)=\"onDiscard()\"\r\n >\r\n {{ discardBtnLabel }}\r\n </button>\r\n <button\r\n *ngIf=\"!hideSaveBtn\"\r\n class=\"e-btn e-primary\"\r\n (click)=\"onSave()\"\r\n >\r\n {{ saveBtnLabel }}\r\n </button>\r\n </ng-template>\r\n </div>\r\n <!-- loading -->\r\n <div class=\"dialog__loading\" [hidden]=\"!loading\">\r\n <img src=\"../../../assets/img/raise_loading.gif\" alt=\"\" />\r\n </div>\r\n</div>\r\n",
|
|
23251
|
-
styles: [":host::ng-deep .dialog{position:relative;max-height:90vh;font-weight:400;padding:20px;overflow:hidden;display:flex;flex-direction:column}:host::ng-deep .dialog.largest{width:96vw!important;height:88vh!important;max-width:2100px;padding:20px}:host::ng-deep .dialog.medium{width:500px;padding:20px}:host::ng-deep .dialog.small{width:350px;padding:20px 16px}:host::ng-deep .dialog.small .dialog__header{color:#002c4f;margin-bottom:16px}:host::ng-deep .dialog.small .dialog__header .header__title{font-size:13px;line-height:16px}:host::ng-deep .dialog.small .dialog__content{font-size:12px;line-height:16px}:host::ng-deep .dialog.small .dialog__footer{min-height:42px;padding:16px 0 0;font-size:12px;line-height:14px}:host::ng-deep .dialog.small .dialog__footer button{padding:6px 12px;min-width:60px}:host::ng-deep .dialog.large{width:800px;padding:20px}:host::ng-deep .dialog .dialog__header{width:100%;display:flex;justify-content:space-between;align-items:center;padding:0}:host::ng-deep .dialog .dialog__header::before{display:none}:host::ng-deep .dialog .dialog__header .header__title{color:#002c4f;font-family:Arial;font-size:15px;font-weight:700;line-height:18px;flex:1;overflow:hidden;display:flex;align-items:center;gap:8px}:host::ng-deep .dialog .dialog__header .header__actions{display:flex;align-items:center;gap:20px}:host::ng-deep .dialog .dialog__header .header-icon{display:block}:host::ng-deep .dialog .dialog__header .header-btn{cursor:pointer;padding:2px;display:flex;justify-content:center;align-items:center}:host::ng-deep .dialog .dialog__content{width:100%;min-height:38px;position:relative;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;font-size:13px;line-height:19px;flex:1;height:0}:host::ng-deep .dialog .dialog__footer{position:relative;display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:20px 0 0;font-size:13px;line-height:16px;margin-bottom:0}:host::ng-deep .dialog .dialog__loading{height:100%;background:0 0;position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999}:host::ng-deep .dialog .dialog__loading img{position:absolute;left:50%;top:50%;width:40px;height:40px;transform:translate(-50%,-50%)}"]
|
|
23252
|
-
}] }
|
|
23253
|
-
];
|
|
23254
|
-
/** @nocollapse */
|
|
23255
|
-
CommonDialogComponent.ctorParameters = () => [
|
|
23256
|
-
{ type: MatDialogRef }
|
|
23257
|
-
];
|
|
23258
|
-
CommonDialogComponent.propDecorators = {
|
|
23259
|
-
hideHeader: [{ type: Input }],
|
|
23260
|
-
hideCloseIcon: [{ type: Input }],
|
|
23261
|
-
hideCloseBtn: [{ type: Input }],
|
|
23262
|
-
hideSaveBtn: [{ type: Input }],
|
|
23263
|
-
hideDiscardBtn: [{ type: Input }],
|
|
23264
|
-
saveBtnLabel: [{ type: Input }],
|
|
23265
|
-
cancelBtnLabel: [{ type: Input }],
|
|
23266
|
-
discardBtnLabel: [{ type: Input }],
|
|
23267
|
-
showErrorIcon: [{ type: Input }],
|
|
23268
|
-
showZoomBtn: [{ type: Input }],
|
|
23269
|
-
onCloseRequest: [{ type: Input }],
|
|
23270
|
-
dialogStyle: [{ type: Input }],
|
|
23271
|
-
size: [{ type: Input }],
|
|
23272
|
-
title: [{ type: Input }],
|
|
23273
|
-
loading: [{ type: Input }],
|
|
23274
|
-
saveEmit: [{ type: Output }],
|
|
23275
|
-
closeEmit: [{ type: Output }],
|
|
23276
|
-
footerContent: [{ type: ContentChild, args: ["footerSlot", { static: false },] }]
|
|
23277
|
-
};
|
|
23278
|
-
if (false) {
|
|
23279
|
-
/** @type {?} */
|
|
23280
|
-
CommonDialogComponent.prototype.translation;
|
|
23281
|
-
/** @type {?} */
|
|
23282
|
-
CommonDialogComponent.prototype.hideHeader;
|
|
23283
|
-
/** @type {?} */
|
|
23284
|
-
CommonDialogComponent.prototype.hideCloseIcon;
|
|
23285
|
-
/** @type {?} */
|
|
23286
|
-
CommonDialogComponent.prototype.hideCloseBtn;
|
|
23287
|
-
/** @type {?} */
|
|
23288
|
-
CommonDialogComponent.prototype.hideSaveBtn;
|
|
23289
|
-
/** @type {?} */
|
|
23290
|
-
CommonDialogComponent.prototype.hideDiscardBtn;
|
|
23291
|
-
/** @type {?} */
|
|
23292
|
-
CommonDialogComponent.prototype.saveBtnLabel;
|
|
23293
|
-
/** @type {?} */
|
|
23294
|
-
CommonDialogComponent.prototype.cancelBtnLabel;
|
|
23295
|
-
/** @type {?} */
|
|
23296
|
-
CommonDialogComponent.prototype.discardBtnLabel;
|
|
23297
|
-
/** @type {?} */
|
|
23298
|
-
CommonDialogComponent.prototype.showErrorIcon;
|
|
23299
|
-
/** @type {?} */
|
|
23300
|
-
CommonDialogComponent.prototype.showZoomBtn;
|
|
23301
|
-
/** @type {?} */
|
|
23302
|
-
CommonDialogComponent.prototype.onCloseRequest;
|
|
23303
|
-
/** @type {?} */
|
|
23304
|
-
CommonDialogComponent.prototype.dialogStyle;
|
|
23305
|
-
/** @type {?} */
|
|
23306
|
-
CommonDialogComponent.prototype.size;
|
|
23307
|
-
/** @type {?} */
|
|
23308
|
-
CommonDialogComponent.prototype.title;
|
|
23309
|
-
/** @type {?} */
|
|
23310
|
-
CommonDialogComponent.prototype.loading;
|
|
23311
|
-
/** @type {?} */
|
|
23312
|
-
CommonDialogComponent.prototype.saveEmit;
|
|
23313
|
-
/** @type {?} */
|
|
23314
|
-
CommonDialogComponent.prototype.closeEmit;
|
|
23315
|
-
/** @type {?} */
|
|
23316
|
-
CommonDialogComponent.prototype.defaultSize;
|
|
23317
|
-
/** @type {?} */
|
|
23318
|
-
CommonDialogComponent.prototype.footerContent;
|
|
23319
|
-
/** @type {?} */
|
|
23320
|
-
CommonDialogComponent.prototype.customFooter;
|
|
23321
|
-
/** @type {?} */
|
|
23322
|
-
CommonDialogComponent.prototype.dialogRef;
|
|
23323
23103
|
}
|
|
23324
23104
|
|
|
23325
23105
|
/**
|
|
23326
23106
|
* @fileoverview added by tsickle
|
|
23327
|
-
* Generated from: lib/
|
|
23107
|
+
* Generated from: lib/form/richtexteditor/index.component.ts
|
|
23328
23108
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
23329
23109
|
*/
|
|
23330
|
-
class
|
|
23110
|
+
class RichtexteditorComponent {
|
|
23331
23111
|
/**
|
|
23332
|
-
* @param {?}
|
|
23333
|
-
* @param {?} domSanitizer
|
|
23112
|
+
* @param {?} ref
|
|
23334
23113
|
*/
|
|
23335
|
-
constructor(
|
|
23336
|
-
this.
|
|
23337
|
-
|
|
23114
|
+
constructor(ref) {
|
|
23115
|
+
this.ref = ref;
|
|
23116
|
+
// @ViewChild("chipList", { static: false }) public chipList!: ChipListComponent;
|
|
23117
|
+
this.placeholder = "";
|
|
23118
|
+
this.value = "";
|
|
23119
|
+
this.height = 150;
|
|
23120
|
+
this.autoSaveOnIdle = true;
|
|
23121
|
+
this.target = "#container"; // dialog 弹窗父级
|
|
23122
|
+
// dialog 弹窗父级
|
|
23123
|
+
this.toolbarClick = new EventEmitter();
|
|
23124
|
+
this.change = new EventEmitter();
|
|
23125
|
+
// @Output() change = new EventEmitter();
|
|
23126
|
+
this.family = fontFamily;
|
|
23127
|
+
this.dialogWidth = "800px";
|
|
23128
|
+
this.dialogHeight = "642px";
|
|
23129
|
+
this.showZoomBtn = true;
|
|
23130
|
+
this.showMsg = false;
|
|
23131
|
+
this.insertImageSettings = {
|
|
23132
|
+
saveFormat: "Blob",
|
|
23133
|
+
allowedTypes: [".svg", ".png"],
|
|
23134
|
+
display: "none",
|
|
23135
|
+
};
|
|
23136
|
+
this.size = "";
|
|
23137
|
+
this.dropValIndex = 0;
|
|
23138
|
+
this.queryList = [
|
|
23139
|
+
{ id: "Rephrase", text: "Rephrase" },
|
|
23140
|
+
{ id: "Grammar", text: "Correct Grammar" },
|
|
23141
|
+
{ id: "Summarize", text: "Summarize" },
|
|
23142
|
+
{ id: "Elaborate", text: "Elaborate" },
|
|
23143
|
+
{ id: "Translate", text: "Translate" },
|
|
23144
|
+
{ id: "SentimentAnalysis", text: "Sentiment Analysis" },
|
|
23145
|
+
];
|
|
23146
|
+
this.rephraseTyleList = [
|
|
23147
|
+
{ text: "Standard", id: "Standard" },
|
|
23148
|
+
{ text: "Fluent", id: "Fluent" },
|
|
23149
|
+
{ text: "Professional", id: "Professional" },
|
|
23150
|
+
];
|
|
23151
|
+
this.languageList = [
|
|
23152
|
+
{ id: "EN", text: "English" },
|
|
23153
|
+
{ id: "ZH", text: "Chinese (Simplified)" },
|
|
23154
|
+
{ id: "ES", text: "Spanish" },
|
|
23155
|
+
{ id: "ZHT", text: "Chinese (Traditional)" },
|
|
23156
|
+
{ id: "HI", text: "Hindi" },
|
|
23157
|
+
{ id: "AR", text: "Arabic" },
|
|
23158
|
+
{ id: "BN", text: "Bengali" },
|
|
23159
|
+
{ id: "PT", text: "Portuguese" },
|
|
23160
|
+
{ id: "RU", text: "Russian" },
|
|
23161
|
+
{ id: "JA", text: "Japanese" },
|
|
23162
|
+
{ id: "DE", text: "German" },
|
|
23163
|
+
{ id: "KO", text: "Korean" },
|
|
23164
|
+
{ id: "FR", text: "French" },
|
|
23165
|
+
{ id: "IT", text: "Italian" },
|
|
23166
|
+
{ id: "TR", text: "Turkish" },
|
|
23167
|
+
];
|
|
23168
|
+
this.promptQuery = "";
|
|
23169
|
+
this.isSentimentCheck = false;
|
|
23170
|
+
this.subQuery = "";
|
|
23171
|
+
this.chipValue = "Standard";
|
|
23172
|
+
this.tools = {
|
|
23173
|
+
enableFloating: false,
|
|
23174
|
+
items: [
|
|
23175
|
+
{
|
|
23176
|
+
tooltipText: "AI Assist",
|
|
23177
|
+
template: '<button class="e-tbar-btn e-btn" tabindex="-1" id="ai_assistant_button_tbar" style="width:100%"><div class="e-rte-dropdown-btn-text">AI Assist</div></button>',
|
|
23178
|
+
},
|
|
23179
|
+
"Bold",
|
|
23180
|
+
"Italic",
|
|
23181
|
+
"Underline",
|
|
23182
|
+
"StrikeThrough",
|
|
23183
|
+
"FontName",
|
|
23184
|
+
"FontSize",
|
|
23185
|
+
"FontColor",
|
|
23186
|
+
"BackgroundColor",
|
|
23187
|
+
"LowerCase",
|
|
23188
|
+
"UpperCase",
|
|
23189
|
+
"|",
|
|
23190
|
+
"CreateTable",
|
|
23191
|
+
"Formats",
|
|
23192
|
+
"Alignments",
|
|
23193
|
+
{
|
|
23194
|
+
tooltipText: "Line Height",
|
|
23195
|
+
template: '<button class="e-tbar-btn e-btn" tabindex="-1" id="lineheight_tbar" style="width:100%"></button>',
|
|
23196
|
+
},
|
|
23197
|
+
"OrderedList",
|
|
23198
|
+
"UnorderedList",
|
|
23199
|
+
"Outdent",
|
|
23200
|
+
"Indent",
|
|
23201
|
+
"|",
|
|
23202
|
+
"CreateLink",
|
|
23203
|
+
{
|
|
23204
|
+
tooltipText: "",
|
|
23205
|
+
template: '<button class="e-tbar-btn e-btn" tabindex="-1" id="custom_tbar" style="width:100%">' +
|
|
23206
|
+
'<div class="e-tbar-btn-text" style="font-weight: 500;"><img src="/assets/img/file-icon.svg" style="position: relative;top: -2px;"/><div class="uploadActions"><div id="uploadFromUser">Computer File</div><div id="relationDom">Ticket Attachment</div></div></div></button>',
|
|
23207
|
+
},
|
|
23208
|
+
"|",
|
|
23209
|
+
"FormatPainter",
|
|
23210
|
+
"ClearFormat",
|
|
23211
|
+
"|",
|
|
23212
|
+
"Undo",
|
|
23213
|
+
"Redo",
|
|
23214
|
+
],
|
|
23215
|
+
};
|
|
23338
23216
|
}
|
|
23339
23217
|
/**
|
|
23340
|
-
* @param {?} list
|
|
23341
23218
|
* @return {?}
|
|
23342
23219
|
*/
|
|
23343
|
-
|
|
23344
|
-
list.forEach((/**
|
|
23345
|
-
* @param {?} __0
|
|
23346
|
-
* @return {?}
|
|
23347
|
-
*/
|
|
23348
|
-
({ name, path }) => {
|
|
23349
|
-
this.registry.addSvgIcon(name, this.domSanitizer.bypassSecurityTrustResourceUrl(path));
|
|
23350
|
-
}));
|
|
23351
|
-
}
|
|
23352
|
-
}
|
|
23353
|
-
IconLoaderService.decorators = [
|
|
23354
|
-
{ type: Injectable }
|
|
23355
|
-
];
|
|
23356
|
-
/** @nocollapse */
|
|
23357
|
-
IconLoaderService.ctorParameters = () => [
|
|
23358
|
-
{ type: MatIconRegistry },
|
|
23359
|
-
{ type: DomSanitizer }
|
|
23360
|
-
];
|
|
23361
|
-
if (false) {
|
|
23362
|
-
/**
|
|
23363
|
-
* @type {?}
|
|
23364
|
-
* @private
|
|
23365
|
-
*/
|
|
23366
|
-
IconLoaderService.prototype.registry;
|
|
23220
|
+
ngOnInit() { }
|
|
23367
23221
|
/**
|
|
23368
|
-
* @
|
|
23369
|
-
* @
|
|
23222
|
+
* @param {?} args
|
|
23223
|
+
* @return {?}
|
|
23370
23224
|
*/
|
|
23371
|
-
|
|
23372
|
-
}
|
|
23373
|
-
|
|
23374
|
-
/**
|
|
23375
|
-
|
|
23376
|
-
|
|
23377
|
-
|
|
23378
|
-
|
|
23379
|
-
/** @type {?} */
|
|
23380
|
-
const
|
|
23381
|
-
|
|
23382
|
-
|
|
23383
|
-
|
|
23384
|
-
|
|
23385
|
-
|
|
23386
|
-
|
|
23225
|
+
onContentChange(args) {
|
|
23226
|
+
/** @type {?} */
|
|
23227
|
+
const tables = document.querySelectorAll("table.e-rte-table");
|
|
23228
|
+
tables.forEach((/**
|
|
23229
|
+
* @param {?} table
|
|
23230
|
+
* @return {?}
|
|
23231
|
+
*/
|
|
23232
|
+
(table) => {
|
|
23233
|
+
/** @type {?} */
|
|
23234
|
+
const htmlTable = (/** @type {?} */ (table));
|
|
23235
|
+
htmlTable.style.marginBottom = "10px";
|
|
23236
|
+
htmlTable.style.borderCollapse = "collapse";
|
|
23237
|
+
htmlTable.style.emptyCells = "show";
|
|
23238
|
+
/** @type {?} */
|
|
23239
|
+
const tdElements = table.querySelectorAll("td");
|
|
23240
|
+
tdElements.forEach((/**
|
|
23241
|
+
* @param {?} td
|
|
23242
|
+
* @return {?}
|
|
23243
|
+
*/
|
|
23244
|
+
(td) => {
|
|
23245
|
+
td.style.border = "1px solid #adb5bd";
|
|
23246
|
+
td.style.height = "20px";
|
|
23247
|
+
td.style.minWidth = "20px";
|
|
23248
|
+
td.style.padding = "2px 5px";
|
|
23249
|
+
td.style.boxSizing = "border-box";
|
|
23250
|
+
}));
|
|
23251
|
+
}));
|
|
23252
|
+
this.change.emit(args);
|
|
23253
|
+
}
|
|
23387
23254
|
/**
|
|
23388
|
-
* @param {?} routes
|
|
23389
23255
|
* @return {?}
|
|
23390
23256
|
*/
|
|
23391
|
-
|
|
23392
|
-
|
|
23257
|
+
onCreate() {
|
|
23258
|
+
//bind the a click event
|
|
23259
|
+
// let editorContent = this.rteObj.contentModule.getEditPanel() as HTMLElement;
|
|
23260
|
+
// editorContent.addEventListener('click', this.OnClicked.bind(this));
|
|
23261
|
+
//add the line height
|
|
23262
|
+
this.editorManager = this.rteObj.formatter.editorManager;
|
|
23263
|
+
/** @type {?} */
|
|
23264
|
+
let splitButton = new DropDownButton({
|
|
23265
|
+
items: lineHeight_items,
|
|
23266
|
+
iconCss: "e-icons e-line-spacing",
|
|
23267
|
+
select: this.onSelect.bind(this),
|
|
23268
|
+
});
|
|
23269
|
+
splitButton.appendTo("#lineheight_tbar");
|
|
23270
|
+
// ai assist
|
|
23271
|
+
/** @type {?} */
|
|
23272
|
+
let aiassistantButton = new DropDownButton({
|
|
23273
|
+
items: this.queryList,
|
|
23274
|
+
// iconCss: "e-btn-icon e-icons e-assistview-icon e-icon-left",
|
|
23275
|
+
select: (/**
|
|
23276
|
+
* @param {?} args
|
|
23277
|
+
* @return {?}
|
|
23278
|
+
*/
|
|
23279
|
+
(args) => this.aiQuerySelectedMenu(args)),
|
|
23280
|
+
});
|
|
23281
|
+
aiassistantButton.appendTo("#ai_assistant_button_tbar");
|
|
23393
23282
|
}
|
|
23394
23283
|
/**
|
|
23395
|
-
* @
|
|
23284
|
+
* @private
|
|
23285
|
+
* @param {?} args
|
|
23396
23286
|
* @return {?}
|
|
23397
23287
|
*/
|
|
23398
|
-
|
|
23399
|
-
|
|
23400
|
-
|
|
23401
|
-
// console.log("shouldDetach", toBeDeleteUrl, this.getRoutePath(route));
|
|
23402
|
-
if (toBeDeleteUrl === this.getRoutePath(route)) {
|
|
23403
|
-
// 对于新开的又即将关闭的tab,不缓存
|
|
23404
|
-
if (route.children.length === 0) {
|
|
23405
|
-
toBeDeleteUrl = "";
|
|
23406
|
-
}
|
|
23407
|
-
return false;
|
|
23288
|
+
onSelect(args) {
|
|
23289
|
+
if (this.rteObj.formatter.getUndoRedoStack().length === 0) {
|
|
23290
|
+
this.rteObj.formatter.saveData();
|
|
23408
23291
|
}
|
|
23409
|
-
|
|
23410
|
-
|
|
23292
|
+
/** @type {?} */
|
|
23293
|
+
let nodes = this.editorManager.domNode.blockNodes();
|
|
23294
|
+
for (let i = 0; nodes.length > i; i++) {
|
|
23295
|
+
((/** @type {?} */ (nodes[i]))).style.lineHeight = args.item.text;
|
|
23411
23296
|
}
|
|
23412
|
-
|
|
23413
|
-
|
|
23297
|
+
this.rteObj.formatter.saveData();
|
|
23298
|
+
this.rteObj.formatter.enableUndo(this.rteObj);
|
|
23414
23299
|
}
|
|
23415
23300
|
/**
|
|
23416
|
-
* @
|
|
23417
|
-
* @param {?}
|
|
23301
|
+
* @private
|
|
23302
|
+
* @param {?} args
|
|
23418
23303
|
* @return {?}
|
|
23419
23304
|
*/
|
|
23420
|
-
|
|
23421
|
-
|
|
23422
|
-
// console.log("store", storedRoutes);
|
|
23423
|
-
/** @type {?} */
|
|
23424
|
-
const key = this.getRoutePath(route);
|
|
23425
|
-
storedRoutes.set(key, handle);
|
|
23305
|
+
aiQuerySelectedMenu(args) {
|
|
23306
|
+
this.dialogueOpen(args.item.text);
|
|
23426
23307
|
}
|
|
23427
23308
|
/**
|
|
23428
|
-
* @param {?}
|
|
23309
|
+
* @param {?} selectedQuery
|
|
23429
23310
|
* @return {?}
|
|
23430
23311
|
*/
|
|
23431
|
-
|
|
23312
|
+
dialogueOpen(selectedQuery) {
|
|
23432
23313
|
/** @type {?} */
|
|
23433
|
-
|
|
23434
|
-
|
|
23314
|
+
var selectionText = this.rteObj.getSelectedHtml();
|
|
23315
|
+
this.selectedQuery = selectedQuery;
|
|
23316
|
+
if (selectionText) {
|
|
23317
|
+
/** @type {?} */
|
|
23318
|
+
let range = ((/** @type {?} */ (this.rteObj))).formatter.editorManager.nodeSelection.getRange(((/** @type {?} */ (this.rteObj))).contentModule.getDocument());
|
|
23319
|
+
((/** @type {?} */ (this.rteObj))).formatter.editorManager.nodeSelection.save(range, ((/** @type {?} */ (this.rteObj))).contentModule.getDocument());
|
|
23320
|
+
this.dropValIndex = this.queryList.findIndex((/**
|
|
23321
|
+
* @param {?} q
|
|
23322
|
+
* @return {?}
|
|
23323
|
+
*/
|
|
23324
|
+
(q) => q.text.toLowerCase() === selectedQuery.toLowerCase()));
|
|
23325
|
+
this.queryCategory.index = this.dropValIndex;
|
|
23326
|
+
this.leftRte.value = this.promptQuery = selectionText;
|
|
23327
|
+
this.leftRte.refreshUI();
|
|
23328
|
+
this.AIdialog.show();
|
|
23329
|
+
this.updateAISugesstionsData(selectedQuery);
|
|
23330
|
+
}
|
|
23331
|
+
else {
|
|
23332
|
+
this.showMsg = true;
|
|
23333
|
+
setTimeout((/**
|
|
23334
|
+
* @return {?}
|
|
23335
|
+
*/
|
|
23336
|
+
() => {
|
|
23337
|
+
this.showMsg = false;
|
|
23338
|
+
}), 3000);
|
|
23339
|
+
console.log("Please select the content to perform the AI operation.");
|
|
23340
|
+
}
|
|
23435
23341
|
}
|
|
23436
23342
|
/**
|
|
23437
|
-
* @param {?}
|
|
23343
|
+
* @param {?} selectedQuery
|
|
23438
23344
|
* @return {?}
|
|
23439
23345
|
*/
|
|
23440
|
-
|
|
23441
|
-
|
|
23442
|
-
|
|
23443
|
-
|
|
23444
|
-
|
|
23445
|
-
|
|
23446
|
-
|
|
23447
|
-
|
|
23346
|
+
updateAISugesstionsData(selectedQuery) {
|
|
23347
|
+
this.isSentimentCheck = false;
|
|
23348
|
+
switch (selectedQuery) {
|
|
23349
|
+
case "Summarize":
|
|
23350
|
+
this.subQuery = "Summarize the upcoming sentence shortly.";
|
|
23351
|
+
break;
|
|
23352
|
+
case "Elaborate":
|
|
23353
|
+
this.subQuery = "Elaborate on the upcoming sentence.";
|
|
23354
|
+
break;
|
|
23355
|
+
case "Rephrase":
|
|
23356
|
+
this.subQuery = this.chipValue + " rephrase the upcoming sentence.";
|
|
23357
|
+
break;
|
|
23358
|
+
case "Correct Grammar":
|
|
23359
|
+
this.subQuery = "Correct the grammar of the upcoming sentence.";
|
|
23360
|
+
break;
|
|
23361
|
+
case "Translate":
|
|
23362
|
+
this.subQuery =
|
|
23363
|
+
"Translate the upcoming sentence to " + this.translatelanguage + ".";
|
|
23364
|
+
break;
|
|
23365
|
+
case "Sentiment Analysis":
|
|
23366
|
+
this.isSentimentCheck = true;
|
|
23367
|
+
this.subQuery =
|
|
23368
|
+
'Analyze the sentiment and grammar of the following paragraphs and provide the expression score with an emoji followed by the sentiment in the format: "😊 Neutral". \n\nNOTE: Avoid any additional text or explanation:';
|
|
23369
|
+
break;
|
|
23448
23370
|
}
|
|
23449
|
-
|
|
23371
|
+
this.updateAISugesstions();
|
|
23450
23372
|
}
|
|
23451
23373
|
/**
|
|
23452
|
-
* @param {?} future
|
|
23453
|
-
* @param {?} curr
|
|
23454
23374
|
* @return {?}
|
|
23455
23375
|
*/
|
|
23456
|
-
|
|
23457
|
-
|
|
23458
|
-
|
|
23459
|
-
|
|
23460
|
-
|
|
23461
|
-
|
|
23462
|
-
|
|
23376
|
+
updateAISugesstions() {
|
|
23377
|
+
try {
|
|
23378
|
+
if (this.promptQuery) {
|
|
23379
|
+
((/** @type {?} */ (document.getElementById("skeletonId")))).style.display =
|
|
23380
|
+
"";
|
|
23381
|
+
((/** @type {?} */ (document.getElementById("rightRte")))).style.display =
|
|
23382
|
+
"none";
|
|
23383
|
+
this.sentimentButton.element.style.display = "none";
|
|
23384
|
+
this.regenerateButton.disabled = true;
|
|
23385
|
+
this.copyButton.disabled = true;
|
|
23386
|
+
this.replaceButton.disabled = true;
|
|
23387
|
+
this.apiResultData = this.getResponseFromOpenAI(this.subQuery, this.promptQuery);
|
|
23388
|
+
this.apiResultData.then((/**
|
|
23389
|
+
* @param {?} result
|
|
23390
|
+
* @return {?}
|
|
23391
|
+
*/
|
|
23392
|
+
(result) => {
|
|
23393
|
+
this.AIResult = this.isSentimentCheck ? this.promptQuery : result;
|
|
23394
|
+
this.sentimentButton.content = result
|
|
23395
|
+
.toLowerCase()
|
|
23396
|
+
.includes("positive")
|
|
23397
|
+
? "😊 Positive"
|
|
23398
|
+
: result.toLowerCase().includes("negative")
|
|
23399
|
+
? "😞 Negative"
|
|
23400
|
+
: "😐 Neutral";
|
|
23401
|
+
this.sentimentButton.element.style.display = !this.isSentimentCheck
|
|
23402
|
+
? "none"
|
|
23403
|
+
: "";
|
|
23404
|
+
this.rightRte.value = this.AIResult;
|
|
23405
|
+
/** @type {?} */
|
|
23406
|
+
var noResultsFound = !(this.AIResult || this.promptQuery);
|
|
23407
|
+
((/** @type {?} */ (document.getElementById("no-results-found")))).style.display = noResultsFound ? "" : "none";
|
|
23408
|
+
this.regenerateButton.disabled = noResultsFound;
|
|
23409
|
+
this.copyButton.disabled = noResultsFound;
|
|
23410
|
+
this.replaceButton.disabled = noResultsFound;
|
|
23411
|
+
((/** @type {?} */ (document.getElementById("skeletonId")))).style.display =
|
|
23412
|
+
"none";
|
|
23413
|
+
((/** @type {?} */ (document.getElementById("rightRte")))).style.display =
|
|
23414
|
+
noResultsFound ? "none" : "";
|
|
23415
|
+
console.log(noResultsFound, ((/** @type {?} */ (document.getElementById("rightRte")))).style);
|
|
23416
|
+
// this.ref.markForCheck();
|
|
23417
|
+
}));
|
|
23463
23418
|
}
|
|
23464
|
-
return true;
|
|
23465
23419
|
}
|
|
23466
|
-
|
|
23420
|
+
catch (_a) {
|
|
23421
|
+
// this.toastObj.show();
|
|
23422
|
+
}
|
|
23467
23423
|
}
|
|
23468
23424
|
/**
|
|
23469
|
-
* @param {?}
|
|
23425
|
+
* @param {?} subQuery
|
|
23426
|
+
* @param {?} promptQuery
|
|
23470
23427
|
* @return {?}
|
|
23471
23428
|
*/
|
|
23472
|
-
|
|
23473
|
-
|
|
23474
|
-
// const pathParams = JSON.stringify(route.params);
|
|
23475
|
-
// const queryParams = new URLSearchParams(route.queryParams).toString();
|
|
23429
|
+
getResponseFromOpenAI(subQuery, promptQuery) {
|
|
23430
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23476
23431
|
/** @type {?} */
|
|
23477
|
-
const
|
|
23478
|
-
|
|
23479
|
-
|
|
23480
|
-
|
|
23481
|
-
|
|
23482
|
-
|
|
23483
|
-
|
|
23484
|
-
|
|
23432
|
+
const content = yield OpenAiModelRTE(subQuery, promptQuery);
|
|
23433
|
+
return content ? ((/** @type {?} */ (content))) : "";
|
|
23434
|
+
});
|
|
23435
|
+
}
|
|
23436
|
+
/**
|
|
23437
|
+
* @return {?}
|
|
23438
|
+
*/
|
|
23439
|
+
dialogShow() {
|
|
23440
|
+
(/** @type {?} */ (this.regenerateButton)).element.addEventListener("click", (/**
|
|
23441
|
+
* @return {?}
|
|
23442
|
+
*/
|
|
23443
|
+
() => {
|
|
23444
|
+
this.updateAISugesstions();
|
|
23445
|
+
}));
|
|
23446
|
+
(/** @type {?} */ (this.copyButton)).element.addEventListener("click", (/**
|
|
23447
|
+
* @return {?}
|
|
23448
|
+
*/
|
|
23449
|
+
() => {
|
|
23450
|
+
this.copyTextToClipboard(this.AIResult);
|
|
23451
|
+
}));
|
|
23452
|
+
(/** @type {?} */ (this.replaceButton)).element.addEventListener("click", (/**
|
|
23453
|
+
* @return {?}
|
|
23454
|
+
*/
|
|
23455
|
+
() => {
|
|
23456
|
+
/** @type {?} */
|
|
23457
|
+
let range = ((/** @type {?} */ (this.rteObj))).formatter.editorManager.nodeSelection.getRange(((/** @type {?} */ (this.rteObj))).contentModule.getDocument());
|
|
23458
|
+
((/** @type {?} */ (this.rteObj))).formatter.editorManager.nodeSelection.restore(range);
|
|
23459
|
+
((/** @type {?} */ (this.rteObj))).executeCommand("insertHTML", this.AIResult, {
|
|
23460
|
+
undo: true,
|
|
23461
|
+
});
|
|
23462
|
+
this.closeDialog();
|
|
23463
|
+
}));
|
|
23464
|
+
((/** @type {?} */ (this.AIdialog))).element.style.display = "";
|
|
23485
23465
|
}
|
|
23486
23466
|
/**
|
|
23487
|
-
* @param {?} path
|
|
23488
23467
|
* @return {?}
|
|
23489
23468
|
*/
|
|
23490
|
-
|
|
23491
|
-
|
|
23492
|
-
|
|
23493
|
-
|
|
23469
|
+
closeDialog() {
|
|
23470
|
+
this.AIdialog.hide();
|
|
23471
|
+
this.rightRte.value = "";
|
|
23472
|
+
this.leftRte.value = "";
|
|
23473
|
+
this.promptQuery = "";
|
|
23474
|
+
this.chipValue = "Standard";
|
|
23475
|
+
this.AIResult = "";
|
|
23476
|
+
this.dropValIndex = 0;
|
|
23477
|
+
this.selectedQuery = "Rephrase";
|
|
23478
|
+
this.sentimentButton.content = "😊 Neutral";
|
|
23494
23479
|
}
|
|
23495
23480
|
/**
|
|
23481
|
+
* @param {?} text
|
|
23496
23482
|
* @return {?}
|
|
23497
23483
|
*/
|
|
23498
|
-
|
|
23499
|
-
|
|
23500
|
-
|
|
23501
|
-
|
|
23502
|
-
|
|
23503
|
-
|
|
23504
|
-
|
|
23505
|
-
|
|
23506
|
-
|
|
23507
|
-
|
|
23508
|
-
|
|
23509
|
-
|
|
23510
|
-
|
|
23511
|
-
|
|
23512
|
-
|
|
23513
|
-
|
|
23514
|
-
|
|
23515
|
-
|
|
23516
|
-
|
|
23517
|
-
|
|
23518
|
-
|
|
23519
|
-
|
|
23520
|
-
|
|
23521
|
-
|
|
23522
|
-
|
|
23484
|
+
copyTextToClipboard(text) {
|
|
23485
|
+
if (navigator.clipboard) {
|
|
23486
|
+
navigator.clipboard
|
|
23487
|
+
.writeText(text)
|
|
23488
|
+
.then((/**
|
|
23489
|
+
* @return {?}
|
|
23490
|
+
*/
|
|
23491
|
+
() => {
|
|
23492
|
+
console.log("Text copied to clipboard successfully!");
|
|
23493
|
+
}))
|
|
23494
|
+
.catch((/**
|
|
23495
|
+
* @param {?} err
|
|
23496
|
+
* @return {?}
|
|
23497
|
+
*/
|
|
23498
|
+
(err) => {
|
|
23499
|
+
console.error("Failed to copy text: ", err);
|
|
23500
|
+
}));
|
|
23501
|
+
}
|
|
23502
|
+
else {
|
|
23503
|
+
// Fallback for browsers that do not support the Clipboard API
|
|
23504
|
+
/** @type {?} */
|
|
23505
|
+
const textarea = document.createElement("textarea");
|
|
23506
|
+
textarea.value = text;
|
|
23507
|
+
document.body.appendChild(textarea);
|
|
23508
|
+
textarea.select();
|
|
23509
|
+
try {
|
|
23510
|
+
document.execCommand("copy");
|
|
23511
|
+
console.log("Text copied to clipboard using execCommand");
|
|
23512
|
+
}
|
|
23513
|
+
catch (err) {
|
|
23514
|
+
console.error("Failed to copy text: ", err);
|
|
23515
|
+
}
|
|
23516
|
+
finally {
|
|
23517
|
+
document.body.removeChild(textarea);
|
|
23518
|
+
}
|
|
23519
|
+
}
|
|
23523
23520
|
}
|
|
23524
23521
|
/**
|
|
23525
23522
|
* @return {?}
|
|
23526
23523
|
*/
|
|
23527
|
-
|
|
23528
|
-
|
|
23529
|
-
this.
|
|
23524
|
+
onOverlayClick() {
|
|
23525
|
+
/** @type {?} */
|
|
23526
|
+
let activeEle = this.AIdialog.element.querySelector(".char_block.e-active");
|
|
23527
|
+
if (activeEle) {
|
|
23528
|
+
activeEle.classList.remove("e-active");
|
|
23529
|
+
}
|
|
23530
|
+
this.closeDialog();
|
|
23530
23531
|
}
|
|
23531
23532
|
/**
|
|
23532
|
-
* @param {?}
|
|
23533
|
+
* @param {?} args
|
|
23533
23534
|
* @return {?}
|
|
23534
23535
|
*/
|
|
23535
|
-
|
|
23536
|
-
|
|
23537
|
-
|
|
23538
|
-
|
|
23536
|
+
onQuerySelect(args) {
|
|
23537
|
+
// this.chipList.selectedChips = 0;
|
|
23538
|
+
this.translatelanguage = "EN";
|
|
23539
|
+
this.selectedQuery = args.itemData.text;
|
|
23540
|
+
this.updateAISugesstionsData(args.itemData.text);
|
|
23539
23541
|
}
|
|
23540
23542
|
/**
|
|
23543
|
+
* @param {?} args
|
|
23541
23544
|
* @return {?}
|
|
23542
23545
|
*/
|
|
23543
|
-
|
|
23544
|
-
this.
|
|
23546
|
+
onLanguageSelect(args) {
|
|
23547
|
+
this.translatelanguage = args.itemData.id;
|
|
23548
|
+
this.updateAISugesstionsData("Translate");
|
|
23545
23549
|
}
|
|
23546
23550
|
/**
|
|
23551
|
+
* @param {?} args
|
|
23547
23552
|
* @return {?}
|
|
23548
23553
|
*/
|
|
23549
|
-
|
|
23550
|
-
this.
|
|
23551
|
-
|
|
23552
|
-
|
|
23553
|
-
|
|
23554
|
+
onChipClick(args) {
|
|
23555
|
+
this.chipValue = args.itemData.text;
|
|
23556
|
+
// 事件会触发两次 必须判断args.text是否有值
|
|
23557
|
+
if (args.itemData.text)
|
|
23558
|
+
this.updateAISugesstionsData("Rephrase");
|
|
23554
23559
|
}
|
|
23555
23560
|
/**
|
|
23561
|
+
* @param {?} args
|
|
23556
23562
|
* @return {?}
|
|
23557
23563
|
*/
|
|
23558
|
-
|
|
23559
|
-
this.
|
|
23560
|
-
this.resetSelectedItems();
|
|
23561
|
-
this.comfirmSelect.hidePopup();
|
|
23564
|
+
_toolbarClick(args) {
|
|
23565
|
+
this.toolbarClick.emit(args);
|
|
23562
23566
|
}
|
|
23563
23567
|
/**
|
|
23564
23568
|
* @return {?}
|
|
23565
23569
|
*/
|
|
23566
|
-
|
|
23567
|
-
this.
|
|
23568
|
-
/** @type {?} */
|
|
23569
|
-
const val = this.comfirmSelect.value;
|
|
23570
|
-
this.valueChange.emit(val);
|
|
23571
|
-
this.comfirmSelect.hidePopup();
|
|
23570
|
+
hideToast() {
|
|
23571
|
+
this.showMsg = false;
|
|
23572
23572
|
}
|
|
23573
23573
|
/**
|
|
23574
|
-
* @param {?} e
|
|
23575
23574
|
* @return {?}
|
|
23576
23575
|
*/
|
|
23577
|
-
|
|
23578
|
-
if (this.
|
|
23579
|
-
this.
|
|
23576
|
+
onZoom() {
|
|
23577
|
+
if (this.size === "largest") {
|
|
23578
|
+
this.size = ""; // 恢复到原始大小
|
|
23580
23579
|
}
|
|
23581
23580
|
else {
|
|
23582
|
-
this.
|
|
23581
|
+
this.size = "largest"; // 设置为最大化
|
|
23583
23582
|
}
|
|
23584
23583
|
}
|
|
23585
23584
|
}
|
|
23586
|
-
|
|
23585
|
+
RichtexteditorComponent.decorators = [
|
|
23587
23586
|
{ type: Component, args: [{
|
|
23588
|
-
selector: "rs-
|
|
23589
|
-
template: "<div class=\"
|
|
23590
|
-
styles: [".
|
|
23587
|
+
selector: "rs-richtext-editor",
|
|
23588
|
+
template: "<div class=\"editor_box\" id=\"container\">\r\n <ejs-richtexteditor\r\n #editor\r\n id=\"editor\"\r\n [height]=\"height\"\r\n [saveInterval]=\"0\"\r\n [autoSaveOnIdle]=\"autoSaveOnIdle\"\r\n [toolbarSettings]=\"tools\"\r\n [fontFamily]=\"family\"\r\n [insertImageSettings]=\"insertImageSettings\"\r\n [(value)]=\"value\"\r\n (change)=\"onContentChange($event)\"\r\n (created)=\"onCreate()\"\r\n (toolbarClick)=\"_toolbarClick($event)\"\r\n >\r\n </ejs-richtexteditor>\r\n <ejs-dialog\r\n #AIdialog\r\n id=\"AIdialog\"\r\n [ngClass]=\"size\"\r\n [visible]=\"false\"\r\n [target]=\"target\"\r\n [isModal]=\"true\"\r\n [height]=\"dialogHeight\"\r\n [width]=\"dialogWidth\"\r\n maxHeight=\"80%\"\r\n cssClass=\"e-rte-elements custom-dialog-rte\"\r\n zIndex=\"1000\"\r\n (close)=\"closeDialog()\"\r\n (overlayClick)=\"onOverlayClick()\"\r\n (open)=\"dialogShow()\"\r\n >\r\n <ng-template #header>\r\n <div class=\"header-title\">AI Assist</div>\r\n <div class=\"header-buttons\">\r\n <div *ngIf=\"showZoomBtn\" class=\"header-zoom\" (click)=\"onZoom()\">\r\n <img\r\n class=\"header-icon\"\r\n *ngIf=\"size === 'largest'\"\r\n src=\"../../../assets/img/dialog-shrink.svg\"\r\n />\r\n <img\r\n class=\"header-icon\"\r\n *ngIf=\"size !== 'largest'\"\r\n src=\"../../../assets/img/dialog-grow.svg\"\r\n />\r\n </div>\r\n <div class=\"header-btn\" (click)=\"closeDialog()\">\r\n <img class=\"header-icon\" src=\"../../../assets/img/dialog-close.svg\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #footerTemplate>\r\n <div id=\"dialog-footer-content\">\r\n <div class=\"custom-row-0\">\r\n <div\r\n class=\"cuscol-0\"\r\n style=\"width: 100%; align-items: center; justify-content: left\"\r\n ></div>\r\n <div\r\n class=\"cuscol-1\"\r\n style=\"\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n width: 100%;\r\n \"\r\n >\r\n <div style=\"text-align: right; width: 100%\">\r\n <button\r\n ejs-button\r\n #sentimentButton\r\n content=\"\uD83D\uDE0A Neutral\"\r\n disabled=\"false\"\r\n cssClass=\"sentiment\"\r\n ></button>\r\n <button\r\n ejs-button\r\n #copyButton\r\n content=\"Copy\"\r\n disabled=\"false\"\r\n class=\"copy-btn\"\r\n ></button>\r\n <button\r\n ejs-button\r\n #replaceButton\r\n content=\"Replace\"\r\n isPrimary=\"true\"\r\n disabled=\"false\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #content>\r\n <div class=\"dialog-content\" style=\"height: 100%\">\r\n <div class=\"custom-row-0\">\r\n <div class=\"cuscol-0\" style=\"width: 100%\">\r\n <ejs-dropdownlist\r\n #queryCategory\r\n style=\"width: 200px\"\r\n id=\"queryCategory\"\r\n [dataSource]=\"queryList\"\r\n index=\"0\"\r\n [fields]=\"{ text: 'text', value: 'id' }\"\r\n (select)=\"onQuerySelect($event)\"\r\n >\r\n Rephrase\r\n </ejs-dropdownlist>\r\n <ejs-dropdownlist\r\n *ngIf=\"selectedQuery == 'Rephrase'\"\r\n id=\"chips-container\"\r\n #chipList\r\n style=\"width: 160px\"\r\n [(ngModel)]=\"chipValue\"\r\n [dataSource]=\"rephraseTyleList\"\r\n [fields]=\"{ text: 'text', value: 'id' }\"\r\n (select)=\"onChipClick($event)\"\r\n >\r\n </ejs-dropdownlist>\r\n <ejs-dropdownlist\r\n *ngIf=\"selectedQuery == 'Translate'\"\r\n #languageCategory\r\n index=\"0\"\r\n id=\"language-Category\"\r\n [dataSource]=\"languageList\"\r\n [fields]=\"{ text: 'text', value: 'id' }\"\r\n (select)=\"onLanguageSelect($event)\"\r\n >\r\n </ejs-dropdownlist>\r\n </div>\r\n <div\r\n class=\"cuscol-1\"\r\n style=\"\r\n justify-content: space-between;\r\n align-items: center;\r\n width: 100%;\r\n \"\r\n >\r\n <!-- <ejs-chiplist\r\n id=\"chips-container\"\r\n #chipList\r\n [chips]=\"['Standard', 'Fluent', 'Professional']\"\r\n selection=\"Single\"\r\n cssClass=\"e-outline\"\r\n [selectedChips]=\"[0]\"\r\n (click)=\"onChipClick($event)\"\r\n >\r\n </ejs-chiplist> -->\r\n <button\r\n ejs-button\r\n #regenerateButton\r\n content=\"Regenerate\"\r\n isPrimary=\"true\"\r\n disabled=\"false\"\r\n ></button>\r\n </div>\r\n </div>\r\n <div class=\"custom-row-1\" style=\"height: calc(100% - 40px)\">\r\n <div\r\n class=\"cuscol-0\"\r\n style=\"\r\n width: 100%;\r\n height: 100%;\r\n align-items: center;\r\n justify-content: left;\r\n \"\r\n >\r\n <div style=\"text-align: left; height: 100%\">\r\n <ejs-richtexteditor\r\n #leftRte\r\n id=\"leftRte\"\r\n height=\"100%\"\r\n [toolbarSettings]=\"{ enable: false }\"\r\n placeholder=\"Analysis of AI Support\"\r\n cssClass=\"e-outline\"\r\n >\r\n </ejs-richtexteditor>\r\n </div>\r\n </div>\r\n <div\r\n class=\"cuscol-1\"\r\n style=\"\r\n display: flex;\r\n justify-content: space-between;\r\n width: 100%;\r\n height: 100%;\r\n \"\r\n >\r\n <div style=\"text-align: left; width: 100%; height: 100%\">\r\n <ejs-richtexteditor\r\n #rightRte\r\n id=\"rightRte\"\r\n height=\"100%\"\r\n [toolbarSettings]=\"{ enable: false }\"\r\n placeholder=\"Analysis of AI Support\"\r\n cssClass=\"e-outline\"\r\n >\r\n <!-- style=\"display: none\" -->\r\n </ejs-richtexteditor>\r\n <div\r\n class=\"no-results-found\"\r\n id=\"no-results-found\"\r\n style=\"display: none; height: 244px; align-content: center\"\r\n >\r\n <img\r\n height=\"50\"\r\n width=\"50\"\r\n src=\"https://storage.googleapis.com/cdn-bolddesk/agent-angular-app/images/light/no-records-warning.svg\"\r\n />\r\n <div>No results found</div>\r\n </div>\r\n <div id=\"skeletonId\" style=\"display: none\">\r\n <ejs-skeleton\r\n #skeletonId1\r\n shape=\"Rectangle\"\r\n height=\"20px\"\r\n width=\"100%\"\r\n ></ejs-skeleton\r\n ><br />\r\n <ejs-skeleton\r\n #skeletonId2\r\n shape=\"Rectangle\"\r\n height=\"20px\"\r\n width=\"90%\"\r\n ></ejs-skeleton\r\n ><br />\r\n <ejs-skeleton\r\n #skeletonId3\r\n shape=\"Rectangle\"\r\n height=\"20px\"\r\n width=\"70%\"\r\n ></ejs-skeleton\r\n ><br />\r\n <ejs-skeleton\r\n #skeletonId4\r\n shape=\"Rectangle\"\r\n height=\"20px\"\r\n width=\"50%\"\r\n ></ejs-skeleton\r\n ><br />\r\n <ejs-skeleton\r\n #skeletonId5\r\n shape=\"Rectangle\"\r\n height=\"20px\"\r\n width=\"30%\"\r\n ></ejs-skeleton\r\n ><br />\r\n <ejs-skeleton\r\n #skeletonId6\r\n shape=\"Rectangle\"\r\n height=\"20px\"\r\n width=\"10%\"\r\n ></ejs-skeleton\r\n ><br />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ejs-dialog>\r\n <div class=\"toast\" *ngIf=\"showMsg\">\r\n <span class=\"toast_text\">First, Select some text</span\r\n ><span class=\"close_icon\" (click)=\"hideToast()\"></span>\r\n </div>\r\n</div>\r\n",
|
|
23589
|
+
styles: [".editor_box{position:relative;width:100%;height:100%}.editor_box .toast{position:absolute;left:35%;top:110px;z-index:1;width:400px;border-radius:4px;border:1px solid #e8f2ff;background:#f4f8ff;padding:4px 12px;color:#1f3f5c;font-size:12px;font-style:normal;font-weight:400;height:32px;font-family:Arial;display:flex;align-items:center;justify-content:space-between}.editor_box .toast .toast_text::before{content:url(../../../assets/img/info.svg);display:inline-block;width:16px;height:16px;vertical-align:bottom;margin-right:8px}.editor_box .toast .close_icon{background-image:url(../../../assets/img/notification-close.svg);cursor:pointer;display:inline-block;width:16px;height:16px}.custom-dialog-rte{padding:0 20px;border-radius:10px}.custom-row-0,.custom-row-1,.custom-row-2{display:flex;align-items:center;padding:12px 24px}.e-rte-dropdown-btn-text{padding-left:4px}.no-results-found{text-align:center}.no-results-found img{display:block;margin:0 auto}.e-custom{margin-right:.5rem;border-radius:25px!important}.custom-dialog-rte .skeleton-rectangle{border-radius:4px}@media (max-width:767px){.cuscol-0,.cuscol-1,.cuscol-2{justify-content:center!important}.custom-row-0,.custom-row-1,.custom-row-2{flex-direction:column!important}.cuscol-1{border-right:none!important}.cuscol-0{width:100%;align-items:center}::ng-deep:host .e-dialog{max-height:80%!important}.custom-dialog-rte .e-dialog .e-dlg-content{overflow-y:auto!important}.custom-dialog-rte .e-dialog .e-dlg-content .e-richtexteditor{height:100px!important}.cuscol-noresult{padding-bottom:20px!important}.e-chip-list{padding:5px!important}.cuscol{padding-right:.2rem!important;width:auto!important}.custom-row-1{height:auto!important}}.cuscol-1{display:flex;flex-direction:row!important}.cuscol-2{display:flex;flex-direction:column!important}.sentiment{color:#000!important}.custom-dialog-rte .e-dialog .e-dlg-content{padding:0!important;overflow-y:hidden}.custom-dialog-rte .e-dialog .e-dlg-header-content{padding:20px 0!important;border:0!important}.custom-dialog-rte .e-dialog .e-dlg-header-content .e-dlg-header{display:flex;align-items:center;line-height:18px;justify-content:space-between}.custom-dialog-rte .e-dialog .e-dlg-header-content .e-dlg-header .header-title{font-family:Arial;font-size:15px;font-weight:700;font-style:normal}.custom-dialog-rte .e-dialog .e-dlg-header-content .header-buttons{display:flex}.custom-dialog-rte .e-dialog .e-dlg-header-content .header-buttons img{width:16px;height:16px;cursor:pointer;padding:2px;margin-left:12px}.custom-dialog-rte .e-dialog .e-footer-content{padding:0!important}.custom-dialog-rte .e-dialog .e-dlg-content .e-richtexteditor.e-rte-tb-expand .e-rte-content,.e-richtexteditor.e-rte-tb-expand .e-source-content{border:0;border-bottom:1px solid #dee2e6;border-top:0 solid #dee2e6!important}.custom-dialog-rte .dialog-content .custom-row-0{border-top:0 solid #ddd!important;padding:0;margin-bottom:12px}.custom-dialog-rte .dialog-content .custom-row-0 .cuscol-0{justify-content:left;border-right:none!important;padding:0;display:flex;gap:12px}.custom-dialog-rte .dialog-content .custom-row-0 .cuscol-1{padding:0;margin-left:12px}.custom-dialog-rte .dialog-content .custom-row-0 .cuscol-1 .e-primary{color:#44566c;border-radius:4px;border:1px solid #dbe1e7;background:#fff;width:87px;margin:0;padding:2px 12px;font-family:Arial;font-size:12px;font-style:normal;font-weight:400;line-height:14px;height:28px}.custom-dialog-rte .dialog-content .custom-row-1{padding:0;height:calc(100% - 40px);gap:12px}.custom-dialog-rte .e-footer-content{border:0}.custom-dialog-rte .e-footer-content .custom-row-0{padding:20px 0}.custom-dialog-rte .e-footer-content .e-control.e-btn{font-family:Arial;font-size:12px;line-height:14px;padding:2px 12px;height:28px;background:#fff;color:#44566c}.custom-dialog-rte .e-footer-content .e-control.e-btn.copy-btn{border-color:#dbe1e7}.custom-dialog-rte .e-footer-content .e-control.e-btn.copy-btn::before{content:url(../../../assets/img/editor-copy.svg);vertical-align:middle;margin-right:6px}.custom-dialog-rte .e-footer-content .e-control.e-btn.e-primary{color:#fff;background:#1364b3}.editor_box .e-dialog.largest{width:96vw!important;height:88vh!important;max-height:88vh;max-width:2100px}"]
|
|
23591
23590
|
}] }
|
|
23592
23591
|
];
|
|
23593
|
-
|
|
23594
|
-
|
|
23595
|
-
|
|
23596
|
-
|
|
23597
|
-
|
|
23598
|
-
|
|
23592
|
+
/** @nocollapse */
|
|
23593
|
+
RichtexteditorComponent.ctorParameters = () => [
|
|
23594
|
+
{ type: ChangeDetectorRef }
|
|
23595
|
+
];
|
|
23596
|
+
RichtexteditorComponent.propDecorators = {
|
|
23597
|
+
rteObj: [{ type: ViewChild, args: ["editor", { static: false },] }],
|
|
23598
|
+
queryCategory: [{ type: ViewChild, args: ["queryCategory", { static: false },] }],
|
|
23599
|
+
leftRte: [{ type: ViewChild, args: ["leftRte", { static: false },] }],
|
|
23600
|
+
rightRte: [{ type: ViewChild, args: ["rightRte", { static: false },] }],
|
|
23601
|
+
AIdialog: [{ type: ViewChild, args: ["AIdialog", { static: true },] }],
|
|
23602
|
+
sentimentButton: [{ type: ViewChild, args: ["sentimentButton", { static: false },] }],
|
|
23603
|
+
regenerateButton: [{ type: ViewChild, args: ["regenerateButton", { static: false },] }],
|
|
23604
|
+
copyButton: [{ type: ViewChild, args: ["copyButton", { static: false },] }],
|
|
23605
|
+
replaceButton: [{ type: ViewChild, args: ["replaceButton", { static: false },] }],
|
|
23599
23606
|
placeholder: [{ type: Input }],
|
|
23600
|
-
|
|
23601
|
-
|
|
23607
|
+
value: [{ type: Input }],
|
|
23608
|
+
height: [{ type: Input }],
|
|
23609
|
+
autoSaveOnIdle: [{ type: Input }],
|
|
23610
|
+
target: [{ type: Input }],
|
|
23611
|
+
toolbarClick: [{ type: Output }],
|
|
23612
|
+
change: [{ type: Output }]
|
|
23602
23613
|
};
|
|
23603
23614
|
if (false) {
|
|
23604
23615
|
/** @type {?} */
|
|
23605
|
-
|
|
23616
|
+
RichtexteditorComponent.prototype.rteObj;
|
|
23606
23617
|
/** @type {?} */
|
|
23607
|
-
|
|
23618
|
+
RichtexteditorComponent.prototype.queryCategory;
|
|
23608
23619
|
/** @type {?} */
|
|
23609
|
-
|
|
23620
|
+
RichtexteditorComponent.prototype.leftRte;
|
|
23610
23621
|
/** @type {?} */
|
|
23611
|
-
|
|
23622
|
+
RichtexteditorComponent.prototype.rightRte;
|
|
23612
23623
|
/** @type {?} */
|
|
23613
|
-
|
|
23624
|
+
RichtexteditorComponent.prototype.AIdialog;
|
|
23614
23625
|
/** @type {?} */
|
|
23615
|
-
|
|
23626
|
+
RichtexteditorComponent.prototype.sentimentButton;
|
|
23616
23627
|
/** @type {?} */
|
|
23617
|
-
|
|
23628
|
+
RichtexteditorComponent.prototype.regenerateButton;
|
|
23618
23629
|
/** @type {?} */
|
|
23619
|
-
|
|
23630
|
+
RichtexteditorComponent.prototype.copyButton;
|
|
23620
23631
|
/** @type {?} */
|
|
23621
|
-
|
|
23632
|
+
RichtexteditorComponent.prototype.replaceButton;
|
|
23622
23633
|
/** @type {?} */
|
|
23623
|
-
|
|
23634
|
+
RichtexteditorComponent.prototype.placeholder;
|
|
23624
23635
|
/** @type {?} */
|
|
23625
|
-
|
|
23636
|
+
RichtexteditorComponent.prototype.value;
|
|
23637
|
+
/** @type {?} */
|
|
23638
|
+
RichtexteditorComponent.prototype.height;
|
|
23639
|
+
/** @type {?} */
|
|
23640
|
+
RichtexteditorComponent.prototype.autoSaveOnIdle;
|
|
23641
|
+
/** @type {?} */
|
|
23642
|
+
RichtexteditorComponent.prototype.target;
|
|
23643
|
+
/** @type {?} */
|
|
23644
|
+
RichtexteditorComponent.prototype.toolbarClick;
|
|
23645
|
+
/** @type {?} */
|
|
23646
|
+
RichtexteditorComponent.prototype.change;
|
|
23647
|
+
/** @type {?} */
|
|
23648
|
+
RichtexteditorComponent.prototype.family;
|
|
23649
|
+
/** @type {?} */
|
|
23650
|
+
RichtexteditorComponent.prototype.dialogWidth;
|
|
23651
|
+
/** @type {?} */
|
|
23652
|
+
RichtexteditorComponent.prototype.dialogHeight;
|
|
23653
|
+
/** @type {?} */
|
|
23654
|
+
RichtexteditorComponent.prototype.showZoomBtn;
|
|
23655
|
+
/** @type {?} */
|
|
23656
|
+
RichtexteditorComponent.prototype.showMsg;
|
|
23657
|
+
/** @type {?} */
|
|
23658
|
+
RichtexteditorComponent.prototype.insertImageSettings;
|
|
23659
|
+
/** @type {?} */
|
|
23660
|
+
RichtexteditorComponent.prototype.editorManager;
|
|
23661
|
+
/** @type {?} */
|
|
23662
|
+
RichtexteditorComponent.prototype.size;
|
|
23663
|
+
/** @type {?} */
|
|
23664
|
+
RichtexteditorComponent.prototype.selectedQuery;
|
|
23665
|
+
/** @type {?} */
|
|
23666
|
+
RichtexteditorComponent.prototype.dropValIndex;
|
|
23667
|
+
/** @type {?} */
|
|
23668
|
+
RichtexteditorComponent.prototype.queryList;
|
|
23669
|
+
/** @type {?} */
|
|
23670
|
+
RichtexteditorComponent.prototype.rephraseTyleList;
|
|
23671
|
+
/** @type {?} */
|
|
23672
|
+
RichtexteditorComponent.prototype.languageList;
|
|
23673
|
+
/** @type {?} */
|
|
23674
|
+
RichtexteditorComponent.prototype.promptQuery;
|
|
23675
|
+
/** @type {?} */
|
|
23676
|
+
RichtexteditorComponent.prototype.isSentimentCheck;
|
|
23677
|
+
/** @type {?} */
|
|
23678
|
+
RichtexteditorComponent.prototype.subQuery;
|
|
23679
|
+
/** @type {?} */
|
|
23680
|
+
RichtexteditorComponent.prototype.translatelanguage;
|
|
23681
|
+
/** @type {?} */
|
|
23682
|
+
RichtexteditorComponent.prototype.chipValue;
|
|
23683
|
+
/** @type {?} */
|
|
23684
|
+
RichtexteditorComponent.prototype.apiResultData;
|
|
23685
|
+
/** @type {?} */
|
|
23686
|
+
RichtexteditorComponent.prototype.AIResult;
|
|
23687
|
+
/** @type {?} */
|
|
23688
|
+
RichtexteditorComponent.prototype.tools;
|
|
23689
|
+
/**
|
|
23690
|
+
* @type {?}
|
|
23691
|
+
* @private
|
|
23692
|
+
*/
|
|
23693
|
+
RichtexteditorComponent.prototype.ref;
|
|
23626
23694
|
}
|
|
23627
23695
|
|
|
23628
23696
|
/**
|
|
@@ -23850,5 +23918,5 @@ RaiseCommonLibModule.decorators = [
|
|
|
23850
23918
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
23851
23919
|
*/
|
|
23852
23920
|
|
|
23853
|
-
export { CheckboxGroupComponent, CommonDialogComponent, CommonFunctionService, CommonGridComponent, DefaultDrawerConfig, DialogService, DrawerComponent, DrawerFormComponent, DrawerService, EmailPattern, EncryptedInputComponent, FloatBoxComponent, GridActionComponent, GridActionItemComponent, GridBoxComponent, IconLoaderService, KeepAliveService, MainContainerComponent, MessageType, MultiTabComponent, RSAsideComponent, RSFooterComponent, RSHeaderComponent, RSNavCardGroupComponent, RSToolbarComponent, RadioGroupComponent, RaiseCommonLibModule,
|
|
23921
|
+
export { CheckboxGroupComponent, CommonDialogComponent, CommonFunctionService, CommonGridComponent, DefaultDrawerConfig, DialogService, DrawerComponent, DrawerFormComponent, DrawerService, EmailPattern, EncryptedInputComponent, FloatBoxComponent, GridActionComponent, GridActionItemComponent, GridBoxComponent, IconLoaderService, KeepAliveService, MainContainerComponent, MessageType, MultiTabComponent, RSAsideComponent, RSFooterComponent, RSHeaderComponent, RSNavCardGroupComponent, RSToolbarComponent, RadioGroupComponent, RaiseCommonLibModule, RsCommentaryComponent, RsPageListComponent, RsPageTabComponent, SearchInputComponent, SwitchInputComponent, TagInputComponent, ToolbarItemComponent, TranslationService, TruncatedTextToggleComponent, filterShowSection, Debounce as ɵa, RichtexteditorComponent as ɵb, ConfirmSelectComponent as ɵc, NewActionNotificationComponent as ɵd, CommonDeleteComponent as ɵe };
|
|
23854
23922
|
//# sourceMappingURL=raise-common-lib.js.map
|