@leafer-ui/data 1.0.0-alpha.10 → 1.0.0-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/UIData.ts +8 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/data",
3
- "version": "1.0.0-alpha.10",
3
+ "version": "1.0.0-alpha.23",
4
4
  "description": "@leafer-ui/data",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -19,10 +19,10 @@
19
19
  "leaferjs"
20
20
  ],
21
21
  "dependencies": {
22
- "@leafer/core": "1.0.0-alpha.10"
22
+ "@leafer/core": "1.0.0-alpha.23"
23
23
  },
24
24
  "devDependencies": {
25
- "@leafer/interface": "1.0.0-alpha.10",
26
- "@leafer-ui/interface": "1.0.0-alpha.10"
25
+ "@leafer/interface": "1.0.0-alpha.23",
26
+ "@leafer-ui/interface": "1.0.0-alpha.23"
27
27
  }
28
28
  }
package/src/UIData.ts CHANGED
@@ -16,34 +16,28 @@ export class UIData extends LeafData implements IUIData {
16
16
  protected _innerShadow?: __Value
17
17
 
18
18
  protected setFill(value: __Value) {
19
- if (typeof value === 'string') {
20
- this._fill = value
19
+ this._fill = value
20
+ if (typeof value === 'string' || !value) {
21
21
  if (this.__isFills) this.__isFills = false
22
22
  } else if (value instanceof Array) {
23
- this._fill = value
23
+ this.__setInput('fill', value)
24
24
  this.__isFills = true
25
25
  } else if (typeof value === 'object') {
26
- this._fill = [value]
26
+ this.__setInput('fill', [value])
27
27
  this.__isFills = true
28
- } else {
29
- this._fill = value
30
- if (this.__isFills) this.__isFills = false
31
28
  }
32
29
  }
33
30
 
34
31
  protected setStroke(value: __Value) {
35
- if (typeof value === 'string') {
36
- this._stroke = value
32
+ this._stroke = value
33
+ if (typeof value === 'string' || !value) {
37
34
  if (this.__isStrokes) this.__isStrokes = false
38
35
  } else if (value instanceof Array) {
39
- this._stroke = value
36
+ this.__setInput('stroke', value)
40
37
  this.__isStrokes = true
41
38
  } else if (typeof value === 'object') {
42
- this._stroke = [value]
39
+ this.__setInput('stroke', [value])
43
40
  this.__isStrokes = true
44
- } else {
45
- this._stroke = value
46
- if (this.__isStrokes) this.__isStrokes = false
47
41
  }
48
42
  }
49
43