@ui5/webcomponents 2.0.0 → 2.0.1
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 +11 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/Menu.js +0 -3
- package/dist/Menu.js.map +1 -1
- package/dist/MenuItem.js +4 -1
- package/dist/MenuItem.js.map +1 -1
- package/dist/MessageStrip.d.ts +5 -4
- package/dist/MessageStrip.js +5 -4
- package/dist/MessageStrip.js.map +1 -1
- package/dist/Option.d.ts +2 -2
- package/dist/Option.js.map +1 -1
- package/dist/OptionCustom.d.ts +1 -1
- package/dist/OptionCustom.js.map +1 -1
- package/dist/Table.d.ts +3 -2
- package/dist/Table.js +3 -5
- package/dist/Table.js.map +1 -1
- package/dist/TableGrowing.d.ts +1 -0
- package/dist/TableGrowing.js +1 -0
- package/dist/TableGrowing.js.map +1 -1
- package/dist/TableRow.d.ts +2 -2
- package/dist/TableRow.js +3 -3
- package/dist/TableRow.js.map +1 -1
- package/dist/TableSelection.d.ts +2 -1
- package/dist/TableSelection.js +4 -3
- package/dist/TableSelection.js.map +1 -1
- package/dist/TableUtils.d.ts +2 -1
- package/dist/TableUtils.js +4 -1
- package/dist/TableUtils.js.map +1 -1
- package/dist/Text.js.map +1 -1
- package/dist/TextArea.d.ts +1 -1
- package/dist/TextArea.js.map +1 -1
- package/dist/bundle.esm.js +1 -0
- package/dist/bundle.esm.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/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/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/FileUploader.css +1 -1
- package/dist/css/themes/Form.css +1 -1
- package/dist/css/themes/FormItem.css +1 -1
- package/dist/css/themes/FormLabelSpan.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/MultiComboBoxPopover.css +1 -1
- package/dist/css/themes/MultiInput.css +1 -1
- package/dist/css/themes/NavigationMenu.css +1 -1
- package/dist/css/themes/NavigationMenuItem.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/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/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/TreeItem.css +1 -1
- package/dist/css/themes/ValueStateMessage.css +1 -1
- package/dist/css/themes/YearPicker.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_dark_exp/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_exp/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcb_exp/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcw_exp/parameters-bundle.css +1 -1
- package/dist/custom-elements-internal.json +18 -15
- package/dist/custom-elements.json +18 -15
- package/dist/generated/assets/i18n/messagebundle_sv.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_dark_exp/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_exp/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_hcb_exp/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcw_exp/parameters-bundle.css.json +1 -1
- package/dist/generated/templates/MenuTemplate.lit.js +1 -1
- package/dist/generated/templates/MenuTemplate.lit.js.map +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.js +1 -1
- package/dist/generated/themes/AvatarGroup.css.js.map +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.js +1 -1
- package/dist/generated/themes/Breadcrumbs.css.js.map +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.js +1 -1
- package/dist/generated/themes/Button.css.js.map +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.js +1 -1
- package/dist/generated/themes/CalendarHeader.css.js.map +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.js +1 -1
- package/dist/generated/themes/CalendarLegendItem.css.js.map +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.js +1 -1
- package/dist/generated/themes/CardHeader.css.js.map +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.js +1 -1
- package/dist/generated/themes/CheckBox.css.js.map +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.js +1 -1
- package/dist/generated/themes/ColorPaletteItem.css.js.map +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.js +1 -1
- package/dist/generated/themes/ColorPicker.css.js.map +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/DatePicker.css.js +1 -1
- package/dist/generated/themes/DatePicker.css.js.map +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.js +1 -1
- package/dist/generated/themes/DayPicker.css.js.map +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/FileUploader.css.js +1 -1
- package/dist/generated/themes/FileUploader.css.js.map +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.js +1 -1
- package/dist/generated/themes/FormItem.css.js.map +1 -1
- package/dist/generated/themes/FormLabelSpan.css.js +1 -1
- package/dist/generated/themes/FormLabelSpan.css.js.map +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.js +1 -1
- package/dist/generated/themes/Icon.css.js.map +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.js +1 -1
- package/dist/generated/themes/InputIcon.css.js.map +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.js +1 -1
- package/dist/generated/themes/Link.css.js.map +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.js +1 -1
- package/dist/generated/themes/ListItem.css.js.map +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.js +1 -1
- package/dist/generated/themes/ListItemCustom.css.js.map +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.js +1 -1
- package/dist/generated/themes/ListItemGroupHeader.css.js.map +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.js +1 -1
- package/dist/generated/themes/Menu.css.js.map +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.js +1 -1
- package/dist/generated/themes/MessageStrip.css.js.map +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.js +1 -1
- package/dist/generated/themes/MultiComboBox.css.js.map +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.js +1 -1
- package/dist/generated/themes/MultiInput.css.js.map +1 -1
- package/dist/generated/themes/NavigationMenu.css.js +1 -1
- package/dist/generated/themes/NavigationMenu.css.js.map +1 -1
- package/dist/generated/themes/NavigationMenuItem.css.js +1 -1
- package/dist/generated/themes/NavigationMenuItem.css.js.map +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.js +1 -1
- package/dist/generated/themes/Panel.css.js.map +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.js +1 -1
- package/dist/generated/themes/PopupsCommon.css.js.map +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.js +1 -1
- package/dist/generated/themes/RadioButton.css.js.map +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.js +1 -1
- package/dist/generated/themes/RatingIndicator.css.js.map +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.js +1 -1
- package/dist/generated/themes/ResponsivePopoverCommon.css.js.map +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.js +1 -1
- package/dist/generated/themes/SegmentedButtonItem.css.js.map +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.js +1 -1
- package/dist/generated/themes/SliderBase.css.js.map +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.js +1 -1
- package/dist/generated/themes/StepInput.css.js.map +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.js +1 -1
- package/dist/generated/themes/SuggestionItemCustom.css.js.map +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.js +1 -1
- package/dist/generated/themes/TabContainer.css.js.map +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.js +1 -1
- package/dist/generated/themes/TabInStrip.css.js.map +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.js +1 -1
- package/dist/generated/themes/TabSeparatorInOverflow.css.js.map +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.js +1 -1
- package/dist/generated/themes/TableHeaderRow.css.js.map +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.js +1 -1
- package/dist/generated/themes/Tag.css.js.map +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.js +1 -1
- package/dist/generated/themes/TextArea.css.js.map +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.js +1 -1
- package/dist/generated/themes/Toast.css.js.map +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.js +1 -1
- package/dist/generated/themes/Token.css.js.map +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.js +1 -1
- package/dist/generated/themes/TokenizerPopover.css.js.map +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.js +1 -1
- package/dist/generated/themes/ToolbarPopover.css.js.map +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.js +1 -1
- package/dist/generated/themes/ValueStateMessage.css.js.map +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/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.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.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.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.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.js +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_dark_exp/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_dark_exp/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_exp/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_exp/parameters-bundle.css.js.map +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_hcb_exp/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcb_exp/parameters-bundle.css.js.map +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/generated/themes/sap_horizon_hcw_exp/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcw_exp/parameters-bundle.css.js.map +1 -1
- package/dist/vscode.html-custom-data.json +9 -9
- package/dist/web-types.json +16 -16
- package/package.json +9 -9
- package/src/Menu.hbs +0 -1
- package/src/i18n/messagebundle_sv.properties +7 -7
- package/src/themes/Input.css +7 -0
package/dist/Menu.js
CHANGED
|
@@ -19,7 +19,6 @@ import DOMReferenceConverter from "@ui5/webcomponents-base/dist/converters/DOMRe
|
|
|
19
19
|
import ResponsivePopover from "./ResponsivePopover.js";
|
|
20
20
|
import Button from "./Button.js";
|
|
21
21
|
import List from "./List.js";
|
|
22
|
-
import Icon from "./Icon.js";
|
|
23
22
|
import BusyIndicator from "./BusyIndicator.js";
|
|
24
23
|
import MenuItem from "./MenuItem.js";
|
|
25
24
|
import MenuSeparator from "./MenuSeparator.js";
|
|
@@ -203,7 +202,6 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
203
202
|
}
|
|
204
203
|
}
|
|
205
204
|
_afterPopoverOpen() {
|
|
206
|
-
this.open = true;
|
|
207
205
|
this._menuItems[0]?.focus();
|
|
208
206
|
this.fireEvent("open", {}, false, true);
|
|
209
207
|
}
|
|
@@ -249,7 +247,6 @@ Menu = Menu_1 = __decorate([
|
|
|
249
247
|
List,
|
|
250
248
|
MenuItem,
|
|
251
249
|
MenuSeparator,
|
|
252
|
-
Icon,
|
|
253
250
|
BusyIndicator,
|
|
254
251
|
],
|
|
255
252
|
})
|
package/dist/Menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../src/Menu.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,kDAAkD,CAAC;AACrE,OAAO,EAC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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.js\";\nimport {\n\tisLeft,\n\tisRight,\n\tisEnter,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tisPhone,\n\tisDesktop,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport type { Timeout } from \"@ui5/webcomponents-base/dist/types.js\";\nimport DOMReferenceConverter from \"@ui5/webcomponents-base/dist/converters/DOMReference.js\";\nimport ResponsivePopover from \"./ResponsivePopover.js\";\nimport type { ResponsivePopoverBeforeCloseEventDetail } from \"./ResponsivePopover.js\";\nimport Button from \"./Button.js\";\nimport List from \"./List.js\";\nimport Icon from \"./Icon.js\";\nimport BusyIndicator from \"./BusyIndicator.js\";\nimport MenuItem from \"./MenuItem.js\";\nimport MenuSeparator from \"./MenuSeparator.js\";\nimport type {\n\tListItemClickEventDetail,\n} from \"./List.js\";\nimport menuTemplate from \"./generated/templates/MenuTemplate.lit.js\";\nimport {\n\tMENU_CLOSE_BUTTON_ARIA_LABEL,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport menuCss from \"./generated/themes/Menu.css.js\";\n\nconst MENU_OPEN_DELAY = 300;\n\n/**\n * Interface for components that may be slotted inside a `ui5-menu`.\n *\n * **Note:** Use with `ui5-menu-item` or `ui5-menu-separator`. Implementing the interface does not guarantee that any other classes can work with the `ui5-menu`.\n * @public\n */\ninterface IMenuItem extends UI5Element {\n\tisSeparator: boolean;\n}\n\ntype MenuItemClickEventDetail = {\n\titem: MenuItem,\n\ttext: string,\n}\n\ntype MenuBeforeOpenEventDetail = { item?: MenuItem };\ntype MenuBeforeCloseEventDetail = { escPressed: boolean };\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-menu` component represents a hierarchical menu structure.\n *\n * ### Structure\n *\n * The `ui5-menu` can hold two types of entities:\n *\n * - `ui5-menu-item` components\n * - `ui5-menu-separator` - used to separate menu items with a line\n *\n * An arbitrary hierarchy structure can be represented by recursively nesting menu items.\n *\n * ### Keyboard Handling\n *\n * The `ui5-menu` provides advanced keyboard handling.\n * The user can use the following keyboard shortcuts in order to navigate trough the tree:\n *\n * - `Arrow Up` / `Arrow Down` - Navigates up and down the menu items that are currently visible.\n * - `Arrow Right`, `Space` or `Enter` - Opens a sub-menu if there are menu items nested\n * in the currently clicked menu item.\n * - `Arrow Left` or `Escape` - Closes the currently opened sub-menu.\n *\n * Note: if the text ditrection is set to Right-to-left (RTL), `Arrow Right` and `Arrow Left` functionality is swapped.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/Menu.js\";`\n * @constructor\n * @extends UI5Element\n * @since 1.3.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-menu\",\n\trenderer: litRender,\n\tstyles: menuCss,\n\ttemplate: menuTemplate,\n\tdependencies: [\n\t\tResponsivePopover,\n\t\tButton,\n\t\tList,\n\t\tMenuItem,\n\t\tMenuSeparator,\n\t\tIcon,\n\t\tBusyIndicator,\n\t],\n})\n\n/**\n * Fired when an item is being clicked.\n *\n * **Note:** Since 1.17.0 the event is preventable, allowing the menu to remain open after an item is pressed.\n * @allowPreventDefault\n * @param { HTMLElement } item The currently clicked menu item.\n * @param { string } text The text of the currently clicked menu item.\n * @public\n */\n@event<MenuItemClickEventDetail>(\"item-click\", {\n\tdetail: {\n\t\t/**\n\t\t * @public\n\t\t */\n\t\titem: {\n\t\t\ttype: HTMLElement,\n\t\t},\n\t\t/**\n\t\t * @public\n\t\t */\n\t\ttext: {\n\t\t\ttype: String,\n\t\t},\n\t},\n})\n\n/**\n * Fired before the menu is opened. This event can be cancelled, which will prevent the menu from opening. **This event does not bubble.**\n *\n * **Note:** Since 1.14.0 the event is also fired before a sub-menu opens.\n * @public\n * @allowPreventDefault\n * @since 1.10.0\n * @param { HTMLElement } item The `ui5-menu-item` that triggers opening of the sub-menu or undefined when fired upon root menu opening.\n */\n@event<MenuBeforeOpenEventDetail>(\"before-open\", {\n\tdetail: {\n\t\t/**\n\t\t * @public\n\t\t * @since 1.14.0\n\t\t */\n\t\titem: {\n\t\t\ttype: HTMLElement,\n\t\t},\n\t},\n})\n\n/**\n * Fired after the menu is opened. **This event does not bubble.**\n * @public\n * @since 1.10.0\n */\n@event(\"open\")\n\n/**\n * Fired before the menu is closed. This event can be cancelled, which will prevent the menu from closing. **This event does not bubble.**\n * @public\n * @allowPreventDefault\n * @param {boolean} escPressed Indicates that `ESC` key has triggered the event.\n * @since 1.10.0\n */\n@event<MenuBeforeCloseEventDetail>(\"before-close\", {\n\tdetail: {\n\t\t/**\n\t\t * @public\n\t\t */\n\t\tescPressed: {\n\t\t\ttype: Boolean,\n\t\t},\n\t},\n})\n\n/**\n * Fired after the menu is closed. **This event does not bubble.**\n * @public\n * @since 1.10.0\n */\n@event(\"close\")\n\nclass Menu extends UI5Element {\n\t/**\n\t * Defines the header text of the menu (displayed on mobile).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\theaderText?: string;\n\n\t/**\n\t * Indicates if the menu is open\n\t * @public\n\t * @default false\n\t * @since 1.10.0\n\t */\n\t@property({ type: Boolean })\n\topen = false;\n\n\t/**\n\t * Defines if a loading indicator would be displayed inside the corresponding ui5-menu popover.\n\t * @default false\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Boolean })\n\tloading = false;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the loading indicator will be displayed inside the corresponding ui5-menu popover..\n\t * @default 1000\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Number })\n\tloadingDelay = 1000;\n\n\t/**\n\t * Defines the ID or DOM Reference of the element at which the menu is shown.\n\t * When using this attribute in a declarative way, you must only use the `id` (as a string) of the element at which you want to show the popover.\n\t * You can only set the `opener` attribute to a DOM Reference when using JavaScript.\n\t * @public\n\t * @default undefined\n\t * @since 1.10.0\n\t */\n\t@property({ converter: DOMReferenceConverter })\n\topener?: HTMLElement | string;\n\n\t/**\n\t * Defines the items of this component.\n\t *\n\t * **Note:** Use `ui5-menu-item` and `ui5-menu-separator` for their intended design.\n\t * @public\n\t */\n\t@slot({ \"default\": true, type: HTMLElement, invalidateOnChildChange: true })\n\titems!: Array<IMenuItem>;\n\n\tstatic i18nBundle: I18nBundle;\n\t_timeout?: Timeout;\n\n\tstatic async onDefine() {\n\t\tMenu.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n\n\tget isRtl() {\n\t\treturn this.effectiveDir === \"rtl\";\n\t}\n\n\tget labelClose() {\n\t\treturn Menu.i18nBundle.getText(MENU_CLOSE_BUTTON_ARIA_LABEL);\n\t}\n\n\tget isPhone() {\n\t\treturn isPhone();\n\t}\n\n\tget _popover() {\n\t\treturn this.shadowRoot!.querySelector<ResponsivePopover>(\"[ui5-responsive-popover]\")!;\n\t}\n\n\tget _menuItems() {\n\t\treturn this.items.filter((item): item is MenuItem => !item.isSeparator);\n\t}\n\n\tonBeforeRendering() {\n\t\tconst siblingsWithIcon = this._menuItems.some(menuItem => !!menuItem.icon);\n\n\t\tthis._menuItems.forEach(item => {\n\t\t\titem._siblingsWithIcon = siblingsWithIcon;\n\t\t});\n\t}\n\n\t_close() {\n\t\tthis.open = false;\n\t}\n\n\t_openItemSubMenu(item: MenuItem) {\n\t\tclearTimeout(this._timeout);\n\n\t\tif (!item._popover || item._popover.open) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.fireEvent<MenuBeforeOpenEventDetail>(\"before-open\", {\n\t\t\titem,\n\t\t}, false, false);\n\t\titem._popover.opener = item;\n\t\titem._popover.open = true;\n\t\titem.selected = true;\n\t}\n\n\t_closeItemSubMenu(item: MenuItem) {\n\t\tif (item && item._popover) {\n\t\t\tconst openedSibling = item._menuItems.find(menuItem => menuItem._popover && menuItem._popover.open);\n\t\t\tif (openedSibling) {\n\t\t\t\tthis._closeItemSubMenu(openedSibling);\n\t\t\t}\n\n\t\t\titem._popover.open = false;\n\t\t\titem.selected = false;\n\t\t}\n\t}\n\n\t_itemMouseOver(e: MouseEvent) {\n\t\tif (isDesktop()) {\n\t\t\t// respect mouseover only on desktop\n\t\t\tconst item = e.target as MenuItem;\n\n\t\t\tif (item.hasAttribute(\"ui5-menu-item\")) {\n\t\t\t\titem.focus();\n\n\t\t\t\t// Opens submenu with 300ms delay\n\t\t\t\tthis._startOpenTimeout(item);\n\t\t\t}\n\t\t}\n\t}\n\n\t_startOpenTimeout(item: MenuItem) {\n\t\tclearTimeout(this._timeout);\n\n\t\tthis._timeout = setTimeout(() => {\n\t\t\tconst opener = item.parentElement as MenuItem | Menu;\n\t\t\tconst openedSibling = opener && opener._menuItems.find(menuItem => menuItem._popover && menuItem._popover.open);\n\t\t\tif (openedSibling) {\n\t\t\t\tthis._closeItemSubMenu(openedSibling);\n\t\t\t}\n\n\t\t\tthis._openItemSubMenu(item);\n\t\t}, MENU_OPEN_DELAY);\n\t}\n\n\t_itemClick(e: CustomEvent<ListItemClickEventDetail>) {\n\t\tconst item = e.detail.item as MenuItem;\n\n\t\tif (!item._popover) {\n\t\t\tconst prevented = !this.fireEvent<MenuItemClickEventDetail>(\"item-click\", {\n\t\t\t\t\"item\": item,\n\t\t\t\t\"text\": item.text || \"\",\n\t\t\t}, true, false);\n\n\t\t\tif (!prevented && this._popover) {\n\t\t\t\titem.fireEvent(\"close-menu\", {});\n\t\t\t}\n\t\t} else {\n\t\t\tthis._openItemSubMenu(item);\n\t\t}\n\t}\n\n\t_itemKeyDown(e: KeyboardEvent) {\n\t\tif (!isLeft(e) && !isRight(e)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst shouldCloseMenu = this.isRtl ? isRight(e) : isLeft(e);\n\t\tconst shouldOpenMenu = this.isRtl ? isLeft(e) : isRight(e);\n\t\tconst item = e.target as MenuItem;\n\t\tconst parentElement = item.parentElement as MenuItem;\n\n\t\tif (isEnter(e)) {\n\t\t\te.preventDefault();\n\t\t}\n\t\tif (shouldOpenMenu) {\n\t\t\tthis._openItemSubMenu(item);\n\t\t} else if (shouldCloseMenu && parentElement.hasAttribute(\"ui5-menu-item\") && parentElement._popover) {\n\t\t\tparentElement._popover.open = false;\n\t\t\tparentElement.selected = false;\n\t\t\t(parentElement._popover.opener as HTMLElement)?.focus();\n\t\t}\n\t}\n\n\t_beforePopoverOpen(e: CustomEvent) {\n\t\tconst prevented = !this.fireEvent<MenuBeforeOpenEventDetail>(\"before-open\", {}, true, true);\n\n\t\tif (prevented) {\n\t\t\tthis.open = false;\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_afterPopoverOpen() {\n\t\tthis.open = true;\n\t\tthis._menuItems[0]?.focus();\n\t\tthis.fireEvent(\"open\", {}, false, true);\n\t}\n\n\t_beforePopoverClose(e: CustomEvent<ResponsivePopoverBeforeCloseEventDetail>) {\n\t\tconst prevented = !this.fireEvent<MenuBeforeCloseEventDetail>(\"before-close\", { escPressed: e.detail.escPressed }, true, true);\n\n\t\tif (prevented) {\n\t\t\tthis.open = true;\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_afterPopoverClose() {\n\t\tthis.open = false;\n\t\tthis.fireEvent(\"close\", {}, false, true);\n\t}\n}\n\nMenu.define();\n\nexport default Menu;\nexport type {\n\tMenuItemClickEventDetail,\n\tMenuBeforeCloseEventDetail,\n\tMenuBeforeOpenEventDetail,\n\tIMenuItem,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../src/Menu.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO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AAC;AAEd,eAAe,IAAI,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.js\";\nimport {\n\tisLeft,\n\tisRight,\n\tisEnter,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tisPhone,\n\tisDesktop,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport type { Timeout } from \"@ui5/webcomponents-base/dist/types.js\";\nimport DOMReferenceConverter from \"@ui5/webcomponents-base/dist/converters/DOMReference.js\";\nimport ResponsivePopover from \"./ResponsivePopover.js\";\nimport type { ResponsivePopoverBeforeCloseEventDetail } from \"./ResponsivePopover.js\";\nimport Button from \"./Button.js\";\nimport List from \"./List.js\";\nimport BusyIndicator from \"./BusyIndicator.js\";\nimport MenuItem from \"./MenuItem.js\";\nimport MenuSeparator from \"./MenuSeparator.js\";\nimport type {\n\tListItemClickEventDetail,\n} from \"./List.js\";\nimport menuTemplate from \"./generated/templates/MenuTemplate.lit.js\";\nimport {\n\tMENU_CLOSE_BUTTON_ARIA_LABEL,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport menuCss from \"./generated/themes/Menu.css.js\";\n\nconst MENU_OPEN_DELAY = 300;\n\n/**\n * Interface for components that may be slotted inside a `ui5-menu`.\n *\n * **Note:** Use with `ui5-menu-item` or `ui5-menu-separator`. Implementing the interface does not guarantee that any other classes can work with the `ui5-menu`.\n * @public\n */\ninterface IMenuItem extends UI5Element {\n\tisSeparator: boolean;\n}\n\ntype MenuItemClickEventDetail = {\n\titem: MenuItem,\n\ttext: string,\n}\n\ntype MenuBeforeOpenEventDetail = { item?: MenuItem };\ntype MenuBeforeCloseEventDetail = { escPressed: boolean };\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-menu` component represents a hierarchical menu structure.\n *\n * ### Structure\n *\n * The `ui5-menu` can hold two types of entities:\n *\n * - `ui5-menu-item` components\n * - `ui5-menu-separator` - used to separate menu items with a line\n *\n * An arbitrary hierarchy structure can be represented by recursively nesting menu items.\n *\n * ### Keyboard Handling\n *\n * The `ui5-menu` provides advanced keyboard handling.\n * The user can use the following keyboard shortcuts in order to navigate trough the tree:\n *\n * - `Arrow Up` / `Arrow Down` - Navigates up and down the menu items that are currently visible.\n * - `Arrow Right`, `Space` or `Enter` - Opens a sub-menu if there are menu items nested\n * in the currently clicked menu item.\n * - `Arrow Left` or `Escape` - Closes the currently opened sub-menu.\n *\n * Note: if the text ditrection is set to Right-to-left (RTL), `Arrow Right` and `Arrow Left` functionality is swapped.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/Menu.js\";`\n * @constructor\n * @extends UI5Element\n * @since 1.3.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-menu\",\n\trenderer: litRender,\n\tstyles: menuCss,\n\ttemplate: menuTemplate,\n\tdependencies: [\n\t\tResponsivePopover,\n\t\tButton,\n\t\tList,\n\t\tMenuItem,\n\t\tMenuSeparator,\n\t\tBusyIndicator,\n\t],\n})\n\n/**\n * Fired when an item is being clicked.\n *\n * **Note:** Since 1.17.0 the event is preventable, allowing the menu to remain open after an item is pressed.\n * @allowPreventDefault\n * @param { HTMLElement } item The currently clicked menu item.\n * @param { string } text The text of the currently clicked menu item.\n * @public\n */\n@event<MenuItemClickEventDetail>(\"item-click\", {\n\tdetail: {\n\t\t/**\n\t\t * @public\n\t\t */\n\t\titem: {\n\t\t\ttype: HTMLElement,\n\t\t},\n\t\t/**\n\t\t * @public\n\t\t */\n\t\ttext: {\n\t\t\ttype: String,\n\t\t},\n\t},\n})\n\n/**\n * Fired before the menu is opened. This event can be cancelled, which will prevent the menu from opening. **This event does not bubble.**\n *\n * **Note:** Since 1.14.0 the event is also fired before a sub-menu opens.\n * @public\n * @allowPreventDefault\n * @since 1.10.0\n * @param { HTMLElement } item The `ui5-menu-item` that triggers opening of the sub-menu or undefined when fired upon root menu opening.\n */\n@event<MenuBeforeOpenEventDetail>(\"before-open\", {\n\tdetail: {\n\t\t/**\n\t\t * @public\n\t\t * @since 1.14.0\n\t\t */\n\t\titem: {\n\t\t\ttype: HTMLElement,\n\t\t},\n\t},\n})\n\n/**\n * Fired after the menu is opened. **This event does not bubble.**\n * @public\n * @since 1.10.0\n */\n@event(\"open\")\n\n/**\n * Fired before the menu is closed. This event can be cancelled, which will prevent the menu from closing. **This event does not bubble.**\n * @public\n * @allowPreventDefault\n * @param {boolean} escPressed Indicates that `ESC` key has triggered the event.\n * @since 1.10.0\n */\n@event<MenuBeforeCloseEventDetail>(\"before-close\", {\n\tdetail: {\n\t\t/**\n\t\t * @public\n\t\t */\n\t\tescPressed: {\n\t\t\ttype: Boolean,\n\t\t},\n\t},\n})\n\n/**\n * Fired after the menu is closed. **This event does not bubble.**\n * @public\n * @since 1.10.0\n */\n@event(\"close\")\n\nclass Menu extends UI5Element {\n\t/**\n\t * Defines the header text of the menu (displayed on mobile).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\theaderText?: string;\n\n\t/**\n\t * Indicates if the menu is open\n\t * @public\n\t * @default false\n\t * @since 1.10.0\n\t */\n\t@property({ type: Boolean })\n\topen = false;\n\n\t/**\n\t * Defines if a loading indicator would be displayed inside the corresponding ui5-menu popover.\n\t * @default false\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Boolean })\n\tloading = false;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the loading indicator will be displayed inside the corresponding ui5-menu popover..\n\t * @default 1000\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Number })\n\tloadingDelay = 1000;\n\n\t/**\n\t * Defines the ID or DOM Reference of the element at which the menu is shown.\n\t * When using this attribute in a declarative way, you must only use the `id` (as a string) of the element at which you want to show the popover.\n\t * You can only set the `opener` attribute to a DOM Reference when using JavaScript.\n\t * @public\n\t * @default undefined\n\t * @since 1.10.0\n\t */\n\t@property({ converter: DOMReferenceConverter })\n\topener?: HTMLElement | string;\n\n\t/**\n\t * Defines the items of this component.\n\t *\n\t * **Note:** Use `ui5-menu-item` and `ui5-menu-separator` for their intended design.\n\t * @public\n\t */\n\t@slot({ \"default\": true, type: HTMLElement, invalidateOnChildChange: true })\n\titems!: Array<IMenuItem>;\n\n\tstatic i18nBundle: I18nBundle;\n\t_timeout?: Timeout;\n\n\tstatic async onDefine() {\n\t\tMenu.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n\n\tget isRtl() {\n\t\treturn this.effectiveDir === \"rtl\";\n\t}\n\n\tget labelClose() {\n\t\treturn Menu.i18nBundle.getText(MENU_CLOSE_BUTTON_ARIA_LABEL);\n\t}\n\n\tget isPhone() {\n\t\treturn isPhone();\n\t}\n\n\tget _popover() {\n\t\treturn this.shadowRoot!.querySelector<ResponsivePopover>(\"[ui5-responsive-popover]\")!;\n\t}\n\n\tget _menuItems() {\n\t\treturn this.items.filter((item): item is MenuItem => !item.isSeparator);\n\t}\n\n\tonBeforeRendering() {\n\t\tconst siblingsWithIcon = this._menuItems.some(menuItem => !!menuItem.icon);\n\n\t\tthis._menuItems.forEach(item => {\n\t\t\titem._siblingsWithIcon = siblingsWithIcon;\n\t\t});\n\t}\n\n\t_close() {\n\t\tthis.open = false;\n\t}\n\n\t_openItemSubMenu(item: MenuItem) {\n\t\tclearTimeout(this._timeout);\n\n\t\tif (!item._popover || item._popover.open) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.fireEvent<MenuBeforeOpenEventDetail>(\"before-open\", {\n\t\t\titem,\n\t\t}, false, false);\n\t\titem._popover.opener = item;\n\t\titem._popover.open = true;\n\t\titem.selected = true;\n\t}\n\n\t_closeItemSubMenu(item: MenuItem) {\n\t\tif (item && item._popover) {\n\t\t\tconst openedSibling = item._menuItems.find(menuItem => menuItem._popover && menuItem._popover.open);\n\t\t\tif (openedSibling) {\n\t\t\t\tthis._closeItemSubMenu(openedSibling);\n\t\t\t}\n\n\t\t\titem._popover.open = false;\n\t\t\titem.selected = false;\n\t\t}\n\t}\n\n\t_itemMouseOver(e: MouseEvent) {\n\t\tif (isDesktop()) {\n\t\t\t// respect mouseover only on desktop\n\t\t\tconst item = e.target as MenuItem;\n\n\t\t\tif (item.hasAttribute(\"ui5-menu-item\")) {\n\t\t\t\titem.focus();\n\n\t\t\t\t// Opens submenu with 300ms delay\n\t\t\t\tthis._startOpenTimeout(item);\n\t\t\t}\n\t\t}\n\t}\n\n\t_startOpenTimeout(item: MenuItem) {\n\t\tclearTimeout(this._timeout);\n\n\t\tthis._timeout = setTimeout(() => {\n\t\t\tconst opener = item.parentElement as MenuItem | Menu;\n\t\t\tconst openedSibling = opener && opener._menuItems.find(menuItem => menuItem._popover && menuItem._popover.open);\n\t\t\tif (openedSibling) {\n\t\t\t\tthis._closeItemSubMenu(openedSibling);\n\t\t\t}\n\n\t\t\tthis._openItemSubMenu(item);\n\t\t}, MENU_OPEN_DELAY);\n\t}\n\n\t_itemClick(e: CustomEvent<ListItemClickEventDetail>) {\n\t\tconst item = e.detail.item as MenuItem;\n\n\t\tif (!item._popover) {\n\t\t\tconst prevented = !this.fireEvent<MenuItemClickEventDetail>(\"item-click\", {\n\t\t\t\t\"item\": item,\n\t\t\t\t\"text\": item.text || \"\",\n\t\t\t}, true, false);\n\n\t\t\tif (!prevented && this._popover) {\n\t\t\t\titem.fireEvent(\"close-menu\", {});\n\t\t\t}\n\t\t} else {\n\t\t\tthis._openItemSubMenu(item);\n\t\t}\n\t}\n\n\t_itemKeyDown(e: KeyboardEvent) {\n\t\tif (!isLeft(e) && !isRight(e)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst shouldCloseMenu = this.isRtl ? isRight(e) : isLeft(e);\n\t\tconst shouldOpenMenu = this.isRtl ? isLeft(e) : isRight(e);\n\t\tconst item = e.target as MenuItem;\n\t\tconst parentElement = item.parentElement as MenuItem;\n\n\t\tif (isEnter(e)) {\n\t\t\te.preventDefault();\n\t\t}\n\t\tif (shouldOpenMenu) {\n\t\t\tthis._openItemSubMenu(item);\n\t\t} else if (shouldCloseMenu && parentElement.hasAttribute(\"ui5-menu-item\") && parentElement._popover) {\n\t\t\tparentElement._popover.open = false;\n\t\t\tparentElement.selected = false;\n\t\t\t(parentElement._popover.opener as HTMLElement)?.focus();\n\t\t}\n\t}\n\n\t_beforePopoverOpen(e: CustomEvent) {\n\t\tconst prevented = !this.fireEvent<MenuBeforeOpenEventDetail>(\"before-open\", {}, true, true);\n\n\t\tif (prevented) {\n\t\t\tthis.open = false;\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_afterPopoverOpen() {\n\t\tthis._menuItems[0]?.focus();\n\t\tthis.fireEvent(\"open\", {}, false, true);\n\t}\n\n\t_beforePopoverClose(e: CustomEvent<ResponsivePopoverBeforeCloseEventDetail>) {\n\t\tconst prevented = !this.fireEvent<MenuBeforeCloseEventDetail>(\"before-close\", { escPressed: e.detail.escPressed }, true, true);\n\n\t\tif (prevented) {\n\t\t\tthis.open = true;\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_afterPopoverClose() {\n\t\tthis.open = false;\n\t\tthis.fireEvent(\"close\", {}, false, true);\n\t}\n}\n\nMenu.define();\n\nexport default Menu;\nexport type {\n\tMenuItemClickEventDetail,\n\tMenuBeforeCloseEventDetail,\n\tMenuBeforeOpenEventDetail,\n\tIMenuItem,\n};\n"]}
|
package/dist/MenuItem.js
CHANGED
|
@@ -85,7 +85,7 @@ let MenuItem = MenuItem_1 = class MenuItem extends ListItem {
|
|
|
85
85
|
return this.effectiveDir === "rtl";
|
|
86
86
|
}
|
|
87
87
|
get hasSubmenu() {
|
|
88
|
-
return !!(this.items.length || this.loading);
|
|
88
|
+
return !!(this.items.length || this.loading) && !this.disabled;
|
|
89
89
|
}
|
|
90
90
|
get hasEndContent() {
|
|
91
91
|
return !!(this.endContent.length);
|
|
@@ -168,6 +168,9 @@ let MenuItem = MenuItem_1 = class MenuItem extends ListItem {
|
|
|
168
168
|
this.selected = false;
|
|
169
169
|
if (e.detail.escPressed) {
|
|
170
170
|
this.focus();
|
|
171
|
+
if (isPhone()) {
|
|
172
|
+
this.fireEvent("close-menu", {});
|
|
173
|
+
}
|
|
171
174
|
}
|
|
172
175
|
}
|
|
173
176
|
_afterPopoverClose() {
|
package/dist/MenuItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sourceRoot":"","sources":["../src/MenuItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACjE,OAAO,YAAY,MAAM,oDAAoD,CAAC;AAC9E,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAEvD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,gBAAgB,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EACN,2BAA2B,EAC3B,4BAA4B,GAC5B,MAAM,mCAAmC,CAAC;AAI3C,SAAS;AACT,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAK7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAO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Q,EAAE;sCACG;AAUd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CACX;AAWjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCACZ;AAShB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CACP;AASpB;IADC,QAAQ,EAAE;gDACa;AASxB;IADC,QAAQ,EAAE;yCACM;AAMjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;mDACrB;AAgB1B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;uCACnD;AAgBzB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;4CACI;AA7H3B,QAAQ;IANb,aAAa,CAAC;QACd,GAAG,EAAE,eAAe;QACpB,QAAQ,EAAE,gBAAgB;QAC1B,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;QACtC,YAAY,EAAE,CAAC,GAAG,QAAQ,CAAC,YAAY,EAAE,iBAAiB,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,CAAC;KACtF,CAAC;GACI,QAAQ,CAyPb;AAED,QAAQ,CAAC,MAAM,EAAE,CAAC;AAElB,eAAe,QAAQ,CAAC","sourcesContent":["import 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 { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { isPhone } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport AriaHasPopup from \"@ui5/webcomponents-base/dist/types/AriaHasPopup.js\";\nimport ListItem from \"./ListItem.js\";\nimport ResponsivePopover from \"./ResponsivePopover.js\";\nimport type PopoverPlacement from \"./types/PopoverPlacement.js\";\nimport List from \"./List.js\";\nimport Icon from \"./Icon.js\";\nimport BusyIndicator from \"./BusyIndicator.js\";\nimport MenuItemTemplate from \"./generated/templates/MenuItemTemplate.lit.js\";\nimport {\n\tMENU_BACK_BUTTON_ARIA_LABEL,\n\tMENU_CLOSE_BUTTON_ARIA_LABEL,\n} from \"./generated/i18n/i18n-defaults.js\";\nimport type { ResponsivePopoverBeforeCloseEventDetail } from \"./ResponsivePopover.js\";\nimport type { IMenuItem } from \"./Menu.js\";\n\n// Styles\nimport menuItemCss from \"./generated/themes/MenuItem.css.js\";\n\ntype MenuBeforeOpenEventDetail = { item?: MenuItem };\ntype MenuBeforeCloseEventDetail = { escPressed: boolean };\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-menu-item` is the item to use inside a `ui5-menu`.\n * An arbitrary hierarchy structure can be represented by recursively nesting menu items.\n *\n * ### Usage\n *\n * `ui5-menu-item` represents a node in a `ui5-menu`. The menu itself is rendered as a list,\n * and each `ui5-menu-item` is represented by a list item in that list. Therefore, you should only use\n * `ui5-menu-item` directly in your apps. The `ui5-li` list item is internal for the list, and not intended for public use.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/MenuItem.js\";`\n * @constructor\n * @extends ListItem\n * @implements {IMenuItem}\n * @since 1.3.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-menu-item\",\n\ttemplate: MenuItemTemplate,\n\tstyles: [ListItem.styles, menuItemCss],\n\tdependencies: [...ListItem.dependencies, ResponsivePopover, List, BusyIndicator, Icon],\n})\nclass MenuItem extends ListItem implements IMenuItem {\n\tstatic async onDefine() {\n\t\tMenuItem.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n\n\t/**\n\t * Defines the text of the tree item.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ttext?: string;\n\n\t/**\n\t * Defines the `additionalText`, displayed in the end of the menu item.\n\t *\n\t * **Note:** The additional text will not be displayed if there are items added in `items` slot or there are\n\t * components added to `endContent` slot.\n\t *\n\t * The priority of what will be displayed at the end of the menu item is as follows:\n\t * sub-menu arrow (if there are items added in `items` slot) -> components added in `endContent` -> text set to `additionalText`.\n\t * @default undefined\n\t * @public\n\t * @since 1.8.0\n\t */\n\t@property()\n\tadditionalText?: string;\n\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * **Example:**\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 whether `ui5-menu-item` is in disabled state.\n\t *\n\t * **Note:** A disabled `ui5-menu-item` is noninteractive.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the loading indicator will be displayed inside the corresponding ui5-menu popover.\n\t *\n\t * **Note:** If set to `true` a `ui5-busy-indicator` component will be displayed into the related one to the current `ui5-menu-item` sub-menu popover.\n\t * @default false\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Boolean })\n\tloading = false;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the loading indicator will be displayed inside the corresponding ui5-menu popover.\n\t * @default 1000\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Number })\n\tloadingDelay = 1000;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.7.0\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the text of the tooltip for the menu item.\n\t * @default undefined\n\t * @public\n\t * @since 1.23.0\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * Indicates whether any of the element siblings have icon.\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_siblingsWithIcon = false;\n\n\t/**\n\t * Defines the items of this component.\n\t *\n\t * **Note:** The slot can hold `ui5-menu-item` and `ui5-menu-separator` items.\n\t *\n\t * If there are items added to this slot, an arrow will be displayed at the end\n\t * of the item in order to indicate that there are items added. In that case components added\n\t * to `endContent` slot or `additionalText` content will not be displayed.\n\t *\n\t * The priority of what will be displayed at the end of the menu item is as follows:\n\t * sub-menu arrow (if there are items added in `items` slot) -> components added in `endContent` -> text set to `additionalText`.\n\t * @public\n\t */\n\t@slot({ \"default\": true, type: HTMLElement, invalidateOnChildChange: true })\n\titems!: Array<IMenuItem>;\n\n\t/**\n\t * Defines the components that should be displayed at the end of the menu item.\n\t *\n\t * **Note:** It is highly recommended to slot only components of type `ui5-button`,`ui5-link`\n\t * or `ui5-icon` in order to preserve the intended design. If there are components added to this slot,\n\t * and there is text set in `additionalText`, it will not be displayed. If there are items added to `items` slot,\n\t * nether `additionalText` nor components added to this slot would be displayed.\n\t *\n\t * The priority of what will be displayed at the end of the menu item is as follows:\n\t * sub-menu arrow (if there are items added in `items` slot) -> components added in `endContent` -> text set to `additionalText`.\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@slot({ type: HTMLElement })\n\tendContent!: Array<HTMLElement>;\n\n\tget placement(): `${PopoverPlacement}` {\n\t\treturn this.isRtl ? \"Start\" : \"End\";\n\t}\n\n\tget isRtl() {\n\t\treturn this.effectiveDir === \"rtl\";\n\t}\n\n\tget hasSubmenu() {\n\t\treturn !!(this.items.length || this.loading);\n\t}\n\n\tget hasEndContent() {\n\t\treturn !!(this.endContent.length);\n\t}\n\n\tget hasIcon() {\n\t\treturn !!this.icon;\n\t}\n\n\tget isSubMenuOpen() {\n\t\treturn this._popover?.open;\n\t}\n\n\tget ariaLabelledByText() {\n\t\treturn `${this.text} ${this.accessibleName}`.trim();\n\t}\n\n\tget menuHeaderTextPhone() {\n\t\treturn this.text;\n\t}\n\n\tget isPhone() {\n\t\treturn isPhone();\n\t}\n\n\tget labelBack() {\n\t\treturn MenuItem.i18nBundle.getText(MENU_BACK_BUTTON_ARIA_LABEL);\n\t}\n\n\tget labelClose() {\n\t\treturn MenuItem.i18nBundle.getText(MENU_CLOSE_BUTTON_ARIA_LABEL);\n\t}\n\n\tget isSeparator(): boolean {\n\t\treturn false;\n\t}\n\n\tonBeforeRendering() {\n\t\tconst siblingsWithIcon = this._menuItems.some(menuItem => !!menuItem.icon);\n\n\t\tthis._menuItems.forEach(item => {\n\t\t\titem._siblingsWithIcon = siblingsWithIcon;\n\t\t});\n\t}\n\n\tget _focusable() {\n\t\treturn true;\n\t}\n\n\tget _accInfo() {\n\t\tconst accInfoSettings = {\n\t\t\trole: \"menuitem\",\n\t\t\tariaHaspopup: this.hasSubmenu ? AriaHasPopup.Menu.toLowerCase() as Lowercase<AriaHasPopup> : undefined,\n\t\t};\n\n\t\treturn { ...super._accInfo, ...accInfoSettings };\n\t}\n\n\tget _popover() {\n\t\treturn this.shadowRoot!.querySelector<ResponsivePopover>(\"[ui5-responsive-popover]\")!;\n\t}\n\n\tget _menuItems() {\n\t\treturn this.items.filter((item): item is MenuItem => !item.isSeparator);\n\t}\n\n\t_closeAll() {\n\t\tif (this._popover) {\n\t\t\tthis._popover.open = false;\n\t\t}\n\t\tthis.selected = false;\n\t\tthis.fireEvent(\"close-menu\", {});\n\t}\n\n\t_close() {\n\t\tif (this._popover) {\n\t\t\tthis._popover.open = false;\n\t\t}\n\t\tthis.selected = false;\n\t}\n\n\t_beforePopoverOpen(e: CustomEvent) {\n\t\tconst prevented = !this.fireEvent<MenuBeforeOpenEventDetail>(\"before-open\", {}, true, false);\n\n\t\tif (prevented) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_afterPopoverOpen() {\n\t\tthis.items[0]?.focus();\n\t\tthis.fireEvent(\"open\", {}, false, false);\n\t}\n\n\t_beforePopoverClose(e: CustomEvent<ResponsivePopoverBeforeCloseEventDetail>) {\n\t\tconst prevented = !this.fireEvent<MenuBeforeCloseEventDetail>(\"before-close\", { escPressed: e.detail.escPressed }, true, false);\n\n\t\tif (prevented) {\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.selected = false;\n\t\tif (e.detail.escPressed) {\n\t\t\tthis.focus();\n\t\t}\n\t}\n\n\t_afterPopoverClose() {\n\t\tthis.fireEvent(\"close\", {}, false, false);\n\t}\n}\n\nMenuItem.define();\n\nexport default MenuItem;\n\nexport type {\n\tMenuBeforeCloseEventDetail,\n\tMenuBeforeOpenEventDetail,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sourceRoot":"","sources":["../src/MenuItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACjE,OAAO,YAAY,MAAM,oDAAoD,CAAC;AAC9E,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAEvD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,gBAAgB,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EACN,2BAA2B,EAC3B,4BAA4B,GAC5B,MAAM,mCAAmC,CAAC;AAI3C,SAAS;AACT,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAK7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,IAAM,QAAQ,gBAAd,MAAM,QAAS,SAAQ,QAAQ;IAA/B;;QAyCC;;;;;;WAMG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAEjB;;;;;;;WAOG;QAEH,YAAO,GAAG,KAAK,CAAC;QAEhB;;;;;WAKG;QAEH,iBAAY,GAAG,IAA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;0CACX;AAWjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCACZ;AAShB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CACP;AASpB;IADC,QAAQ,EAAE;gDACa;AASxB;IADC,QAAQ,EAAE;yCACM;AAMjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;mDACrB;AAgB1B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;uCACnD;AAgBzB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;4CACI;AA7H3B,QAAQ;IANb,aAAa,CAAC;QACd,GAAG,EAAE,eAAe;QACpB,QAAQ,EAAE,gBAAgB;QAC1B,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;QACtC,YAAY,EAAE,CAAC,GAAG,QAAQ,CAAC,YAAY,EAAE,iBAAiB,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,CAAC;KACtF,CAAC;GACI,QAAQ,CA4Pb;AAED,QAAQ,CAAC,MAAM,EAAE,CAAC;AAElB,eAAe,QAAQ,CAAC","sourcesContent":["import 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 { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { isPhone } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport AriaHasPopup from \"@ui5/webcomponents-base/dist/types/AriaHasPopup.js\";\nimport ListItem from \"./ListItem.js\";\nimport ResponsivePopover from \"./ResponsivePopover.js\";\nimport type PopoverPlacement from \"./types/PopoverPlacement.js\";\nimport List from \"./List.js\";\nimport Icon from \"./Icon.js\";\nimport BusyIndicator from \"./BusyIndicator.js\";\nimport MenuItemTemplate from \"./generated/templates/MenuItemTemplate.lit.js\";\nimport {\n\tMENU_BACK_BUTTON_ARIA_LABEL,\n\tMENU_CLOSE_BUTTON_ARIA_LABEL,\n} from \"./generated/i18n/i18n-defaults.js\";\nimport type { ResponsivePopoverBeforeCloseEventDetail } from \"./ResponsivePopover.js\";\nimport type { IMenuItem } from \"./Menu.js\";\n\n// Styles\nimport menuItemCss from \"./generated/themes/MenuItem.css.js\";\n\ntype MenuBeforeOpenEventDetail = { item?: MenuItem };\ntype MenuBeforeCloseEventDetail = { escPressed: boolean };\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-menu-item` is the item to use inside a `ui5-menu`.\n * An arbitrary hierarchy structure can be represented by recursively nesting menu items.\n *\n * ### Usage\n *\n * `ui5-menu-item` represents a node in a `ui5-menu`. The menu itself is rendered as a list,\n * and each `ui5-menu-item` is represented by a list item in that list. Therefore, you should only use\n * `ui5-menu-item` directly in your apps. The `ui5-li` list item is internal for the list, and not intended for public use.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/MenuItem.js\";`\n * @constructor\n * @extends ListItem\n * @implements {IMenuItem}\n * @since 1.3.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-menu-item\",\n\ttemplate: MenuItemTemplate,\n\tstyles: [ListItem.styles, menuItemCss],\n\tdependencies: [...ListItem.dependencies, ResponsivePopover, List, BusyIndicator, Icon],\n})\nclass MenuItem extends ListItem implements IMenuItem {\n\tstatic async onDefine() {\n\t\tMenuItem.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n\n\t/**\n\t * Defines the text of the tree item.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ttext?: string;\n\n\t/**\n\t * Defines the `additionalText`, displayed in the end of the menu item.\n\t *\n\t * **Note:** The additional text will not be displayed if there are items added in `items` slot or there are\n\t * components added to `endContent` slot.\n\t *\n\t * The priority of what will be displayed at the end of the menu item is as follows:\n\t * sub-menu arrow (if there are items added in `items` slot) -> components added in `endContent` -> text set to `additionalText`.\n\t * @default undefined\n\t * @public\n\t * @since 1.8.0\n\t */\n\t@property()\n\tadditionalText?: string;\n\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * **Example:**\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 whether `ui5-menu-item` is in disabled state.\n\t *\n\t * **Note:** A disabled `ui5-menu-item` is noninteractive.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the loading indicator will be displayed inside the corresponding ui5-menu popover.\n\t *\n\t * **Note:** If set to `true` a `ui5-busy-indicator` component will be displayed into the related one to the current `ui5-menu-item` sub-menu popover.\n\t * @default false\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Boolean })\n\tloading = false;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the loading indicator will be displayed inside the corresponding ui5-menu popover.\n\t * @default 1000\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Number })\n\tloadingDelay = 1000;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.7.0\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the text of the tooltip for the menu item.\n\t * @default undefined\n\t * @public\n\t * @since 1.23.0\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * Indicates whether any of the element siblings have icon.\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_siblingsWithIcon = false;\n\n\t/**\n\t * Defines the items of this component.\n\t *\n\t * **Note:** The slot can hold `ui5-menu-item` and `ui5-menu-separator` items.\n\t *\n\t * If there are items added to this slot, an arrow will be displayed at the end\n\t * of the item in order to indicate that there are items added. In that case components added\n\t * to `endContent` slot or `additionalText` content will not be displayed.\n\t *\n\t * The priority of what will be displayed at the end of the menu item is as follows:\n\t * sub-menu arrow (if there are items added in `items` slot) -> components added in `endContent` -> text set to `additionalText`.\n\t * @public\n\t */\n\t@slot({ \"default\": true, type: HTMLElement, invalidateOnChildChange: true })\n\titems!: Array<IMenuItem>;\n\n\t/**\n\t * Defines the components that should be displayed at the end of the menu item.\n\t *\n\t * **Note:** It is highly recommended to slot only components of type `ui5-button`,`ui5-link`\n\t * or `ui5-icon` in order to preserve the intended design. If there are components added to this slot,\n\t * and there is text set in `additionalText`, it will not be displayed. If there are items added to `items` slot,\n\t * nether `additionalText` nor components added to this slot would be displayed.\n\t *\n\t * The priority of what will be displayed at the end of the menu item is as follows:\n\t * sub-menu arrow (if there are items added in `items` slot) -> components added in `endContent` -> text set to `additionalText`.\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@slot({ type: HTMLElement })\n\tendContent!: Array<HTMLElement>;\n\n\tget placement(): `${PopoverPlacement}` {\n\t\treturn this.isRtl ? \"Start\" : \"End\";\n\t}\n\n\tget isRtl() {\n\t\treturn this.effectiveDir === \"rtl\";\n\t}\n\n\tget hasSubmenu() {\n\t\treturn !!(this.items.length || this.loading) && !this.disabled;\n\t}\n\n\tget hasEndContent() {\n\t\treturn !!(this.endContent.length);\n\t}\n\n\tget hasIcon() {\n\t\treturn !!this.icon;\n\t}\n\n\tget isSubMenuOpen() {\n\t\treturn this._popover?.open;\n\t}\n\n\tget ariaLabelledByText() {\n\t\treturn `${this.text} ${this.accessibleName}`.trim();\n\t}\n\n\tget menuHeaderTextPhone() {\n\t\treturn this.text;\n\t}\n\n\tget isPhone() {\n\t\treturn isPhone();\n\t}\n\n\tget labelBack() {\n\t\treturn MenuItem.i18nBundle.getText(MENU_BACK_BUTTON_ARIA_LABEL);\n\t}\n\n\tget labelClose() {\n\t\treturn MenuItem.i18nBundle.getText(MENU_CLOSE_BUTTON_ARIA_LABEL);\n\t}\n\n\tget isSeparator(): boolean {\n\t\treturn false;\n\t}\n\n\tonBeforeRendering() {\n\t\tconst siblingsWithIcon = this._menuItems.some(menuItem => !!menuItem.icon);\n\n\t\tthis._menuItems.forEach(item => {\n\t\t\titem._siblingsWithIcon = siblingsWithIcon;\n\t\t});\n\t}\n\n\tget _focusable() {\n\t\treturn true;\n\t}\n\n\tget _accInfo() {\n\t\tconst accInfoSettings = {\n\t\t\trole: \"menuitem\",\n\t\t\tariaHaspopup: this.hasSubmenu ? AriaHasPopup.Menu.toLowerCase() as Lowercase<AriaHasPopup> : undefined,\n\t\t};\n\n\t\treturn { ...super._accInfo, ...accInfoSettings };\n\t}\n\n\tget _popover() {\n\t\treturn this.shadowRoot!.querySelector<ResponsivePopover>(\"[ui5-responsive-popover]\")!;\n\t}\n\n\tget _menuItems() {\n\t\treturn this.items.filter((item): item is MenuItem => !item.isSeparator);\n\t}\n\n\t_closeAll() {\n\t\tif (this._popover) {\n\t\t\tthis._popover.open = false;\n\t\t}\n\t\tthis.selected = false;\n\t\tthis.fireEvent(\"close-menu\", {});\n\t}\n\n\t_close() {\n\t\tif (this._popover) {\n\t\t\tthis._popover.open = false;\n\t\t}\n\t\tthis.selected = false;\n\t}\n\n\t_beforePopoverOpen(e: CustomEvent) {\n\t\tconst prevented = !this.fireEvent<MenuBeforeOpenEventDetail>(\"before-open\", {}, true, false);\n\n\t\tif (prevented) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_afterPopoverOpen() {\n\t\tthis.items[0]?.focus();\n\t\tthis.fireEvent(\"open\", {}, false, false);\n\t}\n\n\t_beforePopoverClose(e: CustomEvent<ResponsivePopoverBeforeCloseEventDetail>) {\n\t\tconst prevented = !this.fireEvent<MenuBeforeCloseEventDetail>(\"before-close\", { escPressed: e.detail.escPressed }, true, false);\n\n\t\tif (prevented) {\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.selected = false;\n\t\tif (e.detail.escPressed) {\n\t\t\tthis.focus();\n\t\t\tif (isPhone()) {\n\t\t\t\tthis.fireEvent(\"close-menu\", {});\n\t\t\t}\n\t\t}\n\t}\n\n\t_afterPopoverClose() {\n\t\tthis.fireEvent(\"close\", {}, false, false);\n\t}\n}\n\nMenuItem.define();\n\nexport default MenuItem;\n\nexport type {\n\tMenuBeforeCloseEventDetail,\n\tMenuBeforeOpenEventDetail,\n};\n"]}
|
package/dist/MessageStrip.d.ts
CHANGED
|
@@ -22,10 +22,11 @@ type DesignTypeAnnouncemnt = Record<MessageStripDesign, string>;
|
|
|
22
22
|
*
|
|
23
23
|
* ### Overview
|
|
24
24
|
*
|
|
25
|
-
* The
|
|
26
|
-
* It
|
|
27
|
-
*
|
|
28
|
-
*
|
|
25
|
+
* The ui5-message-strip component allows for the embedding of application-related messages.
|
|
26
|
+
* It supports four semantic designs, each with its own color and icon: "Information", "Positive", "Critical", and "Negative".
|
|
27
|
+
* Additionally, users can choose from two color sets ("ColorSet1" and "ColorSet2"), each containing 10 predefined color schemes.
|
|
28
|
+
* Each message shows a "Close" button, so that it can be removed from the UI, if needed.
|
|
29
|
+
|
|
29
30
|
* ### Usage
|
|
30
31
|
*
|
|
31
32
|
* For the `ui5-message-strip` component, you can define whether it displays
|
package/dist/MessageStrip.js
CHANGED
|
@@ -38,10 +38,11 @@ var DesignClassesMapping;
|
|
|
38
38
|
*
|
|
39
39
|
* ### Overview
|
|
40
40
|
*
|
|
41
|
-
* The
|
|
42
|
-
* It
|
|
43
|
-
*
|
|
44
|
-
*
|
|
41
|
+
* The ui5-message-strip component allows for the embedding of application-related messages.
|
|
42
|
+
* It supports four semantic designs, each with its own color and icon: "Information", "Positive", "Critical", and "Negative".
|
|
43
|
+
* Additionally, users can choose from two color sets ("ColorSet1" and "ColorSet2"), each containing 10 predefined color schemes.
|
|
44
|
+
* Each message shows a "Close" button, so that it can be removed from the UI, if needed.
|
|
45
|
+
|
|
45
46
|
* ### Usage
|
|
46
47
|
*
|
|
47
48
|
* For the `ui5-message-strip` component, you can define whether it displays
|
package/dist/MessageStrip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageStrip.js","sourceRoot":"","sources":["../src/MessageStrip.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AAIrF,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,0CAA0C,CAAC;AAClD,OAAO,8CAA8C,CAAC;AACtD,OAAO,8CAA8C,CAAC;AACtD,OAAO,wCAAwC,CAAC;AAChD,OAAO,wCAAwC,CAAC;AAChD,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,oBAAoB,MAAM,mDAAmD,CAAC;AAErF,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EACN,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,SAAS;AACT,OAAO,eAAe,MAAM,wCAAwC,CAAC;AAErE,IAAK,oBAOJ;AAPD,WAAK,oBAAoB;IACxB,oEAA4C,CAAA;IAC5C,qEAA6C,CAAA;IAC7C,qEAA6C,CAAA;IAC7C,qEAA6C,CAAA;IAC7C,yEAAiD,CAAA;IACjD,yEAAiD,CAAA;AAClD,CAAC,EAPI,oBAAoB,KAApB,oBAAoB,QAOxB;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAg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O,EAAE,CAAC;8CACZ;AAQhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qDACJ;AAYxB;IADC,IAAI,EAAE;0CACa;AArDf,YAAY;IAfjB,aAAa,CAAC;QACd,GAAG,EAAE,mBAAmB;QACxB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,oBAAoB;QAC9B,MAAM,EAAE,eAAe;QACvB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF;;;;OAIG;;IACF,KAAK,CAAC,OAAO,CAAC;GAET,YAAY,CAqIjB;AAED,YAAY,CAAC,MAAM,EAAE,CAAC;AAEtB,eAAe,YAAY,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.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.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport type { ClassMap } from \"@ui5/webcomponents-base/dist/types.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport \"@ui5/webcomponents-icons/dist/decline.js\";\nimport \"@ui5/webcomponents-icons/dist/information.js\";\nimport \"@ui5/webcomponents-icons/dist/sys-enter-2.js\";\nimport \"@ui5/webcomponents-icons/dist/error.js\";\nimport \"@ui5/webcomponents-icons/dist/alert.js\";\nimport MessageStripDesign from \"./types/MessageStripDesign.js\";\nimport MessageStripTemplate from \"./generated/templates/MessageStripTemplate.lit.js\";\nimport type { IIcon } from \"./Icon.js\";\nimport Icon from \"./Icon.js\";\nimport Button from \"./Button.js\";\nimport {\n\tMESSAGE_STRIP_CLOSE_BUTTON,\n\tMESSAGE_STRIP_CLOSABLE,\n\tMESSAGE_STRIP_ERROR,\n\tMESSAGE_STRIP_WARNING,\n\tMESSAGE_STRIP_SUCCESS,\n\tMESSAGE_STRIP_INFORMATION,\n\tMESSAGE_STRIP_CUSTOM,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport messageStripCss from \"./generated/themes/MessageStrip.css.js\";\n\nenum DesignClassesMapping {\n\tInformation = \"ui5-message-strip-root--info\",\n\tPositive = \"ui5-message-strip-root--positive\",\n\tNegative = \"ui5-message-strip-root--negative\",\n\tCritical = \"ui5-message-strip-root--critical\",\n\tColorSet1 = \"ui5-message-strip-root--color-set-1\",\n\tColorSet2 = \"ui5-message-strip-root--color-set-2\",\n}\n\ntype DesignTypeAnnouncemnt = Record<MessageStripDesign, string>;\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-message-strip` component enables the embedding of app-related messages.\n * It displays 4 designs of messages, each with corresponding semantic color and icon: Information, Positive, Critical and Negative.\n * Each message can have a Close button, so that it can be removed from the UI, if needed.\n *\n * ### Usage\n *\n * For the `ui5-message-strip` component, you can define whether it displays\n * an icon in the beginning and a close button. Moreover, its size and background\n * can be controlled with CSS.\n *\n * ### Keyboard Handling\n *\n * #### Fast Navigation\n * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up].\n * In order to use this functionality, you need to import the following module:\n * `import \"@ui5/webcomponents-base/dist/features/F6Navigation.js\"`\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/MessageStrip.js\";`\n * @constructor\n * @extends UI5Element\n * @public\n * @since 0.9.0\n * @slot {Array<Node>} default\n * Defines the text of the component.\n *\n * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n */\n@customElement({\n\ttag: \"ui5-message-strip\",\n\tlanguageAware: true,\n\trenderer: litRender,\n\ttemplate: MessageStripTemplate,\n\tstyles: messageStripCss,\n\tdependencies: [Icon, Button],\n})\n/**\n * Fired when the close button is pressed either with a\n * click/tap or by using the Enter or Space key.\n * @public\n */\n@event(\"close\")\n\nclass MessageStrip extends UI5Element {\n\t/**\n\t * Defines the component type.\n\t * @default \"Information\"\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\tdesign: `${MessageStripDesign}` = \"Information\";\n\n\t/**\n\t * Defines the color scheme of the component.\n\t * There are 10 predefined schemes.\n\t * To use one you can set a number from `\"1\"` to `\"10\"`. The `colorScheme` `\"1\"` will be set by default.\n\t *\n\t * @default \"1\"\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property()\n\tcolorScheme = \"1\"\n\n\t/**\n\t * Defines whether the MessageStrip will show an icon in the beginning.\n\t * You can directly provide an icon with the `icon` slot. Otherwise, the default icon for the type will be used.\n\t *\n\t * * **Note:** If <code>MessageStripDesign.ColorSet1</code> or <code>MessageStripDesign.ColorSet2</code> value is set to the <code>design</code> property, default icon will not be presented.\n\t *\n\t * @default false\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property({ type: Boolean })\n\thideIcon = false\n\n\t/**\n\t * Defines whether the MessageStrip renders close button.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\thideCloseButton = false;\n\n\t/**\n\t * Defines the content to be displayed as graphical element within the component.\n\t *\n\t * **Note:** If no icon is given, the default icon for the component type will be used.\n\t * The SAP-icons font provides numerous options.\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 * @public\n\t */\n\t@slot()\n\ticon!: Array<IIcon>;\n\n\tstatic i18nBundle: I18nBundle;\n\n\t_closeClick() {\n\t\tthis.fireEvent(\"close\");\n\t}\n\n\tstatic async onDefine() {\n\t\tMessageStrip.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n\n\tstatic designAnnouncementMappings(): DesignTypeAnnouncemnt {\n\t\tconst getTranslation = (text:I18nText): string => {\n\t\t\treturn MessageStrip.i18nBundle.getText(text);\n\t\t};\n\n\t\treturn {\n\t\t\tInformation: getTranslation(MESSAGE_STRIP_INFORMATION),\n\t\t\tPositive: getTranslation(MESSAGE_STRIP_SUCCESS),\n\t\t\tNegative: getTranslation(MESSAGE_STRIP_ERROR),\n\t\t\tCritical: getTranslation(MESSAGE_STRIP_WARNING),\n\t\t\tColorSet1: getTranslation(MESSAGE_STRIP_CUSTOM),\n\t\t\tColorSet2: getTranslation(MESSAGE_STRIP_CUSTOM),\n\t\t};\n\t}\n\n\tget hiddenText() {\n\t\treturn `${MessageStrip.designAnnouncementMappings()[this.design]} ${this.hideCloseButton ? \"\" : this._closableText}`;\n\t}\n\n\tget shouldHideIcon() {\n\t\tif (this.designClasses === DesignClassesMapping.ColorSet1 || this.designClasses === DesignClassesMapping.ColorSet2) {\n\t\t\treturn this.hideIcon || this.icon.length === 0;\n\t\t}\n\n\t\treturn this.hideIcon;\n\t}\n\n\tget _closeButtonText() {\n\t\treturn MessageStrip.i18nBundle.getText(MESSAGE_STRIP_CLOSE_BUTTON);\n\t}\n\n\tget _closableText() {\n\t\treturn MessageStrip.i18nBundle.getText(MESSAGE_STRIP_CLOSABLE);\n\t}\n\n\tget classes(): ClassMap {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\t\"ui5-message-strip-root\": true,\n\t\t\t\t\"ui5-message-strip-root-hide-icon\": this.shouldHideIcon,\n\t\t\t\t\"ui5-message-strip-root-hide-close-button\": this.hideCloseButton,\n\t\t\t\t[this.designClasses]: true,\n\t\t\t},\n\t\t};\n\t}\n\n\tget iconProvided() {\n\t\treturn this.icon.length > 0;\n\t}\n\n\tget standardIconName() {\n\t\tswitch (this.design) {\n\t\tcase MessageStripDesign.Critical:\n\t\t\treturn \"alert\";\n\t\tcase MessageStripDesign.Positive:\n\t\t\treturn \"sys-enter-2\";\n\t\tcase MessageStripDesign.Negative:\n\t\t\treturn \"error\";\n\t\tcase MessageStripDesign.Information:\n\t\t\treturn \"information\";\n\t\tdefault:\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tget designClasses() {\n\t\treturn DesignClassesMapping[this.design];\n\t}\n}\n\nMessageStrip.define();\n\nexport default MessageStrip;\n"]}
|
|
1
|
+
{"version":3,"file":"MessageStrip.js","sourceRoot":"","sources":["../src/MessageStrip.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AAIrF,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,0CAA0C,CAAC;AAClD,OAAO,8CAA8C,CAAC;AACtD,OAAO,8CAA8C,CAAC;AACtD,OAAO,wCAAwC,CAAC;AAChD,OAAO,wCAAwC,CAAC;AAChD,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,oBAAoB,MAAM,mDAAmD,CAAC;AAErF,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EACN,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,SAAS;AACT,OAAO,eAAe,MAAM,wCAAwC,CAAC;AAErE,IAAK,oBAOJ;AAPD,WAAK,oBAAoB;IACxB,oEAA4C,CAAA;IAC5C,qEAA6C,CAAA;IAC7C,qEAA6C,CAAA;IAC7C,qEAA6C,CAAA;IAC7C,yEAAiD,CAAA;IACjD,yEAA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AA;AA7HA;IADC,QAAQ,EAAE;4CACqC;AAYhD;IADC,QAAQ,EAAE;iDACM;AAajB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACZ;AAQhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qDACJ;AAYxB;IADC,IAAI,EAAE;0CACa;AArDf,YAAY;IAfjB,aAAa,CAAC;QACd,GAAG,EAAE,mBAAmB;QACxB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,oBAAoB;QAC9B,MAAM,EAAE,eAAe;QACvB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF;;;;OAIG;;IACF,KAAK,CAAC,OAAO,CAAC;GAET,YAAY,CAqIjB;AAED,YAAY,CAAC,MAAM,EAAE,CAAC;AAEtB,eAAe,YAAY,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.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.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport type { ClassMap } from \"@ui5/webcomponents-base/dist/types.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport \"@ui5/webcomponents-icons/dist/decline.js\";\nimport \"@ui5/webcomponents-icons/dist/information.js\";\nimport \"@ui5/webcomponents-icons/dist/sys-enter-2.js\";\nimport \"@ui5/webcomponents-icons/dist/error.js\";\nimport \"@ui5/webcomponents-icons/dist/alert.js\";\nimport MessageStripDesign from \"./types/MessageStripDesign.js\";\nimport MessageStripTemplate from \"./generated/templates/MessageStripTemplate.lit.js\";\nimport type { IIcon } from \"./Icon.js\";\nimport Icon from \"./Icon.js\";\nimport Button from \"./Button.js\";\nimport {\n\tMESSAGE_STRIP_CLOSE_BUTTON,\n\tMESSAGE_STRIP_CLOSABLE,\n\tMESSAGE_STRIP_ERROR,\n\tMESSAGE_STRIP_WARNING,\n\tMESSAGE_STRIP_SUCCESS,\n\tMESSAGE_STRIP_INFORMATION,\n\tMESSAGE_STRIP_CUSTOM,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport messageStripCss from \"./generated/themes/MessageStrip.css.js\";\n\nenum DesignClassesMapping {\n\tInformation = \"ui5-message-strip-root--info\",\n\tPositive = \"ui5-message-strip-root--positive\",\n\tNegative = \"ui5-message-strip-root--negative\",\n\tCritical = \"ui5-message-strip-root--critical\",\n\tColorSet1 = \"ui5-message-strip-root--color-set-1\",\n\tColorSet2 = \"ui5-message-strip-root--color-set-2\",\n}\n\ntype DesignTypeAnnouncemnt = Record<MessageStripDesign, string>;\n\n/**\n * @class\n *\n * ### Overview\n *\n * The ui5-message-strip component allows for the embedding of application-related messages.\n * It supports four semantic designs, each with its own color and icon: \"Information\", \"Positive\", \"Critical\", and \"Negative\".\n * Additionally, users can choose from two color sets (\"ColorSet1\" and \"ColorSet2\"), each containing 10 predefined color schemes.\n * Each message shows a \"Close\" button, so that it can be removed from the UI, if needed.\n\n * ### Usage\n *\n * For the `ui5-message-strip` component, you can define whether it displays\n * an icon in the beginning and a close button. Moreover, its size and background\n * can be controlled with CSS.\n *\n * ### Keyboard Handling\n *\n * #### Fast Navigation\n * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up].\n * In order to use this functionality, you need to import the following module:\n * `import \"@ui5/webcomponents-base/dist/features/F6Navigation.js\"`\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/MessageStrip.js\";`\n * @constructor\n * @extends UI5Element\n * @public\n * @since 0.9.0\n * @slot {Array<Node>} default\n * Defines the text of the component.\n *\n * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n */\n@customElement({\n\ttag: \"ui5-message-strip\",\n\tlanguageAware: true,\n\trenderer: litRender,\n\ttemplate: MessageStripTemplate,\n\tstyles: messageStripCss,\n\tdependencies: [Icon, Button],\n})\n/**\n * Fired when the close button is pressed either with a\n * click/tap or by using the Enter or Space key.\n * @public\n */\n@event(\"close\")\n\nclass MessageStrip extends UI5Element {\n\t/**\n\t * Defines the component type.\n\t * @default \"Information\"\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\tdesign: `${MessageStripDesign}` = \"Information\";\n\n\t/**\n\t * Defines the color scheme of the component.\n\t * There are 10 predefined schemes.\n\t * To use one you can set a number from `\"1\"` to `\"10\"`. The `colorScheme` `\"1\"` will be set by default.\n\t *\n\t * @default \"1\"\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property()\n\tcolorScheme = \"1\"\n\n\t/**\n\t * Defines whether the MessageStrip will show an icon in the beginning.\n\t * You can directly provide an icon with the `icon` slot. Otherwise, the default icon for the type will be used.\n\t *\n\t * * **Note:** If <code>MessageStripDesign.ColorSet1</code> or <code>MessageStripDesign.ColorSet2</code> value is set to the <code>design</code> property, default icon will not be presented.\n\t *\n\t * @default false\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property({ type: Boolean })\n\thideIcon = false\n\n\t/**\n\t * Defines whether the MessageStrip renders close button.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\thideCloseButton = false;\n\n\t/**\n\t * Defines the content to be displayed as graphical element within the component.\n\t *\n\t * **Note:** If no icon is given, the default icon for the component type will be used.\n\t * The SAP-icons font provides numerous options.\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 * @public\n\t */\n\t@slot()\n\ticon!: Array<IIcon>;\n\n\tstatic i18nBundle: I18nBundle;\n\n\t_closeClick() {\n\t\tthis.fireEvent(\"close\");\n\t}\n\n\tstatic async onDefine() {\n\t\tMessageStrip.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n\n\tstatic designAnnouncementMappings(): DesignTypeAnnouncemnt {\n\t\tconst getTranslation = (text:I18nText): string => {\n\t\t\treturn MessageStrip.i18nBundle.getText(text);\n\t\t};\n\n\t\treturn {\n\t\t\tInformation: getTranslation(MESSAGE_STRIP_INFORMATION),\n\t\t\tPositive: getTranslation(MESSAGE_STRIP_SUCCESS),\n\t\t\tNegative: getTranslation(MESSAGE_STRIP_ERROR),\n\t\t\tCritical: getTranslation(MESSAGE_STRIP_WARNING),\n\t\t\tColorSet1: getTranslation(MESSAGE_STRIP_CUSTOM),\n\t\t\tColorSet2: getTranslation(MESSAGE_STRIP_CUSTOM),\n\t\t};\n\t}\n\n\tget hiddenText() {\n\t\treturn `${MessageStrip.designAnnouncementMappings()[this.design]} ${this.hideCloseButton ? \"\" : this._closableText}`;\n\t}\n\n\tget shouldHideIcon() {\n\t\tif (this.designClasses === DesignClassesMapping.ColorSet1 || this.designClasses === DesignClassesMapping.ColorSet2) {\n\t\t\treturn this.hideIcon || this.icon.length === 0;\n\t\t}\n\n\t\treturn this.hideIcon;\n\t}\n\n\tget _closeButtonText() {\n\t\treturn MessageStrip.i18nBundle.getText(MESSAGE_STRIP_CLOSE_BUTTON);\n\t}\n\n\tget _closableText() {\n\t\treturn MessageStrip.i18nBundle.getText(MESSAGE_STRIP_CLOSABLE);\n\t}\n\n\tget classes(): ClassMap {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\t\"ui5-message-strip-root\": true,\n\t\t\t\t\"ui5-message-strip-root-hide-icon\": this.shouldHideIcon,\n\t\t\t\t\"ui5-message-strip-root-hide-close-button\": this.hideCloseButton,\n\t\t\t\t[this.designClasses]: true,\n\t\t\t},\n\t\t};\n\t}\n\n\tget iconProvided() {\n\t\treturn this.icon.length > 0;\n\t}\n\n\tget standardIconName() {\n\t\tswitch (this.design) {\n\t\tcase MessageStripDesign.Critical:\n\t\t\treturn \"alert\";\n\t\tcase MessageStripDesign.Positive:\n\t\t\treturn \"sys-enter-2\";\n\t\tcase MessageStripDesign.Negative:\n\t\t\treturn \"error\";\n\t\tcase MessageStripDesign.Information:\n\t\t\treturn \"information\";\n\t\tdefault:\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tget designClasses() {\n\t\treturn DesignClassesMapping[this.design];\n\t}\n}\n\nMessageStrip.define();\n\nexport default MessageStrip;\n"]}
|
package/dist/Option.d.ts
CHANGED
|
@@ -41,14 +41,14 @@ declare class Option extends ListItemBase implements IOption {
|
|
|
41
41
|
*/
|
|
42
42
|
icon?: string;
|
|
43
43
|
/**
|
|
44
|
-
* Defines the `additionalText`, displayed in the end of the
|
|
44
|
+
* Defines the `additionalText`, displayed in the end of the option.
|
|
45
45
|
* @default undefined
|
|
46
46
|
* @public
|
|
47
47
|
* @since 1.0.0-rc.15
|
|
48
48
|
*/
|
|
49
49
|
additionalText?: string;
|
|
50
50
|
/**
|
|
51
|
-
* Defines the
|
|
51
|
+
* Defines the tooltip of the option.
|
|
52
52
|
* @default undefined
|
|
53
53
|
* @public
|
|
54
54
|
* @since 1.23.0
|
package/dist/Option.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.js","sourceRoot":"","sources":["../src/Option.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAE3E,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,WAAW;AACX,OAAO,cAAc,MAAM,6CAA6C,CAAC;AAEzE,SAAS;AACT,OAAO,aAAa,MAAM,sCAAsC,CAAC;AACjE,OAAO,eAAe,MAAM,wCAAwC,CAAC;AACrE,OAAO,yBAAyB,MAAM,kDAAkD,CAAC;AAEzF;;;;;;;;;;;;;;GAcG;AAcH,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,YAAY;IAyDhC,IAAI,gBAAgB;QACnB,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACpB,CAAC;IAED,IAAI,oBAAoB;QACvB,OAAO,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;IAC/B,CAAC;CACD,CAAA;AAxDA;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;oCAClD;AASnB;IADC,QAAQ,EAAE;qCACI;AAYf;IADC,QAAQ,EAAE;oCACG;AASd;IADC,QAAQ,EAAE;8CACa;AASxB;IADC,QAAQ,EAAE;uCACM;AAQT;IADP,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACF;AAvDrB,MAAM;IAbX,aAAa,CAAC;QACd,GAAG,EAAE,YAAY;QACjB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE;YACP,YAAY,CAAC,MAAM;YACnB,yBAAyB;YACzB,eAAe;YACf,aAAa;SACb;QACD,YAAY,EAAE;YACb,IAAI;SACJ;KACD,CAAC;GACI,MAAM,CAgEX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,eAAe,MAAM,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport type { IOption } from \"./Select.js\";\nimport ListItemBase from \"./ListItemBase.js\";\nimport Icon from \"./Icon.js\";\n\n// Template\nimport OptionTemplate from \"./generated/templates/OptionTemplate.lit.js\";\n\n// Styles\nimport optionBaseCss from \"./generated/themes/OptionBase.css.js\";\nimport listItemIconCss from \"./generated/themes/ListItemIcon.css.js\";\nimport listItemAdditionalTextCss from \"./generated/themes/ListItemAdditionalText.css.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-option` component defines the content of an option in the `ui5-select`.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/Option.js\";`\n * @constructor\n * @extends ListItemBase\n * @implements {IOption}\n * @public\n */\n@customElement({\n\ttag: \"ui5-option\",\n\ttemplate: OptionTemplate,\n\tstyles: [\n\t\tListItemBase.styles,\n\t\tlistItemAdditionalTextCss,\n\t\tlistItemIconCss,\n\t\toptionBaseCss,\n\t],\n\tdependencies: [\n\t\tIcon,\n\t],\n})\nclass Option extends ListItemBase implements IOption {\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, invalidateOnChildChange: true })\n\ttext!: Array<Node>;\n\n\t/**\n\t * Defines the value of the `ui5-select` inside an HTML Form element when this component is selected.\n\t * For more information on HTML Form support, see the `name` property of `ui5-select`.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tvalue?: string;\n\n\t/**\n\t * Defines the `icon` source URI.\n\t *\n\t * **Note:**\n\t * SAP-icons font provides numerous built-in icons. To find all the available icons, see the\n\t * [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 `additionalText`, displayed in the end of the
|
|
1
|
+
{"version":3,"file":"Option.js","sourceRoot":"","sources":["../src/Option.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAE3E,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,WAAW;AACX,OAAO,cAAc,MAAM,6CAA6C,CAAC;AAEzE,SAAS;AACT,OAAO,aAAa,MAAM,sCAAsC,CAAC;AACjE,OAAO,eAAe,MAAM,wCAAwC,CAAC;AACrE,OAAO,yBAAyB,MAAM,kDAAkD,CAAC;AAEzF;;;;;;;;;;;;;;GAcG;AAcH,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,YAAY;IAyDhC,IAAI,gBAAgB;QACnB,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACpB,CAAC;IAED,IAAI,oBAAoB;QACvB,OAAO,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;IAC/B,CAAC;CACD,CAAA;AAxDA;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;oCAClD;AASnB;IADC,QAAQ,EAAE;qCACI;AAYf;IADC,QAAQ,EAAE;oCACG;AASd;IADC,QAAQ,EAAE;8CACa;AASxB;IADC,QAAQ,EAAE;uCACM;AAQT;IADP,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACF;AAvDrB,MAAM;IAbX,aAAa,CAAC;QACd,GAAG,EAAE,YAAY;QACjB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE;YACP,YAAY,CAAC,MAAM;YACnB,yBAAyB;YACzB,eAAe;YACf,aAAa;SACb;QACD,YAAY,EAAE;YACb,IAAI;SACJ;KACD,CAAC;GACI,MAAM,CAgEX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,eAAe,MAAM,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport type { IOption } from \"./Select.js\";\nimport ListItemBase from \"./ListItemBase.js\";\nimport Icon from \"./Icon.js\";\n\n// Template\nimport OptionTemplate from \"./generated/templates/OptionTemplate.lit.js\";\n\n// Styles\nimport optionBaseCss from \"./generated/themes/OptionBase.css.js\";\nimport listItemIconCss from \"./generated/themes/ListItemIcon.css.js\";\nimport listItemAdditionalTextCss from \"./generated/themes/ListItemAdditionalText.css.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-option` component defines the content of an option in the `ui5-select`.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/Option.js\";`\n * @constructor\n * @extends ListItemBase\n * @implements {IOption}\n * @public\n */\n@customElement({\n\ttag: \"ui5-option\",\n\ttemplate: OptionTemplate,\n\tstyles: [\n\t\tListItemBase.styles,\n\t\tlistItemAdditionalTextCss,\n\t\tlistItemIconCss,\n\t\toptionBaseCss,\n\t],\n\tdependencies: [\n\t\tIcon,\n\t],\n})\nclass Option extends ListItemBase implements IOption {\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, invalidateOnChildChange: true })\n\ttext!: Array<Node>;\n\n\t/**\n\t * Defines the value of the `ui5-select` inside an HTML Form element when this component is selected.\n\t * For more information on HTML Form support, see the `name` property of `ui5-select`.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tvalue?: string;\n\n\t/**\n\t * Defines the `icon` source URI.\n\t *\n\t * **Note:**\n\t * SAP-icons font provides numerous built-in icons. To find all the available icons, see the\n\t * [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 `additionalText`, displayed in the end of the option.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\tadditionalText?: string;\n\n\t/**\n\t * Defines the tooltip of the option.\n\t * @default undefined\n\t * @public\n\t * @since 1.23.0\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * Defines the selected state of the component.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdeclare selected: boolean;\n\n\tget displayIconBegin(): boolean {\n\t\treturn !!this.icon;\n\t}\n\n\tget effectiveDisplayText() {\n\t\treturn this.textContent || \"\";\n\t}\n}\n\nOption.define();\n\nexport default Option;\n"]}
|
package/dist/OptionCustom.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ declare class OptionCustom extends ListItemBase implements IOption {
|
|
|
41
41
|
*/
|
|
42
42
|
content: Array<Node>;
|
|
43
43
|
/**
|
|
44
|
-
* Defines the
|
|
44
|
+
* Defines the tooltip of the option.
|
|
45
45
|
* @default undefined
|
|
46
46
|
* @public
|
|
47
47
|
*/
|
package/dist/OptionCustom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionCustom.js","sourceRoot":"","sources":["../src/OptionCustom.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAE3E,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,WAAW;AACX,OAAO,oBAAoB,MAAM,mDAAmD,CAAC;AAErF,SAAS;AACT,OAAO,aAAa,MAAM,sCAAsC,CAAC;AAEjE;;;;;;;;;;;;;;;;;GAiBG;AASH,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,YAAY;IA4CtC,IAAI,oBAAoB;QACvB,OAAO,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;IACnD,CAAC;CACD,CAAA;AAvCA;IADC,QAAQ,EAAE;iDACU;AASrB;IADC,QAAQ,EAAE;2CACI;AASf;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;6CAC/C;AAQtB;IADC,QAAQ,EAAE;6CACM;AAQT;IADP,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACF;AA1CrB,YAAY;IARjB,aAAa,CAAC;QACd,GAAG,EAAE,mBAAmB;QACxB,QAAQ,EAAE,oBAAoB;QAC9B,MAAM,EAAE;YACP,YAAY,CAAC,MAAM;YACnB,aAAa;SACb;KACD,CAAC;GACI,YAAY,CA+CjB;AAED,YAAY,CAAC,MAAM,EAAE,CAAC;AAEtB,eAAe,YAAY,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport type { IOption } from \"./Select.js\";\nimport ListItemBase from \"./ListItemBase.js\";\n\n// Template\nimport OptionCustomTemplate from \"./generated/templates/OptionCustomTemplate.lit.js\";\n\n// Styles\nimport optionBaseCss from \"./generated/themes/OptionBase.css.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-option-custom` component defines a custom content of an option in the `ui5-select`.\n * A component to be the same way as the standard `ui5-option`.\n * The component accepts arbitrary HTML content to allow full customization.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/OptionCustom.js\";`\n * @constructor\n * @since 2.0.0\n * @extends ListItemBase\n * @implements {IOption}\n * @public\n */\n@customElement({\n\ttag: \"ui5-option-custom\",\n\ttemplate: OptionCustomTemplate,\n\tstyles: [\n\t\tListItemBase.styles,\n\t\toptionBaseCss,\n\t],\n})\nclass OptionCustom extends ListItemBase implements IOption {\n\t/**\n\t * Defines the text, displayed inside the `ui5-select` input filed\n\t * when the option gets selected.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tdisplayText?: string;\n\n\t/**\n\t * Defines the value of the `ui5-select` inside an HTML Form element when this component is selected.\n\t * For more information on HTML Form support, see the `name` property of `ui5-select`.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tvalue?: string;\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, invalidateOnChildChange: true })\n\tcontent!: Array<Node>;\n\n\t/**\n\t * Defines the
|
|
1
|
+
{"version":3,"file":"OptionCustom.js","sourceRoot":"","sources":["../src/OptionCustom.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAE3E,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,WAAW;AACX,OAAO,oBAAoB,MAAM,mDAAmD,CAAC;AAErF,SAAS;AACT,OAAO,aAAa,MAAM,sCAAsC,CAAC;AAEjE;;;;;;;;;;;;;;;;;GAiBG;AASH,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,YAAY;IA4CtC,IAAI,oBAAoB;QACvB,OAAO,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;IACnD,CAAC;CACD,CAAA;AAvCA;IADC,QAAQ,EAAE;iDACU;AASrB;IADC,QAAQ,EAAE;2CACI;AASf;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;6CAC/C;AAQtB;IADC,QAAQ,EAAE;6CACM;AAQT;IADP,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACF;AA1CrB,YAAY;IARjB,aAAa,CAAC;QACd,GAAG,EAAE,mBAAmB;QACxB,QAAQ,EAAE,oBAAoB;QAC9B,MAAM,EAAE;YACP,YAAY,CAAC,MAAM;YACnB,aAAa;SACb;KACD,CAAC;GACI,YAAY,CA+CjB;AAED,YAAY,CAAC,MAAM,EAAE,CAAC;AAEtB,eAAe,YAAY,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport type { IOption } from \"./Select.js\";\nimport ListItemBase from \"./ListItemBase.js\";\n\n// Template\nimport OptionCustomTemplate from \"./generated/templates/OptionCustomTemplate.lit.js\";\n\n// Styles\nimport optionBaseCss from \"./generated/themes/OptionBase.css.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-option-custom` component defines a custom content of an option in the `ui5-select`.\n * A component to be the same way as the standard `ui5-option`.\n * The component accepts arbitrary HTML content to allow full customization.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/OptionCustom.js\";`\n * @constructor\n * @since 2.0.0\n * @extends ListItemBase\n * @implements {IOption}\n * @public\n */\n@customElement({\n\ttag: \"ui5-option-custom\",\n\ttemplate: OptionCustomTemplate,\n\tstyles: [\n\t\tListItemBase.styles,\n\t\toptionBaseCss,\n\t],\n})\nclass OptionCustom extends ListItemBase implements IOption {\n\t/**\n\t * Defines the text, displayed inside the `ui5-select` input filed\n\t * when the option gets selected.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tdisplayText?: string;\n\n\t/**\n\t * Defines the value of the `ui5-select` inside an HTML Form element when this component is selected.\n\t * For more information on HTML Form support, see the `name` property of `ui5-select`.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tvalue?: string;\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, invalidateOnChildChange: true })\n\tcontent!: Array<Node>;\n\n\t/**\n\t * Defines the tooltip of the option.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * Defines the selected state of the component.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdeclare selected: boolean;\n\n\tget effectiveDisplayText() {\n\t\treturn this.displayText || this.textContent || \"\";\n\t}\n}\n\nOptionCustom.define();\n\nexport default OptionCustom;\n"]}
|
package/dist/Table.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
|
5
5
|
import TableRow from "./TableRow.js";
|
|
6
6
|
import type TableHeaderRow from "./TableHeaderRow.js";
|
|
7
7
|
import type TableHeaderCell from "./TableHeaderCell.js";
|
|
8
|
-
import TableSelection from "./TableSelection.js";
|
|
8
|
+
import type TableSelection from "./TableSelection.js";
|
|
9
9
|
import TableOverflowMode from "./types/TableOverflowMode.js";
|
|
10
10
|
import TableNavigation from "./TableNavigation.js";
|
|
11
11
|
/**
|
|
@@ -15,6 +15,7 @@ import TableNavigation from "./TableNavigation.js";
|
|
|
15
15
|
* @experimental
|
|
16
16
|
*/
|
|
17
17
|
interface ITableFeature extends UI5Element {
|
|
18
|
+
readonly identifier: string;
|
|
18
19
|
/**
|
|
19
20
|
* Called when the table is activated.
|
|
20
21
|
* @param table table instance
|
|
@@ -62,6 +63,7 @@ type TableRowClickEventDetail = {
|
|
|
62
63
|
*
|
|
63
64
|
* The `ui5-table` can be enhanced in its functionalities by applying different features.
|
|
64
65
|
* Features can be slotted into the `features` slot, to enable them in the component.
|
|
66
|
+
* Features need to be imported separately, as they are not enabled by default.
|
|
65
67
|
*
|
|
66
68
|
* The following features are currently available:
|
|
67
69
|
*
|
|
@@ -227,7 +229,6 @@ declare class Table extends UI5Element {
|
|
|
227
229
|
onExitDOM(): void;
|
|
228
230
|
onBeforeRendering(): void;
|
|
229
231
|
onAfterRendering(): void;
|
|
230
|
-
_getFeature<Klass>(klass: any): Klass | undefined;
|
|
231
232
|
_getSelection(): TableSelection | undefined;
|
|
232
233
|
_onEvent(e: Event): void;
|
|
233
234
|
_onResize(): void;
|
package/dist/Table.js
CHANGED
|
@@ -19,12 +19,12 @@ import TableTemplate from "./generated/templates/TableTemplate.lit.js";
|
|
|
19
19
|
import TableStyles from "./generated/themes/Table.css.js";
|
|
20
20
|
import TableRow from "./TableRow.js";
|
|
21
21
|
import TableExtension from "./TableExtension.js";
|
|
22
|
-
import TableSelection from "./TableSelection.js";
|
|
23
22
|
import TableOverflowMode from "./types/TableOverflowMode.js";
|
|
24
23
|
import TableNavigation from "./TableNavigation.js";
|
|
25
24
|
import { TABLE_NO_DATA, } from "./generated/i18n/i18n-defaults.js";
|
|
26
25
|
import BusyIndicator from "./BusyIndicator.js";
|
|
27
26
|
import TableCell from "./TableCell.js";
|
|
27
|
+
import { isFeature } from "./TableUtils.js";
|
|
28
28
|
/**
|
|
29
29
|
* @class
|
|
30
30
|
*
|
|
@@ -37,6 +37,7 @@ import TableCell from "./TableCell.js";
|
|
|
37
37
|
*
|
|
38
38
|
* The `ui5-table` can be enhanced in its functionalities by applying different features.
|
|
39
39
|
* Features can be slotted into the `features` slot, to enable them in the component.
|
|
40
|
+
* Features need to be imported separately, as they are not enabled by default.
|
|
40
41
|
*
|
|
41
42
|
* The following features are currently available:
|
|
42
43
|
*
|
|
@@ -178,11 +179,8 @@ let Table = Table_1 = class Table extends UI5Element {
|
|
|
178
179
|
onAfterRendering() {
|
|
179
180
|
this.features.forEach(feature => feature.onTableRendered?.());
|
|
180
181
|
}
|
|
181
|
-
_getFeature(klass) {
|
|
182
|
-
return this.features.find(feature => feature instanceof klass);
|
|
183
|
-
}
|
|
184
182
|
_getSelection() {
|
|
185
|
-
return this.
|
|
183
|
+
return this.features.find(feature => isFeature(feature, "TableSelection"));
|
|
186
184
|
}
|
|
187
185
|
_onEvent(e) {
|
|
188
186
|
const composedPath = e.composedPath();
|