@teipublisher/pb-components 2.25.4 → 2.25.6
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/.github/workflows/main.yml +3 -3
- package/.github/workflows/node.js.yml +3 -3
- package/.github/workflows/release.js.yml +4 -4
- package/.releaserc.json +1 -1
- package/CHANGELOG.md +15 -0
- package/Dockerfile +78 -70
- package/css/components.css +5 -5
- package/dist/demo/pb-drawer2.html +1 -1
- package/dist/demo/pb-leaflet-map.html +1 -1
- package/dist/demo/pb-repeat.html +1 -3
- package/dist/demo/pb-view3.html +1 -1
- package/dist/{paper-icon-button-0fb125c4.js → paper-icon-button-72125e67.js} +1 -1
- package/dist/pb-code-editor.js +25 -20
- package/dist/pb-component-docs.js +58 -54
- package/dist/pb-components-bundle.js +1827 -1520
- package/dist/pb-edit-app.js +167 -107
- package/dist/pb-elements.json +54 -54
- package/dist/{pb-i18n-0611135a.js → pb-i18n-4cc00bfe.js} +1 -1
- package/dist/pb-leaflet-map.js +23 -23
- package/dist/pb-mei.js +56 -41
- package/dist/{pb-mixin-b1caa22e.js → pb-mixin-886ece32.js} +1 -1
- package/dist/pb-odd-editor.js +925 -758
- package/dist/pb-tify.js +2 -2
- package/dist/{vaadin-element-mixin-859a0132.js → vaadin-element-mixin-ad07ba25.js} +88 -61
- package/gh-pages.js +5 -3
- package/i18n/common/pl.json +2 -2
- package/package.json +2 -2
- package/pb-elements.json +54 -54
- package/src/assets/components.css +5 -5
- package/src/authority/airtable.js +20 -21
- package/src/authority/anton.js +129 -129
- package/src/authority/custom.js +23 -21
- package/src/authority/geonames.js +38 -32
- package/src/authority/gnd.js +47 -42
- package/src/authority/kbga.js +137 -134
- package/src/authority/metagrid.js +44 -46
- package/src/authority/reconciliation.js +66 -67
- package/src/authority/registry.js +4 -4
- package/src/docs/pb-component-docs.js +2 -2
- package/src/docs/pb-component-view.js +5 -5
- package/src/docs/pb-components-list.js +2 -2
- package/src/docs/pb-demo-snippet.js +2 -2
- package/src/dts-client.js +299 -297
- package/src/dts-select-endpoint.js +90 -82
- package/src/parse-date-service.js +184 -135
- package/src/pb-ajax.js +171 -167
- package/src/pb-authority-lookup.js +96 -81
- package/src/pb-autocomplete.js +292 -280
- package/src/pb-blacklab-highlight.js +264 -259
- package/src/pb-blacklab-results.js +236 -221
- package/src/pb-browse-docs.js +540 -475
- package/src/pb-browse.js +68 -65
- package/src/pb-clipboard.js +79 -76
- package/src/pb-code-editor.js +110 -102
- package/src/pb-code-highlight.js +209 -204
- package/src/pb-codepen.js +79 -72
- package/src/pb-collapse.js +149 -146
- package/src/pb-combo-box.js +190 -190
- package/src/pb-components-bundle.js +1 -1
- package/src/pb-custom-form.js +150 -149
- package/src/pb-document.js +89 -90
- package/src/pb-download.js +208 -195
- package/src/pb-drawer.js +145 -148
- package/src/pb-edit-app.js +301 -229
- package/src/pb-edit-xml.js +99 -96
- package/src/pb-events.js +114 -107
- package/src/pb-facs-link.js +104 -102
- package/src/pb-facsimile.js +411 -413
- package/src/pb-formula.js +151 -153
- package/src/pb-geolocation.js +129 -131
- package/src/pb-grid-action.js +53 -56
- package/src/pb-grid.js +231 -228
- package/src/pb-highlight.js +140 -140
- package/src/pb-hotkeys.js +40 -42
- package/src/pb-i18n.js +101 -104
- package/src/pb-image-strip.js +84 -78
- package/src/pb-lang.js +83 -70
- package/src/pb-leaflet-map.js +488 -485
- package/src/pb-link.js +126 -124
- package/src/pb-load.js +431 -426
- package/src/pb-login.js +275 -254
- package/src/pb-manage-odds.js +364 -318
- package/src/pb-map-icon.js +89 -89
- package/src/pb-map-layer.js +85 -85
- package/src/pb-markdown.js +90 -99
- package/src/pb-media-query.js +74 -72
- package/src/pb-mei.js +306 -295
- package/src/pb-message.js +143 -130
- package/src/pb-mixin.js +269 -264
- package/src/pb-navigation.js +80 -82
- package/src/pb-observable.js +38 -38
- package/src/pb-odd-editor.js +1056 -958
- package/src/pb-odd-elementspec-editor.js +348 -297
- package/src/pb-odd-model-editor.js +1058 -898
- package/src/pb-odd-parameter-editor.js +200 -178
- package/src/pb-odd-rendition-editor.js +136 -124
- package/src/pb-page.js +432 -422
- package/src/pb-paginate.js +202 -190
- package/src/pb-panel.js +191 -179
- package/src/pb-popover-themes.js +7 -5
- package/src/pb-popover.js +296 -287
- package/src/pb-print-preview.js +127 -127
- package/src/pb-progress.js +49 -49
- package/src/pb-repeat.js +105 -104
- package/src/pb-restricted.js +84 -77
- package/src/pb-search.js +238 -221
- package/src/pb-select-feature.js +127 -120
- package/src/pb-select-odd.js +132 -124
- package/src/pb-select-template.js +89 -78
- package/src/pb-select.js +251 -227
- package/src/pb-split-list.js +179 -174
- package/src/pb-svg.js +80 -79
- package/src/pb-table-column.js +54 -54
- package/src/pb-table-grid.js +221 -203
- package/src/pb-tabs.js +61 -63
- package/src/pb-tify.js +154 -154
- package/src/pb-timeline.js +271 -229
- package/src/pb-toggle-feature.js +198 -185
- package/src/pb-upload.js +184 -174
- package/src/pb-version.js +30 -30
- package/src/pb-view-annotate.js +132 -98
- package/src/pb-view.js +1282 -1263
- package/src/pb-zoom.js +40 -40
- package/src/polymer-hack.js +1 -1
- package/src/search-result-service.js +256 -223
- package/src/seed-element.js +13 -20
- package/src/settings.js +4 -4
- package/src/theming.js +91 -91
- package/src/urls.js +289 -289
- package/src/utils.js +53 -51
package/src/pb-search.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement, html, css } from 'lit-element';
|
|
2
2
|
import { pbMixin, waitOnce } from './pb-mixin.js';
|
|
3
|
-
import { registry } from
|
|
4
|
-
import { translate } from
|
|
3
|
+
import { registry } from './urls.js';
|
|
4
|
+
import { translate } from './pb-i18n.js';
|
|
5
5
|
import '@polymer/paper-input/paper-input.js';
|
|
6
6
|
import '@polymer/paper-checkbox';
|
|
7
7
|
import '@polymer/iron-ajax';
|
|
@@ -27,248 +27,265 @@ import '@cwmr/paper-autocomplete';
|
|
|
27
27
|
* @fires pb-search-resubmit - When received, triggers the search again
|
|
28
28
|
*/
|
|
29
29
|
export class PbSearch extends pbMixin(LitElement) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
30
|
+
static get properties() {
|
|
31
|
+
return {
|
|
32
|
+
...super.properties,
|
|
33
|
+
action: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
36
|
+
name: {
|
|
37
|
+
type: String,
|
|
38
|
+
},
|
|
39
|
+
value: {
|
|
40
|
+
type: String,
|
|
41
|
+
},
|
|
42
|
+
start: {
|
|
43
|
+
type: Number,
|
|
44
|
+
},
|
|
45
|
+
placeHolder: {
|
|
46
|
+
type: String,
|
|
47
|
+
attribute: 'place-holder',
|
|
48
|
+
},
|
|
49
|
+
redirect: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
},
|
|
52
|
+
currentDoc: {
|
|
53
|
+
type: String,
|
|
54
|
+
attribute: 'current-doc',
|
|
55
|
+
},
|
|
56
|
+
submitOnLoad: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
attribute: 'submit-on-load',
|
|
59
|
+
},
|
|
60
|
+
subforms: {
|
|
61
|
+
type: String,
|
|
62
|
+
},
|
|
63
|
+
disableAutocomplete: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
attribute: 'disable-autocomplete',
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* Optional URL to query for suggestions. If relative, it is interpreted
|
|
69
|
+
* relative to the endpoint defined on a surrounding `pb-page`.
|
|
70
|
+
*
|
|
71
|
+
* Upon autocomplete, the current input by the user will be sent with a query parameter
|
|
72
|
+
* `query`. The name/values of form controls nested within `pb-search` or subforms will also be
|
|
73
|
+
* appended to the request as parameters. This allows the server side code to distinguish
|
|
74
|
+
* different states.
|
|
75
|
+
*/
|
|
76
|
+
source: {
|
|
77
|
+
type: String,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
constructor() {
|
|
83
|
+
super();
|
|
84
|
+
this.name = 'query';
|
|
85
|
+
this.value = '';
|
|
86
|
+
this.redirect = false;
|
|
87
|
+
this.submitOnLoad = false;
|
|
88
|
+
this.placeHolder = 'search.placeholder';
|
|
89
|
+
this.disableAutocomplete = false;
|
|
90
|
+
this.start = 1;
|
|
91
|
+
}
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
connectedCallback() {
|
|
94
|
+
super.connectedCallback();
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
this.subscribeTo('pb-search-resubmit', this._doSearch.bind(this));
|
|
97
|
+
this.subscribeTo('pb-paginate', ev => {
|
|
98
|
+
this.start = ev.detail.params.start;
|
|
99
|
+
this._doSearch(true);
|
|
100
|
+
});
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
});
|
|
110
|
-
}
|
|
102
|
+
registry.subscribe(this, state => {
|
|
103
|
+
this.value = state.query || '';
|
|
104
|
+
this.start = state.start || 1;
|
|
105
|
+
if (this.submitOnLoad) {
|
|
106
|
+
this.emitTo('pb-load', {
|
|
107
|
+
url: this.action,
|
|
108
|
+
params: state,
|
|
111
109
|
});
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
firstUpdated() {
|
|
115
|
+
if (!this.disableAutocomplete) {
|
|
116
|
+
const autocomplete = this.shadowRoot.getElementById('autocomplete');
|
|
117
|
+
autocomplete.addEventListener('autocomplete-change', this._autocomplete.bind(this));
|
|
112
118
|
}
|
|
119
|
+
const ironform = this.shadowRoot.getElementById('ironform');
|
|
120
|
+
ironform.addEventListener('iron-form-response', event =>
|
|
121
|
+
event.detail.completes.then(r => this.emitTo('pb-search', r.parseResponse())),
|
|
122
|
+
);
|
|
123
|
+
waitOnce('pb-page-ready', options => {
|
|
124
|
+
const loader = this.shadowRoot.getElementById('autocompleteLoader');
|
|
125
|
+
const url = this.source || 'api/search/autocomplete';
|
|
126
|
+
if (this.minApiVersion('1.0.0')) {
|
|
127
|
+
loader.url = `${options.endpoint}/${url}`;
|
|
128
|
+
} else {
|
|
129
|
+
loader.url = `${options.endpoint}/modules/autocomplete.xql`;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
113
132
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
);
|
|
123
|
-
waitOnce('pb-page-ready', (options) => {
|
|
124
|
-
const loader = this.shadowRoot.getElementById('autocompleteLoader');
|
|
125
|
-
const url = this.source || "api/search/autocomplete";
|
|
126
|
-
if (this.minApiVersion('1.0.0')) {
|
|
127
|
-
loader.url = `${options.endpoint}/${url}`;
|
|
128
|
-
} else {
|
|
129
|
-
loader.url = `${options.endpoint}/modules/autocomplete.xql`;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
133
|
+
if (this.submitOnLoad) {
|
|
134
|
+
const params = registry.state;
|
|
135
|
+
registry.replace(this, params);
|
|
136
|
+
this.emitTo('pb-load', {
|
|
137
|
+
url: this.action,
|
|
138
|
+
params,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
132
141
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
this.addEventListener('click', e => {
|
|
143
|
+
const root = e.target.closest('[slot]');
|
|
144
|
+
if (!root) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (root.slot === 'searchButton') {
|
|
148
|
+
this._doSearch();
|
|
149
|
+
}
|
|
150
|
+
if (root.slot === 'resetButton') {
|
|
151
|
+
this._reset();
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
141
155
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
156
|
+
render() {
|
|
157
|
+
return html`
|
|
158
|
+
<custom-style>
|
|
159
|
+
<style>
|
|
160
|
+
:host {
|
|
161
|
+
--suggestions-item: {
|
|
162
|
+
color: var(--pb-search-suggestions-color, black);
|
|
146
163
|
}
|
|
147
|
-
|
|
148
|
-
|
|
164
|
+
--suggestions-wrapper: {
|
|
165
|
+
background: var(--pb-search-suggestions-background, white);
|
|
149
166
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
value="${this.value}" always-float-label>
|
|
175
|
-
<iron-icon icon="search" @click="${this._doSearch}" slot="prefix"></iron-icon>
|
|
176
|
-
</paper-input>
|
|
177
|
-
<paper-autocomplete-suggestions id="autocomplete" for="search" source="${this._suggestions}" remote-source></paper-autocomplete-suggestions>
|
|
178
|
-
<slot></slot>
|
|
179
|
-
|
|
180
|
-
<slot name="searchButton"></slot>
|
|
181
|
-
<slot name="resetButton"></slot>
|
|
182
|
-
|
|
183
|
-
</form>
|
|
184
|
-
</iron-form>
|
|
185
|
-
<iron-ajax
|
|
186
|
-
id="autocompleteLoader"
|
|
187
|
-
verbose
|
|
188
|
-
handle-as="json"
|
|
189
|
-
method="get"
|
|
190
|
-
with-credentials
|
|
191
|
-
@response="${this._updateSuggestions}"></iron-ajax>
|
|
192
|
-
`;
|
|
193
|
-
}
|
|
167
|
+
}
|
|
168
|
+
</style>
|
|
169
|
+
</custom-style>
|
|
170
|
+
<iron-form id="ironform" allow-redirect="${this.redirect}">
|
|
171
|
+
<form id="searchPageForm" method="get" action="${this.action}" accept="text/html">
|
|
172
|
+
<slot name="beforeInput"></slot>
|
|
173
|
+
<paper-input
|
|
174
|
+
id="search"
|
|
175
|
+
type="search"
|
|
176
|
+
name="query"
|
|
177
|
+
@keyup="${this._handleEnter}"
|
|
178
|
+
label="${translate(this.placeHolder)}"
|
|
179
|
+
value="${this.value}"
|
|
180
|
+
always-float-label
|
|
181
|
+
>
|
|
182
|
+
<iron-icon icon="search" @click="${this._doSearch}" slot="prefix"></iron-icon>
|
|
183
|
+
</paper-input>
|
|
184
|
+
<paper-autocomplete-suggestions
|
|
185
|
+
id="autocomplete"
|
|
186
|
+
for="search"
|
|
187
|
+
source="${this._suggestions}"
|
|
188
|
+
remote-source
|
|
189
|
+
></paper-autocomplete-suggestions>
|
|
190
|
+
<slot></slot>
|
|
194
191
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
form {
|
|
210
|
-
margin: 0;
|
|
211
|
-
}
|
|
212
|
-
`;
|
|
213
|
-
}
|
|
192
|
+
<slot name="searchButton"></slot>
|
|
193
|
+
<slot name="resetButton"></slot>
|
|
194
|
+
</form>
|
|
195
|
+
</iron-form>
|
|
196
|
+
<iron-ajax
|
|
197
|
+
id="autocompleteLoader"
|
|
198
|
+
verbose
|
|
199
|
+
handle-as="json"
|
|
200
|
+
method="get"
|
|
201
|
+
with-credentials
|
|
202
|
+
@response="${this._updateSuggestions}"
|
|
203
|
+
></iron-ajax>
|
|
204
|
+
`;
|
|
205
|
+
}
|
|
214
206
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
207
|
+
static get styles() {
|
|
208
|
+
return css`
|
|
209
|
+
:host {
|
|
210
|
+
--paper-input-container-color: var(--pb-search-label-color, var(--paper-grey-500, #303030));
|
|
211
|
+
--paper-input-container-input-color: var(
|
|
212
|
+
--pb-search-input-color,
|
|
213
|
+
var(--pb-color-primary, #000000)
|
|
214
|
+
);
|
|
215
|
+
--paper-input-container-focus-color: var(
|
|
216
|
+
--pb-search-focus-color,
|
|
217
|
+
var(--paper-grey-500, #303030)
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
a {
|
|
221
|
+
padding: 1rem;
|
|
222
|
+
color: var(--pb-reset-color);
|
|
223
|
+
}
|
|
224
|
+
.buttons {
|
|
225
|
+
margin-top: 1rem;
|
|
226
|
+
}
|
|
227
|
+
form {
|
|
228
|
+
margin: 0;
|
|
229
|
+
}
|
|
230
|
+
`;
|
|
231
|
+
}
|
|
232
232
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
233
|
+
_doSearch(pagination = false) {
|
|
234
|
+
let json = this.shadowRoot.getElementById('ironform').serializeForm();
|
|
235
|
+
json = this._paramsFromSubforms(json);
|
|
236
|
+
// remove unnecessary param added by autocomplete
|
|
237
|
+
delete json['autocomplete-custom-template'];
|
|
238
|
+
// always start on first result after submitting new search
|
|
239
|
+
json.start = pagination ? this.start : 1;
|
|
240
|
+
if (this.redirect) {
|
|
241
|
+
window.location.href = `${this.action}?${new URLSearchParams(json)}`;
|
|
242
|
+
} else {
|
|
243
|
+
registry.commit(this, json);
|
|
244
|
+
this.emitTo('pb-load', {
|
|
245
|
+
url: this.action,
|
|
246
|
+
params: json,
|
|
247
|
+
});
|
|
242
248
|
}
|
|
249
|
+
}
|
|
243
250
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
251
|
+
_paramsFromSubforms(params) {
|
|
252
|
+
if (this.subforms) {
|
|
253
|
+
document.querySelectorAll(this.subforms).forEach(form => {
|
|
254
|
+
if (form.serializeForm) {
|
|
255
|
+
Object.assign(params, form.serializeForm());
|
|
247
256
|
}
|
|
257
|
+
});
|
|
248
258
|
}
|
|
259
|
+
return params;
|
|
260
|
+
}
|
|
249
261
|
|
|
250
|
-
|
|
251
|
-
|
|
262
|
+
_handleEnter(e) {
|
|
263
|
+
if (e.keyCode === 13) {
|
|
264
|
+
this._doSearch();
|
|
252
265
|
}
|
|
266
|
+
}
|
|
253
267
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
268
|
+
_doSubmit() {
|
|
269
|
+
this.shadowRoot.getElementById('ironform').submit();
|
|
270
|
+
}
|
|
257
271
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
loader.params = params;
|
|
262
|
-
loader.generateRequest();
|
|
263
|
-
}
|
|
272
|
+
_reset() {
|
|
273
|
+
this.shadowRoot.getElementById('ironform').reset();
|
|
274
|
+
}
|
|
264
275
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
276
|
+
_autocomplete(ev) {
|
|
277
|
+
const params = this.shadowRoot.getElementById('ironform').serializeForm();
|
|
278
|
+
const loader = this.shadowRoot.getElementById('autocompleteLoader');
|
|
279
|
+
loader.params = params;
|
|
280
|
+
loader.generateRequest();
|
|
281
|
+
}
|
|
272
282
|
|
|
283
|
+
_updateSuggestions() {
|
|
284
|
+
const autocomplete = this.shadowRoot.getElementById('autocomplete');
|
|
285
|
+
const loader = this.shadowRoot.getElementById('autocompleteLoader');
|
|
286
|
+
if (loader.lastResponse) {
|
|
287
|
+
autocomplete.suggestions(loader.lastResponse);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
273
290
|
}
|
|
274
291
|
customElements.define('pb-search', PbSearch);
|