@flexem/fc-gui 3.0.0-alpha.127 → 3.0.0-alpha.129
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/@flexem/fc-gui.umd.js +1311 -1216
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +4 -4
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/config/history-data/history-data.model.d.ts +7 -1
- package/config/history-data/history-data.model.js +9 -1
- package/config/history-data/history-data.model.metadata.json +1 -1
- package/config/history-data/index.d.ts +1 -1
- package/config/history-data/index.js +1 -1
- package/config/history-data/index.metadata.json +1 -1
- package/elements/alarm/alarm-element.d.ts +1 -1
- package/elements/alarm/alarm-element.js +2 -1
- package/elements/historical-curve/historical-curve.element.d.ts +6 -1
- package/elements/historical-curve/historical-curve.element.js +99 -24
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/elements/numerical-display/numerical-display-element.js +8 -0
- package/package.json +1 -1
|
@@ -22260,10 +22260,18 @@ var history_data_store = __webpack_require__(254);
|
|
|
22260
22260
|
|
|
22261
22261
|
// CONCATENATED MODULE: ./.tmp/config/history-data/history-data.model.ts
|
|
22262
22262
|
class HistoryDataModel {
|
|
22263
|
-
constructor(error, isUnbind, values
|
|
22263
|
+
constructor(error, isUnbind, values, historyDataItems // 新增:多条目独立数据
|
|
22264
|
+
) {
|
|
22264
22265
|
this.error = error;
|
|
22265
22266
|
this.isUnbind = isUnbind;
|
|
22266
22267
|
this.values = values;
|
|
22268
|
+
this.historyDataItems = historyDataItems;
|
|
22269
|
+
}
|
|
22270
|
+
}
|
|
22271
|
+
class HistoryDataItemModel {
|
|
22272
|
+
constructor(itemName, rows) {
|
|
22273
|
+
this.itemName = itemName;
|
|
22274
|
+
this.rows = rows;
|
|
22267
22275
|
}
|
|
22268
22276
|
}
|
|
22269
22277
|
|
|
@@ -22350,14 +22358,15 @@ class GetAlarmsArgs {
|
|
|
22350
22358
|
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "g", function() { return GraphResult; });
|
|
22351
22359
|
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "i", function() { return GraphType; });
|
|
22352
22360
|
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "h", function() { return graph_store["GraphStore"]; });
|
|
22353
|
-
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "
|
|
22354
|
-
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "
|
|
22355
|
-
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "
|
|
22356
|
-
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "
|
|
22357
|
-
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "
|
|
22358
|
-
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "
|
|
22361
|
+
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "q", function() { return view_store["ViewStore"]; });
|
|
22362
|
+
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "p", function() { return view_model["a" /* ViewModel */]; });
|
|
22363
|
+
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "n", function() { return image_store["ImageStore"]; });
|
|
22364
|
+
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "l", function() { return history_data_store["HistoryDataStore"]; });
|
|
22365
|
+
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "k", function() { return HistoryDataModel; });
|
|
22366
|
+
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "j", function() { return HistoryDataItemModel; });
|
|
22367
|
+
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "m", function() { return HistoryDataValue; });
|
|
22359
22368
|
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "d", function() { return GetHistoryDataArgs; });
|
|
22360
|
-
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "
|
|
22369
|
+
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "o", function() { return variable_store["VariableStore"]; });
|
|
22361
22370
|
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "e", function() { return GetVariableNameArgs; });
|
|
22362
22371
|
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "a", function() { return alarm_store["AlarmsStore"]; });
|
|
22363
22372
|
/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "c", function() { return GetAlarmsArgs; });
|
|
@@ -33026,7 +33035,7 @@ class Guid {
|
|
|
33026
33035
|
/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
|
|
33027
33036
|
/* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53);
|
|
33028
33037
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24);
|
|
33029
|
-
/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
33038
|
+
/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(36);
|
|
33030
33039
|
/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */
|
|
33031
33040
|
|
|
33032
33041
|
|
|
@@ -35713,7 +35722,7 @@ class WriteCharacterModalArgs {
|
|
|
35713
35722
|
}
|
|
35714
35723
|
|
|
35715
35724
|
// EXTERNAL MODULE: ./.tmp/modal/write-character/write-character-modal.component.ts
|
|
35716
|
-
var write_character_modal_component = __webpack_require__(
|
|
35725
|
+
var write_character_modal_component = __webpack_require__(39);
|
|
35717
35726
|
|
|
35718
35727
|
// EXTERNAL MODULE: ./.tmp/utils/access-permission.service.ts + 1 modules
|
|
35719
35728
|
var access_permission_service = __webpack_require__(43);
|
|
@@ -37025,7 +37034,7 @@ class datetime_display_element_DatetimeDisplayElement extends conditional_displa
|
|
|
37025
37034
|
var d3 = __webpack_require__(18);
|
|
37026
37035
|
|
|
37027
37036
|
// EXTERNAL MODULE: ./node_modules/nvd3/build/nv.d3.js
|
|
37028
|
-
var nv_d3 = __webpack_require__(
|
|
37037
|
+
var nv_d3 = __webpack_require__(35);
|
|
37029
37038
|
|
|
37030
37039
|
// CONCATENATED MODULE: ./.tmp/config/history-data/historical-curve.time-range.ts
|
|
37031
37040
|
var HistoricalCurveTimeRange;
|
|
@@ -37122,7 +37131,6 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
37122
37131
|
};
|
|
37123
37132
|
this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
|
|
37124
37133
|
this.localization = injector.get(_tmp_localization["b" /* LOCALIZATION */]);
|
|
37125
|
-
this.timePeriods = this.getValidTimePeriods();
|
|
37126
37134
|
this.updateTimeRange(this.model.displaySetting.displayTimePeriod);
|
|
37127
37135
|
this.refreshIntervalId = setInterval(() => {
|
|
37128
37136
|
this.loadFirstPage();
|
|
@@ -37189,6 +37197,7 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
37189
37197
|
if (!selectElement.empty()) {
|
|
37190
37198
|
// 重新生成时间段数据
|
|
37191
37199
|
const updatedTimePeriods = this.getValidTimePeriods();
|
|
37200
|
+
this.timePeriods = updatedTimePeriods;
|
|
37192
37201
|
// 更新选项文本
|
|
37193
37202
|
const options = selectElement.selectAll('option');
|
|
37194
37203
|
options.each(function (_d, i) {
|
|
@@ -37313,7 +37322,51 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
37313
37322
|
}
|
|
37314
37323
|
}
|
|
37315
37324
|
handleQueryResult(result) {
|
|
37316
|
-
|
|
37325
|
+
this.timePeriods = this.getValidTimePeriods();
|
|
37326
|
+
// 【新格式】多条目模式下的错误处理
|
|
37327
|
+
if (result.historyDataItems && result.historyDataItems.length > 0) {
|
|
37328
|
+
// 只要有条目正常返回(即使没有数据),就走正常逻辑
|
|
37329
|
+
// 这样可以确保即使部分条目失败,只要有条目成功返回,就显示正常状态
|
|
37330
|
+
this.clearStatus();
|
|
37331
|
+
if (result.isUnbind) {
|
|
37332
|
+
this.updateElementStatus(HistoricalCurveElementStatus.Unbound);
|
|
37333
|
+
}
|
|
37334
|
+
else {
|
|
37335
|
+
this.updateElementStatus(HistoricalCurveElementStatus.Normal);
|
|
37336
|
+
}
|
|
37337
|
+
// 如果有错误信息,在控制台输出警告
|
|
37338
|
+
if (result.error) {
|
|
37339
|
+
this.logger.warn(`[历史曲线] 部分条目查询失败: ${result.error}`);
|
|
37340
|
+
}
|
|
37341
|
+
// 检查是否有任何条目有数据
|
|
37342
|
+
const hasAnyData = result.historyDataItems.some(item => item.rows && item.rows.length > 0);
|
|
37343
|
+
if (hasAnyData) {
|
|
37344
|
+
// 有数据,计算所有条目的最小和最大时间,确保时间轴覆盖所有数据
|
|
37345
|
+
let globalMinTime = null;
|
|
37346
|
+
let globalMaxTime = null;
|
|
37347
|
+
result.historyDataItems.forEach(item => {
|
|
37348
|
+
if (item.rows && item.rows.length > 0) {
|
|
37349
|
+
const itemMinTime = moment(Object(lodash["first"])(item.rows).time);
|
|
37350
|
+
const itemMaxTime = moment(Object(lodash["last"])(item.rows).time);
|
|
37351
|
+
if (!globalMinTime || itemMinTime.isBefore(globalMinTime)) {
|
|
37352
|
+
globalMinTime = itemMinTime;
|
|
37353
|
+
}
|
|
37354
|
+
if (!globalMaxTime || itemMaxTime.isAfter(globalMaxTime)) {
|
|
37355
|
+
globalMaxTime = itemMaxTime;
|
|
37356
|
+
}
|
|
37357
|
+
}
|
|
37358
|
+
});
|
|
37359
|
+
// 设置全局时间范围
|
|
37360
|
+
if (globalMinTime && globalMaxTime) {
|
|
37361
|
+
this.currentStartTime = globalMinTime;
|
|
37362
|
+
this.currentEndTime = globalMaxTime;
|
|
37363
|
+
}
|
|
37364
|
+
}
|
|
37365
|
+
// 无论是否有数据,都渲染曲线(没有数据会显示空曲线)
|
|
37366
|
+
this.chartElement = this.renderChartWithMultiItems(result.historyDataItems);
|
|
37367
|
+
}
|
|
37368
|
+
// 【旧格式】单条目模式的错误处理
|
|
37369
|
+
else if (result.error) {
|
|
37317
37370
|
this.updateElementStatus(HistoricalCurveElementStatus.LoadFailed, result.error);
|
|
37318
37371
|
}
|
|
37319
37372
|
else {
|
|
@@ -37324,6 +37377,7 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
37324
37377
|
else {
|
|
37325
37378
|
this.updateElementStatus(HistoricalCurveElementStatus.Normal);
|
|
37326
37379
|
}
|
|
37380
|
+
// 【旧格式】单条目数据,使用原有渲染方式
|
|
37327
37381
|
if (result.values.length) {
|
|
37328
37382
|
this.currentStartTime = moment(Object(lodash["first"])(result.values).time);
|
|
37329
37383
|
this.currentEndTime = moment(Object(lodash["last"])(result.values).time);
|
|
@@ -37357,31 +37411,61 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
37357
37411
|
const chartWidth = this.model.displaySetting.size.width;
|
|
37358
37412
|
const chartHeight = this.model.displaySetting.size.height - this.displayOption.operationAreaHeight - this.displayOption.operationAreaMarginTop;
|
|
37359
37413
|
const data = new Array();
|
|
37360
|
-
//
|
|
37361
|
-
|
|
37362
|
-
|
|
37363
|
-
Object(lodash["each"])(
|
|
37364
|
-
|
|
37365
|
-
|
|
37366
|
-
|
|
37367
|
-
|
|
37368
|
-
|
|
37369
|
-
|
|
37370
|
-
|
|
37371
|
-
|
|
37372
|
-
}
|
|
37373
|
-
|
|
37374
|
-
|
|
37375
|
-
|
|
37376
|
-
|
|
37377
|
-
|
|
37414
|
+
// 【旧格式】单条目模式:只显示通道名
|
|
37415
|
+
Object(lodash["each"])(this.model.dataSetting.channels, (channel, key) => {
|
|
37416
|
+
const values = new Array();
|
|
37417
|
+
Object(lodash["each"])(result, v => values.push({ x: moment(v.time).local().toDate().valueOf(), y: v.values[key] }));
|
|
37418
|
+
const displayName = channel.name;
|
|
37419
|
+
data.push({ key: displayName, area: channel.projectEnabled, values: values });
|
|
37420
|
+
});
|
|
37421
|
+
this.data = data;
|
|
37422
|
+
nv_d3["addGraph"](() => {
|
|
37423
|
+
let chart;
|
|
37424
|
+
if (this.model.displaySetting.curveType === CurveType.BarGroup || this.model.displaySetting.curveType === CurveType.BarStack) {
|
|
37425
|
+
chart = this.getMultiBarWithFocusChart(chartWidth, chartHeight, data);
|
|
37426
|
+
}
|
|
37427
|
+
else {
|
|
37428
|
+
chart = this.getLineChart(chartWidth, chartHeight, data);
|
|
37429
|
+
}
|
|
37430
|
+
// 设置 tooltip 自动隐藏逻辑
|
|
37431
|
+
this.setupTooltipAutoHide(chart);
|
|
37432
|
+
return chart;
|
|
37433
|
+
});
|
|
37434
|
+
}
|
|
37435
|
+
/**
|
|
37436
|
+
* 【新格式】多条目独立数据的曲线渲染
|
|
37437
|
+
* 每个条目独立保持自己的时间戳,不会出现时间戳混乱的问题
|
|
37438
|
+
*/
|
|
37439
|
+
renderChartWithMultiItems(historyDataItems) {
|
|
37440
|
+
const chartWidth = this.model.displaySetting.size.width;
|
|
37441
|
+
const chartHeight = this.model.displaySetting.size.height - this.displayOption.operationAreaHeight - this.displayOption.operationAreaMarginTop;
|
|
37442
|
+
const data = new Array();
|
|
37443
|
+
// 创建一个 Map 用于快速查找条目数据
|
|
37444
|
+
const itemDataMap = new Map();
|
|
37445
|
+
Object(lodash["each"])(historyDataItems, item => {
|
|
37446
|
+
if (item && item.itemName) {
|
|
37447
|
+
itemDataMap.set(item.itemName, item.rows || []);
|
|
37448
|
+
}
|
|
37449
|
+
});
|
|
37450
|
+
// 判断是否只有一个条目
|
|
37451
|
+
const isSingleItem = this.model.dataSetting.dataItems && this.model.dataSetting.dataItems.length === 1;
|
|
37452
|
+
// 为每个条目的每个通道创建独立的曲线
|
|
37453
|
+
Object(lodash["each"])(this.model.dataSetting.dataItems, (dataItem) => {
|
|
37454
|
+
const itemName = dataItem.dataName;
|
|
37455
|
+
// 通过 itemName 匹配数据,而不是通过索引
|
|
37456
|
+
const itemRows = itemDataMap.get(itemName) || [];
|
|
37457
|
+
Object(lodash["each"])(dataItem.channels, (channel, channelIdx) => {
|
|
37378
37458
|
const values = new Array();
|
|
37379
|
-
|
|
37380
|
-
|
|
37381
|
-
|
|
37459
|
+
// 每个条目使用自己的时间戳和数据
|
|
37460
|
+
Object(lodash["each"])(itemRows, row => {
|
|
37461
|
+
const value = row.values && row.values[channelIdx] !== undefined ? row.values[channelIdx] : null;
|
|
37462
|
+
values.push({ x: moment(row.time).local().toDate().valueOf(), y: value });
|
|
37463
|
+
});
|
|
37464
|
+
// 只有多个条目时才使用"条目名-通道名"格式,单条目时只显示通道名
|
|
37465
|
+
const displayName = isSingleItem ? channel.name : `${itemName}-${channel.name}`;
|
|
37382
37466
|
data.push({ key: displayName, area: channel.projectEnabled, values: values });
|
|
37383
37467
|
});
|
|
37384
|
-
}
|
|
37468
|
+
});
|
|
37385
37469
|
this.data = data;
|
|
37386
37470
|
nv_d3["addGraph"](() => {
|
|
37387
37471
|
let chart;
|
|
@@ -37987,7 +38071,7 @@ class WriteValueModalArgs {
|
|
|
37987
38071
|
}
|
|
37988
38072
|
|
|
37989
38073
|
// EXTERNAL MODULE: ./.tmp/modal/write-value/write-value-modal.component.ts
|
|
37990
|
-
var write_value_modal_component = __webpack_require__(
|
|
38074
|
+
var write_value_modal_component = __webpack_require__(38);
|
|
37991
38075
|
|
|
37992
38076
|
// EXTERNAL MODULE: ./.tmp/model/shared/data-type/fcloud-data-Type.ts
|
|
37993
38077
|
var fcloud_data_Type = __webpack_require__(6);
|
|
@@ -38208,6 +38292,14 @@ class numerical_display_element_NumericalDisplayElement extends readable_element
|
|
|
38208
38292
|
this.recordValue = result.value;
|
|
38209
38293
|
const writeValue = this.dataTypeService.formatToDecimal(this.model.version, result.value, this.model.dataType);
|
|
38210
38294
|
this.showValue = result.showValue;
|
|
38295
|
+
// 如果是系统变量"当前语种ID",只更新显示,不执行变量写入和操作记录
|
|
38296
|
+
if (this.writeVariableName === '当前语种ID') {
|
|
38297
|
+
// 直接更新显示值
|
|
38298
|
+
this.displayText = this.showValue;
|
|
38299
|
+
this.updateDisplayText(this.formatDisplayTextUnit(this.displayText));
|
|
38300
|
+
this.writeValueMmodalRef.hide();
|
|
38301
|
+
return;
|
|
38302
|
+
}
|
|
38211
38303
|
if (this.displayText !== this.showValue || result.variableRwType === variableRwTypeEnum.witer) {
|
|
38212
38304
|
if (this.numericalOperation || result.enableNumericalOperation || result.isNumericalOperation || result.variableRwType === variableRwTypeEnum.witer) {
|
|
38213
38305
|
this.recordOperation(result.value);
|
|
@@ -41652,7 +41744,6 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
|
|
|
41652
41744
|
this.setStatusAsLoading();
|
|
41653
41745
|
this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
|
|
41654
41746
|
this.variableCommunicator = variableCommunicator;
|
|
41655
|
-
this.timePeriods = this.getValidTimePeriods();
|
|
41656
41747
|
this.pageSize = this.model.generalSetting.pageSize;
|
|
41657
41748
|
localStorage.setItem('simulate-time', moment().valueOf() + '');
|
|
41658
41749
|
// 订阅语种变化事件
|
|
@@ -41724,6 +41815,7 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
|
|
|
41724
41815
|
if (!selectElement.empty()) {
|
|
41725
41816
|
// 重新生成时间段数据
|
|
41726
41817
|
const updatedTimePeriods = this.getValidTimePeriods();
|
|
41818
|
+
this.timePeriods = updatedTimePeriods;
|
|
41727
41819
|
// 更新选项文本
|
|
41728
41820
|
const options = selectElement.selectAll('option');
|
|
41729
41821
|
options.each(function (_d, i) {
|
|
@@ -41814,6 +41906,7 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
|
|
|
41814
41906
|
this.setStatusAsLoading();
|
|
41815
41907
|
clearTimeout(this.getAlarmDataId);
|
|
41816
41908
|
this.getAlarmDataId = setTimeout(() => {
|
|
41909
|
+
this.timePeriods = this.getValidTimePeriods();
|
|
41817
41910
|
if (this.model.filterSetting.alarmType) {
|
|
41818
41911
|
this.updateQueryTimeRange();
|
|
41819
41912
|
const input = new _tmp_config["c" /* GetAlarmsArgs */](this.alarmNames, this.startTime, this.endTime, this.pageSize, this.page * this.pageSize);
|
|
@@ -43349,1030 +43442,233 @@ var ConditionType;
|
|
|
43349
43442
|
|
|
43350
43443
|
/***/ }),
|
|
43351
43444
|
/* 35 */
|
|
43352
|
-
/***/ (function(module,
|
|
43353
|
-
|
|
43354
|
-
"use strict";
|
|
43355
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hostReportError; });
|
|
43356
|
-
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
43357
|
-
function hostReportError(err) {
|
|
43358
|
-
setTimeout(function () { throw err; }, 0);
|
|
43359
|
-
}
|
|
43360
|
-
//# sourceMappingURL=hostReportError.js.map
|
|
43361
|
-
|
|
43362
|
-
|
|
43363
|
-
/***/ }),
|
|
43364
|
-
/* 36 */
|
|
43365
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
43366
|
-
|
|
43367
|
-
"use strict";
|
|
43368
|
-
|
|
43369
|
-
// EXTERNAL MODULE: external "@angular/core"
|
|
43370
|
-
var core_ = __webpack_require__(0);
|
|
43371
|
-
|
|
43372
|
-
// EXTERNAL MODULE: ./node_modules/lodash/lodash.js
|
|
43373
|
-
var lodash = __webpack_require__(2);
|
|
43374
|
-
|
|
43375
|
-
// EXTERNAL MODULE: ./.tmp/localization/index.ts + 1 modules
|
|
43376
|
-
var _tmp_localization = __webpack_require__(9);
|
|
43377
|
-
|
|
43378
|
-
// EXTERNAL MODULE: ./.tmp/settings/index.ts + 2 modules
|
|
43379
|
-
var settings = __webpack_require__(16);
|
|
43380
|
-
|
|
43381
|
-
// EXTERNAL MODULE: ./.tmp/logger/index.ts + 2 modules
|
|
43382
|
-
var logger = __webpack_require__(7);
|
|
43383
|
-
|
|
43384
|
-
// EXTERNAL MODULE: ./.tmp/shared/index.ts + 3 modules
|
|
43385
|
-
var shared = __webpack_require__(5);
|
|
43386
|
-
|
|
43387
|
-
// EXTERNAL MODULE: ./.tmp/view/view.service.ts
|
|
43388
|
-
var view_service = __webpack_require__(27);
|
|
43389
|
-
|
|
43390
|
-
// EXTERNAL MODULE: ./.tmp/gui/gui-view.ts + 126 modules
|
|
43391
|
-
var gui_view = __webpack_require__(32);
|
|
43392
|
-
|
|
43393
|
-
// EXTERNAL MODULE: external "rxjs/operators"
|
|
43394
|
-
var operators_ = __webpack_require__(17);
|
|
43445
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
43395
43446
|
|
|
43396
|
-
|
|
43447
|
+
/* nvd3 version 1.8.6-dev (https://github.com/flexem/nvd3) 2018-08-22 */
|
|
43448
|
+
(function(){
|
|
43397
43449
|
|
|
43450
|
+
// set up main nv object
|
|
43451
|
+
var nv = {};
|
|
43398
43452
|
|
|
43453
|
+
// the major global objects under the nv namespace
|
|
43454
|
+
nv.dev = false; //set false when in production
|
|
43455
|
+
nv.tooltip = nv.tooltip || {}; // For the tooltip system
|
|
43456
|
+
nv.utils = nv.utils || {}; // Utility subsystem
|
|
43457
|
+
nv.models = nv.models || {}; //stores all the possible models/components
|
|
43458
|
+
nv.charts = {}; //stores all the ready to use charts
|
|
43459
|
+
nv.logs = {}; //stores some statistics and potential error messages
|
|
43460
|
+
nv.dom = {}; //DOM manipulation functions
|
|
43399
43461
|
|
|
43462
|
+
// Node/CommonJS - require D3
|
|
43463
|
+
if (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined' && typeof(d3) == 'undefined') {
|
|
43464
|
+
d3 = __webpack_require__(18);
|
|
43465
|
+
}
|
|
43400
43466
|
|
|
43467
|
+
nv.dispatch = d3.dispatch('render_start', 'render_end');
|
|
43401
43468
|
|
|
43402
|
-
|
|
43403
|
-
|
|
43404
|
-
|
|
43405
|
-
|
|
43406
|
-
|
|
43407
|
-
|
|
43408
|
-
|
|
43409
|
-
this
|
|
43410
|
-
|
|
43411
|
-
|
|
43412
|
-
return this.context.configStore.viewStore.getViewConfig(viewIndex).pipe(Object(operators_["map"])(config => {
|
|
43413
|
-
if (this.currentViewIndex !== viewIndex) {
|
|
43414
|
-
return;
|
|
43415
|
-
}
|
|
43416
|
-
if (!config || !config.config || !config.config.length) {
|
|
43417
|
-
throw new shared["a" /* ConfigIsEmptyError */]();
|
|
43418
|
-
}
|
|
43419
|
-
if (this.currentView) {
|
|
43420
|
-
this.currentView.dispose();
|
|
43421
|
-
}
|
|
43422
|
-
this.currentView = new gui_view["a" /* GuiView */](this.injector, this.bsModalService, this.context);
|
|
43423
|
-
const hostGuiOptions = {
|
|
43424
|
-
svgRootClass: this.guiOptions.svgRootClass,
|
|
43425
|
-
hostContainerId: parentContainerId,
|
|
43426
|
-
el: baseEl
|
|
43427
|
-
};
|
|
43428
|
-
this.currentView.load(config, hostGuiOptions);
|
|
43429
|
-
this.currentView.resize(this.currentViewSize, this.currentViewReiszeMode, this.guiOptions.svgRootClass);
|
|
43430
|
-
this.containerEl = $(baseEl.nativeElement).find(`div#${parentContainerId}`).first();
|
|
43431
|
-
this.containerEl.empty();
|
|
43432
|
-
this.containerEl.append(this.currentView.element);
|
|
43433
|
-
this.logger.debug(`[GUI] Toggle View(${viewIndex}) successed.`);
|
|
43434
|
-
}));
|
|
43435
|
-
};
|
|
43436
|
-
injector.get(view_service["a" /* ViewService */]).toggleViews.set(el, toggleViewFunc);
|
|
43437
|
-
}
|
|
43438
|
-
get element() {
|
|
43439
|
-
if (this.containerEl) {
|
|
43440
|
-
return this.containerEl[0];
|
|
43441
|
-
}
|
|
43442
|
-
else {
|
|
43443
|
-
throw new Error('Gui Host not loaded yet.');
|
|
43444
|
-
}
|
|
43445
|
-
}
|
|
43446
|
-
/**
|
|
43447
|
-
* Load gui host and main view.
|
|
43448
|
-
*/
|
|
43449
|
-
load(configureViewId) {
|
|
43450
|
-
if (this.isLoaded) {
|
|
43451
|
-
throw new Error('The GuiHost already loaded.');
|
|
43452
|
-
}
|
|
43453
|
-
this.isLoaded = true;
|
|
43454
|
-
this.containerEl = $(`<div class="svg-content" id= "${this.guiOptions.hostContainerId}" style="display:flex;position:relative;"></div>`);
|
|
43455
|
-
const result = new Promise((resolve, reject) => {
|
|
43456
|
-
if (configureViewId && configureViewId !== 0) {
|
|
43457
|
-
this.loadViewConfigByConfigureViewId(resolve, reject, configureViewId);
|
|
43458
|
-
}
|
|
43459
|
-
else {
|
|
43460
|
-
this.loadMainViewConfig(resolve, reject);
|
|
43461
|
-
}
|
|
43462
|
-
});
|
|
43463
|
-
return result;
|
|
43464
|
-
}
|
|
43465
|
-
loadByConfigureViewCode(configureViewCode) {
|
|
43466
|
-
if (this.isLoaded) {
|
|
43467
|
-
throw new Error('The GuiHost already loaded.');
|
|
43469
|
+
// Function bind polyfill
|
|
43470
|
+
// Needed ONLY for phantomJS as it's missing until version 2.0 which is unreleased as of this comment
|
|
43471
|
+
// https://github.com/ariya/phantomjs/issues/10522
|
|
43472
|
+
// http://kangax.github.io/compat-table/es5/#Function.prototype.bind
|
|
43473
|
+
// phantomJS is used for running the test suite
|
|
43474
|
+
if (!Function.prototype.bind) {
|
|
43475
|
+
Function.prototype.bind = function (oThis) {
|
|
43476
|
+
if (typeof this !== "function") {
|
|
43477
|
+
// closest thing possible to the ECMAScript 5 internal IsCallable function
|
|
43478
|
+
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
|
|
43468
43479
|
}
|
|
43469
|
-
|
|
43470
|
-
|
|
43471
|
-
|
|
43472
|
-
|
|
43473
|
-
|
|
43474
|
-
|
|
43475
|
-
|
|
43476
|
-
|
|
43477
|
-
|
|
43478
|
-
|
|
43479
|
-
|
|
43480
|
-
|
|
43481
|
-
|
|
43482
|
-
|
|
43483
|
-
|
|
43484
|
-
|
|
43485
|
-
|
|
43486
|
-
|
|
43487
|
-
|
|
43488
|
-
|
|
43489
|
-
|
|
43490
|
-
|
|
43491
|
-
|
|
43492
|
-
|
|
43493
|
-
|
|
43494
|
-
|
|
43495
|
-
|
|
43496
|
-
|
|
43497
|
-
|
|
43498
|
-
|
|
43499
|
-
|
|
43500
|
-
|
|
43501
|
-
|
|
43502
|
-
|
|
43503
|
-
|
|
43504
|
-
|
|
43505
|
-
|
|
43506
|
-
|
|
43507
|
-
|
|
43508
|
-
|
|
43509
|
-
this.handleViewConfigCallback(resolve, reject, config);
|
|
43510
|
-
}, error => {
|
|
43511
|
-
this.logger.error('[GUI] Load failed: ' + error.stack);
|
|
43512
|
-
reject(error);
|
|
43513
|
-
});
|
|
43480
|
+
|
|
43481
|
+
var aArgs = Array.prototype.slice.call(arguments, 1),
|
|
43482
|
+
fToBind = this,
|
|
43483
|
+
fNOP = function () {},
|
|
43484
|
+
fBound = function () {
|
|
43485
|
+
return fToBind.apply(this instanceof fNOP && oThis
|
|
43486
|
+
? this
|
|
43487
|
+
: oThis,
|
|
43488
|
+
aArgs.concat(Array.prototype.slice.call(arguments)));
|
|
43489
|
+
};
|
|
43490
|
+
|
|
43491
|
+
fNOP.prototype = this.prototype;
|
|
43492
|
+
fBound.prototype = new fNOP();
|
|
43493
|
+
return fBound;
|
|
43494
|
+
};
|
|
43495
|
+
}
|
|
43496
|
+
|
|
43497
|
+
// Development render timers - disabled if dev = false
|
|
43498
|
+
if (nv.dev) {
|
|
43499
|
+
nv.dispatch.on('render_start', function(e) {
|
|
43500
|
+
nv.logs.startTime = +new Date();
|
|
43501
|
+
});
|
|
43502
|
+
|
|
43503
|
+
nv.dispatch.on('render_end', function(e) {
|
|
43504
|
+
nv.logs.endTime = +new Date();
|
|
43505
|
+
nv.logs.totalTime = nv.logs.endTime - nv.logs.startTime;
|
|
43506
|
+
nv.log('total', nv.logs.totalTime); // used for development, to keep track of graph generation times
|
|
43507
|
+
});
|
|
43508
|
+
}
|
|
43509
|
+
|
|
43510
|
+
// Logs all arguments, and returns the last so you can test things in place
|
|
43511
|
+
// Note: in IE8 console.log is an object not a function, and if modernizr is used
|
|
43512
|
+
// then calling Function.prototype.bind with with anything other than a function
|
|
43513
|
+
// causes a TypeError to be thrown.
|
|
43514
|
+
nv.log = function() {
|
|
43515
|
+
if (nv.dev && window.console && console.log && console.log.apply)
|
|
43516
|
+
console.log.apply(console, arguments);
|
|
43517
|
+
else if (nv.dev && window.console && typeof console.log == "function" && Function.prototype.bind) {
|
|
43518
|
+
var log = Function.prototype.bind.call(console.log, console);
|
|
43519
|
+
log.apply(console, arguments);
|
|
43514
43520
|
}
|
|
43515
|
-
|
|
43516
|
-
|
|
43517
|
-
|
|
43518
|
-
|
|
43519
|
-
|
|
43520
|
-
|
|
43521
|
-
|
|
43522
|
-
this.containerEl.append(this.currentView.element);
|
|
43523
|
-
resolve(this);
|
|
43524
|
-
this.logger.debug('[GUI] Host loaded.');
|
|
43521
|
+
return arguments[arguments.length - 1];
|
|
43522
|
+
};
|
|
43523
|
+
|
|
43524
|
+
// print console warning, should be used by deprecated functions
|
|
43525
|
+
nv.deprecated = function(name, info) {
|
|
43526
|
+
if (console && console.warn) {
|
|
43527
|
+
console.warn('nvd3 warning: `' + name + '` has been deprecated. ', info || '');
|
|
43525
43528
|
}
|
|
43526
|
-
|
|
43527
|
-
|
|
43528
|
-
|
|
43529
|
-
|
|
43530
|
-
|
|
43531
|
-
|
|
43532
|
-
|
|
43533
|
-
|
|
43534
|
-
|
|
43535
|
-
|
|
43529
|
+
};
|
|
43530
|
+
|
|
43531
|
+
// The nv.render function is used to queue up chart rendering
|
|
43532
|
+
// in non-blocking async functions.
|
|
43533
|
+
// When all queued charts are done rendering, nv.dispatch.render_end is invoked.
|
|
43534
|
+
nv.render = function render(step) {
|
|
43535
|
+
// number of graphs to generate in each timeout loop
|
|
43536
|
+
step = step || 1;
|
|
43537
|
+
|
|
43538
|
+
nv.render.active = true;
|
|
43539
|
+
nv.dispatch.render_start();
|
|
43540
|
+
|
|
43541
|
+
var renderLoop = function() {
|
|
43542
|
+
var chart, graph;
|
|
43543
|
+
|
|
43544
|
+
for (var i = 0; i < step && (graph = nv.render.queue[i]); i++) {
|
|
43545
|
+
chart = graph.generate();
|
|
43546
|
+
if (typeof graph.callback == typeof(Function)) graph.callback(chart);
|
|
43536
43547
|
}
|
|
43537
|
-
|
|
43538
|
-
|
|
43539
|
-
|
|
43540
|
-
|
|
43541
|
-
|
|
43542
|
-
updateViewSize(size) {
|
|
43543
|
-
if (!this.currentView) {
|
|
43544
|
-
return;
|
|
43548
|
+
|
|
43549
|
+
nv.render.queue.splice(0, i);
|
|
43550
|
+
|
|
43551
|
+
if (nv.render.queue.length) {
|
|
43552
|
+
setTimeout(renderLoop);
|
|
43545
43553
|
}
|
|
43546
|
-
|
|
43547
|
-
|
|
43548
|
-
|
|
43549
|
-
/**
|
|
43550
|
-
* Resize current view
|
|
43551
|
-
* @param size : target view size
|
|
43552
|
-
* @param resizeMode : target resize mode
|
|
43553
|
-
*/
|
|
43554
|
-
updateViewResizeMode(resizeMode) {
|
|
43555
|
-
if (this.currentView) {
|
|
43556
|
-
this.currentView.resize(this.currentViewSize, resizeMode, this.guiOptions.svgRootClass);
|
|
43557
|
-
this.currentViewReiszeMode = resizeMode;
|
|
43554
|
+
else {
|
|
43555
|
+
nv.dispatch.render_end();
|
|
43556
|
+
nv.render.active = false;
|
|
43558
43557
|
}
|
|
43558
|
+
};
|
|
43559
|
+
|
|
43560
|
+
setTimeout(renderLoop);
|
|
43561
|
+
};
|
|
43562
|
+
|
|
43563
|
+
nv.render.active = false;
|
|
43564
|
+
nv.render.queue = [];
|
|
43565
|
+
|
|
43566
|
+
/*
|
|
43567
|
+
Adds a chart to the async rendering queue. This method can take arguments in two forms:
|
|
43568
|
+
nv.addGraph({
|
|
43569
|
+
generate: <Function>
|
|
43570
|
+
callback: <Function>
|
|
43571
|
+
})
|
|
43572
|
+
|
|
43573
|
+
or
|
|
43574
|
+
|
|
43575
|
+
nv.addGraph(<generate Function>, <callback Function>)
|
|
43576
|
+
|
|
43577
|
+
The generate function should contain code that creates the NVD3 model, sets options
|
|
43578
|
+
on it, adds data to an SVG element, and invokes the chart model. The generate function
|
|
43579
|
+
should return the chart model. See examples/lineChart.html for a usage example.
|
|
43580
|
+
|
|
43581
|
+
The callback function is optional, and it is called when the generate function completes.
|
|
43582
|
+
*/
|
|
43583
|
+
nv.addGraph = function(obj) {
|
|
43584
|
+
if (typeof arguments[0] === typeof(Function)) {
|
|
43585
|
+
obj = {generate: arguments[0], callback: arguments[1]};
|
|
43559
43586
|
}
|
|
43560
|
-
|
|
43561
|
-
|
|
43562
|
-
|
|
43563
|
-
|
|
43564
|
-
|
|
43565
|
-
this.context.dispose();
|
|
43566
|
-
}
|
|
43567
|
-
this.logger.debug('[GUI] GuiHost disposed.');
|
|
43587
|
+
|
|
43588
|
+
nv.render.queue.push(obj);
|
|
43589
|
+
|
|
43590
|
+
if (!nv.render.active) {
|
|
43591
|
+
nv.render();
|
|
43568
43592
|
}
|
|
43593
|
+
};
|
|
43594
|
+
|
|
43595
|
+
// Node/CommonJS exports
|
|
43596
|
+
if (true) {
|
|
43597
|
+
module.exports = nv;
|
|
43569
43598
|
}
|
|
43570
|
-
|
|
43571
|
-
|
|
43572
|
-
|
|
43573
|
-
|
|
43574
|
-
|
|
43575
|
-
|
|
43576
|
-
|
|
43577
|
-
|
|
43578
|
-
|
|
43579
|
-
|
|
43580
|
-
|
|
43599
|
+
|
|
43600
|
+
if (typeof(window) !== 'undefined') {
|
|
43601
|
+
window.nv = nv;
|
|
43602
|
+
}
|
|
43603
|
+
/* Facade for queueing DOM write operations
|
|
43604
|
+
* with Fastdom (https://github.com/wilsonpage/fastdom)
|
|
43605
|
+
* if available.
|
|
43606
|
+
* This could easily be extended to support alternate
|
|
43607
|
+
* implementations in the future.
|
|
43608
|
+
*/
|
|
43609
|
+
nv.dom.write = function(callback) {
|
|
43610
|
+
if (window.fastdom !== undefined) {
|
|
43611
|
+
return fastdom.mutate(callback);
|
|
43612
|
+
}
|
|
43613
|
+
return callback();
|
|
43581
43614
|
};
|
|
43582
|
-
|
|
43583
|
-
|
|
43615
|
+
|
|
43616
|
+
/* Facade for queueing DOM read operations
|
|
43617
|
+
* with Fastdom (https://github.com/wilsonpage/fastdom)
|
|
43618
|
+
* if available.
|
|
43619
|
+
* This could easily be extended to support alternate
|
|
43620
|
+
* implementations in the future.
|
|
43621
|
+
*/
|
|
43622
|
+
nv.dom.read = function(callback) {
|
|
43623
|
+
if (window.fastdom !== undefined) {
|
|
43624
|
+
return fastdom.measure(callback);
|
|
43625
|
+
}
|
|
43626
|
+
return callback();
|
|
43584
43627
|
};
|
|
43628
|
+
/* Utility class to handle creation of an interactive layer.
|
|
43629
|
+
This places a rectangle on top of the chart. When you mouse move over it, it sends a dispatch
|
|
43630
|
+
containing the X-coordinate. It can also render a vertical line where the mouse is located.
|
|
43585
43631
|
|
|
43632
|
+
dispatch.elementMousemove is the important event to latch onto. It is fired whenever the mouse moves over
|
|
43633
|
+
the rectangle. The dispatch is given one object which contains the mouseX/Y location.
|
|
43634
|
+
It also has 'pointXValue', which is the conversion of mouseX to the x-axis scale.
|
|
43635
|
+
*/
|
|
43636
|
+
nv.interactiveGuideline = function() {
|
|
43637
|
+
"use strict";
|
|
43586
43638
|
|
|
43639
|
+
var margin = { left: 0, top: 0 } //Pass the chart's top and left magins. Used to calculate the mouseX/Y.
|
|
43640
|
+
, width = null
|
|
43641
|
+
, height = null
|
|
43642
|
+
, xScale = d3.scale.linear()
|
|
43643
|
+
, dispatch = d3.dispatch('elementMousemove', 'elementMouseout', 'elementClick', 'elementDblclick', 'elementMouseDown', 'elementMouseUp')
|
|
43644
|
+
, showGuideLine = true
|
|
43645
|
+
, svgContainer = null // Must pass the chart's svg, we'll use its mousemove event.
|
|
43646
|
+
, tooltip = nv.models.tooltip()
|
|
43647
|
+
, isMSIE = window.ActiveXObject// Checkt if IE by looking for activeX. (excludes IE11)
|
|
43648
|
+
;
|
|
43587
43649
|
|
|
43650
|
+
tooltip
|
|
43651
|
+
.duration(0)
|
|
43652
|
+
.hideDelay(0)
|
|
43653
|
+
.hidden(false);
|
|
43588
43654
|
|
|
43655
|
+
function layer(selection) {
|
|
43656
|
+
selection.each(function(data) {
|
|
43657
|
+
var container = d3.select(this);
|
|
43658
|
+
var availableWidth = (width || 960), availableHeight = (height || 400);
|
|
43659
|
+
var wrap = container.selectAll("g.nv-wrap.nv-interactiveLineLayer")
|
|
43660
|
+
.data([data]);
|
|
43661
|
+
var wrapEnter = wrap.enter()
|
|
43662
|
+
.append("g").attr("class", " nv-wrap nv-interactiveLineLayer");
|
|
43663
|
+
wrapEnter.append("g").attr("class","nv-interactiveGuideLine");
|
|
43589
43664
|
|
|
43665
|
+
if (!svgContainer) {
|
|
43666
|
+
return;
|
|
43667
|
+
}
|
|
43590
43668
|
|
|
43591
|
-
|
|
43592
|
-
|
|
43593
|
-
|
|
43594
|
-
this.el = el;
|
|
43595
|
-
this.localization = localization;
|
|
43596
|
-
this.injector = injector;
|
|
43597
|
-
this.bsModalService = bsModalService;
|
|
43598
|
-
this.loadFailed = new core_["EventEmitter"]();
|
|
43599
|
-
this.loaded = new core_["EventEmitter"]();
|
|
43600
|
-
this.lastScale = 1;
|
|
43601
|
-
this.isMobileMode = false;
|
|
43602
|
-
this.globalSettings = this.injector.get(settings["b" /* GlobalSettings */]);
|
|
43603
|
-
this.viewService = injector.get(view_service["a" /* ViewService */]);
|
|
43604
|
-
}
|
|
43605
|
-
get viewResizeMode() {
|
|
43606
|
-
switch (this.resizeMode) {
|
|
43607
|
-
case 'HorizontalUniform':
|
|
43608
|
-
return settings["c" /* ViewResizeMode */].HorizontalUniform;
|
|
43609
|
-
default:
|
|
43610
|
-
return settings["c" /* ViewResizeMode */].Uniform;
|
|
43611
|
-
}
|
|
43612
|
-
}
|
|
43613
|
-
ngOnChanges(changes) {
|
|
43614
|
-
if (changes.displayMode) {
|
|
43615
|
-
this.onDisplayModeChanged(changes.displayMode.previousValue, changes.displayMode.currentValue);
|
|
43616
|
-
}
|
|
43617
|
-
if (changes.context) {
|
|
43618
|
-
this.onProviderChanged(changes.context.previousValue, changes.context.currentValue);
|
|
43619
|
-
}
|
|
43620
|
-
if (changes.size) {
|
|
43621
|
-
this.onSizeChanged(changes.size.previousValue, changes.size.currentValue);
|
|
43622
|
-
}
|
|
43623
|
-
if (changes.resizeMode) {
|
|
43624
|
-
this.onResizeModeChanged(changes.resizeMode.previousValue, changes.resizeMode.currentValue);
|
|
43625
|
-
}
|
|
43626
|
-
}
|
|
43627
|
-
doubleFingerZooming() {
|
|
43628
|
-
const scaleElement = this.$svg.find('div.svg-content').first()[0];
|
|
43629
|
-
const self = this;
|
|
43630
|
-
self.initWidth = scaleElement.offsetWidth;
|
|
43631
|
-
self.initHeight = scaleElement.offsetHeight;
|
|
43632
|
-
self.lastScale = 1;
|
|
43633
|
-
scaleElement.addEventListener('touchstart', function (e) {
|
|
43634
|
-
self.pageX = e.targetTouches[0].pageX;
|
|
43635
|
-
self.pageY = e.targetTouches[0].pageY;
|
|
43636
|
-
self.initX = !Object(lodash["isNaN"])(parseInt(scaleElement.style.left, 10)) ? parseInt(scaleElement.style.left, 10) : 0;
|
|
43637
|
-
self.initY = !Object(lodash["isNaN"])(parseInt(scaleElement.style.top, 10)) ? parseInt(scaleElement.style.top, 10) : 0;
|
|
43638
|
-
if (e.touches.length >= 2) {
|
|
43639
|
-
self.startTouch = e.touches;
|
|
43640
|
-
}
|
|
43641
|
-
self.isTouch = true;
|
|
43642
|
-
}, false);
|
|
43643
|
-
scaleElement.addEventListener('touchmove', function (e) {
|
|
43644
|
-
if (e.touches.length === 1 && self.isTouch && self.lastScale > 1) {
|
|
43645
|
-
e.preventDefault();
|
|
43646
|
-
const touchMoveX = e.targetTouches[0].pageX, touchMoveY = e.targetTouches[0].pageY;
|
|
43647
|
-
const left = Number(touchMoveX) - Number(self.pageX) + Number(self.initX);
|
|
43648
|
-
const top = Number(touchMoveY) - Number(self.pageY) + Number(self.initY);
|
|
43649
|
-
if (left > -(self.lastScale - 1) * self.initWidth / 2 && left < (self.lastScale - 1) * self.initWidth / 2) {
|
|
43650
|
-
scaleElement.style.left = left + 'px';
|
|
43651
|
-
}
|
|
43652
|
-
if (top > -(self.lastScale - 1) * self.initHeight / 2 && top < (self.lastScale - 1) * self.initHeight / 2) {
|
|
43653
|
-
scaleElement.style.top = top + 'px';
|
|
43654
|
-
}
|
|
43655
|
-
}
|
|
43656
|
-
if (e.touches.length >= 2 && self.isTouch) {
|
|
43657
|
-
e.preventDefault();
|
|
43658
|
-
const now = e.touches;
|
|
43659
|
-
const scale = (self.getDistance(now[0], now[1]) / self.getDistance(self.startTouch[0], self.startTouch[1]));
|
|
43660
|
-
let nowScale = self.lastScale;
|
|
43661
|
-
if (scale >= 1) {
|
|
43662
|
-
nowScale *= 1.008;
|
|
43663
|
-
}
|
|
43664
|
-
if (nowScale < 1) {
|
|
43665
|
-
nowScale = 1;
|
|
43666
|
-
}
|
|
43667
|
-
if (nowScale > 5) {
|
|
43668
|
-
nowScale = 5;
|
|
43669
|
-
}
|
|
43670
|
-
if (scale < 1) {
|
|
43671
|
-
nowScale *= 0.992;
|
|
43672
|
-
scaleElement.style.left = -(nowScale - 1) * self.initWidth / 8 + 'px';
|
|
43673
|
-
scaleElement.style.top = -(nowScale - 1) * self.initHeight / 8 + 'px';
|
|
43674
|
-
}
|
|
43675
|
-
scaleElement.style.transform = 'scale(' + nowScale + ')';
|
|
43676
|
-
self.lastScale = nowScale;
|
|
43677
|
-
}
|
|
43678
|
-
}, false);
|
|
43679
|
-
scaleElement.addEventListener('touchend', function () {
|
|
43680
|
-
if (self.isTouch) {
|
|
43681
|
-
self.isTouch = false;
|
|
43682
|
-
}
|
|
43683
|
-
}, false);
|
|
43684
|
-
}
|
|
43685
|
-
getDistance(p1, p2) {
|
|
43686
|
-
const x = p2.pageX - p1.pageX, y = p2.pageY - p1.pageY;
|
|
43687
|
-
return Math.sqrt((x * x) + (y * y));
|
|
43688
|
-
}
|
|
43689
|
-
ngOnDestroy() {
|
|
43690
|
-
if (this.host) {
|
|
43691
|
-
this.host.dispose();
|
|
43692
|
-
}
|
|
43693
|
-
}
|
|
43694
|
-
onProviderChanged(oldValue, newValue) {
|
|
43695
|
-
if (Object(lodash["isEqual"])(oldValue, newValue)) {
|
|
43696
|
-
return;
|
|
43697
|
-
}
|
|
43698
|
-
if (this.host) {
|
|
43699
|
-
this.host.dispose();
|
|
43700
|
-
this.host = null;
|
|
43701
|
-
}
|
|
43702
|
-
if (newValue) {
|
|
43703
|
-
this.$svg = $(this.el.nativeElement).find('div.svgView').first();
|
|
43704
|
-
this.$svg.empty();
|
|
43705
|
-
const svgRootClass = 'S' + guid["a" /* Guid */].newGuid().toString('n');
|
|
43706
|
-
this.hostContainerId = 'H' + guid["a" /* Guid */].newGuid().toString('n');
|
|
43707
|
-
this.$svg.addClass(svgRootClass);
|
|
43708
|
-
const guiOptions = {
|
|
43709
|
-
svgRootClass: svgRootClass,
|
|
43710
|
-
hostContainerId: this.hostContainerId,
|
|
43711
|
-
el: this.el
|
|
43712
|
-
};
|
|
43713
|
-
const host = new gui_host_GuiHost(this.injector, this.bsModalService, newValue, guiOptions, this.el);
|
|
43714
|
-
/*
|
|
43715
|
-
* if configureViewCode exist then load by configureViewCode else load by configureViewId
|
|
43716
|
-
*/
|
|
43717
|
-
(this.context.configureViewCode ? host.loadByConfigureViewCode(this.context.configureViewCode) :
|
|
43718
|
-
host.load(this.context.configureViewId)).then(t => {
|
|
43719
|
-
// 加载结束后,如果context发生了变化,直接返回。
|
|
43720
|
-
if (!Object(lodash["isEqual"])(this.context, t.context)) {
|
|
43721
|
-
t.dispose();
|
|
43722
|
-
return;
|
|
43723
|
-
}
|
|
43724
|
-
this.host = host;
|
|
43725
|
-
this.host.resizeView(this.size, this.viewResizeMode);
|
|
43726
|
-
this.$svg.append(t.element);
|
|
43727
|
-
if (this.isMobileMode) {
|
|
43728
|
-
this.doubleFingerZooming();
|
|
43729
|
-
}
|
|
43730
|
-
this.loaded.emit();
|
|
43731
|
-
}).catch(error => {
|
|
43732
|
-
this.$svg.append(`<p>${this.localization.loadFailed}</p>`);
|
|
43733
|
-
this.loadFailed.emit(error);
|
|
43734
|
-
});
|
|
43735
|
-
}
|
|
43736
|
-
else {
|
|
43737
|
-
if (this.$svg) {
|
|
43738
|
-
this.$svg.empty();
|
|
43739
|
-
}
|
|
43740
|
-
this.host = null;
|
|
43741
|
-
}
|
|
43742
|
-
}
|
|
43743
|
-
onSizeChanged(oldValue, newValue) {
|
|
43744
|
-
if (!this.host || Object(lodash["isEqual"])(oldValue, newValue)) {
|
|
43745
|
-
return;
|
|
43746
|
-
}
|
|
43747
|
-
this.host.updateViewSize(newValue);
|
|
43748
|
-
if (this.isMobileMode) {
|
|
43749
|
-
this.doubleFingerZooming();
|
|
43750
|
-
}
|
|
43751
|
-
}
|
|
43752
|
-
onResizeModeChanged(oldValue, newValue) {
|
|
43753
|
-
if (!this.host || Object(lodash["isEqual"])(oldValue, newValue)) {
|
|
43754
|
-
return;
|
|
43755
|
-
}
|
|
43756
|
-
this.host.updateViewResizeMode(this.viewResizeMode);
|
|
43757
|
-
}
|
|
43758
|
-
onDisplayModeChanged(oldValue, newValue) {
|
|
43759
|
-
if (Object(lodash["isEqual"])(oldValue, newValue)) {
|
|
43760
|
-
return;
|
|
43761
|
-
}
|
|
43762
|
-
this.isMobileMode = this.displayMode === 'Mobile';
|
|
43763
|
-
this.globalSettings.displayMode = this.isMobileMode ? settings["a" /* DisplayMode */].Mobile : settings["a" /* DisplayMode */].Web;
|
|
43764
|
-
}
|
|
43765
|
-
refreshCurrentPage() {
|
|
43766
|
-
if (this.host.currentViewIndex === undefined) {
|
|
43767
|
-
return false;
|
|
43768
|
-
}
|
|
43769
|
-
const toggleView = this.viewService.toggleViews.get(this.el);
|
|
43770
|
-
if (!toggleView) {
|
|
43771
|
-
return false;
|
|
43772
|
-
}
|
|
43773
|
-
toggleView(this.host.currentViewIndex, this.hostContainerId, this.el).subscribe();
|
|
43774
|
-
return true;
|
|
43775
|
-
}
|
|
43776
|
-
};
|
|
43777
|
-
__decorate([
|
|
43778
|
-
Object(core_["Input"])()
|
|
43779
|
-
], gui_component_GuiComponent.prototype, "context", void 0);
|
|
43780
|
-
__decorate([
|
|
43781
|
-
Object(core_["Input"])()
|
|
43782
|
-
], gui_component_GuiComponent.prototype, "size", void 0);
|
|
43783
|
-
__decorate([
|
|
43784
|
-
Object(core_["Input"])()
|
|
43785
|
-
], gui_component_GuiComponent.prototype, "resizeMode", void 0);
|
|
43786
|
-
__decorate([
|
|
43787
|
-
Object(core_["Input"])()
|
|
43788
|
-
], gui_component_GuiComponent.prototype, "displayMode", void 0);
|
|
43789
|
-
__decorate([
|
|
43790
|
-
Object(core_["Output"])()
|
|
43791
|
-
], gui_component_GuiComponent.prototype, "loadFailed", void 0);
|
|
43792
|
-
__decorate([
|
|
43793
|
-
Object(core_["Output"])()
|
|
43794
|
-
], gui_component_GuiComponent.prototype, "loaded", void 0);
|
|
43795
|
-
gui_component_GuiComponent = __decorate([
|
|
43796
|
-
Object(core_["Component"])({
|
|
43797
|
-
selector: 'fc-gui',
|
|
43798
|
-
template: "<div> <div class='svgView' style=\"position: relative;display: flex;justify-content: center;align-items: center;\"></div> </div> "
|
|
43799
|
-
}),
|
|
43800
|
-
__param(1, Object(core_["Inject"])(_tmp_localization["b" /* LOCALIZATION */]))
|
|
43801
|
-
], gui_component_GuiComponent);
|
|
43802
|
-
|
|
43803
|
-
|
|
43804
|
-
|
|
43805
|
-
/***/ }),
|
|
43806
|
-
/* 37 */
|
|
43807
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
43808
|
-
|
|
43809
|
-
"use strict";
|
|
43810
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return WriteValueModalComponent; });
|
|
43811
|
-
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
43812
|
-
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
43813
|
-
/* harmony import */ var _localization__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
|
|
43814
|
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
|
|
43815
|
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
|
|
43816
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
43817
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
43818
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
43819
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
43820
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
43821
|
-
};
|
|
43822
|
-
var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
|
|
43823
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
43824
|
-
};
|
|
43825
|
-
|
|
43826
|
-
|
|
43827
|
-
|
|
43828
|
-
let WriteValueModalComponent = class WriteValueModalComponent {
|
|
43829
|
-
constructor(localization, dataTypeService, fractionDigitService, numericalOperationService, bsModalRef) {
|
|
43830
|
-
this.localization = localization;
|
|
43831
|
-
this.dataTypeService = dataTypeService;
|
|
43832
|
-
this.fractionDigitService = fractionDigitService;
|
|
43833
|
-
this.numericalOperationService = numericalOperationService;
|
|
43834
|
-
this.bsModalRef = bsModalRef;
|
|
43835
|
-
this.writeValueRangeText = '';
|
|
43836
|
-
this.isSubmitting = false;
|
|
43837
|
-
}
|
|
43838
|
-
get invalidErrorText() {
|
|
43839
|
-
return this.localization.loadFailed;
|
|
43840
|
-
}
|
|
43841
|
-
ngOnInit() {
|
|
43842
|
-
this.initData(this.args);
|
|
43843
|
-
this.validate();
|
|
43844
|
-
}
|
|
43845
|
-
initData(option) {
|
|
43846
|
-
this.variableName = option.variableName;
|
|
43847
|
-
this.dataType = option.dataType;
|
|
43848
|
-
this.fBoxDataType = option.fBoxDataType;
|
|
43849
|
-
this.integerDigits = option.integerDigits ? option.integerDigits : 0;
|
|
43850
|
-
this.fractionDigits = option.fractionDigits ? option.fractionDigits : 0;
|
|
43851
|
-
this.valueType = this.dataTypeService.getValueType(option.version, option.dataType);
|
|
43852
|
-
this.pattern = this.dataTypeService.getValuePattern(option.version, option.dataType);
|
|
43853
|
-
this.numericalOperation = option.numericalOperation;
|
|
43854
|
-
this.enableNumericalOperation = this.numericalOperation.enableNumericalOperation ?
|
|
43855
|
-
this.numericalOperation.enableNumericalOperation : false;
|
|
43856
|
-
this.value = '';
|
|
43857
|
-
if (this.args.enableDataParsed) {
|
|
43858
|
-
this.setValueRangeAccordToDataParsed(option);
|
|
43859
|
-
}
|
|
43860
|
-
else {
|
|
43861
|
-
this.writeMaxValue = this.dataTypeService.getMaxValue(option.version, this.dataType, this.fBoxDataType);
|
|
43862
|
-
this.writeMinValue = this.dataTypeService.getMinValue(option.version, this.dataType, this.fBoxDataType);
|
|
43863
|
-
}
|
|
43864
|
-
this.writeValueRangeText = this.getWriteValueRangeText();
|
|
43865
|
-
}
|
|
43866
|
-
setValueRangeAccordToDataParsed(option) {
|
|
43867
|
-
if (this.dataTypeService.isFloat(option.version, this.dataType) || this.enableNumericalOperation) {
|
|
43868
|
-
this.maxValueLimit = this.dataTypeService.getMaxValue(option.version, this.dataType, this.fBoxDataType);
|
|
43869
|
-
this.minValueLimit = this.dataTypeService.getMinValue(option.version, this.dataType, this.fBoxDataType);
|
|
43870
|
-
this.numericalLowerLimit = this.numericalOperation.numericalLowerLimit;
|
|
43871
|
-
this.numericalUpperLimit = this.numericalOperation.numericalUpperLimit;
|
|
43872
|
-
}
|
|
43873
|
-
else {
|
|
43874
|
-
this.maxValueLimit = +this.fractionDigitService.movePoint(this.dataTypeService.getMaxValue(option.version, this.dataType, this.fBoxDataType), -this.fractionDigits);
|
|
43875
|
-
this.minValueLimit = +this.fractionDigitService.movePoint(this.dataTypeService.getMinValue(option.version, this.dataType, this.fBoxDataType), -this.fractionDigits);
|
|
43876
|
-
this.numericalLowerLimit = +this.fractionDigitService.movePoint(this.numericalOperation.numericalLowerLimit, -this.fractionDigits);
|
|
43877
|
-
this.numericalUpperLimit = +this.fractionDigitService.movePoint(this.numericalOperation.numericalUpperLimit, -this.fractionDigits);
|
|
43878
|
-
}
|
|
43879
|
-
const minValue = this.numericalOperationService.getWriteMinValue(this.minValueLimit, this.numericalOperation);
|
|
43880
|
-
const maxValue = this.numericalOperationService.getWriteMaxValue(this.maxValueLimit, this.numericalOperation);
|
|
43881
|
-
const lowerLimitValue = this.numericalOperationService.getWriteMinValue(this.numericalLowerLimit, this.numericalOperation);
|
|
43882
|
-
const upperLimitValue = this.numericalOperationService.getWriteMaxValue(this.numericalUpperLimit, this.numericalOperation);
|
|
43883
|
-
const realMinValue = minValue < maxValue ? minValue : maxValue;
|
|
43884
|
-
const realMaxValue = minValue < maxValue ? maxValue : minValue;
|
|
43885
|
-
const realLowerLimitValue = lowerLimitValue < upperLimitValue ? lowerLimitValue : upperLimitValue;
|
|
43886
|
-
const realUpperLimitValue = lowerLimitValue < upperLimitValue ? upperLimitValue : lowerLimitValue;
|
|
43887
|
-
this.writeMinValue = realMinValue > realLowerLimitValue ? realMinValue : realLowerLimitValue;
|
|
43888
|
-
this.writeMaxValue = realMaxValue < realUpperLimitValue ? realMaxValue : realUpperLimitValue;
|
|
43889
|
-
}
|
|
43890
|
-
getWriteValueRangeText() {
|
|
43891
|
-
let minValue = '';
|
|
43892
|
-
let maxValue = '';
|
|
43893
|
-
if (this.dataTypeService.isHexOrBinaryType(this.args.version, this.dataType)) {
|
|
43894
|
-
minValue = this.writeMinValue.toString(16);
|
|
43895
|
-
maxValue = this.writeMaxValue.toString(16);
|
|
43896
|
-
}
|
|
43897
|
-
else {
|
|
43898
|
-
if (this.args.enableDataParsed && this.fractionDigits > 0) {
|
|
43899
|
-
minValue = this.writeMinValue.toFixed(this.fractionDigits).toString();
|
|
43900
|
-
maxValue = this.writeMaxValue.toFixed(this.fractionDigits).toString();
|
|
43901
|
-
}
|
|
43902
|
-
else {
|
|
43903
|
-
minValue = this.writeMinValue.toString();
|
|
43904
|
-
maxValue = this.writeMaxValue.toString();
|
|
43905
|
-
}
|
|
43906
|
-
}
|
|
43907
|
-
return minValue + '~' + maxValue;
|
|
43908
|
-
}
|
|
43909
|
-
save() {
|
|
43910
|
-
this.isSubmitting = true;
|
|
43911
|
-
let value = this.value;
|
|
43912
|
-
const showValue = this.value;
|
|
43913
|
-
if (this.args.enableDataParsed) {
|
|
43914
|
-
if (this.enableNumericalOperation) {
|
|
43915
|
-
value = this.numericalOperationService.getWriteValue(this.args.version, this.value, this.numericalOperation, this.dataType, this.fractionDigits);
|
|
43916
|
-
}
|
|
43917
|
-
else {
|
|
43918
|
-
value = this.formatWriteValue();
|
|
43919
|
-
}
|
|
43920
|
-
}
|
|
43921
|
-
// 处理系统变量"当前语种ID"
|
|
43922
|
-
if (this.variableName === '当前语种ID') {
|
|
43923
|
-
this.handleCurrentLanguageIdSave(value);
|
|
43924
|
-
return;
|
|
43925
|
-
}
|
|
43926
|
-
if (!this.args.releasedVariableService) {
|
|
43927
|
-
this.onClosed({
|
|
43928
|
-
value: value,
|
|
43929
|
-
showValue: showValue,
|
|
43930
|
-
enableNumericalOperation: false,
|
|
43931
|
-
isNumericalOperation: this.isNumericalOperation,
|
|
43932
|
-
variableRwType: 6
|
|
43933
|
-
});
|
|
43934
|
-
return;
|
|
43935
|
-
}
|
|
43936
|
-
this.args.releasedVariableService.getVariableWithValueTransform(this.variableName).subscribe(result => {
|
|
43937
|
-
const valueTransform = JSON.parse(result.valueTransform);
|
|
43938
|
-
if ((valueTransform === null || valueTransform === void 0 ? void 0 : valueTransform.Type) !== 0) {
|
|
43939
|
-
this.isNumericalOperation = true;
|
|
43940
|
-
}
|
|
43941
|
-
this.onClosed({
|
|
43942
|
-
value: value,
|
|
43943
|
-
showValue: showValue,
|
|
43944
|
-
enableNumericalOperation: this.enableNumericalOperation,
|
|
43945
|
-
isNumericalOperation: this.isNumericalOperation,
|
|
43946
|
-
variableRwType: result.variableRwType
|
|
43947
|
-
});
|
|
43948
|
-
});
|
|
43949
|
-
}
|
|
43950
|
-
/**
|
|
43951
|
-
* 处理"当前语种ID"系统变量的保存
|
|
43952
|
-
*/
|
|
43953
|
-
handleCurrentLanguageIdSave(value) {
|
|
43954
|
-
if (!this.args.guiContext || !this.args.guiContext.updateCurrentLanguageId) {
|
|
43955
|
-
this.showValidationErrorInfo(this.localization.loadFailed);
|
|
43956
|
-
this.isSubmitting = false;
|
|
43957
|
-
return;
|
|
43958
|
-
}
|
|
43959
|
-
// 转换为数字类型
|
|
43960
|
-
const languageId = value === '' || value == null ? null : Number(value);
|
|
43961
|
-
// 调用 GuiContext 的语种切换方法
|
|
43962
|
-
this.args.guiContext.updateCurrentLanguageId(languageId).then(() => {
|
|
43963
|
-
// 语种切换成功,调用 onClosed 回调,让数字显示元件也能更新
|
|
43964
|
-
this.onClosed({
|
|
43965
|
-
value: value,
|
|
43966
|
-
showValue: value,
|
|
43967
|
-
enableNumericalOperation: false,
|
|
43968
|
-
isNumericalOperation: false,
|
|
43969
|
-
variableRwType: 6
|
|
43970
|
-
});
|
|
43971
|
-
}).catch(() => {
|
|
43972
|
-
this.showValidationErrorInfo(this.localization.loadFailed);
|
|
43973
|
-
this.isSubmitting = false;
|
|
43974
|
-
});
|
|
43975
|
-
}
|
|
43976
|
-
close() {
|
|
43977
|
-
this.bsModalRef.hide();
|
|
43978
|
-
}
|
|
43979
|
-
validate(event = null) {
|
|
43980
|
-
if (event && event.keyCode === 13 && !this.validationError) {
|
|
43981
|
-
this.save();
|
|
43982
|
-
return;
|
|
43983
|
-
}
|
|
43984
|
-
// 校验数值必填
|
|
43985
|
-
if (null == this.value || '' === this.value.trim()) {
|
|
43986
|
-
return this.showValidationErrorInfo(this.localization.numericalValueRequired);
|
|
43987
|
-
}
|
|
43988
|
-
// 校验格式
|
|
43989
|
-
if (!new RegExp(this.pattern).test(this.value)) {
|
|
43990
|
-
return this.showValidationErrorInfo(this.localization.invalidNumericalValue);
|
|
43991
|
-
}
|
|
43992
|
-
// 校验小数点位数
|
|
43993
|
-
if (!this.enableNumericalOperation && this.dataTypeService.isSupportFractionDigit(this.args.version, this.dataType)
|
|
43994
|
-
&& this.getFractionDigits(this.value) > this.fractionDigits) {
|
|
43995
|
-
return this.showValidationErrorInfo(`${this.localization.fractionDigitsMustLessThan}${this.fractionDigits}`);
|
|
43996
|
-
}
|
|
43997
|
-
// 校验负号
|
|
43998
|
-
if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isNil"])(this.args.version) || (!Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isNil"])(this.args.version) && this.args.version < 5)) {
|
|
43999
|
-
if (!this.enableNumericalOperation && !this.dataTypeService.isSignedType(this.args.version, this.dataType) && this.value.startsWith('-')) {
|
|
44000
|
-
return this.showValidationErrorInfo(this.localization.canNotBeNegative);
|
|
44001
|
-
}
|
|
44002
|
-
}
|
|
44003
|
-
if (this.dataTypeService.isBinaryType(this.args.version, this.dataType) || this.dataTypeService.isHexType(this.args.version, this.dataType)) {
|
|
44004
|
-
// 校验数值最大长度
|
|
44005
|
-
const valueMaxLength = this.dataTypeService.getValueMaxLength(this.args.version, this.dataType, this.fBoxDataType);
|
|
44006
|
-
const maxLength = this.integerDigits ? Math.min(this.integerDigits, valueMaxLength) : valueMaxLength;
|
|
44007
|
-
if (this.value.length > maxLength) {
|
|
44008
|
-
return this.showValidationErrorInfo(this.localization.numericalValueTooLong);
|
|
44009
|
-
}
|
|
44010
|
-
}
|
|
44011
|
-
let transportValue;
|
|
44012
|
-
if (this.dataTypeService.isHexOrBinaryType(this.args.version, this.dataType)) {
|
|
44013
|
-
transportValue = this.dataTypeService.formatToDecimal(this.args.version, this.value, this.dataType);
|
|
44014
|
-
}
|
|
44015
|
-
else {
|
|
44016
|
-
transportValue = Number(this.value);
|
|
44017
|
-
}
|
|
44018
|
-
if (Number(transportValue) > this.writeMaxValue || Number(transportValue) < this.writeMinValue) {
|
|
44019
|
-
return this.showValidationErrorInfo(this.localization.valueOutOfRange);
|
|
44020
|
-
}
|
|
44021
|
-
// 没有错误则隐藏错误框
|
|
44022
|
-
this.hideValidationErrorInfo();
|
|
44023
|
-
}
|
|
44024
|
-
showValidationErrorInfo(errorText) {
|
|
44025
|
-
this.validationError = true;
|
|
44026
|
-
this.validationErrorText = errorText;
|
|
44027
|
-
}
|
|
44028
|
-
hideValidationErrorInfo() {
|
|
44029
|
-
this.validationError = false;
|
|
44030
|
-
this.validationErrorText = '';
|
|
44031
|
-
}
|
|
44032
|
-
getFractionDigits(number) {
|
|
44033
|
-
if (number && number.indexOf('.') > 0) {
|
|
44034
|
-
return number.split('.')[1].length;
|
|
44035
|
-
}
|
|
44036
|
-
return 0;
|
|
44037
|
-
}
|
|
44038
|
-
/**
|
|
44039
|
-
* 格式化写入的值
|
|
44040
|
-
* 因为有小数点的数值类型,会被按照小数点位数移位,所以需要在修改前右移小数点位数
|
|
44041
|
-
*/
|
|
44042
|
-
formatWriteValue() {
|
|
44043
|
-
if (this.dataTypeService.isSupportFractionDigit(this.args.version, this.dataType) &&
|
|
44044
|
-
!this.dataTypeService.isFloat(this.args.version, this.dataType) && this.fractionDigits) {
|
|
44045
|
-
return this.fractionDigitService.movePoint(this.value, this.fractionDigits);
|
|
44046
|
-
}
|
|
44047
|
-
if (this.dataTypeService.isSupportNumericalOperation(this.args.version, this.dataType)) {
|
|
44048
|
-
this.value = Number(this.value).toString();
|
|
44049
|
-
}
|
|
44050
|
-
return this.value;
|
|
44051
|
-
}
|
|
44052
|
-
};
|
|
44053
|
-
__decorate([
|
|
44054
|
-
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])()
|
|
44055
|
-
], WriteValueModalComponent.prototype, "invalidErrorText", null);
|
|
44056
|
-
WriteValueModalComponent = __decorate([
|
|
44057
|
-
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
|
|
44058
|
-
selector: 'writeValueModal',
|
|
44059
|
-
template: "<form #writeValueForm=\"ngForm\" novalidate (ngSubmit)=\"save()\" bs-modal-drag> <div class=\"modal-header\"> <h4 class=\"modal-title\"> <span>{{localization.setting}}</span> <span>{{variableName}}</span> </h4> <button type=\"button\" class=\"close pull-right\" aria-label=\"Close\" (click)=\"close()\"> <span aria-hidden=\"true\">×</span> </button> </div> <div class=\"modal-body\"> <span class=\"write-value-range\">{{localization.writeValueRange}}:</span> <div class=\"write-value-range\"> {{writeValueRangeText}} <span *ngIf=\"valueType\">({{valueType}})</span> </div> <input type=\"text\" name=\"valueInput\" autoFocus class=\"form-control write-value\" [(ngModel)]=\"value\" (keyup)=\"validate($event)\" autocomplete=\"off\"> <span class=\"help-block text-danger\" [hidden]=\"!validationError\">{{validationErrorText}}</span> </div> <div class=\"modal-footer\"> <button type=\"submit\" class=\"btn md-skip btn-primary btn-block\" [disabled]=\"validationError || isSubmitting\"> <ng-container *ngIf=\"!isSubmitting\">{{localization.submit}}</ng-container> <ng-container *ngIf=\"isSubmitting\">{{localization.submitting}}</ng-container> </button> </div> </form> ",
|
|
44060
|
-
styles: [".modal-header { padding: 10px; border-color: transparent; } .modal-body { position: relative; padding: 0px 5px !important; padding-top: 10px !important; } .modal-title { display: unset; margin-left: -6px; font-size: 16px !important; } .form-control { margin: 0 5%; float: none; width: 90%; } .modal-footer { padding: 10px 4px 20px 5px !important; text-align: right; border-color: transparent; } .text-danger { display: block; color: #ed6b75; font-size: 14px; margin: 5px 0px 0px 15px; } .btn-primary { background-color: #3B97FC; border-color: #3B97FC; padding: 5px 30px; width: 90%; margin: 0 5%; height: 32px; } .write-value-range { color: #7f939e; font-size: 14px; margin-left: 15px; } .write-value { padding-left: 8px; margin-left: 16px; height: 32px; } "]
|
|
44061
|
-
}),
|
|
44062
|
-
__param(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_localization__WEBPACK_IMPORTED_MODULE_1__[/* LOCALIZATION */ "b"]))
|
|
44063
|
-
], WriteValueModalComponent);
|
|
44064
|
-
|
|
44065
|
-
|
|
44066
|
-
|
|
44067
|
-
/***/ }),
|
|
44068
|
-
/* 38 */
|
|
44069
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
44070
|
-
|
|
44071
|
-
"use strict";
|
|
44072
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return WriteCharacterModalComponent; });
|
|
44073
|
-
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
44074
|
-
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
44075
|
-
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40);
|
|
44076
|
-
/* harmony import */ var _localization__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9);
|
|
44077
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
44078
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
44079
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
44080
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
44081
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
44082
|
-
};
|
|
44083
|
-
var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
|
|
44084
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
44085
|
-
};
|
|
44086
|
-
|
|
44087
|
-
|
|
44088
|
-
|
|
44089
|
-
let WriteCharacterModalComponent = class WriteCharacterModalComponent {
|
|
44090
|
-
constructor(localization) {
|
|
44091
|
-
this.localization = localization;
|
|
44092
|
-
this._onClosed = new rxjs__WEBPACK_IMPORTED_MODULE_1__[/* Subject */ "a"]();
|
|
44093
|
-
}
|
|
44094
|
-
get onClosed() {
|
|
44095
|
-
return this._onClosed;
|
|
44096
|
-
}
|
|
44097
|
-
get invalidErrorText() {
|
|
44098
|
-
return this.localization.loadFailed;
|
|
44099
|
-
}
|
|
44100
|
-
ngOnInit() {
|
|
44101
|
-
this.variableName = this.args.variableName;
|
|
44102
|
-
this.isPassword = this.args.isPassword ? this.args.isPassword : false;
|
|
44103
|
-
this.charCount = this.args.charCount;
|
|
44104
|
-
this.value = '';
|
|
44105
|
-
this.validate();
|
|
44106
|
-
}
|
|
44107
|
-
validate() {
|
|
44108
|
-
// 校验数值必填
|
|
44109
|
-
if (null == this.value || '' === this.value.trim()) {
|
|
44110
|
-
return this.showValidationErrorInfo(this.localization.characterInputRequired);
|
|
44111
|
-
}
|
|
44112
|
-
if (this.value.length > this.charCount) {
|
|
44113
|
-
return this.showValidationErrorInfo(this.localization.characterOutofRange);
|
|
44114
|
-
}
|
|
44115
|
-
this.hideValidationErrorInfo();
|
|
44116
|
-
}
|
|
44117
|
-
showValidationErrorInfo(errorText) {
|
|
44118
|
-
this.validationError = true;
|
|
44119
|
-
this.validationErrorText = errorText;
|
|
44120
|
-
}
|
|
44121
|
-
hideValidationErrorInfo() {
|
|
44122
|
-
this.validationError = false;
|
|
44123
|
-
this.validationErrorText = '';
|
|
44124
|
-
}
|
|
44125
|
-
save() {
|
|
44126
|
-
this.close({ value: this.value });
|
|
44127
|
-
}
|
|
44128
|
-
close(modalResult) {
|
|
44129
|
-
this._onClosed.next(modalResult);
|
|
44130
|
-
this._onClosed.complete();
|
|
44131
|
-
}
|
|
44132
|
-
};
|
|
44133
|
-
__decorate([
|
|
44134
|
-
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])()
|
|
44135
|
-
], WriteCharacterModalComponent.prototype, "invalidErrorText", null);
|
|
44136
|
-
WriteCharacterModalComponent = __decorate([
|
|
44137
|
-
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
|
|
44138
|
-
selector: 'writeCharacterModal',
|
|
44139
|
-
template: "<form #writeValueForm=\"ngForm\" novalidate (ngSubmit)=\"save()\" bs-modal-drag> <div class=\"modal-header\"> <h4 class=\"modal-title\"> <span>{{localization.setting}}</span> <span>{{variableName}}</span> </h4> <button type=\"button\" class=\"close pull-right\" aria-label=\"Close\" (click)=\"close()\"> <span aria-hidden=\"true\">×</span> </button> </div> <div class=\"modal-body\"> <input type=\"text\" name=\"characterInput\" autoFocus class=\"form-control write-character-value\" [(ngModel)]=\"value\" (keyup)=\"validate()\" *ngIf=\"!isPassword\" autocomplete=\"off\"> <input type=\"password\" name=\"passwordInput\" autoFocus class=\"form-control write-character-value\" [(ngModel)]=\"value\" (keyup)=\"validate()\" *ngIf=\"isPassword\" autocomplete=\"off\"> <span class=\"help-block text-danger\" [hidden]=\"!validationError\">{{validationErrorText}}</span> </div> <div class=\"modal-footer\"> <button type=\"submit\" class=\"btn md-skip btn-primary btn-block\" [disabled]=\"validationError\">{{localization.submit}}</button> </div> </form> ",
|
|
44140
|
-
styles: [".modal-header { padding: 10px; border-color: transparent; } .modal-body { position: relative; padding: 0px 5px !important; } .modal-title { display: unset; margin-left: -6px; font-size: 16px !important; } .form-control { margin: 0 5%; float: none; width: 90%; } .modal-footer { padding: 10px 4px 20px 5px !important; text-align: right; border-color: transparent; } .text-danger { display: block; color: #ed6b75; font-size: 14px; margin: 10px 0px 0px 15px; } .btn-primary { background-color: #3B97FC; border-color: #3B97FC; padding: 5px 30px; width: 90%; margin: 0 5%; height: 32px; } .write-character-value { padding-left: 8px; height: 32px; margin-left: 16px; } "]
|
|
44141
|
-
}),
|
|
44142
|
-
__param(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_localization__WEBPACK_IMPORTED_MODULE_2__[/* LOCALIZATION */ "b"]))
|
|
44143
|
-
], WriteCharacterModalComponent);
|
|
44144
|
-
|
|
44145
|
-
|
|
44146
|
-
|
|
44147
|
-
/***/ }),
|
|
44148
|
-
/* 39 */
|
|
44149
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
44150
|
-
|
|
44151
|
-
/* nvd3 version 1.8.6-dev (https://github.com/flexem/nvd3) 2018-08-22 */
|
|
44152
|
-
(function(){
|
|
44153
|
-
|
|
44154
|
-
// set up main nv object
|
|
44155
|
-
var nv = {};
|
|
44156
|
-
|
|
44157
|
-
// the major global objects under the nv namespace
|
|
44158
|
-
nv.dev = false; //set false when in production
|
|
44159
|
-
nv.tooltip = nv.tooltip || {}; // For the tooltip system
|
|
44160
|
-
nv.utils = nv.utils || {}; // Utility subsystem
|
|
44161
|
-
nv.models = nv.models || {}; //stores all the possible models/components
|
|
44162
|
-
nv.charts = {}; //stores all the ready to use charts
|
|
44163
|
-
nv.logs = {}; //stores some statistics and potential error messages
|
|
44164
|
-
nv.dom = {}; //DOM manipulation functions
|
|
44165
|
-
|
|
44166
|
-
// Node/CommonJS - require D3
|
|
44167
|
-
if (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined' && typeof(d3) == 'undefined') {
|
|
44168
|
-
d3 = __webpack_require__(18);
|
|
44169
|
-
}
|
|
44170
|
-
|
|
44171
|
-
nv.dispatch = d3.dispatch('render_start', 'render_end');
|
|
44172
|
-
|
|
44173
|
-
// Function bind polyfill
|
|
44174
|
-
// Needed ONLY for phantomJS as it's missing until version 2.0 which is unreleased as of this comment
|
|
44175
|
-
// https://github.com/ariya/phantomjs/issues/10522
|
|
44176
|
-
// http://kangax.github.io/compat-table/es5/#Function.prototype.bind
|
|
44177
|
-
// phantomJS is used for running the test suite
|
|
44178
|
-
if (!Function.prototype.bind) {
|
|
44179
|
-
Function.prototype.bind = function (oThis) {
|
|
44180
|
-
if (typeof this !== "function") {
|
|
44181
|
-
// closest thing possible to the ECMAScript 5 internal IsCallable function
|
|
44182
|
-
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
|
|
44183
|
-
}
|
|
44184
|
-
|
|
44185
|
-
var aArgs = Array.prototype.slice.call(arguments, 1),
|
|
44186
|
-
fToBind = this,
|
|
44187
|
-
fNOP = function () {},
|
|
44188
|
-
fBound = function () {
|
|
44189
|
-
return fToBind.apply(this instanceof fNOP && oThis
|
|
44190
|
-
? this
|
|
44191
|
-
: oThis,
|
|
44192
|
-
aArgs.concat(Array.prototype.slice.call(arguments)));
|
|
44193
|
-
};
|
|
44194
|
-
|
|
44195
|
-
fNOP.prototype = this.prototype;
|
|
44196
|
-
fBound.prototype = new fNOP();
|
|
44197
|
-
return fBound;
|
|
44198
|
-
};
|
|
44199
|
-
}
|
|
44200
|
-
|
|
44201
|
-
// Development render timers - disabled if dev = false
|
|
44202
|
-
if (nv.dev) {
|
|
44203
|
-
nv.dispatch.on('render_start', function(e) {
|
|
44204
|
-
nv.logs.startTime = +new Date();
|
|
44205
|
-
});
|
|
44206
|
-
|
|
44207
|
-
nv.dispatch.on('render_end', function(e) {
|
|
44208
|
-
nv.logs.endTime = +new Date();
|
|
44209
|
-
nv.logs.totalTime = nv.logs.endTime - nv.logs.startTime;
|
|
44210
|
-
nv.log('total', nv.logs.totalTime); // used for development, to keep track of graph generation times
|
|
44211
|
-
});
|
|
44212
|
-
}
|
|
44213
|
-
|
|
44214
|
-
// Logs all arguments, and returns the last so you can test things in place
|
|
44215
|
-
// Note: in IE8 console.log is an object not a function, and if modernizr is used
|
|
44216
|
-
// then calling Function.prototype.bind with with anything other than a function
|
|
44217
|
-
// causes a TypeError to be thrown.
|
|
44218
|
-
nv.log = function() {
|
|
44219
|
-
if (nv.dev && window.console && console.log && console.log.apply)
|
|
44220
|
-
console.log.apply(console, arguments);
|
|
44221
|
-
else if (nv.dev && window.console && typeof console.log == "function" && Function.prototype.bind) {
|
|
44222
|
-
var log = Function.prototype.bind.call(console.log, console);
|
|
44223
|
-
log.apply(console, arguments);
|
|
44224
|
-
}
|
|
44225
|
-
return arguments[arguments.length - 1];
|
|
44226
|
-
};
|
|
44227
|
-
|
|
44228
|
-
// print console warning, should be used by deprecated functions
|
|
44229
|
-
nv.deprecated = function(name, info) {
|
|
44230
|
-
if (console && console.warn) {
|
|
44231
|
-
console.warn('nvd3 warning: `' + name + '` has been deprecated. ', info || '');
|
|
44232
|
-
}
|
|
44233
|
-
};
|
|
44234
|
-
|
|
44235
|
-
// The nv.render function is used to queue up chart rendering
|
|
44236
|
-
// in non-blocking async functions.
|
|
44237
|
-
// When all queued charts are done rendering, nv.dispatch.render_end is invoked.
|
|
44238
|
-
nv.render = function render(step) {
|
|
44239
|
-
// number of graphs to generate in each timeout loop
|
|
44240
|
-
step = step || 1;
|
|
44241
|
-
|
|
44242
|
-
nv.render.active = true;
|
|
44243
|
-
nv.dispatch.render_start();
|
|
44244
|
-
|
|
44245
|
-
var renderLoop = function() {
|
|
44246
|
-
var chart, graph;
|
|
44247
|
-
|
|
44248
|
-
for (var i = 0; i < step && (graph = nv.render.queue[i]); i++) {
|
|
44249
|
-
chart = graph.generate();
|
|
44250
|
-
if (typeof graph.callback == typeof(Function)) graph.callback(chart);
|
|
44251
|
-
}
|
|
44252
|
-
|
|
44253
|
-
nv.render.queue.splice(0, i);
|
|
44254
|
-
|
|
44255
|
-
if (nv.render.queue.length) {
|
|
44256
|
-
setTimeout(renderLoop);
|
|
44257
|
-
}
|
|
44258
|
-
else {
|
|
44259
|
-
nv.dispatch.render_end();
|
|
44260
|
-
nv.render.active = false;
|
|
44261
|
-
}
|
|
44262
|
-
};
|
|
44263
|
-
|
|
44264
|
-
setTimeout(renderLoop);
|
|
44265
|
-
};
|
|
44266
|
-
|
|
44267
|
-
nv.render.active = false;
|
|
44268
|
-
nv.render.queue = [];
|
|
44269
|
-
|
|
44270
|
-
/*
|
|
44271
|
-
Adds a chart to the async rendering queue. This method can take arguments in two forms:
|
|
44272
|
-
nv.addGraph({
|
|
44273
|
-
generate: <Function>
|
|
44274
|
-
callback: <Function>
|
|
44275
|
-
})
|
|
44276
|
-
|
|
44277
|
-
or
|
|
44278
|
-
|
|
44279
|
-
nv.addGraph(<generate Function>, <callback Function>)
|
|
44280
|
-
|
|
44281
|
-
The generate function should contain code that creates the NVD3 model, sets options
|
|
44282
|
-
on it, adds data to an SVG element, and invokes the chart model. The generate function
|
|
44283
|
-
should return the chart model. See examples/lineChart.html for a usage example.
|
|
44284
|
-
|
|
44285
|
-
The callback function is optional, and it is called when the generate function completes.
|
|
44286
|
-
*/
|
|
44287
|
-
nv.addGraph = function(obj) {
|
|
44288
|
-
if (typeof arguments[0] === typeof(Function)) {
|
|
44289
|
-
obj = {generate: arguments[0], callback: arguments[1]};
|
|
44290
|
-
}
|
|
44291
|
-
|
|
44292
|
-
nv.render.queue.push(obj);
|
|
44293
|
-
|
|
44294
|
-
if (!nv.render.active) {
|
|
44295
|
-
nv.render();
|
|
44296
|
-
}
|
|
44297
|
-
};
|
|
44298
|
-
|
|
44299
|
-
// Node/CommonJS exports
|
|
44300
|
-
if (true) {
|
|
44301
|
-
module.exports = nv;
|
|
44302
|
-
}
|
|
44303
|
-
|
|
44304
|
-
if (typeof(window) !== 'undefined') {
|
|
44305
|
-
window.nv = nv;
|
|
44306
|
-
}
|
|
44307
|
-
/* Facade for queueing DOM write operations
|
|
44308
|
-
* with Fastdom (https://github.com/wilsonpage/fastdom)
|
|
44309
|
-
* if available.
|
|
44310
|
-
* This could easily be extended to support alternate
|
|
44311
|
-
* implementations in the future.
|
|
44312
|
-
*/
|
|
44313
|
-
nv.dom.write = function(callback) {
|
|
44314
|
-
if (window.fastdom !== undefined) {
|
|
44315
|
-
return fastdom.mutate(callback);
|
|
44316
|
-
}
|
|
44317
|
-
return callback();
|
|
44318
|
-
};
|
|
44319
|
-
|
|
44320
|
-
/* Facade for queueing DOM read operations
|
|
44321
|
-
* with Fastdom (https://github.com/wilsonpage/fastdom)
|
|
44322
|
-
* if available.
|
|
44323
|
-
* This could easily be extended to support alternate
|
|
44324
|
-
* implementations in the future.
|
|
44325
|
-
*/
|
|
44326
|
-
nv.dom.read = function(callback) {
|
|
44327
|
-
if (window.fastdom !== undefined) {
|
|
44328
|
-
return fastdom.measure(callback);
|
|
44329
|
-
}
|
|
44330
|
-
return callback();
|
|
44331
|
-
};
|
|
44332
|
-
/* Utility class to handle creation of an interactive layer.
|
|
44333
|
-
This places a rectangle on top of the chart. When you mouse move over it, it sends a dispatch
|
|
44334
|
-
containing the X-coordinate. It can also render a vertical line where the mouse is located.
|
|
44335
|
-
|
|
44336
|
-
dispatch.elementMousemove is the important event to latch onto. It is fired whenever the mouse moves over
|
|
44337
|
-
the rectangle. The dispatch is given one object which contains the mouseX/Y location.
|
|
44338
|
-
It also has 'pointXValue', which is the conversion of mouseX to the x-axis scale.
|
|
44339
|
-
*/
|
|
44340
|
-
nv.interactiveGuideline = function() {
|
|
44341
|
-
"use strict";
|
|
44342
|
-
|
|
44343
|
-
var margin = { left: 0, top: 0 } //Pass the chart's top and left magins. Used to calculate the mouseX/Y.
|
|
44344
|
-
, width = null
|
|
44345
|
-
, height = null
|
|
44346
|
-
, xScale = d3.scale.linear()
|
|
44347
|
-
, dispatch = d3.dispatch('elementMousemove', 'elementMouseout', 'elementClick', 'elementDblclick', 'elementMouseDown', 'elementMouseUp')
|
|
44348
|
-
, showGuideLine = true
|
|
44349
|
-
, svgContainer = null // Must pass the chart's svg, we'll use its mousemove event.
|
|
44350
|
-
, tooltip = nv.models.tooltip()
|
|
44351
|
-
, isMSIE = window.ActiveXObject// Checkt if IE by looking for activeX. (excludes IE11)
|
|
44352
|
-
;
|
|
44353
|
-
|
|
44354
|
-
tooltip
|
|
44355
|
-
.duration(0)
|
|
44356
|
-
.hideDelay(0)
|
|
44357
|
-
.hidden(false);
|
|
44358
|
-
|
|
44359
|
-
function layer(selection) {
|
|
44360
|
-
selection.each(function(data) {
|
|
44361
|
-
var container = d3.select(this);
|
|
44362
|
-
var availableWidth = (width || 960), availableHeight = (height || 400);
|
|
44363
|
-
var wrap = container.selectAll("g.nv-wrap.nv-interactiveLineLayer")
|
|
44364
|
-
.data([data]);
|
|
44365
|
-
var wrapEnter = wrap.enter()
|
|
44366
|
-
.append("g").attr("class", " nv-wrap nv-interactiveLineLayer");
|
|
44367
|
-
wrapEnter.append("g").attr("class","nv-interactiveGuideLine");
|
|
44368
|
-
|
|
44369
|
-
if (!svgContainer) {
|
|
44370
|
-
return;
|
|
44371
|
-
}
|
|
44372
|
-
|
|
44373
|
-
function mouseHandler() {
|
|
44374
|
-
var mouseX = d3.event.clientX - this.getBoundingClientRect().left;
|
|
44375
|
-
var mouseY = d3.event.clientY - this.getBoundingClientRect().top;
|
|
43669
|
+
function mouseHandler() {
|
|
43670
|
+
var mouseX = d3.event.clientX - this.getBoundingClientRect().left;
|
|
43671
|
+
var mouseY = d3.event.clientY - this.getBoundingClientRect().top;
|
|
44376
43672
|
|
|
44377
43673
|
var subtractMargin = true;
|
|
44378
43674
|
var mouseOutAnyReason = false;
|
|
@@ -63424,206 +62720,1003 @@ nv.models.sunburst = function() {
|
|
|
63424
62720
|
});
|
|
63425
62721
|
}
|
|
63426
62722
|
|
|
63427
|
-
//zoom out to the center when the data is updated.
|
|
63428
|
-
zoomClick(nodes[nodes.length - 1])
|
|
62723
|
+
//zoom out to the center when the data is updated.
|
|
62724
|
+
zoomClick(nodes[nodes.length - 1])
|
|
62725
|
+
|
|
62726
|
+
|
|
62727
|
+
//remove unmatched elements ...
|
|
62728
|
+
cG.exit()
|
|
62729
|
+
.transition()
|
|
62730
|
+
.duration(duration)
|
|
62731
|
+
.attr('opacity',0)
|
|
62732
|
+
.each('end',function(d){
|
|
62733
|
+
var k = key(d);
|
|
62734
|
+
prevPositions[k] = undefined;
|
|
62735
|
+
})
|
|
62736
|
+
.remove();
|
|
62737
|
+
});
|
|
62738
|
+
|
|
62739
|
+
|
|
62740
|
+
renderWatch.renderEnd('sunburst immediate');
|
|
62741
|
+
return chart;
|
|
62742
|
+
}
|
|
62743
|
+
|
|
62744
|
+
//============================================================
|
|
62745
|
+
// Expose Public Variables
|
|
62746
|
+
//------------------------------------------------------------
|
|
62747
|
+
|
|
62748
|
+
chart.dispatch = dispatch;
|
|
62749
|
+
chart.options = nv.utils.optionsFunc.bind(chart);
|
|
62750
|
+
|
|
62751
|
+
chart._options = Object.create({}, {
|
|
62752
|
+
// simple options, just get/set the necessary values
|
|
62753
|
+
width: {get: function(){return width;}, set: function(_){width=_;}},
|
|
62754
|
+
height: {get: function(){return height;}, set: function(_){height=_;}},
|
|
62755
|
+
mode: {get: function(){return mode;}, set: function(_){mode=_;}},
|
|
62756
|
+
id: {get: function(){return id;}, set: function(_){id=_;}},
|
|
62757
|
+
duration: {get: function(){return duration;}, set: function(_){duration=_;}},
|
|
62758
|
+
groupColorByParent: {get: function(){return groupColorByParent;}, set: function(_){groupColorByParent=!!_;}},
|
|
62759
|
+
showLabels: {get: function(){return showLabels;}, set: function(_){showLabels=!!_}},
|
|
62760
|
+
labelFormat: {get: function(){return labelFormat;}, set: function(_){labelFormat=_}},
|
|
62761
|
+
labelThreshold: {get: function(){return labelThreshold;}, set: function(_){labelThreshold=_}},
|
|
62762
|
+
sort: {get: function(){return sort;}, set: function(_){sort=_}},
|
|
62763
|
+
key: {get: function(){return key;}, set: function(_){key=_}},
|
|
62764
|
+
// options that require extra logic in the setter
|
|
62765
|
+
margin: {get: function(){return margin;}, set: function(_){
|
|
62766
|
+
margin.top = _.top != undefined ? _.top : margin.top;
|
|
62767
|
+
margin.right = _.right != undefined ? _.right : margin.right;
|
|
62768
|
+
margin.bottom = _.bottom != undefined ? _.bottom : margin.bottom;
|
|
62769
|
+
margin.left = _.left != undefined ? _.left : margin.left;
|
|
62770
|
+
}},
|
|
62771
|
+
color: {get: function(){return color;}, set: function(_){
|
|
62772
|
+
color=nv.utils.getColor(_);
|
|
62773
|
+
}}
|
|
62774
|
+
});
|
|
62775
|
+
|
|
62776
|
+
nv.utils.initOptions(chart);
|
|
62777
|
+
return chart;
|
|
62778
|
+
};
|
|
62779
|
+
nv.models.sunburstChart = function() {
|
|
62780
|
+
"use strict";
|
|
62781
|
+
|
|
62782
|
+
//============================================================
|
|
62783
|
+
// Public Variables with Default Settings
|
|
62784
|
+
//------------------------------------------------------------
|
|
62785
|
+
|
|
62786
|
+
var sunburst = nv.models.sunburst();
|
|
62787
|
+
var tooltip = nv.models.tooltip();
|
|
62788
|
+
|
|
62789
|
+
var margin = {top: 30, right: 20, bottom: 20, left: 20}
|
|
62790
|
+
, width = null
|
|
62791
|
+
, height = null
|
|
62792
|
+
, color = nv.utils.defaultColor()
|
|
62793
|
+
, showTooltipPercent = false
|
|
62794
|
+
, id = Math.round(Math.random() * 100000)
|
|
62795
|
+
, defaultState = null
|
|
62796
|
+
, noData = null
|
|
62797
|
+
, duration = 250
|
|
62798
|
+
, dispatch = d3.dispatch('stateChange', 'changeState','renderEnd');
|
|
62799
|
+
|
|
62800
|
+
|
|
62801
|
+
//============================================================
|
|
62802
|
+
// Private Variables
|
|
62803
|
+
//------------------------------------------------------------
|
|
62804
|
+
|
|
62805
|
+
var renderWatch = nv.utils.renderWatch(dispatch);
|
|
62806
|
+
|
|
62807
|
+
tooltip
|
|
62808
|
+
.duration(0)
|
|
62809
|
+
.headerEnabled(false)
|
|
62810
|
+
.valueFormatter(function(d){return d;});
|
|
62811
|
+
|
|
62812
|
+
//============================================================
|
|
62813
|
+
// Chart function
|
|
62814
|
+
//------------------------------------------------------------
|
|
62815
|
+
|
|
62816
|
+
function chart(selection) {
|
|
62817
|
+
renderWatch.reset();
|
|
62818
|
+
renderWatch.models(sunburst);
|
|
62819
|
+
|
|
62820
|
+
selection.each(function(data) {
|
|
62821
|
+
var container = d3.select(this);
|
|
62822
|
+
|
|
62823
|
+
nv.utils.initSVG(container);
|
|
63429
62824
|
|
|
62825
|
+
var availableWidth = nv.utils.availableWidth(width, container, margin);
|
|
62826
|
+
var availableHeight = nv.utils.availableHeight(height, container, margin);
|
|
63430
62827
|
|
|
63431
|
-
|
|
63432
|
-
|
|
63433
|
-
|
|
63434
|
-
|
|
63435
|
-
|
|
63436
|
-
|
|
63437
|
-
|
|
63438
|
-
|
|
63439
|
-
})
|
|
63440
|
-
.remove();
|
|
63441
|
-
});
|
|
62828
|
+
chart.update = function() {
|
|
62829
|
+
if (duration === 0) {
|
|
62830
|
+
container.call(chart);
|
|
62831
|
+
} else {
|
|
62832
|
+
container.transition().duration(duration).call(chart);
|
|
62833
|
+
}
|
|
62834
|
+
};
|
|
62835
|
+
chart.container = container;
|
|
63442
62836
|
|
|
62837
|
+
// Display No Data message if there's nothing to show.
|
|
62838
|
+
if (!data || !data.length) {
|
|
62839
|
+
nv.utils.noData(chart, container);
|
|
62840
|
+
return chart;
|
|
62841
|
+
} else {
|
|
62842
|
+
container.selectAll('.nv-noData').remove();
|
|
62843
|
+
}
|
|
63443
62844
|
|
|
63444
|
-
|
|
62845
|
+
sunburst.width(availableWidth).height(availableHeight).margin(margin);
|
|
62846
|
+
container.call(sunburst);
|
|
62847
|
+
});
|
|
62848
|
+
|
|
62849
|
+
renderWatch.renderEnd('sunburstChart immediate');
|
|
63445
62850
|
return chart;
|
|
63446
62851
|
}
|
|
63447
62852
|
|
|
62853
|
+
//============================================================
|
|
62854
|
+
// Event Handling/Dispatching (out of chart's scope)
|
|
62855
|
+
//------------------------------------------------------------
|
|
62856
|
+
|
|
62857
|
+
sunburst.dispatch.on('elementMouseover.tooltip', function(evt) {
|
|
62858
|
+
evt.series = {
|
|
62859
|
+
key: evt.data.name,
|
|
62860
|
+
value: (evt.data.value || evt.data.size),
|
|
62861
|
+
color: evt.color,
|
|
62862
|
+
percent: evt.percent
|
|
62863
|
+
};
|
|
62864
|
+
if (!showTooltipPercent) {
|
|
62865
|
+
delete evt.percent;
|
|
62866
|
+
delete evt.series.percent;
|
|
62867
|
+
}
|
|
62868
|
+
tooltip.data(evt).hidden(false);
|
|
62869
|
+
});
|
|
62870
|
+
|
|
62871
|
+
sunburst.dispatch.on('elementMouseout.tooltip', function(evt) {
|
|
62872
|
+
tooltip.hidden(true);
|
|
62873
|
+
});
|
|
62874
|
+
|
|
62875
|
+
sunburst.dispatch.on('elementMousemove.tooltip', function(evt) {
|
|
62876
|
+
tooltip();
|
|
62877
|
+
});
|
|
62878
|
+
|
|
63448
62879
|
//============================================================
|
|
63449
62880
|
// Expose Public Variables
|
|
63450
62881
|
//------------------------------------------------------------
|
|
63451
62882
|
|
|
62883
|
+
// expose chart's sub-components
|
|
63452
62884
|
chart.dispatch = dispatch;
|
|
62885
|
+
chart.sunburst = sunburst;
|
|
62886
|
+
chart.tooltip = tooltip;
|
|
63453
62887
|
chart.options = nv.utils.optionsFunc.bind(chart);
|
|
63454
62888
|
|
|
62889
|
+
// use Object get/set functionality to map between vars and chart functions
|
|
63455
62890
|
chart._options = Object.create({}, {
|
|
63456
62891
|
// simple options, just get/set the necessary values
|
|
63457
|
-
|
|
63458
|
-
|
|
63459
|
-
|
|
63460
|
-
|
|
63461
|
-
duration: {get: function(){return duration;}, set: function(_){duration=_;}},
|
|
63462
|
-
groupColorByParent: {get: function(){return groupColorByParent;}, set: function(_){groupColorByParent=!!_;}},
|
|
63463
|
-
showLabels: {get: function(){return showLabels;}, set: function(_){showLabels=!!_}},
|
|
63464
|
-
labelFormat: {get: function(){return labelFormat;}, set: function(_){labelFormat=_}},
|
|
63465
|
-
labelThreshold: {get: function(){return labelThreshold;}, set: function(_){labelThreshold=_}},
|
|
63466
|
-
sort: {get: function(){return sort;}, set: function(_){sort=_}},
|
|
63467
|
-
key: {get: function(){return key;}, set: function(_){key=_}},
|
|
62892
|
+
noData: {get: function(){return noData;}, set: function(_){noData=_;}},
|
|
62893
|
+
defaultState: {get: function(){return defaultState;}, set: function(_){defaultState=_;}},
|
|
62894
|
+
showTooltipPercent: {get: function(){return showTooltipPercent;}, set: function(_){showTooltipPercent=_;}},
|
|
62895
|
+
|
|
63468
62896
|
// options that require extra logic in the setter
|
|
63469
|
-
margin: {get: function(){return margin;}, set: function(_){
|
|
63470
|
-
margin.top = _.top != undefined ? _.top : margin.top;
|
|
63471
|
-
margin.right = _.right != undefined ? _.right : margin.right;
|
|
63472
|
-
margin.bottom = _.bottom != undefined ? _.bottom : margin.bottom;
|
|
63473
|
-
margin.left = _.left != undefined ? _.left : margin.left;
|
|
63474
|
-
}},
|
|
63475
62897
|
color: {get: function(){return color;}, set: function(_){
|
|
63476
|
-
color=
|
|
62898
|
+
color = _;
|
|
62899
|
+
sunburst.color(color);
|
|
62900
|
+
}},
|
|
62901
|
+
duration: {get: function(){return duration;}, set: function(_){
|
|
62902
|
+
duration = _;
|
|
62903
|
+
renderWatch.reset(duration);
|
|
62904
|
+
sunburst.duration(duration);
|
|
62905
|
+
}},
|
|
62906
|
+
margin: {get: function(){return margin;}, set: function(_){
|
|
62907
|
+
margin.top = _.top !== undefined ? _.top : margin.top;
|
|
62908
|
+
margin.right = _.right !== undefined ? _.right : margin.right;
|
|
62909
|
+
margin.bottom = _.bottom !== undefined ? _.bottom : margin.bottom;
|
|
62910
|
+
margin.left = _.left !== undefined ? _.left : margin.left;
|
|
62911
|
+
sunburst.margin(margin);
|
|
63477
62912
|
}}
|
|
63478
62913
|
});
|
|
63479
|
-
|
|
62914
|
+
nv.utils.inheritOptions(chart, sunburst);
|
|
63480
62915
|
nv.utils.initOptions(chart);
|
|
63481
62916
|
return chart;
|
|
62917
|
+
|
|
62918
|
+
};
|
|
62919
|
+
|
|
62920
|
+
nv.version = "1.8.6-dev";
|
|
62921
|
+
})();
|
|
62922
|
+
//# sourceMappingURL=nv.d3.js.map
|
|
62923
|
+
|
|
62924
|
+
/***/ }),
|
|
62925
|
+
/* 36 */
|
|
62926
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
62927
|
+
|
|
62928
|
+
"use strict";
|
|
62929
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hostReportError; });
|
|
62930
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
62931
|
+
function hostReportError(err) {
|
|
62932
|
+
setTimeout(function () { throw err; }, 0);
|
|
62933
|
+
}
|
|
62934
|
+
//# sourceMappingURL=hostReportError.js.map
|
|
62935
|
+
|
|
62936
|
+
|
|
62937
|
+
/***/ }),
|
|
62938
|
+
/* 37 */
|
|
62939
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
62940
|
+
|
|
62941
|
+
"use strict";
|
|
62942
|
+
|
|
62943
|
+
// EXTERNAL MODULE: external "@angular/core"
|
|
62944
|
+
var core_ = __webpack_require__(0);
|
|
62945
|
+
|
|
62946
|
+
// EXTERNAL MODULE: ./node_modules/lodash/lodash.js
|
|
62947
|
+
var lodash = __webpack_require__(2);
|
|
62948
|
+
|
|
62949
|
+
// EXTERNAL MODULE: ./.tmp/localization/index.ts + 1 modules
|
|
62950
|
+
var _tmp_localization = __webpack_require__(9);
|
|
62951
|
+
|
|
62952
|
+
// EXTERNAL MODULE: ./.tmp/settings/index.ts + 2 modules
|
|
62953
|
+
var settings = __webpack_require__(16);
|
|
62954
|
+
|
|
62955
|
+
// EXTERNAL MODULE: ./.tmp/logger/index.ts + 2 modules
|
|
62956
|
+
var logger = __webpack_require__(7);
|
|
62957
|
+
|
|
62958
|
+
// EXTERNAL MODULE: ./.tmp/shared/index.ts + 3 modules
|
|
62959
|
+
var shared = __webpack_require__(5);
|
|
62960
|
+
|
|
62961
|
+
// EXTERNAL MODULE: ./.tmp/view/view.service.ts
|
|
62962
|
+
var view_service = __webpack_require__(27);
|
|
62963
|
+
|
|
62964
|
+
// EXTERNAL MODULE: ./.tmp/gui/gui-view.ts + 126 modules
|
|
62965
|
+
var gui_view = __webpack_require__(32);
|
|
62966
|
+
|
|
62967
|
+
// EXTERNAL MODULE: external "rxjs/operators"
|
|
62968
|
+
var operators_ = __webpack_require__(17);
|
|
62969
|
+
|
|
62970
|
+
// CONCATENATED MODULE: ./.tmp/gui/gui-host.ts
|
|
62971
|
+
|
|
62972
|
+
|
|
62973
|
+
|
|
62974
|
+
|
|
62975
|
+
|
|
62976
|
+
class gui_host_GuiHost {
|
|
62977
|
+
constructor(injector, bsModalService, context, guiOptions, el) {
|
|
62978
|
+
this.injector = injector;
|
|
62979
|
+
this.bsModalService = bsModalService;
|
|
62980
|
+
this.context = context;
|
|
62981
|
+
this.guiOptions = guiOptions;
|
|
62982
|
+
this.el = el;
|
|
62983
|
+
this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
|
|
62984
|
+
const toggleViewFunc = (viewIndex, parentContainerId, baseEl) => {
|
|
62985
|
+
this.currentViewIndex = viewIndex;
|
|
62986
|
+
return this.context.configStore.viewStore.getViewConfig(viewIndex).pipe(Object(operators_["map"])(config => {
|
|
62987
|
+
if (this.currentViewIndex !== viewIndex) {
|
|
62988
|
+
return;
|
|
62989
|
+
}
|
|
62990
|
+
if (!config || !config.config || !config.config.length) {
|
|
62991
|
+
throw new shared["a" /* ConfigIsEmptyError */]();
|
|
62992
|
+
}
|
|
62993
|
+
if (this.currentView) {
|
|
62994
|
+
this.currentView.dispose();
|
|
62995
|
+
}
|
|
62996
|
+
this.currentView = new gui_view["a" /* GuiView */](this.injector, this.bsModalService, this.context);
|
|
62997
|
+
const hostGuiOptions = {
|
|
62998
|
+
svgRootClass: this.guiOptions.svgRootClass,
|
|
62999
|
+
hostContainerId: parentContainerId,
|
|
63000
|
+
el: baseEl
|
|
63001
|
+
};
|
|
63002
|
+
this.currentView.load(config, hostGuiOptions);
|
|
63003
|
+
this.currentView.resize(this.currentViewSize, this.currentViewReiszeMode, this.guiOptions.svgRootClass);
|
|
63004
|
+
this.containerEl = $(baseEl.nativeElement).find(`div#${parentContainerId}`).first();
|
|
63005
|
+
this.containerEl.empty();
|
|
63006
|
+
this.containerEl.append(this.currentView.element);
|
|
63007
|
+
this.logger.debug(`[GUI] Toggle View(${viewIndex}) successed.`);
|
|
63008
|
+
}));
|
|
63009
|
+
};
|
|
63010
|
+
injector.get(view_service["a" /* ViewService */]).toggleViews.set(el, toggleViewFunc);
|
|
63011
|
+
}
|
|
63012
|
+
get element() {
|
|
63013
|
+
if (this.containerEl) {
|
|
63014
|
+
return this.containerEl[0];
|
|
63015
|
+
}
|
|
63016
|
+
else {
|
|
63017
|
+
throw new Error('Gui Host not loaded yet.');
|
|
63018
|
+
}
|
|
63019
|
+
}
|
|
63020
|
+
/**
|
|
63021
|
+
* Load gui host and main view.
|
|
63022
|
+
*/
|
|
63023
|
+
load(configureViewId) {
|
|
63024
|
+
if (this.isLoaded) {
|
|
63025
|
+
throw new Error('The GuiHost already loaded.');
|
|
63026
|
+
}
|
|
63027
|
+
this.isLoaded = true;
|
|
63028
|
+
this.containerEl = $(`<div class="svg-content" id= "${this.guiOptions.hostContainerId}" style="display:flex;position:relative;"></div>`);
|
|
63029
|
+
const result = new Promise((resolve, reject) => {
|
|
63030
|
+
if (configureViewId && configureViewId !== 0) {
|
|
63031
|
+
this.loadViewConfigByConfigureViewId(resolve, reject, configureViewId);
|
|
63032
|
+
}
|
|
63033
|
+
else {
|
|
63034
|
+
this.loadMainViewConfig(resolve, reject);
|
|
63035
|
+
}
|
|
63036
|
+
});
|
|
63037
|
+
return result;
|
|
63038
|
+
}
|
|
63039
|
+
loadByConfigureViewCode(configureViewCode) {
|
|
63040
|
+
if (this.isLoaded) {
|
|
63041
|
+
throw new Error('The GuiHost already loaded.');
|
|
63042
|
+
}
|
|
63043
|
+
this.isLoaded = true;
|
|
63044
|
+
this.containerEl = $(`<div class="svg-content" id= "${this.guiOptions.hostContainerId}" style="display: inline-block;position: relative;"></div>`);
|
|
63045
|
+
const result = new Promise((resolve, reject) => {
|
|
63046
|
+
if (configureViewCode) {
|
|
63047
|
+
this.loadViewConfigByConfigureViewCode(resolve, reject, configureViewCode);
|
|
63048
|
+
}
|
|
63049
|
+
else {
|
|
63050
|
+
this.loadMainViewConfig(resolve, reject);
|
|
63051
|
+
}
|
|
63052
|
+
});
|
|
63053
|
+
return result;
|
|
63054
|
+
}
|
|
63055
|
+
loadMainViewConfig(resolve, reject) {
|
|
63056
|
+
this.context.configStore.viewStore.getMainViewConfig().subscribe(config => {
|
|
63057
|
+
if (config.config && config.config.length) {
|
|
63058
|
+
this.currentView = new gui_view["a" /* GuiView */](this.injector, this.bsModalService, this.context);
|
|
63059
|
+
this.currentView.load(config, this.guiOptions);
|
|
63060
|
+
this.containerEl.empty();
|
|
63061
|
+
this.containerEl.append(this.currentView.element);
|
|
63062
|
+
resolve(this);
|
|
63063
|
+
this.logger.debug('[GUI] Host loaded.');
|
|
63064
|
+
}
|
|
63065
|
+
else {
|
|
63066
|
+
reject(new shared["a" /* ConfigIsEmptyError */]());
|
|
63067
|
+
}
|
|
63068
|
+
}, error => {
|
|
63069
|
+
this.logger.error('[GUI] Load failed: ' + error.stack);
|
|
63070
|
+
reject(error);
|
|
63071
|
+
});
|
|
63072
|
+
}
|
|
63073
|
+
loadViewConfigByConfigureViewId(resolve, reject, configureViewId) {
|
|
63074
|
+
this.context.configStore.viewStore.getViewConfigByConfigureViewId(configureViewId).subscribe(config => {
|
|
63075
|
+
this.handleViewConfigCallback(resolve, reject, config);
|
|
63076
|
+
}, error => {
|
|
63077
|
+
this.logger.error('[GUI] Load failed: ' + error.stack);
|
|
63078
|
+
reject(error);
|
|
63079
|
+
});
|
|
63080
|
+
}
|
|
63081
|
+
loadViewConfigByConfigureViewCode(resolve, reject, configureViewCode) {
|
|
63082
|
+
this.context.configStore.viewStore.getViewConfigByConfigureViewCode(configureViewCode).subscribe(config => {
|
|
63083
|
+
this.handleViewConfigCallback(resolve, reject, config);
|
|
63084
|
+
}, error => {
|
|
63085
|
+
this.logger.error('[GUI] Load failed: ' + error.stack);
|
|
63086
|
+
reject(error);
|
|
63087
|
+
});
|
|
63088
|
+
}
|
|
63089
|
+
handleViewConfigCallback(resolve, reject, config) {
|
|
63090
|
+
if (!config.config || !config.config.length) {
|
|
63091
|
+
reject(new shared["a" /* ConfigIsEmptyError */]());
|
|
63092
|
+
}
|
|
63093
|
+
this.currentView = new gui_view["a" /* GuiView */](this.injector, this.bsModalService, this.context);
|
|
63094
|
+
this.currentView.load(config, this.guiOptions);
|
|
63095
|
+
this.containerEl.empty();
|
|
63096
|
+
this.containerEl.append(this.currentView.element);
|
|
63097
|
+
resolve(this);
|
|
63098
|
+
this.logger.debug('[GUI] Host loaded.');
|
|
63099
|
+
}
|
|
63100
|
+
/**
|
|
63101
|
+
* Resize current view
|
|
63102
|
+
* @param size : target view size
|
|
63103
|
+
* @param resizeMode : target resize mode
|
|
63104
|
+
*/
|
|
63105
|
+
resizeView(size, resizeMode) {
|
|
63106
|
+
if (this.currentView) {
|
|
63107
|
+
this.currentView.resize(size, resizeMode, this.guiOptions.svgRootClass);
|
|
63108
|
+
this.currentViewSize = size;
|
|
63109
|
+
this.currentViewReiszeMode = resizeMode;
|
|
63110
|
+
}
|
|
63111
|
+
}
|
|
63112
|
+
/**
|
|
63113
|
+
* Update current view size;
|
|
63114
|
+
* @param size : target view size
|
|
63115
|
+
*/
|
|
63116
|
+
updateViewSize(size) {
|
|
63117
|
+
if (!this.currentView) {
|
|
63118
|
+
return;
|
|
63119
|
+
}
|
|
63120
|
+
this.currentView.resize(size, this.currentViewReiszeMode, this.guiOptions.svgRootClass);
|
|
63121
|
+
this.currentViewSize = size;
|
|
63122
|
+
}
|
|
63123
|
+
/**
|
|
63124
|
+
* Resize current view
|
|
63125
|
+
* @param size : target view size
|
|
63126
|
+
* @param resizeMode : target resize mode
|
|
63127
|
+
*/
|
|
63128
|
+
updateViewResizeMode(resizeMode) {
|
|
63129
|
+
if (this.currentView) {
|
|
63130
|
+
this.currentView.resize(this.currentViewSize, resizeMode, this.guiOptions.svgRootClass);
|
|
63131
|
+
this.currentViewReiszeMode = resizeMode;
|
|
63132
|
+
}
|
|
63133
|
+
}
|
|
63134
|
+
dispose() {
|
|
63135
|
+
if (this.currentView) {
|
|
63136
|
+
this.currentView.dispose();
|
|
63137
|
+
}
|
|
63138
|
+
if (this.context) {
|
|
63139
|
+
this.context.dispose();
|
|
63140
|
+
}
|
|
63141
|
+
this.logger.debug('[GUI] GuiHost disposed.');
|
|
63142
|
+
}
|
|
63143
|
+
}
|
|
63144
|
+
|
|
63145
|
+
// EXTERNAL MODULE: ./.tmp/utils/guid.ts
|
|
63146
|
+
var guid = __webpack_require__(28);
|
|
63147
|
+
|
|
63148
|
+
// CONCATENATED MODULE: ./.tmp/gui/gui.component.ts
|
|
63149
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return gui_component_GuiComponent; });
|
|
63150
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
63151
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
63152
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
63153
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
63154
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
63155
|
+
};
|
|
63156
|
+
var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
|
|
63157
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
63158
|
+
};
|
|
63159
|
+
|
|
63160
|
+
|
|
63161
|
+
|
|
63162
|
+
|
|
63163
|
+
|
|
63164
|
+
|
|
63165
|
+
|
|
63166
|
+
let gui_component_GuiComponent = class GuiComponent {
|
|
63167
|
+
constructor(el, localization, injector, bsModalService) {
|
|
63168
|
+
this.el = el;
|
|
63169
|
+
this.localization = localization;
|
|
63170
|
+
this.injector = injector;
|
|
63171
|
+
this.bsModalService = bsModalService;
|
|
63172
|
+
this.loadFailed = new core_["EventEmitter"]();
|
|
63173
|
+
this.loaded = new core_["EventEmitter"]();
|
|
63174
|
+
this.lastScale = 1;
|
|
63175
|
+
this.isMobileMode = false;
|
|
63176
|
+
this.globalSettings = this.injector.get(settings["b" /* GlobalSettings */]);
|
|
63177
|
+
this.viewService = injector.get(view_service["a" /* ViewService */]);
|
|
63178
|
+
}
|
|
63179
|
+
get viewResizeMode() {
|
|
63180
|
+
switch (this.resizeMode) {
|
|
63181
|
+
case 'HorizontalUniform':
|
|
63182
|
+
return settings["c" /* ViewResizeMode */].HorizontalUniform;
|
|
63183
|
+
default:
|
|
63184
|
+
return settings["c" /* ViewResizeMode */].Uniform;
|
|
63185
|
+
}
|
|
63186
|
+
}
|
|
63187
|
+
ngOnChanges(changes) {
|
|
63188
|
+
if (changes.displayMode) {
|
|
63189
|
+
this.onDisplayModeChanged(changes.displayMode.previousValue, changes.displayMode.currentValue);
|
|
63190
|
+
}
|
|
63191
|
+
if (changes.context) {
|
|
63192
|
+
this.onProviderChanged(changes.context.previousValue, changes.context.currentValue);
|
|
63193
|
+
}
|
|
63194
|
+
if (changes.size) {
|
|
63195
|
+
this.onSizeChanged(changes.size.previousValue, changes.size.currentValue);
|
|
63196
|
+
}
|
|
63197
|
+
if (changes.resizeMode) {
|
|
63198
|
+
this.onResizeModeChanged(changes.resizeMode.previousValue, changes.resizeMode.currentValue);
|
|
63199
|
+
}
|
|
63200
|
+
}
|
|
63201
|
+
doubleFingerZooming() {
|
|
63202
|
+
const scaleElement = this.$svg.find('div.svg-content').first()[0];
|
|
63203
|
+
const self = this;
|
|
63204
|
+
self.initWidth = scaleElement.offsetWidth;
|
|
63205
|
+
self.initHeight = scaleElement.offsetHeight;
|
|
63206
|
+
self.lastScale = 1;
|
|
63207
|
+
scaleElement.addEventListener('touchstart', function (e) {
|
|
63208
|
+
self.pageX = e.targetTouches[0].pageX;
|
|
63209
|
+
self.pageY = e.targetTouches[0].pageY;
|
|
63210
|
+
self.initX = !Object(lodash["isNaN"])(parseInt(scaleElement.style.left, 10)) ? parseInt(scaleElement.style.left, 10) : 0;
|
|
63211
|
+
self.initY = !Object(lodash["isNaN"])(parseInt(scaleElement.style.top, 10)) ? parseInt(scaleElement.style.top, 10) : 0;
|
|
63212
|
+
if (e.touches.length >= 2) {
|
|
63213
|
+
self.startTouch = e.touches;
|
|
63214
|
+
}
|
|
63215
|
+
self.isTouch = true;
|
|
63216
|
+
}, false);
|
|
63217
|
+
scaleElement.addEventListener('touchmove', function (e) {
|
|
63218
|
+
if (e.touches.length === 1 && self.isTouch && self.lastScale > 1) {
|
|
63219
|
+
e.preventDefault();
|
|
63220
|
+
const touchMoveX = e.targetTouches[0].pageX, touchMoveY = e.targetTouches[0].pageY;
|
|
63221
|
+
const left = Number(touchMoveX) - Number(self.pageX) + Number(self.initX);
|
|
63222
|
+
const top = Number(touchMoveY) - Number(self.pageY) + Number(self.initY);
|
|
63223
|
+
if (left > -(self.lastScale - 1) * self.initWidth / 2 && left < (self.lastScale - 1) * self.initWidth / 2) {
|
|
63224
|
+
scaleElement.style.left = left + 'px';
|
|
63225
|
+
}
|
|
63226
|
+
if (top > -(self.lastScale - 1) * self.initHeight / 2 && top < (self.lastScale - 1) * self.initHeight / 2) {
|
|
63227
|
+
scaleElement.style.top = top + 'px';
|
|
63228
|
+
}
|
|
63229
|
+
}
|
|
63230
|
+
if (e.touches.length >= 2 && self.isTouch) {
|
|
63231
|
+
e.preventDefault();
|
|
63232
|
+
const now = e.touches;
|
|
63233
|
+
const scale = (self.getDistance(now[0], now[1]) / self.getDistance(self.startTouch[0], self.startTouch[1]));
|
|
63234
|
+
let nowScale = self.lastScale;
|
|
63235
|
+
if (scale >= 1) {
|
|
63236
|
+
nowScale *= 1.008;
|
|
63237
|
+
}
|
|
63238
|
+
if (nowScale < 1) {
|
|
63239
|
+
nowScale = 1;
|
|
63240
|
+
}
|
|
63241
|
+
if (nowScale > 5) {
|
|
63242
|
+
nowScale = 5;
|
|
63243
|
+
}
|
|
63244
|
+
if (scale < 1) {
|
|
63245
|
+
nowScale *= 0.992;
|
|
63246
|
+
scaleElement.style.left = -(nowScale - 1) * self.initWidth / 8 + 'px';
|
|
63247
|
+
scaleElement.style.top = -(nowScale - 1) * self.initHeight / 8 + 'px';
|
|
63248
|
+
}
|
|
63249
|
+
scaleElement.style.transform = 'scale(' + nowScale + ')';
|
|
63250
|
+
self.lastScale = nowScale;
|
|
63251
|
+
}
|
|
63252
|
+
}, false);
|
|
63253
|
+
scaleElement.addEventListener('touchend', function () {
|
|
63254
|
+
if (self.isTouch) {
|
|
63255
|
+
self.isTouch = false;
|
|
63256
|
+
}
|
|
63257
|
+
}, false);
|
|
63258
|
+
}
|
|
63259
|
+
getDistance(p1, p2) {
|
|
63260
|
+
const x = p2.pageX - p1.pageX, y = p2.pageY - p1.pageY;
|
|
63261
|
+
return Math.sqrt((x * x) + (y * y));
|
|
63262
|
+
}
|
|
63263
|
+
ngOnDestroy() {
|
|
63264
|
+
if (this.host) {
|
|
63265
|
+
this.host.dispose();
|
|
63266
|
+
}
|
|
63267
|
+
}
|
|
63268
|
+
onProviderChanged(oldValue, newValue) {
|
|
63269
|
+
if (Object(lodash["isEqual"])(oldValue, newValue)) {
|
|
63270
|
+
return;
|
|
63271
|
+
}
|
|
63272
|
+
if (this.host) {
|
|
63273
|
+
this.host.dispose();
|
|
63274
|
+
this.host = null;
|
|
63275
|
+
}
|
|
63276
|
+
if (newValue) {
|
|
63277
|
+
this.$svg = $(this.el.nativeElement).find('div.svgView').first();
|
|
63278
|
+
this.$svg.empty();
|
|
63279
|
+
const svgRootClass = 'S' + guid["a" /* Guid */].newGuid().toString('n');
|
|
63280
|
+
this.hostContainerId = 'H' + guid["a" /* Guid */].newGuid().toString('n');
|
|
63281
|
+
this.$svg.addClass(svgRootClass);
|
|
63282
|
+
const guiOptions = {
|
|
63283
|
+
svgRootClass: svgRootClass,
|
|
63284
|
+
hostContainerId: this.hostContainerId,
|
|
63285
|
+
el: this.el
|
|
63286
|
+
};
|
|
63287
|
+
const host = new gui_host_GuiHost(this.injector, this.bsModalService, newValue, guiOptions, this.el);
|
|
63288
|
+
/*
|
|
63289
|
+
* if configureViewCode exist then load by configureViewCode else load by configureViewId
|
|
63290
|
+
*/
|
|
63291
|
+
(this.context.configureViewCode ? host.loadByConfigureViewCode(this.context.configureViewCode) :
|
|
63292
|
+
host.load(this.context.configureViewId)).then(t => {
|
|
63293
|
+
// 加载结束后,如果context发生了变化,直接返回。
|
|
63294
|
+
if (!Object(lodash["isEqual"])(this.context, t.context)) {
|
|
63295
|
+
t.dispose();
|
|
63296
|
+
return;
|
|
63297
|
+
}
|
|
63298
|
+
this.host = host;
|
|
63299
|
+
this.host.resizeView(this.size, this.viewResizeMode);
|
|
63300
|
+
this.$svg.append(t.element);
|
|
63301
|
+
if (this.isMobileMode) {
|
|
63302
|
+
this.doubleFingerZooming();
|
|
63303
|
+
}
|
|
63304
|
+
this.loaded.emit();
|
|
63305
|
+
}).catch(error => {
|
|
63306
|
+
this.$svg.append(`<p>${this.localization.loadFailed}</p>`);
|
|
63307
|
+
this.loadFailed.emit(error);
|
|
63308
|
+
});
|
|
63309
|
+
}
|
|
63310
|
+
else {
|
|
63311
|
+
if (this.$svg) {
|
|
63312
|
+
this.$svg.empty();
|
|
63313
|
+
}
|
|
63314
|
+
this.host = null;
|
|
63315
|
+
}
|
|
63316
|
+
}
|
|
63317
|
+
onSizeChanged(oldValue, newValue) {
|
|
63318
|
+
if (!this.host || Object(lodash["isEqual"])(oldValue, newValue)) {
|
|
63319
|
+
return;
|
|
63320
|
+
}
|
|
63321
|
+
this.host.updateViewSize(newValue);
|
|
63322
|
+
if (this.isMobileMode) {
|
|
63323
|
+
this.doubleFingerZooming();
|
|
63324
|
+
}
|
|
63325
|
+
}
|
|
63326
|
+
onResizeModeChanged(oldValue, newValue) {
|
|
63327
|
+
if (!this.host || Object(lodash["isEqual"])(oldValue, newValue)) {
|
|
63328
|
+
return;
|
|
63329
|
+
}
|
|
63330
|
+
this.host.updateViewResizeMode(this.viewResizeMode);
|
|
63331
|
+
}
|
|
63332
|
+
onDisplayModeChanged(oldValue, newValue) {
|
|
63333
|
+
if (Object(lodash["isEqual"])(oldValue, newValue)) {
|
|
63334
|
+
return;
|
|
63335
|
+
}
|
|
63336
|
+
this.isMobileMode = this.displayMode === 'Mobile';
|
|
63337
|
+
this.globalSettings.displayMode = this.isMobileMode ? settings["a" /* DisplayMode */].Mobile : settings["a" /* DisplayMode */].Web;
|
|
63338
|
+
}
|
|
63339
|
+
refreshCurrentPage() {
|
|
63340
|
+
if (this.host.currentViewIndex === undefined) {
|
|
63341
|
+
return false;
|
|
63342
|
+
}
|
|
63343
|
+
const toggleView = this.viewService.toggleViews.get(this.el);
|
|
63344
|
+
if (!toggleView) {
|
|
63345
|
+
return false;
|
|
63346
|
+
}
|
|
63347
|
+
toggleView(this.host.currentViewIndex, this.hostContainerId, this.el).subscribe();
|
|
63348
|
+
return true;
|
|
63349
|
+
}
|
|
63482
63350
|
};
|
|
63483
|
-
|
|
63484
|
-
"
|
|
63485
|
-
|
|
63486
|
-
|
|
63487
|
-
|
|
63488
|
-
|
|
63489
|
-
|
|
63490
|
-
|
|
63491
|
-
|
|
63492
|
-
|
|
63493
|
-
|
|
63494
|
-
|
|
63495
|
-
|
|
63496
|
-
|
|
63497
|
-
|
|
63498
|
-
|
|
63499
|
-
|
|
63500
|
-
|
|
63501
|
-
|
|
63502
|
-
|
|
63503
|
-
|
|
63504
|
-
|
|
63505
|
-
|
|
63506
|
-
|
|
63507
|
-
|
|
63508
|
-
|
|
63509
|
-
var renderWatch = nv.utils.renderWatch(dispatch);
|
|
63510
|
-
|
|
63511
|
-
tooltip
|
|
63512
|
-
.duration(0)
|
|
63513
|
-
.headerEnabled(false)
|
|
63514
|
-
.valueFormatter(function(d){return d;});
|
|
63515
|
-
|
|
63516
|
-
//============================================================
|
|
63517
|
-
// Chart function
|
|
63518
|
-
//------------------------------------------------------------
|
|
63519
|
-
|
|
63520
|
-
function chart(selection) {
|
|
63521
|
-
renderWatch.reset();
|
|
63522
|
-
renderWatch.models(sunburst);
|
|
63523
|
-
|
|
63524
|
-
selection.each(function(data) {
|
|
63525
|
-
var container = d3.select(this);
|
|
63351
|
+
__decorate([
|
|
63352
|
+
Object(core_["Input"])()
|
|
63353
|
+
], gui_component_GuiComponent.prototype, "context", void 0);
|
|
63354
|
+
__decorate([
|
|
63355
|
+
Object(core_["Input"])()
|
|
63356
|
+
], gui_component_GuiComponent.prototype, "size", void 0);
|
|
63357
|
+
__decorate([
|
|
63358
|
+
Object(core_["Input"])()
|
|
63359
|
+
], gui_component_GuiComponent.prototype, "resizeMode", void 0);
|
|
63360
|
+
__decorate([
|
|
63361
|
+
Object(core_["Input"])()
|
|
63362
|
+
], gui_component_GuiComponent.prototype, "displayMode", void 0);
|
|
63363
|
+
__decorate([
|
|
63364
|
+
Object(core_["Output"])()
|
|
63365
|
+
], gui_component_GuiComponent.prototype, "loadFailed", void 0);
|
|
63366
|
+
__decorate([
|
|
63367
|
+
Object(core_["Output"])()
|
|
63368
|
+
], gui_component_GuiComponent.prototype, "loaded", void 0);
|
|
63369
|
+
gui_component_GuiComponent = __decorate([
|
|
63370
|
+
Object(core_["Component"])({
|
|
63371
|
+
selector: 'fc-gui',
|
|
63372
|
+
template: "<div> <div class='svgView' style=\"position: relative;display: flex;justify-content: center;align-items: center;\"></div> </div> "
|
|
63373
|
+
}),
|
|
63374
|
+
__param(1, Object(core_["Inject"])(_tmp_localization["b" /* LOCALIZATION */]))
|
|
63375
|
+
], gui_component_GuiComponent);
|
|
63526
63376
|
|
|
63527
|
-
|
|
63377
|
+
|
|
63378
|
+
|
|
63379
|
+
/***/ }),
|
|
63380
|
+
/* 38 */
|
|
63381
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
63382
|
+
|
|
63383
|
+
"use strict";
|
|
63384
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return WriteValueModalComponent; });
|
|
63385
|
+
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
63386
|
+
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
63387
|
+
/* harmony import */ var _localization__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
|
|
63388
|
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
|
|
63389
|
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
|
|
63390
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
63391
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
63392
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
63393
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
63394
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
63395
|
+
};
|
|
63396
|
+
var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
|
|
63397
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
63398
|
+
};
|
|
63528
63399
|
|
|
63529
|
-
var availableWidth = nv.utils.availableWidth(width, container, margin);
|
|
63530
|
-
var availableHeight = nv.utils.availableHeight(height, container, margin);
|
|
63531
63400
|
|
|
63532
|
-
chart.update = function() {
|
|
63533
|
-
if (duration === 0) {
|
|
63534
|
-
container.call(chart);
|
|
63535
|
-
} else {
|
|
63536
|
-
container.transition().duration(duration).call(chart);
|
|
63537
|
-
}
|
|
63538
|
-
};
|
|
63539
|
-
chart.container = container;
|
|
63540
63401
|
|
|
63541
|
-
|
|
63542
|
-
|
|
63543
|
-
|
|
63544
|
-
|
|
63545
|
-
|
|
63546
|
-
|
|
63402
|
+
let WriteValueModalComponent = class WriteValueModalComponent {
|
|
63403
|
+
constructor(localization, dataTypeService, fractionDigitService, numericalOperationService, bsModalRef) {
|
|
63404
|
+
this.localization = localization;
|
|
63405
|
+
this.dataTypeService = dataTypeService;
|
|
63406
|
+
this.fractionDigitService = fractionDigitService;
|
|
63407
|
+
this.numericalOperationService = numericalOperationService;
|
|
63408
|
+
this.bsModalRef = bsModalRef;
|
|
63409
|
+
this.writeValueRangeText = '';
|
|
63410
|
+
this.isSubmitting = false;
|
|
63411
|
+
}
|
|
63412
|
+
get invalidErrorText() {
|
|
63413
|
+
return this.localization.loadFailed;
|
|
63414
|
+
}
|
|
63415
|
+
ngOnInit() {
|
|
63416
|
+
this.initData(this.args);
|
|
63417
|
+
this.validate();
|
|
63418
|
+
}
|
|
63419
|
+
initData(option) {
|
|
63420
|
+
this.variableName = option.variableName;
|
|
63421
|
+
this.dataType = option.dataType;
|
|
63422
|
+
this.fBoxDataType = option.fBoxDataType;
|
|
63423
|
+
this.integerDigits = option.integerDigits ? option.integerDigits : 0;
|
|
63424
|
+
this.fractionDigits = option.fractionDigits ? option.fractionDigits : 0;
|
|
63425
|
+
this.valueType = this.dataTypeService.getValueType(option.version, option.dataType);
|
|
63426
|
+
this.pattern = this.dataTypeService.getValuePattern(option.version, option.dataType);
|
|
63427
|
+
this.numericalOperation = option.numericalOperation;
|
|
63428
|
+
this.enableNumericalOperation = this.numericalOperation.enableNumericalOperation ?
|
|
63429
|
+
this.numericalOperation.enableNumericalOperation : false;
|
|
63430
|
+
this.value = '';
|
|
63431
|
+
if (this.args.enableDataParsed) {
|
|
63432
|
+
this.setValueRangeAccordToDataParsed(option);
|
|
63433
|
+
}
|
|
63434
|
+
else {
|
|
63435
|
+
this.writeMaxValue = this.dataTypeService.getMaxValue(option.version, this.dataType, this.fBoxDataType);
|
|
63436
|
+
this.writeMinValue = this.dataTypeService.getMinValue(option.version, this.dataType, this.fBoxDataType);
|
|
63437
|
+
}
|
|
63438
|
+
this.writeValueRangeText = this.getWriteValueRangeText();
|
|
63439
|
+
}
|
|
63440
|
+
setValueRangeAccordToDataParsed(option) {
|
|
63441
|
+
if (this.dataTypeService.isFloat(option.version, this.dataType) || this.enableNumericalOperation) {
|
|
63442
|
+
this.maxValueLimit = this.dataTypeService.getMaxValue(option.version, this.dataType, this.fBoxDataType);
|
|
63443
|
+
this.minValueLimit = this.dataTypeService.getMinValue(option.version, this.dataType, this.fBoxDataType);
|
|
63444
|
+
this.numericalLowerLimit = this.numericalOperation.numericalLowerLimit;
|
|
63445
|
+
this.numericalUpperLimit = this.numericalOperation.numericalUpperLimit;
|
|
63446
|
+
}
|
|
63447
|
+
else {
|
|
63448
|
+
this.maxValueLimit = +this.fractionDigitService.movePoint(this.dataTypeService.getMaxValue(option.version, this.dataType, this.fBoxDataType), -this.fractionDigits);
|
|
63449
|
+
this.minValueLimit = +this.fractionDigitService.movePoint(this.dataTypeService.getMinValue(option.version, this.dataType, this.fBoxDataType), -this.fractionDigits);
|
|
63450
|
+
this.numericalLowerLimit = +this.fractionDigitService.movePoint(this.numericalOperation.numericalLowerLimit, -this.fractionDigits);
|
|
63451
|
+
this.numericalUpperLimit = +this.fractionDigitService.movePoint(this.numericalOperation.numericalUpperLimit, -this.fractionDigits);
|
|
63452
|
+
}
|
|
63453
|
+
const minValue = this.numericalOperationService.getWriteMinValue(this.minValueLimit, this.numericalOperation);
|
|
63454
|
+
const maxValue = this.numericalOperationService.getWriteMaxValue(this.maxValueLimit, this.numericalOperation);
|
|
63455
|
+
const lowerLimitValue = this.numericalOperationService.getWriteMinValue(this.numericalLowerLimit, this.numericalOperation);
|
|
63456
|
+
const upperLimitValue = this.numericalOperationService.getWriteMaxValue(this.numericalUpperLimit, this.numericalOperation);
|
|
63457
|
+
const realMinValue = minValue < maxValue ? minValue : maxValue;
|
|
63458
|
+
const realMaxValue = minValue < maxValue ? maxValue : minValue;
|
|
63459
|
+
const realLowerLimitValue = lowerLimitValue < upperLimitValue ? lowerLimitValue : upperLimitValue;
|
|
63460
|
+
const realUpperLimitValue = lowerLimitValue < upperLimitValue ? upperLimitValue : lowerLimitValue;
|
|
63461
|
+
this.writeMinValue = realMinValue > realLowerLimitValue ? realMinValue : realLowerLimitValue;
|
|
63462
|
+
this.writeMaxValue = realMaxValue < realUpperLimitValue ? realMaxValue : realUpperLimitValue;
|
|
63463
|
+
}
|
|
63464
|
+
getWriteValueRangeText() {
|
|
63465
|
+
let minValue = '';
|
|
63466
|
+
let maxValue = '';
|
|
63467
|
+
if (this.dataTypeService.isHexOrBinaryType(this.args.version, this.dataType)) {
|
|
63468
|
+
minValue = this.writeMinValue.toString(16);
|
|
63469
|
+
maxValue = this.writeMaxValue.toString(16);
|
|
63470
|
+
}
|
|
63471
|
+
else {
|
|
63472
|
+
if (this.args.enableDataParsed && this.fractionDigits > 0) {
|
|
63473
|
+
minValue = this.writeMinValue.toFixed(this.fractionDigits).toString();
|
|
63474
|
+
maxValue = this.writeMaxValue.toFixed(this.fractionDigits).toString();
|
|
63547
63475
|
}
|
|
63548
|
-
|
|
63549
|
-
|
|
63550
|
-
|
|
63476
|
+
else {
|
|
63477
|
+
minValue = this.writeMinValue.toString();
|
|
63478
|
+
maxValue = this.writeMaxValue.toString();
|
|
63479
|
+
}
|
|
63480
|
+
}
|
|
63481
|
+
return minValue + '~' + maxValue;
|
|
63482
|
+
}
|
|
63483
|
+
save() {
|
|
63484
|
+
this.isSubmitting = true;
|
|
63485
|
+
let value = this.value;
|
|
63486
|
+
const showValue = this.value;
|
|
63487
|
+
if (this.args.enableDataParsed) {
|
|
63488
|
+
if (this.enableNumericalOperation) {
|
|
63489
|
+
value = this.numericalOperationService.getWriteValue(this.args.version, this.value, this.numericalOperation, this.dataType, this.fractionDigits);
|
|
63490
|
+
}
|
|
63491
|
+
else {
|
|
63492
|
+
value = this.formatWriteValue();
|
|
63493
|
+
}
|
|
63494
|
+
}
|
|
63495
|
+
// 处理系统变量"当前语种ID"
|
|
63496
|
+
if (this.variableName === '当前语种ID') {
|
|
63497
|
+
this.handleCurrentLanguageIdSave(value);
|
|
63498
|
+
return;
|
|
63499
|
+
}
|
|
63500
|
+
if (!this.args.releasedVariableService) {
|
|
63501
|
+
this.onClosed({
|
|
63502
|
+
value: value,
|
|
63503
|
+
showValue: showValue,
|
|
63504
|
+
enableNumericalOperation: false,
|
|
63505
|
+
isNumericalOperation: this.isNumericalOperation,
|
|
63506
|
+
variableRwType: 6
|
|
63507
|
+
});
|
|
63508
|
+
return;
|
|
63509
|
+
}
|
|
63510
|
+
this.args.releasedVariableService.getVariableWithValueTransform(this.variableName).subscribe(result => {
|
|
63511
|
+
const valueTransform = JSON.parse(result.valueTransform);
|
|
63512
|
+
if ((valueTransform === null || valueTransform === void 0 ? void 0 : valueTransform.Type) !== 0) {
|
|
63513
|
+
this.isNumericalOperation = true;
|
|
63514
|
+
}
|
|
63515
|
+
this.onClosed({
|
|
63516
|
+
value: value,
|
|
63517
|
+
showValue: showValue,
|
|
63518
|
+
enableNumericalOperation: this.enableNumericalOperation,
|
|
63519
|
+
isNumericalOperation: this.isNumericalOperation,
|
|
63520
|
+
variableRwType: result.variableRwType
|
|
63521
|
+
});
|
|
63551
63522
|
});
|
|
63552
|
-
|
|
63553
|
-
renderWatch.renderEnd('sunburstChart immediate');
|
|
63554
|
-
return chart;
|
|
63555
63523
|
}
|
|
63556
|
-
|
|
63557
|
-
|
|
63558
|
-
|
|
63559
|
-
|
|
63560
|
-
|
|
63561
|
-
|
|
63562
|
-
|
|
63563
|
-
|
|
63564
|
-
value: (evt.data.value || evt.data.size),
|
|
63565
|
-
color: evt.color,
|
|
63566
|
-
percent: evt.percent
|
|
63567
|
-
};
|
|
63568
|
-
if (!showTooltipPercent) {
|
|
63569
|
-
delete evt.percent;
|
|
63570
|
-
delete evt.series.percent;
|
|
63524
|
+
/**
|
|
63525
|
+
* 处理"当前语种ID"系统变量的保存
|
|
63526
|
+
*/
|
|
63527
|
+
handleCurrentLanguageIdSave(value) {
|
|
63528
|
+
if (!this.args.guiContext || !this.args.guiContext.updateCurrentLanguageId) {
|
|
63529
|
+
this.showValidationErrorInfo(this.localization.loadFailed);
|
|
63530
|
+
this.isSubmitting = false;
|
|
63531
|
+
return;
|
|
63571
63532
|
}
|
|
63572
|
-
|
|
63573
|
-
|
|
63574
|
-
|
|
63575
|
-
|
|
63576
|
-
|
|
63577
|
-
|
|
63578
|
-
|
|
63579
|
-
|
|
63580
|
-
|
|
63581
|
-
|
|
63582
|
-
|
|
63583
|
-
|
|
63584
|
-
|
|
63585
|
-
|
|
63533
|
+
// 转换为数字类型
|
|
63534
|
+
const languageId = value === '' || value == null ? null : Number(value);
|
|
63535
|
+
// 调用 GuiContext 的语种切换方法
|
|
63536
|
+
this.args.guiContext.updateCurrentLanguageId(languageId).then(() => {
|
|
63537
|
+
// 语种切换成功,调用 onClosed 回调,让数字显示元件也能更新
|
|
63538
|
+
this.onClosed({
|
|
63539
|
+
value: value,
|
|
63540
|
+
showValue: value,
|
|
63541
|
+
enableNumericalOperation: false,
|
|
63542
|
+
isNumericalOperation: false,
|
|
63543
|
+
variableRwType: 6
|
|
63544
|
+
});
|
|
63545
|
+
}).catch(() => {
|
|
63546
|
+
this.showValidationErrorInfo(this.localization.loadFailed);
|
|
63547
|
+
this.isSubmitting = false;
|
|
63548
|
+
});
|
|
63549
|
+
}
|
|
63550
|
+
close() {
|
|
63551
|
+
this.bsModalRef.hide();
|
|
63552
|
+
}
|
|
63553
|
+
validate(event = null) {
|
|
63554
|
+
if (event && event.keyCode === 13 && !this.validationError) {
|
|
63555
|
+
this.save();
|
|
63556
|
+
return;
|
|
63557
|
+
}
|
|
63558
|
+
// 校验数值必填
|
|
63559
|
+
if (null == this.value || '' === this.value.trim()) {
|
|
63560
|
+
return this.showValidationErrorInfo(this.localization.numericalValueRequired);
|
|
63561
|
+
}
|
|
63562
|
+
// 校验格式
|
|
63563
|
+
if (!new RegExp(this.pattern).test(this.value)) {
|
|
63564
|
+
return this.showValidationErrorInfo(this.localization.invalidNumericalValue);
|
|
63565
|
+
}
|
|
63566
|
+
// 校验小数点位数
|
|
63567
|
+
if (!this.enableNumericalOperation && this.dataTypeService.isSupportFractionDigit(this.args.version, this.dataType)
|
|
63568
|
+
&& this.getFractionDigits(this.value) > this.fractionDigits) {
|
|
63569
|
+
return this.showValidationErrorInfo(`${this.localization.fractionDigitsMustLessThan}${this.fractionDigits}`);
|
|
63570
|
+
}
|
|
63571
|
+
// 校验负号
|
|
63572
|
+
if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isNil"])(this.args.version) || (!Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isNil"])(this.args.version) && this.args.version < 5)) {
|
|
63573
|
+
if (!this.enableNumericalOperation && !this.dataTypeService.isSignedType(this.args.version, this.dataType) && this.value.startsWith('-')) {
|
|
63574
|
+
return this.showValidationErrorInfo(this.localization.canNotBeNegative);
|
|
63575
|
+
}
|
|
63576
|
+
}
|
|
63577
|
+
if (this.dataTypeService.isBinaryType(this.args.version, this.dataType) || this.dataTypeService.isHexType(this.args.version, this.dataType)) {
|
|
63578
|
+
// 校验数值最大长度
|
|
63579
|
+
const valueMaxLength = this.dataTypeService.getValueMaxLength(this.args.version, this.dataType, this.fBoxDataType);
|
|
63580
|
+
const maxLength = this.integerDigits ? Math.min(this.integerDigits, valueMaxLength) : valueMaxLength;
|
|
63581
|
+
if (this.value.length > maxLength) {
|
|
63582
|
+
return this.showValidationErrorInfo(this.localization.numericalValueTooLong);
|
|
63583
|
+
}
|
|
63584
|
+
}
|
|
63585
|
+
let transportValue;
|
|
63586
|
+
if (this.dataTypeService.isHexOrBinaryType(this.args.version, this.dataType)) {
|
|
63587
|
+
transportValue = this.dataTypeService.formatToDecimal(this.args.version, this.value, this.dataType);
|
|
63588
|
+
}
|
|
63589
|
+
else {
|
|
63590
|
+
transportValue = Number(this.value);
|
|
63591
|
+
}
|
|
63592
|
+
if (Number(transportValue) > this.writeMaxValue || Number(transportValue) < this.writeMinValue) {
|
|
63593
|
+
return this.showValidationErrorInfo(this.localization.valueOutOfRange);
|
|
63594
|
+
}
|
|
63595
|
+
// 没有错误则隐藏错误框
|
|
63596
|
+
this.hideValidationErrorInfo();
|
|
63597
|
+
}
|
|
63598
|
+
showValidationErrorInfo(errorText) {
|
|
63599
|
+
this.validationError = true;
|
|
63600
|
+
this.validationErrorText = errorText;
|
|
63601
|
+
}
|
|
63602
|
+
hideValidationErrorInfo() {
|
|
63603
|
+
this.validationError = false;
|
|
63604
|
+
this.validationErrorText = '';
|
|
63605
|
+
}
|
|
63606
|
+
getFractionDigits(number) {
|
|
63607
|
+
if (number && number.indexOf('.') > 0) {
|
|
63608
|
+
return number.split('.')[1].length;
|
|
63609
|
+
}
|
|
63610
|
+
return 0;
|
|
63611
|
+
}
|
|
63612
|
+
/**
|
|
63613
|
+
* 格式化写入的值
|
|
63614
|
+
* 因为有小数点的数值类型,会被按照小数点位数移位,所以需要在修改前右移小数点位数
|
|
63615
|
+
*/
|
|
63616
|
+
formatWriteValue() {
|
|
63617
|
+
if (this.dataTypeService.isSupportFractionDigit(this.args.version, this.dataType) &&
|
|
63618
|
+
!this.dataTypeService.isFloat(this.args.version, this.dataType) && this.fractionDigits) {
|
|
63619
|
+
return this.fractionDigitService.movePoint(this.value, this.fractionDigits);
|
|
63620
|
+
}
|
|
63621
|
+
if (this.dataTypeService.isSupportNumericalOperation(this.args.version, this.dataType)) {
|
|
63622
|
+
this.value = Number(this.value).toString();
|
|
63623
|
+
}
|
|
63624
|
+
return this.value;
|
|
63625
|
+
}
|
|
63626
|
+
};
|
|
63627
|
+
__decorate([
|
|
63628
|
+
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])()
|
|
63629
|
+
], WriteValueModalComponent.prototype, "invalidErrorText", null);
|
|
63630
|
+
WriteValueModalComponent = __decorate([
|
|
63631
|
+
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
|
|
63632
|
+
selector: 'writeValueModal',
|
|
63633
|
+
template: "<form #writeValueForm=\"ngForm\" novalidate (ngSubmit)=\"save()\" bs-modal-drag> <div class=\"modal-header\"> <h4 class=\"modal-title\"> <span>{{localization.setting}}</span> <span>{{variableName}}</span> </h4> <button type=\"button\" class=\"close pull-right\" aria-label=\"Close\" (click)=\"close()\"> <span aria-hidden=\"true\">×</span> </button> </div> <div class=\"modal-body\"> <span class=\"write-value-range\">{{localization.writeValueRange}}:</span> <div class=\"write-value-range\"> {{writeValueRangeText}} <span *ngIf=\"valueType\">({{valueType}})</span> </div> <input type=\"text\" name=\"valueInput\" autoFocus class=\"form-control write-value\" [(ngModel)]=\"value\" (keyup)=\"validate($event)\" autocomplete=\"off\"> <span class=\"help-block text-danger\" [hidden]=\"!validationError\">{{validationErrorText}}</span> </div> <div class=\"modal-footer\"> <button type=\"submit\" class=\"btn md-skip btn-primary btn-block\" [disabled]=\"validationError || isSubmitting\"> <ng-container *ngIf=\"!isSubmitting\">{{localization.submit}}</ng-container> <ng-container *ngIf=\"isSubmitting\">{{localization.submitting}}</ng-container> </button> </div> </form> ",
|
|
63634
|
+
styles: [".modal-header { padding: 10px; border-color: transparent; } .modal-body { position: relative; padding: 0px 5px !important; padding-top: 10px !important; } .modal-title { display: unset; margin-left: -6px; font-size: 16px !important; } .form-control { margin: 0 5%; float: none; width: 90%; } .modal-footer { padding: 10px 4px 20px 5px !important; text-align: right; border-color: transparent; } .text-danger { display: block; color: #ed6b75; font-size: 14px; margin: 5px 0px 0px 15px; } .btn-primary { background-color: #3B97FC; border-color: #3B97FC; padding: 5px 30px; width: 90%; margin: 0 5%; height: 32px; } .write-value-range { color: #7f939e; font-size: 14px; margin-left: 15px; } .write-value { padding-left: 8px; margin-left: 16px; height: 32px; } "]
|
|
63635
|
+
}),
|
|
63636
|
+
__param(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_localization__WEBPACK_IMPORTED_MODULE_1__[/* LOCALIZATION */ "b"]))
|
|
63637
|
+
], WriteValueModalComponent);
|
|
63586
63638
|
|
|
63587
|
-
|
|
63588
|
-
|
|
63589
|
-
|
|
63590
|
-
|
|
63591
|
-
|
|
63639
|
+
|
|
63640
|
+
|
|
63641
|
+
/***/ }),
|
|
63642
|
+
/* 39 */
|
|
63643
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
63644
|
+
|
|
63645
|
+
"use strict";
|
|
63646
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return WriteCharacterModalComponent; });
|
|
63647
|
+
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
63648
|
+
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
63649
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40);
|
|
63650
|
+
/* harmony import */ var _localization__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9);
|
|
63651
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
63652
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
63653
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
63654
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
63655
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
63656
|
+
};
|
|
63657
|
+
var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
|
|
63658
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
63659
|
+
};
|
|
63592
63660
|
|
|
63593
|
-
// use Object get/set functionality to map between vars and chart functions
|
|
63594
|
-
chart._options = Object.create({}, {
|
|
63595
|
-
// simple options, just get/set the necessary values
|
|
63596
|
-
noData: {get: function(){return noData;}, set: function(_){noData=_;}},
|
|
63597
|
-
defaultState: {get: function(){return defaultState;}, set: function(_){defaultState=_;}},
|
|
63598
|
-
showTooltipPercent: {get: function(){return showTooltipPercent;}, set: function(_){showTooltipPercent=_;}},
|
|
63599
63661
|
|
|
63600
|
-
// options that require extra logic in the setter
|
|
63601
|
-
color: {get: function(){return color;}, set: function(_){
|
|
63602
|
-
color = _;
|
|
63603
|
-
sunburst.color(color);
|
|
63604
|
-
}},
|
|
63605
|
-
duration: {get: function(){return duration;}, set: function(_){
|
|
63606
|
-
duration = _;
|
|
63607
|
-
renderWatch.reset(duration);
|
|
63608
|
-
sunburst.duration(duration);
|
|
63609
|
-
}},
|
|
63610
|
-
margin: {get: function(){return margin;}, set: function(_){
|
|
63611
|
-
margin.top = _.top !== undefined ? _.top : margin.top;
|
|
63612
|
-
margin.right = _.right !== undefined ? _.right : margin.right;
|
|
63613
|
-
margin.bottom = _.bottom !== undefined ? _.bottom : margin.bottom;
|
|
63614
|
-
margin.left = _.left !== undefined ? _.left : margin.left;
|
|
63615
|
-
sunburst.margin(margin);
|
|
63616
|
-
}}
|
|
63617
|
-
});
|
|
63618
|
-
nv.utils.inheritOptions(chart, sunburst);
|
|
63619
|
-
nv.utils.initOptions(chart);
|
|
63620
|
-
return chart;
|
|
63621
63662
|
|
|
63663
|
+
let WriteCharacterModalComponent = class WriteCharacterModalComponent {
|
|
63664
|
+
constructor(localization) {
|
|
63665
|
+
this.localization = localization;
|
|
63666
|
+
this._onClosed = new rxjs__WEBPACK_IMPORTED_MODULE_1__[/* Subject */ "a"]();
|
|
63667
|
+
}
|
|
63668
|
+
get onClosed() {
|
|
63669
|
+
return this._onClosed;
|
|
63670
|
+
}
|
|
63671
|
+
get invalidErrorText() {
|
|
63672
|
+
return this.localization.loadFailed;
|
|
63673
|
+
}
|
|
63674
|
+
ngOnInit() {
|
|
63675
|
+
this.variableName = this.args.variableName;
|
|
63676
|
+
this.isPassword = this.args.isPassword ? this.args.isPassword : false;
|
|
63677
|
+
this.charCount = this.args.charCount;
|
|
63678
|
+
this.value = '';
|
|
63679
|
+
this.validate();
|
|
63680
|
+
}
|
|
63681
|
+
validate() {
|
|
63682
|
+
// 校验数值必填
|
|
63683
|
+
if (null == this.value || '' === this.value.trim()) {
|
|
63684
|
+
return this.showValidationErrorInfo(this.localization.characterInputRequired);
|
|
63685
|
+
}
|
|
63686
|
+
if (this.value.length > this.charCount) {
|
|
63687
|
+
return this.showValidationErrorInfo(this.localization.characterOutofRange);
|
|
63688
|
+
}
|
|
63689
|
+
this.hideValidationErrorInfo();
|
|
63690
|
+
}
|
|
63691
|
+
showValidationErrorInfo(errorText) {
|
|
63692
|
+
this.validationError = true;
|
|
63693
|
+
this.validationErrorText = errorText;
|
|
63694
|
+
}
|
|
63695
|
+
hideValidationErrorInfo() {
|
|
63696
|
+
this.validationError = false;
|
|
63697
|
+
this.validationErrorText = '';
|
|
63698
|
+
}
|
|
63699
|
+
save() {
|
|
63700
|
+
this.close({ value: this.value });
|
|
63701
|
+
}
|
|
63702
|
+
close(modalResult) {
|
|
63703
|
+
this._onClosed.next(modalResult);
|
|
63704
|
+
this._onClosed.complete();
|
|
63705
|
+
}
|
|
63622
63706
|
};
|
|
63707
|
+
__decorate([
|
|
63708
|
+
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])()
|
|
63709
|
+
], WriteCharacterModalComponent.prototype, "invalidErrorText", null);
|
|
63710
|
+
WriteCharacterModalComponent = __decorate([
|
|
63711
|
+
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
|
|
63712
|
+
selector: 'writeCharacterModal',
|
|
63713
|
+
template: "<form #writeValueForm=\"ngForm\" novalidate (ngSubmit)=\"save()\" bs-modal-drag> <div class=\"modal-header\"> <h4 class=\"modal-title\"> <span>{{localization.setting}}</span> <span>{{variableName}}</span> </h4> <button type=\"button\" class=\"close pull-right\" aria-label=\"Close\" (click)=\"close()\"> <span aria-hidden=\"true\">×</span> </button> </div> <div class=\"modal-body\"> <input type=\"text\" name=\"characterInput\" autoFocus class=\"form-control write-character-value\" [(ngModel)]=\"value\" (keyup)=\"validate()\" *ngIf=\"!isPassword\" autocomplete=\"off\"> <input type=\"password\" name=\"passwordInput\" autoFocus class=\"form-control write-character-value\" [(ngModel)]=\"value\" (keyup)=\"validate()\" *ngIf=\"isPassword\" autocomplete=\"off\"> <span class=\"help-block text-danger\" [hidden]=\"!validationError\">{{validationErrorText}}</span> </div> <div class=\"modal-footer\"> <button type=\"submit\" class=\"btn md-skip btn-primary btn-block\" [disabled]=\"validationError\">{{localization.submit}}</button> </div> </form> ",
|
|
63714
|
+
styles: [".modal-header { padding: 10px; border-color: transparent; } .modal-body { position: relative; padding: 0px 5px !important; } .modal-title { display: unset; margin-left: -6px; font-size: 16px !important; } .form-control { margin: 0 5%; float: none; width: 90%; } .modal-footer { padding: 10px 4px 20px 5px !important; text-align: right; border-color: transparent; } .text-danger { display: block; color: #ed6b75; font-size: 14px; margin: 10px 0px 0px 15px; } .btn-primary { background-color: #3B97FC; border-color: #3B97FC; padding: 5px 30px; width: 90%; margin: 0 5%; height: 32px; } .write-character-value { padding-left: 8px; height: 32px; margin-left: 16px; } "]
|
|
63715
|
+
}),
|
|
63716
|
+
__param(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_localization__WEBPACK_IMPORTED_MODULE_2__[/* LOCALIZATION */ "b"]))
|
|
63717
|
+
], WriteCharacterModalComponent);
|
|
63623
63718
|
|
|
63624
|
-
|
|
63625
|
-
})();
|
|
63626
|
-
//# sourceMappingURL=nv.d3.js.map
|
|
63719
|
+
|
|
63627
63720
|
|
|
63628
63721
|
/***/ }),
|
|
63629
63722
|
/* 40 */
|
|
@@ -65048,7 +65141,7 @@ var $$rxSubscriber = rxSubscriber;
|
|
|
65048
65141
|
"use strict";
|
|
65049
65142
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return empty; });
|
|
65050
65143
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
|
|
65051
|
-
/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
65144
|
+
/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36);
|
|
65052
65145
|
/** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */
|
|
65053
65146
|
|
|
65054
65147
|
|
|
@@ -67723,7 +67816,7 @@ var InnerSubscriber_InnerSubscriber = /*@__PURE__*/ (function (_super) {
|
|
|
67723
67816
|
var subscribeToArray = __webpack_require__(275);
|
|
67724
67817
|
|
|
67725
67818
|
// EXTERNAL MODULE: ./node_modules/rxjs/_esm5/internal/util/hostReportError.js
|
|
67726
|
-
var hostReportError = __webpack_require__(
|
|
67819
|
+
var hostReportError = __webpack_require__(36);
|
|
67727
67820
|
|
|
67728
67821
|
// CONCATENATED MODULE: ./node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js
|
|
67729
67822
|
/** PURE_IMPORTS_START _hostReportError PURE_IMPORTS_END */
|
|
@@ -73457,7 +73550,7 @@ var ngx_bootstrap_tooltip_TooltipModule = /** @class */ (function () {
|
|
|
73457
73550
|
//# sourceMappingURL=ngx-bootstrap-tooltip.js.map
|
|
73458
73551
|
|
|
73459
73552
|
// EXTERNAL MODULE: ./.tmp/gui/gui.component.ts + 1 modules
|
|
73460
|
-
var gui_component = __webpack_require__(
|
|
73553
|
+
var gui_component = __webpack_require__(37);
|
|
73461
73554
|
|
|
73462
73555
|
// EXTERNAL MODULE: ./.tmp/localization/localization.service.ts
|
|
73463
73556
|
var localization_service = __webpack_require__(19);
|
|
@@ -73469,10 +73562,10 @@ var alert_modal_component = __webpack_require__(22);
|
|
|
73469
73562
|
var confirm_operation_modal_component = __webpack_require__(21);
|
|
73470
73563
|
|
|
73471
73564
|
// EXTERNAL MODULE: ./.tmp/modal/write-character/write-character-modal.component.ts
|
|
73472
|
-
var write_character_modal_component = __webpack_require__(
|
|
73565
|
+
var write_character_modal_component = __webpack_require__(39);
|
|
73473
73566
|
|
|
73474
73567
|
// EXTERNAL MODULE: ./.tmp/modal/write-value/write-value-modal.component.ts
|
|
73475
|
-
var write_value_modal_component = __webpack_require__(
|
|
73568
|
+
var write_value_modal_component = __webpack_require__(38);
|
|
73476
73569
|
|
|
73477
73570
|
// EXTERNAL MODULE: ./.tmp/settings/global-settings.ts
|
|
73478
73571
|
var global_settings = __webpack_require__(49);
|
|
@@ -86208,7 +86301,7 @@ module.exports = g;
|
|
|
86208
86301
|
|
|
86209
86302
|
"use strict";
|
|
86210
86303
|
__webpack_require__.r(__webpack_exports__);
|
|
86211
|
-
/* harmony import */ var _gui_gui_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
86304
|
+
/* harmony import */ var _gui_gui_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
|
|
86212
86305
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GuiComponent", function() { return _gui_gui_component__WEBPACK_IMPORTED_MODULE_0__["a"]; });
|
|
86213
86306
|
|
|
86214
86307
|
/* harmony import */ var _gui_gui_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32);
|
|
@@ -86232,21 +86325,23 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
86232
86325
|
|
|
86233
86326
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GraphStore", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["h"]; });
|
|
86234
86327
|
|
|
86235
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewStore", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["
|
|
86328
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewStore", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["q"]; });
|
|
86329
|
+
|
|
86330
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewModel", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["p"]; });
|
|
86236
86331
|
|
|
86237
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
86332
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ImageStore", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["n"]; });
|
|
86238
86333
|
|
|
86239
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
86334
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HistoryDataStore", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["l"]; });
|
|
86240
86335
|
|
|
86241
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
86336
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HistoryDataModel", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["k"]; });
|
|
86242
86337
|
|
|
86243
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
86338
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HistoryDataItemModel", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["j"]; });
|
|
86244
86339
|
|
|
86245
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HistoryDataValue", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["
|
|
86340
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HistoryDataValue", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["m"]; });
|
|
86246
86341
|
|
|
86247
86342
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GetHistoryDataArgs", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["d"]; });
|
|
86248
86343
|
|
|
86249
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VariableStore", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["
|
|
86344
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VariableStore", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["o"]; });
|
|
86250
86345
|
|
|
86251
86346
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GetVariableNameArgs", function() { return _config__WEBPACK_IMPORTED_MODULE_4__["e"]; });
|
|
86252
86347
|
|
|
@@ -86266,7 +86361,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
86266
86361
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VariableStateEnum", function() { return _communication__WEBPACK_IMPORTED_MODULE_5__["d"]; });
|
|
86267
86362
|
|
|
86268
86363
|
/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3);
|
|
86269
|
-
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _model__WEBPACK_IMPORTED_MODULE_6__) if(["GuiComponent","GuiView","GuiContext","GuiModule","LOGGER_SERVICE_TOKEN","LoggerService","ConsoleLoggerService","StringifyingMap","ConfigStore","Graph","GraphResult","GraphType","GraphStore","ViewStore","ViewModel","ImageStore","HistoryDataStore","HistoryDataModel","HistoryDataValue","GetHistoryDataArgs","VariableStore","GetVariableNameArgs","AlarmsStore","GetAlarmsArgs","VariableCommunicator","VariableValue","VariableState","VariableDefinition","VariableStateEnum","default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _model__WEBPACK_IMPORTED_MODULE_6__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
|
86364
|
+
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _model__WEBPACK_IMPORTED_MODULE_6__) if(["GuiComponent","GuiView","GuiContext","GuiModule","LOGGER_SERVICE_TOKEN","LoggerService","ConsoleLoggerService","StringifyingMap","ConfigStore","Graph","GraphResult","GraphType","GraphStore","ViewStore","ViewModel","ImageStore","HistoryDataStore","HistoryDataModel","HistoryDataItemModel","HistoryDataValue","GetHistoryDataArgs","VariableStore","GetVariableNameArgs","AlarmsStore","GetAlarmsArgs","VariableCommunicator","VariableValue","VariableState","VariableDefinition","VariableStateEnum","default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _model__WEBPACK_IMPORTED_MODULE_6__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
|
86270
86365
|
/* harmony import */ var _localization__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9);
|
|
86271
86366
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Localization", function() { return _localization__WEBPACK_IMPORTED_MODULE_7__["c"]; });
|
|
86272
86367
|
|
|
@@ -86323,7 +86418,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
86323
86418
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RemoteVariableProtocol", function() { return _remote__WEBPACK_IMPORTED_MODULE_11__["k"]; });
|
|
86324
86419
|
|
|
86325
86420
|
/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(14);
|
|
86326
|
-
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _service__WEBPACK_IMPORTED_MODULE_12__) if(["GuiComponent","GuiView","GuiContext","GuiModule","LOGGER_SERVICE_TOKEN","LoggerService","ConsoleLoggerService","StringifyingMap","ConfigStore","Graph","GraphResult","GraphType","GraphStore","ViewStore","ViewModel","ImageStore","HistoryDataStore","HistoryDataModel","HistoryDataValue","GetHistoryDataArgs","VariableStore","GetVariableNameArgs","AlarmsStore","GetAlarmsArgs","VariableCommunicator","VariableValue","VariableState","VariableDefinition","VariableStateEnum","Localization","LOCALIZATION","DefaultLocalization","Localization_zh_CN","SecurityChecker","Disposable","ConfigIsEmptyError","OperationHelper","GuiConsts","GraphExtendedStyle","GetReleasedGraphStateResult","GraphStateResult","GetReleasedGraphStates","GraphStateKey","GraphState","RemoteGraphProtocol","RemoteGraphStore","RemoteViewProtocol","RemoteViewStore","ViewResult","RemoteImageProtocol","RemoteImageStore","RemoteVariableCommunicator","RemoteVariableProtocol","default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _service__WEBPACK_IMPORTED_MODULE_12__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
|
86421
|
+
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _service__WEBPACK_IMPORTED_MODULE_12__) if(["GuiComponent","GuiView","GuiContext","GuiModule","LOGGER_SERVICE_TOKEN","LoggerService","ConsoleLoggerService","StringifyingMap","ConfigStore","Graph","GraphResult","GraphType","GraphStore","ViewStore","ViewModel","ImageStore","HistoryDataStore","HistoryDataModel","HistoryDataItemModel","HistoryDataValue","GetHistoryDataArgs","VariableStore","GetVariableNameArgs","AlarmsStore","GetAlarmsArgs","VariableCommunicator","VariableValue","VariableState","VariableDefinition","VariableStateEnum","Localization","LOCALIZATION","DefaultLocalization","Localization_zh_CN","SecurityChecker","Disposable","ConfigIsEmptyError","OperationHelper","GuiConsts","GraphExtendedStyle","GetReleasedGraphStateResult","GraphStateResult","GetReleasedGraphStates","GraphStateKey","GraphState","RemoteGraphProtocol","RemoteGraphStore","RemoteViewProtocol","RemoteViewStore","ViewResult","RemoteImageProtocol","RemoteImageStore","RemoteVariableCommunicator","RemoteVariableProtocol","default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _service__WEBPACK_IMPORTED_MODULE_12__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
|
86327
86422
|
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7);
|
|
86328
86423
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LOGGER_SERVICE_TOKEN", function() { return _logger__WEBPACK_IMPORTED_MODULE_13__["b"]; });
|
|
86329
86424
|
|