@revolist/revogrid 4.9.4 → 4.9.6

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 (203) hide show
  1. package/dist/cjs/{column.service-01f4a6c7.js → column.service-0615a373.js} +11 -12
  2. package/dist/cjs/column.service-0615a373.js.map +1 -0
  3. package/dist/cjs/{base.plugin-bf5f43a0.js → column.utils-694677fa.js} +136 -11
  4. package/dist/cjs/column.utils-694677fa.js.map +1 -0
  5. package/dist/cjs/edit.utils-2e1f4278.js +20 -0
  6. package/dist/cjs/edit.utils-2e1f4278.js.map +1 -0
  7. package/dist/cjs/{events-b28cc194.js → events-af8f6914.js} +1 -8
  8. package/dist/cjs/events-af8f6914.js.map +1 -0
  9. package/dist/cjs/{header-cell-renderer-3bc70679.js → header-cell-renderer-360528aa.js} +2 -2
  10. package/dist/cjs/{header-cell-renderer-3bc70679.js.map → header-cell-renderer-360528aa.js.map} +1 -1
  11. package/dist/cjs/{dimension.helpers-a6788214.js → index-2991afbb.js} +262 -4
  12. package/dist/cjs/index-2991afbb.js.map +1 -0
  13. package/dist/cjs/index.cjs.js +97 -35
  14. package/dist/cjs/index.cjs.js.map +1 -1
  15. package/dist/cjs/key.utils-b84b0eba.js +111 -0
  16. package/dist/cjs/key.utils-b84b0eba.js.map +1 -0
  17. package/dist/cjs/revo-grid.cjs.entry.js +140 -311
  18. package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
  19. package/dist/cjs/revogr-attribution_6.cjs.entry.js +37 -37
  20. package/dist/cjs/revogr-attribution_6.cjs.entry.js.map +1 -1
  21. package/dist/cjs/revogr-clipboard_3.cjs.entry.js +10 -10
  22. package/dist/cjs/revogr-clipboard_3.cjs.entry.js.map +1 -1
  23. package/dist/cjs/revogr-data_4.cjs.entry.js +13 -14
  24. package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
  25. package/dist/cjs/{viewport.store-35a3e7ee.js → row-header-utils-b5266b12.js} +13 -6
  26. package/dist/cjs/row-header-utils-b5266b12.js.map +1 -0
  27. package/dist/cjs/{selection.helpers-1a8c8d49.js → selection.helpers-4374518f.js} +13 -13
  28. package/dist/cjs/selection.helpers-4374518f.js.map +1 -0
  29. package/dist/cjs/{throttle-52be9e67.js → throttle-8885fd65.js} +2 -2
  30. package/dist/cjs/{throttle-52be9e67.js.map → throttle-8885fd65.js.map} +1 -1
  31. package/dist/collection/components/clipboard/revogr-clipboard.js +2 -2
  32. package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -1
  33. package/dist/collection/components/editors/revogr-edit.js +1 -1
  34. package/dist/collection/components/header/revogr-header.js +1 -1
  35. package/dist/collection/components/overlay/revogr-overlay-selection.js +1 -1
  36. package/dist/collection/components/revoGrid/revo-grid.js +12 -11
  37. package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
  38. package/dist/collection/index.js +1 -1
  39. package/dist/collection/index.js.map +1 -1
  40. package/dist/collection/plugins/base.plugin.js.map +1 -1
  41. package/dist/collection/plugins/column.auto-size.plugin.js +2 -2
  42. package/dist/collection/plugins/column.auto-size.plugin.js.map +1 -1
  43. package/dist/collection/plugins/column.stretch.plugin.js.map +1 -1
  44. package/dist/collection/plugins/groupingRow/grouping.row.plugin.js.map +1 -1
  45. package/dist/collection/plugins/moveColumn/column.drag.plugin.js +1 -1
  46. package/dist/collection/plugins/moveColumn/column.drag.plugin.js.map +1 -1
  47. package/dist/collection/plugins/sorting/sorting.plugin.js +2 -2
  48. package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
  49. package/dist/collection/services/column.data.provider.js +32 -88
  50. package/dist/collection/services/column.data.provider.js.map +1 -1
  51. package/dist/collection/services/dimension.provider.js +2 -2
  52. package/dist/collection/services/dimension.provider.js.map +1 -1
  53. package/dist/collection/types/interfaces.js.map +1 -1
  54. package/dist/collection/utils/column.utils.js +124 -0
  55. package/dist/collection/utils/column.utils.js.map +1 -0
  56. package/dist/collection/utils/index.js +7 -0
  57. package/dist/collection/utils/index.js.map +1 -1
  58. package/dist/esm/{column.service-5d14e7e9.js → column.service-af0694c5.js} +3 -4
  59. package/dist/esm/column.service-af0694c5.js.map +1 -0
  60. package/dist/esm/{base.plugin-5e7a3c51.js → column.utils-78dd3ef2.js} +122 -3
  61. package/dist/esm/column.utils-78dd3ef2.js.map +1 -0
  62. package/dist/esm/edit.utils-ca303802.js +17 -0
  63. package/dist/esm/edit.utils-ca303802.js.map +1 -0
  64. package/dist/esm/{events-77b43b40.js → events-cf0893a3.js} +2 -8
  65. package/dist/esm/events-cf0893a3.js.map +1 -0
  66. package/dist/esm/{header-cell-renderer-fc999784.js → header-cell-renderer-261317c3.js} +2 -2
  67. package/dist/esm/{header-cell-renderer-fc999784.js.map → header-cell-renderer-261317c3.js.map} +1 -1
  68. package/dist/esm/{dimension.helpers-56298828.js → index-f65def08.js} +231 -4
  69. package/dist/esm/index-f65def08.js.map +1 -0
  70. package/dist/esm/index.js +5 -4
  71. package/dist/esm/index.js.map +1 -1
  72. package/dist/esm/key.utils-4b0093d5.js +98 -0
  73. package/dist/esm/key.utils-4b0093d5.js.map +1 -0
  74. package/dist/esm/revo-grid.entry.js +50 -221
  75. package/dist/esm/revo-grid.entry.js.map +1 -1
  76. package/dist/esm/revogr-attribution_6.entry.js +8 -8
  77. package/dist/esm/revogr-clipboard_3.entry.js +5 -5
  78. package/dist/esm/revogr-clipboard_3.entry.js.map +1 -1
  79. package/dist/esm/revogr-data_4.entry.js +5 -6
  80. package/dist/esm/revogr-data_4.entry.js.map +1 -1
  81. package/dist/esm/{viewport.store-d8e03528.js → row-header-utils-6081260c.js} +9 -3
  82. package/dist/esm/row-header-utils-6081260c.js.map +1 -0
  83. package/dist/esm/{selection.helpers-accaad4a.js → selection.helpers-d92697e1.js} +2 -2
  84. package/dist/esm/{selection.helpers-accaad4a.js.map → selection.helpers-d92697e1.js.map} +1 -1
  85. package/dist/esm/{throttle-7283692c.js → throttle-041ded8e.js} +2 -2
  86. package/dist/esm/{throttle-7283692c.js.map → throttle-041ded8e.js.map} +1 -1
  87. package/dist/revo-grid/column.service-af0694c5.js +5 -0
  88. package/dist/revo-grid/{column.service-5d14e7e9.js.map → column.service-af0694c5.js.map} +1 -1
  89. package/dist/revo-grid/column.utils-78dd3ef2.js +5 -0
  90. package/dist/revo-grid/column.utils-78dd3ef2.js.map +1 -0
  91. package/dist/revo-grid/edit.utils-ca303802.js +5 -0
  92. package/dist/revo-grid/edit.utils-ca303802.js.map +1 -0
  93. package/dist/revo-grid/events-cf0893a3.js +5 -0
  94. package/dist/revo-grid/events-cf0893a3.js.map +1 -0
  95. package/dist/revo-grid/{header-cell-renderer-fc999784.js → header-cell-renderer-261317c3.js} +2 -2
  96. package/dist/revo-grid/index-f65def08.js +5 -0
  97. package/dist/revo-grid/index-f65def08.js.map +1 -0
  98. package/dist/revo-grid/index.esm.js +1 -1
  99. package/dist/revo-grid/key.utils-4b0093d5.js +5 -0
  100. package/dist/revo-grid/key.utils-4b0093d5.js.map +1 -0
  101. package/dist/revo-grid/revo-grid.entry.js +1 -1
  102. package/dist/revo-grid/revo-grid.entry.js.map +1 -1
  103. package/dist/revo-grid/revogr-attribution_6.entry.js +1 -1
  104. package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
  105. package/dist/revo-grid/revogr-clipboard_3.entry.js.map +1 -1
  106. package/dist/revo-grid/revogr-data_4.entry.js +1 -1
  107. package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
  108. package/dist/revo-grid/row-header-utils-6081260c.js +5 -0
  109. package/dist/revo-grid/row-header-utils-6081260c.js.map +1 -0
  110. package/dist/revo-grid/selection.helpers-d92697e1.js +5 -0
  111. package/dist/revo-grid/{selection.helpers-accaad4a.js.map → selection.helpers-d92697e1.js.map} +1 -1
  112. package/dist/revo-grid/{throttle-7283692c.js → throttle-041ded8e.js} +2 -2
  113. package/dist/types/components/revoGrid/revo-grid.d.ts +2 -1
  114. package/dist/types/components.d.ts +2 -2
  115. package/dist/types/index.d.ts +1 -1
  116. package/dist/types/plugins/base.plugin.d.ts +1 -1
  117. package/dist/types/plugins/column.auto-size.plugin.d.ts +2 -4
  118. package/dist/types/plugins/column.stretch.plugin.d.ts +2 -4
  119. package/dist/types/services/column.data.provider.d.ts +2 -13
  120. package/dist/types/services/dimension.provider.d.ts +0 -1
  121. package/dist/types/types/interfaces.d.ts +11 -11
  122. package/dist/types/utils/column.utils.d.ts +46 -0
  123. package/dist/types/utils/index.d.ts +7 -0
  124. package/hydrate/index.js +304 -357
  125. package/hydrate/index.mjs +304 -357
  126. package/package.json +2 -2
  127. package/standalone/_stringToPath.js +1389 -0
  128. package/standalone/_stringToPath.js.map +1 -0
  129. package/standalone/column.service.js +4 -3
  130. package/standalone/column.service.js.map +1 -1
  131. package/standalone/consts.js +1 -1
  132. package/standalone/data.store.js +31 -1410
  133. package/standalone/data.store.js.map +1 -1
  134. package/standalone/debounce.js +2 -1
  135. package/standalone/debounce.js.map +1 -1
  136. package/standalone/dimension.helpers.js +2 -2
  137. package/standalone/index.js +6 -3
  138. package/standalone/index.js.map +1 -1
  139. package/standalone/index2.js +160 -1
  140. package/standalone/index2.js.map +1 -1
  141. package/standalone/isObjectLike.js +195 -0
  142. package/standalone/isObjectLike.js.map +1 -0
  143. package/standalone/revo-grid.js +168 -218
  144. package/standalone/revo-grid.js.map +1 -1
  145. package/standalone/revogr-clipboard2.js +2 -2
  146. package/standalone/revogr-clipboard2.js.map +1 -1
  147. package/standalone/revogr-data2.js +3 -2
  148. package/standalone/revogr-data2.js.map +1 -1
  149. package/standalone/revogr-edit.js +1 -1
  150. package/standalone/revogr-edit2.js +57 -83
  151. package/standalone/revogr-edit2.js.map +1 -1
  152. package/standalone/revogr-focus2.js +2 -1
  153. package/standalone/revogr-focus2.js.map +1 -1
  154. package/standalone/revogr-header2.js +4 -3
  155. package/standalone/revogr-header2.js.map +1 -1
  156. package/standalone/revogr-order-editor2.js +3 -2
  157. package/standalone/revogr-order-editor2.js.map +1 -1
  158. package/standalone/revogr-overlay-selection2.js +5 -5
  159. package/standalone/revogr-row-headers2.js +3 -2
  160. package/standalone/revogr-row-headers2.js.map +1 -1
  161. package/standalone/selection.utils.js +2 -1
  162. package/standalone/selection.utils.js.map +1 -1
  163. package/standalone/throttle.js +1 -1
  164. package/standalone/toNumber.js +2 -189
  165. package/standalone/toNumber.js.map +1 -1
  166. package/dist/cjs/base.plugin-bf5f43a0.js.map +0 -1
  167. package/dist/cjs/column.service-01f4a6c7.js.map +0 -1
  168. package/dist/cjs/dimension.helpers-a6788214.js.map +0 -1
  169. package/dist/cjs/events-b28cc194.js.map +0 -1
  170. package/dist/cjs/index-2410bbd9.js +0 -103
  171. package/dist/cjs/index-2410bbd9.js.map +0 -1
  172. package/dist/cjs/key.utils-1e48ab8f.js +0 -144
  173. package/dist/cjs/key.utils-1e48ab8f.js.map +0 -1
  174. package/dist/cjs/selection.helpers-1a8c8d49.js.map +0 -1
  175. package/dist/cjs/viewport.store-35a3e7ee.js.map +0 -1
  176. package/dist/collection/plugins/groupingColumn/grouping.col.plugin.js +0 -43
  177. package/dist/collection/plugins/groupingColumn/grouping.col.plugin.js.map +0 -1
  178. package/dist/esm/base.plugin-5e7a3c51.js.map +0 -1
  179. package/dist/esm/column.service-5d14e7e9.js.map +0 -1
  180. package/dist/esm/dimension.helpers-56298828.js.map +0 -1
  181. package/dist/esm/events-77b43b40.js.map +0 -1
  182. package/dist/esm/index-4e881436.js +0 -77
  183. package/dist/esm/index-4e881436.js.map +0 -1
  184. package/dist/esm/key.utils-425c987d.js +0 -133
  185. package/dist/esm/key.utils-425c987d.js.map +0 -1
  186. package/dist/esm/viewport.store-d8e03528.js.map +0 -1
  187. package/dist/revo-grid/base.plugin-5e7a3c51.js +0 -5
  188. package/dist/revo-grid/base.plugin-5e7a3c51.js.map +0 -1
  189. package/dist/revo-grid/column.service-5d14e7e9.js +0 -5
  190. package/dist/revo-grid/dimension.helpers-56298828.js +0 -5
  191. package/dist/revo-grid/dimension.helpers-56298828.js.map +0 -1
  192. package/dist/revo-grid/events-77b43b40.js +0 -5
  193. package/dist/revo-grid/events-77b43b40.js.map +0 -1
  194. package/dist/revo-grid/index-4e881436.js +0 -5
  195. package/dist/revo-grid/index-4e881436.js.map +0 -1
  196. package/dist/revo-grid/key.utils-425c987d.js +0 -5
  197. package/dist/revo-grid/key.utils-425c987d.js.map +0 -1
  198. package/dist/revo-grid/selection.helpers-accaad4a.js +0 -5
  199. package/dist/revo-grid/viewport.store-d8e03528.js +0 -5
  200. package/dist/revo-grid/viewport.store-d8e03528.js.map +0 -1
  201. package/dist/types/plugins/groupingColumn/grouping.col.plugin.d.ts +0 -17
  202. /package/dist/revo-grid/{header-cell-renderer-fc999784.js.map → header-cell-renderer-261317c3.js.map} +0 -0
  203. /package/dist/revo-grid/{throttle-7283692c.js.map → throttle-041ded8e.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/types/interfaces.ts"],"names":[],"mappings":"AA+PC,CAAC","sourcesContent":["import type { VNode } from '@stencil/core';\n\nimport {\n DimensionCols,\n DimensionRows,\n DimensionColPin,\n DimensionType,\n MultiDimensionType,\n} from './dimension';\nimport {\n Cell,\n EditorCtr,\n FocusedCells,\n OldNewRangeMapping,\n RangeArea,\n SelectionStoreState,\n} from './selection';\nimport type { Observable } from '../utils/store.utils';\n\nexport type Nullable<T> = {\n [P in keyof T]: T[P] | null;\n};\n\n/**\n * Advanced column data schema model.\n * Used for transpassing data to cell renderer and editor.\n */\nexport type ColumnDataSchemaModel = {\n /**\n * Column prop used for mapping value to cell from data source model/row\n */\n prop: ColumnProp;\n /**\n * Row data object\n */\n model: DataType;\n /**\n * Column data object\n */\n column: ColumnRegular;\n /**\n * Index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Index of the column in the viewport\n */\n colIndex: number;\n /**\n * Column type based on viewport\n */\n colType: DimensionCols;\n /**\n * Row type based on viewport\n */\n type: DimensionRows;\n /**\n * Row models based on viewport\n */\n data: DataType[];\n /**\n * Current cell data\n */\n value: any;\n};\n/**\n * Template property for each cell, extends the column data schema model.\n * Additionally, it provides access to the providers injected into the template.\n */\nexport interface CellTemplateProp extends ColumnDataSchemaModel {\n /**\n * Providers injected into the template\n */\n providers: Providers;\n}\n/**\n * The ReadOnlyFormat type is a boolean value or a function that takes ColumnDataSchemaModel\n * as a parameter and returns a boolean value.\n *\n * If it is a boolean value, it represents whether the cell in question is read-only.\n * If it is a function, it returns whether the cell in question is read-only based on the provided\n * ColumnDataSchemaModel.\n */\nexport type ReadOnlyFormat =\n | boolean\n | ((params: ColumnDataSchemaModel) => boolean);\nexport type RowDrag =\n | boolean\n | {\n (params: ColumnDataSchemaModel): boolean;\n };\n/**\n * `ColumnGrouping` type is used to define a grouping in a column.\n */\nexport type ColumnGrouping = {\n /**\n * An array of objects that represent the children of the grouping.\n */\n children: (ColumnGrouping | ColumnRegular)[];\n /**\n * A `DataFormat` object that represents the name of the grouping.\n */\n name: DataFormat;\n};\n/**\n * Configuration for header inner template properties\n */\nexport interface ColumnProperties {\n /**\n * Header inner template\n * Function/component to render custom header content\n */\n columnTemplate?: ColumnTemplateFunc;\n /**\n * Header Cell properties\n * Custom function/component to render header properties\n */\n columnProperties?: ColPropertiesFunc;\n}\n/**\n * Type that represents a collection of column types.\n * The keys are the names of the column types and the values are the corresponding column type objects.\n */\nexport type ColumnTypes = {\n /**\n * The name of the column type.\n */\n [name: string]: ColumnType;\n};\n\n/**\n * Interface for custom cell renderer.\n */\nexport interface CellTemplate {\n // TODO: Add Promise support for template and all custom function so user will be able to use async render on the light speed\n (\n createElement: HyperFunc<VNode>,\n props: CellTemplateProp,\n additionalData?: any,\n ): any;\n}\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnType extends ColumnProperties {\n /**\n * Represents whether the column or cell is read-only.\n * Can be a boolean or a function that returns a boolean.\n * The function receives column data as a parameter.\n */\n readonly?: ReadOnlyFormat;\n /**\n * Represents the default column size.\n */\n size?: number;\n /**\n * Represents the minimal column size.\n * This property cannot be less than cell padding\n * in order to keep performance on top and minimize DOM elements number.\n */\n minSize?: number;\n /**\n * Represents the maximum column size.\n */\n maxSize?: number;\n /**\n * Represents a custom editor defined in @editors property.\n * Can be a string or an editor constructor function.\n */\n editor?: string | EditorCtr;\n /**\n * Represents cell properties for custom styling, classes, and events.\n */\n cellProperties?: PropertiesFunc;\n /**\n * Represents the cell template for custom rendering.\n */\n cellTemplate?: CellTemplate;\n /**\n * Represents the cell compare function for custom sorting.\n */\n cellCompare?: CellCompareFunc;\n}\nexport type Order = 'asc' | 'desc' | undefined;\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n * \n */\n/**\n * ColumnRegular interface represents regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnRegular extends ColumnType {\n /**\n * Column prop used for mapping value to cell from data source model/row, used for indexing.\n */\n prop: ColumnProp;\n /**\n * Column pin 'colPinStart'|'colPinEnd'.\n */\n pin?: DimensionColPin;\n /**\n * Column header text.\n */\n name?: DataFormat;\n /**\n * Column size would be changed based on space left.\n */\n autoSize?: boolean;\n /**\n * Filter. Require filter plugin to be installed and activated through grid config @filter.\n */\n filter?: boolean | string | string[];\n /**\n * Is column can be sorted, check @cellCompare function for custom sorting.\n */\n sortable?: boolean;\n /**\n * Sort order.\n */\n order?: Order;\n /**\n * Is cell in column or individual can be dragged.\n */\n rowDrag?: RowDrag;\n /**\n * Represents type defined in @columnTypes property through grid config.\n */\n columnType?: string;\n /**\n * Function called before column applied to the store.\n */\n beforeSetup?(rgCol: ColumnRegular): void;\n /**\n * Additional properties can be added to the column definition.\n */\n [key: string]: any;\n}\n\nexport type ColumnData = (ColumnGrouping | ColumnRegular)[];\n/**\n * Column template property.\n * Contains extended properties for column.\n */\nexport interface ColumnTemplateProp extends ColumnRegular {\n /**\n * Providers injected into the template.\n */\n providers: Providers<DimensionCols | 'rowHeaders'>;\n /**\n * Index of the column, used for mapping value to cell from data source model/row.\n */\n index: number;\n};\n\nexport type ColumnPropProp = ColumnGrouping | ColumnTemplateProp;\n// Column prop used for mapping value to cell from data source model/row, used for indexing.\nexport type ColumnProp = string | number;\n\nexport type DataFormat = any;\n\nexport type CellProp = string | number | object | boolean | undefined;\n\n/**\n * Additional properties applied to the cell.\n * Contains style object where key is CSS property and value is CSS property value.\n * Contains class object where key is CSS class and value is boolean flag indicating if class should be applied.\n * Contains additional properties for custom cell rendering.\n */\nexport type CellProps = {\n // CSS styles applied to the cell\n style?: {\n [key: string]: string | undefined;\n };\n // CSS classes applied to the cell\n class?:\n | {\n // CSS class name\n [key: string]: boolean;\n }\n | string;\n // Additional properties for custom cell rendering\n [attr: string]: CellProp;\n};\n\n/**\n * Providers for grid which are going to be injected into each cell template\n */\nexport type Providers<T = DimensionRows> = {\n /**\n * Dimension type (e.g. row or column)\n */\n type: T;\n /**\n * Flag indicating if grid is in readonly mode\n */\n readonly: boolean;\n /**\n * Data source store\n */\n data: Observable<DataSourceState<any, any>> | ColumnRegular[];\n /**\n * Viewport store\n */\n viewport: Observable<ViewportState>;\n /**\n * Dimension store\n */\n dimension: Observable<DimensionSettingsState>;\n /**\n * Selection store\n */\n selection: Observable<SelectionStoreState>;\n};\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n // (tag: any): T;\n (tag: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, data: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: T): T;\n}\n/**\n * `FocusTemplateFunc` is a function that takes an HTML tag or component, and\n * returns a JSX element. This function is used to create JSX elements in a\n * context where JSX is not valid.\n */\nexport type FocusTemplateFunc = (\n createElement: HyperFunc<VNode>,\n detail: FocusRenderEvent,\n) => any;\n\n\n/**\n * `CellCompareFunc` is a function that takes the column property to compare,\n * the data of the first cell, and the data of the second cell. It returns a\n * number indicating the relative order of the two cells.\n */\nexport type CellCompareFunc = (\n // The column property to compare.\n prop: ColumnProp,\n // The data of the first cell.\n a: DataType,\n // The data of the second cell.\n b: DataType,\n) => number;\nexport type ColumnTemplateFunc = (\n createElement: HyperFunc<VNode>,\n props: ColumnTemplateProp,\n additionalData?: any,\n) => any;\nexport type PropertiesFunc = (\n props: ColumnDataSchemaModel,\n) => CellProps | void | undefined;\nexport type ColPropertiesFunc = (\n props: ColumnPropProp,\n) => CellProps | void | undefined;\nexport type DataType = {\n [T in ColumnProp]: DataFormat;\n};\n\nexport type DataLookup = {\n [rowIndex: number]: DataType;\n};\n/**\n * `RowDefinition` is a type that represents a row definition in the\n * viewport.\n */\nexport type RowDefinition = {\n /**\n * The type of the row.\n */\n type: DimensionRows;\n /**\n * The size of the row.\n */\n size: number;\n /**\n * The index of the row.\n */\n index: number;\n};\nexport interface RowHeaders extends ColumnRegular {}\n/**\n * `ViewPortResizeEvent` is an object that contains information about a resize\n * event in the viewport.\n */\nexport type ViewPortResizeEvent = {\n /* The dimension of the viewport being resized. */\n dimension: DimensionType;\n /* The new size of the viewport. */\n size: number;\n /* Indicates whether the resize event is for a row header. */\n rowHeader?: boolean;\n};\n\n/**\n * `ViewPortScrollEvent` is an object that contains information about a scroll\n * event in the viewport.\n */\nexport type ViewPortScrollEvent = {\n /**\n * The dimension of the viewport being scrolled.\n */\n dimension: DimensionType;\n /**\n * The coordinate of the scroll event.\n */\n coordinate: number;\n /**\n * The change in coordinate between scroll events.\n */\n delta?: number;\n /**\n * Indicates whether the scroll event occurred outside the viewport.\n */\n outside?: boolean;\n};\n\n/**\n * `InitialHeaderClick` represents the information needed to handle a click\n * event on the initial column header.\n */\nexport type InitialHeaderClick = {\n /**\n * The index of the column header that was clicked.\n */\n index: number;\n /**\n * The original mouse event that triggered the click.\n */\n originalEvent: MouseEvent;\n /**\n * The column that was clicked.\n */\n column: ColumnRegular;\n providers: Providers<DimensionCols | 'rowHeaders'>;\n};\n\n/**\n * `Range` is an object that represents a range of values.\n */\nexport type Range = {\n /**\n * The start of the range.\n */\n start: number;\n /**\n * The end of the range.\n */\n end: number;\n};\n\n/**\n * `ViewportStateItems` is an object that represents the items in a viewport\n * along with their corresponding range.\n */\nexport type ViewportStateItems = {\n /**\n * The items in the viewport.\n */\n items: VirtualPositionItem[];\n} & Range;\n\n/**\n * `ViewportState` is an object that represents the state of a viewport.\n */\nexport interface ViewportState extends ViewportStateItems {\n /**\n * The number of real items in the viewport.\n */\n realCount: number;\n /**\n * The virtual size of the viewport.\n */\n virtualSize: number;\n}\n\n/**\n * `ViewSettingSizeProp` is a record that maps column or row indexes to their\n * corresponding sizes.\n */\nexport type ViewSettingSizeProp = Record<string, number>;\n\n/**\n * `VirtualPositionItem` is an object that represents a virtual position item\n * in the viewport.\n */\nexport interface VirtualPositionItem extends PositionItem {\n /**\n * The size of the virtual position item.\n */\n size: number;\n}\nexport type DataSourceState<\n T extends DataType | ColumnRegular,\n ST extends DimensionRows | DimensionCols,\n> = {\n // items - index based array for mapping to source tree\n items: number[];\n // all items, used as proxy for sorting, trimming and others manipulations\n proxyItems: number[];\n // original data source\n source: T[];\n // grouping\n groupingDepth: number;\n groups: Record<any, any>;\n // data source type\n type: ST;\n // trim data, to hide entities from visible data source\n trimmed: Record<any, any>;\n};\nexport interface PositionItem {\n itemIndex: number;\n start: number;\n end: number;\n}\n/**\n * Object containing information about calculated dimensions.\n * Used for both columns and rows.\n */\nexport interface DimensionCalc {\n /**\n * Array of indexes of visible items.\n */\n indexes: number[];\n\n /**\n * Count of visible items.\n */\n count: number;\n\n /**\n * Array of indexes of visible items.\n * Used for mapping items to their position in DOM.\n */\n positionIndexes: number[];\n\n /**\n * Mapping of position to item.\n * Used for mapping position in DOM to item.\n */\n positionIndexToItem: {\n /**\n * Position in DOM.\n */\n [position: number]: PositionItem;\n };\n\n /**\n * Mapping of index to item.\n * Used for mapping index in data source to item.\n */\n indexToItem: {\n /**\n * Index in data source.\n */\n [index: number]: PositionItem;\n };\n\n /**\n * Object containing information about trimmed data.\n * Used for hiding entities from visible data source.\n */\n trimmed: Record<any, any>;\n\n /**\n * Object containing size for each visible item.\n */\n sizes: ViewSettingSizeProp;\n}\n/**\n * Represents the settings state of a dimension.\n * It extends the calculation properties of a dimension.\n * It also includes the real size and origin item size of the dimension.\n */\nexport interface DimensionSettingsState extends DimensionCalc {\n /**\n * Represents the real size of the dimension.\n */\n realSize: number;\n\n /**\n * Represents the origin item size of the dimension.\n */\n originItemSize: number;\n}\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores.\n */\nexport type DimensionStores = {\n [T in MultiDimensionType]: Observable<DimensionSettingsState>;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores for the viewport.\n */\nexport type ViewportStores = {\n [T in MultiDimensionType]: Observable<ViewportState>;\n};\n\n/**\n * Represents the event object that is emitted when the drag operation starts.\n */\nexport interface DragStartEvent {\n /**\n * Represents the original mouse event that triggered the drag operation.\n */\n originalEvent: MouseEvent;\n\n /**\n * Represents the model of the column being dragged.\n */\n model: ColumnDataSchemaModel;\n}\n\n/**\n * Represents the event object that is emitted before cell rendering.\n * It includes information about the dimension type, column, row, and model.\n */\nexport interface BeforeCellRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the column being rendered.\n */\n column: VirtualPositionItem;\n\n /**\n * Represents the row being rendered.\n */\n row: VirtualPositionItem;\n\n /**\n * Represents the model being rendered.\n */\n model: T;\n}\n\n/**\n * Represents the event object that is emitted before row rendering.\n * It includes information about the dimension type, data item, item, and node.\n */\nexport interface BeforeRowRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the data item being rendered.\n */\n model: T;\n\n /**\n * Represents the item being rendered.\n */\n item: VirtualPositionItem;\n\n /**\n * Represents the node being rendered.\n */\n node: VNode;\n}\n\n/**\n * Represents the event object that is emitted after rendering.\n * It includes information about the dimension type.\n */\nexport type AfterRendererEvent = {\n /**\n * Represents the type of dimension being rendered.\n */\n type: DimensionType;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding dimension types.\n */\nexport interface AllDimensionType {\n /**\n * Represents the dimension type for rows.\n */\n rowType: DimensionRows;\n\n /**\n * Represents the dimension type for columns.\n */\n colType: DimensionCols;\n}\n\n/**\n * Represents the event object that is emitted when applying focus.\n * It includes information about the dimension type and focused cells.\n */\nexport interface ApplyFocusEvent extends AllDimensionType, FocusedCells {}\n\n/**\n * Represents the event object that is emitted before focus rendering.\n * It includes information about the dimension type and range area.\n */\nexport interface FocusRenderEvent extends AllDimensionType {\n /**\n * Represents the range area of the focus.\n */\n range: RangeArea;\n\n /**\n * Changes for the next cell to focus. @example { y: -1 }\n */\n next?: Partial<Cell>;\n}\n/**\n * Represents the event object that is emitted when scrolling occurs.\n * The `type` property indicates the type of dimension (row or column) being scrolled.\n * The `coordinate` property represents the current scroll position in that dimension.\n */\nexport type ScrollCoordinateEvent = {\n /**\n * Represents the type of dimension being scrolled.\n * Possible values are 'rgRow' and 'rgCol'.\n */\n type: DimensionType;\n\n /**\n * Represents the current scroll position in the specified dimension.\n * The value is a number representing the coordinate in pixels.\n */\n coordinate: number;\n};\n\n\n/** Range paste. */\nexport type RangeClipboardPasteEvent = {\n data: DataLookup;\n models: {\n [rowIndex: number]: DataType;\n };\n range: RangeArea | null;\n} & AllDimensionType;\n\n/** Range copy. */\nexport type RangeClipboardCopyEventProps = {\n data: DataFormat[][];\n range: RangeArea;\n mapping: OldNewRangeMapping;\n} & AllDimensionType;"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/types/interfaces.ts"],"names":[],"mappings":"AA+PC,CAAC","sourcesContent":["import type { VNode } from '@stencil/core';\n\nimport {\n DimensionCols,\n DimensionRows,\n DimensionColPin,\n DimensionType,\n MultiDimensionType,\n} from './dimension';\nimport {\n Cell,\n EditorCtr,\n FocusedCells,\n OldNewRangeMapping,\n RangeArea,\n SelectionStoreState,\n} from './selection';\nimport type { Observable } from '../utils/store.utils';\n\nexport type Nullable<T> = {\n [P in keyof T]: T[P] | null;\n};\n\n/**\n * Advanced column data schema model.\n * Used for transpassing data to cell renderer and editor.\n */\nexport type ColumnDataSchemaModel = {\n /**\n * Column prop used for mapping value to cell from data source model/row\n */\n prop: ColumnProp;\n /**\n * Row data object\n */\n model: DataType;\n /**\n * Column data object\n */\n column: ColumnRegular;\n /**\n * Index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Index of the column in the viewport\n */\n colIndex: number;\n /**\n * Column type based on viewport\n */\n colType: DimensionCols;\n /**\n * Row type based on viewport\n */\n type: DimensionRows;\n /**\n * Row models based on viewport\n */\n data: DataType[];\n /**\n * Current cell data\n */\n value: any;\n};\n/**\n * Template property for each cell, extends the column data schema model.\n * Additionally, it provides access to the providers injected into the template.\n */\nexport interface CellTemplateProp extends ColumnDataSchemaModel {\n /**\n * Providers injected into the template\n */\n providers: Providers;\n}\n/**\n * The ReadOnlyFormat type is a boolean value or a function that takes ColumnDataSchemaModel\n * as a parameter and returns a boolean value.\n *\n * If it is a boolean value, it represents whether the cell in question is read-only.\n * If it is a function, it returns whether the cell in question is read-only based on the provided\n * ColumnDataSchemaModel.\n */\nexport type ReadOnlyFormat =\n | boolean\n | ((params: ColumnDataSchemaModel) => boolean);\nexport type RowDrag =\n | boolean\n | {\n (params: ColumnDataSchemaModel): boolean;\n };\n/**\n * `ColumnGrouping` type is used to define a grouping in a column.\n */\nexport type ColumnGrouping<T = any> = {\n /**\n * An array of objects that represent the children of the grouping.\n */\n children: (ColumnGrouping<T> | ColumnRegular)[];\n /**\n * A `DataFormat` object that represents the name of the grouping.\n */\n name: DataFormat<T>;\n};\n/**\n * Configuration for header inner template properties\n */\nexport interface ColumnProperties {\n /**\n * Header inner template\n * Function/component to render custom header content\n */\n columnTemplate?: ColumnTemplateFunc;\n /**\n * Header Cell properties\n * Custom function/component to render header properties\n */\n columnProperties?: ColPropertiesFunc;\n}\n/**\n * Type that represents a collection of column types.\n * The keys are the names of the column types and the values are the corresponding column type objects.\n */\nexport type ColumnTypes = {\n /**\n * The name of the column type.\n */\n [name: string]: ColumnType;\n};\n\n/**\n * Interface for custom cell renderer.\n */\nexport interface CellTemplate {\n // TODO: Add Promise support for template and all custom function so user will be able to use async render on the light speed\n (\n createElement: HyperFunc<VNode>,\n props: CellTemplateProp,\n additionalData?: any,\n ): any;\n}\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnType extends ColumnProperties {\n /**\n * Represents whether the column or cell is read-only.\n * Can be a boolean or a function that returns a boolean.\n * The function receives column data as a parameter.\n */\n readonly?: ReadOnlyFormat;\n /**\n * Represents the default column size.\n */\n size?: number;\n /**\n * Represents the minimal column size.\n * This property cannot be less than cell padding\n * in order to keep performance on top and minimize DOM elements number.\n */\n minSize?: number;\n /**\n * Represents the maximum column size.\n */\n maxSize?: number;\n /**\n * Represents a custom editor defined in @editors property.\n * Can be a string or an editor constructor function.\n */\n editor?: string | EditorCtr;\n /**\n * Represents cell properties for custom styling, classes, and events.\n */\n cellProperties?: PropertiesFunc;\n /**\n * Represents the cell template for custom rendering.\n */\n cellTemplate?: CellTemplate;\n /**\n * Represents the cell compare function for custom sorting.\n */\n cellCompare?: CellCompareFunc;\n}\nexport type Order = 'asc' | 'desc' | undefined;\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n * \n */\n/**\n * ColumnRegular interface represents regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnRegular extends ColumnType {\n /**\n * Column prop used for mapping value to cell from data source model/row, used for indexing.\n */\n prop: ColumnProp;\n /**\n * Column pin 'colPinStart'|'colPinEnd'.\n */\n pin?: DimensionColPin;\n /**\n * Column header text.\n */\n name?: any;\n /**\n * Column size would be changed based on space left.\n */\n autoSize?: boolean;\n /**\n * Filter. Require filter plugin to be installed and activated through grid config @filter.\n */\n filter?: boolean | string | string[];\n /**\n * Is column can be sorted, check @cellCompare function for custom sorting.\n */\n sortable?: boolean;\n /**\n * Sort order.\n */\n order?: Order;\n /**\n * Is cell in column or individual can be dragged.\n */\n rowDrag?: RowDrag;\n /**\n * Represents type defined in @columnTypes property through grid config.\n */\n columnType?: string;\n /**\n * Function called before column applied to the store.\n */\n beforeSetup?(rgCol: ColumnRegular): void;\n /**\n * Additional properties can be added to the column definition.\n */\n [key: string]: any;\n}\n\nexport type ColumnData = (ColumnGrouping | ColumnRegular)[];\n/**\n * Column template property.\n * Contains extended properties for column.\n */\nexport interface ColumnTemplateProp extends ColumnRegular {\n /**\n * Providers injected into the template.\n */\n providers: Providers<DimensionCols | 'rowHeaders'>;\n /**\n * Index of the column, used for mapping value to cell from data source model/row.\n */\n index: number;\n};\n\nexport type ColumnPropProp = ColumnGrouping | ColumnTemplateProp;\n// Column prop used for mapping value to cell from data source model/row, used for indexing.\nexport type ColumnProp = string | number;\n\nexport type DataFormat<T = any> = T;\n\nexport type CellProp = string | number | object | boolean | undefined;\n\n/**\n * Additional properties applied to the cell.\n * Contains style object where key is CSS property and value is CSS property value.\n * Contains class object where key is CSS class and value is boolean flag indicating if class should be applied.\n * Contains additional properties for custom cell rendering.\n */\nexport type CellProps = {\n // CSS styles applied to the cell\n style?: {\n [key: string]: string | undefined;\n };\n // CSS classes applied to the cell\n class?:\n | {\n // CSS class name\n [key: string]: boolean;\n }\n | string;\n // Additional properties for custom cell rendering\n [attr: string]: CellProp;\n};\n\n/**\n * Providers for grid which are going to be injected into each cell template\n */\nexport type Providers<T = DimensionRows> = {\n /**\n * Dimension type (e.g. row or column)\n */\n type: T;\n /**\n * Flag indicating if grid is in readonly mode\n */\n readonly: boolean;\n /**\n * Data source store\n */\n data: Observable<DataSourceState<any, any>> | ColumnRegular[];\n /**\n * Viewport store\n */\n viewport: Observable<ViewportState>;\n /**\n * Dimension store\n */\n dimension: Observable<DimensionSettingsState>;\n /**\n * Selection store\n */\n selection: Observable<SelectionStoreState>;\n};\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n // (tag: any): T;\n (tag: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, data: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: T): T;\n}\n/**\n * `FocusTemplateFunc` is a function that takes an HTML tag or component, and\n * returns a JSX element. This function is used to create JSX elements in a\n * context where JSX is not valid.\n */\nexport type FocusTemplateFunc = (\n createElement: HyperFunc<VNode>,\n detail: FocusRenderEvent,\n) => any;\n\n\n/**\n * `CellCompareFunc` is a function that takes the column property to compare,\n * the data of the first cell, and the data of the second cell. It returns a\n * number indicating the relative order of the two cells.\n */\nexport type CellCompareFunc = (\n // The column property to compare.\n prop: ColumnProp,\n // The data of the first cell.\n a: DataType,\n // The data of the second cell.\n b: DataType,\n) => number;\nexport type ColumnTemplateFunc = (\n createElement: HyperFunc<VNode>,\n props: ColumnTemplateProp,\n additionalData?: any,\n) => any;\nexport type PropertiesFunc = (\n props: ColumnDataSchemaModel,\n) => CellProps | void | undefined;\nexport type ColPropertiesFunc = (\n props: ColumnPropProp,\n) => CellProps | void | undefined;\nexport type DataType<D = any> = {\n [T in ColumnProp]: DataFormat<D>;\n};\n\nexport type DataLookup<T = any> = {\n [rowIndex: number]: DataType<T>;\n};\n/**\n * `RowDefinition` is a type that represents a row definition in the\n * viewport.\n */\nexport type RowDefinition = {\n /**\n * The type of the row.\n */\n type: DimensionRows;\n /**\n * The size of the row.\n */\n size: number;\n /**\n * The index of the row.\n */\n index: number;\n};\nexport interface RowHeaders extends ColumnRegular {}\n/**\n * `ViewPortResizeEvent` is an object that contains information about a resize\n * event in the viewport.\n */\nexport type ViewPortResizeEvent = {\n /* The dimension of the viewport being resized. */\n dimension: DimensionType;\n /* The new size of the viewport. */\n size: number;\n /* Indicates whether the resize event is for a row header. */\n rowHeader?: boolean;\n};\n\n/**\n * `ViewPortScrollEvent` is an object that contains information about a scroll\n * event in the viewport.\n */\nexport type ViewPortScrollEvent = {\n /**\n * The dimension of the viewport being scrolled.\n */\n dimension: DimensionType;\n /**\n * The coordinate of the scroll event.\n */\n coordinate: number;\n /**\n * The change in coordinate between scroll events.\n */\n delta?: number;\n /**\n * Indicates whether the scroll event occurred outside the viewport.\n */\n outside?: boolean;\n};\n\n/**\n * `InitialHeaderClick` represents the information needed to handle a click\n * event on the initial column header.\n */\nexport type InitialHeaderClick = {\n /**\n * The index of the column header that was clicked.\n */\n index: number;\n /**\n * The original mouse event that triggered the click.\n */\n originalEvent: MouseEvent;\n /**\n * The column that was clicked.\n */\n column: ColumnRegular;\n providers: Providers<DimensionCols | 'rowHeaders'>;\n};\n\n/**\n * `Range` is an object that represents a range of values.\n */\nexport type Range = {\n /**\n * The start of the range.\n */\n start: number;\n /**\n * The end of the range.\n */\n end: number;\n};\n\n/**\n * `ViewportStateItems` is an object that represents the items in a viewport\n * along with their corresponding range.\n */\nexport type ViewportStateItems = {\n /**\n * The items in the viewport.\n */\n items: VirtualPositionItem[];\n} & Range;\n\n/**\n * `ViewportState` is an object that represents the state of a viewport.\n */\nexport interface ViewportState extends ViewportStateItems {\n /**\n * The number of real items in the viewport.\n */\n realCount: number;\n /**\n * The virtual size of the viewport.\n */\n virtualSize: number;\n}\n\n/**\n * `ViewSettingSizeProp` is a record that maps column or row indexes to their\n * corresponding sizes.\n */\nexport type ViewSettingSizeProp = Record<string, number>;\n\n/**\n * `VirtualPositionItem` is an object that represents a virtual position item\n * in the viewport.\n */\nexport interface VirtualPositionItem extends PositionItem {\n /**\n * The size of the virtual position item.\n */\n size: number;\n}\nexport type DataSourceState<\n T extends DataType | ColumnRegular,\n ST extends DimensionRows | DimensionCols,\n> = {\n // items - index based array for mapping to source tree\n items: number[];\n // all items, used as proxy for sorting, trimming and others manipulations\n proxyItems: number[];\n // original data source\n source: T[];\n // grouping\n groupingDepth: number;\n groups: Record<any, any>;\n // data source type\n type: ST;\n // trim data, to hide entities from visible data source\n trimmed: Record<any, any>;\n};\nexport interface PositionItem {\n itemIndex: number;\n start: number;\n end: number;\n}\n/**\n * Object containing information about calculated dimensions.\n * Used for both columns and rows.\n */\nexport interface DimensionCalc {\n /**\n * Array of indexes of visible items.\n */\n indexes: number[];\n\n /**\n * Count of visible items.\n */\n count: number;\n\n /**\n * Array of indexes of visible items.\n * Used for mapping items to their position in DOM.\n */\n positionIndexes: number[];\n\n /**\n * Mapping of position to item.\n * Used for mapping position in DOM to item.\n */\n positionIndexToItem: {\n /**\n * Position in DOM.\n */\n [position: number]: PositionItem;\n };\n\n /**\n * Mapping of index to item.\n * Used for mapping index in data source to item.\n */\n indexToItem: {\n /**\n * Index in data source.\n */\n [index: number]: PositionItem;\n };\n\n /**\n * Object containing information about trimmed data.\n * Used for hiding entities from visible data source.\n */\n trimmed: Record<any, any>;\n\n /**\n * Object containing size for each visible item.\n */\n sizes: ViewSettingSizeProp;\n}\n/**\n * Represents the settings state of a dimension.\n * It extends the calculation properties of a dimension.\n * It also includes the real size and origin item size of the dimension.\n */\nexport interface DimensionSettingsState extends DimensionCalc {\n /**\n * Represents the real size of the dimension.\n */\n realSize: number;\n\n /**\n * Represents the origin item size of the dimension.\n */\n originItemSize: number;\n}\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores.\n */\nexport type DimensionStores = {\n [T in MultiDimensionType]: Observable<DimensionSettingsState>;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores for the viewport.\n */\nexport type ViewportStores = {\n [T in MultiDimensionType]: Observable<ViewportState>;\n};\n\n/**\n * Represents the event object that is emitted when the drag operation starts.\n */\nexport interface DragStartEvent {\n /**\n * Represents the original mouse event that triggered the drag operation.\n */\n originalEvent: MouseEvent;\n\n /**\n * Represents the model of the column being dragged.\n */\n model: ColumnDataSchemaModel;\n}\n\n/**\n * Represents the event object that is emitted before cell rendering.\n * It includes information about the dimension type, column, row, and model.\n */\nexport interface BeforeCellRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the column being rendered.\n */\n column: VirtualPositionItem;\n\n /**\n * Represents the row being rendered.\n */\n row: VirtualPositionItem;\n\n /**\n * Represents the model being rendered.\n */\n model: T;\n}\n\n/**\n * Represents the event object that is emitted before row rendering.\n * It includes information about the dimension type, data item, item, and node.\n */\nexport interface BeforeRowRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the data item being rendered.\n */\n model: T;\n\n /**\n * Represents the item being rendered.\n */\n item: VirtualPositionItem;\n\n /**\n * Represents the node being rendered.\n */\n node: VNode;\n}\n\n/**\n * Represents the event object that is emitted after rendering.\n * It includes information about the dimension type.\n */\nexport type AfterRendererEvent = {\n /**\n * Represents the type of dimension being rendered.\n */\n type: DimensionType;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding dimension types.\n */\nexport interface AllDimensionType {\n /**\n * Represents the dimension type for rows.\n */\n rowType: DimensionRows;\n\n /**\n * Represents the dimension type for columns.\n */\n colType: DimensionCols;\n}\n\n/**\n * Represents the event object that is emitted when applying focus.\n * It includes information about the dimension type and focused cells.\n */\nexport interface ApplyFocusEvent extends AllDimensionType, FocusedCells {}\n\n/**\n * Represents the event object that is emitted before focus rendering.\n * It includes information about the dimension type and range area.\n */\nexport interface FocusRenderEvent extends AllDimensionType {\n /**\n * Represents the range area of the focus.\n */\n range: RangeArea;\n\n /**\n * Changes for the next cell to focus. @example { y: -1 }\n */\n next?: Partial<Cell>;\n}\n/**\n * Represents the event object that is emitted when scrolling occurs.\n * The `type` property indicates the type of dimension (row or column) being scrolled.\n * The `coordinate` property represents the current scroll position in that dimension.\n */\nexport type ScrollCoordinateEvent = {\n /**\n * Represents the type of dimension being scrolled.\n * Possible values are 'rgRow' and 'rgCol'.\n */\n type: DimensionType;\n\n /**\n * Represents the current scroll position in the specified dimension.\n * The value is a number representing the coordinate in pixels.\n */\n coordinate: number;\n};\n\n\n/** Range paste. */\nexport type RangeClipboardPasteEvent = {\n data: DataLookup;\n models: {\n [rowIndex: number]: DataType;\n };\n range: RangeArea | null;\n} & AllDimensionType;\n\n/** Range copy. */\nexport type RangeClipboardCopyEventProps<T = any> = {\n data: DataFormat<T>[][];\n range: RangeArea;\n mapping: OldNewRangeMapping;\n} & AllDimensionType;"]}
@@ -0,0 +1,124 @@
1
+ /*!
2
+ * Built by Revolist OU ❤️
3
+ */
4
+ import isArray from "lodash/isArray";
5
+ import reduce from "lodash/reduce";
6
+ export function getColumnType(rgCol) {
7
+ if (rgCol.pin) {
8
+ return rgCol.pin;
9
+ }
10
+ return 'rgCol';
11
+ }
12
+ export function getColumnSizes(cols) {
13
+ const res = {};
14
+ for (const [i, c] of cols.entries()) {
15
+ if (c.size) {
16
+ res[i] = c.size;
17
+ }
18
+ }
19
+ return res;
20
+ }
21
+ /**
22
+ * Check if column is grouping column
23
+ */
24
+ export function isColGrouping(colData) {
25
+ return !!colData.children;
26
+ }
27
+ /**
28
+ * This function is used to create a collection of columns.
29
+ */
30
+ export function getColumns(columns, level = 0, types) {
31
+ const collection = {
32
+ // columns as they are in stores per type
33
+ columns: {
34
+ rgCol: [],
35
+ colPinStart: [],
36
+ colPinEnd: [],
37
+ },
38
+ // columns indexed by prop for quick access
39
+ columnByProp: {},
40
+ // column grouping
41
+ columnGrouping: {
42
+ rgCol: [],
43
+ colPinStart: [],
44
+ colPinEnd: [],
45
+ },
46
+ // max depth level for column grouping
47
+ maxLevel: level,
48
+ // sorting
49
+ sort: {},
50
+ };
51
+ return reduce(columns, (res, colData) => {
52
+ // Grouped column
53
+ if (isColGrouping(colData)) {
54
+ return gatherGroup(res, colData, getColumns(colData.children, level + 1, types), level);
55
+ }
56
+ // Regular column
57
+ const regularColumn = Object.assign(Object.assign({}, (colData.columnType && types && types[colData.columnType])), colData);
58
+ // Regular column, no Pin
59
+ if (!regularColumn.pin) {
60
+ res.columns.rgCol.push(regularColumn);
61
+ // Pin
62
+ }
63
+ else {
64
+ res.columns[regularColumn.pin].push(regularColumn);
65
+ }
66
+ if (regularColumn.order) {
67
+ res.sort[regularColumn.prop] = regularColumn;
68
+ }
69
+ // it's possible that some columns have same prop, but better to avoid it
70
+ if (!res.columnByProp[regularColumn.prop]) {
71
+ res.columnByProp[regularColumn.prop] = [];
72
+ }
73
+ res.columnByProp[regularColumn.prop].push(regularColumn);
74
+ // trigger setup hook if present
75
+ regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);
76
+ return res;
77
+ }, collection);
78
+ }
79
+ export function gatherGroup(res, colData, collection, level = 0) {
80
+ // group template
81
+ const group = Object.assign(Object.assign({}, colData), { level, ids: [] });
82
+ // check columns for update
83
+ for (let k in collection.columns) {
84
+ const key = k;
85
+ const resultItem = res.columns[key];
86
+ const collectionItem = collection.columns[key];
87
+ // if column data
88
+ if (isArray(resultItem) && isArray(collectionItem)) {
89
+ // fill columns
90
+ resultItem.push(...collectionItem);
91
+ // fill grouping
92
+ if (collectionItem.length) {
93
+ res.columnGrouping[key].push(Object.assign(Object.assign({}, group), { ids: collectionItem.map(item => item.prop) }));
94
+ }
95
+ }
96
+ }
97
+ // merge column groupings
98
+ for (let k in collection.columnGrouping) {
99
+ const key = k;
100
+ const collectionItem = collection.columnGrouping[key];
101
+ res.columnGrouping[key].push(...collectionItem);
102
+ }
103
+ res.maxLevel = Math.max(res.maxLevel, collection.maxLevel);
104
+ res.sort = Object.assign(Object.assign({}, res.sort), collection.sort);
105
+ return res;
106
+ }
107
+ function findColumn(columns, prop) {
108
+ for (const c of columns) {
109
+ if (isColGrouping(c)) {
110
+ const found = findColumn(c.children, prop);
111
+ if (found) {
112
+ return found;
113
+ }
114
+ }
115
+ else if (c.prop === prop) {
116
+ return c;
117
+ }
118
+ }
119
+ return undefined;
120
+ }
121
+ export function getColumnByProp(columns, prop) {
122
+ return findColumn(columns, prop);
123
+ }
124
+ //# sourceMappingURL=column.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column.utils.js","sourceRoot":"","sources":["../../src/utils/column.utils.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,MAAM,MAAM,eAAe,CAAC;AA+CnC,MAAM,UAAU,aAAa,CAAC,KAAoB;IAChD,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,KAAK,CAAC,GAAG,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAqB;IAClD,MAAM,GAAG,GAAwB,EAAE,CAAC;IACpC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;QACpC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;YACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAGD;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAuC;IAEvC,OAAO,CAAC,CAAE,OAA0B,CAAC,QAAQ,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CACxB,OAAmB,EACnB,KAAK,GAAG,CAAC,EACT,KAAmB;IAEnB,MAAM,UAAU,GAAqB;QACnC,yCAAyC;QACzC,OAAO,EAAE;YACP,KAAK,EAAE,EAAE;YACT,WAAW,EAAE,EAAE;YACf,SAAS,EAAE,EAAE;SACd;QACD,2CAA2C;QAC3C,YAAY,EAAE,EAAE;QAChB,kBAAkB;QAClB,cAAc,EAAE;YACd,KAAK,EAAE,EAAE;YACT,WAAW,EAAE,EAAE;YACf,SAAS,EAAE,EAAE;SACd;QACD,sCAAsC;QACtC,QAAQ,EAAE,KAAK;QACf,UAAU;QACV,IAAI,EAAE,EAAE;KACT,CAAC;IAEF,OAAO,MAAM,CACX,OAAO,EACP,CAAC,GAAq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,GAAG,CAAC,IAAI,GAAK,UAAU,CAAC,IAAI,CAAE,CAAC;IAC/C,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,UAAU,CACjB,OAAmB,EACnB,IAAgB;IAEhB,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;YACrB,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC3C,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YAC3B,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,OAAmB,EACnB,IAAgB;IAEhB,OAAO,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import isArray from 'lodash/isArray';\nimport reduce from 'lodash/reduce';\n\nimport {\n ColumnData,\n ColumnGrouping,\n ColumnProp,\n ColumnRegular,\n ColumnTypes,\n DimensionCols,\n ViewSettingSizeProp,\n} from '@type';\nimport { Group as StoreGroup } from '@store';\n\nexport type ColumnItems = Record<DimensionCols, ColumnRegular[]>;\nexport interface ColumnGroup extends StoreGroup {\n level: number;\n}\nexport type ColumnGroupingCollection = Record<DimensionCols, ColumnGroup[]>;\n\n/**\n * Column collection definition.\n * Used to access indexed data for columns.\n * Can be accessed via different events.\n */\nexport type ColumnCollection = {\n /**\n * Columns as they are in stores\n */\n columns: Record<DimensionCols, ColumnRegular[]>;\n /**\n * Columns indexed by prop for quick access, it's possible to have multiple columns with same prop but not recommended\n */\n columnByProp: Record<ColumnProp, ColumnRegular[]>;\n /**\n * Grouped columns\n */\n columnGrouping: ColumnGroupingCollection;\n /**\n * Max level of grouping\n */\n maxLevel: number;\n /**\n * Sorting\n */\n sort: Record<ColumnProp, ColumnRegular>;\n};\n\nexport function getColumnType(rgCol: ColumnRegular): DimensionCols {\n if (rgCol.pin) {\n return rgCol.pin;\n }\n return 'rgCol';\n}\n\nexport function getColumnSizes(cols: ColumnRegular[]): ViewSettingSizeProp {\n const res: ViewSettingSizeProp = {};\n for (const [i, c] of cols.entries()) {\n if (c.size) {\n res[i] = c.size;\n }\n }\n return res;\n}\n\n\n/**\n * Check if column is grouping column\n */\nexport function isColGrouping(\n colData: ColumnGrouping | ColumnRegular,\n): colData is ColumnGrouping {\n return !!(colData as ColumnGrouping).children;\n}\n\n/**\n * This function is used to create a collection of columns.\n */\nexport function getColumns(\n columns: ColumnData,\n level = 0,\n types?: ColumnTypes,\n): ColumnCollection {\n const collection: ColumnCollection = {\n // columns as they are in stores per type\n columns: {\n rgCol: [],\n colPinStart: [],\n colPinEnd: [],\n },\n // columns indexed by prop for quick access\n columnByProp: {},\n // column grouping\n columnGrouping: {\n rgCol: [],\n colPinStart: [],\n colPinEnd: [],\n },\n // max depth level for column grouping\n maxLevel: level,\n // sorting\n sort: {},\n };\n\n return reduce(\n columns,\n (res: ColumnCollection, colData: ColumnGrouping | ColumnRegular) => {\n // Grouped column\n if (isColGrouping(colData)) {\n return gatherGroup(\n res,\n colData,\n getColumns(colData.children, level + 1, types),\n level,\n );\n }\n // Regular column\n const regularColumn = {\n ...(colData.columnType && types && types[colData.columnType]),\n ...colData,\n };\n // Regular column, no Pin\n if (!regularColumn.pin) {\n res.columns.rgCol.push(regularColumn);\n // Pin\n } else {\n res.columns[regularColumn.pin].push(regularColumn);\n }\n if (regularColumn.order) {\n res.sort[regularColumn.prop] = regularColumn;\n }\n // it's possible that some columns have same prop, but better to avoid it\n if (!res.columnByProp[regularColumn.prop]) {\n res.columnByProp[regularColumn.prop] = [];\n }\n res.columnByProp[regularColumn.prop].push(regularColumn);\n\n // trigger setup hook if present\n regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);\n return res;\n },\n collection,\n );\n}\n\nexport function gatherGroup<T extends ColumnCollection>(\n res: T,\n colData: ColumnGrouping,\n collection: T,\n level = 0,\n): T {\n // group template\n const group: ColumnGroup = {\n ...colData,\n level,\n ids: [],\n };\n\n // check columns for update\n for (let k in collection.columns) {\n const key = k as keyof ColumnCollection['columns'];\n const resultItem = res.columns[key];\n const collectionItem = collection.columns[key];\n\n // if column data\n if (isArray(resultItem) && isArray(collectionItem)) {\n // fill columns\n resultItem.push(...collectionItem);\n\n // fill grouping\n if (collectionItem.length) {\n res.columnGrouping[key].push({\n ...group,\n ids: collectionItem.map(item => item.prop),\n });\n }\n }\n }\n // merge column groupings\n for (let k in collection.columnGrouping) {\n const key = k as DimensionCols;\n const collectionItem = collection.columnGrouping[key];\n res.columnGrouping[key].push(...collectionItem);\n }\n res.maxLevel = Math.max(res.maxLevel, collection.maxLevel);\n res.sort = { ...res.sort, ...collection.sort };\n return res;\n}\n\nfunction findColumn(\n columns: ColumnData,\n prop: ColumnProp,\n): ColumnRegular | undefined {\n for (const c of columns) {\n if (isColGrouping(c)) {\n const found = findColumn(c.children, prop);\n if (found) {\n return found;\n }\n } else if (c.prop === prop) {\n return c;\n }\n }\n return undefined;\n}\n\nexport function getColumnByProp(\n columns: ColumnData,\n prop: ColumnProp,\n): ColumnRegular | undefined {\n return findColumn(columns, prop);\n}\n"]}
@@ -1,6 +1,13 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
+ export * from './store.utils';
5
+ export * from './store.types';
6
+ export * from './column.utils';
7
+ export * from './consts';
8
+ export * from './key.utils';
9
+ export * from './key.codes';
10
+ export * from './row-header-utils';
4
11
  /* Generate range on size
5
12
  */
6
13
  export function range(size, startAt = 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;GACG;AACH,MAAM,UAAU,KAAK,CAAC,IAAY,EAAE,OAAO,GAAG,CAAC;IAC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AAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC9B,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC5D,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,wBAAwB,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACvI,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/* Generate range on size\n */\nexport function range(size: number, startAt = 0): number[] {\n const res: number[] = [];\n const end = startAt + size;\n for (let i = startAt; i < end; i++) {\n res.push(i);\n }\n return res;\n}\n\n/* Find index position in array */\nexport function findPositionInArray<T>(this: T[], el: T, compareFn: (el: T, el2: T) => number): number {\n return (function (arr): number {\n let m = 0;\n let n = arr.length - 1;\n\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = compareFn(el, arr[k]);\n\n if (cmp > 0) {\n m = k + 1;\n } else if (cmp < 0) {\n n = k - 1;\n } else {\n return k;\n }\n }\n\n return -m - 1;\n })(this);\n}\n\n/**\n * Sorted push\n */\nexport function pushSorted<T>(arr: T[], el: T, fn: (el: T, el2: T) => number): T[] {\n arr.splice(findPositionInArray.bind(arr)(el, fn), 0, el);\n return arr;\n}\n\n// (arr1[index1] < arr2[index2])\nfunction simpleCompare<T>(el1: T, el2: T): boolean {\n return el1 < el2;\n}\n\n/**\n * Merge sorted array helper function\n */\nexport function mergeSortedArray<T>(arr1: T[], arr2: T[], compareFn: (el: T, el2: T) => boolean = simpleCompare): T[] {\n const merged: T[] = [];\n let index1 = 0;\n let index2 = 0;\n let current = 0;\n\n while (current < arr1.length + arr2.length) {\n let isArr1Depleted = index1 >= arr1.length;\n let isArr2Depleted = index2 >= arr2.length;\n\n if (!isArr1Depleted && (isArr2Depleted || compareFn(arr1[index1], arr2[index2]))) {\n merged[current] = arr1[index1];\n index1++;\n } else {\n merged[current] = arr2[index2];\n index2++;\n }\n\n current++;\n }\n\n return merged;\n}\n\n/**\n * Calculate system scrollbar size\n */\nexport function getScrollbarSize(document: Document): number {\n // Create a temporary div container and append it to the body\n const container = document.createElement('div');\n\n // Apply styling to ensure the div is scrollable\n container.style.overflow = 'scroll';\n container.style.visibility = 'hidden'; // make sure the container isn't visible\n container.style.position = 'absolute';\n container.style.top = '-9999px'; // move it out of the screen\n container.style.width = '50px'; // arbitrary width\n container.style.height = '50px'; // arbitrary height\n\n // Append the div to the body\n document.body.appendChild(container);\n\n // Calculate the width of the scrollbar\n const scrollbarWidth = container.offsetWidth - container.clientWidth;\n\n // Remove the div from the body after calculation\n document.body.removeChild(container);\n\n // Return the calculated width of the scrollbar\n return scrollbarWidth;\n}\n\n/* Scale a value between 2 ranges\n *\n * Sample:\n * // 55 from a 0-100 range to a 0-1000 range (Ranges don't have to be positive)\n * const n = scaleValue(55, [0,100], [0,1000]);\n *\n * Ranges of two values\n * @from\n * @to\n *\n * ~~ return value does the equivalent of Math.floor but faster.\n */\nexport function scaleValue(value: number, from: [number, number], to: [number, number]): number {\n return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];\n}\n\n/**\n * Async timeout\n */\nexport async function timeout(delay = 0): Promise<void> {\n await new Promise((r: (v?: any) => void) => {\n setTimeout(() => r(), delay);\n });\n}\n\n/**\n * Type script mixins\n */\nexport function applyMixins(derivedCtor: any, constructors: any[]) {\n constructors.forEach(baseCtor => {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {\n Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null));\n });\n });\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAg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;QACzC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,WAAgB,EAAE,YAAmB;IAC/D,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC9B,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC5D,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,wBAAwB,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACvI,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["export * from './store.utils';\nexport * from './store.types';\nexport * from './column.utils';\nexport * from './consts';\nexport * from './key.utils';\nexport * from './key.codes';\nexport * from './row-header-utils';\n\n\n/* Generate range on size\n */\nexport function range(size: number, startAt = 0): number[] {\n const res: number[] = [];\n const end = startAt + size;\n for (let i = startAt; i < end; i++) {\n res.push(i);\n }\n return res;\n}\n\n/* Find index position in array */\nexport function findPositionInArray<T>(this: T[], el: T, compareFn: (el: T, el2: T) => number): number {\n return (function (arr): number {\n let m = 0;\n let n = arr.length - 1;\n\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = compareFn(el, arr[k]);\n\n if (cmp > 0) {\n m = k + 1;\n } else if (cmp < 0) {\n n = k - 1;\n } else {\n return k;\n }\n }\n\n return -m - 1;\n })(this);\n}\n\n/**\n * Sorted push\n */\nexport function pushSorted<T>(arr: T[], el: T, fn: (el: T, el2: T) => number): T[] {\n arr.splice(findPositionInArray.bind(arr)(el, fn), 0, el);\n return arr;\n}\n\n// (arr1[index1] < arr2[index2])\nfunction simpleCompare<T>(el1: T, el2: T): boolean {\n return el1 < el2;\n}\n\n/**\n * Merge sorted array helper function\n */\nexport function mergeSortedArray<T>(arr1: T[], arr2: T[], compareFn: (el: T, el2: T) => boolean = simpleCompare): T[] {\n const merged: T[] = [];\n let index1 = 0;\n let index2 = 0;\n let current = 0;\n\n while (current < arr1.length + arr2.length) {\n let isArr1Depleted = index1 >= arr1.length;\n let isArr2Depleted = index2 >= arr2.length;\n\n if (!isArr1Depleted && (isArr2Depleted || compareFn(arr1[index1], arr2[index2]))) {\n merged[current] = arr1[index1];\n index1++;\n } else {\n merged[current] = arr2[index2];\n index2++;\n }\n\n current++;\n }\n\n return merged;\n}\n\n/**\n * Calculate system scrollbar size\n */\nexport function getScrollbarSize(document: Document): number {\n // Create a temporary div container and append it to the body\n const container = document.createElement('div');\n\n // Apply styling to ensure the div is scrollable\n container.style.overflow = 'scroll';\n container.style.visibility = 'hidden'; // make sure the container isn't visible\n container.style.position = 'absolute';\n container.style.top = '-9999px'; // move it out of the screen\n container.style.width = '50px'; // arbitrary width\n container.style.height = '50px'; // arbitrary height\n\n // Append the div to the body\n document.body.appendChild(container);\n\n // Calculate the width of the scrollbar\n const scrollbarWidth = container.offsetWidth - container.clientWidth;\n\n // Remove the div from the body after calculation\n document.body.removeChild(container);\n\n // Return the calculated width of the scrollbar\n return scrollbarWidth;\n}\n\n/* Scale a value between 2 ranges\n *\n * Sample:\n * // 55 from a 0-100 range to a 0-1000 range (Ranges don't have to be positive)\n * const n = scaleValue(55, [0,100], [0,1000]);\n *\n * Ranges of two values\n * @from\n * @to\n *\n * ~~ return value does the equivalent of Math.floor but faster.\n */\nexport function scaleValue(value: number, from: [number, number], to: [number, number]): number {\n return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];\n}\n\n/**\n * Async timeout\n */\nexport async function timeout(delay = 0): Promise<void> {\n await new Promise((r: (v?: any) => void) => {\n setTimeout(() => r(), delay);\n });\n}\n\n/**\n * Type script mixins\n */\nexport function applyMixins(derivedCtor: any, constructors: any[]) {\n constructors.forEach(baseCtor => {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {\n Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null));\n });\n });\n}\n"]}
@@ -1,11 +1,10 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import { C as _isIterateeCall, B as toInteger_1, a as getVisibleSourceItem, b as getSourceItem } from './dimension.helpers-56298828.js';
4
+ import { O as GRID_INTERNALS, a8 as _isIterateeCall, a7 as toInteger_1, a as getVisibleSourceItem, C as CELL_CLASS, y as DISABLED_CLASS, b as getSourceItem } from './index-f65def08.js';
5
5
  import './toNumber-8de324a7.js';
6
6
  import './index-a61f225b.js';
7
- import { g as getRange } from './selection.helpers-accaad4a.js';
8
- import { G as GRID_INTERNALS, C as CELL_CLASS, D as DISABLED_CLASS } from './index-4e881436.js';
7
+ import { g as getRange } from './selection.helpers-d92697e1.js';
9
8
 
10
9
  const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;
11
10
  const PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;
@@ -558,4 +557,4 @@ function doPropMerge(existing, extra) {
558
557
 
559
558
  export { CONTENT_SLOT as C, DATA_SLOT as D, FOOTER_SLOT as F, GROUP_EXPANDED as G, HEADER_SLOT as H, PSEUDO_GROUP_ITEM_VALUE as P, getParsedGroup as a, isSameGroup as b, GROUP_DEPTH as c, PSEUDO_GROUP_ITEM_ID as d, GROUPING_ROW_TYPE as e, PSEUDO_GROUP_COLUMN as f, getGroupingName as g, GROUP_EXPAND_EVENT as h, isGrouping as i, gatherGrouping as j, isGroupingColumn as k, doPropMerge as l, ColumnService as m, GROUP_EXPAND_BTN as n, PSEUDO_GROUP_ITEM as o, isRowDragService as p, getCellData as q, viewportDataPartition as v };
560
559
 
561
- //# sourceMappingURL=column.service-5d14e7e9.js.map
560
+ //# sourceMappingURL=column.service-af0694c5.js.map
@@ -0,0 +1 @@
1
+ {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AQ,EAC/B;YACA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;SACjC;aAAM,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;YAC1C,KAAK,CAAC,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC;SAClC;KACF;IACD,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,KAAK,CAAC,KAAK,mCAAQ,KAAK,CAAC,KAAK,GAAK,KAAK,CAAC,KAAK,CAAE,CAAC;KAClD;IACD,OAAO,KAAK,CAAC;AACf;;;;","names":["baseSlice","require$$0","require$$1","require$$2","slice"],"sources":["src/plugins/groupingRow/grouping.const.ts","src/plugins/groupingRow/grouping.service.ts","src/components/revoGrid/viewport.helpers.ts","node_modules/lodash/_baseSlice.js","node_modules/lodash/slice.js","src/components/data/column.service.ts"],"sourcesContent":["import { GRID_INTERNALS } from '../../utils/consts';\n\nexport const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;\nexport const PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;\nexport const PSEUDO_GROUP_ITEM_ID = `${GRID_INTERNALS}-id`;\nexport const PSEUDO_GROUP_ITEM_VALUE = `${GRID_INTERNALS}-value`;\nexport const PSEUDO_GROUP_COLUMN = `${GRID_INTERNALS}-column`;\nexport const GROUP_EXPANDED = `${GRID_INTERNALS}-expanded`;\nexport const GROUP_ORIGINAL_INDEX = `${GRID_INTERNALS}-original-index`;\nexport const GROUP_EXPAND_BTN = `group-expand`;\nexport const GROUP_EXPAND_EVENT = `groupexpandclick`;\nexport const GROUPING_ROW_TYPE = 'rgRow';\n","import { DataType, ColumnProp, ColumnRegular } from '@type';\nimport {\n GROUP_DEPTH,\n GROUP_EXPANDED,\n PSEUDO_GROUP_COLUMN,\n PSEUDO_GROUP_ITEM,\n PSEUDO_GROUP_ITEM_ID,\n PSEUDO_GROUP_ITEM_VALUE,\n GROUP_ORIGINAL_INDEX,\n} from './grouping.const';\nimport { GroupLabelTemplateFunc } from './grouping.row.types';\n\nexport type ExpandedOptions = {\n prevExpanded?: Record<string, boolean>;\n expandedAll?: boolean; // skip trim\n\n getGroupValue?(item: DataType, prop: string | number): any;\n groupLabelTemplate?: GroupLabelTemplateFunc;\n};\n\ntype GroupedData = Map<string, GroupedData | DataType[]>;\n\nfunction getGroupValueDefault(item: DataType, prop: string | number) {\n return item[prop] || null;\n}\n\n\n/**\n * Gather data for grouping\n * @param array - flat data array\n * @param groupIds - ids of groups\n * @param expanded - potentially expanded items if present\n */\nexport function gatherGrouping(\n array: DataType[],\n groupIds: ColumnProp[],\n { prevExpanded, expandedAll, getGroupValue = getGroupValueDefault }: ExpandedOptions,\n) {\n const groupedItems: GroupedData = new Map();\n array.forEach((item, originalIndex) => {\n const groupLevelValues = groupIds.map(groupId => getGroupValue(item, groupId));\n const lastLevelValue = groupLevelValues.pop();\n let currentGroupLevel = groupedItems;\n groupLevelValues.forEach(value => {\n if (!currentGroupLevel.has(value)) {\n currentGroupLevel.set(value, new Map());\n }\n currentGroupLevel = currentGroupLevel.get(value) as GroupedData;\n });\n if (!currentGroupLevel.has(lastLevelValue)) {\n currentGroupLevel.set(lastLevelValue, []);\n }\n const lastLevelItems = currentGroupLevel.get(\n lastLevelValue,\n ) as DataType[];\n lastLevelItems.push({\n ...item,\n [GROUP_ORIGINAL_INDEX]: originalIndex,\n });\n });\n\n let itemIndex = -1;\n const groupingDepth = groupIds.length;\n // collapse all groups in the beginning\n const trimmed: Record<number, boolean> = {};\n // index mapping\n const oldNewIndexMap: Record<number, number> = {};\n // check if group header exists\n const pseudoGroupTest: Record<string, number[]> = {};\n const sourceWithGroups: DataType[] = [];\n function flattenGroupMaps(\n groupedValues: GroupedData,\n parentIds: string[],\n isExpanded: boolean,\n ) {\n const depth = parentIds.length;\n groupedValues.forEach((innerGroupedValues, groupId) => {\n const levelIds = [...parentIds, groupId];\n const mergedIds = levelIds.join(',');\n const isGroupExpanded =\n isExpanded && (!!expandedAll || !!prevExpanded?.[mergedIds]);\n sourceWithGroups.push({\n [PSEUDO_GROUP_ITEM]: groupId,\n [GROUP_DEPTH]: depth,\n [PSEUDO_GROUP_ITEM_ID]: JSON.stringify(levelIds),\n [PSEUDO_GROUP_ITEM_VALUE]: mergedIds,\n [GROUP_EXPANDED]: isGroupExpanded,\n });\n itemIndex += 1;\n if (!isGroupExpanded && depth) {\n trimmed[itemIndex] = true;\n }\n if (Array.isArray(innerGroupedValues)) {\n innerGroupedValues.forEach(value => {\n itemIndex += 1;\n if (!isGroupExpanded) {\n trimmed[itemIndex] = true;\n }\n oldNewIndexMap[value[GROUP_ORIGINAL_INDEX]] = itemIndex;\n const pseudoGroupTestIds = levelIds.map((_value, index) =>\n levelIds.slice(0, index + 1).join(','),\n );\n pseudoGroupTestIds.forEach(pseudoGroupTestId => {\n if (!pseudoGroupTest[pseudoGroupTestId]) {\n pseudoGroupTest[pseudoGroupTestId] = [];\n }\n pseudoGroupTest[pseudoGroupTestId].push(itemIndex);\n });\n });\n sourceWithGroups.push(...innerGroupedValues);\n } else {\n flattenGroupMaps(innerGroupedValues, levelIds, isGroupExpanded);\n }\n });\n }\n flattenGroupMaps(groupedItems, [], true);\n\n return {\n sourceWithGroups, // updates source mirror\n depth: groupingDepth, // largest depth for grouping\n trimmed, // used for expand/collapse grouping values\n oldNewIndexMap, // used for mapping old values to new\n childrenByGroup: pseudoGroupTest, // used to get child items in group\n };\n}\n\nexport function getGroupingName(rgRow?: DataType) {\n return rgRow && rgRow[PSEUDO_GROUP_ITEM];\n}\n\nexport function isGrouping(rgRow?: DataType) {\n return rgRow && typeof rgRow[PSEUDO_GROUP_ITEM] !== 'undefined';\n}\n\nexport function isGroupingColumn(column?: ColumnRegular) {\n return column && typeof column[PSEUDO_GROUP_COLUMN] !== 'undefined';\n}\n\nexport function measureEqualDepth<T>(groupA: T[], groupB: T[]) {\n const ln = groupA.length;\n let i = 0;\n for (; i < ln; i++) {\n if (groupA[i] !== groupB[i]) {\n return i;\n }\n }\n return i;\n}\n\nexport function getParsedGroup(id: string){\n const parseGroup = JSON.parse(id);\n // extra precaution and type safeguard\n if (!Array.isArray(parseGroup)) {\n return null;\n }\n return parseGroup;\n}\n\n// check if items is child of current clicked group\nexport function isSameGroup(\n currentGroup: any[],\n currentModel: DataType,\n nextModel: DataType,\n) {\n const nextGroup = getParsedGroup(nextModel[PSEUDO_GROUP_ITEM_ID]);\n if (!nextGroup) {\n return false;\n }\n\n const depth = measureEqualDepth(currentGroup, nextGroup);\n return currentModel[GROUP_DEPTH] < depth;\n}\n","/**\n * Collects data for pinned columns in the required @ViewportProps format.\n */\n\nimport { DimensionRows, MultiDimensionType, SlotType, Cell, ViewportColumn } from '@type';\n\n/**\n * Represents the slot names for the viewport slots.\n */\nexport const HEADER_SLOT = 'header'; // Slot name for the header slot\nexport const FOOTER_SLOT = 'footer'; // Slot name for the footer slot\nexport const CONTENT_SLOT = 'content'; // Slot name for the content slot\nexport const DATA_SLOT = 'data'; // Slot name for the data slot\n\n/**\n * Returns the last visible cell in the viewport for a given row type.\n * Coordinates are not zero-based and are relative to the viewport.\n * If needed to be zero-based they can be adjusted by subtracting 1.\n */\nexport function getLastCell(\n data: ViewportColumn,\n rowType: MultiDimensionType,\n): Cell {\n // Get the last visible column count from the viewport column data.\n const lastVisibleColumnCount = data.viewports[data.colType].store.get('realCount');\n\n // Get the last visible row count for the given row type from the viewport column data.\n const lastVisibleRowCount = data.viewports[rowType].store.get('realCount');\n\n // Return the last visible cell with the last visible column count and row count.\n return {\n x: lastVisibleColumnCount,\n y: lastVisibleRowCount,\n };\n}\n\n\nexport function viewportDataPartition(\n data: ViewportColumn,\n type: DimensionRows,\n slot: SlotType,\n fixed?: boolean,\n) {\n return {\n colData: data.colStore,\n viewportCol: data.viewports[data.colType].store,\n viewportRow: data.viewports[type].store,\n // lastCell is the last real coordinate + 1\n lastCell: getLastCell(data, type),\n slot,\n type,\n canDrag: !fixed,\n position: data.position,\n dataStore: data.rowStores[type].store,\n dimensionCol: data.dimensions[data.colType].store,\n dimensionRow: data.dimensions[type].store,\n style: fixed\n ? { height: `${data.dimensions[type].store.get('realSize')}px` }\n : undefined,\n };\n}\n\nexport type VPPartition = ReturnType<typeof viewportDataPartition>;","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n","var baseSlice = require('./_baseSlice'),\n isIterateeCall = require('./_isIterateeCall'),\n toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n}\n\nmodule.exports = slice;\n","import { DSourceState, getSourceItem, getVisibleSourceItem } from '@store';\nimport { CELL_CLASS, DISABLED_CLASS } from '../../utils/consts';\nimport { getRange } from '@store';\n\nimport { isGroupingColumn } from '../../plugins/groupingRow/grouping.service';\nimport slice from 'lodash/slice';\nimport {\n DimensionCols,\n DimensionRows,\n RowDrag,\n ColumnRegular,\n DataType,\n CellProps,\n ColumnDataSchemaModel,\n ColumnProp,\n DataLookup,\n DataFormat,\n ChangedRange,\n OldNewRangeMapping,\n Cell,\n RangeArea,\n BeforeSaveDataDetails,\n EditorCtr,\n Editors,\n} from '@type';\nimport { Observable } from '../../utils/store.utils';\n\nexport type ColumnStores = {\n [T in DimensionCols]: Observable<DSourceState<ColumnRegular, DimensionCols>>;\n};\nexport type RowStores = {\n [T in DimensionRows]: Observable<DSourceState<DataType, DimensionRows>>;\n};\n\nexport default class ColumnService {\n private unsubscribe: { (): void }[] = [];\n get columns(): ColumnRegular[] {\n return getVisibleSourceItem(this.source);\n }\n\n hasGrouping = false;\n type: DimensionCols;\n\n constructor(\n private dataStore: Observable<DSourceState<DataType, DimensionRows>>,\n private source: Observable<DSourceState<ColumnRegular, DimensionCols>>,\n ) {\n this.unsubscribe.push(\n source.onChange('source', s => this.checkGrouping(s)),\n );\n this.checkGrouping(source.get('source'));\n this.type = source.get('type');\n }\n\n private checkGrouping(cols: ColumnRegular[]) {\n for (let rgCol of cols) {\n if (isGroupingColumn(rgCol)) {\n this.hasGrouping = true;\n return;\n }\n this.hasGrouping = false;\n }\n }\n\n isReadOnly(r: number, c: number) {\n const readOnly = this.columns[c]?.readonly;\n if (typeof readOnly === 'function') {\n const data = this.rowDataModel(r, c);\n return readOnly(data);\n }\n return !!readOnly;\n }\n\n mergeProperties(\n r: number,\n c: number,\n defaultProps: CellProps,\n model: ColumnDataSchemaModel,\n extraPropsFunc: ColumnRegular['cellProperties'],\n ): CellProps {\n const cellClass: { [key: string]: boolean } = {\n [CELL_CLASS]: true,\n [DISABLED_CLASS]: this.isReadOnly(r, c),\n };\n let props: CellProps = {\n ...defaultProps,\n class: cellClass,\n };\n const extra = extraPropsFunc?.(model);\n if (!extra) {\n return props;\n }\n return doPropMerge(props, extra);\n }\n\n getRowClass(r: number, prop: string): string {\n const model = getSourceItem(this.dataStore, r) || {};\n return model[prop] || '';\n }\n\n getCellData(r: number, c: number): string {\n const data = this.rowDataModel(r, c);\n return getCellData(data.model[data.prop as number]);\n }\n\n getSaveData(\n rowIndex: number,\n colIndex: number,\n val?: string,\n ): BeforeSaveDataDetails {\n if (typeof val === 'undefined') {\n val = this.getCellData(rowIndex, colIndex);\n }\n const data = this.rowDataModel(rowIndex, colIndex);\n return {\n prop: data.prop,\n rowIndex,\n colIndex,\n val,\n model: data.model,\n colType: this.type,\n type: this.dataStore.get('type'),\n };\n }\n\n getCellEditor(\n _r: number,\n c: number,\n editors: Editors,\n ): EditorCtr | undefined {\n const editor = this.columns[c]?.editor;\n if (!editor) {\n return undefined;\n }\n // reference\n if (typeof editor === 'string') {\n return editors[editor];\n }\n return editor;\n }\n\n /**\n * Get cell data model for given rowIndex and colIndex\n * Used to pass data to editor/renderer\n */\n rowDataModel(rowIndex: number, colIndex: number): ColumnDataSchemaModel {\n const column = this.columns[colIndex];\n const prop: ColumnProp | undefined = column?.prop;\n const model = getSourceItem(this.dataStore, rowIndex) || {};\n const value = model[prop];\n const type = this.dataStore.get('type');\n return {\n prop,\n model,\n data: this.dataStore.get('source'),\n column,\n rowIndex,\n colIndex,\n colType: this.type,\n type,\n value,\n };\n }\n\n getRangeData(\n d: ChangedRange,\n columns: ColumnRegular[],\n ): {\n changed: DataLookup;\n mapping: OldNewRangeMapping;\n } {\n const changed: DataLookup = {};\n\n // get original length sizes\n const copyColLength = d.oldRange.x1 - d.oldRange.x + 1;\n const copyRowLength = d.oldRange.y1 - d.oldRange.y + 1;\n const mapping: OldNewRangeMapping = {};\n\n // rows\n for (\n let rowIndex = d.newRange.y, i = 0;\n rowIndex < d.newRange.y1 + 1;\n rowIndex++, i++\n ) {\n // copy original data link\n const oldRowIndex = d.oldRange.y + (i % copyRowLength);\n const copyRow = getSourceItem(this.dataStore, oldRowIndex) || {};\n\n // columns\n for (\n let colIndex = d.newRange.x, j = 0;\n colIndex < d.newRange.x1 + 1;\n colIndex++, j++\n ) {\n // check if old range area\n if (\n rowIndex >= d.oldRange.y &&\n rowIndex <= d.oldRange.y1 &&\n colIndex >= d.oldRange.x &&\n colIndex <= d.oldRange.x1\n ) {\n continue;\n }\n\n // requested column beyond range\n if (!this.columns[colIndex]) {\n continue;\n }\n const prop = this.columns[colIndex]?.prop;\n const copyColIndex = d.oldRange.x + (j % copyColLength);\n const copyColumnProp = columns[copyColIndex].prop;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][prop] = copyRow[copyColumnProp];\n /** Generate mapping object */\n if (!mapping[rowIndex]) {\n mapping[rowIndex] = {};\n }\n mapping[rowIndex][prop] = {\n colIndex: copyColIndex,\n colProp: copyColumnProp,\n rowIndex: oldRowIndex,\n };\n }\n }\n }\n return {\n changed,\n mapping,\n };\n }\n\n getTransformedDataToApply(\n start: Cell,\n data: DataFormat[][],\n ): {\n changed: DataLookup;\n range: RangeArea | null;\n } {\n const changed: DataLookup = {};\n const copyRowLength = data.length;\n const colLength = this.columns.length;\n const rowLength = this.dataStore.get('items').length;\n // rows\n let rowIndex = start.y;\n let maxCol = 0;\n for (\n let i = 0;\n rowIndex < rowLength && i < copyRowLength;\n rowIndex++, i++\n ) {\n // copy original data link\n const copyRow = data[i % copyRowLength];\n const copyColLength = copyRow?.length || 0;\n // columns\n let colIndex = start.x;\n for (\n let j = 0;\n colIndex < colLength && j < copyColLength;\n colIndex++, j++\n ) {\n const p = this.columns[colIndex].prop;\n const currentCol = j % colLength;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][p] = copyRow[currentCol];\n }\n }\n maxCol = Math.max(maxCol, colIndex - 1);\n }\n const range = getRange(start, {\n y: rowIndex - 1,\n x: maxCol,\n });\n return {\n changed,\n range,\n };\n }\n\n getRangeStaticData(d: RangeArea, value: DataFormat): DataLookup {\n const changed: DataLookup = {};\n\n // rows\n for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {\n // columns\n for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {\n // requested column beyond range\n if (!this.columns[colIndex]) {\n continue;\n }\n const p = this.columns[colIndex].prop;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][p] = value;\n }\n }\n }\n return changed;\n }\n\n getRangeTransformedToProps(\n d: RangeArea,\n store: Observable<DSourceState<DataType, DimensionRows>>,\n ) {\n const area: {\n prop: ColumnProp;\n rowIndex: number;\n colIndex: number;\n model: DataType;\n colType: DimensionCols;\n type: DimensionRows;\n }[] = [];\n\n const type = this.dataStore.get('type');\n // rows\n for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {\n // columns\n for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {\n const prop = this.columns[colIndex]?.prop;\n area.push({\n prop,\n rowIndex,\n colIndex,\n model: getSourceItem(store, rowIndex),\n type,\n colType: this.type,\n });\n }\n }\n return area;\n }\n\n copyRangeArray(\n range: RangeArea,\n store: Observable<DSourceState<DataType, DimensionRows>>,\n ) {\n const cols = [...this.columns];\n const props = slice(cols, range.x, range.x1 + 1).map(v => v.prop);\n const toCopy: DataFormat[][] = [];\n const mapping: { [rowIndex: number]: { [colProp: ColumnProp]: any } } = {};\n\n // rows indexes\n for (let i = range.y; i <= range.y1; i++) {\n const rgRow: DataFormat[] = [];\n mapping[i] = {};\n\n // columns indexes\n for (let prop of props) {\n const item = getSourceItem(store, i);\n\n // if no item - skip\n if (!item) {\n continue;\n }\n const val = item[prop];\n rgRow.push(val);\n mapping[i][prop] = val;\n }\n\n toCopy.push(rgRow);\n }\n return {\n data: toCopy,\n mapping,\n };\n }\n\n destroy() {\n this.unsubscribe.forEach(f => f());\n }\n}\n\nexport function getCellData(val?: any) {\n if (typeof val === 'undefined' || val === null) {\n return '';\n }\n return val;\n}\n\n/**\n * Checks if the given rowDrag is a service for dragging rows.\n */\nexport function isRowDragService(\n rowDrag: RowDrag,\n model: ColumnDataSchemaModel,\n): boolean {\n if (typeof rowDrag === 'function') {\n return rowDrag(model);\n }\n return !!rowDrag;\n}\nexport function doPropMerge(existing: CellProps, extra: CellProps) {\n let props: CellProps = { ...extra, ...existing };\n // extend existing props\n if (extra.class) {\n if (typeof extra.class === 'object' && typeof props.class === 'object') {\n props.class = { ...extra.class, ...props.class };\n } else if (\n typeof extra.class === 'string' &&\n typeof props.class === 'object'\n ) {\n props.class[extra.class] = true;\n } else if (typeof props.class === 'string') {\n props.class += ' ' + extra.class;\n }\n }\n if (extra.style) {\n props.style = { ...extra.style, ...props.style };\n }\n return props;\n}\n"],"version":3}
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import { l as createStore, r as reduce_1, k as setStore, h as calculateDimensionData } from './dimension.helpers-56298828.js';
4
+ import { V as createStore, W as reduce_1, v as setStore, h as calculateDimensionData, X as isArray_1 } from './index-f65def08.js';
5
5
  import './toNumber-8de324a7.js';
6
6
  import { h } from './index-a61f225b.js';
7
7
 
@@ -209,6 +209,125 @@ class BasePlugin {
209
209
  }
210
210
  }
211
211
 
212
- export { BasePlugin as B, DimensionStore as D, columnTypes as c, isRowType as i, rowTypes as r };
212
+ function getColumnType(rgCol) {
213
+ if (rgCol.pin) {
214
+ return rgCol.pin;
215
+ }
216
+ return 'rgCol';
217
+ }
218
+ function getColumnSizes(cols) {
219
+ const res = {};
220
+ for (const [i, c] of cols.entries()) {
221
+ if (c.size) {
222
+ res[i] = c.size;
223
+ }
224
+ }
225
+ return res;
226
+ }
227
+ /**
228
+ * Check if column is grouping column
229
+ */
230
+ function isColGrouping(colData) {
231
+ return !!colData.children;
232
+ }
233
+ /**
234
+ * This function is used to create a collection of columns.
235
+ */
236
+ function getColumns(columns, level = 0, types) {
237
+ const collection = {
238
+ // columns as they are in stores per type
239
+ columns: {
240
+ rgCol: [],
241
+ colPinStart: [],
242
+ colPinEnd: [],
243
+ },
244
+ // columns indexed by prop for quick access
245
+ columnByProp: {},
246
+ // column grouping
247
+ columnGrouping: {
248
+ rgCol: [],
249
+ colPinStart: [],
250
+ colPinEnd: [],
251
+ },
252
+ // max depth level for column grouping
253
+ maxLevel: level,
254
+ // sorting
255
+ sort: {},
256
+ };
257
+ return reduce_1(columns, (res, colData) => {
258
+ // Grouped column
259
+ if (isColGrouping(colData)) {
260
+ return gatherGroup(res, colData, getColumns(colData.children, level + 1, types), level);
261
+ }
262
+ // Regular column
263
+ const regularColumn = Object.assign(Object.assign({}, (colData.columnType && types && types[colData.columnType])), colData);
264
+ // Regular column, no Pin
265
+ if (!regularColumn.pin) {
266
+ res.columns.rgCol.push(regularColumn);
267
+ // Pin
268
+ }
269
+ else {
270
+ res.columns[regularColumn.pin].push(regularColumn);
271
+ }
272
+ if (regularColumn.order) {
273
+ res.sort[regularColumn.prop] = regularColumn;
274
+ }
275
+ // it's possible that some columns have same prop, but better to avoid it
276
+ if (!res.columnByProp[regularColumn.prop]) {
277
+ res.columnByProp[regularColumn.prop] = [];
278
+ }
279
+ res.columnByProp[regularColumn.prop].push(regularColumn);
280
+ // trigger setup hook if present
281
+ regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);
282
+ return res;
283
+ }, collection);
284
+ }
285
+ function gatherGroup(res, colData, collection, level = 0) {
286
+ // group template
287
+ const group = Object.assign(Object.assign({}, colData), { level, ids: [] });
288
+ // check columns for update
289
+ for (let k in collection.columns) {
290
+ const key = k;
291
+ const resultItem = res.columns[key];
292
+ const collectionItem = collection.columns[key];
293
+ // if column data
294
+ if (isArray_1(resultItem) && isArray_1(collectionItem)) {
295
+ // fill columns
296
+ resultItem.push(...collectionItem);
297
+ // fill grouping
298
+ if (collectionItem.length) {
299
+ res.columnGrouping[key].push(Object.assign(Object.assign({}, group), { ids: collectionItem.map(item => item.prop) }));
300
+ }
301
+ }
302
+ }
303
+ // merge column groupings
304
+ for (let k in collection.columnGrouping) {
305
+ const key = k;
306
+ const collectionItem = collection.columnGrouping[key];
307
+ res.columnGrouping[key].push(...collectionItem);
308
+ }
309
+ res.maxLevel = Math.max(res.maxLevel, collection.maxLevel);
310
+ res.sort = Object.assign(Object.assign({}, res.sort), collection.sort);
311
+ return res;
312
+ }
313
+ function findColumn(columns, prop) {
314
+ for (const c of columns) {
315
+ if (isColGrouping(c)) {
316
+ const found = findColumn(c.children, prop);
317
+ if (found) {
318
+ return found;
319
+ }
320
+ }
321
+ else if (c.prop === prop) {
322
+ return c;
323
+ }
324
+ }
325
+ return undefined;
326
+ }
327
+ function getColumnByProp(columns, prop) {
328
+ return findColumn(columns, prop);
329
+ }
330
+
331
+ export { BasePlugin as B, DimensionStore as D, getColumnSizes as a, isColGrouping as b, columnTypes as c, getColumns as d, gatherGroup as e, getColumnByProp as f, getColumnType as g, isRowType as i, rowTypes as r };
213
332
 
214
- //# sourceMappingURL=base.plugin-5e7a3c51.js.map
333
+ //# sourceMappingURL=column.utils-78dd3ef2.js.map
@@ -0,0 +1 @@
1
+ {"file":"column.utils-78dd3ef2.js","mappings":";;;;;;;AAAA;;;;AAsBA,MAAM,aAAa,GAAG,CACpB,KAAqB;IAErB,IAAI,WAAW,GAAoC,EAAE,CAAC;IAEtD,MAAM,UAAU,GAAG,CACjB,KAAsC,EACtC,OAA0C;QAE1C,MAAM,OAAO,qBAAyC,KAAK,CAAE,CAAC;QAC9D,WAAW,GAAG,EAAE,CAAC;QACjB,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YAChD,MAAM,CAAC,GAAG,KAA8C,CAAC;YACzD,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE;gBACnB,WAAW,CAAC,CAAC,C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vC,MAAM,GAAG,GAAG,CAAkB,CAAC;QAC/B,MAAM,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QACtD,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;KACjD;IACD,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC3D,GAAG,CAAC,IAAI,mCAAQ,GAAG,CAAC,IAAI,GAAK,UAAU,CAAC,IAAI,CAAE,CAAC;IAC/C,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,UAAU,CACjB,OAAmB,EACnB,IAAgB;IAEhB,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE;YACpB,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC3C,IAAI,KAAK,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;SACF;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE;YAC1B,OAAO,CAAC,CAAC;SACV;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;SAEe,eAAe,CAC7B,OAAmB,EACnB,IAAgB;IAEhB,OAAO,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACnC;;;;","names":["reduce","isArray"],"sources":["src/store/dimension/dimension.store.ts","src/store/index.ts","src/plugins/base.plugin.ts","src/utils/column.utils.ts"],"sourcesContent":["/**\n * Storing pre-calculated\n * Dimension information and sizes\n */\nimport reduce from 'lodash/reduce';\nimport { createStore } from '@stencil/store';\n\nimport { setStore, Observable, PluginSubscribe } from '../../utils/store.utils';\nimport { calculateDimensionData } from './dimension.helpers';\nimport {\n DimensionCalc,\n DimensionSettingsState,\n ViewSettingSizeProp,\n MultiDimensionType,\n} from '@type';\n\nexport type DimensionStoreCollection = {\n [T in MultiDimensionType]: DimensionStore;\n};\n\ntype Item = keyof DimensionSettingsState;\n\nconst trimmedPlugin = (\n store: DimensionStore,\n): PluginSubscribe<DimensionSettingsState> => {\n let trimmedSize: DimensionSettingsState['sizes'] = {};\n\n const setTrimmed = (\n sizes: DimensionSettingsState['sizes'],\n trimmed: DimensionSettingsState['trimmed'],\n ) => {\n const newSize: DimensionSettingsState['sizes'] = { ...sizes };\n trimmedSize = {};\n for (const [index, v] of Object.entries(trimmed)) {\n const i = index as keyof DimensionSettingsState['sizes'];\n if (v && newSize[i]) {\n trimmedSize[i] = newSize[i];\n delete newSize[i];\n }\n }\n store.setDimensionSize(newSize);\n };\n return {\n set(key, val) {\n switch (key) {\n case 'trimmed':\n const trim = val as DimensionSettingsState['trimmed'];\n const sizes = store.store.get('sizes');\n // recover trimmed, apply new trim\n setTrimmed({ ...sizes, ...trimmedSize }, trim);\n break;\n }\n },\n };\n};\n\nconst realSizePlugin = (\n store: DimensionStore,\n): PluginSubscribe<DimensionSettingsState> => {\n return {\n set(k) {\n switch (k) {\n case 'count':\n case 'sizes':\n case 'originItemSize':\n let realSize = 0;\n const count = store.store.get('count');\n for (let i = 0; i < count; i++) {\n realSize +=\n store.store.get('sizes')[i] || store.store.get('originItemSize');\n }\n store.setStore({ realSize });\n }\n },\n };\n};\n\nfunction initialBase(): DimensionCalc {\n return {\n indexes: [],\n count: 0,\n\n // plugin support\n trimmed: {},\n\n // size operations, this provider stores only changed sizes, not all of them\n // same as indexes but for sizes and positions\n // item index to size\n sizes: {},\n // order in indexes[] to coordinate\n positionIndexToItem: {},\n // initial element to coordinate ^\n indexToItem: {},\n positionIndexes: [],\n };\n}\n\nfunction initialState(): DimensionSettingsState {\n return {\n ...initialBase(),\n // size which all items can take\n realSize: 0,\n\n // initial item size if it wasn't changed\n originItemSize: 0,\n };\n}\n\nexport class DimensionStore {\n readonly store: Observable<DimensionSettingsState>;\n constructor() {\n this.store = createStore(initialState());\n this.store.use(trimmedPlugin(this));\n this.store.use(realSizePlugin(this));\n }\n\n getCurrentState(): DimensionSettingsState {\n const state = initialState();\n const keys = Object.keys(state);\n return reduce(\n keys,\n (r: DimensionSettingsState, k: Item) => {\n const data = this.store.get(k);\n r[k] = data as never;\n return r;\n },\n state,\n );\n }\n\n dispose() {\n setStore(this.store, initialState());\n }\n\n setStore<T extends Record<string, any>>(data: Partial<T>) {\n setStore(this.store, data);\n }\n\n drop() {\n setStore(this.store, initialBase());\n }\n\n /**\n * Set custom dimension sizes and overwrite old\n * Generates new indexes based on sizes\n * @param sizes - sizes to set\n */\n setDimensionSize(sizes: ViewSettingSizeProp) {\n const dimensionData = calculateDimensionData(\n this.store.get('originItemSize'),\n sizes,\n );\n setStore(this.store, dimensionData);\n }\n}\n","import type { DimensionCols, DimensionRows } from '@type';\n\nexport * from './dataSource';\nexport * from './dimension';\nexport * from './selection';\nexport * from './vp';\n\nexport const rowTypes: DimensionRows[] = ['rowPinStart', 'rgRow', 'rowPinEnd'];\nexport const columnTypes: DimensionCols[] = [\n 'colPinStart',\n 'rgCol',\n 'colPinEnd',\n];\n\nexport function isRowType(type: DimensionRows | any): type is DimensionRows {\n return rowTypes.indexOf(type) > -1;\n}\n","import { h } from '@stencil/core';\nimport { PluginProviders, PluginBaseComponent } from '..';\n\ntype WatchConfig = { immediate: boolean };\n\n/**\n * Base layer for plugins\n * Provide minimal starting core for plugins to work\n * Extend this class to create plugin\n */\nexport class BasePlugin implements PluginBaseComponent {\n readonly h = h;\n readonly subscriptions: Record<string, (...args: any[]) => void> = {};\n constructor(public revogrid: HTMLRevoGridElement, public providers: PluginProviders) {}\n /**\n *\n * @param eventName - event name to subscribe to in revo-grid component (e.g. 'beforeheaderclick')\n * @param callback - callback function for event\n */\n addEventListener<T = any>(\n eventName: string,\n callback: (e: CustomEvent<T>) => void,\n ) {\n this.revogrid.addEventListener(eventName, callback);\n this.subscriptions[eventName] = callback;\n }\n\n /**\n * Subscribe to property change in revo-grid component\n * You can return false in callback to prevent default value set\n *\n * @param prop - property name\n * @param callback - callback function\n * @param immediate - trigger callback immediately with current value\n */\n watch<T extends any>(\n prop: string,\n callback: (arg: T) => boolean | void,\n { immediate }: Partial<WatchConfig> = { immediate: false },\n ) {\n const nativeValueDesc =\n Object.getOwnPropertyDescriptor(this.revogrid, prop) ||\n Object.getOwnPropertyDescriptor(this.revogrid.constructor.prototype, prop);\n\n // Overwrite property descriptor for this instance\n Object.defineProperty(this.revogrid, prop, {\n set(val: T) {\n const keepDefault = callback(val);\n if (keepDefault === false) {\n return;\n }\n // Continue with native behavior\n return nativeValueDesc?.set?.call(this, val);\n },\n get() {\n // Continue with native behavior\n return nativeValueDesc?.get?.call(this);\n },\n });\n if (immediate) {\n callback(nativeValueDesc?.value);\n }\n }\n\n /**\n * Remove event listener\n * @param eventName\n */\n removeEventListener(eventName: string) {\n this.revogrid.removeEventListener(eventName, this.subscriptions[eventName]);\n delete this.subscriptions[eventName];\n }\n\n /**\n * Emit event from revo-grid component\n * Event can be cancelled by calling event.preventDefault() in callback\n */\n emit<T = any>(eventName: string, detail?: T) {\n const event = new CustomEvent<T>(eventName, { detail, cancelable: true });\n this.revogrid.dispatchEvent(event);\n return event;\n }\n\n /**\n * Clear all subscriptions\n */\n clearSubscriptions() {\n for (let type in this.subscriptions) {\n this.removeEventListener(type);\n }\n }\n\n /**\n * Destroy plugin and clear all subscriptions\n */\n destroy() {\n this.clearSubscriptions();\n }\n}\n\nexport type GridPlugin = (typeof BasePlugin);\n","import isArray from 'lodash/isArray';\nimport reduce from 'lodash/reduce';\n\nimport {\n ColumnData,\n ColumnGrouping,\n ColumnProp,\n ColumnRegular,\n ColumnTypes,\n DimensionCols,\n ViewSettingSizeProp,\n} from '@type';\nimport { Group as StoreGroup } from '@store';\n\nexport type ColumnItems = Record<DimensionCols, ColumnRegular[]>;\nexport interface ColumnGroup extends StoreGroup {\n level: number;\n}\nexport type ColumnGroupingCollection = Record<DimensionCols, ColumnGroup[]>;\n\n/**\n * Column collection definition.\n * Used to access indexed data for columns.\n * Can be accessed via different events.\n */\nexport type ColumnCollection = {\n /**\n * Columns as they are in stores\n */\n columns: Record<DimensionCols, ColumnRegular[]>;\n /**\n * Columns indexed by prop for quick access, it's possible to have multiple columns with same prop but not recommended\n */\n columnByProp: Record<ColumnProp, ColumnRegular[]>;\n /**\n * Grouped columns\n */\n columnGrouping: ColumnGroupingCollection;\n /**\n * Max level of grouping\n */\n maxLevel: number;\n /**\n * Sorting\n */\n sort: Record<ColumnProp, ColumnRegular>;\n};\n\nexport function getColumnType(rgCol: ColumnRegular): DimensionCols {\n if (rgCol.pin) {\n return rgCol.pin;\n }\n return 'rgCol';\n}\n\nexport function getColumnSizes(cols: ColumnRegular[]): ViewSettingSizeProp {\n const res: ViewSettingSizeProp = {};\n for (const [i, c] of cols.entries()) {\n if (c.size) {\n res[i] = c.size;\n }\n }\n return res;\n}\n\n\n/**\n * Check if column is grouping column\n */\nexport function isColGrouping(\n colData: ColumnGrouping | ColumnRegular,\n): colData is ColumnGrouping {\n return !!(colData as ColumnGrouping).children;\n}\n\n/**\n * This function is used to create a collection of columns.\n */\nexport function getColumns(\n columns: ColumnData,\n level = 0,\n types?: ColumnTypes,\n): ColumnCollection {\n const collection: ColumnCollection = {\n // columns as they are in stores per type\n columns: {\n rgCol: [],\n colPinStart: [],\n colPinEnd: [],\n },\n // columns indexed by prop for quick access\n columnByProp: {},\n // column grouping\n columnGrouping: {\n rgCol: [],\n colPinStart: [],\n colPinEnd: [],\n },\n // max depth level for column grouping\n maxLevel: level,\n // sorting\n sort: {},\n };\n\n return reduce(\n columns,\n (res: ColumnCollection, colData: ColumnGrouping | ColumnRegular) => {\n // Grouped column\n if (isColGrouping(colData)) {\n return gatherGroup(\n res,\n colData,\n getColumns(colData.children, level + 1, types),\n level,\n );\n }\n // Regular column\n const regularColumn = {\n ...(colData.columnType && types && types[colData.columnType]),\n ...colData,\n };\n // Regular column, no Pin\n if (!regularColumn.pin) {\n res.columns.rgCol.push(regularColumn);\n // Pin\n } else {\n res.columns[regularColumn.pin].push(regularColumn);\n }\n if (regularColumn.order) {\n res.sort[regularColumn.prop] = regularColumn;\n }\n // it's possible that some columns have same prop, but better to avoid it\n if (!res.columnByProp[regularColumn.prop]) {\n res.columnByProp[regularColumn.prop] = [];\n }\n res.columnByProp[regularColumn.prop].push(regularColumn);\n\n // trigger setup hook if present\n regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);\n return res;\n },\n collection,\n );\n}\n\nexport function gatherGroup<T extends ColumnCollection>(\n res: T,\n colData: ColumnGrouping,\n collection: T,\n level = 0,\n): T {\n // group template\n const group: ColumnGroup = {\n ...colData,\n level,\n ids: [],\n };\n\n // check columns for update\n for (let k in collection.columns) {\n const key = k as keyof ColumnCollection['columns'];\n const resultItem = res.columns[key];\n const collectionItem = collection.columns[key];\n\n // if column data\n if (isArray(resultItem) && isArray(collectionItem)) {\n // fill columns\n resultItem.push(...collectionItem);\n\n // fill grouping\n if (collectionItem.length) {\n res.columnGrouping[key].push({\n ...group,\n ids: collectionItem.map(item => item.prop),\n });\n }\n }\n }\n // merge column groupings\n for (let k in collection.columnGrouping) {\n const key = k as DimensionCols;\n const collectionItem = collection.columnGrouping[key];\n res.columnGrouping[key].push(...collectionItem);\n }\n res.maxLevel = Math.max(res.maxLevel, collection.maxLevel);\n res.sort = { ...res.sort, ...collection.sort };\n return res;\n}\n\nfunction findColumn(\n columns: ColumnData,\n prop: ColumnProp,\n): ColumnRegular | undefined {\n for (const c of columns) {\n if (isColGrouping(c)) {\n const found = findColumn(c.children, prop);\n if (found) {\n return found;\n }\n } else if (c.prop === prop) {\n return c;\n }\n }\n return undefined;\n}\n\nexport function getColumnByProp(\n columns: ColumnData,\n prop: ColumnProp,\n): ColumnRegular | undefined {\n return findColumn(columns, prop);\n}\n"],"version":3}
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * Built by Revolist OU ❤️
3
+ */
4
+ import { L as EDIT_INPUT_WR } from './index-f65def08.js';
5
+
6
+ // is edit input
7
+ function isEditInput(el) {
8
+ return !!(el === null || el === void 0 ? void 0 : el.closest(`.${EDIT_INPUT_WR}`));
9
+ }
10
+ // Type guard for EditorCtrConstructible
11
+ function isEditorCtrConstructible(editor) {
12
+ return typeof editor === 'function' && typeof editor.prototype === 'object';
13
+ }
14
+
15
+ export { isEditorCtrConstructible as a, isEditInput as i };
16
+
17
+ //# sourceMappingURL=edit.utils-ca303802.js.map