@polyvharmony/live-scenes-foundation 1.3.0-rc.3 → 1.3.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/CHANGELOG.md +18 -1
- package/oh-package.json5 +1 -1
- package/package.json +1 -1
- package/src/main/ets/common/PLVBasicDataSource.d.ets +19 -19
- package/src/main/ets/common/PLVBasicDataSource.js +75 -75
- package/src/main/ets/common/PLVCallback.d.ets +20 -19
- package/src/main/ets/common/PLVCallback.js +78 -78
- package/src/main/ets/common/PLVCommonEnums.js +16 -16
- package/src/main/ets/common/PLVDeviceUtils.d.ets +4 -4
- package/src/main/ets/common/PLVDeviceUtils.js +9 -9
- package/src/main/ets/common/PLVHashMap.d.ets +2 -2
- package/src/main/ets/common/PLVHashMap.js +2 -2
- package/src/main/ets/common/PLVJSONUtils.d.ets +13 -13
- package/src/main/ets/common/PLVJSONUtils.js +46 -46
- package/src/main/ets/common/PLVNetUtils.d.ets +4 -4
- package/src/main/ets/common/PLVNetUtils.js +24 -24
- package/src/main/ets/common/PLVPreferencesUtils.d.ets +9 -9
- package/src/main/ets/common/PLVPreferencesUtils.js +16 -16
- package/src/main/ets/common/PLVScheduledTask.d.ets +1 -1
- package/src/main/ets/common/PLVScheduledTask.js +9 -9
- package/src/main/ets/common/PLVSimpleBuffer.d.ets +3 -3
- package/src/main/ets/common/PLVSimpleBuffer.js +8 -8
- package/src/main/ets/common/PLVSparseArray.d.ets +6 -6
- package/src/main/ets/common/PLVSparseArray.js +21 -21
- package/src/main/ets/common/PLVTextUtils.d.ets +8 -8
- package/src/main/ets/common/PLVTextUtils.js +44 -44
- package/src/main/ets/common/PLVTimeUtils.d.ets +1 -1
- package/src/main/ets/common/PLVTimeUtils.js +8 -8
- package/src/main/ets/common/PLVToastUtils.d.ets +4 -4
- package/src/main/ets/common/PLVToastUtils.js +7 -7
- package/src/main/ets/common/PLVUACreator.d.ets +1 -1
- package/src/main/ets/common/PLVUACreator.js +6 -6
- package/src/main/ets/common/PLVUtils.d.ets +25 -24
- package/src/main/ets/common/PLVUtils.js +141 -141
- package/src/main/ets/common/PLVWebUtils.d.ets +4 -4
- package/src/main/ets/common/PLVWebUtils.js +46 -47
- package/src/main/ets/common/ui/PLVNodeController.d.ets +11 -9
- package/src/main/ets/common/ui/PLVNodeController.js +48 -47
- package/src/main/ets/modules/log/PLVLogger.d.ets +11 -11
- package/src/main/ets/modules/log/PLVLogger.js +36 -36
- package/src/main/ets/modules/log/PLVXLogFilePrinter.d.ets +2 -2
- package/src/main/ets/modules/log/PLVXLogFilePrinter.js +14 -12
- package/src/main/ets/modules/net/PLVHttpData.d.ets +1 -1
- package/src/main/ets/modules/net/PLVHttpData.js +3 -3
- package/src/main/ets/modules/net/PLVHttpError.d.ets +2 -2
- package/src/main/ets/modules/net/PLVHttpError.js +5 -5
- package/src/main/ets/modules/net/PLVHttpRequest.d.ets +10 -9
- package/src/main/ets/modules/net/PLVHttpRequest.js +89 -88
- package/src/main/ets/modules/net/PLVRequestSetting.d.ets +3 -3
- package/src/main/ets/modules/net/PLVRequestSetting.js +14 -14
- package/src/main/ets/modules/socket/PLVSocketIO.d.ets +20 -20
- package/src/main/ets/modules/socket/PLVSocketIO.js +61 -61
- package/src/main/ets/modules/web/PLVFailureLayout.js +17 -18
- package/src/main/ets/modules/web/PLVLoadingLayout.js +12 -13
- package/src/main/ets/modules/web/PLVNewWindowLayout.js +17 -18
- package/src/main/ets/modules/web/PLVSimpleWeb.js +75 -79
- package/src/main/ets/modules/web/PLVWebController.d.ets +39 -39
- package/src/main/ets/modules/web/PLVWebController.js +106 -106
- package/src/main/module.json +1 -1
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.
|
|
4
|
-
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (x2, y2, z2, a3) {
|
|
2
|
+
var b3 = arguments.length, c3 = b3 < 3 ? y2 : a3 === null ? a3 = Object.getOwnPropertyDescriptor(y2, z2) : a3, d3;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4
|
+
c3 = Reflect.decorate(x2, y2, z2, a3);
|
|
5
5
|
else
|
|
6
|
-
for (var
|
|
7
|
-
if (
|
|
8
|
-
|
|
9
|
-
return
|
|
6
|
+
for (var e3 = x2.length - 1; e3 >= 0; e3--)
|
|
7
|
+
if (d3 = x2[e3])
|
|
8
|
+
c3 = (b3 < 3 ? d3(c3) : b3 > 3 ? d3(y2, z2, c3) : d3(y2, z2)) || c3;
|
|
9
|
+
return b3 > 3 && c3 && Object.defineProperty(y2, z2, c3), c3;
|
|
10
10
|
};
|
|
11
11
|
import PLVLogger from '../modules/log/PLVLogger';
|
|
12
12
|
import PLVUtils from './PLVUtils';
|
|
13
|
-
export function PLVCustomBuilder(
|
|
14
|
-
const
|
|
13
|
+
export function PLVCustomBuilder(u2, v2 = null) {
|
|
14
|
+
const w2 = u2;
|
|
15
15
|
}
|
|
16
16
|
export class PLVMediaQueryListener {
|
|
17
|
-
constructor(
|
|
18
|
-
this.listener =
|
|
19
|
-
this.callback =
|
|
17
|
+
constructor(s2, t2) {
|
|
18
|
+
this.listener = s2;
|
|
19
|
+
this.callback = t2;
|
|
20
20
|
}
|
|
21
21
|
off() {
|
|
22
22
|
this.listener?.off("change", this.callback);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
export class PLVAvoidAreaChangeListener {
|
|
26
|
-
constructor(
|
|
27
|
-
this.windowClass =
|
|
28
|
-
this.callback =
|
|
26
|
+
constructor(q2, r2) {
|
|
27
|
+
this.windowClass = q2;
|
|
28
|
+
this.callback = r2;
|
|
29
29
|
}
|
|
30
30
|
off() {
|
|
31
31
|
try {
|
|
32
32
|
this.windowClass?.off("avoidAreaChange", this.callback);
|
|
33
33
|
}
|
|
34
|
-
catch (
|
|
34
|
+
catch (p2) {
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
export class PLVStateData {
|
|
39
|
-
constructor(
|
|
40
|
-
this.data =
|
|
39
|
+
constructor(o2) {
|
|
40
|
+
this.data = o2;
|
|
41
41
|
}
|
|
42
42
|
copy() {
|
|
43
43
|
return this.copyValue(this.data);
|
|
44
44
|
}
|
|
45
|
-
copyValue(
|
|
46
|
-
return new PLVStateData(
|
|
45
|
+
copyValue(n2) {
|
|
46
|
+
return new PLVStateData(n2);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
export class PLVStatefulData extends PLVStateData {
|
|
50
|
-
constructor(
|
|
51
|
-
super(
|
|
52
|
-
this.isSuccess =
|
|
53
|
-
this.error =
|
|
50
|
+
constructor(k2, l2 = true, m2) {
|
|
51
|
+
super(k2);
|
|
52
|
+
this.isSuccess = l2;
|
|
53
|
+
this.error = m2;
|
|
54
54
|
}
|
|
55
|
-
static success(
|
|
56
|
-
return new PLVStatefulData(
|
|
55
|
+
static success(j2) {
|
|
56
|
+
return new PLVStatefulData(j2, true);
|
|
57
57
|
}
|
|
58
|
-
static error(
|
|
59
|
-
return new PLVStatefulData(undefined, false,
|
|
58
|
+
static error(i2) {
|
|
59
|
+
return new PLVStatefulData(undefined, false, i2);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
export class PLVDisposable {
|
|
@@ -74,32 +74,32 @@ export class PLVPromiseValue {
|
|
|
74
74
|
constructor() {
|
|
75
75
|
this.callbacks = [];
|
|
76
76
|
}
|
|
77
|
-
set(
|
|
77
|
+
set(g2) {
|
|
78
78
|
if (this.value == undefined) {
|
|
79
|
-
this.resolve?.(
|
|
79
|
+
this.resolve?.(g2);
|
|
80
80
|
}
|
|
81
|
-
if (this.value !=
|
|
82
|
-
this.callbacks.forEach(
|
|
83
|
-
|
|
81
|
+
if (this.value != g2) {
|
|
82
|
+
this.callbacks.forEach(h2 => {
|
|
83
|
+
h2(g2);
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
this.value =
|
|
86
|
+
this.value = g2;
|
|
87
87
|
}
|
|
88
|
-
observe(
|
|
88
|
+
observe(f2) {
|
|
89
89
|
if (this.value != undefined) {
|
|
90
|
-
|
|
90
|
+
f2(this.value);
|
|
91
91
|
}
|
|
92
|
-
this.callbacks.push(
|
|
92
|
+
this.callbacks.push(f2);
|
|
93
93
|
}
|
|
94
94
|
get() {
|
|
95
95
|
if (this.value != undefined) {
|
|
96
96
|
return this.value;
|
|
97
97
|
}
|
|
98
98
|
if (!this.promise) {
|
|
99
|
-
this.promise = PLVUtils.safePromise((
|
|
100
|
-
this.resolve =
|
|
99
|
+
this.promise = PLVUtils.safePromise((d2, e2) => {
|
|
100
|
+
this.resolve = d2;
|
|
101
101
|
if (this.value != undefined) {
|
|
102
|
-
|
|
102
|
+
d2(this.value);
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
105
|
}
|
|
@@ -110,73 +110,73 @@ export class PLVPromiseValue {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
let PLVLazyValue = class PLVLazyValue {
|
|
113
|
-
constructor(
|
|
114
|
-
this._callback =
|
|
113
|
+
constructor(c2) {
|
|
114
|
+
this._callback = c2;
|
|
115
115
|
}
|
|
116
|
-
get(
|
|
116
|
+
get(b2) {
|
|
117
117
|
if (this._value == undefined) {
|
|
118
|
-
this._value = this._callback(
|
|
118
|
+
this._value = this._callback(b2);
|
|
119
119
|
}
|
|
120
120
|
return this._value;
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
|
-
PLVLazyValue =
|
|
123
|
+
PLVLazyValue = __decorate([
|
|
124
124
|
Observed
|
|
125
125
|
], PLVLazyValue);
|
|
126
126
|
export { PLVLazyValue };
|
|
127
127
|
let PLVAsyncLazyValue = class PLVAsyncLazyValue {
|
|
128
|
-
constructor(
|
|
129
|
-
this._callback =
|
|
128
|
+
constructor(a2) {
|
|
129
|
+
this._callback = a2;
|
|
130
130
|
}
|
|
131
|
-
get(
|
|
131
|
+
get(x1, y1) {
|
|
132
132
|
if (this._value === undefined) {
|
|
133
|
-
this._callback(
|
|
134
|
-
this._value =
|
|
135
|
-
|
|
133
|
+
this._callback(y1, (z1) => {
|
|
134
|
+
this._value = z1;
|
|
135
|
+
x1(this._value);
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
|
-
|
|
139
|
+
x1(this._value);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
-
PLVAsyncLazyValue =
|
|
143
|
+
PLVAsyncLazyValue = __decorate([
|
|
144
144
|
Observed
|
|
145
145
|
], PLVAsyncLazyValue);
|
|
146
146
|
export { PLVAsyncLazyValue };
|
|
147
147
|
export class PLVEventNotify {
|
|
148
|
-
constructor(
|
|
148
|
+
constructor(v1, w1 = true) {
|
|
149
149
|
this.tag = '[PLVEventNotify]';
|
|
150
150
|
this.events = new Map();
|
|
151
151
|
this.emitLogToFile = true;
|
|
152
|
-
this.tag = PLVUtils.getClassTag(
|
|
153
|
-
this.emitLogToFile =
|
|
154
|
-
}
|
|
155
|
-
on(
|
|
156
|
-
PLVLogger.info(PLVUtils.getClassTag(
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
this.events.set(
|
|
160
|
-
}
|
|
161
|
-
off(
|
|
162
|
-
PLVLogger.info(PLVUtils.getClassTag(
|
|
163
|
-
if (
|
|
164
|
-
const
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
167
|
-
|
|
152
|
+
this.tag = PLVUtils.getClassTag(v1) || this.tag;
|
|
153
|
+
this.emitLogToFile = w1;
|
|
154
|
+
}
|
|
155
|
+
on(r1, s1, t1) {
|
|
156
|
+
PLVLogger.info(PLVUtils.getClassTag(t1) || this.tag, `on event: ${r1}`);
|
|
157
|
+
const u1 = this.events.get(r1) || [];
|
|
158
|
+
u1.push(s1);
|
|
159
|
+
this.events.set(r1, u1);
|
|
160
|
+
}
|
|
161
|
+
off(m1, n1, o1) {
|
|
162
|
+
PLVLogger.info(PLVUtils.getClassTag(o1) || this.tag, `off event: ${m1}`);
|
|
163
|
+
if (n1) {
|
|
164
|
+
const p1 = this.events.get(m1) || [];
|
|
165
|
+
const q1 = p1.indexOf(n1);
|
|
166
|
+
if (q1 !== -1) {
|
|
167
|
+
p1.splice(q1, 1);
|
|
168
168
|
}
|
|
169
|
-
this.events.set(
|
|
169
|
+
this.events.set(m1, p1);
|
|
170
170
|
}
|
|
171
171
|
else {
|
|
172
|
-
this.events.delete(
|
|
172
|
+
this.events.delete(m1);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
emit(
|
|
176
|
-
PLVLogger.info(this.tag, `emit event: ${
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
emit(i1, ...j1) {
|
|
176
|
+
PLVLogger.info(this.tag, `emit event: ${i1}, args: ${j1}`, this.emitLogToFile);
|
|
177
|
+
const k1 = this.events.get(i1) || [];
|
|
178
|
+
k1.forEach(l1 => {
|
|
179
|
+
l1(...j1);
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
clear() {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export var PLVWebpageStatus;
|
|
2
|
-
(function (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
(function (h3) {
|
|
3
|
+
h3["INIT"] = "init";
|
|
4
|
+
h3["ERROR"] = "error";
|
|
5
|
+
h3["FINISHED"] = "finished";
|
|
6
6
|
})(PLVWebpageStatus || (PLVWebpageStatus = {}));
|
|
7
7
|
export var PLVFullScreenStatus;
|
|
8
|
-
(function (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
(function (g3) {
|
|
9
|
+
g3["IDLE"] = "idle";
|
|
10
|
+
g3["ENTER"] = "enter";
|
|
11
|
+
g3["EXIT"] = "exit";
|
|
12
12
|
})(PLVFullScreenStatus || (PLVFullScreenStatus = {}));
|
|
13
13
|
export var PLVPrintLogLevel;
|
|
14
|
-
(function (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
(function (f3) {
|
|
15
|
+
f3[f3["ALL"] = 0] = "ALL";
|
|
16
|
+
f3[f3["VERBOSE"] = 2] = "VERBOSE";
|
|
17
|
+
f3[f3["DEBUG"] = 3] = "DEBUG";
|
|
18
|
+
f3[f3["INFO"] = 4] = "INFO";
|
|
19
|
+
f3[f3["WARN"] = 5] = "WARN";
|
|
20
|
+
f3[f3["ERROR"] = 6] = "ERROR";
|
|
21
|
+
f3[f3["NONE"] = 99] = "NONE";
|
|
22
22
|
})(PLVPrintLogLevel || (PLVPrintLogLevel = {}));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import ConfigurationConstant from "@ohos.app.ability.ConfigurationConstant";
|
|
2
|
+
import window from "@ohos.window";
|
|
3
3
|
export declare class PLVDeviceUtils {
|
|
4
4
|
static getNavigationIndicatorHeight(): number;
|
|
5
5
|
static getStatusBarHeight(): number;
|
|
6
6
|
static getWidth(): number;
|
|
7
7
|
static getHeight(): number;
|
|
8
8
|
static getMinDisplaySide(): number;
|
|
9
|
-
static setColorMode(
|
|
10
|
-
static setWindowSystemBarProperties(
|
|
9
|
+
static setColorMode(m3: ConfigurationConstant.ColorMode): void;
|
|
10
|
+
static setWindowSystemBarProperties(i3?: window.SystemBarProperties): void;
|
|
11
11
|
}
|
|
@@ -17,20 +17,20 @@ export class PLVDeviceUtils {
|
|
|
17
17
|
static getMinDisplaySide() {
|
|
18
18
|
return Math.min(PLVDeviceUtils.getWidth(), PLVDeviceUtils.getHeight());
|
|
19
19
|
}
|
|
20
|
-
static setColorMode(
|
|
21
|
-
AppUtil.getContext().getApplicationContext().setColorMode(
|
|
20
|
+
static setColorMode(m3) {
|
|
21
|
+
AppUtil.getContext().getApplicationContext().setColorMode(m3);
|
|
22
22
|
}
|
|
23
|
-
static setWindowSystemBarProperties(
|
|
23
|
+
static setWindowSystemBarProperties(i3) {
|
|
24
24
|
try {
|
|
25
|
-
let
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
PLVLogger.error(TAG, `setWindowSystemBarProperties-error ~ code: ${
|
|
25
|
+
let k3 = AppUtil.getMainWindow();
|
|
26
|
+
if (i3) {
|
|
27
|
+
k3.setWindowSystemBarProperties(i3).catch((l3) => {
|
|
28
|
+
PLVLogger.error(TAG, `setWindowSystemBarProperties-error ~ code: ${l3.code} -·- message: ${l3.message}`);
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
catch (
|
|
33
|
-
PLVLogger.error(TAG, JSON.stringify(
|
|
32
|
+
catch (j3) {
|
|
33
|
+
PLVLogger.error(TAG, JSON.stringify(j3));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -2,20 +2,20 @@ import { ClassConstructor } from 'class-transformer';
|
|
|
2
2
|
import { PLVHttpData } from '../modules/net/PLVHttpData';
|
|
3
3
|
import { PLVJSONObject } from './PLVType';
|
|
4
4
|
export default class PLVJSONUtils {
|
|
5
|
-
static safeStringify(
|
|
6
|
-
static safeParse(
|
|
7
|
-
static json2Bean<
|
|
8
|
-
static bean2Json(
|
|
9
|
-
static bean2Bean<
|
|
10
|
-
static httpData2Bean<
|
|
11
|
-
static json2Map(
|
|
12
|
-
static object2Map(
|
|
13
|
-
static map2json(
|
|
14
|
-
static map2jsonStr(
|
|
15
|
-
static toUnescapedData(
|
|
16
|
-
static toFillData<
|
|
5
|
+
static safeStringify(p4?: Object, q4?: (this: object, key: string, value: object) => object | undefined): string;
|
|
6
|
+
static safeParse(n4?: string): object | undefined;
|
|
7
|
+
static json2Bean<a24>(k4: ClassConstructor<a24>, l4: string): a24 | undefined;
|
|
8
|
+
static bean2Json(i4: Object | Array<Object | String | Number | Boolean> | null | undefined): string;
|
|
9
|
+
static bean2Bean<y23, z23>(f4: y23, g4: z23): y23 | undefined;
|
|
10
|
+
static httpData2Bean<x23>(b4: x23, c4: PLVHttpData<x23>): x23 | undefined;
|
|
11
|
+
static json2Map(a4: string): Map<string, Object>;
|
|
12
|
+
static object2Map(z3: PLVJSONObject): Map<string, Object | undefined>;
|
|
13
|
+
static map2json(v3: Map<string, Object | undefined>): Record<string, Object>;
|
|
14
|
+
static map2jsonStr(t3: Map<string, Object>, u3?: (this: object, key: string, value: object) => object | undefined): string;
|
|
15
|
+
static toUnescapedData(s3: string): string;
|
|
16
|
+
static toFillData<w23 extends FillData>(p3: ClassConstructor<w23> | w23, q3: string | Object | undefined): w23 | undefined;
|
|
17
17
|
}
|
|
18
|
-
interface
|
|
18
|
+
interface FillData {
|
|
19
19
|
fill(): void;
|
|
20
20
|
}
|
|
21
21
|
export {};
|
|
@@ -1,103 +1,103 @@
|
|
|
1
1
|
import { instanceToPlain, plainToClass, plainToClassFromExist } from 'class-transformer';
|
|
2
2
|
export default class PLVJSONUtils {
|
|
3
|
-
static safeStringify(
|
|
3
|
+
static safeStringify(p4, q4) {
|
|
4
4
|
try {
|
|
5
|
-
return JSON.stringify(
|
|
5
|
+
return JSON.stringify(p4 || new Object(), q4);
|
|
6
6
|
}
|
|
7
|
-
catch (
|
|
7
|
+
catch (r4) {
|
|
8
8
|
return '';
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
static safeParse(
|
|
11
|
+
static safeParse(n4) {
|
|
12
12
|
try {
|
|
13
|
-
return JSON.parse(
|
|
13
|
+
return JSON.parse(n4 || '');
|
|
14
14
|
}
|
|
15
|
-
catch (
|
|
15
|
+
catch (o4) {
|
|
16
16
|
return undefined;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
static json2Bean(
|
|
19
|
+
static json2Bean(k4, l4) {
|
|
20
20
|
try {
|
|
21
|
-
return plainToClass(
|
|
21
|
+
return plainToClass(k4, JSON.parse(l4), {
|
|
22
22
|
enableImplicitConversion: false, exposeDefaultValues: true
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
catch (
|
|
25
|
+
catch (m4) {
|
|
26
26
|
return undefined;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
static bean2Json(
|
|
29
|
+
static bean2Json(i4) {
|
|
30
30
|
try {
|
|
31
|
-
if (
|
|
31
|
+
if (i4 == null || i4 == undefined) {
|
|
32
32
|
return '';
|
|
33
33
|
}
|
|
34
|
-
return JSON.stringify(instanceToPlain(
|
|
34
|
+
return JSON.stringify(instanceToPlain(i4));
|
|
35
35
|
}
|
|
36
|
-
catch (
|
|
36
|
+
catch (j4) {
|
|
37
37
|
return "";
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
static bean2Bean(
|
|
40
|
+
static bean2Bean(f4, g4) {
|
|
41
41
|
try {
|
|
42
|
-
return plainToClassFromExist(
|
|
42
|
+
return plainToClassFromExist(f4, g4, {
|
|
43
43
|
enableImplicitConversion: false, exposeDefaultValues: true
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
catch (
|
|
46
|
+
catch (h4) {
|
|
47
47
|
return undefined;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
static httpData2Bean(
|
|
50
|
+
static httpData2Bean(b4, c4) {
|
|
51
51
|
try {
|
|
52
|
-
|
|
52
|
+
c4.data = plainToClassFromExist(b4, c4.data, {
|
|
53
53
|
enableImplicitConversion: false, exposeDefaultValues: true
|
|
54
54
|
});
|
|
55
55
|
try {
|
|
56
|
-
|
|
56
|
+
c4.data.fill();
|
|
57
57
|
}
|
|
58
|
-
catch (
|
|
58
|
+
catch (e4) {
|
|
59
59
|
}
|
|
60
|
-
return
|
|
60
|
+
return c4.data;
|
|
61
61
|
}
|
|
62
|
-
catch (
|
|
62
|
+
catch (d4) {
|
|
63
63
|
return undefined;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
static json2Map(
|
|
67
|
-
return new Map(Object.entries(JSON.parse(
|
|
66
|
+
static json2Map(a4) {
|
|
67
|
+
return new Map(Object.entries(JSON.parse(a4)));
|
|
68
68
|
}
|
|
69
|
-
static object2Map(
|
|
70
|
-
return new Map(Object.entries(
|
|
69
|
+
static object2Map(z3) {
|
|
70
|
+
return new Map(Object.entries(z3));
|
|
71
71
|
}
|
|
72
|
-
static map2json(
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
if (
|
|
76
|
-
|
|
72
|
+
static map2json(v3) {
|
|
73
|
+
const w3 = {};
|
|
74
|
+
v3.forEach((x3, y3) => {
|
|
75
|
+
if (y3 && x3) {
|
|
76
|
+
w3[y3] = x3;
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
-
return
|
|
79
|
+
return w3;
|
|
80
80
|
}
|
|
81
|
-
static map2jsonStr(
|
|
82
|
-
return PLVJSONUtils.safeStringify(PLVJSONUtils.map2json(
|
|
81
|
+
static map2jsonStr(t3, u3) {
|
|
82
|
+
return PLVJSONUtils.safeStringify(PLVJSONUtils.map2json(t3), u3);
|
|
83
83
|
}
|
|
84
|
-
static toUnescapedData(
|
|
85
|
-
if (!
|
|
86
|
-
return
|
|
84
|
+
static toUnescapedData(s3) {
|
|
85
|
+
if (!s3.includes('\\')) {
|
|
86
|
+
return s3;
|
|
87
87
|
}
|
|
88
|
-
return
|
|
88
|
+
return s3.substring(1, s3.length - 1)
|
|
89
89
|
.replace(/\\"/g, '"')
|
|
90
90
|
.replace(/\\\\/g, '\\');
|
|
91
91
|
}
|
|
92
|
-
static toFillData(
|
|
93
|
-
let
|
|
94
|
-
if (typeof
|
|
95
|
-
|
|
92
|
+
static toFillData(p3, q3) {
|
|
93
|
+
let r3 = undefined;
|
|
94
|
+
if (typeof q3 === 'string') {
|
|
95
|
+
r3 = PLVJSONUtils.json2Bean(p3, q3);
|
|
96
96
|
}
|
|
97
|
-
else if (typeof
|
|
98
|
-
|
|
97
|
+
else if (typeof q3 === 'object') {
|
|
98
|
+
r3 = PLVJSONUtils.bean2Bean(p3, q3);
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
return
|
|
100
|
+
r3?.fill();
|
|
101
|
+
return r3;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare class PLVNetUtils {
|
|
2
|
-
static replaceUrl(
|
|
3
|
-
static formatUrl(
|
|
4
|
-
static formatParams(
|
|
5
|
-
static appendParams(
|
|
2
|
+
static replaceUrl(d5: string, e5: Map<string, string | undefined>): string;
|
|
3
|
+
static formatUrl(b5: string, c5: Record<string, string | undefined>): string;
|
|
4
|
+
static formatParams(v4?: Record<string, string>, w4?: boolean): string;
|
|
5
|
+
static appendParams(s4: string, t4?: Record<string, string>): string;
|
|
6
6
|
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
export class PLVNetUtils {
|
|
2
|
-
static replaceUrl(
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
let
|
|
6
|
-
while ((
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
10
|
-
|
|
2
|
+
static replaceUrl(d5, e5) {
|
|
3
|
+
const f5 = /{(\w+?)}/g;
|
|
4
|
+
let g5;
|
|
5
|
+
let h5 = d5;
|
|
6
|
+
while ((g5 = f5.exec(d5)) !== null) {
|
|
7
|
+
const i5 = g5[1];
|
|
8
|
+
const j5 = e5.get(i5);
|
|
9
|
+
if (j5 !== undefined) {
|
|
10
|
+
h5 = h5.replace(g5[0], j5);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
return
|
|
13
|
+
return h5;
|
|
14
14
|
}
|
|
15
|
-
static formatUrl(
|
|
16
|
-
return PLVNetUtils.replaceUrl(
|
|
15
|
+
static formatUrl(b5, c5) {
|
|
16
|
+
return PLVNetUtils.replaceUrl(b5, new Map(Object.entries(c5)));
|
|
17
17
|
}
|
|
18
|
-
static formatParams(
|
|
19
|
-
let
|
|
20
|
-
if (
|
|
21
|
-
let
|
|
22
|
-
Object.entries(
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
static formatParams(v4, w4) {
|
|
19
|
+
let x4 = '';
|
|
20
|
+
if (v4) {
|
|
21
|
+
let y4 = true;
|
|
22
|
+
Object.entries(v4).forEach((z4, a5) => {
|
|
23
|
+
if (z4?.[0] && z4?.[1]) {
|
|
24
|
+
x4 += (y4 && !w4 ? '?' : '&') + z4?.[0] + '=' + z4?.[1];
|
|
25
|
+
y4 = false;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
return
|
|
29
|
+
return x4;
|
|
30
30
|
}
|
|
31
|
-
static appendParams(
|
|
32
|
-
const
|
|
33
|
-
return
|
|
31
|
+
static appendParams(s4, t4) {
|
|
32
|
+
const u4 = s4.includes('?');
|
|
33
|
+
return s4 + PLVNetUtils.formatParams(t4, u4);
|
|
34
34
|
}
|
|
35
35
|
}
|