@sankhyalabs/sankhyablocks 1.3.31-beta.1 → 1.3.31-beta.11

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.
Files changed (92) hide show
  1. package/dist/cjs/SnkMessageBuilder-13239761.js +188 -0
  2. package/dist/cjs/{index-1133bc2a.js → index-c6671817.js} +416 -9
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  5. package/dist/cjs/snk-application.cjs.entry.js +283 -108
  6. package/dist/cjs/snk-crud.cjs.entry.js +64 -0
  7. package/dist/cjs/snk-data-unit.cjs.entry.js +277 -0
  8. package/dist/cjs/snk-form_2.cjs.entry.js +177 -0
  9. package/dist/cjs/snk-pesquisa.cjs.entry.js +6 -3
  10. package/dist/cjs/snk-taskbar.cjs.entry.js +159 -0
  11. package/dist/cjs/taskbar-elements-73d524e5.js +70 -0
  12. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  13. package/dist/collection/collection-manifest.json +5 -0
  14. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +2 -2
  15. package/dist/collection/components/snk-application/snk-application.js +267 -63
  16. package/dist/collection/components/snk-crud/snk-crud.css +5 -0
  17. package/dist/collection/components/snk-crud/snk-crud.js +137 -0
  18. package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
  19. package/dist/collection/components/snk-data-unit/snk-data-unit.js +528 -0
  20. package/dist/collection/components/snk-form/snk-form.css +34 -0
  21. package/dist/collection/components/snk-form/snk-form.js +220 -0
  22. package/dist/collection/components/snk-grid/snk-grid.css +5 -0
  23. package/dist/collection/components/snk-grid/snk-grid.js +148 -0
  24. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +56 -13
  25. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +5 -1
  26. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +65 -0
  27. package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
  28. package/dist/collection/components/snk-taskbar/snk-taskbar.js +271 -0
  29. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +1 -1
  30. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +52 -21
  31. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
  32. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +2 -0
  33. package/dist/collection/lib/message/SnkMessageBuilder.js +119 -0
  34. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +22 -0
  35. package/dist/collection/lib/message/resources/snk-form.msg.js +10 -0
  36. package/dist/collection/lib/message/resources/snk-taskbar.msg.js +16 -0
  37. package/dist/components/SnkMessageBuilder.js +166 -0
  38. package/dist/components/snk-application2.js +284 -107
  39. package/dist/components/snk-crud.d.ts +11 -0
  40. package/dist/components/snk-crud.js +101 -0
  41. package/dist/components/snk-data-unit.d.ts +11 -0
  42. package/dist/components/snk-data-unit.js +300 -0
  43. package/dist/components/snk-form.d.ts +11 -0
  44. package/dist/components/snk-form.js +6 -0
  45. package/dist/components/snk-form2.js +140 -0
  46. package/dist/components/snk-grid.d.ts +11 -0
  47. package/dist/components/snk-grid.js +6 -0
  48. package/dist/components/snk-grid2.js +91 -0
  49. package/dist/components/snk-pesquisa2.js +5 -2
  50. package/dist/components/snk-taskbar.d.ts +11 -0
  51. package/dist/components/snk-taskbar.js +6 -0
  52. package/dist/components/snk-taskbar2.js +240 -0
  53. package/dist/esm/SnkMessageBuilder-3835f9d8.js +166 -0
  54. package/dist/esm/{index-ffda6382.js → index-6a83ac96.js} +416 -10
  55. package/dist/esm/loader.js +2 -2
  56. package/dist/esm/sankhyablocks.js +2 -2
  57. package/dist/esm/snk-application.entry.js +283 -108
  58. package/dist/esm/snk-crud.entry.js +60 -0
  59. package/dist/esm/snk-data-unit.entry.js +273 -0
  60. package/dist/esm/snk-form_2.entry.js +172 -0
  61. package/dist/esm/snk-pesquisa.entry.js +6 -3
  62. package/dist/esm/snk-taskbar.entry.js +155 -0
  63. package/dist/esm/taskbar-elements-6d01a640.js +68 -0
  64. package/dist/esm/teste-pesquisa.entry.js +1 -1
  65. package/dist/sankhyablocks/p-4c7b32d6.entry.js +1 -0
  66. package/dist/sankhyablocks/p-5e1b7e51.entry.js +1 -0
  67. package/dist/sankhyablocks/p-72bccbb6.js +1 -0
  68. package/dist/sankhyablocks/p-8c74d163.entry.js +1 -0
  69. package/dist/sankhyablocks/p-bab507ad.entry.js +1 -0
  70. package/dist/sankhyablocks/p-cd1dc099.js +2 -0
  71. package/dist/sankhyablocks/{p-2a7b4cb3.entry.js → p-d25637c9.entry.js} +1 -1
  72. package/dist/sankhyablocks/p-dd10a5e3.js +1 -0
  73. package/dist/sankhyablocks/p-e942c604.entry.js +69 -0
  74. package/dist/sankhyablocks/p-f4d0394b.entry.js +1 -0
  75. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  76. package/dist/types/components/snk-application/snk-application.d.ts +109 -15
  77. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +25 -0
  78. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +53 -0
  79. package/dist/types/components.d.ts +372 -6
  80. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +2 -0
  81. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +3 -3
  82. package/dist/types/lib/message/SnkMessageBuilder.d.ts +42 -0
  83. package/dist/types/lib/message/resources/snk-data-unit.msg.d.ts +2 -0
  84. package/dist/types/lib/message/resources/snk-form.msg.d.ts +2 -0
  85. package/dist/types/lib/message/resources/snk-taskbar.msg.d.ts +2 -0
  86. package/package.json +5 -5
  87. package/react/components.d.ts +5 -0
  88. package/react/components.js +5 -0
  89. package/react/components.js.map +1 -1
  90. package/dist/sankhyablocks/p-d62412bb.entry.js +0 -1
  91. package/dist/sankhyablocks/p-e6e91d5f.entry.js +0 -69
  92. package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
