@leafer-ui/external 1.4.0 → 1.4.1
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 +3 -3
- package/src/index.ts +12 -14
- package/types/index.d.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/external",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "@leafer-ui/external",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.4.
|
|
25
|
+
"@leafer/core": "1.4.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@leafer-ui/interface": "1.4.
|
|
28
|
+
"@leafer-ui/interface": "1.4.1"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
// Implemented in partner
|
|
2
|
-
import { IPaintModule, IPaintImageModule, IPaintGradientModule, IEffectModule, ITextConvertModule, IExportModule, IColorConvertModule, IPathArrowModule, IStateModule,
|
|
2
|
+
import { IPaintModule, IPaintImageModule, IPaintGradientModule, IEffectModule, ITextConvertModule, IExportModule, IColorConvertModule, IPathArrowModule, IStateModule, IUnitData, ITransitionModule, IFilterModule } from "@leafer-ui/interface"
|
|
3
3
|
import { Plugin } from '@leafer/core'
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
export const TextConvert = {} as ITextConvertModule
|
|
6
7
|
|
|
7
8
|
export const ColorConvert = {} as IColorConvertModule
|
|
8
9
|
|
|
9
10
|
export const UnitConvert = {
|
|
10
|
-
|
|
11
11
|
number(value: number | IUnitData, percentRefer?: number): number {
|
|
12
|
-
|
|
13
|
-
return value
|
|
12
|
+
return typeof value === 'object' ? (value.type === 'percent' ? value.value * percentRefer : value.value) : value
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
|
|
@@ -27,15 +25,15 @@ export const PaintGradient = {} as IPaintGradientModule
|
|
|
27
25
|
|
|
28
26
|
export const Effect = {} as IEffectModule
|
|
29
27
|
|
|
28
|
+
export const Filter = {
|
|
29
|
+
apply(): void { Plugin.need('filter') }
|
|
30
|
+
} as unknown as IFilterModule
|
|
31
|
+
|
|
30
32
|
export const Export = {} as IExportModule
|
|
31
33
|
|
|
32
34
|
export const State = {
|
|
33
|
-
setStyleName(
|
|
34
|
-
set(
|
|
35
|
-
} as IStateModule
|
|
36
|
-
|
|
37
|
-
export const Transition = {
|
|
38
|
-
list: {},
|
|
39
|
-
register(attrName: string, fn: ITransitionFunction): void { Transition.list[attrName] = fn },
|
|
40
|
-
get(attrName: string): ITransitionFunction { return Transition.list[attrName] }
|
|
41
|
-
} as ITransitionModule
|
|
35
|
+
setStyleName(): void { return Plugin.need('state') },
|
|
36
|
+
set(): void { return Plugin.need('state') }
|
|
37
|
+
} as unknown as IStateModule
|
|
38
|
+
|
|
39
|
+
export const Transition = {} as ITransitionModule
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ITextConvertModule, IColorConvertModule, IUnitData, IPathArrowModule, IPaintModule, IPaintImageModule, IPaintGradientModule, IEffectModule, IExportModule, IStateModule, ITransitionModule } from '@leafer-ui/interface';
|
|
1
|
+
import { ITextConvertModule, IColorConvertModule, IUnitData, IPathArrowModule, IPaintModule, IPaintImageModule, IPaintGradientModule, IEffectModule, IFilterModule, IExportModule, IStateModule, ITransitionModule } from '@leafer-ui/interface';
|
|
2
2
|
|
|
3
3
|
declare const TextConvert: ITextConvertModule;
|
|
4
4
|
declare const ColorConvert: IColorConvertModule;
|
|
@@ -10,8 +10,9 @@ declare const Paint: IPaintModule;
|
|
|
10
10
|
declare const PaintImage: IPaintImageModule;
|
|
11
11
|
declare const PaintGradient: IPaintGradientModule;
|
|
12
12
|
declare const Effect: IEffectModule;
|
|
13
|
+
declare const Filter: IFilterModule;
|
|
13
14
|
declare const Export: IExportModule;
|
|
14
15
|
declare const State: IStateModule;
|
|
15
16
|
declare const Transition: ITransitionModule;
|
|
16
17
|
|
|
17
|
-
export { ColorConvert, Effect, Export, Paint, PaintGradient, PaintImage, PathArrow, State, TextConvert, Transition, UnitConvert };
|
|
18
|
+
export { ColorConvert, Effect, Export, Filter, Paint, PaintGradient, PaintImage, PathArrow, State, TextConvert, Transition, UnitConvert };
|