diff --git a/src/libs/imng-kendo-testing-stubs/src/index.ts b/src/libs/imng-kendo-testing-stubs/src/index.ts index 68d57422..4bd96a3f 100644 --- a/src/libs/imng-kendo-testing-stubs/src/index.ts +++ b/src/libs/imng-kendo-testing-stubs/src/index.ts @@ -97,6 +97,12 @@ export { IMNG_KENDO_LOADER_STUB } from './lib/components/kendo-loader-stub.compo export { IMNG_KENDO_SWITCH_STUB } from './lib/components/kendo-switch-stub.component'; export { IMNG_KENDO_UPLOADDROPZONE_STUB } from './lib/components/kendo-uploaddropzone-stub.component'; export { IMNG_KENDO_UPLOAD_STUB } from './lib/components/kendo-upload-stub.component'; +export { IMNG_KENDO_EDITOR_STUB } from './lib/components/kendo-editor-stub.component'; +export { IMNG_KENDO_LABEL_STUB } from './lib/components/kendo-label-stub.component'; +export { IMNG_KENDO_RADIO_BUTTON_STUB } from './lib/components/kendo-radio-button-stub.component'; +export { IMNG_KENDO_TOOLBAR_BUTTON_STUB } from './lib/components/kendo-toolbar-button-stub.component'; +export { IMNG_KENDO_TOOLBAR_BUTTONGROUP_STUB } from './lib/components/kendo-toolbar-buttongroup-stub.component'; +export { IMNG_KENDO_TOOLBAR_STUB } from './lib/components/kendo-toolbar-stub.component'; export const IMNG_KENDO_GRID_STUBS = [ IMNG_KENDO_GRID_STUB, diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-button-stub.component.ts b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-button-stub.component.ts index cd1391a6..2ce1b177 100644 --- a/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-button-stub.component.ts +++ b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-button-stub.component.ts @@ -6,6 +6,7 @@ import { Input, NO_ERRORS_SCHEMA, } from '@angular/core'; +import { SVGIcon } from '../interfaces/svg-icon'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector @@ -17,7 +18,7 @@ import { schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], }) export class IMNG_KENDO_BUTTON_STUB { - @Input() public svgIcon: unknown; + @Input() public svgIcon?: SVGIcon; @Input() public disabled?: boolean; @Input() public rounded: unknown; @Input() public fillMode: unknown; diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-editor-stub.component.ts b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-editor-stub.component.ts new file mode 100644 index 00000000..03fa1074 --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-editor-stub.component.ts @@ -0,0 +1,45 @@ +import { + ChangeDetectionStrategy, + Component, + CUSTOM_ELEMENTS_SCHEMA, + EventEmitter, + Input, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { ApplyToWordOptions } from '../interfaces/apply-to-word-options'; +import { PasteCleanupSettings } from '../interfaces/paste-cleanup-settings'; +import { EditorPasteEvent } from '../interfaces/editor-paste-event'; +import { EditorCommand } from '../types/editor-command'; +import { DialogCommand } from '../types/dialog-command'; +@Component({ + selector: 'kendo-editor', + template: '', + standalone: true, + providers: [], + changeDetection: ChangeDetectionStrategy.OnPush, + schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], +}) +export class IMNG_KENDO_EDITOR_STUB { + @Input() public applyToWord: boolean | ApplyToWordOptions = false; + @Input() public disabled?: boolean; + @Input() public iframe = true; + @Input() public iframeCss: unknown; + @Input() public pasteCleanupSettings?: PasteCleanupSettings; + @Input() public placeholder?: string; + @Input() public plugins?: () => []; + @Input() public preserveWhitespace: boolean | 'full' = false; + @Input() public readonly = false; + @Input() public resizable = false; + @Input() public schema: unknown; + @Input() public value = ''; + + public blur = new EventEmitter(); + public focus = new EventEmitter(); + public paste = new EventEmitter(); + public valueChange = new EventEmitter(); + + // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars + public exec(_commandName: EditorCommand, _attr: unknown) {} + // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars + public openDialog(_dialogName: DialogCommand) {} +} diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-label-stub.component.ts b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-label-stub.component.ts new file mode 100644 index 00000000..85508b1c --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-label-stub.component.ts @@ -0,0 +1,22 @@ +import { + ChangeDetectionStrategy, + Component, + CUSTOM_ELEMENTS_SCHEMA, + Input, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +@Component({ + selector: 'kendo-label', + template: '', + standalone: true, + providers: [], + changeDetection: ChangeDetectionStrategy.OnPush, + schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], +}) +export class IMNG_KENDO_LABEL_STUB { + @Input() public for: unknown; + @Input() public labelCssClass?: unknown; + @Input() public labelCssStyle?: unknown; + @Input() public optional = false; + @Input() public text?: string; +} diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-radio-button-stub.component.ts b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-radio-button-stub.component.ts new file mode 100644 index 00000000..9e777ef6 --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-radio-button-stub.component.ts @@ -0,0 +1,31 @@ +import { + ChangeDetectionStrategy, + Component, + CUSTOM_ELEMENTS_SCHEMA, + EventEmitter, + Input, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { InputSize } from '../type'; +@Component({ + selector: 'kendo-radiobutton', + template: '', + standalone: true, + providers: [], + changeDetection: ChangeDetectionStrategy.OnPush, + schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], +}) +export class IMNG_KENDO_RADIO_BUTTON_STUB { + @Input() public checked = false; + @Input() public disabled?: boolean; + @Input() public inputAttributes = {}; + @Input() public name = ''; + @Input() public size?: InputSize; + @Input() public tabindex?: number; + @Input() public title?: string; + @Input() public value = ''; + + public blur = new EventEmitter(); + public focus = new EventEmitter(); + public checkedChange = new EventEmitter(); +} diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-toolbar-button-stub.component.ts b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-toolbar-button-stub.component.ts new file mode 100644 index 00000000..959bbe56 --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-toolbar-button-stub.component.ts @@ -0,0 +1,40 @@ +import { + ChangeDetectionStrategy, + Component, + CUSTOM_ELEMENTS_SCHEMA, + EventEmitter, + Input, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { SVGIcon } from '../interfaces/svg-icon'; +@Component({ + selector: 'kendo-toolbar-button', + template: '', + standalone: true, + providers: [], + changeDetection: ChangeDetectionStrategy.OnPush, + schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], +}) +export class IMNG_KENDO_TOOLBAR_BUTTON_STUB { + @Input() public className?: string | string[] | object; + @Input() public disabled?: boolean; + @Input() public fillMode: unknown; + @Input() public icon?: string; + @Input() public iconClass?: string; + @Input() public imageUrl?: string; + @Input() public rounded?: never; + @Input() public selected = false; + @Input() public showIcon?: never; + @Input() public showText?: never; + @Input() public style?: { [key: string]: string }; + @Input() public svgIcon?: SVGIcon; + @Input() public text?: string; + @Input() public themeColor?: never; + @Input() public title?: string; + @Input() public togglable?: boolean; + @Input() public toggleable?: boolean = false; + + click?: EventEmitter; + pointerdown?: EventEmitter; + selectedChange?: EventEmitter; +} diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-toolbar-buttongroup-stub.component.ts b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-toolbar-buttongroup-stub.component.ts new file mode 100644 index 00000000..5e8f532f --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-toolbar-buttongroup-stub.component.ts @@ -0,0 +1,20 @@ +import { + ChangeDetectionStrategy, + Component, + CUSTOM_ELEMENTS_SCHEMA, + Input, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +@Component({ + selector: 'kendo-toolbar-buttongroup', + template: '', + standalone: true, + providers: [], + changeDetection: ChangeDetectionStrategy.OnPush, + schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], +}) +export class IMNG_KENDO_TOOLBAR_BUTTONGROUP_STUB { + @Input() public disabled?: boolean; + @Input() public selection?: unknown; + @Input() public width?: string; +} diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-toolbar-stub.component.ts b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-toolbar-stub.component.ts new file mode 100644 index 00000000..912ee994 --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/components/kendo-toolbar-stub.component.ts @@ -0,0 +1,32 @@ +import { + ChangeDetectionStrategy, + Component, + CUSTOM_ELEMENTS_SCHEMA, + EventEmitter, + Input, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { InputSize } from '../type'; +@Component({ + selector: 'kendo-toolbar', + template: '', + standalone: true, + providers: [], + changeDetection: ChangeDetectionStrategy.OnPush, + schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], +}) +export class IMNG_KENDO_TOOLBAR_STUB { + @Input() public fillMode: unknown; + @Input() public overflow?: unknown; + @Input() public popupSettings: unknown; + @Input() public showIcon: unknown; + @Input() public showText: unknown; + @Input() public size?: InputSize; + @Input() public tabindex?: number; + + public close = new EventEmitter(); + public open = new EventEmitter(); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function + public toggle(_popupOpen?: boolean) {} +} diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/apply-to-word-options.ts b/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/apply-to-word-options.ts new file mode 100644 index 00000000..c245a6e1 --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/apply-to-word-options.ts @@ -0,0 +1,4 @@ +export interface ApplyToWordOptions { + before: RegExp; + after: RegExp; +} diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/editor-css-settings.ts b/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/editor-css-settings.ts new file mode 100644 index 00000000..babf8070 --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/editor-css-settings.ts @@ -0,0 +1,5 @@ +export interface EditorCssSettings { + content?: string; + path?: string; + keepBuiltInCss?: boolean; +} diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/editor-paste-event.ts b/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/editor-paste-event.ts new file mode 100644 index 00000000..e8033490 --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/editor-paste-event.ts @@ -0,0 +1,7 @@ +export interface EditorPasteEvent { + isDefaultPrevented: () => boolean; + preventDefault: () => void; + cleanedHtml: string; + originalEvent: ClipboardEvent; + originalHtml: string; +} diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/editor-resiable-options.ts b/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/editor-resiable-options.ts new file mode 100644 index 00000000..b9e0d75c --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/editor-resiable-options.ts @@ -0,0 +1,6 @@ +export interface EditorResizableOptions { + minWidth?: number; + minHeight?: number; + maxWidth?: number; + maxHeight?: number; +} diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/paste-cleanup-settings.ts b/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/paste-cleanup-settings.ts new file mode 100644 index 00000000..72e56964 --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/interfaces/paste-cleanup-settings.ts @@ -0,0 +1,9 @@ +export interface PasteCleanupSettings { + convertMsLists?: boolean; + removeHtmlComments?: boolean; + stripTags?: string[]; + removeAttributes?: string[] | 'all'; + removeMsClasses?: boolean; + removeMsStyles?: boolean; + removeInvalidHTML?: boolean; +} diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/types/dialog-command.ts b/src/libs/imng-kendo-testing-stubs/src/lib/types/dialog-command.ts new file mode 100644 index 00000000..9bc21601 --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/types/dialog-command.ts @@ -0,0 +1,6 @@ +export type DialogCommand = + | 'createLink' + | 'viewSource' + | 'insertFile' + | 'insertImage' + | 'tableWizard'; diff --git a/src/libs/imng-kendo-testing-stubs/src/lib/types/editor-command.ts b/src/libs/imng-kendo-testing-stubs/src/lib/types/editor-command.ts new file mode 100644 index 00000000..40ad9cab --- /dev/null +++ b/src/libs/imng-kendo-testing-stubs/src/lib/types/editor-command.ts @@ -0,0 +1,42 @@ +export type EditorCommand = + | 'bold' + | 'italic' + | 'underline' + | 'strikethrough' + | 'createLink' + | 'unlink' + | 'insertFile' + | 'insertImage' + | 'insertOrderedList' + | 'insertUnorderedList' + | 'insertText' + | 'indent' + | 'outdent' + | 'alignLeft' + | 'alignCenter' + | 'alignRight' + | 'alignJustify' + | 'format' + | 'fontFamily' + | 'fontSize' + | 'cleanFormat' + | 'setHTML' + | 'undo' + | 'redo' + | 'subscript' + | 'superscript' + | 'cleanFormatting' + | 'foreColor' + | 'backColor' + | 'insertTable' + | 'addColumnBefore' + | 'addColumnAfter' + | 'addRowBefore' + | 'addRowAfter' + | 'deleteRow' + | 'deleteColumn' + | 'mergeCells' + | 'splitCell' + | 'deleteTable' + | 'selectAll' + | 'blockquote';