@teipublisher/pb-components 2.25.5 → 2.25.7

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 (130) 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 +3 -3
  4. package/CHANGELOG.md +15 -0
  5. package/Dockerfile +78 -70
  6. package/css/components.css +5 -5
  7. package/dist/demo/pb-drawer2.html +1 -1
  8. package/dist/demo/pb-facsimile.html +2 -2
  9. package/dist/demo/pb-leaflet-map.html +1 -1
  10. package/dist/demo/pb-repeat.html +1 -3
  11. package/dist/demo/pb-view3.html +1 -1
  12. package/dist/{paper-icon-button-0fb125c4.js → paper-icon-button-72125e67.js} +1 -1
  13. package/dist/pb-code-editor.js +25 -20
  14. package/dist/pb-component-docs.js +58 -54
  15. package/dist/pb-components-bundle.js +1827 -1520
  16. package/dist/pb-edit-app.js +167 -107
  17. package/dist/pb-elements.json +54 -54
  18. package/dist/{pb-i18n-0611135a.js → pb-i18n-4cc00bfe.js} +1 -1
  19. package/dist/pb-leaflet-map.js +23 -23
  20. package/dist/pb-mei.js +56 -41
  21. package/dist/{pb-mixin-b1caa22e.js → pb-mixin-886ece32.js} +1 -1
  22. package/dist/pb-odd-editor.js +925 -758
  23. package/dist/pb-tify.js +2 -2
  24. package/dist/{vaadin-element-mixin-859a0132.js → vaadin-element-mixin-ad07ba25.js} +88 -61
  25. package/gh-pages.js +5 -3
  26. package/lib/openseadragon.min.js +6 -6
  27. package/package.json +3 -2
  28. package/pb-elements.json +54 -54
  29. package/src/assets/components.css +5 -5
  30. package/src/authority/airtable.js +20 -21
  31. package/src/authority/anton.js +129 -129
  32. package/src/authority/custom.js +23 -21
  33. package/src/authority/geonames.js +38 -32
  34. package/src/authority/gnd.js +47 -42
  35. package/src/authority/kbga.js +137 -134
  36. package/src/authority/metagrid.js +44 -46
  37. package/src/authority/reconciliation.js +66 -67
  38. package/src/authority/registry.js +4 -4
  39. package/src/docs/pb-component-docs.js +2 -2
  40. package/src/docs/pb-component-view.js +5 -5
  41. package/src/docs/pb-components-list.js +2 -2
  42. package/src/docs/pb-demo-snippet.js +2 -2
  43. package/src/dts-client.js +299 -297
  44. package/src/dts-select-endpoint.js +90 -82
  45. package/src/parse-date-service.js +184 -135
  46. package/src/pb-ajax.js +171 -167
  47. package/src/pb-authority-lookup.js +96 -81
  48. package/src/pb-autocomplete.js +292 -280
  49. package/src/pb-blacklab-highlight.js +264 -259
  50. package/src/pb-blacklab-results.js +236 -221
  51. package/src/pb-browse-docs.js +540 -475
  52. package/src/pb-browse.js +68 -65
  53. package/src/pb-clipboard.js +79 -76
  54. package/src/pb-code-editor.js +110 -102
  55. package/src/pb-code-highlight.js +209 -204
  56. package/src/pb-codepen.js +79 -72
  57. package/src/pb-collapse.js +149 -146
  58. package/src/pb-combo-box.js +190 -190
  59. package/src/pb-components-bundle.js +1 -1
  60. package/src/pb-custom-form.js +150 -149
  61. package/src/pb-document.js +89 -90
  62. package/src/pb-download.js +208 -195
  63. package/src/pb-drawer.js +145 -148
  64. package/src/pb-edit-app.js +301 -229
  65. package/src/pb-edit-xml.js +99 -96
  66. package/src/pb-events.js +114 -107
  67. package/src/pb-facs-link.js +104 -102
  68. package/src/pb-facsimile.js +444 -410
  69. package/src/pb-formula.js +151 -153
  70. package/src/pb-geolocation.js +129 -131
  71. package/src/pb-grid-action.js +53 -56
  72. package/src/pb-grid.js +231 -228
  73. package/src/pb-highlight.js +140 -140
  74. package/src/pb-hotkeys.js +40 -42
  75. package/src/pb-i18n.js +101 -104
  76. package/src/pb-image-strip.js +84 -78
  77. package/src/pb-lang.js +83 -70
  78. package/src/pb-leaflet-map.js +488 -485
  79. package/src/pb-link.js +126 -124
  80. package/src/pb-load.js +431 -426
  81. package/src/pb-login.js +275 -254
  82. package/src/pb-manage-odds.js +364 -318
  83. package/src/pb-map-icon.js +89 -89
  84. package/src/pb-map-layer.js +85 -85
  85. package/src/pb-markdown.js +90 -99
  86. package/src/pb-media-query.js +74 -72
  87. package/src/pb-mei.js +306 -295
  88. package/src/pb-message.js +143 -130
  89. package/src/pb-mixin.js +269 -264
  90. package/src/pb-navigation.js +80 -82
  91. package/src/pb-observable.js +38 -38
  92. package/src/pb-odd-editor.js +1056 -958
  93. package/src/pb-odd-elementspec-editor.js +348 -297
  94. package/src/pb-odd-model-editor.js +1058 -898
  95. package/src/pb-odd-parameter-editor.js +200 -178
  96. package/src/pb-odd-rendition-editor.js +136 -124
  97. package/src/pb-page.js +432 -422
  98. package/src/pb-paginate.js +202 -190
  99. package/src/pb-panel.js +191 -179
  100. package/src/pb-popover-themes.js +7 -5
  101. package/src/pb-popover.js +296 -287
  102. package/src/pb-print-preview.js +127 -127
  103. package/src/pb-progress.js +49 -49
  104. package/src/pb-repeat.js +105 -104
  105. package/src/pb-restricted.js +84 -77
  106. package/src/pb-search.js +238 -221
  107. package/src/pb-select-feature.js +127 -120
  108. package/src/pb-select-odd.js +132 -124
  109. package/src/pb-select-template.js +89 -78
  110. package/src/pb-select.js +251 -227
  111. package/src/pb-split-list.js +179 -174
  112. package/src/pb-svg.js +80 -79
  113. package/src/pb-table-column.js +54 -54
  114. package/src/pb-table-grid.js +221 -203
  115. package/src/pb-tabs.js +61 -63
  116. package/src/pb-tify.js +154 -154
  117. package/src/pb-timeline.js +271 -229
  118. package/src/pb-toggle-feature.js +198 -185
  119. package/src/pb-upload.js +184 -174
  120. package/src/pb-version.js +30 -30
  121. package/src/pb-view-annotate.js +132 -98
  122. package/src/pb-view.js +1282 -1263
  123. package/src/pb-zoom.js +40 -40
  124. package/src/polymer-hack.js +1 -1
  125. package/src/search-result-service.js +256 -223
  126. package/src/seed-element.js +13 -20
  127. package/src/settings.js +4 -4
  128. package/src/theming.js +91 -91
  129. package/src/urls.js +289 -289
  130. package/src/utils.js +53 -51
