1
0
Fork 0
mirror of synced 2024-09-18 18:28:33 +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 { export class ApexOptionsBuilder {
formatters = { constructor() {
this.formatters = {
["Default"]: val => (isNaN(val) ? val : Math.round(val * 100) / 100), ["Default"]: val => (isNaN(val) ? val : Math.round(val * 100) / 100),
["Thousands"]: val => `${Math.round(val / 1000)}K`, ["Thousands"]: val => `${Math.round(val / 1000)}K`,
["Millions"]: val => `${Math.round(val / 1000000)}M`, ["Millions"]: val => `${Math.round(val / 1000000)}M`,
} }
options = { this.options = {
series: [], series: [],
legend: { legend: {
show: false, show: false,
@ -33,6 +34,7 @@ export class ApexOptionsBuilder {
}, },
}, },
} }
}
setOption(path, value) { setOption(path, value) {
if (value == null || 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. * For other types of datasource, this class is overridden and extended.
*/ */
export default class DataFetch { export default class DataFetch {
/**
* Constructs a new DataFetch instance.
* @param opts the fetch options
*/
constructor(opts) {
// API client // API client
API = null this.API = null
// Feature flags // Feature flags
featureStore = writable({ this.featureStore = writable({
supportsSearch: false, supportsSearch: false,
supportsSort: false, supportsSort: false,
supportsPagination: false, supportsPagination: false,
}) })
// Config // Config
options = { this.options = {
datasource: null, datasource: null,
limit: 10, limit: 10,
@ -43,7 +48,7 @@ export default class DataFetch {
} }
// State of the fetch // State of the fetch
store = writable({ this.store = writable({
rows: [], rows: [],
info: null, info: null,
schema: null, schema: null,
@ -55,11 +60,6 @@ export default class DataFetch {
cursors: [], cursors: [],
}) })
/**
* Constructs a new DataFetch instance.
* @param opts the fetch options
*/
constructor(opts) {
// Merge options with their default values // Merge options with their default values
this.API = opts?.API this.API = opts?.API
this.options = { this.options = {