@shival99/z-ui 2.5.2 → 2.5.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/assets/css/features/media.css +14 -0
- package/assets/css/features/office.css +11 -0
- package/assets/css/global.css +5 -9
- package/assets/css/overlay.css +28 -3
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs +16 -2
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-command.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-command.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs +4 -3
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-loading.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-loading.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-menu.mjs +4 -4
- package/fesm2022/shival99-z-ui-components-z-menu.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-modal.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-modal.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-overlay.mjs +32 -29
- package/fesm2022/shival99-z-ui-components-z-overlay.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-select.mjs +20 -2
- package/fesm2022/shival99-z-ui-components-z-select.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-table.mjs +7 -7
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-services-excel.mjs +672 -0
- package/fesm2022/shival99-z-ui-services-excel.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-services-office.mjs +123 -0
- package/fesm2022/shival99-z-ui-services-office.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-services.mjs +2 -778
- package/fesm2022/shival99-z-ui-services.mjs.map +1 -1
- package/package.json +22 -6
- package/types/shival99-z-ui-components-z-autocomplete.d.ts +2 -1
- package/types/shival99-z-ui-components-z-calendar.d.ts +4 -4
- package/types/shival99-z-ui-components-z-overlay.d.ts +11 -12
- package/types/shival99-z-ui-components-z-select.d.ts +4 -2
- package/types/shival99-z-ui-components-z-table.d.ts +2 -2
- package/types/shival99-z-ui-services-excel.d.ts +36 -0
- package/types/shival99-z-ui-services-office.d.ts +15 -0
- package/types/shival99-z-ui-services.d.ts +151 -194
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shival99/z-ui",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4",
|
|
4
4
|
"description": "Z-UI: Modern Angular UI Component Library - A comprehensive, high-performance design system built with Angular 22, featuring 45+ customizable components with dark mode, accessibility, and enterprise-ready features.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -83,7 +83,6 @@
|
|
|
83
83
|
"exceljs": "^4.4.0",
|
|
84
84
|
"file-saver": "^2.0.5",
|
|
85
85
|
"hls.js": ">=1.6.0",
|
|
86
|
-
"mammoth": ">=1.12.0",
|
|
87
86
|
"minisearch": ">=7.0.0",
|
|
88
87
|
"ng-animated-icons": ">=1.9.0",
|
|
89
88
|
"ng2-pdfjs-viewer": ">=26.0.0",
|
|
@@ -168,9 +167,6 @@
|
|
|
168
167
|
"docx-preview": {
|
|
169
168
|
"optional": true
|
|
170
169
|
},
|
|
171
|
-
"mammoth": {
|
|
172
|
-
"optional": true
|
|
173
|
-
},
|
|
174
170
|
"ng2-pdfjs-viewer": {
|
|
175
171
|
"optional": true
|
|
176
172
|
},
|
|
@@ -191,9 +187,21 @@
|
|
|
191
187
|
},
|
|
192
188
|
"tiptap-extension-resize-image": {
|
|
193
189
|
"optional": true
|
|
190
|
+
},
|
|
191
|
+
"exceljs": {
|
|
192
|
+
"optional": true
|
|
193
|
+
},
|
|
194
|
+
"file-saver": {
|
|
195
|
+
"optional": true
|
|
196
|
+
},
|
|
197
|
+
"xlsx": {
|
|
198
|
+
"optional": true
|
|
194
199
|
}
|
|
195
200
|
},
|
|
196
|
-
"sideEffects":
|
|
201
|
+
"sideEffects": [
|
|
202
|
+
"**/*.css",
|
|
203
|
+
"**/z-media-player/**"
|
|
204
|
+
],
|
|
197
205
|
"engines": {
|
|
198
206
|
"node": ">=18.0.0"
|
|
199
207
|
},
|
|
@@ -419,6 +427,14 @@
|
|
|
419
427
|
"types": "./types/shival99-z-ui-services.d.ts",
|
|
420
428
|
"default": "./fesm2022/shival99-z-ui-services.mjs"
|
|
421
429
|
},
|
|
430
|
+
"./services/excel": {
|
|
431
|
+
"types": "./types/shival99-z-ui-services-excel.d.ts",
|
|
432
|
+
"default": "./fesm2022/shival99-z-ui-services-excel.mjs"
|
|
433
|
+
},
|
|
434
|
+
"./services/office": {
|
|
435
|
+
"types": "./types/shival99-z-ui-services-office.d.ts",
|
|
436
|
+
"default": "./fesm2022/shival99-z-ui-services-office.mjs"
|
|
437
|
+
},
|
|
422
438
|
"./utils": {
|
|
423
439
|
"types": "./types/shival99-z-ui-utils.d.ts",
|
|
424
440
|
"default": "./fesm2022/shival99-z-ui-utils.mjs"
|
|
@@ -179,6 +179,7 @@ declare class ZAutocompleteComponent<T = unknown> implements OnInit, ControlValu
|
|
|
179
179
|
private _asyncRequestId;
|
|
180
180
|
private _lastFilteredOptionsLength;
|
|
181
181
|
private _shouldScrollActiveOption;
|
|
182
|
+
private _pendingServerSearchScrollReset;
|
|
182
183
|
/** Guards against focus+click both requesting an open on the same gesture, which doubled CD cycles. */
|
|
183
184
|
private _openRequested;
|
|
184
185
|
/** Stores input value before keyboard navigation for ESC revert */
|
|
@@ -282,7 +283,7 @@ declare class ZAutocompleteComponent<T = unknown> implements OnInit, ControlValu
|
|
|
282
283
|
|
|
283
284
|
declare const zAutocompleteInputVariants: (props?: ({
|
|
284
285
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
285
|
-
zStatus?: "default" | "
|
|
286
|
+
zStatus?: "default" | "open" | "error" | "disabled" | "readonly" | null | undefined;
|
|
286
287
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
287
288
|
type ZAutocompleteInputVariants = VariantProps<typeof zAutocompleteInputVariants>;
|
|
288
289
|
declare const zAutocompleteOptionVariants: (props?: ({
|
|
@@ -435,16 +435,16 @@ declare class ZCalendarComponent implements OnInit, ControlValueAccessor {
|
|
|
435
435
|
|
|
436
436
|
declare const zCalendarVariants: (props?: ({
|
|
437
437
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
438
|
-
zStatus?: "default" | "disabled" | "
|
|
438
|
+
zStatus?: "default" | "disabled" | "open" | "error" | "readonly" | null | undefined;
|
|
439
439
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
440
440
|
declare const zCalendarDayVariants: (props?: ({
|
|
441
|
-
state?: "default" | "
|
|
441
|
+
state?: "default" | "today" | "selected" | "inRange" | "rangeStart" | "rangeEnd" | "rangeSingle" | "disabled" | "otherMonth" | "hovered" | null | undefined;
|
|
442
442
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
443
443
|
declare const zCalendarMonthVariants: (props?: ({
|
|
444
|
-
state?: "default" | "
|
|
444
|
+
state?: "default" | "selected" | "disabled" | "current" | null | undefined;
|
|
445
445
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
446
446
|
declare const zCalendarYearVariants: (props?: ({
|
|
447
|
-
state?: "default" | "
|
|
447
|
+
state?: "default" | "selected" | "disabled" | "current" | null | undefined;
|
|
448
448
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
449
449
|
|
|
450
450
|
export { ZCalendarComponent, zCalendarDayVariants, zCalendarMonthVariants, zCalendarVariants, zCalendarYearVariants };
|
|
@@ -169,21 +169,20 @@ declare class ZOverlayService {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
|
-
* Khoá scroll trang khi
|
|
173
|
-
*
|
|
172
|
+
* Khoá scroll trang khi modal/drawer mở — thay `scrollStrategies.block()` của CDK, đếm tham chiếu
|
|
173
|
+
* để modal-trong-modal không mở khoá sớm.
|
|
174
174
|
*
|
|
175
|
-
* Chống layout shift bằng cách
|
|
176
|
-
*
|
|
177
|
-
*
|
|
175
|
+
* Chống layout shift bằng cách GIỮ NGUYÊN gutter của scrollbar thay vì bù trừ sau khi mất nó:
|
|
176
|
+
* đo gutter thật của `<html>`, nếu trang đang dành chỗ cho scrollbar thì gắn `.z-scroll-locked-gutter`
|
|
177
|
+
* để CSS ép `scrollbar-gutter: stable`. Chiều rộng layout không đổi nên không có gì nhảy và scrollbar
|
|
178
|
+
* không bị nhả ra rồi trả lại. Đổi lại layout viewport hẹp hơn 100vw, overlay `fixed` vẫn phủ kín nhờ
|
|
179
|
+
* `.z-overlay-global { contain: paint }` trong `overlay.css`.
|
|
178
180
|
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
* khi `overflow: hidden`, dẫn tới bù thừa và làm UI co lại đúng bằng chiều rộng scrollbar.
|
|
181
|
+
* Safari < 18.4 chưa có `scrollbar-gutter` nên vẫn nhả gutter — phải đo lại sau khi khoá, phần thật sự
|
|
182
|
+
* mất mới bù vào `body.paddingRight` và ghi ra `--z-scroll-lock-gutter` cho app bù tiếp element `fixed`.
|
|
182
183
|
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
* Vị trí scroll vẫn được lưu để khôi phục nếu ứng dụng thay đổi scroll programmatically trong lúc khoá.
|
|
184
|
+
* Phải đo bằng `getBoundingClientRect()`, không dùng `documentElement.clientWidth`: với root element
|
|
185
|
+
* thuộc tính đó trả về kích thước viewport nên luôn cộng thêm chiều rộng scrollbar khi `overflow: hidden`.
|
|
187
186
|
*/
|
|
188
187
|
declare class ZScrollLockService {
|
|
189
188
|
private readonly _document;
|
|
@@ -213,6 +213,7 @@ declare class ZSelectComponent<T = unknown> implements OnInit, ControlValueAcces
|
|
|
213
213
|
protected readonly treeDirection: _angular_core.WritableSignal<"none" | "forward" | "back">;
|
|
214
214
|
protected readonly config: _angular_core.Signal<ZSelectConfig<T>>;
|
|
215
215
|
protected readonly hasAsyncOptions: _angular_core.Signal<boolean>;
|
|
216
|
+
protected readonly hasPaginatedOptions: _angular_core.Signal<boolean>;
|
|
216
217
|
protected readonly sourceOptions: _angular_core.Signal<ZSelectOption<T>[]>;
|
|
217
218
|
protected readonly asyncSelectedOptions: _angular_core.Signal<ZSelectOption<T>[]>;
|
|
218
219
|
protected readonly isLoading: _angular_core.Signal<boolean>;
|
|
@@ -258,7 +259,7 @@ declare class ZSelectComponent<T = unknown> implements OnInit, ControlValueAcces
|
|
|
258
259
|
protected readonly isEmptyData: _angular_core.Signal<boolean>;
|
|
259
260
|
protected readonly isNoSearchResults: _angular_core.Signal<boolean>;
|
|
260
261
|
protected readonly optionsMaxHeight: _angular_core.Signal<number>;
|
|
261
|
-
protected readonly currentStatus: _angular_core.Signal<"default" | "
|
|
262
|
+
protected readonly currentStatus: _angular_core.Signal<"default" | "open" | "error" | "disabled" | "readonly">;
|
|
262
263
|
private readonly _shouldShowValidation;
|
|
263
264
|
protected readonly hasError: _angular_core.Signal<boolean>;
|
|
264
265
|
protected readonly errorMessage: _angular_core.Signal<string>;
|
|
@@ -276,6 +277,7 @@ declare class ZSelectComponent<T = unknown> implements OnInit, ControlValueAcces
|
|
|
276
277
|
private _onTouched;
|
|
277
278
|
private _ngControl;
|
|
278
279
|
private readonly _isNgModel;
|
|
280
|
+
private _pendingServerSearchScrollReset;
|
|
279
281
|
constructor();
|
|
280
282
|
ngOnInit(): void;
|
|
281
283
|
writeValue(value: T | T[] | null): void;
|
|
@@ -369,7 +371,7 @@ declare const TAG_COLORS: ZSelectTagColor[];
|
|
|
369
371
|
declare const zSelectVariants: (props?: ({
|
|
370
372
|
zVariant?: "default" | "ghost" | null | undefined;
|
|
371
373
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
372
|
-
zStatus?: "default" | "
|
|
374
|
+
zStatus?: "default" | "open" | "error" | "disabled" | "readonly" | null | undefined;
|
|
373
375
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
374
376
|
declare const zSelectTagVariants: (props?: ({
|
|
375
377
|
zSize?: "sm" | "default" | "lg" | null | undefined;
|
|
@@ -2168,7 +2168,7 @@ declare class ZTableFilterComponent<T> {
|
|
|
2168
2168
|
protected readonly filterBadgeCount: _angular_core.Signal<number>;
|
|
2169
2169
|
protected readonly hasFilterValue: _angular_core.Signal<boolean>;
|
|
2170
2170
|
protected readonly isActive: _angular_core.Signal<boolean>;
|
|
2171
|
-
protected readonly draftSortValue: _angular_core.Signal<"
|
|
2171
|
+
protected readonly draftSortValue: _angular_core.Signal<"none" | "asc" | "desc">;
|
|
2172
2172
|
protected readonly rangeMinValue: _angular_core.Signal<any>;
|
|
2173
2173
|
protected readonly rangeMaxValue: _angular_core.Signal<any>;
|
|
2174
2174
|
protected readonly dateValue: _angular_core.Signal<Date | null>;
|
|
@@ -2240,7 +2240,7 @@ declare class ZTableActionsComponent<T = unknown> {
|
|
|
2240
2240
|
readonly zConfig: _angular_core.InputSignal<ZTableActionColumnConfig<T>>;
|
|
2241
2241
|
readonly zRow: _angular_core.InputSignal<T>;
|
|
2242
2242
|
readonly zRowId: _angular_core.InputSignal<string>;
|
|
2243
|
-
readonly zDropdownButtonSize: _angular_core.InputSignal<"
|
|
2243
|
+
readonly zDropdownButtonSize: _angular_core.InputSignal<"default" | "sm" | "lg" | "xs" | "xl" | null | undefined>;
|
|
2244
2244
|
readonly zActionClick: _angular_core.OutputEmitterRef<ZTableActionClickEvent<T>>;
|
|
2245
2245
|
protected readonly allActions: _angular_core.Signal<ZTableActionItem<T>[]>;
|
|
2246
2246
|
protected readonly shouldShowAsButtons: _angular_core.Signal<boolean>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ZExcelConfig, ZExcelExportOptions, ZExcelFromTableConfig, ZExcelExportResult } from '@shival99/z-ui/services';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class ZExcelService {
|
|
5
|
+
private static _isHeaderConfig;
|
|
6
|
+
private static _getHeaderConfig;
|
|
7
|
+
exportExcel<T = unknown>(config: ZExcelConfig<T>, options?: ZExcelExportOptions): Promise<void>;
|
|
8
|
+
exportFromTable<T = unknown>(config: ZExcelFromTableConfig<T>, options?: ZExcelExportOptions): Promise<void>;
|
|
9
|
+
exportFromElement(elementId: string, fileName?: string, options?: ZExcelExportOptions): Promise<void>;
|
|
10
|
+
exportFromElementXlsx(elementId: string, fileName?: string, options?: ZExcelExportOptions): Promise<void>;
|
|
11
|
+
static exportExcelStatic<T = unknown>(config: ZExcelConfig<T>): Promise<ZExcelExportResult>;
|
|
12
|
+
static exportFromElementStatic(elementId: string, fileName?: string): Promise<ZExcelExportResult>;
|
|
13
|
+
private _saveFile;
|
|
14
|
+
private _convertTableColumnsToExcel;
|
|
15
|
+
private static _flattenColumns;
|
|
16
|
+
private static _calculateHeaderLevels;
|
|
17
|
+
private static _createHeaderRows;
|
|
18
|
+
private static _buildHeaderStructure;
|
|
19
|
+
private static _getLeafCount;
|
|
20
|
+
private static _getCellValue;
|
|
21
|
+
private static _processMergeRegions;
|
|
22
|
+
private static _applyAutoFitWidth;
|
|
23
|
+
private static _applyAutoFitWidthForTable;
|
|
24
|
+
private static _getMergedColumnSpan;
|
|
25
|
+
private static _calculateCellWidth;
|
|
26
|
+
private static _processTableElement;
|
|
27
|
+
private static _parseContentValue;
|
|
28
|
+
private static _applyCellFormatFromHTML;
|
|
29
|
+
private static _getExcelAlignment;
|
|
30
|
+
private static _getExcelVerticalAlignment;
|
|
31
|
+
private static _formatTimestamp;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ZExcelService, never>;
|
|
33
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { ZExcelService };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ZGalleryOfficeRenderResult } from '@shival99/z-ui/services';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class ZGalleryOfficeRenderService {
|
|
5
|
+
renderDoc(container: HTMLElement, blob: Blob): Promise<ZGalleryOfficeRenderResult>;
|
|
6
|
+
renderSheet(container: HTMLElement, blob: Blob): Promise<ZGalleryOfficeRenderResult>;
|
|
7
|
+
renderSlide(container: HTMLElement, blob: Blob): Promise<ZGalleryOfficeRenderResult>;
|
|
8
|
+
private _toUniverWorkbook;
|
|
9
|
+
private _toUniverCellData;
|
|
10
|
+
private _observeDocxZoom;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ZGalleryOfficeRenderService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { ZGalleryOfficeRenderService };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Type, TemplateRef, ViewContainerRef, EventEmitter, ComponentRef, Signal, InjectionToken } from '@angular/core';
|
|
3
3
|
import { ZOverlayRef } from '@shival99/z-ui/components/z-overlay';
|
|
4
|
-
import { ZFormatNumExcelOptions } from '@shival99/z-ui/utils';
|
|
5
4
|
import { HttpHeaders, HttpContext, HttpParams, HttpClient } from '@angular/common/http';
|
|
6
5
|
import { Router } from '@angular/router';
|
|
7
6
|
import * as rxjs from 'rxjs';
|
|
8
7
|
import { Observable } from 'rxjs';
|
|
9
8
|
import { TranslationObject, TranslateService } from '@ngx-translate/core';
|
|
9
|
+
import { ZFormatNumExcelOptions } from '@shival99/z-ui/utils';
|
|
10
10
|
|
|
11
11
|
interface ZCacheEntry<T = unknown> {
|
|
12
12
|
data: T;
|
|
@@ -155,198 +155,6 @@ declare class ZDynamicService {
|
|
|
155
155
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
type ZExcelAlign = 'left' | 'center' | 'right';
|
|
159
|
-
interface ZExcelTableColumnConfig<T = unknown> {
|
|
160
|
-
id: string;
|
|
161
|
-
visible?: boolean | (() => boolean);
|
|
162
|
-
accessorKey?: keyof T & string;
|
|
163
|
-
accessorFn?: (row: T) => unknown;
|
|
164
|
-
header?: string | {
|
|
165
|
-
content?: string | (() => string);
|
|
166
|
-
align?: ZExcelAlign;
|
|
167
|
-
};
|
|
168
|
-
size?: number;
|
|
169
|
-
columns?: ZExcelTableColumnConfig<T>[];
|
|
170
|
-
}
|
|
171
|
-
interface ZExcelTableHeaderConfig {
|
|
172
|
-
content?: string | (() => string);
|
|
173
|
-
class?: string;
|
|
174
|
-
style?: Record<string, string>;
|
|
175
|
-
align?: string;
|
|
176
|
-
tooltip?: string | object;
|
|
177
|
-
rowSpan?: number;
|
|
178
|
-
colSpan?: number;
|
|
179
|
-
}
|
|
180
|
-
interface ZExcelCell {
|
|
181
|
-
value: unknown;
|
|
182
|
-
font?: {
|
|
183
|
-
name?: string;
|
|
184
|
-
size?: number;
|
|
185
|
-
bold?: boolean;
|
|
186
|
-
italic?: boolean;
|
|
187
|
-
color?: {
|
|
188
|
-
argb?: string;
|
|
189
|
-
};
|
|
190
|
-
};
|
|
191
|
-
fill?: {
|
|
192
|
-
type?: string;
|
|
193
|
-
pattern?: string;
|
|
194
|
-
fgColor?: {
|
|
195
|
-
argb?: string;
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
alignment?: {
|
|
199
|
-
horizontal?: 'left' | 'center' | 'right';
|
|
200
|
-
vertical?: 'top' | 'middle' | 'bottom';
|
|
201
|
-
wrapText?: boolean;
|
|
202
|
-
};
|
|
203
|
-
border?: {
|
|
204
|
-
top?: {
|
|
205
|
-
style?: string;
|
|
206
|
-
};
|
|
207
|
-
left?: {
|
|
208
|
-
style?: string;
|
|
209
|
-
};
|
|
210
|
-
bottom?: {
|
|
211
|
-
style?: string;
|
|
212
|
-
};
|
|
213
|
-
right?: {
|
|
214
|
-
style?: string;
|
|
215
|
-
};
|
|
216
|
-
};
|
|
217
|
-
note?: string;
|
|
218
|
-
numFmt?: string;
|
|
219
|
-
}
|
|
220
|
-
interface ZExcelCellContext<T> {
|
|
221
|
-
row: T;
|
|
222
|
-
rowIndex: number;
|
|
223
|
-
data: T[];
|
|
224
|
-
cell: ZExcelCell;
|
|
225
|
-
}
|
|
226
|
-
interface ZExcelHeaderContext {
|
|
227
|
-
colIndex: number;
|
|
228
|
-
cell: ZExcelCell;
|
|
229
|
-
}
|
|
230
|
-
interface ZExcelColumnConfig<T = unknown> {
|
|
231
|
-
id: string;
|
|
232
|
-
header?: string;
|
|
233
|
-
accessorKey?: keyof T & string;
|
|
234
|
-
accessorFn?: (row: T, rowIndex: number, data: T[]) => unknown;
|
|
235
|
-
width?: number;
|
|
236
|
-
autoFit?: boolean;
|
|
237
|
-
align?: ZExcelAlign;
|
|
238
|
-
headerAlign?: ZExcelAlign;
|
|
239
|
-
rowSpan?: number | ((row: T, rowIndex: number, data: T[]) => number);
|
|
240
|
-
colSpan?: number | ((row: T, rowIndex: number, data: T[]) => number);
|
|
241
|
-
headerRowSpan?: number;
|
|
242
|
-
headerColSpan?: number;
|
|
243
|
-
format?: (context: ZExcelCellContext<T>) => void;
|
|
244
|
-
formatNum?: ZFormatNumExcelOptions;
|
|
245
|
-
formatHeader?: (cell: ZExcelCell) => void;
|
|
246
|
-
note?: (row: T, rowIndex: number, data: T[]) => string | undefined;
|
|
247
|
-
columns?: ZExcelColumnConfig<T>[];
|
|
248
|
-
visible?: boolean;
|
|
249
|
-
}
|
|
250
|
-
interface ZExcelSheetSource<T = unknown> {
|
|
251
|
-
sheetName?: string;
|
|
252
|
-
data: T[];
|
|
253
|
-
}
|
|
254
|
-
interface ZExcelConfig<T = unknown> {
|
|
255
|
-
fileName?: string;
|
|
256
|
-
columns: ZExcelColumnConfig<T>[];
|
|
257
|
-
source: ZExcelSheetSource<T>[];
|
|
258
|
-
}
|
|
259
|
-
interface ZExcelToastHandler {
|
|
260
|
-
success?: (message: string) => void;
|
|
261
|
-
error?: (message: string) => void;
|
|
262
|
-
}
|
|
263
|
-
interface ZExcelExportOptions {
|
|
264
|
-
addTimestamp?: boolean;
|
|
265
|
-
showNotification?: boolean;
|
|
266
|
-
/**
|
|
267
|
-
* Optional toast handler for showing success/error notifications.
|
|
268
|
-
* If not provided, no notifications will be shown.
|
|
269
|
-
*/
|
|
270
|
-
toast?: ZExcelToastHandler;
|
|
271
|
-
}
|
|
272
|
-
interface ZExcelExportResult {
|
|
273
|
-
buffer: ArrayBuffer;
|
|
274
|
-
fileName: string;
|
|
275
|
-
}
|
|
276
|
-
interface ZExcelFontConfig {
|
|
277
|
-
name: string;
|
|
278
|
-
size: number;
|
|
279
|
-
bold?: boolean;
|
|
280
|
-
}
|
|
281
|
-
interface ZExcelHeaderColors {
|
|
282
|
-
level0: string;
|
|
283
|
-
level1: string;
|
|
284
|
-
[key: string]: string;
|
|
285
|
-
}
|
|
286
|
-
interface ZExcelDefaultConfig {
|
|
287
|
-
font: ZExcelFontConfig;
|
|
288
|
-
headerFont: ZExcelFontConfig;
|
|
289
|
-
headerColors: ZExcelHeaderColors;
|
|
290
|
-
}
|
|
291
|
-
type ZTableToExcelColumn<T> = Omit<ZExcelColumnConfig<T>, 'header'> & {
|
|
292
|
-
header?: string | ((col: ZExcelTableColumnConfig<T>) => string);
|
|
293
|
-
};
|
|
294
|
-
interface ZExcelFromTableConfig<T = unknown> {
|
|
295
|
-
fileName?: string;
|
|
296
|
-
tableColumns: ZExcelTableColumnConfig<T>[];
|
|
297
|
-
excelOverrides?: Partial<Record<string, Partial<ZExcelColumnConfig<T>>>>;
|
|
298
|
-
source: ZExcelSheetSource<T>[];
|
|
299
|
-
excludeColumns?: string[];
|
|
300
|
-
headerResolver?: (col: ZExcelTableColumnConfig<T>) => string;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
declare class ZExcelService {
|
|
304
|
-
private static _isHeaderConfig;
|
|
305
|
-
private static _getHeaderConfig;
|
|
306
|
-
exportExcel<T = unknown>(config: ZExcelConfig<T>, options?: ZExcelExportOptions): Promise<void>;
|
|
307
|
-
exportFromTable<T = unknown>(config: ZExcelFromTableConfig<T>, options?: ZExcelExportOptions): Promise<void>;
|
|
308
|
-
exportFromElement(elementId: string, fileName?: string, options?: ZExcelExportOptions): Promise<void>;
|
|
309
|
-
exportFromElementXlsx(elementId: string, fileName?: string, options?: ZExcelExportOptions): Promise<void>;
|
|
310
|
-
static exportExcelStatic<T = unknown>(config: ZExcelConfig<T>): Promise<ZExcelExportResult>;
|
|
311
|
-
static exportFromElementStatic(elementId: string, fileName?: string): Promise<ZExcelExportResult>;
|
|
312
|
-
private _saveFile;
|
|
313
|
-
private _convertTableColumnsToExcel;
|
|
314
|
-
private static _flattenColumns;
|
|
315
|
-
private static _calculateHeaderLevels;
|
|
316
|
-
private static _createHeaderRows;
|
|
317
|
-
private static _buildHeaderStructure;
|
|
318
|
-
private static _getLeafCount;
|
|
319
|
-
private static _getCellValue;
|
|
320
|
-
private static _processMergeRegions;
|
|
321
|
-
private static _applyAutoFitWidth;
|
|
322
|
-
private static _applyAutoFitWidthForTable;
|
|
323
|
-
private static _getMergedColumnSpan;
|
|
324
|
-
private static _calculateCellWidth;
|
|
325
|
-
private static _processTableElement;
|
|
326
|
-
private static _parseContentValue;
|
|
327
|
-
private static _applyCellFormatFromHTML;
|
|
328
|
-
private static _getExcelAlignment;
|
|
329
|
-
private static _getExcelVerticalAlignment;
|
|
330
|
-
private static _formatTimestamp;
|
|
331
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ZExcelService, never>;
|
|
332
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
interface ZGalleryOfficeRenderResult {
|
|
336
|
-
dispose: () => void;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
declare class ZGalleryOfficeRenderService {
|
|
340
|
-
renderDoc(container: HTMLElement, blob: Blob): Promise<ZGalleryOfficeRenderResult>;
|
|
341
|
-
renderSheet(container: HTMLElement, blob: Blob): Promise<ZGalleryOfficeRenderResult>;
|
|
342
|
-
renderSlide(container: HTMLElement, blob: Blob): Promise<ZGalleryOfficeRenderResult>;
|
|
343
|
-
private _toUniverWorkbook;
|
|
344
|
-
private _toUniverCellData;
|
|
345
|
-
private _observeDocxZoom;
|
|
346
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ZGalleryOfficeRenderService, never>;
|
|
347
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
158
|
type ZHttpParamsType<T> = {
|
|
351
159
|
[K in keyof T]: string | number | boolean | ReadonlyArray<string | number | boolean>;
|
|
352
160
|
};
|
|
@@ -752,6 +560,151 @@ declare function zStripLegacyScopedCacheKey(key: string): string;
|
|
|
752
560
|
declare const Z_DYNAMIC_DATA: InjectionToken<unknown>;
|
|
753
561
|
declare const Z_DYNAMIC_ANIMATION_DURATION = 150;
|
|
754
562
|
|
|
563
|
+
type ZExcelAlign = 'left' | 'center' | 'right';
|
|
564
|
+
interface ZExcelTableColumnConfig<T = unknown> {
|
|
565
|
+
id: string;
|
|
566
|
+
visible?: boolean | (() => boolean);
|
|
567
|
+
accessorKey?: keyof T & string;
|
|
568
|
+
accessorFn?: (row: T) => unknown;
|
|
569
|
+
header?: string | {
|
|
570
|
+
content?: string | (() => string);
|
|
571
|
+
align?: ZExcelAlign;
|
|
572
|
+
};
|
|
573
|
+
size?: number;
|
|
574
|
+
columns?: ZExcelTableColumnConfig<T>[];
|
|
575
|
+
}
|
|
576
|
+
interface ZExcelTableHeaderConfig {
|
|
577
|
+
content?: string | (() => string);
|
|
578
|
+
class?: string;
|
|
579
|
+
style?: Record<string, string>;
|
|
580
|
+
align?: string;
|
|
581
|
+
tooltip?: string | object;
|
|
582
|
+
rowSpan?: number;
|
|
583
|
+
colSpan?: number;
|
|
584
|
+
}
|
|
585
|
+
interface ZExcelCell {
|
|
586
|
+
value: unknown;
|
|
587
|
+
font?: {
|
|
588
|
+
name?: string;
|
|
589
|
+
size?: number;
|
|
590
|
+
bold?: boolean;
|
|
591
|
+
italic?: boolean;
|
|
592
|
+
color?: {
|
|
593
|
+
argb?: string;
|
|
594
|
+
};
|
|
595
|
+
};
|
|
596
|
+
fill?: {
|
|
597
|
+
type?: string;
|
|
598
|
+
pattern?: string;
|
|
599
|
+
fgColor?: {
|
|
600
|
+
argb?: string;
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
alignment?: {
|
|
604
|
+
horizontal?: 'left' | 'center' | 'right';
|
|
605
|
+
vertical?: 'top' | 'middle' | 'bottom';
|
|
606
|
+
wrapText?: boolean;
|
|
607
|
+
};
|
|
608
|
+
border?: {
|
|
609
|
+
top?: {
|
|
610
|
+
style?: string;
|
|
611
|
+
};
|
|
612
|
+
left?: {
|
|
613
|
+
style?: string;
|
|
614
|
+
};
|
|
615
|
+
bottom?: {
|
|
616
|
+
style?: string;
|
|
617
|
+
};
|
|
618
|
+
right?: {
|
|
619
|
+
style?: string;
|
|
620
|
+
};
|
|
621
|
+
};
|
|
622
|
+
note?: string;
|
|
623
|
+
numFmt?: string;
|
|
624
|
+
}
|
|
625
|
+
interface ZExcelCellContext<T> {
|
|
626
|
+
row: T;
|
|
627
|
+
rowIndex: number;
|
|
628
|
+
data: T[];
|
|
629
|
+
cell: ZExcelCell;
|
|
630
|
+
}
|
|
631
|
+
interface ZExcelHeaderContext {
|
|
632
|
+
colIndex: number;
|
|
633
|
+
cell: ZExcelCell;
|
|
634
|
+
}
|
|
635
|
+
interface ZExcelColumnConfig<T = unknown> {
|
|
636
|
+
id: string;
|
|
637
|
+
header?: string;
|
|
638
|
+
accessorKey?: keyof T & string;
|
|
639
|
+
accessorFn?: (row: T, rowIndex: number, data: T[]) => unknown;
|
|
640
|
+
width?: number;
|
|
641
|
+
autoFit?: boolean;
|
|
642
|
+
align?: ZExcelAlign;
|
|
643
|
+
headerAlign?: ZExcelAlign;
|
|
644
|
+
rowSpan?: number | ((row: T, rowIndex: number, data: T[]) => number);
|
|
645
|
+
colSpan?: number | ((row: T, rowIndex: number, data: T[]) => number);
|
|
646
|
+
headerRowSpan?: number;
|
|
647
|
+
headerColSpan?: number;
|
|
648
|
+
format?: (context: ZExcelCellContext<T>) => void;
|
|
649
|
+
formatNum?: ZFormatNumExcelOptions;
|
|
650
|
+
formatHeader?: (cell: ZExcelCell) => void;
|
|
651
|
+
note?: (row: T, rowIndex: number, data: T[]) => string | undefined;
|
|
652
|
+
columns?: ZExcelColumnConfig<T>[];
|
|
653
|
+
visible?: boolean;
|
|
654
|
+
}
|
|
655
|
+
interface ZExcelSheetSource<T = unknown> {
|
|
656
|
+
sheetName?: string;
|
|
657
|
+
data: T[];
|
|
658
|
+
}
|
|
659
|
+
interface ZExcelConfig<T = unknown> {
|
|
660
|
+
fileName?: string;
|
|
661
|
+
columns: ZExcelColumnConfig<T>[];
|
|
662
|
+
source: ZExcelSheetSource<T>[];
|
|
663
|
+
}
|
|
664
|
+
interface ZExcelToastHandler {
|
|
665
|
+
success?: (message: string) => void;
|
|
666
|
+
error?: (message: string) => void;
|
|
667
|
+
}
|
|
668
|
+
interface ZExcelExportOptions {
|
|
669
|
+
addTimestamp?: boolean;
|
|
670
|
+
showNotification?: boolean;
|
|
671
|
+
/**
|
|
672
|
+
* Optional toast handler for showing success/error notifications.
|
|
673
|
+
* If not provided, no notifications will be shown.
|
|
674
|
+
*/
|
|
675
|
+
toast?: ZExcelToastHandler;
|
|
676
|
+
}
|
|
677
|
+
interface ZExcelExportResult {
|
|
678
|
+
buffer: ArrayBuffer;
|
|
679
|
+
fileName: string;
|
|
680
|
+
}
|
|
681
|
+
interface ZExcelFontConfig {
|
|
682
|
+
name: string;
|
|
683
|
+
size: number;
|
|
684
|
+
bold?: boolean;
|
|
685
|
+
}
|
|
686
|
+
interface ZExcelHeaderColors {
|
|
687
|
+
level0: string;
|
|
688
|
+
level1: string;
|
|
689
|
+
[key: string]: string;
|
|
690
|
+
}
|
|
691
|
+
interface ZExcelDefaultConfig {
|
|
692
|
+
font: ZExcelFontConfig;
|
|
693
|
+
headerFont: ZExcelFontConfig;
|
|
694
|
+
headerColors: ZExcelHeaderColors;
|
|
695
|
+
}
|
|
696
|
+
type ZTableToExcelColumn<T> = Omit<ZExcelColumnConfig<T>, 'header'> & {
|
|
697
|
+
header?: string | ((col: ZExcelTableColumnConfig<T>) => string);
|
|
698
|
+
};
|
|
699
|
+
interface ZExcelFromTableConfig<T = unknown> {
|
|
700
|
+
fileName?: string;
|
|
701
|
+
tableColumns: ZExcelTableColumnConfig<T>[];
|
|
702
|
+
excelOverrides?: Partial<Record<string, Partial<ZExcelColumnConfig<T>>>>;
|
|
703
|
+
source: ZExcelSheetSource<T>[];
|
|
704
|
+
excludeColumns?: string[];
|
|
705
|
+
headerResolver?: (col: ZExcelTableColumnConfig<T>) => string;
|
|
706
|
+
}
|
|
707
|
+
|
|
755
708
|
declare const Z_EXCEL_COLORS: {
|
|
756
709
|
readonly 'green-50': "FFF0FDF4";
|
|
757
710
|
readonly 'green-100': "FFDCFCE7";
|
|
@@ -814,6 +767,10 @@ declare const Z_INDEXDB_MAX_VERSION = 1000;
|
|
|
814
767
|
|
|
815
768
|
declare const Z_LANG_TO_LOCALE: Record<string, string>;
|
|
816
769
|
|
|
770
|
+
interface ZGalleryOfficeRenderResult {
|
|
771
|
+
dispose: () => void;
|
|
772
|
+
}
|
|
773
|
+
|
|
817
774
|
interface ZTranslateConfig {
|
|
818
775
|
/** Default language */
|
|
819
776
|
defaultLang?: string;
|
|
@@ -830,5 +787,5 @@ interface ZTranslateI18nConfig {
|
|
|
830
787
|
}
|
|
831
788
|
declare const Z_LANG_CACHE_KEY = "Z_LANGUAGE";
|
|
832
789
|
|
|
833
|
-
export { ZCacheService, ZDynamicRef, ZDynamicService,
|
|
790
|
+
export { ZCacheService, ZDynamicRef, ZDynamicService, ZHttpAbstractService, ZIndexDbService, ZOverlayContainerService, ZOverlayZIndexService, ZSubjectService, ZThemeService, ZTranslateService, Z_CACHE_DEFAULT_PREFIX, Z_CACHE_SCOPE_SEPARATOR, Z_DB_SCOPE_SEPARATOR, Z_DEFAULT_THEME, Z_DYNAMIC_ANIMATION_DURATION, Z_DYNAMIC_DATA, Z_EXCEL_BORDER_THIN, Z_EXCEL_CHAR_WIDTH_MAP, Z_EXCEL_COLORS, Z_EXCEL_DEFAULT_CONFIG, Z_EXCEL_FONT_MULTIPLIERS, Z_EXCEL_WIDTH_LIMITS, Z_HTTP_DEFAULT_CONFIG, Z_INDEXDB_BATCH_SIZE, Z_INDEXDB_DEFAULT_CONFIG, Z_INDEXDB_MAX_VERSION, Z_LANG_CACHE_KEY, Z_LANG_TO_LOCALE, Z_STORAGE_SCOPE_FALLBACK, Z_THEME_CONFIG, Z_THEME_CSS_MAP, Z_THEME_PREFERENCES_CACHE_KEY, zBuildLegacyScopedCacheKey, zBuildLegacyScopedDbName, zBuildScopedCacheKey, zBuildScopedDbName, zConfigureStorageAppName, zGetStorageAppName, zNormalizeStorageAppName, zStripLegacyScopedCacheKey, zStripScopedCacheKey };
|
|
834
791
|
export type { ZCacheConfig, ZCacheEntry, ZDynamicContent, ZDynamicOptions, ZDynamicResult, ZDynamicTemplateContext, ZExcelAlign, ZExcelCell, ZExcelCellContext, ZExcelColumnConfig, ZExcelConfig, ZExcelDefaultConfig, ZExcelExportOptions, ZExcelExportResult, ZExcelFontConfig, ZExcelFromTableConfig, ZExcelHeaderColors, ZExcelHeaderContext, ZExcelSheetSource, ZExcelTableColumnConfig, ZExcelTableHeaderConfig, ZExcelToastHandler, ZGalleryOfficeRenderResult, ZHttpBaseOptions, ZHttpCacheEntry, ZHttpConfig, ZHttpContentType, ZHttpError, ZHttpNetworkCheck, ZHttpOptions, ZHttpParamsType, ZIndexDbConfig, ZIndexDbGetOptions, ZIndexDbSetOptions, ZIndexDbStoreConfig, ZTableToExcelColumn, ZThemeConfig, ZThemeName, ZThemePreferences, ZTranslateConfig, ZTranslateI18nConfig };
|