@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
package/dist/Icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../src/Icon.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAG3E,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACtG,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAG3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,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O,EAAE,CAAC;yCACR;AASpB;IADC,QAAQ,EAAE;kCACwB;AAMnC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;sCAChB;AAM7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;qCAC3B;AAMnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCACZ;AAMhB;IADC,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;qDACC;AA5F1B;IADN,IAAI,CAAC,oBAAoB,CAAC;8BACG;AANzB,IAAI;IAlBT,aAAa,CAAC;QACd,GAAG,EAAE,UAAU;QACf,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,YAAY;QACtB,MAAM,EAAE,OAAO;KACf,CAAC;IACF;;;;;;OAMG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;KACb,CAAC;GACI,IAAI,CAiPT;AAED,IAAI,CAAC,MAAM,EAAE,CAAC;AAEd,eAAe,IAAI,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport jsxRender from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport type { AriaRole } from \"@ui5/webcomponents-base/dist/types.js\";\nimport type { IconData, UnsafeIconData } from \"@ui5/webcomponents-base/dist/asset-registries/Icons.js\";\nimport { getIconData, getIconDataSync } from \"@ui5/webcomponents-base/dist/asset-registries/Icons.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { isSpace, isEnter } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport executeTemplate from \"@ui5/webcomponents-base/dist/renderer/executeTemplate.js\";\nimport IconTemplate from \"./IconTemplate.js\";\nimport type IconDesign from \"./types/IconDesign.js\";\nimport IconMode from \"./types/IconMode.js\";\n\nimport { ICON_ARIA_TYPE_IMAGE, ICON_ARIA_TYPE_INTERACTIVE } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport iconCss from \"./generated/themes/Icon.css.js\";\n\n/**\n * Interface for components that represent an icon, usable in numerous higher-order components\n * @public\n */\ninterface IIcon extends HTMLElement { }\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\n\n/**\n * @class\n * ### Overview\n *\n * The `ui5-icon` component represents an SVG icon.\n * There are two main scenarios how the `ui5-icon` component is used:\n * as a purely decorative element,\n * or as an interactive element that can be focused and clicked.\n *\n * ### Usage\n *\n * 1. **Get familiar with the icons collections.**\n *\n * Before displaying an icon, you need to explore the icons collections to find and import the desired icon.\n *\n * Currently 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 *\n * 2. **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 *\n * 3. **Then, import the desired icon**.\n *\n * `import \"@ui5/\\{package_name\\}/dist/\\{icon_name\\}.js\";`\n *\n * **For Example**:\n *\n * For 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 *\n * For 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 *\n * For 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 *\n * 4. **Display the icon using the `ui5-icon` web component.**\n * Set the icon collection (\"SAP-icons\", \"tnt\" or \"business-suite\" - \"SAP-icons\" is the default icon collection and can be skipped)\n * and 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 * - [Shift] - If [Space] / [Enter] or [Return] is pressed, pressing [Shift] releases the ui5-icon without triggering the click event.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/Icon.js\";`\n * @csspart root - Used to style the outermost wrapper of the `ui5-icon`.\n * @constructor\n * @extends UI5Element\n * @implements {IIcon}\n * @public\n */\n@customElement({\n\ttag: \"ui5-icon\",\n\tlanguageAware: true,\n\tthemeAware: true,\n\trenderer: jsxRender,\n\ttemplate: IconTemplate,\n\tstyles: iconCss,\n})\n/**\n * Fired on mouseup, `SPACE` and `ENTER`.\n * - on mouse click, the icon fires native `click` event\n * - on `SPACE` and `ENTER`, the icon fires custom `click` event\n * @public\n * @since 2.11.0\n */\n@event(\"click\", {\n\tbubbles: true,\n})\nclass Icon extends UI5Element implements IIcon {\n\teventDetails!: {\n\t\tclick: void\n\t}\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\t/**\n\t * Defines the component semantic design.\n\t * @default \"Default\"\n\t * @public\n\t * @since 1.9.2\n\t */\n\t@property()\n\tdesign: `${IconDesign}` = \"Default\";\n\n\t/**\n\t * Defines the unique identifier (icon name) of the component.\n\t *\n\t * To browse all available icons, see the\n\t * [SAP Icons](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html),\n\t * [SAP Fiori Tools](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons-TNT) and\n\t * [SAP Business Suite](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html)\n\t *\n\t * Example:\n\t * `name='add'`, `name='delete'`, `name='employee'`.\n\t *\n\t * **Note:** To use the SAP Fiori Tools icons,\n\t * you need to set the `tnt` prefix in front of the icon's name.\n\t *\n\t * Example:\n\t * `name='tnt/antenna'`, `name='tnt/actor'`, `name='tnt/api'`.\n\t *\n\t * **Note:** To use the SAP Business Suite icons,\n\t * you need to set the `business-suite` prefix in front of the icon's name.\n\t *\n\t * Example:\n\t * `name='business-suite/3d'`, `name='business-suite/1x2-grid-layout'`, `name='business-suite/4x4-grid-layout'`.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tname?: string;\n\n\t/**\n\t * Defines the text alternative of the component.\n\t * If not provided a default text alternative will be set, if present.\n\t *\n\t * **Note:** Every icon should have a text alternative in order to\n\t * calculate its accessible name.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines whether the component should have a tooltip.\n\t *\n\t * **Note:** The tooltip text should be provided via the `accessible-name` property.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tshowTooltip = false;\n\n\t/**\n\t * Defines the mode of the component.\n\t * @default \"Decorative\"\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property()\n\tmode: `${IconMode}` = \"Decorative\";\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Array, noAttribute: true })\n\tpathData: Array<string> = [];\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Object, noAttribute: true })\n\taccData?: I18nText;\n\n\t/**\n\t* @private\n\t*/\n\t@property({ type: Boolean })\n\tinvalid = false;\n\n\t/**\n\t * @private\n\t */\n\t@property({ noAttribute: true })\n\teffectiveAccessibleName?: string;\n\n\tltr?: boolean;\n\tpackageName?: string;\n\tviewBox?: string;\n\tcustomTemplate?: object;\n\tcustomTemplateAsString?: string;\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (this.mode !== IconMode.Interactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis.fireDecoratorEvent(\"click\");\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault(); // prevent scrolling\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (this.mode === IconMode.Interactive && isSpace(e)) {\n\t\t\tthis.fireDecoratorEvent(\"click\");\n\t\t}\n\t}\n\n\t/**\n\t* Enforce \"ltr\" direction, based on the icons collection metadata.\n\t*/\n\tget _dir() {\n\t\treturn this.ltr ? \"ltr\" : undefined;\n\t}\n\n\tget effectiveAriaHidden() {\n\t\treturn this.mode === IconMode.Decorative ? \"true\" : undefined;\n\t}\n\n\tget _tabIndex() {\n\t\treturn this.mode === IconMode.Interactive ? 0 : undefined;\n\t}\n\n\tget effectiveAccessibleRole() {\n\t\tswitch (this.mode) {\n\t\tcase IconMode.Interactive:\n\t\t\treturn \"button\";\n\t\tcase IconMode.Decorative:\n\t\t\treturn \"presentation\";\n\t\tdefault:\n\t\t\treturn \"img\";\n\t\t}\n\t}\n\n\tonEnterDOM() {\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\t}\n\n\tasync onBeforeRendering() {\n\t\tconst name = this.name;\n\t\tif (!name) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet iconData: typeof ICON_NOT_FOUND | IconData | UnsafeIconData | undefined = getIconDataSync(name);\n\t\tif (!iconData) {\n\t\t\ticonData = await getIconData(name);\n\t\t}\n\n\t\tif (!iconData) {\n\t\t\tthis.invalid = true;\n\t\t\t/* eslint-disable-next-line */\n\t\t\treturn console.warn(`Required icon is not registered. Invalid icon name: ${this.name}`);\n\t\t}\n\n\t\tif (iconData === ICON_NOT_FOUND) {\n\t\t\tthis.invalid = true;\n\t\t\t/* eslint-disable-next-line */\n\t\t\treturn console.warn(`Required icon is not registered. You can either import the icon as a module in order to use it e.g. \"@ui5/webcomponents-icons/dist/${name.replace(\"sap-icon://\", \"\")}.js\", or setup a JSON build step and import \"@ui5/webcomponents-icons/dist/AllIcons.js\".`);\n\t\t}\n\n\t\tthis.viewBox = iconData.viewBox || \"0 0 512 512\";\n\n\t\tif (\"customTemplate\" in iconData && iconData.customTemplate) {\n\t\t\tthis.customTemplate = executeTemplate(iconData.customTemplate, this);\n\t\t}\n\n\t\tif (\"customTemplateAsString\" in iconData) {\n\t\t\tthis.customTemplateAsString = iconData.customTemplateAsString;\n\t\t}\n\n\t\t// in case a new valid name is set, show the icon\n\t\tthis.invalid = false;\n\t\tif (\"pathData\" in iconData && iconData.pathData) {\n\t\t\tthis.pathData = Array.isArray(iconData.pathData) ? iconData.pathData : [iconData.pathData];\n\t\t}\n\n\t\tthis.accData = iconData.accData;\n\t\tthis.ltr = iconData.ltr;\n\t\tthis.packageName = iconData.packageName;\n\n\t\tif (this.accessibleName) {\n\t\t\tthis.effectiveAccessibleName = this.accessibleName;\n\t\t} else if (this.accData) {\n\t\t\tif (this.packageName) {\n\t\t\t\tconst i18nBundle = await getI18nBundle(this.packageName);\n\t\t\t\tthis.effectiveAccessibleName = i18nBundle.getText(this.accData) || undefined;\n\t\t\t} else {\n\t\t\t\tthis.effectiveAccessibleName = this.accData?.defaultText || undefined;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.effectiveAccessibleName = undefined;\n\t\t}\n\t}\n\n\tget hasIconTooltip() {\n\t\treturn this.showTooltip && this.effectiveAccessibleName;\n\t}\n\n\t_getAriaTypeDescription() {\n\t\tswitch (this.mode) {\n\t\tcase IconMode.Interactive:\n\t\t\treturn Icon.i18nBundle.getText(ICON_ARIA_TYPE_INTERACTIVE);\n\t\tcase IconMode.Image:\n\t\t\treturn Icon.i18nBundle.getText(ICON_ARIA_TYPE_IMAGE);\n\t\tdefault:\n\t\t\treturn \"\";\n\t\t}\n\t}\n\n\tget accessibilityInfo() {\n\t\tif (this.mode === IconMode.Decorative) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\trole: this.effectiveAccessibleRole as AriaRole,\n\t\t\ttype: this._getAriaTypeDescription(),\n\t\t\tdescription: this.effectiveAccessibleName,\n\t\t};\n\t}\n}\n\nIcon.define();\n\nexport default Icon;\nexport type {\n\tIIcon,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../src/Icon.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAG3E,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACtG,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAA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webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport type { AriaRole } from \"@ui5/webcomponents-base/dist/types.js\";\nimport type { IconData, UnsafeIconData } from \"@ui5/webcomponents-base/dist/asset-registries/Icons.js\";\nimport { getIconData, getIconDataSync } from \"@ui5/webcomponents-base/dist/asset-registries/Icons.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { isSpace, isEnter } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport executeTemplate from \"@ui5/webcomponents-base/dist/renderer/executeTemplate.js\";\nimport IconTemplate from \"./IconTemplate.js\";\nimport type IconDesign from \"./types/IconDesign.js\";\nimport IconMode from \"./types/IconMode.js\";\n\nimport { ICON_ARIA_TYPE_IMAGE, ICON_ARIA_TYPE_INTERACTIVE } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport iconCss from \"./generated/themes/Icon.css.js\";\n\n/**\n * Interface for components that represent an icon, usable in numerous higher-order components\n * @public\n */\ninterface IIcon extends HTMLElement { }\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\n\n/**\n * @class\n * ### Overview\n *\n * The `ui5-icon` component represents an SVG icon.\n * There are two main scenarios how the `ui5-icon` component is used:\n * as a purely decorative element,\n * or as an interactive element that can be focused and clicked.\n *\n * ### Usage\n *\n * 1. **Get familiar with the icons collections.**\n *\n * Before displaying an icon, you need to explore the icons collections to find and import the desired icon.\n *\n * Currently 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 *\n * 2. **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 *\n * 3. **Then, import the desired icon**.\n *\n * `import \"@ui5/\\{package_name\\}/dist/\\{icon_name\\}.js\";`\n *\n * **For Example**:\n *\n * For 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 *\n * For 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 *\n * For 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 *\n * 4. **Display the icon using the `ui5-icon` web component.**\n * Set the icon collection (\"SAP-icons\", \"tnt\" or \"business-suite\" - \"SAP-icons\" is the default icon collection and can be skipped)\n * and 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\";`\n * @csspart root - Used to style the outermost wrapper of the `ui5-icon`.\n * @constructor\n * @extends UI5Element\n * @implements {IIcon}\n * @public\n */\n@customElement({\n\ttag: \"ui5-icon\",\n\tlanguageAware: true,\n\tthemeAware: true,\n\trenderer: jsxRender,\n\ttemplate: IconTemplate,\n\tstyles: iconCss,\n})\n/**\n * Fired when the component is activated by mouse/touch, keyboard (Enter or Space),\n * or screen reader virtual cursor activation.\n *\n * **Note:** The event will not be fired if the `mode` property is set to `Decorative` or `Image`.\n * @public\n * @since 2.11.0\n */\n@event(\"click\", {\n\tbubbles: true,\n})\nclass Icon extends UI5Element implements IIcon {\n\teventDetails!: {\n\t\tclick: void\n\t}\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\t/**\n\t * Defines the component semantic design.\n\t * @default \"Default\"\n\t * @public\n\t * @since 1.9.2\n\t */\n\t@property()\n\tdesign: `${IconDesign}` = \"Default\";\n\n\t/**\n\t * Defines the unique identifier (icon name) of the component.\n\t *\n\t * To browse all available icons, see the\n\t * [SAP Icons](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html),\n\t * [SAP Fiori Tools](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html#/overview/SAP-icons-TNT) and\n\t * [SAP Business Suite](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html)\n\t *\n\t * Example:\n\t * `name='add'`, `name='delete'`, `name='employee'`.\n\t *\n\t * **Note:** To use the SAP Fiori Tools icons,\n\t * you need to set the `tnt` prefix in front of the icon's name.\n\t *\n\t * Example:\n\t * `name='tnt/antenna'`, `name='tnt/actor'`, `name='tnt/api'`.\n\t *\n\t * **Note:** To use the SAP Business Suite icons,\n\t * you need to set the `business-suite` prefix in front of the icon's name.\n\t *\n\t * Example:\n\t * `name='business-suite/3d'`, `name='business-suite/1x2-grid-layout'`, `name='business-suite/4x4-grid-layout'`.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tname?: string;\n\n\t/**\n\t * Defines the text alternative of the component.\n\t * If not provided a default text alternative will be set, if present.\n\t *\n\t * **Note:** Every icon should have a text alternative in order to\n\t * calculate its accessible name.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines whether the component should have a tooltip.\n\t *\n\t * **Note:** The tooltip text should be provided via the `accessible-name` property.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tshowTooltip = false;\n\n\t/**\n\t * Defines the mode of the component.\n\t * @default \"Decorative\"\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property()\n\tmode: `${IconMode}` = \"Decorative\";\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Array, noAttribute: true })\n\tpathData: Array<string> = [];\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Object, noAttribute: true })\n\taccData?: I18nText;\n\n\t/**\n\t* @private\n\t*/\n\t@property({ type: Boolean })\n\tinvalid = false;\n\n\t/**\n\t * @private\n\t */\n\t@property({ noAttribute: true })\n\teffectiveAccessibleName?: string;\n\n\tltr?: boolean;\n\tpackageName?: string;\n\tviewBox?: string;\n\tcustomTemplate?: object;\n\tcustomTemplateAsString?: string;\n\n\t_onclick(e: MouseEvent) {\n\t\tif (this.mode !== IconMode.Interactive) {\n\t\t\treturn;\n\t\t}\n\n\t\t// prevents the native browser \"click\" event from firing\n\t\te.stopImmediatePropagation();\n\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (this.mode !== IconMode.Interactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis.fireDecoratorEvent(\"click\");\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault(); // prevent scrolling\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (this.mode === IconMode.Interactive && isSpace(e)) {\n\t\t\tthis.fireDecoratorEvent(\"click\");\n\t\t}\n\t}\n\n\t/**\n\t* Enforce \"ltr\" direction, based on the icons collection metadata.\n\t*/\n\tget _dir() {\n\t\treturn this.ltr ? \"ltr\" : undefined;\n\t}\n\n\tget effectiveAriaHidden() {\n\t\treturn this.mode === IconMode.Decorative ? \"true\" : undefined;\n\t}\n\n\tget _tabIndex() {\n\t\treturn this.mode === IconMode.Interactive ? 0 : undefined;\n\t}\n\n\tget effectiveAccessibleRole() {\n\t\tswitch (this.mode) {\n\t\tcase IconMode.Interactive:\n\t\t\treturn \"button\";\n\t\tcase IconMode.Decorative:\n\t\t\treturn \"presentation\";\n\t\tdefault:\n\t\t\treturn \"img\";\n\t\t}\n\t}\n\n\tonEnterDOM() {\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\t}\n\n\tasync onBeforeRendering() {\n\t\tconst name = this.name;\n\t\tif (!name) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet iconData: typeof ICON_NOT_FOUND | IconData | UnsafeIconData | undefined = getIconDataSync(name);\n\t\tif (!iconData) {\n\t\t\ticonData = await getIconData(name);\n\t\t}\n\n\t\tif (!iconData) {\n\t\t\tthis.invalid = true;\n\t\t\t/* eslint-disable-next-line */\n\t\t\treturn console.warn(`Required icon is not registered. Invalid icon name: ${this.name}`);\n\t\t}\n\n\t\tif (iconData === ICON_NOT_FOUND) {\n\t\t\tthis.invalid = true;\n\t\t\t/* eslint-disable-next-line */\n\t\t\treturn console.warn(`Required icon is not registered. You can either import the icon as a module in order to use it e.g. \"@ui5/webcomponents-icons/dist/${name.replace(\"sap-icon://\", \"\")}.js\", or setup a JSON build step and import \"@ui5/webcomponents-icons/dist/AllIcons.js\".`);\n\t\t}\n\n\t\tthis.viewBox = iconData.viewBox || \"0 0 512 512\";\n\n\t\tif (\"customTemplate\" in iconData && iconData.customTemplate) {\n\t\t\tthis.customTemplate = executeTemplate(iconData.customTemplate, this);\n\t\t}\n\n\t\tif (\"customTemplateAsString\" in iconData) {\n\t\t\tthis.customTemplateAsString = iconData.customTemplateAsString;\n\t\t}\n\n\t\t// in case a new valid name is set, show the icon\n\t\tthis.invalid = false;\n\t\tif (\"pathData\" in iconData && iconData.pathData) {\n\t\t\tthis.pathData = Array.isArray(iconData.pathData) ? iconData.pathData : [iconData.pathData];\n\t\t}\n\n\t\tthis.accData = iconData.accData;\n\t\tthis.ltr = iconData.ltr;\n\t\tthis.packageName = iconData.packageName;\n\n\t\tif (this.accessibleName) {\n\t\t\tthis.effectiveAccessibleName = this.accessibleName;\n\t\t} else if (this.accData) {\n\t\t\tif (this.packageName) {\n\t\t\t\tconst i18nBundle = await getI18nBundle(this.packageName);\n\t\t\t\tthis.effectiveAccessibleName = i18nBundle.getText(this.accData) || undefined;\n\t\t\t} else {\n\t\t\t\tthis.effectiveAccessibleName = this.accData?.defaultText || undefined;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.effectiveAccessibleName = undefined;\n\t\t}\n\t}\n\n\tget hasIconTooltip() {\n\t\treturn this.showTooltip && this.effectiveAccessibleName;\n\t}\n\n\t_getAriaTypeDescription() {\n\t\tswitch (this.mode) {\n\t\tcase IconMode.Interactive:\n\t\t\treturn Icon.i18nBundle.getText(ICON_ARIA_TYPE_INTERACTIVE);\n\t\tcase IconMode.Image:\n\t\t\treturn Icon.i18nBundle.getText(ICON_ARIA_TYPE_IMAGE);\n\t\tdefault:\n\t\t\treturn \"\";\n\t\t}\n\t}\n\n\tget accessibilityInfo() {\n\t\tif (this.mode === IconMode.Decorative) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\trole: this.effectiveAccessibleRole as AriaRole,\n\t\t\ttype: this._getAriaTypeDescription(),\n\t\t\tdescription: this.effectiveAccessibleName,\n\t\t};\n\t}\n}\n\nIcon.define();\n\nexport default Icon;\nexport type {\n\tIIcon,\n};\n"]}
|
package/dist/IconTemplate.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "@ui5/webcomponents-base/jsx-runtime";
|
|
2
2
|
export default function IconTemplate() {
|
|
3
|
-
return (_jsxs("svg", { class: "ui5-icon-root", part: "root", tabindex: this._tabIndex, dir: this._dir, viewBox: this.viewBox, role: this.effectiveAccessibleRole, focusable: "false", preserveAspectRatio: "xMidYMid meet", "aria-label": this.effectiveAccessibleName, "aria-hidden": this.effectiveAriaHidden, xmlns: "http://www.w3.org/2000/svg", onKeyDown: this._onkeydown, onKeyUp: this._onkeyup, children: [this.hasIconTooltip &&
|
|
3
|
+
return (_jsxs("svg", { class: "ui5-icon-root", part: "root", tabindex: this._tabIndex, dir: this._dir, viewBox: this.viewBox, role: this.effectiveAccessibleRole, focusable: "false", preserveAspectRatio: "xMidYMid meet", "aria-label": this.effectiveAccessibleName, "aria-hidden": this.effectiveAriaHidden, xmlns: "http://www.w3.org/2000/svg", onKeyDown: this._onkeydown, onKeyUp: this._onkeyup, onClick: this._onclick, children: [this.hasIconTooltip &&
|
|
4
4
|
_jsxs("title", { id: `${this._id}-tooltip`, children: [" ", this.effectiveAccessibleName, " "] }), _jsx("g", { role: "presentation", children: content.call(this) })] }));
|
|
5
5
|
}
|
|
6
6
|
function content() {
|
package/dist/IconTemplate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconTemplate.js","sourceRoot":"","sources":["../src/IconTemplate.tsx"],"names":[],"mappings":";AAEA,MAAM,CAAC,OAAO,UAAU,YAAY;IACnC,OAAO,CACN,eACC,KAAK,EAAC,eAAe,EACrB,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,GAAG,EAAE,IAAI,CAAC,IAAI,EACd,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,IAAI,EAAE,IAAI,CAAC,uBAAuB,EAClC,SAAS,EAAC,OAAO,EACjB,mBAAmB,EAAC,eAAe,gBACvB,IAAI,CAAC,uBAAuB,iBAC3B,IAAI,CAAC,mBAAmB,EACrC,KAAK,EAAC,4BAA4B,EAClC,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ,aAEpB,IAAI,CAAC,cAAc;gBACR,iBAAO,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,UAAU,kBAAK,IAAI,CAAC,uBAAuB,SAAU,EAGxF,YAAG,IAAI,EAAC,cAAc,YACnB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GACjB,IACC,CACN,CAAC;AACH,CAAC;AAED,SAAS,OAAO;IACf,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;IAED,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACjC,OAAO,YAAG,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,sBAAsB,EAAE,GAAM,CAAC;IAClF,CAAC;IAED,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAChC,eAAM,CAAC,EAAE,IAAI,GAAS,CACtB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type Icon from \"./Icon.js\";\n\nexport default function IconTemplate(this: Icon) {\n\treturn (\n\t\t<svg\n\t\t\tclass=\"ui5-icon-root\"\n\t\t\tpart=\"root\"\n\t\t\ttabindex={this._tabIndex}\n\t\t\tdir={this._dir}\n\t\t\tviewBox={this.viewBox}\n\t\t\trole={this.effectiveAccessibleRole}\n\t\t\tfocusable=\"false\"\n\t\t\tpreserveAspectRatio=\"xMidYMid meet\"\n\t\t\taria-label={this.effectiveAccessibleName}\n\t\t\taria-hidden={this.effectiveAriaHidden}\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\tonKeyDown={this._onkeydown}\n\t\t\tonKeyUp={this._onkeyup}\n\t\t>\n\t\t\t{ this.hasIconTooltip &&\n <title id={`${this._id}-tooltip`} > {this.effectiveAccessibleName} </title>\n\t\t\t}\n\n\t\t\t<g role=\"presentation\">\n\t\t\t\t{ content.call(this) }\n\t\t\t</g>\n\t\t</svg>\n\t);\n}\n\nfunction content(this: Icon) {\n\tif (this.customTemplate) {\n\t\treturn this.customTemplate;\n\t}\n\n\tif (this.customTemplateAsString) {\n\t\treturn <g dangerouslySetInnerHTML={{ __html: this.customTemplateAsString }}></g>;\n\t}\n\n\treturn this.pathData.map(path => (\n\t\t<path d={path}></path>\n\t));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IconTemplate.js","sourceRoot":"","sources":["../src/IconTemplate.tsx"],"names":[],"mappings":";AAEA,MAAM,CAAC,OAAO,UAAU,YAAY;IACnC,OAAO,CACN,eACC,KAAK,EAAC,eAAe,EACrB,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,GAAG,EAAE,IAAI,CAAC,IAAI,EACd,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,IAAI,EAAE,IAAI,CAAC,uBAAuB,EAClC,SAAS,EAAC,OAAO,EACjB,mBAAmB,EAAC,eAAe,gBACvB,IAAI,CAAC,uBAAuB,iBAC3B,IAAI,CAAC,mBAAmB,EACrC,KAAK,EAAC,4BAA4B,EAClC,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,OAAO,EAAE,IAAI,CAAC,QAAQ,aAEpB,IAAI,CAAC,cAAc;gBACR,iBAAO,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,UAAU,kBAAK,IAAI,CAAC,uBAAuB,SAAU,EAGxF,YAAG,IAAI,EAAC,cAAc,YACnB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GACjB,IACC,CACN,CAAC;AACH,CAAC;AAED,SAAS,OAAO;IACf,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;IAED,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACjC,OAAO,YAAG,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,sBAAsB,EAAE,GAAM,CAAC;IAClF,CAAC;IAED,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAChC,eAAM,CAAC,EAAE,IAAI,GAAS,CACtB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type Icon from \"./Icon.js\";\n\nexport default function IconTemplate(this: Icon) {\n\treturn (\n\t\t<svg\n\t\t\tclass=\"ui5-icon-root\"\n\t\t\tpart=\"root\"\n\t\t\ttabindex={this._tabIndex}\n\t\t\tdir={this._dir}\n\t\t\tviewBox={this.viewBox}\n\t\t\trole={this.effectiveAccessibleRole}\n\t\t\tfocusable=\"false\"\n\t\t\tpreserveAspectRatio=\"xMidYMid meet\"\n\t\t\taria-label={this.effectiveAccessibleName}\n\t\t\taria-hidden={this.effectiveAriaHidden}\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\tonKeyDown={this._onkeydown}\n\t\t\tonKeyUp={this._onkeyup}\n\t\t\tonClick={this._onclick}\n\t\t>\n\t\t\t{ this.hasIconTooltip &&\n <title id={`${this._id}-tooltip`} > {this.effectiveAccessibleName} </title>\n\t\t\t}\n\n\t\t\t<g role=\"presentation\">\n\t\t\t\t{ content.call(this) }\n\t\t\t</g>\n\t\t</svg>\n\t);\n}\n\nfunction content(this: Icon) {\n\tif (this.customTemplate) {\n\t\treturn this.customTemplate;\n\t}\n\n\tif (this.customTemplateAsString) {\n\t\treturn <g dangerouslySetInnerHTML={{ __html: this.customTemplateAsString }}></g>;\n\t}\n\n\treturn this.pathData.map(path => (\n\t\t<path d={path}></path>\n\t));\n}\n"]}
|
package/dist/Input.d.ts
CHANGED
|
@@ -366,6 +366,7 @@ declare class Input extends UI5Element implements SuggestionComponent, IFormInpu
|
|
|
366
366
|
_clearIconClicked?: boolean;
|
|
367
367
|
_focusedAfterClear: boolean;
|
|
368
368
|
_changeToBeFired?: boolean;
|
|
369
|
+
_matchedSuggestionItem?: IInputSuggestionItemSelectable;
|
|
369
370
|
_performTextSelection?: boolean;
|
|
370
371
|
_isLatestValueFromSuggestions: boolean;
|
|
371
372
|
_isChangeTriggeredBySuggestion: boolean;
|
|
@@ -392,7 +393,7 @@ declare class Input extends UI5Element implements SuggestionComponent, IFormInpu
|
|
|
392
393
|
_isGroupItem(item: IInputSuggestionItem): boolean;
|
|
393
394
|
onBeforeRendering(): void;
|
|
394
395
|
onAfterRendering(): void;
|
|
395
|
-
|
|
396
|
+
_adjustSelectionRange(): void;
|
|
396
397
|
_onkeydown(e: KeyboardEvent): void;
|
|
397
398
|
_onkeyup(e: KeyboardEvent): void;
|
|
398
399
|
get currentItemIndex(): number;
|
package/dist/Input.js
CHANGED
|
@@ -340,10 +340,12 @@ let Input = Input_1 = class Input extends UI5Element {
|
|
|
340
340
|
}
|
|
341
341
|
this._selectMatchingItem(item);
|
|
342
342
|
}
|
|
343
|
+
else {
|
|
344
|
+
this._matchedSuggestionItem = undefined;
|
|
345
|
+
}
|
|
343
346
|
}
|
|
344
347
|
}
|
|
345
348
|
onAfterRendering() {
|
|
346
|
-
const innerInput = this.getInputDOMRefSync();
|
|
347
349
|
if (this.showSuggestions && this.Suggestions?._getPicker()) {
|
|
348
350
|
this._listWidth = this.Suggestions._getListWidth();
|
|
349
351
|
// disabled ItemNavigation from the list since we are not using it
|
|
@@ -356,14 +358,7 @@ let Input = Input_1 = class Input extends UI5Element {
|
|
|
356
358
|
// innerInput.value = this._innerValue;
|
|
357
359
|
// }
|
|
358
360
|
if (this.typedInValue.length && this.value.length) {
|
|
359
|
-
|
|
360
|
-
// Example: "e" → "Belgium" (item does not start with typed value, so select all).
|
|
361
|
-
if (this.filter === InputSuggestionsFilter.Contains) {
|
|
362
|
-
this._adjustContainsSelectionRange();
|
|
363
|
-
}
|
|
364
|
-
else {
|
|
365
|
-
innerInput.setSelectionRange(this.typedInValue.length, this.value.length);
|
|
366
|
-
}
|
|
361
|
+
this._adjustSelectionRange();
|
|
367
362
|
}
|
|
368
363
|
this.fireDecoratorEvent("type-ahead");
|
|
369
364
|
}
|
|
@@ -374,7 +369,7 @@ let Input = Input_1 = class Input extends UI5Element {
|
|
|
374
369
|
this._valueStateLinks = this.linksInAriaValueStateHiddenText;
|
|
375
370
|
}
|
|
376
371
|
}
|
|
377
|
-
|
|
372
|
+
_adjustSelectionRange() {
|
|
378
373
|
const innerInput = this.getInputDOMRefSync();
|
|
379
374
|
const visibleItems = this.Suggestions?._getItems().filter(item => !item.hidden);
|
|
380
375
|
const currentItem = visibleItems?.find(item => { return item.selected || item.focused; });
|
|
@@ -388,6 +383,10 @@ let Input = Input_1 = class Input extends UI5Element {
|
|
|
388
383
|
innerInput.setSelectionRange(0, this.value.length);
|
|
389
384
|
}
|
|
390
385
|
}
|
|
386
|
+
else {
|
|
387
|
+
// No current item selected (e.g., during typing) - use default typeahead selection
|
|
388
|
+
innerInput.setSelectionRange(this.typedInValue.length, this.value.length);
|
|
389
|
+
}
|
|
391
390
|
}
|
|
392
391
|
_onkeydown(e) {
|
|
393
392
|
this._isKeyNavigation = true;
|
|
@@ -527,9 +526,12 @@ let Input = Input_1 = class Input extends UI5Element {
|
|
|
527
526
|
// if a group item is focused, this is false
|
|
528
527
|
const suggestionItemPressed = !!(this.Suggestions?.onEnter(e));
|
|
529
528
|
const innerInput = this.getInputDOMRefSync();
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
529
|
+
let matchingItem = this._matchedSuggestionItem;
|
|
530
|
+
if (!matchingItem) {
|
|
531
|
+
matchingItem = this._selectableItems.find(item => {
|
|
532
|
+
return item.text?.toLowerCase() === this.value.toLowerCase();
|
|
533
|
+
});
|
|
534
|
+
}
|
|
533
535
|
if (matchingItem) {
|
|
534
536
|
const itemText = matchingItem.text || "";
|
|
535
537
|
innerInput.setSelectionRange(itemText.length, itemText.length);
|
|
@@ -580,6 +582,7 @@ let Input = Input_1 = class Input extends UI5Element {
|
|
|
580
582
|
const innerInput = this.getInputDOMRefSync();
|
|
581
583
|
const isAutoCompleted = innerInput.selectionEnd - innerInput.selectionStart > 0;
|
|
582
584
|
this.isTyping = false;
|
|
585
|
+
this._matchedSuggestionItem = undefined;
|
|
583
586
|
if (this.value !== this.previousValue && this.value !== this.lastConfirmedValue && !this.open) {
|
|
584
587
|
this.value = this.lastConfirmedValue ? this.lastConfirmedValue : this.previousValue;
|
|
585
588
|
this.fireDecoratorEvent(INPUT_EVENTS.INPUT, { inputType: "" });
|
|
@@ -762,6 +765,7 @@ let Input = Input_1 = class Input extends UI5Element {
|
|
|
762
765
|
}
|
|
763
766
|
_selectMatchingItem(item) {
|
|
764
767
|
item.selected = true;
|
|
768
|
+
this._matchedSuggestionItem = item;
|
|
765
769
|
}
|
|
766
770
|
_filterItems(value) {
|
|
767
771
|
let matchingItems = [];
|
|
@@ -806,8 +810,12 @@ let Input = Input_1 = class Input extends UI5Element {
|
|
|
806
810
|
});
|
|
807
811
|
}
|
|
808
812
|
_handleTypeAhead(item) {
|
|
809
|
-
const
|
|
810
|
-
|
|
813
|
+
const suggestionText = item.text ? item.text : "";
|
|
814
|
+
const typedValue = this.typedInValue;
|
|
815
|
+
// Preserve the user's typed input case during typing
|
|
816
|
+
if (suggestionText.toLowerCase().startsWith(typedValue.toLowerCase())) {
|
|
817
|
+
this.value = typedValue + suggestionText.substring(typedValue.length);
|
|
818
|
+
}
|
|
811
819
|
this._performTextSelection = true;
|
|
812
820
|
this._shouldAutocomplete = false;
|
|
813
821
|
}
|
|
@@ -935,7 +943,16 @@ let Input = Input_1 = class Input extends UI5Element {
|
|
|
935
943
|
if (this._isGroupItem(item)) {
|
|
936
944
|
return;
|
|
937
945
|
}
|
|
938
|
-
|
|
946
|
+
let originalItem = item;
|
|
947
|
+
if (this._matchedSuggestionItem) {
|
|
948
|
+
const matchedText = this._matchedSuggestionItem.text?.toLowerCase() || "";
|
|
949
|
+
const itemText = item.text?.toLowerCase() || "";
|
|
950
|
+
// Only use matched item if keyboard navigation or if it's the same item (case-insensitive)
|
|
951
|
+
if (keyboardUsed || matchedText === itemText) {
|
|
952
|
+
originalItem = this._matchedSuggestionItem;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
const itemText = originalItem.text || "";
|
|
939
956
|
const fireChange = keyboardUsed
|
|
940
957
|
? this.valueBeforeItemSelection !== itemText : this.previousValue !== itemText;
|
|
941
958
|
this.hasSuggestionItemSelected = true;
|
|
@@ -951,6 +968,7 @@ let Input = Input_1 = class Input extends UI5Element {
|
|
|
951
968
|
this.previousValue = this.value;
|
|
952
969
|
}
|
|
953
970
|
this.valueBeforeSelectionStart = "";
|
|
971
|
+
this._matchedSuggestionItem = undefined;
|
|
954
972
|
this.isTyping = false;
|
|
955
973
|
this.open = false;
|
|
956
974
|
}
|
|
@@ -962,6 +980,10 @@ let Input = Input_1 = class Input extends UI5Element {
|
|
|
962
980
|
const itemValue = this._isGroupItem(item) ? this.valueBeforeSelectionStart : item.text;
|
|
963
981
|
this.value = itemValue || "";
|
|
964
982
|
this._performTextSelection = true;
|
|
983
|
+
// Update the matched item when navigating with arrows to preserve correct case on Enter
|
|
984
|
+
if (!this._isGroupItem(item)) {
|
|
985
|
+
this._matchedSuggestionItem = item;
|
|
986
|
+
}
|
|
965
987
|
}
|
|
966
988
|
fireEventByAction(action, e) {
|
|
967
989
|
const valueBeforeInput = this.value;
|