@vaadin/component-base 25.4.0-alpha6 → 25.4.0-alpha7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/component-base",
3
- "version": "25.4.0-alpha6",
3
+ "version": "25.4.0-alpha7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,11 +39,11 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@polymer/polymer": "^3.0.0",
42
- "@vaadin/chai-plugins": "25.4.0-alpha6",
43
- "@vaadin/test-runner-commands": "25.4.0-alpha6",
42
+ "@vaadin/chai-plugins": "25.4.0-alpha7",
43
+ "@vaadin/test-runner-commands": "25.4.0-alpha7",
44
44
  "@vaadin/testing-helpers": "^2.0.0",
45
45
  "sinon": "^22.0.0"
46
46
  },
47
47
  "customElements": "custom-elements.json",
48
- "gitHead": "4ead7de23a27c47e5ef4cb172481f8c54e86691a"
48
+ "gitHead": "368fb0f0df09ec6f51766d9c44047c8d7620d6bd"
49
49
  }
package/src/define.js CHANGED
@@ -13,7 +13,7 @@ function dashToCamelCase(dash) {
13
13
 
14
14
  const experimentalMap = {};
15
15
 
16
- export function defineCustomElement(CustomElement, version = '25.4.0-alpha6') {
16
+ export function defineCustomElement(CustomElement, version = '25.4.0-alpha7') {
17
17
  Object.defineProperty(CustomElement, 'version', {
18
18
  get() {
19
19
  return version;
@@ -20,3 +20,9 @@ export interface PartNameInfo {
20
20
  * if the property value is truthy, and removed if the value is falsy.
21
21
  */
22
22
  export declare function partMap(partNameInfo: PartNameInfo): DirectiveResult;
23
+
24
+ /**
25
+ * Parses a whitespace separated list of part names
26
+ * into an object accepted by the `partMap` directive.
27
+ */
28
+ export declare function parsePartNames(partName: string | null | undefined): Record<string, boolean>;
@@ -84,3 +84,19 @@ class PartMapDirective extends Directive {
84
84
  * if the property value is truthy, and removed if the value is falsy.
85
85
  */
86
86
  export const partMap = directive(PartMapDirective);
87
+
88
+ /**
89
+ * Parses a whitespace separated list of part names
90
+ * into an object accepted by the `partMap` directive.
91
+ *
92
+ * @param {string | null | undefined} partName
93
+ * @return {Record<string, boolean>}
94
+ */
95
+ export function parsePartNames(partName) {
96
+ return Object.fromEntries(
97
+ (partName || '')
98
+ .split(/\s+/u)
99
+ .filter((name) => name !== '')
100
+ .map((name) => [name, true]),
101
+ );
102
+ }