Specify prop type

This commit is contained in:
Tobias Johansson 2019-04-04 10:44:22 +02:00
parent fe2f350013
commit de40b4b2b6
7 changed files with 18 additions and 9 deletions

View File

@ -91,7 +91,7 @@ let PillarTable = Vue.component('pillar-table-base', {
default: true default: true
}, },
componentState: { componentState: {
// Instance of ComponentState // Instance of ComponentState (but type Object since it has been deserialized)
type: Object, type: Object,
default: undefined default: undefined
} }

View File

@ -1,3 +1,6 @@
import {ColumnBase} from '../../columns/ColumnBase'
import {RowBase} from '../../rows/RowObjectBase'
const TEMPLATE =` const TEMPLATE =`
<div> <div>
{{ cellValue }} {{ cellValue }}
@ -11,8 +14,8 @@ const TEMPLATE =`
let CellDefault = Vue.component('pillar-cell-default', { let CellDefault = Vue.component('pillar-cell-default', {
template: TEMPLATE, template: TEMPLATE,
props: { props: {
column: Object, column: ColumnBase,
rowObject: Object, rowObject: RowBase,
rawCellValue: [String,Number,Boolean,Array,Object,Date,Function,Symbol,], rawCellValue: [String,Number,Boolean,Array,Object,Date,Function,Symbol,],
}, },
computed: { computed: {

View File

@ -1,3 +1,6 @@
import {RowBase} from '../../rows/RowObjectBase'
import {ColumnBase} from '../../columns/ColumnBase'
const TEMPLATE =` const TEMPLATE =`
<component class="pillar-cell" <component class="pillar-cell"
:class="cellClasses" :class="cellClasses"
@ -18,8 +21,8 @@ const TEMPLATE =`
let CellProxy = Vue.component('pillar-cell-proxy', { let CellProxy = Vue.component('pillar-cell-proxy', {
template: TEMPLATE, template: TEMPLATE,
props: { props: {
column: Object, // ColumnBase column: ColumnBase,
rowObject: Object // RowObject rowObject: RowBase,
}, },
computed: { computed: {
/** /**

View File

@ -1,3 +1,5 @@
import {ColumnBase} from '../../columns/ColumnBase'
const TEMPLATE =` const TEMPLATE =`
<div class="pillar-cell header-cell" <div class="pillar-cell header-cell"
:class="cellClasses" :class="cellClasses"
@ -34,7 +36,7 @@ const TEMPLATE =`
Vue.component('pillar-head-cell', { Vue.component('pillar-head-cell', {
template: TEMPLATE, template: TEMPLATE,
props: { props: {
column: Object column: ColumnBase,
}, },
computed: { computed: {
cellClasses() { cellClasses() {

View File

@ -63,7 +63,7 @@ let Filter = Vue.component('pillar-table-column-filter', {
template: TEMPLATE, template: TEMPLATE,
props: { props: {
columns: Array, // Instances of ColumnBase columns: Array, // Instances of ColumnBase
componentState: Object, // Instance of ComponentState componentState: Object, // Instance of ComponentState (but type Object since it has been deserialized)
}, },
data() { data() {
return { return {

View File

@ -63,7 +63,7 @@ let EnumFilter = {
props: { props: {
label: String, label: String,
availableValues: Array, // Array with valid values [{value: abc, displayName: xyz},...] availableValues: Array, // Array with valid values [{value: abc, displayName: xyz},...]
componentState: Object, // Instance of ComponentState. componentState: Object, // Instance of ComponentState (but type Object since it has been deserialized)
valueExtractorCB: { valueExtractorCB: {
// Callback to extract enumvalue from a rowObject // Callback to extract enumvalue from a rowObject
type: Function, type: Function,

View File

@ -1,4 +1,5 @@
import '../../cells/renderer/CellProxy' import '../../cells/renderer/CellProxy'
import {RowBase} from '../RowObjectBase'
const TEMPLATE =` const TEMPLATE =`
@ -21,7 +22,7 @@ const TEMPLATE =`
Vue.component('pillar-table-row', { Vue.component('pillar-table-row', {
template: TEMPLATE, template: TEMPLATE,
props: { props: {
rowObject: Object, rowObject: RowBase,
columns: Array columns: Array
}, },
computed: { computed: {