@rettangoli/ui 0.1.30 → 0.1.32-rc1
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/README.md +20 -85
- package/dist/rettangoli-iife-layout.min.js +113 -173
- package/dist/rettangoli-iife-ui.min.js +123 -183
- package/package.json +5 -4
- package/src/common/dimensions.js +72 -0
- package/src/common/link.js +111 -0
- package/src/common/responsive.js +8 -0
- package/src/common.js +43 -8
- package/src/components/accordionItem/accordionItem.handlers.js +1 -1
- package/src/components/accordionItem/accordionItem.schema.yaml +14 -0
- package/src/components/accordionItem/accordionItem.store.js +8 -8
- package/src/components/accordionItem/accordionItem.view.yaml +9 -38
- package/src/components/breadcrumb/breadcrumb.handlers.js +24 -3
- package/src/components/breadcrumb/breadcrumb.schema.yaml +51 -0
- package/src/components/breadcrumb/breadcrumb.store.js +66 -10
- package/src/components/breadcrumb/breadcrumb.view.yaml +18 -58
- package/src/components/dropdownMenu/dropdownMenu.handlers.js +17 -3
- package/src/components/dropdownMenu/dropdownMenu.schema.yaml +64 -0
- package/src/components/dropdownMenu/dropdownMenu.store.js +48 -6
- package/src/components/dropdownMenu/dropdownMenu.view.yaml +24 -46
- package/src/components/form/form.handlers.js +25 -108
- package/src/components/form/form.schema.yaml +283 -0
- package/src/components/form/form.store.js +19 -14
- package/src/components/form/form.view.yaml +28 -319
- package/src/components/globalUi/globalUi.handlers.js +2 -2
- package/src/components/globalUi/globalUi.schema.yaml +8 -0
- package/src/components/globalUi/globalUi.store.js +8 -8
- package/src/components/globalUi/globalUi.view.yaml +9 -46
- package/src/components/navbar/navbar.handlers.js +1 -1
- package/src/components/navbar/navbar.schema.yaml +25 -0
- package/src/components/navbar/navbar.store.js +28 -14
- package/src/components/navbar/navbar.view.yaml +21 -65
- package/src/components/pageOutline/pageOutline.handlers.js +17 -11
- package/src/components/pageOutline/pageOutline.schema.yaml +16 -0
- package/src/components/pageOutline/pageOutline.store.js +6 -7
- package/src/components/pageOutline/pageOutline.view.yaml +1 -29
- package/src/components/popoverInput/popoverInput.handlers.js +31 -31
- package/src/components/popoverInput/popoverInput.schema.yaml +18 -0
- package/src/components/popoverInput/popoverInput.store.js +9 -9
- package/src/components/popoverInput/popoverInput.view.yaml +5 -22
- package/src/components/select/select.handlers.js +31 -35
- package/src/components/select/select.schema.yaml +36 -0
- package/src/components/select/select.store.js +34 -35
- package/src/components/select/select.view.yaml +13 -56
- package/src/components/sidebar/sidebar.handlers.js +5 -5
- package/src/components/sidebar/sidebar.schema.yaml +57 -0
- package/src/components/sidebar/sidebar.store.js +45 -23
- package/src/components/sidebar/sidebar.view.yaml +79 -174
- package/src/components/sliderInput/sliderInput.handlers.js +28 -8
- package/src/components/sliderInput/sliderInput.schema.yaml +27 -0
- package/src/components/sliderInput/sliderInput.store.js +9 -9
- package/src/components/sliderInput/sliderInput.view.yaml +8 -33
- package/src/components/table/table.handlers.js +3 -3
- package/src/components/table/table.schema.yaml +27 -0
- package/src/components/table/table.store.js +8 -8
- package/src/components/table/table.view.yaml +16 -62
- package/src/components/tabs/tabs.schema.yaml +26 -0
- package/src/components/tabs/tabs.store.js +12 -9
- package/src/components/tabs/tabs.view.yaml +4 -60
- package/src/components/tooltip/tooltip.schema.yaml +18 -0
- package/src/components/tooltip/tooltip.store.js +7 -7
- package/src/components/tooltip/tooltip.view.yaml +4 -22
- package/src/components/waveform/waveform.handlers.js +6 -6
- package/src/components/waveform/waveform.schema.yaml +25 -0
- package/src/components/waveform/waveform.store.js +6 -6
- package/src/components/waveform/waveform.view.yaml +6 -34
- package/src/deps/createGlobalUI.js +2 -2
- package/src/primitives/button.js +200 -114
- package/src/primitives/colorPicker.js +56 -50
- package/src/primitives/dialog.js +2 -1
- package/src/primitives/image.js +73 -103
- package/src/primitives/input-number.js +139 -93
- package/src/primitives/input.js +87 -64
- package/src/primitives/popover.js +36 -28
- package/src/primitives/slider.js +6 -4
- package/src/primitives/svg.js +9 -10
- package/src/primitives/text.js +26 -47
- package/src/primitives/textarea.js +25 -9
- package/src/primitives/view.js +49 -90
- package/src/setup.js +1 -7
- package/src/styles/buttonMarginStyles.js +1 -13
- package/src/styles/cursorStyles.js +1 -5
- package/src/styles/flexDirectionStyles.js +4 -4
- package/src/styles/marginStylesForTarget.js +13 -0
- package/src/styles/textColorStyles.js +14 -6
- package/src/styles/textStyles.js +4 -4
- package/src/styles/viewStyles.js +6 -6
- package/src/styles/viewStylesForTarget.js +58 -0
- package/src/styles/flexChildStyles.js +0 -43
|
@@ -1,125 +1,9 @@
|
|
|
1
|
-
elementName: rtgl-sidebar
|
|
2
|
-
|
|
3
|
-
viewDataSchema:
|
|
4
|
-
type: object
|
|
5
|
-
properties:
|
|
6
|
-
containerAttrString:
|
|
7
|
-
type: string
|
|
8
|
-
mode:
|
|
9
|
-
type: string
|
|
10
|
-
enum: ['full', 'shrunk', 'shrunk-lg']
|
|
11
|
-
default: 'full'
|
|
12
|
-
sidebarWidth:
|
|
13
|
-
type: number
|
|
14
|
-
headerAlign:
|
|
15
|
-
type: string
|
|
16
|
-
itemAlign:
|
|
17
|
-
type: string
|
|
18
|
-
headerPadding:
|
|
19
|
-
type: string
|
|
20
|
-
itemPadding:
|
|
21
|
-
type: string
|
|
22
|
-
itemHeight:
|
|
23
|
-
type: number
|
|
24
|
-
iconSize:
|
|
25
|
-
type: number
|
|
26
|
-
firstLetterSize:
|
|
27
|
-
type: string
|
|
28
|
-
showLabels:
|
|
29
|
-
type: boolean
|
|
30
|
-
showGroupLabels:
|
|
31
|
-
type: boolean
|
|
32
|
-
itemContentAlign:
|
|
33
|
-
type: string
|
|
34
|
-
itemAlignAttr:
|
|
35
|
-
type: string
|
|
36
|
-
itemWidth:
|
|
37
|
-
type: string
|
|
38
|
-
headerWidth:
|
|
39
|
-
type: string
|
|
40
|
-
selectedItemId:
|
|
41
|
-
type: string
|
|
42
|
-
header:
|
|
43
|
-
type: object
|
|
44
|
-
properties:
|
|
45
|
-
label:
|
|
46
|
-
type: string
|
|
47
|
-
href:
|
|
48
|
-
type: string
|
|
49
|
-
image:
|
|
50
|
-
type: object
|
|
51
|
-
properties:
|
|
52
|
-
src:
|
|
53
|
-
type: string
|
|
54
|
-
width:
|
|
55
|
-
type: number
|
|
56
|
-
height:
|
|
57
|
-
type: number
|
|
58
|
-
alt:
|
|
59
|
-
type: string
|
|
60
|
-
items:
|
|
61
|
-
type: array
|
|
62
|
-
items:
|
|
63
|
-
type: object
|
|
64
|
-
properties:
|
|
65
|
-
title:
|
|
66
|
-
type: string
|
|
67
|
-
slug:
|
|
68
|
-
type: string
|
|
69
|
-
type:
|
|
70
|
-
type: string
|
|
71
|
-
active:
|
|
72
|
-
type: boolean
|
|
73
|
-
icon:
|
|
74
|
-
type: string
|
|
75
|
-
|
|
76
|
-
propsSchema:
|
|
77
|
-
type: object
|
|
78
|
-
properties:
|
|
79
|
-
selectedItemId:
|
|
80
|
-
type: string
|
|
81
|
-
header:
|
|
82
|
-
type: object
|
|
83
|
-
properties:
|
|
84
|
-
label:
|
|
85
|
-
type: string
|
|
86
|
-
href:
|
|
87
|
-
type: string
|
|
88
|
-
testId:
|
|
89
|
-
type: string
|
|
90
|
-
image:
|
|
91
|
-
type: object
|
|
92
|
-
properties:
|
|
93
|
-
src:
|
|
94
|
-
type: string
|
|
95
|
-
width:
|
|
96
|
-
type: number
|
|
97
|
-
height:
|
|
98
|
-
type: number
|
|
99
|
-
alt:
|
|
100
|
-
type: string
|
|
101
|
-
items:
|
|
102
|
-
type: array
|
|
103
|
-
items:
|
|
104
|
-
type: object
|
|
105
|
-
properties:
|
|
106
|
-
title:
|
|
107
|
-
type: string
|
|
108
|
-
slug:
|
|
109
|
-
type: string
|
|
110
|
-
type:
|
|
111
|
-
type: string
|
|
112
|
-
items:
|
|
113
|
-
type: array
|
|
114
|
-
testId:
|
|
115
|
-
type: string
|
|
116
|
-
|
|
117
1
|
refs:
|
|
118
|
-
|
|
2
|
+
headerImage:
|
|
119
3
|
eventListeners:
|
|
120
4
|
click:
|
|
121
5
|
handler: handleHeaderClick
|
|
122
|
-
|
|
6
|
+
headerLabel:
|
|
123
7
|
eventListeners:
|
|
124
8
|
click:
|
|
125
9
|
handler: handleHeaderClick
|
|
@@ -127,68 +11,89 @@ refs:
|
|
|
127
11
|
eventListeners:
|
|
128
12
|
click:
|
|
129
13
|
handler: handleHeaderClick
|
|
130
|
-
item
|
|
14
|
+
item*:
|
|
131
15
|
eventListeners:
|
|
132
16
|
click:
|
|
133
17
|
handler: handleItemClick
|
|
134
|
-
|
|
135
|
-
events:
|
|
136
|
-
headerClick:
|
|
137
|
-
type: object
|
|
138
|
-
properties:
|
|
139
|
-
path:
|
|
140
|
-
type: string
|
|
141
|
-
|
|
142
18
|
anchors:
|
|
143
|
-
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
- rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}":
|
|
19
|
+
- - $if header.image && header.image.src:
|
|
20
|
+
- $if header.image.href:
|
|
21
|
+
- a href=${header.image.href}:
|
|
22
|
+
- rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}": null
|
|
23
|
+
$elif header.image.path:
|
|
24
|
+
- rtgl-view#headerImage cur=pointer:
|
|
25
|
+
- rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}": null
|
|
26
|
+
$else:
|
|
27
|
+
- rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}": null
|
|
153
28
|
- $if header.label && showLabels:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
29
|
+
- $if header.labelHref:
|
|
30
|
+
- rtgl-text href=${header.labelHref} s=lg: ${header.label}
|
|
31
|
+
$elif header.labelPath:
|
|
32
|
+
- rtgl-view#headerLabel cur=pointer:
|
|
33
|
+
- rtgl-text s=lg: ${header.label}
|
|
34
|
+
$else:
|
|
35
|
+
- rtgl-text s=lg: ${header.label}
|
|
162
36
|
template:
|
|
163
37
|
- rtgl-view h=f w=${sidebarWidth} bwr=xs ah=${ah} ${containerAttrString}:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
38
|
+
- rtgl-view ph=${headerPadding} pv=lg:
|
|
39
|
+
- $if header.href:
|
|
40
|
+
- rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}:
|
|
41
|
+
- - $if header.image && header.image.src:
|
|
42
|
+
- $if header.image.href:
|
|
43
|
+
- a href=${header.image.href}:
|
|
44
|
+
- rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}": null
|
|
45
|
+
$elif header.image.path:
|
|
46
|
+
- rtgl-view#headerImage cur=pointer:
|
|
47
|
+
- rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}": null
|
|
48
|
+
$else:
|
|
49
|
+
- rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}": null
|
|
50
|
+
- $if header.label && showLabels:
|
|
51
|
+
- $if header.labelHref:
|
|
52
|
+
- rtgl-text href=${header.labelHref} s=lg: ${header.label}
|
|
53
|
+
$elif header.labelPath:
|
|
54
|
+
- rtgl-view#headerLabel cur=pointer:
|
|
55
|
+
- rtgl-text s=lg: ${header.label}
|
|
56
|
+
$else:
|
|
57
|
+
- rtgl-text s=lg: ${header.label}
|
|
58
|
+
$else:
|
|
59
|
+
- rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=pointer data-testid=${header.testId}:
|
|
60
|
+
- - $if header.image && header.image.src:
|
|
61
|
+
- $if header.image.href:
|
|
62
|
+
- a href=${header.image.href}:
|
|
63
|
+
- rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}": null
|
|
64
|
+
$elif header.image.path:
|
|
65
|
+
- rtgl-view#headerImage cur=pointer:
|
|
66
|
+
- rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}": null
|
|
67
|
+
$else:
|
|
68
|
+
- rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}": null
|
|
69
|
+
- $if header.label && showLabels:
|
|
70
|
+
- $if header.labelHref:
|
|
71
|
+
- rtgl-text href=${header.labelHref} s=lg: ${header.label}
|
|
72
|
+
$elif header.labelPath:
|
|
73
|
+
- rtgl-view#headerLabel cur=pointer:
|
|
74
|
+
- rtgl-text s=lg: ${header.label}
|
|
75
|
+
$else:
|
|
76
|
+
- rtgl-text s=lg: ${header.label}
|
|
77
|
+
- rtgl-view w=f ph=${headerPadding} pb=lg g=xs ah=${ah}:
|
|
78
|
+
- $for item, i in items:
|
|
79
|
+
- $if item.type == "groupLabel":
|
|
80
|
+
- $if showGroupLabels:
|
|
81
|
+
- rtgl-view mt=md h=32 av=c ph=md:
|
|
82
|
+
- rtgl-text s=xs c=mu-fg: ${item.title}
|
|
187
83
|
$else:
|
|
188
|
-
- rtgl-
|
|
84
|
+
- rtgl-view mt=md h=1 bgc=mu: null
|
|
189
85
|
$else:
|
|
190
|
-
- $
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
86
|
+
- rtgl-view#item${i} data-item-id=${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=pointer data-testid=${item.testId}:
|
|
87
|
+
- $if item.icon:
|
|
88
|
+
- $if showLabels:
|
|
89
|
+
- rtgl-view d=h ah=${itemContentAlign} g=sm:
|
|
90
|
+
- rtgl-svg wh=16 svg=${item.icon} c=fg: null
|
|
91
|
+
- rtgl-text s=sm: ${item.title}
|
|
92
|
+
$else:
|
|
93
|
+
- rtgl-svg wh=${iconSize} svg=${item.icon} c=fg: null
|
|
94
|
+
$else:
|
|
95
|
+
- $if showLabels:
|
|
96
|
+
- rtgl-text s=sm: ${item.title}
|
|
97
|
+
$else:
|
|
98
|
+
- rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c:
|
|
99
|
+
- rtgl-text s=${firstLetterSize} c=fg: ${item.title.charAt(0).toUpperCase()}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export const handleBeforeMount = (deps) => {
|
|
2
|
-
const { store,
|
|
3
|
-
store.setValue(
|
|
2
|
+
const { store, props } = deps;
|
|
3
|
+
store.setValue({ value: props.value ?? 0 });
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
export const handleOnUpdate = (deps, payload) => {
|
|
7
|
-
const {
|
|
7
|
+
const { oldProps, newProps } = payload;
|
|
8
8
|
const { store, render } = deps;
|
|
9
9
|
|
|
10
|
-
if (
|
|
11
|
-
const value =
|
|
12
|
-
store.setValue(value);
|
|
10
|
+
if (oldProps?.value !== newProps?.value) {
|
|
11
|
+
const value = newProps?.value ?? 0;
|
|
12
|
+
store.setValue({ value });
|
|
13
13
|
render();
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -19,14 +19,34 @@ export const handleValueChange = (deps, payload) => {
|
|
|
19
19
|
const event = payload._event;
|
|
20
20
|
const newValue = Number(event.detail.value);
|
|
21
21
|
|
|
22
|
-
store.setValue(newValue);
|
|
22
|
+
store.setValue({ value: newValue });
|
|
23
23
|
|
|
24
24
|
// Re-render to sync slider and input
|
|
25
25
|
render();
|
|
26
26
|
|
|
27
27
|
// Dispatch event for external listeners
|
|
28
28
|
dispatchEvent(
|
|
29
|
-
new CustomEvent("
|
|
29
|
+
new CustomEvent("value-change", {
|
|
30
|
+
detail: {
|
|
31
|
+
value: newValue,
|
|
32
|
+
},
|
|
33
|
+
bubbles: true,
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const handleValueInput = (deps, payload) => {
|
|
39
|
+
const { store, render, dispatchEvent } = deps;
|
|
40
|
+
const event = payload._event;
|
|
41
|
+
const newValue = Number(event.detail.value);
|
|
42
|
+
|
|
43
|
+
store.setValue({ value: newValue });
|
|
44
|
+
|
|
45
|
+
// Re-render to sync slider and input
|
|
46
|
+
render();
|
|
47
|
+
|
|
48
|
+
dispatchEvent(
|
|
49
|
+
new CustomEvent("value-input", {
|
|
30
50
|
detail: {
|
|
31
51
|
value: newValue,
|
|
32
52
|
},
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
componentName: rtgl-slider-input
|
|
2
|
+
propsSchema:
|
|
3
|
+
type: object
|
|
4
|
+
properties:
|
|
5
|
+
key:
|
|
6
|
+
type: string
|
|
7
|
+
value:
|
|
8
|
+
type: string
|
|
9
|
+
default: '0'
|
|
10
|
+
w:
|
|
11
|
+
type: string
|
|
12
|
+
default: ''
|
|
13
|
+
min:
|
|
14
|
+
type: string
|
|
15
|
+
default: '0'
|
|
16
|
+
max:
|
|
17
|
+
type: string
|
|
18
|
+
default: '100'
|
|
19
|
+
step:
|
|
20
|
+
type: string
|
|
21
|
+
default: '1'
|
|
22
|
+
events:
|
|
23
|
+
value-input: {}
|
|
24
|
+
value-change: {}
|
|
25
|
+
methods:
|
|
26
|
+
type: object
|
|
27
|
+
properties: {}
|
|
@@ -2,17 +2,17 @@ export const createInitialState = () => Object.freeze({
|
|
|
2
2
|
value: 0
|
|
3
3
|
});
|
|
4
4
|
|
|
5
|
-
export const selectViewData = ({ state,
|
|
5
|
+
export const selectViewData = ({ state, props }) => {
|
|
6
6
|
return {
|
|
7
|
-
key:
|
|
7
|
+
key: props.key,
|
|
8
8
|
value: state.value,
|
|
9
|
-
w:
|
|
10
|
-
min:
|
|
11
|
-
max:
|
|
12
|
-
step:
|
|
9
|
+
w: props.w || '',
|
|
10
|
+
min: props.min || 0,
|
|
11
|
+
max: props.max || 100,
|
|
12
|
+
step: props.step || 1
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export const setValue = (state,
|
|
17
|
-
state.value =
|
|
18
|
-
}
|
|
16
|
+
export const setValue = ({ state }, payload = {}) => {
|
|
17
|
+
state.value = payload.value;
|
|
18
|
+
}
|
|
@@ -1,43 +1,18 @@
|
|
|
1
|
-
elementName: rtgl-slider-input
|
|
2
|
-
|
|
3
|
-
viewDataSchema:
|
|
4
|
-
type: object
|
|
5
|
-
|
|
6
|
-
attrsSchema:
|
|
7
|
-
type: object
|
|
8
|
-
properties:
|
|
9
|
-
value:
|
|
10
|
-
type: string
|
|
11
|
-
default: "0"
|
|
12
|
-
w:
|
|
13
|
-
type: string
|
|
14
|
-
default: ""
|
|
15
|
-
min:
|
|
16
|
-
type: string
|
|
17
|
-
default: "0"
|
|
18
|
-
max:
|
|
19
|
-
type: string
|
|
20
|
-
default: "100"
|
|
21
|
-
step:
|
|
22
|
-
type: string
|
|
23
|
-
default: "1"
|
|
24
|
-
|
|
25
1
|
refs:
|
|
26
2
|
input:
|
|
27
3
|
eventListeners:
|
|
28
|
-
input
|
|
4
|
+
value-input:
|
|
5
|
+
handler: handleValueInput
|
|
6
|
+
value-change:
|
|
29
7
|
handler: handleValueChange
|
|
30
8
|
slider:
|
|
31
9
|
eventListeners:
|
|
32
|
-
|
|
10
|
+
value-change:
|
|
33
11
|
handler: handleValueChange
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
form-change: {}
|
|
37
|
-
|
|
12
|
+
value-input:
|
|
13
|
+
handler: handleValueInput
|
|
38
14
|
template:
|
|
39
15
|
- rtgl-view d=h av=c g=md w=${w}:
|
|
40
|
-
- rtgl-slider#slider key=${key} w=f type=range min=${min} max=${max} step=${step} value=${value}:
|
|
16
|
+
- rtgl-slider#slider key=${key} w=f type=range min=${min} max=${max} step=${step} value=${value}: null
|
|
41
17
|
- rtgl-view w=84:
|
|
42
|
-
- rtgl-input#input key=${key} w=f type=number min=${min} max=${max} step=${step} value=${value}:
|
|
43
|
-
|
|
18
|
+
- rtgl-input#input key=${key} w=f type=number min=${min} max=${max} step=${step} value=${value}: null
|
|
@@ -5,7 +5,7 @@ export const handleBeforeMount = (deps) => {
|
|
|
5
5
|
export const handleRowClick = (deps, payload) => {
|
|
6
6
|
const { dispatchEvent, props } = deps;
|
|
7
7
|
const event = payload._event;
|
|
8
|
-
const rowIndex = parseInt(event.currentTarget.id.
|
|
8
|
+
const rowIndex = parseInt(event.currentTarget.id.slice("row".length), 10);
|
|
9
9
|
const rowData = props.data?.rows?.[rowIndex];
|
|
10
10
|
|
|
11
11
|
if (rowData) {
|
|
@@ -23,7 +23,7 @@ export const handleRowClick = (deps, payload) => {
|
|
|
23
23
|
export const handleHeaderClick = (deps, payload) => {
|
|
24
24
|
const { store, render, dispatchEvent } = deps;
|
|
25
25
|
const event = payload._event;
|
|
26
|
-
const columnKey = event.currentTarget.
|
|
26
|
+
const columnKey = event.currentTarget.dataset.columnKey;
|
|
27
27
|
const currentSort = store.selectSortInfo();
|
|
28
28
|
|
|
29
29
|
// Determine new sort direction
|
|
@@ -54,4 +54,4 @@ export const handleHeaderClick = (deps, payload) => {
|
|
|
54
54
|
},
|
|
55
55
|
}),
|
|
56
56
|
);
|
|
57
|
-
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
componentName: rtgl-table
|
|
2
|
+
propsSchema:
|
|
3
|
+
type: object
|
|
4
|
+
properties:
|
|
5
|
+
data:
|
|
6
|
+
type: object
|
|
7
|
+
properties:
|
|
8
|
+
columns:
|
|
9
|
+
type: array
|
|
10
|
+
items:
|
|
11
|
+
type: object
|
|
12
|
+
properties:
|
|
13
|
+
key:
|
|
14
|
+
type: string
|
|
15
|
+
label:
|
|
16
|
+
type: string
|
|
17
|
+
rows:
|
|
18
|
+
type: array
|
|
19
|
+
items:
|
|
20
|
+
type: object
|
|
21
|
+
responsive:
|
|
22
|
+
type: boolean
|
|
23
|
+
default: true
|
|
24
|
+
events: {}
|
|
25
|
+
methods:
|
|
26
|
+
type: object
|
|
27
|
+
properties: {}
|
|
@@ -3,10 +3,10 @@ export const createInitialState = () => Object.freeze({
|
|
|
3
3
|
sortDirection: null,
|
|
4
4
|
});
|
|
5
5
|
|
|
6
|
-
const blacklistedAttrs = ['id', 'class', 'style', 'slot'];
|
|
6
|
+
const blacklistedAttrs = ['id', 'class', 'style', 'slot', 'data'];
|
|
7
7
|
|
|
8
|
-
const stringifyAttrs = (
|
|
9
|
-
return Object.entries(
|
|
8
|
+
const stringifyAttrs = (props = {}) => {
|
|
9
|
+
return Object.entries(props).filter(([key]) => !blacklistedAttrs.includes(key)).map(([key, value]) => `${key}=${value}`).join(' ');
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const getNestedValue = (obj, path) => {
|
|
@@ -23,8 +23,8 @@ const getNestedValue = (obj, path) => {
|
|
|
23
23
|
return result;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export const selectViewData = ({ state, props
|
|
27
|
-
const containerAttrString = stringifyAttrs(
|
|
26
|
+
export const selectViewData = ({ state, props }) => {
|
|
27
|
+
const containerAttrString = stringifyAttrs(props);
|
|
28
28
|
const data = props.data || { columns: [], rows: [] };
|
|
29
29
|
|
|
30
30
|
// Transform rows to create cells array for easier template access
|
|
@@ -61,12 +61,12 @@ export const selectSortInfo = ({ state }) => {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export const setSortColumn = (state, { column, direction }) => {
|
|
64
|
+
export const setSortColumn = ({ state }, { column, direction } = {}) => {
|
|
65
65
|
state.sortColumn = column;
|
|
66
66
|
state.sortDirection = direction;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
export const clearSort = (state) => {
|
|
69
|
+
export const clearSort = ({ state }) => {
|
|
70
70
|
state.sortColumn = null;
|
|
71
71
|
state.sortDirection = null;
|
|
72
|
-
}
|
|
72
|
+
}
|
|
@@ -1,59 +1,19 @@
|
|
|
1
|
-
elementName: rtgl-table
|
|
2
|
-
|
|
3
|
-
viewDataSchema:
|
|
4
|
-
type: object
|
|
5
|
-
properties:
|
|
6
|
-
columns:
|
|
7
|
-
type: array
|
|
8
|
-
rows:
|
|
9
|
-
type: array
|
|
10
|
-
containerAttrString:
|
|
11
|
-
type: string
|
|
12
|
-
|
|
13
|
-
propsSchema:
|
|
14
|
-
type: object
|
|
15
|
-
properties:
|
|
16
|
-
data:
|
|
17
|
-
type: object
|
|
18
|
-
properties:
|
|
19
|
-
columns:
|
|
20
|
-
type: array
|
|
21
|
-
items:
|
|
22
|
-
type: object
|
|
23
|
-
properties:
|
|
24
|
-
key:
|
|
25
|
-
type: string
|
|
26
|
-
label:
|
|
27
|
-
type: string
|
|
28
|
-
rows:
|
|
29
|
-
type: array
|
|
30
|
-
items:
|
|
31
|
-
type: object
|
|
32
|
-
responsive:
|
|
33
|
-
type: boolean
|
|
34
|
-
default: true
|
|
35
|
-
|
|
36
1
|
refs:
|
|
37
|
-
row
|
|
2
|
+
row*:
|
|
38
3
|
eventListeners:
|
|
39
4
|
click:
|
|
40
5
|
handler: handleRowClick
|
|
41
|
-
header
|
|
6
|
+
header*:
|
|
42
7
|
eventListeners:
|
|
43
8
|
click:
|
|
44
9
|
handler: handleHeaderClick
|
|
45
|
-
|
|
46
|
-
events: {}
|
|
47
|
-
|
|
48
10
|
styles:
|
|
49
11
|
table:
|
|
50
12
|
width: 100%
|
|
51
13
|
border-collapse: collapse
|
|
52
14
|
border-spacing: 0
|
|
53
|
-
|
|
54
15
|
thead:
|
|
55
16
|
border-bottom: 2px solid var(--border)
|
|
56
|
-
|
|
57
17
|
th:
|
|
58
18
|
padding: 12px
|
|
59
19
|
text-align: left
|
|
@@ -64,40 +24,34 @@ styles:
|
|
|
64
24
|
position: sticky
|
|
65
25
|
top: 0
|
|
66
26
|
z-index: 1
|
|
67
|
-
|
|
68
27
|
tbody tr:
|
|
69
28
|
border-bottom: 1px solid var(--border)
|
|
70
|
-
|
|
71
29
|
tbody tr:last-child:
|
|
72
30
|
border-bottom: none
|
|
73
|
-
|
|
74
31
|
td:
|
|
75
32
|
padding: 12px
|
|
76
33
|
color: var(--foreground)
|
|
77
|
-
|
|
78
34
|
.table-container:
|
|
79
35
|
width: 100%
|
|
80
36
|
height: 100%
|
|
81
37
|
overflow: auto
|
|
82
|
-
|
|
83
38
|
.empty-state:
|
|
84
39
|
text-align: center
|
|
85
40
|
padding: 24px
|
|
86
41
|
color: var(--muted-foreground)
|
|
87
|
-
|
|
88
42
|
template:
|
|
89
43
|
- rtgl-view.table-container ${containerAttrString}:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
44
|
+
- $if rows.length > 0:
|
|
45
|
+
- table:
|
|
46
|
+
- thead:
|
|
47
|
+
- tr:
|
|
48
|
+
- $for column, i in columns:
|
|
49
|
+
- th#header${i} data-column-key=${column.key}: ${column.label}
|
|
50
|
+
- tbody:
|
|
51
|
+
- $for row, rowIndex in rows:
|
|
52
|
+
- tr#row${rowIndex}:
|
|
53
|
+
- $for cell, cellIndex in row.cells:
|
|
54
|
+
- td: ${cell.value}
|
|
55
|
+
$else:
|
|
56
|
+
- rtgl-view.empty-state w=f p=xl:
|
|
57
|
+
- rtgl-text c=mu-fg: No data available
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
componentName: rtgl-tabs
|
|
2
|
+
propsSchema:
|
|
3
|
+
type: object
|
|
4
|
+
properties:
|
|
5
|
+
items:
|
|
6
|
+
type: array
|
|
7
|
+
items:
|
|
8
|
+
type: object
|
|
9
|
+
properties:
|
|
10
|
+
label:
|
|
11
|
+
type: string
|
|
12
|
+
id:
|
|
13
|
+
type: string
|
|
14
|
+
testId:
|
|
15
|
+
type: string
|
|
16
|
+
selectedTab:
|
|
17
|
+
type: string
|
|
18
|
+
events:
|
|
19
|
+
item-click:
|
|
20
|
+
type: object
|
|
21
|
+
properties:
|
|
22
|
+
id:
|
|
23
|
+
type: string
|
|
24
|
+
methods:
|
|
25
|
+
type: object
|
|
26
|
+
properties: {}
|