@svgrid/enterprise 3.1.8 → 3.1.10

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 (268) hide show
  1. package/README.md +1 -0
  2. package/dist/SvAlertRuleEditor.svelte +16 -5
  3. package/dist/SvGridAlerts.svelte +8 -0
  4. package/dist/SvGridAlerts.svelte.d.ts +4 -0
  5. package/dist/SvGridBoard.svelte +69 -10
  6. package/dist/SvGridBulkEditDrawer.svelte +13 -5
  7. package/dist/SvGridGallery.svelte +286 -0
  8. package/dist/SvGridGallery.svelte.d.ts +30 -0
  9. package/dist/SvGridScheduler.svelte +33 -11
  10. package/dist/SvGridSelectionBar.svelte +47 -0
  11. package/dist/advanced-filter/expr-columns-from-grid.d.ts +1 -0
  12. package/dist/advanced-filter/expr-columns-from-grid.js +11 -7
  13. package/dist/advanced-filter-enable.d.ts +6 -0
  14. package/dist/advanced-filter-enable.js +8 -0
  15. package/dist/alerts/alert-engine.d.ts +7 -0
  16. package/dist/alerts/alert-engine.js +5 -2
  17. package/dist/alerts/condition-editor.d.ts +26 -0
  18. package/dist/alerts/condition-editor.js +17 -0
  19. package/dist/base/index.d.ts +20 -0
  20. package/dist/base/index.js +20 -0
  21. package/dist/bulk-edit.d.ts +11 -0
  22. package/dist/bulk-edit.js +18 -1
  23. package/dist/cdn/svgrid-enterprise.svelte-external.js +11197 -10639
  24. package/dist/designer/assets/GridFooter-Cu8_yBlQ.js +2 -0
  25. package/dist/designer/assets/GridMenus-BUjkkAU2.js +6 -0
  26. package/dist/designer/assets/PinSplitter-BgTpgh1d.css +1 -0
  27. package/dist/designer/assets/PinSplitter-C5AwA1xV.js +1 -0
  28. package/dist/designer/assets/SvGrid.helpers-CIrmIo9U.js +1 -0
  29. package/dist/designer/assets/SvGridCellEditor-CJxThKL_.js +4 -0
  30. package/dist/designer/assets/SvListBox-CS7oUAiX.js +2 -0
  31. package/dist/designer/assets/conditional-formatting-MDWbF8_Y.js +1 -0
  32. package/dist/designer/assets/grid-extension.svelte-BZ7AqyJI.js +1 -0
  33. package/dist/designer/assets/index-BmvG99kR.css +1 -0
  34. package/dist/designer/assets/{index-Obk8sI77.js → index-CJodU3tU.js} +307 -307
  35. package/dist/designer/assets/sparkline-C-NcnB2i.js +1 -0
  36. package/dist/designer/assets/src-C_U1NKOY.js +58 -0
  37. package/dist/designer/assets/sv-grid-scrollbar-B9N6Wuj0.js +109 -0
  38. package/dist/designer/assets/validate-H5u2HEQh.js +1 -0
  39. package/dist/designer/index.html +11 -7
  40. package/dist/expressions/compile.js +10 -0
  41. package/dist/expressions/evaluate.js +18 -0
  42. package/dist/expressions/expression-types.d.ts +10 -0
  43. package/dist/expressions/kinds.d.ts +28 -0
  44. package/dist/expressions/kinds.js +19 -0
  45. package/dist/expressions/parse.js +9 -1
  46. package/dist/fields/AttachmentCell.svelte +242 -0
  47. package/dist/fields/AttachmentCell.svelte.d.ts +5 -0
  48. package/dist/fields/AttachmentDialog.svelte +357 -0
  49. package/dist/fields/AttachmentDialog.svelte.d.ts +13 -0
  50. package/dist/fields/AttachmentEditor.svelte +41 -0
  51. package/dist/fields/AttachmentEditor.svelte.d.ts +11 -0
  52. package/dist/fields/AttachmentPreview.svelte +72 -0
  53. package/dist/fields/AttachmentPreview.svelte.d.ts +8 -0
  54. package/dist/fields/BarcodeCell.svelte +20 -0
  55. package/dist/fields/BarcodeCell.svelte.d.ts +5 -0
  56. package/dist/fields/BaseAutomations.svelte +558 -0
  57. package/dist/fields/BaseAutomations.svelte.d.ts +18 -0
  58. package/dist/fields/BaseChartView.svelte +47 -0
  59. package/dist/fields/BaseChartView.svelte.d.ts +8 -0
  60. package/dist/fields/BaseTableView.svelte +185 -0
  61. package/dist/fields/BaseTableView.svelte.d.ts +37 -0
  62. package/dist/fields/BaseTabs.svelte +308 -0
  63. package/dist/fields/BaseTabs.svelte.d.ts +21 -0
  64. package/dist/fields/ButtonCell.svelte +47 -0
  65. package/dist/fields/ButtonCell.svelte.d.ts +20 -0
  66. package/dist/fields/CheckboxCell.svelte +46 -0
  67. package/dist/fields/CheckboxCell.svelte.d.ts +14 -0
  68. package/dist/fields/DeleteFieldConfirm.svelte +80 -0
  69. package/dist/fields/DeleteFieldConfirm.svelte.d.ts +8 -0
  70. package/dist/fields/DeleteRecordConfirm.svelte +48 -0
  71. package/dist/fields/DeleteRecordConfirm.svelte.d.ts +9 -0
  72. package/dist/fields/FieldCell.svelte +80 -0
  73. package/dist/fields/FieldCell.svelte.d.ts +9 -0
  74. package/dist/fields/FieldEditor.svelte +321 -0
  75. package/dist/fields/FieldEditor.svelte.d.ts +10 -0
  76. package/dist/fields/FieldInput.svelte +188 -0
  77. package/dist/fields/FieldInput.svelte.d.ts +29 -0
  78. package/dist/fields/FieldsHeaderEnd.svelte +146 -0
  79. package/dist/fields/FieldsHeaderEnd.svelte.d.ts +6 -0
  80. package/dist/fields/FootRowAdder.svelte +8 -0
  81. package/dist/fields/FootRowAdder.svelte.d.ts +6 -0
  82. package/dist/fields/GroupHeader.svelte +127 -0
  83. package/dist/fields/GroupHeader.svelte.d.ts +24 -0
  84. package/dist/fields/LinkCell.svelte +46 -0
  85. package/dist/fields/LinkCell.svelte.d.ts +9 -0
  86. package/dist/fields/LinkPickerEditor.svelte +172 -0
  87. package/dist/fields/LinkPickerEditor.svelte.d.ts +9 -0
  88. package/dist/fields/LinkPreview.svelte +60 -0
  89. package/dist/fields/LinkPreview.svelte.d.ts +7 -0
  90. package/dist/fields/LinkedRecordView.svelte +94 -0
  91. package/dist/fields/LinkedRecordView.svelte.d.ts +9 -0
  92. package/dist/fields/LinkedRecordsCell.svelte +59 -0
  93. package/dist/fields/LinkedRecordsCell.svelte.d.ts +11 -0
  94. package/dist/fields/LongTextEditor.svelte +157 -0
  95. package/dist/fields/LongTextEditor.svelte.d.ts +11 -0
  96. package/dist/fields/NumberEditor.svelte +309 -0
  97. package/dist/fields/NumberEditor.svelte.d.ts +12 -0
  98. package/dist/fields/OptionsEditor.svelte +117 -0
  99. package/dist/fields/OptionsEditor.svelte.d.ts +11 -0
  100. package/dist/fields/PercentCell.svelte +21 -0
  101. package/dist/fields/PercentCell.svelte.d.ts +8 -0
  102. package/dist/fields/PropertyInput.svelte +204 -0
  103. package/dist/fields/PropertyInput.svelte.d.ts +11 -0
  104. package/dist/fields/RatingCell.svelte +75 -0
  105. package/dist/fields/RatingCell.svelte.d.ts +16 -0
  106. package/dist/fields/RatingEditor.svelte +82 -0
  107. package/dist/fields/RatingEditor.svelte.d.ts +9 -0
  108. package/dist/fields/RecordView.svelte +310 -0
  109. package/dist/fields/RecordView.svelte.d.ts +11 -0
  110. package/dist/fields/RichTextCell.svelte +30 -0
  111. package/dist/fields/RichTextCell.svelte.d.ts +5 -0
  112. package/dist/fields/RowAdder.svelte +93 -0
  113. package/dist/fields/RowAdder.svelte.d.ts +7 -0
  114. package/dist/fields/RowHeader.svelte +99 -0
  115. package/dist/fields/RowHeader.svelte.d.ts +11 -0
  116. package/dist/fields/SelectCell.svelte +35 -0
  117. package/dist/fields/SelectCell.svelte.d.ts +15 -0
  118. package/dist/fields/SelectEditor.svelte +350 -0
  119. package/dist/fields/SelectEditor.svelte.d.ts +17 -0
  120. package/dist/fields/SummaryCell.svelte +160 -0
  121. package/dist/fields/SummaryCell.svelte.d.ts +11 -0
  122. package/dist/fields/SvBase.svelte +545 -0
  123. package/dist/fields/SvBase.svelte.d.ts +30 -0
  124. package/dist/fields/SvBaseForm.svelte +295 -0
  125. package/dist/fields/SvBaseForm.svelte.d.ts +22 -0
  126. package/dist/fields/SvBaseViewBar.svelte +644 -0
  127. package/dist/fields/SvBaseViewBar.svelte.d.ts +26 -0
  128. package/dist/fields/UserCell.svelte +39 -0
  129. package/dist/fields/UserCell.svelte.d.ts +9 -0
  130. package/dist/fields/UserFace.svelte +30 -0
  131. package/dist/fields/UserFace.svelte.d.ts +12 -0
  132. package/dist/fields/activity.svelte.d.ts +50 -0
  133. package/dist/fields/activity.svelte.js +110 -0
  134. package/dist/fields/attachments.d.ts +95 -0
  135. package/dist/fields/attachments.js +145 -0
  136. package/dist/fields/automation-outbound.d.ts +46 -0
  137. package/dist/fields/automation-outbound.js +61 -0
  138. package/dist/fields/automation-server.d.ts +53 -0
  139. package/dist/fields/automation-server.js +333 -0
  140. package/dist/fields/automations.svelte.d.ts +208 -0
  141. package/dist/fields/automations.svelte.js +437 -0
  142. package/dist/fields/bar-request.svelte.d.ts +16 -0
  143. package/dist/fields/bar-request.svelte.js +15 -0
  144. package/dist/fields/base-alerts.d.ts +24 -0
  145. package/dist/fields/base-alerts.js +64 -0
  146. package/dist/fields/base-connect.d.ts +82 -0
  147. package/dist/fields/base-connect.js +271 -0
  148. package/dist/fields/base-schema.d.ts +104 -0
  149. package/dist/fields/base-schema.js +266 -0
  150. package/dist/fields/base-sql.d.ts +62 -0
  151. package/dist/fields/base-sql.js +251 -0
  152. package/dist/fields/base-sync.d.ts +142 -0
  153. package/dist/fields/base-sync.js +499 -0
  154. package/dist/fields/base-tables.d.ts +89 -0
  155. package/dist/fields/base-tables.js +349 -0
  156. package/dist/fields/builtin-types.d.ts +13 -0
  157. package/dist/fields/builtin-types.js +773 -0
  158. package/dist/fields/button.d.ts +2 -0
  159. package/dist/fields/button.js +17 -0
  160. package/dist/fields/chart-view.d.ts +35 -0
  161. package/dist/fields/chart-view.js +154 -0
  162. package/dist/fields/column-order.d.ts +6 -0
  163. package/dist/fields/column-order.js +12 -0
  164. package/dist/fields/convert.d.ts +16 -0
  165. package/dist/fields/convert.js +176 -0
  166. package/dist/fields/copy-text.d.ts +13 -0
  167. package/dist/fields/copy-text.js +45 -0
  168. package/dist/fields/editor-request.svelte.d.ts +71 -0
  169. package/dist/fields/editor-request.svelte.js +52 -0
  170. package/dist/fields/field-ops.d.ts +72 -0
  171. package/dist/fields/field-ops.js +334 -0
  172. package/dist/fields/filter-model.d.ts +84 -0
  173. package/dist/fields/filter-model.js +446 -0
  174. package/dist/fields/format.d.ts +109 -0
  175. package/dist/fields/format.js +288 -0
  176. package/dist/fields/formula.d.ts +50 -0
  177. package/dist/fields/formula.js +530 -0
  178. package/dist/fields/grid-access.d.ts +60 -0
  179. package/dist/fields/grid-access.js +120 -0
  180. package/dist/fields/index.d.ts +34 -0
  181. package/dist/fields/index.js +312 -0
  182. package/dist/fields/linked-fields.d.ts +8 -0
  183. package/dist/fields/linked-fields.js +40 -0
  184. package/dist/fields/links.d.ts +10 -0
  185. package/dist/fields/links.js +46 -0
  186. package/dist/fields/name-list.d.ts +16 -0
  187. package/dist/fields/name-list.js +49 -0
  188. package/dist/fields/palette.d.ts +47 -0
  189. package/dist/fields/palette.js +69 -0
  190. package/dist/fields/record-delete.svelte.d.ts +12 -0
  191. package/dist/fields/record-delete.svelte.js +5 -0
  192. package/dist/fields/record-menu.d.ts +9 -0
  193. package/dist/fields/record-menu.js +78 -0
  194. package/dist/fields/registry.svelte.d.ts +176 -0
  195. package/dist/fields/registry.svelte.js +51 -0
  196. package/dist/fields/rich-text.d.ts +23 -0
  197. package/dist/fields/rich-text.js +48 -0
  198. package/dist/fields/row-color-choice.svelte.d.ts +31 -0
  199. package/dist/fields/row-color-choice.svelte.js +25 -0
  200. package/dist/fields/row-colors.d.ts +36 -0
  201. package/dist/fields/row-colors.js +90 -0
  202. package/dist/fields/row-height.d.ts +28 -0
  203. package/dist/fields/row-height.js +50 -0
  204. package/dist/fields/sources.svelte.d.ts +80 -0
  205. package/dist/fields/sources.svelte.js +131 -0
  206. package/dist/fields/summaries.d.ts +18 -0
  207. package/dist/fields/summaries.js +138 -0
  208. package/dist/fields/view-model.d.ts +129 -0
  209. package/dist/fields/view-model.js +492 -0
  210. package/dist/fields/viewbar/ChartPanel.svelte +61 -0
  211. package/dist/fields/viewbar/ChartPanel.svelte.d.ts +9 -0
  212. package/dist/fields/viewbar/ColorPanel.svelte +112 -0
  213. package/dist/fields/viewbar/ColorPanel.svelte.d.ts +9 -0
  214. package/dist/fields/viewbar/ConditionValue.svelte +153 -0
  215. package/dist/fields/viewbar/ConditionValue.svelte.d.ts +15 -0
  216. package/dist/fields/viewbar/FieldIcon.svelte +18 -0
  217. package/dist/fields/viewbar/FieldIcon.svelte.d.ts +9 -0
  218. package/dist/fields/viewbar/FilterPanel.svelte +192 -0
  219. package/dist/fields/viewbar/FilterPanel.svelte.d.ts +13 -0
  220. package/dist/fields/viewbar/GanttPanel.svelte +60 -0
  221. package/dist/fields/viewbar/GanttPanel.svelte.d.ts +10 -0
  222. package/dist/fields/viewbar/HideFieldsPanel.svelte +104 -0
  223. package/dist/fields/viewbar/HideFieldsPanel.svelte.d.ts +7 -0
  224. package/dist/fields/viewbar/SortPanel.svelte +85 -0
  225. package/dist/fields/viewbar/SortPanel.svelte.d.ts +8 -0
  226. package/dist/fields/viewbar/ViewsMenu.svelte +250 -0
  227. package/dist/fields/viewbar/ViewsMenu.svelte.d.ts +15 -0
  228. package/dist/fields/viewbar/panel-focus.d.ts +3 -0
  229. package/dist/fields/viewbar/panel-focus.js +22 -0
  230. package/dist/fields/viewbar/sort-state.d.ts +20 -0
  231. package/dist/fields/viewbar/sort-state.js +24 -0
  232. package/dist/gallery.d.ts +7 -0
  233. package/dist/gallery.js +36 -0
  234. package/dist/gantt/SvGridGantt.svelte +88 -16
  235. package/dist/gantt/gantt-config.d.ts +28 -0
  236. package/dist/index.d.ts +3 -0
  237. package/dist/index.js +6 -0
  238. package/dist/install.js +3 -0
  239. package/dist/license-core.d.ts +3 -3
  240. package/dist/license.js +1 -0
  241. package/dist/node/studio.js +105 -4
  242. package/dist/scheduler-config.d.ts +11 -0
  243. package/dist/sources/introspect-supabase.js +4 -1
  244. package/dist/sources/rest.js +6 -2
  245. package/dist/studio/ui-components.generated.js +93 -1
  246. package/dist/upgrade-prompt.d.ts +1 -1
  247. package/dist/version.d.ts +2 -2
  248. package/dist/version.js +2 -2
  249. package/dist/wc/GridFooter-f5K0aLe_.js +145 -0
  250. package/dist/wc/GridMenus-FtSN_8t9.js +1369 -0
  251. package/dist/wc/PinSplitter-D-qtDhSM.js +132 -0
  252. package/dist/wc/{SvGrid.helpers-zBkDTryR.js → SvGrid.helpers-B2GEKrxS.js} +84 -36
  253. package/dist/wc/{SvGridCellEditor-CzUKEbkI.js → SvGridCellEditor-B_cLJrsp.js} +20 -9
  254. package/dist/wc/conditional-formatting-BXis_oP1.js +189 -0
  255. package/dist/wc/grid-extension.svelte-Bufq4B4C.js +20 -0
  256. package/dist/wc/sv-sheet-element.js +7556 -7617
  257. package/dist/wc/svelte-virtualizer.svelte-ehwOupl-.js +360 -0
  258. package/dist/wc/{validate-43C03DLP.js → validate-BaMO8UPE.js} +1 -1
  259. package/package.json +14 -3
  260. package/dist/designer/assets/GridMenus-CvcASlKv.js +0 -8
  261. package/dist/designer/assets/SvGrid.helpers-DE5mmORW.js +0 -1
  262. package/dist/designer/assets/SvGridCellEditor-C7NWcnNC.js +0 -4
  263. package/dist/designer/assets/SvListBox-BlmmzYcU.js +0 -110
  264. package/dist/designer/assets/index-KmSEY7Lb.css +0 -1
  265. package/dist/designer/assets/src-DqHCqori.js +0 -58
  266. package/dist/designer/assets/validate-B71dE1Cs.js +0 -1
  267. package/dist/wc/GridMenus-fWbBUiRH.js +0 -1088
  268. package/dist/wc/svelte-virtualizer.svelte-Dntdh8Ms.js +0 -581
