@vuu-ui/vuu-table-extras 3.4.1 → 3.5.0-beta.2

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 (94) hide show
  1. package/package.json +12 -12
  2. package/src/column-expression-input/useColumnExpressionSuggestionProvider.js +2 -2
  3. package/src/column-formatting-settings/ColumnFormattingPanel.js +12 -9
  4. package/src/column-formatting-settings/DateTimeFormattingSettings.js +107 -3
  5. package/src/column-formatting-settings/LongTypeFormattingSettings.js +8 -3
  6. package/src/freeze-control/FreezeControl.css.js +1 -2
  7. package/src/table-footer/TableFooter.js +3 -3
  8. package/types/column-formatting-settings/DateTimeFormattingSettings.d.ts +1 -1
  9. package/types/table-footer/TableFooter.d.ts +1 -1
  10. package/types/src/calculated-column/CalculatedColumnPanel.d.ts +0 -12
  11. package/types/src/calculated-column/useCalculatedColumnPanel.d.ts +0 -10
  12. package/types/src/calculated-column/useEditCalculatedColumn.d.ts +0 -13
  13. package/types/src/cell-edit-validators/CaseValidator.d.ts +0 -2
  14. package/types/src/cell-edit-validators/PatternValidator.d.ts +0 -2
  15. package/types/src/cell-edit-validators/index.d.ts +0 -2
  16. package/types/src/cell-renderers/background-cell/BackgroundCell.d.ts +0 -2
  17. package/types/src/cell-renderers/background-cell/BackgroundCellConfigurationEditor.d.ts +0 -2
  18. package/types/src/cell-renderers/background-cell/index.d.ts +0 -2
  19. package/types/src/cell-renderers/background-cell/useDirection.d.ts +0 -3
  20. package/types/src/cell-renderers/button-cell/IconButtonCell.d.ts +0 -6
  21. package/types/src/cell-renderers/dropdown-cell/DropdownCell.d.ts +0 -2
  22. package/types/src/cell-renderers/dropdown-cell/index.d.ts +0 -1
  23. package/types/src/cell-renderers/index.d.ts +0 -6
  24. package/types/src/cell-renderers/lookup-cell/LookupCell.d.ts +0 -2
  25. package/types/src/cell-renderers/lookup-cell/index.d.ts +0 -1
  26. package/types/src/cell-renderers/pct-progress-cell/PctProgressCell.d.ts +0 -2
  27. package/types/src/cell-renderers/pct-progress-cell/index.d.ts +0 -1
  28. package/types/src/cell-renderers/progress-cell/ProgressCell.d.ts +0 -1
  29. package/types/src/cell-renderers/progress-cell/index.d.ts +0 -1
  30. package/types/src/column-expression-input/ColumnExpressionInput.d.ts +0 -10
  31. package/types/src/column-expression-input/column-function-descriptors.d.ts +0 -15
  32. package/types/src/column-expression-input/column-language-parser/ColumnExpressionLanguage.d.ts +0 -2
  33. package/types/src/column-expression-input/column-language-parser/ColumnExpressionTreeWalker.d.ts +0 -57
  34. package/types/src/column-expression-input/column-language-parser/column-expression-parse-utils.d.ts +0 -5
  35. package/types/src/column-expression-input/column-language-parser/generated/column-parser.d.ts +0 -2
  36. package/types/src/column-expression-input/column-language-parser/generated/column-parser.terms.d.ts +0 -1
  37. package/types/src/column-expression-input/column-language-parser/index.d.ts +0 -3
  38. package/types/src/column-expression-input/column-language-parser/test.d.mts +0 -1
  39. package/types/src/column-expression-input/functionDocInfo.d.ts +0 -2
  40. package/types/src/column-expression-input/highlighting.d.ts +0 -1
  41. package/types/src/column-expression-input/index.d.ts +0 -4
  42. package/types/src/column-expression-input/theme.d.ts +0 -1
  43. package/types/src/column-expression-input/useColumnAutoComplete.d.ts +0 -6
  44. package/types/src/column-expression-input/useColumnExpressionEditor.d.ts +0 -25
  45. package/types/src/column-expression-input/useColumnExpressionSuggestionProvider.d.ts +0 -8
  46. package/types/src/column-formatting-settings/BaseNumericFormattingSettings.d.ts +0 -2
  47. package/types/src/column-formatting-settings/ColumnFormattingPanel.d.ts +0 -9
  48. package/types/src/column-formatting-settings/DateTimeFormattingSettings.d.ts +0 -3
  49. package/types/src/column-formatting-settings/LongTypeFormattingSettings.d.ts +0 -3
  50. package/types/src/column-formatting-settings/index.d.ts +0 -3
  51. package/types/src/column-menu/ColumnMenu.d.ts +0 -10
  52. package/types/src/column-menu/column-action-types.d.ts +0 -11
  53. package/types/src/column-menu/column-menu-utils.d.ts +0 -19
  54. package/types/src/column-menu/useColumnActions.d.ts +0 -16
  55. package/types/src/column-picker/ColumnModel.d.ts +0 -81
  56. package/types/src/column-picker/ColumnPicker.d.ts +0 -10
  57. package/types/src/column-picker/ColumnPickerAction.d.ts +0 -5
  58. package/types/src/column-picker/useColumnPicker.d.ts +0 -16
  59. package/types/src/column-picker/useTableColumnPicker.d.ts +0 -7
  60. package/types/src/column-picker/useTableColumnPickerDeprecated.d.ts +0 -14
  61. package/types/src/column-settings-panel/ColumnNameLabel.d.ts +0 -7
  62. package/types/src/column-settings-panel/ColumnSettingsPanel.d.ts +0 -5
  63. package/types/src/column-settings-panel/useColumnSettings.d.ts +0 -30
  64. package/types/src/csv-export/export-utils.d.ts +0 -42
  65. package/types/src/csv-export/index.d.ts +0 -2
  66. package/types/src/csv-export/useCsvExport.d.ts +0 -14
  67. package/types/src/csv-upload/CsvUpload.d.ts +0 -69
  68. package/types/src/csv-upload/data-upload-preview/DataUploadPreview.d.ts +0 -10
  69. package/types/src/csv-upload/data-upload-preview/useDataUploadPreview.d.ts +0 -17
  70. package/types/src/csv-upload/index.d.ts +0 -7
  71. package/types/src/csv-upload/parse/csv-constants.d.ts +0 -3
  72. package/types/src/csv-upload/parse/csv-errors.d.ts +0 -47
  73. package/types/src/csv-upload/parse/csv-parse.d.ts +0 -11
  74. package/types/src/csv-upload/parse/csv-schema-validation.d.ts +0 -18
  75. package/types/src/csv-upload/parse/csv-upload-utils.d.ts +0 -21
  76. package/types/src/csv-upload/parse/index.d.ts +0 -5
  77. package/types/src/csv-upload/useCsvUpload.d.ts +0 -43
  78. package/types/src/datasource-stats/DatasourceStats.d.ts +0 -17
  79. package/types/src/datasource-stats/useDatasourceStats.d.ts +0 -15
  80. package/types/src/freeze-control/FreezeControl.d.ts +0 -15
  81. package/types/src/freeze-control/FrozenBanner.d.ts +0 -6
  82. package/types/src/freeze-control/freezeControlBadge.d.ts +0 -11
  83. package/types/src/freeze-control/useFreezeControl.d.ts +0 -10
  84. package/types/src/index.d.ts +0 -26
  85. package/types/src/inline-add-row/InlineAddRow.d.ts +0 -3
  86. package/types/src/inline-add-row/index.d.ts +0 -2
  87. package/types/src/inline-add-row/useInlineAddRow.d.ts +0 -59
  88. package/types/src/tabbed-table-config-panel/TabbedTableConfigPanel.d.ts +0 -17
  89. package/types/src/tabbed-table-config-panel/TabbedTableSettingsAction.d.ts +0 -7
  90. package/types/src/tabbed-table-config-panel/useTabbedTableConfigPanel.d.ts +0 -13
  91. package/types/src/table-footer/TableFooter.d.ts +0 -10
  92. package/types/src/table-provider/TableProvider.d.ts +0 -18
  93. package/types/src/table-settings-panel/TableSettingsPanel.d.ts +0 -22
  94. package/types/src/table-settings-panel/useTableSettings.d.ts +0 -14
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.4.1",
2
+ "version": "3.5.0-beta.2",
3
3
  "author": "heswell",
