@spscommerce/ds-web-components 6.37.3 → 7.0.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/dist/lib/index.cjs.js +152 -150
- package/dist/lib/index.es.js +1421 -1875
- package/dist/package.json +10 -6
- package/lib/index.cjs.js +152 -150
- package/lib/index.es.js +1421 -1875
- package/package.json +13 -10
- package/vite.config.js +6 -6
package/lib/index.es.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
1
|
+
var it = Object.defineProperty;
|
|
2
|
+
var rt = (e, t, s) => t in e ? it(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var a = (e, t, s) => (rt(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
|
+
import { noI18nI18n as at, SpsIcon as Se, SpsInsightCardKind as ot, SpsInsightCardIcons as lt } from "@spscommerce/ds-shared";
|
|
5
|
+
import { code as c, parseFileSize as ct } from "@spscommerce/utils";
|
|
6
|
+
var d = {};
|
|
7
|
+
Object.defineProperty(d, "__esModule", { value: !0 });
|
|
5
8
|
/**
|
|
6
9
|
* @license
|
|
7
10
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
@@ -18,7 +21,7 @@ Object.defineProperty(incrementalDomCjs, "__esModule", { value: true });
|
|
|
18
21
|
* See the License for the specific language governing permissions and
|
|
19
22
|
* limitations under the License.
|
|
20
23
|
*/
|
|
21
|
-
var
|
|
24
|
+
var fe = {
|
|
22
25
|
default: "__default"
|
|
23
26
|
};
|
|
24
27
|
/**
|
|
@@ -37,20 +40,19 @@ var symbols = {
|
|
|
37
40
|
* See the License for the specific language governing permissions and
|
|
38
41
|
* limitations under the License.
|
|
39
42
|
*/
|
|
40
|
-
var
|
|
41
|
-
function
|
|
43
|
+
var pt = Object.prototype.hasOwnProperty;
|
|
44
|
+
function ke() {
|
|
42
45
|
}
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
return
|
|
46
|
+
ke.prototype = /* @__PURE__ */ Object.create(null);
|
|
47
|
+
function dt(e, t) {
|
|
48
|
+
return pt.call(e, t);
|
|
46
49
|
}
|
|
47
|
-
function
|
|
48
|
-
return new
|
|
50
|
+
function Le() {
|
|
51
|
+
return new ke();
|
|
49
52
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
53
|
+
function ge(e, t) {
|
|
54
|
+
for (; e.length > t; )
|
|
55
|
+
e.pop();
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* @license
|
|
@@ -68,64 +70,46 @@ function truncateArray(arr, length) {
|
|
|
68
70
|
* See the License for the specific language governing permissions and
|
|
69
71
|
* limitations under the License.
|
|
70
72
|
*/
|
|
71
|
-
function
|
|
72
|
-
if (
|
|
73
|
+
function ht(e) {
|
|
74
|
+
if (e.lastIndexOf("xml:", 0) === 0)
|
|
73
75
|
return "http://www.w3.org/XML/1998/namespace";
|
|
74
|
-
|
|
75
|
-
if (name.lastIndexOf("xlink:", 0) === 0) {
|
|
76
|
+
if (e.lastIndexOf("xlink:", 0) === 0)
|
|
76
77
|
return "http://www.w3.org/1999/xlink";
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
var attrNS = getNamespace(name);
|
|
85
|
-
if (attrNS) {
|
|
86
|
-
el.setAttributeNS(attrNS, name, String(value));
|
|
87
|
-
} else {
|
|
88
|
-
el.setAttribute(name, String(value));
|
|
89
|
-
}
|
|
78
|
+
}
|
|
79
|
+
function Fe(e, t, s) {
|
|
80
|
+
if (s == null)
|
|
81
|
+
e.removeAttribute(t);
|
|
82
|
+
else {
|
|
83
|
+
var n = ht(t);
|
|
84
|
+
n ? e.setAttributeNS(n, t, String(s)) : e.setAttribute(t, String(s));
|
|
90
85
|
}
|
|
91
86
|
}
|
|
92
|
-
function
|
|
93
|
-
|
|
87
|
+
function Re(e, t, s) {
|
|
88
|
+
e[t] = s;
|
|
94
89
|
}
|
|
95
|
-
function
|
|
96
|
-
|
|
97
|
-
style.setProperty(prop, value);
|
|
98
|
-
} else {
|
|
99
|
-
style[prop] = value;
|
|
100
|
-
}
|
|
90
|
+
function ut(e, t, s) {
|
|
91
|
+
t.indexOf("-") >= 0 ? e.setProperty(t, s) : e[t] = s;
|
|
101
92
|
}
|
|
102
|
-
function
|
|
103
|
-
if (typeof
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
var
|
|
108
|
-
for (var
|
|
109
|
-
|
|
110
|
-
setStyleValue(elStyle, prop, style[prop]);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
93
|
+
function ft(e, t, s) {
|
|
94
|
+
if (typeof s == "string")
|
|
95
|
+
e.style.cssText = s;
|
|
96
|
+
else {
|
|
97
|
+
e.style.cssText = "";
|
|
98
|
+
var n = e.style;
|
|
99
|
+
for (var i in s)
|
|
100
|
+
dt(s, i) && ut(n, i, s[i]);
|
|
113
101
|
}
|
|
114
102
|
}
|
|
115
|
-
function
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
applyProp(el, name, value);
|
|
119
|
-
} else {
|
|
120
|
-
applyAttr(el, name, value);
|
|
121
|
-
}
|
|
103
|
+
function gt(e, t, s) {
|
|
104
|
+
var n = typeof s;
|
|
105
|
+
n === "object" || n === "function" ? Re(e, t, s) : Fe(e, t, s);
|
|
122
106
|
}
|
|
123
|
-
var
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
function
|
|
127
|
-
var
|
|
128
|
-
|
|
107
|
+
var W = Le();
|
|
108
|
+
W[fe.default] = gt;
|
|
109
|
+
W.style = ft;
|
|
110
|
+
function z(e, t, s) {
|
|
111
|
+
var n = W[t] || W[fe.default];
|
|
112
|
+
n(e, t, s);
|
|
129
113
|
}
|
|
130
114
|
/**
|
|
131
115
|
* @license
|
|
@@ -143,46 +127,65 @@ function updateAttribute(el, name, value) {
|
|
|
143
127
|
* See the License for the specific language governing permissions and
|
|
144
128
|
* limitations under the License.
|
|
145
129
|
*/
|
|
146
|
-
var
|
|
147
|
-
function
|
|
148
|
-
if (
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
var currentElement2 = openElement;
|
|
152
|
-
var openTags = [];
|
|
153
|
-
while (currentElement2 && currentElement2 !== root) {
|
|
154
|
-
openTags.push(currentElement2.nodeName.toLowerCase());
|
|
155
|
-
currentElement2 = currentElement2.parentNode;
|
|
156
|
-
}
|
|
157
|
-
throw new Error("One or more tags were not closed:\n" + openTags.join("\n"));
|
|
130
|
+
var H = !1, oe = !1;
|
|
131
|
+
function Be(e, t) {
|
|
132
|
+
if (!t)
|
|
133
|
+
throw new Error("Cannot call " + e + "() unless in patch.");
|
|
158
134
|
}
|
|
159
|
-
function
|
|
160
|
-
if (
|
|
161
|
-
|
|
135
|
+
function mt(e, t) {
|
|
136
|
+
if (e !== t) {
|
|
137
|
+
for (var s = e, n = []; s && s !== t; )
|
|
138
|
+
n.push(s.nodeName.toLowerCase()), s = s.parentNode;
|
|
139
|
+
throw new Error(`One or more tags were not closed:
|
|
140
|
+
` + n.join(`
|
|
141
|
+
`));
|
|
162
142
|
}
|
|
163
143
|
}
|
|
164
|
-
function
|
|
165
|
-
if
|
|
144
|
+
function vt(e) {
|
|
145
|
+
e || console.warn("patchOuter requires the node have a parent if there is a key.");
|
|
146
|
+
}
|
|
147
|
+
function B(e) {
|
|
148
|
+
if (H)
|
|
149
|
+
throw new Error(e + "() can not be called between elementOpenStart() and elementOpenEnd().");
|
|
150
|
+
}
|
|
151
|
+
function $e(e) {
|
|
152
|
+
if (oe)
|
|
153
|
+
throw new Error(e + "() may not be called inside an element that has called skip().");
|
|
154
|
+
}
|
|
155
|
+
function me(e) {
|
|
156
|
+
if (!H)
|
|
157
|
+
throw new Error(e + "() can only be called after calling elementOpenStart().");
|
|
158
|
+
}
|
|
159
|
+
function bt() {
|
|
160
|
+
if (H)
|
|
166
161
|
throw new Error("elementOpenEnd() must be called after calling elementOpenStart().");
|
|
167
|
-
}
|
|
168
162
|
}
|
|
169
|
-
function
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
163
|
+
function Ct(e, t) {
|
|
164
|
+
if (e !== t)
|
|
165
|
+
throw new Error('Received a call to close "' + t + '" but "' + e + '" was open.');
|
|
166
|
+
}
|
|
167
|
+
function wt(e, t) {
|
|
168
|
+
if (t !== null)
|
|
169
|
+
throw new Error(e + "() must come before any child declarations inside the current element.");
|
|
170
|
+
}
|
|
171
|
+
function _t(e, t, s, n) {
|
|
172
|
+
se(e);
|
|
173
|
+
var i = e, r = t, l = r.nextSibling === s && r.previousSibling === n, h = r.nextSibling === i.nextSibling && r.previousSibling === n, C = r === i;
|
|
174
|
+
if (!l && !h && !C)
|
|
176
175
|
throw new Error("There must be exactly one top level call corresponding to the patched element.");
|
|
177
|
-
}
|
|
178
176
|
}
|
|
179
|
-
function
|
|
180
|
-
var
|
|
181
|
-
|
|
182
|
-
|
|
177
|
+
function M(e) {
|
|
178
|
+
var t = H;
|
|
179
|
+
return H = e, t;
|
|
180
|
+
}
|
|
181
|
+
function ee(e) {
|
|
182
|
+
var t = oe;
|
|
183
|
+
return oe = e, t;
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
-
|
|
185
|
+
function se(e) {
|
|
186
|
+
if (process.env.NODE_ENV !== "production" && !e)
|
|
187
|
+
throw new Error("Expected value to be defined");
|
|
188
|
+
return e;
|
|
186
189
|
}
|
|
187
190
|
/**
|
|
188
191
|
* @license
|
|
@@ -200,7 +203,7 @@ function assert(val) {
|
|
|
200
203
|
* See the License for the specific language governing permissions and
|
|
201
204
|
* limitations under the License.
|
|
202
205
|
*/
|
|
203
|
-
var
|
|
206
|
+
var U = {
|
|
204
207
|
nodesCreated: null,
|
|
205
208
|
nodesDeleted: null
|
|
206
209
|
};
|
|
@@ -220,26 +223,17 @@ var notifications = {
|
|
|
220
223
|
* See the License for the specific language governing permissions and
|
|
221
224
|
* limitations under the License.
|
|
222
225
|
*/
|
|
223
|
-
var
|
|
224
|
-
function
|
|
225
|
-
this.created = [];
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
this.deleted.
|
|
233
|
-
};
|
|
234
|
-
Context2.prototype.notifyChanges = function() {
|
|
235
|
-
if (notifications.nodesCreated && this.created.length > 0) {
|
|
236
|
-
notifications.nodesCreated(this.created);
|
|
237
|
-
}
|
|
238
|
-
if (notifications.nodesDeleted && this.deleted.length > 0) {
|
|
239
|
-
notifications.nodesDeleted(this.deleted);
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
return Context2;
|
|
226
|
+
var Nt = function() {
|
|
227
|
+
function e() {
|
|
228
|
+
this.created = [], this.deleted = [];
|
|
229
|
+
}
|
|
230
|
+
return e.prototype.markCreated = function(t) {
|
|
231
|
+
this.created.push(t);
|
|
232
|
+
}, e.prototype.markDeleted = function(t) {
|
|
233
|
+
this.deleted.push(t);
|
|
234
|
+
}, e.prototype.notifyChanges = function() {
|
|
235
|
+
U.nodesCreated && this.created.length > 0 && U.nodesCreated(this.created), U.nodesDeleted && this.deleted.length > 0 && U.nodesDeleted(this.deleted);
|
|
236
|
+
}, e;
|
|
243
237
|
}();
|
|
244
238
|
/**
|
|
245
239
|
* @license
|
|
@@ -257,52 +251,39 @@ var Context = function() {
|
|
|
257
251
|
* See the License for the specific language governing permissions and
|
|
258
252
|
* limitations under the License.
|
|
259
253
|
*/
|
|
260
|
-
function
|
|
261
|
-
return
|
|
262
|
-
}
|
|
263
|
-
function
|
|
264
|
-
return
|
|
265
|
-
}
|
|
266
|
-
function
|
|
267
|
-
return
|
|
268
|
-
}
|
|
269
|
-
function
|
|
270
|
-
var
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
var n = cur;
|
|
274
|
-
ancestry.push(n);
|
|
275
|
-
cur = n.parentNode;
|
|
276
|
-
}
|
|
277
|
-
return ancestry;
|
|
278
|
-
}
|
|
279
|
-
var getRootNode = Node.prototype.getRootNode || function() {
|
|
280
|
-
var cur = this;
|
|
281
|
-
var prev = cur;
|
|
282
|
-
while (cur) {
|
|
283
|
-
prev = cur;
|
|
284
|
-
cur = cur.parentNode;
|
|
254
|
+
function xt(e) {
|
|
255
|
+
return e.nodeType === 11 || e.nodeType === 9;
|
|
256
|
+
}
|
|
257
|
+
function ae(e) {
|
|
258
|
+
return e.nodeType === 1;
|
|
259
|
+
}
|
|
260
|
+
function yt(e) {
|
|
261
|
+
return e.nodeType === 3;
|
|
262
|
+
}
|
|
263
|
+
function St(e, t) {
|
|
264
|
+
for (var s = [], n = e; n !== t; ) {
|
|
265
|
+
var i = n;
|
|
266
|
+
s.push(i), n = i.parentNode;
|
|
285
267
|
}
|
|
286
|
-
return
|
|
268
|
+
return s;
|
|
269
|
+
}
|
|
270
|
+
var Ot = Node.prototype.getRootNode || function() {
|
|
271
|
+
for (var e = this, t = e; e; )
|
|
272
|
+
t = e, e = e.parentNode;
|
|
273
|
+
return t;
|
|
287
274
|
};
|
|
288
|
-
function
|
|
289
|
-
var
|
|
290
|
-
return
|
|
291
|
-
}
|
|
292
|
-
function
|
|
293
|
-
var
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
var insertReferenceNode = node.nextSibling;
|
|
301
|
-
var cur = referenceNode;
|
|
302
|
-
while (cur !== null && cur !== node) {
|
|
303
|
-
var next = cur.nextSibling;
|
|
304
|
-
parentNode.insertBefore(cur, insertReferenceNode);
|
|
305
|
-
cur = next;
|
|
275
|
+
function At(e) {
|
|
276
|
+
var t = Ot.call(e);
|
|
277
|
+
return xt(t) ? t.activeElement : null;
|
|
278
|
+
}
|
|
279
|
+
function Dt(e, t) {
|
|
280
|
+
var s = At(e);
|
|
281
|
+
return !s || !e.contains(s) ? [] : St(s, t);
|
|
282
|
+
}
|
|
283
|
+
function Pt(e, t, s) {
|
|
284
|
+
for (var n = t.nextSibling, i = s; i !== null && i !== t; ) {
|
|
285
|
+
var r = i.nextSibling;
|
|
286
|
+
e.insertBefore(i, n), i = r;
|
|
306
287
|
}
|
|
307
288
|
}
|
|
308
289
|
/**
|
|
@@ -321,77 +302,53 @@ function moveBefore(parentNode, node, referenceNode) {
|
|
|
321
302
|
* See the License for the specific language governing permissions and
|
|
322
303
|
* limitations under the License.
|
|
323
304
|
*/
|
|
324
|
-
var
|
|
325
|
-
function
|
|
326
|
-
this._attrsArr = null;
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
return !attrs || !attrs.length;
|
|
335
|
-
};
|
|
336
|
-
NodeData2.prototype.getAttrsArr = function(length) {
|
|
337
|
-
return this._attrsArr || (this._attrsArr = new Array(length));
|
|
338
|
-
};
|
|
339
|
-
return NodeData2;
|
|
305
|
+
var Et = function() {
|
|
306
|
+
function e(t, s, n) {
|
|
307
|
+
this._attrsArr = null, this.staticsApplied = !1, this.nameOrCtor = t, this.key = s, this.text = n;
|
|
308
|
+
}
|
|
309
|
+
return e.prototype.hasEmptyAttrsArr = function() {
|
|
310
|
+
var t = this._attrsArr;
|
|
311
|
+
return !t || !t.length;
|
|
312
|
+
}, e.prototype.getAttrsArr = function(t) {
|
|
313
|
+
return this._attrsArr || (this._attrsArr = new Array(t));
|
|
314
|
+
}, e;
|
|
340
315
|
}();
|
|
341
|
-
function
|
|
342
|
-
var
|
|
343
|
-
|
|
344
|
-
return data;
|
|
316
|
+
function ve(e, t, s, n) {
|
|
317
|
+
var i = new Et(t, s, n);
|
|
318
|
+
return e.__incrementalDOMData = i, i;
|
|
345
319
|
}
|
|
346
|
-
function
|
|
347
|
-
return
|
|
320
|
+
function $(e, t) {
|
|
321
|
+
return Te(e, t);
|
|
348
322
|
}
|
|
349
|
-
function
|
|
350
|
-
return Boolean(
|
|
323
|
+
function It(e) {
|
|
324
|
+
return Boolean(e.__incrementalDOMData);
|
|
351
325
|
}
|
|
352
|
-
function
|
|
353
|
-
|
|
354
|
-
return getData(node).key;
|
|
326
|
+
function kt(e) {
|
|
327
|
+
return se(e.__incrementalDOMData), $(e).key;
|
|
355
328
|
}
|
|
356
|
-
function
|
|
357
|
-
if (
|
|
358
|
-
return
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
var key2 = isElement(node) ? node.getAttribute("key") || fallbackKey : null;
|
|
362
|
-
var text2 = isText(node) ? node.data : void 0;
|
|
363
|
-
var data = initData(node, nodeName, key2, text2);
|
|
364
|
-
if (isElement(node)) {
|
|
365
|
-
recordAttributes(node, data);
|
|
366
|
-
}
|
|
367
|
-
return data;
|
|
329
|
+
function Te(e, t) {
|
|
330
|
+
if (e.__incrementalDOMData)
|
|
331
|
+
return e.__incrementalDOMData;
|
|
332
|
+
var s = ae(e) ? e.localName : e.nodeName, n = ae(e) ? e.getAttribute("key") || t : null, i = yt(e) ? e.data : void 0, r = ve(e, s, n, i);
|
|
333
|
+
return ae(e) && Lt(e, r), r;
|
|
368
334
|
}
|
|
369
|
-
function
|
|
370
|
-
|
|
371
|
-
for (var
|
|
372
|
-
|
|
373
|
-
}
|
|
335
|
+
function je(e) {
|
|
336
|
+
Te(e);
|
|
337
|
+
for (var t = e.firstChild; t; t = t.nextSibling)
|
|
338
|
+
je(t);
|
|
374
339
|
}
|
|
375
|
-
function
|
|
376
|
-
|
|
377
|
-
for (var
|
|
378
|
-
|
|
379
|
-
}
|
|
340
|
+
function Ue(e) {
|
|
341
|
+
e.__incrementalDOMData = null;
|
|
342
|
+
for (var t = e.firstChild; t; t = t.nextSibling)
|
|
343
|
+
Ue(t);
|
|
380
344
|
}
|
|
381
|
-
function
|
|
382
|
-
var
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
for (var i = 0, j = 0; i < length; i += 1, j += 2) {
|
|
389
|
-
var attr2 = attributes2[i];
|
|
390
|
-
var name = attr2.name;
|
|
391
|
-
var value = attr2.value;
|
|
392
|
-
attrsArr[j] = name;
|
|
393
|
-
attrsArr[j + 1] = value;
|
|
394
|
-
}
|
|
345
|
+
function Lt(e, t) {
|
|
346
|
+
var s = e.attributes, n = s.length;
|
|
347
|
+
if (!!n)
|
|
348
|
+
for (var i = t.getAttrsArr(n), r = 0, l = 0; r < n; r += 1, l += 2) {
|
|
349
|
+
var h = s[r], C = h.name, g = h.value;
|
|
350
|
+
i[l] = C, i[l + 1] = g;
|
|
351
|
+
}
|
|
395
352
|
}
|
|
396
353
|
/**
|
|
397
354
|
* @license
|
|
@@ -409,40 +366,22 @@ function recordAttributes(node, data) {
|
|
|
409
366
|
* See the License for the specific language governing permissions and
|
|
410
367
|
* limitations under the License.
|
|
411
368
|
*/
|
|
412
|
-
function
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
if (getData(parent).nameOrCtor === "foreignObject") {
|
|
423
|
-
return null;
|
|
424
|
-
}
|
|
425
|
-
return parent.namespaceURI;
|
|
426
|
-
}
|
|
427
|
-
function createElement(doc2, parent, nameOrCtor, key2) {
|
|
428
|
-
var el;
|
|
429
|
-
if (typeof nameOrCtor === "function") {
|
|
430
|
-
el = new nameOrCtor();
|
|
431
|
-
} else {
|
|
432
|
-
var namespace = getNamespaceForTag(nameOrCtor, parent);
|
|
433
|
-
if (namespace) {
|
|
434
|
-
el = doc2.createElementNS(namespace, nameOrCtor);
|
|
435
|
-
} else {
|
|
436
|
-
el = doc2.createElement(nameOrCtor);
|
|
437
|
-
}
|
|
369
|
+
function Ft(e, t) {
|
|
370
|
+
return e === "svg" ? "http://www.w3.org/2000/svg" : e === "math" ? "http://www.w3.org/1998/Math/MathML" : t == null || $(t).nameOrCtor === "foreignObject" ? null : t.namespaceURI;
|
|
371
|
+
}
|
|
372
|
+
function Rt(e, t, s, n) {
|
|
373
|
+
var i;
|
|
374
|
+
if (typeof s == "function")
|
|
375
|
+
i = new s();
|
|
376
|
+
else {
|
|
377
|
+
var r = Ft(s, t);
|
|
378
|
+
r ? i = e.createElementNS(r, s) : i = e.createElement(s);
|
|
438
379
|
}
|
|
439
|
-
|
|
440
|
-
return el;
|
|
380
|
+
return ve(i, s, n), i;
|
|
441
381
|
}
|
|
442
|
-
function
|
|
443
|
-
var
|
|
444
|
-
|
|
445
|
-
return node;
|
|
382
|
+
function Bt(e) {
|
|
383
|
+
var t = e.createTextNode("");
|
|
384
|
+
return ve(t, "#text", null), t;
|
|
446
385
|
}
|
|
447
386
|
/**
|
|
448
387
|
* @license
|
|
@@ -460,166 +399,88 @@ function createText(doc2) {
|
|
|
460
399
|
* See the License for the specific language governing permissions and
|
|
461
400
|
* limitations under the License.
|
|
462
401
|
*/
|
|
463
|
-
var
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
var
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}
|
|
472
|
-
function patchFactory(run) {
|
|
473
|
-
var f = function(node, fn, data) {
|
|
474
|
-
var prevContext = context;
|
|
475
|
-
var prevDoc = doc;
|
|
476
|
-
var prevFocusPath = focusPath;
|
|
477
|
-
var prevArgsBuilder = argsBuilder;
|
|
478
|
-
var prevCurrentNode = currentNode;
|
|
479
|
-
var prevCurrentParent = currentParent;
|
|
480
|
-
var previousInAttributes = false;
|
|
481
|
-
context = new Context();
|
|
482
|
-
doc = node.ownerDocument;
|
|
483
|
-
argsBuilder = [];
|
|
484
|
-
currentParent = node.parentNode;
|
|
485
|
-
focusPath = getFocusedPath(node, currentParent);
|
|
402
|
+
var R = null, u = null, b = null, k = null, J = [], Y = [];
|
|
403
|
+
function ne() {
|
|
404
|
+
return Y;
|
|
405
|
+
}
|
|
406
|
+
function ze(e) {
|
|
407
|
+
var t = function(s, n, i) {
|
|
408
|
+
var r = R, l = k, h = J, C = Y, g = u, w = b, S = !1, V = !1;
|
|
409
|
+
R = new Nt(), k = s.ownerDocument, Y = [], b = s.parentNode, J = Dt(s, b), process.env.NODE_ENV !== "production" && (S = M(!1), V = ee(!1));
|
|
486
410
|
try {
|
|
487
|
-
var
|
|
488
|
-
|
|
489
|
-
;
|
|
490
|
-
return retVal;
|
|
411
|
+
var nt = e(s, n, i);
|
|
412
|
+
return process.env.NODE_ENV !== "production" && bt(), nt;
|
|
491
413
|
} finally {
|
|
492
|
-
|
|
493
|
-
argsBuilder = prevArgsBuilder;
|
|
494
|
-
currentNode = prevCurrentNode;
|
|
495
|
-
currentParent = prevCurrentParent;
|
|
496
|
-
focusPath = prevFocusPath;
|
|
497
|
-
context.notifyChanges();
|
|
498
|
-
setInAttributes(previousInAttributes);
|
|
499
|
-
context = prevContext;
|
|
414
|
+
k = l, Y = C, u = g, b = w, J = h, R.notifyChanges(), M(S), ee(V), R = r;
|
|
500
415
|
}
|
|
501
416
|
};
|
|
502
|
-
return
|
|
503
|
-
}
|
|
504
|
-
var
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
if (false)
|
|
510
|
-
;
|
|
511
|
-
return node;
|
|
512
|
-
});
|
|
513
|
-
var patchOuter = patchFactory(function(node, fn, data) {
|
|
514
|
-
var startNode = { nextSibling: node };
|
|
515
|
-
var expectedNextNode = null;
|
|
516
|
-
var expectedPrevNode = null;
|
|
517
|
-
if (false)
|
|
518
|
-
;
|
|
519
|
-
currentNode = startNode;
|
|
520
|
-
fn(data);
|
|
521
|
-
if (false)
|
|
522
|
-
;
|
|
523
|
-
if (currentParent) {
|
|
524
|
-
clearUnvisitedDOM(currentParent, getNextNode(), node.nextSibling);
|
|
525
|
-
}
|
|
526
|
-
return startNode === currentNode ? null : currentNode;
|
|
417
|
+
return t;
|
|
418
|
+
}
|
|
419
|
+
var We = ze(function(e, t, s) {
|
|
420
|
+
return u = e, qe(), t(s), Ge(), process.env.NODE_ENV !== "production" && mt(u, e), e;
|
|
421
|
+
}), $t = ze(function(e, t, s) {
|
|
422
|
+
var n = { nextSibling: e }, i = null, r = null;
|
|
423
|
+
return process.env.NODE_ENV !== "production" && (i = e.nextSibling, r = e.previousSibling), u = n, t(s), process.env.NODE_ENV !== "production" && (vt(b), _t(n, u, i, r)), b && Ve(b, ie(), e.nextSibling), n === u ? null : u;
|
|
527
424
|
});
|
|
528
|
-
function
|
|
529
|
-
var
|
|
530
|
-
return
|
|
425
|
+
function Oe(e, t, s) {
|
|
426
|
+
var n = $(e, s);
|
|
427
|
+
return t == n.nameOrCtor && s == n.key;
|
|
531
428
|
}
|
|
532
|
-
function
|
|
533
|
-
if (!
|
|
429
|
+
function Tt(e, t, s) {
|
|
430
|
+
if (!e)
|
|
534
431
|
return null;
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
if (matches(matchNode, nameOrCtor, key2)) {
|
|
542
|
-
return matchNode;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
432
|
+
if (Oe(e, t, s))
|
|
433
|
+
return e;
|
|
434
|
+
if (s) {
|
|
435
|
+
for (; e = e.nextSibling; )
|
|
436
|
+
if (Oe(e, t, s))
|
|
437
|
+
return e;
|
|
545
438
|
}
|
|
546
439
|
return null;
|
|
547
440
|
}
|
|
548
|
-
function
|
|
549
|
-
var
|
|
550
|
-
|
|
551
|
-
node = createText(doc);
|
|
552
|
-
} else {
|
|
553
|
-
node = createElement(doc, currentParent, nameOrCtor, key2);
|
|
554
|
-
}
|
|
555
|
-
context.markCreated(node);
|
|
556
|
-
return node;
|
|
557
|
-
}
|
|
558
|
-
function alignWithDOM(nameOrCtor, key2) {
|
|
559
|
-
var existingNode = getMatchingNode(currentNode, nameOrCtor, key2);
|
|
560
|
-
var node = existingNode || createNode(nameOrCtor, key2);
|
|
561
|
-
if (node === currentNode) {
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
if (focusPath.indexOf(node) >= 0) {
|
|
565
|
-
moveBefore(currentParent, node, currentNode);
|
|
566
|
-
} else {
|
|
567
|
-
currentParent.insertBefore(node, currentNode);
|
|
568
|
-
}
|
|
569
|
-
currentNode = node;
|
|
570
|
-
}
|
|
571
|
-
function clearUnvisitedDOM(maybeParentNode, startNode, endNode) {
|
|
572
|
-
var parentNode = maybeParentNode;
|
|
573
|
-
var child = startNode;
|
|
574
|
-
while (child !== endNode) {
|
|
575
|
-
var next = child.nextSibling;
|
|
576
|
-
parentNode.removeChild(child);
|
|
577
|
-
context.markDeleted(child);
|
|
578
|
-
child = next;
|
|
579
|
-
}
|
|
441
|
+
function jt(e, t) {
|
|
442
|
+
var s;
|
|
443
|
+
return e === "#text" ? s = Bt(k) : s = Rt(k, b, e, t), R.markCreated(s), s;
|
|
580
444
|
}
|
|
581
|
-
function
|
|
582
|
-
|
|
583
|
-
|
|
445
|
+
function He(e, t) {
|
|
446
|
+
var s = Tt(u, e, t), n = s || jt(e, t);
|
|
447
|
+
n !== u && (J.indexOf(n) >= 0 ? Pt(b, n, u) : b.insertBefore(n, u), u = n);
|
|
584
448
|
}
|
|
585
|
-
function
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
return currentParent.firstChild;
|
|
449
|
+
function Ve(e, t, s) {
|
|
450
|
+
for (var n = e, i = t; i !== s; ) {
|
|
451
|
+
var r = i.nextSibling;
|
|
452
|
+
n.removeChild(i), R.markDeleted(i), i = r;
|
|
590
453
|
}
|
|
591
454
|
}
|
|
592
|
-
function
|
|
593
|
-
|
|
455
|
+
function qe() {
|
|
456
|
+
b = u, u = null;
|
|
457
|
+
}
|
|
458
|
+
function ie() {
|
|
459
|
+
return u ? u.nextSibling : b.firstChild;
|
|
594
460
|
}
|
|
595
|
-
function
|
|
596
|
-
|
|
597
|
-
currentNode = currentParent;
|
|
598
|
-
currentParent = currentParent.parentNode;
|
|
461
|
+
function be() {
|
|
462
|
+
u = ie();
|
|
599
463
|
}
|
|
600
|
-
function
|
|
601
|
-
|
|
602
|
-
alignWithDOM(nameOrCtor, key2);
|
|
603
|
-
enterNode();
|
|
604
|
-
return currentParent;
|
|
464
|
+
function Ge() {
|
|
465
|
+
Ve(b, ie(), null), u = b, b = b.parentNode;
|
|
605
466
|
}
|
|
606
|
-
function
|
|
607
|
-
|
|
608
|
-
return currentNode;
|
|
467
|
+
function Xe(e, t) {
|
|
468
|
+
return be(), He(e, t), qe(), b;
|
|
609
469
|
}
|
|
610
|
-
function
|
|
611
|
-
|
|
612
|
-
alignWithDOM("#text", null);
|
|
613
|
-
return currentNode;
|
|
470
|
+
function Ke() {
|
|
471
|
+
return process.env.NODE_ENV !== "production" && ee(!1), Ge(), u;
|
|
614
472
|
}
|
|
615
|
-
function
|
|
616
|
-
return
|
|
473
|
+
function Ut() {
|
|
474
|
+
return be(), He("#text", null), u;
|
|
617
475
|
}
|
|
618
|
-
function
|
|
619
|
-
return
|
|
476
|
+
function zt() {
|
|
477
|
+
return process.env.NODE_ENV !== "production" && (Be("currentElement", k), B("currentElement")), b;
|
|
620
478
|
}
|
|
621
|
-
function
|
|
622
|
-
|
|
479
|
+
function Wt() {
|
|
480
|
+
return process.env.NODE_ENV !== "production" && (Be("currentPointer", k), B("currentPointer")), ie();
|
|
481
|
+
}
|
|
482
|
+
function Ht() {
|
|
483
|
+
process.env.NODE_ENV !== "production" && (wt("skip", u), ee(!0)), u = b.lastChild;
|
|
623
484
|
}
|
|
624
485
|
/**
|
|
625
486
|
* @license
|
|
@@ -637,148 +498,96 @@ function skip() {
|
|
|
637
498
|
* See the License for the specific language governing permissions and
|
|
638
499
|
* limitations under the License.
|
|
639
500
|
*/
|
|
640
|
-
var
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
for (var
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
}
|
|
656
|
-
var attrsArr = data.getAttrsArr(0);
|
|
657
|
-
var j = 0;
|
|
658
|
-
for (var i = 0; i < attrsArr.length; i += 2) {
|
|
659
|
-
var name = attrsArr[i];
|
|
660
|
-
var value = attrsArr[i + 1];
|
|
661
|
-
var staticsIndex = prevAttrsMap[name];
|
|
662
|
-
if (staticsIndex) {
|
|
663
|
-
if (statics[staticsIndex] === value) {
|
|
664
|
-
delete prevAttrsMap[name];
|
|
501
|
+
var Ae = 3, x = Le();
|
|
502
|
+
function Vt(e, t, s) {
|
|
503
|
+
if (t.staticsApplied = !0, !(!s || !s.length)) {
|
|
504
|
+
if (t.hasEmptyAttrsArr()) {
|
|
505
|
+
for (var n = 0; n < s.length; n += 2)
|
|
506
|
+
z(e, s[n], s[n + 1]);
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
for (var n = 0; n < s.length; n += 2)
|
|
510
|
+
x[s[n]] = n + 1;
|
|
511
|
+
for (var i = t.getAttrsArr(0), r = 0, n = 0; n < i.length; n += 2) {
|
|
512
|
+
var l = i[n], h = i[n + 1], C = x[l];
|
|
513
|
+
if (C) {
|
|
514
|
+
s[C] === h && delete x[l];
|
|
515
|
+
continue;
|
|
665
516
|
}
|
|
666
|
-
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
for (var
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
if (!data.staticsApplied) {
|
|
686
|
-
applyStatics(node, data, statics);
|
|
687
|
-
}
|
|
688
|
-
var attrsLength = Math.max(0, arguments.length - ATTRIBUTES_OFFSET);
|
|
689
|
-
var hadNoAttrs = data.hasEmptyAttrsArr();
|
|
690
|
-
if (!attrsLength && hadNoAttrs) {
|
|
691
|
-
return node;
|
|
692
|
-
}
|
|
693
|
-
var attrsArr = data.getAttrsArr(attrsLength);
|
|
694
|
-
var i = ATTRIBUTES_OFFSET;
|
|
695
|
-
var j = 0;
|
|
696
|
-
for (; i < arguments.length; i += 2, j += 2) {
|
|
697
|
-
var name = arguments[i];
|
|
698
|
-
if (hadNoAttrs) {
|
|
699
|
-
attrsArr[j] = name;
|
|
700
|
-
} else if (attrsArr[j] !== name) {
|
|
517
|
+
i[r] = l, i[r + 1] = h, r += 2;
|
|
518
|
+
}
|
|
519
|
+
ge(i, r);
|
|
520
|
+
for (var l in x)
|
|
521
|
+
z(e, l, s[x[l]]), delete x[l];
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
function Ce(e, t, s) {
|
|
525
|
+
process.env.NODE_ENV !== "production" && (B("elementOpen"), $e("elementOpen"));
|
|
526
|
+
var n = Xe(e, t), i = $(n);
|
|
527
|
+
i.staticsApplied || Vt(n, i, s);
|
|
528
|
+
var r = Math.max(0, arguments.length - Ae), l = i.hasEmptyAttrsArr();
|
|
529
|
+
if (!r && l)
|
|
530
|
+
return n;
|
|
531
|
+
for (var h = i.getAttrsArr(r), C = Ae, g = 0; C < arguments.length; C += 2, g += 2) {
|
|
532
|
+
var w = arguments[C];
|
|
533
|
+
if (l)
|
|
534
|
+
h[g] = w;
|
|
535
|
+
else if (h[g] !== w)
|
|
701
536
|
break;
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
if (hadNoAttrs || attrsArr[j + 1] !== value) {
|
|
705
|
-
attrsArr[j + 1] = value;
|
|
706
|
-
updateAttribute(node, name, value);
|
|
707
|
-
}
|
|
537
|
+
var S = arguments[C + 1];
|
|
538
|
+
(l || h[g + 1] !== S) && (h[g + 1] = S, z(n, w, S));
|
|
708
539
|
}
|
|
709
|
-
if (
|
|
710
|
-
var
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
var name = arguments[i];
|
|
716
|
-
var value = arguments[i + 1];
|
|
717
|
-
if (prevAttrsMap[name] !== value) {
|
|
718
|
-
updateAttribute(node, name, value);
|
|
719
|
-
}
|
|
720
|
-
attrsArr[j] = name;
|
|
721
|
-
attrsArr[j + 1] = value;
|
|
722
|
-
delete prevAttrsMap[name];
|
|
540
|
+
if (C < arguments.length || g < h.length) {
|
|
541
|
+
for (var V = g; g < h.length; g += 2)
|
|
542
|
+
x[h[g]] = h[g + 1];
|
|
543
|
+
for (g = V; C < arguments.length; C += 2, g += 2) {
|
|
544
|
+
var w = arguments[C], S = arguments[C + 1];
|
|
545
|
+
x[w] !== S && z(n, w, S), h[g] = w, h[g + 1] = S, delete x[w];
|
|
723
546
|
}
|
|
724
|
-
|
|
725
|
-
for (var
|
|
726
|
-
|
|
727
|
-
delete prevAttrsMap[name];
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
return node;
|
|
731
|
-
}
|
|
732
|
-
function elementOpenStart(nameOrCtor, key2, statics) {
|
|
733
|
-
var argsBuilder2 = getArgsBuilder();
|
|
734
|
-
argsBuilder2[0] = nameOrCtor;
|
|
735
|
-
argsBuilder2[1] = key2;
|
|
736
|
-
argsBuilder2[2] = statics;
|
|
737
|
-
}
|
|
738
|
-
function key(key2) {
|
|
739
|
-
var argsBuilder2 = getArgsBuilder();
|
|
740
|
-
argsBuilder2[1] = key2;
|
|
741
|
-
}
|
|
742
|
-
function attr(name, value) {
|
|
743
|
-
var argsBuilder2 = getArgsBuilder();
|
|
744
|
-
argsBuilder2.push(name);
|
|
745
|
-
argsBuilder2.push(value);
|
|
746
|
-
}
|
|
747
|
-
function elementOpenEnd() {
|
|
748
|
-
var argsBuilder2 = getArgsBuilder();
|
|
749
|
-
var node = elementOpen.apply(null, argsBuilder2);
|
|
750
|
-
truncateArray(argsBuilder2, 0);
|
|
751
|
-
return node;
|
|
752
|
-
}
|
|
753
|
-
function elementClose(nameOrCtor) {
|
|
754
|
-
var node = close();
|
|
755
|
-
return node;
|
|
756
|
-
}
|
|
757
|
-
function elementVoid(nameOrCtor, key2, statics) {
|
|
758
|
-
var varArgs = [];
|
|
759
|
-
for (var _i = 3; _i < arguments.length; _i++) {
|
|
760
|
-
varArgs[_i - 3] = arguments[_i];
|
|
547
|
+
ge(h, g);
|
|
548
|
+
for (var w in x)
|
|
549
|
+
z(n, w, void 0), delete x[w];
|
|
761
550
|
}
|
|
762
|
-
|
|
763
|
-
return elementClose();
|
|
551
|
+
return n;
|
|
764
552
|
}
|
|
765
|
-
function
|
|
766
|
-
var
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
var
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
553
|
+
function qt(e, t, s) {
|
|
554
|
+
var n = ne();
|
|
555
|
+
process.env.NODE_ENV !== "production" && (B("elementOpenStart"), M(!0)), n[0] = e, n[1] = t, n[2] = s;
|
|
556
|
+
}
|
|
557
|
+
function Gt(e) {
|
|
558
|
+
var t = ne();
|
|
559
|
+
process.env.NODE_ENV !== "production" && (me("key"), se(t)), t[1] = e;
|
|
560
|
+
}
|
|
561
|
+
function Xt(e, t) {
|
|
562
|
+
var s = ne();
|
|
563
|
+
process.env.NODE_ENV !== "production" && me("attr"), s.push(e), s.push(t);
|
|
564
|
+
}
|
|
565
|
+
function Kt() {
|
|
566
|
+
var e = ne();
|
|
567
|
+
process.env.NODE_ENV !== "production" && (me("elementOpenEnd"), M(!1)), se(e);
|
|
568
|
+
var t = Ce.apply(null, e);
|
|
569
|
+
return ge(e, 0), t;
|
|
570
|
+
}
|
|
571
|
+
function Qe(e) {
|
|
572
|
+
process.env.NODE_ENV !== "production" && B("elementClose");
|
|
573
|
+
var t = Ke();
|
|
574
|
+
return process.env.NODE_ENV !== "production" && Ct($(t).nameOrCtor, e), t;
|
|
575
|
+
}
|
|
576
|
+
function Qt(e, t, s) {
|
|
577
|
+
return Ce.apply(null, arguments), Qe(e);
|
|
578
|
+
}
|
|
579
|
+
function Zt(e) {
|
|
580
|
+
process.env.NODE_ENV !== "production" && (B("text"), $e("text"));
|
|
581
|
+
var t = Ut(), s = $(t);
|
|
582
|
+
if (s.text !== e) {
|
|
583
|
+
s.text = e;
|
|
584
|
+
for (var n = e, i = 1; i < arguments.length; i += 1) {
|
|
585
|
+
var r = arguments[i];
|
|
586
|
+
n = r(n);
|
|
778
587
|
}
|
|
779
|
-
|
|
588
|
+
t.data = n;
|
|
780
589
|
}
|
|
781
|
-
return
|
|
590
|
+
return t;
|
|
782
591
|
}
|
|
783
592
|
/**
|
|
784
593
|
* @license
|
|
@@ -796,799 +605,807 @@ function text$1(value) {
|
|
|
796
605
|
* See the License for the specific language governing permissions and
|
|
797
606
|
* limitations under the License.
|
|
798
607
|
*/
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
var
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
var
|
|
819
|
-
|
|
820
|
-
var
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
theI18n = i18n;
|
|
839
|
-
}
|
|
840
|
-
function getI18n() {
|
|
841
|
-
return theI18n;
|
|
842
|
-
}
|
|
843
|
-
const SYMBOL_COMPONENT_META = Symbol("ComponentMetadata");
|
|
844
|
-
const Metadata = Object.freeze({
|
|
845
|
-
has(target, key2) {
|
|
846
|
-
return Boolean(target[SYMBOL_COMPONENT_META] && Object.prototype.hasOwnProperty.call(target[SYMBOL_COMPONENT_META], key2));
|
|
608
|
+
d.applyAttr = Fe;
|
|
609
|
+
d.applyProp = Re;
|
|
610
|
+
d.attributes = W;
|
|
611
|
+
d.close = Ke;
|
|
612
|
+
var we = d.currentElement = zt, le = d.currentPointer = Wt;
|
|
613
|
+
d.open = Xe;
|
|
614
|
+
var Jt = d.patch = We;
|
|
615
|
+
d.patchInner = We;
|
|
616
|
+
d.patchOuter = $t;
|
|
617
|
+
d.skip = Ht;
|
|
618
|
+
var ce = d.skipNode = be;
|
|
619
|
+
d.getKey = kt;
|
|
620
|
+
d.clearCache = Ue;
|
|
621
|
+
d.importNode = je;
|
|
622
|
+
d.isDataInitialized = It;
|
|
623
|
+
d.notifications = U;
|
|
624
|
+
d.symbols = fe;
|
|
625
|
+
var De = d.attr = Xt, Yt = d.elementClose = Qe;
|
|
626
|
+
d.elementOpen = Ce;
|
|
627
|
+
var Mt = d.elementOpenEnd = Kt, es = d.elementOpenStart = qt;
|
|
628
|
+
d.elementVoid = Qt;
|
|
629
|
+
var ts = d.text = Zt;
|
|
630
|
+
d.key = Gt;
|
|
631
|
+
function Pe(e) {
|
|
632
|
+
let t = le();
|
|
633
|
+
return t instanceof Comment && t.data !== e ? t.data = e : (t = document.createComment(e), we().appendChild(t)), ce(), t;
|
|
634
|
+
}
|
|
635
|
+
let Ze = at;
|
|
636
|
+
function Ns(e) {
|
|
637
|
+
Ze = e;
|
|
638
|
+
}
|
|
639
|
+
function ss() {
|
|
640
|
+
return Ze;
|
|
641
|
+
}
|
|
642
|
+
const I = Symbol("ComponentMetadata"), N = Object.freeze({
|
|
643
|
+
has(e, t) {
|
|
644
|
+
return Boolean(
|
|
645
|
+
e[I] && Object.prototype.hasOwnProperty.call(e[I], t)
|
|
646
|
+
);
|
|
847
647
|
},
|
|
848
|
-
add(
|
|
849
|
-
|
|
850
|
-
Object.assign(target[SYMBOL_COMPONENT_META], metadata);
|
|
851
|
-
} else {
|
|
852
|
-
target[SYMBOL_COMPONENT_META] = metadata;
|
|
853
|
-
}
|
|
648
|
+
add(e, t) {
|
|
649
|
+
e[I] ? Object.assign(e[I], t) : e[I] = t;
|
|
854
650
|
},
|
|
855
|
-
get(
|
|
856
|
-
return
|
|
857
|
-
}
|
|
858
|
-
});
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
if (ptr === null) {
|
|
874
|
-
const ce = currentElement_1();
|
|
875
|
-
for (let i = 0; i < child.length; i += 1) {
|
|
876
|
-
if (!ce.contains(child[i])) {
|
|
877
|
-
ce.appendChild(child[i]);
|
|
878
|
-
}
|
|
879
|
-
skipNode();
|
|
880
|
-
}
|
|
651
|
+
get(e, t, s) {
|
|
652
|
+
return e[I] && e[I][t] || s;
|
|
653
|
+
}
|
|
654
|
+
}), Ee = Symbol("ds-web-components:pragma:listeners-attached"), Je = "idom-pragma:content-begin", pe = "idom-pragma:content-end";
|
|
655
|
+
function de(e) {
|
|
656
|
+
for (const t of e)
|
|
657
|
+
if (typeof t == "function")
|
|
658
|
+
t();
|
|
659
|
+
else if (typeof t == "string")
|
|
660
|
+
ts(t);
|
|
661
|
+
else if (t instanceof Set)
|
|
662
|
+
de(Array.from(t));
|
|
663
|
+
else if (Array.isArray(t) && t.length > 0) {
|
|
664
|
+
let s = le();
|
|
665
|
+
if (Pe(Je), s === null) {
|
|
666
|
+
const n = we();
|
|
667
|
+
for (let i = 0; i < t.length; i += 1)
|
|
668
|
+
n.contains(t[i]) || n.appendChild(t[i]), ce();
|
|
881
669
|
}
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}
|
|
886
|
-
comment(MARK_CONTENT_END);
|
|
670
|
+
for (; s && s.data !== pe; )
|
|
671
|
+
ce(), s = le();
|
|
672
|
+
Pe(pe);
|
|
887
673
|
}
|
|
888
|
-
}
|
|
889
674
|
}
|
|
890
|
-
function
|
|
891
|
-
if (
|
|
892
|
-
for (const
|
|
893
|
-
if (
|
|
894
|
-
return () =>
|
|
895
|
-
}
|
|
896
|
-
}
|
|
675
|
+
function o(e, t, ...s) {
|
|
676
|
+
if (t) {
|
|
677
|
+
for (const n of Object.keys(t))
|
|
678
|
+
if (n.toUpperCase() === "DATA-FRAGMENT")
|
|
679
|
+
return () => de(s);
|
|
897
680
|
}
|
|
898
681
|
return () => {
|
|
899
|
-
|
|
900
|
-
const
|
|
901
|
-
if (
|
|
902
|
-
for (const
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
elementOpenEnd_1(tagName);
|
|
913
|
-
const ce = currentElement_1();
|
|
914
|
-
if (!ce[SYMBOL_LISTENERS_ATTACHED]) {
|
|
915
|
-
for (const key2 of eventListenerKeys) {
|
|
916
|
-
ce.addEventListener(key2.substr(2).toLowerCase(), attrs[key2]);
|
|
917
|
-
}
|
|
918
|
-
ce[SYMBOL_LISTENERS_ATTACHED] = true;
|
|
919
|
-
}
|
|
920
|
-
handleChildren(children);
|
|
921
|
-
elementClose_1(tagName);
|
|
682
|
+
es(e);
|
|
683
|
+
const n = [];
|
|
684
|
+
if (t)
|
|
685
|
+
for (const r of Object.keys(t))
|
|
686
|
+
r.toUpperCase() === "CLASSNAME" ? De("class", t[r]) : /^on[A-Z]/.test(r) ? n.push(r) : De(r, t[r]);
|
|
687
|
+
Mt(e);
|
|
688
|
+
const i = we();
|
|
689
|
+
if (!i[Ee]) {
|
|
690
|
+
for (const r of n)
|
|
691
|
+
i.addEventListener(r.substr(2).toLowerCase(), t[r]);
|
|
692
|
+
i[Ee] = !0;
|
|
693
|
+
}
|
|
694
|
+
de(s), Yt(e);
|
|
922
695
|
};
|
|
923
696
|
}
|
|
924
|
-
function
|
|
925
|
-
|
|
926
|
-
customElements.define(tag, Component2);
|
|
927
|
-
}
|
|
697
|
+
function Ye(e, t) {
|
|
698
|
+
customElements.get(e) || customElements.define(e, t);
|
|
928
699
|
}
|
|
929
|
-
function
|
|
930
|
-
for (const
|
|
931
|
-
|
|
932
|
-
}
|
|
700
|
+
function xs(...e) {
|
|
701
|
+
for (const t of e)
|
|
702
|
+
Ye(N.get(t, "tag"), t);
|
|
933
703
|
}
|
|
934
|
-
function
|
|
935
|
-
return function
|
|
936
|
-
for (const
|
|
937
|
-
const
|
|
938
|
-
|
|
704
|
+
function ys(e) {
|
|
705
|
+
return function(...s) {
|
|
706
|
+
for (const n of s) {
|
|
707
|
+
const i = `${e}${N.get(n, "tag").substr(3)}`;
|
|
708
|
+
Ye(i, n);
|
|
939
709
|
}
|
|
940
710
|
};
|
|
941
711
|
}
|
|
942
|
-
const
|
|
943
|
-
|
|
944
|
-
const StyleBindings = Symbol("Component Style Bindings");
|
|
945
|
-
const ext = {
|
|
946
|
-
__initialized: false,
|
|
712
|
+
const Ie = Symbol("Component Attribute Bindings"), T = Symbol("Component Class Bindings"), he = Symbol("Component Style Bindings"), ns = {
|
|
713
|
+
__initialized: !1,
|
|
947
714
|
__observer: null,
|
|
948
715
|
__queuedUpdate: null,
|
|
949
|
-
__managedClasses: new Set(),
|
|
716
|
+
__managedClasses: /* @__PURE__ */ new Set(),
|
|
950
717
|
__updateHostBindings() {
|
|
951
|
-
const
|
|
952
|
-
for (const
|
|
953
|
-
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
for (const
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
self.__managedClasses.add(className);
|
|
963
|
-
self.classList.add(className);
|
|
964
|
-
}
|
|
965
|
-
for (const className of (self.getAttribute("classname") || "").split(/\w+/).filter(Boolean)) {
|
|
966
|
-
self.classList.add(className);
|
|
967
|
-
}
|
|
718
|
+
const e = this;
|
|
719
|
+
for (const t of Object.keys(e[Ie] || {}))
|
|
720
|
+
e.setAttribute(t, e[Ie][t]);
|
|
721
|
+
for (const t of Object.keys(e[he] || {}))
|
|
722
|
+
e.style[t] = e[he][t];
|
|
723
|
+
for (const t of e.__managedClasses)
|
|
724
|
+
e.classList.remove(t);
|
|
725
|
+
for (const t of (e[T] || []).filter(Boolean))
|
|
726
|
+
e.__managedClasses.add(t), e.classList.add(t);
|
|
727
|
+
for (const t of (e.getAttribute("classname") || "").split(/\w+/).filter(Boolean))
|
|
728
|
+
e.classList.add(t);
|
|
968
729
|
},
|
|
969
|
-
__updateChildQueries(
|
|
970
|
-
const
|
|
971
|
-
for (const
|
|
972
|
-
if (!
|
|
973
|
-
const
|
|
974
|
-
|
|
730
|
+
__updateChildQueries(e) {
|
|
731
|
+
const t = this;
|
|
732
|
+
for (const s of N.get(t.constructor, "childQueries", []))
|
|
733
|
+
if (!e || e && s.refresh) {
|
|
734
|
+
const n = s.all ? t.querySelectorAll : t.querySelector;
|
|
735
|
+
t[s.key] = n.call(t, s.selector);
|
|
975
736
|
}
|
|
976
|
-
}
|
|
977
737
|
},
|
|
978
738
|
__gatherChildren() {
|
|
979
|
-
const
|
|
980
|
-
let
|
|
981
|
-
let
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
if (contentStartIndex === null) {
|
|
994
|
-
for (const node of childNodes) {
|
|
995
|
-
node.parentNode.removeChild(node);
|
|
996
|
-
}
|
|
997
|
-
} else {
|
|
998
|
-
childNodes = childNodes.slice(contentStartIndex, contentEndIndex);
|
|
999
|
-
}
|
|
1000
|
-
if (Metadata.has(self.constructor, "contentProp")) {
|
|
1001
|
-
self[Metadata.get(self.constructor, "contentProp")] = childNodes;
|
|
1002
|
-
}
|
|
739
|
+
const e = this;
|
|
740
|
+
let t = Array.from(e.childNodes), s = null, n = t.length;
|
|
741
|
+
for (let i = 0; i < t.length; i += 1) {
|
|
742
|
+
const r = t[i];
|
|
743
|
+
r instanceof Comment && (r.data === Je ? s = i + 1 : r.data === pe && (n = i - 1));
|
|
744
|
+
}
|
|
745
|
+
if (s === null)
|
|
746
|
+
for (const i of t)
|
|
747
|
+
i.parentNode.removeChild(i);
|
|
748
|
+
else
|
|
749
|
+
t = t.slice(s, n);
|
|
750
|
+
N.has(e.constructor, "contentProp") && (e[N.get(e.constructor, "contentProp")] = t);
|
|
1003
751
|
},
|
|
1004
752
|
__startMutObs() {
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
self.contentChangedCallback();
|
|
1010
|
-
}
|
|
1011
|
-
self.__gatherChildren();
|
|
1012
|
-
self.update();
|
|
1013
|
-
});
|
|
1014
|
-
}
|
|
1015
|
-
self.__observer.observe(self, { childList: true });
|
|
753
|
+
const e = this;
|
|
754
|
+
e.__observer || (e.__observer = new MutationObserver(() => {
|
|
755
|
+
e.contentChangedCallback && e.contentChangedCallback(), e.__gatherChildren(), e.update();
|
|
756
|
+
})), e.__observer.observe(e, { childList: !0 });
|
|
1016
757
|
},
|
|
1017
758
|
__stopMutObs() {
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1020
|
-
self.__observer.disconnect();
|
|
1021
|
-
}
|
|
759
|
+
const e = this;
|
|
760
|
+
e.__observer && e.__observer.disconnect();
|
|
1022
761
|
},
|
|
1023
762
|
__doRender() {
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1026
|
-
patch(self, self.render(getI18n()));
|
|
1027
|
-
self.__startMutObs();
|
|
763
|
+
const e = this;
|
|
764
|
+
e.__stopMutObs(), Jt(e, e.render(ss())), e.__startMutObs();
|
|
1028
765
|
},
|
|
1029
766
|
update() {
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
self.__updateHostBindings();
|
|
1037
|
-
}, 0);
|
|
1038
|
-
self.__queuedUpdate = null;
|
|
1039
|
-
});
|
|
1040
|
-
}
|
|
767
|
+
const e = this;
|
|
768
|
+
e.__initialized && !e.__queuedUpdate && (e.__queuedUpdate = window.requestAnimationFrame(() => {
|
|
769
|
+
e.__doRender(), setTimeout(() => {
|
|
770
|
+
e.__updateChildQueries(!0), e.__updateHostBindings();
|
|
771
|
+
}, 0), e.__queuedUpdate = null;
|
|
772
|
+
}));
|
|
1041
773
|
},
|
|
1042
|
-
attributeChangedCallback(
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1045
|
-
if (value !== oldValue) {
|
|
1046
|
-
if (self.__cbAttributeChanged) {
|
|
1047
|
-
self.__cbAttributeChanged(key2, self[key2], value);
|
|
1048
|
-
}
|
|
1049
|
-
if (key2 !== "style") {
|
|
1050
|
-
self[key2] = value;
|
|
1051
|
-
}
|
|
1052
|
-
if (self.__initialized) {
|
|
1053
|
-
self.update();
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
774
|
+
attributeChangedCallback(e, t, s) {
|
|
775
|
+
const n = this, i = s === "" ? !0 : s;
|
|
776
|
+
i !== t && (n.__cbAttributeChanged && n.__cbAttributeChanged(e, n[e], i), e !== "style" && (n[e] = i), n.__initialized && n.update());
|
|
1056
777
|
},
|
|
1057
778
|
connectedCallback() {
|
|
1058
|
-
const
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
}
|
|
1062
|
-
const listeners = Metadata.get(self.constructor, "eventListeners", []);
|
|
779
|
+
const e = this;
|
|
780
|
+
e.__cbConnected && e.__cbConnected();
|
|
781
|
+
const t = N.get(e.constructor, "eventListeners", []);
|
|
1063
782
|
setTimeout(() => {
|
|
1064
|
-
if (!
|
|
1065
|
-
|
|
1066
|
-
for (const [,
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
self.__initialized = true;
|
|
1070
|
-
}
|
|
1071
|
-
for (const [eventName, key2] of listeners) {
|
|
1072
|
-
self.addEventListener(eventName, self[key2]);
|
|
783
|
+
if (!e.__initialized) {
|
|
784
|
+
e.__gatherChildren();
|
|
785
|
+
for (const [, s] of t)
|
|
786
|
+
e[s] = e[s].bind(e);
|
|
787
|
+
e.__initialized = !0;
|
|
1073
788
|
}
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
789
|
+
for (const [s, n] of t)
|
|
790
|
+
e.addEventListener(s, e[n]);
|
|
791
|
+
e.__doRender(), setTimeout(() => {
|
|
792
|
+
e.__updateChildQueries(), e.__updateHostBindings();
|
|
1078
793
|
}, 0);
|
|
1079
794
|
}, 0);
|
|
1080
795
|
},
|
|
1081
796
|
disconnectedCallback() {
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
self.removeEventListener(eventName, self[key2]);
|
|
1088
|
-
}
|
|
1089
|
-
self.__stopMutObs();
|
|
797
|
+
const e = this;
|
|
798
|
+
e.__cbDisconnected && e.__cbDisconnected();
|
|
799
|
+
for (const [t, s] of N.get(e.constructor, "eventListeners", []))
|
|
800
|
+
e.removeEventListener(t, e[s]);
|
|
801
|
+
e.__stopMutObs();
|
|
1090
802
|
}
|
|
1091
803
|
};
|
|
1092
|
-
function
|
|
1093
|
-
return (
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
}, ext);
|
|
804
|
+
function j(e) {
|
|
805
|
+
return (t) => {
|
|
806
|
+
N.add(t, e), Object.assign(t.prototype, {
|
|
807
|
+
__cbAttributeChanged: t.prototype.attributeChangedCallback,
|
|
808
|
+
__cbConnected: t.prototype.connectedCallback,
|
|
809
|
+
__cbDisconnected: t.prototype.disconnectedCallback
|
|
810
|
+
}, ns);
|
|
1100
811
|
};
|
|
1101
812
|
}
|
|
1102
|
-
function
|
|
1103
|
-
return (
|
|
1104
|
-
|
|
813
|
+
function _e() {
|
|
814
|
+
return (e, t) => {
|
|
815
|
+
N.add(e.constructor, { contentProp: t });
|
|
1105
816
|
};
|
|
1106
817
|
}
|
|
1107
|
-
function
|
|
1108
|
-
return (
|
|
1109
|
-
Object.defineProperty(
|
|
818
|
+
function Ne(e) {
|
|
819
|
+
return (t, s) => {
|
|
820
|
+
Object.defineProperty(t, s, {
|
|
1110
821
|
get() {
|
|
1111
|
-
Object.defineProperty(this,
|
|
822
|
+
return Object.defineProperty(this, s, {
|
|
1112
823
|
value: {
|
|
1113
|
-
dispatch: (
|
|
1114
|
-
const
|
|
1115
|
-
this.dispatchEvent(
|
|
1116
|
-
return event;
|
|
824
|
+
dispatch: (n) => {
|
|
825
|
+
const i = new CustomEvent(e || s, { detail: n });
|
|
826
|
+
return this.dispatchEvent(i), i;
|
|
1117
827
|
}
|
|
1118
828
|
}
|
|
1119
|
-
});
|
|
1120
|
-
return this[key2];
|
|
829
|
+
}), this[s];
|
|
1121
830
|
},
|
|
1122
|
-
configurable:
|
|
831
|
+
configurable: !0
|
|
1123
832
|
});
|
|
1124
833
|
};
|
|
1125
834
|
}
|
|
1126
|
-
function
|
|
1127
|
-
return (
|
|
1128
|
-
const
|
|
1129
|
-
|
|
1130
|
-
Metadata.add(target.constructor, { eventListeners });
|
|
835
|
+
function re(e) {
|
|
836
|
+
return (t, s) => {
|
|
837
|
+
const n = N.get(t.constructor, "eventListeners", []);
|
|
838
|
+
n.push([e, s]), N.add(t.constructor, { eventListeners: n });
|
|
1131
839
|
};
|
|
1132
840
|
}
|
|
1133
|
-
function
|
|
1134
|
-
return (
|
|
1135
|
-
const
|
|
1136
|
-
|
|
1137
|
-
c.observedAttributes = c.observedAttributes || [
|
|
841
|
+
function p(e) {
|
|
842
|
+
return (t, s) => {
|
|
843
|
+
const n = t.constructor, i = s.toLowerCase();
|
|
844
|
+
if (n.observedAttributes = n.observedAttributes || [
|
|
1138
845
|
"classname",
|
|
1139
846
|
"className",
|
|
1140
847
|
"style"
|
|
1141
|
-
]
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
}
|
|
1152
|
-
});
|
|
1153
|
-
}
|
|
1154
|
-
if (castToType) {
|
|
1155
|
-
const privateKey = Symbol.for(key2);
|
|
1156
|
-
Object.defineProperty(target, keyLowercase, {
|
|
848
|
+
], n.observedAttributes.push(s), n.observedAttributes.push(i), i !== s && Object.defineProperty(t, s, {
|
|
849
|
+
get() {
|
|
850
|
+
return this[i];
|
|
851
|
+
},
|
|
852
|
+
set(r) {
|
|
853
|
+
this[i] = r;
|
|
854
|
+
}
|
|
855
|
+
}), e) {
|
|
856
|
+
const r = Symbol.for(s);
|
|
857
|
+
Object.defineProperty(t, i, {
|
|
1157
858
|
get() {
|
|
1158
|
-
return this[
|
|
859
|
+
return this[r];
|
|
1159
860
|
},
|
|
1160
|
-
set(
|
|
1161
|
-
let
|
|
1162
|
-
|
|
1163
|
-
castValue = false;
|
|
1164
|
-
} else {
|
|
1165
|
-
castValue = castToType(newValue);
|
|
1166
|
-
}
|
|
1167
|
-
this[privateKey] = castValue;
|
|
861
|
+
set(l) {
|
|
862
|
+
let h = l;
|
|
863
|
+
e === Boolean && typeof l == "string" && l.toLowerCase() === "false" ? h = !1 : h = e(l), this[r] = h;
|
|
1168
864
|
}
|
|
1169
865
|
});
|
|
1170
866
|
}
|
|
1171
867
|
};
|
|
1172
868
|
}
|
|
1173
|
-
function
|
|
1174
|
-
return (
|
|
1175
|
-
const
|
|
1176
|
-
|
|
1177
|
-
key:
|
|
1178
|
-
selector,
|
|
1179
|
-
all,
|
|
1180
|
-
refresh:
|
|
1181
|
-
});
|
|
1182
|
-
Metadata.add(target.constructor, { childQueries });
|
|
869
|
+
function Me(e, t, s) {
|
|
870
|
+
return (n, i) => {
|
|
871
|
+
const r = N.get(n.constructor, "childQueries", []);
|
|
872
|
+
r.push({
|
|
873
|
+
key: i,
|
|
874
|
+
selector: e,
|
|
875
|
+
all: s,
|
|
876
|
+
refresh: t.refresh
|
|
877
|
+
}), N.add(n.constructor, { childQueries: r });
|
|
1183
878
|
};
|
|
1184
879
|
}
|
|
1185
|
-
function
|
|
1186
|
-
return
|
|
1187
|
-
}
|
|
1188
|
-
function
|
|
1189
|
-
return
|
|
1190
|
-
}
|
|
1191
|
-
function
|
|
1192
|
-
return (
|
|
1193
|
-
const
|
|
1194
|
-
Object.defineProperties(
|
|
1195
|
-
[
|
|
1196
|
-
writable:
|
|
1197
|
-
enumerable:
|
|
1198
|
-
configurable:
|
|
1199
|
-
value:
|
|
880
|
+
function xe(e, t = {}) {
|
|
881
|
+
return Me(e, t);
|
|
882
|
+
}
|
|
883
|
+
function is(e, t = {}) {
|
|
884
|
+
return Me(e, t, !0);
|
|
885
|
+
}
|
|
886
|
+
function et() {
|
|
887
|
+
return (e, t) => {
|
|
888
|
+
const s = Symbol(t);
|
|
889
|
+
Object.defineProperties(e, {
|
|
890
|
+
[s]: {
|
|
891
|
+
writable: !0,
|
|
892
|
+
enumerable: !1,
|
|
893
|
+
configurable: !1,
|
|
894
|
+
value: e[t]
|
|
1200
895
|
},
|
|
1201
|
-
[
|
|
896
|
+
[t]: {
|
|
1202
897
|
get() {
|
|
1203
|
-
return this[
|
|
898
|
+
return this[s];
|
|
1204
899
|
},
|
|
1205
|
-
set(
|
|
1206
|
-
|
|
1207
|
-
this[privateKey] = newValue;
|
|
1208
|
-
this.update();
|
|
1209
|
-
}
|
|
900
|
+
set(n) {
|
|
901
|
+
this[s] !== n && (this[s] = n, this.update());
|
|
1210
902
|
}
|
|
1211
903
|
}
|
|
1212
904
|
});
|
|
1213
905
|
};
|
|
1214
906
|
}
|
|
1215
|
-
var
|
|
1216
|
-
(
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
MIMEType2["BIN"] = "application/octet-stream";
|
|
1224
|
-
MIMEType2["BMP"] = "image/bmp";
|
|
1225
|
-
MIMEType2["BZ"] = "application/x-bzip";
|
|
1226
|
-
MIMEType2["BZ2"] = "application/x-bzip2";
|
|
1227
|
-
MIMEType2["CSH"] = "application/x-csh";
|
|
1228
|
-
MIMEType2["CSS"] = "text/css";
|
|
1229
|
-
MIMEType2["CSV"] = "text/csv,application/vnd.ms-excel";
|
|
1230
|
-
MIMEType2["DOC"] = "application/msword";
|
|
1231
|
-
MIMEType2["DOCX"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
1232
|
-
MIMEType2["EOT"] = "application/vnd.ms-fontobject";
|
|
1233
|
-
MIMEType2["EPUB"] = "application/epub+zip";
|
|
1234
|
-
MIMEType2["ES"] = "application/ecmascript";
|
|
1235
|
-
MIMEType2["FLV"] = "video/x-flv";
|
|
1236
|
-
MIMEType2["GIF"] = "image/gif";
|
|
1237
|
-
MIMEType2["GZ"] = "application/x-gzip";
|
|
1238
|
-
MIMEType2["HTM"] = "text/html";
|
|
1239
|
-
MIMEType2["HTML"] = "text/html";
|
|
1240
|
-
MIMEType2["ICO"] = "image/x-icon";
|
|
1241
|
-
MIMEType2["ICS"] = "text/calendar";
|
|
1242
|
-
MIMEType2["JAR"] = "application/java-archive";
|
|
1243
|
-
MIMEType2["JPEG"] = "image/jpeg";
|
|
1244
|
-
MIMEType2["JPG"] = "image/jpeg";
|
|
1245
|
-
MIMEType2["JS"] = "application/javascript";
|
|
1246
|
-
MIMEType2["JSON"] = "application/json";
|
|
1247
|
-
MIMEType2["M3U"] = "audio/x-mpequrl";
|
|
1248
|
-
MIMEType2["MID"] = "audio/midi";
|
|
1249
|
-
MIMEType2["MIDI"] = "audio/midi";
|
|
1250
|
-
MIMEType2["MOV"] = "video/quicktime";
|
|
1251
|
-
MIMEType2["MP3"] = "audio/mpeg3";
|
|
1252
|
-
MIMEType2["MP4"] = "video/mp4";
|
|
1253
|
-
MIMEType2["MPEG"] = "video/mpeg";
|
|
1254
|
-
MIMEType2["MPKG"] = "application/vnd.apple.installer+xml";
|
|
1255
|
-
MIMEType2["ODP"] = "application/vnd.oasis.opendocument.presentation";
|
|
1256
|
-
MIMEType2["ODS"] = "application/vnd.oasis.opendocument.spreadsheet";
|
|
1257
|
-
MIMEType2["ODT"] = "application/vnd.oasis.opendocument.text";
|
|
1258
|
-
MIMEType2["OGA"] = "audio/ogg";
|
|
1259
|
-
MIMEType2["OGV"] = "video/ogg";
|
|
1260
|
-
MIMEType2["OGX"] = "application/ogg";
|
|
1261
|
-
MIMEType2["OTF"] = "font/otf";
|
|
1262
|
-
MIMEType2["PNG"] = "image/png";
|
|
1263
|
-
MIMEType2["PDF"] = "application/pdf";
|
|
1264
|
-
MIMEType2["PPT"] = "application/vnd.ms-powerpoint";
|
|
1265
|
-
MIMEType2["PPTX"] = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
1266
|
-
MIMEType2["RAR"] = "application/x-rar-compressed";
|
|
1267
|
-
MIMEType2["RTF"] = "application/rtf";
|
|
1268
|
-
MIMEType2["SH"] = "application/x-sh";
|
|
1269
|
-
MIMEType2["SVG"] = "image/svg+xml";
|
|
1270
|
-
MIMEType2["SWF"] = "application/x-shockwave-flash";
|
|
1271
|
-
MIMEType2["TAR"] = "application/x-tar";
|
|
1272
|
-
MIMEType2["TIF"] = "image/tiff";
|
|
1273
|
-
MIMEType2["TIFF"] = "image/tiff";
|
|
1274
|
-
MIMEType2["TS"] = "application/typescript";
|
|
1275
|
-
MIMEType2["TTF"] = "font/ttf";
|
|
1276
|
-
MIMEType2["TXT"] = "text/plain";
|
|
1277
|
-
MIMEType2["VSD"] = "application/vnd.visio";
|
|
1278
|
-
MIMEType2["WAV"] = "audio/wav";
|
|
1279
|
-
MIMEType2["WEBA"] = "audio/webm";
|
|
1280
|
-
MIMEType2["WEBM"] = "video/webm";
|
|
1281
|
-
MIMEType2["WEBP"] = "image/webp";
|
|
1282
|
-
MIMEType2["WOFF"] = "font/woff";
|
|
1283
|
-
MIMEType2["WOFF2"] = "font/woff2";
|
|
1284
|
-
MIMEType2["XHTML"] = "application/xhtml+xml";
|
|
1285
|
-
MIMEType2["XLS"] = "application/vnd.ms-excel";
|
|
1286
|
-
MIMEType2["XLSX"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
1287
|
-
MIMEType2["XML"] = "application/xml";
|
|
1288
|
-
MIMEType2["XUL"] = "application/vnd.mozilla.xul+xml";
|
|
1289
|
-
MIMEType2["ZIP"] = "application/zip";
|
|
1290
|
-
})(MIMEType || (MIMEType = {}));
|
|
1291
|
-
var __defProp$5 = Object.defineProperty;
|
|
1292
|
-
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
1293
|
-
var __decorateClass$5 = (decorators, target, key2, kind) => {
|
|
1294
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key2) : target;
|
|
1295
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1296
|
-
if (decorator = decorators[i])
|
|
1297
|
-
result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
|
|
1298
|
-
if (kind && result)
|
|
1299
|
-
__defProp$5(target, key2, result);
|
|
1300
|
-
return result;
|
|
1301
|
-
};
|
|
1302
|
-
const CPT_NAME$3 = "sps-file-upload";
|
|
1303
|
-
let SpsFileUploadComponent = class extends HTMLElement {
|
|
907
|
+
var rs = Object.defineProperty, as = Object.getOwnPropertyDescriptor, E = (e, t, s, n) => {
|
|
908
|
+
for (var i = n > 1 ? void 0 : n ? as(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
909
|
+
(l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
|
|
910
|
+
return n && i && rs(t, s, i), i;
|
|
911
|
+
}, os = /* @__PURE__ */ ((e) => (e.FIT = "fit", e.FILL = "fill", e))(os || {});
|
|
912
|
+
const F = "sps-photo";
|
|
913
|
+
var q;
|
|
914
|
+
let O = (q = class extends HTMLElement {
|
|
1304
915
|
constructor() {
|
|
1305
|
-
super();
|
|
1306
|
-
this
|
|
1307
|
-
this
|
|
1308
|
-
this
|
|
1309
|
-
this
|
|
1310
|
-
this
|
|
1311
|
-
this
|
|
1312
|
-
this
|
|
1313
|
-
this
|
|
1314
|
-
this
|
|
1315
|
-
this.dismiss = this.dismiss.bind(this);
|
|
916
|
+
super(...arguments);
|
|
917
|
+
a(this, "src");
|
|
918
|
+
a(this, "altText");
|
|
919
|
+
a(this, "mode", "fill");
|
|
920
|
+
a(this, "placeholderIcon");
|
|
921
|
+
a(this, "width");
|
|
922
|
+
a(this, "fitWidth");
|
|
923
|
+
a(this, "imageInternal");
|
|
924
|
+
a(this, "waitForWidthInterval");
|
|
925
|
+
a(this, "waitForImgHeightInterval");
|
|
1316
926
|
}
|
|
1317
|
-
get
|
|
1318
|
-
return
|
|
1319
|
-
CPT_NAME$3,
|
|
1320
|
-
this.active && `${CPT_NAME$3}--active`,
|
|
1321
|
-
this.error && `${CPT_NAME$3}--error`,
|
|
1322
|
-
!this.shown && `${CPT_NAME$3}--hidden`,
|
|
1323
|
-
this.mini && `${CPT_NAME$3}--mini`,
|
|
1324
|
-
this.constrainContentWidth && `${CPT_NAME$3}--constrained-content-width`
|
|
1325
|
-
];
|
|
927
|
+
get image() {
|
|
928
|
+
return this.imageInternal;
|
|
1326
929
|
}
|
|
1327
|
-
|
|
1328
|
-
this.
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
930
|
+
set image(t) {
|
|
931
|
+
this.imageInternal = t, t && (this.waitForImgHeightInterval && window.clearInterval(this.waitForImgHeightInterval), this.waitForImgHeightInterval = window.setInterval(() => {
|
|
932
|
+
const s = t.getBoundingClientRect();
|
|
933
|
+
if (s.height) {
|
|
934
|
+
window.clearInterval(this.waitForImgHeightInterval), delete this.waitForImgHeightInterval;
|
|
935
|
+
let n = !0;
|
|
936
|
+
n = s.width / s.height > 1, this.fitWidth = n === (this.mode === "fit");
|
|
937
|
+
}
|
|
938
|
+
}, 1e3 / 60));
|
|
1335
939
|
}
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
}
|
|
940
|
+
get [T]() {
|
|
941
|
+
return [
|
|
942
|
+
F,
|
|
943
|
+
this.fitWidth ? `${F}--fit-width` : `${F}--fit-height`,
|
|
944
|
+
this.placeholderIcon && `${F}--placeholder`
|
|
945
|
+
];
|
|
1343
946
|
}
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
this.
|
|
1347
|
-
this.
|
|
1348
|
-
this.
|
|
1349
|
-
}
|
|
947
|
+
get [he]() {
|
|
948
|
+
return {
|
|
949
|
+
fontSize: `${this.width * 0.05}rem`,
|
|
950
|
+
width: `${this.width}rem`,
|
|
951
|
+
height: `${0.75 * this.width}rem`
|
|
952
|
+
};
|
|
1350
953
|
}
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
this.
|
|
1355
|
-
}
|
|
954
|
+
connectedCallback() {
|
|
955
|
+
this.waitForWidthInterval = window.setInterval(() => {
|
|
956
|
+
const t = this.getBoundingClientRect();
|
|
957
|
+
t.width && (this.setWidth(t.width), window.clearInterval(this.waitForWidthInterval), delete this.waitForWidthInterval);
|
|
958
|
+
}, 1e3 / 60);
|
|
1356
959
|
}
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
const instructions = (this.multiple ? t("design-system:fileUpload.instructions_plural") : t("design-system:fileUpload.instructions")).split("|");
|
|
1360
|
-
return /* @__PURE__ */ h("div", {
|
|
1361
|
-
"data-fragment": true
|
|
1362
|
-
}, /* @__PURE__ */ h("div", {
|
|
1363
|
-
className: `${CPT_NAME$3}__content`
|
|
1364
|
-
}, this.processing ? /* @__PURE__ */ h("div", {
|
|
1365
|
-
"data-fragment": true
|
|
1366
|
-
}, /* @__PURE__ */ h("i", {
|
|
1367
|
-
className: "sps-spinner sps-spinner--medium",
|
|
1368
|
-
"aria-hidden": "true"
|
|
1369
|
-
}), /* @__PURE__ */ h("div", {
|
|
1370
|
-
className: `${CPT_NAME$3}__instructions`
|
|
1371
|
-
}, t("design-system:fileUpload.processing"))) : /* @__PURE__ */ h("div", {
|
|
1372
|
-
"data-fragment": true
|
|
1373
|
-
}, /* @__PURE__ */ h("i", {
|
|
1374
|
-
className: `sps-icon sps-icon-${icon} ${CPT_NAME$3}__icon-primary`,
|
|
1375
|
-
"aria-hidden": "true"
|
|
1376
|
-
}), /* @__PURE__ */ h("div", {
|
|
1377
|
-
className: `${CPT_NAME$3}__title`
|
|
1378
|
-
}, this.error ? /* @__PURE__ */ h("div", {
|
|
1379
|
-
"data-fragment": true
|
|
1380
|
-
}, t(this.namesOfUnsupportedFiles.length > 1 ? "design-system:fileUpload.cancelled_plural" : "design-system:fileUpload.cancelled")) : /* @__PURE__ */ h("div", {
|
|
1381
|
-
"data-fragment": true
|
|
1382
|
-
}, t("design-system:fileUpload.title", { description: this.description }))), this.error ? /* @__PURE__ */ h("div", {
|
|
1383
|
-
className: `${CPT_NAME$3}__errored-files`
|
|
1384
|
-
}, new Set(this.namesOfUnsupportedFiles.map((name, i) => {
|
|
1385
|
-
const breakpoint = Math.floor(name.length / 2);
|
|
1386
|
-
return /* @__PURE__ */ h("div", {
|
|
1387
|
-
className: `${CPT_NAME$3}__errored-filename`,
|
|
1388
|
-
key: name
|
|
1389
|
-
}, /* @__PURE__ */ h("span", {
|
|
1390
|
-
className: `${CPT_NAME$3}__errored-filename-segment`
|
|
1391
|
-
}, name.substr(0, breakpoint)), /* @__PURE__ */ h("div", {
|
|
1392
|
-
className: `${CPT_NAME$3}__errored-filename-segment`
|
|
1393
|
-
}, /* @__PURE__ */ h("span", null, name.substr(breakpoint))), i < this.namesOfUnsupportedFiles.length - 1 ? "," : "");
|
|
1394
|
-
}))) : /* @__PURE__ */ h("span", null), /* @__PURE__ */ h("div", {
|
|
1395
|
-
className: `${CPT_NAME$3}__instructions`
|
|
1396
|
-
}, /* @__PURE__ */ h("div", {
|
|
1397
|
-
"data-fragment": true
|
|
1398
|
-
}, /* @__PURE__ */ h("span", null, instructions[0]), /* @__PURE__ */ h("a", {
|
|
1399
|
-
href: "",
|
|
1400
|
-
onClick: this.handleBrowseLinkClick
|
|
1401
|
-
}, instructions[1]), /* @__PURE__ */ h("span", null, instructions[2]))), /* @__PURE__ */ h("div", {
|
|
1402
|
-
className: `${CPT_NAME$3}__requirements`
|
|
1403
|
-
}, this.acceptExtensions ? /* @__PURE__ */ h("span", null, "(", " ", t("design-system:fileUpload.acceptedTypes", { fileTypes: this.acceptExtensionsDescription }), " ", ")") : "", this.maxSize ? /* @__PURE__ */ h("span", null, "(", " ", t("design-system:fileUpload.maximumSize", { size: this.maxSize }), " ", ")") : "", this.customRequirement ? /* @__PURE__ */ h("span", null, " ", this.customRequirement, " ") : ""), this.downloadLabel && /* @__PURE__ */ h("div", {
|
|
1404
|
-
className: `sps-button sps-button--link ${CPT_NAME$3}__download-button`,
|
|
1405
|
-
onClick: this.handleDownloadButtonClick
|
|
1406
|
-
}, /* @__PURE__ */ h("button", {
|
|
1407
|
-
type: "button"
|
|
1408
|
-
}, /* @__PURE__ */ h("i", {
|
|
1409
|
-
className: "sps-icon sps-icon-download-cloud",
|
|
1410
|
-
"aria-hidden": "true"
|
|
1411
|
-
}), " ", this.downloadLabel)))), this.dismissable && !this.processing && /* @__PURE__ */ h("div", {
|
|
1412
|
-
className: `sps-button sps-button--icon ${CPT_NAME$3}__close-button`,
|
|
1413
|
-
onClick: this.dismiss
|
|
1414
|
-
}, /* @__PURE__ */ h("button", {
|
|
1415
|
-
type: "button",
|
|
1416
|
-
title: t("design-system:fileUpload.close")
|
|
1417
|
-
}, /* @__PURE__ */ h("i", {
|
|
1418
|
-
className: "sps-icon sps-icon-x",
|
|
1419
|
-
"aria-hidden": "true"
|
|
1420
|
-
}))), /* @__PURE__ */ h("form", null, /* @__PURE__ */ h("input", {
|
|
1421
|
-
type: "file",
|
|
1422
|
-
accept: this.accept || "*/*",
|
|
1423
|
-
multiple: this.multiple || null,
|
|
1424
|
-
onChange: this.handleFileInputChange
|
|
1425
|
-
})));
|
|
960
|
+
disconnectedCallback() {
|
|
961
|
+
this.waitForWidthInterval && window.clearInterval(this.waitForWidthInterval), this.waitForImgHeightInterval && window.clearInterval(this.waitForImgHeightInterval);
|
|
1426
962
|
}
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
this.
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
963
|
+
render() {
|
|
964
|
+
return this.src ? this.width ? /* @__PURE__ */ o("img", {
|
|
965
|
+
src: this.src,
|
|
966
|
+
alt: this.altText
|
|
967
|
+
}) : /* @__PURE__ */ o("span", null) : /* @__PURE__ */ o("i", {
|
|
968
|
+
className: `sps-icon sps-icon-${this.placeholderIcon}`
|
|
969
|
+
});
|
|
1433
970
|
}
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
this.acceptExtensionsDescription = extList.map((ext2, i) => i > 0 && i === extList.length - 1 ? `or ${ext2}` : ext2).join(extList.length > 2 ? ", " : " ");
|
|
1439
|
-
this.acceptMIMETypes.clear();
|
|
1440
|
-
for (const ext2 of trimmedExtensions) {
|
|
1441
|
-
for (const type of MIMEType[ext2.toUpperCase()].split(",")) {
|
|
1442
|
-
this.acceptMIMETypes.add(type);
|
|
1443
|
-
}
|
|
971
|
+
setWidth(t) {
|
|
972
|
+
if (t && !this.width) {
|
|
973
|
+
const s = document.body.parentElement.style.fontSize || "16px", n = Number(s.substr(0, s.length - 2));
|
|
974
|
+
this.width = t / n;
|
|
1444
975
|
}
|
|
1445
|
-
this.accept = extList.concat(Array.from(this.acceptMIMETypes)).join(",");
|
|
1446
976
|
}
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
977
|
+
}, a(q, "displayName", F), a(q, "props", {
|
|
978
|
+
src: "string",
|
|
979
|
+
altText: "string",
|
|
980
|
+
mode: "SpsPhotoDisplayMode",
|
|
981
|
+
placeholderIcon: "SpsIcon"
|
|
982
|
+
}), q);
|
|
983
|
+
E([
|
|
984
|
+
p()
|
|
985
|
+
], O.prototype, "src", 2);
|
|
986
|
+
E([
|
|
987
|
+
p()
|
|
988
|
+
], O.prototype, "altText", 2);
|
|
989
|
+
E([
|
|
990
|
+
p()
|
|
991
|
+
], O.prototype, "mode", 2);
|
|
992
|
+
E([
|
|
993
|
+
p()
|
|
994
|
+
], O.prototype, "placeholderIcon", 2);
|
|
995
|
+
E([
|
|
996
|
+
et()
|
|
997
|
+
], O.prototype, "width", 2);
|
|
998
|
+
E([
|
|
999
|
+
et()
|
|
1000
|
+
], O.prototype, "fitWidth", 2);
|
|
1001
|
+
E([
|
|
1002
|
+
xe("img", { refresh: !0 })
|
|
1003
|
+
], O.prototype, "image", 1);
|
|
1004
|
+
O = E([
|
|
1005
|
+
j({ tag: F })
|
|
1006
|
+
], O);
|
|
1007
|
+
const ls = {
|
|
1008
|
+
sizing: {
|
|
1009
|
+
label: "Sizing",
|
|
1010
|
+
description: c`
|
|
1011
|
+
<p>
|
|
1012
|
+
Photos are block elements, so a photo fills its container's width unless
|
|
1013
|
+
an explicit width is set. It is always a 4:3 aspect ratio. In this example,
|
|
1014
|
+
photos have been placed in cards which have different widths in the 12
|
|
1015
|
+
column grid.
|
|
1016
|
+
</p>
|
|
1017
|
+
`,
|
|
1018
|
+
examples: {
|
|
1019
|
+
basic: {
|
|
1020
|
+
jsx: c`
|
|
1021
|
+
<div className="sfg-row">
|
|
1022
|
+
<div className="sfg-col-2">
|
|
1023
|
+
<sps-card>
|
|
1024
|
+
<sps-photo src="assets/images/photo-landscape.jpg"></sps-photo>
|
|
1025
|
+
</sps-card>
|
|
1026
|
+
</div>
|
|
1027
|
+
<div className="sfg-col-4">
|
|
1028
|
+
<sps-card>
|
|
1029
|
+
<sps-photo src="assets/images/photo-landscape.jpg"></sps-photo>
|
|
1030
|
+
</sps-card>
|
|
1031
|
+
</div>
|
|
1032
|
+
<div className="sfg-col-6">
|
|
1033
|
+
<sps-card>
|
|
1034
|
+
<sps-photo src="assets/images/photo-landscape.jpg"></sps-photo>
|
|
1035
|
+
</sps-card>
|
|
1036
|
+
</div>
|
|
1037
|
+
</div>
|
|
1038
|
+
`
|
|
1456
1039
|
}
|
|
1457
1040
|
}
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1041
|
+
},
|
|
1042
|
+
displayMode: {
|
|
1043
|
+
label: "Fill vs. Fit",
|
|
1044
|
+
description: c`
|
|
1045
|
+
<p>
|
|
1046
|
+
There are two display modes available:
|
|
1047
|
+
<ul>
|
|
1048
|
+
<li><b>"fill"</b> fills the entire 4:3 container, cropping off any excess portions of the image.
|
|
1049
|
+
<li><b>"fit"</b> fits the entire image into the container, leaving any excess portions of the container blank.
|
|
1050
|
+
</ul>
|
|
1051
|
+
</p>
|
|
1052
|
+
`,
|
|
1053
|
+
examples: {
|
|
1054
|
+
landscape: {
|
|
1055
|
+
description: "<p>Landscape oriented photo (container outline added for illustrative purposes)</p>",
|
|
1056
|
+
jsx: c`
|
|
1057
|
+
<div className="sfg-row">
|
|
1058
|
+
<div className="sfg-col-4">
|
|
1059
|
+
<sps-photo src="assets/images/photo-landscape.jpg" mode="fill"></sps-photo>
|
|
1060
|
+
</div>
|
|
1061
|
+
<div className="sfg-col-4">
|
|
1062
|
+
<sps-photo src="assets/images/photo-landscape.jpg" mode="fit"></sps-photo>
|
|
1063
|
+
</div>
|
|
1064
|
+
</div>
|
|
1065
|
+
`
|
|
1066
|
+
},
|
|
1067
|
+
portrait: {
|
|
1068
|
+
description: "<p>Portrait oriented photo (container outline added for illustrative purposes)</p>",
|
|
1069
|
+
jsx: c`
|
|
1070
|
+
<div className="sfg-row">
|
|
1071
|
+
<div className="sfg-col-4">
|
|
1072
|
+
<sps-photo src="assets/images/photo-portrait.jpg" mode="fill"></sps-photo>
|
|
1073
|
+
</div>
|
|
1074
|
+
<div className="sfg-col-4">
|
|
1075
|
+
<sps-photo id="foo" src="assets/images/photo-portrait.jpg" mode="fit"></sps-photo>
|
|
1076
|
+
</div>
|
|
1077
|
+
</div>
|
|
1078
|
+
`
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
},
|
|
1082
|
+
placeholder: {
|
|
1083
|
+
label: "Placeholders",
|
|
1084
|
+
description: c`
|
|
1085
|
+
<p>
|
|
1086
|
+
When an image is not provided for a particular use case (such as a user avatar,
|
|
1087
|
+
a company photo, item image, etc.), a placeholder should be shown in its place.
|
|
1088
|
+
|
|
1089
|
+
The placeholder's icon, selected from our SPS icon set, should represent the
|
|
1090
|
+
type of image it is substituting for.
|
|
1091
|
+
</p>
|
|
1092
|
+
`,
|
|
1093
|
+
examples: {
|
|
1094
|
+
general: {
|
|
1095
|
+
description: "<p>General Photo</p>",
|
|
1096
|
+
jsx: c`
|
|
1097
|
+
<div className="sfg-row">
|
|
1098
|
+
<div className="sfg-col-3">
|
|
1099
|
+
<sps-photo placeholderIcon="photo"></sps-photo>
|
|
1100
|
+
</div>
|
|
1101
|
+
</div>
|
|
1102
|
+
`
|
|
1103
|
+
},
|
|
1104
|
+
photoAlt: {
|
|
1105
|
+
description: "<p>Photo Alt</p>",
|
|
1106
|
+
jsx: c`
|
|
1107
|
+
<div className="sfg-row">
|
|
1108
|
+
<div className="sfg-col-3">
|
|
1109
|
+
<sps-photo placeholderIcon="camera"></sps-photo>
|
|
1110
|
+
</div>
|
|
1111
|
+
</div>
|
|
1112
|
+
`
|
|
1113
|
+
},
|
|
1114
|
+
user: {
|
|
1115
|
+
description: "<p>User / Single Person</p>",
|
|
1116
|
+
jsx: c`
|
|
1117
|
+
<div className="sfg-row">
|
|
1118
|
+
<div className="sfg-col-3">
|
|
1119
|
+
<sps-photo placeholderIcon="user"></sps-photo>
|
|
1120
|
+
</div>
|
|
1121
|
+
</div>
|
|
1122
|
+
`
|
|
1123
|
+
},
|
|
1124
|
+
group: {
|
|
1125
|
+
description: "<p>Group / Multiple People</p>",
|
|
1126
|
+
jsx: c`
|
|
1127
|
+
<div className="sfg-row">
|
|
1128
|
+
<div className="sfg-col-3">
|
|
1129
|
+
<sps-photo placeholderIcon="group"></sps-photo>
|
|
1130
|
+
</div>
|
|
1131
|
+
</div>
|
|
1132
|
+
`
|
|
1133
|
+
},
|
|
1134
|
+
company: {
|
|
1135
|
+
description: "<p>Company / Building</p>",
|
|
1136
|
+
jsx: c`
|
|
1137
|
+
<div className="sfg-row">
|
|
1138
|
+
<div className="sfg-col-3">
|
|
1139
|
+
<sps-photo placeholderIcon="building"></sps-photo>
|
|
1140
|
+
</div>
|
|
1141
|
+
</div>
|
|
1142
|
+
`
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}, Ss = {
|
|
1147
|
+
Photos: {
|
|
1148
|
+
components: [O],
|
|
1149
|
+
examples: ls
|
|
1150
|
+
}
|
|
1151
|
+
};
|
|
1152
|
+
var tt = /* @__PURE__ */ ((e) => (e["7Z"] = "application/x-7z-compressed", e.AAC = "audio/aac", e.ABW = "application/x-abiword", e.ARC = "application/octet-stream", e.AVI = "video/x-msvideo", e.AZW = "application/vnd.amazon.ebook", e.BIN = "application/octet-stream", e.BMP = "image/bmp", e.BZ = "application/x-bzip", e.BZ2 = "application/x-bzip2", e.CSH = "application/x-csh", e.CSS = "text/css", e.CSV = "text/csv,application/vnd.ms-excel", e.DOC = "application/msword", e.DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", e.EOT = "application/vnd.ms-fontobject", e.EPUB = "application/epub+zip", e.ES = "application/ecmascript", e.FLV = "video/x-flv", e.GIF = "image/gif", e.GZ = "application/x-gzip", e.HTM = "text/html", e.HTML = "text/html", e.ICO = "image/x-icon", e.ICS = "text/calendar", e.JAR = "application/java-archive", e.JPEG = "image/jpeg", e.JPG = "image/jpeg", e.JS = "application/javascript", e.JSON = "application/json", e.M3U = "audio/x-mpequrl", e.MID = "audio/midi", e.MIDI = "audio/midi", e.MOV = "video/quicktime", e.MP3 = "audio/mpeg3", e.MP4 = "video/mp4", e.MPEG = "video/mpeg", e.MPKG = "application/vnd.apple.installer+xml", e.ODP = "application/vnd.oasis.opendocument.presentation", e.ODS = "application/vnd.oasis.opendocument.spreadsheet", e.ODT = "application/vnd.oasis.opendocument.text", e.OGA = "audio/ogg", e.OGV = "video/ogg", e.OGX = "application/ogg", e.OTF = "font/otf", e.PNG = "image/png", e.PDF = "application/pdf", e.PPT = "application/vnd.ms-powerpoint", e.PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation", e.RAR = "application/x-rar-compressed", e.RTF = "application/rtf", e.SH = "application/x-sh", e.SVG = "image/svg+xml", e.SWF = "application/x-shockwave-flash", e.TAR = "application/x-tar", e.TIF = "image/tiff", e.TIFF = "image/tiff", e.TS = "application/typescript", e.TTF = "font/ttf", e.TXT = "text/plain", e.VSD = "application/vnd.visio", e.WAV = "audio/wav", e.WEBA = "audio/webm", e.WEBM = "video/webm", e.WEBP = "image/webp", e.WOFF = "font/woff", e.WOFF2 = "font/woff2", e.XHTML = "application/xhtml+xml", e.XLS = "application/vnd.ms-excel", e.XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", e.XML = "application/xml", e.XUL = "application/vnd.mozilla.xul+xml", e.ZIP = "application/zip", e))(tt || {}), cs = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, v = (e, t, s, n) => {
|
|
1153
|
+
for (var i = n > 1 ? void 0 : n ? ps(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
1154
|
+
(l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
|
|
1155
|
+
return n && i && cs(t, s, i), i;
|
|
1156
|
+
};
|
|
1157
|
+
const m = "sps-file-upload";
|
|
1158
|
+
var G;
|
|
1159
|
+
let f = (G = class extends HTMLElement {
|
|
1160
|
+
constructor() {
|
|
1161
|
+
super();
|
|
1162
|
+
a(this, "description");
|
|
1163
|
+
a(this, "multiple");
|
|
1164
|
+
a(this, "shown", !0);
|
|
1165
|
+
a(this, "dismissable");
|
|
1166
|
+
a(this, "processing");
|
|
1167
|
+
a(this, "mini");
|
|
1168
|
+
a(this, "constrainContentWidth");
|
|
1169
|
+
a(this, "downloadLabel");
|
|
1170
|
+
a(this, "acceptExtensions");
|
|
1171
|
+
a(this, "maxSize");
|
|
1172
|
+
a(this, "customRequirement");
|
|
1173
|
+
a(this, "selection");
|
|
1174
|
+
a(this, "dismissal");
|
|
1175
|
+
a(this, "download");
|
|
1176
|
+
a(this, "fileInput");
|
|
1177
|
+
a(this, "files", []);
|
|
1178
|
+
a(this, "accept");
|
|
1179
|
+
a(this, "acceptMIMETypes", /* @__PURE__ */ new Set());
|
|
1180
|
+
a(this, "acceptExtensionsDescription");
|
|
1181
|
+
a(this, "maxSizeBytes");
|
|
1182
|
+
a(this, "active", !1);
|
|
1183
|
+
a(this, "error", !1);
|
|
1184
|
+
a(this, "namesOfUnsupportedFiles", []);
|
|
1185
|
+
this.handleBrowseLinkClick = this.handleBrowseLinkClick.bind(this), this.handleDownloadButtonClick = this.handleDownloadButtonClick.bind(this), this.handleFileInputChange = this.handleFileInputChange.bind(this), this.dismiss = this.dismiss.bind(this);
|
|
1186
|
+
}
|
|
1187
|
+
get [T]() {
|
|
1188
|
+
return [
|
|
1189
|
+
m,
|
|
1190
|
+
this.active && `${m}--active`,
|
|
1191
|
+
this.error && `${m}--error`,
|
|
1192
|
+
!this.shown && `${m}--hidden`,
|
|
1193
|
+
this.mini && `${m}--mini`,
|
|
1194
|
+
this.constrainContentWidth && `${m}--constrained-content-width`
|
|
1195
|
+
];
|
|
1196
|
+
}
|
|
1197
|
+
connectedCallback() {
|
|
1198
|
+
this.description = this.description || (this.multiple ? "Files" : "File"), this.acceptExtensions && this.processAcceptExtensions(this.acceptExtensions), this.maxSize && this.parseAndValidateMaxSize(this.maxSize);
|
|
1199
|
+
}
|
|
1200
|
+
attributeChangedCallback(t, s, n) {
|
|
1201
|
+
t === "acceptExtensions" && this.processAcceptExtensions(n), t === "maxSize" && this.parseAndValidateMaxSize(n);
|
|
1202
|
+
}
|
|
1203
|
+
dismiss() {
|
|
1204
|
+
this.dismissable && (this.shown = !1, this.update(), this.dismissal.dispatch());
|
|
1205
|
+
}
|
|
1206
|
+
show() {
|
|
1207
|
+
this.dismissable && (this.shown = !0, this.update());
|
|
1208
|
+
}
|
|
1209
|
+
render({ t }) {
|
|
1210
|
+
const s = this.error ? Se.EXCLAMATION_CIRCLE : Se.UPLOAD_CLOUD, n = (this.multiple ? t("design-system:fileUpload.instructions_plural") : t("design-system:fileUpload.instructions")).split("|");
|
|
1211
|
+
return /* @__PURE__ */ o("div", {
|
|
1212
|
+
"data-fragment": !0
|
|
1213
|
+
}, /* @__PURE__ */ o("div", {
|
|
1214
|
+
className: `${m}__content`
|
|
1215
|
+
}, this.processing ? /* @__PURE__ */ o("div", {
|
|
1216
|
+
"data-fragment": !0
|
|
1217
|
+
}, /* @__PURE__ */ o("i", {
|
|
1218
|
+
className: "sps-spinner sps-spinner--medium",
|
|
1219
|
+
"aria-hidden": "true"
|
|
1220
|
+
}), /* @__PURE__ */ o("div", {
|
|
1221
|
+
className: `${m}__instructions`
|
|
1222
|
+
}, t("design-system:fileUpload.processing"))) : /* @__PURE__ */ o("div", {
|
|
1223
|
+
"data-fragment": !0
|
|
1224
|
+
}, /* @__PURE__ */ o("i", {
|
|
1225
|
+
className: `sps-icon sps-icon-${s} ${m}__icon-primary`,
|
|
1226
|
+
"aria-hidden": "true"
|
|
1227
|
+
}), /* @__PURE__ */ o("div", {
|
|
1228
|
+
className: `${m}__title`
|
|
1229
|
+
}, this.error ? /* @__PURE__ */ o("div", {
|
|
1230
|
+
"data-fragment": !0
|
|
1231
|
+
}, t(
|
|
1232
|
+
this.namesOfUnsupportedFiles.length > 1 ? "design-system:fileUpload.cancelled_plural" : "design-system:fileUpload.cancelled"
|
|
1233
|
+
)) : /* @__PURE__ */ o("div", {
|
|
1234
|
+
"data-fragment": !0
|
|
1235
|
+
}, t("design-system:fileUpload.title", { description: this.description }))), this.error ? /* @__PURE__ */ o("div", {
|
|
1236
|
+
className: `${m}__errored-files`
|
|
1237
|
+
}, new Set(this.namesOfUnsupportedFiles.map((i, r) => {
|
|
1238
|
+
const l = Math.floor(i.length / 2);
|
|
1239
|
+
return /* @__PURE__ */ o("div", {
|
|
1240
|
+
className: `${m}__errored-filename`,
|
|
1241
|
+
key: i
|
|
1242
|
+
}, /* @__PURE__ */ o("span", {
|
|
1243
|
+
className: `${m}__errored-filename-segment`
|
|
1244
|
+
}, i.substr(0, l)), /* @__PURE__ */ o("div", {
|
|
1245
|
+
className: `${m}__errored-filename-segment`
|
|
1246
|
+
}, /* @__PURE__ */ o("span", null, i.substr(l))), r < this.namesOfUnsupportedFiles.length - 1 ? "," : "");
|
|
1247
|
+
}))) : /* @__PURE__ */ o("span", null), /* @__PURE__ */ o("div", {
|
|
1248
|
+
className: `${m}__instructions`
|
|
1249
|
+
}, /* @__PURE__ */ o("div", {
|
|
1250
|
+
"data-fragment": !0
|
|
1251
|
+
}, /* @__PURE__ */ o("span", null, n[0]), /* @__PURE__ */ o("a", {
|
|
1252
|
+
href: "",
|
|
1253
|
+
onClick: this.handleBrowseLinkClick
|
|
1254
|
+
}, n[1]), /* @__PURE__ */ o("span", null, n[2]))), /* @__PURE__ */ o("div", {
|
|
1255
|
+
className: `${m}__requirements`
|
|
1256
|
+
}, this.acceptExtensions ? /* @__PURE__ */ o("span", null, "(", " ", t("design-system:fileUpload.acceptedTypes", { fileTypes: this.acceptExtensionsDescription }), " ", ")") : "", this.maxSize ? /* @__PURE__ */ o("span", null, "(", " ", t("design-system:fileUpload.maximumSize", { size: this.maxSize }), " ", ")") : "", this.customRequirement ? /* @__PURE__ */ o("span", null, " ", this.customRequirement, " ") : ""), this.downloadLabel && /* @__PURE__ */ o("div", {
|
|
1257
|
+
className: `sps-button sps-button--link ${m}__download-button`,
|
|
1258
|
+
onClick: this.handleDownloadButtonClick
|
|
1259
|
+
}, /* @__PURE__ */ o("button", {
|
|
1260
|
+
type: "button"
|
|
1261
|
+
}, /* @__PURE__ */ o("i", {
|
|
1262
|
+
className: "sps-icon sps-icon-download-cloud",
|
|
1263
|
+
"aria-hidden": "true"
|
|
1264
|
+
}), " ", this.downloadLabel)))), this.dismissable && !this.processing && /* @__PURE__ */ o("div", {
|
|
1265
|
+
className: `sps-button sps-button--icon ${m}__close-button`,
|
|
1266
|
+
onClick: this.dismiss
|
|
1267
|
+
}, /* @__PURE__ */ o("button", {
|
|
1268
|
+
type: "button",
|
|
1269
|
+
title: t("design-system:fileUpload.close")
|
|
1270
|
+
}, /* @__PURE__ */ o("i", {
|
|
1271
|
+
className: "sps-icon sps-icon-x",
|
|
1272
|
+
"aria-hidden": "true"
|
|
1273
|
+
}))), /* @__PURE__ */ o("form", null, /* @__PURE__ */ o("input", {
|
|
1274
|
+
type: "file",
|
|
1275
|
+
accept: this.accept || "*/*",
|
|
1276
|
+
multiple: this.multiple || null,
|
|
1277
|
+
onChange: this.handleFileInputChange
|
|
1278
|
+
})));
|
|
1279
|
+
}
|
|
1280
|
+
parseAndValidateMaxSize(t) {
|
|
1281
|
+
try {
|
|
1282
|
+
this.maxSizeBytes = ct(t);
|
|
1283
|
+
} catch {
|
|
1284
|
+
throw new Error(`Could not parse "${t}" as a file size.`);
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
processAcceptExtensions(t) {
|
|
1288
|
+
const n = (Array.isArray(t) ? t : t.trim().split(/\s?,\s?/)).map((r) => r.replace(/^\./, "")), i = n.map((r) => `.${r}`.toLowerCase());
|
|
1289
|
+
this.acceptExtensionsDescription = i.map((r, l) => l > 0 && l === i.length - 1 ? `or ${r}` : r).join(i.length > 2 ? ", " : " "), this.acceptMIMETypes.clear();
|
|
1290
|
+
for (const r of n)
|
|
1291
|
+
for (const l of tt[r.toUpperCase()].split(","))
|
|
1292
|
+
this.acceptMIMETypes.add(l);
|
|
1293
|
+
this.accept = i.concat(Array.from(this.acceptMIMETypes)).join(",");
|
|
1294
|
+
}
|
|
1295
|
+
selectFiles(t) {
|
|
1296
|
+
this.namesOfUnsupportedFiles = [];
|
|
1297
|
+
const s = Array.from(t);
|
|
1298
|
+
for (const n of s)
|
|
1299
|
+
this.acceptExtensions && !this.acceptMIMETypes.has(n.type) && this.namesOfUnsupportedFiles.push(n.name), this.maxSize && n.size > this.maxSizeBytes && this.namesOfUnsupportedFiles.indexOf(n.name) === -1 && this.namesOfUnsupportedFiles.push(n.name);
|
|
1300
|
+
this.namesOfUnsupportedFiles.length ? (this.error = !0, this.fileInput.value = null, this.update()) : (this.files = s, this.selection.dispatch(s));
|
|
1301
|
+
}
|
|
1302
|
+
handleDragOver(t) {
|
|
1303
|
+
t.preventDefault(), t.stopPropagation();
|
|
1304
|
+
}
|
|
1305
|
+
handleDragEnter(t) {
|
|
1306
|
+
t.preventDefault(), this.active = !0, this.error = !1, this.update();
|
|
1307
|
+
}
|
|
1308
|
+
handleDragLeave(t) {
|
|
1309
|
+
t.preventDefault(), this.active = !1, this.update();
|
|
1310
|
+
}
|
|
1311
|
+
handleDrop(t) {
|
|
1312
|
+
t.preventDefault(), t.stopPropagation(), this.active = !1, t.dataTransfer.items ? this.selectFiles(Array.from(t.dataTransfer.items).map(
|
|
1313
|
+
(s) => s.getAsFile()
|
|
1314
|
+
)) : this.selectFiles(t.dataTransfer.files), this.update();
|
|
1315
|
+
}
|
|
1316
|
+
handleBrowseLinkClick(t) {
|
|
1317
|
+
t.preventDefault(), this.error = !1, this.update(), this.fileInput.click();
|
|
1318
|
+
}
|
|
1319
|
+
handleDownloadButtonClick() {
|
|
1320
|
+
this.download.dispatch();
|
|
1321
|
+
}
|
|
1322
|
+
handleFileInputChange(t) {
|
|
1323
|
+
t.stopPropagation(), this.selectFiles(t.target.files);
|
|
1324
|
+
}
|
|
1325
|
+
}, a(G, "displayName", m), a(G, "props", {
|
|
1326
|
+
description: "string",
|
|
1327
|
+
multiple: "boolean",
|
|
1328
|
+
dismissable: "boolean",
|
|
1329
|
+
processing: "boolean",
|
|
1330
|
+
mini: "boolean",
|
|
1514
1331
|
downloadLabel: "string",
|
|
1515
1332
|
acceptExtensions: "Array<string> | string",
|
|
1516
1333
|
maxSize: "string",
|
|
1517
1334
|
customRequirement: "string",
|
|
1518
|
-
selection: { event:
|
|
1519
|
-
dismissal: { event:
|
|
1520
|
-
download: { event:
|
|
1521
|
-
};
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
],
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
],
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
],
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
],
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
],
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
],
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
],
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
],
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
],
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
],
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
],
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
],
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
],
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
],
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
],
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
],
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
],
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
],
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
],
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
],
|
|
1582
|
-
const
|
|
1335
|
+
selection: { event: !0, type: "CustomEvent<Array<File>>" },
|
|
1336
|
+
dismissal: { event: !0, type: "CustomEvent<void>" },
|
|
1337
|
+
download: { event: !0, type: "CustomEvent<void>" }
|
|
1338
|
+
}), G);
|
|
1339
|
+
v([
|
|
1340
|
+
p()
|
|
1341
|
+
], f.prototype, "description", 2);
|
|
1342
|
+
v([
|
|
1343
|
+
p(Boolean)
|
|
1344
|
+
], f.prototype, "multiple", 2);
|
|
1345
|
+
v([
|
|
1346
|
+
p(Boolean)
|
|
1347
|
+
], f.prototype, "shown", 2);
|
|
1348
|
+
v([
|
|
1349
|
+
p(Boolean)
|
|
1350
|
+
], f.prototype, "dismissable", 2);
|
|
1351
|
+
v([
|
|
1352
|
+
p(Boolean)
|
|
1353
|
+
], f.prototype, "processing", 2);
|
|
1354
|
+
v([
|
|
1355
|
+
p(Boolean)
|
|
1356
|
+
], f.prototype, "mini", 2);
|
|
1357
|
+
v([
|
|
1358
|
+
p(Boolean)
|
|
1359
|
+
], f.prototype, "constrainContentWidth", 2);
|
|
1360
|
+
v([
|
|
1361
|
+
p()
|
|
1362
|
+
], f.prototype, "downloadLabel", 2);
|
|
1363
|
+
v([
|
|
1364
|
+
p()
|
|
1365
|
+
], f.prototype, "acceptExtensions", 2);
|
|
1366
|
+
v([
|
|
1367
|
+
p()
|
|
1368
|
+
], f.prototype, "maxSize", 2);
|
|
1369
|
+
v([
|
|
1370
|
+
p()
|
|
1371
|
+
], f.prototype, "customRequirement", 2);
|
|
1372
|
+
v([
|
|
1373
|
+
Ne()
|
|
1374
|
+
], f.prototype, "selection", 2);
|
|
1375
|
+
v([
|
|
1376
|
+
Ne()
|
|
1377
|
+
], f.prototype, "dismissal", 2);
|
|
1378
|
+
v([
|
|
1379
|
+
Ne()
|
|
1380
|
+
], f.prototype, "download", 2);
|
|
1381
|
+
v([
|
|
1382
|
+
xe("input[type='file']")
|
|
1383
|
+
], f.prototype, "fileInput", 2);
|
|
1384
|
+
v([
|
|
1385
|
+
re("dragover")
|
|
1386
|
+
], f.prototype, "handleDragOver", 1);
|
|
1387
|
+
v([
|
|
1388
|
+
re("dragenter")
|
|
1389
|
+
], f.prototype, "handleDragEnter", 1);
|
|
1390
|
+
v([
|
|
1391
|
+
re("dragleave")
|
|
1392
|
+
], f.prototype, "handleDragLeave", 1);
|
|
1393
|
+
v([
|
|
1394
|
+
re("drop")
|
|
1395
|
+
], f.prototype, "handleDrop", 1);
|
|
1396
|
+
f = v([
|
|
1397
|
+
j({ tag: m })
|
|
1398
|
+
], f);
|
|
1399
|
+
const Os = {
|
|
1583
1400
|
basic: {
|
|
1584
1401
|
label: "Basic File Upload",
|
|
1585
|
-
description:
|
|
1402
|
+
description: c`
|
|
1586
1403
|
<p>Simply allow the user to drag-and-drop or select either a single file or multiple files at once.</p>
|
|
1587
1404
|
`,
|
|
1588
1405
|
examples: {
|
|
1589
1406
|
single: {
|
|
1590
1407
|
description: "<p>Single file upload</p>",
|
|
1591
|
-
react:
|
|
1408
|
+
react: c`
|
|
1592
1409
|
function Component() {
|
|
1593
1410
|
const ref = React.useRef()
|
|
1594
1411
|
|
|
@@ -1615,7 +1432,7 @@ const SpsFileUploadExamples = {
|
|
|
1615
1432
|
},
|
|
1616
1433
|
multiple: {
|
|
1617
1434
|
description: "<p>Multiple file upload</p>",
|
|
1618
|
-
react:
|
|
1435
|
+
react: c`
|
|
1619
1436
|
function Component() {
|
|
1620
1437
|
const ref = React.useRef()
|
|
1621
1438
|
|
|
@@ -1644,13 +1461,13 @@ const SpsFileUploadExamples = {
|
|
|
1644
1461
|
},
|
|
1645
1462
|
restrictions: {
|
|
1646
1463
|
label: "Restrictions",
|
|
1647
|
-
description:
|
|
1464
|
+
description: c`
|
|
1648
1465
|
<p>You can place restrictions on what files will be accepted with an extension whitelist and/or a maximum size.</p>
|
|
1649
1466
|
`,
|
|
1650
1467
|
examples: {
|
|
1651
1468
|
size: {
|
|
1652
1469
|
description: "<p>Maximum size</p>",
|
|
1653
|
-
react:
|
|
1470
|
+
react: c`
|
|
1654
1471
|
function Component() {
|
|
1655
1472
|
const ref = React.useRef()
|
|
1656
1473
|
|
|
@@ -1677,7 +1494,7 @@ const SpsFileUploadExamples = {
|
|
|
1677
1494
|
},
|
|
1678
1495
|
type: {
|
|
1679
1496
|
description: "<p>File type whitelist</p>",
|
|
1680
|
-
react:
|
|
1497
|
+
react: c`
|
|
1681
1498
|
function Component() {
|
|
1682
1499
|
const ref = React.useRef()
|
|
1683
1500
|
|
|
@@ -1709,7 +1526,7 @@ const SpsFileUploadExamples = {
|
|
|
1709
1526
|
},
|
|
1710
1527
|
both: {
|
|
1711
1528
|
description: "<p>Both restrictions</p>",
|
|
1712
|
-
react:
|
|
1529
|
+
react: c`
|
|
1713
1530
|
function Component() {
|
|
1714
1531
|
const ref = React.useRef()
|
|
1715
1532
|
|
|
@@ -1744,13 +1561,13 @@ const SpsFileUploadExamples = {
|
|
|
1744
1561
|
},
|
|
1745
1562
|
dismissable: {
|
|
1746
1563
|
label: "Dismissable",
|
|
1747
|
-
description:
|
|
1564
|
+
description: c`
|
|
1748
1565
|
<p>With this option, the file upload component can be dismissed by the user. If the user does dismiss it, you can
|
|
1749
1566
|
show it again programmatically if you need to.</p>
|
|
1750
1567
|
`,
|
|
1751
1568
|
examples: {
|
|
1752
1569
|
dismissable: {
|
|
1753
|
-
react:
|
|
1570
|
+
react: c`
|
|
1754
1571
|
function Component() {
|
|
1755
1572
|
const [showFileUpload, setShowFileUpload] = React.useState(true)
|
|
1756
1573
|
const ref = React.useRef()
|
|
@@ -1787,592 +1604,177 @@ const SpsFileUploadExamples = {
|
|
|
1787
1604
|
}
|
|
1788
1605
|
}
|
|
1789
1606
|
},
|
|
1790
|
-
downloadButton: {
|
|
1791
|
-
label: "Download Button",
|
|
1792
|
-
description:
|
|
1793
|
-
<p>You can optionally provide a button to download a file. Typically this will be a template for
|
|
1794
|
-
whatever the user is expected to upload. They can then fill out the template, save it, and upload it.</p>
|
|
1795
|
-
`,
|
|
1796
|
-
examples: {
|
|
1797
|
-
downloadButton: {
|
|
1798
|
-
react: code`
|
|
1799
|
-
function Component() {
|
|
1800
|
-
const ref = React.useRef()
|
|
1801
|
-
|
|
1802
|
-
function handleDownload() {
|
|
1803
|
-
console.log("Download triggered.")
|
|
1804
|
-
}
|
|
1805
|
-
|
|
1806
|
-
React.useEffect(() => {
|
|
1807
|
-
ref.current.addEventListener("download", handleDownload)
|
|
1808
|
-
return () => {
|
|
1809
|
-
ref.current.removeEventListener("download", handleDownload)
|
|
1810
|
-
}
|
|
1811
|
-
})
|
|
1812
|
-
|
|
1813
|
-
return (
|
|
1814
|
-
<div className="sps-row">
|
|
1815
|
-
<div className="col-12">
|
|
1816
|
-
<sps-file-upload
|
|
1817
|
-
ref={ref}
|
|
1818
|
-
description="Spreadsheet"
|
|
1819
|
-
acceptExtensions="xlsx"
|
|
1820
|
-
downloadLabel="Download Excel Template"
|
|
1821
|
-
/>
|
|
1822
|
-
</div>
|
|
1823
|
-
</div>
|
|
1824
|
-
)
|
|
1825
|
-
}
|
|
1826
|
-
`
|
|
1827
|
-
}
|
|
1828
|
-
}
|
|
1829
|
-
},
|
|
1830
|
-
mini: {
|
|
1831
|
-
label: "Mini File Upload",
|
|
1832
|
-
description: code`
|
|
1833
|
-
<p>When the file upload component is to be placed in a small container,
|
|
1834
|
-
it should be marked as a mini file upload so that everything fits.</p>
|
|
1835
|
-
`,
|
|
1836
|
-
examples: {
|
|
1837
|
-
single: {
|
|
1838
|
-
react: code`
|
|
1839
|
-
function Component() {
|
|
1840
|
-
const ref = React.useRef()
|
|
1841
|
-
|
|
1842
|
-
function handleChange(event) {
|
|
1843
|
-
console.log(event.detail)
|
|
1844
|
-
}
|
|
1845
|
-
|
|
1846
|
-
React.useEffect(() => {
|
|
1847
|
-
ref.current.addEventListener("selection", handleChange)
|
|
1848
|
-
return () => {
|
|
1849
|
-
ref.current.removeEventListener("selection", handleChange)
|
|
1850
|
-
}
|
|
1851
|
-
})
|
|
1852
|
-
|
|
1853
|
-
return (
|
|
1854
|
-
<div className="sps-row">
|
|
1855
|
-
<div className="col-4">
|
|
1856
|
-
<sps-file-upload ref={ref} mini/>
|
|
1857
|
-
</div>
|
|
1858
|
-
</div>
|
|
1859
|
-
)
|
|
1860
|
-
}
|
|
1861
|
-
`
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
},
|
|
1865
|
-
constrainContentWidth: {
|
|
1866
|
-
label: "Constrain Content Width",
|
|
1867
|
-
description: code`
|
|
1868
|
-
<p>If this prop is provided, the content will be restricted to 50% of
|
|
1869
|
-
the overall width of the component. Consult your product designer if
|
|
1870
|
-
you're not sure whether to use this variant.</p>
|
|
1871
|
-
`,
|
|
1872
|
-
examples: {
|
|
1873
|
-
constrainContentWidth: {
|
|
1874
|
-
react: code`
|
|
1875
|
-
function Component() {
|
|
1876
|
-
const ref = React.useRef()
|
|
1877
|
-
|
|
1878
|
-
function handleChange(event: CustomEvent<Array<File>>) {
|
|
1879
|
-
console.log(event.detail)
|
|
1880
|
-
}
|
|
1881
|
-
|
|
1882
|
-
React.useEffect(() => {
|
|
1883
|
-
ref.current.addEventListener("selection", handleChange)
|
|
1884
|
-
return () => {
|
|
1885
|
-
ref.current.removeEventListener("selection", handleChange)
|
|
1886
|
-
}
|
|
1887
|
-
})
|
|
1888
|
-
|
|
1889
|
-
return (
|
|
1890
|
-
<div className="sps-row">
|
|
1891
|
-
<div className="col-4">
|
|
1892
|
-
<sps-file-upload ref={ref} constrainContentWidth/>
|
|
1893
|
-
</div>
|
|
1894
|
-
</div>
|
|
1895
|
-
)
|
|
1896
|
-
}
|
|
1897
|
-
`
|
|
1898
|
-
}
|
|
1899
|
-
}
|
|
1900
|
-
}
|
|
1901
|
-
};
|
|
1902
|
-
var __defProp$4 = Object.defineProperty;
|
|
1903
|
-
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
1904
|
-
var __decorateClass$4 = (decorators, target, key2, kind) => {
|
|
1905
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key2) : target;
|
|
1906
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1907
|
-
if (decorator = decorators[i])
|
|
1908
|
-
result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
|
|
1909
|
-
if (kind && result)
|
|
1910
|
-
__defProp$4(target, key2, result);
|
|
1911
|
-
return result;
|
|
1912
|
-
};
|
|
1913
|
-
let SpsNavTabComponent = class extends HTMLElement {
|
|
1914
|
-
constructor() {
|
|
1915
|
-
super(...arguments);
|
|
1916
|
-
this.active = false;
|
|
1917
|
-
this.label = "";
|
|
1918
|
-
this.tag = "";
|
|
1919
|
-
}
|
|
1920
|
-
get [ClassBindings]() {
|
|
1921
|
-
return [
|
|
1922
|
-
"sps-tabbed-nav__nav-item",
|
|
1923
|
-
this.active && "sps-tabbed-nav__nav-item--active"
|
|
1924
|
-
];
|
|
1925
|
-
}
|
|
1926
|
-
render() {
|
|
1927
|
-
return /* @__PURE__ */ h("a", {
|
|
1928
|
-
href: this.href,
|
|
1929
|
-
target: this.target,
|
|
1930
|
-
className: "sps-tabbed-nav__nav-item-link",
|
|
1931
|
-
tabIndex: 0
|
|
1932
|
-
}, this.icon && /* @__PURE__ */ h("i", {
|
|
1933
|
-
className: `sps-icon sps-icon-${this.icon}`
|
|
1934
|
-
}), this.label && /* @__PURE__ */ h("span", null, this.label), this.tag && /* @__PURE__ */ h("span", {
|
|
1935
|
-
className: "sps-tag sps-tag--default"
|
|
1936
|
-
}, this.tag));
|
|
1937
|
-
}
|
|
1938
|
-
};
|
|
1939
|
-
SpsNavTabComponent.displayName = "sps-nav-tab";
|
|
1940
|
-
SpsNavTabComponent.props = {
|
|
1941
|
-
active: "boolean",
|
|
1942
|
-
label: "string",
|
|
1943
|
-
icon: "SpsIcon",
|
|
1944
|
-
tag: "string",
|
|
1945
|
-
href: "string",
|
|
1946
|
-
target: "string"
|
|
1947
|
-
};
|
|
1948
|
-
__decorateClass$4([
|
|
1949
|
-
Prop()
|
|
1950
|
-
], SpsNavTabComponent.prototype, "active", 2);
|
|
1951
|
-
__decorateClass$4([
|
|
1952
|
-
Prop()
|
|
1953
|
-
], SpsNavTabComponent.prototype, "label", 2);
|
|
1954
|
-
__decorateClass$4([
|
|
1955
|
-
Prop()
|
|
1956
|
-
], SpsNavTabComponent.prototype, "icon", 2);
|
|
1957
|
-
__decorateClass$4([
|
|
1958
|
-
Prop()
|
|
1959
|
-
], SpsNavTabComponent.prototype, "tag", 2);
|
|
1960
|
-
__decorateClass$4([
|
|
1961
|
-
Prop()
|
|
1962
|
-
], SpsNavTabComponent.prototype, "href", 2);
|
|
1963
|
-
__decorateClass$4([
|
|
1964
|
-
Prop()
|
|
1965
|
-
], SpsNavTabComponent.prototype, "target", 2);
|
|
1966
|
-
SpsNavTabComponent = __decorateClass$4([
|
|
1967
|
-
Component({ tag: "sps-nav-tab" })
|
|
1968
|
-
], SpsNavTabComponent);
|
|
1969
|
-
var __defProp$3 = Object.defineProperty;
|
|
1970
|
-
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
1971
|
-
var __decorateClass$3 = (decorators, target, key2, kind) => {
|
|
1972
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key2) : target;
|
|
1973
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1974
|
-
if (decorator = decorators[i])
|
|
1975
|
-
result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
|
|
1976
|
-
if (kind && result)
|
|
1977
|
-
__defProp$3(target, key2, result);
|
|
1978
|
-
return result;
|
|
1979
|
-
};
|
|
1980
|
-
let SpsNavTabSetComponent = class extends HTMLElement {
|
|
1981
|
-
constructor() {
|
|
1982
|
-
super(...arguments);
|
|
1983
|
-
this.content = [];
|
|
1984
|
-
}
|
|
1985
|
-
render() {
|
|
1986
|
-
return /* @__PURE__ */ h("nav", {
|
|
1987
|
-
className: "sps-tabbed-nav"
|
|
1988
|
-
}, this.content);
|
|
1989
|
-
}
|
|
1990
|
-
};
|
|
1991
|
-
SpsNavTabSetComponent.displayName = "sps-nav-tab-set";
|
|
1992
|
-
SpsNavTabSetComponent.props = {};
|
|
1993
|
-
__decorateClass$3([
|
|
1994
|
-
Content()
|
|
1995
|
-
], SpsNavTabSetComponent.prototype, "content", 2);
|
|
1996
|
-
SpsNavTabSetComponent = __decorateClass$3([
|
|
1997
|
-
Component({ tag: "sps-nav-tab-set" })
|
|
1998
|
-
], SpsNavTabSetComponent);
|
|
1999
|
-
const SpsNavTabsExamples = {
|
|
2000
|
-
basic: {
|
|
2001
|
-
label: "Basic Navigation Tabs",
|
|
2002
|
-
description: code`
|
|
2003
|
-
<p>Navigation tabs native web component</p>
|
|
2004
|
-
`,
|
|
2005
|
-
examples: {
|
|
2006
|
-
basic: {
|
|
2007
|
-
react: code`
|
|
2008
|
-
function DemoComponent() {
|
|
2009
|
-
const tabs = [
|
|
2010
|
-
{ label: "Tab A", icon: "chart-line" },
|
|
2011
|
-
{ label: "Tab B", icon: "chart-bar", tag: "12" },
|
|
2012
|
-
{ label: "Tab C", icon: "chart-pie" }
|
|
2013
|
-
]
|
|
2014
|
-
|
|
2015
|
-
const [activeTab, setActiveTab] = React.useState(0)
|
|
2016
|
-
|
|
2017
|
-
return (
|
|
2018
|
-
<sps-nav-tab-set>
|
|
2019
|
-
{tabs.map((tab, index) => (
|
|
2020
|
-
<sps-nav-tab
|
|
2021
|
-
key={index}
|
|
2022
|
-
icon={tab.icon}
|
|
2023
|
-
label={tab.label}
|
|
2024
|
-
tag={tab.tag}
|
|
2025
|
-
active={index === activeTab || null}
|
|
2026
|
-
onClick={() => setActiveTab(index)}
|
|
2027
|
-
/>
|
|
2028
|
-
))}
|
|
2029
|
-
</sps-nav-tab-set>
|
|
2030
|
-
)
|
|
2031
|
-
}
|
|
2032
|
-
`
|
|
2033
|
-
}
|
|
2034
|
-
}
|
|
2035
|
-
}
|
|
2036
|
-
};
|
|
2037
|
-
var __defProp$2 = Object.defineProperty;
|
|
2038
|
-
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
2039
|
-
var __decorateClass$2 = (decorators, target, key2, kind) => {
|
|
2040
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key2) : target;
|
|
2041
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2042
|
-
if (decorator = decorators[i])
|
|
2043
|
-
result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
|
|
2044
|
-
if (kind && result)
|
|
2045
|
-
__defProp$2(target, key2, result);
|
|
2046
|
-
return result;
|
|
2047
|
-
};
|
|
2048
|
-
var SpsPhotoDisplayMode;
|
|
2049
|
-
(function(SpsPhotoDisplayMode2) {
|
|
2050
|
-
SpsPhotoDisplayMode2["FIT"] = "fit";
|
|
2051
|
-
SpsPhotoDisplayMode2["FILL"] = "fill";
|
|
2052
|
-
})(SpsPhotoDisplayMode || (SpsPhotoDisplayMode = {}));
|
|
2053
|
-
const CPT_NAME$2 = "sps-photo";
|
|
2054
|
-
let SpsPhotoComponent = class extends HTMLElement {
|
|
2055
|
-
constructor() {
|
|
2056
|
-
super(...arguments);
|
|
2057
|
-
this.mode = SpsPhotoDisplayMode.FILL;
|
|
2058
|
-
}
|
|
2059
|
-
get image() {
|
|
2060
|
-
return this.imageInternal;
|
|
2061
|
-
}
|
|
2062
|
-
set image(newValue) {
|
|
2063
|
-
this.imageInternal = newValue;
|
|
2064
|
-
if (newValue) {
|
|
2065
|
-
if (this.waitForImgHeightInterval) {
|
|
2066
|
-
window.clearInterval(this.waitForImgHeightInterval);
|
|
2067
|
-
}
|
|
2068
|
-
this.waitForImgHeightInterval = window.setInterval(() => {
|
|
2069
|
-
const imgRect = newValue.getBoundingClientRect();
|
|
2070
|
-
if (imgRect.height) {
|
|
2071
|
-
window.clearInterval(this.waitForImgHeightInterval);
|
|
2072
|
-
delete this.waitForImgHeightInterval;
|
|
2073
|
-
let imageIsLandscape = true;
|
|
2074
|
-
imageIsLandscape = imgRect.width / imgRect.height > 1;
|
|
2075
|
-
this.fitWidth = imageIsLandscape === (this.mode === SpsPhotoDisplayMode.FIT);
|
|
2076
|
-
}
|
|
2077
|
-
}, 1e3 / 60);
|
|
2078
|
-
}
|
|
2079
|
-
}
|
|
2080
|
-
get [ClassBindings]() {
|
|
2081
|
-
return [
|
|
2082
|
-
CPT_NAME$2,
|
|
2083
|
-
this.fitWidth ? `${CPT_NAME$2}--fit-width` : `${CPT_NAME$2}--fit-height`,
|
|
2084
|
-
this.placeholderIcon && `${CPT_NAME$2}--placeholder`
|
|
2085
|
-
];
|
|
2086
|
-
}
|
|
2087
|
-
get [StyleBindings]() {
|
|
2088
|
-
return {
|
|
2089
|
-
fontSize: `${this.width * 0.05}rem`,
|
|
2090
|
-
width: `${this.width}rem`,
|
|
2091
|
-
height: `${0.75 * this.width}rem`
|
|
2092
|
-
};
|
|
2093
|
-
}
|
|
2094
|
-
connectedCallback() {
|
|
2095
|
-
this.waitForWidthInterval = window.setInterval(() => {
|
|
2096
|
-
const boundingClientRect = this.getBoundingClientRect();
|
|
2097
|
-
if (boundingClientRect.width) {
|
|
2098
|
-
this.setWidth(boundingClientRect.width);
|
|
2099
|
-
window.clearInterval(this.waitForWidthInterval);
|
|
2100
|
-
delete this.waitForWidthInterval;
|
|
2101
|
-
}
|
|
2102
|
-
}, 1e3 / 60);
|
|
2103
|
-
}
|
|
2104
|
-
disconnectedCallback() {
|
|
2105
|
-
if (this.waitForWidthInterval) {
|
|
2106
|
-
window.clearInterval(this.waitForWidthInterval);
|
|
2107
|
-
}
|
|
2108
|
-
if (this.waitForImgHeightInterval) {
|
|
2109
|
-
window.clearInterval(this.waitForImgHeightInterval);
|
|
2110
|
-
}
|
|
2111
|
-
}
|
|
2112
|
-
render() {
|
|
2113
|
-
if (this.src) {
|
|
2114
|
-
return this.width ? /* @__PURE__ */ h("img", {
|
|
2115
|
-
src: this.src,
|
|
2116
|
-
alt: this.altText
|
|
2117
|
-
}) : /* @__PURE__ */ h("span", null);
|
|
2118
|
-
}
|
|
2119
|
-
return /* @__PURE__ */ h("i", {
|
|
2120
|
-
className: `sps-icon sps-icon-${this.placeholderIcon}`
|
|
2121
|
-
});
|
|
2122
|
-
}
|
|
2123
|
-
setWidth(hostWidth) {
|
|
2124
|
-
if (hostWidth && !this.width) {
|
|
2125
|
-
const baseFontSize = document.body.parentElement.style.fontSize || "16px";
|
|
2126
|
-
const remPx = Number(baseFontSize.substr(0, baseFontSize.length - 2));
|
|
2127
|
-
this.width = hostWidth / remPx;
|
|
2128
|
-
}
|
|
2129
|
-
}
|
|
2130
|
-
};
|
|
2131
|
-
SpsPhotoComponent.displayName = CPT_NAME$2;
|
|
2132
|
-
SpsPhotoComponent.props = {
|
|
2133
|
-
src: "string",
|
|
2134
|
-
altText: "string",
|
|
2135
|
-
mode: "SpsPhotoDisplayMode",
|
|
2136
|
-
placeholderIcon: "SpsIcon"
|
|
2137
|
-
};
|
|
2138
|
-
__decorateClass$2([
|
|
2139
|
-
Prop()
|
|
2140
|
-
], SpsPhotoComponent.prototype, "src", 2);
|
|
2141
|
-
__decorateClass$2([
|
|
2142
|
-
Prop()
|
|
2143
|
-
], SpsPhotoComponent.prototype, "altText", 2);
|
|
2144
|
-
__decorateClass$2([
|
|
2145
|
-
Prop()
|
|
2146
|
-
], SpsPhotoComponent.prototype, "mode", 2);
|
|
2147
|
-
__decorateClass$2([
|
|
2148
|
-
Prop()
|
|
2149
|
-
], SpsPhotoComponent.prototype, "placeholderIcon", 2);
|
|
2150
|
-
__decorateClass$2([
|
|
2151
|
-
Watch()
|
|
2152
|
-
], SpsPhotoComponent.prototype, "width", 2);
|
|
2153
|
-
__decorateClass$2([
|
|
2154
|
-
Watch()
|
|
2155
|
-
], SpsPhotoComponent.prototype, "fitWidth", 2);
|
|
2156
|
-
__decorateClass$2([
|
|
2157
|
-
QuerySelector("img", { refresh: true })
|
|
2158
|
-
], SpsPhotoComponent.prototype, "image", 1);
|
|
2159
|
-
SpsPhotoComponent = __decorateClass$2([
|
|
2160
|
-
Component({ tag: CPT_NAME$2 })
|
|
2161
|
-
], SpsPhotoComponent);
|
|
2162
|
-
const SpsPhotoExamples = {
|
|
2163
|
-
sizing: {
|
|
2164
|
-
label: "Sizing",
|
|
2165
|
-
description: code`
|
|
2166
|
-
<p>
|
|
2167
|
-
Photos are block elements, so a photo fills its container's width unless
|
|
2168
|
-
an explicit width is set. It is always a 4:3 aspect ratio. In this example,
|
|
2169
|
-
photos have been placed in cards which have different widths in the 12
|
|
2170
|
-
column grid.
|
|
2171
|
-
</p>
|
|
2172
|
-
`,
|
|
2173
|
-
examples: {
|
|
2174
|
-
basic: {
|
|
2175
|
-
jsx: code`
|
|
2176
|
-
<div className="sfg-row">
|
|
2177
|
-
<div className="sfg-col-2">
|
|
2178
|
-
<sps-card>
|
|
2179
|
-
<sps-photo src="assets/images/photo-landscape.jpg"></sps-photo>
|
|
2180
|
-
</sps-card>
|
|
2181
|
-
</div>
|
|
2182
|
-
<div className="sfg-col-4">
|
|
2183
|
-
<sps-card>
|
|
2184
|
-
<sps-photo src="assets/images/photo-landscape.jpg"></sps-photo>
|
|
2185
|
-
</sps-card>
|
|
2186
|
-
</div>
|
|
2187
|
-
<div className="sfg-col-6">
|
|
2188
|
-
<sps-card>
|
|
2189
|
-
<sps-photo src="assets/images/photo-landscape.jpg"></sps-photo>
|
|
2190
|
-
</sps-card>
|
|
2191
|
-
</div>
|
|
2192
|
-
</div>
|
|
2193
|
-
`
|
|
2194
|
-
}
|
|
2195
|
-
}
|
|
2196
|
-
},
|
|
2197
|
-
displayMode: {
|
|
2198
|
-
label: "Fill vs. Fit",
|
|
2199
|
-
description: code`
|
|
2200
|
-
<p>
|
|
2201
|
-
There are two display modes available:
|
|
2202
|
-
<ul>
|
|
2203
|
-
<li><b>"fill"</b> fills the entire 4:3 container, cropping off any excess portions of the image.
|
|
2204
|
-
<li><b>"fit"</b> fits the entire image into the container, leaving any excess portions of the container blank.
|
|
2205
|
-
</ul>
|
|
2206
|
-
</p>
|
|
2207
|
-
`,
|
|
1607
|
+
downloadButton: {
|
|
1608
|
+
label: "Download Button",
|
|
1609
|
+
description: c`
|
|
1610
|
+
<p>You can optionally provide a button to download a file. Typically this will be a template for
|
|
1611
|
+
whatever the user is expected to upload. They can then fill out the template, save it, and upload it.</p>
|
|
1612
|
+
`,
|
|
2208
1613
|
examples: {
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
1614
|
+
downloadButton: {
|
|
1615
|
+
react: c`
|
|
1616
|
+
function Component() {
|
|
1617
|
+
const ref = React.useRef()
|
|
1618
|
+
|
|
1619
|
+
function handleDownload() {
|
|
1620
|
+
console.log("Download triggered.")
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
React.useEffect(() => {
|
|
1624
|
+
ref.current.addEventListener("download", handleDownload)
|
|
1625
|
+
return () => {
|
|
1626
|
+
ref.current.removeEventListener("download", handleDownload)
|
|
1627
|
+
}
|
|
1628
|
+
})
|
|
1629
|
+
|
|
1630
|
+
return (
|
|
1631
|
+
<div className="sps-row">
|
|
1632
|
+
<div className="col-12">
|
|
1633
|
+
<sps-file-upload
|
|
1634
|
+
ref={ref}
|
|
1635
|
+
description="Spreadsheet"
|
|
1636
|
+
acceptExtensions="xlsx"
|
|
1637
|
+
downloadLabel="Download Excel Template"
|
|
1638
|
+
/>
|
|
1639
|
+
</div>
|
|
1640
|
+
</div>
|
|
1641
|
+
)
|
|
1642
|
+
}
|
|
1643
|
+
`
|
|
2234
1644
|
}
|
|
2235
1645
|
}
|
|
2236
1646
|
},
|
|
2237
|
-
|
|
2238
|
-
label: "
|
|
2239
|
-
description:
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
The placeholder's icon, selected from our SPS icon set, should represent the
|
|
2245
|
-
type of image it is substituting for.
|
|
2246
|
-
</p>
|
|
2247
|
-
`,
|
|
1647
|
+
mini: {
|
|
1648
|
+
label: "Mini File Upload",
|
|
1649
|
+
description: c`
|
|
1650
|
+
<p>When the file upload component is to be placed in a small container,
|
|
1651
|
+
it should be marked as a mini file upload so that everything fits.</p>
|
|
1652
|
+
`,
|
|
2248
1653
|
examples: {
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
<sps-photo placeholderIcon="user"></sps-photo>
|
|
2275
|
-
</div>
|
|
2276
|
-
</div>
|
|
2277
|
-
`
|
|
2278
|
-
},
|
|
2279
|
-
group: {
|
|
2280
|
-
description: "<p>Group / Multiple People</p>",
|
|
2281
|
-
jsx: code`
|
|
2282
|
-
<div className="sfg-row">
|
|
2283
|
-
<div className="sfg-col-3">
|
|
2284
|
-
<sps-photo placeholderIcon="group"></sps-photo>
|
|
2285
|
-
</div>
|
|
2286
|
-
</div>
|
|
2287
|
-
`
|
|
2288
|
-
},
|
|
2289
|
-
company: {
|
|
2290
|
-
description: "<p>Company / Building</p>",
|
|
2291
|
-
jsx: code`
|
|
2292
|
-
<div className="sfg-row">
|
|
2293
|
-
<div className="sfg-col-3">
|
|
2294
|
-
<sps-photo placeholderIcon="building"></sps-photo>
|
|
2295
|
-
</div>
|
|
2296
|
-
</div>
|
|
2297
|
-
`
|
|
1654
|
+
single: {
|
|
1655
|
+
react: c`
|
|
1656
|
+
function Component() {
|
|
1657
|
+
const ref = React.useRef()
|
|
1658
|
+
|
|
1659
|
+
function handleChange(event) {
|
|
1660
|
+
console.log(event.detail)
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
React.useEffect(() => {
|
|
1664
|
+
ref.current.addEventListener("selection", handleChange)
|
|
1665
|
+
return () => {
|
|
1666
|
+
ref.current.removeEventListener("selection", handleChange)
|
|
1667
|
+
}
|
|
1668
|
+
})
|
|
1669
|
+
|
|
1670
|
+
return (
|
|
1671
|
+
<div className="sps-row">
|
|
1672
|
+
<div className="col-4">
|
|
1673
|
+
<sps-file-upload ref={ref} mini/>
|
|
1674
|
+
</div>
|
|
1675
|
+
</div>
|
|
1676
|
+
)
|
|
1677
|
+
}
|
|
1678
|
+
`
|
|
2298
1679
|
}
|
|
2299
1680
|
}
|
|
2300
|
-
}
|
|
2301
|
-
};
|
|
2302
|
-
const MANIFEST = {
|
|
2303
|
-
"File Upload": {
|
|
2304
|
-
components: [SpsFileUploadComponent],
|
|
2305
|
-
examples: SpsFileUploadExamples
|
|
2306
1681
|
},
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
1682
|
+
constrainContentWidth: {
|
|
1683
|
+
label: "Constrain Content Width",
|
|
1684
|
+
description: c`
|
|
1685
|
+
<p>If this prop is provided, the content will be restricted to 50% of
|
|
1686
|
+
the overall width of the component. Consult your product designer if
|
|
1687
|
+
you're not sure whether to use this variant.</p>
|
|
1688
|
+
`,
|
|
1689
|
+
examples: {
|
|
1690
|
+
constrainContentWidth: {
|
|
1691
|
+
react: c`
|
|
1692
|
+
function Component() {
|
|
1693
|
+
const ref = React.useRef()
|
|
1694
|
+
|
|
1695
|
+
function handleChange(event: CustomEvent<Array<File>>) {
|
|
1696
|
+
console.log(event.detail)
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
React.useEffect(() => {
|
|
1700
|
+
ref.current.addEventListener("selection", handleChange)
|
|
1701
|
+
return () => {
|
|
1702
|
+
ref.current.removeEventListener("selection", handleChange)
|
|
1703
|
+
}
|
|
1704
|
+
})
|
|
1705
|
+
|
|
1706
|
+
return (
|
|
1707
|
+
<div className="sps-row">
|
|
1708
|
+
<div className="col-4">
|
|
1709
|
+
<sps-file-upload ref={ref} constrainContentWidth/>
|
|
1710
|
+
</div>
|
|
1711
|
+
</div>
|
|
1712
|
+
)
|
|
1713
|
+
}
|
|
1714
|
+
`
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
2314
1717
|
}
|
|
2315
1718
|
};
|
|
2316
|
-
var
|
|
2317
|
-
var
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2321
|
-
if (decorator = decorators[i])
|
|
2322
|
-
result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
|
|
2323
|
-
if (kind && result)
|
|
2324
|
-
__defProp$1(target, key2, result);
|
|
2325
|
-
return result;
|
|
1719
|
+
var ds = Object.defineProperty, hs = Object.getOwnPropertyDescriptor, A = (e, t, s, n) => {
|
|
1720
|
+
for (var i = n > 1 ? void 0 : n ? hs(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
1721
|
+
(l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
|
|
1722
|
+
return n && i && ds(t, s, i), i;
|
|
2326
1723
|
};
|
|
2327
|
-
const
|
|
2328
|
-
|
|
1724
|
+
const _ = "sps-insight-card";
|
|
1725
|
+
var X;
|
|
1726
|
+
let y = (X = class extends HTMLElement {
|
|
2329
1727
|
constructor() {
|
|
2330
1728
|
super(...arguments);
|
|
2331
|
-
this
|
|
2332
|
-
|
|
2333
|
-
|
|
1729
|
+
a(this, "icon");
|
|
1730
|
+
a(this, "kind", ot.GENERAL);
|
|
1731
|
+
a(this, "title");
|
|
1732
|
+
a(this, "metric");
|
|
1733
|
+
a(this, "partnerCount");
|
|
1734
|
+
a(this, "totalPartners");
|
|
1735
|
+
a(this, "secondary");
|
|
1736
|
+
a(this, "content");
|
|
1737
|
+
a(this, "detail");
|
|
1738
|
+
}
|
|
1739
|
+
get [T]() {
|
|
2334
1740
|
return [
|
|
2335
|
-
|
|
2336
|
-
`${
|
|
2337
|
-
this.detail && this.detail.children.length ? `${
|
|
1741
|
+
_,
|
|
1742
|
+
`${_}--${this.kind}`,
|
|
1743
|
+
this.detail && this.detail.children.length ? `${_}--has-detail` : null
|
|
2338
1744
|
];
|
|
2339
1745
|
}
|
|
2340
1746
|
render({ t }) {
|
|
2341
|
-
const
|
|
2342
|
-
className: `${
|
|
2343
|
-
}, this.metric)
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
className: `${CPT_NAME$1}__title`,
|
|
1747
|
+
const s = /* @__PURE__ */ o("div", {
|
|
1748
|
+
className: `${_}__metric-count`
|
|
1749
|
+
}, this.metric), n = /* @__PURE__ */ o("div", {
|
|
1750
|
+
className: `${_}__description`
|
|
1751
|
+
}, /* @__PURE__ */ o("div", {
|
|
1752
|
+
className: `${_}__title`,
|
|
2348
1753
|
style: { "-webkit-box-orient": "vertical" }
|
|
2349
|
-
}, this.title), /* @__PURE__ */
|
|
2350
|
-
className: `${
|
|
2351
|
-
}, this.content))
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
total
|
|
1754
|
+
}, this.title), /* @__PURE__ */ o("div", {
|
|
1755
|
+
className: `${_}__detail`
|
|
1756
|
+
}, this.content)), [
|
|
1757
|
+
i,
|
|
1758
|
+
r,
|
|
1759
|
+
l
|
|
2356
1760
|
] = (this.partnerCount ? t("design-system:insightCard.partnerCount", { count: this.partnerCount, total: this.totalPartners }) : "").split("|");
|
|
2357
|
-
return /* @__PURE__ */
|
|
2358
|
-
"data-fragment":
|
|
2359
|
-
}, /* @__PURE__ */
|
|
2360
|
-
className: `${
|
|
2361
|
-
}, this.icon ? /* @__PURE__ */
|
|
1761
|
+
return /* @__PURE__ */ o("div", {
|
|
1762
|
+
"data-fragment": !0
|
|
1763
|
+
}, /* @__PURE__ */ o("div", {
|
|
1764
|
+
className: `${_}__body`
|
|
1765
|
+
}, this.icon ? /* @__PURE__ */ o("i", {
|
|
2362
1766
|
className: `sps-icon sps-icon-${this.icon}`
|
|
2363
|
-
}) : /* @__PURE__ */
|
|
2364
|
-
className: `sps-icon sps-icon-${
|
|
2365
|
-
}),
|
|
2366
|
-
className: `${
|
|
2367
|
-
}, this.partnerCount === this.totalPartners ? /* @__PURE__ */
|
|
2368
|
-
"data-fragment":
|
|
2369
|
-
}, /* @__PURE__ */
|
|
2370
|
-
className: `${
|
|
1767
|
+
}) : /* @__PURE__ */ o("i", {
|
|
1768
|
+
className: `sps-icon sps-icon-${lt[this.kind]}`
|
|
1769
|
+
}), s, n), this.partnerCount && /* @__PURE__ */ o("div", {
|
|
1770
|
+
className: `${_}__partner-count`
|
|
1771
|
+
}, this.partnerCount === this.totalPartners ? /* @__PURE__ */ o("div", null, t("design-system:insightCard.all")) : /* @__PURE__ */ o("div", {
|
|
1772
|
+
"data-fragment": !0
|
|
1773
|
+
}, /* @__PURE__ */ o("div", null, i), /* @__PURE__ */ o("div", null, r), /* @__PURE__ */ o("div", null, l)), /* @__PURE__ */ o("div", {
|
|
1774
|
+
className: `${_}__partners-text`
|
|
2371
1775
|
}, t("design-system:insightCard.partners"))));
|
|
2372
1776
|
}
|
|
2373
|
-
}
|
|
2374
|
-
SpsInsightCardComponent.displayName = CPT_NAME$1;
|
|
2375
|
-
SpsInsightCardComponent.props = {
|
|
1777
|
+
}, a(X, "displayName", _), a(X, "props", {
|
|
2376
1778
|
icon: "SpsIcon",
|
|
2377
1779
|
kind: "SpsInsightCardKind",
|
|
2378
1780
|
title: "string",
|
|
@@ -2380,98 +1782,91 @@ SpsInsightCardComponent.props = {
|
|
|
2380
1782
|
partnerCount: "number",
|
|
2381
1783
|
totalPartners: "number",
|
|
2382
1784
|
secondary: "boolean"
|
|
1785
|
+
}), X);
|
|
1786
|
+
A([
|
|
1787
|
+
p()
|
|
1788
|
+
], y.prototype, "icon", 2);
|
|
1789
|
+
A([
|
|
1790
|
+
p()
|
|
1791
|
+
], y.prototype, "kind", 2);
|
|
1792
|
+
A([
|
|
1793
|
+
p()
|
|
1794
|
+
], y.prototype, "title", 2);
|
|
1795
|
+
A([
|
|
1796
|
+
p()
|
|
1797
|
+
], y.prototype, "metric", 2);
|
|
1798
|
+
A([
|
|
1799
|
+
p()
|
|
1800
|
+
], y.prototype, "partnerCount", 2);
|
|
1801
|
+
A([
|
|
1802
|
+
p()
|
|
1803
|
+
], y.prototype, "totalPartners", 2);
|
|
1804
|
+
A([
|
|
1805
|
+
p()
|
|
1806
|
+
], y.prototype, "secondary", 2);
|
|
1807
|
+
A([
|
|
1808
|
+
_e()
|
|
1809
|
+
], y.prototype, "content", 2);
|
|
1810
|
+
A([
|
|
1811
|
+
xe(`.${_}__detail`)
|
|
1812
|
+
], y.prototype, "detail", 2);
|
|
1813
|
+
y = A([
|
|
1814
|
+
j({ tag: _ })
|
|
1815
|
+
], y);
|
|
1816
|
+
var us = Object.defineProperty, fs = Object.getOwnPropertyDescriptor, ye = (e, t, s, n) => {
|
|
1817
|
+
for (var i = n > 1 ? void 0 : n ? fs(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
1818
|
+
(l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
|
|
1819
|
+
return n && i && us(t, s, i), i;
|
|
2383
1820
|
};
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
__decorateClass$1([
|
|
2388
|
-
Prop()
|
|
2389
|
-
], SpsInsightCardComponent.prototype, "kind", 2);
|
|
2390
|
-
__decorateClass$1([
|
|
2391
|
-
Prop()
|
|
2392
|
-
], SpsInsightCardComponent.prototype, "title", 2);
|
|
2393
|
-
__decorateClass$1([
|
|
2394
|
-
Prop()
|
|
2395
|
-
], SpsInsightCardComponent.prototype, "metric", 2);
|
|
2396
|
-
__decorateClass$1([
|
|
2397
|
-
Prop()
|
|
2398
|
-
], SpsInsightCardComponent.prototype, "partnerCount", 2);
|
|
2399
|
-
__decorateClass$1([
|
|
2400
|
-
Prop()
|
|
2401
|
-
], SpsInsightCardComponent.prototype, "totalPartners", 2);
|
|
2402
|
-
__decorateClass$1([
|
|
2403
|
-
Prop()
|
|
2404
|
-
], SpsInsightCardComponent.prototype, "secondary", 2);
|
|
2405
|
-
__decorateClass$1([
|
|
2406
|
-
Content()
|
|
2407
|
-
], SpsInsightCardComponent.prototype, "content", 2);
|
|
2408
|
-
__decorateClass$1([
|
|
2409
|
-
QuerySelector(`.${CPT_NAME$1}__detail`)
|
|
2410
|
-
], SpsInsightCardComponent.prototype, "detail", 2);
|
|
2411
|
-
SpsInsightCardComponent = __decorateClass$1([
|
|
2412
|
-
Component({ tag: CPT_NAME$1 })
|
|
2413
|
-
], SpsInsightCardComponent);
|
|
2414
|
-
var __defProp = Object.defineProperty;
|
|
2415
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
2416
|
-
var __decorateClass = (decorators, target, key2, kind) => {
|
|
2417
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key2) : target;
|
|
2418
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2419
|
-
if (decorator = decorators[i])
|
|
2420
|
-
result = (kind ? decorator(target, key2, result) : decorator(result)) || result;
|
|
2421
|
-
if (kind && result)
|
|
2422
|
-
__defProp(target, key2, result);
|
|
2423
|
-
return result;
|
|
2424
|
-
};
|
|
2425
|
-
const CPT_NAME = "sps-insights";
|
|
2426
|
-
let SpsInsightsComponent = class extends HTMLElement {
|
|
1821
|
+
const D = "sps-insights";
|
|
1822
|
+
var K;
|
|
1823
|
+
let te = (K = class extends HTMLElement {
|
|
2427
1824
|
constructor() {
|
|
2428
1825
|
super();
|
|
2429
|
-
this
|
|
2430
|
-
this
|
|
1826
|
+
a(this, "content", []);
|
|
1827
|
+
a(this, "details");
|
|
1828
|
+
a(this, "showAdditionalInsights", !1);
|
|
2431
1829
|
this.toggleAdditionalInsights = this.toggleAdditionalInsights.bind(this);
|
|
2432
1830
|
}
|
|
2433
|
-
get [
|
|
1831
|
+
get [T]() {
|
|
2434
1832
|
return [
|
|
2435
|
-
|
|
2436
|
-
this.showAdditionalInsights && `${
|
|
2437
|
-
this.details && Array.from(this.details).every((
|
|
2438
|
-
this.content.length === 6 ? `${
|
|
2439
|
-
this.content.length === 7 ? `${
|
|
2440
|
-
this.content.length === 8 ? `${
|
|
1833
|
+
D,
|
|
1834
|
+
this.showAdditionalInsights && `${D}--show-additional`,
|
|
1835
|
+
this.details && Array.from(this.details).every((t) => !t.textContent) ? `${D}--no-details` : null,
|
|
1836
|
+
this.content.length === 6 ? `${D}--break-4` : null,
|
|
1837
|
+
this.content.length === 7 ? `${D}--break-5` : null,
|
|
1838
|
+
this.content.length === 8 ? `${D}--break-5` : null
|
|
2441
1839
|
];
|
|
2442
1840
|
}
|
|
2443
1841
|
toggleAdditionalInsights() {
|
|
2444
|
-
this.showAdditionalInsights = !this.showAdditionalInsights;
|
|
2445
|
-
this.update();
|
|
1842
|
+
this.showAdditionalInsights = !this.showAdditionalInsights, this.update();
|
|
2446
1843
|
}
|
|
2447
1844
|
render() {
|
|
2448
|
-
return /* @__PURE__ */
|
|
2449
|
-
"data-fragment":
|
|
2450
|
-
}, this.content, this.content.length > 10 && /* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ o("div", {
|
|
1846
|
+
"data-fragment": !0
|
|
1847
|
+
}, this.content, this.content.length > 10 && /* @__PURE__ */ o("div", {
|
|
2451
1848
|
className: "sps-button sps-button--link",
|
|
2452
1849
|
onClick: this.toggleAdditionalInsights
|
|
2453
|
-
}, /* @__PURE__ */
|
|
1850
|
+
}, /* @__PURE__ */ o("button", {
|
|
2454
1851
|
type: "button"
|
|
2455
1852
|
}, this.showAdditionalInsights ? "Hide " : "Show ", "Additional Insights")));
|
|
2456
1853
|
}
|
|
2457
|
-
};
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
], SpsInsightsComponent);
|
|
2469
|
-
const SpsInsightCardExamples = {
|
|
1854
|
+
}, a(K, "displayName", D), a(K, "props", {}), K);
|
|
1855
|
+
ye([
|
|
1856
|
+
_e()
|
|
1857
|
+
], te.prototype, "content", 2);
|
|
1858
|
+
ye([
|
|
1859
|
+
is(".sps-insight-card__detail")
|
|
1860
|
+
], te.prototype, "details", 2);
|
|
1861
|
+
te = ye([
|
|
1862
|
+
j({ tag: D })
|
|
1863
|
+
], te);
|
|
1864
|
+
const As = {
|
|
2470
1865
|
basic: {
|
|
2471
1866
|
label: "Basic Insight Cards",
|
|
2472
1867
|
examples: {
|
|
2473
1868
|
basic: {
|
|
2474
|
-
jsx:
|
|
1869
|
+
jsx: c`
|
|
2475
1870
|
<sps-insights>
|
|
2476
1871
|
<sps-insight-card kind="general"
|
|
2477
1872
|
metric="1234"
|
|
@@ -2502,7 +1897,7 @@ const SpsInsightCardExamples = {
|
|
|
2502
1897
|
label: "With Details",
|
|
2503
1898
|
examples: {
|
|
2504
1899
|
details: {
|
|
2505
|
-
jsx:
|
|
1900
|
+
jsx: c`
|
|
2506
1901
|
<sps-insights>
|
|
2507
1902
|
<sps-insight-card kind="general"
|
|
2508
1903
|
metric="1234"
|
|
@@ -2555,7 +1950,7 @@ const SpsInsightCardExamples = {
|
|
|
2555
1950
|
label: "Partner Count",
|
|
2556
1951
|
examples: {
|
|
2557
1952
|
partner_count: {
|
|
2558
|
-
jsx:
|
|
1953
|
+
jsx: c`
|
|
2559
1954
|
<sps-insights>
|
|
2560
1955
|
<sps-insight-card kind="general"
|
|
2561
1956
|
metric="1234"
|
|
@@ -2596,7 +1991,7 @@ const SpsInsightCardExamples = {
|
|
|
2596
1991
|
label: "10+ Insight Cards",
|
|
2597
1992
|
examples: {
|
|
2598
1993
|
expansion: {
|
|
2599
|
-
jsx:
|
|
1994
|
+
jsx: c`
|
|
2600
1995
|
<sps-insights>
|
|
2601
1996
|
<sps-insight-card kind="general"
|
|
2602
1997
|
metric="1234"
|
|
@@ -2711,13 +2106,13 @@ const SpsInsightCardExamples = {
|
|
|
2711
2106
|
},
|
|
2712
2107
|
events: {
|
|
2713
2108
|
label: "Adding a click handler",
|
|
2714
|
-
description:
|
|
2109
|
+
description: c`
|
|
2715
2110
|
<p>Attaching event handlers to native web components in React cannot be done the usual way at this time.
|
|
2716
2111
|
Here is how to do it:</p>
|
|
2717
2112
|
`,
|
|
2718
2113
|
examples: {
|
|
2719
2114
|
events: {
|
|
2720
|
-
react:
|
|
2115
|
+
react: c`
|
|
2721
2116
|
function Component() {
|
|
2722
2117
|
function handleClick() {
|
|
2723
2118
|
window.alert("Insight card clicked");
|
|
@@ -2757,7 +2152,7 @@ const SpsInsightCardExamples = {
|
|
|
2757
2152
|
label: "Using alternate icons",
|
|
2758
2153
|
examples: {
|
|
2759
2154
|
basic: {
|
|
2760
|
-
react:
|
|
2155
|
+
react: c`
|
|
2761
2156
|
function DemoComponent() {
|
|
2762
2157
|
return (
|
|
2763
2158
|
<sps-insights>
|
|
@@ -2799,4 +2194,155 @@ const SpsInsightCardExamples = {
|
|
|
2799
2194
|
}
|
|
2800
2195
|
}
|
|
2801
2196
|
};
|
|
2802
|
-
|
|
2197
|
+
var gs = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, L = (e, t, s, n) => {
|
|
2198
|
+
for (var i = n > 1 ? void 0 : n ? ms(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
2199
|
+
(l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
|
|
2200
|
+
return n && i && gs(t, s, i), i;
|
|
2201
|
+
}, Q;
|
|
2202
|
+
let P = (Q = class extends HTMLElement {
|
|
2203
|
+
constructor() {
|
|
2204
|
+
super(...arguments);
|
|
2205
|
+
a(this, "active", !1);
|
|
2206
|
+
a(this, "label", "");
|
|
2207
|
+
a(this, "icon");
|
|
2208
|
+
a(this, "tag", "");
|
|
2209
|
+
a(this, "href");
|
|
2210
|
+
a(this, "target");
|
|
2211
|
+
}
|
|
2212
|
+
get [T]() {
|
|
2213
|
+
return [
|
|
2214
|
+
"sps-tabbed-nav__nav-item",
|
|
2215
|
+
this.active && "sps-tabbed-nav__nav-item--active"
|
|
2216
|
+
];
|
|
2217
|
+
}
|
|
2218
|
+
render() {
|
|
2219
|
+
return /* @__PURE__ */ o("a", {
|
|
2220
|
+
href: this.href,
|
|
2221
|
+
target: this.target,
|
|
2222
|
+
className: "sps-tabbed-nav__nav-item-link",
|
|
2223
|
+
tabIndex: 0
|
|
2224
|
+
}, this.icon && /* @__PURE__ */ o("i", {
|
|
2225
|
+
className: `sps-icon sps-icon-${this.icon}`
|
|
2226
|
+
}), this.label && /* @__PURE__ */ o("span", null, this.label), this.tag && /* @__PURE__ */ o("span", {
|
|
2227
|
+
className: "sps-tag sps-tag--default"
|
|
2228
|
+
}, this.tag));
|
|
2229
|
+
}
|
|
2230
|
+
}, a(Q, "displayName", "sps-nav-tab"), a(Q, "props", {
|
|
2231
|
+
active: "boolean",
|
|
2232
|
+
label: "string",
|
|
2233
|
+
icon: "SpsIcon",
|
|
2234
|
+
tag: "string",
|
|
2235
|
+
href: "string",
|
|
2236
|
+
target: "string"
|
|
2237
|
+
}), Q);
|
|
2238
|
+
L([
|
|
2239
|
+
p()
|
|
2240
|
+
], P.prototype, "active", 2);
|
|
2241
|
+
L([
|
|
2242
|
+
p()
|
|
2243
|
+
], P.prototype, "label", 2);
|
|
2244
|
+
L([
|
|
2245
|
+
p()
|
|
2246
|
+
], P.prototype, "icon", 2);
|
|
2247
|
+
L([
|
|
2248
|
+
p()
|
|
2249
|
+
], P.prototype, "tag", 2);
|
|
2250
|
+
L([
|
|
2251
|
+
p()
|
|
2252
|
+
], P.prototype, "href", 2);
|
|
2253
|
+
L([
|
|
2254
|
+
p()
|
|
2255
|
+
], P.prototype, "target", 2);
|
|
2256
|
+
P = L([
|
|
2257
|
+
j({ tag: "sps-nav-tab" })
|
|
2258
|
+
], P);
|
|
2259
|
+
var vs = Object.defineProperty, bs = Object.getOwnPropertyDescriptor, st = (e, t, s, n) => {
|
|
2260
|
+
for (var i = n > 1 ? void 0 : n ? bs(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
2261
|
+
(l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
|
|
2262
|
+
return n && i && vs(t, s, i), i;
|
|
2263
|
+
}, Z;
|
|
2264
|
+
let ue = (Z = class extends HTMLElement {
|
|
2265
|
+
constructor() {
|
|
2266
|
+
super(...arguments);
|
|
2267
|
+
a(this, "content", []);
|
|
2268
|
+
}
|
|
2269
|
+
render() {
|
|
2270
|
+
return /* @__PURE__ */ o("nav", {
|
|
2271
|
+
className: "sps-tabbed-nav"
|
|
2272
|
+
}, this.content);
|
|
2273
|
+
}
|
|
2274
|
+
}, a(Z, "displayName", "sps-nav-tab-set"), a(Z, "props", {}), Z);
|
|
2275
|
+
st([
|
|
2276
|
+
_e()
|
|
2277
|
+
], ue.prototype, "content", 2);
|
|
2278
|
+
ue = st([
|
|
2279
|
+
j({ tag: "sps-nav-tab-set" })
|
|
2280
|
+
], ue);
|
|
2281
|
+
const Ds = {
|
|
2282
|
+
basic: {
|
|
2283
|
+
label: "Basic Navigation Tabs",
|
|
2284
|
+
description: c`
|
|
2285
|
+
<p>Navigation tabs native web component</p>
|
|
2286
|
+
`,
|
|
2287
|
+
examples: {
|
|
2288
|
+
basic: {
|
|
2289
|
+
react: c`
|
|
2290
|
+
function DemoComponent() {
|
|
2291
|
+
const tabs = [
|
|
2292
|
+
{ label: "Tab A", icon: "chart-line" },
|
|
2293
|
+
{ label: "Tab B", icon: "chart-bar", tag: "12" },
|
|
2294
|
+
{ label: "Tab C", icon: "chart-pie" }
|
|
2295
|
+
]
|
|
2296
|
+
|
|
2297
|
+
const [activeTab, setActiveTab] = React.useState(0)
|
|
2298
|
+
|
|
2299
|
+
return (
|
|
2300
|
+
<sps-nav-tab-set>
|
|
2301
|
+
{tabs.map((tab, index) => (
|
|
2302
|
+
<sps-nav-tab
|
|
2303
|
+
key={index}
|
|
2304
|
+
icon={tab.icon}
|
|
2305
|
+
label={tab.label}
|
|
2306
|
+
tag={tab.tag}
|
|
2307
|
+
active={index === activeTab || null}
|
|
2308
|
+
onClick={() => setActiveTab(index)}
|
|
2309
|
+
/>
|
|
2310
|
+
))}
|
|
2311
|
+
</sps-nav-tab-set>
|
|
2312
|
+
)
|
|
2313
|
+
}
|
|
2314
|
+
`
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
};
|
|
2319
|
+
export {
|
|
2320
|
+
Ie as AttrBindings,
|
|
2321
|
+
T as ClassBindings,
|
|
2322
|
+
j as Component,
|
|
2323
|
+
_e as Content,
|
|
2324
|
+
Ne as EventDispatcher,
|
|
2325
|
+
re as EventListener,
|
|
2326
|
+
Ss as MANIFEST,
|
|
2327
|
+
tt as MIMEType,
|
|
2328
|
+
p as Prop,
|
|
2329
|
+
xe as QuerySelector,
|
|
2330
|
+
is as QuerySelectorAll,
|
|
2331
|
+
f as SpsFileUploadComponent,
|
|
2332
|
+
Os as SpsFileUploadExamples,
|
|
2333
|
+
y as SpsInsightCardComponent,
|
|
2334
|
+
As as SpsInsightCardExamples,
|
|
2335
|
+
te as SpsInsightsComponent,
|
|
2336
|
+
P as SpsNavTabComponent,
|
|
2337
|
+
ue as SpsNavTabSetComponent,
|
|
2338
|
+
Ds as SpsNavTabsExamples,
|
|
2339
|
+
O as SpsPhotoComponent,
|
|
2340
|
+
os as SpsPhotoDisplayMode,
|
|
2341
|
+
ls as SpsPhotoExamples,
|
|
2342
|
+
he as StyleBindings,
|
|
2343
|
+
et as Watch,
|
|
2344
|
+
o as h,
|
|
2345
|
+
ys as namespaceOverrideRegistrar,
|
|
2346
|
+
xs as register,
|
|
2347
|
+
Ns as webComponentsUseI18n
|
|
2348
|
+
};
|