spark-grid-vue3 0.0.13 → 0.0.15
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/package.json +1 -1
- package/src/SparkGrid.vue +3 -3
- package/src/components/GridContentWrapper.vue +6 -6
- package/src/components/GridHeader.vue +3 -3
- package/src/components/GridSummarizer.vue +2 -2
- package/src/types/types.d.ts +4 -4
- package/src/utils/CellValueGetter.ts +2 -2
- /package/src/assets/{DataTable.html → SparkGrid.html} +0 -0
- /package/src/assets/{DataTable.scss → SparkGrid.scss} +0 -0
- /package/src/assets/{DataTable.ts → SparkGrid.ts} +0 -0
package/package.json
CHANGED
package/src/SparkGrid.vue
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<template src="./assets/
|
|
2
|
-
<script lang="ts" src="./assets/
|
|
3
|
-
<style src="./assets/
|
|
1
|
+
<template src="./assets/SparkGrid.html"/>
|
|
2
|
+
<script lang="ts" src="./assets/SparkGrid.ts"/>
|
|
3
|
+
<style src="./assets/SparkGrid.scss" lang="scss"/>
|
|
@@ -17,7 +17,7 @@ const props = defineProps<{ grid: GridComponent }>()
|
|
|
17
17
|
const classes = computed(() => {
|
|
18
18
|
let classes = []
|
|
19
19
|
|
|
20
|
-
if (props.grid.config.stickyHeaderEnabled
|
|
20
|
+
if (props.grid.config.stickyHeaderEnabled) {
|
|
21
21
|
classes.push("grid-sticky-header")
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -29,14 +29,14 @@ const styles = computed(() => {
|
|
|
29
29
|
background: '#fafafa'
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const maxHeight = props.grid.config.height ?? (window.innerHeight - 100)
|
|
33
|
-
styles['max-height'] = `${maxHeight}px`
|
|
34
|
-
styles['min-height'] = `${maxHeight}px`
|
|
35
|
-
|
|
36
32
|
if (props.grid.config.overflowEnabled) {
|
|
33
|
+
const maxHeight = props.grid.config.height ?? (window.innerHeight - 100)
|
|
34
|
+
|
|
37
35
|
styles['overflow-x'] = 'auto'
|
|
36
|
+
styles['max-height'] = `${maxHeight}px`
|
|
37
|
+
styles['min-height'] = `${maxHeight}px`
|
|
38
38
|
|
|
39
|
-
if (props.grid.config.stickyHeaderEnabled
|
|
39
|
+
if (props.grid.config.stickyHeaderEnabled) {
|
|
40
40
|
styles['position'] = 'relative'
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="grid-header" :class="{'grid-header-sticky': grid.config.stickyHeaderEnabled
|
|
2
|
+
<div class="grid-header" :class="{'grid-header-sticky': grid.config.stickyHeaderEnabled}">
|
|
3
3
|
<div class="grid-header-cell" v-if="props.grid.config.checkboxEnabled" :style="GridStyler.getCheckboxColumnStyles()">
|
|
4
4
|
<GridHeaderCheckbox :grid="grid"/>
|
|
5
5
|
</div>
|
|
@@ -62,8 +62,8 @@ const columnContent = (column: Column) => {
|
|
|
62
62
|
label = props.grid.config.onBeforeHeaderCellMounted(column, props.grid)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
if (column.
|
|
66
|
-
label = column.
|
|
65
|
+
if (column.headerContentGetter) {
|
|
66
|
+
label = column.headerContentGetter(label, props.grid)
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
return label ?? column.label
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="flex grid-summarizer" :class="{'grid-summarizer-sticky': grid.config.stickyHeaderEnabled
|
|
2
|
+
<div class="flex grid-summarizer" :class="{'grid-summarizer-sticky': grid.config.stickyHeaderEnabled}">
|
|
3
3
|
<div class="grid-header-cell" v-if="props.grid.config.checkboxEnabled" :style="GridStyler.getCheckboxColumnStyles()"></div>
|
|
4
4
|
<div class="grid-header-cell" v-if="props.grid.config.radioButtonSelectionEnabled" :style="GridStyler.getCheckboxColumnStyles()"></div>
|
|
5
5
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script setup lang="ts">
|
|
20
|
-
import type {
|
|
20
|
+
import type {Column, GridComponent} from "../types/types"
|
|
21
21
|
import {GridStyler} from "../utils/GridStyler"
|
|
22
22
|
import RuntimeRenderer from "../components/RuntimeRenderer.vue"
|
|
23
23
|
|
package/src/types/types.d.ts
CHANGED
|
@@ -28,8 +28,8 @@ export type OnRowEvent = (row: Row, grid: GridComponent) => void
|
|
|
28
28
|
export type OnCellEvent = (value: any, column: Column, row: Row, grid: GridComponent) => any
|
|
29
29
|
export type OnContextMenu = (value: any, column: Column, row: Row, grid: GridComponent) => ContextMenItem[]
|
|
30
30
|
export type OnBeforeRowMounted = (row: Row, grid: GridComponent) => Row
|
|
31
|
-
export type
|
|
32
|
-
export type
|
|
31
|
+
export type OnValueGetter = (value: any, row: Row, grid: GridComponent) => CellContent
|
|
32
|
+
export type OnHeaderContentGetter = (value: any, grid: GridComponent) => CellContent
|
|
33
33
|
export type OnBeforeCellMounted = (value: CellContent, column: Column, row: Row, grid: GridComponent) => CellContent
|
|
34
34
|
export type OnBeforeHeaderCellMounted = (column: Column, grid: GridComponent) => CellContent
|
|
35
35
|
export type OnBeforeCellStyleMounted = (value: CellContent, column: Column, row: Row, grid: GridComponent) => { [key: string]: any }
|
|
@@ -47,8 +47,8 @@ export type Column = {
|
|
|
47
47
|
searchType?: GridSearchType,
|
|
48
48
|
searchConfig?: { [key: string]: any },
|
|
49
49
|
searchTypeRenderer?: () => Component,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
headerContentGetter?: OnHeaderContentGetter,
|
|
51
|
+
valueGetter?: OnValueGetter,
|
|
52
52
|
onBeforeColumnStyleMounted?: OnBeforeColumnStyleMounted,
|
|
53
53
|
orderByEnabled?: boolean,
|
|
54
54
|
searchEnabled?: boolean,
|
|
@@ -7,8 +7,8 @@ export class CellValueGetter {
|
|
|
7
7
|
return () => {
|
|
8
8
|
let value = getValue(row, column.name)
|
|
9
9
|
|
|
10
|
-
if (column.
|
|
11
|
-
value = column.
|
|
10
|
+
if (column.valueGetter) {
|
|
11
|
+
value = column.valueGetter(value, row, grid)
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
if (grid.config.onBeforeCellMounted) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|