@libs-ui/components-inputs-quill 0.2.326-1 → 0.2.327-1

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/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './quill.component';
2
2
  export * from './quill2x.component';
3
3
  export * from './interfaces/quill.interface';
4
+ export * from './interfaces/quill2x.interface';
@@ -0,0 +1,63 @@
1
+ import { ILabel } from '@libs-ui/components-label';
2
+ import Quill2x, { Range, EmitterSource } from 'quill2x';
3
+ import Delta from 'quill-delta';
4
+ export type QUILL2X_TYPE_MODE_BAR_CONFIG_OPTION = 'all' | 'default' | 'basic' | 'custom';
5
+ export interface IQuill2xToolbarConfig {
6
+ type: string;
7
+ mode?: Array<QUILL2X_TYPE_MODE_BAR_CONFIG_OPTION>;
8
+ width: number;
9
+ display?: boolean;
10
+ classInclude?: string;
11
+ }
12
+ export interface IQuill2xEventSave {
13
+ link: string;
14
+ width?: number;
15
+ height?: number;
16
+ }
17
+ export interface IQuill2xUploadImageConfig {
18
+ modeCustom: boolean;
19
+ showIcon?: boolean;
20
+ zIndex?: number;
21
+ maxImageSize?: number;
22
+ label?: ILabel;
23
+ onlyAcceptImageHttpsLink?: boolean;
24
+ functionUploadImage?: (files: Array<File>) => Promise<Array<string | ArrayBuffer>>;
25
+ }
26
+ export interface IQuill2xFunctionControlEvent {
27
+ checkIsValid: () => Promise<boolean>;
28
+ refreshItemValue: () => void;
29
+ setContent: (content: string) => Promise<void>;
30
+ insertText: (value: string, index?: number, focusLt?: boolean) => Promise<void>;
31
+ insertLink: (value: string, url: string, index?: number) => Promise<void>;
32
+ insertImage: (content: string, index?: number) => Promise<void>;
33
+ setFontSize: (size: number) => Promise<Delta | undefined>;
34
+ setColor: (color: string) => Promise<Delta | undefined>;
35
+ setBackground: (color: string) => Promise<Delta | undefined>;
36
+ setMessageError: (message: string) => Promise<void>;
37
+ quill: () => Quill2x | undefined;
38
+ reCalculatorToolbar: () => Promise<void>;
39
+ }
40
+ export interface IQuill2xLink {
41
+ title: string;
42
+ url: string;
43
+ range: {
44
+ index: number;
45
+ length: number;
46
+ };
47
+ }
48
+ export interface IQuill2xBlotRegister {
49
+ component: any;
50
+ className: string;
51
+ style: string;
52
+ ignoreDelete?: boolean;
53
+ }
54
+ export interface IQuill2xSelectionChange {
55
+ quill: Quill2x;
56
+ range: Range;
57
+ oldRange: Range;
58
+ source: EmitterSource;
59
+ }
60
+ export interface IQuill2xTextChange {
61
+ quill: Quill2x;
62
+ delta: Delta;
63
+ }
package/package.json CHANGED
@@ -1,31 +1,31 @@
1
1
  {
2
2
  "name": "@libs-ui/components-inputs-quill",
3
- "version": "0.2.326-1",
3
+ "version": "0.2.327-1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",
7
7
  "quill": "1.3.7",
8
8
  "quill2x": "npm:quill@2.0.3",
9
9
  "parchment": "1.1.4",
10
- "@libs-ui/components-label": "0.2.326-1",
10
+ "@libs-ui/components-label": "0.2.327-1",
11
11
  "quill-delta": "5.1.0",
12
- "@libs-ui/components-inputs-valid": "0.2.326-1",
13
- "@libs-ui/components-modal": "0.2.326-1",
14
- "@libs-ui/utils": "0.2.326-1",
15
- "@libs-ui/components-buttons-button": "0.2.326-1",
16
- "@libs-ui/components-buttons-select-color": "0.2.326-1",
17
- "@libs-ui/components-dropdown": "0.2.326-1",
18
- "@libs-ui/components-inputs-emoji": "0.2.326-1",
19
- "@libs-ui/components-inputs-mention": "0.2.326-1",
20
- "@libs-ui/components-list": "0.2.326-1",
21
- "@libs-ui/components-popover": "0.2.326-1",
22
- "@libs-ui/interfaces-types": "0.2.326-1",
23
- "@libs-ui/services-dynamic-component": "0.2.326-1",
12
+ "@libs-ui/components-inputs-valid": "0.2.327-1",
13
+ "@libs-ui/components-modal": "0.2.327-1",
14
+ "@libs-ui/utils": "0.2.327-1",
15
+ "@libs-ui/components-buttons-button": "0.2.327-1",
16
+ "@libs-ui/components-buttons-select-color": "0.2.327-1",
17
+ "@libs-ui/components-dropdown": "0.2.327-1",
18
+ "@libs-ui/components-inputs-emoji": "0.2.327-1",
19
+ "@libs-ui/components-inputs-mention": "0.2.327-1",
20
+ "@libs-ui/components-list": "0.2.327-1",
21
+ "@libs-ui/components-popover": "0.2.327-1",
22
+ "@libs-ui/interfaces-types": "0.2.327-1",
23
+ "@libs-ui/services-dynamic-component": "0.2.327-1",
24
24
  "@ngx-translate/core": "^15.0.0",
25
25
  "rxjs": "~7.8.0",
26
- "@libs-ui/components-spinner": "0.2.326-1",
27
- "@libs-ui/services-notification": "0.2.326-1",
28
- "@libs-ui/services-http-request": "0.2.326-1"
26
+ "@libs-ui/components-spinner": "0.2.327-1",
27
+ "@libs-ui/services-notification": "0.2.327-1",
28
+ "@libs-ui/services-http-request": "0.2.327-1"
29
29
  },