package/src/pb-login.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 { translate } from "./pb-i18n.js";
4
- import { registry } from "./urls.js";
3
+ import { translate } from './pb-i18n.js';
4
+ import { registry } from './urls.js';
5
5
  import '@polymer/iron-ajax';
6
6
  import '@polymer/paper-dialog';
7
7
  import '@polymer/paper-dialog-scrollable';
@@ -21,152 +21,173 @@ import { minVersion } from './utils.js';
21
21
  * @csspart group-invalid - Text displayed if login is invalid concerning group
22
22
  */
23
23
  export class PbLogin extends pbMixin(LitElement) {
24
- static get properties() {
25
- return {
26
- ...super.properties,
27
- /** True if user is currently logged in */
28
- loggedIn: {
29
- type: Boolean,
30
- attribute: 'logged-in',
31
- reflect: true
32
- },
33
- /**
34
- * The currently logged in user.
35
- */
36
- user: {
37
- type: String
38
- },
39
- password: {
40
- type: String
41
- },
42
- /**
43
- * If set, only users being members of the specified group are
44
- * allowed to log in.
45
- * Multiple groups can be defined separating items by space and/or comma.
46
- */
47
- group: {
48
- type: String
49
- },
50
- /**
51
- * Array of groups the current user is a member of.
52
- */
53
- groups: {
54
- type: Array
55
- },
56
- /**
57
- * If set to true, automatically show login dialog if user is not logged in
58
- */
59
- auto: {
60
- type: Boolean
61
- },
62
- /**
63
- * Label to show if not logged in
64
- */
65
- loginLabel: {
66
- type: String,
67
- reflect: true,
68
- attribute: 'login-label'
69
- },
70
- /**
71
- * Label to show before user name if logged in
72
- */
73
- logoutLabel: {
74
- type: String,
75
- reflect: true,
76
- attribute: 'logout-label'
77
- },
78
- loginIcon: {
79
- type: String,
80
- attribute: 'login-icon'
81
- },
82
- logoutIcon: {
83
- type: String,
84
- attribute: 'logout-icon'
85
- },
86
- _invalid: {
87
- type: Boolean
88
- },
89
- _hasFocus: {
90
- type: Boolean
91
- }
92
- };
93
- }
24
+ static get properties() {
25
+ return {
26
+ ...super.properties,
27
+ /** True if user is currently logged in */
28
+ loggedIn: {
29
+ type: Boolean,
30
+ attribute: 'logged-in',
31
+ reflect: true,
32
+ },
33
+ /**
34
+ * The currently logged in user.
35
+ */
36
+ user: {
37
+ type: String,
38
+ },
39
+ password: {
40
+ type: String,
41
+ },
42
+ /**
43
+ * If set, only users being members of the specified group are
44
+ * allowed to log in.
45
+ * Multiple groups can be defined separating items by space and/or comma.
46
+ */
47
+ group: {
48
+ type: String,
49
+ },
50
+ /**
51
+ * Array of groups the current user is a member of.
52
+ */
53
+ groups: {
54
+ type: Array,
55
+ },
56
+ /**
57
+ * If set to true, automatically show login dialog if user is not logged in
58
+ */
59
+ auto: {
60
+ type: Boolean,
61
+ },
62
+ /**
63
+ * Label to show if not logged in
64
+ */
65
+ loginLabel: {
66
+ type: String,
67
+ reflect: true,
68
+ attribute: 'login-label',
69
+ },
70
+ /**
71
+ * Label to show before user name if logged in
72
+ */
73
+ logoutLabel: {
74
+ type: String,
75
+ reflect: true,
76
+ attribute: 'logout-label',
77
+ },
78
+ loginIcon: {
79
+ type: String,
80
+ attribute: 'login-icon',
81
+ },
82
+ logoutIcon: {
83
+ type: String,
84
+ attribute: 'logout-icon',
85
+ },
86
+ _invalid: {
87
+ type: Boolean,
88
+ },
89
+ _hasFocus: {
90
+ type: Boolean,
91
+ },
92
+ };
93
+ }
94
94
 
95
- constructor() {
96
- super();
97
- this.loggedIn = false;
98
- this.loginLabel = 'login.login';
99
- this.logoutLabel = 'login.as';
100
- this.user = '';
101
- this.groups = [];
102
- this.loginIcon = 'account-circle';
103
- this.logoutIcon = 'supervisor-account';
104
- this._hasFocus = true;
105
- }
95
+ constructor() {
96
+ super();
97
+ this.loggedIn = false;
98
+ this.loginLabel = 'login.login';
99
+ this.logoutLabel = 'login.as';
100
+ this.user = '';
101
+ this.groups = [];
102
+ this.loginIcon = 'account-circle';
103
+ this.logoutIcon = 'supervisor-account';
104
+ this._hasFocus = true;
105
+ }
106
106
 
107
- firstUpdated() {
108
- super.firstUpdated();
109
- this._checkLogin = this.shadowRoot.getElementById('checkLogin');
110
- this._loginDialog = this.shadowRoot.getElementById('loginDialog');
107
+ firstUpdated() {
108
+ super.firstUpdated();
109
+ this._checkLogin = this.shadowRoot.getElementById('checkLogin');
110
+ this._loginDialog = this.shadowRoot.getElementById('loginDialog');
111
111
 
112
- window.addEventListener('blur', () => {
113
- this._hasFocus = false;
114
- });
115
- window.addEventListener('focus', () => {
116
- if (!this._hasFocus) {
117
- this._hasFocus = true;
118
- this._checkLogin.body = null;
119
- this._checkLogin.generateRequest();
120
- }
121
- });
122
- waitOnce('pb-page-ready', (detail) => {
123
- if (minVersion(detail.apiVersion, '1.0.0')) {
124
- this._checkLogin.url = `${detail.endpoint}/api/login/`;
125
- } else {
126
- this._checkLogin.url = `${detail.endpoint}/login`;
127
- }
128
- this._checkLogin.body = {
129
- user: this.user,
130
- password: this.password
131
- };
132
- this._checkLogin.generateRequest();
133
- });
134
- this.addEventListener('keyup', event => {
135
- if (event.keyCode === 13) {
136
- event.preventDefault();
137
- this._confirmLogin();
138
- }
139
- });
140
- }
112
+ window.addEventListener('blur', () => {
113
+ this._hasFocus = false;
114
+ });
115
+ window.addEventListener('focus', () => {
116
+ if (!this._hasFocus) {
117
+ this._hasFocus = true;
118
+ this._checkLogin.body = null;
119
+ this._checkLogin.generateRequest();
120
+ }
121
+ });
122
+ waitOnce('pb-page-ready', detail => {
123
+ if (minVersion(detail.apiVersion, '1.0.0')) {
124
+ this._checkLogin.url = `${detail.endpoint}/api/login/`;
125
+ } else {
126
+ this._checkLogin.url = `${detail.endpoint}/login`;
127
+ }
128
+ this._checkLogin.body = {
129
+ user: this.user,
130
+ password: this.password,
131
+ };
132
+ this._checkLogin.generateRequest();
133
+ });
134
+ this.addEventListener('keyup', event => {
135
+ if (event.keyCode === 13) {
136
+ event.preventDefault();
137
+ this._confirmLogin();
138
+ }
139
+ });
140
+ }
141
141
 
142
- render() {
143
- return html`
144
- <a href="#" @click="${this._show}" role="button" title="${this.user ? this.user : this.loginLabel}">
142
+ render() {
143
+ return html`
144
+ <a href="#" @click="${this._show}" role="button" title="${
145
+ this.user ? this.user : this.loginLabel
146
+ }">
145
147
  ${
146
- this.loggedIn ?
147
- html`<iron-icon icon="${this.logoutIcon}"></iron-icon> <span class="label">${translate(this.logoutLabel, { user: this.user })}</span>` :
148
- html`<iron-icon icon="${this.loginIcon}"></iron-icon> <span class="label">${translate(this.loginLabel)}</span>`
149
- }
148
+ this.loggedIn
149
+ ? html`<iron-icon icon="${this.logoutIcon}"></iron-icon>
150
+ <span class="label"
151
+ >${translate(this.logoutLabel, { user: this.user })}</span
152
+ >`
153
+ : html`<iron-icon icon="${this.loginIcon}"></iron-icon>
154
+ <span class="label">${translate(this.loginLabel)}</span>`
155
+ }
150
156
  </a>
