@ewc-lib/ewc-icon-button-group 3.2.0-alpha → 3.3.0-alpha
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/readme.md +3 -0
- package/src/main.js +6 -7
- package/usage-example/vanilla/index.html +24 -24
- package/usage-example/webpack/dist/ewc_usage.js +283 -0
- package/usage-example/webpack/dist/index.html +152 -0
- package/usage-example/webpack/index.html +24 -24
- package/usage-example/webpack/main.js +6 -1
- package/usage-example/webpack/package-lock.json +4676 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ewc-lib/ewc-icon-button-group",
|
|
3
3
|
"//": "please always keep version in sync with constructor in main.js",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.3.0-alpha",
|
|
5
5
|
"basedOnStandard": "3.0.1",
|
|
6
6
|
"description": "",
|
|
7
7
|
"main": "src/main.js",
|
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
"@ewc-lib/ewc-css-common": "0.1.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@ewc-lib/ewc-icon-button": "3.
|
|
19
|
+
"@ewc-lib/ewc-icon-button": "3.2.0-alpha"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/readme.md
CHANGED
package/src/main.js
CHANGED
|
@@ -4,7 +4,7 @@ button-group: min 1 and max 1 button can be in pressed down state.
|
|
|
4
4
|
keyboard navigation:
|
|
5
5
|
- a group can't get a focus
|
|
6
6
|
- buttons in the group can get a focus
|
|
7
|
-
- only not-pressed buttons can get a focus
|
|
7
|
+
(- only not-pressed buttons can get a focus) <-- to clarify, for now, not implemented
|
|
8
8
|
- disabled buttons can't be pressed
|
|
9
9
|
- left/up and right/down keys move the focus
|
|
10
10
|
- enter and space key presses a button, releases the currently pressed button
|
|
@@ -29,14 +29,14 @@ class Element extends HTMLElement {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
connectedCallback() {
|
|
32
|
-
this.setAttribute("ewc-version", "3.
|
|
32
|
+
this.setAttribute("ewc-version", "3.3.0-alpha") // please always keep in sync with version in package.json
|
|
33
33
|
if(this.#isInitialised == true) {return}
|
|
34
34
|
|
|
35
35
|
this.classList.add(this.#cssClassPrefix)
|
|
36
36
|
this.appendChild(CSS(this.#cssClassPrefix, this.getAttr("breakpoint","480px")).cloneNode(true)) // .ecl-col-s- in ECL 4.8.1.
|
|
37
37
|
|
|
38
38
|
const nodes = this.querySelectorAll("ewc-icon-button")
|
|
39
|
-
this.#
|
|
39
|
+
this.#setAttributes(nodes)
|
|
40
40
|
this.#installEventHandlers(nodes)
|
|
41
41
|
// attributeChangedCallback() might have been called before this, so it just stored the number but couldn't yet press the button. let it catch up now.
|
|
42
42
|
this.#buttonGroup.applyCurrentSelection(nodes)
|
|
@@ -171,11 +171,10 @@ class Element extends HTMLElement {
|
|
|
171
171
|
}.bind(this))
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
|
|
175
|
-
// TODO: remove and replace w/ loops
|
|
176
|
-
#setIndexOnNodes(nodes) {
|
|
174
|
+
#setAttributes(nodes) {
|
|
177
175
|
for(let i=0;i<nodes.length;i++) {
|
|
178
|
-
nodes[i].setAttribute("__index", i)
|
|
176
|
+
nodes[i].setAttribute("__index", i) // assign 0-based ordinal number to each button
|
|
177
|
+
nodes[i].setAttribute("is-in-group","true")
|
|
179
178
|
}
|
|
180
179
|
}
|
|
181
180
|
|
|
@@ -34,28 +34,28 @@
|
|
|
34
34
|
|
|
35
35
|
<div style="margin:20px; padding:20px;">
|
|
36
36
|
<ewc-icon-button-group style="width:600px; padding-right:10px;" selectedIndex="0" breakpoint="800px" id="lightEnabled">
|
|
37
|
-
<ewc-icon-button icon="linechart" use-config="grp-linechart" label="Line chart"
|
|
38
|
-
<ewc-icon-button icon="barchart" use-config="grp-barchart" label="Bar chart" btn-aria-label="Bar chart"
|
|
39
|
-
<ewc-icon-button icon="dotplot" use-config="grp-dotplot"
|
|
40
|
-
<ewc-icon-button icon="table" use-config="grp-table"
|
|
37
|
+
<ewc-icon-button icon="linechart" use-config="grp-linechart" btn-aria-label="Line chart" title="Line chart" label="Line chart" btn-aria-label="Line chart"></ewc-icon-button>
|
|
38
|
+
<ewc-icon-button icon="barchart" use-config="grp-barchart" btn-aria-label="Bar chart" title="Bar chart" label="Bar chart" btn-aria-label="Bar chart"></ewc-icon-button>
|
|
39
|
+
<ewc-icon-button icon="dotplot" use-config="grp-dotplot" btn-aria-label="Dotplot" title="Dotplot" label="Dotplot" btn-aria-label="Dotplot"></ewc-icon-button>
|
|
40
|
+
<ewc-icon-button icon="table" use-config="grp-table" btn-aria-label="Table" title="Table" label="Table" btn-aria-label="Table"></ewc-icon-button>
|
|
41
41
|
</ewc-icon-button-group>
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
44
|
<div style="margin:20px; padding:20px; background: black;">
|
|
45
45
|
<ewc-icon-button-group style="width:600px;" selectedIndex="3" breakpoint="800px" id="darkEnabled">
|
|
46
|
-
<ewc-icon-button icon="linechart"
|
|
47
|
-
<ewc-icon-button icon="barchart"
|
|
48
|
-
<ewc-icon-button icon="dotplot"
|
|
49
|
-
<ewc-icon-button icon="table"
|
|
46
|
+
<ewc-icon-button icon="linechart" use-config="grp-linechart" btn-aria-label="Line chart" title="Line chart" label="Line chart" btn-aria-label="Line chart" background="dark"></ewc-icon-button>
|
|
47
|
+
<ewc-icon-button icon="barchart" use-config="grp-barchart" btn-aria-label="Bar chart" title="Bar chart" label="Bar chart" btn-aria-label="Bar chart" background="dark"></ewc-icon-button>
|
|
48
|
+
<ewc-icon-button icon="dotplot" use-config="grp-dotplot" btn-aria-label="Dotplot" title="Dotplot" label="Dotplot" btn-aria-label="Dotplot" background="dark"></ewc-icon-button>
|
|
49
|
+
<ewc-icon-button icon="table" use-config="grp-table" btn-aria-label="Table" title="Table" label="Table" btn-aria-label="Table" background="dark"></ewc-icon-button>
|
|
50
50
|
</ewc-icon-button-group>
|
|
51
51
|
</div>
|
|
52
52
|
|
|
53
53
|
<div style="margin:20px; padding:20px; background: var(--c-p-140);">
|
|
54
54
|
<ewc-icon-button-group style="width:600px;" selectedIndex="3" breakpoint="800px" id="blueEnabled">
|
|
55
|
-
<ewc-icon-button icon="linechart"
|
|
56
|
-
<ewc-icon-button icon="barchart"
|
|
57
|
-
<ewc-icon-button icon="dotplot"
|
|
58
|
-
<ewc-icon-button icon="table"
|
|
55
|
+
<ewc-icon-button icon="linechart" use-config="grp-linechart" btn-aria-label="Line chart" title="Line chart" label="Line chart" btn-aria-label="Line chart" background="dark"></ewc-icon-button>
|
|
56
|
+
<ewc-icon-button icon="barchart" use-config="grp-barchart" btn-aria-label="Bar chart" title="Bar chart" label="Bar chart" btn-aria-label="Bar chart" background="dark"></ewc-icon-button>
|
|
57
|
+
<ewc-icon-button icon="dotplot" use-config="grp-dotplot" btn-aria-label="Dotplot" title="Dotplot" label="Dotplot" btn-aria-label="Dotplot" background="dark"></ewc-icon-button>
|
|
58
|
+
<ewc-icon-button icon="table" use-config="grp-table" btn-aria-label="Table" title="Table" label="Table" btn-aria-label="Table" background="dark"></ewc-icon-button>
|
|
59
59
|
</ewc-icon-button-group>
|
|
60
60
|
</div>
|
|
61
61
|
|
|
@@ -63,28 +63,28 @@
|
|
|
63
63
|
|
|
64
64
|
<div style="margin:20px; padding:20px;">
|
|
65
65
|
<ewc-icon-button-group style="width:600px; padding-right:10px;" selectedIndex="0" breakpoint="800px" id="lightDisabled">
|
|
66
|
-
<ewc-icon-button icon="linechart" use-config="grp-linechart" label="Line chart"
|
|
67
|
-
<ewc-icon-button icon="barchart" use-config="grp-barchart" label="Bar chart" btn-aria-label="Bar chart"
|
|
68
|
-
<ewc-icon-button icon="dotplot" use-config="grp-dotplot"
|
|
69
|
-
<ewc-icon-button icon="table" use-config="grp-table"
|
|
66
|
+
<ewc-icon-button state="disabled" icon="linechart" use-config="grp-linechart" btn-aria-label="Line chart" title="Line chart" label="Line chart" btn-aria-label="Line chart"></ewc-icon-button>
|
|
67
|
+
<ewc-icon-button state="disabled" icon="barchart" use-config="grp-barchart" btn-aria-label="Bar chart" title="Bar chart" label="Bar chart" btn-aria-label="Bar chart"></ewc-icon-button>
|
|
68
|
+
<ewc-icon-button state="disabled" icon="dotplot" use-config="grp-dotplot" btn-aria-label="Dotplot" title="Dotplot" label="Dotplot" btn-aria-label="Dotplot"></ewc-icon-button>
|
|
69
|
+
<ewc-icon-button state="disabled" icon="table" use-config="grp-table" btn-aria-label="Table" title="Table" label="Table" btn-aria-label="Table"></ewc-icon-button>
|
|
70
70
|
</ewc-icon-button-group>
|
|
71
71
|
</div>
|
|
72
72
|
|
|
73
73
|
<div style="margin:20px; padding:20px; background: black;">
|
|
74
74
|
<ewc-icon-button-group style="width:600px;" selectedIndex="3" breakpoint="800px" id="darkDisabled">
|
|
75
|
-
<ewc-icon-button state="disabled" icon="linechart"
|
|
76
|
-
<ewc-icon-button state="disabled" icon="barchart"
|
|
77
|
-
<ewc-icon-button state="disabled" icon="dotplot"
|
|
78
|
-
<ewc-icon-button state="disabled" icon="table"
|
|
75
|
+
<ewc-icon-button state="disabled" icon="linechart" use-config="grp-linechart" btn-aria-label="Line chart" title="Line chart" label="Line chart" btn-aria-label="Line chart" background="dark"></ewc-icon-button>
|
|
76
|
+
<ewc-icon-button state="disabled" icon="barchart" use-config="grp-barchart" btn-aria-label="Bar chart" title="Bar chart" label="Bar chart" btn-aria-label="Bar chart" background="dark"></ewc-icon-button>
|
|
77
|
+
<ewc-icon-button state="disabled" icon="dotplot" use-config="grp-dotplot" btn-aria-label="Dotplot" title="Dotplot" label="Dotplot" btn-aria-label="Dotplot" background="dark"></ewc-icon-button>
|
|
78
|
+
<ewc-icon-button state="disabled" icon="table" use-config="grp-table" btn-aria-label="Table" title="Table" label="Table" btn-aria-label="Table" background="dark"></ewc-icon-button>
|
|
79
79
|
</ewc-icon-button-group>
|
|
80
80
|
</div>
|
|
81
81
|
|
|
82
82
|
<div style="margin:20px; padding:20px; background: var(--c-p-140);">
|
|
83
83
|
<ewc-icon-button-group style="width:600px;" selectedIndex="3" breakpoint="800px" id="blueDisabled">
|
|
84
|
-
<ewc-icon-button state="disabled" icon="linechart"
|
|
85
|
-
<ewc-icon-button state="disabled" icon="barchart"
|
|
86
|
-
<ewc-icon-button state="disabled" icon="dotplot"
|
|
87
|
-
<ewc-icon-button state="disabled" icon="table"
|
|
84
|
+
<ewc-icon-button state="disabled" icon="linechart" use-config="grp-linechart" btn-aria-label="Line chart" title="Line chart" label="Line chart" btn-aria-label="Line chart" background="dark"></ewc-icon-button>
|
|
85
|
+
<ewc-icon-button state="disabled" icon="barchart" use-config="grp-barchart" btn-aria-label="Bar chart" title="Bar chart" label="Bar chart" btn-aria-label="Bar chart" background="dark"></ewc-icon-button>
|
|
86
|
+
<ewc-icon-button state="disabled" icon="dotplot" use-config="grp-dotplot" btn-aria-label="Dotplot" title="Dotplot" label="Dotplot" btn-aria-label="Dotplot" background="dark"></ewc-icon-button>
|
|
87
|
+
<ewc-icon-button state="disabled" icon="table" use-config="grp-table" btn-aria-label="Table" title="Table" label="Table" btn-aria-label="Table" background="dark"></ewc-icon-button>
|
|
88
88
|
</ewc-icon-button-group>
|
|
89
89
|
</div>
|
|
90
90
|
|