@sitecore-feaas/clientside 0.0.3 → 0.0.4
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/browser/index.cjs +83 -3
- package/dist/browser/index.d.ts +2 -2
- package/dist/browser/index.js +83 -3
- package/dist/browser/react.cjs +83 -3
- package/dist/browser/react.d.ts +2 -2
- package/dist/browser/react.js +83 -3
- package/dist/browser/{webcomponent-7a0e7c34.d.ts → webcomponent-6b45b819.d.ts} +18 -1
- package/dist/node/index.cjs +171 -1
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +171 -1
- package/dist/node/react.cjs +171 -1
- package/dist/node/react.d.ts +2 -2
- package/dist/node/react.js +171 -1
- package/dist/node/{webcomponent-7a0e7c34.d.ts → webcomponent-6b45b819.d.ts} +18 -1
- package/index.cjs +83 -3
- package/index.d.ts +2 -2
- package/index.js +83 -3
- package/package.json +1 -1
- package/react.cjs +83 -3
- package/react.d.ts +2 -2
- package/react.js +83 -3
- package/src/webcomponent.ts +204 -1
- package/{webcomponent-7a0e7c34.d.ts → webcomponent-6b45b819.d.ts} +18 -1
package/dist/node/index.cjs
CHANGED
|
@@ -1184,11 +1184,16 @@ var HTMLFeaasComponent = class extends WebComponent {
|
|
|
1184
1184
|
return;
|
|
1185
1185
|
if (name == "template") {
|
|
1186
1186
|
this.template = newValue;
|
|
1187
|
+
} else if (name != "date") {
|
|
1188
|
+
this.template = null;
|
|
1187
1189
|
}
|
|
1188
1190
|
if (name == "data" && this.children.length > 0) {
|
|
1189
1191
|
this.update();
|
|
1190
1192
|
} else {
|
|
1191
|
-
this.
|
|
1193
|
+
cancelAnimationFrame(this.rendering);
|
|
1194
|
+
this.rendering = requestAnimationFrame(() => {
|
|
1195
|
+
this.render();
|
|
1196
|
+
});
|
|
1192
1197
|
}
|
|
1193
1198
|
}
|
|
1194
1199
|
update() {
|
|
@@ -1294,9 +1299,174 @@ var HTMLFeaasStylesheet = class extends WebComponent {
|
|
|
1294
1299
|
};
|
|
1295
1300
|
}
|
|
1296
1301
|
};
|
|
1302
|
+
var HTMLFeaasPickerLazy = class extends WebComponent {
|
|
1303
|
+
constructor() {
|
|
1304
|
+
super(...arguments);
|
|
1305
|
+
this.src = "https://components.sitecorecloud.io/assets/picker.js";
|
|
1306
|
+
this.onClose = () => {
|
|
1307
|
+
this.set({
|
|
1308
|
+
mode: null
|
|
1309
|
+
});
|
|
1310
|
+
};
|
|
1311
|
+
this.onScriptLoaded = () => {
|
|
1312
|
+
this.element = document.createElement("feaas-picker");
|
|
1313
|
+
this.element.style.cssText = "border: 0; width: 100%; height: 100%; display: block";
|
|
1314
|
+
this.appendChild(this.element);
|
|
1315
|
+
this.set(this.getProps());
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1318
|
+
static get observedAttributes() {
|
|
1319
|
+
return ["library", "mode", "hidden", "src"];
|
|
1320
|
+
}
|
|
1321
|
+
connectedCallback() {
|
|
1322
|
+
this.loader = document.createElement("feaas-loader");
|
|
1323
|
+
this.loader.style.cssText = "position: absolute; top: 0; left: 0; right: 0;bottom: 0; ";
|
|
1324
|
+
this.appendChild(this.loader);
|
|
1325
|
+
}
|
|
1326
|
+
load() {
|
|
1327
|
+
if (!this.script) {
|
|
1328
|
+
this.script = document.createElement("script");
|
|
1329
|
+
this.script.type = "module";
|
|
1330
|
+
this.script.onload = this.onScriptLoaded;
|
|
1331
|
+
this.script.src = this.src;
|
|
1332
|
+
this.appendChild(this.script);
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
getProps() {
|
|
1336
|
+
return {
|
|
1337
|
+
mode: this.getAttribute("mode"),
|
|
1338
|
+
library: this.getAttribute("library"),
|
|
1339
|
+
src: this.getAttribute("src")
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
1343
|
+
this.set(this.getProps());
|
|
1344
|
+
}
|
|
1345
|
+
set(options) {
|
|
1346
|
+
Object.assign(this, options);
|
|
1347
|
+
const keys = Object.keys(this.getProps());
|
|
1348
|
+
for (var key of keys) {
|
|
1349
|
+
const value = this[key];
|
|
1350
|
+
if (value == null) {
|
|
1351
|
+
this.removeAttribute(key);
|
|
1352
|
+
this.load();
|
|
1353
|
+
} else if (this.getAttribute(key) != String(value)) {
|
|
1354
|
+
this.setAttribute(key, String(value));
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
if (this.mode) {
|
|
1358
|
+
this.removeAttribute("hidden");
|
|
1359
|
+
} else if (this.getAttribute("hidden") == null) {
|
|
1360
|
+
this.setAttribute("hidden", "hidden");
|
|
1361
|
+
}
|
|
1362
|
+
if (this.element && this.element.set) {
|
|
1363
|
+
this.element.onClose = this.onClose;
|
|
1364
|
+
this.element.set(options);
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
};
|
|
1368
|
+
var HTMLFeaasLoader = class extends WebComponent {
|
|
1369
|
+
static get observedAttributes() {
|
|
1370
|
+
return ["hidden"];
|
|
1371
|
+
}
|
|
1372
|
+
connectedCallback() {
|
|
1373
|
+
this.style.opacity = "1";
|
|
1374
|
+
this.style.transition = "opacity 0.2s 0.6s";
|
|
1375
|
+
this.stylesheet = document.createElement("style");
|
|
1376
|
+
this.stylesheet.textContent = `
|
|
1377
|
+
#loader {
|
|
1378
|
+
position: absolute;
|
|
1379
|
+
top: 0;
|
|
1380
|
+
left: 0;
|
|
1381
|
+
right: 0;
|
|
1382
|
+
bottom: 0;
|
|
1383
|
+
display: flex;
|
|
1384
|
+
align-items: center;
|
|
1385
|
+
justify-content: center;
|
|
1386
|
+
background: #f6f6ff;
|
|
1387
|
+
z-index: 1000;
|
|
1388
|
+
opacity: 1;
|
|
1389
|
+
transition: top 0.3s, background-color 0.7s 0.3s;
|
|
1390
|
+
}
|
|
1391
|
+
@keyframes loader-disappearance {
|
|
1392
|
+
100% {
|
|
1393
|
+
opacity: 0;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
@keyframes loader-appearance {
|
|
1397
|
+
0% {
|
|
1398
|
+
opacity: 0;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
@keyframes loader-circular-track {
|
|
1402
|
+
0% {
|
|
1403
|
+
stroke-dasharray: 1, 400;
|
|
1404
|
+
stroke-dashoffset: 0;
|
|
1405
|
+
}
|
|
1406
|
+
50% {
|
|
1407
|
+
stroke-dasharray: 400, 400;
|
|
1408
|
+
stroke-dashoffset: -100;
|
|
1409
|
+
}
|
|
1410
|
+
100% {
|
|
1411
|
+
stroke-dasharray: 400, 400;
|
|
1412
|
+
stroke-dashoffset: -260;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
@keyframes loader-circular-spinner {
|
|
1417
|
+
0% {
|
|
1418
|
+
transform: rotate(0deg);
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
100% {
|
|
1422
|
+
transform: rotate(360deg);
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
#loader .spinner {
|
|
1426
|
+
animation: loader-disappearance 0.6s both;
|
|
1427
|
+
width: 48px;
|
|
1428
|
+
height: 48px;
|
|
1429
|
+
}
|
|
1430
|
+
#loader .spinner {
|
|
1431
|
+
animation: loader-appearance 0.6s both;
|
|
1432
|
+
}
|
|
1433
|
+
`;
|
|
1434
|
+
this.root = this.attachShadow({ mode: "open" });
|
|
1435
|
+
this.loader = document.createElement("div");
|
|
1436
|
+
this.loader.id = "loader";
|
|
1437
|
+
this.loader.innerHTML = `
|
|
1438
|
+
<div class="spinner">
|
|
1439
|
+
<svg
|
|
1440
|
+
viewBox="0 0 100 100"
|
|
1441
|
+
style="
|
|
1442
|
+
animation: 2s linear 0s infinite normal none running loader-circular-spinner;
|
|
1443
|
+
display: block;
|
|
1444
|
+
width: 48px;
|
|
1445
|
+
height: 48px;
|
|
1446
|
+
"
|
|
1447
|
+
>
|
|
1448
|
+
<circle fill="transparent" cx="50" cy="50" r="42" stroke="rgba(0,0,0,0.1)" stroke-width="10px"></circle>
|
|
1449
|
+
<circle
|
|
1450
|
+
fill="transparent"
|
|
1451
|
+
stroke="#5548D9"
|
|
1452
|
+
cx="50"
|
|
1453
|
+
cy="50"
|
|
1454
|
+
r="42"
|
|
1455
|
+
stroke-width="10px"
|
|
1456
|
+
stroke-linecap="round"
|
|
1457
|
+
style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
|
|
1458
|
+
></circle>
|
|
1459
|
+
</svg>
|
|
1460
|
+
</div>`;
|
|
1461
|
+
this.shadowRoot.appendChild(this.stylesheet);
|
|
1462
|
+
this.shadowRoot.appendChild(this.loader);
|
|
1463
|
+
}
|
|
1464
|
+
};
|
|
1297
1465
|
if (typeof window != "undefined" && !window.customElements.get("feaas-stylesheet")) {
|
|
1298
1466
|
window.customElements.define("feaas-stylesheet", HTMLFeaasStylesheet);
|
|
1299
1467
|
window.customElements.define("feaas-component", HTMLFeaasComponent);
|
|
1468
|
+
window.customElements.define("feaas-picker-lazy", HTMLFeaasPickerLazy);
|
|
1469
|
+
window.customElements.define("feaas-loader", HTMLFeaasLoader);
|
|
1300
1470
|
}
|
|
1301
1471
|
|
|
1302
1472
|
// src/index.ts
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HTMLFeaasComponent, a as HTMLFeaasStylesheet, D as Datascopes, F as FEAASCustomizations, C as CloudStylesheet, b as FEAASComponentProps } from './webcomponent-
|
|
2
|
-
export { D as Datascopes, E as ExplicitTemplate, b as FEAASComponentProps, F as FEAASCustomizations, H as HTMLFeaasComponent, a as HTMLFeaasStylesheet, d as autoloadScripts, c as cleanCollectionBit, l as loadScript, n as normalizeCollectionScope, o as observeDOMElement, q as queryScopes, i as renderComponent, r as renderComponentElement, j as renderComponentPromise, f as renderDOMContent, e as renderDOMElement, g as renderStylesheet, h as renderStylesheetPromise, s as setDOMAttribute } from './webcomponent-
|
|
1
|
+
import { H as HTMLFeaasComponent, a as HTMLFeaasStylesheet, D as Datascopes, F as FEAASCustomizations, C as CloudStylesheet, b as FEAASComponentProps } from './webcomponent-6b45b819.js';
|
|
2
|
+
export { D as Datascopes, E as ExplicitTemplate, b as FEAASComponentProps, F as FEAASCustomizations, H as HTMLFeaasComponent, k as HTMLFeaasPickerProps, a as HTMLFeaasStylesheet, P as PickerProps, d as autoloadScripts, c as cleanCollectionBit, l as loadScript, n as normalizeCollectionScope, o as observeDOMElement, q as queryScopes, i as renderComponent, r as renderComponentElement, j as renderComponentPromise, f as renderDOMContent, e as renderDOMElement, g as renderStylesheet, h as renderStylesheetPromise, s as setDOMAttribute } from './webcomponent-6b45b819.js';
|
|
3
3
|
|
|
4
4
|
declare function fetchAndRevalidate(url: Parameters<typeof fetch>[0], options: Parameters<typeof fetch>[1], validator: (resposne: Response) => boolean, callback: (response: Response, status: 'cached' | 'valid') => void): Promise<Response>;
|
|
5
5
|
|
package/dist/node/index.js
CHANGED
|
@@ -1149,11 +1149,16 @@ var HTMLFeaasComponent = class extends WebComponent {
|
|
|
1149
1149
|
return;
|
|
1150
1150
|
if (name == "template") {
|
|
1151
1151
|
this.template = newValue;
|
|
1152
|
+
} else if (name != "date") {
|
|
1153
|
+
this.template = null;
|
|
1152
1154
|
}
|
|
1153
1155
|
if (name == "data" && this.children.length > 0) {
|
|
1154
1156
|
this.update();
|
|
1155
1157
|
} else {
|
|
1156
|
-
this.
|
|
1158
|
+
cancelAnimationFrame(this.rendering);
|
|
1159
|
+
this.rendering = requestAnimationFrame(() => {
|
|
1160
|
+
this.render();
|
|
1161
|
+
});
|
|
1157
1162
|
}
|
|
1158
1163
|
}
|
|
1159
1164
|
update() {
|
|
@@ -1259,9 +1264,174 @@ var HTMLFeaasStylesheet = class extends WebComponent {
|
|
|
1259
1264
|
};
|
|
1260
1265
|
}
|
|
1261
1266
|
};
|
|
1267
|
+
var HTMLFeaasPickerLazy = class extends WebComponent {
|
|
1268
|
+
constructor() {
|
|
1269
|
+
super(...arguments);
|
|
1270
|
+
this.src = "https://components.sitecorecloud.io/assets/picker.js";
|
|
1271
|
+
this.onClose = () => {
|
|
1272
|
+
this.set({
|
|
1273
|
+
mode: null
|
|
1274
|
+
});
|
|
1275
|
+
};
|
|
1276
|
+
this.onScriptLoaded = () => {
|
|
1277
|
+
this.element = document.createElement("feaas-picker");
|
|
1278
|
+
this.element.style.cssText = "border: 0; width: 100%; height: 100%; display: block";
|
|
1279
|
+
this.appendChild(this.element);
|
|
1280
|
+
this.set(this.getProps());
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
static get observedAttributes() {
|
|
1284
|
+
return ["library", "mode", "hidden", "src"];
|
|
1285
|
+
}
|
|
1286
|
+
connectedCallback() {
|
|
1287
|
+
this.loader = document.createElement("feaas-loader");
|
|
1288
|
+
this.loader.style.cssText = "position: absolute; top: 0; left: 0; right: 0;bottom: 0; ";
|
|
1289
|
+
this.appendChild(this.loader);
|
|
1290
|
+
}
|
|
1291
|
+
load() {
|
|
1292
|
+
if (!this.script) {
|
|
1293
|
+
this.script = document.createElement("script");
|
|
1294
|
+
this.script.type = "module";
|
|
1295
|
+
this.script.onload = this.onScriptLoaded;
|
|
1296
|
+
this.script.src = this.src;
|
|
1297
|
+
this.appendChild(this.script);
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
getProps() {
|
|
1301
|
+
return {
|
|
1302
|
+
mode: this.getAttribute("mode"),
|
|
1303
|
+
library: this.getAttribute("library"),
|
|
1304
|
+
src: this.getAttribute("src")
|
|
1305
|
+
};
|
|
1306
|
+
}
|
|
1307
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
1308
|
+
this.set(this.getProps());
|
|
1309
|
+
}
|
|
1310
|
+
set(options) {
|
|
1311
|
+
Object.assign(this, options);
|
|
1312
|
+
const keys = Object.keys(this.getProps());
|
|
1313
|
+
for (var key of keys) {
|
|
1314
|
+
const value = this[key];
|
|
1315
|
+
if (value == null) {
|
|
1316
|
+
this.removeAttribute(key);
|
|
1317
|
+
this.load();
|
|
1318
|
+
} else if (this.getAttribute(key) != String(value)) {
|
|
1319
|
+
this.setAttribute(key, String(value));
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
if (this.mode) {
|
|
1323
|
+
this.removeAttribute("hidden");
|
|
1324
|
+
} else if (this.getAttribute("hidden") == null) {
|
|
1325
|
+
this.setAttribute("hidden", "hidden");
|
|
1326
|
+
}
|
|
1327
|
+
if (this.element && this.element.set) {
|
|
1328
|
+
this.element.onClose = this.onClose;
|
|
1329
|
+
this.element.set(options);
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
};
|
|
1333
|
+
var HTMLFeaasLoader = class extends WebComponent {
|
|
1334
|
+
static get observedAttributes() {
|
|
1335
|
+
return ["hidden"];
|
|
1336
|
+
}
|
|
1337
|
+
connectedCallback() {
|
|
1338
|
+
this.style.opacity = "1";
|
|
1339
|
+
this.style.transition = "opacity 0.2s 0.6s";
|
|
1340
|
+
this.stylesheet = document.createElement("style");
|
|
1341
|
+
this.stylesheet.textContent = `
|
|
1342
|
+
#loader {
|
|
1343
|
+
position: absolute;
|
|
1344
|
+
top: 0;
|
|
1345
|
+
left: 0;
|
|
1346
|
+
right: 0;
|
|
1347
|
+
bottom: 0;
|
|
1348
|
+
display: flex;
|
|
1349
|
+
align-items: center;
|
|
1350
|
+
justify-content: center;
|
|
1351
|
+
background: #f6f6ff;
|
|
1352
|
+
z-index: 1000;
|
|
1353
|
+
opacity: 1;
|
|
1354
|
+
transition: top 0.3s, background-color 0.7s 0.3s;
|
|
1355
|
+
}
|
|
1356
|
+
@keyframes loader-disappearance {
|
|
1357
|
+
100% {
|
|
1358
|
+
opacity: 0;
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
@keyframes loader-appearance {
|
|
1362
|
+
0% {
|
|
1363
|
+
opacity: 0;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
@keyframes loader-circular-track {
|
|
1367
|
+
0% {
|
|
1368
|
+
stroke-dasharray: 1, 400;
|
|
1369
|
+
stroke-dashoffset: 0;
|
|
1370
|
+
}
|
|
1371
|
+
50% {
|
|
1372
|
+
stroke-dasharray: 400, 400;
|
|
1373
|
+
stroke-dashoffset: -100;
|
|
1374
|
+
}
|
|
1375
|
+
100% {
|
|
1376
|
+
stroke-dasharray: 400, 400;
|
|
1377
|
+
stroke-dashoffset: -260;
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
@keyframes loader-circular-spinner {
|
|
1382
|
+
0% {
|
|
1383
|
+
transform: rotate(0deg);
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
100% {
|
|
1387
|
+
transform: rotate(360deg);
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
#loader .spinner {
|
|
1391
|
+
animation: loader-disappearance 0.6s both;
|
|
1392
|
+
width: 48px;
|
|
1393
|
+
height: 48px;
|
|
1394
|
+
}
|
|
1395
|
+
#loader .spinner {
|
|
1396
|
+
animation: loader-appearance 0.6s both;
|
|
1397
|
+
}
|
|
1398
|
+
`;
|
|
1399
|
+
this.root = this.attachShadow({ mode: "open" });
|
|
1400
|
+
this.loader = document.createElement("div");
|
|
1401
|
+
this.loader.id = "loader";
|
|
1402
|
+
this.loader.innerHTML = `
|
|
1403
|
+
<div class="spinner">
|
|
1404
|
+
<svg
|
|
1405
|
+
viewBox="0 0 100 100"
|
|
1406
|
+
style="
|
|
1407
|
+
animation: 2s linear 0s infinite normal none running loader-circular-spinner;
|
|
1408
|
+
display: block;
|
|
1409
|
+
width: 48px;
|
|
1410
|
+
height: 48px;
|
|
1411
|
+
"
|
|
1412
|
+
>
|
|
1413
|
+
<circle fill="transparent" cx="50" cy="50" r="42" stroke="rgba(0,0,0,0.1)" stroke-width="10px"></circle>
|
|
1414
|
+
<circle
|
|
1415
|
+
fill="transparent"
|
|
1416
|
+
stroke="#5548D9"
|
|
1417
|
+
cx="50"
|
|
1418
|
+
cy="50"
|
|
1419
|
+
r="42"
|
|
1420
|
+
stroke-width="10px"
|
|
1421
|
+
stroke-linecap="round"
|
|
1422
|
+
style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
|
|
1423
|
+
></circle>
|
|
1424
|
+
</svg>
|
|
1425
|
+
</div>`;
|
|
1426
|
+
this.shadowRoot.appendChild(this.stylesheet);
|
|
1427
|
+
this.shadowRoot.appendChild(this.loader);
|
|
1428
|
+
}
|
|
1429
|
+
};
|
|
1262
1430
|
if (typeof window != "undefined" && !window.customElements.get("feaas-stylesheet")) {
|
|
1263
1431
|
window.customElements.define("feaas-stylesheet", HTMLFeaasStylesheet);
|
|
1264
1432
|
window.customElements.define("feaas-component", HTMLFeaasComponent);
|
|
1433
|
+
window.customElements.define("feaas-picker-lazy", HTMLFeaasPickerLazy);
|
|
1434
|
+
window.customElements.define("feaas-loader", HTMLFeaasLoader);
|
|
1265
1435
|
}
|
|
1266
1436
|
|
|
1267
1437
|
// src/index.ts
|
package/dist/node/react.cjs
CHANGED
|
@@ -1196,11 +1196,16 @@ var HTMLFeaasComponent = class extends WebComponent {
|
|
|
1196
1196
|
return;
|
|
1197
1197
|
if (name == "template") {
|
|
1198
1198
|
this.template = newValue;
|
|
1199
|
+
} else if (name != "date") {
|
|
1200
|
+
this.template = null;
|
|
1199
1201
|
}
|
|
1200
1202
|
if (name == "data" && this.children.length > 0) {
|
|
1201
1203
|
this.update();
|
|
1202
1204
|
} else {
|
|
1203
|
-
this.
|
|
1205
|
+
cancelAnimationFrame(this.rendering);
|
|
1206
|
+
this.rendering = requestAnimationFrame(() => {
|
|
1207
|
+
this.render();
|
|
1208
|
+
});
|
|
1204
1209
|
}
|
|
1205
1210
|
}
|
|
1206
1211
|
update() {
|
|
@@ -1306,9 +1311,174 @@ var HTMLFeaasStylesheet = class extends WebComponent {
|
|
|
1306
1311
|
};
|
|
1307
1312
|
}
|
|
1308
1313
|
};
|
|
1314
|
+
var HTMLFeaasPickerLazy = class extends WebComponent {
|
|
1315
|
+
constructor() {
|
|
1316
|
+
super(...arguments);
|
|
1317
|
+
this.src = "https://components.sitecorecloud.io/assets/picker.js";
|
|
1318
|
+
this.onClose = () => {
|
|
1319
|
+
this.set({
|
|
1320
|
+
mode: null
|
|
1321
|
+
});
|
|
1322
|
+
};
|
|
1323
|
+
this.onScriptLoaded = () => {
|
|
1324
|
+
this.element = document.createElement("feaas-picker");
|
|
1325
|
+
this.element.style.cssText = "border: 0; width: 100%; height: 100%; display: block";
|
|
1326
|
+
this.appendChild(this.element);
|
|
1327
|
+
this.set(this.getProps());
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
static get observedAttributes() {
|
|
1331
|
+
return ["library", "mode", "hidden", "src"];
|
|
1332
|
+
}
|
|
1333
|
+
connectedCallback() {
|
|
1334
|
+
this.loader = document.createElement("feaas-loader");
|
|
1335
|
+
this.loader.style.cssText = "position: absolute; top: 0; left: 0; right: 0;bottom: 0; ";
|
|
1336
|
+
this.appendChild(this.loader);
|
|
1337
|
+
}
|
|
1338
|
+
load() {
|
|
1339
|
+
if (!this.script) {
|
|
1340
|
+
this.script = document.createElement("script");
|
|
1341
|
+
this.script.type = "module";
|
|
1342
|
+
this.script.onload = this.onScriptLoaded;
|
|
1343
|
+
this.script.src = this.src;
|
|
1344
|
+
this.appendChild(this.script);
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
getProps() {
|
|
1348
|
+
return {
|
|
1349
|
+
mode: this.getAttribute("mode"),
|
|
1350
|
+
library: this.getAttribute("library"),
|
|
1351
|
+
src: this.getAttribute("src")
|
|
1352
|
+
};
|
|
1353
|
+
}
|
|
1354
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
1355
|
+
this.set(this.getProps());
|
|
1356
|
+
}
|
|
1357
|
+
set(options) {
|
|
1358
|
+
Object.assign(this, options);
|
|
1359
|
+
const keys = Object.keys(this.getProps());
|
|
1360
|
+
for (var key of keys) {
|
|
1361
|
+
const value = this[key];
|
|
1362
|
+
if (value == null) {
|
|
1363
|
+
this.removeAttribute(key);
|
|
1364
|
+
this.load();
|
|
1365
|
+
} else if (this.getAttribute(key) != String(value)) {
|
|
1366
|
+
this.setAttribute(key, String(value));
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
if (this.mode) {
|
|
1370
|
+
this.removeAttribute("hidden");
|
|
1371
|
+
} else if (this.getAttribute("hidden") == null) {
|
|
1372
|
+
this.setAttribute("hidden", "hidden");
|
|
1373
|
+
}
|
|
1374
|
+
if (this.element && this.element.set) {
|
|
1375
|
+
this.element.onClose = this.onClose;
|
|
1376
|
+
this.element.set(options);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
var HTMLFeaasLoader = class extends WebComponent {
|
|
1381
|
+
static get observedAttributes() {
|
|
1382
|
+
return ["hidden"];
|
|
1383
|
+
}
|
|
1384
|
+
connectedCallback() {
|
|
1385
|
+
this.style.opacity = "1";
|
|
1386
|
+
this.style.transition = "opacity 0.2s 0.6s";
|
|
1387
|
+
this.stylesheet = document.createElement("style");
|
|
1388
|
+
this.stylesheet.textContent = `
|
|
1389
|
+
#loader {
|
|
1390
|
+
position: absolute;
|
|
1391
|
+
top: 0;
|
|
1392
|
+
left: 0;
|
|
1393
|
+
right: 0;
|
|
1394
|
+
bottom: 0;
|
|
1395
|
+
display: flex;
|
|
1396
|
+
align-items: center;
|
|
1397
|
+
justify-content: center;
|
|
1398
|
+
background: #f6f6ff;
|
|
1399
|
+
z-index: 1000;
|
|
1400
|
+
opacity: 1;
|
|
1401
|
+
transition: top 0.3s, background-color 0.7s 0.3s;
|
|
1402
|
+
}
|
|
1403
|
+
@keyframes loader-disappearance {
|
|
1404
|
+
100% {
|
|
1405
|
+
opacity: 0;
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
@keyframes loader-appearance {
|
|
1409
|
+
0% {
|
|
1410
|
+
opacity: 0;
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
@keyframes loader-circular-track {
|
|
1414
|
+
0% {
|
|
1415
|
+
stroke-dasharray: 1, 400;
|
|
1416
|
+
stroke-dashoffset: 0;
|
|
1417
|
+
}
|
|
1418
|
+
50% {
|
|
1419
|
+
stroke-dasharray: 400, 400;
|
|
1420
|
+
stroke-dashoffset: -100;
|
|
1421
|
+
}
|
|
1422
|
+
100% {
|
|
1423
|
+
stroke-dasharray: 400, 400;
|
|
1424
|
+
stroke-dashoffset: -260;
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
@keyframes loader-circular-spinner {
|
|
1429
|
+
0% {
|
|
1430
|
+
transform: rotate(0deg);
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
100% {
|
|
1434
|
+
transform: rotate(360deg);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
#loader .spinner {
|
|
1438
|
+
animation: loader-disappearance 0.6s both;
|
|
1439
|
+
width: 48px;
|
|
1440
|
+
height: 48px;
|
|
1441
|
+
}
|
|
1442
|
+
#loader .spinner {
|
|
1443
|
+
animation: loader-appearance 0.6s both;
|
|
1444
|
+
}
|
|
1445
|
+
`;
|
|
1446
|
+
this.root = this.attachShadow({ mode: "open" });
|
|
1447
|
+
this.loader = document.createElement("div");
|
|
1448
|
+
this.loader.id = "loader";
|
|
1449
|
+
this.loader.innerHTML = `
|
|
1450
|
+
<div class="spinner">
|
|
1451
|
+
<svg
|
|
1452
|
+
viewBox="0 0 100 100"
|
|
1453
|
+
style="
|
|
1454
|
+
animation: 2s linear 0s infinite normal none running loader-circular-spinner;
|
|
1455
|
+
display: block;
|
|
1456
|
+
width: 48px;
|
|
1457
|
+
height: 48px;
|
|
1458
|
+
"
|
|
1459
|
+
>
|
|
1460
|
+
<circle fill="transparent" cx="50" cy="50" r="42" stroke="rgba(0,0,0,0.1)" stroke-width="10px"></circle>
|
|
1461
|
+
<circle
|
|
1462
|
+
fill="transparent"
|
|
1463
|
+
stroke="#5548D9"
|
|
1464
|
+
cx="50"
|
|
1465
|
+
cy="50"
|
|
1466
|
+
r="42"
|
|
1467
|
+
stroke-width="10px"
|
|
1468
|
+
stroke-linecap="round"
|
|
1469
|
+
style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
|
|
1470
|
+
></circle>
|
|
1471
|
+
</svg>
|
|
1472
|
+
</div>`;
|
|
1473
|
+
this.shadowRoot.appendChild(this.stylesheet);
|
|
1474
|
+
this.shadowRoot.appendChild(this.loader);
|
|
1475
|
+
}
|
|
1476
|
+
};
|
|
1309
1477
|
if (typeof window != "undefined" && !window.customElements.get("feaas-stylesheet")) {
|
|
1310
1478
|
window.customElements.define("feaas-stylesheet", HTMLFeaasStylesheet);
|
|
1311
1479
|
window.customElements.define("feaas-component", HTMLFeaasComponent);
|
|
1480
|
+
window.customElements.define("feaas-picker-lazy", HTMLFeaasPickerLazy);
|
|
1481
|
+
window.customElements.define("feaas-loader", HTMLFeaasLoader);
|
|
1312
1482
|
}
|
|
1313
1483
|
|
|
1314
1484
|
// src/react.ts
|
package/dist/node/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { b as FEAASComponentProps, C as CloudStylesheet, H as HTMLFeaasComponent, a as HTMLFeaasStylesheet, D as Datascopes, F as FEAASCustomizations } from './webcomponent-
|
|
3
|
-
export { C as CloudStylesheet,
|
|
2
|
+
import { b as FEAASComponentProps, C as CloudStylesheet, H as HTMLFeaasComponent, a as HTMLFeaasStylesheet, D as Datascopes, F as FEAASCustomizations } from './webcomponent-6b45b819.js';
|
|
3
|
+
export { C as CloudStylesheet, m as CloudTemplate, D as Datascopes, E as ExplicitTemplate, b as FEAASComponentProps, F as FEAASCustomizations, H as HTMLFeaasComponent, k as HTMLFeaasPickerProps, a as HTMLFeaasStylesheet, P as PickerProps, d as autoloadScripts, c as cleanCollectionBit, u as fetchComponent, v as fetchStylesheet, p as getComponentURL, t as getStylesheetURL, l as loadScript, n as normalizeCollectionScope, o as observeDOMElement, q as queryScopes, i as renderComponent, r as renderComponentElement, j as renderComponentPromise, f as renderDOMContent, e as renderDOMElement, g as renderStylesheet, h as renderStylesheetPromise, s as setDOMAttribute } from './webcomponent-6b45b819.js';
|
|
4
4
|
|
|
5
5
|
declare function Component(props: FEAASComponentProps): React.DetailedReactHTMLElement<{
|
|
6
6
|
ref: React.MutableRefObject<HTMLElement>;
|