@ui5/webcomponents 2.11.0 → 2.12.0-rc.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/CHANGELOG.md +25 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/Avatar.d.ts +12 -0
- package/dist/Avatar.js +68 -1
- package/dist/Avatar.js.map +1 -1
- package/dist/AvatarTemplate.js +4 -4
- package/dist/AvatarTemplate.js.map +1 -1
- package/dist/BusyIndicator.d.ts +1 -0
- package/dist/BusyIndicator.js +4 -0
- package/dist/BusyIndicator.js.map +1 -1
- package/dist/BusyIndicatorTemplate.js +4 -1
- package/dist/BusyIndicatorTemplate.js.map +1 -1
- package/dist/Button.d.ts +3 -0
- package/dist/Button.js +22 -0
- package/dist/Button.js.map +1 -1
- package/dist/DynamicDateRange.d.ts +36 -7
- package/dist/DynamicDateRange.js +45 -42
- package/dist/DynamicDateRange.js.map +1 -1
- package/dist/InputTemplate.js +1 -1
- package/dist/InputTemplate.js.map +1 -1
- package/dist/Popup.d.ts +24 -0
- package/dist/Popup.js +29 -1
- package/dist/Popup.js.map +1 -1
- package/dist/PopupTemplate.js +2 -1
- package/dist/PopupTemplate.js.map +1 -1
- package/dist/RangeSlider.d.ts +4 -9
- package/dist/RangeSlider.js +50 -133
- package/dist/RangeSlider.js.map +1 -1
- package/dist/RangeSliderTemplate.js +2 -10
- package/dist/RangeSliderTemplate.js.map +1 -1
- package/dist/ResponsivePopoverTemplate.js +1 -1
- package/dist/ResponsivePopoverTemplate.js.map +1 -1
- package/dist/SelectTemplate.js +10 -4
- package/dist/SelectTemplate.js.map +1 -1
- package/dist/Slider.d.ts +2 -6
- package/dist/Slider.js +9 -43
- package/dist/Slider.js.map +1 -1
- package/dist/SliderBase.d.ts +4 -6
- package/dist/SliderBase.js +14 -31
- package/dist/SliderBase.js.map +1 -1
- package/dist/SliderBaseTemplate.js +1 -1
- package/dist/SliderBaseTemplate.js.map +1 -1
- package/dist/SliderTemplate.js +2 -6
- package/dist/SliderTemplate.js.map +1 -1
- package/dist/SliderTooltip.d.ts +47 -0
- package/dist/SliderTooltip.js +158 -0
- package/dist/SliderTooltip.js.map +1 -0
- package/dist/SliderTooltipTemplate.d.ts +2 -0
- package/dist/SliderTooltipTemplate.js +8 -0
- package/dist/SliderTooltipTemplate.js.map +1 -0
- package/dist/ToggleButton.d.ts +1 -1
- package/dist/ToggleButton.js +21 -2
- package/dist/ToggleButton.js.map +1 -1
- package/dist/Tokenizer.js +0 -6
- package/dist/Tokenizer.js.map +1 -1
- package/dist/css/themes/Avatar.css +1 -1
- package/dist/css/themes/AvatarGroup.css +1 -1
- package/dist/css/themes/Bar.css +1 -1
- package/dist/css/themes/Breadcrumbs.css +1 -1
- package/dist/css/themes/BusyIndicator.css +1 -1
- package/dist/css/themes/Button.css +1 -1
- package/dist/css/themes/ButtonBadge.css +1 -1
- package/dist/css/themes/Calendar.css +1 -1
- package/dist/css/themes/CalendarHeader.css +1 -1
- package/dist/css/themes/CalendarLegend.css +1 -1
- package/dist/css/themes/CalendarLegendItem.css +1 -1
- package/dist/css/themes/Card.css +1 -1
- package/dist/css/themes/CardHeader.css +1 -1
- package/dist/css/themes/Carousel.css +1 -1
- package/dist/css/themes/CheckBox.css +1 -1
- package/dist/css/themes/ColorPalette.css +1 -1
- package/dist/css/themes/ColorPaletteItem.css +1 -1
- package/dist/css/themes/ColorPalettePopover.css +1 -1
- package/dist/css/themes/ColorPicker.css +1 -1
- package/dist/css/themes/ComboBox.css +1 -1
- package/dist/css/themes/ComboBoxItem.css +1 -1
- package/dist/css/themes/DatePicker.css +1 -1
- package/dist/css/themes/DateTimePickerPopover.css +1 -1
- package/dist/css/themes/DayPicker.css +1 -1
- package/dist/css/themes/Dialog.css +1 -1
- package/dist/css/themes/DynamicDateRange.css +1 -1
- package/dist/css/themes/DynamicDateRangePopover.css +1 -1
- package/dist/css/themes/FileUploader.css +1 -1
- package/dist/css/themes/Form.css +1 -1
- package/dist/css/themes/FormItem.css +1 -1
- package/dist/css/themes/FormItemSpan.css +1 -1
- package/dist/css/themes/GrowingButton.css +1 -1
- package/dist/css/themes/Icon.css +1 -1
- package/dist/css/themes/Input.css +1 -1
- package/dist/css/themes/InputIcon.css +1 -1
- package/dist/css/themes/InputSharedStyles.css +1 -1
- package/dist/css/themes/Link.css +1 -1
- package/dist/css/themes/List.css +1 -1
- package/dist/css/themes/ListItem.css +1 -1
- package/dist/css/themes/ListItemBase.css +1 -1
- package/dist/css/themes/ListItemCustom.css +1 -1
- package/dist/css/themes/ListItemGroup.css +1 -1
- package/dist/css/themes/ListItemGroupHeader.css +1 -1
- package/dist/css/themes/ListItemIcon.css +1 -1
- package/dist/css/themes/Menu.css +1 -1
- package/dist/css/themes/MenuItem.css +1 -1
- package/dist/css/themes/MessageStrip.css +1 -1
- package/dist/css/themes/MonthPicker.css +1 -1
- package/dist/css/themes/MultiComboBox.css +1 -1
- package/dist/css/themes/MultiComboBoxItem.css +1 -1
- package/dist/css/themes/MultiComboBoxPopover.css +1 -1
- package/dist/css/themes/MultiInput.css +1 -1
- package/dist/css/themes/OptionBase.css +1 -1
- package/dist/css/themes/Panel.css +1 -1
- package/dist/css/themes/Popover.css +1 -1
- package/dist/css/themes/PopupsCommon.css +1 -1
- package/dist/css/themes/ProgressIndicator.css +1 -1
- package/dist/css/themes/RadioButton.css +1 -1
- package/dist/css/themes/RangeSlider.css +1 -1
- package/dist/css/themes/RatingIndicator.css +1 -1
- package/dist/css/themes/ResponsivePopover.css +1 -1
- package/dist/css/themes/ResponsivePopoverCommon.css +1 -1
- package/dist/css/themes/SegmentedButton.css +1 -1
- package/dist/css/themes/SegmentedButtonItem.css +1 -1
- package/dist/css/themes/Select.css +1 -1
- package/dist/css/themes/SliderBase.css +1 -1
- package/dist/css/themes/SliderTooltip.css +1 -0
- package/dist/css/themes/SplitButton.css +1 -1
- package/dist/css/themes/StepInput.css +1 -1
- package/dist/css/themes/SuggestionItem.css +1 -1
- package/dist/css/themes/SuggestionItemCustom.css +1 -1
- package/dist/css/themes/Switch.css +1 -1
- package/dist/css/themes/TabContainer.css +1 -1
- package/dist/css/themes/TabInOverflow.css +1 -1
- package/dist/css/themes/TabInStrip.css +1 -1
- package/dist/css/themes/TabSemanticIcon.css +1 -1
- package/dist/css/themes/TabSeparatorInOverflow.css +1 -1
- package/dist/css/themes/TableCellBase.css +1 -1
- package/dist/css/themes/TableHeaderRow.css +1 -1
- package/dist/css/themes/TableRow.css +1 -1
- package/dist/css/themes/TableRowActionBase.css +1 -1
- package/dist/css/themes/TableRowBase.css +1 -1
- package/dist/css/themes/Tag.css +1 -1
- package/dist/css/themes/Text.css +1 -1
- package/dist/css/themes/TextArea.css +1 -1
- package/dist/css/themes/TimePicker.css +1 -1
- package/dist/css/themes/Toast.css +1 -1
- package/dist/css/themes/ToggleButton.css +1 -1
- package/dist/css/themes/Token.css +1 -1
- package/dist/css/themes/Tokenizer.css +1 -1
- package/dist/css/themes/TokenizerPopover.css +1 -1
- package/dist/css/themes/Toolbar.css +1 -1
- package/dist/css/themes/ToolbarPopover.css +1 -1
- package/dist/css/themes/ToolbarSeparator.css +1 -1
- package/dist/css/themes/TreeItem.css +1 -1
- package/dist/css/themes/ValueStateMessage.css +1 -1
- package/dist/css/themes/YearPicker.css +1 -1
- package/dist/css/themes/YearRangePicker.css +1 -1
- package/dist/css/themes/sap_fiori_3/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcw/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +1 -1
- package/dist/custom-elements-internal.json +259 -6
- package/dist/custom-elements.json +243 -0
- package/dist/dynamic-date-range-options/DateRange.d.ts +1 -1
- package/dist/dynamic-date-range-options/DateRange.js +1 -1
- package/dist/dynamic-date-range-options/DateRange.js.map +1 -1
- package/dist/dynamic-date-range-options/SingleDate.d.ts +1 -1
- package/dist/dynamic-date-range-options/SingleDate.js +1 -1
- package/dist/dynamic-date-range-options/SingleDate.js.map +1 -1
- package/dist/dynamic-date-range-options/Today.d.ts +1 -1
- package/dist/dynamic-date-range-options/Today.js +1 -1
- package/dist/dynamic-date-range-options/Today.js.map +1 -1
- package/dist/dynamic-date-range-options/Tomorrow.d.ts +1 -1
- package/dist/dynamic-date-range-options/Tomorrow.js +1 -1
- package/dist/dynamic-date-range-options/Tomorrow.js.map +1 -1
- package/dist/dynamic-date-range-options/Yesterday.d.ts +1 -1
- package/dist/dynamic-date-range-options/Yesterday.js +1 -1
- package/dist/dynamic-date-range-options/Yesterday.js.map +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/i18n/i18n-defaults.js +1 -1
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/themes/Avatar.css.d.ts +1 -1
- package/dist/generated/themes/Avatar.css.js +1 -1
- package/dist/generated/themes/Avatar.css.js.map +1 -1
- package/dist/generated/themes/AvatarGroup.css.d.ts +1 -1
- package/dist/generated/themes/AvatarGroup.css.js +1 -1
- package/dist/generated/themes/AvatarGroup.css.js.map +1 -1
- package/dist/generated/themes/Bar.css.d.ts +1 -1
- package/dist/generated/themes/Bar.css.js +1 -1
- package/dist/generated/themes/Bar.css.js.map +1 -1
- package/dist/generated/themes/Breadcrumbs.css.d.ts +1 -1
- package/dist/generated/themes/Breadcrumbs.css.js +1 -1
- package/dist/generated/themes/Breadcrumbs.css.js.map +1 -1
- package/dist/generated/themes/BusyIndicator.css.d.ts +1 -1
- package/dist/generated/themes/BusyIndicator.css.js +1 -1
- package/dist/generated/themes/BusyIndicator.css.js.map +1 -1
- package/dist/generated/themes/Button.css.d.ts +1 -1
- package/dist/generated/themes/Button.css.js +1 -1
- package/dist/generated/themes/Button.css.js.map +1 -1
- package/dist/generated/themes/ButtonBadge.css.d.ts +1 -1
- package/dist/generated/themes/ButtonBadge.css.js +1 -1
- package/dist/generated/themes/ButtonBadge.css.js.map +1 -1
- package/dist/generated/themes/Calendar.css.d.ts +1 -1
- package/dist/generated/themes/Calendar.css.js +1 -1
- package/dist/generated/themes/Calendar.css.js.map +1 -1
- package/dist/generated/themes/CalendarHeader.css.d.ts +1 -1
- package/dist/generated/themes/CalendarHeader.css.js +1 -1
- package/dist/generated/themes/CalendarHeader.css.js.map +1 -1
- package/dist/generated/themes/CalendarLegend.css.d.ts +1 -1
- package/dist/generated/themes/CalendarLegend.css.js +1 -1
- package/dist/generated/themes/CalendarLegend.css.js.map +1 -1
- package/dist/generated/themes/CalendarLegendItem.css.d.ts +1 -1
- package/dist/generated/themes/CalendarLegendItem.css.js +1 -1
- package/dist/generated/themes/CalendarLegendItem.css.js.map +1 -1
- package/dist/generated/themes/Card.css.d.ts +1 -1
- package/dist/generated/themes/Card.css.js +1 -1
- package/dist/generated/themes/Card.css.js.map +1 -1
- package/dist/generated/themes/CardHeader.css.d.ts +1 -1
- package/dist/generated/themes/CardHeader.css.js +1 -1
- package/dist/generated/themes/CardHeader.css.js.map +1 -1
- package/dist/generated/themes/Carousel.css.d.ts +1 -1
- package/dist/generated/themes/Carousel.css.js +1 -1
- package/dist/generated/themes/Carousel.css.js.map +1 -1
- package/dist/generated/themes/CheckBox.css.d.ts +1 -1
- package/dist/generated/themes/CheckBox.css.js +1 -1
- package/dist/generated/themes/CheckBox.css.js.map +1 -1
- package/dist/generated/themes/ColorPalette.css.d.ts +1 -1
- package/dist/generated/themes/ColorPalette.css.js +1 -1
- package/dist/generated/themes/ColorPalette.css.js.map +1 -1
- package/dist/generated/themes/ColorPaletteItem.css.d.ts +1 -1
- package/dist/generated/themes/ColorPaletteItem.css.js +1 -1
- package/dist/generated/themes/ColorPaletteItem.css.js.map +1 -1
- package/dist/generated/themes/ColorPalettePopover.css.d.ts +1 -1
- package/dist/generated/themes/ColorPalettePopover.css.js +1 -1
- package/dist/generated/themes/ColorPalettePopover.css.js.map +1 -1
- package/dist/generated/themes/ColorPicker.css.d.ts +1 -1
- package/dist/generated/themes/ColorPicker.css.js +1 -1
- package/dist/generated/themes/ColorPicker.css.js.map +1 -1
- package/dist/generated/themes/ComboBox.css.d.ts +1 -1
- package/dist/generated/themes/ComboBox.css.js +1 -1
- package/dist/generated/themes/ComboBox.css.js.map +1 -1
- package/dist/generated/themes/ComboBoxItem.css.d.ts +1 -1
- package/dist/generated/themes/ComboBoxItem.css.js +1 -1
- package/dist/generated/themes/ComboBoxItem.css.js.map +1 -1
- package/dist/generated/themes/DatePicker.css.d.ts +1 -1
- package/dist/generated/themes/DatePicker.css.js +1 -1
- package/dist/generated/themes/DatePicker.css.js.map +1 -1
- package/dist/generated/themes/DateTimePickerPopover.css.d.ts +1 -1
- package/dist/generated/themes/DateTimePickerPopover.css.js +1 -1
- package/dist/generated/themes/DateTimePickerPopover.css.js.map +1 -1
- package/dist/generated/themes/DayPicker.css.d.ts +1 -1
- package/dist/generated/themes/DayPicker.css.js +1 -1
- package/dist/generated/themes/DayPicker.css.js.map +1 -1
- package/dist/generated/themes/Dialog.css.d.ts +1 -1
- package/dist/generated/themes/Dialog.css.js +1 -1
- package/dist/generated/themes/Dialog.css.js.map +1 -1
- package/dist/generated/themes/DynamicDateRange.css.d.ts +1 -1
- package/dist/generated/themes/DynamicDateRange.css.js +1 -1
- package/dist/generated/themes/DynamicDateRange.css.js.map +1 -1
- package/dist/generated/themes/DynamicDateRangePopover.css.d.ts +1 -1
- package/dist/generated/themes/DynamicDateRangePopover.css.js +1 -1
- package/dist/generated/themes/DynamicDateRangePopover.css.js.map +1 -1
- package/dist/generated/themes/FileUploader.css.d.ts +1 -1
- package/dist/generated/themes/FileUploader.css.js +1 -1
- package/dist/generated/themes/FileUploader.css.js.map +1 -1
- package/dist/generated/themes/Form.css.d.ts +1 -1
- package/dist/generated/themes/Form.css.js +1 -1
- package/dist/generated/themes/Form.css.js.map +1 -1
- package/dist/generated/themes/FormItem.css.d.ts +1 -1
- package/dist/generated/themes/FormItem.css.js +1 -1
- package/dist/generated/themes/FormItem.css.js.map +1 -1
- package/dist/generated/themes/FormItemSpan.css.d.ts +1 -1
- package/dist/generated/themes/FormItemSpan.css.js +1 -1
- package/dist/generated/themes/FormItemSpan.css.js.map +1 -1
- package/dist/generated/themes/GrowingButton.css.d.ts +1 -1
- package/dist/generated/themes/GrowingButton.css.js +1 -1
- package/dist/generated/themes/GrowingButton.css.js.map +1 -1
- package/dist/generated/themes/Icon.css.d.ts +1 -1
- package/dist/generated/themes/Icon.css.js +1 -1
- package/dist/generated/themes/Icon.css.js.map +1 -1
- package/dist/generated/themes/Input.css.d.ts +1 -1
- package/dist/generated/themes/Input.css.js +1 -1
- package/dist/generated/themes/Input.css.js.map +1 -1
- package/dist/generated/themes/InputIcon.css.d.ts +1 -1
- package/dist/generated/themes/InputIcon.css.js +1 -1
- package/dist/generated/themes/InputIcon.css.js.map +1 -1
- package/dist/generated/themes/InputSharedStyles.css.d.ts +1 -1
- package/dist/generated/themes/InputSharedStyles.css.js +1 -1
- package/dist/generated/themes/InputSharedStyles.css.js.map +1 -1
- package/dist/generated/themes/Link.css.d.ts +1 -1
- package/dist/generated/themes/Link.css.js +1 -1
- package/dist/generated/themes/Link.css.js.map +1 -1
- package/dist/generated/themes/List.css.d.ts +1 -1
- package/dist/generated/themes/List.css.js +1 -1
- package/dist/generated/themes/List.css.js.map +1 -1
- package/dist/generated/themes/ListItem.css.d.ts +1 -1
- package/dist/generated/themes/ListItem.css.js +1 -1
- package/dist/generated/themes/ListItem.css.js.map +1 -1
- package/dist/generated/themes/ListItemBase.css.d.ts +1 -1
- package/dist/generated/themes/ListItemBase.css.js +1 -1
- package/dist/generated/themes/ListItemBase.css.js.map +1 -1
- package/dist/generated/themes/ListItemCustom.css.d.ts +1 -1
- package/dist/generated/themes/ListItemCustom.css.js +1 -1
- package/dist/generated/themes/ListItemCustom.css.js.map +1 -1
- package/dist/generated/themes/ListItemGroup.css.d.ts +1 -1
- package/dist/generated/themes/ListItemGroup.css.js +1 -1
- package/dist/generated/themes/ListItemGroup.css.js.map +1 -1
- package/dist/generated/themes/ListItemGroupHeader.css.d.ts +1 -1
- package/dist/generated/themes/ListItemGroupHeader.css.js +1 -1
- package/dist/generated/themes/ListItemGroupHeader.css.js.map +1 -1
- package/dist/generated/themes/ListItemIcon.css.d.ts +1 -1
- package/dist/generated/themes/ListItemIcon.css.js +1 -1
- package/dist/generated/themes/ListItemIcon.css.js.map +1 -1
- package/dist/generated/themes/Menu.css.d.ts +1 -1
- package/dist/generated/themes/Menu.css.js +1 -1
- package/dist/generated/themes/Menu.css.js.map +1 -1
- package/dist/generated/themes/MenuItem.css.d.ts +1 -1
- package/dist/generated/themes/MenuItem.css.js +1 -1
- package/dist/generated/themes/MenuItem.css.js.map +1 -1
- package/dist/generated/themes/MessageStrip.css.d.ts +1 -1
- package/dist/generated/themes/MessageStrip.css.js +1 -1
- package/dist/generated/themes/MessageStrip.css.js.map +1 -1
- package/dist/generated/themes/MonthPicker.css.d.ts +1 -1
- package/dist/generated/themes/MonthPicker.css.js +1 -1
- package/dist/generated/themes/MonthPicker.css.js.map +1 -1
- package/dist/generated/themes/MultiComboBox.css.d.ts +1 -1
- package/dist/generated/themes/MultiComboBox.css.js +1 -1
- package/dist/generated/themes/MultiComboBox.css.js.map +1 -1
- package/dist/generated/themes/MultiComboBoxItem.css.d.ts +1 -1
- package/dist/generated/themes/MultiComboBoxItem.css.js +1 -1
- package/dist/generated/themes/MultiComboBoxItem.css.js.map +1 -1
- package/dist/generated/themes/MultiComboBoxPopover.css.d.ts +1 -1
- package/dist/generated/themes/MultiComboBoxPopover.css.js +1 -1
- package/dist/generated/themes/MultiComboBoxPopover.css.js.map +1 -1
- package/dist/generated/themes/MultiInput.css.d.ts +1 -1
- package/dist/generated/themes/MultiInput.css.js +1 -1
- package/dist/generated/themes/MultiInput.css.js.map +1 -1
- package/dist/generated/themes/OptionBase.css.d.ts +1 -1
- package/dist/generated/themes/OptionBase.css.js +1 -1
- package/dist/generated/themes/OptionBase.css.js.map +1 -1
- package/dist/generated/themes/Panel.css.d.ts +1 -1
- package/dist/generated/themes/Panel.css.js +1 -1
- package/dist/generated/themes/Panel.css.js.map +1 -1
- package/dist/generated/themes/Popover.css.d.ts +1 -1
- package/dist/generated/themes/Popover.css.js +1 -1
- package/dist/generated/themes/Popover.css.js.map +1 -1
- package/dist/generated/themes/PopupsCommon.css.d.ts +1 -1
- package/dist/generated/themes/PopupsCommon.css.js +1 -1
- package/dist/generated/themes/PopupsCommon.css.js.map +1 -1
- package/dist/generated/themes/ProgressIndicator.css.d.ts +1 -1
- package/dist/generated/themes/ProgressIndicator.css.js +1 -1
- package/dist/generated/themes/ProgressIndicator.css.js.map +1 -1
- package/dist/generated/themes/RadioButton.css.d.ts +1 -1
- package/dist/generated/themes/RadioButton.css.js +1 -1
- package/dist/generated/themes/RadioButton.css.js.map +1 -1
- package/dist/generated/themes/RangeSlider.css.d.ts +1 -1
- package/dist/generated/themes/RangeSlider.css.js +1 -1
- package/dist/generated/themes/RangeSlider.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/ResponsivePopover.css.d.ts +1 -1
- package/dist/generated/themes/ResponsivePopover.css.js +1 -1
- package/dist/generated/themes/ResponsivePopover.css.js.map +1 -1
- package/dist/generated/themes/ResponsivePopoverCommon.css.d.ts +1 -1
- package/dist/generated/themes/ResponsivePopoverCommon.css.js +1 -1
- package/dist/generated/themes/ResponsivePopoverCommon.css.js.map +1 -1
- package/dist/generated/themes/SegmentedButton.css.d.ts +1 -1
- package/dist/generated/themes/SegmentedButton.css.js +1 -1
- package/dist/generated/themes/SegmentedButton.css.js.map +1 -1
- package/dist/generated/themes/SegmentedButtonItem.css.d.ts +1 -1
- package/dist/generated/themes/SegmentedButtonItem.css.js +1 -1
- package/dist/generated/themes/SegmentedButtonItem.css.js.map +1 -1
- package/dist/generated/themes/Select.css.d.ts +1 -1
- package/dist/generated/themes/Select.css.js +1 -1
- package/dist/generated/themes/Select.css.js.map +1 -1
- package/dist/generated/themes/SliderBase.css.d.ts +1 -1
- package/dist/generated/themes/SliderBase.css.js +1 -1
- package/dist/generated/themes/SliderBase.css.js.map +1 -1
- package/dist/generated/themes/SliderTooltip.css.d.ts +2 -0
- package/dist/generated/themes/SliderTooltip.css.js +8 -0
- package/dist/generated/themes/SliderTooltip.css.js.map +1 -0
- package/dist/generated/themes/SplitButton.css.d.ts +1 -1
- package/dist/generated/themes/SplitButton.css.js +1 -1
- package/dist/generated/themes/SplitButton.css.js.map +1 -1
- package/dist/generated/themes/StepInput.css.d.ts +1 -1
- package/dist/generated/themes/StepInput.css.js +1 -1
- package/dist/generated/themes/StepInput.css.js.map +1 -1
- package/dist/generated/themes/SuggestionItem.css.d.ts +1 -1
- package/dist/generated/themes/SuggestionItem.css.js +1 -1
- package/dist/generated/themes/SuggestionItem.css.js.map +1 -1
- package/dist/generated/themes/SuggestionItemCustom.css.d.ts +1 -1
- package/dist/generated/themes/SuggestionItemCustom.css.js +1 -1
- package/dist/generated/themes/SuggestionItemCustom.css.js.map +1 -1
- package/dist/generated/themes/Switch.css.d.ts +1 -1
- package/dist/generated/themes/Switch.css.js +1 -1
- package/dist/generated/themes/Switch.css.js.map +1 -1
- package/dist/generated/themes/TabContainer.css.d.ts +1 -1
- package/dist/generated/themes/TabContainer.css.js +1 -1
- package/dist/generated/themes/TabContainer.css.js.map +1 -1
- package/dist/generated/themes/TabInOverflow.css.d.ts +1 -1
- package/dist/generated/themes/TabInOverflow.css.js +1 -1
- package/dist/generated/themes/TabInOverflow.css.js.map +1 -1
- package/dist/generated/themes/TabInStrip.css.d.ts +1 -1
- package/dist/generated/themes/TabInStrip.css.js +1 -1
- package/dist/generated/themes/TabInStrip.css.js.map +1 -1
- package/dist/generated/themes/TabSemanticIcon.css.d.ts +1 -1
- package/dist/generated/themes/TabSemanticIcon.css.js +1 -1
- package/dist/generated/themes/TabSemanticIcon.css.js.map +1 -1
- package/dist/generated/themes/TabSeparatorInOverflow.css.d.ts +1 -1
- package/dist/generated/themes/TabSeparatorInOverflow.css.js +1 -1
- package/dist/generated/themes/TabSeparatorInOverflow.css.js.map +1 -1
- package/dist/generated/themes/TableCellBase.css.d.ts +1 -1
- package/dist/generated/themes/TableCellBase.css.js +1 -1
- package/dist/generated/themes/TableCellBase.css.js.map +1 -1
- package/dist/generated/themes/TableHeaderRow.css.d.ts +1 -1
- package/dist/generated/themes/TableHeaderRow.css.js +1 -1
- package/dist/generated/themes/TableHeaderRow.css.js.map +1 -1
- package/dist/generated/themes/TableRow.css.d.ts +1 -1
- package/dist/generated/themes/TableRow.css.js +1 -1
- package/dist/generated/themes/TableRow.css.js.map +1 -1
- package/dist/generated/themes/TableRowActionBase.css.d.ts +1 -1
- package/dist/generated/themes/TableRowActionBase.css.js +1 -1
- package/dist/generated/themes/TableRowActionBase.css.js.map +1 -1
- package/dist/generated/themes/TableRowBase.css.d.ts +1 -1
- package/dist/generated/themes/TableRowBase.css.js +1 -1
- package/dist/generated/themes/TableRowBase.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/generated/themes/Text.css.d.ts +1 -1
- package/dist/generated/themes/Text.css.js +1 -1
- package/dist/generated/themes/Text.css.js.map +1 -1
- package/dist/generated/themes/TextArea.css.d.ts +1 -1
- package/dist/generated/themes/TextArea.css.js +1 -1
- package/dist/generated/themes/TextArea.css.js.map +1 -1
- package/dist/generated/themes/TimePicker.css.d.ts +1 -1
- package/dist/generated/themes/TimePicker.css.js +1 -1
- package/dist/generated/themes/TimePicker.css.js.map +1 -1
- package/dist/generated/themes/Toast.css.d.ts +1 -1
- package/dist/generated/themes/Toast.css.js +1 -1
- package/dist/generated/themes/Toast.css.js.map +1 -1
- package/dist/generated/themes/ToggleButton.css.d.ts +1 -1
- package/dist/generated/themes/ToggleButton.css.js +1 -1
- package/dist/generated/themes/ToggleButton.css.js.map +1 -1
- package/dist/generated/themes/Token.css.d.ts +1 -1
- package/dist/generated/themes/Token.css.js +1 -1
- package/dist/generated/themes/Token.css.js.map +1 -1
- package/dist/generated/themes/Tokenizer.css.d.ts +1 -1
- package/dist/generated/themes/Tokenizer.css.js +1 -1
- package/dist/generated/themes/Tokenizer.css.js.map +1 -1
- package/dist/generated/themes/TokenizerPopover.css.d.ts +1 -1
- package/dist/generated/themes/TokenizerPopover.css.js +1 -1
- package/dist/generated/themes/TokenizerPopover.css.js.map +1 -1
- package/dist/generated/themes/Toolbar.css.d.ts +1 -1
- package/dist/generated/themes/Toolbar.css.js +1 -1
- package/dist/generated/themes/Toolbar.css.js.map +1 -1
- package/dist/generated/themes/ToolbarPopover.css.d.ts +1 -1
- package/dist/generated/themes/ToolbarPopover.css.js +1 -1
- package/dist/generated/themes/ToolbarPopover.css.js.map +1 -1
- package/dist/generated/themes/ToolbarSeparator.css.d.ts +1 -1
- package/dist/generated/themes/ToolbarSeparator.css.js +1 -1
- package/dist/generated/themes/ToolbarSeparator.css.js.map +1 -1
- package/dist/generated/themes/TreeItem.css.d.ts +1 -1
- package/dist/generated/themes/TreeItem.css.js +1 -1
- package/dist/generated/themes/TreeItem.css.js.map +1 -1
- package/dist/generated/themes/ValueStateMessage.css.d.ts +1 -1
- package/dist/generated/themes/ValueStateMessage.css.js +1 -1
- package/dist/generated/themes/ValueStateMessage.css.js.map +1 -1
- package/dist/generated/themes/YearPicker.css.d.ts +1 -1
- package/dist/generated/themes/YearPicker.css.js +1 -1
- package/dist/generated/themes/YearPicker.css.js.map +1 -1
- package/dist/generated/themes/YearRangePicker.css.d.ts +1 -1
- package/dist/generated/themes/YearRangePicker.css.js +1 -1
- package/dist/generated/themes/YearRangePicker.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/vscode.html-custom-data.json +41 -1
- package/dist/web-types.json +62 -2
- package/package.json +10 -10
- package/src/AvatarTemplate.tsx +16 -10
- package/src/BusyIndicatorTemplate.tsx +4 -1
- package/src/InputTemplate.tsx +1 -1
- package/src/PopupTemplate.tsx +5 -0
- package/src/RangeSliderTemplate.tsx +25 -39
- package/src/ResponsivePopoverTemplate.tsx +2 -0
- package/src/SelectTemplate.tsx +23 -13
- package/src/SliderBaseTemplate.tsx +0 -1
- package/src/SliderTemplate.tsx +14 -21
- package/src/SliderTooltipTemplate.tsx +27 -0
- package/src/i18n/messagebundle_en.properties +246 -0
- package/src/i18n/messagebundle_en_US_saprigi.properties +18 -0
- package/src/themes/BusyIndicator.css +5 -2
- package/src/themes/PopupsCommon.css +2 -0
- package/src/themes/ResponsivePopoverCommon.css +2 -2
- package/src/themes/Select.css +19 -0
- package/src/themes/SliderTooltip.css +34 -0
- package/src/themes/base/CheckBox-parameters.css +7 -1
- package/src/themes/base/Select-parameters.css +8 -0
- package/src/themes/sap_horizon/BusyIndicator-parameters.css +0 -1
- package/src/themes/sap_horizon/Select-parameters.css +2 -0
- package/src/themes/sap_horizon_dark/BusyIndicator-parameters.css +0 -1
- package/src/themes/sap_horizon_dark/Select-parameters.css +2 -0
package/dist/Avatar.d.ts
CHANGED
|
@@ -149,6 +149,10 @@ declare class Avatar extends UI5Element implements ITabbable, IAvatarGroupItem {
|
|
|
149
149
|
* @private
|
|
150
150
|
*/
|
|
151
151
|
_hasImage: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* @private
|
|
154
|
+
*/
|
|
155
|
+
_imageLoadError: boolean;
|
|
152
156
|
/**
|
|
153
157
|
* Receives the desired `<img>` tag
|
|
154
158
|
*
|
|
@@ -172,6 +176,8 @@ declare class Avatar extends UI5Element implements ITabbable, IAvatarGroupItem {
|
|
|
172
176
|
badge: Array<HTMLElement>;
|
|
173
177
|
static i18nBundle: I18nBundle;
|
|
174
178
|
_handleResizeBound: ResizeObserverCallback;
|
|
179
|
+
_onImageLoadBound: (e: Event) => void;
|
|
180
|
+
_onImageErrorBound: (e: Event) => void;
|
|
175
181
|
constructor();
|
|
176
182
|
onBeforeRendering(): void;
|
|
177
183
|
get tabindex(): number | undefined;
|
|
@@ -193,6 +199,7 @@ declare class Avatar extends UI5Element implements ITabbable, IAvatarGroupItem {
|
|
|
193
199
|
get validInitials(): string | null | undefined;
|
|
194
200
|
get accessibleNameText(): string;
|
|
195
201
|
get hasImage(): boolean;
|
|
202
|
+
get imageEl(): HTMLImageElement | null;
|
|
196
203
|
get initialsContainer(): HTMLObjectElement | null;
|
|
197
204
|
get fallBackIconDomRef(): Icon | null;
|
|
198
205
|
onAfterRendering(): Promise<void>;
|
|
@@ -207,6 +214,11 @@ declare class Avatar extends UI5Element implements ITabbable, IAvatarGroupItem {
|
|
|
207
214
|
_onkeyup(e: KeyboardEvent): void;
|
|
208
215
|
_fireClick(): void;
|
|
209
216
|
_getAriaHasPopup(): import("@ui5/webcomponents-base/dist/types.js").AriaHasPopup | undefined;
|
|
217
|
+
_attachImageEventHandlers(): void;
|
|
218
|
+
_checkExistingImageState(): void;
|
|
219
|
+
_detachImageEventHandlers(): void;
|
|
220
|
+
_onImageLoad(e: Event): void;
|
|
221
|
+
_onImageError(e: Event): void;
|
|
210
222
|
}
|
|
211
223
|
export default Avatar;
|
|
212
224
|
export type { AvatarAccessibilityAttributes, };
|
package/dist/Avatar.js
CHANGED
|
@@ -127,9 +127,16 @@ let Avatar = Avatar_1 = class Avatar extends UI5Element {
|
|
|
127
127
|
* @private
|
|
128
128
|
*/
|
|
129
129
|
this._hasImage = false;
|
|
130
|
+
/**
|
|
131
|
+
* @private
|
|
132
|
+
*/
|
|
133
|
+
this._imageLoadError = false;
|
|
130
134
|
this._handleResizeBound = this.handleResize.bind(this);
|
|
135
|
+
this._onImageLoadBound = this._onImageLoad.bind(this);
|
|
136
|
+
this._onImageErrorBound = this._onImageError.bind(this);
|
|
131
137
|
}
|
|
132
138
|
onBeforeRendering() {
|
|
139
|
+
this._attachImageEventHandlers();
|
|
133
140
|
this._hasImage = this.hasImage;
|
|
134
141
|
}
|
|
135
142
|
get tabindex() {
|
|
@@ -181,7 +188,10 @@ let Avatar = Avatar_1 = class Avatar extends UI5Element {
|
|
|
181
188
|
return this.initials ? `${defaultLabel} ${this.initials}`.trim() : defaultLabel;
|
|
182
189
|
}
|
|
183
190
|
get hasImage() {
|
|
184
|
-
return !!this.image.length;
|
|
191
|
+
return !!this.image.length && !this._imageLoadError;
|
|
192
|
+
}
|
|
193
|
+
get imageEl() {
|
|
194
|
+
return this.image?.[0] instanceof HTMLImageElement ? this.image[0] : null;
|
|
185
195
|
}
|
|
186
196
|
get initialsContainer() {
|
|
187
197
|
return this.getDomRef().querySelector(".ui5-avatar-initials");
|
|
@@ -203,6 +213,7 @@ let Avatar = Avatar_1 = class Avatar extends UI5Element {
|
|
|
203
213
|
}
|
|
204
214
|
onExitDOM() {
|
|
205
215
|
this.initialsContainer && ResizeHandler.deregister(this.initialsContainer, this._handleResizeBound);
|
|
216
|
+
this._detachImageEventHandlers();
|
|
206
217
|
}
|
|
207
218
|
handleResize() {
|
|
208
219
|
if (this.initials && !this.icon) {
|
|
@@ -257,6 +268,59 @@ let Avatar = Avatar_1 = class Avatar extends UI5Element {
|
|
|
257
268
|
}
|
|
258
269
|
return ariaHaspopup;
|
|
259
270
|
}
|
|
271
|
+
_attachImageEventHandlers() {
|
|
272
|
+
const imgEl = this.imageEl;
|
|
273
|
+
if (!imgEl) {
|
|
274
|
+
this._imageLoadError = false;
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
// Remove previous handlers to avoid duplicates
|
|
278
|
+
imgEl.removeEventListener("load", this._onImageLoadBound);
|
|
279
|
+
imgEl.removeEventListener("error", this._onImageErrorBound);
|
|
280
|
+
// Attach new handlers
|
|
281
|
+
imgEl.addEventListener("load", this._onImageLoadBound);
|
|
282
|
+
imgEl.addEventListener("error", this._onImageErrorBound);
|
|
283
|
+
// Check existing image state
|
|
284
|
+
this._checkExistingImageState();
|
|
285
|
+
}
|
|
286
|
+
_checkExistingImageState() {
|
|
287
|
+
const imgEl = this.imageEl;
|
|
288
|
+
if (!imgEl) {
|
|
289
|
+
this._imageLoadError = false;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
if (imgEl.complete && imgEl.naturalWidth === 0) {
|
|
293
|
+
this._imageLoadError = true; // Already broken
|
|
294
|
+
}
|
|
295
|
+
else if (imgEl.complete && imgEl.naturalWidth > 0) {
|
|
296
|
+
this._imageLoadError = false; // Already loaded
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
this._imageLoadError = false; // Pending load
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
_detachImageEventHandlers() {
|
|
303
|
+
const imgEl = this.imageEl;
|
|
304
|
+
if (!imgEl) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
imgEl.removeEventListener("load", this._onImageLoadBound);
|
|
308
|
+
imgEl.removeEventListener("error", this._onImageErrorBound);
|
|
309
|
+
}
|
|
310
|
+
_onImageLoad(e) {
|
|
311
|
+
if (e.target !== this.imageEl) {
|
|
312
|
+
e.target?.removeEventListener("load", this._onImageLoadBound);
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
this._imageLoadError = false;
|
|
316
|
+
}
|
|
317
|
+
_onImageError(e) {
|
|
318
|
+
if (e.target !== this.imageEl) {
|
|
319
|
+
e.target?.removeEventListener("error", this._onImageErrorBound);
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
this._imageLoadError = true;
|
|
323
|
+
}
|
|
260
324
|
};
|
|
261
325
|
__decorate([
|
|
262
326
|
property({ type: Boolean })
|
|
@@ -297,6 +361,9 @@ __decorate([
|
|
|
297
361
|
__decorate([
|
|
298
362
|
property({ type: Boolean })
|
|
299
363
|
], Avatar.prototype, "_hasImage", void 0);
|
|
364
|
+
__decorate([
|
|
365
|
+
property({ type: Boolean, noAttribute: true })
|
|
366
|
+
], Avatar.prototype, "_imageLoadError", void 0);
|
|
300
367
|
__decorate([
|
|
301
368
|
slot({ type: HTMLElement, "default": true })
|
|
302
369
|
], Avatar.prototype, "image", void 0);
|
package/dist/Avatar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../src/Avatar.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;AAC5E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAI/E,OAAO,aAAa,MAAM,wDAAwD,CAAC;AAEnF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAEn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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 i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { ITabbable } from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport { isEnter, isSpace } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport type { IAvatarGroupItem } from \"./AvatarGroup.js\";\n// Template\nimport AvatarTemplate from \"./AvatarTemplate.js\";\n\nimport { AVATAR_TOOLTIP } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport AvatarCss from \"./generated/themes/Avatar.css.js\";\n\nimport type Icon from \"./Icon.js\";\nimport AvatarSize from \"./types/AvatarSize.js\";\nimport type AvatarShape from \"./types/AvatarShape.js\";\nimport type AvatarColorScheme from \"./types/AvatarColorScheme.js\";\n\n// Icon\nimport \"@ui5/webcomponents-icons/dist/employee.js\";\n\ntype AvatarAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\">;\n\n/**\n * @class\n * ### Overview\n *\n * An image-like component that has different display options for representing images and icons\n * in different shapes and sizes, depending on the use case.\n *\n * The shape can be circular or square. There are several predefined sizes, as well as an option to\n * set a custom size.\n *\n * ### Keyboard Handling\n *\n * - [Space] / [Enter] or [Return] - Fires the `click` event if the `interactive` property is set to true.\n * - [Shift] - If [Space] is pressed, pressing [Shift] releases the component without triggering the click event.\n *\n * ### ES6 Module Import\n * `import \"@ui5/webcomponents/dist/Avatar.js\";`\n * @constructor\n * @extends UI5Element\n * @since 1.0.0-rc.6\n * @implements {IAvatarGroupItem}\n * @public\n */\n@customElement({\n\ttag: \"ui5-avatar\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\tstyles: AvatarCss,\n\ttemplate: AvatarTemplate,\n})\n/**\n * Fired on mouseup, space and enter if avatar is interactive\n *\n * **Note:** The event will not be fired if the `disabled`\n * property is set to `true`.\n * @public\n * @since 2.11.0\n */\n@event(\"click\", {\n\tbubbles: true,\n})\nclass Avatar extends UI5Element implements ITabbable, IAvatarGroupItem {\n\teventDetails!: {\n\t\tclick: void,\n\t}\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines if the avatar is interactive (focusable and pressable).\n\t *\n\t * **Note:** This property won't have effect if the `disabled`\n\t * property is set to `true`.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tinteractive = false;\n\n\t/**\n\t * Defines the name of the UI5 Icon, that will be displayed.\n\t *\n\t * **Note:** If `image` slot is provided, the property will be ignored.\n\t *\n\t * **Note:** You should import the desired icon first, then use its name as \"icon\".\n\t *\n\t * `import \"@ui5/webcomponents-icons/dist/{icon_name}.js\"`\n\t *\n\t * `<ui5-avatar icon=\"employee\">`\n\t *\n\t * **Note:** If no icon or an empty one is provided, by default the \"employee\" icon should be displayed.\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines the name of the fallback icon, which should be displayed in the following cases:\n\t *\n\t * \t- If the initials are not valid (more than 3 letters, unsupported languages or empty initials).\n\t * \t- If there are three initials and they do not fit in the shape (e.g. WWW for some of the sizes).\n\t * \t- If the image src is wrong.\n\t *\n\t * **Note:** If not set, a default fallback icon \"employee\" is displayed.\n\t *\n\t * **Note:** You should import the desired icon first, then use its name as \"fallback-icon\".\n\t *\n\t * `import \"@ui5/webcomponents-icons/dist/{icon_name}.js\"`\n\t *\n\t * `<ui5-avatar fallback-icon=\"alert\">`\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default \"employee\"\n\t * @public\n\t */\n\t@property()\n\tfallbackIcon = \"employee\";\n\n\t/**\n\t * Defines the displayed initials.\n\t *\n\t * Up to three Latin letters can be displayed as initials.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tinitials?: string;\n\n\t/**\n\t * Defines the shape of the component.\n\t * @default \"Circle\"\n\t * @public\n\t */\n\t@property()\n\tshape: `${AvatarShape}` = \"Circle\";\n\n\t/**\n\t * Defines predefined size of the component.\n\t * @default \"S\"\n\t * @public\n\t */\n\t@property()\n\tsize: `${AvatarSize}` = \"S\";\n\n\t/**\n\t * Defines the background color of the desired image.\n\t * If `colorScheme` is set to `Auto`, the avatar will be displayed with the `Accent6` color.\n\t *\n\t * @default \"Auto\"\n\t * @public\n\t */\n\t@property()\n\tcolorScheme: `${AvatarColorScheme}` = \"Auto\";\n\n\t/**\n\t * @private\n\t */\n\t@property()\n\t_colorScheme: `${AvatarColorScheme}` = \"Auto\";\n\n\t/**\n\t * Defines the text alternative of the component.\n\t * If not provided a default text alternative will be set, if present.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.7\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The following field is supported:\n\t *\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.\n\t * Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.\n\t *\n\t * @public\n\t * @since 2.0.0\n\t * @default {}\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: AvatarAccessibilityAttributes = {};\n\n\t@property({ noAttribute: true })\n\tforcedTabIndex?: string;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_hasImage = false;\n\n\t/**\n\t * Receives the desired `<img>` tag\n\t *\n\t * **Note:** If you experience flickering of the provided image, you can hide the component until it is defined with the following CSS:<br/>\n\t * `ui5-avatar:not(:defined) {`<br/>\n\t * `visibility: hidden;`<br/>\n\t * `}`\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\timage!: Array<HTMLElement>;\n\n\t/**\n\t * Defines the optional badge that will be used for visual affordance.\n\t *\n\t * **Note:** While the slot allows for custom badges, to achieve\n\t * the Fiori design, you can use the `ui5-tag` with `ui5-icon`\n\t * in the corresponding `icon` slot, without text nodes.\n\t * @public\n\t * @since 1.7.0\n\t */\n\t@slot()\n\tbadge!: Array<HTMLElement>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\t_handleResizeBound: ResizeObserverCallback;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._handleResizeBound = this.handleResize.bind(this);\n\t}\n\n\tonBeforeRendering() {\n\t\tthis._hasImage = this.hasImage;\n\t}\n\n\tget tabindex() {\n\t\tif (this.forcedTabIndex) {\n\t\t\treturn parseInt(this.forcedTabIndex);\n\t\t}\n\t\treturn this._interactive ? 0 : undefined;\n\t}\n\n\t/**\n\t * Returns the effective avatar size.\n\t * @default \"S\"\n\t * @private\n\t */\n\tget effectiveSize(): AvatarSize {\n\t\t// we read the attribute, because the \"size\" property will always have a default value\n\t\treturn this.getAttribute(\"size\") as AvatarSize || AvatarSize.S;\n\t}\n\n\t/**\n\t * Returns the effective background color.\n\t * @default \"Auto\"\n\t * @private\n\t */\n\tget effectiveBackgroundColor(): AvatarColorScheme {\n\t\t// we read the attribute, because the \"background-color\" property will always have a default value\n\t\treturn this.getAttribute(\"color-scheme\") as AvatarColorScheme || this._colorScheme;\n\t}\n\n\tget _role() {\n\t\treturn this._interactive ? \"button\" : \"img\";\n\t}\n\n\tget _ariaHasPopup() {\n\t\treturn this._getAriaHasPopup();\n\t}\n\n\tget _interactive() {\n\t\treturn this.interactive && !this.disabled;\n\t}\n\n\tget validInitials() {\n\t\t// initials should consist of only 1,2 or 3 latin letters\n\t\tconst validInitials = /^[a-zA-Zà-üÀ-Ü]{1,3}$/,\n\t\t\tareInitialsValid = this.initials && validInitials.test(this.initials);\n\n\t\tif (areInitialsValid) {\n\t\t\treturn this.initials;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tget accessibleNameText() {\n\t\tif (this.accessibleName) {\n\t\t\treturn this.accessibleName;\n\t\t}\n\n\t\tconst defaultLabel = Avatar.i18nBundle.getText(AVATAR_TOOLTIP);\n\n\t\treturn this.initials ? `${defaultLabel} ${this.initials}`.trim() : defaultLabel;\n\t}\n\n\tget hasImage() {\n\t\treturn !!this.image.length;\n\t}\n\n\tget initialsContainer(): HTMLObjectElement | null {\n\t\treturn this.getDomRef()!.querySelector(\".ui5-avatar-initials\");\n\t}\n\n\tget fallBackIconDomRef(): Icon | null {\n\t\treturn this.getDomRef()!.querySelector(\".ui5-avatar-icon-fallback\");\n\t}\n\n\tasync onAfterRendering() {\n\t\tawait renderFinished();\n\t\tif (this.initials && !this.icon) {\n\t\t\tthis._checkInitials();\n\t\t}\n\t}\n\n\tonEnterDOM() {\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\n\t\tthis.initialsContainer && ResizeHandler.register(this.initialsContainer,\n\t\t\tthis._handleResizeBound);\n\t}\n\n\tonExitDOM() {\n\t\tthis.initialsContainer && ResizeHandler.deregister(this.initialsContainer,\n\t\t\tthis._handleResizeBound);\n\t}\n\n\thandleResize() {\n\t\tif (this.initials && !this.icon) {\n\t\t\tthis._checkInitials();\n\t\t}\n\t}\n\n\t_checkInitials() {\n\t\tconst avatar = this.getDomRef()!;\n\t\tconst avatarInitials = avatar.querySelector(\".ui5-avatar-initials\");\n\t\tconst validInitials = this.validInitials && avatarInitials && avatarInitials.scrollWidth <= avatar.scrollWidth;\n\n\t\tif (validInitials) {\n\t\t\tthis.showInitials();\n\t\t\treturn;\n\t\t}\n\t\tthis.showFallbackIcon();\n\t}\n\n\tshowFallbackIcon() {\n\t\tthis.initialsContainer?.classList.add(\"ui5-avatar-initials-hidden\");\n\t\tthis.fallBackIconDomRef?.classList.remove(\"ui5-avatar-fallback-icon-hidden\");\n\t}\n\n\tshowInitials() {\n\t\tthis.initialsContainer?.classList.remove(\"ui5-avatar-initials-hidden\");\n\t\tthis.fallBackIconDomRef?.classList.add(\"ui5-avatar-fallback-icon-hidden\");\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\te.stopPropagation();\n\t\tthis._fireClick();\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (!this._interactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis._fireClick();\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault(); // prevent scrolling\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (this._interactive && !e.shiftKey && isSpace(e)) {\n\t\t\tthis._fireClick();\n\t\t}\n\t}\n\n\t_fireClick() {\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t_getAriaHasPopup() {\n\t\tconst ariaHaspopup = this.accessibilityAttributes.hasPopup;\n\n\t\tif (!this._interactive || !ariaHaspopup) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn ariaHaspopup;\n\t}\n}\n\nAvatar.define();\n\nexport default Avatar;\nexport type {\n\tAvatarAccessibilityAttributes,\n};\n"]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O,EAAE,CAAC;yCACV;AAMlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;+CACvB;AAaxB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;qCAClB;AAY3B;IADC,IAAI,EAAE;qCACoB;AAGpB;IADN,IAAI,CAAC,oBAAoB,CAAC;gCACG;AA9KzB,MAAM;IAlBX,aAAa,CAAC;QACd,GAAG,EAAE,YAAY;QACjB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,cAAc;KACxB,CAAC;IACF;;;;;;;OAOG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;KACb,CAAC;GACI,MAAM,CAoaX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,eAAe,MAAM,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 i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { ITabbable } from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport { isEnter, isSpace } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport type { IAvatarGroupItem } from \"./AvatarGroup.js\";\n// Template\nimport AvatarTemplate from \"./AvatarTemplate.js\";\n\nimport { AVATAR_TOOLTIP } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport AvatarCss from \"./generated/themes/Avatar.css.js\";\n\nimport type Icon from \"./Icon.js\";\nimport AvatarSize from \"./types/AvatarSize.js\";\nimport type AvatarShape from \"./types/AvatarShape.js\";\nimport type AvatarColorScheme from \"./types/AvatarColorScheme.js\";\n\n// Icon\nimport \"@ui5/webcomponents-icons/dist/employee.js\";\n\ntype AvatarAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\">;\n\n/**\n * @class\n * ### Overview\n *\n * An image-like component that has different display options for representing images and icons\n * in different shapes and sizes, depending on the use case.\n *\n * The shape can be circular or square. There are several predefined sizes, as well as an option to\n * set a custom size.\n *\n * ### Keyboard Handling\n *\n * - [Space] / [Enter] or [Return] - Fires the `click` event if the `interactive` property is set to true.\n * - [Shift] - If [Space] is pressed, pressing [Shift] releases the component without triggering the click event.\n *\n * ### ES6 Module Import\n * `import \"@ui5/webcomponents/dist/Avatar.js\";`\n * @constructor\n * @extends UI5Element\n * @since 1.0.0-rc.6\n * @implements {IAvatarGroupItem}\n * @public\n */\n@customElement({\n\ttag: \"ui5-avatar\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\tstyles: AvatarCss,\n\ttemplate: AvatarTemplate,\n})\n/**\n * Fired on mouseup, space and enter if avatar is interactive\n *\n * **Note:** The event will not be fired if the `disabled`\n * property is set to `true`.\n * @public\n * @since 2.11.0\n */\n@event(\"click\", {\n\tbubbles: true,\n})\nclass Avatar extends UI5Element implements ITabbable, IAvatarGroupItem {\n\teventDetails!: {\n\t\tclick: void,\n\t}\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines if the avatar is interactive (focusable and pressable).\n\t *\n\t * **Note:** This property won't have effect if the `disabled`\n\t * property is set to `true`.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tinteractive = false;\n\n\t/**\n\t * Defines the name of the UI5 Icon, that will be displayed.\n\t *\n\t * **Note:** If `image` slot is provided, the property will be ignored.\n\t *\n\t * **Note:** You should import the desired icon first, then use its name as \"icon\".\n\t *\n\t * `import \"@ui5/webcomponents-icons/dist/{icon_name}.js\"`\n\t *\n\t * `<ui5-avatar icon=\"employee\">`\n\t *\n\t * **Note:** If no icon or an empty one is provided, by default the \"employee\" icon should be displayed.\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines the name of the fallback icon, which should be displayed in the following cases:\n\t *\n\t * \t- If the initials are not valid (more than 3 letters, unsupported languages or empty initials).\n\t * \t- If there are three initials and they do not fit in the shape (e.g. WWW for some of the sizes).\n\t * \t- If the image src is wrong.\n\t *\n\t * **Note:** If not set, a default fallback icon \"employee\" is displayed.\n\t *\n\t * **Note:** You should import the desired icon first, then use its name as \"fallback-icon\".\n\t *\n\t * `import \"@ui5/webcomponents-icons/dist/{icon_name}.js\"`\n\t *\n\t * `<ui5-avatar fallback-icon=\"alert\">`\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default \"employee\"\n\t * @public\n\t */\n\t@property()\n\tfallbackIcon = \"employee\";\n\n\t/**\n\t * Defines the displayed initials.\n\t *\n\t * Up to three Latin letters can be displayed as initials.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tinitials?: string;\n\n\t/**\n\t * Defines the shape of the component.\n\t * @default \"Circle\"\n\t * @public\n\t */\n\t@property()\n\tshape: `${AvatarShape}` = \"Circle\";\n\n\t/**\n\t * Defines predefined size of the component.\n\t * @default \"S\"\n\t * @public\n\t */\n\t@property()\n\tsize: `${AvatarSize}` = \"S\";\n\n\t/**\n\t * Defines the background color of the desired image.\n\t * If `colorScheme` is set to `Auto`, the avatar will be displayed with the `Accent6` color.\n\t *\n\t * @default \"Auto\"\n\t * @public\n\t */\n\t@property()\n\tcolorScheme: `${AvatarColorScheme}` = \"Auto\";\n\n\t/**\n\t * @private\n\t */\n\t@property()\n\t_colorScheme: `${AvatarColorScheme}` = \"Auto\";\n\n\t/**\n\t * Defines the text alternative of the component.\n\t * If not provided a default text alternative will be set, if present.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.7\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The following field is supported:\n\t *\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.\n\t * Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.\n\t *\n\t * @public\n\t * @since 2.0.0\n\t * @default {}\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: AvatarAccessibilityAttributes = {};\n\n\t@property({ noAttribute: true })\n\tforcedTabIndex?: string;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_hasImage = false;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_imageLoadError = false;\n\n\t/**\n\t * Receives the desired `<img>` tag\n\t *\n\t * **Note:** If you experience flickering of the provided image, you can hide the component until it is defined with the following CSS:<br/>\n\t * `ui5-avatar:not(:defined) {`<br/>\n\t * `visibility: hidden;`<br/>\n\t * `}`\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\timage!: Array<HTMLElement>;\n\n\t/**\n\t * Defines the optional badge that will be used for visual affordance.\n\t *\n\t * **Note:** While the slot allows for custom badges, to achieve\n\t * the Fiori design, you can use the `ui5-tag` with `ui5-icon`\n\t * in the corresponding `icon` slot, without text nodes.\n\t * @public\n\t * @since 1.7.0\n\t */\n\t@slot()\n\tbadge!: Array<HTMLElement>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\t_handleResizeBound: ResizeObserverCallback;\n\t_onImageLoadBound: (e: Event) => void;\n\t_onImageErrorBound: (e: Event) => void;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._handleResizeBound = this.handleResize.bind(this);\n\t\tthis._onImageLoadBound = this._onImageLoad.bind(this);\n\t\tthis._onImageErrorBound = this._onImageError.bind(this);\n\t}\n\n\tonBeforeRendering() {\n\t\tthis._attachImageEventHandlers();\n\t\tthis._hasImage = this.hasImage;\n\t}\n\n\tget tabindex() {\n\t\tif (this.forcedTabIndex) {\n\t\t\treturn parseInt(this.forcedTabIndex);\n\t\t}\n\t\treturn this._interactive ? 0 : undefined;\n\t}\n\n\t/**\n\t * Returns the effective avatar size.\n\t * @default \"S\"\n\t * @private\n\t */\n\tget effectiveSize(): AvatarSize {\n\t\t// we read the attribute, because the \"size\" property will always have a default value\n\t\treturn this.getAttribute(\"size\") as AvatarSize || AvatarSize.S;\n\t}\n\n\t/**\n\t * Returns the effective background color.\n\t * @default \"Auto\"\n\t * @private\n\t */\n\tget effectiveBackgroundColor(): AvatarColorScheme {\n\t\t// we read the attribute, because the \"background-color\" property will always have a default value\n\t\treturn this.getAttribute(\"color-scheme\") as AvatarColorScheme || this._colorScheme;\n\t}\n\n\tget _role() {\n\t\treturn this._interactive ? \"button\" : \"img\";\n\t}\n\n\tget _ariaHasPopup() {\n\t\treturn this._getAriaHasPopup();\n\t}\n\n\tget _interactive() {\n\t\treturn this.interactive && !this.disabled;\n\t}\n\n\tget validInitials() {\n\t\t// initials should consist of only 1,2 or 3 latin letters\n\t\tconst validInitials = /^[a-zA-Zà-üÀ-Ü]{1,3}$/,\n\t\t\tareInitialsValid = this.initials && validInitials.test(this.initials);\n\n\t\tif (areInitialsValid) {\n\t\t\treturn this.initials;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tget accessibleNameText() {\n\t\tif (this.accessibleName) {\n\t\t\treturn this.accessibleName;\n\t\t}\n\n\t\tconst defaultLabel = Avatar.i18nBundle.getText(AVATAR_TOOLTIP);\n\n\t\treturn this.initials ? `${defaultLabel} ${this.initials}`.trim() : defaultLabel;\n\t}\n\n\tget hasImage() {\n\t\treturn !!this.image.length && !this._imageLoadError;\n\t}\n\n\tget imageEl(): HTMLImageElement | null {\n\t\treturn this.image?.[0] instanceof HTMLImageElement ? this.image[0] : null;\n\t}\n\n\tget initialsContainer(): HTMLObjectElement | null {\n\t\treturn this.getDomRef()!.querySelector(\".ui5-avatar-initials\");\n\t}\n\n\tget fallBackIconDomRef(): Icon | null {\n\t\treturn this.getDomRef()!.querySelector(\".ui5-avatar-icon-fallback\");\n\t}\n\n\tasync onAfterRendering() {\n\t\tawait renderFinished();\n\t\tif (this.initials && !this.icon) {\n\t\t\tthis._checkInitials();\n\t\t}\n\t}\n\n\tonEnterDOM() {\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\n\t\tthis.initialsContainer && ResizeHandler.register(this.initialsContainer,\n\t\t\tthis._handleResizeBound);\n\t}\n\n\tonExitDOM() {\n\t\tthis.initialsContainer && ResizeHandler.deregister(this.initialsContainer,\n\t\t\tthis._handleResizeBound);\n\n\t\tthis._detachImageEventHandlers();\n\t}\n\n\thandleResize() {\n\t\tif (this.initials && !this.icon) {\n\t\t\tthis._checkInitials();\n\t\t}\n\t}\n\n\t_checkInitials() {\n\t\tconst avatar = this.getDomRef()!;\n\t\tconst avatarInitials = avatar.querySelector(\".ui5-avatar-initials\");\n\t\tconst validInitials = this.validInitials && avatarInitials && avatarInitials.scrollWidth <= avatar.scrollWidth;\n\n\t\tif (validInitials) {\n\t\t\tthis.showInitials();\n\t\t\treturn;\n\t\t}\n\t\tthis.showFallbackIcon();\n\t}\n\n\tshowFallbackIcon() {\n\t\tthis.initialsContainer?.classList.add(\"ui5-avatar-initials-hidden\");\n\t\tthis.fallBackIconDomRef?.classList.remove(\"ui5-avatar-fallback-icon-hidden\");\n\t}\n\n\tshowInitials() {\n\t\tthis.initialsContainer?.classList.remove(\"ui5-avatar-initials-hidden\");\n\t\tthis.fallBackIconDomRef?.classList.add(\"ui5-avatar-fallback-icon-hidden\");\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\te.stopPropagation();\n\t\tthis._fireClick();\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (!this._interactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis._fireClick();\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault(); // prevent scrolling\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (this._interactive && !e.shiftKey && isSpace(e)) {\n\t\t\tthis._fireClick();\n\t\t}\n\t}\n\n\t_fireClick() {\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t_getAriaHasPopup() {\n\t\tconst ariaHaspopup = this.accessibilityAttributes.hasPopup;\n\n\t\tif (!this._interactive || !ariaHaspopup) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn ariaHaspopup;\n\t}\n\n\t_attachImageEventHandlers() {\n\t\tconst imgEl = this.imageEl;\n\t\tif (!imgEl) {\n\t\t\tthis._imageLoadError = false;\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove previous handlers to avoid duplicates\n\t\timgEl.removeEventListener(\"load\", this._onImageLoadBound);\n\t\timgEl.removeEventListener(\"error\", this._onImageErrorBound);\n\n\t\t// Attach new handlers\n\t\timgEl.addEventListener(\"load\", this._onImageLoadBound);\n\t\timgEl.addEventListener(\"error\", this._onImageErrorBound);\n\n\t\t// Check existing image state\n\t\tthis._checkExistingImageState();\n\t}\n\n\t_checkExistingImageState() {\n\t\tconst imgEl = this.imageEl;\n\t\tif (!imgEl) {\n\t\t\tthis._imageLoadError = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (imgEl.complete && imgEl.naturalWidth === 0) {\n\t\t\tthis._imageLoadError = true; // Already broken\n\t\t} else if (imgEl.complete && imgEl.naturalWidth > 0) {\n\t\t\tthis._imageLoadError = false; // Already loaded\n\t\t} else {\n\t\t\tthis._imageLoadError = false; // Pending load\n\t\t}\n\t}\n\n\t_detachImageEventHandlers() {\n\t\tconst imgEl = this.imageEl;\n\t\tif (!imgEl) {\n\t\t\treturn;\n\t\t}\n\n\t\timgEl.removeEventListener(\"load\", this._onImageLoadBound);\n\t\timgEl.removeEventListener(\"error\", this._onImageErrorBound);\n\t}\n\n\t_onImageLoad(e: Event) {\n\t\tif (e.target !== this.imageEl) {\n\t\t\t(e.target as HTMLImageElement)?.removeEventListener(\"load\", this._onImageLoadBound);\n\t\t\treturn;\n\t\t}\n\t\tthis._imageLoadError = false;\n\t}\n\n\t_onImageError(e: Event) {\n\t\tif (e.target !== this.imageEl) {\n\t\t\t(e.target as HTMLImageElement)?.removeEventListener(\"error\", this._onImageErrorBound);\n\t\t\treturn;\n\t\t}\n\t\tthis._imageLoadError = true;\n\t}\n}\n\nAvatar.define();\n\nexport default Avatar;\nexport type {\n\tAvatarAccessibilityAttributes,\n};\n"]}
|
package/dist/AvatarTemplate.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@ui5/webcomponents-base/jsx-runtime";
|
|
2
2
|
import Icon from "./Icon.js";
|
|
3
3
|
export default function AvatarTemplate() {
|
|
4
|
-
return (_jsxs("div", { class: "ui5-avatar-root", tabindex: this.tabindex, "data-sap-focus-ref": true, role: this._role, "aria-haspopup": this._ariaHasPopup, "aria-label": this.accessibleNameText, onKeyUp: this._onkeyup, onKeyDown: this._onkeydown, onClick: this._onclick, children: [this.
|
|
4
|
+
return (_jsxs("div", { class: "ui5-avatar-root", tabindex: this.tabindex, "data-sap-focus-ref": true, role: this._role, "aria-haspopup": this._ariaHasPopup, "aria-label": this.accessibleNameText, onKeyUp: this._onkeyup, onKeyDown: this._onkeydown, onClick: this._onclick, children: [this._hasImage ?
|
|
5
5
|
_jsx("slot", {})
|
|
6
|
-
:
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
: _jsxs(_Fragment, { children: [this.icon && _jsx(Icon, { class: "ui5-avatar-icon", name: this.icon, accessibleName: this.accessibleName }), this.initials ? (_jsxs(_Fragment, { children: [_jsx("span", { class: "ui5-avatar-initials ui5-avatar-initials-hidden", children: this.validInitials }), _jsx(Icon, { name: this.fallbackIcon, class: "ui5-avatar-icon ui5-avatar-icon-fallback ui5-avatar-fallback-icon-hidden" })] })) : (
|
|
7
|
+
// Show fallback icon only
|
|
8
|
+
_jsx(Icon, { name: this.fallbackIcon, class: "ui5-avatar-icon ui5-avatar-icon-fallback" }))] }), _jsx("slot", { name: "badge" })] }));
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=AvatarTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarTemplate.js","sourceRoot":"","sources":["../src/AvatarTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,cAAc;IACrC,OAAO,CACN,eACC,KAAK,EAAC,iBAAiB,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,8BAEvB,IAAI,EAAE,IAAI,CAAC,KAAK,mBACD,IAAI,CAAC,aAAa,gBACrB,IAAI,CAAC,kBAAkB,EACnC,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ,aAErB,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"AvatarTemplate.js","sourceRoot":"","sources":["../src/AvatarTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,cAAc;IACrC,OAAO,CACN,eACC,KAAK,EAAC,iBAAiB,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,8BAEvB,IAAI,EAAE,IAAI,CAAC,KAAK,mBACD,IAAI,CAAC,aAAa,gBACrB,IAAI,CAAC,kBAAkB,EACnC,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ,aAErB,IAAI,CAAC,SAAS,CAAC,CAAC;gBAChB,gBAAa;gBACb,CAAC,CAAC,8BACA,IAAI,CAAC,IAAI,IAAI,KAAC,IAAI,IAAC,KAAK,EAAC,iBAAiB,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,GAAS,EAExG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAChB,8BAEC,eAAM,KAAK,EAAC,gDAAgD,YAAE,IAAI,CAAC,aAAa,GAAQ,EACxF,KAAC,IAAI,IACJ,IAAI,EAAE,IAAI,CAAC,YAAY,EACvB,KAAK,EAAC,0EAA0E,GACzE,IACN,CACH,CAAC,CAAC,CAAC;wBACH,0BAA0B;wBAC1B,KAAC,IAAI,IACJ,IAAI,EAAE,IAAI,CAAC,YAAY,EACvB,KAAK,EAAC,0CAA0C,GACzC,CACR,IACC,EAGJ,eAAM,IAAI,EAAC,OAAO,GAAQ,IACrB,CACN,CAAC;AACH,CAAC","sourcesContent":["import type Avatar from \"./Avatar.js\";\nimport Icon from \"./Icon.js\";\n\nexport default function AvatarTemplate(this: Avatar) {\n\treturn (\n\t\t<div\n\t\t\tclass=\"ui5-avatar-root\"\n\t\t\ttabindex={this.tabindex}\n\t\t\tdata-sap-focus-ref\n\t\t\trole={this._role}\n\t\t\taria-haspopup={this._ariaHasPopup}\n\t\t\taria-label={this.accessibleNameText}\n\t\t\tonKeyUp={this._onkeyup}\n\t\t\tonKeyDown={this._onkeydown}\n\t\t\tonClick={this._onclick}\n\t\t>\n\t\t\t{this._hasImage ?\n\t\t\t\t<slot></slot>\n\t\t\t\t: <>\n\t\t\t\t\t{this.icon && <Icon class=\"ui5-avatar-icon\" name={this.icon} accessibleName={this.accessibleName}></Icon>}\n\n\t\t\t\t\t{this.initials ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{/* Show initials + hidden fallback icon */}\n\t\t\t\t\t\t\t<span class=\"ui5-avatar-initials ui5-avatar-initials-hidden\">{this.validInitials}</span>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\tname={this.fallbackIcon}\n\t\t\t\t\t\t\t\tclass=\"ui5-avatar-icon ui5-avatar-icon-fallback ui5-avatar-fallback-icon-hidden\"\n\t\t\t\t\t\t\t></Icon>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t// Show fallback icon only\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tname={this.fallbackIcon}\n\t\t\t\t\t\t\tclass=\"ui5-avatar-icon ui5-avatar-icon-fallback\"\n\t\t\t\t\t\t></Icon>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t}\n\n\t\t\t<slot name=\"badge\"></slot>\n\t\t</div>\n\t);\n}\n"]}
|
package/dist/BusyIndicator.d.ts
CHANGED
|
@@ -93,6 +93,7 @@ declare class BusyIndicator extends UI5Element {
|
|
|
93
93
|
top: boolean | "" | undefined;
|
|
94
94
|
bottom: boolean | "" | undefined;
|
|
95
95
|
};
|
|
96
|
+
get hasContent(): boolean;
|
|
96
97
|
onBeforeRendering(): void;
|
|
97
98
|
_handleKeydown(e: KeyboardEvent): void;
|
|
98
99
|
_preventEvent(e: KeyboardEvent): void;
|
package/dist/BusyIndicator.js
CHANGED
|
@@ -12,6 +12,7 @@ import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
|
12
12
|
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
|
13
13
|
import { isTabNext } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
14
14
|
import { isDesktop, } from "@ui5/webcomponents-base/dist/Device.js";
|
|
15
|
+
import willShowContent from "@ui5/webcomponents-base/dist/util/willShowContent.js";
|
|
15
16
|
import BusyIndicatorTextPlacement from "./types/BusyIndicatorTextPlacement.js";
|
|
16
17
|
// Template
|
|
17
18
|
import BusyIndicatorTemplate from "./BusyIndicatorTemplate.js";
|
|
@@ -123,6 +124,9 @@ let BusyIndicator = BusyIndicator_1 = class BusyIndicator extends UI5Element {
|
|
|
123
124
|
bottom: this.text && this.textPlacement === BusyIndicatorTextPlacement.Bottom,
|
|
124
125
|
};
|
|
125
126
|
}
|
|
127
|
+
get hasContent() {
|
|
128
|
+
return willShowContent(Array.from(this.children));
|
|
129
|
+
}
|
|
126
130
|
onBeforeRendering() {
|
|
127
131
|
if (this.active) {
|
|
128
132
|
if (!this._isBusy && !this._busyTimeoutId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BusyIndicator.js","sourceRoot":"","sources":["../src/BusyIndicator.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,WAAW,MAAM,sDAAsD,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,OAAO,EACN,SAAS,GACT,MAAM,wCAAwC,CAAC;AAEhD,OAAO,0BAA0B,MAAM,uCAAuC,CAAC;AAE/E,WAAW;AACX,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,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,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 i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { isTabNext } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport type { Timeout } from \"@ui5/webcomponents-base/dist/types.js\";\nimport {\n\tisDesktop,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport type BusyIndicatorSize from \"./types/BusyIndicatorSize.js\";\nimport BusyIndicatorTextPlacement from \"./types/BusyIndicatorTextPlacement.js\";\n\n// Template\nimport BusyIndicatorTemplate from \"./BusyIndicatorTemplate.js\";\n\nimport { BUSY_INDICATOR_TITLE } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport busyIndicatorCss from \"./generated/themes/BusyIndicator.css.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-busy-indicator` signals that some operation is going on and that the\n * user must wait. It does not block the current UI screen so other operations could be triggered in parallel.\n * It displays 3 dots and each dot expands and shrinks at a different rate, resulting in a cascading flow of animation.\n *\n * ### Usage\n * For the `ui5-busy-indicator` you can define the size, the text and whether it is shown or hidden.\n * In order to hide it, use the \"active\" property.\n *\n * In order to show busy state over an HTML element, simply nest the HTML element in a `ui5-busy-indicator` instance.\n *\n * **Note:** Since `ui5-busy-indicator` has `display: inline-block;` by default and no width of its own,\n * whenever you need to wrap a block-level element, you should set `display: block` to the busy indicator as well.\n *\n * #### When to use:\n *\n * - The user needs to be able to cancel the operation.\n * - Only part of the application or a particular component is affected.\n *\n * #### When not to use:\n *\n * - The operation takes less than one second.\n * - You need to block the screen and prevent the user from starting another activity.\n * - Do not show multiple busy indicators at once.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/BusyIndicator.js\";`\n * @constructor\n * @extends UI5Element\n * @public\n * @slot {Array<Node>} default - Determines the content over which the component will appear.\n * @since 0.12.0\n */\n@customElement({\n\ttag: \"ui5-busy-indicator\",\n\tlanguageAware: true,\n\tstyles: busyIndicatorCss,\n\trenderer: jsxRenderer,\n\ttemplate: BusyIndicatorTemplate,\n})\nclass BusyIndicator extends UI5Element {\n\t/**\n\t * Defines text to be displayed below the component. It can be used to inform the user of the current operation.\n\t * @public\n\t * @default undefined\n\t * @since 1.0.0-rc.7\n\t */\n\t@property()\n\ttext?: string;\n\n\t/**\n\t * Defines the size of the component.\n\t * @default \"M\"\n\t * @public\n\t */\n\t@property()\n\tsize: `${BusyIndicatorSize}` = \"M\";\n\n\t/**\n\t * Defines if the busy indicator is visible on the screen. By default it is not.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tactive = false;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the busy indicator will be visible on the screen.\n\t * @default 1000\n\t * @public\n\t */\n\t@property({ type: Number })\n\tdelay = 1000;\n\n\t/**\n\t * Defines the placement of the text.\n\t *\n\t * @default \"Bottom\"\n\t * @public\n\t */\n\t@property()\n\ttextPlacement: `${BusyIndicatorTextPlacement}` = \"Bottom\";\n\n\t/**\n\t * Defines if the component is currently in busy state.\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_isBusy = false;\n\n\t_keydownHandler: (e: KeyboardEvent) => void;\n\t_preventEventHandler: (e: KeyboardEvent) => void;\n\t_busyTimeoutId?: Timeout;\n\tfocusForward?: boolean;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._keydownHandler = this._handleKeydown.bind(this);\n\t\tthis._preventEventHandler = this._preventEvent.bind(this);\n\t}\n\n\tonEnterDOM() {\n\t\tthis.addEventListener(\"keydown\", this._keydownHandler, {\n\t\t\tcapture: true,\n\t\t});\n\t\tthis.addEventListener(\"keyup\", this._preventEventHandler, {\n\t\t\tcapture: true,\n\t\t});\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\t}\n\n\tonExitDOM() {\n\t\tif (this._busyTimeoutId) {\n\t\t\tclearTimeout(this._busyTimeoutId);\n\t\t\tdelete this._busyTimeoutId;\n\t\t}\n\n\t\tthis.removeEventListener(\"keydown\", this._keydownHandler, true);\n\t\tthis.removeEventListener(\"keyup\", this._preventEventHandler, true);\n\t}\n\n\tget ariaTitle() {\n\t\treturn BusyIndicator.i18nBundle.getText(BUSY_INDICATOR_TITLE);\n\t}\n\n\tget labelId() {\n\t\treturn this.text ? `${this._id}-label` : undefined;\n\t}\n\n\tget textPosition() {\n\t\treturn {\n\t\t\ttop: this.text && this.textPlacement === BusyIndicatorTextPlacement.Top,\n\t\t\tbottom: this.text && this.textPlacement === BusyIndicatorTextPlacement.Bottom,\n\t\t};\n\t}\n\n\tonBeforeRendering() {\n\t\tif (this.active) {\n\t\t\tif (!this._isBusy && !this._busyTimeoutId) {\n\t\t\t\tthis._busyTimeoutId = setTimeout(() => {\n\t\t\t\t\tdelete this._busyTimeoutId;\n\t\t\t\t\tthis._isBusy = true;\n\t\t\t\t}, Math.max(0, this.delay));\n\t\t\t}\n\t\t} else {\n\t\t\tif (this._busyTimeoutId) {\n\t\t\t\tclearTimeout(this._busyTimeoutId);\n\t\t\t\tdelete this._busyTimeoutId;\n\t\t\t}\n\t\t\tthis._isBusy = false;\n\t\t}\n\t}\n\n\t_handleKeydown(e: KeyboardEvent) {\n\t\tif (!this._isBusy) {\n\t\t\treturn;\n\t\t}\n\n\t\te.stopImmediatePropagation();\n\n\t\t// move the focus to the last element in this DOM and let TAB continue to the next focusable element\n\t\tif (isTabNext(e)) {\n\t\t\tthis.focusForward = true;\n\t\t\tthis.shadowRoot!.querySelector<HTMLElement>(\"[data-ui5-focus-redirect]\")!.focus();\n\t\t\tthis.focusForward = false;\n\t\t}\n\t}\n\n\t_preventEvent(e: KeyboardEvent) {\n\t\tif (this._isBusy) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\t}\n\n\t/**\n\t * Moves the focus to busy area when coming with SHIFT + TAB\n\t */\n\t_redirectFocus(e: FocusEvent) {\n\t\tif (this.focusForward) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\t\tthis.shadowRoot!.querySelector<HTMLElement>(\".ui5-busy-indicator-busy-area\")!.focus();\n\t}\n}\n\nBusyIndicator.define();\n\nexport default BusyIndicator;\n"]}
|
|
1
|
+
{"version":3,"file":"BusyIndicator.js","sourceRoot":"","sources":["../src/BusyIndicator.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,WAAW,MAAM,sDAAsD,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,OAAO,EACN,SAAS,GACT,MAAM,wCAAwC,CAAC;AAChD,OAAO,eAAe,MAAM,sDAAsD,CAAC;AAEnF,OAAO,0BAA0B,MAAM,uCAAuC,CAAC;AAE/E,WAAW;AACX,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,SAAS;AACT,OAAO,gBAAgB,MAAM,yCAAyC,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAQH,IAAM,aAAa,qBAAnB,MAAM,aAAc,SAAQ,UAAU;IA0DrC;QACC,KAAK,EAAE,CAAC;QAjDT;;;;WAIG;QAEH,SAAI,GAA2B,GAAG,CAAC;QAEnC;;;;WAIG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AAI,CAAC,UAAW,CAAC,aAAa,CAAc,2BAA2B,CAAE,CAAC,KAAK,EAAE,CAAC;YAClF,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC3B,CAAC;IACF,CAAC;IAED,aAAa,CAAC,CAAgB;QAC7B,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,CAAC,CAAC,wBAAwB,EAAE,CAAC;QAC9B,CAAC;IACF,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,CAAa;QAC3B,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,OAAO;QACR,CAAC;QAED,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,IAAI,CAAC,UAAW,CAAC,aAAa,CAAc,+BAA+B,CAAE,CAAC,KAAK,EAAE,CAAC;IACvF,CAAC;CACD,CAAA;AAlJA;IADC,QAAQ,EAAE;2CACG;AAQd;IADC,QAAQ,EAAE;2CACwB;AAQnC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CACb;AAQf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CACd;AASb;IADC,QAAQ,EAAE;oDAC+C;AAO1D;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACZ;AAQT;IADN,IAAI,CAAC,oBAAoB,CAAC;uCACG;AAxDzB,aAAa;IAPlB,aAAa,CAAC;QACd,GAAG,EAAE,oBAAoB;QACzB,aAAa,EAAE,IAAI;QACnB,MAAM,EAAE,gBAAgB;QACxB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,qBAAqB;KAC/B,CAAC;GACI,aAAa,CA0JlB;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 i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { isTabNext } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport type { Timeout } from \"@ui5/webcomponents-base/dist/types.js\";\nimport {\n\tisDesktop,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport willShowContent from \"@ui5/webcomponents-base/dist/util/willShowContent.js\";\nimport type BusyIndicatorSize from \"./types/BusyIndicatorSize.js\";\nimport BusyIndicatorTextPlacement from \"./types/BusyIndicatorTextPlacement.js\";\n\n// Template\nimport BusyIndicatorTemplate from \"./BusyIndicatorTemplate.js\";\n\nimport { BUSY_INDICATOR_TITLE } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport busyIndicatorCss from \"./generated/themes/BusyIndicator.css.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-busy-indicator` signals that some operation is going on and that the\n * user must wait. It does not block the current UI screen so other operations could be triggered in parallel.\n * It displays 3 dots and each dot expands and shrinks at a different rate, resulting in a cascading flow of animation.\n *\n * ### Usage\n * For the `ui5-busy-indicator` you can define the size, the text and whether it is shown or hidden.\n * In order to hide it, use the \"active\" property.\n *\n * In order to show busy state over an HTML element, simply nest the HTML element in a `ui5-busy-indicator` instance.\n *\n * **Note:** Since `ui5-busy-indicator` has `display: inline-block;` by default and no width of its own,\n * whenever you need to wrap a block-level element, you should set `display: block` to the busy indicator as well.\n *\n * #### When to use:\n *\n * - The user needs to be able to cancel the operation.\n * - Only part of the application or a particular component is affected.\n *\n * #### When not to use:\n *\n * - The operation takes less than one second.\n * - You need to block the screen and prevent the user from starting another activity.\n * - Do not show multiple busy indicators at once.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/BusyIndicator.js\";`\n * @constructor\n * @extends UI5Element\n * @public\n * @slot {Array<Node>} default - Determines the content over which the component will appear.\n * @since 0.12.0\n */\n@customElement({\n\ttag: \"ui5-busy-indicator\",\n\tlanguageAware: true,\n\tstyles: busyIndicatorCss,\n\trenderer: jsxRenderer,\n\ttemplate: BusyIndicatorTemplate,\n})\nclass BusyIndicator extends UI5Element {\n\t/**\n\t * Defines text to be displayed below the component. It can be used to inform the user of the current operation.\n\t * @public\n\t * @default undefined\n\t * @since 1.0.0-rc.7\n\t */\n\t@property()\n\ttext?: string;\n\n\t/**\n\t * Defines the size of the component.\n\t * @default \"M\"\n\t * @public\n\t */\n\t@property()\n\tsize: `${BusyIndicatorSize}` = \"M\";\n\n\t/**\n\t * Defines if the busy indicator is visible on the screen. By default it is not.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tactive = false;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the busy indicator will be visible on the screen.\n\t * @default 1000\n\t * @public\n\t */\n\t@property({ type: Number })\n\tdelay = 1000;\n\n\t/**\n\t * Defines the placement of the text.\n\t *\n\t * @default \"Bottom\"\n\t * @public\n\t */\n\t@property()\n\ttextPlacement: `${BusyIndicatorTextPlacement}` = \"Bottom\";\n\n\t/**\n\t * Defines if the component is currently in busy state.\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_isBusy = false;\n\n\t_keydownHandler: (e: KeyboardEvent) => void;\n\t_preventEventHandler: (e: KeyboardEvent) => void;\n\t_busyTimeoutId?: Timeout;\n\tfocusForward?: boolean;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._keydownHandler = this._handleKeydown.bind(this);\n\t\tthis._preventEventHandler = this._preventEvent.bind(this);\n\t}\n\n\tonEnterDOM() {\n\t\tthis.addEventListener(\"keydown\", this._keydownHandler, {\n\t\t\tcapture: true,\n\t\t});\n\t\tthis.addEventListener(\"keyup\", this._preventEventHandler, {\n\t\t\tcapture: true,\n\t\t});\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\t}\n\n\tonExitDOM() {\n\t\tif (this._busyTimeoutId) {\n\t\t\tclearTimeout(this._busyTimeoutId);\n\t\t\tdelete this._busyTimeoutId;\n\t\t}\n\n\t\tthis.removeEventListener(\"keydown\", this._keydownHandler, true);\n\t\tthis.removeEventListener(\"keyup\", this._preventEventHandler, true);\n\t}\n\n\tget ariaTitle() {\n\t\treturn BusyIndicator.i18nBundle.getText(BUSY_INDICATOR_TITLE);\n\t}\n\n\tget labelId() {\n\t\treturn this.text ? `${this._id}-label` : undefined;\n\t}\n\n\tget textPosition() {\n\t\treturn {\n\t\t\ttop: this.text && this.textPlacement === BusyIndicatorTextPlacement.Top,\n\t\t\tbottom: this.text && this.textPlacement === BusyIndicatorTextPlacement.Bottom,\n\t\t};\n\t}\n\n\tget hasContent() {\n\t\treturn willShowContent(Array.from(this.children));\n\t}\n\n\tonBeforeRendering() {\n\t\tif (this.active) {\n\t\t\tif (!this._isBusy && !this._busyTimeoutId) {\n\t\t\t\tthis._busyTimeoutId = setTimeout(() => {\n\t\t\t\t\tdelete this._busyTimeoutId;\n\t\t\t\t\tthis._isBusy = true;\n\t\t\t\t}, Math.max(0, this.delay));\n\t\t\t}\n\t\t} else {\n\t\t\tif (this._busyTimeoutId) {\n\t\t\t\tclearTimeout(this._busyTimeoutId);\n\t\t\t\tdelete this._busyTimeoutId;\n\t\t\t}\n\t\t\tthis._isBusy = false;\n\t\t}\n\t}\n\n\t_handleKeydown(e: KeyboardEvent) {\n\t\tif (!this._isBusy) {\n\t\t\treturn;\n\t\t}\n\n\t\te.stopImmediatePropagation();\n\n\t\t// move the focus to the last element in this DOM and let TAB continue to the next focusable element\n\t\tif (isTabNext(e)) {\n\t\t\tthis.focusForward = true;\n\t\t\tthis.shadowRoot!.querySelector<HTMLElement>(\"[data-ui5-focus-redirect]\")!.focus();\n\t\t\tthis.focusForward = false;\n\t\t}\n\t}\n\n\t_preventEvent(e: KeyboardEvent) {\n\t\tif (this._isBusy) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\t}\n\n\t/**\n\t * Moves the focus to busy area when coming with SHIFT + TAB\n\t */\n\t_redirectFocus(e: FocusEvent) {\n\t\tif (this.focusForward) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\t\tthis.shadowRoot!.querySelector<HTMLElement>(\".ui5-busy-indicator-busy-area\")!.focus();\n\t}\n}\n\nBusyIndicator.define();\n\nexport default BusyIndicator;\n"]}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ui5/webcomponents-base/jsx-runtime";
|
|
2
2
|
import Label from "./Label.js";
|
|
3
3
|
export default function BusyIndicatorTemplate() {
|
|
4
|
-
return (_jsxs("div", { class: "ui5-busy-indicator-root", children: [this._isBusy && (_jsxs("div", { class:
|
|
4
|
+
return (_jsxs("div", { class: "ui5-busy-indicator-root", children: [this._isBusy && (_jsxs("div", { class: {
|
|
5
|
+
"ui5-busy-indicator-busy-area": true,
|
|
6
|
+
"ui5-busy-indicator-busy-area-over-content": this.hasContent,
|
|
7
|
+
}, title: this.ariaTitle, tabindex: 0, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuetext": "Busy", "aria-labelledby": this.labelId, "data-sap-focus-ref": true, children: [this.textPosition.top && BusyIndicatorBusyText.call(this), _jsxs("div", { class: "ui5-busy-indicator-circles-wrapper", children: [_jsx("div", { class: "ui5-busy-indicator-circle circle-animation-0" }), _jsx("div", { class: "ui5-busy-indicator-circle circle-animation-1" }), _jsx("div", { class: "ui5-busy-indicator-circle circle-animation-2" })] }), this.textPosition.bottom && BusyIndicatorBusyText.call(this)] })), _jsx("slot", {}), this._isBusy && (_jsx("span", { "data-ui5-focus-redirect": true, tabindex: 0, role: "none", onFocusIn: this._redirectFocus }))] }));
|
|
5
8
|
}
|
|
6
9
|
function BusyIndicatorBusyText() {
|
|
7
10
|
return (_jsx(_Fragment, { children: this.text && (_jsx(Label, { id: `${this._id}-label`, class: "ui5-busy-indicator-text", children: this.text })) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BusyIndicatorTemplate.js","sourceRoot":"","sources":["../src/BusyIndicatorTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,MAAM,CAAC,OAAO,UAAU,qBAAqB;IAC5C,OAAO,CACN,eAAK,KAAK,EAAC,yBAAyB,aAClC,IAAI,CAAC,OAAO,IAAI,CAChB,eACC,KAAK,
|
|
1
|
+
{"version":3,"file":"BusyIndicatorTemplate.js","sourceRoot":"","sources":["../src/BusyIndicatorTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,MAAM,CAAC,OAAO,UAAU,qBAAqB;IAC5C,OAAO,CACN,eAAK,KAAK,EAAC,yBAAyB,aAClC,IAAI,CAAC,OAAO,IAAI,CAChB,eACC,KAAK,EAAE;oBACN,8BAA8B,EAAE,IAAI;oBACpC,2CAA2C,EAAE,IAAI,CAAC,UAAU;iBAC5D,EACD,KAAK,EAAE,IAAI,CAAC,SAAS,EACrB,QAAQ,EAAE,CAAC,EACX,IAAI,EAAC,aAAa,mBACH,CAAC,mBACD,GAAG,oBACH,MAAM,qBACJ,IAAI,CAAC,OAAO,yCAG5B,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,EAC1D,eAAK,KAAK,EAAC,oCAAoC,aAC9C,cAAK,KAAK,EAAC,8CAA8C,GAAO,EAChE,cAAK,KAAK,EAAC,8CAA8C,GAAO,EAChE,cAAK,KAAK,EAAC,8CAA8C,GAAO,IAC3D,EACL,IAAI,CAAC,YAAY,CAAC,MAAM,IAAI,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,IACxD,CACN,EACD,gBAAa,EACZ,IAAI,CAAC,OAAO,IAAI,CAChB,gDAEC,QAAQ,EAAE,CAAC,EACX,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,IAAI,CAAC,cAAc,GACvB,CACR,IACI,CACN,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB;IAC7B,OAAO,CAAC,4BACN,IAAI,CAAC,IAAI,IAAI,CACb,KAAC,KAAK,IACL,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,QAAQ,EACvB,KAAK,EAAC,yBAAyB,YAE9B,IAAI,CAAC,IAAI,GACH,CACR,GACC,CAAC,CAAC;AACN,CAAC","sourcesContent":["import type BusyIndicator from \"./BusyIndicator.js\";\nimport Label from \"./Label.js\";\n\nexport default function BusyIndicatorTemplate(this: BusyIndicator) {\n\treturn (\n\t\t<div class=\"ui5-busy-indicator-root\">\n\t\t\t{this._isBusy && (\n\t\t\t\t<div\n\t\t\t\t\tclass={{\n\t\t\t\t\t\t\"ui5-busy-indicator-busy-area\": true,\n\t\t\t\t\t\t\"ui5-busy-indicator-busy-area-over-content\": this.hasContent,\n\t\t\t\t\t}}\n\t\t\t\t\ttitle={this.ariaTitle}\n\t\t\t\t\ttabindex={0}\n\t\t\t\t\trole=\"progressbar\"\n\t\t\t\t\taria-valuemin={0}\n\t\t\t\t\taria-valuemax={100}\n\t\t\t\t\taria-valuetext=\"Busy\"\n\t\t\t\t\taria-labelledby={this.labelId}\n\t\t\t\t\tdata-sap-focus-ref\n\t\t\t\t>\n\t\t\t\t\t{this.textPosition.top && BusyIndicatorBusyText.call(this)}\n\t\t\t\t\t<div class=\"ui5-busy-indicator-circles-wrapper\">\n\t\t\t\t\t\t<div class=\"ui5-busy-indicator-circle circle-animation-0\"></div>\n\t\t\t\t\t\t<div class=\"ui5-busy-indicator-circle circle-animation-1\"></div>\n\t\t\t\t\t\t<div class=\"ui5-busy-indicator-circle circle-animation-2\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t{this.textPosition.bottom && BusyIndicatorBusyText.call(this)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<slot></slot>\n\t\t\t{this._isBusy && (\n\t\t\t\t<span\n\t\t\t\t\tdata-ui5-focus-redirect\n\t\t\t\t\ttabindex={0}\n\t\t\t\t\trole=\"none\"\n\t\t\t\t\tonFocusIn={this._redirectFocus}\n\t\t\t\t></span>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction BusyIndicatorBusyText(this: BusyIndicator) {\n\treturn (<>\n\t\t{this.text && (\n\t\t\t<Label\n\t\t\t\tid={`${this._id}-label`}\n\t\t\t\tclass=\"ui5-busy-indicator-text\"\n\t\t\t>\n\t\t\t\t{this.text}\n\t\t\t</Label>\n\t\t)}\n\t</>);\n}\n"]}
|
package/dist/Button.d.ts
CHANGED
|
@@ -234,10 +234,13 @@ declare class Button extends UI5Element implements IButton {
|
|
|
234
234
|
*/
|
|
235
235
|
badge: Array<ButtonBadge>;
|
|
236
236
|
_deactivate: () => void;
|
|
237
|
+
_onclickBound: (e: MouseEvent) => void;
|
|
238
|
+
_clickHandlerAttached: boolean;
|
|
237
239
|
static i18nBundle: I18nBundle;
|
|
238
240
|
constructor();
|
|
239
241
|
_ontouchstart(): void;
|
|
240
242
|
onEnterDOM(): void;
|
|
243
|
+
onExitDOM(): void;
|
|
241
244
|
onBeforeRendering(): Promise<void>;
|
|
242
245
|
_setBadgeOverlayStyle(): void;
|
|
243
246
|
_onclick(e: MouseEvent): void;
|
package/dist/Button.js
CHANGED
|
@@ -166,11 +166,22 @@ let Button = Button_1 = class Button extends UI5Element {
|
|
|
166
166
|
*/
|
|
167
167
|
this._isTouch = false;
|
|
168
168
|
this._cancelAction = false;
|
|
169
|
+
this._clickHandlerAttached = false;
|
|
169
170
|
this._deactivate = () => {
|
|
170
171
|
if (activeButton) {
|
|
171
172
|
activeButton._setActiveState(false);
|
|
172
173
|
}
|
|
173
174
|
};
|
|
175
|
+
this._onclickBound = e => {
|
|
176
|
+
if (e instanceof CustomEvent) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
this._onclick(e);
|
|
180
|
+
};
|
|
181
|
+
if (!this._clickHandlerAttached) {
|
|
182
|
+
this.addEventListener("click", this._onclickBound);
|
|
183
|
+
this._clickHandlerAttached = true;
|
|
184
|
+
}
|
|
174
185
|
if (!isGlobalHandlerAttached) {
|
|
175
186
|
document.addEventListener("mouseup", this._deactivate);
|
|
176
187
|
isGlobalHandlerAttached = true;
|
|
@@ -186,6 +197,16 @@ let Button = Button_1 = class Button extends UI5Element {
|
|
|
186
197
|
if (isDesktop()) {
|
|
187
198
|
this.setAttribute("desktop", "");
|
|
188
199
|
}
|
|
200
|
+
if (!this._clickHandlerAttached) {
|
|
201
|
+
this.addEventListener("click", this._onclickBound);
|
|
202
|
+
this._clickHandlerAttached = true;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
onExitDOM() {
|
|
206
|
+
if (this._clickHandlerAttached) {
|
|
207
|
+
this.removeEventListener("click", this._onclickBound);
|
|
208
|
+
this._clickHandlerAttached = false;
|
|
209
|
+
}
|
|
189
210
|
}
|
|
190
211
|
async onBeforeRendering() {
|
|
191
212
|
this._setBadgeOverlayStyle();
|
|
@@ -218,6 +239,7 @@ let Button = Button_1 = class Button extends UI5Element {
|
|
|
218
239
|
shiftKey,
|
|
219
240
|
});
|
|
220
241
|
if (prevented) {
|
|
242
|
+
e.preventDefault();
|
|
221
243
|
return;
|
|
222
244
|
}
|
|
223
245
|
if (this._isSubmit) {
|
package/dist/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,IAAI,MAAM,iDAAiD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AC;qCAChC;AAKpB;IADN,IAAI,CAAC,oBAAoB,CAAC;gCACG;AAtOzB,MAAM;IAlCX,aAAa,CAAC;QACd,GAAG,EAAE,YAAY;QACjB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,SAAS;QACjB,iBAAiB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;KAC3C,CAAC;IACF;;;;;;;;;;;;OAYG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;IACF;;;OAGG;;IACF,KAAK,CAAC,qBAAqB,EAAE;QAC7B,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;GACI,MAAM,CAkeX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,eAAe,MAAM,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 event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport {\n\tisSpace,\n\tisEnter,\n\tisEscape,\n\tisShift,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { getEffectiveAriaLabelText } from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport type { AccessibilityAttributes, AriaRole } from \"@ui5/webcomponents-base\";\nimport type { ITabbable } from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { getIconAccessibleName } from \"@ui5/webcomponents-base/dist/asset-registries/Icons.js\";\n\nimport {\n\tisDesktop,\n\tisSafari,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport willShowContent from \"@ui5/webcomponents-base/dist/util/willShowContent.js\";\nimport { submitForm, resetForm } from \"@ui5/webcomponents-base/dist/features/InputElementsFormSupport.js\";\nimport { getEnableDefaultTooltips } from \"@ui5/webcomponents-base/dist/config/Tooltips.js\";\nimport toLowercaseEnumValue from \"@ui5/webcomponents-base/dist/util/toLowercaseEnumValue.js\";\nimport ButtonDesign from \"./types/ButtonDesign.js\";\nimport ButtonType from \"./types/ButtonType.js\";\nimport ButtonBadgeDesign from \"./types/ButtonBadgeDesign.js\";\nimport type ButtonAccessibleRole from \"./types/ButtonAccessibleRole.js\";\nimport type ButtonBadge from \"./ButtonBadge.js\";\nimport ButtonTemplate from \"./ButtonTemplate.js\";\nimport {\n\tBUTTON_ARIA_TYPE_ACCEPT,\n\tBUTTON_ARIA_TYPE_REJECT,\n\tBUTTON_ARIA_TYPE_EMPHASIZED,\n\tBUTTON_ARIA_TYPE_ATTENTION,\n\tBUTTON_BADGE_ONE_ITEM,\n\tBUTTON_BADGE_MANY_ITEMS,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport buttonCss from \"./generated/themes/Button.css.js\";\n\n/**\n * Interface for components that may be used as a button inside numerous higher-order components\n * @public\n */\ninterface IButton extends HTMLElement, ITabbable {\n\tnonInteractive: boolean;\n}\n\nlet isGlobalHandlerAttached = false;\nlet activeButton: Button | null = null;\n\ntype ButtonAccessibilityAttributes = Pick<AccessibilityAttributes, \"expanded\" | \"hasPopup\" | \"controls\">;\n\ntype ButtonClickEventDetail = {\n\toriginalEvent: MouseEvent,\n\taltKey: boolean;\n\tctrlKey: boolean;\n\tmetaKey: boolean;\n\tshiftKey: boolean;\n}\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-button` component represents a simple push button.\n * It enables users to trigger actions by clicking or tapping the `ui5-button`, or by pressing\n * certain keyboard keys, such as Enter.\n *\n * ### Usage\n *\n * For the `ui5-button` UI, you can define text, icon, or both. You can also specify\n * whether the text or the icon is displayed first.\n *\n * You can choose from a set of predefined types that offer different\n * styling to correspond to the triggered action.\n *\n * You can set the `ui5-button` as enabled or disabled. An enabled\n * `ui5-button` can be pressed by clicking or tapping it. The button changes\n * its style to provide visual feedback to the user that it is pressed or hovered over with\n * the mouse cursor. A disabled `ui5-button` appears inactive and cannot be pressed.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/Button.js\";`\n * @csspart button - Used to style the native button element\n * @csspart icon - Used to style the icon in the native button element\n * @csspart endIcon - Used to style the end icon in the native button element\n * @constructor\n * @extends UI5Element\n * @implements { IButton }\n * @public\n */\n@customElement({\n\ttag: \"ui5-button\",\n\tformAssociated: true,\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: ButtonTemplate,\n\tstyles: buttonCss,\n\tshadowRootOptions: { delegatesFocus: true },\n})\n/**\n * Fired when the component is activated either with a mouse/tap or by using the Enter or Space key.\n *\n * **Note:** The event will not be fired if the `disabled` property is set to `true`.\n *\n * @since 2.10.0\n * @public\n * @param {Event} originalEvent Returns original event that comes from user's **click** interaction\n * @param {boolean} altKey Returns whether the \"ALT\" key was pressed when the event was triggered.\n * @param {boolean} ctrlKey Returns whether the \"CTRL\" key was pressed when the event was triggered.\n * @param {boolean} metaKey Returns whether the \"META\" key was pressed when the event was triggered.\n * @param {boolean} shiftKey Returns whether the \"SHIFT\" key was pressed when the event was triggered.\n */\n@event(\"click\", {\n\tbubbles: true,\n\tcancelable: true,\n})\n/**\n * Fired whenever the active state of the component changes.\n * @private\n */\n@event(\"active-state-change\", {\n\tbubbles: true,\n\tcancelable: true,\n})\nclass Button extends UI5Element implements IButton {\n\teventDetails!: {\n\t\t\"click\": ButtonClickEventDetail,\n\t\t\"active-state-change\": void,\n\t};\n\n\t/**\n\t * Defines the component design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign: `${ButtonDesign}` = \"Default\";\n\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the icon, displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * Example:\n\t * See all the available icons within the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines the icon, displayed as graphical element within the component after the button text.\n\t *\n\t * **Note:** It is highly recommended to use `endIcon` property only together with `icon` and/or `text` properties.\n\t * Usage of `endIcon` only should be avoided.\n\t *\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * Example:\n\t * See all the available icons within the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tendIcon?: string;\n\n\t/**\n\t * When set to `true`, the component will\n\t * automatically submit the nearest HTML form element on `press`.\n\t *\n\t * **Note:** This property is only applicable within the context of an HTML Form element.`\n\t * @default false\n\t * @public\n\t * @deprecated Set the \"type\" property to \"Submit\" to achieve the same result. The \"submits\" property is ignored if \"type\" is set to any value other than \"Button\".\n\t */\n\t@property({ type: Boolean })\n\tsubmits = false;\n\n\t/**\n\t * Defines the tooltip of the component.\n\t *\n\t * **Note:** A tooltip attribute should be provided for icon-only buttons, in order to represent their exact meaning/function.\n\t * @default undefined\n\t * @public\n\t * @since 1.2.0\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Receives id(or many ids) of the elements that label the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.1.0\n\t */\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The following fields are supported:\n\t *\n\t * - **expanded**: Indicates whether the button, or another grouping element it controls, is currently expanded or collapsed.\n\t * Accepts the following string values: `true` or `false`\n\t *\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.\n\t * Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.\n\t *\n\t * - **controls**: Identifies the element (or elements) whose contents or presence are controlled by the button element.\n\t * Accepts a lowercase string value.\n\t *\n\t * @public\n\t * @since 1.2.0\n\t * @default {}\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: ButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Defines the accessible description of the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.5.0\n\t */\n\t@property()\n\taccessibleDescription?: string;\n\n\t/**\n\t * Defines whether the button has special form-related functionality.\n\t *\n\t * **Note:** This property is only applicable within the context of an HTML Form element.\n\t * @default \"Button\"\n\t * @public\n\t * @since 1.15.0\n\t */\n\t@property()\n\ttype: `${ButtonType}` = \"Button\";\n\n\t/**\n\t * Describes the accessibility role of the button.\n\t *\n\t * **Note:** Use <code>ButtonAccessibleRole.Link</code> role only with a press handler, which performs a navigation. In all other scenarios the default button semantics are recommended.\n\t *\n\t * @default \"Button\"\n\t * @public\n\t * @since 1.23\n\t */\n\t@property()\n\taccessibleRole: `${ButtonAccessibleRole}` = \"Button\";\n\n\t/**\n\t * Used to switch the active state (pressed or not) of the component.\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tactive = false;\n\n\t/**\n\t * Defines if a content has been added to the default slot\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\ticonOnly = false;\n\n\t/**\n\t * Indicates if the elements has a slotted icon\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\thasIcon = false;\n\n\t/**\n\t * Indicates if the elements has a slotted end icon\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\thasEndIcon = false;\n\n\t/**\n\t * Indicates if the element is focusable\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tnonInteractive = false;\n\n\t/**\n\t * The current title of the button, either the tooltip property or the icons tooltip. The tooltip property with higher prio.\n\t * @private\n\t */\n\t@property({ noAttribute: true })\n\tbuttonTitle?: string;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Object })\n\t_iconSettings: object = {};\n\n\t/**\n\t * Defines the tabIndex of the component.\n\t * @private\n\t */\n\t@property({ noAttribute: true })\n\tforcedTabIndex = \"0\";\n\n\t/**\n\t * @since 1.0.0-rc.13\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_isTouch = false;\n\n\t@property({ type: Boolean, noAttribute: true })\n\t_cancelAction = false;\n\n\t/**\n\t * Defines the text of the component.\n\t *\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: Node, \"default\": true })\n\ttext!: Array<Node>;\n\n\t/**\n\t * Adds a badge to the button.\n\t * @since 2.7.0\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, invalidateOnChildChange: true })\n\tbadge!: Array<ButtonBadge>;\n\n\t_deactivate: () => void;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._deactivate = () => {\n\t\t\tif (activeButton) {\n\t\t\t\tactiveButton._setActiveState(false);\n\t\t\t}\n\t\t};\n\n\t\tif (!isGlobalHandlerAttached) {\n\t\t\tdocument.addEventListener(\"mouseup\", this._deactivate);\n\n\t\t\tisGlobalHandlerAttached = true;\n\t\t}\n\t}\n\n\t_ontouchstart() {\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._setActiveState(true);\n\t}\n\n\tonEnterDOM() {\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\t}\n\n\tasync onBeforeRendering() {\n\t\tthis._setBadgeOverlayStyle();\n\n\t\tthis.hasIcon = !!this.icon;\n\t\tthis.hasEndIcon = !!this.endIcon;\n\t\tthis.iconOnly = this.isIconOnly;\n\n\t\tconst defaultTooltip = await this.getDefaultTooltip();\n\t\tthis.buttonTitle = this.iconOnly ? this.tooltip ?? defaultTooltip : this.tooltip;\n\t}\n\n\t_setBadgeOverlayStyle() {\n\t\tconst needsOverflowVisible = this.badge.length && (this.badge[0].design === ButtonBadgeDesign.AttentionDot || this.badge[0].design === ButtonBadgeDesign.OverlayText);\n\n\t\tif (needsOverflowVisible) {\n\t\t\tthis._internals.states.add(\"has-overlay-badge\");\n\t\t} else {\n\t\t\tthis._internals.states.delete(\"has-overlay-badge\");\n\t\t}\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\te.stopImmediatePropagation();\n\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst {\n\t\t\taltKey,\n\t\t\tctrlKey,\n\t\t\tmetaKey,\n\t\t\tshiftKey,\n\t\t} = e;\n\n\t\tconst prevented = !this.fireDecoratorEvent(\"click\", {\n\t\t\toriginalEvent: e,\n\t\t\taltKey,\n\t\t\tctrlKey,\n\t\t\tmetaKey,\n\t\t\tshiftKey,\n\t\t});\n\n\t\tif (prevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isSubmit) {\n\t\t\tsubmitForm(this);\n\t\t}\n\n\t\tif (this._isReset) {\n\t\t\tresetForm(this);\n\t\t}\n\n\t\tif (isSafari()) {\n\t\t\tthis.getDomRef()?.focus();\n\t\t}\n\t}\n\n\t_onmousedown() {\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._setActiveState(true);\n\t\tactiveButton = this; // eslint-disable-line\n\t}\n\n\t_ontouchend(e: TouchEvent) {\n\t\tif (this.disabled) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\n\t\tif (this.active) {\n\t\t\tthis._setActiveState(false);\n\t\t}\n\n\t\tif (activeButton) {\n\t\t\tactiveButton._setActiveState(false);\n\t\t}\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tthis._cancelAction = isShift(e) || isEscape(e);\n\n\t\tif (isSpace(e) || isEnter(e)) {\n\t\t\tthis._setActiveState(true);\n\t\t} else if (this._cancelAction) {\n\t\t\tthis._setActiveState(false);\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (this._cancelAction) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tif (isSpace(e) || isEnter(e)) {\n\t\t\tif (this.active) {\n\t\t\t\tthis._setActiveState(false);\n\t\t\t}\n\t\t}\n\t}\n\n\t_onfocusout() {\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.active) {\n\t\t\tthis._setActiveState(false);\n\t\t}\n\t}\n\n\t_setActiveState(active: boolean) {\n\t\tconst eventPrevented = !this.fireDecoratorEvent(\"active-state-change\");\n\n\t\tif (eventPrevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.active = active;\n\t}\n\n\tget _hasPopup() {\n\t\treturn this.accessibilityAttributes.hasPopup;\n\t}\n\n\tget hasButtonType() {\n\t\treturn this.design !== ButtonDesign.Default && this.design !== ButtonDesign.Transparent;\n\t}\n\n\tget isIconOnly() {\n\t\treturn !willShowContent(this.text);\n\t}\n\n\tstatic typeTextMappings(): Record<string, I18nText> {\n\t\treturn {\n\t\t\t\"Positive\": BUTTON_ARIA_TYPE_ACCEPT,\n\t\t\t\"Negative\": BUTTON_ARIA_TYPE_REJECT,\n\t\t\t\"Emphasized\": BUTTON_ARIA_TYPE_EMPHASIZED,\n\t\t\t\"Attention\": BUTTON_ARIA_TYPE_ATTENTION,\n\t\t};\n\t}\n\n\tgetDefaultTooltip() {\n\t\tif (!getEnableDefaultTooltips()) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn getIconAccessibleName(this.icon);\n\t}\n\n\tget buttonTypeText() {\n\t\treturn Button.i18nBundle.getText(Button.typeTextMappings()[this.design]);\n\t}\n\n\tget effectiveAccRole(): AriaRole {\n\t\treturn toLowercaseEnumValue(this.accessibleRole);\n\t}\n\n\tget tabIndexValue() {\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst tabindex = this.getAttribute(\"tabindex\");\n\n\t\tif (tabindex) {\n\t\t\treturn Number.parseInt(tabindex);\n\t\t}\n\n\t\treturn this.nonInteractive ? -1 : Number.parseInt(this.forcedTabIndex);\n\t}\n\n\tget ariaLabelText() {\n\t\tconst ariaLabelText = getEffectiveAriaLabelText(this) || \"\";\n\t\tconst typeLabelText = this.hasButtonType ? this.buttonTypeText : \"\";\n\t\tconst internalLabelText = this.effectiveBadgeDescriptionText || \"\";\n\n\t\tconst labelParts = [ariaLabelText, typeLabelText, internalLabelText].filter(part => part);\n\t\treturn labelParts.join(\" \");\n\t}\n\n\tget ariaDescriptionText() {\n\t\treturn this.accessibleDescription === \"\" ? undefined : this.accessibleDescription;\n\t}\n\n\tget effectiveBadgeDescriptionText() {\n\t\tif (!this.shouldRenderBadge) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tconst badgeEffectiveText = this.badge[0].effectiveText;\n\n\t\t// Use distinct i18n keys for singular and plural badge values to ensure proper localization.\n\t\t// Some languages have different grammatical rules for singular and plural forms,\n\t\t// so separate keys (BUTTON_BADGE_ONE_ITEM and BUTTON_BADGE_MANY_ITEMS) are necessary.\n\t\tswitch (badgeEffectiveText) {\n\t\tcase \"\":\n\t\t\treturn badgeEffectiveText;\n\t\tcase \"1\":\n\t\t\treturn Button.i18nBundle.getText(BUTTON_BADGE_ONE_ITEM, badgeEffectiveText);\n\t\tdefault:\n\t\t\treturn Button.i18nBundle.getText(BUTTON_BADGE_MANY_ITEMS, badgeEffectiveText);\n\t\t}\n\t}\n\n\tget _isSubmit() {\n\t\treturn this.type === ButtonType.Submit || this.submits;\n\t}\n\n\tget _isReset() {\n\t\treturn this.type === ButtonType.Reset;\n\t}\n\n\tget shouldRenderBadge() {\n\t\treturn !!this.badge.length && (!!this.badge[0].text.length || this.badge[0].design === ButtonBadgeDesign.AttentionDot);\n\t}\n}\n\nButton.define();\n\nexport default Button;\nexport type {\n\tButtonAccessibilityAttributes,\n\tButtonClickEventDetail,\n\tIButton,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,EACN,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,GACP,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+DAA+D,CAAC;AAK1G,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAE/F,OAAO,EACN,SAAS,EACT,QAAQ,GACR,MAAM,wCAAwC,CAAC;AAChD,OAAO,eAAe,MAAM,sDAAsD,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mEAAmE,CAAC;AAC1G,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,oBAAoB,MAAM,2DAA2D,CAAC;AAC7F,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAG7D,OAAO,cAAc,MAAM,qBAA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AAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;oCACnB;AAQnB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;qCAChC;AAOpB;IADN,IAAI,CAAC,oBAAoB,CAAC;gCACG;AAxOzB,MAAM;IAlCX,aAAa,CAAC;QACd,GAAG,EAAE,YAAY;QACjB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,SAAS;QACjB,iBAAiB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;KAC3C,CAAC;IACF;;;;;;;;;;;;OAYG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;IACF;;;OAGG;;IACF,KAAK,CAAC,qBAAqB,EAAE;QAC7B,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;GACI,MAAM,CA8fX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,eAAe,MAAM,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 event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport {\n\tisSpace,\n\tisEnter,\n\tisEscape,\n\tisShift,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { getEffectiveAriaLabelText } from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport type { AccessibilityAttributes, AriaRole } from \"@ui5/webcomponents-base\";\nimport type { ITabbable } from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { getIconAccessibleName } from \"@ui5/webcomponents-base/dist/asset-registries/Icons.js\";\n\nimport {\n\tisDesktop,\n\tisSafari,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport willShowContent from \"@ui5/webcomponents-base/dist/util/willShowContent.js\";\nimport { submitForm, resetForm } from \"@ui5/webcomponents-base/dist/features/InputElementsFormSupport.js\";\nimport { getEnableDefaultTooltips } from \"@ui5/webcomponents-base/dist/config/Tooltips.js\";\nimport toLowercaseEnumValue from \"@ui5/webcomponents-base/dist/util/toLowercaseEnumValue.js\";\nimport ButtonDesign from \"./types/ButtonDesign.js\";\nimport ButtonType from \"./types/ButtonType.js\";\nimport ButtonBadgeDesign from \"./types/ButtonBadgeDesign.js\";\nimport type ButtonAccessibleRole from \"./types/ButtonAccessibleRole.js\";\nimport type ButtonBadge from \"./ButtonBadge.js\";\nimport ButtonTemplate from \"./ButtonTemplate.js\";\nimport {\n\tBUTTON_ARIA_TYPE_ACCEPT,\n\tBUTTON_ARIA_TYPE_REJECT,\n\tBUTTON_ARIA_TYPE_EMPHASIZED,\n\tBUTTON_ARIA_TYPE_ATTENTION,\n\tBUTTON_BADGE_ONE_ITEM,\n\tBUTTON_BADGE_MANY_ITEMS,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport buttonCss from \"./generated/themes/Button.css.js\";\n\n/**\n * Interface for components that may be used as a button inside numerous higher-order components\n * @public\n */\ninterface IButton extends HTMLElement, ITabbable {\n\tnonInteractive: boolean;\n}\n\nlet isGlobalHandlerAttached = false;\nlet activeButton: Button | null = null;\n\ntype ButtonAccessibilityAttributes = Pick<AccessibilityAttributes, \"expanded\" | \"hasPopup\" | \"controls\">;\n\ntype ButtonClickEventDetail = {\n\toriginalEvent: MouseEvent,\n\taltKey: boolean;\n\tctrlKey: boolean;\n\tmetaKey: boolean;\n\tshiftKey: boolean;\n}\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-button` component represents a simple push button.\n * It enables users to trigger actions by clicking or tapping the `ui5-button`, or by pressing\n * certain keyboard keys, such as Enter.\n *\n * ### Usage\n *\n * For the `ui5-button` UI, you can define text, icon, or both. You can also specify\n * whether the text or the icon is displayed first.\n *\n * You can choose from a set of predefined types that offer different\n * styling to correspond to the triggered action.\n *\n * You can set the `ui5-button` as enabled or disabled. An enabled\n * `ui5-button` can be pressed by clicking or tapping it. The button changes\n * its style to provide visual feedback to the user that it is pressed or hovered over with\n * the mouse cursor. A disabled `ui5-button` appears inactive and cannot be pressed.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/Button.js\";`\n * @csspart button - Used to style the native button element\n * @csspart icon - Used to style the icon in the native button element\n * @csspart endIcon - Used to style the end icon in the native button element\n * @constructor\n * @extends UI5Element\n * @implements { IButton }\n * @public\n */\n@customElement({\n\ttag: \"ui5-button\",\n\tformAssociated: true,\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: ButtonTemplate,\n\tstyles: buttonCss,\n\tshadowRootOptions: { delegatesFocus: true },\n})\n/**\n * Fired when the component is activated either with a mouse/tap or by using the Enter or Space key.\n *\n * **Note:** The event will not be fired if the `disabled` property is set to `true`.\n *\n * @since 2.10.0\n * @public\n * @param {Event} originalEvent Returns original event that comes from user's **click** interaction\n * @param {boolean} altKey Returns whether the \"ALT\" key was pressed when the event was triggered.\n * @param {boolean} ctrlKey Returns whether the \"CTRL\" key was pressed when the event was triggered.\n * @param {boolean} metaKey Returns whether the \"META\" key was pressed when the event was triggered.\n * @param {boolean} shiftKey Returns whether the \"SHIFT\" key was pressed when the event was triggered.\n */\n@event(\"click\", {\n\tbubbles: true,\n\tcancelable: true,\n})\n/**\n * Fired whenever the active state of the component changes.\n * @private\n */\n@event(\"active-state-change\", {\n\tbubbles: true,\n\tcancelable: true,\n})\nclass Button extends UI5Element implements IButton {\n\teventDetails!: {\n\t\t\"click\": ButtonClickEventDetail,\n\t\t\"active-state-change\": void,\n\t};\n\n\t/**\n\t * Defines the component design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign: `${ButtonDesign}` = \"Default\";\n\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the icon, displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * Example:\n\t * See all the available icons within the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines the icon, displayed as graphical element within the component after the button text.\n\t *\n\t * **Note:** It is highly recommended to use `endIcon` property only together with `icon` and/or `text` properties.\n\t * Usage of `endIcon` only should be avoided.\n\t *\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * Example:\n\t * See all the available icons within the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tendIcon?: string;\n\n\t/**\n\t * When set to `true`, the component will\n\t * automatically submit the nearest HTML form element on `press`.\n\t *\n\t * **Note:** This property is only applicable within the context of an HTML Form element.`\n\t * @default false\n\t * @public\n\t * @deprecated Set the \"type\" property to \"Submit\" to achieve the same result. The \"submits\" property is ignored if \"type\" is set to any value other than \"Button\".\n\t */\n\t@property({ type: Boolean })\n\tsubmits = false;\n\n\t/**\n\t * Defines the tooltip of the component.\n\t *\n\t * **Note:** A tooltip attribute should be provided for icon-only buttons, in order to represent their exact meaning/function.\n\t * @default undefined\n\t * @public\n\t * @since 1.2.0\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Receives id(or many ids) of the elements that label the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.1.0\n\t */\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The following fields are supported:\n\t *\n\t * - **expanded**: Indicates whether the button, or another grouping element it controls, is currently expanded or collapsed.\n\t * Accepts the following string values: `true` or `false`\n\t *\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.\n\t * Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.\n\t *\n\t * - **controls**: Identifies the element (or elements) whose contents or presence are controlled by the button element.\n\t * Accepts a lowercase string value.\n\t *\n\t * @public\n\t * @since 1.2.0\n\t * @default {}\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: ButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Defines the accessible description of the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.5.0\n\t */\n\t@property()\n\taccessibleDescription?: string;\n\n\t/**\n\t * Defines whether the button has special form-related functionality.\n\t *\n\t * **Note:** This property is only applicable within the context of an HTML Form element.\n\t * @default \"Button\"\n\t * @public\n\t * @since 1.15.0\n\t */\n\t@property()\n\ttype: `${ButtonType}` = \"Button\";\n\n\t/**\n\t * Describes the accessibility role of the button.\n\t *\n\t * **Note:** Use <code>ButtonAccessibleRole.Link</code> role only with a press handler, which performs a navigation. In all other scenarios the default button semantics are recommended.\n\t *\n\t * @default \"Button\"\n\t * @public\n\t * @since 1.23\n\t */\n\t@property()\n\taccessibleRole: `${ButtonAccessibleRole}` = \"Button\";\n\n\t/**\n\t * Used to switch the active state (pressed or not) of the component.\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tactive = false;\n\n\t/**\n\t * Defines if a content has been added to the default slot\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\ticonOnly = false;\n\n\t/**\n\t * Indicates if the elements has a slotted icon\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\thasIcon = false;\n\n\t/**\n\t * Indicates if the elements has a slotted end icon\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\thasEndIcon = false;\n\n\t/**\n\t * Indicates if the element is focusable\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tnonInteractive = false;\n\n\t/**\n\t * The current title of the button, either the tooltip property or the icons tooltip. The tooltip property with higher prio.\n\t * @private\n\t */\n\t@property({ noAttribute: true })\n\tbuttonTitle?: string;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Object })\n\t_iconSettings: object = {};\n\n\t/**\n\t * Defines the tabIndex of the component.\n\t * @private\n\t */\n\t@property({ noAttribute: true })\n\tforcedTabIndex = \"0\";\n\n\t/**\n\t * @since 1.0.0-rc.13\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_isTouch = false;\n\n\t@property({ type: Boolean, noAttribute: true })\n\t_cancelAction = false;\n\n\t/**\n\t * Defines the text of the component.\n\t *\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: Node, \"default\": true })\n\ttext!: Array<Node>;\n\n\t/**\n\t * Adds a badge to the button.\n\t * @since 2.7.0\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, invalidateOnChildChange: true })\n\tbadge!: Array<ButtonBadge>;\n\n\t_deactivate: () => void;\n\t_onclickBound: (e: MouseEvent) => void;\n\t_clickHandlerAttached = false;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._deactivate = () => {\n\t\t\tif (activeButton) {\n\t\t\t\tactiveButton._setActiveState(false);\n\t\t\t}\n\t\t};\n\n\t\tthis._onclickBound = e => {\n\t\t\tif (e instanceof CustomEvent) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._onclick(e);\n\t\t};\n\n\t\tif (!this._clickHandlerAttached) {\n\t\t\tthis.addEventListener(\"click\", this._onclickBound);\n\t\t\tthis._clickHandlerAttached = true;\n\t\t}\n\n\t\tif (!isGlobalHandlerAttached) {\n\t\t\tdocument.addEventListener(\"mouseup\", this._deactivate);\n\n\t\t\tisGlobalHandlerAttached = true;\n\t\t}\n\t}\n\n\t_ontouchstart() {\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._setActiveState(true);\n\t}\n\n\tonEnterDOM() {\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\n\t\tif (!this._clickHandlerAttached) {\n\t\t\tthis.addEventListener(\"click\", this._onclickBound);\n\t\t\tthis._clickHandlerAttached = true;\n\t\t}\n\t}\n\n\tonExitDOM() {\n\t\tif (this._clickHandlerAttached) {\n\t\t\tthis.removeEventListener(\"click\", this._onclickBound);\n\t\t\tthis._clickHandlerAttached = false;\n\t\t}\n\t}\n\n\tasync onBeforeRendering() {\n\t\tthis._setBadgeOverlayStyle();\n\n\t\tthis.hasIcon = !!this.icon;\n\t\tthis.hasEndIcon = !!this.endIcon;\n\t\tthis.iconOnly = this.isIconOnly;\n\n\t\tconst defaultTooltip = await this.getDefaultTooltip();\n\t\tthis.buttonTitle = this.iconOnly ? this.tooltip ?? defaultTooltip : this.tooltip;\n\t}\n\n\t_setBadgeOverlayStyle() {\n\t\tconst needsOverflowVisible = this.badge.length && (this.badge[0].design === ButtonBadgeDesign.AttentionDot || this.badge[0].design === ButtonBadgeDesign.OverlayText);\n\n\t\tif (needsOverflowVisible) {\n\t\t\tthis._internals.states.add(\"has-overlay-badge\");\n\t\t} else {\n\t\t\tthis._internals.states.delete(\"has-overlay-badge\");\n\t\t}\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\te.stopImmediatePropagation();\n\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst {\n\t\t\taltKey,\n\t\t\tctrlKey,\n\t\t\tmetaKey,\n\t\t\tshiftKey,\n\t\t} = e;\n\n\t\tconst prevented = !this.fireDecoratorEvent(\"click\", {\n\t\t\toriginalEvent: e,\n\t\t\taltKey,\n\t\t\tctrlKey,\n\t\t\tmetaKey,\n\t\t\tshiftKey,\n\t\t});\n\n\t\tif (prevented) {\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isSubmit) {\n\t\t\tsubmitForm(this);\n\t\t}\n\n\t\tif (this._isReset) {\n\t\t\tresetForm(this);\n\t\t}\n\n\t\tif (isSafari()) {\n\t\t\tthis.getDomRef()?.focus();\n\t\t}\n\t}\n\n\t_onmousedown() {\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._setActiveState(true);\n\t\tactiveButton = this; // eslint-disable-line\n\t}\n\n\t_ontouchend(e: TouchEvent) {\n\t\tif (this.disabled) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\n\t\tif (this.active) {\n\t\t\tthis._setActiveState(false);\n\t\t}\n\n\t\tif (activeButton) {\n\t\t\tactiveButton._setActiveState(false);\n\t\t}\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tthis._cancelAction = isShift(e) || isEscape(e);\n\n\t\tif (isSpace(e) || isEnter(e)) {\n\t\t\tthis._setActiveState(true);\n\t\t} else if (this._cancelAction) {\n\t\t\tthis._setActiveState(false);\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (this._cancelAction) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tif (isSpace(e) || isEnter(e)) {\n\t\t\tif (this.active) {\n\t\t\t\tthis._setActiveState(false);\n\t\t\t}\n\t\t}\n\t}\n\n\t_onfocusout() {\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.active) {\n\t\t\tthis._setActiveState(false);\n\t\t}\n\t}\n\n\t_setActiveState(active: boolean) {\n\t\tconst eventPrevented = !this.fireDecoratorEvent(\"active-state-change\");\n\n\t\tif (eventPrevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.active = active;\n\t}\n\n\tget _hasPopup() {\n\t\treturn this.accessibilityAttributes.hasPopup;\n\t}\n\n\tget hasButtonType() {\n\t\treturn this.design !== ButtonDesign.Default && this.design !== ButtonDesign.Transparent;\n\t}\n\n\tget isIconOnly() {\n\t\treturn !willShowContent(this.text);\n\t}\n\n\tstatic typeTextMappings(): Record<string, I18nText> {\n\t\treturn {\n\t\t\t\"Positive\": BUTTON_ARIA_TYPE_ACCEPT,\n\t\t\t\"Negative\": BUTTON_ARIA_TYPE_REJECT,\n\t\t\t\"Emphasized\": BUTTON_ARIA_TYPE_EMPHASIZED,\n\t\t\t\"Attention\": BUTTON_ARIA_TYPE_ATTENTION,\n\t\t};\n\t}\n\n\tgetDefaultTooltip() {\n\t\tif (!getEnableDefaultTooltips()) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn getIconAccessibleName(this.icon);\n\t}\n\n\tget buttonTypeText() {\n\t\treturn Button.i18nBundle.getText(Button.typeTextMappings()[this.design]);\n\t}\n\n\tget effectiveAccRole(): AriaRole {\n\t\treturn toLowercaseEnumValue(this.accessibleRole);\n\t}\n\n\tget tabIndexValue() {\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst tabindex = this.getAttribute(\"tabindex\");\n\n\t\tif (tabindex) {\n\t\t\treturn Number.parseInt(tabindex);\n\t\t}\n\n\t\treturn this.nonInteractive ? -1 : Number.parseInt(this.forcedTabIndex);\n\t}\n\n\tget ariaLabelText() {\n\t\tconst ariaLabelText = getEffectiveAriaLabelText(this) || \"\";\n\t\tconst typeLabelText = this.hasButtonType ? this.buttonTypeText : \"\";\n\t\tconst internalLabelText = this.effectiveBadgeDescriptionText || \"\";\n\n\t\tconst labelParts = [ariaLabelText, typeLabelText, internalLabelText].filter(part => part);\n\t\treturn labelParts.join(\" \");\n\t}\n\n\tget ariaDescriptionText() {\n\t\treturn this.accessibleDescription === \"\" ? undefined : this.accessibleDescription;\n\t}\n\n\tget effectiveBadgeDescriptionText() {\n\t\tif (!this.shouldRenderBadge) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tconst badgeEffectiveText = this.badge[0].effectiveText;\n\n\t\t// Use distinct i18n keys for singular and plural badge values to ensure proper localization.\n\t\t// Some languages have different grammatical rules for singular and plural forms,\n\t\t// so separate keys (BUTTON_BADGE_ONE_ITEM and BUTTON_BADGE_MANY_ITEMS) are necessary.\n\t\tswitch (badgeEffectiveText) {\n\t\tcase \"\":\n\t\t\treturn badgeEffectiveText;\n\t\tcase \"1\":\n\t\t\treturn Button.i18nBundle.getText(BUTTON_BADGE_ONE_ITEM, badgeEffectiveText);\n\t\tdefault:\n\t\t\treturn Button.i18nBundle.getText(BUTTON_BADGE_MANY_ITEMS, badgeEffectiveText);\n\t\t}\n\t}\n\n\tget _isSubmit() {\n\t\treturn this.type === ButtonType.Submit || this.submits;\n\t}\n\n\tget _isReset() {\n\t\treturn this.type === ButtonType.Reset;\n\t}\n\n\tget shouldRenderBadge() {\n\t\treturn !!this.badge.length && (!!this.badge[0].text.length || this.badge[0].design === ButtonBadgeDesign.AttentionDot);\n\t}\n}\n\nButton.define();\n\nexport default Button;\nexport type {\n\tButtonAccessibilityAttributes,\n\tButtonClickEventDetail,\n\tIButton,\n};\n"]}
|