Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove more autosize unused code #1202

Merged
merged 2 commits into from
Nov 21, 2023
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
15 changes: 5 additions & 10 deletions packages/common/src/core/slickCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ export type Handler<ArgType = any> = (e: any, args: ArgType) => void;
* @constructor
*/
export class SlickEventData<ArgType = any> {
protected _arguments?: ArgType;
protected _isPropagationStopped = false;
protected _isImmediatePropagationStopped = false;
protected _isDefaultPrevented = false;
protected nativeEvent?: Event | null;
protected returnValue: any = undefined;
protected target?: EventTarget | null;
protected nativeEvent?: Event | null;
protected arguments_?: ArgType;

constructor(protected event?: Event | null, protected args?: ArgType) {
this.nativeEvent = event;
this.arguments_ = args;
this._arguments = args;

// when we already have an event, we want to keep some of the event properties
// looping through some props is the only way to keep and sync these properties to the returned EventData
Expand Down Expand Up @@ -114,7 +114,7 @@ export class SlickEventData<ArgType = any> {
}

getArguments() {
return this.arguments_;
return this._arguments;
}
}

Expand Down Expand Up @@ -535,10 +535,6 @@ export class SlickEditorLock {
};
}

function regexSanitizer(dirtyHtml: string) {
return dirtyHtml.replace(/(\b)(on[a-z]+)(\s*)=|javascript:([^>]*)[^>]*|(<\s*)(\/*)script([<>]*).*(<\s*)(\/*)script(>*)|(&lt;)(\/*)(script|script defer)(.*)(&gt;|&gt;">)/gi, '');
}

export function isDefined<T>(value: T | undefined | null): value is T {
return <T>value !== undefined && <T>value !== null;
}
Expand Down Expand Up @@ -804,7 +800,6 @@ const SlickCore = {
Group: SlickGroup,
GroupTotals: SlickGroupTotals,
EditorLock: SlickEditorLock,
RegexSanitizer: regexSanitizer,

/**
* A global singleton editor lock.
Expand Down Expand Up @@ -837,5 +832,5 @@ const SlickCore = {

export const {
EditorLock, Event, EventData, EventHandler, Group, GroupTotals, NonDataRow, Range,
RegexSanitizer, GlobalEditorLock, keyCode, preClickClassName,
GlobalEditorLock, keyCode, preClickClassName,
} = SlickCore;
4 changes: 0 additions & 4 deletions packages/common/src/core/slickGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,10 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
enableMouseWheelScrollHandler: true,
doPaging: true,
scrollRenderThrottling: 50,
viewportSwitchToScrollModeWidthPercent: undefined,
viewportMinWidthPx: undefined,
viewportMaxWidthPx: undefined,
suppressCssChangesOnHiddenInit: false,
ffMaxSupportedCssHeight: 6000000,
maxSupportedCssHeight: 1000000000,
sanitizer: undefined, // sanitize function, built in basic sanitizer is: Slick.RegexSanitizer(dirtyHtml)
logSanitizedHtml: false, // log to console when sanitised - recommend true for testing of dev and production
mixinDefaults: true,
shadowRoot: undefined
};
Expand Down
21 changes: 0 additions & 21 deletions packages/common/src/interfaces/gridOption.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,6 @@ export interface GridOption<C extends Column = Column> {
/** Auto-resize options (bottom padding, minHeight, ...) */
autoResize?: AutoResizeOption;

/** defaults to LegacyOff, Grid Autosize Columns Mode used when calling "autosizeColumns()" method */
autosizeColsMode?: string;

/** defaults to 4, autosize column padding in pixel */
autosizeColPaddingPx?: number;

/** defaults to 0.75, autosize text average to minimum width ratio */
autosizeTextAvgToMWidthRatio?: number;

/** Auto-tooltip options (enableForCells, enableForHeaderCells, maxToolTipLength) */
autoTooltipOptions?: AutoTooltipOption;

Expand Down Expand Up @@ -569,9 +560,6 @@ export interface GridOption<C extends Column = Column> {
/** Set of Locale translations used by the library */
locales?: Locale;

/** Should we log the sanitized html? */
logSanitizedHtml?: boolean;

/** Max supported CSS height */
maxSupportedCssHeight?: number;

Expand Down Expand Up @@ -745,13 +733,4 @@ export interface GridOption<C extends Column = Column> {

/** Defaults to null, which is the default Viewport CSS class name */
viewportClass?: string;

/** Viewport switch to scroll model with percentage */
viewportSwitchToScrollModeWidthPercent?: number;

/** Viewport min width in pixel */
viewportMinWidthPx?: number;

/** Viewport max width in pixel */
viewportMaxWidthPx?: number;
}
1 change: 1 addition & 0 deletions test/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const config: Config.InitialOptions = {
'!examples/vite-demo-vanilla-bundle/**',
'!**/node_modules/**',
'!**/test/**',
'!**/index.ts',
],
coverageDirectory: '<rootDir>/test/jest-coverage',
coveragePathIgnorePatterns: [
Expand Down