@rokkit/core 1.0.0-next.113 → 1.0.0-next.115

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 (163) hide show
  1. package/dist/packages/actions/src/delegate.svelte.d.ts +13 -0
  2. package/dist/packages/actions/src/dismissable.svelte.d.ts +7 -0
  3. package/dist/packages/actions/src/fillable.svelte.d.ts +8 -0
  4. package/dist/packages/actions/src/index.d.ts +11 -0
  5. package/dist/packages/actions/src/kbd.d.ts +44 -0
  6. package/dist/packages/actions/src/keyboard.svelte.d.ts +7 -0
  7. package/dist/packages/actions/src/lib/event-manager.d.ts +8 -0
  8. package/dist/packages/actions/src/lib/index.d.ts +2 -0
  9. package/dist/packages/actions/src/lib/internal.d.ts +19 -0
  10. package/dist/packages/actions/src/navigable.svelte.d.ts +8 -0
  11. package/dist/packages/actions/src/navigator.svelte.d.ts +20 -0
  12. package/dist/packages/actions/src/pannable.svelte.d.ts +6 -0
  13. package/dist/packages/actions/src/skinnable.svelte.d.ts +8 -0
  14. package/dist/packages/actions/src/swipeable.svelte.d.ts +14 -0
  15. package/dist/packages/actions/src/themable.svelte.d.ts +7 -0
  16. package/dist/packages/actions/src/types.d.ts +72 -0
  17. package/dist/packages/actions/src/utils.d.ts +18 -0
  18. package/dist/packages/bits-ui/src/index.d.ts +2 -0
  19. package/dist/packages/bits-ui/src/reference.d.ts +22 -0
  20. package/dist/packages/bits-ui/src/tree/constants.d.ts +13 -0
  21. package/dist/packages/bits-ui/src/tree/index.d.ts +7 -0
  22. package/dist/packages/bits-ui/src/tree/types.d.ts +71 -0
  23. package/dist/packages/core/src/calendar.d.ts +10 -0
  24. package/dist/packages/core/src/colors/index.d.ts +333 -0
  25. package/dist/packages/core/src/connector.d.ts +8 -0
  26. package/dist/packages/core/src/constants.d.ts +39 -0
  27. package/dist/packages/core/src/events.d.ts +12 -0
  28. package/dist/packages/core/src/field-mapper.d.ts +63 -0
  29. package/dist/packages/core/src/index.d.ts +13 -0
  30. package/dist/packages/core/src/key-event-map.d.ts +18 -0
  31. package/dist/packages/core/src/mapped-items.d.ts +14 -0
  32. package/dist/packages/core/src/mapping.d.ts +75 -0
  33. package/dist/packages/core/src/nested.d.ts +18 -0
  34. package/dist/packages/core/src/string.d.ts +59 -0
  35. package/dist/packages/core/src/theme.d.ts +52 -0
  36. package/dist/packages/core/src/ticks.d.ts +10 -0
  37. package/dist/packages/core/src/types.d.ts +245 -0
  38. package/dist/packages/core/src/utils.d.ts +70 -0
  39. package/dist/packages/data/src/aggregators.d.ts +2 -0
  40. package/dist/packages/data/src/constants.d.ts +46 -0
  41. package/dist/packages/data/src/convert.d.ts +10 -0
  42. package/dist/packages/data/src/dataset.d.ts +43 -0
  43. package/dist/packages/data/src/filter.d.ts +26 -0
  44. package/dist/packages/data/src/formatter.d.ts +10 -0
  45. package/dist/packages/data/src/hierarchy.d.ts +36 -0
  46. package/dist/packages/data/src/index.d.ts +7 -0
  47. package/dist/packages/data/src/infer.d.ts +80 -0
  48. package/dist/packages/data/src/join.d.ts +95 -0
  49. package/dist/packages/data/src/list.d.ts +121 -0
  50. package/dist/packages/data/src/metadata.d.ts +32 -0
  51. package/dist/packages/data/src/model.d.ts +29 -0
  52. package/dist/packages/data/src/parser.d.ts +31 -0
  53. package/dist/packages/data/src/renamer.d.ts +37 -0
  54. package/dist/packages/data/src/rollup.d.ts +51 -0
  55. package/dist/packages/data/src/types.d.ts +346 -0
  56. package/dist/packages/data/src/utils.d.ts +6 -0
  57. package/dist/packages/data/src/view.d.ts +35 -0
  58. package/dist/packages/helpers/src/components/index.d.ts +2 -0
  59. package/dist/packages/helpers/src/index.d.ts +1 -0
  60. package/dist/packages/helpers/src/matchers/action.d.ts +27 -0
  61. package/dist/packages/helpers/src/matchers/array.d.ts +10 -0
  62. package/dist/packages/helpers/src/matchers/dataset.d.ts +10 -0
  63. package/dist/packages/helpers/src/matchers/event.d.ts +10 -0
  64. package/dist/packages/helpers/src/matchers/index.d.ts +4 -0
  65. package/dist/packages/helpers/src/matchers/internal.d.ts +1 -0
  66. package/dist/packages/helpers/src/mocks/animate.d.ts +1 -0
  67. package/dist/packages/helpers/src/mocks/element.d.ts +60 -0
  68. package/dist/packages/helpers/src/mocks/index.d.ts +2 -0
  69. package/dist/packages/helpers/src/mocks/match-media.d.ts +30 -0
  70. package/dist/packages/helpers/src/mocks/resize-observer.d.ts +9 -0
  71. package/dist/packages/helpers/src/simulators/index.d.ts +1 -0
  72. package/dist/packages/helpers/src/simulators/touch.d.ts +40 -0
  73. package/dist/packages/icons/src/convert.d.ts +22 -0
  74. package/dist/packages/icons/src/index.d.ts +2 -0
  75. package/dist/packages/input/src/index.d.ts +18 -0
  76. package/dist/packages/states/src/constants.d.ts +27 -0
  77. package/dist/packages/states/src/derive.svelte.d.ts +22 -0
  78. package/dist/packages/states/src/hierarchy.d.ts +34 -0
  79. package/dist/packages/states/src/index.d.ts +5 -0
  80. package/dist/packages/states/src/list-controller.svelte.d.ts +70 -0
  81. package/dist/packages/states/src/nested-controller.svelte.d.ts +32 -0
  82. package/dist/packages/states/src/proxy.svelte.d.ts +43 -0
  83. package/dist/packages/states/src/tabular.svelte.d.ts +5 -0
  84. package/dist/packages/states/src/traversal.svelte.d.ts +69 -0
  85. package/dist/packages/states/src/vibe.svelte.d.ts +622 -0
  86. package/dist/packages/themes/src/constants.d.ts +6 -0
  87. package/dist/packages/themes/src/index.d.ts +2 -0
  88. package/dist/packages/tutorial/src/assimilate.d.ts +25 -0
  89. package/dist/packages/tutorial/src/collector.d.ts +46 -0
  90. package/dist/packages/tutorial/src/files.d.ts +8 -0
  91. package/dist/packages/tutorial/src/index.d.ts +2 -0
  92. package/dist/packages/tutorial/src/metadata/base.d.ts +19 -0
  93. package/dist/packages/tutorial/src/metadata/factory.d.ts +19 -0
  94. package/dist/packages/tutorial/src/metadata/index.d.ts +2 -0
  95. package/dist/packages/tutorial/src/metadata/javascript.d.ts +7 -0
  96. package/dist/packages/tutorial/src/metadata/json.d.ts +7 -0
  97. package/dist/packages/tutorial/src/metadata/markdown.d.ts +7 -0
  98. package/dist/packages/tutorial/src/metadata/registry.d.ts +26 -0
  99. package/dist/packages/tutorial/src/metamodel.d.ts +45 -0
  100. package/dist/packages/tutorial/src/tutorial.d.ts +21 -0
  101. package/dist/packages/tutorial/src/types.d.ts +172 -0
  102. package/dist/packages/tutorial/src/utils.d.ts +13 -0
  103. package/dist/packages/ui/src/constants.d.ts +2 -0
  104. package/dist/packages/ui/src/index.d.ts +42 -0
  105. package/dist/packages/ui/src/input/types.d.ts +9 -0
  106. package/dist/packages/ui/src/lib/fields.d.ts +16 -0
  107. package/dist/packages/ui/src/lib/form.d.ts +95 -0
  108. package/dist/packages/ui/src/lib/index.d.ts +6 -0
  109. package/dist/packages/ui/src/lib/layout.d.ts +7 -0
  110. package/dist/packages/ui/src/lib/nested.d.ts +48 -0
  111. package/dist/packages/ui/src/lib/schema.d.ts +7 -0
  112. package/dist/packages/ui/src/lib/select.d.ts +8 -0
  113. package/dist/packages/ui/src/lib/tree.d.ts +9 -0
  114. package/dist/packages/ui/src/types.d.ts +5 -0
  115. package/dist/packages/ui/src/wrappers/index.d.ts +3 -0
  116. package/dist/sites/learn/src/hooks.d.ts +1 -0
  117. package/dist/sites/learn/src/hooks.server.d.ts +2 -0
  118. package/dist/sites/learn/src/lib/index.d.ts +7 -0
  119. package/dist/sites/learn/src/lib/media.d.ts +13 -0
  120. package/dist/sites/learn/src/lib/paraglide/messages/en.d.ts +3 -0
  121. package/dist/sites/learn/src/lib/paraglide/messages/fr.d.ts +3 -0
  122. package/dist/sites/learn/src/lib/paraglide/messages/hi.d.ts +3 -0
  123. package/dist/sites/learn/src/lib/paraglide/messages.d.ts +5 -0
  124. package/dist/sites/learn/src/lib/paraglide/runtime.d.ts +52 -0
  125. package/dist/sites/learn/src/lib/stories/02-elements/01-list/03-mapping/src/data.d.ts +5 -0
  126. package/dist/sites/learn/src/lib/stories/02-elements/01-list/04-mixed/src/data.d.ts +13 -0
  127. package/dist/sites/learn/src/lib/stories/02-elements/02-tabs/04-fields/src/data.d.ts +5 -0
  128. package/dist/sites/learn/src/lib/stories/02-elements/02-tabs/05-using/src/data.d.ts +6 -0
  129. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/01-intro/src/data.d.ts +4 -0
  130. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/02-fields/src/data.d.ts +9 -0
  131. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/03-using/src/data.d.ts +19 -0
  132. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/04-mixed/src/data.d.ts +30 -0
  133. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/props.d.ts +15 -0
  134. package/dist/sites/learn/src/lib/stories/02-elements/04-tree/01-intro/src/data.d.ts +12 -0
  135. package/dist/sites/learn/src/lib/stories/02-elements/06-select/02-fields/src/data.d.ts +5 -0
  136. package/dist/sites/learn/src/lib/stories/02-elements/07-multi-select/02-fields/src/data.d.ts +5 -0
  137. package/dist/sites/learn/src/lib/stories/02-elements/08-drop-down/02-fields/src/data.d.ts +5 -0
  138. package/dist/sites/learn/src/lib/stories/05-templates/01-form/02-schema/src/schema.d.ts +22 -0
  139. package/dist/sites/learn/src/lib/stories/05-templates/01-form/03-layout/src/layout.d.ts +19 -0
  140. package/dist/sites/learn/src/lib/stories/05-templates/01-form/03-layout/src/schema.d.ts +36 -0
  141. package/dist/sites/learn/src/lib/stories/05-templates/01-form/05-validation/src/schema.d.ts +34 -0
  142. package/dist/sites/learn/src/lib/stories/05-templates/02-editor/01-introduction/src/data.d.ts +39 -0
  143. package/dist/sites/learn/src/lib/stories/05-templates/02-editor/01-introduction/src/schema.d.ts +187 -0
  144. package/dist/sites/learn/src/lib/stories/06-layout/03-stepper/01-intro/src/data.d.ts +37 -0
  145. package/dist/sites/learn/src/lib/stories/06-layout/03-stepper/02-play/src/data.d.ts +37 -0
  146. package/dist/sites/learn/src/lib/stories/index.d.ts +1 -0
  147. package/dist/sites/learn/src/lib/theme.svelte.d.ts +70 -0
  148. package/dist/sites/learn/src/routes/(learn)/+layout.d.ts +12 -0
  149. package/dist/sites/learn/src/routes/(learn)/[segment]/[...slug]/+page.d.ts +8 -0
  150. package/dist/sites/learn/src/routes/+layout.d.ts +18 -0
  151. package/dist/sites/quick-start/src/hooks.d.ts +1 -0
  152. package/dist/sites/quick-start/src/hooks.server.d.ts +2 -0
  153. package/dist/sites/quick-start/src/lib/index.d.ts +1 -0
  154. package/dist/sites/quick-start/src/lib/paraglide/messages/en.d.ts +3 -0
  155. package/dist/sites/quick-start/src/lib/paraglide/messages/fr.d.ts +3 -0
  156. package/dist/sites/quick-start/src/lib/paraglide/messages/hi.d.ts +3 -0
  157. package/dist/sites/quick-start/src/lib/paraglide/messages.d.ts +5 -0
  158. package/dist/sites/quick-start/src/lib/paraglide/runtime.d.ts +52 -0
  159. package/dist/sites/quick-start/src/routes/+layout.d.ts +9 -0
  160. package/dist/utils.d.ts +1 -1
  161. package/package.json +2 -2
  162. package/src/constants.js +5 -4
  163. package/src/utils.js +5 -3
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Generate shades for a color using css varuable
3
+ *
4
+ * @param {string} name
5
+ * @param {string} modifier
6
+ * @returns
7
+ */
8
+ export function shadesOf(name: string, modifier?: string): {
9
+ DEFAULT: any;
10
+ base: any;
11
+ inset: any;
12
+ subtle: any;
13
+ muted: any;
14
+ raised: any;
15
+ elevated: any;
16
+ floating: any;
17
+ contrast: any;
18
+ overlay: any;
19
+ };
20
+ /**
21
+ * Generate shades for a color using css varuable
22
+ *
23
+ * @param {string} name
24
+ * @param {string} modifier
25
+ * @returns {object}
26
+ */
27
+ export function stateColors(name: string, modifier?: string): object;
28
+ /**
29
+ *
30
+ * @param {string} modifier
31
+ * @returns
32
+ */
33
+ export function themeColors(modifier?: string): {};
34
+ /**
35
+ * Generates contrast colors for light and dark modes based on a given palette. Each color variant in the
36
+ * palette is mapped to either a light or dark contrast color depending on the shade's value.
37
+ *
38
+ * @param {string} [light='#ffffff'] - The default light color used when the shade is >= 500 in light mode or <= 500 in dark mode.
39
+ * @param {string} [dark='#000000'] - The default dark color used when the shade is < 500 in light mode or > 500 in dark mode.
40
+ * @param {Array<string>} [palette=defaultPalette] - An array of color variant names to generate contrast colors for.
41
+ * @returns {Array<Object>} An array containing contrast color rules organized by light and dark modes for each variant in the palette.
42
+ */
43
+ export function contrastColors(light?: string, dark?: string, palette?: Array<string>): Array<Object>;
44
+ /**
45
+ * Constructs and returns the light and dark theme variants based on provided color mapping and color definitions.
46
+ *
47
+ * @param {string} name - The base name for the theme, defaults to 'rokkit' if not provided.
48
+ * @param {Object} [mapping=defaultThemeMapping] - An object mapping variant names to color property names.
49
+ * @param {Object} [colors=defaultColors] - The object containing default color definitions.
50
+ * @returns {Array<Array>} An array containing two arrays, one for the light theme variant and another for the dark theme.
51
+ */
52
+ export function themeRules(name?: string, mapping?: Object, colors?: Object): Array<any[]>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generates an array of tick marks for a range of values.
3
+ *
4
+ * @param {number} lowerBound - The lower bound of the range.
5
+ * @param {number} upperBound - The upper bound of the range.
6
+ * @param {number} [minorTickStep=upperBound-lowerBound] - The step size for minor ticks.
7
+ * @param {number} [majorTickStep=1] - The step size for major ticks.
8
+ * @returns {import('./types').TickMark[]>} An array of tick mark objects.
9
+ */
10
+ export function generateTicks(lowerBound: number, upperBound: number, minorTickStep?: number, majorTickStep?: number): import("./types").TickMark[];
@@ -0,0 +1,245 @@
1
+ declare const _default: {};
2
+ export default _default;
3
+ export type LineType = "child" | "last" | "sibling" | "empty" | "icon";
4
+ /**
5
+ * An object where keys are event names and values are event handler functions.
6
+ */
7
+ export type EventHandlers = {
8
+ [x: string]: Function;
9
+ };
10
+ /**
11
+ * Component map to be used to render the item.
12
+ */
13
+ export type ComponentMap = {
14
+ [x: string]: import("svelte").SvelteComponent<Record<string, any>, any, any>;
15
+ };
16
+ /**
17
+ * Options for the sort order of the column.
18
+ */
19
+ export type SortOptions = "ascending" | "descending" | "none";
20
+ export type SelectionState = "checked" | "unchecked" | "indeterminate";
21
+ /**
22
+ * Options for the horizontal alignment of the column content.
23
+ */
24
+ export type HorizontalAlignOptions = "left" | "middle" | "right";
25
+ /**
26
+ * Options for the action type of the column.
27
+ */
28
+ export type ActionTypes = "select" | "edit" | "delete";
29
+ /**
30
+ * Structure to map custom fields for rendering. This is used to identofy the attributes for various purposes.
31
+ */
32
+ export type FieldMapping = {
33
+ /**
34
+ * Unique id for the item
35
+ */
36
+ id?: string | undefined;
37
+ /**
38
+ * the text to render
39
+ */
40
+ text?: string | undefined;
41
+ /**
42
+ * the value associated with the item
43
+ */
44
+ value?: string | undefined;
45
+ /**
46
+ * a URL
47
+ */
48
+ url?: string | undefined;
49
+ /**
50
+ * icon to render
51
+ */
52
+ icon?: string | undefined;
53
+ /**
54
+ * the image to render
55
+ */
56
+ image?: string | undefined;
57
+ /**
58
+ * children of the item
59
+ */
60
+ children?: string | undefined;
61
+ /**
62
+ * summary of the item
63
+ */
64
+ summary?: string | undefined;
65
+ /**
66
+ * notes for the item
67
+ */
68
+ notes?: string | undefined;
69
+ /**
70
+ * additional properties
71
+ */
72
+ props?: string | undefined;
73
+ /**
74
+ * item is open or closed
75
+ */
76
+ isOpen?: string | undefined;
77
+ /**
78
+ * level of item
79
+ */
80
+ level?: string | undefined;
81
+ /**
82
+ * item is a parent
83
+ */
84
+ parent?: string | undefined;
85
+ /**
86
+ * {string} [isDeleted='_deleted'] item is deleted
87
+ */
88
+ currency?: string | undefined;
89
+ /**
90
+ * Field mapping to be used on children in the next level
91
+ */
92
+ fields?: FieldMapping | undefined;
93
+ };
94
+ /**
95
+ * Column metadata for the table.
96
+ */
97
+ export type ColumnMetadata = {
98
+ /**
99
+ * - The name of the column.
100
+ */
101
+ name: string;
102
+ /**
103
+ * - The data type of the column (e.g., "string", "number", "date").
104
+ */
105
+ dataType: string;
106
+ /**
107
+ * - Additional attributes for the column.
108
+ */
109
+ fields?: FieldMapping | undefined;
110
+ /**
111
+ * - The number of digits for numeric values (defaults to 0).
112
+ */
113
+ digits?: number | undefined;
114
+ /**
115
+ * - A function to format the column value.
116
+ */
117
+ formatter: Function;
118
+ /**
119
+ * - Indicates if the column is virtual (true/false).
120
+ */
121
+ virtual?: boolean | undefined;
122
+ /**
123
+ * - Indicates if the column is sortable (true/false).
124
+ */
125
+ sortable?: boolean | undefined;
126
+ /**
127
+ * - The sort order of the column.
128
+ */
129
+ sortOrder?: SortOptions | undefined;
130
+ /**
131
+ * - The alignment of the column content.
132
+ */
133
+ align?: HorizontalAlignOptions | undefined;
134
+ /**
135
+ * - Action attribute for action columns.
136
+ */
137
+ action?: ActionTypes | undefined;
138
+ };
139
+ /**
140
+ * Track the state of a row in the table.
141
+ */
142
+ export type RowState = {
143
+ /**
144
+ * - The index of the node in the flat list.
145
+ */
146
+ index: number;
147
+ /**
148
+ * - The depth of the node in the hierarchy.
149
+ */
150
+ depth: number;
151
+ /**
152
+ * - The value of the hierarchy node.
153
+ */
154
+ value?: string | undefined;
155
+ /**
156
+ * - Indicates whether the node is visible (true/false).
157
+ */
158
+ isHidden?: boolean | undefined;
159
+ /**
160
+ * - Indicates if this node is a parent (true/false).
161
+ */
162
+ isParent?: boolean | undefined;
163
+ /**
164
+ * - Indicates whether the node is expanded (true/false).
165
+ */
166
+ isExpanded?: boolean | undefined;
167
+ /**
168
+ * - The index of the parent node in the flat list.
169
+ */
170
+ parentIndex?: number | undefined;
171
+ /**
172
+ * - Indicates whether the node is selected (true/false/indeterminate).
173
+ */
174
+ selected?: SelectionState | undefined;
175
+ /**
176
+ * - The indices of the children in the flat list.
177
+ */
178
+ childred: Array<number>;
179
+ };
180
+ /**
181
+ * Track the state of all rows in the table.
182
+ */
183
+ export type RowStateMap = {
184
+ /**
185
+ * - Flat list of hierarchy nodes.
186
+ */
187
+ rows: RowState[];
188
+ };
189
+ /**
190
+ * Shade mapping for color variables
191
+ */
192
+ export type ShadeMapping = {
193
+ /**
194
+ * - the variable name to be used
195
+ */
196
+ key: string;
197
+ /**
198
+ * - the value to be used
199
+ */
200
+ value: string;
201
+ /**
202
+ * - light or dark mode
203
+ */
204
+ mode: string;
205
+ };
206
+ export type TickMark = {
207
+ /**
208
+ * - The value of the tick mark.
209
+ */
210
+ value: number;
211
+ /**
212
+ * - The label for the tick mark.
213
+ */
214
+ label: string;
215
+ /**
216
+ * - Indicates if the tick mark is a major tick.
217
+ */
218
+ major: boolean;
219
+ };
220
+ export type CalendarDay = {
221
+ /**
222
+ * - The day of the month.
223
+ */
224
+ day: number;
225
+ /**
226
+ * - indicates the offset for positioning
227
+ */
228
+ offset: number;
229
+ /**
230
+ * - Datevalue for the day.
231
+ */
232
+ date: date;
233
+ /**
234
+ * - formatted text for the day.
235
+ */
236
+ text: string;
237
+ /**
238
+ * - Indicates if the day is a holiday.
239
+ */
240
+ holiday: boolean;
241
+ /**
242
+ * - Indicates if the day is on the weekend.
243
+ */
244
+ weekend: boolean;
245
+ };
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Finds the closest ancestor of the given element that has the given attribute.
3
+ *
4
+ * @param {HTMLElement} element
5
+ * @param {string} attribute
6
+ * @returns {HTMLElement|null}
7
+ */
8
+ export function getClosestAncestorWithAttribute(element: HTMLElement, attribute: string): HTMLElement | null;
9
+ /**
10
+ * A function that performs no operations.
11
+ */
12
+ export function noop(): void;
13
+ /**
14
+ * Generates a random id
15
+ *
16
+ * @returns {string} A random id
17
+ */
18
+ export function id(): string;
19
+ /**
20
+ * Check if a value is a json object
21
+ *
22
+ * @param {*} val
23
+ * @returns {boolean}
24
+ */
25
+ export function isObject(val: any): boolean;
26
+ /**
27
+ * Converts the value to a string. If the value is an object, it will convert it to a JSON string.
28
+ *
29
+ * @param {*} value
30
+ * @returns {string}
31
+ */
32
+ export function toString(value: any): string;
33
+ /**
34
+ * Generates icon shortcuts for a collection of icons
35
+ *
36
+ * @param {string[]} icons
37
+ * @param {string} collection
38
+ * @param {string} variants
39
+ * @returns {Object}
40
+ */
41
+ export function iconShortcuts(icons: string[], collection: string, variants: string): Object;
42
+ /**
43
+ * Scales the path by the size
44
+ *
45
+ * @param {number} size
46
+ * @param {string|number} x
47
+ * @returns {string|number}
48
+ */
49
+ export function scaledPath(size: number, x: string | number): string | number;
50
+ /**
51
+ * Gets a key string from path
52
+ * @param {string[]} path
53
+ * @returns {string}
54
+ */
55
+ export function getKeyFromPath(path: string[]): string;
56
+ /**
57
+ * Gets a path array from key string
58
+ * @param {string} key
59
+ * @returns {string[]}
60
+ */
61
+ export function getPathFromKey(key: string): string[];
62
+ /**
63
+ * Get snippet function from an object
64
+ * @param {Object} obj
65
+ * @param {string} key
66
+ * @param {null|Function} defaultSnippet
67
+ * @returns {Function|undefined}
68
+ */
69
+ export function getSnippet(obj: Object, key: string, defaultSnippet?: null | Function): Function | undefined;
70
+ export function importIcons(icons: Object): Object;
@@ -0,0 +1,2 @@
1
+ export function counter(values: any[]): number;
2
+ export function violin(values: number[]): Object;
@@ -0,0 +1,46 @@
1
+ export const pickAllowedConfig: <U extends Partial<Record<"children" | "actual_flag", any>>>(obj: "children" | "actual_flag" extends keyof U ? U : never) => "children" | "actual_flag" extends keyof U ? Pick<U, keyof U & ("children" | "actual_flag")> : never;
2
+ /** @type {import('./types').DataFrameConfig */
3
+ export const defaultConfig: import("./types").DataFrameConfig;
4
+ export namespace defaultPathOptions {
5
+ let path: null;
6
+ let separator: string;
7
+ let currencySuffix: string;
8
+ }
9
+ export namespace defaultViewOptions {
10
+ let expanded: boolean;
11
+ let actions: never[];
12
+ let language: string;
13
+ let scanMode: string;
14
+ }
15
+ export namespace defaultActionOrder {
16
+ export let select: number;
17
+ export let edit: number;
18
+ let _delete: number;
19
+ export { _delete as delete };
20
+ }
21
+ /**
22
+ * Returns the default properties for a column
23
+ * @param {string} key - the key to use for the column
24
+ * @returns {Object} the default properties for a column
25
+ */
26
+ export const filterOperations: {
27
+ '=': (value: any, pattern: any) => boolean;
28
+ '<': (value: any, pattern: any) => boolean;
29
+ '>': (value: any, pattern: any) => boolean;
30
+ '<=': (value: any, pattern: any) => boolean;
31
+ '>=': (value: any, pattern: any) => boolean;
32
+ '~*': (value: any, pattern: any) => any;
33
+ '~': (value: any, pattern: any) => any;
34
+ '!=': (value: any, pattern: any) => boolean;
35
+ '!~*': (value: any, pattern: any) => boolean;
36
+ '!~': (value: any, pattern: any) => boolean;
37
+ };
38
+ export namespace typeConverters {
39
+ export function string(value: any): string;
40
+ export function number(value: any): number;
41
+ export function boolean(value: any): boolean;
42
+ export function date(value: any): Date;
43
+ export { identity as mixed };
44
+ }
45
+ export function includeAll(): boolean;
46
+ import { identity } from 'ramda';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Converts an array of objects into a columnar structure, returning an object with two attributes:
3
+ *
4
+ * - columns, which contains an array of column names
5
+ * - data, which is an object with column names as keys and arrays as values.
6
+ *
7
+ * @param {Array<Object>} input
8
+ * @returns {import('./types').Dataframe}
9
+ */
10
+ export function fromArray(input: Array<Object>): import("./types").Dataframe;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Returns the default aggregator which rolls up the columns other than the group_by columns into a single object.
3
+ *
4
+ * @param {import('./types').Metadata} metadata - The metadata for the columns to be aggregated.
5
+ * @param {Object} config - The configuration used to build the aggregator.
6
+ *
7
+ * @returns {Object} An object containing the default aggregator for the specified metadata and configuration.
8
+ */
9
+ export function defaultAggregator(config: Object): Object;
10
+ export function dataset(data: any, options?: {}): DataSet;
11
+ export class DataSet {
12
+ constructor(data: any);
13
+ set data(values: any[]);
14
+ get data(): any[];
15
+ set config(props: any);
16
+ override(props: any): this;
17
+ where(condition: any): this;
18
+ groupBy(...fields: any[]): this;
19
+ alignBy(...fields: any[]): this;
20
+ usingTemplate(template: any): this;
21
+ summarize(from: any, fields: any): this;
22
+ rename(how: any): this;
23
+ drop(...fields: any[]): DataSet;
24
+ sortBy(...fields: any[]): this;
25
+ remove(): this;
26
+ update(value: any): this;
27
+ fillNA(value: any): this;
28
+ apply(callback: any): this;
29
+ rollup(): DataSet;
30
+ select(...cols: any[]): any[];
31
+ union(other: any): DataSet;
32
+ minus(other: any): DataSet;
33
+ intersect(other: any): DataSet;
34
+ innerJoin(other: any, condition: any): DataSet;
35
+ leftJoin(other: any, condition: any): DataSet;
36
+ rightJoin(other: any, condition: any): DataSet;
37
+ fullJoin(other: any, condition: any): DataSet;
38
+ crossJoin(other: any): DataSet;
39
+ semiJoin(other: any, condition: any): DataSet;
40
+ antiJoin(other: any, condition: any): DataSet;
41
+ nestedJoin(other: any, condition: any): DataSet;
42
+ #private;
43
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Filters an array of objects based on a specified condition defined in the options.
3
+ * If a column is provided, it filters based on the value of that column. Otherwise, it filters
4
+ * based on a value present in any of the object's properties.
5
+ *
6
+ * @param {Object[]} data - The array of objects to filter.
7
+ * @param {Object} options - The filtering options that define the condition.
8
+ * @param {string} [options.column] - The property name in the objects to filter by. If omitted, all properties are considered.
9
+ * @param {string|number} [options.value] - The value to compare against when filtering.
10
+ * @param {string} [options.operator] - The operator to use for comparison, should match a key in the filterOperations object.
11
+ * @returns {Object[]} - The filtered array of objects.
12
+ */
13
+ export function filterObjectArray(data: Object[], options: {
14
+ column?: string | undefined;
15
+ value?: string | number | undefined;
16
+ operator?: string | undefined;
17
+ }): Object[];
18
+ /**
19
+ * Applies multiple filtering conditions to an array of objects. This function iterates through each filter option,
20
+ * successively narrowing down the data.
21
+ *
22
+ * @param {Object[]} data - The array of objects to filter.
23
+ * @param {Object[]} filters - An array of filtering options to apply to the data.
24
+ * @returns {Object[]} - The filtered array of objects that meet all conditions specified by the filters.
25
+ */
26
+ export function filterData(data: Object[], filters: Object[]): Object[];
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Creates a formatter function that formats a value according to the specified type and optional locale settings.
3
+ * Supported types include 'default' (no formatting), 'integer', 'number', 'date', 'time',, 'object', 'array', 'currency' & 'ellipsis''
4
+ *
5
+ * @param {string} type - The type of the formatter to use (e.g., 'integer', 'number', 'date', 'time', 'currency').
6
+ * @param {string} [language='en-US'] - Optional IETF language tag used for locale-specific formatting.
7
+ * @param {number} [decimalPlaces=2] - Optional number of decimal places to show with number and currency formatting.
8
+ * @returns {*} - A format function that takes a value and returns a formatted string.
9
+ */
10
+ export function createFormatter(type: string, language?: string, decimalPlaces?: number): any;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Removes objects from an array where the parent attribute is not null.
3
+ * @param {Array<Object>} arr - The array of objects.
4
+ */
5
+ export function removeChildren(arr: Array<Object>): void;
6
+ /**
7
+ * Flatten nested children arrays within an array of objects.
8
+ * @param {Array<Object>} arr - The array of objects.
9
+ */
10
+ export function flattenNestedChildren(arr: Array<Object>): void;
11
+ /**
12
+ * Applies a hierarchical filter to an array of objects.
13
+ * @param {Array<Object>} arr - The array of objects.
14
+ * @param {Function} filterFn - The filter function to apply on each object.
15
+ */
16
+ export function hierarchicalFilter(arr: Array<Object>, filterFn: Function): void;
17
+ /**
18
+ * Derives the hierarchy from the data.
19
+ *
20
+ * @param {Array} data - The data to derive the hierarchy from.
21
+ * @param {string} path - The column name to be used as hierarchical path.
22
+ * @param {string} separator - The separator to be used in the path.
23
+ * @returns {Array<import('./types').Hierarchy>} - The derived hierarchy.
24
+ */
25
+ export function deriveHierarchy(data: any[], options: any): Array<import("./types").Hierarchy>;
26
+ /**
27
+ * Toggles the expansion state of a node and updates the visibility of its children accordingly.
28
+ * If the node is a parent (has child nodes), it will invert its 'isExpanded' property and call
29
+ * 'changeVisibilityForChildren' to reflect changes to its child nodes.
30
+ *
31
+ * @param {Object} node - The node to toggle expansion for. The node is expected to have an
32
+ * 'isParent' property indicating if the node has children, an
33
+ * 'isExpanded' property indicating if the node is expanded, and an array
34
+ * of child nodes under the 'children' property if it is a parent.
35
+ */
36
+ export function toggleExpansion(node: Object): void;
@@ -0,0 +1,7 @@
1
+ export * from "./types";
2
+ export { typeOf } from "./utils";
3
+ export { renamer } from "./renamer";
4
+ export { model } from "./model";
5
+ export { dataset } from "./dataset";
6
+ export { dataview } from "./view";
7
+ export { innerJoin, leftJoin, rightJoin, fullJoin, crossJoin, antiJoin, semiJoin } from "./join";
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Derives the sorting information for a column based on the type of the input value.
3
+ *
4
+ * @param {import('./types').SortableColumn} value - The value that determines the sorting behavior of the column.
5
+ * @returns {import('./types').ColumnSorter} An object containing the 'name' of the column and a 'sorter' function.
6
+ * @throws {Error} Throws an error if the value type is not supported or the value format is invalid.
7
+ */
8
+ export function deriveSortableColumn(value: import("./types").SortableColumn): import("./types").ColumnSorter;
9
+ /**
10
+ * Creates a deep scan sample object that contains a union of all keys from all
11
+ * objects in the array, pulling the values from the last item that contains the key.
12
+ *
13
+ * @param {Array<Object>} data - An array of objects to deep scan and collect sample values.
14
+ * @returns {Object} A sample object consolidating all unique keys with their latest non-null values.
15
+ */
16
+ export function getSample(data: Array<Object>, deepScan?: boolean): Object;
17
+ /**
18
+ * Derives a unique list of column names from an array of data objects.
19
+ * Each data object represents a row and this function compiles a list of all unique property keys
20
+ * present across these objects.
21
+ *
22
+ * @param {Object[]} data - The array of data objects to analyze for column names.
23
+ * @returns {string[]} - An array of strings representing the unique column names found across all data objects.
24
+ */
25
+ export function deriveColumns(data: Object[], options: any): string[];
26
+ /**
27
+ * Derives the data types of columns based on the data provided in an array of objects.
28
+ * The function assumes that all values of a single field (column) are of the same type. It uses
29
+ * the first object in the data array as a reference for the field names. Each field is categorized
30
+ * as either 'string' or 'number' based on whether any of the field values in the data set are non-numeric.
31
+ *
32
+ * @param {Object[]} data - The array of data objects to assess for column data types.
33
+ * @returns {Object} - An object with keys being the data types ('string' & 'number') and values
34
+ * being arrays of field names that correspond to that data type.
35
+ */
36
+ export function deriveDataTypes(data: Object[]): Object;
37
+ /**
38
+ * Infers the data type of a set of values by examining the values in the array.
39
+ * Assumes all values in the array should have the same type, unless they are 'null'.
40
+ * If multiple types are detected (excluding 'null'), the function will return 'mixed'.
41
+ * If all values are 'null', it returns 'null', and it returns 'undefined' for an empty array.
42
+ *
43
+ * @param {Array} values - An array of values for which the data type is to be inferred.
44
+ * @returns {string} - A string representing the inferred data type. Possible values are
45
+ * 'undefined', 'null', 'mixed', or any data type returned by the getType function.
46
+ */
47
+ export function inferDataType(values: any[]): string;
48
+ /**
49
+ * Adds a formatter function to each column in the array based on the column type. If a formatter
50
+ * function is already present, it will not be overwritten. The formatter is created based on the
51
+ * override formatter if present, or the column type and language.
52
+ *
53
+ * @param {Array<import('./types').ColumnMetadata>} columns - The array of column metadata to add formatters to.
54
+ * @param {string} language - The language to use for formatting.
55
+ * @returns {Array<import('./types').ColumnMetadata>} - The array of column metadata with formatters added.
56
+ */
57
+ export function addFormatters(columns: Array<import("./types").ColumnMetadata>, language: string): Array<import("./types").ColumnMetadata>;
58
+ /**
59
+ * Converts an array of action names to an array of action objects.
60
+ *
61
+ * @param {Array<string|import('./types').Action>} input - The input to convert to actions.
62
+ * @returns {Array<import('./types').Action>} - The converted actions.
63
+ */
64
+ export function convertToActions(input: Array<string | import("./types").Action>): Array<import("./types").Action>;
65
+ /**
66
+ * Adds actions to the column metadata. This function updates the columns array in place.
67
+ *
68
+ * @param {Array<import('./types').ColumnMetadata>} columns - The column metadata to update.
69
+ * @param {Array<string|import('./types').Action>} input - The actions to add to the column metadata.
70
+ * @returns {Array<import('./types').ColumnMetadata>} - The updated column metadata.
71
+ */
72
+ export function deriveActions(columns: Array<import("./types").ColumnMetadata>, input: Array<string | import("./types").Action>): Array<import("./types").ColumnMetadata>;
73
+ /**
74
+ * Derives column metadata from the data to be used in a tabular component.
75
+ *
76
+ * @param {Array} data - The data to derive column metadata from.
77
+ * @param {Object} [options] - The options to use when deriving column metadata.
78
+ * @returns {Array<import('./types').ColumnMetadata>} - The derived column metadata.
79
+ */
80
+ export function deriveMetadata(dataArray: any, options?: Object): Array<import("./types").ColumnMetadata>;