@sankhyalabs/sankhyablocks 2.9.0 → 2.11.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-9c584423.js +7 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +19 -8
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator_3.cjs.entry.js +24 -9
- package/dist/cjs/snk-crud.cjs.entry.js +19 -5
- package/dist/cjs/snk-data-exporter_8.cjs.entry.js +21 -7
- package/dist/cjs/snk-data-unit.cjs.entry.js +49 -10
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +58 -22
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/cjs/{taskbar-elements-bbb89cdb.js → taskbar-elements-89bf9399.js} +14 -3
- package/dist/collection/components/snk-application/snk-application.js +12 -6
- package/dist/collection/components/snk-crud/snk-crud.js +41 -4
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.css +3 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +4 -2
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +49 -10
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
- package/dist/collection/components/snk-form/snk-form.css +1 -1
- package/dist/collection/components/snk-form/snk-form.js +80 -21
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.css +8 -1
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css +42 -19
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +92 -40
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.css +96 -45
- package/dist/collection/components/snk-grid/snk-grid.js +44 -6
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +14 -3
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +37 -2
- package/dist/collection/lib/@types/index.js +5 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +15 -4
- package/dist/components/snk-application2.js +19 -8
- package/dist/components/snk-config-options2.js +1 -1
- package/dist/components/snk-crud.js +20 -6
- package/dist/components/snk-data-exporter2.js +5 -3
- package/dist/components/snk-data-unit.js +49 -10
- package/dist/components/snk-field-config2.js +1 -1
- package/dist/components/snk-filter-bar2.js +1 -1
- package/dist/components/snk-filter-item2.js +1 -1
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-form2.js +59 -23
- package/dist/components/snk-grid2.js +23 -8
- package/dist/components/snk-tab-config2.js +1 -1
- package/dist/components/snk-taskbar2.js +33 -5
- package/dist/esm/index-de5f37a6.js +7 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +19 -8
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator_3.entry.js +22 -7
- package/dist/esm/snk-crud.entry.js +20 -6
- package/dist/esm/snk-data-exporter_8.entry.js +21 -7
- package/dist/esm/snk-data-unit.entry.js +49 -10
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +58 -22
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/{taskbar-elements-beec3b27.js → taskbar-elements-c8966343.js} +14 -3
- package/dist/sankhyablocks/p-01c361bb.entry.js +1 -0
- package/dist/sankhyablocks/p-05fadb77.js +1 -0
- package/dist/sankhyablocks/p-3ee68d78.entry.js +1 -0
- package/dist/sankhyablocks/p-420d07c4.js +1 -0
- package/dist/sankhyablocks/p-4a5c1d36.entry.js +1 -0
- package/dist/sankhyablocks/{p-3cb9f3ad.entry.js → p-4c759619.entry.js} +1 -1
- package/dist/sankhyablocks/p-9b858e3a.entry.js +1 -0
- package/dist/sankhyablocks/p-a65d6ba3.entry.js +1 -0
- package/dist/sankhyablocks/p-b84c7c61.entry.js +90 -0
- package/dist/sankhyablocks/p-c32cfc29.entry.js +1 -0
- package/dist/sankhyablocks/p-cd19bd29.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +2 -2
- package/dist/types/components/snk-crud/snk-crud.d.ts +8 -1
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +6 -0
- package/dist/types/components/snk-form/snk-form.d.ts +10 -1
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +6 -0
- package/dist/types/components.d.ts +37 -4
- package/dist/types/lib/@types/index.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +1 -1
- package/dist/types/lib/store/index.d.ts +4 -3
- package/package.json +1 -1
- package/dist/sankhyablocks/p-13116d05.entry.js +0 -1
- package/dist/sankhyablocks/p-1faef46c.entry.js +0 -83
- package/dist/sankhyablocks/p-3480f2fa.entry.js +0 -1
- package/dist/sankhyablocks/p-4ca32c86.entry.js +0 -1
- package/dist/sankhyablocks/p-6617d349.entry.js +0 -1
- package/dist/sankhyablocks/p-82e20fc0.entry.js +0 -1
- package/dist/sankhyablocks/p-9d474bc0.entry.js +0 -1
- package/dist/sankhyablocks/p-c8327a5c.js +0 -1
- package/dist/sankhyablocks/p-fc77347c.entry.js +0 -1
|
@@ -13,7 +13,44 @@
|
|
|
13
13
|
--snk-tab-config--backward-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z"/></svg>');
|
|
14
14
|
/*@doc Contém o ícone de avançar para a aba posterior.*/
|
|
15
15
|
--snk-tab-config--forward-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z"/></svg>');
|
|
16
|
-
|
|
16
|
+
/*@doc Define a cor de fundo da barra do componente.*/
|
|
17
|
+
--snk-tab-config__lower-bar--background-color: var(--color--disable-primary, #e5eaf0);
|
|
18
|
+
/*@doc Define a borda da barra do componente.*/
|
|
19
|
+
--snk-tab-config__lower-bar--border: 2px solid var(--color--disable-primary, #e5eaf0);
|
|
20
|
+
/*@doc Define a cor do texto do componente.*/
|
|
21
|
+
--snk-tab-config__tab--color: var(--text--primary, #626e82);
|
|
22
|
+
/*@doc Define a fonte do texto do componente.*/
|
|
23
|
+
--snk-tab-config__tab--font-family: var(--font-pattern, "Roboto");
|
|
24
|
+
/*@doc Define o tamanho do texto do componente.*/
|
|
25
|
+
--snk-tab-config__tab--font-size: var(--title--small, 14px);
|
|
26
|
+
/*@doc Define o espaçamento interno do componente.*/
|
|
27
|
+
--snk-tab-config__tab--padding: var(--space--small, 6px) var(--space--medium, 12px);
|
|
28
|
+
/*@doc Define a cor do texto ativo do componente.*/
|
|
29
|
+
--snk-tab-config__tab-is-active--color: var(--color--primary, #008561);
|
|
30
|
+
/*@doc Define a cor no hover do texto do componente.*/
|
|
31
|
+
--snk-tab-config__tab-hover--color: var(--color--secondary, #383c45);
|
|
32
|
+
/*@doc Define a borda no foco do componente.*/
|
|
33
|
+
--snk-tab-config__tab-is-focused--border: 1px dashed var(--color--primary, #008561);
|
|
34
|
+
/*@doc Define a sombra do label do componente.*/
|
|
35
|
+
--snk-tab-config__tab-label--text-shadow: var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);
|
|
36
|
+
/*@doc Define o espaçamento externo inferior do label do componente.*/
|
|
37
|
+
--snk-tab-config__tab-label--margin-bottom: var(--space--extra-small, 3px);
|
|
38
|
+
/*@doc Define a cor do icone do botão de nova aba do componente.*/
|
|
39
|
+
--snk-tab-config__new-button-icon--color: var(--color--secondary-700, #1C1D22);
|
|
40
|
+
/*@doc Define a cor de fundo dos botões de navegação na barra do componente.*/
|
|
41
|
+
--snk-tab-config__forward-button--background-color: var(--text--primary, #626e82);
|
|
42
|
+
/*@doc Define a cor de fundo no hover dos botões de navegação na barra do componente.*/
|
|
43
|
+
--snk-tab-config__forward-button-hover--background-color: var(--color--primary, #008561);
|
|
44
|
+
/*@doc Define o espaçamento interno direito do icone esquerdo do componente.*/
|
|
45
|
+
--snk-tab-config__left-icon--padding-right: var(--space--small, 6px);
|
|
46
|
+
/*@doc Define a cor do icone esquerdo do componente.*/
|
|
47
|
+
--snk-tab-config__left-icon--color: var(--text--disable, #AFB6C0);
|
|
48
|
+
/*@doc Define a cor do label desabilitado do componente.*/
|
|
49
|
+
--snk-tab-config__tab-label-disabled--color: var(--text--disable, #AFB6C0);
|
|
50
|
+
/*@doc Define o espaçamento externo esquerdo no slot do componente.*/
|
|
51
|
+
--snk-tab-config__slot--margin-left: var(--space--small, 6px);
|
|
52
|
+
|
|
53
|
+
/*private*/
|
|
17
54
|
display: flex;
|
|
18
55
|
position: relative;
|
|
19
56
|
width: 100%;
|
|
@@ -21,6 +58,7 @@
|
|
|
21
58
|
}
|
|
22
59
|
|
|
23
60
|
.tab-config__scroll {
|
|
61
|
+
/*private*/
|
|
24
62
|
display: flex;
|
|
25
63
|
width: 100%;
|
|
26
64
|
scroll-behavior: smooth;
|
|
@@ -28,19 +66,8 @@
|
|
|
28
66
|
scrollbar-width: none;
|
|
29
67
|
}
|
|
30
68
|
|
|
31
|
-
.tab-config__scroll--start-hidden {
|
|
32
|
-
-webkit-mask-image: linear-gradient(90deg, transparent 20px, #000 48px);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.tab-config__scroll--middle {
|
|
36
|
-
-webkit-mask-image: linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.tab-config__scroll--end-hidden {
|
|
40
|
-
-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
69
|
.tab-config__lower-bar {
|
|
70
|
+
/*private*/
|
|
44
71
|
position: absolute;
|
|
45
72
|
left: 0%;
|
|
46
73
|
right: 0%;
|
|
@@ -49,11 +76,12 @@
|
|
|
49
76
|
border-radius: 2px;
|
|
50
77
|
|
|
51
78
|
/*public*/
|
|
52
|
-
background: var(--
|
|
53
|
-
border:
|
|
79
|
+
background-color: var(--snk-tab-config__lower-bar--background-color);
|
|
80
|
+
border: var(--snk-tab-config__lower-bar--border);
|
|
54
81
|
}
|
|
55
82
|
|
|
56
83
|
.tab-config__tab {
|
|
84
|
+
/*private*/
|
|
57
85
|
display: flex;
|
|
58
86
|
border: none;
|
|
59
87
|
background-color: unset;
|
|
@@ -63,62 +91,69 @@
|
|
|
63
91
|
min-width: fit-content;
|
|
64
92
|
|
|
65
93
|
/*public*/
|
|
66
|
-
color: var(--
|
|
67
|
-
font-family: var(--font-
|
|
68
|
-
font-size: var(--
|
|
69
|
-
padding: var(--
|
|
94
|
+
color: var(--snk-tab-config__tab--color);
|
|
95
|
+
font-family: var(--snk-tab-config__tab--font-family);
|
|
96
|
+
font-size: var(--snk-tab-config__tab--font-size);
|
|
97
|
+
padding: var(--snk-tab-config__tab--padding);
|
|
70
98
|
}
|
|
71
99
|
|
|
72
100
|
.tab-config__tab:focus,
|
|
73
101
|
.tab-config__forward-button,
|
|
74
102
|
.tab-config__backward-button {
|
|
103
|
+
/*private*/
|
|
75
104
|
outline: none;
|
|
76
105
|
}
|
|
77
106
|
|
|
78
107
|
.tab-config__tab--is-active {
|
|
108
|
+
/*private*/
|
|
79
109
|
position: relative;
|
|
80
110
|
|
|
81
111
|
/*public*/
|
|
82
|
-
color: var(--color
|
|
112
|
+
color: var(--snk-tab-config__tab-is-active--color);
|
|
83
113
|
}
|
|
84
114
|
|
|
85
115
|
.tab-config__tab:hover {
|
|
86
116
|
/*public*/
|
|
87
|
-
color: var(--color
|
|
117
|
+
color: var(--snk-tab-config__tab-hover--color);
|
|
88
118
|
}
|
|
89
119
|
|
|
90
120
|
.tab-config__tab--is-active:hover {
|
|
91
121
|
/*public*/
|
|
92
|
-
color: var(--color
|
|
122
|
+
color: var(--snk-tab-config__tab-is-active--color);
|
|
93
123
|
}
|
|
94
124
|
|
|
95
125
|
.tab-config__tab--is-active::after {
|
|
126
|
+
/*private*/
|
|
96
127
|
content: "";
|
|
97
128
|
position: absolute;
|
|
98
129
|
width: 100%;
|
|
99
130
|
height: 100%;
|
|
100
|
-
background-color: var(--color--primary, #008561);
|
|
101
131
|
clip-path: inset(calc(100% - 3px) 0px 0px 0px);
|
|
102
132
|
animation: activate 0.25s ease-in-out;
|
|
133
|
+
|
|
134
|
+
/*public*/
|
|
135
|
+
background-color: var(--snk-tab-config__tab-is-active--color);
|
|
103
136
|
}
|
|
104
137
|
|
|
105
138
|
.tab-config__tab--is-focused {
|
|
106
139
|
/*public*/
|
|
107
|
-
border:
|
|
140
|
+
border: var(--snk-tab-config__tab-is-focused--border);
|
|
108
141
|
}
|
|
109
142
|
|
|
110
143
|
.tab-config__tab-label {
|
|
144
|
+
/*private*/
|
|
111
145
|
overflow: hidden;
|
|
112
146
|
white-space: nowrap;
|
|
113
147
|
text-overflow: ellipsis;
|
|
114
148
|
|
|
115
149
|
/*public*/
|
|
116
|
-
text-shadow: var(--text-shadow);
|
|
117
|
-
margin-bottom: var(--
|
|
150
|
+
text-shadow: var(--snk-tab-config__tab-label--text-shadow);
|
|
151
|
+
margin-bottom: var(--snk-tab-config__tab-label--margin-bottom);
|
|
118
152
|
}
|
|
119
153
|
|
|
120
154
|
.tab-config__forward-button,
|
|
121
|
-
.tab-config__backward-button{
|
|
155
|
+
.tab-config__backward-button {
|
|
156
|
+
/*private*/
|
|
122
157
|
position: absolute;
|
|
123
158
|
z-index: 1;
|
|
124
159
|
display: flex;
|
|
@@ -136,6 +171,7 @@
|
|
|
136
171
|
}
|
|
137
172
|
|
|
138
173
|
.tab-config__new-button {
|
|
174
|
+
/*private*/
|
|
139
175
|
position: absolute;
|
|
140
176
|
z-index: 1;
|
|
141
177
|
display: flex;
|
|
@@ -152,27 +188,33 @@
|
|
|
152
188
|
}
|
|
153
189
|
|
|
154
190
|
.tab-config__new-button ez-icon {
|
|
155
|
-
|
|
191
|
+
/*public*/
|
|
192
|
+
--ez-icon--color: var(--snk-tab-config__new-button-icon--color);
|
|
156
193
|
}
|
|
157
194
|
|
|
158
195
|
.tab-config__backward-button {
|
|
196
|
+
/*private*/
|
|
159
197
|
left: 0px;
|
|
160
198
|
box-shadow: 10px 10px 5px 5px white;
|
|
161
199
|
background: white;
|
|
162
200
|
}
|
|
163
201
|
|
|
164
202
|
.tab-config__forward-button {
|
|
203
|
+
/*private*/
|
|
165
204
|
box-shadow: 10px 10px 5px 20px white;
|
|
166
205
|
background: white;
|
|
167
206
|
}
|
|
168
207
|
|
|
169
208
|
.tab-config__forward-button::after,
|
|
170
209
|
.tab-config__backward-button::after {
|
|
210
|
+
/*private*/
|
|
171
211
|
content: '';
|
|
172
212
|
display: flex;
|
|
173
|
-
background-color: var(--text--primary, #008561);
|
|
174
213
|
width: 10px;
|
|
175
214
|
height: 16px;
|
|
215
|
+
|
|
216
|
+
/*public*/
|
|
217
|
+
background-color: var(--snk-tab-config__forward-button--background-color);
|
|
176
218
|
}
|
|
177
219
|
|
|
178
220
|
.tab-config__forward-button::after {
|
|
@@ -190,83 +232,92 @@
|
|
|
190
232
|
.tab-config__forward-button:hover::after,
|
|
191
233
|
.tab-config__backward-button:hover::after {
|
|
192
234
|
/*public*/
|
|
193
|
-
background-color: var(--color
|
|
235
|
+
background-color: var(--snk-tab-config__forward-button-hover--background-color);
|
|
194
236
|
}
|
|
195
237
|
|
|
196
238
|
.tab-config__new-button:hover ez-icon {
|
|
197
|
-
|
|
239
|
+
/*public*/
|
|
240
|
+
--ez-icon--color: var(--snk-tab-config__forward-button-hover--background-color);
|
|
198
241
|
}
|
|
199
242
|
|
|
200
243
|
.tab-config__hidden {
|
|
244
|
+
/*private*/
|
|
201
245
|
display: none;
|
|
202
246
|
}
|
|
203
247
|
|
|
204
248
|
.tab-config__scroll::-webkit-scrollbar {
|
|
249
|
+
/*private*/
|
|
205
250
|
display: none;
|
|
206
251
|
}
|
|
207
252
|
|
|
208
253
|
.tab-config__left-icon {
|
|
209
254
|
/*public*/
|
|
210
|
-
padding-right: var(--
|
|
211
|
-
--ez-icon--color: var(--
|
|
255
|
+
padding-right: var(--snk-tab-config__left-icon--padding-right);
|
|
256
|
+
--ez-icon--color: var(--snk-tab-config__left-icon--color);
|
|
212
257
|
}
|
|
213
258
|
|
|
214
259
|
.tab-config__left-icon--eye-off {
|
|
215
260
|
/*public*/
|
|
216
|
-
--ez-icon--color: var(--
|
|
261
|
+
--ez-icon--color: var(--snk-tab-config__left-icon--color);
|
|
217
262
|
}
|
|
218
263
|
|
|
219
|
-
.tab-config__right-icon {
|
|
264
|
+
.tab-config__right-icon {
|
|
265
|
+
/*private*/
|
|
220
266
|
visibility: hidden;
|
|
221
267
|
|
|
222
268
|
/*public*/
|
|
223
|
-
padding-left: var(--
|
|
269
|
+
padding-left: var(--snk-tab-config__left-icon--padding-right);
|
|
224
270
|
}
|
|
225
271
|
|
|
226
272
|
.tab-config__tab:hover .tab-config__right-icon {
|
|
273
|
+
/*private*/
|
|
227
274
|
visibility: visible;
|
|
228
275
|
}
|
|
229
276
|
|
|
230
|
-
.tab-config__tab--is-active .tab-config__right-icon{
|
|
277
|
+
.tab-config__tab--is-active .tab-config__right-icon {
|
|
278
|
+
/*private*/
|
|
231
279
|
visibility: visible;
|
|
232
280
|
|
|
233
281
|
/*public*/
|
|
234
|
-
--ez-icon--color: var(--color
|
|
282
|
+
--ez-icon--color: var(--snk-tab-config__tab-is-active--color);
|
|
235
283
|
}
|
|
236
284
|
|
|
237
|
-
.tab-config__tab:hover .tab-config__right-icon{
|
|
285
|
+
.tab-config__tab:hover .tab-config__right-icon {
|
|
238
286
|
/*public*/
|
|
239
|
-
--ez-icon--color: var(--color
|
|
287
|
+
--ez-icon--color: var(--snk-tab-config__tab-hover--color);
|
|
240
288
|
}
|
|
241
289
|
|
|
242
|
-
.tab-config__tab--is-active:hover .tab-config__right-icon{
|
|
290
|
+
.tab-config__tab--is-active:hover .tab-config__right-icon {
|
|
243
291
|
/*public*/
|
|
244
|
-
--ez-icon--color: var(--color
|
|
292
|
+
--ez-icon--color: var(--snk-tab-config__tab-is-active--color);
|
|
245
293
|
}
|
|
246
294
|
|
|
247
295
|
.tab-config__actions-button {
|
|
296
|
+
/*private*/
|
|
248
297
|
--ez-actions-button__btn-action--min-width: 100px;
|
|
249
298
|
visibility: hidden;
|
|
250
299
|
opacity: 0;
|
|
251
|
-
transition:visibility 1s linear,opacity 0.3s linear;
|
|
300
|
+
transition: visibility 1s linear, opacity 0.3s linear;
|
|
252
301
|
}
|
|
253
302
|
|
|
254
303
|
.tab-config__tab:hover .tab-config__actions-button {
|
|
304
|
+
/*private*/
|
|
255
305
|
visibility: visible;
|
|
256
306
|
opacity: 1;
|
|
257
307
|
transition: visibility 0.2s linear, opacity 0.10s linear;
|
|
258
308
|
}
|
|
259
309
|
|
|
260
310
|
[data-draggable-element] {
|
|
311
|
+
/*private*/
|
|
261
312
|
cursor: grab;
|
|
262
313
|
}
|
|
263
314
|
|
|
264
315
|
.tab-config__tab-label-disabled {
|
|
265
316
|
/*public*/
|
|
266
|
-
color: var(--
|
|
317
|
+
color: var(--snk-tab-config__tab-label-disabled--color);
|
|
267
318
|
}
|
|
268
319
|
|
|
269
320
|
.tab-config__slot {
|
|
270
321
|
/*public*/
|
|
271
|
-
margin-left: var(--
|
|
322
|
+
margin-left: var(--snk-tab-config__slot--margin-left);
|
|
272
323
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
2
|
import { ApplicationContext, DataType, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
4
|
-
import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
|
5
4
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
|
5
|
+
import { PresentationMode } from '../../lib/@types';
|
|
6
|
+
import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
|
6
7
|
import store from "../../lib/store";
|
|
7
8
|
export class SnkGrid {
|
|
8
9
|
constructor() {
|
|
@@ -18,6 +19,10 @@ export class SnkGrid {
|
|
|
18
19
|
* Determina se haverá exportação de dados
|
|
19
20
|
*/
|
|
20
21
|
this.enableDataExporter = false;
|
|
22
|
+
/**
|
|
23
|
+
* Altera o modo de apresentação dos botões do snk-taskbar.
|
|
24
|
+
*/
|
|
25
|
+
this.presentationMode = PresentationMode.PRIMARY;
|
|
21
26
|
}
|
|
22
27
|
/**
|
|
23
28
|
* Exibe a janela de configurações da grade.
|
|
@@ -137,6 +142,19 @@ export class SnkGrid {
|
|
|
137
142
|
};
|
|
138
143
|
store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
|
|
139
144
|
}
|
|
145
|
+
getPrimaryButton() {
|
|
146
|
+
return this.presentationMode === PresentationMode.PRIMARY ? "INSERT" : "";
|
|
147
|
+
}
|
|
148
|
+
validatePresentationMode() {
|
|
149
|
+
if (Object.values(PresentationMode).includes(this.presentationMode)) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
this.presentationMode = PresentationMode.PRIMARY;
|
|
153
|
+
}
|
|
154
|
+
addElementID() {
|
|
155
|
+
const dataInfo = { dataUnit: this._dataUnit };
|
|
156
|
+
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
157
|
+
}
|
|
140
158
|
componentWillLoad() {
|
|
141
159
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
142
160
|
let parent = this._element.parentElement;
|
|
@@ -168,16 +186,13 @@ export class SnkGrid {
|
|
|
168
186
|
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
|
169
187
|
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
|
170
188
|
this.dataExporterProviderStore();
|
|
171
|
-
|
|
172
|
-
addElementID() {
|
|
173
|
-
const dataInfo = { dataUnit: this._dataUnit };
|
|
174
|
-
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
189
|
+
this.validatePresentationMode();
|
|
175
190
|
}
|
|
176
191
|
render() {
|
|
177
192
|
if (!this._dataUnit) {
|
|
178
193
|
return undefined;
|
|
179
194
|
}
|
|
180
|
-
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton:
|
|
195
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton() })), h("ez-grid", { ref: ref => this._grid = ref, "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, onConfigChange: (evt) => this.changeConfig(evt.detail), onConfigCancel: () => this.closeGridConfig() }))));
|
|
181
196
|
}
|
|
182
197
|
static get is() { return "snk-grid"; }
|
|
183
198
|
static get encapsulation() { return "scoped"; }
|
|
@@ -307,6 +322,29 @@ export class SnkGrid {
|
|
|
307
322
|
"attribute": "enable-data-exporter",
|
|
308
323
|
"reflect": false,
|
|
309
324
|
"defaultValue": "false"
|
|
325
|
+
},
|
|
326
|
+
"presentationMode": {
|
|
327
|
+
"type": "string",
|
|
328
|
+
"mutable": false,
|
|
329
|
+
"complexType": {
|
|
330
|
+
"original": "PresentationMode",
|
|
331
|
+
"resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY",
|
|
332
|
+
"references": {
|
|
333
|
+
"PresentationMode": {
|
|
334
|
+
"location": "import",
|
|
335
|
+
"path": "../../lib/@types"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
"required": false,
|
|
340
|
+
"optional": false,
|
|
341
|
+
"docs": {
|
|
342
|
+
"tags": [],
|
|
343
|
+
"text": "Altera o modo de apresenta\u00E7\u00E3o dos bot\u00F5es do snk-taskbar."
|
|
344
|
+
},
|
|
345
|
+
"attribute": "presentation-mode",
|
|
346
|
+
"reflect": false,
|
|
347
|
+
"defaultValue": "PresentationMode.PRIMARY"
|
|
310
348
|
}
|
|
311
349
|
};
|
|
312
350
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { PresentationMode } from "../../../lib/@types";
|
|
2
3
|
import store from "../../../lib/store";
|
|
3
4
|
export var TaskbarElement;
|
|
4
5
|
(function (TaskbarElement) {
|
|
@@ -44,7 +45,7 @@ export const buildCustomButton = (def, className, dataElementId, action, isEnabl
|
|
|
44
45
|
return textButton(def.name, className, dataElementId, text, hint, action, isEnabled);
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
|
-
export const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, configName) => {
|
|
48
|
+
export const buildElem = (element, className, dataElementId, getTitle, action, isEnabled, actions, configName, presentationMode) => {
|
|
48
49
|
var _a;
|
|
49
50
|
const title = getTitle(element);
|
|
50
51
|
switch (element) {
|
|
@@ -61,11 +62,21 @@ export const buildElem = (element, className, dataElementId, getTitle, action, i
|
|
|
61
62
|
case TaskbarElement.REMOVE:
|
|
62
63
|
return iconButton("delete", element, className, dataElementId, title, action, isEnabled);
|
|
63
64
|
case TaskbarElement.INSERT:
|
|
64
|
-
|
|
65
|
+
if (presentationMode === PresentationMode.PRIMARY) {
|
|
66
|
+
return iconTextButton("plus", element, className, dataElementId, title, title, action, isEnabled);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
return iconButton("plus", element, className, dataElementId, title, action, isEnabled);
|
|
70
|
+
}
|
|
65
71
|
case TaskbarElement.CANCEL:
|
|
66
72
|
return textButton(element, className, dataElementId, title, title, action, isEnabled);
|
|
67
73
|
case TaskbarElement.SAVE:
|
|
68
|
-
|
|
74
|
+
if (presentationMode === PresentationMode.PRIMARY) {
|
|
75
|
+
return iconTextButton("save", element, className, dataElementId, title, title, action, isEnabled);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return iconButton("save", element, className, dataElementId, title, action, isEnabled);
|
|
79
|
+
}
|
|
69
80
|
case TaskbarElement.GRID_MODE:
|
|
70
81
|
return iconButton("table", element, className, dataElementId, title, action, isEnabled);
|
|
71
82
|
case TaskbarElement.FORM_MODE:
|
|
@@ -2,8 +2,13 @@ import { ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/co
|
|
|
2
2
|
import { h, Host } from '@stencil/core';
|
|
3
3
|
import { AuthorizationConfig } from '../snk-configurator/AuthorizationConfig';
|
|
4
4
|
import { TaskbarElement, buildElem, AuthorizationElements, buildCustomButton, VisibleWhenForbidden } from './elements/taskbar-elements';
|
|
5
|
+
import { PresentationMode } from '../../lib/@types';
|
|
5
6
|
export class SnkTaskbar {
|
|
6
7
|
constructor() {
|
|
8
|
+
/**
|
|
9
|
+
* Altera o modo de apresentação dos botões do snk-taskbar.
|
|
10
|
+
*/
|
|
11
|
+
this.presentationMode = PresentationMode.PRIMARY;
|
|
7
12
|
this._titleKeyByElement = {
|
|
8
13
|
[TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
|
9
14
|
[TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
|
@@ -103,13 +108,19 @@ export class SnkTaskbar {
|
|
|
103
108
|
}
|
|
104
109
|
return !(this.disabledButtons && this.disabledButtons.includes(elem));
|
|
105
110
|
}
|
|
111
|
+
validatePresentationMode() {
|
|
112
|
+
if (Object.values(PresentationMode).includes(this.presentationMode)) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
this.presentationMode = PresentationMode.PRIMARY;
|
|
116
|
+
}
|
|
106
117
|
getElement(index, def) {
|
|
107
118
|
let className = def === this.primaryButton ? "ez-button--primary " : "";
|
|
108
119
|
if (index > 1) {
|
|
109
120
|
className += "ez-padding-left--medium";
|
|
110
121
|
}
|
|
111
122
|
if (TaskbarElement[def.toString()]) {
|
|
112
|
-
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList, this.configName);
|
|
123
|
+
return buildElem(def, className, this.getIdElemBtnNative(def), elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList, this.configName, this.presentationMode);
|
|
113
124
|
}
|
|
114
125
|
else {
|
|
115
126
|
return buildCustomButton(def, className, this.getIdElemBtnCustom(def), elem => this.elementClick(elem), elem => this.isEnabled(elem));
|
|
@@ -154,6 +165,7 @@ export class SnkTaskbar {
|
|
|
154
165
|
if (this._definitions == undefined && this._permissions) {
|
|
155
166
|
this._definitions = this.elementsFromString(this.buttons);
|
|
156
167
|
}
|
|
168
|
+
this.validatePresentationMode();
|
|
157
169
|
}
|
|
158
170
|
componentDidLoad() {
|
|
159
171
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
@@ -247,7 +259,7 @@ export class SnkTaskbar {
|
|
|
247
259
|
"optional": false,
|
|
248
260
|
"docs": {
|
|
249
261
|
"tags": [],
|
|
250
|
-
"text": "Mapa com defini\u00E7\u00E3o de bot\u00F5es personalizados. A chave do mapa deve ser
|
|
262
|
+
"text": "Mapa com defini\u00E7\u00E3o de bot\u00F5es personalizados. A chave do mapa deve ser\npassada na lista \"buttons\" no lugar onde o bot\u00E3o ir\u00E1 aparecer."
|
|
251
263
|
}
|
|
252
264
|
},
|
|
253
265
|
"actionsList": {
|
|
@@ -327,6 +339,29 @@ export class SnkTaskbar {
|
|
|
327
339
|
"tags": [],
|
|
328
340
|
"text": "Inst\u00E2ncia do DataUnit."
|
|
329
341
|
}
|
|
342
|
+
},
|
|
343
|
+
"presentationMode": {
|
|
344
|
+
"type": "string",
|
|
345
|
+
"mutable": true,
|
|
346
|
+
"complexType": {
|
|
347
|
+
"original": "PresentationMode",
|
|
348
|
+
"resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY",
|
|
349
|
+
"references": {
|
|
350
|
+
"PresentationMode": {
|
|
351
|
+
"location": "import",
|
|
352
|
+
"path": "../../lib/@types"
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
"required": false,
|
|
357
|
+
"optional": false,
|
|
358
|
+
"docs": {
|
|
359
|
+
"tags": [],
|
|
360
|
+
"text": "Altera o modo de apresenta\u00E7\u00E3o dos bot\u00F5es do snk-taskbar."
|
|
361
|
+
},
|
|
362
|
+
"attribute": "presentation-mode",
|
|
363
|
+
"reflect": true,
|
|
364
|
+
"defaultValue": "PresentationMode.PRIMARY"
|
|
330
365
|
}
|
|
331
366
|
};
|
|
332
367
|
}
|
|
@@ -31,6 +31,13 @@ export default class DataUnitFetcher {
|
|
|
31
31
|
type
|
|
32
32
|
expression
|
|
33
33
|
}
|
|
34
|
+
},
|
|
35
|
+
children{
|
|
36
|
+
name
|
|
37
|
+
links{
|
|
38
|
+
source
|
|
39
|
+
target
|
|
40
|
+
}
|
|
34
41
|
}
|
|
35
42
|
children{
|
|
36
43
|
name
|
|
@@ -41,9 +48,9 @@ export default class DataUnitFetcher {
|
|
|
41
48
|
}
|
|
42
49
|
}
|
|
43
50
|
}`);
|
|
44
|
-
this.templateByQuery.set("fetchData", gql `query($dataunit: String! $limit: Int $offset:Int $filters: [InputFilter!] $sort: [InputSort!]) {
|
|
51
|
+
this.templateByQuery.set("fetchData", gql `query($dataunit: String! $limit: Int $offset:Int $filters: [InputFilter!] $sort: [InputSort!] $parentRecordId: String) {
|
|
45
52
|
$queryAlias$: fetchDataUnit(name: $dataunit){
|
|
46
|
-
data(limit: $limit offset: $offset filters: $filters sort: $sort){
|
|
53
|
+
data(limit: $limit offset: $offset filters: $filters sort: $sort parentRecordId: $parentRecordId){
|
|
47
54
|
limit
|
|
48
55
|
offset
|
|
49
56
|
total
|
|
@@ -80,8 +87,8 @@ export default class DataUnitFetcher {
|
|
|
80
87
|
}
|
|
81
88
|
}`);
|
|
82
89
|
}
|
|
83
|
-
getDataUnit(entityName, resourceID) {
|
|
84
|
-
const dataUnit = new DataUnit(`dd://${entityName}/${resourceID}`);
|
|
90
|
+
getDataUnit(entityName, resourceID, parentDataUnit) {
|
|
91
|
+
const dataUnit = parentDataUnit != undefined ? parentDataUnit.getChildDataunit(`dd://${entityName}/${resourceID}`) : new DataUnit(`dd://${entityName}/${resourceID}`);
|
|
85
92
|
dataUnit.metadataLoader = (dataUnit) => this.loadMetadata(dataUnit);
|
|
86
93
|
dataUnit.dataLoader = (dataUnit, request) => this.loadData(dataUnit, request);
|
|
87
94
|
dataUnit.saveLoader = (dataUnit, changes) => this.saveData(dataUnit, changes);
|
|
@@ -144,6 +151,7 @@ export default class DataUnitFetcher {
|
|
|
144
151
|
const variables = { dataunit: dataUnit.name, sort, filters };
|
|
145
152
|
variables.limit = limit;
|
|
146
153
|
variables.offset = offset;
|
|
154
|
+
variables.parentRecordId = request.parentRecordId;
|
|
147
155
|
if (!StringUtils.isEmpty(quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.term)) {
|
|
148
156
|
if (variables.filter === undefined) {
|
|
149
157
|
variables.filter = [];
|
|
@@ -211,6 +219,9 @@ export default class DataUnitFetcher {
|
|
|
211
219
|
if (change.sourceId) {
|
|
212
220
|
reqChange.sourceId = change.sourceId;
|
|
213
221
|
}
|
|
222
|
+
if (record.__parent__record__id__) {
|
|
223
|
+
reqChange.parentRecordId = record.__parent__record__id__;
|
|
224
|
+
}
|
|
214
225
|
return reqChange;
|
|
215
226
|
});
|
|
216
227
|
return new Promise((resolve, reject) => {
|