@fewangsit/wangsvue-fats 1.0.0-alpha.132 → 1.0.0-alpha.134

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.
@@ -0,0 +1,13 @@
1
+ export interface ITable {
2
+ headers: string[];
3
+ data: Record<string, unknown>[];
4
+ tableName: string;
5
+ tableTitle?: string;
6
+ }
7
+ interface IExcelOptions {
8
+ tables: ITable[];
9
+ fileName: string;
10
+ additionalTexts?: (string | string[])[];
11
+ }
12
+ declare const exportToExcel: (options: IExcelOptions) => Promise<void>;
13
+ export default exportToExcel;
@@ -1,23 +1,27 @@
1
1
  import { BadgeProps } from '../components/badge/Badge.vue.d';
2
2
  export type FixedAssetStatus =
3
- | 'Available'
3
+ | 'Active'
4
4
  | 'Approved'
5
- | 'Finished Approval'
5
+ | 'Available'
6
6
  | 'Damaged'
7
+ | 'Disposed'
8
+ | 'Finished Approval'
9
+ | 'Managed'
7
10
  | 'Missing'
11
+ | 'Need Approval'
12
+ | 'Not Paired Yet'
13
+ | 'On Disposal Process'
14
+ | 'On Transfer'
15
+ | 'Pending Activation'
8
16
  | 'Rejected'
17
+ | 'Reported Disposal'
9
18
  | 'Reported Missing'
10
19
  | 'Reported Damaged'
11
20
  | 'TAG Reported'
12
- | 'Not Paired Yet'
13
21
  | 'Unassigned'
14
- | 'Reported Disposal'
15
- | 'On Disposal Process'
16
- | 'Disposed'
17
- | 'On Transfer'
22
+ | 'Unmanaged'
18
23
  | 'Waiting for Handover'
19
- | 'Waiting for Approval'
20
- | 'Need Approval';
24
+ | 'Waiting for Approval';
21
25
  export default function getStatusSeverity(
22
26
  status: FixedAssetStatus,
23
27
  ): BadgeProps['severity'];
package/utils/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from './role.util';
3
3
  export * from './listenSidebarChanges.util';
4
4
  export { isEmptyObject } from '../utils/object.util';
5
5
  export { formatDate, formatDateReadable } from '../utils/date.util';
6
+ export { default as exportToExcel } from '../utils/exportToExcel.util';
6
7
  export { default as flattenTreeNodeChildren } from '../components/tree/helpers/flattenTreeNodeChildren.helper';
7
8
  export { default as getStatusSeverity } from './getStatusSeverity.util';
8
9
  export { default as useToast } from './toast.util';
@@ -0,0 +1,19 @@
1
+ import * as XLSX from 'xlsx/types/index';
2
+ /**
3
+ * Dynamically loads SheetJS (XLSX) from a CDN to avoid bundling its large package size.
4
+ *
5
+ * SheetJS is a powerful but heavy library (~700KB+ uncompressed). To improve bundle performance and reduce initial
6
+ * JavaScript payload, we load it only when needed (on demand), directly from a CDN.
7
+ *
8
+ * The official CDN build is a UMD module that exposes the `XLSX` object on the global `window`.
9
+ * This function ensures it's loaded once and cached for subsequent use.
10
+ *
11
+ * @returns {Promise<XLSXType>} A promise that resolves with the XLSX object once the script is loaded.
12
+ */
13
+ declare const loadSheetJSFromCDN: () => Promise<typeof XLSX>;
14
+ export default loadSheetJSFromCDN;
15
+ declare global {
16
+ interface Window {
17
+ XLSX: typeof XLSX;
18
+ }
19
+ }