@kmkf-fe-packages/basic-components 2.2.10 → 2.2.11

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.
@@ -1,5 +1,6 @@
1
- export declare const processGoods: ({ list, type, canUpdateNumber, }: {
1
+ export declare const processGoods: ({ list, type, canUpdateNumber, source, }: {
2
2
  list: any[];
3
3
  type: string;
4
4
  canUpdateNumber: boolean;
5
+ source?: "erp" | "workOrder" | undefined;
5
6
  }) => any[];
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { GoodsSourceFormatType, GoodsSourceType } from '../model/type';
2
3
  import { FormInstance } from 'antd/es/form';
3
4
  interface BsGoodsProps {
4
5
  form: FormInstance;
@@ -30,6 +31,8 @@ interface BsGoodsProps {
30
31
  onSelect: (val: any[]) => void;
31
32
  onDelete: (val: any[]) => void;
32
33
  onModeChange: (val: boolean) => void;
34
+ goodsSource?: GoodsSourceType;
35
+ useGoodsSourceFormat: (goodsSource?: GoodsSourceType) => GoodsSourceFormatType;
33
36
  tradeGoods?: {
34
37
  uniqueKey?: string;
35
38
  originDataSource: Array<any>;
@@ -39,6 +42,11 @@ interface BsGoodsProps {
39
42
  systemOrders?: any[];
40
43
  selectedSystemOrders?: any[];
41
44
  }
45
+ type MakeRequired<T, K extends keyof T> = {
46
+ [P in K]-?: T[P];
47
+ } & {
48
+ [P in Exclude<keyof T, K>]: T[P];
49
+ };
42
50
  type SelectTradeGoodsProps = {
43
51
  columns: Array<any>;
44
52
  dataSource: Array<any>;
@@ -53,5 +61,5 @@ type SelectTradeGoodsProps = {
53
61
  width?: number;
54
62
  };
55
63
  export declare const SelectTradeGoods: ({ columns, dataSource, getDataSourceAsync, selectedRowKeys, onChangeSelectedKeys, uniqueKey, isGoods, systemOrders, selectedSystemOrders, type, width, }: SelectTradeGoodsProps) => React.JSX.Element;
56
- declare const GoodItem: (props: Partial<BsGoodsProps>) => React.JSX.Element;
64
+ declare const GoodItem: (props: MakeRequired<Partial<BsGoodsProps>, 'useGoodsSourceFormat'>) => React.JSX.Element;
57
65
  export default GoodItem;
@@ -1,12 +1,4 @@
1
1
  import React from 'react';
2
- interface GoodModelProps {
3
- shopId: number | string;
4
- maxLength: number;
5
- shopList: any[];
6
- width?: string | number;
7
- shopCode?: string;
8
- companyKey: string;
9
- onSubmit: (...args: any[]) => any;
10
- }
11
- declare const _default: React.ForwardRefExoticComponent<GoodModelProps & React.RefAttributes<unknown>>;
2
+ import type { ErpGoodModelProps } from './type';
3
+ declare const _default: React.ForwardRefExoticComponent<ErpGoodModelProps<any[]> & React.RefAttributes<unknown>>;
12
4
  export default _default;
@@ -1,12 +1,4 @@
1
1
  import React from 'react';
2
- interface GoodModelProps {
3
- shopId: number | string;
4
- maxLength: number;
5
- shopList: any[];
6
- width?: string | number;
7
- shopCode?: string;
8
- companyKey: string;
9
- onSubmit: (...args: any[]) => any;
10
- }
11
- declare const _default: React.ForwardRefExoticComponent<GoodModelProps & React.RefAttributes<unknown>>;
2
+ import type { ErpGoodModelProps } from './type';
3
+ declare const _default: React.ForwardRefExoticComponent<ErpGoodModelProps<any[]> & React.RefAttributes<unknown>>;
12
4
  export default _default;
@@ -1,12 +1,4 @@
1
1
  import React from 'react';
2
- interface GoodModelProps {
3
- shopId: number | string;
4
- maxLength: number;
5
- shopList: any[];
6
- width?: string | number;
7
- shopCode?: string;
8
- companyKey: string;
9
- onSubmit: (...args: any[]) => any;
10
- }
11
- declare const _default: React.ForwardRefExoticComponent<GoodModelProps & React.RefAttributes<unknown>>;
2
+ import type { ErpGoodModelProps } from './type';
3
+ declare const _default: React.ForwardRefExoticComponent<ErpGoodModelProps<any[]> & React.RefAttributes<unknown>>;
12
4
  export default _default;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ type RateProps = {
3
+ value: (number | null)[];
4
+ onChange: (v: (number | null)[]) => void;
5
+ placeholder: string[];
6
+ prefix: string;
7
+ };
8
+ declare const Rate: ({ value, onChange, placeholder, prefix }: RateProps) => React.JSX.Element;
9
+ export default Rate;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const TrimInput: (props: any) => React.JSX.Element;
3
+ export default TrimInput;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const FilterSelectOption: (props: any) => React.JSX.Element | null;
3
+ export default FilterSelectOption;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { PropsWithChildren } from 'react';
3
+ import './index.less';
4
+ type SearchHeaderPropsType = {
5
+ fixedFields: string[];
6
+ allFields: any[];
7
+ status: boolean;
8
+ layout?: 'inner' | 'block';
9
+ isShowTime?: boolean;
10
+ timeOptions?: {
11
+ label: string;
12
+ value: string;
13
+ }[];
14
+ ShopList: React.JSX.Element;
15
+ };
16
+ declare const SearchHeader: ({ allFields, children, status, layout, isShowTime, timeOptions, ShopList, }: PropsWithChildren<SearchHeaderPropsType>) => React.JSX.Element;
17
+ export default SearchHeader;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { FormInstance } from 'antd';
3
+ declare const SearchForm: (props: {
4
+ filterItems?: any[];
5
+ form: FormInstance;
6
+ ShopList: React.JSX.Element;
7
+ submit: () => void;
8
+ reset: () => void;
9
+ }) => React.JSX.Element;
10
+ export default SearchForm;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface SelectDrawerRefObject {
3
+ getSelectGoodList: () => any[];
4
+ }
5
+ declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<SelectDrawerRefObject>>;
6
+ export default _default;
@@ -1,9 +1,53 @@
1
- export interface ErpGoodModelProps<T> {
1
+ /// <reference types="react" />
2
+ export type GoodsSourceFormatType = {
3
+ filterItems?: any[];
4
+ flowNodeId: string;
5
+ templateKey: string;
6
+ flowTemplateKey: string;
7
+ ShopList: React.JSX.Element;
8
+ tableColumns: any[];
9
+ workOrderDataToGoods: (data: Record<string, any>, erp: string) => Record<string, any>;
10
+ queryComponentsConfig: {
11
+ filterType: 'some' | 'every';
12
+ preQueryComponents: {
13
+ key: string;
14
+ symbol: string;
15
+ value?: any;
16
+ }[];
17
+ };
18
+ };
19
+ export type GoodsSourceType = {
20
+ source?: 'workOrder' | 'erp';
21
+ sourceSettings?: {
22
+ filterMode?: 'some' | 'every';
23
+ filterRules?: {
24
+ leftValue: string;
25
+ compareSymbol: any;
26
+ rightValue?: any;
27
+ }[];
28
+ dataFilterConfig: {
29
+ [cpId: string]: {
30
+ isFilter?: boolean;
31
+ isShow?: boolean;
32
+ };
33
+ };
34
+ keyMap: {
35
+ [key: string]: string;
36
+ };
37
+ workOrder: {
38
+ flowTemplateKey: string;
39
+ nodeId: string;
40
+ };
41
+ };
42
+ };
43
+ export interface ErpGoodModelProps<T = any[]> {
2
44
  shopId: number | string;
3
45
  maxLength: number;
4
46
  shopList: any[];
5
47
  width?: string | number;
6
48
  shopCode?: string;
7
49
  companyKey: string;
50
+ useGoodsSourceFormat: (goodsSource?: GoodsSourceType) => GoodsSourceFormatType;
51
+ goodsSource?: GoodsSourceType;
8
52
  onSubmit: (goodsList: T) => any;
9
53
  }
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface HighPerformanceTableProps {
4
+ disabledIds?: string[];
5
+ selectedKeys?: string[];
6
+ useSelectCol?: boolean;
7
+ handleChangeSelectedKeys?: (keys: string[]) => void;
8
+ dataSource: any[];
9
+ columns: any[];
10
+ height: number;
11
+ loading: boolean;
12
+ className?: string;
13
+ onRow?: (record: any, rowIndex: number) => void;
14
+ }
15
+ declare const HighPerformanceTable: ({ disabledIds, useSelectCol, selectedKeys, handleChangeSelectedKeys, dataSource, columns, height, loading, className, onRow, }: HighPerformanceTableProps) => React.JSX.Element;
16
+ export default HighPerformanceTable;
@@ -0,0 +1,31 @@
1
+ import { ArtColumnStaticPart, TablePipeline } from 'ali-react-table';
2
+ export declare function always<T>(value: T): (...args: any[]) => T;
3
+ export declare const arrayUtils: {
4
+ readonly diff: (arr1: string[], arr2: Iterable<string>) => string[];
5
+ readonly merge: (arr1: string[], arr2: string[]) => string[];
6
+ };
7
+ export interface MultiSelectFeatureOptions {
8
+ /** 非受控用法:默认选中的值 */
9
+ defaultValue?: string[];
10
+ /** 非受控用法:默认 lastKey */
11
+ defaultLastKey?: string;
12
+ /** 受控用法:当前选中的 keys */
13
+ value?: string[];
14
+ /** 受控用法:上一次操作对应的 rowKey */
15
+ lastKey?: string;
16
+ /** 受控用法:状态改变回调 */
17
+ onChange?: (nextValue: string[], key: string, keys: string[], action: 'check' | 'uncheck' | 'check-all' | 'uncheck-all') => void;
18
+ /** 复选框所在列的位置 */
19
+ checkboxPlacement?: 'start' | 'end';
20
+ /** 复选框所在列的 column 配置,可指定 width,lock, title, align, features 等属性 */
21
+ checkboxColumn?: Partial<ArtColumnStaticPart>;
22
+ /** 是否高亮被选中的行 */
23
+ highlightRowWhenSelected?: boolean;
24
+ /** 判断一行中的 checkbox 是否要禁用 */
25
+ isDisabled?(row: any, rowIndex: number): boolean;
26
+ /** 点击事件的响应区域 */
27
+ clickArea?: 'checkbox' | 'cell' | 'row';
28
+ /** 是否对触发 onChange 的 click 事件调用 event.stopPropagation() */
29
+ stopClickEventPropagation?: boolean;
30
+ }
31
+ export declare function multiSelect(opts?: MultiSelectFeatureOptions): (pipeline: TablePipeline) => TablePipeline;
@@ -6,6 +6,7 @@ interface JstGoodsProps {
6
6
  options: any[];
7
7
  disabled: boolean;
8
8
  onChange: (val: any[]) => void;
9
+ onBlur?: (val: any) => void;
9
10
  showField: string;
10
11
  platformType?: string;
11
12
  onlyShowFieldSelect: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "2.2.10",
3
+ "version": "2.2.11",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,8 +20,9 @@
20
20
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "2.2.10",
23
+ "@kmkf-fe-packages/kmkf-utils": "2.2.11",
24
24
  "ahooks": "^3.7.4",
25
+ "ali-react-table": "2.6.1",
25
26
  "bignumber.js": "^9.1.2",
26
27
  "kmkf-monitor": "^0.8.9",
27
28
  "lodash": "^4.17.21",
@@ -65,5 +66,5 @@
65
66
  "publishConfig": {
66
67
  "access": "public"
67
68
  },
68
- "gitHead": "83e9ea0698aeb5557e811db03dce4299dc67981a"
69
+ "gitHead": "261c218e122cfda9b520a72c26a01ec6505f8fbd"
69
70
  }