@astrato-io/visualizations 0.6.4 → 0.7.0

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 (220) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +32 -2
  3. package/THIRD_PARTY_NOTICES.md +68 -205
  4. package/VISUALIZATION_DEFINITIONS.md +68 -114
  5. package/chunks/Button-BrGKp9Nm.js +110 -0
  6. package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
  7. package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
  8. package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-VtfFx2vJ.js} +51 -51
  9. package/chunks/MenuOption-ByRqhRdX.js +3934 -0
  10. package/chunks/Title-CO5dP1ma.js +1691 -0
  11. package/chunks/ToggleButton-KOBAimC1.js +112 -0
  12. package/chunks/app-filter-bar.compiler-TwVTeoj5.js +64 -0
  13. package/chunks/bar.compiler-DuQg8EUb.js +374 -0
  14. package/chunks/builder-DEDvNq1k.js +201 -0
  15. package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
  16. package/chunks/color-settings-3VRlf_Vw.js +6 -0
  17. package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
  18. package/chunks/coloring-CncX_JRX.js +278 -0
  19. package/chunks/{src-BC7cGcJ-.js → definitions-BPJQTx16.js} +650 -464
  20. package/chunks/{escobar-BGqT1EsE.js → escobar-DRhRMYRE.js} +6282 -4931
  21. package/chunks/event-bus-CrLB-Y8z.js +3 -0
  22. package/chunks/extend-preset-CUFNpmPe.js +4398 -0
  23. package/chunks/filter.compiler-w27dlv0C.js +70 -0
  24. package/chunks/filtering-cc7WqWpg.js +1153 -0
  25. package/chunks/handlers-TOT-7INo.js +12871 -0
  26. package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
  27. package/chunks/isEqual-B8loyPsC.js +12 -0
  28. package/chunks/label-format-type-weq1XfcX.js +8 -0
  29. package/chunks/line.compiler-Ct1WhN2p.js +198 -0
  30. package/chunks/logger-DpQtYQnX.js +1163 -0
  31. package/chunks/lookup-BWllin0q.js +36 -0
  32. package/chunks/{metadata-CPXdYoln.js → metadata-WABZrt7Y.js} +1 -1
  33. package/chunks/number.compiler-D8TPly-4.js +53 -0
  34. package/chunks/{src-C0LgoUWY.js → operations-Dh4v1Ovt.js} +7716 -7541
  35. package/chunks/{range-DrzdfBX4.js → range-Bi-7zT0k.js} +2 -2
  36. package/chunks/registry-KervaxqJ.js +31 -0
  37. package/chunks/render-wrappers-OEmtaM8g.js +2 -0
  38. package/chunks/{registry-CExpGJ1N.js → requirements-PAoRaJyb.js} +294 -326
  39. package/chunks/responsive.styles-DSiOGD7u.js +82 -0
  40. package/chunks/shared-Bn4N5QcZ.js +1218 -0
  41. package/chunks/src-77e3mC7i.js +391 -0
  42. package/chunks/standalone-B55oyW6c.js +689 -0
  43. package/chunks/{standalone-CY57qwZ-.js → standalone-BDhPQtzQ.js} +386 -352
  44. package/chunks/{standalone-BDCwI6Hn.js → standalone-BGkmozIb.js} +1108 -953
  45. package/chunks/standalone-BMTCb10X.js +179 -0
  46. package/chunks/standalone-BXKRE_Se.js +468 -0
  47. package/chunks/standalone-Bes8srx1.js +354 -0
  48. package/chunks/standalone-BjZp0QMe.js +2 -0
  49. package/chunks/{standalone-BH5NqDwp.js → standalone-BlMIwpEe.js} +687 -573
  50. package/chunks/{standalone-CCNtaJ7s.js → standalone-C8ZAEutO.js} +44 -43
  51. package/chunks/standalone-C8qAelL4.js +2 -0
  52. package/chunks/standalone-CJvIXsQE.js +743 -0
  53. package/chunks/standalone-CLmGb7nn2.js +355 -0
  54. package/chunks/{ui-D1HQNIBy.js → standalone-CM5XcAN5.js} +15946 -17658
  55. package/chunks/standalone-CXNP6-xD.js +420 -0
  56. package/chunks/{standalone-BYm1UjLr.js → standalone-D5Q5ngsD.js} +59 -57
  57. package/chunks/standalone-DLlyRIE6.js +287 -0
  58. package/chunks/standalone-DMcI1afI.js +396 -0
  59. package/chunks/{standalone-jiz0L2Dg.js → standalone-DN4S1MjT.js} +1113 -1094
  60. package/chunks/{standalone-QJ1kKMnO.js → standalone-DT0wKji7.js} +2 -2
  61. package/chunks/{standalone-D5vnf-9y.js → standalone-DVTJwsTY.js} +1110 -1035
  62. package/chunks/standalone-DW6NT205.js +518 -0
  63. package/chunks/standalone-DYQIQH4c.js +2095 -0
  64. package/chunks/standalone-D__XCp-h.js +1003 -0
  65. package/chunks/standalone-XTgSsTAa.js +354 -0
  66. package/chunks/standalone-XuGksArp.js +68 -0
  67. package/chunks/{standalone-CNyNHKVx.js → standalone-we5D5MIn.js} +176 -172
  68. package/chunks/table.compiler-DMeeHxb6.js +222 -0
  69. package/chunks/useFieldName-Cjn9KCVp.js +7 -0
  70. package/chunks/useSlotProps-DLbQp4lc.js +166 -0
  71. package/chunks/{utils-Ba9T0TqC.js → utils-vdmi_2PK.js} +6266 -6517
  72. package/chunks/{src-DvX5LU9T.js → view-BuwQugKb.js} +2893 -5956
  73. package/chunks/visualization-filters-Cc4KU-l-.js +7455 -0
  74. package/chunks/web-components-DqClFkgO.js +1185 -0
  75. package/chunks/with-html-element-D0uY2zjI.js +7328 -0
  76. package/definitions.js +3 -3
  77. package/docs/operations/astrato-app-filter-bar.md +17 -17
  78. package/docs/operations/bar.md +1006 -1071
  79. package/docs/operations/combo.md +717 -738
  80. package/docs/operations/date-picker.md +27 -27
  81. package/docs/operations/distribution-gauge.md +471 -607
  82. package/docs/operations/dot.md +787 -879
  83. package/docs/operations/filter.md +139 -163
  84. package/docs/operations/gauge.md +491 -627
  85. package/docs/operations/heatMap.md +834 -916
  86. package/docs/operations/histogram.md +166 -180
  87. package/docs/operations/iframe.md +5 -5
  88. package/docs/operations/image.md +16 -16
  89. package/docs/operations/index.md +12 -12
  90. package/docs/operations/line.md +811 -888
  91. package/docs/operations/number.md +470 -536
  92. package/docs/operations/pie.md +825 -958
  93. package/docs/operations/radar.md +599 -679
  94. package/docs/operations/sankey.md +462 -584
  95. package/docs/operations/scatter.md +823 -929
  96. package/docs/operations/shape.md +34 -34
  97. package/docs/operations/simpleTextObject.md +18 -25
  98. package/docs/operations/slider.md +33 -43
  99. package/docs/operations/table.md +1177 -1150
  100. package/docs/operations/tree.md +404 -397
  101. package/docs/operations/treemap.md +595 -673
  102. package/docs/operations/waterfall.md +369 -379
  103. package/docs/operations/word-cloud.md +512 -583
  104. package/getters.js +7 -7
  105. package/index.js +3 -1183
  106. package/metadata.js +18 -18
  107. package/operations.js +13 -13
  108. package/package.json +133 -88
  109. package/render.js +10 -0
  110. package/src/charts/bar.d.ts +1 -0
  111. package/src/charts/combo.d.ts +1 -0
  112. package/src/charts/dot.d.ts +1 -0
  113. package/src/charts/gauge-distribution.d.ts +1 -0
  114. package/src/charts/gauge.d.ts +1 -0
  115. package/src/charts/heat-map.d.ts +1 -0
  116. package/src/charts/histogram.d.ts +1 -0
  117. package/src/charts/line.d.ts +1 -0
  118. package/src/charts/pie.d.ts +1 -0
  119. package/src/charts/radar.d.ts +1 -0
  120. package/src/charts/sankey.d.ts +1 -0
  121. package/src/charts/scatter.d.ts +1 -0
  122. package/src/charts/table.d.ts +1 -0
  123. package/src/charts/tree.d.ts +1 -0
  124. package/src/charts/treemap.d.ts +1 -0
  125. package/src/charts/waterfall.d.ts +1 -0
  126. package/src/charts/word-cloud.d.ts +1 -0
  127. package/src/definitions/index.d.ts +2 -2
  128. package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
  129. package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
  130. package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
  131. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1364 -0
  132. package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
  133. package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
  134. package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
  135. package/src/definitions/model/definitions/index.d.ts +23 -0
  136. package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
  137. package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
  138. package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
  139. package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
  140. package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
  141. package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
  142. package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +8 -8
  143. package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +10 -0
  144. package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
  145. package/src/definitions/model/definitions/types/index.d.ts +3 -0
  146. package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
  147. package/src/getters/index.d.ts +3 -3
  148. package/src/index.d.ts +1 -1
  149. package/src/objects/app-filter-bar.d.ts +1 -0
  150. package/src/objects/date-picker.d.ts +1 -0
  151. package/src/objects/filter.d.ts +1 -0
  152. package/src/objects/iframe.d.ts +1 -0
  153. package/src/objects/image.d.ts +1 -0
  154. package/src/objects/number.d.ts +1 -0
  155. package/src/objects/shape.d.ts +1 -0
  156. package/src/objects/slider.d.ts +1 -0
  157. package/src/objects/text.d.ts +1 -0
  158. package/src/operations/index.d.ts +3 -3
  159. package/src/registry/create-visualization-registry.d.ts +5 -0
  160. package/src/render/index.d.ts +34 -0
  161. package/src/runtime/index.d.ts +2 -2
  162. package/src/types.d.ts +9 -4
  163. package/src/web-components/index.d.ts +3 -3
  164. package/chunks/Radio-Ciu-F4CU.js +0 -957
  165. package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
  166. package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
  167. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
  168. package/chunks/bar.compiler-oqaPzIut.js +0 -370
  169. package/chunks/coloring-C16AUZEi.js +0 -663
  170. package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
  171. package/chunks/event-bus-KiSiCJrC.js +0 -2683
  172. package/chunks/events-WZut5Ow6.js +0 -4
  173. package/chunks/filter.compiler-CuLtc_02.js +0 -60
  174. package/chunks/filtering-Yq4DEa0t.js +0 -953
  175. package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
  176. package/chunks/grouping-type-BX_9Ix5q.js +0 -3
  177. package/chunks/interfaces-VUY4_yVO.js +0 -8742
  178. package/chunks/line-settings-DfYTUyPz.js +0 -4
  179. package/chunks/line.compiler-BpA_6Tc7.js +0 -188
  180. package/chunks/number.compiler-DbkWcG4S.js +0 -44
  181. package/chunks/pie-uv42Eqal.js +0 -10
  182. package/chunks/requirements-DNhuShLS.js +0 -6
  183. package/chunks/shared-CKDL4hx9.js +0 -1171
  184. package/chunks/src-Cum_2NLV.js +0 -12145
  185. package/chunks/src-Dun_jXtz.js +0 -10295
  186. package/chunks/standalone-87YV_m9n.js +0 -687
  187. package/chunks/standalone-BLVAWLNJ.js +0 -385
  188. package/chunks/standalone-BPomtAVs.js +0 -2
  189. package/chunks/standalone-BXyBcUOQ.js +0 -2
  190. package/chunks/standalone-BllF4rDp.js +0 -383
  191. package/chunks/standalone-BmfMt74U.js +0 -726
  192. package/chunks/standalone-BqWyrnZI.js +0 -281
  193. package/chunks/standalone-C85u7U6I.js +0 -340
  194. package/chunks/standalone-CDQnr6qT.js +0 -345
  195. package/chunks/standalone-CZynjFG7.js +0 -12979
  196. package/chunks/standalone-DFPva_ku.js +0 -299
  197. package/chunks/standalone-DQxxNwF8.js +0 -675
  198. package/chunks/standalone-DS9T0FZ-.js +0 -830
  199. package/chunks/standalone-Dx3MLlrO.js +0 -512
  200. package/chunks/standalone-DzixzZAL.js +0 -411
  201. package/chunks/standalone-lBm9hQ-q.js +0 -179
  202. package/chunks/standalone-rJ45Zfl1.js +0 -68
  203. package/chunks/table.compiler-BrXkm4Fz.js +0 -213
  204. package/chunks/toInteger-DVZr-D1j.js +0 -11
  205. package/chunks/treemap-x_zmJoG7.js +0 -23
  206. package/chunks/types-dVVCsDWD.js +0 -4
  207. package/chunks/useFieldName-oqQ3bvnO.js +0 -7
  208. package/chunks/view-CLqWMV7Z.js +0 -156
  209. package/src/definitions/shared/index.d.ts +0 -5
  210. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
  211. package/src/definitions/shared/lib/registry/index.d.ts +0 -3
  212. package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
  213. package/src/definitions/shared/lib/types/index.d.ts +0 -3
  214. package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
  215. package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
  216. package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
  217. package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
  218. package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
  219. package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
  220. /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
@@ -0,0 +1,222 @@
1
+ import { Ms as e, Ts as t, bo as n, r } from "./visualization-filters-Cc4KU-l-.js";
2
+ import { A as i, C as a, E as o, O as s, P as c, T as l, d as u, g as d, h as f, i as p, o as m, p as h, s as g, t as _, u as v, v as y, x as b, y as x } from "./shared-Bn4N5QcZ.js";
3
+ import { Ld as S, gd as C } from "./handlers-TOT-7INo.js";
4
+ import { p as w } from "./operations-Dh4v1Ovt.js";
5
+ r();
6
+ var T = {
7
+ all: n.ShowAll,
8
+ auto: n.Auto,
9
+ horizontal: n.ShowHorizontal,
10
+ none: n.NoBorders,
11
+ vertical: n.ShowVertical
12
+ }, E = (e) => e.flatMap(([e, t]) => t === void 0 ? [] : [{
13
+ name: e,
14
+ payload: t
15
+ }]), D = (e) => e ? E([
16
+ [w.SET_TABLE_COLUMN_WIDTH_BEHAVIOR, e.columnWidthBehavior],
17
+ [w.SET_TABLE_FIXED_ROW_HEIGHT_ENABLED, e.rowHeight !== void 0 || void 0],
18
+ [w.SET_TABLE_FIXED_ROW_HEIGHT_VALUE, e.rowHeight]
19
+ ]) : [], O = (e) => e ? E([
20
+ [w.SET_TABLE_BACKGROUND_TYPE, e.type],
21
+ [w.SET_TABLE_BACKGROUND_COLOR, e.color],
22
+ [w.SET_TABLE_ODD_BACKGROUND_COLOR, e.oddColor],
23
+ [w.SET_TABLE_EVEN_BACKGROUND_COLOR, e.evenColor]
24
+ ]) : [], k = (e) => e ? E([
25
+ [w.SET_TABLE_BODY_FONT_FAMILY, e.fontFamily],
26
+ [w.SET_TABLE_BODY_FONT_SIZE, e.fontSize],
27
+ [w.SET_TABLE_ALL_COLUMNS_FONT_COLOR, e.fontColor],
28
+ [w.SET_TABLE_ALL_COLUMNS_FONT_STYLE, e.fontStyle],
29
+ [w.SET_TABLE_ALL_COLUMNS_HORIZONTAL_ALIGN, e.horizontalAlign],
30
+ [w.SET_TABLE_ALL_COLUMNS_VERTICAL_ALIGN, e.verticalAlign]
31
+ ]) : [], A = (e) => e ? E([
32
+ [w.SET_TABLE_HEADER_BACKGROUND_COLOR, e.backgroundColor],
33
+ [w.SET_TABLE_HEADER_BORDER_COLOR, e.borderColor],
34
+ [w.SET_TABLE_HEADER_FONT_COLOR, e.fontColor],
35
+ [w.SET_TABLE_HEADER_FONT_FAMILY, e.fontFamily],
36
+ [w.SET_TABLE_HEADER_FONT_SIZE, e.fontSize],
37
+ [w.SET_TABLE_HEADER_FONT_STYLE, e.fontStyle],
38
+ [w.SET_TABLE_HEADER_RESPONSIVE_HEIGHT, e.responsiveHeight]
39
+ ]) : [], j = (e) => e ? E([
40
+ [w.SET_TABLE_BORDER_ENABLED, e.enabled],
41
+ [w.SET_TABLE_BORDER_COLOR, e.color],
42
+ [w.SET_TABLE_BORDER_LINE_STYLE, e.lineStyle],
43
+ [w.SET_TABLE_BORDER_RADIUS, e.radius],
44
+ [w.SET_TABLE_BORDER_STROKE_WIDTH, e.strokeWidth],
45
+ [w.SET_TABLE_COLUMN_BORDERS, e.dividers === void 0 ? void 0 : T[e.dividers]],
46
+ [w.SET_TABLE_COLUMN_BORDER_COLOR, e.dividerColor]
47
+ ]) : [], M = (e) => e ? E([
48
+ [w.SET_TABLE_HIGHLIGHT_MODE, e.mode],
49
+ [w.SET_TABLE_HIGHLIGHT_BACKGROUND_COLOR, e.backgroundColor],
50
+ [w.SET_TABLE_HIGHLIGHT_TEXT_COLOR, e.textColor]
51
+ ]) : [], N = (e) => e ? [
52
+ ...D(e.layout),
53
+ ...O(e.background),
54
+ ...k(e.body),
55
+ ...A(e.header),
56
+ ...j(e.borders),
57
+ ...M(e.highlight)
58
+ ] : [], P = (e) => e ? E([
59
+ [w.SET_TABLE_TOTALS_ENABLED, e.enabled],
60
+ [w.SET_TABLE_TOTALS_SHOW_RECORDS_COUNT, e.showRecordsCount],
61
+ [w.SET_TABLE_TOTALS_APPLY_TO, e.applyTo],
62
+ [w.SET_TABLE_TOTALS_BACKGROUND_COLOR, e.style?.backgroundColor],
63
+ [w.SET_TABLE_TOTALS_FONT_COLOR, e.style?.fontColor],
64
+ [w.SET_TABLE_TOTALS_FONT_STYLE, e.style?.fontStyle],
65
+ [w.SET_TABLE_TOTALS_POSITION, e.style?.position],
66
+ [w.SET_TABLE_TOTALS_RESPONSIVE_HEIGHT, e.style?.responsiveHeight]
67
+ ]) : [], F = (e, t, n, r = !1) => ({
68
+ ...e,
69
+ path: n,
70
+ role: t,
71
+ topDimension: r
72
+ }), I = (e) => "columns" in e ? [{
73
+ items: e.columns.map((e, t) => F(e, e.role, [
74
+ "data",
75
+ "columns",
76
+ t
77
+ ])),
78
+ path: ["data", "columns"]
79
+ }] : e.structure === "expandable" ? [{
80
+ items: e.dimensions.map((e, t) => F(e, "dimension", [
81
+ "data",
82
+ "dimensions",
83
+ t
84
+ ])),
85
+ path: ["data", "dimensions"]
86
+ }, {
87
+ items: e.measures.map((e, t) => F(e, "measure", [
88
+ "data",
89
+ "measures",
90
+ t
91
+ ])),
92
+ path: ["data", "measures"]
93
+ }] : [
94
+ {
95
+ items: e.rowDimensions.map((e, t) => F(e, "dimension", [
96
+ "data",
97
+ "rowDimensions",
98
+ t
99
+ ])),
100
+ path: ["data", "rowDimensions"]
101
+ },
102
+ {
103
+ items: e.columnDimensions.map((e, t) => F(e, "dimension", [
104
+ "data",
105
+ "columnDimensions",
106
+ t
107
+ ], !0)),
108
+ path: ["data", "columnDimensions"]
109
+ },
110
+ {
111
+ items: e.measures.map((e, t) => F(e, "measure", [
112
+ "data",
113
+ "measures",
114
+ t
115
+ ])),
116
+ path: ["data", "measures"]
117
+ }
118
+ ], L = (e) => {
119
+ if (!(!("structure" in e) || e.structure === void 0)) switch (e.structure) {
120
+ case "normal": return t.Normal;
121
+ case "expandable": return t.Hierarchical;
122
+ case "pivot": return t.Pivot;
123
+ }
124
+ }, R = (e, t) => f(e, t.flatMap((t) => t.role !== "dimension" || t.showNullValues === void 0 ? [] : [{
125
+ name: w.SET_COLUMN_SHOW_NULL_VALUES,
126
+ payload: {
127
+ ...x(e.resolvedRefs[t.ref]),
128
+ showNullValues: t.showNullValues
129
+ }
130
+ }]), ["data"]), z = (t, n, r) => {
131
+ let i = [
132
+ "formatType",
133
+ "formatString",
134
+ "currency",
135
+ "currencyIsPrefix",
136
+ "negativeType"
137
+ ];
138
+ return f(t, n.flatMap((n) => {
139
+ let a = t.availableFields.find((e) => e.key === n.fieldKey), o = a ? e(a) : n.fieldKey;
140
+ return i.flatMap((e) => {
141
+ let t = n.format?.[e], i = r[e];
142
+ return t !== void 0 && i ? [h(i, o, n.ref, n.path, e, t, n.role)] : [];
143
+ });
144
+ }), ["data"]);
145
+ }, B = async (e) => {
146
+ let t = C(e);
147
+ if (t) return {
148
+ issues: [{
149
+ code: "invalid_structure",
150
+ message: t,
151
+ path: []
152
+ }],
153
+ success: !1
154
+ };
155
+ let n = c.safeParse(e.definition);
156
+ if (!n.success) return {
157
+ issues: l(n.error, e.definition),
158
+ success: !1
159
+ };
160
+ let r = S.safeParse(e.baseVSpec);
161
+ if (!r.success) return {
162
+ issues: [u("invalid_structure", ["baseVSpec"], "Base table vSpec is invalid.", { details: { issues: r.error.issues } })],
163
+ success: !1
164
+ };
165
+ let h = r.data;
166
+ if (!y(h, [
167
+ "columns",
168
+ "dimensions",
169
+ "measures",
170
+ "supportingMeasures",
171
+ "sortingMeasures"
172
+ ])) return {
173
+ issues: [u("non_fresh_base_vspec", ["baseVSpec"], "Table definitions require a fresh base vSpec.")],
174
+ success: !1
175
+ };
176
+ let x = n.data, T = I(x.data), E = T.flatMap((e) => e.items), D = [
177
+ ...E.flatMap((t) => s(t, e.availableFields, t.path, t.role)),
178
+ ...a(T),
179
+ ...i(x.filterGroup, e.availableFields),
180
+ ...b(x.sorting, E.map((e) => e.ref))
181
+ ];
182
+ if (D.length) return {
183
+ issues: D,
184
+ success: !1
185
+ };
186
+ let O = {
187
+ state: v(e, h),
188
+ success: !0
189
+ }, k = L(x.data);
190
+ k !== void 0 && (O = await f(O.state, [{
191
+ name: w.SET_TABLE_DATA_STRUCTURE,
192
+ payload: k
193
+ }], ["data", "structure"]));
194
+ for (let t of E) {
195
+ if ("issue" in O) return {
196
+ issues: [O.issue],
197
+ success: !1
198
+ };
199
+ O = await _(O.state, t, t.role, w.ADD_COLUMN, t.role === "measure" ? o(t, e.availableFields, { columnType: t.role }) : {
200
+ columnType: t.role,
201
+ key: t.fieldKey,
202
+ topDimension: t.topDimension
203
+ }, t.path);
204
+ }
205
+ return "issue" in O || (O = await R(O.state, E), "issue" in O) || (O = await g(O.state, E.filter((e) => e.role === "dimension"), w.SET_COLUMN_TEMPORAL_GROUPING, ["data"]), "issue" in O) || (O = await z(O.state, E, {
206
+ currency: w.SET_COLUMN_CURRENCY,
207
+ currencyIsPrefix: w.SET_COLUMN_CURRENCY_IS_PREFIX,
208
+ formatString: w.SET_COLUMN_FORMAT_STRING,
209
+ formatType: w.SET_COLUMN_FORMAT_TYPE,
210
+ negativeType: w.SET_COLUMN_NEGATIVE_TYPE
211
+ }), "issue" in O) || (O = await f(O.state, N(x.presentation), ["presentation"]), "issue" in O) || (O = await p(O.state, x.filterGroup), "issue" in O) || (O = await m(O.state, x.sorting, w.CHANGE_SORT_ORDER_AND_DIRECTION, w.TOGGLE_SORTING_ITEM), "issue" in O) || (O = await f(O.state, x.limiting?.queryLimit === void 0 ? [] : [{
212
+ name: w.SET_QUERY_LIMIT,
213
+ payload: x.limiting.queryLimit
214
+ }], ["limiting"]), "issue" in O) ? {
215
+ issues: [O.issue],
216
+ success: !1
217
+ } : (O = await f(O.state, P(x.totals), ["totals"]), "issue" in O ? {
218
+ issues: [O.issue],
219
+ success: !1
220
+ } : d(O.state, S));
221
+ };
222
+ export { B as compileTableVisualizationDefinition };
@@ -0,0 +1,7 @@
1
+ import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { Ei as t, F as n } from "./utils-vdmi_2PK.js";
3
+ var r = /* @__PURE__ */ e(t()), i = (e) => {
4
+ let t = n(), i = (0, r.useMemo)(() => t.reduce((e, t) => (e[t.key] = t.name, e), {}), e ?? [t]);
5
+ return (e) => i[e];
6
+ };
7
+ export { i as t };
@@ -0,0 +1,166 @@
1
+ import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { Bt as t, Ei as n, Vt as r, ln as i, rt as a, un as o } from "./utils-vdmi_2PK.js";
3
+ import { d as s } from "./DefaultPropsProvider-BsfB7QTn.js";
4
+ function c(e) {
5
+ return e && e.ownerDocument || document;
6
+ }
7
+ function l(e, t) {
8
+ typeof e == "function" ? e(t) : e && (e.current = t);
9
+ }
10
+ var u = /* @__PURE__ */ e(n());
11
+ function d({ controlled: e, default: t, name: n, state: r = "value" }) {
12
+ let { current: i } = u.useRef(e !== void 0), [a, o] = u.useState(t);
13
+ return [i ? e : a, u.useCallback((e) => {
14
+ i || o(e);
15
+ }, [])];
16
+ }
17
+ function f(e) {
18
+ let t = u.useRef(e);
19
+ return a(() => {
20
+ t.current = e;
21
+ }), u.useRef((...e) => (0, t.current)(...e)).current;
22
+ }
23
+ function p(...e) {
24
+ return u.useMemo(() => e.every((e) => e == null) ? null : (t) => {
25
+ e.forEach((e) => {
26
+ l(e, t);
27
+ });
28
+ }, e);
29
+ }
30
+ var m = {};
31
+ function h(e, t) {
32
+ let n = u.useRef(m);
33
+ return n.current === m && (n.current = e(t)), n;
34
+ }
35
+ var g = [];
36
+ function _(e) {
37
+ u.useEffect(e, g);
38
+ }
39
+ var v = class e {
40
+ constructor() {
41
+ this.currentId = null, this.clear = () => {
42
+ this.currentId !== null && (clearTimeout(this.currentId), this.currentId = null);
43
+ }, this.disposeEffect = () => this.clear;
44
+ }
45
+ static create() {
46
+ return new e();
47
+ }
48
+ start(e, t) {
49
+ this.clear(), this.currentId = setTimeout(() => {
50
+ this.currentId = null, t();
51
+ }, e);
52
+ }
53
+ };
54
+ function y() {
55
+ let e = h(v.create).current;
56
+ return _(e.disposeEffect), e;
57
+ }
58
+ var b = !0, x = !1, S = new v(), C = {
59
+ text: !0,
60
+ search: !0,
61
+ url: !0,
62
+ tel: !0,
63
+ email: !0,
64
+ password: !0,
65
+ number: !0,
66
+ date: !0,
67
+ month: !0,
68
+ week: !0,
69
+ time: !0,
70
+ datetime: !0,
71
+ "datetime-local": !0
72
+ };
73
+ function w(e) {
74
+ let { type: t, tagName: n } = e;
75
+ return !!(n === "INPUT" && C[t] && !e.readOnly || n === "TEXTAREA" && !e.readOnly || e.isContentEditable);
76
+ }
77
+ function T(e) {
78
+ e.metaKey || e.altKey || e.ctrlKey || (b = !0);
79
+ }
80
+ function E() {
81
+ b = !1;
82
+ }
83
+ function D() {
84
+ this.visibilityState === "hidden" && x && (b = !0);
85
+ }
86
+ function O(e) {
87
+ e.addEventListener("keydown", T, !0), e.addEventListener("mousedown", E, !0), e.addEventListener("pointerdown", E, !0), e.addEventListener("touchstart", E, !0), e.addEventListener("visibilitychange", D, !0);
88
+ }
89
+ function k(e) {
90
+ let { target: t } = e;
91
+ try {
92
+ return t.matches(":focus-visible");
93
+ } catch {}
94
+ return b || w(t);
95
+ }
96
+ function A() {
97
+ let e = u.useCallback((e) => {
98
+ e != null && O(e.ownerDocument);
99
+ }, []), t = u.useRef(!1);
100
+ function n() {
101
+ return t.current ? (x = !0, S.start(100, () => {
102
+ x = !1;
103
+ }), t.current = !1, !0) : !1;
104
+ }
105
+ function r(e) {
106
+ return k(e) ? (t.current = !0, !0) : !1;
107
+ }
108
+ return {
109
+ isFocusVisibleRef: t,
110
+ onFocus: r,
111
+ onBlur: n,
112
+ ref: e
113
+ };
114
+ }
115
+ function j(e) {
116
+ return typeof e == "string";
117
+ }
118
+ o();
119
+ function M(e, t, n) {
120
+ return e === void 0 || j(e) ? t : i({}, t, { ownerState: i({}, t.ownerState, n) });
121
+ }
122
+ function N(e, t = []) {
123
+ if (e === void 0) return {};
124
+ let n = {};
125
+ return Object.keys(e).filter((n) => n.match(/^on[A-Z]/) && typeof e[n] == "function" && !t.includes(n)).forEach((t) => {
126
+ n[t] = e[t];
127
+ }), n;
128
+ }
129
+ function P(e) {
130
+ if (e === void 0) return {};
131
+ let t = {};
132
+ return Object.keys(e).filter((t) => !(t.match(/^on[A-Z]/) && typeof e[t] == "function")).forEach((n) => {
133
+ t[n] = e[n];
134
+ }), t;
135
+ }
136
+ o();
137
+ function F(e) {
138
+ let { getSlotProps: t, additionalProps: n, externalSlotProps: r, externalForwardedProps: a, className: o } = e;
139
+ if (!t) {
140
+ let e = s(n?.className, o, a?.className, r?.className), t = i({}, n?.style, a?.style, r?.style), c = i({}, n, a, r);
141
+ return e.length > 0 && (c.className = e), Object.keys(t).length > 0 && (c.style = t), {
142
+ props: c,
143
+ internalRef: void 0
144
+ };
145
+ }
146
+ let c = N(i({}, a, r)), l = P(r), u = P(a), d = t(c), f = s(d?.className, n?.className, o, a?.className, r?.className), p = i({}, d?.style, n?.style, a?.style, r?.style), m = i({}, d, n, u, l);
147
+ return f.length > 0 && (m.className = f), Object.keys(p).length > 0 && (m.style = p), {
148
+ props: m,
149
+ internalRef: d.ref
150
+ };
151
+ }
152
+ function I(e, t, n) {
153
+ return typeof e == "function" ? e(t, n) : e;
154
+ }
155
+ o(), r();
156
+ var L = [
157
+ "elementType",
158
+ "externalSlotProps",
159
+ "ownerState",
160
+ "skipResolvingSlotProps"
161
+ ];
162
+ function R(e) {
163
+ let { elementType: n, externalSlotProps: r, ownerState: a, skipResolvingSlotProps: o = !1 } = e, s = t(e, L), c = o ? {} : I(r, a), { props: l, internalRef: u } = F(i({}, s, { externalSlotProps: c }));
164
+ return M(n, i({}, l, { ref: p(u, c?.ref, e.additionalProps?.ref) }), a);
165
+ }
166
+ export { A as a, p as c, l as d, c as f, j as i, f as l, N as n, v as o, M as r, y as s, R as t, d as u };