All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.ListItem.js.map Maven / Gradle / Ivy

The newest version!
{"version":3,"file":"ListItem.js","sourceRoot":"","sources":["../src/ListItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EACN,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,GAChC,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,gBAAgB,MAAM,uDAAuD,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAElG,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,0CAA0C,CAAC;AAClD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EACN,MAAM,EACN,6BAA6B,EAC7B,iCAAiC,EACjC,kBAAkB,EAClB,sBAAsB,GACtB,MAAM,mCAAmC,CAAC;AAG3C,SAAS;AACT,OAAO,MAAM,MAAM,oCAAoC,CAAC;AACxD,OAAO,yBAAyB,MAAM,kDAAkD,CAAC;AAEzF,QAAQ;AACR,OAAO,mDAAmD,CAAC;AAkC3D;;;;;;;;GAQG;AAqBH,IAAe,QAAQ,gBAAvB,MAAe,QAAS,SAAQ,YAAY;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K,CAAC,sBAAsB,CAAC;GACf,QAAQ,CA4YtB;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport { getEventMark } from \"@ui5/webcomponents-base/dist/MarkedEvents.js\";\nimport {\n\tisSpace, isEnter, isDelete, isF2,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport getActiveElement from \"@ui5/webcomponents-base/dist/util/getActiveElement.js\";\nimport { getFirstFocusableElement } from \"@ui5/webcomponents-base/dist/util/FocusableElements.js\";\nimport type { AccessibilityAttributes, PassiveEventListenerObject } from \"@ui5/webcomponents-base/dist/types.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport type AriaHasPopup from \"@ui5/webcomponents-base/dist/types/AriaHasPopup.js\";\nimport \"@ui5/webcomponents-icons/dist/decline.js\";\nimport \"@ui5/webcomponents-icons/dist/edit.js\";\nimport Highlight from \"./types/Highlight.js\";\nimport ListItemType from \"./types/ListItemType.js\";\nimport ListSelectionMode from \"./types/ListSelectionMode.js\";\nimport ListItemBase from \"./ListItemBase.js\";\nimport RadioButton from \"./RadioButton.js\";\nimport CheckBox from \"./CheckBox.js\";\nimport Button from \"./Button.js\";\nimport type { IButton } from \"./Button.js\";\nimport {\n\tDELETE,\n\tARIA_LABEL_LIST_ITEM_CHECKBOX,\n\tARIA_LABEL_LIST_ITEM_RADIO_BUTTON,\n\tLIST_ITEM_SELECTED,\n\tLIST_ITEM_NOT_SELECTED,\n} from \"./generated/i18n/i18n-defaults.js\";\nimport type ListItemAccessibleRole from \"./types/ListItemAccessibleRole.js\";\n\n// Styles\nimport styles from \"./generated/themes/ListItem.css.js\";\nimport listItemAdditionalTextCss from \"./generated/themes/ListItemAdditionalText.css.js\";\n\n// Icons\nimport \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\n\ninterface IAccessibleListItem {\n\taccessibleName?: string;\n\taccessibleNameRef?: string;\n}\n\ntype SelectionRequestEventDetail = {\n\titem: ListItemBase,\n\tselectionComponentPressed: boolean,\n\tselected?: boolean,\n\tkey?: string,\n}\n\ntype AccInfo = {\n\trole?: string;\n\tariaExpanded?: boolean;\n\tariaLevel?: number;\n\tariaLabel: string;\n\tariaLabelRadioButton: string;\n\tariaSelectedText?: string;\n\tariaHaspopup?: `${Lowercase}`;\n\tposinset?: number;\n\tsetsize?: number;\n\tariaSelected?: boolean;\n\tariaChecked?: boolean;\n\tlistItemAriaLabel?: string;\n\tariaOwns?: string;\n\ttooltip?: string;\n\tariaKeyShortcuts?: string;\n}\n\ntype ListItemAccessibilityAttributes = Pick;\n\n/**\n * @class\n * A class to serve as a base\n * for the `ListItemStandard` and `ListItemCustom` classes.\n * @constructor\n * @abstract\n * @extends ListItemBase\n * @public\n */\n@customElement({\n\tlanguageAware: true,\n\tstyles: [\n\t\tListItemBase.styles,\n\t\tlistItemAdditionalTextCss,\n\t\tstyles,\n\t],\n\tdependencies: [\n\t\tButton,\n\t\tRadioButton,\n\t\tCheckBox,\n\t],\n})\n/**\n * Fired when the user clicks on the detail button when type is `Detail`.\n * @public\n */\n@event(\"detail-click\")\n@event(\"_focused\")\n@event(\"_selection-requested\")\nabstract class ListItem extends ListItemBase {\n\t/**\n\t * Defines the visual indication and behavior of the list items.\n\t * Available options are `Active` (by default), `Inactive`, `Detail` and `Navigation`.\n\t *\n\t * **Note:** When set to `Active` or `Navigation`, the item will provide visual response upon press and hover,\n\t * while with type `Inactive` and `Detail` - will not.\n\t * @default \"Active\"\n\t * @public\n\t*/\n\t@property()\n\ttype: `${ListItemType}` = \"Active\";\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The following fields are supported:\n\t *\n\t * - **ariaSetsize**: Defines the number of items in the current set  when not all items in the set are present in the DOM.\n\t * **Note:** The value is an integer reflecting the number of items in the complete set. If the size of the entire set is unknown, set `-1`.\n\t *\n\t * \t- **ariaPosinset**: Defines an element's number or position in the current set when not all items are present in the DOM.\n\t * \t**Note:** The value is an integer greater than or equal to 1, and less than or equal to the size of the set when that size is known.\n\t *\n\t * @default {}\n\t * @public\n\t * @since 1.15.0\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: ListItemAccessibilityAttributes = {};\n\n\t/**\n\t * The navigated state of the list item.\n\t * If set to `true`, a navigation indicator is displayed at the end of the list item.\n\t * @default false\n\t * @public\n\t * @since 1.10.0\n\t */\n\t@property({ type: Boolean })\n\tnavigated = false;\n\n\t/**\n\t * Defines the text of the tooltip that would be displayed for the list item.\n\t * @default undefined\n\t * @public\n\t * @since 1.23.0\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * Indicates if the list item is active, e.g pressed down with the mouse or the keyboard keys.\n\t * @private\n\t*/\n\t@property({ type: Boolean })\n\tactive = false;\n\n\t/**\n\t * Defines the highlight state of the list items.\n\t * Available options are: `\"None\"` (by default), `\"Positive\"`, `\"Critical\"`, `\"Information\"` and `\"Negative\"`.\n\t * @default \"None\"\n\t * @public\n\t * @since 1.24\n\t */\n\t@property()\n\thighlight: `${Highlight}` = \"None\";\n\n\t/**\n\t * Defines the selected state of the component.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdeclare selected: boolean;\n\n\t/**\n\t * Used to define the role of the list item.\n\t * @private\n\t * @default \"ListItem\"\n\t * @since 1.3.0\n\t *\n\t */\n\t@property()\n\taccessibleRole: `${ListItemAccessibleRole}` = \"ListItem\";\n\n\t@property()\n\t_selectionMode: `${ListSelectionMode}` = \"None\";\n\n\t/**\n\t * Defines the delete button, displayed in \"Delete\" mode.\n\t * **Note:** While the slot allows custom buttons, to match\n\t * design guidelines, please use the `ui5-button` component.\n\t * **Note:** When the slot is not present, a built-in delete button will be displayed.\n\t * @since 1.9.0\n\t * @public\n\t*/\n\t@slot()\n\tdeleteButton!: Array;\n\n\tdeactivateByKey: (e: KeyboardEvent) => void;\n\tdeactivate: () => void;\n\t_ontouchstart: PassiveEventListenerObject;\n\t// used in template, implemented in TreeItemBase, ListItemStandard\n\taccessibleName?: string;\n\t// used in ListItem template but implemented in TreeItemBase\n\tindeterminate?: boolean;\n\t// Used in UploadCollectionItem\n\tdisableDeleteButton?: boolean;\n\n\tstatic i18nBundle: I18nBundle;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.deactivateByKey = (e: KeyboardEvent) => {\n\t\t\tif (isEnter(e)) {\n\t\t\t\tthis.deactivate();\n\t\t\t}\n\t\t};\n\n\t\tthis.deactivate = () => {\n\t\t\tif (this.active) {\n\t\t\t\tthis.active = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleTouchStartEvent = (e: TouchEvent) => {\n\t\t\tthis._onmousedown(e as unknown as MouseEvent);\n\t\t};\n\n\t\tthis._ontouchstart = {\n\t\t\thandleEvent: handleTouchStartEvent,\n\t\t\tpassive: true,\n\t\t};\n\t}\n\n\tonBeforeRendering() {\n\t\tsuper.onBeforeRendering();\n\t\tthis.actionable = (this.type === ListItemType.Active || this.type === ListItemType.Navigation) && (this._selectionMode !== ListSelectionMode.Delete);\n\t}\n\n\tonEnterDOM() {\n\t\tsuper.onEnterDOM();\n\t\tdocument.addEventListener(\"mouseup\", this.deactivate);\n\t\tdocument.addEventListener(\"touchend\", this.deactivate);\n\t\tdocument.addEventListener(\"keyup\", this.deactivateByKey);\n\t}\n\n\tonExitDOM() {\n\t\tdocument.removeEventListener(\"mouseup\", this.deactivate);\n\t\tdocument.removeEventListener(\"keyup\", this.deactivateByKey);\n\t\tdocument.removeEventListener(\"touchend\", this.deactivate);\n\t}\n\n\tasync _onkeydown(e: KeyboardEvent) {\n\t\tsuper._onkeydown(e);\n\n\t\tconst itemActive = this.type === ListItemType.Active,\n\t\t\titemNavigated = this.typeNavigation;\n\n\t\tif ((isSpace(e) || isEnter(e)) && (itemActive || itemNavigated)) {\n\t\t\tthis.activate();\n\t\t}\n\n\t\tif (isF2(e)) {\n\t\t\tconst activeElement = getActiveElement();\n\t\t\tconst focusDomRef = this.getFocusDomRef()!;\n\n\t\t\tif (activeElement === focusDomRef) {\n\t\t\t\tconst firstFocusable = await getFirstFocusableElement(focusDomRef);\n\t\t\t\tfirstFocusable?.focus();\n\t\t\t} else {\n\t\t\t\tfocusDomRef.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tsuper._onkeyup(e);\n\n\t\tif (isSpace(e) || isEnter(e)) {\n\t\t\tthis.deactivate();\n\t\t}\n\n\t\tif (this.modeDelete && isDelete(e)) {\n\t\t\tthis.onDelete();\n\t\t}\n\t}\n\n\t_onmousedown(e: MouseEvent) {\n\t\tif (getEventMark(e) === \"button\") {\n\t\t\treturn;\n\t\t}\n\t\tthis.activate();\n\t}\n\n\t_onmouseup(e: MouseEvent) {\n\t\tif (getEventMark(e) === \"button\") {\n\t\t\treturn;\n\t\t}\n\t\tthis.deactivate();\n\t}\n\n\t_ontouchend(e: TouchEvent) {\n\t\tthis._onmouseup(e as unknown as MouseEvent);\n\t}\n\n\t_onfocusout() {\n\t\tthis.deactivate();\n\t}\n\n\t_ondragstart(e: DragEvent) {\n\t\tif (!e.dataTransfer) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.target === this._listItem) {\n\t\t\tthis.setAttribute(\"data-moving\", \"\");\n\t\t\te.dataTransfer.dropEffect = \"move\";\n\t\t\te.dataTransfer.effectAllowed = \"move\";\n\t\t}\n\t}\n\n\t_ondragend(e: DragEvent) {\n\t\tif (e.target === this._listItem) {\n\t\t\tthis.removeAttribute(\"data-moving\");\n\t\t}\n\t}\n\n\t/**\n\t * Called when selection components in Single (ui5-radio-button)\n\t * and Multi (ui5-checkbox) selection modes are used.\n\t */\n\tonMultiSelectionComponentPress(e: MouseEvent) {\n\t\tif (this.isInactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.fireEvent(\"_selection-requested\", { item: this, selected: (e.target as CheckBox).checked, selectionComponentPressed: true });\n\t}\n\n\tonSingleSelectionComponentPress(e: MouseEvent) {\n\t\tif (this.isInactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.fireEvent(\"_selection-requested\", { item: this, selected: !(e.target as RadioButton).checked, selectionComponentPressed: true });\n\t}\n\n\tactivate() {\n\t\tif (this.type === ListItemType.Active || this.type === ListItemType.Navigation) {\n\t\t\tthis.active = true;\n\t\t}\n\t}\n\n\tonDelete() {\n\t\tthis.fireEvent(\"_selection-requested\", { item: this, selectionComponentPressed: false });\n\t}\n\n\tonDetailClick() {\n\t\tthis.fireEvent(\"detail-click\", { item: this, selected: this.selected });\n\t}\n\n\tfireItemPress(e: Event) {\n\t\tif (this.isInactive) {\n\t\t\treturn;\n\t\t}\n\t\tsuper.fireItemPress(e);\n\t}\n\n\tget isInactive() {\n\t\treturn this.type === ListItemType.Inactive || this.type === ListItemType.Detail;\n\t}\n\n\tget placeSelectionElementBefore() {\n\t\treturn this._selectionMode === ListSelectionMode.Multiple\n\t\t\t|| this._selectionMode === ListSelectionMode.SingleStart;\n\t}\n\n\tget placeSelectionElementAfter() {\n\t\treturn !this.placeSelectionElementBefore\n\t\t\t&& (this._selectionMode === ListSelectionMode.SingleEnd || this._selectionMode === ListSelectionMode.Delete);\n\t}\n\n\tget modeSingleSelect() {\n\t\treturn [\n\t\t\tListSelectionMode.SingleStart,\n\t\t\tListSelectionMode.SingleEnd,\n\t\t\tListSelectionMode.Single,\n\t\t].includes(this._selectionMode as ListSelectionMode);\n\t}\n\n\tget modeMultiple() {\n\t\treturn this._selectionMode === ListSelectionMode.Multiple;\n\t}\n\n\tget modeDelete() {\n\t\treturn this._selectionMode === ListSelectionMode.Delete;\n\t}\n\n\t/**\n\t * Used in UploadCollectionItem\n\t */\n\tget renderDeleteButton() {\n\t\treturn this.modeDelete;\n\t}\n\n\t/**\n\t * End\n\t */\n\n\tget typeDetail() {\n\t\treturn this.type === ListItemType.Detail;\n\t}\n\n\tget typeNavigation() {\n\t\treturn this.type === ListItemType.Navigation;\n\t}\n\n\tget typeActive() {\n\t\treturn this.type === ListItemType.Active;\n\t}\n\n\tget _ariaSelected() {\n\t\tif (this.modeMultiple || this.modeSingleSelect) {\n\t\t\treturn this.selected;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tget listItemAccessibleRole() {\n\t\treturn this.accessibleRole.toLowerCase();\n\t}\n\n\tget ariaSelectedText() {\n\t\tlet ariaSelectedText;\n\n\t\t// Selected state needs to be supported separately since now the role mapping is list -> listitem[]\n\t\t// to avoid the issue of nesting interactive elements, ex. (option -> radio/checkbox);\n\t\t// The text is added to aria-describedby because as part of the aria-labelledby\n\t\t// the whole content of the item is readout when the aria-labelledby value is changed.\n\t\tif (this._ariaSelected !== undefined) {\n\t\t\tariaSelectedText = this._ariaSelected ? ListItem.i18nBundle.getText(LIST_ITEM_SELECTED) : ListItem.i18nBundle.getText(LIST_ITEM_NOT_SELECTED);\n\t\t}\n\n\t\treturn ariaSelectedText;\n\t}\n\n\tget deleteText() {\n\t\treturn ListItem.i18nBundle.getText(DELETE);\n\t}\n\n\tget hasDeleteButtonSlot() {\n\t\treturn !!this.deleteButton.length;\n\t}\n\n\tget _accessibleNameRef(): string {\n\t\tif ((this as IAccessibleListItem).accessibleName) {\n\t\t\t// accessibleName is set - return labels excluding content\n\t\t\treturn `${this._id}-invisibleText`;\n\t\t}\n\n\t\t// accessibleName is not set - return _accInfo.listItemAriaLabel including content\n\t\treturn `${this._id}-content ${this._id}-invisibleText`;\n\t}\n\n\tget _accInfo(): AccInfo {\n\t\treturn {\n\t\t\trole: this.listItemAccessibleRole,\n\t\t\tariaExpanded: undefined,\n\t\t\tariaLevel: undefined,\n\t\t\tariaLabel: ListItem.i18nBundle.getText(ARIA_LABEL_LIST_ITEM_CHECKBOX),\n\t\t\tariaLabelRadioButton: ListItem.i18nBundle.getText(ARIA_LABEL_LIST_ITEM_RADIO_BUTTON),\n\t\t\tariaSelectedText: this.ariaSelectedText,\n\t\t\tariaHaspopup: this.accessibilityAttributes.hasPopup,\n\t\t\tsetsize: this.accessibilityAttributes.ariaSetsize,\n\t\t\tposinset: this.accessibilityAttributes.ariaPosinset,\n\t\t\ttooltip: this.tooltip,\n\t\t};\n\t}\n\n\tget _hasHighlightColor() {\n\t\treturn this.highlight !== Highlight.None;\n\t}\n\n\tget hasConfigurableMode() {\n\t\treturn true;\n\t}\n\n\tget _listItem() {\n\t\treturn this.shadowRoot!.querySelector(\"li\");\n\t}\n\n\tstatic async onDefine() {\n\t\tListItem.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n}\n\nexport default ListItem;\nexport type {\n\tIAccessibleListItem,\n\tSelectionRequestEventDetail,\n\tListItemAccessibilityAttributes,\n};\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy