@platforma-sdk/ui-vue 1.63.5 → 1.63.12

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 (247) hide show
  1. package/.turbo/turbo-build.log +157 -159
  2. package/.turbo/turbo-formatter$colon$check.log +2 -2
  3. package/.turbo/turbo-linter$colon$check.log +2 -2
  4. package/.turbo/turbo-types$colon$check.log +1 -1
  5. package/CHANGELOG.md +20 -0
  6. package/dist/AgGridVue/AgGridTheme.js +3 -1
  7. package/dist/AgGridVue/AgGridTheme.js.map +1 -1
  8. package/dist/AgGridVue/ag-override.js +2 -0
  9. package/dist/AgGridVue/ag-override.js.map +1 -1
  10. package/dist/AgGridVue/createAgGridColDef.js +2 -35
  11. package/dist/AgGridVue/createAgGridColDef.js.map +1 -1
  12. package/dist/AgGridVue/selection.js +2 -23
  13. package/dist/AgGridVue/selection.js.map +1 -1
  14. package/dist/AgGridVue/useAgGridOptions.js +2 -83
  15. package/dist/AgGridVue/useAgGridOptions.js.map +1 -1
  16. package/dist/_virtual/_plugin-vue_export-helper.js +2 -0
  17. package/dist/_virtual/_rolldown/runtime.js +2 -0
  18. package/dist/components/BlockLayout.js +1 -0
  19. package/dist/components/BlockLayout.style.js +1 -0
  20. package/dist/components/BlockLayout.vue2.js +2 -0
  21. package/dist/components/BlockLayout.vue2.js.map +1 -1
  22. package/dist/components/BlockLoader.js +2 -0
  23. package/dist/components/BlockLoader.vue2.js +2 -0
  24. package/dist/components/BlockLoader.vue2.js.map +1 -1
  25. package/dist/components/LoaderPage.js +2 -0
  26. package/dist/components/LoaderPage.js.map +1 -1
  27. package/dist/components/NotFound.js +2 -0
  28. package/dist/components/NotFound.vue2.js +2 -0
  29. package/dist/components/NotFound.vue2.js.map +1 -1
  30. package/dist/components/PlAdvancedFilter/FilterEditor.js +1 -0
  31. package/dist/components/PlAdvancedFilter/FilterEditor.style.js +1 -0
  32. package/dist/components/PlAdvancedFilter/FilterEditor.vue2.js +2 -0
  33. package/dist/components/PlAdvancedFilter/FilterEditor.vue2.js.map +1 -1
  34. package/dist/components/PlAdvancedFilter/OperandButton.js +1 -0
  35. package/dist/components/PlAdvancedFilter/OperandButton.style.js +1 -0
  36. package/dist/components/PlAdvancedFilter/OperandButton.vue2.js +2 -0
  37. package/dist/components/PlAdvancedFilter/OperandButton.vue2.js.map +1 -1
  38. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.js +1 -0
  39. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.style.js +1 -0
  40. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js +2 -0
  41. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js.map +1 -1
  42. package/dist/components/PlAdvancedFilter/constants.js +4 -4
  43. package/dist/components/PlAdvancedFilter/constants.js.map +1 -1
  44. package/dist/components/PlAdvancedFilter/index.js +3 -1
  45. package/dist/components/PlAdvancedFilter/index.js.map +1 -1
  46. package/dist/components/PlAdvancedFilter/utils.js +2 -0
  47. package/dist/components/PlAdvancedFilter/utils.js.map +1 -1
  48. package/dist/components/PlAgCellFile/PlAgCellFile.js +2 -0
  49. package/dist/components/PlAgCellFile/PlAgCellFile.vue2.js +2 -4
  50. package/dist/components/PlAgCellFile/PlAgCellFile.vue2.js.map +1 -1
  51. package/dist/components/PlAgCellProgress/PlAgCellProgress.js +2 -0
  52. package/dist/components/PlAgCellProgress/PlAgCellProgress.vue2.js +2 -0
  53. package/dist/components/PlAgCellProgress/PlAgCellProgress.vue2.js.map +1 -1
  54. package/dist/components/PlAgCellStatusTag/PlAgCellStatusTag.js +2 -0
  55. package/dist/components/PlAgCellStatusTag/PlAgCellStatusTag.vue2.js +2 -0
  56. package/dist/components/PlAgCellStatusTag/PlAgCellStatusTag.vue2.js.map +1 -1
  57. package/dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.js +2 -0
  58. package/dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.vue2.js +2 -0
  59. package/dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.vue2.js.map +1 -1
  60. package/dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.js +2 -0
  61. package/dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.vue2.js +2 -0
  62. package/dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.vue2.js.map +1 -1
  63. package/dist/components/PlAgColumnHeader/PlAgColumnHeader.js +2 -0
  64. package/dist/components/PlAgColumnHeader/PlAgColumnHeader.vue2.js +2 -0
  65. package/dist/components/PlAgColumnHeader/PlAgColumnHeader.vue2.js.map +1 -1
  66. package/dist/components/PlAgCsvExporter/PlAgCsvExporter.js +2 -0
  67. package/dist/components/PlAgCsvExporter/PlAgCsvExporter.vue2.js +2 -0
  68. package/dist/components/PlAgCsvExporter/PlAgCsvExporter.vue2.js.map +1 -1
  69. package/dist/components/PlAgCsvExporter/export-csv.js +2 -0
  70. package/dist/components/PlAgCsvExporter/export-csv.js.map +1 -1
  71. package/dist/components/PlAgDataTable/PlAgDataTableSheets.js +1 -0
  72. package/dist/components/PlAgDataTable/PlAgDataTableSheets.style.js +1 -0
  73. package/dist/components/PlAgDataTable/PlAgDataTableSheets.vue2.js +2 -0
  74. package/dist/components/PlAgDataTable/PlAgDataTableSheets.vue2.js.map +1 -1
  75. package/dist/components/PlAgDataTable/PlAgDataTableV2.js +1 -0
  76. package/dist/components/PlAgDataTable/PlAgDataTableV2.style.js +1 -0
  77. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js +2 -0
  78. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js.map +1 -1
  79. package/dist/components/PlAgDataTable/PlAgOverlayLoading.js +2 -0
  80. package/dist/components/PlAgDataTable/PlAgOverlayLoading.vue2.js +2 -0
  81. package/dist/components/PlAgDataTable/PlAgOverlayLoading.vue2.js.map +1 -1
  82. package/dist/components/PlAgDataTable/PlAgOverlayNoRows.js +2 -0
  83. package/dist/components/PlAgDataTable/PlAgOverlayNoRows.vue2.js +2 -0
  84. package/dist/components/PlAgDataTable/PlAgOverlayNoRows.vue2.js.map +1 -1
  85. package/dist/components/PlAgDataTable/PlAgRowCount.js +2 -0
  86. package/dist/components/PlAgDataTable/PlAgRowCount.vue2.js +2 -0
  87. package/dist/components/PlAgDataTable/PlAgRowCount.vue2.js.map +1 -1
  88. package/dist/components/PlAgDataTable/compositions/useFilterableColumns.js +2 -0
  89. package/dist/components/PlAgDataTable/compositions/useFilterableColumns.js.map +1 -1
  90. package/dist/components/PlAgDataTable/compositions/useGrid.js +2 -0
  91. package/dist/components/PlAgDataTable/compositions/useGrid.js.map +1 -1
  92. package/dist/components/PlAgDataTable/index.js +2 -0
  93. package/dist/components/PlAgDataTable/index.js.map +1 -1
  94. package/dist/components/PlAgDataTable/pl-ag-overlay-loading.module.js +1 -0
  95. package/dist/components/PlAgDataTable/sources/common.js +3 -1
  96. package/dist/components/PlAgDataTable/sources/common.js.map +1 -1
  97. package/dist/components/PlAgDataTable/sources/focus-row.js +2 -0
  98. package/dist/components/PlAgDataTable/sources/focus-row.js.map +1 -1
  99. package/dist/components/PlAgDataTable/sources/menu-items.js +2 -0
  100. package/dist/components/PlAgDataTable/sources/menu-items.js.map +1 -1
  101. package/dist/components/PlAgDataTable/sources/row-number.js +3 -2
  102. package/dist/components/PlAgDataTable/sources/row-number.js.map +1 -1
  103. package/dist/components/PlAgDataTable/sources/table-source-v2.js +2 -5
  104. package/dist/components/PlAgDataTable/sources/table-source-v2.js.map +1 -1
  105. package/dist/components/PlAgDataTable/sources/table-state-v2.js +2 -0
  106. package/dist/components/PlAgDataTable/sources/table-state-v2.js.map +1 -1
  107. package/dist/components/PlAgDataTable/sources/value-rendering.js +2 -0
  108. package/dist/components/PlAgDataTable/sources/value-rendering.js.map +1 -1
  109. package/dist/components/PlAgDataTable/types.js +2 -0
  110. package/dist/components/PlAgDataTable/types.js.map +1 -1
  111. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.js +1 -0
  112. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.style.js +1 -0
  113. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue2.js +2 -0
  114. package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue2.js.map +1 -1
  115. package/dist/components/PlAgGridColumnManager/useFilteredItems.js +2 -0
  116. package/dist/components/PlAgGridColumnManager/useFilteredItems.js.map +1 -1
  117. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.js +2 -0
  118. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue2.js +2 -0
  119. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue2.js.map +1 -1
  120. package/dist/components/PlAgRowNumCheckbox/pl-ag-row-num-checkbox.module.js +1 -0
  121. package/dist/components/PlAgRowNumHeader.js +2 -0
  122. package/dist/components/PlAgRowNumHeader.vue2.js +2 -0
  123. package/dist/components/PlAgRowNumHeader.vue2.js.map +1 -1
  124. package/dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.js +2 -0
  125. package/dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue2.js +2 -0
  126. package/dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue2.js.map +1 -1
  127. package/dist/components/PlAnnotations/components/AnnotationsSidebar.js +1 -0
  128. package/dist/components/PlAnnotations/components/AnnotationsSidebar.style.js +1 -0
  129. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js +2 -0
  130. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js.map +1 -1
  131. package/dist/components/PlAnnotations/components/FilterSidebar.js +1 -0
  132. package/dist/components/PlAnnotations/components/FilterSidebar.style.js +1 -0
  133. package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js +2 -0
  134. package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js.map +1 -1
  135. package/dist/components/PlAnnotations/components/PlAnnotations.js +1 -0
  136. package/dist/components/PlAnnotations/components/PlAnnotations.style.js +1 -0
  137. package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js +2 -0
  138. package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js.map +1 -1
  139. package/dist/components/PlAnnotations/components/PlAnnotationsModal.js +1 -0
  140. package/dist/components/PlAnnotations/components/PlAnnotationsModal.style.js +1 -0
  141. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js +2 -0
  142. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js.map +1 -1
  143. package/dist/components/PlAnnotations/components/style.module.js +1 -0
  144. package/dist/components/PlAnnotations/utils.js +2 -0
  145. package/dist/components/PlAnnotations/utils.js.map +1 -1
  146. package/dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.js +2 -0
  147. package/dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue2.js +2 -0
  148. package/dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue2.js.map +1 -1
  149. package/dist/components/PlBtnExportArchive/Item.js +1 -0
  150. package/dist/components/PlBtnExportArchive/Item.style.js +1 -0
  151. package/dist/components/PlBtnExportArchive/Item.vue2.js +2 -0
  152. package/dist/components/PlBtnExportArchive/Item.vue2.js.map +1 -1
  153. package/dist/components/PlBtnExportArchive/PlBtnExportArchive.js +1 -0
  154. package/dist/components/PlBtnExportArchive/PlBtnExportArchive.style.js +1 -0
  155. package/dist/components/PlBtnExportArchive/PlBtnExportArchive.vue2.js +2 -0
  156. package/dist/components/PlBtnExportArchive/PlBtnExportArchive.vue2.js.map +1 -1
  157. package/dist/components/PlBtnExportArchive/Summary.js +1 -0
  158. package/dist/components/PlBtnExportArchive/Summary.style.js +1 -0
  159. package/dist/components/PlBtnExportArchive/Summary.vue2.js +2 -0
  160. package/dist/components/PlBtnExportArchive/Summary.vue2.js.map +1 -1
  161. package/dist/components/PlTableFastSearch/PlTableFastSearch.js +2 -0
  162. package/dist/components/PlTableFastSearch/PlTableFastSearch.vue2.js +2 -0
  163. package/dist/components/PlTableFastSearch/PlTableFastSearch.vue2.js.map +1 -1
  164. package/dist/components/PlTableFilters/PlTableFiltersV2.js +1 -0
  165. package/dist/components/PlTableFilters/PlTableFiltersV2.style.js +1 -0
  166. package/dist/components/PlTableFilters/PlTableFiltersV2.vue2.js +2 -0
  167. package/dist/components/PlTableFilters/PlTableFiltersV2.vue2.js.map +1 -1
  168. package/dist/composition/AgGrid/index.js +2 -0
  169. package/dist/composition/AgGrid/index.js.map +1 -1
  170. package/dist/composition/fileContent.js +2 -38
  171. package/dist/composition/fileContent.js.map +1 -1
  172. package/dist/computedResult.js +2 -30
  173. package/dist/computedResult.js.map +1 -1
  174. package/dist/createModel.js +2 -0
  175. package/dist/createModel.js.map +1 -1
  176. package/dist/defineApp.js +3 -2
  177. package/dist/defineApp.js.map +1 -1
  178. package/dist/defineStore.js +2 -0
  179. package/dist/defineStore.js.map +1 -1
  180. package/dist/index.js +1 -0
  181. package/dist/internal/UpdateSerializer.js +2 -6
  182. package/dist/internal/UpdateSerializer.js.map +1 -1
  183. package/dist/internal/createAppModel.js +2 -0
  184. package/dist/internal/createAppModel.js.map +1 -1
  185. package/dist/internal/createAppV1.js +2 -14
  186. package/dist/internal/createAppV1.js.map +1 -1
  187. package/dist/internal/createAppV2.js +3 -17
  188. package/dist/internal/createAppV2.js.map +1 -1
  189. package/dist/internal/createAppV3.js +3 -17
  190. package/dist/internal/createAppV3.js.map +1 -1
  191. package/dist/internal/service_factories.js +2 -8
  192. package/dist/internal/service_factories.js.map +1 -1
  193. package/dist/lib/util/helpers/dist/functions.js +2 -3
  194. package/dist/lib/util/helpers/dist/functions.js.map +1 -1
  195. package/dist/lib/util/helpers/dist/hash.js +1 -1
  196. package/dist/lib/util/helpers/dist/hash.js.map +1 -1
  197. package/dist/lib/util/helpers/dist/index.js +0 -2
  198. package/dist/lib/util/helpers/dist/objects.js +2 -45
  199. package/dist/lib/util/helpers/dist/objects.js.map +1 -1
  200. package/dist/lib/util/helpers/dist/prettyBytes.js +2 -0
  201. package/dist/lib/util/helpers/dist/prettyBytes.js.map +1 -1
  202. package/dist/lib/util/helpers/dist/random.js +2 -0
  203. package/dist/lib/util/helpers/dist/random.js.map +1 -1
  204. package/dist/lib/util/helpers/dist/strings.js +2 -0
  205. package/dist/lib/util/helpers/dist/strings.js.map +1 -1
  206. package/dist/lib/util/helpers/dist/uniqId.js +2 -0
  207. package/dist/lib/util/helpers/dist/uniqId.js.map +1 -1
  208. package/dist/lib/util/helpers/dist/utils.js +2 -1
  209. package/dist/lib/util/helpers/dist/utils.js.map +1 -1
  210. package/dist/objectHash.js +2 -5
  211. package/dist/objectHash.js.map +1 -1
  212. package/dist/plugins/Monetization/EndOfPeriod.js +1 -0
  213. package/dist/plugins/Monetization/EndOfPeriod.style.js +1 -0
  214. package/dist/plugins/Monetization/EndOfPeriod.vue2.js +2 -0
  215. package/dist/plugins/Monetization/EndOfPeriod.vue2.js.map +1 -1
  216. package/dist/plugins/Monetization/LimitCard.js +1 -0
  217. package/dist/plugins/Monetization/LimitCard.style.js +1 -0
  218. package/dist/plugins/Monetization/LimitCard.vue2.js +2 -0
  219. package/dist/plugins/Monetization/LimitCard.vue2.js.map +1 -1
  220. package/dist/plugins/Monetization/MonetizationSidebar.js +2 -0
  221. package/dist/plugins/Monetization/MonetizationSidebar.vue2.js +2 -0
  222. package/dist/plugins/Monetization/MonetizationSidebar.vue2.js.map +1 -1
  223. package/dist/plugins/Monetization/RunStatus.js +1 -0
  224. package/dist/plugins/Monetization/RunStatus.style.js +1 -0
  225. package/dist/plugins/Monetization/RunStatus.vue2.js +2 -0
  226. package/dist/plugins/Monetization/RunStatus.vue2.js.map +1 -1
  227. package/dist/plugins/Monetization/UserCabinetCard.js +1 -0
  228. package/dist/plugins/Monetization/UserCabinetCard.style.js +1 -0
  229. package/dist/plugins/Monetization/UserCabinetCard.vue2.js +2 -0
  230. package/dist/plugins/Monetization/UserCabinetCard.vue2.js.map +1 -1
  231. package/dist/plugins/Monetization/useButtonTarget.js +2 -0
  232. package/dist/plugins/Monetization/useButtonTarget.js.map +1 -1
  233. package/dist/plugins/Monetization/useInfo.js +2 -0
  234. package/dist/plugins/Monetization/useInfo.js.map +1 -1
  235. package/dist/plugins/Monetization/validation.js +4 -4
  236. package/dist/plugins/Monetization/validation.js.map +1 -1
  237. package/dist/urls.js +3 -1
  238. package/dist/urls.js.map +1 -1
  239. package/dist/usePlugin.js +2 -24
  240. package/dist/usePlugin.js.map +1 -1
  241. package/dist/utils.js +3 -1
  242. package/dist/utils.js.map +1 -1
  243. package/package.json +13 -13
  244. package/dist/lib/util/helpers/dist/disposable.js +0 -9
  245. package/dist/lib/util/helpers/dist/disposable.js.map +0 -1
  246. package/dist/lib/util/helpers/dist/ref_count_pool.js +0 -4
  247. package/dist/lib/util/helpers/dist/ref_count_pool.js.map +0 -1
