@fle-ui/plus-choose-site-goods 1.0.2 → 1.0.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.
- package/es/index.d.ts +2 -1
- package/es/utils/common.d.ts +3 -1
- package/es/utils/common.js +16 -11
- package/es/utils/serviceEnv.d.ts +4 -6
- package/lib/index.d.ts +2 -1
- package/lib/utils/common.d.ts +3 -1
- package/lib/utils/common.js +16 -11
- package/lib/utils/serviceEnv.d.ts +4 -6
- package/package.json +4 -3
package/es/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { EnvType } from './utils/serviceEnv';
|
|
2
3
|
import type { ModalProps } from 'antd';
|
|
3
4
|
import './index.less';
|
|
4
5
|
export interface ChooseSiteGoodsProps extends ModalProps {
|
|
5
|
-
env?:
|
|
6
|
+
env?: EnvType;
|
|
6
7
|
token?: string;
|
|
7
8
|
loginErrFn?: any;
|
|
8
9
|
onClose?: any;
|
package/es/utils/common.d.ts
CHANGED
package/es/utils/common.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
1
4
|
import moment from 'moment';
|
|
2
5
|
export var showMoney = function showMoney(data) {
|
|
3
6
|
return (+data / 100).toFixed(2);
|
|
@@ -10,17 +13,19 @@ export var showTime = function showTime(data) {
|
|
|
10
13
|
* 格式化url参数
|
|
11
14
|
*/
|
|
12
15
|
export var parseQueryString = function parseQueryString() {
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
while ((result = regPara.exec(strPara)) != null) {
|
|
22
|
-
ret[result[1]] = result[2];
|
|
16
|
+
var urlParams = new URLSearchParams(window.location.search);
|
|
17
|
+
var params = {};
|
|
18
|
+
var _iterator = _createForOfIteratorHelper(urlParams),
|
|
19
|
+
_step;
|
|
20
|
+
try {
|
|
21
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
22
|
+
var param = _step.value;
|
|
23
|
+
params[param[0]] = param[1];
|
|
23
24
|
}
|
|
25
|
+
} catch (err) {
|
|
26
|
+
_iterator.e(err);
|
|
27
|
+
} finally {
|
|
28
|
+
_iterator.f();
|
|
24
29
|
}
|
|
25
|
-
return
|
|
30
|
+
return params;
|
|
26
31
|
};
|
package/es/utils/serviceEnv.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
export type EnvType = 'dev' | 'test' | 'qa' | 'prod';
|
|
1
2
|
export declare const baseURLMap: {
|
|
2
|
-
|
|
3
|
-
test: string;
|
|
4
|
-
qa: string;
|
|
5
|
-
prod: string;
|
|
3
|
+
[key in EnvType]: string;
|
|
6
4
|
};
|
|
7
|
-
export declare const getApiHost: (env:
|
|
8
|
-
export declare const getApiUrl: (env:
|
|
5
|
+
export declare const getApiHost: (env: EnvType) => string;
|
|
6
|
+
export declare const getApiUrl: (env: EnvType, url: string) => string;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { EnvType } from './utils/serviceEnv';
|
|
2
3
|
import type { ModalProps } from 'antd';
|
|
3
4
|
import './index.less';
|
|
4
5
|
export interface ChooseSiteGoodsProps extends ModalProps {
|
|
5
|
-
env?:
|
|
6
|
+
env?: EnvType;
|
|
6
7
|
token?: string;
|
|
7
8
|
loginErrFn?: any;
|
|
8
9
|
onClose?: any;
|
package/lib/utils/common.d.ts
CHANGED
package/lib/utils/common.js
CHANGED
|
@@ -6,6 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.showTime = exports.showMoney = exports.parseQueryString = void 0;
|
|
7
7
|
var _moment = _interopRequireDefault(require("moment"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
12
|
var showMoney = function showMoney(data) {
|
|
10
13
|
return (+data / 100).toFixed(2);
|
|
11
14
|
};
|
|
@@ -19,18 +22,20 @@ var showTime = function showTime(data) {
|
|
|
19
22
|
*/
|
|
20
23
|
exports.showTime = showTime;
|
|
21
24
|
var parseQueryString = function parseQueryString() {
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
while ((result = regPara.exec(strPara)) != null) {
|
|
31
|
-
ret[result[1]] = result[2];
|
|
25
|
+
var urlParams = new URLSearchParams(window.location.search);
|
|
26
|
+
var params = {};
|
|
27
|
+
var _iterator = _createForOfIteratorHelper(urlParams),
|
|
28
|
+
_step;
|
|
29
|
+
try {
|
|
30
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
31
|
+
var param = _step.value;
|
|
32
|
+
params[param[0]] = param[1];
|
|
32
33
|
}
|
|
34
|
+
} catch (err) {
|
|
35
|
+
_iterator.e(err);
|
|
36
|
+
} finally {
|
|
37
|
+
_iterator.f();
|
|
33
38
|
}
|
|
34
|
-
return
|
|
39
|
+
return params;
|
|
35
40
|
};
|
|
36
41
|
exports.parseQueryString = parseQueryString;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
export type EnvType = 'dev' | 'test' | 'qa' | 'prod';
|
|
1
2
|
export declare const baseURLMap: {
|
|
2
|
-
|
|
3
|
-
test: string;
|
|
4
|
-
qa: string;
|
|
5
|
-
prod: string;
|
|
3
|
+
[key in EnvType]: string;
|
|
6
4
|
};
|
|
7
|
-
export declare const getApiHost: (env:
|
|
8
|
-
export declare const getApiUrl: (env:
|
|
5
|
+
export declare const getApiHost: (env: EnvType) => string;
|
|
6
|
+
export declare const getApiUrl: (env: EnvType, url: string) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fle-ui/plus-choose-site-goods",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "@fle-ui/plus-choose-site-goods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fle-ui",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"@fle-ui/plus-choose-mall-goods": "^2.0.3"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"
|
|
33
|
+
"antd": ">=4.23.0 || >=5.0.0",
|
|
34
|
+
"react": ">=17.0.0"
|
|
34
35
|
},
|
|
35
36
|
"browserslist": [
|
|
36
37
|
"last 2 versions",
|
|
@@ -43,5 +44,5 @@
|
|
|
43
44
|
"publishConfig": {
|
|
44
45
|
"access": "public"
|
|
45
46
|
},
|
|
46
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "9fa663205bda0aac89fe4f173a006b011aea1968"
|
|
47
48
|
}
|