@sankhyalabs/sankhyablocks 10.1.0-dev.34 → 10.1.0-dev.36

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.
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-1894343a.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
- const sortable_esm = require('./sortable.esm-9a110bb7.js');
8
+ const sortable_esm = require('./sortable.esm-b87669ab.js');
9
9
  const constants = require('./constants-6d82e405.js');
10
10
  const FormConfigHelper = require('./FormConfigHelper-28fe4668.js');
11
11
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1894343a.js');
6
- const sortable_esm = require('./sortable.esm-9a110bb7.js');
6
+ const sortable_esm = require('./sortable.esm-b87669ab.js');
7
7
  const FormConfigHelper = require('./FormConfigHelper-28fe4668.js');
8
8
  const core = require('@sankhyalabs/core');
9
9
  require('./constants-6d82e405.js');
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-1894343a.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
- const sortable_esm = require('./sortable.esm-9a110bb7.js');
8
+ const sortable_esm = require('./sortable.esm-b87669ab.js');
9
9
  const constants = require('./constants-6d82e405.js');
10
10
 
11
- const guidesConfiguratorCss = ".ezSidebarNavigator.sc-guides-configurator{--ez-sidebar-navigator--height:calc(100vh - 118px)}.navigator-container.sc-guides-configurator{height:calc(100vh - 175px);display:flex;flex-direction:column;justify-content:space-between}.collapsible-container.sc-guides-configurator{display:flex;flex-direction:column;gap:12px;flex-grow:1;max-height:calc(100vh - 240px);overflow:auto}.collapsible-item.sc-guides-configurator{padding:6px;border-radius:6px;border:1px solid #dce0e8}.add-button-container.sc-guides-configurator{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;gap:6px;cursor:pointer;justify-content:center}.add-button-container.sc-guides-configurator span.sc-guides-configurator{display:block}.guide-list.sc-guides-configurator{display:flex;flex-direction:column;width:100%;min-height:10px}.guide-list.hidden-empty-content.sc-guides-configurator::before{content:var(--no-hidden-guides-message, \"Nenhuma guia oculta\");display:block;font-size:16px;font-weight:400;color:#AFB6C0;margin:auto;padding:8px}.guide-list.visible-empty-content.sc-guides-configurator::before{content:var(--no-visible-guides-message, \"Nenhuma guia visível\");display:block;font-size:16px;font-weight:400;color:#AFB6C0;margin:auto;padding:8px}.item-label.sc-guides-configurator{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-grow:1}.guide-item.sc-guides-configurator{margin:0 3px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:5px 10px;border-radius:6px;transition:all 0.2s ease-in-out;height:32px}.guide-item.sc-guides-configurator .actions.sc-guides-configurator{display:flex;gap:8px;transition:opacity 0.2s ease-in-out;display:none;opacity:0}.guide-item.sc-guides-configurator:hover .actions.sc-guides-configurator{display:flex;opacity:1}ez-button.sc-guides-configurator{width:24px;align-items:center;justify-content:center;display:flex}.ghost.sc-guides-configurator{opacity:.5;background:#e2eaf4}.main-guide.sc-guides-configurator{padding:12px;margin:12px 0;border:1px solid #dce0e8;border-radius:6px;transition:all 0.2s ease-in-out}.guide-item.selected.sc-guides-configurator,.main-guide.selected.sc-guides-configurator{background:#E2F4EF}.guide-item.sc-guides-configurator:hover,.main-guide.sc-guides-configurator:hover{background:#f5fcfa}";
11
+ const guidesConfiguratorCss = ".ezSidebarNavigator.sc-guides-configurator{--ez-sidebar-navigator--height:calc(100vh - 118px)}.navigator-container.sc-guides-configurator{height:calc(100vh - 175px);display:flex;flex-direction:column;justify-content:space-between}.collapsible-container.sc-guides-configurator{display:flex;flex-direction:column;gap:12px;flex-grow:1;max-height:calc(100vh - 240px);overflow:auto}.collapsible-item.sc-guides-configurator{padding:6px;border-radius:6px;border:1px solid #dce0e8}.add-button-container.sc-guides-configurator{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;gap:6px;cursor:pointer;justify-content:center}.add-button-container.sc-guides-configurator span.sc-guides-configurator{display:block}.guide-list.sc-guides-configurator{display:flex;flex-direction:column;width:100%;min-height:10px}.guide-list.hidden-empty-content.sc-guides-configurator::before{content:var(--no-hidden-guides-message, \"Nenhuma guia oculta\");display:block;font-size:16px;font-weight:400;color:#AFB6C0;margin:auto;padding:8px}.guide-list.visible-empty-content.sc-guides-configurator::before{content:var(--no-visible-guides-message, \"Nenhuma guia visível\");display:block;font-size:16px;font-weight:400;color:#AFB6C0;margin:auto;padding:8px}.item-label.sc-guides-configurator{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-grow:1}.guide-item.sc-guides-configurator{margin:0 3px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:5px 10px;border-radius:6px;transition:all 0.2s ease-in-out;height:32px}.guide-item.sc-guides-configurator .actions.sc-guides-configurator{gap:8px;transition:opacity 0.2s ease-in-out;display:none;opacity:0}.guide-item.sc-guides-configurator:hover .actions.sc-guides-configurator{display:flex;opacity:1}ez-button.sc-guides-configurator{width:24px;align-items:center;justify-content:center;display:flex}.ghost.sc-guides-configurator{opacity:.5;background:#e2eaf4}.main-guide.sc-guides-configurator{padding:12px;margin:12px 0;border:1px solid #dce0e8;border-radius:6px;transition:all 0.2s ease-in-out}.guide-item.selected.sc-guides-configurator,.main-guide.selected.sc-guides-configurator{background:#E2F4EF}.guide-item.sc-guides-configurator:hover,.main-guide.sc-guides-configurator:hover{background:#f5fcfa}";
12
12
 
