@servicetitan/table 24.3.1 → 25.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/demo/filters/single-select-filter.d.ts.map +1 -1
- package/dist/demo/filters/single-select-filter.js +1 -4
- package/dist/demo/filters/single-select-filter.js.map +1 -1
- package/dist/demo/overview/table.d.ts +2 -0
- package/dist/demo/overview/table.d.ts.map +1 -1
- package/dist/demo/overview/table.js +16 -4
- package/dist/demo/overview/table.js.map +1 -1
- package/dist/editable-cell/index.d.ts +0 -2
- package/dist/editable-cell/index.d.ts.map +1 -1
- package/dist/editable-cell/index.js +0 -2
- package/dist/editable-cell/index.js.map +1 -1
- package/dist/filters/single-select/single-select-filter.d.ts +1 -4
- package/dist/filters/single-select/single-select-filter.d.ts.map +1 -1
- package/dist/filters/single-select/single-select-filter.js +5 -6
- package/dist/filters/single-select/single-select-filter.js.map +1 -1
- package/package.json +7 -7
- package/src/demo/filters/single-select-filter.tsx +2 -5
- package/src/demo/overview/table.tsx +44 -6
- package/src/editable-cell/index.ts +0 -2
- package/src/filters/single-select/single-select-filter.tsx +2 -7
- package/dist/editable-cell/date-editable-cell.d.ts +0 -3
- package/dist/editable-cell/date-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/date-editable-cell.js +0 -14
- package/dist/editable-cell/date-editable-cell.js.map +0 -1
- package/dist/editable-cell/numeric-editable-cell.d.ts +0 -3
- package/dist/editable-cell/numeric-editable-cell.d.ts.map +0 -1
- package/dist/editable-cell/numeric-editable-cell.js +0 -15
- package/dist/editable-cell/numeric-editable-cell.js.map +0 -1
- package/src/editable-cell/date-editable-cell.tsx +0 -29
- package/src/editable-cell/numeric-editable-cell.tsx +0 -30
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"single-select-filter.d.ts","sourceRoot":"","sources":["../../../src/demo/filters/single-select-filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,EAAE,EAAY,MAAM,OAAO,CAAC;AAY9C,eAAO,MAAM,0BAA0B,EAAE,EAmDxC,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,
|
1
|
+
{"version":3,"file":"single-select-filter.d.ts","sourceRoot":"","sources":["../../../src/demo/filters/single-select-filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,EAAE,EAAY,MAAM,OAAO,CAAC;AAY9C,eAAO,MAAM,0BAA0B,EAAE,EAmDxC,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,EAoC7C,CAAC"}
|
@@ -27,10 +27,7 @@ export const SingleSelectCustomFilterExample = provide({
|
|
27
27
|
return singleSelectColumnMenuFilter({
|
28
28
|
options: [0, 1],
|
29
29
|
renderItem: item => (item ? 'Start with Vowel' : 'Start with Consonants'),
|
30
|
-
|
31
|
-
value,
|
32
|
-
operator: (madeIn) => madeIn ? (value ? isVowel(madeIn) : !isVowel(madeIn)) : false,
|
33
|
-
}),
|
30
|
+
filterOperator: (madeIn, value) => madeIn ? (value ? isVowel(madeIn) : !isVowel(madeIn)) : false,
|
34
31
|
});
|
35
32
|
}, []);
|
36
33
|
return (_jsxs(Fragment, { children: [_jsxs(Banner, Object.assign({ title: "Default filter with single select", className: "m-b-2" }, { children: ["Single select filter allows to choose one option from the provided list. You can pass simple options (string or number) or complex objects", _jsx("br", {}), "Custom filter allows you to provide custom filtering options"] })), _jsxs(Table, Object.assign({ tableState: tableState, striped: false }, { children: [_jsx(TableColumn, { field: "ProductID", title: "ID", editable: false, width: "100px" }), _jsx(TableColumn, { field: "ProductName", title: "Product Name (custom single-select filter)", columnMenu: productNameCustomFilter })] }))] }));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"single-select-filter.js","sourceRoot":"","sources":["../../../src/demo/filters/single-select-filter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE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,eACL,MAAC,MAAM,kBAAC,KAAK,EAAC,mCAAmC,EAAC,SAAS,EAAC,OAAO,+JAG/D,cAAM,qEAED,EACT,MAAC,KAAK,kBAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,iBACzC,KAAC,WAAW,IAAC,KAAK,EAAC,WAAW,EAAC,KAAK,EAAC,IAAI,EAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAC,OAAO,GAAG,EAC3E,KAAC,WAAW,IACR,KAAK,EAAC,aAAa,EACnB,KAAK,EAAC,4CAA4C,EAClD,UAAU,EAAE,uBAAuB,GACrC,KACE,IACD,CACd,CAAC;AACN,CAAC,CAAC,CACL,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/demo/overview/table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmC,EAAE,EAAgB,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/demo/overview/table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmC,EAAE,EAAgB,MAAM,OAAO,CAAC;AAQ1E,OAAO,EAIH,cAAc,EAWjB,MAAM,OAAO,CAAC;AA6Cf,eAAO,MAAM,gBAAgB,gEAE3B,CAAC;AA0BH,MAAM,WAAW,iBAAiB;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA+H9C,CAAC"}
|
@@ -2,12 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, cloneElement, Fragment } from 'react';
|
3
3
|
import { provide, useDependencies } from '@servicetitan/react-ioc';
|
4
4
|
import { observer } from 'mobx-react';
|
5
|
-
import { Stack, ButtonGroup, Button, Tag } from '@servicetitan/design-system';
|
6
|
-
import { Table, TableColumn, TableCell, TextEditableCell,
|
5
|
+
import { Stack, ButtonGroup, Button, Tag, DatePicker } from '@servicetitan/design-system';
|
6
|
+
import { Table, TableColumn, TableCell, TextEditableCell, BooleanEditableCell, getSelectEditableCell, DateRangeColumnMenuFilter, StandardColumnMenuFilter, standardFilterWithMultiselect, multiSelectColumnMenuFilter, CurrencyRangeColumnMenuFilter, getEditableCell, } from '../..';
|
7
7
|
import { Export } from '../../export';
|
8
8
|
import { TableStore } from './table.store';
|
9
9
|
import { ActionsCell } from './actions-cell';
|
10
|
-
import { enumToOptions, getEnumKeys } from '@servicetitan/form';
|
10
|
+
import { NumberInput, enumToOptions, getEnumKeys } from '@servicetitan/form';
|
11
11
|
import { UserRole, Supplier } from './product';
|
12
12
|
const UserRoleColumnMenuFilter = multiSelectColumnMenuFilter(getEnumKeys(UserRole), userRole => (_jsx(Tag, Object.assign({ compact: true, color: UserRole[userRole] === UserRole.Owner ? 'success' : 'default' }, { children: userRole }))));
|
13
13
|
const AvailableForEditableCell = getSelectEditableCell({
|
@@ -24,6 +24,18 @@ const SupplierCell = props => {
|
|
24
24
|
}
|
25
25
|
return _jsx("td", { children: Supplier[dataItem[field]] });
|
26
26
|
};
|
27
|
+
// Implementation of a date editable cell utilizing getEditableCell
|
28
|
+
const DateEditor = observer(({ fieldState: { value, onChange, hasError }, className }) => {
|
29
|
+
return (_jsx("td", Object.assign({ className: className }, { children: _jsx(DatePicker, { value: value, onChange: onChange, error: hasError }) })));
|
30
|
+
});
|
31
|
+
export const DateEditableCell = getEditableCell({
|
32
|
+
editor: DateEditor,
|
33
|
+
});
|
34
|
+
// Implementation of a numeric editable cell utilizing getEditableCell
|
35
|
+
const NumberCellEditor = observer(({ fieldState: { value, hasError, onChange } }) => (_jsx("td", { children: _jsx(NumberInput, { onChange: onChange, type: "number", error: hasError, value: value, emptyValue: 0, min: 0, max: 1000, useEmptyThousandsSeparator: true, fluid: true, decimalPlaces: 2, useKeyboardNavigation: true }) })));
|
36
|
+
const NumericEditableCell = getEditableCell({
|
37
|
+
editor: getEditableCell({ editor: NumberCellEditor }),
|
38
|
+
});
|
27
39
|
export const TableExample = provide({
|
28
40
|
singletons: [TableStore],
|
29
41
|
})(observer((props) => {
|
@@ -39,6 +51,6 @@ export const TableExample = provide({
|
|
39
51
|
},
|
40
52
|
});
|
41
53
|
};
|
42
|
-
return (_jsxs(Fragment, { children: [_jsxs(Stack, Object.assign({ justifyContent: "space-between", alignContent: "center", className: "m-b-2" }, { children: [_jsx(Export, { totalCount: tableState.totalCount, exportPdf: tableState.exportPdf, exportExcel: tableState.exportExcel }), inEdit ? (_jsxs(ButtonGroup, { children: [_jsx(Button, Object.assign({ small: true, onClick: cancelAll, className: "m-r-2" }, { children: "Cancel All" })), _jsx(Button, Object.assign({ small: true, primary: true, onClick: saveAll }, { children: "Save All" }))] })) : (_jsx(Button, Object.assign({ small: true, primary: true, onClick: editAll }, { children: "Edit All" })))] })), _jsxs(Table, Object.assign({ tableState: tableState, striped: false, selectable: true, groupable: true, sortable: true, exportable: true, exportFileName: "Table.Export.Test...File.Name.01.01.2020..~!@#$%^(*_+';", cellRender: cellRender }, { children: [_jsx(TableColumn, { field: "ProductID", title: "ID", editable: false, width: "100px" }), _jsx(TableColumn, { field: "ProductName", title: "Product Name", cell: TextEditableCell, columnMenu: StandardColumnMenuFilter, width: "240px" }), _jsx(TableColumn, { field: "Supplier", title: "Supplier", cell: SupplierCell, columnMenu: StandardColumnMenuFilter, width: "150px" }), _jsx(TableColumn, { field: "MadeIn", title: "Made In", cell: TextEditableCell, columnMenu: madeInColumnMenu, width: "175px" }), _jsx(TableColumn, { field: "UnitsOnOrder", title: "First Ordered On", cell: DateEditableCell, columnMenu: DateRangeColumnMenuFilter, format: "{0:
|
54
|
+
return (_jsxs(Fragment, { children: [_jsxs(Stack, Object.assign({ justifyContent: "space-between", alignContent: "center", className: "m-b-2" }, { children: [_jsx(Export, { totalCount: tableState.totalCount, exportPdf: tableState.exportPdf, exportExcel: tableState.exportExcel }), inEdit ? (_jsxs(ButtonGroup, { children: [_jsx(Button, Object.assign({ small: true, onClick: cancelAll, className: "m-r-2" }, { children: "Cancel All" })), _jsx(Button, Object.assign({ small: true, primary: true, onClick: saveAll }, { children: "Save All" }))] })) : (_jsx(Button, Object.assign({ small: true, primary: true, onClick: editAll }, { children: "Edit All" })))] })), _jsxs(Table, Object.assign({ tableState: tableState, striped: false, selectable: true, groupable: true, sortable: true, exportable: true, exportFileName: "Table.Export.Test...File.Name.01.01.2020..~!@#$%^(*_+';", cellRender: cellRender }, { children: [_jsx(TableColumn, { field: "ProductID", title: "ID", editable: false, width: "100px" }), _jsx(TableColumn, { field: "ProductName", title: "Product Name", cell: TextEditableCell, columnMenu: StandardColumnMenuFilter, width: "240px" }), _jsx(TableColumn, { field: "Supplier", title: "Supplier", cell: SupplierCell, columnMenu: StandardColumnMenuFilter, width: "150px" }), _jsx(TableColumn, { field: "MadeIn", title: "Made In", cell: TextEditableCell, columnMenu: madeInColumnMenu, width: "175px" }), _jsx(TableColumn, { field: "UnitsOnOrder", title: "First Ordered On", cell: DateEditableCell, columnMenu: DateRangeColumnMenuFilter, format: "{0:MM/dd/yyyy}", width: "240px" }), _jsx(TableColumn, { field: "UnitPrice", title: "Unit Price", cell: NumericEditableCell, columnMenu: CurrencyRangeColumnMenuFilter, format: "{0:c}", width: "125px" }), _jsx(TableColumn, { field: "Discontinued", title: "Discontinued", cell: BooleanEditableCell, sortable: false, width: "125px" }), _jsx(TableColumn, { field: "AvailableFor", title: "Available For", cell: AvailableForEditableCell, columnMenu: UserRoleColumnMenuFilter, width: "240px" }), _jsx(TableColumn, Object.assign({ cell: ActionsCell, sortable: false }, (props.fixedWidthColumns ? { width: '125px' } : {})))] }))] }));
|
43
55
|
}));
|
44
56
|
//# sourceMappingURL=table.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/demo/overview/table.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAoB,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EAAE,gBAAgB,EAC5B,KAAK,EAAC,OAAO,GACf,EAEF,KAAC,WAAW,IACR,KAAK,EAAC,cAAc,EACpB,KAAK,EAAC,kBAAkB,EACxB,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,yBAAyB,EACrC,MAAM,EAAC,gBAAgB,EACvB,KAAK,EAAC,OAAO,GACf,EAEF,KAAC,WAAW,IACR,KAAK,EAAC,WAAW,EACjB,KAAK,EAAC,YAAY,EAClB,IAAI,EAAE,mBAAmB,EACzB,UAAU,EAAE,6BAA6B,EACzC,MAAM,EAAC,OAAO,EACd,KAAK,EAAC,OAAO,GACf,EAEF,KAAC,WAAW,IACR,KAAK,EAAC,cAAc,EACpB,KAAK,EAAC,cAAc,EACpB,IAAI,EAAE,mBAAmB,EACzB,QAAQ,EAAE,KAAK,EACf,KAAK,EAAC,OAAO,GACf,EAEF,KAAC,WAAW,IACR,KAAK,EAAC,cAAc,EACpB,KAAK,EAAC,eAAe,EACrB,IAAI,EAAE,wBAAwB,EAC9B,UAAU,EAAE,wBAAwB,EACpC,KAAK,EAAC,OAAO,GACf,EAEF,KAAC,WAAW,kBACR,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,KAAK,IACX,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACzD,KACE,IACD,CACd,CAAC;AACN,CAAC,CAAC,CACL,CAAC"}
|
@@ -1,8 +1,6 @@
|
|
1
1
|
export * from './get-action-cell';
|
2
2
|
export * from './get-editable-cell';
|
3
3
|
export * from './text-editable-cell';
|
4
|
-
export * from './numeric-editable-cell';
|
5
4
|
export * from './boolean-editable-cell';
|
6
|
-
export * from './date-editable-cell';
|
7
5
|
export * from './get-select-editable-cell';
|
8
6
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editable-cell/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editable-cell/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
|
@@ -1,8 +1,6 @@
|
|
1
1
|
export * from './get-action-cell';
|
2
2
|
export * from './get-editable-cell';
|
3
3
|
export * from './text-editable-cell';
|
4
|
-
export * from './numeric-editable-cell';
|
5
4
|
export * from './boolean-editable-cell';
|
6
|
-
export * from './date-editable-cell';
|
7
5
|
export * from './get-select-editable-cell';
|
8
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/editable-cell/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/editable-cell/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
|
@@ -4,10 +4,7 @@ export interface SingleSelectColumnMenuOptions<TV, TO = TV> {
|
|
4
4
|
options: TO[];
|
5
5
|
valueSelector?: (item: TO) => TV;
|
6
6
|
renderItem?: (item: TO) => ReactNode | string;
|
7
|
-
|
8
|
-
value: any;
|
9
|
-
operator: string | Function;
|
10
|
-
};
|
7
|
+
filterOperator?: (listItem: any, value: TV) => boolean;
|
11
8
|
}
|
12
9
|
export declare function singleSelectColumnMenuFilter<TV extends IdType, TO = TV>(props: SingleSelectColumnMenuOptions<TV, TO>): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
|
13
10
|
//# sourceMappingURL=single-select-filter.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"single-select-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/single-select/single-select-filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,SAAS,EAAM,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAiClD,MAAM,WAAW,6BAA6B,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE;IACtD,OAAO,EAAE,EAAE,EAAE,CAAC;IACd,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC;IACjC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,SAAS,GAAG,MAAM,CAAC;IAC9C,
|
1
|
+
{"version":3,"file":"single-select-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/single-select/single-select-filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,SAAS,EAAM,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAiClD,MAAM,WAAW,6BAA6B,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE;IACtD,OAAO,EAAE,EAAE,EAAE,CAAC;IACd,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC;IACjC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,SAAS,GAAG,MAAM,CAAC;IAC9C,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,KAAK,OAAO,CAAC;CAC1D;AAED,wBAAgB,4BAA4B,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,EACnE,KAAK,EAAE,6BAA6B,CAAC,EAAE,EAAE,EAAE,CAAC,sFA8B/C"}
|
@@ -17,14 +17,13 @@ export function singleSelectColumnMenuFilter(props) {
|
|
17
17
|
const FilterCell = ({ value, onChange }) => {
|
18
18
|
var _a;
|
19
19
|
const handleChange = (value, event) => {
|
20
|
+
var _a;
|
20
21
|
const filter = value === undefined
|
21
22
|
? { value: '', operator: '' }
|
22
|
-
:
|
23
|
-
|
24
|
-
:
|
25
|
-
|
26
|
-
operator: 'equals',
|
27
|
-
};
|
23
|
+
: {
|
24
|
+
value,
|
25
|
+
operator: (_a = props.filterOperator) !== null && _a !== void 0 ? _a : 'equals',
|
26
|
+
};
|
28
27
|
onChange(Object.assign(Object.assign({}, filter), { syntheticEvent: event }));
|
29
28
|
};
|
30
29
|
return (_jsx(SelectorRadio, { options: props.options, value: value === '' ? undefined : value, onChange: handleChange, renderer: props.renderItem, valueSelector: (_a = props.valueSelector) !== null && _a !== void 0 ? _a : (option => option) }));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"single-select-filter.js","sourceRoot":"","sources":["../../../src/filters/single-select/single-select-filter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAiC,MAAM,OAAO,CAAC;AAGjE,OAAO,EAAwB,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAE1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAUtE,MAAM,aAAsB,SAAQ,SAAgC;IAChE,MAAM;QACF,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAEhD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACjC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YACrD,OAAO;YACH,oDAAoD;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AQ,CAAC,WAAW,EAAE,KAAK,CAAC,GACjE,KALK,KAAK,CAMT,CACV,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AASD,MAAM,UAAU,4BAA4B,CACxC,KAA4C;IAE5C,MAAM,UAAU,GAA6B,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;;QACjE,MAAM,YAAY,GAAG,CAAC,KAAqB,EAAE,KAAuC,EAAE,EAAE;;YACpF,MAAM,MAAM,GACR,KAAK,KAAK,SAAS;gBACf,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;gBAC7B,CAAC,CAAC;oBACI,KAAK;oBACL,QAAQ,EAAE,MAAA,KAAK,CAAC,cAAc,mCAAI,QAAQ;iBAC7C,CAAC;YAEZ,QAAQ,iCACD,MAAM,KACT,cAAc,EAAE,KAAK,IACvB,CAAC;QACP,CAAC,CAAC;QAEF,OAAO,CACH,KAAC,aAAa,IACV,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,KAAK,EAAE,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EACvC,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,KAAK,CAAC,UAAU,EAC1B,aAAa,EAAE,MAAA,KAAK,CAAC,aAAa,mCAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,GAC1D,CACL,CAAC;IACN,CAAC,CAAC;IAEF,OAAO,4BAA4B,CAAC,UAAU,CAAC,CAAC;AACpD,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@servicetitan/table",
|
3
|
-
"version": "
|
3
|
+
"version": "25.0.0",
|
4
4
|
"description": "",
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/table",
|
6
6
|
"repository": {
|
@@ -32,14 +32,14 @@
|
|
32
32
|
"@progress/kendo-react-pdf": "^5.5.0",
|
33
33
|
"@progress/kendo-react-popup": "^5.5.0",
|
34
34
|
"@progress/kendo-react-treeview": "^5.5.0",
|
35
|
-
"@servicetitan/react-hooks": "^
|
35
|
+
"@servicetitan/react-hooks": "^3.0.0",
|
36
36
|
"classnames": "~2.3.1",
|
37
37
|
"memoize-one": "~6.0.0"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
-
"@servicetitan/data-query": "^
|
40
|
+
"@servicetitan/data-query": "^25.0.0",
|
41
41
|
"@servicetitan/design-system": ">=12.4.1",
|
42
|
-
"@servicetitan/form": "^
|
42
|
+
"@servicetitan/form": "^25.0.0",
|
43
43
|
"@servicetitan/react-ioc": "^21.6.0",
|
44
44
|
"@servicetitan/suppress-warnings": "^21.6.0",
|
45
45
|
"@types/accounting": "~0.4.2",
|
@@ -53,9 +53,9 @@
|
|
53
53
|
"react": "~17.0.2"
|
54
54
|
},
|
55
55
|
"peerDependencies": {
|
56
|
-
"@servicetitan/data-query": "^
|
56
|
+
"@servicetitan/data-query": "^25.0.0",
|
57
57
|
"@servicetitan/design-system": ">=12.4.1",
|
58
|
-
"@servicetitan/form": "^
|
58
|
+
"@servicetitan/form": "^25.0.0",
|
59
59
|
"@servicetitan/react-ioc": ">21.0.0",
|
60
60
|
"@servicetitan/suppress-warnings": ">21.0.0",
|
61
61
|
"accounting": "~0.4.1",
|
@@ -72,5 +72,5 @@
|
|
72
72
|
"cli": {
|
73
73
|
"webpack": false
|
74
74
|
},
|
75
|
-
"gitHead": "
|
75
|
+
"gitHead": "cdf8c0f396959190a404d1a601c46947a858a476"
|
76
76
|
}
|
@@ -75,11 +75,8 @@ export const SingleSelectCustomFilterExample: FC = provide({
|
|
75
75
|
return singleSelectColumnMenuFilter({
|
76
76
|
options: [0, 1],
|
77
77
|
renderItem: item => (item ? 'Start with Vowel' : 'Start with Consonants'),
|
78
|
-
|
79
|
-
value,
|
80
|
-
operator: (madeIn: string) =>
|
81
|
-
madeIn ? (value ? isVowel(madeIn) : !isVowel(madeIn)) : false,
|
82
|
-
}),
|
78
|
+
filterOperator: (madeIn: string, value: number) =>
|
79
|
+
madeIn ? (value ? isVowel(madeIn) : !isVowel(madeIn)) : false,
|
83
80
|
});
|
84
81
|
}, []);
|
85
82
|
|
@@ -4,7 +4,7 @@ import { provide, useDependencies } from '@servicetitan/react-ioc';
|
|
4
4
|
|
5
5
|
import { observer } from 'mobx-react';
|
6
6
|
|
7
|
-
import { Stack, ButtonGroup, Button, Tag } from '@servicetitan/design-system';
|
7
|
+
import { Stack, ButtonGroup, Button, Tag, DatePicker } from '@servicetitan/design-system';
|
8
8
|
|
9
9
|
import {
|
10
10
|
Table,
|
@@ -12,15 +12,15 @@ import {
|
|
12
12
|
TableCell,
|
13
13
|
TableCellProps,
|
14
14
|
TextEditableCell,
|
15
|
-
NumericEditableCell,
|
16
15
|
BooleanEditableCell,
|
17
|
-
DateEditableCell,
|
18
16
|
getSelectEditableCell,
|
19
|
-
CurrencyRangeColumnMenuFilter,
|
20
17
|
DateRangeColumnMenuFilter,
|
21
18
|
StandardColumnMenuFilter,
|
22
19
|
standardFilterWithMultiselect,
|
23
20
|
multiSelectColumnMenuFilter,
|
21
|
+
CurrencyRangeColumnMenuFilter,
|
22
|
+
getEditableCell,
|
23
|
+
EditorProps,
|
24
24
|
} from '../..';
|
25
25
|
import { Export } from '../../export';
|
26
26
|
|
@@ -28,7 +28,7 @@ import { TableStore } from './table.store';
|
|
28
28
|
|
29
29
|
import { ActionsCell } from './actions-cell';
|
30
30
|
|
31
|
-
import { enumToOptions, getEnumKeys } from '@servicetitan/form';
|
31
|
+
import { NumberInput, enumToOptions, getEnumKeys } from '@servicetitan/form';
|
32
32
|
import { Product, UserRole, Supplier } from './product';
|
33
33
|
|
34
34
|
const UserRoleColumnMenuFilter = multiSelectColumnMenuFilter(getEnumKeys(UserRole), userRole => (
|
@@ -56,6 +56,44 @@ const SupplierCell: FC<TableCellProps> = props => {
|
|
56
56
|
return <td>{Supplier[dataItem[field!]]}</td>;
|
57
57
|
};
|
58
58
|
|
59
|
+
// Implementation of a date editable cell utilizing getEditableCell
|
60
|
+
const DateEditor = observer<FC<EditorProps<Date | string | undefined>>>(
|
61
|
+
({ fieldState: { value, onChange, hasError }, className }) => {
|
62
|
+
return (
|
63
|
+
<td className={className}>
|
64
|
+
<DatePicker value={value} onChange={onChange} error={hasError} />
|
65
|
+
</td>
|
66
|
+
);
|
67
|
+
}
|
68
|
+
);
|
69
|
+
export const DateEditableCell = getEditableCell({
|
70
|
+
editor: DateEditor,
|
71
|
+
});
|
72
|
+
|
73
|
+
// Implementation of a numeric editable cell utilizing getEditableCell
|
74
|
+
const NumberCellEditor: FC<EditorProps<number>> = observer(
|
75
|
+
({ fieldState: { value, hasError, onChange } }) => (
|
76
|
+
<td>
|
77
|
+
<NumberInput
|
78
|
+
onChange={onChange}
|
79
|
+
type="number"
|
80
|
+
error={hasError}
|
81
|
+
value={value}
|
82
|
+
emptyValue={0}
|
83
|
+
min={0}
|
84
|
+
max={1000}
|
85
|
+
useEmptyThousandsSeparator
|
86
|
+
fluid
|
87
|
+
decimalPlaces={2}
|
88
|
+
useKeyboardNavigation
|
89
|
+
/>
|
90
|
+
</td>
|
91
|
+
)
|
92
|
+
);
|
93
|
+
const NumericEditableCell = getEditableCell({
|
94
|
+
editor: getEditableCell({ editor: NumberCellEditor }),
|
95
|
+
});
|
96
|
+
|
59
97
|
export interface TableExampleProps {
|
60
98
|
fixedWidthColumns?: boolean;
|
61
99
|
}
|
@@ -149,7 +187,7 @@ export const TableExample: FC<TableExampleProps> = provide({
|
|
149
187
|
title="First Ordered On"
|
150
188
|
cell={DateEditableCell}
|
151
189
|
columnMenu={DateRangeColumnMenuFilter}
|
152
|
-
format="{0:
|
190
|
+
format="{0:MM/dd/yyyy}"
|
153
191
|
width="240px"
|
154
192
|
/>
|
155
193
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
export * from './get-action-cell';
|
2
2
|
export * from './get-editable-cell';
|
3
3
|
export * from './text-editable-cell';
|
4
|
-
export * from './numeric-editable-cell';
|
5
4
|
export * from './boolean-editable-cell';
|
6
|
-
export * from './date-editable-cell';
|
7
5
|
export * from './get-select-editable-cell';
|
@@ -37,10 +37,7 @@ export interface SingleSelectColumnMenuOptions<TV, TO = TV> {
|
|
37
37
|
options: TO[];
|
38
38
|
valueSelector?: (item: TO) => TV;
|
39
39
|
renderItem?: (item: TO) => ReactNode | string;
|
40
|
-
|
41
|
-
value: any;
|
42
|
-
operator: string | Function;
|
43
|
-
};
|
40
|
+
filterOperator?: (listItem: any, value: TV) => boolean;
|
44
41
|
}
|
45
42
|
|
46
43
|
export function singleSelectColumnMenuFilter<TV extends IdType, TO = TV>(
|
@@ -51,11 +48,9 @@ export function singleSelectColumnMenuFilter<TV extends IdType, TO = TV>(
|
|
51
48
|
const filter =
|
52
49
|
value === undefined
|
53
50
|
? { value: '', operator: '' }
|
54
|
-
: props.filter
|
55
|
-
? props.filter(value)
|
56
51
|
: {
|
57
52
|
value,
|
58
|
-
operator: 'equals',
|
53
|
+
operator: props.filterOperator ?? 'equals',
|
59
54
|
};
|
60
55
|
|
61
56
|
onChange({
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"date-editable-cell.d.ts","sourceRoot":"","sources":["../../src/editable-cell/date-editable-cell.tsx"],"names":[],"mappings":";AA0BA,eAAO,MAAM,gBAAgB,6EAE3B,CAAC"}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import { observer } from 'mobx-react';
|
3
|
-
import { DatePicker } from '@progress/kendo-react-dateinputs';
|
4
|
-
import { getEditableCell } from './get-editable-cell';
|
5
|
-
const Editor = observer(({ fieldState: { value, onChange, hasError, error }, className }) => {
|
6
|
-
const handleChange = (event) => {
|
7
|
-
onChange(event.value);
|
8
|
-
};
|
9
|
-
return (_jsx("td", Object.assign({ className: className }, { children: _jsx(DatePicker, { value: value, onChange: handleChange, valid: !hasError, validationMessage: error }) })));
|
10
|
-
});
|
11
|
-
export const DateEditableCell = getEditableCell({
|
12
|
-
editor: Editor,
|
13
|
-
});
|
14
|
-
//# sourceMappingURL=date-editable-cell.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"date-editable-cell.js","sourceRoot":"","sources":["../../src/editable-cell/date-editable-cell.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAyB,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAE,eAAe,EAAe,MAAM,qBAAqB,CAAC;AAEnE,MAAM,MAAM,GAAG,QAAQ,CACnB,CAAC,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAChE,MAAM,YAAY,GAAG,CAAC,KAA4B,EAAE,EAAE;QAClD,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,CACH,2BAAI,SAAS,EAAE,SAAS,gBACpB,KAAC,UAAU,IACP,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,CAAC,QAAQ,EAChB,iBAAiB,EAAE,KAAK,GAC1B,IACD,CACR,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;IAC5C,MAAM,EAAE,MAAM;CACjB,CAAC,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"numeric-editable-cell.d.ts","sourceRoot":"","sources":["../../src/editable-cell/numeric-editable-cell.tsx"],"names":[],"mappings":";AA2BA,eAAO,MAAM,mBAAmB,6EAE9B,CAAC"}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import { observer } from 'mobx-react';
|
3
|
-
import { NumericTextBox } from '@progress/kendo-react-inputs';
|
4
|
-
import { getEditableCell } from './get-editable-cell';
|
5
|
-
const Editor = observer(({ fieldState: { value, onChange, hasError, error }, className }) => {
|
6
|
-
const handleChange = (event) => {
|
7
|
-
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
8
|
-
onChange(event.value || undefined);
|
9
|
-
};
|
10
|
-
return (_jsx("td", Object.assign({ className: className }, { children: _jsx(NumericTextBox, { value: value, onChange: handleChange, valid: !hasError, validationMessage: error }) })));
|
11
|
-
});
|
12
|
-
export const NumericEditableCell = getEditableCell({
|
13
|
-
editor: Editor,
|
14
|
-
});
|
15
|
-
//# sourceMappingURL=numeric-editable-cell.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"numeric-editable-cell.js","sourceRoot":"","sources":["../../src/editable-cell/numeric-editable-cell.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,cAAc,EAA6B,MAAM,8BAA8B,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAe,MAAM,qBAAqB,CAAC;AAEnE,MAAM,MAAM,GAAG,QAAQ,CACnB,CAAC,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAChE,MAAM,YAAY,GAAG,CAAC,KAAgC,EAAE,EAAE;QACtD,wEAAwE;QACxE,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,OAAO,CACH,2BAAI,SAAS,EAAE,SAAS,gBACpB,KAAC,cAAc,IACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,CAAC,QAAQ,EAChB,iBAAiB,EAAE,KAAK,GAC1B,IACD,CACR,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC;IAC/C,MAAM,EAAE,MAAM;CACjB,CAAC,CAAC"}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import { FC } from 'react';
|
2
|
-
import { observer } from 'mobx-react';
|
3
|
-
|
4
|
-
import { DatePicker, DatePickerChangeEvent } from '@progress/kendo-react-dateinputs';
|
5
|
-
|
6
|
-
import { getEditableCell, EditorProps } from './get-editable-cell';
|
7
|
-
|
8
|
-
const Editor = observer<FC<EditorProps<Date | null>>>(
|
9
|
-
({ fieldState: { value, onChange, hasError, error }, className }) => {
|
10
|
-
const handleChange = (event: DatePickerChangeEvent) => {
|
11
|
-
onChange(event.value);
|
12
|
-
};
|
13
|
-
|
14
|
-
return (
|
15
|
-
<td className={className}>
|
16
|
-
<DatePicker
|
17
|
-
value={value}
|
18
|
-
onChange={handleChange}
|
19
|
-
valid={!hasError}
|
20
|
-
validationMessage={error}
|
21
|
-
/>
|
22
|
-
</td>
|
23
|
-
);
|
24
|
-
}
|
25
|
-
);
|
26
|
-
|
27
|
-
export const DateEditableCell = getEditableCell({
|
28
|
-
editor: Editor,
|
29
|
-
});
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { FC } from 'react';
|
2
|
-
import { observer } from 'mobx-react';
|
3
|
-
|
4
|
-
import { NumericTextBox, NumericTextBoxChangeEvent } from '@progress/kendo-react-inputs';
|
5
|
-
|
6
|
-
import { getEditableCell, EditorProps } from './get-editable-cell';
|
7
|
-
|
8
|
-
const Editor = observer<FC<EditorProps<number | undefined>>>(
|
9
|
-
({ fieldState: { value, onChange, hasError, error }, className }) => {
|
10
|
-
const handleChange = (event: NumericTextBoxChangeEvent) => {
|
11
|
-
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
12
|
-
onChange(event.value || undefined);
|
13
|
-
};
|
14
|
-
|
15
|
-
return (
|
16
|
-
<td className={className}>
|
17
|
-
<NumericTextBox
|
18
|
-
value={value}
|
19
|
-
onChange={handleChange}
|
20
|
-
valid={!hasError}
|
21
|
-
validationMessage={error}
|
22
|
-
/>
|
23
|
-
</td>
|
24
|
-
);
|
25
|
-
}
|
26
|
-
);
|
27
|
-
|
28
|
-
export const NumericEditableCell = getEditableCell({
|
29
|
-
editor: Editor,
|
30
|
-
});
|