@@ -6,45 +6,24 @@ import n from "../components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.js";
6
6
  import "../components/PlAgTextAndButtonCell/index.js";
7
7
  import r from "../components/PlAgCellProgress/PlAgCellProgress.js";
8
8
  import "../components/PlAgCellProgress/index.js";
9
- /**
10
- * Human-readable labels for each {@link ProgressStatus}.
11
- */
9
+ //#region src/AgGridVue/createAgGridColDef.ts
12
10
  var i = {
13
11
  not_started: "Not Started",
14
12
  running: "Running",
15
13
  done: "Done"
16
14
  };
17
- /**
18
- * Returns a style object that removes horizontal and vertical padding from an AG Grid cell.
19
- */
20
15
  function a() {
21
16
  return {
22
17
  "--ag-cell-horizontal-padding": "0px",
23
18
  "--ag-cell-vertical-padding": "0px"
24
19
  };
25
20
  }
26
- /**
27
- * Creates the configuration object for a progress cell renderer component.
28
- *
29
- * @param params - The properties for the progress cell component, conforming to {@link PlProgressCellProps}.
30
- * @returns An object containing the progress component and its parameters.
31
- */
32
21
  function o(e) {
33
22
  return {
34
23
  component: r,
35
24
  params: e
36
25
  };
37
26
  }
38
- /**
39
- * Enhances the given column definition to support a progress overlay if a progress callback is provided.
40
- *
41
- * This function modifies the column definition by:
42
- * - Merging no-gutters styles into the cell style.
43
- * - Overriding the `cellRendererSelector` to return a progress component when a valid progress configuration is present.
44
- *
45
- * @typeParam TData - The type of the row data.
46
- * @param def - The extended column definition to be augmented.
47
- */
48
27
  function s(t) {
49
28
  if (t.progress) {
50
29
  let n = t.progress, r = t.cellRendererSelector;
@@ -60,22 +39,10 @@ function s(t) {
60
39
  };
61
40
  }
62
41
  }
63
- /**
64
- * Creates an AG Grid column definition with extended features such as progress overlays and gutter removal.
65
- *
66
- * This function processes an extended column definition by:
67
- * - Applying progress rendering logic via {@link handleProgress} if a progress callback is provided.
68
- * - Merging no-gutters styles if the `noGutters` flag is set.
69
- * - Removing the internal properties (`progress` and `noGutters`) from the final definition.
70
- *
71
- * @typeParam TData - The type of the row data.
72
- * @typeParam TValue - The type of the cell value.
73
- * @param def - The extended column definition containing custom properties.
74
- * @returns The processed column definition ready for use with AG Grid.
75
- */
76
42
  function c(e) {
77
43
  return s(e), e.noGutters && (e.cellStyle = Object.assign({}, e.cellStyle ?? {}, a())), e.headerComponentParams && (e.headerComponent = t), e.textWithButton && (e.cellRenderer = n, typeof e.textWithButton == "boolean" ? e.cellRendererParams = { invokeRowsOnDoubleClick: !0 } : e.cellRendererParams = e.textWithButton), delete e.textWithButton, delete e.progress, delete e.noGutters, e;
78
44
  }
45
+ //#endregion
79
46
  export { c as createAgGridColDef };
80
47
 
