Skip to content

Commit 5e1d50c

Browse files
authored
Merge pull request #147 from vue-pivottable/ts-helper
ts 린트 에러 수정, index.js, main.js ts 파일로 변환
2 parents 6ef67a7 + d6e0153 commit 5e1d50c

File tree

9 files changed

+8
-18
lines changed

9 files changed

+8
-18
lines changed
File renamed without changes.
File renamed without changes.

src/helper/defaultProps.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { aggregators, locales } from './utilities'
22
import { redColorScaleGenerator } from './redColorScaleGenerator'
33
import type { PropType } from 'vue'
4+
import type { AggregatorTemplate } from './utilities'
45

56
export default {
67
data: {
78
type: [Array, Object, Function] as PropType<any>,
89
required: true
910
},
1011
aggregators: {
11-
type: Object as PropType<Record<string, Function>>,
12+
type: Object as PropType<Record<string, AggregatorTemplate>>,
1213
default: () => aggregators
1314
},
1415
aggregatorName: {

src/helper/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/helper/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export { default as defaultProps } from './defaultProps'
2+
export { redColorScaleGenerator } from './redColorScaleGenerator'
3+
export * from './utilities'

src/helper/redColorScaleGenerator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export function redColorScaleGenerator(values: number[]) {
2-
const min = Math.min.apply(Math, values)
3-
const max = Math.max.apply(Math, values)
2+
const min = Math.min(...values)
3+
const max = Math.max(...values)
44
return (x: number) => {
55
const nonRed = 255 - Math.round((255 * (x - min)) / (max - min))
66
return { backgroundColor: `rgb(255,${nonRed},${nonRed})` }

src/index.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { VuePivottable, VuePivottableUi } from './components'
22
import TableRenderer from './components/pivottable/renderer'
33
import * as PivotUtilities from './helper'
4-
export * from './composables/index.js'
54
import type { Component } from 'vue'
5+
export * from './composables'
66

77
const Renderer: Record<string, Component> = {
88
...TableRenderer
File renamed without changes.

0 commit comments

Comments
 (0)