@tntd/reference 1.0.3 → 1.0.5

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 (36) hide show
  1. package/es/AHref/index.js +60 -46
  2. package/es/AHref/index.js.map +1 -1
  3. package/es/I18N.js +19 -12
  4. package/es/ReferenceBatchCheck/index.js +162 -87
  5. package/es/ReferenceBatchCheck/index.js.map +1 -1
  6. package/es/ReferenceBatchCheck/index.less +1 -1
  7. package/es/ReferenceBatchDrawer/index.js +113 -51
  8. package/es/ReferenceBatchDrawer/index.js.map +1 -1
  9. package/es/ReferenceCheck/index.js +125 -63
  10. package/es/ReferenceCheck/index.js.map +1 -1
  11. package/es/ReferenceCheck/index.less +6 -6
  12. package/es/ReferenceDrawer/index.js +80 -39
  13. package/es/ReferenceDrawer/index.js.map +1 -1
  14. package/es/ReferenceInfo/index.js +157 -83
  15. package/es/ReferenceInfo/index.less +5 -0
  16. package/es/index.js +47 -7
  17. package/lib/AHref/index.d.ts +2 -1
  18. package/lib/AHref/index.d.ts.map +1 -1
  19. package/lib/AHref/index.js +61 -47
  20. package/lib/AHref/index.js.map +1 -1
  21. package/lib/I18N.js +21 -17
  22. package/lib/ReferenceBatchCheck/index.d.ts.map +1 -1
  23. package/lib/ReferenceBatchCheck/index.js +168 -90
  24. package/lib/ReferenceBatchCheck/index.js.map +1 -1
  25. package/lib/ReferenceBatchCheck/index.less +1 -1
  26. package/lib/ReferenceBatchDrawer/index.js +152 -76
  27. package/lib/ReferenceBatchDrawer/index.js.map +1 -1
  28. package/lib/ReferenceCheck/index.js +129 -66
  29. package/lib/ReferenceCheck/index.js.map +1 -1
  30. package/lib/ReferenceCheck/index.less +6 -6
  31. package/lib/ReferenceDrawer/index.js +119 -64
  32. package/lib/ReferenceDrawer/index.js.map +1 -1
  33. package/lib/ReferenceInfo/index.js +166 -86
  34. package/lib/ReferenceInfo/index.less +5 -0
  35. package/lib/index.js +50 -17
  36. package/package.json +1 -1
