@exmg/exm-grid 0.0.2-alpha.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.
Files changed (47) hide show
  1. package/README.md +501 -0
  2. package/assets/arrow-upward.svg +7 -0
  3. package/dist/index.d.ts +14 -0
  4. package/dist/index.js +14 -0
  5. package/dist/search/exm-toolbar-search.d.ts +22 -0
  6. package/dist/search/exm-toolbar-search.js +194 -0
  7. package/dist/styles/exm-grid-base-toolbar-styles-css.d.ts +1 -0
  8. package/dist/styles/exm-grid-base-toolbar-styles-css.js +103 -0
  9. package/dist/styles/exm-grid-common-styles-css.d.ts +1 -0
  10. package/dist/styles/exm-grid-common-styles-css.js +104 -0
  11. package/dist/styles/exm-grid-pagination-styles-css.d.ts +1 -0
  12. package/dist/styles/exm-grid-pagination-styles-css.js +104 -0
  13. package/dist/styles/exm-grid-setting-selection-list-styles-css.d.ts +1 -0
  14. package/dist/styles/exm-grid-setting-selection-list-styles-css.js +12 -0
  15. package/dist/styles/exm-grid-styles-css.d.ts +1 -0
  16. package/dist/styles/exm-grid-styles-css.js +416 -0
  17. package/dist/table/exm-grid-base-toolbar.d.ts +23 -0
  18. package/dist/table/exm-grid-base-toolbar.js +91 -0
  19. package/dist/table/exm-grid-pagination.d.ts +37 -0
  20. package/dist/table/exm-grid-pagination.js +190 -0
  21. package/dist/table/exm-grid-setting-selection-list.d.ts +24 -0
  22. package/dist/table/exm-grid-setting-selection-list.js +124 -0
  23. package/dist/table/exm-grid-smart-toolbar.d.ts +31 -0
  24. package/dist/table/exm-grid-smart-toolbar.js +138 -0
  25. package/dist/table/exm-grid-toolbar-filters.d.ts +36 -0
  26. package/dist/table/exm-grid-toolbar-filters.js +77 -0
  27. package/dist/table/exm-grid-toolbar.d.ts +41 -0
  28. package/dist/table/exm-grid-toolbar.js +282 -0
  29. package/dist/table/exm-grid.d.ts +130 -0
  30. package/dist/table/exm-grid.js +333 -0
  31. package/dist/table/featrues/exm-column-sortable.d.ts +12 -0
  32. package/dist/table/featrues/exm-column-sortable.js +50 -0
  33. package/dist/table/featrues/exm-row-expandable.d.ts +9 -0
  34. package/dist/table/featrues/exm-row-expandable.js +42 -0
  35. package/dist/table/featrues/exm-row-selectable.d.ts +20 -0
  36. package/dist/table/featrues/exm-row-selectable.js +204 -0
  37. package/dist/table/featrues/exm-row-sortable.d.ts +9 -0
  38. package/dist/table/featrues/exm-row-sortable.js +50 -0
  39. package/dist/table/types/exm-grid-smart-toolbar-types.d.ts +17 -0
  40. package/dist/table/types/exm-grid-smart-toolbar-types.js +6 -0
  41. package/dist/table/types/exm-grid-toolbar-types.d.ts +55 -0
  42. package/dist/table/types/exm-grid-toolbar-types.js +16 -0
  43. package/dist/table/types/exm-grid-types.d.ts +15 -0
  44. package/dist/table/types/exm-grid-types.js +2 -0
  45. package/dist/table/utils/exm-query-selectors.d.ts +12 -0
  46. package/dist/table/utils/exm-query-selectors.js +37 -0
  47. package/package.json +55 -0
