@opentiny/vue-renderless 3.1.0-alpha.0 → 3.4.7
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/action-menu/index.js +10 -0
- package/action-menu/vue.js +26 -0
- package/amount/index.js +334 -0
- package/amount/vue.js +206 -0
- package/area/index.js +162 -0
- package/area/vue.js +68 -0
- package/autonavi-map/index.js +28 -0
- package/avatar/index.js +5 -1
- package/avatar/vue.js +2 -1
- package/baidu-map/index.js +28 -0
- package/breadcrumb/index.js +9 -0
- package/breadcrumb/vue.js +25 -3
- package/breadcrumb-item/index.js +26 -0
- package/breadcrumb-item/vue.js +20 -11
- package/bulletin-board/index.js +4 -1
- package/button-group/vue.js +1 -1
- package/calendar/index.js +14 -14
- package/card-template/index.js +1 -1
- package/cascader/index.js +21 -7
- package/cascader/vue.js +1 -2
- package/cascader-node/index.js +3 -1
- package/cascader-panel/index.js +12 -4
- package/cascader-panel/vue.js +1 -2
- package/chart-bar/index.js +533 -0
- package/chart-boxplot/index.js +270 -0
- package/chart-candle/index.js +428 -0
- package/chart-core/deps/constants.js +65 -0
- package/chart-core/deps/numerify.js +286 -0
- package/chart-core/deps/utils.js +205 -0
- package/chart-core/index.js +541 -0
- package/chart-core/modules/animation.js +10 -0
- package/chart-core/modules/extend.js +36 -0
- package/chart-core/modules/mark.js +7 -0
- package/chart-core/vue.js +128 -0
- package/chart-funnel/index.js +155 -0
- package/chart-gauge/index.js +153 -0
- package/chart-graph/index.js +38 -0
- package/chart-heatmap/index.js +407 -0
- package/chart-line/index.js +358 -0
- package/chart-liquidfill/index.js +119 -0
- package/chart-map/index.js +261 -0
- package/chart-pie/index.js +327 -0
- package/chart-radar/index.js +181 -0
- package/chart-sankey/index.js +166 -0
- package/chart-scatter/index.js +360 -0
- package/chart-sunburst/index.js +36 -0
- package/chart-tree/index.js +107 -0
- package/chart-waterfall/index.js +231 -0
- package/chart-wordcloud/index.js +109 -0
- package/checkbox/index.js +4 -4
- package/checkbox-button/index.js +3 -1
- package/common/bigInt.js +5 -2
- package/common/date.js +17 -17
- package/common/deps/date-util.js +15 -5
- package/common/deps/date.js +6 -6
- package/common/deps/dom.js +18 -6
- package/common/deps/eSpaceCtrl.js +286 -0
- package/common/deps/fullscreen/apis.js +22 -22
- package/common/deps/memorize.js +3 -3
- package/common/deps/modal-queue.js +2 -0
- package/common/deps/popper.js +12 -10
- package/common/deps/popup-manager.js +16 -5
- package/common/deps/resize-event.js +6 -2
- package/common/deps/scrollbar-width.js +6 -2
- package/common/deps/tree-model/node.js +30 -10
- package/common/deps/tree-model/tree-store.js +33 -21
- package/common/deps/tree-model/util.js +6 -2
- package/common/deps/upload-ajax.js +7 -1
- package/common/deps/vue-popper.js +2 -2
- package/common/string.js +1 -1
- package/company/index.js +56 -0
- package/company/vue.js +35 -0
- package/country/index.js +54 -0
- package/country/vue.js +35 -0
- package/credit-card-form/index.js +1 -0
- package/currency/index.js +78 -0
- package/currency/vue.js +39 -0
- package/date-panel/index.js +16 -6
- package/date-picker/index.js +9 -5
- package/date-range/index.js +28 -9
- package/date-table/index.js +3 -1
- package/dept/index.js +318 -0
- package/dept/vue.js +163 -0
- package/detail-page/index.js +4 -1
- package/dialog-box/index.js +14 -4
- package/dialog-box/vue.js +7 -3
- package/drop-roles/index.js +73 -0
- package/drop-roles/vue.js +38 -0
- package/dropdown/index.js +5 -4
- package/dropdown/vue.js +5 -3
- package/dropdown-item/index.js +15 -0
- package/dropdown-item/vue.js +27 -13
- package/espace/index.js +129 -0
- package/espace/vue.js +52 -0
- package/file-upload/index.js +336 -291
- package/form/index.js +3 -1
- package/form/vue.js +15 -0
- package/form-item/index.js +15 -5
- package/fullscreen/index.js +4 -4
- package/fullscreen/vue.js +3 -3
- package/grid/core/interceptor.js +4 -7
- package/grid/plugins/export.js +2 -2
- package/grid/plugins/exportExcel.js +28 -10
- package/grid/static/array/findTree.js +1 -1
- package/grid/static/base/helperCreateGetObjects.js +1 -1
- package/grid/static/base/helperEqualCompare.js +2 -2
- package/grid/static/base/helperGetHGSKeys.js +1 -1
- package/grid/static/base/uniqueId.js +1 -1
- package/grid/static/object/assign.js +3 -3
- package/grid/static/string/toString.js +3 -3
- package/hrapprover/index.js +118 -0
- package/hrapprover/vue.js +102 -0
- package/locales/index.js +116 -0
- package/locales/vue.js +46 -0
- package/logon-user/index.js +23 -0
- package/logon-user/vue.js +22 -0
- package/logout/index.js +118 -0
- package/logout/vue.js +22 -0
- package/milestone/index.js +2 -1
- package/mini-picker/index.js +1 -1
- package/mini-picker/vue.js +1 -1
- package/modal/index.js +4 -2
- package/month-table/index.js +2 -2
- package/nav-menu/index.js +2 -2
- package/numeric/index.js +4 -2
- package/package.json +33 -136
- package/pager-item/vue.js +6 -2
- package/picker/index.js +43 -17
- package/picker/timezone.js +2 -2
- package/picker-column/index.js +7 -3
- package/pop-upload/index.js +5 -3
- package/popeditor/index.js +15 -7
- package/popover/index.js +87 -54
- package/popover/vue.js +13 -9
- package/rate/index.js +2 -2
- package/rich-text/clipboard.js +77 -0
- package/rich-text/index.js +176 -0
- package/rich-text/module/file-upload.js +118 -0
- package/rich-text/module/image-drop.js +54 -0
- package/rich-text/module/image-upload.js +84 -0
- package/rich-text/options.js +187 -0
- package/rich-text/table-module.js +557 -0
- package/rich-text/vue.js +149 -0
- package/roles/index.js +87 -0
- package/roles/vue.js +39 -0
- package/search/index.js +32 -27
- package/search/vue.js +7 -2
- package/select/index.js +328 -304
- package/select/vue.js +19 -9
- package/select-dropdown/index.js +1 -1
- package/slider/index.js +9 -11
- package/slider/vue.js +3 -3
- package/split/vue.js +1 -1
- package/tab-nav/index.js +0 -6
- package/tab-nav/vue.js +0 -14
- package/table/index.js +1 -1
- package/text-popup/index.js +6 -4
- package/time/index.js +3 -1
- package/time-range/index.js +6 -2
- package/time-spinner/index.js +15 -5
- package/toggle-menu/index.js +11 -0
- package/toggle-menu/vue.js +2 -1
- package/tooltip/index.js +46 -35
- package/tooltip/vue.js +5 -1
- package/tree/index.js +57 -21
- package/tree-menu/index.js +3 -1
- package/tree-node/index.js +7 -3
- package/upload/index.js +14 -5
- package/user/index.js +634 -0
- package/user/vue.js +113 -0
- package/user-account/index.js +23 -0
- package/user-account/vue.js +25 -0
- package/user-contact/index.js +1 -4
- package/user-head/index.js +9 -11
- package/user-head/vue.js +2 -6
- package/user-link/index.js +43 -0
- package/user-link/vue.js +60 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { itemPoint, itemLabel, itemContent } from '@opentiny/vue-renderless/chart-core/deps/constants';
|
|
2
|
+
var getTooltip = function getTooltip() {
|
|
3
|
+
return {
|
|
4
|
+
trigger: 'item',
|
|
5
|
+
formatter: function formatter(item) {
|
|
6
|
+
var tpl = [];
|
|
7
|
+
var name = item.name,
|
|
8
|
+
value = item.value,
|
|
9
|
+
color = item.color;
|
|
10
|
+
if (name) {
|
|
11
|
+
color && tpl.push(itemPoint(color));
|
|
12
|
+
tpl.push("".concat(itemLabel('label')).concat(itemContent(name)));
|
|
13
|
+
tpl.push('<br>');
|
|
14
|
+
}
|
|
15
|
+
color && tpl.push(itemPoint(color));
|
|
16
|
+
tpl.push("".concat(itemLabel('sum')).concat(itemContent(value)));
|
|
17
|
+
return tpl.join('');
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export var sunburst = function sunburst(columns, rows, settings, extra) {
|
|
22
|
+
var defaultItemStyle = {
|
|
23
|
+
borderWidth: 2
|
|
24
|
+
};
|
|
25
|
+
var series = {
|
|
26
|
+
type: 'sunburst',
|
|
27
|
+
itemStyle: defaultItemStyle
|
|
28
|
+
};
|
|
29
|
+
var tooltipVisible = extra.tooltipVisible;
|
|
30
|
+
var tooltip = tooltipVisible && getTooltip({});
|
|
31
|
+
var options = {
|
|
32
|
+
series: series,
|
|
33
|
+
tooltip: tooltip
|
|
34
|
+
};
|
|
35
|
+
return options;
|
|
36
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { isObject } from '@opentiny/vue-renderless/chart-core/deps/utils';
|
|
2
|
+
import { itemLabel, itemContent, SAAS_DEFAULT_COLORS_10 } from '@opentiny/vue-renderless/chart-core/deps/constants';
|
|
3
|
+
var getTreeLegend = function getTreeLegend(args) {
|
|
4
|
+
var dimension = args.dimension,
|
|
5
|
+
rows = args.rows;
|
|
6
|
+
var result = rows.map(function (row) {
|
|
7
|
+
return row[dimension];
|
|
8
|
+
});
|
|
9
|
+
return {
|
|
10
|
+
data: result
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
var getTreeTooltip = function getTreeTooltip(args) {
|
|
14
|
+
var tooltipFormatter = args.tooltipFormatter;
|
|
15
|
+
return {
|
|
16
|
+
trigger: 'item',
|
|
17
|
+
triggerOn: 'mousemove',
|
|
18
|
+
formatter: function formatter(item) {
|
|
19
|
+
if (tooltipFormatter) {
|
|
20
|
+
return tooltipFormatter.apply(null, arguments);
|
|
21
|
+
}
|
|
22
|
+
var template = [];
|
|
23
|
+
var treeAncestors = item.treeAncestors,
|
|
24
|
+
value = item.value;
|
|
25
|
+
var names = [];
|
|
26
|
+
treeAncestors.forEach(function (ancestor, idx) {
|
|
27
|
+
idx && names.push(ancestor.name);
|
|
28
|
+
});
|
|
29
|
+
template.push("".concat(itemLabel(names.join('.'))));
|
|
30
|
+
template.push("".concat(itemContent(value)));
|
|
31
|
+
return template.join('');
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
var getTreeSeries = function getTreeSeries(args) {
|
|
36
|
+
var dimension = args.dimension,
|
|
37
|
+
metrics = args.metrics,
|
|
38
|
+
rows = args.rows,
|
|
39
|
+
seriesMap = args.seriesMap;
|
|
40
|
+
var series = [];
|
|
41
|
+
rows.forEach(function (row) {
|
|
42
|
+
var seriesItem = seriesMap[row[dimension]];
|
|
43
|
+
var label = {
|
|
44
|
+
position: 'right',
|
|
45
|
+
fontSize: 12,
|
|
46
|
+
color: '#191919'
|
|
47
|
+
};
|
|
48
|
+
var itemStyle = {
|
|
49
|
+
color: SAAS_DEFAULT_COLORS_10[0]
|
|
50
|
+
};
|
|
51
|
+
var lineStyle = {
|
|
52
|
+
color: 'rgba(25 ,25 ,25 , 0.10)'
|
|
53
|
+
};
|
|
54
|
+
var symbolSize = 16;
|
|
55
|
+
var result = {
|
|
56
|
+
type: 'tree',
|
|
57
|
+
name: row[dimension],
|
|
58
|
+
data: row[metrics],
|
|
59
|
+
itemStyle: itemStyle,
|
|
60
|
+
label: label,
|
|
61
|
+
lineStyle: lineStyle,
|
|
62
|
+
symbolSize: symbolSize
|
|
63
|
+
};
|
|
64
|
+
if (seriesItem) {
|
|
65
|
+
Object.keys(seriesItem).forEach(function (key) {
|
|
66
|
+
if (!isObject(result[key])) {
|
|
67
|
+
result[key] = seriesItem[key];
|
|
68
|
+
} else {
|
|
69
|
+
Object.assign(result[key], seriesItem[key]);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
series.push(result);
|
|
74
|
+
});
|
|
75
|
+
return series;
|
|
76
|
+
};
|
|
77
|
+
export var tree = function tree(columns, rows, settings, extra) {
|
|
78
|
+
var _settings$dimension = settings.dimension,
|
|
79
|
+
dimension = _settings$dimension === void 0 ? columns[0] : _settings$dimension,
|
|
80
|
+
_settings$metrics = settings.metrics,
|
|
81
|
+
metrics = _settings$metrics === void 0 ? columns[1] : _settings$metrics,
|
|
82
|
+
_settings$seriesMap = settings.seriesMap,
|
|
83
|
+
seriesMap = _settings$seriesMap === void 0 ? {} : _settings$seriesMap;
|
|
84
|
+
var legendVisible = extra.legendVisible,
|
|
85
|
+
tooltipFormatter = extra.tooltipFormatter,
|
|
86
|
+
tooltipVisible = extra.tooltipVisible;
|
|
87
|
+
var seriesParam = {
|
|
88
|
+
dimension: dimension,
|
|
89
|
+
metrics: metrics,
|
|
90
|
+
rows: rows,
|
|
91
|
+
seriesMap: seriesMap
|
|
92
|
+
};
|
|
93
|
+
var series = getTreeSeries(seriesParam);
|
|
94
|
+
var legendParam = {
|
|
95
|
+
dimension: dimension,
|
|
96
|
+
rows: rows
|
|
97
|
+
};
|
|
98
|
+
var legend = legendVisible && rows.length > 1 && getTreeLegend(legendParam);
|
|
99
|
+
var tooltip = tooltipVisible && getTreeTooltip({
|
|
100
|
+
tooltipFormatter: tooltipFormatter
|
|
101
|
+
});
|
|
102
|
+
return {
|
|
103
|
+
series: series,
|
|
104
|
+
legend: legend,
|
|
105
|
+
tooltip: tooltip
|
|
106
|
+
};
|
|
107
|
+
};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
import { getFormated } from '@opentiny/vue-renderless/chart-core/deps/utils';
|
|
5
|
+
import { isNull } from '@opentiny/vue-renderless/common/type';
|
|
6
|
+
import { itemLabel, itemContent, SAAS_DEFAULT_COLORS_10 } from '@opentiny/vue-renderless/chart-core/deps/constants';
|
|
7
|
+
var getWaterfallTooltip = function getWaterfallTooltip(dataType, digit) {
|
|
8
|
+
var trigger = 'axis';
|
|
9
|
+
var axisPointer = {
|
|
10
|
+
type: 'shadow'
|
|
11
|
+
};
|
|
12
|
+
var formatter = function formatter(items) {
|
|
13
|
+
var item = items[1];
|
|
14
|
+
return ["".concat(itemContent(item.name), "<br/>").concat(itemLabel(item.seriesName)), "".concat(itemContent(getFormated(item.value, dataType, digit)))].join('');
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
trigger: trigger,
|
|
18
|
+
axisPointer: axisPointer,
|
|
19
|
+
formatter: formatter
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
var getWaterfallXAxis = function getWaterfallXAxis(args) {
|
|
23
|
+
var axisVisible = args.axisVisible,
|
|
24
|
+
dimension = args.dimension,
|
|
25
|
+
labelMap = args.labelMap,
|
|
26
|
+
remainName = args.remainName,
|
|
27
|
+
remainStatus = args.remainStatus,
|
|
28
|
+
rows = args.rows,
|
|
29
|
+
totalName = args.totalName,
|
|
30
|
+
xAxisName = args.xAxisName;
|
|
31
|
+
var xAxisData = [totalName].concat(rows.map(function (row) {
|
|
32
|
+
return row[dimension];
|
|
33
|
+
}));
|
|
34
|
+
remainStatus === 'have-remain' && (xAxisData = xAxisData.concat([remainName]));
|
|
35
|
+
var name = labelMap && labelMap[xAxisName] || xAxisName;
|
|
36
|
+
var xAxis = {
|
|
37
|
+
type: 'category',
|
|
38
|
+
name: name,
|
|
39
|
+
splitLine: {
|
|
40
|
+
show: false
|
|
41
|
+
},
|
|
42
|
+
data: xAxisData,
|
|
43
|
+
show: axisVisible
|
|
44
|
+
};
|
|
45
|
+
var axisLine = {
|
|
46
|
+
show: true,
|
|
47
|
+
lineStyle: {
|
|
48
|
+
color: '#191919',
|
|
49
|
+
opacity: 0.1,
|
|
50
|
+
width: 2
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var axisPointer = {
|
|
54
|
+
type: 'shadow',
|
|
55
|
+
z: 1,
|
|
56
|
+
shadowStyle: {
|
|
57
|
+
color: '#f5f5f5'
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return _objectSpread(_objectSpread({}, xAxis), {}, {
|
|
61
|
+
axisLine: axisLine,
|
|
62
|
+
axisPointer: axisPointer
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
var getWaterfallYAxis = function getWaterfallYAxis(args) {
|
|
66
|
+
var axisVisible = args.axisVisible,
|
|
67
|
+
dataType = args.dataType,
|
|
68
|
+
digit = args.digit,
|
|
69
|
+
labelMap = args.labelMap,
|
|
70
|
+
yAxisName = args.yAxisName;
|
|
71
|
+
var name = !isNull(labelMap[yAxisName]) ? labelMap[yAxisName] : yAxisName;
|
|
72
|
+
var formatter = function formatter(val) {
|
|
73
|
+
return getFormated(val, dataType, digit);
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
type: 'value',
|
|
77
|
+
name: name,
|
|
78
|
+
axisTick: {
|
|
79
|
+
show: false
|
|
80
|
+
},
|
|
81
|
+
axisLabel: {
|
|
82
|
+
formatter: formatter
|
|
83
|
+
},
|
|
84
|
+
show: axisVisible
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
var getWaterfallSeries = function getWaterfallSeries(args) {
|
|
88
|
+
var dataSum = args.dataSum,
|
|
89
|
+
dataType = args.dataType,
|
|
90
|
+
digit = args.digit,
|
|
91
|
+
metrics = args.metrics,
|
|
92
|
+
remainStatus = args.remainStatus,
|
|
93
|
+
rows = args.rows,
|
|
94
|
+
t = args.t,
|
|
95
|
+
totalNum = args.totalNum;
|
|
96
|
+
var seriesBase = {
|
|
97
|
+
type: 'bar',
|
|
98
|
+
stack: t('ui.chart.summation')
|
|
99
|
+
};
|
|
100
|
+
var _ref = {},
|
|
101
|
+
_ref$dataSumTemp = _ref.dataSumTemp,
|
|
102
|
+
dataSumTemp = _ref$dataSumTemp === void 0 ? dataSum : _ref$dataSumTemp,
|
|
103
|
+
_ref$totalNumTemp = _ref.totalNumTemp,
|
|
104
|
+
totalNumTemp = _ref$totalNumTemp === void 0 ? totalNum : _ref$totalNumTemp,
|
|
105
|
+
assistData = _ref.assistData,
|
|
106
|
+
mainData = _ref.mainData;
|
|
107
|
+
var rowData = rows.map(function (row) {
|
|
108
|
+
return row[metrics];
|
|
109
|
+
});
|
|
110
|
+
if (remainStatus === 'have-remain') {
|
|
111
|
+
assistData = [0].concat(rows.map(function (row) {
|
|
112
|
+
return totalNumTemp -= row[metrics];
|
|
113
|
+
})).concat([0]);
|
|
114
|
+
mainData = [totalNum].concat(rowData).concat([totalNum - dataSum]);
|
|
115
|
+
} else {
|
|
116
|
+
assistData = [0].concat(rows.map(function (row) {
|
|
117
|
+
return dataSumTemp -= row[metrics];
|
|
118
|
+
}));
|
|
119
|
+
mainData = [dataSum].concat(rowData);
|
|
120
|
+
}
|
|
121
|
+
var series = [];
|
|
122
|
+
var seriesAdv = {
|
|
123
|
+
name: t('ui.chart.auxiliary'),
|
|
124
|
+
itemStyle: {
|
|
125
|
+
opacity: 0
|
|
126
|
+
},
|
|
127
|
+
emphasis: {
|
|
128
|
+
itemStyle: {
|
|
129
|
+
opacity: 0
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
data: assistData
|
|
133
|
+
};
|
|
134
|
+
series.push(Object.assign(seriesAdv, seriesBase));
|
|
135
|
+
var formatter = function formatter(item) {
|
|
136
|
+
return getFormated(item.value, dataType, digit);
|
|
137
|
+
};
|
|
138
|
+
seriesAdv = {
|
|
139
|
+
name: t('ui.chart.value'),
|
|
140
|
+
label: {
|
|
141
|
+
show: true,
|
|
142
|
+
position: 'top',
|
|
143
|
+
formatter: formatter
|
|
144
|
+
},
|
|
145
|
+
data: mainData
|
|
146
|
+
};
|
|
147
|
+
series.push(Object.assign(seriesAdv, _objectSpread(_objectSpread({}, seriesBase), {}, {
|
|
148
|
+
itemStyle: {
|
|
149
|
+
borderRadius: [4, 4, 0, 0]
|
|
150
|
+
},
|
|
151
|
+
color: SAAS_DEFAULT_COLORS_10[0]
|
|
152
|
+
})));
|
|
153
|
+
return series;
|
|
154
|
+
};
|
|
155
|
+
var getWaterfallRemainStatus = function getWaterfallRemainStatus(dataSum, totalNum) {
|
|
156
|
+
return !totalNum ? 'not-total' : totalNum <= dataSum ? 'none-remain' : 'have-remain';
|
|
157
|
+
};
|
|
158
|
+
export var waterfall = function waterfall(columns, rows, settings, extra) {
|
|
159
|
+
var tooltipVisible = extra.tooltipVisible,
|
|
160
|
+
t = extra.t;
|
|
161
|
+
var _settings$axisVisible = settings.axisVisible,
|
|
162
|
+
axisVisible = _settings$axisVisible === void 0 ? true : _settings$axisVisible,
|
|
163
|
+
_settings$dataType = settings.dataType,
|
|
164
|
+
dataType = _settings$dataType === void 0 ? 'normal' : _settings$dataType,
|
|
165
|
+
_settings$dimension = settings.dimension,
|
|
166
|
+
dimension = _settings$dimension === void 0 ? columns[0] : _settings$dimension;
|
|
167
|
+
var _settings$remainName = settings.remainName,
|
|
168
|
+
remainName = _settings$remainName === void 0 ? t('ui.chart.other') : _settings$remainName,
|
|
169
|
+
_settings$totalName = settings.totalName,
|
|
170
|
+
totalName = _settings$totalName === void 0 ? t('ui.chart.total') : _settings$totalName;
|
|
171
|
+
var totalNum = settings.totalNum,
|
|
172
|
+
_settings$xAxisName = settings.xAxisName,
|
|
173
|
+
xAxisName = _settings$xAxisName === void 0 ? dimension : _settings$xAxisName,
|
|
174
|
+
_settings$digit = settings.digit,
|
|
175
|
+
digit = _settings$digit === void 0 ? 2 : _settings$digit,
|
|
176
|
+
_settings$labelMap = settings.labelMap,
|
|
177
|
+
labelMap = _settings$labelMap === void 0 ? {} : _settings$labelMap;
|
|
178
|
+
var metricsTemp = columns.slice();
|
|
179
|
+
metricsTemp.splice(metricsTemp.indexOf(dimension), 1);
|
|
180
|
+
var _ref2 = {},
|
|
181
|
+
_ref2$metrics = _ref2.metrics,
|
|
182
|
+
metrics = _ref2$metrics === void 0 ? metricsTemp[0] : _ref2$metrics,
|
|
183
|
+
_ref2$yAxisName = _ref2.yAxisName,
|
|
184
|
+
yAxisName = _ref2$yAxisName === void 0 ? metrics : _ref2$yAxisName;
|
|
185
|
+
var tooltip = tooltipVisible && getWaterfallTooltip(dataType, digit);
|
|
186
|
+
var dataSum = parseFloat(rows.reduce(function (pre, cur) {
|
|
187
|
+
return pre + Number(cur[metrics]);
|
|
188
|
+
}, 0).toFixed(digit));
|
|
189
|
+
var remainStatus = getWaterfallRemainStatus(dataSum, totalNum);
|
|
190
|
+
var xAxisParams = {
|
|
191
|
+
dimension: dimension,
|
|
192
|
+
rows: rows,
|
|
193
|
+
remainStatus: remainStatus,
|
|
194
|
+
totalName: totalName
|
|
195
|
+
};
|
|
196
|
+
Object.assign(xAxisParams, {
|
|
197
|
+
remainName: remainName,
|
|
198
|
+
xAxisName: xAxisName,
|
|
199
|
+
labelMap: labelMap,
|
|
200
|
+
axisVisible: axisVisible
|
|
201
|
+
});
|
|
202
|
+
var xAxis = getWaterfallXAxis(xAxisParams);
|
|
203
|
+
var yAxisParams = {
|
|
204
|
+
dataType: dataType,
|
|
205
|
+
yAxisName: yAxisName,
|
|
206
|
+
axisVisible: axisVisible,
|
|
207
|
+
digit: digit,
|
|
208
|
+
labelMap: labelMap
|
|
209
|
+
};
|
|
210
|
+
var yAxis = getWaterfallYAxis(yAxisParams);
|
|
211
|
+
var seriesParams = {
|
|
212
|
+
dataType: dataType,
|
|
213
|
+
rows: rows,
|
|
214
|
+
dimension: dimension,
|
|
215
|
+
metrics: metrics
|
|
216
|
+
};
|
|
217
|
+
Object.assign(seriesParams, {
|
|
218
|
+
totalNum: totalNum,
|
|
219
|
+
remainStatus: remainStatus,
|
|
220
|
+
dataSum: dataSum,
|
|
221
|
+
digit: digit,
|
|
222
|
+
t: t
|
|
223
|
+
});
|
|
224
|
+
var series = getWaterfallSeries(seriesParams);
|
|
225
|
+
return {
|
|
226
|
+
series: series,
|
|
227
|
+
tooltip: tooltip,
|
|
228
|
+
xAxis: xAxis,
|
|
229
|
+
yAxis: yAxis
|
|
230
|
+
};
|
|
231
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { random } from '@opentiny/vue-renderless/common/string';
|
|
2
|
+
import { itemLabel, itemContent } from '@opentiny/vue-renderless/chart-core/deps/constants';
|
|
3
|
+
var isArr = Array.isArray;
|
|
4
|
+
var getSeries = function getSeries(args) {
|
|
5
|
+
var color = args.color,
|
|
6
|
+
dimension = args.dimension,
|
|
7
|
+
metrics = args.metrics,
|
|
8
|
+
rows = args.rows,
|
|
9
|
+
shape = args.shape,
|
|
10
|
+
sizeMax = args.sizeMax,
|
|
11
|
+
sizeMin = args.sizeMin;
|
|
12
|
+
var normalColor;
|
|
13
|
+
if (!isArr(color) && !!color) {
|
|
14
|
+
normalColor = color;
|
|
15
|
+
} else {
|
|
16
|
+
normalColor = function normalColor() {
|
|
17
|
+
var rgb = [Math.round(random() * 160), Math.round(random() * 160), Math.round(random() * 160)].join(',');
|
|
18
|
+
return 'rgb(' + rgb + ')';
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
var textStyle = {
|
|
22
|
+
normal: {
|
|
23
|
+
color: normalColor
|
|
24
|
+
},
|
|
25
|
+
color: normalColor
|
|
26
|
+
};
|
|
27
|
+
var baseType = {
|
|
28
|
+
type: 'wordCloud',
|
|
29
|
+
textStyle: textStyle,
|
|
30
|
+
shape: shape,
|
|
31
|
+
sizeRange: [sizeMin, sizeMax]
|
|
32
|
+
};
|
|
33
|
+
var len = isArr(color) ? color.length : 0;
|
|
34
|
+
baseType.data = rows.slice().map(function (row, i) {
|
|
35
|
+
var text = {
|
|
36
|
+
name: row[dimension],
|
|
37
|
+
value: row[metrics]
|
|
38
|
+
};
|
|
39
|
+
if (len > 0) {
|
|
40
|
+
var wordColor = color[i % len];
|
|
41
|
+
text.textStyle = {
|
|
42
|
+
normal: {
|
|
43
|
+
color: wordColor
|
|
44
|
+
},
|
|
45
|
+
color: wordColor
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return text;
|
|
49
|
+
});
|
|
50
|
+
Object.assign(baseType, {
|
|
51
|
+
rotationRange: [0, 0],
|
|
52
|
+
gridSize: 10
|
|
53
|
+
});
|
|
54
|
+
return [baseType];
|
|
55
|
+
};
|
|
56
|
+
var getTooltip = function getTooltip(args) {
|
|
57
|
+
var tooltipFormatter = args.tooltipFormatter;
|
|
58
|
+
function formatter(params) {
|
|
59
|
+
var data = params.data;
|
|
60
|
+
var name = data.name,
|
|
61
|
+
value = data.value;
|
|
62
|
+
if (tooltipFormatter) {
|
|
63
|
+
return tooltipFormatter.apply(null, params);
|
|
64
|
+
}
|
|
65
|
+
return "".concat(itemLabel(name)).concat(itemContent(value));
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
show: true,
|
|
69
|
+
formatter: formatter
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
var shapeSquare = function shapeSquare(theta) {
|
|
73
|
+
return Math.min(1 / Math.abs(Math.cos(theta)), 1 / Math.abs(Math.sin(theta)));
|
|
74
|
+
};
|
|
75
|
+
export var wordcloud = function wordcloud(columns, rows, settings, extra) {
|
|
76
|
+
var _settings$dimension = settings.dimension,
|
|
77
|
+
dimension = _settings$dimension === void 0 ? columns[0] : _settings$dimension,
|
|
78
|
+
_settings$metrics = settings.metrics,
|
|
79
|
+
metrics = _settings$metrics === void 0 ? columns[1] : _settings$metrics,
|
|
80
|
+
_settings$color = settings.color,
|
|
81
|
+
color = _settings$color === void 0 ? '' : _settings$color;
|
|
82
|
+
var _settings$sizeMax = settings.sizeMax,
|
|
83
|
+
sizeMax = _settings$sizeMax === void 0 ? 60 : _settings$sizeMax,
|
|
84
|
+
_settings$sizeMin = settings.sizeMin,
|
|
85
|
+
sizeMin = _settings$sizeMin === void 0 ? 12 : _settings$sizeMin,
|
|
86
|
+
shape = settings.shape;
|
|
87
|
+
var tooltipVisible = extra.tooltipVisible,
|
|
88
|
+
tooltipFormatter = extra.tooltipFormatter,
|
|
89
|
+
colors = extra.color;
|
|
90
|
+
var seriesParams = {
|
|
91
|
+
dimension: dimension,
|
|
92
|
+
metrics: metrics,
|
|
93
|
+
rows: rows,
|
|
94
|
+
sizeMax: sizeMax,
|
|
95
|
+
sizeMin: sizeMin
|
|
96
|
+
};
|
|
97
|
+
Object.assign(seriesParams, {
|
|
98
|
+
color: color || colors,
|
|
99
|
+
shape: shape || shapeSquare
|
|
100
|
+
});
|
|
101
|
+
var series = getSeries(seriesParams);
|
|
102
|
+
var tooltip = tooltipVisible && getTooltip({
|
|
103
|
+
tooltipFormatter: tooltipFormatter
|
|
104
|
+
});
|
|
105
|
+
return {
|
|
106
|
+
series: series,
|
|
107
|
+
tooltip: tooltip
|
|
108
|
+
};
|
|
109
|
+
};
|
package/checkbox/index.js
CHANGED
|
@@ -20,13 +20,13 @@ export var handleChange = function handleChange(_ref2) {
|
|
|
20
20
|
if (state.isLimitExceeded) {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
var
|
|
23
|
+
var moduleValue;
|
|
24
24
|
if (event.target.checked) {
|
|
25
|
-
|
|
25
|
+
moduleValue = props.trueLabel === undefined ? true : props.trueLabel;
|
|
26
26
|
} else {
|
|
27
|
-
|
|
27
|
+
moduleValue = props.falseLabel === undefined ? false : props.falseLabel;
|
|
28
28
|
}
|
|
29
|
-
emit('change',
|
|
29
|
+
emit('change', moduleValue, event);
|
|
30
30
|
nextTick(function () {
|
|
31
31
|
state.isGroup && dispatch(constants.CHECKBOX_GROUP, 'change', [state.checkboxGroup.modelValue]);
|
|
32
32
|
});
|
package/checkbox-button/index.js
CHANGED
|
@@ -6,7 +6,9 @@ export var handleChange = function handleChange(_ref) {
|
|
|
6
6
|
dispatch = _ref.dispatch,
|
|
7
7
|
constants = _ref.constants;
|
|
8
8
|
return function (event) {
|
|
9
|
-
if (state.isLimitExceeded)
|
|
9
|
+
if (state.isLimitExceeded) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
10
12
|
var value;
|
|
11
13
|
if (event.target.checked) {
|
|
12
14
|
value = props.trueLabel === undefined ? true : props.trueLabel;
|
package/common/bigInt.js
CHANGED
|
@@ -112,14 +112,17 @@ export var BigIntDecimal = function () {
|
|
|
112
112
|
if (typeof mergedValue !== 'string') {
|
|
113
113
|
num2str(mergedValue);
|
|
114
114
|
}
|
|
115
|
+
var f = Function;
|
|
116
|
+
var convertBigInt = function convertBigInt(str) {
|
|
117
|
+
return f("return BigInt(".concat(str, ")"))();
|
|
118
|
+
};
|
|
115
119
|
if (validateNumber(mergedValue)) {
|
|
116
120
|
var trimRet = trimNumber(mergedValue);
|
|
117
121
|
this.negative = trimRet.negative;
|
|
118
122
|
var numbers = trimRet.trimStr.split('.');
|
|
119
123
|
this.integer = BigInt(numbers[0]);
|
|
120
124
|
var decimalStr = numbers[1] || '0';
|
|
121
|
-
this.
|
|
122
|
-
this.decimal = BigInt(decimalStr);
|
|
125
|
+
this.decimal = convertBigInt(decimalStr);
|
|
123
126
|
} else {
|
|
124
127
|
this.nan = true;
|
|
125
128
|
}
|
package/common/date.js
CHANGED
|
@@ -60,9 +60,9 @@ var getDateFromData = function getDateFromData(_ref) {
|
|
|
60
60
|
};
|
|
61
61
|
var yyyymmddDateParser = function yyyymmddDateParser(m) {
|
|
62
62
|
if (m.length === 23) {
|
|
63
|
-
var year = m[1]
|
|
63
|
+
var year = Number(m[1]);
|
|
64
64
|
var month = m[3] - 1;
|
|
65
|
-
var date = (m[9] || 1)
|
|
65
|
+
var date = Number(m[9] || 1);
|
|
66
66
|
var hours = m[15] || 0;
|
|
67
67
|
var minutes = m[17] || 0;
|
|
68
68
|
var seconds = m[20] || 0;
|
|
@@ -80,9 +80,9 @@ var yyyymmddDateParser = function yyyymmddDateParser(m) {
|
|
|
80
80
|
};
|
|
81
81
|
var mmddyyyyDateParser = function mmddyyyyDateParser(m) {
|
|
82
82
|
if (m.length === 22) {
|
|
83
|
-
var year = m[12]
|
|
83
|
+
var year = Number(m[12]);
|
|
84
84
|
var month = m[1] - 1;
|
|
85
|
-
var date = (m[6] || 1)
|
|
85
|
+
var date = Number(m[6] || 1);
|
|
86
86
|
var hours = m[14] || 0;
|
|
87
87
|
var minutes = m[16] || 0;
|
|
88
88
|
var seconds = m[19] || 0;
|
|
@@ -102,9 +102,9 @@ var iso8601DateParser = function iso8601DateParser(m) {
|
|
|
102
102
|
if (m.length !== 25) {
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
|
-
var year = m[1]
|
|
105
|
+
var year = Number(m[1]);
|
|
106
106
|
var month = m[2] - 1;
|
|
107
|
-
var date = m[6]
|
|
107
|
+
var date = Number(m[6]);
|
|
108
108
|
var offset = new Date(year, month, date).getTimezoneOffset();
|
|
109
109
|
var hours = m[12] || 0;
|
|
110
110
|
var minutes = m[14] || 0;
|
|
@@ -131,8 +131,8 @@ var iso8601DateParser = function iso8601DateParser(m) {
|
|
|
131
131
|
if (timezones.indexOf(timeZone) === -1) {
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
|
-
actHours = sign === '+' ? hours - offsetHours - offset / 60 : hours
|
|
135
|
-
actMinutes = sign === '+' ? minutes - offsetMinutes : minutes
|
|
134
|
+
actHours = sign === '+' ? hours - offsetHours - offset / 60 : Number(hours) + Number(offsetHours) - offset / 60;
|
|
135
|
+
actMinutes = sign === '+' ? minutes - offsetMinutes : Number(minutes) + Number(offsetMinutes);
|
|
136
136
|
}
|
|
137
137
|
return new Date(year, month, date, actHours, actMinutes, seconds, milliseconds);
|
|
138
138
|
}
|
|
@@ -192,7 +192,7 @@ var getDateArray = function getDateArray(str, dateFormat) {
|
|
|
192
192
|
var textPos = 0;
|
|
193
193
|
for (var i = 0, len = str.length; i < len; i++) {
|
|
194
194
|
var charValue = str.substr(i, 1);
|
|
195
|
-
var notNum = isNaN(charValue
|
|
195
|
+
var notNum = isNaN(Number(charValue)) || charValue.trim() === '';
|
|
196
196
|
if (notNum && charValue === dateFormat.substr(i, 1) || i === len - 1) {
|
|
197
197
|
var value = void 0;
|
|
198
198
|
var text = void 0;
|
|
@@ -229,13 +229,13 @@ var invalideValue = function invalideValue(_ref2) {
|
|
|
229
229
|
var innerParse = function innerParse(value, dateFormat) {
|
|
230
230
|
if (typeof dateFormat === 'string') {
|
|
231
231
|
var arr = getDateArray(value, dateFormat);
|
|
232
|
-
var year = arr[0]
|
|
233
|
-
var month = arr[1]
|
|
234
|
-
var date = (arr[2] || 1)
|
|
235
|
-
var hours = (arr[3] || 0)
|
|
236
|
-
var minutes = (arr[4] || 0)
|
|
237
|
-
var seconds = (arr[5] || 0)
|
|
238
|
-
var milliseconds = (arr[6] || 0)
|
|
232
|
+
var year = Number(arr[0]);
|
|
233
|
+
var month = Number(arr[1]);
|
|
234
|
+
var date = Number(arr[2] || 1);
|
|
235
|
+
var hours = Number(arr[3] || 0);
|
|
236
|
+
var minutes = Number(arr[4] || 0);
|
|
237
|
+
var seconds = Number(arr[5] || 0);
|
|
238
|
+
var milliseconds = Number(arr[6] || 0);
|
|
239
239
|
if (invalideValue({
|
|
240
240
|
year: year,
|
|
241
241
|
month: month,
|
|
@@ -342,7 +342,7 @@ export var getStrTimezone = function getStrTimezone(value) {
|
|
|
342
342
|
var localTimeZone = getLocalTimezone();
|
|
343
343
|
var match = typeof value === 'string' && value.match(TZRE);
|
|
344
344
|
if (match) {
|
|
345
|
-
var minoffset = match[2]
|
|
345
|
+
var minoffset = Number(match[2]) + Number(match[3]) / 60;
|
|
346
346
|
value = minoffset * "".concat(match[1], "1");
|
|
347
347
|
}
|
|
348
348
|
if (isNumber(value) && value >= -12 && value <= 12) {
|
package/common/deps/date-util.js
CHANGED
|
@@ -32,9 +32,15 @@ export var getI18nSettings = function getI18nSettings(t) {
|
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
export var isDate = function isDate(date) {
|
|
35
|
-
if (isNull(date))
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
if (isNull(date)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (isNaN(new Date(date).getTime())) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
if (Array.isArray(date)) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
38
44
|
return true;
|
|
39
45
|
};
|
|
40
46
|
export var toDate = function toDate(date) {
|
|
@@ -45,7 +51,9 @@ export var isDateObject = function isDateObject(val) {
|
|
|
45
51
|
};
|
|
46
52
|
export var formatDate = function formatDate(date, format, t) {
|
|
47
53
|
date = toDate(date);
|
|
48
|
-
if (!date)
|
|
54
|
+
if (!date) {
|
|
55
|
+
return '';
|
|
56
|
+
}
|
|
49
57
|
return fecha.format(date, format || defaultYMD, getI18nSettings(t));
|
|
50
58
|
};
|
|
51
59
|
export var parseDate = function parseDate(string, format, t) {
|
|
@@ -136,7 +144,9 @@ export var getMonthDays = function getMonthDays(date) {
|
|
|
136
144
|
});
|
|
137
145
|
};
|
|
138
146
|
export var getPrevMonthLastDays = function getPrevMonthLastDays(date, amount) {
|
|
139
|
-
if (amount <= 0)
|
|
147
|
+
if (amount <= 0) {
|
|
148
|
+
return [];
|
|
149
|
+
}
|
|
140
150
|
var timeValue = new Date(date.getTime());
|
|
141
151
|
timeValue.setDate(0);
|
|
142
152
|
var lastDay = timeValue.getDate();
|