4
4
  "main": "./src/index.js",
5
5
  "license": "Apache-2.0",
@@ -11,19 +11,19 @@
11
11
  "lezer-generate:column": "lezer-generator --output ./src/column-expression-input/column-language-parser/generated/column-parser.js ./src/column-expression-input/column-language-parser/grammar/column.grammar"
12
12
  },
13
13
  "devDependencies": {
14
- "@vuu-ui/vuu-filter-types": "3.4.1",
15
- "@vuu-ui/vuu-protocol-types": "3.4.1"
14
+ "@vuu-ui/vuu-filter-types": "3.5.0-beta.2",
15
+ "@vuu-ui/vuu-protocol-types": "3.5.0-beta.2"
16
16
  },
17
17
  "dependencies": {
18
- "@vuu-ui/vuu-codemirror": "3.4.1",
19
- "@vuu-ui/vuu-data-editing": "3.4.1",
20
- "@vuu-ui/vuu-data-react": "3.4.1",
21
- "@vuu-ui/vuu-data-types": "3.4.1",
22
- "@vuu-ui/vuu-table-types": "3.4.1",
23
- "@vuu-ui/vuu-popups": "3.4.1",
24
- "@vuu-ui/vuu-table": "3.4.1",
25
- "@vuu-ui/vuu-utils": "3.4.1",
26
- "@vuu-ui/vuu-ui-controls": "3.4.1",
18
+ "@vuu-ui/vuu-codemirror": "3.5.0-beta.2",
19
+ "@vuu-ui/vuu-data-editing": "3.5.0-beta.2",
20
+ "@vuu-ui/vuu-data-react": "3.5.0-beta.2",
21
+ "@vuu-ui/vuu-data-types": "3.5.0-beta.2",
22
+ "@vuu-ui/vuu-table-types": "3.5.0-beta.2",
23
+ "@vuu-ui/vuu-popups": "3.5.0-beta.2",
24
+ "@vuu-ui/vuu-table": "3.5.0-beta.2",
25
+ "@vuu-ui/vuu-utils": "3.5.0-beta.2",
26
+ "@vuu-ui/vuu-ui-controls": "3.5.0-beta.2",
27
27
  "@lezer/lr": "1.4.2",
28
28
  "@salt-ds/core": "1.54.1",
29
29
  "@salt-ds/lab": "1.0.0-alpha.83",
@@ -1,6 +1,6 @@
1
1
  import { AnnotationType, getRelationalOperators, numericOperators, stringOperators, toSuggestions } from "@vuu-ui/vuu-codemirror";
2
2
  import { getTypeaheadParams, useTypeaheadSuggestions } from "@vuu-ui/vuu-data-react";
3
- import { isNumericColumn, isTextColumn } from "@vuu-ui/vuu-utils";
3
+ import { isNumericColumn, isTemporalColumn, isTextColumn } from "@vuu-ui/vuu-utils";
4
4
  import { useCallback, useRef } from "react";
5
5
  import { columnFunctionDescriptors } from "./column-function-descriptors.js";
6
6
  import { functionDocInfo } from "./functionDocInfo.js";
@@ -64,7 +64,7 @@ const arithmeticOperators = [
64
64
  }
65
65
  ];