@@ -0,0 +1,194 @@
1
+ import { __decorate } from "tslib";
2
+ import { html, css } from 'lit';
3
+ import { property, customElement, query, state } from 'lit/decorators.js';
4
+ import { ExmgElement } from '@exmg/lit-base/index.js';
5
+ import { classMap } from 'lit/directives/class-map.js';
6
+ import { async, debounce } from '@exmg/lit-base/index.js';
7
+ let ToolbarSearch = class ToolbarSearch extends ExmgElement {
8
+ constructor() {
9
+ super(...arguments);
10
+ this._isSearch = false;
11
+ this.placeHolder = 'Search';
12
+ }
13
+ render() {
14
+ const classMapValues = {
15
+ search: this._isSearch,
16
+ };
17
+ return html `
18
+ <div class=${classMap(classMapValues)} @click=${this._showSearch}>
19
+ ${this._isSearch
20
+ ? html `
21
+ <div style="position: relative">
22
+ <md-focus-ring style="--md-focus-ring-shape: 8px" for="searchInput"></md-focus-ring>
23
+ <md-icon>search</md-icon>
24
+ <input
25
+ id="searchInput"
26
+ placeholder=${this.placeHolder}
27
+ value=${this.filterValue ? this.filterValue : ''}
28
+ onfocus="let value = this.value; this.value = null; this.value = value"
29
+ @keyup=${this._handleKeyUp}
30
+ @blur=${this._handleInputBlur}
31
+ />
32
+ ${this.filterValue
33
+ ? html `
34
+ <md-icon-button class="clear-button" @click=${this._handleClear}
35
+ ><md-icon>close</md-icon></md-icon-button
36
+ >
37
+ `
38
+ : html ``}
39
+ </div>
40
+ `
41
+ : html `
42
+ <md-icon>search</md-icon>
43
+ <span class="interactive-content">${this._getValue()}</span>
44
+ <slot></slot>
45
+ `}
46
+ </div>
47
+ `;
48
+ }
49
+ _getValue() {
50
+ return this.filterValue || this.placeHolder;
51
+ }
52
+ _handleClear(e) {
53
+ e.preventDefault();
54
+ this.filterValue = null;
55
+ this.search.value = '';
56
+ this._notifyChange();
57
+ }
58
+ _handleKeyUp(e) {
59
+ const input = e.target;
60
+ if (this.filterValue !== input.value) {
61
+ this.filterValue = input.value;
62
+ this._notifyChange();
63
+ }
64
+ if (e.keyCode === 27) {
65
+ this._hideSearch();
66
+ }
67
+ }
68
+ _notifyChange() {
69
+ this._debouncer = debounce.Debouncer.debounce(this._debouncer, async.timeOut.after(200), () => {
70
+ this.dispatchEvent(new CustomEvent('exm-grid-toolbar-search-changed', {
71
+ bubbles: false,
72
+ composed: true,
73
+ detail: { value: this.filterValue },
74
+ }));
75
+ });
76
+ }
77
+ _handleInputBlur() {
78
+ this._hideSearch();
79
+ }
80
+ _hideSearch() {
81
+ this._isSearch = false;
82
+ }
83
+ _showSearch() {
84
+ if (this._isSearch)
85
+ return;
86
+ this._isSearch = true;
87
+ setTimeout(() => this.shadowRoot.querySelector('#searchInput').focus(), 200);
88
+ }
89
+ };
90
+ ToolbarSearch.styles = [
91
+ css `
92
+ :host {
93
+ display: block;
94
+ color: var(--md-sys-color-on-surface-variant);
95
+ background-color: var(--md-sys-color-surface-container-low);
96
+ border-radius: var(--exm-toolbar-search-border-radius, var(--exm-surface-border-radius, 16px));
97
+ }
98
+ :host > div {
99
+ display: flex;
100
+ flex-direction: row;
101
+ justify-content: center;
102
+ align-items: center;
103
+ height: 48px;
104
+ }
105
+ h2 {
106
+ max-width: 936px;
107
+ width: 100%;
108
+ margin: 20px auto;
109
+ }
110
+ input {
111
+ width: 100%;
112
+ caret-color: var(--md-sys-color-on-surface);
113
+ color: var(--md-sys-color-on-surface);
114
+ }
115
+ md-icon {
116
+ margin: 0 8px 0 16px;
117
+ fill: var(--md-sys-color-on-surface);
118
+ cursor: pointer;
119
+ }
120
+ :host > div > svg {
121
+ margin-right: 10px;
122
+ }
123
+ ::slotted(*) {
124
+ margin: 14px 12px;
125
+ }
126
+ span.interactive-content {
127
+ white-space: nowrap;
128
+ overflow: hidden;
129
+ font-size: 14px;
130
+ opacity: 0.6;
131
+ text-overflow: ellipsis;
132
+ letter-spacing: 0.005em;
133
+ box-sizing: border-box;
134
+
135
+ font-weight: 400;
136
+ cursor: pointer;
137
+ flex: 1;
138
+ }
139
+ .search {
140
+ display: absolute;
141
+ background: none;
142
+ /* outline-color: rgb(77, 144, 254);
143
+ outline-offset: 1px;
144
+ outline-style: auto;
145
+ outline-width: 1px; */
146
+ }
147
+ .search > div {
148
+ width: 100%;
149
+ position: relative;
150
+ display: flex;
151
+ align-items: center;
152
+ }
153
+ .search input {
154
+ font-size: 14px;
155
+ margin: 15px 0px;
156
+ padding: 2px;
157
+ border: 0px;
158
+ width: 100%;
159
+ outline: none;
160
+ background: none;
161
+ box-sizing: border-box;
162
+ }
163
+ .clear-button {
164
+ position: absolute;
165
+ right: 0;
166
+ background: transparent;
167
+ border: none !important;
168
+ font-size: 0;
169
+ margin-right: 1rem;
170
+ color: var(--exm-table-color, black);
171
+ }
172
+
173
+ md-focus-ring {
174
+ --md-focus-ring-shape: 16px;
175
+ }
176
+ `,
177
+ ];
178
+ __decorate([
179
+ state()
180
+ ], ToolbarSearch.prototype, "_isSearch", void 0);
181
+ __decorate([
182
+ property({ type: String })
183
+ ], ToolbarSearch.prototype, "filterValue", void 0);
184
+ __decorate([
185
+ property({ type: String })
186
+ ], ToolbarSearch.prototype, "placeHolder", void 0);
187
+ __decorate([
188
+ query('#searchInput')
189
+ ], ToolbarSearch.prototype, "search", void 0);
190
+ ToolbarSearch = __decorate([
191
+ customElement('exm-toolbar-search')
192
+ ], ToolbarSearch);
193
+ export { ToolbarSearch };
194
+ //# sourceMappingURL=exm-toolbar-search.js.map
@@ -0,0 +1 @@
1
+ export declare const style: import("lit").CSSResult;
@@ -0,0 +1,103 @@
1
+ import { css } from 'lit';
2
+ export const style = css `
3
+ :host {
4
+ display: block;
5
+ -moz-osx-font-smoothing: grayscale;
6
+ -webkit-font-smoothing: antialiased;
7
+ font-family: Roboto, sans-serif;
8
+ font-family: var(--mdc-typography-font-family, Roboto, sans-serif);
9
+ border-top-left-radius: var(--exm-theme-table-radius, var(--exm-surface-border-radius, 16px));
10
+ border-top-right-radius: var(--exm-theme-table-radius, var(--exm-surface-border-radius, 16px));
11
+ --toolbar-bg-color: var(--exm-theme-table-toolbar-background-color, var(--md-sys-color-surface-container));
12
+ --toolbar-color: var(--exm-theme-table-toolbar-color, var(--md-sys-color-on-surface-container));
13
+ background-color: var(--toolbar-bg-color);
14
+ color: var(--toolbar-color);
15
+ }
16
+
17
+ .wrapper {
18
+ display: flex;
19
+ flex: 1;
20
+ flex-direction: row;
21
+ align-items: center;
22
+ padding: 10px 16px 10px 16px;
23
+ overflow-x: var(--exm-theme-table-toolbar-overflow-x, initial);
24
+ white-space: nowrap;
25
+ }
26
+
27
+ .wrapper.active {
28
+ --active-toolbar-bg-color: var(--exm-theme-table-toolbar-active-bg-color, var(--md-sys-color-secondary-container));
29
+ --active-toolbar-color: var(--exm-theme-table-toolbar-active-color, var(--md-sys-color-on-secondary-container));
30
+ background-color: var(--active-toolbar-bg-color);
31
+ color: var(--active-toolbar-color);
32
+ border-top-left-radius: var(--exm-theme-table-radius, var(--exm-surface-border-radius, 16px));
33
+ border-top-right-radius: var(--exm-theme-table-radius, var(--exm-surface-border-radius, 16px));
34
+ }
35
+
36
+ .wrapper.active .seperator.with-action-separator {
37
+ border-left: 1px solid var(--active-toolbar-color);
38
+ }
39
+
40
+ .wrapper.active .description {
41
+ color: var(--active-toolbar-color);
42
+ flex: 1;
43
+ margin-left: 8px;
44
+ }
45
+
46
+ .wrapper .seperator {
47
+ min-height: 32px;
48
+ }
49
+
50
+ .wrapper .seperator.with-action-separator {
51
+ border-left: 1px solid var(--active-toolbar-color);
52
+ }
53
+
54
+ .wrapper .description {
55
+ -moz-osx-font-smoothing: grayscale;
56
+ -webkit-font-smoothing: antialiased;
57
+ font-family: Roboto, sans-serif;
58
+ font-family: var(--mdc-typography-headline5-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));
59
+ font-size: 1.5rem;
60
+ font-size: var(--mdc-typography-headline5-font-size, 1.5rem);
61
+ line-height: 2rem;
62
+ line-height: var(--mdc-typography-headline5-line-height, 2rem);
63
+ font-weight: 400;
64
+ font-weight: var(--mdc-typography-headline5-font-weight, 400);
65
+ letter-spacing: normal;
66
+ letter-spacing: var(--mdc-typography-headline5-letter-spacing, normal);
67
+ text-decoration: inherit;
68
+ text-decoration: var(--mdc-typography-headline5-text-decoration, inherit);
69
+ text-transform: inherit;
70
+ text-transform: var(--mdc-typography-headline5-text-transform, inherit);
71
+ color: var(--toolbar-color);
72
+ font-size: 1.25rem;
73
+ padding: 0;
74
+ height: 48px;
75
+ flex: 1;
76
+ display: flex;
77
+ align-items: center;
78
+ }
79
+
80
+ .actions {
81
+ padding: 0 8px 0 0;
82
+ color: var(--mdc-theme-primary);
83
+ }
84
+
85
+ .filters {
86
+ display: flex;
87
+ flex-direction: row;
88
+ justify-content: flex-end;
89
+ }
90
+
91
+ .settings {
92
+ display: flex;
93
+ flex-direction: row;
94
+ justify-content: flex-end;
95
+ }
96
+
97
+ @media (max-width: 500px) {
98
+ .wrapper .description {
99
+ display: none;
100
+ }
101
+ }
102
+ `;
103
+ //# sourceMappingURL=exm-grid-base-toolbar-styles-css.js.map
@@ -0,0 +1 @@
1
+ export declare const style: import("lit").CSSResult;
@@ -0,0 +1,104 @@
1
+ import { css } from 'lit';
2
+ export const style = css `
3
+ :host {
4
+ display: block;
5
+ -moz-osx-font-smoothing: grayscale;
6
+ -webkit-font-smoothing: antialiased;
7
+ font-family: Roboto, sans-serif;
8
+ font-family: var(--mdc-typography-font-family, Roboto, sans-serif);
9
+ color: var(--exm-theme-table-pagination-color, var(--md-sys-color-on-surface-container));
10
+ border-bottom-left-radius: var(--exm-theme-table-radius, var(--exm-surface-border-radius, 16px));
11
+ border-bottom-right-radius: var(--exm-theme-table-radius, var(--exm-surface-border-radius, 16px));
12
+ }
13
+
14
+ .wrapper {
15
+ display: flex;
16
+ flex: 1;
17
+ flex-direction: row;
18
+ align-items: center;
19
+ justify-content: flex-end;
20
+ padding: 8px 10px;
21
+ white-space: nowrap;
22
+ }
23
+
24
+ .wrapper .page-size {
25
+ display: flex;
26
+ flex-direction: row;
27
+ margin-right: 26px;
28
+ align-items: center;
29
+ }
30
+
31
+ .wrapper .page-size .page-size-label {
32
+ margin-right: 10px;
33
+ -moz-osx-font-smoothing: grayscale;
34
+ -webkit-font-smoothing: antialiased;
35
+ font-family: Roboto, sans-serif;
36
+ font-family: var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));
37
+ font-size: 0.875rem;
38
+ font-size: var(--mdc-typography-body2-font-size, 0.875rem);
39
+ line-height: 1.25rem;
40
+ line-height: var(--mdc-typography-body2-line-height, 1.25rem);
41
+ font-weight: 400;
42
+ font-weight: var(--mdc-typography-body2-font-weight, 400);
43
+ letter-spacing: 0.0178571429em;
44
+ letter-spacing: var(--mdc-typography-body2-letter-spacing, 0.0178571429em);
45
+ text-decoration: inherit;
46
+ text-decoration: var(--mdc-typography-body2-text-decoration, inherit);
47
+ text-transform: inherit;
48
+ text-transform: var(--mdc-typography-body2-text-transform, inherit);
49
+ }
50
+
51
+ .wrapper .page-range {
52
+ display: flex;
53
+ flex-direction: row;
54
+ align-items: center;
55
+ }
56
+
57
+ .wrapper .page-range .page-range-label {
58
+ margin-right: 44px;
59
+ -moz-osx-font-smoothing: grayscale;
60
+ -webkit-font-smoothing: antialiased;
61
+ font-family: Roboto, sans-serif;
62
+ font-family: var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));
63
+ font-size: 0.875rem;
64
+ font-size: var(--mdc-typography-body2-font-size, 0.875rem);
65
+ line-height: 1.25rem;
66
+ line-height: var(--mdc-typography-body2-line-height, 1.25rem);
67
+ font-weight: 400;
68
+ font-weight: var(--mdc-typography-body2-font-weight, 400);
69
+ letter-spacing: 0.0178571429em;
70
+ letter-spacing: var(--mdc-typography-body2-letter-spacing, 0.0178571429em);
71
+ text-decoration: inherit;
72
+ text-decoration: var(--mdc-typography-body2-text-decoration, inherit);
73
+ text-transform: inherit;
74
+ text-transform: var(--mdc-typography-body2-text-transform, inherit);
75
+ }
76
+
77
+ .wrapper .page-range .page-range-actions {
78
+ user-select: none;
79
+ }
80
+
81
+ @media (max-width: 600px) {
82
+ .page-size-label {
83
+ display: none;
84
+ }
85
+ }
86
+
87
+ @media (max-width: 500px) {
88
+ .wrapper .page-size {
89
+ display: none;
90
+ }
91
+ }
92
+
93
+ @media (max-width: 450px) {
94
+ .wrapper {
95
+ overflow-x: auto;
96
+ white-space: nowrap;
97
+ }
98
+
99
+ .wrapper .page-range {
100
+ min-width: 1px;
101
+ }
102
+ }
103
+ `;
104
+ //# sourceMappingURL=exm-grid-common-styles-css.js.map
@@ -0,0 +1 @@
1
+ export declare const style: import("lit").CSSResult;
@@ -0,0 +1,104 @@
1
+ import { css } from 'lit';
2
+ export const style = css `
3
+ :host {
4
+ display: block;
5
+ -moz-osx-font-smoothing: grayscale;
6
+ -webkit-font-smoothing: antialiased;
7
+ font-family: Roboto, sans-serif;
8
+ font-family: var(--mdc-typography-font-family, Roboto, sans-serif);
9
+ color: var(--exm-theme-table-pagination-color, var(--md-sys-color-on-surface-container));
10
+ border-bottom-left-radius: var(--exm-theme-table-radius, var(--exm-surface-border-radius, 16px));
11
+ border-bottom-right-radius: var(--exm-theme-table-radius, var(--exm-surface-border-radius, 16px));
12
+ }
13
+
14
+ .wrapper {
15
+ display: flex;
16
+ flex: 1;
17
+ flex-direction: row;
18
+ align-items: center;
19
+ justify-content: flex-end;
20
+ padding: 8px 10px;
21
+ white-space: nowrap;
22
+ }
23
+
24
+ .wrapper .page-size {
25
+ display: flex;
26
+ flex-direction: row;
27
+ margin-right: 26px;
28
+ align-items: center;
29
+ }
30
+
31
+ .wrapper .page-size .page-size-label {
32
+ margin-right: 10px;
33
+ -moz-osx-font-smoothing: grayscale;
34
+ -webkit-font-smoothing: antialiased;
35
+ font-family: Roboto, sans-serif;
36
+ font-family: var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));
37
+ font-size: 0.875rem;
38
+ font-size: var(--mdc-typography-body2-font-size, 0.875rem);
39
+ line-height: 1.25rem;
40
+ line-height: var(--mdc-typography-body2-line-height, 1.25rem);
41
+ font-weight: 400;
42
+ font-weight: var(--mdc-typography-body2-font-weight, 400);
43
+ letter-spacing: 0.0178571429em;
44
+ letter-spacing: var(--mdc-typography-body2-letter-spacing, 0.0178571429em);
45
+ text-decoration: inherit;
46
+ text-decoration: var(--mdc-typography-body2-text-decoration, inherit);
47
+ text-transform: inherit;
48
+ text-transform: var(--mdc-typography-body2-text-transform, inherit);
49
+ }
50
+
51
+ .wrapper .page-range {
52
+ display: flex;
53
+ flex-direction: row;
54
+ align-items: center;
55
+ }
56
+
57
+ .wrapper .page-range .page-range-label {
58
+ margin-right: 44px;
59
+ -moz-osx-font-smoothing: grayscale;
60
+ -webkit-font-smoothing: antialiased;
61
+ font-family: Roboto, sans-serif;
62
+ font-family: var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));
63
+ font-size: 0.875rem;
64
+ font-size: var(--mdc-typography-body2-font-size, 0.875rem);
65
+ line-height: 1.25rem;
66
+ line-height: var(--mdc-typography-body2-line-height, 1.25rem);
67
+ font-weight: 400;
68
+ font-weight: var(--mdc-typography-body2-font-weight, 400);
69
+ letter-spacing: 0.0178571429em;
70
+ letter-spacing: var(--mdc-typography-body2-letter-spacing, 0.0178571429em);
71
+ text-decoration: inherit;
72
+ text-decoration: var(--mdc-typography-body2-text-decoration, inherit);
73
+ text-transform: inherit;
74
+ text-transform: var(--mdc-typography-body2-text-transform, inherit);
75
+ }
76
+
77
+ .wrapper .page-range .page-range-actions {
78
+ user-select: none;
79
+ }
80
+
81
+ @media (max-width: 600px) {
82
+ .page-size-label {
83
+ display: none;
84
+ }
85
+ }
86
+
87
+ @media (max-width: 500px) {
88
+ .wrapper .page-size {
89
+ display: none;
90
+ }
91
+ }
92
+
93
+ @media (max-width: 450px) {
94
+ .wrapper {
95
+ overflow-x: auto;
96
+ white-space: nowrap;
97
+ }
98
+
99
+ .wrapper .page-range {
100
+ min-width: 1px;
101
+ }
102
+ }
103
+ `;
104
+ //# sourceMappingURL=exm-grid-pagination-styles-css.js.map
@@ -0,0 +1 @@
1
+ export declare const style: import("lit").CSSResult;
@@ -0,0 +1,12 @@
1
+ import { css } from 'lit';
2
+ export const style = css `
3
+ :host {
4
+ display: block;
5
+ position: relative;
6
+ }
7
+
8
+ .action {
9
+ color: var(--mdc-theme-primary);
10
+ }
11
+ `;
12
+ //# sourceMappingURL=exm-grid-setting-selection-list-styles-css.js.map
@@ -0,0 +1 @@
1
+ export declare const style: import("lit").CSSResult;