@ui5/webcomponents 0.31.21 → 0.31.22
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/Card.js +15 -26
- package/dist/api.json +1 -1
- package/dist/generated/templates/CardTemplate.lit.js +1 -1
- package/package.json +7 -7
- package/src/Card.hbs +2 -2
- package/src/Card.js +15 -26
- package/.port +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* eslint no-unused-vars: 0 */
|
|
3
3
|
import ifDefined from '@ui5/webcomponents-base/dist/renderer/ifDefined.js';
|
|
4
4
|
import { html, svg, repeat, classMap, styleMap, unsafeHTML, setTags, setSuffix } from '@ui5/webcomponents-base/dist/renderer/LitRenderer.js';
|
|
5
|
-
const block0 = (context) => { return html`<div class="${classMap(context.classes.main)}" dir="${ifDefined(context.effectiveDir)}" role="region" aria-label="${ifDefined(context.ariaLabelText)}">${ context.hasHeader ? block1(context) : undefined }<
|
|
5
|
+
const block0 = (context) => { return html`<div class="${classMap(context.classes.main)}" dir="${ifDefined(context.effectiveDir)}" role="region" aria-label="${ifDefined(context.ariaLabelText)}">${ context.hasHeader ? block1(context) : undefined }<div role="group" aria-label="${ifDefined(context.ariaCardContentLabel)}"><slot></slot></div></div>`; };
|
|
6
6
|
const block1 = (context) => { return html`<div class="${classMap(context.classes.header)}" @click="${context._headerClick}" @keydown="${context._headerKeydown}" @keyup="${context._headerKeyup}" role="${ifDefined(context.ariaHeaderRole)}" aria-labelledby="${ifDefined(context.ariaLabelledByHeader)}" aria-level="${ifDefined(context._ariaLevel)}" aria-roledescription="${ifDefined(context.ariaCardHeaderRoleDescription)}" tabindex="0">${ context.hasAvatar ? block2(context) : undefined }<div class="ui5-card-header-text">${ context.heading ? block3(context) : undefined }${ context.subheading ? block4(context) : undefined }</div>${ context.hasAction ? block5(context) : block6(context) }</div>`; };
|
|
7
7
|
const block2 = (context) => { return html`<div id="${ifDefined(context._id)}-avatar" class="ui5-card-avatar" aria-label="${ifDefined(context.ariaCardAvatarLabel)}"><slot name="avatar"></slot></div>`; };
|
|
8
8
|
const block3 = (context) => { return html`<div id="${ifDefined(context._id)}-heading" class="ui5-card-heading" part="heading">${ifDefined(context.heading)}</div>`; };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.22",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.main",
|
|
5
5
|
"ui5": {
|
|
6
6
|
"webComponentsPackage": true
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"directory": "packages/main"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@ui5/webcomponents-base": "0.31.
|
|
34
|
-
"@ui5/webcomponents-icons": "0.31.
|
|
35
|
-
"@ui5/webcomponents-ie11": "0.31.
|
|
36
|
-
"@ui5/webcomponents-localization": "0.31.
|
|
37
|
-
"@ui5/webcomponents-theme-base": "0.31.
|
|
33
|
+
"@ui5/webcomponents-base": "0.31.22",
|
|
34
|
+
"@ui5/webcomponents-icons": "0.31.22",
|
|
35
|
+
"@ui5/webcomponents-ie11": "0.31.22",
|
|
36
|
+
"@ui5/webcomponents-localization": "0.31.22",
|
|
37
|
+
"@ui5/webcomponents-theme-base": "0.31.22"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@ui5/webcomponents-tools": "0.31.
|
|
40
|
+
"@ui5/webcomponents-tools": "0.31.22",
|
|
41
41
|
"chromedriver": "88.0.0"
|
|
42
42
|
}
|
|
43
43
|
}
|
package/src/Card.hbs
CHANGED
package/src/Card.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
2
|
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
|
3
3
|
import { fetchI18nBundle, getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
4
|
-
import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AriaLabelHelper.js";
|
|
5
4
|
import { isSpace, isEnter } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
6
5
|
import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
|
|
7
6
|
import CardTemplate from "./generated/templates/CardTemplate.lit.js";
|
|
@@ -66,19 +65,6 @@ const metadata = {
|
|
|
66
65
|
action: {
|
|
67
66
|
type: HTMLElement,
|
|
68
67
|
},
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Defines the accessible name of the component, which is used as the name of the card region and should be unique per card.
|
|
72
|
-
* <b>Note:</b> <code>accessibleName</code> should be always set.
|
|
73
|
-
*
|
|
74
|
-
* @type {String}
|
|
75
|
-
* @defaultvalue ""
|
|
76
|
-
* @public
|
|
77
|
-
* @since 1.0.0-rc.16
|
|
78
|
-
*/
|
|
79
|
-
accessibleName: {
|
|
80
|
-
type: String,
|
|
81
|
-
},
|
|
82
68
|
},
|
|
83
69
|
properties: /** @lends sap.ui.webcomponents.main.Card.prototype */ {
|
|
84
70
|
|
|
@@ -127,28 +113,28 @@ const metadata = {
|
|
|
127
113
|
},
|
|
128
114
|
|
|
129
115
|
/**
|
|
130
|
-
* Defines the
|
|
116
|
+
* Defines the accessible name of the component, which is used as the name of the card region and should be unique per card.
|
|
117
|
+
* <b>Note:</b> <code>accessibleName</code> should be always set.
|
|
131
118
|
*
|
|
132
119
|
* @type {String}
|
|
133
|
-
* @since 1.0.0-rc.9
|
|
134
|
-
* @private
|
|
135
120
|
* @defaultvalue ""
|
|
121
|
+
* @public
|
|
122
|
+
* @since 1.0.0-rc.16
|
|
136
123
|
*/
|
|
137
|
-
|
|
124
|
+
accessibleName: {
|
|
138
125
|
type: String,
|
|
139
126
|
},
|
|
140
127
|
|
|
141
128
|
/**
|
|
142
|
-
*
|
|
129
|
+
* Defines the IDs of the elements that label the component.
|
|
143
130
|
*
|
|
144
131
|
* @type {String}
|
|
145
132
|
* @defaultvalue ""
|
|
146
|
-
* @
|
|
147
|
-
* @since 1.0.0-rc.
|
|
133
|
+
* @public
|
|
134
|
+
* @since 1.0.0-rc.16
|
|
148
135
|
*/
|
|
149
|
-
|
|
136
|
+
accessibleNameRef: {
|
|
150
137
|
type: String,
|
|
151
|
-
defaultValue: "",
|
|
152
138
|
},
|
|
153
139
|
|
|
154
140
|
/**
|
|
@@ -268,6 +254,9 @@ class Card extends UI5Element {
|
|
|
268
254
|
return !!(this.heading || this.subheading || this.status || this.hasAction || this.avatar);
|
|
269
255
|
}
|
|
270
256
|
|
|
257
|
+
// As in 0.31 we don't have all the accessibleNameRef, accessibleName related changes downported,
|
|
258
|
+
// we manually add getEffectiveAriaLabelText and getAriaLabelledByTexts methods and change them,
|
|
259
|
+
// so they work with accessibleName and accessibleNameRef, isntead of ariaLabel and ariaLabelledby
|
|
271
260
|
getEffectiveAriaLabelText(el) {
|
|
272
261
|
if (!el.accessibleNameRef) {
|
|
273
262
|
if (el.accessibleName) {
|
|
@@ -279,7 +268,7 @@ class Card extends UI5Element {
|
|
|
279
268
|
|
|
280
269
|
return this.getAriaLabelledByTexts(el);
|
|
281
270
|
};
|
|
282
|
-
|
|
271
|
+
|
|
283
272
|
getAriaLabelledByTexts(el, ownerDocument, readyIds = "") {
|
|
284
273
|
const ids = (readyIds && readyIds.split(" ")) || el.accessibleNameRef.split(" ");
|
|
285
274
|
const owner = ownerDocument || findNodeOwner(el);
|
|
@@ -296,9 +285,9 @@ class Card extends UI5Element {
|
|
|
296
285
|
|
|
297
286
|
return result;
|
|
298
287
|
};
|
|
299
|
-
|
|
288
|
+
|
|
300
289
|
get ariaLabelText() {
|
|
301
|
-
const effectiveAriaLabelText = getEffectiveAriaLabelText(this),
|
|
290
|
+
const effectiveAriaLabelText = this.getEffectiveAriaLabelText(this),
|
|
302
291
|
effectiveAriaLabel = effectiveAriaLabelText ? ` ${effectiveAriaLabelText}` : "";
|
|
303
292
|
return this.i18nBundle.getText(ARIA_ROLEDESCRIPTION_CARD) + effectiveAriaLabel;
|
|
304
293
|
}
|
package/.port
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8080
|