81
48
  //# sourceMappingURL=createAgGridColDef.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createAgGridColDef.js","names":[],"sources":["../../src/AgGridVue/createAgGridColDef.ts"],"sourcesContent":["import type { ColDef, ICellRendererParams } from \"ag-grid-enterprise\";\nimport { PlAgCellProgress } from \"../components/PlAgCellProgress\";\nimport type { MaskIconName16, PlProgressCellProps } from \"@milaboratories/uikit\";\nimport { tapIf } from \"@milaboratories/helpers\";\nimport type { PlAgHeaderComponentParams } from \"../components/PlAgColumnHeader\";\nimport { PlAgColumnHeader } from \"../components/PlAgColumnHeader\";\nimport { PlAgTextAndButtonCell } from \"../components/PlAgTextAndButtonCell\";\n\n/**\n * Represents the available progress statuses for a cell.\n */\ntype ProgressStatus = \"not_started\" | \"running\" | \"done\";\n\n/**\n * Human-readable labels for each {@link ProgressStatus}.\n */\nconst progressStatusLabels: Record<ProgressStatus, string> = {\n not_started: \"Not Started\",\n running: \"Running\",\n done: \"Done\",\n};\n\n/**\n * Defines the configuration for rendering a progress overlay in a grid cell.\n *\n * When provided, a progress overlay will be rendered. If the value is\n * `undefined`, no progress overlay is shown.\n */\nexport type ColDefProgress =\n | {\n /**\n * The progress status which influences default text and styling:\n * - `'not_started'`: Typically renders gray text without a progress bar.\n * - `'running'`: Indicates an active progress state.\n * - `'done'`: Implies completion (commonly rendered as 100%).\n */\n status: ProgressStatus;\n /**\n * A number (or numeric string) between 0 and 100 that indicates progress.\n * If omitted or invalid, it implies an infinite or indeterminate progress state\n */\n percent?: number | string;\n /**\n * The main label displayed on the left side of the cell.\n */\n text?: string;\n /**\n * Additional text, often used to display the percentage by default.\n */\n suffix?: string;\n /**\n * If provided, this message takes precedence over `text` to indicate an error.\n */\n error?: string;\n }\n | undefined;\n\n/**\n * Callback function type to dynamically generate a {@link ColDefProgress} configuration\n * for a cell based on its rendering parameters.\n *\n * @typeParam TData - The type of the row data.\n * @typeParam TValue - The type of the cell value.\n *\n * @param cellData - The parameters provided by AG Grid's cell renderer.\n * @returns A {@link ColDefProgress} object to configure the progress overlay,\n * or `undefined` if no progress overlay should be rendered.\n */\nexport type ColDefProgressCallback<TData = any, TValue = any> = (\n value: TValue,\n cellData: ICellRendererParams<TData, TValue>,\n) => ColDefProgress;\n\n/**\n * Extended AG Grid column definition that supports additional properties for\n * progress overlays and layout customization.\n *\n * @typeParam TData - The type of the row data.\n * @typeParam TValue - The type of the cell value.\n *\n * @property progress - An optional callback to provide progress overlay configuration.\n * @property noGutters - If `true`, removes padding from the cell.\n */\nexport interface ColDefExtended<TData, TValue = any> extends ColDef<TData, TValue> {\n progress?: ColDefProgressCallback<TData, TValue>;\n noGutters?: boolean;\n headerComponentParams?: PlAgHeaderComponentParams;\n textWithButton?:\n | true\n | {\n /**\n * Button icon MaskIconName16\n */\n icon?: MaskIconName16;\n /**\n * Button label\n */\n btnLabel?: string;\n /**\n * If invokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row. In this case,\n * the handler passed to the component is not called, even if it is defined.\n *\n * If invokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but the provided handler will be called, receiving\n * the ICellRendererParams as an argument.\n */\n invokeRowsOnDoubleClick?: boolean;\n /**\n * plHandler parameter is a click handler that is invoked when\n * the invokeRowsOnDoubleClick property is set to false.\n */\n onClick?: (params: ICellRendererParams) => void;\n };\n}\n\n/**\n * Utility type to infer the type of a specific property key from a {@link ColDefExtended}. Maybe not useful\n */\nexport type InferColDefKey<\n TData,\n TValue,\n K extends keyof ColDefExtended<TData, TValue>,\n> = ColDefExtended<TData, TValue>[K];\n\n/**\n * Returns a style object that removes horizontal and vertical padding from an AG Grid cell.\n */\nfunction noGuttersStyle() {\n return {\n \"--ag-cell-horizontal-padding\": \"0px\",\n \"--ag-cell-vertical-padding\": \"0px\",\n };\n}\n\n/**\n * Creates the configuration object for a progress cell renderer component.\n *\n * @param params - The properties for the progress cell component, conforming to {@link PlProgressCellProps}.\n * @returns An object containing the progress component and its parameters.\n */\nfunction createProgressComponent(params: PlProgressCellProps) {\n return {\n component: PlAgCellProgress,\n params,\n };\n}\n\n/**\n * Enhances the given column definition to support a progress overlay if a progress callback is provided.\n *\n * This function modifies the column definition by:\n * - Merging no-gutters styles into the cell style.\n * - Overriding the `cellRendererSelector` to return a progress component when a valid progress configuration is present.\n *\n * @typeParam TData - The type of the row data.\n * @param def - The extended column definition to be augmented.\n */\nfunction handleProgress<TData>(def: ColDefExtended<TData>) {\n if (def.progress) {\n const progress = def.progress;\n\n const cellRendererSelector = def.cellRendererSelector;\n\n // Ensure no padding in the cell when a progress overlay is rendered.\n def.cellStyle = Object.assign({}, def.cellStyle ?? {}, noGuttersStyle());\n\n def.cellRendererSelector = (cellData) => {\n const pt = progress(cellData.value, cellData);\n\n if (!pt) {\n return cellRendererSelector?.(cellData);\n }\n\n return createProgressComponent({\n progress: tapIf(Number(pt.percent), (n) =>\n Number.isFinite(n) ? (n < 0 ? 0 : n) : undefined,\n ),\n progressString: pt.suffix ?? (pt.status === \"running\" ? `${pt.percent ?? 0}%` : \"\"),\n step: pt.text ?? progressStatusLabels[pt.status],\n stage: pt.status,\n error: pt.error,\n });\n };\n }\n}\n\n/**\n * Creates an AG Grid column definition with extended features such as progress overlays and gutter removal.\n *\n * This function processes an extended column definition by:\n * - Applying progress rendering logic via {@link handleProgress} if a progress callback is provided.\n * - Merging no-gutters styles if the `noGutters` flag is set.\n * - Removing the internal properties (`progress` and `noGutters`) from the final definition.\n *\n * @typeParam TData - The type of the row data.\n * @typeParam TValue - The type of the cell value.\n * @param def - The extended column definition containing custom properties.\n * @returns The processed column definition ready for use with AG Grid.\n */\nexport function createAgGridColDef<TData, TValue = any>(\n def: ColDefExtended<TData, TValue>,\n): ColDef<TData, TValue> {\n handleProgress(def);\n\n if (def.noGutters) {\n def.cellStyle = Object.assign({}, def.cellStyle ?? {}, noGuttersStyle());\n }\n\n if (def.headerComponentParams) {\n def.headerComponent = PlAgColumnHeader;\n }\n\n if (def.textWithButton) {\n def.cellRenderer = PlAgTextAndButtonCell;\n if (typeof def.textWithButton !== \"boolean\") {\n def.cellRendererParams = def.textWithButton;\n } else {\n def.cellRendererParams = {\n invokeRowsOnDoubleClick: true,\n };\n }\n }\n\n delete def.textWithButton;\n\n delete def.progress;\n\n delete def.noGutters;\n\n return def;\n}\n"],"mappings":";;;;;;;;;;;AAgBA,IAAM,IAAuD;CAC3D,aAAa;CACb,SAAS;CACT,MAAM;CACP;;;;AA4GD,SAAS,IAAiB;AACxB,QAAO;EACL,gCAAgC;EAChC,8BAA8B;EAC/B;;;;;;;;AASH,SAAS,EAAwB,GAA6B;AAC5D,QAAO;EACL,WAAW;EACX;EACD;;;;;;;;;;;;AAaH,SAAS,EAAsB,GAA4B;AACzD,KAAI,EAAI,UAAU;EAChB,IAAM,IAAW,EAAI,UAEf,IAAuB,EAAI;AAKjC,EAFA,EAAI,YAAY,OAAO,OAAO,EAAE,EAAE,EAAI,aAAa,EAAE,EAAE,GAAgB,CAAC,EAExE,EAAI,wBAAwB,MAAa;GACvC,IAAM,IAAK,EAAS,EAAS,OAAO,EAAS;AAM7C,UAJK,IAIE,EAAwB;IAC7B,UAAU,EAAM,OAAO,EAAG,QAAQ,GAAG,MACnC,OAAO,SAAS,EAAE,GAAI,IAAI,IAAI,IAAI,IAAK,KAAA,EACxC;IACD,gBAAgB,EAAG,WAAW,EAAG,WAAW,YAAY,GAAG,EAAG,WAAW,EAAE,KAAK;IAChF,MAAM,EAAG,QAAQ,EAAqB,EAAG;IACzC,OAAO,EAAG;IACV,OAAO,EAAG;IACX,CAAC,GAXO,IAAuB,EAAS;;;;;;;;;;;;;;;;;AA6B/C,SAAgB,EACd,GACuB;AA4BvB,QA3BA,EAAe,EAAI,EAEf,EAAI,cACN,EAAI,YAAY,OAAO,OAAO,EAAE,EAAE,EAAI,aAAa,EAAE,EAAE,GAAgB,CAAC,GAGtE,EAAI,0BACN,EAAI,kBAAkB,IAGpB,EAAI,mBACN,EAAI,eAAe,GACf,OAAO,EAAI,kBAAmB,YAGhC,EAAI,qBAAqB,EACvB,yBAAyB,IAC1B,GAJD,EAAI,qBAAqB,EAAI,iBAQjC,OAAO,EAAI,gBAEX,OAAO,EAAI,UAEX,OAAO,EAAI,WAEJ"}
1
+ {"version":3,"file":"createAgGridColDef.js","names":[],"sources":["../../src/AgGridVue/createAgGridColDef.ts"],"sourcesContent":["import type { ColDef, ICellRendererParams } from \"ag-grid-enterprise\";\nimport { PlAgCellProgress } from \"../components/PlAgCellProgress\";\nimport type { MaskIconName16, PlProgressCellProps } from \"@milaboratories/uikit\";\nimport { tapIf } from \"@milaboratories/helpers\";\nimport type { PlAgHeaderComponentParams } from \"../components/PlAgColumnHeader\";\nimport { PlAgColumnHeader } from \"../components/PlAgColumnHeader\";\nimport { PlAgTextAndButtonCell } from \"../components/PlAgTextAndButtonCell\";\n\n/**\n * Represents the available progress statuses for a cell.\n */\ntype ProgressStatus = \"not_started\" | \"running\" | \"done\";\n\n/**\n * Human-readable labels for each {@link ProgressStatus}.\n */\nconst progressStatusLabels: Record<ProgressStatus, string> = {\n not_started: \"Not Started\",\n running: \"Running\",\n done: \"Done\",\n};\n\n/**\n * Defines the configuration for rendering a progress overlay in a grid cell.\n *\n * When provided, a progress overlay will be rendered. If the value is\n * `undefined`, no progress overlay is shown.\n */\nexport type ColDefProgress =\n | {\n /**\n * The progress status which influences default text and styling:\n * - `'not_started'`: Typically renders gray text without a progress bar.\n * - `'running'`: Indicates an active progress state.\n * - `'done'`: Implies completion (commonly rendered as 100%).\n */\n status: ProgressStatus;\n /**\n * A number (or numeric string) between 0 and 100 that indicates progress.\n * If omitted or invalid, it implies an infinite or indeterminate progress state\n */\n percent?: number | string;\n /**\n * The main label displayed on the left side of the cell.\n */\n text?: string;\n /**\n * Additional text, often used to display the percentage by default.\n */\n suffix?: string;\n /**\n * If provided, this message takes precedence over `text` to indicate an error.\n */\n error?: string;\n }\n | undefined;\n\n/**\n * Callback function type to dynamically generate a {@link ColDefProgress} configuration\n * for a cell based on its rendering parameters.\n *\n * @typeParam TData - The type of the row data.\n * @typeParam TValue - The type of the cell value.\n *\n * @param cellData - The parameters provided by AG Grid's cell renderer.\n * @returns A {@link ColDefProgress} object to configure the progress overlay,\n * or `undefined` if no progress overlay should be rendered.\n */\nexport type ColDefProgressCallback<TData = any, TValue = any> = (\n value: TValue,\n cellData: ICellRendererParams<TData, TValue>,\n) => ColDefProgress;\n\n/**\n * Extended AG Grid column definition that supports additional properties for\n * progress overlays and layout customization.\n *\n * @typeParam TData - The type of the row data.\n * @typeParam TValue - The type of the cell value.\n *\n * @property progress - An optional callback to provide progress overlay configuration.\n * @property noGutters - If `true`, removes padding from the cell.\n */\nexport interface ColDefExtended<TData, TValue = any> extends ColDef<TData, TValue> {\n progress?: ColDefProgressCallback<TData, TValue>;\n noGutters?: boolean;\n headerComponentParams?: PlAgHeaderComponentParams;\n textWithButton?:\n | true\n | {\n /**\n * Button icon MaskIconName16\n */\n icon?: MaskIconName16;\n /**\n * Button label\n */\n btnLabel?: string;\n /**\n * If invokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row. In this case,\n * the handler passed to the component is not called, even if it is defined.\n *\n * If invokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but the provided handler will be called, receiving\n * the ICellRendererParams as an argument.\n */\n invokeRowsOnDoubleClick?: boolean;\n /**\n * plHandler parameter is a click handler that is invoked when\n * the invokeRowsOnDoubleClick property is set to false.\n */\n onClick?: (params: ICellRendererParams) => void;\n };\n}\n\n/**\n * Utility type to infer the type of a specific property key from a {@link ColDefExtended}. Maybe not useful\n */\nexport type InferColDefKey<\n TData,\n TValue,\n K extends keyof ColDefExtended<TData, TValue>,\n> = ColDefExtended<TData, TValue>[K];\n\n/**\n * Returns a style object that removes horizontal and vertical padding from an AG Grid cell.\n */\nfunction noGuttersStyle() {\n return {\n \"--ag-cell-horizontal-padding\": \"0px\",\n \"--ag-cell-vertical-padding\": \"0px\",\n };\n}\n\n/**\n * Creates the configuration object for a progress cell renderer component.\n *\n * @param params - The properties for the progress cell component, conforming to {@link PlProgressCellProps}.\n * @returns An object containing the progress component and its parameters.\n */\nfunction createProgressComponent(params: PlProgressCellProps) {\n return {\n component: PlAgCellProgress,\n params,\n };\n}\n\n/**\n * Enhances the given column definition to support a progress overlay if a progress callback is provided.\n *\n * This function modifies the column definition by:\n * - Merging no-gutters styles into the cell style.\n * - Overriding the `cellRendererSelector` to return a progress component when a valid progress configuration is present.\n *\n * @typeParam TData - The type of the row data.\n * @param def - The extended column definition to be augmented.\n */\nfunction handleProgress<TData>(def: ColDefExtended<TData>) {\n if (def.progress) {\n const progress = def.progress;\n\n const cellRendererSelector = def.cellRendererSelector;\n\n // Ensure no padding in the cell when a progress overlay is rendered.\n def.cellStyle = Object.assign({}, def.cellStyle ?? {}, noGuttersStyle());\n\n def.cellRendererSelector = (cellData) => {\n const pt = progress(cellData.value, cellData);\n\n if (!pt) {\n return cellRendererSelector?.(cellData);\n }\n\n return createProgressComponent({\n progress: tapIf(Number(pt.percent), (n) =>\n Number.isFinite(n) ? (n < 0 ? 0 : n) : undefined,\n ),\n progressString: pt.suffix ?? (pt.status === \"running\" ? `${pt.percent ?? 0}%` : \"\"),\n step: pt.text ?? progressStatusLabels[pt.status],\n stage: pt.status,\n error: pt.error,\n });\n };\n }\n}\n\n/**\n * Creates an AG Grid column definition with extended features such as progress overlays and gutter removal.\n *\n * This function processes an extended column definition by:\n * - Applying progress rendering logic via {@link handleProgress} if a progress callback is provided.\n * - Merging no-gutters styles if the `noGutters` flag is set.\n * - Removing the internal properties (`progress` and `noGutters`) from the final definition.\n *\n * @typeParam TData - The type of the row data.\n * @typeParam TValue - The type of the cell value.\n * @param def - The extended column definition containing custom properties.\n * @returns The processed column definition ready for use with AG Grid.\n */\nexport function createAgGridColDef<TData, TValue = any>(\n def: ColDefExtended<TData, TValue>,\n): ColDef<TData, TValue> {\n handleProgress(def);\n\n if (def.noGutters) {\n def.cellStyle = Object.assign({}, def.cellStyle ?? {}, noGuttersStyle());\n }\n\n if (def.headerComponentParams) {\n def.headerComponent = PlAgColumnHeader;\n }\n\n if (def.textWithButton) {\n def.cellRenderer = PlAgTextAndButtonCell;\n if (typeof def.textWithButton !== \"boolean\") {\n def.cellRendererParams = def.textWithButton;\n } else {\n def.cellRendererParams = {\n invokeRowsOnDoubleClick: true,\n };\n }\n }\n\n delete def.textWithButton;\n\n delete def.progress;\n\n delete def.noGutters;\n\n return def;\n}\n"],"mappings":";;;;;;;;;AAgBA,IAAM,IAAuD;CAC3D,aAAa;CACb,SAAS;CACT,MAAM;CACP;AA4GD,SAAS,IAAiB;AACxB,QAAO;EACL,gCAAgC;EAChC,8BAA8B;EAC/B;;AASH,SAAS,EAAwB,GAA6B;AAC5D,QAAO;EACL,WAAW;EACX;EACD;;AAaH,SAAS,EAAsB,GAA4B;AACzD,KAAI,EAAI,UAAU;EAChB,IAAM,IAAW,EAAI,UAEf,IAAuB,EAAI;AAKjC,EAFA,EAAI,YAAY,OAAO,OAAO,EAAE,EAAE,EAAI,aAAa,EAAE,EAAE,GAAgB,CAAC,EAExE,EAAI,wBAAwB,MAAa;GACvC,IAAM,IAAK,EAAS,EAAS,OAAO,EAAS;AAM7C,UAJK,IAIE,EAAwB;IAC7B,UAAU,EAAM,OAAO,EAAG,QAAQ,GAAG,MACnC,OAAO,SAAS,EAAE,GAAI,IAAI,IAAI,IAAI,IAAK,KAAA,EACxC;IACD,gBAAgB,EAAG,WAAW,EAAG,WAAW,YAAY,GAAG,EAAG,WAAW,EAAE,KAAK;IAChF,MAAM,EAAG,QAAQ,EAAqB,EAAG;IACzC,OAAO,EAAG;IACV,OAAO,EAAG;IACX,CAAC,GAXO,IAAuB,EAAS;;;;AA6B/C,SAAgB,EACd,GACuB;AA4BvB,QA3BA,EAAe,EAAI,EAEf,EAAI,cACN,EAAI,YAAY,OAAO,OAAO,EAAE,EAAE,EAAI,aAAa,EAAE,EAAE,GAAgB,CAAC,GAGtE,EAAI,0BACN,EAAI,kBAAkB,IAGpB,EAAI,mBACN,EAAI,eAAe,GACf,OAAO,EAAI,kBAAmB,YAGhC,EAAI,qBAAqB,EACvB,yBAAyB,IAC1B,GAJD,EAAI,qBAAqB,EAAI,iBAQjC,OAAO,EAAI,gBAEX,OAAO,EAAI,UAEX,OAAO,EAAI,WAEJ"}
@@ -1,8 +1,4 @@
1
- /**
2
- * Returns the number of selected rows in the grid.
3
- * @param gridApi - The grid API.
4
- * @returns The number of selected rows.
5
- */
1
+ //#region src/AgGridVue/selection.ts
6
2
  function e(e) {
7
3
  if (!e.getGridOption("loading")) switch (e.getGridOption("rowModelType")) {
8
4
  case "clientSide": return e.getSelectedRows().length;
@@ -10,10 +6,6 @@ function e(e) {
10
6
  }
11
7
  return 0;
12
8
  }
13
- /**
14
- * Selects all rows in the grid.
15
- * @param gridApi - The grid API.
16
- */
17
9
  function t(e) {
18
10
  switch (e.getGridOption("rowModelType")) {
19
11
  case "clientSide":
@@ -24,10 +16,6 @@ function t(e) {
24
16
  });
25
17
  }
26
18
  }
