@servicetitan/table 25.0.1 → 25.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. package/dist/demo/filters/async-select-filter.js +1 -1
  2. package/dist/demo/filters/async-select-filter.js.map +1 -1
  3. package/dist/demo/filters/categories.d.ts.map +1 -1
  4. package/dist/demo/filters/categories.js +24 -0
  5. package/dist/demo/filters/categories.js.map +1 -1
  6. package/dist/demo/filters/multiselect-filter.d.ts.map +1 -1
  7. package/dist/demo/filters/multiselect-filter.js +2 -1
  8. package/dist/demo/filters/multiselect-filter.js.map +1 -1
  9. package/dist/demo/filters/select-filter.d.ts +6 -0
  10. package/dist/demo/filters/select-filter.d.ts.map +1 -0
  11. package/dist/demo/filters/select-filter.js +58 -0
  12. package/dist/demo/filters/select-filter.js.map +1 -0
  13. package/dist/demo/filters/single-select-filter.d.ts.map +1 -1
  14. package/dist/demo/filters/single-select-filter.js +2 -1
  15. package/dist/demo/filters/single-select-filter.js.map +1 -1
  16. package/dist/demo/filters/table.store.d.ts +8 -1
  17. package/dist/demo/filters/table.store.d.ts.map +1 -1
  18. package/dist/demo/filters/table.store.js +35 -1
  19. package/dist/demo/filters/table.store.js.map +1 -1
  20. package/dist/demo/footer-page-size/index.d.ts +2 -0
  21. package/dist/demo/footer-page-size/index.d.ts.map +1 -0
  22. package/dist/demo/footer-page-size/index.js +2 -0
  23. package/dist/demo/footer-page-size/index.js.map +1 -0
  24. package/dist/demo/footer-page-size/table.d.ts +3 -0
  25. package/dist/demo/footer-page-size/table.d.ts.map +1 -0
  26. package/dist/demo/footer-page-size/table.js +18 -0
  27. package/dist/demo/footer-page-size/table.js.map +1 -0
  28. package/dist/demo/index.d.ts +1 -0
  29. package/dist/demo/index.d.ts.map +1 -1
  30. package/dist/demo/index.js +1 -0
  31. package/dist/demo/index.js.map +1 -1
  32. package/dist/demo/overview/product.d.ts +5 -0
  33. package/dist/demo/overview/product.d.ts.map +1 -1
  34. package/dist/demo/overview/products.d.ts.map +1 -1
  35. package/dist/demo/overview/products.js +12 -0
  36. package/dist/demo/overview/products.js.map +1 -1
  37. package/dist/demo/overview/table.store.d.ts.map +1 -1
  38. package/dist/demo/overview/table.store.js +1 -0
  39. package/dist/demo/overview/table.store.js.map +1 -1
  40. package/dist/filters/async-select/async-select-filter.d.ts +7 -3
  41. package/dist/filters/async-select/async-select-filter.d.ts.map +1 -1
  42. package/dist/filters/async-select/async-select-filter.js +21 -6
  43. package/dist/filters/async-select/async-select-filter.js.map +1 -1
  44. package/dist/filters/column-menu-filters.d.ts +10 -1
  45. package/dist/filters/column-menu-filters.d.ts.map +1 -1
  46. package/dist/filters/column-menu-filters.js +11 -3
  47. package/dist/filters/column-menu-filters.js.map +1 -1
  48. package/dist/filters/index.d.ts +1 -0
  49. package/dist/filters/index.d.ts.map +1 -1
  50. package/dist/filters/index.js +1 -0
  51. package/dist/filters/index.js.map +1 -1
  52. package/dist/filters/multiselect-filter/multiselect-filter.d.ts +4 -3
  53. package/dist/filters/multiselect-filter/multiselect-filter.d.ts.map +1 -1
  54. package/dist/filters/multiselect-filter/multiselect-filter.js +7 -7
  55. package/dist/filters/multiselect-filter/multiselect-filter.js.map +1 -1
  56. package/dist/filters/select-filter/object-search.d.ts +2 -0
  57. package/dist/filters/select-filter/object-search.d.ts.map +1 -0
  58. package/dist/filters/select-filter/object-search.js +19 -0
  59. package/dist/filters/select-filter/object-search.js.map +1 -0
  60. package/dist/filters/select-filter/select-filter.d.ts +32 -0
  61. package/dist/filters/select-filter/select-filter.d.ts.map +1 -0
  62. package/dist/filters/select-filter/select-filter.js +214 -0
  63. package/dist/filters/select-filter/select-filter.js.map +1 -0
  64. package/dist/filters/select-filter/select-filter.stories.d.ts +8 -0
  65. package/dist/filters/select-filter/select-filter.stories.d.ts.map +1 -0
  66. package/dist/filters/select-filter/select-filter.stories.js +8 -0
  67. package/dist/filters/select-filter/select-filter.stories.js.map +1 -0
  68. package/dist/filters/select-filter/value-getter.d.ts +3 -0
  69. package/dist/filters/select-filter/value-getter.d.ts.map +1 -0
  70. package/dist/filters/select-filter/value-getter.js +10 -0
  71. package/dist/filters/select-filter/value-getter.js.map +1 -0
  72. package/dist/filters/single-select/single-select-filter.d.ts +3 -2
  73. package/dist/filters/single-select/single-select-filter.d.ts.map +1 -1
  74. package/dist/filters/single-select/single-select-filter.js +17 -7
  75. package/dist/filters/single-select/single-select-filter.js.map +1 -1
  76. package/dist/index.d.ts +1 -1
  77. package/dist/index.d.ts.map +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/index.js.map +1 -1
  80. package/package.json +6 -6
  81. package/src/demo/filters/async-select-filter.tsx +1 -1
  82. package/src/demo/filters/categories.tsx +24 -0
  83. package/src/demo/filters/multiselect-filter.tsx +15 -0
  84. package/src/demo/filters/select-filter.tsx +147 -0
  85. package/src/demo/filters/single-select-filter.tsx +2 -1
  86. package/src/demo/filters/table.store.ts +45 -2
  87. package/src/demo/footer-page-size/index.ts +1 -0
  88. package/src/demo/footer-page-size/table.tsx +104 -0
  89. package/src/demo/index.ts +1 -0
  90. package/src/demo/overview/product.ts +6 -0
  91. package/src/demo/overview/products.ts +12 -0
  92. package/src/demo/overview/table.store.ts +1 -0
  93. package/src/filters/async-select/async-select-filter.tsx +26 -15
  94. package/src/filters/column-menu-filters.tsx +44 -21
  95. package/src/filters/index.ts +1 -0
  96. package/src/filters/multiselect-filter/multiselect-filter.tsx +16 -7
  97. package/src/filters/select-filter/__tests__/object-search.test.ts +32 -0
  98. package/src/filters/select-filter/object-search.ts +25 -0
  99. package/src/filters/select-filter/select-filter.stories.tsx +8 -0
  100. package/src/filters/select-filter/select-filter.tsx +320 -0
  101. package/src/filters/select-filter/value-getter.ts +13 -0
  102. package/src/filters/single-select/single-select-filter.tsx +18 -10
  103. package/src/index.ts +1 -0
  104. package/src/table.stories.tsx +4 -2
