mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 11:52:38 +02:00
wip: do not use public class fields yet
Browser support is not enough.
This commit is contained in:
parent
f10d345113
commit
6bdba1d0ed
1 changed files with 12 additions and 11 deletions
|
@ -3,7 +3,6 @@ import * as Utils from './utils.js'
|
||||||
import { translate } from './i18n.js'
|
import { translate } from './i18n.js'
|
||||||
|
|
||||||
class Rule {
|
class Rule {
|
||||||
_condition = null
|
|
||||||
|
|
||||||
get condition() {
|
get condition() {
|
||||||
return this._condition
|
return this._condition
|
||||||
|
@ -14,7 +13,6 @@ class Rule {
|
||||||
this.parse()
|
this.parse()
|
||||||
}
|
}
|
||||||
|
|
||||||
_isDirty = false
|
|
||||||
|
|
||||||
get isDirty() {
|
get isDirty() {
|
||||||
return this._isDirty
|
return this._isDirty
|
||||||
|
@ -26,6 +24,18 @@ class Rule {
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(map, condition = '', options = {}) {
|
constructor(map, condition = '', options = {}) {
|
||||||
|
// TODO make this public properties when browser coverage is ok
|
||||||
|
// cf https://caniuse.com/?search=public%20class%20field
|
||||||
|
this._condition = null
|
||||||
|
this._isDirty = false
|
||||||
|
this.OPERATORS = [
|
||||||
|
['>', this.gt],
|
||||||
|
['<', this.lt],
|
||||||
|
// When sent by Django
|
||||||
|
['<', this.lt],
|
||||||
|
['!=', this.not_equal],
|
||||||
|
['=', this.equal],
|
||||||
|
]
|
||||||
this.map = map
|
this.map = map
|
||||||
this.active = true
|
this.active = true
|
||||||
this.options = options
|
this.options = options
|
||||||
|
@ -52,15 +62,6 @@ class Rule {
|
||||||
return other < this.expected
|
return other < this.expected
|
||||||
}
|
}
|
||||||
|
|
||||||
OPERATORS = [
|
|
||||||
['>', this.gt],
|
|
||||||
['<', this.lt],
|
|
||||||
// When sent by Django
|
|
||||||
['<', this.lt],
|
|
||||||
['!=', this.not_equal],
|
|
||||||
['=', this.equal],
|
|
||||||
]
|
|
||||||
|
|
||||||
parse() {
|
parse() {
|
||||||
let vars = []
|
let vars = []
|
||||||
this.cast = (v) => v
|
this.cast = (v) => v
|
||||||
|
|
Loading…
Reference in a new issue