@antv/component 2.0.4 → 2.1.0

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 (42) hide show
  1. package/dist/component.min.js +1 -1
  2. package/esm/animation/fadeIn.d.ts +1 -1
  3. package/esm/animation/fadeOut.d.ts +1 -1
  4. package/esm/animation/utils.d.ts +3 -3
  5. package/esm/ui/axis/axis.d.ts +1 -1
  6. package/esm/ui/axis/guides/grid.d.ts +1 -1
  7. package/esm/ui/axis/guides/ticks.d.ts +1 -1
  8. package/esm/ui/axis/guides/title.d.ts +1 -1
  9. package/esm/ui/grid/index.d.ts +1 -1
  10. package/esm/ui/poptip/constant.d.ts +1 -1
  11. package/esm/ui/poptip/constant.js +1 -1
  12. package/esm/ui/poptip/constant.js.map +1 -1
  13. package/esm/ui/slider/index.js +2 -2
  14. package/esm/ui/slider/index.js.map +1 -1
  15. package/esm/ui/sparkline/utils.js +4 -1
  16. package/esm/ui/sparkline/utils.js.map +1 -1
  17. package/esm/ui/title/types.d.ts +1 -1
  18. package/esm/util/keyframe-interpolate.d.ts +1 -1
  19. package/esm/util/text.d.ts +1 -9
  20. package/lib/animation/fadeIn.d.ts +1 -1
  21. package/lib/animation/fadeOut.d.ts +1 -1
  22. package/lib/animation/utils.d.ts +3 -3
  23. package/lib/ui/axis/axis.d.ts +1 -1
  24. package/lib/ui/axis/guides/grid.d.ts +1 -1
  25. package/lib/ui/axis/guides/ticks.d.ts +1 -1
  26. package/lib/ui/axis/guides/title.d.ts +1 -1
  27. package/lib/ui/grid/index.d.ts +1 -1
  28. package/lib/ui/poptip/constant.d.ts +1 -1
  29. package/lib/ui/poptip/constant.js +1 -1
  30. package/lib/ui/poptip/constant.js.map +1 -1
  31. package/lib/ui/slider/index.js +2 -2
  32. package/lib/ui/slider/index.js.map +1 -1
  33. package/lib/ui/sparkline/utils.js +4 -1
  34. package/lib/ui/sparkline/utils.js.map +1 -1
  35. package/lib/ui/title/types.d.ts +1 -1
  36. package/lib/util/keyframe-interpolate.d.ts +1 -1
  37. package/lib/util/text.d.ts +1 -9
  38. package/package.json +7 -6
  39. package/src/ui/poptip/constant.ts +1 -1
  40. package/src/ui/slider/index.ts +3 -2
  41. package/src/ui/sparkline/utils.ts +4 -1
  42. package/src/ui/title/types.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/component",
3
- "version": "2.0.4",
3
+ "version": "2.1.0",
4
4
  "description": "Visualization components for AntV, based on G.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -34,6 +34,7 @@
34
34
  "build:cjs": "tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib",
35
35
  "build:esm": "tsc -p tsconfig.json --target ES5 --module ESNext --outDir esm",
36
36
  "ci": "run-s lint test build",
37
+ "prepublishOnly": "npm run ci",
37
38
  "prepare": "husky install"
38
39
  },
39
40
  "keywords": [
@@ -43,16 +44,16 @@
43
44
  "component"
44
45
  ],
45
46
  "dependencies": {
46
- "@antv/g": "^6.0.5",
47
+ "@antv/g": "^6.1.1",
47
48
  "@antv/scale": "^0.4.3",
48
49
  "@antv/util": "^3.3.5",
49
50
  "svg-path-parser": "^1.1.0"
50
51
  },
51
52
  "devDependencies": {
52
- "@antv/g-canvas": "^2.0.3",
53
- "@antv/g-plugin-control": "^2.0.0",
54
- "@antv/g-svg": "^2.0.3",
55
- "@antv/g-webgl": "^2.0.3",
53
+ "@antv/g-canvas": "^2.0.17",
54
+ "@antv/g-plugin-control": "^2.0.12",
55
+ "@antv/g-svg": "^2.0.14",
56
+ "@antv/g-webgl": "^2.0.21",
56
57
  "@babel/plugin-proposal-decorators": "^7.20.5",
57
58
  "@babel/plugin-transform-runtime": "^7.17.0",
58
59
  "@babel/preset-env": "^7.16.11",
@@ -73,7 +73,7 @@ export const POPTIP_STYLE = {
73
73
  [`.${CLASS_NAME.ARROW}`]: {
74
74
  width: '4px',
75
75
  height: '4px',
76
- transform: 'rotate(45deg)',
76
+ transform: [['rotate', 45]],
77
77
  'background-color': 'rgba(0, 0, 0)',
78
78
  position: 'absolute',
79
79
  'z-index': -1,
@@ -389,8 +389,9 @@ export class Slider extends Component<SliderStyleProps> {
389
389
  private inferTextStyle(handleType: HandleType): Record<string, any> {
390
390
  const { orientation } = this.attributes;
391
391
  if (orientation === 'horizontal') return {};
392
- if (handleType === 'start') return { transformOrigin: 'left center', transform: 'rotate(90)', textAlign: 'start' };
393
- if (handleType === 'end') return { transformOrigin: 'right center', transform: 'rotate(90)', textAlign: 'end' };
392
+ if (handleType === 'start')
393
+ return { transformOrigin: 'left center', transform: [['rotate', 90]], textAlign: 'start' };
394
+ if (handleType === 'end') return { transformOrigin: 'right center', transform: [['rotate', 90]], textAlign: 'end' };
394
395
  return {};
395
396
  }
396
397
 
@@ -6,7 +6,10 @@ import type { Data } from './types';
6
6
  */
7
7
  export function getRange(data: Data): [number, number] {
8
8
  if (data.length === 0) return [0, 0];
9
- return [min(minBy(data, (arr) => min(arr) || 0)), max(maxBy(data, (arr) => max(arr) || 0))] as [number, number];
9
+ return [
10
+ min(minBy(data, (arr) => min(arr) || 0) as number[]),
11
+ max(maxBy(data, (arr) => max(arr) || 0) as number[]),
12
+ ] as [number, number];
10
13
  }
11
14
 
12
15
  /**
@@ -1,6 +1,6 @@
1
- import { ExtendDisplayObject } from 'src/types';
2
1
  import type { ComponentOptions } from '../../core/types';
3
2
  import type { GroupStyleProps, TextStyleProps } from '../../shapes';
3
+ import type { ExtendDisplayObject } from '../../types';
4
4
  import type { SeriesAttr } from '../../util';
5
5
 
6
6
  export type PositionAbbr = 't' | 'r' | 'l' | 'b' | 'lt' | 'tl' | 'rt' | 'tr' | 'lb' | 'bl' | 'rb' | 'br' | 'i';