ztxkutils 2.8.14 → 2.8.17

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.
@@ -11,4 +11,4 @@ export declare function useDocumentTitle(title: string): void;
11
11
  export declare function setFilterAuth(): void;
12
12
  export declare function isFilterAuth(): boolean;
13
13
  export declare function setSession(name: any, value: any): void;
14
- export declare function getSession(name: any): any;
14
+ export declare function getSession(name: any): string;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { c as authority } from './authority-5bc06c1a.js';
2
2
  export { d as dataModel } from './dataModel-1fbaff40.js';
3
- export { t as tools } from './tools-4de9d743.js';
3
+ export { t as tools } from './tools-aa1fafe4.js';
4
4
  export { v as validate } from './validate-3e15dd74.js';
5
5
  export { r as request } from './request-09b081d4.js';
6
6
  export { r as reqUrl } from './reqUrl-88fcc5c5.js';
@@ -253,6 +253,22 @@ function copyContent(text) {
253
253
  textarea.select();
254
254
  document === null || document === void 0 ? void 0 : document.execCommand('copy');
255
255
  document.body.removeChild(textarea);
256
+ }
257
+ /**
258
+ * @author 陈亚雄
259
+ * @description 处理转义字符
260
+ */
261
+ function dangerouslySetXss(str) {
262
+ var _a;
263
+ try {
264
+ var arrEntities_1 = { lt: '', gt: '', nbsp: ' ', amp: '&', quot: '"' };
265
+ return (_a = str === null || str === void 0 ? void 0 : str.replace) === null || _a === void 0 ? void 0 : _a.call(str, /&(lt|gt|nbsp|amp|quot);/gi, function (all, t) {
266
+ return arrEntities_1[t];
267
+ });
268
+ }
269
+ catch (err) {
270
+ return str;
271
+ }
256
272
  }
257
273
 
258
274
  var tools = /*#__PURE__*/Object.freeze({
@@ -271,7 +287,8 @@ var tools = /*#__PURE__*/Object.freeze({
271
287
  SHOWFRAME_KEY: SHOWFRAME_KEY,
272
288
  showFrame: showFrame,
273
289
  getUrlSearch: getUrlSearch,
274
- copyContent: copyContent
290
+ copyContent: copyContent,
291
+ dangerouslySetXss: dangerouslySetXss
275
292
  });
276
293
 
277
- export { SHOWFRAME_KEY as S, timeTransfrom as a, toThousand as b, clearAssignStr as c, divide as d, exactRound as e, transformFileSize as f, getUrlSearch as g, copyContent as h, isEqualByKey as i, loadFileRename as l, showFrame as s, tools as t };
294
+ export { SHOWFRAME_KEY as S, timeTransfrom as a, toThousand as b, clearAssignStr as c, divide as d, exactRound as e, transformFileSize as f, getUrlSearch as g, copyContent as h, isEqualByKey as i, dangerouslySetXss as j, loadFileRename as l, showFrame as s, tools as t };
package/dist/tools.d.ts CHANGED
@@ -64,3 +64,8 @@ export declare function getUrlSearch(): {};
64
64
  * @description 复制
65
65
  */
66
66
  export declare function copyContent(text: string): void;
67
+ /**
68
+ * @author 陈亚雄
69
+ * @description 处理转义字符
70
+ */
71
+ export declare function dangerouslySetXss(str?: string): string;
package/dist/tools.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import './tslib.es6-f9459658.js';
2
2
  import 'dayjs';
3
3
  export { minus, plus, times } from 'number-precision';
4
- export { S as SHOWFRAME_KEY, c as clearAssignStr, h as copyContent, d as divide, e as exactRound, g as getUrlSearch, i as isEqualByKey, l as loadFileRename, s as showFrame, a as timeTransfrom, b as toThousand, f as transformFileSize } from './tools-4de9d743.js';
4
+ export { S as SHOWFRAME_KEY, c as clearAssignStr, h as copyContent, j as dangerouslySetXss, d as divide, e as exactRound, g as getUrlSearch, i as isEqualByKey, l as loadFileRename, s as showFrame, a as timeTransfrom, b as toThousand, f as transformFileSize } from './tools-aa1fafe4.js';
@@ -113,7 +113,15 @@ function setSession(name, value) {
113
113
  }
114
114
  function getSession(name) {
115
115
  if (window.opener && Object.getOwnPropertyNames(window.opener).length > 0) {
116
- return window.opener.sessionStorage.getItem(name);
116
+ var v = ROUTER_FILTER_RULES_VALUE;
117
+ try {
118
+ v = window.opener.sessionStorage.getItem(name);
119
+ }
120
+ catch (err) {
121
+ console.log(err, '=========');
122
+ v = ROUTER_FILTER_RULES_VALUE;
123
+ }
124
+ return v;
117
125
  }
118
126
  else {
119
127
  return sessionStorage.getItem(name);
package/dist/workflow.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useEffect } from 'react';
2
- import { g as getUrlSearch } from './tools-4de9d743.js';
2
+ import { g as getUrlSearch } from './tools-aa1fafe4.js';
3
3
  import { WORKFLOW_HIDEFRAME_KEY } from './constants.js';
4
4
  import './tslib.es6-f9459658.js';
5
5
  import 'dayjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkutils",
3
- "version": "2.8.14",
3
+ "version": "2.8.17",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",