@exmg/exm-grid 1.0.7 → 1.0.8-alpha.21

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.
Files changed (47) hide show
  1. package/dist/index.d.ts +14 -0
  2. package/dist/index.js +14 -0
  3. package/package.json +17 -19
  4. package/index.d.ts +0 -14
  5. package/index.js +0 -14
  6. package/src/search/exm-toolbar-search.d.ts +0 -25
  7. package/src/search/exm-toolbar-search.js +0 -197
  8. package/src/styles/exm-grid-base-toolbar-styles-css.d.ts +0 -1
  9. package/src/styles/exm-grid-base-toolbar-styles-css.js +0 -103
  10. package/src/styles/exm-grid-common-styles-css.d.ts +0 -1
  11. package/src/styles/exm-grid-common-styles-css.js +0 -104
  12. package/src/styles/exm-grid-pagination-styles-css.d.ts +0 -1
  13. package/src/styles/exm-grid-pagination-styles-css.js +0 -104
  14. package/src/styles/exm-grid-setting-selection-list-styles-css.d.ts +0 -1
  15. package/src/styles/exm-grid-setting-selection-list-styles-css.js +0 -12
  16. package/src/styles/exm-grid-styles-css.d.ts +0 -1
  17. package/src/styles/exm-grid-styles-css.js +0 -412
  18. package/src/table/exm-grid-base-toolbar.d.ts +0 -23
  19. package/src/table/exm-grid-base-toolbar.js +0 -91
  20. package/src/table/exm-grid-pagination.d.ts +0 -37
  21. package/src/table/exm-grid-pagination.js +0 -190
  22. package/src/table/exm-grid-setting-selection-list.d.ts +0 -24
  23. package/src/table/exm-grid-setting-selection-list.js +0 -124
  24. package/src/table/exm-grid-smart-toolbar.d.ts +0 -31
  25. package/src/table/exm-grid-smart-toolbar.js +0 -138
  26. package/src/table/exm-grid-toolbar-filters.d.ts +0 -36
  27. package/src/table/exm-grid-toolbar-filters.js +0 -77
  28. package/src/table/exm-grid-toolbar.d.ts +0 -42
  29. package/src/table/exm-grid-toolbar.js +0 -283
  30. package/src/table/exm-grid.d.ts +0 -130
  31. package/src/table/exm-grid.js +0 -333
  32. package/src/table/featrues/exm-column-sortable.d.ts +0 -12
  33. package/src/table/featrues/exm-column-sortable.js +0 -50
  34. package/src/table/featrues/exm-row-expandable.d.ts +0 -9
  35. package/src/table/featrues/exm-row-expandable.js +0 -42
  36. package/src/table/featrues/exm-row-selectable.d.ts +0 -20
  37. package/src/table/featrues/exm-row-selectable.js +0 -204
  38. package/src/table/featrues/exm-row-sortable.d.ts +0 -9
  39. package/src/table/featrues/exm-row-sortable.js +0 -50
  40. package/src/table/types/exm-grid-smart-toolbar-types.d.ts +0 -17
  41. package/src/table/types/exm-grid-smart-toolbar-types.js +0 -6
  42. package/src/table/types/exm-grid-toolbar-types.d.ts +0 -55
  43. package/src/table/types/exm-grid-toolbar-types.js +0 -16
  44. package/src/table/types/exm-grid-types.d.ts +0 -15
  45. package/src/table/types/exm-grid-types.js +0 -2
  46. package/src/table/utils/exm-query-selectors.d.ts +0 -12
  47. package/src/table/utils/exm-query-selectors.js +0 -37
