@zero-library/common 3.1.3 → 3.1.4
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/dist/index.cjs.js +4 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +3 -17
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -1
package/dist/index.esm.js
CHANGED
|
@@ -5,6 +5,7 @@ import classNames2 from 'classnames';
|
|
|
5
5
|
import { renderAsync } from 'docx-preview';
|
|
6
6
|
import * as React3 from 'react';
|
|
7
7
|
import React3__default, { useRef, useState, useEffect, forwardRef, useMemo, useCallback, createContext, isValidElement, version, cloneElement, memo, useImperativeHandle, useContext, Fragment as Fragment$1, lazy, Suspense } from 'react';
|
|
8
|
+
import copyToClipboard from 'copy-to-clipboard';
|
|
8
9
|
import AES from 'crypto-js/aes';
|
|
9
10
|
import encUtf8 from 'crypto-js/enc-utf8';
|
|
10
11
|
import { convert } from 'html-to-text';
|
|
@@ -468,23 +469,8 @@ var genNonDuplicateID = () => {
|
|
|
468
469
|
});
|
|
469
470
|
};
|
|
470
471
|
var copyText = async (text, prompt = "\u590D\u5236\u6210\u529F") => {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
if (prompt) message.success(prompt);
|
|
474
|
-
} catch (e) {
|
|
475
|
-
const textArea = document.createElement("textarea");
|
|
476
|
-
textArea.value = text;
|
|
477
|
-
textArea.style.position = "absolute";
|
|
478
|
-
textArea.style.opacity = "0";
|
|
479
|
-
textArea.style.left = "-999999px";
|
|
480
|
-
textArea.style.top = "-999999px";
|
|
481
|
-
document.body.appendChild(textArea);
|
|
482
|
-
textArea.focus();
|
|
483
|
-
textArea.select();
|
|
484
|
-
const ok = document.execCommand("copy");
|
|
485
|
-
if (ok && prompt) message.success(prompt);
|
|
486
|
-
textArea.remove();
|
|
487
|
-
}
|
|
472
|
+
await copyToClipboard(text);
|
|
473
|
+
if (prompt) message.success(prompt);
|
|
488
474
|
};
|
|
489
475
|
function formatNumberWithCommas(number) {
|
|
490
476
|
const numericValue = parseFloat(number);
|