@leafer-ui/data
Advanced tools
+5
-5
| { | ||
| "name": "@leafer-ui/data", | ||
| "version": "1.8.0", | ||
| "version": "1.9.0", | ||
| "description": "@leafer-ui/data", | ||
@@ -25,9 +25,9 @@ "author": "Chao (Leafer) Wan", | ||
| "dependencies": { | ||
| "@leafer/core": "1.8.0", | ||
| "@leafer-ui/external": "1.8.0" | ||
| "@leafer/core": "1.9.0", | ||
| "@leafer-ui/external": "1.9.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@leafer/interface": "1.8.0", | ||
| "@leafer-ui/interface": "1.8.0" | ||
| "@leafer/interface": "1.9.0", | ||
| "@leafer-ui/interface": "1.9.0" | ||
| } | ||
| } |
+2
-2
@@ -1,2 +0,2 @@ | ||
| import { UICreator } from '@leafer/core' | ||
| import { UICreator, isString } from '@leafer/core' | ||
@@ -28,3 +28,3 @@ import { IFontWeight, ITextData, IUI, IText, IObject, IBackgroundBoxStyle, IFontWeightNumer } from '@leafer-ui/interface' | ||
| setFontWeight(value: IFontWeight): void { | ||
| if (typeof value === 'string') { | ||
| if (isString(value)) { | ||
| this.__setInput('fontWeight', value) | ||
@@ -31,0 +31,0 @@ value = fontWeightMap[value] as IFontWeightNumer || 400 |
+11
-11
| import { INumber, IValue, IBoolean, IPathCommandData, IPathString, IPointData, IPathCommandObject, IObject, IFilter } from '@leafer/interface' | ||
| import { PathConvert, DataHelper, LeafData, Debug } from '@leafer/core' | ||
| import { PathConvert, DataHelper, LeafData, Debug, isArray, isObject, isString, isUndefined } from '@leafer/core' | ||
@@ -87,7 +87,7 @@ import { IUI, IUIData, ILeafPaint, IStrokeComputedStyle } from '@leafer-ui/interface' | ||
| if (this.__naturalWidth) this.__removeNaturalSize() | ||
| if (typeof value === 'string' || !value) { | ||
| if (isString(value) || !value) { | ||
| stintSet(this, '__isTransparentFill', hasTransparent(value as string)) | ||
| this.__isFills && this.__removePaint('fill', true) | ||
| this._fill = value | ||
| } else if (typeof value === 'object') { | ||
| } else if (isObject(value)) { | ||
| this.__setPaint('fill', value) | ||
@@ -98,7 +98,7 @@ } | ||
| protected setStroke(value: IValue) { | ||
| if (typeof value === 'string' || !value) { | ||
| if (isString(value) || !value) { | ||
| stintSet(this, '__isTransparentStroke', hasTransparent(value as string)) | ||
| this.__isStrokes && this.__removePaint('stroke', true) | ||
| this._stroke = value | ||
| } else if (typeof value === 'object') { | ||
| } else if (isObject(value)) { | ||
| this.__setPaint('stroke', value) | ||
@@ -110,6 +110,6 @@ } | ||
| protected setPath(value: IPathCommandData | IPathCommandObject[] | IPathString) { | ||
| const isString = typeof value === 'string' | ||
| if (isString || (value && typeof value[0] === 'object')) { | ||
| const isStr = isString(value) | ||
| if (isStr || (value && isObject(value[0]))) { | ||
| this.__setInput('path', value) | ||
| this._path = isString ? parse(value) : objectToCanvasData(value as IPathCommandObject[]) | ||
| this._path = isStr ? parse(value) : objectToCanvasData(value as IPathCommandObject[]) | ||
| } else { | ||
@@ -149,3 +149,3 @@ if (this.__input) this.__removeInput('path') | ||
| if (childStyle.strokeWidth) strokeWidth = childStyle.strokeWidth | ||
| if (childStyle.strokeWidthFixed !== undefined) strokeWidthFixed = childStyle.strokeWidthFixed | ||
| if (!isUndefined(childStyle.strokeWidthFixed)) strokeWidthFixed = childStyle.strokeWidthFixed | ||
| } | ||
@@ -163,3 +163,3 @@ if (strokeWidthFixed) { | ||
| layout.boxChanged || layout.boxChange() | ||
| if (value instanceof Array && !value.length) { | ||
| if (isArray(value) && !value.length) { | ||
| this.__removePaint(attrName) | ||
@@ -189,3 +189,3 @@ } else { | ||
| data.__setInput(key, value) | ||
| if (value instanceof Array) { | ||
| if (isArray(value)) { | ||
| if (value.some((item: IFilter) => item.visible === false)) value = value.filter((item: IFilter) => item.visible !== false) | ||
@@ -192,0 +192,0 @@ value.length || (value = undefined) |
19659
-0.22%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated