@ui5/webcomponents 0.0.0-d849bec2c → 0.0.0-dc3ccac50
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 +552 -1
- package/README.md +144 -52
- package/csp.js +7 -0
- package/customI18n.js +50 -0
- package/dist/Assets-static.js +6 -0
- package/dist/Assets.js +2 -1
- package/dist/Avatar.js +197 -46
- package/dist/AvatarGroup.js +603 -0
- package/dist/Badge.js +44 -22
- package/dist/Breadcrumbs.js +563 -0
- package/dist/BreadcrumbsItem.js +109 -0
- package/dist/BusyIndicator.js +141 -37
- package/dist/Button.js +120 -68
- package/dist/Calendar.js +341 -545
- package/dist/CalendarDate.js +45 -0
- package/dist/CalendarHeader.js +127 -56
- package/dist/CalendarPart.js +111 -0
- package/dist/Card.js +44 -158
- package/dist/CardHeader.js +288 -0
- package/dist/Carousel.js +267 -98
- package/dist/CheckBox.js +146 -58
- package/dist/ColorPalette.js +493 -0
- package/dist/ColorPaletteItem.js +137 -0
- package/dist/ColorPalettePopover.js +219 -0
- package/dist/ColorPicker.js +524 -0
- package/dist/ComboBox.js +599 -94
- package/dist/ComboBoxFilters.js +8 -1
- package/dist/ComboBoxGroupItem.js +70 -0
- package/dist/ComboBoxItem.js +12 -24
- package/dist/CustomListItem.js +38 -4
- package/dist/DateComponentBase.js +170 -0
- package/dist/DatePicker.js +392 -409
- package/dist/DateRangePicker.js +328 -0
- package/dist/DateTimePicker.js +106 -384
- package/dist/DayPicker.js +508 -430
- package/dist/Dialog.js +496 -44
- package/dist/DurationPicker.js +135 -400
- package/dist/FileUploader.js +208 -26
- package/dist/GroupHeaderListItem.js +24 -14
- package/dist/Icon.js +140 -46
- package/dist/Input.js +613 -162
- package/dist/Interfaces.js +192 -0
- package/dist/Label.js +27 -17
- package/dist/Link.js +123 -29
- package/dist/List.js +425 -94
- package/dist/ListItem.js +88 -19
- package/dist/ListItemBase.js +27 -5
- package/dist/MessageStrip.js +50 -65
- package/dist/MonthPicker.js +180 -182
- package/dist/MultiComboBox.js +569 -156
- package/dist/MultiComboBoxItem.js +8 -2
- package/dist/MultiInput.js +301 -0
- package/dist/Option.js +48 -5
- package/dist/Panel.js +100 -37
- package/dist/Popover.js +252 -139
- package/dist/Popup.js +364 -90
- package/dist/ProgressIndicator.js +235 -0
- package/dist/RadioButton.js +131 -51
- package/dist/RadioButtonGroup.js +53 -29
- package/dist/RangeSlider.js +769 -0
- package/dist/RatingIndicator.js +291 -0
- package/dist/ResponsivePopover.js +67 -53
- package/dist/SegmentedButton.js +109 -73
- package/dist/SegmentedButtonItem.js +109 -0
- package/dist/Select.js +441 -108
- package/dist/Slider.js +320 -0
- package/dist/SliderBase.js +842 -0
- package/dist/StandardListItem.js +44 -13
- package/dist/StepInput.js +681 -0
- package/dist/SuggestionGroupItem.js +64 -0
- package/dist/SuggestionItem.js +37 -31
- package/dist/SuggestionListItem.js +76 -0
- package/dist/Switch.js +59 -42
- package/dist/Tab.js +55 -24
- package/dist/TabContainer.js +142 -62
- package/dist/TabSeparator.js +1 -0
- package/dist/Table.js +475 -22
- package/dist/TableCell.js +11 -9
- package/dist/TableColumn.js +13 -3
- package/dist/TableGroupRow.js +160 -0
- package/dist/TableRow.js +235 -10
- package/dist/TextArea.js +139 -41
- package/dist/TimePicker.js +55 -675
- package/dist/TimePickerBase.js +463 -0
- package/dist/TimeSelection.js +493 -0
- package/dist/Title.js +16 -9
- package/dist/Toast.js +24 -13
- package/dist/ToggleButton.js +21 -8
- package/dist/Token.js +84 -47
- package/dist/Tokenizer.js +242 -60
- package/dist/Tree.js +137 -51
- package/dist/TreeItem.js +44 -9
- package/dist/TreeListItem.js +127 -7
- package/dist/WheelSlider.js +76 -56
- package/dist/YearPicker.js +198 -254
- package/dist/api.json +6877 -1
- package/dist/features/ColorPaletteMoreColors.js +42 -0
- package/dist/features/InputElementsFormSupport.js +0 -1
- package/dist/features/InputSuggestions.js +247 -53
- package/dist/generated/assets/i18n/messagebundle_ar.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_bg.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ca.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cs.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cy.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_da.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_de.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_el.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_GB.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_es.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_es_MX.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_et.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_hi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hu.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_in.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_it.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_iw.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ja.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_kk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ko.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lv.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ms.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_nl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_no.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ro.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ru.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sh.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sv.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_th.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_tr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_uk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_vi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_zh_TW.json +1 -1
- package/dist/generated/assets/themes/sap_belize/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_belize_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_belize_hcw/parameters-bundle.css.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 -0
- package/dist/generated/assets/themes/sap_fiori_3_hcw/parameters-bundle.css.json +1 -0
- package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -0
- package/dist/generated/assets/themes/sap_horizon_exp/parameters-bundle.css.json +1 -0
- package/dist/generated/i18n/i18n-defaults.js +2 -2
- package/dist/generated/json-imports/Themes-static.js +35 -0
- package/dist/generated/json-imports/Themes.js +23 -15
- package/dist/generated/json-imports/i18n-static.js +162 -0
- package/dist/generated/json-imports/i18n.js +113 -87
- package/dist/generated/templates/AvatarGroupTemplate.lit.js +9 -0
- package/dist/generated/templates/AvatarTemplate.lit.js +9 -9
- package/dist/generated/templates/BadgeTemplate.lit.js +5 -6
- package/dist/generated/templates/BreadcrumbsPopoverTemplate.lit.js +8 -0
- package/dist/generated/templates/BreadcrumbsTemplate.lit.js +9 -0
- package/dist/generated/templates/BusyIndicatorTemplate.lit.js +7 -6
- package/dist/generated/templates/ButtonTemplate.lit.js +6 -6
- package/dist/generated/templates/CalendarHeaderTemplate.lit.js +6 -4
- package/dist/generated/templates/CalendarTemplate.lit.js +4 -4
- package/dist/generated/templates/CardHeaderTemplate.lit.js +12 -0
- package/dist/generated/templates/CardTemplate.lit.js +5 -8
- package/dist/generated/templates/CarouselTemplate.lit.js +13 -12
- package/dist/generated/templates/CheckBoxTemplate.lit.js +7 -7
- package/dist/generated/templates/ColorPaletteDialogTemplate.lit.js +7 -0
- package/dist/generated/templates/ColorPaletteItemTemplate.lit.js +7 -0
- package/dist/generated/templates/ColorPalettePopoverTemplate.lit.js +8 -0
- package/dist/generated/templates/ColorPaletteTemplate.lit.js +12 -0
- package/dist/generated/templates/ColorPickerTemplate.lit.js +7 -0
- package/dist/generated/templates/ComboBoxPopoverTemplate.lit.js +20 -5
- package/dist/generated/templates/ComboBoxTemplate.lit.js +8 -6
- package/dist/generated/templates/CustomListItemTemplate.lit.js +13 -13
- package/dist/generated/templates/DatePickerPopoverTemplate.lit.js +7 -6
- package/dist/generated/templates/DatePickerTemplate.lit.js +6 -6
- package/dist/generated/templates/DateTimePickerPopoverTemplate.lit.js +9 -12
- package/dist/generated/templates/DayPickerTemplate.lit.js +13 -11
- package/dist/generated/templates/DialogTemplate.lit.js +9 -9
- package/dist/generated/templates/FileUploaderPopoverTemplate.lit.js +10 -0
- package/dist/generated/templates/FileUploaderTemplate.lit.js +7 -7
- package/dist/generated/templates/GroupHeaderListItemTemplate.lit.js +4 -4
- package/dist/generated/templates/IconTemplate.lit.js +6 -6
- package/dist/generated/templates/InputPopoverTemplate.lit.js +24 -23
- package/dist/generated/templates/InputTemplate.lit.js +9 -8
- package/dist/generated/templates/LabelTemplate.lit.js +4 -4
- package/dist/generated/templates/LinkTemplate.lit.js +5 -5
- package/dist/generated/templates/ListItemTemplate.lit.js +13 -13
- package/dist/generated/templates/ListTemplate.lit.js +12 -9
- package/dist/generated/templates/MessageStripTemplate.lit.js +8 -17
- package/dist/generated/templates/MonthPickerTemplate.lit.js +6 -6
- package/dist/generated/templates/MultiComboBoxPopoverTemplate.lit.js +23 -5
- package/dist/generated/templates/MultiComboBoxTemplate.lit.js +10 -8
- package/dist/generated/templates/MultiInputTemplate.lit.js +16 -0
- package/dist/generated/templates/PanelTemplate.lit.js +9 -6
- package/dist/generated/templates/PopoverTemplate.lit.js +9 -9
- package/dist/generated/templates/PopupBlockLayerTemplate.lit.js +4 -4
- package/dist/generated/templates/PopupTemplate.lit.js +4 -9
- package/dist/generated/templates/ProgressIndicatorTemplate.lit.js +17 -0
- package/dist/generated/templates/RadioButtonTemplate.lit.js +7 -7
- package/dist/generated/templates/RangeSliderTemplate.lit.js +13 -0
- package/dist/generated/templates/RatingIndicatorTemplate.lit.js +14 -0
- package/dist/generated/templates/ResponsivePopoverTemplate.lit.js +16 -14
- package/dist/generated/templates/SegmentedButtonItemTemplate.lit.js +8 -0
- package/dist/generated/templates/SegmentedButtonTemplate.lit.js +4 -9
- package/dist/generated/templates/SelectPopoverTemplate.lit.js +20 -6
- package/dist/generated/templates/SelectTemplate.lit.js +6 -5
- package/dist/generated/templates/SliderBaseTemplate.lit.js +11 -0
- package/dist/generated/templates/SliderTemplate.lit.js +12 -0
- package/dist/generated/templates/StandardListItemTemplate.lit.js +21 -20
- package/dist/generated/templates/StepInputTemplate.lit.js +8 -0
- package/dist/generated/templates/SuggestionListItemTemplate.lit.js +27 -0
- package/dist/generated/templates/SwitchTemplate.lit.js +8 -6
- package/dist/generated/templates/TabContainerPopoverTemplate.lit.js +6 -6
- package/dist/generated/templates/TabContainerTemplate.lit.js +16 -14
- package/dist/generated/templates/TabInOverflowTemplate.lit.js +6 -13
- package/dist/generated/templates/TabInStripTemplate.lit.js +8 -21
- package/dist/generated/templates/TabSeparatorTemplate.lit.js +4 -4
- package/dist/generated/templates/TabTemplate.lit.js +4 -4
- package/dist/generated/templates/TableCellTemplate.lit.js +4 -4
- package/dist/generated/templates/TableColumnTemplate.lit.js +4 -4
- package/dist/generated/templates/TableGroupRowTemplate.lit.js +7 -0
- package/dist/generated/templates/TableRowTemplate.lit.js +12 -11
- package/dist/generated/templates/TableTemplate.lit.js +13 -8
- package/dist/generated/templates/TextAreaPopoverTemplate.lit.js +8 -8
- package/dist/generated/templates/TextAreaTemplate.lit.js +8 -7
- package/dist/generated/templates/TimePickerPopoverTemplate.lit.js +4 -8
- package/dist/generated/templates/TimePickerTemplate.lit.js +6 -6
- package/dist/generated/templates/TimeSelectionTemplate.lit.js +11 -0
- package/dist/generated/templates/TitleTemplate.lit.js +10 -10
- package/dist/generated/templates/ToastTemplate.lit.js +5 -4
- package/dist/generated/templates/ToggleButtonTemplate.lit.js +6 -6
- package/dist/generated/templates/TokenTemplate.lit.js +7 -5
- package/dist/generated/templates/TokenizerPopoverTemplate.lit.js +12 -0
- package/dist/generated/templates/TokenizerTemplate.lit.js +6 -6
- package/dist/generated/templates/TreeListItemTemplate.lit.js +18 -16
- package/dist/generated/templates/TreeTemplate.lit.js +5 -5
- package/dist/generated/templates/WheelSliderTemplate.lit.js +7 -7
- package/dist/generated/templates/YearPickerTemplate.lit.js +6 -6
- package/dist/generated/themes/Avatar.css.js +5 -5
- package/dist/generated/themes/AvatarGroup.css.js +8 -0
- package/dist/generated/themes/Badge.css.js +5 -5
- package/dist/generated/themes/Breadcrumbs.css.js +8 -0
- package/dist/generated/themes/BreadcrumbsPopover.css.js +8 -0
- package/dist/generated/themes/BrowserScrollbar.css.js +8 -0
- package/dist/generated/themes/BusyIndicator.css.js +5 -5
- package/dist/generated/themes/Button.css.js +5 -5
- package/dist/generated/themes/Button.ie11.css.js +8 -0
- package/dist/generated/themes/Calendar.css.js +5 -5
- package/dist/generated/themes/CalendarHeader.css.js +5 -5
- package/dist/generated/themes/Card.css.js +5 -5
- package/dist/generated/themes/CardHeader.css.js +8 -0
- package/dist/generated/themes/Carousel.css.js +5 -5
- package/dist/generated/themes/CheckBox.css.js +5 -5
- package/dist/generated/themes/ColorPalette.css.js +8 -0
- package/dist/generated/themes/ColorPaletteItem.css.js +8 -0
- package/dist/generated/themes/ColorPalettePopover.css.js +8 -0
- package/dist/generated/themes/ColorPaletteStaticArea.css.js +8 -0
- package/dist/generated/themes/ColorPicker.css.js +8 -0
- package/dist/generated/themes/ComboBox.css.js +5 -5
- package/dist/generated/themes/ComboBoxPopover.css.js +5 -5
- package/dist/generated/themes/CustomListItem.css.js +5 -5
- package/dist/generated/themes/DatePicker.css.js +5 -5
- package/dist/generated/themes/DatePickerPopover.css.js +5 -5
- package/dist/generated/themes/DateRangePicker.css.js +8 -0
- package/dist/generated/themes/DateTimePicker.css.js +5 -5
- package/dist/generated/themes/DateTimePickerPopover.css.js +5 -5
- package/dist/generated/themes/DayPicker.css.js +5 -5
- package/dist/generated/themes/Dialog.css.js +5 -5
- package/dist/generated/themes/FileUploader.css.js +5 -5
- package/dist/generated/themes/GroupHeaderListItem.css.js +5 -5
- package/dist/generated/themes/GrowingButton.css.js +8 -0
- package/dist/generated/themes/Icon.css.js +5 -5
- package/dist/generated/themes/Input.css.js +5 -5
- package/dist/generated/themes/InputIcon.css.js +5 -5
- package/dist/generated/themes/InvisibleTextStyles.css.js +5 -5
- package/dist/generated/themes/Label.css.js +5 -5
- package/dist/generated/themes/Link.css.js +5 -5
- package/dist/generated/themes/List.css.js +5 -5
- package/dist/generated/themes/ListItem.css.js +5 -5
- package/dist/generated/themes/ListItemBase.css.js +5 -5
- package/dist/generated/themes/MessageStrip.css.js +5 -5
- package/dist/generated/themes/MonthPicker.css.js +5 -5
- package/dist/generated/themes/MultiComboBox.css.js +5 -5
- package/dist/generated/themes/MultiInput.css.js +8 -0
- package/dist/generated/themes/Panel.css.js +5 -5
- package/dist/generated/themes/Popover.css.js +5 -5
- package/dist/generated/themes/Popup.css.js +5 -5
- package/dist/generated/themes/PopupGlobal.css.js +8 -0
- package/dist/generated/themes/PopupStaticAreaStyles.css.js +5 -5
- package/dist/generated/themes/PopupsCommon.css.js +8 -0
- package/dist/generated/themes/ProgressIndicator.css.js +8 -0
- package/dist/generated/themes/RadioButton.css.js +5 -5
- package/dist/generated/themes/RatingIndicator.css.js +8 -0
- package/dist/generated/themes/ResponsivePopover.css.js +5 -5
- package/dist/generated/themes/ResponsivePopoverCommon.css.js +5 -5
- package/dist/generated/themes/SegmentedButton.css.js +5 -5
- package/dist/generated/themes/Select.css.js +5 -5
- package/dist/generated/themes/SelectPopover.css.js +8 -0
- package/dist/generated/themes/SliderBase.css.js +8 -0
- package/dist/generated/themes/StepInput.css.js +8 -0
- package/dist/generated/themes/Suggestions.css.js +8 -0
- package/dist/generated/themes/Switch.css.js +5 -5
- package/dist/generated/themes/Tab.css.js +5 -5
- package/dist/generated/themes/TabContainer.css.js +5 -5
- package/dist/generated/themes/TabInOverflow.css.js +5 -5
- package/dist/generated/themes/TabInStrip.css.js +5 -5
- package/dist/generated/themes/Table.css.js +5 -5
- package/dist/generated/themes/TableCell.css.js +5 -5
- package/dist/generated/themes/TableColumn.css.js +5 -5
- package/dist/generated/themes/TableGroupRow.css.js +8 -0
- package/dist/generated/themes/TableRow.css.js +5 -5
- package/dist/generated/themes/TapHighlightColor.css.js +8 -0
- package/dist/generated/themes/TextArea.css.js +5 -5
- package/dist/generated/themes/TimePicker.css.js +5 -5
- package/dist/generated/themes/TimePickerPopover.css.js +5 -5
- package/dist/generated/themes/TimeSelection.css.js +8 -0
- package/dist/generated/themes/Title.css.js +5 -5
- package/dist/generated/themes/Toast.css.js +5 -5
- package/dist/generated/themes/ToggleButton.css.js +5 -5
- package/dist/generated/themes/ToggleButton.ie11.css.js +8 -0
- package/dist/generated/themes/Token.css.js +5 -5
- package/dist/generated/themes/Tokenizer.css.js +5 -5
- package/dist/generated/themes/Tree.css.js +5 -5
- package/dist/generated/themes/TreeListItem.css.js +5 -5
- package/dist/generated/themes/ValueStateMessage.css.js +5 -5
- package/dist/generated/themes/WheelSlider.css.js +5 -5
- package/dist/generated/themes/YearPicker.css.js +5 -5
- package/dist/generated/themes/sap_belize/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_belize_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_belize_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js +1 -0
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js +1 -0
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -0
- package/dist/generated/themes/sap_horizon_exp/parameters-bundle.css.js +1 -0
- package/dist/i18n/messagebundle.properties +335 -0
- package/dist/i18n/messagebundle_ar.properties +224 -0
- package/dist/i18n/messagebundle_bg.properties +224 -0
- package/dist/i18n/messagebundle_ca.properties +224 -0
- package/dist/i18n/messagebundle_cs.properties +224 -0
- package/dist/i18n/messagebundle_cy.properties +224 -0
- package/dist/i18n/messagebundle_da.properties +224 -0
- package/dist/i18n/messagebundle_de.properties +224 -0
- package/dist/i18n/messagebundle_el.properties +224 -0
- package/dist/i18n/messagebundle_en.properties +224 -0
- package/dist/i18n/messagebundle_en_GB.properties +224 -0
- package/dist/i18n/messagebundle_en_US_sappsd.properties +224 -0
- package/dist/i18n/messagebundle_en_US_saprigi.properties +224 -0
- package/dist/i18n/messagebundle_en_US_saptrc.properties +224 -0
- package/dist/i18n/messagebundle_es.properties +224 -0
- package/dist/i18n/messagebundle_es_MX.properties +224 -0
- package/dist/i18n/messagebundle_et.properties +224 -0
- package/dist/i18n/messagebundle_fi.properties +224 -0
- package/dist/i18n/messagebundle_fr.properties +224 -0
- package/dist/i18n/messagebundle_fr_CA.properties +224 -0
- package/dist/i18n/messagebundle_hi.properties +224 -0
- package/dist/i18n/messagebundle_hr.properties +224 -0
- package/dist/i18n/messagebundle_hu.properties +224 -0
- package/dist/i18n/messagebundle_id.properties +224 -0
- package/dist/i18n/messagebundle_in.properties +172 -0
- package/dist/i18n/messagebundle_it.properties +224 -0
- package/dist/i18n/messagebundle_iw.properties +224 -0
- package/dist/i18n/messagebundle_ja.properties +224 -0
- package/dist/i18n/messagebundle_kk.properties +224 -0
- package/dist/i18n/messagebundle_ko.properties +224 -0
- package/dist/i18n/messagebundle_lt.properties +224 -0
- package/dist/i18n/messagebundle_lv.properties +224 -0
- package/dist/i18n/messagebundle_ms.properties +224 -0
- package/dist/i18n/messagebundle_nl.properties +224 -0
- package/dist/i18n/messagebundle_no.properties +224 -0
- package/dist/i18n/messagebundle_pl.properties +224 -0
- package/dist/i18n/messagebundle_pt.properties +224 -0
- package/dist/i18n/messagebundle_pt_PT.properties +224 -0
- package/dist/i18n/messagebundle_ro.properties +224 -0
- package/dist/i18n/messagebundle_ru.properties +224 -0
- package/dist/i18n/messagebundle_sh.properties +224 -0
- package/dist/i18n/messagebundle_sk.properties +224 -0
- package/dist/i18n/messagebundle_sl.properties +224 -0
- package/dist/i18n/messagebundle_sv.properties +224 -0
- package/dist/i18n/messagebundle_th.properties +224 -0
- package/dist/i18n/messagebundle_tr.properties +224 -0
- package/dist/i18n/messagebundle_uk.properties +224 -0
- package/dist/i18n/messagebundle_vi.properties +224 -0
- package/dist/i18n/messagebundle_zh_CN.properties +224 -0
- package/dist/i18n/messagebundle_zh_TW.properties +224 -0
- package/dist/popup-utils/OpenedPopupsRegistry.js +18 -13
- package/dist/popup-utils/PopoverRegistry.js +49 -15
- package/dist/timepicker-utils/TimeSlider.js +15 -13
- package/dist/types/{AvatarBackgroundColor.js → AvatarColorScheme.js} +9 -9
- package/dist/types/AvatarGroupType.js +43 -0
- package/dist/types/AvatarShape.js +1 -1
- package/dist/types/AvatarSize.js +1 -1
- package/dist/types/BreadcrumbsDesign.js +42 -0
- package/dist/types/BreadcrumbsSeparatorStyle.js +69 -0
- package/dist/types/BusyIndicatorSize.js +1 -1
- package/dist/types/ButtonDesign.js +8 -1
- package/dist/types/CalendarSelectionMode.js +47 -0
- package/dist/types/CarouselArrowsPlacement.js +3 -3
- package/dist/types/GrowingMode.js +48 -0
- package/dist/types/InputType.js +7 -7
- package/dist/types/LinkDesign.js +1 -1
- package/dist/types/ListGrowingMode.js +15 -0
- package/dist/types/ListItemType.js +1 -1
- package/dist/types/ListMode.js +9 -1
- package/dist/types/ListSeparators.js +1 -1
- package/dist/types/{MessageStripType.js → MessageStripDesign.js} +7 -7
- package/dist/types/PanelAccessibleRole.js +1 -1
- package/dist/types/PopoverHorizontalAlign.js +1 -1
- package/dist/types/PopoverPlacementType.js +2 -2
- package/dist/types/PopoverVerticalAlign.js +1 -2
- package/dist/types/Priority.js +1 -1
- package/dist/types/SemanticColor.js +1 -1
- package/dist/types/SwitchDesign.js +40 -0
- package/dist/types/TabContainerTabsPlacement.js +5 -5
- package/dist/types/TabLayout.js +1 -1
- package/dist/types/TableGrowingMode.js +15 -0
- package/dist/types/TableMode.js +47 -0
- package/dist/types/TableRowType.js +40 -0
- package/dist/types/TitleLevel.js +1 -1
- package/dist/types/ToastPlacement.js +1 -2
- package/dist/types/WrappingType.js +41 -0
- package/dist/webcomponentsjs/CHANGELOG.md +61 -0
- package/dist/webcomponentsjs/README.md +64 -47
- package/dist/webcomponentsjs/bundles/webcomponents-ce.js +38 -38
- package/dist/webcomponentsjs/bundles/webcomponents-ce.js.map +1 -1
- package/dist/webcomponentsjs/bundles/webcomponents-pf_dom.js +60 -0
- package/dist/webcomponentsjs/bundles/webcomponents-pf_dom.js.map +1 -0
- package/dist/webcomponentsjs/bundles/webcomponents-pf_js.js +95 -0
- package/dist/webcomponentsjs/bundles/webcomponents-pf_js.js.map +1 -0
- package/dist/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js +292 -229
- package/dist/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js.map +1 -1
- package/dist/webcomponentsjs/bundles/webcomponents-sd-ce.js +190 -170
- package/dist/webcomponentsjs/bundles/webcomponents-sd-ce.js.map +1 -1
- package/dist/webcomponentsjs/bundles/webcomponents-sd.js +151 -132
- package/dist/webcomponentsjs/bundles/webcomponents-sd.js.map +1 -1
- package/dist/webcomponentsjs/custom-elements-es5-adapter.js +2 -2
- package/dist/webcomponentsjs/webcomponents-bundle.js +302 -230
- package/dist/webcomponentsjs/webcomponents-bundle.js.map +1 -1
- package/dist/webcomponentsjs/webcomponents-loader.js +49 -28
- package/package-scripts.js +1 -0
- package/package.json +23 -7
- package/src/Assets-static.js +6 -0
- package/src/Assets.js +7 -0
- package/src/Avatar.hbs +20 -0
- package/src/Avatar.js +392 -0
- package/src/AvatarGroup.hbs +30 -0
- package/src/AvatarGroup.js +603 -0
- package/src/Badge.hbs +14 -0
- package/src/Badge.js +165 -0
- package/src/Breadcrumbs.hbs +42 -0
- package/src/Breadcrumbs.js +563 -0
- package/src/BreadcrumbsItem.js +109 -0
- package/src/BreadcrumbsPopover.hbs +28 -0
- package/src/BusyIndicator.hbs +32 -0
- package/src/BusyIndicator.js +269 -0
- package/src/Button.hbs +45 -0
- package/src/Button.js +463 -0
- package/src/Calendar.hbs +69 -0
- package/src/Calendar.js +489 -0
- package/src/CalendarDate.js +45 -0
- package/src/CalendarHeader.hbs +54 -0
- package/src/CalendarHeader.js +209 -0
- package/src/CalendarPart.js +111 -0
- package/src/Card.hbs +14 -0
- package/src/Card.js +160 -0
- package/src/CardHeader.hbs +35 -0
- package/src/CardHeader.js +288 -0
- package/src/Carousel.hbs +85 -0
- package/src/Carousel.js +681 -0
- package/src/CheckBox.hbs +44 -0
- package/src/CheckBox.js +424 -0
- package/src/ColorPalette.hbs +52 -0
- package/src/ColorPalette.js +493 -0
- package/src/ColorPaletteDialog.hbs +18 -0
- package/src/ColorPaletteItem.hbs +11 -0
- package/src/ColorPaletteItem.js +137 -0
- package/src/ColorPalettePopover.hbs +29 -0
- package/src/ColorPalettePopover.js +219 -0
- package/src/ColorPicker.hbs +98 -0
- package/src/ColorPicker.js +524 -0
- package/src/ComboBox.hbs +49 -0
- package/src/ComboBox.js +1041 -0
- package/src/ComboBoxFilters.js +40 -0
- package/src/ComboBoxGroupItem.js +70 -0
- package/src/ComboBoxItem.js +49 -0
- package/src/ComboBoxPopover.hbs +125 -0
- package/src/CustomListItem.hbs +5 -0
- package/src/CustomListItem.js +99 -0
- package/src/DateComponentBase.js +170 -0
- package/src/DatePicker.hbs +44 -0
- package/src/DatePicker.js +823 -0
- package/src/DatePickerPopover.hbs +63 -0
- package/src/DateRangePicker.js +328 -0
- package/src/DateTimePicker.js +430 -0
- package/src/DateTimePickerPopover.hbs +74 -0
- package/src/DayPicker.hbs +66 -0
- package/src/DayPicker.js +754 -0
- package/src/Dialog.hbs +35 -0
- package/src/Dialog.js +601 -0
- package/src/DurationPicker.js +312 -0
- package/src/FileUploader.hbs +40 -0
- package/src/FileUploader.js +532 -0
- package/src/FileUploaderPopover.hbs +25 -0
- package/src/GroupHeaderListItem.hbs +15 -0
- package/src/GroupHeaderListItem.js +94 -0
- package/src/Icon.hbs +25 -0
- package/src/Icon.js +373 -0
- package/src/Input.hbs +78 -0
- package/src/Input.js +1381 -0
- package/src/InputPopover.hbs +118 -0
- package/src/Interfaces.js +192 -0
- package/src/Label.hbs +13 -0
- package/src/Label.js +152 -0
- package/src/Link.hbs +20 -0
- package/src/Link.js +349 -0
- package/src/List.hbs +89 -0
- package/src/List.js +1056 -0
- package/src/ListItem.hbs +102 -0
- package/src/ListItem.js +371 -0
- package/src/ListItemBase.js +179 -0
- package/src/MessageStrip.hbs +34 -0
- package/src/MessageStrip.js +226 -0
- package/src/MonthPicker.hbs +29 -0
- package/src/MonthPicker.js +299 -0
- package/src/MultiComboBox.hbs +78 -0
- package/src/MultiComboBox.js +1091 -0
- package/src/MultiComboBoxItem.js +43 -0
- package/src/MultiComboBoxPopover.hbs +133 -0
- package/src/MultiInput.hbs +41 -0
- package/src/MultiInput.js +301 -0
- package/src/Option.js +115 -0
- package/src/Panel.hbs +63 -0
- package/src/Panel.js +462 -0
- package/src/Popover.hbs +25 -0
- package/src/Popover.js +786 -0
- package/src/Popup.hbs +34 -0
- package/src/Popup.js +567 -0
- package/src/PopupBlockLayer.hbs +7 -0
- package/src/ProgressIndicator.hbs +35 -0
- package/src/ProgressIndicator.js +235 -0
- package/src/RadioButton.hbs +33 -0
- package/src/RadioButton.js +494 -0
- package/src/RadioButtonGroup.js +205 -0
- package/src/RangeSlider.hbs +70 -0
- package/src/RangeSlider.js +769 -0
- package/src/RatingIndicator.hbs +33 -0
- package/src/RatingIndicator.js +291 -0
- package/src/ResponsivePopover.hbs +39 -0
- package/src/ResponsivePopover.js +206 -0
- package/src/SegmentedButton.hbs +17 -0
- package/src/SegmentedButton.js +290 -0
- package/src/SegmentedButtonItem.hbs +42 -0
- package/src/SegmentedButtonItem.js +109 -0
- package/src/Select.hbs +45 -0
- package/src/Select.js +834 -0
- package/src/SelectPopover.hbs +89 -0
- package/src/Slider.hbs +42 -0
- package/src/Slider.js +320 -0
- package/src/SliderBase.hbs +38 -0
- package/src/SliderBase.js +842 -0
- package/src/StandardListItem.hbs +44 -0
- package/src/StandardListItem.js +191 -0
- package/src/StepInput.hbs +77 -0
- package/src/StepInput.js +681 -0
- package/src/SuggestionGroupItem.js +64 -0
- package/src/SuggestionItem.js +146 -0
- package/src/SuggestionListItem.hbs +33 -0
- package/src/SuggestionListItem.js +76 -0
- package/src/Switch.hbs +50 -0
- package/src/Switch.js +261 -0
- package/src/Tab.hbs +3 -0
- package/src/Tab.js +334 -0
- package/src/TabContainer.hbs +93 -0
- package/src/TabContainer.js +679 -0
- package/src/TabContainerPopover.hbs +24 -0
- package/src/TabInOverflow.hbs +22 -0
- package/src/TabInStrip.hbs +43 -0
- package/src/TabSeparator.hbs +1 -0
- package/src/TabSeparator.js +44 -0
- package/src/Table.hbs +99 -0
- package/src/Table.js +761 -0
- package/src/TableCell.hbs +7 -0
- package/src/TableCell.js +88 -0
- package/src/TableColumn.hbs +8 -0
- package/src/TableColumn.js +136 -0
- package/src/TableGroupRow.hbs +12 -0
- package/src/TableGroupRow.js +160 -0
- package/src/TableRow.hbs +61 -0
- package/src/TableRow.js +388 -0
- package/src/TextArea.hbs +50 -0
- package/src/TextArea.js +691 -0
- package/src/TextAreaPopover.hbs +28 -0
- package/src/TimePicker.hbs +35 -0
- package/src/TimePicker.js +166 -0
- package/src/TimePickerBase.js +463 -0
- package/src/TimePickerPopover.hbs +34 -0
- package/src/TimeSelection.hbs +60 -0
- package/src/TimeSelection.js +493 -0
- package/src/Title.hbs +47 -0
- package/src/Title.js +132 -0
- package/src/Toast.hbs +13 -0
- package/src/Toast.js +243 -0
- package/src/ToggleButton.hbs +5 -0
- package/src/ToggleButton.js +84 -0
- package/src/Token.hbs +30 -0
- package/src/Token.js +219 -0
- package/src/Tokenizer.hbs +27 -0
- package/src/Tokenizer.js +414 -0
- package/src/TokenizerPopover.hbs +50 -0
- package/src/Tree.hbs +42 -0
- package/src/Tree.js +443 -0
- package/src/TreeItem.js +168 -0
- package/src/TreeListItem.hbs +48 -0
- package/src/TreeListItem.js +332 -0
- package/src/WheelSlider.hbs +48 -0
- package/src/WheelSlider.js +435 -0
- package/src/YearPicker.hbs +27 -0
- package/src/YearPicker.js +324 -0
- package/src/features/ColorPaletteMoreColors.js +42 -0
- package/src/features/InputElementsFormSupport.js +88 -0
- package/src/features/InputSuggestions.js +530 -0
- package/src/i18n/messagebundle.properties +335 -0
- package/src/i18n/messagebundle_ar.properties +224 -0
- package/src/i18n/messagebundle_bg.properties +224 -0
- package/src/i18n/messagebundle_ca.properties +224 -0
- package/src/i18n/messagebundle_cs.properties +224 -0
- package/src/i18n/messagebundle_cy.properties +224 -0
- package/src/i18n/messagebundle_da.properties +224 -0
- package/src/i18n/messagebundle_de.properties +224 -0
- package/src/i18n/messagebundle_el.properties +224 -0
- package/src/i18n/messagebundle_en.properties +224 -0
- package/src/i18n/messagebundle_en_GB.properties +224 -0
- package/src/i18n/messagebundle_en_US_sappsd.properties +224 -0
- package/src/i18n/messagebundle_en_US_saprigi.properties +224 -0
- package/src/i18n/messagebundle_en_US_saptrc.properties +224 -0
- package/src/i18n/messagebundle_es.properties +224 -0
- package/src/i18n/messagebundle_es_MX.properties +224 -0
- package/src/i18n/messagebundle_et.properties +224 -0
- package/src/i18n/messagebundle_fi.properties +224 -0
- package/src/i18n/messagebundle_fr.properties +224 -0
- package/src/i18n/messagebundle_fr_CA.properties +224 -0
- package/src/i18n/messagebundle_hi.properties +224 -0
- package/src/i18n/messagebundle_hr.properties +224 -0
- package/src/i18n/messagebundle_hu.properties +224 -0
- package/src/i18n/messagebundle_id.properties +224 -0
- package/src/i18n/messagebundle_in.properties +172 -0
- package/src/i18n/messagebundle_it.properties +224 -0
- package/src/i18n/messagebundle_iw.properties +224 -0
- package/src/i18n/messagebundle_ja.properties +224 -0
- package/src/i18n/messagebundle_kk.properties +224 -0
- package/src/i18n/messagebundle_ko.properties +224 -0
- package/src/i18n/messagebundle_lt.properties +224 -0
- package/src/i18n/messagebundle_lv.properties +224 -0
- package/src/i18n/messagebundle_ms.properties +224 -0
- package/src/i18n/messagebundle_nl.properties +224 -0
- package/src/i18n/messagebundle_no.properties +224 -0
- package/src/i18n/messagebundle_pl.properties +224 -0
- package/src/i18n/messagebundle_pt.properties +224 -0
- package/src/i18n/messagebundle_pt_PT.properties +224 -0
- package/src/i18n/messagebundle_ro.properties +224 -0
- package/src/i18n/messagebundle_ru.properties +224 -0
- package/src/i18n/messagebundle_sh.properties +224 -0
- package/src/i18n/messagebundle_sk.properties +224 -0
- package/src/i18n/messagebundle_sl.properties +224 -0
- package/src/i18n/messagebundle_sv.properties +224 -0
- package/src/i18n/messagebundle_th.properties +224 -0
- package/src/i18n/messagebundle_tr.properties +224 -0
- package/src/i18n/messagebundle_uk.properties +224 -0
- package/src/i18n/messagebundle_vi.properties +224 -0
- package/src/i18n/messagebundle_zh_CN.properties +224 -0
- package/src/i18n/messagebundle_zh_TW.properties +224 -0
- package/src/popup-utils/OpenedPopupsRegistry.js +50 -0
- package/src/popup-utils/PopoverRegistry.js +145 -0
- package/src/timepicker-utils/TimeSlider.js +103 -0
- package/src/types/AvatarColorScheme.js +104 -0
- package/src/types/AvatarGroupType.js +43 -0
- package/src/types/AvatarShape.js +41 -0
- package/src/types/AvatarSize.js +67 -0
- package/src/types/BreadcrumbsDesign.js +42 -0
- package/src/types/BreadcrumbsSeparatorStyle.js +69 -0
- package/src/types/BusyIndicatorSize.js +47 -0
- package/src/types/ButtonDesign.js +68 -0
- package/src/types/CalendarSelectionMode.js +47 -0
- package/src/types/CarouselArrowsPlacement.js +40 -0
- package/src/types/GrowingMode.js +48 -0
- package/src/types/InputType.js +68 -0
- package/src/types/LinkDesign.js +47 -0
- package/src/types/ListGrowingMode.js +15 -0
- package/src/types/ListItemType.js +47 -0
- package/src/types/ListMode.js +77 -0
- package/src/types/ListSeparators.js +46 -0
- package/src/types/MessageStripDesign.js +54 -0
- package/src/types/PanelAccessibleRole.js +48 -0
- package/src/types/PopoverHorizontalAlign.js +54 -0
- package/src/types/PopoverPlacementType.js +54 -0
- package/src/types/PopoverVerticalAlign.js +54 -0
- package/src/types/Priority.js +55 -0
- package/src/types/SemanticColor.js +61 -0
- package/src/types/SwitchDesign.js +40 -0
- package/src/types/TabContainerTabsPlacement.js +40 -0
- package/src/types/TabLayout.js +40 -0
- package/src/types/TableGrowingMode.js +15 -0
- package/src/types/TableMode.js +47 -0
- package/src/types/TableRowType.js +40 -0
- package/src/types/TitleLevel.js +68 -0
- package/src/types/ToastPlacement.js +91 -0
- package/src/types/WrappingType.js +41 -0
- package/dist/Timeline.js +0 -97
- package/dist/TimelineItem.js +0 -161
- package/dist/generated/templates/ComboBoxItemTemplate.lit.js +0 -7
- package/dist/generated/templates/DurationPickerPopoverTemplate.lit.js +0 -10
- package/dist/generated/templates/DurationPickerTemplate.lit.js +0 -8
- package/dist/generated/templates/TimelineItemTemplate.lit.js +0 -12
- package/dist/generated/templates/TimelineTemplate.lit.js +0 -8
- package/dist/generated/themes/ComboBoxItem.css.js +0 -8
- package/dist/generated/themes/DurationPicker.css.js +0 -8
- package/dist/generated/themes/DurationPickerPopover.css.js +0 -8
- package/dist/generated/themes/Timeline.css.js +0 -8
- package/dist/generated/themes/TimelineItem.css.js +0 -8
- package/dist/popup-utils/PopupUtils.js +0 -55
- package/dist/types/AvatarFitType.js +0 -40
- package/dist/webcomponentsjs/package.json +0 -46
package/dist/Input.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
2
|
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
|
3
3
|
import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
|
|
4
|
-
import
|
|
5
|
-
import { isIE, isPhone } from "@ui5/webcomponents-base/dist/Device.js";
|
|
4
|
+
import { isIE, isPhone, isSafari } from "@ui5/webcomponents-base/dist/Device.js";
|
|
6
5
|
import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
|
|
7
6
|
import { getFeature } from "@ui5/webcomponents-base/dist/FeaturesRegistry.js";
|
|
8
7
|
import {
|
|
@@ -10,10 +9,16 @@ import {
|
|
|
10
9
|
isDown,
|
|
11
10
|
isSpace,
|
|
12
11
|
isEnter,
|
|
12
|
+
isBackSpace,
|
|
13
|
+
isEscape,
|
|
14
|
+
isTabNext,
|
|
13
15
|
} from "@ui5/webcomponents-base/dist/Keys.js";
|
|
14
16
|
import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
|
|
15
|
-
import {
|
|
16
|
-
import "@ui5/webcomponents-
|
|
17
|
+
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
18
|
+
import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AriaLabelHelper.js";
|
|
19
|
+
import { getCaretPosition, setCaretPosition } from "@ui5/webcomponents-base/dist/util/Caret.js";
|
|
20
|
+
import "@ui5/webcomponents-icons/dist/decline.js";
|
|
21
|
+
import "@ui5/webcomponents-icons/dist/not-editable.js";
|
|
17
22
|
import InputType from "./types/InputType.js";
|
|
18
23
|
import Popover from "./Popover.js";
|
|
19
24
|
// Templates
|
|
@@ -27,25 +32,32 @@ import {
|
|
|
27
32
|
VALUE_STATE_WARNING,
|
|
28
33
|
INPUT_SUGGESTIONS,
|
|
29
34
|
INPUT_SUGGESTIONS_TITLE,
|
|
35
|
+
INPUT_SUGGESTIONS_ONE_HIT,
|
|
36
|
+
INPUT_SUGGESTIONS_MORE_HITS,
|
|
37
|
+
INPUT_SUGGESTIONS_NO_HIT,
|
|
30
38
|
} from "./generated/i18n/i18n-defaults.js";
|
|
31
39
|
|
|
32
40
|
// Styles
|
|
33
41
|
import styles from "./generated/themes/Input.css.js";
|
|
34
42
|
import ResponsivePopoverCommonCss from "./generated/themes/ResponsivePopoverCommon.css.js";
|
|
35
43
|
import ValueStateMessageCss from "./generated/themes/ValueStateMessage.css.js";
|
|
44
|
+
import SuggestionsCss from "./generated/themes/Suggestions.css.js";
|
|
45
|
+
|
|
46
|
+
const rgxFloat = new RegExp(/(\+|-)?\d+(\.|,)\d+/);
|
|
36
47
|
|
|
37
48
|
/**
|
|
38
49
|
* @public
|
|
39
50
|
*/
|
|
40
51
|
const metadata = {
|
|
41
52
|
tag: "ui5-input",
|
|
53
|
+
languageAware: true,
|
|
42
54
|
managedSlots: true,
|
|
43
55
|
slots: /** @lends sap.ui.webcomponents.main.Input.prototype */ {
|
|
44
56
|
|
|
45
57
|
/**
|
|
46
|
-
* Defines the icon to be displayed in the
|
|
58
|
+
* Defines the icon to be displayed in the component.
|
|
47
59
|
*
|
|
48
|
-
* @type {
|
|
60
|
+
* @type {sap.ui.webcomponents.main.IIcon[]}
|
|
49
61
|
* @slot
|
|
50
62
|
* @public
|
|
51
63
|
*/
|
|
@@ -54,7 +66,7 @@ const metadata = {
|
|
|
54
66
|
},
|
|
55
67
|
|
|
56
68
|
/**
|
|
57
|
-
* Defines the
|
|
69
|
+
* Defines the suggestion items.
|
|
58
70
|
* <br><br>
|
|
59
71
|
* Example:
|
|
60
72
|
* <br><br>
|
|
@@ -64,22 +76,27 @@ const metadata = {
|
|
|
64
76
|
* </ui5-input>
|
|
65
77
|
* <br>
|
|
66
78
|
* <ui5-input show-suggestions>
|
|
79
|
+
* <ui5-suggestion-group-item text="Group #1"></ui5-suggestion-group-item>
|
|
67
80
|
* <ui5-suggestion-item text="Item #1"></ui5-suggestion-item>
|
|
68
81
|
* <ui5-suggestion-item text="Item #2"></ui5-suggestion-item>
|
|
82
|
+
* <ui5-suggestion-group-item text="Group #2"></ui5-suggestion-group-item>
|
|
83
|
+
* <ui5-suggestion-item text="Item #3"></ui5-suggestion-item>
|
|
84
|
+
* <ui5-suggestion-item text="Item #4"></ui5-suggestion-item>
|
|
69
85
|
* </ui5-input>
|
|
70
86
|
* <br><br>
|
|
71
|
-
* <b>Note:</b> The
|
|
87
|
+
* <b>Note:</b> The suggestions would be displayed only if the <code>showSuggestions</code>
|
|
72
88
|
* property is set to <code>true</code>.
|
|
73
89
|
* <br><br>
|
|
74
|
-
* <b>Note:</b> The <ui5-suggestion-item>
|
|
75
|
-
*
|
|
90
|
+
* <b>Note:</b> The <code><ui5-suggestion-item></code> and <code><ui5-suggestion-group-item></code> are recommended to be used as suggestion items.
|
|
91
|
+
* <br><br>
|
|
92
|
+
* <b>Note:</b> Importing the Input Suggestions Support feature:
|
|
76
93
|
* <br>
|
|
77
94
|
* <code>import "@ui5/webcomponents/dist/features/InputSuggestions.js";</code>
|
|
78
95
|
* <br>
|
|
79
|
-
*
|
|
96
|
+
* automatically imports the <code><ui5-suggestion-item></code> and <code><ui5-suggestion-group-item></code> for your convenience.
|
|
80
97
|
*
|
|
81
|
-
* @type {
|
|
82
|
-
* @slot
|
|
98
|
+
* @type {sap.ui.webcomponents.main.IInputSuggestionItem[]}
|
|
99
|
+
* @slot suggestionItems
|
|
83
100
|
* @public
|
|
84
101
|
*/
|
|
85
102
|
"default": {
|
|
@@ -98,15 +115,15 @@ const metadata = {
|
|
|
98
115
|
},
|
|
99
116
|
|
|
100
117
|
/**
|
|
101
|
-
* Defines the value state message that will be displayed as pop up under the
|
|
118
|
+
* Defines the value state message that will be displayed as pop up under the component.
|
|
102
119
|
* <br><br>
|
|
103
120
|
*
|
|
104
121
|
* <b>Note:</b> If not specified, a default text (in the respective language) will be displayed.
|
|
105
|
-
* <br>
|
|
122
|
+
* <br><br>
|
|
106
123
|
* <b>Note:</b> The <code>valueStateMessage</code> would be displayed,
|
|
107
|
-
* when the
|
|
108
|
-
* <br>
|
|
109
|
-
* <b>Note:</b> If the
|
|
124
|
+
* when the component is in <code>Information</code>, <code>Warning</code> or <code>Error</code> value state.
|
|
125
|
+
* <br><br>
|
|
126
|
+
* <b>Note:</b> If the component has <code>suggestionItems</code>,
|
|
110
127
|
* the <code>valueStateMessage</code> would be displayed as part of the same popover, if used on desktop, or dialog - on phone.
|
|
111
128
|
* @type {HTMLElement[]}
|
|
112
129
|
* @since 1.0.0-rc.6
|
|
@@ -120,9 +137,9 @@ const metadata = {
|
|
|
120
137
|
properties: /** @lends sap.ui.webcomponents.main.Input.prototype */ {
|
|
121
138
|
|
|
122
139
|
/**
|
|
123
|
-
* Defines whether the
|
|
140
|
+
* Defines whether the component is in disabled state.
|
|
124
141
|
* <br><br>
|
|
125
|
-
* <b>Note:</b> A disabled
|
|
142
|
+
* <b>Note:</b> A disabled component is completely noninteractive.
|
|
126
143
|
*
|
|
127
144
|
* @type {boolean}
|
|
128
145
|
* @defaultvalue false
|
|
@@ -132,9 +149,24 @@ const metadata = {
|
|
|
132
149
|
type: Boolean,
|
|
133
150
|
},
|
|
134
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Defines if characters within the suggestions are to be highlighted
|
|
154
|
+
* in case the input value matches parts of the suggestions text.
|
|
155
|
+
* <br><br>
|
|
156
|
+
* <b>Note:</b> takes effect when <code>showSuggestions</code> is set to <code>true</code>
|
|
157
|
+
*
|
|
158
|
+
* @type {boolean}
|
|
159
|
+
* @defaultvalue false
|
|
160
|
+
* @private
|
|
161
|
+
* @sicne 1.0.0-rc.8
|
|
162
|
+
*/
|
|
163
|
+
highlight: {
|
|
164
|
+
type: Boolean,
|
|
165
|
+
},
|
|
166
|
+
|
|
135
167
|
/**
|
|
136
168
|
* Defines a short hint intended to aid the user with data entry when the
|
|
137
|
-
*
|
|
169
|
+
* component has no value.
|
|
138
170
|
* @type {string}
|
|
139
171
|
* @defaultvalue ""
|
|
140
172
|
* @public
|
|
@@ -144,9 +176,9 @@ const metadata = {
|
|
|
144
176
|
},
|
|
145
177
|
|
|
146
178
|
/**
|
|
147
|
-
* Defines whether the
|
|
179
|
+
* Defines whether the component is read-only.
|
|
148
180
|
* <br><br>
|
|
149
|
-
* <b>Note:</b> A read-only
|
|
181
|
+
* <b>Note:</b> A read-only component is not editable,
|
|
150
182
|
* but still provides visual feedback upon user interaction.
|
|
151
183
|
*
|
|
152
184
|
* @type {boolean}
|
|
@@ -158,7 +190,7 @@ const metadata = {
|
|
|
158
190
|
},
|
|
159
191
|
|
|
160
192
|
/**
|
|
161
|
-
* Defines whether the
|
|
193
|
+
* Defines whether the component is required.
|
|
162
194
|
*
|
|
163
195
|
* @type {boolean}
|
|
164
196
|
* @defaultvalue false
|
|
@@ -170,7 +202,7 @@ const metadata = {
|
|
|
170
202
|
},
|
|
171
203
|
|
|
172
204
|
/**
|
|
173
|
-
* Defines the HTML type of the
|
|
205
|
+
* Defines the HTML type of the component.
|
|
174
206
|
* Available options are: <code>Text</code>, <code>Email</code>,
|
|
175
207
|
* <code>Number</code>, <code>Password</code>, <code>Tel</code>, and <code>URL</code>.
|
|
176
208
|
* <br><br>
|
|
@@ -192,7 +224,7 @@ const metadata = {
|
|
|
192
224
|
},
|
|
193
225
|
|
|
194
226
|
/**
|
|
195
|
-
* Defines the value of the
|
|
227
|
+
* Defines the value of the component.
|
|
196
228
|
* <br><br>
|
|
197
229
|
* <b>Note:</b> The property is updated upon typing.
|
|
198
230
|
*
|
|
@@ -205,7 +237,7 @@ const metadata = {
|
|
|
205
237
|
},
|
|
206
238
|
|
|
207
239
|
/**
|
|
208
|
-
* Defines the value state of the
|
|
240
|
+
* Defines the value state of the component.
|
|
209
241
|
* <br><br>
|
|
210
242
|
* Available options are:
|
|
211
243
|
* <ul>
|
|
@@ -226,7 +258,7 @@ const metadata = {
|
|
|
226
258
|
},
|
|
227
259
|
|
|
228
260
|
/**
|
|
229
|
-
* Determines the name with which the
|
|
261
|
+
* Determines the name with which the component will be submitted in an HTML form.
|
|
230
262
|
*
|
|
231
263
|
* <br><br>
|
|
232
264
|
* <b>Important:</b> For the <code>name</code> property to have effect, you must add the following import to your project:
|
|
@@ -234,7 +266,7 @@ const metadata = {
|
|
|
234
266
|
*
|
|
235
267
|
* <br><br>
|
|
236
268
|
* <b>Note:</b> When set, a native <code>input</code> HTML element
|
|
237
|
-
* will be created inside the
|
|
269
|
+
* will be created inside the component so that it can be submitted as
|
|
238
270
|
* part of an HTML form. Do not use this property unless you need to submit a form.
|
|
239
271
|
*
|
|
240
272
|
* @type {string}
|
|
@@ -246,10 +278,10 @@ const metadata = {
|
|
|
246
278
|
},
|
|
247
279
|
|
|
248
280
|
/**
|
|
249
|
-
* Defines whether the
|
|
281
|
+
* Defines whether the component should show suggestions, if such are present.
|
|
250
282
|
* <br><br>
|
|
251
|
-
* <b>Note:</b>
|
|
252
|
-
*
|
|
283
|
+
* <b>Note:</b> You need to import the <code>InputSuggestions</code> module
|
|
284
|
+
* from <code>"@ui5/webcomponents/dist/features/InputSuggestions.js"</code> to enable this functionality.
|
|
253
285
|
* @type {boolean}
|
|
254
286
|
* @defaultvalue false
|
|
255
287
|
* @public
|
|
@@ -269,6 +301,30 @@ const metadata = {
|
|
|
269
301
|
type: Integer,
|
|
270
302
|
},
|
|
271
303
|
|
|
304
|
+
/**
|
|
305
|
+
* Sets the accessible aria name of the component.
|
|
306
|
+
*
|
|
307
|
+
* @type {String}
|
|
308
|
+
* @public
|
|
309
|
+
* @since 1.0.0-rc.15
|
|
310
|
+
*/
|
|
311
|
+
accessibleName: {
|
|
312
|
+
type: String,
|
|
313
|
+
},
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Receives id(or many ids) of the elements that label the input.
|
|
317
|
+
*
|
|
318
|
+
* @type {String}
|
|
319
|
+
* @defaultvalue ""
|
|
320
|
+
* @public
|
|
321
|
+
* @since 1.0.0-rc.15
|
|
322
|
+
*/
|
|
323
|
+
accessibleNameRef: {
|
|
324
|
+
type: String,
|
|
325
|
+
defaultValue: "",
|
|
326
|
+
},
|
|
327
|
+
|
|
272
328
|
/**
|
|
273
329
|
* @private
|
|
274
330
|
*/
|
|
@@ -276,6 +332,18 @@ const metadata = {
|
|
|
276
332
|
type: Boolean,
|
|
277
333
|
},
|
|
278
334
|
|
|
335
|
+
/**
|
|
336
|
+
* Indicates whether the visual focus is on the value state header
|
|
337
|
+
* @private
|
|
338
|
+
*/
|
|
339
|
+
_isValueStateFocused: {
|
|
340
|
+
type: Boolean,
|
|
341
|
+
},
|
|
342
|
+
|
|
343
|
+
open: {
|
|
344
|
+
type: Boolean,
|
|
345
|
+
},
|
|
346
|
+
|
|
279
347
|
_input: {
|
|
280
348
|
type: Object,
|
|
281
349
|
},
|
|
@@ -284,7 +352,7 @@ const metadata = {
|
|
|
284
352
|
type: Object,
|
|
285
353
|
},
|
|
286
354
|
|
|
287
|
-
|
|
355
|
+
_nativeInputAttributes: {
|
|
288
356
|
type: Object,
|
|
289
357
|
},
|
|
290
358
|
|
|
@@ -316,7 +384,7 @@ const metadata = {
|
|
|
316
384
|
change: {},
|
|
317
385
|
|
|
318
386
|
/**
|
|
319
|
-
* Fired when the value of the
|
|
387
|
+
* Fired when the value of the component changes at each keystroke,
|
|
320
388
|
* and when a suggestion item has been selected.
|
|
321
389
|
*
|
|
322
390
|
* @event
|
|
@@ -325,27 +393,48 @@ const metadata = {
|
|
|
325
393
|
input: {},
|
|
326
394
|
|
|
327
395
|
/**
|
|
328
|
-
* Fired when
|
|
329
|
-
* <br><br>
|
|
330
|
-
* <b>Note:</b> The event is fired independent of whether there was a change before or not.
|
|
331
|
-
* If change was performed, the event is fired after the change event.
|
|
332
|
-
* The event is also fired when an item of the select list is selected by pressing Enter.
|
|
396
|
+
* Fired when a suggestion item, that is displayed in the suggestion popup, is selected.
|
|
333
397
|
*
|
|
334
|
-
* @event
|
|
398
|
+
* @event sap.ui.webcomponents.main.Input#suggestion-item-select
|
|
399
|
+
* @param {HTMLElement} item The selected item.
|
|
335
400
|
* @public
|
|
336
401
|
*/
|
|
337
|
-
|
|
402
|
+
"suggestion-item-select": {
|
|
403
|
+
detail: {
|
|
404
|
+
item: { type: HTMLElement },
|
|
405
|
+
},
|
|
406
|
+
},
|
|
338
407
|
|
|
339
408
|
/**
|
|
340
|
-
* Fired when a suggestion item
|
|
409
|
+
* Fired when the user navigates to a suggestion item via the ARROW keys,
|
|
410
|
+
* as a preview, before the final selection.
|
|
341
411
|
*
|
|
342
|
-
* @event sap.ui.webcomponents.main.Input#suggestion-item-
|
|
343
|
-
* @param {HTMLElement} item The
|
|
412
|
+
* @event sap.ui.webcomponents.main.Input#suggestion-item-preview
|
|
413
|
+
* @param {HTMLElement} item The previewed suggestion item.
|
|
414
|
+
* @param {HTMLElement} targetRef The DOM ref of the suggestion item.
|
|
344
415
|
* @public
|
|
416
|
+
* @since 1.0.0-rc.8
|
|
345
417
|
*/
|
|
346
|
-
"suggestion-item-
|
|
418
|
+
"suggestion-item-preview": {
|
|
347
419
|
detail: {
|
|
348
420
|
item: { type: HTMLElement },
|
|
421
|
+
targetRef: { type: HTMLElement },
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Fired when the user scrolls the suggestion popover.
|
|
427
|
+
*
|
|
428
|
+
* @event sap.ui.webcomponents.main.Input#suggestion-scroll
|
|
429
|
+
* @param {Integer} scrollTop The current scroll position.
|
|
430
|
+
* @param {HTMLElement} scrollContainer The scroll container.
|
|
431
|
+
* @protected
|
|
432
|
+
* @since 1.0.0-rc.8
|
|
433
|
+
*/
|
|
434
|
+
"suggestion-scroll": {
|
|
435
|
+
detail: {
|
|
436
|
+
scrollTop: { type: Integer },
|
|
437
|
+
scrollContainer: { type: HTMLElement },
|
|
349
438
|
},
|
|
350
439
|
},
|
|
351
440
|
},
|
|
@@ -361,7 +450,7 @@ const metadata = {
|
|
|
361
450
|
* that are displayed in a popover right under the input.
|
|
362
451
|
* <br><br>
|
|
363
452
|
* The text field can be editable or read-only (<code>readonly</code> property),
|
|
364
|
-
* and it can be enabled or disabled (<code>
|
|
453
|
+
* and it can be enabled or disabled (<code>disabled</code> property).
|
|
365
454
|
* To visualize semantic states, such as "error" or "warning", the <code>valueState</code> property is provided.
|
|
366
455
|
* When the user makes changes to the text, the change event is fired,
|
|
367
456
|
* which enables you to react on any text change.
|
|
@@ -382,7 +471,8 @@ const metadata = {
|
|
|
382
471
|
* @alias sap.ui.webcomponents.main.Input
|
|
383
472
|
* @extends sap.ui.webcomponents.base.UI5Element
|
|
384
473
|
* @tagname ui5-input
|
|
385
|
-
* @appenddocs SuggestionItem
|
|
474
|
+
* @appenddocs SuggestionItem SuggestionGroupItem
|
|
475
|
+
* @implements sap.ui.webcomponents.main.IInput
|
|
386
476
|
* @public
|
|
387
477
|
*/
|
|
388
478
|
class Input extends UI5Element {
|
|
@@ -407,7 +497,7 @@ class Input extends UI5Element {
|
|
|
407
497
|
}
|
|
408
498
|
|
|
409
499
|
static get staticAreaStyles() {
|
|
410
|
-
return [ResponsivePopoverCommonCss, ValueStateMessageCss];
|
|
500
|
+
return [ResponsivePopoverCommonCss, ValueStateMessageCss, SuggestionsCss];
|
|
411
501
|
}
|
|
412
502
|
|
|
413
503
|
constructor() {
|
|
@@ -415,19 +505,39 @@ class Input extends UI5Element {
|
|
|
415
505
|
// Indicates if there is selected suggestionItem.
|
|
416
506
|
this.hasSuggestionItemSelected = false;
|
|
417
507
|
|
|
418
|
-
// Represents the value before user moves selection
|
|
419
|
-
//
|
|
420
|
-
// Note:
|
|
508
|
+
// Represents the value before user moves selection from suggestion item to another
|
|
509
|
+
// and its value is updated after each move.
|
|
510
|
+
// Note: Used to register and fire "input" event upon [SPACE] or [ENTER].
|
|
511
|
+
// Note: The property "value" is updated upon selection move and can`t be used.
|
|
421
512
|
this.valueBeforeItemSelection = "";
|
|
422
513
|
|
|
514
|
+
// Represents the value before user moves selection between the suggestion items
|
|
515
|
+
// and its value remains the same when the user navigates up or down the list.
|
|
516
|
+
// Note: Used to cancel selection upon [ESC].
|
|
517
|
+
this.valueBeforeItemPreview = "";
|
|
518
|
+
|
|
519
|
+
// Indicates if the user selection has been canceled with [ESC].
|
|
520
|
+
this.suggestionSelectionCanceled = false;
|
|
521
|
+
|
|
522
|
+
// Indicates if the change event has already been fired
|
|
523
|
+
this._changeFired = false;
|
|
524
|
+
|
|
423
525
|
// tracks the value between focus in and focus out to detect that change event should be fired.
|
|
424
526
|
this.previousValue = undefined;
|
|
425
527
|
|
|
426
528
|
// Indicates, if the component is rendering for first time.
|
|
427
529
|
this.firstRendering = true;
|
|
428
530
|
|
|
531
|
+
// The value that should be highlited.
|
|
532
|
+
this.highlightValue = "";
|
|
533
|
+
|
|
534
|
+
// The last value confirmed by the user with "ENTER"
|
|
535
|
+
this.lastConfirmedValue = "";
|
|
536
|
+
|
|
537
|
+
// Indicates, if the user pressed the BACKSPACE key.
|
|
538
|
+
this._backspaceKeyDown = false;
|
|
539
|
+
|
|
429
540
|
// all sementic events
|
|
430
|
-
this.EVENT_SUBMIT = "submit";
|
|
431
541
|
this.EVENT_CHANGE = "change";
|
|
432
542
|
this.EVENT_INPUT = "input";
|
|
433
543
|
this.EVENT_SUGGESTION_ITEM_SELECT = "suggestion-item-select";
|
|
@@ -439,8 +549,6 @@ class Input extends UI5Element {
|
|
|
439
549
|
// Suggestions array initialization
|
|
440
550
|
this.suggestionsTexts = [];
|
|
441
551
|
|
|
442
|
-
this.i18nBundle = getI18nBundle("@ui5/webcomponents");
|
|
443
|
-
|
|
444
552
|
this._handleResizeBound = this._handleResize.bind(this);
|
|
445
553
|
}
|
|
446
554
|
|
|
@@ -455,10 +563,13 @@ class Input extends UI5Element {
|
|
|
455
563
|
onBeforeRendering() {
|
|
456
564
|
if (this.showSuggestions) {
|
|
457
565
|
this.enableSuggestions();
|
|
458
|
-
this.suggestionsTexts = this.Suggestions.defaultSlotProperties();
|
|
566
|
+
this.suggestionsTexts = this.Suggestions.defaultSlotProperties(this.highlightValue);
|
|
459
567
|
}
|
|
460
568
|
|
|
569
|
+
this.open = this.open && (!!this.suggestionItems.length || this._isPhone);
|
|
570
|
+
|
|
461
571
|
const FormSupport = getFeature("FormSupport");
|
|
572
|
+
|
|
462
573
|
if (FormSupport) {
|
|
463
574
|
FormSupport.syncNativeHiddenInput(this);
|
|
464
575
|
} else if (this.name) {
|
|
@@ -466,28 +577,20 @@ class Input extends UI5Element {
|
|
|
466
577
|
}
|
|
467
578
|
}
|
|
468
579
|
|
|
469
|
-
onAfterRendering() {
|
|
470
|
-
if (
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
this.updateStaticAreaItemContentDensity();
|
|
474
|
-
this.Suggestions.toggle(shouldOpenSuggestions);
|
|
475
|
-
|
|
476
|
-
RenderScheduler.whenFinished().then(async () => {
|
|
477
|
-
this._listWidth = await this.Suggestions._getListWidth();
|
|
580
|
+
async onAfterRendering() {
|
|
581
|
+
if (this.Suggestions) {
|
|
582
|
+
this.Suggestions.toggle(this.open, {
|
|
583
|
+
preventFocusRestore: true,
|
|
478
584
|
});
|
|
479
585
|
|
|
480
|
-
|
|
481
|
-
// Set initial focus to the native input
|
|
482
|
-
this.inputDomRef && this.inputDomRef.focus();
|
|
483
|
-
}
|
|
586
|
+
this._listWidth = await this.Suggestions._getListWidth();
|
|
484
587
|
}
|
|
485
588
|
|
|
486
|
-
if (
|
|
487
|
-
this.
|
|
589
|
+
if (this.shouldDisplayOnlyValueStateMessage) {
|
|
590
|
+
this.openPopover();
|
|
591
|
+
} else {
|
|
592
|
+
this.closePopover();
|
|
488
593
|
}
|
|
489
|
-
|
|
490
|
-
this.firstRendering = false;
|
|
491
594
|
}
|
|
492
595
|
|
|
493
596
|
_onkeydown(event) {
|
|
@@ -503,15 +606,33 @@ class Input extends UI5Element {
|
|
|
503
606
|
return this._handleSpace(event);
|
|
504
607
|
}
|
|
505
608
|
|
|
609
|
+
if (isTabNext(event)) {
|
|
610
|
+
return this._handleTab(event);
|
|
611
|
+
}
|
|
612
|
+
|
|
506
613
|
if (isEnter(event)) {
|
|
507
614
|
return this._handleEnter(event);
|
|
508
615
|
}
|
|
509
616
|
|
|
617
|
+
if (isEscape(event)) {
|
|
618
|
+
return this._handleEscape(event);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
if (isBackSpace(event)) {
|
|
622
|
+
this._backspaceKeyDown = true;
|
|
623
|
+
this._selectedText = window.getSelection().toString();
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
if (this.showSuggestions) {
|
|
627
|
+
this._clearPopoverFocusAndSelection();
|
|
628
|
+
}
|
|
629
|
+
|
|
510
630
|
this._keyDown = true;
|
|
511
631
|
}
|
|
512
632
|
|
|
513
633
|
_onkeyup(event) {
|
|
514
634
|
this._keyDown = false;
|
|
635
|
+
this._backspaceKeyDown = false;
|
|
515
636
|
}
|
|
516
637
|
|
|
517
638
|
/* Event handling */
|
|
@@ -533,19 +654,59 @@ class Input extends UI5Element {
|
|
|
533
654
|
}
|
|
534
655
|
}
|
|
535
656
|
|
|
657
|
+
_handleTab(event) {
|
|
658
|
+
if (this.Suggestions && (this.previousValue !== this.value)) {
|
|
659
|
+
this.Suggestions.onTab(event);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
536
663
|
_handleEnter(event) {
|
|
537
664
|
const itemPressed = !!(this.Suggestions && this.Suggestions.onEnter(event));
|
|
665
|
+
|
|
538
666
|
if (!itemPressed) {
|
|
539
667
|
this.fireEventByAction(this.ACTION_ENTER);
|
|
668
|
+
this.lastConfirmedValue = this.value;
|
|
669
|
+
return;
|
|
540
670
|
}
|
|
671
|
+
|
|
672
|
+
this.focused = true;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
_handleEscape() {
|
|
676
|
+
const hasSuggestions = this.showSuggestions && !!this.Suggestions;
|
|
677
|
+
const isOpen = hasSuggestions && this.open;
|
|
678
|
+
|
|
679
|
+
if (!isOpen) {
|
|
680
|
+
this.value = this.lastConfirmedValue ? this.lastConfirmedValue : this.previousValue;
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
if (hasSuggestions && isOpen && this.Suggestions._isItemOnTarget()) {
|
|
685
|
+
// Restore the value.
|
|
686
|
+
this.value = this.valueBeforeItemPreview;
|
|
687
|
+
|
|
688
|
+
// Mark that the selection has been canceled, so the popover can close
|
|
689
|
+
// and not reopen, due to receiving focus.
|
|
690
|
+
this.suggestionSelectionCanceled = true;
|
|
691
|
+
this.focused = true;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
if (this._isValueStateFocused) {
|
|
695
|
+
this._isValueStateFocused = false;
|
|
696
|
+
this.focused = true;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
this.open = false;
|
|
541
700
|
}
|
|
542
701
|
|
|
543
702
|
async _onfocusin(event) {
|
|
703
|
+
await this.getInputDOMRef();
|
|
704
|
+
|
|
544
705
|
this.focused = true; // invalidating property
|
|
545
706
|
this.previousValue = this.value;
|
|
707
|
+
this.valueBeforeItemPreview = this.value;
|
|
546
708
|
|
|
547
|
-
|
|
548
|
-
this._inputIconFocused = event.target && event.target === this.querySelector("ui5-icon");
|
|
709
|
+
this._inputIconFocused = event.target && event.target === this.querySelector("[ui5-icon]");
|
|
549
710
|
}
|
|
550
711
|
|
|
551
712
|
_onfocusout(event) {
|
|
@@ -555,6 +716,7 @@ class Input extends UI5Element {
|
|
|
555
716
|
// if focusout is triggered by pressing on suggestion item or value state message popover, skip invalidation, because re-rendering
|
|
556
717
|
// will happen before "itemPress" event, which will make item "active" state not visualized
|
|
557
718
|
if (focusedOutToSuggestions || focusedOutToValueStateMessage) {
|
|
719
|
+
event.stopImmediatePropagation();
|
|
558
720
|
return;
|
|
559
721
|
}
|
|
560
722
|
|
|
@@ -564,29 +726,94 @@ class Input extends UI5Element {
|
|
|
564
726
|
return;
|
|
565
727
|
}
|
|
566
728
|
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
}
|
|
729
|
+
this.closePopover();
|
|
730
|
+
this._clearPopoverFocusAndSelection();
|
|
570
731
|
|
|
571
732
|
this.previousValue = "";
|
|
733
|
+
this.lastConfirmedValue = "";
|
|
572
734
|
this.focused = false; // invalidating property
|
|
735
|
+
this.open = false;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
_clearPopoverFocusAndSelection() {
|
|
739
|
+
if (!this.showSuggestions || !this.Suggestions) {
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
this._isValueStateFocused = false;
|
|
744
|
+
this.hasSuggestionItemSelected = false;
|
|
745
|
+
|
|
746
|
+
this.Suggestions._deselectItems();
|
|
747
|
+
this.Suggestions._clearItemFocus();
|
|
573
748
|
}
|
|
574
749
|
|
|
575
750
|
_click(event) {
|
|
576
751
|
if (isPhone() && !this.readonly && this.Suggestions) {
|
|
577
|
-
this.
|
|
578
|
-
this.
|
|
579
|
-
this.isRespPopoverOpen = true;
|
|
752
|
+
this.blur();
|
|
753
|
+
this.open = true;
|
|
580
754
|
}
|
|
581
755
|
}
|
|
582
756
|
|
|
583
757
|
_handleChange(event) {
|
|
584
|
-
|
|
758
|
+
if (!this._changeFired) {
|
|
759
|
+
this.fireEvent(this.EVENT_CHANGE);
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
// Set event as no longer marked
|
|
763
|
+
this._changeFired = false;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
_scroll(event) {
|
|
767
|
+
const detail = event.detail;
|
|
768
|
+
this.fireEvent("suggestion-scroll", {
|
|
769
|
+
scrollTop: detail.scrollTop,
|
|
770
|
+
scrollContainer: detail.targetRef,
|
|
771
|
+
});
|
|
585
772
|
}
|
|
586
773
|
|
|
587
774
|
async _handleInput(event) {
|
|
588
|
-
await this.getInputDOMRef();
|
|
589
|
-
|
|
775
|
+
const inputDomRef = await this.getInputDOMRef();
|
|
776
|
+
const emptyValueFiredOnNumberInput = this.value && this.isTypeNumber && !inputDomRef.value;
|
|
777
|
+
|
|
778
|
+
this.suggestionSelectionCanceled = false;
|
|
779
|
+
|
|
780
|
+
if (emptyValueFiredOnNumberInput && !this._backspaceKeyDown) {
|
|
781
|
+
// For input with type="Number", if the delimiter is entered second time,
|
|
782
|
+
// the inner input is firing event with empty value
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
if (emptyValueFiredOnNumberInput && this._backspaceKeyDown) {
|
|
787
|
+
// Issue: when the user removes the character(s) after the delimeter of numeric Input,
|
|
788
|
+
// the native input is firing event with an empty value and we have to manually handle this case,
|
|
789
|
+
// otherwise the entire input will be cleared as we sync the "value".
|
|
790
|
+
|
|
791
|
+
// There are tree scenarios:
|
|
792
|
+
// Example: type "123.4" and press BACKSPACE - the native input is firing event with empty value.
|
|
793
|
+
// Example: type "123.456", select/mark "456" and press BACKSPACE - the native input is firing event with empty value.
|
|
794
|
+
// Example: type "123.456", select/mark "123.456" and press BACKSPACE - the native input is firing event with empty value,
|
|
795
|
+
// but this time that's really the case.
|
|
796
|
+
|
|
797
|
+
// Perform manual handling in case of floating number
|
|
798
|
+
// and if the user did not select the entire input value
|
|
799
|
+
if (rgxFloat.test(this.value) && this._selectedText !== this.value) {
|
|
800
|
+
const newValue = this.removeFractionalPart(this.value);
|
|
801
|
+
|
|
802
|
+
// update state
|
|
803
|
+
this.value = newValue;
|
|
804
|
+
this.highlightValue = newValue;
|
|
805
|
+
this.valueBeforeItemPreview = newValue;
|
|
806
|
+
|
|
807
|
+
// fire events
|
|
808
|
+
this.fireEvent(this.EVENT_INPUT);
|
|
809
|
+
this.fireEvent("value-changed");
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
if (event.target === inputDomRef) {
|
|
815
|
+
this.focused = true;
|
|
816
|
+
|
|
590
817
|
// stop the native event, as the semantic "input" would be fired.
|
|
591
818
|
event.stopImmediatePropagation();
|
|
592
819
|
}
|
|
@@ -595,14 +822,19 @@ class Input extends UI5Element {
|
|
|
595
822
|
- value of the host and the internal input should be differnt in case of actual input
|
|
596
823
|
- input is called when a key is pressed => keyup should not be called yet
|
|
597
824
|
*/
|
|
598
|
-
const skipFiring = (
|
|
825
|
+
const skipFiring = (inputDomRef.value === this.value) && isIE() && !this._keyDown && !!this.placeholder;
|
|
599
826
|
|
|
600
827
|
!skipFiring && this.fireEventByAction(this.ACTION_USER_INPUT);
|
|
601
828
|
|
|
602
829
|
this.hasSuggestionItemSelected = false;
|
|
830
|
+
this._isValueStateFocused = false;
|
|
603
831
|
|
|
604
832
|
if (this.Suggestions) {
|
|
605
833
|
this.Suggestions.updateSelectedItemPosition(null);
|
|
834
|
+
|
|
835
|
+
if (!this._isPhone) {
|
|
836
|
+
this.open = !!inputDomRef.value;
|
|
837
|
+
}
|
|
606
838
|
}
|
|
607
839
|
}
|
|
608
840
|
|
|
@@ -610,60 +842,53 @@ class Input extends UI5Element {
|
|
|
610
842
|
this._inputWidth = this.offsetWidth;
|
|
611
843
|
}
|
|
612
844
|
|
|
613
|
-
_closeRespPopover() {
|
|
614
|
-
this.Suggestions.close();
|
|
845
|
+
_closeRespPopover(preventFocusRestore) {
|
|
846
|
+
this.Suggestions.close(preventFocusRestore);
|
|
615
847
|
}
|
|
616
848
|
|
|
617
849
|
async _afterOpenPopover() {
|
|
618
850
|
// Set initial focus to the native input
|
|
619
851
|
if (isPhone()) {
|
|
620
|
-
await this.getInputDOMRef();
|
|
621
|
-
this.inputDomRef.focus();
|
|
852
|
+
(await this.getInputDOMRef()).focus();
|
|
622
853
|
}
|
|
623
854
|
}
|
|
624
855
|
|
|
625
856
|
_afterClosePopover() {
|
|
626
|
-
this.
|
|
857
|
+
this.announceSelectedItem();
|
|
627
858
|
|
|
628
859
|
// close device's keyboard and prevent further typing
|
|
629
860
|
if (isPhone()) {
|
|
630
861
|
this.blur();
|
|
631
|
-
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
toggle(isToggled) {
|
|
635
|
-
if (isToggled && !this.isRespPopoverOpen) {
|
|
636
|
-
this.openPopover();
|
|
637
|
-
} else {
|
|
638
|
-
this.closePopover();
|
|
862
|
+
this.focused = false;
|
|
639
863
|
}
|
|
640
864
|
}
|
|
641
865
|
|
|
642
866
|
/**
|
|
643
|
-
* Checks if the popover is open.
|
|
644
|
-
* @returns {
|
|
645
|
-
* @public
|
|
867
|
+
* Checks if the value state popover is open.
|
|
868
|
+
* @returns {boolean} true if the value state popover is open, false otherwise
|
|
646
869
|
*/
|
|
647
|
-
|
|
870
|
+
isValueStateOpened() {
|
|
648
871
|
return !!this._isPopoverOpen;
|
|
649
872
|
}
|
|
650
873
|
|
|
651
874
|
async openPopover() {
|
|
652
|
-
|
|
653
|
-
this.popover = await this._getPopover();
|
|
654
|
-
this.popover.openBy(this);
|
|
655
|
-
}
|
|
875
|
+
const popover = await this._getPopover();
|
|
656
876
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
this
|
|
660
|
-
this.popover.close();
|
|
877
|
+
if (popover) {
|
|
878
|
+
this._isPopoverOpen = true;
|
|
879
|
+
popover.showAt(this);
|
|
661
880
|
}
|
|
662
881
|
}
|
|
663
882
|
|
|
883
|
+
async closePopover() {
|
|
884
|
+
const popover = await this._getPopover();
|
|
885
|
+
|
|
886
|
+
popover && popover.close();
|
|
887
|
+
}
|
|
888
|
+
|
|
664
889
|
async _getPopover() {
|
|
665
890
|
const staticAreaItem = await this.getStaticAreaItemDomRef();
|
|
666
|
-
return staticAreaItem.querySelector("ui5-popover");
|
|
891
|
+
return staticAreaItem && staticAreaItem.querySelector("[ui5-popover]");
|
|
667
892
|
}
|
|
668
893
|
|
|
669
894
|
enableSuggestions() {
|
|
@@ -672,20 +897,14 @@ class Input extends UI5Element {
|
|
|
672
897
|
}
|
|
673
898
|
|
|
674
899
|
const Suggestions = getFeature("InputSuggestions");
|
|
900
|
+
|
|
675
901
|
if (Suggestions) {
|
|
676
|
-
this.Suggestions = new Suggestions(this, "suggestionItems");
|
|
902
|
+
this.Suggestions = new Suggestions(this, "suggestionItems", true);
|
|
677
903
|
} else {
|
|
678
904
|
throw new Error(`You have to import "@ui5/webcomponents/dist/features/InputSuggestions.js" module to use ui5-input suggestions`);
|
|
679
905
|
}
|
|
680
906
|
}
|
|
681
907
|
|
|
682
|
-
shouldOpenSuggestions() {
|
|
683
|
-
return !!(this.suggestionItems.length
|
|
684
|
-
&& this.focused
|
|
685
|
-
&& this.showSuggestions
|
|
686
|
-
&& !this.hasSuggestionItemSelected);
|
|
687
|
-
}
|
|
688
|
-
|
|
689
908
|
selectSuggestion(item, keyboardUsed) {
|
|
690
909
|
if (item.group) {
|
|
691
910
|
return;
|
|
@@ -696,20 +915,53 @@ class Input extends UI5Element {
|
|
|
696
915
|
? this.valueBeforeItemSelection !== itemText : this.value !== itemText;
|
|
697
916
|
|
|
698
917
|
this.hasSuggestionItemSelected = true;
|
|
699
|
-
this.fireEvent(this.EVENT_SUGGESTION_ITEM_SELECT, { item });
|
|
700
918
|
|
|
701
919
|
if (fireInput) {
|
|
702
920
|
this.value = itemText;
|
|
703
921
|
this.valueBeforeItemSelection = itemText;
|
|
922
|
+
this.lastConfirmedValue = itemText;
|
|
704
923
|
this.fireEvent(this.EVENT_INPUT);
|
|
705
924
|
this.fireEvent(this.EVENT_CHANGE);
|
|
925
|
+
|
|
926
|
+
// Mark the change event to avoid double firing
|
|
927
|
+
this._changeFired = true;
|
|
706
928
|
}
|
|
929
|
+
|
|
930
|
+
this.valueBeforeItemPreview = "";
|
|
931
|
+
this.suggestionSelectionCanceled = false;
|
|
932
|
+
|
|
933
|
+
this.fireEvent(this.EVENT_SUGGESTION_ITEM_SELECT, { item });
|
|
707
934
|
}
|
|
708
935
|
|
|
709
936
|
previewSuggestion(item) {
|
|
710
937
|
this.valueBeforeItemSelection = this.value;
|
|
711
|
-
this.
|
|
712
|
-
this.
|
|
938
|
+
this.updateValueOnPreview(item);
|
|
939
|
+
this.announceSelectedItem();
|
|
940
|
+
this._previewItem = item;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* Updates the input value on item preview.
|
|
945
|
+
* @param {Object} item The item that is on preview
|
|
946
|
+
*/
|
|
947
|
+
updateValueOnPreview(item) {
|
|
948
|
+
const noPreview = item.type === "Inactive" || item.group;
|
|
949
|
+
const itemValue = noPreview ? this.valueBeforeItemPreview : (item.effectiveTitle || item.textContent);
|
|
950
|
+
this.value = itemValue;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* The suggestion item on preview.
|
|
955
|
+
* @type { ui5-suggestion-item }
|
|
956
|
+
* @readonly
|
|
957
|
+
* @public
|
|
958
|
+
*/
|
|
959
|
+
get previewItem() {
|
|
960
|
+
if (!this._previewItem) {
|
|
961
|
+
return null;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
return this.getSuggestionByListItem(this._previewItem);
|
|
713
965
|
}
|
|
714
966
|
|
|
715
967
|
async fireEventByAction(action) {
|
|
@@ -719,11 +971,23 @@ class Input extends UI5Element {
|
|
|
719
971
|
return;
|
|
720
972
|
}
|
|
721
973
|
|
|
722
|
-
const inputValue = this.getInputValue();
|
|
723
|
-
const isSubmit = action === this.ACTION_ENTER;
|
|
974
|
+
const inputValue = await this.getInputValue();
|
|
724
975
|
const isUserInput = action === this.ACTION_USER_INPUT;
|
|
725
976
|
|
|
977
|
+
const input = await this.getInputDOMRef();
|
|
978
|
+
const cursorPosition = input.selectionStart;
|
|
979
|
+
|
|
726
980
|
this.value = inputValue;
|
|
981
|
+
this.highlightValue = inputValue;
|
|
982
|
+
this.valueBeforeItemPreview = inputValue;
|
|
983
|
+
|
|
984
|
+
if (isSafari()) {
|
|
985
|
+
// When setting the value by hand, Safari moves the cursor when typing in the middle of the text (See #1761)
|
|
986
|
+
setTimeout(() => {
|
|
987
|
+
input.selectionStart = cursorPosition;
|
|
988
|
+
input.selectionEnd = cursorPosition;
|
|
989
|
+
}, 0);
|
|
990
|
+
}
|
|
727
991
|
|
|
728
992
|
if (isUserInput) { // input
|
|
729
993
|
this.fireEvent(this.EVENT_INPUT);
|
|
@@ -732,45 +996,66 @@ class Input extends UI5Element {
|
|
|
732
996
|
return;
|
|
733
997
|
}
|
|
734
998
|
|
|
735
|
-
if (isSubmit) { // submit
|
|
736
|
-
this.fireEvent(this.EVENT_SUBMIT);
|
|
737
|
-
}
|
|
738
|
-
|
|
739
999
|
// In IE, pressing the ENTER does not fire change
|
|
740
1000
|
const valueChanged = (this.previousValue !== undefined) && (this.previousValue !== this.value);
|
|
741
|
-
if (isIE() &&
|
|
1001
|
+
if (isIE() && action === this.ACTION_ENTER && valueChanged) {
|
|
742
1002
|
this.fireEvent(this.EVENT_CHANGE);
|
|
743
1003
|
}
|
|
744
1004
|
}
|
|
745
1005
|
|
|
746
|
-
getInputValue() {
|
|
747
|
-
const
|
|
748
|
-
|
|
749
|
-
|
|
1006
|
+
async getInputValue() {
|
|
1007
|
+
const domRef = this.getDomRef();
|
|
1008
|
+
|
|
1009
|
+
if (domRef) {
|
|
1010
|
+
return (await this.getInputDOMRef()).value;
|
|
750
1011
|
}
|
|
751
1012
|
return "";
|
|
752
1013
|
}
|
|
753
1014
|
|
|
754
1015
|
async getInputDOMRef() {
|
|
755
|
-
let inputDomRef;
|
|
756
|
-
|
|
757
1016
|
if (isPhone() && this.Suggestions) {
|
|
758
|
-
await this.Suggestions.
|
|
759
|
-
|
|
1017
|
+
await this.Suggestions._getSuggestionPopover();
|
|
1018
|
+
return this.Suggestions && this.Suggestions.responsivePopover.querySelector(".ui5-input-inner-phone");
|
|
760
1019
|
}
|
|
761
1020
|
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
1021
|
+
return this.nativeInput;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
/**
|
|
1025
|
+
* Returns a reference to the native input element
|
|
1026
|
+
* @protected
|
|
1027
|
+
*/
|
|
1028
|
+
get nativeInput() {
|
|
1029
|
+
return this.getDomRef() && this.getDomRef().querySelector(`input`);
|
|
1030
|
+
}
|
|
765
1031
|
|
|
766
|
-
|
|
767
|
-
return this.
|
|
1032
|
+
get nativeInputWidth() {
|
|
1033
|
+
return this.nativeInput && this.nativeInput.offsetWidth;
|
|
768
1034
|
}
|
|
769
1035
|
|
|
770
1036
|
getLabelableElementId() {
|
|
771
1037
|
return this.getInputId();
|
|
772
1038
|
}
|
|
773
1039
|
|
|
1040
|
+
getSuggestionByListItem(item) {
|
|
1041
|
+
const key = parseInt(item.getAttribute("data-ui5-key"));
|
|
1042
|
+
return this.suggestionItems[key];
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* Returns if the suggestions popover is scrollable.
|
|
1047
|
+
* The method returns <code>Promise</code> that resolves to true,
|
|
1048
|
+
* if the popup is scrollable and false otherwise.
|
|
1049
|
+
* @returns {Promise}
|
|
1050
|
+
*/
|
|
1051
|
+
isSuggestionsScrollable() {
|
|
1052
|
+
if (!this.Suggestions) {
|
|
1053
|
+
return Promise.resolve(false);
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
return this.Suggestions._isScrollable();
|
|
1057
|
+
}
|
|
1058
|
+
|
|
774
1059
|
getInputId() {
|
|
775
1060
|
return `${this._id}-inner`;
|
|
776
1061
|
}
|
|
@@ -778,12 +1063,34 @@ class Input extends UI5Element {
|
|
|
778
1063
|
/* Suggestions interface */
|
|
779
1064
|
onItemFocused() {}
|
|
780
1065
|
|
|
1066
|
+
onItemMouseOver(event) {
|
|
1067
|
+
const item = event.target;
|
|
1068
|
+
const suggestion = this.getSuggestionByListItem(item);
|
|
1069
|
+
suggestion && suggestion.fireEvent("mouseover", {
|
|
1070
|
+
item: suggestion,
|
|
1071
|
+
targetRef: item,
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
onItemMouseOut(event) {
|
|
1076
|
+
const item = event.target;
|
|
1077
|
+
const suggestion = this.getSuggestionByListItem(item);
|
|
1078
|
+
suggestion && suggestion.fireEvent("mouseout", {
|
|
1079
|
+
item: suggestion,
|
|
1080
|
+
targetRef: item,
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
|
|
781
1084
|
onItemSelected(item, keyboardUsed) {
|
|
782
1085
|
this.selectSuggestion(item, keyboardUsed);
|
|
783
1086
|
}
|
|
784
1087
|
|
|
785
1088
|
onItemPreviewed(item) {
|
|
786
1089
|
this.previewSuggestion(item);
|
|
1090
|
+
this.fireEvent("suggestion-item-preview", {
|
|
1091
|
+
item: this.getSuggestionByListItem(item),
|
|
1092
|
+
targetRef: item,
|
|
1093
|
+
});
|
|
787
1094
|
}
|
|
788
1095
|
|
|
789
1096
|
onOpen() {}
|
|
@@ -791,17 +1098,15 @@ class Input extends UI5Element {
|
|
|
791
1098
|
onClose() {}
|
|
792
1099
|
|
|
793
1100
|
valueStateTextMappings() {
|
|
794
|
-
const i18nBundle = this.i18nBundle;
|
|
795
|
-
|
|
796
1101
|
return {
|
|
797
|
-
"Success": i18nBundle.getText(VALUE_STATE_SUCCESS),
|
|
798
|
-
"Information": i18nBundle.getText(VALUE_STATE_INFORMATION),
|
|
799
|
-
"Error": i18nBundle.getText(VALUE_STATE_ERROR),
|
|
800
|
-
"Warning": i18nBundle.getText(VALUE_STATE_WARNING),
|
|
1102
|
+
"Success": Input.i18nBundle.getText(VALUE_STATE_SUCCESS),
|
|
1103
|
+
"Information": Input.i18nBundle.getText(VALUE_STATE_INFORMATION),
|
|
1104
|
+
"Error": Input.i18nBundle.getText(VALUE_STATE_ERROR),
|
|
1105
|
+
"Warning": Input.i18nBundle.getText(VALUE_STATE_WARNING),
|
|
801
1106
|
};
|
|
802
1107
|
}
|
|
803
1108
|
|
|
804
|
-
|
|
1109
|
+
announceSelectedItem() {
|
|
805
1110
|
const invisibleText = this.shadowRoot.querySelector(`#${this._id}-selectionText`);
|
|
806
1111
|
|
|
807
1112
|
if (this.Suggestions && this.Suggestions._isItemOnTarget()) {
|
|
@@ -816,13 +1121,17 @@ class Input extends UI5Element {
|
|
|
816
1121
|
}
|
|
817
1122
|
|
|
818
1123
|
get _headerTitleText() {
|
|
819
|
-
return
|
|
1124
|
+
return Input.i18nBundle.getText(INPUT_SUGGESTIONS_TITLE);
|
|
820
1125
|
}
|
|
821
1126
|
|
|
822
1127
|
get inputType() {
|
|
823
1128
|
return this.type.toLowerCase();
|
|
824
1129
|
}
|
|
825
1130
|
|
|
1131
|
+
get isTypeNumber() {
|
|
1132
|
+
return this.type === InputType.Number;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
826
1135
|
get suggestionsTextId() {
|
|
827
1136
|
return this.showSuggestions ? `${this._id}-suggestionsText` : "";
|
|
828
1137
|
}
|
|
@@ -834,30 +1143,57 @@ class Input extends UI5Element {
|
|
|
834
1143
|
get accInfo() {
|
|
835
1144
|
const ariaHasPopupDefault = this.showSuggestions ? "true" : undefined;
|
|
836
1145
|
const ariaAutoCompleteDefault = this.showSuggestions ? "list" : undefined;
|
|
1146
|
+
const ariaDescribedBy = this._inputAccInfo.ariaDescribedBy ? `${this.suggestionsTextId} ${this.valueStateTextId} ${this._inputAccInfo.ariaDescribedBy}`.trim() : `${this.suggestionsTextId} ${this.valueStateTextId}`.trim();
|
|
1147
|
+
|
|
837
1148
|
return {
|
|
838
|
-
"wrapper": {
|
|
839
|
-
},
|
|
840
1149
|
"input": {
|
|
841
|
-
"
|
|
1150
|
+
"ariaRoledescription": this._inputAccInfo && (this._inputAccInfo.ariaRoledescription || undefined),
|
|
1151
|
+
"ariaDescribedBy": ariaDescribedBy || undefined,
|
|
842
1152
|
"ariaInvalid": this.valueState === ValueState.Error ? "true" : undefined,
|
|
843
1153
|
"ariaHasPopup": this._inputAccInfo.ariaHasPopup ? this._inputAccInfo.ariaHasPopup : ariaHasPopupDefault,
|
|
844
1154
|
"ariaAutoComplete": this._inputAccInfo.ariaAutoComplete ? this._inputAccInfo.ariaAutoComplete : ariaAutoCompleteDefault,
|
|
845
1155
|
"role": this._inputAccInfo && this._inputAccInfo.role,
|
|
846
|
-
"
|
|
1156
|
+
"ariaControls": this._inputAccInfo && this._inputAccInfo.ariaControls,
|
|
847
1157
|
"ariaExpanded": this._inputAccInfo && this._inputAccInfo.ariaExpanded,
|
|
848
1158
|
"ariaDescription": this._inputAccInfo && this._inputAccInfo.ariaDescription,
|
|
1159
|
+
"ariaLabel": (this._inputAccInfo && this._inputAccInfo.ariaLabel) || getEffectiveAriaLabelText(this),
|
|
849
1160
|
},
|
|
850
1161
|
};
|
|
851
1162
|
}
|
|
852
1163
|
|
|
1164
|
+
get nativeInputAttributes() {
|
|
1165
|
+
return {
|
|
1166
|
+
"min": this.isTypeNumber ? this._nativeInputAttributes.min : undefined,
|
|
1167
|
+
"max": this.isTypeNumber ? this._nativeInputAttributes.max : undefined,
|
|
1168
|
+
"step": this.isTypeNumber ? (this._nativeInputAttributes.step || "any") : undefined,
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
get ariaValueStateHiddenText() {
|
|
1173
|
+
if (!this.hasValueStateMessage) {
|
|
1174
|
+
return;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
if (this.shouldDisplayDefaultValueStateMessage) {
|
|
1178
|
+
return this.valueStateText;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
return this.valueStateMessageText.map(el => el.textContent).join(" ");
|
|
1182
|
+
}
|
|
1183
|
+
|
|
853
1184
|
get itemSelectionAnnounce() {
|
|
854
1185
|
return this.Suggestions ? this.Suggestions.itemSelectionAnnounce : undefined;
|
|
855
1186
|
}
|
|
856
1187
|
|
|
857
1188
|
get classes() {
|
|
858
1189
|
return {
|
|
1190
|
+
popover: {
|
|
1191
|
+
"ui5-suggestions-popover": !this.isPhone && this.showSuggestions,
|
|
1192
|
+
"ui5-suggestions-popover-with-value-state-header": !this.isPhone && this.showSuggestions && this.hasValueStateMessage,
|
|
1193
|
+
},
|
|
859
1194
|
popoverValueState: {
|
|
860
1195
|
"ui5-valuestatemessage-root": true,
|
|
1196
|
+
"ui5-valuestatemessage-header": true,
|
|
861
1197
|
"ui5-valuestatemessage--success": this.valueState === ValueState.Success,
|
|
862
1198
|
"ui5-valuestatemessage--error": this.valueState === ValueState.Error,
|
|
863
1199
|
"ui5-valuestatemessage--warning": this.valueState === ValueState.Warning,
|
|
@@ -867,16 +1203,32 @@ class Input extends UI5Element {
|
|
|
867
1203
|
}
|
|
868
1204
|
|
|
869
1205
|
get styles() {
|
|
870
|
-
|
|
1206
|
+
const remSizeIxPx = parseInt(getComputedStyle(document.documentElement).fontSize);
|
|
1207
|
+
|
|
1208
|
+
const stylesObject = {
|
|
871
1209
|
popoverHeader: {
|
|
872
|
-
"width": `${this._inputWidth}px`,
|
|
1210
|
+
"max-width": `${this._inputWidth}px`,
|
|
873
1211
|
},
|
|
874
1212
|
suggestionPopoverHeader: {
|
|
875
1213
|
"display": this._listWidth === 0 ? "none" : "inline-block",
|
|
876
1214
|
"width": `${this._listWidth}px`,
|
|
877
|
-
"padding": "0.5625rem 1rem",
|
|
878
1215
|
},
|
|
1216
|
+
suggestionsPopover: {
|
|
1217
|
+
"min-width": `${this._inputWidth}px`,
|
|
1218
|
+
"max-width": (this._inputWidth / remSizeIxPx) > 40 ? `${this._inputWidth}px` : "40rem",
|
|
1219
|
+
},
|
|
1220
|
+
innerInput: {},
|
|
879
1221
|
};
|
|
1222
|
+
|
|
1223
|
+
if (this.nativeInputWidth < 48) {
|
|
1224
|
+
stylesObject.innerInput.padding = "0";
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
return stylesObject;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
get suggestionSeparators() {
|
|
1231
|
+
return "None";
|
|
880
1232
|
}
|
|
881
1233
|
|
|
882
1234
|
get valueStateMessageText() {
|
|
@@ -884,7 +1236,7 @@ class Input extends UI5Element {
|
|
|
884
1236
|
}
|
|
885
1237
|
|
|
886
1238
|
get shouldDisplayOnlyValueStateMessage() {
|
|
887
|
-
return this.hasValueStateMessage && !this.
|
|
1239
|
+
return this.hasValueStateMessage && !this.open && this.focused;
|
|
888
1240
|
}
|
|
889
1241
|
|
|
890
1242
|
get shouldDisplayDefaultValueStateMessage() {
|
|
@@ -906,21 +1258,120 @@ class Input extends UI5Element {
|
|
|
906
1258
|
}
|
|
907
1259
|
|
|
908
1260
|
get suggestionsText() {
|
|
909
|
-
return
|
|
1261
|
+
return Input.i18nBundle.getText(INPUT_SUGGESTIONS);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
get availableSuggestionsCount() {
|
|
1265
|
+
if (this.showSuggestions && (this.value || this.Suggestions.isOpened())) {
|
|
1266
|
+
switch (this.suggestionsTexts.length) {
|
|
1267
|
+
case 0:
|
|
1268
|
+
return Input.i18nBundle.getText(INPUT_SUGGESTIONS_NO_HIT);
|
|
1269
|
+
|
|
1270
|
+
case 1:
|
|
1271
|
+
return Input.i18nBundle.getText(INPUT_SUGGESTIONS_ONE_HIT);
|
|
1272
|
+
|
|
1273
|
+
default:
|
|
1274
|
+
return Input.i18nBundle.getText(INPUT_SUGGESTIONS_MORE_HITS, this.suggestionsTexts.length);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
return undefined;
|
|
910
1279
|
}
|
|
911
1280
|
|
|
912
1281
|
get step() {
|
|
913
|
-
return this.
|
|
1282
|
+
return this.isTypeNumber ? "any" : undefined;
|
|
914
1283
|
}
|
|
915
1284
|
|
|
916
1285
|
get _isPhone() {
|
|
917
1286
|
return isPhone();
|
|
918
1287
|
}
|
|
919
1288
|
|
|
1289
|
+
/**
|
|
1290
|
+
* Returns the placeholder value.
|
|
1291
|
+
* @protected
|
|
1292
|
+
*/
|
|
1293
|
+
get _placeholder() {
|
|
1294
|
+
return this.placeholder;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* This method is relevant for sap_horizon theme only
|
|
1299
|
+
*/
|
|
1300
|
+
get _valueStateInputIcon() {
|
|
1301
|
+
const iconPerValueState = {
|
|
1302
|
+
Error: `<path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20ZM7.70711 13.7071C7.31658 14.0976 6.68342 14.0976 6.29289 13.7071C5.90237 13.3166 5.90237 12.6834 6.29289 12.2929L8.58579 10L6.29289 7.70711C5.90237 7.31658 5.90237 6.68342 6.29289 6.29289C6.68342 5.90237 7.31658 5.90237 7.70711 6.29289L10 8.58579L12.2929 6.29289C12.6834 5.90237 13.3166 5.90237 13.7071 6.29289C14.0976 6.68342 14.0976 7.31658 13.7071 7.70711L11.4142 10L13.7071 12.2929C14.0976 12.6834 14.0976 13.3166 13.7071 13.7071C13.3166 14.0976 12.6834 14.0976 12.2929 13.7071L10 11.4142L7.70711 13.7071Z" fill="#EE3939"/>`,
|
|
1303
|
+
Warning: `<path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M11.8619 0.49298C11.6823 0.187541 11.3544 0 11 0C10.6456 0 10.3177 0.187541 10.1381 0.49298L0.138066 17.493C-0.0438112 17.8022 -0.0461447 18.1851 0.13195 18.4965C0.310046 18.8079 0.641283 19 1 19H21C21.3587 19 21.69 18.8079 21.868 18.4965C22.0461 18.1851 22.0438 17.8022 21.8619 17.493L11.8619 0.49298ZM11 6C11.5523 6 12 6.44772 12 7V10C12 10.5523 11.5523 11 11 11C10.4477 11 10 10.5523 10 10V7C10 6.44772 10.4477 6 11 6ZM11 16C11.8284 16 12.5 15.3284 12.5 14.5C12.5 13.6716 11.8284 13 11 13C10.1716 13 9.5 13.6716 9.5 14.5C9.5 15.3284 10.1716 16 11 16Z" fill="#F58B00"/>`,
|
|
1304
|
+
Success: `<path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M0 10C0 15.5228 4.47715 20 10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10ZM14.7071 6.29289C14.3166 5.90237 13.6834 5.90237 13.2929 6.29289L8 11.5858L6.70711 10.2929C6.31658 9.90237 5.68342 9.90237 5.29289 10.2929C4.90237 10.6834 4.90237 11.3166 5.29289 11.7071L7.29289 13.7071C7.68342 14.0976 8.31658 14.0976 8.70711 13.7071L14.7071 7.70711C15.0976 7.31658 15.0976 6.68342 14.7071 6.29289Z" fill="#36A41D"/>`,
|
|
1305
|
+
Information: `<path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M3 0C1.34315 0 0 1.34315 0 3V15C0 16.6569 1.34315 18 3 18H15C16.6569 18 18 16.6569 18 15V3C18 1.34315 16.6569 0 15 0H3ZM9 6.5C9.82843 6.5 10.5 5.82843 10.5 5C10.5 4.17157 9.82843 3.5 9 3.5C8.17157 3.5 7.5 4.17157 7.5 5C7.5 5.82843 8.17157 6.5 9 6.5ZM9 8.5C9.55228 8.5 10 8.94772 10 9.5V13.5C10 14.0523 9.55228 14.5 9 14.5C8.44771 14.5 8 14.0523 8 13.5V9.5C8 8.94772 8.44771 8.5 9 8.5Z" fill="#1B90FF"/>`,
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
const result = `
|
|
1309
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="20" viewBox="0 0 20 20" fill="none">
|
|
1310
|
+
${iconPerValueState[this.valueState]};
|
|
1311
|
+
</svg>
|
|
1312
|
+
`;
|
|
1313
|
+
|
|
1314
|
+
return this.valueState !== ValueState.None ? result : "";
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
/**
|
|
1318
|
+
* This method is relevant for sap_horizon theme only
|
|
1319
|
+
*/
|
|
1320
|
+
get _valueStateMessageInputIcon() {
|
|
1321
|
+
const iconPerValueState = {
|
|
1322
|
+
Error: "error",
|
|
1323
|
+
Warning: "alert",
|
|
1324
|
+
Success: "sys-enter-2",
|
|
1325
|
+
Information: "information",
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1328
|
+
return this.valueState !== ValueState.None ? iconPerValueState[this.valueState] : "";
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* Returns the caret position inside the native input
|
|
1333
|
+
* @protected
|
|
1334
|
+
*/
|
|
1335
|
+
getCaretPosition() {
|
|
1336
|
+
return getCaretPosition(this.nativeInput);
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
/**
|
|
1340
|
+
* Sets the caret to a certain position inside the native input
|
|
1341
|
+
* @protected
|
|
1342
|
+
* @param pos
|
|
1343
|
+
*/
|
|
1344
|
+
setCaretPosition(pos) {
|
|
1345
|
+
setCaretPosition(this.nativeInput, pos);
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
/**
|
|
1349
|
+
* Removes the fractional part of floating-point number.
|
|
1350
|
+
* @param {String} value the numeric value of Input of type "Number"
|
|
1351
|
+
*/
|
|
1352
|
+
removeFractionalPart(value) {
|
|
1353
|
+
if (value.includes(".")) {
|
|
1354
|
+
return value.slice(0, value.indexOf("."));
|
|
1355
|
+
}
|
|
1356
|
+
if (value.includes(",")) {
|
|
1357
|
+
return value.slice(0, value.indexOf(","));
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
return value;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
static get dependencies() {
|
|
1364
|
+
const Suggestions = getFeature("InputSuggestions");
|
|
1365
|
+
|
|
1366
|
+
return [Popover].concat(Suggestions ? Suggestions.dependencies : []);
|
|
1367
|
+
}
|
|
1368
|
+
|
|
920
1369
|
static async onDefine() {
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
1370
|
+
const Suggestions = getFeature("InputSuggestions");
|
|
1371
|
+
|
|
1372
|
+
[Input.i18nBundle] = await Promise.all([
|
|
1373
|
+
getI18nBundle("@ui5/webcomponents"),
|
|
1374
|
+
Suggestions ? Suggestions.init() : Promise.resolve(),
|
|
924
1375
|
]);
|
|
925
1376
|
}
|
|
926
1377
|
}
|