@sankhyalabs/sankhyablocks 10.1.0-dev.13 → 10.1.0-dev.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/dist/cjs/{ConfigStorage-5c0590b3.js → ConfigStorage-a4e1e518.js} +2 -2
  2. package/dist/cjs/{DataFetcher-5181a917.js → DataFetcher-0b6aa084.js} +11 -22
  3. package/dist/cjs/{ISave-0f98a457.js → ISave-2c455a77.js} +1 -1
  4. package/dist/cjs/{SnkFormConfigManager-1907ffed.js → SnkFormConfigManager-b8c81493.js} +2 -2
  5. package/dist/cjs/{SnkMultiSelectionListDataSource-e4e38139.js → SnkMultiSelectionListDataSource-72925620.js} +5 -5
  6. package/dist/cjs/{auth-fetcher-cff55b1f.js → auth-fetcher-7e7796c9.js} +1 -1
  7. package/dist/cjs/config-header.cjs.entry.js +1 -1
  8. package/dist/cjs/configs-button.cjs.entry.js +1 -1
  9. package/dist/cjs/{dataunit-fetcher-1ba5e2cc.js → dataunit-fetcher-8dffbcdf.js} +1 -1
  10. package/dist/cjs/field-config_2.cjs.entry.js +1 -1
  11. package/dist/cjs/fields-layout.cjs.entry.js +1 -1
  12. package/dist/cjs/fields-selector.cjs.entry.js +1 -1
  13. package/dist/cjs/{form-config-fetcher-4a679e23.js → form-config-fetcher-5516d68a.js} +1 -1
  14. package/dist/cjs/guides-configurator.cjs.entry.js +1 -1
  15. package/dist/cjs/{index-13d05f03.js → index-516250fa.js} +1 -1
  16. package/dist/cjs/{index-1cf293c1.js → index-dc83c596.js} +0 -17
  17. package/dist/cjs/loader.cjs.js +1 -1
  18. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +5 -5
  19. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  20. package/dist/cjs/snk-actions-button_9.cjs.entry.js +6 -6
  21. package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
  22. package/dist/cjs/snk-application.cjs.entry.js +7 -7
  23. package/dist/cjs/snk-attach.cjs.entry.js +8 -8
  24. package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
  26. package/dist/cjs/snk-crud.cjs.entry.js +8 -8
  27. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +1 -1
  28. package/dist/cjs/snk-custom-slot-guide.cjs.entry.js +1 -1
  29. package/dist/cjs/snk-data-exporter.cjs.entry.js +6 -6
  30. package/dist/cjs/{snk-data-unit-061487a8.js → snk-data-unit-47f02b9e.js} +3 -3
  31. package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
  32. package/dist/cjs/snk-default-filter.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-detail-view.cjs.entry.js +10 -10
  34. package/dist/cjs/snk-entity-list.cjs.entry.js +1 -1
  35. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  36. package/dist/cjs/snk-expression-group_2.cjs.entry.js +2 -2
  37. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js +1 -1
  38. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +4 -4
  39. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  40. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
  41. package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
  42. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +1 -1
  43. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +4 -4
  44. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  45. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  46. package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
  47. package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
  48. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  49. package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
  50. package/dist/cjs/snk-form-view.cjs.entry.js +1 -1
  51. package/dist/cjs/snk-form_2.cjs.entry.js +5 -5
  52. package/dist/cjs/snk-grid.cjs.entry.js +20 -14
  53. package/dist/cjs/{snk-guides-viewer-2efe60a7.js → snk-guides-viewer-41c22d96.js} +7 -7
  54. package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -10
  55. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +1 -1
  56. package/dist/cjs/snk-personalized-filter.cjs.entry.js +5 -5
  57. package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
  58. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  59. package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
  60. package/dist/cjs/snk-simple-crud.cjs.entry.js +10 -10
  61. package/dist/cjs/snk-taskbar.cjs.entry.js +3 -3
  62. package/dist/cjs/{taskbar-elements-fb5d1e08.js → taskbar-elements-756fcbe7.js} +2 -2
  63. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  64. package/dist/collection/components/snk-grid/snk-grid.js +12 -7
  65. package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
  66. package/dist/components/DataFetcher.js +11 -2
  67. package/dist/components/snk-grid2.js +12 -6
  68. package/dist/esm/{ConfigStorage-bd096633.js → ConfigStorage-39ac8fef.js} +2 -2
  69. package/dist/esm/{DataFetcher-5780ad39.js → DataFetcher-0b9da57d.js} +11 -2
  70. package/dist/esm/{ISave-8a22ec18.js → ISave-f1c9269b.js} +1 -1
  71. package/dist/esm/{SnkFormConfigManager-437e98bb.js → SnkFormConfigManager-a87566c8.js} +2 -2
  72. package/dist/esm/{SnkMultiSelectionListDataSource-42125ef4.js → SnkMultiSelectionListDataSource-493ae8c8.js} +5 -5
  73. package/dist/esm/{auth-fetcher-28b9d0db.js → auth-fetcher-acdc1cb4.js} +1 -1
  74. package/dist/esm/config-header.entry.js +1 -1
  75. package/dist/esm/configs-button.entry.js +1 -1
  76. package/dist/esm/{dataunit-fetcher-c4251d80.js → dataunit-fetcher-4c312b43.js} +1 -1
  77. package/dist/esm/field-config_2.entry.js +1 -1
  78. package/dist/esm/fields-layout.entry.js +1 -1
  79. package/dist/esm/fields-selector.entry.js +1 -1
  80. package/dist/esm/{form-config-fetcher-d0536a71.js → form-config-fetcher-7cda6254.js} +1 -1
  81. package/dist/esm/guides-configurator.entry.js +1 -1
  82. package/dist/esm/{index-446f9341.js → index-3355bd17.js} +1 -1
  83. package/dist/esm/{index-479e1293.js → index-7fd74680.js} +0 -17
  84. package/dist/esm/loader.js +2 -2
  85. package/dist/esm/pesquisa-grid_2.entry.js +5 -5
  86. package/dist/esm/sankhyablocks.js +2 -2
  87. package/dist/esm/snk-actions-button_9.entry.js +6 -6
  88. package/dist/esm/snk-actions-form.entry.js +1 -1
  89. package/dist/esm/snk-application.entry.js +7 -7
  90. package/dist/esm/snk-attach.entry.js +8 -8
  91. package/dist/esm/snk-client-confirm.entry.js +1 -1
  92. package/dist/esm/snk-configurator.entry.js +1 -1
  93. package/dist/esm/snk-crud.entry.js +8 -8
  94. package/dist/esm/snk-custom-slot-elements.entry.js +1 -1
  95. package/dist/esm/snk-custom-slot-guide.entry.js +1 -1
  96. package/dist/esm/snk-data-exporter.entry.js +6 -6
  97. package/dist/esm/{snk-data-unit-4a1ef77f.js → snk-data-unit-9e9d9d46.js} +3 -3
  98. package/dist/esm/snk-data-unit.entry.js +4 -4
  99. package/dist/esm/snk-default-filter.entry.js +1 -1
  100. package/dist/esm/snk-detail-view.entry.js +10 -10
  101. package/dist/esm/snk-entity-list.entry.js +1 -1
  102. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  103. package/dist/esm/snk-expression-group_2.entry.js +2 -2
  104. package/dist/esm/snk-filter-advanced-mode_2.entry.js +1 -1
  105. package/dist/esm/snk-filter-bar_4.entry.js +4 -4
  106. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  107. package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
  108. package/dist/esm/snk-filter-detail.entry.js +1 -1
  109. package/dist/esm/snk-filter-field-search_2.entry.js +1 -1
  110. package/dist/esm/snk-filter-modal-item.entry.js +4 -4
  111. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  112. package/dist/esm/snk-filter-number.entry.js +1 -1
  113. package/dist/esm/snk-filter-period.entry.js +1 -1
  114. package/dist/esm/snk-filter-search.entry.js +1 -1
  115. package/dist/esm/snk-filter-text.entry.js +1 -1
  116. package/dist/esm/snk-form-summary.entry.js +1 -1
  117. package/dist/esm/snk-form-view.entry.js +1 -1
  118. package/dist/esm/snk-form_2.entry.js +5 -5
  119. package/dist/esm/snk-grid.entry.js +20 -14
  120. package/dist/esm/{snk-guides-viewer-c182d058.js → snk-guides-viewer-31ef5fc6.js} +7 -7
  121. package/dist/esm/snk-guides-viewer.entry.js +10 -10
  122. package/dist/esm/snk-personalized-filter-editor.entry.js +1 -1
  123. package/dist/esm/snk-personalized-filter.entry.js +5 -5
  124. package/dist/esm/snk-pesquisa.entry.js +5 -5
  125. package/dist/esm/snk-print-selector.entry.js +1 -1
  126. package/dist/esm/snk-simple-bar.entry.js +1 -1
  127. package/dist/esm/snk-simple-crud.entry.js +10 -10
  128. package/dist/esm/snk-taskbar.entry.js +3 -3
  129. package/dist/esm/{taskbar-elements-faaf5d8f.js → taskbar-elements-bf5b73f1.js} +2 -2
  130. package/dist/esm/teste-pesquisa.entry.js +1 -1
  131. package/dist/sankhyablocks/p-02cb4829.entry.js +1 -0
  132. package/dist/sankhyablocks/{p-78d4b3e3.entry.js → p-0893a694.entry.js} +1 -1
  133. package/dist/sankhyablocks/{p-5d408e7e.entry.js → p-0da30fd9.entry.js} +1 -1
  134. package/dist/sankhyablocks/{p-55d7abe7.js → p-156c9f38.js} +1 -1
  135. package/dist/sankhyablocks/{p-f35f2eb3.entry.js → p-17856827.entry.js} +1 -1
  136. package/dist/sankhyablocks/{p-b987e15d.js → p-1be69fd4.js} +1 -1
  137. package/dist/sankhyablocks/{p-e679c75a.entry.js → p-1dba30c9.entry.js} +1 -1
  138. package/dist/sankhyablocks/{p-21107f0d.entry.js → p-1e469905.entry.js} +1 -1
  139. package/dist/sankhyablocks/{p-0e4f8b86.js → p-1f310bc6.js} +1 -1
  140. package/dist/sankhyablocks/{p-96d45943.entry.js → p-227e82b2.entry.js} +1 -1
  141. package/dist/sankhyablocks/p-2624dfd2.entry.js +1 -0
  142. package/dist/sankhyablocks/{p-aca74b21.js → p-2ac55a5d.js} +1 -1
  143. package/dist/sankhyablocks/{p-99a11017.entry.js → p-301baf9c.entry.js} +1 -1
  144. package/dist/sankhyablocks/{p-2e882241.entry.js → p-357e10e0.entry.js} +1 -1
  145. package/dist/sankhyablocks/{p-987cd79d.entry.js → p-35a26068.entry.js} +1 -1
  146. package/dist/sankhyablocks/{p-180716b2.entry.js → p-3671cdd4.entry.js} +1 -1
  147. package/dist/sankhyablocks/{p-27482793.entry.js → p-4575c4aa.entry.js} +1 -1
  148. package/dist/sankhyablocks/{p-3c046287.js → p-48a5c311.js} +2 -2
  149. package/dist/sankhyablocks/{p-3d41f5a8.entry.js → p-497ece60.entry.js} +1 -1
  150. package/dist/sankhyablocks/{p-6e5af618.entry.js → p-4deb7f46.entry.js} +1 -1
  151. package/dist/sankhyablocks/{p-9f16d33e.entry.js → p-4e9e570c.entry.js} +1 -1
  152. package/dist/sankhyablocks/{p-3b167a03.entry.js → p-516411de.entry.js} +1 -1
  153. package/dist/sankhyablocks/{p-162bddae.entry.js → p-522d36aa.entry.js} +1 -1
  154. package/dist/sankhyablocks/p-52691b42.js +1 -0
  155. package/dist/sankhyablocks/{p-825098c1.entry.js → p-56b1b397.entry.js} +1 -1
  156. package/dist/sankhyablocks/{p-d3534985.js → p-59158ba4.js} +1 -1
  157. package/dist/sankhyablocks/{p-c98c79c3.entry.js → p-5c9bea92.entry.js} +1 -1
  158. package/dist/sankhyablocks/{p-91a9abb6.entry.js → p-613eb22e.entry.js} +1 -1
  159. package/dist/sankhyablocks/{p-49ddc27a.entry.js → p-670b8802.entry.js} +1 -1
  160. package/dist/sankhyablocks/{p-60dd1d27.entry.js → p-67137d7c.entry.js} +1 -1
  161. package/dist/sankhyablocks/{p-1b1373b6.js → p-6768f176.js} +1 -1
  162. package/dist/sankhyablocks/{p-03f02b12.entry.js → p-7375bf6a.entry.js} +1 -1
  163. package/dist/sankhyablocks/{p-b7e891cc.entry.js → p-7961c550.entry.js} +1 -1
  164. package/dist/sankhyablocks/{p-4db9dbf8.js → p-7ee6b1bf.js} +1 -1
  165. package/dist/sankhyablocks/{p-75af335e.entry.js → p-82b59a45.entry.js} +1 -1
  166. package/dist/sankhyablocks/p-82bb3eda.js +2 -0
  167. package/dist/sankhyablocks/{p-55798617.js → p-8336900b.js} +1 -1
  168. package/dist/sankhyablocks/{p-d2ec9a24.entry.js → p-8488fa7e.entry.js} +1 -1
  169. package/dist/sankhyablocks/{p-cb4343c4.entry.js → p-8783d550.entry.js} +1 -1
  170. package/dist/sankhyablocks/{p-471b34f4.entry.js → p-8d76a0ca.entry.js} +1 -1
  171. package/dist/sankhyablocks/{p-9a63f3f7.entry.js → p-8d84d6ab.entry.js} +1 -1
  172. package/dist/sankhyablocks/{p-a1d23fef.js → p-907e96eb.js} +1 -1
  173. package/dist/sankhyablocks/{p-e258de96.entry.js → p-939523b3.entry.js} +1 -1
  174. package/dist/sankhyablocks/{p-a9b16874.entry.js → p-959fe522.entry.js} +1 -1
  175. package/dist/sankhyablocks/{p-7e250432.entry.js → p-98c70173.entry.js} +1 -1
  176. package/dist/sankhyablocks/{p-82a3d522.entry.js → p-98e3d0a1.entry.js} +1 -1
  177. package/dist/sankhyablocks/{p-9ab6ae1e.js → p-9e4555ab.js} +2 -2
  178. package/dist/sankhyablocks/{p-2fdac5e6.entry.js → p-abfc9880.entry.js} +1 -1
  179. package/dist/sankhyablocks/{p-1037ea7b.entry.js → p-b5832fa0.entry.js} +1 -1
  180. package/dist/sankhyablocks/{p-01ca59fc.entry.js → p-c2bb0659.entry.js} +1 -1
  181. package/dist/sankhyablocks/{p-7f7fe6c4.entry.js → p-c60d864f.entry.js} +1 -1
  182. package/dist/sankhyablocks/{p-028fb380.entry.js → p-cb7c592f.entry.js} +1 -1
  183. package/dist/sankhyablocks/{p-f3027bc9.entry.js → p-cc68a0c1.entry.js} +1 -1
  184. package/dist/sankhyablocks/{p-c3dbf441.entry.js → p-ce207f2a.entry.js} +1 -1
  185. package/dist/sankhyablocks/{p-c4fcf1fb.entry.js → p-cfa4c183.entry.js} +1 -1
  186. package/dist/sankhyablocks/{p-42272de8.entry.js → p-d5d7fe52.entry.js} +1 -1
  187. package/dist/sankhyablocks/{p-b04db4ac.entry.js → p-dd89bc02.entry.js} +1 -1
  188. package/dist/sankhyablocks/{p-667cab42.entry.js → p-def17f0e.entry.js} +1 -1
  189. package/dist/sankhyablocks/p-e41c86b2.entry.js +1 -0
  190. package/dist/sankhyablocks/{p-4c2e2767.entry.js → p-e47d6f17.entry.js} +1 -1
  191. package/dist/sankhyablocks/{p-7345782c.entry.js → p-fd1a5a61.entry.js} +1 -1
  192. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  193. package/dist/types/components/snk-grid/snk-grid.d.ts +1 -0
  194. package/package.json +1 -1
  195. package/dist/sankhyablocks/p-30a58e29.entry.js +0 -1
  196. package/dist/sankhyablocks/p-903fa0b4.entry.js +0 -1
  197. package/dist/sankhyablocks/p-b9699067.js +0 -1
  198. package/dist/sankhyablocks/p-d8d8169b.js +0 -2
  199. package/dist/sankhyablocks/p-fd05e31d.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as i,h as e,F as s,H as l,g as r}from"./p-d8d8169b.js";import{ElementIDUtils as n,ObjectUtils as a}from"@sankhyalabs/core";import{ApplicationUtils as h}from"@sankhyalabs/ezui/dist/collection/utils";import{P as o}from"./p-988afe78.js";import{E as c}from"./p-1a68fb59.js";import{F as d}from"./p-ff1990ad.js";import"./p-84345e7a.js";const u=class{constructor(e){t(this,e),this.filterChange=i(this,"filterChange",7),this.config=void 0,this.getMessage=void 0,this.showHardFixed=!0,this.removalBlocked=!1}async setFocusField(){var t,i,e,s;this._editor&&(this._editor.setFocus?null===(i=null===(t=this._editor)||void 0===t?void 0:t.setFocus)||void 0===i||i.call(t):this._editor.focus&&(null===(s=null===(e=this._editor)||void 0===e?void 0:e.focus)||void 0===s||s.call(e)))}async clearValue(){this._editor&&this._editor.clearValue&&await this._editor.clearValue()}observeConfig(t){var i,e;this._editor&&(this._editor.config=t),null===(e=null===(i=this._editor)||void 0===i?void 0:i.reloadList)||void 0===e||e.call(i),this._customElementObject=this.getContentEditor()}componentDidLoad(){if(this._element){n.addIDInfo(this._element);const t=this._element.getAttribute(n.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.config.id}`}}changeConfig(t){this.filterChange.emit(t)}getContentEditor(){switch(this.config.type){case d.BINARY_SELECT:return{tag:"snk-filter-binary-select"};case d.MULTI_SELECT:return{tag:"snk-filter-multi-select"};case d.PERIOD:return{tag:"snk-filter-period"};case d.SEARCH:return{tag:"snk-filter-search"};case d.NUMBER:return{tag:"snk-filter-number"};case d.PERSONALIZED:return{tag:"snk-personalized-filter-editor",props:{presentationMode:c.CHIP,onValueChanged:t=>this.handleValueChanged(t)}};case d.CHECK_BOX_LIST:return{tag:"snk-filter-checkbox-list",props:{onValueChanged:t=>this.config=Object.assign(Object.assign({},this.config),{value:t.detail})}};case d.MULTI_LIST:return{tag:"snk-entity-list",props:{onValueChanged:t=>this.config=Object.assign(Object.assign({},this.config),{value:t.detail})}}}return{tag:"snk-filter-text"}}handleValueChanged({detail:t}){const i=(null==t?void 0:t.items)||this.config.groupedItems;this.config=Object.assign(Object.assign({},this.config),{groupedItems:i,visible:(i||[]).filter((t=>t.visible)).length>0})}removeItem(){const t=this.config.type===d.MULTI_LIST&&Array.isArray(this.config.value)?this.config.value.map((t=>Object.assign(Object.assign({},t),{check:!1}))):void 0,i=Object.assign(Object.assign({},this.config),{visible:!1,fixed:!1,value:t});null!=i.groupedItems&&(i.groupedItems=i.groupedItems.map((t=>Object.assign(Object.assign({},t),{visible:!1,fixed:!1,value:void 0})))),this.changeConfig(i)}removeItemFromGroup(t){return Object.assign(Object.assign({},t),{visible:!1,fixed:!1,value:void 0})}getPopUpHeaderButtons(){return e(s,null,!this.removalBlocked&&!this.config.removalBlocked&&this.buildIcon(this.getMessage("snkFilterBar.removeFilter"),"delete",(()=>this.removeItem())),this.showHardFixed&&!this.config.hardFixed&&this.buildIcon(this.getMessage(this.config.fixed?"snkFilterBar.unpinFilter":"snkFilterBar.pinFilter"),this.config.fixed?"un-pin":"push-pin",(()=>this.changeConfig(Object.assign(Object.assign({},this.config),{fixed:!this.config.fixed})))))}buildIcon(t,i,s){return e("button",{onClick:()=>s(),class:"sc-snk-filter-bar snk-filter-item__editor-header-button",ref:i=>i&&this.buildIdButton(i,t)},e("ez-icon",Object.assign({title:t,iconName:i},{[n.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${n.getInternalIDInfo(`_${t}`)}`})))}buildIdButton(t,i){if(!t)return;const e={id:i};t.removeAttribute(n.DATA_ELEMENT_ID_ATTRIBUTE_NAME),n.addIDInfoIfNotExists(t,"button",e)}clearBinarySelectValues(){var t;const i=this._editor||{};null===(t=i.resetValues)||void 0===t||t.call(i),this.config=a.copy(this.originalConfig),this.changeConfig(Object.assign(Object.assign({},this.config),{value:void 0}))}apply(){if(!o.validateVariableValues(this.config,this._editor.value))return h.alert(this.getMessage("snkFilterBar.filterModal.validations.notFullFilled.title"),this.getMessage("snkFilterBar.filterModal.validations.notFullFilled.message"));const t=void 0!==this._editor.value?this._editor.value:this.config.value;this.changeConfig(Object.assign(Object.assign({},this.config),{visible:this.isVisible(),value:t}))}isVisible(){return!(this.config.groupedItems&&this.config.groupedItems.length>0)||this.config.groupedItems.filter((t=>t.visible)).length>0}clear(){var t;if(this.config.type!==d.BINARY_SELECT){if(d.MULTI_LIST===this.config.type){const i=a.copy(this.config);return null===(t=i.value)||void 0===t||t.forEach((t=>!!t&&(t.check=!1))),void(this.config=a.copy(i))}this.changeConfig(Object.assign(Object.assign({},this.config),{value:void 0}))}else this.clearBinarySelectValues()}filterCanBeCleared(){return this.config.type!==d.PERSONALIZED}onKeyDonwListener(t){"Enter"===t.key&&this._applyButton.setFocus().then((()=>this.apply()))}buildRightSlot(t){return e("ez-icon",{iconName:"delete",onClick:()=>this.removeValueFromConfig(t)})}removeValueFromConfig(t){var i,e;if(this.config){const s=a.copy(this.config),l=null===(i=s.value)||void 0===i?void 0:i.findIndex((i=>(null==i?void 0:i.id)===t.id));null===(e=s.value)||void 0===e||e.splice(l,1),this.config=a.copy(s)}}componentWillLoad(){this.originalConfig=a.copy(this.config),this._customElementObject=this.getContentEditor()}render(){const{tag:t,props:i}=this._customElementObject;return e(l,null,e("div",{class:"col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center"},e("div",{class:"ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header"},this.config.detailTitle),this.getPopUpHeaderButtons()),e(t,Object.assign({maxHeightList:"240px",ref:t=>this._editor=t,value:this.config.value,config:this.config,onKeyDown:t=>this.onKeyDonwListener(t),"data-element-id":this._idContentEditor,getMessage:this.getMessage,rightListSlotBuilder:t=>this.buildRightSlot(t)},i)),e("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),e("div",{class:"ez-col ez-col--sd-12 ez-align--right"},this.filterCanBeCleared()&&e("ez-button",{label:this.getMessage("snkFilterBar.cleanFilter"),onClick:()=>this.clear(),size:"small"}),e("ez-button",{ref:t=>this._applyButton=t,label:this.getMessage("snkFilterBar.applyFilter"),onClick:()=>this.apply(),size:"small",class:"ez-button--primary ez-padding-left--medium"})))}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};export{u as snk_filter_detail}
1
+ import{r as t,c as i,h as e,F as s,H as l,g as r}from"./p-82bb3eda.js";import{ElementIDUtils as n,ObjectUtils as a}from"@sankhyalabs/core";import{ApplicationUtils as h}from"@sankhyalabs/ezui/dist/collection/utils";import{P as o}from"./p-988afe78.js";import{E as c}from"./p-1a68fb59.js";import{F as d}from"./p-ff1990ad.js";import"./p-84345e7a.js";const u=class{constructor(e){t(this,e),this.filterChange=i(this,"filterChange",7),this.config=void 0,this.getMessage=void 0,this.showHardFixed=!0,this.removalBlocked=!1}async setFocusField(){var t,i,e,s;this._editor&&(this._editor.setFocus?null===(i=null===(t=this._editor)||void 0===t?void 0:t.setFocus)||void 0===i||i.call(t):this._editor.focus&&(null===(s=null===(e=this._editor)||void 0===e?void 0:e.focus)||void 0===s||s.call(e)))}async clearValue(){this._editor&&this._editor.clearValue&&await this._editor.clearValue()}observeConfig(t){var i,e;this._editor&&(this._editor.config=t),null===(e=null===(i=this._editor)||void 0===i?void 0:i.reloadList)||void 0===e||e.call(i),this._customElementObject=this.getContentEditor()}componentDidLoad(){if(this._element){n.addIDInfo(this._element);const t=this._element.getAttribute(n.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.config.id}`}}changeConfig(t){this.filterChange.emit(t)}getContentEditor(){switch(this.config.type){case d.BINARY_SELECT:return{tag:"snk-filter-binary-select"};case d.MULTI_SELECT:return{tag:"snk-filter-multi-select"};case d.PERIOD:return{tag:"snk-filter-period"};case d.SEARCH:return{tag:"snk-filter-search"};case d.NUMBER:return{tag:"snk-filter-number"};case d.PERSONALIZED:return{tag:"snk-personalized-filter-editor",props:{presentationMode:c.CHIP,onValueChanged:t=>this.handleValueChanged(t)}};case d.CHECK_BOX_LIST:return{tag:"snk-filter-checkbox-list",props:{onValueChanged:t=>this.config=Object.assign(Object.assign({},this.config),{value:t.detail})}};case d.MULTI_LIST:return{tag:"snk-entity-list",props:{onValueChanged:t=>this.config=Object.assign(Object.assign({},this.config),{value:t.detail})}}}return{tag:"snk-filter-text"}}handleValueChanged({detail:t}){const i=(null==t?void 0:t.items)||this.config.groupedItems;this.config=Object.assign(Object.assign({},this.config),{groupedItems:i,visible:(i||[]).filter((t=>t.visible)).length>0})}removeItem(){const t=this.config.type===d.MULTI_LIST&&Array.isArray(this.config.value)?this.config.value.map((t=>Object.assign(Object.assign({},t),{check:!1}))):void 0,i=Object.assign(Object.assign({},this.config),{visible:!1,fixed:!1,value:t});null!=i.groupedItems&&(i.groupedItems=i.groupedItems.map((t=>Object.assign(Object.assign({},t),{visible:!1,fixed:!1,value:void 0})))),this.changeConfig(i)}removeItemFromGroup(t){return Object.assign(Object.assign({},t),{visible:!1,fixed:!1,value:void 0})}getPopUpHeaderButtons(){return e(s,null,!this.removalBlocked&&!this.config.removalBlocked&&this.buildIcon(this.getMessage("snkFilterBar.removeFilter"),"delete",(()=>this.removeItem())),this.showHardFixed&&!this.config.hardFixed&&this.buildIcon(this.getMessage(this.config.fixed?"snkFilterBar.unpinFilter":"snkFilterBar.pinFilter"),this.config.fixed?"un-pin":"push-pin",(()=>this.changeConfig(Object.assign(Object.assign({},this.config),{fixed:!this.config.fixed})))))}buildIcon(t,i,s){return e("button",{onClick:()=>s(),class:"sc-snk-filter-bar snk-filter-item__editor-header-button",ref:i=>i&&this.buildIdButton(i,t)},e("ez-icon",Object.assign({title:t,iconName:i},{[n.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${n.getInternalIDInfo(`_${t}`)}`})))}buildIdButton(t,i){if(!t)return;const e={id:i};t.removeAttribute(n.DATA_ELEMENT_ID_ATTRIBUTE_NAME),n.addIDInfoIfNotExists(t,"button",e)}clearBinarySelectValues(){var t;const i=this._editor||{};null===(t=i.resetValues)||void 0===t||t.call(i),this.config=a.copy(this.originalConfig),this.changeConfig(Object.assign(Object.assign({},this.config),{value:void 0}))}apply(){if(!o.validateVariableValues(this.config,this._editor.value))return h.alert(this.getMessage("snkFilterBar.filterModal.validations.notFullFilled.title"),this.getMessage("snkFilterBar.filterModal.validations.notFullFilled.message"));const t=void 0!==this._editor.value?this._editor.value:this.config.value;this.changeConfig(Object.assign(Object.assign({},this.config),{visible:this.isVisible(),value:t}))}isVisible(){return!(this.config.groupedItems&&this.config.groupedItems.length>0)||this.config.groupedItems.filter((t=>t.visible)).length>0}clear(){var t;if(this.config.type!==d.BINARY_SELECT){if(d.MULTI_LIST===this.config.type){const i=a.copy(this.config);return null===(t=i.value)||void 0===t||t.forEach((t=>!!t&&(t.check=!1))),void(this.config=a.copy(i))}this.changeConfig(Object.assign(Object.assign({},this.config),{value:void 0}))}else this.clearBinarySelectValues()}filterCanBeCleared(){return this.config.type!==d.PERSONALIZED}onKeyDonwListener(t){"Enter"===t.key&&this._applyButton.setFocus().then((()=>this.apply()))}buildRightSlot(t){return e("ez-icon",{iconName:"delete",onClick:()=>this.removeValueFromConfig(t)})}removeValueFromConfig(t){var i,e;if(this.config){const s=a.copy(this.config),l=null===(i=s.value)||void 0===i?void 0:i.findIndex((i=>(null==i?void 0:i.id)===t.id));null===(e=s.value)||void 0===e||e.splice(l,1),this.config=a.copy(s)}}componentWillLoad(){this.originalConfig=a.copy(this.config),this._customElementObject=this.getContentEditor()}render(){const{tag:t,props:i}=this._customElementObject;return e(l,null,e("div",{class:"col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center"},e("div",{class:"ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header"},this.config.detailTitle),this.getPopUpHeaderButtons()),e(t,Object.assign({maxHeightList:"240px",ref:t=>this._editor=t,value:this.config.value,config:this.config,onKeyDown:t=>this.onKeyDonwListener(t),"data-element-id":this._idContentEditor,getMessage:this.getMessage,rightListSlotBuilder:t=>this.buildRightSlot(t)},i)),e("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),e("div",{class:"ez-col ez-col--sd-12 ez-align--right"},this.filterCanBeCleared()&&e("ez-button",{label:this.getMessage("snkFilterBar.cleanFilter"),onClick:()=>this.clear(),size:"small"}),e("ez-button",{ref:t=>this._applyButton=t,label:this.getMessage("snkFilterBar.applyFilter"),onClick:()=>this.apply(),size:"small",class:"ez-button--primary ez-padding-left--medium"})))}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};export{u as snk_filter_detail}
@@ -1 +1 @@
1
- import{r as t,c as e,h as i,H as s}from"./p-d8d8169b.js";import{A as r}from"./p-6a4b21dd.js";const l=class{constructor(i){t(this,i),this.actionSelected=e(this,"actionSelected",7),this.OFFSET_HEIGHT=5,this.getMessage=void 0,this.hasDefaultFilter=!1,this._opened=!1}repositionDropDown(){if(!this._refIcon||!this._refDropdown)return;const t=this._refIcon.getBoundingClientRect(),e=this._refDropdown.getBoundingClientRect();this._refDropdown.style.top=t.y+t.height+this.OFFSET_HEIGHT+"px",this._refDropdown.style.left=t.x+t.width/2-e.width+"px"}toggleDropdown(){this._opened=!this._opened}closeDropdown(t){const e=null==t?void 0:t.target;e&&(e.closest("#dropdown-parent-demo")||(this._opened=!1))}buildItems(){return[{id:r.EDIT,label:this.getMessage("defaultFilter.edit")},{id:r.REMOVE,label:this.getMessage("defaultFilter.remove")}]}onValueSelected({detail:t}){this._opened=!1,this.actionSelected.emit(t.id)}openCreateNewFilter(){this.actionSelected.emit(r.CREATE)}componentDidRender(){this.repositionDropDown()}componentWillLoad(){this._items=this.buildItems(),document.removeEventListener("scroll",this.repositionDropDown.bind(this)),document.addEventListener("scroll",this.repositionDropDown.bind(this))}render(){return this.hasDefaultFilter?i(s,null,i("button",{class:"default_container",onClick:this.toggleDropdown.bind(this)},i("span",null,this.getMessage("defaultFilter.title")),i("ez-icon",{ref:t=>this._refIcon=t,iconName:"dots-vertical"})),this._opened&&i("ez-dropdown",{ref:t=>this._refDropdown=t,items:this._items,onEzClick:this.onValueSelected.bind(this),onEzOutsideClick:this.closeDropdown.bind(this)})):i(s,null,i("button",{class:"default_container new_filter",onClick:this.openCreateNewFilter.bind(this)},i("span",null,this.getMessage("defaultFilter.create"))))}};l.style=".sc-snk-default-filter-h{display:flex;justify-content:flex-end}.default_container.sc-snk-default-filter{border:none;background:none;display:flex;align-items:center;gap:var(--space--3xs, 4px);font-family:var(--font-pattern);color:var(--title--primary, #2b3a54);font-size:var(--text--medium, 14px);padding:0;outline:none}.default_container.sc-snk-default-filter ez-icon.sc-snk-default-filter{cursor:pointer}.default_container.sc-snk-default-filter ez-icon.sc-snk-default-filter:hover{color:var(--color--primary-600)}.new_filter.sc-snk-default-filter{cursor:pointer;margin:0 var(--space--3xs, 4px)}.new_filter.sc-snk-default-filter:hover{color:var(--color--primary-600)}";export{l as snk_default_filter}
1
+ import{r as t,c as e,h as i,H as s}from"./p-82bb3eda.js";import{A as r}from"./p-6a4b21dd.js";const l=class{constructor(i){t(this,i),this.actionSelected=e(this,"actionSelected",7),this.OFFSET_HEIGHT=5,this.getMessage=void 0,this.hasDefaultFilter=!1,this._opened=!1}repositionDropDown(){if(!this._refIcon||!this._refDropdown)return;const t=this._refIcon.getBoundingClientRect(),e=this._refDropdown.getBoundingClientRect();this._refDropdown.style.top=t.y+t.height+this.OFFSET_HEIGHT+"px",this._refDropdown.style.left=t.x+t.width/2-e.width+"px"}toggleDropdown(){this._opened=!this._opened}closeDropdown(t){const e=null==t?void 0:t.target;e&&(e.closest("#dropdown-parent-demo")||(this._opened=!1))}buildItems(){return[{id:r.EDIT,label:this.getMessage("defaultFilter.edit")},{id:r.REMOVE,label:this.getMessage("defaultFilter.remove")}]}onValueSelected({detail:t}){this._opened=!1,this.actionSelected.emit(t.id)}openCreateNewFilter(){this.actionSelected.emit(r.CREATE)}componentDidRender(){this.repositionDropDown()}componentWillLoad(){this._items=this.buildItems(),document.removeEventListener("scroll",this.repositionDropDown.bind(this)),document.addEventListener("scroll",this.repositionDropDown.bind(this))}render(){return this.hasDefaultFilter?i(s,null,i("button",{class:"default_container",onClick:this.toggleDropdown.bind(this)},i("span",null,this.getMessage("defaultFilter.title")),i("ez-icon",{ref:t=>this._refIcon=t,iconName:"dots-vertical"})),this._opened&&i("ez-dropdown",{ref:t=>this._refDropdown=t,items:this._items,onEzClick:this.onValueSelected.bind(this),onEzOutsideClick:this.closeDropdown.bind(this)})):i(s,null,i("button",{class:"default_container new_filter",onClick:this.openCreateNewFilter.bind(this)},i("span",null,this.getMessage("defaultFilter.create"))))}};l.style=".sc-snk-default-filter-h{display:flex;justify-content:flex-end}.default_container.sc-snk-default-filter{border:none;background:none;display:flex;align-items:center;gap:var(--space--3xs, 4px);font-family:var(--font-pattern);color:var(--title--primary, #2b3a54);font-size:var(--text--medium, 14px);padding:0;outline:none}.default_container.sc-snk-default-filter ez-icon.sc-snk-default-filter{cursor:pointer}.default_container.sc-snk-default-filter ez-icon.sc-snk-default-filter:hover{color:var(--color--primary-600)}.new_filter.sc-snk-default-filter{cursor:pointer;margin:0 var(--space--3xs, 4px)}.new_filter.sc-snk-default-filter:hover{color:var(--color--primary-600)}";export{l as snk_default_filter}