@@ -1,50 +0,0 @@
1
- export class ExmRowSortable {
2
- constructor(qs) {
3
- this.querySelectors = qs;
4
- }
5
- initFeature() {
6
- this.querySelectors
7
- .getTableBody()
8
- .querySelectorAll('tr:not([data-initialized]) .grid-row-drag-handler, tr:not([data-initialized]).grid-row-drag-handler')
9
- .forEach((element) => {
10
- this.registerMouseListenersHideDetailOnStartDragging(element);
11
- });
12
- }
13
- updateFeature() {
14
- this.initFeature();
15
- }
16
- getRowDetailQuerySelectorFactory(element) {
17
- const row = element.closest('tr');
18
- const rowId = row && row.getAttribute('data-row-key');
19
- if (rowId) {
20
- return () => this.querySelectors.getTableBody().querySelector(`tr[data-row-detail-key="${rowId}"]`) ||
21
- undefined;
22
- }
23
- return () => undefined;
24
- }
25
- registerMouseListenersHideDetailOnStartDragging(element) {
26
- const getRowDetail = this.getRowDetailQuerySelectorFactory(element);
27
- if (element.closest('td')) {
28
- // ignore click (won't eventually select row) when trigger is element embedded in table cell
29
- element.addEventListener('click', (event) => event.stopPropagation());
30
- }
31
- element.addEventListener('mousedown', (event) => {
32
- event.preventDefault();
33
- const rowDetail = getRowDetail();
34
- if (rowDetail && rowDetail.hasAttribute('data-is-row-expanded')) {
35
- rowDetail.style.display = 'none';
36
- const handlerMouseUp = () => {
37
- const rowDetailToRevert = getRowDetail();
38
- if (rowDetailToRevert && rowDetailToRevert.hasAttribute('data-is-row-expanded')) {
39
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
40
- // @ts-ignore
41
- rowDetailToRevert.style.display = null;
42
- }
43
- this.querySelectors.getTableBody().removeEventListener('mouseup', handlerMouseUp);
44
- };
45
- this.querySelectors.getTableBody().addEventListener('mouseup', handlerMouseUp);
46
- }
47
- });
48
- }
49
- }
50
- //# sourceMappingURL=exm-row-sortable.js.map
@@ -1,17 +0,0 @@
1
- export interface ActionWithCondition<TCondition extends BaseActionCondition = BaseActionCondition> {
2
- id: string;
3
- icon?: string;
4
- text?: string;
5
- tooltip?: string;
6
- condition?: TCondition;
7
- }
8
- export declare enum ActionConditionType {
9
- AmountOfSelectedItemsRange = "amount_of_items_range"
10
- }
11
- export interface BaseActionCondition {
12
- type?: ActionConditionType;
13
- }
14
- export interface ActionAmountSelectedItemsCondition extends BaseActionCondition {
15
- min?: number;
16
- max?: number;
17
- }
@@ -1,6 +0,0 @@
1
- // eslint-disable-next-line no-shadow
2
- export var ActionConditionType;
3
- (function (ActionConditionType) {
4
- ActionConditionType["AmountOfSelectedItemsRange"] = "amount_of_items_range";
5
- })(ActionConditionType = ActionConditionType || (ActionConditionType = {}));
6
- //# sourceMappingURL=exm-grid-smart-toolbar-types.js.map
@@ -1,55 +0,0 @@
1
- export interface Action {
2
- id: string;
3
- icon?: string;
4
- text?: string;
5
- tooltip?: string;
6
- }
7
- /**
8
- * ID MUST BE UNIQUE HERE
9
- */
10
- export interface Filter<TConfig extends BaseFilterConfig = BaseFilterConfig> {
11
- id: string;
12
- name: string;
13
- disabled?: boolean;
14
- config: TConfig;
15
- }
16
- export declare enum FilterConfigType {
17
- SingleSelect = "single_select"
18
- }
19
- export interface BaseFilterConfig {
20
- type?: FilterConfigType;
21
- }
22
- export interface FilterSingleSelectConfig extends BaseFilterConfig {
23
- data: {
24
- id: string;
25
- title: string;
26
- }[];
27
- }
28
- export interface Setting<TConfig extends BaseSettingConfig = BaseSettingConfig> {
29
- id: string;
30
- icon?: string;
31
- dialogTitle?: string;
32
- tooltip?: string;
33
- config: TConfig;
34
- }
35
- export declare enum SettingConfigType {
36
- SelectionList = "selection_list"
37
- }
38
- export declare enum SettingConfigId {
39
- ColumnSelector = "column-selector"
40
- }
41
- export interface BaseSettingConfig {
42
- type?: SettingConfigType;
43
- }
44
- export interface SettingSelectionListItem {
45
- id: string;
46
- title: string;
47
- selected?: boolean;
48
- }
49
- export interface SettingSelectionListConfig extends BaseSettingConfig {
50
- data: SettingSelectionListItem[];
51
- }
52
- export interface EventDetailGridToolbarSettingChanged {
53
- id: string;
54
- value: SettingSelectionListItem[];
55
- }
@@ -1,16 +0,0 @@
1
- // eslint-disable-next-line no-shadow
2
- export var FilterConfigType;
3
- (function (FilterConfigType) {
4
- FilterConfigType["SingleSelect"] = "single_select";
5
- })(FilterConfigType = FilterConfigType || (FilterConfigType = {}));
6
- // eslint-disable-next-line no-shadow
7
- export var SettingConfigType;
8
- (function (SettingConfigType) {
9
- SettingConfigType["SelectionList"] = "selection_list";
10
- })(SettingConfigType = SettingConfigType || (SettingConfigType = {}));
11
- // eslint-disable-next-line no-shadow
12
- export var SettingConfigId;
13
- (function (SettingConfigId) {
14
- SettingConfigId["ColumnSelector"] = "column-selector";
15
- })(SettingConfigId = SettingConfigId || (SettingConfigId = {}));
16
- //# sourceMappingURL=exm-grid-toolbar-types.js.map
@@ -1,15 +0,0 @@
1
- export type SORT_DIRECTION = 'ASC' | 'DESC';
2
- export interface EventDetailSortChange {
3
- column: string;
4
- sortDirection?: SORT_DIRECTION;
5
- }
6
- export interface EventDetailSelectedRowsChange {
7
- rows: HTMLTableRowElement[];
8
- }
9
- export interface EventDetailRowsOrderChanged<T extends any = any> {
10
- items: T[];
11
- }
12
- export interface EventDetailRowsOrderUpdated {
13
- sourceIndex: number;
14
- targetIndex: number;
15
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=exm-grid-types.js.map
@@ -1,12 +0,0 @@
1
- export declare class ExmQuerySelectors {
2
- private table;
3
- private tableBody;
4
- constructor(t: HTMLTableElement, tb: HTMLTableSectionElement);
5
- getTable(): HTMLTableElement;
6
- getTableBody(): HTMLElement;
7
- getColumns(selector?: string): NodeListOf<HTMLElement>;
8
- getColumn<T extends HTMLElement>(selector?: string): T | undefined;
9
- getBodyRowSelector(selector?: string): string;
10
- getBodyRows(): NodeListOf<HTMLTableRowElement>;
11
- getBodyRowsNotInitialized(): NodeListOf<HTMLTableRowElement>;
12
- }
@@ -1,37 +0,0 @@
1
- export class ExmQuerySelectors {
2
- constructor(t, tb) {
3
- this.table = t;
4
- this.tableBody = tb;
5
- }
6
- getTable() {
7
- if (!this.table) {
8
- throw new Error('Element table not found. Slot hast to define <table>');
9
- }
10
- return this.table;
11
- }
12
- getTableBody() {
13
- if (!this.tableBody) {
14
- throw new Error('Element tbody not found. Slot hast to define <tbody class="grid-data">');
15
- }
16
- return this.tableBody;
17
- }
18
- // eslint-disable-next-line
19
- getColumns(selector = 'th') {
20
- return this.getTable().querySelectorAll(`.grid-columns ${selector}`);
21
- }
22
- getColumn(selector = 'th') {
23
- return this.getTable().querySelector(`.grid-columns ${selector}`) || undefined;
24
- }
25
- getBodyRowSelector(selector = '') {
26
- return `tr:not(.grid-row-detail)${selector}`;
27
- }
28
- // eslint-disable-next-line
29
- getBodyRows() {
30
- return this.getTableBody().querySelectorAll(this.getBodyRowSelector());
31
- }
32
- // eslint-disable-next-line
33
- getBodyRowsNotInitialized() {
34
- return this.getTableBody().querySelectorAll(this.getBodyRowSelector(':not([data-initialized])'));
35
- }
36
- }
37
- //# sourceMappingURL=exm-query-selectors.js.map