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