@universal-ember/table 3.6.0 → 3.6.1

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 (224) hide show
  1. package/package.json +1 -1
  2. package/src/plugins/column-reordering/plugin.ts +4 -6
  3. package/declarations/-private/-type-tests/plugin-properties.test.d.ts +0 -2
  4. package/declarations/-private/-type-tests/plugin-properties.test.d.ts.map +0 -1
  5. package/declarations/-private/-type-tests/plugin-with.test.d.ts +0 -2
  6. package/declarations/-private/-type-tests/plugin-with.test.d.ts.map +0 -1
  7. package/declarations/-private/-type-tests/plugins-accessors.test.d.ts +0 -2
  8. package/declarations/-private/-type-tests/plugins-accessors.test.d.ts.map +0 -1
  9. package/declarations/-private/-type-tests/plugins-signature-from.test.d.ts +0 -2
  10. package/declarations/-private/-type-tests/plugins-signature-from.test.d.ts.map +0 -1
  11. package/declarations/-private/-type-tests/plugins-signature-utils.test.d.ts +0 -2
  12. package/declarations/-private/-type-tests/plugins-signature-utils.test.d.ts.map +0 -1
  13. package/declarations/-private/-type-tests/table-api.test.d.ts +0 -2
  14. package/declarations/-private/-type-tests/table-api.test.d.ts.map +0 -1
  15. package/declarations/-private/-type-tests/table-config.test.d.ts +0 -2
  16. package/declarations/-private/-type-tests/table-config.test.d.ts.map +0 -1
  17. package/declarations/-private/column.d.ts +0 -18
  18. package/declarations/-private/column.d.ts.map +0 -1
  19. package/declarations/-private/ember-compat.d.ts +0 -8
  20. package/declarations/-private/ember-compat.d.ts.map +0 -1
  21. package/declarations/-private/interfaces/column.d.ts +0 -63
  22. package/declarations/-private/interfaces/column.d.ts.map +0 -1
  23. package/declarations/-private/interfaces/index.d.ts +0 -8
  24. package/declarations/-private/interfaces/index.d.ts.map +0 -1
  25. package/declarations/-private/interfaces/modifier.d.ts +0 -7
  26. package/declarations/-private/interfaces/modifier.d.ts.map +0 -1
  27. package/declarations/-private/interfaces/pagination.d.ts +0 -17
  28. package/declarations/-private/interfaces/pagination.d.ts.map +0 -1
  29. package/declarations/-private/interfaces/plugins.d.ts +0 -315
  30. package/declarations/-private/interfaces/plugins.d.ts.map +0 -1
  31. package/declarations/-private/interfaces/preferences.d.ts +0 -74
  32. package/declarations/-private/interfaces/preferences.d.ts.map +0 -1
  33. package/declarations/-private/interfaces/selection.d.ts +0 -36
  34. package/declarations/-private/interfaces/selection.d.ts.map +0 -1
  35. package/declarations/-private/interfaces/table.d.ts +0 -127
  36. package/declarations/-private/interfaces/table.d.ts.map +0 -1
  37. package/declarations/-private/js-helper.d.ts +0 -39
  38. package/declarations/-private/js-helper.d.ts.map +0 -1
  39. package/declarations/-private/preferences.d.ts +0 -47
  40. package/declarations/-private/preferences.d.ts.map +0 -1
  41. package/declarations/-private/private-types.d.ts +0 -6
  42. package/declarations/-private/private-types.d.ts.map +0 -1
  43. package/declarations/-private/row.d.ts +0 -12
  44. package/declarations/-private/row.d.ts.map +0 -1
  45. package/declarations/-private/table.d.ts +0 -136
  46. package/declarations/-private/table.d.ts.map +0 -1
  47. package/declarations/-private/utils.d.ts +0 -3
  48. package/declarations/-private/utils.d.ts.map +0 -1
  49. package/declarations/index.d.ts +0 -14
  50. package/declarations/index.d.ts.map +0 -1
  51. package/declarations/plugins/-private/base.d.ts +0 -281
  52. package/declarations/plugins/-private/base.d.ts.map +0 -1
  53. package/declarations/plugins/-private/utils.d.ts +0 -22
  54. package/declarations/plugins/-private/utils.d.ts.map +0 -1
  55. package/declarations/plugins/column-reordering/helpers.d.ts +0 -54
  56. package/declarations/plugins/column-reordering/helpers.d.ts.map +0 -1
  57. package/declarations/plugins/column-reordering/index.d.ts +0 -5
  58. package/declarations/plugins/column-reordering/index.d.ts.map +0 -1
  59. package/declarations/plugins/column-reordering/plugin.d.ts +0 -196
  60. package/declarations/plugins/column-reordering/plugin.d.ts.map +0 -1
  61. package/declarations/plugins/column-reordering/utils.d.ts +0 -8
  62. package/declarations/plugins/column-reordering/utils.d.ts.map +0 -1
  63. package/declarations/plugins/column-resizing/handle.d.ts +0 -128
  64. package/declarations/plugins/column-resizing/handle.d.ts.map +0 -1
  65. package/declarations/plugins/column-resizing/helpers.d.ts +0 -40
  66. package/declarations/plugins/column-resizing/helpers.d.ts.map +0 -1
  67. package/declarations/plugins/column-resizing/index.d.ts +0 -6
  68. package/declarations/plugins/column-resizing/index.d.ts.map +0 -1
  69. package/declarations/plugins/column-resizing/plugin.d.ts +0 -172
  70. package/declarations/plugins/column-resizing/plugin.d.ts.map +0 -1
  71. package/declarations/plugins/column-resizing/resize-observer.d.ts +0 -14
  72. package/declarations/plugins/column-resizing/resize-observer.d.ts.map +0 -1
  73. package/declarations/plugins/column-resizing/utils.d.ts +0 -22
  74. package/declarations/plugins/column-resizing/utils.d.ts.map +0 -1
  75. package/declarations/plugins/column-visibility/helpers.d.ts +0 -18
  76. package/declarations/plugins/column-visibility/helpers.d.ts.map +0 -1
  77. package/declarations/plugins/column-visibility/index.d.ts +0 -5
  78. package/declarations/plugins/column-visibility/index.d.ts.map +0 -1
  79. package/declarations/plugins/column-visibility/plugin.d.ts +0 -64
  80. package/declarations/plugins/column-visibility/plugin.d.ts.map +0 -1
  81. package/declarations/plugins/data-sorting/helpers.d.ts +0 -38
  82. package/declarations/plugins/data-sorting/helpers.d.ts.map +0 -1
  83. package/declarations/plugins/data-sorting/index.d.ts +0 -7
  84. package/declarations/plugins/data-sorting/index.d.ts.map +0 -1
  85. package/declarations/plugins/data-sorting/plugin.d.ts +0 -102
  86. package/declarations/plugins/data-sorting/plugin.d.ts.map +0 -1
  87. package/declarations/plugins/data-sorting/types.d.ts +0 -23
  88. package/declarations/plugins/data-sorting/types.d.ts.map +0 -1
  89. package/declarations/plugins/index.d.ts +0 -6
  90. package/declarations/plugins/index.d.ts.map +0 -1
  91. package/declarations/plugins/metadata/helpers.d.ts +0 -4
  92. package/declarations/plugins/metadata/helpers.d.ts.map +0 -1
  93. package/declarations/plugins/metadata/index.d.ts +0 -5
  94. package/declarations/plugins/metadata/index.d.ts.map +0 -1
  95. package/declarations/plugins/metadata/plugin.d.ts +0 -25
  96. package/declarations/plugins/metadata/plugin.d.ts.map +0 -1
  97. package/declarations/plugins/row-selection/helpers.d.ts +0 -6
  98. package/declarations/plugins/row-selection/helpers.d.ts.map +0 -1
  99. package/declarations/plugins/row-selection/index.d.ts +0 -5
  100. package/declarations/plugins/row-selection/index.d.ts.map +0 -1
  101. package/declarations/plugins/row-selection/plugin.d.ts +0 -80
  102. package/declarations/plugins/row-selection/plugin.d.ts.map +0 -1
  103. package/declarations/plugins/sticky-columns/helpers.d.ts +0 -17
  104. package/declarations/plugins/sticky-columns/helpers.d.ts.map +0 -1
  105. package/declarations/plugins/sticky-columns/index.d.ts +0 -5
  106. package/declarations/plugins/sticky-columns/index.d.ts.map +0 -1
  107. package/declarations/plugins/sticky-columns/plugin.d.ts +0 -70
  108. package/declarations/plugins/sticky-columns/plugin.d.ts.map +0 -1
  109. package/declarations/test-support/index.d.ts +0 -15
  110. package/declarations/test-support/index.d.ts.map +0 -1
  111. package/declarations/utils.d.ts +0 -26
  112. package/declarations/utils.d.ts.map +0 -1
  113. package/dist/-private/-type-tests/plugin-properties.test.js +0 -27
  114. package/dist/-private/-type-tests/plugin-properties.test.js.map +0 -1
  115. package/dist/-private/-type-tests/plugin-with.test.js +0 -20
  116. package/dist/-private/-type-tests/plugin-with.test.js.map +0 -1
  117. package/dist/-private/-type-tests/plugins-accessors.test.js +0 -36
  118. package/dist/-private/-type-tests/plugins-accessors.test.js.map +0 -1
  119. package/dist/-private/-type-tests/plugins-signature-from.test.js +0 -15
  120. package/dist/-private/-type-tests/plugins-signature-from.test.js.map +0 -1
  121. package/dist/-private/-type-tests/plugins-signature-utils.test.js +0 -36
  122. package/dist/-private/-type-tests/plugins-signature-utils.test.js.map +0 -1
  123. package/dist/-private/-type-tests/table-api.test.js +0 -17
  124. package/dist/-private/-type-tests/table-api.test.js.map +0 -1
  125. package/dist/-private/-type-tests/table-config.test.js +0 -55
  126. package/dist/-private/-type-tests/table-config.test.js.map +0 -1
  127. package/dist/-private/column.js +0 -62
  128. package/dist/-private/column.js.map +0 -1
  129. package/dist/-private/ember-compat.js +0 -17
  130. package/dist/-private/ember-compat.js.map +0 -1
  131. package/dist/-private/interfaces/column.js +0 -2
  132. package/dist/-private/interfaces/column.js.map +0 -1
  133. package/dist/-private/interfaces/index.js +0 -2
  134. package/dist/-private/interfaces/index.js.map +0 -1
  135. package/dist/-private/interfaces/modifier.js +0 -2
  136. package/dist/-private/interfaces/modifier.js.map +0 -1
  137. package/dist/-private/interfaces/pagination.js +0 -2
  138. package/dist/-private/interfaces/pagination.js.map +0 -1
  139. package/dist/-private/interfaces/plugins.js +0 -2
  140. package/dist/-private/interfaces/plugins.js.map +0 -1
  141. package/dist/-private/interfaces/preferences.js +0 -2
  142. package/dist/-private/interfaces/preferences.js.map +0 -1
  143. package/dist/-private/interfaces/selection.js +0 -2
  144. package/dist/-private/interfaces/selection.js.map +0 -1
  145. package/dist/-private/interfaces/table.js +0 -2
  146. package/dist/-private/interfaces/table.js.map +0 -1
  147. package/dist/-private/js-helper.js +0 -55
  148. package/dist/-private/js-helper.js.map +0 -1
  149. package/dist/-private/preferences.js +0 -149
  150. package/dist/-private/preferences.js.map +0 -1
  151. package/dist/-private/private-types.js +0 -2
  152. package/dist/-private/private-types.js.map +0 -1
  153. package/dist/-private/row.js +0 -51
  154. package/dist/-private/row.js.map +0 -1
  155. package/dist/-private/table.js +0 -276
  156. package/dist/-private/table.js.map +0 -1
  157. package/dist/-private/utils.js +0 -15
  158. package/dist/-private/utils.js.map +0 -1
  159. package/dist/_rollupPluginBabelHelpers-CjaRjJZX.js +0 -63
  160. package/dist/_rollupPluginBabelHelpers-CjaRjJZX.js.map +0 -1
  161. package/dist/index.js +0 -4
  162. package/dist/index.js.map +0 -1
  163. package/dist/plugins/-private/base.js +0 -532
  164. package/dist/plugins/-private/base.js.map +0 -1
  165. package/dist/plugins/-private/utils.js +0 -103
  166. package/dist/plugins/-private/utils.js.map +0 -1
  167. package/dist/plugins/column-reordering/helpers.js +0 -81
  168. package/dist/plugins/column-reordering/helpers.js.map +0 -1
  169. package/dist/plugins/column-reordering/index.js +0 -3
  170. package/dist/plugins/column-reordering/index.js.map +0 -1
  171. package/dist/plugins/column-reordering/plugin.js +0 -453
  172. package/dist/plugins/column-reordering/plugin.js.map +0 -1
  173. package/dist/plugins/column-reordering/utils.js +0 -34
  174. package/dist/plugins/column-reordering/utils.js.map +0 -1
  175. package/dist/plugins/column-resizing/handle.js +0 -243
  176. package/dist/plugins/column-resizing/handle.js.map +0 -1
  177. package/dist/plugins/column-resizing/helpers.js +0 -77
  178. package/dist/plugins/column-resizing/helpers.js.map +0 -1
  179. package/dist/plugins/column-resizing/index.js +0 -4
  180. package/dist/plugins/column-resizing/index.js.map +0 -1
  181. package/dist/plugins/column-resizing/plugin.js +0 -365
  182. package/dist/plugins/column-resizing/plugin.js.map +0 -1
  183. package/dist/plugins/column-resizing/resize-observer.js +0 -44
  184. package/dist/plugins/column-resizing/resize-observer.js.map +0 -1
  185. package/dist/plugins/column-resizing/utils.js +0 -44
  186. package/dist/plugins/column-resizing/utils.js.map +0 -1
  187. package/dist/plugins/column-visibility/helpers.js +0 -25
  188. package/dist/plugins/column-visibility/helpers.js.map +0 -1
  189. package/dist/plugins/column-visibility/index.js +0 -3
  190. package/dist/plugins/column-visibility/index.js.map +0 -1
  191. package/dist/plugins/column-visibility/plugin.js +0 -92
  192. package/dist/plugins/column-visibility/plugin.js.map +0 -1
  193. package/dist/plugins/data-sorting/helpers.js +0 -49
  194. package/dist/plugins/data-sorting/helpers.js.map +0 -1
  195. package/dist/plugins/data-sorting/index.js +0 -4
  196. package/dist/plugins/data-sorting/index.js.map +0 -1
  197. package/dist/plugins/data-sorting/plugin.js +0 -132
  198. package/dist/plugins/data-sorting/plugin.js.map +0 -1
  199. package/dist/plugins/data-sorting/types.js +0 -14
  200. package/dist/plugins/data-sorting/types.js.map +0 -1
  201. package/dist/plugins/index.js +0 -3
  202. package/dist/plugins/index.js.map +0 -1
  203. package/dist/plugins/metadata/helpers.js +0 -12
  204. package/dist/plugins/metadata/helpers.js.map +0 -1
  205. package/dist/plugins/metadata/index.js +0 -3
  206. package/dist/plugins/metadata/index.js.map +0 -1
  207. package/dist/plugins/metadata/plugin.js +0 -25
  208. package/dist/plugins/metadata/plugin.js.map +0 -1
  209. package/dist/plugins/row-selection/helpers.js +0 -10
  210. package/dist/plugins/row-selection/helpers.js.map +0 -1
  211. package/dist/plugins/row-selection/index.js +0 -3
  212. package/dist/plugins/row-selection/index.js.map +0 -1
  213. package/dist/plugins/row-selection/plugin.js +0 -118
  214. package/dist/plugins/row-selection/plugin.js.map +0 -1
  215. package/dist/plugins/sticky-columns/helpers.js +0 -49
  216. package/dist/plugins/sticky-columns/helpers.js.map +0 -1
  217. package/dist/plugins/sticky-columns/index.js +0 -3
  218. package/dist/plugins/sticky-columns/index.js.map +0 -1
  219. package/dist/plugins/sticky-columns/plugin.js +0 -139
  220. package/dist/plugins/sticky-columns/plugin.js.map +0 -1
  221. package/dist/test-support/index.js +0 -62
  222. package/dist/test-support/index.js.map +0 -1
  223. package/dist/utils.js +0 -77
  224. package/dist/utils.js.map +0 -1
