@sitecore-feaas/clientside 0.0.3 → 0.0.5
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 +172 -1
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +172 -1
- package/dist/node/react.cjs +172 -1
- package/dist/node/react.d.ts +2 -2
- package/dist/node/react.js +172 -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 +205 -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,175 @@ 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.script.crossOrigin = "anonymous";
|
|
1333
|
+
this.appendChild(this.script);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
getProps() {
|
|
1337
|
+
return {
|
|
1338
|
+
mode: this.getAttribute("mode"),
|
|
1339
|
+
library: this.getAttribute("library"),
|
|
1340
|
+
src: this.getAttribute("src")
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
1344
|
+
this.set(this.getProps());
|
|
1345
|
+
}
|
|
1346
|
+
set(options) {
|
|
1347
|
+
Object.assign(this, options);
|
|
1348
|
+
const keys = Object.keys(this.getProps());
|
|
1349
|
+
for (var key of keys) {
|
|
1350
|
+
const value = this[key];
|
|
1351
|
+
if (value == null) {
|
|
1352
|
+
this.removeAttribute(key);
|
|
1353
|
+
this.load();
|
|
1354
|
+
} else if (this.getAttribute(key) != String(value)) {
|
|
1355
|
+
this.setAttribute(key, String(value));
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
if (this.mode) {
|
|
1359
|
+
this.removeAttribute("hidden");
|
|
1360
|
+
} else if (this.getAttribute("hidden") == null) {
|
|
1361
|
+
this.setAttribute("hidden", "hidden");
|
|
1362
|
+
}
|
|
1363
|
+
if (this.element && this.element.set) {
|
|
1364
|
+
this.element.onClose = this.onClose;
|
|
1365
|
+
this.element.set(options);
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
var HTMLFeaasLoader = class extends WebComponent {
|
|
1370
|
+
static get observedAttributes() {
|
|
1371
|
+
return ["hidden"];
|
|
1372
|
+
}
|
|
1373
|
+
connectedCallback() {
|
|
1374
|
+
this.style.opacity = "1";
|
|
1375
|
+
this.style.transition = "opacity 0.2s 0.6s";
|
|
1376
|
+
this.stylesheet = document.createElement("style");
|
|
1377
|
+
this.stylesheet.textContent = `
|
|
1378
|
+
#loader {
|
|
1379
|
+
position: absolute;
|
|
1380
|
+
top: 0;
|
|
1381
|
+
left: 0;
|
|
1382
|
+
right: 0;
|
|
1383
|
+
bottom: 0;
|
|
1384
|
+
display: flex;
|
|
1385
|
+
align-items: center;
|
|
1386
|
+
justify-content: center;
|
|
1387
|
+
background: #f6f6ff;
|
|
1388
|
+
z-index: 1000;
|
|
1389
|
+
opacity: 1;
|
|
1390
|
+
transition: top 0.3s, background-color 0.7s 0.3s;
|
|
1391
|
+
}
|
|
1392
|
+
@keyframes loader-disappearance {
|
|
1393
|
+
100% {
|
|
1394
|
+
opacity: 0;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
@keyframes loader-appearance {
|
|
1398
|
+
0% {
|
|
1399
|
+
opacity: 0;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
@keyframes loader-circular-track {
|
|
1403
|
+
0% {
|
|
1404
|
+
stroke-dasharray: 1, 400;
|
|
1405
|
+
stroke-dashoffset: 0;
|
|
1406
|
+
}
|
|
1407
|
+
50% {
|
|
1408
|
+
stroke-dasharray: 400, 400;
|
|
1409
|
+
stroke-dashoffset: -100;
|
|
1410
|
+
}
|
|
1411
|
+
100% {
|
|
1412
|
+
stroke-dasharray: 400, 400;
|
|
1413
|
+
stroke-dashoffset: -260;
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
@keyframes loader-circular-spinner {
|
|
1418
|
+
0% {
|
|
1419
|
+
transform: rotate(0deg);
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
100% {
|
|
1423
|
+
transform: rotate(360deg);
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
#loader .spinner {
|
|
1427
|
+
animation: loader-disappearance 0.6s both;
|
|
1428
|
+
width: 48px;
|
|
1429
|
+
height: 48px;
|
|
1430
|
+
}
|
|
1431
|
+
#loader .spinner {
|
|
1432
|
+
animation: loader-appearance 0.6s both;
|
|
1433
|
+
}
|
|
1434
|
+
`;
|
|
1435
|
+
this.root = this.attachShadow({ mode: "open" });
|
|
1436
|
+
this.loader = document.createElement("div");
|
|
1437
|
+
this.loader.id = "loader";
|
|
1438
|
+
this.loader.innerHTML = `
|
|
1439
|
+
<div class="spinner">
|
|
1440
|
+
<svg
|
|
1441
|
+
viewBox="0 0 100 100"
|
|
1442
|
+
style="
|
|
1443
|
+
animation: 2s linear 0s infinite normal none running loader-circular-spinner;
|
|
1444
|
+
display: block;
|
|
1445
|
+
width: 48px;
|
|
1446
|
+
height: 48px;
|
|
1447
|
+
"
|
|
1448
|
+
>
|
|
1449
|
+
<circle fill="transparent" cx="50" cy="50" r="42" stroke="rgba(0,0,0,0.1)" stroke-width="10px"></circle>
|
|
1450
|
+
<circle
|
|
1451
|
+
fill="transparent"
|
|
1452
|
+
stroke="#5548D9"
|
|
1453
|
+
cx="50"
|
|
1454
|
+
cy="50"
|
|
1455
|
+
r="42"
|
|
1456
|
+
stroke-width="10px"
|
|
1457
|
+
stroke-linecap="round"
|
|
1458
|
+
style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
|
|
1459
|
+
></circle>
|
|
1460
|
+
</svg>
|
|
1461
|
+
</div>`;
|
|
1462
|
+
this.shadowRoot.appendChild(this.stylesheet);
|
|
1463
|
+
this.shadowRoot.appendChild(this.loader);
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1297
1466
|
if (typeof window != "undefined" && !window.customElements.get("feaas-stylesheet")) {
|
|
1298
1467
|
window.customElements.define("feaas-stylesheet", HTMLFeaasStylesheet);
|
|
1299
1468
|
window.customElements.define("feaas-component", HTMLFeaasComponent);
|
|
1469
|
+
window.customElements.define("feaas-picker-lazy", HTMLFeaasPickerLazy);
|
|
1470
|
+
window.customElements.define("feaas-loader", HTMLFeaasLoader);
|
|
1300
1471
|
}
|
|
1301
1472
|
|
|
1302
1473
|
// 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,175 @@ 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.script.crossOrigin = "anonymous";
|
|
1298
|
+
this.appendChild(this.script);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
getProps() {
|
|
1302
|
+
return {
|
|
1303
|
+
mode: this.getAttribute("mode"),
|
|
1304
|
+
library: this.getAttribute("library"),
|
|
1305
|
+
src: this.getAttribute("src")
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
1309
|
+
this.set(this.getProps());
|
|
1310
|
+
}
|
|
1311
|
+
set(options) {
|
|
1312
|
+
Object.assign(this, options);
|
|
1313
|
+
const keys = Object.keys(this.getProps());
|
|
1314
|
+
for (var key of keys) {
|
|
1315
|
+
const value = this[key];
|
|
1316
|
+
if (value == null) {
|
|
1317
|
+
this.removeAttribute(key);
|
|
1318
|
+
this.load();
|
|
1319
|
+
} else if (this.getAttribute(key) != String(value)) {
|
|
1320
|
+
this.setAttribute(key, String(value));
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
if (this.mode) {
|
|
1324
|
+
this.removeAttribute("hidden");
|
|
1325
|
+
} else if (this.getAttribute("hidden") == null) {
|
|
1326
|
+
this.setAttribute("hidden", "hidden");
|
|
1327
|
+
}
|
|
1328
|
+
if (this.element && this.element.set) {
|
|
1329
|
+
this.element.onClose = this.onClose;
|
|
1330
|
+
this.element.set(options);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
};
|
|
1334
|
+
var HTMLFeaasLoader = class extends WebComponent {
|
|
1335
|
+
static get observedAttributes() {
|
|
1336
|
+
return ["hidden"];
|
|
1337
|
+
}
|
|
1338
|
+
connectedCallback() {
|
|
1339
|
+
this.style.opacity = "1";
|
|
1340
|
+
this.style.transition = "opacity 0.2s 0.6s";
|
|
1341
|
+
this.stylesheet = document.createElement("style");
|
|
1342
|
+
this.stylesheet.textContent = `
|
|
1343
|
+
#loader {
|
|
1344
|
+
position: absolute;
|
|
1345
|
+
top: 0;
|
|
1346
|
+
left: 0;
|
|
1347
|
+
right: 0;
|
|
1348
|
+
bottom: 0;
|
|
1349
|
+
display: flex;
|
|
1350
|
+
align-items: center;
|
|
1351
|
+
justify-content: center;
|
|
1352
|
+
background: #f6f6ff;
|
|
1353
|
+
z-index: 1000;
|
|
1354
|
+
opacity: 1;
|
|
1355
|
+
transition: top 0.3s, background-color 0.7s 0.3s;
|
|
1356
|
+
}
|
|
1357
|
+
@keyframes loader-disappearance {
|
|
1358
|
+
100% {
|
|
1359
|
+
opacity: 0;
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
@keyframes loader-appearance {
|
|
1363
|
+
0% {
|
|
1364
|
+
opacity: 0;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
@keyframes loader-circular-track {
|
|
1368
|
+
0% {
|
|
1369
|
+
stroke-dasharray: 1, 400;
|
|
1370
|
+
stroke-dashoffset: 0;
|
|
1371
|
+
}
|
|
1372
|
+
50% {
|
|
1373
|
+
stroke-dasharray: 400, 400;
|
|
1374
|
+
stroke-dashoffset: -100;
|
|
1375
|
+
}
|
|
1376
|
+
100% {
|
|
1377
|
+
stroke-dasharray: 400, 400;
|
|
1378
|
+
stroke-dashoffset: -260;
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
@keyframes loader-circular-spinner {
|
|
1383
|
+
0% {
|
|
1384
|
+
transform: rotate(0deg);
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
100% {
|
|
1388
|
+
transform: rotate(360deg);
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
#loader .spinner {
|
|
1392
|
+
animation: loader-disappearance 0.6s both;
|
|
1393
|
+
width: 48px;
|
|
1394
|
+
height: 48px;
|
|
1395
|
+
}
|
|
1396
|
+
#loader .spinner {
|
|
1397
|
+
animation: loader-appearance 0.6s both;
|
|
1398
|
+
}
|
|
1399
|
+
`;
|
|
1400
|
+
this.root = this.attachShadow({ mode: "open" });
|
|
1401
|
+
this.loader = document.createElement("div");
|
|
1402
|
+
this.loader.id = "loader";
|
|
1403
|
+
this.loader.innerHTML = `
|
|
1404
|
+
<div class="spinner">
|
|
1405
|
+
<svg
|
|
1406
|
+
viewBox="0 0 100 100"
|
|
1407
|
+
style="
|
|
1408
|
+
animation: 2s linear 0s infinite normal none running loader-circular-spinner;
|
|
1409
|
+
display: block;
|
|
1410
|
+
width: 48px;
|
|
1411
|
+
height: 48px;
|
|
1412
|
+
"
|
|
1413
|
+
>
|
|
1414
|
+
<circle fill="transparent" cx="50" cy="50" r="42" stroke="rgba(0,0,0,0.1)" stroke-width="10px"></circle>
|
|
1415
|
+
<circle
|
|
1416
|
+
fill="transparent"
|
|
1417
|
+
stroke="#5548D9"
|
|
1418
|
+
cx="50"
|
|
1419
|
+
cy="50"
|
|
1420
|
+
r="42"
|
|
1421
|
+
stroke-width="10px"
|
|
1422
|
+
stroke-linecap="round"
|
|
1423
|
+
style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
|
|
1424
|
+
></circle>
|
|
1425
|
+
</svg>
|
|
1426
|
+
</div>`;
|
|
1427
|
+
this.shadowRoot.appendChild(this.stylesheet);
|
|
1428
|
+
this.shadowRoot.appendChild(this.loader);
|
|
1429
|
+
}
|
|
1430
|
+
};
|
|
1262
1431
|
if (typeof window != "undefined" && !window.customElements.get("feaas-stylesheet")) {
|
|
1263
1432
|
window.customElements.define("feaas-stylesheet", HTMLFeaasStylesheet);
|
|
1264
1433
|
window.customElements.define("feaas-component", HTMLFeaasComponent);
|
|
1434
|
+
window.customElements.define("feaas-picker-lazy", HTMLFeaasPickerLazy);
|
|
1435
|
+
window.customElements.define("feaas-loader", HTMLFeaasLoader);
|
|
1265
1436
|
}
|
|
1266
1437
|
|
|
1267
1438
|
// 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,175 @@ 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.script.crossOrigin = "anonymous";
|
|
1345
|
+
this.appendChild(this.script);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
getProps() {
|
|
1349
|
+
return {
|
|
1350
|
+
mode: this.getAttribute("mode"),
|
|
1351
|
+
library: this.getAttribute("library"),
|
|
1352
|
+
src: this.getAttribute("src")
|
|
1353
|
+
};
|
|
1354
|
+
}
|
|
1355
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
1356
|
+
this.set(this.getProps());
|
|
1357
|
+
}
|
|
1358
|
+
set(options) {
|
|
1359
|
+
Object.assign(this, options);
|
|
1360
|
+
const keys = Object.keys(this.getProps());
|
|
1361
|
+
for (var key of keys) {
|
|
1362
|
+
const value = this[key];
|
|
1363
|
+
if (value == null) {
|
|
1364
|
+
this.removeAttribute(key);
|
|
1365
|
+
this.load();
|
|
1366
|
+
} else if (this.getAttribute(key) != String(value)) {
|
|
1367
|
+
this.setAttribute(key, String(value));
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
if (this.mode) {
|
|
1371
|
+
this.removeAttribute("hidden");
|
|
1372
|
+
} else if (this.getAttribute("hidden") == null) {
|
|
1373
|
+
this.setAttribute("hidden", "hidden");
|
|
1374
|
+
}
|
|
1375
|
+
if (this.element && this.element.set) {
|
|
1376
|
+
this.element.onClose = this.onClose;
|
|
1377
|
+
this.element.set(options);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
var HTMLFeaasLoader = class extends WebComponent {
|
|
1382
|
+
static get observedAttributes() {
|
|
1383
|
+
return ["hidden"];
|
|
1384
|
+
}
|
|
1385
|
+
connectedCallback() {
|
|
1386
|
+
this.style.opacity = "1";
|
|
1387
|
+
this.style.transition = "opacity 0.2s 0.6s";
|
|
1388
|
+
this.stylesheet = document.createElement("style");
|
|
1389
|
+
this.stylesheet.textContent = `
|
|
1390
|
+
#loader {
|
|
1391
|
+
position: absolute;
|
|
1392
|
+
top: 0;
|
|
1393
|
+
left: 0;
|
|
1394
|
+
right: 0;
|
|
1395
|
+
bottom: 0;
|
|
1396
|
+
display: flex;
|
|
1397
|
+
align-items: center;
|
|
1398
|
+
justify-content: center;
|
|
1399
|
+
background: #f6f6ff;
|
|
1400
|
+
z-index: 1000;
|
|
1401
|
+
opacity: 1;
|
|
1402
|
+
transition: top 0.3s, background-color 0.7s 0.3s;
|
|
1403
|
+
}
|
|
1404
|
+
@keyframes loader-disappearance {
|
|
1405
|
+
100% {
|
|
1406
|
+
opacity: 0;
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
@keyframes loader-appearance {
|
|
1410
|
+
0% {
|
|
1411
|
+
opacity: 0;
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
@keyframes loader-circular-track {
|
|
1415
|
+
0% {
|
|
1416
|
+
stroke-dasharray: 1, 400;
|
|
1417
|
+
stroke-dashoffset: 0;
|
|
1418
|
+
}
|
|
1419
|
+
50% {
|
|
1420
|
+
stroke-dasharray: 400, 400;
|
|
1421
|
+
stroke-dashoffset: -100;
|
|
1422
|
+
}
|
|
1423
|
+
100% {
|
|
1424
|
+
stroke-dasharray: 400, 400;
|
|
1425
|
+
stroke-dashoffset: -260;
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
@keyframes loader-circular-spinner {
|
|
1430
|
+
0% {
|
|
1431
|
+
transform: rotate(0deg);
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
100% {
|
|
1435
|
+
transform: rotate(360deg);
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
#loader .spinner {
|
|
1439
|
+
animation: loader-disappearance 0.6s both;
|
|
1440
|
+
width: 48px;
|
|
1441
|
+
height: 48px;
|
|
1442
|
+
}
|
|
1443
|
+
#loader .spinner {
|
|
1444
|
+
animation: loader-appearance 0.6s both;
|
|
1445
|
+
}
|
|
1446
|
+
`;
|
|
1447
|
+
this.root = this.attachShadow({ mode: "open" });
|
|
1448
|
+
this.loader = document.createElement("div");
|
|
1449
|
+
this.loader.id = "loader";
|
|
1450
|
+
this.loader.innerHTML = `
|
|
1451
|
+
<div class="spinner">
|
|
1452
|
+
<svg
|
|
1453
|
+
viewBox="0 0 100 100"
|
|
1454
|
+
style="
|
|
1455
|
+
animation: 2s linear 0s infinite normal none running loader-circular-spinner;
|
|
1456
|
+
display: block;
|
|
1457
|
+
width: 48px;
|
|
1458
|
+
height: 48px;
|
|
1459
|
+
"
|
|
1460
|
+
>
|
|
1461
|
+
<circle fill="transparent" cx="50" cy="50" r="42" stroke="rgba(0,0,0,0.1)" stroke-width="10px"></circle>
|
|
1462
|
+
<circle
|
|
1463
|
+
fill="transparent"
|
|
1464
|
+
stroke="#5548D9"
|
|
1465
|
+
cx="50"
|
|
1466
|
+
cy="50"
|
|
1467
|
+
r="42"
|
|
1468
|
+
stroke-width="10px"
|
|
1469
|
+
stroke-linecap="round"
|
|
1470
|
+
style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
|
|
1471
|
+
></circle>
|
|
1472
|
+
</svg>
|
|
1473
|
+
</div>`;
|
|
1474
|
+
this.shadowRoot.appendChild(this.stylesheet);
|
|
1475
|
+
this.shadowRoot.appendChild(this.loader);
|
|
1476
|
+
}
|
|
1477
|
+
};
|
|
1309
1478
|
if (typeof window != "undefined" && !window.customElements.get("feaas-stylesheet")) {
|
|
1310
1479
|
window.customElements.define("feaas-stylesheet", HTMLFeaasStylesheet);
|
|
1311
1480
|
window.customElements.define("feaas-component", HTMLFeaasComponent);
|
|
1481
|
+
window.customElements.define("feaas-picker-lazy", HTMLFeaasPickerLazy);
|
|
1482
|
+
window.customElements.define("feaas-loader", HTMLFeaasLoader);
|
|
1312
1483
|
}
|
|
1313
1484
|
|
|
1314
1485
|
// 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>;
|