pixuireactcomponents 1.1.21 → 1.1.22

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 (37) hide show
  1. package/README.md +5 -5
  2. package/index.d.ts +15 -15
  3. package/index.js +16 -16
  4. package/package.json +11 -11
  5. package/tools/EventDispatcherJs.d.ts +10 -10
  6. package/tools/EventDispatcherJs.js +71 -71
  7. package/tools/Logger.d.ts +6 -6
  8. package/tools/Logger.js +138 -138
  9. package/tools/tools.md +21 -21
  10. package/ui/components/button/Button.d.ts +5 -5
  11. package/ui/components/button/Button.js +37 -37
  12. package/ui/components/carousel/Carousel.d.ts +5 -5
  13. package/ui/components/carousel/Carousel.js +219 -219
  14. package/ui/components/dropdown/Dropdown.d.ts +30 -30
  15. package/ui/components/dropdown/Dropdown.js +92 -92
  16. package/ui/components/dropdown/DropdownOptionUI.d.ts +11 -11
  17. package/ui/components/dropdown/DropdownOptionUI.js +28 -28
  18. package/ui/components/dropdown/DropdownSpreadMainUI.d.ts +9 -9
  19. package/ui/components/dropdown/DropdownSpreadMainUI.js +27 -27
  20. package/ui/components/dropdown/DropdownUnspreadMainUI.d.ts +9 -9
  21. package/ui/components/dropdown/DropdownUnspreadMainUI.js +27 -27
  22. package/ui/components/gradient/GradientText.d.ts +63 -63
  23. package/ui/components/gradient/GradientText.js +329 -329
  24. package/ui/components/outlinetext/OutlineText.d.ts +73 -73
  25. package/ui/components/outlinetext/OutlineText.js +157 -157
  26. package/ui/components/progress/Progress.d.ts +34 -34
  27. package/ui/components/progress/Progress.js +142 -142
  28. package/ui/components/slapface/Slapface.d.ts +12 -12
  29. package/ui/components/slapface/Slapface.js +224 -227
  30. package/ui/components/slapface/less/Slapface.less +125 -0
  31. package/ui/components/slider/Slider.d.ts +57 -57
  32. package/ui/components/slider/Slider.js +289 -289
  33. package/ui/components/tab/Tab.d.ts +6 -6
  34. package/ui/components/tab/Tab.js +27 -27
  35. package/ui/components/tab/Tabs.d.ts +12 -12
  36. package/ui/components/tab/Tabs.js +54 -54
  37. package/ui/ui.md +1 -1
