sea-chart 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/lib/assets/icons/area-chart.svg +10 -0
- package/lib/assets/icons/bar-chart.svg +12 -0
- package/lib/assets/icons/card.svg +22 -0
- package/lib/assets/icons/combination-chart.svg +17 -0
- package/lib/assets/icons/dtable-logo.svg +16 -0
- package/lib/assets/icons/facet-chart.svg +12 -0
- package/lib/assets/icons/gauge.svg +18 -0
- package/lib/assets/icons/heat-map.svg +14 -0
- package/lib/assets/icons/histogram.svg +12 -0
- package/lib/assets/icons/line-chart.svg +12 -0
- package/lib/assets/icons/map.svg +20 -0
- package/lib/assets/icons/pie-chart.svg +11 -0
- package/lib/assets/icons/rectangular-tree-diagram.svg +10 -0
- package/lib/assets/icons/scatter-chart.svg +15 -0
- package/lib/assets/icons/type-change.svg +17 -0
- package/lib/assets/img/area-chart.png +0 -0
- package/lib/assets/img/area-group-chart.png +0 -0
- package/lib/assets/img/bar-group.png +0 -0
- package/lib/assets/img/bar-stack.png +0 -0
- package/lib/assets/img/bar.png +0 -0
- package/lib/assets/img/combination-chart.png +0 -0
- package/lib/assets/img/compared-chart.png +0 -0
- package/lib/assets/img/completeness-chart.png +0 -0
- package/lib/assets/img/custom-bar.png +0 -0
- package/lib/assets/img/dashboard-chart.png +0 -0
- package/lib/assets/img/group-completeness-chart.png +0 -0
- package/lib/assets/img/group_line.png +0 -0
- package/lib/assets/img/heat-map.png +0 -0
- package/lib/assets/img/horizontal-bar.png +0 -0
- package/lib/assets/img/horizontal-group-bar.png +0 -0
- package/lib/assets/img/line.png +0 -0
- package/lib/assets/img/map-bubble.png +0 -0
- package/lib/assets/img/map.png +0 -0
- package/lib/assets/img/mirror.png +0 -0
- package/lib/assets/img/number-card.png +0 -0
- package/lib/assets/img/pie.png +0 -0
- package/lib/assets/img/pivot-table.png +0 -0
- package/lib/assets/img/ring.png +0 -0
- package/lib/assets/img/scatter.png +0 -0
- package/lib/assets/img/stacked-horizontal-bar.png +0 -0
- package/lib/assets/img/treemap.png +0 -0
- package/lib/assets/img/trend-chart.png +0 -0
- package/lib/assets/img/world-map-bubble.png +0 -0
- package/lib/assets/img/world-map.png +0 -0
- package/lib/components/collaborator/index.js +24 -0
- package/lib/components/formatter/area.js +162 -0
- package/lib/components/formatter/bar-group.js +160 -0
- package/lib/components/formatter/bar.js +150 -0
- package/lib/components/formatter/basic-number-card.js +138 -0
- package/lib/components/formatter/chart-component.js +266 -0
- package/lib/components/formatter/combination.js +407 -0
- package/lib/components/formatter/dashboard.js +182 -0
- package/lib/components/formatter/horizontal-bar-group.js +161 -0
- package/lib/components/formatter/horizontal-bar.js +152 -0
- package/lib/components/formatter/horizontal-component.js +91 -0
- package/lib/components/formatter/index.js +181 -0
- package/lib/components/formatter/line-group.js +157 -0
- package/lib/components/formatter/line.js +170 -0
- package/lib/components/formatter/pie.js +201 -0
- package/lib/components/formatter/ring.js +277 -0
- package/lib/components/formatter/table/index.css +103 -0
- package/lib/components/formatter/table/index.js +42 -0
- package/lib/components/formatter/table/one-dimension-table-no-numeric-columns.js +145 -0
- package/lib/components/formatter/table/one-dimension-table-with-numeric-columns.js +193 -0
- package/lib/components/formatter/table/pivot-table-display-name.js +249 -0
- package/lib/components/formatter/table/two-dimension-table.js +241 -0
- package/lib/components/formatter/treemap.js +213 -0
- package/lib/components/icon/index.css +5 -0
- package/lib/components/icon/index.js +22 -0
- package/lib/components/index.js +5 -0
- package/lib/components/loading/index.css +54 -0
- package/lib/components/loading/index.js +10 -0
- package/lib/components/number-input/index.js +31 -0
- package/lib/components/pixel-editor/index.css +29 -0
- package/lib/components/pixel-editor/index.js +42 -0
- package/lib/components/select-group/index.css +67 -0
- package/lib/components/select-group/index.js +63 -0
- package/lib/components/settings/advance-bar-settings/data-settings.js +120 -0
- package/lib/components/settings/advance-bar-settings/index.js +3 -0
- package/lib/components/settings/advance-bar-settings/style-settings.js +149 -0
- package/lib/components/settings/bar-settings/data-settings.js +137 -0
- package/lib/components/settings/bar-settings/index.js +3 -0
- package/lib/components/settings/bar-settings/style-settings.js +163 -0
- package/lib/components/settings/basic-number-card/data-settings.js +121 -0
- package/lib/components/settings/basic-number-card/index.js +3 -0
- package/lib/components/settings/basic-number-card/style-settings.js +42 -0
- package/lib/components/settings/combination-settings/data-settings.js +256 -0
- package/lib/components/settings/combination-settings/index.js +3 -0
- package/lib/components/settings/combination-settings/style-settings.js +183 -0
- package/lib/components/settings/dashboard-settings/data-settings.js +167 -0
- package/lib/components/settings/dashboard-settings/index.js +2 -0
- package/lib/components/settings/data-settings.js +67 -0
- package/lib/components/settings/horizontal-bar-settings/data-settings.js +45 -0
- package/lib/components/settings/horizontal-bar-settings/index.js +3 -0
- package/lib/components/settings/horizontal-bar-settings/style-settings.js +38 -0
- package/lib/components/settings/index.css +73 -0
- package/lib/components/settings/index.js +74 -0
- package/lib/components/settings/pie-settings/data-settings.js +123 -0
- package/lib/components/settings/pie-settings/index.js +3 -0
- package/lib/components/settings/pie-settings/style-settings.js +123 -0
- package/lib/components/settings/style-settings.js +100 -0
- package/lib/components/settings/table-settings/data-settings.js +488 -0
- package/lib/components/settings/table-settings/index.js +2 -0
- package/lib/components/settings/time-comparison-settings/data-settings.js +157 -0
- package/lib/components/settings/time-comparison-settings/index.js +3 -0
- package/lib/components/settings/time-comparison-settings/style-settings.js +191 -0
- package/lib/components/settings/widgets/basic-summary/index.css +12 -0
- package/lib/components/settings/widgets/basic-summary/index.js +173 -0
- package/lib/components/settings/widgets/common-data-settings.js +42 -0
- package/lib/components/settings/widgets/data-filter/index.css +17 -0
- package/lib/components/settings/widgets/data-filter/index.js +76 -0
- package/lib/components/settings/widgets/data-sort.js +38 -0
- package/lib/components/settings/widgets/date-summary-item.js +126 -0
- package/lib/components/settings/widgets/display-values-settings/index.css +13 -0
- package/lib/components/settings/widgets/display-values-settings/index.js +37 -0
- package/lib/components/settings/widgets/divider/index.css +4 -0
- package/lib/components/settings/widgets/divider/index.js +10 -0
- package/lib/components/settings/widgets/font-settings/font-size-settings.js +31 -0
- package/lib/components/settings/widgets/font-settings/font-weight-settings.js +46 -0
- package/lib/components/settings/widgets/font-settings/index.js +3 -0
- package/lib/components/settings/widgets/group-by.js +168 -0
- package/lib/components/settings/widgets/label-color.js +30 -0
- package/lib/components/settings/widgets/min-max-setting.js +64 -0
- package/lib/components/settings/widgets/mininum-slice-percent.js +72 -0
- package/lib/components/settings/widgets/numeric-summary-item.js +109 -0
- package/lib/components/settings/widgets/select-table/index.css +0 -0
- package/lib/components/settings/widgets/select-table/index.js +49 -0
- package/lib/components/settings/widgets/stack.js +58 -0
- package/lib/components/settings/widgets/statistic-type/index.css +31 -0
- package/lib/components/settings/widgets/statistic-type/index.js +54 -0
- package/lib/components/settings/widgets/summary-method-setting.js +80 -0
- package/lib/components/settings/widgets/summary-settings.js +394 -0
- package/lib/components/settings/widgets/switch/index.css +37 -0
- package/lib/components/settings/widgets/switch/index.js +21 -0
- package/lib/components/settings/widgets/text-horizontal-settings.js +23 -0
- package/lib/components/settings/widgets/time-picker.js +182 -0
- package/lib/components/settings/widgets/title-settings/index.js +58 -0
- package/lib/components/settings/widgets/title-settings/title-text.js +31 -0
- package/lib/components/settings/widgets/x-axios.js +0 -0
- package/lib/components/settings/widgets/y-axis-group-settings.js +399 -0
- package/lib/components/types-dialog/index.css +97 -0
- package/lib/components/types-dialog/index.js +127 -0
- package/lib/constants/geolocation.js +11 -0
- package/lib/constants/index.js +164 -0
- package/lib/constants/model.js +167 -0
- package/lib/constants/style.js +13 -0
- package/lib/constants/type-image.js +32 -0
- package/lib/constants/type.js +97 -0
- package/lib/context.js +49 -0
- package/lib/index.js +6 -0
- package/lib/intl.js +37 -0
- package/lib/layout/index.js +4 -0
- package/lib/layout/statistic/index.css +53 -0
- package/lib/layout/statistic/index.js +190 -0
- package/lib/layout/title/index.css +3 -0
- package/lib/layout/title/index.js +41 -0
- package/lib/locale/index.js +11 -0
- package/lib/locale/lang/de.js +141 -0
- package/lib/locale/lang/en.js +143 -0
- package/lib/locale/lang/es.js +141 -0
- package/lib/locale/lang/fr.js +141 -0
- package/lib/locale/lang/pt.js +141 -0
- package/lib/locale/lang/ru.js +141 -0
- package/lib/locale/lang/zh_CN.js +143 -0
- package/lib/model/area-group.js +51 -0
- package/lib/model/area.js +42 -0
- package/lib/model/bar-group.js +54 -0
- package/lib/model/bar-stack.js +51 -0
- package/lib/model/bar.js +48 -0
- package/lib/model/base-model.js +11 -0
- package/lib/model/basic-number-card.js +32 -0
- package/lib/model/combination.js +48 -0
- package/lib/model/compare-bar.js +49 -0
- package/lib/model/completeness-group.js +34 -0
- package/lib/model/completeness.js +28 -0
- package/lib/model/dashboard.js +26 -0
- package/lib/model/generic-model.js +235 -0
- package/lib/model/heat-map.js +33 -0
- package/lib/model/horizontal-bar.js +48 -0
- package/lib/model/horizontal-group-bar.js +53 -0
- package/lib/model/index.js +36 -0
- package/lib/model/line-group.js +54 -0
- package/lib/model/line.js +48 -0
- package/lib/model/map-bubble.js +37 -0
- package/lib/model/map.js +37 -0
- package/lib/model/mirror.js +36 -0
- package/lib/model/pie.js +36 -0
- package/lib/model/ring.js +36 -0
- package/lib/model/scatter.js +29 -0
- package/lib/model/stacked-horizontal-bar.js +42 -0
- package/lib/model/statistic.js +22 -0
- package/lib/model/table.js +33 -0
- package/lib/model/tree-map.js +30 -0
- package/lib/model/trend.js +34 -0
- package/lib/model/user.js +22 -0
- package/lib/model/world-map-bubble.js +36 -0
- package/lib/model/world-map.js +36 -0
- package/lib/utils/cell-format-utils.js +41 -0
- package/lib/utils/chart.js +6 -0
- package/lib/utils/collaborator-utils.js +40 -0
- package/lib/utils/column-utils.js +247 -0
- package/lib/utils/custom-g2.js +612 -0
- package/lib/utils/data-filter/filter-item-utils.js +80 -0
- package/lib/utils/data-filter/filters-utils.js +406 -0
- package/lib/utils/data-filter/index.js +3 -0
- package/lib/utils/date-translate.js +66 -0
- package/lib/utils/index.js +50 -0
- package/lib/utils/key-generator.js +13 -0
- package/lib/utils/object-utils.js +61 -0
- package/lib/utils/options-utils.js +61 -0
- package/lib/utils/statistic-column-2-sql-column-utils.js +499 -0
- package/lib/utils/statistic-utils.js +1685 -0
- package/package.json +160 -0
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
// 注册主题
|
|
2
|
+
import * as CanvasEngine from '@antv/g-canvas/esm/index';
|
|
3
|
+
import Area from '@antv/g2/esm/geometry/area';
|
|
4
|
+
import Edge from '@antv/g2/esm/geometry/edge';
|
|
5
|
+
import HeatMap from '@antv/g2/esm/geometry/heatmap';
|
|
6
|
+
import Interval from '@antv/g2/esm/geometry/interval';
|
|
7
|
+
import Line from '@antv/g2/esm/geometry/line';
|
|
8
|
+
import Path from '@antv/g2/esm/geometry/path';
|
|
9
|
+
import Point from '@antv/g2/esm/geometry/point';
|
|
10
|
+
import Polygon from '@antv/g2/esm/geometry/polygon';
|
|
11
|
+
import Schema from '@antv/g2/esm/geometry/schema';
|
|
12
|
+
// 引入所有内置的 shapes
|
|
13
|
+
import '@antv/g2/esm/geometry/shape/area/line';
|
|
14
|
+
import '@antv/g2/esm/geometry/shape/area/smooth';
|
|
15
|
+
import '@antv/g2/esm/geometry/shape/area/smooth-line';
|
|
16
|
+
import '@antv/g2/esm/geometry/shape/edge/arc';
|
|
17
|
+
import '@antv/g2/esm/geometry/shape/edge/smooth';
|
|
18
|
+
import '@antv/g2/esm/geometry/shape/edge/vhv';
|
|
19
|
+
import '@antv/g2/esm/geometry/shape/interval/funnel';
|
|
20
|
+
import '@antv/g2/esm/geometry/shape/interval/hollow-rect';
|
|
21
|
+
import '@antv/g2/esm/geometry/shape/interval/line';
|
|
22
|
+
import '@antv/g2/esm/geometry/shape/interval/pyramid';
|
|
23
|
+
import '@antv/g2/esm/geometry/shape/interval/tick';
|
|
24
|
+
import '@antv/g2/esm/geometry/shape/line/step';
|
|
25
|
+
import '@antv/g2/esm/geometry/shape/point/hollow';
|
|
26
|
+
import '@antv/g2/esm/geometry/shape/point/image';
|
|
27
|
+
import '@antv/g2/esm/geometry/shape/point/solid';
|
|
28
|
+
import '@antv/g2/esm/geometry/shape/schema/box';
|
|
29
|
+
import '@antv/g2/esm/geometry/shape/schema/candle';
|
|
30
|
+
import GeometryLabel from '@antv/g2/esm/geometry/label/base';
|
|
31
|
+
import IntervalLabel from '@antv/g2/esm/geometry/label/interval';
|
|
32
|
+
import PieLabel from '@antv/g2/esm/geometry/label/pie';
|
|
33
|
+
import PolarLabel from '@antv/g2/esm/geometry/label/polar';
|
|
34
|
+
import { limitInCanvas } from '@antv/g2/esm/geometry/label/layout/limit-in-canvas';
|
|
35
|
+
import { limitInShape } from '@antv/g2/esm/geometry/label/layout/limit-in-shape';
|
|
36
|
+
import { fixedOverlap, overlap } from '@antv/g2/esm/geometry/label/layout/overlap';
|
|
37
|
+
import { fadeIn, fadeOut } from '@antv/g2/esm/animate/animation/fade';
|
|
38
|
+
import { growInX, growInXY, growInY } from '@antv/g2/esm/animate/animation/grow-in';
|
|
39
|
+
import { pathIn } from '@antv/g2/esm/animate/animation/path-in';
|
|
40
|
+
import { positionUpdate } from '@antv/g2/esm/animate/animation/position-update';
|
|
41
|
+
import { scaleInX, scaleInY } from '@antv/g2/esm/animate/animation/scale-in';
|
|
42
|
+
import { sectorPathUpdate } from '@antv/g2/esm/animate/animation/sector-path-update';
|
|
43
|
+
import { waveIn } from '@antv/g2/esm/animate/animation/wave-in';
|
|
44
|
+
import { zoomIn, zoomOut } from '@antv/g2/esm/animate/animation/zoom';
|
|
45
|
+
import { registerEngine, registerGeometry, registerAnimation, registerFacet, registerComponentController, registerAction, registerInteraction, registerGeometryLabelLayout, registerGeometryLabel } from '@antv/g2/esm/core';
|
|
46
|
+
import Circle from '@antv/g2/esm/facet/circle';
|
|
47
|
+
import List from '@antv/g2/esm/facet/list';
|
|
48
|
+
import Matrix from '@antv/g2/esm/facet/matrix';
|
|
49
|
+
import Mirror from '@antv/g2/esm/facet/mirror';
|
|
50
|
+
import Rect from '@antv/g2/esm/facet/rect';
|
|
51
|
+
import Tree from '@antv/g2/esm/facet/tree';
|
|
52
|
+
import Annotation from '@antv/g2/esm/chart/controller/annotation';
|
|
53
|
+
import Axis from '@antv/g2/esm/chart/controller/axis';
|
|
54
|
+
import Legend from '@antv/g2/esm/chart/controller/legend';
|
|
55
|
+
import Slider from '@antv/g2/esm/chart/controller/slider';
|
|
56
|
+
import Tooltip from '@antv/g2/esm/chart/controller/tooltip';
|
|
57
|
+
import ActiveRegion from '@antv/g2/esm/interaction/action/active-region';
|
|
58
|
+
import SiblingTooltip from '@antv/g2/esm/interaction/action/component/tooltip/sibling';
|
|
59
|
+
import TooltipAction from '@antv/g2/esm/interaction/action/component/tooltip/geometry';
|
|
60
|
+
import ElementActive from '@antv/g2/esm/interaction/action/element/active';
|
|
61
|
+
import ElementLinkByColor from '@antv/g2/esm/interaction/action/element/link-by-color';
|
|
62
|
+
import ElementRangeActive from '@antv/g2/esm/interaction/action/element/range-active';
|
|
63
|
+
import ElementSingleActive from '@antv/g2/esm/interaction/action/element/single-active';
|
|
64
|
+
import ElementHighlight from '@antv/g2/esm/interaction/action/element/highlight';
|
|
65
|
+
import ElementHighlightByColor from '@antv/g2/esm/interaction/action/element/highlight-by-color';
|
|
66
|
+
import ElementHighlightByX from '@antv/g2/esm/interaction/action/element/highlight-by-x';
|
|
67
|
+
import ElementRangeHighlight from '@antv/g2/esm/interaction/action/element/range-highlight';
|
|
68
|
+
import ElementSingleHighlight from '@antv/g2/esm/interaction/action/element/single-highlight';
|
|
69
|
+
import ElementRangeSelected from '@antv/g2/esm/interaction/action/element/range-selected';
|
|
70
|
+
import ElementSelected from '@antv/g2/esm/interaction/action/element/selected';
|
|
71
|
+
import ElementSingleSelected from '@antv/g2/esm/interaction/action/element/single-selected';
|
|
72
|
+
import ListActive from '@antv/g2/esm/interaction/action/component/list-active';
|
|
73
|
+
import ListHighlight from '@antv/g2/esm/interaction/action/component/list-highlight';
|
|
74
|
+
import ListSelected from '@antv/g2/esm/interaction/action/component/list-selected';
|
|
75
|
+
import ListUnchecked from '@antv/g2/esm/interaction/action/component/list-unchecked';
|
|
76
|
+
import CircleMask from '@antv/g2/esm/interaction/action/mask/circle';
|
|
77
|
+
import DimMask from '@antv/g2/esm/interaction/action/mask/dim-rect';
|
|
78
|
+
import PathMask from '@antv/g2/esm/interaction/action/mask/path';
|
|
79
|
+
import RectMask from '@antv/g2/esm/interaction/action/mask/rect';
|
|
80
|
+
import SmoothPathMask from '@antv/g2/esm/interaction/action/mask/smooth-path';
|
|
81
|
+
import CursorAction from '@antv/g2/esm/interaction/action/cursor';
|
|
82
|
+
import DataFilter from '@antv/g2/esm/interaction/action/data/filter';
|
|
83
|
+
import DataRangeFilter from '@antv/g2/esm/interaction/action/data/range-filter';
|
|
84
|
+
import SiblingFilter from '@antv/g2/esm/interaction/action/data/sibling-filter';
|
|
85
|
+
import ElementFilter from '@antv/g2/esm/interaction/action/element/filter';
|
|
86
|
+
import ElementSiblingFilter from '@antv/g2/esm/interaction/action/element/sibling-filter';
|
|
87
|
+
import ButtonAction from '@antv/g2/esm/interaction/action/view/button';
|
|
88
|
+
import ViewDrag from '@antv/g2/esm/interaction/action/view/drag';
|
|
89
|
+
import ViewMove from '@antv/g2/esm/interaction/action/view/move';
|
|
90
|
+
import ScaleTranslate from '@antv/g2/esm/interaction/action/view/scale-translate';
|
|
91
|
+
import ScaleZoom from '@antv/g2/esm/interaction/action/view/scale-zoom';
|
|
92
|
+
import { getAngle, polarToCartesian } from '@antv/g2/esm/util/graphics';
|
|
93
|
+
import { rotate, transform, translate, zoom } from '@antv/g2/esm/util/transform';
|
|
94
|
+
export { getRectWithCornerRadius } from '@antv/g2/esm/geometry/shape/interval/util';
|
|
95
|
+
// 注册 G 渲染引擎
|
|
96
|
+
registerEngine('canvas', CanvasEngine);
|
|
97
|
+
|
|
98
|
+
// 注册 G2 内置的 geometry
|
|
99
|
+
registerGeometry('Polygon', Polygon);
|
|
100
|
+
registerGeometry('Interval', Interval);
|
|
101
|
+
registerGeometry('Schema', Schema);
|
|
102
|
+
registerGeometry('Path', Path);
|
|
103
|
+
registerGeometry('Point', Point);
|
|
104
|
+
registerGeometry('Line', Line);
|
|
105
|
+
registerGeometry('Area', Area);
|
|
106
|
+
registerGeometry('Edge', Edge);
|
|
107
|
+
registerGeometry('Heatmap', HeatMap);
|
|
108
|
+
|
|
109
|
+
// 注册 Geometry 内置的 label
|
|
110
|
+
registerGeometryLabel('base', GeometryLabel);
|
|
111
|
+
registerGeometryLabel('interval', IntervalLabel);
|
|
112
|
+
registerGeometryLabel('pie', PieLabel);
|
|
113
|
+
registerGeometryLabel('polar', PolarLabel);
|
|
114
|
+
|
|
115
|
+
// 注册 Geometry label 内置的布局函数
|
|
116
|
+
registerGeometryLabelLayout('overlap', overlap);
|
|
117
|
+
registerGeometryLabelLayout('fixed-overlap', fixedOverlap);
|
|
118
|
+
registerGeometryLabelLayout('limit-in-shape', limitInShape);
|
|
119
|
+
registerGeometryLabelLayout('limit-in-canvas', limitInCanvas);
|
|
120
|
+
|
|
121
|
+
// 注册需要的动画执行函数
|
|
122
|
+
registerAnimation('fade-in', fadeIn);
|
|
123
|
+
registerAnimation('fade-out', fadeOut);
|
|
124
|
+
registerAnimation('grow-in-x', growInX);
|
|
125
|
+
registerAnimation('grow-in-xy', growInXY);
|
|
126
|
+
registerAnimation('grow-in-y', growInY);
|
|
127
|
+
registerAnimation('scale-in-x', scaleInX);
|
|
128
|
+
registerAnimation('scale-in-y', scaleInY);
|
|
129
|
+
registerAnimation('wave-in', waveIn);
|
|
130
|
+
registerAnimation('zoom-in', zoomIn);
|
|
131
|
+
registerAnimation('zoom-out', zoomOut);
|
|
132
|
+
registerAnimation('position-update', positionUpdate);
|
|
133
|
+
registerAnimation('sector-path-update', sectorPathUpdate);
|
|
134
|
+
registerAnimation('path-in', pathIn);
|
|
135
|
+
|
|
136
|
+
// 注册内置的 Facet
|
|
137
|
+
registerFacet('rect', Rect);
|
|
138
|
+
registerFacet('mirror', Mirror);
|
|
139
|
+
registerFacet('list', List);
|
|
140
|
+
registerFacet('matrix', Matrix);
|
|
141
|
+
registerFacet('circle', Circle);
|
|
142
|
+
registerFacet('tree', Tree);
|
|
143
|
+
|
|
144
|
+
// 注册内置的 Component
|
|
145
|
+
// register build-in components
|
|
146
|
+
registerComponentController('axis', Axis);
|
|
147
|
+
registerComponentController('legend', Legend);
|
|
148
|
+
registerComponentController('tooltip', Tooltip);
|
|
149
|
+
registerComponentController('annotation', Annotation);
|
|
150
|
+
registerComponentController('slider', Slider);
|
|
151
|
+
|
|
152
|
+
// 注册 Interaction Action
|
|
153
|
+
registerAction('tooltip', TooltipAction);
|
|
154
|
+
registerAction('sibling-tooltip', SiblingTooltip);
|
|
155
|
+
registerAction('element-active', ElementActive);
|
|
156
|
+
registerAction('element-single-active', ElementSingleActive);
|
|
157
|
+
registerAction('element-range-active', ElementRangeActive);
|
|
158
|
+
registerAction('element-highlight', ElementHighlight);
|
|
159
|
+
registerAction('element-highlight-by-x', ElementHighlightByX);
|
|
160
|
+
registerAction('element-highlight-by-color', ElementHighlightByColor);
|
|
161
|
+
registerAction('element-single-highlight', ElementSingleHighlight);
|
|
162
|
+
registerAction('element-range-highlight', ElementRangeHighlight);
|
|
163
|
+
registerAction('element-sibling-highlight', ElementRangeHighlight, {
|
|
164
|
+
effectSiblings: true,
|
|
165
|
+
effectByRecord: true
|
|
166
|
+
});
|
|
167
|
+
registerAction('element-selected', ElementSelected);
|
|
168
|
+
registerAction('element-single-selected', ElementSingleSelected);
|
|
169
|
+
registerAction('element-range-selected', ElementRangeSelected);
|
|
170
|
+
registerAction('element-link-by-color', ElementLinkByColor);
|
|
171
|
+
registerAction('active-region', ActiveRegion);
|
|
172
|
+
registerAction('list-active', ListActive);
|
|
173
|
+
registerAction('list-selected', ListSelected);
|
|
174
|
+
registerAction('list-highlight', ListHighlight);
|
|
175
|
+
registerAction('list-unchecked', ListUnchecked);
|
|
176
|
+
registerAction('rect-mask', RectMask);
|
|
177
|
+
registerAction('x-rect-mask', DimMask, {
|
|
178
|
+
dim: 'x'
|
|
179
|
+
});
|
|
180
|
+
registerAction('y-rect-mask', DimMask, {
|
|
181
|
+
dim: 'y'
|
|
182
|
+
});
|
|
183
|
+
registerAction('circle-mask', CircleMask);
|
|
184
|
+
registerAction('path-mask', PathMask);
|
|
185
|
+
registerAction('smooth-path-mask', SmoothPathMask);
|
|
186
|
+
registerAction('cursor', CursorAction);
|
|
187
|
+
registerAction('data-filter', DataFilter);
|
|
188
|
+
registerAction('brush', DataRangeFilter);
|
|
189
|
+
registerAction('brush-x', DataRangeFilter, {
|
|
190
|
+
dims: ['x']
|
|
191
|
+
});
|
|
192
|
+
registerAction('brush-y', DataRangeFilter, {
|
|
193
|
+
dims: ['y']
|
|
194
|
+
});
|
|
195
|
+
registerAction('sibling-filter', SiblingFilter);
|
|
196
|
+
registerAction('sibling-x-filter', SiblingFilter);
|
|
197
|
+
registerAction('sibling-y-filter', SiblingFilter);
|
|
198
|
+
registerAction('element-filter', ElementFilter);
|
|
199
|
+
registerAction('element-sibling-filter', ElementSiblingFilter);
|
|
200
|
+
registerAction('element-sibling-filter-record', ElementSiblingFilter, {
|
|
201
|
+
byRecord: true
|
|
202
|
+
});
|
|
203
|
+
registerAction('view-drag', ViewDrag);
|
|
204
|
+
registerAction('view-move', ViewMove);
|
|
205
|
+
registerAction('scale-translate', ScaleTranslate);
|
|
206
|
+
registerAction('scale-zoom', ScaleZoom);
|
|
207
|
+
registerAction('reset-button', ButtonAction, {
|
|
208
|
+
name: 'reset-button',
|
|
209
|
+
text: 'reset'
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// 注册默认的 Interaction 交互行为
|
|
213
|
+
function isPointInView(context) {
|
|
214
|
+
return context.isInPlot();
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// 注册 tooltip 的 interaction
|
|
218
|
+
registerInteraction('tooltip', {
|
|
219
|
+
start: [{
|
|
220
|
+
trigger: 'plot:mousemove',
|
|
221
|
+
action: 'tooltip:show'
|
|
222
|
+
}],
|
|
223
|
+
end: [{
|
|
224
|
+
trigger: 'plot:mouseleave',
|
|
225
|
+
action: 'tooltip:hide'
|
|
226
|
+
}]
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
// 移动到 element 上 active
|
|
230
|
+
registerInteraction('element-active', {
|
|
231
|
+
start: [{
|
|
232
|
+
trigger: 'element:mouseenter',
|
|
233
|
+
action: 'element-active:active'
|
|
234
|
+
}],
|
|
235
|
+
end: [{
|
|
236
|
+
trigger: 'element:mouseleave',
|
|
237
|
+
action: 'element-active:reset'
|
|
238
|
+
}]
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
// 点击选中,允许取消
|
|
242
|
+
registerInteraction('element-selected', {
|
|
243
|
+
start: [{
|
|
244
|
+
trigger: 'element:click',
|
|
245
|
+
action: 'element-selected:toggle'
|
|
246
|
+
}]
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
// hover highlight,允许取消
|
|
250
|
+
registerInteraction('element-highlight', {
|
|
251
|
+
start: [{
|
|
252
|
+
trigger: 'element:mouseenter',
|
|
253
|
+
action: 'element-highlight:highlight'
|
|
254
|
+
}],
|
|
255
|
+
end: [{
|
|
256
|
+
trigger: 'element:mouseleave',
|
|
257
|
+
action: 'element-highlight:reset'
|
|
258
|
+
}]
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
// hover highlight by x,允许取消
|
|
262
|
+
registerInteraction('element-highlight-by-x', {
|
|
263
|
+
start: [{
|
|
264
|
+
trigger: 'element:mouseenter',
|
|
265
|
+
action: 'element-highlight-by-x:highlight'
|
|
266
|
+
}],
|
|
267
|
+
end: [{
|
|
268
|
+
trigger: 'element:mouseleave',
|
|
269
|
+
action: 'element-highlight-by-x:reset'
|
|
270
|
+
}]
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
// hover highlight by y,允许取消
|
|
274
|
+
registerInteraction('element-highlight-by-color', {
|
|
275
|
+
start: [{
|
|
276
|
+
trigger: 'element:mouseenter',
|
|
277
|
+
action: 'element-highlight-by-color:highlight'
|
|
278
|
+
}],
|
|
279
|
+
end: [{
|
|
280
|
+
trigger: 'element:mouseleave',
|
|
281
|
+
action: 'element-highlight-by-color:reset'
|
|
282
|
+
}]
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
// legend hover,element active
|
|
286
|
+
registerInteraction('legend-active', {
|
|
287
|
+
start: [{
|
|
288
|
+
trigger: 'legend-item:mouseenter',
|
|
289
|
+
action: ['list-active:active', 'element-active:active']
|
|
290
|
+
}],
|
|
291
|
+
end: [{
|
|
292
|
+
trigger: 'legend-item:mouseleave',
|
|
293
|
+
action: ['list-active:reset', 'element-active:reset']
|
|
294
|
+
}]
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
// legend hover,element active
|
|
298
|
+
registerInteraction('legend-highlight', {
|
|
299
|
+
start: [{
|
|
300
|
+
trigger: 'legend-item:mouseenter',
|
|
301
|
+
action: ['list-highlight:highlight', 'element-highlight:highlight']
|
|
302
|
+
}],
|
|
303
|
+
end: [{
|
|
304
|
+
trigger: 'legend-item:mouseleave',
|
|
305
|
+
action: ['list-highlight:reset', 'element-highlight:reset']
|
|
306
|
+
}]
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
// legend hover,element active
|
|
310
|
+
registerInteraction('axis-label-highlight', {
|
|
311
|
+
start: [{
|
|
312
|
+
trigger: 'axis-label:mouseenter',
|
|
313
|
+
action: ['list-highlight:highlight', 'element-highlight:highlight']
|
|
314
|
+
}],
|
|
315
|
+
end: [{
|
|
316
|
+
trigger: 'axis-label:mouseleave',
|
|
317
|
+
action: ['list-highlight:reset', 'element-highlight:reset']
|
|
318
|
+
}]
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
// legend hover,element active
|
|
322
|
+
registerInteraction('element-list-highlight', {
|
|
323
|
+
start: [{
|
|
324
|
+
trigger: 'element:mouseenter',
|
|
325
|
+
action: ['list-highlight:highlight', 'element-highlight:highlight']
|
|
326
|
+
}],
|
|
327
|
+
end: [{
|
|
328
|
+
trigger: 'element:mouseleave',
|
|
329
|
+
action: ['list-highlight:reset', 'element-highlight:reset']
|
|
330
|
+
}]
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
// 框选
|
|
334
|
+
registerInteraction('element-range-highlight', {
|
|
335
|
+
showEnable: [{
|
|
336
|
+
trigger: 'plot:mouseenter',
|
|
337
|
+
action: 'cursor:crosshair'
|
|
338
|
+
}, {
|
|
339
|
+
trigger: 'mask:mouseenter',
|
|
340
|
+
action: 'cursor:move'
|
|
341
|
+
}, {
|
|
342
|
+
trigger: 'plot:mouseleave',
|
|
343
|
+
action: 'cursor:default'
|
|
344
|
+
}, {
|
|
345
|
+
trigger: 'mask:mouseleave',
|
|
346
|
+
action: 'cursor:crosshair'
|
|
347
|
+
}],
|
|
348
|
+
start: [{
|
|
349
|
+
trigger: 'plot:mousedown',
|
|
350
|
+
isEnable: function isEnable(context) {
|
|
351
|
+
return !context.isInShape('mask');
|
|
352
|
+
},
|
|
353
|
+
action: ['rect-mask:start', 'rect-mask:show']
|
|
354
|
+
}, {
|
|
355
|
+
trigger: 'mask:dragstart',
|
|
356
|
+
action: ['rect-mask:moveStart']
|
|
357
|
+
}],
|
|
358
|
+
processing: [{
|
|
359
|
+
trigger: 'plot:mousemove',
|
|
360
|
+
action: ['rect-mask:resize']
|
|
361
|
+
}, {
|
|
362
|
+
trigger: 'mask:drag',
|
|
363
|
+
action: ['rect-mask:move']
|
|
364
|
+
}, {
|
|
365
|
+
trigger: 'mask:change',
|
|
366
|
+
action: ['element-range-highlight:highlight']
|
|
367
|
+
}],
|
|
368
|
+
end: [{
|
|
369
|
+
trigger: 'plot:mouseup',
|
|
370
|
+
action: ['rect-mask:end']
|
|
371
|
+
}, {
|
|
372
|
+
trigger: 'mask:dragend',
|
|
373
|
+
action: ['rect-mask:moveEnd']
|
|
374
|
+
}, {
|
|
375
|
+
trigger: 'document:mouseup',
|
|
376
|
+
isEnable: function isEnable(context) {
|
|
377
|
+
return !context.isInPlot();
|
|
378
|
+
},
|
|
379
|
+
action: ['element-range-highlight:clear', 'rect-mask:end', 'rect-mask:hide']
|
|
380
|
+
}],
|
|
381
|
+
rollback: [{
|
|
382
|
+
trigger: 'dblclick',
|
|
383
|
+
action: ['element-range-highlight:clear', 'rect-mask:hide']
|
|
384
|
+
}]
|
|
385
|
+
});
|
|
386
|
+
registerInteraction('brush', {
|
|
387
|
+
showEnable: [{
|
|
388
|
+
trigger: 'plot:mouseenter',
|
|
389
|
+
action: 'cursor:crosshair'
|
|
390
|
+
}, {
|
|
391
|
+
trigger: 'plot:mouseleave',
|
|
392
|
+
action: 'cursor:default'
|
|
393
|
+
}],
|
|
394
|
+
start: [{
|
|
395
|
+
trigger: 'mousedown',
|
|
396
|
+
isEnable: isPointInView,
|
|
397
|
+
action: ['brush:start', 'rect-mask:start', 'rect-mask:show']
|
|
398
|
+
}],
|
|
399
|
+
processing: [{
|
|
400
|
+
trigger: 'mousemove',
|
|
401
|
+
isEnable: isPointInView,
|
|
402
|
+
action: ['rect-mask:resize']
|
|
403
|
+
}],
|
|
404
|
+
end: [{
|
|
405
|
+
trigger: 'mouseup',
|
|
406
|
+
isEnable: isPointInView,
|
|
407
|
+
action: ['brush:filter', 'brush:end', 'rect-mask:end', 'rect-mask:hide', 'reset-button:show']
|
|
408
|
+
}],
|
|
409
|
+
rollback: [{
|
|
410
|
+
trigger: 'reset-button:click',
|
|
411
|
+
action: ['brush:reset', 'reset-button:hide', 'cursor:crosshair']
|
|
412
|
+
}]
|
|
413
|
+
});
|
|
414
|
+
registerInteraction('brush-visible', {
|
|
415
|
+
showEnable: [{
|
|
416
|
+
trigger: 'plot:mouseenter',
|
|
417
|
+
action: 'cursor:crosshair'
|
|
418
|
+
}, {
|
|
419
|
+
trigger: 'plot:mouseleave',
|
|
420
|
+
action: 'cursor:default'
|
|
421
|
+
}],
|
|
422
|
+
start: [{
|
|
423
|
+
trigger: 'plot:mousedown',
|
|
424
|
+
action: ['rect-mask:start', 'rect-mask:show', 'element-range-highlight:start']
|
|
425
|
+
}],
|
|
426
|
+
processing: [{
|
|
427
|
+
trigger: 'plot:mousemove',
|
|
428
|
+
action: ['rect-mask:resize', 'element-range-highlight:highlight']
|
|
429
|
+
}, {
|
|
430
|
+
trigger: 'mask:end',
|
|
431
|
+
action: ['element-filter:filter']
|
|
432
|
+
}],
|
|
433
|
+
end: [{
|
|
434
|
+
trigger: 'mouseup',
|
|
435
|
+
isEnable: isPointInView,
|
|
436
|
+
action: ['rect-mask:end', 'rect-mask:hide', 'element-range-highlight:end', 'element-range-highlight:clear']
|
|
437
|
+
}],
|
|
438
|
+
rollback: [{
|
|
439
|
+
trigger: 'dblclick',
|
|
440
|
+
action: ['element-filter:clear']
|
|
441
|
+
}]
|
|
442
|
+
});
|
|
443
|
+
registerInteraction('brush-x', {
|
|
444
|
+
showEnable: [{
|
|
445
|
+
trigger: 'plot:mouseenter',
|
|
446
|
+
action: 'cursor:crosshair'
|
|
447
|
+
}, {
|
|
448
|
+
trigger: 'plot:mouseleave',
|
|
449
|
+
action: 'cursor:default'
|
|
450
|
+
}],
|
|
451
|
+
start: [{
|
|
452
|
+
trigger: 'mousedown',
|
|
453
|
+
isEnable: isPointInView,
|
|
454
|
+
action: ['brush-x:start', 'x-rect-mask:start', 'x-rect-mask:show']
|
|
455
|
+
}],
|
|
456
|
+
processing: [{
|
|
457
|
+
trigger: 'mousemove',
|
|
458
|
+
isEnable: isPointInView,
|
|
459
|
+
action: ['x-rect-mask:resize']
|
|
460
|
+
}],
|
|
461
|
+
end: [{
|
|
462
|
+
trigger: 'mouseup',
|
|
463
|
+
isEnable: isPointInView,
|
|
464
|
+
action: ['brush-x:filter', 'brush-x:end', 'x-rect-mask:end', 'x-rect-mask:hide']
|
|
465
|
+
}],
|
|
466
|
+
rollback: [{
|
|
467
|
+
trigger: 'dblclick',
|
|
468
|
+
action: ['brush-x:reset']
|
|
469
|
+
}]
|
|
470
|
+
});
|
|
471
|
+
registerInteraction('element-path-highlight', {
|
|
472
|
+
showEnable: [{
|
|
473
|
+
trigger: 'plot:mouseenter',
|
|
474
|
+
action: 'cursor:crosshair'
|
|
475
|
+
}, {
|
|
476
|
+
trigger: 'plot:mouseleave',
|
|
477
|
+
action: 'cursor:default'
|
|
478
|
+
}],
|
|
479
|
+
start: [{
|
|
480
|
+
trigger: 'mousedown',
|
|
481
|
+
isEnable: isPointInView,
|
|
482
|
+
action: 'path-mask:start'
|
|
483
|
+
}, {
|
|
484
|
+
trigger: 'mousedown',
|
|
485
|
+
isEnable: isPointInView,
|
|
486
|
+
action: 'path-mask:show'
|
|
487
|
+
}],
|
|
488
|
+
processing: [{
|
|
489
|
+
trigger: 'mousemove',
|
|
490
|
+
action: 'path-mask:addPoint'
|
|
491
|
+
}],
|
|
492
|
+
end: [{
|
|
493
|
+
trigger: 'mouseup',
|
|
494
|
+
action: 'path-mask:end'
|
|
495
|
+
}],
|
|
496
|
+
rollback: [{
|
|
497
|
+
trigger: 'dblclick',
|
|
498
|
+
action: 'path-mask:hide'
|
|
499
|
+
}]
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
// 点击选中,允许取消
|
|
503
|
+
registerInteraction('element-single-selected', {
|
|
504
|
+
start: [{
|
|
505
|
+
trigger: 'element:click',
|
|
506
|
+
action: 'element-single-selected:toggle'
|
|
507
|
+
}]
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
// 筛选数据
|
|
511
|
+
registerInteraction('legend-filter', {
|
|
512
|
+
showEnable: [{
|
|
513
|
+
trigger: 'legend-item:mouseenter',
|
|
514
|
+
action: 'cursor:pointer'
|
|
515
|
+
}, {
|
|
516
|
+
trigger: 'legend-item:mouseleave',
|
|
517
|
+
action: 'cursor:default'
|
|
518
|
+
}],
|
|
519
|
+
start: [{
|
|
520
|
+
trigger: 'legend-item:click',
|
|
521
|
+
action: 'list-unchecked:toggle'
|
|
522
|
+
}, {
|
|
523
|
+
trigger: 'legend-item:click',
|
|
524
|
+
action: 'data-filter:filter'
|
|
525
|
+
}]
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
// 筛选数据
|
|
529
|
+
registerInteraction('continuous-filter', {
|
|
530
|
+
start: [{
|
|
531
|
+
trigger: 'legend:valuechanged',
|
|
532
|
+
action: 'data-filter:filter'
|
|
533
|
+
}]
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
// 筛选数据
|
|
537
|
+
registerInteraction('continuous-visible-filter', {
|
|
538
|
+
start: [{
|
|
539
|
+
trigger: 'legend:valuechanged',
|
|
540
|
+
action: 'element-filter:filter'
|
|
541
|
+
}]
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
// 筛选图形
|
|
545
|
+
registerInteraction('legend-visible-filter', {
|
|
546
|
+
showEnable: [{
|
|
547
|
+
trigger: 'legend-item:mouseenter',
|
|
548
|
+
action: 'cursor:pointer'
|
|
549
|
+
}, {
|
|
550
|
+
trigger: 'legend-item:mouseleave',
|
|
551
|
+
action: 'cursor:default'
|
|
552
|
+
}],
|
|
553
|
+
start: [{
|
|
554
|
+
trigger: 'legend-item:click',
|
|
555
|
+
action: 'list-unchecked:toggle'
|
|
556
|
+
}, {
|
|
557
|
+
trigger: 'legend-item:click',
|
|
558
|
+
action: 'element-filter:filter'
|
|
559
|
+
}]
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
// 出现背景框
|
|
563
|
+
registerInteraction('active-region', {
|
|
564
|
+
start: [{
|
|
565
|
+
trigger: 'plot:mousemove',
|
|
566
|
+
action: 'active-region:show'
|
|
567
|
+
}],
|
|
568
|
+
end: [{
|
|
569
|
+
trigger: 'plot:mouseleave',
|
|
570
|
+
action: 'active-region:hide'
|
|
571
|
+
}]
|
|
572
|
+
});
|
|
573
|
+
function isWheelDown(event) {
|
|
574
|
+
event.gEvent.preventDefault();
|
|
575
|
+
return event.gEvent.originalEvent.deltaY > 0;
|
|
576
|
+
}
|
|
577
|
+
registerInteraction('view-zoom', {
|
|
578
|
+
start: [{
|
|
579
|
+
trigger: 'plot:mousewheel',
|
|
580
|
+
isEnable: function isEnable(context) {
|
|
581
|
+
return isWheelDown(context.event);
|
|
582
|
+
},
|
|
583
|
+
action: 'scale-zoom:zoomOut'
|
|
584
|
+
}, {
|
|
585
|
+
trigger: 'plot:mousewheel',
|
|
586
|
+
isEnable: function isEnable(context) {
|
|
587
|
+
return !isWheelDown(context.event);
|
|
588
|
+
},
|
|
589
|
+
action: 'scale-zoom:zoomIn'
|
|
590
|
+
}]
|
|
591
|
+
});
|
|
592
|
+
registerInteraction('sibling-tooltip', {
|
|
593
|
+
start: [{
|
|
594
|
+
trigger: 'plot:mousemove',
|
|
595
|
+
action: 'sibling-tooltip:show'
|
|
596
|
+
}],
|
|
597
|
+
end: [{
|
|
598
|
+
trigger: 'plot:mouseleave',
|
|
599
|
+
action: 'sibling-tooltip:hide'
|
|
600
|
+
}]
|
|
601
|
+
});
|
|
602
|
+
export * from '@antv/g2/esm/core';
|
|
603
|
+
|
|
604
|
+
// 一些工具方法导出
|
|
605
|
+
export var Util = {
|
|
606
|
+
translate: translate,
|
|
607
|
+
rotate: rotate,
|
|
608
|
+
zoom: zoom,
|
|
609
|
+
transform: transform,
|
|
610
|
+
getAngle: getAngle,
|
|
611
|
+
polarToCartesian: polarToCartesian
|
|
612
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import intl from '../../intl';
|
|
5
|
+
var FilterItemUtils = /*#__PURE__*/function () {
|
|
6
|
+
function FilterItemUtils() {
|
|
7
|
+
_classCallCheck(this, FilterItemUtils);
|
|
8
|
+
}
|
|
9
|
+
_createClass(FilterItemUtils, null, [{
|
|
10
|
+
key: "generatorPredicateOption",
|
|
11
|
+
value: function generatorPredicateOption(filterPredicate) {
|
|
12
|
+
return {
|
|
13
|
+
value: {
|
|
14
|
+
filterPredicate: filterPredicate
|
|
15
|
+
},
|
|
16
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
17
|
+
className: "select-option-name"
|
|
18
|
+
}, intl.get(filterPredicate))
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}, {
|
|
22
|
+
key: "generatorTermModifierOption",
|
|
23
|
+
value: function generatorTermModifierOption(filterTermModifier) {
|
|
24
|
+
return {
|
|
25
|
+
value: {
|
|
26
|
+
filterTermModifier: filterTermModifier
|
|
27
|
+
},
|
|
28
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
29
|
+
className: "select-option-name"
|
|
30
|
+
}, intl.get(filterTermModifier))
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
key: "generatorSingleSelectOption",
|
|
35
|
+
value: function generatorSingleSelectOption(option) {
|
|
36
|
+
return {
|
|
37
|
+
value: {
|
|
38
|
+
columnOption: option
|
|
39
|
+
},
|
|
40
|
+
label: /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: "select-option-name"
|
|
42
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: "single-select-option",
|
|
44
|
+
style: {
|
|
45
|
+
background: option.color,
|
|
46
|
+
color: option.textColor || null
|
|
47
|
+
},
|
|
48
|
+
title: option.name,
|
|
49
|
+
"aria-label": option.name
|
|
50
|
+
}, option.name))
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
key: "generatorMultipleSelectOption",
|
|
55
|
+
value: function generatorMultipleSelectOption(option, filterTerm) {
|
|
56
|
+
return {
|
|
57
|
+
value: {
|
|
58
|
+
columnOption: option
|
|
59
|
+
},
|
|
60
|
+
label: /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: "select-option-name multiple-option-name"
|
|
62
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: "multiple-select-option",
|
|
64
|
+
style: {
|
|
65
|
+
background: option.color,
|
|
66
|
+
color: option.textColor
|
|
67
|
+
},
|
|
68
|
+
title: option.name,
|
|
69
|
+
"aria-label": option.name
|
|
70
|
+
}, option.name), /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: "multiple-check-icon"
|
|
72
|
+
}, filterTerm.indexOf(option.id) > -1 && /*#__PURE__*/React.createElement("i", {
|
|
73
|
+
className: "option-edit dtable-font dtable-icon-check-mark"
|
|
74
|
+
})))
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}]);
|
|
78
|
+
return FilterItemUtils;
|
|
79
|
+
}();
|
|
80
|
+
export default FilterItemUtils;
|