13
13
  const GuidesConfigurator = class {
14
14
  constructor(hostRef) {
@@ -779,31 +779,49 @@ const SnkGridConfig = class {
779
779
  return newList;
780
780
  }
781
781
  createOrderList() {
782
+ var _a;
782
783
  let newSortableList = this.getSortableColumns();
783
- newSortableList.sort((a, b) => {
784
- //OS dois tem order index 0 e pelo menos um deles tem orientação de ordenação.
785
- if (a.orderIndex == 0 && b.orderIndex == 0 && (a.ascending != undefined || b.ascending != undefined)) {
786
- if (a.ascending != undefined)
787
- return -1;
788
- if (b.ascending != undefined)
789
- return 1;
790
- return 0;
791
- //Pelo menos um deles tem order index diferente de 0 e os dois tem orientação de ordenação.
792
- }
793
- else if (a.ascending != undefined && b.ascending != undefined) {
784
+ if (((_a = this._orderPriorityList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
785
+ const orderedList = [];
786
+ this._orderPriorityList.forEach((priorityItem) => {
787
+ const item = newSortableList.find(col => col.label === priorityItem.label);
788
+ if (item) {
789
+ orderedList.push(item);
790
+ }
791
+ });
792
+ newSortableList.forEach(item => {
793
+ if (!orderedList.find(o => o.label === item.label)) {
794
+ orderedList.push(item);
795
+ }
796
+ });
797
+ this._orderListItems = orderedList;
798
+ }
799
+ else {
800
+ newSortableList.sort((a, b) => {
801
+ //OS dois tem order index 0 e pelo menos um deles tem orientação de ordenação.
802
+ if (a.orderIndex == 0 && b.orderIndex == 0 && (a.ascending != undefined || b.ascending != undefined)) {
803
+ if (a.ascending != undefined)
804
+ return -1;
805
+ if (b.ascending != undefined)
806
+ return 1;
807
+ return 0;
808
+ //Pelo menos um deles tem order index diferente de 0 e os dois tem orientação de ordenação.
809
+ }
810
+ else if (a.ascending != undefined && b.ascending != undefined) {
811
+ return (a.orderIndex - b.orderIndex);
812
+ //Pelo menos um deles tem order index diferente de 0 e pelo menos um deles tem orientação de ordenação.
813
+ }
814
+ else if (a.ascending != undefined || b.ascending != undefined) {
815
+ if (a.ascending != undefined)
816
+ return -1;
817
+ if (b.ascending != undefined)
818
+ return 1;
819
+ return 0;
820
+ }
794
821
  return (a.orderIndex - b.orderIndex);
795
- //Pelo menos um deles tem order index diferente de 0 e pelo menos um deles tem orientação de ordenação.
796
- }
797
- else if (a.ascending != undefined || b.ascending != undefined) {
798
- if (a.ascending != undefined)
799
- return -1;
800
- if (b.ascending != undefined)
801
- return 1;
802
- return 0;
803
- }
804
- return (a.orderIndex - b.orderIndex);
805
- });
806
- this._orderListItems = newSortableList;
822
+ });
823
+ this._orderListItems = newSortableList;
824
+ }
807
825
  }
808
826
  createColumnList() {
809
827
  const visibleGroup = this.buildVisibleGroup();
@@ -859,8 +877,11 @@ const SnkGridConfig = class {
859
877
  }
860
878
  let orderArray;
861
879
  if (((_a = this._orderPriorityList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
862
- this._orderPriorityList.find((item) => item.label === newItem.label).sort = sortOrder;
863
- this._orderPriorityList.filter((item) => item.sort).forEach((item, index) => {
880
+ const priorityItem = this._orderPriorityList.find((item) => item.label === newItem.label);
881
+ if (priorityItem) {
882
+ priorityItem.sort = sortOrder.value === constants.ORDER_VALUES.none.value ? undefined : sortOrder.value;
883
+ }
884
+ this._orderPriorityList.filter((item) => item.sort != undefined).forEach((item, index) => {
864
885
  if (item.label === newItem.label) {
865
886
  newItem.sortIndex = index;
866
887
  }
@@ -886,6 +907,7 @@ const SnkGridConfig = class {
886
907
  this._dataChanged = false;
887
908
  this.closeConfig();
888
909
  this.save();
910
+ this._orderPriorityList = [];
889
911
  }
890
912
  updateColumns() {
891
913
  this.columns = this._columListItems.flatMap((group) => group.items.map((item) => this.buildColumnFromListItem(item, group)));
@@ -943,11 +965,8 @@ const SnkGridConfig = class {
943
965
  let _newColumnConfig = _newConfig.columns.find((_newColumnConfig) => column.name === _newColumnConfig.name);
944
966
  if (column.hidden === true && _newColumnConfig)
945
967
  return;
946
- if (_newColumnConfig) {
947
- _newColumnConfig.width = column.width;
948
- }
949
- else if (column.hidden === false) {
950
- _newColumnConfig = { name: column.name, width: column.width, orderIndex: 0 };
968
+ if (!_newColumnConfig && column.hidden === false) {
969
+ _newColumnConfig = { name: column.name, orderIndex: 0 };
951
970
  }
952
971
  if (_newColumnConfig) {
953
972
  if (column.sort) {
@@ -1012,6 +1031,7 @@ const SnkGridConfig = class {
1012
1031
  .then((response) => {
1013
1032
  if (!response) {
1014
1033
  this._dataChanged = false;
1034
+ this._orderPriorityList = [];
1015
1035
  this.configCancel.emit();
1016
1036
  this._componenteInternalKey = Date.now();
1017
1037
  }
@@ -1076,6 +1096,7 @@ const SnkGridConfig = class {
1076
1096
  if (!this.resourceID)
1077
1097
  return;
1078
1098
  this._dataChanged = true;
1099
+ this._orderPriorityList = [];
1079
1100
  const config = await ConfigStorage.ConfigStorage.getDefaultGridConfig(this.resourceID);
1080
1101
  const defaultVisibleCols = (_a = config === null || config === void 0 ? void 0 : config.columns.map(col => col.name)) !== null && _a !== void 0 ? _a : [];
1081
1102
  const isEmptyConfig = defaultVisibleCols.length === 0;
@@ -1121,7 +1142,7 @@ const SnkGridConfig = class {
1121
1142
  return (index.h(index.Host, null, index.h("div", { class: "grid-config__header" }, index.h("div", { class: "title-container" }, index.h("div", { class: "ez-margin-bottom--medium" }, index.h("label", { class: "title" }, this.getMessage('snkGridConfig.gridConfiguration')), index.h("label", { class: "subtitle" }, this.getMessage('snkGridConfig.columnVisibilityOrder'))), index.h("div", { class: "button-close" }, index.h("ez-button", { mode: "icon", iconName: "close", size: "medium", class: "ez-button--tertiary", onClick: () => this.closeConfig() })))), index.h("div", { class: 'grid-config__body' }, index.h("ez-collapsible-box", { id: 'group-select-columns', label: this.getMessage('snkGridConfig.columnsSelection'), "header-size": "medium", key: 'key_group-select-columns', value: this._collapsibleBoxListSelect, onEzChange: ({ detail }) => this._collapsibleBoxListOrder = !detail }, index.h("div", { class: "grid-config__main" }, index.h("ez-double-list", { leftList: this._hiddenList, leftTitle: this.getMessage('snkGridConfig.availableColumns'), rightList: this._visibleList, rightTitle: this.getMessage('snkGridConfig.selectedColumns'), onEzRightListChanged: ({ detail }) => this.handleRightListChange(detail), emptyMessage: {
1122
1143
  LEFT_LIST: this.getMessage('snkGridConfig.emptyMensage.left'),
1123
1144
  RIGHT_LIST: this.getMessage('snkGridConfig.emptyMensage.right'),
1124
- }, entityLabel: 'coluna', entityLabelPlural: 'colunas' }))), index.h("ez-collapsible-box", { id: 'ID_group-order-columns', label: this.getMessage('snkGridConfig.dataOrdering'), "header-size": "medium", key: 'KEY_group-order-columns', value: this._collapsibleBoxListOrder, onEzChange: ({ detail }) => this._collapsibleBoxListSelect = !detail }, index.h("div", { class: "grid-config__main" }, index.h("ez-double-list", { rightList: this._orderListItems, rightTitle: this.getMessage('snkGridConfig.selectedColumns'), useOnlyRightList: true, slotsListBuilder: this.getListSlots(), emptyMessage: {
1145
+ }, entityLabel: 'coluna', entityLabelPlural: 'colunas' }))), index.h("ez-collapsible-box", { id: 'ID_group-order-columns', label: this.getMessage('snkGridConfig.dataOrdering'), "header-size": "medium", key: 'KEY_group-order-columns', value: this._collapsibleBoxListOrder, onEzChange: ({ detail }) => this._collapsibleBoxListSelect = !detail }, index.h("div", { class: "grid-config__main" }, index.h("ez-double-list", { rightList: this._orderListItems, rightTitle: this.getMessage('snkGridConfig.selectedColumns'), useOnlyRightList: true, slotsListBuilder: this.getListSlots(), onEzRightListChanged: (evt) => this.handleOrderListChange(evt), emptyMessage: {
1125
1146
  RIGHT_LIST: this.getMessage('snkGridConfig.emptyMensage.right'),
1126
1147
  }, entityLabel: 'coluna', entityLabelPlural: 'colunas' })))), index.h("div", { class: "grid-config__footer" }, this.renderResetConfigBtn(), index.h("ez-button", { class: "padding-right--medium", label: this.getMessage('snkGridConfig.cancel'), onClick: () => this.closeConfig() }), index.h("ez-button", { label: this.getMessage('snkGridConfig.complete'), class: "ez-button--primary", onClick: () => this.finish() }))));
1127
1148
  }
@@ -1,111 +1,94 @@
1
1
  'use strict';
2
2
 
3
3
  /**!
4
- * Sortable 1.15.6
4
+ * Sortable 1.15.7
5
5
  * @author RubaXa <trash@rubaxa.org>
6
6
  * @author owenm <owen23355@gmail.com>
7
7
  * @license MIT
8
8
  */
9
- function ownKeys(object, enumerableOnly) {
10
- var keys = Object.keys(object);
11
- if (Object.getOwnPropertySymbols) {
12
- var symbols = Object.getOwnPropertySymbols(object);
13
- if (enumerableOnly) {
14
- symbols = symbols.filter(function (sym) {
15
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
16
- });
17
- }
18
- keys.push.apply(keys, symbols);
19
- }
20
- return keys;
9
+ function _defineProperty(e, r, t) {
10
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
11
+ value: t,
12
+ enumerable: !0,
13
+ configurable: !0,
14
+ writable: !0
15
+ }) : e[r] = t, e;
21
16
  }
22
- function _objectSpread2(target) {
23
- for (var i = 1; i < arguments.length; i++) {
24
- var source = arguments[i] != null ? arguments[i] : {};
25
- if (i % 2) {
26
- ownKeys(Object(source), true).forEach(function (key) {
27
- _defineProperty(target, key, source[key]);
28
- });
29
- } else if (Object.getOwnPropertyDescriptors) {
30
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
31
- } else {
32
- ownKeys(Object(source)).forEach(function (key) {
33
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
34
- });
17
+ function _extends() {
18
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
19
+ for (var e = 1; e < arguments.length; e++) {
20
+ var t = arguments[e];
21
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
35
22
  }
36
- }
37
- return target;
23
+ return n;
24
+ }, _extends.apply(null, arguments);
38
25
  }
39
- function _typeof(obj) {
40
- "@babel/helpers - typeof";
41
-
42
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
43
- _typeof = function (obj) {
44
- return typeof obj;
45
- };
46
- } else {
47
- _typeof = function (obj) {
48
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
49
- };
26
+ function ownKeys(e, r) {
27
+ var t = Object.keys(e);
28
+ if (Object.getOwnPropertySymbols) {
29
+ var o = Object.getOwnPropertySymbols(e);
30
+ r && (o = o.filter(function (r) {
31
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
32
+ })), t.push.apply(t, o);
50
33
  }
51
- return _typeof(obj);
34
+ return t;
52
35
  }
53
- function _defineProperty(obj, key, value) {
54
- if (key in obj) {
55
- Object.defineProperty(obj, key, {
56
- value: value,
57
- enumerable: true,
58
- configurable: true,
59
- writable: true
36
+ function _objectSpread2(e) {
37
+ for (var r = 1; r < arguments.length; r++) {
38
+ var t = null != arguments[r] ? arguments[r] : {};
39
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
40
+ _defineProperty(e, r, t[r]);
41
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
42
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
60
43
  });
61
- } else {
62
- obj[key] = value;
63
44
  }
64
- return obj;
45
+ return e;
65
46
  }
66
- function _extends() {
67
- _extends = Object.assign || function (target) {
68
- for (var i = 1; i < arguments.length; i++) {
69
- var source = arguments[i];
70
- for (var key in source) {
71
- if (Object.prototype.hasOwnProperty.call(source, key)) {
72
- target[key] = source[key];
73
- }
74
- }
75
- }
76
- return target;
77
- };
78
- return _extends.apply(this, arguments);
47
+ function _objectWithoutProperties(e, t) {
48
+ if (null == e) return {};
49
+ var o,
50
+ r,
51
+ i = _objectWithoutPropertiesLoose(e, t);
52
+ if (Object.getOwnPropertySymbols) {
53
+ var n = Object.getOwnPropertySymbols(e);
54
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
55
+ }
56
+ return i;
79
57
  }
80
- function _objectWithoutPropertiesLoose(source, excluded) {
81
- if (source == null) return {};
82
- var target = {};
83
- var sourceKeys = Object.keys(source);
84
- var key, i;
85
- for (i = 0; i < sourceKeys.length; i++) {
86
- key = sourceKeys[i];
87
- if (excluded.indexOf(key) >= 0) continue;
88
- target[key] = source[key];
58
+ function _objectWithoutPropertiesLoose(r, e) {
59
+ if (null == r) return {};
60
+ var t = {};
61
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
62
+ if (-1 !== e.indexOf(n)) continue;
63
+ t[n] = r[n];
89
64
  }
90
- return target;
65
+ return t;
91
66
  }
92
- function _objectWithoutProperties(source, excluded) {
93
- if (source == null) return {};
94
- var target = _objectWithoutPropertiesLoose(source, excluded);
95
- var key, i;
96
- if (Object.getOwnPropertySymbols) {
97
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
98
- for (i = 0; i < sourceSymbolKeys.length; i++) {
99
- key = sourceSymbolKeys[i];
100
- if (excluded.indexOf(key) >= 0) continue;
101
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
102
- target[key] = source[key];
103
- }
67
+ function _toPrimitive(t, r) {
68
+ if ("object" != typeof t || !t) return t;
69
+ var e = t[Symbol.toPrimitive];
70
+ if (void 0 !== e) {
71
+ var i = e.call(t, r || "default");
72
+ if ("object" != typeof i) return i;
73
+ throw new TypeError("@@toPrimitive must return a primitive value.");
104
74
  }
105
- return target;
75
+ return ("string" === r ? String : Number)(t);
76
+ }
77
+ function _toPropertyKey(t) {
78
+ var i = _toPrimitive(t, "string");
79
+ return "symbol" == typeof i ? i : i + "";
106
80
  }
81
+ function _typeof(o) {
82
+ "@babel/helpers - typeof";
107
83
 
108
- var version = "1.15.6";
84
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
85
+ return typeof o;
86
+ } : function (o) {
87
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
88
+ }, _typeof(o);
89
+ }
90
+
91
+ var version = "1.15.7";
109
92
 
110
93
  function userAgent(pattern) {
111
94
  if (typeof window !== 'undefined' && window.navigator) {
@@ -148,7 +131,7 @@ function matches( /**HTMLElement*/el, /**String*/selector) {
148
131
  return false;
149
132
  }
150
133
  function getParentOrHost(el) {
151
- return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
134
+ return el.host && el !== document && el.host.nodeType && el.host !== el ? el.host : el.parentNode;
152
135
  }
153
136
  function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
154
137
  if (el) {
@@ -2018,8 +2001,11 @@ Sortable.prototype = /** @lends Sortable.prototype */{
2018
2001
  _nulling: function _nulling() {
2019
2002
  pluginEvent('nulling', this);
2020
2003
  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;
2021
- savedInputChecked.forEach(function (el) {
2022
- el.checked = true;
2004
+ var el = this.el;
2005
+ savedInputChecked.forEach(function (checkEl) {
2006
+ if (el.contains(checkEl)) {
2007
+ checkEl.checked = true;
2008
+ }
2023
2009
  });
2024
2010
  savedInputChecked.length = lastDx = lastDy = 0;
2025
2011
  },
@@ -89,7 +89,6 @@
89
89
 
90
90
 
91
91
  .guide-item .actions {
92
- display: flex;
93
92
  gap: 8px;
94
93
  transition: opacity 0.2s ease-in-out;
95
94
  display: none;
@@ -49,31 +49,49 @@ export class SnkGridConfig {
49
49
  return newList;
50
50
  }
51
51
  createOrderList() {
52
+ var _a;
52
53
  let newSortableList = this.getSortableColumns();
53
- newSortableList.sort((a, b) => {
54
- //OS dois tem order index 0 e pelo menos um deles tem orientação de ordenação.
55
- if (a.orderIndex == 0 && b.orderIndex == 0 && (a.ascending != undefined || b.ascending != undefined)) {
56
- if (a.ascending != undefined)
57
- return -1;
58
- if (b.ascending != undefined)
59
- return 1;
60
- return 0;
61
- //Pelo menos um deles tem order index diferente de 0 e os dois tem orientação de ordenação.
62
- }
63
- else if (a.ascending != undefined && b.ascending != undefined) {
54
+ if (((_a = this._orderPriorityList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
55
+ const orderedList = [];
56
+ this._orderPriorityList.forEach((priorityItem) => {
57
+ const item = newSortableList.find(col => col.label === priorityItem.label);
58
+ if (item) {
59
+ orderedList.push(item);
60
+ }
61
+ });
62
+ newSortableList.forEach(item => {
63
+ if (!orderedList.find(o => o.label === item.label)) {
64
+ orderedList.push(item);
65
+ }
66
+ });
67
+ this._orderListItems = orderedList;
68
+ }
69
+ else {
70
+ newSortableList.sort((a, b) => {
71
+ //OS dois tem order index 0 e pelo menos um deles tem orientação de ordenação.
72
+ if (a.orderIndex == 0 && b.orderIndex == 0 && (a.ascending != undefined || b.ascending != undefined)) {
73
+ if (a.ascending != undefined)
74
+ return -1;
75
+ if (b.ascending != undefined)
76
+ return 1;
77
+ return 0;
78
+ //Pelo menos um deles tem order index diferente de 0 e os dois tem orientação de ordenação.
79
+ }
80
+ else if (a.ascending != undefined && b.ascending != undefined) {
81
+ return (a.orderIndex - b.orderIndex);
82
+ //Pelo menos um deles tem order index diferente de 0 e pelo menos um deles tem orientação de ordenação.
83
+ }
84
+ else if (a.ascending != undefined || b.ascending != undefined) {
85
+ if (a.ascending != undefined)
86
+ return -1;
87
+ if (b.ascending != undefined)
88
+ return 1;
89
+ return 0;
90
+ }
64
91
  return (a.orderIndex - b.orderIndex);
65
- //Pelo menos um deles tem order index diferente de 0 e pelo menos um deles tem orientação de ordenação.
66
- }
67
- else if (a.ascending != undefined || b.ascending != undefined) {
68
- if (a.ascending != undefined)
69
- return -1;
70
- if (b.ascending != undefined)
71
- return 1;
72
- return 0;
73
- }
74
- return (a.orderIndex - b.orderIndex);
75
- });
76
- this._orderListItems = newSortableList;
92
+ });
93
+ this._orderListItems = newSortableList;
94
+ }
77
95
  }
78
96
  createColumnList() {
79
97
  const visibleGroup = this.buildVisibleGroup();
@@ -129,8 +147,11 @@ export class SnkGridConfig {
129
147
  }
130
148
  let orderArray;
131
149
  if (((_a = this._orderPriorityList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
132
- this._orderPriorityList.find((item) => item.label === newItem.label).sort = sortOrder;
133
- this._orderPriorityList.filter((item) => item.sort).forEach((item, index) => {
150
+ const priorityItem = this._orderPriorityList.find((item) => item.label === newItem.label);
151
+ if (priorityItem) {
152
+ priorityItem.sort = sortOrder.value === ORDER_VALUES.none.value ? undefined : sortOrder.value;
153
+ }
154
+ this._orderPriorityList.filter((item) => item.sort != undefined).forEach((item, index) => {
134
155
  if (item.label === newItem.label) {
135
156
  newItem.sortIndex = index;
136
157
  }
@@ -156,6 +177,7 @@ export class SnkGridConfig {
156
177
  this._dataChanged = false;
157
178
  this.closeConfig();
158
179
  this.save();
180
+ this._orderPriorityList = [];
159
181
  }
160
182
  updateColumns() {
161
183
  this.columns = this._columListItems.flatMap((group) => group.items.map((item) => this.buildColumnFromListItem(item, group)));
@@ -213,11 +235,8 @@ export class SnkGridConfig {
213
235
  let _newColumnConfig = _newConfig.columns.find((_newColumnConfig) => column.name === _newColumnConfig.name);
214
236
  if (column.hidden === true && _newColumnConfig)
215
237
  return;
216
- if (_newColumnConfig) {
217
- _newColumnConfig.width = column.width;
218
- }
219
- else if (column.hidden === false) {
220
- _newColumnConfig = { name: column.name, width: column.width, orderIndex: 0 };
238
+ if (!_newColumnConfig && column.hidden === false) {
239
+ _newColumnConfig = { name: column.name, orderIndex: 0 };
221
240
  }
222
241
  if (_newColumnConfig) {
223
242
  if (column.sort) {
@@ -282,6 +301,7 @@ export class SnkGridConfig {
282
301
  .then((response) => {
283
302
  if (!response) {
284
303
  this._dataChanged = false;
304
+ this._orderPriorityList = [];
285
305
  this.configCancel.emit();
286
306
  this._componenteInternalKey = Date.now();
287
307
  }
@@ -346,6 +366,7 @@ export class SnkGridConfig {
346
366
  if (!this.resourceID)
347
367
  return;
348
368
  this._dataChanged = true;
369
+ this._orderPriorityList = [];
349
370
  const config = await ConfigStorage.getDefaultGridConfig(this.resourceID);
350
371
  const defaultVisibleCols = (_a = config === null || config === void 0 ? void 0 : config.columns.map(col => col.name)) !== null && _a !== void 0 ? _a : [];
351
372
  const isEmptyConfig = defaultVisibleCols.length === 0;
@@ -391,7 +412,7 @@ export class SnkGridConfig {
391
412
  return (h(Host, null, h("div", { class: "grid-config__header" }, h("div", { class: "title-container" }, h("div", { class: "ez-margin-bottom--medium" }, h("label", { class: "title" }, this.getMessage('snkGridConfig.gridConfiguration')), h("label", { class: "subtitle" }, this.getMessage('snkGridConfig.columnVisibilityOrder'))), h("div", { class: "button-close" }, h("ez-button", { mode: "icon", iconName: "close", size: "medium", class: "ez-button--tertiary", onClick: () => this.closeConfig() })))), h("div", { class: 'grid-config__body' }, h("ez-collapsible-box", { id: 'group-select-columns', label: this.getMessage('snkGridConfig.columnsSelection'), "header-size": "medium", key: 'key_group-select-columns', value: this._collapsibleBoxListSelect, onEzChange: ({ detail }) => this._collapsibleBoxListOrder = !detail }, h("div", { class: "grid-config__main" }, h("ez-double-list", { leftList: this._hiddenList, leftTitle: this.getMessage('snkGridConfig.availableColumns'), rightList: this._visibleList, rightTitle: this.getMessage('snkGridConfig.selectedColumns'), onEzRightListChanged: ({ detail }) => this.handleRightListChange(detail), emptyMessage: {
392
413
  LEFT_LIST: this.getMessage('snkGridConfig.emptyMensage.left'),
393
414
  RIGHT_LIST: this.getMessage('snkGridConfig.emptyMensage.right'),
394
- }, entityLabel: 'coluna', entityLabelPlural: 'colunas' }))), h("ez-collapsible-box", { id: 'ID_group-order-columns', label: this.getMessage('snkGridConfig.dataOrdering'), "header-size": "medium", key: 'KEY_group-order-columns', value: this._collapsibleBoxListOrder, onEzChange: ({ detail }) => this._collapsibleBoxListSelect = !detail }, h("div", { class: "grid-config__main" }, h("ez-double-list", { rightList: this._orderListItems, rightTitle: this.getMessage('snkGridConfig.selectedColumns'), useOnlyRightList: true, slotsListBuilder: this.getListSlots(), emptyMessage: {
415
+ }, entityLabel: 'coluna', entityLabelPlural: 'colunas' }))), h("ez-collapsible-box", { id: 'ID_group-order-columns', label: this.getMessage('snkGridConfig.dataOrdering'), "header-size": "medium", key: 'KEY_group-order-columns', value: this._collapsibleBoxListOrder, onEzChange: ({ detail }) => this._collapsibleBoxListSelect = !detail }, h("div", { class: "grid-config__main" }, h("ez-double-list", { rightList: this._orderListItems, rightTitle: this.getMessage('snkGridConfig.selectedColumns'), useOnlyRightList: true, slotsListBuilder: this.getListSlots(), onEzRightListChanged: (evt) => this.handleOrderListChange(evt), emptyMessage: {
395
416
  RIGHT_LIST: this.getMessage('snkGridConfig.emptyMensage.right'),
396
417
  }, entityLabel: 'coluna', entityLabelPlural: 'colunas' })))), h("div", { class: "grid-config__footer" }, this.renderResetConfigBtn(), h("ez-button", { class: "padding-right--medium", label: this.getMessage('snkGridConfig.cancel'), onClick: () => this.closeConfig() }), h("ez-button", { label: this.getMessage('snkGridConfig.complete'), class: "ez-button--primary", onClick: () => this.finish() }))));
397
418
  }
@@ -4,7 +4,7 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { S as Sortable } from './sortable.esm.js';
5
5
  import { T as TAB_NAMES } from './constants.js';
6
6
 
7
- const guidesConfiguratorCss = ".ezSidebarNavigator.sc-guides-configurator{--ez-sidebar-navigator--height:calc(100vh - 118px)}.navigator-container.sc-guides-configurator{height:calc(100vh - 175px);display:flex;flex-direction:column;justify-content:space-between}.collapsible-container.sc-guides-configurator{display:flex;flex-direction:column;gap:12px;flex-grow:1;max-height:calc(100vh - 240px);overflow:auto}.collapsible-item.sc-guides-configurator{padding:6px;border-radius:6px;border:1px solid #dce0e8}.add-button-container.sc-guides-configurator{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;gap:6px;cursor:pointer;justify-content:center}.add-button-container.sc-guides-configurator span.sc-guides-configurator{display:block}.guide-list.sc-guides-configurator{display:flex;flex-direction:column;width:100%;min-height:10px}.guide-list.hidden-empty-content.sc-guides-configurator::before{content:var(--no-hidden-guides-message, \"Nenhuma guia oculta\");display:block;font-size:16px;font-weight:400;color:#AFB6C0;margin:auto;padding:8px}.guide-list.visible-empty-content.sc-guides-configurator::before{content:var(--no-visible-guides-message, \"Nenhuma guia visível\");display:block;font-size:16px;font-weight:400;color:#AFB6C0;margin:auto;padding:8px}.item-label.sc-guides-configurator{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-grow:1}.guide-item.sc-guides-configurator{margin:0 3px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:5px 10px;border-radius:6px;transition:all 0.2s ease-in-out;height:32px}.guide-item.sc-guides-configurator .actions.sc-guides-configurator{display:flex;gap:8px;transition:opacity 0.2s ease-in-out;display:none;opacity:0}.guide-item.sc-guides-configurator:hover .actions.sc-guides-configurator{display:flex;opacity:1}ez-button.sc-guides-configurator{width:24px;align-items:center;justify-content:center;display:flex}.ghost.sc-guides-configurator{opacity:.5;background:#e2eaf4}.main-guide.sc-guides-configurator{padding:12px;margin:12px 0;border:1px solid #dce0e8;border-radius:6px;transition:all 0.2s ease-in-out}.guide-item.selected.sc-guides-configurator,.main-guide.selected.sc-guides-configurator{background:#E2F4EF}.guide-item.sc-guides-configurator:hover,.main-guide.sc-guides-configurator:hover{background:#f5fcfa}";
7
+ const guidesConfiguratorCss = ".ezSidebarNavigator.sc-guides-configurator{--ez-sidebar-navigator--height:calc(100vh - 118px)}.navigator-container.sc-guides-configurator{height:calc(100vh - 175px);display:flex;flex-direction:column;justify-content:space-between}.collapsible-container.sc-guides-configurator{display:flex;flex-direction:column;gap:12px;flex-grow:1;max-height:calc(100vh - 240px);overflow:auto}.collapsible-item.sc-guides-configurator{padding:6px;border-radius:6px;border:1px solid #dce0e8}.add-button-container.sc-guides-configurator{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;gap:6px;cursor:pointer;justify-content:center}.add-button-container.sc-guides-configurator span.sc-guides-configurator{display:block}.guide-list.sc-guides-configurator{display:flex;flex-direction:column;width:100%;min-height:10px}.guide-list.hidden-empty-content.sc-guides-configurator::before{content:var(--no-hidden-guides-message, \"Nenhuma guia oculta\");display:block;font-size:16px;font-weight:400;color:#AFB6C0;margin:auto;padding:8px}.guide-list.visible-empty-content.sc-guides-configurator::before{content:var(--no-visible-guides-message, \"Nenhuma guia visível\");display:block;font-size:16px;font-weight:400;color:#AFB6C0;margin:auto;padding:8px}.item-label.sc-guides-configurator{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-grow:1}.guide-item.sc-guides-configurator{margin:0 3px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:5px 10px;border-radius:6px;transition:all 0.2s ease-in-out;height:32px}.guide-item.sc-guides-configurator .actions.sc-guides-configurator{gap:8px;transition:opacity 0.2s ease-in-out;display:none;opacity:0}.guide-item.sc-guides-configurator:hover .actions.sc-guides-configurator{display:flex;opacity:1}ez-button.sc-guides-configurator{width:24px;align-items:center;justify-content:center;display:flex}.ghost.sc-guides-configurator{opacity:.5;background:#e2eaf4}.main-guide.sc-guides-configurator{padding:12px;margin:12px 0;border:1px solid #dce0e8;border-radius:6px;transition:all 0.2s ease-in-out}.guide-item.selected.sc-guides-configurator,.main-guide.selected.sc-guides-configurator{background:#E2F4EF}.guide-item.sc-guides-configurator:hover,.main-guide.sc-guides-configurator:hover{background:#f5fcfa}";
8
8
 
9
9
  const GuidesConfigurator = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
10
10
  constructor() {