wj-elements 0.1.144 → 0.1.145
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/dist/packages/utils/permissions-api.d.ts +2 -2
- package/dist/packages/wje-accordion/accordion.element.d.ts +2 -2
- package/dist/packages/wje-accordion/accordion.test.d.ts +0 -0
- package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +1 -1
- package/dist/packages/wje-animation/animation.element.d.ts +1 -1
- package/dist/packages/wje-aside/aside.element.d.ts +1 -1
- package/dist/packages/wje-avatar/avatar.element.d.ts +33 -0
- package/dist/packages/wje-avatar/avatar.test.d.ts +1 -0
- package/dist/packages/wje-badge/badge.element.d.ts +1 -1
- package/dist/packages/wje-breadcrumb/breadcrumb.element.d.ts +2 -2
- package/dist/packages/wje-breadcrumbs/breadcrumbs.element.d.ts +3 -3
- package/dist/packages/wje-button/button.element.d.ts +5 -5
- package/dist/packages/wje-button-group/button-group.element.d.ts +2 -2
- package/dist/packages/wje-card/card.element.d.ts +1 -1
- package/dist/packages/wje-card-content/card-content.element.d.ts +1 -1
- package/dist/packages/wje-card-controls/card-controls.element.d.ts +1 -1
- package/dist/packages/wje-card-header/card-header.element.d.ts +1 -1
- package/dist/packages/wje-card-subtitle/card-subtitle.element.d.ts +1 -1
- package/dist/packages/wje-card-title/card-title.element.d.ts +1 -1
- package/dist/packages/wje-carousel/carousel.element.d.ts +2 -2
- package/dist/packages/wje-color-picker/color-picker.element.d.ts +4 -4
- package/dist/packages/wje-color-picker/color-picker.test.d.ts +1 -0
- package/dist/packages/wje-container/container.element.d.ts +1 -1
- package/dist/packages/wje-dialog/dialog.element.d.ts +2 -2
- package/dist/packages/wje-dropdown/dropdown.element.d.ts +2 -2
- package/dist/packages/wje-element/element.d.ts +2 -2
- package/dist/packages/wje-file-upload/file-upload.element.d.ts +2 -2
- package/dist/packages/wje-file-upload-item/file-upload-item.element.d.ts +1 -1
- package/dist/packages/wje-footer/footer.element.d.ts +1 -1
- package/dist/packages/wje-format-digital/format-digital.element.d.ts +1 -1
- package/dist/packages/wje-header/header.element.d.ts +1 -1
- package/dist/packages/wje-icon/icon.element.d.ts +1 -1
- package/dist/packages/wje-icon-picker/icon-picker.element.d.ts +1 -1
- package/dist/packages/wje-img/img.element.d.ts +4 -4
- package/dist/packages/wje-img-comparer/img-comparer.element.d.ts +1 -1
- package/dist/packages/wje-infinite-scroll/infinite-scroll.element.d.ts +3 -3
- package/dist/packages/wje-input-file/input-file.element.d.ts +1 -1
- package/dist/packages/wje-item/item.element.d.ts +1 -1
- package/dist/packages/wje-kanban/kanban.element.d.ts +3 -3
- package/dist/packages/wje-label/label.element.d.ts +1 -1
- package/dist/packages/wje-level-indicator/level-indicator.element.d.ts +2 -2
- package/dist/packages/wje-main/main.element.d.ts +1 -1
- package/dist/packages/wje-menu/menu.element.d.ts +1 -1
- package/dist/packages/wje-menu-button/menu-button.element.d.ts +1 -1
- package/dist/packages/wje-menu-label/menu-label.element.d.ts +1 -1
- package/dist/packages/wje-option/option.element.d.ts +1 -1
- package/dist/packages/wje-options/options.element.d.ts +1 -1
- package/dist/packages/wje-pagination/pagination.element.d.ts +5 -5
- package/dist/packages/wje-popup/popup.element.d.ts +1 -1
- package/dist/packages/wje-progress-bar/progress-bar.element.d.ts +1 -1
- package/dist/packages/wje-radio/radio.element.d.ts +1 -1
- package/dist/packages/wje-rate/rate.element.d.ts +3 -3
- package/dist/packages/wje-relative-time/relative-time.element.d.ts +1 -1
- package/dist/packages/wje-reorder/reorder.element.d.ts +1 -1
- package/dist/packages/wje-route/route.element.d.ts +1 -1
- package/dist/packages/wje-router/router.element.d.ts +1 -1
- package/dist/packages/wje-router-link/router-link.element.d.ts +1 -1
- package/dist/packages/wje-select/select.element.d.ts +2 -2
- package/dist/packages/wje-slider/slider.element.d.ts +1 -1
- package/dist/packages/wje-split-view/split-view.element.d.ts +1 -1
- package/dist/packages/wje-textarea/textarea.element.d.ts +1 -1
- package/dist/packages/wje-tree-item/tree-item.element.d.ts +2 -2
- package/dist/wje-avatar.js +46 -1
- package/dist/wje-avatar.js.map +1 -1
- package/package.json +2 -1
|
@@ -4,12 +4,12 @@ export class WjePermissionsApi {
|
|
|
4
4
|
* Sets the permission key.
|
|
5
5
|
* @param value
|
|
6
6
|
*/
|
|
7
|
-
static set permissionKey(value: any
|
|
7
|
+
static set permissionKey(value: any);
|
|
8
8
|
/**
|
|
9
9
|
* Returns the permission key.
|
|
10
10
|
* @returns {*|string}
|
|
11
11
|
*/
|
|
12
|
-
static get permissionKey(): any
|
|
12
|
+
static get permissionKey(): any;
|
|
13
13
|
/**
|
|
14
14
|
* Sets the permissions.
|
|
15
15
|
* @param value
|
|
@@ -17,7 +17,7 @@ export default class Accordion extends WJElement {
|
|
|
17
17
|
* Getter for the CSS stylesheet.
|
|
18
18
|
* @returns {object} The styles for the Accordion element.
|
|
19
19
|
*/
|
|
20
|
-
static get cssStyleSheet():
|
|
20
|
+
static get cssStyleSheet(): any;
|
|
21
21
|
/**
|
|
22
22
|
* Getter for the observed attributes.
|
|
23
23
|
* @returns {Array} An array containing the name of the observed attribute.
|
|
@@ -39,7 +39,7 @@ export default class Accordion extends WJElement {
|
|
|
39
39
|
* Sets the value of the `index` attribute.
|
|
40
40
|
* @param {number|string} value The value to set for the `index` attribute.
|
|
41
41
|
*/
|
|
42
|
-
set index(value: number
|
|
42
|
+
set index(value: number);
|
|
43
43
|
/**
|
|
44
44
|
* Retrieves the value of the `index` attribute as a number.
|
|
45
45
|
* @returns {number} The numerical value of the `index` attribute, or `0` if the attribute is not set.
|
|
File without changes
|
|
@@ -12,7 +12,7 @@ export default class AccordionItem extends WJElement {
|
|
|
12
12
|
* Getter for the CSS stylesheet.
|
|
13
13
|
* @returns {object} The styles for the Accordion Item element.
|
|
14
14
|
*/
|
|
15
|
-
static get cssStyleSheet():
|
|
15
|
+
static get cssStyleSheet(): any;
|
|
16
16
|
/**
|
|
17
17
|
* Getter for the observed attributes.
|
|
18
18
|
* @returns {Array} An array containing the name of the observed attribute.
|
|
@@ -13,7 +13,7 @@ export default class Animation extends WJElement {
|
|
|
13
13
|
* Getter for the CSS stylesheet.
|
|
14
14
|
* @returns {object} The styles for the Animation element.
|
|
15
15
|
*/
|
|
16
|
-
static get cssStyleSheet():
|
|
16
|
+
static get cssStyleSheet(): any;
|
|
17
17
|
/**
|
|
18
18
|
* Getter for the observed attributes.
|
|
19
19
|
* @returns {Array} An array containing the name of the observed attribute.
|
|
@@ -17,7 +17,7 @@ export default class Aside extends WJElement {
|
|
|
17
17
|
* Getter for the CSS stylesheet.
|
|
18
18
|
* @returns {object} The styles for the Aside element.
|
|
19
19
|
*/
|
|
20
|
-
static get cssStyleSheet():
|
|
20
|
+
static get cssStyleSheet(): any;
|
|
21
21
|
/**
|
|
22
22
|
* Getter for the observed attributes.
|
|
23
23
|
* @returns {Array} An empty array as there are no observed attributes.
|
|
@@ -24,6 +24,39 @@ export default class Avatar extends WJElement {
|
|
|
24
24
|
* @returns {string} styles
|
|
25
25
|
*/
|
|
26
26
|
static get cssStyleSheet(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Sets the value of the 'label' attribute for the element.
|
|
29
|
+
* @param {string} value The new value to be set for the 'label' attribute.
|
|
30
|
+
*/
|
|
31
|
+
set label(value: string);
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves the value of the 'label' attribute for the element.
|
|
34
|
+
* If the attribute is not set, it defaults to an empty string.
|
|
35
|
+
* @returns {string} The value of the 'label' attribute or an empty string if not defined.
|
|
36
|
+
*/
|
|
37
|
+
get label(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Sets the value of initials for the element by updating
|
|
40
|
+
* the 'initials' attribute with the provided value.
|
|
41
|
+
* @param {string} value The value to be set as the initials.
|
|
42
|
+
*/
|
|
43
|
+
set initials(value: boolean);
|
|
44
|
+
/**
|
|
45
|
+
* Retrieves the value of the 'initials' attribute if it exists.
|
|
46
|
+
* @returns {boolean} Returns true if the 'initials' attribute is present, otherwise false.
|
|
47
|
+
*/
|
|
48
|
+
get initials(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Sets the size attribute for the element.
|
|
51
|
+
* @param {string | number} value The value to set for the size attribute.
|
|
52
|
+
*/
|
|
53
|
+
set size(value: string);
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves the size attribute of the element. If the size attribute
|
|
56
|
+
* is not defined, it returns the default value 'medium'.
|
|
57
|
+
* @returns {string} The size value of the element or 'medium' if not specified.
|
|
58
|
+
*/
|
|
59
|
+
get size(): string;
|
|
27
60
|
/**
|
|
28
61
|
* Method to draw the avatar element and return a document fragment.
|
|
29
62
|
* @returns {object} fragment - The document fragment
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,7 +26,7 @@ export default class Badge extends WJElement {
|
|
|
26
26
|
* return ['color'];
|
|
27
27
|
* }
|
|
28
28
|
*/
|
|
29
|
-
static get observedAttributes():
|
|
29
|
+
static get observedAttributes(): string[];
|
|
30
30
|
/**
|
|
31
31
|
* Creates the DOM structure for the Badge element.
|
|
32
32
|
* @returns {DocumentFragment} A document fragment containing the Badge's structure.
|
|
@@ -20,13 +20,13 @@ export default class Breadcrumb extends WJElement {
|
|
|
20
20
|
* @static
|
|
21
21
|
* @returns {object} styles - The CSS styles
|
|
22
22
|
*/
|
|
23
|
-
static get cssStyleSheet():
|
|
23
|
+
static get cssStyleSheet(): any;
|
|
24
24
|
/**
|
|
25
25
|
* Get observed attributes for the Breadcrumb element.
|
|
26
26
|
* @static
|
|
27
27
|
* @returns {Array<string>} - The observed attributes array for the Breadcrumb element.
|
|
28
28
|
*/
|
|
29
|
-
static get observedAttributes():
|
|
29
|
+
static get observedAttributes(): string[];
|
|
30
30
|
_showSeparator: boolean;
|
|
31
31
|
showCollapsedIndicator: boolean;
|
|
32
32
|
/**
|
|
@@ -28,13 +28,13 @@ export default class Breadcrumbs extends WJElement {
|
|
|
28
28
|
* @static
|
|
29
29
|
* @returns {object} styles - The CSS styles
|
|
30
30
|
*/
|
|
31
|
-
static get cssStyleSheet():
|
|
31
|
+
static get cssStyleSheet(): any;
|
|
32
32
|
/**
|
|
33
33
|
* Get observed attributes for the Breadcrumb element.
|
|
34
34
|
* @static
|
|
35
35
|
* @returns {Array<string>} - The observed attributes array for the Breadcrumb element.
|
|
36
36
|
*/
|
|
37
|
-
static get observedAttributes():
|
|
37
|
+
static get observedAttributes(): string[];
|
|
38
38
|
/**
|
|
39
39
|
* Last breadcrumb flag
|
|
40
40
|
* @type {boolean}
|
|
@@ -54,7 +54,7 @@ export default class Breadcrumbs extends WJElement {
|
|
|
54
54
|
* Get items before collapse attribute.
|
|
55
55
|
* @param {string} value
|
|
56
56
|
*/
|
|
57
|
-
set maxItems(value:
|
|
57
|
+
set maxItems(value: number);
|
|
58
58
|
/**
|
|
59
59
|
* Get items before collapse attribute.
|
|
60
60
|
* @returns {number}
|
|
@@ -33,7 +33,7 @@ export default class Button extends WJElement {
|
|
|
33
33
|
* @static
|
|
34
34
|
* @returns {Array<string>} observedAttributes - The observed attributes array for the Button element.
|
|
35
35
|
*/
|
|
36
|
-
static get observedAttributes():
|
|
36
|
+
static get observedAttributes(): string[];
|
|
37
37
|
/**
|
|
38
38
|
* @summary A static property that indicates whether the custom element is form-associated or not.
|
|
39
39
|
* Form-associated custom elements are elements that can participate in form submission.
|
|
@@ -50,12 +50,12 @@ export default class Button extends WJElement {
|
|
|
50
50
|
* Properties of the element Button.
|
|
51
51
|
* @param value
|
|
52
52
|
*/
|
|
53
|
-
set color(value: string
|
|
53
|
+
set color(value: string);
|
|
54
54
|
/**
|
|
55
55
|
* Get color of the Button element.
|
|
56
56
|
* @returns {string|string}
|
|
57
57
|
*/
|
|
58
|
-
get color(): string
|
|
58
|
+
get color(): string;
|
|
59
59
|
/**
|
|
60
60
|
* Set variant of the Button element.
|
|
61
61
|
* @param value
|
|
@@ -80,12 +80,12 @@ export default class Button extends WJElement {
|
|
|
80
80
|
* Set variant of the Button element.
|
|
81
81
|
* @param value
|
|
82
82
|
*/
|
|
83
|
-
set dialog(value:
|
|
83
|
+
set dialog(value: any);
|
|
84
84
|
/**
|
|
85
85
|
* Get variant of the Button element.
|
|
86
86
|
* @returns {string|object}
|
|
87
87
|
*/
|
|
88
|
-
get dialog():
|
|
88
|
+
get dialog(): any;
|
|
89
89
|
/**
|
|
90
90
|
* Set active state of the Button element.
|
|
91
91
|
* @param {boolean} value The value to set
|
|
@@ -13,13 +13,13 @@ export default class ButtonGroup extends WJElement {
|
|
|
13
13
|
* @static
|
|
14
14
|
* @returns {object} styles - The CSS styles
|
|
15
15
|
*/
|
|
16
|
-
static get cssStyleSheet():
|
|
16
|
+
static get cssStyleSheet(): any;
|
|
17
17
|
/**
|
|
18
18
|
* Get observed attributes for the ButtonGroup element.
|
|
19
19
|
* @static
|
|
20
20
|
* @returns {Array<string>} observedAttributes - The observed attributes array
|
|
21
21
|
*/
|
|
22
|
-
static get observedAttributes():
|
|
22
|
+
static get observedAttributes(): string[];
|
|
23
23
|
/**
|
|
24
24
|
* Draw method for the ButtonGroup element.
|
|
25
25
|
* @returns {object} fragment - The document fragment
|
|
@@ -17,7 +17,7 @@ export default class Card extends WJElement {
|
|
|
17
17
|
* @static
|
|
18
18
|
* @returns {object} styles - The CSS styles
|
|
19
19
|
*/
|
|
20
|
-
static get cssStyleSheet():
|
|
20
|
+
static get cssStyleSheet(): any;
|
|
21
21
|
/**
|
|
22
22
|
* Draw method for the Card element.
|
|
23
23
|
* @param {object} context The context object
|
|
@@ -13,7 +13,7 @@ export default class CardContent extends WJElement {
|
|
|
13
13
|
* @static
|
|
14
14
|
* @returns {object} styles - The CSS styles for the CardContent element.
|
|
15
15
|
*/
|
|
16
|
-
static get cssStyleSheet():
|
|
16
|
+
static get cssStyleSheet(): any;
|
|
17
17
|
/**
|
|
18
18
|
* Draw method for the CardContent element.
|
|
19
19
|
* @returns {object} fragment - The document fragment containing the drawn element.
|
|
@@ -14,7 +14,7 @@ export default class CardControls extends WJElement {
|
|
|
14
14
|
* @static
|
|
15
15
|
* @returns {object} styles - The CSS styles
|
|
16
16
|
*/
|
|
17
|
-
static get cssStyleSheet():
|
|
17
|
+
static get cssStyleSheet(): any;
|
|
18
18
|
/**
|
|
19
19
|
* Draw method for the CardControls element.
|
|
20
20
|
* @returns {object} fragment - The document fragment
|
|
@@ -13,7 +13,7 @@ export default class CardHeader extends WJElement {
|
|
|
13
13
|
* @returns {object} The styles object.
|
|
14
14
|
* @static
|
|
15
15
|
*/
|
|
16
|
-
static get cssStyleSheet():
|
|
16
|
+
static get cssStyleSheet(): any;
|
|
17
17
|
/**
|
|
18
18
|
* Draws the CardHeader.
|
|
19
19
|
* @returns {DocumentFragment} The created document fragment.
|
|
@@ -15,7 +15,7 @@ export default class CardSubtitle extends WJElement {
|
|
|
15
15
|
* @returns {object} The styles object.
|
|
16
16
|
* @static
|
|
17
17
|
*/
|
|
18
|
-
static get cssStyleSheet():
|
|
18
|
+
static get cssStyleSheet(): any;
|
|
19
19
|
/**
|
|
20
20
|
* Getter for the observed attributes.
|
|
21
21
|
* @returns {Array} An empty array.
|
|
@@ -17,7 +17,7 @@ export default class CardTitle extends WJElement {
|
|
|
17
17
|
* @returns {object} The styles object.
|
|
18
18
|
* @static
|
|
19
19
|
*/
|
|
20
|
-
static get cssStyleSheet():
|
|
20
|
+
static get cssStyleSheet(): any;
|
|
21
21
|
/**
|
|
22
22
|
* Getter for the observed attributes.
|
|
23
23
|
* @returns {Array} An empty array.
|
|
@@ -23,12 +23,12 @@ export default class Carousel extends WJElement {
|
|
|
23
23
|
* Active slide attribute.
|
|
24
24
|
* @param value
|
|
25
25
|
*/
|
|
26
|
-
set activeSlide(value: number
|
|
26
|
+
set activeSlide(value: number);
|
|
27
27
|
/**
|
|
28
28
|
* Active slide attribute.
|
|
29
29
|
* @returns {number|number}
|
|
30
30
|
*/
|
|
31
|
-
get activeSlide(): number
|
|
31
|
+
get activeSlide(): number;
|
|
32
32
|
/**
|
|
33
33
|
* Pagination attribute.
|
|
34
34
|
* @returns {boolean}
|
|
@@ -27,7 +27,7 @@ export default class ColorPicker extends WJElement {
|
|
|
27
27
|
* @returns {object} The styles object.
|
|
28
28
|
* @static
|
|
29
29
|
*/
|
|
30
|
-
static get cssStyleSheet():
|
|
30
|
+
static get cssStyleSheet(): any;
|
|
31
31
|
/**
|
|
32
32
|
* Getter for the observed attributes.
|
|
33
33
|
* @returns {Array} An empty array.
|
|
@@ -50,17 +50,17 @@ export default class ColorPicker extends WJElement {
|
|
|
50
50
|
* Setter for the marker position.
|
|
51
51
|
* @param {object} value The new marker position.
|
|
52
52
|
*/
|
|
53
|
-
set markerPosition(value:
|
|
53
|
+
set markerPosition(value: any);
|
|
54
54
|
/**
|
|
55
55
|
* Getter for the marker position.
|
|
56
56
|
* @returns {object} The current marker position.
|
|
57
57
|
*/
|
|
58
|
-
get markerPosition():
|
|
58
|
+
get markerPosition(): any;
|
|
59
59
|
/**
|
|
60
60
|
* Setter for the color swatches.
|
|
61
61
|
* @param {string} value The new color swatches.
|
|
62
62
|
*/
|
|
63
|
-
set swatches(value:
|
|
63
|
+
set swatches(value: any[]);
|
|
64
64
|
/**
|
|
65
65
|
* Getter for the color swatches.
|
|
66
66
|
* @returns {Array} The current color swatches.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,7 +16,7 @@ export default class Container extends WJElement {
|
|
|
16
16
|
* @returns {object} The styles object.
|
|
17
17
|
* @static
|
|
18
18
|
*/
|
|
19
|
-
static get cssStyleSheet():
|
|
19
|
+
static get cssStyleSheet(): any;
|
|
20
20
|
/**
|
|
21
21
|
* Getter for the observed attributes.
|
|
22
22
|
* @returns {Array} An empty array.
|
|
@@ -35,12 +35,12 @@ export default class Dialog extends WJElement {
|
|
|
35
35
|
* Sets the headline of the dialog.
|
|
36
36
|
* @param value
|
|
37
37
|
*/
|
|
38
|
-
set placement(value: string
|
|
38
|
+
set placement(value: string);
|
|
39
39
|
/**
|
|
40
40
|
* Gets the headline of the dialog.
|
|
41
41
|
* @returns {string|string}
|
|
42
42
|
*/
|
|
43
|
-
get placement(): string
|
|
43
|
+
get placement(): string;
|
|
44
44
|
/**
|
|
45
45
|
* Sets the headline of the dialog.
|
|
46
46
|
* @param value
|
|
@@ -30,12 +30,12 @@ export default class Dropdown extends WJElement {
|
|
|
30
30
|
* Sets the placement of the dropdown.
|
|
31
31
|
* @param value
|
|
32
32
|
*/
|
|
33
|
-
set trigger(value: string
|
|
33
|
+
set trigger(value: string);
|
|
34
34
|
/**
|
|
35
35
|
* Gets the placement of the dropdown.
|
|
36
36
|
* @returns {string|string}
|
|
37
37
|
*/
|
|
38
|
-
get trigger(): string
|
|
38
|
+
get trigger(): string;
|
|
39
39
|
/**
|
|
40
40
|
* Callback function to handle other dropdowns being opened. Close the dropdown if it is not the target and collapse is enabled.
|
|
41
41
|
* @param {Event} e The event object.
|
|
@@ -88,12 +88,12 @@ export default class WJElement extends HTMLElement {
|
|
|
88
88
|
* Gets the rendering context, either the shadow root or the component itself.
|
|
89
89
|
* @returns The rendering context.
|
|
90
90
|
*/
|
|
91
|
-
get context():
|
|
91
|
+
get context(): any;
|
|
92
92
|
/**
|
|
93
93
|
* Gets the store instance.
|
|
94
94
|
* @returns {object} The store instance.
|
|
95
95
|
*/
|
|
96
|
-
get store():
|
|
96
|
+
get store(): any;
|
|
97
97
|
/**
|
|
98
98
|
* @typedef {object} ArrayActions
|
|
99
99
|
* @property {Function} addAction - Adds an item to the array.
|
|
@@ -83,12 +83,12 @@ export default class FileUpload extends WJElement {
|
|
|
83
83
|
* Sets the autoProcessFiles attribute.
|
|
84
84
|
* @param value
|
|
85
85
|
*/
|
|
86
|
-
set autoProcessFiles(value: any
|
|
86
|
+
set autoProcessFiles(value: any);
|
|
87
87
|
/**
|
|
88
88
|
* Gets the autoProcessFiles attribute.
|
|
89
89
|
* @returns {any|boolean}
|
|
90
90
|
*/
|
|
91
|
-
get autoProcessFiles(): any
|
|
91
|
+
get autoProcessFiles(): any;
|
|
92
92
|
/**
|
|
93
93
|
* Sets the noUploadButton attribute.
|
|
94
94
|
* @param value
|
|
@@ -29,7 +29,7 @@ export default class FileUploadItem extends WJElement {
|
|
|
29
29
|
* @static
|
|
30
30
|
* @returns {Array<string>}
|
|
31
31
|
*/
|
|
32
|
-
static get observedAttributes():
|
|
32
|
+
static get observedAttributes(): string[];
|
|
33
33
|
localizer: Localizer;
|
|
34
34
|
set size(value: string);
|
|
35
35
|
get size(): string;
|
|
@@ -34,7 +34,7 @@ export default class FormatDigital extends WJElement {
|
|
|
34
34
|
* @static
|
|
35
35
|
* @returns {Array<string>} - The attributes to observe.
|
|
36
36
|
*/
|
|
37
|
-
static get observedAttributes():
|
|
37
|
+
static get observedAttributes(): string[];
|
|
38
38
|
localizer: Localizer;
|
|
39
39
|
/**
|
|
40
40
|
* Sets the value of the digital format.
|
|
@@ -22,7 +22,7 @@ export default class Icon extends WJElement {
|
|
|
22
22
|
* @static
|
|
23
23
|
* @returns {Array<string>}
|
|
24
24
|
*/
|
|
25
|
-
static get observedAttributes():
|
|
25
|
+
static get observedAttributes(): string[];
|
|
26
26
|
/**
|
|
27
27
|
* Draws the component.
|
|
28
28
|
* @param {object} context The context for drawing.
|
|
@@ -36,7 +36,7 @@ export default class IconPicker extends WJElement {
|
|
|
36
36
|
* @static
|
|
37
37
|
* @returns {Array<string>}
|
|
38
38
|
*/
|
|
39
|
-
static get observedAttributes():
|
|
39
|
+
static get observedAttributes(): string[];
|
|
40
40
|
/**
|
|
41
41
|
* Dependencies of the IconPicker component.
|
|
42
42
|
* @property {object} dependencies
|
|
@@ -24,7 +24,7 @@ export default class Img extends WJElement {
|
|
|
24
24
|
* @static
|
|
25
25
|
* @returns {Array<string>}
|
|
26
26
|
*/
|
|
27
|
-
static get observedAttributes():
|
|
27
|
+
static get observedAttributes(): string[];
|
|
28
28
|
_fallout: boolean;
|
|
29
29
|
actions: {
|
|
30
30
|
delete: () => void;
|
|
@@ -35,12 +35,12 @@ export default class Img extends WJElement {
|
|
|
35
35
|
* otherwise, assigns the value to the `_fallout` property.
|
|
36
36
|
* @param {string|*} value The value to set for the fallout property. If a string, it will update the `fallout` attribute; for other types, it will assign it to the `_fallout` property.
|
|
37
37
|
*/
|
|
38
|
-
set fallout(value: string
|
|
38
|
+
set fallout(value: string);
|
|
39
39
|
/**
|
|
40
40
|
* Retrieves the value of the 'fallout' attribute if it exists, otherwise returns the internal `_fallout` property.
|
|
41
41
|
* @returns {string|null} The value of the 'fallout' attribute or the `_fallout` property if the attribute is not present. Returns null if no value is found.
|
|
42
42
|
*/
|
|
43
|
-
get fallout(): string
|
|
43
|
+
get fallout(): string;
|
|
44
44
|
/**
|
|
45
45
|
* Sets the value of the loader attribute.
|
|
46
46
|
* @param {string} value The value to set for the loader attribute.
|
|
@@ -50,7 +50,7 @@ export default class Img extends WJElement {
|
|
|
50
50
|
* Retrieves the value of the 'loader' attribute from the element.
|
|
51
51
|
* @returns {string|null} The value of the 'loader' attribute if set, otherwise null.
|
|
52
52
|
*/
|
|
53
|
-
get loader(): string
|
|
53
|
+
get loader(): string;
|
|
54
54
|
/**
|
|
55
55
|
* Creates and assembles a lazy-loaded image element within a document fragment.
|
|
56
56
|
* @returns {DocumentFragment} A document fragment containing the image element.
|
|
@@ -29,7 +29,7 @@ export default class ImgComparer extends WJElement {
|
|
|
29
29
|
* @static
|
|
30
30
|
* @returns {Array<string>}
|
|
31
31
|
*/
|
|
32
|
-
static get observedAttributes():
|
|
32
|
+
static get observedAttributes(): string[];
|
|
33
33
|
/**
|
|
34
34
|
* Dependencies of the ImgComparer component.
|
|
35
35
|
* @property {object} dependencies
|
|
@@ -25,7 +25,7 @@ export default class InfiniteScroll extends WJElement {
|
|
|
25
25
|
* @static
|
|
26
26
|
* @returns {Array<string>}
|
|
27
27
|
*/
|
|
28
|
-
static get observedAttributes():
|
|
28
|
+
static get observedAttributes(): string[];
|
|
29
29
|
totalPages: number;
|
|
30
30
|
isLoading: any[];
|
|
31
31
|
_response: {};
|
|
@@ -47,12 +47,12 @@ export default class InfiniteScroll extends WJElement {
|
|
|
47
47
|
* Dependencies of the InfiniteScroll component.
|
|
48
48
|
* @param value
|
|
49
49
|
*/
|
|
50
|
-
set response(value: any
|
|
50
|
+
set response(value: any);
|
|
51
51
|
/**
|
|
52
52
|
* Getter for the response property.
|
|
53
53
|
* @returns {*|{}}
|
|
54
54
|
*/
|
|
55
|
-
get response(): any
|
|
55
|
+
get response(): any;
|
|
56
56
|
/**
|
|
57
57
|
* Dependencies of the InfiniteScroll component.
|
|
58
58
|
* @param value
|
|
@@ -24,7 +24,7 @@ export default class Kanban extends WJElement {
|
|
|
24
24
|
* @static
|
|
25
25
|
* @returns {Array<string>}
|
|
26
26
|
*/
|
|
27
|
-
static get observedAttributes():
|
|
27
|
+
static get observedAttributes(): string[];
|
|
28
28
|
totalPages: number;
|
|
29
29
|
isLoading: any[];
|
|
30
30
|
_response: {};
|
|
@@ -41,12 +41,12 @@ export default class Kanban extends WJElement {
|
|
|
41
41
|
* Sets the URL for fetching data.
|
|
42
42
|
* @param value {string}
|
|
43
43
|
*/
|
|
44
|
-
set response(value:
|
|
44
|
+
set response(value: any);
|
|
45
45
|
/**
|
|
46
46
|
* Gets the URL for fetching data.
|
|
47
47
|
* @returns {*|{}|{}}
|
|
48
48
|
*/
|
|
49
|
-
get response(): any
|
|
49
|
+
get response(): any;
|
|
50
50
|
/**
|
|
51
51
|
* Sets the URL for fetching data.
|
|
52
52
|
* @param value {array}
|
|
@@ -20,7 +20,7 @@ export default class LevelIndicator extends WJElement {
|
|
|
20
20
|
* Sets the level attribute for an instance.
|
|
21
21
|
* @param {string} value The value to set for the 'level' attribute.
|
|
22
22
|
*/
|
|
23
|
-
set level(value:
|
|
23
|
+
set level(value: number);
|
|
24
24
|
/**
|
|
25
25
|
* Retrieves the level attribute of an element, with validation to ensure
|
|
26
26
|
* it is within the range of 0 to 3. If the level attribute is not present,
|
|
@@ -33,7 +33,7 @@ export default class LevelIndicator extends WJElement {
|
|
|
33
33
|
* Sets the value of the "bars" attribute.
|
|
34
34
|
* @param {string} value The value to set for the "bars" attribute.
|
|
35
35
|
*/
|
|
36
|
-
set bars(value:
|
|
36
|
+
set bars(value: number);
|
|
37
37
|
/**
|
|
38
38
|
* Retrieves the value of the "bars" attribute, parses it as an integer,
|
|
39
39
|
* and ensures it is at least 1. If the attribute is not set, defaults to 3.
|
|
@@ -21,7 +21,7 @@ export default class Main extends WJElement {
|
|
|
21
21
|
* @static
|
|
22
22
|
* @returns {Array<string>}
|
|
23
23
|
*/
|
|
24
|
-
static get observedAttributes():
|
|
24
|
+
static get observedAttributes(): string[];
|
|
25
25
|
/**
|
|
26
26
|
* Draws the component for the main section.
|
|
27
27
|
* @returns {DocumentFragment}
|
|
@@ -34,7 +34,7 @@ export default class Menu extends WJElement {
|
|
|
34
34
|
* @static
|
|
35
35
|
* @returns {Array<string>}
|
|
36
36
|
*/
|
|
37
|
-
static get observedAttributes():
|
|
37
|
+
static get observedAttributes(): string[];
|
|
38
38
|
/**
|
|
39
39
|
* Draws the component for the menu.
|
|
40
40
|
* @returns {DocumentFragment}
|
|
@@ -21,7 +21,7 @@ export default class MenuButton extends WJElement {
|
|
|
21
21
|
* @static
|
|
22
22
|
* @returns {Array<string>}
|
|
23
23
|
*/
|
|
24
|
-
static get observedAttributes():
|
|
24
|
+
static get observedAttributes(): string[];
|
|
25
25
|
/**
|
|
26
26
|
* Draws the component for the menu button.
|
|
27
27
|
* @returns {DocumentFragment}
|
|
@@ -29,7 +29,7 @@ export default class MenuLabel extends WJElement {
|
|
|
29
29
|
* @static
|
|
30
30
|
* @returns {Array<string>}
|
|
31
31
|
*/
|
|
32
|
-
static get observedAttributes():
|
|
32
|
+
static get observedAttributes(): string[];
|
|
33
33
|
hasSubmenu: boolean;
|
|
34
34
|
/**
|
|
35
35
|
* Draws the component for the menu label.
|
|
@@ -18,7 +18,7 @@ export default class Options extends WJElement {
|
|
|
18
18
|
* @static
|
|
19
19
|
* @returns {Array<string>}
|
|
20
20
|
*/
|
|
21
|
-
static get observedAttributes():
|
|
21
|
+
static get observedAttributes(): string[];
|
|
22
22
|
_loadedOptions: any[];
|
|
23
23
|
dependencies: {
|
|
24
24
|
'wje-option': typeof Option;
|
|
@@ -26,7 +26,7 @@ export default class Pagination extends WJElement {
|
|
|
26
26
|
* Sets the value of the 'page' attribute for the object.
|
|
27
27
|
* @param {string} value The value to set for the 'page' attribute.
|
|
28
28
|
*/
|
|
29
|
-
set page(value:
|
|
29
|
+
set page(value: number);
|
|
30
30
|
/**
|
|
31
31
|
* Retrieves the current page number as a numeric value.
|
|
32
32
|
* @returns {number} The current page number. Returns 0 if the attribute 'page' is not set or is not a numeric value.
|
|
@@ -37,7 +37,7 @@ export default class Pagination extends WJElement {
|
|
|
37
37
|
* Updates the 'max-pages' attribute with the provided value.
|
|
38
38
|
* @param {number|string} value The maximum number of pages to set. Can be a number or a parsable string representing a number.
|
|
39
39
|
*/
|
|
40
|
-
set maxPages(value: number
|
|
40
|
+
set maxPages(value: number);
|
|
41
41
|
/**
|
|
42
42
|
* Gets the maximum number of pages.
|
|
43
43
|
* This getter retrieves the value of the "max-pages" attribute from the element.
|
|
@@ -49,7 +49,7 @@ export default class Pagination extends WJElement {
|
|
|
49
49
|
* Sets the `pageSize` attribute to the specified value.
|
|
50
50
|
* @param {number|string} value The desired page size value. This can be a number or a string representation of the size.
|
|
51
51
|
*/
|
|
52
|
-
set pageSize(value: number
|
|
52
|
+
set pageSize(value: number);
|
|
53
53
|
/**
|
|
54
54
|
* Retrieves the value of the 'page-size' attribute and converts it to a number.
|
|
55
55
|
* If the attribute is not set or is invalid, returns the default value of 3.
|
|
@@ -95,12 +95,12 @@ export default class Pagination extends WJElement {
|
|
|
95
95
|
* based on the total items, current page, page size, and maximum pages.
|
|
96
96
|
* @param {object} value The value to set the pagination object. The pagination details are computed internally.
|
|
97
97
|
*/
|
|
98
|
-
set paginateObj(value:
|
|
98
|
+
set paginateObj(value: any);
|
|
99
99
|
/**
|
|
100
100
|
* Retrieves the pagination object used for managing paginated data.
|
|
101
101
|
* @returns {object} The pagination object containing details and functionality for paginating data.
|
|
102
102
|
*/
|
|
103
|
-
get paginateObj():
|
|
103
|
+
get paginateObj(): any;
|
|
104
104
|
/**
|
|
105
105
|
* Sets the 'round' attribute on the element. If the provided value is truthy,
|
|
106
106
|
* the 'round' attribute is added. If the value is falsy, the attribute is removed.
|
|
@@ -26,7 +26,7 @@ export default class Popup extends WJElement {
|
|
|
26
26
|
* @static
|
|
27
27
|
* @returns {Array<string>}
|
|
28
28
|
*/
|
|
29
|
-
static get observedAttributes():
|
|
29
|
+
static get observedAttributes(): string[];
|
|
30
30
|
_manual: boolean;
|
|
31
31
|
/**
|
|
32
32
|
* Sets the manual property of the popup.
|
|
@@ -25,7 +25,7 @@ export default class ProgressBar extends WJElement {
|
|
|
25
25
|
* @static
|
|
26
26
|
* @returns {Array<string>}
|
|
27
27
|
*/
|
|
28
|
-
static get observedAttributes():
|
|
28
|
+
static get observedAttributes(): string[];
|
|
29
29
|
/**
|
|
30
30
|
* Sets the radius of the progress bar.
|
|
31
31
|
* @param {number} value The value to set.
|
|
@@ -23,7 +23,7 @@ export default class Radio extends WJElement {
|
|
|
23
23
|
* @static
|
|
24
24
|
* @returns {Array<string>}
|
|
25
25
|
*/
|
|
26
|
-
static get observedAttributes():
|
|
26
|
+
static get observedAttributes(): string[];
|
|
27
27
|
_checked: boolean;
|
|
28
28
|
/**
|
|
29
29
|
* Sets the name of the radio button.
|
|
@@ -26,7 +26,7 @@ export default class Rate extends WJElement {
|
|
|
26
26
|
* @static
|
|
27
27
|
* @returns {Array<string>}
|
|
28
28
|
*/
|
|
29
|
-
static get observedAttributes():
|
|
29
|
+
static get observedAttributes(): string[];
|
|
30
30
|
/**
|
|
31
31
|
* Sets the precision of the rating component.
|
|
32
32
|
* @param {number} value The value to set.
|
|
@@ -51,12 +51,12 @@ export default class Rate extends WJElement {
|
|
|
51
51
|
* Sets the icons of the rating component.
|
|
52
52
|
* @param {Array<string>} value The value to set.
|
|
53
53
|
*/
|
|
54
|
-
set icons(value:
|
|
54
|
+
set icons(value: string[]);
|
|
55
55
|
/**
|
|
56
56
|
* Gets the icons of the rating component.
|
|
57
57
|
* @returns {Array<string>} The value of the icons.
|
|
58
58
|
*/
|
|
59
|
-
get icons():
|
|
59
|
+
get icons(): string[];
|
|
60
60
|
/**
|
|
61
61
|
* Sets the value of the rating component.
|
|
62
62
|
* @param {number} value The value to set.
|
|
@@ -15,7 +15,7 @@ export default class RelativeTime extends WJElement {
|
|
|
15
15
|
* @static
|
|
16
16
|
* @returns {Array<string>}
|
|
17
17
|
*/
|
|
18
|
-
static get observedAttributes():
|
|
18
|
+
static get observedAttributes(): string[];
|
|
19
19
|
localizer: Localizer;
|
|
20
20
|
/**
|
|
21
21
|
* Sets the date of the relative time component.
|
|
@@ -13,7 +13,7 @@ export default class Route extends WJElement {
|
|
|
13
13
|
* @static
|
|
14
14
|
* @returns {Array<string>}
|
|
15
15
|
*/
|
|
16
|
-
static get observedAttributes():
|
|
16
|
+
static get observedAttributes(): string[];
|
|
17
17
|
/**
|
|
18
18
|
* Draws the component for the route.
|
|
19
19
|
* @returns {DocumentFragment}
|
|
@@ -13,7 +13,7 @@ export default class Routerx extends WJElement {
|
|
|
13
13
|
* @static
|
|
14
14
|
* @returns {Array<string>}
|
|
15
15
|
*/
|
|
16
|
-
static get observedAttributes():
|
|
16
|
+
static get observedAttributes(): string[];
|
|
17
17
|
/**
|
|
18
18
|
* Sets up the router after the component is drawn.
|
|
19
19
|
*/
|
|
@@ -20,7 +20,7 @@ export default class RouterLink extends WJElement {
|
|
|
20
20
|
* @static
|
|
21
21
|
* @returns {Array<string>}
|
|
22
22
|
*/
|
|
23
|
-
static get observedAttributes():
|
|
23
|
+
static get observedAttributes(): string[];
|
|
24
24
|
/**
|
|
25
25
|
* Draws the component for the router link.
|
|
26
26
|
* @returns {DocumentFragment}
|
|
@@ -43,7 +43,7 @@ export default class Select extends WJElement {
|
|
|
43
43
|
* @static
|
|
44
44
|
* @returns {Array<string>}
|
|
45
45
|
*/
|
|
46
|
-
static get observedAttributes():
|
|
46
|
+
static get observedAttributes(): string[];
|
|
47
47
|
/**
|
|
48
48
|
* Whether the input is associated with a form.
|
|
49
49
|
* @type {boolean}
|
|
@@ -221,7 +221,7 @@ export default class Select extends WJElement {
|
|
|
221
221
|
* selections(true);
|
|
222
222
|
*/
|
|
223
223
|
selections(silence?: boolean): void;
|
|
224
|
-
selectedOptions: (NodeList & any[])
|
|
224
|
+
selectedOptions: Node[] | (NodeList & any[]);
|
|
225
225
|
/**
|
|
226
226
|
* Manages the display of a counter element to indicate the number of items exceeding the maximum allowed options.
|
|
227
227
|
* - If the number of selected items equals the maximum allowed, the counter element is removed.
|
|
@@ -16,7 +16,7 @@ export default class Slider extends WJElement {
|
|
|
16
16
|
* @static
|
|
17
17
|
* @returns {Array<string>}
|
|
18
18
|
*/
|
|
19
|
-
static get observedAttributes():
|
|
19
|
+
static get observedAttributes(): string[];
|
|
20
20
|
/**
|
|
21
21
|
* Sets the value of the slider.
|
|
22
22
|
* @param {number} value The value to set.
|
|
@@ -34,7 +34,7 @@ export default class SplitView extends WJElement {
|
|
|
34
34
|
* @static
|
|
35
35
|
* @returns {Array<string>}
|
|
36
36
|
*/
|
|
37
|
-
static get observedAttributes():
|
|
37
|
+
static get observedAttributes(): string[];
|
|
38
38
|
set initial(value: number);
|
|
39
39
|
get initial(): number;
|
|
40
40
|
/**
|
|
@@ -39,7 +39,7 @@ export default class Textarea extends WJElement {
|
|
|
39
39
|
* @static
|
|
40
40
|
* @returns {Array<string>}
|
|
41
41
|
*/
|
|
42
|
-
static get observedAttributes():
|
|
42
|
+
static get observedAttributes(): string[];
|
|
43
43
|
/**
|
|
44
44
|
* Setter for the invalid attribute.
|
|
45
45
|
* @param {boolean} isInvalid Whether the input is invalid.
|
|
@@ -24,7 +24,7 @@ export default class TreeItem extends HTMLElement {
|
|
|
24
24
|
* @static
|
|
25
25
|
* @returns {Array<string>}
|
|
26
26
|
*/
|
|
27
|
-
static get observedAttributes():
|
|
27
|
+
static get observedAttributes(): string[];
|
|
28
28
|
_selection: string;
|
|
29
29
|
/**
|
|
30
30
|
* Sets the expanded state of the element. When set to a truthy value,
|
|
@@ -59,7 +59,7 @@ export default class TreeItem extends HTMLElement {
|
|
|
59
59
|
* specific to the implementation of the component
|
|
60
60
|
* (e.g., 'single', 'multiple').
|
|
61
61
|
*/
|
|
62
|
-
set selection(value:
|
|
62
|
+
set selection(value: any);
|
|
63
63
|
/**
|
|
64
64
|
* Retrieves the current selection.
|
|
65
65
|
* @returns {*} The value of the current selection.
|
package/dist/wje-avatar.js
CHANGED
|
@@ -31,6 +31,51 @@ class Avatar extends WJElement {
|
|
|
31
31
|
*/
|
|
32
32
|
__publicField(this, "className", "Avatar");
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Sets the value of the 'label' attribute for the element.
|
|
36
|
+
* @param {string} value The new value to be set for the 'label' attribute.
|
|
37
|
+
*/
|
|
38
|
+
set label(value) {
|
|
39
|
+
this.setAttribute("label", value);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves the value of the 'label' attribute for the element.
|
|
43
|
+
* If the attribute is not set, it defaults to an empty string.
|
|
44
|
+
* @returns {string} The value of the 'label' attribute or an empty string if not defined.
|
|
45
|
+
*/
|
|
46
|
+
get label() {
|
|
47
|
+
return this.getAttribute("label") || "";
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Sets the value of initials for the element by updating
|
|
51
|
+
* the 'initials' attribute with the provided value.
|
|
52
|
+
* @param {string} value The value to be set as the initials.
|
|
53
|
+
*/
|
|
54
|
+
set initials(value) {
|
|
55
|
+
this.setAttribute("initials", "");
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Retrieves the value of the 'initials' attribute if it exists.
|
|
59
|
+
* @returns {boolean} Returns true if the 'initials' attribute is present, otherwise false.
|
|
60
|
+
*/
|
|
61
|
+
get initials() {
|
|
62
|
+
return this.hasAttribute("initials") || false;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Sets the size attribute for the element.
|
|
66
|
+
* @param {string | number} value The value to set for the size attribute.
|
|
67
|
+
*/
|
|
68
|
+
set size(value) {
|
|
69
|
+
this.setAttribute("size", value);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Retrieves the size attribute of the element. If the size attribute
|
|
73
|
+
* is not defined, it returns the default value 'medium'.
|
|
74
|
+
* @returns {string} The size value of the element or 'medium' if not specified.
|
|
75
|
+
*/
|
|
76
|
+
get size() {
|
|
77
|
+
return this.getAttribute("size") || "medium";
|
|
78
|
+
}
|
|
34
79
|
/**
|
|
35
80
|
* Getter for cssStyleSheet.
|
|
36
81
|
* @returns {string} styles
|
|
@@ -55,7 +100,7 @@ class Avatar extends WJElement {
|
|
|
55
100
|
element.classList.add("native-avatar");
|
|
56
101
|
let slot = document.createElement("slot");
|
|
57
102
|
element.appendChild(slot);
|
|
58
|
-
if (this.
|
|
103
|
+
if (this.initials) {
|
|
59
104
|
let initials = getInitials(this.label);
|
|
60
105
|
this.setAttribute("style", `--wje-avatar-background-color: ${getHsl(initials)}`);
|
|
61
106
|
element.innerText = initials;
|
package/dist/wje-avatar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-avatar.js","sources":["../packages/wje-avatar/service/service.js","../packages/wje-avatar/avatar.element.js","../packages/wje-avatar/avatar.js"],"sourcesContent":["/**\n * Generates an HSL color value based on the input text.\n * @param {string} text The input text to generate the HSL color.\n * @param {number} [s] The saturation value (in percentage) for the HSL color.\n * @param {number} [l] The lightness value (in percentage) for the HSL color.\n * @returns {string} - The HSL color string in the format `hsl(h, s%, l%)`.\n * @description\n * This function computes a hash from the input text and uses it to generate\n * a hue value. The hue is combined with the provided saturation and lightness\n * values to create an HSL color. This can be useful for consistently assigning\n * colors based on text input, such as for avatars or tags.\n * @example\n * // Returns 'hsl(180, 40%, 65%)'\n * getHsl('example');\n * @example\n * // Returns 'hsl(300, 50%, 70%)'\n * getHsl('test', 50, 70);\n */\nexport function getHsl(text, s = 40, l = 65) {\n let str = text;\n let hash = 0;\n\n for (let i = 0; i < str?.length; i++) {\n hash = str.charCodeAt(i) + hash * 31;\n }\n\n let h = hash % 360;\n\n return `hsl(${h}, ${s}%, ${l}%)`;\n}\n\n/**\n * Generates initials from a given string.\n * @param {string} string The input string, typically a full name.\n * @param {number} [length] The desired number of initials (default is 2).\n * @returns {string} - The generated initials in uppercase.\n * @description\n * This function takes a string, splits it by spaces, and generates initials.\n * It always includes the first character of the first word. If the input string\n * contains more than one word and the `length` parameter is greater than 1, it\n * also includes the first character of the last word.\n * @example\n * // Returns 'JD'\n * getInitials('John Doe');\n * @example\n * // Returns 'J'\n * getInitials('John');\n * @example\n * // Returns 'JM'\n * getInitials('John Michael Doe', 2);\n */\nexport function getInitials(string, length = 2) {\n let names = string.split(' ');\n let initials = names[0].substring(0, 1).toUpperCase();\n\n if (names.length > 1 && length > 1) {\n initials += names[names.length - 1].substring(0, 1).toUpperCase();\n }\n return initials;\n}\n","import { default as WJElement } from '../wje-element/element.js';\nimport { getHsl, getInitials } from './service/service.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This class represents an Avatar element, extending the WJElement class.\n * @documentation https://elements.webjet.sk/components/avatar\n * @status stable\n * @augments WJElement\n * @slot - The avatar main content.\n * @csspart native - The component's native wrapper.\n * @cssproperty --wje-avatar-width;\n * @cssproperty --wje-avatar-height;\n * @cssproperty --wje-avatar-font-size;\n * @cssproperty --wje-avatar-font-weight;\n * @cssproperty --wje-avatar-color;\n * @cssproperty --wje-avatar-background-color;\n * @cssproperty --wje-avatar-border-radius;\n * @cssproperty --wje-avatar-border-color;\n * @cssproperty --wje-avatar-border-width;\n * @cssproperty --wje-avatar-border-style;\n * @tag wje-avatar\n */\nexport default class Avatar extends WJElement {\n /**\n * Avatar class constructor.\n */\n constructor() {\n super();\n }\n\n /**\n * Class name for the Avatar element.\n */\n className = 'Avatar';\n\n /**\n * Getter for cssStyleSheet.\n * @returns {string} styles\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Method to setup attributes.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Method to draw the avatar element and return a document fragment.\n * @returns {object} fragment - The document fragment\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let element = document.createElement('div');\n element.setAttribute('part', 'native');\n element.classList.add('native-avatar');\n\n let slot = document.createElement('slot');\n\n element.appendChild(slot);\n\n if (this.
|
|
1
|
+
{"version":3,"file":"wje-avatar.js","sources":["../packages/wje-avatar/service/service.js","../packages/wje-avatar/avatar.element.js","../packages/wje-avatar/avatar.js"],"sourcesContent":["/**\n * Generates an HSL color value based on the input text.\n * @param {string} text The input text to generate the HSL color.\n * @param {number} [s] The saturation value (in percentage) for the HSL color.\n * @param {number} [l] The lightness value (in percentage) for the HSL color.\n * @returns {string} - The HSL color string in the format `hsl(h, s%, l%)`.\n * @description\n * This function computes a hash from the input text and uses it to generate\n * a hue value. The hue is combined with the provided saturation and lightness\n * values to create an HSL color. This can be useful for consistently assigning\n * colors based on text input, such as for avatars or tags.\n * @example\n * // Returns 'hsl(180, 40%, 65%)'\n * getHsl('example');\n * @example\n * // Returns 'hsl(300, 50%, 70%)'\n * getHsl('test', 50, 70);\n */\nexport function getHsl(text, s = 40, l = 65) {\n let str = text;\n let hash = 0;\n\n for (let i = 0; i < str?.length; i++) {\n hash = str.charCodeAt(i) + hash * 31;\n }\n\n let h = hash % 360;\n\n return `hsl(${h}, ${s}%, ${l}%)`;\n}\n\n/**\n * Generates initials from a given string.\n * @param {string} string The input string, typically a full name.\n * @param {number} [length] The desired number of initials (default is 2).\n * @returns {string} - The generated initials in uppercase.\n * @description\n * This function takes a string, splits it by spaces, and generates initials.\n * It always includes the first character of the first word. If the input string\n * contains more than one word and the `length` parameter is greater than 1, it\n * also includes the first character of the last word.\n * @example\n * // Returns 'JD'\n * getInitials('John Doe');\n * @example\n * // Returns 'J'\n * getInitials('John');\n * @example\n * // Returns 'JM'\n * getInitials('John Michael Doe', 2);\n */\nexport function getInitials(string, length = 2) {\n let names = string.split(' ');\n let initials = names[0].substring(0, 1).toUpperCase();\n\n if (names.length > 1 && length > 1) {\n initials += names[names.length - 1].substring(0, 1).toUpperCase();\n }\n return initials;\n}\n","import { default as WJElement } from '../wje-element/element.js';\nimport { getHsl, getInitials } from './service/service.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This class represents an Avatar element, extending the WJElement class.\n * @documentation https://elements.webjet.sk/components/avatar\n * @status stable\n * @augments WJElement\n * @slot - The avatar main content.\n * @csspart native - The component's native wrapper.\n * @cssproperty --wje-avatar-width;\n * @cssproperty --wje-avatar-height;\n * @cssproperty --wje-avatar-font-size;\n * @cssproperty --wje-avatar-font-weight;\n * @cssproperty --wje-avatar-color;\n * @cssproperty --wje-avatar-background-color;\n * @cssproperty --wje-avatar-border-radius;\n * @cssproperty --wje-avatar-border-color;\n * @cssproperty --wje-avatar-border-width;\n * @cssproperty --wje-avatar-border-style;\n * @tag wje-avatar\n */\nexport default class Avatar extends WJElement {\n /**\n * Avatar class constructor.\n */\n constructor() {\n super();\n }\n\n /**\n * Sets the value of the 'label' attribute for the element.\n * @param {string} value The new value to be set for the 'label' attribute.\n */\n set label(value) {\n this.setAttribute('label', value);\n }\n\n /**\n * Retrieves the value of the 'label' attribute for the element.\n * If the attribute is not set, it defaults to an empty string.\n * @returns {string} The value of the 'label' attribute or an empty string if not defined.\n */\n get label() {\n return this.getAttribute('label') || '';\n }\n\n /**\n * Sets the value of initials for the element by updating\n * the 'initials' attribute with the provided value.\n * @param {string} value The value to be set as the initials.\n */\n set initials(value) {\n this.setAttribute('initials', '');\n }\n\n /**\n * Retrieves the value of the 'initials' attribute if it exists.\n * @returns {boolean} Returns true if the 'initials' attribute is present, otherwise false.\n */\n get initials() {\n return this.hasAttribute('initials') || false;\n }\n\n /**\n * Sets the size attribute for the element.\n * @param {string | number} value The value to set for the size attribute.\n */\n set size(value) {\n this.setAttribute('size', value);\n }\n\n /**\n * Retrieves the size attribute of the element. If the size attribute\n * is not defined, it returns the default value 'medium'.\n * @returns {string} The size value of the element or 'medium' if not specified.\n */\n get size() {\n return this.getAttribute('size') || 'medium';\n }\n\n /**\n * Class name for the Avatar element.\n */\n className = 'Avatar';\n\n /**\n * Getter for cssStyleSheet.\n * @returns {string} styles\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Method to setup attributes.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Method to draw the avatar element and return a document fragment.\n * @returns {object} fragment - The document fragment\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let element = document.createElement('div');\n element.setAttribute('part', 'native');\n element.classList.add('native-avatar');\n\n let slot = document.createElement('slot');\n\n element.appendChild(slot);\n\n if (this.initials) {\n let initials = getInitials(this.label);\n\n this.setAttribute('style', `--wje-avatar-background-color: ${getHsl(initials)}`);\n element.innerText = initials;\n } else {\n let slotIcon = document.createElement('slot');\n slotIcon.setAttribute('name', 'icon');\n\n element.appendChild(slotIcon);\n }\n\n let status = document.createElement('slot');\n status.setAttribute('name', 'status');\n status.setAttribute('part', 'status');\n\n let secondary = document.createElement('slot');\n secondary.setAttribute('name', 'secondary');\n secondary.setAttribute('part', 'secondary');\n\n element.appendChild(status);\n element.appendChild(secondary);\n\n fragment.appendChild(element);\n\n return fragment;\n }\n\n /**\n * Method to check if the avatar is an image.\n * @returns {boolean} - True if the avatar is an image, false otherwise\n */\n isImage() {\n return this.getElementsByTagName('wje-img').length > 0;\n }\n}\n","import Avatar from './avatar.element.js';\n\nexport default Avatar;\n\nAvatar.define('wje-avatar', Avatar);\n"],"names":[],"mappings":";;;;AAkBO,SAAS,OAAO,MAAM,IAAI,IAAI,IAAI,IAAI;AACzC,MAAI,MAAM;AACV,MAAI,OAAO;AAEX,WAAS,IAAI,GAAG,KAAI,2BAAK,SAAQ,KAAK;AAClC,WAAO,IAAI,WAAW,CAAC,IAAI,OAAO;AAAA,EAC1C;AAEI,MAAI,IAAI,OAAO;AAEf,SAAO,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;AAChC;AAsBO,SAAS,YAAY,QAAQ,SAAS,GAAG;AAC5C,MAAI,QAAQ,OAAO,MAAM,GAAG;AAC5B,MAAI,WAAW,MAAM,CAAC,EAAE,UAAU,GAAG,CAAC,EAAE,YAAa;AAErD,MAAI,MAAM,SAAS,KAAK,SAAS,GAAG;AAChC,gBAAY,MAAM,MAAM,SAAS,CAAC,EAAE,UAAU,GAAG,CAAC,EAAE,YAAa;AAAA,EACzE;AACI,SAAO;AACX;;ACpCe,MAAM,eAAe,UAAU;AAAA;AAAA;AAAA;AAAA,EAI1C,cAAc;AACV,UAAO;AAyDX;AAAA;AAAA;AAAA,qCAAY;AAAA,EAxDhB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,MAAM,OAAO;AACb,SAAK,aAAa,SAAS,KAAK;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,IAAI,QAAQ;AACR,WAAO,KAAK,aAAa,OAAO,KAAK;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,IAAI,SAAS,OAAO;AAChB,SAAK,aAAa,YAAY,EAAE;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,WAAW;AACX,WAAO,KAAK,aAAa,UAAU,KAAK;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,KAAK,OAAO;AACZ,SAAK,aAAa,QAAQ,KAAK;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,IAAI,OAAO;AACP,WAAO,KAAK,aAAa,MAAM,KAAK;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA;AAAA,EAWI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAO;AACH,QAAI,WAAW,SAAS,uBAAwB;AAEhD,QAAI,UAAU,SAAS,cAAc,KAAK;AAC1C,YAAQ,aAAa,QAAQ,QAAQ;AACrC,YAAQ,UAAU,IAAI,eAAe;AAErC,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,YAAQ,YAAY,IAAI;AAExB,QAAI,KAAK,UAAU;AACf,UAAI,WAAW,YAAY,KAAK,KAAK;AAErC,WAAK,aAAa,SAAS,kCAAkC,OAAO,QAAQ,CAAC,EAAE;AAC/E,cAAQ,YAAY;AAAA,IAChC,OAAe;AACH,UAAI,WAAW,SAAS,cAAc,MAAM;AAC5C,eAAS,aAAa,QAAQ,MAAM;AAEpC,cAAQ,YAAY,QAAQ;AAAA,IACxC;AAEQ,QAAI,SAAS,SAAS,cAAc,MAAM;AAC1C,WAAO,aAAa,QAAQ,QAAQ;AACpC,WAAO,aAAa,QAAQ,QAAQ;AAEpC,QAAI,YAAY,SAAS,cAAc,MAAM;AAC7C,cAAU,aAAa,QAAQ,WAAW;AAC1C,cAAU,aAAa,QAAQ,WAAW;AAE1C,YAAQ,YAAY,MAAM;AAC1B,YAAQ,YAAY,SAAS;AAE7B,aAAS,YAAY,OAAO;AAE5B,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,UAAU;AACN,WAAO,KAAK,qBAAqB,SAAS,EAAE,SAAS;AAAA,EAC7D;AACA;ACpJA,OAAO,OAAO,cAAc,MAAM;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wj-elements",
|
|
3
3
|
"description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.145",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"lint:fix": "eslint packages --max-warnings 0 --fix",
|
|
45
45
|
"prettier": "prettier --write ./packages",
|
|
46
46
|
"test:animation": "web-test-runner --files packages/wje-animation/animation.test.js",
|
|
47
|
+
"test:avatar": "web-test-runner --files packages/wje-avatar/avatar.test.js",
|
|
47
48
|
"test:badge": "web-test-runner --files packages/wje-badge/badge.test.js",
|
|
48
49
|
"test:breadcrumbs": "web-test-runner --files packages/wje-breadcrumbs/breadcrumbs.test.js",
|
|
49
50
|
"test:button": "web-test-runner --files packages/wje-button/button.test.js",
|