Skip to content

Commit

Permalink
chore: remove more autosize unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Nov 21, 2023
1 parent c9d6261 commit 4c2322c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 35 deletions.
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;
}

0 comments on commit 4c2322c

Please sign in to comment.