@pallasoft/ps-table-components 1.17.0 → 1.18.0
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/components/ps-table-export-button.d.ts +5 -0
- package/dist/components/ps-table-export-button.js +7 -0
- package/dist/constants/ps-table-download-config.d.ts +4 -0
- package/dist/constants/ps-table-download-config.js +7 -0
- package/dist/esm/components/ps-table-export-button.js +3 -0
- package/dist/esm/constants/ps-table-download-config.js +4 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/services/ps-table-download-service.js +12 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/services/ps-table-download-service.d.ts +3 -0
- package/dist/services/ps-table-download-service.js +16 -0
- package/package.json +1 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PsTableExportButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ps_icons_1 = require("@pallasoft/ps-icons");
|
|
6
|
+
const PsTableExportButton = ({ label, onExport }) => ((0, jsx_runtime_1.jsxs)("button", { className: 'ps-focus-ring ps-liquid ps-liquid-control inline-flex min-h-10 min-w-10 items-center justify-center gap-2 rounded-full px-3 text-sm font-semibold text-ink transition-colors hover:border-primary/40 sm:px-4', onClick: onExport, type: 'button', children: [(0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { "aria-hidden": 'true', className: 'block h-4 w-4', iconKey: ps_icons_1.PsIconKey.Download }), (0, jsx_runtime_1.jsx)("span", { className: 'sr-only sm:not-sr-only', children: label })] }));
|
|
7
|
+
exports.PsTableExportButton = PsTableExportButton;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PsIcon, PsIconKey } from '@pallasoft/ps-icons';
|
|
3
|
+
export const PsTableExportButton = ({ label, onExport }) => (_jsxs("button", { className: 'ps-focus-ring ps-liquid ps-liquid-control inline-flex min-h-10 min-w-10 items-center justify-center gap-2 rounded-full px-3 text-sm font-semibold text-ink transition-colors hover:border-primary/40 sm:px-4', onClick: onExport, type: 'button', children: [_jsx(PsIcon, { "aria-hidden": 'true', className: 'block h-4 w-4', iconKey: PsIconKey.Download }), _jsx("span", { className: 'sr-only sm:not-sr-only', children: label })] }));
|
package/dist/esm/index.js
CHANGED
|
@@ -26,3 +26,6 @@ export * from './services/ps-table-group-service';
|
|
|
26
26
|
export * from './services/ps-table-query-service';
|
|
27
27
|
export * from './services/ps-table-search-service';
|
|
28
28
|
export * from './services/ps-table-stream-service';
|
|
29
|
+
export * from './components/ps-table-export-button';
|
|
30
|
+
export * from './constants/ps-table-download-config';
|
|
31
|
+
export * from './services/ps-table-download-service';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PsTableDownloadConfig } from '../constants/ps-table-download-config';
|
|
2
|
+
export class PsTableDownloadService {
|
|
3
|
+
static downloadCsv(fileName, content) {
|
|
4
|
+
const blob = new Blob([content], { type: PsTableDownloadConfig.csvMimeType });
|
|
5
|
+
const url = URL.createObjectURL(blob);
|
|
6
|
+
const link = document.createElement('a');
|
|
7
|
+
link.href = url;
|
|
8
|
+
link.download = `${fileName}${PsTableDownloadConfig.csvExtension}`;
|
|
9
|
+
link.click();
|
|
10
|
+
URL.revokeObjectURL(url);
|
|
11
|
+
}
|
|
12
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -26,3 +26,6 @@ export * from './services/ps-table-group-service';
|
|
|
26
26
|
export * from './services/ps-table-query-service';
|
|
27
27
|
export * from './services/ps-table-search-service';
|
|
28
28
|
export * from './services/ps-table-stream-service';
|
|
29
|
+
export * from './components/ps-table-export-button';
|
|
30
|
+
export * from './constants/ps-table-download-config';
|
|
31
|
+
export * from './services/ps-table-download-service';
|
package/dist/index.js
CHANGED
|
@@ -42,3 +42,6 @@ __exportStar(require("./services/ps-table-group-service"), exports);
|
|
|
42
42
|
__exportStar(require("./services/ps-table-query-service"), exports);
|
|
43
43
|
__exportStar(require("./services/ps-table-search-service"), exports);
|
|
44
44
|
__exportStar(require("./services/ps-table-stream-service"), exports);
|
|
45
|
+
__exportStar(require("./components/ps-table-export-button"), exports);
|
|
46
|
+
__exportStar(require("./constants/ps-table-download-config"), exports);
|
|
47
|
+
__exportStar(require("./services/ps-table-download-service"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PsTableDownloadService = void 0;
|
|
4
|
+
const ps_table_download_config_1 = require("../constants/ps-table-download-config");
|
|
5
|
+
class PsTableDownloadService {
|
|
6
|
+
static downloadCsv(fileName, content) {
|
|
7
|
+
const blob = new Blob([content], { type: ps_table_download_config_1.PsTableDownloadConfig.csvMimeType });
|
|
8
|
+
const url = URL.createObjectURL(blob);
|
|
9
|
+
const link = document.createElement('a');
|
|
10
|
+
link.href = url;
|
|
11
|
+
link.download = `${fileName}${ps_table_download_config_1.PsTableDownloadConfig.csvExtension}`;
|
|
12
|
+
link.click();
|
|
13
|
+
URL.revokeObjectURL(url);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.PsTableDownloadService = PsTableDownloadService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pallasoft/ps-table-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/esm/index.js",
|
|
13
12
|
"module": "./dist/esm/index.js",
|
|
14
13
|
"require": "./dist/index.js",
|
|
15
14
|
"default": "./dist/index.js"
|