@shival99/z-ui 1.9.21 → 1.9.23
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/fesm2022/shival99-z-ui-components-z-accordion.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-accordion.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs +106 -247
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-editor.mjs +5 -0
- package/fesm2022/shival99-z-ui-components-z-editor.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs +109 -6
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-input.mjs +5 -0
- package/fesm2022/shival99-z-ui-components-z-input.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-menu.mjs +318 -2
- package/fesm2022/shival99-z-ui-components-z-menu.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-select.mjs +5 -0
- package/fesm2022/shival99-z-ui-components-z-select.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs +15 -10
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-tags.mjs +36 -9
- package/fesm2022/shival99-z-ui-components-z-tags.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-upload.mjs +5 -0
- package/fesm2022/shival99-z-ui-components-z-upload.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-i18n.mjs +8 -0
- package/fesm2022/shival99-z-ui-i18n.mjs.map +1 -1
- package/package.json +2 -2
- package/types/shival99-z-ui-components-z-calendar.d.ts +11 -1
- package/types/shival99-z-ui-components-z-editor.d.ts +8 -1
- package/types/shival99-z-ui-components-z-gallery.d.ts +38 -3
- package/types/shival99-z-ui-components-z-input.d.ts +8 -1
- package/types/shival99-z-ui-components-z-menu.d.ts +67 -2
- package/types/shival99-z-ui-components-z-select.d.ts +8 -1
- package/types/shival99-z-ui-components-z-tabs.d.ts +3 -2
- package/types/shival99-z-ui-components-z-tags.d.ts +11 -1
- package/types/shival99-z-ui-components-z-upload.d.ts +8 -0
|
@@ -299,6 +299,7 @@ class ZEditorComponent {
|
|
|
299
299
|
setValue(content) {
|
|
300
300
|
this.setContent(content);
|
|
301
301
|
}
|
|
302
|
+
/** @deprecated Use `valid()` for boolean form-submit checks. */
|
|
302
303
|
validate() {
|
|
303
304
|
this.uiState.update(s => ({ ...s, touched: true, dirty: true }));
|
|
304
305
|
this._onTouched();
|
|
@@ -308,6 +309,9 @@ class ZEditorComponent {
|
|
|
308
309
|
}
|
|
309
310
|
return this.hasError();
|
|
310
311
|
}
|
|
312
|
+
valid() {
|
|
313
|
+
return !this.validate();
|
|
314
|
+
}
|
|
311
315
|
reset() {
|
|
312
316
|
this._value.set('');
|
|
313
317
|
this.uiState.update(s => ({ ...s, touched: false, dirty: false }));
|
|
@@ -327,6 +331,7 @@ class ZEditorComponent {
|
|
|
327
331
|
getContent: () => this.getContent(),
|
|
328
332
|
getText: () => this.getText(),
|
|
329
333
|
getLength: () => this.getLength(),
|
|
334
|
+
valid: () => this.valid(),
|
|
330
335
|
validate: () => this.validate(),
|
|
331
336
|
reset: () => this.reset(),
|
|
332
337
|
setValue: (content) => this.setValue(content),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shival99-z-ui-components-z-editor.mjs","sources":["../../../../libs/core-ui/components/z-editor/z-editor.variants.ts","../../../../libs/core-ui/components/z-editor/z-editor.component.ts","../../../../libs/core-ui/components/z-editor/shival99-z-ui-components-z-editor.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const zEditorVariants = cva(\n [\n 'z-editor block w-full rounded-[0.375rem] border border-input bg-white shadow-xs',\n 'transition-[border-color,box-shadow,background-color,color,opacity] duration-200',\n 'dark:bg-input/30 dark:border-input',\n 'outline-none',\n ],\n {\n variants: {\n zSize: {\n sm: '[&_.ql-editor]:min-h-24 [&_.ql-editor]:text-sm',\n default: '[&_.ql-editor]:min-h-40 [&_.ql-editor]:text-sm',\n lg: '[&_.ql-editor]:min-h-60 [&_.ql-editor]:text-base',\n },\n zStatus: {\n default: 'focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]',\n error:\n 'border-destructive! ring-destructive/20 ring-[3px] focus-within:border-destructive! focus-within:ring-destructive/30',\n disabled: 'opacity-50 cursor-not-allowed bg-muted! text-muted-foreground',\n readonly: 'bg-muted/50! text-muted-foreground cursor-default',\n },\n },\n defaultVariants: {\n zSize: 'default',\n zStatus: 'default',\n },\n }\n);\n\nexport type ZEditorVariants = VariantProps<typeof zEditorVariants>;\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n forwardRef,\n inject,\n Injector,\n input,\n type OnInit,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n type AbstractControl,\n ControlValueAccessor,\n NG_VALUE_ACCESSOR,\n NgControl,\n NgModel,\n PristineChangeEvent,\n ReactiveFormsModule,\n TouchedChangeEvent,\n} from '@angular/forms';\nimport { FormsModule } from '@angular/forms';\nimport { ZTranslateService } from '@shival99/z-ui/services';\nimport { zUuid, zMergeClasses, zTransform, zCreateEvent, type ZEvent } from '@shival99/z-ui/utils';\nimport type { ClassValue } from 'clsx';\nimport { ContentChange, QuillEditorComponent, QuillModule, type QuillModules } from 'ngx-quill';\nimport Quill from 'quill';\nimport QuillResizeImage from 'quill-resize-image';\nimport { filter, merge } from 'rxjs';\nimport type { ZEditorControl, ZEditorSize, ZEditorValidator } from './z-editor.types';\nimport { zEditorVariants } from './z-editor.variants';\n\nQuill.register('modules/resize', QuillResizeImage);\nconst DEFAULT_TOOLBAR = [\n ['bold', 'italic', 'underline', 'strike'],\n ['blockquote', 'code-block'],\n [{ header: 1 }, { header: 2 }],\n [{ list: 'ordered' }, { list: 'bullet' }],\n [{ indent: '-1' }, { indent: '+1' }],\n [{ align: [] }],\n [{ color: [] }, { background: [] }],\n ['link', 'image'],\n ['clean'],\n];\n\n@Component({\n selector: 'z-editor',\n imports: [QuillModule, ReactiveFormsModule, FormsModule],\n standalone: true,\n template: `\n <div [class]=\"wrapperClasses()\" [class.z-editor-disabled]=\"isDisabled()\" [class.z-editor-readonly]=\"zReadonly()\">\n @if (zLabel()) {\n <label [for]=\"editorId\" class=\"text-xs leading-none font-medium\" [class]=\"zLabelClass()\">\n {{ zLabel() }}\n @if (zRequired()) {\n <span class=\"text-destructive! ml-0.5\">*</span>\n }\n </label>\n }\n\n <quill-editor\n [id]=\"editorId\"\n [class]=\"editorClasses()\"\n [modules]=\"effectiveModules()\"\n [placeholder]=\"effectivePlaceholder()\"\n [readOnly]=\"isDisabled() || zReadonly()\"\n [formats]=\"zFormats()\"\n [bounds]=\"zBounds()\"\n [theme]=\"zTheme()\"\n [ngModel]=\"_value()\"\n (onContentChanged)=\"onContentChange($event)\"\n (onFocus)=\"onFocus()\"\n (onBlur)=\"onBlur()\"\n />\n\n @if (hasError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 text-xs duration-200\">\n {{ errorMessage() }}\n </p>\n }\n </div>\n `,\n styleUrl: './z-editor.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ZEditorComponent),\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'zEditor',\n})\nexport class ZEditorComponent implements OnInit, ControlValueAccessor {\n private readonly _injector = inject(Injector);\n private readonly _destroyRef = inject(DestroyRef);\n private readonly _zTranslate = inject(ZTranslateService);\n\n public readonly zOnChange = output<string>();\n public readonly zOnFocus = output<FocusEvent>();\n public readonly zOnBlur = output<FocusEvent>();\n public readonly zControl = output<ZEditorControl>();\n public readonly zEvent = output<ZEvent>();\n\n public readonly class = input<ClassValue>('');\n public readonly zSize = input<ZEditorSize>('default');\n public readonly zLabel = input<string>('');\n public readonly zLabelClass = input<string>('');\n public readonly zPlaceholder = input<string>('');\n public readonly zRequired = input(false, { transform: zTransform });\n public readonly zDisabled = input(false, { transform: zTransform });\n public readonly zReadonly = input(false, { transform: zTransform });\n public readonly zModules = input<QuillModules | null>(null);\n public readonly zFormats = input<string[] | null>(null);\n public readonly zBounds = input<string | HTMLElement>('document.body');\n public readonly zTheme = input<'snow' | 'bubble'>('snow');\n public readonly zValidators = input<ZEditorValidator[]>([]);\n\n protected readonly editorId = zUuid('z-editor');\n\n protected readonly _value = signal<string>('');\n private readonly _disabled = signal(false);\n private readonly _formControl = signal<AbstractControl | null>(null);\n private readonly _formStateVersion = signal(0);\n private readonly _isNgModel = signal(false);\n\n protected readonly uiState = signal({\n touched: false,\n dirty: false,\n });\n\n private readonly _customError = signal<string | null>(null);\n\n private _onChange: (value: string) => void = () => void 0;\n private _onTouched: () => void = () => void 0;\n private _ngControl: NgControl | null = null;\n private _editorInstance: QuillEditorComponent | null = null;\n\n protected readonly isDisabled = computed(() => this._disabled() || this.zDisabled());\n protected readonly effectivePlaceholder = computed(() => {\n this._zTranslate.currentLang();\n return this.zPlaceholder() || this._zTranslate.instant('i18n_z_ui_editor_placeholder');\n });\n\n protected readonly effectiveModules = computed<QuillModules>(() => {\n const customModules = this.zModules();\n if (customModules) {\n return customModules;\n }\n\n return {\n toolbar: DEFAULT_TOOLBAR,\n resize: {\n locale: {},\n },\n history: {\n delay: 1000,\n maxStack: 50,\n userOnly: true,\n },\n };\n });\n\n private readonly _shouldShowValidation = computed(() => {\n const control = this._formControl();\n this._formStateVersion();\n\n if (this._isNgModel()) {\n return this.uiState().dirty || this.uiState().touched;\n }\n\n if (control) {\n return control.dirty;\n }\n\n return this.uiState().dirty || this.uiState().touched;\n });\n\n private _getValidationErrors(): string[] {\n const errors: string[] = [];\n const value = this._value();\n const validators = this.zValidators();\n\n if (!this._shouldShowValidation()) {\n return errors;\n }\n\n // Check zRequired independently (works with ngModel without formControlName)\n const isRequired = this.zRequired() || this._formControl()?.errors?.['required'];\n if (isRequired && (!value || value.trim() === '' || value === '<p><br></p>')) {\n this._zTranslate.currentLang();\n errors.push(this._zTranslate.instant('i18n_z_ui_editor_required'));\n }\n\n for (const validator of validators) {\n // Skip required check here since we already checked above\n if (validator.error === 'required') {\n continue;\n }\n\n if (validator.minLength && value.length < validator.minLength) {\n errors.push(validator.message);\n continue;\n }\n\n if (validator.maxLength && value.length > validator.maxLength) {\n errors.push(validator.message);\n continue;\n }\n\n if (validator.pattern && !validator.pattern.test(value)) {\n errors.push(validator.message);\n }\n }\n\n return errors;\n }\n\n protected readonly hasError = computed(() => {\n // Custom error from setErrorMessage takes priority\n if (this._customError()) {\n return true;\n }\n\n const customErrors = this._getValidationErrors();\n if (customErrors.length > 0) {\n return true;\n }\n\n const control = this._formControl();\n this._formStateVersion();\n\n if (!control) {\n return false;\n }\n\n return control.invalid && this._shouldShowValidation();\n });\n\n protected readonly errorMessage = computed(() => {\n // Custom error from setErrorMessage takes priority\n const customError = this._customError();\n if (customError) {\n return customError;\n }\n\n const customErrors = this._getValidationErrors();\n if (customErrors.length > 0) {\n return customErrors[0];\n }\n\n const control = this._formControl();\n const errors = control?.errors;\n\n if (!errors) {\n return '';\n }\n\n this._zTranslate.currentLang();\n if (errors['required']) {\n return this._zTranslate.instant('i18n_z_ui_editor_required');\n }\n\n if (errors['minlength']) {\n return this._zTranslate.instant('i18n_z_ui_editor_min_length', {\n min: errors['minlength'].requiredLength,\n });\n }\n\n if (errors['maxlength']) {\n return this._zTranslate.instant('i18n_z_ui_editor_max_length', {\n max: errors['maxlength'].requiredLength,\n });\n }\n\n return this._zTranslate.instant('i18n_z_ui_editor_invalid');\n });\n\n protected readonly currentStatus = computed(() => {\n if (this.isDisabled()) {\n return 'disabled';\n }\n\n if (this.zReadonly()) {\n return 'readonly';\n }\n\n if (this.hasError()) {\n return 'error';\n }\n\n return 'default';\n });\n\n protected readonly wrapperClasses = computed(() => 'z-editor-wrapper flex w-full flex-col gap-2');\n\n protected readonly labelClasses = computed(() =>\n zMergeClasses('mb-1.5 block text-sm font-medium text-foreground', this.zLabelClass())\n );\n\n protected readonly editorClasses = computed(() =>\n zMergeClasses(\n zEditorVariants({\n zSize: this.zSize(),\n zStatus: this.currentStatus(),\n }),\n this.class()\n )\n );\n\n ngOnInit(): void {\n queueMicrotask(() => {\n try {\n this._ngControl = this._injector.get(NgControl, null);\n this._isNgModel.set(this._ngControl instanceof NgModel);\n\n if (this._ngControl?.control) {\n const { control } = this._ngControl;\n this._formControl.set(control);\n merge(\n control.statusChanges,\n control.valueChanges,\n control.events.pipe(\n filter(event => event instanceof PristineChangeEvent || event instanceof TouchedChangeEvent)\n )\n )\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n this._formStateVersion.update(v => v + 1);\n });\n }\n } catch {\n this._ngControl = null;\n }\n });\n\n setTimeout(() => this._emitControl());\n }\n\n public writeValue(value: string): void {\n this._value.set(value || '');\n }\n\n public registerOnChange(fn: (value: string) => void): void {\n this._onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n public setDisabledState(isDisabled: boolean): void {\n this._disabled.set(isDisabled);\n }\n\n protected onContentChange(event: ContentChange): void {\n const html = event.html || '';\n this._value.set(html);\n this.uiState.update(s => ({ ...s, dirty: true }));\n this._onChange(html);\n this.zOnChange.emit(html);\n }\n\n protected onFocus(): void {\n const focusEvent = new FocusEvent('focus');\n this.zOnFocus.emit(focusEvent);\n this.zEvent.emit(zCreateEvent('focus', focusEvent));\n }\n\n protected onBlur(): void {\n if (this.uiState().dirty) {\n this.uiState.update(s => ({ ...s, touched: true }));\n }\n\n this._onTouched();\n const blurEvent = new FocusEvent('blur');\n this.zOnBlur.emit(blurEvent);\n this.zEvent.emit(zCreateEvent('blur', blurEvent));\n }\n\n public focus(): void {\n this._editorInstance?.quillEditor?.focus();\n }\n\n public blur(): void {\n this._editorInstance?.quillEditor?.blur();\n }\n\n public clear(): void {\n this._value.set('');\n this._onChange('');\n }\n\n public setContent(content: string): void {\n this._value.set(content);\n this._onChange(content);\n }\n\n public getContent(): string {\n return this._value();\n }\n\n public getText(): string {\n return this._editorInstance?.quillEditor?.getText() || '';\n }\n\n public getLength(): number {\n return this._editorInstance?.quillEditor?.getLength() || 0;\n }\n\n public setErrorMessage(message: string | null): void {\n this._customError.set(message);\n }\n\n public setValue(content: string): void {\n this.setContent(content);\n }\n\n public validate(): boolean {\n this.uiState.update(s => ({ ...s, touched: true, dirty: true }));\n this._onTouched();\n\n if (this._ngControl?.control) {\n this._ngControl.control.markAsDirty();\n this._ngControl.control.markAsTouched();\n }\n\n return this.hasError();\n }\n\n public reset(): void {\n this._value.set('');\n this.uiState.update(s => ({ ...s, touched: false, dirty: false }));\n this._customError.set(null);\n this._onChange('');\n\n if (this._ngControl?.control) {\n this._ngControl.control.markAsPristine();\n this._ngControl.control.markAsUntouched();\n }\n }\n\n private _emitControl(): void {\n this.zControl.emit({\n focus: () => this.focus(),\n blur: () => this.blur(),\n clear: () => this.clear(),\n setContent: (content: string) => this.setContent(content),\n getContent: () => this.getContent(),\n getText: () => this.getText(),\n getLength: () => this.getLength(),\n validate: () => this.validate(),\n reset: () => this.reset(),\n setValue: (content: string) => this.setValue(content),\n setErrorMessage: (message: string | null) => this.setErrorMessage(message),\n hasError: this.hasError,\n value: this._value.asReadonly(),\n errorMessage: this.errorMessage,\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAEO,MAAM,eAAe,GAAG,GAAG,CAChC;IACE,iFAAiF;IACjF,kFAAkF;IAClF,oCAAoC;IACpC,cAAc;CACf,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,KAAK,EAAE;AACL,YAAA,EAAE,EAAE,gDAAgD;AACpD,YAAA,OAAO,EAAE,gDAAgD;AACzD,YAA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A,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FA+C5C,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAjD5B,SAAS;+BACE,UAAU,EAAA,OAAA,EACX,CAAC,WAAW,EAAE,mBAAmB,EAAE,WAAW,CAAC,EAAA,UAAA,EAC5C,IAAI,EAAA,QAAA,EACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCT,EAAA,SAAA,EAEU;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,sBAAsB,CAAC;AAC/C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;qBACF,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,YAC3B,SAAS,EAAA,MAAA,EAAA,CAAA,+p8BAAA,CAAA,EAAA;;;AChGrB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"shival99-z-ui-components-z-editor.mjs","sources":["../../../../libs/core-ui/components/z-editor/z-editor.variants.ts","../../../../libs/core-ui/components/z-editor/z-editor.component.ts","../../../../libs/core-ui/components/z-editor/shival99-z-ui-components-z-editor.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const zEditorVariants = cva(\n [\n 'z-editor block w-full rounded-[0.375rem] border border-input bg-white shadow-xs',\n 'transition-[border-color,box-shadow,background-color,color,opacity] duration-200',\n 'dark:bg-input/30 dark:border-input',\n 'outline-none',\n ],\n {\n variants: {\n zSize: {\n sm: '[&_.ql-editor]:min-h-24 [&_.ql-editor]:text-sm',\n default: '[&_.ql-editor]:min-h-40 [&_.ql-editor]:text-sm',\n lg: '[&_.ql-editor]:min-h-60 [&_.ql-editor]:text-base',\n },\n zStatus: {\n default: 'focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]',\n error:\n 'border-destructive! ring-destructive/20 ring-[3px] focus-within:border-destructive! focus-within:ring-destructive/30',\n disabled: 'opacity-50 cursor-not-allowed bg-muted! text-muted-foreground',\n readonly: 'bg-muted/50! text-muted-foreground cursor-default',\n },\n },\n defaultVariants: {\n zSize: 'default',\n zStatus: 'default',\n },\n }\n);\n\nexport type ZEditorVariants = VariantProps<typeof zEditorVariants>;\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n forwardRef,\n inject,\n Injector,\n input,\n type OnInit,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n type AbstractControl,\n ControlValueAccessor,\n NG_VALUE_ACCESSOR,\n NgControl,\n NgModel,\n PristineChangeEvent,\n ReactiveFormsModule,\n TouchedChangeEvent,\n} from '@angular/forms';\nimport { FormsModule } from '@angular/forms';\nimport { ZTranslateService } from '@shival99/z-ui/services';\nimport { zUuid, zMergeClasses, zTransform, zCreateEvent, type ZEvent } from '@shival99/z-ui/utils';\nimport type { ClassValue } from 'clsx';\nimport { ContentChange, QuillEditorComponent, QuillModule, type QuillModules } from 'ngx-quill';\nimport Quill from 'quill';\nimport QuillResizeImage from 'quill-resize-image';\nimport { filter, merge } from 'rxjs';\nimport type { ZEditorControl, ZEditorSize, ZEditorValidator } from './z-editor.types';\nimport { zEditorVariants } from './z-editor.variants';\n\nQuill.register('modules/resize', QuillResizeImage);\nconst DEFAULT_TOOLBAR = [\n ['bold', 'italic', 'underline', 'strike'],\n ['blockquote', 'code-block'],\n [{ header: 1 }, { header: 2 }],\n [{ list: 'ordered' }, { list: 'bullet' }],\n [{ indent: '-1' }, { indent: '+1' }],\n [{ align: [] }],\n [{ color: [] }, { background: [] }],\n ['link', 'image'],\n ['clean'],\n];\n\n@Component({\n selector: 'z-editor',\n imports: [QuillModule, ReactiveFormsModule, FormsModule],\n standalone: true,\n template: `\n <div [class]=\"wrapperClasses()\" [class.z-editor-disabled]=\"isDisabled()\" [class.z-editor-readonly]=\"zReadonly()\">\n @if (zLabel()) {\n <label [for]=\"editorId\" class=\"text-xs leading-none font-medium\" [class]=\"zLabelClass()\">\n {{ zLabel() }}\n @if (zRequired()) {\n <span class=\"text-destructive! ml-0.5\">*</span>\n }\n </label>\n }\n\n <quill-editor\n [id]=\"editorId\"\n [class]=\"editorClasses()\"\n [modules]=\"effectiveModules()\"\n [placeholder]=\"effectivePlaceholder()\"\n [readOnly]=\"isDisabled() || zReadonly()\"\n [formats]=\"zFormats()\"\n [bounds]=\"zBounds()\"\n [theme]=\"zTheme()\"\n [ngModel]=\"_value()\"\n (onContentChanged)=\"onContentChange($event)\"\n (onFocus)=\"onFocus()\"\n (onBlur)=\"onBlur()\"\n />\n\n @if (hasError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 text-xs duration-200\">\n {{ errorMessage() }}\n </p>\n }\n </div>\n `,\n styleUrl: './z-editor.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ZEditorComponent),\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'zEditor',\n})\nexport class ZEditorComponent implements OnInit, ControlValueAccessor {\n private readonly _injector = inject(Injector);\n private readonly _destroyRef = inject(DestroyRef);\n private readonly _zTranslate = inject(ZTranslateService);\n\n public readonly zOnChange = output<string>();\n public readonly zOnFocus = output<FocusEvent>();\n public readonly zOnBlur = output<FocusEvent>();\n public readonly zControl = output<ZEditorControl>();\n public readonly zEvent = output<ZEvent>();\n\n public readonly class = input<ClassValue>('');\n public readonly zSize = input<ZEditorSize>('default');\n public readonly zLabel = input<string>('');\n public readonly zLabelClass = input<string>('');\n public readonly zPlaceholder = input<string>('');\n public readonly zRequired = input(false, { transform: zTransform });\n public readonly zDisabled = input(false, { transform: zTransform });\n public readonly zReadonly = input(false, { transform: zTransform });\n public readonly zModules = input<QuillModules | null>(null);\n public readonly zFormats = input<string[] | null>(null);\n public readonly zBounds = input<string | HTMLElement>('document.body');\n public readonly zTheme = input<'snow' | 'bubble'>('snow');\n public readonly zValidators = input<ZEditorValidator[]>([]);\n\n protected readonly editorId = zUuid('z-editor');\n\n protected readonly _value = signal<string>('');\n private readonly _disabled = signal(false);\n private readonly _formControl = signal<AbstractControl | null>(null);\n private readonly _formStateVersion = signal(0);\n private readonly _isNgModel = signal(false);\n\n protected readonly uiState = signal({\n touched: false,\n dirty: false,\n });\n\n private readonly _customError = signal<string | null>(null);\n\n private _onChange: (value: string) => void = () => void 0;\n private _onTouched: () => void = () => void 0;\n private _ngControl: NgControl | null = null;\n private _editorInstance: QuillEditorComponent | null = null;\n\n protected readonly isDisabled = computed(() => this._disabled() || this.zDisabled());\n protected readonly effectivePlaceholder = computed(() => {\n this._zTranslate.currentLang();\n return this.zPlaceholder() || this._zTranslate.instant('i18n_z_ui_editor_placeholder');\n });\n\n protected readonly effectiveModules = computed<QuillModules>(() => {\n const customModules = this.zModules();\n if (customModules) {\n return customModules;\n }\n\n return {\n toolbar: DEFAULT_TOOLBAR,\n resize: {\n locale: {},\n },\n history: {\n delay: 1000,\n maxStack: 50,\n userOnly: true,\n },\n };\n });\n\n private readonly _shouldShowValidation = computed(() => {\n const control = this._formControl();\n this._formStateVersion();\n\n if (this._isNgModel()) {\n return this.uiState().dirty || this.uiState().touched;\n }\n\n if (control) {\n return control.dirty;\n }\n\n return this.uiState().dirty || this.uiState().touched;\n });\n\n private _getValidationErrors(): string[] {\n const errors: string[] = [];\n const value = this._value();\n const validators = this.zValidators();\n\n if (!this._shouldShowValidation()) {\n return errors;\n }\n\n // Check zRequired independently (works with ngModel without formControlName)\n const isRequired = this.zRequired() || this._formControl()?.errors?.['required'];\n if (isRequired && (!value || value.trim() === '' || value === '<p><br></p>')) {\n this._zTranslate.currentLang();\n errors.push(this._zTranslate.instant('i18n_z_ui_editor_required'));\n }\n\n for (const validator of validators) {\n // Skip required check here since we already checked above\n if (validator.error === 'required') {\n continue;\n }\n\n if (validator.minLength && value.length < validator.minLength) {\n errors.push(validator.message);\n continue;\n }\n\n if (validator.maxLength && value.length > validator.maxLength) {\n errors.push(validator.message);\n continue;\n }\n\n if (validator.pattern && !validator.pattern.test(value)) {\n errors.push(validator.message);\n }\n }\n\n return errors;\n }\n\n protected readonly hasError = computed(() => {\n // Custom error from setErrorMessage takes priority\n if (this._customError()) {\n return true;\n }\n\n const customErrors = this._getValidationErrors();\n if (customErrors.length > 0) {\n return true;\n }\n\n const control = this._formControl();\n this._formStateVersion();\n\n if (!control) {\n return false;\n }\n\n return control.invalid && this._shouldShowValidation();\n });\n\n protected readonly errorMessage = computed(() => {\n // Custom error from setErrorMessage takes priority\n const customError = this._customError();\n if (customError) {\n return customError;\n }\n\n const customErrors = this._getValidationErrors();\n if (customErrors.length > 0) {\n return customErrors[0];\n }\n\n const control = this._formControl();\n const errors = control?.errors;\n\n if (!errors) {\n return '';\n }\n\n this._zTranslate.currentLang();\n if (errors['required']) {\n return this._zTranslate.instant('i18n_z_ui_editor_required');\n }\n\n if (errors['minlength']) {\n return this._zTranslate.instant('i18n_z_ui_editor_min_length', {\n min: errors['minlength'].requiredLength,\n });\n }\n\n if (errors['maxlength']) {\n return this._zTranslate.instant('i18n_z_ui_editor_max_length', {\n max: errors['maxlength'].requiredLength,\n });\n }\n\n return this._zTranslate.instant('i18n_z_ui_editor_invalid');\n });\n\n protected readonly currentStatus = computed(() => {\n if (this.isDisabled()) {\n return 'disabled';\n }\n\n if (this.zReadonly()) {\n return 'readonly';\n }\n\n if (this.hasError()) {\n return 'error';\n }\n\n return 'default';\n });\n\n protected readonly wrapperClasses = computed(() => 'z-editor-wrapper flex w-full flex-col gap-2');\n\n protected readonly labelClasses = computed(() =>\n zMergeClasses('mb-1.5 block text-sm font-medium text-foreground', this.zLabelClass())\n );\n\n protected readonly editorClasses = computed(() =>\n zMergeClasses(\n zEditorVariants({\n zSize: this.zSize(),\n zStatus: this.currentStatus(),\n }),\n this.class()\n )\n );\n\n ngOnInit(): void {\n queueMicrotask(() => {\n try {\n this._ngControl = this._injector.get(NgControl, null);\n this._isNgModel.set(this._ngControl instanceof NgModel);\n\n if (this._ngControl?.control) {\n const { control } = this._ngControl;\n this._formControl.set(control);\n merge(\n control.statusChanges,\n control.valueChanges,\n control.events.pipe(\n filter(event => event instanceof PristineChangeEvent || event instanceof TouchedChangeEvent)\n )\n )\n .pipe(takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n this._formStateVersion.update(v => v + 1);\n });\n }\n } catch {\n this._ngControl = null;\n }\n });\n\n setTimeout(() => this._emitControl());\n }\n\n public writeValue(value: string): void {\n this._value.set(value || '');\n }\n\n public registerOnChange(fn: (value: string) => void): void {\n this._onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n public setDisabledState(isDisabled: boolean): void {\n this._disabled.set(isDisabled);\n }\n\n protected onContentChange(event: ContentChange): void {\n const html = event.html || '';\n this._value.set(html);\n this.uiState.update(s => ({ ...s, dirty: true }));\n this._onChange(html);\n this.zOnChange.emit(html);\n }\n\n protected onFocus(): void {\n const focusEvent = new FocusEvent('focus');\n this.zOnFocus.emit(focusEvent);\n this.zEvent.emit(zCreateEvent('focus', focusEvent));\n }\n\n protected onBlur(): void {\n if (this.uiState().dirty) {\n this.uiState.update(s => ({ ...s, touched: true }));\n }\n\n this._onTouched();\n const blurEvent = new FocusEvent('blur');\n this.zOnBlur.emit(blurEvent);\n this.zEvent.emit(zCreateEvent('blur', blurEvent));\n }\n\n public focus(): void {\n this._editorInstance?.quillEditor?.focus();\n }\n\n public blur(): void {\n this._editorInstance?.quillEditor?.blur();\n }\n\n public clear(): void {\n this._value.set('');\n this._onChange('');\n }\n\n public setContent(content: string): void {\n this._value.set(content);\n this._onChange(content);\n }\n\n public getContent(): string {\n return this._value();\n }\n\n public getText(): string {\n return this._editorInstance?.quillEditor?.getText() || '';\n }\n\n public getLength(): number {\n return this._editorInstance?.quillEditor?.getLength() || 0;\n }\n\n public setErrorMessage(message: string | null): void {\n this._customError.set(message);\n }\n\n public setValue(content: string): void {\n this.setContent(content);\n }\n\n /** @deprecated Use `valid()` for boolean form-submit checks. */\n public validate(): boolean {\n this.uiState.update(s => ({ ...s, touched: true, dirty: true }));\n this._onTouched();\n\n if (this._ngControl?.control) {\n this._ngControl.control.markAsDirty();\n this._ngControl.control.markAsTouched();\n }\n\n return this.hasError();\n }\n\n public valid(): boolean {\n return !this.validate();\n }\n\n public reset(): void {\n this._value.set('');\n this.uiState.update(s => ({ ...s, touched: false, dirty: false }));\n this._customError.set(null);\n this._onChange('');\n\n if (this._ngControl?.control) {\n this._ngControl.control.markAsPristine();\n this._ngControl.control.markAsUntouched();\n }\n }\n\n private _emitControl(): void {\n this.zControl.emit({\n focus: () => this.focus(),\n blur: () => this.blur(),\n clear: () => this.clear(),\n setContent: (content: string) => this.setContent(content),\n getContent: () => this.getContent(),\n getText: () => this.getText(),\n getLength: () => this.getLength(),\n valid: () => this.valid(),\n validate: () => this.validate(),\n reset: () => this.reset(),\n setValue: (content: string) => this.setValue(content),\n setErrorMessage: (message: string | null) => this.setErrorMessage(message),\n hasError: this.hasError,\n value: this._value.asReadonly(),\n errorMessage: this.errorMessage,\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAEO,MAAM,eAAe,GAAG,GAAG,CAChC;IACE,iFAAiF;IACjF,kFAAkF;IAClF,oCAAoC;IACpC,cAAc;CACf,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,KAAK,EAAE;AACL,YAAA,EAAE,EAAE,gDAAgD;AACpD,YAAA,OAAO,EAAE,gDAAgD;AACzD,YAAA,EAAE,EAAE,kDAAkD;AACvD,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,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AAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FA+C5C,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAjD5B,SAAS;+BACE,UAAU,EAAA,OAAA,EACX,CAAC,WAAW,EAAE,mBAAmB,EAAE,WAAW,CAAC,EAAA,UAAA,EAC5C,IAAI,EAAA,QAAA,EACN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCT,EAAA,SAAA,EAEU;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,sBAAsB,CAAC;AAC/C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;qBACF,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,YAC3B,SAAS,EAAA,MAAA,EAAA,CAAA,+p8BAAA,CAAA,EAAA;;;AChGrB;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, signal, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, effect, model } from '@angular/core';
|
|
2
|
+
import { input, output, signal, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, effect, model, EventEmitter, inject, Injector, PLATFORM_ID, Injectable } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule } from '@angular/forms';
|
|
5
5
|
import { TranslatePipe } from '@ngx-translate/core';
|
|
@@ -14,6 +14,10 @@ import { ZSkeletonComponent } from '@shival99/z-ui/components/z-skeleton';
|
|
|
14
14
|
import { ZTooltipDirective } from '@shival99/z-ui/components/z-tooltip';
|
|
15
15
|
import { ZSafeResourceUrlPipe } from '@shival99/z-ui/pipes';
|
|
16
16
|
import { cva } from 'class-variance-authority';
|
|
17
|
+
import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
|
|
18
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
19
|
+
import { DOCUMENT, isPlatformBrowser } from '@angular/common';
|
|
20
|
+
import { ZOverlayZIndexService } from '@shival99/z-ui/services';
|
|
17
21
|
|
|
18
22
|
const FILE_CATEGORY_STYLES = {
|
|
19
23
|
image: {
|
|
@@ -894,9 +898,9 @@ class ZGalleryPreviewComponent {
|
|
|
894
898
|
<div
|
|
895
899
|
class="dark:!border-border absolute top-4 left-1/2 z-10 flex -translate-x-1/2 items-center gap-2 rounded-[0.375rem] border !border-transparent bg-black/60 px-4 py-2 text-sm text-white backdrop-blur-sm dark:border"
|
|
896
900
|
>
|
|
897
|
-
<div>
|
|
901
|
+
<div class="flex min-w-0 items-baseline gap-1.5">
|
|
898
902
|
<span class="max-w-[12.5rem] truncate font-medium">{{ file().name }}</span>
|
|
899
|
-
<span class="text-white/70">{{ formattedSize() }}</span>
|
|
903
|
+
<span class="shrink-0 text-white/70">({{ formattedSize() }})</span>
|
|
900
904
|
</div>
|
|
901
905
|
|
|
902
906
|
@if (files().length > 1) {
|
|
@@ -1094,9 +1098,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
1094
1098
|
<div
|
|
1095
1099
|
class="dark:!border-border absolute top-4 left-1/2 z-10 flex -translate-x-1/2 items-center gap-2 rounded-[0.375rem] border !border-transparent bg-black/60 px-4 py-2 text-sm text-white backdrop-blur-sm dark:border"
|
|
1096
1100
|
>
|
|
1097
|
-
<div>
|
|
1101
|
+
<div class="flex min-w-0 items-baseline gap-1.5">
|
|
1098
1102
|
<span class="max-w-[12.5rem] truncate font-medium">{{ file().name }}</span>
|
|
1099
|
-
<span class="text-white/70">{{ formattedSize() }}</span>
|
|
1103
|
+
<span class="shrink-0 text-white/70">({{ formattedSize() }})</span>
|
|
1100
1104
|
</div>
|
|
1101
1105
|
|
|
1102
1106
|
@if (files().length > 1) {
|
|
@@ -1924,9 +1928,108 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
1924
1928
|
}]
|
|
1925
1929
|
}], propDecorators: { file: [{ type: i0.Input, args: [{ isSignal: true, alias: "file", required: true }] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", required: false }] }], zMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMode", required: false }] }] } });
|
|
1926
1930
|
|
|
1931
|
+
class ZGalleryPreviewRef {
|
|
1932
|
+
_overlayRef;
|
|
1933
|
+
_closed = false;
|
|
1934
|
+
componentInstance = null;
|
|
1935
|
+
zAfterClose = new EventEmitter();
|
|
1936
|
+
constructor(_overlayRef) {
|
|
1937
|
+
this._overlayRef = _overlayRef;
|
|
1938
|
+
}
|
|
1939
|
+
close() {
|
|
1940
|
+
if (this._closed) {
|
|
1941
|
+
return;
|
|
1942
|
+
}
|
|
1943
|
+
this._closed = true;
|
|
1944
|
+
this.zAfterClose.emit();
|
|
1945
|
+
this.zAfterClose.complete();
|
|
1946
|
+
this._overlayRef?.dispose();
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
class ZGalleryPreviewService {
|
|
1951
|
+
_document = inject(DOCUMENT);
|
|
1952
|
+
_injector = inject(Injector);
|
|
1953
|
+
_overlay = inject(Overlay);
|
|
1954
|
+
_platformId = inject(PLATFORM_ID);
|
|
1955
|
+
_zIndexService = inject(ZOverlayZIndexService);
|
|
1956
|
+
open(fileOrOptions, options = {}) {
|
|
1957
|
+
const previewOptions = this._normalizeOptions(fileOrOptions, options);
|
|
1958
|
+
const overlayRef = this._createOverlay();
|
|
1959
|
+
const previewRef = new ZGalleryPreviewRef(overlayRef ?? null);
|
|
1960
|
+
if (!overlayRef) {
|
|
1961
|
+
return previewRef;
|
|
1962
|
+
}
|
|
1963
|
+
const componentRef = overlayRef.attach(new ComponentPortal(ZGalleryPreviewComponent, null, this._injector));
|
|
1964
|
+
previewRef.componentInstance = componentRef.instance;
|
|
1965
|
+
componentRef.setInput('file', previewOptions.file);
|
|
1966
|
+
componentRef.setInput('files', previewOptions.files);
|
|
1967
|
+
componentRef.setInput('zShowRemove', previewOptions.zShowRemove ?? false);
|
|
1968
|
+
componentRef.instance.zOnClose.subscribe(() => {
|
|
1969
|
+
previewOptions.zOnClose?.();
|
|
1970
|
+
previewRef.close();
|
|
1971
|
+
});
|
|
1972
|
+
componentRef.instance.zOnDownload.subscribe(file => this._handleDownload(file, previewOptions));
|
|
1973
|
+
componentRef.instance.zOnNavigate.subscribe(file => {
|
|
1974
|
+
componentRef.setInput('file', file);
|
|
1975
|
+
previewOptions.zOnNavigate?.(file);
|
|
1976
|
+
});
|
|
1977
|
+
componentRef.instance.zOnRemove.subscribe(file => previewOptions.zOnRemove?.(file));
|
|
1978
|
+
return previewRef;
|
|
1979
|
+
}
|
|
1980
|
+
_createOverlay() {
|
|
1981
|
+
if (!isPlatformBrowser(this._platformId)) {
|
|
1982
|
+
return undefined;
|
|
1983
|
+
}
|
|
1984
|
+
const overlayRef = this._overlay.create(new OverlayConfig({
|
|
1985
|
+
hasBackdrop: false,
|
|
1986
|
+
panelClass: 'z-gallery-preview-overlay-pane',
|
|
1987
|
+
positionStrategy: this._overlay.position().global(),
|
|
1988
|
+
scrollStrategy: this._overlay.scrollStrategies.block(),
|
|
1989
|
+
}));
|
|
1990
|
+
this._zIndexService.applyToOverlay(overlayRef);
|
|
1991
|
+
this._zIndexService.deferMoveToTop(overlayRef);
|
|
1992
|
+
return overlayRef;
|
|
1993
|
+
}
|
|
1994
|
+
_normalizeOptions(fileOrOptions, options) {
|
|
1995
|
+
const previewOptions = 'file' in fileOrOptions ? fileOrOptions : { ...options, file: fileOrOptions };
|
|
1996
|
+
const files = previewOptions.files?.length ? previewOptions.files : [previewOptions.file];
|
|
1997
|
+
const hasCurrentFile = files.some(file => file.id === previewOptions.file.id);
|
|
1998
|
+
return {
|
|
1999
|
+
...previewOptions,
|
|
2000
|
+
files: hasCurrentFile ? files : [previewOptions.file, ...files],
|
|
2001
|
+
};
|
|
2002
|
+
}
|
|
2003
|
+
_handleDownload(file, options) {
|
|
2004
|
+
options.zOnDownload?.(file);
|
|
2005
|
+
if (options.zDownload === false) {
|
|
2006
|
+
return;
|
|
2007
|
+
}
|
|
2008
|
+
const downloadLink = file.downloadUrl || file.url;
|
|
2009
|
+
if (!downloadLink || !isPlatformBrowser(this._platformId)) {
|
|
2010
|
+
return;
|
|
2011
|
+
}
|
|
2012
|
+
const link = this._document.createElement('a');
|
|
2013
|
+
link.href = downloadLink;
|
|
2014
|
+
link.download = file.name;
|
|
2015
|
+
link.target = '_blank';
|
|
2016
|
+
this._document.body.appendChild(link);
|
|
2017
|
+
link.click();
|
|
2018
|
+
this._document.body.removeChild(link);
|
|
2019
|
+
}
|
|
2020
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZGalleryPreviewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2021
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZGalleryPreviewService, providedIn: 'root' });
|
|
2022
|
+
}
|
|
2023
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZGalleryPreviewService, decorators: [{
|
|
2024
|
+
type: Injectable,
|
|
2025
|
+
args: [{
|
|
2026
|
+
providedIn: 'root',
|
|
2027
|
+
}]
|
|
2028
|
+
}] });
|
|
2029
|
+
|
|
1927
2030
|
/**
|
|
1928
2031
|
* Generated bundle index. Do not edit.
|
|
1929
2032
|
*/
|
|
1930
2033
|
|
|
1931
|
-
export { FILE_CATEGORY_STYLES, ZGalleryComponent, ZGalleryFileIconComponent, ZGalleryItemComponent, ZGalleryPreviewComponent, formatFileSize, getFileCategory, isImage, isPreviewable, zGalleryFileIconVariants, zGalleryItemVariants, zGalleryVariants };
|
|
2034
|
+
export { FILE_CATEGORY_STYLES, ZGalleryComponent, ZGalleryFileIconComponent, ZGalleryItemComponent, ZGalleryPreviewComponent, ZGalleryPreviewRef, ZGalleryPreviewService, formatFileSize, getFileCategory, isImage, isPreviewable, zGalleryFileIconVariants, zGalleryItemVariants, zGalleryVariants };
|
|
1932
2035
|
//# sourceMappingURL=shival99-z-ui-components-z-gallery.mjs.map
|