@scouterna/ui-webc 3.1.0 → 4.0.0
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/cjs/{index-BPpKjjvS.js → index-Vd3hlPvW.js} +35 -4
- package/dist/cjs/{inputMixin-D0IzcaXz.js → inputMixin-BsRV69ob.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/scout-app-bar.cjs.entry.js +2 -2
- package/dist/cjs/scout-avatar.cjs.entry.js +39 -0
- package/dist/cjs/scout-bottom-bar-item.cjs.entry.js +2 -2
- package/dist/cjs/scout-bottom-bar.cjs.entry.js +2 -2
- package/dist/cjs/scout-button.cjs.entry.js +1 -1
- package/dist/cjs/scout-card.cjs.entry.js +1 -1
- package/dist/cjs/scout-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/scout-divider.cjs.entry.js +1 -1
- package/dist/cjs/scout-drawer.cjs.entry.js +841 -0
- package/dist/cjs/scout-field.cjs.entry.js +1 -1
- package/dist/cjs/scout-input.cjs.entry.js +2 -2
- package/dist/cjs/scout-link.cjs.entry.js +1 -1
- package/dist/cjs/scout-list-view-item.cjs.entry.js +14 -3
- package/dist/cjs/scout-list-view-subheader.cjs.entry.js +1 -1
- package/dist/cjs/scout-list-view.cjs.entry.js +7 -5
- package/dist/cjs/scout-loader.cjs.entry.js +1 -1
- package/dist/cjs/scout-segmented-control.cjs.entry.js +88 -0
- package/dist/cjs/scout-select.cjs.entry.js +3 -3
- package/dist/cjs/scout-stack.cjs.entry.js +3 -3
- package/dist/cjs/scout-switch.cjs.entry.js +3 -3
- package/dist/cjs/scout-tabs-tab.cjs.entry.js +2 -2
- package/dist/cjs/scout-tabs.cjs.entry.js +3 -3
- package/dist/cjs/ui-webc.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/app-bar/app-bar.css +5 -1
- package/dist/collection/components/avatar/assets/fallbackImage.png +0 -0
- package/dist/collection/components/avatar/avatar.css +7 -0
- package/dist/collection/components/avatar/avatar.js +88 -0
- package/dist/collection/components/bottom-bar/bottom-bar.css +7 -2
- package/dist/collection/components/bottom-bar-item/bottom-bar-item.css +16 -2
- package/dist/collection/components/drawer/drawer.css +157 -0
- package/dist/collection/components/drawer/drawer.js +323 -0
- package/dist/collection/components/list-view/list-view.css +7 -2
- package/dist/collection/components/list-view/list-view.js +6 -4
- package/dist/collection/components/list-view-item/list-view-item.css +16 -4
- package/dist/collection/components/list-view-item/list-view-item.js +37 -1
- package/dist/collection/components/segmented-control/segmented-control.css +68 -0
- package/dist/collection/components/segmented-control/segmented-control.js +185 -0
- package/dist/collection/components/select/select.js +1 -1
- package/dist/collection/components/stack/stack.js +2 -2
- package/dist/collection/components/switch/switch.js +1 -1
- package/dist/collection/components/tabs/tabs.js +2 -2
- package/dist/collection/components/tabs-tab/tabs-tab.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-BO7j9O37.js +1 -0
- package/dist/components/p-CpD1flSg.js +1 -0
- package/dist/components/p-DLiFilsh.js +1 -0
- package/dist/components/{p-Qv5q0SGa.js → p-lrqW957X.js} +1 -1
- package/dist/components/scout-app-bar.js +1 -1
- package/dist/components/scout-avatar.d.ts +11 -0
- package/dist/components/scout-avatar.js +1 -0
- package/dist/components/scout-bottom-bar-item.js +1 -1
- package/dist/components/scout-bottom-bar.js +1 -1
- package/dist/components/scout-button.js +1 -1
- package/dist/components/scout-card.js +1 -1
- package/dist/components/scout-checkbox.js +1 -1
- package/dist/components/scout-divider.js +1 -1
- package/dist/components/scout-drawer.d.ts +11 -0
- package/dist/components/scout-drawer.js +1 -0
- package/dist/components/scout-field.js +1 -1
- package/dist/components/scout-input.js +1 -1
- package/dist/components/scout-link.js +1 -1
- package/dist/components/scout-list-view-item.js +1 -1
- package/dist/components/scout-list-view-subheader.js +1 -1
- package/dist/components/scout-list-view.js +1 -1
- package/dist/components/scout-loader.js +1 -1
- package/dist/components/scout-radio-button.js +1 -1
- package/dist/components/scout-segmented-control.d.ts +11 -0
- package/dist/components/scout-segmented-control.js +1 -0
- package/dist/components/scout-select.js +1 -1
- package/dist/components/scout-stack.js +1 -1
- package/dist/components/scout-switch.js +1 -1
- package/dist/components/scout-tabs-tab.js +1 -1
- package/dist/components/scout-tabs.js +1 -1
- package/dist/custom-elements.json +516 -1
- package/dist/esm/{index-CBq_WkdR.js → index-BtN0bCWb.js} +35 -5
- package/dist/esm/{inputMixin-CArDsEiI.js → inputMixin-DC4hF1Lp.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/scout-app-bar.entry.js +2 -2
- package/dist/esm/scout-avatar.entry.js +37 -0
- package/dist/esm/scout-bottom-bar-item.entry.js +2 -2
- package/dist/esm/scout-bottom-bar.entry.js +2 -2
- package/dist/esm/scout-button.entry.js +1 -1
- package/dist/esm/scout-card.entry.js +1 -1
- package/dist/esm/scout-checkbox_2.entry.js +2 -2
- package/dist/esm/scout-divider.entry.js +1 -1
- package/dist/esm/scout-drawer.entry.js +839 -0
- package/dist/esm/scout-field.entry.js +1 -1
- package/dist/esm/scout-input.entry.js +2 -2
- package/dist/esm/scout-link.entry.js +1 -1
- package/dist/esm/scout-list-view-item.entry.js +14 -3
- package/dist/esm/scout-list-view-subheader.entry.js +1 -1
- package/dist/esm/scout-list-view.entry.js +7 -5
- package/dist/esm/scout-loader.entry.js +1 -1
- package/dist/esm/scout-segmented-control.entry.js +86 -0
- package/dist/esm/scout-select.entry.js +3 -3
- package/dist/esm/scout-stack.entry.js +3 -3
- package/dist/esm/scout-switch.entry.js +3 -3
- package/dist/esm/scout-tabs-tab.entry.js +2 -2
- package/dist/esm/scout-tabs.entry.js +3 -3
- package/dist/esm/ui-webc.js +3 -3
- package/dist/types/components/avatar/avatar.d.ts +16 -0
- package/dist/types/components/drawer/drawer.d.ts +53 -0
- package/dist/types/components/list-view-item/list-view-item.d.ts +7 -0
- package/dist/types/components/segmented-control/segmented-control.d.ts +40 -0
- package/dist/types/components/tabs/tabs.d.ts +1 -1
- package/dist/types/components.d.ts +264 -2
- package/dist/ui-webc/assets/fallbackImage.png +0 -0
- package/dist/ui-webc/p-0b313ae9.entry.js +1 -0
- package/dist/ui-webc/p-1c5b40f5.entry.js +1 -0
- package/dist/ui-webc/p-214dc4e4.entry.js +1 -0
- package/dist/ui-webc/{p-a153023c.entry.js → p-2d773911.entry.js} +1 -1
- package/dist/ui-webc/{p-c0696c1f.entry.js → p-4d676928.entry.js} +1 -1
- package/dist/ui-webc/p-4d905b20.entry.js +1 -0
- package/dist/ui-webc/{p-f8a4ef3d.entry.js → p-5b0e6de5.entry.js} +1 -1
- package/dist/ui-webc/p-6bd3258b.entry.js +1 -0
- package/dist/ui-webc/p-6fea31a0.entry.js +1 -0
- package/dist/ui-webc/{p-6287efe7.entry.js → p-70c0acea.entry.js} +1 -1
- package/dist/ui-webc/p-74bd1d24.entry.js +1 -0
- package/dist/ui-webc/{p-0e444b1f.entry.js → p-8c81f27f.entry.js} +1 -1
- package/dist/ui-webc/{p-ff537388.entry.js → p-9c8d24b2.entry.js} +1 -1
- package/dist/ui-webc/p-9e3739c6.entry.js +1 -0
- package/dist/ui-webc/p-BtN0bCWb.js +2 -0
- package/dist/ui-webc/{p-6xDaXBJm.js → p-DMdnqqlQ.js} +1 -1
- package/dist/ui-webc/{p-b699617e.entry.js → p-a26bd0db.entry.js} +1 -1
- package/dist/ui-webc/{p-a2c09e05.entry.js → p-cec7a021.entry.js} +1 -1
- package/dist/ui-webc/p-d0fc1cd6.entry.js +1 -0
- package/dist/ui-webc/p-d76c67a5.entry.js +1 -0
- package/dist/ui-webc/{p-8f5965aa.entry.js → p-d88cbd78.entry.js} +1 -1
- package/dist/ui-webc/{p-f8099e5b.entry.js → p-db109100.entry.js} +1 -1
- package/dist/ui-webc/{p-6825e415.entry.js → p-ee796725.entry.js} +1 -1
- package/dist/ui-webc/{p-189879c2.entry.js → p-f1fb33e9.entry.js} +1 -1
- package/dist/ui-webc/ui-webc.css +2 -2
- package/dist/ui-webc/ui-webc.esm.js +1 -1
- package/package.json +2 -1
- package/dist/components/p-B72iGJNe.js +0 -1
- package/dist/components/p-CXXyN7aY.js +0 -1
- package/dist/components/p-DxVqa2PR.js +0 -1
- package/dist/ui-webc/p-60cd6c7e.entry.js +0 -1
- package/dist/ui-webc/p-78126f74.entry.js +0 -1
- package/dist/ui-webc/p-CBq_WkdR.js +0 -2
- package/dist/ui-webc/p-c4f7cfa2.entry.js +0 -1
- package/dist/ui-webc/p-cdc127de.entry.js +0 -1
- package/dist/ui-webc/p-db40c987.entry.js +0 -1
- package/dist/ui-webc/p-ef34d84c.entry.js +0 -1
- package/dist/ui-webc/p-f799b2d8.entry.js +0 -1
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
.drawer {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Mobile style
|
|
6
|
+
*/
|
|
7
|
+
.drawer--container {
|
|
8
|
+
position: fixed;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
right: 0;
|
|
11
|
+
left: 0;
|
|
12
|
+
height: 90%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
transform: translateY(100%);
|
|
15
|
+
background-color: #fefefe;
|
|
16
|
+
box-shadow: 0 0 20px 3px var(--color-gray-200);
|
|
17
|
+
border-top-left-radius: var(--spacing-5);
|
|
18
|
+
border-top-right-radius: var(--spacing-5);
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
margin: 0;
|
|
21
|
+
z-index: 101;
|
|
22
|
+
}
|
|
23
|
+
@keyframes drawerOpen {
|
|
24
|
+
from {
|
|
25
|
+
transform: translateY(100%);
|
|
26
|
+
}
|
|
27
|
+
to {
|
|
28
|
+
transform: translateY(0);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
@keyframes drawerClose {
|
|
32
|
+
from {
|
|
33
|
+
transform: translateY(0);
|
|
34
|
+
}
|
|
35
|
+
to {
|
|
36
|
+
transform: translateY(100%);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
.open {
|
|
40
|
+
animation: drawerOpen 0.3s ease-in-out forwards;
|
|
41
|
+
}
|
|
42
|
+
.close {
|
|
43
|
+
animation: drawerClose 0.3s ease-in-out forwards;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Desktop style
|
|
47
|
+
*/
|
|
48
|
+
@media screen and (min-width: 901px) {
|
|
49
|
+
@keyframes drawerOpen {
|
|
50
|
+
from {
|
|
51
|
+
transform: translateX(100%);
|
|
52
|
+
}
|
|
53
|
+
to {
|
|
54
|
+
transform: translateX(0);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
@keyframes drawerClose {
|
|
58
|
+
from {
|
|
59
|
+
transform: translateX(0);
|
|
60
|
+
}
|
|
61
|
+
to {
|
|
62
|
+
transform: translateX(100%);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.drawer--container {
|
|
67
|
+
top: 0;
|
|
68
|
+
bottom: 0;
|
|
69
|
+
right: 0;
|
|
70
|
+
left: auto;
|
|
71
|
+
left: initial;
|
|
72
|
+
height: 100%;
|
|
73
|
+
max-height: 100%;
|
|
74
|
+
max-width: 90%;
|
|
75
|
+
min-height: 600px;
|
|
76
|
+
width: 430px;
|
|
77
|
+
transform: translateX(100%);
|
|
78
|
+
border-top-left-radius: var(--spacing-5);
|
|
79
|
+
border-bottom-left-radius: var(--spacing-5);
|
|
80
|
+
border-top-right-radius: 0;
|
|
81
|
+
}
|
|
82
|
+
.open {
|
|
83
|
+
animation: drawerOpen 0.3s ease-in-out forwards;
|
|
84
|
+
}
|
|
85
|
+
.close {
|
|
86
|
+
animation: drawerClose 0.3s ease-in-out forwards;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/* Backdrop styles */
|
|
90
|
+
.backdrop {
|
|
91
|
+
position: fixed;
|
|
92
|
+
top: 0;
|
|
93
|
+
bottom: 0;
|
|
94
|
+
left: 0;
|
|
95
|
+
right: 0;
|
|
96
|
+
transition: opacity 0.2s;
|
|
97
|
+
z-index: 100;
|
|
98
|
+
}
|
|
99
|
+
.backdrop-hidden {
|
|
100
|
+
opacity: 0;
|
|
101
|
+
}
|
|
102
|
+
.backdrop-visible {
|
|
103
|
+
opacity: 0.6;
|
|
104
|
+
pointer-events: all;
|
|
105
|
+
background-color: var(--color-gray-200);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Header styles
|
|
109
|
+
*/
|
|
110
|
+
.header--wrapper {
|
|
111
|
+
display: flex;
|
|
112
|
+
position: relative;
|
|
113
|
+
width: 100%;
|
|
114
|
+
height: var(--spacing-20);
|
|
115
|
+
flex-direction: row;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
align-items: center;
|
|
118
|
+
}
|
|
119
|
+
.heading {
|
|
120
|
+
font: var(--type-body-lg);
|
|
121
|
+
font-weight: 600;
|
|
122
|
+
color: var(--color-text-base);
|
|
123
|
+
}
|
|
124
|
+
.content--wrapper {
|
|
125
|
+
padding: 0 var(--spacing-7);
|
|
126
|
+
}
|
|
127
|
+
button {
|
|
128
|
+
z-index: 2;
|
|
129
|
+
pointer-events: all;
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
background: none;
|
|
132
|
+
box-shadow: none;
|
|
133
|
+
position: absolute;
|
|
134
|
+
border: none;
|
|
135
|
+
/*top: calc(50% - 24px);*/
|
|
136
|
+
width: 24px;
|
|
137
|
+
height: 24px;
|
|
138
|
+
padding: 24px;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
}
|
|
143
|
+
.exit-button {
|
|
144
|
+
right: var(--spacing-3);
|
|
145
|
+
}
|
|
146
|
+
.back-button {
|
|
147
|
+
left: var(--spacing-3);
|
|
148
|
+
}
|
|
149
|
+
.visually-hidden {
|
|
150
|
+
clip: rect(0 0 0 0);
|
|
151
|
+
clip-path: inset(50%);
|
|
152
|
+
height: 1px;
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
position: absolute;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
width: 1px;
|
|
157
|
+
}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { h, } from "@stencil/core";
|
|
2
|
+
import focusLock from "dom-focus-lock";
|
|
3
|
+
const backIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-left"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l14 0" /><path d="M5 12l6 6" /><path d="M5 12l6 -6" /></svg>';
|
|
4
|
+
const exitIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-x"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12" /><path d="M6 6l12 12" /></svg>';
|
|
5
|
+
export class ScoutDrawer {
|
|
6
|
+
rootElement;
|
|
7
|
+
/**
|
|
8
|
+
* Open/close state of the drawer.
|
|
9
|
+
*/
|
|
10
|
+
open = false;
|
|
11
|
+
/**
|
|
12
|
+
* Heading within the sheet.
|
|
13
|
+
*/
|
|
14
|
+
heading = "";
|
|
15
|
+
/**
|
|
16
|
+
* Render back button.
|
|
17
|
+
*/
|
|
18
|
+
showBackButton = false;
|
|
19
|
+
/**
|
|
20
|
+
* Back button label.
|
|
21
|
+
*/
|
|
22
|
+
backButtonLabel = "";
|
|
23
|
+
/**
|
|
24
|
+
* Render exit button.
|
|
25
|
+
*/
|
|
26
|
+
showExitButton = false;
|
|
27
|
+
/**
|
|
28
|
+
* Exit button label.
|
|
29
|
+
*/
|
|
30
|
+
exitButtonLabel = "";
|
|
31
|
+
/**
|
|
32
|
+
* Disable backdrop for the drawer.
|
|
33
|
+
*/
|
|
34
|
+
disableBackdrop = false;
|
|
35
|
+
/**
|
|
36
|
+
* Disable drawer content padding. Use only if you have specific use case and you need to use full width.
|
|
37
|
+
*/
|
|
38
|
+
disableContentPadding = false;
|
|
39
|
+
drawerState = "closed";
|
|
40
|
+
focusedNode = null;
|
|
41
|
+
componentWillLoad() {
|
|
42
|
+
this.focusedNode = document.activeElement;
|
|
43
|
+
}
|
|
44
|
+
componentDidLoad() {
|
|
45
|
+
if (this.open) {
|
|
46
|
+
this.setDrawerOpenState(true);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
disconnectedCallback() {
|
|
50
|
+
this.focusedNode;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Fired when clicking backButton (<-)
|
|
54
|
+
*/
|
|
55
|
+
backButtonClicked;
|
|
56
|
+
/**
|
|
57
|
+
* Fired when clicking backButton (X). Also sent when clicking the backdrop.
|
|
58
|
+
*/
|
|
59
|
+
exitButtonClicked;
|
|
60
|
+
onBackButtonClick() {
|
|
61
|
+
this.backButtonClicked.emit();
|
|
62
|
+
}
|
|
63
|
+
onExitButtonClick() {
|
|
64
|
+
this.exitButtonClicked.emit();
|
|
65
|
+
}
|
|
66
|
+
setDrawerOpenState(open) {
|
|
67
|
+
const drawer = this.rootElement.shadowRoot.querySelector(".drawer--container");
|
|
68
|
+
if (!drawer) {
|
|
69
|
+
this.drawerState = open ? "opening" : "closing";
|
|
70
|
+
}
|
|
71
|
+
if (open) {
|
|
72
|
+
this.drawerState = "opening";
|
|
73
|
+
focusLock.on(drawer);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
focusLock.off(drawer);
|
|
77
|
+
this.drawerState = "closing";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
render() {
|
|
81
|
+
const shouldRenderHeader = this.heading || this.showBackButton || this.showExitButton;
|
|
82
|
+
const getDrawerStateClass = (state) => {
|
|
83
|
+
switch (state) {
|
|
84
|
+
case "opening":
|
|
85
|
+
case "open":
|
|
86
|
+
return "open";
|
|
87
|
+
case "closing":
|
|
88
|
+
return "close";
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
return (h("div", { class: "drawer" }, !this.disableBackdrop && (
|
|
92
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: <closable backdrop>
|
|
93
|
+
// biome-ignore lint/a11y/useKeyWithClickEvents: <closable backdrop>
|
|
94
|
+
h("div", { onClick: () => {
|
|
95
|
+
this.onExitButtonClick();
|
|
96
|
+
}, class: `backdrop ${this.drawerState !== "closed" ? "backdrop-visible" : "backdrop-hidden"}` })), h("div", { class: `drawer--container ${getDrawerStateClass(this.drawerState)}`, onAnimationEnd: () => {
|
|
97
|
+
this.drawerState = this.open ? "open" : "closed";
|
|
98
|
+
} }, shouldRenderHeader && (h("div", { class: "header--wrapper" }, this.showBackButton && (h("button", { type: "button", class: "back-button", onClick: () => this.onBackButtonClick() }, h("span", { class: "icon", innerHTML: backIcon }), h("span", { class: "visually-hidden" }, this.backButtonLabel))), this.showExitButton && (h("button", { type: "button", class: "exit-button", onClick: () => this.onExitButtonClick() }, h("span", { class: "icon", innerHTML: exitIcon }), h("span", { class: "visually-hidden" }, this.exitButtonLabel))), this.heading && h("h3", { class: "heading" }, this.heading))), h("div", { class: !this.disableContentPadding && `content--wrapper` }, h("slot", null)))));
|
|
99
|
+
}
|
|
100
|
+
static get is() { return "scout-drawer"; }
|
|
101
|
+
static get encapsulation() { return "shadow"; }
|
|
102
|
+
static get delegatesFocus() { return true; }
|
|
103
|
+
static get originalStyleUrls() {
|
|
104
|
+
return {
|
|
105
|
+
"$": ["drawer.css"]
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
static get styleUrls() {
|
|
109
|
+
return {
|
|
110
|
+
"$": ["drawer.css"]
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
static get properties() {
|
|
114
|
+
return {
|
|
115
|
+
"open": {
|
|
116
|
+
"type": "boolean",
|
|
117
|
+
"mutable": false,
|
|
118
|
+
"complexType": {
|
|
119
|
+
"original": "boolean",
|
|
120
|
+
"resolved": "boolean",
|
|
121
|
+
"references": {}
|
|
122
|
+
},
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": false,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": "Open/close state of the drawer."
|
|
128
|
+
},
|
|
129
|
+
"getter": false,
|
|
130
|
+
"setter": false,
|
|
131
|
+
"reflect": false,
|
|
132
|
+
"attribute": "open",
|
|
133
|
+
"defaultValue": "false"
|
|
134
|
+
},
|
|
135
|
+
"heading": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"mutable": false,
|
|
138
|
+
"complexType": {
|
|
139
|
+
"original": "string",
|
|
140
|
+
"resolved": "string",
|
|
141
|
+
"references": {}
|
|
142
|
+
},
|
|
143
|
+
"required": false,
|
|
144
|
+
"optional": false,
|
|
145
|
+
"docs": {
|
|
146
|
+
"tags": [],
|
|
147
|
+
"text": "Heading within the sheet."
|
|
148
|
+
},
|
|
149
|
+
"getter": false,
|
|
150
|
+
"setter": false,
|
|
151
|
+
"reflect": false,
|
|
152
|
+
"attribute": "heading",
|
|
153
|
+
"defaultValue": "\"\""
|
|
154
|
+
},
|
|
155
|
+
"showBackButton": {
|
|
156
|
+
"type": "boolean",
|
|
157
|
+
"mutable": false,
|
|
158
|
+
"complexType": {
|
|
159
|
+
"original": "boolean",
|
|
160
|
+
"resolved": "boolean",
|
|
161
|
+
"references": {}
|
|
162
|
+
},
|
|
163
|
+
"required": false,
|
|
164
|
+
"optional": false,
|
|
165
|
+
"docs": {
|
|
166
|
+
"tags": [],
|
|
167
|
+
"text": "Render back button."
|
|
168
|
+
},
|
|
169
|
+
"getter": false,
|
|
170
|
+
"setter": false,
|
|
171
|
+
"reflect": false,
|
|
172
|
+
"attribute": "show-back-button",
|
|
173
|
+
"defaultValue": "false"
|
|
174
|
+
},
|
|
175
|
+
"backButtonLabel": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"mutable": false,
|
|
178
|
+
"complexType": {
|
|
179
|
+
"original": "string",
|
|
180
|
+
"resolved": "string",
|
|
181
|
+
"references": {}
|
|
182
|
+
},
|
|
183
|
+
"required": false,
|
|
184
|
+
"optional": false,
|
|
185
|
+
"docs": {
|
|
186
|
+
"tags": [],
|
|
187
|
+
"text": "Back button label."
|
|
188
|
+
},
|
|
189
|
+
"getter": false,
|
|
190
|
+
"setter": false,
|
|
191
|
+
"reflect": false,
|
|
192
|
+
"attribute": "back-button-label",
|
|
193
|
+
"defaultValue": "\"\""
|
|
194
|
+
},
|
|
195
|
+
"showExitButton": {
|
|
196
|
+
"type": "boolean",
|
|
197
|
+
"mutable": false,
|
|
198
|
+
"complexType": {
|
|
199
|
+
"original": "boolean",
|
|
200
|
+
"resolved": "boolean",
|
|
201
|
+
"references": {}
|
|
202
|
+
},
|
|
203
|
+
"required": false,
|
|
204
|
+
"optional": false,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "Render exit button."
|
|
208
|
+
},
|
|
209
|
+
"getter": false,
|
|
210
|
+
"setter": false,
|
|
211
|
+
"reflect": false,
|
|
212
|
+
"attribute": "show-exit-button",
|
|
213
|
+
"defaultValue": "false"
|
|
214
|
+
},
|
|
215
|
+
"exitButtonLabel": {
|
|
216
|
+
"type": "string",
|
|
217
|
+
"mutable": false,
|
|
218
|
+
"complexType": {
|
|
219
|
+
"original": "string",
|
|
220
|
+
"resolved": "string",
|
|
221
|
+
"references": {}
|
|
222
|
+
},
|
|
223
|
+
"required": false,
|
|
224
|
+
"optional": false,
|
|
225
|
+
"docs": {
|
|
226
|
+
"tags": [],
|
|
227
|
+
"text": "Exit button label."
|
|
228
|
+
},
|
|
229
|
+
"getter": false,
|
|
230
|
+
"setter": false,
|
|
231
|
+
"reflect": false,
|
|
232
|
+
"attribute": "exit-button-label",
|
|
233
|
+
"defaultValue": "\"\""
|
|
234
|
+
},
|
|
235
|
+
"disableBackdrop": {
|
|
236
|
+
"type": "boolean",
|
|
237
|
+
"mutable": false,
|
|
238
|
+
"complexType": {
|
|
239
|
+
"original": "boolean",
|
|
240
|
+
"resolved": "boolean",
|
|
241
|
+
"references": {}
|
|
242
|
+
},
|
|
243
|
+
"required": false,
|
|
244
|
+
"optional": false,
|
|
245
|
+
"docs": {
|
|
246
|
+
"tags": [],
|
|
247
|
+
"text": "Disable backdrop for the drawer."
|
|
248
|
+
},
|
|
249
|
+
"getter": false,
|
|
250
|
+
"setter": false,
|
|
251
|
+
"reflect": false,
|
|
252
|
+
"attribute": "disable-backdrop",
|
|
253
|
+
"defaultValue": "false"
|
|
254
|
+
},
|
|
255
|
+
"disableContentPadding": {
|
|
256
|
+
"type": "boolean",
|
|
257
|
+
"mutable": false,
|
|
258
|
+
"complexType": {
|
|
259
|
+
"original": "boolean",
|
|
260
|
+
"resolved": "boolean",
|
|
261
|
+
"references": {}
|
|
262
|
+
},
|
|
263
|
+
"required": false,
|
|
264
|
+
"optional": false,
|
|
265
|
+
"docs": {
|
|
266
|
+
"tags": [],
|
|
267
|
+
"text": "Disable drawer content padding. Use only if you have specific use case and you need to use full width."
|
|
268
|
+
},
|
|
269
|
+
"getter": false,
|
|
270
|
+
"setter": false,
|
|
271
|
+
"reflect": false,
|
|
272
|
+
"attribute": "disable-content-padding",
|
|
273
|
+
"defaultValue": "false"
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
static get states() {
|
|
278
|
+
return {
|
|
279
|
+
"drawerState": {},
|
|
280
|
+
"focusedNode": {}
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
static get events() {
|
|
284
|
+
return [{
|
|
285
|
+
"method": "backButtonClicked",
|
|
286
|
+
"name": "backButtonClicked",
|
|
287
|
+
"bubbles": true,
|
|
288
|
+
"cancelable": true,
|
|
289
|
+
"composed": true,
|
|
290
|
+
"docs": {
|
|
291
|
+
"tags": [],
|
|
292
|
+
"text": "Fired when clicking backButton (<-)"
|
|
293
|
+
},
|
|
294
|
+
"complexType": {
|
|
295
|
+
"original": "void",
|
|
296
|
+
"resolved": "void",
|
|
297
|
+
"references": {}
|
|
298
|
+
}
|
|
299
|
+
}, {
|
|
300
|
+
"method": "exitButtonClicked",
|
|
301
|
+
"name": "exitButtonClicked",
|
|
302
|
+
"bubbles": true,
|
|
303
|
+
"cancelable": true,
|
|
304
|
+
"composed": true,
|
|
305
|
+
"docs": {
|
|
306
|
+
"tags": [],
|
|
307
|
+
"text": "Fired when clicking backButton (X). Also sent when clicking the backdrop."
|
|
308
|
+
},
|
|
309
|
+
"complexType": {
|
|
310
|
+
"original": "void",
|
|
311
|
+
"resolved": "void",
|
|
312
|
+
"references": {}
|
|
313
|
+
}
|
|
314
|
+
}];
|
|
315
|
+
}
|
|
316
|
+
static get elementRef() { return "rootElement"; }
|
|
317
|
+
static get watchers() {
|
|
318
|
+
return [{
|
|
319
|
+
"propName": "open",
|
|
320
|
+
"methodName": "setDrawerOpenState"
|
|
321
|
+
}];
|
|
322
|
+
}
|
|
323
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
2
|
export class ScoutListView {
|
|
3
3
|
el;
|
|
4
4
|
onScoutChecked(event) {
|
|
@@ -9,8 +9,8 @@ export class ScoutListView {
|
|
|
9
9
|
const listItems = this.el.querySelectorAll("scout-list-view-item");
|
|
10
10
|
const otherRadios = [];
|
|
11
11
|
listItems.forEach((item) => {
|
|
12
|
-
const radios = item.shadowRoot
|
|
13
|
-
radios
|
|
12
|
+
const radios = item.shadowRoot?.querySelectorAll(`input[type="radio"][name="${CSS.escape(element.name)}"]`);
|
|
13
|
+
radios?.forEach((r) => {
|
|
14
14
|
if (r !== element) {
|
|
15
15
|
otherRadios.push(r);
|
|
16
16
|
}
|
|
@@ -21,7 +21,9 @@ export class ScoutListView {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return (
|
|
24
|
+
return (
|
|
25
|
+
// biome-ignore lint/a11y/useSemanticElements: custom-elements are not allowed as children of a <ul>
|
|
26
|
+
h("div", { key: 'a2c79ce8e0fe8028cb7b093f6bf64961a0ef4d05', class: "list", role: "list" }, h("slot", { key: '6a147fbbb385c80325211e9cb009b6af0678dbb6' })));
|
|
25
27
|
}
|
|
26
28
|
static get is() { return "scout-list-view"; }
|
|
27
29
|
static get encapsulation() { return "shadow"; }
|
|
@@ -9,17 +9,29 @@
|
|
|
9
9
|
text-align: inherit;
|
|
10
10
|
min-height: var(--spacing-12);
|
|
11
11
|
color: var(--color-text-base);
|
|
12
|
-
padding: var(--spacing-
|
|
12
|
+
padding: var(--spacing-4) var(--spacing-4);
|
|
13
13
|
cursor: pointer;
|
|
14
|
-
border:
|
|
15
|
-
background-color:
|
|
14
|
+
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
15
|
+
background-color: var(--color-white);
|
|
16
16
|
-webkit-text-decoration: none;
|
|
17
17
|
text-decoration: none;
|
|
18
|
+
border-radius: 6px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host(:first-of-type) .button {
|
|
22
|
+
border-top-left-radius: var(--spacing-4);
|
|
23
|
+
border-top-right-radius: var(--spacing-4);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host(:last-of-type) .button {
|
|
27
|
+
border-bottom-left-radius: var(--spacing-4);
|
|
28
|
+
border-bottom-right-radius: var(--spacing-4);
|
|
18
29
|
}
|
|
19
30
|
|
|
20
31
|
@media (hover: hover) {
|
|
21
32
|
.button:hover {
|
|
22
33
|
background-color: var(--color-background-brand-subtle-hovered);
|
|
34
|
+
border-color: rgba(0, 0, 0, 0.03);
|
|
23
35
|
}
|
|
24
36
|
}
|
|
25
37
|
|
|
@@ -38,7 +50,7 @@
|
|
|
38
50
|
|
|
39
51
|
.prefix-icon {
|
|
40
52
|
justify-content: flex-start;
|
|
41
|
-
width: var(--spacing-
|
|
53
|
+
width: var(--spacing-10);
|
|
42
54
|
}
|
|
43
55
|
|
|
44
56
|
.suffix-icon {
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Host, h, } from "@stencil/core";
|
|
2
|
+
import ChevronRightIcon from "@tabler/icons/outline/chevron-right.svg";
|
|
2
3
|
export class ScoutListViewItem {
|
|
3
4
|
icon;
|
|
4
5
|
primary;
|
|
5
6
|
secondary;
|
|
6
7
|
type = "button";
|
|
8
|
+
/**
|
|
9
|
+
* The action to display on the right side of the item. For example, a
|
|
10
|
+
* chevron. This is purely visual and does not affect the behavior of the item
|
|
11
|
+
* in any way. Not visible when the type is "radio" or "checkbox".
|
|
12
|
+
*/
|
|
13
|
+
action = null;
|
|
7
14
|
href;
|
|
8
15
|
target;
|
|
9
16
|
rel;
|
|
@@ -27,7 +34,7 @@ export class ScoutListViewItem {
|
|
|
27
34
|
(this.target === "_blank" ? "noopener noreferrer" : undefined),
|
|
28
35
|
}
|
|
29
36
|
: {};
|
|
30
|
-
return (h(Host, { key: '
|
|
37
|
+
return (h(Host, { key: 'a91a63b4ed66f3ea5139f83d0024b342cd7095d1', role: "listitem" }, h(Tag, { key: '9c4e5c7e24c0f152f5e13b77a91c9eff0f73192d', class: "button", ...linkProps, onClick: () => this.scoutClick.emit() }, this.getPrefix(), this.getContent(), this.getSuffix())));
|
|
31
38
|
}
|
|
32
39
|
getPrefix() {
|
|
33
40
|
if (!this.icon) {
|
|
@@ -45,6 +52,9 @@ export class ScoutListViewItem {
|
|
|
45
52
|
if (this.type === "checkbox") {
|
|
46
53
|
return (h("scout-checkbox", { name: this.name, value: this.value, checked: this.checked, disabled: this.disabled }));
|
|
47
54
|
}
|
|
55
|
+
if (this.action === "chevron") {
|
|
56
|
+
return (h("div", { class: "suffix-icon" }, h("div", { class: "icon", style: { "--icon": `url(${ChevronRightIcon})` } })));
|
|
57
|
+
}
|
|
48
58
|
return null;
|
|
49
59
|
}
|
|
50
60
|
static get is() { return "scout-list-view-item"; }
|
|
@@ -145,6 +155,32 @@ export class ScoutListViewItem {
|
|
|
145
155
|
"attribute": "type",
|
|
146
156
|
"defaultValue": "\"button\""
|
|
147
157
|
},
|
|
158
|
+
"action": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"mutable": false,
|
|
161
|
+
"complexType": {
|
|
162
|
+
"original": "ActionType",
|
|
163
|
+
"resolved": "\"chevron\"",
|
|
164
|
+
"references": {
|
|
165
|
+
"ActionType": {
|
|
166
|
+
"location": "local",
|
|
167
|
+
"path": "/home/runner/work/j26-components/j26-components/packages/ui-webc/src/components/list-view-item/list-view-item.tsx",
|
|
168
|
+
"id": "src/components/list-view-item/list-view-item.tsx::ActionType"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"optional": false,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": "The action to display on the right side of the item. For example, a\nchevron. This is purely visual and does not affect the behavior of the item\nin any way. Not visible when the type is \"radio\" or \"checkbox\"."
|
|
177
|
+
},
|
|
178
|
+
"getter": false,
|
|
179
|
+
"setter": false,
|
|
180
|
+
"reflect": false,
|
|
181
|
+
"attribute": "action",
|
|
182
|
+
"defaultValue": "null"
|
|
183
|
+
},
|
|
148
184
|
"href": {
|
|
149
185
|
"type": "string",
|
|
150
186
|
"mutable": false,
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
height: var(--spacing-10);
|
|
6
|
+
border: 1px solid var(--color-gray-300);
|
|
7
|
+
border-radius: var(--spacing-2);
|
|
8
|
+
font: var(--type-body-md);
|
|
9
|
+
padding: 0 0.125rem;
|
|
10
|
+
padding: 0 var(--indicator-padding);
|
|
11
|
+
|
|
12
|
+
--indicator-padding: 0.125rem;
|
|
13
|
+
--button-padding: var(--spacing-3);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host(.small) {
|
|
17
|
+
height: var(--spacing-8);
|
|
18
|
+
font: var(--type-body-sm);
|
|
19
|
+
|
|
20
|
+
--button-padding: var(--spacing-2);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.indicator {
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
width: 0;
|
|
28
|
+
height: 100%;
|
|
29
|
+
transition: all 0.2s ease;
|
|
30
|
+
pointer-events: none;
|
|
31
|
+
z-index: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.indicator::after {
|
|
35
|
+
content: "";
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: var(--indicator-padding);
|
|
38
|
+
left: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
bottom: var(--indicator-padding);
|
|
41
|
+
border-radius: 0.375rem;
|
|
42
|
+
background-color: var(--color-background-brand-base);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
::slotted(button) {
|
|
46
|
+
flex: 1;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
padding: 0 var(--button-padding);
|
|
51
|
+
font-size: var(--font-size-2);
|
|
52
|
+
color: var(--color-text-default);
|
|
53
|
+
background-color: transparent;
|
|
54
|
+
border: none;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
transition: color 0.15s ease;
|
|
57
|
+
position: relative;
|
|
58
|
+
z-index: 1;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
::-csstools-invalid-slotted(button):disabled {
|
|
62
|
+
color: var(--color-text-disabled);
|
|
63
|
+
cursor: not-allowed;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
::slotted(button[aria-checked="true"]) {
|
|
67
|
+
color: var(--color-text-brand-inverse);
|
|
68
|
+
}
|