@platforma-sdk/ui-vue 1.85.2 → 1.86.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. package/.turbo/turbo-build.log +210 -211
  2. package/.turbo/turbo-formatter$colon$check.log +4 -6
  3. package/.turbo/turbo-linter$colon$check.log +4 -6
  4. package/.turbo/turbo-types$colon$check.log +3 -5
  5. package/CHANGELOG.md +32 -0
  6. package/dist/AgGridVue/AgGridTheme.js +1 -2
  7. package/dist/AgGridVue/AgGridTheme.js.map +1 -1
  8. package/dist/AgGridVue/ag-override.js +1 -2
  9. package/dist/AgGridVue/ag-override.js.map +1 -1
  10. package/dist/AgGridVue/createAgGridColDef.js +2 -3
  11. package/dist/AgGridVue/createAgGridColDef.js.map +1 -1
  12. package/dist/AgGridVue/index.js +5 -4
  13. package/dist/AgGridVue/selection.js +1 -2
  14. package/dist/AgGridVue/selection.js.map +1 -1
  15. package/dist/AgGridVue/useAgGridOptions.js +1 -2
  16. package/dist/AgGridVue/useAgGridOptions.js.map +1 -1
  17. package/dist/_virtual/_plugin-vue_export-helper.js +1 -2
  18. package/dist/components/BlockLayout.js +1 -2
  19. package/dist/components/BlockLayout.js.map +1 -1
  20. package/dist/components/BlockLayout.style.js +3 -3
  21. package/dist/components/BlockLayout.style.js.map +1 -1
  22. package/dist/components/BlockLayout.vue2.js +2 -3
  23. package/dist/components/BlockLayout.vue2.js.map +1 -1
  24. package/dist/components/BlockLoader.js +1 -2
  25. package/dist/components/BlockLoader.js.map +1 -1
  26. package/dist/components/BlockLoader.vue2.js +2 -3
  27. package/dist/components/BlockLoader.vue2.js.map +1 -1
  28. package/dist/components/LoaderPage.js +2 -3
  29. package/dist/components/LoaderPage.js.map +1 -1
  30. package/dist/components/NotFound.js +1 -2
  31. package/dist/components/NotFound.js.map +1 -1
  32. package/dist/components/NotFound.vue2.js +2 -3
  33. package/dist/components/NotFound.vue2.js.map +1 -1
  34. package/dist/components/PlAdvancedFilter/FilterEditor.js +1 -2
  35. package/dist/components/PlAdvancedFilter/FilterEditor.js.map +1 -1
  36. package/dist/components/PlAdvancedFilter/FilterEditor.style.js +16 -16
  37. package/dist/components/PlAdvancedFilter/FilterEditor.style.js.map +1 -1
  38. package/dist/components/PlAdvancedFilter/FilterEditor.vue.d.ts.map +1 -1
  39. package/dist/components/PlAdvancedFilter/FilterEditor.vue2.js +86 -83
  40. package/dist/components/PlAdvancedFilter/FilterEditor.vue2.js.map +1 -1
  41. package/dist/components/PlAdvancedFilter/OperandButton.js +1 -2
  42. package/dist/components/PlAdvancedFilter/OperandButton.js.map +1 -1
  43. package/dist/components/PlAdvancedFilter/OperandButton.style.js +6 -6
  44. package/dist/components/PlAdvancedFilter/OperandButton.style.js.map +1 -1
  45. package/dist/components/PlAdvancedFilter/OperandButton.vue2.js +2 -3
  46. package/dist/components/PlAdvancedFilter/OperandButton.vue2.js.map +1 -1
  47. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.js +1 -2
  48. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.js.map +1 -1
  49. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.style.js +11 -11
  50. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.style.js.map +1 -1
  51. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js +4 -5
  52. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js.map +1 -1
  53. package/dist/components/PlAdvancedFilter/constants.js +1 -2
  54. package/dist/components/PlAdvancedFilter/constants.js.map +1 -1
  55. package/dist/components/PlAdvancedFilter/index.js +4 -5
  56. package/dist/components/PlAdvancedFilter/index.js.map +1 -1
  57. package/dist/components/PlAdvancedFilter/types.d.ts +2 -0
  58. package/dist/components/PlAdvancedFilter/types.d.ts.map +1 -1
  59. package/dist/components/PlAdvancedFilter/utils.js +2 -3
  60. package/dist/components/PlAdvancedFilter/utils.js.map +1 -1
  61. package/dist/components/PlAgCellFile/PlAgCellFile.js +1 -2
  62. package/dist/components/PlAgCellFile/PlAgCellFile.js.map +1 -1
  63. package/dist/components/PlAgCellFile/PlAgCellFile.vue2.js +2 -3
  64. package/dist/components/PlAgCellFile/PlAgCellFile.vue2.js.map +1 -1
  65. package/dist/components/PlAgCellFile/index.js +1 -1
  66. package/dist/components/PlAgCellProgress/PlAgCellProgress.js +1 -2
  67. package/dist/components/PlAgCellProgress/PlAgCellProgress.js.map +1 -1
  68. package/dist/components/PlAgCellProgress/PlAgCellProgress.vue2.js +2 -3
  69. package/dist/components/PlAgCellProgress/PlAgCellProgress.vue2.js.map +1 -1
  70. package/dist/components/PlAgCellProgress/index.js +1 -1
  71. package/dist/components/PlAgCellStatusTag/PlAgCellStatusTag.js +1 -2
  72. package/dist/components/PlAgCellStatusTag/PlAgCellStatusTag.js.map +1 -1
  73. package/dist/components/PlAgCellStatusTag/PlAgCellStatusTag.vue2.js +2 -3
  74. package/dist/components/PlAgCellStatusTag/PlAgCellStatusTag.vue2.js.map +1 -1
  75. package/dist/components/PlAgCellStatusTag/index.js +1 -1
  76. package/dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.js +1 -2
  77. package/dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.js.map +1 -1
  78. package/dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.vue2.js +2 -3
  79. package/dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.vue2.js.map +1 -1
  80. package/dist/components/PlAgChartHistogramCell/index.js +1 -1
  81. package/dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.js +1 -2
  82. package/dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.js.map +1 -1
  83. package/dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.vue2.js +2 -3
  84. package/dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.vue2.js.map +1 -1
  85. package/dist/components/PlAgChartStackedBarCell/index.js +1 -1
  86. package/dist/components/PlAgColumnHeader/PlAgColumnHeader.js +1 -2
  87. package/dist/components/PlAgColumnHeader/PlAgColumnHeader.js.map +1 -1
  88. package/dist/components/PlAgColumnHeader/PlAgColumnHeader.vue.d.ts.map +1 -1
  89. package/dist/components/PlAgColumnHeader/PlAgColumnHeader.vue2.js +41 -36
  90. package/dist/components/PlAgColumnHeader/PlAgColumnHeader.vue2.js.map +1 -1
  91. package/dist/components/PlAgColumnHeader/index.js +1 -1
  92. package/dist/components/PlAgColumnHeader/types.d.ts +2 -0
  93. package/dist/components/PlAgColumnHeader/types.d.ts.map +1 -1
  94. package/dist/components/PlAgCsvExporter/PlAgCsvExporter.js +1 -2
  95. package/dist/components/PlAgCsvExporter/PlAgCsvExporter.js.map +1 -1
  96. package/dist/components/PlAgCsvExporter/PlAgCsvExporter.vue2.js +2 -3
  97. package/dist/components/PlAgCsvExporter/PlAgCsvExporter.vue2.js.map +1 -1
  98. package/dist/components/PlAgCsvExporter/export-csv.js +3 -4
  99. package/dist/components/PlAgCsvExporter/export-csv.js.map +1 -1
  100. package/dist/components/PlAgCsvExporter/index.js +1 -1
  101. package/dist/components/PlAgDataTable/PlAgDataTableSheets.js +1 -2
  102. package/dist/components/PlAgDataTable/PlAgDataTableSheets.js.map +1 -1
  103. package/dist/components/PlAgDataTable/PlAgDataTableSheets.style.js +3 -3
  104. package/dist/components/PlAgDataTable/PlAgDataTableSheets.style.js.map +1 -1
  105. package/dist/components/PlAgDataTable/PlAgDataTableSheets.vue2.js +4 -5
  106. package/dist/components/PlAgDataTable/PlAgDataTableSheets.vue2.js.map +1 -1
  107. package/dist/components/PlAgDataTable/PlAgDataTableV2.js +1 -2
  108. package/dist/components/PlAgDataTable/PlAgDataTableV2.js.map +1 -1
  109. package/dist/components/PlAgDataTable/PlAgDataTableV2.style.js +5 -5
  110. package/dist/components/PlAgDataTable/PlAgDataTableV2.style.js.map +1 -1
  111. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts.map +1 -1
  112. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js +130 -129
  113. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js.map +1 -1
  114. package/dist/components/PlAgDataTable/PlAgOverlayLoading.js +1 -2
  115. package/dist/components/PlAgDataTable/PlAgOverlayLoading.js.map +1 -1
  116. package/dist/components/PlAgDataTable/PlAgOverlayLoading.vue2.js +2 -3
  117. package/dist/components/PlAgDataTable/PlAgOverlayLoading.vue2.js.map +1 -1
  118. package/dist/components/PlAgDataTable/PlAgOverlayNoRows.js +1 -2
  119. package/dist/components/PlAgDataTable/PlAgOverlayNoRows.js.map +1 -1
  120. package/dist/components/PlAgDataTable/PlAgOverlayNoRows.vue2.js +2 -3
  121. package/dist/components/PlAgDataTable/PlAgOverlayNoRows.vue2.js.map +1 -1
  122. package/dist/components/PlAgDataTable/PlAgRowCount.js +1 -2
  123. package/dist/components/PlAgDataTable/PlAgRowCount.js.map +1 -1
  124. package/dist/components/PlAgDataTable/PlAgRowCount.vue2.js +2 -3
  125. package/dist/components/PlAgDataTable/PlAgRowCount.vue2.js.map +1 -1
  126. package/dist/components/PlAgDataTable/compositions/useFilterableColumns.js +1 -2
  127. package/dist/components/PlAgDataTable/compositions/useFilterableColumns.js.map +1 -1
  128. package/dist/components/PlAgDataTable/compositions/useGrid.js +1 -2
  129. package/dist/components/PlAgDataTable/compositions/useGrid.js.map +1 -1
  130. package/dist/components/PlAgDataTable/index.js +11 -11
  131. package/dist/components/PlAgDataTable/index.js.map +1 -1
  132. package/dist/components/PlAgDataTable/pl-ag-overlay-loading.module.js +7 -7
  133. package/dist/components/PlAgDataTable/pl-ag-overlay-loading.module.js.map +1 -1
  134. package/dist/components/PlAgDataTable/sources/common.js +1 -2
  135. package/dist/components/PlAgDataTable/sources/common.js.map +1 -1
  136. package/dist/components/PlAgDataTable/sources/focus-row.js +1 -2
  137. package/dist/components/PlAgDataTable/sources/focus-row.js.map +1 -1
  138. package/dist/components/PlAgDataTable/sources/grid-state.js +3 -4
  139. package/dist/components/PlAgDataTable/sources/grid-state.js.map +1 -1
  140. package/dist/components/PlAgDataTable/sources/menu-items.js +1 -2
  141. package/dist/components/PlAgDataTable/sources/menu-items.js.map +1 -1
  142. package/dist/components/PlAgDataTable/sources/row-number.js +2 -3
  143. package/dist/components/PlAgDataTable/sources/row-number.js.map +1 -1
  144. package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts +2 -0
  145. package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts.map +1 -1
  146. package/dist/components/PlAgDataTable/sources/table-source-v2.js +49 -52
  147. package/dist/components/PlAgDataTable/sources/table-source-v2.js.map +1 -1
  148. package/dist/components/PlAgDataTable/sources/table-state-v2.js +2 -3
  149. package/dist/components/PlAgDataTable/sources/table-state-v2.js.map +1 -1
  150. package/dist/components/PlAgDataTable/sources/value-rendering.js +6 -9
  151. package/dist/components/PlAgDataTable/sources/value-rendering.js.map +1 -1
  152. package/dist/components/PlAgDataTable/types.js +1 -2
  153. package/dist/components/PlAgDataTable/types.js.map +1 -1
  154. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.js +1 -2
  155. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.js.map +1 -1
  156. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.style.js +6 -6
  157. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.style.js.map +1 -1
  158. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue.d.ts.map +1 -1
  159. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue2.js +44 -38
  160. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue2.js.map +1 -1
  161. package/dist/components/PlAgGridColumnManager/index.js +1 -1
  162. package/dist/components/PlAgGridColumnManager/useFilteredItems.js +2 -3
  163. package/dist/components/PlAgGridColumnManager/useFilteredItems.js.map +1 -1
  164. package/dist/components/PlAgGridColumnManager/useGridColumns.js +1 -2
  165. package/dist/components/PlAgGridColumnManager/useGridColumns.js.map +1 -1
  166. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.js +1 -2
  167. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.js.map +1 -1
  168. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue2.js +2 -3
  169. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue2.js.map +1 -1
  170. package/dist/components/PlAgRowNumCheckbox/index.js +1 -1
  171. package/dist/components/PlAgRowNumCheckbox/pl-ag-row-num-checkbox.module.js +7 -7
  172. package/dist/components/PlAgRowNumCheckbox/pl-ag-row-num-checkbox.module.js.map +1 -1
  173. package/dist/components/PlAgRowNumHeader.js +1 -2
  174. package/dist/components/PlAgRowNumHeader.js.map +1 -1
  175. package/dist/components/PlAgRowNumHeader.vue2.js +2 -3
  176. package/dist/components/PlAgRowNumHeader.vue2.js.map +1 -1
  177. package/dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.js +1 -2
  178. package/dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.js.map +1 -1
  179. package/dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue2.js +2 -3
  180. package/dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue2.js.map +1 -1
  181. package/dist/components/PlAgTextAndButtonCell/index.js +1 -1
  182. package/dist/components/PlAnnotations/components/AnnotationsSidebar.js +1 -2
  183. package/dist/components/PlAnnotations/components/AnnotationsSidebar.js.map +1 -1
  184. package/dist/components/PlAnnotations/components/AnnotationsSidebar.style.js +9 -9
  185. package/dist/components/PlAnnotations/components/AnnotationsSidebar.style.js.map +1 -1
  186. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js +2 -3
  187. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js.map +1 -1
  188. package/dist/components/PlAnnotations/components/FilterSidebar.js +1 -2
  189. package/dist/components/PlAnnotations/components/FilterSidebar.js.map +1 -1
  190. package/dist/components/PlAnnotations/components/FilterSidebar.style.js +5 -5
  191. package/dist/components/PlAnnotations/components/FilterSidebar.style.js.map +1 -1
  192. package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js +2 -3
  193. package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js.map +1 -1
  194. package/dist/components/PlAnnotations/components/PlAnnotations.js +1 -2
  195. package/dist/components/PlAnnotations/components/PlAnnotations.js.map +1 -1
  196. package/dist/components/PlAnnotations/components/PlAnnotations.style.js +3 -3
  197. package/dist/components/PlAnnotations/components/PlAnnotations.style.js.map +1 -1
  198. package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js +2 -3
  199. package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js.map +1 -1
  200. package/dist/components/PlAnnotations/components/PlAnnotationsModal.js +1 -2
  201. package/dist/components/PlAnnotations/components/PlAnnotationsModal.js.map +1 -1
  202. package/dist/components/PlAnnotations/components/PlAnnotationsModal.style.js +5 -5
  203. package/dist/components/PlAnnotations/components/PlAnnotationsModal.style.js.map +1 -1
  204. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js +2 -3
  205. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js.map +1 -1
  206. package/dist/components/PlAnnotations/components/style.module.js +6 -6
  207. package/dist/components/PlAnnotations/components/style.module.js.map +1 -1
  208. package/dist/components/PlAnnotations/index.js +3 -2
  209. package/dist/components/PlAnnotations/utils.js +1 -2
  210. package/dist/components/PlAnnotations/utils.js.map +1 -1
  211. package/dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.js +1 -2
  212. package/dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.js.map +1 -1
  213. package/dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue2.js +2 -3
  214. package/dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue2.js.map +1 -1
  215. package/dist/components/PlAppErrorNotificationAlert/index.js +1 -1
  216. package/dist/components/PlBtnExportArchive/Item.js +1 -2
  217. package/dist/components/PlBtnExportArchive/Item.js.map +1 -1
  218. package/dist/components/PlBtnExportArchive/Item.style.js +7 -7
  219. package/dist/components/PlBtnExportArchive/Item.style.js.map +1 -1
  220. package/dist/components/PlBtnExportArchive/Item.vue2.js +2 -3
  221. package/dist/components/PlBtnExportArchive/Item.vue2.js.map +1 -1
  222. package/dist/components/PlBtnExportArchive/PlBtnExportArchive.js +1 -2
  223. package/dist/components/PlBtnExportArchive/PlBtnExportArchive.js.map +1 -1
  224. package/dist/components/PlBtnExportArchive/PlBtnExportArchive.style.js +6 -6
  225. package/dist/components/PlBtnExportArchive/PlBtnExportArchive.style.js.map +1 -1
  226. package/dist/components/PlBtnExportArchive/PlBtnExportArchive.vue2.js +16 -17
  227. package/dist/components/PlBtnExportArchive/PlBtnExportArchive.vue2.js.map +1 -1
  228. package/dist/components/PlBtnExportArchive/Summary.js +1 -2
  229. package/dist/components/PlBtnExportArchive/Summary.js.map +1 -1
  230. package/dist/components/PlBtnExportArchive/Summary.style.js +6 -6
  231. package/dist/components/PlBtnExportArchive/Summary.style.js.map +1 -1
  232. package/dist/components/PlBtnExportArchive/Summary.vue2.js +2 -3
  233. package/dist/components/PlBtnExportArchive/Summary.vue2.js.map +1 -1
  234. package/dist/components/PlBtnExportArchive/index.js +1 -1
  235. package/dist/components/PlDatasetSelector/PlDatasetSelector.js +1 -2
  236. package/dist/components/PlDatasetSelector/PlDatasetSelector.js.map +1 -1
  237. package/dist/components/PlDatasetSelector/PlDatasetSelector.vue2.js +3 -8
  238. package/dist/components/PlDatasetSelector/PlDatasetSelector.vue2.js.map +1 -1
  239. package/dist/components/PlDatasetSelector/index.js +1 -1
  240. package/dist/components/PlTableFastSearch/PlTableFastSearch.js +1 -2
  241. package/dist/components/PlTableFastSearch/PlTableFastSearch.js.map +1 -1
  242. package/dist/components/PlTableFastSearch/PlTableFastSearch.vue2.js +2 -3
  243. package/dist/components/PlTableFastSearch/PlTableFastSearch.vue2.js.map +1 -1
  244. package/dist/components/PlTableFastSearch/index.js +1 -1
  245. package/dist/components/PlTableFilters/PlTableFiltersV2.js +1 -2
  246. package/dist/components/PlTableFilters/PlTableFiltersV2.js.map +1 -1
  247. package/dist/components/PlTableFilters/PlTableFiltersV2.style.js +6 -6
  248. package/dist/components/PlTableFilters/PlTableFiltersV2.style.js.map +1 -1
  249. package/dist/components/PlTableFilters/PlTableFiltersV2.vue.d.ts +2 -1
  250. package/dist/components/PlTableFilters/PlTableFiltersV2.vue.d.ts.map +1 -1
  251. package/dist/components/PlTableFilters/PlTableFiltersV2.vue2.js +72 -68
  252. package/dist/components/PlTableFilters/PlTableFiltersV2.vue2.js.map +1 -1
  253. package/dist/components/PlTableFilters/index.js +1 -1
  254. package/dist/components/PlTableFilters/suggest-source.js +1 -2
  255. package/dist/components/PlTableFilters/suggest-source.js.map +1 -1
  256. package/dist/composition/AgGrid/index.js +1 -2
  257. package/dist/composition/AgGrid/index.js.map +1 -1
  258. package/dist/composition/fileContent.js +9 -5
  259. package/dist/composition/fileContent.js.map +1 -1
  260. package/dist/composition/usePlugin.js +1 -2
  261. package/dist/composition/usePlugin.js.map +1 -1
  262. package/dist/computedResult.js +1 -2
  263. package/dist/computedResult.js.map +1 -1
  264. package/dist/createModel.js +8 -7
  265. package/dist/createModel.js.map +1 -1
  266. package/dist/defineApp.js +5 -3
  267. package/dist/defineApp.js.map +1 -1
  268. package/dist/defineStore.js +1 -2
  269. package/dist/defineStore.js.map +1 -1
  270. package/dist/index.js +1 -2
  271. package/dist/index.js.map +1 -1
  272. package/dist/internal/UpdateSerializer.js +2 -2
  273. package/dist/internal/UpdateSerializer.js.map +1 -1
  274. package/dist/internal/createAppV3.js +2 -3
  275. package/dist/internal/createAppV3.js.map +1 -1
  276. package/dist/internal/getServices.js +4 -5
  277. package/dist/internal/getServices.js.map +1 -1
  278. package/dist/internal/service_factories.js +1 -2
  279. package/dist/internal/service_factories.js.map +1 -1
  280. package/dist/internal/utils.js +1 -2
  281. package/dist/internal/utils.js.map +1 -1
  282. package/dist/lib/util/helpers/dist/functions.js +1 -2
  283. package/dist/lib/util/helpers/dist/functions.js.map +1 -1
  284. package/dist/lib/util/helpers/dist/hash.js +0 -1
  285. package/dist/lib/util/helpers/dist/hash.js.map +1 -1
  286. package/dist/lib/util/helpers/dist/index.js +7 -6
  287. package/dist/lib/util/helpers/dist/objects.js +7 -6
  288. package/dist/lib/util/helpers/dist/objects.js.map +1 -1
  289. package/dist/lib/util/helpers/dist/prettyBytes.js +1 -2
  290. package/dist/lib/util/helpers/dist/prettyBytes.js.map +1 -1
  291. package/dist/lib/util/helpers/dist/random.js +1 -2
  292. package/dist/lib/util/helpers/dist/random.js.map +1 -1
  293. package/dist/lib/util/helpers/dist/strings.js +1 -2
  294. package/dist/lib/util/helpers/dist/strings.js.map +1 -1
  295. package/dist/lib/util/helpers/dist/uniqId.js +1 -2
  296. package/dist/lib/util/helpers/dist/uniqId.js.map +1 -1
  297. package/dist/lib/util/helpers/dist/utils.js +1 -2
  298. package/dist/lib/util/helpers/dist/utils.js.map +1 -1
  299. package/dist/lib.js +38 -38
  300. package/dist/objectHash.js +1 -2
  301. package/dist/objectHash.js.map +1 -1
  302. package/dist/plugins/Monetization/EndOfPeriod.js +1 -2
  303. package/dist/plugins/Monetization/EndOfPeriod.js.map +1 -1
  304. package/dist/plugins/Monetization/EndOfPeriod.style.js +3 -3
  305. package/dist/plugins/Monetization/EndOfPeriod.style.js.map +1 -1
  306. package/dist/plugins/Monetization/EndOfPeriod.vue2.js +2 -3
  307. package/dist/plugins/Monetization/EndOfPeriod.vue2.js.map +1 -1
  308. package/dist/plugins/Monetization/LimitCard.js +1 -2
  309. package/dist/plugins/Monetization/LimitCard.js.map +1 -1
  310. package/dist/plugins/Monetization/LimitCard.style.js +16 -16
  311. package/dist/plugins/Monetization/LimitCard.style.js.map +1 -1
  312. package/dist/plugins/Monetization/LimitCard.vue2.js +3 -4
  313. package/dist/plugins/Monetization/LimitCard.vue2.js.map +1 -1
  314. package/dist/plugins/Monetization/MonetizationSidebar.js +1 -2
  315. package/dist/plugins/Monetization/MonetizationSidebar.js.map +1 -1
  316. package/dist/plugins/Monetization/MonetizationSidebar.vue2.js +2 -3
  317. package/dist/plugins/Monetization/MonetizationSidebar.vue2.js.map +1 -1
  318. package/dist/plugins/Monetization/RunStatus.js +1 -2
  319. package/dist/plugins/Monetization/RunStatus.js.map +1 -1
  320. package/dist/plugins/Monetization/RunStatus.style.js +9 -9
  321. package/dist/plugins/Monetization/RunStatus.style.js.map +1 -1
  322. package/dist/plugins/Monetization/RunStatus.vue2.js +2 -3
  323. package/dist/plugins/Monetization/RunStatus.vue2.js.map +1 -1
  324. package/dist/plugins/Monetization/UserCabinetCard.js +1 -2
  325. package/dist/plugins/Monetization/UserCabinetCard.js.map +1 -1
  326. package/dist/plugins/Monetization/UserCabinetCard.style.js +10 -10
  327. package/dist/plugins/Monetization/UserCabinetCard.style.js.map +1 -1
  328. package/dist/plugins/Monetization/UserCabinetCard.vue2.js +2 -3
  329. package/dist/plugins/Monetization/UserCabinetCard.vue2.js.map +1 -1
  330. package/dist/plugins/Monetization/index.js +1 -1
  331. package/dist/plugins/Monetization/useButtonTarget.js +2 -7
  332. package/dist/plugins/Monetization/useButtonTarget.js.map +1 -1
  333. package/dist/plugins/Monetization/useInfo.js +1 -2
  334. package/dist/plugins/Monetization/useInfo.js.map +1 -1
  335. package/dist/plugins/Monetization/validation.js +2 -3
  336. package/dist/plugins/Monetization/validation.js.map +1 -1
  337. package/dist/urls.js +1 -2
  338. package/dist/urls.js.map +1 -1
  339. package/dist/utils.js +2 -2
  340. package/dist/utils.js.map +1 -1
  341. package/package.json +25 -21
  342. package/src/components/PlAdvancedFilter/FilterEditor.test.ts +1 -1
  343. package/src/components/PlAdvancedFilter/FilterEditor.vue +15 -8
  344. package/src/components/PlAdvancedFilter/types.ts +2 -0
  345. package/src/components/PlAgColumnHeader/PlAgColumnHeader.vue +7 -5
  346. package/src/components/PlAgColumnHeader/types.ts +2 -0
  347. package/src/components/PlAgDataTable/PlAgDataTableSheets.vue +1 -1
  348. package/src/components/PlAgDataTable/PlAgDataTableV2.vue +1 -0
  349. package/src/components/PlAgDataTable/sources/table-source-v2.ts +17 -2
  350. package/src/components/PlAgDataTable/sources/table-state-v2.test.ts +1 -1
  351. package/src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue +21 -13
  352. package/src/components/PlTableFilters/PlTableFiltersV2.vue +8 -1
  353. package/dist/_virtual/_rolldown/runtime.js +0 -17
  354. /package/dist/components/{BlockLayout.vue.css → BlockLayout.style.css} +0 -0
  355. /package/dist/components/PlAdvancedFilter/{FilterEditor.vue.css → FilterEditor.style.css} +0 -0
  356. /package/dist/components/PlAdvancedFilter/{OperandButton.vue.css → OperandButton.style.css} +0 -0
  357. /package/dist/components/PlAdvancedFilter/{PlAdvancedFilter.vue.css → PlAdvancedFilter.style.css} +0 -0
  358. /package/dist/components/PlAgDataTable/{PlAgDataTableSheets.vue.css → PlAgDataTableSheets.style.css} +0 -0
  359. /package/dist/components/PlAgDataTable/{PlAgDataTableV2.vue.css → PlAgDataTableV2.style.css} +0 -0
  360. /package/dist/components/PlAgGridColumnManager/{PlAgGridColumnManager.vue.css → PlAgGridColumnManager.style.css} +0 -0
  361. /package/dist/components/PlAnnotations/components/{AnnotationsSidebar.vue.css → AnnotationsSidebar.style.css} +0 -0
  362. /package/dist/components/PlAnnotations/components/{FilterSidebar.vue.css → FilterSidebar.style.css} +0 -0
  363. /package/dist/components/PlAnnotations/components/{PlAnnotations.vue.css → PlAnnotations.style.css} +0 -0
  364. /package/dist/components/PlAnnotations/components/{PlAnnotationsModal.vue.css → PlAnnotationsModal.style.css} +0 -0
  365. /package/dist/components/PlBtnExportArchive/{Item.vue.css → Item.style.css} +0 -0
  366. /package/dist/components/PlBtnExportArchive/{PlBtnExportArchive.vue.css → PlBtnExportArchive.style.css} +0 -0
  367. /package/dist/components/PlBtnExportArchive/{Summary.vue.css → Summary.style.css} +0 -0
  368. /package/dist/components/PlTableFilters/{PlTableFiltersV2.vue.css → PlTableFiltersV2.style.css} +0 -0
  369. /package/dist/plugins/Monetization/{EndOfPeriod.vue.css → EndOfPeriod.style.css} +0 -0
  370. /package/dist/plugins/Monetization/{LimitCard.vue.css → LimitCard.style.css} +0 -0
  371. /package/dist/plugins/Monetization/{RunStatus.vue.css → RunStatus.style.css} +0 -0
  372. /package/dist/plugins/Monetization/{UserCabinetCard.vue.css → UserCabinetCard.style.css} +0 -0
