@sankhyalabs/ezui 7.2.0-dev.1 → 7.2.0-dev.2

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.
@@ -64867,6 +64867,29 @@ function resolveAggFunc(aggFunc) {
64867
64867
  return fn;
64868
64868
  }
64869
64869
 
64870
+ /**
64871
+ * Larguras padrão das colunas do grid por tipo de UserInterface
64872
+ */
64873
+ const GRID_COLUMN_DEFAULT_WIDTHS = {
64874
+ [core.UserInterface.SEARCH]: 200,
64875
+ [core.UserInterface.SEARCHPLUS]: 100,
64876
+ [core.UserInterface.DATE]: 120,
64877
+ [core.UserInterface.DATETIME]: 160,
64878
+ [core.UserInterface.TIME]: 100,
64879
+ [core.UserInterface.ELAPSEDTIME]: 100,
64880
+ [core.UserInterface.DECIMALNUMBER]: 130,
64881
+ [core.UserInterface.INTEGERNUMBER]: 120,
64882
+ [core.UserInterface.SWITCH]: 80,
64883
+ [core.UserInterface.FILE]: 100,
64884
+ [core.UserInterface.HTML]: 200,
64885
+ [core.UserInterface.LONGTEXT]: 200,
64886
+ [core.UserInterface.CHECKBOX]: 80,
64887
+ [core.UserInterface.OPTIONSELECTOR]: 100,
64888
+ [core.UserInterface.SHORTTEXT]: 200,
64889
+ [core.UserInterface.PASSWORD]: 100,
64890
+ [core.UserInterface.MASKEDTEXT]: 100,
64891
+ };
64892
+
64870
64893
  class AgGridController {
64871
64894
  configFilterColumn(filterColumn) {
64872
64895
  this._filterColumn = filterColumn;
@@ -64895,10 +64918,10 @@ class AgGridController {
64895
64918
  this.COLUMN_FOOTER_OPER = 'gridFooterOper';
64896
64919
  this.RECORD_ARCHIVE_COL_ID = '__RECORD_ARCHIVE__';
64897
64920
  this.BLOCK_LOAD_DEBOUNCE = 100;
64898
- this.DEFAULT_FONT_SIZE = 14;
64921
+ this.DEFAULT_FONT_SIZE = 8;
64899
64922
  this.DEFAULT_FONT_SIZE_HTML5 = 32;
64900
- this.DEFAULT_ICON_SIZE = 12;
64901
- this.DEFAULT_MAX_SIZE = 200;
64923
+ this.DEFAULT_ICON_SIZE = 40;
64924
+ this.DEFAULT_MAX_SIZE = 300;
64902
64925
  this._menuItems = [];
64903
64926
  this._idAttribName = '__record__id__';
64904
64927
  this._gridConfig = [];
@@ -65884,9 +65907,11 @@ class AgGridController {
65884
65907
  tooltip = this._i18n('ez-grid.columnCantBeOrder');
65885
65908
  }
65886
65909
  const presentationFrom = (_d = source === null || source === void 0 ? void 0 : source.props) === null || _d === void 0 ? void 0 : _d.get(constants.PRESENTATION_FROM_COL_PROP_NAME);
65910
+ const initialWidth = this.getInitialColumnWidth(source.userInterface, source.label);
65887
65911
  return this._editionManager.configureColumn({
65888
65912
  headerName: source.label,
65889
65913
  field: source.name,
65914
+ width: initialWidth,
65890
65915
  aggFunc: this.getAggFunc(source),
65891
65916
  sortable: propSortable,
65892
65917
  resizable: true,
@@ -66232,10 +66257,21 @@ class AgGridController {
66232
66257
  }
66233
66258
  const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
66234
66259
  const label = (_b = field === null || field === void 0 ? void 0 : field.label) !== null && _b !== void 0 ? _b : (_f = (_e = (_d = (_c = this._gridOptions) === null || _c === void 0 ? void 0 : _c.columnApi) === null || _d === void 0 ? void 0 : _d.getColumn(cfgColumn.name)) === null || _e === void 0 ? void 0 : _e.getColDef()) === null || _f === void 0 ? void 0 : _f.headerName;
66235
- if ((field === null || field === void 0 ? void 0 : field.userInterface) === core.UserInterface.SEARCH) {
66236
- return this.DEFAULT_MAX_SIZE;
66260
+ return this.getInitialColumnWidth(field === null || field === void 0 ? void 0 : field.userInterface, label);
66261
+ }
66262
+ getInitialColumnWidth(userInterface, label) {
66263
+ const columnWidthByLabel = this.getColumnWidthByLabel(label);
66264
+ const defaultWidth = this.getDefaultWidthByUserInterface(userInterface);
66265
+ if (!defaultWidth) {
66266
+ return columnWidthByLabel;
66267
+ }
66268
+ return Math.max(defaultWidth, columnWidthByLabel);
66269
+ }
66270
+ getDefaultWidthByUserInterface(userInterface) {
66271
+ if (!userInterface) {
66272
+ return undefined;
66237
66273
  }
66238
- return this.getColumnWidthByLabel(label);
66274
+ return GRID_COLUMN_DEFAULT_WIDTHS[userInterface];
66239
66275
  }
66240
66276
  getColumnWidthByLabel(label) {
66241
66277
  const labelSize = ((label === null || label === void 0 ? void 0 : label.length) || 0) * this.DEFAULT_FONT_SIZE + this.DEFAULT_ICON_SIZE;
@@ -99,7 +99,6 @@ const EzPopup = class {
99
99
  }
100
100
  componentDidRender() {
101
101
  this.manageOverlay();
102
- this.popUpFocus();
103
102
  }
104
103
  handleAutoClose(event) {
105
104
  if (!this.opened || !this._popupRef || !this.autoClose) {
@@ -7,136 +7,118 @@ const core = require('@sankhyalabs/core');
7
7
  const index$2 = require('./index-350d0fa0.js');
8
8
 
9
9
  /**!
10
- * Sortable 1.15.6
10
+ * Sortable 1.15.7
11
11
  * @author RubaXa <trash@rubaxa.org>
12
12
  * @author owenm <owen23355@gmail.com>
13
13
  * @license MIT
14
14
  */
15
- function ownKeys(object, enumerableOnly) {
16
- var keys = Object.keys(object);
17
- if (Object.getOwnPropertySymbols) {
18
- var symbols = Object.getOwnPropertySymbols(object);
19
- if (enumerableOnly) {
20
- symbols = symbols.filter(function (sym) {
21
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
22
- });
23
- }
24
- keys.push.apply(keys, symbols);
25
- }
26
- return keys;
15
+ function _arrayLikeToArray(r, a) {
16
+ (null == a || a > r.length) && (a = r.length);
17
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
18
+ return n;
19
+ }
20
+ function _arrayWithoutHoles(r) {
21
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
22
+ }
23
+ function _defineProperty(e, r, t) {
24
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
25
+ value: t,
26
+ enumerable: !0,
27
+ configurable: !0,
28
+ writable: !0
29
+ }) : e[r] = t, e;
27
30
  }
28
- function _objectSpread2(target) {
29
- for (var i = 1; i < arguments.length; i++) {
30
- var source = arguments[i] != null ? arguments[i] : {};
31
- if (i % 2) {
32
- ownKeys(Object(source), true).forEach(function (key) {
33
- _defineProperty(target, key, source[key]);
34
- });
35
- } else if (Object.getOwnPropertyDescriptors) {
36
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
37
- } else {
38
- ownKeys(Object(source)).forEach(function (key) {
39
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
40
- });
31
+ function _extends() {
32
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
33
+ for (var e = 1; e < arguments.length; e++) {
34
+ var t = arguments[e];
35
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
41
36
  }
42
- }
43
- return target;
37
+ return n;
38
+ }, _extends.apply(null, arguments);
44
39
  }
45
- function _typeof(obj) {
46
- "@babel/helpers - typeof";
47
-
48
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
49
- _typeof = function (obj) {
50
- return typeof obj;
51
- };
52
- } else {
53
- _typeof = function (obj) {
54
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
55
- };
56
- }
57
- return _typeof(obj);
40
+ function _iterableToArray(r) {
41
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
42
+ }
43
+ function _nonIterableSpread() {
44
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
58
45
  }
59
- function _defineProperty(obj, key, value) {
60
- if (key in obj) {
61
- Object.defineProperty(obj, key, {
62
- value: value,
63
- enumerable: true,
64
- configurable: true,
65
- writable: true
46
+ function ownKeys(e, r) {
47
+ var t = Object.keys(e);
48
+ if (Object.getOwnPropertySymbols) {
49
+ var o = Object.getOwnPropertySymbols(e);
50
+ r && (o = o.filter(function (r) {
51
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
52
+ })), t.push.apply(t, o);
53
+ }
54
+ return t;
55
+ }
56
+ function _objectSpread2(e) {
57
+ for (var r = 1; r < arguments.length; r++) {
58
+ var t = null != arguments[r] ? arguments[r] : {};
59
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
60
+ _defineProperty(e, r, t[r]);
61
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
62
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
66
63
  });
67
- } else {
68
- obj[key] = value;
69
64
  }
70
- return obj;
65
+ return e;
71
66
  }
72
- function _extends() {
73
- _extends = Object.assign || function (target) {
74
- for (var i = 1; i < arguments.length; i++) {
75
- var source = arguments[i];
76
- for (var key in source) {
77
- if (Object.prototype.hasOwnProperty.call(source, key)) {
78
- target[key] = source[key];
79
- }
80
- }
81
- }
82
- return target;
83
- };
84
- return _extends.apply(this, arguments);
85
- }
86
- function _objectWithoutPropertiesLoose(source, excluded) {
87
- if (source == null) return {};
88
- var target = {};
89
- var sourceKeys = Object.keys(source);
90
- var key, i;
91
- for (i = 0; i < sourceKeys.length; i++) {
92
- key = sourceKeys[i];
93
- if (excluded.indexOf(key) >= 0) continue;
94
- target[key] = source[key];
95
- }
96
- return target;
97
- }
98
- function _objectWithoutProperties(source, excluded) {
99
- if (source == null) return {};
100
- var target = _objectWithoutPropertiesLoose(source, excluded);
101
- var key, i;
67
+ function _objectWithoutProperties(e, t) {
68
+ if (null == e) return {};
69
+ var o,
70
+ r,
71
+ i = _objectWithoutPropertiesLoose(e, t);
102
72
  if (Object.getOwnPropertySymbols) {
103
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
104
- for (i = 0; i < sourceSymbolKeys.length; i++) {
105
- key = sourceSymbolKeys[i];
106
- if (excluded.indexOf(key) >= 0) continue;
107
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
108
- target[key] = source[key];
109
- }
73
+ var n = Object.getOwnPropertySymbols(e);
74
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
110
75
  }
111
- return target;
76
+ return i;
112
77
  }
113
- function _toConsumableArray(arr) {
114
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
78
+ function _objectWithoutPropertiesLoose(r, e) {
79
+ if (null == r) return {};
80
+ var t = {};
81
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
82
+ if (-1 !== e.indexOf(n)) continue;
83
+ t[n] = r[n];
84
+ }
85
+ return t;
115
86
  }
116
- function _arrayWithoutHoles(arr) {
117
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
87
+ function _toConsumableArray(r) {
88
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
118
89
  }
119
- function _iterableToArray(iter) {
120
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
90
+ function _toPrimitive(t, r) {
91
+ if ("object" != typeof t || !t) return t;
92
+ var e = t[Symbol.toPrimitive];
93
+ if (void 0 !== e) {
94
+ var i = e.call(t, r || "default");
95
+ if ("object" != typeof i) return i;
96
+ throw new TypeError("@@toPrimitive must return a primitive value.");
97
+ }
98
+ return ("string" === r ? String : Number)(t);
121
99
  }
122
- function _unsupportedIterableToArray(o, minLen) {
123
- if (!o) return;
124
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
125
- var n = Object.prototype.toString.call(o).slice(8, -1);
126
- if (n === "Object" && o.constructor) n = o.constructor.name;
127
- if (n === "Map" || n === "Set") return Array.from(o);
128
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
100
+ function _toPropertyKey(t) {
101
+ var i = _toPrimitive(t, "string");
102
+ return "symbol" == typeof i ? i : i + "";
129
103
  }
130
- function _arrayLikeToArray(arr, len) {
131
- if (len == null || len > arr.length) len = arr.length;
132
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
133
- return arr2;
104
+ function _typeof(o) {
105
+ "@babel/helpers - typeof";
106
+
107
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
108
+ return typeof o;
109
+ } : function (o) {
110
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
111
+ }, _typeof(o);
134
112
  }
135
- function _nonIterableSpread() {
136
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
113
+ function _unsupportedIterableToArray(r, a) {
114
+ if (r) {
115
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
116
+ var t = {}.toString.call(r).slice(8, -1);
117
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
118
+ }
137
119
  }
138
120
 
139
- var version = "1.15.6";
121
+ var version = "1.15.7";
140
122
 
141
123
  function userAgent(pattern) {
142
124
  if (typeof window !== 'undefined' && window.navigator) {
@@ -179,7 +161,7 @@ function matches( /**HTMLElement*/el, /**String*/selector) {
179
161
  return false;
180
162
  }
181
163
  function getParentOrHost(el) {
182
- return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
164
+ return el.host && el !== document && el.host.nodeType && el.host !== el ? el.host : el.parentNode;
183
165
  }
184
166
  function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
185
167
  if (el) {
@@ -2063,8 +2045,11 @@ Sortable.prototype = /** @lends Sortable.prototype */{
2063
2045
  _nulling: function _nulling() {
2064
2046
  pluginEvent('nulling', this);
2065
2047
  rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
2066
- savedInputChecked.forEach(function (el) {
2067
- el.checked = true;
2048
+ var el = this.el;
2049
+ savedInputChecked.forEach(function (checkEl) {
2050
+ if (el.contains(checkEl)) {
2051
+ checkEl.checked = true;
2052
+ }
2068
2053
  });
2069
2054
  savedInputChecked.length = lastDx = lastDy = 0;
2070
2055
  },
@@ -15,6 +15,7 @@ import DOMPurify from 'dompurify';
15
15
  import { buildLocaleText } from './utils/buildLocaleText';
16
16
  import { agGridLicense } from '../../../../utils/ag-grid-license';
17
17
  import { resolveAggFunc } from './utils/AggFunctionResolver';
18
+ import { GRID_COLUMN_DEFAULT_WIDTHS } from './gridColumnDefaultWidths';
18
19
  export default class AgGridController {
19
20
  configFilterColumn(filterColumn) {
20
21
  this._filterColumn = filterColumn;
@@ -43,10 +44,10 @@ export default class AgGridController {
43
44
  this.COLUMN_FOOTER_OPER = 'gridFooterOper';
44
45
  this.RECORD_ARCHIVE_COL_ID = '__RECORD_ARCHIVE__';
45
46
  this.BLOCK_LOAD_DEBOUNCE = 100;
46
- this.DEFAULT_FONT_SIZE = 14;
47
+ this.DEFAULT_FONT_SIZE = 8;
47
48
  this.DEFAULT_FONT_SIZE_HTML5 = 32;
48
- this.DEFAULT_ICON_SIZE = 12;
49
- this.DEFAULT_MAX_SIZE = 200;
49
+ this.DEFAULT_ICON_SIZE = 40;
50
+ this.DEFAULT_MAX_SIZE = 300;
50
51
  this._menuItems = [];
51
52
  this._idAttribName = '__record__id__';
52
53
  this._gridConfig = [];
@@ -1032,9 +1033,11 @@ export default class AgGridController {
1032
1033
  tooltip = this._i18n('ez-grid.columnCantBeOrder');
1033
1034
  }
1034
1035
  const presentationFrom = (_d = source === null || source === void 0 ? void 0 : source.props) === null || _d === void 0 ? void 0 : _d.get(PRESENTATION_FROM_COL_PROP_NAME);
1036
+ const initialWidth = this.getInitialColumnWidth(source.userInterface, source.label);
1035
1037
  return this._editionManager.configureColumn({
1036
1038
  headerName: source.label,
1037
1039
  field: source.name,
1040
+ width: initialWidth,
1038
1041
  aggFunc: this.getAggFunc(source),
1039
1042
  sortable: propSortable,
1040
1043
  resizable: true,
@@ -1380,10 +1383,21 @@ export default class AgGridController {
1380
1383
  }
1381
1384
  const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
1382
1385
  const label = (_b = field === null || field === void 0 ? void 0 : field.label) !== null && _b !== void 0 ? _b : (_f = (_e = (_d = (_c = this._gridOptions) === null || _c === void 0 ? void 0 : _c.columnApi) === null || _d === void 0 ? void 0 : _d.getColumn(cfgColumn.name)) === null || _e === void 0 ? void 0 : _e.getColDef()) === null || _f === void 0 ? void 0 : _f.headerName;
1383
- if ((field === null || field === void 0 ? void 0 : field.userInterface) === UserInterface.SEARCH) {
1384
- return this.DEFAULT_MAX_SIZE;
1386
+ return this.getInitialColumnWidth(field === null || field === void 0 ? void 0 : field.userInterface, label);
1387
+ }
1388
+ getInitialColumnWidth(userInterface, label) {
1389
+ const columnWidthByLabel = this.getColumnWidthByLabel(label);
1390
+ const defaultWidth = this.getDefaultWidthByUserInterface(userInterface);
1391
+ if (!defaultWidth) {
1392
+ return columnWidthByLabel;
1393
+ }
1394
+ return Math.max(defaultWidth, columnWidthByLabel);
1395
+ }
1396
+ getDefaultWidthByUserInterface(userInterface) {
1397
+ if (!userInterface) {
1398
+ return undefined;
1385
1399
  }
1386
- return this.getColumnWidthByLabel(label);
1400
+ return GRID_COLUMN_DEFAULT_WIDTHS[userInterface];
1387
1401
  }
1388
1402
  getColumnWidthByLabel(label) {
1389
1403
  const labelSize = ((label === null || label === void 0 ? void 0 : label.length) || 0) * this.DEFAULT_FONT_SIZE + this.DEFAULT_ICON_SIZE;
@@ -0,0 +1,23 @@
1
+ import { UserInterface } from '@sankhyalabs/core';
2
+ /**
3
+ * Larguras padrão das colunas do grid por tipo de UserInterface
4
+ */
5
+ export const GRID_COLUMN_DEFAULT_WIDTHS = {
6
+ [UserInterface.SEARCH]: 200,
7
+ [UserInterface.SEARCHPLUS]: 100,
8
+ [UserInterface.DATE]: 120,
9
+ [UserInterface.DATETIME]: 160,
10
+ [UserInterface.TIME]: 100,
11
+ [UserInterface.ELAPSEDTIME]: 100,
12
+ [UserInterface.DECIMALNUMBER]: 130,
13
+ [UserInterface.INTEGERNUMBER]: 120,
14
+ [UserInterface.SWITCH]: 80,
15
+ [UserInterface.FILE]: 100,
16
+ [UserInterface.HTML]: 200,
17
+ [UserInterface.LONGTEXT]: 200,
18
+ [UserInterface.CHECKBOX]: 80,
19
+ [UserInterface.OPTIONSELECTOR]: 100,
20
+ [UserInterface.SHORTTEXT]: 200,
21
+ [UserInterface.PASSWORD]: 100,
22
+ [UserInterface.MASKEDTEXT]: 100,
23
+ };
@@ -1 +1,2 @@
1
1
  export * from './ColumnFilterManager';
2
+ export * from '../controller/ag-grid/gridColumnDefaultWidths';
@@ -89,7 +89,6 @@ export class EzPopup {
89
89
  }
90
90
  componentDidRender() {
91
91
  this.manageOverlay();
92
- this.popUpFocus();
93
92
  }
94
93
  handleAutoClose(event) {
95
94
  if (!this.opened || !this._popupRef || !this.autoClose) {