@teipublisher/pb-components 2.26.1-next.3 → 3.0.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 (154) hide show
  1. package/.github/workflows/main.yml +3 -3
  2. package/.github/workflows/node.js.yml +3 -3
  3. package/.github/workflows/release.js.yml +4 -4
  4. package/.releaserc.json +2 -2
  5. package/CHANGELOG.md +262 -11
  6. package/Dockerfile +78 -70
  7. package/css/components.css +5 -5
  8. package/css/leaflet/images/layers.png +0 -0
  9. package/dist/demo/components.css +46 -1
  10. package/dist/demo/pb-browse-docs2.html +1 -1
  11. package/dist/demo/pb-dialog.html +3 -5
  12. package/dist/demo/pb-drawer2.html +1 -1
  13. package/dist/demo/pb-facsimile.html +2 -2
  14. package/dist/demo/pb-grid.html +19 -6
  15. package/dist/demo/pb-leaflet-map.html +1 -1
  16. package/dist/demo/pb-login.html +0 -2
  17. package/dist/demo/pb-message.html +1 -2
  18. package/dist/demo/pb-progress.html +2 -2
  19. package/dist/demo/pb-repeat.html +1 -3
  20. package/dist/demo/pb-search.html +7 -4
  21. package/dist/demo/pb-search3.html +1 -1
  22. package/dist/demo/pb-search4.html +2 -2
  23. package/dist/demo/pb-view3.html +1 -1
  24. package/dist/{iron-form-3b8dcaa7.js → iron-form-dfb3e3b1.js} +95 -95
  25. package/dist/paper-checkbox-645e1077.js +200 -0
  26. package/dist/{paper-icon-button-b1d31571.js → paper-icon-button-984162bd.js} +1 -1
  27. package/dist/{paper-checkbox-515a5284.js → paper-inky-focus-behavior-fa16796b.js} +58 -247
  28. package/dist/{paper-listbox-a3b7175c.js → paper-listbox-5f5d1cec.js} +152 -162
  29. package/dist/pb-code-editor.js +25 -20
  30. package/dist/pb-component-docs.js +68 -64
  31. package/dist/pb-components-bundle.js +1983 -2293
  32. package/dist/pb-edit-app.js +167 -107
  33. package/dist/pb-elements.json +176 -120
  34. package/dist/{pb-i18n-0611135a.js → pb-i18n-4cc00bfe.js} +1 -1
  35. package/dist/pb-leaflet-map.js +23 -23
  36. package/dist/pb-mei.js +56 -41
  37. package/dist/{pb-mixin-b1caa22e.js → pb-mixin-886ece32.js} +1 -1
  38. package/dist/pb-odd-editor.js +1023 -782
  39. package/dist/pb-tify.js +2 -2
  40. package/dist/vaadin-element-mixin-beb74ffd.js +545 -0
  41. package/gh-pages.js +5 -3
  42. package/i18n/common/en.json +6 -0
  43. package/i18n/common/pl.json +2 -2
  44. package/lib/openseadragon.min.js +6 -6
  45. package/package.json +3 -3
  46. package/pb-elements.json +176 -120
  47. package/src/assets/components.css +5 -5
  48. package/src/authority/airtable.js +20 -21
  49. package/src/authority/anton.js +129 -129
  50. package/src/authority/custom.js +23 -21
  51. package/src/authority/geonames.js +38 -32
  52. package/src/authority/gnd.js +50 -42
  53. package/src/authority/kbga.js +137 -134
  54. package/src/authority/metagrid.js +44 -46
  55. package/src/authority/reconciliation.js +66 -67
  56. package/src/authority/registry.js +4 -4
  57. package/src/docs/pb-component-docs.js +2 -2
  58. package/src/docs/pb-component-view.js +5 -5
  59. package/src/docs/pb-components-list.js +2 -2
  60. package/src/docs/pb-demo-snippet.js +2 -2
  61. package/src/dts-client.js +299 -297
  62. package/src/dts-select-endpoint.js +90 -82
  63. package/src/parse-date-service.js +184 -135
  64. package/src/pb-ajax.js +158 -171
  65. package/src/pb-authority-lookup.js +191 -156
  66. package/src/pb-autocomplete.js +292 -280
  67. package/src/pb-blacklab-highlight.js +264 -259
  68. package/src/pb-blacklab-results.js +236 -221
  69. package/src/pb-browse-docs.js +540 -475
  70. package/src/pb-browse.js +68 -65
  71. package/src/pb-clipboard.js +79 -76
  72. package/src/pb-code-editor.js +110 -102
  73. package/src/pb-code-highlight.js +209 -204
  74. package/src/pb-codepen.js +79 -72
  75. package/src/pb-collapse.js +211 -151
  76. package/src/pb-combo-box.js +190 -190
  77. package/src/pb-components-bundle.js +1 -1
  78. package/src/pb-components.js +1 -0
  79. package/src/pb-custom-form.js +173 -153
  80. package/src/pb-dialog.js +98 -62
  81. package/src/pb-document.js +89 -90
  82. package/src/pb-download.js +212 -196
  83. package/src/pb-drawer.js +145 -148
  84. package/src/pb-edit-app.js +301 -229
  85. package/src/pb-edit-xml.js +100 -97
  86. package/src/pb-events.js +114 -107
  87. package/src/pb-facs-link.js +104 -102
  88. package/src/pb-facsimile.js +474 -410
  89. package/src/pb-formula.js +151 -153
  90. package/src/pb-geolocation.js +129 -131
  91. package/src/pb-grid-action.js +53 -56
  92. package/src/pb-grid.js +231 -228
  93. package/src/pb-highlight.js +140 -140
  94. package/src/pb-hotkeys.js +40 -42
  95. package/src/pb-i18n.js +101 -104
  96. package/src/pb-image-strip.js +84 -78
  97. package/src/pb-lang.js +142 -57
  98. package/src/pb-leaflet-map.js +488 -485
  99. package/src/pb-link.js +126 -124
  100. package/src/pb-load.js +431 -429
  101. package/src/pb-login.js +299 -244
  102. package/src/pb-manage-odds.js +352 -336
  103. package/src/pb-map-icon.js +89 -89
  104. package/src/pb-map-layer.js +85 -85
  105. package/src/pb-markdown.js +90 -99
  106. package/src/pb-media-query.js +74 -72
  107. package/src/pb-mei.js +306 -295
  108. package/src/pb-message.js +139 -97
  109. package/src/pb-mixin.js +269 -264
  110. package/src/pb-navigation.js +80 -95
  111. package/src/pb-observable.js +38 -38
  112. package/src/pb-odd-editor.js +1054 -958
  113. package/src/pb-odd-elementspec-editor.js +349 -298
  114. package/src/pb-odd-model-editor.js +1075 -909
  115. package/src/pb-odd-parameter-editor.js +200 -178
  116. package/src/pb-odd-rendition-editor.js +136 -124
  117. package/src/pb-page.js +431 -422
  118. package/src/pb-paginate.js +228 -179
  119. package/src/pb-panel.js +198 -182
  120. package/src/pb-popover-themes.js +15 -8
  121. package/src/pb-popover.js +296 -287
  122. package/src/pb-print-preview.js +127 -127
  123. package/src/pb-progress.js +51 -51
  124. package/src/pb-repeat.js +105 -104
  125. package/src/pb-restricted.js +84 -77
  126. package/src/pb-search.js +256 -228
  127. package/src/pb-select-feature.js +127 -120
  128. package/src/pb-select-odd.js +132 -124
  129. package/src/pb-select-template.js +89 -78
  130. package/src/pb-select.js +251 -227
  131. package/src/pb-split-list.js +179 -174
  132. package/src/pb-svg.js +80 -79
  133. package/src/pb-table-column.js +54 -54
  134. package/src/pb-table-grid.js +221 -203
  135. package/src/pb-tabs.js +61 -63
  136. package/src/pb-tify.js +154 -154
  137. package/src/pb-timeline.js +382 -249
  138. package/src/pb-toggle-feature.js +195 -187
  139. package/src/pb-upload.js +184 -174
  140. package/src/pb-version.js +30 -30
  141. package/src/pb-view-annotate.js +135 -98
  142. package/src/pb-view.js +1282 -1270
  143. package/src/pb-zoom.js +127 -45
  144. package/src/polymer-hack.js +1 -1
  145. package/src/search-result-service.js +256 -223
  146. package/src/seed-element.js +13 -20
  147. package/src/settings.js +4 -4
  148. package/src/theming.js +98 -91
  149. package/src/urls.js +289 -289
  150. package/src/utils.js +53 -51
  151. package/css/pb-styles.css +0 -51
  152. package/dist/vaadin-element-mixin-fe4a4883.js +0 -527
  153. package/src/assets/pb-styles.css +0 -51
  154. package/src/pb-light-dom.js +0 -41
