@sapudex/web-components 2.10.0 → 2.11.0
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/bundle.esm.js +1 -0
- package/cypress/specs/Accordion.cy.tsx +19 -0
- package/cypress/specs/AccordionItem.cy.tsx +9 -0
- package/cypress/specs/Footer.cy.tsx +48 -11
- package/cypress/specs/PromoTile.cy.tsx +124 -0
- package/cypress/specs/Quote.cy.tsx +65 -0
- package/cypress/support/component-imports.instrumented.ts +4 -0
- package/cypress/support/component-imports.src.ts +5 -1
- package/dist/Accordion.d.ts +15 -0
- package/dist/Accordion.js +19 -0
- package/dist/Accordion.js.map +1 -1
- package/dist/AccordionItem.d.ts +19 -0
- package/dist/AccordionItem.js +23 -0
- package/dist/AccordionItem.js.map +1 -1
- package/dist/AccordionItemTemplate.js +7 -2
- package/dist/AccordionItemTemplate.js.map +1 -1
- package/dist/AccordionTemplate.js +21 -1
- package/dist/AccordionTemplate.js.map +1 -1
- package/dist/Footer.d.ts +45 -3
- package/dist/Footer.js +41 -17
- package/dist/Footer.js.map +1 -1
- package/dist/PromoTile.d.ts +143 -0
- package/dist/PromoTile.js +198 -0
- package/dist/PromoTile.js.map +1 -0
- package/dist/PromoTileTemplate.d.ts +2 -0
- package/dist/PromoTileTemplate.js +22 -0
- package/dist/PromoTileTemplate.js.map +1 -0
- package/dist/Quote.d.ts +11 -0
- package/dist/Quote.js +18 -3
- package/dist/Quote.js.map +1 -1
- package/dist/Search.d.ts +3 -1
- package/dist/Search.js +1 -0
- package/dist/Search.js.map +1 -1
- package/dist/assets/{InputSuggestions-xcV7PZDf.js → InputSuggestions-9WQMOg4t.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-RYCr4pVL.js → ListItemStandardExpandableTextTemplate-BQaMMo_n.js} +1 -1
- package/dist/assets/{bundle.esm-bg-64miJ.js → bundle.esm-ZNiP-jPI.js} +210 -209
- package/dist/assets/messagebundle_en-DwlTjyni.js +1 -0
- package/dist/css/themes/AccordionItem.css +1 -1
- package/dist/css/themes/BreadcrumbsPopover.css +1 -1
- package/dist/css/themes/CountrySelector.css +1 -1
- package/dist/css/themes/Divider.css +1 -1
- package/dist/css/themes/Footer.css +1 -1
- package/dist/css/themes/HeroBanner.css +1 -1
- package/dist/css/themes/PromoTile.css +1 -0
- package/dist/css/themes/Quote.css +1 -1
- package/dist/css/themes/RatingIndicator.css +1 -1
- package/dist/css/themes/Slider.css +1 -1
- package/dist/css/themes/Tag.css +1 -1
- package/dist/custom-elements-internal.json +614 -160
- package/dist/custom-elements.json +572 -128
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +3 -1
- package/dist/generated/i18n/i18n-defaults.js +3 -1
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/templates/FooterTemplate.lit.js +33 -32
- package/dist/generated/templates/FooterTemplate.lit.js.map +1 -1
- package/dist/generated/templates/HeroBannerTemplate.lit.js +1 -1
- package/dist/generated/templates/HeroBannerTemplate.lit.js.map +1 -1
- package/dist/generated/themes/AccordionItem.css.d.ts +1 -1
- package/dist/generated/themes/AccordionItem.css.js +1 -1
- package/dist/generated/themes/AccordionItem.css.js.map +1 -1
- package/dist/generated/themes/BreadcrumbsPopover.css.d.ts +1 -1
- package/dist/generated/themes/BreadcrumbsPopover.css.js +1 -1
- package/dist/generated/themes/BreadcrumbsPopover.css.js.map +1 -1
- package/dist/generated/themes/CountrySelector.css.d.ts +1 -1
- package/dist/generated/themes/CountrySelector.css.js +1 -1
- package/dist/generated/themes/CountrySelector.css.js.map +1 -1
- package/dist/generated/themes/Divider.css.d.ts +1 -1
- package/dist/generated/themes/Divider.css.js +1 -1
- package/dist/generated/themes/Divider.css.js.map +1 -1
- package/dist/generated/themes/Footer.css.d.ts +1 -1
- package/dist/generated/themes/Footer.css.js +1 -1
- package/dist/generated/themes/Footer.css.js.map +1 -1
- package/dist/generated/themes/HeroBanner.css.d.ts +1 -1
- package/dist/generated/themes/HeroBanner.css.js +1 -1
- package/dist/generated/themes/HeroBanner.css.js.map +1 -1
- package/dist/generated/themes/PromoTile.css.d.ts +2 -0
- package/dist/generated/themes/PromoTile.css.js +8 -0
- package/dist/generated/themes/PromoTile.css.js.map +1 -0
- package/dist/generated/themes/Quote.css.d.ts +1 -1
- package/dist/generated/themes/Quote.css.js +1 -1
- package/dist/generated/themes/Quote.css.js.map +1 -1
- package/dist/generated/themes/RatingIndicator.css.d.ts +1 -1
- package/dist/generated/themes/RatingIndicator.css.js +1 -1
- package/dist/generated/themes/RatingIndicator.css.js.map +1 -1
- package/dist/generated/themes/Slider.css.d.ts +1 -1
- package/dist/generated/themes/Slider.css.js +1 -1
- package/dist/generated/themes/Slider.css.js.map +1 -1
- package/dist/generated/themes/Tag.css.d.ts +1 -1
- package/dist/generated/themes/Tag.css.js +1 -1
- package/dist/generated/themes/Tag.css.js.map +1 -1
- package/dist/messagebundle.properties +6 -0
- package/dist/messagebundle_en.properties +2 -0
- package/dist/types/PromoTile.d.ts +60 -0
- package/dist/types/PromoTile.js +63 -0
- package/dist/types/PromoTile.js.map +1 -0
- package/dist/utils/debounce.d.ts +3 -1
- package/dist/utils/debounce.js +16 -4
- package/dist/utils/debounce.js.map +1 -1
- package/dist/vscode.html-custom-data.json +102 -0
- package/dist/web-types.json +230 -5
- package/package.json +1 -1
- package/src/Accordion.ts +19 -0
- package/src/AccordionItem.ts +28 -0
- package/src/AccordionItemTemplate.tsx +25 -10
- package/src/AccordionTemplate.tsx +22 -1
- package/src/Footer.hbs +39 -36
- package/src/Footer.ts +81 -6
- package/src/HeroBanner.hbs +0 -1
- package/src/PromoTile.ts +290 -0
- package/src/PromoTileTemplate.tsx +68 -0
- package/src/Quote.ts +17 -3
- package/src/Search.ts +1 -0
- package/src/generated/i18n/i18n-defaults.ts +2 -2
- package/src/generated/templates/FooterTemplate.lit.ts +33 -32
- package/src/generated/templates/HeroBannerTemplate.lit.ts +1 -1
- package/src/generated/themes/AccordionItem.css.ts +1 -1
- package/src/generated/themes/BreadcrumbsPopover.css.ts +1 -1
- package/src/generated/themes/CountrySelector.css.ts +1 -1
- package/src/generated/themes/Divider.css.ts +1 -1
- package/src/generated/themes/Footer.css.ts +1 -1
- package/src/generated/themes/HeroBanner.css.ts +1 -1
- package/src/generated/themes/PromoTile.css.ts +9 -0
- package/src/generated/themes/Quote.css.ts +1 -1
- package/src/generated/themes/RatingIndicator.css.ts +1 -1
- package/src/generated/themes/Slider.css.ts +1 -1
- package/src/generated/themes/Tag.css.ts +1 -1
- package/src/i18n/messagebundle.properties +6 -0
- package/src/i18n/messagebundle_en.properties +2 -0
- package/src/themes/AccordionItem.css +61 -22
- package/src/themes/BreadcrumbsPopover.css +2 -1
- package/src/themes/CountrySelector.css +4 -0
- package/src/themes/Divider.css +2 -1
- package/src/themes/Footer.css +44 -9
- package/src/themes/HeroBanner.css +34 -32
- package/src/themes/PromoTile.css +152 -0
- package/src/themes/Quote.css +21 -24
- package/src/themes/Tag.css +18 -24
- package/src/types/PromoTile.ts +61 -0
- package/src/utils/debounce.ts +19 -4
- package/dist/assets/messagebundle_en-BHfPJk-2.js +0 -1
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var UDExPromoTile_1;
|
|
8
|
+
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
9
|
+
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
10
|
+
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
11
|
+
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
12
|
+
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
13
|
+
import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
|
|
14
|
+
import { isDesktop } from "@ui5/webcomponents-base/dist/Device.js";
|
|
15
|
+
import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
|
|
16
|
+
import PromoTileTemplate from "./PromoTileTemplate.js";
|
|
17
|
+
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
18
|
+
import { PROMO_TILE, PROMO_TILE_ICON } from "./generated/i18n/i18n-defaults.js";
|
|
19
|
+
import { BreakpointUtils } from "./utils/Breakpoints.js";
|
|
20
|
+
import UDExButtonSize from "./types/ButtonSize.js";
|
|
21
|
+
import UDExButtonDesign from "./types/ButtonDesign.js";
|
|
22
|
+
import { UDExPromoTileColorSheme, UDExPromoTileMode } from "./types/PromoTile.js";
|
|
23
|
+
// Styles
|
|
24
|
+
import PromoTileCss from "./generated/themes/PromoTile.css.js";
|
|
25
|
+
export var UDExOrientation;
|
|
26
|
+
(function (UDExOrientation) {
|
|
27
|
+
UDExOrientation["Vertical"] = "Vertical";
|
|
28
|
+
UDExOrientation["Horizontal"] = "Horizontal";
|
|
29
|
+
})(UDExOrientation || (UDExOrientation = {}));
|
|
30
|
+
/**
|
|
31
|
+
* @class
|
|
32
|
+
*
|
|
33
|
+
* <h3 class="comment-api-title">Overview</h3>
|
|
34
|
+
*
|
|
35
|
+
*
|
|
36
|
+
* <h3>Usage</h3>
|
|
37
|
+
*
|
|
38
|
+
* For the <code>udex-promo-tile</code>
|
|
39
|
+
* <h3>ES6 Module Import</h3>
|
|
40
|
+
*
|
|
41
|
+
* <code>import "@sapudex/web-components/dist/PromoTile.js";</code>
|
|
42
|
+
*
|
|
43
|
+
* @constructor
|
|
44
|
+
* @extends UI5Element
|
|
45
|
+
* @tagname udex-promo-tile
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
let UDExPromoTile = UDExPromoTile_1 = class UDExPromoTile extends UI5Element {
|
|
49
|
+
constructor() {
|
|
50
|
+
super();
|
|
51
|
+
/**
|
|
52
|
+
* Defines the orientation of the Promo Tile component.
|
|
53
|
+
*
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @defaultvalue "Vertical"
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
this.orientation = UDExOrientation.Vertical;
|
|
59
|
+
this._colorMode = UDExPromoTileMode.light;
|
|
60
|
+
this._lightModeColors = [1, 2];
|
|
61
|
+
this._darkModeColors = [7, 8, 9, 10];
|
|
62
|
+
this._handleResizeBound = this._handleResize.bind(this);
|
|
63
|
+
}
|
|
64
|
+
onEnterDOM() {
|
|
65
|
+
if (isDesktop()) {
|
|
66
|
+
this.setAttribute("desktop", "");
|
|
67
|
+
}
|
|
68
|
+
ResizeHandler.register(this, this._handleResizeBound);
|
|
69
|
+
}
|
|
70
|
+
onExitDOM() {
|
|
71
|
+
ResizeHandler.deregister(this, this._handleResizeBound);
|
|
72
|
+
}
|
|
73
|
+
onAfterRendering() {
|
|
74
|
+
this._button = this.getButton();
|
|
75
|
+
this.applyColorScheme();
|
|
76
|
+
}
|
|
77
|
+
_handleResize() {
|
|
78
|
+
if (this._button) {
|
|
79
|
+
this._button.size = this.isMobile ? UDExButtonSize.Medium : UDExButtonSize.Large;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
getButton() {
|
|
83
|
+
return this.shadowRoot.querySelector("[udex-button]");
|
|
84
|
+
}
|
|
85
|
+
applyColorScheme() {
|
|
86
|
+
if (!this.colorScheme) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this._colorMode = this.checkColorMode(this.colorScheme);
|
|
90
|
+
const eyebrowColor = this.checkEyebrowColor(this.colorScheme);
|
|
91
|
+
if (this._colorMode === UDExPromoTileMode.dark) {
|
|
92
|
+
if (this._button) {
|
|
93
|
+
this._button.design = this.buttonDesign || UDExButtonDesign.Secondary;
|
|
94
|
+
}
|
|
95
|
+
this.style.setProperty("--udex-promo-tile-icon-fill-color", `var(--udexCoreTextLight)`);
|
|
96
|
+
}
|
|
97
|
+
this.style.setProperty("--udex-promo-tile-background", `var(--udexColor${this.colorScheme})`);
|
|
98
|
+
this.style.setProperty("--udex-promo-tile-eyebrow-color", `var(--udexColor${eyebrowColor})`);
|
|
99
|
+
}
|
|
100
|
+
getColorNumber(colorScheme) {
|
|
101
|
+
const match = colorScheme.match(/\d+/);
|
|
102
|
+
return match ? parseInt(match[0]) : 0;
|
|
103
|
+
}
|
|
104
|
+
checkColorMode(colorScheme) {
|
|
105
|
+
const number = this.getColorNumber(colorScheme);
|
|
106
|
+
if (number && this._darkModeColors.includes(number)) {
|
|
107
|
+
return UDExPromoTileMode.dark;
|
|
108
|
+
}
|
|
109
|
+
return UDExPromoTileMode.light;
|
|
110
|
+
}
|
|
111
|
+
checkEyebrowColor(colorScheme) {
|
|
112
|
+
const number = this.getColorNumber(colorScheme);
|
|
113
|
+
let color = UDExPromoTileColorSheme.Blue8;
|
|
114
|
+
if (number === 7) {
|
|
115
|
+
color = "NeutralWhite";
|
|
116
|
+
}
|
|
117
|
+
else if (this._darkModeColors.includes(number)) {
|
|
118
|
+
color = colorScheme.replace(`${number}`, `${number - 7}`);
|
|
119
|
+
}
|
|
120
|
+
else if (this._lightModeColors.includes(number)) {
|
|
121
|
+
color = colorScheme.replace(`${number}`, `${number + 7}`);
|
|
122
|
+
}
|
|
123
|
+
return color;
|
|
124
|
+
}
|
|
125
|
+
get isMobile() {
|
|
126
|
+
return BreakpointUtils.isAtMost("S");
|
|
127
|
+
}
|
|
128
|
+
get promoTileContainerText() {
|
|
129
|
+
return this.accessibleName || this.header || UDExPromoTile_1.i18nBundle.getText(PROMO_TILE);
|
|
130
|
+
}
|
|
131
|
+
get _showPictogram() {
|
|
132
|
+
return !!this.icon || !!this.logoUrl;
|
|
133
|
+
}
|
|
134
|
+
get _showLogo() {
|
|
135
|
+
return !this.icon && !!this.logoUrl;
|
|
136
|
+
}
|
|
137
|
+
get _imageLabel() {
|
|
138
|
+
return this.imageLabel || UDExPromoTile_1.i18nBundle.getText(PROMO_TILE_ICON);
|
|
139
|
+
}
|
|
140
|
+
handleCTAButtonClick(e) {
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
this.fireDecoratorEvent("button-click");
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
__decorate([
|
|
146
|
+
slot({ type: HTMLElement, "default": true })
|
|
147
|
+
], UDExPromoTile.prototype, "content", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
property({ type: String })
|
|
150
|
+
], UDExPromoTile.prototype, "orientation", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
property({ type: String })
|
|
153
|
+
], UDExPromoTile.prototype, "icon", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
property({ type: String })
|
|
156
|
+
], UDExPromoTile.prototype, "imageLabel", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
property({ type: String })
|
|
159
|
+
], UDExPromoTile.prototype, "logoUrl", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
property({ type: String })
|
|
162
|
+
], UDExPromoTile.prototype, "header", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
property({ type: String })
|
|
165
|
+
], UDExPromoTile.prototype, "eyebrow", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
property({ type: String })
|
|
168
|
+
], UDExPromoTile.prototype, "button", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
property({ type: String })
|
|
171
|
+
], UDExPromoTile.prototype, "buttonDesign", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
property({ type: String })
|
|
174
|
+
], UDExPromoTile.prototype, "colorScheme", void 0);
|
|
175
|
+
__decorate([
|
|
176
|
+
property({ type: String })
|
|
177
|
+
], UDExPromoTile.prototype, "accessibleName", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
i18n("@sapudex/web-components")
|
|
180
|
+
], UDExPromoTile, "i18nBundle", void 0);
|
|
181
|
+
UDExPromoTile = UDExPromoTile_1 = __decorate([
|
|
182
|
+
customElement({
|
|
183
|
+
tag: "udex-promo-tile",
|
|
184
|
+
renderer: jsxRenderer,
|
|
185
|
+
styles: PromoTileCss,
|
|
186
|
+
template: PromoTileTemplate,
|
|
187
|
+
})
|
|
188
|
+
/**
|
|
189
|
+
* Triggered when the user clicks on the CTA button
|
|
190
|
+
*
|
|
191
|
+
* @public
|
|
192
|
+
*/
|
|
193
|
+
,
|
|
194
|
+
event("button-click", { cancelable: true, bubbles: true })
|
|
195
|
+
], UDExPromoTile);
|
|
196
|
+
UDExPromoTile.define();
|
|
197
|
+
export default UDExPromoTile;
|
|
198
|
+
//# sourceMappingURL=PromoTile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromoTile.js","sourceRoot":"","sources":["../src/PromoTile.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAE5E,OAAO,aAAa,MAAM,wDAAwD,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,WAAW,MAAM,iDAAiD,CAAC;AAC1E,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,O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F;AAnH1B,aAAa;IAdlB,aAAa,CAAC;QACb,GAAG,EAAE,iBAAiB;QACtB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,YAAY;QACpB,QAAQ,EAAE,iBAAiB;KAC5B,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,cAAc,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;GAErD,aAAa,CAkOlB;AAED,aAAa,CAAC,MAAM,EAAE,CAAC;AAEvB,eAAe,aAAa,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/renderer/JsxRenderer.js\";\nimport PromoTileTemplate from \"./PromoTileTemplate.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { PROMO_TILE, PROMO_TILE_ICON } from \"./generated/i18n/i18n-defaults.js\";\nimport { BreakpointUtils } from \"./utils/Breakpoints.js\";\nimport type UDExButton from \"./Button.js\";\nimport UDExButtonSize from \"./types/ButtonSize.js\";\nimport UDExButtonDesign from \"./types/ButtonDesign.js\";\nimport { UDExPromoTileColorSheme, UDExPromoTileMode } from \"./types/PromoTile.js\";\n\n// Styles\nimport PromoTileCss from \"./generated/themes/PromoTile.css.js\";\n\nexport enum UDExOrientation {\n Vertical = \"Vertical\",\n Horizontal = \"Horizontal\",\n}\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>udex-promo-tile</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/PromoTile.js\";</code>\n *\n * @constructor\n * @extends UI5Element\n * @tagname udex-promo-tile\n * @public\n */\n@customElement({\n tag: \"udex-promo-tile\",\n renderer: jsxRenderer,\n styles: PromoTileCss,\n template: PromoTileTemplate,\n})\n\n/**\n * Triggered when the user clicks on the CTA button\n *\n * @public\n */\n@event(\"button-click\", { cancelable: true, bubbles: true })\n\nclass UDExPromoTile extends UI5Element {\n eventDetails!: {\n \"button-click\": void,\n };\n\n /**\n * Defines the text content of the Promo Tile.\n *\n * @slot content\n * @public\n */\n @slot({ type: HTMLElement, \"default\": true })\n content!: Array<HTMLElement>;\n\n /**\n * Defines the orientation of the Promo Tile component.\n *\n * @type {string}\n * @defaultvalue \"Vertical\"\n * @public\n */\n @property({ type: String })\n orientation: `${UDExOrientation}` = UDExOrientation.Vertical;\n\n /**\n * Defines the UI5 icon name in the pictogram section.\n *\n * @type {string}\n * @defaultvalue \"\"\n * @public\n */\n @property({ type: String })\n icon?: string;\n\n /**\n * Defines the image aria label and alt in the pictogram section.\n *\n * @type {string}\n * @defaultvalue \"\"\n * @public\n */\n @property({ type: String })\n imageLabel?: string;\n\n /**\n * Defines the logo URL in the pictogram section.\n *\n * @type {string}\n * @defaultvalue \"\"\n * @public\n */\n @property({ type: String })\n logoUrl?: string;\n\n /**\n * Defines the header text of the promo tile.\n *\n * @type {string}\n * @defaultvalue \"\"\n * @public\n */\n @property({ type: String })\n header?: string;\n\n /**\n * Defines the eyebrow text of the promo tile.\n *\n * @type {string}\n * @defaultvalue \"\"\n * @public\n */\n @property({ type: String })\n eyebrow?: string;\n\n /**\n * Defines the CTA button label\n *\n * @type {string}\n * @defaultvalue \"\"\n * @public\n */\n @property({ type: String })\n button?: string;\n\n /**\n * Defines the CTA button design\n *\n * @type {string}\n * @defaultvalue \"\"\n * @public\n */\n @property({ type: String })\n buttonDesign?: UDExButtonDesign;\n\n /**\n * Defines the color scheme of the Promo Tile.\n *\n * @type {string}\n * @defaultvalue \"\"\n * @public\n */\n @property({ type: String })\n colorScheme?: UDExPromoTileColorSheme;\n\n /**\n * Defines the accessible name of the component.\n *\n * @type {string}\n * @defaultvalue \"\"\n * @public\n */\n @property({ type: String })\n accessibleName?: string;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n _handleResizeBound: ResizeObserverCallback;\n _button: UDExButton | undefined;\n _colorMode: UDExPromoTileMode = UDExPromoTileMode.light;\n _lightModeColors: Array<number> = [1, 2];\n _darkModeColors: Array<number> = [7, 8, 9, 10];\n\n constructor() {\n super();\n this._handleResizeBound = this._handleResize.bind(this);\n }\n\n onEnterDOM(): void {\n if (isDesktop()) {\n this.setAttribute(\"desktop\", \"\");\n }\n ResizeHandler.register(this, this._handleResizeBound);\n }\n\n onExitDOM(): void {\n ResizeHandler.deregister(this, this._handleResizeBound);\n }\n\n onAfterRendering() {\n this._button = this.getButton();\n this.applyColorScheme();\n }\n\n _handleResize(): void {\n if (this._button) {\n this._button.size = this.isMobile ? UDExButtonSize.Medium : UDExButtonSize.Large;\n }\n }\n\n getButton(): UDExButton | undefined {\n return this.shadowRoot!.querySelector<UDExButton>(\n \"[udex-button]\",\n )!;\n }\n\n applyColorScheme(): void {\n if (!this.colorScheme) {\n return;\n }\n\n this._colorMode = this.checkColorMode(this.colorScheme);\n const eyebrowColor = this.checkEyebrowColor(this.colorScheme);\n\n if (this._colorMode === UDExPromoTileMode.dark) {\n if (this._button) {\n this._button.design = this.buttonDesign || UDExButtonDesign.Secondary;\n }\n this.style.setProperty(\"--udex-promo-tile-icon-fill-color\", `var(--udexCoreTextLight)`);\n }\n this.style.setProperty(\"--udex-promo-tile-background\", `var(--udexColor${this.colorScheme})`);\n this.style.setProperty(\"--udex-promo-tile-eyebrow-color\", `var(--udexColor${eyebrowColor})`);\n }\n\n getColorNumber(colorScheme: string): number {\n const match = colorScheme.match(/\\d+/);\n return match ? parseInt(match[0]) : 0;\n }\n\n checkColorMode(colorScheme: string): UDExPromoTileMode {\n const number = this.getColorNumber(colorScheme);\n\n if (number && this._darkModeColors.includes(number)) {\n return UDExPromoTileMode.dark;\n }\n return UDExPromoTileMode.light;\n }\n\n checkEyebrowColor(colorScheme: string): string {\n const number = this.getColorNumber(colorScheme);\n let color: string = UDExPromoTileColorSheme.Blue8;\n\n if (number === 7) {\n color = \"NeutralWhite\";\n } else if (this._darkModeColors.includes(number)) {\n color = colorScheme.replace(`${number}`, `${number - 7}`);\n } else if (this._lightModeColors.includes(number)) {\n color = colorScheme.replace(`${number}`, `${number + 7}`);\n }\n return color;\n }\n\n get isMobile(): boolean {\n return BreakpointUtils.isAtMost(\"S\");\n }\n\n get promoTileContainerText(): string {\n return this.accessibleName || this.header || UDExPromoTile.i18nBundle.getText(PROMO_TILE);\n }\n\n get _showPictogram(): boolean {\n return !!this.icon || !!this.logoUrl;\n }\n\n get _showLogo(): boolean {\n return !this.icon && !!this.logoUrl;\n }\n\n get _imageLabel(): string {\n return this.imageLabel || UDExPromoTile.i18nBundle.getText(PROMO_TILE_ICON);\n }\n\n handleCTAButtonClick(e: Event) {\n e.preventDefault();\n this.fireDecoratorEvent(\"button-click\");\n }\n}\n\nUDExPromoTile.define();\n\nexport default UDExPromoTile;\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ui5/webcomponents-base/jsx-runtime";
|
|
2
|
+
import UI5Icon from "@ui5/webcomponents/dist/Icon.js";
|
|
3
|
+
import IconMode from "@ui5/webcomponents/dist/types/IconMode.js";
|
|
4
|
+
import UDExButton from "./Button.js";
|
|
5
|
+
import UDExButtonSize from "./types/ButtonSize.js";
|
|
6
|
+
import UDExButtonAccessibleRole from "./types/ButtonAccessibleRole.js";
|
|
7
|
+
export default function PromoTileTemplate() {
|
|
8
|
+
const rootClass = "udex-promo-tile";
|
|
9
|
+
return (_jsxs("div", { role: "region", class: `${rootClass}__container ${rootClass}--${this.orientation?.toLowerCase()} ${rootClass}--${this._colorMode}`, "aria-label": this.promoTileContainerText, children: [this._showPictogram &&
|
|
10
|
+
_jsxs("div", { part: "image", class: {
|
|
11
|
+
"udex-promo-tile__pictogram": true,
|
|
12
|
+
"udex-promo-tile__pictogram--logo": this.logoUrl
|
|
13
|
+
}, title: this._imageLabel, children: [this.icon &&
|
|
14
|
+
_jsx(UI5Icon, { class: `${rootClass}__icon`, name: this.icon?.toLowerCase(), mode: IconMode.Decorative, accessibleName: this._imageLabel }), this._showLogo &&
|
|
15
|
+
_jsx("img", { src: this.logoUrl, class: `${rootClass}__icon`, "aria-label": this._imageLabel, alt: this._imageLabel })] }), _jsxs("div", { part: "content", class: `${rootClass}__content`, children: [_jsxs("div", { class: `${rootClass}__text`, children: [this.eyebrow &&
|
|
16
|
+
_jsx("div", { class: `${rootClass}__eyebrow eyebrow--l`, children: this.eyebrow }), this.header &&
|
|
17
|
+
_jsx("div", { part: "header", class: `${rootClass}__header`, children: this.header }), _jsx("slot", {})] }), !!this.button && footerSection.call(this, rootClass)] })] }));
|
|
18
|
+
}
|
|
19
|
+
function footerSection(rootClass) {
|
|
20
|
+
return (_jsx(_Fragment, { children: _jsx("div", { part: "footer", class: `${rootClass}__footer`, children: _jsx(UDExButton, { class: `${rootClass}__btn`, size: UDExButtonSize.Large, design: this.buttonDesign, onClick: this.handleCTAButtonClick, accessibleRole: UDExButtonAccessibleRole.Button, children: this.button }) }) }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=PromoTileTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromoTileTemplate.js","sourceRoot":"","sources":["../src/PromoTileTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,OAAO,MAAM,iCAAiC,CAAC;AACt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cAAK,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,GAAG,SAAS,UAAU,YAAG,IAAI,CAAC,MAAM,GAAO,EAEvE,gBAAa,IACT,EACL,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,IACjD,IACF,CACP,CAAC;AACJ,CAAC;AACD,SAAS,aAAa,CAAsB,SAAiB;IAC3D,OAAO,CACL,4BACE,cAAK,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,GAAG,SAAS,UAAU,YAC9C,KAAC,UAAU,IAAC,KAAK,EAAE,GAAG,SAAS,OAAO,EACpC,IAAI,EAAE,cAAc,CAAC,KAAK,EAC1B,MAAM,EAAE,IAAI,CAAC,YAAY,EACzB,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAClC,cAAc,EAAE,wBAAwB,CAAC,MAAM,YAC9C,IAAI,CAAC,MAAM,GACD,GACT,GACL,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import type UDExPromoTile from \"./PromoTile.js\";\nimport UI5Icon from \"@ui5/webcomponents/dist/Icon.js\";\nimport IconMode from \"@ui5/webcomponents/dist/types/IconMode.js\";\nimport UDExButton from \"./Button.js\";\nimport UDExButtonSize from \"./types/ButtonSize.js\";\nimport UDExButtonAccessibleRole from \"./types/ButtonAccessibleRole.js\";\n\nexport default function PromoTileTemplate(this: UDExPromoTile) {\n const rootClass = \"udex-promo-tile\";\n\n return (\n <div\n role=\"region\"\n class={`${rootClass}__container ${rootClass}--${this.orientation?.toLowerCase()} ${rootClass}--${this._colorMode}`}\n aria-label={this.promoTileContainerText}>\n {this._showPictogram &&\n <div\n part=\"image\"\n class={{\n \"udex-promo-tile__pictogram\": true,\n \"udex-promo-tile__pictogram--logo\": this.logoUrl\n }}\n title={this._imageLabel}>\n {this.icon &&\n <UI5Icon\n class={`${rootClass}__icon`}\n name={this.icon?.toLowerCase()}\n mode={IconMode.Decorative}\n accessibleName={this._imageLabel}>\n </UI5Icon>}\n {this._showLogo &&\n <img\n src={this.logoUrl}\n class={`${rootClass}__icon`}\n aria-label={this._imageLabel}\n alt={this._imageLabel} />}\n </div>\n }\n <div part=\"content\" class={`${rootClass}__content`}>\n <div class={`${rootClass}__text`}>\n {this.eyebrow &&\n <div class={`${rootClass}__eyebrow eyebrow--l`}>{this.eyebrow}</div>\n }\n {this.header &&\n <div part=\"header\" class={`${rootClass}__header`}>{this.header}</div>\n }\n <slot></slot>\n </div>\n {!!this.button && footerSection.call(this, rootClass)}\n </div>\n </div>\n );\n}\nfunction footerSection(this: UDExPromoTile, rootClass: string) {\n return (\n <>\n <div part=\"footer\" class={`${rootClass}__footer`}>\n <UDExButton class={`${rootClass}__btn`}\n size={UDExButtonSize.Large}\n design={this.buttonDesign}\n onClick={this.handleCTAButtonClick}\n accessibleRole={UDExButtonAccessibleRole.Button}>\n {this.button}\n </UDExButton>\n </div>\n </>\n );\n}\n"]}
|
package/dist/Quote.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ export declare enum UDExMaskType {
|
|
|
7
7
|
avatar = "avatar",
|
|
8
8
|
rectangle = "rectangle"
|
|
9
9
|
}
|
|
10
|
+
export declare enum UDExImagePlacement {
|
|
11
|
+
left = "left",
|
|
12
|
+
right = "right"
|
|
13
|
+
}
|
|
10
14
|
/**
|
|
11
15
|
* @class
|
|
12
16
|
*
|
|
@@ -69,5 +73,12 @@ declare class UDExQuote extends UI5Element {
|
|
|
69
73
|
* @default "avatar"
|
|
70
74
|
*/
|
|
71
75
|
mask: `${UDExMaskType}`;
|
|
76
|
+
/**
|
|
77
|
+
* Defines image placement
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
* @default "left"
|
|
81
|
+
*/
|
|
82
|
+
imagePlacement: `${UDExImagePlacement}`;
|
|
72
83
|
}
|
|
73
84
|
export default UDExQuote;
|
package/dist/Quote.js
CHANGED
|
@@ -23,6 +23,11 @@ export var UDExMaskType;
|
|
|
23
23
|
UDExMaskType["avatar"] = "avatar";
|
|
24
24
|
UDExMaskType["rectangle"] = "rectangle";
|
|
25
25
|
})(UDExMaskType || (UDExMaskType = {}));
|
|
26
|
+
export var UDExImagePlacement;
|
|
27
|
+
(function (UDExImagePlacement) {
|
|
28
|
+
UDExImagePlacement["left"] = "left";
|
|
29
|
+
UDExImagePlacement["right"] = "right";
|
|
30
|
+
})(UDExImagePlacement || (UDExImagePlacement = {}));
|
|
26
31
|
/**
|
|
27
32
|
* @class
|
|
28
33
|
*
|
|
@@ -44,21 +49,28 @@ let UDExQuote = class UDExQuote extends UI5Element {
|
|
|
44
49
|
* @public
|
|
45
50
|
* @default "large"
|
|
46
51
|
*/
|
|
47
|
-
this.imageSize =
|
|
52
|
+
this.imageSize = UDExSizeType.large;
|
|
48
53
|
/**
|
|
49
54
|
* Defines text size
|
|
50
55
|
*
|
|
51
56
|
* @public
|
|
52
57
|
* @default "large"
|
|
53
58
|
*/
|
|
54
|
-
this.textSize =
|
|
59
|
+
this.textSize = UDExSizeType.large;
|
|
55
60
|
/**
|
|
56
61
|
* Defines image mask
|
|
57
62
|
*
|
|
58
63
|
* @public
|
|
59
64
|
* @default "avatar"
|
|
60
65
|
*/
|
|
61
|
-
this.mask =
|
|
66
|
+
this.mask = UDExMaskType.avatar;
|
|
67
|
+
/**
|
|
68
|
+
* Defines image placement
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
* @default "left"
|
|
72
|
+
*/
|
|
73
|
+
this.imagePlacement = UDExImagePlacement.left;
|
|
62
74
|
}
|
|
63
75
|
};
|
|
64
76
|
__decorate([
|
|
@@ -82,6 +94,9 @@ __decorate([
|
|
|
82
94
|
__decorate([
|
|
83
95
|
property()
|
|
84
96
|
], UDExQuote.prototype, "mask", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
property()
|
|
99
|
+
], UDExQuote.prototype, "imagePlacement", void 0);
|
|
85
100
|
UDExQuote = __decorate([
|
|
86
101
|
customElement({
|
|
87
102
|
tag: "udex-quote",
|
package/dist/Quote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Quote.js","sourceRoot":"","sources":["../src/Quote.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAE7E,WAAW;AACX,OAAO,aAAa,MAAM,4CAA4C,CAAC;AAEvE,SAAS;AACT,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AAEvD,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,+BAAe,CAAA;AACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,uCAAuB,CAAA;AACzB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED;;;;;;;;;;;GAWG;AAOH,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAqCE;;;;;UAKE;QAEA,cAAS,GAAsB,
|
|
1
|
+
{"version":3,"file":"Quote.js","sourceRoot":"","sources":["../src/Quote.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAE7E,WAAW;AACX,OAAO,aAAa,MAAM,4CAA4C,CAAC;AAEvE,SAAS;AACT,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AAEvD,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;I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AAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\n\n// Template\nimport QuoteTemplate from \"./generated/templates/QuoteTemplate.lit.js\";\n\n// Styles\nimport QuoteCss from \"./generated/themes/Quote.css.js\";\n\nexport enum UDExSizeType {\n small = \"small\",\n large = \"large\"\n}\n\nexport enum UDExMaskType {\n avatar = \"avatar\",\n rectangle = \"rectangle\"\n}\n\nexport enum UDExImagePlacement {\n left = \"left\",\n right = \"right\"\n}\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * The <code>udex-quote</code> component is a demo component that displays some text.\n *\n * @constructor\n * @extends UI5Element\n * @tagname udex-quote\n * @public\n */\n@customElement({\n tag: \"udex-quote\",\n renderer: litRender,\n styles: QuoteCss,\n template: QuoteTemplate,\n})\nclass UDExQuote extends UI5Element {\n /**\n * Defines the text content of the Quote.\n *\n * @slot content\n * @public\n */\n @slot({ type: HTMLElement, \"default\": true })\n content!: Array<HTMLElement>;\n\n /**\n * Defines the link in the Quote\n *\n * @slot\n * @public\n */\n @slot()\n link!: Array<HTMLElement>;\n\n /**\n * Defines author's name and company\n *\n * @public\n * @slot\n */\n @slot()\n author!: Array<HTMLElement>;\n\n /**\n * Defines image near quote text\n *\n * @public\n * @slot\n */\n @slot()\n image!: Array<HTMLElement>;\n\n /**\n * Defines image (Avatar or company logo) size\n *\n * @public\n * @default \"large\"\n */\n @property()\n imageSize: `${UDExSizeType}` = UDExSizeType.large;\n\n /**\n * Defines text size\n *\n * @public\n * @default \"large\"\n */\n @property()\n textSize: `${UDExSizeType}` = UDExSizeType.large;\n\n /**\n * Defines image mask\n *\n * @public\n * @default \"avatar\"\n */\n @property()\n mask: `${UDExMaskType}` = UDExMaskType.avatar;\n\n /**\n * Defines image placement\n *\n * @public\n * @default \"left\"\n */\n @property()\n imagePlacement: `${UDExImagePlacement}` = UDExImagePlacement.left;\n}\n\nUDExQuote.define();\n\nexport default UDExQuote;\n"]}
|
package/dist/Search.d.ts
CHANGED
|
@@ -395,7 +395,9 @@ declare class UDExSearch extends UI5Element {
|
|
|
395
395
|
handleOutsideClick(): void;
|
|
396
396
|
handleBlur(): void;
|
|
397
397
|
handleSearchChange(e: InputEvent): void;
|
|
398
|
-
handleDebounce: (
|
|
398
|
+
handleDebounce: (() => void) & {
|
|
399
|
+
cancel: () => void;
|
|
400
|
+
};
|
|
399
401
|
handleKeyDown: (e: KeyboardEvent) => void;
|
|
400
402
|
handleEnterKey(e: KeyboardEvent): void;
|
|
401
403
|
handleTabKey(e: KeyboardEvent): void;
|
package/dist/Search.js
CHANGED
|
@@ -408,6 +408,7 @@ let UDExSearch = UDExSearch_1 = class UDExSearch extends UI5Element {
|
|
|
408
408
|
this.handleSubmitValue();
|
|
409
409
|
}
|
|
410
410
|
handleSubmitValue() {
|
|
411
|
+
this.handleDebounce.cancel();
|
|
411
412
|
this.onClosePopover();
|
|
412
413
|
this.fireDecoratorEvent("submit-search-value", { value: this.value });
|
|
413
414
|
}
|