@zgfe/business-lib 1.2.66-hxd.2 → 1.2.70-hxd.10

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.
Files changed (70) hide show
  1. package/README.md +1 -1
  2. package/es/assets/iconfont/demo_index.html +348 -3
  3. package/es/assets/iconfont/iconfont.css +63 -3
  4. package/es/assets/iconfont/iconfont.js +8 -8
  5. package/es/assets/iconfont/iconfont.json +105 -0
  6. package/es/assets/iconfont/iconfont.ttf +0 -0
  7. package/es/assets/iconfont/iconfont.woff +0 -0
  8. package/es/assets/iconfont/iconfont.woff2 +0 -0
  9. package/es/assets/styles/resetAntd.less +20 -7
  10. package/es/attrCondition/useAttrCondition.js +4 -1
  11. package/es/attrConditions/components/operateList.js +4 -4
  12. package/es/attrConditions/components/valuesList.js +1 -1
  13. package/es/attrConditions/types.d.ts +1 -0
  14. package/es/attributeSelector/index.js +3 -1
  15. package/es/attributeSelector/listPanel.js +3 -3
  16. package/es/attributeSelector/types.d.ts +2 -0
  17. package/es/attributeSelector/util.js +4 -0
  18. package/es/chart/demo/data/data7.d.ts +54 -0
  19. package/es/chart/demo/data/data7.js +1527 -0
  20. package/es/chart/demo/stack.d.ts +3 -0
  21. package/es/chart/demo/stack.js +31 -0
  22. package/es/chart/index.js +16 -6
  23. package/es/chart/types.d.ts +4 -1
  24. package/es/chart/util/chartOptionConfig.d.ts +4 -3
  25. package/es/chart/util/chartOptionConfig.js +84 -4
  26. package/es/chart/util/formatData.d.ts +1 -0
  27. package/es/chart/util/formatData.js +13 -0
  28. package/es/cycleTime/index.js +1 -1
  29. package/es/datePicker/index.js +6 -6
  30. package/es/datePickerV2/index.js +6 -3
  31. package/es/datePickerV2/popoverContent.d.ts +1 -0
  32. package/es/datePickerV2/popoverContent.js +3 -1
  33. package/es/datePickerV2/shortcut.d.ts +2 -0
  34. package/es/datePickerV2/shortcut.js +4 -3
  35. package/es/datePickerV2/types.d.ts +2 -0
  36. package/es/datePickerV2/utils.d.ts +1 -1
  37. package/es/datePickerV2/utils.js +5 -5
  38. package/es/dnd/demo/styles/index.less +34 -34
  39. package/es/eventSelector/listPanel.js +1 -1
  40. package/es/hooks/useBizStore.js +5 -2
  41. package/es/index.d.ts +4 -1
  42. package/es/index.js +4 -1
  43. package/es/layout/optionTitle/components/btnMenu/index.less +18 -18
  44. package/es/layout/optionTitle/components/title/index.less +43 -43
  45. package/es/layout/optionTitle/styles/index.less +30 -30
  46. package/es/layout/optionTitle/styles/layout.less +90 -90
  47. package/es/layout/optionTitle/styles/search.less +27 -27
  48. package/es/productCondition/conditions/order/runPeriodCondition.js +1 -1
  49. package/es/productCondition/conditions/periodCondition.js +1 -1
  50. package/es/productCondition/conditions/runTimesCondition.js +1 -1
  51. package/es/select/index.js +9 -1
  52. package/es/select/types.d.ts +3 -2
  53. package/es/subjectWrapper/demo/index.d.ts +3 -0
  54. package/es/subjectWrapper/demo/index.js +28 -0
  55. package/es/subjectWrapper/index.d.ts +5 -0
  56. package/es/subjectWrapper/index.js +98 -0
  57. package/es/subjectWrapper/index.less +12 -0
  58. package/es/subjectWrapper/types.d.ts +14 -0
  59. package/es/subjectWrapper/types.js +4 -0
  60. package/es/userCondition/conditions/cdpCshCondition.js +0 -1
  61. package/es/userCondition/conditions/order/runPeriodCondition.js +1 -1
  62. package/es/userCondition/conditions/periodCondition.js +1 -1
  63. package/es/userCondition/conditions/runTimesCondition.js +1 -1
  64. package/es/userGroup/index.js +2 -2
  65. package/es/userGroupHeader/demo/index.js +1 -1
  66. package/es/utils/ajax.js +15 -2
  67. package/es/utils/type.d.ts +1 -0
  68. package/es/utils/util.d.ts +3 -0
  69. package/es/utils/util.js +10 -0
  70. package/package.json +62 -62
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
3
+ export default _default;
@@ -0,0 +1,31 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { useRef, useState } from 'react';
8
+ import { BizChart } from '@zgfe/business-lib';
9
+ import chartData from './data/data7';
10
+ import { Button } from 'antd';
11
+ export default (function () {
12
+ var chartRef = useRef();
13
+ var _useState = useState(true),
14
+ _useState2 = _slicedToArray(_useState, 2),
15
+ show = _useState2[0],
16
+ setShow = _useState2[1];
17
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
18
+ onClick: function onClick() {
19
+ return setShow(!show);
20
+ }
21
+ }, show ? '隐藏' : '显示'), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(BizChart, {
22
+ data: chartData,
23
+ type: "pie",
24
+ legendPosition: "bottom",
25
+ isHideLegend: true,
26
+ ref: chartRef,
27
+ showList: undefined,
28
+ showAll: true,
29
+ colors: undefined
30
+ }));
31
+ });
package/es/chart/index.js CHANGED
@@ -13,9 +13,9 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import React, { useEffect, useImperativeHandle, useState } from 'react';
14
14
  import ReactEChartsCore from 'echarts-for-react/lib/core';
