@tcn/ui-table 2.1.0 → 2.1.1
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/dist/components/table_filter_panel/field_filters/field_filter_props.d.ts +1 -0
- package/dist/components/table_filter_panel/field_filters/string_field_filter.d.ts +1 -1
- package/dist/components/table_filter_panel/field_filters/string_field_filter.js +12 -6
- package/dist/components/table_filter_panel/field_filters/string_field_filter.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FieldFilterProps } from "./field_filter_props.js";
|
|
3
|
-
export declare function StringFieldFilter({ fieldName, label }: FieldFilterProps): React.JSX.Element;
|
|
3
|
+
export declare function StringFieldFilter({ fieldName, label, operators }: FieldFilterProps): React.JSX.Element;
|
|
@@ -7,21 +7,27 @@ import { Title } from '@tcn/ui-typography';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { StringFieldFilterPresenter } from "./string_field_filter_presenter.js";
|
|
9
9
|
import { useFieldFilterStrategy } from "./use_field_filter_strategy.js";
|
|
10
|
-
const
|
|
10
|
+
const allOperators = ['is', 'isNot', 'has'];
|
|
11
|
+
const operatorSymbols = {
|
|
12
|
+
is: '=',
|
|
13
|
+
isNot: '!=',
|
|
14
|
+
has: ':',
|
|
15
|
+
};
|
|
11
16
|
const operatorLabels = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
is: 'is',
|
|
18
|
+
isNot: 'is not',
|
|
19
|
+
has: 'has',
|
|
15
20
|
};
|
|
16
|
-
export function StringFieldFilter({ fieldName, label }) {
|
|
21
|
+
export function StringFieldFilter({ fieldName, label, operators }) {
|
|
17
22
|
const presenter = useFieldFilterStrategy(StringFieldFilterPresenter, fieldName);
|
|
18
23
|
const value = useSignalValue(presenter.broadcasts.value);
|
|
19
24
|
const operator = useSignalValue(presenter.broadcasts.operator);
|
|
25
|
+
const availableOperators = operators || allOperators;
|
|
20
26
|
return (React.createElement(VStack, { gap: "4px" },
|
|
21
27
|
React.createElement(Box, { width: "flex" },
|
|
22
28
|
React.createElement(Title, { size: "md" }, label)),
|
|
23
29
|
React.createElement(HStack, { width: "flex" },
|
|
24
|
-
React.createElement(Select, { value: operator, onChange: value => presenter.setOperator(value), width: "65px" },
|
|
30
|
+
React.createElement(Select, { value: operator, onChange: value => presenter.setOperator(value), width: "65px" }, availableOperators.map(operator => (React.createElement(Option, { key: operator, value: operatorSymbols[operator], label: operatorLabels[operator] }, operatorLabels[operator])))),
|
|
25
31
|
React.createElement(Input, { type: "text", value: value ?? '', onChange: value => presenter.setValue(value) }),
|
|
26
32
|
React.createElement(Button, { onClick: () => presenter.setValue(null), hierarchy: "tertiary", disabled: value == null },
|
|
27
33
|
React.createElement(CrossCircleIcon, null)))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string_field_filter.js","sourceRoot":"","sources":["../../../../src/components/table_filter_panel/field_filters/string_field_filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,0BAA0B,EAAE,2CAAyF;AAG9H,OAAO,EAAE,sBAAsB,EAAE,uCAAqF;AAEtH,MAAM,
|
|
1
|
+
{"version":3,"file":"string_field_filter.js","sourceRoot":"","sources":["../../../../src/components/table_filter_panel/field_filters/string_field_filter.tsx"],"names":[],"mappings":"AAA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AAC,IAAI,EAAC,IAAI,IAAE,KAAK,CAAS,CAC5B;QACN,oBAAC,MAAM,IAAC,KAAK,EAAC,MAAM;YAClB,oBAAC,MAAM,IACL,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,KAA2B,CAAC,EACrE,KAAK,EAAC,MAAM,IAEX,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClC,oBAAC,MAAM,IACL,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC,EAChC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,IAE9B,cAAc,CAAC,QAAQ,CAAC,CAClB,CACV,CAAC,CACK;YACT,oBAAC,KAAK,IACJ,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,GAC5C;YACF,oBAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EACvC,SAAS,EAAC,UAAU,EACpB,QAAQ,EAAE,KAAK,IAAI,IAAI;gBAEvB,oBAAC,eAAe,OAAG,CACZ,CACF,CACF,CACV,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tcn/ui-table",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "TCN",
|
|
6
6
|
"description": "Blackcat UI Table",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@tcn/aip-160": "^1.2.2",
|
|
67
67
|
"@tcn/icons": "^2.0.0",
|
|
68
|
-
"@tcn/resource-store": "^2.
|
|
68
|
+
"@tcn/resource-store": "^2.3.0",
|
|
69
69
|
"@tcn/state": "^0.2.0",
|
|
70
70
|
"@tcn/ui-actions": "^3.0.1",
|
|
71
71
|
"@tcn/ui-core": "^3.0.0",
|