@@ -1,122 +1,127 @@
1
- import e from "../PlAdvancedFilter/PlAdvancedFilter.js";
1
+ import { effectiveLinkHint as e } from "../PlAgDataTable/sources/table-source-v2.js";
2
+ import t from "../PlAdvancedFilter/PlAdvancedFilter.js";
2
3
  import "../PlAdvancedFilter/index.js";
3
- import { TABLE_FILTER_TYPES as t, resolveSuggestSource as n } from "./suggest-source.js";
4
- import { Fragment as r, Teleport as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, openBlock as m, ref as h, unref as g, withCtx as _, withModifiers as v } from "vue";
5
- import { Annotation as y, Domain as b, deriveDistinctLabels as x, getPTableColumnId as S, getUniqueAxisValuesWithLabels as C, getUniqueSourceValuesWithLabels as w, readAnnotation as T, readDomain as E } from "@platforma-sdk/model";
6
- import { isFunction as D, isNil as O } from "es-toolkit";
7
- import { PlBtnGhost as k, PlSlideModal as A, usePlBlockPageTitleTeleportTarget as j } from "@milaboratories/uikit";
8
- //#region src/components/PlTableFilters/PlTableFiltersV2.vue?vue&type=script&setup=true&lang.ts
9
- var M = {
4
+ import { TABLE_FILTER_TYPES as n, resolveSuggestSource as r } from "./suggest-source.js";
5
+ import { Fragment as i, Teleport as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, normalizeClass as m, openBlock as h, ref as g, unref as _, withCtx as v, withModifiers as y } from "vue";
6
+ import { Annotation as b, Domain as x, deriveDistinctLabels as S, getPTableColumnId as C, getUniqueAxisValuesWithLabels as w, getUniqueSourceValuesWithLabels as T, peerLinkedLast as E, readAnnotation as D, readDomain as O } from "@platforma-sdk/model";
7
+ import { isFunction as k, isNil as A } from "es-toolkit";
8
+ import { PlBtnGhost as j, PlSlideModal as M, usePlBlockPageTitleTeleportTarget as N } from "@milaboratories/uikit";
9
+ // src/components/PlTableFilters/PlTableFiltersV2.vue?vue&type=script&setup=true&lang.ts
10
+ var P = {
10
11
  key: 1,
11
12
  "data-testid": "pl-table-filters-custom-group-title"
12
- }, N = /* @__PURE__ */ f({
13
+ }, F = /*@__PURE__*/ p({
13
14
  __name: "PlTableFiltersV2",
14
15
  props: {
15
16
  columns: {},
16
17
  pframeHandle: {},
18
+ columnsMeta: {},
17
19
  filters: {},
18
20
  defaultFilters: {},
19
21
  onUpdateFilters: { type: Function },
20
22
  onResetDefaultFilters: { type: Function },
21
23
  onUpdateDefaultFilters: { type: Function }
22
24
  },
23
- setup(f) {
24
- let N = f, P = j("PlTableFiltersV2"), F = h(!1), I = a(() => N.filters.filters.length > 0), L = a(() => !O(N.defaultFilters) && N.defaultFilters.filters.length > 0), R = a(() => O(N.defaultFilters) || N.defaultFilters?.filters.length === 0 ? N.filters : {
25
- ...N.filters,
26
- filters: [...N.defaultFilters?.filters ?? [], ...N.filters.filters]
27
- }), z = (e) => {
25
+ setup(p) {
26
+ let F = p, I = N("PlTableFiltersV2"), L = g(!1), R = o(() => F.filters.filters.length > 0), z = o(() => !A(F.defaultFilters) && F.defaultFilters.filters.length > 0), B = o(() => A(F.defaultFilters) || F.defaultFilters?.filters.length === 0 ? F.filters : {
27
+ ...F.filters,
28
+ filters: [...F.defaultFilters?.filters ?? [], ...F.filters.filters]
29
+ }), V = (e) => {
28
30
  let t = e;
29
- if (O(N.defaultFilters)) return N.onUpdateFilters(t);
31
+ if (A(F.defaultFilters)) return F.onUpdateFilters(t);
30
32
  let [n, ...r] = t.filters;
31
- N.onUpdateFilters({
33
+ F.onUpdateFilters({
32
34
  ...t,
33
35
  filters: r
34
- }), N.onUpdateDefaultFilters?.({
35
- ...N.defaultFilters,
36
+ }), F.onUpdateDefaultFilters?.({
37
+ ...F.defaultFilters,
36
38
  filters: [n]
37
39
  });
38
- }, B = a(() => {
39
- let e = [];
40
- N.columns.forEach((t, n) => {
41
- t.type === "column" && e.push({
40
+ }, H = o(() => {
41
+ let t = [];
42
+ F.columns.forEach((e, n) => {
43
+ e.type === "column" && t.push({
42
44
  idx: n,
43
- spec: t.spec
45
+ spec: e.spec
44
46
  });
45
47
  });
46
- let t = /* @__PURE__ */ new Map();
47
- return x(e.map((e) => e.spec), {}).forEach((n, r) => t.set(e[r].idx, n)), N.columns.map((e, n) => {
48
- let r = S(e), i = t.get(n)?.trim() || T(e.spec, y.Label)?.trim() || `Unlabeled ${e.type} ${n}`, a = E(e.spec, b.Alphabet) ?? T(e.spec, y.Alphabet);
48
+ let n = /* @__PURE__ */ new Map();
49
+ S(t.map((e) => e.spec), {}).forEach((e, r) => n.set(t[r].idx, e));
50
+ let r = F.columns.map((t, r) => {
51
+ let i = C(t), a = n.get(r)?.trim() || D(t.spec, b.Label)?.trim() || `Unlabeled ${t.type} ${r}`, o = O(t.spec, x.Alphabet) ?? D(t.spec, b.Alphabet);
49
52
  return {
50
- id: r,
51
- label: i,
52
- spec: e.spec,
53
- alphabet: a ?? void 0
53
+ id: i,
54
+ label: a,
55
+ linkHint: e(t, F.columnsMeta),
56
+ spec: t.spec,
57
+ alphabet: o ?? void 0
54
58
  };
55
59
  });
56
- }), V = t;
57
- function H(e) {
58
- if (O(N.pframeHandle)) return console.warn("PFrame handle is not available, cannot fetch suggest options"), [];
60
+ return E(r, (e) => e.linkHint !== void 0);
61
+ }), U = n;
62
+ function W(e) {
63
+ if (A(F.pframeHandle)) return console.warn("PFrame handle is not available, cannot fetch suggest options"), [];
59
64
  let t = e.columnId;
60
65
  if (typeof t != "object" || !t) throw Error("ColumnId should be a table column id for suggest options");
61
- let r = {
66
+ let n = {
62
67
  limit: 100,
63
68
  searchQuery: e.searchType === "label" ? e.searchStr : void 0,
64
69
  searchQueryValue: e.searchType === "value" ? e.searchStr : void 0
65
- }, i = n(N.columns, t, e.axisIdx);
66
- return (i.type === "column" ? w(N.pframeHandle, {
70
+ }, i = r(F.columns, t, e.axisIdx);
71
+ return (i.type === "column" ? T(F.pframeHandle, {
67
72
  columnId: i.columnId,
68
73
  axisIdx: i.axisIdx,
69
- ...r
70
- }) : C(N.pframeHandle, {
74
+ ...n
75
+ }) : w(F.pframeHandle, {
71
76
  axisSpec: i.axisSpec,
72
77
  parentColumnIds: i.parentColumnIds,
73
- ...r
78
+ ...n
74
79
  })).then((e) => e.values);
75
80
  }
76
- return (t, n) => (m(), c(r, null, [g(P) ? (m(), o(i, {
81
+ return (e, n) => (h(), l(i, null, [_(I) ? (h(), s(a, {
77
82
  key: 0,
78
- to: g(P)
79
- }, [d(g(k), {
83
+ to: _(I)
84
+ }, [f(_(j), {
80
85
  "data-testid": "pl-table-filters",
81
- icon: I.value || L.value ? "filter-on" : "filter",
82
- onClick: n[0] ||= v((e) => F.value = !0, ["stop"])
86
+ icon: R.value || z.value ? "filter-on" : "filter",
87
+ onClick: n[0] ||= y((e) => L.value = !0, ["stop"])
83
88
  }, {
84
- default: _(() => [...n[3] ||= [u(" Filters ", -1)]]),
89
+ default: v(() => [...n[3] ||= [d(" Filters ", -1)]]),
85
90
  _: 1
86
- }, 8, ["icon"])], 8, ["to"])) : s("", !0), d(g(A), {
87
- modelValue: F.value,
88
- "onUpdate:modelValue": n[2] ||= (e) => F.value = e,
91
+ }, 8, ["icon"])], 8, ["to"])) : c("", !0), f(_(M), {
92
+ modelValue: L.value,
93
+ "onUpdate:modelValue": n[2] ||= (e) => L.value = e,
89
94
  "data-testid": "pl-table-filters-panel",
90
95
  "close-on-outside-click": !1
91
96
  }, {
92
- title: _(() => [...n[4] ||= [u("Manage Filters", -1)]]),
93
- default: _(() => [l("div", {
97
+ title: v(() => [...n[4] ||= [d("Manage Filters", -1)]]),
98
+ default: v(() => [u("div", {
94
99
  "data-testid": "pl-table-filters-content",
95
- class: p(t.$style.root)
96
- }, [d(g(e), {
97
- filters: R.value,
98
- options: B.value,
99
- "supported-filters": g(V),
100
- "get-suggest-options": H,
101
- "is-pinned": (e, t) => L.value && t === 0,
102
- "is-removable": (e, t) => L.value ? t > 0 : !0,
103
- "is-draggable": (e, t) => L.value ? t > 0 : !0,
100
+ class: m(e.$style.root)
101
+ }, [f(_(t), {
102
+ filters: B.value,
103
+ options: H.value,
104
+ "supported-filters": _(U),
105
+ "get-suggest-options": W,
106
+ "is-pinned": (e, t) => z.value && t === 0,
107
+ "is-removable": (e, t) => !z.value || t > 0,
108
+ "is-draggable": (e, t) => !z.value || t > 0,
104
109
  "enable-dnd": !1,
105
110
  "enable-toggling": !0,
106
111
  "enable-add-group-button": !0,
107
- onUpdateFilters: z
112
+ onUpdateFilters: V
108
113
  }, {
109
- "group-title": _(({ index: e }) => [L.value && e === 0 ? (m(), c("div", {
114
+ "group-title": v(({ index: t }) => [z.value && t === 0 ? (h(), l("div", {
110
115
  key: 0,
111
116
  "data-testid": "pl-table-filters-default-group-title",
112
- class: p(t.$style.defaultGroupTitle)
113
- }, [n[5] ||= u(" Default Group ", -1), g(D)(N.onResetDefaultFilters) ? (m(), o(g(k), {
117
+ class: m(e.$style.defaultGroupTitle)
118
+ }, [n[5] ||= d(" Default Group ", -1), _(k)(F.onResetDefaultFilters) ? (h(), s(_(j), {
114
119
  key: 0,
115
120
  "data-testid": "pl-table-filters-reset-default",
116
121
  icon: "restart",
117
- class: p(t.$style.restartBtn),
118
- onClick: n[1] ||= v((e) => N.onResetDefaultFilters(), ["stop"])
119
- }, null, 8, ["class"])) : s("", !0)], 2)) : (m(), c("div", M, "Custom Group"))]),
122
+ class: m(e.$style.restartBtn),
123
+ onClick: n[1] ||= y((e) => F.onResetDefaultFilters(), ["stop"])
124
+ }, null, 8, ["class"])) : c("", !0)], 2)) : (h(), l("div", P, "Custom Group"))]),
120
125
  _: 1
121
126
  }, 8, [
122
127
  "filters",
@@ -130,7 +135,6 @@ var M = {
130
135
  }, 8, ["modelValue"])], 64));
131
136
  }
132
137
  });
133
- //#endregion
134
- export { N as default };
138
+ export { F as default };
135
139
 
136
140
  //# sourceMappingURL=PlTableFiltersV2.vue2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlTableFiltersV2.vue_vue_type_script_setup_true_lang.js","names":["$style"],"sources":["../../../src/components/PlTableFilters/PlTableFiltersV2.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n PTableColumnSpec,\n PlDataTableFiltersWithMeta,\n PFrameHandle,\n PTableColumnId,\n PColumnSpec,\n} from \"@platforma-sdk/model\";\nimport {\n Annotation,\n Domain,\n readAnnotation,\n readDomain,\n getUniqueAxisValuesWithLabels,\n getUniqueSourceValuesWithLabels,\n getPTableColumnId,\n deriveDistinctLabels,\n} from \"@platforma-sdk/model\";\nimport { computed, ref } from \"vue\";\nimport { PlBtnGhost, PlSlideModal, usePlBlockPageTitleTeleportTarget } from \"@milaboratories/uikit\";\nimport {\n PlAdvancedFilter,\n PlAdvancedFilterComponent,\n type PlAdvancedFilterItem,\n} from \"../PlAdvancedFilter\";\nimport type { PlAdvancedFilterColumnId } from \"../PlAdvancedFilter/types\";\nimport type { Nil } from \"@milaboratories/helpers\";\nimport { isFunction, isNil } from \"es-toolkit\";\nimport { resolveSuggestSource, TABLE_FILTER_TYPES } from \"./suggest-source\";\n\nconst props = defineProps<{\n columns: PTableColumnSpec[];\n pframeHandle: Nil | PFrameHandle;\n filters: PlDataTableFiltersWithMeta;\n defaultFilters: Nil | PlDataTableFiltersWithMeta;\n onUpdateFilters: (value: PlDataTableFiltersWithMeta) => void;\n onResetDefaultFilters?: () => void;\n onUpdateDefaultFilters?: (value: PlDataTableFiltersWithMeta) => void;\n}>();\n\nconst teleportTarget = usePlBlockPageTitleTeleportTarget(\"PlTableFiltersV2\");\nconst showManager = ref(false);\nconst hasFilters = computed(() => props.filters.filters.length > 0);\nconst hasDefaultFilters = computed(\n () => !isNil(props.defaultFilters) && props.defaultFilters.filters.length > 0,\n);\nconst filters = computed<PlDataTableFiltersWithMeta>(() => {\n if (isNil(props.defaultFilters) || props.defaultFilters?.filters.length === 0) {\n return props.filters;\n }\n\n return {\n ...props.filters,\n filters: [...(props.defaultFilters?.filters ?? []), ...props.filters.filters],\n };\n});\nconst onUpdateFilters = (_value: PlAdvancedFilter) => {\n const value = _value as PlDataTableFiltersWithMeta;\n\n if (isNil(props.defaultFilters)) {\n return props.onUpdateFilters(value);\n }\n\n const [defaults, ...rest] = value.filters;\n props.onUpdateFilters({ ...value, filters: rest });\n props.onUpdateDefaultFilters?.({ ...props.defaultFilters, filters: [defaults] });\n};\n\nconst options = computed<PlAdvancedFilterItem[]>(() => {\n const columnEntries: { idx: number; spec: PColumnSpec }[] = [];\n props.columns.forEach((col, idx) => {\n if (col.type === \"column\") columnEntries.push({ idx, spec: col.spec });\n });\n const distinctLabelByIdx = new Map<number, string>();\n deriveDistinctLabels(\n columnEntries.map((e) => e.spec),\n {},\n ).forEach((label, i) => distinctLabelByIdx.set(columnEntries[i].idx, label));\n\n return props.columns.map((col, idx) => {\n const id = getPTableColumnId(col);\n const label =\n distinctLabelByIdx.get(idx)?.trim() ||\n readAnnotation(col.spec, Annotation.Label)?.trim() ||\n `Unlabeled ${col.type} ${idx}`;\n const alphabet =\n readDomain(col.spec, Domain.Alphabet) ?? readAnnotation(col.spec, Annotation.Alphabet);\n return {\n id,\n label,\n spec: col.spec,\n alphabet: alphabet ?? undefined,\n };\n });\n});\n\nconst supportedFilters = TABLE_FILTER_TYPES;\n\n// getSuggestOptions - provide discrete values from column annotations\nfunction handleSuggestOptions(params: {\n columnId: PlAdvancedFilterColumnId;\n axisIdx?: number;\n searchStr: string;\n searchType: \"value\" | \"label\";\n}) {\n if (isNil(props.pframeHandle)) {\n console.warn(\"PFrame handle is not available, cannot fetch suggest options\");\n return [];\n }\n\n const tableColumnId = params.columnId as PTableColumnId;\n if (typeof tableColumnId !== \"object\" || tableColumnId === null) {\n throw new Error(\"ColumnId should be a table column id for suggest options\");\n }\n\n const search = {\n limit: 100,\n searchQuery: params.searchType === \"label\" ? params.searchStr : undefined,\n searchQueryValue: params.searchType === \"value\" ? params.searchStr : undefined,\n };\n const source = resolveSuggestSource(props.columns, tableColumnId, params.axisIdx);\n const response =\n source.type === \"column\"\n ? getUniqueSourceValuesWithLabels(props.pframeHandle, {\n columnId: source.columnId,\n axisIdx: source.axisIdx,\n ...search,\n })\n : getUniqueAxisValuesWithLabels(props.pframeHandle, {\n axisSpec: source.axisSpec,\n parentColumnIds: source.parentColumnIds,\n ...search,\n });\n return response.then((v) => v.values);\n}\n</script>\n\n<template>\n <Teleport v-if=\"teleportTarget\" :to=\"teleportTarget\">\n <PlBtnGhost\n data-testid=\"pl-table-filters\"\n :icon=\"hasFilters || hasDefaultFilters ? 'filter-on' : 'filter'\"\n @click.stop=\"showManager = true\"\n >\n Filters\n </PlBtnGhost>\n </Teleport>\n\n <PlSlideModal\n v-model=\"showManager\"\n data-testid=\"pl-table-filters-panel\"\n :close-on-outside-click=\"false\"\n >\n <template #title>Manage Filters</template>\n\n <div data-testid=\"pl-table-filters-content\" :class=\"$style.root\">\n <PlAdvancedFilterComponent\n :filters=\"filters as PlAdvancedFilter\"\n :options=\"options\"\n :supported-filters=\"supportedFilters\"\n :get-suggest-options=\"handleSuggestOptions\"\n :is-pinned=\"(_, index) => hasDefaultFilters && index === 0\"\n :is-removable=\"(_, index) => (hasDefaultFilters ? index > 0 : true)\"\n :is-draggable=\"(_, index) => (hasDefaultFilters ? index > 0 : true)\"\n :enable-dnd=\"false\"\n :enable-toggling=\"true\"\n :enable-add-group-button=\"true\"\n @update-filters=\"onUpdateFilters\"\n >\n <template #group-title=\"{ index }\">\n <div\n v-if=\"hasDefaultFilters && index === 0\"\n data-testid=\"pl-table-filters-default-group-title\"\n :class=\"$style.defaultGroupTitle\"\n >\n Default Group\n <PlBtnGhost\n v-if=\"isFunction(props.onResetDefaultFilters)\"\n data-testid=\"pl-table-filters-reset-default\"\n icon=\"restart\"\n :class=\"$style.restartBtn\"\n @click.stop=\"props.onResetDefaultFilters()\"\n />\n </div>\n <div v-else data-testid=\"pl-table-filters-custom-group-title\">Custom Group</div>\n </template>\n </PlAdvancedFilterComponent>\n </div>\n </PlSlideModal>\n</template>\n\n<style module>\n.root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n.defaultGroupTitle {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n.restartBtn {\n width: 24px;\n height: 24px;\n padding: 4px;\n --button-width: 24px;\n --btn-min-width: 24px;\n --button-height: 24px;\n --btn-min-height: 24x;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EA8BA,IAAM,IAAQ,GAUR,IAAiB,EAAkC,mBAAmB,EACtE,IAAc,EAAI,GAAM,EACxB,IAAa,QAAe,EAAM,QAAQ,QAAQ,SAAS,EAAE,EAC7D,IAAoB,QAClB,CAAC,EAAM,EAAM,eAAe,IAAI,EAAM,eAAe,QAAQ,SAAS,EAC7E,EACK,IAAU,QACV,EAAM,EAAM,eAAe,IAAI,EAAM,gBAAgB,QAAQ,WAAW,IACnE,EAAM,UAGR;GACL,GAAG,EAAM;GACT,SAAS,CAAC,GAAI,EAAM,gBAAgB,WAAW,EAAE,EAAG,GAAG,EAAM,QAAQ,QAAQ;GAC9E,CACD,EACI,KAAmB,MAA6B;GACpD,IAAM,IAAQ;AAEd,OAAI,EAAM,EAAM,eAAe,CAC7B,QAAO,EAAM,gBAAgB,EAAM;GAGrC,IAAM,CAAC,GAAU,GAAG,KAAQ,EAAM;AAElC,GADA,EAAM,gBAAgB;IAAE,GAAG;IAAO,SAAS;IAAM,CAAC,EAClD,EAAM,yBAAyB;IAAE,GAAG,EAAM;IAAgB,SAAS,CAAC,EAAS;IAAE,CAAC;KAG5E,IAAU,QAAuC;GACrD,IAAM,IAAsD,EAAE;AAC9D,KAAM,QAAQ,SAAS,GAAK,MAAQ;A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AAA,CAAA;sDAG5C,EAAgF,OAAhF,GAA8D,eAAY,EAAA,CAAA"}
1
+ {"version":3,"file":"PlTableFiltersV2.vue_vue_type_script_setup_true_lang.js","names":["$style","_openBlock","_createElementBlock","_Fragment","_unref","_createBlock","_Teleport","_createVNode","_withModifiers","_withCtx","_createTextVNode","_createCommentVNode","_createElementVNode","_normalizeClass","PlAdvancedFilterComponent","PlAdvancedFilter_default","_hoisted_1","PlTableFiltersV2_vue_vue_type_script_setup_true_lang_default","props","__props","teleportTarget","usePlBlockPageTitleTeleportTarget","showManager","ref","hasFilters","computed","hasDefaultFilters","isNil","filters","onUpdateFilters","value","_value","defaults","rest","options","columnEntries","col","distinctLabelByIdx","i","label","items","id","getPTableColumnId","idx","readAnnotation","Annotation","alphabet","readDomain","Domain","effectiveLinkHint","peerLinkedLast","item","supportedFilters","TABLE_FILTER_TYPES","handleSuggestOptions","tableColumnId","params","search","source","resolveSuggestSource","getUniqueSourceValuesWithLabels","getUniqueAxisValuesWithLabels","v","openBlock","createElementBlock","Fragment","unref","createBlock","Teleport","createVNode","PlBtnGhost","_cache","withModifiers","withCtx","createTextVNode","createCommentVNode","PlSlideModal","$event","createElementVNode","normalizeClass","_ctx","index","isFunction"],"sources":["../../../src/components/PlTableFilters/PlTableFiltersV2.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n PTableColumnSpec,\n PlDataTableFiltersWithMeta,\n PFrameHandle,\n PTableColumnId,\n PColumnSpec,\n PlDataTableColumnsMeta,\n} from \"@platforma-sdk/model\";\nimport {\n Annotation,\n Domain,\n readAnnotation,\n readDomain,\n getUniqueAxisValuesWithLabels,\n getUniqueSourceValuesWithLabels,\n getPTableColumnId,\n deriveDistinctLabels,\n peerLinkedLast,\n} from \"@platforma-sdk/model\";\nimport { computed, ref } from \"vue\";\nimport { PlBtnGhost, PlSlideModal, usePlBlockPageTitleTeleportTarget } from \"@milaboratories/uikit\";\nimport {\n PlAdvancedFilter,\n PlAdvancedFilterComponent,\n type PlAdvancedFilterItem,\n} from \"../PlAdvancedFilter\";\nimport type { PlAdvancedFilterColumnId } from \"../PlAdvancedFilter/types\";\nimport type { Nil } from \"@milaboratories/helpers\";\nimport { isFunction, isNil } from \"es-toolkit\";\nimport { resolveSuggestSource, TABLE_FILTER_TYPES } from \"./suggest-source\";\nimport { effectiveLinkHint } from \"../PlAgDataTable/sources/table-source-v2\";\n\nconst props = defineProps<{\n columns: PTableColumnSpec[];\n pframeHandle: Nil | PFrameHandle;\n columnsMeta?: PlDataTableColumnsMeta;\n filters: PlDataTableFiltersWithMeta;\n defaultFilters: Nil | PlDataTableFiltersWithMeta;\n onUpdateFilters: (value: PlDataTableFiltersWithMeta) => void;\n onResetDefaultFilters?: () => void;\n onUpdateDefaultFilters?: (value: PlDataTableFiltersWithMeta) => void;\n}>();\n\nconst teleportTarget = usePlBlockPageTitleTeleportTarget(\"PlTableFiltersV2\");\nconst showManager = ref(false);\nconst hasFilters = computed(() => props.filters.filters.length > 0);\nconst hasDefaultFilters = computed(\n () => !isNil(props.defaultFilters) && props.defaultFilters.filters.length > 0,\n);\nconst filters = computed<PlDataTableFiltersWithMeta>(() => {\n if (isNil(props.defaultFilters) || props.defaultFilters?.filters.length === 0) {\n return props.filters;\n }\n\n return {\n ...props.filters,\n filters: [...(props.defaultFilters?.filters ?? []), ...props.filters.filters],\n };\n});\nconst onUpdateFilters = (_value: PlAdvancedFilter) => {\n const value = _value as PlDataTableFiltersWithMeta;\n\n if (isNil(props.defaultFilters)) {\n return props.onUpdateFilters(value);\n }\n\n const [defaults, ...rest] = value.filters;\n props.onUpdateFilters({ ...value, filters: rest });\n props.onUpdateDefaultFilters?.({ ...props.defaultFilters, filters: [defaults] });\n};\n\nconst options = computed<PlAdvancedFilterItem[]>(() => {\n const columnEntries: { idx: number; spec: PColumnSpec }[] = [];\n props.columns.forEach((col, idx) => {\n if (col.type === \"column\") columnEntries.push({ idx, spec: col.spec });\n });\n const distinctLabelByIdx = new Map<number, string>();\n deriveDistinctLabels(\n columnEntries.map((e) => e.spec),\n {},\n ).forEach((label, i) => distinctLabelByIdx.set(columnEntries[i].idx, label));\n\n const items = props.columns.map((col, idx) => {\n const id = getPTableColumnId(col);\n const label =\n distinctLabelByIdx.get(idx)?.trim() ||\n readAnnotation(col.spec, Annotation.Label)?.trim() ||\n `Unlabeled ${col.type} ${idx}`;\n const alphabet =\n readDomain(col.spec, Domain.Alphabet) ?? readAnnotation(col.spec, Annotation.Alphabet);\n return {\n id,\n label,\n linkHint: effectiveLinkHint(col, props.columnsMeta),\n spec: col.spec,\n alphabet: alphabet ?? undefined,\n };\n });\n // Peer-linked columns last, as in the table.\n return peerLinkedLast(items, (item) => item.linkHint !== undefined);\n});\n\nconst supportedFilters = TABLE_FILTER_TYPES;\n\n// getSuggestOptions - provide discrete values from column annotations\nfunction handleSuggestOptions(params: {\n columnId: PlAdvancedFilterColumnId;\n axisIdx?: number;\n searchStr: string;\n searchType: \"value\" | \"label\";\n}) {\n if (isNil(props.pframeHandle)) {\n console.warn(\"PFrame handle is not available, cannot fetch suggest options\");\n return [];\n }\n\n const tableColumnId = params.columnId as PTableColumnId;\n if (typeof tableColumnId !== \"object\" || tableColumnId === null) {\n throw new Error(\"ColumnId should be a table column id for suggest options\");\n }\n\n const search = {\n limit: 100,\n searchQuery: params.searchType === \"label\" ? params.searchStr : undefined,\n searchQueryValue: params.searchType === \"value\" ? params.searchStr : undefined,\n };\n const source = resolveSuggestSource(props.columns, tableColumnId, params.axisIdx);\n const response =\n source.type === \"column\"\n ? getUniqueSourceValuesWithLabels(props.pframeHandle, {\n columnId: source.columnId,\n axisIdx: source.axisIdx,\n ...search,\n })\n : getUniqueAxisValuesWithLabels(props.pframeHandle, {\n axisSpec: source.axisSpec,\n parentColumnIds: source.parentColumnIds,\n ...search,\n });\n return response.then((v) => v.values);\n}\n</script>\n\n<template>\n <Teleport v-if=\"teleportTarget\" :to=\"teleportTarget\">\n <PlBtnGhost\n data-testid=\"pl-table-filters\"\n :icon=\"hasFilters || hasDefaultFilters ? 'filter-on' : 'filter'\"\n @click.stop=\"showManager = true\"\n >\n Filters\n </PlBtnGhost>\n </Teleport>\n\n <PlSlideModal\n v-model=\"showManager\"\n data-testid=\"pl-table-filters-panel\"\n :close-on-outside-click=\"false\"\n >\n <template #title>Manage Filters</template>\n\n <div data-testid=\"pl-table-filters-content\" :class=\"$style.root\">\n <PlAdvancedFilterComponent\n :filters=\"filters as PlAdvancedFilter\"\n :options=\"options\"\n :supported-filters=\"supportedFilters\"\n :get-suggest-options=\"handleSuggestOptions\"\n :is-pinned=\"(_, index) => hasDefaultFilters && index === 0\"\n :is-removable=\"(_, index) => (hasDefaultFilters ? index > 0 : true)\"\n :is-draggable=\"(_, index) => (hasDefaultFilters ? index > 0 : true)\"\n :enable-dnd=\"false\"\n :enable-toggling=\"true\"\n :enable-add-group-button=\"true\"\n @update-filters=\"onUpdateFilters\"\n >\n <template #group-title=\"{ index }\">\n <div\n v-if=\"hasDefaultFilters && index === 0\"\n data-testid=\"pl-table-filters-default-group-title\"\n :class=\"$style.defaultGroupTitle\"\n >\n Default Group\n <PlBtnGhost\n v-if=\"isFunction(props.onResetDefaultFilters)\"\n data-testid=\"pl-table-filters-reset-default\"\n icon=\"restart\"\n :class=\"$style.restartBtn\"\n @click.stop=\"props.onResetDefaultFilters()\"\n />\n </div>\n <div v-else data-testid=\"pl-table-filters-custom-group-title\">Custom Group</div>\n </template>\n </PlAdvancedFilterComponent>\n </div>\n </PlSlideModal>\n</template>\n\n<style module>\n.root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n.defaultGroupTitle {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n.restartBtn {\n width: 24px;\n height: 24px;\n padding: 4px;\n --button-width: 24px;\n --btn-min-width: 24px;\n --button-height: 24px;\n --btn-min-height: 24x;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAiCA,IAAMkB,IAAQC,GAWRC,IAAiBC,EAAkC,kBAAkB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cAAY,E"}
@@ -1 +1 @@
1
- import "./PlTableFiltersV2.js";
1
+ export { default as PlTableFiltersV2 } from "./PlTableFiltersV2.js";
@@ -1,5 +1,5 @@
1
1
  import { canonicalizeAxisId as e, extractPObjectId as t, getAxisId as n } from "@platforma-sdk/model";
2
- //#region src/components/PlTableFilters/suggest-source.ts
2
+ // src/components/PlTableFilters/suggest-source.ts
3
3
  var r = [
4
4
  "isNA",
5
5
  "isNotNA",
@@ -36,7 +36,6 @@ function i(n, r, i) {
36
36
  function a(t, r) {
37
37
  return t.some((t) => e(n(t)) === r);
38
38
  }
39
- //#endregion
40
39
  export { r as TABLE_FILTER_TYPES, i as resolveSuggestSource };
41
40
 
42
41
  //# sourceMappingURL=suggest-source.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"suggest-source.js","names":[],"sources":["../../../src/components/PlTableFilters/suggest-source.ts"],"sourcesContent":["import type { AxisSpec, PObjectId, PTableColumnId, PTableColumnSpec } from \"@platforma-sdk/model\";\nimport { canonicalizeAxisId, extractPObjectId, getAxisId } from \"@platforma-sdk/model\";\nimport type { SupportedFilterTypes } from \"../PlAdvancedFilter/types\";\n\n/** Predicates the table filter offers (same set as FilterSidebar, plus list membership). */\nexport const TABLE_FILTER_TYPES: SupportedFilterTypes[] = [\n \"isNA\",\n \"isNotNA\",\n \"greaterThan\",\n \"greaterThanOrEqual\",\n \"lessThan\",\n \"lessThanOrEqual\",\n \"patternEquals\",\n \"patternNotEquals\",\n \"patternContainSubsequence\",\n \"patternNotContainSubsequence\",\n \"patternMatchesRegularExpression\",\n \"patternFuzzyContainSubsequence\",\n \"equal\",\n \"notEqual\",\n \"inSet\",\n \"notInSet\",\n];\n\n/** Where value suggestions for a filtered table column come from. */\nexport type SuggestSource =\n | { type: \"column\"; columnId: PObjectId; axisIdx: undefined | number }\n | { type: \"axis\"; axisSpec: AxisSpec; parentColumnIds: PObjectId[] };\n\n/**\n * A data column suggests its own values. An axis suggests the keys of every\n * table column carrying it: a full join can hold keys that only some of those\n * columns have, and the user can filter by any of them.\n */\nexport function resolveSuggestSource(\n columns: PTableColumnSpec[],\n tableColumnId: PTableColumnId,\n axisIdx: undefined | number,\n): SuggestSource {\n if (tableColumnId.type === \"column\") {\n return { type: \"column\", columnId: extractPObjectId(tableColumnId.id), axisIdx };\n }\n\n const strAxisId = canonicalizeAxisId(tableColumnId.id);\n let axisSpec: undefined | AxisSpec;\n const parentColumnIds = new Set<PObjectId>();\n for (const col of columns) {\n if (col.type === \"axis\") {\n if (canonicalizeAxisId(col.id) === strAxisId) axisSpec = col.spec;\n } else if (carriesAxis(col.spec.axesSpec, strAxisId)) {\n parentColumnIds.add(extractPObjectId(col.id));\n }\n }\n if (axisSpec === undefined || parentColumnIds.size === 0) {\n throw new Error(\n `No column in the table carries axis ${tableColumnId.id.name}, cannot fetch suggest options`,\n );\n }\n return { type: \"axis\", axisSpec, parentColumnIds: [...parentColumnIds] };\n}\n\n// Internals\n\nfunction carriesAxis(axesSpec: AxisSpec[], strAxisId: string): boolean {\n return axesSpec.some((axis) => canonicalizeAxisId(getAxisId(axis)) === strAxisId);\n}\n"],"mappings":";;AAKA,IAAa,IAA6C;CACxD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAYD,SAAgB,EACd,GACA,GACA,GACe;AACf,KAAI,EAAc,SAAS,SACzB,QAAO;EAAE,MAAM;EAAU,UAAU,EAAiB,EAAc,GAAG;EAAE;EAAS;CAGlF,IAAM,IAAY,EAAmB,EAAc,GAAG,EAClD,GACE,oBAAkB,IAAI,KAAgB;AAC5C,MAAK,IAAM,KAAO,EAChB,CAAI,EAAI,SAAS,SACX,EAAmB,EAAI,GAAG,KAAK,MAAW,IAAW,EAAI,QACpD,EAAY,EAAI,KAAK,UAAU,EAAU,IAClD,EAAgB,IAAI,EAAiB,EAAI,GAAG,CAAC;AAGjD,KAAI,MAAa,KAAA,KAAa,EAAgB,SAAS,EACrD,OAAU,MACR,uCAAuC,EAAc,GAAG,KAAK,gCAC9D;AAEH,QAAO;EAAE,MAAM;EAAQ;EAAU,iBAAiB,CAAC,GAAG,EAAgB;EAAE;;AAK1E,SAAS,EAAY,GAAsB,GAA4B;AACrE,QAAO,EAAS,MAAM,MAAS,EAAmB,EAAU,EAAK,CAAC,KAAK,EAAU"}
1
+ {"version":3,"file":"suggest-source.js","names":["TABLE_FILTER_TYPES","resolveSuggestSource","tableColumnId","extractPObjectId","strAxisId","canonicalizeAxisId","axisSpec","parentColumnIds","col","columns","carriesAxis","axesSpec","getAxisId","axis"],"sources":["../../../src/components/PlTableFilters/suggest-source.ts"],"sourcesContent":["import type { AxisSpec, PObjectId, PTableColumnId, PTableColumnSpec } from \"@platforma-sdk/model\";\nimport { canonicalizeAxisId, extractPObjectId, getAxisId } from \"@platforma-sdk/model\";\nimport type { SupportedFilterTypes } from \"../PlAdvancedFilter/types\";\n\n/** Predicates the table filter offers (same set as FilterSidebar, plus list membership). */\nexport const TABLE_FILTER_TYPES: SupportedFilterTypes[] = [\n \"isNA\",\n \"isNotNA\",\n \"greaterThan\",\n \"greaterThanOrEqual\",\n \"lessThan\",\n \"lessThanOrEqual\",\n \"patternEquals\",\n \"patternNotEquals\",\n \"patternContainSubsequence\",\n \"patternNotContainSubsequence\",\n \"patternMatchesRegularExpression\",\n \"patternFuzzyContainSubsequence\",\n \"equal\",\n \"notEqual\",\n \"inSet\",\n \"notInSet\",\n];\n\n/** Where value suggestions for a filtered table column come from. */\nexport type SuggestSource =\n | { type: \"column\"; columnId: PObjectId; axisIdx: undefined | number }\n | { type: \"axis\"; axisSpec: AxisSpec; parentColumnIds: PObjectId[] };\n\n/**\n * A data column suggests its own values. An axis suggests the keys of every\n * table column carrying it: a full join can hold keys that only some of those\n * columns have, and the user can filter by any of them.\n */\nexport function resolveSuggestSource(\n columns: PTableColumnSpec[],\n tableColumnId: PTableColumnId,\n axisIdx: undefined | number,\n): SuggestSource {\n if (tableColumnId.type === \"column\") {\n return { type: \"column\", columnId: extractPObjectId(tableColumnId.id), axisIdx };\n }\n\n const strAxisId = canonicalizeAxisId(tableColumnId.id);\n let axisSpec: undefined | AxisSpec;\n const parentColumnIds = new Set<PObjectId>();\n for (const col of columns) {\n if (col.type === \"axis\") {\n if (canonicalizeAxisId(col.id) === strAxisId) axisSpec = col.spec;\n } else if (carriesAxis(col.spec.axesSpec, strAxisId)) {\n parentColumnIds.add(extractPObjectId(col.id));\n }\n }\n if (axisSpec === undefined || parentColumnIds.size === 0) {\n throw new Error(\n `No column in the table carries axis ${tableColumnId.id.name}, cannot fetch suggest options`,\n );\n }\n return { type: \"axis\", axisSpec, parentColumnIds: [...parentColumnIds] };\n}\n\n// Internals\n\nfunction carriesAxis(axesSpec: AxisSpec[], strAxisId: string): boolean {\n return axesSpec.some((axis) => canonicalizeAxisId(getAxisId(axis)) === strAxisId);\n}\n"],"mappings":";;AAKA,IAAaA,IAA6C;CACxD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAYA,SAAgBC,EACd,GACA,GACA,GACe;CACf,IAAIC,EAAc,SAAS,UACzB,OAAO;EAAE,MAAM;EAAU,UAAUC,EAAiBD,EAAc,EAAE;EAAG;CAAQ;CAGjF,IAAME,IAAYC,EAAmBH,EAAc,EAAE,GACjDI,GACEC,oBAAkB,IAAI,IAAe;CAC3C,KAAK,IAAMC,KAAOC,GAChB,AAAID,EAAI,SAAS,SACXH,EAAmBG,EAAI,EAAE,MAAMJ,MAAW,IAAWI,EAAI,QACpDE,EAAYF,EAAI,KAAK,UAAUJ,CAAS,KACjDG,EAAgB,IAAIJ,EAAiBK,EAAI,EAAE,CAAC;CAGhD,IAAIF,MAAa,KAAA,KAAaC,EAAgB,SAAS,GACrD,MAAU,MACR,uCAAuCL,EAAc,GAAG,KAAK,+BAC/D;CAEF,OAAO;EAAE,MAAM;EAAQ;EAAU,iBAAiB,CAAC,GAAGK,CAAe;CAAE;AACzE;AAIA,SAASG,EAAY,GAAsB,GAA4B;CACrE,OAAOC,EAAS,MAAM,MAASN,EAAmBO,EAAUC,CAAI,CAAC,MAAMT,CAAS;AAClF"}
@@ -1,12 +1,11 @@
1
1
  import { getEnvironmentValue as e } from "@platforma-sdk/model";
2
2
  import { AllEnterpriseModule as t, LicenseManager as n, ModuleRegistry as r } from "ag-grid-enterprise";
3
- //#region src/composition/AgGrid/index.ts
3
+ // src/composition/AgGrid/index.ts
4
4
  function i() {
5
5
  r.registerModules([t]);
6
6
  let i = e("AGGRID_LICENSE");
7
7
  i ? (n.setLicenseKey(i), console.log("AG Grid Activated")) : console.log("AG Grid License not found");
8
8
  }
9
- //#endregion
10
9
  export { i as activateAgGrid };
11
10
 
12
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/composition/AgGrid/index.ts"],"sourcesContent":["import { AllEnterpriseModule, LicenseManager, ModuleRegistry } from \"ag-grid-enterprise\";\nimport { getEnvironmentValue } from \"@platforma-sdk/model\";\n\nexport function activateAgGrid() {\n ModuleRegistry.registerModules([AllEnterpriseModule]);\n const agGridLicense = getEnvironmentValue(\"AGGRID_LICENSE\");\n if (agGridLicense) {\n LicenseManager.setLicenseKey(agGridLicense);\n console.log(\"AG Grid Activated\");\n } else {\n console.log(\"AG Grid License not found\");\n }\n}\n"],"mappings":";;;AAGA,SAAgB,IAAiB;AAC/B,GAAe,gBAAgB,CAAC,EAAoB,CAAC;CACrD,IAAM,IAAgB,EAAoB,iBAAiB;AAC3D,CAAI,KACF,EAAe,cAAc,EAAc,EAC3C,QAAQ,IAAI,oBAAoB,IAEhC,QAAQ,IAAI,4BAA4B"}
1
+ {"version":3,"file":"index.js","names":["activateAgGrid","AllEnterpriseModule","agGridLicense","getEnvironmentValue","LicenseManager"],"sources":["../../../src/composition/AgGrid/index.ts"],"sourcesContent":["import { AllEnterpriseModule, LicenseManager, ModuleRegistry } from \"ag-grid-enterprise\";\nimport { getEnvironmentValue } from \"@platforma-sdk/model\";\n\nexport function activateAgGrid() {\n ModuleRegistry.registerModules([AllEnterpriseModule]);\n const agGridLicense = getEnvironmentValue(\"AGGRID_LICENSE\");\n if (agGridLicense) {\n LicenseManager.setLicenseKey(agGridLicense);\n console.log(\"AG Grid Activated\");\n } else {\n console.log(\"AG Grid License not found\");\n }\n}\n"],"mappings":";;;AAGA,SAAgBA,IAAiB;CAC/B,EAAe,gBAAgB,CAACC,CAAmB,CAAC;CACpD,IAAMC,IAAgBC,EAAoB,gBAAgB;CAC1D,AAAID,KACFE,EAAe,cAAcF,CAAa,GAC1C,QAAQ,IAAI,mBAAmB,KAE/B,QAAQ,IAAI,2BAA2B;AAE3C"}
@@ -3,8 +3,9 @@ import "../lib/util/helpers/dist/index.js";
3
3
  import { computed as t, effectScope as n, getCurrentScope as r, onScopeDispose as i, shallowRef as a } from "vue";
4
4
  import { getRawPlatformaInstance as o } from "@platforma-sdk/model";
5
5
  import { LRUCache as s } from "lru-cache";
6
- //#region src/composition/fileContent.ts
6
+ // src/composition/fileContent.ts
7
7
  var c = { cacheSize: 15e6 }, l = class {
8
+ bytes;
8
9
  _str = void 0;
9
10
  _rawJson = void 0;
10
11
  _zodSchema = void 0;
@@ -29,6 +30,7 @@ var f = new s({
29
30
  maxSize: c.cacheSize,
30
31
  sizeCalculation: (e) => e.bytes.length
31
32
  }), p = new e(), m = class m {
33
+ currentScope;
32
34
  fileDataCache;
33
35
  fetcher;
34
36
  ns = /* @__PURE__ */ new Map();
@@ -90,7 +92,8 @@ var f = new s({
90
92
  let r = a();
91
93
  return t.set(e, r), (async () => {
92
94
  for (let t = 0; t < 8; t++) try {
93
- r.value = await this.doFetch(e);
95
+ let t = await this.doFetch(e);
96
+ r.value = t;
94
97
  return;
95
98
  } catch (e) {
96
99
  console.error(`File download attempt ${t + 1}/8 failed:`, e), t < 7 ? await new Promise((e) => setTimeout(e, 1e3)) : console.error("Failed to download file after 8 attempts");
@@ -119,17 +122,18 @@ var f = new s({
119
122
  }), t;
120
123
  }
121
124
  static use(e, t) {
122
- return new m(this.initScope(t), { ...e });
125
+ let n = this.initScope(t);
126
+ return new m(n, { ...e });
123
127
  }
124
128
  static useGlobal(e, t) {
125
- return new m(this.initScope(t), {
129
+ let n = this.initScope(t);
130
+ return new m(n, {
126
131
  ...e,
127
132
  lruCache: f,
128
133
  fetcher: p
129
134
  });
130
135
  }
131
136
  };
132
- //#endregion
133
137
  export { m as ReactiveFileContent };
134
138
 
135
139
  //# sourceMappingURL=fileContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fileContent.js","names":[],"sources":["../../src/composition/fileContent.ts"],"sourcesContent":["import type { BlobHandleAndSize } from \"@platforma-sdk/model\";\nimport { getRawPlatformaInstance } from \"@platforma-sdk/model\";\nimport { LRUCache } from \"lru-cache\";\nimport type { ComputedRef, ShallowRef, EffectScope } from \"vue\";\nimport { computed, shallowRef, getCurrentScope, onScopeDispose, effectScope } from \"vue\";\nimport type { ZodSchema, SafeParseReturnType } from \"zod\";\nimport { Fetcher } from \"@milaboratories/helpers\";\n\ntype FileHandle = BlobHandleAndSize[\"handle\"];\n\nexport type ReactiveFileContentOps = {\n /** Maximum size in bytes of file content to cache */\n cacheSize: number;\n lruCache?: LRUCache<FileHandle, FileContentData>;\n fetcher?: Fetcher<FileHandle, FileContentData>;\n};\n\nconst DefaultReactiveFileContentOps: ReactiveFileContentOps = {\n cacheSize: 15_000_000, // 15 Mb\n};\n\nclass FileContentData {\n private _str: string | undefined = undefined;\n private _rawJson: unknown | undefined = undefined;\n private _zodSchema: ZodSchema | undefined = undefined;\n private _validatedJson: SafeParseReturnType<unknown, unknown> | undefined = undefined;\n\n constructor(public readonly bytes: Uint8Array) {}\n\n public get str(): string {\n if (this._str === undefined) this._str = new TextDecoder().decode(this.bytes);\n return this._str;\n }\n\n public get rawJson(): unknown {\n if (this._rawJson === undefined) this._rawJson = JSON.parse(this.str);\n return this._rawJson;\n }\n\n public validatedJson<T>(schema: ZodSchema<T>): T | undefined {\n if (this._zodSchema !== schema) {\n this._validatedJson = schema.safeParse(this.rawJson);\n this._zodSchema = schema;\n }\n return this._validatedJson?.success ? (this._validatedJson.data as T) : undefined;\n }\n}\n\nconst scopes = new WeakMap<EffectScope, Map<FileHandle, ShallowRef<FileContentData | undefined>>>();\n\nfunction addScope(scope: EffectScope) {\n scopes.set(scope, new Map<FileHandle, ShallowRef<FileContentData | undefined>>());\n}\n\nconst globalCache = new LRUCache<FileHandle, FileContentData>({\n maxSize: DefaultReactiveFileContentOps.cacheSize,\n sizeCalculation: (value) => value.bytes.length,\n});\n\nconst globalFetcher = new Fetcher<FileHandle, FileContentData>();\n\nexport class ReactiveFileContent {\n private readonly fileDataCache: LRUCache<FileHandle, FileContentData>;\n private readonly fetcher: Fetcher<FileHandle, FileContentData>;\n private ns = new Map<string, Set<FileHandle>>();\n private currentKey: string | undefined;\n\n private constructor(\n private currentScope: EffectScope,\n _ops?: Partial<ReactiveFileContentOps>,\n ) {\n const ops: ReactiveFileContentOps = { ...DefaultReactiveFileContentOps, ..._ops };\n this.fileDataCache =\n ops.lruCache ??\n new LRUCache<FileHandle, FileContentData>({\n maxSize: ops.cacheSize,\n sizeCalculation: (value) => value.bytes.length,\n });\n this.fetcher = ops.fetcher ?? new Fetcher<FileHandle, FileContentData>();\n }\n\n /**\n * Experimental method to invalidate the refs map cache for a given key.\n */\n public withInvalidate<T>(key: string, cb: () => T) {\n const previous = this.ns.get(key);\n this.ns.set(key, new Set());\n this.currentKey = key;\n try {\n const res = cb();\n this.invalidate(key, previous);\n return res;\n } finally {\n this.currentKey = undefined;\n }\n }\n\n public stopScope() {\n scopes.delete(this.currentScope);\n this.currentScope.stop();\n }\n\n private async doFetch(handle: FileHandle) {\n if (!this.fileDataCache.has(handle)) {\n const fileContentData = await this.fetcher.fetch(\n handle,\n async () =>\n new FileContentData(await getRawPlatformaInstance().blobDriver.getContent(handle)),\n );\n this.fileDataCache.set(handle, fileContentData);\n }\n\n return this.fileDataCache.get(handle)!;\n }\n\n private getSize() {\n const refsMap = this.getRefsMap();\n return refsMap ? refsMap.size : 0;\n }\n\n private getRefsMap() {\n return scopes.get(this.currentScope);\n }\n\n private invalidate(key: string, previous: Set<FileHandle> | undefined) {\n if (!previous) {\n return;\n }\n\n const actual = this.ns.get(key)!;\n\n for (const handle of actual) {\n previous.delete(handle);\n }\n\n const map = this.getRefsMap();\n\n for (const handle of previous) {\n map?.delete(handle);\n }\n }\n\n private withHandle(handle: FileHandle) {\n if (this.currentKey) {\n this.ns.get(this.currentKey)?.add(handle);\n }\n }\n\n private getDataRef(handle: FileHandle): ShallowRef<FileContentData | undefined> {\n const refsMap = this.getRefsMap();\n\n if (!refsMap) {\n throw new Error(\"ReactiveFileContent must be used within a Vue component or effect scope.\");\n }\n\n this.withHandle(handle);\n\n const refFromMap = refsMap.get(handle);\n\n if (refFromMap !== undefined) {\n return refFromMap;\n }\n\n const newRef = shallowRef<FileContentData>();\n refsMap.set(handle, newRef);\n\n // Initiating actual fetch from the cache, that will in turn initiate upload\n (async () => {\n const maxRetries = 8;\n const retryDelay = 1000; // 1 second\n\n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n const data = await this.doFetch(handle);\n newRef.value = data;\n return;\n } catch (err: unknown) {\n console.error(`File download attempt ${attempt + 1}/${maxRetries} failed:`, err);\n\n if (attempt < maxRetries - 1) {\n await new Promise((resolve) => setTimeout(resolve, retryDelay));\n } else {\n console.error(`Failed to download file after ${maxRetries} attempts`);\n }\n }\n }\n })();\n\n return newRef;\n }\n\n public getContentBytes(handle: FileHandle): ComputedRef<Uint8Array | undefined>;\n public getContentBytes(\n handle: FileHandle | undefined,\n ): ComputedRef<Uint8Array | undefined> | undefined;\n public getContentBytes(\n handle: FileHandle | undefined,\n ): ComputedRef<Uint8Array | undefined> | undefined {\n if (handle === undefined) return undefined;\n const dataRef = this.getDataRef(handle);\n return computed(() => dataRef.value?.bytes);\n }\n\n public getContentString(handle: FileHandle): ComputedRef<string | undefined>;\n public getContentString(\n handle: FileHandle | undefined,\n ): ComputedRef<string | undefined> | undefined;\n public getContentString(\n handle: FileHandle | undefined,\n ): ComputedRef<string | undefined> | undefined {\n if (handle === undefined) return undefined;\n const dataRef = this.getDataRef(handle);\n return computed(() => dataRef.value?.str);\n }\n\n public getContentJson<T>(handle: FileHandle, schema: ZodSchema<T>): ComputedRef<T | undefined>;\n public getContentJson<T>(\n handle: FileHandle | undefined,\n schema: ZodSchema<T>,\n ): ComputedRef<T | undefined> | undefined;\n public getContentJson<T = unknown>(handle: FileHandle): ComputedRef<T | undefined>;\n public getContentJson<T = unknown>(\n handle: FileHandle | undefined,\n ): ComputedRef<T | undefined> | undefined;\n public getContentJson<T>(\n handle: FileHandle | undefined,\n schema?: ZodSchema<T>,\n ): ComputedRef<T | undefined> | undefined;\n public getContentJson<T>(\n handle: FileHandle | undefined,\n schema?: ZodSchema<T>,\n ): ComputedRef<T | undefined> | undefined {\n if (handle === undefined) return undefined;\n const dataRef = this.getDataRef(handle);\n return computed(\n () =>\n (schema === undefined ? dataRef.value?.rawJson : dataRef.value?.validatedJson(schema)) as T,\n );\n }\n\n private static initScope(_scope: EffectScope | undefined) {\n let scope = getCurrentScope() ?? _scope;\n\n if (!scope) {\n console.warn(\"Current scope not found, using new detached scope...\");\n scope = effectScope(true);\n }\n\n addScope(scope);\n\n onScopeDispose(() => {\n scopes.delete(scope);\n });\n\n return scope;\n }\n\n /**\n * Creates a ReactiveFileContent instance with isolated cache and fetcher.\n * Use this when you need component-specific caching.\n *\n * @example\n * ```ts\n * import { ReactiveFileContent } from '@platforma-sdk/ui-vue';\n * import { computed } from 'vue';\n *\n * const fileContent = ReactiveFileContent.use();\n *\n * const processedData = computed(() => {\n * const content = fileContent.getContentString(fileHandle).value;\n * return content?.split('\\n').length ?? 0;\n * });\n * ```\n */\n public static use(_ops?: Partial<ReactiveFileContentOps>, _scope?: EffectScope) {\n const scope = this.initScope(_scope);\n\n return new ReactiveFileContent(scope, { ..._ops });\n }\n\n /**\n * Creates a ReactiveFileContent instance with globally shared cache and fetcher.\n * Use this to share file content cache across multiple components.\n *\n * @example\n * ```ts\n * import { ReactiveFileContent } from '@platforma-sdk/ui-vue';\n * import { computed } from 'vue';\n *\n * const fileContent = ReactiveFileContent.useGlobal();\n *\n * const combinedData = computed(() => {\n * const data1 = fileContent.getContentJson(handle1).value;\n * const data2 = fileContent.getContentJson(handle2).value;\n * return { data1, data2 };\n * });\n * ```\n */\n public static useGlobal(_ops?: Partial<ReactiveFileContentOps>, _scope?: EffectScope) {\n const scope = this.initScope(_scope);\n\n return new ReactiveFileContent(scope, {\n ..._ops,\n lruCache: globalCache,\n fetcher: globalFetcher,\n });\n }\n}\n"],"mappings":";;;;;;AAiBA,IAAM,IAAwD,EAC5D,WAAW,MACZ,EAEK,IAAN,MAAsB;CACpB,OAAmC,KAAA;CACnC,WAAwC,KAAA;CACxC,aAA4C,KAAA;CAC5C,iBAA4E,KAAA;CAE5E,YAAY,GAAmC;AAAnB,OAAA,QAAA;;CAE5B,IAAW,MAAc;AAEvB,SADI,KAAK,SAAS,KAAA,MAAW,KAAK,OAAO,IAAI,aAAa,CAAC,OAAO,KAAK,MAAM,GACtE,KAAK;;CAGd,IAAW,UAAmB;AAE5B,SADI,KAAK,aAAa,KAAA,MAAW,KAAK,WAAW,KAAK,MAAM,KAAK,IAAI,GAC9D,KAAK;;CAGd,cAAwB,GAAqC;AAK3D,SAJI,KAAK,eAAe,MACtB,KAAK,iBAAiB,EAAO,UAAU,KAAK,QAAQ,EACpD,KAAK,aAAa,IAEb,KAAK,gBAAgB,UAAW,KAAK,eAAe,OAAa,KAAA;;GAItE,oBAAS,IAAI,SAAgF;AAEnG,SAAS,EAAS,GAAoB;AACpC,GAAO,IAAI,mBAAO,IAAI,KAA0D,CAAC;;AAGnF,IAAM,IAAc,IAAI,EAAsC;CAC5D,SAAS,EAA8B;CACvC,kBAAkB,MAAU,EAAM,MAAM;CACzC,CAAC,EAEI,IAAgB,IA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uD,EAC5D,EAAY,GAAK,GAG3B,EAAS,EAAM,EAEf,QAAqB;AACnB,KAAO,OAAO,EAAM;IACpB,EAEK;;CAoBT,OAAc,IAAI,GAAwC,GAAsB;AAG9E,SAAO,IAAI,EAFG,KAAK,UAAU,EAAO,EAEE,EAAE,GAAG,GAAM,CAAC;;CAqBpD,OAAc,UAAU,GAAwC,GAAsB;AAGpF,SAAO,IAAI,EAFG,KAAK,UAAU,EAAO,EAEE;GACpC,GAAG;GACH,UAAU;GACV,SAAS;GACV,CAAC"}
1
+ {"version":3,"file":"fileContent.js","names":["DefaultReactiveFileContentOps","FileContentData","bytes","schema","scopes","addScope","scope","globalCache","LRUCache","value","globalFetcher","Fetcher","ReactiveFileContent","currentScope","ops","_ops","previous","key","res","cb","handle","fileContentData","getRawPlatformaInstance","refsMap","actual","map","refFromMap","newRef","shallowRef","attempt","data","err","resolve","dataRef","computed","getCurrentScope","_scope","effectScope","onScopeDispose"],"sources":["../../src/composition/fileContent.ts"],"sourcesContent":["import type { BlobHandleAndSize } from \"@platforma-sdk/model\";\nimport { getRawPlatformaInstance } from \"@platforma-sdk/model\";\nimport { LRUCache } from \"lru-cache\";\nimport type { ComputedRef, ShallowRef, EffectScope } from \"vue\";\nimport { computed, shallowRef, getCurrentScope, onScopeDispose, effectScope } from \"vue\";\nimport type { ZodSchema, SafeParseReturnType } from \"zod\";\nimport { Fetcher } from \"@milaboratories/helpers\";\n\ntype FileHandle = BlobHandleAndSize[\"handle\"];\n\nexport type ReactiveFileContentOps = {\n /** Maximum size in bytes of file content to cache */\n cacheSize: number;\n lruCache?: LRUCache<FileHandle, FileContentData>;\n fetcher?: Fetcher<FileHandle, FileContentData>;\n};\n\nconst DefaultReactiveFileContentOps: ReactiveFileContentOps = {\n cacheSize: 15_000_000, // 15 Mb\n};\n\nclass FileContentData {\n private _str: string | undefined = undefined;\n private _rawJson: unknown | undefined = undefined;\n private _zodSchema: ZodSchema | undefined = undefined;\n private _validatedJson: SafeParseReturnType<unknown, unknown> | undefined = undefined;\n\n constructor(public readonly bytes: Uint8Array) {}\n\n public get str(): string {\n if (this._str === undefined) this._str = new TextDecoder().decode(this.bytes);\n return this._str;\n }\n\n public get rawJson(): unknown {\n if (this._rawJson === undefined) this._rawJson = JSON.parse(this.str);\n return this._rawJson;\n }\n\n public validatedJson<T>(schema: ZodSchema<T>): T | undefined {\n if (this._zodSchema !== schema) {\n this._validatedJson = schema.safeParse(this.rawJson);\n this._zodSchema = schema;\n }\n return this._validatedJson?.success ? (this._validatedJson.data as T) : undefined;\n }\n}\n\nconst scopes = new WeakMap<EffectScope, Map<FileHandle, ShallowRef<FileContentData | undefined>>>();\n\nfunction addScope(scope: EffectScope) {\n scopes.set(scope, new Map<FileHandle, ShallowRef<FileContentData | undefined>>());\n}\n\nconst globalCache = new LRUCache<FileHandle, FileContentData>({\n maxSize: DefaultReactiveFileContentOps.cacheSize,\n sizeCalculation: (value) => value.bytes.length,\n});\n\nconst globalFetcher = new Fetcher<FileHandle, FileContentData>();\n\nexport class ReactiveFileContent {\n private readonly fileDataCache: LRUCache<FileHandle, FileContentData>;\n private readonly fetcher: Fetcher<FileHandle, FileContentData>;\n private ns = new Map<string, Set<FileHandle>>();\n private currentKey: string | undefined;\n\n private constructor(\n private currentScope: EffectScope,\n _ops?: Partial<ReactiveFileContentOps>,\n ) {\n const ops: ReactiveFileContentOps = { ...DefaultReactiveFileContentOps, ..._ops };\n this.fileDataCache =\n ops.lruCache ??\n new LRUCache<FileHandle, FileContentData>({\n maxSize: ops.cacheSize,\n sizeCalculation: (value) => value.bytes.length,\n });\n this.fetcher = ops.fetcher ?? new Fetcher<FileHandle, FileContentData>();\n }\n\n /**\n * Experimental method to invalidate the refs map cache for a given key.\n */\n public withInvalidate<T>(key: string, cb: () => T) {\n const previous = this.ns.get(key);\n this.ns.set(key, new Set());\n this.currentKey = key;\n try {\n const res = cb();\n this.invalidate(key, previous);\n return res;\n } finally {\n this.currentKey = undefined;\n }\n }\n\n public stopScope() {\n scopes.delete(this.currentScope);\n this.currentScope.stop();\n }\n\n private async doFetch(handle: FileHandle) {\n if (!this.fileDataCache.has(handle)) {\n const fileContentData = await this.fetcher.fetch(\n handle,\n async () =>\n new FileContentData(await getRawPlatformaInstance().blobDriver.getContent(handle)),\n );\n this.fileDataCache.set(handle, fileContentData);\n }\n\n return this.fileDataCache.get(handle)!;\n }\n\n private getSize() {\n const refsMap = this.getRefsMap();\n return refsMap ? refsMap.size : 0;\n }\n\n private getRefsMap() {\n return scopes.get(this.currentScope);\n }\n\n private invalidate(key: string, previous: Set<FileHandle> | undefined) {\n if (!previous) {\n return;\n }\n\n const actual = this.ns.get(key)!;\n\n for (const handle of actual) {\n previous.delete(handle);\n }\n\n const map = this.getRefsMap();\n\n for (const handle of previous) {\n map?.delete(handle);\n }\n }\n\n private withHandle(handle: FileHandle) {\n if (this.currentKey) {\n this.ns.get(this.currentKey)?.add(handle);\n }\n }\n\n private getDataRef(handle: FileHandle): ShallowRef<FileContentData | undefined> {\n const refsMap = this.getRefsMap();\n\n if (!refsMap) {\n throw new Error(\"ReactiveFileContent must be used within a Vue component or effect scope.\");\n }\n\n this.withHandle(handle);\n\n const refFromMap = refsMap.get(handle);\n\n if (refFromMap !== undefined) {\n return refFromMap;\n }\n\n const newRef = shallowRef<FileContentData>();\n refsMap.set(handle, newRef);\n\n // Initiating actual fetch from the cache, that will in turn initiate upload\n (async () => {\n const maxRetries = 8;\n const retryDelay = 1000; // 1 second\n\n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n const data = await this.doFetch(handle);\n newRef.value = data;\n return;\n } catch (err: unknown) {\n console.error(`File download attempt ${attempt + 1}/${maxRetries} failed:`, err);\n\n if (attempt < maxRetries - 1) {\n await new Promise((resolve) => setTimeout(resolve, retryDelay));\n } else {\n console.error(`Failed to download file after ${maxRetries} attempts`);\n }\n }\n }\n })();\n\n return newRef;\n }\n\n public getContentBytes(handle: FileHandle): ComputedRef<Uint8Array | undefined>;\n public getContentBytes(\n handle: FileHandle | undefined,\n ): ComputedRef<Uint8Array | undefined> | undefined;\n public getContentBytes(\n handle: FileHandle | undefined,\n ): ComputedRef<Uint8Array | undefined> | undefined {\n if (handle === undefined) return undefined;\n const dataRef = this.getDataRef(handle);\n return computed(() => dataRef.value?.bytes);\n }\n\n public getContentString(handle: FileHandle): ComputedRef<string | undefined>;\n public getContentString(\n handle: FileHandle | undefined,\n ): ComputedRef<string | undefined> | undefined;\n public getContentString(\n handle: FileHandle | undefined,\n ): ComputedRef<string | undefined> | undefined {\n if (handle === undefined) return undefined;\n const dataRef = this.getDataRef(handle);\n return computed(() => dataRef.value?.str);\n }\n\n public getContentJson<T>(handle: FileHandle, schema: ZodSchema<T>): ComputedRef<T | undefined>;\n public getContentJson<T>(\n handle: FileHandle | undefined,\n schema: ZodSchema<T>,\n ): ComputedRef<T | undefined> | undefined;\n public getContentJson<T = unknown>(handle: FileHandle): ComputedRef<T | undefined>;\n public getContentJson<T = unknown>(\n handle: FileHandle | undefined,\n ): ComputedRef<T | undefined> | undefined;\n public getContentJson<T>(\n handle: FileHandle | undefined,\n schema?: ZodSchema<T>,\n ): ComputedRef<T | undefined> | undefined;\n public getContentJson<T>(\n handle: FileHandle | undefined,\n schema?: ZodSchema<T>,\n ): ComputedRef<T | undefined> | undefined {\n if (handle === undefined) return undefined;\n const dataRef = this.getDataRef(handle);\n return computed(\n () =>\n (schema === undefined ? dataRef.value?.rawJson : dataRef.value?.validatedJson(schema)) as T,\n );\n }\n\n private static initScope(_scope: EffectScope | undefined) {\n let scope = getCurrentScope() ?? _scope;\n\n if (!scope) {\n console.warn(\"Current scope not found, using new detached scope...\");\n scope = effectScope(true);\n }\n\n addScope(scope);\n\n onScopeDispose(() => {\n scopes.delete(scope);\n });\n\n return scope;\n }\n\n /**\n * Creates a ReactiveFileContent instance with isolated cache and fetcher.\n * Use this when you need component-specific caching.\n *\n * @example\n * ```ts\n * import { ReactiveFileContent } from '@platforma-sdk/ui-vue';\n * import { computed } from 'vue';\n *\n * const fileContent = ReactiveFileContent.use();\n *\n * const processedData = computed(() => {\n * const content = fileContent.getContentString(fileHandle).value;\n * return content?.split('\\n').length ?? 0;\n * });\n * ```\n */\n public static use(_ops?: Partial<ReactiveFileContentOps>, _scope?: EffectScope) {\n const scope = this.initScope(_scope);\n\n return new ReactiveFileContent(scope, { ..._ops });\n }\n\n /**\n * Creates a ReactiveFileContent instance with globally shared cache and fetcher.\n * Use this to share file content cache across multiple components.\n *\n * @example\n * ```ts\n * import { ReactiveFileContent } from '@platforma-sdk/ui-vue';\n * import { computed } from 'vue';\n *\n * const fileContent = ReactiveFileContent.useGlobal();\n *\n * const combinedData = computed(() => {\n * const data1 = fileContent.getContentJson(handle1).value;\n * const data2 = fileContent.getContentJson(handle2).value;\n * return { data1, data2 };\n * });\n * ```\n */\n public static useGlobal(_ops?: Partial<ReactiveFileContentOps>, _scope?: EffectScope) {\n const scope = this.initScope(_scope);\n\n return new ReactiveFileContent(scope, {\n ..._ops,\n lruCache: globalCache,\n fetcher: globalFetcher,\n });\n }\n}\n"],"mappings":";;;;;;AAiBA,IAAMA,IAAwD,EAC5D,WAAW,KACb,GAEMC,IAAN,MAAsB;CAMQ;CAL5B,OAAmC,KAAA;CACnC,WAAwC,KAAA;CACxC,aAA4C,KAAA;CAC5C,iBAA4E,KAAA;CAE5E,YAAY,GAAmC;EAAnB,KAAA,QAAAC;CAAoB;CAEhD,IAAW,MAAc;EAEvB,OADI,KAAK,SAAS,KAAA,MAAW,KAAK,OAAO,IAAI,YAAY,CAAC,CAAC,OAAO,KAAK,KAAK,IACrE,KAAK;CACd;CAEA,IAAW,UAAmB;EAE5B,OADI,KAAK,aAAa,KAAA,MAAW,KAAK,WAAW,KAAK,MAAM,KAAK,GAAG,IAC7D,KAAK;CACd;CAEA,cAAwB,GAAqC;EAK3D,OAJI,KAAK,eAAeC,MACtB,KAAK,iBAAiBA,EAAO,UAAU,KAAK,OAAO,GACnD,KAAK,aAAaA,IAEb,KAAK,gBAAgB,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,CAAM;EACtC,OAAOc,QAAeD,EAAQ,OAAO,KAAK;CAC5C;CAMA,iBACE,GAC6C;EAC7C,IAAIb,MAAW,KAAA,GAAW;EAC1B,IAAMa,IAAU,KAAK,WAAWb,CAAM;EACtC,OAAOc,QAAeD,EAAQ,OAAO,GAAG;CAC1C;CAeA,eACE,GACA,GACwC;EACxC,IAAIb,MAAW,KAAA,GAAW;EAC1B,IAAMa,IAAU,KAAK,WAAWb,CAAM;EACtC,OAAOc,QAEF/B,MAAW,KAAA,IAAY8B,EAAQ,OAAO,UAAUA,EAAQ,OAAO,cAAc9B,CAAM,CACxF;CACF;CAEA,OAAe,UAAU,GAAiC;EACxD,IAAIG,IAAQ6B,EAAgB,KAAKC;EAajC,OAXA,AAEE9B,OADA,QAAQ,KAAK,sDAAsD,GAC3D+B,EAAY,EAAI,IAG1BhC,EAASC,CAAK,GAEdgC,QAAqB;GACnB,EAAO,OAAOhC,CAAK;EACrB,CAAC,GAEMA;CACT;CAmBA,OAAc,IAAI,GAAwC,GAAsB;EAC9E,IAAMA,IAAQ,KAAK,UAAU8B,CAAM;EAEnC,OAAO,IAAIxB,EAAoBN,GAAO,EAAE,GAAGS,EAAK,CAAC;CACnD;CAoBA,OAAc,UAAU,GAAwC,GAAsB;EACpF,IAAMT,IAAQ,KAAK,UAAU8B,CAAM;EAEnC,OAAO,IAAIxB,EAAoBN,GAAO;GACpC,GAAGS;GACH,UAAUR;GACV,SAASG;EACX,CAAC;CACH;AACF"}
@@ -1,12 +1,11 @@
1
1
  import { pluginDataKey as e } from "../defineApp.js";
2
2
  import { inject as t } from "vue";
3
- //#region src/composition/usePlugin.ts
3
+ // src/composition/usePlugin.ts
4
4
  function n(n) {
5
5
  let r = t(e);
6
6
  if (!r) throw Error("usePlugin requires a V3 block (BlockModelV3). Make sure the block uses apiVersion 3 and the plugin is installed.");
7
7
  return r.getOrCreatePluginState(n);
8
8
  }
9
- //#endregion
10
9
  export { n as usePlugin };
11
10
 
12
11
  //# sourceMappingURL=usePlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePlugin.js","names":[],"sources":["../../src/composition/usePlugin.ts"],"sourcesContent":["import { inject, type Reactive } from \"vue\";\nimport { pluginDataKey } from \"../defineApp\";\nimport type {\n PluginHandle,\n InferFactoryData,\n InferFactoryOutputs,\n InferFactoryUiServices,\n PluginFactoryLike,\n} from \"@platforma-sdk/model\";\n\n/** Per-plugin reactive model exposed to consumers via usePlugin(). */\nexport interface PluginState<\n Data = unknown,\n Outputs = unknown,\n Services = Record<string, unknown>,\n> {\n readonly model: Reactive<{\n data: Data;\n outputs: Outputs extends Record<string, unknown>\n ? { [K in keyof Outputs]: Outputs[K] | undefined }\n : Record<string, unknown>;\n outputErrors: Outputs extends Record<string, unknown>\n ? { [K in keyof Outputs]?: Error }\n : Record<string, Error | undefined>;\n }>;\n readonly services: Services;\n}\n\n/** Internal interface for plugin access — provided via Vue injection to usePlugin(). */\nexport interface PluginAccess {\n getOrCreatePluginState<F extends PluginFactoryLike>(\n handle: PluginHandle<F>,\n ): PluginState<InferFactoryData<F>, InferFactoryOutputs<F>, InferFactoryUiServices<F>>;\n}\n\n/**\n * Composable for accessing a plugin's reactive model: data, outputs, and outputErrors.\n *\n * Mirrors the `app.model` access pattern — `plugin.model.data` is reactive and deep-watched,\n * mutations are automatically queued and sent to storage.\n *\n * @param handle - Opaque plugin handle obtained from `app.plugins`.\n * @typeParam F - The plugin factory type (inferred from the handle)\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { usePlugin, type InferPluginHandle } from '@platforma-sdk/ui-vue';\n * import type { CounterPlugin } from './plugins/counter';\n *\n * const props = defineProps<{ instance: InferPluginHandle<CounterPlugin> }>();\n * const plugin = usePlugin(props.instance);\n *\n * plugin.model.data.count += 1; // reactive, triggers storage update\n * plugin.model.outputs.displayText // computed, plugin's own outputs only\n * plugin.model.outputErrors.displayText // Error | undefined\n * </script>\n * ```\n */\nexport function usePlugin<F extends PluginFactoryLike>(handle: PluginHandle<F>) {\n const access = inject<PluginAccess>(pluginDataKey);\n\n if (!access) {\n throw new Error(\n \"usePlugin requires a V3 block (BlockModelV3). \" +\n \"Make sure the block uses apiVersion 3 and the plugin is installed.\",\n );\n }\n\n return access.getOrCreatePluginState<F>(handle);\n}\n"],"mappings":";;;AA2DA,SAAgB,EAAuC,GAAyB;CAC9E,IAAM,IAAS,EAAqB,EAAc;AAElD,KAAI,CAAC,EACH,OAAU,MACR,mHAED;AAGH,QAAO,EAAO,uBAA0B,EAAO"}
1
+ {"version":3,"file":"usePlugin.js","names":["usePlugin","access","inject","pluginDataKey","handle"],"sources":["../../src/composition/usePlugin.ts"],"sourcesContent":["import { inject, type Reactive } from \"vue\";\nimport { pluginDataKey } from \"../defineApp\";\nimport type {\n PluginHandle,\n InferFactoryData,\n InferFactoryOutputs,\n InferFactoryUiServices,\n PluginFactoryLike,\n} from \"@platforma-sdk/model\";\n\n/** Per-plugin reactive model exposed to consumers via usePlugin(). */\nexport interface PluginState<\n Data = unknown,\n Outputs = unknown,\n Services = Record<string, unknown>,\n> {\n readonly model: Reactive<{\n data: Data;\n outputs: Outputs extends Record<string, unknown>\n ? { [K in keyof Outputs]: Outputs[K] | undefined }\n : Record<string, unknown>;\n outputErrors: Outputs extends Record<string, unknown>\n ? { [K in keyof Outputs]?: Error }\n : Record<string, Error | undefined>;\n }>;\n readonly services: Services;\n}\n\n/** Internal interface for plugin access — provided via Vue injection to usePlugin(). */\nexport interface PluginAccess {\n getOrCreatePluginState<F extends PluginFactoryLike>(\n handle: PluginHandle<F>,\n ): PluginState<InferFactoryData<F>, InferFactoryOutputs<F>, InferFactoryUiServices<F>>;\n}\n\n/**\n * Composable for accessing a plugin's reactive model: data, outputs, and outputErrors.\n *\n * Mirrors the `app.model` access pattern — `plugin.model.data` is reactive and deep-watched,\n * mutations are automatically queued and sent to storage.\n *\n * @param handle - Opaque plugin handle obtained from `app.plugins`.\n * @typeParam F - The plugin factory type (inferred from the handle)\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { usePlugin, type InferPluginHandle } from '@platforma-sdk/ui-vue';\n * import type { CounterPlugin } from './plugins/counter';\n *\n * const props = defineProps<{ instance: InferPluginHandle<CounterPlugin> }>();\n * const plugin = usePlugin(props.instance);\n *\n * plugin.model.data.count += 1; // reactive, triggers storage update\n * plugin.model.outputs.displayText // computed, plugin's own outputs only\n * plugin.model.outputErrors.displayText // Error | undefined\n * </script>\n * ```\n */\nexport function usePlugin<F extends PluginFactoryLike>(handle: PluginHandle<F>) {\n const access = inject<PluginAccess>(pluginDataKey);\n\n if (!access) {\n throw new Error(\n \"usePlugin requires a V3 block (BlockModelV3). \" +\n \"Make sure the block uses apiVersion 3 and the plugin is installed.\",\n );\n }\n\n return access.getOrCreatePluginState<F>(handle);\n}\n"],"mappings":";;;AA2DA,SAAgBA,EAAuC,GAAyB;CAC9E,IAAMC,IAASC,EAAqBC,CAAa;CAEjD,IAAI,CAACF,GACH,MAAU,MACR,kHAEF;CAGF,OAAOA,EAAO,uBAA0BG,CAAM;AAChD"}
@@ -1,7 +1,7 @@
1
1
  import { wrapOptionalResult as e } from "./utils.js";
2
2
  import { computed as t } from "vue";
3
3
  import { ensureErrorLike as n } from "@platforma-sdk/model";
4
- //#region src/computedResult.ts
4
+ // src/computedResult.ts
5
5
  function r(r) {
6
6
  return t(() => {
7
7
  try {
@@ -14,7 +14,6 @@ function r(r) {
14
14
  }
15
15
  });
16
16
  }
17
- //#endregion
18
17
  export { r as computedResult };
19
18
 
20
19
  //# sourceMappingURL=computedResult.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"computedResult.js","names":[],"sources":["../src/computedResult.ts"],"sourcesContent":["import type { ComputedRef } from \"vue\";\nimport { computed, type ComputedGetter } from \"vue\";\nimport type { OptionalResult } from \"./types\";\nimport { wrapOptionalResult } from \"./utils\";\nimport { ensureErrorLike } from \"@platforma-sdk/model\";\n\n/**\n * Creates a computed reference that wraps the result of a getter function in an `OptionalResult` object.\n * This wrapper provides error handling, ensuring that if an error occurs during the computation of the result,\n * the error is captured and included in the `OptionalResult` instead of throwing the error.\n *\n * @template V - The type of the value returned by the getter function.\n *\n * @param {ComputedGetter<V>} getter - A function that returns a value of type `V`. This function is executed inside\n * the computed reference and its result is wrapped in an `OptionalResult`.\n *\n * @returns {ComputedRef<OptionalResult<V>>} - A computed reference containing the result of the getter function\n * wrapped in an `OptionalResult`. If the getter function executes successfully, the `value` property of the `OptionalResult`\n * will contain the result. If an error occurs, the `errors` property will contain the error message, and `value` will be `undefined`.\n *\n * @example\n * const myGetter = () => {\n * if (someCondition) {\n * throw new Error('An error occurred');\n * }\n * return 'Success';\n * };\n *\n * const myComputedResult = computedResult(myGetter);\n *\n * // If someCondition is true:\n * // myComputedResult.value will be { errors: ['An error occurred'], value: undefined }\n *\n * // If someCondition is false:\n * // myComputedResult.value will be { errors: undefined, value: 'Success' }\n */\nexport function computedResult<V>(getter: ComputedGetter<V>): ComputedRef<OptionalResult<V>> {\n return computed(() => {\n try {\n return wrapOptionalResult(getter());\n } catch (err) {\n return {\n errors: [ensureErrorLike(err)],\n value: undefined,\n };\n }\n });\n}\n"],"mappings":";;;;AAoCA,SAAgB,EAAkB,GAA2D;AAC3F,QAAO,QAAe;AACpB,MAAI;AACF,UAAO,EAAmB,GAAQ,CAAC;WAC5B,GAAK;AACZ,UAAO;IACL,QAAQ,CAAC,EAAgB,EAAI,CAAC;IAC9B,OAAO,KAAA;IACR;;GAEH"}
1
+ {"version":3,"file":"computedResult.js","names":["computedResult","computed","wrapOptionalResult","getter","err","ensureErrorLike"],"sources":["../src/computedResult.ts"],"sourcesContent":["import type { ComputedRef } from \"vue\";\nimport { computed, type ComputedGetter } from \"vue\";\nimport type { OptionalResult } from \"./types\";\nimport { wrapOptionalResult } from \"./utils\";\nimport { ensureErrorLike } from \"@platforma-sdk/model\";\n\n/**\n * Creates a computed reference that wraps the result of a getter function in an `OptionalResult` object.\n * This wrapper provides error handling, ensuring that if an error occurs during the computation of the result,\n * the error is captured and included in the `OptionalResult` instead of throwing the error.\n *\n * @template V - The type of the value returned by the getter function.\n *\n * @param {ComputedGetter<V>} getter - A function that returns a value of type `V`. This function is executed inside\n * the computed reference and its result is wrapped in an `OptionalResult`.\n *\n * @returns {ComputedRef<OptionalResult<V>>} - A computed reference containing the result of the getter function\n * wrapped in an `OptionalResult`. If the getter function executes successfully, the `value` property of the `OptionalResult`\n * will contain the result. If an error occurs, the `errors` property will contain the error message, and `value` will be `undefined`.\n *\n * @example\n * const myGetter = () => {\n * if (someCondition) {\n * throw new Error('An error occurred');\n * }\n * return 'Success';\n * };\n *\n * const myComputedResult = computedResult(myGetter);\n *\n * // If someCondition is true:\n * // myComputedResult.value will be { errors: ['An error occurred'], value: undefined }\n *\n * // If someCondition is false:\n * // myComputedResult.value will be { errors: undefined, value: 'Success' }\n */\nexport function computedResult<V>(getter: ComputedGetter<V>): ComputedRef<OptionalResult<V>> {\n return computed(() => {\n try {\n return wrapOptionalResult(getter());\n } catch (err) {\n return {\n errors: [ensureErrorLike(err)],\n value: undefined,\n };\n }\n });\n}\n"],"mappings":";;;;AAoCA,SAAgBA,EAAkB,GAA2D;CAC3F,OAAOC,QAAe;EACpB,IAAI;GACF,OAAOC,EAAmBC,EAAO,CAAC;EACpC,SAASC,GAAK;GACZ,OAAO;IACL,QAAQ,CAACC,EAAgBD,CAAG,CAAC;IAC7B,OAAO,KAAA;GACT;EACF;CACF,CAAC;AACH"}
@@ -2,7 +2,7 @@ import { deepClone as e, isJsonEqual as t } from "./lib/util/helpers/dist/object
2
2
  import "./lib/util/helpers/dist/index.js";
3
3
  import { ensureError as n, formatZodError as r, identity as i, isZodError as a } from "./utils.js";
4
4
  import { computed as o, reactive as s, ref as c, unref as l, watch as u } from "vue";
5
- //#region src/createModel.ts
5
+ // src/createModel.ts
6
6
  function d(d) {
7
7
  let f = d.validate ?? i, { autoSave: p } = d, m = c(), h = c(), g = (t) => {
8
8
  h.value = { model: e(t) };
@@ -28,20 +28,21 @@ function d(d) {
28
28
  g(e), b(e);
29
29
  }
30
30
  });
31
- return u(h, (e, t) => {
31
+ u(h, (e, t) => {
32
32
  e && e === t && b(e.model);
33
- }, { deep: !0 }), s({
33
+ }, { deep: !0 });
34
+ let S = o(() => !m.value), C = o(() => !t(d.get(), l(h))), w = o(() => m.value ? m.value.message : "");
35
+ return s({
34
36
  model: x,
35
- valid: o(() => !m.value),
36
- isChanged: o(() => !t(d.get(), l(h))),
37
+ valid: S,
38
+ isChanged: C,
37
39
  error: m,
38
- errorString: o(() => m.value ? m.value.message : ""),
40
+ errorString: w,
39
41
  save: _,
40
42
  revert: v,
41
43
  setError: y
42
44
  });
43
45
  }
44
- //#endregion
45
46
  export { d as createModel };
46
47
 
47
48
  //# sourceMappingURL=createModel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createModel.js","names":[],"sources":["../src/createModel.ts"],"sourcesContent":["import { reactive, computed, ref, watch, unref } from \"vue\";\nimport type { ModelOptions, Model } from \"./types\";\nimport { deepClone, isJsonEqual } from \"@milaboratories/helpers\";\nimport { identity, ensureError, isZodError, formatZodError } from \"./utils\";\n\nexport function createModel<M, V = unknown>(options: ModelOptions<M, V>): Model<M> {\n const validate = options.validate ?? identity;\n\n const { autoSave } = options;\n\n const error = ref<Error | undefined>();\n\n const local = ref<{ model: M }>();\n\n const setSource = (v: M) => {\n local.value = {\n model: deepClone(v),\n };\n };\n\n watch(\n () => options.get(),\n (v) => setSource(v),\n { immediate: true },\n );\n\n const save = () => {\n options.onSave(validate(deepClone(local.value?.model)));\n };\n\n const revert = () => {\n setSource(options.get());\n error.value = undefined;\n };\n\n const setError = (cause: unknown) => {\n const err = ensureError(cause);\n if (isZodError(err)) {\n error.value = Error(formatZodError(err)); // @todo temp\n } else {\n error.value = err;\n }\n };\n\n const setValue = (v: M) => {\n error.value = undefined;\n try {\n validate(v);\n if (autoSave) {\n save();\n }\n } catch (cause: unknown) {\n setError(cause);\n }\n };\n\n const model = computed<M>({\n get: () => {\n return local.value?.model as M;\n },\n set(v) {\n setSource(v);\n setValue(v);\n },\n });\n\n watch(\n local,\n (n, o) => {\n if (n && n === o) {\n setValue(n.model);\n }\n },\n { deep: true },\n );\n\n const valid = computed(() => !error.value);\n\n const isChanged = computed(() => {\n return !isJsonEqual(options.get(), unref(local));\n });\n\n const errorString = computed(() => (error.value ? error.value.message : \"\"));\n\n return reactive({\n model,\n valid,\n isChanged,\n error,\n errorString,\n save,\n revert,\n setError,\n });\n}\n"],"mappings":";;;;;AAKA,SAAgB,EAA4B,GAAuC;CACjF,IAAM,IAAW,EAAQ,YAAY,GAE/B,EAAE,gBAAa,GAEf,IAAQ,GAAwB,EAEhC,IAAQ,GAAmB,EAE3B,KAAa,MAAS;AAC1B,IAAM,QAAQ,EACZ,OAAO,EAAU,EAAE,EACpB;;AAGH,SACQ,EAAQ,KAAK,GAClB,MAAM,EAAU,EAAE,EACnB,EAAE,WAAW,IAAM,CACpB;CAED,IAAM,UAAa;AACjB,IAAQ,OAAO,EAAS,EAAU,EAAM,OAAO,MAAM,CAAC,CAAC;IAGnD,UAAe;AAEnB,EADA,EAAU,EAAQ,KAAK,CAAC,EACxB,EAAM,QAAQ,KAAA;IAGV,KAAY,MAAmB;EACnC,IAAM,IAAM,EAAY,EAAM;AAC9B,EAAI,EAAW,EAAI,GACjB,EAAM,QAAQ,MAAM,EAAe,EAAI,CAAC,GAExC,EAAM,QAAQ;IAIZ,KAAY,MAAS;AACzB,IAAM,QAAQ,KAAA;AACd,MAAI;AAEF,GADA,EAAS,EAAE,EACP,KACF,GAAM;WAED,GAAgB;AACvB,KAAS,EAAM;;IAIb,IAAQ,EAAY;EACxB,WACS,EAAM,OAAO;EAEtB,IAAI,GAAG;AAEL,GADA,EAAU,EAAE,EACZ,EAAS,EAAE;;EAEd,CAAC;AAoBF,QAlBA,EACE,IACC,GAAG,MAAM;AACR,EAAI,KAAK,MAAM,KACb,EAAS,EAAE,MAAM;IAGrB,EAAE,MAAM,IAAM,CACf,EAUM,EAAS;EACd;EACA,OAVY,QAAe,CAAC,EAAM,MAAM;EAWxC,WATgB,QACT,CAAC,EAAY,EAAQ,KAAK,EAAE,EAAM,EAAM,CAAC,CAChD;EAQA;EACA,aAPkB,QAAgB,EAAM,QAAQ,EAAM,MAAM,UAAU,GAAI;EAQ1E;EACA;EACA;EACD,CAAC"}
1
+ {"version":3,"file":"createModel.js","names":["createModel","validate","options","identity","error","ref","local","setSource","deepClone","v","save","revert","setError","err","ensureError","cause","isZodError","formatZodError","setValue","autoSave","model","computed","n","o","valid","isChanged","isJsonEqual","unref","errorString","reactive"],"sources":["../src/createModel.ts"],"sourcesContent":["import { reactive, computed, ref, watch, unref } from \"vue\";\nimport type { ModelOptions, Model } from \"./types\";\nimport { deepClone, isJsonEqual } from \"@milaboratories/helpers\";\nimport { identity, ensureError, isZodError, formatZodError } from \"./utils\";\n\nexport function createModel<M, V = unknown>(options: ModelOptions<M, V>): Model<M> {\n const validate = options.validate ?? identity;\n\n const { autoSave } = options;\n\n const error = ref<Error | undefined>();\n\n const local = ref<{ model: M }>();\n\n const setSource = (v: M) => {\n local.value = {\n model: deepClone(v),\n };\n };\n\n watch(\n () => options.get(),\n (v) => setSource(v),\n { immediate: true },\n );\n\n const save = () => {\n options.onSave(validate(deepClone(local.value?.model)));\n };\n\n const revert = () => {\n setSource(options.get());\n error.value = undefined;\n };\n\n const setError = (cause: unknown) => {\n const err = ensureError(cause);\n if (isZodError(err)) {\n error.value = Error(formatZodError(err)); // @todo temp\n } else {\n error.value = err;\n }\n };\n\n const setValue = (v: M) => {\n error.value = undefined;\n try {\n validate(v);\n if (autoSave) {\n save();\n }\n } catch (cause: unknown) {\n setError(cause);\n }\n };\n\n const model = computed<M>({\n get: () => {\n return local.value?.model as M;\n },\n set(v) {\n setSource(v);\n setValue(v);\n },\n });\n\n watch(\n local,\n (n, o) => {\n if (n && n === o) {\n setValue(n.model);\n }\n },\n { deep: true },\n );\n\n const valid = computed(() => !error.value);\n\n const isChanged = computed(() => {\n return !isJsonEqual(options.get(), unref(local));\n });\n\n const errorString = computed(() => (error.value ? error.value.message : \"\"));\n\n return reactive({\n model,\n valid,\n isChanged,\n error,\n errorString,\n save,\n revert,\n setError,\n });\n}\n"],"mappings":";;;;;AAKA,SAAgBA,EAA4B,GAAuC;CACjF,IAAMC,IAAWC,EAAQ,YAAYC,GAE/B,EAAE,gBAAaD,GAEfE,IAAQC,EAAuB,GAE/BC,IAAQD,EAAkB,GAE1BE,KAAa,MAAS;EAC1B,EAAM,QAAQ,EACZ,OAAOC,EAAUC,CAAC,EACpB;CACF;CAEA,QACQP,EAAQ,IAAI,IACjB,MAAMK,EAAUE,CAAC,GAClB,EAAE,WAAW,GAAK,CACpB;CAEA,IAAMC,UAAa;EACjB,EAAQ,OAAOT,EAASO,EAAUF,EAAM,OAAO,KAAK,CAAC,CAAC;CACxD,GAEMK,UAAe;EAEnB,AADAJ,EAAUL,EAAQ,IAAI,CAAC,GACvB,EAAM,QAAQ,KAAA;CAChB,GAEMU,KAAY,MAAmB;EACnC,IAAMC,IAAMC,EAAYC,CAAK;EAC7B,AAAIC,EAAWH,CAAG,IAChB,EAAM,QAAQ,MAAMI,EAAeJ,CAAG,CAAC,IAEvC,EAAM,QAAQA;CAElB,GAEMK,KAAY,MAAS;EACzB,EAAM,QAAQ,KAAA;EACd,IAAI;GAEF,AADAjB,EAASQ,CAAC,GACNU,KACFT,EAAK;EAET,SAASK,GAAgB;GACvB,EAASA,CAAK;EAChB;CACF,GAEMK,IAAQC,EAAY;EACxB,WACSf,EAAM,OAAO;EAEtB,IAAI,GAAG;GAEL,AADAC,EAAUE,CAAC,GACXS,EAAST,CAAC;EACZ;CACF,CAAC;CAED,EACEH,IACC,GAAG,MAAM;EACR,AAAIgB,KAAKA,MAAMC,KACbL,EAASI,EAAE,KAAK;CAEpB,GACA,EAAE,MAAM,GAAK,CACf;CAEA,IAAME,IAAQH,QAAe,CAACjB,EAAM,KAAK,GAEnCqB,IAAYJ,QACT,CAACK,EAAYxB,EAAQ,IAAI,GAAGyB,EAAMrB,CAAK,CAAC,CAChD,GAEKsB,IAAcP,QAAgBjB,EAAM,QAAQA,EAAM,MAAM,UAAU,EAAG;CAE3E,OAAOyB,EAAS;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH"}
package/dist/defineApp.js CHANGED
@@ -3,7 +3,7 @@ import "./lib/util/helpers/dist/index.js";
3
3
  import { createAppV3 as t } from "./internal/createAppV3.js";
4
4
  import { inject as n, markRaw as r, reactive as i } from "vue";
5
5
  import { getPlatformaApiVersion as a, unwrapResult as o } from "@platforma-sdk/model";
6
- //#region src/defineApp.ts
6
+ // src/defineApp.ts
7
7
  var s = Symbol("sdk-vue"), c = Symbol("plugin-data-access");
8
8
  function l() {
9
9
  return n(s);
@@ -21,7 +21,10 @@ function d(n, l, u = {}) {
21
21
  let { app: a, pluginAccess: s } = t(i, n, u);
22
22
  if (!f) throw Error("Plugin data injection failed: Vue app instance not captured during install()");
23
23
  f.provide(c, s);
24
- let p = l(a), m = Object.fromEntries(Object.entries(p.routes).map(([e, t]) => [e, r(typeof t == "function" ? t() : t)]));
24
+ let p = l(a), m = Object.fromEntries(Object.entries(p.routes).map(([e, t]) => {
25
+ let n = typeof t == "function" ? t() : t;
26
+ return [e, r(n)];
27
+ }));
25
28
  d = Object.assign(a, {
26
29
  ...p,
27
30
  getRoute(e) {
@@ -45,7 +48,6 @@ function d(n, l, u = {}) {
45
48
  });
46
49
  return h;
47
50
  }
48
- //#endregion
49
51
  export { d as defineAppV3, c as pluginDataKey, u as useFeatureFlags, l as useSdkPlugin };
50
52
 
51
53
  //# sourceMappingURL=defineApp.js.map