@expcat/tigercat-core 1.0.7 → 1.2.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/README.md +1 -1
- package/dist/datepicker-DXzS_8l8.d.cts +130 -0
- package/dist/datepicker-DXzS_8l8.d.ts +130 -0
- package/dist/datepicker-locales/ar-SA.cjs +46 -0
- package/dist/datepicker-locales/ar-SA.d.cts +6 -0
- package/dist/datepicker-locales/ar-SA.d.ts +6 -0
- package/dist/datepicker-locales/ar-SA.js +20 -0
- package/dist/datepicker-locales/de-DE.cjs +46 -0
- package/dist/datepicker-locales/de-DE.d.cts +6 -0
- package/dist/datepicker-locales/de-DE.d.ts +6 -0
- package/dist/datepicker-locales/de-DE.js +20 -0
- package/dist/datepicker-locales/en-US.cjs +46 -0
- package/dist/datepicker-locales/en-US.d.cts +6 -0
- package/dist/datepicker-locales/en-US.d.ts +6 -0
- package/dist/datepicker-locales/en-US.js +20 -0
- package/dist/datepicker-locales/es-ES.cjs +46 -0
- package/dist/datepicker-locales/es-ES.d.cts +6 -0
- package/dist/datepicker-locales/es-ES.d.ts +6 -0
- package/dist/datepicker-locales/es-ES.js +20 -0
- package/dist/datepicker-locales/fr-FR.cjs +46 -0
- package/dist/datepicker-locales/fr-FR.d.cts +6 -0
- package/dist/datepicker-locales/fr-FR.d.ts +6 -0
- package/dist/datepicker-locales/fr-FR.js +20 -0
- package/dist/datepicker-locales/id-ID.cjs +46 -0
- package/dist/datepicker-locales/id-ID.d.cts +6 -0
- package/dist/datepicker-locales/id-ID.d.ts +6 -0
- package/dist/datepicker-locales/id-ID.js +20 -0
- package/dist/datepicker-locales/ja-JP.cjs +46 -0
- package/dist/datepicker-locales/ja-JP.d.cts +6 -0
- package/dist/datepicker-locales/ja-JP.d.ts +6 -0
- package/dist/datepicker-locales/ja-JP.js +20 -0
- package/dist/datepicker-locales/ko-KR.cjs +46 -0
- package/dist/datepicker-locales/ko-KR.d.cts +6 -0
- package/dist/datepicker-locales/ko-KR.d.ts +6 -0
- package/dist/datepicker-locales/ko-KR.js +20 -0
- package/dist/datepicker-locales/pt-BR.cjs +46 -0
- package/dist/datepicker-locales/pt-BR.d.cts +6 -0
- package/dist/datepicker-locales/pt-BR.d.ts +6 -0
- package/dist/datepicker-locales/pt-BR.js +20 -0
- package/dist/datepicker-locales/th-TH.cjs +46 -0
- package/dist/datepicker-locales/th-TH.d.cts +6 -0
- package/dist/datepicker-locales/th-TH.d.ts +6 -0
- package/dist/datepicker-locales/th-TH.js +20 -0
- package/dist/datepicker-locales/vi-VN.cjs +46 -0
- package/dist/datepicker-locales/vi-VN.d.cts +6 -0
- package/dist/datepicker-locales/vi-VN.d.ts +6 -0
- package/dist/datepicker-locales/vi-VN.js +20 -0
- package/dist/datepicker-locales/zh-CN.cjs +46 -0
- package/dist/datepicker-locales/zh-CN.d.cts +6 -0
- package/dist/datepicker-locales/zh-CN.d.ts +6 -0
- package/dist/datepicker-locales/zh-CN.js +20 -0
- package/dist/datepicker-locales/zh-TW.cjs +46 -0
- package/dist/datepicker-locales/zh-TW.d.cts +6 -0
- package/dist/datepicker-locales/zh-TW.d.ts +6 -0
- package/dist/datepicker-locales/zh-TW.js +20 -0
- package/dist/icons/common.cjs +54 -0
- package/dist/icons/common.d.cts +20 -0
- package/dist/icons/common.d.ts +20 -0
- package/dist/icons/common.js +21 -0
- package/dist/icons/picker.cjs +75 -0
- package/dist/icons/picker.d.cts +53 -0
- package/dist/icons/picker.d.ts +53 -0
- package/dist/icons/picker.js +35 -0
- package/dist/icons/status.cjs +47 -0
- package/dist/icons/status.d.cts +13 -0
- package/dist/icons/status.d.ts +13 -0
- package/dist/icons/status.js +18 -0
- package/dist/icons/table.cjs +48 -0
- package/dist/icons/table.d.cts +25 -0
- package/dist/icons/table.d.ts +25 -0
- package/dist/icons/table.js +17 -0
- package/dist/index.cjs +7064 -886
- package/dist/index.d.cts +3826 -1238
- package/dist/index.d.ts +3826 -1238
- package/dist/index.js +6705 -1011
- package/dist/locale-9-B-d0mp.d.cts +97 -0
- package/dist/locale-Bc3zz2b0.d.ts +97 -0
- package/dist/locales/ar-SA.cjs +155 -0
- package/dist/locales/ar-SA.d.cts +10 -0
- package/dist/locales/ar-SA.d.ts +10 -0
- package/dist/locales/ar-SA.js +128 -0
- package/dist/locales/de-DE.cjs +155 -0
- package/dist/locales/de-DE.d.cts +10 -0
- package/dist/locales/de-DE.d.ts +10 -0
- package/dist/locales/de-DE.js +128 -0
- package/dist/locales/en-US.cjs +69 -0
- package/dist/locales/en-US.d.cts +10 -0
- package/dist/locales/en-US.d.ts +10 -0
- package/dist/locales/en-US.js +44 -0
- package/dist/locales/es-ES.cjs +155 -0
- package/dist/locales/es-ES.d.cts +10 -0
- package/dist/locales/es-ES.d.ts +10 -0
- package/dist/locales/es-ES.js +128 -0
- package/dist/locales/fr-FR.cjs +155 -0
- package/dist/locales/fr-FR.d.cts +10 -0
- package/dist/locales/fr-FR.d.ts +10 -0
- package/dist/locales/fr-FR.js +128 -0
- package/dist/locales/id-ID.cjs +69 -0
- package/dist/locales/id-ID.d.cts +10 -0
- package/dist/locales/id-ID.d.ts +10 -0
- package/dist/locales/id-ID.js +44 -0
- package/dist/locales/ja-JP.cjs +69 -0
- package/dist/locales/ja-JP.d.cts +10 -0
- package/dist/locales/ja-JP.d.ts +10 -0
- package/dist/locales/ja-JP.js +44 -0
- package/dist/locales/ko-KR.cjs +69 -0
- package/dist/locales/ko-KR.d.cts +10 -0
- package/dist/locales/ko-KR.d.ts +10 -0
- package/dist/locales/ko-KR.js +44 -0
- package/dist/locales/pt-BR.cjs +155 -0
- package/dist/locales/pt-BR.d.cts +10 -0
- package/dist/locales/pt-BR.d.ts +10 -0
- package/dist/locales/pt-BR.js +128 -0
- package/dist/locales/th-TH.cjs +69 -0
- package/dist/locales/th-TH.d.cts +10 -0
- package/dist/locales/th-TH.d.ts +10 -0
- package/dist/locales/th-TH.js +44 -0
- package/dist/locales/vi-VN.cjs +69 -0
- package/dist/locales/vi-VN.d.cts +10 -0
- package/dist/locales/vi-VN.d.ts +10 -0
- package/dist/locales/vi-VN.js +44 -0
- package/dist/locales/zh-CN.cjs +69 -0
- package/dist/locales/zh-CN.d.cts +10 -0
- package/dist/locales/zh-CN.d.ts +10 -0
- package/dist/locales/zh-CN.js +44 -0
- package/dist/locales/zh-TW.cjs +69 -0
- package/dist/locales/zh-TW.d.cts +10 -0
- package/dist/locales/zh-TW.d.ts +10 -0
- package/dist/locales/zh-TW.js +44 -0
- package/dist/table-export-6ISYSoVB.d.cts +490 -0
- package/dist/table-export-6ISYSoVB.d.ts +490 -0
- package/dist/tailwind/modern.cjs +353 -0
- package/dist/tailwind/modern.d.cts +6 -0
- package/dist/tailwind/modern.d.ts +6 -0
- package/dist/tailwind/modern.js +320 -0
- package/dist/tailwind-entry-D4_sseNi.d.ts +218 -0
- package/dist/tailwind-entry-DUchHtjs.d.cts +218 -0
- package/dist/tailwind.cjs +206 -0
- package/dist/tailwind.d.cts +3 -0
- package/dist/tailwind.d.ts +3 -0
- package/dist/tailwind.js +173 -0
- package/dist/types-CJYAW1ql.d-DDBFn6KB.d.cts +126 -0
- package/dist/types-CJYAW1ql.d-DDBFn6KB.d.ts +126 -0
- package/dist/utils/table-export.cjs +112 -0
- package/dist/utils/table-export.d.cts +1 -0
- package/dist/utils/table-export.d.ts +1 -0
- package/dist/utils/table-export.js +79 -0
- package/package.json +190 -12
- package/tokens/figma-variables.json +2553 -0
- package/tokens/tailwind-tokens.js +145 -0
- package/tokens/tokens.css +640 -0
- package/tokens/tokens.json +395 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { N, P } from './resolve-config-QUZ9b-Gn.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The source code for one or more nodes in the AST
|
|
5
|
+
*
|
|
6
|
+
* This generally corresponds to a stylesheet
|
|
7
|
+
*/
|
|
8
|
+
interface Source {
|
|
9
|
+
/**
|
|
10
|
+
* The path to the file that contains the referenced source code
|
|
11
|
+
*
|
|
12
|
+
* If this references the *output* source code, this is `null`.
|
|
13
|
+
*/
|
|
14
|
+
file: string | null;
|
|
15
|
+
/**
|
|
16
|
+
* The referenced source code
|
|
17
|
+
*/
|
|
18
|
+
code: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The file and offsets within it that this node covers
|
|
22
|
+
*
|
|
23
|
+
* This can represent either:
|
|
24
|
+
* - A location in the original CSS which caused this node to be created
|
|
25
|
+
* - A location in the output CSS where this node resides
|
|
26
|
+
*/
|
|
27
|
+
type SourceLocation = [source: Source, start: number, end: number];
|
|
28
|
+
type PluginFn = (api: PluginAPI) => void;
|
|
29
|
+
type PluginWithConfig = {
|
|
30
|
+
handler: PluginFn;
|
|
31
|
+
config?: UserConfig;
|
|
32
|
+
/** @internal */
|
|
33
|
+
reference?: boolean;
|
|
34
|
+
src?: SourceLocation | undefined;
|
|
35
|
+
};
|
|
36
|
+
type PluginWithOptions<T> = {
|
|
37
|
+
(options?: T): PluginWithConfig;
|
|
38
|
+
__isOptionsFunction: true;
|
|
39
|
+
};
|
|
40
|
+
type Plugin = PluginFn | PluginWithConfig | PluginWithOptions<any>;
|
|
41
|
+
type PluginAPI = {
|
|
42
|
+
addBase(base: CssInJs): void;
|
|
43
|
+
addVariant(name: string, variant: string | string[] | CssInJs): void;
|
|
44
|
+
matchVariant<T = string>(name: string, cb: (value: T | string, extra: {
|
|
45
|
+
modifier: string | null;
|
|
46
|
+
}) => string | string[], options?: {
|
|
47
|
+
values?: Record<string, T>;
|
|
48
|
+
sort?(a: {
|
|
49
|
+
value: T | string;
|
|
50
|
+
modifier: string | null;
|
|
51
|
+
}, b: {
|
|
52
|
+
value: T | string;
|
|
53
|
+
modifier: string | null;
|
|
54
|
+
}): number;
|
|
55
|
+
}): void;
|
|
56
|
+
addUtilities(utilities: Record<string, CssInJs | CssInJs[]> | Record<string, CssInJs | CssInJs[]>[], options?: {}): void;
|
|
57
|
+
matchUtilities(utilities: Record<string, (value: string, extra: {
|
|
58
|
+
modifier: string | null;
|
|
59
|
+
}) => CssInJs | CssInJs[]>, options?: Partial<{
|
|
60
|
+
type: string | string[];
|
|
61
|
+
supportsNegativeValues: boolean;
|
|
62
|
+
values: Record<string, string> & {
|
|
63
|
+
__BARE_VALUE__?: (value: N) => string | undefined;
|
|
64
|
+
};
|
|
65
|
+
modifiers: 'any' | Record<string, string>;
|
|
66
|
+
}>): void;
|
|
67
|
+
addComponents(utilities: Record<string, CssInJs> | Record<string, CssInJs>[], options?: {}): void;
|
|
68
|
+
matchComponents(utilities: Record<string, (value: string, extra: {
|
|
69
|
+
modifier: string | null;
|
|
70
|
+
}) => CssInJs>, options?: Partial<{
|
|
71
|
+
type: string | string[];
|
|
72
|
+
supportsNegativeValues: boolean;
|
|
73
|
+
values: Record<string, string> & {
|
|
74
|
+
__BARE_VALUE__?: (value: N) => string | undefined;
|
|
75
|
+
};
|
|
76
|
+
modifiers: 'any' | Record<string, string>;
|
|
77
|
+
}>): void;
|
|
78
|
+
theme(path: string, defaultValue?: any): any;
|
|
79
|
+
config(path?: string, defaultValue?: any): any;
|
|
80
|
+
prefix(className: string): string;
|
|
81
|
+
};
|
|
82
|
+
type CssInJs = {
|
|
83
|
+
[key: string]: string | string[] | CssInJs | CssInJs[];
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
type ResolvableTo<T> = T | ((utils: P) => T);
|
|
87
|
+
type ThemeValue = ResolvableTo<Record<string, unknown>> | null | undefined;
|
|
88
|
+
type ThemeConfig = Record<string, ThemeValue> & {
|
|
89
|
+
extend?: Record<string, ThemeValue>;
|
|
90
|
+
};
|
|
91
|
+
type ContentFile = string | {
|
|
92
|
+
raw: string;
|
|
93
|
+
extension?: string;
|
|
94
|
+
};
|
|
95
|
+
type DarkModeStrategy = false | 'media' | 'class' | ['class', string] | 'selector' | ['selector', string] | ['variant', string | string[]];
|
|
96
|
+
interface UserConfig {
|
|
97
|
+
presets?: UserConfig[];
|
|
98
|
+
theme?: ThemeConfig;
|
|
99
|
+
plugins?: Plugin[];
|
|
100
|
+
}
|
|
101
|
+
interface UserConfig {
|
|
102
|
+
content?: ContentFile[] | {
|
|
103
|
+
relative?: boolean;
|
|
104
|
+
files: ContentFile[];
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
interface UserConfig {
|
|
108
|
+
darkMode?: DarkModeStrategy;
|
|
109
|
+
}
|
|
110
|
+
interface UserConfig {
|
|
111
|
+
prefix?: string;
|
|
112
|
+
}
|
|
113
|
+
interface UserConfig {
|
|
114
|
+
blocklist?: string[];
|
|
115
|
+
}
|
|
116
|
+
interface UserConfig {
|
|
117
|
+
important?: boolean | string;
|
|
118
|
+
}
|
|
119
|
+
interface UserConfig {
|
|
120
|
+
future?: 'all' | Record<string, boolean>;
|
|
121
|
+
}
|
|
122
|
+
interface UserConfig {
|
|
123
|
+
experimental?: 'all' | Record<string, boolean>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export type { PluginWithConfig as P };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { N, P } from './resolve-config-QUZ9b-Gn.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The source code for one or more nodes in the AST
|
|
5
|
+
*
|
|
6
|
+
* This generally corresponds to a stylesheet
|
|
7
|
+
*/
|
|
8
|
+
interface Source {
|
|
9
|
+
/**
|
|
10
|
+
* The path to the file that contains the referenced source code
|
|
11
|
+
*
|
|
12
|
+
* If this references the *output* source code, this is `null`.
|
|
13
|
+
*/
|
|
14
|
+
file: string | null;
|
|
15
|
+
/**
|
|
16
|
+
* The referenced source code
|
|
17
|
+
*/
|
|
18
|
+
code: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The file and offsets within it that this node covers
|
|
22
|
+
*
|
|
23
|
+
* This can represent either:
|
|
24
|
+
* - A location in the original CSS which caused this node to be created
|
|
25
|
+
* - A location in the output CSS where this node resides
|
|
26
|
+
*/
|
|
27
|
+
type SourceLocation = [source: Source, start: number, end: number];
|
|
28
|
+
type PluginFn = (api: PluginAPI) => void;
|
|
29
|
+
type PluginWithConfig = {
|
|
30
|
+
handler: PluginFn;
|
|
31
|
+
config?: UserConfig;
|
|
32
|
+
/** @internal */
|
|
33
|
+
reference?: boolean;
|
|
34
|
+
src?: SourceLocation | undefined;
|
|
35
|
+
};
|
|
36
|
+
type PluginWithOptions<T> = {
|
|
37
|
+
(options?: T): PluginWithConfig;
|
|
38
|
+
__isOptionsFunction: true;
|
|
39
|
+
};
|
|
40
|
+
type Plugin = PluginFn | PluginWithConfig | PluginWithOptions<any>;
|
|
41
|
+
type PluginAPI = {
|
|
42
|
+
addBase(base: CssInJs): void;
|
|
43
|
+
addVariant(name: string, variant: string | string[] | CssInJs): void;
|
|
44
|
+
matchVariant<T = string>(name: string, cb: (value: T | string, extra: {
|
|
45
|
+
modifier: string | null;
|
|
46
|
+
}) => string | string[], options?: {
|
|
47
|
+
values?: Record<string, T>;
|
|
48
|
+
sort?(a: {
|
|
49
|
+
value: T | string;
|
|
50
|
+
modifier: string | null;
|
|
51
|
+
}, b: {
|
|
52
|
+
value: T | string;
|
|
53
|
+
modifier: string | null;
|
|
54
|
+
}): number;
|
|
55
|
+
}): void;
|
|
56
|
+
addUtilities(utilities: Record<string, CssInJs | CssInJs[]> | Record<string, CssInJs | CssInJs[]>[], options?: {}): void;
|
|
57
|
+
matchUtilities(utilities: Record<string, (value: string, extra: {
|
|
58
|
+
modifier: string | null;
|
|
59
|
+
}) => CssInJs | CssInJs[]>, options?: Partial<{
|
|
60
|
+
type: string | string[];
|
|
61
|
+
supportsNegativeValues: boolean;
|
|
62
|
+
values: Record<string, string> & {
|
|
63
|
+
__BARE_VALUE__?: (value: N) => string | undefined;
|
|
64
|
+
};
|
|
65
|
+
modifiers: 'any' | Record<string, string>;
|
|
66
|
+
}>): void;
|
|
67
|
+
addComponents(utilities: Record<string, CssInJs> | Record<string, CssInJs>[], options?: {}): void;
|
|
68
|
+
matchComponents(utilities: Record<string, (value: string, extra: {
|
|
69
|
+
modifier: string | null;
|
|
70
|
+
}) => CssInJs>, options?: Partial<{
|
|
71
|
+
type: string | string[];
|
|
72
|
+
supportsNegativeValues: boolean;
|
|
73
|
+
values: Record<string, string> & {
|
|
74
|
+
__BARE_VALUE__?: (value: N) => string | undefined;
|
|
75
|
+
};
|
|
76
|
+
modifiers: 'any' | Record<string, string>;
|
|
77
|
+
}>): void;
|
|
78
|
+
theme(path: string, defaultValue?: any): any;
|
|
79
|
+
config(path?: string, defaultValue?: any): any;
|
|
80
|
+
prefix(className: string): string;
|
|
81
|
+
};
|
|
82
|
+
type CssInJs = {
|
|
83
|
+
[key: string]: string | string[] | CssInJs | CssInJs[];
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
type ResolvableTo<T> = T | ((utils: P) => T);
|
|
87
|
+
type ThemeValue = ResolvableTo<Record<string, unknown>> | null | undefined;
|
|
88
|
+
type ThemeConfig = Record<string, ThemeValue> & {
|
|
89
|
+
extend?: Record<string, ThemeValue>;
|
|
90
|
+
};
|
|
91
|
+
type ContentFile = string | {
|
|
92
|
+
raw: string;
|
|
93
|
+
extension?: string;
|
|
94
|
+
};
|
|
95
|
+
type DarkModeStrategy = false | 'media' | 'class' | ['class', string] | 'selector' | ['selector', string] | ['variant', string | string[]];
|
|
96
|
+
interface UserConfig {
|
|
97
|
+
presets?: UserConfig[];
|
|
98
|
+
theme?: ThemeConfig;
|
|
99
|
+
plugins?: Plugin[];
|
|
100
|
+
}
|
|
101
|
+
interface UserConfig {
|
|
102
|
+
content?: ContentFile[] | {
|
|
103
|
+
relative?: boolean;
|
|
104
|
+
files: ContentFile[];
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
interface UserConfig {
|
|
108
|
+
darkMode?: DarkModeStrategy;
|
|
109
|
+
}
|
|
110
|
+
interface UserConfig {
|
|
111
|
+
prefix?: string;
|
|
112
|
+
}
|
|
113
|
+
interface UserConfig {
|
|
114
|
+
blocklist?: string[];
|
|
115
|
+
}
|
|
116
|
+
interface UserConfig {
|
|
117
|
+
important?: boolean | string;
|
|
118
|
+
}
|
|
119
|
+
interface UserConfig {
|
|
120
|
+
future?: 'all' | Record<string, boolean>;
|
|
121
|
+
}
|
|
122
|
+
interface UserConfig {
|
|
123
|
+
experimental?: 'all' | Record<string, boolean>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export type { PluginWithConfig as P };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/utils/table-export.ts
|
|
21
|
+
var table_export_exports = {};
|
|
22
|
+
__export(table_export_exports, {
|
|
23
|
+
downloadCsv: () => downloadCsv,
|
|
24
|
+
downloadExcel: () => downloadExcel,
|
|
25
|
+
downloadTableExport: () => downloadTableExport,
|
|
26
|
+
exportTableData: () => exportTableData,
|
|
27
|
+
exportTableToCsv: () => exportTableToCsv,
|
|
28
|
+
exportTableToExcel: () => exportTableToExcel,
|
|
29
|
+
tableExportButtonClasses: () => tableExportButtonClasses
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(table_export_exports);
|
|
32
|
+
|
|
33
|
+
// src/utils/table-export-utils.ts
|
|
34
|
+
function escapeCsvValue(value) {
|
|
35
|
+
const str = value === null || value === void 0 ? "" : String(value);
|
|
36
|
+
if (str.includes(",") || str.includes('"') || str.includes("\n")) {
|
|
37
|
+
return `"${str.replace(/"/g, '""')}"`;
|
|
38
|
+
}
|
|
39
|
+
return str;
|
|
40
|
+
}
|
|
41
|
+
function exportTableToCsv(columns, data, _filename) {
|
|
42
|
+
const headers = columns.map((col) => escapeCsvValue(col.title));
|
|
43
|
+
const rows = data.map(
|
|
44
|
+
(record) => columns.map((col) => {
|
|
45
|
+
const key = col.dataKey || col.key;
|
|
46
|
+
const value = record[key];
|
|
47
|
+
return escapeCsvValue(value);
|
|
48
|
+
}).join(",")
|
|
49
|
+
);
|
|
50
|
+
return [headers.join(","), ...rows].join("\n");
|
|
51
|
+
}
|
|
52
|
+
function escapeHtmlValue(value) {
|
|
53
|
+
const str = value === null || value === void 0 ? "" : String(value);
|
|
54
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
55
|
+
}
|
|
56
|
+
function exportTableToExcel(columns, data) {
|
|
57
|
+
const headerCells = columns.map((column) => `<th>${escapeHtmlValue(column.title)}</th>`).join("");
|
|
58
|
+
const bodyRows = data.map((record) => {
|
|
59
|
+
const cells = columns.map((column) => {
|
|
60
|
+
const key = column.dataKey || column.key;
|
|
61
|
+
const value = record[key];
|
|
62
|
+
return `<td>${escapeHtmlValue(value)}</td>`;
|
|
63
|
+
}).join("");
|
|
64
|
+
return `<tr>${cells}</tr>`;
|
|
65
|
+
}).join("");
|
|
66
|
+
return `<!doctype html><html><head><meta charset="utf-8"></head><body><table><thead><tr>${headerCells}</tr></thead><tbody>${bodyRows}</tbody></table></body></html>`;
|
|
67
|
+
}
|
|
68
|
+
function downloadCsv(csvContent, filename = "export") {
|
|
69
|
+
const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" });
|
|
70
|
+
const url = URL.createObjectURL(blob);
|
|
71
|
+
const link = document.createElement("a");
|
|
72
|
+
link.href = url;
|
|
73
|
+
link.download = `${filename}.csv`;
|
|
74
|
+
link.style.display = "none";
|
|
75
|
+
document.body.appendChild(link);
|
|
76
|
+
link.click();
|
|
77
|
+
document.body.removeChild(link);
|
|
78
|
+
URL.revokeObjectURL(url);
|
|
79
|
+
}
|
|
80
|
+
function downloadExcel(excelContent, filename = "export") {
|
|
81
|
+
const blob = new Blob([excelContent], { type: "application/vnd.ms-excel;charset=utf-8;" });
|
|
82
|
+
const url = URL.createObjectURL(blob);
|
|
83
|
+
const link = document.createElement("a");
|
|
84
|
+
link.href = url;
|
|
85
|
+
link.download = `${filename}.xls`;
|
|
86
|
+
link.style.display = "none";
|
|
87
|
+
document.body.appendChild(link);
|
|
88
|
+
link.click();
|
|
89
|
+
document.body.removeChild(link);
|
|
90
|
+
URL.revokeObjectURL(url);
|
|
91
|
+
}
|
|
92
|
+
function exportTableData(columns, data, format = "csv") {
|
|
93
|
+
return format === "excel" ? exportTableToExcel(columns, data) : exportTableToCsv(columns, data);
|
|
94
|
+
}
|
|
95
|
+
function downloadTableExport(content, filename = "export", format = "csv") {
|
|
96
|
+
if (format === "excel") {
|
|
97
|
+
downloadExcel(content, filename);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
downloadCsv(content, filename);
|
|
101
|
+
}
|
|
102
|
+
var tableExportButtonClasses = "inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] text-[var(--tiger-text,#111827)] bg-[var(--tiger-surface,#ffffff)] hover:bg-[var(--tiger-surface-muted,#f9fafb)] transition-colors";
|
|
103
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
+
0 && (module.exports = {
|
|
105
|
+
downloadCsv,
|
|
106
|
+
downloadExcel,
|
|
107
|
+
downloadTableExport,
|
|
108
|
+
exportTableData,
|
|
109
|
+
exportTableToCsv,
|
|
110
|
+
exportTableToExcel,
|
|
111
|
+
tableExportButtonClasses
|
|
112
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { i as downloadCsv, j as downloadExcel, l as downloadTableExport, k as exportTableData, g as exportTableToCsv, h as exportTableToExcel, t as tableExportButtonClasses } from '../table-export-6ISYSoVB.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { i as downloadCsv, j as downloadExcel, l as downloadTableExport, k as exportTableData, g as exportTableToCsv, h as exportTableToExcel, t as tableExportButtonClasses } from '../table-export-6ISYSoVB.js';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// src/utils/table-export-utils.ts
|
|
2
|
+
function escapeCsvValue(value) {
|
|
3
|
+
const str = value === null || value === void 0 ? "" : String(value);
|
|
4
|
+
if (str.includes(",") || str.includes('"') || str.includes("\n")) {
|
|
5
|
+
return `"${str.replace(/"/g, '""')}"`;
|
|
6
|
+
}
|
|
7
|
+
return str;
|
|
8
|
+
}
|
|
9
|
+
function exportTableToCsv(columns, data, _filename) {
|
|
10
|
+
const headers = columns.map((col) => escapeCsvValue(col.title));
|
|
11
|
+
const rows = data.map(
|
|
12
|
+
(record) => columns.map((col) => {
|
|
13
|
+
const key = col.dataKey || col.key;
|
|
14
|
+
const value = record[key];
|
|
15
|
+
return escapeCsvValue(value);
|
|
16
|
+
}).join(",")
|
|
17
|
+
);
|
|
18
|
+
return [headers.join(","), ...rows].join("\n");
|
|
19
|
+
}
|
|
20
|
+
function escapeHtmlValue(value) {
|
|
21
|
+
const str = value === null || value === void 0 ? "" : String(value);
|
|
22
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
23
|
+
}
|
|
24
|
+
function exportTableToExcel(columns, data) {
|
|
25
|
+
const headerCells = columns.map((column) => `<th>${escapeHtmlValue(column.title)}</th>`).join("");
|
|
26
|
+
const bodyRows = data.map((record) => {
|
|
27
|
+
const cells = columns.map((column) => {
|
|
28
|
+
const key = column.dataKey || column.key;
|
|
29
|
+
const value = record[key];
|
|
30
|
+
return `<td>${escapeHtmlValue(value)}</td>`;
|
|
31
|
+
}).join("");
|
|
32
|
+
return `<tr>${cells}</tr>`;
|
|
33
|
+
}).join("");
|
|
34
|
+
return `<!doctype html><html><head><meta charset="utf-8"></head><body><table><thead><tr>${headerCells}</tr></thead><tbody>${bodyRows}</tbody></table></body></html>`;
|
|
35
|
+
}
|
|
36
|
+
function downloadCsv(csvContent, filename = "export") {
|
|
37
|
+
const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" });
|
|
38
|
+
const url = URL.createObjectURL(blob);
|
|
39
|
+
const link = document.createElement("a");
|
|
40
|
+
link.href = url;
|
|
41
|
+
link.download = `${filename}.csv`;
|
|
42
|
+
link.style.display = "none";
|
|
43
|
+
document.body.appendChild(link);
|
|
44
|
+
link.click();
|
|
45
|
+
document.body.removeChild(link);
|
|
46
|
+
URL.revokeObjectURL(url);
|
|
47
|
+
}
|
|
48
|
+
function downloadExcel(excelContent, filename = "export") {
|
|
49
|
+
const blob = new Blob([excelContent], { type: "application/vnd.ms-excel;charset=utf-8;" });
|
|
50
|
+
const url = URL.createObjectURL(blob);
|
|
51
|
+
const link = document.createElement("a");
|
|
52
|
+
link.href = url;
|
|
53
|
+
link.download = `${filename}.xls`;
|
|
54
|
+
link.style.display = "none";
|
|
55
|
+
document.body.appendChild(link);
|
|
56
|
+
link.click();
|
|
57
|
+
document.body.removeChild(link);
|
|
58
|
+
URL.revokeObjectURL(url);
|
|
59
|
+
}
|
|
60
|
+
function exportTableData(columns, data, format = "csv") {
|
|
61
|
+
return format === "excel" ? exportTableToExcel(columns, data) : exportTableToCsv(columns, data);
|
|
62
|
+
}
|
|
63
|
+
function downloadTableExport(content, filename = "export", format = "csv") {
|
|
64
|
+
if (format === "excel") {
|
|
65
|
+
downloadExcel(content, filename);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
downloadCsv(content, filename);
|
|
69
|
+
}
|
|
70
|
+
var tableExportButtonClasses = "inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] text-[var(--tiger-text,#111827)] bg-[var(--tiger-surface,#ffffff)] hover:bg-[var(--tiger-surface-muted,#f9fafb)] transition-colors";
|
|
71
|
+
export {
|
|
72
|
+
downloadCsv,
|
|
73
|
+
downloadExcel,
|
|
74
|
+
downloadTableExport,
|
|
75
|
+
exportTableData,
|
|
76
|
+
exportTableToCsv,
|
|
77
|
+
exportTableToExcel,
|
|
78
|
+
tableExportButtonClasses
|
|
79
|
+
};
|