@ui5/webcomponents 2.27.0-rc.0 → 2.27.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/AvatarBadge.d.ts +16 -0
- package/dist/AvatarBadge.js +6 -0
- package/dist/AvatarBadge.js.map +1 -1
- package/dist/CardHeaderTemplate.js +6 -5
- package/dist/CardHeaderTemplate.js.map +1 -1
- package/dist/DatePicker.d.ts +4 -4
- package/dist/DatePicker.js +4 -4
- package/dist/DatePicker.js.map +1 -1
- package/dist/DateTimeInput.d.ts +6 -0
- package/dist/DateTimeInput.js +11 -0
- package/dist/DateTimeInput.js.map +1 -1
- package/dist/DayPicker.d.ts +1 -0
- package/dist/DayPicker.js +4 -1
- package/dist/DayPicker.js.map +1 -1
- package/dist/DayPickerTemplate.js +1 -1
- package/dist/DayPickerTemplate.js.map +1 -1
- package/dist/Filters.js +1 -1
- package/dist/Filters.js.map +1 -1
- package/dist/Icon.js +3 -0
- package/dist/Icon.js.map +1 -1
- package/dist/List.js +5 -2
- package/dist/List.js.map +1 -1
- package/dist/ListItem.d.ts +4 -2
- package/dist/ListItem.js +5 -9
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItemGroup.d.ts +7 -23
- package/dist/ListItemGroup.js +4 -21
- package/dist/ListItemGroup.js.map +1 -1
- package/dist/ListItemGroupBase.d.ts +41 -0
- package/dist/ListItemGroupBase.js +54 -0
- package/dist/ListItemGroupBase.js.map +1 -0
- package/dist/ListItemStandardTemplate.js +1 -1
- package/dist/ListItemStandardTemplate.js.map +1 -1
- package/dist/NumberInput.d.ts +1 -1
- package/dist/NumberInput.js +1 -1
- package/dist/NumberInput.js.map +1 -1
- package/dist/OptionGroup.d.ts +4 -4
- package/dist/OptionGroup.js +3 -3
- package/dist/OptionGroup.js.map +1 -1
- package/dist/Popover.js +5 -3
- package/dist/Popover.js.map +1 -1
- package/dist/SplitButton.d.ts +7 -3
- package/dist/SplitButton.js +4 -4
- package/dist/SplitButton.js.map +1 -1
- package/dist/SplitButtonTemplate.js +1 -1
- package/dist/SplitButtonTemplate.js.map +1 -1
- package/dist/TableHeaderCell.d.ts +3 -0
- package/dist/TableHeaderCell.js +16 -0
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderCellTemplate.js +3 -15
- package/dist/TableHeaderCellTemplate.js.map +1 -1
- package/dist/TableHeaderRow.d.ts +2 -0
- package/dist/TableHeaderRow.js +6 -0
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableHeaderRowTemplate.js +6 -7
- package/dist/TableHeaderRowTemplate.js.map +1 -1
- package/dist/TableRow.d.ts +2 -0
- package/dist/TableRow.js +6 -0
- package/dist/TableRow.js.map +1 -1
- package/dist/TableRowActionBase.d.ts +3 -1
- package/dist/TableRowActionBase.js +8 -0
- package/dist/TableRowActionBase.js.map +1 -1
- package/dist/TableRowBase.d.ts +1 -0
- package/dist/TableRowBase.js +3 -0
- package/dist/TableRowBase.js.map +1 -1
- package/dist/TableRowTemplate.js +6 -11
- package/dist/TableRowTemplate.js.map +1 -1
- package/dist/TableSelection.d.ts +5 -0
- package/dist/TableSelection.js +11 -0
- package/dist/TableSelection.js.map +1 -1
- package/dist/TableSelectionBase.d.ts +13 -0
- package/dist/TableSelectionBase.js +18 -0
- package/dist/TableSelectionBase.js.map +1 -1
- package/dist/TableSelectionMulti.d.ts +5 -0
- package/dist/TableSelectionMulti.js +12 -0
- package/dist/TableSelectionMulti.js.map +1 -1
- package/dist/TableSelectionSingle.d.ts +2 -0
- package/dist/TableSelectionSingle.js +4 -0
- package/dist/TableSelectionSingle.js.map +1 -1
- package/dist/TimePicker.d.ts +10 -0
- package/dist/TimePicker.js +51 -11
- package/dist/TimePicker.js.map +1 -1
- package/dist/TimePickerPopoverTemplate.js +1 -1
- package/dist/TimePickerPopoverTemplate.js.map +1 -1
- package/dist/TimePickerTemplate.js +1 -1
- package/dist/TimePickerTemplate.js.map +1 -1
- package/dist/Tokenizer.d.ts +6 -0
- package/dist/Tokenizer.js +27 -10
- package/dist/Tokenizer.js.map +1 -1
- package/dist/Toolbar.d.ts +27 -0
- package/dist/Toolbar.js +102 -20
- package/dist/Toolbar.js.map +1 -1
- package/dist/ToolbarButton.d.ts +18 -0
- package/dist/ToolbarButton.js +16 -0
- package/dist/ToolbarButton.js.map +1 -1
- package/dist/ToolbarButtonTemplate.js +1 -1
- package/dist/ToolbarButtonTemplate.js.map +1 -1
- package/dist/ToolbarItemBase.d.ts +51 -0
- package/dist/ToolbarItemBase.js +89 -0
- package/dist/ToolbarItemBase.js.map +1 -1
- package/dist/css/themes/AvatarBadge.css +1 -1
- package/dist/css/themes/CardHeader.css +1 -1
- package/dist/custom-elements-internal.json +298 -187
- package/dist/custom-elements.json +272 -127
- package/dist/generated/assets/i18n/messagebundle_ar.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_bg.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ca.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cnr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cs.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cy.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_da.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_de.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_el.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_GB.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_es.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_es_MX.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_et.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hu.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_id.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_it.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_iw.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ja.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_kk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ko.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lv.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_mk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ms.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_nl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_no.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ro.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ru.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sh.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sv.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_th.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_tr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_uk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_vi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_zh_TW.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +4 -1
- package/dist/generated/i18n/i18n-defaults.js +7 -4
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/themes/AvatarBadge.css.d.ts +1 -1
- package/dist/generated/themes/AvatarBadge.css.js +1 -1
- package/dist/generated/themes/AvatarBadge.css.js.map +1 -1
- package/dist/generated/themes/CardHeader.css.d.ts +1 -1
- package/dist/generated/themes/CardHeader.css.js +1 -1
- package/dist/generated/themes/CardHeader.css.js.map +1 -1
- package/dist/types/ListItemType.d.ts +2 -1
- package/dist/types/ListItemType.js +2 -1
- package/dist/types/ListItemType.js.map +1 -1
- package/dist/vscode.html-custom-data.json +57 -27
- package/dist/web-types.json +117 -87
- package/package.json +9 -9
- package/src/CardHeaderTemplate.tsx +19 -20
- package/src/DayPickerTemplate.tsx +1 -1
- package/src/ListItemStandardTemplate.tsx +1 -1
- package/src/SplitButtonTemplate.tsx +1 -2
- package/src/TableHeaderCellTemplate.tsx +4 -16
- package/src/TableHeaderRowTemplate.tsx +15 -15
- package/src/TableRowTemplate.tsx +10 -20
- package/src/TimePickerPopoverTemplate.tsx +1 -0
- package/src/TimePickerTemplate.tsx +1 -0
- package/src/ToolbarButtonTemplate.tsx +2 -0
- package/src/i18n/messagebundle.properties +9 -0
- package/src/i18n/messagebundle_ar.properties +13 -6
- package/src/i18n/messagebundle_bg.properties +13 -6
- package/src/i18n/messagebundle_ca.properties +13 -6
- package/src/i18n/messagebundle_cnr.properties +13 -6
- package/src/i18n/messagebundle_cs.properties +13 -6
- package/src/i18n/messagebundle_cy.properties +13 -6
- package/src/i18n/messagebundle_da.properties +13 -6
- package/src/i18n/messagebundle_de.properties +13 -6
- package/src/i18n/messagebundle_el.properties +13 -6
- package/src/i18n/messagebundle_en.properties +13 -6
- package/src/i18n/messagebundle_en_GB.properties +13 -6
- package/src/i18n/messagebundle_en_US_sappsd.properties +13 -6
- package/src/i18n/messagebundle_en_US_saprigi.properties +13 -6
- package/src/i18n/messagebundle_en_US_saptrc.properties +13 -6
- package/src/i18n/messagebundle_es.properties +13 -6
- package/src/i18n/messagebundle_es_MX.properties +13 -6
- package/src/i18n/messagebundle_et.properties +13 -6
- package/src/i18n/messagebundle_fi.properties +13 -6
- package/src/i18n/messagebundle_fr.properties +13 -6
- package/src/i18n/messagebundle_fr_CA.properties +13 -6
- package/src/i18n/messagebundle_hi.properties +13 -6
- package/src/i18n/messagebundle_hr.properties +13 -6
- package/src/i18n/messagebundle_hu.properties +13 -6
- package/src/i18n/messagebundle_id.properties +13 -6
- package/src/i18n/messagebundle_it.properties +13 -6
- package/src/i18n/messagebundle_iw.properties +13 -6
- package/src/i18n/messagebundle_ja.properties +13 -6
- package/src/i18n/messagebundle_kk.properties +13 -6
- package/src/i18n/messagebundle_ko.properties +13 -6
- package/src/i18n/messagebundle_lt.properties +13 -6
- package/src/i18n/messagebundle_lv.properties +13 -6
- package/src/i18n/messagebundle_mk.properties +13 -6
- package/src/i18n/messagebundle_ms.properties +13 -6
- package/src/i18n/messagebundle_nl.properties +13 -6
- package/src/i18n/messagebundle_no.properties +13 -6
- package/src/i18n/messagebundle_pl.properties +13 -6
- package/src/i18n/messagebundle_pt.properties +13 -6
- package/src/i18n/messagebundle_pt_PT.properties +13 -6
- package/src/i18n/messagebundle_ro.properties +13 -6
- package/src/i18n/messagebundle_ru.properties +13 -6
- package/src/i18n/messagebundle_sh.properties +13 -6
- package/src/i18n/messagebundle_sk.properties +13 -6
- package/src/i18n/messagebundle_sl.properties +13 -6
- package/src/i18n/messagebundle_sr.properties +13 -6
- package/src/i18n/messagebundle_sv.properties +13 -6
- package/src/i18n/messagebundle_th.properties +13 -6
- package/src/i18n/messagebundle_tr.properties +13 -6
- package/src/i18n/messagebundle_uk.properties +13 -6
- package/src/i18n/messagebundle_vi.properties +13 -6
- package/src/i18n/messagebundle_zh_CN.properties +13 -6
- package/src/i18n/messagebundle_zh_TW.properties +13 -6
- package/src/themes/AvatarBadge.css +12 -0
- package/src/themes/CardHeader.css +12 -14
package/dist/SplitButton.js
CHANGED
|
@@ -128,8 +128,6 @@ let SplitButton = SplitButton_1 = class SplitButton extends UI5Element {
|
|
|
128
128
|
* - **root**: Attributes that will be applied to the main (text) button.
|
|
129
129
|
* - **hasPopup**: Indicates the presence and type of popup triggered by the button.
|
|
130
130
|
* Accepts string values: `"dialog"`, `"grid"`, `"listbox"`, `"menu"`, or `"tree"`.
|
|
131
|
-
* - **roleDescription**: Provides a human-readable description for the role of the button.
|
|
132
|
-
* Accepts any string value.
|
|
133
131
|
* - **title**: Specifies a tooltip or description for screen readers.
|
|
134
132
|
* Accepts any string value.
|
|
135
133
|
* - **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or give focus to the button.
|
|
@@ -320,7 +318,6 @@ let SplitButton = SplitButton_1 = class SplitButton extends UI5Element {
|
|
|
320
318
|
return {
|
|
321
319
|
root: {
|
|
322
320
|
hasPopup: this.accessibilityAttributes?.root?.hasPopup,
|
|
323
|
-
roleDescription: this.accessibilityAttributes?.root?.roleDescription || (this._hideArrowButton ? undefined : SplitButton_1.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION)),
|
|
324
321
|
title: this.accessibilityAttributes?.root?.title,
|
|
325
322
|
ariaKeyShortcuts: this.accessibilityAttributes?.root?.ariaKeyShortcuts,
|
|
326
323
|
},
|
|
@@ -334,7 +331,7 @@ let SplitButton = SplitButton_1 = class SplitButton extends UI5Element {
|
|
|
334
331
|
get accInfo() {
|
|
335
332
|
return {
|
|
336
333
|
"keyboardHint": SplitButton_1.i18nBundle.getText(SPLIT_BUTTON_KEYBOARD_HINT),
|
|
337
|
-
"description": SplitButton_1.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION),
|
|
334
|
+
"description": this._roleDescription || SplitButton_1.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION),
|
|
338
335
|
};
|
|
339
336
|
}
|
|
340
337
|
get arrowButtonTooltip() {
|
|
@@ -380,6 +377,9 @@ __decorate([
|
|
|
380
377
|
__decorate([
|
|
381
378
|
property({ type: Boolean })
|
|
382
379
|
], SplitButton.prototype, "_hideArrowButton", void 0);
|
|
380
|
+
__decorate([
|
|
381
|
+
property({ noAttribute: true })
|
|
382
|
+
], SplitButton.prototype, "_roleDescription", void 0);
|
|
383
383
|
__decorate([
|
|
384
384
|
property({ type: Object })
|
|
385
385
|
], SplitButton.prototype, "accessibilityAttributes", void 0);
|
package/dist/SplitButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitButton.js","sourceRoot":"","sources":["../src/SplitButton.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,qBAAqB,MAAM,4DAA4D,CAAC;AAC/F,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,IAAI,EACJ,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAO,EACP,SAAS,EACT,aAAa,GACb,MAAM,sCAAsC,CAAC;AAG9C,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAK/E,OAAO,EACN,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,GACjC,MAAM,mCAAmC,CAAC;AAE3C,WAAW;AACX,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAE3D,SAAS;AACT,OAAO,cAAc,MAAM,uCAAuC,CAAC;AAMnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAsBH,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,UAAU;IA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AO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;qEACN;AAQzC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;sDACrB;AAQ1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;uDACpB;AAa3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACT;AASlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qDACH;AA0BzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DACsC;AASjE;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;yCACb;AAGlB;IADN,IAAI,CAAC,oBAAoB,CAAC;qCACG;AA/IzB,WAAW;IArBhB,aAAa,CAAC;QACd,GAAG,EAAE,kBAAkB;QACvB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,cAAc;QACtB,QAAQ,EAAE,mBAAmB;KAC7B,CAAC;IACF;;;OAGG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,aAAa,EAAE;QACrB,OAAO,EAAE,IAAI;KACb,CAAC;GACI,WAAW,CAqYhB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC;AAK3B,MAAM,CAAC,MAAM,uBAAuB,GAAG,qBAAqB,CAAc,eAAe,CAAC,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport createInstanceChecker from \"@ui5/webcomponents-base/dist/util/createInstanceChecker.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport {\n\tisEscape,\n\tisSpace,\n\tisEnter,\n\tisDown,\n\tisUp,\n\tisDownAlt,\n\tisUpAlt,\n\tisF4,\n\tisShift,\n\tisTabNext,\n\tisTabPrevious,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\nimport type { AriaHasPopup, UI5CustomEvent } from \"@ui5/webcomponents-base\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type ButtonDesign from \"./types/ButtonDesign.js\";\nimport type Button from \"./Button.js\";\n\nimport {\n\tSPLIT_BUTTON_DESCRIPTION,\n\tSPLIT_BUTTON_KEYBOARD_HINT,\n\tSPLIT_BUTTON_ARROW_BUTTON_TOOLTIP,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Template\nimport SplitButtonTemplate from \"./SplitButtonTemplate.js\";\n\n// Styles\nimport SplitButtonCss from \"./generated/themes/SplitButton.css.js\";\n\ntype SplitButtonRootAccAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"roleDescription\" | \"title\" | \"ariaKeyShortcuts\">;\ntype SplitButtonArrowButtonAccAtributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"expanded\" | \"title\">;\ntype SplitButtonAccessibilityAttributes = {root?: SplitButtonRootAccAttributes, arrowButton?: SplitButtonArrowButtonAccAtributes}\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-split-button` enables users to trigger actions. It is constructed of two separate actions -\n * default action and arrow action that can be activated by clicking or tapping, or by\n * pressing certain keyboard keys - `Space` or `Enter` for default action,\n * and `Arrow Down` or `Arrow Up` for arrow action.\n *\n * ### Usage\n *\n * `ui5-split-button` consists two separate buttons:\n *\n * - for the first one (default action) you can define some `text` or an `icon`, or both.\n * - the second one (arrow action) contains only `slim-arrow-down` icon.\n *\n * You can choose a `design` from a set of predefined types (the same as for ui5-button) that offer\n * different styling to correspond to the triggered action. Both text and arrow actions have the same design.\n *\n * You can set the `ui5-split-button` as enabled or disabled. Both parts of an enabled\n * `ui5-split-button` can be pressed by clicking or tapping it, or by certain keys, which changes\n * the style to provide visual feedback to the user that it is pressed or hovered over with\n * the mouse cursor. A disabled `ui5-split-button` appears inactive and any of the two buttons\n * cannot be pressed.\n *\n * ### Keyboard Handling\n *\n * - `Space` or `Enter` - triggers the default action\n * - `Shift` or `Escape` - if `Space` is pressed, releases the default action button without triggering the click event.\n * - `Arrow Down`, `Arrow Up`, `Alt`+`Arrow Down`, `Alt`+`Arrow Up`, or `F4` - triggers the arrow action\n * There are separate events that are fired on activating of `ui5-split-button` parts:\n *\n * - `click` for the first button (default action)\n * - `arrow-click` for the second button (arrow action)\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/SplitButton.js\";`\n * @csspart button - Used to style the native button element\n * @csspart icon - Used to style the icon in the native button element\n * @csspart endIcon - Used to style the end icon in the native button element\n * @constructor\n * @extends UI5Element\n * @public\n * @since 1.1.0\n */\n@customElement({\n\ttag: \"ui5-split-button\",\n\trenderer: jsxRenderer,\n\tstyles: SplitButtonCss,\n\ttemplate: SplitButtonTemplate,\n})\n/**\n * Fired when the user clicks on the default action.\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the user clicks on the arrow action.\n * @public\n */\n@event(\"arrow-click\", {\n\tbubbles: true,\n})\nclass SplitButton extends UI5Element {\n\teventDetails!: {\n\t\tclick: void;\n\t\t\"arrow-click\": void;\n\t}\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * Example:\n\t *\n\t * See all available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines whether the arrow button should have the active state styles or not.\n\t * @default false\n\t * @public\n\t * @since 1.21.0\n\t */\n\t@property({ type: Boolean })\n\tactiveArrowButton = false;\n\n\t/**\n\t * Defines the component design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign: `${ButtonDesign}` = \"Default\";\n\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the tabIndex of the component.\n\t * @default \"0\"\n\t * @private\n\t */\n\t@property({ type: Number, noAttribute: true })\n\t_tabIndex = 0\n\n\t/**\n\t * Indicates if there is Shift or Escape key pressed while Space key is down.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_shiftOrEscapePressedDuringSpace = false;\n\n\t/**\n\t * Defines the active state of the text button\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_textButtonActive = false;\n\n\t/**\n\t * Defines the state of the internal Button used for the Arrow button of the SplitButton.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_activeArrowButton = false;\n\n\t/**\n\t * Defines the display of the end icon as a graphical element within the default action of the component after the button text.\n\t * The SAP-icons font provides different options.\n\t *\n\t * Example:\n\t *\n\t * See all available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @private\n\t */\n\t@property({ type: String })\n\t_endIcon?: string;\n\n\t/**\n\t * Defines the visibility of the arrow button of the component.\n\t *\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_hideArrowButton = false;\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The `accessibilityAttributes` property accepts an object with the following optional fields:\n\t *\n\t * - **root**: Attributes that will be applied to the main (text) button.\n\t * - **hasPopup**: Indicates the presence and type of popup triggered by the button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **roleDescription**: Provides a human-readable description for the role of the button.\n\t * Accepts any string value.\n\t * - **title**: Specifies a tooltip or description for screen readers.\n\t * Accepts any string value.\n\t * \t- **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or give focus to the button.\n\t *\n\t * - **arrowButton**: Attributes applied specifically to the arrow (split) button.\n\t * - **hasPopup**: Indicates the presence and type of popup triggered by the arrow button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **expanded**: Indicates whether the popup triggered by the arrow button is currently expanded.\n\t * Accepts boolean values: `true` or `false`.\n\t *\n\t * @default {}\n\t * @public\n\t * @since 2.13.0\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: SplitButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Defines the text of the component.\n\t *\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: Node, \"default\": true })\n\ttext!: DefaultSlot<Node>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tonBeforeRendering() {\n\t\tif (this.disabled) {\n\t\t\tthis._tabIndex = -1;\n\t\t}\n\t}\n\n\t_handleMouseClick(e: UI5CustomEvent<Button, \"click\">) {\n\t\tthis._fireClick(e);\n\t}\n\n\t_onFocusOut() {\n\t\tif (this.disabled || this.getFocusDomRef()!.matches(\":has(:focus-within)\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._resetActionButtonStates();\n\t\tthis._setTabIndexValue();\n\t}\n\n\thandleTouchStart(e: TouchEvent | MouseEvent) {\n\t\te.stopPropagation();\n\t\tthis._textButtonActive = true;\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_onInnerButtonFocusIn(e: FocusEvent) {\n\t\te.stopPropagation();\n\t\tthis._setTabIndexValue(true);\n\t\tconst target = e.target as Button;\n\t\ttarget.focus();\n\t}\n\n\t_onKeyDown(e: KeyboardEvent) {\n\t\tif (this._isArrowKeyAction(e)) {\n\t\t\tthis._handleArrowButtonAction(e);\n\t\t\tthis._activeArrowButton = true;\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isDefaultAction(e)) {\n\t\t\tthis._handleDefaultAction(e);\n\t\t\treturn;\n\t\t}\n\n\t\tif ((isShift(e) || isEscape(e)) && this._textButtonActive) {\n\t\t\te.preventDefault();\n\t\t\tthis._shiftOrEscapePressedDuringSpace = true;\n\t\t}\n\n\t\tif (isEscape(e) && !this._textButtonActive) {\n\t\t\tthis._resetActionButtonStates();\n\t\t}\n\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_onKeyUp(e: KeyboardEvent) {\n\t\tconst target = e.target as Button;\n\t\tif (this._isArrowKeyAction(e)) {\n\t\t\te.preventDefault();\n\t\t\tthis._activeArrowButton = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis._textButtonActive = false;\n\t\t\tif (!this._shiftOrEscapePressedDuringSpace) { // Do not fire click if Arrow button is focused by mouse and Space is pressed afterwards\n\t\t\t\tif (target !== this.arrowButton) {\n\t\t\t\t\tthis._fireClick();\n\t\t\t\t} else {\n\t\t\t\t\tthis._fireArrowClick();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._shiftOrEscapePressedDuringSpace = false;\n\t\t\treturn;\n\t\t}\n\n\t\tconst shouldToggleTextButtonActiveStateOff = isEnter(e) || (isShift(e) && this._textButtonActive);\n\n\t\tif (shouldToggleTextButtonActiveStateOff) {\n\t\t\tthis._textButtonActive = false;\n\t\t}\n\t}\n\n\t_resetActionButtonStates() {\n\t\tthis._activeArrowButton = false;\n\t\tthis._textButtonActive = false;\n\t\tthis._shiftOrEscapePressedDuringSpace = false;\n\t}\n\n\t_fireClick(e?: Event) {\n\t\te?.stopPropagation();\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t_fireArrowClick(e?: Event) {\n\t\te?.stopPropagation();\n\n\t\tthis.fireDecoratorEvent(\"arrow-click\");\n\t}\n\n\t_textButtonRelease() {\n\t\tthis._textButtonActive = false;\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_arrowButtonPress(e: MouseEvent) {\n\t\te.stopPropagation();\n\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_arrowButtonRelease(e: MouseEvent) {\n\t\te.preventDefault();\n\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_setTabIndexValue(innerButtonPressed?: boolean) {\n\t\tthis._tabIndex = this.disabled ? -1 : 0;\n\n\t\tif (this._tabIndex === -1 && innerButtonPressed) {\n\t\t\tthis._tabIndex = 0;\n\t\t}\n\t}\n\n\t_onArrowButtonActiveStateChange(e: CustomEvent) {\n\t\tif (this.activeArrowButton) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the pressed key is an arrow key.\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_isArrowKeyAction(e: KeyboardEvent): boolean {\n\t\treturn isDown(e) || isUp(e) || isDownAlt(e) || isUpAlt(e) || isF4(e);\n\t}\n\n\t/**\n\t * Checks if the pressed key is a default action key (Space or Enter).\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_isDefaultAction(e: KeyboardEvent): boolean {\n\t\treturn isSpace(e) || isEnter(e);\n\t}\n\n\t/**\n\t * Handles the click event and the focus on the arrow button.\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_handleArrowButtonAction(e: UI5CustomEvent<Button, \"click\"> | KeyboardEvent) {\n\t\te.preventDefault();\n\n\t\tthis._fireArrowClick(e);\n\t}\n\n\t/**\n\t * Handles the default action and the active state of the respective button.\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_handleDefaultAction(e: KeyboardEvent) {\n\t\te.preventDefault();\n\t\tconst target = e.target as Button;\n\n\t\tif (isEnter(e)) {\n\t\t\tif (this.arrowButton && target === this.arrowButton) {\n\t\t\t\tthis._activeArrowButton = true;\n\t\t\t\tthis._fireArrowClick();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._textButtonActive = true;\n\t\t\tthis._fireClick(e);\n\t\t\treturn;\n\t\t}\n\n\t\tif (isTabPrevious(e) || isTabNext(e)) {\n\t\t\tthis._resetActionButtonStates();\n\t\t}\n\t}\n\n\tget effectiveActiveArrowButton() {\n\t\treturn this.activeArrowButton || this._activeArrowButton;\n\t}\n\n\tget buttonTextContent() {\n\t\treturn this.textContent;\n\t}\n\n\tget isTextButton() {\n\t\treturn !!this.textContent;\n\t}\n\n\tget textButton() {\n\t\treturn this.getDomRef()?.querySelector<Button>(\".ui5-split-text-button\");\n\t}\n\n\tget arrowButton() {\n\t\treturn this.getDomRef()?.querySelector<Button>(\".ui5-split-arrow-button\");\n\t}\n\n\tget _computedAccessibilityAttributes(): SplitButtonAccessibilityAttributes {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.root?.hasPopup,\n\t\t\t\troleDescription: this.accessibilityAttributes?.root?.roleDescription || (this._hideArrowButton ? undefined : SplitButton.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION)),\n\t\t\t\ttitle: this.accessibilityAttributes?.root?.title,\n\t\t\t\tariaKeyShortcuts: this.accessibilityAttributes?.root?.ariaKeyShortcuts,\n\t\t\t},\n\t\t\tarrowButton: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.arrowButton?.hasPopup || \"menu\" as AriaHasPopup,\n\t\t\t\texpanded: this.accessibilityAttributes?.arrowButton?.expanded || this.effectiveActiveArrowButton,\n\t\t\t\ttitle: this.accessibilityAttributes?.arrowButton?.title || this.arrowButtonTooltip,\n\t\t\t},\n\t\t};\n\t}\n\n\tget accInfo() {\n\t\treturn {\n\t\t\t\"keyboardHint\": SplitButton.i18nBundle.getText(SPLIT_BUTTON_KEYBOARD_HINT),\n\t\t\t\"description\": SplitButton.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION),\n\t\t};\n\t}\n\n\tget arrowButtonTooltip() {\n\t\treturn SplitButton.i18nBundle.getText(SPLIT_BUTTON_ARROW_BUTTON_TOOLTIP);\n\t}\n\n\tget isSplitButton(): boolean {\n\t\treturn true;\n\t}\n\n\tget ariaLabelText() {\n\t\treturn [SplitButton.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION), SplitButton.i18nBundle.getText(SPLIT_BUTTON_KEYBOARD_HINT)].join(\" \");\n\t}\n}\n\nSplitButton.define();\n\nexport default SplitButton;\nexport type {\n\tSplitButtonAccessibilityAttributes,\n};\n\nexport const isInstanceOfSplitButton = createInstanceChecker<SplitButton>(\"isSplitButton\");\n"]}
|
|
1
|
+
{"version":3,"file":"SplitButton.js","sourceRoot":"","sources":["../src/SplitButton.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,qBAAqB,MAAM,4DAA4D,CAAC;AAC/F,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,IAAI,EACJ,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAO,EACP,SAAS,EACT,aAAa,GACb,MAAM,sCAAsC,CAAC;AAG9C,OAAO,IAAI,MAAM,iDAAiD,CAAC;A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GAAG,qBAAqB,CAAc,eAAe,CAAC,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport createInstanceChecker from \"@ui5/webcomponents-base/dist/util/createInstanceChecker.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport {\n\tisEscape,\n\tisSpace,\n\tisEnter,\n\tisDown,\n\tisUp,\n\tisDownAlt,\n\tisUpAlt,\n\tisF4,\n\tisShift,\n\tisTabNext,\n\tisTabPrevious,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\nimport type { AriaHasPopup, UI5CustomEvent } from \"@ui5/webcomponents-base\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type ButtonDesign from \"./types/ButtonDesign.js\";\nimport type Button from \"./Button.js\";\n\nimport {\n\tSPLIT_BUTTON_DESCRIPTION,\n\tSPLIT_BUTTON_KEYBOARD_HINT,\n\tSPLIT_BUTTON_ARROW_BUTTON_TOOLTIP,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Template\nimport SplitButtonTemplate from \"./SplitButtonTemplate.js\";\n\n// Styles\nimport SplitButtonCss from \"./generated/themes/SplitButton.css.js\";\n\ntype SplitButtonRootAccAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"title\" | \"ariaKeyShortcuts\">;\ntype SplitButtonArrowButtonAccAtributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"expanded\" | \"title\">;\ntype SplitButtonAccessibilityAttributes = {root?: SplitButtonRootAccAttributes, arrowButton?: SplitButtonArrowButtonAccAtributes}\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-split-button` enables users to trigger actions. It is constructed of two separate actions -\n * default action and arrow action that can be activated by clicking or tapping, or by\n * pressing certain keyboard keys - `Space` or `Enter` for default action,\n * and `Arrow Down` or `Arrow Up` for arrow action.\n *\n * ### Usage\n *\n * `ui5-split-button` consists two separate buttons:\n *\n * - for the first one (default action) you can define some `text` or an `icon`, or both.\n * - the second one (arrow action) contains only `slim-arrow-down` icon.\n *\n * You can choose a `design` from a set of predefined types (the same as for ui5-button) that offer\n * different styling to correspond to the triggered action. Both text and arrow actions have the same design.\n *\n * You can set the `ui5-split-button` as enabled or disabled. Both parts of an enabled\n * `ui5-split-button` can be pressed by clicking or tapping it, or by certain keys, which changes\n * the style to provide visual feedback to the user that it is pressed or hovered over with\n * the mouse cursor. A disabled `ui5-split-button` appears inactive and any of the two buttons\n * cannot be pressed.\n *\n * ### Keyboard Handling\n *\n * - `Space` or `Enter` - triggers the default action\n * - `Shift` or `Escape` - if `Space` is pressed, releases the default action button without triggering the click event.\n * - `Arrow Down`, `Arrow Up`, `Alt`+`Arrow Down`, `Alt`+`Arrow Up`, or `F4` - triggers the arrow action\n * There are separate events that are fired on activating of `ui5-split-button` parts:\n *\n * - `click` for the first button (default action)\n * - `arrow-click` for the second button (arrow action)\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/SplitButton.js\";`\n * @csspart button - Used to style the native button element\n * @csspart icon - Used to style the icon in the native button element\n * @csspart endIcon - Used to style the end icon in the native button element\n * @constructor\n * @extends UI5Element\n * @public\n * @since 1.1.0\n */\n@customElement({\n\ttag: \"ui5-split-button\",\n\trenderer: jsxRenderer,\n\tstyles: SplitButtonCss,\n\ttemplate: SplitButtonTemplate,\n})\n/**\n * Fired when the user clicks on the default action.\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the user clicks on the arrow action.\n * @public\n */\n@event(\"arrow-click\", {\n\tbubbles: true,\n})\nclass SplitButton extends UI5Element {\n\teventDetails!: {\n\t\tclick: void;\n\t\t\"arrow-click\": void;\n\t}\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * Example:\n\t *\n\t * See all available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines whether the arrow button should have the active state styles or not.\n\t * @default false\n\t * @public\n\t * @since 1.21.0\n\t */\n\t@property({ type: Boolean })\n\tactiveArrowButton = false;\n\n\t/**\n\t * Defines the component design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign: `${ButtonDesign}` = \"Default\";\n\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the tabIndex of the component.\n\t * @default \"0\"\n\t * @private\n\t */\n\t@property({ type: Number, noAttribute: true })\n\t_tabIndex = 0\n\n\t/**\n\t * Indicates if there is Shift or Escape key pressed while Space key is down.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_shiftOrEscapePressedDuringSpace = false;\n\n\t/**\n\t * Defines the active state of the text button\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_textButtonActive = false;\n\n\t/**\n\t * Defines the state of the internal Button used for the Arrow button of the SplitButton.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_activeArrowButton = false;\n\n\t/**\n\t * Defines the display of the end icon as a graphical element within the default action of the component after the button text.\n\t * The SAP-icons font provides different options.\n\t *\n\t * Example:\n\t *\n\t * See all available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @private\n\t */\n\t@property({ type: String })\n\t_endIcon?: string;\n\n\t/**\n\t * Defines the visibility of the arrow button of the component.\n\t *\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_hideArrowButton = false;\n\n\t/**\n\t * Overrides the default role description announced by screen readers.\n\t * @default undefined\n\t * @private\n\t */\n\t@property({ noAttribute: true })\n\t_roleDescription?: string;\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The `accessibilityAttributes` property accepts an object with the following optional fields:\n\t *\n\t * - **root**: Attributes that will be applied to the main (text) button.\n\t * - **hasPopup**: Indicates the presence and type of popup triggered by the button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **title**: Specifies a tooltip or description for screen readers.\n\t * Accepts any string value.\n\t * \t- **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or give focus to the button.\n\t *\n\t * - **arrowButton**: Attributes applied specifically to the arrow (split) button.\n\t * - **hasPopup**: Indicates the presence and type of popup triggered by the arrow button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **expanded**: Indicates whether the popup triggered by the arrow button is currently expanded.\n\t * Accepts boolean values: `true` or `false`.\n\t *\n\t * @default {}\n\t * @public\n\t * @since 2.13.0\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: SplitButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Defines the text of the component.\n\t *\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: Node, \"default\": true })\n\ttext!: DefaultSlot<Node>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tonBeforeRendering() {\n\t\tif (this.disabled) {\n\t\t\tthis._tabIndex = -1;\n\t\t}\n\t}\n\n\t_handleMouseClick(e: UI5CustomEvent<Button, \"click\">) {\n\t\tthis._fireClick(e);\n\t}\n\n\t_onFocusOut() {\n\t\tif (this.disabled || this.getFocusDomRef()!.matches(\":has(:focus-within)\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._resetActionButtonStates();\n\t\tthis._setTabIndexValue();\n\t}\n\n\thandleTouchStart(e: TouchEvent | MouseEvent) {\n\t\te.stopPropagation();\n\t\tthis._textButtonActive = true;\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_onInnerButtonFocusIn(e: FocusEvent) {\n\t\te.stopPropagation();\n\t\tthis._setTabIndexValue(true);\n\t\tconst target = e.target as Button;\n\t\ttarget.focus();\n\t}\n\n\t_onKeyDown(e: KeyboardEvent) {\n\t\tif (this._isArrowKeyAction(e)) {\n\t\t\tthis._handleArrowButtonAction(e);\n\t\t\tthis._activeArrowButton = true;\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isDefaultAction(e)) {\n\t\t\tthis._handleDefaultAction(e);\n\t\t\treturn;\n\t\t}\n\n\t\tif ((isShift(e) || isEscape(e)) && this._textButtonActive) {\n\t\t\te.preventDefault();\n\t\t\tthis._shiftOrEscapePressedDuringSpace = true;\n\t\t}\n\n\t\tif (isEscape(e) && !this._textButtonActive) {\n\t\t\tthis._resetActionButtonStates();\n\t\t}\n\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_onKeyUp(e: KeyboardEvent) {\n\t\tconst target = e.target as Button;\n\t\tif (this._isArrowKeyAction(e)) {\n\t\t\te.preventDefault();\n\t\t\tthis._activeArrowButton = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis._textButtonActive = false;\n\t\t\tif (!this._shiftOrEscapePressedDuringSpace) { // Do not fire click if Arrow button is focused by mouse and Space is pressed afterwards\n\t\t\t\tif (target !== this.arrowButton) {\n\t\t\t\t\tthis._fireClick();\n\t\t\t\t} else {\n\t\t\t\t\tthis._fireArrowClick();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._shiftOrEscapePressedDuringSpace = false;\n\t\t\treturn;\n\t\t}\n\n\t\tconst shouldToggleTextButtonActiveStateOff = isEnter(e) || (isShift(e) && this._textButtonActive);\n\n\t\tif (shouldToggleTextButtonActiveStateOff) {\n\t\t\tthis._textButtonActive = false;\n\t\t}\n\t}\n\n\t_resetActionButtonStates() {\n\t\tthis._activeArrowButton = false;\n\t\tthis._textButtonActive = false;\n\t\tthis._shiftOrEscapePressedDuringSpace = false;\n\t}\n\n\t_fireClick(e?: Event) {\n\t\te?.stopPropagation();\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t_fireArrowClick(e?: Event) {\n\t\te?.stopPropagation();\n\n\t\tthis.fireDecoratorEvent(\"arrow-click\");\n\t}\n\n\t_textButtonRelease() {\n\t\tthis._textButtonActive = false;\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_arrowButtonPress(e: MouseEvent) {\n\t\te.stopPropagation();\n\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_arrowButtonRelease(e: MouseEvent) {\n\t\te.preventDefault();\n\n\t\tthis._tabIndex = -1;\n\t}\n\n\t_setTabIndexValue(innerButtonPressed?: boolean) {\n\t\tthis._tabIndex = this.disabled ? -1 : 0;\n\n\t\tif (this._tabIndex === -1 && innerButtonPressed) {\n\t\t\tthis._tabIndex = 0;\n\t\t}\n\t}\n\n\t_onArrowButtonActiveStateChange(e: CustomEvent) {\n\t\tif (this.activeArrowButton) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the pressed key is an arrow key.\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_isArrowKeyAction(e: KeyboardEvent): boolean {\n\t\treturn isDown(e) || isUp(e) || isDownAlt(e) || isUpAlt(e) || isF4(e);\n\t}\n\n\t/**\n\t * Checks if the pressed key is a default action key (Space or Enter).\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_isDefaultAction(e: KeyboardEvent): boolean {\n\t\treturn isSpace(e) || isEnter(e);\n\t}\n\n\t/**\n\t * Handles the click event and the focus on the arrow button.\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_handleArrowButtonAction(e: UI5CustomEvent<Button, \"click\"> | KeyboardEvent) {\n\t\te.preventDefault();\n\n\t\tthis._fireArrowClick(e);\n\t}\n\n\t/**\n\t * Handles the default action and the active state of the respective button.\n\t * @param e - keyboard event\n\t * @private\n\t */\n\t_handleDefaultAction(e: KeyboardEvent) {\n\t\te.preventDefault();\n\t\tconst target = e.target as Button;\n\n\t\tif (isEnter(e)) {\n\t\t\tif (this.arrowButton && target === this.arrowButton) {\n\t\t\t\tthis._activeArrowButton = true;\n\t\t\t\tthis._fireArrowClick();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._textButtonActive = true;\n\t\t\tthis._fireClick(e);\n\t\t\treturn;\n\t\t}\n\n\t\tif (isTabPrevious(e) || isTabNext(e)) {\n\t\t\tthis._resetActionButtonStates();\n\t\t}\n\t}\n\n\tget effectiveActiveArrowButton() {\n\t\treturn this.activeArrowButton || this._activeArrowButton;\n\t}\n\n\tget buttonTextContent() {\n\t\treturn this.textContent;\n\t}\n\n\tget isTextButton() {\n\t\treturn !!this.textContent;\n\t}\n\n\tget textButton() {\n\t\treturn this.getDomRef()?.querySelector<Button>(\".ui5-split-text-button\");\n\t}\n\n\tget arrowButton() {\n\t\treturn this.getDomRef()?.querySelector<Button>(\".ui5-split-arrow-button\");\n\t}\n\n\tget _computedAccessibilityAttributes(): SplitButtonAccessibilityAttributes {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.root?.hasPopup,\n\t\t\t\ttitle: this.accessibilityAttributes?.root?.title,\n\t\t\t\tariaKeyShortcuts: this.accessibilityAttributes?.root?.ariaKeyShortcuts,\n\t\t\t},\n\t\t\tarrowButton: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.arrowButton?.hasPopup || \"menu\" as AriaHasPopup,\n\t\t\t\texpanded: this.accessibilityAttributes?.arrowButton?.expanded || this.effectiveActiveArrowButton,\n\t\t\t\ttitle: this.accessibilityAttributes?.arrowButton?.title || this.arrowButtonTooltip,\n\t\t\t},\n\t\t};\n\t}\n\n\tget accInfo() {\n\t\treturn {\n\t\t\t\"keyboardHint\": SplitButton.i18nBundle.getText(SPLIT_BUTTON_KEYBOARD_HINT),\n\t\t\t\"description\": this._roleDescription || SplitButton.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION),\n\t\t};\n\t}\n\n\tget arrowButtonTooltip() {\n\t\treturn SplitButton.i18nBundle.getText(SPLIT_BUTTON_ARROW_BUTTON_TOOLTIP);\n\t}\n\n\tget isSplitButton(): boolean {\n\t\treturn true;\n\t}\n\n\tget ariaLabelText() {\n\t\treturn [SplitButton.i18nBundle.getText(SPLIT_BUTTON_DESCRIPTION), SplitButton.i18nBundle.getText(SPLIT_BUTTON_KEYBOARD_HINT)].join(\" \");\n\t}\n}\n\nSplitButton.define();\n\nexport default SplitButton;\nexport type {\n\tSplitButtonAccessibilityAttributes,\n};\n\nexport const isInstanceOfSplitButton = createInstanceChecker<SplitButton>(\"isSplitButton\");\n"]}
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ui5/webcompo
|
|
|
2
2
|
import slimArrowDown from "@ui5/webcomponents-icons/dist/slim-arrow-down.js";
|
|
3
3
|
import Button from "./Button.js";
|
|
4
4
|
export default function SplitButtonTemplate() {
|
|
5
|
-
return (_jsxs("div", { role: this._hideArrowButton ? "presentation" : "group", class: "ui5-split-button-root", tabindex: this._tabIndex, "aria-labelledby": !this._hideArrowButton ? `${this._id}-invisibleTextDefault ${this._id}-invisibleText` : undefined, "aria-haspopup": this._computedAccessibilityAttributes?.root?.hasPopup, "aria-
|
|
5
|
+
return (_jsxs("div", { role: this._hideArrowButton ? "presentation" : "group", class: "ui5-split-button-root", tabindex: this._tabIndex, "aria-labelledby": !this._hideArrowButton ? `${this._id}-invisibleTextDefault ${this._id}-invisibleText` : undefined, "aria-haspopup": this._computedAccessibilityAttributes?.root?.hasPopup, "aria-label": this._computedAccessibilityAttributes?.root?.title, "aria-keyshortcuts": this._computedAccessibilityAttributes?.root?.ariaKeyShortcuts, onFocusOut: this._onFocusOut, onKeyDown: this._onKeyDown, onKeyUp: this._onKeyUp, children: [_jsx(Button, { class: "ui5-split-text-button", design: this.design, icon: this.icon, endIcon: this._endIcon, tabindex: -1, disabled: this.disabled, active: this._textButtonActive, exportparts: "icon,endIcon,button", onClick: this._handleMouseClick, onTouchStart: this.handleTouchStart, onMouseDown: this.handleTouchStart, onMouseUp: this._textButtonRelease, onFocusIn: this._onInnerButtonFocusIn, onFocusOut: this._onFocusOut, tooltip: this._computedAccessibilityAttributes?.root?.title, children: this.isTextButton && _jsx("slot", {}) }), !this._hideArrowButton && (_jsxs(_Fragment, { children: [_jsx(Button, { class: "ui5-split-arrow-button", design: this.design, icon: slimArrowDown, tabindex: -1, tooltip: this._computedAccessibilityAttributes?.arrowButton?.title, accessibilityAttributes: { hasPopup: this._computedAccessibilityAttributes?.arrowButton?.hasPopup, expanded: this._computedAccessibilityAttributes?.arrowButton?.expanded }, disabled: this.disabled, active: this.effectiveActiveArrowButton, part: "arrowButton", onClick: this._handleArrowButtonAction, onMouseDown: this._arrowButtonPress, onMouseUp: this._arrowButtonRelease, onFocusIn: this._onInnerButtonFocusIn, onActiveStateChange: this._onArrowButtonActiveStateChange }), _jsxs("span", { id: `${this._id}-invisibleText`, class: "ui5-hidden-text", children: [this.accessibleName, " ", this.accInfo.description, " ", this.accInfo.keyboardHint] }), _jsx("span", { id: `${this._id}-invisibleTextDefault`, class: "ui5-hidden-text", children: this.buttonTextContent })] }))] }));
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=SplitButtonTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitButtonTemplate.js","sourceRoot":"","sources":["../src/SplitButtonTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,aAAa,MAAM,kDAAkD,CAAC;AAC7E,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,mBAAmB;IAC1C,OAAO,CACN,eACC,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,EACtD,KAAK,EAAC,uBAAuB,EAC7B,QAAQ,EAAE,IAAI,CAAC,SAAS,qBACP,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,yBAAyB,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,SAAS,mBACnG,IAAI,CAAC,gCAAgC,EAAE,IAAI,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"SplitButtonTemplate.js","sourceRoot":"","sources":["../src/SplitButtonTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,aAAa,MAAM,kDAAkD,CAAC;AAC7E,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,mBAAmB;IAC1C,OAAO,CACN,eACC,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,EACtD,KAAK,EAAC,uBAAuB,EAC7B,QAAQ,EAAE,IAAI,CAAC,SAAS,qBACP,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,yBAAyB,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,SAAS,mBACnG,IAAI,CAAC,gCAAgC,EAAE,IAAI,EAAE,QAAQ,gBACxD,IAAI,CAAC,gCAAgC,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,EAAE,IAAI,CAAC,QAAQ,EACvB,MAAM,EAAE,IAAI,CAAC,0BAA0B,EACvC,IAAI,EAAC,aAAa,EAClB,OAAO,EAAE,IAAI,CAAC,wBAAwB,EACtC,WAAW,EAAE,IAAI,CAAC,iBAAiB,EACnC,SAAS,EAAE,IAAI,CAAC,mBAAmB,EACnC,SAAS,EAAE,IAAI,CAAC,qBAAqB,EACrC,mBAAmB,EAAE,IAAI,CAAC,+BAA+B,GAEjD,EACT,gBAAM,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,gBAAgB,EAAE,KAAK,EAAC,iBAAiB,aAAE,IAAI,CAAC,cAAc,OAAG,IAAI,CAAC,OAAO,CAAC,WAAW,OAAG,IAAI,CAAC,OAAO,CAAC,YAAY,IAAQ,EAClJ,eAAM,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,uBAAuB,EAAE,KAAK,EAAC,iBAAiB,YAAE,IAAI,CAAC,iBAAiB,GAAQ,IACnG,CACH,IACI,CACN,CAAC;AACH,CAAC","sourcesContent":["import type SplitButton from \"./SplitButton.js\";\nimport slimArrowDown from \"@ui5/webcomponents-icons/dist/slim-arrow-down.js\";\nimport Button from \"./Button.js\";\n\nexport default function SplitButtonTemplate(this: SplitButton) {\n\treturn (\n\t\t<div\n\t\t\trole={this._hideArrowButton ? \"presentation\" : \"group\"}\n\t\t\tclass=\"ui5-split-button-root\"\n\t\t\ttabindex={this._tabIndex}\n\t\t\taria-labelledby={!this._hideArrowButton ? `${this._id}-invisibleTextDefault ${this._id}-invisibleText` : undefined}\n\t\t\taria-haspopup={this._computedAccessibilityAttributes?.root?.hasPopup}\n\t\t\taria-label={this._computedAccessibilityAttributes?.root?.title}\n\t\t\taria-keyshortcuts={this._computedAccessibilityAttributes?.root?.ariaKeyShortcuts}\n\t\t\tonFocusOut={this._onFocusOut}\n\t\t\tonKeyDown={this._onKeyDown}\n\t\t\tonKeyUp={this._onKeyUp}\n\t\t>\n\t\t\t<Button\n\t\t\t\tclass=\"ui5-split-text-button\"\n\t\t\t\tdesign={this.design}\n\t\t\t\ticon={this.icon}\n\t\t\t\tendIcon={this._endIcon}\n\t\t\t\ttabindex={-1}\n\t\t\t\tdisabled={this.disabled}\n\t\t\t\tactive={this._textButtonActive}\n\t\t\t\texportparts=\"icon,endIcon,button\"\n\t\t\t\tonClick={this._handleMouseClick}\n\t\t\t\tonTouchStart={this.handleTouchStart}\n\t\t\t\tonMouseDown={this.handleTouchStart}\n\t\t\t\tonMouseUp={this._textButtonRelease}\n\t\t\t\tonFocusIn={this._onInnerButtonFocusIn}\n\t\t\t\tonFocusOut={this._onFocusOut}\n\t\t\t\ttooltip={this._computedAccessibilityAttributes?.root?.title}\n\t\t\t>\n\t\t\t\t{this.isTextButton && <slot></slot> }\n\t\t\t</Button>\n\n\t\t\t{!this._hideArrowButton && (\n\t\t\t\t<>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclass=\"ui5-split-arrow-button\"\n\t\t\t\t\t\tdesign={this.design}\n\t\t\t\t\t\ticon={slimArrowDown}\n\t\t\t\t\t\ttabindex={-1}\n\t\t\t\t\t\ttooltip={this._computedAccessibilityAttributes?.arrowButton?.title}\n\t\t\t\t\t\taccessibilityAttributes={{ hasPopup: this._computedAccessibilityAttributes?.arrowButton?.hasPopup, expanded: this._computedAccessibilityAttributes?.arrowButton?.expanded }}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tactive={this.effectiveActiveArrowButton}\n\t\t\t\t\t\tpart=\"arrowButton\"\n\t\t\t\t\t\tonClick={this._handleArrowButtonAction}\n\t\t\t\t\t\tonMouseDown={this._arrowButtonPress}\n\t\t\t\t\t\tonMouseUp={this._arrowButtonRelease}\n\t\t\t\t\t\tonFocusIn={this._onInnerButtonFocusIn}\n\t\t\t\t\t\tonActiveStateChange={this._onArrowButtonActiveStateChange}\n\t\t\t\t\t>\n\t\t\t\t\t</Button>\n\t\t\t\t\t<span id={`${this._id}-invisibleText`} class=\"ui5-hidden-text\">{this.accessibleName} {this.accInfo.description} {this.accInfo.keyboardHint}</span>\n\t\t\t\t\t<span id={`${this._id}-invisibleTextDefault`} class=\"ui5-hidden-text\">{this.buttonTextContent}</span>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import TableCellBase from "./TableCellBase.js";
|
|
2
2
|
import SortOrder from "@ui5/webcomponents-base/dist/types/SortOrder.js";
|
|
3
|
+
import Icon from "./Icon.js";
|
|
3
4
|
import type TableHeaderCellActionBase from "./TableHeaderCellActionBase.js";
|
|
4
5
|
import type { Slot } from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
5
6
|
/**
|
|
@@ -102,6 +103,8 @@ declare class TableHeaderCell extends TableCellBase {
|
|
|
102
103
|
_actionSlot: HTMLSlotElement;
|
|
103
104
|
ariaRole: string;
|
|
104
105
|
_popinWidth: number;
|
|
106
|
+
get _sortIconComponent(): typeof Icon | undefined;
|
|
107
|
+
get _sortIcon(): string | undefined;
|
|
105
108
|
onBeforeRendering(): void;
|
|
106
109
|
get accessibilityInfo(): {
|
|
107
110
|
children: HTMLSlotElement[];
|
package/dist/TableHeaderCell.js
CHANGED
|
@@ -10,6 +10,9 @@ import TableCellBase from "./TableCellBase.js";
|
|
|
10
10
|
import TableHeaderCellTemplate from "./TableHeaderCellTemplate.js";
|
|
11
11
|
import TableHeaderCellStyles from "./generated/themes/TableHeaderCell.css.js";
|
|
12
12
|
import SortOrder from "@ui5/webcomponents-base/dist/types/SortOrder.js";
|
|
13
|
+
import Icon from "./Icon.js";
|
|
14
|
+
import SortAscending from "@ui5/webcomponents-icons/dist/sort-ascending.js";
|
|
15
|
+
import SortDescending from "@ui5/webcomponents-icons/dist/sort-descending.js";
|
|
13
16
|
import query from "@ui5/webcomponents-base/dist/decorators/query.js";
|
|
14
17
|
/**
|
|
15
18
|
* @class
|
|
@@ -66,6 +69,19 @@ let TableHeaderCell = class TableHeaderCell extends TableCellBase {
|
|
|
66
69
|
this.ariaRole = "columnheader";
|
|
67
70
|
this._popinWidth = 0;
|
|
68
71
|
}
|
|
72
|
+
get _sortIconComponent() {
|
|
73
|
+
return this.sortIndicator === SortOrder.None ? undefined : Icon;
|
|
74
|
+
}
|
|
75
|
+
get _sortIcon() {
|
|
76
|
+
switch (this.sortIndicator) {
|
|
77
|
+
case SortOrder.Ascending:
|
|
78
|
+
return SortAscending;
|
|
79
|
+
case SortOrder.Descending:
|
|
80
|
+
return SortDescending;
|
|
81
|
+
default:
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
69
85
|
onBeforeRendering() {
|
|
70
86
|
super.onBeforeRendering();
|
|
71
87
|
this.style.textAlign = this.horizontalAlign || "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeaderCell.js","sourceRoot":"","sources":["../src/TableHeaderCell.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,IAAI,IAAI,EAAE,MAAM,4CAA4C,CAAC;AACzG,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,qBAAqB,MAAM,2CAA2C,CAAC;AAC9E,OAAO,SAAS,MAAM,iDAAiD,CAAC;AACxE,OAAO,KAAK,MAAM,kDAAkD,CAAC;AAIrE;;;;;;;;;;;;;;;;;;GAkBG;AAMH,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,aAAa;IAA3C;;QAkCC;;;;;;;;;WASG;QAEH,eAAU,GAAG,CAAC,CAAC;QAYf;;;;;;WAMG;QAEH,kBAAa,GAAmB,MAAM,CAAC;QAEvC;;;;;;;;;WASG;QAEH,gBAAW,GAAY,KAAK,CAAC;QAmB7B,aAAQ,GAAW,cAAc,CAAC;QAClC,gBAAW,GAAW,CAAC,CAAC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;IACF,CAAC;IAED,iBAAiB;QAChB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,eAAe,IAAI,EAAE,CAAC;QAClD,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,IAAI,EAAE,CAAC;QACvD,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,aAAa,KAAK,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7G,CAAC;IAED,IAAI,iBAAiB;QACpB,OAAO;YACN,QAAQ,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC;SAC/C,CAAC;IACH,CAAC;CACD,CAAA;AAjHA;IADC,QAAQ,EAAE;8CACI;AAkBf;IADC,QAAQ,EAAE;iDACO;AAalB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACZ;AAUf;IADC,QAAQ,EAAE;kDACQ;AAUnB;IADC,QAAQ,EAAE;sDAC4B;AAavC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACC;AAW7B;IADC,IAAI,EAAE;+CACkC;AAGzC;IADC,KAAK,CAAC,kBAAkB,CAAC;qDACK;AAG/B;IADC,KAAK,CAAC,mBAAmB,CAAC;oDACG;AA/FzB,eAAe;IALpB,aAAa,CAAC;QACd,GAAG,EAAE,uBAAuB;QAC5B,MAAM,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,qBAAqB,CAAC;QACrD,QAAQ,EAAE,uBAAuB;KACjC,CAAC;GACI,eAAe,CA+HpB;AAED,eAAe,CAAC,MAAM,EAAE,CAAC;AAEzB,eAAe,eAAe,CAAC","sourcesContent":["import { customElement, property, slotStrict as slot } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport { toggleAttribute } from \"./TableUtils.js\";\nimport TableCellBase from \"./TableCellBase.js\";\nimport TableHeaderCellTemplate from \"./TableHeaderCellTemplate.js\";\nimport TableHeaderCellStyles from \"./generated/themes/TableHeaderCell.css.js\";\nimport SortOrder from \"@ui5/webcomponents-base/dist/types/SortOrder.js\";\nimport Icon from \"./Icon.js\";\nimport SortAscending from \"@ui5/webcomponents-icons/dist/sort-ascending.js\";\nimport SortDescending from \"@ui5/webcomponents-icons/dist/sort-descending.js\";\nimport query from \"@ui5/webcomponents-base/dist/decorators/query.js\";\nimport type TableHeaderCellActionBase from \"./TableHeaderCellActionBase.js\";\nimport type { Slot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-table-header-cell` component represents a column in the `ui5-table`.\n *\n * As it is tightly coupled to the `ui5-table`, it should only be used in the `ui5-table-header-row`\n * to ensure correct layout and design.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/TableHeaderCell.js\";`\n *\n * @constructor\n * @extends TableCellBase\n * @since 2.0.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-table-header-cell\",\n\tstyles: [TableCellBase.styles, TableHeaderCellStyles],\n\ttemplate: TableHeaderCellTemplate,\n})\nclass TableHeaderCell extends TableCellBase {\n\t/**\n\t * Defines the width of the column.\n\t *\n\t * By default, the column will grow and shrink according to the available space.\n\t * This will distribute the space proportionally among all columns with no specific width set.\n\t *\n\t * See [\\<length\\>](https://developer.mozilla.org/en-US/docs/Web/CSS/length) and\n\t * [\\<percentage\\>](https://developer.mozilla.org/en-US/docs/Web/CSS/percentage) for possible width values.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\twidth?: string;\n\n\t/**\n \t * Defines the minimum width of the column.\n\t *\n\t * If the table is in `Popin` mode and the minimum width does not fit anymore,\n\t * the column will move into the popin.\n\t *\n\t * By default, the table prevents the column from becoming too small.\n\t * Changing this value to a small value might lead to accessibility issues.\n\t *\n\t * **Note:** This property only takes effect for columns with a [\\<percentage\\>](https://developer.mozilla.org/en-US/docs/Web/CSS/percentage) value\n\t * or the default width.\n\t *\n\t * @public\n\t * @default undefined\n\t */\n\t@property()\n\tminWidth?: string;\n\n\t/**\n\t * Defines the importance of the column.\n\t *\n\t * This property affects the popin behaviour.\n\t * Columns with higher importance will move into the popin area later then less important\n\t * columns.\n\t *\n\t * @default 0\n\t * @public\n\t */\n\t@property({ type: Number })\n\timportance = 0;\n\n\t/**\n\t * The text for the column when it pops in.\n\t *\n\t * @default undefined\n\t * @since 2.7.0\n\t * @public\n\t */\n\t@property()\n\tpopinText?: string;\n\n\t/**\n\t * Defines the sort indicator of the column.\n\t *\n\t * @default \"None\"\n\t * @since 2.8.0\n\t * @public\n\t */\n\t@property()\n\tsortIndicator: `${SortOrder}` = \"None\";\n\n\t/**\n\t * Defines if the column is hidden in the popin.\n\t *\n\t * **Note:** Please be aware that hiding the column in the popin might lead to accessibility issues as\n\t * users might not be able to access the content of the column on small screens.\n\t *\n\t * @default false\n\t * @since 2.8.0\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tpopinHidden: boolean = false;\n\n\t/**\n\t * Defines the action of the column.\n\t *\n\t * **Note:** While multiple actions are technically possible, this is not supported.\n\t *\n\t * @public\n\t * @since 2.8.0\n\t */\n\t@slot()\n\taction!: Slot<TableHeaderCellActionBase>;\n\n\t@query(\"slot:not([name])\")\n\t_defaultSlot!: HTMLSlotElement;\n\n\t@query(\"slot[name=action]\")\n\t_actionSlot!: HTMLSlotElement;\n\n\tariaRole: string = \"columnheader\";\n\t_popinWidth: number = 0;\n\n\tget _sortIconComponent(): typeof Icon | undefined {\n\t\treturn this.sortIndicator === SortOrder.None ? undefined : Icon;\n\t}\n\n\tget _sortIcon(): string | undefined {\n\t\tswitch (this.sortIndicator) {\n\t\tcase SortOrder.Ascending:\n\t\t\treturn SortAscending;\n\t\tcase SortOrder.Descending:\n\t\t\treturn SortDescending;\n\t\tdefault:\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tonBeforeRendering() {\n\t\tsuper.onBeforeRendering();\n\t\tthis.style.textAlign = this.horizontalAlign || \"\";\n\t\tthis.style.justifyContent = this.horizontalAlign || \"\";\n\t\ttoggleAttribute(this, \"aria-sort\", this.sortIndicator !== SortOrder.None, this.sortIndicator.toLowerCase());\n\t}\n\n\tget accessibilityInfo() {\n\t\treturn {\n\t\t\tchildren: [this._defaultSlot, this._actionSlot],\n\t\t};\n\t}\n}\n\nTableHeaderCell.define();\n\nexport default TableHeaderCell;\n"]}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@ui5/webcomponents-base/jsx-runtime";
|
|
2
|
-
import Icon from "./Icon.js";
|
|
3
|
-
import SortOrder from "@ui5/webcomponents-base/dist/types/SortOrder.js";
|
|
4
|
-
import SortAscending from "@ui5/webcomponents-icons/dist/sort-ascending.js";
|
|
5
|
-
import SortDescending from "@ui5/webcomponents-icons/dist/sort-descending.js";
|
|
6
2
|
export default function TableHeaderCellTemplate() {
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
switch (this.sortIndicator) {
|
|
11
|
-
case SortOrder.Ascending:
|
|
12
|
-
return _jsx(Icon, { name: SortAscending });
|
|
13
|
-
case SortOrder.Descending:
|
|
14
|
-
return _jsx(Icon, { name: SortDescending });
|
|
15
|
-
default:
|
|
16
|
-
return _jsx(_Fragment, {});
|
|
17
|
-
}
|
|
3
|
+
const SortIconComponent = this._sortIconComponent;
|
|
4
|
+
return (_jsxs(_Fragment, { children: [_jsx("slot", { name: "action" }), _jsx("slot", {}), SortIconComponent &&
|
|
5
|
+
_jsx(SortIconComponent, { name: this._sortIcon })] }));
|
|
18
6
|
}
|
|
19
7
|
//# sourceMappingURL=TableHeaderCellTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeaderCellTemplate.js","sourceRoot":"","sources":["../src/TableHeaderCellTemplate.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TableHeaderCellTemplate.js","sourceRoot":"","sources":["../src/TableHeaderCellTemplate.tsx"],"names":[],"mappings":";AAEA,MAAM,CAAC,OAAO,UAAU,uBAAuB;IAC9C,MAAM,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,CAAC;IAClD,OAAO,CACN,8BACC,eAAM,IAAI,EAAC,QAAQ,GAAQ,EAC3B,gBAAa,EACX,iBAAiB;gBAClB,KAAC,iBAAiB,IAAC,IAAI,EAAE,IAAI,CAAC,SAAS,GAAsB,IAE5D,CACH,CAAC;AACH,CAAC","sourcesContent":["import type TableHeaderCell from \"./TableHeaderCell.js\";\n\nexport default function TableHeaderCellTemplate(this: TableHeaderCell) {\n\tconst SortIconComponent = this._sortIconComponent;\n\treturn (\n\t\t<>\n\t\t\t<slot name=\"action\"></slot>\n\t\t\t<slot></slot>\n\t\t\t{ SortIconComponent &&\n\t\t\t\t<SortIconComponent name={this._sortIcon}></SortIconComponent>\n\t\t\t}\n\t\t</>\n\t);\n}\n"]}
|
package/dist/TableHeaderRow.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ declare class TableHeaderRow extends TableRowBase<TableHeaderCell> {
|
|
|
44
44
|
get _isSelectable(): boolean;
|
|
45
45
|
get _hasSelectedRows(): boolean;
|
|
46
46
|
get _shouldRenderClearAll(): boolean;
|
|
47
|
+
get _clearAllComponent(): typeof import("./Icon.js").default | undefined;
|
|
48
|
+
get _clearAllIcon(): string | undefined;
|
|
47
49
|
get _selectionCellAriaDescription(): string | undefined;
|
|
48
50
|
get _i18nSelection(): string;
|
|
49
51
|
get _i18nRowPopin(): string;
|
package/dist/TableHeaderRow.js
CHANGED
|
@@ -71,6 +71,12 @@ class TableHeaderRow extends TableRowBase {
|
|
|
71
71
|
get _shouldRenderClearAll() {
|
|
72
72
|
return this._tableSelection.headerSelector === "ClearAll";
|
|
73
73
|
}
|
|
74
|
+
get _clearAllComponent() {
|
|
75
|
+
return this._tableSelection?.getClearAllComponent();
|
|
76
|
+
}
|
|
77
|
+
get _clearAllIcon() {
|
|
78
|
+
return this._tableSelection?.getClearAllIcon();
|
|
79
|
+
}
|
|
74
80
|
get _selectionCellAriaDescription() {
|
|
75
81
|
return this._tableSelection?.getAriaDescriptionForColumnHeader();
|
|
76
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeaderRow.js","sourceRoot":"","sources":["../src/TableHeaderRow.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,IAAI,IAAI,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACzG,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAG5E,OAAO,EACN,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,mCAAmC,CAAC;AAG3C;;;;;;;;;;;;;;;;;;GAkBG;AAcH,IAAM,cAAc;AANpB;;;;;GAKG;AACH,MAAM,cAAe,SAAQ,YAA6B;IAA1D;;QAmBC;;;;;;;WAOG;QAEH,WAAM,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"TableHeaderRow.js","sourceRoot":"","sources":["../src/TableHeaderRow.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,IAAI,IAAI,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACzG,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAG5E,OAAO,EACN,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,mCAAmC,CAAC;AAG3C;;;;;;;;;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QAChB,OAAO,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,eAAe;QAClB,OAAO,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,kBAAkB;QACrB,OAAO,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,oBAAoB;QACvB,OAAO,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACjE,CAAC;CACD,CAAA;AAzEA;IATC,IAAI,CAAC;QACL,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,IAAI;QACf,uBAAuB,EAAE;YACxB,UAAU,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,aAAa,CAAC;YACjE,KAAK,EAAE,KAAK;SACZ;QACD,eAAe,EAAE,IAAI;KACrB,CAAC;6CACmC;AAWrC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACb;AA5BV,cAAc;IAbnB,aAAa,CAAC;QACd,GAAG,EAAE,sBAAsB;QAC3B,aAAa,EAAE,IAAI;QACnB,MAAM,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,oBAAoB,CAAC;QACnD,QAAQ,EAAE,sBAAsB;KAChC,CAAC;IAEF;;;;;OAKG;GACG,cAAc,CA0FnB;AAED,cAAc,CAAC,MAAM,EAAE,CAAC;AAExB,eAAe,cAAc,CAAC","sourcesContent":["import { customElement, slotStrict as slot, property } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport TableRowBase from \"./TableRowBase.js\";\nimport TableHeaderRowTemplate from \"./TableHeaderRowTemplate.js\";\nimport TableHeaderRowStyles from \"./generated/themes/TableHeaderRow.css.js\";\nimport type TableHeaderCell from \"./TableHeaderCell.js\";\nimport type TableSelectionMulti from \"./TableSelectionMulti.js\";\nimport {\n\tTABLE_SELECTION,\n\tTABLE_ROW_POPIN,\n\tTABLE_ROW_ACTIONS,\n\tTABLE_COLUMN_HEADER_ROW,\n\tTABLE_SELECT_ALL_ROWS,\n\tTABLE_DESELECT_ALL_ROWS,\n} from \"./generated/i18n/i18n-defaults.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-table-header-row` component represents the table headers of a `ui5-table`.\n *\n * It is tightly coupled to the `ui5-table` and should therefore be used in the `ui5-table` only.\n * The header row is placed in the `headerRow` slot of the table.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/TableHeaderRow.js\";`\n *\n * @constructor\n * @extends TableRowBase\n * @since 2.0.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-table-header-row\",\n\tlanguageAware: true,\n\tstyles: [TableRowBase.styles, TableHeaderRowStyles],\n\ttemplate: TableHeaderRowTemplate,\n})\n\n/**\n * Example custom event.\n * Please keep in mind that all public events should be documented in the API Reference as shown below.\n *\n * @public\n */\nclass TableHeaderRow extends TableRowBase<TableHeaderCell> {\n\t/**\n\t * Defines the cells of the component.\n\t *\n\t * **Note:** Use `ui5-table-header-cell` for the intended design.\n\t *\n\t * @public\n\t */\n\t@slot({\n\t\ttype: HTMLElement,\n\t\t\"default\": true,\n\t\tinvalidateOnChildChange: {\n\t\t\tproperties: [\"width\", \"_popin\", \"horizontalAlign\", \"popinHidden\"],\n\t\t\tslots: false,\n\t\t},\n\t\tindividualSlots: true,\n\t})\n\tcells!: DefaultSlot<TableHeaderCell>;\n\n\t/**\n\t * Sticks the `ui5-table-header-row` to the top of a table.\n\t *\n\t * Note: If used in combination with overflowMode \"Scroll\", the table needs a defined height for the sticky header to work as expected.\n\t *\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tsticky = false;\n\n\tonEnterDOM(): void {\n\t\tsuper.onEnterDOM();\n\t\tthis.ariaRowIndex = \"1\";\n\t\tthis.ariaRoleDescription = TableRowBase.i18nBundle.getText(TABLE_COLUMN_HEADER_ROW);\n\t}\n\n\tonBeforeRendering() {\n\t\tsuper.onBeforeRendering();\n\t\tif (this._table) {\n\t\t\tthis.style.top = this._table.stickyTop;\n\t\t}\n\t}\n\n\tisHeaderRow(): boolean {\n\t\treturn true;\n\t}\n\n\tget _isSelectable() {\n\t\treturn this._isMultiSelect;\n\t}\n\n\tget _hasSelectedRows() {\n\t\treturn (this._tableSelection as TableSelectionMulti).getSelectedRows().length > 0;\n\t}\n\n\tget _shouldRenderClearAll() {\n\t\treturn (this._tableSelection as TableSelectionMulti).headerSelector === \"ClearAll\";\n\t}\n\n\tget _clearAllComponent() {\n\t\treturn this._tableSelection?.getClearAllComponent();\n\t}\n\n\tget _clearAllIcon() {\n\t\treturn this._tableSelection?.getClearAllIcon();\n\t}\n\n\tget _selectionCellAriaDescription() {\n\t\treturn this._tableSelection?.getAriaDescriptionForColumnHeader();\n\t}\n\n\tget _i18nSelection() {\n\t\treturn TableRowBase.i18nBundle.getText(TABLE_SELECTION);\n\t}\n\n\tget _i18nRowPopin() {\n\t\treturn TableRowBase.i18nBundle.getText(TABLE_ROW_POPIN);\n\t}\n\n\tget _i18nRowActions() {\n\t\treturn TableRowBase.i18nBundle.getText(TABLE_ROW_ACTIONS);\n\t}\n\n\tget _i18nSelectAllRows() {\n\t\treturn TableRowBase.i18nBundle.getText(TABLE_SELECT_ALL_ROWS);\n\t}\n\n\tget _i18nDeselectAllRows() {\n\t\treturn TableRowBase.i18nBundle.getText(TABLE_DESELECT_ALL_ROWS);\n\t}\n}\n\nTableHeaderRow.define();\n\nexport default TableHeaderRow;\n"]}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "@ui5/webcomponents-base/jsx-runtime";
|
|
2
|
-
import CheckBox from "./CheckBox.js";
|
|
3
2
|
import TableHeaderCell from "./TableHeaderCell.js";
|
|
4
|
-
import Icon from "./Icon.js";
|
|
5
|
-
import IconMode from "./types/IconMode.js";
|
|
6
|
-
import ClearAll from "@ui5/webcomponents-icons/dist/clear-all.js";
|
|
7
|
-
import IconDesign from "./types/IconDesign.js";
|
|
8
3
|
export default function TableHeaderRowTemplate(ariaColIndex = 1) {
|
|
4
|
+
const SelectionComponent = this._selectionComponent;
|
|
5
|
+
const ClearAllComponent = this._clearAllComponent;
|
|
9
6
|
return (_jsxs(_Fragment, { children: [this._hasSelector &&
|
|
10
7
|
_jsx(TableHeaderCell, { id: "selection-cell", "aria-selected": this._isSelected, "aria-label": this._i18nSelection, "aria-description": this._selectionCellAriaDescription, "aria-colindex": ariaColIndex++, "data-ui5-table-selection-cell": true, "data-ui5-acc-text": "", children: !this._isMultiSelect ?
|
|
11
8
|
_jsx(_Fragment, {})
|
|
12
9
|
:
|
|
13
10
|
this._shouldRenderClearAll ?
|
|
14
|
-
|
|
11
|
+
(ClearAllComponent &&
|
|
12
|
+
_jsx(ClearAllComponent, { name: this._clearAllIcon, mode: "Decorative", showTooltip: true, accessibleName: this._i18nDeselectAllRows, design: this._hasSelectedRows ? "Default" : "NonInteractive", onClick: this._onSelectionChange }))
|
|
15
13
|
:
|
|
16
|
-
|
|
14
|
+
SelectionComponent &&
|
|
15
|
+
_jsx(SelectionComponent, { id: "selection-component", tabindex: -1, checked: this._isSelected, onChange: this._onSelectionChange, accessibleName: this._i18nRowSelector, title: this._isSelected ? this._i18nDeselectAllRows : this._i18nSelectAllRows }) }), this.cells.flatMap(cell => {
|
|
17
16
|
if (cell._popin) {
|
|
18
17
|
cell.role = null;
|
|
19
18
|
cell.ariaColIndex = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeaderRowTemplate.js","sourceRoot":"","sources":["../src/TableHeaderRowTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"TableHeaderRowTemplate.js","sourceRoot":"","sources":["../src/TableHeaderRowTempl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,EAAC,oBAAoB,YAAE,IAAI,CAAC,aAAa,GAAO,GACtC,IAEjB,CACH,CAAC;AACH,CAAC","sourcesContent":["import TableHeaderCell from \"./TableHeaderCell.js\";\nimport type TableHeaderRow from \"./TableHeaderRow.js\";\n\nexport default function TableHeaderRowTemplate(this: TableHeaderRow, ariaColIndex: number = 1) {\n\tconst SelectionComponent = this._selectionComponent;\n\tconst ClearAllComponent = this._clearAllComponent;\n\treturn (\n\t\t<>\n\t\t\t{ this._hasSelector &&\n\t\t\t\t<TableHeaderCell id=\"selection-cell\"\n\t\t\t\t\taria-selected={this._isSelected}\n\t\t\t\t\taria-label={this._i18nSelection}\n\t\t\t\t\taria-description={this._selectionCellAriaDescription}\n\t\t\t\t\taria-colindex={ariaColIndex++}\n\t\t\t\t\tdata-ui5-table-selection-cell\n\t\t\t\t\tdata-ui5-acc-text=\"\"\n\t\t\t\t>\n\t\t\t\t\t{ !this._isMultiSelect ?\n\t\t\t\t\t\t<></>\n\t\t\t\t\t\t:\n\t\t\t\t\t\tthis._shouldRenderClearAll ?\n\t\t\t\t\t\t\t(ClearAllComponent &&\n\t\t\t\t\t\t\t\t<ClearAllComponent\n\t\t\t\t\t\t\t\t\tname={this._clearAllIcon}\n\t\t\t\t\t\t\t\t\tmode=\"Decorative\"\n\t\t\t\t\t\t\t\t\tshowTooltip={true}\n\t\t\t\t\t\t\t\t\taccessibleName={this._i18nDeselectAllRows}\n\t\t\t\t\t\t\t\t\tdesign={this._hasSelectedRows ? \"Default\" : \"NonInteractive\"}\n\t\t\t\t\t\t\t\t\tonClick={this._onSelectionChange}\n\t\t\t\t\t\t\t\t></ClearAllComponent>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t:\n\t\t\t\t\t\t\tSelectionComponent &&\n\t\t\t\t\t\t\t<SelectionComponent id=\"selection-component\"\n\t\t\t\t\t\t\t\ttabindex={-1}\n\t\t\t\t\t\t\t\tchecked={this._isSelected}\n\t\t\t\t\t\t\t\tonChange={this._onSelectionChange}\n\t\t\t\t\t\t\t\taccessibleName={this._i18nRowSelector}\n\t\t\t\t\t\t\t\ttitle={this._isSelected ? this._i18nDeselectAllRows : this._i18nSelectAllRows}\n\t\t\t\t\t\t\t></SelectionComponent>\n\t\t\t\t\t}\n\t\t\t\t</TableHeaderCell>\n\t\t\t}\n\n\t\t\t{ this.cells.flatMap(cell => {\n\t\t\t\tif (cell._popin) {\n\t\t\t\t\tcell.role = null;\n\t\t\t\t\tcell.ariaColIndex = null;\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tcell.role ??= cell.ariaRole;\n\t\t\t\tcell.ariaColIndex = (cell.role === cell.ariaRole) ? `${ariaColIndex++}` : null;\n\t\t\t\treturn [<slot name={cell._individualSlot}></slot>];\n\t\t\t})}\n\n\t\t\t{ this._renderDummyCell && this._hasPopin &&\n\t\t\t\t<TableHeaderCell id=\"dummy-cell\" role=\"none\" aria-hidden={true}\n\t\t\t\t\tdata-excluded-from-navigation=\"\">\n\t\t\t\t</TableHeaderCell>\n\t\t\t}\n\n\t\t\t{ this._rowActionCount > 0 &&\n\t\t\t\t<TableHeaderCell id=\"actions-cell\" aria-colindex={ariaColIndex++}>\n\t\t\t\t\t<div id=\"actions-cell-content\">{this._i18nRowActions}</div>\n\t\t\t\t</TableHeaderCell>\n\t\t\t}\n\n\t\t\t{ this._renderNavigated &&\n\t\t\t\t<TableHeaderCell id=\"navigated-cell\"\n\t\t\t\t\tdata-excluded-from-navigation\n\t\t\t\t\taria-hidden={true}\n\t\t\t\t\trole=\"none\"\n\t\t\t\t>\n\t\t\t\t\t<div id=\"navigated\"></div>\n\t\t\t\t</TableHeaderCell>\n\t\t\t}\n\n\t\t\t{ this._renderDummyCell && !this._hasPopin &&\n\t\t\t\t<TableHeaderCell id=\"dummy-cell\" role=\"none\" aria-hidden={true}\n\t\t\t\t\tdata-excluded-from-navigation=\"nofocus\">\n\t\t\t\t</TableHeaderCell>\n\t\t\t}\n\n\t\t\t{ this._hasPopin &&\n\t\t\t\t<TableHeaderCell id=\"popin-cell\" aria-colindex={ariaColIndex++} data-excluded-from-navigation>\n\t\t\t\t\t<div id=\"popin-cell-content\">{this._i18nRowPopin}</div>\n\t\t\t\t</TableHeaderCell>\n\t\t\t}\n\t\t</>\n\t);\n}\n"]}
|
package/dist/TableRow.d.ts
CHANGED
|
@@ -89,6 +89,8 @@ declare class TableRow extends TableRowBase<TableCell> {
|
|
|
89
89
|
get _rowIndex(): number;
|
|
90
90
|
get _hasOverflowActions(): boolean;
|
|
91
91
|
get _overflowButtonTooltip(): string;
|
|
92
|
+
get _overflowButtonComponent(): typeof Button | undefined;
|
|
93
|
+
get _overflowButtonIcon(): string | undefined;
|
|
92
94
|
get _flexibleActions(): TableRowActionBase[];
|
|
93
95
|
get _fixedActions(): TableRowActionBase[];
|
|
94
96
|
get _overflowActions(): TableRowActionBase[];
|
package/dist/TableRow.js
CHANGED
|
@@ -134,6 +134,12 @@ let TableRow = class TableRow extends TableRowBase {
|
|
|
134
134
|
get _overflowButtonTooltip() {
|
|
135
135
|
return TableRowBase.i18nBundle.getText(TABLE_ROW_OVERFLOW_BUTTON);
|
|
136
136
|
}
|
|
137
|
+
get _overflowButtonComponent() {
|
|
138
|
+
return this.actions.at(0)?.overflowButtonComponent;
|
|
139
|
+
}
|
|
140
|
+
get _overflowButtonIcon() {
|
|
141
|
+
return this.actions.at(0)?.overflowButtonIcon;
|
|
142
|
+
}
|
|
137
143
|
get _flexibleActions() {
|
|
138
144
|
const flexibleActions = this.actions.filter(action => !action.isFixedAction());
|
|
139
145
|
const fixedActionsCount = this.actions.length - flexibleActions.length;
|
package/dist/TableRow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRow.js","sourceRoot":"","sources":["../src/TableRow.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,IAAI,IAAI,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACzG,OAAO,EA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AAqB,GAAG,CAAC,EAAE,CAAC;YAC/B,MAAM,SAAS,GAAG,qBAAqB,KAAK,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,0BAA0B,CAAC;YACrG,OAAO,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;QAC1E,CAAC;IACF,CAAC;CACD,CAAA;AA1NA;IATC,IAAI,CAAC;QACL,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,IAAI;QACf,eAAe,EAAE,IAAI;QACrB,uBAAuB,EAAE;YACxB,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,CAAC;YAChD,KAAK,EAAE,KAAK;SACZ;KACD,CAAC;uCAC6B;AAc/B;IAJC,IAAI,CAAC;QACL,IAAI,EAAE,WAAW;QACjB,eAAe,EAAE,IAAI;KACrB,CAAC;yCACiC;AAWnC;IADC,QAAQ,EAAE;wCACK;AAUhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACT;AASlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CACR;AASpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACV;AAUlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCACZ;AAGhB;IADC,KAAK,CAAC,aAAa,CAAC;4CACE;AAnFlB,QAAQ;IALb,aAAa,CAAC;QACd,GAAG,EAAE,eAAe;QACpB,MAAM,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC;QAC1C,QAAQ,EAAE,gBAAgB;KAC1B,CAAC;GACI,QAAQ,CA2Ob;AAED,QAAQ,CAAC,MAAM,EAAE,CAAC;AAElB,eAAe,QAAQ,CAAC","sourcesContent":["import { customElement, slotStrict as slot, property } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport { isEnter } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport getActiveElement from \"@ui5/webcomponents-base/dist/util/getActiveElement.js\";\nimport query from \"@ui5/webcomponents-base/dist/decorators/query.js\";\nimport { toggleAttribute } from \"./TableUtils.js\";\nimport TableRowTemplate from \"./TableRowTemplate.js\";\nimport TableRowBase from \"./TableRowBase.js\";\nimport TableRowCss from \"./generated/themes/TableRow.css.js\";\nimport type TableCell from \"./TableCell.js\";\nimport type TableRowActionBase from \"./TableRowActionBase.js\";\nimport type Button from \"./Button.js\";\nimport type { UI5CustomEvent } from \"@ui5/webcomponents-base\";\nimport type { Slot, DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport {\n\tTABLE_ROW_MULTIPLE_ACTIONS, TABLE_ROW_SINGLE_ACTION, TABLE_ROW_OVERFLOW_BUTTON,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-table-row` component represents a row in the `ui5-table`.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/TableRow.js\";`\n *\n * @constructor\n * @extends TableRowBase\n * @since 2.0.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-table-row\",\n\tstyles: [TableRowBase.styles, TableRowCss],\n\ttemplate: TableRowTemplate,\n})\nclass TableRow extends TableRowBase<TableCell> {\n\t/**\n\t * Defines the cells of the component.\n\t *\n\t * **Note:** Use `ui5-table-cell` for the intended design.\n\t *\n\t * @public\n\t */\n\t@slot({\n\t\ttype: HTMLElement,\n\t\t\"default\": true,\n\t\tindividualSlots: true,\n\t\tinvalidateOnChildChange: {\n\t\t\tproperties: [\"merged\", \"_popin\", \"_popinHidden\"],\n\t\t\tslots: false,\n\t\t},\n\t})\n\tcells!: DefaultSlot<TableCell>;\n\n\t/**\n\t * Defines the actions of the component.\n\t *\n\t * **Note:** Use `ui5-table-row-action` or `ui5-table-row-action-navigation` for the intended design.\n\t *\n\t * @since 2.7.0\n\t * @public\n\t */\n\t@slot({\n\t\ttype: HTMLElement,\n\t\tindividualSlots: true,\n\t})\n\tactions!: Slot<TableRowActionBase>;\n\n\t/**\n\t * Unique identifier of the row.\n\t *\n\t * **Note:** For selection features to work properly, this property is mandatory, and its value must not contain spaces.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\trowKey?: string;\n\n\t/**\n\t * Defines the 0-based position of the row related to the total number of rows within the table when the `ui5-table-virtualizer` feature is used.\n\t *\n\t * @default undefined\n\t * @since 2.5.0\n\t * @public\n\t */\n\t@property({ type: Number })\n\tposition?: number;\n\n\t/**\n\t * Defines the interactive state of the row.\n\t *\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tinteractive = false;\n\n\t/**\n\t * Defines the navigated state of the row.\n\t *\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tnavigated = false;\n\n\t/**\n\t * Defines whether the row is movable.\n\t *\n\t * @default false\n\t * @since 2.6.0\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tmovable = false;\n\n\t@query(\"#popin-cell\")\n\t_popinCell?: TableCell;\n\n\tonBeforeRendering() {\n\t\tsuper.onBeforeRendering();\n\t\tthis.ariaRowIndex = (this.role === \"row\") ? `${this._rowIndex + 2}` : null;\n\t\ttoggleAttribute(this, \"draggable\", this.movable, \"true\");\n\t\ttoggleAttribute(this, \"_interactive\", this._isInteractive);\n\t\ttoggleAttribute(this, \"_alternate\", this._alternate);\n\t}\n\n\tasync _onpointerdown(e: PointerEvent) {\n\t\tif (e.button !== 0 || !this._isInteractive) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst composedPath = e.composedPath();\n\t\tcomposedPath.splice(composedPath.indexOf(this));\n\t\tawait new Promise(resolve => setTimeout(resolve)); // wait for the focus to be set\n\t\tconst activeElement = getActiveElement() as Element;\n\t\tif (!composedPath.includes(activeElement)) {\n\t\t\tthis._setActive(\"pointerup\");\n\t\t}\n\t}\n\n\t_onkeydown(e: KeyboardEvent, eventOrigin: HTMLElement) {\n\t\tsuper._onkeydown(e, eventOrigin);\n\t\tif (e.defaultPrevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (eventOrigin === this && this._isInteractive && isEnter(e)) {\n\t\t\tthis._setActive(\"keyup\");\n\t\t\tthis._onclick();\n\t\t}\n\t}\n\n\t_onclick() {\n\t\tif (this === getActiveElement()) {\n\t\t\tif (this._isSelectable && !this._hasSelector) {\n\t\t\t\tthis._onSelectionChange();\n\t\t\t} else \tif (this.interactive || this._isNavigable) {\n\t\t\t\tthis._table?._onRowClick(this);\n\t\t\t}\n\t\t}\n\t}\n\n\t_setActive(deactivationEvent: string) {\n\t\tthis.toggleAttribute(\"_active\", true);\n\t\tdocument.addEventListener(deactivationEvent, () => {\n\t\t\tthis.removeAttribute(\"_active\");\n\t\t}, { once: true });\n\t}\n\n\t_onOverflowButtonClick(e: UI5CustomEvent<Button, \"click\">) {\n\t\tconst ctor = this.actions[0].constructor as typeof TableRowActionBase;\n\t\tctor.showMenu(this._overflowActions, e.target as HTMLElement);\n\t\te.stopPropagation();\n\t}\n\n\tget _isInteractive() {\n\t\treturn this.interactive || (this._isSelectable && !this._hasSelector) || this._isNavigable;\n\t}\n\n\tget _isNavigable() {\n\t\treturn this._fixedActions.find(action => {\n\t\t\treturn action.hasAttribute(\"ui5-table-row-action-navigation\") && !action.invisible && !action._isInteractive;\n\t\t}) !== undefined;\n\t}\n\n\tget _rowIndex() {\n\t\tif (this.position !== undefined) {\n\t\t\treturn this.position;\n\t\t}\n\t\tif (this._table) {\n\t\t\treturn this._table.rows.indexOf(this);\n\t\t}\n\t\treturn -1;\n\t}\n\n\tget _hasOverflowActions() {\n\t\tlet renderableActionsCount = 0;\n\t\treturn this.actions.some(action => {\n\t\t\tif (action.isFixedAction() || !action.invisible) {\n\t\t\t\trenderableActionsCount++;\n\t\t\t}\n\t\t\treturn renderableActionsCount > this._rowActionCount;\n\t\t});\n\t}\n\n\tget _overflowButtonTooltip() {\n\t\treturn TableRowBase.i18nBundle.getText(TABLE_ROW_OVERFLOW_BUTTON);\n\t}\n\n\tget _flexibleActions() {\n\t\tconst flexibleActions = this.actions.filter(action => !action.isFixedAction());\n\t\tconst fixedActionsCount = this.actions.length - flexibleActions.length;\n\t\tlet maxFlexibleActionsCount = this._rowActionCount - fixedActionsCount;\n\t\tif (maxFlexibleActionsCount < 1) {\n\t\t\treturn []; // fixed actions occupy all the available space\n\t\t}\n\t\tif (flexibleActions.length <= maxFlexibleActionsCount) {\n\t\t\treturn flexibleActions; // all actions fit the available space\n\t\t}\n\n\t\tconst visibleFlexibleActions = flexibleActions.filter(action => !action.invisible);\n\t\tif (visibleFlexibleActions.length > maxFlexibleActionsCount) {\n\t\t\tmaxFlexibleActionsCount--;\t// preserve space for the overflow button\n\t\t}\n\n\t\treturn visibleFlexibleActions.slice(0, maxFlexibleActionsCount);\n\t}\n\n\tget _fixedActions() {\n\t\tlet maxFixedActionsCount = this._rowActionCount;\n\t\tif (this._hasOverflowActions) {\n\t\t\tmaxFixedActionsCount--;\n\t\t}\n\n\t\tconst fixedActions = this.actions.filter(action => action.isFixedAction());\n\t\treturn fixedActions.slice(0, maxFixedActionsCount);\n\t}\n\n\tget _overflowActions() {\n\t\tconst fixedActions = this._fixedActions;\n\t\tconst flexibleActions = this._flexibleActions;\n\t\tconst overflowActions: Array<TableRowActionBase> = [];\n\t\tthis.actions.forEach(action => {\n\t\t\tif (!action.invisible && !fixedActions.includes(action) && !flexibleActions.includes(action)) {\n\t\t\t\toverflowActions.push(action);\n\t\t\t}\n\t\t});\n\n\t\treturn overflowActions;\n\t}\n\n\tget _availableActionsCount() {\n\t\tif (this._rowActionCount < 1) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn [...this._flexibleActions, ...this._fixedActions].filter(action => {\n\t\t\treturn !action.invisible && action._isInteractive;\n\t\t}).length + (this._hasOverflowActions ? 1 : 0);\n\t}\n\n\tget _actionCellAccText() {\n\t\tconst availableActionsCount = this._availableActionsCount;\n\t\tif (availableActionsCount > 0) {\n\t\t\tconst bundleKey = availableActionsCount === 1 ? TABLE_ROW_SINGLE_ACTION : TABLE_ROW_MULTIPLE_ACTIONS;\n\t\t\treturn TableRowBase.i18nBundle.getText(bundleKey, availableActionsCount);\n\t\t}\n\t}\n}\n\nTableRow.define();\n\nexport default TableRow;\n"]}
|
|
1
|
+
{"version":3,"file":"TableRow.js","sourceRoot":"","sources":["../src/TableRow.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,IAAI,IAAI,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACzG,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,gBAAgB,MAAM,uDAAuD,CAAC;AACrF,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAM7D,OAAO,EACN,0BAA0B,EAAE,uBAAuB,EAAE,yBAAyB,GAC9E,MAAM,mCAAmC,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AAMH,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,YAAuB;IAA9C;;QAsDC;;;;;WAKG;QAEH,gBAAW,GAAG,KAAK,CAAC;QAEpB;;;;;WAKG;QAEH,cAAS,GAAG,KAAK,CAAC;QAElB;;;;;;WAMG;QAEH,YAAO,GAAG,KAAK,CAAC;IAmKjB,CAAC;IA9JA,iBAAiB;QAChB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3E,eAAe,CA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AE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACT;AASlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CACR;AASpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACV;AAUlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCACZ;AAGhB;IADC,KAAK,CAAC,aAAa,CAAC;4CACE;AAnFlB,QAAQ;IALb,aAAa,CAAC;QACd,GAAG,EAAE,eAAe;QACpB,MAAM,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC;QAC1C,QAAQ,EAAE,gBAAgB;KAC1B,CAAC;GACI,QAAQ,CAmPb;AAED,QAAQ,CAAC,MAAM,EAAE,CAAC;AAElB,eAAe,QAAQ,CAAC","sourcesContent":["import { customElement, slotStrict as slot, property } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport { isEnter } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport getActiveElement from \"@ui5/webcomponents-base/dist/util/getActiveElement.js\";\nimport query from \"@ui5/webcomponents-base/dist/decorators/query.js\";\nimport { toggleAttribute } from \"./TableUtils.js\";\nimport TableRowTemplate from \"./TableRowTemplate.js\";\nimport TableRowBase from \"./TableRowBase.js\";\nimport TableRowCss from \"./generated/themes/TableRow.css.js\";\nimport type TableCell from \"./TableCell.js\";\nimport type TableRowActionBase from \"./TableRowActionBase.js\";\nimport type Button from \"./Button.js\";\nimport type { UI5CustomEvent } from \"@ui5/webcomponents-base\";\nimport type { Slot, DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport {\n\tTABLE_ROW_MULTIPLE_ACTIONS, TABLE_ROW_SINGLE_ACTION, TABLE_ROW_OVERFLOW_BUTTON,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-table-row` component represents a row in the `ui5-table`.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/TableRow.js\";`\n *\n * @constructor\n * @extends TableRowBase\n * @since 2.0.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-table-row\",\n\tstyles: [TableRowBase.styles, TableRowCss],\n\ttemplate: TableRowTemplate,\n})\nclass TableRow extends TableRowBase<TableCell> {\n\t/**\n\t * Defines the cells of the component.\n\t *\n\t * **Note:** Use `ui5-table-cell` for the intended design.\n\t *\n\t * @public\n\t */\n\t@slot({\n\t\ttype: HTMLElement,\n\t\t\"default\": true,\n\t\tindividualSlots: true,\n\t\tinvalidateOnChildChange: {\n\t\t\tproperties: [\"merged\", \"_popin\", \"_popinHidden\"],\n\t\t\tslots: false,\n\t\t},\n\t})\n\tcells!: DefaultSlot<TableCell>;\n\n\t/**\n\t * Defines the actions of the component.\n\t *\n\t * **Note:** Use `ui5-table-row-action` or `ui5-table-row-action-navigation` for the intended design.\n\t *\n\t * @since 2.7.0\n\t * @public\n\t */\n\t@slot({\n\t\ttype: HTMLElement,\n\t\tindividualSlots: true,\n\t})\n\tactions!: Slot<TableRowActionBase>;\n\n\t/**\n\t * Unique identifier of the row.\n\t *\n\t * **Note:** For selection features to work properly, this property is mandatory, and its value must not contain spaces.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\trowKey?: string;\n\n\t/**\n\t * Defines the 0-based position of the row related to the total number of rows within the table when the `ui5-table-virtualizer` feature is used.\n\t *\n\t * @default undefined\n\t * @since 2.5.0\n\t * @public\n\t */\n\t@property({ type: Number })\n\tposition?: number;\n\n\t/**\n\t * Defines the interactive state of the row.\n\t *\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tinteractive = false;\n\n\t/**\n\t * Defines the navigated state of the row.\n\t *\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tnavigated = false;\n\n\t/**\n\t * Defines whether the row is movable.\n\t *\n\t * @default false\n\t * @since 2.6.0\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tmovable = false;\n\n\t@query(\"#popin-cell\")\n\t_popinCell?: TableCell;\n\n\tonBeforeRendering() {\n\t\tsuper.onBeforeRendering();\n\t\tthis.ariaRowIndex = (this.role === \"row\") ? `${this._rowIndex + 2}` : null;\n\t\ttoggleAttribute(this, \"draggable\", this.movable, \"true\");\n\t\ttoggleAttribute(this, \"_interactive\", this._isInteractive);\n\t\ttoggleAttribute(this, \"_alternate\", this._alternate);\n\t}\n\n\tasync _onpointerdown(e: PointerEvent) {\n\t\tif (e.button !== 0 || !this._isInteractive) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst composedPath = e.composedPath();\n\t\tcomposedPath.splice(composedPath.indexOf(this));\n\t\tawait new Promise(resolve => setTimeout(resolve)); // wait for the focus to be set\n\t\tconst activeElement = getActiveElement() as Element;\n\t\tif (!composedPath.includes(activeElement)) {\n\t\t\tthis._setActive(\"pointerup\");\n\t\t}\n\t}\n\n\t_onkeydown(e: KeyboardEvent, eventOrigin: HTMLElement) {\n\t\tsuper._onkeydown(e, eventOrigin);\n\t\tif (e.defaultPrevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (eventOrigin === this && this._isInteractive && isEnter(e)) {\n\t\t\tthis._setActive(\"keyup\");\n\t\t\tthis._onclick();\n\t\t}\n\t}\n\n\t_onclick() {\n\t\tif (this === getActiveElement()) {\n\t\t\tif (this._isSelectable && !this._hasSelector) {\n\t\t\t\tthis._onSelectionChange();\n\t\t\t} else \tif (this.interactive || this._isNavigable) {\n\t\t\t\tthis._table?._onRowClick(this);\n\t\t\t}\n\t\t}\n\t}\n\n\t_setActive(deactivationEvent: string) {\n\t\tthis.toggleAttribute(\"_active\", true);\n\t\tdocument.addEventListener(deactivationEvent, () => {\n\t\t\tthis.removeAttribute(\"_active\");\n\t\t}, { once: true });\n\t}\n\n\t_onOverflowButtonClick(e: UI5CustomEvent<Button, \"click\">) {\n\t\tconst ctor = this.actions[0].constructor as typeof TableRowActionBase;\n\t\tctor.showMenu(this._overflowActions, e.target as HTMLElement);\n\t\te.stopPropagation();\n\t}\n\n\tget _isInteractive() {\n\t\treturn this.interactive || (this._isSelectable && !this._hasSelector) || this._isNavigable;\n\t}\n\n\tget _isNavigable() {\n\t\treturn this._fixedActions.find(action => {\n\t\t\treturn action.hasAttribute(\"ui5-table-row-action-navigation\") && !action.invisible && !action._isInteractive;\n\t\t}) !== undefined;\n\t}\n\n\tget _rowIndex() {\n\t\tif (this.position !== undefined) {\n\t\t\treturn this.position;\n\t\t}\n\t\tif (this._table) {\n\t\t\treturn this._table.rows.indexOf(this);\n\t\t}\n\t\treturn -1;\n\t}\n\n\tget _hasOverflowActions() {\n\t\tlet renderableActionsCount = 0;\n\t\treturn this.actions.some(action => {\n\t\t\tif (action.isFixedAction() || !action.invisible) {\n\t\t\t\trenderableActionsCount++;\n\t\t\t}\n\t\t\treturn renderableActionsCount > this._rowActionCount;\n\t\t});\n\t}\n\n\tget _overflowButtonTooltip() {\n\t\treturn TableRowBase.i18nBundle.getText(TABLE_ROW_OVERFLOW_BUTTON);\n\t}\n\n\tget _overflowButtonComponent(): typeof Button | undefined {\n\t\treturn this.actions.at(0)?.overflowButtonComponent;\n\t}\n\n\tget _overflowButtonIcon(): string | undefined {\n\t\treturn this.actions.at(0)?.overflowButtonIcon;\n\t}\n\n\tget _flexibleActions() {\n\t\tconst flexibleActions = this.actions.filter(action => !action.isFixedAction());\n\t\tconst fixedActionsCount = this.actions.length - flexibleActions.length;\n\t\tlet maxFlexibleActionsCount = this._rowActionCount - fixedActionsCount;\n\t\tif (maxFlexibleActionsCount < 1) {\n\t\t\treturn []; // fixed actions occupy all the available space\n\t\t}\n\t\tif (flexibleActions.length <= maxFlexibleActionsCount) {\n\t\t\treturn flexibleActions; // all actions fit the available space\n\t\t}\n\n\t\tconst visibleFlexibleActions = flexibleActions.filter(action => !action.invisible);\n\t\tif (visibleFlexibleActions.length > maxFlexibleActionsCount) {\n\t\t\tmaxFlexibleActionsCount--;\t// preserve space for the overflow button\n\t\t}\n\n\t\treturn visibleFlexibleActions.slice(0, maxFlexibleActionsCount);\n\t}\n\n\tget _fixedActions() {\n\t\tlet maxFixedActionsCount = this._rowActionCount;\n\t\tif (this._hasOverflowActions) {\n\t\t\tmaxFixedActionsCount--;\n\t\t}\n\n\t\tconst fixedActions = this.actions.filter(action => action.isFixedAction());\n\t\treturn fixedActions.slice(0, maxFixedActionsCount);\n\t}\n\n\tget _overflowActions() {\n\t\tconst fixedActions = this._fixedActions;\n\t\tconst flexibleActions = this._flexibleActions;\n\t\tconst overflowActions: Array<TableRowActionBase> = [];\n\t\tthis.actions.forEach(action => {\n\t\t\tif (!action.invisible && !fixedActions.includes(action) && !flexibleActions.includes(action)) {\n\t\t\t\toverflowActions.push(action);\n\t\t\t}\n\t\t});\n\n\t\treturn overflowActions;\n\t}\n\n\tget _availableActionsCount() {\n\t\tif (this._rowActionCount < 1) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn [...this._flexibleActions, ...this._fixedActions].filter(action => {\n\t\t\treturn !action.invisible && action._isInteractive;\n\t\t}).length + (this._hasOverflowActions ? 1 : 0);\n\t}\n\n\tget _actionCellAccText() {\n\t\tconst availableActionsCount = this._availableActionsCount;\n\t\tif (availableActionsCount > 0) {\n\t\t\tconst bundleKey = availableActionsCount === 1 ? TABLE_ROW_SINGLE_ACTION : TABLE_ROW_MULTIPLE_ACTIONS;\n\t\t\treturn TableRowBase.i18nBundle.getText(bundleKey, availableActionsCount);\n\t\t}\n\t}\n}\n\nTableRow.define();\n\nexport default TableRow;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
2
|
import type { UI5CustomEvent } from "@ui5/webcomponents-base";
|
|
3
|
-
import
|
|
3
|
+
import Button from "./Button.js";
|
|
4
4
|
/**
|
|
5
5
|
* Fired when a row action is clicked.
|
|
6
6
|
*
|
|
@@ -20,6 +20,8 @@ declare abstract class TableRowActionBase extends UI5Element {
|
|
|
20
20
|
* @public
|
|
21
21
|
*/
|
|
22
22
|
invisible: boolean;
|
|
23
|
+
get overflowButtonComponent(): typeof Button;
|
|
24
|
+
get overflowButtonIcon(): string;
|
|
23
25
|
private static _menu;
|
|
24
26
|
private static _menuItems;
|
|
25
27
|
static showMenu(actions: TableRowActionBase[], opener: HTMLElement): Promise<void>;
|
|
@@ -9,6 +9,8 @@ import { customElement, property, eventStrict } from "@ui5/webcomponents-base/di
|
|
|
9
9
|
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
|
10
10
|
import TableRowActionBaseTemplate from "./TableRowActionBaseTemplate.js";
|
|
11
11
|
import TableRowActionBaseStyles from "./generated/themes/TableRowActionBase.css.js";
|
|
12
|
+
import Button from "./Button.js";
|
|
13
|
+
import iconOverflow from "@ui5/webcomponents-icons/dist/overflow.js";
|
|
12
14
|
let MenuConstructor;
|
|
13
15
|
let MenuItemConstructor;
|
|
14
16
|
/**
|
|
@@ -30,6 +32,12 @@ let TableRowActionBase = class TableRowActionBase extends UI5Element {
|
|
|
30
32
|
*/
|
|
31
33
|
this.invisible = false;
|
|
32
34
|
}
|
|
35
|
+
get overflowButtonComponent() {
|
|
36
|
+
return Button;
|
|
37
|
+
}
|
|
38
|
+
get overflowButtonIcon() {
|
|
39
|
+
return iconOverflow;
|
|
40
|
+
}
|
|
33
41
|
static async showMenu(actions, opener) {
|
|
34
42
|
if (!MenuConstructor) {
|
|
35
43
|
[MenuConstructor, MenuItemConstructor] = await Promise.all([
|