@leafer/platform 1.8.0 → 1.9.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/platform",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "@leafer/platform",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,10 +22,10 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/layouter": "1.8.0",
26
- "@leafer/debug": "1.8.0"
25
+ "@leafer/data": "1.9.0",
26
+ "@leafer/debug": "1.9.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "1.8.0"
29
+ "@leafer/interface": "1.9.0"
30
30
  }
31
31
  }
@@ -1,4 +1,5 @@
1
1
  import { IEvent, IObject } from '@leafer/interface'
2
+ import { isString } from '@leafer/data'
2
3
  import { Debug } from '@leafer/debug'
3
4
 
4
5
 
@@ -12,7 +13,7 @@ export const EventCreator = {
12
13
  let name: string
13
14
  Object.keys(Event).forEach(key => {
14
15
  name = Event[key]
15
- if (typeof name === 'string') nameList[name] && debug.repeat(name), nameList[name] = Event
16
+ if (isString(name)) nameList[name] && debug.repeat(name), nameList[name] = Event
16
17
  })
17
18
  },
18
19
 
@@ -1,4 +1,5 @@
1
1
  import { ILeaf, IObject } from '@leafer/interface'
2
+ import { isUndefined } from '@leafer/data'
2
3
  import { Debug } from '@leafer/debug'
3
4
 
4
5
 
@@ -17,7 +18,7 @@ export const UICreator = {
17
18
  get(tag: string, data?: IObject, x?: number, y?: number, width?: number, height?: number): ILeaf {
18
19
  if (!list[tag]) debug.error('not register ' + tag)
19
20
  const ui = new list[tag](data)
20
- if (x !== undefined) {
21
+ if (!isUndefined(x)) {
21
22
  ui.x = x
22
23
  if (y) ui.y = y
23
24
  if (width) ui.width = width