15
15
  import * as echarts from 'echarts';
16
- import { getChartOption, getPieOption, getMapOption } from './util/chartOptionConfig';
16
+ import { getChartOption, getPieOption, getMapOption, getStackingOption } from './util/chartOptionConfig';
17
17
  import { provinceSeries, citySeries, maxMinValue } from './util/mapUtil';
18
- import { formatPieData, formatChartData } from './util/formatData';
18
+ import { formatPieData, formatChartData, formatStackChartData } from './util/formatData';
19
19
  import './util/data/china.js';
20
20
  import moment from 'moment';
21
21
  import _ from 'lodash';
@@ -44,7 +44,10 @@ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
44
44
  tooltipTrigger = props.tooltipTrigger,
45
45
  muit_yAxis = props.muit_yAxis,
46
46
  unContainLabel = props.unContainLabel,
47
- markArea = props.markArea;
47
+ markArea = props.markArea,
48
+ mergeOption = props.mergeOption,
49
+ mergeSeries = props.mergeSeries,
50
+ emphasisFocus = props.emphasisFocus;
48
51
  var _useState = useState({}),
49
52
  _useState2 = _slicedToArray(_useState, 2),
50
53
  chartOption = _useState2[0],
@@ -123,10 +126,11 @@ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
123
126
  if (!data) return eOption;
124
127
  if (type === 'pie') {
125
128
  var rData = formatPieData(data, showAll, showList, props.showOther);
126
- eOption = getPieOption(rData, legendPosition, legendOrient, props.showLabel, props.radius, props.center, tooltipFormatter);
129
+ eOption = getPieOption(rData, legendPosition, legendOrient, props.showLabel, props.radius, props.center, tooltipFormatter, undefined, mergeSeries, isHideLegend);
130
+ eOption.legend.padding = [20, 0, 0, 0];
127
131
  } else if (type === 'line' || type === 'bar' || type === 'line_bar' || type === 'muit_y') {
128
132
  var _rData = formatChartData(data, showAll, showList, reverseXAxis, colors, type === 'line_bar' || type === 'muit_y');
129
- eOption = getChartOption(type, _rData, legendPosition, legendOrient, valueUnit, xRotate, yRotate, tooltipFormatter, xAxisFormatter, yAxisFormatter, legendFormatter, reverseXAxis, seriesName, isHideLegend, tooltipTrigger, muit_yAxis);
133
+ eOption = getChartOption(type, _rData, legendPosition, legendOrient, valueUnit, xRotate, yRotate, tooltipFormatter, xAxisFormatter, yAxisFormatter, legendFormatter, reverseXAxis, seriesName, isHideLegend, tooltipTrigger, muit_yAxis, mergeSeries);
130
134
  if (type === 'line_bar' || type === 'muit_y') {
131
135
  eOption.grid.right = '1%';
132
136
  eOption.grid.left = '1%';
@@ -147,6 +151,9 @@ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
147
151
  var maxMin = maxMinValue(series[0]);
148
152
  var showVisualMap = !(userGroup && userGroup.split(',').length > 1);
149
153
  eOption = getMapOption(series, maxMin, showVisualMap, tooltipFormatter, isCity);
154
+ } else if (type === 'stack') {
155
+ formatStackChartData(data, showList, showAll);
156
+ eOption = getStackingOption(data, legendPosition, emphasisFocus);
150
157
  }
151
158
  if (colors) {
152
159
  eOption.color = colors;
@@ -157,10 +164,13 @@ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
157
164
  if (data === null || data === void 0 ? void 0 : data.grid) {
158
165
  eOption.grid = _objectSpread(_objectSpread({}, eOption.grid), data === null || data === void 0 ? void 0 : data.grid);
159
166
  }
167
+ if (mergeOption) {
168
+ eOption = Object.assign(eOption, mergeOption);
169
+ }
160
170
  setChartOption(function () {
161
171
  return _objectSpread({}, eOption);
162
172
  });
163
- }, [data, showAll, showList, reverseXAxis, option]);
173
+ }, [data, showAll, showList, reverseXAxis, option, emphasisFocus]);
164
174
  useImperativeHandle(ref, function () {
165
175
  return {
166
176
  instance: instance
@@ -1,4 +1,4 @@
1
- import { EChartsOption } from 'echarts';
1
+ import { EChartsOption, SeriesOption } from 'echarts';
2
2
  import { GridOption } from 'echarts/types/dist/shared';
3
3
  export interface ChartItmProps {
4
4
  names: Array<string>;
@@ -59,5 +59,8 @@ export declare namespace ChartTypes {
59
59
  muit_yAxis?: {}[];
60
60
  unContainLabel?: boolean;
61
61
  markArea?: boolean;
62
+ mergeOption?: EChartsOption;
63
+ mergeSeries?: SeriesOption;
64
+ emphasisFocus?: null | string;
62
65
  }
63
66
  }
@@ -1,4 +1,4 @@
1
- import { GridComponentOption, TitleComponentOption, TooltipComponentOption } from 'echarts/types/dist/echarts';
1
+ import { GridComponentOption, SeriesOption, TitleComponentOption, TooltipComponentOption } from 'echarts/types/dist/echarts';
2
2
  import { BarSeriesOption, GridOption, LegendComponentOption, LineSeriesOption, PieSeriesOption, ToolboxComponentOption, XAXisOption, YAXisOption } from 'echarts/types/dist/shared';
3
3
  import '../styles/index.less';
4
4
  import { ChartTypes } from '../types';
@@ -10,10 +10,11 @@ export declare const gridConfig: GridOption;
10
10
  export declare const xAxisConfig: XAXisOption;
11
11
  export declare const yAxisConfig: YAXisOption;
12
12
  export declare const tooltipConfig: TooltipComponentOption;
13
+ export declare const getStackingOption: (data: ChartTypes.Value, legendPosition?: 'top' | 'bottom' | 'middle', emphasisFocus?: null | string) => any;
13
14
  export declare const getChartOption: (chartType: string, data: ChartTypes.Value, legendPosition?: 'top' | 'bottom' | 'middle', legendOrient?: 'horizontal' | 'vertical', unit?: string, xRotate?: number, yRotate?: number, tooltipFormatter?: ((value: any) => string) | undefined, xAxisFormatter?: ((value: any) => string) | undefined, yAxisFormatter?: ((value: any) => string) | undefined, legendFormatter?: ((value: any) => string) | undefined, reverseXAxis?: boolean, seriesName?: string, isHideLegend?: boolean, tooltipTrigger?: string, muit_yAxis?: {
14
15
  name?: string;
15
- }[]) => EChartsOption;
16
- export declare const getPieOption: (seriesData?: object[], legendPosition?: 'top' | 'bottom' | 'middle', legendOrient?: 'horizontal' | 'vertical', showLabel?: boolean, radius?: string | number | Array<string | number>, center?: Array<string | number>, tooltipFormatter?: ((value: any) => string) | undefined, legendFormatter?: ((value: any) => string) | undefined) => EChartsOption;
16
+ }[], mergeSeries?: SeriesOption) => EChartsOption;
17
+ export declare const getPieOption: (seriesData?: object[], legendPosition?: 'top' | 'bottom' | 'middle', legendOrient?: 'horizontal' | 'vertical', showLabel?: boolean, radius?: string | number | Array<string | number>, center?: Array<string | number>, tooltipFormatter?: ((value: any) => string) | undefined, legendFormatter?: ((value: any) => string) | undefined, mergeSeries?: SeriesOption, isHideLegend?: boolean) => EChartsOption;
17
18
  export declare const getMapOption: (seriesData: object[] | undefined, maxMinValue: {
18
19
  min: number;
19
20
  max: number;
@@ -101,7 +101,7 @@ export var tooltipConfig = {
101
101
  padding: 8,
102
102
  extraCssText: '0px 4px 10px rgba(0, 0, 0, 0.1)',
103
103
  className: 'biz-chart-tooltip',
104
- appendToBody: true,
104
+ appendToBody: util.isMobile() ? false : true,
105
105
  axisPointer: {
106
106
  type: 'shadow',
107
107
  z: 0,
@@ -110,6 +110,77 @@ export var tooltipConfig = {
110
110
  }
111
111
  }
112
112
  };
113
+ export var getStackingOption = function getStackingOption(data) {
114
+ var legendPosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'bottom';
115
+ var emphasisFocus = arguments.length > 2 ? arguments[2] : undefined;
116
+ var tooltip = JSON.parse(JSON.stringify(tooltipConfig));
117
+ var xAxis = [{
118
+ type: 'category',
119
+ data: data.xAxis
120
+ }];
121
+ var yAxis = [{
122
+ type: 'value'
123
+ }];
124
+ var grid = {
125
+ left: '1%',
126
+ right: '1%',
127
+ bottom: 45,
128
+ top: 24,
129
+ containLabel: true
130
+ };
131
+ var legend = {
132
+ icon: 'circle',
133
+ type: 'scroll',
134
+ itemHeight: 10,
135
+ itemWidth: 10,
136
+ itemGap: 21,
137
+ itemStyle: {
138
+ borderCap: 'round'
139
+ },
140
+ z: 10,
141
+ textStyle: {
142
+ color: '#5F6085',
143
+ height: 10,
144
+ rich: {
145
+ a: {
146
+ verticalAlign: 'bottom'
147
+ }
148
+ }
149
+ },
150
+ pageTextStyle: {
151
+ color: '#5F6085'
152
+ },
153
+ tooltip: {
154
+ show: true
155
+ },
156
+ top: 'bottom',
157
+ orient: 'horizontal'
158
+ };
159
+ var series = data.series.map(function (item) {
160
+ return {
161
+ name: item.names.join(','),
162
+ type: 'bar',
163
+ barMaxWidth: 40,
164
+ barWidth: 'auto',
165
+ stack: 'all',
166
+ emphasis: {
167
+ focus: emphasisFocus !== undefined ? emphasisFocus : 'series'
168
+ },
169
+ data: item.values
170
+ };
171
+ });
172
+ legend.top = legendPosition || 'bottom';
173
+ legend.icon = 'circle';
174
+ var _data = _objectSpread(_objectSpread({}, baseConfig), {}, {
175
+ legend: legend,
176
+ xAxis: xAxis,
177
+ yAxis: yAxis,
178
+ tooltip: tooltip,
179
+ grid: grid,
180
+ series: series
181
+ });
182
+ return _data;
183
+ };
113
184
  export var getChartOption = function getChartOption(chartType, data) {
114
185
  var legendPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'bottom';
115
186
  var legendOrient = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'horizontal';
@@ -125,6 +196,7 @@ export var getChartOption = function getChartOption(chartType, data) {
125
196
  var isHideLegend = arguments.length > 13 ? arguments[13] : undefined;
126
197
  var tooltipTrigger = arguments.length > 14 ? arguments[14] : undefined;
127
198
  var muit_yAxis = arguments.length > 15 ? arguments[15] : undefined;
199
+ var mergeSeries = arguments.length > 16 ? arguments[16] : undefined;
128
200
  var xAxis = JSON.parse(JSON.stringify(xAxisConfig)),
129
201
  tooltip = JSON.parse(JSON.stringify(tooltipConfig)),
130
202
  yAxis = _objectSpread({}, yAxisConfig),
@@ -167,13 +239,13 @@ export var getChartOption = function getChartOption(chartType, data) {
167
239
  }
168
240
  if (!reverseXAxis) {
169
241
  series = data.series.map(function (item) {
170
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, item), seriesItem), {}, {
242
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, item), seriesItem), {}, {
171
243
  type: chartType === 'line_bar' || chartType === 'muit_y' ? item.type : chartType
172
244
  }, chartType === 'line_bar' ? {
173
245
  yAxisIndex: item.type === 'line' ? 1 : 0
174
246
  } : {}), chartType === 'muit_y' ? {
175
247
  yAxisIndex: item.yAxisIndex
176
- } : {});
248
+ } : {}), mergeSeries ? mergeSeries : {});
177
249
  });
