add: getText
compatibility.
add: `AssetSelector` and `TemplateSelector`. add: `popup-selector` style class. add: `ui.resolvePopup` function. add: `switch` in checkbox. add: `GridColumn.filterTemplate` supports. add: add `action` callback in `createIcon`. change: replace `setTimeout(..., 0)` with `requestAnimationFrame`. change: Popup result structure adjustment ({ result: any, popup: Popup }). change: complete add work order flow. change: reduce Popup title height. fix: Grid column sort in number.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Grid, GridColumn, createElement, setTooltip, createIcon, createCheckbox, createRadiobox, showAlert, showConfirm, Popup } from "../../ui";
|
||||
import { Grid, GridColumn, createElement, setTooltip, createIcon, createCheckbox, createRadiobox, showAlert, showConfirm, Popup, requestAnimationFrame } from "../../ui";
|
||||
import { r as lang, nullOrEmpty, formatUrl, escapeEmoji, isEmail, isPhone } from "../../utility";
|
||||
import { createBox, appendMedia, fileSupported, insertFile, getMessageSendTo, getMessageStatus, updateCustomerName, createHideMessageTitleButton, createHideMessageCommentTail } from "./lib";
|
||||
import { Contact, CustomerRecordContact } from "./contact";
|
||||
@@ -41,6 +41,8 @@ export default class CustomerCommunication {
|
||||
const getText = opt?.getText;
|
||||
if (typeof getText === 'function') {
|
||||
r = getText;
|
||||
} else if (typeof GetTextByKey === 'function') {
|
||||
r = GetTextByKey;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1015,11 +1017,11 @@ export default class CustomerCommunication {
|
||||
{ key: 'ok', text: r('P_WO_OK', 'OK') },
|
||||
{ key: 'cancel', text: r('P_WO_CANCEL', 'Cancel') }
|
||||
]
|
||||
).then(result => {
|
||||
if (result?.key === 'ok') {
|
||||
const isRecord = result.popup.container.querySelector('.radio-customer-record>input').checked;
|
||||
).then(r => {
|
||||
if (r.result === 'ok') {
|
||||
const isRecord = r.popup.container.querySelector('.radio-customer-record>input').checked;
|
||||
if (typeof option.onDelete === 'function') {
|
||||
option.onDelete(result.key, this, isRecord);
|
||||
option.onDelete(r.result, this, isRecord);
|
||||
}
|
||||
const index = grid.source.indexOf(this);
|
||||
if (index >= 0) {
|
||||
@@ -1075,10 +1077,10 @@ export default class CustomerCommunication {
|
||||
showConfirm(r('P_CU_REMOVECONTACT', 'Remove Contact'), r('P_CU_REMOVEFROMWORKORDER', 'You are removing {name} from work order.\n\nDo you want to Continue?').replace('{name}', this.Name), [
|
||||
{ key: 'continue', text: r('P_JS_CONTINUE', 'Continue') },
|
||||
{ key: 'cancel', text: r('P_WO_CANCEL', 'Cancel') }
|
||||
]).then(result => {
|
||||
if (result?.key === 'continue') {
|
||||
]).then(r => {
|
||||
if (r.result === 'continue') {
|
||||
if (typeof option.onDelete === 'function') {
|
||||
option.onDelete(result.key, this);
|
||||
option.onDelete(r.result, this);
|
||||
}
|
||||
const index = gridWo.source.indexOf(this);
|
||||
if (index >= 0) {
|
||||
@@ -1122,14 +1124,11 @@ export default class CustomerCommunication {
|
||||
{ key: 'skip', text: r('P_CUSTOMER_SKIPTHISSTEP', 'Skip This Step') }
|
||||
]
|
||||
).then(r => {
|
||||
if (r == null) {
|
||||
return;
|
||||
}
|
||||
if (r.key === 'add') {
|
||||
if (r.result === 'add') {
|
||||
if (typeof option.onAddCompany === 'function') {
|
||||
option.onAddCompany.call(this);
|
||||
}
|
||||
} else {
|
||||
} else if (r.key === 'skip') {
|
||||
editContacts();
|
||||
}
|
||||
});
|
||||
@@ -1328,6 +1327,6 @@ export default class CustomerCommunication {
|
||||
this._var.lastTop = this._var.message.scrollTop;
|
||||
}
|
||||
this._var.message.replaceChildren(...children);
|
||||
setTimeout(() => this._var.message.scrollTop = keep ? this._var.lastTop : this._var.message.scrollHeight, 0);
|
||||
requestAnimationFrame(() => this._var.message.scrollTop = keep ? this._var.lastTop : this._var.message.scrollHeight);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user