@@ -1,66 +1,66 @@
1
1
  import { LitElement } from 'lit-element';
2
- import { html } from "gridjs";
2
+ import { html } from 'gridjs';
3
3
  import './pb-popover.js';
4
4
 
5
5
  /**
6
6
  * Defines a column within `pb-table-grid`.
7
7
  */
8
8
  export class PbTableColumn extends LitElement {
9
- static get properties() {
10
- return {
11
- /**
12
- * Column heading to display
13
- */
14
- label: {
15
- type: String
16
- },
17
- /**
18
- * Name of the JSON property containing the data
19
- */
20
- property: {
21
- type: String
22
- },
23
- /**
24
- * Should the column support sorting?
25
- */
26
- sort: {
27
- type: Boolean
28
- },
29
- /**
30
- * Optional fixed width of the column (e.g. '200px' or '30%')
31
- */
32
- width: {
33
- type: String
34
- },
35
- ...super.properties
36
- };
37
- }
9
+ static get properties() {
10
+ return {
11
+ /**
12
+ * Column heading to display
13
+ */
14
+ label: {
15
+ type: String,
16
+ },
17
+ /**
18
+ * Name of the JSON property containing the data
19
+ */
20
+ property: {
21
+ type: String,
22
+ },
23
+ /**
24
+ * Should the column support sorting?
25
+ */
26
+ sort: {
27
+ type: Boolean,
28
+ },
29
+ /**
30
+ * Optional fixed width of the column (e.g. '200px' or '30%')
31
+ */
32
+ width: {
33
+ type: String,
34
+ },
35
+ ...super.properties,
36
+ };
37
+ }
38
38
 
39
- constructor() {
40
- super();
41
- this.label = 'no-label';
42
- this.property = null;
43
- this.sort = false;
44
- this.width = null;
45
- }
39
+ constructor() {
40
+ super();
41
+ this.label = 'no-label';
42
+ this.property = null;
43
+ this.sort = false;
44
+ this.width = null;
45
+ }
46
46
 
47
- connectedCallback() {
48
- super.connectedCallback();
49
- }
47
+ connectedCallback() {
48
+ super.connectedCallback();
49
+ }
50
50
 
51
- data() {
52
- const config = {
53
- name: html(`<pb-i18n key="${this.label}">${this.label}</pb-i18n>`),
54
- sort: { enabled: this.sort },
55
- formatter: (cell) => html(cell)
56
- };
57
- if (this.property) {
58
- config.id = this.property;
59
- }
60
- if (this.width) {
61
- config.width = this.width;
62
- }
63
- return config;
51
+ data() {
52
+ const config = {
53
+ name: html(`<pb-i18n key="${this.label}">${this.label}</pb-i18n>`),
54
+ sort: { enabled: this.sort },
55
+ formatter: cell => html(cell),
56
+ };
57
+ if (this.property) {
58
+ config.id = this.property;
59
+ }
60
+ if (this.width) {
61
+ config.width = this.width;
64
62
  }
63
+ return config;
64
+ }
65
65
  }
66
- customElements.define('pb-table-column', PbTableColumn);
66
+ customElements.define('pb-table-column', PbTableColumn);
@@ -1,28 +1,28 @@
1
1
  import { LitElement, html, css } from 'lit-element';
2
- import { Grid } from "gridjs";
2
+ import { Grid } from 'gridjs';
3
3
  import { pbMixin, waitOnce } from './pb-mixin.js';
4
4
  import { resolveURL } from './utils.js';
5
- import { loadStylesheets, importStyles } from "./theming.js";
5
+ import { loadStylesheets, importStyles } from './theming.js';
6
6
  import '@polymer/paper-input/paper-input';
7
7
  import '@polymer/iron-icons';
8
8
  import '@polymer/iron-form';
9
9
  import '@polymer/paper-icon-button';
10
10
  import './pb-table-column.js';
11
- import { registry } from "./urls.js";
11
+ import { registry } from './urls.js';
12
12
 
13
13
  /**
14
14
  * A table grid based on [gridjs](https://gridjs.io/), which loads its data from a server endpoint
15
15
  * specified in `source`. If `source` is a relative URI, it will be resolved relative to the
16
16
  * TEI Publisher endpoint.
17
- *
17
+ *
18
18
  * The JSON data returned by the endpoint should be an object with two properties:
19
- *
19
+ *
20
20
  * * `count`: the overall number of rows available on the server
21
21
  * * `results`: an array containing each record as an object
22
- *
22
+ *
23
23
  * The parameters send to the server are as follows:
24
- *
25
- *
24
+ *
25
+ *
26
26
  * Parameter | Description
27
27
  * ---------|----------
28
28
  * limit | number of records to return for each page
@@ -30,9 +30,9 @@ import { registry } from "./urls.js";
30
30
  * order | the id of the column to sort by
31
31
  * dir | sort direction: either 'asc' or 'desc'
32
32
  * search | an optional search string entered by the user
33
- *
33
+ *
34
34
  * Table columns are configured via nested `<pb-table-column>` elements:
35
- *
35
+ *
36
36
  * ```html
37
37
  * <pb-table-column label="Name" property="name" sort width="33%"></pb-table-column>
38
38
  * <pb-table-column label="Born" property="birth"></pb-table-column>
@@ -40,215 +40,233 @@ import { registry } from "./urls.js";
40
40
  * ```
41
41
  */
42
42
  export class PbTableGrid extends pbMixin(LitElement) {
43
- static get properties() {
44
- return {
45
- /**
46
- * URI of the server-side endpoint to retrieve data from.
47
- * Relative URIs are resolved relative to the configured TEI Publisher endpoint.
48
- */
49
- source: {
50
- type: String
51
- },
52
- /**
53
- * Path to the gridjs theme CSS files.
54
- */
55
- cssPath: {
56
- type: String,
57
- attribute: 'css-path'
58
- },
59
- /**
60
- * If specified, columns (without a fixed width) will be resizable.
61
- */
62
- resizable: {
63
- type: Boolean
64
- },
65
- subforms: {
66
- type: String
67
- },
68
- perPage: {
69
- type: Number,
70
- attribute: 'per-page'
71
- },
72
- height: {
73
- type: String
74
- },
75
- /**
76
- * If specified, enable server-side search.
77
- */
78
- search: {
79
- type: Boolean
80
- },
81
- _params: {
82
- type: Object
83
- },
84
- ...super.properties
85
- };
86
- }
43
+ static get properties() {
44
+ return {
45
+ /**
46
+ * URI of the server-side endpoint to retrieve data from.
47
+ * Relative URIs are resolved relative to the configured TEI Publisher endpoint.
48
+ */
49
+ source: {
50
+ type: String,
51
+ },
52
+ /**
53
+ * Path to the gridjs theme CSS files.
54
+ */
55
+ cssPath: {
56
+ type: String,
57
+ attribute: 'css-path',
58
+ },
59
+ /**
60
+ * If specified, columns (without a fixed width) will be resizable.
61
+ */
62
+ resizable: {
63
+ type: Boolean,
64
+ },
65
+ subforms: {
66
+ type: String,
67
+ },
68
+ perPage: {
69
+ type: Number,
70
+ attribute: 'per-page',
71
+ },
72
+ height: {
73
+ type: String,
74
+ },
75
+ /**
76
+ * If specified, enable server-side search.
77
+ */
78
+ search: {
79
+ type: Boolean,
80
+ },
81
+ _params: {
82
+ type: Object,
83
+ },
84
+ ...super.properties,
85
+ };
86
+ }
87
87
 
88
- constructor() {
89
- super();
90
- this.cssPath = '../css/gridjs';
91
- this._params = {};
92
- this.resizable = false;
93
- this.search = false;
94
- this.perPage = 10;
95
- this.height = null;
96
- this.fixedHeader = false;
97
- }
88
+ constructor() {
89
+ super();
90
+ this.cssPath = '../css/gridjs';
91
+ this._params = {};
92
+ this.resizable = false;
93
+ this.search = false;
94
+ this.perPage = 10;
95
+ this.height = null;
96
+ this.fixedHeader = false;
97
+ }
98
98
 
99
- async connectedCallback() {
100
- super.connectedCallback();
99
+ async connectedCallback() {
100
+ super.connectedCallback();
101
101
 
102
- this.subscribeTo('pb-search-resubmit', (ev) => {
103
- this._submit();
104
- });
102
+ this.subscribeTo('pb-search-resubmit', ev => {
103
+ this._submit();
104
+ });
105
105
 
106
- registry.subscribe(this, (state) => {
107
- this._params = state;
108
- this._submit();
109
- });
106
+ registry.subscribe(this, state => {
107
+ this._params = state;
108
+ this._submit();
109
+ });
110
110
 
111
- this.subscribeTo('pb-i18n-update', ev => {
112
- const needsRefresh = this.language && this.language !== ev.detail.language;
113
- this.language = ev.detail.language;
114
- if (needsRefresh) {
115
- this._submit();
116
- }
117
- }, []);
118
-
119
- if (!this.height) {
120
- const property = getComputedStyle(this).getPropertyValue('--pb-table-grid-height');
121
- if (property) {
122
- this.height = property;
123
- } else {
124
- this.height = 'auto';
125
- }
111
+ this.subscribeTo(
112
+ 'pb-i18n-update',
113
+ ev => {
114
+ const needsRefresh = this.language && this.language !== ev.detail.language;
115
+ this.language = ev.detail.language;
116
+ if (needsRefresh) {
117
+ this._submit();
126
118
  }
119
+ },
120
+ [],
121
+ );
127
122
 
128
- const gridjsTheme = await loadStylesheets([`${resolveURL(this.cssPath)}/mermaid.min.css`]);
129
- const theme = importStyles(this);
130
- const sheets = [...this.shadowRoot.adoptedStyleSheets, gridjsTheme];
131
- if (theme) {
132
- sheets.push(theme);
133
- }
134
- this.shadowRoot.adoptedStyleSheets = sheets;
123
+ if (!this.height) {
124
+ const property = getComputedStyle(this).getPropertyValue('--pb-table-grid-height');
125
+ if (property) {
126
+ this.height = property;
127
+ } else {
128
+ this.height = 'auto';
129
+ }
135
130
  }
136
131
 
137
- firstUpdated() {
138
- const table = this.shadowRoot.getElementById('table');
139
-
140
- const pbColumns = this.querySelectorAll('pb-table-column');
141
- const columns = [];
142
- pbColumns.forEach((column) => columns.push(column.data()));
143
- waitOnce('pb-page-ready', (data) => {
144
- if (data && data.language) {
145
- this.language = data.language;
146
- }
147
- this._params = registry.state;
148
- const url = this.toAbsoluteURL(this.source);
149
- const config = {
150
- height: this.height,
151
- fixedHeader: true,
152
- columns,
153
- resizable: this.resizable,
154
- server: {
155
- url,
156
- then: data => data.results,
157
- total: data => data.count
158
- },
159
- sort: {
160
- multiColumn: false,
161
- enabled: true,
162
- server: {
163
- url: (prev, cols) => {
164
- if (!cols.length) return prev;
165
- const col = cols[0];
166
- return `${prev}${prev.indexOf('?') > -1 ? '&' : '?'}order=${columns[col.index].id}&dir=${col.direction === 1 ? 'asc' : 'desc'}`;
167
- }
168
- }
169
- },
170
- pagination: {
171
- enabled: true,
172
- limit: this.perPage,
173
- server: {
174
- url: (prev, page, limit) => {
175
- const form = this.shadowRoot.getElementById('form');
176
- if (form) {
177
- Object.assign(this._params, form.serializeForm());
178
- }
179
- this._params = this._paramsFromSubforms(this._params);
180
- this._params.limit = limit;
181
- this._params.start = page * limit + 1;
182
- if (this.language) {
183
- this._params.language = this.language;
184
- }
185
- registry.commit(this, this._params);
186
-
187
- // copy params and remove null values
188
- const urlParams = Object.assign({}, this._params);
189
- Object.keys(urlParams).forEach(key => {
190
- if (urlParams[key] === null) {
191
- delete urlParams[key];
192
- }
193
- });
194
- return `${prev}${prev.indexOf('?') > -1 ? '&' : '?'}${new URLSearchParams(urlParams).toString()}`;
195
- }
196
- }
197
- }
198
- };
132
+ const gridjsTheme = await loadStylesheets([`${resolveURL(this.cssPath)}/mermaid.min.css`]);
133
+ const theme = importStyles(this);
134
+ const sheets = [...this.shadowRoot.adoptedStyleSheets, gridjsTheme];
135
+ if (theme) {
136
+ sheets.push(theme);
137
+ }
138
+ this.shadowRoot.adoptedStyleSheets = sheets;
139
+ }
199
140
 
200
- this.grid = new Grid(config);
201
- this.grid.on('load', () => {
202
- this.emitTo('pb-results-received', {
203
- "params": this._params
204
- });
205
- });
141
+ firstUpdated() {
142
+ const table = this.shadowRoot.getElementById('table');
143
+
144
+ const pbColumns = this.querySelectorAll('pb-table-column');
145
+ const columns = [];
146
+ pbColumns.forEach(column => columns.push(column.data()));
147
+ waitOnce('pb-page-ready', data => {
148
+ if (data && data.language) {
149
+ this.language = data.language;
150
+ }
151
+ this._params = registry.state;
152
+ const url = this.toAbsoluteURL(this.source);
153
+ const config = {
154
+ height: this.height,
155
+ fixedHeader: true,
156
+ columns,
157
+ resizable: this.resizable,
158
+ server: {
159
+ url,
160
+ then: data => data.results,
161
+ total: data => data.count,
162
+ },
163
+ sort: {
164
+ multiColumn: false,
165
+ enabled: true,
166
+ server: {
167
+ url: (prev, cols) => {
168
+ if (!cols.length) return prev;
169
+ const col = cols[0];
170
+ return `${prev}${prev.indexOf('?') > -1 ? '&' : '?'}order=${
171
+ columns[col.index].id
172
+ }&dir=${col.direction === 1 ? 'asc' : 'desc'}`;
173
+ },
174
+ },
175
+ },
176
+ pagination: {
177
+ enabled: true,
178
+ limit: this.perPage,
179
+ server: {
180
+ url: (prev, page, limit) => {
181
+ const form = this.shadowRoot.getElementById('form');
182
+ if (form) {
183
+ Object.assign(this._params, form.serializeForm());
184
+ }
185
+ this._params = this._paramsFromSubforms(this._params);
186
+ this._params.limit = limit;
187
+ this._params.start = page * limit + 1;
188
+ if (this.language) {
189
+ this._params.language = this.language;
190
+ }
191
+ registry.commit(this, this._params);
192
+
193
+ // copy params and remove null values
194
+ const urlParams = { ...this._params };
195
+ Object.keys(urlParams).forEach(key => {
196
+ if (urlParams[key] === null) {
197
+ delete urlParams[key];
198
+ }
199
+ });
200
+ return `${prev}${prev.indexOf('?') > -1 ? '&' : '?'}${new URLSearchParams(
201
+ urlParams,
202
+ ).toString()}`;
203
+ },
204
+ },
205
+ },
206
+ };
206
207
 
207
- this.grid.render(table);
208
+ this.grid = new Grid(config);
209
+ this.grid.on('load', () => {
210
+ this.emitTo('pb-results-received', {
211
+ params: this._params,
208
212
  });
209
- }
213
+ });
210
214
 
211
- _submit() {
212
- this.grid.forceRender();
213
- }
215
+ this.grid.render(table);
216
+ });
217
+ }
214
218
 
215
- _paramsFromSubforms(params) {
216
- if (this.subforms) {
217
- document.querySelectorAll(this.subforms).forEach((form) => {
218
- if (form.serializeForm) {
219
- Object.assign(params, form.serializeForm());
220
- }
221
- });
219
+ _submit() {
220
+ this.grid.forceRender();
221
+ }
222
+
223
+ _paramsFromSubforms(params) {
224
+ if (this.subforms) {
225
+ document.querySelectorAll(this.subforms).forEach(form => {
226
+ if (form.serializeForm) {
227
+ Object.assign(params, form.serializeForm());
222
228
  }
223
- return params;
229
+ });
224
230
  }
231
+ return params;
232
+ }
225
233
 
226
- render() {
227
- return html`
228
- ${
229
- this.search ? html`
230
- <iron-form id="form">
231
- <form action="">
232
- <paper-input id="search" name="search" label="Search" value="${this._params.search || ''}" @keyup="${(e) => e.keyCode == 13 ? this._submit() : null}">
233
- <paper-icon-button icon="search" @click="${this._submit}" slot="suffix"></paper-icon-button>
234
- </paper-input>
235
- </form>
236
- </iron-form>
237
- ` : null
238
- }
239
- <div id="table"></div>
240
- `;
241
- }
234
+ render() {
235
+ return html`
236
+ ${this.search
237
+ ? html`
238
+ <iron-form id="form">
239
+ <form action="">
240
+ <paper-input
241
+ id="search"
242
+ name="search"
243
+ label="Search"
244
+ value="${this._params.search || ''}"
245
+ @keyup="${e => (e.keyCode == 13 ? this._submit() : null)}"
246
+ >
247
+ <paper-icon-button
248
+ icon="search"
249
+ @click="${this._submit}"
250
+ slot="suffix"
251
+ ></paper-icon-button>
252
+ </paper-input>
253
+ </form>
254
+ </iron-form>
255
+ `
256
+ : null}
257
+ <div id="table"></div>
258
+ `;
259
+ }
242
260
 
243
- static get styles() {
244
- return css`
245
- :host {
246
- display: block;
247
- }
248
- button {
249
- border: 0;
250
- }
251
- `;
252
- }
261
+ static get styles() {
262
+ return css`
263
+ :host {
264
+ display: block;
265
+ }
266
+ button {
267
+ border: 0;
268
+ }
269
+ `;
270
+ }
253
271
  }
254
- customElements.define('pb-table-grid', PbTableGrid);
272
+ customElements.define('pb-table-grid', PbTableGrid);