@spscommerce/ds-web-components 5.0.2 → 5.2.2-ie
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/components/file-upload/file-upload.d.ts +119 -0
- package/dist/components/file-upload/file-upload.examples.d.ts +2 -0
- package/dist/components/file-upload/file-upload.examples.js +77 -0
- package/dist/components/file-upload/file-upload.examples.js.map +1 -0
- package/dist/components/file-upload/file-upload.js +415 -0
- package/dist/components/file-upload/file-upload.js.map +1 -0
- package/dist/components/file-upload/mime-type.enum.d.ts +75 -0
- package/dist/components/file-upload/mime-type.enum.js +77 -0
- package/dist/components/file-upload/mime-type.enum.js.map +1 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.js +12 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/insight-card/insight-card.d.ts +40 -0
- package/dist/components/insight-card/insight-card.examples.d.ts +51 -0
- package/dist/components/insight-card/insight-card.examples.js +58 -0
- package/dist/components/insight-card/insight-card.examples.js.map +1 -0
- package/dist/components/insight-card/insight-card.js +147 -0
- package/dist/components/insight-card/insight-card.js.map +1 -0
- package/dist/components/insight-card/insights.d.ts +18 -0
- package/dist/components/insight-card/insights.js +90 -0
- package/dist/components/insight-card/insights.js.map +1 -0
- package/dist/components/nav-tabs/nav-tab-set.d.ts +7 -0
- package/dist/components/nav-tabs/nav-tab-set.js +53 -0
- package/dist/components/nav-tabs/nav-tab-set.js.map +1 -0
- package/dist/components/nav-tabs/nav-tab.d.ts +24 -0
- package/dist/components/nav-tabs/nav-tab.js +94 -0
- package/dist/components/nav-tabs/nav-tab.js.map +1 -0
- package/dist/components/nav-tabs/nav-tabs.examples.d.ts +11 -0
- package/dist/components/nav-tabs/nav-tabs.examples.js +18 -0
- package/dist/components/nav-tabs/nav-tabs.examples.js.map +1 -0
- package/dist/components/photo/photo.d.ts +42 -0
- package/dist/components/photo/photo.examples.d.ts +2 -0
- package/dist/components/photo/photo.examples.js +58 -0
- package/dist/components/photo/photo.examples.js.map +1 -0
- package/dist/components/photo/photo.js +172 -0
- package/dist/components/photo/photo.js.map +1 -0
- package/dist/decorators/component.d.ts +33 -0
- package/dist/decorators/component.js +313 -0
- package/dist/decorators/component.js.map +1 -0
- package/dist/decorators/content.d.ts +7 -0
- package/dist/decorators/content.js +13 -0
- package/dist/decorators/content.js.map +1 -0
- package/dist/decorators/event-dispatcher.d.ts +9 -0
- package/dist/decorators/event-dispatcher.js +22 -0
- package/dist/decorators/event-dispatcher.js.map +1 -0
- package/dist/decorators/event-listener.d.ts +5 -0
- package/dist/decorators/event-listener.js +14 -0
- package/dist/decorators/event-listener.js.map +1 -0
- package/dist/decorators/index.d.ts +7 -0
- package/dist/decorators/index.js +8 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/prop.d.ts +6 -0
- package/dist/decorators/prop.js +47 -0
- package/dist/decorators/prop.js.map +1 -0
- package/dist/decorators/query-selector.d.ts +19 -0
- package/dist/decorators/query-selector.js +32 -0
- package/dist/decorators/query-selector.js.map +1 -0
- package/dist/decorators/watch.d.ts +2 -0
- package/dist/decorators/watch.js +27 -0
- package/dist/decorators/watch.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/index.cjs.js +3190 -642
- package/dist/lib/index.es.js +2914 -2368
- package/dist/manifest.d.ts +2 -0
- package/dist/manifest.js +33 -0
- package/dist/manifest.js.map +1 -0
- package/dist/package.json +4 -3
- package/dist/utils/comment.d.ts +2 -0
- package/dist/utils/comment.js +15 -0
- package/dist/utils/comment.js.map +1 -0
- package/dist/utils/i18n.d.ts +3 -0
- package/dist/utils/i18n.js +9 -0
- package/dist/utils/i18n.js.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/metadata.d.ts +22 -0
- package/dist/utils/metadata.js +23 -0
- package/dist/utils/metadata.js.map +1 -0
- package/dist/utils/pragma.d.ts +6 -0
- package/dist/utils/pragma.js +143 -0
- package/dist/utils/pragma.js.map +1 -0
- package/dist/utils/register.d.ts +13 -0
- package/dist/utils/register.js +73 -0
- package/dist/utils/register.js.map +1 -0
- package/lib/index.cjs.js +3190 -642
- package/lib/index.es.js +2914 -2368
- package/package.json +9 -9
- package/rollup.config.js +22 -0
- package/spscommerce-ds-web-components-4.36.3-ie.tgz +0 -0
- package/spscommerce-ds-web-components-5.0.2-ie.tgz +0 -0
- package/vite.config.js +1 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
+
};
|
|
25
|
+
/** @jsx h */
|
|
26
|
+
/* eslint-disable new-cap */
|
|
27
|
+
import { SpsIcon } from "@spscommerce/ds-shared";
|
|
28
|
+
import { ClassBindings, Component, Prop } from "../../decorators/index";
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
+
import { h } from "../../utils/pragma";
|
|
31
|
+
var SpsNavTabComponent = /** @class */ (function (_super) {
|
|
32
|
+
__extends(SpsNavTabComponent, _super);
|
|
33
|
+
function SpsNavTabComponent() {
|
|
34
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
+
_this.active = false;
|
|
36
|
+
_this.label = "";
|
|
37
|
+
_this.tag = "";
|
|
38
|
+
return _this;
|
|
39
|
+
}
|
|
40
|
+
Object.defineProperty(SpsNavTabComponent.prototype, ClassBindings, {
|
|
41
|
+
get: function () {
|
|
42
|
+
return [
|
|
43
|
+
"sps-tabbed-nav__nav-item", this.active && "sps-tabbed-nav__nav-item--active",
|
|
44
|
+
];
|
|
45
|
+
},
|
|
46
|
+
enumerable: false,
|
|
47
|
+
configurable: true
|
|
48
|
+
});
|
|
49
|
+
SpsNavTabComponent.prototype.render = function () {
|
|
50
|
+
return (h("a", { href: this.href, target: this.target, className: "sps-tabbed-nav__nav-item-link", tabIndex: 0 },
|
|
51
|
+
this.icon && h("i", { className: "sps-icon sps-icon-" + this.icon }),
|
|
52
|
+
this.label && h("span", null, this.label),
|
|
53
|
+
this.tag && h("span", { className: "sps-tag sps-tag--default" }, this.tag)));
|
|
54
|
+
};
|
|
55
|
+
SpsNavTabComponent.displayName = "sps-nav-tab";
|
|
56
|
+
SpsNavTabComponent.props = {
|
|
57
|
+
active: "boolean",
|
|
58
|
+
label: "string",
|
|
59
|
+
icon: "SpsIcon",
|
|
60
|
+
tag: "string",
|
|
61
|
+
href: "string",
|
|
62
|
+
target: "string",
|
|
63
|
+
};
|
|
64
|
+
__decorate([
|
|
65
|
+
Prop(),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], SpsNavTabComponent.prototype, "active", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
Prop(),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], SpsNavTabComponent.prototype, "label", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
Prop(),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], SpsNavTabComponent.prototype, "icon", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
Prop(),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], SpsNavTabComponent.prototype, "tag", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
Prop(),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], SpsNavTabComponent.prototype, "href", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
Prop(),
|
|
86
|
+
__metadata("design:type", String)
|
|
87
|
+
], SpsNavTabComponent.prototype, "target", void 0);
|
|
88
|
+
SpsNavTabComponent = __decorate([
|
|
89
|
+
Component({ tag: "sps-nav-tab" })
|
|
90
|
+
], SpsNavTabComponent);
|
|
91
|
+
return SpsNavTabComponent;
|
|
92
|
+
}(HTMLElement));
|
|
93
|
+
export { SpsNavTabComponent };
|
|
94
|
+
//# sourceMappingURL=nav-tab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-tab.js","sourceRoot":"","sources":["../../../src/components/nav-tabs/nav-tab.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,4BAA4B;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACxE,6DAA6D;A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BAAkB,CAyC9B;IAAD,yBAAC;CAAA,AAzCD,CAAwC,WAAW,GAyClD;SAzCY,kBAAkB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { code } from "@spscommerce/utils";
|
|
6
|
+
export var SpsNavTabsExamples = {
|
|
7
|
+
basic: {
|
|
8
|
+
label: "Basic Navigation Tabs",
|
|
9
|
+
description: code(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n <p>Navigation tabs native web component</p>\n "], ["\n <p>Navigation tabs native web component</p>\n "]))),
|
|
10
|
+
examples: {
|
|
11
|
+
basic: {
|
|
12
|
+
react: code(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n function DemoComponent() {\n const tabs = [\n { label: \"Tab A\", icon: \"chart-line\" },\n { label: \"Tab B\", icon: \"chart-bar\", tag: \"12\" },\n { label: \"Tab C\", icon: \"chart-pie\" }\n ]\n\n const [activeTab, setActiveTab] = React.useState(0)\n\n return (\n <sps-nav-tab-set>\n {tabs.map((tab, index) => (\n <sps-nav-tab\n key={index}\n icon={tab.icon}\n label={tab.label}\n tag={tab.tag}\n active={index === activeTab || null}\n onClick={() => setActiveTab(index)}\n />\n ))}\n </sps-nav-tab-set>\n )\n }\n "], ["\n function DemoComponent() {\n const tabs = [\n { label: \"Tab A\", icon: \"chart-line\" },\n { label: \"Tab B\", icon: \"chart-bar\", tag: \"12\" },\n { label: \"Tab C\", icon: \"chart-pie\" }\n ]\n\n const [activeTab, setActiveTab] = React.useState(0)\n\n return (\n <sps-nav-tab-set>\n {tabs.map((tab, index) => (\n <sps-nav-tab\n key={index}\n icon={tab.icon}\n label={tab.label}\n tag={tab.tag}\n active={index === activeTab || null}\n onClick={() => setActiveTab(index)}\n />\n ))}\n </sps-nav-tab-set>\n )\n }\n "]))),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
var templateObject_1, templateObject_2;
|
|
18
|
+
//# sourceMappingURL=nav-tabs.examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-tabs.examples.js","sourceRoot":"","sources":["../../../src/components/nav-tabs/nav-tabs.examples.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,IAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE;QACL,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE,IAAI,sIAAA,mEAEZ,IAAA;QACL,QAAQ,EAAE;YACR,KAAK,EAAE;gBACL,KAAK,EAAE,IAAI,0rCAAA,unCAyBF,IAAA;aACV;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** @jsx h */
|
|
2
|
+
import { SpsIcon } from "@spscommerce/ds-shared";
|
|
3
|
+
import { ClassBindings, StyleBindings } from "../../decorators/index";
|
|
4
|
+
export declare enum SpsPhotoDisplayMode {
|
|
5
|
+
FIT = "fit",
|
|
6
|
+
FILL = "fill"
|
|
7
|
+
}
|
|
8
|
+
export declare class SpsPhotoComponent extends HTMLElement {
|
|
9
|
+
static readonly displayName = "sps-photo";
|
|
10
|
+
static readonly props: {
|
|
11
|
+
src: string;
|
|
12
|
+
altText: string;
|
|
13
|
+
mode: string;
|
|
14
|
+
placeholderIcon: string;
|
|
15
|
+
};
|
|
16
|
+
/** Photo source path, exactly the same as for an <img> tag. */
|
|
17
|
+
src: string;
|
|
18
|
+
/** Alt text to put on the image for vision impaired users. */
|
|
19
|
+
altText: string;
|
|
20
|
+
/** Display mode - fill or fit. */
|
|
21
|
+
mode: SpsPhotoDisplayMode;
|
|
22
|
+
/** If src is empty, the placeholder icon will be displayed instead. */
|
|
23
|
+
placeholderIcon: SpsIcon;
|
|
24
|
+
private width;
|
|
25
|
+
private fitWidth;
|
|
26
|
+
private imageInternal;
|
|
27
|
+
/** The native HTML <img> element within the photo component. */
|
|
28
|
+
get image(): HTMLImageElement;
|
|
29
|
+
set image(newValue: HTMLImageElement);
|
|
30
|
+
get [ClassBindings](): string[];
|
|
31
|
+
get [StyleBindings](): {
|
|
32
|
+
fontSize: string;
|
|
33
|
+
width: string;
|
|
34
|
+
height: string;
|
|
35
|
+
};
|
|
36
|
+
private waitForWidthInterval;
|
|
37
|
+
private waitForImgHeightInterval;
|
|
38
|
+
connectedCallback(): void;
|
|
39
|
+
disconnectedCallback(): void;
|
|
40
|
+
render(): JSX.Element;
|
|
41
|
+
private setWidth;
|
|
42
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { code } from "@spscommerce/utils";
|
|
6
|
+
export var SpsPhotoExamples = {
|
|
7
|
+
sizing: {
|
|
8
|
+
label: "Sizing",
|
|
9
|
+
description: code(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n <p>\n Photos are block elements, so a photo fills its container's width unless\n an explicit width is set. It is always a 4:3 aspect ratio. In this example,\n photos have been placed in cards which have different widths in the 12\n column grid.\n </p>\n "], ["\n <p>\n Photos are block elements, so a photo fills its container's width unless\n an explicit width is set. It is always a 4:3 aspect ratio. In this example,\n photos have been placed in cards which have different widths in the 12\n column grid.\n </p>\n "]))),
|
|
10
|
+
examples: {
|
|
11
|
+
basic: {
|
|
12
|
+
jsx: code(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-2\">\n <sps-card>\n <sps-photo src=\"assets/images/photo-landscape.jpg\"></sps-photo>\n </sps-card>\n </div>\n <div className=\"sfg-col-4\">\n <sps-card>\n <sps-photo src=\"assets/images/photo-landscape.jpg\"></sps-photo>\n </sps-card>\n </div>\n <div className=\"sfg-col-6\">\n <sps-card>\n <sps-photo src=\"assets/images/photo-landscape.jpg\"></sps-photo>\n </sps-card>\n </div>\n </div>\n "], ["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-2\">\n <sps-card>\n <sps-photo src=\"assets/images/photo-landscape.jpg\"></sps-photo>\n </sps-card>\n </div>\n <div className=\"sfg-col-4\">\n <sps-card>\n <sps-photo src=\"assets/images/photo-landscape.jpg\"></sps-photo>\n </sps-card>\n </div>\n <div className=\"sfg-col-6\">\n <sps-card>\n <sps-photo src=\"assets/images/photo-landscape.jpg\"></sps-photo>\n </sps-card>\n </div>\n </div>\n "]))),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
displayMode: {
|
|
17
|
+
label: "Fill vs. Fit",
|
|
18
|
+
description: code(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n <p>\n There are two display modes available:\n <ul>\n <li><b>\"fill\"</b> fills the entire 4:3 container, cropping off any excess portions of the image.\n <li><b>\"fit\"</b> fits the entire image into the container, leaving any excess portions of the container blank.\n </ul>\n </p>\n "], ["\n <p>\n There are two display modes available:\n <ul>\n <li><b>\"fill\"</b> fills the entire 4:3 container, cropping off any excess portions of the image.\n <li><b>\"fit\"</b> fits the entire image into the container, leaving any excess portions of the container blank.\n </ul>\n </p>\n "]))),
|
|
19
|
+
examples: {
|
|
20
|
+
landscape: {
|
|
21
|
+
description: "<p>Landscape oriented photo (container outline added for illustrative purposes)</p>",
|
|
22
|
+
jsx: code(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-4\">\n <sps-photo src=\"assets/images/photo-landscape.jpg\" mode=\"fill\"></sps-photo>\n </div>\n <div className=\"sfg-col-4\">\n <sps-photo src=\"assets/images/photo-landscape.jpg\" mode=\"fit\"></sps-photo>\n </div>\n </div>\n "], ["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-4\">\n <sps-photo src=\"assets/images/photo-landscape.jpg\" mode=\"fill\"></sps-photo>\n </div>\n <div className=\"sfg-col-4\">\n <sps-photo src=\"assets/images/photo-landscape.jpg\" mode=\"fit\"></sps-photo>\n </div>\n </div>\n "]))),
|
|
23
|
+
},
|
|
24
|
+
portrait: {
|
|
25
|
+
description: "<p>Portrait oriented photo (container outline added for illustrative purposes)</p>",
|
|
26
|
+
jsx: code(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-4\">\n <sps-photo src=\"assets/images/photo-portrait.jpg\" mode=\"fill\"></sps-photo>\n </div>\n <div className=\"sfg-col-4\">\n <sps-photo id=\"foo\" src=\"assets/images/photo-portrait.jpg\" mode=\"fit\"></sps-photo>\n </div>\n </div>\n "], ["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-4\">\n <sps-photo src=\"assets/images/photo-portrait.jpg\" mode=\"fill\"></sps-photo>\n </div>\n <div className=\"sfg-col-4\">\n <sps-photo id=\"foo\" src=\"assets/images/photo-portrait.jpg\" mode=\"fit\"></sps-photo>\n </div>\n </div>\n "]))),
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
placeholder: {
|
|
31
|
+
label: "Placeholders",
|
|
32
|
+
description: code(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n <p>\n When an image is not provided for a particular use case (such as a user avatar,\n a company photo, item image, etc.), a placeholder should be shown in its place.\n\n The placeholder's icon, selected from our SPS icon set, should represent the\n type of image it is substituting for.\n </p>\n "], ["\n <p>\n When an image is not provided for a particular use case (such as a user avatar,\n a company photo, item image, etc.), a placeholder should be shown in its place.\n\n The placeholder's icon, selected from our SPS icon set, should represent the\n type of image it is substituting for.\n </p>\n "]))),
|
|
33
|
+
examples: {
|
|
34
|
+
general: {
|
|
35
|
+
description: "<p>General Photo</p>",
|
|
36
|
+
jsx: code(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-3\">\n <sps-photo placeholderIcon=\"photo\"></sps-photo>\n </div>\n </div>\n "], ["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-3\">\n <sps-photo placeholderIcon=\"photo\"></sps-photo>\n </div>\n </div>\n "]))),
|
|
37
|
+
},
|
|
38
|
+
photoAlt: {
|
|
39
|
+
description: "<p>Photo Alt</p>",
|
|
40
|
+
jsx: code(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-3\">\n <sps-photo placeholderIcon=\"camera\"></sps-photo>\n </div>\n </div>\n "], ["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-3\">\n <sps-photo placeholderIcon=\"camera\"></sps-photo>\n </div>\n </div>\n "]))),
|
|
41
|
+
},
|
|
42
|
+
user: {
|
|
43
|
+
description: "<p>User / Single Person</p>",
|
|
44
|
+
jsx: code(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-3\">\n <sps-photo placeholderIcon=\"user\"></sps-photo>\n </div>\n </div>\n "], ["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-3\">\n <sps-photo placeholderIcon=\"user\"></sps-photo>\n </div>\n </div>\n "]))),
|
|
45
|
+
},
|
|
46
|
+
group: {
|
|
47
|
+
description: "<p>Group / Multiple People</p>",
|
|
48
|
+
jsx: code(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-3\">\n <sps-photo placeholderIcon=\"group\"></sps-photo>\n </div>\n </div>\n "], ["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-3\">\n <sps-photo placeholderIcon=\"group\"></sps-photo>\n </div>\n </div>\n "]))),
|
|
49
|
+
},
|
|
50
|
+
company: {
|
|
51
|
+
description: "<p>Company / Building</p>",
|
|
52
|
+
jsx: code(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-3\">\n <sps-photo placeholderIcon=\"building\"></sps-photo>\n </div>\n </div>\n "], ["\n <div className=\"sfg-row\">\n <div className=\"sfg-col-3\">\n <sps-photo placeholderIcon=\"building\"></sps-photo>\n </div>\n </div>\n "]))),
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
58
|
+
//# sourceMappingURL=photo.examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"photo.examples.js","sourceRoot":"","sources":["../../../src/components/photo/photo.examples.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG1C,MAAM,CAAC,IAAM,gBAAgB,GAAoB;IAC/C,MAAM,EAAE;QACN,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,IAAI,mYAAA,gUAOhB,IAAA;QACD,QAAQ,EAAE;YACR,KAAK,EAAE;gBACL,GAAG,EAAE,IAAI,qzBAAA,kvBAkBR,IAAA;aACF;SACF;KACF;IACD,WAAW,EAAE;QACX,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,IAAI,qbAAA,kXAQhB,IAAA;QACD,QAAQ,EAAE;YACR,SAAS,EAAE;gBACT,WAAW,EAAE,qFAAqF;gBAClG,GAAG,EAAE,IAAI,meAAA,gaASR,IAAA;aACF;YACD,QAAQ,EAAE;gBACR,WAAW,EAAE,oFAAoF;gBACjG,GAAG,EAAE,IAAI,4eAAA,yaASR,IAAA;aACF;SACF;KACF;IACD,WAAW,EAAE;QACX,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,IAAI,+aAAA,4WAQhB,IAAA;QACD,QAAQ,EAAE;YACR,OAAO,EAAE;gBACP,WAAW,EAAE,sBAAsB;gBACnC,GAAG,EAAE,IAAI,kTAAA,+OAMJ,IAAA;aACN;YACD,QAAQ,EAAE;gBACR,WAAW,EAAE,kBAAkB;gBAC/B,GAAG,EAAE,IAAI,mTAAA,gPAMJ,IAAA;aACN;YACD,IAAI,EAAE;gBACJ,WAAW,EAAE,6BAA6B;gBAC1C,GAAG,EAAE,IAAI,iTAAA,8OAMJ,IAAA;aACN;YACD,KAAK,EAAE;gBACL,WAAW,EAAE,gCAAgC;gBAC7C,GAAG,EAAE,IAAI,oTAAA,+OAMJ,IAAA;aACN;YACD,OAAO,EAAE;gBACP,WAAW,EAAE,2BAA2B;gBACxC,GAAG,EAAE,IAAI,uTAAA,kPAMJ,IAAA;aACN;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
+
};
|
|
25
|
+
/** @jsx h */
|
|
26
|
+
/* eslint-disable new-cap */
|
|
27
|
+
import { SpsIcon } from "@spscommerce/ds-shared";
|
|
28
|
+
import { ClassBindings, Component, Prop, QuerySelector, StyleBindings, Watch, } from "../../decorators/index";
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
+
import { h } from "../../utils/pragma";
|
|
31
|
+
export var SpsPhotoDisplayMode;
|
|
32
|
+
(function (SpsPhotoDisplayMode) {
|
|
33
|
+
SpsPhotoDisplayMode["FIT"] = "fit";
|
|
34
|
+
SpsPhotoDisplayMode["FILL"] = "fill";
|
|
35
|
+
})(SpsPhotoDisplayMode || (SpsPhotoDisplayMode = {}));
|
|
36
|
+
var CPT_NAME = "sps-photo";
|
|
37
|
+
var SpsPhotoComponent = /** @class */ (function (_super) {
|
|
38
|
+
__extends(SpsPhotoComponent, _super);
|
|
39
|
+
function SpsPhotoComponent() {
|
|
40
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
41
|
+
/** Display mode - fill or fit. */
|
|
42
|
+
_this.mode = SpsPhotoDisplayMode.FILL;
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
Object.defineProperty(SpsPhotoComponent.prototype, "image", {
|
|
46
|
+
/** The native HTML <img> element within the photo component. */
|
|
47
|
+
get: function () {
|
|
48
|
+
return this.imageInternal;
|
|
49
|
+
},
|
|
50
|
+
set: function (newValue) {
|
|
51
|
+
var _this = this;
|
|
52
|
+
this.imageInternal = newValue;
|
|
53
|
+
if (newValue) {
|
|
54
|
+
if (this.waitForImgHeightInterval) {
|
|
55
|
+
window.clearInterval(this.waitForImgHeightInterval);
|
|
56
|
+
}
|
|
57
|
+
this.waitForImgHeightInterval = window.setInterval(function () {
|
|
58
|
+
var imgRect = newValue.getBoundingClientRect();
|
|
59
|
+
if (imgRect.height) {
|
|
60
|
+
window.clearInterval(_this.waitForImgHeightInterval);
|
|
61
|
+
delete _this.waitForImgHeightInterval;
|
|
62
|
+
var imageIsLandscape = true;
|
|
63
|
+
imageIsLandscape = imgRect.width / imgRect.height > 1;
|
|
64
|
+
_this.fitWidth = imageIsLandscape === (_this.mode === SpsPhotoDisplayMode.FIT);
|
|
65
|
+
}
|
|
66
|
+
}, 1000 / 60);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
enumerable: false,
|
|
70
|
+
configurable: true
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(SpsPhotoComponent.prototype, ClassBindings, {
|
|
73
|
+
get: function () {
|
|
74
|
+
return [
|
|
75
|
+
CPT_NAME,
|
|
76
|
+
this.fitWidth
|
|
77
|
+
? CPT_NAME + "--fit-width"
|
|
78
|
+
: CPT_NAME + "--fit-height",
|
|
79
|
+
this.placeholderIcon && CPT_NAME + "--placeholder",
|
|
80
|
+
];
|
|
81
|
+
},
|
|
82
|
+
enumerable: false,
|
|
83
|
+
configurable: true
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(SpsPhotoComponent.prototype, StyleBindings, {
|
|
86
|
+
get: function () {
|
|
87
|
+
return {
|
|
88
|
+
fontSize: this.width * 0.05 + "rem",
|
|
89
|
+
width: this.width + "rem",
|
|
90
|
+
height: 0.75 * this.width + "rem",
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
enumerable: false,
|
|
94
|
+
configurable: true
|
|
95
|
+
});
|
|
96
|
+
SpsPhotoComponent.prototype.connectedCallback = function () {
|
|
97
|
+
var _this = this;
|
|
98
|
+
this.waitForWidthInterval = window.setInterval(function () {
|
|
99
|
+
var boundingClientRect = _this.getBoundingClientRect();
|
|
100
|
+
if (boundingClientRect.width) {
|
|
101
|
+
_this.setWidth(boundingClientRect.width);
|
|
102
|
+
window.clearInterval(_this.waitForWidthInterval);
|
|
103
|
+
delete _this.waitForWidthInterval;
|
|
104
|
+
}
|
|
105
|
+
}, 1000 / 60);
|
|
106
|
+
};
|
|
107
|
+
SpsPhotoComponent.prototype.disconnectedCallback = function () {
|
|
108
|
+
if (this.waitForWidthInterval) {
|
|
109
|
+
window.clearInterval(this.waitForWidthInterval);
|
|
110
|
+
}
|
|
111
|
+
if (this.waitForImgHeightInterval) {
|
|
112
|
+
window.clearInterval(this.waitForImgHeightInterval);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
SpsPhotoComponent.prototype.render = function () {
|
|
116
|
+
if (this.src) {
|
|
117
|
+
return this.width
|
|
118
|
+
? h("img", { src: this.src, alt: this.altText })
|
|
119
|
+
: h("span", null);
|
|
120
|
+
}
|
|
121
|
+
return h("i", { className: "sps-icon sps-icon-" + this.placeholderIcon });
|
|
122
|
+
};
|
|
123
|
+
SpsPhotoComponent.prototype.setWidth = function (hostWidth) {
|
|
124
|
+
if (hostWidth && !this.width) {
|
|
125
|
+
var baseFontSize = document.body.parentElement.style.fontSize || "16px";
|
|
126
|
+
var remPx = Number(baseFontSize.substr(0, baseFontSize.length - 2));
|
|
127
|
+
this.width = hostWidth / remPx;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
SpsPhotoComponent.displayName = CPT_NAME;
|
|
131
|
+
SpsPhotoComponent.props = {
|
|
132
|
+
src: "string",
|
|
133
|
+
altText: "string",
|
|
134
|
+
mode: "SpsPhotoDisplayMode",
|
|
135
|
+
placeholderIcon: "SpsIcon",
|
|
136
|
+
};
|
|
137
|
+
__decorate([
|
|
138
|
+
Prop(),
|
|
139
|
+
__metadata("design:type", String)
|
|
140
|
+
], SpsPhotoComponent.prototype, "src", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
Prop(),
|
|
143
|
+
__metadata("design:type", String)
|
|
144
|
+
], SpsPhotoComponent.prototype, "altText", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
Prop(),
|
|
147
|
+
__metadata("design:type", Object)
|
|
148
|
+
], SpsPhotoComponent.prototype, "mode", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
Prop(),
|
|
151
|
+
__metadata("design:type", String)
|
|
152
|
+
], SpsPhotoComponent.prototype, "placeholderIcon", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
Watch(),
|
|
155
|
+
__metadata("design:type", Number)
|
|
156
|
+
], SpsPhotoComponent.prototype, "width", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
Watch(),
|
|
159
|
+
__metadata("design:type", Object)
|
|
160
|
+
], SpsPhotoComponent.prototype, "fitWidth", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
QuerySelector("img", { refresh: true }),
|
|
163
|
+
__metadata("design:type", HTMLImageElement),
|
|
164
|
+
__metadata("design:paramtypes", [HTMLImageElement])
|
|
165
|
+
], SpsPhotoComponent.prototype, "image", null);
|
|
166
|
+
SpsPhotoComponent = __decorate([
|
|
167
|
+
Component({ tag: CPT_NAME })
|
|
168
|
+
], SpsPhotoComponent);
|
|
169
|
+
return SpsPhotoComponent;
|
|
170
|
+
}(HTMLElement));
|
|
171
|
+
export { SpsPhotoComponent };
|
|
172
|
+
//# sourceMappingURL=photo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"photo.js","sourceRoot":"","sources":["../../../src/components/photo/photo.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,4BAA4B;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EACL,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,GACpE,MAAM,wBAAwB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
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { I18nObject } from "@spscommerce/ds-shared";
|
|
2
|
+
import type { ComponentConfig } from "../utils/index";
|
|
3
|
+
export declare const AttrBindings: unique symbol;
|
|
4
|
+
export declare const ClassBindings: unique symbol;
|
|
5
|
+
export declare const StyleBindings: unique symbol;
|
|
6
|
+
interface DSElementExtension {
|
|
7
|
+
__initialized: boolean;
|
|
8
|
+
__observer: MutationObserver;
|
|
9
|
+
__queuedUpdate: number;
|
|
10
|
+
__managedClasses: Set<string>;
|
|
11
|
+
__cbAttributeChanged?: (key: string, oldValue: any, newValue: any) => any;
|
|
12
|
+
__cbConnected?: () => any;
|
|
13
|
+
__cbDisconnected?: () => any;
|
|
14
|
+
__updateHostBindings: () => any;
|
|
15
|
+
__updateChildQueries: (adhereToRefreshOption?: boolean) => any;
|
|
16
|
+
__gatherChildren: () => any;
|
|
17
|
+
__startMutObs: () => any;
|
|
18
|
+
__stopMutObs: () => any;
|
|
19
|
+
__doRender: () => any;
|
|
20
|
+
update: () => any;
|
|
21
|
+
attributeChangedCallback: (key: string, oldValue: any, newValue: any) => any;
|
|
22
|
+
connectedCallback: () => any;
|
|
23
|
+
disconnectedCallback: () => any;
|
|
24
|
+
contentChangedCallback?: () => any;
|
|
25
|
+
render?: (i18n: I18nObject) => any;
|
|
26
|
+
}
|
|
27
|
+
export declare type DSComponent = HTMLElement & DSElementExtension;
|
|
28
|
+
/**
|
|
29
|
+
* Marks a class as a component, setting the tag it will be registered under
|
|
30
|
+
* when the class is passed to `register()`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function Component(config: ComponentConfig): ClassDecorator;
|
|
33
|
+
export {};
|