@leafer-ui/data 1.6.0 → 1.6.2

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 +5 -5
  2. package/src/TextData.ts +4 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/data",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "@leafer-ui/data",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "1.6.0",
26
- "@leafer-ui/external": "1.6.0"
25
+ "@leafer/core": "1.6.2",
26
+ "@leafer-ui/external": "1.6.2"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "1.6.0",
30
- "@leafer-ui/interface": "1.6.0"
29
+ "@leafer/interface": "1.6.2",
30
+ "@leafer-ui/interface": "1.6.2"
31
31
  }
32
32
  }
package/src/TextData.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { UICreator } from '@leafer/core'
2
2
 
3
- import { IFontWeight, ITextData, IUI, IText, IObject, IBackgroundBoxStyle } from '@leafer-ui/interface'
3
+ import { IFontWeight, ITextData, IUI, IText, IObject, IBackgroundBoxStyle, IFontWeightNumer } from '@leafer-ui/interface'
4
4
 
5
5
  import { UIData } from "./UIData"
6
6
 
@@ -27,11 +27,9 @@ export class TextData extends UIData implements ITextData {
27
27
  setFontWeight(value: IFontWeight): void {
28
28
  if (typeof value === 'string') {
29
29
  this.__setInput('fontWeight', value)
30
- this._fontWeight = fontWeightMap[value] || 400
31
- } else {
32
- if (this.__input) this.__removeInput('fontWeight')
33
- this._fontWeight = value
34
- }
30
+ value = fontWeightMap[value] as IFontWeightNumer || 400
31
+ } else if (this.__input) this.__removeInput('fontWeight')
32
+ this._fontWeight = value
35
33
  }
36
34
 
37
35
  setBoxStyle(value: IUI) {