listpage-next 0.0.279 → 0.0.280

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.
@@ -37,7 +37,7 @@ const MarkdownBody = styled_components(x_markdown)`
37
37
 
38
38
  /* 表格美化样式,仅作用于当前气泡内容内的表格 */
39
39
  table {
40
- width: 100%;
40
+ width: 100% !important;
41
41
  border-collapse: separate;
42
42
  border-spacing: 0;
43
43
  background: #fff;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copies text to the clipboard using the Clipboard API or a fallback method.
3
+ * Compatible with Google Chrome and other modern browsers.
4
+ *
5
+ * @param text The text to copy.
6
+ * @returns A promise that resolves to true if the copy was successful, false otherwise.
7
+ */
8
+ export declare function copyToClipboard(text: string): Promise<boolean>;
@@ -0,0 +1,29 @@
1
+ async function copyToClipboard(text) {
2
+ if (!text) return false;
3
+ try {
4
+ if (navigator.clipboard && navigator.clipboard.writeText) {
5
+ await navigator.clipboard.writeText(text);
6
+ return true;
7
+ }
8
+ } catch (err) {
9
+ console.warn('Clipboard API failed, attempting fallback...', err);
10
+ }
11
+ try {
12
+ const textArea = document.createElement('textarea');
13
+ textArea.value = text;
14
+ textArea.style.position = 'fixed';
15
+ textArea.style.left = '-9999px';
16
+ textArea.style.top = '0';
17
+ textArea.setAttribute('readonly', '');
18
+ document.body.appendChild(textArea);
19
+ textArea.focus();
20
+ textArea.select();
21
+ const successful = document.execCommand('copy');
22
+ document.body.removeChild(textArea);
23
+ return successful;
24
+ } catch (err) {
25
+ console.error('Fallback copy failed', err);
26
+ return false;
27
+ }
28
+ }
29
+ export { copyToClipboard };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.279",
3
+ "version": "0.0.280",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",