@@ -0,0 +1,132 @@
1
+ import { G as e, H as t, I as n, L as r, P as i, R as a, S as o, T as s, U as c, W as l, X as u, Y as d, at as f, dt as p, et as m, it as h, j as g, m as _, mt as v, n as y, nt as b, st as x, tt as S, ut as C, x as w } from "./client-DQIzjDBG.js";
2
+ import { n as T } from "./grid-extension.svelte-Bufq4B4C.js";
3
+ //#region ../grid/dist/pin-splitter.js
4
+ function E(e, t) {
5
+ let n = [e], r = e;
6
+ for (let e of t) n.push(r += e);
7
+ return n;
8
+ }
9
+ function D(e, t, n, r) {
10
+ let i = 0, a = Math.abs((e[0] ?? 0) - t);
11
+ for (let o = 1; o < e.length && o <= n; o++) {
12
+ let n = e[o] ?? Infinity;
13
+ if (n > r) break;
14
+ Math.abs(n - t) < a && (i = o, a = Math.abs(n - t));
15
+ }
16
+ return i;
17
+ }
18
+ function O(e, t) {
19
+ let n = new Set(e), r = t.filter((e) => n.has(e)), i = new Set(r), a = 0;
20
+ return e.map((e) => i.has(e) ? r[a++] ?? e : e);
21
+ }
22
+ //#endregion
23
+ //#region ../grid/dist/PinSplitter.svelte
24
+ var k = a("<div class=\"sv-pin-split-ghost svelte-3uth74\" aria-hidden=\"true\"></div> <div class=\"sv-pin-split-tip svelte-3uth74\" aria-hidden=\"true\"> </div>", 1), A = a("<div><!> <div class=\"sv-pin-split-line svelte-3uth74\" aria-hidden=\"true\"></div> <div class=\"sv-pin-split-hit svelte-3uth74\" role=\"separator\" aria-orientation=\"vertical\" tabindex=\"0\"></div></div>"), j = {
25
+ hash: "svelte-3uth74",
26
+ code: "\n /* Above the sticky header and pinned cells (up to 42), under the scrollbars (900). */.sv-pin-split.svelte-3uth74 {position:absolute;top:0;left:0;width:0;z-index:50;pointer-events:none;}\n /* An open editor's panel can cross the line. */.sv-pin-split.is-editing.svelte-3uth74 {display:none;}.sv-pin-split-line.svelte-3uth74 {position:absolute;top:0;bottom:0;left:calc(var(--x) - 1px);width:2px;background:color-mix(in srgb, var(--sg-fg, #0f172a) 18%, transparent);transition:background-color 0.12s;}.sv-pin-split-hit.svelte-3uth74 {position:absolute;bottom:0;left:max(0px, calc(var(--x) - 4px));width:8px;cursor:col-resize;pointer-events:auto;outline:none;touch-action:none;}.sv-pin-split.svelte-3uth74:has(.sv-pin-split-hit:where(.svelte-3uth74):hover) .sv-pin-split-line:where(.svelte-3uth74),\n .sv-pin-split.svelte-3uth74:has(.sv-pin-split-hit:where(.svelte-3uth74):focus-visible) .sv-pin-split-line:where(.svelte-3uth74),\n .sv-pin-split.is-dragging.svelte-3uth74 .sv-pin-split-line:where(.svelte-3uth74) {background:var(--sg-accent, #2563eb);}.sv-pin-split.is-dragging.svelte-3uth74 .sv-pin-split-line:where(.svelte-3uth74) {width:3px;left:calc(var(--x) - 1.5px);}\n /* The pointer's own line while the divider snaps between column edges. */.sv-pin-split-ghost.svelte-3uth74 {position:absolute;top:0;bottom:0;width:0;border-left:2px dashed color-mix(in srgb, var(--sg-accent, #2563eb) 50%, transparent);}.sv-pin-split-tip.svelte-3uth74 {position:absolute;top:6px;left:calc(var(--x) + 8px);padding:3px 8px;border-radius:6px;background:var(--sg-fg, #0f172a);color:var(--sg-bg, #fff);font-size:12px;white-space:nowrap;}"
27
+ };
28
+ function M(t, a) {
29
+ p(a, !0), s(t, j);
30
+ let M = y(a, "ctrl", 7), N = x(() => new Set(M().effectivePinning.right)), P = x(() => M().allColumns.filter((t) => !e(N).has(t.id))), F = x(() => new Set(M().effectivePinning.left)), I = x(() => e(P).filter((t) => e(F).has(t.id)).length), L = x(() => E(M().systemColumnsWidth ?? 0, e(P).map((e) => M().getColumnWidth(e.id)))), R = x(() => e(L)[e(I)] ?? 0), z = x(() => M().hasHorizontalOverflow ? 16 : 0), B = x(() => {
31
+ let t = T()?.lockColumn, n = 0;
32
+ if (t) for (let r of e(P)) {
33
+ if (!e(F).has(r.id) || !t(M(), r.id)) break;
34
+ n += 1;
35
+ }
36
+ return n;
37
+ }), V = x(() => M().messages), H = f(null);
38
+ function U() {
39
+ let t = M().scrollContainer;
40
+ if (!t?.clientWidth) return Infinity;
41
+ let n = 0;
42
+ for (let t of e(N)) n += M().getColumnWidth(t) ?? 0;
43
+ return t.clientWidth - n - 120;
44
+ }
45
+ function W(e) {
46
+ let t = M().scrollContainer;
47
+ return t ? e.clientX - t.getBoundingClientRect().left : e.clientX;
48
+ }
49
+ function G(t) {
50
+ if (t === e(I)) return;
51
+ let n = e(P).map((e) => e.id), r = new Set(n), i = [...M().columnPinning.left.filter((e) => !r.has(e)), ...n.slice(0, t)], a = M().grid.getAllColumns().map((e) => e.id), o = M().userColumnOrder ?? [], s = o.length ? [...o, ...a.filter((e) => !o.includes(e))] : a, c = O(s, M().allColumns.map((e) => e.id));
52
+ c.some((e, t) => e !== s[t]) && M().setColumnOrderInternal(c), M().columnPinning = {
53
+ left: i,
54
+ right: [...M().columnPinning.right]
55
+ };
56
+ }
57
+ function K(t) {
58
+ if (t.button !== 0) return;
59
+ t.preventDefault(), t.stopPropagation();
60
+ let n = M().scrollContainer;
61
+ n && (n.scrollLeft = 0), t.currentTarget.setPointerCapture?.(t.pointerId), h(H, {
62
+ x: e(R),
63
+ count: e(I)
64
+ }, !0);
65
+ }
66
+ u(() => {
67
+ if (!e(H)) return;
68
+ let t = (e) => {
69
+ e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), h(H, null));
70
+ };
71
+ return window.addEventListener("keydown", t, !0), () => window.removeEventListener("keydown", t, !0);
72
+ });
73
+ function q(t) {
74
+ if (!e(H)) return;
75
+ let n = W(t);
76
+ h(H, {
77
+ x: n,
78
+ count: Math.max(e(B), D(e(L), n, e(P).length - 1, U()))
79
+ }, !0);
80
+ }
81
+ function J() {
82
+ if (!e(H)) return;
83
+ let t = e(H).count;
84
+ h(H, null), G(t);
85
+ }
86
+ function Y(t) {
87
+ let n = e(I);
88
+ if (t.key === "ArrowRight") n = e(I) + 1;
89
+ else if (t.key === "ArrowLeft") n = e(I) - 1;
90
+ else if (t.key === "Home") n = e(B);
91
+ else return;
92
+ t.preventDefault(), t.stopPropagation(), !(n < e(B) || n > e(P).length - 1) && (n > e(I) && (e(L)[n] ?? Infinity) > U() || G(n));
93
+ }
94
+ let X = x(() => e(H) ? e(H).count : e(I)), Z = x(() => e(H) ? e(L)[e(H).count] ?? e(R) : e(R)), Q = x(() => e(X) === 0 ? e(V).pinSplitterNone : e(X) === 1 ? e(V).pinSplitterOne : e(V).pinSplitterMany.replace("{count}", String(e(X))));
95
+ var $ = r(), ee = S($), te = (t) => {
96
+ var r = A();
97
+ let a, s;
98
+ var u = m(r), f = (t) => {
99
+ var r = k(), a = S(r);
100
+ let o;
101
+ var s = b(a, 2), c = m(s, !0);
102
+ v(s), d(() => {
103
+ o = w(a, "", o, { left: `${e(H).x}px` }), i(c, e(Q));
104
+ }), n(t, r);
105
+ };
106
+ g(u, (t) => {
107
+ e(H) && t(f);
108
+ });
109
+ var p = b(u, 4);
110
+ let y;
111
+ v(r), d(() => {
112
+ a = o(r, 1, "sv-pin-split svelte-3uth74", null, a, {
113
+ "is-dragging": !!e(H),
114
+ "is-editing": !!M().editingCell
115
+ }), s = w(r, "", s, {
116
+ "--x": `${e(Z)}px`,
117
+ bottom: `${e(z)}px`
118
+ }), _(p, "aria-label", e(V).pinSplitterLabel), _(p, "aria-valuemin", e(B)), _(p, "aria-valuemax", e(P).length - 1), _(p, "aria-valuenow", e(X)), _(p, "aria-valuetext", e(Q)), _(p, "title", e(V).pinSplitterHint), y = w(p, "", y, { top: `${M().headerHeight ?? 0}px` });
119
+ }), c("pointerdown", p, K), c("pointermove", p, q), c("pointerup", p, J), l("pointercancel", p, () => h(H, null)), l("lostpointercapture", p, J), c("keydown", p, Y), n(t, r);
120
+ };
121
+ g(ee, (t) => {
122
+ !M().isNarrowResponsive && e(P).length > 1 && t(te);
123
+ }), n(t, $), C();
124
+ }
125
+ t([
126
+ "pointerdown",
127
+ "pointermove",
128
+ "pointerup",
129
+ "keydown"
130
+ ]);
131
+ //#endregion
132
+ export { M as default };
@@ -1,16 +1,63 @@
1
1
  import { i as e } from "./cell-formatting-hb3vzxhJ.js";
