pixuireactcomponents 1.1.17 → 1.1.18
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/index.js
CHANGED
|
@@ -12,5 +12,4 @@ export { Logger } from "./tools/Logger";
|
|
|
12
12
|
export { EventDispatcherJs } from "./tools/EventDispatcherJs";
|
|
13
13
|
export { Carousel } from "./ui/components/carousel/Carousel";
|
|
14
14
|
export { Slapface } from "./ui/components/slapface/Slapface";
|
|
15
|
-
export { SlapfaceLess } from "./ui/components/slapface/less/Slapface.less";
|
|
16
15
|
console.log("Hello, 欢迎使用PixUI React Components");
|
package/package.json
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
import { h, Component } from "preact";
|
|
2
|
-
export interface SettingsItems {
|
|
3
|
-
readonly ani_switch_type: number;
|
|
4
|
-
readonly is_mask: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface groupInfo {
|
|
7
|
-
groupId: number;
|
|
8
|
-
isLoadDone: boolean;
|
|
9
|
-
picture: string;
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
}
|
|
13
|
-
interface SlapfaceInfo {
|
|
14
|
-
LoadGroup(): groupInfo[];
|
|
15
|
-
jumpButton: object;
|
|
16
|
-
settingsitems: SettingsItems;
|
|
17
|
-
btn_closeButton: string;
|
|
18
|
-
}
|
|
19
2
|
export declare class Slapface extends Component<any, any> {
|
|
20
3
|
private LoadGroup;
|
|
21
4
|
private jumpButton;
|
|
@@ -24,18 +7,3 @@ export declare class Slapface extends Component<any, any> {
|
|
|
24
7
|
constructor(props: any);
|
|
25
8
|
render(): h.JSX.Element;
|
|
26
9
|
}
|
|
27
|
-
export declare class Group extends Component<SlapfaceInfo, any> {
|
|
28
|
-
constructor(props: any);
|
|
29
|
-
private groupIndexList;
|
|
30
|
-
private groupArr;
|
|
31
|
-
componentDidMount(): void;
|
|
32
|
-
closeClick(e?: Event): void;
|
|
33
|
-
render(): h.JSX.Element;
|
|
34
|
-
}
|
|
35
|
-
export declare class CloseButton extends Component<any, any> {
|
|
36
|
-
render(): h.JSX.Element;
|
|
37
|
-
}
|
|
38
|
-
export declare class JumpButton extends Component<any, any> {
|
|
39
|
-
render(): h.JSX.Element;
|
|
40
|
-
}
|
|
41
|
-
export {};
|
|
@@ -101,7 +101,6 @@ var Slapface = /** @class */ (function (_super) {
|
|
|
101
101
|
_this.jumpButton = _this.props.jumpButton ? _this.props.jumpButton : jumpButton;
|
|
102
102
|
_this.settingsitems = _this.props.settingsitems ? _this.props.settingsitems : settingsitems;
|
|
103
103
|
_this.btn_closeButton = _this.props.btn_closeButton;
|
|
104
|
-
console.log("111", _this.settingsitems);
|
|
105
104
|
return _this;
|
|
106
105
|
}
|
|
107
106
|
Slapface.prototype.render = function () {
|
|
@@ -140,9 +139,9 @@ var Group = /** @class */ (function (_super) {
|
|
|
140
139
|
}
|
|
141
140
|
Group.prototype.componentDidMount = function () {
|
|
142
141
|
var _this = this;
|
|
143
|
-
if (
|
|
142
|
+
if (this.picBack.style.visibility == 'hidden') {
|
|
144
143
|
setTimeout(function () {
|
|
145
|
-
|
|
144
|
+
_this.picBack.style.visibility = 'visible';
|
|
146
145
|
_this.closeClick();
|
|
147
146
|
}, 600);
|
|
148
147
|
}
|
|
@@ -150,15 +149,14 @@ var Group = /** @class */ (function (_super) {
|
|
|
150
149
|
Group.prototype.closeClick = function (e) {
|
|
151
150
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
152
151
|
var nextIndex = this.groupIndexList.CheckReady();
|
|
153
|
-
console.log("222", SlapfaceLess.groupBack);
|
|
154
152
|
if (nextIndex != -1) {
|
|
155
153
|
if (this.props.settingsitems.ani_switch_type == 2) {
|
|
156
|
-
|
|
154
|
+
this.picBack.classList.add(SlapfaceLess.groupBack);
|
|
157
155
|
}
|
|
158
156
|
this.setState({ curIndex: nextIndex });
|
|
159
157
|
}
|
|
160
158
|
else {
|
|
161
|
-
|
|
159
|
+
this.picBack.style.visibility = "hidden";
|
|
162
160
|
this.forceUpdate();
|
|
163
161
|
}
|
|
164
162
|
};
|
|
@@ -167,7 +165,7 @@ var Group = /** @class */ (function (_super) {
|
|
|
167
165
|
if (this.state.curIndex == -1) {
|
|
168
166
|
this.setState({ curIndex: this.groupIndexList.CheckReady() });
|
|
169
167
|
}
|
|
170
|
-
return (h("div", {
|
|
168
|
+
return (h("div", { ref: function (div) { _this.picBack = div; }, style: { width: '100%', height: '100%', alignItems: 'center', justifyContent: 'center', position: 'absolute', visibility: 'hidden' }, onAnimationEnd: function () { _this.picBack.classList.remove(SlapfaceLess.groupBack); } },
|
|
171
169
|
h("div", { onClick: function () { if (_this.props.settingsitems.is_mask == false)
|
|
172
170
|
return; _this.closeClick(); }, style: { position: "absolute", width: "100%", height: "100%" } }),
|
|
173
171
|
h("div", { style: { backgroundImage: "url(".concat(this.groupArr[this.state.curIndex].picture, ")"), width: this.groupArr[this.state.curIndex].width, height: this.groupArr[this.state.curIndex].height } },
|
|
@@ -176,19 +174,16 @@ var Group = /** @class */ (function (_super) {
|
|
|
176
174
|
};
|
|
177
175
|
return Group;
|
|
178
176
|
}(Component));
|
|
179
|
-
export { Group };
|
|
180
177
|
var CloseButton = /** @class */ (function (_super) {
|
|
181
178
|
__extends(CloseButton, _super);
|
|
182
179
|
function CloseButton() {
|
|
183
180
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
184
181
|
}
|
|
185
182
|
CloseButton.prototype.render = function () {
|
|
186
|
-
console.log("123213", this.props.btn_closeButton);
|
|
187
183
|
return (h("button", { className: SlapfaceLess.closeButton, style: { backgroundImage: "url(".concat(this.props.btn_closeButton, ")") }, onClick: this.props.onClick }));
|
|
188
184
|
};
|
|
189
185
|
return CloseButton;
|
|
190
186
|
}(Component));
|
|
191
|
-
export { CloseButton };
|
|
192
187
|
var JumpButton = /** @class */ (function (_super) {
|
|
193
188
|
__extends(JumpButton, _super);
|
|
194
189
|
function JumpButton() {
|
|
@@ -196,9 +191,8 @@ var JumpButton = /** @class */ (function (_super) {
|
|
|
196
191
|
}
|
|
197
192
|
JumpButton.prototype.render = function () {
|
|
198
193
|
var _this = this;
|
|
199
|
-
return (h("div", { className: SlapfaceLess.jumpButton, onMouseDown: function () {
|
|
200
|
-
h("img", {
|
|
194
|
+
return (h("div", { className: SlapfaceLess.jumpButton, onMouseDown: function () { _this.jumpbtnImg.src = _this.props.jumpButton.pic_yaxia; }, onMouseUp: function () { _this.jumpbtnImg.src = _this.props.jumpButton.pic_changtai; }, onMouseOver: function () { _this.jumpbtnImg.src = _this.props.jumpButton.pic_xuanfu; }, onMouseOut: function () { _this.jumpbtnImg.src = _this.props.jumpButton.pic_changtai; } },
|
|
195
|
+
h("img", { ref: function (img) { _this.jumpbtnImg = img; }, src: this.props.jumpButton.pic_changtai })));
|
|
201
196
|
};
|
|
202
197
|
return JumpButton;
|
|
203
198
|
}(Component));
|
|
204
|
-
export { JumpButton };
|