27
- /**
28
- * Deselects all rows in the grid.
29
- * @param gridApi - The grid API.
30
- */
31
19
  function n(e) {
32
20
  switch (e.getGridOption("rowModelType")) {
33
21
  case "clientSide":
@@ -39,22 +27,13 @@ function n(e) {
39
27
  });
40
28
  }
41
29
  }
42
- /**
43
- * Returns the total number of rows in the grid.
44
- * @param gridApi - The grid API.
45
- * @returns The total number of rows.
46
- */
47
30
  function r(e) {
48
31
  return e.getGridOption("loading") ? 0 : e.getDisplayedRowCount();
49
32
  }
50
- /**
51
- * Returns true if selection is enabled in the grid.
52
- * @param gridApi - The grid API.
53
- * @returns True if selection is enabled.
54
- */
55
33
  function i(e) {
56
34
  return !!e.getGridOption("rowSelection");
57
35
  }
36
+ //#endregion
58
37
  export { n as deselectAll, e as getSelectedRowsCount, r as getTotalRowsCount, i as isSelectionEnabled, t as selectAll };
59
38
 
60
39
  //# sourceMappingURL=selection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"selection.js","names":[],"sources":["../../src/AgGridVue/selection.ts"],"sourcesContent":["import type { GridApi } from \"ag-grid-enterprise\";\n\n/**\n * Returns the number of selected rows in the grid.\n * @param gridApi - The grid API.\n * @returns The number of selected rows.\n */\nexport function getSelectedRowsCount(gridApi: GridApi) {\n if (!gridApi.getGridOption(\"loading\")) {\n const rowModel = gridApi.getGridOption(\"rowModelType\");\n switch (rowModel) {\n case \"clientSide\": {\n return gridApi.getSelectedRows().length;\n }\n case \"serverSide\": {\n const state = gridApi.getServerSideSelectionState();\n // `state.selectAll` flag is ignored as we assume `selectAll` was used to select all rows\n return state?.toggledNodes?.length ?? 0;\n }\n }\n }\n return 0;\n}\n\n/**\n * Selects all rows in the grid.\n * @param gridApi - The grid API.\n */\nexport function selectAll(gridApi: GridApi) {\n const rowModel = gridApi.getGridOption(\"rowModelType\");\n switch (rowModel) {\n case \"clientSide\": {\n gridApi.selectAll();\n break;\n }\n case \"serverSide\": {\n // Instead of using `selectAll` we set selection state manually\n // as `selectAll` will not give us the selected rows ids.\n // `forEachNode` goes over all cached rows, so increase cached block size\n // to match the number of rows you expect to be selected at most\n gridApi.forEachNode((node) => {\n node.setSelected(true);\n });\n }\n }\n}\n\n/**\n * Deselects all rows in the grid.\n * @param gridApi - The grid API.\n */\nexport function deselectAll(gridApi: GridApi) {\n const rowModel = gridApi.getGridOption(\"rowModelType\");\n switch (rowModel) {\n case \"clientSide\": {\n gridApi.deselectAll();\n break;\n }\n case \"serverSide\": {\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n }\n}\n\n/**\n * Returns the total number of rows in the grid.\n * @param gridApi - The grid API.\n * @returns The total number of rows.\n */\nexport function getTotalRowsCount(gridApi: GridApi) {\n return gridApi.getGridOption(\"loading\") ? 0 : gridApi.getDisplayedRowCount();\n}\n\n/**\n * Returns true if selection is enabled in the grid.\n * @param gridApi - The grid API.\n * @returns True if selection is enabled.\n */\nexport function isSelectionEnabled(gridApi: GridApi) {\n return Boolean(gridApi.getGridOption(\"rowSelection\"));\n}\n"],"mappings":";;;;;AAOA,SAAgB,EAAqB,GAAkB;AACrD,KAAI,CAAC,EAAQ,cAAc,UAAU,CAEnC,SADiB,EAAQ,cAAc,eAAe,EACtD;EACE,KAAK,aACH,QAAO,EAAQ,iBAAiB,CAAC;EAEnC,KAAK,aAGH,QAFc,EAAQ,6BAA6B,EAErC,cAAc,UAAU;;AAI5C,QAAO;;;;;;AAOT,SAAgB,EAAU,GAAkB;AAE1C,SADiB,EAAQ,cAAc,eAAe,EACtD;EACE,KAAK;AACH,KAAQ,WAAW;AACnB;EAEF,KAAK,aAKH,GAAQ,aAAa,MAAS;AAC5B,KAAK,YAAY,GAAK;IACtB;;;;;;;AASR,SAAgB,EAAY,GAAkB;AAE5C,SADiB,EAAQ,cAAc,eAAe,EACtD;EACE,KAAK;AACH,KAAQ,aAAa;AACrB;EAEF,KAAK,aACH,GAAQ,4BAA4B;GAClC,WAAW;GACX,cAAc,EAAE;GACjB,CAAC;;;;;;;;AAUR,SAAgB,EAAkB,GAAkB;AAClD,QAAO,EAAQ,cAAc,UAAU,GAAG,IAAI,EAAQ,sBAAsB;;;;;;;AAQ9E,SAAgB,EAAmB,GAAkB;AACnD,QAAO,EAAQ,EAAQ,cAAc,eAAe"}
1
+ {"version":3,"file":"selection.js","names":[],"sources":["../../src/AgGridVue/selection.ts"],"sourcesContent":["import type { GridApi } from \"ag-grid-enterprise\";\n\n/**\n * Returns the number of selected rows in the grid.\n * @param gridApi - The grid API.\n * @returns The number of selected rows.\n */\nexport function getSelectedRowsCount(gridApi: GridApi) {\n if (!gridApi.getGridOption(\"loading\")) {\n const rowModel = gridApi.getGridOption(\"rowModelType\");\n switch (rowModel) {\n case \"clientSide\": {\n return gridApi.getSelectedRows().length;\n }\n case \"serverSide\": {\n const state = gridApi.getServerSideSelectionState();\n // `state.selectAll` flag is ignored as we assume `selectAll` was used to select all rows\n return state?.toggledNodes?.length ?? 0;\n }\n }\n }\n return 0;\n}\n\n/**\n * Selects all rows in the grid.\n * @param gridApi - The grid API.\n */\nexport function selectAll(gridApi: GridApi) {\n const rowModel = gridApi.getGridOption(\"rowModelType\");\n switch (rowModel) {\n case \"clientSide\": {\n gridApi.selectAll();\n break;\n }\n case \"serverSide\": {\n // Instead of using `selectAll` we set selection state manually\n // as `selectAll` will not give us the selected rows ids.\n // `forEachNode` goes over all cached rows, so increase cached block size\n // to match the number of rows you expect to be selected at most\n gridApi.forEachNode((node) => {\n node.setSelected(true);\n });\n }\n }\n}\n\n/**\n * Deselects all rows in the grid.\n * @param gridApi - The grid API.\n */\nexport function deselectAll(gridApi: GridApi) {\n const rowModel = gridApi.getGridOption(\"rowModelType\");\n switch (rowModel) {\n case \"clientSide\": {\n gridApi.deselectAll();\n break;\n }\n case \"serverSide\": {\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n }\n}\n\n/**\n * Returns the total number of rows in the grid.\n * @param gridApi - The grid API.\n * @returns The total number of rows.\n */\nexport function getTotalRowsCount(gridApi: GridApi) {\n return gridApi.getGridOption(\"loading\") ? 0 : gridApi.getDisplayedRowCount();\n}\n\n/**\n * Returns true if selection is enabled in the grid.\n * @param gridApi - The grid API.\n * @returns True if selection is enabled.\n */\nexport function isSelectionEnabled(gridApi: GridApi) {\n return Boolean(gridApi.getGridOption(\"rowSelection\"));\n}\n"],"mappings":";AAOA,SAAgB,EAAqB,GAAkB;AACrD,KAAI,CAAC,EAAQ,cAAc,UAAU,CAEnC,SADiB,EAAQ,cAAc,eAAe,EACtD;EACE,KAAK,aACH,QAAO,EAAQ,iBAAiB,CAAC;EAEnC,KAAK,aAGH,QAFc,EAAQ,6BAA6B,EAErC,cAAc,UAAU;;AAI5C,QAAO;;AAOT,SAAgB,EAAU,GAAkB;AAE1C,SADiB,EAAQ,cAAc,eAAe,EACtD;EACE,KAAK;AACH,KAAQ,WAAW;AACnB;EAEF,KAAK,aAKH,GAAQ,aAAa,MAAS;AAC5B,KAAK,YAAY,GAAK;IACtB;;;AASR,SAAgB,EAAY,GAAkB;AAE5C,SADiB,EAAQ,cAAc,eAAe,EACtD;EACE,KAAK;AACH,KAAQ,aAAa;AACrB;EAEF,KAAK,aACH,GAAQ,4BAA4B;GAClC,WAAW;GACX,cAAc,EAAE;GACjB,CAAC;;;AAUR,SAAgB,EAAkB,GAAkB;AAClD,QAAO,EAAQ,cAAc,UAAU,GAAG,IAAI,EAAQ,sBAAsB;;AAQ9E,SAAgB,EAAmB,GAAkB;AACnD,QAAO,EAAQ,EAAQ,cAAc,eAAe"}
@@ -14,6 +14,7 @@ import l from "../components/PlAgCellStatusTag/PlAgCellStatusTag.js";
14
14
  import "../components/PlAgCellStatusTag/index.js";
15
15
  import { computed as u, shallowRef as d, watch as f } from "vue";
16
16
  import { whenever as p } from "@vueuse/core";