66
66
  const getOperators = (column)=>{
67
- if (void 0 === column || isNumericColumn(column)) return arithmeticOperators;
67
+ if (void 0 === column || isNumericColumn(column) || isTemporalColumn(column)) return arithmeticOperators;
68
68
  return NO_OPERATORS;
69
69
  };
70
70
  const getConditionOperators = (column)=>{
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { getCellRendererOptions, getConfigurationEditor, isColumnTypeRenderer, isTypeDescriptor } from "@vuu-ui/vuu-utils";
2
+ import { getCellRendererOptions, getConfigurationEditor, isColumnTypeRenderer, isTemporalColumn, isTypeDescriptor } from "@vuu-ui/vuu-utils";
3
3
  import { Dropdown, FormField, FormFieldLabel, Option } from "@salt-ds/core";
4
4
  import clsx from "clsx";
5
5
  import { useCallback, useMemo } from "react";
@@ -88,21 +88,24 @@ const ColumnFormattingPanel = ({ availableRenderers, className, column, onChange
88
88
  function getFormattingSettingsComponent(props) {
89
89
  const { column } = props;
90
90
  switch(column.serverDataType){
91
+ case "long":
92
+ return /*#__PURE__*/ jsx(LongTypeFormattingSettings, {
93
+ ...props
94
+ });
95
+ case "epochtimestamp":
96
+ case "epochtimestampnano":
97
+ return /*#__PURE__*/ jsx(DateTimeFormattingSettings, {
98
+ ...props
99
+ });
91
100
  case "double":
92
101
  case "scaleddecimal2":
93
102
  case "scaleddecimal4":
94
103
  case "scaleddecimal6":
95
104
  case "scaleddecimal8":
96
105
  case "int":
97
- return /*#__PURE__*/ jsx(BaseNumericFormattingSettings, {
106
+ return isTemporalColumn(column) ? /*#__PURE__*/ jsx(DateTimeFormattingSettings, {
98
107
  ...props
99
- });
100
- case "long":
101
- return /*#__PURE__*/ jsx(LongTypeFormattingSettings, {
102
- ...props
103
- });
104
- case "epochtimestamp":
105
- return /*#__PURE__*/ jsx(DateTimeFormattingSettings, {
108
+ }) : /*#__PURE__*/ jsx(BaseNumericFormattingSettings, {
106
109
  ...props
107
110
  });
108
111
  default:
@@ -1,5 +1,5 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { dateTimeLabelByType, defaultPatternsByType, fallbackDateTimePattern, getTypeFormattingFromColumn, isDatePattern, isTimePattern, supportedDateTimePatterns } from "@vuu-ui/vuu-utils";
2
+ import { dateTimeLabelByType, dateTimePattern, defaultPatternsByType, fallbackDateTimePattern, getTemporalInfo, getTypeFormattingFromColumn, isDatePattern, isTimePattern, supportedDateTimePatterns } from "@vuu-ui/vuu-utils";
3
3
  import { Dropdown, FormField, FormFieldLabel, Option, ToggleButton, ToggleButtonGroup } from "@salt-ds/core";
4
4
  import { useCallback, useMemo, useState } from "react";
5
5
  const toggleValues = [
@@ -7,6 +7,32 @@ const toggleValues = [
7
7
  "time",
8
8
  "both"
9
9
  ];
10
+ const DEFAULT = "default";
11
+ const fractionalSecondDigitOptions = [
12
+ DEFAULT,
13
+ "0",
14
+ "3",
15
+ "6",
16
+ "9"
17
+ ];
18
+ const timeZoneOptions = [
19
+ DEFAULT,
20
+ "local",
21
+ "UTC",
22
+ "Europe/London",
23
+ "Europe/Paris",
24
+ "America/New_York",
25
+ "Asia/Tokyo",
26
+ "Asia/Hong_Kong"
27
+ ];
28
+ const localeOptions = [
29
+ DEFAULT,
30
+ "en-GB",
31
+ "en-US",
32
+ "de-DE",
33
+ "fr-FR",
34
+ "ja-JP"
35
+ ];
10
36
  function getToggleValue(pattern) {
11
37
  return pattern.time ? pattern.date ? "both" : "time" : "date";
12
38
  }
@@ -20,7 +46,8 @@ const getSelectedPattern = (pattern)=>{
20
46
  };
21
47
  const DateTimeFormattingSettings = ({ column, onChangeFormatting: onChange })=>{
22
48
  const formatting = getTypeFormattingFromColumn(column);
23
- const { pattern = fallbackDateTimePattern } = formatting;
49
+ const temporalInfo = getTemporalInfo(column);
50
+ const { pattern = temporalInfo ? dateTimePattern(column.type, temporalInfo.kind) : fallbackDateTimePattern } = formatting;
24
51
  const toggleValue = useMemo(()=>getToggleValue(pattern), [
25
52
  pattern
26
53
  ]);
@@ -28,6 +55,26 @@ const DateTimeFormattingSettings = ({ column, onChangeFormatting: onChange })=>{
28
55
  time: pattern.time ?? defaultPatternsByType.time,
29
56
  date: pattern.date ?? defaultPatternsByType.date
30
57
  });
58
+ const onFractionalSecondDigitsChange = useCallback((_, [value])=>{
59
+ const { fractionalSecondDigits, ...rest } = formatting;
60
+ onChange(value === DEFAULT ? rest : {
61
+ ...rest,
62
+ fractionalSecondDigits: parseInt(value, 10)
63
+ });
64
+ }, [
65
+ formatting,
66
+ onChange
67
+ ]);
68
+ const onFormattingOptionChange = useCallback((key)=>(_, [value])=>{
69
+ const { [key]: _previous, ...rest } = formatting;
70
+ onChange(value === DEFAULT ? rest : {
71
+ ...rest,
72
+ [key]: value
73
+ });
74
+ }, [
75
+ formatting,
76
+ onChange
77
+ ]);
31
78
  const onPatternChange = useCallback((pattern)=>onChange({
32
79
  ...formatting,
33
80
  pattern
@@ -109,7 +156,64 @@ const DateTimeFormattingSettings = ({ column, onChangeFormatting: onChange })=>{
109
156
  }, i))
110
157
  })
111
158
  ]
112
- }, v))
159
+ }, v)),
160
+ pattern.time ? /*#__PURE__*/ jsxs(FormField, {
161
+ labelPlacement: "top",
162
+ children: [
163
+ /*#__PURE__*/ jsx(FormFieldLabel, {
164
+ children: "Fractional second digits"
165
+ }),
166
+ /*#__PURE__*/ jsx(Dropdown, {
167
+ onSelectionChange: onFractionalSecondDigitsChange,
168
+ selected: [
169
+ `${formatting.fractionalSecondDigits ?? DEFAULT}`
170
+ ],
171
+ value: `${formatting.fractionalSecondDigits ?? DEFAULT}`,
172
+ children: fractionalSecondDigitOptions.filter((digits)=>temporalInfo?.precision === "ns" || "6" !== digits && "9" !== digits).map((digits)=>/*#__PURE__*/ jsx(Option, {
173
+ value: digits,
174
+ children: digits
175
+ }, digits))
176
+ })
177
+ ]
178
+ }) : null,
179
+ /*#__PURE__*/ jsxs(FormField, {
180
+ labelPlacement: "top",
181
+ children: [
182
+ /*#__PURE__*/ jsx(FormFieldLabel, {
183
+ children: "Time zone"
184
+ }),
185
+ /*#__PURE__*/ jsx(Dropdown, {
186
+ onSelectionChange: onFormattingOptionChange("timeZone"),
187
+ selected: [
188
+ formatting.timeZone ?? DEFAULT
189
+ ],
190
+ value: formatting.timeZone ?? DEFAULT,
191
+ children: timeZoneOptions.map((timeZone)=>/*#__PURE__*/ jsx(Option, {
192
+ value: timeZone,
193
+ children: timeZone
194
+ }, timeZone))
195
+ })
196
+ ]
197
+ }),
198
+ /*#__PURE__*/ jsxs(FormField, {
199
+ labelPlacement: "top",
200
+ children: [
201
+ /*#__PURE__*/ jsx(FormFieldLabel, {
202
+ children: "Locale"
203
+ }),
204
+ /*#__PURE__*/ jsx(Dropdown, {
205
+ onSelectionChange: onFormattingOptionChange("locale"),
206
+ selected: [
207
+ formatting.locale ?? DEFAULT
208
+ ],
209
+ value: formatting.locale ?? DEFAULT,
210
+ children: localeOptions.map((locale)=>/*#__PURE__*/ jsx(Option, {
211
+ value: locale,
212
+ children: locale
213
+ }, locale))
214
+ })
215
+ ]
216
+ })
113
217
  ]