@@ -1,281 +0,0 @@
1
- import type { Table } from '../../-private/table.ts';
2
- import type { ColumnReordering } from '../column-reordering';
3
- import type { ColumnVisibility } from '../column-visibility';
4
- import type { Class, Constructor } from '../../-private/private-types.ts';
5
- import type { Column, Row } from '../../index.ts';
6
- import type { ColumnMetaFor, ColumnOptionsFor, OptionsFor, Plugin, RowMetaFor, TableMetaFor } from '../../-private/interfaces';
7
- type InstanceOf<T> = T extends Class<infer Instance> ? Instance : T;
8
- /**
9
- * @public
10
- *
11
- * list of interfaces by feature name that consumers may provide alternative
12
- * implementation for
13
- */
14
- export interface TableFeatures extends Record<string, unknown | undefined> {
15
- /**
16
- * @public
17
- *
18
- * interface for the table meta of a "column visibility plugin"
19
- */
20
- columnVisibility: InstanceOf<ColumnVisibility['meta']['table']>;
21
- /**
22
- * @public
23
- *
24
- * interface for the table meta of a "column order plugin"
25
- */
26
- columnOrder: InstanceOf<ColumnReordering['meta']['table']>;
27
- }
28
- /**
29
- * @public
30
- *
31
- * list of interfaces by feature name that consumers may provide alternative
32
- * implementation for
33
- */
34
- export interface ColumnFeatures extends Record<string, unknown | undefined> {
35
- /**
36
- * @public
37
- *
38
- * interface for the column meta of a "column visibility plugin"
39
- */
40
- columnVisibility: InstanceOf<ColumnVisibility['meta']['column']>;
41
- /**
42
- * @public
43
- *
44
- * interface for the column meta of a "column order plugin"
45
- */
46
- columnOrder: InstanceOf<ColumnReordering['meta']['column']>;
47
- }
48
- /**
49
- * @private utility type
50
- *
51
- */
52
- export type SignatureFrom<Klass extends BasePlugin<any>> = Klass extends BasePlugin<infer Signature> ? Signature : never;
53
- declare const __Signature__: unique symbol;
54
- /**
55
- * @public
56
- *
57
- * If your table plugin is a class, you may extend from BasePlugin, which provides
58
- * small utility methods and properties for getting the metadata for your plugin
59
- * for the table and each column
60
- *
61
- * One instance of a plugin exists per table
62
- */
63
- export declare abstract class BasePlugin<Signature = unknown> implements Plugin<Signature> {
64
- protected table: Table;
65
- constructor(table: Table);
66
- /**
67
- * @private (secret)
68
- *
69
- * Because classes are kind of like interfaces,
70
- * we need "something" to help TS know what a Resource is.
71
- *
72
- * This isn't a real API, but does help with type inference
73
- * with the SignatureFrom utility above
74
- */
75
- [__Signature__]: Signature;
76
- /**
77
- * Helper for specifying plugins on `headlessTable` with the plugin-level options
78
- */
79
- static with<T extends BasePlugin<any>>(this: Constructor<T>, configFn: () => OptionsFor<SignatureFrom<T>>): [Constructor<T>, () => OptionsFor<SignatureFrom<T>>];
80
- /**
81
- * Helper for specifying column-level configurations for a plugin on `headlessTable`'s
82
- * columns option
83
- */
84
- static forColumn<T extends BasePlugin<any>>(this: Constructor<T>, configFn: () => ColumnOptionsFor<SignatureFrom<T>>): [Constructor<T>, () => ColumnOptionsFor<SignatureFrom<T>>];
85
- meta?: {
86
- column?: Constructor<ColumnMetaFor<Signature>>;
87
- table?: Constructor<TableMetaFor<Signature>>;
88
- row?: Constructor<RowMetaFor<Signature>>;
89
- };
90
- abstract name: string;
91
- static features?: string[];
92
- static requires?: string[];
93
- }
94
- /**
95
- * @public
96
- *
97
- * returns boolean if the passed table has an instance of the configured passed plugin class.
98
- * This can be used to help guard against accessing public-specific APIs if those plugins
99
- * are not configured for a particular table instance
100
- */
101
- export declare function hasPlugin<P extends BasePlugin<any>, Data = unknown>(table: Table<Data>, klass: Class<P>): boolean;
102
- export declare const preferences: {
103
- /**
104
- * @public
105
- *
106
- * returns an object for getting and setting preferences data
107
- * based on the column (scoped to key)
108
- *
109
- * Only the provided plugin will have access to these preferences
110
- * (though, if other plugins can guess how the underlying plugin access
111
- * works, they can access this data, too. No security guaranteed)
112
- */
113
- forColumn<P extends BasePlugin<any>, Data = unknown>(column: Column<Data>, klass: Class<P>): {
114
- /**
115
- * delete an entry on the underlying `Map` used for this column-plugin pair
116
- */
117
- delete(key: string): void | undefined;
118
- /**
119
- * get an entry on the underlying `Map` used for this column-plugin pair
120
- */
121
- get(key: string): unknown;
122
- /**
123
- * set an entry on the underlying `Map` used for this column-plugin pair
124
- */
125
- set(key: string, value: unknown): void;
126
- };
127
- /**
128
- * @public
129
- *
130
- * returns an object for bulk updating preferences data
131
- * for all columns (scoped to key and table)
132
- */
133
- forAllColumns<P extends BasePlugin<any>, Data = unknown>(table: Table<Data>, klass: Class<P>): {
134
- /**
135
- * delete an entry on every column in the underlying column `Map` for this table-plugin pair
136
- */
137
- delete(key: string): void | undefined;
138
- };
139
- /**
140
- * @public
141
- *
142
- * returns an object for getting and setting preferences data
143
- * based on the table (scoped to the key: "table")
144
- *
145
- * Only the provided plugin will have access to these preferences
146
- * (though, if other plugins can guess how the underlying plugin access
147
- * works, they can access this data, too. No security guaranteed)
148
- */
149
- forTable<P extends BasePlugin<any>, Data = unknown>(table: Table<Data>, klass: Class<P>): {
150
- /**
151
- * delete an entry on the underlying `Map` used for this table-plugin pair
152
- */
153
- delete(key: string): void | undefined;
154
- /**
155
- * get an entry on the underlying `Map` used for this table-plugin pair
156
- */
157
- get(key: string): unknown;
158
- /**
159
- * set an entry on the underlying `Map` used for this table-plugin pair
160
- */
161
- set(key: string, value: unknown): void | undefined;
162
- };
163
- };
164
- /**
165
- * if a `requester` is not provided,
166
- * Get the columns for the table, considering any and all plugins that could modify columns.
167
- *
168
- * If you are an end-consumer of @universal-ember/table, this is the function to use.
169
- * If you are a plugin-author, you'll want to pass your plugin class as the second parameter.
170
- *
171
- * For a given plugin, `requester`, determine what columns should be returned.
172
- * Since multiple plugins could be used in a table, there is an implicit hierarchy of
173
- * column modifications that can occur from each of those plugins.
174
- *
175
- * If a plugin defines other plugins as either *requirements* or *optional requirements*,
176
- * and that upstream plugin defines a `columns` property, then those columns will be returned here.
177
- *
178
- * This works recursively up the plugin tree up until a plugin has no requirements, and then
179
- * all columns from the table are returned.
180
- */
181
- declare function columnsFor<DataType = any>(table: Table<DataType>, requester?: Plugin<any>): Column<DataType>[];
182
- export declare const columns: {
183
- for: typeof columnsFor;
184
- /**
185
- * for a given current or reference column, return the column that
186
- * is immediately next, or to the right of that column.
187
- *
188
- * If a plugin class is provided, the hierarchy of column list modifications
189
- * will be respected.
190
- */
191
- next: <Data = unknown>(current: Column<Data>, requester?: Plugin<any>) => Column<Data> | undefined;
192
- /**
193
- * for a given current or reference column, return the column that
194
- * is immediately previous, or to the left of that column.
195
- *
196
- * If a plugin class is provided, the hierarchy of column list modifications
197
- * will be respected.
198
- */
199
- previous: <Data = unknown>(current: Column<Data>, requester?: Plugin<any>) => Column<Data> | undefined;
200
- /**
201
- * for a given current or reference column, return the columns that
202
- * should appear before, or to the left of that column.
203
- *
204
- * if a plugin class is provided, the hierarchy of column list modifications
205
- * will be respected.
206
- */
207
- before: <Data = unknown>(current: Column<Data>, requester?: Plugin<any>) => Column<Data>[];
208
- /**
209
- * for a given current or reference column, return the columns that
210
- * should appear after, or to the right of that column.
211
- *
212
- * if a plugin class is provided, the hierarchy of column list modifications
213
- * will be respected.
214
- */
215
- after: <Data = unknown>(current: Column<Data>, requester?: Plugin<any>) => Column<Data>[];
216
- };
217
- export declare const meta: {
218
- /**
219
- * @public
220
- *
221
- * For a given column and plugin, return the meta / state bucket for the
222
- * plugin<->column instance pair.
223
- *
224
- * Note that this requires the column instance to exist on the table.
225
- */
226
- forColumn<P extends BasePlugin<any>, Data = unknown>(column: Column<Data>, klass: Class<P>): ColumnMetaFor<SignatureFrom<P>>;
227
- /**
228
- * @public
229
- *
230
- * For a given row and plugin, return the meta / state bucket for the
231
- * plugin<->row instance pair.
232
- *
233
- * Note that this requires the row instance to exist on the table.
234
- */
235
- forRow<P extends BasePlugin<any>, Data = unknown>(row: Row<Data>, klass: Class<P>): RowMetaFor<SignatureFrom<P>>;
236
- /**
237
- * @public
238
- *
239
- * For a given table and plugin, return the meta / state bucket for the
240
- * plugin<->table instance pair.
241
- */
242
- forTable<P extends BasePlugin<any>, Data = unknown>(table: Table<Data>, klass: Class<P>): TableMetaFor<SignatureFrom<P>>;
243
- /**
244
- * Instead of finding meta based on column or table instances,
245
- * you can search for meta based on feature strings, such as `columnWidth`
246
- */
247
- withFeature: {
248
- /**
249
- * @public
250
- *
251
- * for a given column and feature name, return the "ColumnMeta" for that feature.
252
- * This is useful when plugins may depend on one another but may not necessarily care which
253
- * plugin is providing what behavior.
254
- *
255
- * For example, multiple column-focused plugins may care about width or visibility
256
- */
257
- forColumn<FeatureName extends string, Data = unknown>(column: Column<Data>, featureName: FeatureName): ColumnFeatures[FeatureName];
258
- /**
259
- * @public
260
- *
261
- * for a given table and feature name, return the "TableMeta" for that feature.
262
- * This is useful when plugins may depend on one another but may not necessarily care
263
- * which plugin is providing that behavior.
264
- *
265
- * For example, multiple column-focused plugins may care about width or visibility.
266
- */
267
- forTable<FeatureName extends string, Data = unknown>(table: Table<Data>, featureName: FeatureName): TableFeatures[FeatureName];
268
- };
269
- };
270
- export declare const options: {
271
- /**
272
- * @public
273
- *
274
- * For a given table and plugin, return the options, if any were given from the user
275
- * during construction of the table.
276
- */
277
- forTable<P extends BasePlugin<any>, Data = unknown>(table: Table<Data>, klass: Class<P>): Partial<OptionsFor<SignatureFrom<P>>>;
278
- forColumn<P extends BasePlugin<any>, Data = unknown>(column: Column<Data>, klass: Class<P>): Partial<ColumnOptionsFor<SignatureFrom<P>>>;
279
- };
280
- export {};
281
- //# sourceMappingURL=base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/plugins/-private/base.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,UAAU,EACV,YAAY,EACb,MAAM,2BAA2B,CAAC;AAEnC,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,QAAQ,CAAC,GAAG,QAAQ,GAAG,CAAC,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IACxE;;;;OAIG;IACH,gBAAgB,EAAE,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAChE;;;;OAIG;IACH,WAAW,EAAE,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;CAC5D;AAED;;;;;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a,CAAC,CAAC,CAAC,CAAC;IAuB/B;;;;;OAKG;aACM,CAAC,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,mBAC/B,KAAK,CAAC,IAAI,CAAC,SACX,KAAK,CAAC,CAAC,CAAC,GACd,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IA4BjC;;;OAGG;;QAED;;;;;;;;WAQG;kBACO,WAAW,SAAS,MAAM,EAAE,IAAI,oBAChC,MAAM,CAAC,IAAI,CAAC,eACP,WAAW,GACvB,cAAc,CAAC,WAAW,CAAC;QAe9B;;;;;;;;WAQG;iBACM,WAAW,SAAS,MAAM,EAAE,IAAI,mBAChC,KAAK,CAAC,IAAI,CAAC,eACL,WAAW,GACvB,aAAa,CAAC,WAAW,CAAC;;CAehC,CAAC;AAuCF,eAAO,MAAM,OAAO;IAClB;;;;;OAKG;aACM,CAAC,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,mBAC/B,KAAK,CAAC,IAAI,CAAC,SACX,KAAK,CAAC,CAAC,CAAC,GACd,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;cAa9B,CAAC,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,oBAC/B,MAAM,CAAC,IAAI,CAAC,SACb,KAAK,CAAC,CAAC,CAAC,GACd,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;CAY/C,CAAC"}
@@ -1,22 +0,0 @@
1
- import type { Constructor } from '../../-private/private-types';
2
- import type { Plugin } from '../../plugins';
3
- type PluginOption = Constructor<Plugin<any>> | [Constructor<Plugin<any>>, () => any];
4
- type ExpandedPluginOption = [Constructor<Plugin<any>>, () => any];
5
- export type Plugins = PluginOption[];
6
- export declare function normalizePluginsConfig(plugins?: Plugins): ExpandedPluginOption[];
7
- export declare function verifyPlugins(plugins: ExpandedPluginOption[]): void;
8
- type AssignableStyles = Omit<CSSStyleDeclaration, 'length' | 'parentRule'>;
9
- /**
10
- * @public
11
- *
12
- * Utility that helps safely apply styles to an element
13
- */
14
- export declare function applyStyles(element: HTMLElement | SVGElement, styles: Partial<AssignableStyles>): void;
15
- /**
16
- * @public
17
- *
18
- * Utility that helps safely remove styles from an element
19
- */
20
- export declare function removeStyles(element: HTMLElement | SVGElement, styles: Array<keyof AssignableStyles>): void;
21
- export {};
22
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/-private/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,KAAK,YAAY,GACb,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GACxB,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;AAE1C,KAAK,oBAAoB,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;AAElE,MAAM,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;AAErC,wBAAgB,sBAAsB,CACpC,OAAO,CAAC,EAAE,OAAO,GAChB,oBAAoB,EAAE,CA8BxB;AAsCD,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,QA6B5D;AAED,KAAK,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,WAAW,GAAG,UAAU,EACjC,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,QAWlC;AAiBD;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,GAAG,UAAU,EACjC,MAAM,EAAE,KAAK,CAAC,MAAM,gBAAgB,CAAC,QAMtC"}
@@ -1,54 +0,0 @@
1
- import type { ColumnOrder } from './plugin.ts';
2
- import type { Column, Table } from '../../index.ts';
3
- /**
4
- * Move the column one position to the left.
5
- * If the column is first, nothing will happen.
6
- */
7
- export declare const moveLeft: <DataType = unknown>(column: Column<DataType>) => void;
8
- /**
9
- * Move the column one position to the right.
10
- * If the column is last, nothing will happen.
11
- */
12
- export declare const moveRight: <DataType = unknown>(column: Column<DataType>) => void;
13
- /**
14
- * Override all column positions at once.
15
- */
16
- export declare const setColumnOrder: <DataType = unknown>(table: Table<DataType>, order: ColumnOrder<DataType>) => void;
17
- /**
18
- * Ask if the column cannot move to the left
19
- */
20
- export declare const cannotMoveLeft: <DataType = unknown>(column: Column<DataType>) => boolean;
21
- /**
22
- * Ask if the column cannot move to the right
23
- */
24
- export declare const cannotMoveRight: <DataType = unknown>(column: Column<DataType>) => boolean;
25
- /**
26
- * Ask if the column can move to the left
27
- * (If your plugin doesn't expose `canMoveLeft`, use `!cannotMoveLeft`.)
28
- */
29
- export declare const canMoveLeft: <DataType = unknown>(column: Column<DataType>) => boolean;
30
- /**
31
- * Ask if the column can move to the right
32
- * (If your plugin doesn't expose `canMoveRight`, use `!cannotMoveRight`.)
33
- */
34
- export declare const canMoveRight: <DataType = unknown>(column: Column<DataType>) => boolean;
35
- /**
36
- * Get the columns in their current display order.
37
- *
38
- * This returns an array of columns sorted according to any reordering
39
- * that has been applied via the ColumnReordering plugin. If no reordering
40
- * has been applied, columns are returned in their original order.
41
- *
42
- * @param table - The table instance to get ordered columns from
43
- * @returns Array of columns in their current display order
44
- *
45
- * @example
46
- * ```ts
47
- * import { orderedColumnsFor } from '@universal-ember/table/plugins/column-reordering';
48
- *
49
- * const columns = orderedColumnsFor(table);
50
- * // Use the ordered columns for rendering or other operations
51
- * ```
52
- */
53
- export declare const orderedColumnsFor: <DataType = unknown>(table: Table<DataType>) => Column<DataType>[];
54
- //# sourceMappingURL=helpers.d.ts.map
@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5 +0,0 @@
1
- export * from './helpers.ts';
2
- export { ColumnOrder, ColumnReordering, orderOf } from './plugin.ts';
3
- export { ColumnReordering as Plugin } from './plugin.ts';
4
- export type { Signature } from './plugin.ts';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/column-reordering/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAGzD,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -1,196 +0,0 @@
1
- import { TrackedMap } from 'tracked-built-ins';
2
- import { BasePlugin } from '../-private/base.ts';
3
- import type { PluginPreferences } from '../../plugins/index.ts';
4
- import type { Column, Table } from '../../index.ts';
5
- interface ColumnReorderingPreferences extends PluginPreferences {
6
- table: {
7
- order?: Record<string, number>;
8
- };
9
- }
10
- declare module '@universal-ember/table/plugins' {
11
- interface Registry {
12
- ColumnReordering?: ColumnReorderingPreferences;
13
- 'column-reordering'?: ColumnReorderingPreferences;
14
- }
15
- }
16
- export interface Signature {
17
- Meta: {
18
- Column: ColumnMeta;
19
- Table: TableMeta;
20
- };
21
- }
22
- export declare class ColumnReordering extends BasePlugin<Signature> {
23
- name: string;
24
- static features: string[];
25
- meta: {
26
- readonly column: typeof ColumnMeta;
27
- readonly table: typeof TableMeta;
28
- };
29
- reset(): void;
30
- get columns(): Column<unknown>[];
31
- }
32
- export declare class ColumnMeta<DataType = unknown> {
33
- #private;
34
- private column;
35
- constructor(column: Column<DataType>);
36
- get position(): number;
37
- set position(value: number);
38
- get canMoveLeft(): boolean;
39
- get canMoveRight(): boolean;
40
- get cannotMoveLeft(): boolean;
41
- get cannotMoveRight(): boolean;
42
- /**
43
- * Move the column one spot to the left
44
- */
45
- moveLeft: () => void;
46
- /**
47
- * Move the column one spot to the right
48
- */
49
- moveRight: () => void;
50
- }
51
- export declare class TableMeta<DataType = unknown> {
52
- private table;
53
- constructor(table: Table<DataType>);
54
- /**
55
- * @private
56
- *
57
- * We want to maintain the instance of this ColumnOrder class because
58
- * we allow the consumer of the table to swap out columns at any time.
59
- * When they do this, we want to maintain the order of the table, best we can.
60
- * This is also why the order of the columns is maintained via column key
61
- */
62
- columnOrder: ColumnOrder<DataType>;
63
- /**
64
- * Get the curret order/position of a column
65
- */
66
- getPosition(column: Column<DataType>): number;
67
- /**
68
- * Swap the column with the column at `newPosition`
69
- */
70
- setPosition(column: Column<DataType>, newPosition: number): false | undefined;
71
- /**
72
- * Using a `ColumnOrder` instance, set the order of all columns
73
- */
74
- setOrder: (order: ColumnOrder<DataType>) => void;
75
- /**
76
- * Revert to default config, delete preferences,
77
- * and clear the columnOrder
78
- */
79
- reset(): void;
80
- /**
81
- * @private
82
- */
83
- save(map: Map<string, number>): void;
84
- /**
85
- * @private
86
- */
87
- private read;
88
- get columns(): Column<DataType>[];
89
- /**
90
- * @private
91
- * This isn't our data to expose, but it is useful to alias
92
- */
93
- private get visibleColumns();
94
- private get allColumns();
95
- }
96
- /**
97
- * @private
98
- * Used for keeping track of and updating column order
99
- */
100
- export declare class ColumnOrder<DataType = unknown> {
101
- private args;
102
- /**
103
- * This map will be empty until we re-order something.
104
- */
105
- map: TrackedMap<string, number>;
106
- constructor(args: {
107
- /**
108
- * All columns to track in the ordering.
109
- *
110
- * Backwards compatible usage (without ColumnVisibility):
111
- * - Pass only the columns you want to display
112
- * - All columns are treated as visible
113
- *
114
- * New usage (with ColumnVisibility):
115
- * - Pass ALL columns (including hidden ones)
116
- * - Provide `visibleColumns` to indicate which are visible
117
- * - Hidden columns maintain their position when toggled
118
- */
119
- columns: () => Column<DataType>[];
120
- /**
121
- * Optional: Record of which columns are currently visible.
122
- * When provided, moveLeft/moveRight will skip over hidden columns.
123
- * When omitted, all columns from `columns` are treated as visible (backwards compatible).
124
- *
125
- * Example when using ColumnVisibility:
126
- * ```ts
127
- * visibleColumns: () => columns.reduce((acc, col) => {
128
- * acc[col.key] = meta(col).ColumnVisibility?.isVisible !== false;
129
- * return acc;
130
- * }, {})
131
- * ```
132
- */
133
- visibleColumns?: () => Record<string, boolean>;
134
- /**
135
- * Optional: Callback to persist the column order (e.g., to localStorage).
136
- */
137
- save?: (order: Map<string, number>) => void;
138
- /**
139
- * Optional: Callback to read the current saved order from preferences.
140
- * Called reactively - when preferences change, order updates automatically.
141
- */
142
- read?: () => Map<string, number> | undefined;
143
- /**
144
- * @deprecated Use `read` instead for reactive preferences support.
145
- * Optional: Previously saved column order to restore.
146
- */
147
- existingOrder?: Map<string, number>;
148
- });
149
- /**
150
- * @private
151
- * Helper to get visible columns, defaulting to all columns if not specified
152
- */
153
- private getVisibleColumns;
154
- /**
155
- * To account for columnVisibilty, we need to:
156
- * - get the list of visible columns
157
- * - get the column order (which preserves the order of hidden columns)
158
- * - skip over non-visible columns when determining the previous "index"
159
- * - set the position to whatever that is.
160
- */
161
- moveLeft(key: string): void;
162
- setAll: (map: Map<string, number>) => void;
163
- /**
164
- * To account for columnVisibilty, we need to:
165
- * - get the list of visible columns
166
- * - get the column order (which preserves the order of hidden columns)
167
- * - skip over non-visible columns when determining the next "index"
168
- * - set the position to whatever that is.
169
- */
170
- moveRight(key: string): void;
171
- /**
172
- * Performs a swap of the column's position with the column at position
173
- */
174
- swapWith(key: string, position: number): false | undefined;
175
- get(key: string): number;
176
- /**
177
- * The same as this.map, but with all the columns' information.
178
- * Prefers preferences (via read callback) when available for reactivity.
179
- */
180
- get orderedMap(): ReadonlyMap<string, number>;
181
- get orderedColumns(): Column<DataType>[];
182
- }
183
- /**
184
- * @private
185
- *
186
- * Utility for helping determine the percieved order of a set of columns
187
- * given the original (default) ordering, and then user-configurations.
188
- *
189
- * This function adds missing columns but preserves extra columns in the map
190
- * (they might be hidden, not deleted).
191
- */
192
- export declare function orderOf(columns: {
193
- key: string;
194
- }[], currentOrder: Map<string, number>): Map<string, number>;
195
- export {};
196
- //# sourceMappingURL=plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/column-reordering/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAAE,UAAU,EAAiB,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEpD,UAAU,2BAA4B,SAAQ,iBAAiB;IAC7D,KAAK,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC;CACH;AAED,OAAO,QAAQ,gCAAgC,CAAC;IAC9C,UAAU,QAAQ;QAChB,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;QAC/C,mBAAmB,CAAC,EAAE,2BAA2B,CAAC;KACnD;CACF;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE;QACJ,MAAM,EAAE,UAAU,CAAC;QACnB,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC;CACH;AAED,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,SAAS,CAAC;IACzD,IAAI,SAAuB;IAC3B,MAAM,CAAC,QAAQ,WAAmB;IAElC,IAAI;;;MAGO;IAEX,KAAK;IAML,IAAI,OAAO,sBAEV;CACF;AAED,qBAAa,UAAU,CAAC,QAAQ,GAAG,OAAO;;IAC5B,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC;IAS5C,IAAI,QAAQ,IAKQ,MAAM,CAHzB;IAGD,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED,IAAI,WAAW,YAEd;IAED,IAA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,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;QAC7C;;;WAGG;QACH,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACrC;IAkBH;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAezB;;;;;;OAMG;IAEH,QAAQ,CAAC,GAAG,EAAE,MAAM;IAsCpB,MAAM,GAAI,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,UAahC;IAEF;;;;;;OAMG;IAEH,SAAS,CAAC,GAAG,EAAE,MAAM;IAkCrB;;OAEG;IAEH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IA0EtC,GAAG,CAAC,GAAG,EAAE,MAAM;IAYf;;;OAGG;IACH,IACI,UAAU,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAK5C;IAED,IACI,cAAc,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CA6BvC;CACF;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CACrB,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,EAC1B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAwBrB"}
@@ -1,8 +0,0 @@
1
- import type { Column } from '../../index.ts';
2
- type ColumnOrder = {
3
- key: string;
4
- position: number | undefined;
5
- }[];
6
- export declare function reorderColumns(columns: Column[], orderedColumns: ColumnOrder | undefined): Column<unknown>[];
7
- export {};
8
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/column-reordering/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,KAAK,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAAE,CAAC;AAEnE,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EAAE,EACjB,cAAc,EAAE,WAAW,GAAG,SAAS,qBAsCxC"}