From 4c2322ccb0cac716aa2a7ac98447fe0efaf94b75 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Mon, 20 Nov 2023 22:45:36 -0500 Subject: [PATCH] chore: remove more autosize unused code --- packages/common/src/core/slickCore.ts | 15 +++++-------- packages/common/src/core/slickGrid.ts | 4 ---- .../src/interfaces/gridOption.interface.ts | 21 ------------------- 3 files changed, 5 insertions(+), 35 deletions(-) diff --git a/packages/common/src/core/slickCore.ts b/packages/common/src/core/slickCore.ts index 9e5fb4fca..fac6b6018 100644 --- a/packages/common/src/core/slickCore.ts +++ b/packages/common/src/core/slickCore.ts @@ -20,17 +20,17 @@ export type Handler = (e: any, args: ArgType) => void; * @constructor */ export class SlickEventData { + 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 @@ -114,7 +114,7 @@ export class SlickEventData { } getArguments() { - return this.arguments_; + return this._arguments; } } @@ -535,10 +535,6 @@ export class SlickEditorLock { }; } -function regexSanitizer(dirtyHtml: string) { - return dirtyHtml.replace(/(\b)(on[a-z]+)(\s*)=|javascript:([^>]*)[^>]*|(<\s*)(\/*)script([<>]*).*(<\s*)(\/*)script(>*)|(<)(\/*)(script|script defer)(.*)(>|>">)/gi, ''); -} - export function isDefined(value: T | undefined | null): value is T { return value !== undefined && value !== null; } @@ -804,7 +800,6 @@ const SlickCore = { Group: SlickGroup, GroupTotals: SlickGroupTotals, EditorLock: SlickEditorLock, - RegexSanitizer: regexSanitizer, /** * A global singleton editor lock. @@ -837,5 +832,5 @@ const SlickCore = { export const { EditorLock, Event, EventData, EventHandler, Group, GroupTotals, NonDataRow, Range, - RegexSanitizer, GlobalEditorLock, keyCode, preClickClassName, + GlobalEditorLock, keyCode, preClickClassName, } = SlickCore; \ No newline at end of file diff --git a/packages/common/src/core/slickGrid.ts b/packages/common/src/core/slickGrid.ts index 729a9b418..b290e7f1e 100644 --- a/packages/common/src/core/slickGrid.ts +++ b/packages/common/src/core/slickGrid.ts @@ -250,14 +250,10 @@ export class SlickGrid = Column, 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 }; diff --git a/packages/common/src/interfaces/gridOption.interface.ts b/packages/common/src/interfaces/gridOption.interface.ts index e3191254d..857665564 100644 --- a/packages/common/src/interfaces/gridOption.interface.ts +++ b/packages/common/src/interfaces/gridOption.interface.ts @@ -140,15 +140,6 @@ export interface GridOption { /** 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; @@ -569,9 +560,6 @@ export interface GridOption { /** Set of Locale translations used by the library */ locales?: Locale; - /** Should we log the sanitized html? */ - logSanitizedHtml?: boolean; - /** Max supported CSS height */ maxSupportedCssHeight?: number; @@ -745,13 +733,4 @@ export interface GridOption { /** 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; }