2
- //#region ../grid/dist/SvGrid.helpers.js
2
+ //#region ../grid/dist/column-types.js
3
3
  function t(e) {
4
+ switch (e) {
5
+ case "number": return { editorType: "number" };
6
+ case "boolean": return { editorType: "checkbox" };
7
+ case "date": return {
8
+ editorType: "date",
9
+ format: { type: "date" }
10
+ };
11
+ case "dateString": return { editorType: "date" };
12
+ default: return { editorType: "text" };
13
+ }
14
+ }
15
+ function n(e) {
16
+ if (!e) return;
17
+ if (e.cellDataType) return e.cellDataType;
18
+ let t = e.editorType;
19
+ if (t === "number") return "number";
20
+ if (t === "date" || t === "datetime") return "date";
21
+ if (t === "checkbox") return "boolean";
22
+ }
23
+ var r = (e) => e === "date" || e === "dateString";
24
+ function i(e) {
25
+ if (e != null) return typeof e == "number" && Number.isFinite(e) ? "number" : typeof e == "boolean" ? "boolean" : e instanceof Date ? "date" : typeof e == "string" && /^\d{4}-\d{2}-\d{2}([T\s]|$)/.test(e) ? "dateString" : "text";
26
+ }
27
+ function a(e, r, o) {
28
+ return e.map((e) => {
29
+ if (e.columns && e.columns.length) return {
30
+ ...e,
31
+ columns: a(e.columns, r, o)
32
+ };
33
+ let s = e.cellDataType;
34
+ if (!s && o && !n(e) && r != null) {
35
+ let t = e.field;
36
+ s = i(e.fieldFn?.(r) ?? (typeof t == "string" ? r[t] : void 0));
37
+ }
38
+ if (!s) return e;
39
+ let c = t(s);
40
+ return {
41
+ ...e,
42
+ cellDataType: s,
43
+ editorType: e.editorType ?? c.editorType,
44
+ format: e.format ?? c.format
45
+ };
46
+ });
47
+ }
48
+ //#endregion
49
+ //#region ../grid/dist/SvGrid.helpers.js
50
+ function o(e) {
4
51
  let t = "";
5
52
  return e.color && (t += `color:${e.color};`), e.fontWeight != null && (t += `font-weight:${e.fontWeight};`), t;
6
53
  }
