@redvars/peacock 3.3.0 → 3.3.1
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/assets/components.css +1 -1
- package/dist/assets/components.css.map +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/button-group-DA7xoziD.js +292 -0
- package/dist/button-group-DA7xoziD.js.map +1 -0
- package/dist/button-group.js +6 -107
- package/dist/button-group.js.map +1 -1
- package/dist/{button-BGFJfbT2.js → button-trIfcqC7.js} +2 -3
- package/dist/{button-BGFJfbT2.js.map → button-trIfcqC7.js.map} +1 -1
- package/dist/button.js +2 -3
- package/dist/button.js.map +1 -1
- package/dist/{class-map-DpeNtqCn.js → class-map-hJdvjl-W.js} +9 -3
- package/dist/class-map-hJdvjl-W.js.map +1 -0
- package/dist/code-editor.js +5 -5
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +5 -23
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +4706 -2471
- package/dist/custom-elements.json +3444 -1007
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/peacock-loader.js +26 -496
- package/dist/peacock-loader.js.map +1 -1
- package/dist/src/accordion/accordion-item.d.ts +1 -0
- package/dist/src/breadcrumb/breadcrumb/breadcrumb.d.ts +2 -0
- package/dist/src/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +1 -0
- package/dist/src/button/button-group/button-group.d.ts +4 -0
- package/dist/src/code-editor/code-editor.d.ts +4 -3
- package/dist/src/code-highlighter/code-highlighter.d.ts +4 -7
- package/dist/src/index.d.ts +4 -0
- package/dist/src/menu/index.d.ts +3 -0
- package/dist/src/menu/menu/MenuSurfaceController.d.ts +18 -0
- package/dist/src/menu/menu/menu.d.ts +54 -12
- package/dist/src/menu/menu-item/menu-item.d.ts +12 -5
- package/dist/src/menu/sub-menu/sub-menu.d.ts +36 -0
- package/dist/src/pagination/index.d.ts +1 -0
- package/dist/src/pagination/pagination.d.ts +38 -0
- package/dist/src/popover/PopoverController.d.ts +4 -1
- package/dist/src/table/index.d.ts +1 -0
- package/dist/src/table/table.d.ts +110 -0
- package/dist/src/tabs/tab-group.d.ts +4 -0
- package/dist/src/tabs/tab-panel.d.ts +1 -0
- package/dist/src/tabs/tab.d.ts +1 -0
- package/dist/src/tabs/tabs.d.ts +2 -0
- package/dist/src/tooltip/tooltip.d.ts +1 -3
- package/dist/src/tree-view/index.d.ts +2 -0
- package/dist/src/tree-view/tree-node.d.ts +69 -0
- package/dist/src/tree-view/tree-view.d.ts +40 -0
- package/dist/src/tree-view/wc-tree-view.d.ts +6 -0
- package/dist/test/icon.test.d.ts +1 -1
- package/dist/test/menu.test.d.ts +1 -0
- package/dist/test/sub-menu.test.d.ts +1 -0
- package/dist/test/tree-view.test.d.ts +1 -0
- package/dist/{slider-Dk9CFWTG.js → tree-view-CLolVlU0.js} +3317 -1180
- package/dist/tree-view-CLolVlU0.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/readme.md +40 -40
- package/src/accordion/accordion-item.ts +2 -1
- package/src/breadcrumb/breadcrumb/breadcrumb.ts +3 -0
- package/src/breadcrumb/breadcrumb-item/breadcrumb-item.ts +1 -0
- package/src/button/button-group/button-group.ts +6 -0
- package/src/code-editor/code-editor.ts +4 -3
- package/src/code-highlighter/code-highlighter.ts +4 -22
- package/src/divider/divider.scss +2 -2
- package/src/empty-state/empty-state.scss +1 -1
- package/src/empty-state/empty-state.ts +1 -1
- package/src/index.ts +6 -2
- package/src/menu/index.ts +3 -0
- package/src/menu/menu/MenuSurfaceController.ts +61 -0
- package/src/menu/{menu-list/menu-list.scss → menu/menu.scss} +19 -4
- package/src/menu/menu/menu.ts +389 -81
- package/src/menu/menu-item/menu-item.ts +115 -36
- package/src/menu/sub-menu/sub-menu.scss +7 -0
- package/src/menu/sub-menu/sub-menu.ts +243 -0
- package/src/pagination/index.ts +1 -0
- package/src/pagination/pagination.scss +59 -0
- package/src/pagination/pagination.ts +135 -0
- package/src/peacock-loader.ts +25 -11
- package/src/popover/PopoverController.ts +13 -7
- package/src/table/index.ts +1 -0
- package/src/table/table.scss +174 -0
- package/src/table/table.ts +475 -0
- package/src/tabs/tab-group.ts +12 -6
- package/src/tabs/tab-panel.ts +1 -0
- package/src/tabs/tab.ts +1 -0
- package/src/tabs/tabs.scss +6 -5
- package/src/tabs/tabs.ts +5 -3
- package/src/text/text.css-component.scss +6 -3
- package/src/tooltip/tooltip.scss +16 -13
- package/src/tooltip/tooltip.ts +7 -9
- package/src/tree-view/demo/index.html +57 -0
- package/src/tree-view/index.ts +2 -0
- package/src/tree-view/tree-node.scss +101 -0
- package/src/tree-view/tree-node.ts +268 -0
- package/src/tree-view/tree-view.scss +12 -0
- package/src/tree-view/tree-view.ts +182 -0
- package/src/tree-view/wc-tree-view.ts +9 -0
- package/dist/class-map-DpeNtqCn.js.map +0 -1
- package/dist/slider-Dk9CFWTG.js.map +0 -1
- package/dist/src/menu/menu-list/menu-list.d.ts +0 -22
- package/dist/state-8v48Exzh.js +0 -10
- package/dist/state-8v48Exzh.js.map +0 -1
- package/src/menu/menu-list/menu-list.ts +0 -48
package/src/peacock-loader.ts
CHANGED
|
@@ -22,7 +22,7 @@ import { Checkbox } from './checkbox/checkbox.js';
|
|
|
22
22
|
|
|
23
23
|
import { Menu } from './menu/menu/menu.js';
|
|
24
24
|
import { MenuItem } from './menu/menu-item/menu-item.js';
|
|
25
|
-
import {
|
|
25
|
+
import { SubMenu } from './menu/sub-menu/sub-menu.js';
|
|
26
26
|
|
|
27
27
|
import { Accordion } from './accordion/accordion.js';
|
|
28
28
|
import { Link } from './link/link.js';
|
|
@@ -48,10 +48,12 @@ import { Tabs } from './tabs/tabs.js';
|
|
|
48
48
|
import { Tab } from './tabs/tab.js';
|
|
49
49
|
import { TabPanel } from './tabs/tab-panel.js';
|
|
50
50
|
import { Slider } from './slider/slider.js';
|
|
51
|
-
|
|
51
|
+
import { Table } from './table/table.js';
|
|
52
|
+
import { Pagination } from './pagination/pagination.js';
|
|
53
|
+
import { TreeView } from './tree-view/tree-view.js';
|
|
52
54
|
|
|
53
55
|
const distDirectory = `${import.meta.url}/..`;
|
|
54
|
-
await loadCSS(`${distDirectory
|
|
56
|
+
await loadCSS(`${distDirectory}/assets/styles.css`);
|
|
55
57
|
|
|
56
58
|
/*
|
|
57
59
|
import tooltipStyles from './popover/tooltip.css-component.scss';
|
|
@@ -122,7 +124,7 @@ const loaderConfig: LoaderConfig = {
|
|
|
122
124
|
CustomElementClass: TabGroup,
|
|
123
125
|
},
|
|
124
126
|
'wc-tab': {
|
|
125
|
-
CustomElementClass: Tab
|
|
127
|
+
CustomElementClass: Tab,
|
|
126
128
|
},
|
|
127
129
|
'wc-tab-panel': {
|
|
128
130
|
CustomElementClass: TabPanel,
|
|
@@ -194,30 +196,42 @@ const loaderConfig: LoaderConfig = {
|
|
|
194
196
|
'wc-empty-state': {
|
|
195
197
|
CustomElementClass: EmptyState,
|
|
196
198
|
},
|
|
197
|
-
'wc-
|
|
199
|
+
'wc-menu': {
|
|
198
200
|
CustomElementClass: Menu,
|
|
199
201
|
},
|
|
200
202
|
'wc-menu-item': {
|
|
201
203
|
CustomElementClass: MenuItem,
|
|
202
204
|
},
|
|
203
|
-
'wc-menu
|
|
204
|
-
CustomElementClass:
|
|
205
|
+
'wc-sub-menu': {
|
|
206
|
+
CustomElementClass: SubMenu,
|
|
205
207
|
},
|
|
206
208
|
'wc-container': {
|
|
207
|
-
CustomElementClass: Container
|
|
209
|
+
CustomElementClass: Container,
|
|
208
210
|
},
|
|
209
211
|
'wc-image': {
|
|
210
|
-
CustomElementClass: Image
|
|
212
|
+
CustomElementClass: Image,
|
|
211
213
|
},
|
|
212
214
|
'wc-slider': {
|
|
213
|
-
CustomElementClass: Slider
|
|
215
|
+
CustomElementClass: Slider,
|
|
216
|
+
},
|
|
217
|
+
'wc-table': {
|
|
218
|
+
CustomElementClass: Table,
|
|
219
|
+
},
|
|
220
|
+
'wc-pagination': {
|
|
221
|
+
CustomElementClass: Pagination,
|
|
222
|
+
},
|
|
223
|
+
'wc-tree-view': {
|
|
224
|
+
CustomElementClass: TreeView,
|
|
225
|
+
},
|
|
226
|
+
'wc-tree-node': {
|
|
227
|
+
CustomElementClass: TreeView.Node,
|
|
214
228
|
},
|
|
215
229
|
'wc-chart-doughnut': {
|
|
216
230
|
importPath: `${distDirectory}/chart-doughnut.js`,
|
|
217
231
|
},
|
|
218
232
|
'wc-chart-pie': {
|
|
219
233
|
importPath: `${distDirectory}/chart-pie.js`,
|
|
220
|
-
}
|
|
234
|
+
},
|
|
221
235
|
},
|
|
222
236
|
};
|
|
223
237
|
|
|
@@ -22,19 +22,25 @@ export class PopoverController implements ReactiveController {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// Set up the floating logic
|
|
25
|
-
async updatePosition(
|
|
25
|
+
async updatePosition(
|
|
26
|
+
reference: HTMLElement | null,
|
|
27
|
+
floating: HTMLElement,
|
|
28
|
+
options?: {
|
|
29
|
+
placement?: Placement;
|
|
30
|
+
offset?: number;
|
|
31
|
+
},
|
|
32
|
+
) {
|
|
26
33
|
if (!reference) return;
|
|
27
34
|
|
|
28
35
|
this.cleanup?.();
|
|
29
36
|
|
|
37
|
+
const placement = options?.placement ?? this.options.placement;
|
|
38
|
+
const spacing = options?.offset ?? this.options.offset;
|
|
39
|
+
|
|
30
40
|
this.cleanup = autoUpdate(reference, floating, async () => {
|
|
31
41
|
const { x, y } = await computePosition(reference, floating, {
|
|
32
|
-
placement
|
|
33
|
-
middleware: [
|
|
34
|
-
offset(this.options.offset),
|
|
35
|
-
flip(),
|
|
36
|
-
shift({ padding: 4 }),
|
|
37
|
-
],
|
|
42
|
+
placement,
|
|
43
|
+
middleware: [offset(spacing), flip(), shift({ padding: 4 })],
|
|
38
44
|
});
|
|
39
45
|
|
|
40
46
|
Object.assign(floating.style, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table } from './table.js';
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
@use '../../scss/mixin';
|
|
2
|
+
|
|
3
|
+
@include mixin.base-styles;
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
height: 100%;
|
|
8
|
+
min-height: 20em;
|
|
9
|
+
--table-border-color: var(--color-outline-variant);
|
|
10
|
+
--table-border: 1px solid var(--table-border-color);
|
|
11
|
+
--table-col-content-padding: var(--spacing-150, 0.75rem) var(--spacing-200, 1rem);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.table {
|
|
15
|
+
height: 100%;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
background: var(--color-surface, #fff);
|
|
19
|
+
|
|
20
|
+
@include mixin.get-typography-not-important('body-medium');
|
|
21
|
+
|
|
22
|
+
.table-scroll-container {
|
|
23
|
+
position: relative;
|
|
24
|
+
overflow: auto;
|
|
25
|
+
height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.empty-table {
|
|
29
|
+
height: 80%;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
|
|
34
|
+
.empty-state {
|
|
35
|
+
width: 10rem;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
wc-pagination {
|
|
40
|
+
border-top: 1px solid var(--table-border-color);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.horizontal-scrolled {
|
|
44
|
+
.fixed-columns::after {
|
|
45
|
+
box-shadow: 10px 0 20px -20px var(--color-outline) inset;
|
|
46
|
+
content: ' ';
|
|
47
|
+
height: 100%;
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0;
|
|
50
|
+
right: -20px;
|
|
51
|
+
width: 20px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.row {
|
|
57
|
+
display: flex;
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
width: max-content;
|
|
60
|
+
min-width: 100%;
|
|
61
|
+
|
|
62
|
+
.columns-container {
|
|
63
|
+
display: flex;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.col {
|
|
67
|
+
margin: 0;
|
|
68
|
+
color: var(--color-on-surface);
|
|
69
|
+
flex-shrink: 0;
|
|
70
|
+
|
|
71
|
+
.col-content {
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
height: 100%;
|
|
75
|
+
|
|
76
|
+
.col-text {
|
|
77
|
+
padding: var(--table-col-content-padding);
|
|
78
|
+
flex: 1;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
text-overflow: ellipsis;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.col-template {
|
|
85
|
+
width: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.col-action {
|
|
89
|
+
--button-border-radius: 0;
|
|
90
|
+
|
|
91
|
+
&.has-focus {
|
|
92
|
+
z-index: 12;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.checkbox {
|
|
97
|
+
padding: 0 var(--spacing-100, 0.5rem);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&.center .col-content {
|
|
102
|
+
justify-content: center;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:last-child {
|
|
106
|
+
flex: 1;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.fixed-columns {
|
|
111
|
+
position: sticky;
|
|
112
|
+
left: 0;
|
|
113
|
+
z-index: 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.scrollable-columns {
|
|
117
|
+
flex: 0 0 auto;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.header {
|
|
122
|
+
z-index: 2;
|
|
123
|
+
position: sticky;
|
|
124
|
+
top: 0;
|
|
125
|
+
|
|
126
|
+
@include mixin.get-typography-not-important('label-medium');
|
|
127
|
+
|
|
128
|
+
.col {
|
|
129
|
+
background: var(--color-surface-variant, #f4f4f4);
|
|
130
|
+
|
|
131
|
+
&.sort {
|
|
132
|
+
background: var(--color-secondary-container, #e8eaf6);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.body {
|
|
138
|
+
.row {
|
|
139
|
+
.col {
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
background: var(--color-surface, #fff);
|
|
142
|
+
border-bottom: 1px solid var(--color-surface-variant, #f4f4f4);
|
|
143
|
+
|
|
144
|
+
&.col-checkbox .col-content {
|
|
145
|
+
border: 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.col-content {
|
|
149
|
+
border: 2px solid transparent;
|
|
150
|
+
border-bottom: 1px solid transparent;
|
|
151
|
+
|
|
152
|
+
.col-text {
|
|
153
|
+
text-wrap: wrap;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&:focus {
|
|
158
|
+
outline: none;
|
|
159
|
+
border-bottom-color: var(--color-primary);
|
|
160
|
+
z-index: 1;
|
|
161
|
+
|
|
162
|
+
.col-content {
|
|
163
|
+
border-color: var(--color-primary);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&:hover {
|
|
169
|
+
.col {
|
|
170
|
+
background-color: var(--color-surface-container-low, #f8f8f8);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|