@sankhyalabs/ezui 4.6.0 → 4.7.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/{constants-5d588e38.js → constants-5a75e2f3.js} +0 -2
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +0 -1
- package/dist/cjs/ez-grid.cjs.entry.js +112 -213
- package/dist/cjs/ez-modal.cjs.entry.js +5 -2
- package/dist/cjs/ez-upload.cjs.entry.js +4 -2
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +86 -84
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +5 -16
- package/dist/collection/components/ez-grid/ez-grid.js +21 -110
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -5
- package/dist/collection/components/ez-modal/ez-modal.css +4 -2
- package/dist/collection/components/ez-modal/ez-modal.js +26 -1
- package/dist/collection/components/ez-upload/ez-upload.css +14 -1
- package/dist/collection/components/ez-upload/ez-upload.js +20 -1
- package/dist/collection/utils/form/DataBinder.js +0 -1
- package/dist/custom-elements/index.js +124 -221
- package/dist/esm/constants-ca136201.js +3 -0
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +0 -1
- package/dist/esm/ez-grid.entry.js +112 -213
- package/dist/esm/ez-modal.entry.js +5 -2
- package/dist/esm/ez-upload.entry.js +4 -2
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-03164b9f.entry.js +1 -0
- package/dist/ezui/p-22f4210d.entry.js +1 -0
- package/dist/ezui/p-3f4ae3a3.js +1 -0
- package/dist/ezui/{p-878646a0.entry.js → p-50883460.entry.js} +1 -1
- package/dist/ezui/{p-ef705232.entry.js → p-8654802d.entry.js} +2 -2
- package/dist/ezui/{p-b7ea9791.entry.js → p-e748b5d3.entry.js} +1 -1
- package/dist/ezui/p-f1dc3514.entry.js +1 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +6 -10
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +3 -5
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +0 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +2 -9
- package/dist/types/components/ez-grid/subcomponents/selection-counter.d.ts +2 -2
- package/dist/types/components/ez-modal/ez-modal.d.ts +9 -0
- package/dist/types/components/ez-upload/ez-upload.d.ts +4 -0
- package/dist/types/components.d.ts +16 -0
- package/package.json +1 -1
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +0 -73
- package/dist/esm/constants-76d2e931.js +0 -4
- package/dist/ezui/p-1f841f3c.entry.js +0 -1
- package/dist/ezui/p-622c2d53.entry.js +0 -1
- package/dist/ezui/p-b01e3085.js +0 -1
- package/dist/ezui/p-eceb9382.entry.js +0 -1
- package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +0 -11
|
@@ -8,7 +8,7 @@ const ApplicationUtils = require('./ApplicationUtils-1eef635f.js');
|
|
|
8
8
|
const CSSVarsUtils = require('./CSSVarsUtils-af809e73.js');
|
|
9
9
|
require('./DialogType-2114c337.js');
|
|
10
10
|
require('./CheckMode-ecb90b87.js');
|
|
11
|
-
const constants = require('./constants-
|
|
11
|
+
const constants = require('./constants-5a75e2f3.js');
|
|
12
12
|
|
|
13
13
|
const ezComboBoxCss = ":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box--line-height:calc(var(--text--medium, 14px) + 4px);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #2B3A54);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-combo-box__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-combo-box__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-combo-box__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-combo-box__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__scrollbar--color-background);width:var(--ez-combo-box__scrollbar--width);max-width:var(--ez-combo-box__scrollbar--width);min-width:var(--ez-combo-box__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__scrollbar--color-background);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__scrollbar--color-default);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-combo-box__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-combo-box__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size);line-height:var(--ez-combo-box--line-height)}.item__label{font-weight:var(--ez-combo-box--font-weight--medium)}.item__label--bold{font-weight:var(--ez-combo-box--font-weight--large)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-combo-box__list-height)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
|
14
14
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-892780f1.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const constants = require('./constants-
|
|
7
|
+
const constants = require('./constants-5a75e2f3.js');
|
|
8
8
|
const CheckMode = require('./CheckMode-ecb90b87.js');
|
|
9
9
|
|
|
10
10
|
const buildSwitch = (field) => {
|
|
@@ -214,7 +214,6 @@ class DataBinder {
|
|
|
214
214
|
case core.Action.RECORDS_COPIED:
|
|
215
215
|
case core.Action.EDITION_CANCELED:
|
|
216
216
|
case core.Action.SELECTION_CHANGED:
|
|
217
|
-
case core.Action.SELECTION_REMOVED:
|
|
218
217
|
case core.Action.NEXT_SELECTED:
|
|
219
218
|
case core.Action.PREVIOUS_SELECTED:
|
|
220
219
|
this.clearInvalid();
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-892780f1.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const
|
|
7
|
+
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.2.1
|
|
@@ -118934,6 +118934,7 @@ class DataSource {
|
|
|
118934
118934
|
if (this._options) {
|
|
118935
118935
|
this._options.onPaginationChange(this._dataUnit.getPaginationInfo());
|
|
118936
118936
|
}
|
|
118937
|
+
this.updateSelection();
|
|
118937
118938
|
break;
|
|
118938
118939
|
case core.Action.RECORDS_REMOVED:
|
|
118939
118940
|
case core.Action.DATA_SAVED:
|
|
@@ -118942,7 +118943,6 @@ class DataSource {
|
|
|
118942
118943
|
this._controller.refresh();
|
|
118943
118944
|
break;
|
|
118944
118945
|
case core.Action.SELECTION_CHANGED:
|
|
118945
|
-
case core.Action.SELECTION_REMOVED:
|
|
118946
118946
|
case core.Action.NEXT_SELECTED:
|
|
118947
118947
|
case core.Action.PREVIOUS_SELECTED:
|
|
118948
118948
|
this.updateSelection();
|
|
@@ -118956,25 +118956,14 @@ class DataSource {
|
|
|
118956
118956
|
this._dataUnit.subscribe(this.duObserver);
|
|
118957
118957
|
}
|
|
118958
118958
|
updateSelection() {
|
|
118959
|
-
|
|
118960
|
-
if (
|
|
118961
|
-
|
|
118962
|
-
}
|
|
118963
|
-
const dataSelection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
118964
|
-
if ((dataSelection === null || dataSelection === void 0 ? void 0 : dataSelection.length) > 0) {
|
|
118965
|
-
this._controller.selectRows(dataSelection);
|
|
118959
|
+
const selectionInfo = this._dataUnit.getSelectionInfo();
|
|
118960
|
+
if (selectionInfo.isAllRecords()) {
|
|
118961
|
+
this._controller.selectAll(true);
|
|
118966
118962
|
}
|
|
118967
118963
|
else {
|
|
118968
|
-
this._controller.
|
|
118964
|
+
this._controller.selectRows(selectionInfo.recordIds, true);
|
|
118969
118965
|
}
|
|
118970
118966
|
}
|
|
118971
|
-
isSelectionEquals() {
|
|
118972
|
-
var _a, _b;
|
|
118973
|
-
const dataSelection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
118974
|
-
const controlSelection = (_b = this._controller) === null || _b === void 0 ? void 0 : _b.getSelection();
|
|
118975
|
-
return core.ObjectUtils.objectToString(dataSelection || []) ===
|
|
118976
|
-
core.ObjectUtils.objectToString(controlSelection || []);
|
|
118977
|
-
}
|
|
118978
118967
|
getRows(params) {
|
|
118979
118968
|
if (this.needReload(params)) {
|
|
118980
118969
|
this._lastLoadingParams = params;
|
|
@@ -119175,9 +119164,12 @@ class AgGridController {
|
|
|
119175
119164
|
else {
|
|
119176
119165
|
this._grid = new Grid(container, this._gridOptions);
|
|
119177
119166
|
}
|
|
119178
|
-
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.
|
|
119179
|
-
if (selection) {
|
|
119180
|
-
this.
|
|
119167
|
+
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectionInfo();
|
|
119168
|
+
if (selection === null || selection === void 0 ? void 0 : selection.isAllRecords()) {
|
|
119169
|
+
this.selectAll(true);
|
|
119170
|
+
}
|
|
119171
|
+
else {
|
|
119172
|
+
this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
|
|
119181
119173
|
}
|
|
119182
119174
|
this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
|
|
119183
119175
|
}
|
|
@@ -119241,7 +119233,7 @@ class AgGridController {
|
|
|
119241
119233
|
opt.onColumnPinned = e => this.onCallStateChange("columnPinned", e);
|
|
119242
119234
|
opt.onColumnMoved = e => this.onCallStateChange("columnMoved", e);
|
|
119243
119235
|
opt.onColumnVisible = e => this.onCallStateChange("visibleChange", e);
|
|
119244
|
-
opt.onSelectionChanged =
|
|
119236
|
+
opt.onSelectionChanged = e => this.onSelectionChange(e);
|
|
119245
119237
|
opt.onRowDoubleClicked = evt => this.onRowDoubleClick(evt);
|
|
119246
119238
|
opt.onDragStopped = evt => this.onCallStateChange("columnMovedEnd", evt);
|
|
119247
119239
|
}
|
|
@@ -119249,72 +119241,31 @@ class AgGridController {
|
|
|
119249
119241
|
opt.suppressDragLeaveHidesColumns = true;
|
|
119250
119242
|
opt.suppressMenuHide = true;
|
|
119251
119243
|
}
|
|
119252
|
-
isAllRecordSetted(allSelection) {
|
|
119253
|
-
return allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((selectedRecord) => {
|
|
119254
|
-
return selectedRecord.__record__id__ === constants.ALL_RECORD;
|
|
119255
|
-
});
|
|
119256
|
-
}
|
|
119257
119244
|
getSelectionHeaderStatus() {
|
|
119258
119245
|
const records = this._dataUnit.records;
|
|
119259
119246
|
if (records && records.length === 0) {
|
|
119260
119247
|
return false;
|
|
119261
119248
|
}
|
|
119262
|
-
const
|
|
119263
|
-
if (
|
|
119264
|
-
return false;
|
|
119265
|
-
}
|
|
119266
|
-
if (this.isAllRecordSetted(allSelection)) {
|
|
119249
|
+
const selectionInfo = this._dataUnit.getSelectionInfo();
|
|
119250
|
+
if (selectionInfo.isAllRecords()) {
|
|
119267
119251
|
return true;
|
|
119268
119252
|
}
|
|
119269
|
-
|
|
119270
|
-
|
|
119271
|
-
|
|
119272
|
-
const selectedRecords = this._dataUnit.getSelectedRecords();
|
|
119273
|
-
if (selectedRecords.length < allSelection.length) {
|
|
119274
|
-
return undefined;
|
|
119253
|
+
const selection = selectionInfo.recordIds;
|
|
119254
|
+
if (selection == undefined || selection.length === 0) {
|
|
119255
|
+
return false;
|
|
119275
119256
|
}
|
|
119276
119257
|
let status = undefined;
|
|
119277
119258
|
for (let i = 0; i < records.length; i++) {
|
|
119278
|
-
const current =
|
|
119279
|
-
return selectedRecord.__record__id__ === records[i].__record__id__;
|
|
119280
|
-
});
|
|
119259
|
+
const current = selection.includes(records[i].__record__id__);
|
|
119281
119260
|
if (status != undefined && current !== status) {
|
|
119282
|
-
return;
|
|
119261
|
+
return undefined;
|
|
119283
119262
|
}
|
|
119284
119263
|
status = current;
|
|
119285
119264
|
}
|
|
119286
119265
|
return status;
|
|
119287
119266
|
}
|
|
119288
|
-
|
|
119289
|
-
|
|
119290
|
-
return;
|
|
119291
|
-
}
|
|
119292
|
-
let allSelection = this._dataUnit.getSelection();
|
|
119293
|
-
if (allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((sel) => sel.__record__id__ === constants.ALL_RECORD)) {
|
|
119294
|
-
await this._dataUnit.clearSelection();
|
|
119295
|
-
}
|
|
119296
|
-
let updateSelection = [];
|
|
119297
|
-
const records = this._dataUnit.records;
|
|
119298
|
-
const selectedRecords = this._dataUnit.getSelectedRecords();
|
|
119299
|
-
allSelection = this._dataUnit.getSelection();
|
|
119300
|
-
if (selectAll && selectedRecords.length < records.length) {
|
|
119301
|
-
updateSelection = records;
|
|
119302
|
-
allSelection.forEach((selectedRecord) => {
|
|
119303
|
-
const recordIds = updateSelection.map((record) => record.__record__id__);
|
|
119304
|
-
if (!recordIds.includes(selectedRecord.__record__id__)) {
|
|
119305
|
-
updateSelection.push(selectedRecord);
|
|
119306
|
-
}
|
|
119307
|
-
});
|
|
119308
|
-
}
|
|
119309
|
-
else {
|
|
119310
|
-
updateSelection = allSelection.filter((selectedRecord) => {
|
|
119311
|
-
return !(records || [])
|
|
119312
|
-
.some((record) => {
|
|
119313
|
-
return record.__record__id__ === selectedRecord.__record__id__;
|
|
119314
|
-
});
|
|
119315
|
-
});
|
|
119316
|
-
}
|
|
119317
|
-
this._dataUnit.setSelection(updateSelection);
|
|
119267
|
+
updateSelectionForAll(selectAll) {
|
|
119268
|
+
this._dataUnit.updatePageSelection(selectAll ? this._dataUnit.records.map(r => r.__record__id__) : []);
|
|
119318
119269
|
}
|
|
119319
119270
|
setData(data) {
|
|
119320
119271
|
if (this._grid === undefined) {
|
|
@@ -119332,21 +119283,55 @@ class AgGridController {
|
|
|
119332
119283
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
119333
119284
|
}
|
|
119334
119285
|
}
|
|
119335
|
-
|
|
119336
|
-
|
|
119337
|
-
|
|
119286
|
+
selectAll(quietly = false) {
|
|
119287
|
+
try {
|
|
119288
|
+
this._gridOptions.context.selectionChangeQuietly = quietly;
|
|
119289
|
+
this._gridOptions.api.forEachNode(node => {
|
|
119290
|
+
if (!node.isSelected()) {
|
|
119291
|
+
node.setSelected(true);
|
|
119292
|
+
}
|
|
119293
|
+
});
|
|
119294
|
+
}
|
|
119295
|
+
finally {
|
|
119296
|
+
const newContext = Object.assign({}, this._gridOptions.context);
|
|
119297
|
+
delete newContext.selectionChangeQuietly;
|
|
119298
|
+
this._gridOptions.context = newContext;
|
|
119338
119299
|
}
|
|
119339
|
-
|
|
119340
|
-
|
|
119341
|
-
|
|
119342
|
-
|
|
119343
|
-
|
|
119300
|
+
}
|
|
119301
|
+
selectRows(rowIds, quietly = false) {
|
|
119302
|
+
var _a;
|
|
119303
|
+
try {
|
|
119304
|
+
this._gridOptions.context.selectionChangeQuietly = quietly;
|
|
119305
|
+
if (this._grid === undefined) {
|
|
119306
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
119344
119307
|
}
|
|
119345
|
-
|
|
119346
|
-
|
|
119308
|
+
let lastSelected;
|
|
119309
|
+
this._gridOptions.api.forEachNode(node => {
|
|
119310
|
+
if (rowIds && rowIds.includes(node.id)) {
|
|
119311
|
+
if (!node.isSelected()) {
|
|
119312
|
+
node.setSelected(true);
|
|
119313
|
+
lastSelected = node;
|
|
119314
|
+
}
|
|
119315
|
+
}
|
|
119316
|
+
else {
|
|
119317
|
+
if (node.isSelected()) {
|
|
119318
|
+
node.setSelected(false);
|
|
119319
|
+
}
|
|
119320
|
+
}
|
|
119321
|
+
});
|
|
119322
|
+
const selectionHeader = this._gridOptions.context.selectionHeader;
|
|
119323
|
+
if (selectionHeader) {
|
|
119324
|
+
selectionHeader.updateCheckbox();
|
|
119347
119325
|
}
|
|
119348
|
-
|
|
119349
|
-
|
|
119326
|
+
if (lastSelected) {
|
|
119327
|
+
(_a = this._gridOptions.api) === null || _a === void 0 ? void 0 : _a.ensureNodeVisible(lastSelected);
|
|
119328
|
+
}
|
|
119329
|
+
}
|
|
119330
|
+
finally {
|
|
119331
|
+
const newContext = Object.assign({}, this._gridOptions.context);
|
|
119332
|
+
delete newContext.selectionChangeQuietly;
|
|
119333
|
+
this._gridOptions.context = newContext;
|
|
119334
|
+
}
|
|
119350
119335
|
}
|
|
119351
119336
|
removeRows() {
|
|
119352
119337
|
if (this._grid === undefined) {
|
|
@@ -119529,19 +119514,6 @@ class AgGridController {
|
|
|
119529
119514
|
var _a;
|
|
119530
119515
|
(_a = this._gridOptions.api.getDisplayedRowAtIndex(index)) === null || _a === void 0 ? void 0 : _a.setSelected(true);
|
|
119531
119516
|
}
|
|
119532
|
-
deselectAll() {
|
|
119533
|
-
var _a, _b;
|
|
119534
|
-
(_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.deselectAll();
|
|
119535
|
-
this.updateCheckbox();
|
|
119536
|
-
}
|
|
119537
|
-
updateCheckbox() {
|
|
119538
|
-
var _a, _b;
|
|
119539
|
-
const selectionHeader = (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.selectionHeader;
|
|
119540
|
-
if (selectionHeader == undefined) {
|
|
119541
|
-
return;
|
|
119542
|
-
}
|
|
119543
|
-
selectionHeader.updateCheckbox();
|
|
119544
|
-
}
|
|
119545
119517
|
buildColDef(source) {
|
|
119546
119518
|
var _a, _b, _c;
|
|
119547
119519
|
let tooltip = undefined;
|
|
@@ -119662,13 +119634,33 @@ class AgGridController {
|
|
|
119662
119634
|
}
|
|
119663
119635
|
return false;
|
|
119664
119636
|
}
|
|
119665
|
-
onSelectionChange() {
|
|
119637
|
+
onSelectionChange(event) {
|
|
119666
119638
|
if (this._selectionChangeCallback) {
|
|
119667
119639
|
clearTimeout(this._selectionChangeDeboucing);
|
|
119668
119640
|
this._selectionChangeDeboucing = window.setTimeout(() => {
|
|
119669
|
-
this.
|
|
119670
|
-
|
|
119671
|
-
|
|
119641
|
+
if (this._dataUnit) {
|
|
119642
|
+
if (event.context.selectionChangeQuietly) {
|
|
119643
|
+
const selectionInfo = this._dataUnit;
|
|
119644
|
+
this._selectionChangeCallback({
|
|
119645
|
+
selection: selectionInfo.records,
|
|
119646
|
+
selectionHeaderStatus: this.getSelectionHeaderStatus()
|
|
119647
|
+
});
|
|
119648
|
+
}
|
|
119649
|
+
else {
|
|
119650
|
+
this._dataUnit.updatePageSelection(this._gridOptions.api.getSelectedRows().map((r) => r.__record__id__)).then(selectionInfo => {
|
|
119651
|
+
this._selectionChangeCallback({
|
|
119652
|
+
selection: selectionInfo.records,
|
|
119653
|
+
selectionHeaderStatus: this.getSelectionHeaderStatus()
|
|
119654
|
+
});
|
|
119655
|
+
});
|
|
119656
|
+
}
|
|
119657
|
+
}
|
|
119658
|
+
else {
|
|
119659
|
+
this._selectionChangeCallback({
|
|
119660
|
+
selection: this._gridOptions.api.getSelectedRows(),
|
|
119661
|
+
selectionHeaderStatus: this.getSelectionHeaderStatus()
|
|
119662
|
+
});
|
|
119663
|
+
}
|
|
119672
119664
|
}, 0);
|
|
119673
119665
|
}
|
|
119674
119666
|
}
|
|
@@ -119700,16 +119692,14 @@ class AgGridController {
|
|
|
119700
119692
|
}
|
|
119701
119693
|
|
|
119702
119694
|
const SelectionCounter = (props) => {
|
|
119703
|
-
const { selectionCount,
|
|
119704
|
-
const pageSelectedRecords = selectionPageCount === recordsLength;
|
|
119705
|
-
const allSelectedRecords = selectionCount === total;
|
|
119695
|
+
const { selectionCount, currentPageSelected, total, allRecordSelected, onSelectAll, onSelectPage, onClearAll, onClose } = props;
|
|
119706
119696
|
return (index.h("div", Object.assign({ class: "ez-box ez-box--shadow-small" }, getElementID("ezGridSelectionCounter")),
|
|
119707
119697
|
index.h("div", { class: "ez-flex ez-flex--align-items-center ez-size-width--full ez-padding-horizontal--medium" },
|
|
119708
119698
|
index.h("div", { class: "ez-flex ez-flex--wrap ez-flex--align-items-baseline ez-flex--justify-center" },
|
|
119709
|
-
index.h("label", Object.assign({ innerHTML: getText(selectionCount,
|
|
119699
|
+
index.h("label", Object.assign({ innerHTML: getText(selectionCount, allRecordSelected), class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium" }, getElementID("ezGridSelectionCounter_label"))),
|
|
119710
119700
|
index.h("div", { class: "ez-flex ez-margin-right--medium" },
|
|
119711
|
-
(
|
|
119712
|
-
index.h("ez-button", Object.assign({ class: "ez-margin-right--medium", label: `Selecionar ${
|
|
119701
|
+
(currentPageSelected || allRecordSelected) &&
|
|
119702
|
+
index.h("ez-button", Object.assign({ class: "ez-margin-right--medium", label: `Selecionar ${allRecordSelected ? "apenas a página atual" : `todos os ${total} registros`}`, mode: "link", onClick: allRecordSelected ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allRecordSelected ? "Page" : "All"}`))),
|
|
119713
119703
|
index.h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
|
|
119714
119704
|
index.h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")),
|
|
119715
119705
|
index.h("ez-icon", { iconName: "close" })))));
|
|
@@ -119739,13 +119729,12 @@ const EzGrid = class {
|
|
|
119739
119729
|
this.ezDoubleClick = index.createEvent(this, "ezDoubleClick", 7);
|
|
119740
119730
|
this.configChange = index.createEvent(this, "configChange", 7);
|
|
119741
119731
|
this._gridController = new AgGridController(false);
|
|
119742
|
-
this._debounceTimer = 500;
|
|
119743
|
-
this._selectionAll = false;
|
|
119744
119732
|
this._paginationInfo = undefined;
|
|
119745
119733
|
this._paginationChangedByKeyboard = true;
|
|
119746
119734
|
this._showSelectionCounter = false;
|
|
119747
|
-
this.
|
|
119748
|
-
this.
|
|
119735
|
+
this._isAllSelection = false;
|
|
119736
|
+
this._currentPageSelected = undefined;
|
|
119737
|
+
this._selectionCount = undefined;
|
|
119749
119738
|
this.multipleSelection = undefined;
|
|
119750
119739
|
this.config = undefined;
|
|
119751
119740
|
this.serverUrl = undefined;
|
|
@@ -119804,117 +119793,29 @@ const EzGrid = class {
|
|
|
119804
119793
|
this._gridController.setColumnsState(config.columns);
|
|
119805
119794
|
}
|
|
119806
119795
|
onSelectionChange(evt) {
|
|
119807
|
-
|
|
119808
|
-
if (
|
|
119809
|
-
|
|
119810
|
-
}
|
|
119811
|
-
if (this.isAllRecordSetted()) {
|
|
119812
|
-
this.updateSelectionPage(selection);
|
|
119813
|
-
return;
|
|
119814
|
-
}
|
|
119815
|
-
this.setSelection(selection);
|
|
119816
|
-
}
|
|
119817
|
-
updateSelectionPage(selection) {
|
|
119818
|
-
if (this._selectionAll) {
|
|
119819
|
-
this._selectionAll = false;
|
|
119820
|
-
}
|
|
119821
|
-
else {
|
|
119822
|
-
this.dataUnit.clearSelection()
|
|
119823
|
-
.then(() => {
|
|
119824
|
-
const records = this.dataUnit.records;
|
|
119825
|
-
const selectionPage = selection.filter((selectedRecord) => {
|
|
119826
|
-
return records.some((record) => {
|
|
119827
|
-
return record.__record__id__ === selectedRecord.__record__id__;
|
|
119828
|
-
});
|
|
119829
|
-
});
|
|
119830
|
-
this._gridController.selectRows(selectionPage);
|
|
119831
|
-
});
|
|
119832
|
-
}
|
|
119833
|
-
}
|
|
119834
|
-
isAllRecordSetted() {
|
|
119835
|
-
var _a;
|
|
119836
|
-
const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
119837
|
-
return allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((selectedRecord) => {
|
|
119838
|
-
return selectedRecord.__record__id__ === constants.ALL_RECORD;
|
|
119839
|
-
});
|
|
119840
|
-
}
|
|
119841
|
-
setSelection(selection) {
|
|
119842
|
-
if ((selection === null || selection === void 0 ? void 0 : selection.length) > 0) {
|
|
119843
|
-
this.dataUnit.setSelection(selection)
|
|
119844
|
-
.then(this.controlSelectionCounter.bind(this));
|
|
119845
|
-
}
|
|
119846
|
-
else {
|
|
119847
|
-
this.dataUnit.clearSelection()
|
|
119848
|
-
.then(this.controlSelectionCounter.bind(this));
|
|
119849
|
-
}
|
|
119850
|
-
}
|
|
119851
|
-
setAutoSelectAll() {
|
|
119852
|
-
var _a, _b, _c, _d;
|
|
119853
|
-
const { total } = (_a = this._paginationInfo) !== null && _a !== void 0 ? _a : {};
|
|
119854
|
-
if (total == undefined) {
|
|
119855
|
-
return;
|
|
119856
|
-
}
|
|
119857
|
-
this._selectionCount = total;
|
|
119858
|
-
this._selectionAll = true;
|
|
119859
|
-
this._showSelectionCounter = true;
|
|
119860
|
-
(_b = this._gridController) === null || _b === void 0 ? void 0 : _b.selectRows((_d = (_c = this.dataUnit) === null || _c === void 0 ? void 0 : _c.records) !== null && _d !== void 0 ? _d : []);
|
|
119861
|
-
}
|
|
119862
|
-
controlSelectionCounter() {
|
|
119863
|
-
var _a, _b;
|
|
119864
|
-
const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
|
|
119865
|
-
const counter = (_b = allSelection === null || allSelection === void 0 ? void 0 : allSelection.length) !== null && _b !== void 0 ? _b : 0;
|
|
119866
|
-
if (this.isAllRecordSetted()) {
|
|
119867
|
-
this.setAutoSelectAll();
|
|
119868
|
-
return;
|
|
119869
|
-
}
|
|
119870
|
-
if (!this.multipleSelection || !this.isPaginationActived()) {
|
|
119871
|
-
this._showSelectionCounter = false;
|
|
119872
|
-
setTimeout(this.setSelectionCount.bind(this), this._debounceTimer);
|
|
119873
|
-
return;
|
|
119874
|
-
}
|
|
119875
|
-
if (counter > 1) {
|
|
119876
|
-
setTimeout(() => {
|
|
119877
|
-
this.setSelectionCount(counter);
|
|
119878
|
-
this._showSelectionCounter = true;
|
|
119879
|
-
}, this._debounceTimer);
|
|
119880
|
-
}
|
|
119881
|
-
else {
|
|
119882
|
-
this._showSelectionCounter = false;
|
|
119883
|
-
setTimeout(this.setSelectionCount.bind(this, counter), this._debounceTimer);
|
|
119796
|
+
this._currentPageSelected = evt.detail.selectionHeaderStatus === true;
|
|
119797
|
+
if (this.dataUnit) {
|
|
119798
|
+
this.setSelection(this.dataUnit.getSelectionInfo());
|
|
119884
119799
|
}
|
|
119885
119800
|
}
|
|
119886
|
-
|
|
119887
|
-
var _a, _b;
|
|
119888
|
-
this._selectionCount = value;
|
|
119889
|
-
const selectPageRecords = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecords();
|
|
119890
|
-
this._selectionPageCount = (_b = selectPageRecords === null || selectPageRecords === void 0 ? void 0 : selectPageRecords.length) !== null && _b !== void 0 ? _b : 0;
|
|
119891
|
-
}
|
|
119892
|
-
isPaginationActived() {
|
|
119801
|
+
setSelection(selectionInfo) {
|
|
119893
119802
|
var _a;
|
|
119894
|
-
|
|
119895
|
-
|
|
119896
|
-
|
|
119897
|
-
}
|
|
119898
|
-
return Math.ceil(total / (lastRecord - firstRecord + 1)) > 1;
|
|
119803
|
+
this._selectionCount = (_a = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.length) !== null && _a !== void 0 ? _a : 0;
|
|
119804
|
+
this._isAllSelection = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords();
|
|
119805
|
+
this._showSelectionCounter = this._selectionCount > 1 || this._isAllSelection;
|
|
119899
119806
|
}
|
|
119900
119807
|
onSelectAllRecords() {
|
|
119901
|
-
|
|
119902
|
-
|
|
119903
|
-
filter: this.dataUnit.getFilters(),
|
|
119904
|
-
sort: this.dataUnit.getSort()
|
|
119905
|
-
};
|
|
119906
|
-
this.setSelection([allRecord]);
|
|
119808
|
+
var _a;
|
|
119809
|
+
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.setSelection(DataUnit.SelectionMode.ALL_RECORDS).then(selection => this.setSelection(selection));
|
|
119907
119810
|
}
|
|
119908
119811
|
onSelectPageRecords() {
|
|
119909
119812
|
var _a;
|
|
119910
|
-
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.
|
|
119911
|
-
var _a, _b, _c;
|
|
119912
|
-
(_a = this._gridController) === null || _a === void 0 ? void 0 : _a.selectRows((_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) !== null && _c !== void 0 ? _c : []);
|
|
119913
|
-
});
|
|
119813
|
+
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.setSelection(this.dataUnit.records.map(record => record.__record__id__)).then(selection => this.setSelection(selection));
|
|
119914
119814
|
}
|
|
119915
119815
|
onClearSelectedRecords() {
|
|
119916
119816
|
var _a;
|
|
119917
119817
|
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection();
|
|
119818
|
+
this.setSelection(undefined);
|
|
119918
119819
|
}
|
|
119919
119820
|
createConfigFromState(state) {
|
|
119920
119821
|
let newConfig = { columns: [] };
|
|
@@ -120064,8 +119965,6 @@ const EzGrid = class {
|
|
|
120064
119965
|
this._paginationChangedByKeyboard = true;
|
|
120065
119966
|
}
|
|
120066
119967
|
this._paginationInfo = paginationInfo;
|
|
120067
|
-
this._gridController.updateCheckbox();
|
|
120068
|
-
this.controlSelectionCounter();
|
|
120069
119968
|
},
|
|
120070
119969
|
onDoubleClick: (row) => {
|
|
120071
119970
|
this.ezDoubleClick.emit(row);
|
|
@@ -120085,10 +119984,10 @@ const EzGrid = class {
|
|
|
120085
119984
|
this.configSelectionCounter();
|
|
120086
119985
|
}
|
|
120087
119986
|
render() {
|
|
120088
|
-
var _a
|
|
119987
|
+
var _a;
|
|
120089
119988
|
return (index.h(index.Host, null, index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("div", { class: "grid-header__container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container", ref: ref => this._refPaginationControl = ref }, this.getPaginationControl())), index.h("div", { ref: (ref) => this._gridSelectionCounter = ref, class: `grid__selection-counter
|
|
120090
119989
|
${this._showSelectionCounter ? "grid__selection-counter--opened" : ""}
|
|
120091
|
-
` }, index.h(SelectionCounter, { selectionCount: this._selectionCount,
|
|
119990
|
+
` }, index.h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, total: (_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.total, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => this._showSelectionCounter = false })), index.h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), index.h("div", { class: "grid__footer" }, index.h("slot", { name: "footer" }))));
|
|
120092
119991
|
}
|
|
120093
119992
|
static get assetsDirs() { return ["../assets"]; }
|
|
120094
119993
|
get _element() { return index.getElement(this); }
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-892780f1.js');
|
|
6
6
|
|
|
7
|
-
const ezModalCss = ":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;
|
|
7
|
+
const ezModalCss = ":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.modal__vertical-padding{padding:var(--ez-modal-vertical-padding) 0}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;box-sizing:border-box;max-height:100%;height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
|
|
8
8
|
|
|
9
9
|
const EzModal = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -18,6 +18,7 @@ const EzModal = class {
|
|
|
18
18
|
};
|
|
19
19
|
this.modalSize = undefined;
|
|
20
20
|
this.align = undefined;
|
|
21
|
+
this.heightMode = "regular";
|
|
21
22
|
this.opened = true;
|
|
22
23
|
this.closeEsc = false;
|
|
23
24
|
this.closeOutsideClick = false;
|
|
@@ -49,9 +50,11 @@ const EzModal = class {
|
|
|
49
50
|
}
|
|
50
51
|
render() {
|
|
51
52
|
const positionSufix = this.align === "left" ? "left" : "right";
|
|
53
|
+
const regularVerticalPaddingClass = this.heightMode === "regular" ? 'modal__vertical-padding' : '';
|
|
54
|
+
const modalContentHeightMode = this.heightMode === "regular" ? `modal__content--${positionSufix}` : '';
|
|
52
55
|
return (index.h(index.Host, null, this.opened
|
|
53
56
|
?
|
|
54
|
-
index.h("div", { class:
|
|
57
|
+
index.h("div", { class: `modal ${regularVerticalPaddingClass}`, onMouseDown: evt => this.onMouseDownHandler(evt) }, index.h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, index.h("div", { class: `modal__content ${modalContentHeightMode} ${this.modalSize}` }, index.h("slot", null))))
|
|
55
58
|
:
|
|
56
59
|
undefined));
|
|
57
60
|
}
|
|
@@ -102,7 +102,7 @@ class RemoteFile {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
const ezUploadCss = ":host{--ez-upload--height:42px;--ez-upload--width:100%;--ez-upload__icon--width:48px;--ez-upload__container--background-color:var(--background--medium, #d2dce9);--ez-upload__color--primary:var(--color--primary, #008561);--ez-upload--padding--extra-small:var(--space--extra-small, 3px);--ez-upload--padding--small:var(--space--small, 6px);--ez-upload--padding--medium:var(--space--medium, 12px);--ez-upload--padding--large:var(--space--large, 24px);--ez-upload__border--color:var(--color-strokes, #DCE0E8);--ez-upload--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-upload--text--primary:var(--text-primary, #626e82);--ez-upload--font-size:var(--text--medium, 14px);--ez-upload--font-family:var(--font-pattern, Arial);--ez-upload--font-weight:var(--text-weight--large, 500);--ez-upload__btn__cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z\"/></svg>');--ez-upload__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\"/></svg>');display:flex;flex-wrap:wrap;position:relative;padding-bottom:16px;font-family:var(--ez-upload--font-family);font-size:var(--ez-upload--font-size);width:var(--ez-upload--width);font-weight:var(--ez-upload--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:var(--ez-upload--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--ez-upload--padding--medium) var(--ez-upload--padding--medium) var(--ez-upload--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--ez-upload--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--ez-upload__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--ez-upload__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:var(--font-pattern, \"Roboto\");text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--ez-upload__btn__cancel-image);mask-image:var(--ez-upload__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-upload--font-family);font-size:var(--text--extra-small);font-weight:var(--ez-upload--font-weight);color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--ez-upload__file-icon-image);mask-image:var(--ez-upload__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;
|
|
105
|
+
const ezUploadCss = ":host{--ez-upload--height:42px;--ez-upload--width:100%;--ez-upload__icon--width:48px;--ez-upload__container--background-color:var(--background--medium, #d2dce9);--ez-upload__color--primary:var(--color--primary, #008561);--ez-upload--padding--extra-small:var(--space--extra-small, 3px);--ez-upload--padding--small:var(--space--small, 6px);--ez-upload--padding--medium:var(--space--medium, 12px);--ez-upload--padding--large:var(--space--large, 24px);--ez-upload__border--color:var(--color-strokes, #DCE0E8);--ez-upload--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-upload--text--primary:var(--text-primary, #626e82);--ez-upload--text--secondary:var(--text-secondary, #a2abb9);--ez-upload--font-size:var(--text--medium, 14px);--ez-upload--font-family:var(--font-pattern, Arial);--ez-upload--font-weight:var(--text-weight--large, 500);--ez-upload__btn__cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z\"/></svg>');--ez-upload__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\"/></svg>');display:flex;flex-wrap:wrap;position:relative;padding-bottom:16px;font-family:var(--ez-upload--font-family);font-size:var(--ez-upload--font-size);width:var(--ez-upload--width);font-weight:var(--ez-upload--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:var(--ez-upload--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--ez-upload--padding--medium) var(--ez-upload--padding--medium) var(--ez-upload--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--ez-upload--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--ez-upload__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--ez-upload__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.padding-large{padding:var(--ez-upload--padding--large) 0px}.padding-extra-small{padding:var(--ez-upload--padding--extra-small) 0px}.text{font-family:var(--font-pattern, \"Roboto\");text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.text--secondary{color:var(--ez-upload--text--secondary);text-shadow:var(--ez-upload--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--ez-upload__btn__cancel-image);mask-image:var(--ez-upload__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-upload--font-family);font-size:var(--text--extra-small);font-weight:var(--ez-upload--font-weight);color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--ez-upload__file-icon-image);mask-image:var(--ez-upload__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:unset}.appearanceNone{width:0px;height:0px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
|
|
106
106
|
|
|
107
107
|
const EzUpload = class {
|
|
108
108
|
constructor(hostRef) {
|
|
@@ -112,6 +112,7 @@ const EzUpload = class {
|
|
|
112
112
|
this.ezCancelWaitingChange = index.createEvent(this, "ezCancelWaitingChange", 7);
|
|
113
113
|
this._filePointers = new Map();
|
|
114
114
|
this.label = undefined;
|
|
115
|
+
this.subtitle = undefined;
|
|
115
116
|
this.enabled = true;
|
|
116
117
|
this.maxFileSize = undefined;
|
|
117
118
|
this.maxFiles = undefined;
|
|
@@ -352,7 +353,8 @@ const EzUpload = class {
|
|
|
352
353
|
}
|
|
353
354
|
}
|
|
354
355
|
render() {
|
|
355
|
-
return (index.h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass("iu", "background--disabled") }, index.h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, index.h("div", { class: "iu_header" }, this.label ? index.h("label", { class: this.evalDisabledClass("iu__label", "text--disabled"), title: this.label }, this.label) : null, index.h("div", { class: this.evalDisabledClass("iu__icon-label", "mouse-pointer--disabled") }, index.h("button", { class: "iu__file-icon", disabled: !this.enabled }), index.h("div", { class: this.evalDisabledClass("text text--center text--medium text--primary", "text--disabled") }, this.enabled ? "Arraste e solte ou clique para adicionar arquivos" : "Somente leitura"))
|
|
356
|
+
return (index.h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass("iu", "background--disabled") }, index.h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, index.h("div", { class: "iu_header" }, this.label ? index.h("label", { class: this.evalDisabledClass("iu__label", "text--disabled"), title: this.label }, this.label) : null, index.h("div", { class: "padding-large" }, index.h("div", { class: this.evalDisabledClass("iu__icon-label", "mouse-pointer--disabled") }, index.h("button", { class: "iu__file-icon", disabled: !this.enabled }), index.h("div", { class: this.evalDisabledClass("text text--center text--medium text--primary", "text--disabled") }, this.enabled ? "Arraste e solte ou clique para adicionar arquivos" : "Somente leitura")), this.subtitle &&
|
|
357
|
+
index.h("div", { class: this.evalDisabledClass("padding-extra-small text text--center text--small text--secondary", "text--disabled") }, this.subtitle))), this.buildFooter()), index.h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, class: "appearanceNone" })));
|
|
356
358
|
}
|
|
357
359
|
buildFooter() {
|
|
358
360
|
if (this._filePointers.size === 0) {
|