30
30
  "sideEffects": false,
31
31
  "module": "fesm2022/libs-ui-components-inputs-quill.mjs",
@@ -33,6 +33,8 @@ export declare class LibsUiComponentsInputsQuillComponent implements OnInit, Aft
33
33
  protected displayShowMoreToolbar: import("@angular/core").Signal<boolean>;
34
34
  protected displaySkeleton: import("@angular/core").Signal<boolean>;
35
35
  private timeCalculationToolBar;
36
+ private timerCalculatorToolbar;
37
+ private totalRecallCalculatorToolbar;
36
38
  private popoverFunctionControl;
37
39
  private quill;
38
40
  private handlers;
@@ -1,16 +1,22 @@
1
- import { OnInit, TemplateRef, WritableSignal } from '@angular/core';
1
+ import { OnDestroy, OnInit, TemplateRef, WritableSignal } from '@angular/core';
2
2
  import { IEmitSelectKey } from '@libs-ui/components-dropdown';
3
+ import { IValidLength, IValidRequired } from '@libs-ui/components-inputs-valid';
3
4
  import { ILabel } from '@libs-ui/components-label';
4
5
  import { IListConfigItem } from '@libs-ui/components-list';
5
6
  import { TYPE_POPOVER_EVENT } from '@libs-ui/components-popover';
6
- import { IQuillBlotRegister, IQuillFunctionControlEvent, IQuillLink, IQuillSelectionChange, IQuillTextChange, IQuillToolbarConfig, IQuillUploadImageConfig, TYPE_MODE_BAR_CONFIG_OPTION } from './interfaces/quill.interface';
7
+ import { TYPE_OBJECT } from '@libs-ui/interfaces-types';
8
+ import { IQuill2xToolbarConfig, IQuill2xBlotRegister, IQuill2xFunctionControlEvent, IQuill2xLink, IQuill2xSelectionChange, IQuill2xTextChange, IQuill2xUploadImageConfig, QUILL2X_TYPE_MODE_BAR_CONFIG_OPTION } from './interfaces/quill2x.interface';
7
9
  import * as i0 from "@angular/core";
