@ui5/webcomponents 0.0.0-323968e1b → 0.0.0-4180fe799
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 +717 -1
- package/README.md +144 -41
- package/csp.js +7 -0
- package/customI18n.js +50 -0
- package/dist/Assets-static.js +6 -0
- package/dist/Assets.js +3 -2
- package/dist/Avatar.js +224 -40
- package/dist/AvatarGroup.js +603 -0
- package/dist/Badge.js +48 -28
- package/dist/Breadcrumbs.js +563 -0
- package/dist/BreadcrumbsItem.js +109 -0
- package/dist/BusyIndicator.js +172 -19
- package/dist/Button.js +180 -49
- package/dist/Calendar.js +345 -554
- package/dist/CalendarDate.js +45 -0
- package/dist/CalendarHeader.js +133 -64
- package/dist/CalendarPart.js +111 -0
- package/dist/Card.js +47 -161
- package/dist/CardHeader.js +288 -0
- package/dist/Carousel.js +681 -0
- package/dist/CheckBox.js +154 -54
- 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 +664 -107
- package/dist/ComboBoxFilters.js +8 -1
- package/dist/ComboBoxGroupItem.js +70 -0
- package/dist/ComboBoxItem.js +33 -30
- package/dist/CustomListItem.js +38 -9
- package/dist/DateComponentBase.js +170 -0
- package/dist/DatePicker.js +468 -384
- package/dist/DateRangePicker.js +328 -0
- package/dist/DateTimePicker.js +430 -0
- package/dist/DayPicker.js +513 -438
- package/dist/Dialog.js +501 -47
- package/dist/DurationPicker.js +312 -0
- package/dist/FileUploader.js +532 -0
- package/dist/GroupHeaderListItem.js +36 -8
- package/dist/Icon.js +221 -43
- package/dist/Input.js +796 -127
- package/dist/Interfaces.js +192 -0
- package/dist/Label.js +27 -12
- package/dist/Link.js +143 -35
- package/dist/List.js +560 -73
- package/dist/ListItem.js +139 -30
- package/dist/ListItemBase.js +53 -9
- package/dist/MessageStrip.js +82 -93
- package/dist/MonthPicker.js +181 -184
- package/dist/MultiComboBox.js +625 -200
- package/dist/MultiComboBoxItem.js +43 -0
- package/dist/MultiInput.js +301 -0
- package/dist/Option.js +48 -5
- package/dist/Panel.js +123 -41
- package/dist/Popover.js +314 -234
- package/dist/Popup.js +382 -287
- package/dist/ProgressIndicator.js +235 -0
- package/dist/RadioButton.js +153 -66
- package/dist/RadioButtonGroup.js +53 -29
- package/dist/RangeSlider.js +769 -0
- package/dist/RatingIndicator.js +291 -0
- package/dist/ResponsivePopover.js +117 -61
- package/dist/SegmentedButton.js +290 -0
- package/dist/SegmentedButtonItem.js +109 -0
- package/dist/Select.js +500 -110
- package/dist/Slider.js +320 -0
- package/dist/SliderBase.js +842 -0
- package/dist/StandardListItem.js +46 -24
- package/dist/StepInput.js +684 -0
- package/dist/SuggestionGroupItem.js +64 -0
- package/dist/SuggestionItem.js +146 -0
- package/dist/SuggestionListItem.js +76 -0
- package/dist/Switch.js +62 -48
- package/dist/Tab.js +184 -18
- package/dist/TabContainer.js +337 -235
- package/dist/TabSeparator.js +2 -1
- package/dist/Table.js +492 -39
- package/dist/TableCell.js +13 -15
- package/dist/TableColumn.js +18 -7
- package/dist/TableGroupRow.js +160 -0
- package/dist/TableRow.js +254 -31
- package/dist/TextArea.js +314 -38
- package/dist/TimePicker.js +166 -0
- package/dist/TimePickerBase.js +463 -0
- package/dist/TimeSelection.js +493 -0
- package/dist/Title.js +18 -10
- package/dist/Toast.js +63 -37
- package/dist/ToggleButton.js +21 -13
- package/dist/Token.js +87 -49
- package/dist/Tokenizer.js +250 -65
- package/dist/Tree.js +443 -0
- package/dist/TreeItem.js +168 -0
- package/dist/TreeListItem.js +332 -0
- package/dist/WheelSlider.js +435 -0
- package/dist/YearPicker.js +201 -258
- package/dist/api.json +6877 -0
- package/dist/features/ColorPaletteMoreColors.js +42 -0
- package/dist/features/InputElementsFormSupport.js +35 -1
- package/dist/features/InputSuggestions.js +294 -52
- 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 -0
- 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 -13
- package/dist/generated/json-imports/i18n-static.js +162 -0
- package/dist/generated/json-imports/i18n.js +113 -89
- 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 -5
- 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 +16 -0
- 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 -5
- package/dist/generated/templates/CustomListItemTemplate.lit.js +13 -12
- package/dist/generated/templates/DatePickerPopoverTemplate.lit.js +7 -4
- package/dist/generated/templates/DatePickerTemplate.lit.js +6 -5
- package/dist/generated/templates/DateTimePickerPopoverTemplate.lit.js +12 -0
- package/dist/generated/templates/DayPickerTemplate.lit.js +13 -11
- package/dist/generated/templates/DialogTemplate.lit.js +9 -8
- package/dist/generated/templates/FileUploaderPopoverTemplate.lit.js +10 -0
- package/dist/generated/templates/FileUploaderTemplate.lit.js +10 -0
- 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 -6
- 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 -12
- package/dist/generated/templates/ListTemplate.lit.js +12 -8
- package/dist/generated/templates/MessageStripTemplate.lit.js +6 -22
- package/dist/generated/templates/MonthPickerTemplate.lit.js +6 -6
- package/dist/generated/templates/MultiComboBoxPopoverTemplate.lit.js +23 -7
- 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 +7 -0
- package/dist/generated/templates/PopupTemplate.lit.js +4 -4
- 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 -11
- package/dist/generated/templates/SegmentedButtonItemTemplate.lit.js +8 -0
- package/dist/generated/templates/SegmentedButtonTemplate.lit.js +7 -0
- package/dist/generated/templates/SelectPopoverTemplate.lit.js +20 -6
- package/dist/generated/templates/SelectTemplate.lit.js +6 -4
- 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 -18
- package/dist/generated/templates/StepInputTemplate.lit.js +10 -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 -8
- package/dist/generated/templates/TabContainerTemplate.lit.js +16 -18
- package/dist/generated/templates/TabInOverflowTemplate.lit.js +9 -0
- package/dist/generated/templates/TabInStripTemplate.lit.js +11 -0
- 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 -6
- package/dist/generated/templates/TableTemplate.lit.js +13 -8
- package/dist/generated/templates/TextAreaPopoverTemplate.lit.js +11 -0
- package/dist/generated/templates/TextAreaTemplate.lit.js +8 -8
- package/dist/generated/templates/TimePickerPopoverTemplate.lit.js +7 -0
- package/dist/generated/templates/TimePickerTemplate.lit.js +9 -0
- 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 +21 -0
- package/dist/generated/templates/TreeTemplate.lit.js +8 -0
- package/dist/generated/templates/WheelSliderTemplate.lit.js +10 -0
- package/dist/generated/templates/YearPickerTemplate.lit.js +6 -6
- package/dist/generated/themes/Avatar.css.js +6 -7
- package/dist/generated/themes/AvatarGroup.css.js +8 -0
- package/dist/generated/themes/Badge.css.js +6 -7
- 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 +6 -7
- package/dist/generated/themes/Button.css.js +6 -7
- package/dist/generated/themes/Button.ie11.css.js +8 -0
- package/dist/generated/themes/Calendar.css.js +6 -7
- package/dist/generated/themes/CalendarHeader.css.js +6 -7
- package/dist/generated/themes/Card.css.js +6 -7
- package/dist/generated/themes/CardHeader.css.js +8 -0
- package/dist/generated/themes/Carousel.css.js +8 -0
- package/dist/generated/themes/CheckBox.css.js +6 -7
- 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 +6 -7
- package/dist/generated/themes/ComboBoxPopover.css.js +6 -7
- package/dist/generated/themes/CustomListItem.css.js +6 -7
- package/dist/generated/themes/DatePicker.css.js +6 -7
- package/dist/generated/themes/DatePickerPopover.css.js +6 -7
- package/dist/generated/themes/DateRangePicker.css.js +8 -0
- package/dist/generated/themes/DateTimePicker.css.js +8 -0
- package/dist/generated/themes/DateTimePickerPopover.css.js +8 -0
- package/dist/generated/themes/DayPicker.css.js +6 -7
- package/dist/generated/themes/Dialog.css.js +6 -7
- package/dist/generated/themes/FileUploader.css.js +8 -0
- package/dist/generated/themes/GroupHeaderListItem.css.js +6 -7
- package/dist/generated/themes/GrowingButton.css.js +8 -0
- package/dist/generated/themes/Icon.css.js +6 -7
- package/dist/generated/themes/Input.css.js +6 -7
- package/dist/generated/themes/InputIcon.css.js +6 -7
- package/dist/generated/themes/InvisibleTextStyles.css.js +6 -7
- package/dist/generated/themes/Label.css.js +6 -7
- package/dist/generated/themes/Link.css.js +6 -7
- package/dist/generated/themes/List.css.js +6 -7
- package/dist/generated/themes/ListItem.css.js +6 -7
- package/dist/generated/themes/ListItemBase.css.js +6 -7
- package/dist/generated/themes/MessageStrip.css.js +6 -7
- package/dist/generated/themes/MonthPicker.css.js +6 -7
- package/dist/generated/themes/MultiComboBox.css.js +6 -7
- package/dist/generated/themes/MultiInput.css.js +8 -0
- package/dist/generated/themes/Panel.css.js +6 -7
- package/dist/generated/themes/Popover.css.js +6 -7
- package/dist/generated/themes/Popup.css.js +6 -7
- package/dist/generated/themes/PopupGlobal.css.js +8 -0
- package/dist/generated/themes/PopupStaticAreaStyles.css.js +8 -0
- 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 +6 -7
- package/dist/generated/themes/RatingIndicator.css.js +8 -0
- package/dist/generated/themes/ResponsivePopover.css.js +6 -7
- package/dist/generated/themes/ResponsivePopoverCommon.css.js +6 -7
- package/dist/generated/themes/SegmentedButton.css.js +8 -0
- package/dist/generated/themes/Select.css.js +6 -7
- 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 +6 -7
- package/dist/generated/themes/Tab.css.js +6 -7
- package/dist/generated/themes/TabContainer.css.js +6 -7
- package/dist/generated/themes/TabInOverflow.css.js +8 -0
- package/dist/generated/themes/TabInStrip.css.js +8 -0
- package/dist/generated/themes/Table.css.js +6 -7
- package/dist/generated/themes/TableCell.css.js +6 -7
- package/dist/generated/themes/TableColumn.css.js +6 -7
- package/dist/generated/themes/TableGroupRow.css.js +8 -0
- package/dist/generated/themes/TableRow.css.js +6 -7
- package/dist/generated/themes/TapHighlightColor.css.js +8 -0
- package/dist/generated/themes/TextArea.css.js +6 -7
- package/dist/generated/themes/TimePicker.css.js +8 -0
- package/dist/generated/themes/TimePickerPopover.css.js +8 -0
- package/dist/generated/themes/TimeSelection.css.js +8 -0
- package/dist/generated/themes/Title.css.js +6 -7
- package/dist/generated/themes/Toast.css.js +6 -7
- package/dist/generated/themes/ToggleButton.css.js +6 -7
- package/dist/generated/themes/ToggleButton.ie11.css.js +8 -0
- package/dist/generated/themes/Token.css.js +6 -7
- package/dist/generated/themes/Tokenizer.css.js +6 -7
- package/dist/generated/themes/Tree.css.js +8 -0
- package/dist/generated/themes/TreeListItem.css.js +8 -0
- package/dist/generated/themes/ValueStateMessage.css.js +8 -0
- package/dist/generated/themes/WheelSlider.css.js +8 -0
- package/dist/generated/themes/YearPicker.css.js +6 -7
- 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 -0
- 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 +55 -21
- package/dist/timepicker-utils/TimeSlider.js +103 -0
- 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 +40 -0
- 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 +8 -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 +55 -0
- package/dist/types/SemanticColor.js +1 -1
- package/dist/types/SwitchDesign.js +40 -0
- package/dist/types/TabContainerTabsPlacement.js +40 -0
- package/dist/types/TabLayout.js +40 -0
- 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 -8
- 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 +227 -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 +80 -0
- package/src/StepInput.js +684 -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 +262 -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 -81
- package/dist/TimelineItem.js +0 -163
- package/dist/generated/templates/ComboBoxItemTemplate.lit.js +0 -7
- 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 -9
- package/dist/generated/themes/TabContainerPopup.css.js +0 -9
- package/dist/generated/themes/Timeline.css.js +0 -9
- package/dist/generated/themes/TimelineItem.css.js +0 -9
- package/dist/popup-utils/PopupUtils.js +0 -42
- package/dist/types/AvatarFitType.js +0 -40
- package/dist/webcomponentsjs/package.json +0 -46
- package/index.js +0 -2
package/dist/Input.js
CHANGED
|
@@ -1,6 +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
|
-
import
|
|
3
|
+
import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
|
|
4
|
+
import { isIE, isPhone, isSafari } from "@ui5/webcomponents-base/dist/Device.js";
|
|
4
5
|
import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
|
|
5
6
|
import { getFeature } from "@ui5/webcomponents-base/dist/FeaturesRegistry.js";
|
|
6
7
|
import {
|
|
@@ -8,38 +9,55 @@ import {
|
|
|
8
9
|
isDown,
|
|
9
10
|
isSpace,
|
|
10
11
|
isEnter,
|
|
11
|
-
|
|
12
|
+
isBackSpace,
|
|
13
|
+
isEscape,
|
|
14
|
+
isTabNext,
|
|
15
|
+
} from "@ui5/webcomponents-base/dist/Keys.js";
|
|
12
16
|
import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
|
|
13
|
-
import {
|
|
14
|
-
|
|
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";
|
|
15
22
|
import InputType from "./types/InputType.js";
|
|
23
|
+
import Popover from "./Popover.js";
|
|
16
24
|
// Templates
|
|
17
25
|
import InputTemplate from "./generated/templates/InputTemplate.lit.js";
|
|
18
26
|
import InputPopoverTemplate from "./generated/templates/InputPopoverTemplate.lit.js";
|
|
19
27
|
|
|
20
28
|
import {
|
|
21
29
|
VALUE_STATE_SUCCESS,
|
|
30
|
+
VALUE_STATE_INFORMATION,
|
|
22
31
|
VALUE_STATE_ERROR,
|
|
23
32
|
VALUE_STATE_WARNING,
|
|
24
33
|
INPUT_SUGGESTIONS,
|
|
25
34
|
INPUT_SUGGESTIONS_TITLE,
|
|
35
|
+
INPUT_SUGGESTIONS_ONE_HIT,
|
|
36
|
+
INPUT_SUGGESTIONS_MORE_HITS,
|
|
37
|
+
INPUT_SUGGESTIONS_NO_HIT,
|
|
26
38
|
} from "./generated/i18n/i18n-defaults.js";
|
|
27
39
|
|
|
28
40
|
// Styles
|
|
29
41
|
import styles from "./generated/themes/Input.css.js";
|
|
30
42
|
import ResponsivePopoverCommonCss from "./generated/themes/ResponsivePopoverCommon.css.js";
|
|
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+/);
|
|
31
47
|
|
|
32
48
|
/**
|
|
33
49
|
* @public
|
|
34
50
|
*/
|
|
35
51
|
const metadata = {
|
|
36
52
|
tag: "ui5-input",
|
|
53
|
+
languageAware: true,
|
|
54
|
+
managedSlots: true,
|
|
37
55
|
slots: /** @lends sap.ui.webcomponents.main.Input.prototype */ {
|
|
38
56
|
|
|
39
57
|
/**
|
|
40
|
-
* Defines the icon to be displayed in the
|
|
58
|
+
* Defines the icon to be displayed in the component.
|
|
41
59
|
*
|
|
42
|
-
* @type {
|
|
60
|
+
* @type {sap.ui.webcomponents.main.IIcon[]}
|
|
43
61
|
* @slot
|
|
44
62
|
* @public
|
|
45
63
|
*/
|
|
@@ -48,24 +66,37 @@ const metadata = {
|
|
|
48
66
|
},
|
|
49
67
|
|
|
50
68
|
/**
|
|
51
|
-
* Defines the
|
|
69
|
+
* Defines the suggestion items.
|
|
70
|
+
* <br><br>
|
|
71
|
+
* Example:
|
|
52
72
|
* <br><br>
|
|
53
|
-
* Example: <br>
|
|
54
73
|
* <ui5-input show-suggestions><br>
|
|
55
|
-
* <ui5-
|
|
56
|
-
* <ui5-
|
|
74
|
+
* <ui5-suggestion-item text="Item #1"></ui5-suggestion-item><br>
|
|
75
|
+
* <ui5-suggestion-item text="Item #2"></ui5-suggestion-item><br>
|
|
57
76
|
* </ui5-input>
|
|
58
|
-
* <
|
|
77
|
+
* <br>
|
|
78
|
+
* <ui5-input show-suggestions>
|
|
79
|
+
* <ui5-suggestion-group-item text="Group #1"></ui5-suggestion-group-item>
|
|
80
|
+
* <ui5-suggestion-item text="Item #1"></ui5-suggestion-item>
|
|
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>
|
|
85
|
+
* </ui5-input>
|
|
59
86
|
* <br><br>
|
|
60
|
-
* <b>Note:</b> The
|
|
87
|
+
* <b>Note:</b> The suggestions would be displayed only if the <code>showSuggestions</code>
|
|
61
88
|
* property is set to <code>true</code>.
|
|
62
89
|
* <br><br>
|
|
63
|
-
* <b>Note:</b> The
|
|
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:
|
|
64
93
|
* <br>
|
|
65
|
-
*
|
|
94
|
+
* <code>import "@ui5/webcomponents/dist/features/InputSuggestions.js";</code>
|
|
95
|
+
* <br>
|
|
96
|
+
* automatically imports the <code><ui5-suggestion-item></code> and <code><ui5-suggestion-group-item></code> for your convenience.
|
|
66
97
|
*
|
|
67
|
-
* @type {
|
|
68
|
-
* @slot
|
|
98
|
+
* @type {sap.ui.webcomponents.main.IInputSuggestionItem[]}
|
|
99
|
+
* @slot suggestionItems
|
|
69
100
|
* @public
|
|
70
101
|
*/
|
|
71
102
|
"default": {
|
|
@@ -82,13 +113,33 @@ const metadata = {
|
|
|
82
113
|
formSupport: {
|
|
83
114
|
type: HTMLElement,
|
|
84
115
|
},
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Defines the value state message that will be displayed as pop up under the component.
|
|
119
|
+
* <br><br>
|
|
120
|
+
*
|
|
121
|
+
* <b>Note:</b> If not specified, a default text (in the respective language) will be displayed.
|
|
122
|
+
* <br><br>
|
|
123
|
+
* <b>Note:</b> The <code>valueStateMessage</code> would be displayed,
|
|
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>,
|
|
127
|
+
* the <code>valueStateMessage</code> would be displayed as part of the same popover, if used on desktop, or dialog - on phone.
|
|
128
|
+
* @type {HTMLElement[]}
|
|
129
|
+
* @since 1.0.0-rc.6
|
|
130
|
+
* @slot
|
|
131
|
+
* @public
|
|
132
|
+
*/
|
|
133
|
+
valueStateMessage: {
|
|
134
|
+
type: HTMLElement,
|
|
135
|
+
},
|
|
85
136
|
},
|
|
86
137
|
properties: /** @lends sap.ui.webcomponents.main.Input.prototype */ {
|
|
87
138
|
|
|
88
139
|
/**
|
|
89
|
-
* Defines whether
|
|
140
|
+
* Defines whether the component is in disabled state.
|
|
90
141
|
* <br><br>
|
|
91
|
-
* <b>Note:</b> A disabled
|
|
142
|
+
* <b>Note:</b> A disabled component is completely noninteractive.
|
|
92
143
|
*
|
|
93
144
|
* @type {boolean}
|
|
94
145
|
* @defaultvalue false
|
|
@@ -98,9 +149,24 @@ const metadata = {
|
|
|
98
149
|
type: Boolean,
|
|
99
150
|
},
|
|
100
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
|
+
|
|
101
167
|
/**
|
|
102
168
|
* Defines a short hint intended to aid the user with data entry when the
|
|
103
|
-
*
|
|
169
|
+
* component has no value.
|
|
104
170
|
* @type {string}
|
|
105
171
|
* @defaultvalue ""
|
|
106
172
|
* @public
|
|
@@ -110,9 +176,9 @@ const metadata = {
|
|
|
110
176
|
},
|
|
111
177
|
|
|
112
178
|
/**
|
|
113
|
-
* Defines whether the
|
|
179
|
+
* Defines whether the component is read-only.
|
|
114
180
|
* <br><br>
|
|
115
|
-
* <b>Note:</b> A read-only
|
|
181
|
+
* <b>Note:</b> A read-only component is not editable,
|
|
116
182
|
* but still provides visual feedback upon user interaction.
|
|
117
183
|
*
|
|
118
184
|
* @type {boolean}
|
|
@@ -124,7 +190,7 @@ const metadata = {
|
|
|
124
190
|
},
|
|
125
191
|
|
|
126
192
|
/**
|
|
127
|
-
* Defines whether the
|
|
193
|
+
* Defines whether the component is required.
|
|
128
194
|
*
|
|
129
195
|
* @type {boolean}
|
|
130
196
|
* @defaultvalue false
|
|
@@ -136,7 +202,7 @@ const metadata = {
|
|
|
136
202
|
},
|
|
137
203
|
|
|
138
204
|
/**
|
|
139
|
-
* Defines the HTML type of the
|
|
205
|
+
* Defines the HTML type of the component.
|
|
140
206
|
* Available options are: <code>Text</code>, <code>Email</code>,
|
|
141
207
|
* <code>Number</code>, <code>Password</code>, <code>Tel</code>, and <code>URL</code>.
|
|
142
208
|
* <br><br>
|
|
@@ -148,7 +214,7 @@ const metadata = {
|
|
|
148
214
|
* that use different soft keyboard layouts depending on the given input type.</li>
|
|
149
215
|
* </ul>
|
|
150
216
|
*
|
|
151
|
-
* @type {
|
|
217
|
+
* @type {InputType}
|
|
152
218
|
* @defaultvalue "Text"
|
|
153
219
|
* @public
|
|
154
220
|
*/
|
|
@@ -158,7 +224,7 @@ const metadata = {
|
|
|
158
224
|
},
|
|
159
225
|
|
|
160
226
|
/**
|
|
161
|
-
* Defines the value of the
|
|
227
|
+
* Defines the value of the component.
|
|
162
228
|
* <br><br>
|
|
163
229
|
* <b>Note:</b> The property is updated upon typing.
|
|
164
230
|
*
|
|
@@ -171,10 +237,18 @@ const metadata = {
|
|
|
171
237
|
},
|
|
172
238
|
|
|
173
239
|
/**
|
|
174
|
-
* Defines the value state of the
|
|
175
|
-
*
|
|
240
|
+
* Defines the value state of the component.
|
|
241
|
+
* <br><br>
|
|
242
|
+
* Available options are:
|
|
243
|
+
* <ul>
|
|
244
|
+
* <li><code>None</code></li>
|
|
245
|
+
* <li><code>Error</code></li>
|
|
246
|
+
* <li><code>Warning</code></li>
|
|
247
|
+
* <li><code>Success</code></li>
|
|
248
|
+
* <li><code>Information</code></li>
|
|
249
|
+
* </ul>
|
|
176
250
|
*
|
|
177
|
-
* @type {
|
|
251
|
+
* @type {ValueState}
|
|
178
252
|
* @defaultvalue "None"
|
|
179
253
|
* @public
|
|
180
254
|
*/
|
|
@@ -184,13 +258,15 @@ const metadata = {
|
|
|
184
258
|
},
|
|
185
259
|
|
|
186
260
|
/**
|
|
187
|
-
* Determines the name with which the
|
|
261
|
+
* Determines the name with which the component will be submitted in an HTML form.
|
|
188
262
|
*
|
|
263
|
+
* <br><br>
|
|
189
264
|
* <b>Important:</b> For the <code>name</code> property to have effect, you must add the following import to your project:
|
|
190
265
|
* <code>import "@ui5/webcomponents/dist/features/InputElementsFormSupport.js";</code>
|
|
191
266
|
*
|
|
267
|
+
* <br><br>
|
|
192
268
|
* <b>Note:</b> When set, a native <code>input</code> HTML element
|
|
193
|
-
* will be created inside the
|
|
269
|
+
* will be created inside the component so that it can be submitted as
|
|
194
270
|
* part of an HTML form. Do not use this property unless you need to submit a form.
|
|
195
271
|
*
|
|
196
272
|
* @type {string}
|
|
@@ -202,11 +278,11 @@ const metadata = {
|
|
|
202
278
|
},
|
|
203
279
|
|
|
204
280
|
/**
|
|
205
|
-
* Defines whether the
|
|
281
|
+
* Defines whether the component should show suggestions, if such are present.
|
|
206
282
|
* <br><br>
|
|
207
|
-
* <b>Note:</b>
|
|
208
|
-
*
|
|
209
|
-
* @type {
|
|
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.
|
|
285
|
+
* @type {boolean}
|
|
210
286
|
* @defaultvalue false
|
|
211
287
|
* @public
|
|
212
288
|
*/
|
|
@@ -225,6 +301,30 @@ const metadata = {
|
|
|
225
301
|
type: Integer,
|
|
226
302
|
},
|
|
227
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
|
+
|
|
228
328
|
/**
|
|
229
329
|
* @private
|
|
230
330
|
*/
|
|
@@ -232,6 +332,18 @@ const metadata = {
|
|
|
232
332
|
type: Boolean,
|
|
233
333
|
},
|
|
234
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
|
+
|
|
235
347
|
_input: {
|
|
236
348
|
type: Object,
|
|
237
349
|
},
|
|
@@ -240,9 +352,27 @@ const metadata = {
|
|
|
240
352
|
type: Object,
|
|
241
353
|
},
|
|
242
354
|
|
|
243
|
-
|
|
355
|
+
_nativeInputAttributes: {
|
|
244
356
|
type: Object,
|
|
245
357
|
},
|
|
358
|
+
|
|
359
|
+
_inputWidth: {
|
|
360
|
+
type: Integer,
|
|
361
|
+
},
|
|
362
|
+
|
|
363
|
+
_listWidth: {
|
|
364
|
+
type: Integer,
|
|
365
|
+
},
|
|
366
|
+
|
|
367
|
+
_isPopoverOpen: {
|
|
368
|
+
type: Boolean,
|
|
369
|
+
noAttribute: true,
|
|
370
|
+
},
|
|
371
|
+
|
|
372
|
+
_inputIconFocused: {
|
|
373
|
+
type: Boolean,
|
|
374
|
+
noAttribute: true,
|
|
375
|
+
},
|
|
246
376
|
},
|
|
247
377
|
events: /** @lends sap.ui.webcomponents.main.Input.prototype */ {
|
|
248
378
|
/**
|
|
@@ -254,7 +384,7 @@ const metadata = {
|
|
|
254
384
|
change: {},
|
|
255
385
|
|
|
256
386
|
/**
|
|
257
|
-
* Fired when the value of the
|
|
387
|
+
* Fired when the value of the component changes at each keystroke,
|
|
258
388
|
* and when a suggestion item has been selected.
|
|
259
389
|
*
|
|
260
390
|
* @event
|
|
@@ -263,27 +393,48 @@ const metadata = {
|
|
|
263
393
|
input: {},
|
|
264
394
|
|
|
265
395
|
/**
|
|
266
|
-
* Fired when
|
|
267
|
-
* <br><br>
|
|
268
|
-
* <b>Note:</b> The event is fired independent of whether there was a change before or not.
|
|
269
|
-
* If change was performed, the event is fired after the change event.
|
|
270
|
-
* 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.
|
|
271
397
|
*
|
|
272
|
-
* @event
|
|
398
|
+
* @event sap.ui.webcomponents.main.Input#suggestion-item-select
|
|
399
|
+
* @param {HTMLElement} item The selected item.
|
|
273
400
|
* @public
|
|
274
401
|
*/
|
|
275
|
-
|
|
402
|
+
"suggestion-item-select": {
|
|
403
|
+
detail: {
|
|
404
|
+
item: { type: HTMLElement },
|
|
405
|
+
},
|
|
406
|
+
},
|
|
276
407
|
|
|
277
408
|
/**
|
|
278
|
-
* 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.
|
|
279
411
|
*
|
|
280
|
-
* @event
|
|
281
|
-
* @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.
|
|
282
415
|
* @public
|
|
416
|
+
* @since 1.0.0-rc.8
|
|
283
417
|
*/
|
|
284
|
-
|
|
418
|
+
"suggestion-item-preview": {
|
|
285
419
|
detail: {
|
|
286
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 },
|
|
287
438
|
},
|
|
288
439
|
},
|
|
289
440
|
},
|
|
@@ -299,13 +450,13 @@ const metadata = {
|
|
|
299
450
|
* that are displayed in a popover right under the input.
|
|
300
451
|
* <br><br>
|
|
301
452
|
* The text field can be editable or read-only (<code>readonly</code> property),
|
|
302
|
-
* and
|
|
453
|
+
* and it can be enabled or disabled (<code>disabled</code> property).
|
|
303
454
|
* To visualize semantic states, such as "error" or "warning", the <code>valueState</code> property is provided.
|
|
304
455
|
* When the user makes changes to the text, the change event is fired,
|
|
305
456
|
* which enables you to react on any text change.
|
|
306
457
|
* <br><br>
|
|
307
458
|
* <b>Note:</b> If you are using the <code>ui5-input</code> as a single npm module,
|
|
308
|
-
* don
|
|
459
|
+
* don't forget to import the <code>InputSuggestions</code> module from
|
|
309
460
|
* "@ui5/webcomponents/dist/features/InputSuggestions.js"
|
|
310
461
|
* to enable the suggestions functionality.
|
|
311
462
|
*
|
|
@@ -320,6 +471,8 @@ const metadata = {
|
|
|
320
471
|
* @alias sap.ui.webcomponents.main.Input
|
|
321
472
|
* @extends sap.ui.webcomponents.base.UI5Element
|
|
322
473
|
* @tagname ui5-input
|
|
474
|
+
* @appenddocs SuggestionItem SuggestionGroupItem
|
|
475
|
+
* @implements sap.ui.webcomponents.main.IInput
|
|
323
476
|
* @public
|
|
324
477
|
*/
|
|
325
478
|
class Input extends UI5Element {
|
|
@@ -344,7 +497,7 @@ class Input extends UI5Element {
|
|
|
344
497
|
}
|
|
345
498
|
|
|
346
499
|
static get staticAreaStyles() {
|
|
347
|
-
return ResponsivePopoverCommonCss;
|
|
500
|
+
return [ResponsivePopoverCommonCss, ValueStateMessageCss, SuggestionsCss];
|
|
348
501
|
}
|
|
349
502
|
|
|
350
503
|
constructor() {
|
|
@@ -352,22 +505,42 @@ class Input extends UI5Element {
|
|
|
352
505
|
// Indicates if there is selected suggestionItem.
|
|
353
506
|
this.hasSuggestionItemSelected = false;
|
|
354
507
|
|
|
355
|
-
// Represents the value before user moves selection
|
|
356
|
-
//
|
|
357
|
-
// 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.
|
|
358
512
|
this.valueBeforeItemSelection = "";
|
|
359
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
|
+
|
|
360
525
|
// tracks the value between focus in and focus out to detect that change event should be fired.
|
|
361
526
|
this.previousValue = undefined;
|
|
362
527
|
|
|
363
528
|
// Indicates, if the component is rendering for first time.
|
|
364
529
|
this.firstRendering = true;
|
|
365
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
|
+
|
|
366
540
|
// all sementic events
|
|
367
|
-
this.EVENT_SUBMIT = "submit";
|
|
368
541
|
this.EVENT_CHANGE = "change";
|
|
369
542
|
this.EVENT_INPUT = "input";
|
|
370
|
-
this.EVENT_SUGGESTION_ITEM_SELECT = "
|
|
543
|
+
this.EVENT_SUGGESTION_ITEM_SELECT = "suggestion-item-select";
|
|
371
544
|
|
|
372
545
|
// all user interactions
|
|
373
546
|
this.ACTION_ENTER = "enter";
|
|
@@ -376,16 +549,27 @@ class Input extends UI5Element {
|
|
|
376
549
|
// Suggestions array initialization
|
|
377
550
|
this.suggestionsTexts = [];
|
|
378
551
|
|
|
379
|
-
this.
|
|
552
|
+
this._handleResizeBound = this._handleResize.bind(this);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
onEnterDOM() {
|
|
556
|
+
ResizeHandler.register(this, this._handleResizeBound);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
onExitDOM() {
|
|
560
|
+
ResizeHandler.deregister(this, this._handleResizeBound);
|
|
380
561
|
}
|
|
381
562
|
|
|
382
563
|
onBeforeRendering() {
|
|
383
564
|
if (this.showSuggestions) {
|
|
384
565
|
this.enableSuggestions();
|
|
385
|
-
this.suggestionsTexts = this.Suggestions.defaultSlotProperties();
|
|
566
|
+
this.suggestionsTexts = this.Suggestions.defaultSlotProperties(this.highlightValue);
|
|
386
567
|
}
|
|
387
568
|
|
|
569
|
+
this.open = this.open && (!!this.suggestionItems.length || this._isPhone);
|
|
570
|
+
|
|
388
571
|
const FormSupport = getFeature("FormSupport");
|
|
572
|
+
|
|
389
573
|
if (FormSupport) {
|
|
390
574
|
FormSupport.syncNativeHiddenInput(this);
|
|
391
575
|
} else if (this.name) {
|
|
@@ -393,19 +577,20 @@ class Input extends UI5Element {
|
|
|
393
577
|
}
|
|
394
578
|
}
|
|
395
579
|
|
|
396
|
-
onAfterRendering() {
|
|
397
|
-
if (
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
580
|
+
async onAfterRendering() {
|
|
581
|
+
if (this.Suggestions) {
|
|
582
|
+
this.Suggestions.toggle(this.open, {
|
|
583
|
+
preventFocusRestore: true,
|
|
584
|
+
});
|
|
401
585
|
|
|
402
|
-
|
|
403
|
-
// Set initial focus to the native input
|
|
404
|
-
this.getInputDOMRef().focus();
|
|
405
|
-
}
|
|
586
|
+
this._listWidth = await this.Suggestions._getListWidth();
|
|
406
587
|
}
|
|
407
588
|
|
|
408
|
-
this.
|
|
589
|
+
if (this.shouldDisplayOnlyValueStateMessage) {
|
|
590
|
+
this.openPopover();
|
|
591
|
+
} else {
|
|
592
|
+
this.closePopover();
|
|
593
|
+
}
|
|
409
594
|
}
|
|
410
595
|
|
|
411
596
|
_onkeydown(event) {
|
|
@@ -421,26 +606,44 @@ class Input extends UI5Element {
|
|
|
421
606
|
return this._handleSpace(event);
|
|
422
607
|
}
|
|
423
608
|
|
|
609
|
+
if (isTabNext(event)) {
|
|
610
|
+
return this._handleTab(event);
|
|
611
|
+
}
|
|
612
|
+
|
|
424
613
|
if (isEnter(event)) {
|
|
425
614
|
return this._handleEnter(event);
|
|
426
615
|
}
|
|
427
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
|
+
|
|
428
630
|
this._keyDown = true;
|
|
429
631
|
}
|
|
430
632
|
|
|
431
633
|
_onkeyup(event) {
|
|
432
634
|
this._keyDown = false;
|
|
635
|
+
this._backspaceKeyDown = false;
|
|
433
636
|
}
|
|
434
637
|
|
|
435
638
|
/* Event handling */
|
|
436
639
|
_handleUp(event) {
|
|
437
|
-
if (this.Suggestions) {
|
|
640
|
+
if (this.Suggestions && this.Suggestions.isOpened()) {
|
|
438
641
|
this.Suggestions.onUp(event);
|
|
439
642
|
}
|
|
440
643
|
}
|
|
441
644
|
|
|
442
645
|
_handleDown(event) {
|
|
443
|
-
if (this.Suggestions) {
|
|
646
|
+
if (this.Suggestions && this.Suggestions.isOpened()) {
|
|
444
647
|
this.Suggestions.onDown(event);
|
|
445
648
|
}
|
|
446
649
|
}
|
|
@@ -451,41 +654,166 @@ class Input extends UI5Element {
|
|
|
451
654
|
}
|
|
452
655
|
}
|
|
453
656
|
|
|
657
|
+
_handleTab(event) {
|
|
658
|
+
if (this.Suggestions && (this.previousValue !== this.value)) {
|
|
659
|
+
this.Suggestions.onTab(event);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
454
663
|
_handleEnter(event) {
|
|
455
664
|
const itemPressed = !!(this.Suggestions && this.Suggestions.onEnter(event));
|
|
665
|
+
|
|
456
666
|
if (!itemPressed) {
|
|
457
667
|
this.fireEventByAction(this.ACTION_ENTER);
|
|
668
|
+
this.lastConfirmedValue = this.value;
|
|
669
|
+
return;
|
|
458
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;
|
|
459
700
|
}
|
|
460
701
|
|
|
461
|
-
_onfocusin(event) {
|
|
702
|
+
async _onfocusin(event) {
|
|
703
|
+
await this.getInputDOMRef();
|
|
704
|
+
|
|
462
705
|
this.focused = true; // invalidating property
|
|
463
706
|
this.previousValue = this.value;
|
|
707
|
+
this.valueBeforeItemPreview = this.value;
|
|
708
|
+
|
|
709
|
+
this._inputIconFocused = event.target && event.target === this.querySelector("[ui5-icon]");
|
|
464
710
|
}
|
|
465
711
|
|
|
466
712
|
_onfocusout(event) {
|
|
467
|
-
|
|
713
|
+
const focusedOutToSuggestions = this.Suggestions && event.relatedTarget && event.relatedTarget.shadowRoot && event.relatedTarget.shadowRoot.contains(this.Suggestions.responsivePopover);
|
|
714
|
+
const focusedOutToValueStateMessage = event.relatedTarget && event.relatedTarget.shadowRoot && event.relatedTarget.shadowRoot.querySelector(".ui5-valuestatemessage-root");
|
|
715
|
+
|
|
716
|
+
// if focusout is triggered by pressing on suggestion item or value state message popover, skip invalidation, because re-rendering
|
|
468
717
|
// will happen before "itemPress" event, which will make item "active" state not visualized
|
|
469
|
-
if (
|
|
718
|
+
if (focusedOutToSuggestions || focusedOutToValueStateMessage) {
|
|
719
|
+
event.stopImmediatePropagation();
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
const toBeFocused = event.relatedTarget;
|
|
724
|
+
|
|
725
|
+
if (toBeFocused && toBeFocused.classList.contains(this._id)) {
|
|
470
726
|
return;
|
|
471
727
|
}
|
|
472
728
|
|
|
729
|
+
this.closePopover();
|
|
730
|
+
this._clearPopoverFocusAndSelection();
|
|
731
|
+
|
|
473
732
|
this.previousValue = "";
|
|
733
|
+
this.lastConfirmedValue = "";
|
|
474
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();
|
|
475
748
|
}
|
|
476
749
|
|
|
477
750
|
_click(event) {
|
|
478
751
|
if (isPhone() && !this.readonly && this.Suggestions) {
|
|
479
|
-
this.
|
|
752
|
+
this.blur();
|
|
753
|
+
this.open = true;
|
|
480
754
|
}
|
|
481
755
|
}
|
|
482
756
|
|
|
483
757
|
_handleChange(event) {
|
|
484
|
-
|
|
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
|
+
});
|
|
485
772
|
}
|
|
486
773
|
|
|
487
|
-
_handleInput(event) {
|
|
488
|
-
|
|
774
|
+
async _handleInput(event) {
|
|
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
|
+
|
|
489
817
|
// stop the native event, as the semantic "input" would be fired.
|
|
490
818
|
event.stopImmediatePropagation();
|
|
491
819
|
}
|
|
@@ -494,86 +822,172 @@ class Input extends UI5Element {
|
|
|
494
822
|
- value of the host and the internal input should be differnt in case of actual input
|
|
495
823
|
- input is called when a key is pressed => keyup should not be called yet
|
|
496
824
|
*/
|
|
497
|
-
const skipFiring = (
|
|
825
|
+
const skipFiring = (inputDomRef.value === this.value) && isIE() && !this._keyDown && !!this.placeholder;
|
|
498
826
|
|
|
499
827
|
!skipFiring && this.fireEventByAction(this.ACTION_USER_INPUT);
|
|
500
828
|
|
|
501
829
|
this.hasSuggestionItemSelected = false;
|
|
830
|
+
this._isValueStateFocused = false;
|
|
502
831
|
|
|
503
832
|
if (this.Suggestions) {
|
|
504
833
|
this.Suggestions.updateSelectedItemPosition(null);
|
|
834
|
+
|
|
835
|
+
if (!this._isPhone) {
|
|
836
|
+
this.open = !!inputDomRef.value;
|
|
837
|
+
}
|
|
505
838
|
}
|
|
506
839
|
}
|
|
507
840
|
|
|
508
|
-
|
|
509
|
-
this.
|
|
841
|
+
_handleResize() {
|
|
842
|
+
this._inputWidth = this.offsetWidth;
|
|
510
843
|
}
|
|
511
844
|
|
|
512
|
-
|
|
845
|
+
_closeRespPopover(preventFocusRestore) {
|
|
846
|
+
this.Suggestions.close(preventFocusRestore);
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
async _afterOpenPopover() {
|
|
513
850
|
// Set initial focus to the native input
|
|
514
851
|
if (isPhone()) {
|
|
515
|
-
this.getInputDOMRef().focus();
|
|
852
|
+
(await this.getInputDOMRef()).focus();
|
|
516
853
|
}
|
|
517
854
|
}
|
|
518
855
|
|
|
519
856
|
_afterClosePopover() {
|
|
857
|
+
this.announceSelectedItem();
|
|
858
|
+
|
|
520
859
|
// close device's keyboard and prevent further typing
|
|
521
860
|
if (isPhone()) {
|
|
522
861
|
this.blur();
|
|
862
|
+
this.focused = false;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* Checks if the value state popover is open.
|
|
868
|
+
* @returns {boolean} true if the value state popover is open, false otherwise
|
|
869
|
+
*/
|
|
870
|
+
isValueStateOpened() {
|
|
871
|
+
return !!this._isPopoverOpen;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
async openPopover() {
|
|
875
|
+
const popover = await this._getPopover();
|
|
876
|
+
|
|
877
|
+
if (popover) {
|
|
878
|
+
this._isPopoverOpen = true;
|
|
879
|
+
popover.showAt(this);
|
|
523
880
|
}
|
|
524
881
|
}
|
|
525
882
|
|
|
883
|
+
async closePopover() {
|
|
884
|
+
const popover = await this._getPopover();
|
|
885
|
+
|
|
886
|
+
popover && popover.close();
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
async _getPopover() {
|
|
890
|
+
const staticAreaItem = await this.getStaticAreaItemDomRef();
|
|
891
|
+
return staticAreaItem && staticAreaItem.querySelector("[ui5-popover]");
|
|
892
|
+
}
|
|
893
|
+
|
|
526
894
|
enableSuggestions() {
|
|
527
895
|
if (this.Suggestions) {
|
|
528
896
|
return;
|
|
529
897
|
}
|
|
530
898
|
|
|
531
899
|
const Suggestions = getFeature("InputSuggestions");
|
|
900
|
+
|
|
532
901
|
if (Suggestions) {
|
|
533
|
-
this.Suggestions = new Suggestions(this, "suggestionItems");
|
|
902
|
+
this.Suggestions = new Suggestions(this, "suggestionItems", true);
|
|
534
903
|
} else {
|
|
535
904
|
throw new Error(`You have to import "@ui5/webcomponents/dist/features/InputSuggestions.js" module to use ui5-input suggestions`);
|
|
536
905
|
}
|
|
537
906
|
}
|
|
538
907
|
|
|
539
|
-
shouldOpenSuggestions() {
|
|
540
|
-
return !!(this.suggestionItems.length
|
|
541
|
-
&& this.focused
|
|
542
|
-
&& this.showSuggestions
|
|
543
|
-
&& !this.hasSuggestionItemSelected);
|
|
544
|
-
}
|
|
545
|
-
|
|
546
908
|
selectSuggestion(item, keyboardUsed) {
|
|
547
|
-
|
|
909
|
+
if (item.group) {
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
const itemText = item.text || item.textContent; // keep textContent for compatibility
|
|
548
914
|
const fireInput = keyboardUsed
|
|
549
915
|
? this.valueBeforeItemSelection !== itemText : this.value !== itemText;
|
|
550
916
|
|
|
551
917
|
this.hasSuggestionItemSelected = true;
|
|
552
|
-
this.fireEvent(this.EVENT_SUGGESTION_ITEM_SELECT, { item });
|
|
553
918
|
|
|
554
919
|
if (fireInput) {
|
|
555
920
|
this.value = itemText;
|
|
556
921
|
this.valueBeforeItemSelection = itemText;
|
|
922
|
+
this.lastConfirmedValue = itemText;
|
|
557
923
|
this.fireEvent(this.EVENT_INPUT);
|
|
558
924
|
this.fireEvent(this.EVENT_CHANGE);
|
|
925
|
+
|
|
926
|
+
// Mark the change event to avoid double firing
|
|
927
|
+
this._changeFired = true;
|
|
559
928
|
}
|
|
929
|
+
|
|
930
|
+
this.valueBeforeItemPreview = "";
|
|
931
|
+
this.suggestionSelectionCanceled = false;
|
|
932
|
+
|
|
933
|
+
this.fireEvent(this.EVENT_SUGGESTION_ITEM_SELECT, { item });
|
|
560
934
|
}
|
|
561
935
|
|
|
562
936
|
previewSuggestion(item) {
|
|
563
937
|
this.valueBeforeItemSelection = this.value;
|
|
564
|
-
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);
|
|
565
965
|
}
|
|
566
966
|
|
|
567
|
-
fireEventByAction(action) {
|
|
967
|
+
async fireEventByAction(action) {
|
|
968
|
+
await this.getInputDOMRef();
|
|
969
|
+
|
|
568
970
|
if (this.disabled || this.readonly) {
|
|
569
971
|
return;
|
|
570
972
|
}
|
|
571
973
|
|
|
572
|
-
const inputValue = this.getInputValue();
|
|
573
|
-
const isSubmit = action === this.ACTION_ENTER;
|
|
974
|
+
const inputValue = await this.getInputValue();
|
|
574
975
|
const isUserInput = action === this.ACTION_USER_INPUT;
|
|
575
976
|
|
|
977
|
+
const input = await this.getInputDOMRef();
|
|
978
|
+
const cursorPosition = input.selectionStart;
|
|
979
|
+
|
|
576
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
|
+
}
|
|
577
991
|
|
|
578
992
|
if (isUserInput) { // input
|
|
579
993
|
this.fireEvent(this.EVENT_INPUT);
|
|
@@ -582,44 +996,66 @@ class Input extends UI5Element {
|
|
|
582
996
|
return;
|
|
583
997
|
}
|
|
584
998
|
|
|
585
|
-
if (isSubmit) { // submit
|
|
586
|
-
this.fireEvent(this.EVENT_SUBMIT);
|
|
587
|
-
}
|
|
588
|
-
|
|
589
999
|
// In IE, pressing the ENTER does not fire change
|
|
590
1000
|
const valueChanged = (this.previousValue !== undefined) && (this.previousValue !== this.value);
|
|
591
|
-
if (isIE() &&
|
|
1001
|
+
if (isIE() && action === this.ACTION_ENTER && valueChanged) {
|
|
592
1002
|
this.fireEvent(this.EVENT_CHANGE);
|
|
593
1003
|
}
|
|
594
1004
|
}
|
|
595
1005
|
|
|
1006
|
+
async getInputValue() {
|
|
1007
|
+
const domRef = this.getDomRef();
|
|
596
1008
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
if (inputDOM) {
|
|
600
|
-
return this.getInputDOMRef().value;
|
|
1009
|
+
if (domRef) {
|
|
1010
|
+
return (await this.getInputDOMRef()).value;
|
|
601
1011
|
}
|
|
602
1012
|
return "";
|
|
603
1013
|
}
|
|
604
1014
|
|
|
605
|
-
getInputDOMRef() {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
inputDomRef = this.getStaticAreaItemDomRef().querySelector(".ui5-input-inner-phone");
|
|
1015
|
+
async getInputDOMRef() {
|
|
1016
|
+
if (isPhone() && this.Suggestions) {
|
|
1017
|
+
await this.Suggestions._getSuggestionPopover();
|
|
1018
|
+
return this.Suggestions && this.Suggestions.responsivePopover.querySelector(".ui5-input-inner-phone");
|
|
610
1019
|
}
|
|
611
1020
|
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
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
|
+
}
|
|
615
1031
|
|
|
616
|
-
|
|
1032
|
+
get nativeInputWidth() {
|
|
1033
|
+
return this.nativeInput && this.nativeInput.offsetWidth;
|
|
617
1034
|
}
|
|
618
1035
|
|
|
619
1036
|
getLabelableElementId() {
|
|
620
1037
|
return this.getInputId();
|
|
621
1038
|
}
|
|
622
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
|
+
|
|
623
1059
|
getInputId() {
|
|
624
1060
|
return `${this._id}-inner`;
|
|
625
1061
|
}
|
|
@@ -627,12 +1063,34 @@ class Input extends UI5Element {
|
|
|
627
1063
|
/* Suggestions interface */
|
|
628
1064
|
onItemFocused() {}
|
|
629
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
|
+
|
|
630
1084
|
onItemSelected(item, keyboardUsed) {
|
|
631
1085
|
this.selectSuggestion(item, keyboardUsed);
|
|
632
1086
|
}
|
|
633
1087
|
|
|
634
1088
|
onItemPreviewed(item) {
|
|
635
1089
|
this.previewSuggestion(item);
|
|
1090
|
+
this.fireEvent("suggestion-item-preview", {
|
|
1091
|
+
item: this.getSuggestionByListItem(item),
|
|
1092
|
+
targetRef: item,
|
|
1093
|
+
});
|
|
636
1094
|
}
|
|
637
1095
|
|
|
638
1096
|
onOpen() {}
|
|
@@ -640,27 +1098,40 @@ class Input extends UI5Element {
|
|
|
640
1098
|
onClose() {}
|
|
641
1099
|
|
|
642
1100
|
valueStateTextMappings() {
|
|
643
|
-
const i18nBundle = this.i18nBundle;
|
|
644
|
-
|
|
645
1101
|
return {
|
|
646
|
-
"Success": i18nBundle.getText(VALUE_STATE_SUCCESS),
|
|
647
|
-
"
|
|
648
|
-
"
|
|
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),
|
|
649
1106
|
};
|
|
650
1107
|
}
|
|
651
1108
|
|
|
1109
|
+
announceSelectedItem() {
|
|
1110
|
+
const invisibleText = this.shadowRoot.querySelector(`#${this._id}-selectionText`);
|
|
1111
|
+
|
|
1112
|
+
if (this.Suggestions && this.Suggestions._isItemOnTarget()) {
|
|
1113
|
+
invisibleText.textContent = this.itemSelectionAnnounce;
|
|
1114
|
+
} else {
|
|
1115
|
+
invisibleText.textContent = "";
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
|
|
652
1119
|
get _readonly() {
|
|
653
1120
|
return this.readonly && !this.disabled;
|
|
654
1121
|
}
|
|
655
1122
|
|
|
656
1123
|
get _headerTitleText() {
|
|
657
|
-
return
|
|
1124
|
+
return Input.i18nBundle.getText(INPUT_SUGGESTIONS_TITLE);
|
|
658
1125
|
}
|
|
659
1126
|
|
|
660
1127
|
get inputType() {
|
|
661
1128
|
return this.type.toLowerCase();
|
|
662
1129
|
}
|
|
663
1130
|
|
|
1131
|
+
get isTypeNumber() {
|
|
1132
|
+
return this.type === InputType.Number;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
664
1135
|
get suggestionsTextId() {
|
|
665
1136
|
return this.showSuggestions ? `${this._id}-suggestionsText` : "";
|
|
666
1137
|
}
|
|
@@ -672,38 +1143,236 @@ class Input extends UI5Element {
|
|
|
672
1143
|
get accInfo() {
|
|
673
1144
|
const ariaHasPopupDefault = this.showSuggestions ? "true" : undefined;
|
|
674
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
|
+
|
|
675
1148
|
return {
|
|
676
|
-
"wrapper": {
|
|
677
|
-
},
|
|
678
1149
|
"input": {
|
|
679
|
-
"
|
|
1150
|
+
"ariaRoledescription": this._inputAccInfo && (this._inputAccInfo.ariaRoledescription || undefined),
|
|
1151
|
+
"ariaDescribedBy": ariaDescribedBy || undefined,
|
|
680
1152
|
"ariaInvalid": this.valueState === ValueState.Error ? "true" : undefined,
|
|
681
1153
|
"ariaHasPopup": this._inputAccInfo.ariaHasPopup ? this._inputAccInfo.ariaHasPopup : ariaHasPopupDefault,
|
|
682
1154
|
"ariaAutoComplete": this._inputAccInfo.ariaAutoComplete ? this._inputAccInfo.ariaAutoComplete : ariaAutoCompleteDefault,
|
|
683
1155
|
"role": this._inputAccInfo && this._inputAccInfo.role,
|
|
684
|
-
"
|
|
1156
|
+
"ariaControls": this._inputAccInfo && this._inputAccInfo.ariaControls,
|
|
685
1157
|
"ariaExpanded": this._inputAccInfo && this._inputAccInfo.ariaExpanded,
|
|
686
1158
|
"ariaDescription": this._inputAccInfo && this._inputAccInfo.ariaDescription,
|
|
1159
|
+
"ariaLabel": (this._inputAccInfo && this._inputAccInfo.ariaLabel) || getEffectiveAriaLabelText(this),
|
|
687
1160
|
},
|
|
688
1161
|
};
|
|
689
1162
|
}
|
|
690
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
|
+
|
|
1184
|
+
get itemSelectionAnnounce() {
|
|
1185
|
+
return this.Suggestions ? this.Suggestions.itemSelectionAnnounce : undefined;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
get classes() {
|
|
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
|
+
},
|
|
1194
|
+
popoverValueState: {
|
|
1195
|
+
"ui5-valuestatemessage-root": true,
|
|
1196
|
+
"ui5-valuestatemessage-header": true,
|
|
1197
|
+
"ui5-valuestatemessage--success": this.valueState === ValueState.Success,
|
|
1198
|
+
"ui5-valuestatemessage--error": this.valueState === ValueState.Error,
|
|
1199
|
+
"ui5-valuestatemessage--warning": this.valueState === ValueState.Warning,
|
|
1200
|
+
"ui5-valuestatemessage--information": this.valueState === ValueState.Information,
|
|
1201
|
+
},
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
get styles() {
|
|
1206
|
+
const remSizeIxPx = parseInt(getComputedStyle(document.documentElement).fontSize);
|
|
1207
|
+
|
|
1208
|
+
const stylesObject = {
|
|
1209
|
+
popoverHeader: {
|
|
1210
|
+
"max-width": `${this._inputWidth}px`,
|
|
1211
|
+
},
|
|
1212
|
+
suggestionPopoverHeader: {
|
|
1213
|
+
"display": this._listWidth === 0 ? "none" : "inline-block",
|
|
1214
|
+
"width": `${this._listWidth}px`,
|
|
1215
|
+
},
|
|
1216
|
+
suggestionsPopover: {
|
|
1217
|
+
"min-width": `${this._inputWidth}px`,
|
|
1218
|
+
"max-width": (this._inputWidth / remSizeIxPx) > 40 ? `${this._inputWidth}px` : "40rem",
|
|
1219
|
+
},
|
|
1220
|
+
innerInput: {},
|
|
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";
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
get valueStateMessageText() {
|
|
1235
|
+
return this.getSlottedNodes("valueStateMessage").map(el => el.cloneNode(true));
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
get shouldDisplayOnlyValueStateMessage() {
|
|
1239
|
+
return this.hasValueStateMessage && !this.open && this.focused;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
get shouldDisplayDefaultValueStateMessage() {
|
|
1243
|
+
return !this.valueStateMessage.length && this.hasValueStateMessage;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
691
1246
|
get hasValueState() {
|
|
692
1247
|
return this.valueState !== ValueState.None;
|
|
693
1248
|
}
|
|
694
1249
|
|
|
1250
|
+
get hasValueStateMessage() {
|
|
1251
|
+
return this.hasValueState && this.valueState !== ValueState.Success
|
|
1252
|
+
&& (!this._inputIconFocused // Handles the cases when valueStateMessage is forwarded (from datepicker e.g.)
|
|
1253
|
+
|| (this._isPhone && this.Suggestions)); // Handles Input with suggestions on mobile
|
|
1254
|
+
}
|
|
1255
|
+
|
|
695
1256
|
get valueStateText() {
|
|
696
1257
|
return this.valueStateTextMappings()[this.valueState];
|
|
697
1258
|
}
|
|
698
1259
|
|
|
699
1260
|
get suggestionsText() {
|
|
700
|
-
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;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
get step() {
|
|
1282
|
+
return this.isTypeNumber ? "any" : undefined;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
get _isPhone() {
|
|
1286
|
+
return isPhone();
|
|
1287
|
+
}
|
|
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 : "";
|
|
701
1315
|
}
|
|
702
1316
|
|
|
703
|
-
|
|
704
|
-
|
|
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
|
+
|
|
1369
|
+
static async onDefine() {
|
|
1370
|
+
const Suggestions = getFeature("InputSuggestions");
|
|
705
1371
|
|
|
706
|
-
|
|
1372
|
+
[Input.i18nBundle] = await Promise.all([
|
|
1373
|
+
getI18nBundle("@ui5/webcomponents"),
|
|
1374
|
+
Suggestions ? Suggestions.init() : Promise.resolve(),
|
|
1375
|
+
]);
|
|
707
1376
|
}
|
|
708
1377
|
}
|
|
709
1378
|
|