17
+ //#region src/AgGridVue/useAgGridOptions.ts
17
18
  var m = class {
18
19
  #e = {};
19
20
  options(e) {
@@ -22,109 +23,42 @@ var m = class {
22
23
  get columnDefs() {
23
24
  return this.#e.columnDefs ?? [];
24
25
  }
25
- /**
26
- * Set default column definition
27
- * @param def - column definition
28
- * @returns this
29
- */
30
26
  setDefaultColDef(e) {
31
27
  return this.#e.defaultColDef = e, this;
32
28
  }
33
- /**
34
- * Show loading overlay
35
- * @param loading
36
- * @returns this
37
- */
38
29
  setLoading(e) {
39
30
  return this.#e.loading = e, this;
40
31
  }
41
- /**
42
- * Set loading overlay custom text (default is "Loading")
43
- * @param loadingText
44
- * @returns this
45
- */
46
32
  setLoadingText(e) {
47
33
  return this.#e.loadingText = e, this;
48
34
  }
49
- /**
50
- * Show "not ready overlay
51
- * @param notReady
52
- * @returns this
53
- */
54
35
  setNotReady(e) {
55
36
  return this.#e.notReady = e, this;
56
37
  }
57
- /**
58
- * Set "not ready" text
59
- * @param notReadyText
60
- * @returns this
61
- */
62
38
  setNotReadyText(e) {
63
39
  return this.#e.notReadyText = e, this;
64
40
  }
65
- /**
66
- * Set "no rows" text when there are no rows (default is "Empty")
67
- * @param noRowsText
68
- * @returns this
69
- */
70
41
  setNoRowsText(e) {
71
42
  return this.#e.noRowsText = e, this;
72
43
  }
73
- /**
74
- * Set row selection options
75
- * @param rowSelection
76
- * @returns this
77
- */
78
44
  setRowSelection(e) {
79
45
  return this.#e.rowSelection = e, this;
80
46
  }
81
- /**
82
- * Set row data
83
- * @param rowData
84
- * @returns this
85
- */
86
47
  setRowData(e) {
87
48
  return this.#e.rowData = e, this;
88
49
  }
89
- /**
90
- * Set components
91
- * @param components
92
- * @returns this
93
- */
94
50
  setComponents(e) {
95
51
  return this.#e.components = e, this;
96
52
  }
97
- /**
98
- * Set an option
99
- * @param key - option key
100
- * @param value - option value
101
- * @returns this
102
- */
103
53
  setOption(e, t) {
104
54
  return this.#e[e] = t, this;
105
55
  }
106
- /**
107
- * Add an extended column definition
108
- * @param def - column definition
109
- * @returns this
110
- */
111
56
  column(e) {
112
57
  return this.#e.columnDefs = [...this.columnDefs, e], this;
113
58
  }
114
- /**
115
- * Show row numbers column
116
- * @param show - show or hide row numbers column
117
- * @returns this
118
- */
119
59
  columnRowNumbers(e = !0) {
120
60
  return this.#e.rowNumbersColumn = e, this;
121
61
  }
122
- /**
123
- * Add a file input column
124
- * @param def - column definition
125
- * @param cb - callback to set params for the file input cell renderer
126
- * @returns this
127
- */
128
62
  columnFileInput(e) {
129
63
  return this.column(Object.assign({
130
64
  cellRenderer: "PlAgCellFile",
@@ -145,22 +79,6 @@ var m = class {
145
79
  return this.#e;
146
80
  }
147
81
  };
148
- /**
149
- * Returns a set of Ag Grid options along with a reference to the Ag Grid API.
150
- * (This is a fast prototype)
151
- *
152
- * @example
153
- * ```ts
154
- * const { gridOptions, gridApi } = useAgGridOptions(() => ({
155
- * // custom grid options here
156
- * }));
157
- *
158
- * // Usage in a template (v-bind is required!)
159
- * <template>
160
- * <AgGridVue :style="{ height: '100%' }" v-bind="gridOptions" />
161
- * </template>
162
- * ```
163
- */
164
82
  function h(h) {
165
83
  let g = d(), _ = u(() => {
166
84
  let u = {
@@ -214,6 +132,7 @@ function h(h) {
214
132
  gridApi: g
215
133
  };
216
134
  }
135
+ //#endregion
217
136
  export { h as useAgGridOptions };
218
137
 
219
138
  //# sourceMappingURL=useAgGridOptions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAgGridOptions.js","names":["#options"],"sources":["../../src/AgGridVue/useAgGridOptions.ts"],"sourcesContent":["/**/\nimport type {\n ColGroupDef,\n GridApi,\n GridOptions,\n GridReadyEvent,\n ICellRendererParams,\n RowSelectionOptions,\n ValueSetterParams,\n} from \"ag-grid-enterprise\";\nimport type { Component } from \"vue\";\nimport { computed, shallowRef, watch } from \"vue\";\nimport {\n autoSizeRowNumberColumn,\n makeRowNumberColDef,\n PlAgOverlayLoading,\n type PlAgOverlayLoadingParams,\n} from \"../components/PlAgDataTable\";\nimport { PlAgOverlayNoRows } from \"../components/PlAgDataTable\";\nimport { createAgGridColDef, type ColDefExtended } from \"./createAgGridColDef\";\nimport { whenever } from \"@vueuse/core\";\nimport { PlAgCellFile } from \"../components/PlAgCellFile\";\nimport { PlAgChartStackedBarCell } from \"../components/PlAgChartStackedBarCell\";\nimport { PlAgChartHistogramCell } from \"../components/PlAgChartHistogramCell\";\nimport type { ImportFileHandle } from \"@platforma-sdk/model\";\nimport type { ImportProgress } from \"@platforma-sdk/model\";\nimport { PlAgCellStatusTag } from \"../components/PlAgCellStatusTag\";\nimport { AgGridTheme } from \"./AgGridTheme\";\ninterface GridOptionsExtended<TData = any> extends Omit<\n GridOptions<TData>,\n \"columnDefs\" | \"loadingOverlayComponentParams\"\n> {\n /**\n * Array of Column / Column Group definitions.\n */\n columnDefs?: (ColDefExtended<TData> | ColGroupDef<TData>)[] | null;\n /**\n * Show row numbers column\n */\n rowNumbersColumn?: boolean;\n /**\n * Loading overlay text\n */\n loadingText?: string;\n /**\n * Not ready overlay (Data is not computed). Takes priority over \"loading\"\n */\n notReady?: boolean;\n /**\n * \"Data is not computed\" by default\n */\n notReadyText?: string;\n /**\n * Override standard 'Empty' text for the \"no rows\" overlay\n */\n noRowsText?: string;\n /**\n * @deprecated Use loading, notReady, loadingText instead\n */\n loadingOverlayComponentParams?: never;\n}\n\n// @TODO (super simple builder for now)\nclass Builder<TData> {\n #options: GridOptionsExtended<TData> = {};\n\n public options(options: GridOptionsExtended<TData>) {\n this.#options = Object.assign({}, this.#options, options);\n return this;\n }\n\n private get columnDefs() {\n return this.#options.columnDefs ?? [];\n }\n\n /**\n * Set default column definition\n * @param def - column definition\n * @returns this\n */\n public setDefaultColDef(def: ColDefExtended<TData>) {\n this.#options.defaultColDef = def;\n return this;\n }\n\n /**\n * Show loading overlay\n * @param loading\n * @returns this\n */\n public setLoading(loading?: boolean) {\n this.#options.loading = loading;\n return this;\n }\n\n /**\n * Set loading overlay custom text (default is \"Loading\")\n * @param loadingText\n * @returns this\n */\n public setLoadingText(loadingText?: string) {\n this.#options.loadingText = loadingText;\n return this;\n }\n\n /**\n * Show \"not ready overlay\n * @param notReady\n * @returns this\n */\n public setNotReady(notReady?: boolean) {\n this.#options.notReady = notReady;\n return this;\n }\n\n /**\n * Set \"not ready\" text\n * @param notReadyText\n * @returns this\n */\n public setNotReadyText(notReadyText?: string) {\n this.#options.notReadyText = notReadyText;\n return this;\n }\n\n /**\n * Set \"no rows\" text when there are no rows (default is \"Empty\")\n * @param noRowsText\n * @returns this\n */\n public setNoRowsText(noRowsText?: string) {\n this.#options.noRowsText = noRowsText;\n return this;\n }\n\n /**\n * Set row selection options\n * @param rowSelection\n * @returns this\n */\n public setRowSelection(rowSelection?: RowSelectionOptions) {\n this.#options.rowSelection = rowSelection;\n return this;\n }\n\n /**\n * Set row data\n * @param rowData\n * @returns this\n */\n public setRowData(rowData?: TData[]) {\n this.#options.rowData = rowData;\n return this;\n }\n\n /**\n * Set components\n * @param components\n * @returns this\n */\n public setComponents(components?: Record<string, Component>) {\n this.#options.components = components;\n return this;\n }\n\n /**\n * Set an option\n * @param key - option key\n * @param value - option value\n * @returns this\n */\n public setOption<K extends keyof GridOptionsExtended<TData>>(\n key: K,\n value: GridOptionsExtended<TData>[K],\n ) {\n this.#options[key] = value;\n return this;\n }\n\n /**\n * Add an extended column definition\n * @param def - column definition\n * @returns this\n */\n public column<TValue = any>(def: ColDefExtended<TData, TValue>) {\n this.#options.columnDefs = [...this.columnDefs, def];\n return this;\n }\n\n /**\n * Show row numbers column\n * @param show - show or hide row numbers column\n * @returns this\n */\n public columnRowNumbers(show: boolean = true) {\n this.#options.rowNumbersColumn = show;\n return this;\n }\n\n /**\n * Add a file input column\n * @param def - column definition\n * @param cb - callback to set params for the file input cell renderer\n * @returns this\n */\n public columnFileInput<TValue = any>(\n def: ColDefExtended<TData, TValue> & {\n /**\n * Allowed file extensions (like ['fastq.gz'])\n */\n extensions?: string[];\n /**\n * The resolveProgress function is an optional input parameter for the component\n * that allows tracking the file upload progress in real-time.\n * By passing resolveProgress, you can ensure that the component\n * displays accurate progress values for each file as they upload.\n * How to use it in AgGrid\n * cellRendererParams: {\n * resolveProgress: (cellData) => {\n * const progresses = app.progresses;\n * if (!cellData.value.importFileHandle) return undefined;\n * else return progresses[cellData.value.importFileHandle];\n * }\n * }\n */\n resolveImportProgress?: (\n cellData: ICellRendererParams<TData, TValue>,\n ) => ImportProgress | undefined;\n\n /**\n * The resolveFileHandle function is an optional input parameter for the component\n * that allows tracking the file upload progress in real-time.\n * By passing resolveFileHandle, you can ensure that the component\n * displays accurate progress values for each file as they upload.\n * How to use it in AgGrid\n * cellRendererParams: {\n * resolveFileHandle: (cellData) => {\n * return cellData.value.importFileHandle;\n * }\n * }\n */\n resolveImportFileHandle?: (\n cellData: ICellRendererParams<TData, TValue>,\n ) => ImportFileHandle | undefined;\n\n setImportFileHandle?: (d: ValueSetterParams<TData, ImportFileHandle | undefined>) => void;\n },\n ) {\n return this.column(\n Object.assign(\n {\n cellRenderer: \"PlAgCellFile\",\n headerComponentParams: { type: \"File\" },\n cellStyle: { padding: 0 },\n valueSetter: (d: ValueSetterParams<TData, ImportFileHandle | undefined>) => {\n def.setImportFileHandle?.(d);\n return true;\n },\n cellRendererSelector: (cellData: ICellRendererParams<TData, TValue>) => {\n return {\n component: \"PlAgCellFile\",\n params: {\n extensions: def.extensions,\n value: def.resolveImportFileHandle?.(cellData),\n resolveProgress: () => {\n return def.resolveImportProgress?.(cellData);\n },\n },\n };\n },\n },\n def,\n ),\n );\n }\n\n public build() {\n return this.#options;\n }\n}\n\n// Simple helper to use like column<string> in grid options literal\ntype ColumnFunc<TData> = <TValue>(\n def: ColDefExtended<TData, TValue>,\n) => ColDefExtended<TData, TValue>;\n\n/**\n * Returns a set of Ag Grid options along with a reference to the Ag Grid API.\n * (This is a fast prototype)\n *\n * @example\n * ```ts\n * const { gridOptions, gridApi } = useAgGridOptions(() => ({\n * // custom grid options here\n * }));\n *\n * // Usage in a template (v-bind is required!)\n * <template>\n * <AgGridVue :style=\"{ height: '100%' }\" v-bind=\"gridOptions\" />\n * </template>\n * ```\n */\nexport function useAgGridOptions<TData>(\n factory: (context: {\n builder: Builder<TData>;\n column: ColumnFunc<TData>;\n }) => Builder<TData> | GridOptionsExtended<TData>,\n) {\n const gridApi = shallowRef<GridApi>();\n\n const extOptions = computed<GridOptionsExtended>(() => {\n const def: GridOptionsExtended<TData> = {\n theme: AgGridTheme,\n loadingOverlayComponent: PlAgOverlayLoading,\n noRowsOverlayComponent: PlAgOverlayNoRows,\n onGridReady: (e: GridReadyEvent) => {\n gridApi.value = e.api;\n autoSizeRowNumberColumn(e.api); // @TODO\n },\n };\n\n const column = <TValue>(def: ColDefExtended<TData, TValue>) => {\n return def;\n };\n\n const result = factory({ builder: new Builder(), column });\n\n const options = Object.assign({}, def, result instanceof Builder ? result.build() : result);\n\n if (options.rowNumbersColumn) {\n options.columnDefs = [makeRowNumberColDef(), ...(options.columnDefs ?? [])];\n }\n\n if (options.noRowsText) {\n options.noRowsOverlayComponentParams = {\n text: options.noRowsText,\n };\n }\n\n if (\"loadingOverlayComponentParams\" in options) {\n console.warn(\n \"useAgGridOptions: remove loadingOverlayComponentParams from options, use loading, notReady, loadingText instead\",\n );\n }\n\n options.loading = options.notReady || options.loading;\n\n options.columnDefs = options.columnDefs?.map((it) => createAgGridColDef(it));\n\n // Register all special components\n options.components = Object.assign({}, options.components ?? {}, {\n PlAgCellFile,\n PlAgChartStackedBarCell,\n PlAgChartHistogramCell,\n PlAgCellStatusTag,\n });\n\n return options;\n });\n\n const gridOptions = computed<GridOptions>(() => {\n const options = extOptions.value;\n\n return {\n ...options,\n loadingOverlayComponentParams: {\n variant: options.notReady ? \"not-ready\" : \"loading\",\n notReadyText: options.notReadyText,\n loadingText: options.loadingText,\n } satisfies PlAgOverlayLoadingParams,\n };\n });\n\n whenever(\n () => extOptions.value.rowNumbersColumn,\n () => {\n if (gridApi.value) {\n autoSizeRowNumberColumn(gridApi.value);\n }\n },\n );\n\n watch(\n [() => extOptions.value.notReady, () => extOptions.value.loading],\n ([notReady, loading]) => {\n const loadingOverlayComponentParams = {\n variant: notReady ? \"not-ready\" : \"loading\",\n // we probably don't need to update the parameters below\n notReadyText: extOptions.value.notReadyText,\n loadingText: extOptions.value.loadingText,\n } satisfies PlAgOverlayLoadingParams;\n\n // Hack to apply loadingOverlayComponentParams\n gridApi.value?.updateGridOptions({\n loading: !loading,\n loadingOverlayComponentParams,\n });\n\n gridApi.value?.updateGridOptions({\n loading,\n loadingOverlayComponentParams,\n });\n },\n { deep: true, immediate: true },\n );\n\n return { gridOptions, gridApi };\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"useAgGridOptions.js","names":["#options"],"sources":["../../src/AgGridVue/useAgGridOptions.ts"],"sourcesContent":["/**/\nimport type {\n ColGroupDef,\n GridApi,\n GridOptions,\n GridReadyEvent,\n ICellRendererParams,\n RowSelectionOptions,\n ValueSetterParams,\n} from \"ag-grid-enterprise\";\nimport type { Component } from \"vue\";\nimport { computed, shallowRef, watch } from \"vue\";\nimport {\n autoSizeRowNumberColumn,\n makeRowNumberColDef,\n PlAgOverlayLoading,\n type PlAgOverlayLoadingParams,\n} from \"../components/PlAgDataTable\";\nimport { PlAgOverlayNoRows } from \"../components/PlAgDataTable\";\nimport { createAgGridColDef, type ColDefExtended } from \"./createAgGridColDef\";\nimport { whenever } from \"@vueuse/core\";\nimport { PlAgCellFile } from \"../components/PlAgCellFile\";\nimport { PlAgChartStackedBarCell } from \"../components/PlAgChartStackedBarCell\";\nimport { PlAgChartHistogramCell } from \"../components/PlAgChartHistogramCell\";\nimport type { ImportFileHandle } from \"@platforma-sdk/model\";\nimport type { ImportProgress } from \"@platforma-sdk/model\";\nimport { PlAgCellStatusTag } from \"../components/PlAgCellStatusTag\";\nimport { AgGridTheme } from \"./AgGridTheme\";\ninterface GridOptionsExtended<TData = any> extends Omit<\n GridOptions<TData>,\n \"columnDefs\" | \"loadingOverlayComponentParams\"\n> {\n /**\n * Array of Column / Column Group definitions.\n */\n columnDefs?: (ColDefExtended<TData> | ColGroupDef<TData>)[] | null;\n /**\n * Show row numbers column\n */\n rowNumbersColumn?: boolean;\n /**\n * Loading overlay text\n */\n loadingText?: string;\n /**\n * Not ready overlay (Data is not computed). Takes priority over \"loading\"\n */\n notReady?: boolean;\n /**\n * \"Data is not computed\" by default\n */\n notReadyText?: string;\n /**\n * Override standard 'Empty' text for the \"no rows\" overlay\n */\n noRowsText?: string;\n /**\n * @deprecated Use loading, notReady, loadingText instead\n */\n loadingOverlayComponentParams?: never;\n}\n\n// @TODO (super simple builder for now)\nclass Builder<TData> {\n #options: GridOptionsExtended<TData> = {};\n\n public options(options: GridOptionsExtended<TData>) {\n this.#options = Object.assign({}, this.#options, options);\n return this;\n }\n\n private get columnDefs() {\n return this.#options.columnDefs ?? [];\n }\n\n /**\n * Set default column definition\n * @param def - column definition\n * @returns this\n */\n public setDefaultColDef(def: ColDefExtended<TData>) {\n this.#options.defaultColDef = def;\n return this;\n }\n\n /**\n * Show loading overlay\n * @param loading\n * @returns this\n */\n public setLoading(loading?: boolean) {\n this.#options.loading = loading;\n return this;\n }\n\n /**\n * Set loading overlay custom text (default is \"Loading\")\n * @param loadingText\n * @returns this\n */\n public setLoadingText(loadingText?: string) {\n this.#options.loadingText = loadingText;\n return this;\n }\n\n /**\n * Show \"not ready overlay\n * @param notReady\n * @returns this\n */\n public setNotReady(notReady?: boolean) {\n this.#options.notReady = notReady;\n return this;\n }\n\n /**\n * Set \"not ready\" text\n * @param notReadyText\n * @returns this\n */\n public setNotReadyText(notReadyText?: string) {\n this.#options.notReadyText = notReadyText;\n return this;\n }\n\n /**\n * Set \"no rows\" text when there are no rows (default is \"Empty\")\n * @param noRowsText\n * @returns this\n */\n public setNoRowsText(noRowsText?: string) {\n this.#options.noRowsText = noRowsText;\n return this;\n }\n\n /**\n * Set row selection options\n * @param rowSelection\n * @returns this\n */\n public setRowSelection(rowSelection?: RowSelectionOptions) {\n this.#options.rowSelection = rowSelection;\n return this;\n }\n\n /**\n * Set row data\n * @param rowData\n * @returns this\n */\n public setRowData(rowData?: TData[]) {\n this.#options.rowData = rowData;\n return this;\n }\n\n /**\n * Set components\n * @param components\n * @returns this\n */\n public setComponents(components?: Record<string, Component>) {\n this.#options.components = components;\n return this;\n }\n\n /**\n * Set an option\n * @param key - option key\n * @param value - option value\n * @returns this\n */\n public setOption<K extends keyof GridOptionsExtended<TData>>(\n key: K,\n value: GridOptionsExtended<TData>[K],\n ) {\n this.#options[key] = value;\n return this;\n }\n\n /**\n * Add an extended column definition\n * @param def - column definition\n * @returns this\n */\n public column<TValue = any>(def: ColDefExtended<TData, TValue>) {\n this.#options.columnDefs = [...this.columnDefs, def];\n return this;\n }\n\n /**\n * Show row numbers column\n * @param show - show or hide row numbers column\n * @returns this\n */\n public columnRowNumbers(show: boolean = true) {\n this.#options.rowNumbersColumn = show;\n return this;\n }\n\n /**\n * Add a file input column\n * @param def - column definition\n * @param cb - callback to set params for the file input cell renderer\n * @returns this\n */\n public columnFileInput<TValue = any>(\n def: ColDefExtended<TData, TValue> & {\n /**\n * Allowed file extensions (like ['fastq.gz'])\n */\n extensions?: string[];\n /**\n * The resolveProgress function is an optional input parameter for the component\n * that allows tracking the file upload progress in real-time.\n * By passing resolveProgress, you can ensure that the component\n * displays accurate progress values for each file as they upload.\n * How to use it in AgGrid\n * cellRendererParams: {\n * resolveProgress: (cellData) => {\n * const progresses = app.progresses;\n * if (!cellData.value.importFileHandle) return undefined;\n * else return progresses[cellData.value.importFileHandle];\n * }\n * }\n */\n resolveImportProgress?: (\n cellData: ICellRendererParams<TData, TValue>,\n ) => ImportProgress | undefined;\n\n /**\n * The resolveFileHandle function is an optional input parameter for the component\n * that allows tracking the file upload progress in real-time.\n * By passing resolveFileHandle, you can ensure that the component\n * displays accurate progress values for each file as they upload.\n * How to use it in AgGrid\n * cellRendererParams: {\n * resolveFileHandle: (cellData) => {\n * return cellData.value.importFileHandle;\n * }\n * }\n */\n resolveImportFileHandle?: (\n cellData: ICellRendererParams<TData, TValue>,\n ) => ImportFileHandle | undefined;\n\n setImportFileHandle?: (d: ValueSetterParams<TData, ImportFileHandle | undefined>) => void;\n },\n ) {\n return this.column(\n Object.assign(\n {\n cellRenderer: \"PlAgCellFile\",\n headerComponentParams: { type: \"File\" },\n cellStyle: { padding: 0 },\n valueSetter: (d: ValueSetterParams<TData, ImportFileHandle | undefined>) => {\n def.setImportFileHandle?.(d);\n return true;\n },\n cellRendererSelector: (cellData: ICellRendererParams<TData, TValue>) => {\n return {\n component: \"PlAgCellFile\",\n params: {\n extensions: def.extensions,\n value: def.resolveImportFileHandle?.(cellData),\n resolveProgress: () => {\n return def.resolveImportProgress?.(cellData);\n },\n },\n };\n },\n },\n def,\n ),\n );\n }\n\n public build() {\n return this.#options;\n }\n}\n\n// Simple helper to use like column<string> in grid options literal\ntype ColumnFunc<TData> = <TValue>(\n def: ColDefExtended<TData, TValue>,\n) => ColDefExtended<TData, TValue>;\n\n/**\n * Returns a set of Ag Grid options along with a reference to the Ag Grid API.\n * (This is a fast prototype)\n *\n * @example\n * ```ts\n * const { gridOptions, gridApi } = useAgGridOptions(() => ({\n * // custom grid options here\n * }));\n *\n * // Usage in a template (v-bind is required!)\n * <template>\n * <AgGridVue :style=\"{ height: '100%' }\" v-bind=\"gridOptions\" />\n * </template>\n * ```\n */\nexport function useAgGridOptions<TData>(\n factory: (context: {\n builder: Builder<TData>;\n column: ColumnFunc<TData>;\n }) => Builder<TData> | GridOptionsExtended<TData>,\n) {\n const gridApi = shallowRef<GridApi>();\n\n const extOptions = computed<GridOptionsExtended>(() => {\n const def: GridOptionsExtended<TData> = {\n theme: AgGridTheme,\n loadingOverlayComponent: PlAgOverlayLoading,\n noRowsOverlayComponent: PlAgOverlayNoRows,\n onGridReady: (e: GridReadyEvent) => {\n gridApi.value = e.api;\n autoSizeRowNumberColumn(e.api); // @TODO\n },\n };\n\n const column = <TValue>(def: ColDefExtended<TData, TValue>) => {\n return def;\n };\n\n const result = factory({ builder: new Builder(), column });\n\n const options = Object.assign({}, def, result instanceof Builder ? result.build() : result);\n\n if (options.rowNumbersColumn) {\n options.columnDefs = [makeRowNumberColDef(), ...(options.columnDefs ?? [])];\n }\n\n if (options.noRowsText) {\n options.noRowsOverlayComponentParams = {\n text: options.noRowsText,\n };\n }\n\n if (\"loadingOverlayComponentParams\" in options) {\n console.warn(\n \"useAgGridOptions: remove loadingOverlayComponentParams from options, use loading, notReady, loadingText instead\",\n );\n }\n\n options.loading = options.notReady || options.loading;\n\n options.columnDefs = options.columnDefs?.map((it) => createAgGridColDef(it));\n\n // Register all special components\n options.components = Object.assign({}, options.components ?? {}, {\n PlAgCellFile,\n PlAgChartStackedBarCell,\n PlAgChartHistogramCell,\n PlAgCellStatusTag,\n });\n\n return options;\n });\n\n const gridOptions = computed<GridOptions>(() => {\n const options = extOptions.value;\n\n return {\n ...options,\n loadingOverlayComponentParams: {\n variant: options.notReady ? \"not-ready\" : \"loading\",\n notReadyText: options.notReadyText,\n loadingText: options.loadingText,\n } satisfies PlAgOverlayLoadingParams,\n };\n });\n\n whenever(\n () => extOptions.value.rowNumbersColumn,\n () => {\n if (gridApi.value) {\n autoSizeRowNumberColumn(gridApi.value);\n }\n },\n );\n\n watch(\n [() => extOptions.value.notReady, () => extOptions.value.loading],\n ([notReady, loading]) => {\n const loadingOverlayComponentParams = {\n variant: notReady ? \"not-ready\" : \"loading\",\n // we probably don't need to update the parameters below\n notReadyText: extOptions.value.notReadyText,\n loadingText: extOptions.value.loadingText,\n } satisfies PlAgOverlayLoadingParams;\n\n // Hack to apply loadingOverlayComponentParams\n gridApi.value?.updateGridOptions({\n loading: !loading,\n loadingOverlayComponentParams,\n });\n\n gridApi.value?.updateGridOptions({\n loading,\n loadingOverlayComponentParams,\n });\n },\n { deep: true, immediate: true },\n );\n\n return { gridOptions, gridApi };\n}\n"],"mappings":"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"}
@@ -1,6 +1,8 @@
1
+ //#region \0plugin-vue:export-helper
1
2
  var e = (e, t) => {
2
3
  let n = e.__vccOpts || e;
3
4
  for (let [e, r] of t) n[e] = r;
4
5
  return n;
5
6
  };
7
+ //#endregion
6
8
  export { e as default };
@@ -1,3 +1,4 @@
1
+ //#region \0rolldown/runtime.js
1
2
  var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, r = Object.prototype.hasOwnProperty, i = (t, n) => {
2
3
  let r = {};
3
4
  for (var i in t) e(r, i, {
@@ -12,4 +13,5 @@ var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, n = Object.g
12
13
  });
13
14
  return i;
14
15
  }, o = (e, t, n) => (a(e, t, "default"), n && a(n, t, "default"));
16
+ //#endregion
15
17
  export { i as __exportAll, o as __reExport };
@@ -2,6 +2,7 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./BlockLayout.vue2.js";
3
3
  import n from "./BlockLayout.style.js";
4
4
  var r = /* @__PURE__ */ e(t, [["__cssModules", { $style: n }]]);
5
+ //#endregion
5
6
  export { r as default };
6
7
 
7
8
  //# sourceMappingURL=BlockLayout.js.map
@@ -1,4 +1,5 @@
1
1
  import './BlockLayout.vue.css';var e = { error: "_error_rqtei_2" };
2
+ //#endregion
2
3
  export { e as default };
3
4
 
4
5
  //# sourceMappingURL=BlockLayout.style.js.map
@@ -8,6 +8,7 @@ import i from "./BlockLoader.js";
8
8
  import a from "../plugins/Monetization/MonetizationSidebar.js";
9
9
  import "../plugins/Monetization/index.js";
10
10
  import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, normalizeClass as h, openBlock as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, withCtx as b } from "vue";
11
+ //#region src/components/BlockLayout.vue?vue&type=script&setup=true&lang.ts
11
12
  var x = { class: "block block__layout" }, S = /* @__PURE__ */ m({
12
13
  __name: "BlockLayout",
13
14
  setup(m) {
@@ -40,6 +41,7 @@ var x = { class: "block block__layout" }, S = /* @__PURE__ */ m({
40
41
  ]), T.value ? (g(), c(y(a), { key: 0 })) : l("", !0)], 64));
41
42
  }
42
43
  });
44
+ //#endregion
43
45
  export { S as default };
44
46
 
45
47
  //# sourceMappingURL=BlockLayout.vue2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockLayout.vue_vue_type_script_setup_true_lang.js","names":["$style"],"sources":["../../src/components/BlockLayout.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport \"../assets/block.scss\";\nimport { computed } from \"vue\";\nimport { useSdkPlugin } from \"../defineApp\";\nimport NotFound from \"./NotFound.vue\";\nimport LoaderPage from \"./LoaderPage.vue\";\nimport { PlAppErrorNotificationAlert } from \"./PlAppErrorNotificationAlert\";\nimport BlockLoader from \"./BlockLoader.vue\";\nimport { MonetizationSidebar } from \"../plugins/Monetization\";\n\nconst sdk = useSdkPlugin();\n\nconst parsePathname = (href: `/${string}`) => {\n try {\n return new URL(href, \"http://dummy\").pathname as `/${string}`;\n } catch (_cause) {\n console.error(\"Invalid href\", href);\n return undefined;\n }\n};\n\nconst href = computed(() => (sdk.loaded ? sdk.useApp().href : undefined));\n\nconst CurrentView = computed(() => {\n if (sdk.loaded) {\n const app = sdk.useApp();\n const pathname = parsePathname(app.snapshot.navigationState.href);\n return pathname ? app.getRoute(pathname) : undefined;\n }\n\n return undefined;\n});\n\nconst app = computed(() => (sdk.loaded ? sdk.useApp() : undefined));\n\nconst errors = computed(() => (app.value ? app.value.model.outputErrors : {}));\n\nconst showErrorsNotification = computed(() => app.value?.showErrorsNotification ?? true);\n\nconst progress = computed(() => app.value?.progress?.());\n</script>\n\n<template>\n <div class=\"block block__layout\">\n <BlockLoader :value=\"progress\" />\n <div v-if=\"sdk.error\" :class=\"$style.error\">{{ sdk.error }}</div>\n <LoaderPage v-else-if=\"!sdk.loaded\">Loading...</LoaderPage>\n <component :is=\"CurrentView\" v-else-if=\"CurrentView\" :key=\"href\" />\n <NotFound v-else />\n <PlAppErrorNotificationAlert v-if=\"sdk.loaded && showErrorsNotification\" :errors=\"errors\" />\n </div>\n <!-- Plugins -->\n <MonetizationSidebar v-if=\"CurrentView\" />\n</template>\n\n<style module>\n.error {\n color: red;\n font-weight: bold;\n padding: 24px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;EAUA,IAAM,IAAM,GAAc,EAEpB,KAAiB,MAAuB;AAC5C,OAAI;AACF,WAAO,IAAI,IAAI,GAAM,eAAe,CAAC;WACtB;AACf,YAAQ,MAAM,gBAAgB,EAAK;AACnC;;KAIE,IAAO,QAAgB,EAAI,SAAS,EAAI,QAAQ,CAAC,OAAO,KAAA,EAAW,EAEnE,IAAc,QAAe;AACjC,OAAI,EAAI,QAAQ;IACd,IAAM,IAAM,EAAI,QAAQ,EAClB,IAAW,EAAc,EAAI,SAAS,gBAAgB,KAAK;AACjE,WAAO,IAAW,EAAI,SAAS,EAAS,GAAG,KAAA;;IAI7C,EAEI,IAAM,QAAgB,EAAI,SAAS,EAAI,QAAQ,GAAG,KAAA,EAAW,EAE7D,IAAS,QAAgB,EAAI,QAAQ,EAAI,MAAM,MAAM,eAAe,EAAE,CAAE,EAExE,IAAyB,QAAe,EAAI,OAAO,0BAA0B,GAAK,EAElF,IAAW,QAAe,EAAI,OAAO,YAAY,CAAC;qCAItD,EAOM,OAPN,GAOM;GANJ,EAAiC,GAAA,EAAnB,OAAO,EAAA,OAAQ,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA;GAClB,EAAA,EAAG,CAAC,SAAA,GAAA,EAAf,EAAiE,OAAA;;IAA1C,OAAK,EAAEA,EAAAA,OAAO,MAAK;QAAK,EAAA,EAAG,CAAC,MAAK,EAAA,EAAA,IAChC,EAAA,EAAG,CAAC,SACY,EAAA,SAAA,GAAA,EAAxC,EAAmE,EAAnD,EAAA,MAAW,EAAA,EAA2B,KAAK,EAAA,OAAI,CAAA,KAAA,GAAA,EAC/D,EAAmB,GAAA,EAAA,KAAA,GAAA,CAAA,KAFS,GAAA,EAA5B,EAA2D,GAAA,EAAA,KAAA,GAAA,EAAA;qBAAb,CAAA,GAAA,AAAA,EAAA,OAAA,CAAA,EAAV,cAAU,GAAA,CAAA,CAAA,CAAA;;;GAGX,EAAA,EAAG,CAAC,UAAU,EAAA,SAAA,GAAA,EAAjD,EAA4F,EAAA,EAAA,EAAA;;IAAlB,QAAQ,EAAA;;MAGzD,EAAA,SAAA,GAAA,EAA3B,EAA0C,EAAA,EAAA,EAAA,EAAA,KAAA,GAAA,CAAA,IAAA,EAAA,IAAA,GAAA,CAAA,EAAA,GAAA"}
1
+ {"version":3,"file":"BlockLayout.vue_vue_type_script_setup_true_lang.js","names":["$style"],"sources":["../../src/components/BlockLayout.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport \"../assets/block.scss\";\nimport { computed } from \"vue\";\nimport { useSdkPlugin } from \"../defineApp\";\nimport NotFound from \"./NotFound.vue\";\nimport LoaderPage from \"./LoaderPage.vue\";\nimport { PlAppErrorNotificationAlert } from \"./PlAppErrorNotificationAlert\";\nimport BlockLoader from \"./BlockLoader.vue\";\nimport { MonetizationSidebar } from \"../plugins/Monetization\";\n\nconst sdk = useSdkPlugin();\n\nconst parsePathname = (href: `/${string}`) => {\n try {\n return new URL(href, \"http://dummy\").pathname as `/${string}`;\n } catch (_cause) {\n console.error(\"Invalid href\", href);\n return undefined;\n }\n};\n\nconst href = computed(() => (sdk.loaded ? sdk.useApp().href : undefined));\n\nconst CurrentView = computed(() => {\n if (sdk.loaded) {\n const app = sdk.useApp();\n const pathname = parsePathname(app.snapshot.navigationState.href);\n return pathname ? app.getRoute(pathname) : undefined;\n }\n\n return undefined;\n});\n\nconst app = computed(() => (sdk.loaded ? sdk.useApp() : undefined));\n\nconst errors = computed(() => (app.value ? app.value.model.outputErrors : {}));\n\nconst showErrorsNotification = computed(() => app.value?.showErrorsNotification ?? true);\n\nconst progress = computed(() => app.value?.progress?.());\n</script>\n\n<template>\n <div class=\"block block__layout\">\n <BlockLoader :value=\"progress\" />\n <div v-if=\"sdk.error\" :class=\"$style.error\">{{ sdk.error }}</div>\n <LoaderPage v-else-if=\"!sdk.loaded\">Loading...</LoaderPage>\n <component :is=\"CurrentView\" v-else-if=\"CurrentView\" :key=\"href\" />\n <NotFound v-else />\n <PlAppErrorNotificationAlert v-if=\"sdk.loaded && showErrorsNotification\" :errors=\"errors\" />\n </div>\n <!-- Plugins -->\n <MonetizationSidebar v-if=\"CurrentView\" />\n</template>\n\n<style module>\n.error {\n color: red;\n font-weight: bold;\n padding: 24px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;EAUA,IAAM,IAAM,GAAc,EAEpB,KAAiB,MAAuB;AAC5C,OAAI;AACF,WAAO,IAAI,IAAI,GAAM,eAAe,CAAC;WACtB;AACf,YAAQ,MAAM,gBAAgB,EAAK;AACnC;;KAIE,IAAO,QAAgB,EAAI,SAAS,EAAI,QAAQ,CAAC,OAAO,KAAA,EAAW,EAEnE,IAAc,QAAe;AACjC,OAAI,EAAI,QAAQ;IACd,IAAM,IAAM,EAAI,QAAQ,EAClB,IAAW,EAAc,EAAI,SAAS,gBAAgB,KAAK;AACjE,WAAO,IAAW,EAAI,SAAS,EAAS,GAAG,KAAA;;IAI7C,EAEI,IAAM,QAAgB,EAAI,SAAS,EAAI,QAAQ,GAAG,KAAA,EAAW,EAE7D,IAAS,QAAgB,EAAI,QAAQ,EAAI,MAAM,MAAM,eAAe,EAAE,CAAE,EAExE,IAAyB,QAAe,EAAI,OAAO,0BAA0B,GAAK,EAElF,IAAW,QAAe,EAAI,OAAO,YAAY,CAAC;qCAItD,EAOM,OAPN,GAOM;GANJ,EAAiC,GAAA,EAAnB,OAAO,EAAA,OAAQ,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA;GAClB,EAAA,EAAG,CAAC,SAAA,GAAA,EAAf,EAAiE,OAAA;;IAA1C,OAAK,EAAEA,EAAAA,OAAO,MAAK;QAAK,EAAA,EAAG,CAAC,MAAK,EAAA,EAAA,IAChC,EAAA,EAAG,CAAC,SACY,EAAA,SAAA,GAAA,EAAxC,EAAmE,EAAnD,EAAA,MAAW,EAAA,EAA2B,KAAK,EAAA,OAAI,CAAA,KAAA,GAAA,EAC/D,EAAmB,GAAA,EAAA,KAAA,GAAA,CAAA,KAFS,GAAA,EAA5B,EAA2D,GAAA,EAAA,KAAA,GAAA,EAAA;qBAAb,CAAA,GAAA,AAAA,EAAA,OAAA,CAAA,EAAV,cAAU,GAAA,CAAA,CAAA,CAAA;;;GAGX,EAAA,EAAG,CAAC,UAAU,EAAA,SAAA,GAAA,EAAjD,EAA4F,EAAA,EAAA,EAAA;;IAAlB,QAAQ,EAAA;;MAGzD,EAAA,SAAA,GAAA,EAA3B,EAA0C,EAAA,EAAA,EAAA,EAAA,KAAA,GAAA,CAAA,IAAA,EAAA,IAAA,GAAA,CAAA,EAAA,GAAA"}
@@ -1,5 +1,7 @@
1
1
  import e from "./BlockLoader.vue2.js";
2
+ //#region src/components/BlockLoader.vue
2
3
  var t = e;
4
+ //#endregion
3
5
  export { t as default };
4
6
 
5
7
  //# sourceMappingURL=BlockLoader.js.map
@@ -1,4 +1,5 @@
1
1
  import { computed as e, createCommentVNode as t, createElementBlock as n, defineComponent as r, normalizeStyle as i, openBlock as a } from "vue";
2
+ //#region src/components/BlockLoader.vue?vue&type=script&setup=true&lang.ts
2
3
  var o = {
3
4
  key: 0,
4
5
  class: "block__loader"
@@ -17,6 +18,7 @@ var o = {
17
18
  }, null, 4));
18
19
  }
19
20
  });
21
+ //#endregion
20
22
  export { s as default };
21
23
 
22
24
  //# sourceMappingURL=BlockLoader.vue2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockLoader.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/components/BlockLoader.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from \"vue\";\n\nconst props = defineProps<{\n value: boolean | number | undefined;\n}>();\n\nconst isLoader = computed(() => typeof props.value === \"boolean\" && props.value);\n\nconst progressWidth = computed(() => {\n const value = props.value;\n\n if (typeof value === \"number\") {\n if (value >= 1) {\n return undefined;\n }\n\n return (value * 100).toFixed(2) + \"%\";\n }\n\n return undefined;\n});\n</script>\n\n<template>\n <div v-if=\"isLoader\" class=\"block__loader\" />\n <div\n v-else-if=\"progressWidth !== undefined\"\n class=\"block__progress\"\n :style=\"{ '--progress-width': progressWidth }\"\n />\n</template>\n"],"mappings":";;;;;;;;EAGA,IAAM,IAAQ,GAIR,IAAW,QAAe,OAAO,EAAM,SAAU,aAAa,EAAM,MAAM,EAE1E,IAAgB,QAAe;GACnC,IAAM,IAAQ,EAAM;AAEpB,OAAI,OAAO,KAAU,SAKnB,QAJI,KAAS,IACX,UAGM,IAAQ,KAAK,QAAQ,EAAE,GAAG;IAIpC;mBAIW,EAAA,SAAA,GAAA,EAAX,EAA6C,OAA7C,EAA6C,IAEhC,EAAA,UAAkB,KAAA,iBAAA,GAAA,EAD/B,EAIE,OAAA;;GAFA,OAAM;GACL,OAAK,EAAA,EAAA,oBAAwB,EAAA,OAAa,CAAA"}
1
+ {"version":3,"file":"BlockLoader.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/components/BlockLoader.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from \"vue\";\n\nconst props = defineProps<{\n value: boolean | number | undefined;\n}>();\n\nconst isLoader = computed(() => typeof props.value === \"boolean\" && props.value);\n\nconst progressWidth = computed(() => {\n const value = props.value;\n\n if (typeof value === \"number\") {\n if (value >= 1) {\n return undefined;\n }\n\n return (value * 100).toFixed(2) + \"%\";\n }\n\n return undefined;\n});\n</script>\n\n<template>\n <div v-if=\"isLoader\" class=\"block__loader\" />\n <div\n v-else-if=\"progressWidth !== undefined\"\n class=\"block__progress\"\n :style=\"{ '--progress-width': progressWidth }\"\n />\n</template>\n"],"mappings":";;;;;;;;;EAGA,IAAM,IAAQ,GAIR,IAAW,QAAe,OAAO,EAAM,SAAU,aAAa,EAAM,MAAM,EAE1E,IAAgB,QAAe;GACnC,IAAM,IAAQ,EAAM;AAEpB,OAAI,OAAO,KAAU,SAKnB,QAJI,KAAS,IACX,UAGM,IAAQ,KAAK,QAAQ,EAAE,GAAG;IAIpC;mBAIW,EAAA,SAAA,GAAA,EAAX,EAA6C,OAA7C,EAA6C,IAEhC,EAAA,UAAkB,KAAA,iBAAA,GAAA,EAD/B,EAIE,OAAA;;GAFA,OAAM;GACL,OAAK,EAAA,EAAA,oBAAwB,EAAA,OAAa,CAAA"}
@@ -1,10 +1,12 @@
1
1
  import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import { createElementBlock as t, createElementVNode as n, openBlock as r } from "vue";
3
+ //#region src/components/LoaderPage.vue
3
4
  var i = {}, a = { class: "block__loader-page" };
4
5
  function o(e, i) {
5
6
  return r(), t("div", a, [...i[0] ||= [n("div", { class: "loader-container" }, [n("i", { class: "mask-24 mask-loading loader-icon" })], -1)]]);
6
7
  }
7
8
  var s = /* @__PURE__ */ e(i, [["render", o]]);
9
+ //#endregion
8
10
  export { s as default };
9
11
 
10
12
  //# sourceMappingURL=LoaderPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoaderPage.js","names":[],"sources":["../../src/components/LoaderPage.vue"],"sourcesContent":["<template>\n <div class=\"block__loader-page\">\n <div class=\"loader-container\">\n <i class=\"mask-24 mask-loading loader-icon\" />\n </div>\n </div>\n</template>\n"],"mappings":";;kBACO,OAAM,sBAAoB;;aAA/B,EAIM,OAJN,GAIM,CAAA,GAAA,AAAA,EAAA,OAAA,CAHJ,EAEM,OAAA,EAFD,OAAM,oBAAkB,EAAA,CAC3B,EAA8C,KAAA,EAA3C,OAAM,oCAAkC,CAAA,CAAA,EAAA,GAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"LoaderPage.js","names":[],"sources":["../../src/components/LoaderPage.vue"],"sourcesContent":["<template>\n <div class=\"block__loader-page\">\n <div class=\"loader-container\">\n <i class=\"mask-24 mask-loading loader-icon\" />\n </div>\n </div>\n</template>\n"],"mappings":";;;kBACO,OAAM,sBAAoB;;aAA/B,EAIM,OAJN,GAIM,CAAA,GAAA,AAAA,EAAA,OAAA,CAHJ,EAEM,OAAA,EAFD,OAAM,oBAAkB,EAAA,CAC3B,EAA8C,KAAA,EAA3C,OAAM,oCAAkC,CAAA,CAAA,EAAA,GAAA,CAAA,CAAA,CAAA"}
@@ -1,5 +1,7 @@
1
1
  import e from "./NotFound.vue2.js";
2
+ //#region src/components/NotFound.vue
2
3
  var t = e;
4
+ //#endregion
3
5
  export { t as default };
4
6
 
5
7
  //# sourceMappingURL=NotFound.js.map
@@ -1,6 +1,7 @@
1
1
  import { useSdkPlugin as e } from "../defineApp.js";
2
2
  import { createElementBlock as t, createElementVNode as n, createTextVNode as r, createVNode as i, defineComponent as a, openBlock as o, toDisplayString as s, unref as c, withCtx as l, withModifiers as u } from "vue";
3
3
  import { PlBtnSecondary as d } from "@milaboratories/uikit";
4
+ //#region src/components/NotFound.vue?vue&type=script&setup=true&lang.ts
4
5
  var f = { class: "block__not-found" }, p = /* @__PURE__ */ a({
5
6
  __name: "NotFound",
6
7
  setup(a) {
@@ -13,6 +14,7 @@ var f = { class: "block__not-found" }, p = /* @__PURE__ */ a({
13
14
  })]));
14
15
  }
