@creekjs/web-components 1.0.2 → 1.0.4

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 (154) hide show
  1. package/.fatherrc.ts +1 -5
  2. package/.turbo/turbo-father$colon$build.log +39 -0
  3. package/.turbo/turbo-father$colon$dev.log +33 -0
  4. package/dist/creek-config-provider/CreekConfigContext.js +31 -2
  5. package/dist/creek-config-provider/CreekConfigContext.js.map +7 -0
  6. package/dist/creek-config-provider/index.js +35 -13
  7. package/dist/creek-config-provider/index.js.map +7 -0
  8. package/dist/creek-hooks/index.d.ts +1 -0
  9. package/dist/creek-hooks/index.js +26 -1
  10. package/dist/creek-hooks/index.js.map +7 -0
  11. package/dist/creek-hooks/useApp/DrawerHelper.d.ts +9 -0
  12. package/dist/creek-hooks/useApp/DrawerHelper.js +62 -0
  13. package/dist/creek-hooks/useApp/DrawerHelper.js.map +7 -0
  14. package/dist/creek-hooks/useApp/ModalHelper.d.ts +9 -0
  15. package/dist/creek-hooks/useApp/ModalHelper.js +62 -0
  16. package/dist/creek-hooks/useApp/ModalHelper.js.map +7 -0
  17. package/dist/creek-hooks/useApp/index.d.ts +25 -0
  18. package/dist/creek-hooks/useApp/index.js +118 -0
  19. package/dist/creek-hooks/useApp/index.js.map +7 -0
  20. package/dist/creek-hooks/useApp/types.d.ts +26 -0
  21. package/dist/creek-hooks/useApp/types.js +18 -0
  22. package/dist/creek-hooks/useApp/types.js.map +7 -0
  23. package/dist/creek-hooks/useViewportHeight.js +99 -97
  24. package/dist/creek-hooks/useViewportHeight.js.map +7 -0
  25. package/dist/creek-icon/index.js +53 -31
  26. package/dist/creek-icon/index.js.map +7 -0
  27. package/dist/creek-keep-alive/index.js +36 -18
  28. package/dist/creek-keep-alive/index.js.map +7 -0
  29. package/dist/creek-layout/CollapseButton.js +69 -47
  30. package/dist/creek-layout/CollapseButton.js.map +7 -0
  31. package/dist/creek-layout/Exception/NotFound.js +42 -13
  32. package/dist/creek-layout/Exception/NotFound.js.map +7 -0
  33. package/dist/creek-layout/Exception/NotFoundPage.js +30 -5
  34. package/dist/creek-layout/Exception/NotFoundPage.js.map +7 -0
  35. package/dist/creek-layout/Exception/index.js +37 -8
  36. package/dist/creek-layout/Exception/index.js.map +7 -0
  37. package/dist/creek-layout/HeaderContent/FullScreen.js +45 -39
  38. package/dist/creek-layout/HeaderContent/FullScreen.js.map +7 -0
  39. package/dist/creek-layout/HeaderContent/UserInfo.js +75 -53
  40. package/dist/creek-layout/HeaderContent/UserInfo.js.map +7 -0
  41. package/dist/creek-layout/HeaderContent/index.js +48 -28
  42. package/dist/creek-layout/HeaderContent/index.js.map +7 -0
  43. package/dist/creek-layout/index.js +117 -81
  44. package/dist/creek-layout/index.js.map +7 -0
  45. package/dist/creek-loading/index.js +55 -48
  46. package/dist/creek-loading/index.js.map +7 -0
  47. package/dist/creek-table/SearchTable.js +118 -114
  48. package/dist/creek-table/SearchTable.js.map +7 -0
  49. package/dist/creek-table/TableOptionRender.js +69 -60
  50. package/dist/creek-table/TableOptionRender.js.map +7 -0
  51. package/dist/creek-table/hooks/index.d.ts +2 -1
  52. package/dist/creek-table/hooks/index.js +30 -3
  53. package/dist/creek-table/hooks/index.js.map +7 -0
  54. package/dist/creek-table/hooks/useAdaptiveToolBar.js +48 -36
  55. package/dist/creek-table/hooks/useAdaptiveToolBar.js.map +7 -0
  56. package/dist/creek-table/hooks/useAutoWidthColumns.d.ts +6 -0
  57. package/dist/creek-table/hooks/useAutoWidthColumns.js +187 -0
  58. package/dist/creek-table/hooks/useAutoWidthColumns.js.map +7 -0
  59. package/dist/creek-table/hooks/useElementDistance.js +51 -39
  60. package/dist/creek-table/hooks/useElementDistance.js.map +7 -0
  61. package/dist/creek-table/hooks/useTableScrollHeight.d.ts +1 -0
  62. package/dist/creek-table/hooks/useTableScrollHeight.js +72 -0
  63. package/dist/creek-table/hooks/useTableScrollHeight.js.map +7 -0
  64. package/dist/creek-table/index.js +35 -25
  65. package/dist/creek-table/index.js.map +7 -0
  66. package/dist/creek-table/toolBarRender.d.ts +1 -0
  67. package/dist/creek-table/toolBarRender.js +55 -33
  68. package/dist/creek-table/toolBarRender.js.map +7 -0
  69. package/dist/creek-table/type.d.ts +1 -1
  70. package/dist/creek-table/type.js +18 -1
  71. package/dist/creek-table/type.js.map +7 -0
  72. package/dist/index.d.ts +1 -2
  73. package/dist/index.js +34 -7
  74. package/dist/index.js.map +7 -0
  75. package/package.json +2 -2
  76. package/src/creek-hooks/index.ts +2 -0
  77. package/src/creek-hooks/useApp/DrawerHelper.tsx +43 -0
  78. package/src/creek-hooks/useApp/ModalHelper.tsx +43 -0
  79. package/src/creek-hooks/useApp/index.tsx +119 -0
  80. package/src/creek-hooks/useApp/types.ts +25 -0
  81. package/src/creek-hooks/useViewportHeight.tsx +34 -5
  82. package/src/creek-layout/index.tsx +2 -2
  83. package/src/creek-table/SearchTable.tsx +69 -77
  84. package/src/creek-table/hooks/index.ts +3 -1
  85. package/src/creek-table/hooks/useAutoWidthColumns.tsx +212 -0
  86. package/src/creek-table/hooks/useTableScrollHeight.tsx +63 -0
  87. package/src/creek-table/index.tsx +2 -6
  88. package/src/creek-table/toolBarRender.tsx +3 -3
  89. package/src/creek-table/type.ts +1 -1
  90. package/src/index.tsx +2 -2
  91. package/dist/bg-center/index.d.ts +0 -5
  92. package/dist/bg-center/index.d.ts.map +0 -1
  93. package/dist/bg-center/index.js +0 -28
  94. package/dist/creek-config-provider/CreekConfigContext.d.ts.map +0 -1
  95. package/dist/creek-config-provider/index.d.ts.map +0 -1
  96. package/dist/creek-hooks/index.d.ts.map +0 -1
  97. package/dist/creek-hooks/useViewportHeight.d.ts.map +0 -1
  98. package/dist/creek-icon/index.d.ts.map +0 -1
  99. package/dist/creek-keep-alive/index.d.ts.map +0 -1
  100. package/dist/creek-layout/CollapseButton.d.ts.map +0 -1
  101. package/dist/creek-layout/Exception/NotFound.d.ts.map +0 -1
  102. package/dist/creek-layout/Exception/NotFoundPage.d.ts.map +0 -1
  103. package/dist/creek-layout/Exception/index.d.ts.map +0 -1
  104. package/dist/creek-layout/HeaderContent/FullScreen.d.ts.map +0 -1
  105. package/dist/creek-layout/HeaderContent/UserInfo.d.ts.map +0 -1
  106. package/dist/creek-layout/HeaderContent/index.d.ts.map +0 -1
  107. package/dist/creek-layout/index.d.ts.map +0 -1
  108. package/dist/creek-loading/index.d.ts.map +0 -1
  109. package/dist/creek-search/CreekSearch.d.ts +0 -7
  110. package/dist/creek-search/CreekSearch.d.ts.map +0 -1
  111. package/dist/creek-search/CreekSearch.js +0 -51
  112. package/dist/creek-search/CreekSearchContext.d.ts +0 -54
  113. package/dist/creek-search/CreekSearchContext.d.ts.map +0 -1
  114. package/dist/creek-search/CreekSearchContext.js +0 -546
  115. package/dist/creek-search/CreekSearchFilterDisplay.d.ts +0 -5
  116. package/dist/creek-search/CreekSearchFilterDisplay.d.ts.map +0 -1
  117. package/dist/creek-search/CreekSearchFilterDisplay.js +0 -97
  118. package/dist/creek-search/CreekSearchInput.d.ts +0 -4
  119. package/dist/creek-search/CreekSearchInput.d.ts.map +0 -1
  120. package/dist/creek-search/CreekSearchInput.js +0 -96
  121. package/dist/creek-search/CreekSearchValueSelector.d.ts +0 -5
  122. package/dist/creek-search/CreekSearchValueSelector.d.ts.map +0 -1
  123. package/dist/creek-search/CreekSearchValueSelector.js +0 -422
  124. package/dist/creek-search/index.d.ts +0 -5
  125. package/dist/creek-search/index.d.ts.map +0 -1
  126. package/dist/creek-search/index.js +0 -5
  127. package/dist/creek-search/type.d.ts +0 -8
  128. package/dist/creek-search/type.d.ts.map +0 -1
  129. package/dist/creek-search/type.js +0 -1
  130. package/dist/creek-table/SearchTable.d.ts.map +0 -1
  131. package/dist/creek-table/TableOptionRender.d.ts.map +0 -1
  132. package/dist/creek-table/TableViewContent.d.ts +0 -4
  133. package/dist/creek-table/TableViewContent.d.ts.map +0 -1
  134. package/dist/creek-table/TableViewContent.js +0 -47
  135. package/dist/creek-table/hooks/index.d.ts.map +0 -1
  136. package/dist/creek-table/hooks/useAdaptiveToolBar.d.ts.map +0 -1
  137. package/dist/creek-table/hooks/useAutoAddFilterToColumns.d.ts +0 -12
  138. package/dist/creek-table/hooks/useAutoAddFilterToColumns.d.ts.map +0 -1
  139. package/dist/creek-table/hooks/useAutoAddFilterToColumns.js +0 -96
  140. package/dist/creek-table/hooks/useElementDistance.d.ts.map +0 -1
  141. package/dist/creek-table/index.d.ts.map +0 -1
  142. package/dist/creek-table/toolBarRender.d.ts.map +0 -1
  143. package/dist/creek-table/type.d.ts.map +0 -1
  144. package/dist/index.d.ts.map +0 -1
  145. package/src/bg-center/index.tsx +0 -26
  146. package/src/creek-search/CreekSearch.tsx +0 -60
  147. package/src/creek-search/CreekSearchContext.tsx +0 -593
  148. package/src/creek-search/CreekSearchFilterDisplay.tsx +0 -84
  149. package/src/creek-search/CreekSearchInput.tsx +0 -75
  150. package/src/creek-search/CreekSearchValueSelector.tsx +0 -324
  151. package/src/creek-search/index.tsx +0 -5
  152. package/src/creek-search/type.ts +0 -9
  153. package/src/creek-table/TableViewContent.tsx +0 -46
  154. package/src/creek-table/hooks/useAutoAddFilterToColumns.tsx +0 -90
