@ui5/webcomponents-fiori 2.16.0-rc.2 → 2.16.0-rc.3
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 +12 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/FlexibleColumnLayout.d.ts +93 -21
- package/dist/FlexibleColumnLayout.js +207 -17
- package/dist/FlexibleColumnLayout.js.map +1 -1
- package/dist/SearchItem.d.ts +17 -0
- package/dist/SearchItem.js +62 -1
- package/dist/SearchItem.js.map +1 -1
- package/dist/SearchItemTemplate.js +3 -2
- package/dist/SearchItemTemplate.js.map +1 -1
- package/dist/UserSettingsDialog.js +2 -0
- package/dist/UserSettingsDialog.js.map +1 -1
- package/dist/UserSettingsDialogTemplate.js +1 -1
- package/dist/UserSettingsDialogTemplate.js.map +1 -1
- package/dist/UserSettingsItem.d.ts +4 -0
- package/dist/UserSettingsItem.js +7 -0
- package/dist/UserSettingsItem.js.map +1 -1
- package/dist/css/themes/DynamicPage.css +1 -1
- package/dist/css/themes/DynamicPageHeader.css +1 -1
- package/dist/css/themes/DynamicPageHeaderActions.css +1 -1
- package/dist/css/themes/DynamicPageTitle.css +1 -1
- package/dist/css/themes/FlexibleColumnLayout.css +1 -1
- package/dist/css/themes/MediaGallery.css +1 -1
- package/dist/css/themes/MediaGalleryItem.css +1 -1
- package/dist/css/themes/NavigationMenu.css +1 -1
- package/dist/css/themes/NavigationMenuItem.css +1 -1
- package/dist/css/themes/NotificationListGroupItem.css +1 -1
- package/dist/css/themes/NotificationListItem.css +1 -1
- package/dist/css/themes/NotificationListItemBase.css +1 -1
- package/dist/css/themes/NotificationStateIcon.css +1 -1
- package/dist/css/themes/Page.css +1 -1
- package/dist/css/themes/ProductSwitchItem.css +1 -1
- package/dist/css/themes/Search.css +1 -1
- package/dist/css/themes/SearchField.css +1 -1
- package/dist/css/themes/SearchItem.css +1 -1
- package/dist/css/themes/ShellBar.css +1 -1
- package/dist/css/themes/ShellBarBranding.css +1 -1
- package/dist/css/themes/ShellBarPopover.css +1 -1
- package/dist/css/themes/SideNavigation.css +1 -1
- package/dist/css/themes/SideNavigationGroup.css +1 -1
- package/dist/css/themes/SideNavigationItem.css +1 -1
- package/dist/css/themes/SideNavigationItemBase.css +1 -1
- package/dist/css/themes/SideNavigationSubItem.css +1 -1
- package/dist/css/themes/Timeline.css +1 -1
- package/dist/css/themes/TimelineGroupItem.css +1 -1
- package/dist/css/themes/TimelineItem.css +1 -1
- package/dist/css/themes/UploadCollection.css +1 -1
- package/dist/css/themes/UploadCollectionItem.css +1 -1
- package/dist/css/themes/UserMenu.css +1 -1
- package/dist/css/themes/UserSettingsDialog.css +1 -1
- package/dist/css/themes/UserSettingsItem.css +1 -1
- package/dist/css/themes/ViewSettingsDialog.css +1 -1
- package/dist/css/themes/Wizard.css +1 -1
- package/dist/css/themes/WizardTab.css +1 -1
- package/dist/css/themes/sap_fiori_3/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcw/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_dark_exp/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_exp/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcb_exp/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcw_exp/parameters-bundle.css +1 -1
- package/dist/custom-elements-internal.json +95 -0
- package/dist/custom-elements.json +44 -0
- package/dist/fcl-utils/FCLLayout.d.ts +4 -4
- package/dist/fcl-utils/FCLLayout.js +2 -2
- package/dist/fcl-utils/FCLLayout.js.map +1 -1
- package/dist/generated/assets/themes/sap_fiori_3/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_dark_exp/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_exp/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcb_exp/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcw_exp/parameters-bundle.css.json +1 -1
- package/dist/generated/themes/DynamicPage.css.d.ts +1 -1
- package/dist/generated/themes/DynamicPage.css.js +1 -1
- package/dist/generated/themes/DynamicPage.css.js.map +1 -1
- package/dist/generated/themes/DynamicPageHeader.css.d.ts +1 -1
- package/dist/generated/themes/DynamicPageHeader.css.js +1 -1
- package/dist/generated/themes/DynamicPageHeader.css.js.map +1 -1
- package/dist/generated/themes/DynamicPageHeaderActions.css.d.ts +1 -1
- package/dist/generated/themes/DynamicPageHeaderActions.css.js +1 -1
- package/dist/generated/themes/DynamicPageHeaderActions.css.js.map +1 -1
- package/dist/generated/themes/DynamicPageTitle.css.d.ts +1 -1
- package/dist/generated/themes/DynamicPageTitle.css.js +1 -1
- package/dist/generated/themes/DynamicPageTitle.css.js.map +1 -1
- package/dist/generated/themes/FlexibleColumnLayout.css.d.ts +1 -1
- package/dist/generated/themes/FlexibleColumnLayout.css.js +1 -1
- package/dist/generated/themes/FlexibleColumnLayout.css.js.map +1 -1
- package/dist/generated/themes/MediaGallery.css.d.ts +1 -1
- package/dist/generated/themes/MediaGallery.css.js +1 -1
- package/dist/generated/themes/MediaGallery.css.js.map +1 -1
- package/dist/generated/themes/MediaGalleryItem.css.d.ts +1 -1
- package/dist/generated/themes/MediaGalleryItem.css.js +1 -1
- package/dist/generated/themes/MediaGalleryItem.css.js.map +1 -1
- package/dist/generated/themes/NavigationMenu.css.d.ts +1 -1
- package/dist/generated/themes/NavigationMenu.css.js +1 -1
- package/dist/generated/themes/NavigationMenu.css.js.map +1 -1
- package/dist/generated/themes/NavigationMenuItem.css.d.ts +1 -1
- package/dist/generated/themes/NavigationMenuItem.css.js +1 -1
- package/dist/generated/themes/NavigationMenuItem.css.js.map +1 -1
- package/dist/generated/themes/NotificationListGroupItem.css.d.ts +1 -1
- package/dist/generated/themes/NotificationListGroupItem.css.js +1 -1
- package/dist/generated/themes/NotificationListGroupItem.css.js.map +1 -1
- package/dist/generated/themes/NotificationListItem.css.d.ts +1 -1
- package/dist/generated/themes/NotificationListItem.css.js +1 -1
- package/dist/generated/themes/NotificationListItem.css.js.map +1 -1
- package/dist/generated/themes/NotificationListItemBase.css.d.ts +1 -1
- package/dist/generated/themes/NotificationListItemBase.css.js +1 -1
- package/dist/generated/themes/NotificationListItemBase.css.js.map +1 -1
- package/dist/generated/themes/NotificationStateIcon.css.d.ts +1 -1
- package/dist/generated/themes/NotificationStateIcon.css.js +1 -1
- package/dist/generated/themes/NotificationStateIcon.css.js.map +1 -1
- package/dist/generated/themes/Page.css.d.ts +1 -1
- package/dist/generated/themes/Page.css.js +1 -1
- package/dist/generated/themes/Page.css.js.map +1 -1
- package/dist/generated/themes/ProductSwitchItem.css.d.ts +1 -1
- package/dist/generated/themes/ProductSwitchItem.css.js +1 -1
- package/dist/generated/themes/ProductSwitchItem.css.js.map +1 -1
- package/dist/generated/themes/Search.css.d.ts +1 -1
- package/dist/generated/themes/Search.css.js +1 -1
- package/dist/generated/themes/Search.css.js.map +1 -1
- package/dist/generated/themes/SearchField.css.d.ts +1 -1
- package/dist/generated/themes/SearchField.css.js +1 -1
- package/dist/generated/themes/SearchField.css.js.map +1 -1
- package/dist/generated/themes/SearchItem.css.d.ts +1 -1
- package/dist/generated/themes/SearchItem.css.js +1 -1
- package/dist/generated/themes/SearchItem.css.js.map +1 -1
- package/dist/generated/themes/ShellBar.css.d.ts +1 -1
- package/dist/generated/themes/ShellBar.css.js +1 -1
- package/dist/generated/themes/ShellBar.css.js.map +1 -1
- package/dist/generated/themes/ShellBarBranding.css.d.ts +1 -1
- package/dist/generated/themes/ShellBarBranding.css.js +1 -1
- package/dist/generated/themes/ShellBarBranding.css.js.map +1 -1
- package/dist/generated/themes/ShellBarPopover.css.d.ts +1 -1
- package/dist/generated/themes/ShellBarPopover.css.js +1 -1
- package/dist/generated/themes/ShellBarPopover.css.js.map +1 -1
- package/dist/generated/themes/SideNavigation.css.d.ts +1 -1
- package/dist/generated/themes/SideNavigation.css.js +1 -1
- package/dist/generated/themes/SideNavigation.css.js.map +1 -1
- package/dist/generated/themes/SideNavigationGroup.css.d.ts +1 -1
- package/dist/generated/themes/SideNavigationGroup.css.js +1 -1
- package/dist/generated/themes/SideNavigationGroup.css.js.map +1 -1
- package/dist/generated/themes/SideNavigationItem.css.d.ts +1 -1
- package/dist/generated/themes/SideNavigationItem.css.js +1 -1
- package/dist/generated/themes/SideNavigationItem.css.js.map +1 -1
- package/dist/generated/themes/SideNavigationItemBase.css.d.ts +1 -1
- package/dist/generated/themes/SideNavigationItemBase.css.js +1 -1
- package/dist/generated/themes/SideNavigationItemBase.css.js.map +1 -1
- package/dist/generated/themes/SideNavigationSubItem.css.d.ts +1 -1
- package/dist/generated/themes/SideNavigationSubItem.css.js +1 -1
- package/dist/generated/themes/SideNavigationSubItem.css.js.map +1 -1
- package/dist/generated/themes/Timeline.css.d.ts +1 -1
- package/dist/generated/themes/Timeline.css.js +1 -1
- package/dist/generated/themes/Timeline.css.js.map +1 -1
- package/dist/generated/themes/TimelineGroupItem.css.d.ts +1 -1
- package/dist/generated/themes/TimelineGroupItem.css.js +1 -1
- package/dist/generated/themes/TimelineGroupItem.css.js.map +1 -1
- package/dist/generated/themes/TimelineItem.css.d.ts +1 -1
- package/dist/generated/themes/TimelineItem.css.js +1 -1
- package/dist/generated/themes/TimelineItem.css.js.map +1 -1
- package/dist/generated/themes/UploadCollection.css.d.ts +1 -1
- package/dist/generated/themes/UploadCollection.css.js +1 -1
- package/dist/generated/themes/UploadCollection.css.js.map +1 -1
- package/dist/generated/themes/UploadCollectionItem.css.d.ts +1 -1
- package/dist/generated/themes/UploadCollectionItem.css.js +1 -1
- package/dist/generated/themes/UploadCollectionItem.css.js.map +1 -1
- package/dist/generated/themes/UserMenu.css.d.ts +1 -1
- package/dist/generated/themes/UserMenu.css.js +1 -1
- package/dist/generated/themes/UserMenu.css.js.map +1 -1
- package/dist/generated/themes/UserSettingsDialog.css.d.ts +1 -1
- package/dist/generated/themes/UserSettingsDialog.css.js +1 -1
- package/dist/generated/themes/UserSettingsDialog.css.js.map +1 -1
- package/dist/generated/themes/UserSettingsItem.css.d.ts +1 -1
- package/dist/generated/themes/UserSettingsItem.css.js +1 -1
- package/dist/generated/themes/UserSettingsItem.css.js.map +1 -1
- package/dist/generated/themes/ViewSettingsDialog.css.d.ts +1 -1
- package/dist/generated/themes/ViewSettingsDialog.css.js +1 -1
- package/dist/generated/themes/ViewSettingsDialog.css.js.map +1 -1
- package/dist/generated/themes/Wizard.css.d.ts +1 -1
- package/dist/generated/themes/Wizard.css.js +1 -1
- package/dist/generated/themes/Wizard.css.js.map +1 -1
- package/dist/generated/themes/WizardTab.css.d.ts +1 -1
- package/dist/generated/themes/WizardTab.css.js +1 -1
- package/dist/generated/themes/WizardTab.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_dark_exp/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_dark_exp/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_dark_exp/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_exp/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_exp/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_exp/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcb_exp/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_hcb_exp/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcb_exp/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcw_exp/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_hcw_exp/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcw_exp/parameters-bundle.css.js.map +1 -1
- package/dist/vscode.html-custom-data.json +7 -2
- package/dist/web-types.json +25 -3
- package/package.json +7 -7
- package/src/SearchItemTemplate.tsx +16 -8
- package/src/UserSettingsDialogTemplate.tsx +13 -1
- package/src/themes/SearchItem.css +21 -1
- package/src/themes/UserSettingsDialog.css +4 -0
|
@@ -3,7 +3,6 @@ import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
|
3
3
|
import "@ui5/webcomponents-icons/dist/vertical-grip.js";
|
|
4
4
|
import type { PassiveEventListenerObject, AriaLandmarkRole } from "@ui5/webcomponents-base";
|
|
5
5
|
import FCLLayout from "./types/FCLLayout.js";
|
|
6
|
-
import type { LayoutConfiguration } from "./fcl-utils/FCLLayout.js";
|
|
7
6
|
declare enum MEDIA {
|
|
8
7
|
PHONE = "phone",
|
|
9
8
|
TABLET = "tablet",
|
|
@@ -19,7 +18,19 @@ type SeparatorMovementSession = {
|
|
|
19
18
|
cursorPositionX: number;
|
|
20
19
|
tmpFCLLayout: FCLLayout;
|
|
21
20
|
};
|
|
22
|
-
type FlexibleColumnLayoutColumnLayout = Array<string |
|
|
21
|
+
type FlexibleColumnLayoutColumnLayout = Array<string | 0>;
|
|
22
|
+
type LayoutConfiguration = {
|
|
23
|
+
"tablet"?: {
|
|
24
|
+
[layoutName in FCLLayout]?: {
|
|
25
|
+
layout: FlexibleColumnLayoutColumnLayout;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
"desktop"?: {
|
|
29
|
+
[layoutName in FCLLayout]?: {
|
|
30
|
+
layout: FlexibleColumnLayoutColumnLayout;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
23
34
|
type FlexibleColumnLayoutLayoutChangeEventDetail = {
|
|
24
35
|
layout: `${FCLLayout}`;
|
|
25
36
|
columnLayout: FlexibleColumnLayoutColumnLayout;
|
|
@@ -29,6 +40,11 @@ type FlexibleColumnLayoutLayoutChangeEventDetail = {
|
|
|
29
40
|
separatorsUsed: boolean;
|
|
30
41
|
resized: boolean;
|
|
31
42
|
};
|
|
43
|
+
type FlexibleColumnLayoutLayoutConfigurationChangeEventDetail = {
|
|
44
|
+
layout: `${FCLLayout}`;
|
|
45
|
+
media: `${MEDIA}`;
|
|
46
|
+
columnLayout: FlexibleColumnLayoutColumnLayout;
|
|
47
|
+
};
|
|
32
48
|
type FCLAccessibilityRoles = Extract<AriaLandmarkRole, "none" | "complementary" | "contentinfo" | "main" | "region">;
|
|
33
49
|
type FCLAccessibilityAttributes = {
|
|
34
50
|
startColumn?: {
|
|
@@ -52,14 +68,6 @@ type FCLAccessibilityAttributes = {
|
|
|
52
68
|
name: string;
|
|
53
69
|
};
|
|
54
70
|
};
|
|
55
|
-
type UserDefinedColumnLayouts = {
|
|
56
|
-
"tablet": {
|
|
57
|
-
[layoutName in FCLLayout]?: FlexibleColumnLayoutColumnLayout;
|
|
58
|
-
};
|
|
59
|
-
"desktop": {
|
|
60
|
-
[layoutName in FCLLayout]?: FlexibleColumnLayoutColumnLayout;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
71
|
/**
|
|
64
72
|
* @class
|
|
65
73
|
*
|
|
@@ -112,6 +120,7 @@ type UserDefinedColumnLayouts = {
|
|
|
112
120
|
declare class FlexibleColumnLayout extends UI5Element {
|
|
113
121
|
eventDetails: {
|
|
114
122
|
"layout-change": FlexibleColumnLayoutLayoutChangeEventDetail;
|
|
123
|
+
"layout-configuration-change": FlexibleColumnLayoutLayoutConfigurationChangeEventDetail;
|
|
115
124
|
};
|
|
116
125
|
/**
|
|
117
126
|
* Defines the columns layout and their proportion.
|
|
@@ -158,6 +167,24 @@ declare class FlexibleColumnLayout extends UI5Element {
|
|
|
158
167
|
*/
|
|
159
168
|
accessibilityAttributes: FCLAccessibilityAttributes;
|
|
160
169
|
/**
|
|
170
|
+
* Allows to customize the column proportions per screen size and layout.
|
|
171
|
+
* If no custom proportion provided for a specific layout, the default will be used.
|
|
172
|
+
*
|
|
173
|
+
* **Notes:**
|
|
174
|
+
*
|
|
175
|
+
* - The proportions should be given in percentages. For example ["30%", "40%", "30%"], ["70%", "30%", 0], etc.
|
|
176
|
+
* - The proportions should add up to 100%.
|
|
177
|
+
* - Hidden columns are marked as "0px", e.g. ["0px", "70%", "30%"]. Specifying 0 or "0%" for hidden columns is also valid.
|
|
178
|
+
* - If the proportions do not match the layout (e.g. if provided proportions ["70%", "30%", "0px"] for "OneColumn" layout), then the default proportions will be used instead.
|
|
179
|
+
* - Whenever the user drags the columns separator to resize the columns, the `layoutsConfiguration` object will be updated with the user-specified proportions for the given layout (and the `layout-configuration-change` event will be fired).
|
|
180
|
+
* - No custom configuration available for the phone screen size, as the default of 100% column width is always used there.
|
|
181
|
+
* @default {}
|
|
182
|
+
* @public
|
|
183
|
+
* @since 2.16.0
|
|
184
|
+
* @experimental
|
|
185
|
+
*/
|
|
186
|
+
layoutsConfiguration: LayoutConfiguration;
|
|
187
|
+
/**
|
|
161
188
|
* Defines the component width in px.
|
|
162
189
|
* @default 0
|
|
163
190
|
* @private
|
|
@@ -184,10 +211,19 @@ declare class FlexibleColumnLayout extends UI5Element {
|
|
|
184
211
|
*/
|
|
185
212
|
_resizing: boolean;
|
|
186
213
|
/**
|
|
187
|
-
|
|
188
|
-
|
|
214
|
+
* This property is no longer used and is replaced by `layoutsConfiguration`.
|
|
215
|
+
* The property will be removed once all adopters migrate to `layoutsConfiguration`.
|
|
189
216
|
*/
|
|
190
|
-
_layoutsConfiguration?:
|
|
217
|
+
_layoutsConfiguration?: {
|
|
218
|
+
[device in MEDIA]: {
|
|
219
|
+
[layoutName in FCLLayout]: {
|
|
220
|
+
layout: Array<string>;
|
|
221
|
+
separators: Array<{
|
|
222
|
+
visible: boolean;
|
|
223
|
+
}>;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
};
|
|
191
227
|
/**
|
|
192
228
|
* Defines the content in the start column.
|
|
193
229
|
* @public
|
|
@@ -210,7 +246,7 @@ declare class FlexibleColumnLayout extends UI5Element {
|
|
|
210
246
|
onColumnCollapseAnimationEndRef: (e: TransitionEvent) => void;
|
|
211
247
|
static i18nBundle: I18nBundle;
|
|
212
248
|
_prevLayout: `${FCLLayout}` | null;
|
|
213
|
-
|
|
249
|
+
_prevLayoutsConfiguration: LayoutConfiguration | null;
|
|
214
250
|
_ontouchstart: PassiveEventListenerObject;
|
|
215
251
|
separatorMovementSession?: SeparatorMovementSession | null;
|
|
216
252
|
constructor();
|
|
@@ -222,14 +258,50 @@ declare class FlexibleColumnLayout extends UI5Element {
|
|
|
222
258
|
handleResize(): void;
|
|
223
259
|
updateLayout(): void;
|
|
224
260
|
syncLayout(): void;
|
|
261
|
+
syncLayoutsConfiguration(): void;
|
|
225
262
|
toggleColumns(): void;
|
|
226
263
|
toggleColumn(column: string): void;
|
|
227
264
|
expandColumn(columnDOM: HTMLElement, columnWidth: string | number): void;
|
|
228
265
|
collapseColumn(columnDOM: HTMLElement): void;
|
|
229
266
|
onColumnCollapseAnimationEnd: (e: Event) => void;
|
|
230
|
-
nextColumnLayout(layout: `${FCLLayout}`):
|
|
267
|
+
nextColumnLayout(layout: `${FCLLayout}`): string[];
|
|
268
|
+
/**
|
|
269
|
+
* Gets custom column layout configuration if available and valid.
|
|
270
|
+
* Ensures all visible columns meet minimum width requirements.
|
|
271
|
+
* @param layout The FCL layout to get configuration for
|
|
272
|
+
* @returns Normalized column layout or undefined if invalid/unavailable
|
|
273
|
+
*/
|
|
274
|
+
getCustomColumnLayout(layout: `${FCLLayout}`): string[] | undefined;
|
|
275
|
+
getDefaultColumnLayout(layout: `${FCLLayout}`): string[];
|
|
276
|
+
mediaAllowsCustomConfiguration(media: MEDIA): media is MEDIA.TABLET | MEDIA.DESKTOP;
|
|
277
|
+
/**
|
|
278
|
+
* Applies minimum width constraints to column layout configuration.
|
|
279
|
+
* Ensures all visible columns meet the minimum width requirement by transferring
|
|
280
|
+
* space from the wider columns to the undersized columns.
|
|
281
|
+
* @param columnLayout Original column layout (percentages or pixels)
|
|
282
|
+
* @returns Constraint-compliant column layout in same format as input
|
|
283
|
+
*/
|
|
284
|
+
applyMinimumWidthConstraints(columnLayout: (string | 0)[]): string[];
|
|
285
|
+
/**
|
|
286
|
+
* Adjusts column widths to ensure minimum width constraints.
|
|
287
|
+
* Takes width from the widest columns to bring undersized columns up to minimum.
|
|
288
|
+
* @param pxWidths Array of column widths in pixels (modified in place)
|
|
289
|
+
*/
|
|
290
|
+
adjustColumnsToMinimumWidth(pxWidths: number[]): number[];
|
|
291
|
+
getColumnProportionsAboveMinWidth(columnPxWidths: number[]): number[];
|
|
292
|
+
/**
|
|
293
|
+
* Helper that handles pixel conversion for column width operations.
|
|
294
|
+
* Converts input to pixels, applies the operation, then converts back to relative widths.
|
|
295
|
+
* @param columnLayout Column layout in mixed formats
|
|
296
|
+
* @param operation Function that operates on pixel widths
|
|
297
|
+
* @returns Column layout in percentage format
|
|
298
|
+
*/
|
|
299
|
+
doWithPixelConversion(columnLayout: (string | 0)[], operation: (pxWidths: number[]) => number[]): string[];
|
|
300
|
+
isValidColumnLayout(columnLayout: (string | 0)[]): boolean;
|
|
301
|
+
verifyColumnWidthsMatchLayout(pxWidths: number[]): boolean;
|
|
231
302
|
calcVisibleColumns(colLayout: FlexibleColumnLayoutColumnLayout): number;
|
|
232
303
|
fireLayoutChange(separatorUsed: boolean, resized: boolean): void;
|
|
304
|
+
fireLayoutConfigurationChange(): void;
|
|
233
305
|
onSeparatorPress(e: TouchEvent | MouseEvent): void;
|
|
234
306
|
onSeparatorMove(e: TouchEvent | MouseEvent): void;
|
|
235
307
|
private onSeparatorMoveEnd;
|
|
@@ -239,7 +311,8 @@ declare class FlexibleColumnLayout extends UI5Element {
|
|
|
239
311
|
tmpFCLLayout: FCLLayout;
|
|
240
312
|
};
|
|
241
313
|
exitSeparatorMovementSession(): void;
|
|
242
|
-
saveUserDefinedColumnLayout(newLayout: FCLLayout, newColumnLayout:
|
|
314
|
+
saveUserDefinedColumnLayout(newLayout: FCLLayout, newColumnLayout: string[]): void;
|
|
315
|
+
updateLayoutsConfiguration(layout: `${FCLLayout}`, columnLayout: string[]): void;
|
|
243
316
|
private isSeparatorAheadOfCursor;
|
|
244
317
|
calculateNewColumnWidth(columnToResize: typeof COLUMN.START | typeof COLUMN.END, widthDelta: number): number;
|
|
245
318
|
moveSeparator(separator: HTMLElement, offsetX: number, fclLayoutBeforeMove: FCLLayout): FCLLayout;
|
|
@@ -293,9 +366,9 @@ declare class FlexibleColumnLayout extends UI5Element {
|
|
|
293
366
|
* @public
|
|
294
367
|
*/
|
|
295
368
|
get visibleColumns(): number;
|
|
296
|
-
get startColumnWidth(): string |
|
|
297
|
-
get midColumnWidth(): string |
|
|
298
|
-
get endColumnWidth(): string |
|
|
369
|
+
get startColumnWidth(): string | 0;
|
|
370
|
+
get midColumnWidth(): string | 0;
|
|
371
|
+
get endColumnWidth(): string | 0;
|
|
299
372
|
get showStartSeparator(): boolean;
|
|
300
373
|
get showEndSeparator(): boolean;
|
|
301
374
|
get showStartSeparatorGrip(): boolean | undefined;
|
|
@@ -337,7 +410,6 @@ declare class FlexibleColumnLayout extends UI5Element {
|
|
|
337
410
|
get accEndColumnRole(): FCLAccessibilityRoles | undefined;
|
|
338
411
|
get accStartSeparatorRole(): "separator" | FCLAccessibilityRoles;
|
|
339
412
|
get accEndSeparatorRole(): "separator" | FCLAccessibilityRoles;
|
|
340
|
-
get _effectiveLayoutsByMedia(): LayoutConfiguration;
|
|
341
413
|
get _accAttributes(): {
|
|
342
414
|
columns: {
|
|
343
415
|
start: {
|
|
@@ -356,4 +428,4 @@ declare class FlexibleColumnLayout extends UI5Element {
|
|
|
356
428
|
};
|
|
357
429
|
}
|
|
358
430
|
export default FlexibleColumnLayout;
|
|
359
|
-
export type { MEDIA, FlexibleColumnLayoutLayoutChangeEventDetail, FCLAccessibilityAttributes, FlexibleColumnLayoutColumnLayout, };
|
|
431
|
+
export type { MEDIA, FlexibleColumnLayoutLayoutChangeEventDetail, FlexibleColumnLayoutLayoutConfigurationChangeEventDetail, FCLAccessibilityAttributes, FlexibleColumnLayoutColumnLayout, LayoutConfiguration, };
|
|
@@ -22,7 +22,7 @@ import "@ui5/webcomponents-icons/dist/vertical-grip.js";
|
|
|
22
22
|
import { renderFinished } from "@ui5/webcomponents-base/dist/Render.js";
|
|
23
23
|
import { isLeft, isRight, isLeftShift, isRightShift, isHome, isEnd, isEnter, isSpace, } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
24
24
|
import FCLLayout from "./types/FCLLayout.js";
|
|
25
|
-
import {
|
|
25
|
+
import { getDefaultLayoutsByMedia, getNextLayoutByArrowPress, } from "./fcl-utils/FCLLayout.js";
|
|
26
26
|
// Texts
|
|
27
27
|
import { FCL_START_COLUMN_TXT, FCL_MIDDLE_COLUMN_TXT, FCL_END_COLUMN_TXT, FCL_START_SEPARATOR_TOOLTIP, FCL_END_SEPARATOR_TOOLTIP, } from "./generated/i18n/i18n-defaults.js";
|
|
28
28
|
// Template
|
|
@@ -146,6 +146,24 @@ let FlexibleColumnLayout = FlexibleColumnLayout_1 = class FlexibleColumnLayout e
|
|
|
146
146
|
*/
|
|
147
147
|
this.accessibilityAttributes = {};
|
|
148
148
|
/**
|
|
149
|
+
* Allows to customize the column proportions per screen size and layout.
|
|
150
|
+
* If no custom proportion provided for a specific layout, the default will be used.
|
|
151
|
+
*
|
|
152
|
+
* **Notes:**
|
|
153
|
+
*
|
|
154
|
+
* - The proportions should be given in percentages. For example ["30%", "40%", "30%"], ["70%", "30%", 0], etc.
|
|
155
|
+
* - The proportions should add up to 100%.
|
|
156
|
+
* - Hidden columns are marked as "0px", e.g. ["0px", "70%", "30%"]. Specifying 0 or "0%" for hidden columns is also valid.
|
|
157
|
+
* - If the proportions do not match the layout (e.g. if provided proportions ["70%", "30%", "0px"] for "OneColumn" layout), then the default proportions will be used instead.
|
|
158
|
+
* - Whenever the user drags the columns separator to resize the columns, the `layoutsConfiguration` object will be updated with the user-specified proportions for the given layout (and the `layout-configuration-change` event will be fired).
|
|
159
|
+
* - No custom configuration available for the phone screen size, as the default of 100% column width is always used there.
|
|
160
|
+
* @default {}
|
|
161
|
+
* @public
|
|
162
|
+
* @since 2.16.0
|
|
163
|
+
* @experimental
|
|
164
|
+
*/
|
|
165
|
+
this.layoutsConfiguration = {};
|
|
166
|
+
/**
|
|
149
167
|
* Defines the component width in px.
|
|
150
168
|
* @default 0
|
|
151
169
|
* @private
|
|
@@ -163,10 +181,6 @@ let FlexibleColumnLayout = FlexibleColumnLayout_1 = class FlexibleColumnLayout e
|
|
|
163
181
|
* @private
|
|
164
182
|
*/
|
|
165
183
|
this._resizing = false;
|
|
166
|
-
this._userDefinedColumnLayouts = {
|
|
167
|
-
tablet: {},
|
|
168
|
-
desktop: {},
|
|
169
|
-
};
|
|
170
184
|
this.onColumnCollapseAnimationEnd = (e) => {
|
|
171
185
|
const columnDOM = e.target;
|
|
172
186
|
columnDOM.classList.add("ui5-fcl-column--hidden");
|
|
@@ -174,6 +188,7 @@ let FlexibleColumnLayout = FlexibleColumnLayout_1 = class FlexibleColumnLayout e
|
|
|
174
188
|
columnDOM.removeEventListener("transitionend", this.onColumnCollapseAnimationEndRef);
|
|
175
189
|
};
|
|
176
190
|
this._prevLayout = null;
|
|
191
|
+
this._prevLayoutsConfiguration = null;
|
|
177
192
|
this.initialRendering = true;
|
|
178
193
|
this._handleResize = this.handleResize.bind(this);
|
|
179
194
|
this._onSeparatorMove = this.onSeparatorMove.bind(this);
|
|
@@ -201,6 +216,7 @@ let FlexibleColumnLayout = FlexibleColumnLayout_1 = class FlexibleColumnLayout e
|
|
|
201
216
|
this.handleInitialRendering();
|
|
202
217
|
return;
|
|
203
218
|
}
|
|
219
|
+
this.syncLayoutsConfiguration();
|
|
204
220
|
this.syncLayout();
|
|
205
221
|
}
|
|
206
222
|
handleInitialRendering() {
|
|
@@ -233,6 +249,14 @@ let FlexibleColumnLayout = FlexibleColumnLayout_1 = class FlexibleColumnLayout e
|
|
|
233
249
|
this._prevLayout = this.layout;
|
|
234
250
|
}
|
|
235
251
|
}
|
|
252
|
+
syncLayoutsConfiguration() {
|
|
253
|
+
if (this._prevLayoutsConfiguration !== this.layoutsConfiguration) {
|
|
254
|
+
this._prevLayoutsConfiguration = this.layoutsConfiguration;
|
|
255
|
+
if (this.nextColumnLayout(this.layout).join() !== this._columnLayout?.join() && !this.separatorMovementSession) {
|
|
256
|
+
this.updateLayout();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
236
260
|
toggleColumns() {
|
|
237
261
|
this.toggleColumn("start");
|
|
238
262
|
this.toggleColumn("mid");
|
|
@@ -292,19 +316,154 @@ let FlexibleColumnLayout = FlexibleColumnLayout_1 = class FlexibleColumnLayout e
|
|
|
292
316
|
}
|
|
293
317
|
}
|
|
294
318
|
nextColumnLayout(layout) {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
319
|
+
return this.getCustomColumnLayout(layout) || this.getDefaultColumnLayout(layout);
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Gets custom column layout configuration if available and valid.
|
|
323
|
+
* Ensures all visible columns meet minimum width requirements.
|
|
324
|
+
* @param layout The FCL layout to get configuration for
|
|
325
|
+
* @returns Normalized column layout or undefined if invalid/unavailable
|
|
326
|
+
*/
|
|
327
|
+
getCustomColumnLayout(layout) {
|
|
328
|
+
// Only allow custom configuration for tablet and desktop (not phone)
|
|
329
|
+
if (!this.mediaAllowsCustomConfiguration(this.media)) {
|
|
330
|
+
return undefined;
|
|
331
|
+
}
|
|
332
|
+
const customLayout = this.layoutsConfiguration[this.media]?.[layout]?.layout;
|
|
333
|
+
if (!customLayout) {
|
|
334
|
+
return undefined;
|
|
298
335
|
}
|
|
299
|
-
|
|
336
|
+
// ensure visible columns are above min-width given the current fcl total width
|
|
337
|
+
const constraintCompliantLayout = this.applyMinimumWidthConstraints(customLayout);
|
|
338
|
+
if (this.isValidColumnLayout(constraintCompliantLayout)) { // satisfy layout-specific contraints
|
|
339
|
+
return constraintCompliantLayout;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
getDefaultColumnLayout(layout) {
|
|
343
|
+
return getDefaultLayoutsByMedia()[this.media][layout].layout;
|
|
344
|
+
}
|
|
345
|
+
mediaAllowsCustomConfiguration(media) {
|
|
346
|
+
return media !== MEDIA.PHONE;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Applies minimum width constraints to column layout configuration.
|
|
350
|
+
* Ensures all visible columns meet the minimum width requirement by transferring
|
|
351
|
+
* space from the wider columns to the undersized columns.
|
|
352
|
+
* @param columnLayout Original column layout (percentages or pixels)
|
|
353
|
+
* @returns Constraint-compliant column layout in same format as input
|
|
354
|
+
*/
|
|
355
|
+
applyMinimumWidthConstraints(columnLayout) {
|
|
356
|
+
return this.doWithPixelConversion(columnLayout, pxWidths => {
|
|
357
|
+
return this.adjustColumnsToMinimumWidth(pxWidths);
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Adjusts column widths to ensure minimum width constraints.
|
|
362
|
+
* Takes width from the widest columns to bring undersized columns up to minimum.
|
|
363
|
+
* @param pxWidths Array of column widths in pixels (modified in place)
|
|
364
|
+
*/
|
|
365
|
+
adjustColumnsToMinimumWidth(pxWidths) {
|
|
366
|
+
const adjustedWidths = [...pxWidths];
|
|
367
|
+
let totalDeficit = 0;
|
|
368
|
+
for (let i = 0; i < adjustedWidths.length; i++) {
|
|
369
|
+
const width = adjustedWidths[i];
|
|
370
|
+
const isBelowMinimum = Math.ceil(width) < COLUMN_MIN_WIDTH; // ceil to avoid floating point precision issues
|
|
371
|
+
if (!this._isColumnHidden(width) && isBelowMinimum) {
|
|
372
|
+
totalDeficit += COLUMN_MIN_WIDTH - width;
|
|
373
|
+
adjustedWidths[i] = COLUMN_MIN_WIDTH;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (totalDeficit === 0) {
|
|
377
|
+
return adjustedWidths; // no adjustments were needed
|
|
378
|
+
}
|
|
379
|
+
// Create proportions for redistribution of the deficit based on available space above COLUMN_MIN_WIDTH
|
|
380
|
+
const columnProportions = this.getColumnProportionsAboveMinWidth(pxWidths);
|
|
381
|
+
// Redistribute the deficit proportionally among columns that can contribute
|
|
382
|
+
for (let i = 0; i < adjustedWidths.length; i++) {
|
|
383
|
+
const isVisible = adjustedWidths[i] > 0;
|
|
384
|
+
if (isVisible && columnProportions[i] > 0) {
|
|
385
|
+
adjustedWidths[i] -= totalDeficit * columnProportions[i];
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
return adjustedWidths;
|
|
389
|
+
}
|
|
390
|
+
getColumnProportionsAboveMinWidth(columnPxWidths) {
|
|
391
|
+
const widthsAboveMinWidth = columnPxWidths.map(width => {
|
|
392
|
+
if (width > COLUMN_MIN_WIDTH) {
|
|
393
|
+
return width - COLUMN_MIN_WIDTH;
|
|
394
|
+
}
|
|
395
|
+
return 0;
|
|
396
|
+
});
|
|
397
|
+
const total = widthsAboveMinWidth.reduce((sum, width) => sum + width, 0);
|
|
398
|
+
if (total === 0) {
|
|
399
|
+
return widthsAboveMinWidth;
|
|
400
|
+
}
|
|
401
|
+
return widthsAboveMinWidth.map(width => width / total);
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Helper that handles pixel conversion for column width operations.
|
|
405
|
+
* Converts input to pixels, applies the operation, then converts back to relative widths.
|
|
406
|
+
* @param columnLayout Column layout in mixed formats
|
|
407
|
+
* @param operation Function that operates on pixel widths
|
|
408
|
+
* @returns Column layout in percentage format
|
|
409
|
+
*/
|
|
410
|
+
doWithPixelConversion(columnLayout, operation) {
|
|
411
|
+
// Convert to pixels for calculations
|
|
412
|
+
const pxWidths = columnLayout.map(width => this.convertColumnWidthToPixels(width));
|
|
413
|
+
// Apply the operation
|
|
414
|
+
const adjustedPxWidths = operation(pxWidths);
|
|
415
|
+
// Convert back to percentage-based widths
|
|
416
|
+
return adjustedPxWidths.map(width => this.convertToRelativeColumnWidth(width));
|
|
417
|
+
}
|
|
418
|
+
isValidColumnLayout(columnLayout) {
|
|
419
|
+
const pxWidths = columnLayout?.map(w => this.convertColumnWidthToPixels(w));
|
|
420
|
+
const totalWidth = pxWidths.reduce((sum, i) => sum + i, 0);
|
|
421
|
+
if (Math.round(totalWidth) !== Math.round(this._availableWidthForColumns)) {
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
return this.verifyColumnWidthsMatchLayout(pxWidths);
|
|
425
|
+
}
|
|
426
|
+
verifyColumnWidthsMatchLayout(pxWidths) {
|
|
427
|
+
const columnWidths = {
|
|
428
|
+
start: pxWidths[0],
|
|
429
|
+
mid: pxWidths[1],
|
|
430
|
+
end: pxWidths[2],
|
|
431
|
+
}, startWidth = columnWidths.start, startPercentWidth = parseInt(this.convertToRelativeColumnWidth(startWidth));
|
|
432
|
+
switch (this.layout) {
|
|
433
|
+
case FCLLayout.TwoColumnsStartExpanded: {
|
|
434
|
+
return columnWidths.start >= columnWidths.mid;
|
|
435
|
+
}
|
|
436
|
+
case FCLLayout.TwoColumnsMidExpanded: {
|
|
437
|
+
return columnWidths.mid > columnWidths.start;
|
|
438
|
+
}
|
|
439
|
+
case FCLLayout.ThreeColumnsEndExpanded: {
|
|
440
|
+
return (columnWidths.end > columnWidths.mid) && (startPercentWidth < 33);
|
|
441
|
+
}
|
|
442
|
+
case FCLLayout.ThreeColumnsStartExpandedEndHidden: {
|
|
443
|
+
return (columnWidths.start >= columnWidths.mid) && columnWidths.end === 0;
|
|
444
|
+
}
|
|
445
|
+
case FCLLayout.ThreeColumnsMidExpanded: {
|
|
446
|
+
return (columnWidths.mid >= columnWidths.end)
|
|
447
|
+
&& ((this.media === MEDIA.DESKTOP && startPercentWidth < 33) // desktop
|
|
448
|
+
|| (this.media === MEDIA.TABLET && startPercentWidth === 0)); // tablet
|
|
449
|
+
}
|
|
450
|
+
case FCLLayout.ThreeColumnsMidExpandedEndHidden: {
|
|
451
|
+
return (columnWidths.mid > columnWidths.start)
|
|
452
|
+
&& columnWidths.end === 0
|
|
453
|
+
&& ((this.media === MEDIA.DESKTOP && startPercentWidth >= 33)
|
|
454
|
+
|| (this.media === MEDIA.TABLET && startWidth >= COLUMN_MIN_WIDTH));
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
return false;
|
|
300
458
|
}
|
|
301
459
|
calcVisibleColumns(colLayout) {
|
|
302
460
|
return colLayout.filter(colWidth => !this._isColumnHidden(colWidth)).length;
|
|
303
461
|
}
|
|
304
462
|
fireLayoutChange(separatorUsed, resized) {
|
|
463
|
+
const columnLayout = [...this._columnLayout]; // do not leak reference to the private _columnLayout array to prevent apps modifying its content
|
|
305
464
|
this.fireDecoratorEvent("layout-change", {
|
|
306
465
|
layout: this.layout,
|
|
307
|
-
columnLayout
|
|
466
|
+
columnLayout,
|
|
308
467
|
startColumnVisible: this.startColumnVisible,
|
|
309
468
|
midColumnVisible: this.midColumnVisible,
|
|
310
469
|
endColumnVisible: this.endColumnVisible,
|
|
@@ -312,6 +471,14 @@ let FlexibleColumnLayout = FlexibleColumnLayout_1 = class FlexibleColumnLayout e
|
|
|
312
471
|
resized,
|
|
313
472
|
});
|
|
314
473
|
}
|
|
474
|
+
fireLayoutConfigurationChange() {
|
|
475
|
+
const columnLayout = [...this._columnLayout]; // do not leak reference to the private _columnLayout array to prevent apps modifying its content
|
|
476
|
+
this.fireDecoratorEvent("layout-configuration-change", {
|
|
477
|
+
layout: this.layout,
|
|
478
|
+
media: this.media,
|
|
479
|
+
columnLayout,
|
|
480
|
+
});
|
|
481
|
+
}
|
|
315
482
|
onSeparatorPress(e) {
|
|
316
483
|
if (e.target === this.startArrowDOM) {
|
|
317
484
|
return;
|
|
@@ -353,7 +520,7 @@ let FlexibleColumnLayout = FlexibleColumnLayout_1 = class FlexibleColumnLayout e
|
|
|
353
520
|
return;
|
|
354
521
|
}
|
|
355
522
|
const newLayout = this.separatorMovementSession.tmpFCLLayout;
|
|
356
|
-
const newColumnLayout = this._columnLayout;
|
|
523
|
+
const newColumnLayout = [...this._columnLayout]; // obtain the values only
|
|
357
524
|
this.saveUserDefinedColumnLayout(newLayout, newColumnLayout);
|
|
358
525
|
this.exitSeparatorMovementSession();
|
|
359
526
|
}
|
|
@@ -377,12 +544,22 @@ let FlexibleColumnLayout = FlexibleColumnLayout_1 = class FlexibleColumnLayout e
|
|
|
377
544
|
this.separatorMovementSession = null;
|
|
378
545
|
}
|
|
379
546
|
saveUserDefinedColumnLayout(newLayout, newColumnLayout) {
|
|
380
|
-
const
|
|
381
|
-
this._userDefinedColumnLayouts[media][newLayout] = newColumnLayout;
|
|
547
|
+
const oldColumnLayout = this.getCustomColumnLayout(newLayout);
|
|
382
548
|
if (this.layout !== newLayout) {
|
|
383
549
|
this.layout = newLayout;
|
|
384
550
|
this.fireLayoutChange(true, false);
|
|
385
551
|
}
|
|
552
|
+
if (oldColumnLayout?.join() !== newColumnLayout.join()) { // compare arrays' content
|
|
553
|
+
this.updateLayoutsConfiguration(newLayout, newColumnLayout);
|
|
554
|
+
this.fireLayoutConfigurationChange();
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
updateLayoutsConfiguration(layout, columnLayout) {
|
|
558
|
+
if (this.mediaAllowsCustomConfiguration(this.media)) {
|
|
559
|
+
this.layoutsConfiguration[this.media] ??= {};
|
|
560
|
+
this.layoutsConfiguration[this.media][layout] ??= { layout: [] };
|
|
561
|
+
this.layoutsConfiguration[this.media][layout].layout = columnLayout;
|
|
562
|
+
}
|
|
386
563
|
}
|
|
387
564
|
isSeparatorAheadOfCursor(cursorX, separatorX, isForwardMove) {
|
|
388
565
|
if (isForwardMove) {
|
|
@@ -804,7 +981,7 @@ let FlexibleColumnLayout = FlexibleColumnLayout_1 = class FlexibleColumnLayout e
|
|
|
804
981
|
return this.shadowRoot.querySelector(".ui5-fcl-arrow--start");
|
|
805
982
|
}
|
|
806
983
|
get effectiveSeparatorsInfo() {
|
|
807
|
-
return
|
|
984
|
+
return getDefaultLayoutsByMedia()[this.media][this.effectiveLayout].separators;
|
|
808
985
|
}
|
|
809
986
|
get effectiveLayout() {
|
|
810
987
|
return this.separatorMovementSession?.tmpFCLLayout || this.layout;
|
|
@@ -898,9 +1075,6 @@ let FlexibleColumnLayout = FlexibleColumnLayout_1 = class FlexibleColumnLayout e
|
|
|
898
1075
|
get accEndSeparatorRole() {
|
|
899
1076
|
return this.accessibilityAttributes.endSeparator?.role || "separator";
|
|
900
1077
|
}
|
|
901
|
-
get _effectiveLayoutsByMedia() {
|
|
902
|
-
return this._layoutsConfiguration || getLayoutsByMedia();
|
|
903
|
-
}
|
|
904
1078
|
get _accAttributes() {
|
|
905
1079
|
return {
|
|
906
1080
|
columns: {
|
|
@@ -929,6 +1103,9 @@ __decorate([
|
|
|
929
1103
|
__decorate([
|
|
930
1104
|
property({ type: Object })
|
|
931
1105
|
], FlexibleColumnLayout.prototype, "accessibilityAttributes", void 0);
|
|
1106
|
+
__decorate([
|
|
1107
|
+
property({ type: Object })
|
|
1108
|
+
], FlexibleColumnLayout.prototype, "layoutsConfiguration", void 0);
|
|
932
1109
|
__decorate([
|
|
933
1110
|
property({ type: Number })
|
|
934
1111
|
], FlexibleColumnLayout.prototype, "_width", void 0);
|
|
@@ -981,6 +1158,19 @@ FlexibleColumnLayout = FlexibleColumnLayout_1 = __decorate([
|
|
|
981
1158
|
event("layout-change", {
|
|
982
1159
|
bubbles: true,
|
|
983
1160
|
})
|
|
1161
|
+
/**
|
|
1162
|
+
* Fired when the `layoutsConfiguration` changes via user interaction by dragging the separators.
|
|
1163
|
+
* @param {FCLLayout} layout The current layout
|
|
1164
|
+
* @param {MEDIA} media The current media type
|
|
1165
|
+
* @param {array} columnLayout The effective column layout, f.e ["67%", "33%", "0px"]
|
|
1166
|
+
* @public
|
|
1167
|
+
* @since 2.16.0
|
|
1168
|
+
* @experimental
|
|
1169
|
+
*/
|
|
1170
|
+
,
|
|
1171
|
+
event("layout-configuration-change", {
|
|
1172
|
+
bubbles: true,
|
|
1173
|
+
})
|
|
984
1174
|
], FlexibleColumnLayout);
|
|
985
1175
|
FlexibleColumnLayout.define();
|
|
986
1176
|
export default FlexibleColumnLayout;
|