@vuu-ui/vuu-data-react 3.5.2 → 3.5.3

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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.5.2",
2
+ "version": "3.5.3",
3
3
  "main": "./src/index.js",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
@@ -10,21 +10,21 @@
10
10
  "type-defs": "node ../../scripts/build-type-defs.mjs"
11
11
  },
12
12
  "devDependencies": {
13
- "@vuu-ui/vuu-data-types": "3.5.2",
14
- "@vuu-ui/vuu-filter-types": "3.5.2",
15
- "@vuu-ui/vuu-protocol-types": "3.5.2",
16
- "@vuu-ui/vuu-table-types": "3.5.2"
13
+ "@vuu-ui/vuu-data-types": "3.5.3",
14
+ "@vuu-ui/vuu-filter-types": "3.5.3",
15
+ "@vuu-ui/vuu-protocol-types": "3.5.3",
16
+ "@vuu-ui/vuu-table-types": "3.5.3"
17
17
  },
18
18
  "dependencies": {
19
- "@vuu-ui/vuu-context-menu": "3.5.2",
20
- "@vuu-ui/vuu-data-remote": "3.5.2",
21
- "@vuu-ui/vuu-filter-parser": "3.5.2",
22
- "@vuu-ui/vuu-filters": "3.5.2",
23
- "@vuu-ui/vuu-layout": "3.5.2",
24
- "@vuu-ui/vuu-notifications": "3.5.2",
25
- "@vuu-ui/vuu-ui-controls": "3.5.2",
26
- "@vuu-ui/vuu-utils": "3.5.2",
27
- "@vuu-ui/vuu-table": "3.5.2",
19
+ "@vuu-ui/vuu-context-menu": "3.5.3",
20
+ "@vuu-ui/vuu-data-remote": "3.5.3",
21
+ "@vuu-ui/vuu-filter-parser": "3.5.3",
22
+ "@vuu-ui/vuu-filters": "3.5.3",
23
+ "@vuu-ui/vuu-layout": "3.5.3",
24
+ "@vuu-ui/vuu-notifications": "3.5.3",
25
+ "@vuu-ui/vuu-ui-controls": "3.5.3",
26
+ "@vuu-ui/vuu-utils": "3.5.3",
27
+ "@vuu-ui/vuu-table": "3.5.3",
28
28
  "@salt-ds/core": "1.54.1",
29
29
  "@salt-ds/styles": "0.2.1",
30
30
  "@salt-ds/window": "0.1.1"
@@ -21,6 +21,10 @@ function toTimeString(value, timestamp, { timeZone }, milliseconds = false) {
21
21
  if (isValidTimeString(timeString)) return timeString;
22
22
  }
23
23
  }
24
+ const BOOLEAN_TOGGLE_VALUES = [
25
+ true,
26
+ false
27
+ ];
24
28
  const getDataItemEditControl = ({ InputProps, TypeaheadProps, className, commitOnBlur, commitWhenCleared, dataDescriptor, editOperation = "update", errorMessage, labels, onCommit, table, values, variant })=>{
25
29
  const dataVariant = variant && "toggle" !== variant ? variant : void 0;
26
30
  const temporalInfo = getTemporalInfo(dataDescriptor);
@@ -82,6 +86,16 @@ const getDataItemEditControl = ({ InputProps, TypeaheadProps, className, commitO
82
86
  "data-edit-control": true
83
87
  });
84
88
  }
89
+ if ("toggle" === variant && "boolean" === dataDescriptor.serverDataType) return /*#__PURE__*/ jsx(ToggleFilter, {
90
+ className: className,
91
+ column: dataDescriptor.name,
92
+ "data-edit-control": true,
93
+ labels: labels,
94
+ onCommit: onCommit,
95
+ table: table,
96
+ values: values?.length ? values : BOOLEAN_TOGGLE_VALUES,
97
+ value: InputProps?.inputProps?.value ?? "all"
98
+ });
85
99
  if ("string" === dataDescriptor.serverDataType && table) if ("toggle" === variant && values?.length) return /*#__PURE__*/ jsx(ToggleFilter, {
86
100
  className: className,
87
101
  column: dataDescriptor.name,
@@ -2,6 +2,7 @@ import type { DataValueDescriptor, TableSchemaTable } from "@vuu-ui/vuu-data-typ
2
2
  import { type VuuTypeaheadInputProps } from "@vuu-ui/vuu-ui-controls";
3
3
  import { type CommitHandler } from "@vuu-ui/vuu-utils";
4
4
  import type { InputProps } from "@salt-ds/core";
5
+ import { type ToggleFilterValue } from "@vuu-ui/vuu-filters";
5
6
  /**
6
7
  * variant can be used to provide a rendering hint to the filter control rendered.
7
8
  * 'toggle' for A ToggleButtonGroup, only suitable for up to 3 value choices
@@ -33,9 +34,10 @@ export interface DataItemEditControlProps {
33
34
  * They will be validated against server with Typeahead service, so
34
35
  * unavailable options are not offered.
35
36
  * Recommended for toggle filters, not usually necessary for other
36
- * filter variants.
37
+ * filter variants. Boolean values are supported for toggle filters on
38
+ * boolean columns, where values default to [true, false].
37
39
  */
38
- values?: string[];
40
+ values?: ToggleFilterValue[];
39
41
  variant?: FilterControlVariant;
40
42
  }
41
43
  export type ValidationStatus = "initial" | true | string;