178
250
  series.map(function (item) {
179
251
  seriesObject[item.name] = item;
@@ -250,6 +322,8 @@ export var getPieOption = function getPieOption() {
250
322
  var center = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : ['50%', '50%'];
251
323
  var tooltipFormatter = arguments.length > 6 ? arguments[6] : undefined;
252
324
  var legendFormatter = arguments.length > 7 ? arguments[7] : undefined;
325
+ var mergeSeries = arguments.length > 8 ? arguments[8] : undefined;
326
+ var isHideLegend = arguments.length > 9 ? arguments[9] : undefined;
253
327
  var series = [{
254
328
  type: 'pie',
255
329
  data: seriesData,
@@ -301,10 +375,16 @@ export var getPieOption = function getPieOption() {
301
375
  }
302
376
  }
303
377
  }];
378
+ if (mergeSeries) {
379
+ series[0] = _objectSpread(_objectSpread({}, series[0]), mergeSeries);
380
+ }
304
381
  var tooltip = JSON.parse(JSON.stringify(tooltipConfig)),
305
382
  legend = _objectSpread({}, legendConfig),
306
383
  grid = _objectSpread({}, gridConfig);
307
384
  legend.top = legendPosition;
385
+ if (isHideLegend) {
386
+ legend.show = false;
387
+ }
308
388
  legend.orient = legendOrient;
309
389
  legend.icon = 'circle';
310
390
  if (legendOrient === 'vertical') {
@@ -384,7 +464,7 @@ export var getMapOption = function getMapOption() {
384
464
  bottom: '20',
385
465
  feature: {
386
466
  saveAsImage: {
387
- show: true,
467
+ show: util.isMobile() ? false : true,
388
468
  title: '保存为图片'
389
469
  }
390
470
  }
@@ -13,3 +13,4 @@ export declare const formatChartData: (data: ChartTypes.Value, showAll?: boolean
13
13
  [key: string]: string;
14
14
  };
15
15
  };
16
+ export declare const formatStackChartData: (data: ChartTypes.Value, showList?: Array<any>, showAll?: boolean) => void;
@@ -84,6 +84,19 @@ export var formatChartData = function formatChartData(data, showAll, showList, r
84
84
  resultFormatMap: resultFormatMap
85
85
  };
86
86
  };
87
+ export var formatStackChartData = function formatStackChartData(data, showList, showAll) {
88
+ var showMap = getShowMap(showList);
89
+ var _seriesData = [];
90
+ data.series.forEach(function (seriesItem) {
91
+ var name = seriesItem.names.join(',');
92
+ var showName = "".concat(name).concat(seriesItem.orderNum ? '|:|' + seriesItem.orderNum : '');
93
+ if (showAll || showList && showMap[showName] || (!showList || showList.length <= 0) && _seriesData.length < 10) {
94
+ _seriesData.push(seriesItem);
95
+ }
96
+ });
97
+ data.series = _seriesData;
98
+ return;
99
+ };
87
100
  var getShowMap = function getShowMap(showList) {
88
101
  var data = {};
89
102
  if (showList) {
@@ -151,7 +151,7 @@ var BizCycleTime = function BizCycleTime(props) {
151
151
  disable: disable,
152
152
  onChange: function onChange(v) {
153
153
  setDay([]);
154
- setTime(showHour && v.value !== CycleTimeUnit.custom ? '00' : undefined);
154
+ setTime(showHour && (v === null || v === void 0 ? void 0 : v.value) !== CycleTimeUnit.custom ? '00' : undefined);
155
155
  setUnit(v);
156
156
  }
157
157
  }), unit.value === CycleTimeUnit.week && /*#__PURE__*/React.createElement(BizSelect, {
@@ -136,25 +136,25 @@ var BizDatePicker = function BizDatePicker(_ref) {
136
136
  options: typeList,
137
137
  onChange: function onChange(type) {
138
138
  setCurrentType(type);
139
- if (type.value === 'custom') {
139
+ if ((type === null || type === void 0 ? void 0 : type.value) === 'custom') {
140
140
  setDateRange(getDateRange(DatePickerTypes.Unit.day, 7, includeToday));
141
141
  }
142
- if (type.value === 'hour') {
142
+ if ((type === null || type === void 0 ? void 0 : type.value) === 'hour') {
143
143
  setDateRange(getDateRange(DatePickerTypes.Unit.day, 1, includeToday));
144
144
  }
145
- if (type.value === 'day') {
145
+ if ((type === null || type === void 0 ? void 0 : type.value) === 'day') {
146
146
  setDateRange(getDateRange(DatePickerTypes.Unit.day, 7, includeToday));
147
147
  setRelative([7, includeToday ? 0 : 1]);
148
148
  }
149
- if (type.value === 'week') {
149
+ if ((type === null || type === void 0 ? void 0 : type.value) === 'week') {
150
150
  setDateRange(getDateRange(DatePickerTypes.Unit.week, 4, includeToday));
151
151
  setRelative([4, includeToday ? 0 : 1]);
152
152
  }
153
- if (type.value === 'month') {
153
+ if ((type === null || type === void 0 ? void 0 : type.value) === 'month') {
154
154
  setDateRange(getDateRange(DatePickerTypes.Unit.month, 1, includeToday));
155
155
  setRelative([1, includeToday ? 0 : 1]);
156
156
  }
157
- if (type.value === 'quarter') {
157
+ if ((type === null || type === void 0 ? void 0 : type.value) === 'quarter') {
158
158
  setDateRange(getDateRange(DatePickerTypes.Unit.quarter, 1, includeToday));
159
159
  setRelative([1, includeToday ? 0 : 1]);
160
160
  }
@@ -38,7 +38,9 @@ var BizDatePicker = function BizDatePicker(_ref) {
38
38
  onChange = _ref.onChange,
39
39
  selectRange = _ref.selectRange,
40
40
  selectRangeUnit = _ref.selectRangeUnit,
41
- timeRangeOpen = _ref.timeRangeOpen;
41
+ timeRangeOpen = _ref.timeRangeOpen,
42
+ hiddenUnitType = _ref.hiddenUnitType,
43
+ shortcuts = _ref.shortcuts;
42
44
  var _useState = useState(false),
43
45
  _useState2 = _slicedToArray(_useState, 2),
44
46
  ready = _useState2[0],
@@ -170,7 +172,7 @@ var BizDatePicker = function BizDatePicker(_ref) {
170
172
  setRelative: setRelative,
171
173
  setOpen: setOpen
172
174
  }
173
- }, /*#__PURE__*/React.createElement(BizSelect, {
175
+ }, !hiddenUnitType && /*#__PURE__*/React.createElement(BizSelect, {
174
176
  className: "".concat(classPrefix, "-type"),
175
177
  theme: "secondary",
176
178
  keyField: "value",
@@ -216,7 +218,8 @@ var BizDatePicker = function BizDatePicker(_ref) {
216
218
  selectRangeUnit: selectRangeUnit,
217
219
  timeRangeOpen: timeRangeOpen,
218
220
  currentType: currentType.value,
219
- relative: relative
221
+ relative: relative,
222
+ shortcuts: shortcuts
220
223
  }),
221
224
  onOpenChange: function onOpenChange() {
222
225
  return setOpen(!open);
@@ -8,6 +8,7 @@ interface PopoverContent {
8
8
  currentType?: DatePickerTypes.Unit;
9
9
  relative?: any[];
10
10
  selectRangeUnit?: 'days' | 'weeks' | 'months' | 'quarter';
11
+ shortcuts?: DatePickerTypes.Option[];
11
12
  }
12
13
  declare const _default: (props: PopoverContent) => React.JSX.Element;
13
14
  export default _default;
@@ -16,7 +16,8 @@ export default (function (props) {
16
16
  setOpen = props.setOpen,
17
17
  currentType = props.currentType,
18
18
  relative = props.relative,
19
- selectRangeUnit = props.selectRangeUnit;
19
+ selectRangeUnit = props.selectRangeUnit,
20
+ shortcuts = props.shortcuts;
20
21
  var ref = useRef();
21
22
  return /*#__PURE__*/React.createElement(Tabs, {
22
23
  defaultActiveKey: relative ? '1' : '2'
@@ -24,6 +25,7 @@ export default (function (props) {
24
25
  tab: "\u6700\u8FD1",
25
26
  key: "1"
26
27
  }, /*#__PURE__*/React.createElement(PickerShortcut, {
28
+ shortcuts: shortcuts,
27
29
  selectRange: selectRange,
28
30
  selectRangeUnit: selectRangeUnit
29
31
  })), /*#__PURE__*/React.createElement(Tabs.TabPane, {
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
+ import { DatePickerTypes } from './types';
2
3
  declare const PickerShortcut: React.FC<{
3
4
  selectRange?: number;
4
5
  selectRangeUnit?: string;
5
6
  timeRangeOpen?: number;
7
+ shortcuts?: DatePickerTypes.Option[];
6
8
  }>;
7
9
  export default PickerShortcut;
@@ -15,7 +15,8 @@ import moment from 'moment';
15
15
  var PickerShortcut = function PickerShortcut(_ref) {
16
16
  var selectRange = _ref.selectRange,
17
17
  selectRangeUnit = _ref.selectRangeUnit,
18
- timeRangeOpen = _ref.timeRangeOpen;
18
+ timeRangeOpen = _ref.timeRangeOpen,
19
+ shortcuts = _ref.shortcuts;
19
20
  var _useContext = useContext(DatePickerContext),
20
21
  currentType = _useContext.currentType,
21
22
  includeToday = _useContext.includeToday,
@@ -25,7 +26,7 @@ var PickerShortcut = function PickerShortcut(_ref) {
25
26
  setOpen = _useContext.setOpen;
26
27
  var _useContext2 = useContext(BizGlobalDataContext),
27
28
  envs = _useContext2.envs;
28
- var list = getTypeList(currentType, includeToday);
29
+ var list = getTypeList(currentType, includeToday, shortcuts);
29
30
  var _useState = useState(),
30
31
  _useState2 = _slicedToArray(_useState, 2),
31
32
  active = _useState2[0],
@@ -39,7 +40,7 @@ var PickerShortcut = function PickerShortcut(_ref) {
39
40
  isError = _useState6[0],
40
41
  setIsError = _useState6[1];
41
42
  useEffect(function () {
42
- list = getTypeList(currentType, includeToday);
43
+ list = getTypeList(currentType, includeToday, shortcuts);
43
44
  if (relative) {
44
45
  setActive(relative[0]);
45
46
  setNumbers(relative[0]);
@@ -25,6 +25,8 @@ export declare namespace DatePickerTypes {
25
25
  onChange?: (data: Value) => void;
26
26
  onOpenChange?: (data: boolean) => void;
27
27
  dateTypeList?: Unit[];
28
+ hiddenUnitType?: boolean;
29
+ shortcuts?: DatePickerTypes.Option[];
28
30
  }
29
31
  interface Option {
30
32
  label: string;
@@ -5,7 +5,7 @@ export declare const getDateRange: (type: DatePickerTypes.Unit, count: number, i
5
5
  end: string;
6
6
  };
7
7
  export declare const isTodayInRange: (_startDate: moment.Moment, _endDate: moment.Moment) => boolean;
8
- export declare const getTypeList: (currentType: DatePickerTypes.Unit, includeToday: boolean) => DatePickerTypes.ListOption[];
8
+ export declare const getTypeList: (currentType: DatePickerTypes.Unit, includeToday: boolean, shortcuts?: DatePickerTypes.Option[]) => DatePickerTypes.ListOption[];
9
9
  export declare const DateOptionMap: {
10
10
  day: string;
11
11
  week: string;
@@ -39,9 +39,9 @@ export var isTodayInRange = function isTodayInRange(_startDate, _endDate) {
39
39
  var dateToCheck = moment(new Date()).format('x');
40
40
  return dateToCheck >= startDate && dateToCheck <= endDate;
41
41
  };
42
- export var getTypeList = function getTypeList(currentType, includeToday) {
43
- var _shortcuts$find;
44
- var shortcuts = [{
42
+ export var getTypeList = function getTypeList(currentType, includeToday, shortcuts) {
43
+ var _find;
44
+ var defaultShortcuts = [{
45
45
  label: '按小时',
46
46
  value: DatePickerTypes.Unit.hour,
47
47
  children: [{
@@ -104,9 +104,9 @@ export var getTypeList = function getTypeList(currentType, includeToday) {
104
104
  count: 4
105
105
  }]
106
106
  }];
107
- var list = (((_shortcuts$find = shortcuts.find(function (item) {
107
+ var list = (((_find = (shortcuts ? shortcuts : defaultShortcuts).find(function (item) {
108
108
  return item.value === currentType;
109
- })) === null || _shortcuts$find === void 0 ? void 0 : _shortcuts$find.children) || []).filter(function (item) {
109
+ })) === null || _find === void 0 ? void 0 : _find.children) || []).filter(function (item) {
110
110
  if (currentType === 'day') {
111
111
  if (!includeToday && (item.count === 0 || item.count === 1)) return false;
112
112
  return true;
@@ -1,34 +1,34 @@
1
- @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
- .container {
3
- padding: @padding-md;
4
- border: 1px solid @border-color-base;
5
- border-radius: @border-radius-normal;
6
- }
7
- .item {
8
- display: inline-block;
9
- width: 10%;
10
- height: 150px;
11
- margin: @margin-md;
12
- line-height: 150px;
13
- text-align: center;
14
- vertical-align: top;
15
- background: @background-color-base;
16
- border-radius: @border-radius-normal;
17
- }
18
- .temp {
19
- display: inline-block;
20
- border: 2px dashed @primary-color;
21
- border-radius: @border-radius-normal;
22
- }
23
- .add {
24
- font-size: 48px;
25
- cursor: pointer;
26
- }
27
- .doing {
28
- border: 1px solid @warning-color;
29
- }
30
- .handle {
31
- display: block;
32
- height: 25px;
33
- background: @info-color;
34
- }
1
+ @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
+ .container {
3
+ padding: @padding-md;
4
+ border: 1px solid @border-color-base;
5
+ border-radius: @border-radius-normal;
6
+ }
7
+ .item {
8
+ display: inline-block;
9
+ width: 10%;
10
+ height: 150px;
11
+ margin: @margin-md;
12
+ line-height: 150px;
13
+ text-align: center;
14
+ vertical-align: top;
15
+ background: @background-color-base;
16
+ border-radius: @border-radius-normal;
17
+ }
18
+ .temp {
19
+ display: inline-block;
20
+ border: 2px dashed @primary-color;
21
+ border-radius: @border-radius-normal;
22
+ }
23
+ .add {
24
+ font-size: 48px;
25
+ cursor: pointer;
26
+ }
27
+ .doing {
28
+ border: 1px solid @warning-color;
29
+ }
30
+ .handle {
31
+ display: block;
32
+ height: 25px;
33
+ background: @info-color;
34
+ }
@@ -176,7 +176,7 @@ var EventListPanel = function EventListPanel(props) {
176
176
  useEffect(function () {
177
177
  var list = [];
178
178
  currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.eventList.forEach(function (event) {
179
- if (searchValue && !new RegExp(_.escapeRegExp(searchValue), 'i').test("".concat(event.owner === 'zg_vtl' ? '虚拟事件' : '元事件', " | ").concat(event.alias || event.name))) return;
179
+ if (searchValue && !(new RegExp(_.escapeRegExp(searchValue), 'i').test("".concat(event.owner === 'zg_vtl' ? '虚拟事件' : '元事件', " | ").concat(event.alias)) || new RegExp(_.escapeRegExp(searchValue), 'i').test("".concat(event.owner === 'zg_vtl' ? '虚拟事件' : '元事件', " | ").concat(event.name)))) return;
180
180
  list.push(event);
181
181
  });
182
182
  if (showOverview) list.unshift(overviewData);
@@ -63,7 +63,7 @@ function useBizStore(_ref) {
63
63
  _useState24 = _slicedToArray(_useState23, 2),
64
64
  store = _useState24[0],
65
65
  setStore = _useState24[1];
66
- var _useState25 = useState(false),
66
+ var _useState25 = useState(true),
67
67
  _useState26 = _slicedToArray(_useState25, 2),
68
68
  useBizStoreLoading = _useState26[0],
69
69
  setUseBizStoreLoading = _useState26[1];
@@ -152,7 +152,10 @@ function useBizStore(_ref) {
152
152
  setUseBizStoreLoading(false);
153
153
  }, [loadEvent, loadEnv, loadUsers, groupLoading, tagLoading]);
154
154
  useEffect(function () {
155
- if (!currentApp || !currentApp.appId) return;
155
+ if (!currentApp || !currentApp.appId) {
156
+ setUseBizStoreLoading(false);
157
+ return;
158
+ }
156
159
  setTimer(function (pre) {
157
160
  if (pre) {
158
161
  clearTimeout(pre);
package/es/index.d.ts CHANGED
@@ -50,8 +50,11 @@ import useSubject from './hooks/useSubject';
50
50
  import BizPlatformSelector from './platformSelector';
51
51
  import DataSetGroup from './dataSetGroup';
52
52
  import BizDatePickerV2 from './datePickerV2';
53
+ import SubjectWrapper from './subjectWrapper';
54
+ import StyleList from './addToPanel/components/styleList';
55
+ import BizEditText from './layout/optionTitle/components/title';
53
56
  import ValuesList from './attrConditions/components/valuesList';
54
- export { BizTargetDimension, BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizLayout, BizAnalysisLayout, BizDetailLayout, BizUserGroup, BizUserGroupHeader, IconFont, ColorIcon, BizFormulaTarget, BizAUMFormulaTarget, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizQuickDatePicker, BizLoading, BizEmpty, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizProductCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, base64, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, chartColors, useBizStore, useChanged, useSubject, DataSetGroup, BizDatePickerV2, BizPlatformSelector, ValuesList, };
57
+ export { BizTargetDimension, BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizLayout, BizAnalysisLayout, BizDetailLayout, BizUserGroup, BizUserGroupHeader, IconFont, ColorIcon, BizFormulaTarget, BizAUMFormulaTarget, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizQuickDatePicker, BizLoading, BizEmpty, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizProductCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, base64, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, chartColors, useBizStore, useChanged, useSubject, DataSetGroup, BizDatePickerV2, BizPlatformSelector, SubjectWrapper, StyleList, BizEditText, ValuesList, };
55
58
  export type { UserGroupTypes } from './userGroup/types';
56
59
  export type { BizProductConditionT } from './productCondition/types';
57
60
  export type { BizSelectTypes } from './select/types';
package/es/index.js CHANGED
@@ -49,5 +49,8 @@ import useSubject from './hooks/useSubject';
49
49
  import BizPlatformSelector from './platformSelector';
50
50
  import DataSetGroup from './dataSetGroup';
51
51
  import BizDatePickerV2 from './datePickerV2';
52
+ import SubjectWrapper from './subjectWrapper';
53
+ import StyleList from './addToPanel/components/styleList';
54
+ import BizEditText from './layout/optionTitle/components/title';
52
55
  import ValuesList from './attrConditions/components/valuesList';
53
- export { BizTargetDimension, BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizLayout, BizAnalysisLayout, BizDetailLayout, BizUserGroup, BizUserGroupHeader, IconFont, ColorIcon, BizFormulaTarget, BizAUMFormulaTarget, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizQuickDatePicker, BizLoading, BizEmpty, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizProductCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, base64, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, chartColors, useBizStore, useChanged, useSubject, DataSetGroup, BizDatePickerV2, BizPlatformSelector, ValuesList };
56
+ export { BizTargetDimension, BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizLayout, BizAnalysisLayout, BizDetailLayout, BizUserGroup, BizUserGroupHeader, IconFont, ColorIcon, BizFormulaTarget, BizAUMFormulaTarget, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizQuickDatePicker, BizLoading, BizEmpty, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizProductCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, base64, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, chartColors, useBizStore, useChanged, useSubject, DataSetGroup, BizDatePickerV2, BizPlatformSelector, SubjectWrapper, StyleList, BizEditText, ValuesList };