@teipublisher/pb-components 2.1.1 → 2.3.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.
@@ -211,14 +211,15 @@ export class PbManageOdds extends pbMixin(LitElement) {
211
211
  ${this.odds.map((odd) =>
212
212
  html`
213
213
  <div class="odd">
214
- <a href="odd-editor.html?odd=${odd.name}.odd" target="_blank">${odd.label}</a>
214
+ <a href="odd-editor.html?odd=${odd.name}.odd" target="_blank"
215
+ title="edit ODD in graphical editor">${odd.label}</a>
215
216
  <!-- TODO this toolbar should only appear once per ODD files papercard -->
216
217
  <app-toolbar>
217
218
  ${
218
219
  odd.canWrite ?
219
220
  html`
220
221
  <pb-restricted login="login">
221
- <pb-ajax url="${regenUrl}?odd=${odd.name}.odd" method="post"
222
+ <pb-ajax url="${regenUrl}?odd=${odd.name}.odd" method="post"
222
223
  emit="${this.emit ? this.emit : ''}" .emitConfig="${this.emitConfig}">
223
224
  <h2 slot="title">${translate('menu.admin.recompile')}</h2>
224
225
  <paper-icon-button title="Regenerate ODD" icon="update"></paper-icon-button>
@@ -227,8 +228,10 @@ export class PbManageOdds extends pbMixin(LitElement) {
227
228
  </pb-restricted>
228
229
  ` : null
229
230
  }
230
- <pb-edit-xml path="${odd.path}">
231
- <paper-icon-button title="Edit ODD" icon="code"></paper-icon-button>
231
+ <a href="odd-editor.html?odd=${odd.name}.odd" target="_blank" class="editor-link"
232
+ title="edit ODD in graphical editor"><iron-icon icon="reorder"></iron-icon></a>
233
+ <pb-edit-xml path="${odd.path}" class="editor-link">
234
+ <paper-icon-button title="Edit XML" icon="create"></paper-icon-button>
232
235
  </pb-edit-xml>
233
236
  </app-toolbar>
234
237
  </div>
@@ -295,15 +298,19 @@ export class PbManageOdds extends pbMixin(LitElement) {
295
298
  margin-right: 1em;
296
299
  }
297
300
 
298
- .odd a {
301
+ .odd a,
302
+ .odd a:link,
303
+ .odd a:visited{
299
304
  display: block;
300
- flex: 2 0;
305
+ flex: 10 0;
306
+ color:var(--pb-manage-odds-link-color);
301
307
  }
302
308
 
303
309
  .odd app-toolbar {
304
310
  flex: 1 0;
305
- justify-content: flex-end;
306
- padding: 0;
311
+ justify-content: flex-end;
312
+ padding: 0;
313
+ min-height:0.25rem;
307
314
  }
308
315
 
309
316
  pb-restricted {
@@ -313,7 +320,7 @@ export class PbManageOdds extends pbMixin(LitElement) {
313
320
  .odd-description {
314
321
  color: #888888;
315
322
  font-size: 0.8em;
316
- margin-top: -1em;
323
+ margin-bottom: 0.25rem;
317
324
  }
318
325
 
319
326
  #regenerateAll {
@@ -322,7 +329,28 @@ export class PbManageOdds extends pbMixin(LitElement) {
322
329
  margin-top: 10px;
323
330
  text-align: right;
324
331
  }
332
+ [icon]{
333
+ color:var(--pb-manage-odds-icon-color);
334
+ }
335
+
336
+ [icon='reorder']
337
+ {
338
+ width:24px;
339
+ height: 24px;
340
+ }
341
+
342
+ @media (hover:hover) and (pointer: fine){
343
+ .odd app-toolbar .editor-link{
344
+ opacity: 0;
345
+ }
346
+ .odd:hover .editor-link{
347
+ opacity: 1;
348
+ transition: opacity 0.6s;
349
+ }
350
+ }
325
351
  `;
326
352
  }
327
353
  }
328
- customElements.define('pb-manage-odds', PbManageOdds);
354
+ if(!customElements.get('pb-manage-odds')){
355
+ customElements.define('pb-manage-odds', PbManageOdds);
356
+ }
@@ -10,6 +10,7 @@ import { translate } from "./pb-i18n.js";
10
10
  * which should cause the connected `pb-load` element to refresh.
11
11
  *
12
12
  * @fires pb-load - Fires when user selects new page to show
13
+ * @fires pb-paginate - Fires when user selects new page to show
13
14
  * @fires pb-results-received - When received, recalculates page ranges to display according to the parameters received
14
15
  */
15
16
  export class PbPaginate extends pbMixin(LitElement) {
package/src/pb-search.js CHANGED
@@ -23,6 +23,7 @@ import '@cwmr/paper-autocomplete';
23
23
  * @slot - searchButton allows to plug a component that acts as submit button. Must support the 'click' event
24
24
  * @slot - resetButton allows to plug a component that acts as reset button. Must support the 'click' event
25
25
  * @fires pb-load - Fired to perform the actual search with parameters passed to the request
26
+ * @fires pb-paginate - When received, triggers the search again with the new value of the start property
26
27
  * @fires pb-search-resubmit - When received, triggers the search again
27
28
  */
28
29
  export class PbSearch extends pbMixin(LitElement) {
@@ -62,6 +63,18 @@ export class PbSearch extends pbMixin(LitElement) {
62
63
  disableAutocomplete: {
63
64
  type: Boolean,
64
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
65
78
  }
66
79
  };
67
80
  }
@@ -109,8 +122,9 @@ export class PbSearch extends pbMixin(LitElement) {
109
122
  );
110
123
  waitOnce('pb-page-ready', (options) => {
111
124
  const loader = this.shadowRoot.getElementById('autocompleteLoader');
125
+ const url = this.source || "api/search/autocomplete";
112
126
  if (this.minApiVersion('1.0.0')) {
113
- loader.url = `${options.endpoint}/api/search/autocomplete`;
127
+ loader.url = `${options.endpoint}/${url}`;
114
128
  } else {
115
129
  loader.url = `${options.endpoint}/modules/autocomplete.xql`;
116
130
  }
package/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- dist: xenial
2
- language: node_js
3
- node_js:
4
- - 14
5
- services:
6
- - docker
7
- env:
8
- - img=existdb/teipublisher:6.0.0-RC1
9
- before_install:
10
- - docker pull $img
11
- - docker create --name exist-ci -p 8080:8080 $img
12
- - npm prune
13
- install:
14
- - npm install -q
15
- before_script:
16
- - docker start exist-ci
17
- # exist needs time
18
- - sleep 30
19
- script:
20
- - npm test