Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/libs/imng-kendo-testing-stubs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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<never>();
public focus = new EventEmitter<never>();
public paste = new EventEmitter<EditorPasteEvent>();
public valueChange = new EventEmitter<never>();

// 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) {}
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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<never>();
public focus = new EventEmitter<never>();
public checkedChange = new EventEmitter<boolean>();
}
Original file line number Diff line number Diff line change
@@ -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<never>;
pointerdown?: EventEmitter<never>;
selectedChange?: EventEmitter<never>;
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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<never>();
public open = new EventEmitter<never>();

// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
public toggle(_popupOpen?: boolean) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface ApplyToWordOptions {
before: RegExp;
after: RegExp;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface EditorCssSettings {
content?: string;
path?: string;
keepBuiltInCss?: boolean;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface EditorPasteEvent {
isDefaultPrevented: () => boolean;
preventDefault: () => void;
cleanedHtml: string;
originalEvent: ClipboardEvent;
originalHtml: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface EditorResizableOptions {
minWidth?: number;
minHeight?: number;
maxWidth?: number;
maxHeight?: number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface PasteCleanupSettings {
convertMsLists?: boolean;
removeHtmlComments?: boolean;
stripTags?: string[];
removeAttributes?: string[] | 'all';
removeMsClasses?: boolean;
removeMsStyles?: boolean;
removeInvalidHTML?: boolean;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export type DialogCommand =
| 'createLink'
| 'viewSource'
| 'insertFile'
| 'insertImage'
| 'tableWizard';
42 changes: 42 additions & 0 deletions src/libs/imng-kendo-testing-stubs/src/lib/types/editor-command.ts
Original file line number Diff line number Diff line change
@@ -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';
Loading