@slickgrid-universal/vanilla-force-bundle 4.0.3 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/slickgrid-vanilla-bundle.js +44 -44
- package/dist/cjs/src/vanilla-force-bundle.js +2 -1
- package/dist/cjs/src/vanilla-force-bundle.js.map +1 -1
- package/dist/esm/vanilla-force-bundle.js +3 -2
- package/dist/esm/vanilla-force-bundle.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +20 -20
- package/dist/types/vanilla-force-bundle.d.ts.map +1 -1
- package/package.json +16 -15
- package/src/index.ts +31 -0
- package/src/salesforce-global-grid-options.ts +85 -0
- package/src/vanilla-force-bundle.ts +166 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -179,7 +179,7 @@ declare const Slicker: {
|
|
|
179
179
|
getInnerSize(elm: HTMLElement, type: "height" | "width"): number;
|
|
180
180
|
getStyleProp(elm: HTMLElement, property: string): string | null;
|
|
181
181
|
findFirstAttribute(inputElm: Element | null | undefined, attributes: string[]): string | null;
|
|
182
|
-
findWidthOrDefault(inputWidth?: string | number | undefined, defaultValue?: string | undefined): string;
|
|
182
|
+
findWidthOrDefault(inputWidth?: string | number | null | undefined, defaultValue?: string | undefined): string;
|
|
183
183
|
htmlEncode(inputValue: string): string;
|
|
184
184
|
htmlEntityDecode(input: string): string;
|
|
185
185
|
htmlEncodeWithPadding(inputStr: string, paddingLength: number): string;
|
|
@@ -188,16 +188,16 @@ declare const Slicker: {
|
|
|
188
188
|
left: number;
|
|
189
189
|
top: number;
|
|
190
190
|
};
|
|
191
|
+
extend<T_2 = any>(...args: any[]): T_2;
|
|
191
192
|
stripTags(htmlText: string | number | boolean | HTMLElement, allowableTags?: string | string[] | undefined, tagReplacement?: string | undefined): string;
|
|
192
|
-
addToArrayWhenNotExists<
|
|
193
|
+
addToArrayWhenNotExists<T_3 = any>(inputArray: T_3[], inputItem: T_3, itemIdPropName?: string | undefined): void;
|
|
193
194
|
addWhiteSpaces(nbSpaces: number, spaceChar?: string | undefined): string;
|
|
194
|
-
arrayRemoveItemByIndex<
|
|
195
|
+
arrayRemoveItemByIndex<T_4>(array: T_4[], index: number): T_4[];
|
|
195
196
|
deepCopy(objectOrArray: any): any;
|
|
196
197
|
deepMerge(target: any, ...sources: any[]): any;
|
|
197
|
-
objectAssignAndExtend(target: any, ...sources: any): any;
|
|
198
198
|
emptyObject(obj: any): any;
|
|
199
199
|
isEmptyObject(obj: any): boolean;
|
|
200
|
-
isDefined<
|
|
200
|
+
isDefined<T_5>(value: T_5 | null | undefined): value is T_5;
|
|
201
201
|
isObject(item: any): boolean;
|
|
202
202
|
isPrimitiveValue(val: any): boolean;
|
|
203
203
|
isPrimitiveOrHTML(val: any): boolean;
|
|
@@ -206,27 +206,27 @@ declare const Slicker: {
|
|
|
206
206
|
isObjectEmpty(obj: unknown): boolean;
|
|
207
207
|
parseBoolean(input: any): boolean;
|
|
208
208
|
removeAccentFromText(text: string, shouldLowerCase?: boolean | undefined): string;
|
|
209
|
-
setDeepValue<
|
|
209
|
+
setDeepValue<T_6 = unknown>(obj: T_6, path: string | string[], value: any): void;
|
|
210
210
|
titleCase(inputStr: string, shouldTitleCaseEveryWords?: boolean | undefined): string;
|
|
211
211
|
toCamelCase(inputStr: string): string;
|
|
212
212
|
toKebabCase(inputStr: string): string;
|
|
213
213
|
toSentenceCase(inputStr: string): string;
|
|
214
214
|
toSnakeCase(inputStr: string): string;
|
|
215
|
-
uniqueArray<
|
|
215
|
+
uniqueArray<T_7 = any>(arr: T_7[]): T_7[];
|
|
216
216
|
uniqueObjectArray(arr: any[], propertyName?: string | undefined): any[];
|
|
217
217
|
sortByFieldType(fieldType: "string" | "number" | "boolean" | "object" | "unknown" | "integer" | "float" | "date" | "dateIso" | "dateUtc" | "dateTime" | "dateTimeIso" | "dateTimeIsoAmPm" | "dateTimeIsoAM_PM" | "dateTimeShortIso" | "dateEuro" | "dateEuroShort" | "dateTimeShortEuro" | "dateTimeEuro" | "dateTimeEuroAmPm" | "dateTimeEuroAM_PM" | "dateTimeEuroShort" | "dateTimeEuroShortAmPm" | "dateTimeEuroShortAM_PM" | "dateUs" | "dateUsShort" | "dateTimeShortUs" | "dateTimeUs" | "dateTimeUsAmPm" | "dateTimeUsAM_PM" | "dateTimeUsShort" | "dateTimeUsShortAmPm" | "dateTimeUsShortAM_PM" | "password" | "text" | "readonly", value1: any, value2: any, sortDirection: number, sortColumn?: import("@slickgrid-universal/common").Column<any> | undefined, gridOptions?: import("@slickgrid-universal/common").GridOption<import("@slickgrid-universal/common").Column<any>> | undefined): number;
|
|
218
|
-
cancellablePromise<
|
|
219
|
-
castObservableToPromise<
|
|
220
|
-
addTreeLevelByMutation<
|
|
218
|
+
cancellablePromise<T_8 = any>(inputPromise: Promise<T_8>): import("@slickgrid-universal/common").CancellablePromiseWrapper<T_8>;
|
|
219
|
+
castObservableToPromise<T_9>(rxjs: import("@slickgrid-universal/common").RxJsFacade, input: Promise<T_9> | import("@slickgrid-universal/common").Observable<T_9> | import("@slickgrid-universal/common").Subject<T_9>, fromServiceName?: string | undefined): Promise<T_9>;
|
|
220
|
+
addTreeLevelByMutation<T_10>(treeArray: T_10[], options: {
|
|
221
221
|
childrenPropName: string;
|
|
222
222
|
levelPropName: string;
|
|
223
223
|
}, treeLevel?: number | undefined): void;
|
|
224
|
-
addTreeLevelAndAggregatorsByMutation<
|
|
224
|
+
addTreeLevelAndAggregatorsByMutation<T_11 = any>(treeArray: T_11[], options: {
|
|
225
225
|
aggregator: import("@slickgrid-universal/common").Aggregator;
|
|
226
226
|
childrenPropName: string;
|
|
227
227
|
levelPropName: string;
|
|
228
|
-
}, treeLevel?: number | undefined, parent?:
|
|
229
|
-
flattenToParentChildArray<
|
|
228
|
+
}, treeLevel?: number | undefined, parent?: T_11 | undefined): void;
|
|
229
|
+
flattenToParentChildArray<T_12>(treeArray: T_12[], options?: {
|
|
230
230
|
aggregators?: import("@slickgrid-universal/common").Aggregator[] | undefined;
|
|
231
231
|
parentPropName?: string | undefined;
|
|
232
232
|
childrenPropName?: string | undefined;
|
|
@@ -234,8 +234,8 @@ declare const Slicker: {
|
|
|
234
234
|
identifierPropName?: string | undefined;
|
|
235
235
|
shouldAddTreeLevelNumber?: boolean | undefined;
|
|
236
236
|
levelPropName?: string | undefined;
|
|
237
|
-
} | undefined): Omit<
|
|
238
|
-
unflattenParentChildArrayToTree<P_1,
|
|
237
|
+
} | undefined): Omit<T_12, number | typeof Symbol.iterator | "link" | "search" | "small" | "sub" | "sup" | "charAt" | "charCodeAt" | "concat" | "indexOf" | "lastIndexOf" | "localeCompare" | "match" | "replace" | "slice" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "length" | "substr" | "codePointAt" | "includes" | "endsWith" | "normalize" | "repeat" | "startsWith" | "anchor" | "big" | "blink" | "bold" | "fixed" | "fontcolor" | "fontsize" | "italics" | "strike" | "padStart" | "padEnd" | "trimEnd" | "trimStart" | "trimLeft" | "trimRight" | "matchAll" | "replaceAll" | "at" | "toString" | "valueOf" | "toLocaleString">[];
|
|
238
|
+
unflattenParentChildArrayToTree<P_1, T_13 extends P_1 & {
|
|
239
239
|
[childrenPropName: string]: P_1[];
|
|
240
240
|
}>(flatArray: P_1[], options?: {
|
|
241
241
|
aggregators?: import("@slickgrid-universal/common").Aggregator[] | undefined;
|
|
@@ -245,12 +245,12 @@ declare const Slicker: {
|
|
|
245
245
|
levelPropName?: string | undefined;
|
|
246
246
|
parentPropName?: string | undefined;
|
|
247
247
|
initiallyCollapsed?: boolean | undefined;
|
|
248
|
-
} | undefined):
|
|
249
|
-
findItemInTreeStructure<
|
|
248
|
+
} | undefined): T_13[];
|
|
249
|
+
findItemInTreeStructure<T_14 = any>(treeArray: T_14[], predicate: (item: T_14) => boolean, childrenPropertyName: string): T_14 | undefined;
|
|
250
250
|
decimalFormatted(input: string | number, minDecimal?: number | undefined, maxDecimal?: number | undefined, decimalSeparator?: "," | "." | undefined, thousandSeparator?: "" | "," | "_" | "." | " " | undefined): string;
|
|
251
251
|
formatNumber(input: string | number, minDecimal?: number | undefined, maxDecimal?: number | undefined, wrapNegativeNumberInBraquets?: boolean | undefined, symbolPrefix?: string | undefined, symbolSuffix?: string | undefined, decimalSeparator?: "," | "." | undefined, thousandSeparator?: "" | "," | "_" | "." | " " | undefined): string;
|
|
252
252
|
getCellValueFromQueryFieldGetter(columnDef: import("@slickgrid-universal/common").Column<any>, dataContext: any, defaultValue: any): string;
|
|
253
|
-
getDescendantProperty<
|
|
253
|
+
getDescendantProperty<T_15 = any>(object: T_15, path: string | undefined): any;
|
|
254
254
|
getTranslationPrefix(gridOptions?: import("@slickgrid-universal/common").GridOption<import("@slickgrid-universal/common").Column<any>> | undefined): string;
|
|
255
255
|
getColumnFieldType(columnDef: import("@slickgrid-universal/common").Column<any>): "string" | "number" | "boolean" | "object" | "unknown" | "integer" | "float" | "date" | "dateIso" | "dateUtc" | "dateTime" | "dateTimeIso" | "dateTimeIsoAmPm" | "dateTimeIsoAM_PM" | "dateTimeShortIso" | "dateEuro" | "dateEuroShort" | "dateTimeShortEuro" | "dateTimeEuro" | "dateTimeEuroAmPm" | "dateTimeEuroAM_PM" | "dateTimeEuroShort" | "dateTimeEuroShortAmPm" | "dateTimeEuroShortAM_PM" | "dateUs" | "dateUsShort" | "dateTimeShortUs" | "dateTimeUs" | "dateTimeUsAmPm" | "dateTimeUsAM_PM" | "dateTimeUsShort" | "dateTimeUsShortAmPm" | "dateTimeUsShortAM_PM" | "password" | "text" | "readonly";
|
|
256
256
|
isColumnDateType(fieldType: "string" | "number" | "boolean" | "object" | "unknown" | "integer" | "float" | "date" | "dateIso" | "dateUtc" | "dateTime" | "dateTimeIso" | "dateTimeIsoAmPm" | "dateTimeIsoAM_PM" | "dateTimeShortIso" | "dateEuro" | "dateEuroShort" | "dateTimeShortEuro" | "dateTimeEuro" | "dateTimeEuroAmPm" | "dateTimeEuroAM_PM" | "dateTimeEuroShort" | "dateTimeEuroShortAmPm" | "dateTimeEuroShortAM_PM" | "dateUs" | "dateUsShort" | "dateTimeShortUs" | "dateTimeUs" | "dateTimeUsAmPm" | "dateTimeUsAM_PM" | "dateTimeUsShort" | "dateTimeUsShortAmPm" | "dateTimeUsShortAM_PM" | "password" | "text" | "readonly"): boolean;
|
|
@@ -259,10 +259,10 @@ declare const Slicker: {
|
|
|
259
259
|
mapOperatorType(operator: Enums.OperatorString | Enums.OperatorType): Enums.OperatorType;
|
|
260
260
|
mapOperatorToShorthandDesignation(operator: Enums.OperatorString | Enums.OperatorType): Enums.OperatorString;
|
|
261
261
|
mapOperatorByFieldType(fieldType: "string" | "number" | "boolean" | "object" | "unknown" | "integer" | "float" | "date" | "dateIso" | "dateUtc" | "dateTime" | "dateTimeIso" | "dateTimeIsoAmPm" | "dateTimeIsoAM_PM" | "dateTimeShortIso" | "dateEuro" | "dateEuroShort" | "dateTimeShortEuro" | "dateTimeEuro" | "dateTimeEuroAmPm" | "dateTimeEuroAM_PM" | "dateTimeEuroShort" | "dateTimeEuroShortAmPm" | "dateTimeEuroShortAM_PM" | "dateUs" | "dateUsShort" | "dateTimeShortUs" | "dateTimeUs" | "dateTimeUsAmPm" | "dateTimeUsAM_PM" | "dateTimeUsShort" | "dateTimeUsShortAmPm" | "dateTimeUsShortAM_PM" | "password" | "text" | "readonly"): Enums.OperatorType;
|
|
262
|
-
objectWithoutKey<
|
|
262
|
+
objectWithoutKey<T_16 = any>(obj: T_16, omitKey: keyof T_16): T_16;
|
|
263
263
|
parseUtcDate(inputDateString: any, useUtc?: boolean | undefined): string;
|
|
264
264
|
thousandSeparatorFormatted(inputValue: string | number | null, separator?: "" | "," | "_" | "." | " " | undefined): string | null;
|
|
265
|
-
findOrDefault<
|
|
265
|
+
findOrDefault<T_17 = any>(array: T_17[], logic: (item: T_17) => boolean, defaultVal?: {} | undefined): any;
|
|
266
266
|
unsubscribeAll(subscriptions: (import("@slickgrid-universal/common").Subscription | import("@slickgrid-universal/common").EventSubscription)[]): (import("@slickgrid-universal/common").Subscription | import("@slickgrid-universal/common").EventSubscription)[];
|
|
267
267
|
CancelledException: typeof import("@slickgrid-universal/common").CancelledException;
|
|
268
268
|
collectionObserver(inputArray: any[], callback: (outputArray: any[], newValues: any[]) => void): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vanilla-force-bundle.d.ts","sourceRoot":"","sources":["../../src/vanilla-force-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,UAAU,EAEV,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"vanilla-force-bundle.d.ts","sourceRoot":"","sources":["../../src/vanilla-force-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,UAAU,EAEV,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAKhG,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAIxG,qBAAa,sBAAuB,SAAQ,sBAAsB;IAChE,oBAAoB,EAAE,6BAA6B,GAAG,SAAS,CAAC;IAEhE;;;;;;;;OAQG;gBAED,sBAAsB,EAAE,WAAW,EACnC,UAAU,CAAC,EAAE,MAAM,EAAE,EACrB,OAAO,CAAC,EAAE,UAAU,EACpB,OAAO,CAAC,EAAE,GAAG,EAAE,EACf,mBAAmB,CAAC,EAAE,GAAG,EAAE,EAC3B,QAAQ,CAAC,EAAE;QACT,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;QAC9C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;QACtC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;QACxC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;QACpC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;QACpC,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;QACpC,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;QACpC,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;QACtD,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;QACtC,cAAc,CAAC,EAAE,cAAc,CAAC;QAChC,IAAI,CAAC,EAAE,UAAU,CAAC;QAClB,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,eAAe,CAAC,EAAE,eAAe,CAAC;QAClC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;QACtC,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;KACvD;IAKH,gBAAgB,CAAC,WAAW,EAAE,UAAU;IAkCxC,SAAS,CAAC,iBAAiB;CAwD5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slickgrid-universal/vanilla-force-bundle",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Vanilla Slick Grid Bundle (mostly exist for our Salesforce implementation) - Similar to Vanilla Bundle, the only difference is that it adds extra packages within its bundle (CustomTooltip, CompositeEditor & TextExport)",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
|
-
"/dist"
|
|
28
|
+
"/dist",
|
|
29
|
+
"/src"
|
|
29
30
|
],
|
|
30
31
|
"note": "there are 2 bundler available vite & esbuild, but we really only use Vite only but we keep esbuild for reference",
|
|
31
32
|
"license": "MIT",
|
|
@@ -45,19 +46,19 @@
|
|
|
45
46
|
"not dead"
|
|
46
47
|
],
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@slickgrid-universal/binding": "~4.0
|
|
49
|
-
"@slickgrid-universal/common": "~4.0
|
|
50
|
-
"@slickgrid-universal/composite-editor-component": "~4.0
|
|
51
|
-
"@slickgrid-universal/custom-footer-component": "~4.0
|
|
52
|
-
"@slickgrid-universal/custom-tooltip-plugin": "~4.0
|
|
53
|
-
"@slickgrid-universal/empty-warning-component": "~4.0
|
|
54
|
-
"@slickgrid-universal/event-pub-sub": "~4.0
|
|
55
|
-
"@slickgrid-universal/excel-export": "~4.0
|
|
56
|
-
"@slickgrid-universal/pagination-component": "~4.0
|
|
57
|
-
"@slickgrid-universal/text-export": "~4.0
|
|
58
|
-
"@slickgrid-universal/utils": "~4.0
|
|
59
|
-
"@slickgrid-universal/vanilla-bundle": "~4.0
|
|
49
|
+
"@slickgrid-universal/binding": "~4.1.0",
|
|
50
|
+
"@slickgrid-universal/common": "~4.2.0",
|
|
51
|
+
"@slickgrid-universal/composite-editor-component": "~4.2.0",
|
|
52
|
+
"@slickgrid-universal/custom-footer-component": "~4.2.0",
|
|
53
|
+
"@slickgrid-universal/custom-tooltip-plugin": "~4.2.0",
|
|
54
|
+
"@slickgrid-universal/empty-warning-component": "~4.2.0",
|
|
55
|
+
"@slickgrid-universal/event-pub-sub": "~4.2.0",
|
|
56
|
+
"@slickgrid-universal/excel-export": "~4.2.0",
|
|
57
|
+
"@slickgrid-universal/pagination-component": "~4.2.0",
|
|
58
|
+
"@slickgrid-universal/text-export": "~4.2.0",
|
|
59
|
+
"@slickgrid-universal/utils": "~4.2.0",
|
|
60
|
+
"@slickgrid-universal/vanilla-bundle": "~4.2.0",
|
|
60
61
|
"whatwg-fetch": "^3.6.20"
|
|
61
62
|
},
|
|
62
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "d97d211a6c2d7d2f3ad65a3d5f19b27584e5ae8c"
|
|
63
64
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Aggregators, Editors, Enums, Filters, Formatters, GroupTotalFormatters, SlickGlobalEditorLock, SortComparers, Utilities } from '@slickgrid-universal/common';
|
|
2
|
+
import { BindingService } from '@slickgrid-universal/binding';
|
|
3
|
+
import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
|
|
4
|
+
import { SlickCompositeEditorComponent } from '@slickgrid-universal/composite-editor-component';
|
|
5
|
+
import { SlickEmptyWarningComponent } from '@slickgrid-universal/empty-warning-component';
|
|
6
|
+
import { SlickPaginationComponent } from '@slickgrid-universal/pagination-component';
|
|
7
|
+
import { VanillaForceGridBundle } from './vanilla-force-bundle';
|
|
8
|
+
|
|
9
|
+
const Slicker = {
|
|
10
|
+
GridBundle: VanillaForceGridBundle,
|
|
11
|
+
Aggregators,
|
|
12
|
+
BindingService,
|
|
13
|
+
Editors,
|
|
14
|
+
Enums,
|
|
15
|
+
Filters,
|
|
16
|
+
Formatters,
|
|
17
|
+
GroupTotalFormatters,
|
|
18
|
+
SlickGlobalEditorLock,
|
|
19
|
+
SortComparers,
|
|
20
|
+
Utilities,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// expose the bundle on the global "window" object as Slicker
|
|
24
|
+
if (typeof window !== 'undefined') {
|
|
25
|
+
(window as any).Slicker = Slicker;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { BindingService };
|
|
29
|
+
export { Aggregators, Editors, Enums, EventPubSubService, Filters, Formatters, GroupTotalFormatters, SortComparers, Utilities };
|
|
30
|
+
export { SlickCompositeEditorComponent, SlickEmptyWarningComponent, SlickPaginationComponent, VanillaForceGridBundle }; // export the custom components & interfaces
|
|
31
|
+
export { Slicker };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { GridOption } from '@slickgrid-universal/common';
|
|
2
|
+
import { EventNamingStyle } from '@slickgrid-universal/event-pub-sub';
|
|
3
|
+
|
|
4
|
+
/** Global Grid Options Defaults for Salesforce */
|
|
5
|
+
export const SalesforceGlobalGridOptions = {
|
|
6
|
+
autoEdit: true, // true single click (false for double-click)
|
|
7
|
+
autoCommitEdit: true,
|
|
8
|
+
autoFixResizeTimeout: 5 * 60 * 60, // interval is 200ms, so 5x is 1sec, so (5 * 60 * 60 = 60min)
|
|
9
|
+
autoFixResizeRequiredGoodCount: 5 * 60 * 60, // make it the same as the interval timeout, this is equivalent to say don't stop until the timeout is over
|
|
10
|
+
autoFixResizeWhenBrokenStyleDetected: true,
|
|
11
|
+
cellValueCouldBeUndefined: true,
|
|
12
|
+
contextMenu: {
|
|
13
|
+
hideCloseButton: false,
|
|
14
|
+
},
|
|
15
|
+
eventNamingStyle: EventNamingStyle.lowerCaseWithoutOnPrefix,
|
|
16
|
+
compositeEditorOptions: {
|
|
17
|
+
resetEditorButtonCssClass: 'mdi mdi-refresh mdi-15px mdi-v-align-text-top',
|
|
18
|
+
resetFormButtonIconCssClass: 'mdi mdi-refresh mdi-16px mdi-flip-h mdi-v-align-text-top',
|
|
19
|
+
shouldPreviewMassChangeDataset: true,
|
|
20
|
+
},
|
|
21
|
+
datasetIdPropertyName: 'Id',
|
|
22
|
+
emptyDataWarning: {
|
|
23
|
+
message: `<span class="mdi mdi-alert color-warning"></span> No data to display.`,
|
|
24
|
+
},
|
|
25
|
+
enableDeepCopyDatasetOnPageLoad: true,
|
|
26
|
+
enableTextExport: true,
|
|
27
|
+
textExportOptions: {
|
|
28
|
+
exportWithFormatter: true,
|
|
29
|
+
sanitizeDataExport: true,
|
|
30
|
+
},
|
|
31
|
+
enableCellNavigation: true,
|
|
32
|
+
customTooltip: {
|
|
33
|
+
tooltipTextMaxLength: 650,
|
|
34
|
+
},
|
|
35
|
+
enableExcelExport: true,
|
|
36
|
+
excelExportOptions: {
|
|
37
|
+
exportWithFormatter: true,
|
|
38
|
+
mimeType: '', // Salesforce doesn't like Excel MIME type (not allowed), but we can bypass the problem by using no type at all
|
|
39
|
+
sanitizeDataExport: true
|
|
40
|
+
},
|
|
41
|
+
filterTypingDebounce: 250,
|
|
42
|
+
formatterOptions: {
|
|
43
|
+
thousandSeparator: ','
|
|
44
|
+
},
|
|
45
|
+
frozenHeaderWidthCalcDifferential: 2,
|
|
46
|
+
columnPicker: {
|
|
47
|
+
hideForceFitButton: true,
|
|
48
|
+
},
|
|
49
|
+
gridMenu: {
|
|
50
|
+
commandLabels: {
|
|
51
|
+
clearFrozenColumnsCommandKey: 'UNFREEZE_COLUMNS',
|
|
52
|
+
},
|
|
53
|
+
hideTogglePreHeaderCommand: true,
|
|
54
|
+
hideRefreshDatasetCommand: true,
|
|
55
|
+
hideClearFrozenColumnsCommand: false,
|
|
56
|
+
hideForceFitButton: true,
|
|
57
|
+
},
|
|
58
|
+
headerMenu: {
|
|
59
|
+
hideFreezeColumnsCommand: false,
|
|
60
|
+
iconSortAscCommand: 'fa fa-sort-amount-asc mdi mdi-arrow-up',
|
|
61
|
+
iconSortDescCommand: 'fa fa-sort-amount-desc mdi mdi-arrow-down',
|
|
62
|
+
},
|
|
63
|
+
preventDocumentFragmentUsage: true,
|
|
64
|
+
sanitizer: (dirtyHtml: string) => typeof dirtyHtml === 'string' ? dirtyHtml.replace(/(\b)(on[a-z]+)(\s*)=|javascript:([^>]*)[^>]*|(<\s*)(\/*)script([<>]*).*(<\s*)(\/*)script(>*)|(<)(\/*)(script|script defer)(.*)(>|>">)/gi, '') : dirtyHtml,
|
|
65
|
+
showCustomFooter: true,
|
|
66
|
+
customFooterOptions: {
|
|
67
|
+
hideMetrics: false,
|
|
68
|
+
hideTotalItemCount: false,
|
|
69
|
+
hideLastUpdateTimestamp: true,
|
|
70
|
+
metricTexts: {
|
|
71
|
+
itemsSelectedKey: 'RECORDS_SELECTED',
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
headerRowHeight: 35,
|
|
75
|
+
rowHeight: 33,
|
|
76
|
+
resizeByContentOnlyOnFirstLoad: false,
|
|
77
|
+
resizeByContentOptions: {
|
|
78
|
+
formatterPaddingWidthInPx: 8,
|
|
79
|
+
maxItemToInspectCellContentWidth: 500,
|
|
80
|
+
},
|
|
81
|
+
rowMoveManager: {
|
|
82
|
+
hideRowMoveShadow: false,
|
|
83
|
+
},
|
|
84
|
+
useSalesforceDefaultGridOptions: true,
|
|
85
|
+
} as GridOption;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Column,
|
|
3
|
+
GridOption,
|
|
4
|
+
// services
|
|
5
|
+
BackendUtilityService,
|
|
6
|
+
CollectionService,
|
|
7
|
+
ExtensionService,
|
|
8
|
+
ExtensionUtility,
|
|
9
|
+
FilterService,
|
|
10
|
+
GridEventService,
|
|
11
|
+
GridService,
|
|
12
|
+
GridStateService,
|
|
13
|
+
GroupingAndColspanService,
|
|
14
|
+
PaginationService,
|
|
15
|
+
ResizerService,
|
|
16
|
+
RxJsFacade,
|
|
17
|
+
SharedService,
|
|
18
|
+
SortService,
|
|
19
|
+
TranslaterService,
|
|
20
|
+
TreeDataService,
|
|
21
|
+
} from '@slickgrid-universal/common';
|
|
22
|
+
import { GlobalGridOptions } from '@slickgrid-universal/common';
|
|
23
|
+
import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
|
|
24
|
+
import { ExcelExportService } from '@slickgrid-universal/excel-export';
|
|
25
|
+
import { SlickCompositeEditorComponent } from '@slickgrid-universal/composite-editor-component';
|
|
26
|
+
import { SlickEmptyWarningComponent } from '@slickgrid-universal/empty-warning-component';
|
|
27
|
+
import { SlickCustomTooltip } from '@slickgrid-universal/custom-tooltip-plugin';
|
|
28
|
+
import { TextExportService } from '@slickgrid-universal/text-export';
|
|
29
|
+
import { extend } from '@slickgrid-universal/utils';
|
|
30
|
+
import { SlickVanillaGridBundle, UniversalContainerService } from '@slickgrid-universal/vanilla-bundle';
|
|
31
|
+
|
|
32
|
+
import { SalesforceGlobalGridOptions } from './salesforce-global-grid-options';
|
|
33
|
+
|
|
34
|
+
export class VanillaForceGridBundle extends SlickVanillaGridBundle {
|
|
35
|
+
slickCompositeEditor: SlickCompositeEditorComponent | undefined;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Salesforce Slicker Grid Bundle constructor
|
|
39
|
+
* @param {Object} gridParentContainerElm - div HTML DOM element container
|
|
40
|
+
* @param {Array<Column>} columnDefs - Column Definitions
|
|
41
|
+
* @param {Object} options - Grid Options
|
|
42
|
+
* @param {Array<Object>} dataset - Dataset
|
|
43
|
+
* @param {Array<Object>} hierarchicalDataset - Hierarchical Dataset
|
|
44
|
+
* @param {Object} services - Typically only used for Unit Testing when we want to pass Mocked/Stub Services
|
|
45
|
+
*/
|
|
46
|
+
constructor(
|
|
47
|
+
gridParentContainerElm: HTMLElement,
|
|
48
|
+
columnDefs?: Column[],
|
|
49
|
+
options?: GridOption,
|
|
50
|
+
dataset?: any[],
|
|
51
|
+
hierarchicalDataset?: any[],
|
|
52
|
+
services?: {
|
|
53
|
+
backendUtilityService?: BackendUtilityService,
|
|
54
|
+
collectionService?: CollectionService,
|
|
55
|
+
eventPubSubService?: EventPubSubService,
|
|
56
|
+
extensionService?: ExtensionService,
|
|
57
|
+
extensionUtility?: ExtensionUtility,
|
|
58
|
+
filterService?: FilterService,
|
|
59
|
+
gridEventService?: GridEventService,
|
|
60
|
+
gridService?: GridService,
|
|
61
|
+
gridStateService?: GridStateService,
|
|
62
|
+
groupingAndColspanService?: GroupingAndColspanService,
|
|
63
|
+
paginationService?: PaginationService,
|
|
64
|
+
resizerService?: ResizerService,
|
|
65
|
+
rxjs?: RxJsFacade,
|
|
66
|
+
sharedService?: SharedService,
|
|
67
|
+
sortService?: SortService,
|
|
68
|
+
treeDataService?: TreeDataService,
|
|
69
|
+
translaterService?: TranslaterService,
|
|
70
|
+
universalContainerService?: UniversalContainerService,
|
|
71
|
+
}
|
|
72
|
+
) {
|
|
73
|
+
super(gridParentContainerElm, columnDefs, options, dataset, hierarchicalDataset, services);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
mergeGridOptions(gridOptions: GridOption) {
|
|
77
|
+
const extraOptions = (gridOptions.useSalesforceDefaultGridOptions || (this._gridOptions?.useSalesforceDefaultGridOptions)) ? SalesforceGlobalGridOptions : {};
|
|
78
|
+
const options = extend(true, {}, GlobalGridOptions, extraOptions, gridOptions);
|
|
79
|
+
|
|
80
|
+
// also make sure to show the header row if user have enabled filtering
|
|
81
|
+
if (options.enableFiltering && !options.showHeaderRow) {
|
|
82
|
+
options.showHeaderRow = options.enableFiltering;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// using copy extend to do a deep clone has an unwanted side on objects and pageSizes but ES6 spread has other worst side effects
|
|
86
|
+
// so we will just overwrite the pageSizes when needed, this is the only one causing issues so far.
|
|
87
|
+
// On a deep extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not.
|
|
88
|
+
if (options?.pagination && (gridOptions.enablePagination || gridOptions.backendServiceApi) && gridOptions.pagination && Array.isArray(gridOptions.pagination.pageSizes)) {
|
|
89
|
+
options.pagination.pageSizes = gridOptions.pagination.pageSizes;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// when we use Pagination on Local Grid, it doesn't seem to work without enableFiltering
|
|
93
|
+
// so we'll enable the filtering but we'll keep the header row hidden
|
|
94
|
+
if (!options.enableFiltering && options.enablePagination && this._isLocalGrid) {
|
|
95
|
+
options.enableFiltering = true;
|
|
96
|
+
options.showHeaderRow = false;
|
|
97
|
+
this._hideHeaderRowAfterPageLoad = true;
|
|
98
|
+
if (this.sharedService) {
|
|
99
|
+
this.sharedService.hideHeaderRowAfterPageLoad = true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return options;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// --
|
|
107
|
+
// protected functions
|
|
108
|
+
// ------------------
|
|
109
|
+
|
|
110
|
+
protected registerResources() {
|
|
111
|
+
// when using Salesforce, we want the Export to CSV always enabled without registering it
|
|
112
|
+
if (this.gridOptions.enableTextExport) {
|
|
113
|
+
this._registeredResources.push(new TextExportService());
|
|
114
|
+
}
|
|
115
|
+
if (this.gridOptions.enableTextExport) {
|
|
116
|
+
this._registeredResources.push(new ExcelExportService());
|
|
117
|
+
}
|
|
118
|
+
this._registeredResources.push(new SlickCustomTooltip());
|
|
119
|
+
|
|
120
|
+
// at this point, we consider all the registered services as external services, anything else registered afterward aren't external
|
|
121
|
+
if (Array.isArray(this._registeredResources)) {
|
|
122
|
+
this.sharedService.externalRegisteredResources = this._registeredResources;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// push all other Services that we want to be registered
|
|
126
|
+
this._registeredResources.push(this.gridService, this.gridStateService);
|
|
127
|
+
|
|
128
|
+
// when using Grouping/DraggableGrouping/Colspan register its Service
|
|
129
|
+
if (this.gridOptions.createPreHeaderPanel && !this.gridOptions.enableDraggableGrouping) {
|
|
130
|
+
this._registeredResources.push(this.groupingService);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// when using Tree Data View, register its Service
|
|
134
|
+
if (this.gridOptions.enableTreeData) {
|
|
135
|
+
this._registeredResources.push(this.treeDataService);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// when user enables translation, we need to translate Headers on first pass & subsequently in the bindDifferentHooks
|
|
139
|
+
if (this.gridOptions.enableTranslate) {
|
|
140
|
+
this.extensionService.translateColumnHeaders();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// also initialize (render) the empty warning component
|
|
144
|
+
this.slickEmptyWarning = new SlickEmptyWarningComponent();
|
|
145
|
+
this._registeredResources.push(this.slickEmptyWarning);
|
|
146
|
+
|
|
147
|
+
// also initialize (render) the pagination component when using the salesforce default options
|
|
148
|
+
// however before adding a new instance, just make sure there isn't one that might have been loaded by calling "registerExternalResources"
|
|
149
|
+
if (this.gridOptions.enableCompositeEditor) {
|
|
150
|
+
if (!this._registeredResources.some((resource => resource instanceof SlickCompositeEditorComponent))) {
|
|
151
|
+
this.slickCompositeEditor = new SlickCompositeEditorComponent();
|
|
152
|
+
this._registeredResources.push(this.slickCompositeEditor);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// bind & initialize all Components/Services that were tagged as enabled
|
|
157
|
+
// register all services by executing their init method and providing them with the Grid object
|
|
158
|
+
if (Array.isArray(this._registeredResources)) {
|
|
159
|
+
for (const resource of this._registeredResources) {
|
|
160
|
+
if (this.slickGrid && typeof resource.init === 'function') {
|
|
161
|
+
resource.init(this.slickGrid, this.universalContainerService);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|