@openui5/sap.ui.webc.common 1.111.6 → 1.112.1
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/package.json +2 -2
- package/src/sap/ui/webc/common/.library +2 -2
- package/src/sap/ui/webc/common/Configuration.js +6 -0
- package/src/sap/ui/webc/common/Icons.js +6 -0
- package/src/sap/ui/webc/common/WebComponent.js +1 -1
- package/src/sap/ui/webc/common/WebComponentMetadata.js +1 -1
- package/src/sap/ui/webc/common/library.js +3 -3
- package/src/sap/ui/webc/common/thirdparty/base/Boot.js +2 -11
- package/src/sap/ui/webc/common/thirdparty/base/CSP.js +3 -14
- package/src/sap/ui/webc/common/thirdparty/base/CustomElementsRegistry.js +0 -21
- package/src/sap/ui/webc/common/thirdparty/base/CustomElementsScopeUtils.js +5 -22
- package/src/sap/ui/webc/common/thirdparty/base/DOMObserver.js +5 -18
- package/src/sap/ui/webc/common/thirdparty/base/Device.js +2 -35
- package/src/sap/ui/webc/common/thirdparty/base/EventProvider.js +2 -21
- package/src/sap/ui/webc/common/thirdparty/base/FeaturesRegistry.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/base/FontFace.js +4 -8
- package/src/sap/ui/webc/common/thirdparty/base/InitialConfiguration.js +13 -42
- package/src/sap/ui/webc/common/thirdparty/base/Keys.js +3 -138
- package/src/sap/ui/webc/common/thirdparty/base/ManagedStyles.js +0 -19
- package/src/sap/ui/webc/common/thirdparty/base/MediaRange.js +4 -8
- package/src/sap/ui/webc/common/thirdparty/base/PropertiesFileFormat.js +2 -16
- package/src/sap/ui/webc/common/thirdparty/base/Render.js +14 -35
- package/src/sap/ui/webc/common/thirdparty/base/RenderQueue.js +1 -16
- package/src/sap/ui/webc/common/thirdparty/base/RenderScheduler.js +2 -10
- package/src/sap/ui/webc/common/thirdparty/base/Runtimes.js +18 -34
- package/src/sap/ui/webc/common/thirdparty/base/StaticAreaItem.js +4 -25
- package/src/sap/ui/webc/common/thirdparty/base/SystemCSSVars.js +0 -3
- package/src/sap/ui/webc/common/thirdparty/base/UI5Element.js +104 -246
- package/src/sap/ui/webc/common/thirdparty/base/UI5ElementMetadata.js +39 -84
- package/src/sap/ui/webc/common/thirdparty/base/animations/AnimationQueue.js +0 -11
- package/src/sap/ui/webc/common/thirdparty/base/animations/animate.js +0 -8
- package/src/sap/ui/webc/common/thirdparty/base/animations/scroll.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/base/animations/slideDown.js +9 -10
- package/src/sap/ui/webc/common/thirdparty/base/animations/slideUp.js +4 -7
- package/src/sap/ui/webc/common/thirdparty/base/asset-registries/Icons.js +9 -34
- package/src/sap/ui/webc/common/thirdparty/base/asset-registries/Illustrations.js +0 -8
- package/src/sap/ui/webc/common/thirdparty/base/asset-registries/LocaleData.js +36 -57
- package/src/sap/ui/webc/common/thirdparty/base/asset-registries/Themes.js +4 -27
- package/src/sap/ui/webc/common/thirdparty/base/asset-registries/i18n.js +12 -37
- package/src/sap/ui/webc/common/thirdparty/base/assets-meta/IconCollectionsAlias.js +0 -1
- package/src/sap/ui/webc/common/thirdparty/base/config/AnimationMode.js +0 -7
- package/src/sap/ui/webc/common/thirdparty/base/config/CalendarType.js +2 -7
- package/src/sap/ui/webc/common/thirdparty/base/config/FormatSettings.js +2 -4
- package/src/sap/ui/webc/common/thirdparty/base/config/Icons.js +3 -11
- package/src/sap/ui/webc/common/thirdparty/base/config/Language.js +4 -14
- package/src/sap/ui/webc/common/thirdparty/base/config/NoConflict.js +4 -14
- package/src/sap/ui/webc/common/thirdparty/base/config/RTL.js +2 -8
- package/src/sap/ui/webc/common/thirdparty/base/config/Theme.js +4 -15
- package/src/sap/ui/webc/common/thirdparty/base/delegate/ItemNavigation.js +8 -72
- package/src/sap/ui/webc/common/thirdparty/base/delegate/ResizeHandler.js +8 -23
- package/src/sap/ui/webc/common/thirdparty/base/delegate/ScrollEnablement.js +9 -34
- package/src/sap/ui/webc/common/thirdparty/base/features/F6Navigation.js +1 -20
- package/src/sap/ui/webc/common/thirdparty/base/features/OpenUI5Enablement.js +0 -17
- package/src/sap/ui/webc/common/thirdparty/base/features/OpenUI5Support.js +0 -32
- package/src/sap/ui/webc/common/thirdparty/base/generated/VersionInfo.js +1 -1
- package/src/sap/ui/webc/common/thirdparty/base/getSharedResource.js +1 -9
- package/src/sap/ui/webc/common/thirdparty/base/i18nBundle.js +4 -18
- package/src/sap/ui/webc/common/thirdparty/base/locale/Locale.js +0 -25
- package/src/sap/ui/webc/common/thirdparty/base/locale/RTLAwareRegistry.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/base/locale/applyDirection.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/base/locale/directionChange.js +2 -9
- package/src/sap/ui/webc/common/thirdparty/base/locale/getEffectiveDir.js +4 -9
- package/src/sap/ui/webc/common/thirdparty/base/locale/getLocale.js +3 -11
- package/src/sap/ui/webc/common/thirdparty/base/locale/languageChange.js +0 -8
- package/src/sap/ui/webc/common/thirdparty/base/locale/nextFallbackLocale.js +4 -8
- package/src/sap/ui/webc/common/thirdparty/base/locale/normalizeLocale.js +8 -14
- package/src/sap/ui/webc/common/thirdparty/base/renderer/LitRenderer.js +0 -11
- package/src/sap/ui/webc/common/thirdparty/base/renderer/directives/style-map.js +7 -21
- package/src/sap/ui/webc/common/thirdparty/base/renderer/executeTemplate.js +1 -6
- package/src/sap/ui/webc/common/thirdparty/base/theming/CustomStyle.js +2 -16
- package/src/sap/ui/webc/common/thirdparty/base/theming/ThemeLoaded.js +0 -8
- package/src/sap/ui/webc/common/thirdparty/base/theming/applyTheme.js +6 -21
- package/src/sap/ui/webc/common/thirdparty/base/theming/getConstructableStyle.js +1 -6
- package/src/sap/ui/webc/common/thirdparty/base/theming/getEffectiveLinksHrefs.js +0 -7
- package/src/sap/ui/webc/common/thirdparty/base/theming/getEffectiveStyle.js +0 -8
- package/src/sap/ui/webc/common/thirdparty/base/theming/getStylesString.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/base/theming/getThemeDesignerTheme.js +4 -22
- package/src/sap/ui/webc/common/thirdparty/base/theming/preloadLinks.js +0 -5
- package/src/sap/ui/webc/common/thirdparty/base/thirdparty/_merge.js +10 -20
- package/src/sap/ui/webc/common/thirdparty/base/thirdparty/isPlainObject.js +0 -6
- package/src/sap/ui/webc/common/thirdparty/base/thirdparty/merge.js +0 -3
- package/src/sap/ui/webc/common/thirdparty/base/types/CSSColor.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/base/types/CSSSize.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/base/types/CalendarType.js +0 -5
- package/src/sap/ui/webc/common/thirdparty/base/types/DataType.js +0 -8
- package/src/sap/ui/webc/common/thirdparty/base/types/Float.js +0 -5
- package/src/sap/ui/webc/common/thirdparty/base/types/Integer.js +0 -5
- package/src/sap/ui/webc/common/thirdparty/base/types/InvisibleMessageMode.js +0 -6
- package/src/sap/ui/webc/common/thirdparty/base/types/ItemNavigationBehavior.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/base/types/PopupState.js +0 -8
- package/src/sap/ui/webc/common/thirdparty/base/types/ValueState.js +0 -5
- package/src/sap/ui/webc/common/thirdparty/base/updateShadowRoot.js +0 -5
- package/src/sap/ui/webc/common/thirdparty/base/util/AriaLabelHelper.js +1 -9
- package/src/sap/ui/webc/common/thirdparty/base/util/Caret.js +0 -6
- package/src/sap/ui/webc/common/thirdparty/base/util/ColorConversion.js +29 -46
- package/src/sap/ui/webc/common/thirdparty/base/util/FetchHelper.js +0 -10
- package/src/sap/ui/webc/common/thirdparty/base/util/FocusableElements.js +2 -19
- package/src/sap/ui/webc/common/thirdparty/base/util/InvisibleMessage.js +3 -9
- package/src/sap/ui/webc/common/thirdparty/base/util/PopupUtils.js +0 -28
- package/src/sap/ui/webc/common/thirdparty/base/util/SlotsHelper.js +4 -15
- package/src/sap/ui/webc/common/thirdparty/base/util/StringHelper.js +0 -7
- package/src/sap/ui/webc/common/thirdparty/base/util/TabbableElements.js +0 -12
- package/src/sap/ui/webc/common/thirdparty/base/util/arraysAreEqual.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/base/util/clamp.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/base/util/createLinkInHead.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/base/util/createStyleInHead.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/base/util/debounce.js +1 -3
- package/src/sap/ui/webc/common/thirdparty/base/util/detectNavigatorLanguage.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/base/util/escapeRegex.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/base/util/findNodeOwner.js +0 -6
- package/src/sap/ui/webc/common/thirdparty/base/util/formatMessage.js +2 -7
- package/src/sap/ui/webc/common/thirdparty/base/util/generateHighlightedMarkup.js +9 -17
- package/src/sap/ui/webc/common/thirdparty/base/util/getActiveElement.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/base/util/getClassCopy.js +0 -3
- package/src/sap/ui/webc/common/thirdparty/base/util/getDesigntimePropertyAsArray.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/base/util/getEffectiveContentDensity.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/base/util/getFileExtension.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/base/util/getNormalizedTarget.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/base/util/getSingletonElementInstance.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/base/util/isDefaultSlotProvided.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/base/util/isDescendantOf.js +0 -6
- package/src/sap/ui/webc/common/thirdparty/base/util/isElementInView.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/base/util/isNodeClickable.js +0 -5
- package/src/sap/ui/webc/common/thirdparty/base/util/isNodeHidden.js +0 -3
- package/src/sap/ui/webc/common/thirdparty/base/util/isNodeTabbable.js +0 -9
- package/src/sap/ui/webc/common/thirdparty/base/util/isValidPropertyName.js +1 -3
- package/src/sap/ui/webc/common/thirdparty/base/util/setToArray.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/base/util/whenDOMReady.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/icons/generated/json-imports/i18n.js +0 -52
- package/src/sap/ui/webc/common/thirdparty/icons/json-imports/Icons.js +0 -5
- package/src/sap/ui/webc/common/thirdparty/icons-business-suite/json-imports/Icons.js +0 -3
- package/src/sap/ui/webc/common/thirdparty/icons-tnt/json-imports/Icons.js +0 -3
- package/src/sap/ui/webc/common/thirdparty/lit-html/directive-helpers.js +62 -70
- package/src/sap/ui/webc/common/thirdparty/lit-html/directive.js +11 -20
- package/src/sap/ui/webc/common/thirdparty/lit-html/directives/class-map.js +0 -10
- package/src/sap/ui/webc/common/thirdparty/lit-html/directives/if-defined.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/lit-html/directives/repeat.js +55 -71
- package/src/sap/ui/webc/common/thirdparty/lit-html/directives/unsafe-html.js +0 -4
- package/src/sap/ui/webc/common/thirdparty/lit-html/lit-html.js +96 -171
- package/src/sap/ui/webc/common/thirdparty/lit-html/static.js +34 -40
- package/src/sap/ui/webc/common/thirdparty/localization/DateFormat.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/localization/LocaleData.js +0 -2
- package/src/sap/ui/webc/common/thirdparty/localization/dates/CalendarDate.js +13 -56
- package/src/sap/ui/webc/common/thirdparty/localization/dates/ExtremeDates.js +0 -11
- package/src/sap/ui/webc/common/thirdparty/localization/dates/calculateWeekNumber.js +5 -8
- package/src/sap/ui/webc/common/thirdparty/localization/dates/getRoundedTimestamp.js +0 -3
- package/src/sap/ui/webc/common/thirdparty/localization/dates/getTodayUTCTimestamp.js +0 -3
- package/src/sap/ui/webc/common/thirdparty/localization/dates/modifyDateBy.js +0 -9
- package/src/sap/ui/webc/common/thirdparty/localization/getCachedLocaleDataInstance.js +0 -5
- package/src/sap/ui/webc/common/thirdparty/localization/locale/getLocaleData.js +1 -6
- package/src/sap/ui/webc/common/thirdparty/theming/generated/json-imports/Themes.js +0 -16
- package/ui5.yaml +7 -7
- package/src/sap/ui/webc/common/thirdparty/icons-business-suite/main-milestone.js +0 -25
- package/src/sap/ui/webc/common/thirdparty/icons-business-suite/main-sequence.js +0 -25
@@ -7,9 +7,7 @@ sap.ui.define(["exports", "./types/DataType", "./util/isDescendantOf", "./util/S
|
|
7
7
|
_exports.default = void 0;
|
8
8
|
_DataType = _interopRequireDefault(_DataType);
|
9
9
|
_isDescendantOf = _interopRequireDefault(_isDescendantOf);
|
10
|
-
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
|
-
|
13
11
|
/**
|
14
12
|
*
|
15
13
|
* @class
|
@@ -19,25 +17,21 @@ sap.ui.define(["exports", "./types/DataType", "./util/isDescendantOf", "./util/S
|
|
19
17
|
constructor(metadata) {
|
20
18
|
this.metadata = metadata;
|
21
19
|
}
|
22
|
-
|
23
20
|
getInitialState() {
|
24
21
|
if (Object.prototype.hasOwnProperty.call(this, "_initialState")) {
|
25
22
|
return this._initialState;
|
26
23
|
}
|
27
|
-
|
28
24
|
const initialState = {};
|
29
|
-
const slotsAreManaged = this.slotsAreManaged();
|
25
|
+
const slotsAreManaged = this.slotsAreManaged();
|
30
26
|
|
27
|
+
// Initialize properties
|
31
28
|
const props = this.getProperties();
|
32
|
-
|
33
29
|
for (const propName in props) {
|
34
30
|
// eslint-disable-line
|
35
31
|
const propType = props[propName].type;
|
36
32
|
const propDefaultValue = props[propName].defaultValue;
|
37
|
-
|
38
33
|
if (propType === Boolean) {
|
39
34
|
initialState[propName] = false;
|
40
|
-
|
41
35
|
if (propDefaultValue !== undefined) {
|
42
36
|
console.warn("The 'defaultValue' metadata key is ignored for all booleans properties, they would be initialized with 'false' by default"); // eslint-disable-line
|
43
37
|
}
|
@@ -50,215 +44,188 @@ sap.ui.define(["exports", "./types/DataType", "./util/isDescendantOf", "./util/S
|
|
50
44
|
} else {
|
51
45
|
initialState[propName] = propDefaultValue;
|
52
46
|
}
|
53
|
-
}
|
54
|
-
|
47
|
+
}
|
55
48
|
|
49
|
+
// Initialize slots
|
56
50
|
if (slotsAreManaged) {
|
57
51
|
const slots = this.getSlots();
|
58
|
-
|
59
52
|
for (const [slotName, slotData] of Object.entries(slots)) {
|
60
53
|
// eslint-disable-line
|
61
54
|
const propertyName = slotData.propertyName || slotName;
|
62
55
|
initialState[propertyName] = [];
|
63
56
|
}
|
64
57
|
}
|
65
|
-
|
66
58
|
this._initialState = initialState;
|
67
59
|
return initialState;
|
68
60
|
}
|
61
|
+
|
69
62
|
/**
|
70
63
|
* Only intended for use by UI5Element.js
|
71
64
|
* @protected
|
72
65
|
*/
|
73
|
-
|
74
|
-
|
75
66
|
static validatePropertyValue(value, propData) {
|
76
67
|
const isMultiple = propData.multiple;
|
77
|
-
|
78
68
|
if (isMultiple) {
|
79
69
|
return value.map(propValue => validateSingleProperty(propValue, propData));
|
80
70
|
}
|
81
|
-
|
82
71
|
return validateSingleProperty(value, propData);
|
83
72
|
}
|
73
|
+
|
84
74
|
/**
|
85
75
|
* Only intended for use by UI5Element.js
|
86
76
|
* @protected
|
87
77
|
*/
|
88
|
-
|
89
|
-
|
90
78
|
static validateSlotValue(value, slotData) {
|
91
79
|
return validateSingleSlot(value, slotData);
|
92
80
|
}
|
81
|
+
|
93
82
|
/**
|
94
83
|
* Returns the tag of the UI5 Element without the scope
|
95
84
|
* @public
|
96
85
|
*/
|
97
|
-
|
98
|
-
|
99
86
|
getPureTag() {
|
100
87
|
return this.metadata.tag;
|
101
88
|
}
|
89
|
+
|
102
90
|
/**
|
103
91
|
* Returns the tag of the UI5 Element
|
104
92
|
* @public
|
105
93
|
*/
|
106
|
-
|
107
|
-
|
108
94
|
getTag() {
|
109
95
|
const pureTag = this.metadata.tag;
|
110
96
|
const suffix = (0, _CustomElementsScopeUtils.getEffectiveScopingSuffixForTag)(pureTag);
|
111
|
-
|
112
97
|
if (!suffix) {
|
113
98
|
return pureTag;
|
114
99
|
}
|
115
|
-
|
116
100
|
return `${pureTag}-${suffix}`;
|
117
101
|
}
|
102
|
+
|
118
103
|
/**
|
119
104
|
* Used to get the tag we need to register for backwards compatibility
|
120
105
|
* @public
|
121
106
|
*/
|
122
|
-
|
123
|
-
|
124
107
|
getAltTag() {
|
125
108
|
const pureAltTag = this.metadata.altTag;
|
126
|
-
|
127
109
|
if (!pureAltTag) {
|
128
110
|
return;
|
129
111
|
}
|
130
|
-
|
131
112
|
const suffix = (0, _CustomElementsScopeUtils.getEffectiveScopingSuffixForTag)(pureAltTag);
|
132
|
-
|
133
113
|
if (!suffix) {
|
134
114
|
return pureAltTag;
|
135
115
|
}
|
136
|
-
|
137
116
|
return `${pureAltTag}-${suffix}`;
|
138
117
|
}
|
118
|
+
|
139
119
|
/**
|
140
120
|
* Determines whether a property should have an attribute counterpart
|
141
121
|
* @public
|
142
122
|
* @param propName
|
143
123
|
* @returns {boolean}
|
144
124
|
*/
|
145
|
-
|
146
|
-
|
147
125
|
hasAttribute(propName) {
|
148
126
|
const propData = this.getProperties()[propName];
|
149
127
|
return propData.type !== Object && !propData.noAttribute && !propData.multiple;
|
150
128
|
}
|
129
|
+
|
151
130
|
/**
|
152
131
|
* Returns an array with the properties of the UI5 Element (in camelCase)
|
153
132
|
* @public
|
154
133
|
* @returns {string[]}
|
155
134
|
*/
|
156
|
-
|
157
|
-
|
158
135
|
getPropertiesList() {
|
159
136
|
return Object.keys(this.getProperties());
|
160
137
|
}
|
138
|
+
|
161
139
|
/**
|
162
140
|
* Returns an array with the attributes of the UI5 Element (in kebab-case)
|
163
141
|
* @public
|
164
142
|
* @returns {string[]}
|
165
143
|
*/
|
166
|
-
|
167
|
-
|
168
144
|
getAttributesList() {
|
169
145
|
return this.getPropertiesList().filter(this.hasAttribute, this).map(_StringHelper.camelToKebabCase);
|
170
146
|
}
|
147
|
+
|
171
148
|
/**
|
172
149
|
* Returns an object with key-value pairs of slots and their metadata definitions
|
173
150
|
* @public
|
174
151
|
*/
|
175
|
-
|
176
|
-
|
177
152
|
getSlots() {
|
178
153
|
return this.metadata.slots || {};
|
179
154
|
}
|
155
|
+
|
180
156
|
/**
|
181
157
|
* Determines whether this UI5 Element has a default slot of type Node, therefore can slot text
|
182
158
|
* @returns {boolean}
|
183
159
|
*/
|
184
|
-
|
185
|
-
|
186
160
|
canSlotText() {
|
187
161
|
const defaultSlot = this.getSlots().default;
|
188
162
|
return defaultSlot && defaultSlot.type === Node;
|
189
163
|
}
|
164
|
+
|
190
165
|
/**
|
191
166
|
* Determines whether this UI5 Element supports any slots
|
192
167
|
* @public
|
193
168
|
*/
|
194
|
-
|
195
|
-
|
196
169
|
hasSlots() {
|
197
170
|
return !!Object.entries(this.getSlots()).length;
|
198
171
|
}
|
172
|
+
|
199
173
|
/**
|
200
174
|
* Determines whether this UI5 Element supports any slots with "individualSlots: true"
|
201
175
|
* @public
|
202
176
|
*/
|
203
|
-
|
204
|
-
|
205
177
|
hasIndividualSlots() {
|
206
178
|
return this.slotsAreManaged() && Object.entries(this.getSlots()).some(([_slotName, slotData]) => slotData.individualSlots);
|
207
179
|
}
|
180
|
+
|
208
181
|
/**
|
209
182
|
* Determines whether this UI5 Element needs to invalidate if children are added/removed/changed
|
210
183
|
* @public
|
211
184
|
*/
|
212
|
-
|
213
|
-
|
214
185
|
slotsAreManaged() {
|
215
186
|
return !!this.metadata.managedSlots;
|
216
187
|
}
|
188
|
+
|
217
189
|
/**
|
218
190
|
* Determines whether this control supports F6 fast navigation
|
219
191
|
* @public
|
220
192
|
*/
|
221
|
-
|
222
|
-
|
223
193
|
supportsF6FastNavigation() {
|
224
194
|
return !!this.metadata.fastNavigation;
|
225
195
|
}
|
196
|
+
|
226
197
|
/**
|
227
198
|
* Returns an object with key-value pairs of properties and their metadata definitions
|
228
199
|
* @public
|
229
200
|
*/
|
230
|
-
|
231
|
-
|
232
201
|
getProperties() {
|
233
202
|
return this.metadata.properties || {};
|
234
203
|
}
|
204
|
+
|
235
205
|
/**
|
236
206
|
* Returns an object with key-value pairs of events and their metadata definitions
|
237
207
|
* @public
|
238
208
|
*/
|
239
|
-
|
240
|
-
|
241
209
|
getEvents() {
|
242
210
|
return this.metadata.events || {};
|
243
211
|
}
|
212
|
+
|
244
213
|
/**
|
245
214
|
* Determines whether this UI5 Element has any translatable texts (needs to be invalidated upon language change)
|
246
215
|
* @returns {boolean}
|
247
216
|
*/
|
248
|
-
|
249
|
-
|
250
217
|
isLanguageAware() {
|
251
218
|
return !!this.metadata.languageAware;
|
252
219
|
}
|
220
|
+
|
253
221
|
/**
|
254
222
|
* Determines whether this UI5 Element has any theme dependant carachteristics.
|
255
223
|
* @returns {boolean}
|
256
224
|
*/
|
257
|
-
|
258
|
-
|
259
225
|
isThemeAware() {
|
260
226
|
return !!this.metadata.themeAware;
|
261
227
|
}
|
228
|
+
|
262
229
|
/**
|
263
230
|
* Matches a changed entity (property/slot) with the given name against the "invalidateOnChildChange" configuration
|
264
231
|
* and determines whether this should cause and invalidation
|
@@ -268,88 +235,77 @@ sap.ui.define(["exports", "./types/DataType", "./util/isDescendantOf", "./util/S
|
|
268
235
|
* @param name the name of the property/slot that changed
|
269
236
|
* @returns {boolean}
|
270
237
|
*/
|
271
|
-
|
272
|
-
|
273
238
|
shouldInvalidateOnChildChange(slotName, type, name) {
|
274
|
-
const config = this.getSlots()[slotName].invalidateOnChildChange;
|
239
|
+
const config = this.getSlots()[slotName].invalidateOnChildChange;
|
275
240
|
|
241
|
+
// invalidateOnChildChange was not set in the slot metadata - by default child changes do not affect the component
|
276
242
|
if (config === undefined) {
|
277
243
|
return false;
|
278
|
-
}
|
279
|
-
|
244
|
+
}
|
280
245
|
|
246
|
+
// The simple format was used: invalidateOnChildChange: true/false;
|
281
247
|
if (typeof config === "boolean") {
|
282
248
|
return config;
|
283
|
-
}
|
284
|
-
|
249
|
+
}
|
285
250
|
|
251
|
+
// The complex format was used: invalidateOnChildChange: { properties, slots }
|
286
252
|
if (typeof config === "object") {
|
287
253
|
// A property was changed
|
288
254
|
if (type === "property") {
|
289
255
|
// The config object does not have a properties field
|
290
256
|
if (config.properties === undefined) {
|
291
257
|
return false;
|
292
|
-
}
|
293
|
-
|
258
|
+
}
|
294
259
|
|
260
|
+
// The config object has the short format: properties: true/false
|
295
261
|
if (typeof config.properties === "boolean") {
|
296
262
|
return config.properties;
|
297
|
-
}
|
298
|
-
|
263
|
+
}
|
299
264
|
|
265
|
+
// The config object has the complex format: properties: [...]
|
300
266
|
if (Array.isArray(config.properties)) {
|
301
267
|
return config.properties.includes(name);
|
302
268
|
}
|
303
|
-
|
304
269
|
throw new Error("Wrong format for invalidateOnChildChange.properties: boolean or array is expected");
|
305
|
-
}
|
306
|
-
|
270
|
+
}
|
307
271
|
|
272
|
+
// A slot was changed
|
308
273
|
if (type === "slot") {
|
309
274
|
// The config object does not have a slots field
|
310
275
|
if (config.slots === undefined) {
|
311
276
|
return false;
|
312
|
-
}
|
313
|
-
|
277
|
+
}
|
314
278
|
|
279
|
+
// The config object has the short format: slots: true/false
|
315
280
|
if (typeof config.slots === "boolean") {
|
316
281
|
return config.slots;
|
317
|
-
}
|
318
|
-
|
282
|
+
}
|
319
283
|
|
284
|
+
// The config object has the complex format: slots: [...]
|
320
285
|
if (Array.isArray(config.slots)) {
|
321
286
|
return config.slots.includes(name);
|
322
287
|
}
|
323
|
-
|
324
288
|
throw new Error("Wrong format for invalidateOnChildChange.slots: boolean or array is expected");
|
325
289
|
}
|
326
290
|
}
|
327
|
-
|
328
291
|
throw new Error("Wrong format for invalidateOnChildChange: boolean or object is expected");
|
329
292
|
}
|
330
|
-
|
331
293
|
}
|
332
|
-
|
333
294
|
const validateSingleProperty = (value, propData) => {
|
334
295
|
const propertyType = propData.type;
|
335
|
-
|
336
296
|
if (propertyType === Boolean) {
|
337
297
|
return typeof value === "boolean" ? value : false;
|
338
298
|
}
|
339
|
-
|
340
299
|
if (propertyType === String) {
|
341
300
|
return typeof value === "string" || typeof value === "undefined" || value === null ? value : value.toString();
|
342
301
|
}
|
343
|
-
|
344
302
|
if (propertyType === Object) {
|
345
303
|
return typeof value === "object" ? value : propData.defaultValue;
|
346
304
|
}
|
347
|
-
|
348
305
|
if ((0, _isDescendantOf.default)(propertyType, _DataType.default)) {
|
349
306
|
return propertyType.isValid(value) ? value : propData.defaultValue;
|
350
307
|
}
|
351
308
|
};
|
352
|
-
|
353
309
|
const validateSingleSlot = (value, slotData) => {
|
354
310
|
value && (0, _SlotsHelper.getSlottedElements)(value).forEach(el => {
|
355
311
|
if (!(el instanceof slotData.type)) {
|
@@ -358,7 +314,6 @@ sap.ui.define(["exports", "./types/DataType", "./util/isDescendantOf", "./util/S
|
|
358
314
|
});
|
359
315
|
return value;
|
360
316
|
};
|
361
|
-
|
362
317
|
var _default = UI5ElementMetadata;
|
363
318
|
_exports.default = _default;
|
364
319
|
});
|
@@ -6,48 +6,37 @@ sap.ui.define(["exports"], function (_exports) {
|
|
6
6
|
});
|
7
7
|
_exports.default = void 0;
|
8
8
|
const tasks = new WeakMap();
|
9
|
-
|
10
9
|
class AnimationQueue {
|
11
10
|
static get tasks() {
|
12
11
|
return tasks;
|
13
12
|
}
|
14
|
-
|
15
13
|
static enqueue(element, task) {
|
16
14
|
if (!tasks.has(element)) {
|
17
15
|
tasks.set(element, []);
|
18
16
|
}
|
19
|
-
|
20
17
|
tasks.get(element).push(task);
|
21
18
|
}
|
22
|
-
|
23
19
|
static run(element, task) {
|
24
20
|
if (!tasks.has(element)) {
|
25
21
|
tasks.set(element, []);
|
26
22
|
}
|
27
|
-
|
28
23
|
return task().then(() => {
|
29
24
|
const elementTasks = tasks.get(element);
|
30
|
-
|
31
25
|
if (elementTasks.length > 0) {
|
32
26
|
return AnimationQueue.run(element, elementTasks.shift());
|
33
27
|
}
|
34
|
-
|
35
28
|
tasks.delete(element);
|
36
29
|
});
|
37
30
|
}
|
38
|
-
|
39
31
|
static push(element, task) {
|
40
32
|
const elementTasks = tasks.get(element);
|
41
|
-
|
42
33
|
if (elementTasks) {
|
43
34
|
AnimationQueue.enqueue(element, task);
|
44
35
|
} else {
|
45
36
|
AnimationQueue.run(element, task);
|
46
37
|
}
|
47
38
|
}
|
48
|
-
|
49
39
|
}
|
50
|
-
|
51
40
|
var _default = AnimationQueue;
|
52
41
|
_exports.default = _default;
|
53
42
|
});
|
@@ -7,9 +7,7 @@ sap.ui.define(["exports", "./AnimationQueue", "./config"], function (_exports, _
|
|
7
7
|
_exports.default = void 0;
|
8
8
|
_AnimationQueue = _interopRequireDefault(_AnimationQueue);
|
9
9
|
_config = _interopRequireDefault(_config);
|
10
|
-
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
|
-
|
13
11
|
var _default = ({
|
14
12
|
beforeStart = _config.default.identity,
|
15
13
|
duration = _config.default.defaultDuration,
|
@@ -26,10 +24,8 @@ sap.ui.define(["exports", "./AnimationQueue", "./config"], function (_exports, _
|
|
26
24
|
start = start || timestamp;
|
27
25
|
const timeElapsed = timestamp - start;
|
28
26
|
const remaining = duration - timeElapsed;
|
29
|
-
|
30
27
|
if (timeElapsed <= duration) {
|
31
28
|
const progress = 1 - remaining / duration; // easing formula (currently linear)
|
32
|
-
|
33
29
|
progressCallback(progress);
|
34
30
|
animationFrame = !stopped && requestAnimationFrame(animate);
|
35
31
|
} else {
|
@@ -37,14 +33,12 @@ sap.ui.define(["exports", "./AnimationQueue", "./config"], function (_exports, _
|
|
37
33
|
resolve();
|
38
34
|
}
|
39
35
|
};
|
40
|
-
|
41
36
|
stop = () => {
|
42
37
|
stopped = true;
|
43
38
|
cancelAnimationFrame(animationFrame);
|
44
39
|
reject(new Error("animation stopped"));
|
45
40
|
};
|
46
41
|
}).catch(oReason => oReason);
|
47
|
-
|
48
42
|
_AnimationQueue.default.push(element, () => {
|
49
43
|
beforeStart();
|
50
44
|
requestAnimationFrame(animate);
|
@@ -52,12 +46,10 @@ sap.ui.define(["exports", "./AnimationQueue", "./config"], function (_exports, _
|
|
52
46
|
promise.then(() => resolve());
|
53
47
|
});
|
54
48
|
});
|
55
|
-
|
56
49
|
return {
|
57
50
|
promise: () => promise,
|
58
51
|
stop: () => stop
|
59
52
|
};
|
60
53
|
};
|
61
|
-
|
62
54
|
_exports.default = _default;
|
63
55
|
});
|
@@ -7,9 +7,7 @@ sap.ui.define(["exports", "./animate", "./config"], function (_exports, _animate
|
|
7
7
|
_exports.default = void 0;
|
8
8
|
_animate = _interopRequireDefault(_animate);
|
9
9
|
_config = _interopRequireDefault(_config);
|
10
|
-
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
|
-
|
13
11
|
var _default = ({
|
14
12
|
element = _config.default.element,
|
15
13
|
duration = _config.default.duration,
|
@@ -29,11 +27,9 @@ sap.ui.define(["exports", "./animate", "./config"], function (_exports, _animate
|
|
29
27
|
progress: progress => {
|
30
28
|
progressCallback(progress);
|
31
29
|
element.scrollLeft = scrollLeft + progress * dx; // easing - linear
|
32
|
-
|
33
30
|
element.scrollTop = scrollTop + progress * dy; // easing - linear
|
34
31
|
}
|
35
32
|
});
|
36
33
|
};
|
37
|
-
|
38
34
|
_exports.default = _default;
|
39
35
|
});
|
@@ -7,9 +7,7 @@ sap.ui.define(["exports", "./config", "./animate"], function (_exports, _config,
|
|
7
7
|
_exports.default = void 0;
|
8
8
|
_config = _interopRequireDefault(_config);
|
9
9
|
_animate = _interopRequireDefault(_animate);
|
10
|
-
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
|
-
|
13
11
|
var _default = ({
|
14
12
|
element = _config.default.element,
|
15
13
|
duration = _config.default.defaultDuration,
|
@@ -20,15 +18,17 @@ sap.ui.define(["exports", "./config", "./animate"], function (_exports, _config,
|
|
20
18
|
const animation = (0, _animate.default)({
|
21
19
|
beforeStart: () => {
|
22
20
|
// Show the element to measure its properties
|
23
|
-
element.style.display = "block";
|
21
|
+
element.style.display = "block";
|
24
22
|
|
23
|
+
// Get Computed styles
|
25
24
|
computedStyles = getComputedStyle(element);
|
26
25
|
paddingTop = parseFloat(computedStyles.paddingTop);
|
27
26
|
paddingBottom = parseFloat(computedStyles.paddingBottom);
|
28
27
|
marginTop = parseFloat(computedStyles.marginTop);
|
29
28
|
marginBottom = parseFloat(computedStyles.marginBottom);
|
30
|
-
height = parseFloat(computedStyles.height);
|
29
|
+
height = parseFloat(computedStyles.height);
|
31
30
|
|
31
|
+
// Store inline styles
|
32
32
|
storedOverflow = element.style.overflow;
|
33
33
|
storedPaddingTop = element.style.paddingTop;
|
34
34
|
storedPaddingBottom = element.style.paddingBottom;
|
@@ -44,14 +44,14 @@ sap.ui.define(["exports", "./config", "./animate"], function (_exports, _config,
|
|
44
44
|
},
|
45
45
|
duration,
|
46
46
|
element,
|
47
|
-
|
48
47
|
progress(progress) {
|
49
|
-
progressCallback(progress);
|
48
|
+
progressCallback(progress);
|
50
49
|
|
51
|
-
|
50
|
+
// WORKAROUND
|
51
|
+
element.style.display = "block";
|
52
|
+
// END OF WORKAROUND
|
52
53
|
|
53
54
|
/* eslint-disable */
|
54
|
-
|
55
55
|
element.style.paddingTop = 0 + paddingTop * progress + "px";
|
56
56
|
element.style.paddingBottom = 0 + paddingBottom * progress + "px";
|
57
57
|
element.style.marginTop = 0 + marginTop * progress + "px";
|
@@ -59,8 +59,8 @@ sap.ui.define(["exports", "./config", "./animate"], function (_exports, _config,
|
|
59
59
|
element.style.height = 0 + height * progress + "px";
|
60
60
|
/* eslint-enable */
|
61
61
|
}
|
62
|
-
|
63
62
|
});
|
63
|
+
|
64
64
|
animation.promise().then(() => {
|
65
65
|
element.style.overflow = storedOverflow;
|
66
66
|
element.style.paddingTop = storedPaddingTop;
|
@@ -71,6 +71,5 @@ sap.ui.define(["exports", "./config", "./animate"], function (_exports, _config,
|
|
71
71
|
});
|
72
72
|
return animation;
|
73
73
|
};
|
74
|
-
|
75
74
|
_exports.default = _default;
|
76
75
|
});
|
@@ -7,17 +7,16 @@ sap.ui.define(["exports", "./config", "./animate"], function (_exports, _config,
|
|
7
7
|
_exports.default = void 0;
|
8
8
|
_config = _interopRequireDefault(_config);
|
9
9
|
_animate = _interopRequireDefault(_animate);
|
10
|
-
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
|
-
|
13
11
|
var _default = ({
|
14
12
|
element = _config.default.element,
|
15
13
|
duration = _config.default.defaultDuration,
|
16
14
|
progress: progressCallback = _config.default.identity
|
17
15
|
}) => {
|
18
16
|
// Get Computed styles
|
19
|
-
let computedStyles, paddingTop, paddingBottom, marginTop, marginBottom, height;
|
17
|
+
let computedStyles, paddingTop, paddingBottom, marginTop, marginBottom, height;
|
20
18
|
|
19
|
+
// Store inline styles
|
21
20
|
let storedOverflow, storedPaddingTop, storedPaddingBottom, storedMarginTop, storedMarginBottom, storedHeight;
|
22
21
|
const animation = (0, _animate.default)({
|
23
22
|
beforeStart: () => {
|
@@ -27,8 +26,9 @@ sap.ui.define(["exports", "./config", "./animate"], function (_exports, _config,
|
|
27
26
|
paddingBottom = parseFloat(computedStyles.paddingBottom);
|
28
27
|
marginTop = parseFloat(computedStyles.marginTop);
|
29
28
|
marginBottom = parseFloat(computedStyles.marginBottom);
|
30
|
-
height = parseFloat(computedStyles.height);
|
29
|
+
height = parseFloat(computedStyles.height);
|
31
30
|
|
31
|
+
// Store inline styles
|
32
32
|
storedOverflow = element.style.overflow;
|
33
33
|
storedPaddingTop = element.style.paddingTop;
|
34
34
|
storedPaddingBottom = element.style.paddingBottom;
|
@@ -39,7 +39,6 @@ sap.ui.define(["exports", "./config", "./animate"], function (_exports, _config,
|
|
39
39
|
},
|
40
40
|
duration,
|
41
41
|
element,
|
42
|
-
|
43
42
|
progress(progress) {
|
44
43
|
progressCallback(progress);
|
45
44
|
element.style.paddingTop = `${paddingTop - paddingTop * progress}px`;
|
@@ -48,7 +47,6 @@ sap.ui.define(["exports", "./config", "./animate"], function (_exports, _config,
|
|
48
47
|
element.style.marginBottom = `${marginBottom - marginBottom * progress}px`;
|
49
48
|
element.style.height = `${height - height * progress}px`;
|
50
49
|
}
|
51
|
-
|
52
50
|
});
|
53
51
|
animation.promise().then(oReason => {
|
54
52
|
if (!(oReason instanceof Error)) {
|
@@ -63,6 +61,5 @@ sap.ui.define(["exports", "./config", "./animate"], function (_exports, _config,
|
|
63
61
|
});
|
64
62
|
return animation;
|
65
63
|
};
|
66
|
-
|
67
64
|
_exports.default = _default;
|
68
65
|
});
|