8
- export declare class LibsUiComponentsInputsQuill2xComponent implements OnInit {
10
+ export declare class LibsUiComponentsInputsQuill2xComponent implements OnInit, OnDestroy {
9
11
  private quill?;
10
12
  private addEditLinkComponentRef;
11
13
  private uploadImageComponentRef;
12
14
  private handlers;
13
15
  private timerSetFontSize;
16
+ private timerCalculatorToolbar;
17
+ private totalRecallCalculatorToolbar;
18
+ private isCalculatorToolbarSuccess;
19
+ protected borderColor: import("@angular/core").Signal<string>;
14
20
  protected containerToolbarClass: import("@angular/core").Signal<string>;
15
21
  protected containerEditorClass: import("@angular/core").Signal<string>;
16
22
  protected showButtonMoreToolbar: import("@angular/core").Signal<boolean>;
@@ -26,30 +32,33 @@ export declare class LibsUiComponentsInputsQuill2xComponent implements OnInit {
26
32
  protected iconAlignSelectedComputed: import("@angular/core").Signal<any>;
27
33
  protected colorSelected: WritableSignal<boolean>;
28
34
  protected backgroundSelected: WritableSignal<boolean>;
35
+ protected messageError: WritableSignal<string>;
29
36
  protected size: WritableSignal<{
30
37
  value: number;
31
38
  }>;
32
- protected link: WritableSignal<IQuillLink>;
39
+ protected link: WritableSignal<IQuill2xLink>;
33
40
  protected showMoreAction: WritableSignal<boolean>;
34
- protected toolbarOptionsConfig: WritableSignal<Array<IQuillToolbarConfig>>;
41
+ protected toolbarOptionsConfig: WritableSignal<Array<IQuill2xToolbarConfig>>;
35
42
  protected loadingUploadImage: WritableSignal<boolean>;
36
- readonly uploadImageConfig: import("@angular/core").InputSignalWithTransform<IQuillUploadImageConfig, IQuillUploadImageConfig | undefined>;
43
+ readonly uploadImageConfig: import("@angular/core").InputSignalWithTransform<IQuill2xUploadImageConfig, IQuill2xUploadImageConfig | undefined>;
37
44
  readonly placeholder: import("@angular/core").InputSignalWithTransform<string, string | undefined>;
38
- readonly blotsRegister: import("@angular/core").InputSignal<IQuillBlotRegister[] | undefined>;
45
+ readonly blotsRegister: import("@angular/core").InputSignal<IQuill2xBlotRegister[] | undefined>;
39
46
  readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, boolean | undefined>;
40
47
  readonly quillCustomConfig: import("@angular/core").InputSignal<{
41
48
  toolbar?: {
42
49
  hidden?: boolean;
43
- type: TYPE_MODE_BAR_CONFIG_OPTION;
44
- options?: Array<IQuillToolbarConfig>;
50
+ type: QUILL2X_TYPE_MODE_BAR_CONFIG_OPTION;
51
+ options?: Array<IQuill2xToolbarConfig>;
45
52
  classCustomContainerToolbar?: string;
53
+ lessWidthToolbarRecallCalculator?: number;
54
+ maximumRecallCalculator?: number;
46
55
  };
47
56
  editor?: {
48
57
  classCustomContainerEditor?: string;
49
58
  };
50
59
  } | undefined>;
51
60
  readonly label: import("@angular/core").InputSignal<ILabel | undefined>;
52
- readonly item: import("@angular/core").ModelSignal<Record<string, unknown>>;
61
+ readonly item: import("@angular/core").ModelSignal<TYPE_OBJECT>;
53
62
  readonly fieldBind: import("@angular/core").InputSignal<string>;
54
63
  readonly autoUpdateValueWhenTextChange: import("@angular/core").InputSignalWithTransform<boolean, boolean | undefined>;
55
64
  readonly templateToolBarPersonalize: import("@angular/core").InputSignal<TemplateRef<any> | undefined>;
@@ -60,8 +69,15 @@ export declare class LibsUiComponentsInputsQuill2xComponent implements OnInit {
60
69
  title: string;
61
70
  action: () => void;
62
71
  }[] | undefined>;
72
+ readonly autoFocus: import("@angular/core").InputSignal<boolean | undefined>;
73
+ readonly focusBottom: import("@angular/core").InputSignal<boolean | undefined>;
74
+ readonly validRequired: import("@angular/core").InputSignal<IValidRequired | undefined>;
75
+ readonly validMinLength: import("@angular/core").InputSignal<IValidLength | undefined>;
76
+ readonly validMaxLength: import("@angular/core").InputSignal<IValidLength | undefined>;
77
+ readonly showErrorLabel: import("@angular/core").InputSignalWithTransform<boolean, boolean | undefined>;
78
+ readonly showErrorBorder: import("@angular/core").InputSignal<boolean | undefined>;
63
79
  readonly outShowPopupEditLink: import("@angular/core").OutputEmitterRef<{
64
- dataLink: IQuillLink;
80
+ dataLink: IQuill2xLink;
65
81
  callback: (linkEdit: {
66
82
  title: string;
67
83
  link: string;
@@ -71,10 +87,10 @@ export declare class LibsUiComponentsInputsQuill2xComponent implements OnInit {
71
87
  readonly outBlur: import("@angular/core").OutputEmitterRef<void>;
72
88
  readonly outFocus: import("@angular/core").OutputEmitterRef<void>;
73
89
  readonly outChange: import("@angular/core").OutputEmitterRef<string>;
74
- readonly outSelectionChange: import("@angular/core").OutputEmitterRef<IQuillSelectionChange>;
75
- readonly outTextChange: import("@angular/core").OutputEmitterRef<IQuillTextChange>;
90
+ readonly outSelectionChange: import("@angular/core").OutputEmitterRef<IQuill2xSelectionChange>;
91
+ readonly outTextChange: import("@angular/core").OutputEmitterRef<IQuill2xTextChange>;
76
92
  readonly outContextMenu: import("@angular/core").OutputEmitterRef<MouseEvent>;
77
- readonly outFunctionsControl: import("@angular/core").OutputEmitterRef<IQuillFunctionControlEvent>;
93
+ readonly outFunctionsControl: import("@angular/core").OutputEmitterRef<IQuill2xFunctionControlEvent>;
78
94
  private readonly htmlContainer;
79
95
  private readonly quillBodyContainer;
80
96
  private readonly toolbarContainer;
@@ -85,8 +101,8 @@ export declare class LibsUiComponentsInputsQuill2xComponent implements OnInit {
85
101
  private readonly translate;
86
102
  private readonly cdr;
87
103
  private readonly dynamicComponentService;
88
- ngOnInit(): void;
89
- get FunctionsControl(): any;
104
+ ngOnInit(): Promise<void>;
105
+ get FunctionsControl(): IQuill2xFunctionControlEvent;
90
106
  protected handlerChangeShowMoreAction(event: Event): void;
91
107
  protected handleSelectFont(event: IEmitSelectKey | undefined): void;
92
108
  protected handleSelectHeader(event: IEmitSelectKey | undefined): void;
@@ -94,6 +110,8 @@ export declare class LibsUiComponentsInputsQuill2xComponent implements OnInit {
94
110
  protected handleSelectAlign(event: IEmitSelectKey | undefined): void;
95
111
  protected handlerSetFormat(type: string, data: string | number): void;
96
112
  protected handlerInsertEmoji(emoji: unknown): void;
113
+ protected handlerUnlink(event: Event): void;
114
+ protected handlerEditLink(event: Event): void;
97
115
  private handleTable;
98
116
  private handleUndo;
99
117
  private handleRedo;
@@ -102,6 +120,7 @@ export declare class LibsUiComponentsInputsQuill2xComponent implements OnInit {
102
120
  private handlerSelectionChange;
103
121
  private handlerPaste;
104
122
  private handlerTextChange;
123
+ private validate;
105
124
  private updateHandlerFunction;
106
125
  private noPreventEmbedDeletion;
107
126
  private setFontSizeSelected;
@@ -116,11 +135,12 @@ export declare class LibsUiComponentsInputsQuill2xComponent implements OnInit {
116
135
  private insertImage;
117
136
  protected handlerPopoverEvent(event: TYPE_POPOVER_EVENT): void;
118
137
  private insertLink;
119
- protected handlerEditLink(event: Event): void;
120
- protected handleShowUploadLink(event: unknown): void;
121
- protected handlerUnlink(event: Event): void;
122
- private handlerUnInsertLink;
138
+ private handleShowUploadLink;
139
+ private updateValueByRootQuillHtml;
140
+ private convertInnerHTMLAndSetValue;
123
141
  private removeUnwantedPart;
142
+ private focus;
143
+ ngOnDestroy(): void;
124
144
  static ɵfac: i0.ɵɵFactoryDeclaration<LibsUiComponentsInputsQuill2xComponent, never>;
125
- static ɵcmp: i0.ɵɵComponentDeclaration<LibsUiComponentsInputsQuill2xComponent, "libs_ui-components-inputs-quill2x", never, { "uploadImageConfig": { "alias": "uploadImageConfig"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "blotsRegister": { "alias": "blotsRegister"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "quillCustomConfig": { "alias": "quillCustomConfig"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "item": { "alias": "item"; "required": true; "isSignal": true; }; "fieldBind": { "alias": "fieldBind"; "required": true; "isSignal": true; }; "autoUpdateValueWhenTextChange": { "alias": "autoUpdateValueWhenTextChange"; "required": false; "isSignal": true; }; "templateToolBarPersonalize": { "alias": "templateToolBarPersonalize"; "required": false; "isSignal": true; }; "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; "ignoreShowPopupEditLink": { "alias": "ignoreShowPopupEditLink"; "required": false; "isSignal": true; }; "ignoreCommunicateMicroEventPopup": { "alias": "ignoreCommunicateMicroEventPopup"; "required": false; "isSignal": true; }; "handlersExpand": { "alias": "handlersExpand"; "required": false; "isSignal": true; }; }, { "item": "itemChange"; "outShowPopupEditLink": "outShowPopupEditLink"; "outMessageError": "outMessageError"; "outBlur": "outBlur"; "outFocus": "outFocus"; "outChange": "outChange"; "outSelectionChange": "outSelectionChange"; "outTextChange": "outTextChange"; "outContextMenu": "outContextMenu"; "outFunctionsControl": "outFunctionsControl"; }, never, never, true, never>;
145
+ static ɵcmp: i0.ɵɵComponentDeclaration<LibsUiComponentsInputsQuill2xComponent, "libs_ui-components-inputs-quill2x", never, { "uploadImageConfig": { "alias": "uploadImageConfig"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "blotsRegister": { "alias": "blotsRegister"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "quillCustomConfig": { "alias": "quillCustomConfig"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "item": { "alias": "item"; "required": true; "isSignal": true; }; "fieldBind": { "alias": "fieldBind"; "required": true; "isSignal": true; }; "autoUpdateValueWhenTextChange": { "alias": "autoUpdateValueWhenTextChange"; "required": false; "isSignal": true; }; "templateToolBarPersonalize": { "alias": "templateToolBarPersonalize"; "required": false; "isSignal": true; }; "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; "ignoreShowPopupEditLink": { "alias": "ignoreShowPopupEditLink"; "required": false; "isSignal": true; }; "ignoreCommunicateMicroEventPopup": { "alias": "ignoreCommunicateMicroEventPopup"; "required": false; "isSignal": true; }; "handlersExpand": { "alias": "handlersExpand"; "required": false; "isSignal": true; }; "autoFocus": { "alias": "autoFocus"; "required": false; "isSignal": true; }; "focusBottom": { "alias": "focusBottom"; "required": false; "isSignal": true; }; "validRequired": { "alias": "validRequired"; "required": false; "isSignal": true; }; "validMinLength": { "alias": "validMinLength"; "required": false; "isSignal": true; }; "validMaxLength": { "alias": "validMaxLength"; "required": false; "isSignal": true; }; "showErrorLabel": { "alias": "showErrorLabel"; "required": false; "isSignal": true; }; "showErrorBorder": { "alias": "showErrorBorder"; "required": false; "isSignal": true; }; }, { "item": "itemChange"; "outShowPopupEditLink": "outShowPopupEditLink"; "outMessageError": "outMessageError"; "outBlur": "outBlur"; "outFocus": "outFocus"; "outChange": "outChange"; "outSelectionChange": "outSelectionChange"; "outTextChange": "outTextChange"; "outContextMenu": "outContextMenu"; "outFunctionsControl": "outFunctionsControl"; }, never, never, true, never>;
126
146
  }