slick-table 1.1.46 → 1.1.48
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/index.cjs.js +71 -71
- package/dist/index.es.js +599 -644
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/index.d.ts +1 -1
- package/dist/types/shared/lib/slickgrid/index.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/lib/editors/Autocomplete/Autocomplete.d.ts +1 -2
- package/dist/types/shared/lib/slickgrid/lib/editors/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/lib/editors/Autocomplete/EditorAutocomplete.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/lib/editors/Autocomplete/EditorSelectWithSearch.d.ts +15 -0
- package/dist/types/shared/lib/slickgrid/lib/editors/Autocomplete/EditorSelectWithSearch.d.ts.map +1 -0
- package/dist/types/shared/lib/slickgrid/lib/editors/Autocomplete/index.d.ts +1 -0
- package/dist/types/shared/lib/slickgrid/lib/editors/Autocomplete/index.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/lib/editors/index.d.ts +1 -1
- package/dist/types/shared/lib/slickgrid/lib/editors/index.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/lib/index.d.ts +1 -1
- package/dist/types/shared/lib/slickgrid/lib/index.d.ts.map +1 -1
- package/package.json +1 -3
- package/src/app/styles/slick-table.scss +19 -21
- package/src/index.ts +0 -1
- package/src/shared/lib/slickgrid/index.ts +1 -0
- package/src/shared/lib/slickgrid/lib/editors/Autocomplete/Autocomplete.ts +12 -32
- package/src/shared/lib/slickgrid/lib/editors/Autocomplete/EditorAutocomplete.ts +18 -3
- package/src/shared/lib/slickgrid/lib/editors/Autocomplete/EditorSelectWithSearch.ts +79 -0
- package/src/shared/lib/slickgrid/lib/editors/Autocomplete/index.ts +1 -0
- package/src/shared/lib/slickgrid/lib/editors/index.ts +5 -1
- package/src/shared/lib/slickgrid/lib/index.ts +1 -0
- package/dist/styles/slick-table.scss +0 -21
package/dist/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { PopupSummary } from './entities/popup-summary';
|
|
|
3
3
|
export { ColumnFilters } from './features/column-filters';
|
|
4
4
|
export { ContextMenu } from './features/context-menu';
|
|
5
5
|
export { HeaderContextMenu } from './features/header-context-menu';
|
|
6
|
-
export { Autocomplete, ColumnPicker, ColumnSorter, DecoratorColumnFilter, DecoratorFilter, DefaultHotKeys, DefaultPrinter, DeletedRowsFilter,
|
|
6
|
+
export { Autocomplete, ColumnPicker, ColumnSorter, DecoratorColumnFilter, DecoratorFilter, DefaultHotKeys, DefaultPrinter, DeletedRowsFilter, FORMATTER_NUMBER, Filter, HotKeysDecorator, PreventCopying, RedoUndoOnly, SlickTable, SlickgridTable, TotalCalculator, WithSummary, WithoutHotKeys, columnIsEdited, columnCheckboxSelector, commitCurrentEdit, copySelectedRows, formatterGroupTotals, formatterCheckMark, getDisplayedRows, getFormatterNumber, getNextId, handleHeaderButtons, headerButtons, highlightCell, highlightColumns, hotKeysCopy, hotKeysDelete, hotKeysRedo, hotKeysUndo, openColumnFilter, openContextMenu, printerCheckMark, useListenIfTablesWereEdited, } from './shared/lib/slickgrid';
|
|
7
7
|
export { formatNumber } from './shared/lib/format';
|
|
8
8
|
export type { IColumn, IFilter, IFilterArguments, IFormatterNumberOptions, IHotKeysBehavior, IPrinter, ISlickTable, ITotalCalculator, } from './shared/model/types';
|
|
9
9
|
export { BOLD, WINK } from './shared/model/consts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EACX,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,gBAAgB,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EACN,aAAa,EACb,mBAAmB,EACnB,SAAS,GACT,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Autocomplete, ColumnSorter, DateFormatter, DateValidator, EditorAmount, EditorAutocomplete, EditorDate, EditorSelectString, EditorSelectNumber, EmptyStringValidator, FORMATTER_NUMBER, LengthValidator, PercentFormatter, StringFormatter, TotalCalculator, formatterCheckMark, formatterGroupTotals, getFormatterNumber, columnSorter, commitCurrentEdit, copySelectedRows, deleteRows, getDisplayedRows, getLastRow, getNextId, getUpdates, highlightCell, highlightColumns, hotKeysCopy, hotKeysDelete, hotKeysRedo, hotKeysUndo, isDeletionDangerous, onCellChange, onRowCountChanged, onRowsChanged, openContextMenu, printerCheckMark, selectedRows, useHotKeys, useListenIfTablesWereEdited, useUpdateTotal, wereEdited, } from './lib';
|
|
1
|
+
export { Autocomplete, ColumnSorter, DateFormatter, DateValidator, EditorAmount, EditorAutocomplete, EditorDate, EditorSelectString, EditorSelectNumber, EditorSelectWithSearch, EmptyStringValidator, FORMATTER_NUMBER, LengthValidator, PercentFormatter, StringFormatter, TotalCalculator, formatterCheckMark, formatterGroupTotals, getFormatterNumber, columnSorter, commitCurrentEdit, copySelectedRows, deleteRows, getDisplayedRows, getLastRow, getNextId, getUpdates, highlightCell, highlightColumns, hotKeysCopy, hotKeysDelete, hotKeysRedo, hotKeysUndo, isDeletionDangerous, onCellChange, onRowCountChanged, onRowsChanged, openContextMenu, printerCheckMark, selectedRows, useHotKeys, useListenIfTablesWereEdited, useUpdateTotal, wereEdited, } from './lib';
|
|
2
2
|
export { ColumnPicker, DownloadManager, DecoratorEndingDate, DecoratorFilter, DecoratorColumnFilter, DecoratorPeriod, DefaultHotKeys, DefaultPrinter, DeletedRowsFilter, Filter, HotKeysDecorator, PreventCopying, RedoUndoOnly, SlickTable, WithConfirmationOfDeletion, WithSummary, WithoutHotKeys, eventContextMenu, eventHeaderContextMenu, eventSummary, } from './model';
|
|
3
3
|
export { SlickgridTable, WithTableStyles, columnCheckboxSelector, columnIsEdited, eventOpenColumnFilters, handleHeaderButtons, headerButtons, openColumnFilter, } from './ui';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/lib/slickgrid/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,2BAA2B,EAC3B,cAAc,EACd,UAAU,GACV,MAAM,OAAO,CAAC;AACf,OAAO,EACN,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,0BAA0B,EAC1B,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,GAChB,MAAM,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/lib/slickgrid/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,2BAA2B,EAC3B,cAAc,EACd,UAAU,GACV,MAAM,OAAO,CAAC;AACf,OAAO,EACN,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,0BAA0B,EAC1B,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,GAChB,MAAM,MAAM,CAAC"}
|
|
@@ -11,13 +11,12 @@ export declare abstract class Autocomplete implements Editor {
|
|
|
11
11
|
protected navOnLR?: boolean;
|
|
12
12
|
applyValue(item: any, state: any): void;
|
|
13
13
|
closeAllList(): void;
|
|
14
|
-
createList(): void;
|
|
15
14
|
destroy(): void;
|
|
16
15
|
focus(): void;
|
|
17
16
|
init(): void;
|
|
18
17
|
isValueChanged(): boolean;
|
|
19
18
|
loadValue(item: ISlickRow): void;
|
|
20
|
-
makeVisible(): void;
|
|
19
|
+
makeVisible(list: HTMLDivElement): void;
|
|
21
20
|
abstract onClick(event: MouseEvent): void;
|
|
22
21
|
abstract onInput(event: Event): void;
|
|
23
22
|
onKeydown(event: KeyboardEvent): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/lib/editors/Autocomplete/Autocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,eAAe,EACf,sBAAsB,
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/lib/editors/Autocomplete/Autocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,eAAe,EACf,sBAAsB,EAEtB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,8BAAsB,YAAa,YAAW,MAAM;IACnD,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9C,SAAS,CAAC,YAAY,SAAM;IAC5B,SAAS,CAAC,YAAY,SAAM;IAC5B,SAAS,CAAC,EAAE,SAA8B;IAC1C,SAAS,CAAC,KAAK,EAAE,gBAAgB,CAAmC;IAC7D,cAAc,EAAE,MAAM,EAAE,CAA6C;IAC5E,SAAS,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE5B,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAGvC,YAAY,IAAI,IAAI;IAKpB,OAAO,IAAI,IAAI;IAMf,KAAK,IAAI,IAAI;IAGb,IAAI,IAAI,IAAI;IAWZ,cAAc,IAAI,OAAO;IAMzB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAOhC,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI;IAsBvC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IACzC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IACpC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IA8BrC,YAAY,CAAC,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,GAAG,IAAI;IAKvD,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAW5C,cAAc,IAAI,MAAM;IAGxB,SAAS,CAAC,IAAI,EAAE,gBAAgB,CAAC,cAAc,CAAC,GAAG,IAAI;IASvD,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAC1C,QAAQ,IAAI,sBAAsB;CAelC"}
|
package/dist/types/shared/lib/slickgrid/lib/editors/Autocomplete/EditorAutocomplete.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorAutocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/lib/editors/Autocomplete/EditorAutocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"EditorAutocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/lib/editors/Autocomplete/EditorAutocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,eAAe,EAEf,UAAU,EAEV,MAAM,WAAW,CAAC;AAKnB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,qBAAa,kBAAkB,CAC9B,KAAK,GAAG,GAAG,EACX,CAAC,SAAS,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,EACvC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CACtC,SAAQ,YAAY;IAGF,IAAI,EAAE,eAAe,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAFrD,SAAS,CAAC,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;gBAEpB,IAAI,EAAE,eAAe,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAuBrD,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAK3B,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAShC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAyBjC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Column, EditorArguments, GridOption } from 'slickgrid';
|
|
2
|
+
import { ISlickRow } from '../../../../../model/types';
|
|
3
|
+
import { Autocomplete } from './Autocomplete';
|
|
4
|
+
export declare class EditorSelectWithSearch<TData = any, C extends Column<TData> = Column<TData>, O extends GridOption<C> = GridOption<C>> extends Autocomplete {
|
|
5
|
+
args: EditorArguments<TData, C, O>;
|
|
6
|
+
protected hash: Record<string, string>;
|
|
7
|
+
protected reversedHash: Record<string, string>;
|
|
8
|
+
constructor(args: EditorArguments<TData, C, O>);
|
|
9
|
+
applyValue(item: any, state: any): void;
|
|
10
|
+
loadValue(item: ISlickRow): void;
|
|
11
|
+
onInput(event: Event): void;
|
|
12
|
+
onClick(event: MouseEvent): void;
|
|
13
|
+
showOptions(search: string): void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=EditorSelectWithSearch.d.ts.map
|
package/dist/types/shared/lib/slickgrid/lib/editors/Autocomplete/EditorSelectWithSearch.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorSelectWithSearch.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/lib/editors/Autocomplete/EditorSelectWithSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGhE,OAAO,EAAW,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,qBAAa,sBAAsB,CAClC,KAAK,GAAG,GAAG,EACX,CAAC,SAAS,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,EACvC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CACtC,SAAQ,YAAY;IAIF,IAAI,EAAE,eAAe,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAHrD,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAE5B,IAAI,EAAE,eAAe,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAmBrD,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAIvC,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAQhC,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAK3B,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAKhC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAsBjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/lib/editors/Autocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/lib/editors/Autocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { EditorAmount } from './EditorAmount';
|
|
2
|
-
export { Autocomplete, EditorAutocomplete } from './Autocomplete';
|
|
2
|
+
export { Autocomplete, EditorAutocomplete, EditorSelectWithSearch, } from './Autocomplete';
|
|
3
3
|
export { EditorDate } from './EditorDate';
|
|
4
4
|
export { EditorSelectString } from './EditorSelectString';
|
|
5
5
|
export { EditorSelectNumber } from './EditorSelectNumber';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/lib/slickgrid/lib/editors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/lib/slickgrid/lib/editors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -3,7 +3,7 @@ export { openContextMenu } from './contextMenu';
|
|
|
3
3
|
export { openHeaderContextMenu } from './header-context-menu';
|
|
4
4
|
export { useHotKeys, useListenIfTablesWereEdited, useResizeCanvas, useUpdateTotal, } from './hooks';
|
|
5
5
|
export { hotKeysCopy, hotKeysDelete, hotKeysOpenSummary, hotKeysRedo, hotKeysReverse, hotKeysUndo, nothingToCopy, positionToPaste, } from './hotKeys';
|
|
6
|
-
export { Autocomplete, EditorAmount, EditorAutocomplete, EditorDate, EditorSelectString, EditorSelectNumber, } from './editors';
|
|
6
|
+
export { Autocomplete, EditorAmount, EditorAutocomplete, EditorDate, EditorSelectString, EditorSelectNumber, EditorSelectWithSearch, } from './editors';
|
|
7
7
|
export { FORMATTER_NUMBER, DateFormatter, formatterCheckMark, getFormatterNumber, PercentFormatter, StringFormatter, } from './formatters';
|
|
8
8
|
export { commitCurrentEdit, copySelectedRows, deleteRows, getActiveRowId, getDisplayedRows, getLastRow, getNextId, isDeletionDangerous, wereEdited, } from './functions';
|
|
9
9
|
export { formatterGroupTotals } from './grouping';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/lib/slickgrid/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,aAAa,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACN,UAAU,EACV,2BAA2B,EAC3B,eAAe,EACf,cAAc,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/lib/slickgrid/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,aAAa,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACN,UAAU,EACV,2BAA2B,EAC3B,eAAe,EACf,cAAc,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,UAAU,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACN,aAAa,EACb,oBAAoB,EACpB,eAAe,GACf,MAAM,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slick-table",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.48",
|
|
4
4
|
"description": "Enhanced version of SlickGrid library",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"import": "./dist/index.es.js",
|
|
14
14
|
"require": "./dist/index.cjs.js"
|
|
15
15
|
},
|
|
16
|
-
"./styles": "./dist/styles/slick-table.scss",
|
|
17
16
|
"./package.json": "./package.json"
|
|
18
17
|
},
|
|
19
18
|
"files": [
|
|
@@ -37,7 +36,6 @@
|
|
|
37
36
|
"scripts": {
|
|
38
37
|
"dev": "vite",
|
|
39
38
|
"build": "vite build",
|
|
40
|
-
"postbuild": "node scripts/copy-styles.mjs",
|
|
41
39
|
"lint": "eslint .",
|
|
42
40
|
"pack": "npm pack --dry-run",
|
|
43
41
|
"version:patch": "npm version patch",
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
#slick-table-autocomplete {
|
|
2
|
-
background-color: white;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
1
|
+
#slick-table-autocomplete {
|
|
2
|
+
background-color: white;
|
|
3
|
+
z-index: 1;
|
|
4
|
+
position: absolute;
|
|
5
|
+
color: #1E456F;
|
|
6
|
+
box-shadow: gray 0px 0px 5px 1px;
|
|
7
|
+
font-size: 0.75rem;
|
|
8
|
+
|
|
9
|
+
strong {
|
|
10
|
+
color: rgb(0, 123, 255)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
div.active,
|
|
14
|
+
div:hover {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
background-color: #e8f4fe;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
package/src/index.ts
CHANGED
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
Editor,
|
|
3
3
|
EditorArguments,
|
|
4
4
|
EditorValidationResult,
|
|
5
|
-
ElementPosition,
|
|
6
5
|
keyCode,
|
|
7
6
|
} from "slickgrid";
|
|
8
7
|
|
|
@@ -27,19 +26,6 @@ export abstract class Autocomplete implements Editor {
|
|
|
27
26
|
this.list = undefined;
|
|
28
27
|
this.currentFocus = -1;
|
|
29
28
|
}
|
|
30
|
-
createList() {
|
|
31
|
-
this.list = document.createElement("div");
|
|
32
|
-
const container = document.getElementById("root");
|
|
33
|
-
if (!container) return;
|
|
34
|
-
container.appendChild(this.list);
|
|
35
|
-
this.list.setAttribute("tabIndex", "0"); // this.input.addEventListener("blur", ...) doesn't work without it
|
|
36
|
-
this.list.setAttribute("id", this.id);
|
|
37
|
-
const { top, left, right } = this.args.position as ElementPosition;
|
|
38
|
-
const rowHeight = this.args.grid.getOptions().rowHeight || 25;
|
|
39
|
-
this.list.style.top = `${top + rowHeight}px`;
|
|
40
|
-
this.list.style.left = `${left}px`;
|
|
41
|
-
this.list.style.minWidth = `${right - left}px`;
|
|
42
|
-
}
|
|
43
29
|
destroy(): void {
|
|
44
30
|
this.input.removeEventListener("input", this.onInput.bind(this));
|
|
45
31
|
this.input.removeEventListener("keydown", this.onKeydown.bind(this));
|
|
@@ -57,13 +43,6 @@ export abstract class Autocomplete implements Editor {
|
|
|
57
43
|
|
|
58
44
|
this.input.addEventListener("input", this.onInput.bind(this));
|
|
59
45
|
this.input.addEventListener("keydown", this.onKeydown.bind(this));
|
|
60
|
-
this.input.addEventListener("blur", ({ relatedTarget }) => {
|
|
61
|
-
if ((relatedTarget as HTMLDivElement | null)?.id === this.id) {
|
|
62
|
-
this.focus();
|
|
63
|
-
} else {
|
|
64
|
-
this.closeAllList();
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
46
|
this.input.focus();
|
|
68
47
|
this.input.select();
|
|
69
48
|
}
|
|
@@ -80,25 +59,26 @@ export abstract class Autocomplete implements Editor {
|
|
|
80
59
|
this.input.focus();
|
|
81
60
|
this.input.select();
|
|
82
61
|
}
|
|
83
|
-
makeVisible(): void {
|
|
84
|
-
|
|
62
|
+
makeVisible(list: HTMLDivElement): void {
|
|
63
|
+
const canvas = this.args.container.closest(".slick-viewport");
|
|
64
|
+
if (!canvas) return;
|
|
85
65
|
const {
|
|
86
66
|
bottom: listBottom,
|
|
87
67
|
left: listLeft,
|
|
88
68
|
right: listRight,
|
|
89
69
|
top: listTop,
|
|
90
|
-
} =
|
|
91
|
-
const { bottom:
|
|
92
|
-
|
|
93
|
-
if (listBottom >=
|
|
70
|
+
} = list.getBoundingClientRect();
|
|
71
|
+
const { bottom: canvasBottom, right: canvasRight } =
|
|
72
|
+
canvas.getBoundingClientRect();
|
|
73
|
+
if (listBottom >= canvasBottom) {
|
|
94
74
|
const rowHeight = this.args.grid.getOptions().rowHeight || 25;
|
|
95
75
|
const listHeight = listBottom - listTop;
|
|
96
|
-
|
|
76
|
+
list.style.top = `${listTop - listHeight - rowHeight}px`;
|
|
97
77
|
}
|
|
98
|
-
if (listRight >=
|
|
78
|
+
if (listRight >= canvasRight) {
|
|
99
79
|
const { right: cellRight } = this.args.container.getBoundingClientRect();
|
|
100
80
|
const exceeding = listRight - cellRight;
|
|
101
|
-
|
|
81
|
+
list.style.left = `${listLeft - exceeding}px`;
|
|
102
82
|
}
|
|
103
83
|
}
|
|
104
84
|
abstract onClick(event: MouseEvent): void;
|
|
@@ -128,8 +108,8 @@ export abstract class Autocomplete implements Editor {
|
|
|
128
108
|
this.currentFocus = 0;
|
|
129
109
|
}
|
|
130
110
|
if (this.currentFocus > -1) {
|
|
131
|
-
|
|
132
|
-
if (items) items[this.currentFocus].click();
|
|
111
|
+
/* simulate click on the "active" item */
|
|
112
|
+
if (items) items[this.currentFocus].click();
|
|
133
113
|
}
|
|
134
114
|
}
|
|
135
115
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Column,
|
|
3
|
+
EditorArguments,
|
|
4
|
+
ElementPosition,
|
|
5
|
+
GridOption,
|
|
6
|
+
SlickDataView,
|
|
7
|
+
} from "slickgrid";
|
|
2
8
|
|
|
3
9
|
import { escapeSpecialChar } from "shared/lib/regexp";
|
|
4
10
|
import { IColumn } from "shared/model/types";
|
|
@@ -50,7 +56,16 @@ export class EditorAutocomplete<
|
|
|
50
56
|
this.args.grid.navigateNext();
|
|
51
57
|
}
|
|
52
58
|
showOptions(search: string): void {
|
|
53
|
-
this.
|
|
59
|
+
this.list = document.createElement("div");
|
|
60
|
+
const container = document.getElementById("root");
|
|
61
|
+
if (!container) return;
|
|
62
|
+
container.appendChild(this.list);
|
|
63
|
+
this.list.setAttribute("id", this.id);
|
|
64
|
+
const { top, left, right } = this.args.position as ElementPosition;
|
|
65
|
+
const rowHeight = this.args.grid.getOptions().rowHeight || 25;
|
|
66
|
+
this.list.style.top = `${top + rowHeight}px`;
|
|
67
|
+
this.list.style.left = `${left}px`;
|
|
68
|
+
this.list.style.minWidth = `${right - left}px`;
|
|
54
69
|
this.suggestionsList.forEach((name: string) => {
|
|
55
70
|
const hasOverlap = name.match(new RegExp(escapeSpecialChar(search), "i"));
|
|
56
71
|
if (hasOverlap) {
|
|
@@ -63,6 +78,6 @@ export class EditorAutocomplete<
|
|
|
63
78
|
this.list?.appendChild(listItem);
|
|
64
79
|
}
|
|
65
80
|
});
|
|
66
|
-
this.makeVisible();
|
|
81
|
+
this.makeVisible(this.list);
|
|
67
82
|
}
|
|
68
83
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Column, EditorArguments, GridOption } from "slickgrid";
|
|
2
|
+
|
|
3
|
+
import { escapeSpecialChar } from "shared/lib/regexp";
|
|
4
|
+
import { IColumn, ISlickRow } from "shared/model/types";
|
|
5
|
+
|
|
6
|
+
import { Autocomplete } from "./Autocomplete";
|
|
7
|
+
|
|
8
|
+
export class EditorSelectWithSearch<
|
|
9
|
+
TData = any,
|
|
10
|
+
C extends Column<TData> = Column<TData>,
|
|
11
|
+
O extends GridOption<C> = GridOption<C>,
|
|
12
|
+
> extends Autocomplete {
|
|
13
|
+
protected hash: Record<string, string>;
|
|
14
|
+
protected reversedHash: Record<string, string>;
|
|
15
|
+
|
|
16
|
+
constructor(public args: EditorArguments<TData, C, O>) {
|
|
17
|
+
super();
|
|
18
|
+
const column: IColumn = this.args.column;
|
|
19
|
+
this.hash = column.selectOptions as Record<string, string>;
|
|
20
|
+
this.reversedHash = Object.entries(this.hash).reduce(
|
|
21
|
+
(acc: Record<string, string>, [key, value]) => {
|
|
22
|
+
acc[value] = key;
|
|
23
|
+
return acc;
|
|
24
|
+
},
|
|
25
|
+
{},
|
|
26
|
+
);
|
|
27
|
+
this.init();
|
|
28
|
+
const item = this.args.item;
|
|
29
|
+
const initialValue = item[column.field];
|
|
30
|
+
if (!initialValue) {
|
|
31
|
+
this.showOptions("");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
applyValue(item: any, state: any): void {
|
|
36
|
+
item[this.args.column.field] = this.reversedHash[state];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
loadValue(item: ISlickRow): void {
|
|
40
|
+
this.defaultValue = this.hash[item[this.args.column.id]] || "";
|
|
41
|
+
this.input.value = this.defaultValue;
|
|
42
|
+
this.input.defaultValue = this.defaultValue;
|
|
43
|
+
this.input.focus();
|
|
44
|
+
this.input.select();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
onInput(event: Event): void {
|
|
48
|
+
this.closeAllList();
|
|
49
|
+
this.currentFocus = -1;
|
|
50
|
+
this.showOptions((event.target as HTMLInputElement).value);
|
|
51
|
+
}
|
|
52
|
+
onClick(event: MouseEvent): void {
|
|
53
|
+
const div = (event.target as HTMLElement).closest("div") as HTMLDivElement;
|
|
54
|
+
this.input.value = this.hash[div.getElementsByTagName("input")[0].value];
|
|
55
|
+
this.closeAllList();
|
|
56
|
+
}
|
|
57
|
+
showOptions(search: string): void {
|
|
58
|
+
this.list = document.createElement("div");
|
|
59
|
+
this.list.setAttribute("id", this.id);
|
|
60
|
+
this.list.style.width = "fit-content";
|
|
61
|
+
this.list.style.textAlign = "left";
|
|
62
|
+
this.args.container.appendChild(this.list);
|
|
63
|
+
Object.entries(this.hash).forEach(([key, value]) => {
|
|
64
|
+
const hasOverlap = value.match(
|
|
65
|
+
new RegExp(escapeSpecialChar(search), "i"),
|
|
66
|
+
);
|
|
67
|
+
if (hasOverlap) {
|
|
68
|
+
const overlap = hasOverlap[0];
|
|
69
|
+
const listItem = document.createElement("div");
|
|
70
|
+
listItem.innerHTML = `${value.replaceAll(overlap, `<strong>${overlap}</strong>`)}`;
|
|
71
|
+
// insert an input field that will hold the current array item's value
|
|
72
|
+
listItem.innerHTML += `<input type="hidden" value="${key}">`;
|
|
73
|
+
listItem.addEventListener("click", this.onClick.bind(this));
|
|
74
|
+
this.list?.appendChild(listItem);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
this.makeVisible(this.list);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export { EditorAmount } from "./EditorAmount";
|
|
2
|
-
export {
|
|
2
|
+
export {
|
|
3
|
+
Autocomplete,
|
|
4
|
+
EditorAutocomplete,
|
|
5
|
+
EditorSelectWithSearch,
|
|
6
|
+
} from "./Autocomplete";
|
|
3
7
|
export { EditorDate } from "./EditorDate";
|
|
4
8
|
export { EditorSelectString } from "./EditorSelectString";
|
|
5
9
|
export { EditorSelectNumber } from "./EditorSelectNumber";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#slick-table-autocomplete {
|
|
2
|
-
background-color: white;
|
|
3
|
-
box-shadow: gray 0 0 5px 1px;
|
|
4
|
-
color: #1E456F;
|
|
5
|
-
font-size: 0.75rem;
|
|
6
|
-
max-height: 20em;
|
|
7
|
-
overflow-y: auto;
|
|
8
|
-
position: absolute;
|
|
9
|
-
z-index: 1;
|
|
10
|
-
|
|
11
|
-
strong {
|
|
12
|
-
color: rgb(0, 123, 255)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
div.active,
|
|
16
|
-
div:hover {
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
background-color: #e8f4fe;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|