@@ -1,92 +1,92 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- import { Component, h } from 'preact';
17
- var optionsDivStyle = {
18
- marginTop: 3,
19
- display: 'flex',
20
- flexDirection: 'column',
21
- justifyContent: 'flex-start',
22
- alignItems: 'center',
23
- height: 'auto',
24
- overflow: 'scroll',
25
- overflowStyle: 'none',
26
- };
27
- var Dropdown = /** @class */ (function (_super) {
28
- __extends(Dropdown, _super);
29
- function Dropdown(props) {
30
- var _this = _super.call(this, props) || this;
31
- _this.addNetEvents = function () {
32
- };
33
- _this.removeNetEvents = function () {
34
- };
35
- _this.addLogicEvents = function () {
36
- };
37
- _this.removeLogicEvents = function () {
38
- };
39
- _this.openList = function () {
40
- // console.warn("open dropdown====")
41
- _this.setState({
42
- isSpread: true
43
- });
44
- };
45
- _this.closeList = function () {
46
- // console.warn("close dropdown====")
47
- _this.setState({
48
- isSpread: false
49
- });
50
- };
51
- _this.onChoose = function (index) {
52
- _this.props.onChoose(index);
53
- // console.warn('dropdown-=----', index)
54
- _this.setState({
55
- selectedIndex: index,
56
- isSpread: false
57
- });
58
- };
59
- _this.addNetEvents();
60
- _this.addLogicEvents();
61
- var initIndex = _this.props.defaultIndex == null ? 0 : _this.props.defaultIndex;
62
- _this.state = {
63
- selectedIndex: initIndex,
64
- isSpread: false
65
- };
66
- return _this;
67
- }
68
- Dropdown.prototype.componentWillUnmount = function () {
69
- this.removeLogicEvents();
70
- this.removeNetEvents();
71
- };
72
- Dropdown.prototype.render = function () {
73
- var _this = this;
74
- if (!this.state.isSpread) {
75
- this.props.unspreadMainUI.props.info = this.props.config.datas[this.state.selectedIndex];
76
- this.props.unspreadMainUI.props.openList = this.openList;
77
- return (h("div", null, this.props.unspreadMainUI));
78
- }
79
- this.props.spreadMainUI.props.info = this.props.config.datas[this.state.selectedIndex];
80
- this.props.spreadMainUI.props.closeList = this.closeList;
81
- this.props.optionsUI.forEach(function (v, index) { v.props.onChoose = function () { _this.onChoose(index); }; });
82
- var _optionsUI = this.props.optionsUI.filter(function (v) { return v.props.index != _this.state.selectedIndex; });
83
- if (_optionsUI.length > 0)
84
- _optionsUI[_optionsUI.length - 1].props['isLast'] = true;
85
- return (h("div", null,
86
- h("div", { style: this.props.config.spreadStyle },
87
- this.props.spreadMainUI,
88
- h("div", { style: optionsDivStyle }, _optionsUI))));
89
- };
90
- return Dropdown;
91
- }(Component));
92
- export { Dropdown };
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Component, h } from 'preact';
17
+ var optionsDivStyle = {
18
+ marginTop: 3,
19
+ display: 'flex',
20
+ flexDirection: 'column',
21
+ justifyContent: 'flex-start',
22
+ alignItems: 'center',
23
+ height: 'auto',
24
+ overflow: 'scroll',
25
+ overflowStyle: 'none',
26
+ };
27
+ var Dropdown = /** @class */ (function (_super) {
28
+ __extends(Dropdown, _super);
29
+ function Dropdown(props) {
30
+ var _this = _super.call(this, props) || this;
31
+ _this.addNetEvents = function () {
32
+ };
33
+ _this.removeNetEvents = function () {
34
+ };
35
+ _this.addLogicEvents = function () {
36
+ };
37
+ _this.removeLogicEvents = function () {
38
+ };
39
+ _this.openList = function () {
40
+ // console.warn("open dropdown====")
41
+ _this.setState({
42
+ isSpread: true
43
+ });
44
+ };
45
+ _this.closeList = function () {
46
+ // console.warn("close dropdown====")
47
+ _this.setState({
48
+ isSpread: false
49
+ });
50
+ };
51
+ _this.onChoose = function (index) {
52
+ _this.props.onChoose(index);
53
+ // console.warn('dropdown-=----', index)
54
+ _this.setState({
55
+ selectedIndex: index,
56
+ isSpread: false
57
+ });
58
+ };
59
+ _this.addNetEvents();
60
+ _this.addLogicEvents();
61
+ var initIndex = _this.props.defaultIndex == null ? 0 : _this.props.defaultIndex;
62
+ _this.state = {
63
+ selectedIndex: initIndex,
64
+ isSpread: false
65
+ };
66
+ return _this;
67
+ }
68
+ Dropdown.prototype.componentWillUnmount = function () {
69
+ this.removeLogicEvents();
70
+ this.removeNetEvents();
71
+ };
72
+ Dropdown.prototype.render = function () {
73
+ var _this = this;
74
+ if (!this.state.isSpread) {
75
+ this.props.unspreadMainUI.props.info = this.props.config.datas[this.state.selectedIndex];
76
+ this.props.unspreadMainUI.props.openList = this.openList;
77
+ return (h("div", null, this.props.unspreadMainUI));
78
+ }
79
+ this.props.spreadMainUI.props.info = this.props.config.datas[this.state.selectedIndex];
80
+ this.props.spreadMainUI.props.closeList = this.closeList;
81
+ this.props.optionsUI.forEach(function (v, index) { v.props.onChoose = function () { _this.onChoose(index); }; });
82
+ var _optionsUI = this.props.optionsUI.filter(function (v) { return v.props.index != _this.state.selectedIndex; });
83
+ if (_optionsUI.length > 0)
84
+ _optionsUI[_optionsUI.length - 1].props['isLast'] = true;
85
+ return (h("div", null,
86
+ h("div", { style: this.props.config.spreadStyle },
87
+ this.props.spreadMainUI,
88
+ h("div", { style: optionsDivStyle }, _optionsUI))));
89
+ };
90
+ return Dropdown;
91
+ }(Component));
92
+ export { Dropdown };
@@ -1,11 +1,11 @@
1
- import { Component } from 'preact';
2
- /**
3
- * dropdown 打开时options列表的单个Item UI
4
- * 如果要使用滚动条,在创建改该组件时最外层div样式里面需添加flex-shrink : 0
5
- */
6
- export declare abstract class DropdownOptionUI<T> extends Component<{
7
- info: T;
8
- onChoose: Function;
9
- index: number;
10
- }, any> {
11
- }
1
+ import { Component } from 'preact';
2
+ /**
3
+ * dropdown 打开时options列表的单个Item UI
4
+ * 如果要使用滚动条,在创建改该组件时最外层div样式里面需添加flex-shrink : 0
5
+ */
6
+ export declare abstract class DropdownOptionUI<T> extends Component<{
7
+ info: T;
8
+ onChoose: Function;
9
+ index: number;
10
+ }, any> {
11
+ }
@@ -1,28 +1,28 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- import { Component } from 'preact';
17
- /**
18
- * dropdown 打开时options列表的单个Item UI
19
- * 如果要使用滚动条,在创建改该组件时最外层div样式里面需添加flex-shrink : 0
20
- */
21
- var DropdownOptionUI = /** @class */ (function (_super) {
22
- __extends(DropdownOptionUI, _super);
23
- function DropdownOptionUI() {
24
- return _super !== null && _super.apply(this, arguments) || this;
25
- }
26
- return DropdownOptionUI;
27
- }(Component));
28
- export { DropdownOptionUI };
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Component } from 'preact';
17
+ /**
18
+ * dropdown 打开时options列表的单个Item UI
19
+ * 如果要使用滚动条,在创建改该组件时最外层div样式里面需添加flex-shrink : 0
20
+ */
21
+ var DropdownOptionUI = /** @class */ (function (_super) {
22
+ __extends(DropdownOptionUI, _super);
23
+ function DropdownOptionUI() {
24
+ return _super !== null && _super.apply(this, arguments) || this;
25
+ }
26
+ return DropdownOptionUI;
27
+ }(Component));
28
+ export { DropdownOptionUI };
@@ -1,9 +1,9 @@
1
- import { Component } from 'preact';
2
- /**
3
- * dropdown 打开时选中框的UI
4
- */
5
- export declare abstract class DropdownSpreadMainUI<T> extends Component<{
6
- info: T;
7
- closeList: Function;
8
- }, any> {
9
- }
1
+ import { Component } from 'preact';
2
+ /**
3
+ * dropdown 打开时选中框的UI
4
+ */
5
+ export declare abstract class DropdownSpreadMainUI<T> extends Component<{
6
+ info: T;
7
+ closeList: Function;
8
+ }, any> {
9
+ }
@@ -1,27 +1,27 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- import { Component } from 'preact';
17
- /**
18
- * dropdown 打开时选中框的UI
19
- */
20
- var DropdownSpreadMainUI = /** @class */ (function (_super) {
21
- __extends(DropdownSpreadMainUI, _super);
22
- function DropdownSpreadMainUI() {
23
- return _super !== null && _super.apply(this, arguments) || this;
24
- }
25
- return DropdownSpreadMainUI;
26
- }(Component));
27
- export { DropdownSpreadMainUI };
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Component } from 'preact';
17
+ /**
18
+ * dropdown 打开时选中框的UI
19
+ */
20
+ var DropdownSpreadMainUI = /** @class */ (function (_super) {
21
+ __extends(DropdownSpreadMainUI, _super);
22
+ function DropdownSpreadMainUI() {
23
+ return _super !== null && _super.apply(this, arguments) || this;
24
+ }
25
+ return DropdownSpreadMainUI;
26
+ }(Component));
27
+ export { DropdownSpreadMainUI };
@@ -1,9 +1,9 @@
1
- import { Component } from 'preact';
2
- /**
3
- * dropdown 未打开时选中框的UI
4
- */
5
- export declare abstract class DropdownUnspreadMainUI<T> extends Component<{
6
- info: T;
7
- openList: Function;
8
- }, any> {
9
- }
1
+ import { Component } from 'preact';
2
+ /**
3
+ * dropdown 未打开时选中框的UI
4
+ */
5
+ export declare abstract class DropdownUnspreadMainUI<T> extends Component<{
6
+ info: T;
7
+ openList: Function;
8
+ }, any> {
9
+ }
@@ -1,27 +1,27 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- import { Component } from 'preact';
17
- /**
18
- * dropdown 未打开时选中框的UI
19
- */
20
- var DropdownUnspreadMainUI = /** @class */ (function (_super) {
21
- __extends(DropdownUnspreadMainUI, _super);
22
- function DropdownUnspreadMainUI() {
23
- return _super !== null && _super.apply(this, arguments) || this;
24
- }
25
- return DropdownUnspreadMainUI;
26
- }(Component));
27
- export { DropdownUnspreadMainUI };
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Component } from 'preact';
17
+ /**
18
+ * dropdown 未打开时选中框的UI
19
+ */
20
+ var DropdownUnspreadMainUI = /** @class */ (function (_super) {
21
+ __extends(DropdownUnspreadMainUI, _super);
22
+ function DropdownUnspreadMainUI() {
23
+ return _super !== null && _super.apply(this, arguments) || this;
24
+ }
25
+ return DropdownUnspreadMainUI;
26
+ }(Component));
27
+ export { DropdownUnspreadMainUI };
@@ -1,63 +1,63 @@
1
- import { Component, CSSProperties, h } from 'preact';
2
- export interface GradientTextProps {
3
- style?: CSSProperties;
4
- text?: string;
5
- color?: string;
6
- fontSize?: number;
7
- font?: string;
8
- alignment?: string;
9
- direction?: string;
10
- colorTop?: string;
11
- colorBottom?: string;
12
- colorLeft?: string;
13
- colorRight?: string;
14
- fitRectTransform?: boolean;
15
- richText?: boolean;
16
- alignByGeometry?: boolean;
17
- horizontalOverflow?: string;
18
- verticalOverflow?: string;
19
- bestFit?: boolean;
20
- raycastTarget?: boolean;
21
- fontStyle?: string;
22
- lineSpacing?: number;
23
- }
24
- export declare class GradientText extends Component<GradientTextProps, GradientTextProps> {
25
- isPrintLog: boolean;
26
- textObj: null;
27
- gradientObj: null;
28
- constructor(props: any);
29
- componentDidUpdate(): void;
30
- static getDerivedStateFromProps(props: any, state: any): {
31
- text: any;
32
- color: any;
33
- fontSize: any;
34
- font: any;
35
- alignment: any;
36
- direction: any;
37
- colorTop: any;
38
- colorBottom: any;
39
- colorLeft: any;
40
- colorRight: any;
41
- fitRectTransform: any;
42
- richText: any;
43
- alignByGeometry: any;
44
- horizontalOverflow: any;
45
- verticalOverflow: any;
46
- bestFit: any;
47
- raycastTarget: any;
48
- fontStyle: any;
49
- lineSpacing: any;
50
- } | null;
51
- getCSharp(): any;
52
- onLoad(e: any): void;
53
- updateGradientText(): void;
54
- transFont(fontName: any): any;
55
- transHorizontalOverflow(str: any): any;
56
- transVerticalOverflow(str: any): any;
57
- transFontStyle(str: any): any;
58
- colorRgb(colorStr: any): any;
59
- printLog(text: any): void;
60
- transDirection(direction: any): any;
61
- transAlignment(alignment: any): any;
62
- render(props: any): h.JSX.Element;
63
- }
1
+ import { Component, CSSProperties, h } from 'preact';
2
+ export interface GradientTextProps {
3
+ style?: CSSProperties;
4
+ text?: string;
5
+ color?: string;
6
+ fontSize?: number;
7
+ font?: string;
8
+ alignment?: string;
9
+ direction?: string;
10
+ colorTop?: string;
11
+ colorBottom?: string;
12
+ colorLeft?: string;
13
+ colorRight?: string;
14
+ fitRectTransform?: boolean;
15
+ richText?: boolean;
16
+ alignByGeometry?: boolean;
17
+ horizontalOverflow?: string;
18
+ verticalOverflow?: string;
19
+ bestFit?: boolean;
20
+ raycastTarget?: boolean;
21
+ fontStyle?: string;
22
+ lineSpacing?: number;
23
+ }
24
+ export declare class GradientText extends Component<GradientTextProps, GradientTextProps> {
25
+ isPrintLog: boolean;
26
+ textObj: null;
27
+ gradientObj: null;
28
+ constructor(props: any);
29
+ componentDidUpdate(): void;
30
+ static getDerivedStateFromProps(props: any, state: any): {
31
+ text: any;
32
+ color: any;
33
+ fontSize: any;
34
+ font: any;
35
+ alignment: any;
36
+ direction: any;
37
+ colorTop: any;
38
+ colorBottom: any;
39
+ colorLeft: any;
40
+ colorRight: any;
41
+ fitRectTransform: any;
42
+ richText: any;
43
+ alignByGeometry: any;
44
+ horizontalOverflow: any;
45
+ verticalOverflow: any;
46
+ bestFit: any;
47
+ raycastTarget: any;
48
+ fontStyle: any;
49
+ lineSpacing: any;
50
+ } | null;
51
+ getCSharp(): any;
52
+ onLoad(e: any): void;
53
+ updateGradientText(): void;
54
+ transFont(fontName: any): any;
55
+ transHorizontalOverflow(str: any): any;
56
+ transVerticalOverflow(str: any): any;
57
+ transFontStyle(str: any): any;
58
+ colorRgb(colorStr: any): any;
59
+ printLog(text: any): void;
60
+ transDirection(direction: any): any;
61
+ transAlignment(alignment: any): any;
62
+ render(props: any): h.JSX.Element;
63
+ }