151
157
 
152
158
  <paper-dialog id="loginDialog" ?modal="${this.auto}">
153
159
  <h2>${translate('login.login')}</h2>
154
160
  <paper-dialog-scrollable>
155
161
  <form action="login">
156
- <paper-input id="user" name="user" label="${translate('login.user')}" value="${this.user}" autofocus></paper-input>
157
- <paper-input id="password" name="password" label="${translate('login.password')}" type="password"></paper-input>
162
+ <paper-input id="user" name="user" label="${translate(
163
+ 'login.user',
164
+ )}" value="${this.user}" autofocus></paper-input>
165
+ <paper-input id="password" name="password" label="${translate(
166
+ 'login.password',
167
+ )}" type="password"></paper-input>
158
168
  <input id="logout" type="hidden" name="logout"></input>
159
169
  </form>
160
170
  <slot name="information"></slot>
161
- ${this._invalid ?
162
- html`
163
- <p id="message" part="message-invalid">${translate('login.invalid')}<span part="group-invalid">${this.group ? html` (${translate('login.requiredGroup', { group: this.group })})` : null}</span>.
171
+ ${
172
+ this._invalid
173
+ ? html`
174
+ <p id="message" part="message-invalid">
175
+ ${translate('login.invalid')}<span part="group-invalid"
176
+ >${this.group
177
+ ? html` (${translate('login.requiredGroup', {
178
+ group: this.group,
179
+ })})`
180
+ : null}</span
181
+ >.
164
182
  </p>
165
- `: null
166
- }
183
+ `
184
+ : null
185
+ }
167
186
  </paper-dialog-scrollable>