@@ -1,87 +1,161 @@
1
- import I18N from '../I18N';
2
- import React from 'react';
3
- import { Tooltip, Icon, Table, Empty, Ellipsis, Tag, Title } from "tntd";
4
- import AHref from '../AHref';
5
- import './index.less';
6
- export default (props) => {
7
- const { from, referenceData = [], orgMap = {}, appList = [], description = '', unmountHandle, imageStyle = {}, showPagination = true, jumpFun, iframeJump, type, } = props;
8
- let paginationInfo = {
9
- pagination: {
10
- hideOnSinglePage: true,
11
- size: 'small',
12
- },
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _table = _interopRequireDefault(require("tntd/es/table"));
8
+ var _icon = _interopRequireDefault(require("tntd/es/icon"));
9
+ var _title = _interopRequireDefault(require("tntd/es/title"));
10
+ var _ellipsis = _interopRequireDefault(require("tntd/es/ellipsis"));
11
+ var _tag = _interopRequireDefault(require("tntd/es/tag"));
12
+ var _tooltip = _interopRequireDefault(require("tntd/es/tooltip"));
13
+ var _empty = _interopRequireDefault(require("tntd/es/empty"));
14
+ var _I18N = _interopRequireDefault(require("../I18N"));
15
+ var _react = _interopRequireDefault(require("react"));
16
+ var _AHref = _interopRequireDefault(require("../AHref"));
17
+ require("./index.less");
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ var _default = props => {
20
+ const {
21
+ from,
22
+ referenceData = [],
23
+ orgMap = {},
24
+ appList = [],
25
+ description = '',
26
+ unmountHandle,
27
+ imageStyle = {},
28
+ showPagination = true,
29
+ jumpFun,
30
+ iframeJump,
31
+ type
32
+ } = props;
33
+ let paginationInfo = {
34
+ pagination: {
35
+ hideOnSinglePage: true,
36
+ size: 'small'
37
+ }
38
+ };
39
+ if (!showPagination) {
40
+ paginationInfo = {
41
+ pagination: false
13
42
  };
14
- if (!showPagination) {
15
- paginationInfo = {
16
- pagination: false,
43
+ }
44
+ return _react.default.createElement("div", {
45
+ className: "reference-body"
46
+ }, !(referenceData === null || referenceData === void 0 ? void 0 : referenceData.length) && _react.default.createElement(_empty.default, {
47
+ description: description || _I18N.default.referenceinfo.index.zanWuShuJu,
48
+ type: type || 'no-result',
49
+ imageStyle: Object.assign({
50
+ marginTop: 120
51
+ }, imageStyle)
52
+ }), referenceData === null || referenceData === void 0 ? void 0 : referenceData.map((d, dIndex) => {
53
+ const {
54
+ columns,
55
+ goName
56
+ } = d || {};
57
+ let renderColumns = [];
58
+ if (columns === null || columns === void 0 ? void 0 : columns.length) {
59
+ renderColumns = columns === null || columns === void 0 ? void 0 : columns.map((c, i) => {
60
+ const newC = Object.assign(Object.assign({}, c), {
61
+ title: _react.default.createElement(_tooltip.default, {
62
+ title: c === null || c === void 0 ? void 0 : c.title,
63
+ placement: "topLeft"
64
+ }, c === null || c === void 0 ? void 0 : c.title),
65
+ width: referenceData.length > 4 ? '160px' : (1 / referenceData.length).toFixed(2) + "%",
66
+ ellipsis: true
67
+ });
68
+ if (from === 'ReferenceOnlineCheck' && c.dataIndex === 'status') {
69
+ newC.className = 'refer-warning-txt';
70
+ }
71
+ newC.render = (t, record) => {
72
+ var _a, _b;
73
+ let content = t;
74
+ if (c.dataIndex === 'org') {
75
+ content = ((_a = orgMap[t]) === null || _a === void 0 ? void 0 : _a.name) || t;
76
+ }
77
+ if (c.dataIndex === 'app') {
78
+ content = ((_b = appList.find(a => a.key === t)) === null || _b === void 0 ? void 0 : _b.name) || t;
79
+ }
80
+ // 强弱引用
81
+ let tagInfo = null;
82
+ if (i === 0 && (record === null || record === void 0 ? void 0 : record.referenceCheckType)) {
83
+ let checkObj;
84
+ // 能进行下一步操作
85
+ const isStrong = ['STRONG'].includes(record === null || record === void 0 ? void 0 : record.referenceCheckType);
86
+ if (isStrong) {
87
+ checkObj = {
88
+ name: (record === null || record === void 0 ? void 0 : record.referenceCheckTypeName) || _I18N.default.referenceinfo.index.qiangYinYong,
89
+ color: 'red'
90
+ };
91
+ } else {
92
+ checkObj = {
93
+ name: (record === null || record === void 0 ? void 0 : record.referenceCheckTypeName) || _I18N.default.referenceinfo.index.ruoYinYong,
94
+ color: 'grey'
95
+ };
96
+ }
97
+ tagInfo = checkObj ? _react.default.createElement(_tag.default, {
98
+ size: "small",
99
+ color: checkObj.color
100
+ }, checkObj.name) : null;
101
+ }
102
+ if (c.dataIndex === goName && (record === null || record === void 0 ? void 0 : record.goLink)) {
103
+ return _react.default.createElement(_AHref.default, {
104
+ jumpFun: jumpFun,
105
+ iframeJump: iframeJump,
106
+ href: record === null || record === void 0 ? void 0 : record.goLink,
107
+ target: "_blank",
108
+ unmountHandle: unmountHandle
109
+ }, _react.default.createElement(_tooltip.default, {
110
+ placement: "topLeft",
111
+ title: content || '- -'
112
+ }, _react.default.createElement("span", {
113
+ className: "content-span"
114
+ }, tagInfo, content || '- -')));
115
+ }
116
+ if (c.dataIndex === goName) {
117
+ return _react.default.createElement(_ellipsis.default, {
118
+ placement: "topLeft",
119
+ copyable: true,
120
+ title: content || '- -',
121
+ prefix: tagInfo
122
+ });
123
+ }
124
+ return _react.default.createElement(_tooltip.default, {
125
+ placement: "topLeft",
126
+ title: content || '- -'
127
+ }, _react.default.createElement("span", {
128
+ className: "content-span"
129
+ }, tagInfo, content || '- -'));
17
130
  };
131
+ return newC;
132
+ });
18
133
  }
19
- return (React.createElement("div", { className: "reference-body" },
20
- !(referenceData === null || referenceData === void 0 ? void 0 : referenceData.length) && (React.createElement(Empty, { description: description || I18N.referenceinfo.index.zanWuShuJu, type: type || 'no-result', imageStyle: Object.assign({ marginTop: 120 }, imageStyle) })), referenceData === null || referenceData === void 0 ? void 0 :
21
- referenceData.map((d, dIndex) => {
22
- const { columns, goName } = d || {};
23
- let renderColumns = [];
24
- if (columns === null || columns === void 0 ? void 0 : columns.length) {
25
- renderColumns = columns === null || columns === void 0 ? void 0 : columns.map((c, i) => {
26
- const newC = Object.assign(Object.assign({}, c), { title: (React.createElement(Tooltip, { title: c === null || c === void 0 ? void 0 : c.title, placement: "topLeft" }, c === null || c === void 0 ? void 0 : c.title)), width: referenceData.length > 4 ? '160px' : (1 / referenceData.length).toFixed(2) + "%", ellipsis: true });
27
- if (from === 'ReferenceOnlineCheck' && c.dataIndex === 'status') {
28
- newC.className = 'refer-warning-txt';
29
- }
30
- newC.render = (t, record) => {
31
- var _a, _b;
32
- let content = t;
33
- if (c.dataIndex === 'org') {
34
- content = ((_a = orgMap[t]) === null || _a === void 0 ? void 0 : _a.name) || t;
35
- }
36
- if (c.dataIndex === 'app') {
37
- content = ((_b = appList.find((a) => a.key === t)) === null || _b === void 0 ? void 0 : _b.name) || t;
38
- }
39
- // 强弱引用
40
- let tagInfo = null;
41
- if (i === 0 && (record === null || record === void 0 ? void 0 : record.referenceCheckType)) {
42
- let checkObj;
43
- // 能进行下一步操作
44
- const isStrong = ['STRONG'].includes(record === null || record === void 0 ? void 0 : record.referenceCheckType);
45
- if (isStrong) {
46
- checkObj = {
47
- name: (record === null || record === void 0 ? void 0 : record.referenceCheckTypeName) || I18N.referenceinfo.index.qiangYinYong,
48
- color: 'red',
49
- };
50
- }
51
- else {
52
- checkObj = {
53
- name: (record === null || record === void 0 ? void 0 : record.referenceCheckTypeName) || I18N.referenceinfo.index.ruoYinYong,
54
- color: 'grey',
55
- };
56
- }
57
- tagInfo = checkObj ? (React.createElement(Tag, { size: "small", color: checkObj.color }, checkObj.name)) : null;
58
- }
59
- if (c.dataIndex === goName && (record === null || record === void 0 ? void 0 : record.goLink)) {
60
- return (React.createElement(AHref, { jumpFun: jumpFun, iframeJump: iframeJump, href: record === null || record === void 0 ? void 0 : record.goLink, target: "_blank", unmountHandle: unmountHandle },
61
- React.createElement(Tooltip, { placement: "topLeft", title: content || '- -' },
62
- React.createElement("span", { className: "content-span" },
63
- tagInfo,
64
- content || '- -'))));
65
- }
66
- if (c.dataIndex === goName) {
67
- return (React.createElement(Ellipsis, { placement: "topLeft", copyable: true, title: content || '- -', prefix: tagInfo }));
68
- }
69
- return (React.createElement(Tooltip, { placement: "topLeft", title: content || '- -' },
70
- React.createElement("span", { className: "content-span" },
71
- tagInfo,
72
- content || '- -')));
73
- };
74
- return newC;
75
- });
76
- }
77
- return (React.createElement("div", { className: "reference-body-item", key: dIndex },
78
- React.createElement(Title, { className: "reference-body-title", title: d === null || d === void 0 ? void 0 : d.title, tooltip: d === null || d === void 0 ? void 0 : d.title, subTitle: (d === null || d === void 0 ? void 0 : d.tips) && (React.createElement(Tooltip, { title: d === null || d === void 0 ? void 0 : d.tips, placement: "topLeft" },
79
- React.createElement(Icon, { type: "info-circle" }))) }),
80
- (renderColumns === null || renderColumns === void 0 ? void 0 : renderColumns.length) && (React.createElement(Table, Object.assign({ bordered: true, className: "reference-table", striped: true, dataSource: d === null || d === void 0 ? void 0 : d.rows, columns: renderColumns, scroll: renderColumns.length > 4
81
- ? {
82
- x: renderColumns.length * 160,
83
- }
84
- : {} }, paginationInfo, { rowKey: (e, i) => `${dIndex}_${i}` })))));
85
- })));
134
+ return _react.default.createElement("div", {
135
+ className: "reference-body-item",
136
+ key: dIndex
137
+ }, _react.default.createElement(_title.default, {
138
+ className: "reference-body-title",
139
+ title: d === null || d === void 0 ? void 0 : d.title,
140
+ tooltip: d === null || d === void 0 ? void 0 : d.title,
141
+ subTitle: (d === null || d === void 0 ? void 0 : d.tips) && _react.default.createElement(_tooltip.default, {
142
+ title: d === null || d === void 0 ? void 0 : d.tips,
143
+ placement: "topLeft"
144
+ }, _react.default.createElement(_icon.default, {
145
+ type: "info-circle"
146
+ }))
147
+ }), (renderColumns === null || renderColumns === void 0 ? void 0 : renderColumns.length) && _react.default.createElement(_table.default, Object.assign({
148
+ bordered: true,
149
+ className: "reference-table",
150
+ striped: true,
151
+ dataSource: d === null || d === void 0 ? void 0 : d.rows,
152
+ columns: renderColumns,
153
+ scroll: renderColumns.length > 4 ? {
154
+ x: renderColumns.length * 160
155
+ } : {}
156
+ }, paginationInfo, {
157
+ rowKey: (e, i) => `${dIndex}_${i}`
158
+ })));
159
+ }));
86
160
  };
87
- //# sourceMappingURL=index.js.map
161
+ exports.default = _default;
@@ -10,6 +10,11 @@
10
10
  margin-bottom: 16px;
11
11
  }
12
12
  }
13
+
14
+ .ant-table-scroll .ant-table-body{
15
+ overflow-x: auto !important;
16
+ }
17
+
13
18
  .ant-table-tbody > tr > td {
14
19
  &.refer-warning-txt {
15
20
  * {
package/es/index.js CHANGED
@@ -1,7 +1,47 @@
1
- import ReferenceDrawer from './ReferenceDrawer';
2
- import ReferenceCheck from './ReferenceCheck';
3
- import ReferenceBatchCheck from './ReferenceBatchCheck';
4
- import ReferenceInfo from './ReferenceInfo';
5
- import ReferenceBatchDrawer from './ReferenceBatchDrawer';
6
- export { ReferenceDrawer, ReferenceBatchDrawer, ReferenceCheck, ReferenceInfo, ReferenceBatchCheck, ReferenceBatchCheck as ReferenceOnlineCheck };
7
- //# sourceMappingURL=index.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ReferenceBatchCheck", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _ReferenceBatchCheck.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "ReferenceBatchDrawer", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _ReferenceBatchDrawer.default;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "ReferenceCheck", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _ReferenceCheck.default;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "ReferenceDrawer", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _ReferenceDrawer.default;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "ReferenceInfo", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _ReferenceInfo.default;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "ReferenceOnlineCheck", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _ReferenceBatchCheck.default;
40
+ }
41
+ });
42
+ var _ReferenceDrawer = _interopRequireDefault(require("./ReferenceDrawer"));
43
+ var _ReferenceCheck = _interopRequireDefault(require("./ReferenceCheck"));
44
+ var _ReferenceBatchCheck = _interopRequireDefault(require("./ReferenceBatchCheck"));
45
+ var _ReferenceInfo = _interopRequireDefault(require("./ReferenceInfo"));
46
+ var _ReferenceBatchDrawer = _interopRequireDefault(require("./ReferenceBatchDrawer"));
47
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -1,3 +1,4 @@
1
- declare function _default(props: any): import("react").JSX.Element;
1
+ declare function _default(props: any): React.JSX.Element;
2
2
  export default _default;
3
+ import React from "react";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AHref/index.js"],"names":[],"mappings":"AAAe,mEA2Cd"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AHref/index.js"],"names":[],"mappings":"AACe,yDA2Cd"}
@@ -1,50 +1,64 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ function _interopRequireDefault(e) {
9
+ return e && e.__esModule ? e : {
10
+ "default": e
11
+ };
12
+ }
13
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
18
+ }
19
+ return t;
12
20
  };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.default = (props) => {
15
- const { children, href, unmountHandle, jumpFun, iframeJump } = props, rest = __rest(props, ["children", "href", "unmountHandle", "jumpFun", "iframeJump"]);
16
- if (window.__isMultiTab__) {
17
- return (React.createElement("a", { onClick: (evt) => {
18
- evt.preventDefault();
19
- if (unmountHandle && typeof unmountHandle === 'function') {
20
- unmountHandle();
21
- }
22
- let pathName = href;
23
- if (href && href.includes('?')) {
24
- pathName = href === null || href === void 0 ? void 0 : href.split('?')[0];
25
- }
26
- if (jumpFun && typeof jumpFun === 'function') {
27
- jumpFun(href);
28
- return;
29
- }
30
- const isInIframe = (window === null || window === void 0 ? void 0 : window.self) !== (window === null || window === void 0 ? void 0 : window.top);
31
- if (iframeJump && isInIframe) {
32
- if (pathName === window.location.pathname) {
33
- window.parent.location.href = href;
34
- }
35
- else {
36
- window.parent.open(href);
37
- }
38
- return;
39
- }
40
- if (pathName === window.location.pathname) {
41
- window.location.href = href;
42
- }
43
- else {
44
- window.push(href);
45
- }
46
- } }, children));
47
- }
48
- return (React.createElement("a", Object.assign({ href: href }, rest), children));
21
+ var _default = function _default(props) {
22
+ var children = props.children,
23
+ href = props.href,
24
+ unmountHandle = props.unmountHandle,
25
+ jumpFun = props.jumpFun,
26
+ iframeJump = props.iframeJump,
27
+ rest = __rest(props, ["children", "href", "unmountHandle", "jumpFun", "iframeJump"]);
28
+ if (window.__isMultiTab__) {
29
+ return _react["default"].createElement("a", {
30
+ onClick: function onClick(evt) {
31
+ evt.preventDefault();
32
+ if (unmountHandle && typeof unmountHandle === 'function') {
33
+ unmountHandle();
34
+ }
35
+ var pathName = href;
36
+ if (href && href.includes('?')) {
37
+ pathName = href === null || href === void 0 ? void 0 : href.split('?')[0];
38
+ }
39
+ if (jumpFun && typeof jumpFun === 'function') {
40
+ jumpFun(href);
41
+ return;
42
+ }
43
+ var isInIframe = (window === null || window === void 0 ? void 0 : window.self) !== (window === null || window === void 0 ? void 0 : window.top);
44
+ if (iframeJump && isInIframe) {
45
+ if (pathName === window.location.pathname) {
46
+ window.parent.location.href = href;
47
+ } else {
48
+ window.parent.open(href);
49
+ }
50
+ return;
51
+ }
52
+ if (pathName === window.location.pathname) {
53
+ window.location.href = href;
54
+ } else {
55
+ window.push(href);
56
+ }
57
+ }
58
+ }, children);
59
+ }
60
+ return _react["default"].createElement("a", Object.assign({
61
+ href: href
62
+ }, rest), children);
49
63
  };
50
- //# sourceMappingURL=index.js.map
64
+ exports["default"] = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AHref/index.js"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kBAAe,CAAC,KAAK,EAAE,EAAE;IACvB,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,KAAa,KAAK,EAAd,IAAI,UAAK,KAAK,EAAtE,8DAA8D,CAAQ,CAAC;IAC7E,IAAI,MAAM,CAAC,cAAc,EAAE;QACzB,OAAO,CACL,2BACE,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACb,GAAG,CAAC,cAAc,EAAE,CAAC;gBACrB,IAAI,aAAa,IAAI,OAAO,aAAa,KAAK,UAAU,EAAE;oBACtD,aAAa,EAAE,CAAC;iBACnB;gBACD,IAAI,QAAQ,GAAG,IAAI,CAAC;gBACpB,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBAC5B,QAAQ,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;iBAClC;gBACD,IAAG,OAAO,IAAI,OAAO,OAAO,KAAG,UAAU,EAAC;oBACtC,OAAO,CAAC,IAAI,CAAC,CAAC;oBACd,OAAM;iBACT;gBACD,MAAM,UAAU,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,OAAK,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,CAAC;gBAChD,IAAG,UAAU,IAAI,UAAU,EAAC;oBACxB,IAAI,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE;wBACvC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;qBACtC;yBAAM;wBACH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;qBAC5B;oBACD,OAAM;iBACT;gBACD,IAAI,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE;oBACvC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;iBAC/B;qBAAM;oBACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACrB;YACL,CAAC,IAEA,QAAQ,CACP,CACL,CAAC;KACH;IACD,OAAO,CACL,yCAAG,IAAI,EAAE,IAAI,IAAM,IAAI,GACpB,QAAQ,CACP,CACL,CAAC;AACJ,CAAC,CAAC","sourcesContent":["export default (props) => {\n const { children, href, unmountHandle, jumpFun, iframeJump,...rest } = props;\n if (window.__isMultiTab__) {\n return (\n <a\n onClick={(evt) => {\n evt.preventDefault();\n if (unmountHandle && typeof unmountHandle === 'function') {\n unmountHandle();\n }\n let pathName = href;\n if (href && href.includes('?')) {\n pathName = href?.split('?')[0];\n }\n if(jumpFun && typeof jumpFun==='function'){\n jumpFun(href);\n return\n }\n const isInIframe = window?.self !== window?.top;\n if(iframeJump && isInIframe){\n if (pathName === window.location.pathname) {\n window.parent.location.href = href;\n } else {\n window.parent.open(href);\n }\n return\n }\n if (pathName === window.location.pathname) {\n window.location.href = href;\n } else {\n window.push(href);\n }\n }}\n >\n {children}\n </a>\n );\n }\n return (\n <a href={href} {...rest}>\n {children}\n </a>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AHref/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,kBAAe,CAAC,KAAK,EAAE,EAAE;IACvB,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,KAAa,KAAK,EAAd,IAAI,UAAK,KAAK,EAAtE,8DAA8D,CAAQ,CAAC;IAC7E,IAAI,MAAM,CAAC,cAAc,EAAE;QACzB,OAAO,CACL,qCACE,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACb,GAAG,CAAC,cAAc,EAAE,CAAC;gBACrB,IAAI,aAAa,IAAI,OAAO,aAAa,KAAK,UAAU,EAAE;oBACtD,aAAa,EAAE,CAAC;iBACnB;gBACD,IAAI,QAAQ,GAAG,IAAI,CAAC;gBACpB,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBAC5B,QAAQ,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;iBAClC;gBACD,IAAG,OAAO,IAAI,OAAO,OAAO,KAAG,UAAU,EAAC;oBACtC,OAAO,CAAC,IAAI,CAAC,CAAC;oBACd,OAAM;iBACT;gBACD,MAAM,UAAU,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,OAAK,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,CAAC;gBAChD,IAAG,UAAU,IAAI,UAAU,EAAC;oBACxB,IAAI,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE;wBACvC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;qBACtC;yBAAM;wBACH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;qBAC5B;oBACD,OAAM;iBACT;gBACD,IAAI,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE;oBACvC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;iBAC/B;qBAAM;oBACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACrB;YACL,CAAC,IAEA,QAAQ,CACP,CACL,CAAC;KACH;IACD,OAAO,CACL,mDAAG,IAAI,EAAE,IAAI,IAAM,IAAI,GACpB,QAAQ,CACP,CACL,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nexport default (props) => {\n const { children, href, unmountHandle, jumpFun, iframeJump,...rest } = props;\n if (window.__isMultiTab__) {\n return (\n <a\n onClick={(evt) => {\n evt.preventDefault();\n if (unmountHandle && typeof unmountHandle === 'function') {\n unmountHandle();\n }\n let pathName = href;\n if (href && href.includes('?')) {\n pathName = href?.split('?')[0];\n }\n if(jumpFun && typeof jumpFun==='function'){\n jumpFun(href);\n return\n }\n const isInIframe = window?.self !== window?.top;\n if(iframeJump && isInIframe){\n if (pathName === window.location.pathname) {\n window.parent.location.href = href;\n } else {\n window.parent.open(href);\n }\n return\n }\n if (pathName === window.location.pathname) {\n window.location.href = href;\n } else {\n window.push(href);\n }\n }}\n >\n {children}\n </a>\n );\n }\n return (\n <a href={href} {...rest}>\n {children}\n </a>\n );\n};\n"]}
package/lib/I18N.js CHANGED
@@ -1,21 +1,25 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getLang = void 0;
7
- const otp_intl_1 = __importDefault(require("otp-intl"));
8
- const universal_cookie_1 = __importDefault(require("universal-cookie"));
9
- const zh_CN_1 = __importDefault(require("../.octopus/zh-CN"));
10
- const en_US_1 = __importDefault(require("../.octopus/en-US"));
11
- const cookies = new universal_cookie_1.default();
12
- const getLang = () => {
13
- return cookies.get('lang') || 'cn';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getLang = exports["default"] = void 0;
7
+ var _otpIntl = _interopRequireDefault(require("otp-intl"));
8
+ var _universalCookie = _interopRequireDefault(require("universal-cookie"));
9
+ var _zhCN = _interopRequireDefault(require("../.octopus/zh-CN"));
10
+ var _enUS = _interopRequireDefault(require("../.octopus/en-US"));
11
+ function _interopRequireDefault(e) {
12
+ return e && e.__esModule ? e : {
13
+ "default": e
14
+ };
15
+ }
16
+ var cookies = new _universalCookie["default"]();
17
+ var getLang = function getLang() {
18
+ return cookies.get('lang') || 'cn';
14
19
  };
15
20
  exports.getLang = getLang;
16
- const kiwiIntl = otp_intl_1.default.init((0, exports.getLang)(), {
17
- cn: zh_CN_1.default,
18
- en: en_US_1.default
21
+ var kiwiIntl = _otpIntl["default"].init(getLang(), {
22
+ cn: _zhCN["default"],
23
+ en: _enUS["default"]
19
24
  });
20
- exports.default = kiwiIntl;
21
- //# sourceMappingURL=I18N.js.map
25
+ var _default = exports["default"] = kiwiIntl;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ReferenceBatchCheck/index.js"],"names":[],"mappings":"AAQe,gEAgKd"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ReferenceBatchCheck/index.js"],"names":[],"mappings":"AASe,gEAgKd"}