Add drill down for compose chart page block

This commit is contained in:
Jože Fortun
2023-02-17 18:02:18 +01:00
parent 0488e50e8c
commit cfc4ab7424
12 changed files with 325 additions and 92 deletions
+19 -4
View File
@@ -3,18 +3,28 @@ import { Apply, CortezaID, NoID } from '../../../cast'
const kind = 'Chart'
interface DrillDown {
enabled: boolean;
blockID?: string;
}
interface Options {
chartID: string;
refreshRate: number;
showRefresh: boolean;
magnifyOption: string;
drillDown: DrillDown;
}
const defaults: Readonly<Options> = Object.freeze({
chartID: NoID,
chartID: '',
refreshRate: 0,
magnifyOption: '',
showRefresh: false,
magnifyOption: '',
drillDown: {
enabled: false,
blockID: ''
}
})
export class PageBlockChart extends PageBlock {
@@ -30,10 +40,15 @@ export class PageBlockChart extends PageBlock {
applyOptions (o?: Partial<Options>): void {
if (!o) return
Apply(this.options, o, CortezaID, 'chartID')
o.chartID = o.chartID === NoID ? '' : o.chartID
Apply(this.options, o, String, 'chartID', 'magnifyOption')
Apply(this.options, o, Number, 'refreshRate')
Apply(this.options, o, Boolean, 'showRefresh')
Apply(this.options, o, String, 'magnifyOption')
if (o.drillDown) {
this.options.drillDown = o.drillDown
}
}
}
@@ -13,6 +13,7 @@ interface Options {
hideHeader: boolean;
hideAddButton: boolean;
hideImportButton: boolean;
hideConfigureFieldsButton: boolean;
hideSearch: boolean;
hidePaging: boolean;
hideSorting: boolean;
@@ -62,6 +63,7 @@ const defaults: Readonly<Options> = Object.freeze({
hideHeader: false,
hideAddButton: false,
hideImportButton: false,
hideConfigureFieldsButton: true,
hideSearch: false,
hidePaging: false,
hideSorting: false,
@@ -130,6 +132,7 @@ export class PageBlockRecordList extends PageBlock {
'hideHeader',
'hideAddButton',
'hideImportButton',
'hideConfigureFieldsButton',
'hideSearch',
'hidePaging',
'fullPageNavigation',
+1
View File
@@ -4,6 +4,7 @@
:theme="theme"
autoresize
class="position-absolute w-100 h-100 overflow-hidden"
v-on="$listeners"
/>
</template>