@@ -0,0 +1,137 @@
1
+ import { Component, h, Prop, Element, State } from '@stencil/core';
2
+ const GRID_MODE = 0;
3
+ const FORM_MODE = 1;
4
+ /**
5
+ * É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
6
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
7
+ * Para conhecer os detalhes do módulo, vide os arquivos neste projeto "/src/lib/message/resources/*.msg.ts"
8
+ */
9
+ export class SnkCrud {
10
+ async gridToForm(keepFormMode = false) {
11
+ this._backToGrid = !keepFormMode && await this._viewStack.getSelectedIndex() === GRID_MODE;
12
+ this._viewStack.show(FORM_MODE);
13
+ }
14
+ async executeAction(act) {
15
+ if (act === "GRID_MODE") {
16
+ this._viewStack.show(GRID_MODE);
17
+ }
18
+ else if (act === "FORM_MODE" || act === "UPDATE") {
19
+ this.gridToForm(act !== "UPDATE");
20
+ }
21
+ }
22
+ insertionModeHandler() {
23
+ this.gridToForm();
24
+ }
25
+ cancelHandler() {
26
+ if (this._backToGrid) {
27
+ this._viewStack.show(GRID_MODE);
28
+ }
29
+ }
30
+ componentWillLoad() {
31
+ let parent = this._element.parentElement;
32
+ while (parent) {
33
+ if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
34
+ this._snkDataUnit = parent;
35
+ this._snkDataUnit.addEventListener("insertionMode", () => this.insertionModeHandler());
36
+ this._snkDataUnit.addEventListener("cancelEdition", () => this.cancelHandler());
37
+ this._dataUnit = this._snkDataUnit.dataUnit;
38
+ this._dataState = this._snkDataUnit.dataState;
39
+ if (!this._dataUnit) {
40
+ this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
41
+ this._dataUnit = evt.detail;
42
+ });
43
+ }
44
+ this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
45
+ this._dataState = evt.detail;
46
+ });
47
+ break;
48
+ }
49
+ parent = parent.parentElement;
50
+ }
51
+ }
52
+ render() {
53
+ return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref },
54
+ h("stack-item", null,
55
+ h("snk-grid", { configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList },
56
+ h("slot", null))),
57
+ h("stack-item", null,
58
+ h("snk-form", { configName: this.configName, actionsList: this.actionsList, onExit: () => this._viewStack.show(GRID_MODE), recordsValidator: this.recordsValidator, onActionClick: evt => this.executeAction(evt.detail) }))));
59
+ }
60
+ static get is() { return "snk-crud"; }
61
+ static get encapsulation() { return "scoped"; }
62
+ static get originalStyleUrls() { return {
63
+ "$": ["snk-crud.css"]
64
+ }; }
65
+ static get styleUrls() { return {
66
+ "$": ["snk-crud.css"]
67
+ }; }
68
+ static get properties() { return {
69
+ "configName": {
70
+ "type": "string",
71
+ "mutable": false,
72
+ "complexType": {
73
+ "original": "string",
74
+ "resolved": "string",
75
+ "references": {}
76
+ },
77
+ "required": false,
78
+ "optional": false,
79
+ "docs": {
80
+ "tags": [],
81
+ "text": ""
82
+ },
83
+ "attribute": "config-name",
84
+ "reflect": false
85
+ },
86
+ "actionsList": {
87
+ "type": "unknown",
88
+ "mutable": false,
89
+ "complexType": {
90
+ "original": "Array<Action>",
91
+ "resolved": "Action[]",
92
+ "references": {
93
+ "Array": {
94
+ "location": "global"
95
+ },
96
+ "Action": {
97
+ "location": "import",
98
+ "path": "../snk-taskbar/snk-taskbar"
99
+ }
100
+ }
101
+ },
102
+ "required": false,
103
+ "optional": false,
104
+ "docs": {
105
+ "tags": [],
106
+ "text": ""
107
+ }
108
+ },
109
+ "recordsValidator": {
110
+ "type": "any",
111
+ "mutable": false,
112
+ "complexType": {
113
+ "original": "RecordValidator",
114
+ "resolved": "RecordValidator",
115
+ "references": {
116
+ "RecordValidator": {
117
+ "location": "import",
118
+ "path": "@sankhyalabs/ezui/dist/types/components/ez-form/ez-form"
119
+ }
120
+ }
121
+ },
122
+ "required": false,
123
+ "optional": false,
124
+ "docs": {
125
+ "tags": [],
126
+ "text": "Validador respons\u00E1vel por checar a integridade das informa\u00E7\u00F5es do registro"
127
+ },
128
+ "attribute": "records-validator",
129
+ "reflect": false
130
+ }
131
+ }; }
132
+ static get states() { return {
133
+ "_dataUnit": {},
134
+ "_dataState": {}
135
+ }; }
136
+ static get elementRef() { return "_element"; }
137
+ }
@@ -0,0 +1,6 @@
1
+ :host {
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100%;
5
+ }
6
+
@@ -0,0 +1,528 @@
1
+ import { Component, Host, h, Event, Element, Prop, Watch, Method } from '@stencil/core';
2
+ import { Action, ApplicationContext } from '@sankhyalabs/core';
3
+ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
+ import { OperationMap } from '../../lib/message/SnkMessageBuilder';
5
+ export class SnkDataUnit {
6
+ constructor() {
7
+ this._onDataUnitResolve = [];
8
+ /**
9
+ * Determina quantas linhas são retornadas por página
10
+ */
11
+ this.pageSize = 150;
12
+ /**
13
+ * Quando ativada essa propriedade faz com que haja uma carga imediata no DataUnit
14
+ */
15
+ this.autoLoad = true;
16
+ this._dataUnitObserver = (action) => {
17
+ const duState = {
18
+ insertionMode: false,
19
+ hasNext: this.dataUnit.hasNext(),
20
+ hasPrevious: this.dataUnit.hasPrevious(),
21
+ copyMode: false,
22
+ isDirty: this.dataUnit.isDirty(),
23
+ hasDirtyRecords: this.dataUnit.hasDirtyRecords(),
24
+ selectedRecords: this.dataUnit.getSelectedRecords()
25
+ };
26
+ this.dataUnit.records.forEach(r => {
27
+ if (r.__record__id__.startsWith('NEW_')) {
28
+ duState.insertionMode = true;
29
+ duState.copyMode || (duState.copyMode = r['__record__source__id__'] != undefined);
30
+ }
31
+ });
32
+ this.dataState = duState;
33
+ if (action.type === Action.DATA_SAVED) {
34
+ const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
35
+ if (msg != undefined) {
36
+ this.showSuccessMessage(msg);
37
+ }
38
+ }
39
+ if (action.type === Action.RECORDS_ADDED || action.type === Action.RECORDS_COPIED) {
40
+ this.insertionMode.emit();
41
+ }
42
+ if (action.type === Action.EDITION_CANCELED) {
43
+ this.cancelEdition.emit();
44
+ const cancelFinishMsg = this.getMessage("snkDataUnit.cancelInfo");
45
+ if (cancelFinishMsg != undefined) {
46
+ this.showSuccessMessage(cancelFinishMsg);
47
+ }
48
+ }
49
+ if (action.type === Action.RECORDS_REMOVED) {
50
+ const removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
51
+ if (removeFinishMsg != undefined) {
52
+ this.showSuccessMessage(removeFinishMsg);
53
+ }
54
+ }
55
+ this._application.messagesBuilder.currentOperation = this.getMessageOperation();
56
+ };
57
+ }
58
+ observePageSize() {
59
+ if (this.dataUnit) {
60
+ this.dataUnit.pageSize = this.pageSize;
61
+ }
62
+ }
63
+ observeDataUnitName(newValue, oldValue) {
64
+ if (oldValue != newValue) {
65
+ this.dataUnit = undefined;
66
+ this.dataUnitName = newValue;
67
+ this.loadDataUnit();
68
+ }
69
+ }
70
+ observeEntityName(newValue, oldValue) {
71
+ if (oldValue != newValue) {
72
+ this.dataUnit = undefined;
73
+ this.entityName = newValue;
74
+ this.loadDataUnit();
75
+ }
76
+ }
77
+ observeDataState(newValue, oldValue) {
78
+ if (oldValue != newValue) {
79
+ this.dataStateChange.emit(newValue);
80
+ }
81
+ }
82
+ observeDataUnit() {
83
+ this.dataUnitReady.emit(this.dataUnit);
84
+ }
85
+ /**
86
+ * Pode-se obter o dataUnit através desse método. Outra forma, é ouvir o evento de
87
+ *
88
+ * @returns dataUnit
89
+ */
90
+ async getDataUnit() {
91
+ return new Promise((resolve) => {
92
+ if (this.dataUnit) {
93
+ resolve(this.dataUnit);
94
+ }
95
+ else {
96
+ this._onDataUnitResolve.push(resolve);
97
+ }
98
+ });
99
+ }
100
+ async interceptAction(action) {
101
+ return new Promise(resolve => {
102
+ switch (action.type) {
103
+ case Action.RECORDS_ADDED:
104
+ if (this.isAllowed("INSERT")) {
105
+ resolve(action);
106
+ }
107
+ else {
108
+ ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenInsert"));
109
+ }
110
+ break;
111
+ case Action.RECORDS_COPIED:
112
+ if (this.isAllowed("CLONE")) {
113
+ resolve(action);
114
+ }
115
+ else {
116
+ ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenClone"));
117
+ }
118
+ break;
119
+ case Action.DATA_CHANGED:
120
+ case Action.CHANGING_DATA:
121
+ if (this.isAllowed("UPDATE")) {
122
+ resolve(action);
123
+ }
124
+ else {
125
+ this.dataUnit.cancelEdition();
126
+ ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenUpdate"));
127
+ }
128
+ break;
129
+ case Action.SAVING_DATA:
130
+ if (this.beforeSave) {
131
+ const continueAction = this.beforeSave(this.dataUnit);
132
+ if (continueAction instanceof Promise) {
133
+ continueAction.then(result => resolve(result ? action : undefined));
134
+ }
135
+ else {
136
+ resolve(continueAction ? action : undefined);
137
+ }
138
+ }
139
+ else {
140
+ resolve(action);
141
+ }
142
+ break;
143
+ case Action.DATA_SAVED:
144
+ if (this.afterSave) {
145
+ this.afterSave(this.dataUnit);
146
+ }
147
+ else {
148
+ resolve(action);
149
+ }
150
+ break;
151
+ case Action.EDITION_CANCELED:
152
+ if (this.dataState.hasDirtyRecords) {
153
+ const cancelConfirmation = this.getMessage("snkDataUnit.cancelConfirmation");
154
+ if (cancelConfirmation == undefined) {
155
+ resolve(action);
156
+ }
157
+ else {
158
+ const cancelConfirmationTitle = this.getMessage("snkDataUnit.cancelConfirmationTitle");
159
+ ApplicationUtils.confirm(cancelConfirmationTitle, cancelConfirmation)
160
+ .then((result) => resolve(result ? action : undefined));
161
+ }
162
+ }
163
+ else {
164
+ resolve(action);
165
+ }
166
+ break;
167
+ case Action.REMOVING_RECORDS:
168
+ if (this.isAllowed("REMOVE")) {
169
+ const removeConfirmation = this.getMessage("snkDataUnit.removeConfirmation");
170
+ if (removeConfirmation == undefined) {
171
+ resolve(action);
172
+ }
173
+ else {
174
+ const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
175
+ ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, "delete", true, { btnConfirmDanger: true })
176
+ .then((result) => resolve(result ? action : undefined));
177
+ }
178
+ }
179
+ else {
180
+ ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenRemove"));
181
+ }
182
+ break;
183
+ default:
184
+ resolve(action);
185
+ }
186
+ });
187
+ }
188
+ showSuccessMessage(message) {
189
+ ApplicationUtils.info(message, { iconName: "check" });
190
+ }
191
+ isAllowed(flag) {
192
+ return this._permissions ? this._permissions.isSup || this._permissions[flag] : false;
193
+ }
194
+ /**
195
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
196
+ * através de um pequeno modulo na estrutura da aplicação:
197
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
198
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
199
+ */
200
+ getMessage(key, params = undefined) {
201
+ if (!params) {
202
+ params = this.getMessageParams();
203
+ }
204
+ return this._application.messagesBuilder.getMessage(key, params);
205
+ }
206
+ getMessageParams() {
207
+ //TODO: Atualmente ainda não usamos o recurso de multiseleção do dataunit, mas no futuro
208
+ //precisaremos criar um mecanismo para oferecer todos os registros selecionados para a
209
+ //mensagem
210
+ return this.dataState.selectedRecords ? this.dataState.selectedRecords[0] : undefined;
211
+ }
212
+ getMessageOperation() {
213
+ if (this.dataState.copyMode) {
214
+ return OperationMap.CLONE;
215
+ }
216
+ if (this.dataState.insertionMode) {
217
+ return OperationMap.INSERT;
218
+ }
219
+ if (this.dataState.isDirty) {
220
+ return OperationMap.UPDATE;
221
+ }
222
+ return OperationMap.CLEAN;
223
+ }
224
+ async loadDataUnit() {
225
+ if (!this.dataUnit) {
226
+ if (this._application && this.entityName) {
227
+ const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
228
+ this.dataUnit = await this._application.getDataUnit(this.entityName, cacheName);
229
+ this.dataUnit.pageSize = this.pageSize;
230
+ this.dataUnit.unsubscribe(this._dataUnitObserver);
231
+ this.dataUnit.addInterceptor(this);
232
+ this.dataUnit.subscribe(this._dataUnitObserver);
233
+ let resolver;
234
+ while (resolver = this._onDataUnitResolve.pop()) {
235
+ resolver(this.dataUnit);
236
+ }
237
+ if (this.autoLoad) {
238
+ this.dataUnit.loadData();
239
+ }
240
+ }
241
+ }
242
+ }
243
+ //---------------------------------------------
244
+ // Lifecycle web component
245
+ //---------------------------------------------
246
+ componentWillLoad() {
247
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
248
+ this._application.getAllAccess().then(access => this._permissions = access);
249
+ this.loadDataUnit();
250
+ }
251
+ render() {
252
+ return (h(Host, null));
253
+ }
254
+ static get is() { return "snk-data-unit"; }
255
+ static get encapsulation() { return "scoped"; }
256
+ static get originalStyleUrls() { return {
257
+ "$": ["snk-data-unit.css"]
258
+ }; }
259
+ static get styleUrls() { return {
260
+ "$": ["snk-data-unit.css"]
261
+ }; }
262
+ static get properties() { return {
263
+ "dataState": {
264
+ "type": "unknown",
265
+ "mutable": true,
266
+ "complexType": {
267
+ "original": "DataState",
268
+ "resolved": "DataState",
269
+ "references": {
270
+ "DataState": {
271
+ "location": "local"
272
+ }
273
+ }
274
+ },
275
+ "required": false,
276
+ "optional": false,
277
+ "docs": {
278
+ "tags": [],
279
+ "text": "O estato atual dos dados, isto \u00E9 se h\u00E1 altera\u00E7\u00E3o, insers\u00E3o, as linhas selecionadas, etc."
280
+ }
281
+ },
282
+ "dataUnitName": {
283
+ "type": "string",
284
+ "mutable": false,
285
+ "complexType": {
286
+ "original": "string",
287
+ "resolved": "string",
288
+ "references": {}
289
+ },
290
+ "required": false,
291
+ "optional": false,
292
+ "docs": {
293
+ "tags": [],
294
+ "text": "Este atributo \u00E9 usado para criar o dataUnit uma \u00FAnica vez. Se omitido ser\u00E1 usado o pr\u00F3prio nome\nda entidade."
295
+ },
296
+ "attribute": "data-unit-name",
297
+ "reflect": false
298
+ },
299
+ "entityName": {
300
+ "type": "string",
301
+ "mutable": false,
302
+ "complexType": {
303
+ "original": "string",
304
+ "resolved": "string",
305
+ "references": {}
306
+ },
307
+ "required": false,
308
+ "optional": false,
309
+ "docs": {
310
+ "tags": [],
311
+ "text": "Determina qual a entidade representa os dados em quest\u00E3o."
312
+ },
313
+ "attribute": "entity-name",
314
+ "reflect": false
315
+ },
316
+ "pageSize": {
317
+ "type": "number",
318
+ "mutable": false,
319
+ "complexType": {
320
+ "original": "number",
321
+ "resolved": "number",
322
+ "references": {}
323
+ },
324
+ "required": false,
325
+ "optional": false,
326
+ "docs": {
327
+ "tags": [],
328
+ "text": "Determina quantas linhas s\u00E3o retornadas por p\u00E1gina"
329
+ },
330
+ "attribute": "page-size",
331
+ "reflect": false,
332
+ "defaultValue": "150"
333
+ },
334
+ "dataUnit": {
335
+ "type": "unknown",
336
+ "mutable": true,
337
+ "complexType": {
338
+ "original": "DataUnit",
339
+ "resolved": "DataUnit",
340
+ "references": {
341
+ "DataUnit": {
342
+ "location": "import",
343
+ "path": "@sankhyalabs/core"
344
+ }
345
+ }
346
+ },
347
+ "required": false,
348
+ "optional": false,
349
+ "docs": {
350
+ "tags": [],
351
+ "text": "Uma vez instanciado, pode-se obter o dataUnit por esta propriedade"
352
+ }
353
+ },
354
+ "beforeSave": {
355
+ "type": "unknown",
356
+ "mutable": false,
357
+ "complexType": {
358
+ "original": "(dataUnit: DataUnit) => boolean | Promise<boolean>",
359
+ "resolved": "(dataUnit: DataUnit) => boolean | Promise<boolean>",
360
+ "references": {
361
+ "DataUnit": {
362
+ "location": "import",
363
+ "path": "@sankhyalabs/core"
364
+ },
365
+ "Promise": {
366
+ "location": "global"
367
+ }
368
+ }
369
+ },
370
+ "required": false,
371
+ "optional": false,
372
+ "docs": {
373
+ "tags": [],
374
+ "text": "Executado imediatamente antes da a\u00E7\u00E3o de salvar as altera\u00E7\u00F5es. \u00DAtil no caso de valida\u00E7\u00F5es por exemplo.\nCaso retorne \"false\" (ou a promessa se resolva como false), cancela a a\u00E7\u00E3o."
375
+ }
376
+ },
377
+ "afterSave": {
378
+ "type": "unknown",
379
+ "mutable": false,
380
+ "complexType": {
381
+ "original": "(dataUnit: DataUnit) => void",
382
+ "resolved": "(dataUnit: DataUnit) => void",
383
+ "references": {
384
+ "DataUnit": {
385
+ "location": "import",
386
+ "path": "@sankhyalabs/core"
387
+ }
388
+ }
389
+ },
390
+ "required": false,
391
+ "optional": false,
392
+ "docs": {
393
+ "tags": [],
394
+ "text": "Executado ap\u00F3s a a\u00E7\u00E3o de salvar"
395
+ }
396
+ },
397
+ "autoLoad": {
398
+ "type": "boolean",
399
+ "mutable": false,
400
+ "complexType": {
401
+ "original": "boolean",
402
+ "resolved": "boolean",
403
+ "references": {}
404
+ },
405
+ "required": false,
406
+ "optional": false,
407
+ "docs": {
408
+ "tags": [],
409
+ "text": "Quando ativada essa propriedade faz com que haja uma carga imediata no DataUnit"
410
+ },
411
+ "attribute": "auto-load",
412
+ "reflect": false,
413
+ "defaultValue": "true"
414
+ }
415
+ }; }
416
+ static get events() { return [{
417
+ "method": "dataStateChange",
418
+ "name": "dataStateChange",
419
+ "bubbles": true,
420
+ "cancelable": true,
421
+ "composed": true,
422
+ "docs": {
423
+ "tags": [],
424
+ "text": "Disparado quando o h\u00E1 qualquer mudan\u00E7a de estado no DataUnit"
425
+ },
426
+ "complexType": {
427
+ "original": "DataState",
428
+ "resolved": "DataState",
429
+ "references": {
430
+ "DataState": {
431
+ "location": "local"
432
+ }
433
+ }
434
+ }
435
+ }, {
436
+ "method": "dataUnitReady",
437
+ "name": "dataUnitReady",
438
+ "bubbles": true,
439
+ "cancelable": true,
440
+ "composed": true,
441
+ "docs": {
442
+ "tags": [],
443
+ "text": "Disparado quando o DataUnit est\u00E1 pronto"
444
+ },
445
+ "complexType": {
446
+ "original": "DataUnit",
447
+ "resolved": "DataUnit",
448
+ "references": {
449
+ "DataUnit": {
450
+ "location": "import",
451
+ "path": "@sankhyalabs/core"
452
+ }
453
+ }
454
+ }
455
+ }, {
456
+ "method": "insertionMode",
457
+ "name": "insertionMode",
458
+ "bubbles": true,
459
+ "cancelable": true,
460
+ "composed": true,
461
+ "docs": {
462
+ "tags": [],
463
+ "text": "Disparado quando um registro \u00E9 adicionado ou copiado"
464
+ },
465
+ "complexType": {
466
+ "original": "void",
467
+ "resolved": "void",
468
+ "references": {}
469
+ }
470
+ }, {
471
+ "method": "cancelEdition",
472
+ "name": "cancelEdition",
473
+ "bubbles": true,
474
+ "cancelable": true,
475
+ "composed": true,
476
+ "docs": {
477
+ "tags": [],
478
+ "text": "Disparado quando se cancela uma insers\u00E3o/c\u00F3pia"
479
+ },
480
+ "complexType": {
481
+ "original": "void",
482
+ "resolved": "void",
483
+ "references": {}
484
+ }
485
+ }]; }
486
+ static get methods() { return {
487
+ "getDataUnit": {
488
+ "complexType": {
489
+ "signature": "() => Promise<DataUnit>",
490
+ "parameters": [],
491
+ "references": {
492
+ "Promise": {
493
+ "location": "global"
494
+ },
495
+ "DataUnit": {
496
+ "location": "import",
497
+ "path": "@sankhyalabs/core"
498
+ }
499
+ },
500
+ "return": "Promise<DataUnit>"
501
+ },
502
+ "docs": {
503
+ "text": "Pode-se obter o dataUnit atrav\u00E9s desse m\u00E9todo. Outra forma, \u00E9 ouvir o evento de",
504
+ "tags": [{
505
+ "name": "returns",
506
+ "text": "dataUnit"
507
+ }]
508
+ }
509
+ }
510
+ }; }
511
+ static get elementRef() { return "element"; }
512
+ static get watchers() { return [{
513
+ "propName": "pageSize",
514
+ "methodName": "observePageSize"
515
+ }, {
516
+ "propName": "dataUnitName",
517
+ "methodName": "observeDataUnitName"
518
+ }, {
519
+ "propName": "entityName",
520
+ "methodName": "observeEntityName"
521
+ }, {
522
+ "propName": "dataState",
523
+ "methodName": "observeDataState"
524
+ }, {
525
+ "propName": "dataUnit",
526
+ "methodName": "observeDataUnit"
527
+ }]; }
528
+ }
@@ -0,0 +1,34 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .snk-form {
6
+ position: relative;
7
+
8
+ /*public*/
9
+ padding: var(--space--large);
10
+ padding-top: var(--space--medium);
11
+ }
12
+
13
+ .snk-form__header {
14
+ position: relative;
15
+
16
+ /*public*/
17
+ padding-top: var(--space--medium);
18
+ padding-bottom: var(--space--medium);
19
+ margin-bottom: var(--space--medium);
20
+ }
21
+
22
+ .snk-form__header--fixed {
23
+ position: sticky;
24
+ top: 0;
25
+
26
+ /*public*/
27
+ background: var(--background--body);
28
+ z-index: var(--more-visible, 2);
29
+ padding-left: var(--space--large);
30
+ padding-right: var(--space--large);
31
+ margin-left: calc(var(--space--large) * -1);
32
+ margin-right: calc(var(--space--large) * -1);
33
+ width: calc(100% + (var(--space--large) * 2));
34
+ }