@ui5/webcomponents 2.27.0-rc.1 → 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 +23 -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/DateTimeInput.d.ts +6 -0
- package/dist/DateTimeInput.js +11 -0
- package/dist/DateTimeInput.js.map +1 -1
- package/dist/Filters.js +1 -1
- package/dist/Filters.js.map +1 -1
- package/dist/List.js +4 -1
- package/dist/List.js.map +1 -1
- package/dist/ListItem.d.ts +4 -4
- package/dist/ListItem.js +6 -6
- package/dist/ListItem.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/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/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 +161 -21
- package/dist/custom-elements.json +152 -19
- 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 +3 -1
- package/dist/generated/i18n/i18n-defaults.js +6 -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 +38 -8
- package/dist/web-types.json +76 -16
- package/package.json +9 -9
- package/src/CardHeaderTemplate.tsx +19 -20
- 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/i18n/messagebundle.properties +6 -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 +11 -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 +6 -0
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableSelectionBase.js","sourceRoot":"","sources":["../src/TableSelectionBase.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"TableSelectionBase.js","sourceRoot":"","sources":["../src/TableSelectionBase.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAMpD,OAAO,sBAAsB,MAAM,mCAAmC,CAAC;AACvE,OAAO,EACN,sBAAsB,EACtB,uBAAuB,GACvB,MAAM,mCAAmC,CAAC;AAS3C;;;;GAIG;AAaH,IAAe,kBAAkB;AARjC;;;;;;;GAOG;AACH,MAAe,kBAAmB,SAAQ,UAAU;IAApD;;QAcC;;;;;;WAMG;QAEH,aAAQ,GAAgC,aAAa,CAAC;QAE7C,eAAU,GAAG,gBAAgB,CAAC;QAE/B,gBAAW,GAAG,CAAC,CAAC;IAoIzB,CAAC;IAlIA,eAAe,CAAC,KAAY;QAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,u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d,CAAC;IAEF;;;;;;;OAOG;GACY,kBAAkB,CA8JhC;AAED,eAAe,kBAAkB,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport { property, eventStrict } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport { isInstanceOfTable } from \"./TableUtils.js\";\nimport type Icon from \"./Icon.js\";\nimport type Table from \"./Table.js\";\nimport type TableRowBase from \"./TableRowBase.js\";\nimport type TableRow from \"./TableRow.js\";\nimport type { ITableFeature } from \"./Table.js\";\nimport TableSelectionBehavior from \"./types/TableSelectionBehavior.js\";\nimport {\n\tTABLE_MULTI_SELECTABLE,\n\tTABLE_SINGLE_SELECTABLE,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n/**\n * Fired when selection is changed by user interaction.\n *\n * @public\n */\ntype TableSelectionBaseChangeEventDetail = void;\n\n/**\n * Fired when the selection is changed by user interaction.\n *\n * @public\n */\n@eventStrict(\"change\", {\n\tbubbles: false,\n})\n\n/**\n * @class\n * The `TableSelectionBase` class serves as a foundation for table selections.\n * @constructor\n * @extends UI5Element\n * @since 2.8.0\n * @public\n */\nabstract class TableSelectionBase extends UI5Element implements ITableFeature {\n\teventDetails!: {\n\t\tchange: TableSelectionBaseChangeEventDetail,\n\t}\n\n\t/**\n\t * Defines the selected elements of the component.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tselected?: string;\n\n\t/**\n\t * Defines the selection behavior.\n\t *\n\t * @default \"RowSelector\"\n\t * @public\n\t * @since 2.11\n\t */\n\t@property()\n\tbehavior: `${TableSelectionBehavior}` = \"RowSelector\";\n\n\treadonly identifier = \"TableSelection\";\n\tprotected _table?: Table;\n\tprivate _rowsLength = 0;\n\n\tonTableActivate(table: Table) {\n\t\tthis._table = table;\n\t\tthis._invalidateTableAndRows();\n\t}\n\n\tonExitDOM() {\n\t\tthis._invalidateTableAndRows();\n\t\tthis._table = undefined;\n\t}\n\n\tonBeforeRendering() {\n\t\tif (!this._table && this.parentElement && isInstanceOfTable(this.parentElement)) {\n\t\t\tthis._table = this.parentElement;\n\t\t}\n\t\tthis._invalidateTableAndRows();\n\t}\n\n\tonTableBeforeRendering() {\n\t\tif (this._table && this._table.headerRow[0] && this._rowsLength !== this._table.rows.length) {\n\t\t\tthis._rowsLength = this._table.rows.length;\n\t\t\tthis._table.headerRow[0]._invalidate++;\n\t\t}\n\t}\n\n\t// this will be removed when the legacy selection component is removed\n\tisSelectable(): boolean {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Determines if the component allows multiple selection.\n\t */\n\tisMultiSelectable(): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Determines whether a row selector (for example, `radiobutton` or `checkbox`) is rendered.\n\t */\n\tisRowSelectorRequired(): boolean {\n\t\treturn this.behavior === TableSelectionBehavior.RowSelector;\n\t}\n\n\t/**\n\t * Returns the component used to render the row selector (for example, `CheckBox` or `RadioButton`).\n\t */\n\tgetSelectionComponent(): typeof UI5Element | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Returns the component used to render the \"Clear All\" selector in the column header.\n\t */\n\tgetClearAllComponent(): typeof Icon | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Returns the icon name used for the \"Clear All\" selector in the column header.\n\t */\n\tgetClearAllIcon(): string | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Returns the ARIA description of the Table as an alternative to aria-multiselectable.\n\t */\n\tgetAriaDescriptionForTable(): string | undefined {\n\t\tif (!this._table || !this._table.rows.length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst i18nBundle = (this._table.constructor as typeof Table).i18nBundle;\n\t\treturn i18nBundle.getText(this.isMultiSelectable() ? TABLE_MULTI_SELECTABLE : TABLE_SINGLE_SELECTABLE);\n\t}\n\n\t/**\n\t * Returns the ARIA description of the selection component displayed in the column header.\n\t */\n\tgetAriaDescriptionForColumnHeader(): string | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Returns the unique key associated with the table row.\n\t *\n\t * @param row The row instance\n\t */\n\tgetRowKey(row: TableRow): string {\n\t\treturn row.rowKey || \"\";\n\t}\n\n\t/**\n\t * Returns the table row instance for the given row key.\n\t *\n\t * @param rowKey The row key\n\t * @public\n\t */\n\tgetRowByKey(rowKey: string): TableRow | undefined {\n\t\tif (this._table && rowKey) {\n\t\t\treturn this._table.rows.find(row => this.getRowKey(row) === rowKey);\n\t\t}\n\t}\n\n\t/**\n\t * Determines whether the specified table row is currently selected.\n\t *\n\t * @param row The row instance\n\t */\n\tabstract isSelected(row: TableRowBase): boolean;\n\n\t/**\n\t * Sets the selected state of the specified table row.\n\t *\n\t * @param row The row instance\n\t * @param selected Whether the row is selected\n\t * @param fireEvent Whether the change event should be fired\n\t */\n\tabstract setSelected(row: TableRowBase, selected: boolean, fireEvent: boolean): void;\n\n\t/**\n\t * Invalidates the table and its rows to re-evaluate the selection.\n\t */\n\tprotected _invalidateTableAndRows() {\n\t\tif (this._table) {\n\t\t\tthis._table._invalidate++;\n\t\t\tthis._table.rows.forEach(row => row._invalidate++);\n\t\t\tthis._table.headerRow.forEach(row => row._invalidate++);\n\t\t}\n\t}\n}\n\nexport default TableSelectionBase;\n\nexport type {\n\tTableSelectionBaseChangeEventDetail,\n};\n"]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import TableSelectionBase from "./TableSelectionBase.js";
|
|
2
|
+
import CheckBox from "./CheckBox.js";
|
|
3
|
+
import Icon from "./Icon.js";
|
|
2
4
|
import type TableRow from "./TableRow.js";
|
|
3
5
|
import type TableRowBase from "./TableRowBase.js";
|
|
4
6
|
import type TableSelectionMultiHeaderSelector from "./types/TableSelectionMultiHeaderSelector.js";
|
|
@@ -53,6 +55,9 @@ declare class TableSelectionMulti extends TableSelectionBase {
|
|
|
53
55
|
onTableBeforeRendering(): void;
|
|
54
56
|
onTableAfterRendering(): void;
|
|
55
57
|
isMultiSelectable(): boolean;
|
|
58
|
+
getSelectionComponent(): typeof CheckBox;
|
|
59
|
+
getClearAllComponent(): typeof Icon;
|
|
60
|
+
getClearAllIcon(): string;
|
|
56
61
|
isSelected(row: TableRowBase): boolean;
|
|
57
62
|
setSelected(row: TableRowBase, selected: boolean, fireEvent?: boolean): void;
|
|
58
63
|
/**
|
|
@@ -6,6 +6,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { customElement, property } from "@ui5/webcomponents-base/dist/decorators.js";
|
|
8
8
|
import TableSelectionBase from "./TableSelectionBase.js";
|
|
9
|
+
import CheckBox from "./CheckBox.js";
|
|
10
|
+
import Icon from "./Icon.js";
|
|
11
|
+
import ClearAll from "@ui5/webcomponents-icons/dist/clear-all.js";
|
|
9
12
|
import getActiveElement from "@ui5/webcomponents-base/dist/util/getActiveElement.js";
|
|
10
13
|
import { isSelectionCell, isHeaderSelectionCell, findRowInPath } from "./TableUtils.js";
|
|
11
14
|
import { isUpShift } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
@@ -62,6 +65,15 @@ let TableSelectionMulti = class TableSelectionMulti extends TableSelectionBase {
|
|
|
62
65
|
isMultiSelectable() {
|
|
63
66
|
return true;
|
|
64
67
|
}
|
|
68
|
+
getSelectionComponent() {
|
|
69
|
+
return CheckBox;
|
|
70
|
+
}
|
|
71
|
+
getClearAllComponent() {
|
|
72
|
+
return Icon;
|
|
73
|
+
}
|
|
74
|
+
getClearAllIcon() {
|
|
75
|
+
return ClearAll;
|
|
76
|
+
}
|
|
65
77
|
isSelected(row) {
|
|
66
78
|
if (row.isHeaderRow()) {
|
|
67
79
|
return this.headerSelector === "ClearAll" ? true : this.areAllRowsSelected();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableSelectionMulti.js","sourceRoot":"","sources":["../src/TableSelectionMulti.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,kBAAkB,MAAM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;IAFxB,aAAa,CAAC,EAAE,GAAG,EAAE,2BAA2B,EAAE,CAAC;GAE9C,mBAAmB,CA8SxB;AAED,mBAAmB,CAAC,MAAM,EAAE,CAAC;AAE7B,eAAe,mBAAmB,CAAC","sourcesContent":["import { customElement, property } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport TableSelectionBase from \"./TableSelectionBase.js\";\nimport getActiveElement from \"@ui5/webcomponents-base/dist/util/getActiveElement.js\";\nimport { isSelectionCell, isHeaderSelectionCell, findRowInPath } from \"./TableUtils.js\";\nimport { isUpShift } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport type Table from \"./Table.js\";\nimport type TableRow from \"./TableRow.js\";\nimport type TableRowBase from \"./TableRowBase.js\";\nimport type TableSelectionMultiHeaderSelector from \"./types/TableSelectionMultiHeaderSelector.js\";\nimport {\n\tTABLE_COLUMNHEADER_SELECTALL_DESCRIPTION,\n\tTABLE_COLUMNHEADER_CLEARALL_DESCRIPTION,\n\tCHECKBOX_CHECKED,\n\tCHECKBOX_NOT_CHECKED,\n\tACC_STATE_DISABLED,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-table-selection-multi` component is used inside the `ui5-table` to add multi-selection capabilities to the `ui5-table`.\n * Since selection is key-based, each `ui5-table-row` must define a unique `row-key` property.\n *\n * ### Usage\n *\n * The `ui5-table-selection-multi` component is a feature designed exclusively for use within the `ui5-table` component.\n * It must be placed inside the `features` slot of `ui5-table`.\n * This component is not intended for standalone use.\n *\n * ```html\n * <ui5-table>\n * \t<ui5-table-selection-multi slot=\"features\" selected=\"Row1 Row3\"></ui5-table-selection-multi>\n * </ui5-table>\n * ```\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/TableSelectionMulti.js\";`\n *\n * @constructor\n * @extends TableSelectionBase\n * @since 2.8.0\n * @public\n */\n@customElement({ tag: \"ui5-table-selection-multi\" })\n\nclass TableSelectionMulti extends TableSelectionBase {\n\t/**\n\t * Defines the `row-key` values of selected rows, with each value separated by a space.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tselected?: string;\n\n\t/**\n\t * Defines the selector of the header row.\n\t *\n\t * @default \"SelectAll\"\n\t * @public\n\t * @since 2.12\n\t */\n\t@property()\n\theaderSelector: `${TableSelectionMultiHeaderSelector}` = \"SelectAll\";\n\n\tprivate _rangeSelection?: {\n\t\tselected: boolean,\n\t\tisUp: boolean | null,\n\t\trows: TableRow[],\n\t\tisMouse: boolean,\n\t\tshiftPressed: boolean\n\t} | null;\n\n\t_onClickCaptureBound: (e: MouseEvent) => void;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._onClickCaptureBound = this._onclickCapture.bind(this);\n\t}\n\n\tonTableBeforeRendering() {\n\t\tsuper.onTableBeforeRendering();\n\t\tthis._table?.removeEventListener(\"click\", this._onClickCaptureBound);\n\t}\n\n\tonTableAfterRendering() {\n\t\tthis._table?.addEventListener(\"click\", this._onClickCaptureBound, { capture: true });\n\t}\n\n\tisMultiSelectable(): boolean {\n\t\treturn true;\n\t}\n\n\tisSelected(row: TableRowBase): boolean {\n\t\tif (row.isHeaderRow()) {\n\t\t\treturn this.headerSelector === \"ClearAll\" ? true : this.areAllRowsSelected();\n\t\t}\n\n\t\tconst rowKey = this.getRowKey(row as TableRow);\n\t\treturn this.getSelectedAsSet().has(rowKey);\n\t}\n\n\tsetSelected(row: TableRowBase, selected: boolean, fireEvent: boolean = false) {\n\t\tif (this._rangeSelection?.isMouse && this._rangeSelection.shiftPressed) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst tableRows = row.isHeaderRow() ? this._table!.rows : [row as TableRow];\n\t\tconst selectedSet = this.getSelectedAsSet();\n\t\tconst selectionChanged = tableRows.reduce((selectedSetChanged, tableRow) => {\n\t\t\tconst rowKey = this.getRowKey(tableRow);\n\t\t\tif (!rowKey) {\n\t\t\t\treturn selectedSetChanged;\n\t\t\t}\n\n\t\t\tconst setSize = selectedSet.size;\n\t\t\tselectedSet[selected ? \"add\" : \"delete\"](rowKey);\n\t\t\treturn selectedSetChanged || setSize !== selectedSet.size;\n\t\t}, false);\n\n\t\tif (selectionChanged) {\n\t\t\tthis.setSelectedAsSet(selectedSet);\n\t\t\tfireEvent && this.fireDecoratorEvent(\"change\");\n\t\t}\n\t}\n\n\t/**\n\t * Returns an array of the selected rows.\n\t *\n\t * @public\n\t */\n\tgetSelectedRows(): TableRow[] {\n\t\treturn this._table ? this._table.rows.filter(row => this.isSelected(row)) : [];\n\t}\n\n\t/**\n\t * Determines whether all rows are selected.\n\t */\n\tareAllRowsSelected(): boolean {\n\t\tif (!this._table || !this._table.rows.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst selectedSet = this.getSelectedAsSet();\n\t\treturn this._table.rows.filter(row => row._isSelectable).every(row => {\n\t\t\tconst rowKey = this.getRowKey(row);\n\t\t\treturn selectedSet.has(rowKey);\n\t\t});\n\t}\n\n\t/**\n\t * Returns the `selected` property as a set of unique `row-key` values.\n\t *\n\t * @public\n\t */\n\tgetSelectedAsSet(): Set<string> {\n\t\tconst selected = this.selected || \"\";\n\t\tconst selectedArray = selected.split(\" \").filter(String);\n\t\treturn new Set(selectedArray);\n\t}\n\n\t/**\n\t * Sets the `selected` property using the provided set of unique `row-key` values.\n\t *\n\t * @param selectedSet A set of `row-key` values\n\t * @public\n\t */\n\tsetSelectedAsSet(selectedSet: Set<string>): void {\n\t\tthis.selected = [...selectedSet].join(\" \");\n\t}\n\n\t/**\n\t * Returns the ARIA description of the selection component displayed in the column header.\n\t */\n\tgetAriaDescriptionForColumnHeader(): string | undefined {\n\t\tif (!this._table || !this._table.rows.length || this.behavior === \"RowOnly\") {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet description = \"\";\n\t\tconst seperator = \" \";\n\t\tconst i18nBundle = (this._table.constructor as typeof Table).i18nBundle;\n\t\tif (this.headerSelector === \"SelectAll\") {\n\t\t\tdescription = i18nBundle.getText(TABLE_COLUMNHEADER_SELECTALL_DESCRIPTION);\n\t\t\tdescription += seperator + i18nBundle.getText(this.areAllRowsSelected() ? CHECKBOX_CHECKED : CHECKBOX_NOT_CHECKED);\n\t\t} else {\n\t\t\tdescription = i18nBundle.getText(TABLE_COLUMNHEADER_CLEARALL_DESCRIPTION);\n\t\t\tdescription += this.getSelectedRows().length === 0 ? seperator + i18nBundle.getText(ACC_STATE_DISABLED) : \"\";\n\t\t}\n\t\treturn description;\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (!this._table || !e.shiftKey) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst focusedElement = getActiveElement(); // Assumption: The focused element is always the \"next\" row after navigation.\n\n\t\tif (!(focusedElement?.hasAttribute(\"ui5-table-row\") || this._rangeSelection?.isMouse)) {\n\t\t\tthis._stopRangeSelection();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._rangeSelection) {\n\t\t\t// If no range selection is active, start one\n\t\t\tconst row = focusedElement as TableRow;\n\t\t\tthis._startRangeSelection(row, this.isSelected(row));\n\t\t} else if (e.key === \"ArrowUp\" || e.key === \"ArrowDown\") {\n\t\t\tconst change = isUpShift(e) ? -1 : 1;\n\t\t\tthis._handleRangeSelection(focusedElement as TableRow, change);\n\t\t}\n\n\t\tif (this._rangeSelection) {\n\t\t\tthis._rangeSelection.shiftPressed = e.shiftKey;\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent, eventOrigin: HTMLElement) {\n\t\tif (!this._table) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!eventOrigin.hasAttribute(\"ui5-table-row\") || !this._rangeSelection || !e.shiftKey) {\n\t\t\t// Stop range selection if a) Shift is relased or b) the event target is not a row\n\t\t\tthis._stopRangeSelection();\n\t\t}\n\n\t\tif (this._rangeSelection) {\n\t\t\tthis._rangeSelection.shiftPressed = e.shiftKey;\n\t\t}\n\t}\n\n\t_onclickCapture(e: MouseEvent) {\n\t\tif (!this._table) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isHeaderSelectionCell(e)) {\n\t\t\tthis._stopRangeSelection();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isSelectionCell(e)) {\n\t\t\tthis._stopRangeSelection();\n\t\t\treturn;\n\t\t}\n\n\t\tconst row = findRowInPath(e.composedPath());\n\n\t\tif (e.shiftKey && this._rangeSelection?.isMouse) {\n\t\t\tconst startRow = this._rangeSelection.rows[0];\n\t\t\tconst startIndex = this._table.rows.indexOf(startRow);\n\t\t\tconst endIndex = this._table.rows.indexOf(row);\n\n\t\t\t// Set checkbox to the selection state of the start row (if it is selected)\n\t\t\tconst selectionState = this.isSelected(startRow);\n\n\t\t\t// When doing a range selection and clicking on an already selected row, the checked status should not change\n\t\t\t// Therefore, we need to manually set the checked attribute again, as clicking it would deselect it and leads to\n\t\t\t// a visual inconsistency.\n\t\t\trow.shadowRoot?.querySelector(\"#selection-component\")?.toggleAttribute(\"checked\", selectionState);\n\t\t\te.stopPropagation();\n\n\t\t\tif (startIndex === -1 || endIndex === -1 || row.rowKey === startRow.rowKey || row.rowKey === this._rangeSelection.rows[this._rangeSelection.rows.length - 1].rowKey) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst change = endIndex - startIndex;\n\t\t\tthis._handleRangeSelection(row, change);\n\t\t} else if (row) {\n\t\t\tthis._startRangeSelection(row, !this.isSelected(row), true);\n\t\t}\n\t}\n\n\t/**\n\t * Start the range selection and initialises the range selection state\n\t * @param row starting row\n\t * @private\n\t */\n\t_startRangeSelection(row: TableRow, selected: boolean, isMouse = false) {\n\t\tthis._rangeSelection = {\n\t\t\tselected,\n\t\t\tisUp: null,\n\t\t\trows: [row],\n\t\t\tisMouse,\n\t\t\tshiftPressed: false,\n\t\t};\n\t}\n\n\t/**\n\t * Handles the range selection\n\t * @param targetRow Row that is currently focused\n\t * @param change indicates direction\n\t * @private\n\t */\n\t_handleRangeSelection(targetRow: TableRow, change: number) {\n\t\tif (!this._rangeSelection) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isUp = change > 0;\n\t\tthis._rangeSelection.isUp ??= isUp;\n\n\t\tconst shouldReverseSelection = isUp !== this._rangeSelection.isUp && !this._rangeSelection.isMouse;\n\t\tlet selectionChanged = shouldReverseSelection && this.isSelected(targetRow);\n\n\t\tif (shouldReverseSelection) {\n\t\t\tthis._reverseRangeSelection();\n\t\t} else {\n\t\t\tconst rowIndex = this._table!.rows.indexOf(targetRow);\n\t\t\tconst [startIndex, endIndex] = [rowIndex, rowIndex - change].sort((a, b) => a - b);\n\t\t\tconst selectedSet = this.getSelectedAsSet();\n\n\t\t\tselectionChanged = this._table?.rows.slice(startIndex, endIndex + 1).reduce((changed, row) => {\n\t\t\t\tconst isRowNotInSelection = !this._rangeSelection?.rows.includes(row);\n\t\t\t\tconst isRowSelectionDifferent = this.isSelected(row) !== this._rangeSelection!.selected;\n\n\t\t\t\tif (isRowNotInSelection) {\n\t\t\t\t\tthis._rangeSelection?.rows.push(row);\n\t\t\t\t}\n\n\t\t\t\tselectedSet[this._rangeSelection!.selected ? \"add\" : \"delete\"](this.getRowKey(row));\n\n\t\t\t\treturn changed || isRowSelectionDifferent;\n\t\t\t}, selectionChanged) || false;\n\n\t\t\tthis.setSelectedAsSet(selectedSet);\n\t\t}\n\n\t\tselectionChanged && this.fireDecoratorEvent(\"change\");\n\t}\n\n\t_stopRangeSelection() {\n\t\tthis._rangeSelection = null;\n\t}\n\n\t_reverseRangeSelection() {\n\t\tconst row = this._rangeSelection?.rows.pop();\n\t\tif (row) {\n\t\t\tthis.setSelected(row, false);\n\t\t}\n\n\t\tif (this._rangeSelection?.rows.length === 1) {\n\t\t\tthis._rangeSelection.isUp = null;\n\t\t}\n\t}\n}\n\nTableSelectionMulti.define();\n\nexport default TableSelectionMulti;\n"]}
|
|
1
|
+
{"version":3,"file":"TableSelectionMulti.js","sourceRoot":"","sources":["../src/TableSelectionMulti.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EA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,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9B,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC,eAAe,CAAC,IAAI,GAAG,IAAI,CAAC;QAClC,CAAC;IACF,CAAC;CACD,CAAA;AAlTA;IADC,QAAQ,EAAE;qDACO;AAUlB;IADC,QAAQ,EAAE;2DAC0D;AAlBhE,mBAAmB;IAFxB,aAAa,CAAC,EAAE,GAAG,EAAE,2BAA2B,EAAE,CAAC;GAE9C,mBAAmB,CA0TxB;AAED,mBAAmB,CAAC,MAAM,EAAE,CAAC;AAE7B,eAAe,mBAAmB,CAAC","sourcesContent":["import { customElement, property } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport TableSelectionBase from \"./TableSelectionBase.js\";\nimport CheckBox from \"./CheckBox.js\";\nimport Icon from \"./Icon.js\";\nimport ClearAll from \"@ui5/webcomponents-icons/dist/clear-all.js\";\nimport getActiveElement from \"@ui5/webcomponents-base/dist/util/getActiveElement.js\";\nimport { isSelectionCell, isHeaderSelectionCell, findRowInPath } from \"./TableUtils.js\";\nimport { isUpShift } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport type Table from \"./Table.js\";\nimport type TableRow from \"./TableRow.js\";\nimport type TableRowBase from \"./TableRowBase.js\";\nimport type TableSelectionMultiHeaderSelector from \"./types/TableSelectionMultiHeaderSelector.js\";\nimport {\n\tTABLE_COLUMNHEADER_SELECTALL_DESCRIPTION,\n\tTABLE_COLUMNHEADER_CLEARALL_DESCRIPTION,\n\tCHECKBOX_CHECKED,\n\tCHECKBOX_NOT_CHECKED,\n\tACC_STATE_DISABLED,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-table-selection-multi` component is used inside the `ui5-table` to add multi-selection capabilities to the `ui5-table`.\n * Since selection is key-based, each `ui5-table-row` must define a unique `row-key` property.\n *\n * ### Usage\n *\n * The `ui5-table-selection-multi` component is a feature designed exclusively for use within the `ui5-table` component.\n * It must be placed inside the `features` slot of `ui5-table`.\n * This component is not intended for standalone use.\n *\n * ```html\n * <ui5-table>\n * \t<ui5-table-selection-multi slot=\"features\" selected=\"Row1 Row3\"></ui5-table-selection-multi>\n * </ui5-table>\n * ```\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/TableSelectionMulti.js\";`\n *\n * @constructor\n * @extends TableSelectionBase\n * @since 2.8.0\n * @public\n */\n@customElement({ tag: \"ui5-table-selection-multi\" })\n\nclass TableSelectionMulti extends TableSelectionBase {\n\t/**\n\t * Defines the `row-key` values of selected rows, with each value separated by a space.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tselected?: string;\n\n\t/**\n\t * Defines the selector of the header row.\n\t *\n\t * @default \"SelectAll\"\n\t * @public\n\t * @since 2.12\n\t */\n\t@property()\n\theaderSelector: `${TableSelectionMultiHeaderSelector}` = \"SelectAll\";\n\n\tprivate _rangeSelection?: {\n\t\tselected: boolean,\n\t\tisUp: boolean | null,\n\t\trows: TableRow[],\n\t\tisMouse: boolean,\n\t\tshiftPressed: boolean\n\t} | null;\n\n\t_onClickCaptureBound: (e: MouseEvent) => void;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._onClickCaptureBound = this._onclickCapture.bind(this);\n\t}\n\n\tonTableBeforeRendering() {\n\t\tsuper.onTableBeforeRendering();\n\t\tthis._table?.removeEventListener(\"click\", this._onClickCaptureBound);\n\t}\n\n\tonTableAfterRendering() {\n\t\tthis._table?.addEventListener(\"click\", this._onClickCaptureBound, { capture: true });\n\t}\n\n\tisMultiSelectable(): boolean {\n\t\treturn true;\n\t}\n\n\tgetSelectionComponent(): typeof CheckBox {\n\t\treturn CheckBox;\n\t}\n\n\tgetClearAllComponent(): typeof Icon {\n\t\treturn Icon;\n\t}\n\n\tgetClearAllIcon(): string {\n\t\treturn ClearAll;\n\t}\n\n\tisSelected(row: TableRowBase): boolean {\n\t\tif (row.isHeaderRow()) {\n\t\t\treturn this.headerSelector === \"ClearAll\" ? true : this.areAllRowsSelected();\n\t\t}\n\n\t\tconst rowKey = this.getRowKey(row as TableRow);\n\t\treturn this.getSelectedAsSet().has(rowKey);\n\t}\n\n\tsetSelected(row: TableRowBase, selected: boolean, fireEvent: boolean = false) {\n\t\tif (this._rangeSelection?.isMouse && this._rangeSelection.shiftPressed) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst tableRows = row.isHeaderRow() ? this._table!.rows : [row as TableRow];\n\t\tconst selectedSet = this.getSelectedAsSet();\n\t\tconst selectionChanged = tableRows.reduce((selectedSetChanged, tableRow) => {\n\t\t\tconst rowKey = this.getRowKey(tableRow);\n\t\t\tif (!rowKey) {\n\t\t\t\treturn selectedSetChanged;\n\t\t\t}\n\n\t\t\tconst setSize = selectedSet.size;\n\t\t\tselectedSet[selected ? \"add\" : \"delete\"](rowKey);\n\t\t\treturn selectedSetChanged || setSize !== selectedSet.size;\n\t\t}, false);\n\n\t\tif (selectionChanged) {\n\t\t\tthis.setSelectedAsSet(selectedSet);\n\t\t\tfireEvent && this.fireDecoratorEvent(\"change\");\n\t\t}\n\t}\n\n\t/**\n\t * Returns an array of the selected rows.\n\t *\n\t * @public\n\t */\n\tgetSelectedRows(): TableRow[] {\n\t\treturn this._table ? this._table.rows.filter(row => this.isSelected(row)) : [];\n\t}\n\n\t/**\n\t * Determines whether all rows are selected.\n\t */\n\tareAllRowsSelected(): boolean {\n\t\tif (!this._table || !this._table.rows.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst selectedSet = this.getSelectedAsSet();\n\t\treturn this._table.rows.filter(row => row._isSelectable).every(row => {\n\t\t\tconst rowKey = this.getRowKey(row);\n\t\t\treturn selectedSet.has(rowKey);\n\t\t});\n\t}\n\n\t/**\n\t * Returns the `selected` property as a set of unique `row-key` values.\n\t *\n\t * @public\n\t */\n\tgetSelectedAsSet(): Set<string> {\n\t\tconst selected = this.selected || \"\";\n\t\tconst selectedArray = selected.split(\" \").filter(String);\n\t\treturn new Set(selectedArray);\n\t}\n\n\t/**\n\t * Sets the `selected` property using the provided set of unique `row-key` values.\n\t *\n\t * @param selectedSet A set of `row-key` values\n\t * @public\n\t */\n\tsetSelectedAsSet(selectedSet: Set<string>): void {\n\t\tthis.selected = [...selectedSet].join(\" \");\n\t}\n\n\t/**\n\t * Returns the ARIA description of the selection component displayed in the column header.\n\t */\n\tgetAriaDescriptionForColumnHeader(): string | undefined {\n\t\tif (!this._table || !this._table.rows.length || this.behavior === \"RowOnly\") {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet description = \"\";\n\t\tconst seperator = \" \";\n\t\tconst i18nBundle = (this._table.constructor as typeof Table).i18nBundle;\n\t\tif (this.headerSelector === \"SelectAll\") {\n\t\t\tdescription = i18nBundle.getText(TABLE_COLUMNHEADER_SELECTALL_DESCRIPTION);\n\t\t\tdescription += seperator + i18nBundle.getText(this.areAllRowsSelected() ? CHECKBOX_CHECKED : CHECKBOX_NOT_CHECKED);\n\t\t} else {\n\t\t\tdescription = i18nBundle.getText(TABLE_COLUMNHEADER_CLEARALL_DESCRIPTION);\n\t\t\tdescription += this.getSelectedRows().length === 0 ? seperator + i18nBundle.getText(ACC_STATE_DISABLED) : \"\";\n\t\t}\n\t\treturn description;\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (!this._table || !e.shiftKey) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst focusedElement = getActiveElement(); // Assumption: The focused element is always the \"next\" row after navigation.\n\n\t\tif (!(focusedElement?.hasAttribute(\"ui5-table-row\") || this._rangeSelection?.isMouse)) {\n\t\t\tthis._stopRangeSelection();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._rangeSelection) {\n\t\t\t// If no range selection is active, start one\n\t\t\tconst row = focusedElement as TableRow;\n\t\t\tthis._startRangeSelection(row, this.isSelected(row));\n\t\t} else if (e.key === \"ArrowUp\" || e.key === \"ArrowDown\") {\n\t\t\tconst change = isUpShift(e) ? -1 : 1;\n\t\t\tthis._handleRangeSelection(focusedElement as TableRow, change);\n\t\t}\n\n\t\tif (this._rangeSelection) {\n\t\t\tthis._rangeSelection.shiftPressed = e.shiftKey;\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent, eventOrigin: HTMLElement) {\n\t\tif (!this._table) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!eventOrigin.hasAttribute(\"ui5-table-row\") || !this._rangeSelection || !e.shiftKey) {\n\t\t\t// Stop range selection if a) Shift is relased or b) the event target is not a row\n\t\t\tthis._stopRangeSelection();\n\t\t}\n\n\t\tif (this._rangeSelection) {\n\t\t\tthis._rangeSelection.shiftPressed = e.shiftKey;\n\t\t}\n\t}\n\n\t_onclickCapture(e: MouseEvent) {\n\t\tif (!this._table) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isHeaderSelectionCell(e)) {\n\t\t\tthis._stopRangeSelection();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isSelectionCell(e)) {\n\t\t\tthis._stopRangeSelection();\n\t\t\treturn;\n\t\t}\n\n\t\tconst row = findRowInPath(e.composedPath());\n\n\t\tif (e.shiftKey && this._rangeSelection?.isMouse) {\n\t\t\tconst startRow = this._rangeSelection.rows[0];\n\t\t\tconst startIndex = this._table.rows.indexOf(startRow);\n\t\t\tconst endIndex = this._table.rows.indexOf(row);\n\n\t\t\t// Set checkbox to the selection state of the start row (if it is selected)\n\t\t\tconst selectionState = this.isSelected(startRow);\n\n\t\t\t// When doing a range selection and clicking on an already selected row, the checked status should not change\n\t\t\t// Therefore, we need to manually set the checked attribute again, as clicking it would deselect it and leads to\n\t\t\t// a visual inconsistency.\n\t\t\trow.shadowRoot?.querySelector(\"#selection-component\")?.toggleAttribute(\"checked\", selectionState);\n\t\t\te.stopPropagation();\n\n\t\t\tif (startIndex === -1 || endIndex === -1 || row.rowKey === startRow.rowKey || row.rowKey === this._rangeSelection.rows[this._rangeSelection.rows.length - 1].rowKey) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst change = endIndex - startIndex;\n\t\t\tthis._handleRangeSelection(row, change);\n\t\t} else if (row) {\n\t\t\tthis._startRangeSelection(row, !this.isSelected(row), true);\n\t\t}\n\t}\n\n\t/**\n\t * Start the range selection and initialises the range selection state\n\t * @param row starting row\n\t * @private\n\t */\n\t_startRangeSelection(row: TableRow, selected: boolean, isMouse = false) {\n\t\tthis._rangeSelection = {\n\t\t\tselected,\n\t\t\tisUp: null,\n\t\t\trows: [row],\n\t\t\tisMouse,\n\t\t\tshiftPressed: false,\n\t\t};\n\t}\n\n\t/**\n\t * Handles the range selection\n\t * @param targetRow Row that is currently focused\n\t * @param change indicates direction\n\t * @private\n\t */\n\t_handleRangeSelection(targetRow: TableRow, change: number) {\n\t\tif (!this._rangeSelection) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isUp = change > 0;\n\t\tthis._rangeSelection.isUp ??= isUp;\n\n\t\tconst shouldReverseSelection = isUp !== this._rangeSelection.isUp && !this._rangeSelection.isMouse;\n\t\tlet selectionChanged = shouldReverseSelection && this.isSelected(targetRow);\n\n\t\tif (shouldReverseSelection) {\n\t\t\tthis._reverseRangeSelection();\n\t\t} else {\n\t\t\tconst rowIndex = this._table!.rows.indexOf(targetRow);\n\t\t\tconst [startIndex, endIndex] = [rowIndex, rowIndex - change].sort((a, b) => a - b);\n\t\t\tconst selectedSet = this.getSelectedAsSet();\n\n\t\t\tselectionChanged = this._table?.rows.slice(startIndex, endIndex + 1).reduce((changed, row) => {\n\t\t\t\tconst isRowNotInSelection = !this._rangeSelection?.rows.includes(row);\n\t\t\t\tconst isRowSelectionDifferent = this.isSelected(row) !== this._rangeSelection!.selected;\n\n\t\t\t\tif (isRowNotInSelection) {\n\t\t\t\t\tthis._rangeSelection?.rows.push(row);\n\t\t\t\t}\n\n\t\t\t\tselectedSet[this._rangeSelection!.selected ? \"add\" : \"delete\"](this.getRowKey(row));\n\n\t\t\t\treturn changed || isRowSelectionDifferent;\n\t\t\t}, selectionChanged) || false;\n\n\t\t\tthis.setSelectedAsSet(selectedSet);\n\t\t}\n\n\t\tselectionChanged && this.fireDecoratorEvent(\"change\");\n\t}\n\n\t_stopRangeSelection() {\n\t\tthis._rangeSelection = null;\n\t}\n\n\t_reverseRangeSelection() {\n\t\tconst row = this._rangeSelection?.rows.pop();\n\t\tif (row) {\n\t\t\tthis.setSelected(row, false);\n\t\t}\n\n\t\tif (this._rangeSelection?.rows.length === 1) {\n\t\t\tthis._rangeSelection.isUp = null;\n\t\t}\n\t}\n}\n\nTableSelectionMulti.define();\n\nexport default TableSelectionMulti;\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import TableSelectionBase from "./TableSelectionBase.js";
|
|
2
|
+
import RadioButton from "./RadioButton.js";
|
|
2
3
|
import type TableRow from "./TableRow.js";
|
|
3
4
|
/**
|
|
4
5
|
* @class
|
|
@@ -38,6 +39,7 @@ declare class TableSelectionSingle extends TableSelectionBase {
|
|
|
38
39
|
*/
|
|
39
40
|
selected?: string;
|
|
40
41
|
isSelected(row: TableRow): boolean;
|
|
42
|
+
getSelectionComponent(): typeof RadioButton;
|
|
41
43
|
setSelected(row: TableRow, selected: boolean, fireEvent?: boolean): void;
|
|
42
44
|
/**
|
|
43
45
|
* Returns the selected row.
|
|
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { customElement, property } from "@ui5/webcomponents-base/dist/decorators.js";
|
|
8
8
|
import TableSelectionBase from "./TableSelectionBase.js";
|
|
9
|
+
import RadioButton from "./RadioButton.js";
|
|
9
10
|
/**
|
|
10
11
|
* @class
|
|
11
12
|
*
|
|
@@ -40,6 +41,9 @@ let TableSelectionSingle = class TableSelectionSingle extends TableSelectionBase
|
|
|
40
41
|
const rowKey = this.getRowKey(row);
|
|
41
42
|
return rowKey ? this.selected === rowKey : false;
|
|
42
43
|
}
|
|
44
|
+
getSelectionComponent() {
|
|
45
|
+
return RadioButton;
|
|
46
|
+
}
|
|
43
47
|
setSelected(row, selected, fireEvent = false) {
|
|
44
48
|
const rowKey = this.getRowKey(row);
|
|
45
49
|
if (rowKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableSelectionSingle.js","sourceRoot":"","sources":["../src/TableSelectionSingle.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"TableSelectionSingle.js","sourceRoot":"","sources":["../src/TableSelectionSingle.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAG3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,kBAAkB;IAUpD,UAAU,CAAC,GAAa;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;IAClD,CAAC;IAED,qBAAqB;QACpB,OAAO,WAAW,CAAC;IACpB,CAAC;IAED,WAAW,CAAC,GAAa,EAAE,QAAiB,EAAE,YAAqB,KAAK;QACvE,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,MAAM,EAAE,CAAC;YACZ,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAC9C,SAAS,IAAI,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAChD,CAAC;IACF,CAAC;IAED;;;;OAIG;IACH,cAAc;QACb,OAAO,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5D,CAAC;CACD,CAAA;AA3BA;IADC,QAAQ,EAAE;sDACO;AARb,oBAAoB;IAFzB,aAAa,CAAC,EAAE,GAAG,EAAE,4BAA4B,EAAE,CAAC;GAE/C,oBAAoB,CAmCzB;AAED,oBAAoB,CAAC,MAAM,EAAE,CAAC;AAE9B,eAAe,oBAAoB,CAAC","sourcesContent":["import { customElement, property } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport TableSelectionBase from \"./TableSelectionBase.js\";\nimport RadioButton from \"./RadioButton.js\";\nimport type TableRow from \"./TableRow.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-table-selection-single` component is used inside the `ui5-table` to add single selection capabilities to the `ui5-table`.\n * Since selection is key-based, each `ui5-table-row` must define a unique `row-key` property.\n *\n * ### Usage\n *\n * The `ui5-table-selection-single` component is a feature designed exclusively for use within the `ui5-table` component.\n * It must be placed inside the `features` slot of `ui5-table`.\n * This component is not intended for standalone use.\n *\n * ```html\n * <ui5-table>\n * \t<ui5-table-selection-single slot=\"features\" selected=\"Row1\"></ui5-table-selection-single>\n * </ui5-table>\n * ```\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/TableSelectionSingle.js\";`\n *\n * @constructor\n * @extends TableSelectionBase\n * @since 2.8.0\n * @public\n */\n@customElement({ tag: \"ui5-table-selection-single\" })\n\nclass TableSelectionSingle extends TableSelectionBase {\n\t/**\n\t * Defines the `row-key` value of the selected row.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tselected?: string;\n\n\tisSelected(row: TableRow): boolean {\n\t\tconst rowKey = this.getRowKey(row);\n\t\treturn rowKey ? this.selected === rowKey : false;\n\t}\n\n\tgetSelectionComponent(): typeof RadioButton {\n\t\treturn RadioButton;\n\t}\n\n\tsetSelected(row: TableRow, selected: boolean, fireEvent: boolean = false) {\n\t\tconst rowKey = this.getRowKey(row);\n\t\tif (rowKey) {\n\t\t\tthis.selected = selected ? rowKey : undefined;\n\t\t\tfireEvent && this.fireDecoratorEvent(\"change\");\n\t\t}\n\t}\n\n\t/**\n\t * Returns the selected row.\n\t *\n\t * @public\n\t */\n\tgetSelectedRow(): TableRow | undefined {\n\t\treturn this._table?.rows.find(row => this.isSelected(row));\n\t}\n}\n\nTableSelectionSingle.define();\n\nexport default TableSelectionSingle;\n"]}
|
package/dist/TimePicker.d.ts
CHANGED
|
@@ -264,6 +264,14 @@ declare class TimePicker extends UI5Element implements IFormInputElement {
|
|
|
264
264
|
onTimeSelectionChange(e: CustomEvent<TimeSelectionChangeEventDetail>): void;
|
|
265
265
|
get openIconTitle(): string;
|
|
266
266
|
_togglePicker(): void;
|
|
267
|
+
/**
|
|
268
|
+
* Prevents the inner input from taking focus when the value-help icon is pressed,
|
|
269
|
+
* so the subsequent click opens the picker on the first tap (same as MultiInput value-help).
|
|
270
|
+
* @private
|
|
271
|
+
*/
|
|
272
|
+
_onValueHelpIconMouseDown(e: MouseEvent): void;
|
|
273
|
+
_isIconClick(e: Event): boolean;
|
|
274
|
+
_isInputFieldClick(e: Event): boolean;
|
|
267
275
|
submitPickers(): void;
|
|
268
276
|
onResponsivePopoverAfterClose(): void;
|
|
269
277
|
onResponsivePopoverBeforeOpen(): void;
|
|
@@ -290,6 +298,7 @@ declare class TimePicker extends UI5Element implements IFormInputElement {
|
|
|
290
298
|
onInputsPopoverAfterOpen(): void;
|
|
291
299
|
onInputsPopoverAfterClose(): void;
|
|
292
300
|
_handleInputClick(e: MouseEvent): void;
|
|
301
|
+
_isInputFieldFocus(e: FocusEvent): boolean;
|
|
293
302
|
_updateValueAndFireEvents(value: string, normalizeValue: boolean, eventsNames: Array<"input" | "change" | "value-changed">): void;
|
|
294
303
|
_updateValueState(): void;
|
|
295
304
|
_handleInputChange(e: CustomEvent): void;
|
|
@@ -370,6 +379,7 @@ declare class TimePicker extends UI5Element implements IFormInputElement {
|
|
|
370
379
|
get shouldDisplayValueStateMessageOnDesktop(): boolean;
|
|
371
380
|
get _headerTitleText(): string;
|
|
372
381
|
get showHeader(): boolean;
|
|
382
|
+
get _preventPickerInitialFocus(): boolean;
|
|
373
383
|
/**
|
|
374
384
|
* Defines whether the dialog on mobile should have header
|
|
375
385
|
* @private
|
package/dist/TimePicker.js
CHANGED
|
@@ -275,12 +275,39 @@ let TimePicker = TimePicker_1 = class TimePicker extends UI5Element {
|
|
|
275
275
|
this._inputsPopover.open = false;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* Prevents the inner input from taking focus when the value-help icon is pressed,
|
|
280
|
+
* so the subsequent click opens the picker on the first tap (same as MultiInput value-help).
|
|
281
|
+
* @private
|
|
282
|
+
*/
|
|
283
|
+
_onValueHelpIconMouseDown(e) {
|
|
284
|
+
if (!this._canOpenPicker()) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
e.preventDefault();
|
|
288
|
+
}
|
|
289
|
+
_isIconClick(e) {
|
|
290
|
+
return e.composedPath().some(el => el instanceof HTMLElement && el.hasAttribute("ui5-icon"));
|
|
291
|
+
}
|
|
292
|
+
_isInputFieldClick(e) {
|
|
293
|
+
const inputField = this._getInputField();
|
|
294
|
+
if (!inputField) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
return e.composedPath().includes(inputField);
|
|
298
|
+
}
|
|
278
299
|
submitPickers() {
|
|
279
300
|
this._updateValueAndFireEvents(this.tempValue, true, ["change", "value-changed"]);
|
|
280
301
|
this._togglePicker();
|
|
281
302
|
}
|
|
282
303
|
onResponsivePopoverAfterClose() {
|
|
283
304
|
this.open = false;
|
|
305
|
+
if (isPhone()) {
|
|
306
|
+
this.blur(); // close device's keyboard and prevent further typing
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
this._dateTimeInput?.focus();
|
|
310
|
+
}
|
|
284
311
|
this.fireDecoratorEvent("close");
|
|
285
312
|
}
|
|
286
313
|
onResponsivePopoverBeforeOpen() {
|
|
@@ -341,18 +368,20 @@ let TimePicker = TimePicker_1 = class TimePicker extends UI5Element {
|
|
|
341
368
|
this._isInputsPopoverOpen = false;
|
|
342
369
|
}
|
|
343
370
|
_handleInputClick(e) {
|
|
344
|
-
|
|
345
|
-
if (this.open) {
|
|
371
|
+
if (this._isMobileDevice) {
|
|
346
372
|
return;
|
|
347
373
|
}
|
|
348
|
-
if (this.
|
|
349
|
-
|
|
374
|
+
if (this._isIconClick(e) || this.open) {
|
|
375
|
+
return;
|
|
350
376
|
}
|
|
351
377
|
const inputField = this._getInputField();
|
|
352
|
-
if (inputField) {
|
|
378
|
+
if (inputField && this._isInputFieldClick(e)) {
|
|
353
379
|
inputField.select();
|
|
354
380
|
}
|
|
355
381
|
}
|
|
382
|
+
_isInputFieldFocus(e) {
|
|
383
|
+
return this._isInputFieldClick(e);
|
|
384
|
+
}
|
|
356
385
|
_updateValueAndFireEvents(value, normalizeValue, eventsNames) {
|
|
357
386
|
const isInputEvent = eventsNames.includes("input");
|
|
358
387
|
const valid = this.isValidValue(value);
|
|
@@ -640,12 +669,20 @@ let TimePicker = TimePicker_1 = class TimePicker extends UI5Element {
|
|
|
640
669
|
setTimeout(() => { this._dateTimeInput.readonly = false; }, 0);
|
|
641
670
|
}
|
|
642
671
|
_onfocusin(e) {
|
|
643
|
-
if (this._isMobileDevice) {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
672
|
+
if (!this._isMobileDevice) {
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
if (this._isIconClick(e)) {
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
this._hideMobileKeyboard();
|
|
679
|
+
if (this._isInputsPopoverOpen) {
|
|
680
|
+
this._inputsPopover.applyFocus();
|
|
681
|
+
e.preventDefault();
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
if (this._isInputFieldFocus(e)) {
|
|
685
|
+
this.toggleInputsPopover();
|
|
649
686
|
e.preventDefault();
|
|
650
687
|
}
|
|
651
688
|
}
|
|
@@ -687,6 +724,9 @@ let TimePicker = TimePicker_1 = class TimePicker extends UI5Element {
|
|
|
687
724
|
get showHeader() {
|
|
688
725
|
return isPhone();
|
|
689
726
|
}
|
|
727
|
+
get _preventPickerInitialFocus() {
|
|
728
|
+
return isPhone();
|
|
729
|
+
}
|
|
690
730
|
/**
|
|
691
731
|
* Defines whether the dialog on mobile should have header
|
|
692
732
|
* @private
|