@fle-ui/plus-address-selection 1.0.11 → 1.0.13
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/README.md +17 -17
- package/es/index.d.ts +5 -0
- package/es/index.js +5 -3
- package/es/utils/api.d.ts +1 -1
- package/es/utils/api.js +2 -2
- package/lib/index.d.ts +5 -0
- package/lib/index.js +5 -3
- package/lib/utils/api.d.ts +1 -1
- package/lib/utils/api.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# @fle-ui/plus-address-selection
|
|
2
|
-
|
|
3
|
-
> @fle-ui/plus-address-selection
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
Using npm:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
$ npm install --save @fle-ui/plus-address-selection
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
or using yarn:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
$ yarn add @fle-ui/plus-address-selection
|
|
17
|
-
```
|
|
1
|
+
# @fle-ui/plus-address-selection
|
|
2
|
+
|
|
3
|
+
> @fle-ui/plus-address-selection
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Using npm:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
$ npm install --save @fle-ui/plus-address-selection
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
or using yarn:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
$ yarn add @fle-ui/plus-address-selection
|
|
17
|
+
```
|
package/es/index.d.ts
CHANGED
|
@@ -29,6 +29,11 @@ export interface SiteSelectProps extends Omit<CascaderProps<any>, 'options' | 'v
|
|
|
29
29
|
* @default
|
|
30
30
|
*/
|
|
31
31
|
valueDivision?: string;
|
|
32
|
+
/**
|
|
33
|
+
* @description 接口地址 全地址哦
|
|
34
|
+
* @default
|
|
35
|
+
*/
|
|
36
|
+
apiUrl?: string;
|
|
32
37
|
/**
|
|
33
38
|
* @description 地址层级 默认四级 --
|
|
34
39
|
* @default 4
|
package/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
import "antd/es/cascader/style";
|
|
3
3
|
import _Cascader from "antd/es/cascader";
|
|
4
|
-
var _excluded = ["env", "level", "value", "onChange", "valueDivision"];
|
|
4
|
+
var _excluded = ["env", "level", "value", "onChange", "valueDivision", "apiUrl"];
|
|
5
5
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
6
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
7
7
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -22,7 +22,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
22
22
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
23
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
24
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var
|
|
25
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
|
26
26
|
import React, { useEffect, useState } from 'react';
|
|
27
27
|
import _ from 'lodash';
|
|
28
28
|
import { apiCreate } from './utils/api';
|
|
@@ -30,6 +30,7 @@ var defaultProps = {
|
|
|
30
30
|
level: 4,
|
|
31
31
|
valueDivision: '',
|
|
32
32
|
value: [],
|
|
33
|
+
apiUrl: '/basic/area/areas',
|
|
33
34
|
onChange: function onChange() {}
|
|
34
35
|
};
|
|
35
36
|
var AddressSelection = function AddressSelection(props) {
|
|
@@ -39,8 +40,9 @@ var AddressSelection = function AddressSelection(props) {
|
|
|
39
40
|
value = _defaultProps$props.value,
|
|
40
41
|
onChange = _defaultProps$props.onChange,
|
|
41
42
|
valueDivision = _defaultProps$props.valueDivision,
|
|
43
|
+
apiUrl = _defaultProps$props.apiUrl,
|
|
42
44
|
otherProps = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
43
|
-
var _apiCreate = apiCreate(env),
|
|
45
|
+
var _apiCreate = apiCreate(apiUrl, env),
|
|
44
46
|
getAddress = _apiCreate.getAddress;
|
|
45
47
|
var _useState = useState([]),
|
|
46
48
|
_useState2 = _slicedToArray(_useState, 2),
|
package/es/utils/api.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare const baseURLMap: {
|
|
|
4
4
|
prod: string;
|
|
5
5
|
};
|
|
6
6
|
export type Env = keyof typeof baseURLMap;
|
|
7
|
-
export declare const apiCreate: (env?: Env) => {
|
|
7
|
+
export declare const apiCreate: (apiUrl: string, env?: Env) => {
|
|
8
8
|
getAddress(data: any): Promise<any>;
|
|
9
9
|
};
|
|
10
10
|
export {};
|
package/es/utils/api.js
CHANGED
|
@@ -4,13 +4,13 @@ var baseURLMap = {
|
|
|
4
4
|
qa: 'https://qa-gateway.fxqifu.net/pangu',
|
|
5
5
|
prod: 'https://gateway.fxqifu.net/pangu'
|
|
6
6
|
};
|
|
7
|
-
export var apiCreate = function apiCreate(env) {
|
|
7
|
+
export var apiCreate = function apiCreate(apiUrl, env) {
|
|
8
8
|
var envGet = env || localStorage.getItem('env') || 'prod';
|
|
9
9
|
var baseURL = baseURLMap[envGet];
|
|
10
10
|
return {
|
|
11
11
|
getAddress: function getAddress(data) {
|
|
12
12
|
return new Promise(function (resolve, reject) {
|
|
13
|
-
axios.post("".concat(baseURL
|
|
13
|
+
axios.post("".concat(baseURL).concat(apiUrl), data).then(function (res) {
|
|
14
14
|
var _res$data;
|
|
15
15
|
if (Array.isArray((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.data)) {
|
|
16
16
|
resolve(res.data.data);
|
package/lib/index.d.ts
CHANGED
|
@@ -29,6 +29,11 @@ export interface SiteSelectProps extends Omit<CascaderProps<any>, 'options' | 'v
|
|
|
29
29
|
* @default
|
|
30
30
|
*/
|
|
31
31
|
valueDivision?: string;
|
|
32
|
+
/**
|
|
33
|
+
* @description 接口地址 全地址哦
|
|
34
|
+
* @default
|
|
35
|
+
*/
|
|
36
|
+
apiUrl?: string;
|
|
32
37
|
/**
|
|
33
38
|
* @description 地址层级 默认四级 --
|
|
34
39
|
* @default 4
|
package/lib/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _antd = require("antd");
|
|
10
10
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
11
11
|
var _api = require("./utils/api");
|
|
12
|
-
var _excluded = ["env", "level", "value", "onChange", "valueDivision"];
|
|
12
|
+
var _excluded = ["env", "level", "value", "onChange", "valueDivision", "apiUrl"];
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -33,11 +33,12 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
33
33
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
34
34
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
35
35
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
36
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var
|
|
36
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
|
37
37
|
var defaultProps = {
|
|
38
38
|
level: 4,
|
|
39
39
|
valueDivision: '',
|
|
40
40
|
value: [],
|
|
41
|
+
apiUrl: '/basic/area/areas',
|
|
41
42
|
onChange: function onChange() {}
|
|
42
43
|
};
|
|
43
44
|
var AddressSelection = function AddressSelection(props) {
|
|
@@ -47,8 +48,9 @@ var AddressSelection = function AddressSelection(props) {
|
|
|
47
48
|
value = _defaultProps$props.value,
|
|
48
49
|
onChange = _defaultProps$props.onChange,
|
|
49
50
|
valueDivision = _defaultProps$props.valueDivision,
|
|
51
|
+
apiUrl = _defaultProps$props.apiUrl,
|
|
50
52
|
otherProps = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
51
|
-
var _apiCreate = (0, _api.apiCreate)(env),
|
|
53
|
+
var _apiCreate = (0, _api.apiCreate)(apiUrl, env),
|
|
52
54
|
getAddress = _apiCreate.getAddress;
|
|
53
55
|
var _useState = (0, _react.useState)([]),
|
|
54
56
|
_useState2 = _slicedToArray(_useState, 2),
|
package/lib/utils/api.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare const baseURLMap: {
|
|
|
4
4
|
prod: string;
|
|
5
5
|
};
|
|
6
6
|
export type Env = keyof typeof baseURLMap;
|
|
7
|
-
export declare const apiCreate: (env?: Env) => {
|
|
7
|
+
export declare const apiCreate: (apiUrl: string, env?: Env) => {
|
|
8
8
|
getAddress(data: any): Promise<any>;
|
|
9
9
|
};
|
|
10
10
|
export {};
|
package/lib/utils/api.js
CHANGED
|
@@ -11,13 +11,13 @@ var baseURLMap = {
|
|
|
11
11
|
qa: 'https://qa-gateway.fxqifu.net/pangu',
|
|
12
12
|
prod: 'https://gateway.fxqifu.net/pangu'
|
|
13
13
|
};
|
|
14
|
-
var apiCreate = exports.apiCreate = function apiCreate(env) {
|
|
14
|
+
var apiCreate = exports.apiCreate = function apiCreate(apiUrl, env) {
|
|
15
15
|
var envGet = env || localStorage.getItem('env') || 'prod';
|
|
16
16
|
var baseURL = baseURLMap[envGet];
|
|
17
17
|
return {
|
|
18
18
|
getAddress: function getAddress(data) {
|
|
19
19
|
return new Promise(function (resolve, reject) {
|
|
20
|
-
_axios.default.post("".concat(baseURL
|
|
20
|
+
_axios.default.post("".concat(baseURL).concat(apiUrl), data).then(function (res) {
|
|
21
21
|
var _res$data;
|
|
22
22
|
if (Array.isArray((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.data)) {
|
|
23
23
|
resolve(res.data.data);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fle-ui/plus-address-selection",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "@fle-ui/plus-address-selection",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/js-cookie": "^3.0.0"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "efedcaf9e8359b7bc34f9687d38c66c14c5516af"
|
|
45
45
|
}
|