15
16
  });
17
+ //#endregion
16
18
  export { p as default };
17
19
 
18
20
  //# sourceMappingURL=NotFound.vue2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotFound.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/components/NotFound.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { PlBtnSecondary } from \"@milaboratories/uikit\";\nimport { useSdkPlugin } from \"../defineApp\";\n\nconst sdk = useSdkPlugin();\n\nconst app = sdk.useApp();\n\nconst goToMain = () => {\n app.navigateTo(\"/\");\n};\n</script>\n\n<template>\n <div class=\"block__not-found\">\n <h1>Not found route: {{ app.snapshot.navigationState.href }}</h1>\n <PlBtnSecondary @click.stop=\"goToMain\">Return to main page</PlBtnSecondary>\n </div>\n</template>\n"],"mappings":";;;;;;EAMA,IAAM,IAFM,GAAc,CAEV,QAAQ,EAElB,UAAiB;AACrB,KAAI,WAAW,IAAI;;yBAKnB,EAGM,OAHN,GAGM,CAFJ,EAAiE,MAAA,MAA7D,sBAAiB,EAAG,EAAA,EAAG,CAAC,SAAS,gBAAgB,KAAI,EAAA,EAAA,EACzD,EAA2E,EAAA,EAAA,EAAA,EAA1D,SAAK,EAAO,GAAQ,CAAA,OAAA,CAAA,EAAA,EAAA;oBAAqB,CAAA,GAAA,AAAA,EAAA,OAAA,CAAA,EAAnB,uBAAmB,GAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"NotFound.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/components/NotFound.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { PlBtnSecondary } from \"@milaboratories/uikit\";\nimport { useSdkPlugin } from \"../defineApp\";\n\nconst sdk = useSdkPlugin();\n\nconst app = sdk.useApp();\n\nconst goToMain = () => {\n app.navigateTo(\"/\");\n};\n</script>\n\n<template>\n <div class=\"block__not-found\">\n <h1>Not found route: {{ app.snapshot.navigationState.href }}</h1>\n <PlBtnSecondary @click.stop=\"goToMain\">Return to main page</PlBtnSecondary>\n </div>\n</template>\n"],"mappings":";;;;;;;EAMA,IAAM,IAFM,GAAc,CAEV,QAAQ,EAElB,UAAiB;AACrB,KAAI,WAAW,IAAI;;yBAKnB,EAGM,OAHN,GAGM,CAFJ,EAAiE,MAAA,MAA7D,sBAAiB,EAAG,EAAA,EAAG,CAAC,SAAS,gBAAgB,KAAI,EAAA,EAAA,EACzD,EAA2E,EAAA,EAAA,EAAA,EAA1D,SAAK,EAAO,GAAQ,CAAA,OAAA,CAAA,EAAA,EAAA;oBAAqB,CAAA,GAAA,AAAA,EAAA,OAAA,CAAA,EAAnB,uBAAmB,GAAA,CAAA,CAAA,CAAA"}
