@sapudex/web-components 2.20.0 → 2.21.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 +2 -0
- package/cypress/specs/Feed.cy.tsx +72 -0
- package/cypress/specs/FeedItem.cy.tsx +82 -0
- package/cypress/specs/Footer.cy.tsx +45 -1
- package/cypress/support/component-imports.instrumented.ts +4 -0
- package/cypress/support/component-imports.src.ts +4 -0
- package/dist/AssetsVariables.js +4 -0
- package/dist/AssetsVariables.js.map +1 -1
- package/dist/Carousel.d.ts +29 -2
- package/dist/Carousel.js +34 -6
- package/dist/Carousel.js.map +1 -1
- package/dist/CarouselTemplate.js +2 -2
- package/dist/CarouselTemplate.js.map +1 -1
- package/dist/DatePicker.d.ts +4 -4
- package/dist/DatePicker.js +3 -10
- package/dist/DatePicker.js.map +1 -1
- package/dist/DatePickerPopoverTemplate.d.ts +2 -0
- package/dist/DatePickerPopoverTemplate.js +13 -0
- package/dist/DatePickerPopoverTemplate.js.map +1 -0
- package/dist/DatePickerTemplate.d.ts +2 -0
- package/dist/DatePickerTemplate.js +7 -0
- package/dist/DatePickerTemplate.js.map +1 -0
- package/dist/Feed.d.ts +88 -0
- package/dist/Feed.js +103 -0
- package/dist/Feed.js.map +1 -0
- package/dist/FeedItem.d.ts +114 -0
- package/dist/FeedItem.js +131 -0
- package/dist/FeedItem.js.map +1 -0
- package/dist/FeedItemTemplate.d.ts +2 -0
- package/dist/FeedItemTemplate.js +16 -0
- package/dist/FeedItemTemplate.js.map +1 -0
- package/dist/FeedTemplate.d.ts +2 -0
- package/dist/FeedTemplate.js +19 -0
- package/dist/FeedTemplate.js.map +1 -0
- package/dist/Footer.d.ts +14 -2
- package/dist/Footer.js +10 -4
- package/dist/Footer.js.map +1 -1
- package/dist/FooterTemplate.js +3 -3
- package/dist/FooterTemplate.js.map +1 -1
- package/dist/MediaPlayerTemplate.js +2 -2
- package/dist/MediaPlayerTemplate.js.map +1 -1
- package/dist/MessageStripTemplate.js +3 -1
- package/dist/MessageStripTemplate.js.map +1 -1
- package/dist/RatingBarTemplate.js +1 -1
- package/dist/RatingBarTemplate.js.map +1 -1
- package/dist/Review.js +3 -6
- package/dist/Review.js.map +1 -1
- package/dist/ReviewItem.d.ts +1 -1
- package/dist/ReviewItem.js +15 -18
- package/dist/ReviewItem.js.map +1 -1
- package/dist/ReviewItemTemplate.d.ts +2 -0
- package/dist/ReviewItemTemplate.js +10 -0
- package/dist/ReviewItemTemplate.js.map +1 -0
- package/dist/ReviewTemplate.d.ts +2 -0
- package/dist/ReviewTemplate.js +9 -0
- package/dist/ReviewTemplate.js.map +1 -0
- package/dist/TileTemplate.js +1 -1
- package/dist/TileTemplate.js.map +1 -1
- package/dist/assets/{InputSuggestions-DOj9B3SE.js → InputSuggestions-B0P5JAFd.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-C6q5EhEr.js → ListItemStandardExpandableTextTemplate-CFj3_UAT.js} +1 -1
- package/dist/assets/{bundle.esm-CmHUshBw.js → bundle.esm-BaPBMfCT.js} +211 -205
- package/dist/assets/messagebundle_en-D_yCmNrd.js +1 -0
- package/dist/css/themes/Feed.css +1 -0
- package/dist/css/themes/FeedItem.css +1 -0
- package/dist/css/themes/Footer.css +1 -1
- package/dist/css/themes/MediaPlayer.css +1 -1
- package/dist/css/themes/RatingIndicator.css +1 -1
- package/dist/css/themes/Slider.css +1 -1
- package/dist/custom-elements-internal.json +533 -0
- package/dist/custom-elements.json +507 -0
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +2 -1
- package/dist/generated/i18n/i18n-defaults.js +2 -1
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/themes/Feed.css.d.ts +2 -0
- package/dist/generated/themes/Feed.css.js +8 -0
- package/dist/generated/themes/Feed.css.js.map +1 -0
- package/dist/generated/themes/FeedItem.css.d.ts +2 -0
- package/dist/generated/themes/FeedItem.css.js +8 -0
- package/dist/generated/themes/FeedItem.css.js.map +1 -0
- 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/MediaPlayer.css.d.ts +1 -1
- package/dist/generated/themes/MediaPlayer.css.js +1 -1
- package/dist/generated/themes/MediaPlayer.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/messagebundle.properties +3 -0
- package/dist/messagebundle_en.properties +1 -0
- package/dist/vscode.html-custom-data.json +114 -0
- package/dist/web-types.json +255 -1
- package/package.json +1 -1
- package/src/AssetsVariables.ts +4 -0
- package/src/Carousel.ts +36 -6
- package/src/CarouselTemplate.tsx +4 -0
- package/src/DatePicker.ts +7 -11
- package/src/DatePickerPopoverTemplate.tsx +35 -0
- package/src/DatePickerTemplate.tsx +27 -0
- package/src/Feed.ts +144 -0
- package/src/FeedItem.ts +198 -0
- package/src/FeedItemTemplate.tsx +60 -0
- package/src/FeedTemplate.tsx +66 -0
- package/src/Footer.ts +20 -4
- package/src/FooterTemplate.tsx +29 -39
- package/src/MediaPlayerTemplate.tsx +20 -19
- package/src/MessageStripTemplate.tsx +4 -2
- package/src/RatingBarTemplate.tsx +1 -0
- package/src/Review.ts +3 -6
- package/src/ReviewItem.ts +15 -19
- package/src/ReviewItemTemplate.tsx +49 -0
- package/src/ReviewTemplate.tsx +69 -0
- package/src/TileTemplate.tsx +1 -0
- package/src/generated/i18n/i18n-defaults.ts +2 -2
- package/src/generated/themes/Feed.css.ts +9 -0
- package/src/generated/themes/FeedItem.css.ts +9 -0
- package/src/generated/themes/Footer.css.ts +1 -1
- package/src/generated/themes/MediaPlayer.css.ts +1 -1
- package/src/generated/themes/RatingIndicator.css.ts +1 -1
- package/src/generated/themes/Slider.css.ts +1 -1
- package/src/i18n/messagebundle.properties +3 -0
- package/src/i18n/messagebundle_en.properties +1 -0
- package/src/themes/Feed.css +51 -0
- package/src/themes/FeedItem.css +60 -0
- package/src/themes/Footer.css +9 -5
- package/src/themes/MediaPlayer.css +1 -1
- package/dist/assets/messagebundle_en-BhTYnZbC.js +0 -1
- package/dist/generated/templates/DatePickerPopoverTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/DatePickerPopoverTemplate.lit.js +0 -10
- package/dist/generated/templates/DatePickerPopoverTemplate.lit.js.map +0 -1
- package/dist/generated/templates/DatePickerTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/DatePickerTemplate.lit.js +0 -10
- package/dist/generated/templates/DatePickerTemplate.lit.js.map +0 -1
- package/dist/generated/templates/ReviewItemTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/ReviewItemTemplate.lit.js +0 -10
- package/dist/generated/templates/ReviewItemTemplate.lit.js.map +0 -1
- package/dist/generated/templates/ReviewTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/ReviewTemplate.lit.js +0 -12
- package/dist/generated/templates/ReviewTemplate.lit.js.map +0 -1
- package/src/DatePicker.hbs +0 -19
- package/src/DatePickerPopover.hbs +0 -24
- package/src/Review.hbs +0 -44
- package/src/ReviewItem.hbs +0 -20
- package/src/generated/templates/DatePickerPopoverTemplate.lit.ts +0 -14
- package/src/generated/templates/DatePickerTemplate.lit.ts +0 -14
- package/src/generated/templates/ReviewItemTemplate.lit.ts +0 -14
- package/src/generated/templates/ReviewTemplate.lit.ts +0 -16
package/src/DatePicker.ts
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import DateComponentBase from "@ui5/webcomponents/dist/DateComponentBase.js";
|
|
2
|
-
import
|
|
2
|
+
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
|
3
3
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
4
4
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
5
5
|
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
6
|
-
|
|
7
|
-
import Calendar, { CalendarSelectionChangeEventDetail } from "@ui5/webcomponents/dist/Calendar.js";
|
|
8
|
-
import CalendarDate from "@ui5/webcomponents/dist/CalendarDate.js";
|
|
6
|
+
import type { CalendarSelectionChangeEventDetail } from "@ui5/webcomponents/dist/Calendar.js";
|
|
9
7
|
import "@ui5/webcomponents/dist/Icon.js";
|
|
10
8
|
import "@ui5/webcomponents-icons/dist/appointment-2.js";
|
|
11
9
|
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
12
10
|
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
13
11
|
import { CALENDAR_ICON, DATEPICKER_DATE_DESCRIPTION } from "./generated/i18n/i18n-defaults.js";
|
|
14
|
-
import UDExTextField from "./TextField.js";
|
|
15
|
-
import UDExDropdown from "./Dropdown.js";
|
|
16
|
-
import UDExStatusMessage from "./StatusMessage.js";
|
|
12
|
+
import type UDExTextField from "./TextField.js";
|
|
13
|
+
import type UDExDropdown from "./Dropdown.js";
|
|
17
14
|
import UDExValueState from "./types/common.js";
|
|
18
15
|
|
|
19
16
|
// Template
|
|
20
|
-
import DatePickerTemplate from "./
|
|
17
|
+
import DatePickerTemplate from "./DatePickerTemplate.js";
|
|
21
18
|
|
|
22
19
|
// Styles
|
|
23
20
|
import DatePickerCss from "./generated/themes/DatePicker.css.js";
|
|
@@ -60,10 +57,9 @@ type UDExDatePickerValueStateChangeEventDetail = {
|
|
|
60
57
|
*/
|
|
61
58
|
@customElement({
|
|
62
59
|
tag: "udex-date-picker",
|
|
63
|
-
renderer:
|
|
60
|
+
renderer: jsxRenderer,
|
|
64
61
|
styles: [DatePickerCss, DatePickerPopoverCss],
|
|
65
62
|
template: DatePickerTemplate,
|
|
66
|
-
dependencies: [CalendarDate, Calendar, UDExTextField, UDExDropdown, UDExStatusMessage],
|
|
67
63
|
})
|
|
68
64
|
/**
|
|
69
65
|
* Fired when the selected dates change.
|
|
@@ -506,7 +502,7 @@ class UDExDatePicker extends DateComponentBase {
|
|
|
506
502
|
this._updateValueAndFireDecoratorEvents((e.target as UDExDatePicker).value, true);
|
|
507
503
|
}
|
|
508
504
|
|
|
509
|
-
handleInputClick(e:
|
|
505
|
+
handleInputClick(e: CustomEvent<void>): void {
|
|
510
506
|
e.preventDefault();
|
|
511
507
|
|
|
512
508
|
if (this.disabled || this.readonly) {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Calendar from "@ui5/webcomponents/dist/Calendar.js";
|
|
2
|
+
import type DatePicker from "./DatePicker.js";
|
|
3
|
+
import UDExDropdown from "./Dropdown.js";
|
|
4
|
+
import { Placement } from "./types/Dropdown.js";
|
|
5
|
+
import CalendarDate from "@ui5/webcomponents/dist/CalendarDate.js";
|
|
6
|
+
import CalendarDateRange from "@ui5/webcomponents/dist/CalendarDateRange.js";
|
|
7
|
+
|
|
8
|
+
export default function DatePickerPopoverTemplate(this: DatePicker) {
|
|
9
|
+
return (
|
|
10
|
+
<UDExDropdown
|
|
11
|
+
id={`udex-${this._id}-calendar__popover`}
|
|
12
|
+
opener={`udex-${this._id}-calendar__opener`}
|
|
13
|
+
class="udex-date-picker__popover"
|
|
14
|
+
placement={Placement.Bottom}
|
|
15
|
+
horizontal-align="Start"
|
|
16
|
+
onClose={this._afterDropdownClose}
|
|
17
|
+
onOpen={this._afterDropdownOpen}>
|
|
18
|
+
<Calendar
|
|
19
|
+
class="udex-date-picker__calendar"
|
|
20
|
+
onSelectionChange={this.handleCalendarChange}
|
|
21
|
+
selection-mode={this.selectionMode}
|
|
22
|
+
min-date={this.minDate}
|
|
23
|
+
max-date={this.maxDate}
|
|
24
|
+
format-pattern={this.formatPattern}>
|
|
25
|
+
{ this.isRangeMode ?
|
|
26
|
+
<CalendarDateRange start-value={this.startValue} end-value={this.endValue}></CalendarDateRange>
|
|
27
|
+
:
|
|
28
|
+
this._calendarSelectedDates.map(date =>
|
|
29
|
+
<CalendarDate value={date}></CalendarDate>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
</Calendar>
|
|
33
|
+
</UDExDropdown>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type DatePicker from "./DatePicker.js";
|
|
2
|
+
import DatePickerPopoverTemplate from "./DatePickerPopoverTemplate.js";
|
|
3
|
+
import UDExTextField from "./TextField.js";
|
|
4
|
+
|
|
5
|
+
export default function DatePickerTemplate(this: DatePicker) {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<UDExTextField
|
|
9
|
+
class="udex-date-picker__input"
|
|
10
|
+
_aria-has-popup="grid"
|
|
11
|
+
icon="appointment-2"
|
|
12
|
+
value={this.value}
|
|
13
|
+
label={this.label}
|
|
14
|
+
accessible-name={this.dateAccessibleName}
|
|
15
|
+
accessible-name-ref={this.accessibleNameRef}
|
|
16
|
+
accessible-icon-name={this.accessibleIconName}
|
|
17
|
+
{...(this.disabled ? { "disabled": true } : {})}
|
|
18
|
+
{...(this.required ? { "required": true } : {})}
|
|
19
|
+
{...(this.readonly ? { "readonly": true } : {})}
|
|
20
|
+
onClickIcon={this.handleInputClick}
|
|
21
|
+
onChange={this._onInputChange}
|
|
22
|
+
value-state={this.valueState}
|
|
23
|
+
supporting-text={this.supportingText} />
|
|
24
|
+
{DatePickerPopoverTemplate.call(this)}
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
}
|
package/src/Feed.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
|
+
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
3
|
+
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
4
|
+
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
5
|
+
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
6
|
+
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
|
7
|
+
import UDExButtonDesign from "./types/ButtonDesign.js";
|
|
8
|
+
import FeedItem from "./FeedItem.js";
|
|
9
|
+
import type UDExFeedItem from "./FeedItem.js";
|
|
10
|
+
import FeedTemplate from "./FeedTemplate.js";
|
|
11
|
+
|
|
12
|
+
// Styles
|
|
13
|
+
import FeedCss from "./generated/themes/Feed.css.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @class
|
|
17
|
+
*
|
|
18
|
+
* <h3 class="comment-api-title">Overview</h3>
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
* <h3>Usage</h3>
|
|
22
|
+
*
|
|
23
|
+
* For the <code>udex-feed</code>
|
|
24
|
+
* <h3>ES6 Module Import</h3>
|
|
25
|
+
*
|
|
26
|
+
* <code>import "@sapudex/web-components/dist/Feed.js";</code>
|
|
27
|
+
*
|
|
28
|
+
*
|
|
29
|
+
* @constructor
|
|
30
|
+
* @extends UI5Element
|
|
31
|
+
* @tagname udex-feed
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
@customElement({
|
|
35
|
+
tag: "udex-feed",
|
|
36
|
+
renderer: jsxRenderer,
|
|
37
|
+
styles: FeedCss,
|
|
38
|
+
template: FeedTemplate,
|
|
39
|
+
dependencies: [FeedItem],
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Triggered when the user clicks on the CTA button
|
|
44
|
+
*
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
@event("button-click", { cancelable: true, bubbles: true })
|
|
48
|
+
|
|
49
|
+
class UDExFeed extends UI5Element {
|
|
50
|
+
eventDetails!: {
|
|
51
|
+
"button-click": void
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Slot for feed items.
|
|
55
|
+
*
|
|
56
|
+
* @slot items
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
@slot({ type: HTMLElement, individualSlots: true })
|
|
60
|
+
items!: Array<UDExFeedItem>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Defines the UI5 icon name in the pictogram section.
|
|
64
|
+
*
|
|
65
|
+
* @default ""
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
@property({ type: String })
|
|
69
|
+
icon?: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Defines the image URL in the pictogram section.
|
|
73
|
+
*
|
|
74
|
+
* @default ""
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
@property({ type: String })
|
|
78
|
+
imageUrl?: string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Defines the image aria label and alt in the pictogram section.
|
|
82
|
+
*
|
|
83
|
+
* @default ""
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
@property({ type: String })
|
|
87
|
+
imageLabel?: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Defines the header text of the component.
|
|
91
|
+
*
|
|
92
|
+
* @default ""
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
@property({ type: String })
|
|
96
|
+
header?: string;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Defines the CTA button label
|
|
100
|
+
*
|
|
101
|
+
* @default ""
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
@property({ type: String })
|
|
105
|
+
button?: string;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Defines the CTA button design
|
|
109
|
+
*
|
|
110
|
+
* @default "UDExButtonDesign.Secondary"
|
|
111
|
+
* @public
|
|
112
|
+
*/
|
|
113
|
+
@property()
|
|
114
|
+
buttonDesign: UDExButtonDesign = UDExButtonDesign.Secondary;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Defines the accessible ARIA name of the component.
|
|
118
|
+
*
|
|
119
|
+
* @default undefined
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
122
|
+
@property()
|
|
123
|
+
accessibleName?: string;
|
|
124
|
+
|
|
125
|
+
get _showPictogram(): boolean {
|
|
126
|
+
return !!this.icon || !!this.imageUrl;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
get _showImage(): boolean {
|
|
130
|
+
return !this.icon && !!this.imageUrl;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
get _imageLabel(): string {
|
|
134
|
+
return this.imageLabel || "";
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
handleCTAButtonClick() {
|
|
138
|
+
this.fireDecoratorEvent("button-click");
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
UDExFeed.define();
|
|
143
|
+
|
|
144
|
+
export default UDExFeed;
|
package/src/FeedItem.ts
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
|
+
import { UDExTarget } from "./types/common.js";
|
|
3
|
+
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
4
|
+
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
5
|
+
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
6
|
+
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
7
|
+
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
8
|
+
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
9
|
+
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
|
10
|
+
import FeedItemTemplate from "./FeedItemTemplate.js";
|
|
11
|
+
import { LOCATION } from "./generated/i18n/i18n-defaults.js";
|
|
12
|
+
|
|
13
|
+
// Styles
|
|
14
|
+
import FeedItemCss from "./generated/themes/FeedItem.css.js";
|
|
15
|
+
|
|
16
|
+
type UDExFeedItemClickEventDetail = {
|
|
17
|
+
originalEvent: Event,
|
|
18
|
+
item: UDExFeedItem,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type FeedDate = {
|
|
22
|
+
day: string;
|
|
23
|
+
month: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @class
|
|
28
|
+
*
|
|
29
|
+
* <h3 class="comment-api-title">Overview</h3>
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* <h3>Usage</h3>
|
|
33
|
+
*
|
|
34
|
+
* For the <code>udex-feed-item</code>
|
|
35
|
+
* <h3>ES6 Module Import</h3>
|
|
36
|
+
*
|
|
37
|
+
* <code>import "@sapudex/web-components/dist/FeedItem.js";</code>
|
|
38
|
+
*
|
|
39
|
+
* @constructor
|
|
40
|
+
* @extends UI5Element
|
|
41
|
+
* @tagname udex-feed-item
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
@customElement({
|
|
45
|
+
tag: "udex-feed-item",
|
|
46
|
+
renderer: jsxRenderer,
|
|
47
|
+
styles: FeedItemCss,
|
|
48
|
+
template: FeedItemTemplate,
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Fires when item is clicked
|
|
53
|
+
*
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
@event("item-click", { bubbles: true, cancelable: true })
|
|
57
|
+
|
|
58
|
+
class UDExFeedItem extends UI5Element {
|
|
59
|
+
eventDetails!: {
|
|
60
|
+
"item-click": UDExFeedItemClickEventDetail,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Defines the link text
|
|
65
|
+
*
|
|
66
|
+
* @default undefined
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
@property({ type: String })
|
|
70
|
+
text?: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Defines the link text URL
|
|
74
|
+
*
|
|
75
|
+
* @default ""
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
@property({ type: String })
|
|
79
|
+
href!: string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Defines target for the link
|
|
83
|
+
*
|
|
84
|
+
* @default UDExTarget._self
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
87
|
+
@property()
|
|
88
|
+
target: UDExTarget = UDExTarget._self;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Defines the link text details
|
|
92
|
+
*
|
|
93
|
+
* @default undefined
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
@property({ type: String })
|
|
97
|
+
details?: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Defines the accessible ARIA name of the link.
|
|
101
|
+
*
|
|
102
|
+
* @default undefined
|
|
103
|
+
* @public
|
|
104
|
+
*/
|
|
105
|
+
@property()
|
|
106
|
+
accessibleName?: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Defines the date of the event
|
|
110
|
+
*
|
|
111
|
+
* @default undefined
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
@property({ type: String })
|
|
115
|
+
date?: string;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Defines the location of the event
|
|
119
|
+
*
|
|
120
|
+
* @default undefined
|
|
121
|
+
* @public
|
|
122
|
+
*/
|
|
123
|
+
@property({ type: String })
|
|
124
|
+
location?: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Defines the UI5 icon name
|
|
128
|
+
*
|
|
129
|
+
* @default undefined
|
|
130
|
+
* @public
|
|
131
|
+
*/
|
|
132
|
+
@property({ type: String })
|
|
133
|
+
icon?: string;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Defines the UI5 icon label
|
|
137
|
+
*
|
|
138
|
+
* @default undefined
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
@property({ type: String })
|
|
142
|
+
iconAccessibleName?: string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Receives the avatar
|
|
146
|
+
*
|
|
147
|
+
* @slot avatar
|
|
148
|
+
* @public
|
|
149
|
+
*/
|
|
150
|
+
@slot({ type: HTMLElement })
|
|
151
|
+
avatar!: Array<HTMLElement>;
|
|
152
|
+
|
|
153
|
+
@i18n("@sapudex/web-components")
|
|
154
|
+
static i18nBundle: I18nBundle;
|
|
155
|
+
|
|
156
|
+
get _date(): FeedDate {
|
|
157
|
+
return this.formatDate(this.date);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
get _showAvatar(): boolean {
|
|
161
|
+
return !!this.avatar.length;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
get _showIcon(): boolean {
|
|
165
|
+
return !!this.icon && !this._showAvatar;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
get _showDate(): boolean {
|
|
169
|
+
return !!this.date && !this._showAvatar && !this._showIcon;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
get locationIconLabel(): string {
|
|
173
|
+
return UDExFeedItem.i18nBundle.getText(LOCATION);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
formatDate(d: string | undefined): FeedDate {
|
|
177
|
+
if (!d) {
|
|
178
|
+
return { day: "", month: "" };
|
|
179
|
+
}
|
|
180
|
+
const date = new Date(d);
|
|
181
|
+
const day = date.toLocaleString("default", { day: "2-digit" });
|
|
182
|
+
let month = date.toLocaleString("default", { month: "short" });
|
|
183
|
+
month = month.charAt(0).toUpperCase() + month.slice(1);
|
|
184
|
+
return { day, month };
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
handleLinkClick(e: Event): void {
|
|
188
|
+
this.fireDecoratorEvent("item-click", {
|
|
189
|
+
item: this,
|
|
190
|
+
originalEvent: e,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
UDExFeedItem.define();
|
|
196
|
+
|
|
197
|
+
export default UDExFeedItem;
|
|
198
|
+
export type { UDExFeedItemClickEventDetail };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type FeedItem from "./FeedItem.js";
|
|
2
|
+
import UI5Icon from "@ui5/webcomponents/dist/Icon.js";
|
|
3
|
+
import IconMode from "@ui5/webcomponents/dist/types/IconMode.js";
|
|
4
|
+
import IconDesign from "@ui5/webcomponents/dist/types/IconDesign.js";
|
|
5
|
+
import UDExLink from "./Link.js";
|
|
6
|
+
|
|
7
|
+
export default function FeedItemTemplate(this: FeedItem) {
|
|
8
|
+
const rootClass = "udex-feed-item";
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<div class={rootClass}>
|
|
12
|
+
{this._showAvatar &&
|
|
13
|
+
<slot name="avatar" slot="avatar" aria-hidden="true"></slot>
|
|
14
|
+
}
|
|
15
|
+
{this._showIcon &&
|
|
16
|
+
<UI5Icon
|
|
17
|
+
class={`${rootClass}__icon`}
|
|
18
|
+
name={this.icon?.toLowerCase()}
|
|
19
|
+
mode={IconMode.Decorative}
|
|
20
|
+
accessibleName={this.iconAccessibleName}>
|
|
21
|
+
</UI5Icon>
|
|
22
|
+
}
|
|
23
|
+
{this._showDate &&
|
|
24
|
+
<div class={`${rootClass}__date`}
|
|
25
|
+
aria-label={this.date}>
|
|
26
|
+
<span class={`${rootClass}__month`}>{this._date.month}</span>
|
|
27
|
+
<span class={`${rootClass}__day`}>{this._date.day}</span>
|
|
28
|
+
</div>
|
|
29
|
+
}
|
|
30
|
+
{(this.text || this.details || this.location) &&
|
|
31
|
+
<div class={`${rootClass}__content`}>
|
|
32
|
+
<UDExLink
|
|
33
|
+
class={`${rootClass}__link`}
|
|
34
|
+
accessibleName={this.accessibleName}
|
|
35
|
+
href={this.href}
|
|
36
|
+
target={this.target}
|
|
37
|
+
onClick={this.handleLinkClick}>
|
|
38
|
+
{this.text}
|
|
39
|
+
</UDExLink>
|
|
40
|
+
{this.details &&
|
|
41
|
+
<p class={`${rootClass}__details`}>
|
|
42
|
+
{this.details}
|
|
43
|
+
</p>
|
|
44
|
+
}
|
|
45
|
+
{this.location &&
|
|
46
|
+
<p class={`${rootClass}__location`}>
|
|
47
|
+
<UI5Icon
|
|
48
|
+
name="map"
|
|
49
|
+
mode={IconMode.Decorative}
|
|
50
|
+
design={IconDesign.Neutral}
|
|
51
|
+
accessibleName={this.locationIconLabel}>
|
|
52
|
+
</UI5Icon>
|
|
53
|
+
{this.location}
|
|
54
|
+
</p>
|
|
55
|
+
}
|
|
56
|
+
</div>
|
|
57
|
+
}
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type UDExFeed from "./Feed.js";
|
|
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
|
+
|
|
8
|
+
export default function FeedTemplate(this: UDExFeed) {
|
|
9
|
+
const rootClass = "udex-feed";
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
role="region"
|
|
14
|
+
class={`${rootClass}__container`}
|
|
15
|
+
aria-label={this.accessibleName}>
|
|
16
|
+
{this._showPictogram &&
|
|
17
|
+
<div
|
|
18
|
+
part="image"
|
|
19
|
+
class={`${rootClass}__pictogram`}
|
|
20
|
+
title={this._imageLabel}>
|
|
21
|
+
{this.icon &&
|
|
22
|
+
<UI5Icon
|
|
23
|
+
class={`${rootClass}__icon`}
|
|
24
|
+
name={this.icon?.toLowerCase()}
|
|
25
|
+
mode={IconMode.Decorative}
|
|
26
|
+
accessibleName={this._imageLabel}>
|
|
27
|
+
</UI5Icon>}
|
|
28
|
+
{this._showImage &&
|
|
29
|
+
<img
|
|
30
|
+
src={this.imageUrl}
|
|
31
|
+
class={`${rootClass}__icon`}
|
|
32
|
+
aria-label={this._imageLabel}
|
|
33
|
+
alt={this._imageLabel} />}
|
|
34
|
+
</div>
|
|
35
|
+
}
|
|
36
|
+
<div part="content" class={`${rootClass}__content`}>
|
|
37
|
+
{this.header &&
|
|
38
|
+
<h3 part="header" class={`${rootClass}__header`}>{this.header}</h3>
|
|
39
|
+
}
|
|
40
|
+
{this.items.length > 0 &&
|
|
41
|
+
<div class={`${rootClass}__items`}>
|
|
42
|
+
{this.items.map(item =>
|
|
43
|
+
<slot name={item._individualSlot}></slot>
|
|
44
|
+
)}
|
|
45
|
+
</div>
|
|
46
|
+
}
|
|
47
|
+
{!!this.button && footerSection.call(this, rootClass)}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function footerSection(this: UDExFeed, rootClass: string) {
|
|
53
|
+
return (
|
|
54
|
+
<>
|
|
55
|
+
<div part="footer" class={`${rootClass}__footer`}>
|
|
56
|
+
<UDExButton class={`${rootClass}__btn`}
|
|
57
|
+
size={UDExButtonSize.Large}
|
|
58
|
+
design={this.buttonDesign}
|
|
59
|
+
onClick={this.handleCTAButtonClick}
|
|
60
|
+
accessibleRole={UDExButtonAccessibleRole.Button}>
|
|
61
|
+
{this.button}
|
|
62
|
+
</UDExButton>
|
|
63
|
+
</div>
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
}
|
package/src/Footer.ts
CHANGED
|
@@ -417,6 +417,22 @@ class UDExFooter extends UI5Element {
|
|
|
417
417
|
@property({ type: String })
|
|
418
418
|
chineseIcpNumberLink: string = chineseICPDefaultLink;
|
|
419
419
|
|
|
420
|
+
/**
|
|
421
|
+
* Defines text for the chinese ICP Number
|
|
422
|
+
*
|
|
423
|
+
* @public
|
|
424
|
+
*/
|
|
425
|
+
@property({ type: String })
|
|
426
|
+
chineseIcpNumber!: string;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Defines text for the chinese security network number
|
|
430
|
+
*
|
|
431
|
+
* @public
|
|
432
|
+
*/
|
|
433
|
+
@property({ type: String })
|
|
434
|
+
chineseSecurityNetworkNumber!: string;
|
|
435
|
+
|
|
420
436
|
/**
|
|
421
437
|
* Defines should render the mobile navigation.
|
|
422
438
|
*
|
|
@@ -532,12 +548,12 @@ class UDExFooter extends UI5Element {
|
|
|
532
548
|
return UDExFooter.i18nBundle.getText(COPYRIGHT, new Date().getFullYear());
|
|
533
549
|
}
|
|
534
550
|
|
|
535
|
-
get
|
|
536
|
-
return `${UDExFooter.i18nBundle.getText(ICP_NUMBER)} `;
|
|
551
|
+
get chineseICPNumberText(): string {
|
|
552
|
+
return this.chineseIcpNumber ? `${this.chineseIcpNumber} ` : `${UDExFooter.i18nBundle.getText(ICP_NUMBER)} `;
|
|
537
553
|
}
|
|
538
554
|
|
|
539
|
-
get
|
|
540
|
-
return UDExFooter.i18nBundle.getText(PUBLIC_SECURITY_NETWORK_NUMBER);
|
|
555
|
+
get chineseSecurityNetworkNumberText(): string {
|
|
556
|
+
return this.chineseSecurityNetworkNumber ?? UDExFooter.i18nBundle.getText(PUBLIC_SECURITY_NETWORK_NUMBER);
|
|
541
557
|
}
|
|
542
558
|
|
|
543
559
|
get isMobile(): boolean {
|