@sapudex/web-components 2.24.0 → 2.25.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/downloads/downloads.html +0 -0
- package/cypress/specs/EventRibbon.cy.tsx +7 -7
- package/cypress/specs/ImageGridTable.cy.tsx +41 -0
- package/cypress/specs/ImageGridTableItem.cy.tsx +101 -0
- package/cypress/specs/ImageGridTickerItem.cy.tsx +1 -2
- package/cypress/specs/MastheadProfileMenu.cy.tsx +16 -0
- package/cypress/specs/UploadItem.cy.tsx +14 -5
- package/cypress/support/component-imports.instrumented.ts +4 -0
- package/cypress/support/component-imports.src.ts +4 -0
- package/dist/Accordion.js +3 -2
- package/dist/Accordion.js.map +1 -1
- package/dist/Avatar.js +4 -3
- package/dist/Avatar.js.map +1 -1
- package/dist/Breadcrumbs.js +4 -3
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/Button.js +3 -2
- package/dist/Button.js.map +1 -1
- package/dist/Carousel.d.ts +1 -0
- package/dist/Carousel.js +6 -4
- package/dist/Carousel.js.map +1 -1
- package/dist/CarouselTemplate.js +1 -1
- package/dist/CarouselTemplate.js.map +1 -1
- package/dist/Checkbox.js +3 -2
- package/dist/Checkbox.js.map +1 -1
- package/dist/Contact.js +5 -4
- package/dist/Contact.js.map +1 -1
- package/dist/CountrySelector.d.ts +1 -1
- package/dist/CountrySelector.js +1 -1
- package/dist/CountrySelector.js.map +1 -1
- package/dist/DatePicker.js +3 -2
- package/dist/DatePicker.js.map +1 -1
- package/dist/EventRibbon.d.ts +2 -2
- package/dist/EventRibbon.js.map +1 -1
- package/dist/FeedItem.js +2 -1
- package/dist/FeedItem.js.map +1 -1
- package/dist/FilterMenu.js +5 -4
- package/dist/FilterMenu.js.map +1 -1
- package/dist/Footer.js +15 -14
- package/dist/Footer.js.map +1 -1
- package/dist/ImageGridTable.d.ts +57 -0
- package/dist/ImageGridTable.js +120 -0
- package/dist/ImageGridTable.js.map +1 -0
- package/dist/ImageGridTableItem.d.ts +89 -0
- package/dist/ImageGridTableItem.js +108 -0
- package/dist/ImageGridTableItem.js.map +1 -0
- package/dist/ImageGridTableItemTemplate.d.ts +2 -0
- package/dist/ImageGridTableItemTemplate.js +13 -0
- package/dist/ImageGridTableItemTemplate.js.map +1 -0
- package/dist/ImageGridTableTemplate.d.ts +2 -0
- package/dist/ImageGridTableTemplate.js +5 -0
- package/dist/ImageGridTableTemplate.js.map +1 -0
- package/dist/ImageGridTicker.js +3 -2
- package/dist/ImageGridTicker.js.map +1 -1
- package/dist/ImageGridTickerItem.d.ts +4 -0
- package/dist/ImageGridTickerItem.js +14 -0
- package/dist/ImageGridTickerItem.js.map +1 -1
- package/dist/ImageGridTickerItemTemplate.js +1 -1
- package/dist/ImageGridTickerItemTemplate.js.map +1 -1
- package/dist/InputGroup.js +3 -2
- package/dist/InputGroup.js.map +1 -1
- package/dist/List.js +2 -1
- package/dist/List.js.map +1 -1
- package/dist/ListItem.d.ts +0 -2
- package/dist/ListItem.js +4 -9
- package/dist/ListItem.js.map +1 -1
- package/dist/ListSelectAll.js +2 -1
- package/dist/ListSelectAll.js.map +1 -1
- package/dist/MastheadCountrySelector.js +3 -2
- package/dist/MastheadCountrySelector.js.map +1 -1
- package/dist/MastheadItem.js +8 -7
- package/dist/MastheadItem.js.map +1 -1
- package/dist/MastheadMenuItem.js +2 -1
- package/dist/MastheadMenuItem.js.map +1 -1
- package/dist/MastheadMobileMenu.js +2 -1
- package/dist/MastheadMobileMenu.js.map +1 -1
- package/dist/MastheadProfileMenu.js +6 -5
- package/dist/MastheadProfileMenu.js.map +1 -1
- package/dist/MastheadShell.d.ts +17 -0
- package/dist/MastheadShell.js +42 -13
- package/dist/MastheadShell.js.map +1 -1
- package/dist/MessageStrip.js +2 -1
- package/dist/MessageStrip.js.map +1 -1
- package/dist/MessageStripTemplate.js +1 -1
- package/dist/MessageStripTemplate.js.map +1 -1
- package/dist/Pagination.d.ts +0 -2
- package/dist/Pagination.js +16 -29
- package/dist/Pagination.js.map +1 -1
- package/dist/PhoneNumberField.js +7 -6
- package/dist/PhoneNumberField.js.map +1 -1
- package/dist/ProgressBar.js +5 -4
- package/dist/ProgressBar.js.map +1 -1
- package/dist/PromoTile.js +3 -2
- package/dist/PromoTile.js.map +1 -1
- package/dist/RadioButton.js +5 -4
- package/dist/RadioButton.js.map +1 -1
- package/dist/RatingBar.js +2 -1
- package/dist/RatingBar.js.map +1 -1
- package/dist/RatingIndicator.js +2 -1
- package/dist/RatingIndicator.js.map +1 -1
- package/dist/Review.d.ts +1 -1
- package/dist/Review.js +3 -3
- package/dist/Review.js.map +1 -1
- package/dist/ReviewItem.js +2 -1
- package/dist/ReviewItem.js.map +1 -1
- package/dist/Search.d.ts +2 -0
- package/dist/Search.js +34 -19
- package/dist/Search.js.map +1 -1
- package/dist/SearchTemplate.js +1 -1
- package/dist/SearchTemplate.js.map +1 -1
- package/dist/SearchableListBase.d.ts +1 -1
- package/dist/SearchableListBase.js +4 -3
- package/dist/SearchableListBase.js.map +1 -1
- package/dist/SecondaryNavigation.js +2 -1
- package/dist/SecondaryNavigation.js.map +1 -1
- package/dist/SecondaryNavigationSubItem.js +2 -1
- package/dist/SecondaryNavigationSubItem.js.map +1 -1
- package/dist/SelectBase.d.ts +4 -11
- package/dist/SelectBase.js +4 -11
- package/dist/SelectBase.js.map +1 -1
- package/dist/SelectBox.d.ts +1 -1
- package/dist/SelectBox.js +1 -1
- package/dist/SelectBox.js.map +1 -1
- package/dist/SocialMediaButton.js +2 -1
- package/dist/SocialMediaButton.js.map +1 -1
- package/dist/StatusBadge.js +7 -6
- package/dist/StatusBadge.js.map +1 -1
- package/dist/StepInput.js +9 -2
- package/dist/StepInput.js.map +1 -1
- package/dist/StepInputTemplate.js +1 -1
- package/dist/StepInputTemplate.js.map +1 -1
- package/dist/Tab.js +2 -1
- package/dist/Tab.js.map +1 -1
- package/dist/TabNavigation.js +2 -1
- package/dist/TabNavigation.js.map +1 -1
- package/dist/Table.d.ts +2 -2
- package/dist/Table.js +5 -15
- package/dist/Table.js.map +1 -1
- package/dist/TableCell.js +3 -3
- package/dist/TableCell.js.map +1 -1
- package/dist/TableCellBase.js +1 -3
- package/dist/TableCellBase.js.map +1 -1
- package/dist/TableCellTemplate.d.ts +2 -0
- package/dist/TableCellTemplate.js +9 -0
- package/dist/TableCellTemplate.js.map +1 -0
- package/dist/TableGroupRow.d.ts +1 -1
- package/dist/TableGroupRow.js +3 -6
- package/dist/TableGroupRow.js.map +1 -1
- package/dist/TableGroupRowTemplate.d.ts +2 -0
- package/dist/TableGroupRowTemplate.js +7 -0
- package/dist/TableGroupRowTemplate.js.map +1 -0
- package/dist/TableHeaderCell.js +3 -4
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderCellTemplate.d.ts +2 -0
- package/dist/TableHeaderCellTemplate.js +6 -0
- package/dist/TableHeaderCellTemplate.js.map +1 -0
- package/dist/TableHeaderRow.js +3 -5
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableHeaderRowTemplate.d.ts +2 -0
- package/dist/TableHeaderRowTemplate.js +5 -0
- package/dist/TableHeaderRowTemplate.js.map +1 -0
- package/dist/TableRow.js +3 -4
- package/dist/TableRow.js.map +1 -1
- package/dist/TableRowBase.d.ts +1 -1
- package/dist/TableRowBase.js +0 -2
- package/dist/TableRowBase.js.map +1 -1
- package/dist/TableRowTemplate.d.ts +2 -0
- package/dist/TableRowTemplate.js +5 -0
- package/dist/TableRowTemplate.js.map +1 -0
- package/dist/TableTemplate.d.ts +2 -0
- package/dist/TableTemplate.js +20 -0
- package/dist/TableTemplate.js.map +1 -0
- package/dist/TextArea.js +9 -8
- package/dist/TextArea.js.map +1 -1
- package/dist/TextField.js +7 -6
- package/dist/TextField.js.map +1 -1
- package/dist/Toast.d.ts +3 -1
- package/dist/Toast.js +15 -9
- package/dist/Toast.js.map +1 -1
- package/dist/ToastTemplate.d.ts +2 -0
- package/dist/ToastTemplate.js +11 -0
- package/dist/ToastTemplate.js.map +1 -0
- package/dist/TruncatedText.js +3 -2
- package/dist/TruncatedText.js.map +1 -1
- package/dist/Upload.js +2 -1
- package/dist/Upload.js.map +1 -1
- package/dist/UploadItem.d.ts +7 -0
- package/dist/UploadItem.js +14 -3
- package/dist/UploadItem.js.map +1 -1
- package/dist/assets/{InputSuggestions-63QG0i9j.js → InputSuggestions-DF_pzCn9.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-B1CpqSCb.js → ListItemStandardExpandableTextTemplate-DOYL5Szm.js} +1 -1
- package/dist/assets/{bundle.esm-lUYJDofa.js → bundle.esm-CWBg8c5Q.js} +269 -267
- package/dist/assets/messagebundle_en-mjqY85LY.js +1 -0
- package/dist/css/themes/ImageGridTable.css +1 -0
- package/dist/css/themes/ImageGridTableItem.css +1 -0
- package/dist/css/themes/ImageGridTicker.css +1 -1
- package/dist/css/themes/MastheadItem.css +1 -1
- package/dist/css/themes/MastheadShell.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 +9292 -7325
- package/dist/custom-elements.json +6574 -5095
- 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 +4 -3
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/templates/MastheadShellTemplate.lit.js +8 -7
- package/dist/generated/templates/MastheadShellTemplate.lit.js.map +1 -1
- package/dist/generated/templates/UploadItemTemplate.lit.js +1 -1
- package/dist/generated/templates/UploadItemTemplate.lit.js.map +1 -1
- package/dist/generated/themes/ImageGridTable.css.d.ts +2 -0
- package/dist/generated/themes/ImageGridTable.css.js +8 -0
- package/dist/generated/themes/ImageGridTable.css.js.map +1 -0
- package/dist/generated/themes/ImageGridTableItem.css.d.ts +2 -0
- package/dist/generated/themes/ImageGridTableItem.css.js +8 -0
- package/dist/generated/themes/ImageGridTableItem.css.js.map +1 -0
- package/dist/generated/themes/ImageGridTicker.css.d.ts +1 -1
- package/dist/generated/themes/ImageGridTicker.css.js +1 -1
- package/dist/generated/themes/ImageGridTicker.css.js.map +1 -1
- package/dist/generated/themes/MastheadItem.css.d.ts +1 -1
- package/dist/generated/themes/MastheadItem.css.js +1 -1
- package/dist/generated/themes/MastheadItem.css.js.map +1 -1
- package/dist/generated/themes/MastheadShell.css.d.ts +1 -1
- package/dist/generated/themes/MastheadShell.css.js +1 -1
- package/dist/generated/themes/MastheadShell.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 +6 -2
- package/dist/messagebundle_en.properties +3 -2
- package/dist/types/CustomTranslations.d.ts +3 -0
- package/dist/types/CustomTranslations.js +2 -0
- package/dist/types/CustomTranslations.js.map +1 -0
- package/dist/types/EventRibbon.d.ts +1 -1
- package/dist/types/EventRibbon.js +39 -39
- package/dist/types/EventRibbon.js.map +1 -1
- package/dist/utils/translate.d.ts +7 -0
- package/dist/utils/translate.js +15 -0
- package/dist/utils/translate.js.map +1 -0
- package/dist/vscode.html-custom-data.json +207 -7
- package/dist/web-types.json +541 -12
- package/package.json +1 -1
- package/src/Accordion.ts +3 -2
- package/src/Avatar.ts +5 -3
- package/src/Breadcrumbs.ts +4 -3
- package/src/Button.ts +3 -2
- package/src/Carousel.ts +7 -4
- package/src/CarouselTemplate.tsx +2 -1
- package/src/Checkbox.ts +3 -2
- package/src/Contact.ts +5 -4
- package/src/CountrySelector.ts +1 -1
- package/src/DatePicker.ts +3 -2
- package/src/EventRibbon.ts +2 -2
- package/src/FeedItem.ts +2 -1
- package/src/FilterMenu.ts +5 -4
- package/src/Footer.ts +15 -14
- package/src/ImageGridTable.ts +151 -0
- package/src/ImageGridTableItem.ts +148 -0
- package/src/ImageGridTableItemTemplate.tsx +48 -0
- package/src/ImageGridTableTemplate.tsx +9 -0
- package/src/ImageGridTicker.ts +4 -2
- package/src/ImageGridTickerItem.ts +20 -0
- package/src/ImageGridTickerItemTemplate.tsx +1 -0
- package/src/InputGroup.ts +3 -2
- package/src/List.ts +2 -1
- package/src/ListItem.ts +4 -11
- package/src/ListSelectAll.ts +2 -1
- package/src/MastheadCountrySelector.ts +3 -2
- package/src/MastheadItem.ts +8 -7
- package/src/MastheadMenuItem.ts +2 -1
- package/src/MastheadMobileMenu.ts +2 -1
- package/src/MastheadProfileMenu.ts +6 -5
- package/src/MastheadShell.hbs +38 -29
- package/src/MastheadShell.ts +57 -13
- package/src/MessageStrip.ts +2 -1
- package/src/MessageStripTemplate.tsx +1 -1
- package/src/Pagination.ts +15 -28
- package/src/PhoneNumberField.ts +7 -6
- package/src/ProgressBar.ts +5 -4
- package/src/PromoTile.ts +3 -2
- package/src/RadioButton.ts +5 -4
- package/src/RatingBar.ts +2 -1
- package/src/RatingIndicator.ts +2 -1
- package/src/Review.ts +4 -3
- package/src/ReviewItem.ts +2 -1
- package/src/Search.ts +36 -19
- package/src/SearchTemplate.tsx +1 -1
- package/src/SearchableListBase.ts +4 -3
- package/src/SecondaryNavigation.ts +2 -1
- package/src/SecondaryNavigationSubItem.ts +2 -1
- package/src/SelectBase.ts +6 -12
- package/src/SelectBox.ts +1 -1
- package/src/SocialMediaButton.ts +2 -1
- package/src/StatusBadge.ts +7 -6
- package/src/StepInput.ts +9 -2
- package/src/StepInputTemplate.tsx +6 -2
- package/src/Tab.ts +2 -1
- package/src/TabNavigation.ts +2 -1
- package/src/Table.ts +7 -15
- package/src/TableCell.ts +3 -3
- package/src/TableCellBase.ts +1 -3
- package/src/TableCellTemplate.tsx +21 -0
- package/src/TableGroupRow.ts +4 -6
- package/src/TableGroupRowTemplate.tsx +36 -0
- package/src/TableHeaderCell.ts +3 -4
- package/src/TableHeaderCellTemplate.tsx +36 -0
- package/src/TableHeaderRow.ts +3 -5
- package/src/TableHeaderRowTemplate.tsx +13 -0
- package/src/TableRow.ts +3 -4
- package/src/TableRowBase.ts +1 -2
- package/src/TableRowTemplate.tsx +13 -0
- package/src/TableTemplate.tsx +94 -0
- package/src/TextArea.ts +8 -8
- package/src/TextField.ts +7 -6
- package/src/Toast.ts +17 -8
- package/src/ToastTemplate.tsx +42 -0
- package/src/TruncatedText.ts +3 -2
- package/src/Upload.ts +2 -1
- package/src/UploadItem.hbs +1 -1
- package/src/UploadItem.ts +13 -3
- package/src/generated/i18n/i18n-defaults.ts +2 -2
- package/src/generated/templates/MastheadShellTemplate.lit.ts +8 -7
- package/src/generated/templates/UploadItemTemplate.lit.ts +1 -1
- package/src/generated/themes/ImageGridTable.css.ts +9 -0
- package/src/generated/themes/ImageGridTableItem.css.ts +9 -0
- package/src/generated/themes/ImageGridTicker.css.ts +1 -1
- package/src/generated/themes/MastheadItem.css.ts +1 -1
- package/src/generated/themes/MastheadShell.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 +6 -2
- package/src/i18n/messagebundle_en.properties +3 -2
- package/src/themes/ImageGridTable.css +47 -0
- package/src/themes/ImageGridTableItem.css +102 -0
- package/src/themes/ImageGridTicker.css +1 -0
- package/src/themes/MastheadItem.css +1 -0
- package/src/themes/MastheadShell.css +1 -0
- package/src/types/CustomTranslations.ts +1 -0
- package/src/types/EventRibbon.ts +1 -1
- package/src/utils/translate.ts +21 -0
- package/dist/assets/messagebundle_en-D_yCmNrd.js +0 -1
- package/dist/generated/templates/TableCellTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TableCellTemplate.lit.js +0 -8
- package/dist/generated/templates/TableCellTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TableGroupRowTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TableGroupRowTemplate.lit.js +0 -9
- package/dist/generated/templates/TableGroupRowTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TableHeaderCellTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TableHeaderCellTemplate.lit.js +0 -11
- package/dist/generated/templates/TableHeaderCellTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TableHeaderRowTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TableHeaderRowTemplate.lit.js +0 -8
- package/dist/generated/templates/TableHeaderRowTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TableRowTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TableRowTemplate.lit.js +0 -8
- package/dist/generated/templates/TableRowTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TableTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TableTemplate.lit.js +0 -13
- package/dist/generated/templates/TableTemplate.lit.js.map +0 -1
- package/dist/generated/templates/ToastTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/ToastTemplate.lit.js +0 -10
- package/dist/generated/templates/ToastTemplate.lit.js.map +0 -1
- package/src/Table.hbs +0 -45
- package/src/TableCell.hbs +0 -4
- package/src/TableGroupRow.hbs +0 -24
- package/src/TableHeaderCell.hbs +0 -19
- package/src/TableHeaderRow.hbs +0 -3
- package/src/TableRow.hbs +0 -3
- package/src/Toast.hbs +0 -20
- package/src/generated/templates/TableCellTemplate.lit.ts +0 -12
- package/src/generated/templates/TableGroupRowTemplate.lit.ts +0 -13
- package/src/generated/templates/TableHeaderCellTemplate.lit.ts +0 -15
- package/src/generated/templates/TableHeaderRowTemplate.lit.ts +0 -12
- package/src/generated/templates/TableRowTemplate.lit.ts +0 -12
- package/src/generated/templates/TableTemplate.lit.ts +0 -17
- package/src/generated/templates/ToastTemplate.lit.ts +0 -14
package/src/Search.ts
CHANGED
|
@@ -41,6 +41,7 @@ import type SearchInputSuggestion from "./features/SearchSuggestionsPopover.js";
|
|
|
41
41
|
import retryUntilSuccessful from "./utils/retryUntilSuccessful.js";
|
|
42
42
|
import sanitizeString from "./utils/sanitizeString.js";
|
|
43
43
|
import UDExButton from "./Button.js";
|
|
44
|
+
import translate from "./utils/translate.js";
|
|
44
45
|
|
|
45
46
|
import SearchTemplate from "./SearchTemplate.js";
|
|
46
47
|
|
|
@@ -634,7 +635,7 @@ class UDExSearch extends UI5Element {
|
|
|
634
635
|
const hasDataLabels = this.hasDataLabel(parsedData);
|
|
635
636
|
|
|
636
637
|
if (this.shouldShowPopover(parsedData, hasDataLabels)) {
|
|
637
|
-
this.setDropdownLabels(
|
|
638
|
+
this.setDropdownLabels(parsedData);
|
|
638
639
|
this.suggestedList = this.getListWithSuggestion(this.getSuggestedList(hasDataLabels, parsedData), "suggested");
|
|
639
640
|
this.recommendedList = this.getListWithSuggestion(this.getRecommendedList(hasDataLabels, parsedData), "recommended");
|
|
640
641
|
}
|
|
@@ -649,26 +650,42 @@ class UDExSearch extends UI5Element {
|
|
|
649
650
|
return Object.values(parsedData).some(item => Object.prototype.hasOwnProperty.call(item, "label"));
|
|
650
651
|
}
|
|
651
652
|
|
|
653
|
+
private hasSuggestedLabel(parsedData: SuggestionRecommendLists) {
|
|
654
|
+
if (parsedData.suggested) {
|
|
655
|
+
const suggestedData = parsedData.suggested as SuggestionData;
|
|
656
|
+
return Object.prototype.hasOwnProperty.call(parsedData.suggested, "label") ? !!suggestedData.label : false;
|
|
657
|
+
}
|
|
658
|
+
return false;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
private hasRecommendedLabel(parsedData: SuggestionRecommendLists): boolean {
|
|
662
|
+
if (parsedData.recommended) {
|
|
663
|
+
const recommendedData = parsedData.recommended as RecommendData;
|
|
664
|
+
return Object.prototype.hasOwnProperty.call(parsedData.recommended, "label") ? !!recommendedData.label : false;
|
|
665
|
+
}
|
|
666
|
+
return false;
|
|
667
|
+
}
|
|
668
|
+
|
|
652
669
|
private resetSuggestedRecommendedLists() {
|
|
653
670
|
this.suggestedList = [];
|
|
654
671
|
this.recommendedList = [];
|
|
655
672
|
}
|
|
656
673
|
|
|
657
|
-
private setDropdownLabels(
|
|
658
|
-
this._suggestionLabel = this.getSuggestionLabel(
|
|
659
|
-
this._recommendLabel = this.getRecommendLabel(
|
|
674
|
+
private setDropdownLabels(parsedData: SuggestionRecommendLists) {
|
|
675
|
+
this._suggestionLabel = this.getSuggestionLabel(parsedData);
|
|
676
|
+
this._recommendLabel = this.getRecommendLabel(parsedData);
|
|
660
677
|
}
|
|
661
678
|
|
|
662
|
-
private getRecommendLabel(
|
|
663
|
-
return
|
|
679
|
+
private getRecommendLabel(parsedData: SuggestionRecommendLists): string {
|
|
680
|
+
return this.hasRecommendedLabel(parsedData)
|
|
664
681
|
? (parsedData.recommended as RecommendData).label || ""
|
|
665
|
-
: UDExSearch
|
|
682
|
+
: translate(UDExSearch, RECOMMENDED_TEXT);
|
|
666
683
|
}
|
|
667
684
|
|
|
668
|
-
private getSuggestionLabel(
|
|
669
|
-
return
|
|
685
|
+
private getSuggestionLabel(parsedData: SuggestionRecommendLists): string {
|
|
686
|
+
return this.hasSuggestedLabel(parsedData)
|
|
670
687
|
? (parsedData.suggested as SuggestionData).label || ""
|
|
671
|
-
: UDExSearch
|
|
688
|
+
: translate(UDExSearch, SUGGESTED_TEXT);
|
|
672
689
|
}
|
|
673
690
|
|
|
674
691
|
private getRecommendedList(hasDataLabels: boolean, parsedData: SuggestionRecommendLists) {
|
|
@@ -712,7 +729,7 @@ class UDExSearch extends UI5Element {
|
|
|
712
729
|
icon: itemWithCustomIcon ? item.icon : SearchIcon,
|
|
713
730
|
hasCustomIcon: itemWithCustomIcon,
|
|
714
731
|
id: `${idName}-${index}`,
|
|
715
|
-
suggestionDescription: sanitizeString(`${label}, ${idName} ${index + 1} ${UDExSearch
|
|
732
|
+
suggestionDescription: sanitizeString(`${label}, ${idName} ${index + 1} ${translate(UDExSearch, OF)} ${suggestedList.length}`),
|
|
716
733
|
};
|
|
717
734
|
});
|
|
718
735
|
}
|
|
@@ -1113,7 +1130,7 @@ class UDExSearch extends UI5Element {
|
|
|
1113
1130
|
}
|
|
1114
1131
|
|
|
1115
1132
|
get effectivePlaceholder() {
|
|
1116
|
-
return !this.voiceActiveClass ? this.label : `${UDExSearch
|
|
1133
|
+
return !this.voiceActiveClass ? this.label : `${translate(UDExSearch, LISTENING)}...`;
|
|
1117
1134
|
}
|
|
1118
1135
|
|
|
1119
1136
|
onSpeechStart(): void {
|
|
@@ -1178,7 +1195,7 @@ class UDExSearch extends UI5Element {
|
|
|
1178
1195
|
}
|
|
1179
1196
|
|
|
1180
1197
|
get noResultMessage(): string {
|
|
1181
|
-
return this.noResultText || UDExSearch
|
|
1198
|
+
return this.noResultText || translate(UDExSearch, NO_MATCHES_FOUND);
|
|
1182
1199
|
}
|
|
1183
1200
|
|
|
1184
1201
|
get showNoResultMessage(): boolean {
|
|
@@ -1285,8 +1302,8 @@ class UDExSearch extends UI5Element {
|
|
|
1285
1302
|
get accInfo() {
|
|
1286
1303
|
return {
|
|
1287
1304
|
"ariaLabel": this.accessibleName || undefined,
|
|
1288
|
-
"accessibleNameResetIcon": this.accessibleNameResetIcon || UDExSearch
|
|
1289
|
-
"accessibleNameSearchIcon": this.accessibleNameSearchIcon || UDExSearch
|
|
1305
|
+
"accessibleNameResetIcon": this.accessibleNameResetIcon || translate(UDExSearch, ACCESSIBLE_NAME_RESET_ICON),
|
|
1306
|
+
"accessibleNameSearchIcon": this.accessibleNameSearchIcon || translate(UDExSearch, ACCESSIBLE_NAME_SEARCH_ICON),
|
|
1290
1307
|
};
|
|
1291
1308
|
}
|
|
1292
1309
|
|
|
@@ -1296,14 +1313,14 @@ class UDExSearch extends UI5Element {
|
|
|
1296
1313
|
|
|
1297
1314
|
get tooltipInfo() {
|
|
1298
1315
|
return {
|
|
1299
|
-
"tooltipResetButton": this.tooltipResetButton || UDExSearch
|
|
1300
|
-
"tooltipVoiceButton": this.tooltipVoiceButton || UDExSearch
|
|
1301
|
-
"tooltipSubmitButton": this.tooltipSubmitButton || UDExSearch
|
|
1316
|
+
"tooltipResetButton": this.tooltipResetButton || translate(UDExSearch, TOOLTIP_RESET_BUTTON),
|
|
1317
|
+
"tooltipVoiceButton": this.tooltipVoiceButton || translate(UDExSearch, TOOLTIP_VOICE_BUTTON),
|
|
1318
|
+
"tooltipSubmitButton": this.tooltipSubmitButton || translate(UDExSearch, TOOLTIP_SUBMIT_BUTTON),
|
|
1302
1319
|
};
|
|
1303
1320
|
}
|
|
1304
1321
|
|
|
1305
1322
|
get suggestionsAccessibleName(): string {
|
|
1306
|
-
return UDExSearch
|
|
1323
|
+
return translate(UDExSearch, AVAILABLE_VALUES);
|
|
1307
1324
|
}
|
|
1308
1325
|
|
|
1309
1326
|
get showNonInteractiveButton(): boolean {
|
package/src/SearchTemplate.tsx
CHANGED
|
@@ -23,7 +23,7 @@ export default function SearchTemplate(this: UDExSearch) {
|
|
|
23
23
|
<div class={`udex-search__root ${this.searchClasses}`}>
|
|
24
24
|
{ this.isShowSearchHomePrefix ? renderSearchHomePrefix.call(this) : "" }
|
|
25
25
|
|
|
26
|
-
<form
|
|
26
|
+
<form class={`udex-search__container ${this.focusClasses} ${this.isNotEmptyClass}`}>
|
|
27
27
|
{ this.labelAnimationDisabled ? renderInputWithStaticLabel.call(this) : renderInputWithAnimatedLabel.call(this) }
|
|
28
28
|
|
|
29
29
|
{
|
|
@@ -16,6 +16,7 @@ import type UDExListItem from "./ListItem.js";
|
|
|
16
16
|
import type UDExFilterMenuItem from "./FilterMenuItem.js";
|
|
17
17
|
import { SHOW_SEARCH_AFTER_COUNT, UDExPopoverPart } from "./types/SearchableListBase.js";
|
|
18
18
|
import { NO_MATCHES_FOUND, RESULT_RETURNED } from "./generated/i18n/i18n-defaults.js";
|
|
19
|
+
import translate from "./utils/translate.js";
|
|
19
20
|
|
|
20
21
|
export type UDExItemFromList = UDExListItemBase | UDExListGroupHeaderBase | null | undefined;
|
|
21
22
|
|
|
@@ -50,7 +51,7 @@ export type UDExSearchableListBaseEvents = {
|
|
|
50
51
|
* @class
|
|
51
52
|
*
|
|
52
53
|
* A class to serve as a foundation
|
|
53
|
-
* for the <code>UDExFilterMenu</code> and <code>
|
|
54
|
+
* for the <code>UDExFilterMenu</code> ,<code>UDExSelectBox</code> and <code>UDExCountrySelector</code> classes.
|
|
54
55
|
*
|
|
55
56
|
* @constructor
|
|
56
57
|
* @author SAP SE
|
|
@@ -558,11 +559,11 @@ class UDExSearchableListBase extends UI5Element {
|
|
|
558
559
|
}
|
|
559
560
|
|
|
560
561
|
get noMatchesFoundText(): string {
|
|
561
|
-
return UDExSearchableListBase
|
|
562
|
+
return translate(UDExSearchableListBase, NO_MATCHES_FOUND);
|
|
562
563
|
}
|
|
563
564
|
|
|
564
565
|
get resultReturnedText(): string {
|
|
565
|
-
return UDExSearchableListBase
|
|
566
|
+
return translate(UDExSearchableListBase, RESULT_RETURNED);
|
|
566
567
|
}
|
|
567
568
|
|
|
568
569
|
get isListEmpty(): boolean {
|
|
@@ -22,6 +22,7 @@ import SecondaryNavigationTemplate from "./generated/templates/SecondaryNavigati
|
|
|
22
22
|
import { BreakpointUtils } from "./utils/Breakpoints.js";
|
|
23
23
|
import parseArrayFromString from "./utils/parseArrayFromString.js";
|
|
24
24
|
import AnalyticsName from "./types/AnalyticsName.js";
|
|
25
|
+
import translate from "./utils/translate.js";
|
|
25
26
|
|
|
26
27
|
// Styles
|
|
27
28
|
import SecondaryNavigationCss from "./generated/themes/SecondaryNavigation.css.js";
|
|
@@ -501,7 +502,7 @@ class UDExSecondaryNavigation extends UI5Element {
|
|
|
501
502
|
}
|
|
502
503
|
|
|
503
504
|
get moreButtonText(): string {
|
|
504
|
-
return UDExSecondaryNavigation
|
|
505
|
+
return translate(UDExSecondaryNavigation, MORE);
|
|
505
506
|
}
|
|
506
507
|
|
|
507
508
|
get parsedItems(): Array<NavItem> {
|
|
@@ -11,6 +11,7 @@ import { BACK_BUTTON_LABEL } from "./generated/i18n/i18n-defaults.js";
|
|
|
11
11
|
import "@ui5/webcomponents-icons/dist/slim-arrow-left.js";
|
|
12
12
|
import "@ui5/webcomponents-icons/dist/slim-arrow-right.js";
|
|
13
13
|
import SecondaryNavigationSubItemTemplate from "./generated/templates/SecondaryNavigationSubItemTemplate.lit.js";
|
|
14
|
+
import translate from "./utils/translate.js";
|
|
14
15
|
|
|
15
16
|
// Styles
|
|
16
17
|
import SecondaryNavigationSubItemCss from "./generated/themes/SecondaryNavigationSubItem.css.js";
|
|
@@ -119,7 +120,7 @@ class UDExSecondaryNavigationSubItem extends UDExSecondaryNavigationItemBase {
|
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
get backButtonAriaLabel(): string {
|
|
122
|
-
const label = UDExSecondaryNavigationSubItem
|
|
123
|
+
const label = translate(UDExSecondaryNavigationSubItem, BACK_BUTTON_LABEL);
|
|
123
124
|
return `${label} ${this.itemLabel}`;
|
|
124
125
|
}
|
|
125
126
|
}
|
package/src/SelectBase.ts
CHANGED
|
@@ -20,8 +20,9 @@ import UDExValueState from "./types/common.js";
|
|
|
20
20
|
import type { UDExSearchableListBaseEvents } from "./SearchableListBase.js";
|
|
21
21
|
import { getTokensCountText } from "@ui5/webcomponents/dist/Tokenizer.js";
|
|
22
22
|
import isLetterKey from "./utils/isLetterKeyPressed.js";
|
|
23
|
+
import translate from "./utils/translate.js";
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
type UDExSelectBaseEvents = {
|
|
25
26
|
"open": void,
|
|
26
27
|
"close": void,
|
|
27
28
|
"before-close": void,
|
|
@@ -31,19 +32,11 @@ export type UDExSelectBaseEvents = {
|
|
|
31
32
|
/**
|
|
32
33
|
* @class
|
|
33
34
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* <h3>Usage</h3>
|
|
38
|
-
*
|
|
39
|
-
* For the <code>udex-select-box</code>
|
|
40
|
-
* <h3>ES6 Module Import</h3>
|
|
41
|
-
*
|
|
42
|
-
* <code>import "@sapudex/web-components/dist/UDExSelectBox.js";</code>
|
|
35
|
+
* A class to serve as a foundation
|
|
36
|
+
* for the <code>UDExCountrySelector</code> and <code>UDExSelectBox</code> classes.
|
|
43
37
|
*
|
|
44
38
|
* @constructor
|
|
45
39
|
* @extends UDExSearchableListBase
|
|
46
|
-
* @tagname udex-select-box
|
|
47
40
|
* @public
|
|
48
41
|
*/
|
|
49
42
|
|
|
@@ -539,7 +532,7 @@ class UDExSelectBase extends UDExSearchableListBase {
|
|
|
539
532
|
|
|
540
533
|
get accInfo(): { ariaLabel: string } {
|
|
541
534
|
return {
|
|
542
|
-
"ariaLabel": getAllAccessibleNameRefTexts(this) || this.accessibleName || this.label || UDExSelectBase
|
|
535
|
+
"ariaLabel": getAllAccessibleNameRefTexts(this) || this.accessibleName || this.label || translate(UDExSelectBase, COUNTRY_SELECT),
|
|
543
536
|
};
|
|
544
537
|
}
|
|
545
538
|
|
|
@@ -578,3 +571,4 @@ class UDExSelectBase extends UDExSearchableListBase {
|
|
|
578
571
|
}
|
|
579
572
|
|
|
580
573
|
export default UDExSelectBase;
|
|
574
|
+
export type { UDExSelectBaseEvents };
|
package/src/SelectBox.ts
CHANGED
package/src/SocialMediaButton.ts
CHANGED
|
@@ -11,6 +11,7 @@ import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
|
11
11
|
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
12
12
|
import { SOCIAL_MEDIA_BUTTON } from "./generated/i18n/i18n-defaults.js";
|
|
13
13
|
import { UDExTarget } from "./types/common.js";
|
|
14
|
+
import translate from "./utils/translate.js";
|
|
14
15
|
|
|
15
16
|
// Styles
|
|
16
17
|
import SocialMediaButtonCss from "./generated/themes/SocialMediaButton.css.js";
|
|
@@ -157,7 +158,7 @@ class UDExSocialMediaButton extends UI5Element {
|
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
get buttonAccessibleName(): string {
|
|
160
|
-
return this.accessibleName || UDExSocialMediaButton
|
|
161
|
+
return this.accessibleName || translate(UDExSocialMediaButton, SOCIAL_MEDIA_BUTTON);
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
get imageSlot(): boolean {
|
package/src/StatusBadge.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
STATUS_BADGE_SUCCESS_TITLE,
|
|
20
20
|
STATUS_BADGE_WARNING_TITLE,
|
|
21
21
|
} from "./generated/i18n/i18n-defaults.js";
|
|
22
|
+
import translate from "./utils/translate.js";
|
|
22
23
|
|
|
23
24
|
import StatusBadgeTemplate from "./StatusBadgeTemplate.js";
|
|
24
25
|
|
|
@@ -105,21 +106,21 @@ class UDExStatusBadge extends UI5Element {
|
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
get badgeAccessibleName(): string {
|
|
108
|
-
return `${this.accessibleName ? this.accessibleName : UDExStatusBadge
|
|
109
|
+
return `${this.accessibleName ? this.accessibleName : translate(UDExStatusBadge, STATUS_BADGE_TEXT)}`;
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
get ariaTitle(): string {
|
|
112
113
|
switch (IconMapping[this.valueState]) {
|
|
113
114
|
case IconMapping.Edit:
|
|
114
|
-
return UDExStatusBadge
|
|
115
|
+
return translate(UDExStatusBadge, STATUS_BADGE_EDIT_TITLE);
|
|
115
116
|
case IconMapping.Information:
|
|
116
|
-
return UDExStatusBadge
|
|
117
|
+
return translate(UDExStatusBadge, STATUS_BADGE_INFORMATION_TITLE);
|
|
117
118
|
case IconMapping.Success:
|
|
118
|
-
return UDExStatusBadge
|
|
119
|
+
return translate(UDExStatusBadge, STATUS_BADGE_SUCCESS_TITLE);
|
|
119
120
|
case IconMapping.Error:
|
|
120
|
-
return UDExStatusBadge
|
|
121
|
+
return translate(UDExStatusBadge, STATUS_BADGE_ERROR_TITLE);
|
|
121
122
|
case IconMapping.Warning:
|
|
122
|
-
return UDExStatusBadge
|
|
123
|
+
return translate(UDExStatusBadge, STATUS_BADGE_WARNING_TITLE);
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
126
|
}
|
package/src/StepInput.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
|
15
15
|
import { STEPINPUT_DEC_ICON_TITLE, STEPINPUT_INC_ICON_TITLE } from "./generated/i18n/i18n-defaults.js";
|
|
16
16
|
import UDExValueState, { valueStateToControlButtonDesign } from "./types/common.js";
|
|
17
17
|
import StepInputTemplate from "./StepInputTemplate.js";
|
|
18
|
+
import translate from "./utils/translate.js";
|
|
18
19
|
|
|
19
20
|
// Styles
|
|
20
21
|
import StepInputCss from "./generated/themes/StepInput.css.js";
|
|
@@ -258,15 +259,21 @@ class UDExStepInput extends UI5Element {
|
|
|
258
259
|
}
|
|
259
260
|
|
|
260
261
|
get decIconTitle() {
|
|
262
|
+
const text = translate(UDExStepInput, STEPINPUT_DEC_ICON_TITLE)?.split(" ");
|
|
261
263
|
return [
|
|
262
|
-
|
|
264
|
+
text[0],
|
|
265
|
+
this.accessibleName || this.label,
|
|
266
|
+
text[1] || "",
|
|
263
267
|
this.step.toFixed(this._getNumberPrecision(this.step)),
|
|
264
268
|
].join(" ");
|
|
265
269
|
}
|
|
266
270
|
|
|
267
271
|
get incIconTitle() {
|
|
272
|
+
const text = translate(UDExStepInput, STEPINPUT_INC_ICON_TITLE)?.split(" ");
|
|
268
273
|
return [
|
|
269
|
-
|
|
274
|
+
text[0],
|
|
275
|
+
this.accessibleName || this.label,
|
|
276
|
+
text[1] || "",
|
|
270
277
|
this.step.toFixed(this._getNumberPrecision(this.step)),
|
|
271
278
|
].join(" ");
|
|
272
279
|
}
|
|
@@ -27,8 +27,10 @@ export default function StepInputTemplate(this: UDExStepInput) {
|
|
|
27
27
|
<UDExControlButton
|
|
28
28
|
class="udex-step-input__button udex-step-input__button_dec"
|
|
29
29
|
title={this.decIconTitle}
|
|
30
|
-
|
|
30
|
+
accessibleName={this.decIconTitle}
|
|
31
|
+
tooltip={this.decIconTitle}
|
|
31
32
|
icon="less"
|
|
33
|
+
iconOnly
|
|
32
34
|
size="Large"
|
|
33
35
|
design={this.controlButtonDesign}
|
|
34
36
|
onClick={this._decValue}
|
|
@@ -42,8 +44,10 @@ export default function StepInputTemplate(this: UDExStepInput) {
|
|
|
42
44
|
<UDExControlButton
|
|
43
45
|
class="udex-step-input__button udex-step-input__button_inc"
|
|
44
46
|
title={this.incIconTitle}
|
|
45
|
-
|
|
47
|
+
accessibleName={this.incIconTitle}
|
|
48
|
+
tooltip={this.incIconTitle}
|
|
46
49
|
icon="add"
|
|
50
|
+
iconOnly
|
|
47
51
|
size="Large"
|
|
48
52
|
design={this.controlButtonDesign}
|
|
49
53
|
onClick={this._incValue}
|
package/src/Tab.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { ATTENTION_BADGE } from "./generated/i18n/i18n-defaults.js";
|
|
|
16
16
|
|
|
17
17
|
// Styles
|
|
18
18
|
import TabInOverflowCss from "./generated/themes/TabInOverflow.css.js";
|
|
19
|
+
import translate from "./utils/translate.js";
|
|
19
20
|
|
|
20
21
|
export interface ITab extends UI5Element {
|
|
21
22
|
getTabInHeaderDomRef: () => ITab | null;
|
|
@@ -257,7 +258,7 @@ class UDExTab extends UI5Element implements ITab {
|
|
|
257
258
|
}
|
|
258
259
|
|
|
259
260
|
get accessibleNameText(): string {
|
|
260
|
-
return this.accessibleName || (this.showAttentionBadge ? `, ${UDExTab
|
|
261
|
+
return this.accessibleName || (this.showAttentionBadge ? `, ${translate(UDExTab, ATTENTION_BADGE)}` : "");
|
|
261
262
|
}
|
|
262
263
|
|
|
263
264
|
get linkTabIndex(): string {
|
package/src/TabNavigation.ts
CHANGED
|
@@ -27,6 +27,7 @@ import TabNavigationPopoverTemplate from "./generated/templates/TabNavigationPop
|
|
|
27
27
|
// Styles
|
|
28
28
|
import TabNavigationCss from "./generated/themes/TabNavigation.css.js";
|
|
29
29
|
import TabInOverflowCss from "./generated/themes/TabInOverflow.css.js";
|
|
30
|
+
import translate from "./utils/translate.js";
|
|
30
31
|
|
|
31
32
|
const staticAreaTabStyles: Array<StyleData> = [];
|
|
32
33
|
|
|
@@ -825,7 +826,7 @@ class UDExTabNavigation extends UI5Element {
|
|
|
825
826
|
}
|
|
826
827
|
|
|
827
828
|
get moreButtonText(): string {
|
|
828
|
-
return UDExTabNavigation
|
|
829
|
+
return translate(UDExTabNavigation, MORE);
|
|
829
830
|
}
|
|
830
831
|
|
|
831
832
|
static registerStaticAreaTabStyles(styles: StyleData) {
|
package/src/Table.ts
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
2
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
3
3
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
4
|
-
import
|
|
4
|
+
import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
|
|
5
5
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
6
6
|
import {
|
|
7
7
|
isUp, isDown, isLeft, isRight,
|
|
8
8
|
} from "@ui5/webcomponents-base/dist/Keys.js";
|
|
9
|
-
import UDExTableHeaderRow from "./TableHeaderRow.js";
|
|
10
|
-
import UDExTableRow from "./TableRow.js";
|
|
11
|
-
import UDExTableCell from "./TableCell.js";
|
|
9
|
+
import type UDExTableHeaderRow from "./TableHeaderRow.js";
|
|
10
|
+
import type UDExTableRow from "./TableRow.js";
|
|
12
11
|
import UDExTableGroupRow from "./TableGroupRow.js";
|
|
13
|
-
import UDExBusyIndicator from "./BusyIndicator.js";
|
|
14
12
|
import type UDExTableHeaderCell from "./TableHeaderCell.js";
|
|
15
13
|
import { TABLE_NO_DATA_FOUND } from "./generated/i18n/i18n-defaults.js";
|
|
16
14
|
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
17
15
|
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
18
|
-
import TableTemplate from "./
|
|
16
|
+
import TableTemplate from "./TableTemplate.js";
|
|
19
17
|
|
|
20
18
|
// Styles
|
|
21
19
|
import TableCss from "./generated/themes/Table.css.js";
|
|
22
20
|
import getEffectiveScrollbarStyle from "./utils/getEffectiveScrollbarStyle.js";
|
|
21
|
+
import translate from "./utils/translate.js";
|
|
23
22
|
|
|
24
23
|
export type TableBaseRow = UDExTableHeaderRow | UDExTableRow;
|
|
25
24
|
|
|
@@ -47,16 +46,9 @@ export type KeyBoardItem = {
|
|
|
47
46
|
*/
|
|
48
47
|
@customElement({
|
|
49
48
|
tag: "udex-table",
|
|
50
|
-
renderer:
|
|
49
|
+
renderer: jsxRenderer,
|
|
51
50
|
styles: [TableCss, getEffectiveScrollbarStyle()],
|
|
52
51
|
template: TableTemplate,
|
|
53
|
-
dependencies: [
|
|
54
|
-
UDExBusyIndicator,
|
|
55
|
-
UDExTableHeaderRow,
|
|
56
|
-
UDExTableRow,
|
|
57
|
-
UDExTableCell,
|
|
58
|
-
UDExTableGroupRow,
|
|
59
|
-
],
|
|
60
52
|
})
|
|
61
53
|
|
|
62
54
|
class UDExTable extends UI5Element {
|
|
@@ -355,7 +347,7 @@ class UDExTable extends UI5Element {
|
|
|
355
347
|
}
|
|
356
348
|
|
|
357
349
|
get _effectiveNoDataText() {
|
|
358
|
-
return this.noDataText || UDExTable
|
|
350
|
+
return this.noDataText || translate(UDExTable, TABLE_NO_DATA_FOUND);
|
|
359
351
|
}
|
|
360
352
|
|
|
361
353
|
get _hasToolbar(): boolean {
|
package/src/TableCell.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
2
|
-
import
|
|
2
|
+
import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
|
|
3
3
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
4
4
|
import UDExTableCellBase from "./TableCellBase.js";
|
|
5
|
-
import TableCellTemplate from "./
|
|
5
|
+
import TableCellTemplate from "./TableCellTemplate.js";
|
|
6
6
|
|
|
7
7
|
// Styles
|
|
8
8
|
import TableCellCss from "./generated/themes/TableCell.css.js";
|
|
@@ -26,7 +26,7 @@ import TableCellCss from "./generated/themes/TableCell.css.js";
|
|
|
26
26
|
*/
|
|
27
27
|
@customElement({
|
|
28
28
|
tag: "udex-table-cell",
|
|
29
|
-
renderer:
|
|
29
|
+
renderer: jsxRenderer,
|
|
30
30
|
styles: [UDExTableCellBase.styles, TableCellCss],
|
|
31
31
|
template: TableCellTemplate,
|
|
32
32
|
dependencies: [],
|
package/src/TableCellBase.ts
CHANGED
|
@@ -2,7 +2,6 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
|
2
2
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
3
3
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
4
4
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
5
|
-
import Icon from "@ui5/webcomponents/dist/Icon.js";
|
|
6
5
|
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
|
7
6
|
import type UDExTableCellHorizontalAlign from "./types/Table.js";
|
|
8
7
|
|
|
@@ -20,7 +19,6 @@ import TableCellBaseCss from "./generated/themes/TableCellBase.css.js";
|
|
|
20
19
|
@customElement({
|
|
21
20
|
renderer: litRender,
|
|
22
21
|
styles: TableCellBaseCss,
|
|
23
|
-
dependencies: [Icon],
|
|
24
22
|
})
|
|
25
23
|
|
|
26
24
|
abstract class UDExTableCellBase extends UI5Element {
|
|
@@ -59,7 +57,7 @@ abstract class UDExTableCellBase extends UI5Element {
|
|
|
59
57
|
|
|
60
58
|
_individualSlot?: string;
|
|
61
59
|
|
|
62
|
-
protected ariaRole: string = "
|
|
60
|
+
protected ariaRole: string = "cell";
|
|
63
61
|
|
|
64
62
|
onBeforeRendering() {
|
|
65
63
|
this.setAttribute("role", this.ariaRole);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type UDExTableCell from "./TableCell.js";
|
|
2
|
+
import UI5Icon from "@ui5/webcomponents/dist/Icon.js";
|
|
3
|
+
|
|
4
|
+
export default function TableCellTemplate(this: UDExTableCell) {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
{
|
|
8
|
+
this.icon ? (
|
|
9
|
+
renderTableCellIcon.call(this)
|
|
10
|
+
) : ""
|
|
11
|
+
}
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function renderTableCellIcon(this: UDExTableCell) {
|
|
18
|
+
return (
|
|
19
|
+
<UI5Icon class="udex-table-cell__icon" name={this.icon}></UI5Icon>
|
|
20
|
+
);
|
|
21
|
+
}
|
package/src/TableGroupRow.ts
CHANGED
|
@@ -2,12 +2,11 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
|
2
2
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
3
3
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
4
4
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
5
|
-
import
|
|
6
|
-
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
|
5
|
+
import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
|
|
7
6
|
import { isEscape } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
8
|
-
import UDExTableRow from "./TableRow.js";
|
|
7
|
+
import type UDExTableRow from "./TableRow.js";
|
|
9
8
|
|
|
10
|
-
import TableGroupRowTemplate from "./
|
|
9
|
+
import TableGroupRowTemplate from "./TableGroupRowTemplate.js";
|
|
11
10
|
import "@ui5/webcomponents-icons/dist/slim-arrow-right.js";
|
|
12
11
|
|
|
13
12
|
// Styles
|
|
@@ -32,10 +31,9 @@ import TableGroupRowCss from "./generated/themes/TableGroupRow.css.js";
|
|
|
32
31
|
*/
|
|
33
32
|
@customElement({
|
|
34
33
|
tag: "udex-table-group-row",
|
|
35
|
-
renderer:
|
|
34
|
+
renderer: jsxRenderer,
|
|
36
35
|
styles: TableGroupRowCss,
|
|
37
36
|
template: TableGroupRowTemplate,
|
|
38
|
-
dependencies: [UDExTableRow, UI5Icon],
|
|
39
37
|
})
|
|
40
38
|
|
|
41
39
|
class UDExTableGroupRow extends UI5Element {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type UDExTableGroupRow from "./TableGroupRow.js";
|
|
2
|
+
import UI5Icon from "@ui5/webcomponents/dist/Icon.js";
|
|
3
|
+
import slimArrowRight from "@ui5/webcomponents-icons/dist/slim-arrow-right.js";
|
|
4
|
+
|
|
5
|
+
export default function TableCellTemplate(this: UDExTableGroupRow) {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
{
|
|
9
|
+
this.collapsible ? (
|
|
10
|
+
<button
|
|
11
|
+
id="udex-table-group-opener"
|
|
12
|
+
class="udex-table-grow-btn"
|
|
13
|
+
aria-expanded={this.expanded}
|
|
14
|
+
onClick={this.toggleExpanded}
|
|
15
|
+
>
|
|
16
|
+
<span class="udex-table-grow">
|
|
17
|
+
<UI5Icon
|
|
18
|
+
class="udex-table-grow__icon"
|
|
19
|
+
name={slimArrowRight}
|
|
20
|
+
></UI5Icon>
|
|
21
|
+
{this.groupTitle}
|
|
22
|
+
</span>
|
|
23
|
+
</button>
|
|
24
|
+
) : (
|
|
25
|
+
<div class="udex-table-grow-btn">
|
|
26
|
+
<span class="udex-table-grow">{this.groupTitle}</span>
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
<div class="udex-table-grow-rows" onKeyDown={this.handleEscapeKey}>
|
|
32
|
+
<slot></slot>
|
|
33
|
+
</div>
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
}
|
package/src/TableHeaderCell.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
2
2
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
3
|
-
import
|
|
4
|
-
import TableHeaderCellTemplate from "./
|
|
3
|
+
import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
|
|
4
|
+
import TableHeaderCellTemplate from "./TableHeaderCellTemplate.js";
|
|
5
5
|
import UDExTableCellBase from "./TableCellBase.js";
|
|
6
6
|
|
|
7
7
|
// Styles
|
|
@@ -26,10 +26,9 @@ import TableHeaderCellCss from "./generated/themes/TableHeaderCell.css.js";
|
|
|
26
26
|
*/
|
|
27
27
|
@customElement({
|
|
28
28
|
tag: "udex-table-header-cell",
|
|
29
|
-
renderer:
|
|
29
|
+
renderer: jsxRenderer,
|
|
30
30
|
styles: [UDExTableCellBase.styles, TableHeaderCellCss],
|
|
31
31
|
template: TableHeaderCellTemplate,
|
|
32
|
-
dependencies: [...UDExTableCellBase.dependencies],
|
|
33
32
|
})
|
|
34
33
|
|
|
35
34
|
class UDExTableHeaderCell extends UDExTableCellBase {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type UDExTableHeaderCell from "./TableHeaderCell.js";
|
|
2
|
+
import UI5Icon from "@ui5/webcomponents/dist/Icon.js";
|
|
3
|
+
|
|
4
|
+
export default function TableCellTemplate(this: UDExTableHeaderCell) {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
{
|
|
8
|
+
this._hasIcons ? (
|
|
9
|
+
<div class="udex-table-header-cell-wrap">
|
|
10
|
+
{
|
|
11
|
+
this.iconStart ? (
|
|
12
|
+
<UI5Icon
|
|
13
|
+
class="udex-table-header-cell-wrap__icon"
|
|
14
|
+
name={this.iconStart}
|
|
15
|
+
></UI5Icon>
|
|
16
|
+
) : ""
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
<slot></slot>
|
|
20
|
+
|
|
21
|
+
{
|
|
22
|
+
this.iconEnd ? (
|
|
23
|
+
<UI5Icon
|
|
24
|
+
class="udex-table-header-cell-wrap__icon"
|
|
25
|
+
name={this.iconEnd}
|
|
26
|
+
></UI5Icon>
|
|
27
|
+
) : ""
|
|
28
|
+
}
|
|
29
|
+
</div>
|
|
30
|
+
) : (
|
|
31
|
+
<slot></slot>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
}
|