@ui5/webcomponents 2.20.0 → 2.21.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/Button.d.ts +6 -0
- package/dist/Button.js +11 -2
- package/dist/Button.js.map +1 -1
- package/dist/Carousel.d.ts +14 -13
- package/dist/Carousel.js +93 -177
- package/dist/Carousel.js.map +1 -1
- package/dist/CarouselTemplate.js +2 -2
- package/dist/CarouselTemplate.js.map +1 -1
- package/dist/ColorPaletteTemplate.js +1 -1
- package/dist/ColorPaletteTemplate.js.map +1 -1
- package/dist/DatePicker.js +2 -2
- package/dist/DatePicker.js.map +1 -1
- package/dist/DayPickerTemplate.js +1 -1
- package/dist/DayPickerTemplate.js.map +1 -1
- package/dist/Dialog.d.ts +0 -3
- package/dist/Dialog.js +3 -1
- package/dist/Dialog.js.map +1 -1
- package/dist/Icon.d.ts +1 -1
- package/dist/Icon.js +12 -4
- package/dist/Icon.js.map +1 -1
- package/dist/IconTemplate.js +1 -1
- package/dist/IconTemplate.js.map +1 -1
- package/dist/Input.d.ts +2 -1
- package/dist/Input.js +38 -16
- package/dist/Input.js.map +1 -1
- package/dist/Menu.js +6 -1
- package/dist/Menu.js.map +1 -1
- package/dist/MenuItem.d.ts +8 -0
- package/dist/MenuItem.js +29 -1
- package/dist/MenuItem.js.map +1 -1
- package/dist/MenuItemTemplate.js +2 -2
- package/dist/MenuItemTemplate.js.map +1 -1
- package/dist/MultiComboBox.js +5 -0
- package/dist/MultiComboBox.js.map +1 -1
- package/dist/MultiInput.js +4 -5
- package/dist/MultiInput.js.map +1 -1
- package/dist/StepInput.d.ts +5 -0
- package/dist/StepInput.js +26 -5
- package/dist/StepInput.js.map +1 -1
- package/dist/Switch.d.ts +8 -4
- package/dist/Switch.js +15 -11
- package/dist/Switch.js.map +1 -1
- package/dist/SwitchTemplate.js +1 -1
- package/dist/SwitchTemplate.js.map +1 -1
- package/dist/TimePicker.d.ts +55 -3
- package/dist/TimePicker.js +160 -26
- package/dist/TimePicker.js.map +1 -1
- package/dist/TimePickerTemplate.js +1 -1
- package/dist/TimePickerTemplate.js.map +1 -1
- package/dist/TimeSelectionClocks.js +8 -0
- package/dist/TimeSelectionClocks.js.map +1 -1
- package/dist/Token.js +2 -2
- package/dist/Token.js.map +1 -1
- package/dist/Tokenizer.js +2 -1
- package/dist/Tokenizer.js.map +1 -1
- package/dist/css/themes/Breadcrumbs.css +1 -1
- package/dist/css/themes/ColorPaletteItem.css +1 -1
- package/dist/css/themes/DatePickerPopover.css +1 -1
- package/dist/css/themes/MenuItem.css +1 -1
- package/dist/css/themes/PopupsCommon.css +1 -1
- package/dist/css/themes/sap_fiori_3/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcw/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +1 -1
- package/dist/custom-elements-internal.json +69 -6
- package/dist/custom-elements.json +66 -6
- package/dist/features/InputSuggestions.js +2 -1
- package/dist/features/InputSuggestions.js.map +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +7 -2
- package/dist/generated/i18n/i18n-defaults.js +7 -2
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/themes/Breadcrumbs.css.d.ts +1 -1
- package/dist/generated/themes/Breadcrumbs.css.js +1 -1
- package/dist/generated/themes/Breadcrumbs.css.js.map +1 -1
- package/dist/generated/themes/ColorPaletteItem.css.d.ts +1 -1
- package/dist/generated/themes/ColorPaletteItem.css.js +1 -1
- package/dist/generated/themes/ColorPaletteItem.css.js.map +1 -1
- package/dist/generated/themes/DatePickerPopover.css.d.ts +1 -1
- package/dist/generated/themes/DatePickerPopover.css.js +1 -1
- package/dist/generated/themes/DatePickerPopover.css.js.map +1 -1
- package/dist/generated/themes/MenuItem.css.d.ts +1 -1
- package/dist/generated/themes/MenuItem.css.js +1 -1
- package/dist/generated/themes/MenuItem.css.js.map +1 -1
- package/dist/generated/themes/PopupsCommon.css.d.ts +1 -1
- package/dist/generated/themes/PopupsCommon.css.js +1 -1
- package/dist/generated/themes/PopupsCommon.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/vscode.html-custom-data.json +13 -3
- package/dist/web-types.json +28 -8
- package/package.json +9 -9
- package/src/CarouselTemplate.tsx +3 -3
- package/src/ColorPaletteTemplate.tsx +2 -2
- package/src/DayPickerTemplate.tsx +1 -1
- package/src/IconTemplate.tsx +1 -0
- package/src/MenuItemTemplate.tsx +11 -1
- package/src/SwitchTemplate.tsx +2 -2
- package/src/TimePickerTemplate.tsx +1 -1
- package/src/i18n/messagebundle.properties +17 -2
- package/src/i18n/messagebundle_en_US_saprigi.properties +2 -0
- package/src/themes/Breadcrumbs.css +6 -2
- package/src/themes/ColorPaletteItem.css +14 -0
- package/src/themes/DatePickerPopover.css +5 -0
- package/src/themes/MenuItem.css +5 -0
- package/src/themes/PopupsCommon.css +7 -0
- package/src/themes/base/Bar-parameters.css +1 -0
- package/src/themes/base/Breadcrumbs-parameters.css +4 -0
- package/src/themes/sap_fiori_3/parameters-bundle.css +2 -1
- package/src/themes/sap_fiori_3_dark/parameters-bundle.css +2 -1
- package/src/themes/sap_fiori_3_hcb/parameters-bundle.css +2 -1
- package/src/themes/sap_fiori_3_hcw/parameters-bundle.css +2 -1
- package/src/themes/sap_horizon/Breadcrumbs-parameters.css +5 -1
- package/src/themes/sap_horizon/CalendarHeader-parameters.css +3 -3
- package/src/themes/sap_horizon/DayPicker-parameters.css +3 -3
- package/src/themes/sap_horizon_dark/Breadcrumbs-parameters.css +5 -1
- package/src/themes/sap_horizon_dark/CalendarHeader-parameters.css +2 -2
- package/src/themes/sap_horizon_hcb/Breadcrumbs-parameters.css +6 -0
- package/src/themes/sap_horizon_hcb/parameters-bundle.css +2 -1
- package/src/themes/sap_horizon_hcw/Breadcrumbs-parameters.css +6 -0
- package/src/themes/sap_horizon_hcw/parameters-bundle.css +2 -1
|
@@ -7840,11 +7840,11 @@
|
|
|
7840
7840
|
},
|
|
7841
7841
|
{
|
|
7842
7842
|
"name": "footer",
|
|
7843
|
-
"description": "Defines the footer HTML Element
|
|
7843
|
+
"description": "Defines the footer HTML Element."
|
|
7844
7844
|
},
|
|
7845
7845
|
{
|
|
7846
7846
|
"name": "header",
|
|
7847
|
-
"description": "Defines the header HTML Element.\n\n**Note:**
|
|
7847
|
+
"description": "Defines the header HTML Element.\n\n**Note:** If `header` slot is provided, the labelling of the dialog is a responsibility of the application developer.\n`accessibleName` should be used."
|
|
7848
7848
|
}
|
|
7849
7849
|
],
|
|
7850
7850
|
"members": [
|
|
@@ -9477,7 +9477,7 @@
|
|
|
9477
9477
|
"declarations": [
|
|
9478
9478
|
{
|
|
9479
9479
|
"kind": "class",
|
|
9480
|
-
"description": "### Overview\n\nThe `ui5-icon` component represents an SVG icon.\nThere are two main scenarios how the `ui5-icon` component is used:\nas a purely decorative element,\nor as an interactive element that can be focused and clicked.\n\n### Usage\n\n1. **Get familiar with the icons collections.**\n\nBefore displaying an icon, you need to explore the icons collections to find and import the desired icon.\n\nCurrently there are 3 icons collection, available as 3 npm packages:\n\n- [@ui5/webcomponents-icons](https://www.npmjs.com/package/@ui5/webcomponents-icons) represents the \"SAP-icons\" collection and includes the following\n[icons](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons).\n- [@ui5/webcomponents-icons-tnt](https://www.npmjs.com/package/@ui5/webcomponents-icons-tnt) represents the \"tnt\" collection and includes the following\n[icons](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons-TNT).\n- [@ui5/webcomponents-icons-business-suite](https://www.npmjs.com/package/@ui5/webcomponents-icons-business-suite) represents the \"business-suite\" collection and includes the following\n[icons](https://ui5.sap.com/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/BusinessSuiteInAppSymbols).\n\n2. **After exploring the icons collections, add one or more of the packages as dependencies to your project.**\n\n`npm i @ui5/webcomponents-icons`\n`npm i @ui5/webcomponents-icons-tnt`\n`npm i @ui5/webcomponents-icons-business-suite`\n\n3. **Then, import the desired icon**.\n\n`import \"@ui5/\\{package_name\\}/dist/\\{icon_name\\}.js\";`\n\n**For Example**:\n\nFor the standard \"SAP-icons\" icon collection, import an icon from the `@ui5/webcomponents-icons` package:\n\n`import \"@ui5/webcomponents-icons/dist/employee.js\";`\n\nFor the \"tnt\" (SAP Fiori Tools) icon collection, import an icon from the `@ui5/webcomponents-icons-tnt` package:\n\n`import \"@ui5/webcomponents-icons-tnt/dist/antenna.js\";`\n\nFor the \"business-suite\" (SAP Business Suite) icon collection, import an icon from the `@ui5/webcomponents-icons-business-suite` package:\n\n`import \"@ui5/webcomponents-icons-business-suite/dist/ab-testing.js\";`\n\n4. **Display the icon using the `ui5-icon` web component.**\nSet the icon collection (\"SAP-icons\", \"tnt\" or \"business-suite\" - \"SAP-icons\" is the default icon collection and can be skipped)\nand the icon name to the `name` property.\n\n`<ui5-icon name=\"employee\"></ui5-icon>`\n`<ui5-icon name=\"tnt/antenna\"></ui5-icon>`\n`<ui5-icon name=\"business-suite/ab-testing\"></ui5-icon>`\n\n### Keyboard Handling\n\n- [Space] / [Enter] or [Return] - Fires the `click` event if the `mode` property is set to `Interactive`.\n
|
|
9480
|
+
"description": "### Overview\n\nThe `ui5-icon` component represents an SVG icon.\nThere are two main scenarios how the `ui5-icon` component is used:\nas a purely decorative element,\nor as an interactive element that can be focused and clicked.\n\n### Usage\n\n1. **Get familiar with the icons collections.**\n\nBefore displaying an icon, you need to explore the icons collections to find and import the desired icon.\n\nCurrently there are 3 icons collection, available as 3 npm packages:\n\n- [@ui5/webcomponents-icons](https://www.npmjs.com/package/@ui5/webcomponents-icons) represents the \"SAP-icons\" collection and includes the following\n[icons](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons).\n- [@ui5/webcomponents-icons-tnt](https://www.npmjs.com/package/@ui5/webcomponents-icons-tnt) represents the \"tnt\" collection and includes the following\n[icons](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons-TNT).\n- [@ui5/webcomponents-icons-business-suite](https://www.npmjs.com/package/@ui5/webcomponents-icons-business-suite) represents the \"business-suite\" collection and includes the following\n[icons](https://ui5.sap.com/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/BusinessSuiteInAppSymbols).\n\n2. **After exploring the icons collections, add one or more of the packages as dependencies to your project.**\n\n`npm i @ui5/webcomponents-icons`\n`npm i @ui5/webcomponents-icons-tnt`\n`npm i @ui5/webcomponents-icons-business-suite`\n\n3. **Then, import the desired icon**.\n\n`import \"@ui5/\\{package_name\\}/dist/\\{icon_name\\}.js\";`\n\n**For Example**:\n\nFor the standard \"SAP-icons\" icon collection, import an icon from the `@ui5/webcomponents-icons` package:\n\n`import \"@ui5/webcomponents-icons/dist/employee.js\";`\n\nFor the \"tnt\" (SAP Fiori Tools) icon collection, import an icon from the `@ui5/webcomponents-icons-tnt` package:\n\n`import \"@ui5/webcomponents-icons-tnt/dist/antenna.js\";`\n\nFor the \"business-suite\" (SAP Business Suite) icon collection, import an icon from the `@ui5/webcomponents-icons-business-suite` package:\n\n`import \"@ui5/webcomponents-icons-business-suite/dist/ab-testing.js\";`\n\n4. **Display the icon using the `ui5-icon` web component.**\nSet the icon collection (\"SAP-icons\", \"tnt\" or \"business-suite\" - \"SAP-icons\" is the default icon collection and can be skipped)\nand the icon name to the `name` property.\n\n`<ui5-icon name=\"employee\"></ui5-icon>`\n`<ui5-icon name=\"tnt/antenna\"></ui5-icon>`\n`<ui5-icon name=\"business-suite/ab-testing\"></ui5-icon>`\n\n### Keyboard Handling\n\n- [Space] / [Enter] or [Return] - Fires the `click` event if the `mode` property is set to `Interactive`.\n\n### ES6 Module Import\n\n`import \"@ui5/webcomponents/dist/Icon.js\";`",
|
|
9481
9481
|
"name": "Icon",
|
|
9482
9482
|
"cssParts": [
|
|
9483
9483
|
{
|
|
@@ -9557,7 +9557,7 @@
|
|
|
9557
9557
|
"type": {
|
|
9558
9558
|
"text": "CustomEvent"
|
|
9559
9559
|
},
|
|
9560
|
-
"description": "Fired
|
|
9560
|
+
"description": "Fired when the component is activated by mouse/touch, keyboard (Enter or Space),\nor screen reader virtual cursor activation.\n\n**Note:** The event will not be fired if the `mode` property is set to `Decorative` or `Image`."
|
|
9561
9561
|
}
|
|
9562
9562
|
],
|
|
9563
9563
|
"attributes": [
|
|
@@ -23833,7 +23833,7 @@
|
|
|
23833
23833
|
"declarations": [
|
|
23834
23834
|
{
|
|
23835
23835
|
"kind": "class",
|
|
23836
|
-
"description": "### Overview\nThe `ui5-time-picker` component provides an input field with assigned clocks which are opened on user action.\nThe `ui5-time-picker` allows users to select a localized time using touch, mouse, or keyboard input.\nIt consists of two parts: the time input field and the clocks.\n\n### Usage\nThe user can enter a time by:\n\n- Using the clocks that are displayed in a popup\n- Typing it in directly in the input field\n\nWhen the user makes an entry and chooses the enter key, the clocks show the corresponding time (hours, minutes and seconds separately).\nWhen the user directly triggers the clocks display, the actual time is displayed.\nFor the `ui5-time-picker`\n\n### Formatting\n\nIf a time is entered by typing it into\nthe input field, it must fit to the used time format.\n\nSupported format options are pattern-based on Unicode LDML Date Format notation.\nFor more information, see [UTS #35: Unicode Locale Data Markup Language](https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\n\nFor example, if the
|
|
23836
|
+
"description": "### Overview\nThe `ui5-time-picker` component provides an input field with assigned clocks which are opened on user action.\nThe `ui5-time-picker` allows users to select a localized time using touch, mouse, or keyboard input.\nIt consists of two parts: the time input field and the clocks.\n\n### Usage\nThe user can enter a time by:\n\n- Using the clocks that are displayed in a popup\n- Typing it in directly in the input field\n\nWhen the user makes an entry and chooses the enter key, the clocks show the corresponding time (hours, minutes and seconds separately).\nWhen the user directly triggers the clocks display, the actual time is displayed.\nFor the `ui5-time-picker`\n\n### Formatting\n\nIf a time is entered by typing it into\nthe input field, it must fit to the used time format.\n\nSupported format options are pattern-based on Unicode LDML Date Format notation.\nFor more information, see [UTS #35: Unicode Locale Data Markup Language](https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\n\nFor example, if the valueFormat is \"HH:mm:ss\", the displayFormat is \"hh:mm: ss a\", and the used locale is English, a valid value string is \"11:42:35\", which leads to an output of \"11:42:35 AM\".\nIf no placeholder is set to the TimePicker, the used displayFormat is displayed as a placeholder. If another placeholder is needed, it must be set.\n\n### Keyboard handling\n[F4], [Alt]+[Up], [Alt]+[Down] Open/Close picker dialog and move focus to it.\n\nWhen closed:\n\n- [Page Up] - Increments hours by 1. If 12 am is reached, increment hours to 1 pm and vice versa.\n- [Page Down] - Decrements the corresponding field by 1. If 1 pm is reached, decrement hours to 12 am and vice versa.\n- [Shift]+[Page Up] - Increments minutes by 1.\n- [Shift]+[Page Down] - Decrements minutes by 1.\n- [Shift]+[Ctrl]+[Page Up] - Increments seconds by 1.\n- [Shift]+[Ctrl]+[Page Down] - Decrements seconds by 1.\n-\n\nWhen opened:\n\n- [Page Up] - Increments hours by 1. If 12 am is reached, increment hours to 1 pm and vice versa.\n- [Page Down] - Decrements the corresponding field by 1. If 1 pm is reached, decrement hours to 12 am and vice versa.\n- [Shift]+[Page Up] - Increments minutes by 1.\n- [Shift]+[Page Down] - Decrements minutes by 1.\n- [Shift]+[Ctrl]+[Page Up] - Increments seconds by 1.\n- [Shift]+[Ctrl]+[Page Down] - Decrements seconds by 1.\n- [A] or [P] - Selects AM or PM respectively.\n- [0]-[9] - Allows direct time selecting (hours/minutes/seconds).\n- [:] - Allows switching between hours/minutes/seconds clocks. If the last clock is displayed and [:] is pressed, the first clock is beind displayed.\n\n### ES6 Module Import\n\n`import \"@ui5/webcomponents/dist/TimePicker.js\";`",
|
|
23837
23837
|
"name": "TimePicker",
|
|
23838
23838
|
"cssParts": [
|
|
23839
23839
|
{
|
|
@@ -23909,6 +23909,16 @@
|
|
|
23909
23909
|
"description": "Defines the disabled state of the comonent.",
|
|
23910
23910
|
"privacy": "public"
|
|
23911
23911
|
},
|
|
23912
|
+
{
|
|
23913
|
+
"kind": "field",
|
|
23914
|
+
"name": "displayFormat",
|
|
23915
|
+
"type": {
|
|
23916
|
+
"text": "string | undefined"
|
|
23917
|
+
},
|
|
23918
|
+
"description": "Determines the format, displayed in the input field.",
|
|
23919
|
+
"default": "undefined",
|
|
23920
|
+
"privacy": "public"
|
|
23921
|
+
},
|
|
23912
23922
|
{
|
|
23913
23923
|
"kind": "field",
|
|
23914
23924
|
"name": "formatPattern",
|
|
@@ -23917,6 +23927,7 @@
|
|
|
23917
23927
|
},
|
|
23918
23928
|
"description": "Determines the format, displayed in the input field.\n\nExample:\nHH:mm:ss -> 11:42:35\nhh:mm:ss a -> 2:23:15 PM\nmm:ss -> 12:04 (only minutes and seconds)",
|
|
23919
23929
|
"default": "undefined",
|
|
23930
|
+
"deprecated": "Use displayFormat and valueFormat instead",
|
|
23920
23931
|
"privacy": "public"
|
|
23921
23932
|
},
|
|
23922
23933
|
{
|
|
@@ -23960,6 +23971,26 @@
|
|
|
23960
23971
|
"description": "Checks if a value is valid against the current `formatPattern` value.\n\n**Note:** an empty string is considered as valid value.",
|
|
23961
23972
|
"privacy": "public"
|
|
23962
23973
|
},
|
|
23974
|
+
{
|
|
23975
|
+
"kind": "method",
|
|
23976
|
+
"name": "isValidValue",
|
|
23977
|
+
"return": {
|
|
23978
|
+
"type": {
|
|
23979
|
+
"text": "boolean"
|
|
23980
|
+
}
|
|
23981
|
+
},
|
|
23982
|
+
"parameters": [
|
|
23983
|
+
{
|
|
23984
|
+
"name": "value",
|
|
23985
|
+
"type": {
|
|
23986
|
+
"text": "string | undefined"
|
|
23987
|
+
},
|
|
23988
|
+
"description": "The value to be tested against the value format"
|
|
23989
|
+
}
|
|
23990
|
+
],
|
|
23991
|
+
"description": "Checks if a value is valid against the current `valueFormat` value.\n\n**Note:** an empty string is considered as valid value.",
|
|
23992
|
+
"privacy": "public"
|
|
23993
|
+
},
|
|
23963
23994
|
{
|
|
23964
23995
|
"kind": "field",
|
|
23965
23996
|
"name": "name",
|
|
@@ -24020,6 +24051,16 @@
|
|
|
24020
24051
|
"description": "Defines a formatted time value.",
|
|
24021
24052
|
"privacy": "public"
|
|
24022
24053
|
},
|
|
24054
|
+
{
|
|
24055
|
+
"kind": "field",
|
|
24056
|
+
"name": "valueFormat",
|
|
24057
|
+
"type": {
|
|
24058
|
+
"text": "string | undefined"
|
|
24059
|
+
},
|
|
24060
|
+
"description": "Determines the format, used for the value attribute.",
|
|
24061
|
+
"default": "undefined",
|
|
24062
|
+
"privacy": "public"
|
|
24063
|
+
},
|
|
24023
24064
|
{
|
|
24024
24065
|
"kind": "field",
|
|
24025
24066
|
"name": "valueState",
|
|
@@ -24137,6 +24178,15 @@
|
|
|
24137
24178
|
"text": "boolean"
|
|
24138
24179
|
}
|
|
24139
24180
|
},
|
|
24181
|
+
{
|
|
24182
|
+
"description": "Determines the format, displayed in the input field.",
|
|
24183
|
+
"name": "display-format",
|
|
24184
|
+
"default": "undefined",
|
|
24185
|
+
"fieldName": "displayFormat",
|
|
24186
|
+
"type": {
|
|
24187
|
+
"text": "string | undefined"
|
|
24188
|
+
}
|
|
24189
|
+
},
|
|
24140
24190
|
{
|
|
24141
24191
|
"description": "Determines the format, displayed in the input field.\n\nExample:\nHH:mm:ss -> 11:42:35\nhh:mm:ss a -> 2:23:15 PM\nmm:ss -> 12:04 (only minutes and seconds)",
|
|
24142
24192
|
"name": "format-pattern",
|
|
@@ -24144,7 +24194,8 @@
|
|
|
24144
24194
|
"fieldName": "formatPattern",
|
|
24145
24195
|
"type": {
|
|
24146
24196
|
"text": "string | undefined"
|
|
24147
|
-
}
|
|
24197
|
+
},
|
|
24198
|
+
"deprecated": "Use displayFormat and valueFormat instead"
|
|
24148
24199
|
},
|
|
24149
24200
|
{
|
|
24150
24201
|
"description": "Determines the name by which the component will be identified upon submission in an HTML form.\n\n**Note:** This property is only applicable within the context of an HTML Form element.",
|
|
@@ -24200,6 +24251,15 @@
|
|
|
24200
24251
|
"text": "string"
|
|
24201
24252
|
}
|
|
24202
24253
|
},
|
|
24254
|
+
{
|
|
24255
|
+
"description": "Determines the format, used for the value attribute.",
|
|
24256
|
+
"name": "value-format",
|
|
24257
|
+
"default": "undefined",
|
|
24258
|
+
"fieldName": "valueFormat",
|
|
24259
|
+
"type": {
|
|
24260
|
+
"text": "string | undefined"
|
|
24261
|
+
}
|
|
24262
|
+
},
|
|
24203
24263
|
{
|
|
24204
24264
|
"description": "Defines the value state of the component.",
|
|
24205
24265
|
"name": "value-state",
|
|
@@ -211,6 +211,7 @@ class Suggestions {
|
|
|
211
211
|
items[previousSelectedIdx].focused = false;
|
|
212
212
|
this.component.focused = true;
|
|
213
213
|
this.component.hasSuggestionItemSelected = false;
|
|
214
|
+
this.component.value = this.component.typedInValue;
|
|
214
215
|
this.selectedItemIndex -= 1;
|
|
215
216
|
return;
|
|
216
217
|
}
|
|
@@ -265,7 +266,7 @@ class Suggestions {
|
|
|
265
266
|
_deselectItems() {
|
|
266
267
|
const items = this._getItems();
|
|
267
268
|
items.forEach(item => {
|
|
268
|
-
if (item.hasAttribute("ui5-suggestion-item")) {
|
|
269
|
+
if (item.hasAttribute("ui5-suggestion-item") || item.hasAttribute("ui5-suggestion-item-custom")) {
|
|
269
270
|
item.selected = false;
|
|
270
271
|
}
|
|
271
272
|
item.focused = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputSuggestions.js","sourceRoot":"","sources":["../../src/features/InputSuggestions.ts"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,MAAM,gEAAgE,CAAC;AAIvG,OAAO,sBAAsB,CAAC;AAC9B,OAAO,2BAA2B,CAAC;AAGnC,OAAO,wBAAwB,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,MAAM,aAAa,CAAC;AAEhC,OAAO,EACN,kBAAkB,EAClB,sBAAsB,GACtB,MAAM,oCAAoC,CAAC;AAyB5C;;;;GAIG;AACH,MAAM,WAAW;IAchB,IAAI,QAAQ;QACX,OAAO,wBAAwB,CAAC;IACjC,CAAC;IAED,YAAY,SAA8B,EAAE,QAAgB,EAAE,SAAkB,EAAE,WAAoB;QACrG,sDAAsD;QACtD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,gCAAgC;QAChC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,0DAA0D;QAC1D,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAE/B,gDAAgD;QAChD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,kEAAkE;QAClE,wCAAwC;QACxC,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,CAAC,CAAgB,EAAE,WAAmB;QACzC,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,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B,CAAE,CAAC;IACvG,CAAC;IAED,IAAI,qBAAqB;QACxB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO,EAAE,CAAC;QACX,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YAC1B,OAAO,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QAC7F,CAAC;QAED,MAAM,gBAAgB,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC;QAEtI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,gBAAgB,EAAE,CAAC,IAAI,EAAE,CAAC;IACpE,CAAC;IAED,eAAe,CAAC,IAAY,EAAE,KAAa;QAC1C,OAAO,yBAAyB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,cAAc;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;IAC5C,CAAC;IAED,kCAAkC;QACjC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;IAC5B,CAAC;;AAlbM,uBAAW,GAAG,EAAE,CAAC;AAqbzB,KAAK,CAAC,gBAAgB,GAAG,WAAW,CAAC;AAErC,eAAe,WAAW,CAAC","sourcesContent":["import type UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport generateHighlightedMarkup from \"@ui5/webcomponents-base/dist/util/generateHighlightedMarkup.js\";\nimport type List from \"../List.js\";\nimport type { ListItemClickEventDetail, ListSelectionChangeEventDetail } from \"../List.js\";\nimport type ResponsivePopover from \"../ResponsivePopover.js\";\nimport \"../SuggestionItem.js\";\nimport \"../SuggestionItemGroup.js\";\nimport type SuggestionItem from \"../SuggestionItem.js\";\nimport type ListItemGroupHeader from \"../ListItemGroupHeader.js\";\nimport InputSuggestionsTemplate from \"./InputSuggestionsTemplate.js\";\nimport Input from \"../Input.js\";\n\nimport {\n\tLIST_ITEM_POSITION,\n\tLIST_ITEM_GROUP_HEADER,\n} from \"../generated/i18n/i18n-defaults.js\";\nimport type ListItemBase from \"../ListItemBase.js\";\nimport type SuggestionItemGroup from \"../SuggestionItemGroup.js\";\nimport type { IInputSuggestionItem, IInputSuggestionItemSelectable } from \"../Input.js\";\n\ninterface SuggestionComponent extends UI5Element {\n\tfocused: boolean;\n\thasSuggestionItemSelected: boolean;\n\tvalue: string;\n\ttypedInValue: string;\n\thasValueStateMessage: boolean;\n\tsuggestionItems: Array<IInputSuggestionItem>;\n\topen: boolean;\n\tonItemSelected: (pressedItem: IInputSuggestionItemSelectable, keyboardUsed: boolean) => void;\n\tonItemSelect: (item: IInputSuggestionItem) => void;\n}\n\ntype SuggestionsAccInfo = {\n\tisGroup: boolean;\n\tcurrentPos?: number;\n\tlistSize?: number;\n\titemText: string;\n\tadditionalText?: string;\n}\n\n/**\n * A class to manage the `Input` suggestion items.\n * @class\n * @private\n */\nclass Suggestions {\n\tcomponent: SuggestionComponent;\n\tslotName: string;\n\thandleFocus: boolean;\n\thighlight: boolean;\n\tselectedItemIndex: number;\n\taccInfo?: SuggestionsAccInfo;\n\t_scrollContainer?: HTMLElement;\n\t_handledPress?: boolean;\n\tattachedAfterOpened?: boolean;\n\tattachedAfterClose?: boolean;\n\tstatic i18nBundle: I18nBundle;\n\tstatic SCROLL_STEP = 60;\n\n\tget template() {\n\t\treturn InputSuggestionsTemplate;\n\t}\n\n\tconstructor(component: SuggestionComponent, slotName: string, highlight: boolean, handleFocus: boolean) {\n\t\t// The component, that the suggestion would plug into.\n\t\tthis.component = component;\n\n\t\t// Defines the items` slot name.\n\t\tthis.slotName = slotName;\n\n\t\t// Defines, if the focus will be moved via the arrow keys.\n\t\tthis.handleFocus = handleFocus;\n\n\t\t// Defines, if the suggestions should highlight.\n\t\tthis.highlight = highlight;\n\n\t\t// An integer value to store the currently selected item position,\n\t\t// that changes due to user interaction.\n\t\tthis.selectedItemIndex = -1;\n\t}\n\n\tonUp(e: KeyboardEvent, indexOfItem: number) {\n\t\te.preventDefault();\n\t\tconst index = !this.isOpened && this._hasValueState && indexOfItem === -1 ? 0 : indexOfItem;\n\t\tthis._handleItemNavigation(false /* forward */, index);\n\t\treturn true;\n\t}\n\n\tonDown(e: KeyboardEvent, indexOfItem: number) {\n\t\te.preventDefault();\n\t\tconst index = !this.isOpened && this._hasValueState && indexOfItem === -1 ? 0 : indexOfItem;\n\t\tthis._handleItemNavigation(true /* forward */, index);\n\t\treturn true;\n\t}\n\n\tonSpace(e: KeyboardEvent) {\n\t\tif (this._isItemOnTarget()) {\n\t\t\te.preventDefault();\n\t\t\tthis.onItemSelected(this._selectedItem, true /* keyboardUsed */);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tonEnter(e: KeyboardEvent) {\n\t\tif (this._isGroupItem) {\n\t\t\te.preventDefault();\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this._isItemOnTarget()) {\n\t\t\tthis.onItemSelected(this._selectedItem, true /* keyboardUsed */);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tonPageUp(e: KeyboardEvent) {\n\t\te.preventDefault();\n\n\t\tconst isItemIndexValid = this.selectedItemIndex - 10 > -1;\n\n\t\tthis._moveItemSelection(this.selectedItemIndex,\n\t\t\tisItemIndexValid ? this.selectedItemIndex -= 10 : this.selectedItemIndex = 0);\n\t\treturn true;\n\t}\n\n\tonPageDown(e: KeyboardEvent) {\n\t\te.preventDefault();\n\n\t\tconst items = this.visibleItems;\n\n\t\tif (!items) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst lastItemIndex = items.length - 1;\n\t\tconst isItemIndexValid = this.selectedItemIndex + 10 <= lastItemIndex;\n\n\t\tthis._moveItemSelection(this.selectedItemIndex,\n\t\t\tisItemIndexValid ? this.selectedItemIndex += 10 : this.selectedItemIndex = lastItemIndex);\n\t\treturn true;\n\t}\n\n\tonHome(e: KeyboardEvent) {\n\t\te.preventDefault();\n\n\t\tthis._moveItemSelection(this.selectedItemIndex, this.selectedItemIndex = 0);\n\t\treturn true;\n\t}\n\n\tonEnd(e: KeyboardEvent) {\n\t\te.preventDefault();\n\n\t\tconst lastItemIndex = this._getItems().length - 1;\n\n\t\tif (!lastItemIndex) {\n\t\t\treturn true;\n\t\t}\n\n\t\tthis._moveItemSelection(this.selectedItemIndex, this.selectedItemIndex = lastItemIndex);\n\t\treturn true;\n\t}\n\n\tonTab() {\n\t\tif (this._isItemOnTarget()) {\n\t\t\tthis.onItemSelected(this._selectedItem, true);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\ttoggle(bToggle: boolean, options: { preventFocusRestore: boolean }) {\n\t\tconst toggle = bToggle !== undefined ? bToggle : !this.isOpened();\n\n\t\tif (toggle) {\n\t\t\tthis._getComponent().open = true;\n\t\t} else {\n\t\t\tthis.close(options.preventFocusRestore);\n\t\t}\n\t}\n\n\tget _selectedItem() {\n\t\treturn this._getNonGroupItems().find(item => item.selected) as SuggestionItem | null;\n\t}\n\n\t_isScrollable() {\n\t\tconst sc = this._getScrollContainer();\n\t\treturn sc.offsetHeight < sc.scrollHeight;\n\t}\n\n\tclose(preventFocusRestore = false) {\n\t\tconst selectedItem = this._getItems() && this._getItems()[this.selectedItemIndex];\n\n\t\tthis._getComponent().open = false;\n\t\tconst picker = this._getPicker();\n\t\tpicker.preventFocusRestore = preventFocusRestore;\n\t\tpicker.open = false;\n\n\t\tif (selectedItem && selectedItem.focused) {\n\t\t\tselectedItem.focused = false;\n\t\t}\n\t}\n\n\tupdateSelectedItemPosition(pos: number) {\n\t\tthis.selectedItemIndex = pos;\n\t}\n\n\tonItemSelected(selectedItem: IInputSuggestionItemSelectable | null, keyboardUsed: boolean) {\n\t\tconst item = selectedItem;\n\t\tconst nonGroupItems = this._getNonGroupItems();\n\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.accInfo = {\n\t\t\tisGroup: item.hasAttribute(\"ui5-suggestion-item-group\"),\n\t\t\tcurrentPos: nonGroupItems.indexOf(item) + 1,\n\t\t\tlistSize: nonGroupItems.length,\n\t\t\titemText: item.text || \"\",\n\t\t\tadditionalText: item.additionalText,\n\t\t};\n\n\t\tthis._getComponent().onItemSelected(item, keyboardUsed);\n\t\tthis._getComponent().open = false;\n\t}\n\n\tonItemSelect(item: IInputSuggestionItem) {\n\t\tthis._getComponent().onItemSelect(item);\n\t}\n\n\t/* Private methods */\n\t// Note: Split into two separate handlers\n\tonItemPress(e: CustomEvent<ListItemClickEventDetail | ListSelectionChangeEventDetail>) {\n\t\tlet pressedItem: ListItemBase; // SuggestionListItem\n\t\tconst isPressEvent = e.type === \"ui5-item-click\";\n\n\t\t// Only use the press e if the item is already selected, in all other cases we are listening for 'ui5-selection-change' from the list\n\t\t// Also we have to check if the selection-change is fired by the list's 'item-click' event handling, to avoid double handling on our side\n\t\tif ((isPressEvent && !(e.detail as ListItemClickEventDetail).item.selected) || (this._handledPress && !isPressEvent)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isPressEvent && (e.detail as ListItemClickEventDetail).item.selected) {\n\t\t\tpressedItem = (e.detail as ListItemClickEventDetail).item;\n\t\t\tthis._handledPress = true;\n\t\t} else {\n\t\t\tpressedItem = (e.detail as ListSelectionChangeEventDetail).selectedItems[0];\n\t\t}\n\n\t\tthis.onItemSelected(pressedItem as SuggestionItem, false /* keyboardUsed */);\n\t}\n\n\t_onClose() {\n\t\tthis._handledPress = false;\n\t}\n\n\t_isItemOnTarget() {\n\t\treturn this.isOpened() && this.selectedItemIndex !== null && this.selectedItemIndex !== -1 && !this._isGroupItem;\n\t}\n\n\tget _isGroupItem() {\n\t\tconst items = this._getItems();\n\n\t\tif (!items || !items[this.selectedItemIndex]) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn items[this.selectedItemIndex].hasAttribute(\"ui5-suggestion-item-group\");\n\t}\n\n\tisOpened() {\n\t\treturn !!(this._getPicker()?.open);\n\t}\n\n\t_handleItemNavigation(forward: boolean, index: number) {\n\t\tthis.selectedItemIndex = index;\n\n\t\tif (!this._getItems().length) {\n\t\t\treturn;\n\t\t}\n\t\tif (forward) {\n\t\t\tthis._selectNextItem();\n\t\t} else {\n\t\t\tthis._selectPreviousItem();\n\t\t}\n\t}\n\n\t_selectNextItem() {\n\t\tconst itemsCount = this._getItems().length;\n\n\t\tconst previousSelectedIdx = this.selectedItemIndex;\n\n\t\tif (previousSelectedIdx !== -1 && previousSelectedIdx + 1 > itemsCount - 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._moveItemSelection(previousSelectedIdx, ++this.selectedItemIndex);\n\t}\n\n\t_selectPreviousItem() {\n\t\tconst items = this.visibleItems;\n\t\tconst previousSelectedIdx = this.selectedItemIndex;\n\n\t\tif (previousSelectedIdx === -1 || previousSelectedIdx === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (previousSelectedIdx - 1 < 0) {\n\t\t\tif (items[previousSelectedIdx].hasAttribute(\"ui5-suggestion-item\") || items[previousSelectedIdx].hasAttribute(\"ui5-suggestion-item-custom\")) {\n\t\t\t\t(items[previousSelectedIdx] as SuggestionItem).selected = false;\n\t\t\t}\n\n\t\t\titems[previousSelectedIdx].focused = false;\n\n\t\t\tthis.component.focused = true;\n\t\t\tthis.component.hasSuggestionItemSelected = false;\n\t\t\tthis.selectedItemIndex -= 1;\n\t\t\treturn;\n\t\t}\n\n\t\tthis._moveItemSelection(previousSelectedIdx, --this.selectedItemIndex);\n\t}\n\n\tget visibleItems() {\n\t\treturn this._getItems().filter(item => !item.hidden);\n\t}\n\n\t_moveItemSelection(previousIdx: number, nextIdx: number) {\n\t\tconst items = this.visibleItems;\n\t\tconst currentItem = items[nextIdx];\n\t\tconst previousItem = items[previousIdx];\n\t\tconst nonGroupItems = this._getNonGroupItems();\n\t\tconst isGroupItem = currentItem?.hasAttribute(\"ui5-suggestion-item-group\");\n\n\t\tif (!currentItem) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.component.focused = false;\n\n\t\tconst selectedItem = this.visibleItems[this.selectedItemIndex];\n\n\t\tthis.accInfo = {\n\t\t\tisGroup: isGroupItem,\n\t\t\tcurrentPos: items.indexOf(currentItem) + 1,\n\t\t\titemText: (isGroupItem ? (selectedItem as SuggestionItemGroup).headerText : (selectedItem as IInputSuggestionItemSelectable).text) || \"\",\n\t\t};\n\n\t\tif (currentItem.hasAttribute(\"ui5-suggestion-item\") || currentItem.hasAttribute(\"ui5-suggestion-item-custom\")) {\n\t\t\tthis.accInfo.additionalText = (currentItem as IInputSuggestionItemSelectable).additionalText || \"\";\n\t\t\tthis.accInfo.currentPos = nonGroupItems.indexOf(currentItem as IInputSuggestionItemSelectable) + 1;\n\t\t\tthis.accInfo.listSize = nonGroupItems.length;\n\t\t}\n\n\t\tif (previousItem) {\n\t\t\tpreviousItem.focused = false;\n\t\t}\n\t\tif (previousItem?.hasAttribute(\"ui5-suggestion-item\") || previousItem?.hasAttribute(\"ui5-suggestion-item-custom\")) {\n\t\t\t(previousItem as IInputSuggestionItemSelectable).selected = false;\n\t\t}\n\n\t\tif (currentItem) {\n\t\t\tcurrentItem.focused = true;\n\n\t\t\tif (!isGroupItem) {\n\t\t\t\t(currentItem as IInputSuggestionItemSelectable).selected = true;\n\t\t\t}\n\n\t\t\tif (this.handleFocus) {\n\t\t\t\tcurrentItem.focus();\n\t\t\t}\n\t\t}\n\n\t\tthis.component.hasSuggestionItemSelected = true;\n\t\tthis.onItemSelect(currentItem);\n\n\t\tif (!this._isItemIntoView(currentItem)) {\n\t\t\tconst itemRef = this._isGroupItem ? (currentItem.shadowRoot!.querySelector(\"[ui5-li-group-header]\") as ListItemGroupHeader) : currentItem;\n\t\t\tthis._scrollItemIntoView(itemRef);\n\t\t}\n\t}\n\n\t_deselectItems() {\n\t\tconst items = this._getItems();\n\t\titems.forEach(item => {\n\t\t\tif (item.hasAttribute(\"ui5-suggestion-item\")) {\n\t\t\t\t(item as SuggestionItem).selected = false;\n\t\t\t}\n\n\t\t\titem.focused = false;\n\t\t});\n\t}\n\n\t_clearItemFocus() {\n\t\tconst focusedItem = this._getItems().find(item => item.focused);\n\n\t\tif (focusedItem) {\n\t\t\tfocusedItem.focused = false;\n\t\t}\n\t}\n\n\t_isItemIntoView(item: IInputSuggestionItem) {\n\t\tconst rectItem = item.getDomRef()!.getBoundingClientRect();\n\t\tconst rectInput = this._getComponent().getDomRef()!.getBoundingClientRect();\n\t\tconst windowHeight = (window.innerHeight || document.documentElement.clientHeight);\n\t\tlet headerHeight = 0;\n\n\t\tif (this._hasValueState) {\n\t\t\tconst valueStateHeader = this._getPicker().querySelector(\"[slot=header]\")!;\n\t\t\theaderHeight = valueStateHeader.getBoundingClientRect().height;\n\t\t}\n\n\t\treturn (rectItem.top + Suggestions.SCROLL_STEP <= windowHeight) && (rectItem.top >= rectInput.top + headerHeight);\n\t}\n\n\t_scrollItemIntoView(item: IInputSuggestionItem) {\n\t\titem.scrollIntoView({\n\t\t\tbehavior: \"auto\",\n\t\t\tblock: \"nearest\",\n\t\t\tinline: \"nearest\",\n\t\t});\n\t}\n\n\t_getScrollContainer() {\n\t\tif (!this._scrollContainer) {\n\t\t\tthis._scrollContainer = this._getPicker().shadowRoot!.querySelector(\".ui5-popup-content\")!;\n\t\t}\n\n\t\treturn this._scrollContainer;\n\t}\n\n\t/**\n\t * Returns the items in 1D array.\n\t *\n\t */\n\t_getItems(): Array<IInputSuggestionItem> {\n\t\tconst suggestionComponent = this._getComponent();\n\n\t\treturn suggestionComponent.getSlottedNodes<IInputSuggestionItem>(\"suggestionItems\").flatMap(item => {\n\t\t\treturn item.hasAttribute(\"ui5-suggestion-item-group\") ? [item, ...item.items!] : [item];\n\t\t});\n\t}\n\n\t_getNonGroupItems(): Array<IInputSuggestionItemSelectable> {\n\t\treturn this._getItems().filter(item => !item.hasAttribute(\"ui5-suggestion-item-group\")) as Array<IInputSuggestionItemSelectable>;\n\t}\n\n\t_getComponent(): SuggestionComponent {\n\t\treturn this.component;\n\t}\n\n\t_getList() {\n\t\treturn this._getPicker().querySelector<List>(\"[ui5-list]\")!;\n\t}\n\n\t_getListWidth() {\n\t\treturn this._getList()?.offsetWidth;\n\t}\n\n\t_getPicker() {\n\t\treturn this._getComponent().shadowRoot!.querySelector<ResponsivePopover>(\"[ui5-responsive-popover]\")!;\n\t}\n\n\tget itemSelectionAnnounce() {\n\t\tif (!this.accInfo) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tif (this.accInfo.isGroup) {\n\t\t\treturn `${Suggestions.i18nBundle.getText(LIST_ITEM_GROUP_HEADER)} ${this.accInfo.itemText}`;\n\t\t}\n\n\t\tconst itemPositionText = Suggestions.i18nBundle.getText(LIST_ITEM_POSITION, this.accInfo.currentPos || 0, this.accInfo.listSize || 0);\n\n\t\treturn `${this.accInfo.additionalText} ${itemPositionText}`.trim();\n\t}\n\n\thightlightInput(text: string, input: string) {\n\t\treturn generateHighlightedMarkup(text, input);\n\t}\n\n\tget _hasValueState() {\n\t\treturn this.component.hasValueStateMessage;\n\t}\n\n\t_clearSelectedSuggestionAndaccInfo() {\n\t\tthis.accInfo = undefined;\n\t\tthis.selectedItemIndex = 0;\n\t}\n}\n\nInput.SuggestionsClass = Suggestions;\n\nexport default Suggestions;\n\nexport type {\n\tSuggestionComponent,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"InputSuggestions.js","sourceRoot":"","sources":["../../src/features/InputSuggestions.ts"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,MAAM,gEAAgE,CAAC;AAIvG,OAAO,sBAAsB,CAAC;AAC9B,OAAO,2BAA2B,CAAC;AAGnC,OAAO,wBAAwB,MAA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AC,OAAO,CAAC,UAAU,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC;QAEtI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,gBAAgB,EAAE,CAAC,IAAI,EAAE,CAAC;IACpE,CAAC;IAED,eAAe,CAAC,IAAY,EAAE,KAAa;QAC1C,OAAO,yBAAyB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,cAAc;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;IAC5C,CAAC;IAED,kCAAkC;QACjC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;IAC5B,CAAC;;AAnbM,uBAAW,GAAG,EAAE,CAAC;AAsbzB,KAAK,CAAC,gBAAgB,GAAG,WAAW,CAAC;AAErC,eAAe,WAAW,CAAC","sourcesContent":["import type UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport generateHighlightedMarkup from \"@ui5/webcomponents-base/dist/util/generateHighlightedMarkup.js\";\nimport type List from \"../List.js\";\nimport type { ListItemClickEventDetail, ListSelectionChangeEventDetail } from \"../List.js\";\nimport type ResponsivePopover from \"../ResponsivePopover.js\";\nimport \"../SuggestionItem.js\";\nimport \"../SuggestionItemGroup.js\";\nimport type SuggestionItem from \"../SuggestionItem.js\";\nimport type ListItemGroupHeader from \"../ListItemGroupHeader.js\";\nimport InputSuggestionsTemplate from \"./InputSuggestionsTemplate.js\";\nimport Input from \"../Input.js\";\n\nimport {\n\tLIST_ITEM_POSITION,\n\tLIST_ITEM_GROUP_HEADER,\n} from \"../generated/i18n/i18n-defaults.js\";\nimport type ListItemBase from \"../ListItemBase.js\";\nimport type SuggestionItemGroup from \"../SuggestionItemGroup.js\";\nimport type { IInputSuggestionItem, IInputSuggestionItemSelectable } from \"../Input.js\";\n\ninterface SuggestionComponent extends UI5Element {\n\tfocused: boolean;\n\thasSuggestionItemSelected: boolean;\n\tvalue: string;\n\ttypedInValue: string;\n\thasValueStateMessage: boolean;\n\tsuggestionItems: Array<IInputSuggestionItem>;\n\topen: boolean;\n\tonItemSelected: (pressedItem: IInputSuggestionItemSelectable, keyboardUsed: boolean) => void;\n\tonItemSelect: (item: IInputSuggestionItem) => void;\n}\n\ntype SuggestionsAccInfo = {\n\tisGroup: boolean;\n\tcurrentPos?: number;\n\tlistSize?: number;\n\titemText: string;\n\tadditionalText?: string;\n}\n\n/**\n * A class to manage the `Input` suggestion items.\n * @class\n * @private\n */\nclass Suggestions {\n\tcomponent: SuggestionComponent;\n\tslotName: string;\n\thandleFocus: boolean;\n\thighlight: boolean;\n\tselectedItemIndex: number;\n\taccInfo?: SuggestionsAccInfo;\n\t_scrollContainer?: HTMLElement;\n\t_handledPress?: boolean;\n\tattachedAfterOpened?: boolean;\n\tattachedAfterClose?: boolean;\n\tstatic i18nBundle: I18nBundle;\n\tstatic SCROLL_STEP = 60;\n\n\tget template() {\n\t\treturn InputSuggestionsTemplate;\n\t}\n\n\tconstructor(component: SuggestionComponent, slotName: string, highlight: boolean, handleFocus: boolean) {\n\t\t// The component, that the suggestion would plug into.\n\t\tthis.component = component;\n\n\t\t// Defines the items` slot name.\n\t\tthis.slotName = slotName;\n\n\t\t// Defines, if the focus will be moved via the arrow keys.\n\t\tthis.handleFocus = handleFocus;\n\n\t\t// Defines, if the suggestions should highlight.\n\t\tthis.highlight = highlight;\n\n\t\t// An integer value to store the currently selected item position,\n\t\t// that changes due to user interaction.\n\t\tthis.selectedItemIndex = -1;\n\t}\n\n\tonUp(e: KeyboardEvent, indexOfItem: number) {\n\t\te.preventDefault();\n\t\tconst index = !this.isOpened && this._hasValueState && indexOfItem === -1 ? 0 : indexOfItem;\n\t\tthis._handleItemNavigation(false /* forward */, index);\n\t\treturn true;\n\t}\n\n\tonDown(e: KeyboardEvent, indexOfItem: number) {\n\t\te.preventDefault();\n\t\tconst index = !this.isOpened && this._hasValueState && indexOfItem === -1 ? 0 : indexOfItem;\n\t\tthis._handleItemNavigation(true /* forward */, index);\n\t\treturn true;\n\t}\n\n\tonSpace(e: KeyboardEvent) {\n\t\tif (this._isItemOnTarget()) {\n\t\t\te.preventDefault();\n\t\t\tthis.onItemSelected(this._selectedItem, true /* keyboardUsed */);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tonEnter(e: KeyboardEvent) {\n\t\tif (this._isGroupItem) {\n\t\t\te.preventDefault();\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this._isItemOnTarget()) {\n\t\t\tthis.onItemSelected(this._selectedItem, true /* keyboardUsed */);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tonPageUp(e: KeyboardEvent) {\n\t\te.preventDefault();\n\n\t\tconst isItemIndexValid = this.selectedItemIndex - 10 > -1;\n\n\t\tthis._moveItemSelection(this.selectedItemIndex,\n\t\t\tisItemIndexValid ? this.selectedItemIndex -= 10 : this.selectedItemIndex = 0);\n\t\treturn true;\n\t}\n\n\tonPageDown(e: KeyboardEvent) {\n\t\te.preventDefault();\n\n\t\tconst items = this.visibleItems;\n\n\t\tif (!items) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst lastItemIndex = items.length - 1;\n\t\tconst isItemIndexValid = this.selectedItemIndex + 10 <= lastItemIndex;\n\n\t\tthis._moveItemSelection(this.selectedItemIndex,\n\t\t\tisItemIndexValid ? this.selectedItemIndex += 10 : this.selectedItemIndex = lastItemIndex);\n\t\treturn true;\n\t}\n\n\tonHome(e: KeyboardEvent) {\n\t\te.preventDefault();\n\n\t\tthis._moveItemSelection(this.selectedItemIndex, this.selectedItemIndex = 0);\n\t\treturn true;\n\t}\n\n\tonEnd(e: KeyboardEvent) {\n\t\te.preventDefault();\n\n\t\tconst lastItemIndex = this._getItems().length - 1;\n\n\t\tif (!lastItemIndex) {\n\t\t\treturn true;\n\t\t}\n\n\t\tthis._moveItemSelection(this.selectedItemIndex, this.selectedItemIndex = lastItemIndex);\n\t\treturn true;\n\t}\n\n\tonTab() {\n\t\tif (this._isItemOnTarget()) {\n\t\t\tthis.onItemSelected(this._selectedItem, true);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\ttoggle(bToggle: boolean, options: { preventFocusRestore: boolean }) {\n\t\tconst toggle = bToggle !== undefined ? bToggle : !this.isOpened();\n\n\t\tif (toggle) {\n\t\t\tthis._getComponent().open = true;\n\t\t} else {\n\t\t\tthis.close(options.preventFocusRestore);\n\t\t}\n\t}\n\n\tget _selectedItem() {\n\t\treturn this._getNonGroupItems().find(item => item.selected) as SuggestionItem | null;\n\t}\n\n\t_isScrollable() {\n\t\tconst sc = this._getScrollContainer();\n\t\treturn sc.offsetHeight < sc.scrollHeight;\n\t}\n\n\tclose(preventFocusRestore = false) {\n\t\tconst selectedItem = this._getItems() && this._getItems()[this.selectedItemIndex];\n\n\t\tthis._getComponent().open = false;\n\t\tconst picker = this._getPicker();\n\t\tpicker.preventFocusRestore = preventFocusRestore;\n\t\tpicker.open = false;\n\n\t\tif (selectedItem && selectedItem.focused) {\n\t\t\tselectedItem.focused = false;\n\t\t}\n\t}\n\n\tupdateSelectedItemPosition(pos: number) {\n\t\tthis.selectedItemIndex = pos;\n\t}\n\n\tonItemSelected(selectedItem: IInputSuggestionItemSelectable | null, keyboardUsed: boolean) {\n\t\tconst item = selectedItem;\n\t\tconst nonGroupItems = this._getNonGroupItems();\n\n\t\tif (!item) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.accInfo = {\n\t\t\tisGroup: item.hasAttribute(\"ui5-suggestion-item-group\"),\n\t\t\tcurrentPos: nonGroupItems.indexOf(item) + 1,\n\t\t\tlistSize: nonGroupItems.length,\n\t\t\titemText: item.text || \"\",\n\t\t\tadditionalText: item.additionalText,\n\t\t};\n\n\t\tthis._getComponent().onItemSelected(item, keyboardUsed);\n\t\tthis._getComponent().open = false;\n\t}\n\n\tonItemSelect(item: IInputSuggestionItem) {\n\t\tthis._getComponent().onItemSelect(item);\n\t}\n\n\t/* Private methods */\n\t// Note: Split into two separate handlers\n\tonItemPress(e: CustomEvent<ListItemClickEventDetail | ListSelectionChangeEventDetail>) {\n\t\tlet pressedItem: ListItemBase; // SuggestionListItem\n\t\tconst isPressEvent = e.type === \"ui5-item-click\";\n\n\t\t// Only use the press e if the item is already selected, in all other cases we are listening for 'ui5-selection-change' from the list\n\t\t// Also we have to check if the selection-change is fired by the list's 'item-click' event handling, to avoid double handling on our side\n\t\tif ((isPressEvent && !(e.detail as ListItemClickEventDetail).item.selected) || (this._handledPress && !isPressEvent)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isPressEvent && (e.detail as ListItemClickEventDetail).item.selected) {\n\t\t\tpressedItem = (e.detail as ListItemClickEventDetail).item;\n\t\t\tthis._handledPress = true;\n\t\t} else {\n\t\t\tpressedItem = (e.detail as ListSelectionChangeEventDetail).selectedItems[0];\n\t\t}\n\n\t\tthis.onItemSelected(pressedItem as SuggestionItem, false /* keyboardUsed */);\n\t}\n\n\t_onClose() {\n\t\tthis._handledPress = false;\n\t}\n\n\t_isItemOnTarget() {\n\t\treturn this.isOpened() && this.selectedItemIndex !== null && this.selectedItemIndex !== -1 && !this._isGroupItem;\n\t}\n\n\tget _isGroupItem() {\n\t\tconst items = this._getItems();\n\n\t\tif (!items || !items[this.selectedItemIndex]) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn items[this.selectedItemIndex].hasAttribute(\"ui5-suggestion-item-group\");\n\t}\n\n\tisOpened() {\n\t\treturn !!(this._getPicker()?.open);\n\t}\n\n\t_handleItemNavigation(forward: boolean, index: number) {\n\t\tthis.selectedItemIndex = index;\n\n\t\tif (!this._getItems().length) {\n\t\t\treturn;\n\t\t}\n\t\tif (forward) {\n\t\t\tthis._selectNextItem();\n\t\t} else {\n\t\t\tthis._selectPreviousItem();\n\t\t}\n\t}\n\n\t_selectNextItem() {\n\t\tconst itemsCount = this._getItems().length;\n\n\t\tconst previousSelectedIdx = this.selectedItemIndex;\n\n\t\tif (previousSelectedIdx !== -1 && previousSelectedIdx + 1 > itemsCount - 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._moveItemSelection(previousSelectedIdx, ++this.selectedItemIndex);\n\t}\n\n\t_selectPreviousItem() {\n\t\tconst items = this.visibleItems;\n\t\tconst previousSelectedIdx = this.selectedItemIndex;\n\n\t\tif (previousSelectedIdx === -1 || previousSelectedIdx === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (previousSelectedIdx - 1 < 0) {\n\t\t\tif (items[previousSelectedIdx].hasAttribute(\"ui5-suggestion-item\") || items[previousSelectedIdx].hasAttribute(\"ui5-suggestion-item-custom\")) {\n\t\t\t\t(items[previousSelectedIdx] as SuggestionItem).selected = false;\n\t\t\t}\n\n\t\t\titems[previousSelectedIdx].focused = false;\n\n\t\t\tthis.component.focused = true;\n\t\t\tthis.component.hasSuggestionItemSelected = false;\n\t\t\tthis.component.value = this.component.typedInValue;\n\t\t\tthis.selectedItemIndex -= 1;\n\t\t\treturn;\n\t\t}\n\n\t\tthis._moveItemSelection(previousSelectedIdx, --this.selectedItemIndex);\n\t}\n\n\tget visibleItems() {\n\t\treturn this._getItems().filter(item => !item.hidden);\n\t}\n\n\t_moveItemSelection(previousIdx: number, nextIdx: number) {\n\t\tconst items = this.visibleItems;\n\t\tconst currentItem = items[nextIdx];\n\t\tconst previousItem = items[previousIdx];\n\t\tconst nonGroupItems = this._getNonGroupItems();\n\t\tconst isGroupItem = currentItem?.hasAttribute(\"ui5-suggestion-item-group\");\n\n\t\tif (!currentItem) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.component.focused = false;\n\n\t\tconst selectedItem = this.visibleItems[this.selectedItemIndex];\n\n\t\tthis.accInfo = {\n\t\t\tisGroup: isGroupItem,\n\t\t\tcurrentPos: items.indexOf(currentItem) + 1,\n\t\t\titemText: (isGroupItem ? (selectedItem as SuggestionItemGroup).headerText : (selectedItem as IInputSuggestionItemSelectable).text) || \"\",\n\t\t};\n\n\t\tif (currentItem.hasAttribute(\"ui5-suggestion-item\") || currentItem.hasAttribute(\"ui5-suggestion-item-custom\")) {\n\t\t\tthis.accInfo.additionalText = (currentItem as IInputSuggestionItemSelectable).additionalText || \"\";\n\t\t\tthis.accInfo.currentPos = nonGroupItems.indexOf(currentItem as IInputSuggestionItemSelectable) + 1;\n\t\t\tthis.accInfo.listSize = nonGroupItems.length;\n\t\t}\n\n\t\tif (previousItem) {\n\t\t\tpreviousItem.focused = false;\n\t\t}\n\t\tif (previousItem?.hasAttribute(\"ui5-suggestion-item\") || previousItem?.hasAttribute(\"ui5-suggestion-item-custom\")) {\n\t\t\t(previousItem as IInputSuggestionItemSelectable).selected = false;\n\t\t}\n\n\t\tif (currentItem) {\n\t\t\tcurrentItem.focused = true;\n\n\t\t\tif (!isGroupItem) {\n\t\t\t\t(currentItem as IInputSuggestionItemSelectable).selected = true;\n\t\t\t}\n\n\t\t\tif (this.handleFocus) {\n\t\t\t\tcurrentItem.focus();\n\t\t\t}\n\t\t}\n\n\t\tthis.component.hasSuggestionItemSelected = true;\n\t\tthis.onItemSelect(currentItem);\n\n\t\tif (!this._isItemIntoView(currentItem)) {\n\t\t\tconst itemRef = this._isGroupItem ? (currentItem.shadowRoot!.querySelector(\"[ui5-li-group-header]\") as ListItemGroupHeader) : currentItem;\n\t\t\tthis._scrollItemIntoView(itemRef);\n\t\t}\n\t}\n\n\t_deselectItems() {\n\t\tconst items = this._getItems();\n\t\titems.forEach(item => {\n\t\t\tif (item.hasAttribute(\"ui5-suggestion-item\") || item.hasAttribute(\"ui5-suggestion-item-custom\")) {\n\t\t\t\t(item as SuggestionItem).selected = false;\n\t\t\t}\n\n\t\t\titem.focused = false;\n\t\t});\n\t}\n\n\t_clearItemFocus() {\n\t\tconst focusedItem = this._getItems().find(item => item.focused);\n\n\t\tif (focusedItem) {\n\t\t\tfocusedItem.focused = false;\n\t\t}\n\t}\n\n\t_isItemIntoView(item: IInputSuggestionItem) {\n\t\tconst rectItem = item.getDomRef()!.getBoundingClientRect();\n\t\tconst rectInput = this._getComponent().getDomRef()!.getBoundingClientRect();\n\t\tconst windowHeight = (window.innerHeight || document.documentElement.clientHeight);\n\t\tlet headerHeight = 0;\n\n\t\tif (this._hasValueState) {\n\t\t\tconst valueStateHeader = this._getPicker().querySelector(\"[slot=header]\")!;\n\t\t\theaderHeight = valueStateHeader.getBoundingClientRect().height;\n\t\t}\n\n\t\treturn (rectItem.top + Suggestions.SCROLL_STEP <= windowHeight) && (rectItem.top >= rectInput.top + headerHeight);\n\t}\n\n\t_scrollItemIntoView(item: IInputSuggestionItem) {\n\t\titem.scrollIntoView({\n\t\t\tbehavior: \"auto\",\n\t\t\tblock: \"nearest\",\n\t\t\tinline: \"nearest\",\n\t\t});\n\t}\n\n\t_getScrollContainer() {\n\t\tif (!this._scrollContainer) {\n\t\t\tthis._scrollContainer = this._getPicker().shadowRoot!.querySelector(\".ui5-popup-content\")!;\n\t\t}\n\n\t\treturn this._scrollContainer;\n\t}\n\n\t/**\n\t * Returns the items in 1D array.\n\t *\n\t */\n\t_getItems(): Array<IInputSuggestionItem> {\n\t\tconst suggestionComponent = this._getComponent();\n\n\t\treturn suggestionComponent.getSlottedNodes<IInputSuggestionItem>(\"suggestionItems\").flatMap(item => {\n\t\t\treturn item.hasAttribute(\"ui5-suggestion-item-group\") ? [item, ...item.items!] : [item];\n\t\t});\n\t}\n\n\t_getNonGroupItems(): Array<IInputSuggestionItemSelectable> {\n\t\treturn this._getItems().filter(item => !item.hasAttribute(\"ui5-suggestion-item-group\")) as Array<IInputSuggestionItemSelectable>;\n\t}\n\n\t_getComponent(): SuggestionComponent {\n\t\treturn this.component;\n\t}\n\n\t_getList() {\n\t\treturn this._getPicker().querySelector<List>(\"[ui5-list]\")!;\n\t}\n\n\t_getListWidth() {\n\t\treturn this._getList()?.offsetWidth;\n\t}\n\n\t_getPicker() {\n\t\treturn this._getComponent().shadowRoot!.querySelector<ResponsivePopover>(\"[ui5-responsive-popover]\")!;\n\t}\n\n\tget itemSelectionAnnounce() {\n\t\tif (!this.accInfo) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tif (this.accInfo.isGroup) {\n\t\t\treturn `${Suggestions.i18nBundle.getText(LIST_ITEM_GROUP_HEADER)} ${this.accInfo.itemText}`;\n\t\t}\n\n\t\tconst itemPositionText = Suggestions.i18nBundle.getText(LIST_ITEM_POSITION, this.accInfo.currentPos || 0, this.accInfo.listSize || 0);\n\n\t\treturn `${this.accInfo.additionalText} ${itemPositionText}`.trim();\n\t}\n\n\thightlightInput(text: string, input: string) {\n\t\treturn generateHighlightedMarkup(text, input);\n\t}\n\n\tget _hasValueState() {\n\t\treturn this.component.hasValueStateMessage;\n\t}\n\n\t_clearSelectedSuggestionAndaccInfo() {\n\t\tthis.accInfo = undefined;\n\t\tthis.selectedItemIndex = 0;\n\t}\n}\n\nInput.SuggestionsClass = Suggestions;\n\nexport default Suggestions;\n\nexport type {\n\tSuggestionComponent,\n};\n"]}
|