1
0
Fork 0
mirror of synced 2024-09-14 16:27:26 +12:00

Use OG class properties for iOS13 support

This commit is contained in:
Mel O'Hagan 2022-10-05 15:53:06 +01:00
parent 95dd5eefbb
commit 969c67f767
2 changed files with 71 additions and 69 deletions

View file

@ -1,10 +1,11 @@
export class ApexOptionsBuilder {
formatters = {
constructor() {
this.formatters = {
["Default"]: val => (isNaN(val) ? val : Math.round(val * 100) / 100),
["Thousands"]: val => `${Math.round(val / 1000)}K`,
["Millions"]: val => `${Math.round(val / 1000000)}M`,
}
options = {
this.options = {
series: [],
legend: {
show: false,
@ -33,6 +34,7 @@ export class ApexOptionsBuilder {
},
},
}
}
setOption(path, value) {
if (value == null || value === "") {

View file

@ -14,18 +14,23 @@ import { convertJSONSchemaToTableSchema } from "../utils/json"
* For other types of datasource, this class is overridden and extended.
*/
export default class DataFetch {
/**
* Constructs a new DataFetch instance.
* @param opts the fetch options
*/
constructor(opts) {
// API client
API = null
this.API = null
// Feature flags
featureStore = writable({
this.featureStore = writable({
supportsSearch: false,
supportsSort: false,
supportsPagination: false,
})
// Config
options = {
this.options = {
datasource: null,
limit: 10,
@ -43,7 +48,7 @@ export default class DataFetch {
}
// State of the fetch
store = writable({
this.store = writable({
rows: [],
info: null,
schema: null,
@ -55,11 +60,6 @@ export default class DataFetch {
cursors: [],
})
/**
* Constructs a new DataFetch instance.
* @param opts the fetch options
*/
constructor(opts) {
// Merge options with their default values
this.API = opts?.API
this.options = {