@@ -1 +1 @@
1
- {"version":3,"file":"async-select-filter.js","sourceRoot":"","sources":["../../../src/filters/async-select/async-select-filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;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AAC,CAAC,CAAC,EAAE;oBAC9B,cAAc,EAAE,KAAK;iBACxB,CAAC,CAAC;YACP,CAAC,CAAC;YAEF,OAAO,CACH,KAAC,aAAa,IACV,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAC9B,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,kBAAkB,EACjC,WAAW,EAAE,OAAO,CAAC,WAAW,EAChC,QAAQ,EAAE,OAAO,CAAC,UAAU,EAC5B,WAAW,EAAE,OAAO,CAAC,WAAW,GAClC,CACL,CAAC;QACN,CAAC,CAAC;IAER,OAAO,4BAA4B,CAAC,UAAU,CAAC,CAAC;AACpD,CAAC"}
1
+ {"version":3,"file":"async-select-filter.js","sourceRoot":"","sources":["../../../src/filters/async-select/async-select-filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAA6B,QAAQ,EAAqB,MAAM,OAAO,CAAC;AAE1F,OAAO,EACH,QAAQ,EAER,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,GACX,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEH,4BAA4B,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAiCtC,IAAM,aAAa,GAAnB,MAAM,aAAmE,SAAQ,SAEhF;IAMG,YAAY,KAA6B;QACrC,KAAK,CAAC,KAAK,CAAC,CAAC;QANL;;;;mBAAuC,EAAE;WAAC;QAC1C;;;;mBAAS,EAAE;WAAC;QACZ;;;;mBAAQ,KAAK;WAAC;QACd;;;;mBAAU,KAAK;WAAC;QAW5B;;;;mBAAgB,CAAC,KAAsC,EAAE,EAAE;gBACvD,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;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AAS;oBACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;oBACpC,cAAc,EAAE,KAAK;iBACxB,CAAC,CAAC;YACP,CAAC,CAAC;YAEF,OAAO,CACH,KAAC,aAAa,IACV,QAAQ,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,EACrB,aAAa,EAAE,oBAAoB,EACnC,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,WAAW,GAC1B,CACL,CAAC;QACN,CAAC;QACH,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAiC,EAAE,EAAE;YACnD,MAAM,YAAY,GAAG,CACjB,MAAU,EACV,OAAgB,EAChB,KAAuC,EACzC,EAAE;gBACA,QAAQ,CAAC;oBACL,KAAK,EAAE,MAAM;oBACb,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;oBAC9B,cAAc,EAAE,KAAK;iBACxB,CAAC,CAAC;YACP,CAAC,CAAC;YAEF,OAAO,CACH,KAAC,aAAa,IACV,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAC9B,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,kBAAkB,EACjC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,WAAW,GAC1B,CACL,CAAC;QACN,CAAC,CAAC;IAER,OAAO,4BAA4B,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAC1D,CAAC"}
@@ -1,5 +1,14 @@
1
1
  import { ComponentType } from 'react';
2
2
  import { TableColumnMenuProps, TableFilterCellProps } from '@servicetitan/design-system';
3
3
  export declare const StandardColumnMenuFilter: (props: TableColumnMenuProps) => JSX.Element;
4
- export declare function renderCustomColumnMenuFilter(FilterCell: ComponentType<TableFilterCellProps>, double?: boolean): (props: TableColumnMenuProps) => JSX.Element;
4
+ export interface CustomColumnMenuFilterSingleOpts {
5
+ contentMaxHeight?: string;
6
+ contentClassName?: string;
7
+ }
8
+ export interface CustomColumnMenuFilterDoubleOpts {
9
+ double?: boolean;
10
+ doubleContentClassName?: string;
11
+ }
12
+ export declare type CustomColumnMenuFilterOpts = CustomColumnMenuFilterSingleOpts & CustomColumnMenuFilterDoubleOpts;
13
+ export declare function renderCustomColumnMenuFilter(FilterCell: ComponentType<TableFilterCellProps>, doubleOrOptions?: boolean | CustomColumnMenuFilterOpts): (props: TableColumnMenuProps) => JSX.Element;
5
14
  //# sourceMappingURL=column-menu-filters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"column-menu-filters.d.ts","sourceRoot":"","sources":["../../src/filters/column-menu-filters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAM,MAAM,OAAO,CAAC;AAC1C,OAAO,EAEH,oBAAoB,EACpB,oBAAoB,EACvB,MAAM,6BAA6B,CAAC;AAIrC,eAAO,MAAM,wBAAwB,UAAW,oBAAoB,gBAEnE,CAAC;AAEF,wBAAgB,4BAA4B,CACxC,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,EAC/C,MAAM,CAAC,EAAE,OAAO,WA0BD,oBAAoB,iBAGtC"}
1
+ {"version":3,"file":"column-menu-filters.d.ts","sourceRoot":"","sources":["../../src/filters/column-menu-filters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAC;AACzD,OAAO,EAEH,oBAAoB,EACpB,oBAAoB,EACvB,MAAM,6BAA6B,CAAC;AAIrC,eAAO,MAAM,wBAAwB,UAAW,oBAAoB,gBAEnE,CAAC;AAEF,MAAM,WAAW,gCAAgC;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AACD,MAAM,WAAW,gCAAgC;IAC7C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,oBAAY,0BAA0B,GAAG,gCAAgC,GACrE,gCAAgC,CAAC;AAErC,wBAAgB,4BAA4B,CACxC,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,EAC/C,eAAe,CAAC,EAAE,OAAO,GAAG,0BAA0B,WAqCvC,oBAAoB,iBAGtC"}
@@ -2,8 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { TableColumnMenuFilter, } from '@servicetitan/design-system';
3
3
  import { DropDownList } from '@progress/kendo-react-dropdowns';
4
4
  export const StandardColumnMenuFilter = (props) => (_jsx(TableColumnMenuFilter, Object.assign({}, props, { expanded: true })));
5
- export function renderCustomColumnMenuFilter(FilterCell, double) {
6
- const filterUI = ({ firstFilterProps, secondFilterProps, logicData, logicValue, onLogicChange, }) => (_jsxs("div", { children: [_jsx(FilterCell, Object.assign({}, firstFilterProps)), double && (_jsxs("div", { children: [_jsx(DropDownList, { data: logicData, value: logicValue, onChange: onLogicChange, className: "k-filter-and m-b-1", textField: "text" }), _jsx(FilterCell, Object.assign({}, secondFilterProps))] }))] }));
7
- return (props) => (_jsx(TableColumnMenuFilter, Object.assign({}, props, { filterUI: filterUI, expanded: true })));
5
+ export function renderCustomColumnMenuFilter(FilterCell, doubleOrOptions) {
6
+ const opts = typeof doubleOrOptions === 'boolean' ? { double: doubleOrOptions } : doubleOrOptions !== null && doubleOrOptions !== void 0 ? doubleOrOptions : {};
7
+ const FilterUI = ({ firstFilterProps, secondFilterProps, logicData, logicValue, onLogicChange, }) => {
8
+ const contentStyles = {};
9
+ if (opts.contentMaxHeight) {
10
+ contentStyles.maxHeight = opts.contentMaxHeight;
11
+ contentStyles.overflowY = 'auto';
12
+ }
13
+ return (_jsxs("div", Object.assign({ className: opts.contentClassName, style: contentStyles }, { children: [_jsx(FilterCell, Object.assign({}, firstFilterProps)), !!opts.double && (_jsxs("div", Object.assign({ className: opts.doubleContentClassName }, { children: [_jsx(DropDownList, { data: logicData, value: logicValue, onChange: onLogicChange, className: "k-filter-and m-b-1", textField: "text" }), _jsx(FilterCell, Object.assign({}, secondFilterProps))] })))] })));
14
+ };
15
+ return (props) => (_jsx(TableColumnMenuFilter, Object.assign({}, props, { filterUI: FilterUI, expanded: true })));
8
16
  }
9
17
  //# sourceMappingURL=column-menu-filters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"column-menu-filters.js","sourceRoot":"","sources":["../../src/filters/column-menu-filters.tsx"],"names":[],"mappings":";AACA,OAAO,EACH,qBAAqB,GAGxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAA2B,EAAE,EAAE,CAAC,CACrE,KAAC,qBAAqB,oBAAK,KAAK,IAAE,QAAQ,UAAG,CAChD,CAAC;AAEF,MAAM,UAAU,4BAA4B,CACxC,UAA+C,EAC/C,MAAgB;IAEhB,MAAM,QAAQ,GAAqC,CAAC,EAChD,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,aAAa,GAChB,EAAE,EAAE,CAAC,CACF,0BACI,KAAC,UAAU,oBAAK,gBAAgB,EAAI,EACnC,MAAM,IAAI,CACP,0BACI,KAAC,YAAY,IACT,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,aAAa,EACvB,SAAS,EAAC,oBAAoB,EAC9B,SAAS,EAAC,MAAM,GAClB,EACF,KAAC,UAAU,oBAAK,iBAAiB,EAAI,IACnC,CACT,IACC,CACT,CAAC;IAEF,OAAO,CAAC,KAA2B,EAAE,EAAE,CAAC,CACpC,KAAC,qBAAqB,oBAAK,KAAK,IAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,UAAG,CACpE,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"column-menu-filters.js","sourceRoot":"","sources":["../../src/filters/column-menu-filters.tsx"],"names":[],"mappings":";AACA,OAAO,EACH,qBAAqB,GAGxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAA2B,EAAE,EAAE,CAAC,CACrE,KAAC,qBAAqB,oBAAK,KAAK,IAAE,QAAQ,UAAG,CAChD,CAAC;AAcF,MAAM,UAAU,4BAA4B,CACxC,UAA+C,EAC/C,eAAsD;IAEtD,MAAM,IAAI,GACN,OAAO,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,EAAE,CAAC;IAC/F,MAAM,QAAQ,GAAqC,CAAC,EAChD,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,aAAa,GAChB,EAAE,EAAE;QACD,MAAM,aAAa,GAAkB,EAAE,CAAC;QAExC,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACvB,aAAa,CAAC,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC;YAChD,aAAa,CAAC,SAAS,GAAG,MAAM,CAAC;SACpC;QAED,OAAO,CACH,6BAAK,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,EAAE,aAAa,iBACvD,KAAC,UAAU,oBAAK,gBAAgB,EAAI,EACnC,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,CACd,6BAAK,SAAS,EAAE,IAAI,CAAC,sBAAsB,iBACvC,KAAC,YAAY,IACT,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,aAAa,EACvB,SAAS,EAAC,oBAAoB,EAC9B,SAAS,EAAC,MAAM,GAClB,EACF,KAAC,UAAU,oBAAK,iBAAiB,EAAI,KACnC,CACT,KACC,CACT,CAAC;IACN,CAAC,CAAC;IAEF,OAAO,CAAC,KAA2B,EAAE,EAAE,CAAC,CACpC,KAAC,qBAAqB,oBAAK,KAAK,IAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,UAAG,CACpE,CAAC;AACN,CAAC"}
@@ -8,4 +8,5 @@ export * from './multiselect-filter/multiselect-filter';
8
8
  export * from './numeric-filter-extended/numeric-filter-extended';
9
9
  export * from './single-select/single-select-filter';
10
10
  export * from './async-select/async-select-filter';
11
+ export * from './select-filter/select-filter';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filters/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qEAAqE,CAAC;AACpF,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filters/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qEAAqE,CAAC;AACpF,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC"}
@@ -8,4 +8,5 @@ export * from './multiselect-filter/multiselect-filter';
8
8
  export * from './numeric-filter-extended/numeric-filter-extended';
9
9
  export * from './single-select/single-select-filter';
10
10
  export * from './async-select/async-select-filter';
11
+ export * from './select-filter/select-filter';
11
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/filters/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qEAAqE,CAAC;AACpF,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/filters/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qEAAqE,CAAC;AACpF,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yCAAyC,CAAC;AACxD,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- export declare function multiSelectColumnMenuFilter<T>(data: T[], renderItem?: (item: T) => ReactNode): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
3
- export declare function complexItemMultiSelectColumnMenuFilter<T>(data: T[], renderItem?: (item: T) => ReactNode): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
4
- export declare function multiItemMultiSelectColumnMenuFilter<T>(data: T[], renderItem?: (item: T) => ReactNode): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
2
+ import { CustomColumnMenuFilterSingleOpts } from '../column-menu-filters';
3
+ export declare function multiSelectColumnMenuFilter<T>(data: T[], renderItem?: (item: T) => ReactNode, opts?: CustomColumnMenuFilterSingleOpts): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
4
+ export declare function complexItemMultiSelectColumnMenuFilter<T>(data: T[], renderItem?: (item: T) => ReactNode, opts?: CustomColumnMenuFilterSingleOpts): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
5
+ export declare function multiItemMultiSelectColumnMenuFilter<T>(data: T[], renderItem?: (item: T) => ReactNode, opts?: CustomColumnMenuFilterSingleOpts): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
5
6
  //# sourceMappingURL=multiselect-filter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"multiselect-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/multiselect-filter/multiselect-filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,SAAS,EAAM,MAAM,OAAO,CAAC;AAuCjE,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,sFAqB5F;AAED,wBAAgB,sCAAsC,CAAC,CAAC,EACpD,IAAI,EAAE,CAAC,EAAE,EACT,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,sFAgCtC;AAED,wBAAgB,oCAAoC,CAAC,CAAC,EAClD,IAAI,EAAE,CAAC,EAAE,EACT,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,sFAgCtC"}
1
+ {"version":3,"file":"multiselect-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/multiselect-filter/multiselect-filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,SAAS,EAAM,MAAM,OAAO,CAAC;AAIjE,OAAO,EACH,gCAAgC,EAEnC,MAAM,wBAAwB,CAAC;AAmChC,wBAAgB,2BAA2B,CAAC,CAAC,EACzC,IAAI,EAAE,CAAC,EAAE,EACT,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,EACnC,IAAI,CAAC,EAAE,gCAAgC,sFAsB1C;AAED,wBAAgB,sCAAsC,CAAC,CAAC,EACpD,IAAI,EAAE,CAAC,EAAE,EACT,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,EACnC,IAAI,CAAC,EAAE,gCAAgC,sFAgC1C;AAED,wBAAgB,oCAAoC,CAAC,CAAC,EAClD,IAAI,EAAE,CAAC,EAAE,EACT,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,EACnC,IAAI,CAAC,EAAE,gCAAgC,sFAgC1C"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Component } from 'react';
3
3
  import { Checkbox } from '@servicetitan/design-system';
4
- import { renderCustomColumnMenuFilter } from '../column-menu-filters';
4
+ import { renderCustomColumnMenuFilter, } from '../column-menu-filters';
5
5
  class Selector extends Component {
6
6
  constructor() {
7
7
  super(...arguments);
@@ -25,7 +25,7 @@ class Selector extends Component {
25
25
  _jsx("span", Object.assign({ className: "k-widget m-b-1-i d-b" }, { children: _jsx(Checkbox, { value: option, label: renderer ? renderer(option) : option, checked: (value !== null && value !== void 0 ? value : []).includes(option), onChange: this.handleChange }) }), index)));
26
26
  }
27
27
  }
28
- export function multiSelectColumnMenuFilter(data, renderItem) {
28
+ export function multiSelectColumnMenuFilter(data, renderItem, opts) {
29
29
  const FilterCell = ({ value, onChange }) => {
30
30
  const handleChange = (value, event) => {
31
31
  onChange({
@@ -36,9 +36,9 @@ export function multiSelectColumnMenuFilter(data, renderItem) {
36
36
  };
37
37
  return (_jsx(Selector, { options: data, value: value === '' ? undefined : value, onChange: handleChange, renderer: renderItem }));
38
38
  };
39
- return renderCustomColumnMenuFilter(FilterCell);
39
+ return renderCustomColumnMenuFilter(FilterCell, opts);
40
40
  }
41
- export function complexItemMultiSelectColumnMenuFilter(data, renderItem) {
41
+ export function complexItemMultiSelectColumnMenuFilter(data, renderItem, opts) {
42
42
  class FilterCell extends Component {
43
43
  constructor() {
44
44
  super(...arguments);
@@ -69,9 +69,9 @@ export function complexItemMultiSelectColumnMenuFilter(data, renderItem) {
69
69
  return (_jsx(Selector, { options: data, value: value === '' ? undefined : value, onChange: this.handleChange, renderer: renderItem }));
70
70
  }
71
71
  }
72
- return renderCustomColumnMenuFilter(FilterCell);
72
+ return renderCustomColumnMenuFilter(FilterCell, opts);
73
73
  }
74
- export function multiItemMultiSelectColumnMenuFilter(data, renderItem) {
74
+ export function multiItemMultiSelectColumnMenuFilter(data, renderItem, opts) {
75
75
  class FilterCell extends Component {
76
76
  constructor() {
77
77
  super(...arguments);
@@ -102,6 +102,6 @@ export function multiItemMultiSelectColumnMenuFilter(data, renderItem) {
102
102
  return (_jsx(Selector, { options: data, value: value === '' ? undefined : value, onChange: this.handleChange, renderer: renderItem }));
103
103
  }
104
104
  }
105
- return renderCustomColumnMenuFilter(FilterCell);
105
+ return renderCustomColumnMenuFilter(FilterCell, opts);
106
106
  }
107
107
  //# sourceMappingURL=multiselect-filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"multiselect-filter.js","sourceRoot":"","sources":["../../../src/filters/multiselect-filter/multiselect-filter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAiC,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAwB,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAStE,MAAM,QAAY,SAAQ,SAA2B;IAArD;;QACI;;;;mBAAe,CAAC,MAAS,EAAE,OAAgB,EAAE,KAAuC,EAAE,EAAE;;gBACpF,MAAM,QAAQ,GAAG,OAAO;oBACpB,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;oBACzC,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,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AC,EAAE;wBACpC,cAAc,EAAE,KAAK;qBACxB,CAAC,CAAC;gBACP,CAAC;eAAC;QAcN,CAAC;QAZG,MAAM;YACF,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;YAE7B,OAAO,CACH,KAAC,QAAQ,IACL,OAAO,EAAE,IAAI,EACb,KAAK,EAAE,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EACvC,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,QAAQ,EAAE,UAAU,GACtB,CACL,CAAC;QACN,CAAC;KACJ;IAED,OAAO,4BAA4B,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const objectSearch: (search: string) => (item: any) => boolean;
2
+ //# sourceMappingURL=object-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object-search.d.ts","sourceRoot":"","sources":["../../../src/filters/select-filter/object-search.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,WAAY,MAAM,YAGzB,GAAG,KAAG,OAqBvB,CAAC"}
@@ -0,0 +1,19 @@
1
+ export const objectSearch = (search) => {
2
+ const s = search.toLowerCase().trim();
3
+ return (item) => {
4
+ if (!s) {
5
+ return true;
6
+ }
7
+ if (item === null) {
8
+ return false;
9
+ }
10
+ if (typeof item === 'string') {
11
+ return item.toLowerCase().includes(s);
12
+ }
13
+ if (typeof item === 'object') {
14
+ return Object.values(item).some(value => typeof value === 'string' ? value.toLowerCase().includes(s) : false);
15
+ }
16
+ return false;
17
+ };
18
+ };
19
+ //# sourceMappingURL=object-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object-search.js","sourceRoot":"","sources":["../../../src/filters/select-filter/object-search.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,EAAE;IAC3C,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IAEtC,OAAO,CAAC,IAAS,EAAW,EAAE;QAC1B,IAAI,CAAC,CAAC,EAAE;YACJ,OAAO,IAAI,CAAC;SACf;QAED,IAAI,IAAI,KAAK,IAAI,EAAE;YACf,OAAO,KAAK,CAAC;SAChB;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC1B,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;SACzC;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC1B,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CACpC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CACtE,CAAC;SACL;QAED,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { ReactNode } from 'react';
2
+ import { IdType } from '@servicetitan/data-query';
3
+ import { CustomColumnMenuFilterSingleOpts } from '../column-menu-filters';
4
+ export declare type SelectFilterDataFetcher<TO> = (opts: {
5
+ search?: string;
6
+ }) => Promise<{
7
+ data: TO[];
8
+ }>;
9
+ export interface SelectFilterSearchOptions<TO = any> {
10
+ placeholder?: string;
11
+ filter(search: string): (item: TO) => boolean | undefined;
12
+ }
13
+ export interface SelectFilterOptions<TO> extends CustomColumnMenuFilterSingleOpts {
14
+ /** Can select multiple options in filter */
15
+ multiple?: boolean;
16
+ /** Ability to search options in filter */
17
+ search?: boolean | Partial<SelectFilterSearchOptions>;
18
+ /** Static options to show in filter */
19
+ data?: TO[];
20
+ /** Method to fetch filter options asynchronously */
21
+ dataFetcher?: SelectFilterDataFetcher<TO>;
22
+ /** Search operator passed to table state */
23
+ operator?: ((value: any, options?: TO[]) => boolean) | ((value: any, options?: TO) => boolean);
24
+ /** Select item value (ex id) for complex items */
25
+ valueSelector?(item: TO): IdType;
26
+ /** Select row item value (from table source row field) for complex items */
27
+ rowValueSelector?(item: any): IdType | undefined;
28
+ /** Render option label */
29
+ renderItem?(item: TO): ReactNode;
30
+ }
31
+ export declare function selectColumnMenuFilter<TO>({ dataFetcher, data, search, multiple, valueSelector, rowValueSelector, renderItem, operator, ...opts }: SelectFilterOptions<TO>): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
32
+ //# sourceMappingURL=select-filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/select-filter/select-filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,SAAS,EAA+B,MAAM,OAAO,CAAC;AAU1F,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EACH,gCAAgC,EAEnC,MAAM,wBAAwB,CAAC;AAMhC,oBAAY,uBAAuB,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC;IAAE,IAAI,EAAE,EAAE,EAAE,CAAA;CAAE,CAAC,CAAC;AAEjG,MAAM,WAAW,yBAAyB,CAAC,EAAE,GAAG,GAAG;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,OAAO,GAAG,SAAS,CAAC;CAC7D;AAqLD,MAAM,WAAW,mBAAmB,CAAC,EAAE,CAAE,SAAQ,gCAAgC;IAC7E,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACtD,uCAAuC;IACvC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;IACZ,oDAAoD;IACpD,WAAW,CAAC,EAAE,uBAAuB,CAAC,EAAE,CAAC,CAAC;IAC1C,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,OAAO,CAAC,CAAC;IAC/F,kDAAkD;IAClD,aAAa,CAAC,CAAC,IAAI,EAAE,EAAE,GAAG,MAAM,CAAC;IACjC,4EAA4E;IAC5E,gBAAgB,CAAC,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAAC;IACjD,0BAA0B;IAC1B,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,GAAG,SAAS,CAAC;CACpC;AAMD,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,EACvC,WAAW,EACX,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,aAA8B,EAC9B,gBAAiC,EACjC,UAAU,EACV,QAAQ,EACR,GAAG,IAAI,EACV,EAAE,mBAAmB,CAAC,EAAE,CAAC,sFA+EzB"}
@@ -0,0 +1,214 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
11
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12
+ return new (P || (P = Promise))(function (resolve, reject) {
13
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
14
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
15
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
16
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
17
+ });
18
+ };
19
+ var __rest = (this && this.__rest) || function (s, e) {
20
+ var t = {};
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
22
+ t[p] = s[p];
23
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
24
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
25
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
26
+ t[p[i]] = s[p[i]];
27
+ }
28
+ return t;
29
+ };
30
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
31
+ import { Component, Fragment } from 'react';
32
+ import { Checkbox, Radio, Input, Spinner, BodyText, } from '@servicetitan/design-system';
33
+ import { renderCustomColumnMenuFilter, } from '../column-menu-filters';
34
+ import { makeObservable, observable, runInAction, toJS } from 'mobx';
35
+ import { observer } from 'mobx-react';
36
+ import { getSimpleValue } from './value-getter';
37
+ import { objectSearch } from './object-search';
38
+ let SelectorAsync = class SelectorAsync extends Component {
39
+ constructor(props) {
40
+ super(props);
41
+ Object.defineProperty(this, "shownOptions", {
42
+ enumerable: true,
43
+ configurable: true,
44
+ writable: true,
45
+ value: []
46
+ });
47
+ Object.defineProperty(this, "search", {
48
+ enumerable: true,
49
+ configurable: true,
50
+ writable: true,
51
+ value: ''
52
+ });
53
+ Object.defineProperty(this, "error", {
54
+ enumerable: true,
55
+ configurable: true,
56
+ writable: true,
57
+ value: false
58
+ });
59
+ Object.defineProperty(this, "loading", {
60
+ enumerable: true,
61
+ configurable: true,
62
+ writable: true,
63
+ value: false
64
+ });
65
+ Object.defineProperty(this, "handleKeyDown", {
66
+ enumerable: true,
67
+ configurable: true,
68
+ writable: true,
69
+ value: (event) => {
70
+ if (event.key === 'Enter') {
71
+ event.stopPropagation();
72
+ }
73
+ }
74
+ });
75
+ Object.defineProperty(this, "handleSearch", {
76
+ enumerable: true,
77
+ configurable: true,
78
+ writable: true,
79
+ value: (_0, data) => {
80
+ runInAction(() => (this.search = data.value));
81
+ this.searchOptions().catch();
82
+ }
83
+ });
84
+ Object.defineProperty(this, "searchOptions", {
85
+ enumerable: true,
86
+ configurable: true,
87
+ writable: true,
88
+ value: () => __awaiter(this, void 0, void 0, function* () {
89
+ if (this.props.dataFetcher) {
90
+ runInAction(() => {
91
+ this.loading = true;
92
+ });
93
+ }
94
+ try {
95
+ const data = yield this.getData();
96
+ runInAction(() => {
97
+ this.shownOptions = data;
98
+ this.error = false;
99
+ this.loading = false;
100
+ });
101
+ }
102
+ catch (_a) {
103
+ runInAction(() => {
104
+ this.error = true;
105
+ this.loading = false;
106
+ });
107
+ }
108
+ })
109
+ });
110
+ Object.defineProperty(this, "getItemKey", {
111
+ enumerable: true,
112
+ configurable: true,
113
+ writable: true,
114
+ value: (item, index) => {
115
+ return `${index}__${this.props.valueSelector(item)}`;
116
+ }
117
+ });
118
+ makeObservable(this);
119
+ }
120
+ componentDidMount() {
121
+ this.searchOptions().catch();
122
+ }
123
+ render() {
124
+ var _a;
125
+ const selectedOptions = this.props.selected;
126
+ const selected = new Set(selectedOptions.map(opt => this.props.valueSelector(opt)));
127
+ const ItemComponent = this.props.itemComponent;
128
+ return (_jsxs(Fragment, { children: [!!this.props.search && (_jsx(Input, { className: "m-x-half m-t-half m-b-2", placeholder: (_a = this.props.search) === null || _a === void 0 ? void 0 : _a.placeholder, onChange: this.handleSearch, onKeyDown: this.handleKeyDown, size: "xsmall", value: this.search })), _jsxs("div", Object.assign({ className: "p-x-half position-relative", onKeyDown: this.handleKeyDown }, { children: [!!selectedOptions.length && (_jsx("div", Object.assign({ className: "border-bottom m-y-half" }, { children: selectedOptions.map((option, index) => (_jsx(ItemComponent, { option: option, checked: true, renderer: this.props.renderItem, onChange: this.props.onChange }, this.getItemKey(option, index)))) }))), this.error ? (_jsx(BodyText, Object.assign({ className: "c-red-500" }, { children: "Unable to load options" }))) : this.shownOptions.length ? (this.shownOptions
129
+ .filter(opt => !selected.has(this.props.valueSelector(opt)))
130
+ .map((option, index) => (_jsx(ItemComponent, { option: option, checked: false, renderer: this.props.renderItem, onChange: this.props.onChange }, this.getItemKey(option, index))))) : this.loading ? (_jsx(BodyText, { children: "\u00A0" })) : (_jsx(BodyText, Object.assign({ subdued: true }, { children: "No options match search criteria" }))), this.loading && (_jsx("div", Object.assign({ className: "position-absolute top-0 bottom-0 left-0 right-0 opacity-disabled bg-white d-f justify-content-center" }, { children: _jsx(Spinner, { size: "tiny" }) })))] }))] }));
131
+ }
132
+ getData() {
133
+ var _a, _b;
134
+ return __awaiter(this, void 0, void 0, function* () {
135
+ if (this.props.dataFetcher) {
136
+ const { data } = yield this.props.dataFetcher({
137
+ search: this.search,
138
+ });
139
+ return data;
140
+ }
141
+ let data = (_a = this.props.data) !== null && _a !== void 0 ? _a : [];
142
+ if ((_b = this.props.search) === null || _b === void 0 ? void 0 : _b.filter) {
143
+ data = data.filter(this.props.search.filter(this.search));
144
+ }
145
+ return data;
146
+ });
147
+ }
148
+ };
149
+ __decorate([
150
+ observable,
151
+ __metadata("design:type", Array)
152
+ ], SelectorAsync.prototype, "shownOptions", void 0);
153
+ __decorate([
154
+ observable,
155
+ __metadata("design:type", Object)
156
+ ], SelectorAsync.prototype, "search", void 0);
157
+ __decorate([
158
+ observable,
159
+ __metadata("design:type", Object)
160
+ ], SelectorAsync.prototype, "error", void 0);
161
+ __decorate([
162
+ observable,
163
+ __metadata("design:type", Object)
164
+ ], SelectorAsync.prototype, "loading", void 0);
165
+ SelectorAsync = __decorate([
166
+ observer,
167
+ __metadata("design:paramtypes", [Object])
168
+ ], SelectorAsync);
169
+ const SelectorItemSingle = ({ option, renderer, checked, onChange, }) => {
170
+ var _a;
171
+ return (_jsx(Radio, { label: (_a = renderer === null || renderer === void 0 ? void 0 : renderer(option)) !== null && _a !== void 0 ? _a : `${option}`, checked: checked, onChange: (_, event) => onChange(option, true, event), className: "m-b-1" }));
172
+ };
173
+ const SelectorItemMultiple = ({ option, renderer, checked, onChange, }) => {
174
+ var _a;
175
+ return (_jsx(Checkbox, { label: (_a = renderer === null || renderer === void 0 ? void 0 : renderer(option)) !== null && _a !== void 0 ? _a : `${option}`, checked: checked, onChange: (_, checked, event) => onChange(option, checked, event), className: "m-b-1" }));
176
+ };
177
+ export function selectColumnMenuFilter(_a) {
178
+ var { dataFetcher, data, search, multiple, valueSelector = getSimpleValue, rowValueSelector = getSimpleValue, renderItem, operator } = _a, opts = __rest(_a, ["dataFetcher", "data", "search", "multiple", "valueSelector", "rowValueSelector", "renderItem", "operator"]);
179
+ const renderer = renderItem !== null && renderItem !== void 0 ? renderItem : (item => valueSelector(item));
180
+ const contains = (value, options) => options === null || options === void 0 ? void 0 : options.some(opt => valueSelector(opt) === rowValueSelector(value));
181
+ const equals = (value, option) => option === undefined ? false : valueSelector(option) === rowValueSelector(value);
182
+ const searchOptions = search
183
+ ? Object.assign({ filter: objectSearch }, (typeof search === 'boolean' ? {} : search)) : undefined;
184
+ if (multiple) {
185
+ const FilterCell = ({ value, onChange }) => {
186
+ const handleChange = (option, checked, event) => {
187
+ const val = checked
188
+ ? (value !== null && value !== void 0 ? value : []).concat(option)
189
+ : (value !== null && value !== void 0 ? value : []).filter(opt => valueSelector
190
+ ? valueSelector(opt) !== valueSelector(option)
191
+ : option !== opt);
192
+ onChange({
193
+ value: val.length ? toJS(val) : undefined,
194
+ operator: val.length ? operator !== null && operator !== void 0 ? operator : contains : '',
195
+ syntheticEvent: event,
196
+ });
197
+ };
198
+ return (_jsx(SelectorAsync, { selected: value !== null && value !== void 0 ? value : [], itemComponent: SelectorItemMultiple, onChange: handleChange, search: searchOptions, renderItem: renderer, dataFetcher: dataFetcher, data: data, valueSelector: valueSelector }));
199
+ };
200
+ return renderCustomColumnMenuFilter(FilterCell, opts);
201
+ }
202
+ const FilterCell = ({ value, onChange }) => {
203
+ const handleChange = (option, _, event) => {
204
+ onChange({
205
+ value: toJS(option),
206
+ operator: operator !== null && operator !== void 0 ? operator : equals,
207
+ syntheticEvent: event,
208
+ });
209
+ };
210
+ return (_jsx(SelectorAsync, { selected: value ? [value] : [], onChange: handleChange, itemComponent: SelectorItemSingle, search: searchOptions, renderItem: renderer, dataFetcher: dataFetcher, data: data, valueSelector: valueSelector }));
211
+ };
212
+ return renderCustomColumnMenuFilter(FilterCell, opts);
213
+ }
214
+ //# sourceMappingURL=select-filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-filter.js","sourceRoot":"","sources":["../../../src/filters/select-filter/select-filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAA6B,QAAQ,EAAqB,MAAM,OAAO,CAAC;AAE1F,OAAO,EACH,QAAQ,EAER,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,GACX,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEH,4BAA4B,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA4B/C,IAAM,aAAa,GAAnB,MAAM,aAAkB,SAAQ,SAA4B;IAMxD,YAAY,KAAwB;QAChC,KAAK,CAAC,KAAK,CAAC,CAAC;QANL;;;;mBAAqB,EAAE;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QAAQ,GAAI,MAAM;gBAC5B,cAAc,EAAE,KAAK;aACxB,CAAC,CAAC;QACP,CAAC,CAAC;QAEF,OAAO,CACH,KAAC,aAAa,IACV,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAC9B,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,kBAAkB,EACjC,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,QAAQ,EACpB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,aAAa,GAC9B,CACL,CAAC;IACN,CAAC,CAAC;IAEF,OAAO,4BAA4B,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const AsyncSelect: () => JSX.Element;
7
+ export declare const SyncSelect: () => JSX.Element;
8
+ //# sourceMappingURL=select-filter.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-filter.stories.d.ts","sourceRoot":"","sources":["../../../src/filters/select-filter/select-filter.stories.tsx"],"names":[],"mappings":";;;;AAEA,wBAEE;AAEF,eAAO,MAAM,WAAW,mBAA+B,CAAC;AACxD,eAAO,MAAM,UAAU,mBAA8B,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { SelectAsyncExample, SelectSyncExample } from '../../demo/filters/select-filter';
3
+ export default {
4
+ title: 'Table/Filters/Select',
5
+ };
6
+ export const AsyncSelect = () => _jsx(SelectAsyncExample, {});
7
+ export const SyncSelect = () => _jsx(SelectSyncExample, {});
8
+ //# sourceMappingURL=select-filter.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-filter.stories.js","sourceRoot":"","sources":["../../../src/filters/select-filter/select-filter.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAEzF,eAAe;IACX,KAAK,EAAE,sBAAsB;CAChC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,KAAC,kBAAkB,KAAG,CAAC;AACxD,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,KAAC,iBAAiB,KAAG,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IdType } from '@servicetitan/data-query';
2
+ export declare const getSimpleValue: (item: any) => IdType;
3
+ //# sourceMappingURL=value-getter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-getter.d.ts","sourceRoot":"","sources":["../../../src/filters/select-filter/value-getter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,eAAO,MAAM,cAAc,SAAU,GAAG,KAAG,MAU1C,CAAC"}
@@ -0,0 +1,10 @@
1
+ export const getSimpleValue = (item) => {
2
+ if (item === null) {
3
+ return item;
4
+ }
5
+ if (typeof item === 'object' || typeof item === 'function') {
6
+ return `${item}`;
7
+ }
8
+ return item;
9
+ };
10
+ //# sourceMappingURL=value-getter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value-getter.js","sourceRoot":"","sources":["../../../src/filters/select-filter/value-getter.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAS,EAAU,EAAE;IAChD,IAAI,IAAI,KAAK,IAAI,EAAE;QACf,OAAO,IAAI,CAAC;KACf;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;QACxD,OAAO,GAAG,IAAI,EAAE,CAAC;KACpB;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { IdType } from '@servicetitan/data-query';
3
- export interface SingleSelectColumnMenuOptions<TV, TO = TV> {
3
+ import { CustomColumnMenuFilterSingleOpts } from '../column-menu-filters';
4
+ export interface SingleSelectColumnMenuOptions<TV, TO = TV> extends CustomColumnMenuFilterSingleOpts {
4
5
  options: TO[];
5
6
  valueSelector?: (item: TO) => TV;
6
7
  renderItem?: (item: TO) => ReactNode | string;
7
8
  filterOperator?: (listItem: any, value: TV) => boolean;
8
9
  }
9
- export declare function singleSelectColumnMenuFilter<TV extends IdType, TO = TV>(props: SingleSelectColumnMenuOptions<TV, TO>): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
10
+ export declare function singleSelectColumnMenuFilter<TV extends IdType, TO = TV>({ options, valueSelector, renderItem, filterOperator, ...opts }: SingleSelectColumnMenuOptions<TV, TO>): (props: import("@servicetitan/design-system").TableColumnMenuProps) => JSX.Element;
10
11
  //# 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,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"}
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;AAGlD,OAAO,EACH,gCAAgC,EAEnC,MAAM,wBAAwB,CAAC;AA8BhC,MAAM,WAAW,6BAA6B,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CACtD,SAAQ,gCAAgC;IACxC,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,EAAE,EACrE,OAAO,EACP,aAAa,EACb,UAAU,EACV,cAAc,EACd,GAAG,IAAI,EACV,EAAE,6BAA6B,CAAC,EAAE,EAAE,EAAE,CAAC,sFA6BvC"}