114
218
  });
115
219
  };
@@ -5,7 +5,8 @@ import { useWindow } from "@salt-ds/window";
5
5
  import { useCallback } from "react";
6
6
  import { BaseNumericFormattingSettings } from "./BaseNumericFormattingSettings.js";
7
7
  import LongTypeFormattingSettings from "./LongTypeFormattingSettings.css";
8
- import { isTypeDescriptor } from "@vuu-ui/vuu-utils";
8
+ import { isTemporalColumn, isTypeDescriptor } from "@vuu-ui/vuu-utils";
9
+ import { DateTimeFormattingSettings } from "./DateTimeFormattingSettings.js";
9
10
  const classBase = "vuuLongColumnFormattingSettings";
10
11
  const LongTypeFormattingSettings_LongTypeFormattingSettings = (props)=>{
11
12
  const targetWindow = useWindow();
@@ -41,7 +42,9 @@ const LongTypeFormattingSettings_LongTypeFormattingSettings = (props)=>{
41
42
  })
42
43
  ]
43
44
  }),
44
- /*#__PURE__*/ jsx(BaseNumericFormattingSettings, {
45
+ isTemporalColumn(column) ? /*#__PURE__*/ jsx(DateTimeFormattingSettings, {
46
+ ...props
47
+ }) : /*#__PURE__*/ jsx(BaseNumericFormattingSettings, {
45
48
  ...props
46
49
  })
47
50
  ]
@@ -49,6 +52,8 @@ const LongTypeFormattingSettings_LongTypeFormattingSettings = (props)=>{
49
52
  };
50
53
  const toggleValues = [
51
54
  "number",
52
- "date/time"
55
+ "date/time",
56
+ "date",
57
+ "time"
53
58
  ];
54
59
  export { LongTypeFormattingSettings_LongTypeFormattingSettings as LongTypeFormattingSettings };
@@ -70,8 +70,7 @@ const css = `
70
70
  }
71
71
 
72
72
  .vuuFreezeControl-customBadge-flashing {
73
- animation: flashGreenRed var(--freeze-control-flash-duration, .25s)
74
- steps(1, end) infinite;
73
+ animation: flashGreenRed var(--freeze-control-flash-duration, .25s) steps(1, end) infinite;
75
74
  }
76
75
 
77
76
  .vuuFreezeControl-customBadge[data-overflow="true"] {
@@ -4,10 +4,10 @@ import { useComponentCssInjection } from "@salt-ds/styles";
4
4
  import { useWindow } from "@salt-ds/window";
5
5
  import TableFooter from "./TableFooter.css";
6
6
  const classBase = "vuuTableFooter";
7
- const TableFooterTray = ({ children, position = 'end' })=>/*#__PURE__*/ jsx("div", {
7
+ const TableFooterTray = ({ children, position = "end" })=>/*#__PURE__*/ jsx("div", {
8
8
  className: clsx(`${classBase}Tray`, {
9
- [`${classBase}Tray-center`]: 'center' === position,
10
- [`${classBase}Tray-end`]: 'end' === position
9
+ [`${classBase}Tray-center`]: "center" === position,
10
+ [`${classBase}Tray-end`]: "end" === position
11
11
  }),
12
12
  children: children
13
13
  });
@@ -1,3 +1,3 @@
1
- import { FormattingSettingsProps } from "@vuu-ui/vuu-table-types";
1
+ import type { FormattingSettingsProps } from "@vuu-ui/vuu-table-types";
2
2
  import React from "react";
3
3
  export declare const DateTimeFormattingSettings: React.FC<FormattingSettingsProps>;
@@ -3,7 +3,7 @@ export interface TableFooterProps extends HTMLAttributes<HTMLDivElement> {
3
3
  onInvokeAction?: (action: string) => void;
4
4
  tooltrayActions?: ReactNode;
5
5
  }
6
- export declare const TableFooterTray: ({ children, position }: {
6
+ export declare const TableFooterTray: ({ children, position, }: {
7
7
  children: ReactNode;
8
8
  position?: "center" | "end";
9
9
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +0,0 @@
1
- import { HTMLAttributes } from "react";
2
- import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
3
- import { VuuColumnDataType, VuuTable } from "@vuu-ui/vuu-protocol-types";
4
- import { ColumnModel } from "../column-picker/ColumnModel";
5
- export interface CalculatedColumnPanelProps extends HTMLAttributes<HTMLDivElement> {
6
- column: ColumnDescriptor;
7
- columnModel: ColumnModel;
8
- onChangeColumn: (column: ColumnDescriptor) => void;
9
- onChangeServerDataType?: (name: VuuColumnDataType) => void;
10
- vuuTable: VuuTable;
11
- }
12
- export declare const CalculatedColumnPanel: ({ column: columnProp, columnModel, onChangeColumn, onChangeServerDataType: onChangeServerDataTypeProp, vuuTable, }: CalculatedColumnPanelProps) => import("react").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
- import { FormEventHandler, SyntheticEvent } from "react";
3
- import { CalculatedColumnPanelProps } from "./CalculatedColumnPanel";
4
- export type ColumnExpressionHookProps = Pick<CalculatedColumnPanelProps, "column" | "onChangeColumn" | "onChangeServerDataType">;
5
- export declare const useCalculatedColumnPanel: ({ column: columnProp, onChangeColumn, onChangeServerDataType: onChangeServerDataTypeProp, }: ColumnExpressionHookProps) => {
6
- column: ColumnDescriptor;
7
- onChangeExpression: (value: string) => void;
8
- onChangeName: FormEventHandler;
9
- onChangeServerDataType: (_e: SyntheticEvent, [serverDataType]: string[]) => void;
10
- };
@@ -1,13 +0,0 @@
1
- import { VuuTable } from "@vuu-ui/vuu-protocol-types";
2
- import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
3
- import { ColumnModel } from "../column-picker/ColumnModel";
4
- export interface EditCalculatedColumnProps {
5
- calculatedColumn?: ColumnDescriptor;
6
- columnModel: ColumnModel;
7
- onSaveColumn?: (caclulatedColumn: ColumnDescriptor) => void;
8
- vuuTable?: VuuTable;
9
- }
10
- export declare const useEditCalculatedColumn: ({ calculatedColumn, columnModel, onSaveColumn, vuuTable, }: EditCalculatedColumnProps) => {
11
- onCreateCalculatedColumn: () => void;
12
- onEditCalculatedColumn: () => void;
13
- };
@@ -1,2 +0,0 @@
1
- import { EditRuleValidator } from "@vuu-ui/vuu-data-types";
2
- export declare const CaseValidator: EditRuleValidator;
@@ -1,2 +0,0 @@
1
- import { EditRuleValidator } from "@vuu-ui/vuu-data-types";
2
- export declare const PatternValidator: EditRuleValidator;
@@ -1,2 +0,0 @@
1
- export * from "./CaseValidator";
2
- export * from "./PatternValidator";
@@ -1,2 +0,0 @@
1
- import { TableCellRendererProps } from "@vuu-ui/vuu-table-types";
2
- export declare const BackgroundCell: import("react").MemoExoticComponent<({ column, dataRow, }: TableCellRendererProps) => import("react").JSX.Element>;
@@ -1,2 +0,0 @@
1
- import { ConfigurationEditorProps } from "@vuu-ui/vuu-utils";
2
- export declare const BackgroundCellConfigurationEditor: ({ column, onChangeRendering, }: ConfigurationEditorProps) => import("react").JSX.Element;
@@ -1,2 +0,0 @@
1
- export * from "./BackgroundCell";
2
- export * from "./BackgroundCellConfigurationEditor";
@@ -1,3 +0,0 @@
1
- import { RuntimeColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
- import { valueChangeDirection } from "@vuu-ui/vuu-utils";
3
- export declare function useDirection(key: string, value: unknown, column: RuntimeColumnDescriptor): valueChangeDirection;
@@ -1,6 +0,0 @@
1
- import { TableCellRendererProps } from "@vuu-ui/vuu-table-types";
2
- /**
3
- * To assign an icon to the cell, give the columndescriptor
4
- * a className. In css, assign an icon variable to --vuu-svg-icon.
5
- */
6
- export declare const IconButtonCell: ({ column, dataRow }: TableCellRendererProps) => import("react").JSX.Element;
@@ -1,2 +0,0 @@
1
- import { TableCellRendererProps } from "@vuu-ui/vuu-table-types";
2
- export declare const DropdownCell: import("react").MemoExoticComponent<({ column, dataRow, editedDuringCurrentSession, onEdit, }: TableCellRendererProps) => import("react").JSX.Element>;
@@ -1 +0,0 @@
1
- export * from "./DropdownCell";
@@ -1,6 +0,0 @@
1
- export * from "./background-cell";
2
- export * from "./dropdown-cell";
3
- export * from "./lookup-cell";
4
- export * from "./pct-progress-cell";
5
- export * from "./progress-cell";
6
- export { IconButtonCell } from "./button-cell/IconButtonCell";
@@ -1,2 +0,0 @@
1
- import { TableCellRendererProps } from "@vuu-ui/vuu-table-types";
2
- export declare const LookupCell: import("react").MemoExoticComponent<({ column, dataRow, }: TableCellRendererProps) => import("react").JSX.Element>;
@@ -1 +0,0 @@
1
- export * from "./LookupCell";
@@ -1,2 +0,0 @@
1
- import { TableCellProps } from "@vuu-ui/vuu-table-types";
2
- export declare const PctProgressCell: ({ column, dataRow }: TableCellProps) => import("react").JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./PctProgressCell";
@@ -1 +0,0 @@
1
- export * from "./ProgressCell";
@@ -1,10 +0,0 @@
1
- import { HTMLAttributes } from "react";
2
- import { ColumnDefinitionExpression } from "./column-language-parser";
3
- import { ExpressionSuggestionConsumer } from "./useColumnExpressionEditor";
4
- export type ColumnExpressionSubmitHandler = (source: string, expression: ColumnDefinitionExpression | undefined) => void;
5
- export interface ColumnExpressionInputProps extends ExpressionSuggestionConsumer, Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
6
- onChange?: (source: string) => void;
7
- onSubmitExpression?: ColumnExpressionSubmitHandler;
8
- source?: string;
9
- }
10
- export declare const ColumnExpressionInput: import("react").MemoExoticComponent<({ onChange, onSubmitExpression, source, suggestionProvider, }: ColumnExpressionInputProps) => import("react").JSX.Element>;
@@ -1,15 +0,0 @@
1
- export type ColumnFunctionDescriptor = {
2
- accepts: "string" | "number" | "boolean" | "any" | Array<"string" | "number" | "boolean">;
3
- description: string;
4
- example: {
5
- expression: string;
6
- result: string;
7
- };
8
- name: string;
9
- params: {
10
- count?: number;
11
- description: string;
12
- };
13
- type: "string" | "number" | "boolean" | "variable";
14
- };
15
- export declare const columnFunctionDescriptors: ColumnFunctionDescriptor[];
@@ -1,2 +0,0 @@
1
- import { LanguageSupport } from "@vuu-ui/vuu-codemirror";
2
- export declare const columnExpressionLanguageSupport: () => LanguageSupport;
@@ -1,57 +0,0 @@
1
- import type { Tree } from "@vuu-ui/vuu-codemirror";
2
- type expressionType = "arithmeticExpression" | "booleanCondition" | "booleanLiteralExpression" | "callExpression" | "colExpression" | "conditionalExpression" | "numericLiteralExpression" | "relationalExpression" | "stringLiteralExpression" | "unknown";
3
- type arithmeticOp = "*" | "/" | "+" | "-" | "unknown";
4
- type booleanOp = "and" | "or";
5
- type relationalOp = "=" | "!=" | ">" | ">=" | "<" | "<=" | "unknown";
6
- export interface Expression {
7
- type: expressionType;
8
- expressions?: Expression[];
9
- toJSON?: () => unknown;
10
- value?: string | number | boolean;
11
- }
12
- interface BooleanLiteralExpression {
13
- type: "booleanLiteralExpression";
14
- value: boolean;
15
- }
16
- interface NumericLiteralExpression {
17
- type: "numericLiteralExpression";
18
- value: number;
19
- }
20
- interface StringLiteralExpression {
21
- type: "stringLiteralExpression";
22
- value: string;
23
- }
24
- interface ArithmeticExpression extends Expression {
25
- expressions: [Expression, Expression];
26
- op: arithmeticOp;
27
- type: "arithmeticExpression";
28
- }
29
- interface BooleanCondition extends Expression {
30
- expressions: Expression[];
31
- op: booleanOp;
32
- type: "booleanCondition";
33
- }
34
- interface RelationalExpression extends Expression {
35
- expressions: Expression[];
36
- op: relationalOp;
37
- type: "relationalExpression";
38
- }
39
- interface ColExpression extends Expression {
40
- column?: string;
41
- type: "colExpression";
42
- }
43
- interface CallExpression extends Expression {
44
- arguments: Expression[];
45
- functionName?: string;
46
- type: "callExpression";
47
- }
48
- type ConditionExpression = RelationalExpression | BooleanCondition;
49
- interface ConditionalExpression extends Expression {
50
- type: "conditionalExpression";
51
- condition: ConditionExpression;
52
- truthyExpression: Expression;
53
- falsyExpression: Expression;
54
- }
55
- export type ColumnDefinitionExpression = ArithmeticExpression | BooleanLiteralExpression | CallExpression | ColExpression | ConditionalExpression | NumericLiteralExpression | StringLiteralExpression;
56
- export declare const walkTree: (tree: Tree, source: string) => ColumnDefinitionExpression;
57
- export {};
@@ -1,5 +0,0 @@
1
- import type { SyntaxNode } from "@vuu-ui/vuu-codemirror";
2
- export declare const ColumnNamedTerms: readonly string[];
3
- export declare const isCompleteExpression: (src: string) => boolean;
4
- export declare const lastNamedChild: (node: SyntaxNode) => SyntaxNode | null;
5
- export declare const isCompleteRelationalExpression: (node?: SyntaxNode) => boolean;
@@ -1,2 +0,0 @@
1
- import { LRParser } from "@lezer/lr";
2
- export declare const parser: LRParser;
@@ -1 +0,0 @@
1
- export declare const ColumnDefinitionExpression = 1, Column = 2, Number = 3, String = 4, True = 5, False = 6, ParenthesizedExpression = 7, OpenBrace = 8, CloseBrace = 9, ArithmeticExpression = 10, Divide = 11, Times = 12, Plus = 13, Minus = 14, ConditionalExpression = 15, If = 16, RelationalExpression = 17, RelationalOperator = 18, AndCondition = 19, OrCondition = 20, Comma = 21, CallExpression = 22, Function = 23, ArgList = 24;
@@ -1,3 +0,0 @@
1
- export * from "./ColumnExpressionLanguage";
2
- export * from "./ColumnExpressionTreeWalker";
3
- export * from "./column-expression-parse-utils";
@@ -1 +0,0 @@
1
- export declare const walkTree: (tree: any, source: any) => void;
@@ -1,2 +0,0 @@
1
- import { ColumnFunctionDescriptor } from "./column-function-descriptors";
2
- export declare const functionDocInfo: ({ name, description, example, params, type, }: ColumnFunctionDescriptor) => HTMLElement;
@@ -1 +0,0 @@
1
- export declare const vuuHighlighting: import("@codemirror/state").Extension;
@@ -1,4 +0,0 @@
1
- export * from "./ColumnExpressionInput";
2
- export * from "./column-language-parser";
3
- export * from "./useColumnExpressionEditor";
4
- export * from "./useColumnExpressionSuggestionProvider";
@@ -1 +0,0 @@
1
- export declare const vuuTheme: import("@codemirror/state").Extension;
@@ -1,6 +0,0 @@
1
- import { type CompletionSource } from "@vuu-ui/vuu-codemirror";
2
- import { type RefObject } from "react";
3
- import type { IExpressionSuggestionProvider } from "./useColumnExpressionEditor";
4
- export type ApplyCompletion = (mode?: "add" | "replace") => void;
5
- export type Operator = "";
6
- export declare const useColumnAutoComplete: (suggestionProvider: IExpressionSuggestionProvider, onSubmit: RefObject<ApplyCompletion>) => CompletionSource;
@@ -1,25 +0,0 @@
1
- import { Completion } from "@vuu-ui/vuu-codemirror";
2
- import { FocusEventHandler } from "react";
3
- import { ColumnExpressionInputProps } from "./ColumnExpressionInput";
4
- export type ColumnExpressionOperator = "Times" | "Divide" | "Minus" | "Plus";
5
- export type ColumnExpressionSuggestionType = "column" | "columnValue" | "expression" | "condition-operator" | "operator" | "relational-operator";
6
- export type ColumnExpressionSuggestionOptions = {
7
- columnName?: string;
8
- functionName?: string;
9
- operator?: ColumnExpressionOperator;
10
- prefix?: string;
11
- startsWith?: string;
12
- selection?: string[];
13
- };
14
- export interface IExpressionSuggestionProvider {
15
- getSuggestions: (valueType: ColumnExpressionSuggestionType, options?: ColumnExpressionSuggestionOptions) => Promise<Completion[]>;
16
- isPartialMatch: (valueType: ColumnExpressionSuggestionType, columnName?: string, text?: string | undefined) => Promise<boolean>;
17
- }
18
- export interface ExpressionSuggestionConsumer {
19
- suggestionProvider: IExpressionSuggestionProvider;
20
- }
21
- export declare const useColumnExpressionEditor: ({ onChange, onSubmitExpression, source, suggestionProvider, }: ColumnExpressionInputProps) => {
22
- editorRef: import("react").RefObject<HTMLDivElement | null>;
23
- clearInput: () => void;
24
- onBlur: FocusEventHandler;
25
- };
@@ -1,8 +0,0 @@
1
- import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
- import { VuuTable } from "@vuu-ui/vuu-protocol-types";
3
- import { IExpressionSuggestionProvider } from "./useColumnExpressionEditor";
4
- export interface SuggestionProviderHookProps {
5
- columns: readonly ColumnDescriptor[];
6
- table: VuuTable;
7
- }
8
- export declare const useColumnExpressionSuggestionProvider: ({ columns, table, }: SuggestionProviderHookProps) => IExpressionSuggestionProvider;
@@ -1,2 +0,0 @@
1
- import { FormattingSettingsProps } from "@vuu-ui/vuu-table-types";
2
- export declare const BaseNumericFormattingSettings: ({ column, onChangeFormatting: onChange, }: FormattingSettingsProps) => import("react").JSX.Element;
@@ -1,9 +0,0 @@
1
- import { ColumnDescriptor, ColumnTypeRendering, FormattingSettingsProps } from "@vuu-ui/vuu-table-types";
2
- import { CellRendererDescriptor } from "@vuu-ui/vuu-utils";
3
- import { HTMLAttributes } from "react";
4
- export interface ColumnFormattingPanelProps extends HTMLAttributes<HTMLDivElement>, FormattingSettingsProps {
5
- availableRenderers: CellRendererDescriptor[];
6
- column: ColumnDescriptor;
7
- onChangeRendering: (renderProps: ColumnTypeRendering) => void;
8
- }
9
- export declare const ColumnFormattingPanel: ({ availableRenderers, className, column, onChangeFormatting, onChangeColumnType, onChangeRendering, ...htmlAttributes }: ColumnFormattingPanelProps) => import("react").JSX.Element;
@@ -1,3 +0,0 @@
1
- import { FormattingSettingsProps } from "@vuu-ui/vuu-table-types";
2
- import React from "react";
3
- export declare const DateTimeFormattingSettings: React.FC<FormattingSettingsProps>;