raise-common-lib 0.0.192 → 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/bundles/raise-common-lib.umd.js +1357 -49
- 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/common-grid/index.component.js +2 -2
- package/esm2015/lib/form/drawer-form/drawer-form.component.js +112 -44
- package/esm2015/lib/form/richtexteditor/ai-config.js +70 -0
- package/esm2015/lib/form/richtexteditor/data-config.js +273 -0
- package/esm2015/lib/form/richtexteditor/index.component.js +601 -0
- package/esm2015/lib/form/richtexteditor/openapi.js +175 -0
- package/esm2015/lib/layout/page-tab/index.component.js +6 -2
- package/esm2015/lib/raise-common-lib.module.js +7 -2
- package/esm2015/raise-common-lib.js +5 -4
- package/esm5/lib/common-grid/index.component.js +2 -2
- package/esm5/lib/form/drawer-form/drawer-form.component.js +123 -45
- package/esm5/lib/form/richtexteditor/ai-config.js +73 -0
- package/esm5/lib/form/richtexteditor/data-config.js +273 -0
- package/esm5/lib/form/richtexteditor/index.component.js +681 -0
- package/esm5/lib/form/richtexteditor/openapi.js +208 -0
- package/esm5/lib/layout/page-tab/index.component.js +6 -2
- package/esm5/lib/raise-common-lib.module.js +7 -2
- package/esm5/raise-common-lib.js +5 -4
- package/fesm2015/raise-common-lib.js +1230 -48
- package/fesm2015/raise-common-lib.js.map +1 -1
- package/fesm5/raise-common-lib.js +1356 -49
- package/fesm5/raise-common-lib.js.map +1 -1
- package/lib/form/drawer-form/drawer-form.component.d.ts +10 -5
- package/lib/form/richtexteditor/ai-config.d.ts +10 -0
- package/lib/form/richtexteditor/data-config.d.ts +14 -0
- package/lib/form/richtexteditor/index.component.d.ts +78 -0
- package/lib/form/richtexteditor/openapi.d.ts +3 -0
- package/lib/layout/page-tab/index.component.d.ts +1 -0
- package/package.json +1 -1
- package/raise-common-lib.d.ts +4 -3
- package/raise-common-lib.metadata.json +1 -1
- package/src/assets/img/editor-copy.svg +5 -0
- package/src/assets/img/info.svg +5 -0
- package/src/assets/style/reset/grid.scss +2 -1
|
@@ -1003,7 +1003,7 @@
|
|
|
1003
1003
|
CommonGridComponent.decorators = [
|
|
1004
1004
|
{ type: core.Component, args: [{
|
|
1005
1005
|
selector: "rs-common-grid",
|
|
1006
|
-
template: "<ejs-grid\r\n #grid\r\n [id]=\"gridId\"\r\n [ngClass]=\"{\r\n 'hide-Check-box': !alwaysShowCheckbox,\r\n 'grid-loading': className === 'grid-loading'\r\n }\"\r\n [dataSource]=\"dataSource\"\r\n [allowPaging]=\"allowPaging && pageSettings\"\r\n [allowResizing]=\"true\"\r\n [pageSettings]=\"pageSettings\"\r\n [showColumnMenu]=\"true\"\r\n [allowSorting]=\"true\"\r\n [allowFiltering]=\"true\"\r\n [allowExcelExport]=\"true\"\r\n [allowRowDragAndDrop]=\"allowRowDragAndDrop\"\r\n [filterSettings]=\"filterSettings\"\r\n [resizeSettings]=\"resizeSettings\"\r\n [allowSelection]=\"true\"\r\n [editSettings]=\"editSettings\"\r\n [childGrid]=\"childGrid\"\r\n [contextMenuItems]=\"dataSource && dataSource.length ? contextMenuItems : null\"\r\n [selectionSettings]=\"selectionSettings\"\r\n (recordClick)=\"_recordClick($event)\"\r\n (recordDoubleClick)=\"_recordDoubleClick($event)\"\r\n (actionBegin)=\"_actionBegin($event)\"\r\n (actionComplete)=\"_actionHandler($event)\"\r\n (rowSelected)=\"_rowSelected($event)\"\r\n (rowDeselecting)=\"_rowDeselecting($event)\"\r\n (rowDeselected)=\"_rowDeselected($event)\"\r\n style=\"border: none\"\r\n (contextMenuClick)=\"_onContextMenu($event)\"\r\n (contextMenuOpen)=\"contextMenuOpen($event)\"\r\n (queryCellInfo)=\"customiseCell($event)\"\r\n (dataBound)=\"_dataBound($event)\"\r\n (rowDataBound)=\"_rowDataBound($event)\"\r\n (rowSelecting)=\"_rowSelecting($event)\"\r\n (excelQueryCellInfo)=\"_exportQueryCellInfo($event)\"\r\n (rowDrop)=\"onRowDrop($event)\"\r\n (rowDragStart)=\"_rowDragStart($event)\"\r\n (rowDrag)=\"_rowDrag($event)\"\r\n (load)=\"_load()\"\r\n [frozenColumns]=\"frozenColumns\"\r\n [columnChooserSettings]=\"columnChooserSettings\"\r\n>\r\n <e-columns>\r\n <e-column\r\n *ngIf=\"showCheckBox\"\r\n type=\"checkbox\"\r\n [width]=\"checkBoxWidth\"\r\n [minWidth]=\"checkBoxWidth\"\r\n [showColumnMenu]=\"false\"\r\n [allowResizing]=\"false\"\r\n ></e-column>\r\n <e-column\r\n *ngFor=\"let item of fields; trackBy: trackByFn; let last = last\"\r\n [field]=\"item.columnName\"\r\n [filter]=\"item.filter ? item.filter : { type: 'CheckBox' }\"\r\n [customAttributes]=\"\r\n item.colName === 'entityUserList' || item.colName === 'kycProgress'\r\n ? { class: 'hideColumnFilterClass' }\r\n : {}\r\n \"\r\n [headerText]=\"item.columnDisplayName\"\r\n [textAlign]=\"item.textAlign\"\r\n [showColumnMenu]=\"item.showColumnMenu === undefined ? true : false\"\r\n [allowFiltering]=\"item.allowFiltering === undefined ? true : false\"\r\n [allowSorting]=\"item.allowSorting === undefined ? true : false\"\r\n [editType]=\"item.editType\"\r\n [validationRules]=\"item.validationRules\"\r\n [type]=\"item.dataType || 'string'\"\r\n [width]=\"item.width\"\r\n [minWidth]=\"item.minWidth\"\r\n [format]=\"item.format\"\r\n [visible]=\"item.visible\"\r\n [template]=\"item.showTemplate ? columnTemplate : undefined\"\r\n [clipMode]=\"\r\n item.clipMode ? item.clipMode : clipMode || 'EllipsisWithTooltip'\r\n \"\r\n [sortComparer]=\"item.dateComparer || null\"\r\n [allowResizing]=\"!last\"\r\n >\r\n </e-column>\r\n </e-columns>\r\n</ejs-grid>\r\n",
|
|
1006
|
+
template: "<ejs-grid\r\n #grid\r\n [id]=\"gridId\"\r\n [ngClass]=\"{\r\n 'hide-Check-box': !alwaysShowCheckbox,\r\n 'grid-loading': className === 'grid-loading'\r\n }\"\r\n [dataSource]=\"dataSource\"\r\n [allowPaging]=\"allowPaging && pageSettings\"\r\n [allowResizing]=\"true\"\r\n [pageSettings]=\"pageSettings\"\r\n [showColumnMenu]=\"true\"\r\n [allowSorting]=\"true\"\r\n [allowFiltering]=\"true\"\r\n [allowExcelExport]=\"true\"\r\n [allowRowDragAndDrop]=\"allowRowDragAndDrop\"\r\n [filterSettings]=\"filterSettings\"\r\n [resizeSettings]=\"resizeSettings\"\r\n [allowSelection]=\"true\"\r\n [editSettings]=\"editSettings\"\r\n [childGrid]=\"childGrid\"\r\n [contextMenuItems]=\"dataSource && dataSource.length ? contextMenuItems : null\"\r\n [selectionSettings]=\"selectionSettings\"\r\n (recordClick)=\"_recordClick($event)\"\r\n (recordDoubleClick)=\"_recordDoubleClick($event)\"\r\n (actionBegin)=\"_actionBegin($event)\"\r\n (actionComplete)=\"_actionHandler($event)\"\r\n (rowSelected)=\"_rowSelected($event)\"\r\n (rowDeselecting)=\"_rowDeselecting($event)\"\r\n (rowDeselected)=\"_rowDeselected($event)\"\r\n style=\"border: none\"\r\n (contextMenuClick)=\"_onContextMenu($event)\"\r\n (contextMenuOpen)=\"contextMenuOpen($event)\"\r\n (queryCellInfo)=\"customiseCell($event)\"\r\n (dataBound)=\"_dataBound($event)\"\r\n (rowDataBound)=\"_rowDataBound($event)\"\r\n (rowSelecting)=\"_rowSelecting($event)\"\r\n (excelQueryCellInfo)=\"_exportQueryCellInfo($event)\"\r\n (rowDrop)=\"onRowDrop($event)\"\r\n (rowDragStart)=\"_rowDragStart($event)\"\r\n (rowDrag)=\"_rowDrag($event)\"\r\n (load)=\"_load()\"\r\n [frozenColumns]=\"frozenColumns\"\r\n [columnChooserSettings]=\"columnChooserSettings\"\r\n>\r\n <e-columns>\r\n <e-column\r\n *ngIf=\"showCheckBox\"\r\n type=\"checkbox\"\r\n [width]=\"checkBoxWidth\"\r\n [minWidth]=\"checkBoxWidth\"\r\n [showColumnMenu]=\"false\"\r\n [allowResizing]=\"false\"\r\n ></e-column>\r\n <e-column\r\n *ngFor=\"let item of fields; trackBy: trackByFn; let last = last\"\r\n [field]=\"item.columnName\"\r\n [filter]=\"item.filter ? item.filter : { type: 'CheckBox' }\"\r\n [customAttributes]=\"\r\n item.colName === 'entityUserList' || item.colName === 'kycProgress'\r\n ? { class: 'hideColumnFilterClass' }\r\n : {}\r\n \"\r\n [headerText]=\"item.columnDisplayName\"\r\n [textAlign]=\"item.textAlign\"\r\n [showColumnMenu]=\"item.showColumnMenu === undefined ? true : false\"\r\n [allowFiltering]=\"item.allowFiltering === undefined ? true : false\"\r\n [allowSorting]=\"item.allowSorting === undefined ? true : false\"\r\n [showInColumnChooser]=\"\r\n item.showInColumnChooser === undefined ? true : item.showInColumnChooser\r\n \"\r\n [editType]=\"item.editType\"\r\n [validationRules]=\"item.validationRules\"\r\n [type]=\"item.dataType || 'string'\"\r\n [width]=\"item.width\"\r\n [minWidth]=\"item.minWidth\"\r\n [format]=\"item.format\"\r\n [visible]=\"item.visible\"\r\n [template]=\"item.showTemplate ? columnTemplate : undefined\"\r\n [clipMode]=\"\r\n item.clipMode ? item.clipMode : clipMode || 'EllipsisWithTooltip'\r\n \"\r\n [sortComparer]=\"item.dateComparer || null\"\r\n [allowResizing]=\"!last\"\r\n >\r\n </e-column>\r\n </e-columns>\r\n</ejs-grid>\r\n",
|
|
1007
1007
|
styles: [""]
|
|
1008
1008
|
}] }
|
|
1009
1009
|
];
|
|
@@ -3000,6 +3000,7 @@
|
|
|
3000
3000
|
this.customPageTitle = false;
|
|
3001
3001
|
this.tabList = [];
|
|
3002
3002
|
this.tabChange = new core.EventEmitter();
|
|
3003
|
+
this.selectedItemIndex = 0;
|
|
3003
3004
|
this.animation = {
|
|
3004
3005
|
previous: { effect: "", duration: 0, easing: "" },
|
|
3005
3006
|
next: { effect: "", duration: 0, easing: "" },
|
|
@@ -3048,6 +3049,7 @@
|
|
|
3048
3049
|
var index = e.selectedItem.dataset.id.split('_')[1] // sy的bug只能这么取了
|
|
3049
3050
|
;
|
|
3050
3051
|
if (e.isInteracted) {
|
|
3052
|
+
this.selectedItemIndex = index;
|
|
3051
3053
|
this.tabChange.emit(this.tabList[index]);
|
|
3052
3054
|
}
|
|
3053
3055
|
};
|
|
@@ -3069,7 +3071,7 @@
|
|
|
3069
3071
|
RsPageTabComponent.decorators = [
|
|
3070
3072
|
{ type: core.Component, args: [{
|
|
3071
3073
|
selector: "rs-page-tab",
|
|
3072
|
-
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 >\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",
|
|
3074
|
+
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",
|
|
3073
3075
|
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}"]
|
|
3074
3076
|
}] }
|
|
3075
3077
|
];
|
|
@@ -3097,6 +3099,8 @@
|
|
|
3097
3099
|
/** @type {?} */
|
|
3098
3100
|
RsPageTabComponent.prototype.tabChange;
|
|
3099
3101
|
/** @type {?} */
|
|
3102
|
+
RsPageTabComponent.prototype.selectedItemIndex;
|
|
3103
|
+
/** @type {?} */
|
|
3100
3104
|
RsPageTabComponent.prototype.animation;
|
|
3101
3105
|
}
|
|
3102
3106
|
|
|
@@ -22425,9 +22429,12 @@
|
|
|
22425
22429
|
* Generated from: lib/form/drawer-form/drawer-form.component.ts
|
|
22426
22430
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
22427
22431
|
*/
|
|
22432
|
+
/** @type {?} */
|
|
22433
|
+
var FORM_PROXY_TAG = Symbol.for("form-proxy");
|
|
22428
22434
|
var DrawerFormComponent = /** @class */ (function () {
|
|
22429
22435
|
function DrawerFormComponent(ref) {
|
|
22430
22436
|
this.ref = ref;
|
|
22437
|
+
this._form = {};
|
|
22431
22438
|
this._sections = [];
|
|
22432
22439
|
this.optionsMap = {};
|
|
22433
22440
|
this.formDisabled = false;
|
|
@@ -22439,12 +22446,14 @@
|
|
|
22439
22446
|
groupBy: null,
|
|
22440
22447
|
};
|
|
22441
22448
|
this.showFilterNumber = 10;
|
|
22442
|
-
this.
|
|
22449
|
+
this.dateFormat = "yyyy-MM-dd";
|
|
22443
22450
|
this.formChange = new core.EventEmitter();
|
|
22444
22451
|
this.fieldChange = new core.EventEmitter();
|
|
22445
22452
|
this.sections = [];
|
|
22446
|
-
this.
|
|
22453
|
+
this.form = {};
|
|
22447
22454
|
this.fieldValidMap = {};
|
|
22455
|
+
// 存储 datepicker 的值
|
|
22456
|
+
this.dateForm = {};
|
|
22448
22457
|
this.dateValidMap = {};
|
|
22449
22458
|
this.scrollIndex = 0;
|
|
22450
22459
|
this.isClickAnchor = false;
|
|
@@ -22465,13 +22474,19 @@
|
|
|
22465
22474
|
* @return {?}
|
|
22466
22475
|
*/
|
|
22467
22476
|
function (changes) {
|
|
22477
|
+
if (changes._form) {
|
|
22478
|
+
if (!changes._form.currentValue[FORM_PROXY_TAG]) {
|
|
22479
|
+
this.form = this.getFormProxy(changes._form.currentValue);
|
|
22480
|
+
this.formChange.emit(this.form);
|
|
22481
|
+
}
|
|
22482
|
+
if (!changes._form.firstChange) {
|
|
22483
|
+
this.checkFormChange(changes._form.previousValue, changes._form.currentValue);
|
|
22484
|
+
}
|
|
22485
|
+
}
|
|
22468
22486
|
if (changes._sections) {
|
|
22469
22487
|
this.sections = filterShowSection(changes._sections.currentValue);
|
|
22470
22488
|
this.formatForm(this.sections);
|
|
22471
22489
|
}
|
|
22472
|
-
if (changes.form && !changes.form.firstChange) {
|
|
22473
|
-
this.checkFormChange(changes.form.previousValue, changes.form.currentValue);
|
|
22474
|
-
}
|
|
22475
22490
|
};
|
|
22476
22491
|
/**
|
|
22477
22492
|
* @return {?}
|
|
@@ -22603,6 +22618,23 @@
|
|
|
22603
22618
|
}
|
|
22604
22619
|
}));
|
|
22605
22620
|
};
|
|
22621
|
+
/**
|
|
22622
|
+
* @param {?} field
|
|
22623
|
+
* @param {?} value
|
|
22624
|
+
* @return {?}
|
|
22625
|
+
*/
|
|
22626
|
+
DrawerFormComponent.prototype.syncFormToDateForm = /**
|
|
22627
|
+
* @param {?} field
|
|
22628
|
+
* @param {?} value
|
|
22629
|
+
* @return {?}
|
|
22630
|
+
*/
|
|
22631
|
+
function (field, value) {
|
|
22632
|
+
if (value) {
|
|
22633
|
+
/** @type {?} */
|
|
22634
|
+
var date = moment(value);
|
|
22635
|
+
this.dateForm[field.formKey] = date.isValid() ? date.toDate() : null;
|
|
22636
|
+
}
|
|
22637
|
+
};
|
|
22606
22638
|
/**
|
|
22607
22639
|
* @param {?} sections
|
|
22608
22640
|
* @return {?}
|
|
@@ -22638,6 +22670,9 @@
|
|
|
22638
22670
|
case "Switch":
|
|
22639
22671
|
_this.form[field.formKey] = false;
|
|
22640
22672
|
break;
|
|
22673
|
+
case "Datepicker":
|
|
22674
|
+
_this.syncFormToDateForm(field, _this.form[field.formKey]);
|
|
22675
|
+
break;
|
|
22641
22676
|
default:
|
|
22642
22677
|
_this.form[field.formKey] = null;
|
|
22643
22678
|
}
|
|
@@ -22645,6 +22680,43 @@
|
|
|
22645
22680
|
}));
|
|
22646
22681
|
}));
|
|
22647
22682
|
};
|
|
22683
|
+
/**
|
|
22684
|
+
* @param {?} form
|
|
22685
|
+
* @return {?}
|
|
22686
|
+
*/
|
|
22687
|
+
DrawerFormComponent.prototype.getFormProxy = /**
|
|
22688
|
+
* @param {?} form
|
|
22689
|
+
* @return {?}
|
|
22690
|
+
*/
|
|
22691
|
+
function (form) {
|
|
22692
|
+
var _this = this;
|
|
22693
|
+
// 现在除了 tag 之外不支持嵌套 form 属性,只对浅层进行处理
|
|
22694
|
+
/** @type {?} */
|
|
22695
|
+
var proxyForm = new Proxy(form, {
|
|
22696
|
+
set: (/**
|
|
22697
|
+
* @param {?} target
|
|
22698
|
+
* @param {?} prop
|
|
22699
|
+
* @param {?} value
|
|
22700
|
+
* @return {?}
|
|
22701
|
+
*/
|
|
22702
|
+
function (target, prop, value) {
|
|
22703
|
+
target[prop] = value;
|
|
22704
|
+
/** @type {?} */
|
|
22705
|
+
var field = _this.getField(prop);
|
|
22706
|
+
if (field && field.fieldFormType === "Datepicker") {
|
|
22707
|
+
_this.syncFormToDateForm(field, value);
|
|
22708
|
+
}
|
|
22709
|
+
return true;
|
|
22710
|
+
}),
|
|
22711
|
+
});
|
|
22712
|
+
Object.defineProperty(proxyForm, FORM_PROXY_TAG, {
|
|
22713
|
+
value: true,
|
|
22714
|
+
writable: false,
|
|
22715
|
+
enumerable: false,
|
|
22716
|
+
configurable: false,
|
|
22717
|
+
});
|
|
22718
|
+
return proxyForm;
|
|
22719
|
+
};
|
|
22648
22720
|
// 表单提交前会触发这个函数
|
|
22649
22721
|
// 表单提交前会触发这个函数
|
|
22650
22722
|
/**
|
|
@@ -22660,12 +22732,8 @@
|
|
|
22660
22732
|
* @return {?}
|
|
22661
22733
|
*/
|
|
22662
22734
|
function (value, field) {
|
|
22663
|
-
|
|
22664
|
-
|
|
22665
|
-
var newForm = __assign({}, this.form, (_a = {}, _a[field.formKey] = value, _a));
|
|
22666
|
-
// 修复错误提示显示 bug,不设置一下有概率拿不到最新的值
|
|
22667
|
-
this.form = newForm;
|
|
22668
|
-
this.formChange.emit(newForm);
|
|
22735
|
+
this.form[field.formKey] = value;
|
|
22736
|
+
this.formChange.emit(this.form);
|
|
22669
22737
|
this.fieldChange.emit({ field: field, value: value });
|
|
22670
22738
|
};
|
|
22671
22739
|
/**
|
|
@@ -22832,13 +22900,14 @@
|
|
|
22832
22900
|
if (!event.isInteracted) {
|
|
22833
22901
|
return;
|
|
22834
22902
|
}
|
|
22835
|
-
|
|
22836
|
-
|
|
22837
|
-
|
|
22838
|
-
/** @type {?} */
|
|
22839
|
-
var date = moment(value);
|
|
22840
|
-
value = date.isValid() ? date.format("YYYY-MM-DD") : null;
|
|
22903
|
+
if (field.fieldFormType !== "Datepicker") {
|
|
22904
|
+
this.onChange(event.value, field);
|
|
22905
|
+
return;
|
|
22841
22906
|
}
|
|
22907
|
+
console.log("change", event);
|
|
22908
|
+
/** @type {?} */
|
|
22909
|
+
var value = event.value ? moment(event.value).format("YYYY-MM-DD") : null;
|
|
22910
|
+
this.dateForm[field.formKey] = event.value;
|
|
22842
22911
|
this.onChange(value, field);
|
|
22843
22912
|
};
|
|
22844
22913
|
/**
|
|
@@ -22866,17 +22935,21 @@
|
|
|
22866
22935
|
* @return {?}
|
|
22867
22936
|
*/
|
|
22868
22937
|
function (event, field) {
|
|
22938
|
+
var _this = this;
|
|
22869
22939
|
this.onBlur(field);
|
|
22870
|
-
/**
|
|
22871
|
-
|
|
22872
|
-
|
|
22873
|
-
|
|
22874
|
-
|
|
22875
|
-
|
|
22876
|
-
|
|
22877
|
-
|
|
22878
|
-
|
|
22879
|
-
|
|
22940
|
+
setTimeout((/**
|
|
22941
|
+
* @return {?}
|
|
22942
|
+
*/
|
|
22943
|
+
function () {
|
|
22944
|
+
/** @type {?} */
|
|
22945
|
+
var $input = event.model.element.querySelector("input");
|
|
22946
|
+
if ($input && $input.value && !_this.dateForm[field.formKey]) {
|
|
22947
|
+
_this.dateValidMap[field.formKey] = false;
|
|
22948
|
+
}
|
|
22949
|
+
else {
|
|
22950
|
+
delete _this.dateValidMap[field.formKey];
|
|
22951
|
+
}
|
|
22952
|
+
}), 50);
|
|
22880
22953
|
};
|
|
22881
22954
|
/**
|
|
22882
22955
|
* @param {?} field
|
|
@@ -22916,23 +22989,24 @@
|
|
|
22916
22989
|
if (event.text) {
|
|
22917
22990
|
query.where(this.optionFields.text, "contains", event.text, true);
|
|
22918
22991
|
}
|
|
22919
|
-
event.updateData(this.
|
|
22992
|
+
event.updateData(this.getOptions(field), query);
|
|
22920
22993
|
};
|
|
22921
22994
|
/**
|
|
22922
22995
|
* @param {?} field
|
|
22923
22996
|
* @return {?}
|
|
22924
22997
|
*/
|
|
22925
|
-
DrawerFormComponent.prototype.
|
|
22998
|
+
DrawerFormComponent.prototype.getOptions = /**
|
|
22926
22999
|
* @param {?} field
|
|
22927
23000
|
* @return {?}
|
|
22928
23001
|
*/
|
|
22929
23002
|
function (field) {
|
|
22930
|
-
if (
|
|
22931
|
-
|
|
22932
|
-
|
|
22933
|
-
|
|
23003
|
+
if (Array.isArray(this.optionsMap[field.optionKey])) {
|
|
23004
|
+
return this.optionsMap[field.optionKey];
|
|
23005
|
+
}
|
|
23006
|
+
if (Array.isArray(this.optionsMap[field.formKey])) {
|
|
23007
|
+
return this.optionsMap[field.formKey];
|
|
22934
23008
|
}
|
|
22935
|
-
return
|
|
23009
|
+
return [];
|
|
22936
23010
|
};
|
|
22937
23011
|
/**
|
|
22938
23012
|
* @param {?} field
|
|
@@ -23053,7 +23127,7 @@
|
|
|
23053
23127
|
DrawerFormComponent.decorators = [
|
|
23054
23128
|
{ type: core.Component, args: [{
|
|
23055
23129
|
selector: "rs-drawer-form",
|
|
23056
|
-
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]=\"
|
|
23130
|
+
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",
|
|
23057
23131
|
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}"]
|
|
23058
23132
|
}] }
|
|
23059
23133
|
];
|
|
@@ -23062,15 +23136,17 @@
|
|
|
23062
23136
|
{ type: core.ChangeDetectorRef }
|
|
23063
23137
|
]; };
|
|
23064
23138
|
DrawerFormComponent.propDecorators = {
|
|
23139
|
+
_form: [{ type: core.Input, args: ["form",] }],
|
|
23065
23140
|
_sections: [{ type: core.Input, args: ["sections",] }],
|
|
23066
23141
|
optionsMap: [{ type: core.Input, args: ["optionsMap",] }],
|
|
23067
|
-
customTemplate: [{ type: core.Input, args: ["customTemplate",] }],
|
|
23068
|
-
customSectionTemplate: [{ type: core.Input, args: ["customSectionTemplate",] }],
|
|
23069
23142
|
formDisabled: [{ type: core.Input, args: ["disabled",] }],
|
|
23070
23143
|
showAnchor: [{ type: core.Input, args: ["showAnchor",] }],
|
|
23144
|
+
customTemplate: [{ type: core.Input, args: ["customTemplate",] }],
|
|
23145
|
+
customSectionTemplate: [{ type: core.Input, args: ["customSectionTemplate",] }],
|
|
23071
23146
|
optionFields: [{ type: core.Input, args: ["optionFields",] }],
|
|
23072
23147
|
showFilterNumber: [{ type: core.Input, args: ["showFilterNumber",] }],
|
|
23073
|
-
|
|
23148
|
+
numberFormat: [{ type: core.Input, args: ["numberFormat",] }],
|
|
23149
|
+
dateFormat: [{ type: core.Input, args: ["dateFormat",] }],
|
|
23074
23150
|
formChange: [{ type: core.Output, args: ["formChange",] }],
|
|
23075
23151
|
fieldChange: [{ type: core.Output, args: ["fieldChange",] }],
|
|
23076
23152
|
rootEl: [{ type: core.ViewChild, args: ["drawerFormEl", { static: false },] }],
|
|
@@ -23081,24 +23157,28 @@
|
|
|
23081
23157
|
return DrawerFormComponent;
|
|
23082
23158
|
}());
|
|
23083
23159
|
if (false) {
|
|
23160
|
+
/** @type {?} */
|
|
23161
|
+
DrawerFormComponent.prototype._form;
|
|
23084
23162
|
/** @type {?} */
|
|
23085
23163
|
DrawerFormComponent.prototype._sections;
|
|
23086
23164
|
/** @type {?} */
|
|
23087
23165
|
DrawerFormComponent.prototype.optionsMap;
|
|
23088
23166
|
/** @type {?} */
|
|
23089
|
-
DrawerFormComponent.prototype.customTemplate;
|
|
23090
|
-
/** @type {?} */
|
|
23091
|
-
DrawerFormComponent.prototype.customSectionTemplate;
|
|
23092
|
-
/** @type {?} */
|
|
23093
23167
|
DrawerFormComponent.prototype.formDisabled;
|
|
23094
23168
|
/** @type {?} */
|
|
23095
23169
|
DrawerFormComponent.prototype.showAnchor;
|
|
23096
23170
|
/** @type {?} */
|
|
23171
|
+
DrawerFormComponent.prototype.customTemplate;
|
|
23172
|
+
/** @type {?} */
|
|
23173
|
+
DrawerFormComponent.prototype.customSectionTemplate;
|
|
23174
|
+
/** @type {?} */
|
|
23097
23175
|
DrawerFormComponent.prototype.optionFields;
|
|
23098
23176
|
/** @type {?} */
|
|
23099
23177
|
DrawerFormComponent.prototype.showFilterNumber;
|
|
23100
23178
|
/** @type {?} */
|
|
23101
|
-
DrawerFormComponent.prototype.
|
|
23179
|
+
DrawerFormComponent.prototype.numberFormat;
|
|
23180
|
+
/** @type {?} */
|
|
23181
|
+
DrawerFormComponent.prototype.dateFormat;
|
|
23102
23182
|
/** @type {?} */
|
|
23103
23183
|
DrawerFormComponent.prototype.formChange;
|
|
23104
23184
|
/** @type {?} */
|
|
@@ -23118,10 +23198,12 @@
|
|
|
23118
23198
|
/** @type {?} */
|
|
23119
23199
|
DrawerFormComponent.prototype.sections;
|
|
23120
23200
|
/** @type {?} */
|
|
23121
|
-
DrawerFormComponent.prototype.
|
|
23201
|
+
DrawerFormComponent.prototype.form;
|
|
23122
23202
|
/** @type {?} */
|
|
23123
23203
|
DrawerFormComponent.prototype.fieldValidMap;
|
|
23124
23204
|
/** @type {?} */
|
|
23205
|
+
DrawerFormComponent.prototype.dateForm;
|
|
23206
|
+
/** @type {?} */
|
|
23125
23207
|
DrawerFormComponent.prototype.dateValidMap;
|
|
23126
23208
|
/** @type {?} */
|
|
23127
23209
|
DrawerFormComponent.prototype.sectionEls;
|
|
@@ -23703,6 +23785,1227 @@
|
|
|
23703
23785
|
ConfirmSelectComponent.prototype.isInteracted;
|
|
23704
23786
|
}
|
|
23705
23787
|
|
|
23788
|
+
/**
|
|
23789
|
+
* @fileoverview added by tsickle
|
|
23790
|
+
* Generated from: lib/form/richtexteditor/ai-config.ts
|
|
23791
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
23792
|
+
*/
|
|
23793
|
+
/**
|
|
23794
|
+
* @record
|
|
23795
|
+
*/
|
|
23796
|
+
function AIConfig() { }
|
|
23797
|
+
if (false) {
|
|
23798
|
+
/** @type {?} */
|
|
23799
|
+
AIConfig.prototype.endpoint;
|
|
23800
|
+
/** @type {?} */
|
|
23801
|
+
AIConfig.prototype.apiKey;
|
|
23802
|
+
/** @type {?} */
|
|
23803
|
+
AIConfig.prototype.deployment;
|
|
23804
|
+
/** @type {?} */
|
|
23805
|
+
AIConfig.prototype.apiVersion;
|
|
23806
|
+
/** @type {?} */
|
|
23807
|
+
AIConfig.prototype.enabled;
|
|
23808
|
+
}
|
|
23809
|
+
// 从环境配置获取AI配置
|
|
23810
|
+
/**
|
|
23811
|
+
* @return {?}
|
|
23812
|
+
*/
|
|
23813
|
+
function getAIConfig() {
|
|
23814
|
+
return {
|
|
23815
|
+
endpoint: "https://aidevused.openai.azure.com/",
|
|
23816
|
+
apiKey: "ccba76e279f64653a50ac4fee90afe5c",
|
|
23817
|
+
deployment: "gpt-4",
|
|
23818
|
+
apiVersion: "2025-01-01-preview",
|
|
23819
|
+
enabled: true,
|
|
23820
|
+
};
|
|
23821
|
+
}
|
|
23822
|
+
// 检查配置是否有效
|
|
23823
|
+
/**
|
|
23824
|
+
* @param {?} config
|
|
23825
|
+
* @return {?}
|
|
23826
|
+
*/
|
|
23827
|
+
function isAIConfigValid(config) {
|
|
23828
|
+
// 检查是否为aidevused端点且有有效API密钥
|
|
23829
|
+
return !!((config.endpoint &&
|
|
23830
|
+
config.apiKey &&
|
|
23831
|
+
config.deployment &&
|
|
23832
|
+
config.enabled &&
|
|
23833
|
+
config.endpoint === "https://aidevused.openai.azure.com/" &&
|
|
23834
|
+
config.apiKey !== "your-api-key-here") // Azure OpenAI API密钥通常以sk-开头
|
|
23835
|
+
);
|
|
23836
|
+
}
|
|
23837
|
+
// 从后端API获取AI配置(推荐方式)
|
|
23838
|
+
/**
|
|
23839
|
+
* @return {?}
|
|
23840
|
+
* @this {*}
|
|
23841
|
+
*/
|
|
23842
|
+
function getAIConfigFromBackend() {
|
|
23843
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
23844
|
+
return __generator(this, function (_a) {
|
|
23845
|
+
try {
|
|
23846
|
+
// 这里应该调用你的后端API来获取AI配置
|
|
23847
|
+
// 例如:return await this.http.get('/api/ai-config');
|
|
23848
|
+
// 临时返回默认配置
|
|
23849
|
+
return [2 /*return*/, getAIConfig()];
|
|
23850
|
+
}
|
|
23851
|
+
catch (error) {
|
|
23852
|
+
console.error("Failed to get AI config from backend:", error);
|
|
23853
|
+
return [2 /*return*/, getAIConfig()];
|
|
23854
|
+
}
|
|
23855
|
+
return [2 /*return*/];
|
|
23856
|
+
});
|
|
23857
|
+
});
|
|
23858
|
+
}
|
|
23859
|
+
|
|
23860
|
+
/**
|
|
23861
|
+
* @fileoverview added by tsickle
|
|
23862
|
+
* Generated from: lib/form/richtexteditor/openapi.ts
|
|
23863
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
23864
|
+
*/
|
|
23865
|
+
// import { testAIFunction } from './ai-test';
|
|
23866
|
+
// testAIFunction();
|
|
23867
|
+
// 使用fetch API发送请求到Azure OpenAI
|
|
23868
|
+
/**
|
|
23869
|
+
* @param {?} messages
|
|
23870
|
+
* @param {?} config
|
|
23871
|
+
* @return {?}
|
|
23872
|
+
* @this {*}
|
|
23873
|
+
*/
|
|
23874
|
+
function sendAIRequest(messages, config) {
|
|
23875
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
23876
|
+
var url, url1, response, errorText, data, error_1;
|
|
23877
|
+
return __generator(this, function (_a) {
|
|
23878
|
+
switch (_a.label) {
|
|
23879
|
+
case 0:
|
|
23880
|
+
_a.trys.push([0, 5, , 6]);
|
|
23881
|
+
url = config.endpoint + "/openai/deployments/" + config.deployment + "/chat/completions?api-version=" + config.apiVersion;
|
|
23882
|
+
url1 = "" + config.endpoint;
|
|
23883
|
+
return [4 /*yield*/, fetch(url, {
|
|
23884
|
+
method: 'POST',
|
|
23885
|
+
headers: {
|
|
23886
|
+
'Content-Type': 'application/json',
|
|
23887
|
+
'api-key': config.apiKey,
|
|
23888
|
+
},
|
|
23889
|
+
body: JSON.stringify({
|
|
23890
|
+
messages: messages,
|
|
23891
|
+
max_tokens: 1000,
|
|
23892
|
+
temperature: 0.7,
|
|
23893
|
+
top_p: 1,
|
|
23894
|
+
frequency_penalty: 0,
|
|
23895
|
+
presence_penalty: 0,
|
|
23896
|
+
}),
|
|
23897
|
+
})];
|
|
23898
|
+
case 1:
|
|
23899
|
+
response = _a.sent();
|
|
23900
|
+
if (!!response.ok) return [3 /*break*/, 3];
|
|
23901
|
+
return [4 /*yield*/, response.text()];
|
|
23902
|
+
case 2:
|
|
23903
|
+
errorText = _a.sent();
|
|
23904
|
+
throw new Error("HTTP error! status: " + response.status + ", message: " + errorText);
|
|
23905
|
+
case 3: return [4 /*yield*/, response.json()];
|
|
23906
|
+
case 4:
|
|
23907
|
+
data = _a.sent();
|
|
23908
|
+
if (!data.choices || !data.choices[0] || !data.choices[0].message) {
|
|
23909
|
+
throw new Error('Invalid response format from AI service');
|
|
23910
|
+
}
|
|
23911
|
+
return [2 /*return*/, data.choices[0].message.content];
|
|
23912
|
+
case 5:
|
|
23913
|
+
error_1 = _a.sent();
|
|
23914
|
+
console.error('AI request failed:', error_1);
|
|
23915
|
+
throw error_1;
|
|
23916
|
+
case 6: return [2 /*return*/];
|
|
23917
|
+
}
|
|
23918
|
+
});
|
|
23919
|
+
});
|
|
23920
|
+
}
|
|
23921
|
+
// 备用方案:使用模拟数据(用于开发测试)
|
|
23922
|
+
/**
|
|
23923
|
+
* @param {?} subQuery
|
|
23924
|
+
* @param {?} promptQuery
|
|
23925
|
+
* @return {?}
|
|
23926
|
+
*/
|
|
23927
|
+
function getMockAIResponse(subQuery, promptQuery) {
|
|
23928
|
+
var e_1, _a;
|
|
23929
|
+
/** @type {?} */
|
|
23930
|
+
var mockResponses = {
|
|
23931
|
+
Rephrase: "Rephrased: " + promptQuery,
|
|
23932
|
+
Grammar: "Corrected: " + promptQuery,
|
|
23933
|
+
Summarize: "Summary: " + promptQuery.substring(0, 100) + "...",
|
|
23934
|
+
Elaborate: "Elaborated: " + promptQuery + " with additional details and context.",
|
|
23935
|
+
Translate: "Translated: " + promptQuery,
|
|
23936
|
+
SentimentAnalysis: '😊 Positive',
|
|
23937
|
+
};
|
|
23938
|
+
try {
|
|
23939
|
+
for (var _b = __values(Object.entries(mockResponses)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
23940
|
+
var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
|
|
23941
|
+
if (subQuery.includes(key)) {
|
|
23942
|
+
return value;
|
|
23943
|
+
}
|
|
23944
|
+
}
|
|
23945
|
+
}
|
|
23946
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
23947
|
+
finally {
|
|
23948
|
+
try {
|
|
23949
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
23950
|
+
}
|
|
23951
|
+
finally { if (e_1) throw e_1.error; }
|
|
23952
|
+
}
|
|
23953
|
+
return "AI processed: " + promptQuery;
|
|
23954
|
+
}
|
|
23955
|
+
// 主要的AI请求方法
|
|
23956
|
+
/**
|
|
23957
|
+
* @param {?} subQuery
|
|
23958
|
+
* @param {?} promptQuery
|
|
23959
|
+
* @return {?}
|
|
23960
|
+
* @this {*}
|
|
23961
|
+
*/
|
|
23962
|
+
function OpenAiModelRTE(subQuery, promptQuery) {
|
|
23963
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
23964
|
+
var config, messages, result, error_2;
|
|
23965
|
+
return __generator(this, function (_a) {
|
|
23966
|
+
switch (_a.label) {
|
|
23967
|
+
case 0:
|
|
23968
|
+
_a.trys.push([0, 2, , 3]);
|
|
23969
|
+
config = getAIConfig();
|
|
23970
|
+
// 检查配置是否有效
|
|
23971
|
+
if (!isAIConfigValid(config)) {
|
|
23972
|
+
console.warn('AI configuration is incomplete or disabled, using mock response');
|
|
23973
|
+
return [2 /*return*/, getMockAIResponse(subQuery, promptQuery)];
|
|
23974
|
+
}
|
|
23975
|
+
messages = [
|
|
23976
|
+
{
|
|
23977
|
+
role: 'system',
|
|
23978
|
+
content: subQuery.includes('emoji followed by the sentiment in the format')
|
|
23979
|
+
? 'You are a helpful assistant. Please respond in string format.'
|
|
23980
|
+
: "NOTE: Return same html format just do changes content only. don't change html formats.",
|
|
23981
|
+
},
|
|
23982
|
+
{
|
|
23983
|
+
role: 'user',
|
|
23984
|
+
content: subQuery + " " + promptQuery,
|
|
23985
|
+
},
|
|
23986
|
+
];
|
|
23987
|
+
return [4 /*yield*/, sendAIRequest(messages, config)];
|
|
23988
|
+
case 1:
|
|
23989
|
+
result = _a.sent();
|
|
23990
|
+
return [2 /*return*/, result];
|
|
23991
|
+
case 2:
|
|
23992
|
+
error_2 = _a.sent();
|
|
23993
|
+
console.error('AI request failed, using mock response:', error_2);
|
|
23994
|
+
return [2 /*return*/, getMockAIResponse(subQuery, promptQuery)];
|
|
23995
|
+
case 3: return [2 /*return*/];
|
|
23996
|
+
}
|
|
23997
|
+
});
|
|
23998
|
+
});
|
|
23999
|
+
}
|
|
24000
|
+
// 兼容性方法(保持向后兼容)
|
|
24001
|
+
/**
|
|
24002
|
+
* @param {?} options
|
|
24003
|
+
* @return {?}
|
|
24004
|
+
* @this {*}
|
|
24005
|
+
*/
|
|
24006
|
+
function getAzureChatAIRequest(options) {
|
|
24007
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
24008
|
+
var config, result, err_1;
|
|
24009
|
+
return __generator(this, function (_a) {
|
|
24010
|
+
switch (_a.label) {
|
|
24011
|
+
case 0:
|
|
24012
|
+
_a.trys.push([0, 2, , 3]);
|
|
24013
|
+
config = getAIConfig();
|
|
24014
|
+
if (!isAIConfigValid(config)) {
|
|
24015
|
+
return [2 /*return*/, null];
|
|
24016
|
+
}
|
|
24017
|
+
return [4 /*yield*/, sendAIRequest(options.messages, config)];
|
|
24018
|
+
case 1:
|
|
24019
|
+
result = _a.sent();
|
|
24020
|
+
return [2 /*return*/, result];
|
|
24021
|
+
case 2:
|
|
24022
|
+
err_1 = _a.sent();
|
|
24023
|
+
console.error('Error occurred:', err_1);
|
|
24024
|
+
return [2 /*return*/, null];
|
|
24025
|
+
case 3: return [2 /*return*/];
|
|
24026
|
+
}
|
|
24027
|
+
});
|
|
24028
|
+
});
|
|
24029
|
+
}
|
|
24030
|
+
/**
|
|
24031
|
+
* @param {?} prompt
|
|
24032
|
+
* @return {?}
|
|
24033
|
+
* @this {*}
|
|
24034
|
+
*/
|
|
24035
|
+
function getAzureTextAIRequest(prompt) {
|
|
24036
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
24037
|
+
var config, messages, result, err_2;
|
|
24038
|
+
return __generator(this, function (_a) {
|
|
24039
|
+
switch (_a.label) {
|
|
24040
|
+
case 0:
|
|
24041
|
+
_a.trys.push([0, 2, , 3]);
|
|
24042
|
+
config = getAIConfig();
|
|
24043
|
+
if (!isAIConfigValid(config)) {
|
|
24044
|
+
return [2 /*return*/, undefined];
|
|
24045
|
+
}
|
|
24046
|
+
messages = [
|
|
24047
|
+
{
|
|
24048
|
+
role: 'user',
|
|
24049
|
+
content: prompt,
|
|
24050
|
+
},
|
|
24051
|
+
];
|
|
24052
|
+
return [4 /*yield*/, sendAIRequest(messages, config)];
|
|
24053
|
+
case 1:
|
|
24054
|
+
result = _a.sent();
|
|
24055
|
+
return [2 /*return*/, result];
|
|
24056
|
+
case 2:
|
|
24057
|
+
err_2 = _a.sent();
|
|
24058
|
+
console.error('Error occurred:', err_2);
|
|
24059
|
+
return [2 /*return*/, undefined];
|
|
24060
|
+
case 3: return [2 /*return*/];
|
|
24061
|
+
}
|
|
24062
|
+
});
|
|
24063
|
+
});
|
|
24064
|
+
}
|
|
24065
|
+
|
|
24066
|
+
/**
|
|
24067
|
+
* @fileoverview added by tsickle
|
|
24068
|
+
* Generated from: lib/form/richtexteditor/data-config.ts
|
|
24069
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
24070
|
+
*/
|
|
24071
|
+
// font family
|
|
24072
|
+
/** @type {?} */
|
|
24073
|
+
var fontFamily = {
|
|
24074
|
+
default: "Arial",
|
|
24075
|
+
items: [
|
|
24076
|
+
{
|
|
24077
|
+
text: "Arial",
|
|
24078
|
+
value: "Arial, Helvetica, sans-serif",
|
|
24079
|
+
cssClass: "e-arial",
|
|
24080
|
+
command: "Font",
|
|
24081
|
+
subCommand: "FontName",
|
|
24082
|
+
},
|
|
24083
|
+
{
|
|
24084
|
+
text: "Times New Roman",
|
|
24085
|
+
value: "Times New Roman,Times,serif",
|
|
24086
|
+
cssClass: "e-times-new-roman",
|
|
24087
|
+
command: "Font",
|
|
24088
|
+
subCommand: "FontName",
|
|
24089
|
+
},
|
|
24090
|
+
{
|
|
24091
|
+
text: "Helvetica",
|
|
24092
|
+
value: "Helvetica",
|
|
24093
|
+
cssClass: "e-helvetica",
|
|
24094
|
+
command: "Font",
|
|
24095
|
+
subCommand: "FontName",
|
|
24096
|
+
},
|
|
24097
|
+
{
|
|
24098
|
+
text: "Calibri",
|
|
24099
|
+
value: "Calibri, Helvetica, sans-serif",
|
|
24100
|
+
cssClass: "e-calibri",
|
|
24101
|
+
command: "Font",
|
|
24102
|
+
subCommand: "FontName",
|
|
24103
|
+
},
|
|
24104
|
+
{
|
|
24105
|
+
text: "Verdana",
|
|
24106
|
+
value: "Verdana,Geneva,sans-serif",
|
|
24107
|
+
cssClass: "e-verdana",
|
|
24108
|
+
command: "Font",
|
|
24109
|
+
subCommand: "FontName",
|
|
24110
|
+
},
|
|
24111
|
+
{
|
|
24112
|
+
text: "Georgia",
|
|
24113
|
+
value: "Georgia,serif",
|
|
24114
|
+
cssClass: "e-georgia",
|
|
24115
|
+
command: "Font",
|
|
24116
|
+
subCommand: "FontName",
|
|
24117
|
+
},
|
|
24118
|
+
{
|
|
24119
|
+
text: "Open Sans",
|
|
24120
|
+
value: "Open Sans, sans-serif",
|
|
24121
|
+
cssClass: "e-open-sans",
|
|
24122
|
+
command: "Font",
|
|
24123
|
+
subCommand: "FontName",
|
|
24124
|
+
},
|
|
24125
|
+
{
|
|
24126
|
+
text: "Roboto",
|
|
24127
|
+
value: "Roboto",
|
|
24128
|
+
cssClass: "e-roboto",
|
|
24129
|
+
command: "Font",
|
|
24130
|
+
subCommand: "FontName",
|
|
24131
|
+
},
|
|
24132
|
+
{
|
|
24133
|
+
text: "Lato",
|
|
24134
|
+
value: "Lato, sans-serif",
|
|
24135
|
+
cssClass: "e-lato",
|
|
24136
|
+
command: "Font",
|
|
24137
|
+
subCommand: "FontName",
|
|
24138
|
+
},
|
|
24139
|
+
{
|
|
24140
|
+
text: "Montserrat",
|
|
24141
|
+
value: "Montserrat, sans-serif",
|
|
24142
|
+
cssClass: "e-montserrat",
|
|
24143
|
+
command: "Font",
|
|
24144
|
+
subCommand: "FontName",
|
|
24145
|
+
},
|
|
24146
|
+
{
|
|
24147
|
+
text: "Segoe UI",
|
|
24148
|
+
value: "Segoe UI",
|
|
24149
|
+
cssClass: "e-segoe-ui",
|
|
24150
|
+
command: "Font",
|
|
24151
|
+
subCommand: "FontName",
|
|
24152
|
+
},
|
|
24153
|
+
{
|
|
24154
|
+
text: "Impact",
|
|
24155
|
+
value: "Impact,Charcoal,sans-serif",
|
|
24156
|
+
cssClass: "e-impact",
|
|
24157
|
+
command: "Font",
|
|
24158
|
+
subCommand: "FontName",
|
|
24159
|
+
},
|
|
24160
|
+
],
|
|
24161
|
+
};
|
|
24162
|
+
// line height配置
|
|
24163
|
+
/** @type {?} */
|
|
24164
|
+
var lineHeight_items = [
|
|
24165
|
+
{
|
|
24166
|
+
text: "1.0",
|
|
24167
|
+
},
|
|
24168
|
+
{
|
|
24169
|
+
text: "1.15",
|
|
24170
|
+
},
|
|
24171
|
+
{
|
|
24172
|
+
text: "1.5",
|
|
24173
|
+
},
|
|
24174
|
+
{
|
|
24175
|
+
text: "2.0",
|
|
24176
|
+
},
|
|
24177
|
+
{
|
|
24178
|
+
text: "2.5",
|
|
24179
|
+
},
|
|
24180
|
+
{
|
|
24181
|
+
text: "3.0",
|
|
24182
|
+
},
|
|
24183
|
+
];
|
|
24184
|
+
/**
|
|
24185
|
+
* @record
|
|
24186
|
+
*/
|
|
24187
|
+
function BulletStyle() { }
|
|
24188
|
+
if (false) {
|
|
24189
|
+
/** @type {?} */
|
|
24190
|
+
BulletStyle.prototype.id;
|
|
24191
|
+
/** @type {?} */
|
|
24192
|
+
BulletStyle.prototype.text;
|
|
24193
|
+
/** @type {?} */
|
|
24194
|
+
BulletStyle.prototype.symbol;
|
|
24195
|
+
/** @type {?} */
|
|
24196
|
+
BulletStyle.prototype.iconCss;
|
|
24197
|
+
/** @type {?} */
|
|
24198
|
+
BulletStyle.prototype.description;
|
|
24199
|
+
}
|
|
24200
|
+
/** @type {?} */
|
|
24201
|
+
var BULLET_STYLES = [
|
|
24202
|
+
{
|
|
24203
|
+
id: "disc",
|
|
24204
|
+
text: "● 实心圆点",
|
|
24205
|
+
symbol: "●",
|
|
24206
|
+
iconCss: "e-icons e-bullet-disc",
|
|
24207
|
+
description: "标准实心圆点",
|
|
24208
|
+
},
|
|
24209
|
+
{
|
|
24210
|
+
id: "circle",
|
|
24211
|
+
text: "○ 空心圆点",
|
|
24212
|
+
symbol: "○",
|
|
24213
|
+
iconCss: "e-icons e-bullet-circle",
|
|
24214
|
+
description: "空心圆点",
|
|
24215
|
+
},
|
|
24216
|
+
{
|
|
24217
|
+
id: "square",
|
|
24218
|
+
text: "■ 实心方块",
|
|
24219
|
+
symbol: "■",
|
|
24220
|
+
iconCss: "e-icons e-bullet-square",
|
|
24221
|
+
description: "实心方块",
|
|
24222
|
+
},
|
|
24223
|
+
{
|
|
24224
|
+
id: "diamond",
|
|
24225
|
+
text: "◆ 实心菱形",
|
|
24226
|
+
symbol: "◆",
|
|
24227
|
+
iconCss: "e-icons e-bullet-diamond",
|
|
24228
|
+
description: "实心菱形",
|
|
24229
|
+
},
|
|
24230
|
+
{
|
|
24231
|
+
id: "triangle",
|
|
24232
|
+
text: "► 实心三角",
|
|
24233
|
+
symbol: "►",
|
|
24234
|
+
iconCss: "e-icons e-bullet-triangle",
|
|
24235
|
+
description: "实心三角形",
|
|
24236
|
+
},
|
|
24237
|
+
{
|
|
24238
|
+
id: "arrow",
|
|
24239
|
+
text: "➤ 箭头",
|
|
24240
|
+
symbol: "➤",
|
|
24241
|
+
iconCss: "e-icons e-bullet-arrow",
|
|
24242
|
+
description: "箭头符号",
|
|
24243
|
+
},
|
|
24244
|
+
{
|
|
24245
|
+
id: "star",
|
|
24246
|
+
text: "★ 星形",
|
|
24247
|
+
symbol: "★",
|
|
24248
|
+
iconCss: "e-icons e-bullet-star",
|
|
24249
|
+
description: "星形符号",
|
|
24250
|
+
},
|
|
24251
|
+
{
|
|
24252
|
+
id: "check",
|
|
24253
|
+
text: "✓ 对勾",
|
|
24254
|
+
symbol: "✓",
|
|
24255
|
+
iconCss: "e-icons e-bullet-check",
|
|
24256
|
+
description: "对勾符号",
|
|
24257
|
+
},
|
|
24258
|
+
{
|
|
24259
|
+
id: "heart",
|
|
24260
|
+
text: "♥ 心形",
|
|
24261
|
+
symbol: "♥",
|
|
24262
|
+
iconCss: "e-icons e-bullet-heart",
|
|
24263
|
+
description: "心形符号",
|
|
24264
|
+
},
|
|
24265
|
+
{
|
|
24266
|
+
id: "bullet",
|
|
24267
|
+
text: "• 小圆点",
|
|
24268
|
+
symbol: "•",
|
|
24269
|
+
iconCss: "e-icons e-bullet-bullet",
|
|
24270
|
+
description: "小圆点",
|
|
24271
|
+
},
|
|
24272
|
+
];
|
|
24273
|
+
// 获取符号样式
|
|
24274
|
+
/**
|
|
24275
|
+
* @param {?} id
|
|
24276
|
+
* @return {?}
|
|
24277
|
+
*/
|
|
24278
|
+
function getBulletStyle(id) {
|
|
24279
|
+
return BULLET_STYLES.find((/**
|
|
24280
|
+
* @param {?} style
|
|
24281
|
+
* @return {?}
|
|
24282
|
+
*/
|
|
24283
|
+
function (style) { return style.id === id; }));
|
|
24284
|
+
}
|
|
24285
|
+
// 获取所有符号样式
|
|
24286
|
+
/**
|
|
24287
|
+
* @return {?}
|
|
24288
|
+
*/
|
|
24289
|
+
function getAllBulletStyles() {
|
|
24290
|
+
return BULLET_STYLES;
|
|
24291
|
+
}
|
|
24292
|
+
// 应用符号样式到列表
|
|
24293
|
+
/**
|
|
24294
|
+
* @param {?} ul
|
|
24295
|
+
* @param {?} style
|
|
24296
|
+
* @return {?}
|
|
24297
|
+
*/
|
|
24298
|
+
function applyBulletStyle(ul, style) {
|
|
24299
|
+
if (style.id === "disc" || style.id === "circle" || style.id === "square") {
|
|
24300
|
+
// 使用CSS list-style-type
|
|
24301
|
+
ul.style.listStyleType = style.id;
|
|
24302
|
+
// 移除自定义符号
|
|
24303
|
+
ul.querySelectorAll(".custom-bullet").forEach((/**
|
|
24304
|
+
* @param {?} bullet
|
|
24305
|
+
* @return {?}
|
|
24306
|
+
*/
|
|
24307
|
+
function (bullet) { return bullet.remove(); }));
|
|
24308
|
+
}
|
|
24309
|
+
else {
|
|
24310
|
+
// 使用自定义符号
|
|
24311
|
+
ul.style.listStyleType = "none";
|
|
24312
|
+
ul.setAttribute("data-bullet-style", style.id);
|
|
24313
|
+
/** @type {?} */
|
|
24314
|
+
var listItems = ul.querySelectorAll("li");
|
|
24315
|
+
listItems.forEach((/**
|
|
24316
|
+
* @param {?} li
|
|
24317
|
+
* @return {?}
|
|
24318
|
+
*/
|
|
24319
|
+
function (li) {
|
|
24320
|
+
// 移除现有的自定义符号
|
|
24321
|
+
/** @type {?} */
|
|
24322
|
+
var existingBullet = li.querySelector(".custom-bullet");
|
|
24323
|
+
if (existingBullet) {
|
|
24324
|
+
existingBullet.remove();
|
|
24325
|
+
}
|
|
24326
|
+
// 添加新的自定义符号
|
|
24327
|
+
/** @type {?} */
|
|
24328
|
+
var bullet = document.createElement("span");
|
|
24329
|
+
bullet.className = "custom-bullet";
|
|
24330
|
+
bullet.textContent = style.symbol;
|
|
24331
|
+
bullet.style.marginRight = "8px";
|
|
24332
|
+
bullet.style.color = "#666";
|
|
24333
|
+
// 将符号插入到列表项的开头
|
|
24334
|
+
li.insertBefore(bullet, li.firstChild);
|
|
24335
|
+
}));
|
|
24336
|
+
}
|
|
24337
|
+
}
|
|
24338
|
+
|
|
24339
|
+
/**
|
|
24340
|
+
* @fileoverview added by tsickle
|
|
24341
|
+
* Generated from: lib/form/richtexteditor/index.component.ts
|
|
24342
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
24343
|
+
*/
|
|
24344
|
+
var RichtexteditorComponent = /** @class */ (function () {
|
|
24345
|
+
function RichtexteditorComponent(ref) {
|
|
24346
|
+
this.ref = ref;
|
|
24347
|
+
// @ViewChild("chipList", { static: false }) public chipList!: ChipListComponent;
|
|
24348
|
+
this.placeholder = "";
|
|
24349
|
+
this.value = "";
|
|
24350
|
+
this.height = 150;
|
|
24351
|
+
this.autoSaveOnIdle = true;
|
|
24352
|
+
this.target = "#container"; // dialog 弹窗父级
|
|
24353
|
+
// dialog 弹窗父级
|
|
24354
|
+
this.toolbarClick = new core.EventEmitter();
|
|
24355
|
+
this.change = new core.EventEmitter();
|
|
24356
|
+
// @Output() change = new EventEmitter();
|
|
24357
|
+
this.family = fontFamily;
|
|
24358
|
+
this.dialogWidth = "800px";
|
|
24359
|
+
this.dialogHeight = "642px";
|
|
24360
|
+
this.showZoomBtn = true;
|
|
24361
|
+
this.showMsg = false;
|
|
24362
|
+
this.insertImageSettings = {
|
|
24363
|
+
saveFormat: "Blob",
|
|
24364
|
+
allowedTypes: [".svg", ".png"],
|
|
24365
|
+
display: "none",
|
|
24366
|
+
};
|
|
24367
|
+
this.size = "";
|
|
24368
|
+
this.dropValIndex = 0;
|
|
24369
|
+
this.queryList = [
|
|
24370
|
+
{ id: "Rephrase", text: "Rephrase" },
|
|
24371
|
+
{ id: "Grammar", text: "Correct Grammar" },
|
|
24372
|
+
{ id: "Summarize", text: "Summarize" },
|
|
24373
|
+
{ id: "Elaborate", text: "Elaborate" },
|
|
24374
|
+
{ id: "Translate", text: "Translate" },
|
|
24375
|
+
{ id: "SentimentAnalysis", text: "Sentiment Analysis" },
|
|
24376
|
+
];
|
|
24377
|
+
this.rephraseTyleList = [
|
|
24378
|
+
{ text: "Standard", id: "Standard" },
|
|
24379
|
+
{ text: "Fluent", id: "Fluent" },
|
|
24380
|
+
{ text: "Professional", id: "Professional" },
|
|
24381
|
+
];
|
|
24382
|
+
this.languageList = [
|
|
24383
|
+
{ id: "EN", text: "English" },
|
|
24384
|
+
{ id: "ZH", text: "Chinese (Simplified)" },
|
|
24385
|
+
{ id: "ES", text: "Spanish" },
|
|
24386
|
+
{ id: "ZHT", text: "Chinese (Traditional)" },
|
|
24387
|
+
{ id: "HI", text: "Hindi" },
|
|
24388
|
+
{ id: "AR", text: "Arabic" },
|
|
24389
|
+
{ id: "BN", text: "Bengali" },
|
|
24390
|
+
{ id: "PT", text: "Portuguese" },
|
|
24391
|
+
{ id: "RU", text: "Russian" },
|
|
24392
|
+
{ id: "JA", text: "Japanese" },
|
|
24393
|
+
{ id: "DE", text: "German" },
|
|
24394
|
+
{ id: "KO", text: "Korean" },
|
|
24395
|
+
{ id: "FR", text: "French" },
|
|
24396
|
+
{ id: "IT", text: "Italian" },
|
|
24397
|
+
{ id: "TR", text: "Turkish" },
|
|
24398
|
+
];
|
|
24399
|
+
this.promptQuery = "";
|
|
24400
|
+
this.isSentimentCheck = false;
|
|
24401
|
+
this.subQuery = "";
|
|
24402
|
+
this.chipValue = "Standard";
|
|
24403
|
+
this.tools = {
|
|
24404
|
+
enableFloating: false,
|
|
24405
|
+
items: [
|
|
24406
|
+
{
|
|
24407
|
+
tooltipText: "AI Assist",
|
|
24408
|
+
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>',
|
|
24409
|
+
},
|
|
24410
|
+
"Bold",
|
|
24411
|
+
"Italic",
|
|
24412
|
+
"Underline",
|
|
24413
|
+
"StrikeThrough",
|
|
24414
|
+
"FontName",
|
|
24415
|
+
"FontSize",
|
|
24416
|
+
"FontColor",
|
|
24417
|
+
"BackgroundColor",
|
|
24418
|
+
"LowerCase",
|
|
24419
|
+
"UpperCase",
|
|
24420
|
+
"|",
|
|
24421
|
+
"CreateTable",
|
|
24422
|
+
"Formats",
|
|
24423
|
+
"Alignments",
|
|
24424
|
+
{
|
|
24425
|
+
tooltipText: "Line Height",
|
|
24426
|
+
template: '<button class="e-tbar-btn e-btn" tabindex="-1" id="lineheight_tbar" style="width:100%"></button>',
|
|
24427
|
+
},
|
|
24428
|
+
"OrderedList",
|
|
24429
|
+
"UnorderedList",
|
|
24430
|
+
"Outdent",
|
|
24431
|
+
"Indent",
|
|
24432
|
+
"|",
|
|
24433
|
+
"CreateLink",
|
|
24434
|
+
{
|
|
24435
|
+
tooltipText: "",
|
|
24436
|
+
template: '<button class="e-tbar-btn e-btn" tabindex="-1" id="custom_tbar" style="width:100%">' +
|
|
24437
|
+
'<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>',
|
|
24438
|
+
},
|
|
24439
|
+
"|",
|
|
24440
|
+
"FormatPainter",
|
|
24441
|
+
"ClearFormat",
|
|
24442
|
+
"|",
|
|
24443
|
+
"Undo",
|
|
24444
|
+
"Redo",
|
|
24445
|
+
],
|
|
24446
|
+
};
|
|
24447
|
+
}
|
|
24448
|
+
/**
|
|
24449
|
+
* @return {?}
|
|
24450
|
+
*/
|
|
24451
|
+
RichtexteditorComponent.prototype.ngOnInit = /**
|
|
24452
|
+
* @return {?}
|
|
24453
|
+
*/
|
|
24454
|
+
function () { };
|
|
24455
|
+
/**
|
|
24456
|
+
* @param {?} args
|
|
24457
|
+
* @return {?}
|
|
24458
|
+
*/
|
|
24459
|
+
RichtexteditorComponent.prototype.onContentChange = /**
|
|
24460
|
+
* @param {?} args
|
|
24461
|
+
* @return {?}
|
|
24462
|
+
*/
|
|
24463
|
+
function (args) {
|
|
24464
|
+
/** @type {?} */
|
|
24465
|
+
var tables = document.querySelectorAll("table.e-rte-table");
|
|
24466
|
+
tables.forEach((/**
|
|
24467
|
+
* @param {?} table
|
|
24468
|
+
* @return {?}
|
|
24469
|
+
*/
|
|
24470
|
+
function (table) {
|
|
24471
|
+
/** @type {?} */
|
|
24472
|
+
var htmlTable = (/** @type {?} */ (table));
|
|
24473
|
+
htmlTable.style.marginBottom = "10px";
|
|
24474
|
+
htmlTable.style.borderCollapse = "collapse";
|
|
24475
|
+
htmlTable.style.emptyCells = "show";
|
|
24476
|
+
/** @type {?} */
|
|
24477
|
+
var tdElements = table.querySelectorAll("td");
|
|
24478
|
+
tdElements.forEach((/**
|
|
24479
|
+
* @param {?} td
|
|
24480
|
+
* @return {?}
|
|
24481
|
+
*/
|
|
24482
|
+
function (td) {
|
|
24483
|
+
td.style.border = "1px solid #adb5bd";
|
|
24484
|
+
td.style.height = "20px";
|
|
24485
|
+
td.style.minWidth = "20px";
|
|
24486
|
+
td.style.padding = "2px 5px";
|
|
24487
|
+
td.style.boxSizing = "border-box";
|
|
24488
|
+
}));
|
|
24489
|
+
}));
|
|
24490
|
+
this.change.emit(args);
|
|
24491
|
+
};
|
|
24492
|
+
/**
|
|
24493
|
+
* @return {?}
|
|
24494
|
+
*/
|
|
24495
|
+
RichtexteditorComponent.prototype.onCreate = /**
|
|
24496
|
+
* @return {?}
|
|
24497
|
+
*/
|
|
24498
|
+
function () {
|
|
24499
|
+
var _this = this;
|
|
24500
|
+
//bind the a click event
|
|
24501
|
+
// let editorContent = this.rteObj.contentModule.getEditPanel() as HTMLElement;
|
|
24502
|
+
// editorContent.addEventListener('click', this.OnClicked.bind(this));
|
|
24503
|
+
//add the line height
|
|
24504
|
+
this.editorManager = this.rteObj.formatter.editorManager;
|
|
24505
|
+
/** @type {?} */
|
|
24506
|
+
var splitButton = new ej2AngularSplitbuttons.DropDownButton({
|
|
24507
|
+
items: lineHeight_items,
|
|
24508
|
+
iconCss: "e-icons e-line-spacing",
|
|
24509
|
+
select: this.onSelect.bind(this),
|
|
24510
|
+
});
|
|
24511
|
+
splitButton.appendTo("#lineheight_tbar");
|
|
24512
|
+
// ai assist
|
|
24513
|
+
/** @type {?} */
|
|
24514
|
+
var aiassistantButton = new ej2AngularSplitbuttons.DropDownButton({
|
|
24515
|
+
items: this.queryList,
|
|
24516
|
+
// iconCss: "e-btn-icon e-icons e-assistview-icon e-icon-left",
|
|
24517
|
+
select: (/**
|
|
24518
|
+
* @param {?} args
|
|
24519
|
+
* @return {?}
|
|
24520
|
+
*/
|
|
24521
|
+
function (args) { return _this.aiQuerySelectedMenu(args); }),
|
|
24522
|
+
});
|
|
24523
|
+
aiassistantButton.appendTo("#ai_assistant_button_tbar");
|
|
24524
|
+
};
|
|
24525
|
+
/**
|
|
24526
|
+
* @private
|
|
24527
|
+
* @param {?} args
|
|
24528
|
+
* @return {?}
|
|
24529
|
+
*/
|
|
24530
|
+
RichtexteditorComponent.prototype.onSelect = /**
|
|
24531
|
+
* @private
|
|
24532
|
+
* @param {?} args
|
|
24533
|
+
* @return {?}
|
|
24534
|
+
*/
|
|
24535
|
+
function (args) {
|
|
24536
|
+
if (this.rteObj.formatter.getUndoRedoStack().length === 0) {
|
|
24537
|
+
this.rteObj.formatter.saveData();
|
|
24538
|
+
}
|
|
24539
|
+
/** @type {?} */
|
|
24540
|
+
var nodes = this.editorManager.domNode.blockNodes();
|
|
24541
|
+
for (var i = 0; nodes.length > i; i++) {
|
|
24542
|
+
((/** @type {?} */ (nodes[i]))).style.lineHeight = args.item.text;
|
|
24543
|
+
}
|
|
24544
|
+
this.rteObj.formatter.saveData();
|
|
24545
|
+
this.rteObj.formatter.enableUndo(this.rteObj);
|
|
24546
|
+
};
|
|
24547
|
+
/**
|
|
24548
|
+
* @private
|
|
24549
|
+
* @param {?} args
|
|
24550
|
+
* @return {?}
|
|
24551
|
+
*/
|
|
24552
|
+
RichtexteditorComponent.prototype.aiQuerySelectedMenu = /**
|
|
24553
|
+
* @private
|
|
24554
|
+
* @param {?} args
|
|
24555
|
+
* @return {?}
|
|
24556
|
+
*/
|
|
24557
|
+
function (args) {
|
|
24558
|
+
this.dialogueOpen(args.item.text);
|
|
24559
|
+
};
|
|
24560
|
+
/**
|
|
24561
|
+
* @param {?} selectedQuery
|
|
24562
|
+
* @return {?}
|
|
24563
|
+
*/
|
|
24564
|
+
RichtexteditorComponent.prototype.dialogueOpen = /**
|
|
24565
|
+
* @param {?} selectedQuery
|
|
24566
|
+
* @return {?}
|
|
24567
|
+
*/
|
|
24568
|
+
function (selectedQuery) {
|
|
24569
|
+
var _this = this;
|
|
24570
|
+
/** @type {?} */
|
|
24571
|
+
var selectionText = this.rteObj.getSelectedHtml();
|
|
24572
|
+
this.selectedQuery = selectedQuery;
|
|
24573
|
+
if (selectionText) {
|
|
24574
|
+
/** @type {?} */
|
|
24575
|
+
var range = ((/** @type {?} */ (this.rteObj))).formatter.editorManager.nodeSelection.getRange(((/** @type {?} */ (this.rteObj))).contentModule.getDocument());
|
|
24576
|
+
((/** @type {?} */ (this.rteObj))).formatter.editorManager.nodeSelection.save(range, ((/** @type {?} */ (this.rteObj))).contentModule.getDocument());
|
|
24577
|
+
this.dropValIndex = this.queryList.findIndex((/**
|
|
24578
|
+
* @param {?} q
|
|
24579
|
+
* @return {?}
|
|
24580
|
+
*/
|
|
24581
|
+
function (q) { return q.text.toLowerCase() === selectedQuery.toLowerCase(); }));
|
|
24582
|
+
this.queryCategory.index = this.dropValIndex;
|
|
24583
|
+
this.leftRte.value = this.promptQuery = selectionText;
|
|
24584
|
+
this.leftRte.refreshUI();
|
|
24585
|
+
this.AIdialog.show();
|
|
24586
|
+
this.updateAISugesstionsData(selectedQuery);
|
|
24587
|
+
}
|
|
24588
|
+
else {
|
|
24589
|
+
this.showMsg = true;
|
|
24590
|
+
setTimeout((/**
|
|
24591
|
+
* @return {?}
|
|
24592
|
+
*/
|
|
24593
|
+
function () {
|
|
24594
|
+
_this.showMsg = false;
|
|
24595
|
+
}), 3000);
|
|
24596
|
+
console.log("Please select the content to perform the AI operation.");
|
|
24597
|
+
}
|
|
24598
|
+
};
|
|
24599
|
+
/**
|
|
24600
|
+
* @param {?} selectedQuery
|
|
24601
|
+
* @return {?}
|
|
24602
|
+
*/
|
|
24603
|
+
RichtexteditorComponent.prototype.updateAISugesstionsData = /**
|
|
24604
|
+
* @param {?} selectedQuery
|
|
24605
|
+
* @return {?}
|
|
24606
|
+
*/
|
|
24607
|
+
function (selectedQuery) {
|
|
24608
|
+
this.isSentimentCheck = false;
|
|
24609
|
+
switch (selectedQuery) {
|
|
24610
|
+
case "Summarize":
|
|
24611
|
+
this.subQuery = "Summarize the upcoming sentence shortly.";
|
|
24612
|
+
break;
|
|
24613
|
+
case "Elaborate":
|
|
24614
|
+
this.subQuery = "Elaborate on the upcoming sentence.";
|
|
24615
|
+
break;
|
|
24616
|
+
case "Rephrase":
|
|
24617
|
+
this.subQuery = this.chipValue + " rephrase the upcoming sentence.";
|
|
24618
|
+
break;
|
|
24619
|
+
case "Correct Grammar":
|
|
24620
|
+
this.subQuery = "Correct the grammar of the upcoming sentence.";
|
|
24621
|
+
break;
|
|
24622
|
+
case "Translate":
|
|
24623
|
+
this.subQuery =
|
|
24624
|
+
"Translate the upcoming sentence to " + this.translatelanguage + ".";
|
|
24625
|
+
break;
|
|
24626
|
+
case "Sentiment Analysis":
|
|
24627
|
+
this.isSentimentCheck = true;
|
|
24628
|
+
this.subQuery =
|
|
24629
|
+
'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:';
|
|
24630
|
+
break;
|
|
24631
|
+
}
|
|
24632
|
+
this.updateAISugesstions();
|
|
24633
|
+
};
|
|
24634
|
+
/**
|
|
24635
|
+
* @return {?}
|
|
24636
|
+
*/
|
|
24637
|
+
RichtexteditorComponent.prototype.updateAISugesstions = /**
|
|
24638
|
+
* @return {?}
|
|
24639
|
+
*/
|
|
24640
|
+
function () {
|
|
24641
|
+
var _this = this;
|
|
24642
|
+
try {
|
|
24643
|
+
if (this.promptQuery) {
|
|
24644
|
+
((/** @type {?} */ (document.getElementById("skeletonId")))).style.display =
|
|
24645
|
+
"";
|
|
24646
|
+
((/** @type {?} */ (document.getElementById("rightRte")))).style.display =
|
|
24647
|
+
"none";
|
|
24648
|
+
this.sentimentButton.element.style.display = "none";
|
|
24649
|
+
this.regenerateButton.disabled = true;
|
|
24650
|
+
this.copyButton.disabled = true;
|
|
24651
|
+
this.replaceButton.disabled = true;
|
|
24652
|
+
this.apiResultData = this.getResponseFromOpenAI(this.subQuery, this.promptQuery);
|
|
24653
|
+
this.apiResultData.then((/**
|
|
24654
|
+
* @param {?} result
|
|
24655
|
+
* @return {?}
|
|
24656
|
+
*/
|
|
24657
|
+
function (result) {
|
|
24658
|
+
_this.AIResult = _this.isSentimentCheck ? _this.promptQuery : result;
|
|
24659
|
+
_this.sentimentButton.content = result
|
|
24660
|
+
.toLowerCase()
|
|
24661
|
+
.includes("positive")
|
|
24662
|
+
? "😊 Positive"
|
|
24663
|
+
: result.toLowerCase().includes("negative")
|
|
24664
|
+
? "😞 Negative"
|
|
24665
|
+
: "😐 Neutral";
|
|
24666
|
+
_this.sentimentButton.element.style.display = !_this.isSentimentCheck
|
|
24667
|
+
? "none"
|
|
24668
|
+
: "";
|
|
24669
|
+
_this.rightRte.value = _this.AIResult;
|
|
24670
|
+
/** @type {?} */
|
|
24671
|
+
var noResultsFound = !(_this.AIResult || _this.promptQuery);
|
|
24672
|
+
((/** @type {?} */ (document.getElementById("no-results-found")))).style.display = noResultsFound ? "" : "none";
|
|
24673
|
+
_this.regenerateButton.disabled = noResultsFound;
|
|
24674
|
+
_this.copyButton.disabled = noResultsFound;
|
|
24675
|
+
_this.replaceButton.disabled = noResultsFound;
|
|
24676
|
+
((/** @type {?} */ (document.getElementById("skeletonId")))).style.display =
|
|
24677
|
+
"none";
|
|
24678
|
+
((/** @type {?} */ (document.getElementById("rightRte")))).style.display =
|
|
24679
|
+
noResultsFound ? "none" : "";
|
|
24680
|
+
console.log(noResultsFound, ((/** @type {?} */ (document.getElementById("rightRte")))).style);
|
|
24681
|
+
// this.ref.markForCheck();
|
|
24682
|
+
}));
|
|
24683
|
+
}
|
|
24684
|
+
}
|
|
24685
|
+
catch (_a) {
|
|
24686
|
+
// this.toastObj.show();
|
|
24687
|
+
}
|
|
24688
|
+
};
|
|
24689
|
+
/**
|
|
24690
|
+
* @param {?} subQuery
|
|
24691
|
+
* @param {?} promptQuery
|
|
24692
|
+
* @return {?}
|
|
24693
|
+
*/
|
|
24694
|
+
RichtexteditorComponent.prototype.getResponseFromOpenAI = /**
|
|
24695
|
+
* @param {?} subQuery
|
|
24696
|
+
* @param {?} promptQuery
|
|
24697
|
+
* @return {?}
|
|
24698
|
+
*/
|
|
24699
|
+
function (subQuery, promptQuery) {
|
|
24700
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
24701
|
+
var content;
|
|
24702
|
+
return __generator(this, function (_a) {
|
|
24703
|
+
switch (_a.label) {
|
|
24704
|
+
case 0: return [4 /*yield*/, OpenAiModelRTE(subQuery, promptQuery)];
|
|
24705
|
+
case 1:
|
|
24706
|
+
content = _a.sent();
|
|
24707
|
+
return [2 /*return*/, content ? ((/** @type {?} */ (content))) : ""];
|
|
24708
|
+
}
|
|
24709
|
+
});
|
|
24710
|
+
});
|
|
24711
|
+
};
|
|
24712
|
+
/**
|
|
24713
|
+
* @return {?}
|
|
24714
|
+
*/
|
|
24715
|
+
RichtexteditorComponent.prototype.dialogShow = /**
|
|
24716
|
+
* @return {?}
|
|
24717
|
+
*/
|
|
24718
|
+
function () {
|
|
24719
|
+
var _this = this;
|
|
24720
|
+
(/** @type {?} */ (this.regenerateButton)).element.addEventListener("click", (/**
|
|
24721
|
+
* @return {?}
|
|
24722
|
+
*/
|
|
24723
|
+
function () {
|
|
24724
|
+
_this.updateAISugesstions();
|
|
24725
|
+
}));
|
|
24726
|
+
(/** @type {?} */ (this.copyButton)).element.addEventListener("click", (/**
|
|
24727
|
+
* @return {?}
|
|
24728
|
+
*/
|
|
24729
|
+
function () {
|
|
24730
|
+
_this.copyTextToClipboard(_this.AIResult);
|
|
24731
|
+
}));
|
|
24732
|
+
(/** @type {?} */ (this.replaceButton)).element.addEventListener("click", (/**
|
|
24733
|
+
* @return {?}
|
|
24734
|
+
*/
|
|
24735
|
+
function () {
|
|
24736
|
+
/** @type {?} */
|
|
24737
|
+
var range = ((/** @type {?} */ (_this.rteObj))).formatter.editorManager.nodeSelection.getRange(((/** @type {?} */ (_this.rteObj))).contentModule.getDocument());
|
|
24738
|
+
((/** @type {?} */ (_this.rteObj))).formatter.editorManager.nodeSelection.restore(range);
|
|
24739
|
+
((/** @type {?} */ (_this.rteObj))).executeCommand("insertHTML", _this.AIResult, {
|
|
24740
|
+
undo: true,
|
|
24741
|
+
});
|
|
24742
|
+
_this.closeDialog();
|
|
24743
|
+
}));
|
|
24744
|
+
((/** @type {?} */ (this.AIdialog))).element.style.display = "";
|
|
24745
|
+
};
|
|
24746
|
+
/**
|
|
24747
|
+
* @return {?}
|
|
24748
|
+
*/
|
|
24749
|
+
RichtexteditorComponent.prototype.closeDialog = /**
|
|
24750
|
+
* @return {?}
|
|
24751
|
+
*/
|
|
24752
|
+
function () {
|
|
24753
|
+
this.AIdialog.hide();
|
|
24754
|
+
this.rightRte.value = "";
|
|
24755
|
+
this.leftRte.value = "";
|
|
24756
|
+
this.promptQuery = "";
|
|
24757
|
+
this.chipValue = "Standard";
|
|
24758
|
+
this.AIResult = "";
|
|
24759
|
+
this.dropValIndex = 0;
|
|
24760
|
+
this.selectedQuery = "Rephrase";
|
|
24761
|
+
this.sentimentButton.content = "😊 Neutral";
|
|
24762
|
+
};
|
|
24763
|
+
/**
|
|
24764
|
+
* @param {?} text
|
|
24765
|
+
* @return {?}
|
|
24766
|
+
*/
|
|
24767
|
+
RichtexteditorComponent.prototype.copyTextToClipboard = /**
|
|
24768
|
+
* @param {?} text
|
|
24769
|
+
* @return {?}
|
|
24770
|
+
*/
|
|
24771
|
+
function (text) {
|
|
24772
|
+
if (navigator.clipboard) {
|
|
24773
|
+
navigator.clipboard
|
|
24774
|
+
.writeText(text)
|
|
24775
|
+
.then((/**
|
|
24776
|
+
* @return {?}
|
|
24777
|
+
*/
|
|
24778
|
+
function () {
|
|
24779
|
+
console.log("Text copied to clipboard successfully!");
|
|
24780
|
+
}))
|
|
24781
|
+
.catch((/**
|
|
24782
|
+
* @param {?} err
|
|
24783
|
+
* @return {?}
|
|
24784
|
+
*/
|
|
24785
|
+
function (err) {
|
|
24786
|
+
console.error("Failed to copy text: ", err);
|
|
24787
|
+
}));
|
|
24788
|
+
}
|
|
24789
|
+
else {
|
|
24790
|
+
// Fallback for browsers that do not support the Clipboard API
|
|
24791
|
+
/** @type {?} */
|
|
24792
|
+
var textarea = document.createElement("textarea");
|
|
24793
|
+
textarea.value = text;
|
|
24794
|
+
document.body.appendChild(textarea);
|
|
24795
|
+
textarea.select();
|
|
24796
|
+
try {
|
|
24797
|
+
document.execCommand("copy");
|
|
24798
|
+
console.log("Text copied to clipboard using execCommand");
|
|
24799
|
+
}
|
|
24800
|
+
catch (err) {
|
|
24801
|
+
console.error("Failed to copy text: ", err);
|
|
24802
|
+
}
|
|
24803
|
+
finally {
|
|
24804
|
+
document.body.removeChild(textarea);
|
|
24805
|
+
}
|
|
24806
|
+
}
|
|
24807
|
+
};
|
|
24808
|
+
/**
|
|
24809
|
+
* @return {?}
|
|
24810
|
+
*/
|
|
24811
|
+
RichtexteditorComponent.prototype.onOverlayClick = /**
|
|
24812
|
+
* @return {?}
|
|
24813
|
+
*/
|
|
24814
|
+
function () {
|
|
24815
|
+
/** @type {?} */
|
|
24816
|
+
var activeEle = this.AIdialog.element.querySelector(".char_block.e-active");
|
|
24817
|
+
if (activeEle) {
|
|
24818
|
+
activeEle.classList.remove("e-active");
|
|
24819
|
+
}
|
|
24820
|
+
this.closeDialog();
|
|
24821
|
+
};
|
|
24822
|
+
/**
|
|
24823
|
+
* @param {?} args
|
|
24824
|
+
* @return {?}
|
|
24825
|
+
*/
|
|
24826
|
+
RichtexteditorComponent.prototype.onQuerySelect = /**
|
|
24827
|
+
* @param {?} args
|
|
24828
|
+
* @return {?}
|
|
24829
|
+
*/
|
|
24830
|
+
function (args) {
|
|
24831
|
+
// this.chipList.selectedChips = 0;
|
|
24832
|
+
this.translatelanguage = "EN";
|
|
24833
|
+
this.selectedQuery = args.itemData.text;
|
|
24834
|
+
this.updateAISugesstionsData(args.itemData.text);
|
|
24835
|
+
};
|
|
24836
|
+
/**
|
|
24837
|
+
* @param {?} args
|
|
24838
|
+
* @return {?}
|
|
24839
|
+
*/
|
|
24840
|
+
RichtexteditorComponent.prototype.onLanguageSelect = /**
|
|
24841
|
+
* @param {?} args
|
|
24842
|
+
* @return {?}
|
|
24843
|
+
*/
|
|
24844
|
+
function (args) {
|
|
24845
|
+
this.translatelanguage = args.itemData.id;
|
|
24846
|
+
this.updateAISugesstionsData("Translate");
|
|
24847
|
+
};
|
|
24848
|
+
/**
|
|
24849
|
+
* @param {?} args
|
|
24850
|
+
* @return {?}
|
|
24851
|
+
*/
|
|
24852
|
+
RichtexteditorComponent.prototype.onChipClick = /**
|
|
24853
|
+
* @param {?} args
|
|
24854
|
+
* @return {?}
|
|
24855
|
+
*/
|
|
24856
|
+
function (args) {
|
|
24857
|
+
this.chipValue = args.itemData.text;
|
|
24858
|
+
// 事件会触发两次 必须判断args.text是否有值
|
|
24859
|
+
if (args.itemData.text)
|
|
24860
|
+
this.updateAISugesstionsData("Rephrase");
|
|
24861
|
+
};
|
|
24862
|
+
/**
|
|
24863
|
+
* @param {?} args
|
|
24864
|
+
* @return {?}
|
|
24865
|
+
*/
|
|
24866
|
+
RichtexteditorComponent.prototype._toolbarClick = /**
|
|
24867
|
+
* @param {?} args
|
|
24868
|
+
* @return {?}
|
|
24869
|
+
*/
|
|
24870
|
+
function (args) {
|
|
24871
|
+
this.toolbarClick.emit(args);
|
|
24872
|
+
};
|
|
24873
|
+
/**
|
|
24874
|
+
* @return {?}
|
|
24875
|
+
*/
|
|
24876
|
+
RichtexteditorComponent.prototype.hideToast = /**
|
|
24877
|
+
* @return {?}
|
|
24878
|
+
*/
|
|
24879
|
+
function () {
|
|
24880
|
+
this.showMsg = false;
|
|
24881
|
+
};
|
|
24882
|
+
/**
|
|
24883
|
+
* @return {?}
|
|
24884
|
+
*/
|
|
24885
|
+
RichtexteditorComponent.prototype.onZoom = /**
|
|
24886
|
+
* @return {?}
|
|
24887
|
+
*/
|
|
24888
|
+
function () {
|
|
24889
|
+
if (this.size === "largest") {
|
|
24890
|
+
this.size = ""; // 恢复到原始大小
|
|
24891
|
+
}
|
|
24892
|
+
else {
|
|
24893
|
+
this.size = "largest"; // 设置为最大化
|
|
24894
|
+
}
|
|
24895
|
+
};
|
|
24896
|
+
RichtexteditorComponent.decorators = [
|
|
24897
|
+
{ type: core.Component, args: [{
|
|
24898
|
+
selector: "rs-richtext-editor",
|
|
24899
|
+
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",
|
|
24900
|
+
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}"]
|
|
24901
|
+
}] }
|
|
24902
|
+
];
|
|
24903
|
+
/** @nocollapse */
|
|
24904
|
+
RichtexteditorComponent.ctorParameters = function () { return [
|
|
24905
|
+
{ type: core.ChangeDetectorRef }
|
|
24906
|
+
]; };
|
|
24907
|
+
RichtexteditorComponent.propDecorators = {
|
|
24908
|
+
rteObj: [{ type: core.ViewChild, args: ["editor", { static: false },] }],
|
|
24909
|
+
queryCategory: [{ type: core.ViewChild, args: ["queryCategory", { static: false },] }],
|
|
24910
|
+
leftRte: [{ type: core.ViewChild, args: ["leftRte", { static: false },] }],
|
|
24911
|
+
rightRte: [{ type: core.ViewChild, args: ["rightRte", { static: false },] }],
|
|
24912
|
+
AIdialog: [{ type: core.ViewChild, args: ["AIdialog", { static: true },] }],
|
|
24913
|
+
sentimentButton: [{ type: core.ViewChild, args: ["sentimentButton", { static: false },] }],
|
|
24914
|
+
regenerateButton: [{ type: core.ViewChild, args: ["regenerateButton", { static: false },] }],
|
|
24915
|
+
copyButton: [{ type: core.ViewChild, args: ["copyButton", { static: false },] }],
|
|
24916
|
+
replaceButton: [{ type: core.ViewChild, args: ["replaceButton", { static: false },] }],
|
|
24917
|
+
placeholder: [{ type: core.Input }],
|
|
24918
|
+
value: [{ type: core.Input }],
|
|
24919
|
+
height: [{ type: core.Input }],
|
|
24920
|
+
autoSaveOnIdle: [{ type: core.Input }],
|
|
24921
|
+
target: [{ type: core.Input }],
|
|
24922
|
+
toolbarClick: [{ type: core.Output }],
|
|
24923
|
+
change: [{ type: core.Output }]
|
|
24924
|
+
};
|
|
24925
|
+
return RichtexteditorComponent;
|
|
24926
|
+
}());
|
|
24927
|
+
if (false) {
|
|
24928
|
+
/** @type {?} */
|
|
24929
|
+
RichtexteditorComponent.prototype.rteObj;
|
|
24930
|
+
/** @type {?} */
|
|
24931
|
+
RichtexteditorComponent.prototype.queryCategory;
|
|
24932
|
+
/** @type {?} */
|
|
24933
|
+
RichtexteditorComponent.prototype.leftRte;
|
|
24934
|
+
/** @type {?} */
|
|
24935
|
+
RichtexteditorComponent.prototype.rightRte;
|
|
24936
|
+
/** @type {?} */
|
|
24937
|
+
RichtexteditorComponent.prototype.AIdialog;
|
|
24938
|
+
/** @type {?} */
|
|
24939
|
+
RichtexteditorComponent.prototype.sentimentButton;
|
|
24940
|
+
/** @type {?} */
|
|
24941
|
+
RichtexteditorComponent.prototype.regenerateButton;
|
|
24942
|
+
/** @type {?} */
|
|
24943
|
+
RichtexteditorComponent.prototype.copyButton;
|
|
24944
|
+
/** @type {?} */
|
|
24945
|
+
RichtexteditorComponent.prototype.replaceButton;
|
|
24946
|
+
/** @type {?} */
|
|
24947
|
+
RichtexteditorComponent.prototype.placeholder;
|
|
24948
|
+
/** @type {?} */
|
|
24949
|
+
RichtexteditorComponent.prototype.value;
|
|
24950
|
+
/** @type {?} */
|
|
24951
|
+
RichtexteditorComponent.prototype.height;
|
|
24952
|
+
/** @type {?} */
|
|
24953
|
+
RichtexteditorComponent.prototype.autoSaveOnIdle;
|
|
24954
|
+
/** @type {?} */
|
|
24955
|
+
RichtexteditorComponent.prototype.target;
|
|
24956
|
+
/** @type {?} */
|
|
24957
|
+
RichtexteditorComponent.prototype.toolbarClick;
|
|
24958
|
+
/** @type {?} */
|
|
24959
|
+
RichtexteditorComponent.prototype.change;
|
|
24960
|
+
/** @type {?} */
|
|
24961
|
+
RichtexteditorComponent.prototype.family;
|
|
24962
|
+
/** @type {?} */
|
|
24963
|
+
RichtexteditorComponent.prototype.dialogWidth;
|
|
24964
|
+
/** @type {?} */
|
|
24965
|
+
RichtexteditorComponent.prototype.dialogHeight;
|
|
24966
|
+
/** @type {?} */
|
|
24967
|
+
RichtexteditorComponent.prototype.showZoomBtn;
|
|
24968
|
+
/** @type {?} */
|
|
24969
|
+
RichtexteditorComponent.prototype.showMsg;
|
|
24970
|
+
/** @type {?} */
|
|
24971
|
+
RichtexteditorComponent.prototype.insertImageSettings;
|
|
24972
|
+
/** @type {?} */
|
|
24973
|
+
RichtexteditorComponent.prototype.editorManager;
|
|
24974
|
+
/** @type {?} */
|
|
24975
|
+
RichtexteditorComponent.prototype.size;
|
|
24976
|
+
/** @type {?} */
|
|
24977
|
+
RichtexteditorComponent.prototype.selectedQuery;
|
|
24978
|
+
/** @type {?} */
|
|
24979
|
+
RichtexteditorComponent.prototype.dropValIndex;
|
|
24980
|
+
/** @type {?} */
|
|
24981
|
+
RichtexteditorComponent.prototype.queryList;
|
|
24982
|
+
/** @type {?} */
|
|
24983
|
+
RichtexteditorComponent.prototype.rephraseTyleList;
|
|
24984
|
+
/** @type {?} */
|
|
24985
|
+
RichtexteditorComponent.prototype.languageList;
|
|
24986
|
+
/** @type {?} */
|
|
24987
|
+
RichtexteditorComponent.prototype.promptQuery;
|
|
24988
|
+
/** @type {?} */
|
|
24989
|
+
RichtexteditorComponent.prototype.isSentimentCheck;
|
|
24990
|
+
/** @type {?} */
|
|
24991
|
+
RichtexteditorComponent.prototype.subQuery;
|
|
24992
|
+
/** @type {?} */
|
|
24993
|
+
RichtexteditorComponent.prototype.translatelanguage;
|
|
24994
|
+
/** @type {?} */
|
|
24995
|
+
RichtexteditorComponent.prototype.chipValue;
|
|
24996
|
+
/** @type {?} */
|
|
24997
|
+
RichtexteditorComponent.prototype.apiResultData;
|
|
24998
|
+
/** @type {?} */
|
|
24999
|
+
RichtexteditorComponent.prototype.AIResult;
|
|
25000
|
+
/** @type {?} */
|
|
25001
|
+
RichtexteditorComponent.prototype.tools;
|
|
25002
|
+
/**
|
|
25003
|
+
* @type {?}
|
|
25004
|
+
* @private
|
|
25005
|
+
*/
|
|
25006
|
+
RichtexteditorComponent.prototype.ref;
|
|
25007
|
+
}
|
|
25008
|
+
|
|
23706
25009
|
/**
|
|
23707
25010
|
* @fileoverview added by tsickle
|
|
23708
25011
|
* Generated from: lib/raise-common-lib.module.ts
|
|
@@ -23729,6 +25032,7 @@
|
|
|
23729
25032
|
TagInputComponent,
|
|
23730
25033
|
RadioGroupComponent,
|
|
23731
25034
|
CheckboxGroupComponent,
|
|
25035
|
+
RichtexteditorComponent,
|
|
23732
25036
|
SwitchInputComponent,
|
|
23733
25037
|
EncryptedInputComponent,
|
|
23734
25038
|
SearchInputComponent,
|
|
@@ -23762,6 +25066,7 @@
|
|
|
23762
25066
|
ej2AngularButtons.CheckBoxModule,
|
|
23763
25067
|
ej2AngularButtons.RadioButtonModule,
|
|
23764
25068
|
ej2AngularButtons.ButtonModule,
|
|
25069
|
+
ej2AngularButtons.ChipListModule,
|
|
23765
25070
|
ej2AngularDiagrams.DiagramModule,
|
|
23766
25071
|
ej2AngularPopups.TooltipModule,
|
|
23767
25072
|
ej2AngularPopups.DialogModule,
|
|
@@ -23846,6 +25151,7 @@
|
|
|
23846
25151
|
ej2AngularButtons.CheckBoxModule,
|
|
23847
25152
|
ej2AngularButtons.RadioButtonModule,
|
|
23848
25153
|
ej2AngularButtons.ButtonModule,
|
|
25154
|
+
ej2AngularButtons.ChipListModule,
|
|
23849
25155
|
ej2AngularDiagrams.DiagramModule,
|
|
23850
25156
|
ej2AngularPopups.TooltipModule,
|
|
23851
25157
|
ej2AngularPopups.DialogModule,
|
|
@@ -23891,6 +25197,7 @@
|
|
|
23891
25197
|
TagInputComponent,
|
|
23892
25198
|
RadioGroupComponent,
|
|
23893
25199
|
CheckboxGroupComponent,
|
|
25200
|
+
RichtexteditorComponent,
|
|
23894
25201
|
SwitchInputComponent,
|
|
23895
25202
|
EncryptedInputComponent,
|
|
23896
25203
|
SearchInputComponent,
|
|
@@ -23953,9 +25260,10 @@
|
|
|
23953
25260
|
exports.TruncatedTextToggleComponent = TruncatedTextToggleComponent;
|
|
23954
25261
|
exports.filterShowSection = filterShowSection;
|
|
23955
25262
|
exports.ɵa = Debounce;
|
|
23956
|
-
exports.ɵb =
|
|
23957
|
-
exports.ɵc =
|
|
23958
|
-
exports.ɵd =
|
|
25263
|
+
exports.ɵb = RichtexteditorComponent;
|
|
25264
|
+
exports.ɵc = ConfirmSelectComponent;
|
|
25265
|
+
exports.ɵd = NewActionNotificationComponent;
|
|
25266
|
+
exports.ɵe = CommonDeleteComponent;
|
|
23959
25267
|
|
|
23960
25268
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
23961
25269
|
|