@luftborn/custom-elements 2.1.0 → 2.1.1
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/demo/index.js +229 -275
- package/demo/index.min.js +228 -274
- package/demo/index.min.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/CHANGELOG.md +0 -15
- package/node_modules/@webcomponents/webcomponentsjs/README.md +0 -13
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-ce.js +31 -31
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-ce.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-pf_dom.js +13 -15
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-pf_dom.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-pf_js.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js +223 -237
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce.js +176 -188
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd.js +144 -155
- package/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/package.json +8 -7
- package/node_modules/@webcomponents/webcomponentsjs/src/entrypoints/webcomponents-pf_dom-index.js +0 -2
- package/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.d.ts +0 -1
- package/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js +225 -239
- package/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js.map +1 -1
- package/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js +3 -35
- package/package.json +2 -2
- package/node_modules/@webcomponents/webcomponentsjs/src/platform/event-listener-options.js +0 -122
- package/node_modules/@webcomponents/webcomponentsjs/src/platform/toggle-attribute.js +0 -39
|
@@ -157,48 +157,16 @@
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
if (polyfills.length) {
|
|
160
|
-
// When the Trusted Types API is available, `policy` is a
|
|
161
|
-
// `TrustedTypePolicy` with functions for creating trusted HTML, scripts,
|
|
162
|
-
// and script URLs. This policy is used below to (a) approve the bundle URL
|
|
163
|
-
// string created by the loader that is assigned to a `<script>`'s `src`
|
|
164
|
-
// attribute, (b) approve a constant script string that is assigned to that
|
|
165
|
-
// `<script>'s `onload` attribute, and (c) approve the string of HTML that
|
|
166
|
-
// the loader reads from that `<script>`'s `outerHTML`.
|
|
167
|
-
//
|
|
168
|
-
// If the Trusted Types API is not available, the returned object exposes a
|
|
169
|
-
// similar interface to a `TrustedTypePolicy`, but all of its functions are
|
|
170
|
-
// the identity function.
|
|
171
|
-
var policy = (function () {
|
|
172
|
-
var identity = function (x) {
|
|
173
|
-
return x;
|
|
174
|
-
};
|
|
175
|
-
var policyOptions = {
|
|
176
|
-
createHTML: identity,
|
|
177
|
-
createScript: identity,
|
|
178
|
-
createScriptURL: identity,
|
|
179
|
-
};
|
|
180
|
-
var policy =
|
|
181
|
-
window.trustedTypes &&
|
|
182
|
-
window.trustedTypes.createPolicy('webcomponents-loader', policyOptions);
|
|
183
|
-
return policy || policyOptions;
|
|
184
|
-
})();
|
|
185
|
-
|
|
186
160
|
var url;
|
|
187
161
|
var polyfillFile = 'bundles/webcomponents-' + polyfills.join('-') + '.js';
|
|
188
162
|
|
|
189
163
|
// Load it from the right place.
|
|
190
164
|
if (window.WebComponents.root) {
|
|
191
165
|
url = window.WebComponents.root + polyfillFile;
|
|
192
|
-
if (
|
|
193
|
-
window.trustedTypes &&
|
|
194
|
-
window.trustedTypes.isScriptURL(window.WebComponents.root)
|
|
195
|
-
) {
|
|
196
|
-
url = policy.createScriptURL(url);
|
|
197
|
-
}
|
|
198
166
|
} else {
|
|
199
167
|
var script = document.querySelector('script[src*="' + name + '"]');
|
|
200
168
|
// Load it from the right place.
|
|
201
|
-
url =
|
|
169
|
+
url = script.src.replace(name, polyfillFile);
|
|
202
170
|
}
|
|
203
171
|
|
|
204
172
|
var newScript = document.createElement('script');
|
|
@@ -208,9 +176,9 @@
|
|
|
208
176
|
// make sure custom elements are batched whenever parser gets to the injected script
|
|
209
177
|
newScript.setAttribute(
|
|
210
178
|
'onload',
|
|
211
|
-
|
|
179
|
+
'window.WebComponents._batchCustomElements()'
|
|
212
180
|
);
|
|
213
|
-
document.write(
|
|
181
|
+
document.write(newScript.outerHTML);
|
|
214
182
|
document.addEventListener('DOMContentLoaded', ready);
|
|
215
183
|
} else {
|
|
216
184
|
newScript.addEventListener('load', function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luftborn/custom-elements",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "custom HTML elements for the form builder application ",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@types/googlemaps": "^3.39.6",
|
|
18
18
|
"@webcomponents/custom-elements": "^1.4.1",
|
|
19
|
-
"@webcomponents/webcomponentsjs": "
|
|
19
|
+
"@webcomponents/webcomponentsjs": "2.6.0",
|
|
20
20
|
"intl-tel-input": "^16.0.8",
|
|
21
21
|
"restore": "^0.3.0"
|
|
22
22
|
},
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
4
|
-
* This code may only be used under the BSD style license found at
|
|
5
|
-
* http://polymer.github.io/LICENSE.txt The complete set of authors may be found
|
|
6
|
-
* at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
|
|
7
|
-
* be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
|
|
8
|
-
* Google as part of the polymer project is also subject to an additional IP
|
|
9
|
-
* rights grant found at http://polymer.github.io/PATENTS.txt
|
|
10
|
-
*/
|
|
11
|
-
var _a;
|
|
12
|
-
// Older browsers like IE do not support an object as the options parameter
|
|
13
|
-
// to add/removeEventListener.
|
|
14
|
-
// https://connect.microsoft.com/IE/feedback/details/790389/event-defaultprevented-returns-false-after-preventdefault-was-called
|
|
15
|
-
const supportsEventOptions = (() => {
|
|
16
|
-
let supported = false;
|
|
17
|
-
let onceSupported = false;
|
|
18
|
-
const eventOptions = {
|
|
19
|
-
get capture() {
|
|
20
|
-
supported = true;
|
|
21
|
-
return true;
|
|
22
|
-
},
|
|
23
|
-
get once() {
|
|
24
|
-
onceSupported = true;
|
|
25
|
-
return true;
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
let callCount = 0;
|
|
29
|
-
const listener = () => {
|
|
30
|
-
callCount++;
|
|
31
|
-
};
|
|
32
|
-
const d = document.createElement('div');
|
|
33
|
-
// NOTE: These will be unpatched at this point.
|
|
34
|
-
d.addEventListener('click', listener, eventOptions);
|
|
35
|
-
let fullySupported = supported && onceSupported;
|
|
36
|
-
// Once + capture broken on Edge >= 17 < 79.
|
|
37
|
-
if (fullySupported) {
|
|
38
|
-
d.dispatchEvent(new Event('click'));
|
|
39
|
-
d.dispatchEvent(new Event('click'));
|
|
40
|
-
fullySupported = callCount == 1;
|
|
41
|
-
}
|
|
42
|
-
d.removeEventListener('click', listener, eventOptions);
|
|
43
|
-
return fullySupported;
|
|
44
|
-
})();
|
|
45
|
-
const nativeEventTarget = (_a = window.EventTarget) !== null && _a !== void 0 ? _a : window.Node;
|
|
46
|
-
if (!supportsEventOptions &&
|
|
47
|
-
'addEventListener' in nativeEventTarget.prototype) {
|
|
48
|
-
const parseEventOptions = (optionsOrCapture) => {
|
|
49
|
-
let capture, once;
|
|
50
|
-
if (optionsOrCapture &&
|
|
51
|
-
(typeof optionsOrCapture === 'object' ||
|
|
52
|
-
typeof optionsOrCapture === 'function')) {
|
|
53
|
-
capture = Boolean(optionsOrCapture.capture);
|
|
54
|
-
once = Boolean(optionsOrCapture.once);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
capture = Boolean(optionsOrCapture);
|
|
58
|
-
once = false;
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
capture,
|
|
62
|
-
once,
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
const origAddEventListener = nativeEventTarget.prototype.addEventListener;
|
|
66
|
-
const origRemoveEventListener = nativeEventTarget.prototype.removeEventListener;
|
|
67
|
-
const captureListenerMap = new WeakMap();
|
|
68
|
-
const listenerMap = new WeakMap();
|
|
69
|
-
const getListenerMap = (target, type, capture) => {
|
|
70
|
-
const elMap = capture ? captureListenerMap : listenerMap;
|
|
71
|
-
let typeMap = elMap.get(target);
|
|
72
|
-
if (typeMap === undefined) {
|
|
73
|
-
elMap.set(target, (typeMap = new Map()));
|
|
74
|
-
}
|
|
75
|
-
let listeners = typeMap.get(type);
|
|
76
|
-
if (listeners === undefined) {
|
|
77
|
-
typeMap.set(type, (listeners = new WeakMap()));
|
|
78
|
-
}
|
|
79
|
-
return listeners;
|
|
80
|
-
};
|
|
81
|
-
nativeEventTarget.prototype.addEventListener = function (type, listener, options) {
|
|
82
|
-
if (listener == null) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const { capture, once } = parseEventOptions(options);
|
|
86
|
-
const map = getListenerMap(this, type, capture);
|
|
87
|
-
if (!map.has(listener)) {
|
|
88
|
-
const cachedListener = once
|
|
89
|
-
? (e) => {
|
|
90
|
-
map.delete(listener);
|
|
91
|
-
origRemoveEventListener.call(this, type, cachedListener, capture);
|
|
92
|
-
if (typeof listener === 'function') {
|
|
93
|
-
return listener.call(this, e);
|
|
94
|
-
}
|
|
95
|
-
if (typeof (listener === null || listener === void 0 ? void 0 : listener.handleEvent) === 'function') {
|
|
96
|
-
return listener.handleEvent(e);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
: null;
|
|
100
|
-
map.set(listener, cachedListener);
|
|
101
|
-
// Note, the cached listener is null if no wrapper is used to avoid
|
|
102
|
-
// a strong ref to it;
|
|
103
|
-
origAddEventListener.call(this, type, cachedListener !== null && cachedListener !== void 0 ? cachedListener : listener, capture);
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
nativeEventTarget.prototype.removeEventListener = function (type, listener, options) {
|
|
107
|
-
if (listener == null) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const { capture } = parseEventOptions(options);
|
|
111
|
-
const map = getListenerMap(this, type, capture);
|
|
112
|
-
const cachedListener = map.get(listener);
|
|
113
|
-
if (cachedListener !== undefined) {
|
|
114
|
-
map.delete(listener);
|
|
115
|
-
// Note, the cached listener is null if no wrapper was used so that a
|
|
116
|
-
// strong ref to it is not kept.
|
|
117
|
-
origRemoveEventListener.call(this, type, cachedListener !== null && cachedListener !== void 0 ? cachedListener : listener, capture);
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
export {};
|
|
122
|
-
//# sourceMappingURL=event-listener-options.js.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
@license
|
|
3
|
-
Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
|
|
4
|
-
This code may only be used under the BSD style license found at
|
|
5
|
-
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
|
6
|
-
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
|
7
|
-
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
|
8
|
-
part of the polymer project is also subject to an additional IP rights grant
|
|
9
|
-
found at http://polymer.github.io/PATENTS.txt
|
|
10
|
-
*/
|
|
11
|
-
const Element_prototype = Element.prototype;
|
|
12
|
-
const nativeHasAttribute = Element.prototype.hasAttribute;
|
|
13
|
-
const nativeSetAttribute = Element.prototype.setAttribute;
|
|
14
|
-
const nativeRemoveAttribute = Element.prototype.removeAttribute;
|
|
15
|
-
if (!Element_prototype.hasOwnProperty('toggleAttribute')) {
|
|
16
|
-
Element_prototype.toggleAttribute = function toggleAttribute(name, force) {
|
|
17
|
-
if (force === undefined) {
|
|
18
|
-
if (nativeHasAttribute.call(this, name)) {
|
|
19
|
-
nativeRemoveAttribute.call(this, name);
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
nativeSetAttribute.call(this, name, '');
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (force) {
|
|
28
|
-
if (!nativeHasAttribute.call(this, name)) {
|
|
29
|
-
nativeSetAttribute.call(this, name, '');
|
|
30
|
-
}
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
// force is falsey
|
|
34
|
-
nativeRemoveAttribute.call(this, name);
|
|
35
|
-
return false;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export {};
|
|
39
|
-
//# sourceMappingURL=toggle-attribute.js.map
|