@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.
- 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 +2 -2
- package/CHANGELOG.md +262 -11
- package/Dockerfile +78 -70
- package/css/components.css +5 -5
- package/css/leaflet/images/layers.png +0 -0
- package/dist/demo/components.css +46 -1
- package/dist/demo/pb-browse-docs2.html +1 -1
- package/dist/demo/pb-dialog.html +3 -5
- package/dist/demo/pb-drawer2.html +1 -1
- package/dist/demo/pb-facsimile.html +2 -2
- package/dist/demo/pb-grid.html +19 -6
- package/dist/demo/pb-leaflet-map.html +1 -1
- package/dist/demo/pb-login.html +0 -2
- package/dist/demo/pb-message.html +1 -2
- package/dist/demo/pb-progress.html +2 -2
- package/dist/demo/pb-repeat.html +1 -3
- package/dist/demo/pb-search.html +7 -4
- package/dist/demo/pb-search3.html +1 -1
- package/dist/demo/pb-search4.html +2 -2
- package/dist/demo/pb-view3.html +1 -1
- package/dist/{iron-form-3b8dcaa7.js → iron-form-dfb3e3b1.js} +95 -95
- package/dist/paper-checkbox-645e1077.js +200 -0
- package/dist/{paper-icon-button-b1d31571.js → paper-icon-button-984162bd.js} +1 -1
- package/dist/{paper-checkbox-515a5284.js → paper-inky-focus-behavior-fa16796b.js} +58 -247
- package/dist/{paper-listbox-a3b7175c.js → paper-listbox-5f5d1cec.js} +152 -162
- package/dist/pb-code-editor.js +25 -20
- package/dist/pb-component-docs.js +68 -64
- package/dist/pb-components-bundle.js +1983 -2293
- package/dist/pb-edit-app.js +167 -107
- package/dist/pb-elements.json +176 -120
- 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 +1023 -782
- package/dist/pb-tify.js +2 -2
- package/dist/vaadin-element-mixin-beb74ffd.js +545 -0
- package/gh-pages.js +5 -3
- package/i18n/common/en.json +6 -0
- package/i18n/common/pl.json +2 -2
- package/lib/openseadragon.min.js +6 -6
- package/package.json +3 -3
- package/pb-elements.json +176 -120
- 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 +50 -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 +158 -171
- package/src/pb-authority-lookup.js +191 -156
- 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 +211 -151
- package/src/pb-combo-box.js +190 -190
- package/src/pb-components-bundle.js +1 -1
- package/src/pb-components.js +1 -0
- package/src/pb-custom-form.js +173 -153
- package/src/pb-dialog.js +98 -62
- package/src/pb-document.js +89 -90
- package/src/pb-download.js +212 -196
- package/src/pb-drawer.js +145 -148
- package/src/pb-edit-app.js +301 -229
- package/src/pb-edit-xml.js +100 -97
- package/src/pb-events.js +114 -107
- package/src/pb-facs-link.js +104 -102
- package/src/pb-facsimile.js +474 -410
- 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 +142 -57
- package/src/pb-leaflet-map.js +488 -485
- package/src/pb-link.js +126 -124
- package/src/pb-load.js +431 -429
- package/src/pb-login.js +299 -244
- package/src/pb-manage-odds.js +352 -336
- 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 +139 -97
- package/src/pb-mixin.js +269 -264
- package/src/pb-navigation.js +80 -95
- package/src/pb-observable.js +38 -38
- package/src/pb-odd-editor.js +1054 -958
- package/src/pb-odd-elementspec-editor.js +349 -298
- package/src/pb-odd-model-editor.js +1075 -909
- package/src/pb-odd-parameter-editor.js +200 -178
- package/src/pb-odd-rendition-editor.js +136 -124
- package/src/pb-page.js +431 -422
- package/src/pb-paginate.js +228 -179
- package/src/pb-panel.js +198 -182
- package/src/pb-popover-themes.js +15 -8
- package/src/pb-popover.js +296 -287
- package/src/pb-print-preview.js +127 -127
- package/src/pb-progress.js +51 -51
- package/src/pb-repeat.js +105 -104
- package/src/pb-restricted.js +84 -77
- package/src/pb-search.js +256 -228
- 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 +382 -249
- package/src/pb-toggle-feature.js +195 -187
- package/src/pb-upload.js +184 -174
- package/src/pb-version.js +30 -30
- package/src/pb-view-annotate.js +135 -98
- package/src/pb-view.js +1282 -1270
- package/src/pb-zoom.js +127 -45
- 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 +98 -91
- package/src/urls.js +289 -289
- package/src/utils.js +53 -51
- package/css/pb-styles.css +0 -51
- package/dist/vaadin-element-mixin-fe4a4883.js +0 -527
- package/src/assets/pb-styles.css +0 -51
- package/src/pb-light-dom.js +0 -41
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
// names
|
|
70
70
|
pbEvents.subscribe('pb-update', 'transcription', (ev) => {
|
|
71
71
|
// the HTML content to be displayed is passed in ev.detail.root
|
|
72
|
-
const root = ev.detail
|
|
72
|
+
const {root} = ev.detail;
|
|
73
73
|
root.querySelectorAll('.tei-persName5, .tei-placeName5').forEach((name) => {
|
|
74
74
|
// disable the popover behaviour
|
|
75
75
|
name.command('disable', true);
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
facsimiles='["15929_000_IDL5772_BOss12034_IIIp79.jpg", "15929_000_IDL5772_BOss12034_IIIp80.jpg", "15929_000_IDL5772_BOss12034_IIIp81.jpg", "15929_000_IDL5772_BOss12034_IIIp82.jpg",
|
|
45
45
|
"does-not-exist.jpg"]'
|
|
46
46
|
default-zoom-level="0" show-navigator show-sequence-control reference-strip
|
|
47
|
-
show-navigation-control show-home-control show-rotation-control>
|
|
47
|
+
show-navigation-control show-home-control show-rotation-control show-full-page-control>
|
|
48
48
|
<h3 slot="before">Facsimile Viewer Test</h3>
|
|
49
49
|
<div slot="after">Status: <span id="status"></span></div>
|
|
50
50
|
</pb-facsimile>
|
|
@@ -90,4 +90,4 @@
|
|
|
90
90
|
</pb-demo-snippet>
|
|
91
91
|
</body>
|
|
92
92
|
|
|
93
|
-
</html>
|
|
93
|
+
</html>
|
package/dist/demo/pb-grid.html
CHANGED
|
@@ -5,6 +5,16 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes" />
|
|
6
6
|
|
|
7
7
|
<title>pb-grid Demo</title>
|
|
8
|
+
<style>
|
|
9
|
+
svg {
|
|
10
|
+
width: 1rem;
|
|
11
|
+
height: 1rem;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pb-grid-action {
|
|
15
|
+
margin-bottom: 1rem;
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
8
18
|
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script><script type="module" src="../pb-components-bundle.js"></script>
|
|
9
19
|
</head>
|
|
10
20
|
|
|
@@ -15,9 +25,7 @@
|
|
|
15
25
|
<pb-document id="document1" path="test/orlik_to_serafin.xml" odd="serafin" view="single"></pb-document>
|
|
16
26
|
|
|
17
27
|
<pb-grid-action action="add" class="grid-add" grid="#grid" initial="1">
|
|
18
|
-
<
|
|
19
|
-
<iron-icon icon="icons:add"></iron-icon> Add Column
|
|
20
|
-
</paper-button>
|
|
28
|
+
<button>Add Column</button>
|
|
21
29
|
</pb-grid-action>
|
|
22
30
|
<!-- Define the grid with one initial column -->
|
|
23
31
|
<pb-grid id="grid" panels="[0,1]" subscribe="transcription" animation="true">
|
|
@@ -25,9 +33,14 @@
|
|
|
25
33
|
<template>
|
|
26
34
|
<pb-panel emit="transcription">
|
|
27
35
|
<!-- Added to the toolbar -->
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
|
|
36
|
+
<li slot="toolbar">
|
|
37
|
+
<pb-grid-action grid="#grid" action="remove">
|
|
38
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512">
|
|
39
|
+
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"
|
|
40
|
+
d="M368 368L144 144M368 144L144 368" />
|
|
41
|
+
</svg>
|
|
42
|
+
</pb-grid-action>
|
|
43
|
+
</li>
|
|
31
44
|
<template title="Transcription">
|
|
32
45
|
<pb-view class="animated" src="document1"
|
|
33
46
|
xpath="! (.//text[@xml:lang = 'la']/body | .//text/body)[1]" emit="transcription">
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
* which does itself send the `pb-update` event, e.g. `pb-view`.
|
|
58
58
|
*/
|
|
59
59
|
document.addEventListener('WebComponentsReady', () => {
|
|
60
|
-
pbEvents.subscribe('pb-ready', null,
|
|
60
|
+
pbEvents.subscribe('pb-ready', null, () => {
|
|
61
61
|
document.dispatchEvent(new CustomEvent('pb-update', {
|
|
62
62
|
detail: {
|
|
63
63
|
root: document.getElementById('locations')
|
package/dist/demo/pb-login.html
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes"/>
|
|
5
5
|
|
|
6
6
|
<title>pb-login Demo</title>
|
|
7
|
-
<link rel="stylesheet" href="../css/pb-styles.css">
|
|
8
7
|
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script><script type="module" src="../pb-components-bundle.js"></script>
|
|
9
8
|
</head>
|
|
10
9
|
|
|
@@ -24,7 +23,6 @@
|
|
|
24
23
|
|
|
25
24
|
<main>
|
|
26
25
|
<pb-login id="loginElem">
|
|
27
|
-
|
|
28
26
|
<p slot="information">Please log in with your eXist-db credentials.</p>
|
|
29
27
|
</pb-login>
|
|
30
28
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes"/>
|
|
5
5
|
|
|
6
6
|
<title>pb-message Demo</title>
|
|
7
|
-
<link rel="stylesheet" href="../css/pb-styles.css">
|
|
8
7
|
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script><script type="module" src="../pb-components-bundle.js"></script>
|
|
9
8
|
</head>
|
|
10
9
|
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
}
|
|
34
33
|
function confirm() {
|
|
35
34
|
document.getElementById('msg')
|
|
36
|
-
.confirm(
|
|
35
|
+
.confirm("a confirmation message", 'confirm?')
|
|
37
36
|
.then(
|
|
38
37
|
() => { document.getElementById('output').innerHTML = 'Confirmed!'; },
|
|
39
38
|
() => { document.getElementById('output').innerHTML = 'Dismissed!'; }
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
if (started) {
|
|
33
33
|
started = false;
|
|
34
34
|
btn.innerHTML = 'Click to start';
|
|
35
|
-
|
|
35
|
+
pbEvents.emit('pb-end-update');
|
|
36
36
|
} else {
|
|
37
37
|
started = true;
|
|
38
38
|
btn.innerHTML = 'Click to stop';
|
|
39
|
-
|
|
39
|
+
pbEvents.emit('pb-start-update');
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
</script>
|
package/dist/demo/pb-repeat.html
CHANGED
|
@@ -49,9 +49,7 @@
|
|
|
49
49
|
form.addEventListener('iron-form-presubmit', (ev) => {
|
|
50
50
|
ev.preventDefault();
|
|
51
51
|
const data = form.serializeForm();
|
|
52
|
-
const queryString = Object.keys(data).map((key) => {
|
|
53
|
-
return key + '=' + data[key]
|
|
54
|
-
}).join('&');
|
|
52
|
+
const queryString = Object.keys(data).map((key) => `${key }=${ data[key]}`).join('&');
|
|
55
53
|
document.getElementById('output').innerText = queryString;
|
|
56
54
|
});
|
|
57
55
|
});
|
package/dist/demo/pb-search.html
CHANGED
|
@@ -47,12 +47,15 @@
|
|
|
47
47
|
<main>
|
|
48
48
|
<pb-search id="search-form">
|
|
49
49
|
<div class="targets">
|
|
50
|
-
<
|
|
51
|
-
<
|
|
50
|
+
<input id="tei-text" type="checkbox" name="tei-target" value="tei-text">
|
|
51
|
+
<label for="tei-text"><pb-i18n key="search.sections">Search sections</pb-i18n></label>
|
|
52
|
+
|
|
53
|
+
<input id="tei-head" type="checkbox" name="tei-target" value="tei-head">
|
|
54
|
+
<label for="tei-head"><pb-i18n key="search.headings">Search headings</pb-i18n></label>
|
|
52
55
|
</div>
|
|
53
56
|
<div class="buttons">
|
|
54
|
-
<
|
|
55
|
-
<
|
|
57
|
+
<button slot="searchButton"><pb-i18n key="search.search"></pb-i18n></button>
|
|
58
|
+
<button slot="resetButton"><pb-i18n key="search.reset"></pb-i18n></button>
|
|
56
59
|
</div>
|
|
57
60
|
</pb-search>
|
|
58
61
|
<pb-paginate per-page="10" range="5"></pb-paginate>
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
<h2>multi-select</h2>
|
|
51
51
|
<pb-custom-form id="custom-form">
|
|
52
52
|
<input type="text" name="custom">
|
|
53
|
-
<button type="submit" slot="
|
|
53
|
+
<button type="submit" slot="searchButtonBottom">Submit</button>
|
|
54
54
|
<button type="reset" slot="resetButton">Reset</button>
|
|
55
55
|
</pb-custom-form>
|
|
56
56
|
<pb-search id="search-form" subforms="pb-custom-form"></pb-search>
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
<h2>paper buttons for search + reset</h2>
|
|
25
25
|
|
|
26
26
|
<pb-search id="search-form">
|
|
27
|
-
<
|
|
28
|
-
<
|
|
27
|
+
<button slot="searchButton">submit</button>
|
|
28
|
+
<button slot="resetButton">reset</button>
|
|
29
29
|
</pb-search>
|
|
30
30
|
|
|
31
31
|
<h2>native buttons for search + reset</h2>
|
package/dist/demo/pb-view3.html
CHANGED
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
<script>
|
|
66
66
|
window.addEventListener('DOMContentLoaded', () => {
|
|
67
67
|
pbEvents.subscribe('before-transcription-update', 'transcription', (ev) => {
|
|
68
|
-
const root = ev.detail
|
|
68
|
+
const {root} = ev.detail;
|
|
69
69
|
// walk through all .tei-name elements and insert a node before each
|
|
70
70
|
root.querySelectorAll('.tei-name').forEach((name) => {
|
|
71
71
|
// create a span with text 'Name' and orange color
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as e,a as t,I as i,b as s,h as o,P as a,d as n}from"./paper-inky-focus-behavior-fa16796b.js";import{f as r,N as l}from"./paper-listbox-5f5d1cec.js";
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -8,97 +8,7 @@ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
|
8
8
|
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
9
9
|
part of the polymer project is also subject to an additional IP rights grant
|
|
10
10
|
found at http://polymer.github.io/PATENTS.txt
|
|
11
|
-
*/const h={properties:{elevation:{type:Number,reflectToAttribute:!0,readOnly:!0}},observers:["_calculateElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)","_computeKeyboardClass(receivedFocusFromKeyboard)"],hostAttributes:{role:"button",tabindex:"0",animated:!0},_calculateElevation:function(){var e=1;this.disabled?e=0:this.active||this.pressed?e=4:this.receivedFocusFromKeyboard&&(e=3),this._setElevation(e)},_computeKeyboardClass:function(e){this.toggleClass("keyboard-focus",e)},_spaceKeyDownHandler:function(t){e._spaceKeyDownHandler.call(this,t),this.hasRipple()&&this.getRipple().ripples.length<1&&this._ripple.uiDownAction()},_spaceKeyUpHandler:function(t){e._spaceKeyUpHandler.call(this,t),this.hasRipple()&&this._ripple.uiUpAction()}},d=[t,i,s,h],p=
|
|
12
|
-
/**
|
|
13
|
-
@license
|
|
14
|
-
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
15
|
-
This code may only be used under the BSD style license found at
|
|
16
|
-
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
|
17
|
-
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
18
|
-
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
19
|
-
part of the polymer project is also subject to an additional IP rights grant
|
|
20
|
-
found at http://polymer.github.io/PATENTS.txt
|
|
21
|
-
*/
|
|
22
|
-
const c={hostAttributes:{role:"dialog",tabindex:"-1"},properties:{modal:{type:Boolean,value:!1},__readied:{type:Boolean,value:!1}},observers:["_modalChanged(modal, __readied)"],listeners:{tap:"_onDialogClick"},ready:function(){this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.__readied=!0},_modalChanged:function(e,t){t&&(e?(this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.noCancelOnOutsideClick=!0,this.noCancelOnEscKey=!0,this.withBackdrop=!0):(this.noCancelOnOutsideClick=this.noCancelOnOutsideClick&&this.__prevNoCancelOnOutsideClick,this.noCancelOnEscKey=this.noCancelOnEscKey&&this.__prevNoCancelOnEscKey,this.withBackdrop=this.withBackdrop&&this.__prevWithBackdrop))},_updateClosingReasonConfirmed:function(e){this.closingReason=this.closingReason||{},this.closingReason.confirmed=e},_onDialogClick:function(e){for(var t=o(e).path,i=0,s=t.indexOf(this);i<s;i++){var a=t[i];if(a.hasAttribute&&(a.hasAttribute("dialog-dismiss")||a.hasAttribute("dialog-confirm"))){this._updateClosingReasonConfirmed(a.hasAttribute("dialog-confirm")),this.close(),e.stopPropagation();break}}}};
|
|
23
|
-
/**
|
|
24
|
-
@license
|
|
25
|
-
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
26
|
-
This code may only be used under the BSD style license found at
|
|
27
|
-
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
|
28
|
-
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
29
|
-
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
30
|
-
part of the polymer project is also subject to an additional IP rights grant
|
|
31
|
-
found at http://polymer.github.io/PATENTS.txt
|
|
32
|
-
*/
|
|
33
|
-
a({_template:n`
|
|
34
|
-
<style include="paper-dialog-shared-styles"></style>
|
|
35
|
-
<slot></slot>
|
|
36
|
-
`,is:"paper-dialog",behaviors:[[r,c],l],listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},_renderOpened:function(){this.cancelAnimation(),this.playAnimation("entry")},_renderClosed:function(){this.cancelAnimation(),this.playAnimation("exit")},_onNeonAnimationFinish:function(){this.opened?this._finishRenderOpened():this._finishRenderClosed()}}),
|
|
37
|
-
/**
|
|
38
|
-
@license
|
|
39
|
-
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
40
|
-
This code may only be used under the BSD style license found at
|
|
41
|
-
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
|
42
|
-
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
43
|
-
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
44
|
-
part of the polymer project is also subject to an additional IP rights grant
|
|
45
|
-
found at http://polymer.github.io/PATENTS.txt
|
|
46
|
-
*/
|
|
47
|
-
a({_template:n`
|
|
48
|
-
<style>
|
|
49
|
-
|
|
50
|
-
:host {
|
|
51
|
-
display: block;
|
|
52
|
-
@apply --layout-relative;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
:host(.is-scrolled:not(:first-child))::before {
|
|
56
|
-
content: '';
|
|
57
|
-
position: absolute;
|
|
58
|
-
top: 0;
|
|
59
|
-
left: 0;
|
|
60
|
-
right: 0;
|
|
61
|
-
height: 1px;
|
|
62
|
-
background: var(--divider-color);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
:host(.can-scroll:not(.scrolled-to-bottom):not(:last-child))::after {
|
|
66
|
-
content: '';
|
|
67
|
-
position: absolute;
|
|
68
|
-
bottom: 0;
|
|
69
|
-
left: 0;
|
|
70
|
-
right: 0;
|
|
71
|
-
height: 1px;
|
|
72
|
-
background: var(--divider-color);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.scrollable {
|
|
76
|
-
padding: 0 24px;
|
|
77
|
-
|
|
78
|
-
@apply --layout-scroll;
|
|
79
|
-
@apply --paper-dialog-scrollable;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.fit {
|
|
83
|
-
@apply --layout-fit;
|
|
84
|
-
}
|
|
85
|
-
</style>
|
|
86
|
-
|
|
87
|
-
<div id="scrollable" class="scrollable" on-scroll="updateScrollState">
|
|
88
|
-
<slot></slot>
|
|
89
|
-
</div>
|
|
90
|
-
`,is:"paper-dialog-scrollable",properties:{dialogElement:{type:Object}},get scrollTarget(){return this.$.scrollable},ready:function(){this._ensureTarget(),this.classList.add("no-padding")},attached:function(){this._ensureTarget(),requestAnimationFrame(this.updateScrollState.bind(this))},updateScrollState:function(){this.toggleClass("is-scrolled",this.scrollTarget.scrollTop>0),this.toggleClass("can-scroll",this.scrollTarget.offsetHeight<this.scrollTarget.scrollHeight),this.toggleClass("scrolled-to-bottom",this.scrollTarget.scrollTop+this.scrollTarget.offsetHeight>=this.scrollTarget.scrollHeight)},_ensureTarget:function(){this.dialogElement=this.dialogElement||this.parentElement,this.dialogElement&&this.dialogElement.behaviors&&this.dialogElement.behaviors.indexOf(c)>=0?(this.dialogElement.sizingTarget=this.scrollTarget,this.scrollTarget.classList.remove("fit")):this.dialogElement&&this.scrollTarget.classList.add("fit")}});
|
|
91
|
-
/**
|
|
92
|
-
@license
|
|
93
|
-
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
94
|
-
This code may only be used under the BSD style license found at
|
|
95
|
-
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
|
96
|
-
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
97
|
-
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
98
|
-
part of the polymer project is also subject to an additional IP rights grant
|
|
99
|
-
found at http://polymer.github.io/PATENTS.txt
|
|
100
|
-
*/
|
|
101
|
-
const u=n`
|
|
11
|
+
*/const h={properties:{elevation:{type:Number,reflectToAttribute:!0,readOnly:!0}},observers:["_calculateElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)","_computeKeyboardClass(receivedFocusFromKeyboard)"],hostAttributes:{role:"button",tabindex:"0",animated:!0},_calculateElevation:function(){var e=1;this.disabled?e=0:this.active||this.pressed?e=4:this.receivedFocusFromKeyboard&&(e=3),this._setElevation(e)},_computeKeyboardClass:function(e){this.toggleClass("keyboard-focus",e)},_spaceKeyDownHandler:function(t){e._spaceKeyDownHandler.call(this,t),this.hasRipple()&&this.getRipple().ripples.length<1&&this._ripple.uiDownAction()},_spaceKeyUpHandler:function(t){e._spaceKeyUpHandler.call(this,t),this.hasRipple()&&this._ripple.uiUpAction()}},d=[t,i,s,h],p=o`
|
|
102
12
|
<style include="paper-material-styles">
|
|
103
13
|
/* Need to specify the same specificity as the styles imported from paper-material. */
|
|
104
14
|
:host {
|
|
@@ -184,7 +94,97 @@ const u=n`
|
|
|
184
94
|
}
|
|
185
95
|
</style>
|
|
186
96
|
|
|
187
|
-
<slot></slot>`;
|
|
97
|
+
<slot></slot>`;p.setAttribute("strip-whitespace",""),a({_template:p,is:"paper-button",behaviors:[d],properties:{raised:{type:Boolean,reflectToAttribute:!0,value:!1,observer:"_calculateElevation"}},_calculateElevation:function(){this.raised?h._calculateElevation.apply(this):this._setElevation(0)}});
|
|
98
|
+
/**
|
|
99
|
+
@license
|
|
100
|
+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
101
|
+
This code may only be used under the BSD style license found at
|
|
102
|
+
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
|
103
|
+
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
104
|
+
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
105
|
+
part of the polymer project is also subject to an additional IP rights grant
|
|
106
|
+
found at http://polymer.github.io/PATENTS.txt
|
|
107
|
+
*/
|
|
108
|
+
const c=document.createElement("template");c.setAttribute("style","display: none;"),c.innerHTML='<dom-module id="paper-dialog-shared-styles">\n <template>\n <style>\n :host {\n display: block;\n margin: 24px 40px;\n\n background: var(--paper-dialog-background-color, var(--primary-background-color));\n color: var(--paper-dialog-color, var(--primary-text-color));\n\n @apply --paper-font-body1;\n @apply --shadow-elevation-16dp;\n @apply --paper-dialog;\n }\n\n :host > ::slotted(*) {\n margin-top: 20px;\n padding: 0 24px;\n }\n\n :host > ::slotted(.no-padding) {\n padding: 0;\n }\n\n \n :host > ::slotted(*:first-child) {\n margin-top: 24px;\n }\n\n :host > ::slotted(*:last-child) {\n margin-bottom: 24px;\n }\n\n /* In 1.x, this selector was `:host > ::content h2`. In 2.x <slot> allows\n to select direct children only, which increases the weight of this\n selector, so we have to re-define first-child/last-child margins below. */\n :host > ::slotted(h2) {\n position: relative;\n margin: 0;\n\n @apply --paper-font-title;\n @apply --paper-dialog-title;\n }\n\n /* Apply mixin again, in case it sets margin-top. */\n :host > ::slotted(h2:first-child) {\n margin-top: 24px;\n @apply --paper-dialog-title;\n }\n\n /* Apply mixin again, in case it sets margin-bottom. */\n :host > ::slotted(h2:last-child) {\n margin-bottom: 24px;\n @apply --paper-dialog-title;\n }\n\n :host > ::slotted(.paper-dialog-buttons),\n :host > ::slotted(.buttons) {\n position: relative;\n padding: 8px 8px 8px 24px;\n margin: 0;\n\n color: var(--paper-dialog-button-color, var(--primary-color));\n\n @apply --layout-horizontal;\n @apply --layout-end-justified;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(c.content);
|
|
109
|
+
/**
|
|
110
|
+
@license
|
|
111
|
+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
112
|
+
This code may only be used under the BSD style license found at
|
|
113
|
+
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
|
114
|
+
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
115
|
+
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
116
|
+
part of the polymer project is also subject to an additional IP rights grant
|
|
117
|
+
found at http://polymer.github.io/PATENTS.txt
|
|
118
|
+
*/
|
|
119
|
+
const u={hostAttributes:{role:"dialog",tabindex:"-1"},properties:{modal:{type:Boolean,value:!1},__readied:{type:Boolean,value:!1}},observers:["_modalChanged(modal, __readied)"],listeners:{tap:"_onDialogClick"},ready:function(){this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.__readied=!0},_modalChanged:function(e,t){t&&(e?(this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.noCancelOnOutsideClick=!0,this.noCancelOnEscKey=!0,this.withBackdrop=!0):(this.noCancelOnOutsideClick=this.noCancelOnOutsideClick&&this.__prevNoCancelOnOutsideClick,this.noCancelOnEscKey=this.noCancelOnEscKey&&this.__prevNoCancelOnEscKey,this.withBackdrop=this.withBackdrop&&this.__prevWithBackdrop))},_updateClosingReasonConfirmed:function(e){this.closingReason=this.closingReason||{},this.closingReason.confirmed=e},_onDialogClick:function(e){for(var t=n(e).path,i=0,s=t.indexOf(this);i<s;i++){var o=t[i];if(o.hasAttribute&&(o.hasAttribute("dialog-dismiss")||o.hasAttribute("dialog-confirm"))){this._updateClosingReasonConfirmed(o.hasAttribute("dialog-confirm")),this.close(),e.stopPropagation();break}}}};
|
|
120
|
+
/**
|
|
121
|
+
@license
|
|
122
|
+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
123
|
+
This code may only be used under the BSD style license found at
|
|
124
|
+
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
|
125
|
+
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
126
|
+
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
127
|
+
part of the polymer project is also subject to an additional IP rights grant
|
|
128
|
+
found at http://polymer.github.io/PATENTS.txt
|
|
129
|
+
*/
|
|
130
|
+
a({_template:o`
|
|
131
|
+
<style include="paper-dialog-shared-styles"></style>
|
|
132
|
+
<slot></slot>
|
|
133
|
+
`,is:"paper-dialog",behaviors:[[r,u],l],listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},_renderOpened:function(){this.cancelAnimation(),this.playAnimation("entry")},_renderClosed:function(){this.cancelAnimation(),this.playAnimation("exit")},_onNeonAnimationFinish:function(){this.opened?this._finishRenderOpened():this._finishRenderClosed()}}),
|
|
134
|
+
/**
|
|
135
|
+
@license
|
|
136
|
+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
137
|
+
This code may only be used under the BSD style license found at
|
|
138
|
+
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
|
139
|
+
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
140
|
+
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
141
|
+
part of the polymer project is also subject to an additional IP rights grant
|
|
142
|
+
found at http://polymer.github.io/PATENTS.txt
|
|
143
|
+
*/
|
|
144
|
+
a({_template:o`
|
|
145
|
+
<style>
|
|
146
|
+
|
|
147
|
+
:host {
|
|
148
|
+
display: block;
|
|
149
|
+
@apply --layout-relative;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:host(.is-scrolled:not(:first-child))::before {
|
|
153
|
+
content: '';
|
|
154
|
+
position: absolute;
|
|
155
|
+
top: 0;
|
|
156
|
+
left: 0;
|
|
157
|
+
right: 0;
|
|
158
|
+
height: 1px;
|
|
159
|
+
background: var(--divider-color);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
:host(.can-scroll:not(.scrolled-to-bottom):not(:last-child))::after {
|
|
163
|
+
content: '';
|
|
164
|
+
position: absolute;
|
|
165
|
+
bottom: 0;
|
|
166
|
+
left: 0;
|
|
167
|
+
right: 0;
|
|
168
|
+
height: 1px;
|
|
169
|
+
background: var(--divider-color);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.scrollable {
|
|
173
|
+
padding: 0 24px;
|
|
174
|
+
|
|
175
|
+
@apply --layout-scroll;
|
|
176
|
+
@apply --paper-dialog-scrollable;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.fit {
|
|
180
|
+
@apply --layout-fit;
|
|
181
|
+
}
|
|
182
|
+
</style>
|
|
183
|
+
|
|
184
|
+
<div id="scrollable" class="scrollable" on-scroll="updateScrollState">
|
|
185
|
+
<slot></slot>
|
|
186
|
+
</div>
|
|
187
|
+
`,is:"paper-dialog-scrollable",properties:{dialogElement:{type:Object}},get scrollTarget(){return this.$.scrollable},ready:function(){this._ensureTarget(),this.classList.add("no-padding")},attached:function(){this._ensureTarget(),requestAnimationFrame(this.updateScrollState.bind(this))},updateScrollState:function(){this.toggleClass("is-scrolled",this.scrollTarget.scrollTop>0),this.toggleClass("can-scroll",this.scrollTarget.offsetHeight<this.scrollTarget.scrollHeight),this.toggleClass("scrolled-to-bottom",this.scrollTarget.scrollTop+this.scrollTarget.offsetHeight>=this.scrollTarget.scrollHeight)},_ensureTarget:function(){this.dialogElement=this.dialogElement||this.parentElement,this.dialogElement&&this.dialogElement.behaviors&&this.dialogElement.behaviors.indexOf(u)>=0?(this.dialogElement.sizingTarget=this.scrollTarget,this.scrollTarget.classList.remove("fit")):this.dialogElement&&this.scrollTarget.classList.add("fit")}}),
|
|
188
188
|
/**
|
|
189
189
|
@license
|
|
190
190
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
|
@@ -195,7 +195,7 @@ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
|
195
195
|
part of the polymer project is also subject to an additional IP rights grant
|
|
196
196
|
found at http://polymer.github.io/PATENTS.txt
|
|
197
197
|
*/
|
|
198
|
-
a({_template:
|
|
198
|
+
a({_template:o`
|
|
199
199
|
<style>
|
|
200
200
|
:host {
|
|
201
201
|
display: block;
|
|
@@ -207,4 +207,4 @@ a({_template:n`
|
|
|
207
207
|
|
|
208
208
|
<!-- This form is used for submission -->
|
|
209
209
|
<form id="helper" action\$="[[action]]" method\$="[[method]]" enctype\$="[[enctype]]"></form>
|
|
210
|
-
`,is:"iron-form",properties:{allowRedirect:{type:Boolean,value:!1},headers:{type:Object,value:function(){return{}}},withCredentials:{type:Boolean,value:!1}},attached:function(){this._form||(this._form=
|
|
210
|
+
`,is:"iron-form",properties:{allowRedirect:{type:Boolean,value:!1},headers:{type:Object,value:function(){return{}}},withCredentials:{type:Boolean,value:!1}},attached:function(){this._form||(this._form=n(this).querySelector("form"),this._form?(this._init(),this.async(this._saveInitialValues.bind(this),1)):this._nodeObserver=n(this).observeNodes(function(e){for(var t=0;t<e.addedNodes.length;t++)"FORM"===e.addedNodes[t].tagName&&(this._form=e.addedNodes[t],this._init(),n(this).unobserveNodes(this._nodeObserver),this._nodeObserver=null)}.bind(this)))},detached:function(){this._nodeObserver&&(n(this).unobserveNodes(this._nodeObserver),this._nodeObserver=null)},_init:function(){this._form.addEventListener("submit",this.submit.bind(this)),this._form.addEventListener("reset",this.reset.bind(this)),this._defaults=this._defaults||new WeakMap,this._saveInitialValues()},saveResetValues:function(){this._saveInitialValues(!0)},_saveInitialValues:function(e){for(var t=this._getValidatableElements(),i=0;i<t.length;i++){var s=t[i];if(!this._defaults.has(s)||e){var o={value:s.value};"checked"in s&&(o.checked=s.checked),"invalid"in s&&(o.invalid=s.invalid),this._defaults.set(s,o)}}},validate:function(){if(!this._form)return!1;if(""===this._form.getAttribute("novalidate"))return!0;for(var e,t=this._form.checkValidity(),i=this._getValidatableElements(),s=0;e=i[s],s<i.length;s++){var o=e;o.validate&&(t=!!o.validate()&&t)}return t},submit:function(e){if(e&&e.preventDefault(),this._form)if(this.validate()){this.$.helper.textContent="";var t=this.serializeForm();if(this.allowRedirect){for(var i in t)this.$.helper.appendChild(this._createHiddenElement(i,t[i]));this.$.helper.action=this._form.getAttribute("action"),this.$.helper.method=this._form.getAttribute("method")||"GET",this.$.helper.contentType=this._form.getAttribute("enctype")||"application/x-www-form-urlencoded",this.$.helper.submit(),this.fire("iron-form-submit")}else this._makeAjaxRequest(t)}else this.fire("iron-form-invalid")},reset:function(e){if(e&&e.preventDefault(),this._form)if(e&&"reset"===e.type&&e.target===this._form){for(var t=this._getValidatableElements(),i=0;i<t.length;i++){var s=t[i];if(this._defaults.has(s)){var o=this._defaults.get(s);for(var a in o)s[a]=o[a]}}this.fire("iron-form-reset")}else this._form.reset()},serializeForm:function(){for(var e=this._getSubmittableElements(),t={},i=0;i<e.length;i++)for(var s=this._serializeElementValues(e[i]),o=0;o<s.length;o++)this._addSerializedElement(t,e[i].name,s[o]);return t},_handleFormResponse:function(e){this.fire("iron-form-response",e.detail)},_handleFormError:function(e){this.fire("iron-form-error",e.detail)},_makeAjaxRequest:function(e){this.request||(this.request=document.createElement("iron-ajax"),this.request.addEventListener("response",this._handleFormResponse.bind(this)),this.request.addEventListener("error",this._handleFormError.bind(this))),this.request.url=this._form.getAttribute("action"),this.request.method=this._form.getAttribute("method")||"GET",this.request.contentType=this._form.getAttribute("enctype")||"application/x-www-form-urlencoded",this.request.withCredentials=this.withCredentials,this.request.headers=this.headers,"POST"===this._form.method.toUpperCase()?this.request.body=e:this.request.params=e,this.fire("iron-form-presubmit",{},{cancelable:!0}).defaultPrevented||(this.request.generateRequest(),this.fire("iron-form-submit",e))},_getValidatableElements:function(){return this._findElements(this._form,!0,!1)},_getSubmittableElements:function(){return this._findElements(this._form,!1,!1)},_findElements:function(e,t,i,s){s=s||[];for(var o=n(e).querySelectorAll("*"),a=0;a<o.length;a++)i||"slot"!==o[a].localName&&"content"!==o[a].localName?this._searchSubmittable(s,o[a],t):this._searchSubmittableInSlot(s,o[a],t);return s},_searchSubmittableInSlot:function(e,t,i){for(var s=n(t).getDistributedNodes(),o=0;o<s.length;o++)if(s[o].nodeType!==Node.TEXT_NODE){this._searchSubmittable(e,s[o],i);for(var a=n(s[o]).querySelectorAll("*"),r=0;r<a.length;r++)this._searchSubmittable(e,a[r],i)}},_searchSubmittable:function(e,t,i){this._isSubmittable(t,i)?e.push(t):t.root&&this._findElements(t.root,i,!0,e)},_isSubmittable:function(e,t){return!e.disabled&&(t?e.name||"function"==typeof e.validate:e.name)},_serializeElementValues:function(e){var t=e.tagName.toLowerCase();return"button"===t||"input"===t&&("submit"===e.type||"reset"===e.type)?[]:"select"===t?this._serializeSelectValues(e):"input"===t?this._serializeInputValues(e):e._hasIronCheckedElementBehavior&&!e.checked?[]:[e.value]},_serializeSelectValues:function(e){for(var t=[],i=0;i<e.options.length;i++)e.options[i].selected&&t.push(e.options[i].value);return t},_serializeInputValues:function(e){var t=e.type.toLowerCase();return("checkbox"!==t&&"radio"!==t||e.checked)&&"file"!==t?[e.value]:[]},_createHiddenElement:function(e,t){var i=document.createElement("input");return i.setAttribute("type","hidden"),i.setAttribute("name",e),i.setAttribute("value",t),i},_addSerializedElement:function(e,t,i){void 0===e[t]?e[t]=i:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(i))}});export{d as P};
|