@@ -2,6 +2,7 @@ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./FilterEditor.vue2.js";
3
3
  import n from "./FilterEditor.style.js";
4
4
  var r = /* @__PURE__ */ e(t, [["__cssModules", { $style: n }]]);
5
+ //#endregion
5
6
  export { r as default };
6
7
 
7
8
  //# sourceMappingURL=FilterEditor.js.map
@@ -13,6 +13,7 @@ import './FilterEditor.vue.css';var e = {
13
13
  middle: "_middle_16khp_95",
14
14
  bottom: "_bottom_16khp_96"
15
15
  };
16
+ //#endregion
16
17
  export { e as default };
17
18
 
18
19
  //# sourceMappingURL=FilterEditor.style.js.map
@@ -4,6 +4,7 @@ import { getFilterInfo as r, getNormalizedSpec as i, isNumericFilter as a, isPos
4
4
  import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as m, mergeModels as h, normalizeClass as g, openBlock as _, renderList as v, toDisplayString as y, unref as b, useModel as x } from "vue";
5
5
  import { isFilteredPColumn as S, parseColumnId as C, stringifyColumnId as w } from "@platforma-sdk/model";
6
6
  import { PlAutocomplete as T, PlAutocompleteMulti as E, PlDropdown as D, PlIcon16 as O, PlNumberField as k, PlTextField as A, PlToggleSwitch as j, Slider as M } from "@milaboratories/uikit";
7
+ //#region src/components/PlAdvancedFilter/FilterEditor.vue?vue&type=script&setup=true&lang.ts
7
8
  var N = ["title"], P = /* @__PURE__ */ m({
8
9
  __name: "FilterEditor",
9
10
  props: /* @__PURE__ */ h({
@@ -282,6 +283,7 @@ var N = ["title"], P = /* @__PURE__ */ m({
282
283
  ])], 64));
283
284
  }
284
285
  });
286
+ //#endregion
285
287
  export { P as default };
286
288
 
287
289
  //# sourceMappingURL=FilterEditor.vue2.js.map