@sapudex/web-components 2.13.0 → 2.15.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/cypress/specs/Breadcrumbs.cy.tsx +77 -0
- package/cypress/specs/EventRibbon.cy.tsx +9 -1
- package/cypress/specs/FilterMenu.cy.tsx +36 -44
- package/cypress/specs/InputGroup.cy.tsx +47 -0
- package/cypress/specs/SelectBox.cy.tsx +17 -0
- package/cypress/specs/SocialMediaButton.cy.tsx +6 -0
- package/cypress/support/component-imports.instrumented.ts +4 -0
- package/cypress/support/component-imports.src.ts +4 -0
- package/dist/Accordion.d.ts +4 -3
- package/dist/Accordion.js.map +1 -1
- package/dist/AccordionItem.js.map +1 -1
- package/dist/Breadcrumbs.d.ts +4 -1
- package/dist/Breadcrumbs.js +10 -9
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/BreadcrumbsItem.d.ts +1 -2
- package/dist/BreadcrumbsItem.js.map +1 -1
- package/dist/BreadcrumbsPopoverTemplate.d.ts +2 -0
- package/dist/BreadcrumbsPopoverTemplate.js +8 -0
- package/dist/BreadcrumbsPopoverTemplate.js.map +1 -0
- package/dist/BreadcrumbsTemplate.d.ts +2 -0
- package/dist/BreadcrumbsTemplate.js +10 -0
- package/dist/BreadcrumbsTemplate.js.map +1 -0
- package/dist/Checkbox.js +1 -1
- package/dist/Checkbox.js.map +1 -1
- package/dist/ContactItem.d.ts +1 -0
- package/dist/ContactItem.js.map +1 -1
- package/dist/ControlButton.js +3 -3
- package/dist/ControlButton.js.map +1 -1
- package/dist/CountrySelector.d.ts +1 -0
- package/dist/CountrySelector.js +1 -1
- package/dist/CountrySelector.js.map +1 -1
- package/dist/DatePicker.d.ts +3 -2
- package/dist/DatePicker.js.map +1 -1
- package/dist/Dropdown.js.map +1 -1
- package/dist/EventRibbon.js +1 -1
- package/dist/EventRibbon.js.map +1 -1
- package/dist/EventRibbonTemplate.js +2 -2
- package/dist/EventRibbonTemplate.js.map +1 -1
- package/dist/FilterMenu.d.ts +11 -5
- package/dist/FilterMenu.js +8 -2
- package/dist/FilterMenu.js.map +1 -1
- package/dist/FilterMenuGroupHeader.js.map +1 -1
- package/dist/FilterMenuItem.js.map +1 -1
- package/dist/FilterMenuSelectAll.d.ts +0 -1
- package/dist/FilterMenuSelectAll.js +0 -3
- package/dist/FilterMenuSelectAll.js.map +1 -1
- package/dist/Footer.d.ts +1 -0
- package/dist/Footer.js.map +1 -1
- package/dist/HeroBanner.js.map +1 -1
- package/dist/InputGroup.d.ts +0 -1
- package/dist/InputGroup.js +3 -6
- package/dist/InputGroup.js.map +1 -1
- package/dist/InputGroupTemplate.d.ts +2 -0
- package/dist/InputGroupTemplate.js +7 -0
- package/dist/InputGroupTemplate.js.map +1 -0
- package/dist/LinkList.js.map +1 -1
- package/dist/LinkListItem.d.ts +1 -0
- package/dist/LinkListItem.js.map +1 -1
- package/dist/List.d.ts +1 -0
- package/dist/List.js +1 -1
- package/dist/List.js.map +1 -1
- package/dist/ListGroupHeader.d.ts +1 -0
- package/dist/ListGroupHeader.js.map +1 -1
- package/dist/ListGroupHeaderBase.js.map +1 -1
- package/dist/ListItem.d.ts +1 -0
- package/dist/ListItem.js +1 -1
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItemBase.d.ts +5 -4
- package/dist/ListItemBase.js.map +1 -1
- package/dist/ListSelectAll.d.ts +1 -0
- package/dist/ListSelectAll.js.map +1 -1
- package/dist/MastheadCountrySelector.d.ts +10 -9
- package/dist/MastheadCountrySelector.js.map +1 -1
- package/dist/MastheadItem.d.ts +2 -1
- package/dist/MastheadItem.js.map +1 -1
- package/dist/MastheadMenu.d.ts +1 -0
- package/dist/MastheadMenu.js.map +1 -1
- package/dist/MastheadMenuItem.js.map +1 -1
- package/dist/MastheadMobileMenu.d.ts +1 -0
- package/dist/MastheadMobileMenu.js +1 -1
- package/dist/MastheadMobileMenu.js.map +1 -1
- package/dist/MastheadProfileMenu.d.ts +4 -3
- package/dist/MastheadProfileMenu.js +2 -2
- package/dist/MastheadProfileMenu.js.map +1 -1
- package/dist/MastheadShell.d.ts +12 -11
- package/dist/MastheadShell.js.map +1 -1
- package/dist/MediaPlayer.d.ts +2 -1
- package/dist/MediaPlayer.js.map +1 -1
- package/dist/MediaPlayerVimeo.d.ts +1 -0
- package/dist/MediaPlayerVimeo.js.map +1 -1
- package/dist/MediaPlayerYoutube.d.ts +1 -0
- package/dist/MediaPlayerYoutube.js.map +1 -1
- package/dist/Pagination.d.ts +3 -2
- package/dist/Pagination.js.map +1 -1
- package/dist/RatingIndicator.js.map +1 -1
- package/dist/Search.d.ts +11 -5
- package/dist/Search.js +9 -8
- package/dist/Search.js.map +1 -1
- package/dist/SearchableListBase.d.ts +7 -5
- package/dist/SearchableListBase.js +13 -23
- package/dist/SearchableListBase.js.map +1 -1
- package/dist/SecondaryNavigation.d.ts +1 -0
- package/dist/SecondaryNavigation.js.map +1 -1
- package/dist/SecondaryNavigationItem.d.ts +3 -2
- package/dist/SecondaryNavigationItem.js.map +1 -1
- package/dist/SecondaryNavigationItemBase.js.map +1 -1
- package/dist/SecondaryNavigationSubItem.d.ts +3 -2
- package/dist/SecondaryNavigationSubItem.js.map +1 -1
- package/dist/SelectBox.d.ts +6 -0
- package/dist/SelectBox.js +8 -2
- package/dist/SelectBox.js.map +1 -1
- package/dist/SelectBoxGroupHeader.js.map +1 -1
- package/dist/SideNavigationMobile.d.ts +1 -1
- package/dist/SideNavigationMobile.js.map +1 -1
- package/dist/SocialMediaButton.d.ts +8 -0
- package/dist/SocialMediaButton.js +10 -1
- package/dist/SocialMediaButton.js.map +1 -1
- package/dist/SocialMediaButtonTemplate.js +1 -1
- package/dist/SocialMediaButtonTemplate.js.map +1 -1
- package/dist/StepInput.d.ts +3 -2
- package/dist/StepInput.js.map +1 -1
- package/dist/StepInputTemplate.js +1 -1
- package/dist/StepInputTemplate.js.map +1 -1
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.d.ts +1 -2
- package/dist/Tab.js.map +1 -1
- package/dist/TabNavigation.d.ts +1 -0
- package/dist/TabNavigation.js.map +1 -1
- package/dist/Table.d.ts +2 -2
- package/dist/Table.js.map +1 -1
- package/dist/TableCellBase.js.map +1 -1
- package/dist/TableRowBase.js.map +1 -1
- package/dist/Tag.d.ts +1 -0
- package/dist/Tag.js.map +1 -1
- package/dist/TagGroup.d.ts +1 -0
- package/dist/TagGroup.js.map +1 -1
- package/dist/TextField.d.ts +2 -1
- package/dist/TextField.js.map +1 -1
- package/dist/Tile.d.ts +2 -0
- package/dist/Tile.js.map +1 -1
- package/dist/Tooltip.d.ts +11 -0
- package/dist/Tooltip.js +42 -0
- package/dist/Tooltip.js.map +1 -1
- package/dist/TruncatedText.d.ts +0 -1
- package/dist/TruncatedText.js +5 -6
- package/dist/TruncatedText.js.map +1 -1
- package/dist/TruncatedTextTemplate.d.ts +2 -0
- package/dist/TruncatedTextTemplate.js +9 -0
- package/dist/TruncatedTextTemplate.js.map +1 -0
- package/dist/Upload.d.ts +1 -0
- package/dist/Upload.js.map +1 -1
- package/dist/UploadItem.js +1 -1
- package/dist/UploadItem.js.map +1 -1
- package/dist/Wizard.d.ts +2 -2
- package/dist/Wizard.js.map +1 -1
- package/dist/WizardTab.js +1 -1
- package/dist/WizardTab.js.map +1 -1
- package/dist/assets/{InputSuggestions-FI3fjOZ9.js → InputSuggestions-D5z6eIC2.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-CkvW90wq.js → ListItemStandardExpandableTextTemplate-BKeYxhnX.js} +1 -1
- package/dist/assets/{bundle.esm-BrqOd5tw.js → bundle.esm-DXwtYGLH.js} +210 -210
- package/dist/css/themes/EventRibbon.css +1 -1
- package/dist/css/themes/MediaPlayer.css +1 -1
- package/dist/css/themes/RatingIndicator.css +1 -1
- package/dist/css/themes/Slider.css +1 -1
- package/dist/css/themes/SocialMediaButton.css +1 -1
- package/dist/custom-elements-internal.json +247 -136
- package/dist/custom-elements.json +201 -121
- package/dist/generated/templates/TooltipTemplate.lit.js +1 -1
- package/dist/generated/templates/TooltipTemplate.lit.js.map +1 -1
- package/dist/generated/themes/EventRibbon.css.d.ts +1 -1
- package/dist/generated/themes/EventRibbon.css.js +1 -1
- package/dist/generated/themes/EventRibbon.css.js.map +1 -1
- package/dist/generated/themes/MediaPlayer.css.d.ts +1 -1
- package/dist/generated/themes/MediaPlayer.css.js +1 -1
- package/dist/generated/themes/MediaPlayer.css.js.map +1 -1
- package/dist/generated/themes/RatingIndicator.css.d.ts +1 -1
- package/dist/generated/themes/RatingIndicator.css.js +1 -1
- package/dist/generated/themes/RatingIndicator.css.js.map +1 -1
- package/dist/generated/themes/Slider.css.d.ts +1 -1
- package/dist/generated/themes/Slider.css.js +1 -1
- package/dist/generated/themes/Slider.css.js.map +1 -1
- package/dist/generated/themes/SocialMediaButton.css.d.ts +1 -1
- package/dist/generated/themes/SocialMediaButton.css.js +1 -1
- package/dist/generated/themes/SocialMediaButton.css.js.map +1 -1
- package/dist/utils/sanitizeString.d.ts +2 -0
- package/dist/utils/sanitizeString.js +12 -0
- package/dist/utils/sanitizeString.js.map +1 -0
- package/dist/vscode.html-custom-data.json +4 -4
- package/dist/web-types.json +48 -8
- package/package.json +2 -2
- package/src/Accordion.ts +5 -4
- package/src/AccordionItem.ts +1 -0
- package/src/Breadcrumbs.ts +16 -17
- package/src/BreadcrumbsItem.ts +2 -2
- package/src/BreadcrumbsPopoverTemplate.tsx +60 -0
- package/src/BreadcrumbsTemplate.tsx +53 -0
- package/src/Checkbox.ts +3 -2
- package/src/ContactItem.ts +1 -0
- package/src/ControlButton.ts +3 -3
- package/src/CountrySelector.ts +2 -5
- package/src/DatePicker.ts +3 -2
- package/src/Dropdown.ts +0 -1
- package/src/EventRibbon.ts +1 -1
- package/src/EventRibbonTemplate.tsx +4 -6
- package/src/FilterMenu.ts +17 -9
- package/src/FilterMenuGroupHeader.ts +0 -1
- package/src/FilterMenuItem.ts +1 -0
- package/src/FilterMenuSelectAll.ts +0 -4
- package/src/Footer.ts +1 -0
- package/src/HeroBanner.ts +0 -1
- package/src/InputGroup.ts +3 -8
- package/src/InputGroupTemplate.tsx +31 -0
- package/src/LinkList.ts +1 -0
- package/src/LinkListItem.ts +1 -0
- package/src/List.ts +3 -8
- package/src/ListGroupHeader.ts +1 -0
- package/src/ListGroupHeaderBase.ts +0 -1
- package/src/ListItem.ts +2 -3
- package/src/ListItemBase.ts +6 -6
- package/src/ListSelectAll.ts +1 -0
- package/src/MastheadCountrySelector.ts +12 -11
- package/src/MastheadItem.ts +2 -1
- package/src/MastheadMenu.ts +1 -0
- package/src/MastheadMenuItem.ts +1 -0
- package/src/MastheadMobileMenu.ts +2 -1
- package/src/MastheadProfileMenu.ts +7 -5
- package/src/MastheadShell.ts +14 -12
- package/src/MediaPlayer.ts +2 -2
- package/src/MediaPlayerVimeo.ts +1 -0
- package/src/MediaPlayerYoutube.ts +1 -0
- package/src/Pagination.ts +3 -2
- package/src/RatingIndicator.ts +0 -1
- package/src/Search.ts +17 -19
- package/src/SearchableListBase.ts +23 -31
- package/src/SecondaryNavigation.ts +1 -0
- package/src/SecondaryNavigationItem.ts +4 -11
- package/src/SecondaryNavigationItemBase.ts +0 -1
- package/src/SecondaryNavigationSubItem.ts +3 -2
- package/src/SelectBox.ts +11 -14
- package/src/SelectBoxGroupHeader.ts +0 -1
- package/src/SideNavigationMobile.ts +1 -1
- package/src/SocialMediaButton.ts +17 -1
- package/src/SocialMediaButtonTemplate.tsx +3 -1
- package/src/StepInput.ts +4 -14
- package/src/StepInputTemplate.tsx +1 -1
- package/src/Switch.ts +0 -1
- package/src/Tab.ts +1 -2
- package/src/TabNavigation.ts +5 -14
- package/src/Table.ts +2 -2
- package/src/TableCellBase.ts +0 -1
- package/src/TableRowBase.ts +0 -1
- package/src/Tag.ts +1 -0
- package/src/TagGroup.ts +1 -0
- package/src/TextField.ts +2 -1
- package/src/Tile.ts +3 -1
- package/src/Tooltip.hbs +5 -1
- package/src/Tooltip.ts +52 -0
- package/src/TruncatedText.ts +8 -14
- package/src/TruncatedTextTemplate.tsx +21 -0
- package/src/Upload.ts +1 -0
- package/src/UploadItem.ts +1 -4
- package/src/Wizard.ts +2 -2
- package/src/WizardTab.ts +1 -1
- package/src/generated/templates/TooltipTemplate.lit.ts +1 -1
- package/src/generated/themes/EventRibbon.css.ts +1 -1
- package/src/generated/themes/MediaPlayer.css.ts +1 -1
- package/src/generated/themes/RatingIndicator.css.ts +1 -1
- package/src/generated/themes/Slider.css.ts +1 -1
- package/src/generated/themes/SocialMediaButton.css.ts +1 -1
- package/src/themes/EventRibbon.css +3 -3
- package/src/themes/MediaPlayer.css +133 -186
- package/src/themes/SocialMediaButton.css +4 -1
- package/src/utils/sanitizeString.ts +13 -0
- package/dist/generated/templates/BreadcrumbsPopoverTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/BreadcrumbsPopoverTemplate.lit.js +0 -12
- package/dist/generated/templates/BreadcrumbsPopoverTemplate.lit.js.map +0 -1
- package/dist/generated/templates/BreadcrumbsTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/BreadcrumbsTemplate.lit.js +0 -14
- package/dist/generated/templates/BreadcrumbsTemplate.lit.js.map +0 -1
- package/dist/generated/templates/InputGroupTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/InputGroupTemplate.lit.js +0 -9
- package/dist/generated/templates/InputGroupTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TruncatedTextTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TruncatedTextTemplate.lit.js +0 -7
- package/dist/generated/templates/TruncatedTextTemplate.lit.js.map +0 -1
- package/src/Breadcrumbs.hbs +0 -38
- package/src/BreadcrumbsPopover.hbs +0 -48
- package/src/InputGroup.hbs +0 -20
- package/src/TruncatedText.hbs +0 -11
- package/src/generated/templates/BreadcrumbsPopoverTemplate.lit.ts +0 -16
- package/src/generated/templates/BreadcrumbsTemplate.lit.ts +0 -18
- package/src/generated/templates/InputGroupTemplate.lit.ts +0 -13
- package/src/generated/templates/TruncatedTextTemplate.lit.ts +0 -11
package/dist/TextField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../src/TextField.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,iCAAiC,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+DAA+D,CAAC;AAC7G,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,GACV,MAAM,mCAAmC,CAAC;AAC3C,OAAO,iBAAiB,MAAM,oBAAoB,CAAC;AACnD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,iBAAiB,MAAM,oBAAoB,CAAC;AAEnD,WAAW;AACX,OAAO,iBAAiB,MAAM,gDAAgD,CAAC;AAE/E,SAAS;AACT,OAAO,YAAY,MAAM,qCAAqC,CAAC;AAc/D;;;;;;;GAOG;AAkCH,IAAM,aAAa,qBAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAOE,0BAAqB,GAAG,+BAA+B,CAAC;QAaxD;;;;;;;;;WASG;QAED,UAAK,GAAW,EAAE,CAAC;QA8BrB;;;;WAIG;QAED,sBAAiB,GAAW,EAAE,CAAC;QAEjC;;;;;WAKG;QAED,uBAAkB,GAAW,EAAE,CAAC;QAmClC;;;;;WAKG;QAED,eAAU,GAAwB,cAAc,CAAC,QAAQ,CAAC;QAsC5D;;;;WAIG;QAED,iBAAY,GAAW,KAAK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omponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport Icon from \"@ui5/webcomponents/dist/Icon.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { getAllAccessibleNameRefTexts } from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport {\n VALUE_STATE_SUCCESS,\n VALUE_STATE_INFORMATION,\n VALUE_STATE_WARNING,\n VALUE_STATE_ERROR,\n READ_ONLY,\n} from \"./generated/i18n/i18n-defaults.js\";\nimport UDExControlButton from \"./ControlButton.js\";\nimport UDExValueState from \"./types/common.js\";\nimport UDExStatusMessage from \"./StatusMessage.js\";\n\n// Template\nimport TextFieldTemplate from \"./generated/templates/TextFieldTemplate.lit.js\";\n\n// Styles\nimport TextFieldCss from \"./generated/themes/TextField.css.js\";\n\nexport type AccInfo = {\n ariaInvalid?: string;\n ariaDescribedBy?: string;\n ariaLabelledBy?: string;\n ariaLabel?: string;\n ariaHasPopup?: string,\n}\n\nexport type UDExTextFieldKeydownEventDetail = {\n keyboardEvent: KeyboardEvent;\n}\n\n/**\n * @class\n *\n * @constructor\n * @extends UI5Element\n * @tagname udex-text-field\n * @public\n */\n@customElement({\n tag: \"udex-text-field\",\n renderer: litRender,\n styles: TextFieldCss,\n template: TextFieldTemplate,\n dependencies: [UDExControlButton, Icon, UDExStatusMessage],\n})\n\n/**\n * Fired when the value of the component changes at each keystroke.\n *\n * @public\n */\n@event(\"input\", { bubbles: true })\n/**\n * Fired when the input operation has finished by pressing Enter or on focusout.\n *\n * @public\n */\n@event(\"change\", { bubbles: true })\n/**\n * Fired event when the user clicks the icon.\n *\n * @private\n */\n@event(\"click-icon\", { bubbles: true })\n\n/**\n * Fired event when the key is pressed in the input.\n *\n * @private\n */\n@event(\"keydown\", { bubbles: true })\nclass UDExTextField extends UI5Element {\n eventDetails!: {\n \"keydown\": UDExTextFieldKeydownEventDetail,\n \"input\": void,\n \"change\": void,\n \"click-icon\": void,\n };\n _labelActiveClassName = \"udex-text-field__label_active\";\n\n /**\n * Defines whether the component is in disabled state.\n * <br><br>\n * <b>Note:</b> A disabled component is completely noninteractive.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n disabled!: boolean;\n\n /**\n * Defines the value of the component.\n * <br><br>\n * <b>Note:</b> The property is updated upon typing.\n *\n * @default \"\"\n * @formEvents input\n * @formProperty\n * @public\n */\n @property({ type: String })\n value: string = \"\";\n\n /**\n * Sets the maximum number of characters available in the input field.\n * <br><br>\n * <b>Note:</b> This property is not compatible with the ui5-input type InputType.Number. If the ui5-input type is set to Number, the maxlength value is ignored.\n *\n * @public\n */\n @property({ type: Number })\n maxlength?: number;\n\n /**\n * Defines label text for the input field.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n label!: string;\n\n /**\n * Defines the accessible ARIA name of the component.\n *\n * @default \"\"\n * @public\n */\n @property()\n accessibleName!: string;\n\n /**\n * Receives id (or many ids) of the elements that label the component.\n * @default \"\"\n * @public\n */\n @property()\n accessibleNameRef: string = \"\";\n\n /**\n * Defines the accessible ARIA name of the component.\n *\n * @default \"\"\n * @public\n */\n @property()\n accessibleIconName: string = \"\";\n\n /**\n * Defines whether the component is read-only.\n * <br><br>\n * <b>Note:</b> A read-only component is not editable,\n * but still provides visual feedback upon user interaction.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n readonly!: boolean;\n\n /**\n * Defines whether the component is display-only.\n * <br><br>\n * <b>Note:</b> A display-only component is not editable,\n * but still provides visual feedback upon user interaction, input border is not visible.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n displayonly!: boolean;\n\n /**\n * Defines whether the component is required.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n required!: boolean;\n\n /**\n * Defines the value state of the component.\n *\n * @default \"Standard\"\n * @public\n */\n @property()\n valueState: `${UDExValueState}` = UDExValueState.Standard;\n\n /**\n * Defines supporting text under the input field.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n supportingText!: string;\n\n /**\n * Defines the icon name in the text-field.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n icon!: string;\n\n /**\n * Defines if the text-field is active\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n active!: boolean;\n\n /**\n * Defines if dropdown associated with text-field trigger has opened dropdown. It indicates active state of control button.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n iconActive!: boolean;\n\n /**\n * Defines the behaviour of autocomplete.\n * @default \"off\"\n * @public\n */\n @property({ type: String })\n autocomplete: string = \"off\";\n\n /**\n * Defines the inner stored show password button tooltip.\n *\n * @default \"\"\n * @private\n */\n\n @property({ type: String })\n showButtonTooltip: string = \"\";\n\n /**\n * Defines the inner stored class of the label.\n *\n * @default \"\"\n * @private\n */\n @property({ type: String, noAttribute: true })\n labelActiveClass: string = \"\";\n\n /**\n * Defines the inner stored value of the readonly attribute of the input.\n *\n * @default false\n * @private\n */\n @property({ type: Boolean, noAttribute: true })\n isInputReadonly!: boolean;\n\n /**\n * Defines the inner stored value of the classes of the label.\n *\n * @default \"\"\n * @private\n */\n @property({ type: String, noAttribute: true })\n labelClasses: string = \"\";\n\n /**\n * Defines the inner stored value of the classes of the label.\n *\n * @default \"text\"\n * @private\n */\n @property({ type: String })\n type: \"Text\" | \"Email\" | \"Number\" | \"Password\" | \"Tel\" | \"URL\" | \"Search\" = \"Text\";\n\n /**\n * Defines direction of the input.\n *\n * @public\n */\n @property({ type: String, noAttribute: true })\n direction?: string;\n\n /**\n * Defines the max value for the \"number\" type of the input.\n */\n @property({ type: Number })\n max?: number;\n\n /**\n * Defines the min value for the \"number\" type of the input.\n */\n @property({ type: Number })\n min?: number;\n\n /**\n * Defines the step for the \"number\" type of the input.\n * @default undefined\n */\n @property({ type: Number })\n step?: number;\n\n /**\n * Allows setting the aria-describedby property on the internal input node.\n *\n * @default \"\"\n * @public\n */\n @property()\n ariaDescribedBy?: string;\n\n /**\n * Defines the aria-has-popup attribute of the input.\n * @private\n */\n @property({ type: String })\n _ariaHasPopup?: string;\n\n /**\n * Defines is it the touch of the input field (only for mobile devices).\n * @default false\n * @private\n */\n @property({ type: Boolean })\n _isTouched!: boolean;\n\n /**\n * Determines Combobox role for the button.\n * @default false\n * @private\n */\n @property({ type: Boolean })\n _isComboboxRole?: boolean;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n onBeforeRendering(): void {\n if ((this.value || this.active) && this.labelActiveClass === \"\") {\n this.labelActiveClass = this._labelActiveClassName;\n } else if (!this.active && !this.value && this.labelActiveClass.length) {\n this.labelActiveClass = \"\";\n }\n\n this.isInputReadonly = this.readonly || this.displayonly;\n\n this.labelClasses = `udex-text-field__label ${this.labelActiveClass}`;\n }\n\n onAfterRendering(): void {\n const directionStyles: string = window\n .getComputedStyle(this)\n .getPropertyValue(\"direction\");\n\n if (!directionStyles) {\n this.direction = \"ltr\";\n } else {\n this.direction = directionStyles;\n }\n }\n\n handleKeydown(e: KeyboardEvent): void {\n e.stopPropagation();\n this.fireDecoratorEvent(\"keydown\", { keyboardEvent: e });\n }\n\n handleChange = (): void => {\n this.fireDecoratorEvent(\"change\");\n };\n\n handleInput = (inputEvent: InputEvent) => {\n this.value = (inputEvent.target as HTMLInputElement)?.value;\n };\n\n handleClick = (): void => {\n if (!isDesktop()) {\n this._isTouched = true;\n }\n };\n\n handleFocus = (): void => {\n if (!this.disabled && !this.readonly && !this.displayonly) {\n this.labelActiveClass = this._labelActiveClassName;\n this.active = true;\n }\n };\n\n handleBlur = (): void => {\n this.active = false;\n\n if (this.value) {\n this.labelActiveClass = this._labelActiveClassName;\n } else {\n this.labelActiveClass = \"\";\n }\n this._isTouched = false;\n };\n\n handleIconClick(): void {\n this.fireDecoratorEvent(\"click-icon\");\n }\n\n get _inputHolder(): HTMLElement {\n return this.shadowRoot!.querySelector<HTMLElement>(\".udex-text-field__wrap\")!;\n }\n\n get valueStateTypeMappings(): Record<string, string> {\n return {\n \"Success\": UDExTextField.i18nBundle.getText(VALUE_STATE_SUCCESS),\n \"Standard\": UDExTextField.i18nBundle.getText(VALUE_STATE_INFORMATION),\n \"Error\": UDExTextField.i18nBundle.getText(VALUE_STATE_ERROR),\n \"Warning\": UDExTextField.i18nBundle.getText(VALUE_STATE_WARNING),\n };\n }\n\n get hasValueState(): boolean {\n return this.valueState !== UDExValueState.Standard;\n }\n\n get valueStateText(): string {\n return this.valueState !== UDExValueState.Standard ? this.valueStateTypeMappings[this.valueState] : \"\";\n }\n\n get readOnlyStateText(): string {\n return UDExTextField.i18nBundle.getText(READ_ONLY);\n }\n\n get ariaDescribedById(): string {\n return `${this.supportingTextId} ${this.valueStateTextId} ${this.readOnlyStateTextId}`.trim();\n }\n\n get supportingTextId(): string {\n return this.supportingText ? `${this._id}-supportingTextDesc` : \"\";\n }\n\n get valueStateTextId(): string {\n return this.hasValueState ? `${this._id}-valueStateDesc` : \"\";\n }\n\n get readOnlyStateTextId(): string {\n return this.readonly ? `${this._id}-stateReadOnlyDesc` : \"\";\n }\n\n get accInfo(): AccInfo {\n return {\n \"ariaInvalid\": this.valueState === UDExValueState.Error ? \"true\" : undefined,\n \"ariaDescribedBy\": this.ariaDescribedBy ? this.ariaDescribedBy : this.ariaDescribedById || undefined,\n \"ariaLabel\": getAllAccessibleNameRefTexts(this) || this.accessibleName || undefined,\n \"ariaHasPopup\": this._ariaHasPopup || undefined,\n };\n }\n\n get inputRole(): string | undefined {\n return this.isAutoCompleteDisabled ? \"presentation\" : undefined;\n }\n\n get isAutoCompleteDisabled(): boolean {\n return this.autocomplete === \"off\" || this.autocomplete === \"new-password\";\n }\n\n get readonlyNotDisabled(): boolean {\n return this.isInputReadonly && !this.disabled;\n }\n\n get buttonAccessibleName(): string {\n return this._isComboboxRole ? this.label : this.accessibleIconName || this.icon;\n }\n\n get buttonAccessibleDescription(): string {\n const label = this._isComboboxRole ? this.value : \"\";\n return `${label} ${this.supportingText || \"\"} ${this.valueStateText}`;\n }\n}\n\nUDExTextField.define();\n\nexport default UDExTextField;\n"]}
|
|
1
|
+
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../src/TextField.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,iCAAiC,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+DAA+D,CAAC;AAC7G,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,GACV,MAAM,mCAAmC,CAAC;AAC3C,OAAO,iBAAiB,MAAM,oBAAoB,CAAC;AACnD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,iBAAiB,MAAM,oBAAoB,CAAC;AAEnD,WAAW;AACX,OAAO,iBAAiB,MAAM,gDAAgD,CAAC;AAE/E,SAAS;AACT,OAAO,YAAY,MAAM,qCAAqC,CAAC;AAc/D;;;;;;;GAOG;AAkCH,IAAM,aAAa,qBAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAOE,0BAAqB,GAAG,+BAA+B,CAAC;QAaxD;;;;;;;;;WASG;QAED,UAAK,GAAW,EAAE,CAAC;QA8BrB;;;;WAIG;QAED,sBAAiB,GAAW,EAAE,CAAC;QAEjC;;;;;WAKG;QAED,u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,aAAa,CAAC,MAAM,EAAE,CAAC;AAEvB,eAAe,aAAa,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport Icon from \"@ui5/webcomponents/dist/Icon.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { getAllAccessibleNameRefTexts } from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport {\n VALUE_STATE_SUCCESS,\n VALUE_STATE_INFORMATION,\n VALUE_STATE_WARNING,\n VALUE_STATE_ERROR,\n READ_ONLY,\n} from \"./generated/i18n/i18n-defaults.js\";\nimport UDExControlButton from \"./ControlButton.js\";\nimport UDExValueState from \"./types/common.js\";\nimport UDExStatusMessage from \"./StatusMessage.js\";\n\n// Template\nimport TextFieldTemplate from \"./generated/templates/TextFieldTemplate.lit.js\";\n\n// Styles\nimport TextFieldCss from \"./generated/themes/TextField.css.js\";\n\nexport type AccInfo = {\n ariaInvalid?: string;\n ariaDescribedBy?: string;\n ariaLabelledBy?: string;\n ariaLabel?: string;\n ariaHasPopup?: string,\n}\n\ntype UDExTextFieldKeydownEventDetail = {\n keyboardEvent: KeyboardEvent;\n}\n\n/**\n * @class\n *\n * @constructor\n * @extends UI5Element\n * @tagname udex-text-field\n * @public\n */\n@customElement({\n tag: \"udex-text-field\",\n renderer: litRender,\n styles: TextFieldCss,\n template: TextFieldTemplate,\n dependencies: [UDExControlButton, Icon, UDExStatusMessage],\n})\n\n/**\n * Fired when the value of the component changes at each keystroke.\n *\n * @public\n */\n@event(\"input\", { bubbles: true })\n/**\n * Fired when the input operation has finished by pressing Enter or on focusout.\n *\n * @public\n */\n@event(\"change\", { bubbles: true })\n/**\n * Fired event when the user clicks the icon.\n *\n * @private\n */\n@event(\"click-icon\", { bubbles: true })\n\n/**\n * Fired event when the key is pressed in the input.\n *\n * @private\n */\n@event(\"keydown\", { bubbles: true })\nclass UDExTextField extends UI5Element {\n eventDetails!: {\n \"keydown\": UDExTextFieldKeydownEventDetail,\n \"input\": void,\n \"change\": void,\n \"click-icon\": void,\n };\n _labelActiveClassName = \"udex-text-field__label_active\";\n\n /**\n * Defines whether the component is in disabled state.\n * <br><br>\n * <b>Note:</b> A disabled component is completely noninteractive.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n disabled!: boolean;\n\n /**\n * Defines the value of the component.\n * <br><br>\n * <b>Note:</b> The property is updated upon typing.\n *\n * @default \"\"\n * @formEvents input\n * @formProperty\n * @public\n */\n @property({ type: String })\n value: string = \"\";\n\n /**\n * Sets the maximum number of characters available in the input field.\n * <br><br>\n * <b>Note:</b> This property is not compatible with the ui5-input type InputType.Number. If the ui5-input type is set to Number, the maxlength value is ignored.\n *\n * @public\n */\n @property({ type: Number })\n maxlength?: number;\n\n /**\n * Defines label text for the input field.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n label!: string;\n\n /**\n * Defines the accessible ARIA name of the component.\n *\n * @default \"\"\n * @public\n */\n @property()\n accessibleName!: string;\n\n /**\n * Receives id (or many ids) of the elements that label the component.\n * @default \"\"\n * @public\n */\n @property()\n accessibleNameRef: string = \"\";\n\n /**\n * Defines the accessible ARIA name of the component.\n *\n * @default \"\"\n * @public\n */\n @property()\n accessibleIconName: string = \"\";\n\n /**\n * Defines whether the component is read-only.\n * <br><br>\n * <b>Note:</b> A read-only component is not editable,\n * but still provides visual feedback upon user interaction.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n readonly!: boolean;\n\n /**\n * Defines whether the component is display-only.\n * <br><br>\n * <b>Note:</b> A display-only component is not editable,\n * but still provides visual feedback upon user interaction, input border is not visible.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n displayonly!: boolean;\n\n /**\n * Defines whether the component is required.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n required!: boolean;\n\n /**\n * Defines the value state of the component.\n *\n * @default \"Standard\"\n * @public\n */\n @property()\n valueState: `${UDExValueState}` = UDExValueState.Standard;\n\n /**\n * Defines supporting text under the input field.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n supportingText!: string;\n\n /**\n * Defines the icon name in the text-field.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n icon!: string;\n\n /**\n * Defines if the text-field is active\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n active!: boolean;\n\n /**\n * Defines if dropdown associated with text-field trigger has opened dropdown. It indicates active state of control button.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n iconActive!: boolean;\n\n /**\n * Defines the behaviour of autocomplete.\n * @default \"off\"\n * @public\n */\n @property({ type: String })\n autocomplete: string = \"off\";\n\n /**\n * Defines the inner stored show password button tooltip.\n *\n * @default \"\"\n * @private\n */\n\n @property({ type: String })\n showButtonTooltip: string = \"\";\n\n /**\n * Defines the inner stored class of the label.\n *\n * @default \"\"\n * @private\n */\n @property({ type: String, noAttribute: true })\n labelActiveClass: string = \"\";\n\n /**\n * Defines the inner stored value of the readonly attribute of the input.\n *\n * @default false\n * @private\n */\n @property({ type: Boolean, noAttribute: true })\n isInputReadonly!: boolean;\n\n /**\n * Defines the inner stored value of the classes of the label.\n *\n * @default \"\"\n * @private\n */\n @property({ type: String, noAttribute: true })\n labelClasses: string = \"\";\n\n /**\n * Defines the inner stored value of the classes of the label.\n *\n * @default \"text\"\n * @private\n */\n @property({ type: String })\n type: \"Text\" | \"Email\" | \"Number\" | \"Password\" | \"Tel\" | \"URL\" | \"Search\" = \"Text\";\n\n /**\n * Defines direction of the input.\n *\n * @public\n */\n @property({ type: String, noAttribute: true })\n direction?: string;\n\n /**\n * Defines the max value for the \"number\" type of the input.\n */\n @property({ type: Number })\n max?: number;\n\n /**\n * Defines the min value for the \"number\" type of the input.\n */\n @property({ type: Number })\n min?: number;\n\n /**\n * Defines the step for the \"number\" type of the input.\n * @default undefined\n */\n @property({ type: Number })\n step?: number;\n\n /**\n * Allows setting the aria-describedby property on the internal input node.\n *\n * @default \"\"\n * @public\n */\n @property()\n ariaDescribedBy?: string;\n\n /**\n * Defines the aria-has-popup attribute of the input.\n * @private\n */\n @property({ type: String })\n _ariaHasPopup?: string;\n\n /**\n * Defines is it the touch of the input field (only for mobile devices).\n * @default false\n * @private\n */\n @property({ type: Boolean })\n _isTouched!: boolean;\n\n /**\n * Determines Combobox role for the button.\n * @default false\n * @private\n */\n @property({ type: Boolean })\n _isComboboxRole?: boolean;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n onBeforeRendering(): void {\n if ((this.value || this.active) && this.labelActiveClass === \"\") {\n this.labelActiveClass = this._labelActiveClassName;\n } else if (!this.active && !this.value && this.labelActiveClass.length) {\n this.labelActiveClass = \"\";\n }\n\n this.isInputReadonly = this.readonly || this.displayonly;\n\n this.labelClasses = `udex-text-field__label ${this.labelActiveClass}`;\n }\n\n onAfterRendering(): void {\n const directionStyles: string = window\n .getComputedStyle(this)\n .getPropertyValue(\"direction\");\n\n if (!directionStyles) {\n this.direction = \"ltr\";\n } else {\n this.direction = directionStyles;\n }\n }\n\n handleKeydown(e: KeyboardEvent): void {\n e.stopPropagation();\n this.fireDecoratorEvent(\"keydown\", { keyboardEvent: e });\n }\n\n handleChange = (): void => {\n this.fireDecoratorEvent(\"change\");\n };\n\n handleInput = (inputEvent: InputEvent) => {\n this.value = (inputEvent.target as HTMLInputElement)?.value;\n };\n\n handleClick = (): void => {\n if (!isDesktop()) {\n this._isTouched = true;\n }\n };\n\n handleFocus = (): void => {\n if (!this.disabled && !this.readonly && !this.displayonly) {\n this.labelActiveClass = this._labelActiveClassName;\n this.active = true;\n }\n };\n\n handleBlur = (): void => {\n this.active = false;\n\n if (this.value) {\n this.labelActiveClass = this._labelActiveClassName;\n } else {\n this.labelActiveClass = \"\";\n }\n this._isTouched = false;\n };\n\n handleIconClick(): void {\n this.fireDecoratorEvent(\"click-icon\");\n }\n\n get _inputHolder(): HTMLElement {\n return this.shadowRoot!.querySelector<HTMLElement>(\".udex-text-field__wrap\")!;\n }\n\n get valueStateTypeMappings(): Record<string, string> {\n return {\n \"Success\": UDExTextField.i18nBundle.getText(VALUE_STATE_SUCCESS),\n \"Standard\": UDExTextField.i18nBundle.getText(VALUE_STATE_INFORMATION),\n \"Error\": UDExTextField.i18nBundle.getText(VALUE_STATE_ERROR),\n \"Warning\": UDExTextField.i18nBundle.getText(VALUE_STATE_WARNING),\n };\n }\n\n get hasValueState(): boolean {\n return this.valueState !== UDExValueState.Standard;\n }\n\n get valueStateText(): string {\n return this.valueState !== UDExValueState.Standard ? this.valueStateTypeMappings[this.valueState] : \"\";\n }\n\n get readOnlyStateText(): string {\n return UDExTextField.i18nBundle.getText(READ_ONLY);\n }\n\n get ariaDescribedById(): string {\n return `${this.supportingTextId} ${this.valueStateTextId} ${this.readOnlyStateTextId}`.trim();\n }\n\n get supportingTextId(): string {\n return this.supportingText ? `${this._id}-supportingTextDesc` : \"\";\n }\n\n get valueStateTextId(): string {\n return this.hasValueState ? `${this._id}-valueStateDesc` : \"\";\n }\n\n get readOnlyStateTextId(): string {\n return this.readonly ? `${this._id}-stateReadOnlyDesc` : \"\";\n }\n\n get accInfo(): AccInfo {\n return {\n \"ariaInvalid\": this.valueState === UDExValueState.Error ? \"true\" : undefined,\n \"ariaDescribedBy\": this.ariaDescribedBy ? this.ariaDescribedBy : this.ariaDescribedById || undefined,\n \"ariaLabel\": getAllAccessibleNameRefTexts(this) || this.accessibleName || undefined,\n \"ariaHasPopup\": this._ariaHasPopup || undefined,\n };\n }\n\n get inputRole(): string | undefined {\n return this.isAutoCompleteDisabled ? \"presentation\" : undefined;\n }\n\n get isAutoCompleteDisabled(): boolean {\n return this.autocomplete === \"off\" || this.autocomplete === \"new-password\";\n }\n\n get readonlyNotDisabled(): boolean {\n return this.isInputReadonly && !this.disabled;\n }\n\n get buttonAccessibleName(): string {\n return this._isComboboxRole ? this.label : this.accessibleIconName || this.icon;\n }\n\n get buttonAccessibleDescription(): string {\n const label = this._isComboboxRole ? this.value : \"\";\n return `${label} ${this.supportingText || \"\"} ${this.valueStateText}`;\n }\n}\n\nUDExTextField.define();\n\nexport default UDExTextField;\nexport type { UDExTextFieldKeydownEventDetail };\n"]}
|
package/dist/Tile.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
|
+
export type AnchorNode = HTMLAnchorElement | undefined | null;
|
|
2
3
|
type UDExTileClickEventDetail = {
|
|
3
4
|
originalEvent: MouseEvent;
|
|
4
5
|
};
|
|
@@ -78,3 +79,4 @@ declare class UDExTile extends UI5Element {
|
|
|
78
79
|
_onclick(e: MouseEvent): void;
|
|
79
80
|
}
|
|
80
81
|
export default UDExTile;
|
|
82
|
+
export type { UDExTileClickEventDetail };
|
package/dist/Tile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tile.js","sourceRoot":"","sources":["../src/Tile.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,WAAW,MAAM,iDAAiD,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAEnE,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C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,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;CACF,CAAA;AAxFG;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CACL;AAUrB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CACJ;AAYtB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCACX;AAsBd;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCACT;AAUhB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACD;AAQJ;IAArB,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;yCAAgB;AAxEjC,QAAQ;IAZb,aAAa,CAAC;QACb,GAAG,EAAE,WAAW;QAChB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,YAAY;KACvB,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;GAC5B,QAAQ,CAkGb;AAED,QAAQ,CAAC,MAAM,EAAE,CAAC;AAElB,eAAe,QAAQ,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/renderer/JsxRenderer.js\";\nimport { isSpace } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\n\nimport TileTemplate from \"./TileTemplate.js\";\n\n// Styles\nimport TileCss from \"./generated/themes/Tile.css.js\";\n\nexport type AnchorNode = HTMLAnchorElement | undefined | null;\n\ntype UDExTileClickEventDetail = {\n originalEvent: MouseEvent,\n}\n\n/**\n * @class\n *\n * @constructor\n * @extends UI5Element\n * @tagname udex-tile\n * @public\n */\n@customElement({\n tag: \"udex-tile\",\n renderer: jsxRenderer,\n styles: TileCss,\n template: TileTemplate,\n})\n\n/**\n * Fires when the user clicks inside the component in interactive mode.\n * @public\n */\n@event(\"click\", { bubbles: true })\nclass UDExTile extends UI5Element {\n eventDetails!: {\n \"click\": UDExTileClickEventDetail\n };\n /**\n * Defines display the shadow for the Tile.\n *\n * @public\n */\n @property({ type: Boolean })\n hideShadow!: boolean;\n\n /**\n * Defines if the component would be interactive,\n * e.g. gets hover effect, gets focus outline and <code>click</code> event is fired, when pressed.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n interactive!: boolean;\n\n /**\n * Defines the component href.\n *\n * <b>This property must only be used when the <code>interactive</code> property is set.</b>\n *\n * <br><br>\n * <b>Note:</b> Standard hyperlink behavior is supported.\n * @public\n */\n @property({ type: String })\n href!: string;\n\n /**\n * Defines the component target.\n * <br><br>\n * <b>Notes:</b>\n *\n * <ul>\n * <li><code>_self</code></li>\n * <li><code>_top</code></li>\n * <li><code>_blank</code></li>\n * <li><code>_parent</code></li>\n * <li><code>_search</code></li>\n * </ul>\n *\n * <b>This property must only be used when the <code>interactive</code> property is set.</b>\n *\n * <br><br>\n * <b>Note:</b> Standard hyperlink behavior is supported.\n * @public\n */\n @property({ type: String })\n target!: string;\n\n /**\n * Defines the component aria-label accessibility attribute.\n *\n * <b>This property must only be used when the <code>interactive</code> property is set.</b>\n *\n * @public\n */\n @property({ type: String })\n accessibleName!: string;\n\n /**\n * Defines the content of the component.\n *\n * @slot\n * @public\n */\n @slot({ type: Node }) default!: Node;\n\n onEnterDOM(): void {\n if (isDesktop()) {\n this.setAttribute(\"desktop\", \"\");\n }\n }\n\n _onkeydown(e: KeyboardEvent) {\n if (isSpace(e)) {\n const component: AnchorNode = this.shadowRoot?.querySelector(\"a.udex-tile\");\n\n if (component) {\n e.preventDefault(); // prevent scrolling\n component.click();\n }\n }\n }\n\n _onclick(e: MouseEvent) {\n e.stopImmediatePropagation();\n\n if (this.interactive) {\n this.fireDecoratorEvent(\"click\", { originalEvent: e });\n }\n }\n}\n\nUDExTile.define();\n\nexport default UDExTile;\nexport type { UDExTileClickEventDetail };\n"]}
|
package/dist/Tooltip.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
2
|
import PopupAccessibleRole from "@ui5/webcomponents/dist/types/PopupAccessibleRole.js";
|
|
3
|
+
import type { PopupBeforeCloseEventDetail } from "@ui5/webcomponents/dist/Popup.js";
|
|
3
4
|
import { HorizontalAlign, Placement, VerticalAlign } from "./types/Dropdown.js";
|
|
4
5
|
/**
|
|
5
6
|
* @class
|
|
@@ -20,6 +21,12 @@ import { HorizontalAlign, Placement, VerticalAlign } from "./types/Dropdown.js";
|
|
|
20
21
|
* @public
|
|
21
22
|
*/
|
|
22
23
|
declare class UDExTooltip extends UI5Element {
|
|
24
|
+
eventDetails: {
|
|
25
|
+
"before-open": void;
|
|
26
|
+
"open": void;
|
|
27
|
+
"before-close": PopupBeforeCloseEventDetail;
|
|
28
|
+
"close": void;
|
|
29
|
+
};
|
|
23
30
|
/**
|
|
24
31
|
* Defines the content of the component.
|
|
25
32
|
*
|
|
@@ -99,5 +106,9 @@ declare class UDExTooltip extends UI5Element {
|
|
|
99
106
|
syncClose(): void;
|
|
100
107
|
onEnterDOM(): void;
|
|
101
108
|
onExitDOM(): void;
|
|
109
|
+
handleBeforeOpen(e: CustomEvent<void>): void;
|
|
110
|
+
handleOpen(e: CustomEvent<void>): void;
|
|
111
|
+
handleBeforeClose(e: CustomEvent<PopupBeforeCloseEventDetail>): void;
|
|
112
|
+
handleClose(e: CustomEvent<void>): void;
|
|
102
113
|
}
|
|
103
114
|
export default UDExTooltip;
|
package/dist/Tooltip.js
CHANGED
|
@@ -8,6 +8,7 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
|
8
8
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
9
9
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
10
10
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
11
|
+
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
11
12
|
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
|
12
13
|
import Popover from "@ui5/webcomponents/dist/Popover.js";
|
|
13
14
|
import PopupAccessibleRole from "@ui5/webcomponents/dist/types/PopupAccessibleRole.js";
|
|
@@ -86,6 +87,18 @@ let UDExTooltip = class UDExTooltip extends UI5Element {
|
|
|
86
87
|
onExitDOM() {
|
|
87
88
|
this.removeEventListener("close", this._onClose);
|
|
88
89
|
}
|
|
90
|
+
handleBeforeOpen(e) {
|
|
91
|
+
this.fireDecoratorEvent("before-open", e.detail);
|
|
92
|
+
}
|
|
93
|
+
handleOpen(e) {
|
|
94
|
+
this.fireDecoratorEvent("open", e.detail);
|
|
95
|
+
}
|
|
96
|
+
handleBeforeClose(e) {
|
|
97
|
+
this.fireDecoratorEvent("before-close", e.detail);
|
|
98
|
+
}
|
|
99
|
+
handleClose(e) {
|
|
100
|
+
this.fireDecoratorEvent("close", e.detail);
|
|
101
|
+
}
|
|
89
102
|
};
|
|
90
103
|
__decorate([
|
|
91
104
|
slot({ type: Node })
|
|
@@ -134,6 +147,35 @@ UDExTooltip = __decorate([
|
|
|
134
147
|
template: TooltipTemplate,
|
|
135
148
|
dependencies: [Popover],
|
|
136
149
|
})
|
|
150
|
+
/**
|
|
151
|
+
* Fired before the component is opened. This event can be cancelled, which will prevent the popup from opening.
|
|
152
|
+
* @public
|
|
153
|
+
*/
|
|
154
|
+
,
|
|
155
|
+
event("before-open", {
|
|
156
|
+
cancelable: true,
|
|
157
|
+
})
|
|
158
|
+
/**
|
|
159
|
+
* Fired after the component is opened.
|
|
160
|
+
* @public
|
|
161
|
+
*/
|
|
162
|
+
,
|
|
163
|
+
event("open")
|
|
164
|
+
/**
|
|
165
|
+
* Fired before the component is closed. This event can be cancelled, which will prevent the popup from closing.
|
|
166
|
+
* @public
|
|
167
|
+
* @param {boolean} escPressed Indicates that `ESC` key has triggered the event.
|
|
168
|
+
*/
|
|
169
|
+
,
|
|
170
|
+
event("before-close", {
|
|
171
|
+
cancelable: true,
|
|
172
|
+
})
|
|
173
|
+
/**
|
|
174
|
+
* Fired after the component is closed.
|
|
175
|
+
* @public
|
|
176
|
+
*/
|
|
177
|
+
,
|
|
178
|
+
event("close")
|
|
137
179
|
], UDExTooltip);
|
|
138
180
|
UDExTooltip.define();
|
|
139
181
|
export default UDExTooltip;
|
package/dist/Tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,OAAO,MAAM,oCAAoC,CAAC;AACzD,OAAO,mBAAmB,MAAM,sDAAsD,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,OAAO,MAAM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IACF,KAAK,CAAC,MAAM,CAAC;IAEd;;;;OAIG;;IACF,KAAK,CAAC,cAAc,EAAE;QACrB,UAAU,EAAE,IAAI;KACjB,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,OAAO,CAAC;GACT,WAAW,CA2IhB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport Popover from \"@ui5/webcomponents/dist/Popover.js\";\nimport PopupAccessibleRole from \"@ui5/webcomponents/dist/types/PopupAccessibleRole.js\";\nimport type { PopupBeforeCloseEventDetail } from \"@ui5/webcomponents/dist/Popup.js\";\nimport { HorizontalAlign, Placement, VerticalAlign } from \"./types/Dropdown.js\";\n\n// Template\nimport TooltipTemplate from \"./generated/templates/TooltipTemplate.lit.js\";\n\n// Styles\nimport TooltipCss from \"./generated/themes/Tooltip.css.js\";\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * <h3>Usage</h3>\n *\n * For the <code>udex-tooltip</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/Tooltip.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @extends UI5Element\n * @tagname udex-tooltip\n * @public\n */\n@customElement({\n tag: \"udex-tooltip\",\n renderer: litRender,\n styles: TooltipCss,\n template: TooltipTemplate,\n dependencies: [Popover],\n})\n/**\n * Fired before the component is opened. This event can be cancelled, which will prevent the popup from opening.\n * @public\n */\n@event(\"before-open\", {\n cancelable: true,\n})\n\n/**\n * Fired after the component is opened.\n * @public\n */\n@event(\"open\")\n\n/**\n * Fired before the component is closed. This event can be cancelled, which will prevent the popup from closing.\n * @public\n * @param {boolean} escPressed Indicates that `ESC` key has triggered the event.\n */\n@event(\"before-close\", {\n cancelable: true,\n})\n\n/**\n * Fired after the component is closed.\n * @public\n */\n@event(\"close\")\nclass UDExTooltip extends UI5Element {\n eventDetails!: {\n \"before-open\": void\n \"open\": void\n \"before-close\": PopupBeforeCloseEventDetail\n \"close\": void\n };\n /**\n * Defines the content of the component.\n *\n * @slot\n * @public\n */\n @slot({ type: Node }) default!: Node;\n\n /**\n * Defines the Tooltip title.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n title: string = \"\";\n\n /**\n * Defines if Tooltip has an arrow or not.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n hideArrow!: boolean;\n\n /**\n * Determines on which side of the component the Tooltip is displayed.\n *\n * @default \"End\"\n * @public\n */\n @property()\n placement: `${Placement}` = Placement.End;\n /**\n * Determines the horizontal alignment of the component.\n * @default \"Center\"\n * @public\n */\n @property()\n horizontalAlign: `${HorizontalAlign}` = HorizontalAlign.Center;\n\n /**\n * Determines the vertical alignment of the component.\n * @default \"Center\"\n * @public\n */\n @property()\n verticalAlign: `${VerticalAlign}` = VerticalAlign.Center;\n\n @property()\n opener!: HTMLElement | string;\n\n /**\n * Defines the accessible name of the component.\n * @default undefined\n * @public\n */\n @property()\n accessibleName?: string;\n\n /**\n * Defines the IDs of the elements that label the component.\n * @default \"\"\n * @public\n */\n @property()\n accessibleNameRef: string = \"\";\n\n /**\n * Allows setting a custom role.\n * @default \"Dialog\"\n * @public\n */\n @property()\n accessibleRole: `${PopupAccessibleRole}` = PopupAccessibleRole.Dialog;\n\n /**\n * Defines if the tooltip is open.\n * @public\n */\n @property({ type: Boolean })\n open!: boolean;\n\n /**\n * Defines if the initial focus should be prevented.\n * @public\n */\n @property({ type: Boolean })\n preventInitialFocus!: boolean;\n\n /**\n * Defines if the focus should be returned to the previously focused element.\n * @public\n */\n @property({ type: Boolean })\n preventFocusRestore!: boolean;\n\n _onClose!: EventListener;\n\n constructor() {\n super();\n this._onClose = this.syncClose.bind(this);\n }\n\n syncClose() {\n this.open = false;\n }\n\n onEnterDOM(): void {\n this.shadowRoot?.querySelector(\"[ui5-popover]\")?.addEventListener(\"close\", this._onClose);\n }\n\n onExitDOM(): void {\n this.removeEventListener(\"close\", this._onClose);\n }\n\n handleBeforeOpen(e: CustomEvent<void>): void {\n this.fireDecoratorEvent(\"before-open\", e.detail);\n }\n\n handleOpen(e: CustomEvent<void>): void {\n this.fireDecoratorEvent(\"open\", e.detail);\n }\n\n handleBeforeClose(e: CustomEvent<PopupBeforeCloseEventDetail>): void {\n this.fireDecoratorEvent(\"before-close\", e.detail);\n }\n\n handleClose(e: CustomEvent<void>): void {\n this.fireDecoratorEvent(\"close\", e.detail);\n }\n}\n\nUDExTooltip.define();\n\nexport default UDExTooltip;\n"]}
|
package/dist/TruncatedText.d.ts
CHANGED
package/dist/TruncatedText.js
CHANGED
|
@@ -6,16 +6,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
var UDExTruncatedText_1;
|
|
8
8
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
9
|
+
import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
|
|
9
10
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
10
11
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
11
|
-
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
|
12
12
|
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
13
13
|
import { READ_LESS, READ_MORE } from "./generated/i18n/i18n-defaults.js";
|
|
14
|
-
|
|
15
|
-
import TruncatedTextTemplate from "./
|
|
14
|
+
import UDExButton from "./Button.js";
|
|
15
|
+
import TruncatedTextTemplate from "./TruncatedTextTemplate.js";
|
|
16
16
|
// Styles
|
|
17
17
|
import TruncatedTextCss from "./generated/themes/TruncatedText.css.js";
|
|
18
|
-
import UDExButton from "./Button.js";
|
|
19
18
|
export var ErrorVariableName;
|
|
20
19
|
(function (ErrorVariableName) {
|
|
21
20
|
ErrorVariableName["charLimit"] = "char-limit";
|
|
@@ -36,7 +35,7 @@ const lineEndRegExp = new RegExp(/($)|([,.]+)$|([,.]+)?\s+(\S*)$/);
|
|
|
36
35
|
*/
|
|
37
36
|
let UDExTruncatedText = UDExTruncatedText_1 = class UDExTruncatedText extends UI5Element {
|
|
38
37
|
constructor() {
|
|
39
|
-
super();
|
|
38
|
+
super(...arguments);
|
|
40
39
|
/**
|
|
41
40
|
* Indicates the limit for chars
|
|
42
41
|
*
|
|
@@ -92,7 +91,7 @@ __decorate([
|
|
|
92
91
|
UDExTruncatedText = UDExTruncatedText_1 = __decorate([
|
|
93
92
|
customElement({
|
|
94
93
|
tag: "udex-truncated-text",
|
|
95
|
-
renderer:
|
|
94
|
+
renderer: jsxRenderer,
|
|
96
95
|
styles: TruncatedTextCss,
|
|
97
96
|
template: TruncatedTextTemplate,
|
|
98
97
|
dependencies: [UDExButton],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TruncatedText.js","sourceRoot":"","sources":["../src/TruncatedText.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,
|
|
1
|
+
{"version":3,"file":"TruncatedText.js","sourceRoot":"","sources":["../src/TruncatedText.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,WAAW,MAAM,iDAAiD,CAAC;AAC1E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO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C,iBAAiB,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC;IAC/E,CAAC;IAED,iBAAiB,CAAC,IAAY,EAAE,KAAa;QAC3C,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,CAAC,gBAAgB,IAAI,+BAA+B,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;IAED,aAAa;QACX,IAAI,CAAC,iBAAiB,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC;IACnD,CAAC;CACF,CAAA;AAjEG;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4DACE;AAQ5B;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDACL;AAQpB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACX;AASd;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDACD;AAGnB;IADN,IAAI,CAAC,yBAAyB,CAAC;2CACF;AAnC1B,iBAAiB;IARtB,aAAa,CAAC;QACb,GAAG,EAAE,qBAAqB;QAC1B,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,gBAAgB;QACxB,QAAQ,EAAE,qBAAqB;QAC/B,YAAY,EAAE,CAAC,UAAU,CAAC;KAC3B,CAAC;GAEI,iBAAiB,CAwEtB;AAED,iBAAiB,CAAC,MAAM,EAAE,CAAC;AAE3B,eAAe,iBAAiB,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/renderer/JsxRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { READ_LESS, READ_MORE } from \"./generated/i18n/i18n-defaults.js\";\nimport UDExButton from \"./Button.js\";\nimport TruncatedTextTemplate from \"./TruncatedTextTemplate.js\";\n\n// Styles\nimport TruncatedTextCss from \"./generated/themes/TruncatedText.css.js\";\n\nexport enum ErrorVariableName {\n charLimit = \"char-limit\"\n}\n\nconst ellipsisSymbols = \"...\";\nconst lineEndRegExp = new RegExp(/($)|([,.]+)$|([,.]+)?\\s+(\\S*)$/);\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * The <code> udex-truncated-text </code> component is a component used to limit and toggle text visibility.\n *\n * @constructor\n * @extends UI5Element\n * @tagname udex-truncated-text\n * @public\n */\n@customElement({\n tag: \"udex-truncated-text\",\n renderer: jsxRenderer,\n styles: TruncatedTextCss,\n template: TruncatedTextTemplate,\n dependencies: [UDExButton],\n})\n\nclass UDExTruncatedText extends UI5Element {\n /**\n * Defines if the text is initially expanded.\n *\n * @public\n */\n @property({ type: Boolean })\n initiallyExpanded!: boolean;\n\n /**\n * Defines direction of the text.\n *\n * @private\n */\n @property({ type: String })\n _direction?: string;\n\n /**\n * Indicates the element text\n *\n * @public\n */\n @property({ type: String })\n text!: string;\n\n /**\n * Indicates the limit for chars\n *\n * @public\n * @default 150\n */\n @property({ type: Number })\n charLimit: number = 150;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n get visibleText(): string {\n return this.initiallyExpanded ? `${this.text} ` : this.truncatedText;\n }\n\n get truncatedText(): string {\n return this.text.substring(0, this.cropAfter()).replace(lineEndRegExp, ellipsisSymbols);\n }\n\n get buttonLabel(): string {\n return this.initiallyExpanded\n ? UDExTruncatedText.i18nBundle.getText(READ_LESS)\n : UDExTruncatedText.i18nBundle.getText(READ_MORE);\n }\n\n get validatedCharLimit(): number {\n return (Number(this.charLimit) < 0) ? 0 : this.charLimit;\n }\n\n onBeforeRendering(): void {\n this.validateVariables(ErrorVariableName.charLimit, Number(this.charLimit));\n }\n\n cropAfter(): number {\n return this.text.substring(0, Number(this.validatedCharLimit)).trim().length;\n }\n\n validateVariables(name: string, value: number): void {\n if (value < 0) {\n console.warn(`The variable ${name} cannot take a negative value`);\n }\n }\n\n onToggleClick(): void {\n this.initiallyExpanded = !this.initiallyExpanded;\n }\n}\n\nUDExTruncatedText.define();\n\nexport default UDExTruncatedText;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@ui5/webcomponents-base/jsx-runtime";
|
|
2
|
+
import UDExButtonSize from "./types/ButtonSize.js";
|
|
3
|
+
import UDExButtonDesign from "./types/ButtonDesign.js";
|
|
4
|
+
import UDExButton from "./Button.js";
|
|
5
|
+
export default function TruncatedTextTemplate() {
|
|
6
|
+
const rootClass = "udex-truncated-text";
|
|
7
|
+
return (_jsxs("p", { className: rootClass, children: [_jsx("span", { className: `${rootClass}__visible-text`, children: this.visibleText }), _jsx(UDExButton, { id: "toggleButton", class: `${rootClass}__toggle-button`, design: UDExButtonDesign.Tertiary, size: UDExButtonSize.Small, onClick: this.onToggleClick, children: this.buttonLabel })] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=TruncatedTextTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TruncatedTextTemplate.js","sourceRoot":"","sources":["../src/TruncatedTextTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,OAAO,UAAU,qBAAqB;IAC3C,MAAM,SAAS,GAAG,qBAAqB,CAAC;IACxC,OAAO,CACL,aAAG,SAAS,EAAE,SAAS,aACrB,eAAM,SAAS,EAAE,GAAG,SAAS,gBAAgB,YAAG,IAAI,CAAC,WAAW,GAAQ,EACxE,KAAC,UAAU,IACT,EAAE,EAAC,cAAc,EACjB,KAAK,EAAE,GAAG,SAAS,iBAAiB,EACpC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,EACjC,IAAI,EAAE,cAAc,CAAC,KAAK,EAC1B,OAAO,EAAE,IAAI,CAAC,aAAa,YAC1B,IAAI,CAAC,WAAW,GACN,IACX,CACL,CAAC;AACJ,CAAC","sourcesContent":["import type TruncatedText from \"./TruncatedText.js\";\nimport UDExButtonSize from \"./types/ButtonSize.js\";\nimport UDExButtonDesign from \"./types/ButtonDesign.js\";\nimport UDExButton from \"./Button.js\";\n\nexport default function TruncatedTextTemplate(this: TruncatedText) {\n const rootClass = \"udex-truncated-text\";\n return (\n <p className={rootClass}>\n <span className={`${rootClass}__visible-text`}>{this.visibleText}</span>\n <UDExButton\n id=\"toggleButton\"\n class={`${rootClass}__toggle-button`}\n design={UDExButtonDesign.Tertiary}\n size={UDExButtonSize.Small}\n onClick={this.onToggleClick}>\n {this.buttonLabel}\n </UDExButton>\n </p>\n );\n}\n"]}
|
package/dist/Upload.d.ts
CHANGED
package/dist/Upload.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Upload.js","sourceRoot":"","sources":["../src/Upload.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AAElE,OAAO,aAAa,MAAM,wDAAwD,CAAC;AACnF,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,YAAY,MAAM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AAM,EAAE,CAAC;kDACD;AAQxB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDACC;AAQ1B;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACE;AAQ5B;IADD,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;yCACb;AAS9B;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAC+B;AAGnD;IADN,IAAI,CAAC,yBAAyB,CAAC;oCACF;AA7G1B,UAAU;IA3Cf,aAAa,CAAC;QACb,GAAG,EAAE,aAAa;QAClB,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,cAAc;QACxB,YAAY,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,CAAC;KACnE,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,kBAAkB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAE7C;;;;OAIG;;IACF,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAExC;;;;OAIG;;IACF,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAExC;;;;OAIG;;IACF,KAAK,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAE3C;;;;OAIG;;IACF,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;GAE7B,UAAU,CAoQf;AAED,UAAU,CAAC,MAAM,EAAE,CAAC;AAEpB,eAAe,UAAU,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { slot } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport FileUploader from \"@ui5/webcomponents/dist/FileUploader.js\";\nimport type { FileUploaderChangeEventDetail } from \"@ui5/webcomponents/dist/FileUploader.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { UPLOAD_BUTTON_LABEL } from \"./generated/i18n/i18n-defaults.js\";\nimport UDExButton from \"./Button.js\";\nimport UDExButtonSize from \"./types/ButtonSize.js\";\nimport UDExList from \"./List.js\";\nimport UDExUploadItem from \"./UploadItem.js\";\nimport UploadTemplate from \"./generated/templates/UploadTemplate.lit.js\";\nimport type FileData from \"./types/FileData.js\";\n\n// Styles\nimport UploadCss from \"./generated/themes/Upload.css.js\";\nimport { BreakpointUtils } from \"./utils/Breakpoints.js\";\n\nconst convertBytesToMegabytes = (bytes: number) => (bytes / 1024) / 1024;\n\ntype UDExUploadBaseEventDetail = {\n files: Array<FileData>\n}\n\ntype UDExUploadFileDeleteEventDetail = {\n file: UDExUploadItem,\n}\n\ntype UDExUploadFileChangeEventDetail = {\n files: Array<UDExUploadItem>\n}\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>udex-upload</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/Upload.js\";</code>\n *\n * @constructor\n * @extends UI5Element\n * @public\n */\n@customElement({\n tag: \"udex-upload\",\n renderer: litRender,\n styles: UploadCss,\n template: UploadTemplate,\n dependencies: [FileUploader, UDExList, UDExButton, UDExUploadItem],\n})\n\n/**\n * Triggered when the uploaded file exceeds the maximum allowed size.\n *\n * @public\n */\n@event(\"file-size-exceed\", { bubbles: true })\n\n/**\n * Triggered when the user deletes the uploaded item.\n *\n * @public\n */\n@event(\"file-delete\", { bubbles: true })\n\n/**\n * Triggered when the user uploads the item.\n *\n * @public\n */\n@event(\"file-change\", { bubbles: true })\n\n/**\n * Triggered when the user attempts to upload a duplicate file.\n *\n * @public\n */\n@event(\"file-duplicate\", { bubbles: true })\n\n/**\n * Triggered when the user attempts to upload a file.\n *\n * @public\n */\n@event(\"change\", { bubbles: true })\n\nclass UDExUpload extends UI5Element {\n eventDetails!: {\n \"file-size-exceed\": UDExUploadBaseEventDetail,\n \"file-delete\": UDExUploadFileDeleteEventDetail,\n \"file-change\": UDExUploadFileChangeEventDetail,\n \"file-duplicate\": UDExUploadBaseEventDetail,\n \"change\": FileUploaderChangeEventDetail\n };\n /**\n * Defines the title of the upload.\n *\n * @public\n */\n @property({ type: String })\n uploadTitle!: string;\n\n /**\n * Defines an optional upporting message shown in 2 cases, both in single uplaod mode.\n * 1) When more than one file is uploaded and the button for uploading is clicked.\n * 2) When the button for uploading is disabled and a file has already been uploaded.\n *\n * @public\n */\n @property({ type: String })\n supportingText!: string;\n\n /**\n * Defines if uploader is required.\n *\n * @public\n */\n @property({ type: Boolean })\n required: boolean = false;\n\n /**\n * Defines if the button for uploading is disabled.\n *\n * @public\n */\n @property({ type: Boolean })\n disabled: boolean = false;\n\n /**\n * Defines if uploading multiple files is allowed.\n *\n * @public\n */\n @property({ type: Boolean })\n multiple!: boolean;\n\n /**\n * Defines the acceptable file formats for uploading.\n *\n * @public\n */\n @property({ type: String })\n accept!: string;\n\n /**\n * Defines the maximum allowed size of the file for uploading.\n *\n * @default undefined\n * @public\n */\n @property({ type: Number })\n maxFileSize!: number;\n\n /**\n * Defines the additional text below the title of the upload.\n *\n * @public\n */\n @property({ type: String })\n additionalText!: string;\n\n /**\n * Defines the text in the upload button.\n *\n * @public\n */\n @property({ type: String })\n uploadButtonText!: string;\n\n /**\n * Defines if a file is already uploaded when multiple is false.\n *\n * @private\n */\n @property({ type: Boolean })\n _filesFull: boolean = false;\n\n /**\n * Defines the uploaded files.\n *\n * @public\n */\n @slot({ type: HTMLElement, \"default\": true })\n items!: Array<UDExUploadItem>;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default \"Large\"\n * @private\n */\n @property({ type: String })\n _buttonSize: `${UDExButtonSize}` = UDExButtonSize.Large;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n _uploadedFiles: FileData[] = [];\n _handleResizeBound: ResizeObserverCallback;\n\n constructor() {\n super();\n this._handleResizeBound = this._handleResize.bind(this);\n }\n\n onEnterDOM(): void {\n ResizeHandler.register(this, this._handleResizeBound);\n }\n\n onExitDOM(): void {\n ResizeHandler.deregister(this, this._handleResizeBound);\n }\n\n onAfterRendering(): void {\n if (this._filesFull) {\n this._filesFull = this.fileNumberExceeded;\n }\n }\n\n handleUploadClick(e: Event) {\n this._filesFull = this.fileNumberExceeded;\n if (this.fileNumberExceeded) {\n e.preventDefault();\n }\n }\n\n handleUploadFile(e: CustomEvent<FileUploaderChangeEventDetail>) {\n const { files } = e.target as HTMLInputElement;\n if (!files?.length || this.fileNumberExceeded) {\n e.stopPropagation();\n }\n\n const duplicateFiles = this._getDuplicateFiles(files!);\n if (duplicateFiles.length) {\n e.stopPropagation();\n this.fireDecoratorEvent(\"file-duplicate\", {\n files: duplicateFiles,\n });\n this.fileUploader.value = \"\";\n return;\n }\n\n const newFiles = Array.from(files!).map(file => ({\n fileName: file.name,\n fileSize: file.size,\n }));\n\n this._uploadedFiles = [...this._uploadedFiles, ...newFiles];\n\n const exceededFilesData = this.maxFileSize ? this._getExceededFiles(files!) : [];\n if (exceededFilesData.length) {\n e.stopPropagation();\n this.fireDecoratorEvent(\"file-size-exceed\", {\n files: exceededFilesData,\n });\n return;\n }\n\n this.fireEvent(\"change\", { files });\n }\n\n handleSelectionChange(e: CustomEvent) {\n const uploadedFiles = e.detail.listItems as UDExUploadItem[];\n this.fireDecoratorEvent(\"file-change\", { files: uploadedFiles });\n this.fileUploader.value = \"\";\n }\n\n _handleResize() {\n this._buttonSize = BreakpointUtils.isAtMost(\"S\") ? UDExButtonSize.Medium : UDExButtonSize.Large;\n }\n\n handleRemoveFile(e: CustomEvent) {\n const removedFile = e.target as UDExUploadItem;\n this.fireDecoratorEvent(\"file-delete\", { file: removedFile });\n this._uploadedFiles = this._uploadedFiles.filter(file => file.fileName !== removedFile.fileName);\n this.fileUploader.value = \"\";\n }\n\n _isDuplicateFile(file: string): boolean {\n return this._uploadedFiles.some(uploadedFile => uploadedFile.fileName === file);\n }\n\n _getExceededFiles(files: FileList): Array<FileData> {\n const filesArray = Array.from(files);\n const exceededFiles: Array<FileData> = [];\n\n for (let i = 0; i < filesArray.length; i++) {\n const fileSize = convertBytesToMegabytes(filesArray[i].size);\n if (fileSize > this.maxFileSize) {\n exceededFiles.push({\n fileName: filesArray[i].name,\n fileSize,\n });\n }\n }\n return exceededFiles;\n }\n\n _getDuplicateFiles(files: FileList): Array<FileData> {\n const filesArray = Array.from(files);\n const duplicateFiles: Array<FileData> = [];\n\n for (let i = 0; i < filesArray.length; i++) {\n const fileSize = convertBytesToMegabytes(filesArray[i].size);\n const { name } = filesArray[i];\n\n const potentialDuplicate: FileData = {\n fileSize,\n fileName: name,\n };\n\n if (this._isDuplicateFile(potentialDuplicate.fileName)) {\n duplicateFiles.push(potentialDuplicate);\n }\n }\n\n return duplicateFiles;\n }\n\n get showSupportingText(): boolean {\n return this.disabled || this._filesFull;\n }\n\n get supportingTextClasses(): string {\n if (this.disabled && !!this.supportingText) {\n return \"udex-upload__supporting-text\";\n }\n return \"udex-upload__supporting-error-text\";\n }\n\n get fileUploader(): HTMLInputElement {\n const uploader = this.shadowRoot!.querySelector<FileUploader>(\"[ui5-file-uploader]\")!;\n return uploader.shadowRoot!.querySelector(\"input\")!;\n }\n\n get uploadButtonAriaLabel(): string {\n return UDExUpload.i18nBundle.getText(UPLOAD_BUTTON_LABEL);\n }\n\n get listBusy(): boolean {\n return !this.items.length;\n }\n\n get fileNumberExceeded(): boolean {\n return !this.multiple && this.items.length >= 1;\n }\n}\n\nUDExUpload.define();\n\nexport default UDExUpload;\n"]}
|
|
1
|
+
{"version":3,"file":"Upload.js","sourceRoot":"","sources":["../src/Upload.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AAElE,OAAO,aAAa,MAAM,wDAAwD,CAAC;AACnF,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,YAAY,MAAM,yCAAyC,CAAC;AAEnE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAC7C,OAAO,cAAc,MAAM,6CAA6C,CAAC;AAGzE,SAAS;AACT,OAAO,SAAS,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,uBAAuB,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;AAczE;;;;;;;;;;;;;;;;GAgBG;AA4CH,IAAM,UAAU,kBAAhB,MAAM,UAAW,SAAQ,UAAU;IAkHjC;QACE,KAAK,EAAE,CAAC;QAzFV;;;;WAIG;QAED,aAAQ,GAAY,KAAK,C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C;IAE7C;;;;OAIG;;IACF,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAExC;;;;OAIG;;IACF,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAExC;;;;OAIG;;IACF,KAAK,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAE3C;;;;OAIG;;IACF,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;GAE7B,UAAU,CAoQf;AAED,UAAU,CAAC,MAAM,EAAE,CAAC;AAEpB,eAAe,UAAU,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { slot } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport FileUploader from \"@ui5/webcomponents/dist/FileUploader.js\";\nimport type { FileUploaderChangeEventDetail } from \"@ui5/webcomponents/dist/FileUploader.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { UPLOAD_BUTTON_LABEL } from \"./generated/i18n/i18n-defaults.js\";\nimport UDExButton from \"./Button.js\";\nimport UDExButtonSize from \"./types/ButtonSize.js\";\nimport UDExList from \"./List.js\";\nimport UDExUploadItem from \"./UploadItem.js\";\nimport UploadTemplate from \"./generated/templates/UploadTemplate.lit.js\";\nimport type FileData from \"./types/FileData.js\";\n\n// Styles\nimport UploadCss from \"./generated/themes/Upload.css.js\";\nimport { BreakpointUtils } from \"./utils/Breakpoints.js\";\n\nconst convertBytesToMegabytes = (bytes: number) => (bytes / 1024) / 1024;\n\ntype UDExUploadBaseEventDetail = {\n files: Array<FileData>\n}\n\ntype UDExUploadFileDeleteEventDetail = {\n file: UDExUploadItem,\n}\n\ntype UDExUploadFileChangeEventDetail = {\n files: Array<UDExUploadItem>\n}\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>udex-upload</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/Upload.js\";</code>\n *\n * @constructor\n * @extends UI5Element\n * @public\n */\n@customElement({\n tag: \"udex-upload\",\n renderer: litRender,\n styles: UploadCss,\n template: UploadTemplate,\n dependencies: [FileUploader, UDExList, UDExButton, UDExUploadItem],\n})\n\n/**\n * Triggered when the uploaded file exceeds the maximum allowed size.\n *\n * @public\n */\n@event(\"file-size-exceed\", { bubbles: true })\n\n/**\n * Triggered when the user deletes the uploaded item.\n *\n * @public\n */\n@event(\"file-delete\", { bubbles: true })\n\n/**\n * Triggered when the user uploads the item.\n *\n * @public\n */\n@event(\"file-change\", { bubbles: true })\n\n/**\n * Triggered when the user attempts to upload a duplicate file.\n *\n * @public\n */\n@event(\"file-duplicate\", { bubbles: true })\n\n/**\n * Triggered when the user attempts to upload a file.\n *\n * @public\n */\n@event(\"change\", { bubbles: true })\n\nclass UDExUpload extends UI5Element {\n eventDetails!: {\n \"file-size-exceed\": UDExUploadBaseEventDetail,\n \"file-delete\": UDExUploadFileDeleteEventDetail,\n \"file-change\": UDExUploadFileChangeEventDetail,\n \"file-duplicate\": UDExUploadBaseEventDetail,\n \"change\": FileUploaderChangeEventDetail\n };\n /**\n * Defines the title of the upload.\n *\n * @public\n */\n @property({ type: String })\n uploadTitle!: string;\n\n /**\n * Defines an optional upporting message shown in 2 cases, both in single uplaod mode.\n * 1) When more than one file is uploaded and the button for uploading is clicked.\n * 2) When the button for uploading is disabled and a file has already been uploaded.\n *\n * @public\n */\n @property({ type: String })\n supportingText!: string;\n\n /**\n * Defines if uploader is required.\n *\n * @public\n */\n @property({ type: Boolean })\n required: boolean = false;\n\n /**\n * Defines if the button for uploading is disabled.\n *\n * @public\n */\n @property({ type: Boolean })\n disabled: boolean = false;\n\n /**\n * Defines if uploading multiple files is allowed.\n *\n * @public\n */\n @property({ type: Boolean })\n multiple!: boolean;\n\n /**\n * Defines the acceptable file formats for uploading.\n *\n * @public\n */\n @property({ type: String })\n accept!: string;\n\n /**\n * Defines the maximum allowed size of the file for uploading.\n *\n * @default undefined\n * @public\n */\n @property({ type: Number })\n maxFileSize!: number;\n\n /**\n * Defines the additional text below the title of the upload.\n *\n * @public\n */\n @property({ type: String })\n additionalText!: string;\n\n /**\n * Defines the text in the upload button.\n *\n * @public\n */\n @property({ type: String })\n uploadButtonText!: string;\n\n /**\n * Defines if a file is already uploaded when multiple is false.\n *\n * @private\n */\n @property({ type: Boolean })\n _filesFull: boolean = false;\n\n /**\n * Defines the uploaded files.\n *\n * @public\n */\n @slot({ type: HTMLElement, \"default\": true })\n items!: Array<UDExUploadItem>;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default \"Large\"\n * @private\n */\n @property({ type: String })\n _buttonSize: `${UDExButtonSize}` = UDExButtonSize.Large;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n _uploadedFiles: FileData[] = [];\n _handleResizeBound: ResizeObserverCallback;\n\n constructor() {\n super();\n this._handleResizeBound = this._handleResize.bind(this);\n }\n\n onEnterDOM(): void {\n ResizeHandler.register(this, this._handleResizeBound);\n }\n\n onExitDOM(): void {\n ResizeHandler.deregister(this, this._handleResizeBound);\n }\n\n onAfterRendering(): void {\n if (this._filesFull) {\n this._filesFull = this.fileNumberExceeded;\n }\n }\n\n handleUploadClick(e: Event) {\n this._filesFull = this.fileNumberExceeded;\n if (this.fileNumberExceeded) {\n e.preventDefault();\n }\n }\n\n handleUploadFile(e: CustomEvent<FileUploaderChangeEventDetail>) {\n const { files } = e.target as HTMLInputElement;\n if (!files?.length || this.fileNumberExceeded) {\n e.stopPropagation();\n }\n\n const duplicateFiles = this._getDuplicateFiles(files!);\n if (duplicateFiles.length) {\n e.stopPropagation();\n this.fireDecoratorEvent(\"file-duplicate\", {\n files: duplicateFiles,\n });\n this.fileUploader.value = \"\";\n return;\n }\n\n const newFiles = Array.from(files!).map(file => ({\n fileName: file.name,\n fileSize: file.size,\n }));\n\n this._uploadedFiles = [...this._uploadedFiles, ...newFiles];\n\n const exceededFilesData = this.maxFileSize ? this._getExceededFiles(files!) : [];\n if (exceededFilesData.length) {\n e.stopPropagation();\n this.fireDecoratorEvent(\"file-size-exceed\", {\n files: exceededFilesData,\n });\n return;\n }\n\n this.fireEvent(\"change\", { files });\n }\n\n handleSelectionChange(e: CustomEvent) {\n const uploadedFiles = e.detail.listItems as UDExUploadItem[];\n this.fireDecoratorEvent(\"file-change\", { files: uploadedFiles });\n this.fileUploader.value = \"\";\n }\n\n _handleResize() {\n this._buttonSize = BreakpointUtils.isAtMost(\"S\") ? UDExButtonSize.Medium : UDExButtonSize.Large;\n }\n\n handleRemoveFile(e: CustomEvent) {\n const removedFile = e.target as UDExUploadItem;\n this.fireDecoratorEvent(\"file-delete\", { file: removedFile });\n this._uploadedFiles = this._uploadedFiles.filter(file => file.fileName !== removedFile.fileName);\n this.fileUploader.value = \"\";\n }\n\n _isDuplicateFile(file: string): boolean {\n return this._uploadedFiles.some(uploadedFile => uploadedFile.fileName === file);\n }\n\n _getExceededFiles(files: FileList): Array<FileData> {\n const filesArray = Array.from(files);\n const exceededFiles: Array<FileData> = [];\n\n for (let i = 0; i < filesArray.length; i++) {\n const fileSize = convertBytesToMegabytes(filesArray[i].size);\n if (fileSize > this.maxFileSize) {\n exceededFiles.push({\n fileName: filesArray[i].name,\n fileSize,\n });\n }\n }\n return exceededFiles;\n }\n\n _getDuplicateFiles(files: FileList): Array<FileData> {\n const filesArray = Array.from(files);\n const duplicateFiles: Array<FileData> = [];\n\n for (let i = 0; i < filesArray.length; i++) {\n const fileSize = convertBytesToMegabytes(filesArray[i].size);\n const { name } = filesArray[i];\n\n const potentialDuplicate: FileData = {\n fileSize,\n fileName: name,\n };\n\n if (this._isDuplicateFile(potentialDuplicate.fileName)) {\n duplicateFiles.push(potentialDuplicate);\n }\n }\n\n return duplicateFiles;\n }\n\n get showSupportingText(): boolean {\n return this.disabled || this._filesFull;\n }\n\n get supportingTextClasses(): string {\n if (this.disabled && !!this.supportingText) {\n return \"udex-upload__supporting-text\";\n }\n return \"udex-upload__supporting-error-text\";\n }\n\n get fileUploader(): HTMLInputElement {\n const uploader = this.shadowRoot!.querySelector<FileUploader>(\"[ui5-file-uploader]\")!;\n return uploader.shadowRoot!.querySelector(\"input\")!;\n }\n\n get uploadButtonAriaLabel(): string {\n return UDExUpload.i18nBundle.getText(UPLOAD_BUTTON_LABEL);\n }\n\n get listBusy(): boolean {\n return !this.items.length;\n }\n\n get fileNumberExceeded(): boolean {\n return !this.multiple && this.items.length >= 1;\n }\n}\n\nUDExUpload.define();\n\nexport default UDExUpload;\nexport type { UDExUploadBaseEventDetail, UDExUploadFileChangeEventDetail, UDExUploadFileDeleteEventDetail };\n"]}
|
package/dist/UploadItem.js
CHANGED
|
@@ -14,7 +14,7 @@ import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
|
14
14
|
import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
|
|
15
15
|
import { isEnter, isSpace } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
16
16
|
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
17
|
-
import { REMOVE_FILE_TEXT, TERMINATED_FILE_STATUS_TEXT, UPLOADING_FILE_STATUS_TEXT
|
|
17
|
+
import { REMOVE_FILE_TEXT, TERMINATED_FILE_STATUS_TEXT, UPLOADING_FILE_STATUS_TEXT } from "./generated/i18n/i18n-defaults.js";
|
|
18
18
|
import UDExListItem from "./ListItem.js";
|
|
19
19
|
import UDExProgressBar from "./ProgressBar.js";
|
|
20
20
|
import UDExLink from "./Link.js";
|
package/dist/UploadItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadItem.js","sourceRoot":"","sources":["../src/UploadItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AAElE,OAAO,aAAa,MAAM,wDAAwD,CAAC;AACnF,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,UAAU,MAAM,kDAAkD,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAAE,0BAA0B,GACxD,MAAM,mCAAmC,CAAC;AAC3C,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAC/C,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,kBAAkB,MAAM,iDAAiD,CAAC;AAEjF,SAAS;AACT,OAAO,aAAa,MAAM,sCAAsC,CAAC;AACjE,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,MAAM,eAAe,GAAW,GAAG,CAAC;AACpC,MAAM,eAAe,GAAW,IAAI,CAAC;AAErC;;;;;;;;;;;;;;;;GAgBG;AAgBH,IAAM,cAAc,sBAApB,MAAM,cAAe,SAAQ,YAAY;IAgFvC;QACE,KAAK,EAAE,CAAC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AAW,KAAK,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACrH,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,EAAE,CAAC;IAClF,CAAC;CACF,CAAA;AAtJG;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACP;AASlB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACP;AASlB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDACC;AAS1B;IADD,QAAQ,EAAE;mDAC4D;AAQzB;IAA7C,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;kDAAiC;AAS5E;IADD,QAAQ,EAAE;mDACyB;AASlC;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACH;AASvB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACH;AAGlB;IADN,IAAI,CAAC,yBAAyB,CAAC;wCACF;AA5E1B,cAAc;IAfnB,aAAa,CAAC;QACb,GAAG,EAAE,kBAAkB;QACvB,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,kBAAkB;QAC5B,YAAY,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,CAAC;KACpE,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;GAErC,cAAc,CAiKnB;AAED,cAAc,CAAC,MAAM,EAAE,CAAC;AAExB,eAAe,cAAc,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { slot } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport ValueState from \"@ui5/webcomponents-base/dist/types/ValueState.js\";\nimport { isEnter, isSpace } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport {\n REMOVE_FILE_TEXT,\n TERMINATED_FILE_STATUS_TEXT, UPLOADING_FILE_STATUS_TEXT,\n} from \"./generated/i18n/i18n-defaults.js\";\nimport UDExListItem from \"./ListItem.js\";\nimport UDExProgressBar from \"./ProgressBar.js\";\nimport UDExLink from \"./Link.js\";\nimport UDExButton from \"./Button.js\";\nimport UDExButtonSize from \"./types/ButtonSize.js\";\nimport UploadItemTemplate from \"./generated/templates/UploadItemTemplate.lit.js\";\n\n// Styles\nimport UploadItemCss from \"./generated/themes/UploadItem.css.js\";\nimport UDExFileUploadState from \"./types/FileUploadState.js\";\n\nconst BreakpointSizeS: number = 979;\nconst BreakpointSizeM: number = 1279;\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>udex-upload-item</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/UploadItem.js\";</code>\n *\n * @constructor\n * @extends UDExListItemBase\n * @public\n */\n@customElement({\n tag: \"udex-upload-item\",\n renderer: litRender,\n styles: UploadItemCss,\n template: UploadItemTemplate,\n dependencies: [UDExLink, UDExListItem, UDExProgressBar, UDExButton],\n})\n\n/**\n * Triggered when the upload item is deleted.\n *\n * @public\n */\n@event(\"request-delete\", { bubbles: true })\n\nclass UDExUploadItem extends UDExListItem {\n eventDetails!: {\n \"request-delete\": void\n } & UDExListItem[\"eventDetails\"];\n /**\n * Defines the name of the uploaded file.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n fileName!: string;\n\n /**\n * Defines the link of the uploaded file.\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n fileLink?: string;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default 0\n * @public\n */\n @property({ type: Number })\n uploadPercentage!: number;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default \"Uploaded\"\n * @public\n */\n @property()\n uploadState: `${UDExFileUploadState}` = UDExFileUploadState.Uploaded;\n\n /**\n * Slot for information about the uploaded file.\n *\n * @slot\n * @public\n */\n @slot({ type: HTMLElement, \"default\": true }) uploadInfo!: Array<HTMLElement>;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default \"Large\"\n * @private\n */\n @property()\n _buttonSize!: `${UDExButtonSize}`;\n\n /**\n * Defines if the screen is at the M breakpoint.\n *\n * @default false\n * @private\n */\n @property({ type: Boolean })\n _breakpointM!: boolean;\n\n /**\n * Defines if the screen is at the L breakpoint.\n *\n * @default false\n * @private\n */\n @property({ type: Boolean })\n _breakpointL!: boolean;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n _handleResizeBound: ResizeObserverCallback;\n\n constructor() {\n super();\n this._handleResizeBound = this._handleResize.bind(this);\n }\n\n onEnterDOM(): void {\n ResizeHandler.register(this, this._handleResizeBound);\n this.fireDecoratorEvent(\"item-press\", {\n selected: false,\n item: this,\n });\n }\n\n onExitDOM(): void {\n ResizeHandler.deregister(this, this._handleResizeBound);\n }\n\n onAfterRendering(): void {\n const fileLink = this.fileLinkComponent;\n if (fileLink) {\n fileLink._setCustomAttributes([{ attribute: \"download\", value: \"true\" }]);\n }\n }\n\n handleButtonClick(e: Event) {\n e.stopImmediatePropagation();\n this.fireDecoratorEvent(\"request-delete\");\n }\n\n handleButtonKeydown(e: KeyboardEvent) {\n if (isEnter(e) || isSpace(e)) {\n e.stopImmediatePropagation();\n this.fireDecoratorEvent(\"request-delete\");\n }\n }\n\n _handleResize() {\n this._buttonSize = window.innerWidth <= BreakpointSizeS ? UDExButtonSize.Medium : UDExButtonSize.Large;\n this._breakpointL = window.innerWidth > BreakpointSizeM;\n this._breakpointM = !this._breakpointL ? true : !this._breakpointL && this.uploadState === UDExFileUploadState.Uploaded;\n }\n\n get fileLinkComponent(): UDExLink {\n return this.shadowRoot!.querySelector<UDExLink>(\"[udex-link]\")!;\n }\n\n get removeButtonAccessibleName(): string {\n return UDExUploadItem.i18nBundle.getText(REMOVE_FILE_TEXT);\n }\n\n get showUploadProgress(): boolean {\n return this.uploadState === UDExFileUploadState.Error || this.uploadState === UDExFileUploadState.Uploading;\n }\n\n get uploadProgressState(): ValueState {\n if (this.uploadState === UDExFileUploadState.Uploading) {\n return ValueState.Information;\n }\n\n return ValueState.Negative;\n }\n\n get uploadStatus(): string {\n if (this.uploadState === UDExFileUploadState.Uploading) {\n return `${UDExUploadItem.i18nBundle.getText(UPLOADING_FILE_STATUS_TEXT)} ${this.uploadPercentage}%`;\n }\n\n return `${UDExUploadItem.i18nBundle.getText(TERMINATED_FILE_STATUS_TEXT)} ${this.uploadPercentage}%`;\n }\n\n get fileInteractive(): boolean {\n return this.uploadState === UDExFileUploadState.Uploaded;\n }\n\n get additionalInfoClasses(): string {\n return `udex-upload-item__info ${this.uploadState === UDExFileUploadState.Error ? \"udex-upload-item__error\" : \"\"}`;\n }\n\n get uploadItemClasses(): string {\n return this.uploadState === \"Uploaded\" ? \"udex-upload-item__info-uploaded\" : \"\";\n }\n}\n\nUDExUploadItem.define();\n\nexport default UDExUploadItem;\n"]}
|
|
1
|
+
{"version":3,"file":"UploadItem.js","sourceRoot":"","sources":["../src/UploadItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC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MAAM,EAAE,CAAC;gDACP;AASlB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACP;AASlB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDACC;AAS1B;IADD,QAAQ,EAAE;mDAC4D;AAQzB;IAA7C,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;kDAAiC;AAS5E;IADD,QAAQ,EAAE;mDACyB;AASlC;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACH;AASvB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACH;AAGlB;IADN,IAAI,CAAC,yBAAyB,CAAC;wCACF;AA5E1B,cAAc;IAfnB,aAAa,CAAC;QACb,GAAG,EAAE,kBAAkB;QACvB,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,kBAAkB;QAC5B,YAAY,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,CAAC;KACpE,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;GAErC,cAAc,CAiKnB;AAED,cAAc,CAAC,MAAM,EAAE,CAAC;AAExB,eAAe,cAAc,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { slot } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport ValueState from \"@ui5/webcomponents-base/dist/types/ValueState.js\";\nimport { isEnter, isSpace } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { REMOVE_FILE_TEXT, TERMINATED_FILE_STATUS_TEXT, UPLOADING_FILE_STATUS_TEXT } from \"./generated/i18n/i18n-defaults.js\";\nimport UDExListItem from \"./ListItem.js\";\nimport UDExProgressBar from \"./ProgressBar.js\";\nimport UDExLink from \"./Link.js\";\nimport UDExButton from \"./Button.js\";\nimport UDExButtonSize from \"./types/ButtonSize.js\";\nimport UploadItemTemplate from \"./generated/templates/UploadItemTemplate.lit.js\";\n\n// Styles\nimport UploadItemCss from \"./generated/themes/UploadItem.css.js\";\nimport UDExFileUploadState from \"./types/FileUploadState.js\";\n\nconst BreakpointSizeS: number = 979;\nconst BreakpointSizeM: number = 1279;\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>udex-upload-item</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/UploadItem.js\";</code>\n *\n * @constructor\n * @extends UDExListItemBase\n * @public\n */\n@customElement({\n tag: \"udex-upload-item\",\n renderer: litRender,\n styles: UploadItemCss,\n template: UploadItemTemplate,\n dependencies: [UDExLink, UDExListItem, UDExProgressBar, UDExButton],\n})\n\n/**\n * Triggered when the upload item is deleted.\n *\n * @public\n */\n@event(\"request-delete\", { bubbles: true })\n\nclass UDExUploadItem extends UDExListItem {\n eventDetails!: {\n \"request-delete\": void\n } & UDExListItem[\"eventDetails\"];\n /**\n * Defines the name of the uploaded file.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n fileName!: string;\n\n /**\n * Defines the link of the uploaded file.\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n fileLink?: string;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default 0\n * @public\n */\n @property({ type: Number })\n uploadPercentage!: number;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default \"Uploaded\"\n * @public\n */\n @property()\n uploadState: `${UDExFileUploadState}` = UDExFileUploadState.Uploaded;\n\n /**\n * Slot for information about the uploaded file.\n *\n * @slot\n * @public\n */\n @slot({ type: HTMLElement, \"default\": true }) uploadInfo!: Array<HTMLElement>;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default \"Large\"\n * @private\n */\n @property()\n _buttonSize!: `${UDExButtonSize}`;\n\n /**\n * Defines if the screen is at the M breakpoint.\n *\n * @default false\n * @private\n */\n @property({ type: Boolean })\n _breakpointM!: boolean;\n\n /**\n * Defines if the screen is at the L breakpoint.\n *\n * @default false\n * @private\n */\n @property({ type: Boolean })\n _breakpointL!: boolean;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n _handleResizeBound: ResizeObserverCallback;\n\n constructor() {\n super();\n this._handleResizeBound = this._handleResize.bind(this);\n }\n\n onEnterDOM(): void {\n ResizeHandler.register(this, this._handleResizeBound);\n this.fireDecoratorEvent(\"item-press\", {\n selected: false,\n item: this,\n });\n }\n\n onExitDOM(): void {\n ResizeHandler.deregister(this, this._handleResizeBound);\n }\n\n onAfterRendering(): void {\n const fileLink = this.fileLinkComponent;\n if (fileLink) {\n fileLink._setCustomAttributes([{ attribute: \"download\", value: \"true\" }]);\n }\n }\n\n handleButtonClick(e: Event) {\n e.stopImmediatePropagation();\n this.fireDecoratorEvent(\"request-delete\");\n }\n\n handleButtonKeydown(e: KeyboardEvent) {\n if (isEnter(e) || isSpace(e)) {\n e.stopImmediatePropagation();\n this.fireDecoratorEvent(\"request-delete\");\n }\n }\n\n _handleResize() {\n this._buttonSize = window.innerWidth <= BreakpointSizeS ? UDExButtonSize.Medium : UDExButtonSize.Large;\n this._breakpointL = window.innerWidth > BreakpointSizeM;\n this._breakpointM = !this._breakpointL ? true : !this._breakpointL && this.uploadState === UDExFileUploadState.Uploaded;\n }\n\n get fileLinkComponent(): UDExLink {\n return this.shadowRoot!.querySelector<UDExLink>(\"[udex-link]\")!;\n }\n\n get removeButtonAccessibleName(): string {\n return UDExUploadItem.i18nBundle.getText(REMOVE_FILE_TEXT);\n }\n\n get showUploadProgress(): boolean {\n return this.uploadState === UDExFileUploadState.Error || this.uploadState === UDExFileUploadState.Uploading;\n }\n\n get uploadProgressState(): ValueState {\n if (this.uploadState === UDExFileUploadState.Uploading) {\n return ValueState.Information;\n }\n\n return ValueState.Negative;\n }\n\n get uploadStatus(): string {\n if (this.uploadState === UDExFileUploadState.Uploading) {\n return `${UDExUploadItem.i18nBundle.getText(UPLOADING_FILE_STATUS_TEXT)} ${this.uploadPercentage}%`;\n }\n\n return `${UDExUploadItem.i18nBundle.getText(TERMINATED_FILE_STATUS_TEXT)} ${this.uploadPercentage}%`;\n }\n\n get fileInteractive(): boolean {\n return this.uploadState === UDExFileUploadState.Uploaded;\n }\n\n get additionalInfoClasses(): string {\n return `udex-upload-item__info ${this.uploadState === UDExFileUploadState.Error ? \"udex-upload-item__error\" : \"\"}`;\n }\n\n get uploadItemClasses(): string {\n return this.uploadState === \"Uploaded\" ? \"udex-upload-item__info-uploaded\" : \"\";\n }\n}\n\nUDExUploadItem.define();\n\nexport default UDExUploadItem;\n"]}
|
package/dist/Wizard.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import type { ResizeObserverCallback } from "@ui5/webcomponents-base/dist/delega
|
|
|
3
3
|
import type UDExWizardTab from "./WizardTab.js";
|
|
4
4
|
import type UDExWizardStep from "./WizardStep.js";
|
|
5
5
|
import { UDExWindowSize } from "./types/common.js";
|
|
6
|
-
type AccessibilityInformation = {
|
|
6
|
+
export type AccessibilityInformation = {
|
|
7
7
|
ariaSetsize: number;
|
|
8
8
|
ariaPosinset: number;
|
|
9
9
|
ariaLabel: string;
|
|
10
10
|
};
|
|
11
|
-
type StepInfo = {
|
|
11
|
+
export type StepInfo = {
|
|
12
12
|
icon?: string;
|
|
13
13
|
titleText?: string;
|
|
14
14
|
subtitleText?: string;
|