pixuireactcomponents 1.2.2 → 1.2.3

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 (105) hide show
  1. package/index.d.ts +15 -0
  2. package/index.js +16 -20
  3. package/package.json +9 -9
  4. package/tools/EventDispatcherJs.d.ts +10 -0
  5. package/tools/EventDispatcherJs.js +71 -0
  6. package/tools/Logger.d.ts +6 -0
  7. package/tools/Logger.js +138 -0
  8. package/ui/components/button/Button.d.ts +5 -0
  9. package/ui/components/button/Button.js +37 -0
  10. package/ui/components/carousel/Carousel.d.ts +5 -0
  11. package/ui/components/carousel/Carousel.js +219 -0
  12. package/ui/components/dropdown/Dropdown.d.ts +30 -0
  13. package/ui/components/dropdown/Dropdown.js +92 -0
  14. package/ui/components/dropdown/DropdownOptionUI.d.ts +11 -0
  15. package/ui/components/dropdown/DropdownOptionUI.js +28 -0
  16. package/ui/components/dropdown/DropdownSpreadMainUI.d.ts +9 -0
  17. package/ui/components/dropdown/DropdownSpreadMainUI.js +27 -0
  18. package/ui/components/dropdown/DropdownUnspreadMainUI.d.ts +9 -0
  19. package/ui/components/dropdown/DropdownUnspreadMainUI.js +27 -0
  20. package/ui/components/gradient/GradientText.d.ts +63 -0
  21. package/ui/components/gradient/{GradientText.tsx → GradientText.js} +174 -183
  22. package/ui/components/outlinetext/OutlineText.d.ts +94 -0
  23. package/ui/components/outlinetext/OutlineText.js +168 -0
  24. package/ui/components/progress/Progress.d.ts +34 -0
  25. package/ui/components/progress/Progress.js +142 -0
  26. package/ui/components/slapface/Slapface.d.ts +12 -0
  27. package/ui/components/slapface/Slapface.js +235 -0
  28. package/ui/components/slider/Slider.d.ts +57 -0
  29. package/ui/components/slider/Slider.js +289 -0
  30. package/ui/components/tab/Tab.d.ts +6 -0
  31. package/ui/components/tab/Tab.js +27 -0
  32. package/ui/components/tab/Tabs.d.ts +12 -0
  33. package/ui/components/tab/Tabs.js +54 -0
  34. package/cmdAfterTsBuild.js +0 -8
  35. package/tools/EventDispatcherJs.tsx +0 -74
  36. package/tools/Logger.tsx +0 -161
  37. package/tools/img/logger.png +0 -0
  38. package/tsconfig.json +0 -45
  39. package/ui/components/bulletscreen/BulletItemAnimation.tsx +0 -117
  40. package/ui/components/bulletscreen/BulletScreenAnimation.tsx +0 -278
  41. package/ui/components/bulletscreen/bullet.less +0 -17
  42. package/ui/components/button/Button.tsx +0 -18
  43. package/ui/components/carousel/Carousel.tsx +0 -279
  44. package/ui/components/checkBox/CheckBox.tsx +0 -40
  45. package/ui/components/dropdown/Dropdown.tsx +0 -126
  46. package/ui/components/dropdown/DropdownOptionUI.tsx +0 -14
  47. package/ui/components/dropdown/DropdownSpreadMainUI.tsx +0 -11
  48. package/ui/components/dropdown/DropdownUnspreadMainUI.tsx +0 -11
  49. package/ui/components/outlinetext/OutlineText.tsx +0 -184
  50. package/ui/components/progress/Progress.tsx +0 -174
  51. package/ui/components/slapface/Slapface.tsx +0 -284
  52. package/ui/components/slapface/less/Slapface.less +0 -112
  53. package/ui/components/slider/Slider.tsx +0 -366
  54. package/ui/components/tab/Tab.tsx +0 -12
  55. package/ui/components/tab/Tabs.tsx +0 -56
  56. package/ui/components/togglegroup/ToggleGroup.tsx +0 -105
  57. package/ui/components/videoplayer/VideoPlayer.tsx +0 -200
  58. package/ui/components/waterfallcomponent/WaterfallComponent.jsx +0 -687
  59. package/ui/components/waterfallcomponent/less/WaterfallComponent.less +0 -13
  60. package/ui/sample/Images.tsx +0 -60
  61. package/ui/sample/OutlineText/OutlineDemo.tsx +0 -61
  62. package/ui/sample/Slapface/SlapfaceDemo.tsx +0 -30
  63. package/ui/sample/asset/btn_close.png +0 -0
  64. package/ui/sample/asset/changtai_button.jpg +0 -0
  65. package/ui/sample/asset/checkbox0.png +0 -0
  66. package/ui/sample/asset/checkbox1.png +0 -0
  67. package/ui/sample/asset/data_arrow_down.png +0 -0
  68. package/ui/sample/asset/data_arrow_up.png +0 -0
  69. package/ui/sample/asset/dot.png +0 -0
  70. package/ui/sample/asset/inner.png +0 -0
  71. package/ui/sample/asset/item_reddot.png +0 -0
  72. package/ui/sample/asset/loading.png +0 -0
  73. package/ui/sample/asset/money_dropdown.png +0 -0
  74. package/ui/sample/asset/money_dropdownall.png +0 -0
  75. package/ui/sample/asset/outer.png +0 -0
  76. package/ui/sample/asset/slapface_samplepic1.png +0 -0
  77. package/ui/sample/asset/slapface_samplepic2.png +0 -0
  78. package/ui/sample/asset/slapface_samplepic3.png +0 -0
  79. package/ui/sample/asset/slapface_samplepic4.png +0 -0
  80. package/ui/sample/asset/slapface_samplepic5.png +0 -0
  81. package/ui/sample/asset/slapface_samplepic6.png +0 -0
  82. package/ui/sample/asset/tab_choosed.png +0 -0
  83. package/ui/sample/asset/tabs_bg.png +0 -0
  84. package/ui/sample/asset/video_pause.png +0 -0
  85. package/ui/sample/asset/video_play.png +0 -0
  86. package/ui/sample/asset/video_reload.png +0 -0
  87. package/ui/sample/asset/xuanfu_button.jpg +0 -0
  88. package/ui/sample/asset/yaxia_button.jpg +0 -0
  89. package/ui/sample/bulletscreen/BulletDemo.tsx +0 -84
  90. package/ui/sample/button/ButtonDemo.tsx +0 -19
  91. package/ui/sample/carousel/carouselDemo.tsx +0 -52
  92. package/ui/sample/checkBox/checkBoxDemo.tsx +0 -7
  93. package/ui/sample/dropdown/DropdownDemo.tsx +0 -65
  94. package/ui/sample/dropdown/MoneyDropdownOption.tsx +0 -50
  95. package/ui/sample/dropdown/MoneyDropdownSpreadMain.tsx +0 -42
  96. package/ui/sample/dropdown/MoneyDropdownUnspreadMain.tsx +0 -44
  97. package/ui/sample/gradient/GradientDemo.tsx +0 -51
  98. package/ui/sample/less/video.less +0 -144
  99. package/ui/sample/progress/ProgressDemo.tsx +0 -74
  100. package/ui/sample/slider/SliderDemo.tsx +0 -116
  101. package/ui/sample/tab/TabDemo.tsx +0 -67
  102. package/ui/sample/tab/TopTab.tsx +0 -74
  103. package/ui/sample/togglegroup/ToggleGroupDemo.tsx +0 -35
  104. package/ui/sample/videoplayer/VideoPlayerDemo.tsx +0 -57
  105. package/ui/sample/waterfallcomponent/WaterfallComponentDemo.jsx +0 -137
@@ -0,0 +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 };
@@ -0,0 +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
+ }
@@ -0,0 +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 };
@@ -0,0 +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
+ }
@@ -0,0 +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 };
@@ -0,0 +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
+ }
@@ -0,0 +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 };
@@ -0,0 +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
+ }