@sankhyalabs/sankhyablocks 1.4.0-beta.1 → 1.4.0-beta.3
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/{SnkMessageBuilder-7717f1e4.js → SnkMessageBuilder-d8215915.js} +14 -119
- package/dist/cjs/{filter-item-type.enum-e2e1bc5b.js → filter-item-type.enum-3daf58d3.js} +2 -0
- package/dist/cjs/{index-b0b676c5.js → index-6fcf07f3.js} +159 -1515
- package/dist/cjs/loader.cjs.js +2 -18
- package/dist/cjs/sankhyablocks.cjs.js +4 -116
- package/dist/cjs/snk-application.cjs.entry.js +84 -230
- package/dist/cjs/snk-crud.cjs.entry.js +3 -3
- package/dist/cjs/snk-data-unit.cjs.entry.js +24 -32
- package/dist/cjs/snk-filter-bar_5.cjs.entry.js +902 -0
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-detail.cjs.entry.js +38 -3
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-number.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-period.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +90 -0
- package/dist/cjs/snk-filter-search.cjs.entry.js +4 -4
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- package/dist/cjs/{snk-form.cjs.entry.js → snk-form_2.cjs.entry.js} +119 -5
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
- package/dist/cjs/{taskbar-elements-283c737e.js → taskbar-elements-aedfeae6.js} +1 -1
- package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/snk-application/snk-application.js +54 -7
- package/dist/collection/components/snk-crud/snk-crud.js +2 -4
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +0 -27
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +100 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +161 -0
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +2 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +36 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +32 -9
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +196 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +22 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +238 -139
- package/dist/collection/components/snk-grid/snk-grid.js +2 -4
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +18 -10
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +14 -2
- package/dist/components/SnkMessageBuilder.js +15 -119
- package/dist/components/filter-item-type.enum.js +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -4
- package/dist/components/snk-application2.js +47 -191
- package/dist/components/snk-crud.js +16 -10
- package/dist/components/snk-data-unit.js +3 -12
- package/dist/components/snk-filter-bar2.js +342 -146
- package/dist/components/snk-filter-detail2.js +36 -1
- package/dist/components/snk-filter-item2.js +33 -10
- package/dist/components/snk-filter-list2.js +1 -1
- package/dist/components/snk-filter-modal.d.ts +11 -0
- package/dist/components/snk-filter-modal.js +6 -0
- package/dist/components/snk-filter-modal2.js +58 -0
- package/dist/components/snk-filter-personalized.d.ts +11 -0
- package/dist/components/snk-filter-personalized.js +108 -0
- package/dist/components/snk-filter-search.js +1 -1
- package/dist/components/snk-form2.js +1 -1
- package/dist/components/snk-grid2.js +16 -10
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-taskbar2.js +1 -1
- package/dist/components/teste-pesquisa.js +1 -1
- package/dist/{sankhyablocks/SnkMessageBuilder-a7da466b.js → esm/SnkMessageBuilder-35a20271.js} +15 -119
- package/dist/esm/{filter-item-type.enum-61fbf80a.js → filter-item-type.enum-a79b2fa8.js} +2 -0
- package/dist/{sankhyablocks/index-2b4d2d14.js → esm/index-81dda3cf.js} +160 -1508
- package/dist/esm/loader.js +2 -18
- package/dist/esm/sankhyablocks.js +4 -116
- package/dist/esm/snk-application.entry.js +46 -192
- package/dist/esm/snk-crud.entry.js +2 -2
- package/dist/esm/snk-data-unit.entry.js +4 -12
- package/dist/esm/snk-filter-bar_5.entry.js +894 -0
- package/dist/esm/snk-filter-binary-select.entry.js +2 -2
- package/dist/esm/snk-filter-detail.entry.js +38 -3
- package/dist/esm/snk-filter-multi-select.entry.js +2 -2
- package/dist/esm/snk-filter-number.entry.js +2 -2
- package/dist/esm/snk-filter-period.entry.js +2 -2
- package/dist/esm/snk-filter-personalized.entry.js +86 -0
- package/dist/esm/snk-filter-search.entry.js +3 -3
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/esm/{snk-form.entry.js → snk-form_2.entry.js} +117 -4
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/{sankhyablocks/taskbar-elements-35d64ff9.js → esm/taskbar-elements-38eb5d51.js} +1 -1
- package/dist/esm/teste-pesquisa.entry.js +2 -2
- package/dist/sankhyablocks/index.esm.js +0 -1
- package/dist/sankhyablocks/p-0352c0e2.entry.js +1 -0
- package/dist/sankhyablocks/p-07ebda01.entry.js +1 -0
- package/dist/sankhyablocks/p-322c0df2.entry.js +1 -0
- package/dist/sankhyablocks/p-46caa101.entry.js +1 -0
- package/dist/sankhyablocks/p-473cedf9.entry.js +1 -0
- package/dist/sankhyablocks/p-586e2522.js +1 -0
- package/dist/sankhyablocks/p-86f15ffe.js +1 -0
- package/dist/sankhyablocks/p-8f3c5709.entry.js +1 -0
- package/dist/sankhyablocks/p-97009a2c.entry.js +1 -0
- package/dist/sankhyablocks/p-9be74b46.entry.js +74 -0
- package/dist/sankhyablocks/p-9dd2b8cb.js +1 -0
- package/dist/sankhyablocks/p-a8b59c61.entry.js +1 -0
- package/dist/sankhyablocks/p-aecf3e0a.entry.js +1 -0
- package/dist/sankhyablocks/p-c1c3b5d8.entry.js +1 -0
- package/dist/sankhyablocks/p-c78cb79a.entry.js +1 -0
- package/dist/sankhyablocks/p-c9eec639.entry.js +1 -0
- package/dist/sankhyablocks/p-dc482a42.entry.js +1 -0
- package/dist/sankhyablocks/p-fac2b6a9.js +2 -0
- package/dist/sankhyablocks/p-fb705f81.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -129
- package/dist/types/components/snk-application/snk-application.d.ts +4 -1
- package/dist/types/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +23 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +3 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +23 -0
- package/dist/types/components.d.ts +56 -8
- package/package.json +3 -3
- package/react/components.d.ts +19 -0
- package/react/components.js +19 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-b8158822.js +0 -6
- package/dist/cjs/dom-36862b77.js +0 -75
- package/dist/cjs/index-02201bc9.js +0 -2397
- package/dist/cjs/shadow-css-346c0795.js +0 -389
- package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -278
- package/dist/cjs/snk-filter-item.cjs.entry.js +0 -154
- package/dist/cjs/snk-filter-list.cjs.entry.js +0 -91
- package/dist/cjs/snk-grid.cjs.entry.js +0 -79
- package/dist/cjs/snk-taskbar.cjs.entry.js +0 -160
- package/dist/cjs/taskbar-processor-6bd0d35c.js +0 -47
- package/dist/components/index2.js +0 -2384
- package/dist/esm/SnkMessageBuilder-a7da466b.js +0 -303
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-b3f2ee8d.js +0 -4
- package/dist/esm/dom-665d6011.js +0 -73
- package/dist/esm/index-2b4d2d14.js +0 -3262
- package/dist/esm/index-f1d3e4da.js +0 -2384
- package/dist/esm/shadow-css-b18e99d7.js +0 -387
- package/dist/esm/snk-filter-bar.entry.js +0 -274
- package/dist/esm/snk-filter-item.entry.js +0 -150
- package/dist/esm/snk-filter-list.entry.js +0 -87
- package/dist/esm/snk-grid.entry.js +0 -75
- package/dist/esm/snk-taskbar.entry.js +0 -156
- package/dist/esm/taskbar-elements-35d64ff9.js +0 -90
- package/dist/esm/taskbar-processor-aa6772c9.js +0 -45
- package/dist/sankhyablocks/app-globals-0f993ce5.js +0 -3
- package/dist/sankhyablocks/css-shim-b3f2ee8d.js +0 -4
- package/dist/sankhyablocks/dom-665d6011.js +0 -73
- package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +0 -12
- package/dist/sankhyablocks/index-f1d3e4da.js +0 -2384
- package/dist/sankhyablocks/shadow-css-b18e99d7.js +0 -387
- package/dist/sankhyablocks/snk-application.entry.js +0 -8148
- package/dist/sankhyablocks/snk-crud.entry.js +0 -66
- package/dist/sankhyablocks/snk-data-unit.entry.js +0 -276
- package/dist/sankhyablocks/snk-filter-bar.entry.js +0 -274
- package/dist/sankhyablocks/snk-filter-binary-select.entry.js +0 -43
- package/dist/sankhyablocks/snk-filter-detail.entry.js +0 -45
- package/dist/sankhyablocks/snk-filter-item.entry.js +0 -150
- package/dist/sankhyablocks/snk-filter-list.entry.js +0 -87
- package/dist/sankhyablocks/snk-filter-multi-select.entry.js +0 -19
- package/dist/sankhyablocks/snk-filter-number.entry.js +0 -20
- package/dist/sankhyablocks/snk-filter-period.entry.js +0 -33
- package/dist/sankhyablocks/snk-filter-search.entry.js +0 -40
- package/dist/sankhyablocks/snk-filter-text.entry.js +0 -18
- package/dist/sankhyablocks/snk-form.entry.js +0 -129
- package/dist/sankhyablocks/snk-grid.entry.js +0 -75
- package/dist/sankhyablocks/snk-pesquisa.entry.js +0 -311
- package/dist/sankhyablocks/snk-taskbar.entry.js +0 -156
- package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +0 -45
- package/dist/sankhyablocks/teste-pesquisa.entry.js +0 -33
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -51
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const
|
|
5
|
+
const index = require('./index-6fcf07f3.js');
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
7
7
|
|
|
8
8
|
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
|
9
9
|
|
|
@@ -56,7 +56,7 @@ const SnkCrud = class {
|
|
|
56
56
|
parent = parent.parentElement;
|
|
57
57
|
}
|
|
58
58
|
if (!this.configName) {
|
|
59
|
-
const application =
|
|
59
|
+
const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
60
60
|
this.configName = application.configName;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
5
|
+
const index = require('./index-6fcf07f3.js');
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
7
|
+
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-d8215915.js');
|
|
8
9
|
|
|
9
10
|
const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
|
|
10
11
|
|
|
@@ -20,10 +21,6 @@ const SnkDataUnit = class {
|
|
|
20
21
|
* Determina quantas linhas são retornadas por página
|
|
21
22
|
*/
|
|
22
23
|
this.pageSize = 150;
|
|
23
|
-
/**
|
|
24
|
-
* Quando ativada essa propriedade faz com que haja uma carga imediata no DataUnit
|
|
25
|
-
*/
|
|
26
|
-
this.autoLoad = true;
|
|
27
24
|
this._dataUnitObserver = (action) => {
|
|
28
25
|
const duState = {
|
|
29
26
|
insertionMode: false,
|
|
@@ -41,23 +38,23 @@ const SnkDataUnit = class {
|
|
|
41
38
|
}
|
|
42
39
|
});
|
|
43
40
|
this.dataState = duState;
|
|
44
|
-
if (action.type ===
|
|
41
|
+
if (action.type === core.Action.DATA_SAVED) {
|
|
45
42
|
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
|
|
46
43
|
if (msg != undefined) {
|
|
47
44
|
this.showSuccessMessage(msg);
|
|
48
45
|
}
|
|
49
46
|
}
|
|
50
|
-
if (action.type ===
|
|
47
|
+
if (action.type === core.Action.RECORDS_ADDED || action.type === core.Action.RECORDS_COPIED) {
|
|
51
48
|
this.insertionMode.emit();
|
|
52
49
|
}
|
|
53
|
-
if (action.type ===
|
|
50
|
+
if (action.type === core.Action.EDITION_CANCELED) {
|
|
54
51
|
this.cancelEdition.emit();
|
|
55
52
|
const cancelFinishMsg = this.getMessage("snkDataUnit.cancelInfo");
|
|
56
53
|
if (cancelFinishMsg != undefined) {
|
|
57
54
|
this.showSuccessMessage(cancelFinishMsg);
|
|
58
55
|
}
|
|
59
56
|
}
|
|
60
|
-
if (action.type ===
|
|
57
|
+
if (action.type === core.Action.RECORDS_REMOVED) {
|
|
61
58
|
const removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
|
|
62
59
|
if (removeFinishMsg != undefined) {
|
|
63
60
|
this.showSuccessMessage(removeFinishMsg);
|
|
@@ -111,33 +108,33 @@ const SnkDataUnit = class {
|
|
|
111
108
|
async interceptAction(action) {
|
|
112
109
|
return new Promise(resolve => {
|
|
113
110
|
switch (action.type) {
|
|
114
|
-
case
|
|
111
|
+
case core.Action.RECORDS_ADDED:
|
|
115
112
|
if (this.isAllowed("INSERT")) {
|
|
116
113
|
resolve(action);
|
|
117
114
|
}
|
|
118
115
|
else {
|
|
119
|
-
|
|
116
|
+
utils.ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenInsert"));
|
|
120
117
|
}
|
|
121
118
|
break;
|
|
122
|
-
case
|
|
119
|
+
case core.Action.RECORDS_COPIED:
|
|
123
120
|
if (this.isAllowed("CLONE")) {
|
|
124
121
|
resolve(action);
|
|
125
122
|
}
|
|
126
123
|
else {
|
|
127
|
-
|
|
124
|
+
utils.ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenClone"));
|
|
128
125
|
}
|
|
129
126
|
break;
|
|
130
|
-
case
|
|
131
|
-
case
|
|
127
|
+
case core.Action.DATA_CHANGED:
|
|
128
|
+
case core.Action.CHANGING_DATA:
|
|
132
129
|
if (this.isAllowed("UPDATE")) {
|
|
133
130
|
resolve(action);
|
|
134
131
|
}
|
|
135
132
|
else {
|
|
136
133
|
this.dataUnit.cancelEdition();
|
|
137
|
-
|
|
134
|
+
utils.ApplicationUtils.alert(this.getMessage("snkDataUnit.forbidden"), this.getMessage("snkDataUnit.forbiddenUpdate"));
|
|
138
135
|
}
|
|
139
136
|
break;
|
|
140
|
-
case
|
|
137
|
+
case core.Action.SAVING_DATA:
|
|
141
138
|
if (this.beforeSave) {
|
|
142
139
|
const continueAction = this.beforeSave(this.dataUnit);
|
|
143
140
|
if (continueAction instanceof Promise) {
|
|
@@ -151,7 +148,7 @@ const SnkDataUnit = class {
|
|
|
151
148
|
resolve(action);
|
|
152
149
|
}
|
|
153
150
|
break;
|
|
154
|
-
case
|
|
151
|
+
case core.Action.DATA_SAVED:
|
|
155
152
|
if (this.afterSave) {
|
|
156
153
|
this.afterSave(this.dataUnit);
|
|
157
154
|
}
|
|
@@ -159,7 +156,7 @@ const SnkDataUnit = class {
|
|
|
159
156
|
resolve(action);
|
|
160
157
|
}
|
|
161
158
|
break;
|
|
162
|
-
case
|
|
159
|
+
case core.Action.EDITION_CANCELED:
|
|
163
160
|
if (this.dataState.hasDirtyRecords) {
|
|
164
161
|
const cancelConfirmation = this.getMessage("snkDataUnit.cancelConfirmation");
|
|
165
162
|
if (cancelConfirmation == undefined) {
|
|
@@ -167,7 +164,7 @@ const SnkDataUnit = class {
|
|
|
167
164
|
}
|
|
168
165
|
else {
|
|
169
166
|
const cancelConfirmationTitle = this.getMessage("snkDataUnit.cancelConfirmationTitle");
|
|
170
|
-
|
|
167
|
+
utils.ApplicationUtils.confirm(cancelConfirmationTitle, cancelConfirmation)
|
|
171
168
|
.then((result) => resolve(result ? action : undefined));
|
|
172
169
|
}
|
|
173
170
|
}
|
|
@@ -175,7 +172,7 @@ const SnkDataUnit = class {
|
|
|
175
172
|
resolve(action);
|
|
176
173
|
}
|
|
177
174
|
break;
|
|
178
|
-
case
|
|
175
|
+
case core.Action.REMOVING_RECORDS:
|
|
179
176
|
if (this.isAllowed("REMOVE")) {
|
|
180
177
|
const removeConfirmation = this.getMessage("snkDataUnit.removeConfirmation");
|
|
181
178
|
if (removeConfirmation == undefined) {
|
|
@@ -183,12 +180,12 @@ const SnkDataUnit = class {
|
|
|
183
180
|
}
|
|
184
181
|
else {
|
|
185
182
|
const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
|
|
186
|
-
|
|
183
|
+
utils.ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, "delete", utils.DialogType.CRITICAL, { btnConfirmDanger: true })
|
|
187
184
|
.then((result) => resolve(result ? action : undefined));
|
|
188
185
|
}
|
|
189
186
|
}
|
|
190
187
|
else {
|
|
191
|
-
|
|
188
|
+
utils.ApplicationUtils.info(this.getMessage("snkDataUnit.forbiddenRemove"));
|
|
192
189
|
}
|
|
193
190
|
break;
|
|
194
191
|
default:
|
|
@@ -197,7 +194,7 @@ const SnkDataUnit = class {
|
|
|
197
194
|
});
|
|
198
195
|
}
|
|
199
196
|
showSuccessMessage(message) {
|
|
200
|
-
|
|
197
|
+
utils.ApplicationUtils.info(message, { iconName: "check" });
|
|
201
198
|
}
|
|
202
199
|
isAllowed(flag) {
|
|
203
200
|
return this._permissions ? this._permissions.isSup || this._permissions[flag] : false;
|
|
@@ -245,11 +242,6 @@ const SnkDataUnit = class {
|
|
|
245
242
|
while (resolver = this._onDataUnitResolve.pop()) {
|
|
246
243
|
resolver(this.dataUnit);
|
|
247
244
|
}
|
|
248
|
-
if (this.autoLoad) {
|
|
249
|
-
setTimeout(() => {
|
|
250
|
-
this.dataUnit.loadData();
|
|
251
|
-
}, 500); //TODO: Ajustar para aguardar filterProvider do dataunit estar pronto.
|
|
252
|
-
}
|
|
253
245
|
}
|
|
254
246
|
}
|
|
255
247
|
}
|
|
@@ -257,7 +249,7 @@ const SnkDataUnit = class {
|
|
|
257
249
|
// Lifecycle web component
|
|
258
250
|
//---------------------------------------------
|
|
259
251
|
componentWillLoad() {
|
|
260
|
-
this._application =
|
|
252
|
+
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
261
253
|
this._application.getAllAccess().then(access => this._permissions = access);
|
|
262
254
|
}
|
|
263
255
|
componentDidLoad() {
|