7
- function n(e) {
54
+ function s(e) {
8
55
  return Number.isInteger(e) ? e.toLocaleString() : e.toLocaleString(void 0, { maximumFractionDigits: 2 });
9
56
  }
10
- function r(e, t) {
57
+ function c(e, t) {
11
58
  return `${e}:${t}`;
12
59
  }
13
- function i(e) {
60
+ function l(e) {
14
61
  if (!e) return "";
15
62
  if (typeof e == "string") return e;
16
63
  if (Array.isArray(e)) return e.filter(Boolean).join(" ");
@@ -21,22 +68,22 @@ function i(e) {
21
68
  }
22
69
  return "";
23
70
  }
24
- function a(e) {
71
+ function u(e) {
25
72
  if (e == null || e === "") return "";
26
73
  if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e)) return e;
27
74
  let t = e instanceof Date ? e : new Date(e);
28
75
  return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
29
76
  }
30
- function o(e) {
77
+ function d(e) {
31
78
  if (e == null || e === "") return "";
32
79
  if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/.test(e)) return e;
33
80
  let t = e instanceof Date ? e : new Date(e);
34
81
  return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 16);
35
82
  }
36
- function s(e) {
83
+ function f(e) {
37
84
  return String(e).replace(/-native$/, "");
38
85
  }
39
- function c(e) {
86
+ function p(e) {
40
87
  if (e instanceof Date) return e;
41
88
  if (typeof e == "string") {
42
89
  let t = e.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?/);
@@ -47,23 +94,23 @@ function c(e) {
47
94
  }
48
95
  return null;
49
96
  }
50
- function l(e) {
97
+ function m(e) {
51
98
  return e ? `${String(e.getHours()).padStart(2, "0")}:${String(e.getMinutes()).padStart(2, "0")}` : null;
52
99
  }
53
- function u(e, t) {
54
- let n = s(e);
55
- return n === "date" ? a(t) : n === "datetime" ? o(t) : String(t ?? "");
100
+ function h(e, t) {
101
+ let n = f(e);
102
+ return n === "date" ? u(t) : n === "datetime" ? d(t) : String(t ?? "");
56
103
  }
57
- function d(e) {
58
- let t = s(e);
104
+ function g(e) {
105
+ let t = f(e);
59
106
  return t === "number" ? "number" : t === "date" ? "date" : t === "datetime" ? "datetime-local" : t === "time" ? "time" : t === "password" ? "password" : t === "color" ? "color" : "text";
60
107
  }
61
- function f(e) {
108
+ function _(e) {
62
109
  if (!e || Number.isNaN(e.getTime())) return "";
63
110
  let t = (e) => String(e).padStart(2, "0");
64
111
  return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}`;
65
112
  }
66
- function p(e) {
113
+ function v(e) {
67
114
  if (!e) return null;
68
115
  let t = /^(\d{4})-(\d{2})-(\d{2})/.exec(e);
69
116
  if (!t) {
@@ -73,44 +120,45 @@ function p(e) {
73
120
  let n = new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3]));
74
121
  return Number.isNaN(n.getTime()) ? null : n;
75
122
  }
76
- function m(e) {
77
- if (!e || String(e).endsWith("-native")) return !1;
78
- let t = s(e);
79
- return t === "date" || t === "datetime" || t === "time";
123
+ function y(e) {
124
+ let t = e?.editorType;
125
+ if (t && String(t).endsWith("-native")) return !1;
126
+ let i = t ? f(t) : "";
127
+ return i === "date" || i === "datetime" || i === "time" || r(n(e));
80
128
  }
81
- function h(e) {
82
- return s(e) === "number" ? "text" : d(e);
129
+ function b(e) {
130
+ return f(e) === "number" ? "text" : g(e);
83
131
  }
84
- function g(e) {
132
+ function x(e) {
85
133
  return /^-?(\d*\.?\d*)(e-?\d*)?$/i.test(e);
86
134
  }
87
- function _(e) {
135
+ function S(e) {
88
136
  return e == null || e === "" ? [] : Array.isArray(e) ? e.filter((e) => e != null && e !== "") : [e];
89
137
  }
90
- function v(e, t) {
138
+ function C(e, t) {
91
139
  let n = e.find((e) => e.value === t || String(e.value) === String(t));
92
140
  return n ? n.label : String(t ?? "");
93
141
  }
94
- function y(e, t) {
142
+ function w(e, t) {
95
143
  return e.find((e) => e.value === t || String(e.value) === String(t))?.color;
96
144
  }
97
- function b(e) {
145
+ function T(e) {
98
146
  return e ? `background: color-mix(in srgb, ${e} 22%, transparent);border-color: color-mix(in srgb, ${e} 45%, transparent);color: color-mix(in srgb, ${e} 80%, var(--sg-fg, #0f172a));` : "";
99
147
  }
100
- function x(e) {
101
- let t = s(e);
148
+ function E(e) {
149
+ let t = f(e);
102
150
  return t === "number" ? "sv-grid-cell-editor sv-grid-cell-editor-number" : t === "date" ? "sv-grid-cell-editor sv-grid-cell-editor-date" : t === "datetime" ? "sv-grid-cell-editor sv-grid-cell-editor-datetime" : t === "color" ? "sv-grid-cell-editor sv-grid-cell-editor-color" : "sv-grid-cell-editor";
103
151
  }
104
- function S(t) {
152
+ function D(t) {
105
153
  return e(t);
106
154
  }
107
- function C(e, t) {
155
+ function O(e, t) {
108
156
  return Math.max(8, Math.min(e, window.innerWidth - t - 8));
109
157
  }
110
- function w(e) {
158
+ function k(e) {
111
159
  return typeof CSS < "u" && CSS.escape ? CSS.escape(e) : e.replace(/"/g, "\\\"");
112
160
  }
113
- function T(e, t) {
161
+ function A(e, t) {
114
162
  if (e == null || e === "") return NaN;
115
163
  if (t) {
116
164
  let t = (e instanceof Date ? e : new Date(String(e))).getTime();
@@ -119,11 +167,11 @@ function T(e, t) {
119
167
  let n = typeof e == "number" ? e : Number(e);
120
168
  return Number.isFinite(n) ? n : NaN;
121
169
  }
122
- function E(e) {
170
+ function j(e) {
123
171
  let t = Math.abs(e), n = t >= 1e3 ? 0 : t >= 100 ? 1 : t >= 1 ? 2 : 4;
124
172
  return e.toLocaleString(void 0, { maximumFractionDigits: n });
125
173
  }
126
- function D(e) {
174
+ function M(e) {
127
175
  return new Date(e).toLocaleDateString(void 0, {
128
176
  year: "numeric",
129
177
  month: "short",
@@ -131,4 +179,4 @@ function D(e) {
131
179
  });
132
180
  }
133
181
  //#endregion
134
- export { _ as C, f as S, v as _, w as a, i as b, D as c, h as d, r as f, y as g, d as h, b as i, E as l, x as m, t as n, l as o, u as p, C as r, n as s, S as t, p as u, g as v, m as w, c as x, T as y };
182
+ export { S as C, a as D, r as E, _ as S, n as T, C as _, k as a, l as b, M as c, b as d, c as f, w as g, g as h, T as i, j as l, E as m, o as n, m as o, h as p, O as r, s, D as t, v as u, x as v, y as w, p as x, A as y };
@@ -1,5 +1,5 @@
1
1
  import { C as e, D as t, G as n, H as r, I as i, L as a, M as o, O as s, P as c, Q as l, R as u, S as d, U as f, W as p, X as m, Y as h, _ as g, at as _, b as v, dt as y, et as b, h as ee, ht as x, i as te, it as S, j as C, m as w, mt as T, n as E, nt as D, p as O, st as k, tt as A, ut as j, w as M, y as ne } from "./client-DQIzjDBG.js";
2
- import { C as re, d as ie, h as ae, m as oe, o as se, p as ce, v as le, x as ue } from "./SvGrid.helpers-zBkDTryR.js";
2
+ import { C as re, d as ie, h as ae, m as oe, o as se, p as ce, v as le, x as ue } from "./SvGrid.helpers-B2GEKrxS.js";
3
3
  import { n as de, r as fe, t as pe } from "./editor-registry-DxGKqcvx.js";
4
4
  //#region ../grid/dist/SvGridCellEditor.svelte
5
5
  var N = u("<span class=\"sv-grid-chip sv-grid-chip-removable\"> <button type=\"button\" class=\"sv-grid-chip-remove\">×</button></span>"), P = u("<button type=\"button\" class=\"sv-grid-chip-commit\" aria-label=\"Commit chip selection\">Done</button>"), F = u("<div class=\"sv-grid-cell-editor sv-grid-cell-editor-chips\" role=\"group\"><div class=\"sv-grid-chips-row\"><!> <input class=\"sv-grid-chip-input\" type=\"text\"/> <!></div></div>"), I = u("<input type=\"checkbox\" class=\"sv-grid-fr-editor sv-grid-fr-checkbox\"/>"), L = u("<option> </option>"), R = u("<select class=\"sv-grid-cell-editor sv-grid-fr-editor\"></select>"), z = u("<input class=\"sv-grid-cell-editor sv-grid-fr-editor\"/>"), me = u("<button type=\"button\" class=\"sv-grid-checkbox\" role=\"checkbox\" aria-label=\"Edit checkbox value\"></button>"), he = u("<button type=\"button\" role=\"radio\">★</button>"), ge = u("<span class=\"sv-grid-rating-editor\" role=\"radiogroup\" aria-label=\"Rating\"><!> <button type=\"button\" aria-label=\"Clear rating\" class=\"sv-grid-rating-clear\">×</button></span>"), _e = u("<textarea class=\"sv-grid-cell-editor sv-grid-cell-editor-textarea\" rows=\"4\"></textarea>"), ve = u("<button type=\"button\" class=\"sv-grid-autocomplete-option\" role=\"option\"> </button>"), ye = u("<div class=\"sv-grid-autocomplete-list\" role=\"listbox\"></div>"), be = u("<div class=\"sv-grid-autocomplete\"><input class=\"sv-grid-cell-editor sv-grid-cell-editor-autocomplete\" type=\"text\"/> <!></div>"), xe = u("<input type=\"color\"/>"), Se = u("<textarea class=\"sv-grid-cell-editor sv-grid-cell-editor-text sv-grid-cell-editor-multiline\"></textarea>"), Ce = u("<input/>");
@@ -118,6 +118,10 @@ function B(r, u) {
118
118
  value: e?.value,
119
119
  rowId: e?.rowId ?? "",
120
120
  columnId: e?.columnId ?? "",
121
+ columnDef: u.column.columnDef,
122
+ row: u.row.original,
123
+ typed: e?.typed === !0,
124
+ grid: V(),
121
125
  onChange: (e) => n(Y)(e),
122
126
  onCommit: (e) => {
123
127
  e !== void 0 && n(Y)(e), n(J)();
@@ -128,6 +132,9 @@ function B(r, u) {
128
132
  onCommitAndMove: (e, t) => {
129
133
  e !== void 0 && n(Y)(e), V().commitAndMoveByTab(t === -1);
130
134
  },
135
+ onCommitAndMoveDown: (e, t) => {
136
+ e !== void 0 && n(Y)(e), V().commitAndMoveByEnter(t === !0);
137
+ },
131
138
  onRequestClose: () => {
132
139
  V().editingCell = null, V().gridRootEl?.focus({ preventScroll: !0 });
133
140
  },
@@ -414,13 +421,15 @@ function B(r, u) {
414
421
  var r = a(), o = A(r), s = (e) => {
415
422
  var r = a(), o = A(r);
416
423
  {
417
- let e = k(() => V().editingCell?.value);
418
- t(o, () => n(W), (t, r) => {
419
- r(t, {
424
+ let e = k(() => V().editingCell?.value), r = k(() => u.column.columnDef.editorFormatString ?? "yyyy-MM-dd");
425
+ t(o, () => n(W), (t, i) => {
426
+ i(t, {
420
427
  get value() {
421
428
  return n(e);
422
429
  },
423
- formatString: "yyyy-MM-dd",
430
+ get formatString() {
431
+ return n(r);
432
+ },
424
433
  dropDownDisplayMode: "calendar",
425
434
  autoOpen: !0,
426
435
  block: !0,
@@ -441,13 +450,15 @@ function B(r, u) {
441
450
  var r = a(), o = A(r), s = (e) => {
442
451
  var r = a(), o = A(r);
443
452
  {
444
- let e = k(() => V().editingCell?.value);
445
- t(o, () => n(W), (t, r) => {
446
- r(t, {
453
+ let e = k(() => V().editingCell?.value), r = k(() => u.column.columnDef.editorFormatString ?? "yyyy-MM-dd HH:mm");
454
+ t(o, () => n(W), (t, i) => {
455
+ i(t, {
447
456
  get value() {
448
457
  return n(e);
449
458
  },
450
- formatString: "yyyy-MM-dd HH:mm",
459
+ get formatString() {
460
+ return n(r);
461
+ },
451
462
  dropDownDisplayMode: "both",
452
463
  autoOpen: !0,
453
464
  block: !0,
@@ -0,0 +1,189 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ //#region ../grid/dist/conditional-formatting.js
3
+ var t = /* @__PURE__ */ e({
4
+ computeColumnStat: () => r,
5
+ contrastText: () => c,
6
+ formatNeedsStats: () => h,
7
+ formatsNeedingStats: () => g,
8
+ lerpColor: () => l,
9
+ resolveCellFormat: () => m,
10
+ rgba: () => u
11
+ }), n = {
12
+ arrows: [
13
+ "↓",
14
+ "→",
15
+ "↑"
16
+ ],
17
+ traffic: [
18
+ "🔴",
19
+ "🟡",
20
+ "🟢"
21
+ ],
22
+ triangles: [
23
+ "▼",
24
+ "◆",
25
+ "▲"
26
+ ]
27
+ };
28
+ function r(e) {
29
+ let t = Infinity, n = -Infinity, r = !1;
30
+ for (let i of e) {
31
+ if (i == null || i === "") continue;
32
+ let e = Number(i);
33
+ Number.isFinite(e) && (r = !0, e < t && (t = e), e > n && (n = e));
34
+ }
35
+ return r ? {
36
+ min: t,
37
+ max: n
38
+ } : null;
39
+ }
40
+ function i(e, t, n) {
41
+ let r = 0;
42
+ for (let e = 0; e < t.length; e += 1) n >= t[e] && (r = e + 1);
43
+ return e[Math.min(e.length - 1, Math.max(0, r))] ?? e[e.length - 1];
44
+ }
45
+ function a(e) {
46
+ return e < 0 ? 0 : e > 1 ? 1 : e;
47
+ }
48
+ function o(e) {
49
+ let t = /^#?([0-9a-f]{6})$/i.exec(e.trim());
50
+ if (!t) return null;
51
+ let n = parseInt(t[1], 16);
52
+ return [
53
+ n >> 16 & 255,
54
+ n >> 8 & 255,
55
+ n & 255
56
+ ];
57
+ }
58
+ function s(e) {
59
+ return "#" + e.map((e) => Math.round(a(e / 255) * 255).toString(16).padStart(2, "0")).join("");
60
+ }
61
+ function c(e) {
62
+ let t = o(e);
63
+ if (!t) return null;
64
+ let n = t.map((e) => {
65
+ let t = e / 255;
66
+ return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
67
+ });
68
+ return .2126 * n[0] + .7152 * n[1] + .0722 * n[2] > .45 ? "#1e293b" : "#ffffff";
69
+ }
70
+ function l(e, t, n) {
71
+ let r = o(e), i = o(t);
72
+ if (!r || !i) return e;
73
+ let c = a(n);
74
+ return s([
75
+ r[0] + (i[0] - r[0]) * c,
76
+ r[1] + (i[1] - r[1]) * c,
77
+ r[2] + (i[2] - r[2]) * c
78
+ ]);
79
+ }
80
+ function u(e, t) {
81
+ let n = o(e);
82
+ return n ? `rgba(${n[0]}, ${n[1]}, ${n[2]}, ${a(t).toFixed(3)})` : e;
83
+ }
84
+ function d(e, t) {
85
+ let n = [...e].sort((e, t) => e.offset - t.offset);
86
+ if (n.length === 0) return "#000000";
87
+ if (t <= n[0].offset) return n[0].color;
88
+ let r = n[n.length - 1];
89
+ if (t >= r.offset) return r.color;
90
+ for (let e = 0; e < n.length - 1; e += 1) {
91
+ let r = n[e], i = n[e + 1];
92
+ if (t >= r.offset && t <= i.offset) {
93
+ let e = i.offset - r.offset || 1;
94
+ return l(r.color, i.color, (t - r.offset) / e);
95
+ }
96
+ }
97
+ return r.color;
98
+ }
99
+ function f(e, t) {
100
+ if (e.stops && e.stops.length >= 2) return d(e.stops, t);
101
+ let n = e.min ?? "#ffffff", r = e.max ?? "#000000";
102
+ return e.mid ? t <= .5 ? l(n, e.mid, t / .5) : l(e.mid, r, (t - .5) / .5) : l(n, r, t);
103
+ }
104
+ function p(e, t, n, r) {
105
+ let i;
106
+ if (e.compareColumn) {
107
+ let r = Number(n?.[e.compareColumn]);
108
+ if (!Number.isFinite(r) || r === 0) return null;
109
+ i = a(t / r);
110
+ } else if (e.type === "colorScale" && e.zeroCentred) {
111
+ let n = e.minValue ?? r?.min ?? t, o = e.maxValue ?? r?.max ?? t;
112
+ i = a(.5 + t / (Math.max(Math.abs(n), Math.abs(o)) || 1) / 2);
113
+ } else {
114
+ let n = r?.min ?? t, o = r?.max ?? t, s, c;
115
+ if (e.bounds === "percent") {
116
+ let t = o - n;
117
+ s = n + (e.minValue ?? 0) / 100 * t, c = n + (e.maxValue ?? 100) / 100 * t;
118
+ } else s = e.minValue ?? n, c = e.maxValue ?? o;
119
+ i = c === s ? .5 : a((t - s) / (c - s));
120
+ }
121
+ return e.type === "colorScale" && e.reverse && (i = 1 - i), i;
122
+ }
123
+ function m(e, t, r, o, s) {
124
+ let l = {};
125
+ for (let d of o) {
126
+ if (d.columns && !d.columns.includes(r)) continue;
127
+ let o = Number(e);
128
+ if (d.type === "rule") {
129
+ if (d.when({
130
+ value: e,
131
+ row: t
132
+ })) {
133
+ if (d.background && (l.background = d.background, !d.color)) {
134
+ let e = c(d.background);
135
+ e && (l.color = e);
136
+ }
137
+ d.color && (l.color = d.color), d.fontWeight != null && (l.fontWeight = d.fontWeight), d.icon && (l.icon = d.icon);
138
+ }
139
+ continue;
140
+ }
141
+ if (!(e == null || e === "" || !Number.isFinite(o))) {
142
+ if (d.type === "colorScale") {
143
+ let n = p(d, o, t, s);
144
+ if (n == null) continue;
145
+ if (d.mode === "alpha") {
146
+ let [e, t] = d.alphaBounds ?? [.05, .85];
147
+ l.background = u(d.base ?? "#2563eb", e + (t - e) * n);
148
+ } else {
149
+ l.background = f(d, n);
150
+ let e = c(l.background);
151
+ e && (l.color = e);
152
+ }
153
+ d.tooltip === "value" ? l.title = String(e) : d.tooltip === "percent" && (l.title = `${Math.round(n * 100)}%`);
154
+ } else if (d.type === "dataBar") {
155
+ let e;
156
+ if (d.compareColumn) {
157
+ let n = p(d, o, t, s);
158
+ if (n == null) continue;
159
+ e = n * 100;
160
+ } else if (d.bounds === "percent") {
161
+ let n = p(d, o, t, s);
162
+ if (n == null) continue;
163
+ e = n * 100;
164
+ } else {
165
+ let t = d.minValue ?? Math.min(0, s?.min ?? 0), n = (d.maxValue ?? s?.max ?? o) - t || 1;
166
+ e = a((o - t) / n) * 100;
167
+ }
168
+ l.dataBar = {
169
+ percent: e,
170
+ color: o < 0 ? d.negativeColor ?? "#ef4444" : d.color,
171
+ fromRight: !1,
172
+ gradient: d.gradient
173
+ }, d.showValue === !1 && (l.color = "transparent");
174
+ } else if (d.type === "iconSet") {
175
+ let e = n[d.set ?? "arrows"];
176
+ l.icon = i(e, d.thresholds, o), d.iconOnly && (l.iconOnly = !0);
177
+ }
178
+ }
179
+ }
180
+ return l;
181
+ }
182
+ function h(e) {
183
+ return !(e.type !== "colorScale" && e.type !== "dataBar" || "compareColumn" in e && e.compareColumn || e.minValue != null && e.maxValue != null && (e.bounds ?? "absolute") === "absolute");
184
+ }
185
+ function g(e) {
186
+ return e.some(h);
187
+ }
188
+ //#endregion
189
+ export { t };
@@ -0,0 +1,20 @@
1
+ import { G as e, at as t } from "./client-DQIzjDBG.js";
2
+ //#region ../grid/dist/grid-extension.svelte.js
3
+ var n = t(null);
4
+ function r(t, a) {
5
+ let o = e(n)?.column;
6
+ if (!o) return t;
7
+ let s = a ?? i(t);
8
+ return t.map((e) => e?.columns?.length ? {
9
+ ...e,
10
+ columns: r(e.columns, s)
11
+ } : e?.fieldType ? o(e, s) : e);
12
+ }
13
+ function i(e) {
14
+ return e.flatMap((e) => e?.columns?.length ? i(e.columns) : [e]);
15
+ }
16
+ function a() {
17
+ return e(n);
18
+ }
19
+ //#endregion
20
+ export { a as n, r as t };