168
187
  <div class="buttons">
169
- <paper-button autofocus @click="${this._confirmLogin}">${translate(this.loginLabel)}</paper-button>
188
+ <paper-button autofocus @click="${this._confirmLogin}">${translate(
189
+ this.loginLabel,
190
+ )}</paper-button>
170
191
  </div>
171
192
  </paper-dialog>
172
193
 
@@ -175,146 +196,146 @@ export class PbLogin extends pbMixin(LitElement) {
175
196
  method="post"
176
197
  content-type="application/x-www-form-urlencoded"></iron-ajax>
177
198
  `;
178
- }
199
+ }
179
200
 
180
- static get styles() {
181
- return css`
182
- :host {
183
- display: block;
184
- }
201
+ static get styles() {
202
+ return css`
203
+ :host {
204
+ display: block;
205
+ }
185
206
 
186
- paper-dialog {
187
- min-width: 320px;
188
- max-width: 640px;
189
- min-height: 128px;
190
- }
207
+ paper-dialog {
208
+ min-width: 320px;
209
+ max-width: 640px;
210
+ min-height: 128px;
211
+ }
191
212
 
192
- paper-dialog h2 {
193
- background-color: #607D8B;
194
- padding: 16px 8px;
195
- margin-top: 0;
196
- color: #F0F0F0;
197
- }
213
+ paper-dialog h2 {
214
+ background-color: #607d8b;
215
+ padding: 16px 8px;
216
+ margin-top: 0;
217
+ color: #f0f0f0;
218
+ }
198
219
 
199
- a {
200
- color: var(--pb-login-link-color, --pb-link-color);
201
- text-decoration: none;
202
- display: flex;
203
- gap:0.5rem;
204
- }
220
+ a {
221
+ color: var(--pb-login-link-color, --pb-link-color);
222
+ text-decoration: none;
223
+ display: flex;
224
+ gap: 0.5rem;
225
+ }
205
226
 
206
- #message {
207
- color: var(--paper-red-800);
208
- }
209
- `;
227
+ #message {
228
+ color: var(--paper-red-800);
229
+ }
230
+ `;
231
+ }
232
+
233
+ _show(ev) {
234
+ ev.preventDefault();
235
+ if (this.loggedIn) {
236
+ this._checkLogin.body = {
237
+ logout: this.user,
238
+ };
239
+ this._checkLogin.generateRequest();
240
+ } else {
241
+ this._loginDialog.open();
210
242
  }
243
+ }
244
+
245
+ _confirmLogin() {
246
+ this.user = this.shadowRoot.getElementById('user').value;
247
+ this.password = this.shadowRoot.getElementById('password').value;
248
+ this._checkLogin.body = {
249
+ user: this.user,
250
+ password: this.password,
251
+ };
252
+ this._checkLogin.generateRequest();
253
+ }
211
254
 
212
- _show(ev) {
213
- ev.preventDefault();
214
- if (this.loggedIn) {
215
- this._checkLogin.body = {
216
- logout: this.user
217
- };
218
- this._checkLogin.generateRequest();
219
- } else {
220
- this._loginDialog.open();
221
- }
255
+ _handleResponse() {
256
+ const resp = this._checkLogin.lastResponse;
257
+ if (resp.user && this._checkGroup(resp)) {
258
+ resp.userChanged = !this.loggedIn || this.user !== resp.user;
259
+ this.loggedIn = true;
260
+ this.user = resp.user;
261
+ this.groups = resp.groups;
262
+ this._invalid = false;
263
+ this._loginDialog.close();
264
+ } else {
265
+ resp.userChanged = this.loggedIn;
266
+ this.loggedIn = false;
267
+ this.password = null;
268
+ if (this._loginDialog.opened) {
269
+ this._invalid = true;
270
+ } else if (this.auto) {
271
+ this._loginDialog.open();
272
+ }
222
273
  }
274
+ this.emitTo('pb-login', resp);
223
275
 
224
- _confirmLogin() {
225
- this.user = this.shadowRoot.getElementById('user').value;
226
- this.password = this.shadowRoot.getElementById('password').value;
227
- this._checkLogin.body = {
228
- user: this.user,
229
- password: this.password
230
- };
231
- this._checkLogin.generateRequest();
276
+ if (this.loggedIn) {
277
+ registry.currentUser = {
278
+ user: this.user,
279
+ groups: this.groups,
280
+ };
281
+ } else {
282
+ registry.currentUser = null;
232
283
  }
284
+ }
233
285
 
234
- _handleResponse() {
235
- const resp = this._checkLogin.lastResponse;
236
- if (resp.user && this._checkGroup(resp)) {
237
- resp.userChanged = !this.loggedIn || this.user !== resp.user;
238
- this.loggedIn = true;
239
- this.user = resp.user;
240
- this.groups = resp.groups;
241
- this._invalid = false;
242
- this._loginDialog.close();
243
- } else {
244
- resp.userChanged = this.loggedIn;
245
- this.loggedIn = false;
246
- this.password = null;
247
- if (this._loginDialog.opened) {
248
- this._invalid = true;
249
- } else if (this.auto) {
250
- this._loginDialog.open();
251
- }
252
- }
253
- this.emitTo('pb-login', resp);
286
+ _handleError() {
287
+ this.loggedIn = false;
288
+ this.password = null;
254
289
 
255
- if (this.loggedIn) {
256
- registry.currentUser = {
257
- user: this.user,
258
- groups: this.groups
259
- }
260
- } else {
261
- registry.currentUser = null;
262
- }
290
+ const resp = {
291
+ userChanged: this.loggedIn,
292
+ user: null,
293
+ };
294
+ if (this._loginDialog.opened) {
295
+ this._invalid = true;
296
+ } else if (this.auto) {
297
+ this._loginDialog.open();
263
298
  }
264
299
 
265
- _handleError() {
266
- this.loggedIn = false;
267
- this.password = null;
268
-
269
- const resp = {
270
- userChanged: this.loggedIn,
271
- user: null
272
- };
273
- if (this._loginDialog.opened) {
274
- this._invalid = true;
275
- } else if (this.auto) {
276
- this._loginDialog.open();
277
- }
300
+ registry.currentUser = null;
301
+ this.emitTo('pb-login', resp);
302
+ }
278
303
 
279
- registry.currentUser = null;
280
- this.emitTo('pb-login', resp);
281
- }
304
+ /**
305
+ *
306
+ * @param {Array<String>} arr array containg string values (name of groups)
307
+ * @param {String} val value to check if it's in the array
308
+ * @returns true if the checked values is in the array
309
+ */
310
+ _isItemInArray(arr, val) {
311
+ return arr.some(arrVal => val === arrVal);
312
+ }
282
313
 
283
- /**
284
- *
285
- * @param {Array<String>} arr array containg string values (name of groups)
286
- * @param {String} val value to check if it's in the array
287
- * @returns true if the checked values is in the array
288
- */
289
- _isItemInArray(arr, val) {
290
- return arr.some((arrVal) => val === arrVal);
291
- }
292
-
293
- /**
294
- *
295
- * @param {object} info object returned by login function;
296
- * contains groups the user is a member of
297
- * @returns true if user is member of one of defined groups
298
- */
299
- _checkGroup(info) {
300
- if (this.group) {
301
- let groupArray = this.group.split(/[\s+,]+/);
302
- let exists = false;
303
- if(info.groups)
304
- groupArray.forEach(async (oneItem) => {
305
- exists = this._isItemInArray(info.groups, oneItem) || exists;
306
- });
307
- return exists;
308
- }
309
- return true;
314
+ /**
315
+ *
316
+ * @param {object} info object returned by login function;
317
+ * contains groups the user is a member of
318
+ * @returns true if user is member of one of defined groups
319
+ */
320
+ _checkGroup(info) {
321
+ if (this.group) {
322
+ const groupArray = this.group.split(/[\s+,]+/);
323
+ let exists = false;
324
+ if (info.groups)
325
+ groupArray.forEach(async oneItem => {
326
+ exists = this._isItemInArray(info.groups, oneItem) || exists;
327
+ });
328
+ return exists;
310
329
  }
330
+ return true;
331
+ }
311
332
 
312
- /**
313
- * Fired on successful login.
314
- *
315
- * @event pb-login
316
- * @param {String} user logged in user
317
- * @param {Array<String>} groups groups the user is a member of
318
- */
333
+ /**
334
+ * Fired on successful login.
335
+ *
336
+ * @event pb-login
337
+ * @param {String} user logged in user
338
+ * @param {Array<String>} groups groups the user is a member of
339
+ */
319
340
  }
320
341
  customElements.define('pb-login', PbLogin);