@@ -1,16 +1,12 @@
1
1
  import { ParamsType } from '@ant-design/pro-components';
2
2
 
3
- import { CreekSearchProvider } from '../creek-search';
4
-
5
3
  import { SearchProTable } from './SearchTable';
6
4
  import { CreekTableProps } from './type';
7
5
 
8
6
  export const CreekTable = <T extends ParamsType, U extends ParamsType, ValueType = 'text'>(props: CreekTableProps<T, U, ValueType>) => {
9
- const { columns = [], onSubmit, ...restProps } = props;
7
+ const { columns = [], ...restProps } = props;
10
8
 
11
9
  return (
12
- <CreekSearchProvider columns={columns} onSubmit={onSubmit}>
13
- <SearchProTable columns={columns} {...restProps} />
14
- </CreekSearchProvider>
10
+ <SearchProTable columns={columns} {...restProps} />
15
11
  );
16
12
  };
@@ -1,10 +1,10 @@
1
1
  import { DownOutlined } from '@ant-design/icons';
2
2
  import { Button, Dropdown } from 'antd';
3
3
 
4
- export const toolBarRender = (options: { shouldCollapse: boolean; restProps: any }) => {
5
- const { shouldCollapse, restProps } = options;
4
+ export const toolBarRender = (options: { shouldCollapse: boolean; restProps: any; args?: any[] }) => {
5
+ const { shouldCollapse, restProps, args = [] } = options;
6
6
 
7
- const baseActions = restProps.toolBarRender?.() || [];
7
+ const baseActions = restProps.toolBarRender?.(...args) || [];
8
8
  if (!shouldCollapse || baseActions.length <= 1) {
9
9
  return baseActions;
10
10
  }
@@ -6,7 +6,7 @@ export type OptionRenderCustom = {
6
6
  onClick?: () => void;
7
7
  };
8
8
 
9
- export type CreekTableProps<T extends ParamsType, U extends ParamsType, ValueType = 'text'> = Omit<ProTableProps<T, U, ValueType>, 'search' | 'options'> & {
9
+ export type CreekTableProps<T extends ParamsType, U extends ParamsType, ValueType = 'text'> = Omit<ProTableProps<T, U, ValueType>, 'options'> & {
10
10
  pageFixedBottom?: boolean; // 是否固定分页在底部
11
11
  pageFixedBottomConfig?: {
12
12
  /** 底部保留空间(如固定在底部的元素高度),默认 0 */
package/src/index.tsx CHANGED
@@ -1,8 +1,8 @@
1
- export * from './bg-center';
1
+
2
2
  export * from './creek-config-provider';
3
+ export * from './creek-hooks';
3
4
  export * from './creek-icon';
4
5
  export * from './creek-layout';
5
6
  export * from './creek-loading';
6
- export * from './creek-search';
7
7
  export * from './creek-table';
8
8
 
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- export type BgCenterProps = {
3
- children: React.ReactNode;
4
- };
5
- export declare const BgCenter: ({ children }: BgCenterProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bg-center/index.tsx"],"names":[],"mappings":";AAEA,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,QAAQ,iBAAkB,aAAa,4CAmBnD,CAAC"}
@@ -1,28 +0,0 @@
1
- import { createStyles } from 'antd-style';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- export var BgCenter = function BgCenter(_ref) {
4
- var children = _ref.children;
5
- var useStyles = createStyles(function (_ref2) {
6
- var token = _ref2.token;
7
- return {
8
- bgCenterContianer: {
9
- display: 'flex',
10
- alignItems: 'center',
11
- justifyContent: 'center',
12
- position: 'fixed',
13
- top: 0,
14
- left: 0,
15
- right: 0,
16
- bottom: 0,
17
- backgroundColor: 'rgba(255, 255, 255, 0.7)',
18
- zIndex: token.zIndexBase
19
- }
20
- };
21
- });
22
- var _useStyles = useStyles(),
23
- styles = _useStyles.styles;
24
- return /*#__PURE__*/_jsx("div", {
25
- className: styles.bgCenterContianer,
26
- children: children
27
- });
28
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreekConfigContext.d.ts","sourceRoot":"","sources":["../../src/creek-config-provider/CreekConfigContext.tsx"],"names":[],"mappings":";AAEA,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,kDAA6C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/creek-config-provider/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAsB,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,GAAG;IAC/D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,mBAAmB;YAAW,wBAAwB;;CAGlE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/creek-hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useViewportHeight.d.ts","sourceRoot":"","sources":["../../src/creek-hooks/useViewportHeight.tsx"],"names":[],"mappings":";AAGA,UAAU,wBAAwB;IAChC,+BAA+B;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yBAAyB;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC;IAE5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,iBAAiB,aAAa,wBAAwB;IA0H/D,wBAAwB;;IAExB,kBAAkB;;IAElB,kBAAkB;;IAElB,gBAAgB;;CAGnB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/creek-icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,IAA8B,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAIrC,OAAO,EAAuB,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzF,KAAK,wBAAwB,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEtD,MAAM,MAAM,cAAc,GAAG,wBAAwB,GAAG;IACtD,WAAW,CAAC,EAAE,wBAAwB,CAAC,aAAa,CAAC,CAAC;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,wBAAwB,CAAC,WAAW,CAAC,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,cAAc,mDAkB9C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/creek-keep-alive/index.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,+CAQ1B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CollapseButton.d.ts","sourceRoot":"","sources":["../../src/creek-layout/CollapseButton.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAiBF,eAAO,MAAM,iBAAiB,mFAU5B,CAAC;AAEH,eAAO,MAAM,eAAe,UAAW,oBAAoB,4CAwB1D,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotFound.d.ts","sourceRoot":"","sources":["../../../src/creek-layout/Exception/NotFound.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,+CASpB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotFoundPage.d.ts","sourceRoot":"","sources":["../../../src/creek-layout/Exception/NotFoundPage.tsx"],"names":[],"mappings":";AACA,wBAEE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/creek-layout/Exception/index.tsx"],"names":[],"mappings":";AAAA,cAAc,YAAY,CAAC;AAE3B,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,cAAc,4CAG9C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FullScreen.d.ts","sourceRoot":"","sources":["../../../src/creek-layout/HeaderContent/FullScreen.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,8EAU7B,CAAC;AAEH,eAAO,MAAM,UAAU,+CAuBtB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserInfo.d.ts","sourceRoot":"","sources":["../../../src/creek-layout/HeaderContent/UserInfo.tsx"],"names":[],"mappings":"AAuBA,eAAO,MAAM,QAAQ,+CA8BpB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/creek-layout/HeaderContent/index.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,aAAa,+CAWzB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/creek-layout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,cAAc,EAAE,MAAM,4BAA4B,CAAC;AASvE,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG;IACzC,aAAa,EAAE,cAAc,CAAC;IAC9B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5C,WAAW,CAAC,EAAE;QACZ,YAAY,EAAE,GAAG,CAAC;QAClB,OAAO,EAAE,OAAO,CAAC;QACjB,eAAe,EAAE,MAAM,IAAI,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,WAAW,4CA4E7C,CAAC;AAEF,cAAc,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/creek-loading/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,qBAAa,OAAO;IAClB,OAAO,CAAC,MAAM,CAAC,SAAS,CAA+B;IACvD,OAAO,CAAC,MAAM,CAAC,IAAI,CAA8C;IAEjE,OAAO,CAAC,MAAM,CAAC,eAAe;IAS9B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC;IAMtD,MAAM,CAAC,KAAK;CAWb"}
@@ -1,7 +0,0 @@
1
- import { ParamsType, ProColumnType } from '@ant-design/pro-components';
2
- export type CreekSearchProps<T> = {
3
- columns: ProColumnType<T>[];
4
- onSubmit?: (values: Record<string, any>) => void;
5
- justify?: 'start' | 'end';
6
- };
7
- export declare const CreekSearch: <T extends ParamsType>(props: CreekSearchProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreekSearch.d.ts","sourceRoot":"","sources":["../../src/creek-search/CreekSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAqCvE,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IACjD,OAAO,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,WAAW,gCAAiC,iBAAiB,CAAC,CAAC,4CAgB3E,CAAC"}
@@ -1,51 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
- import { createStyles } from 'antd-style';
6
- import classnames from 'classnames';
7
- import { CreekSearchProvider } from "./CreekSearchContext";
8
- import { CreekFilterDisplay } from "./CreekSearchFilterDisplay";
9
- import { CreekSearchInput } from "./CreekSearchInput";
10
- import { jsx as _jsx } from "react/jsx-runtime";
11
- import { jsxs as _jsxs } from "react/jsx-runtime";
12
- var useStyles = createStyles(function (_ref, props) {
13
- var token = _ref.token,
14
- prefixCls = _ref.prefixCls;
15
- return {
16
- creekSearchContainer: {
17
- padding: '20px 20px 0 20px',
18
- width: '100%',
19
- display: 'flex',
20
- flexDirection: 'column',
21
- alignItems: props.justify === 'end' ? 'flex-end' : 'flex-start'
22
- },
23
- creekSearchContainerEnd: _defineProperty({}, "& .".concat(prefixCls, "-tag"), {
24
- marginInlineEnd: 0
25
- }),
26
- creekSearchFilterDisplay: {
27
- marginTop: '10px'
28
- }
29
- };
30
- });
31
- export var CreekSearch = function CreekSearch(props) {
32
- var _props$columns = props.columns,
33
- columns = _props$columns === void 0 ? [] : _props$columns,
34
- onSubmit = props.onSubmit,
35
- _props$justify = props.justify,
36
- justify = _props$justify === void 0 ? 'start' : _props$justify;
37
- var _useStyles = useStyles({
38
- justify: justify
39
- }),
40
- styles = _useStyles.styles;
41
- return /*#__PURE__*/_jsx(CreekSearchProvider, {
42
- columns: columns,
43
- onSubmit: onSubmit,
44
- children: /*#__PURE__*/_jsxs("div", {
45
- className: classnames(styles.creekSearchContainer, justify === 'end' && styles.creekSearchContainerEnd),
46
- children: [/*#__PURE__*/_jsx(CreekSearchInput, {}), /*#__PURE__*/_jsx(CreekFilterDisplay, {
47
- className: styles.creekSearchFilterDisplay
48
- })]
49
- })
50
- });
51
- };
@@ -1,54 +0,0 @@
1
- import { ParamsType, ProColumnType, ProTableProps } from '@ant-design/pro-components';
2
- import React, { ReactNode } from 'react';
3
- import { CreekSearchAddFilterOption, CreekSearchFilter } from './type';
4
- interface ValueTypeConfig {
5
- showValueSelector: boolean;
6
- dateFormat?: string;
7
- isRange?: boolean;
8
- isDateTime?: boolean;
9
- displayName: string;
10
- componentType: 'input' | 'select' | 'date' | 'dateRange' | 'time' | 'timeRange' | 'number' | 'switch' | 'radio' | 'checkbox';
11
- }
12
- export interface SearchContextValue<T extends ParamsType, U extends ParamsType, ValueType = 'text'> {
13
- searchValue: string;
14
- filters: CreekSearchFilter[];
15
- showValueSelector: boolean;
16
- selectedColumn: ProColumnType<T, U>;
17
- tempValue: any;
18
- inputRef: React.RefObject<any>;
19
- columns: ProTableProps<T, U, ValueType>['columns'];
20
- filterOptions: ProTableProps<T, U, ValueType>['columns'];
21
- onSubmit?: (params: U) => void;
22
- beforeSearchSubmit?: (params: Record<string, any>) => Record<string, any>;
23
- setSearchValue: (value: string) => void;
24
- setFilters: React.Dispatch<React.SetStateAction<CreekSearchFilter[]>>;
25
- setShowValueSelector: (show: boolean) => void;
26
- setSelectedColumn: (column: any) => void;
27
- setTempValue: (value: any) => void;
28
- handleSearch: (value: string) => void;
29
- handleSelectColumn: (value: string) => void;
30
- addFilter: (key: string, option: CreekSearchAddFilterOption) => void;
31
- confirmAddFilter: () => void;
32
- cancelValueSelector: () => void;
33
- removeFilter: (filterId: string) => void;
34
- handelRest: () => void;
35
- getColumnOptions: (column: any) => Array<{
36
- label: string;
37
- value: string;
38
- }>;
39
- getDisplayText: (column: any, value: any) => any;
40
- hasOptions: (column: any) => boolean;
41
- filtersToParams: (filters: CreekSearchFilter[]) => ParamsType;
42
- getValueTypeConfig: (valueType?: ProColumnType<T, U>['valueType']) => ValueTypeConfig;
43
- formatDateValue: (value: any, config: ValueTypeConfig) => string | string[];
44
- shouldShowValueSelector: (column: any) => boolean;
45
- }
46
- export declare const useSearchContext: <T extends ParamsType, U extends ParamsType, ValueType = "text">() => SearchContextValue<T, U, ValueType>;
47
- interface CreekSearchProviderProps<T extends ParamsType, U extends ParamsType, ValueType = 'text'> {
48
- columns: ProTableProps<T, U, ValueType>['columns'];
49
- onSubmit?: (params: U) => void;
50
- beforeSearchSubmit?: (params: Record<string, any>) => Record<string, any>;
51
- children: ReactNode;
52
- }
53
- export declare const CreekSearchProvider: <T extends ParamsType, U extends ParamsType, ValueType = "text">({ columns, onSubmit, beforeSearchSubmit, children, }: CreekSearchProviderProps<T, U, ValueType>) => import("react/jsx-runtime").JSX.Element;
54
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreekSearchContext.d.ts","sourceRoot":"","sources":["../../src/creek-search/CreekSearchContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAGtF,OAAO,KAAK,EAAE,EAAiB,SAAS,EAAgC,MAAM,OAAO,CAAC;AAEtF,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAGvE,UAAU,eAAe;IAEvB,iBAAiB,EAAE,OAAO,CAAC;IAE3B,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,WAAW,EAAE,MAAM,CAAC;IAEpB,aAAa,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;CAC9H;AAsLD,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,UAAU,EAAE,SAAS,GAAG,MAAM;IAEhG,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,iBAAiB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