@pisell/materials 1.0.878 → 1.0.879

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 (61) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +1 -1
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +1 -1
  9. package/es/components/productCard/components/Header/index.js +1 -14
  10. package/es/components/productCard/components/Header/index.less +0 -20
  11. package/lib/components/productCard/components/Header/index.js +0 -4
  12. package/lib/components/productCard/components/Header/index.less +0 -20
  13. package/package.json +3 -3
  14. package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +0 -56
  15. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +0 -98
  16. package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +0 -16
  17. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +0 -16
  18. package/es/components/pisellAdjustPrice/index.d.ts +0 -4
  19. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +0 -3
  20. package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +0 -3
  21. package/es/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +0 -14
  22. package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +0 -3
  23. package/es/components/productCard/cartSkuCard/index.d.ts +0 -10
  24. package/es/components/productCard/components/Time/components/SelectHolder/index.d.ts +0 -3
  25. package/es/components/productCard/components/Time/components/SelectResource/index.d.ts +0 -18
  26. package/es/components/productCard/components/Warning/index.d.ts +0 -7
  27. package/es/components/productCard/index.d.ts +0 -7
  28. package/es/components/productCard/utils.d.ts +0 -31
  29. package/es/components/table/Gallery/components/GalleryItem/index.d.ts +0 -14
  30. package/es/components/table/Gallery/index.d.ts +0 -5
  31. package/es/components/table/Table/utils.d.ts +0 -173
  32. package/es/components/table/hooks/useTableSetting.d.ts +0 -22
  33. package/es/components/table/hooks/useTransDataSource.d.ts +0 -12
  34. package/es/components/virtual-keyboard/Amount/index.d.ts +0 -5
  35. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -21
  36. package/es/components/virtual-keyboard/Number/index.d.ts +0 -5
  37. package/es/index.d.ts +0 -142
  38. package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +0 -56
  39. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +0 -98
  40. package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +0 -16
  41. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +0 -16
  42. package/lib/components/pisellAdjustPrice/index.d.ts +0 -4
  43. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +0 -3
  44. package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +0 -3
  45. package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +0 -14
  46. package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +0 -3
  47. package/lib/components/productCard/cartSkuCard/index.d.ts +0 -10
  48. package/lib/components/productCard/components/Time/components/SelectHolder/index.d.ts +0 -3
  49. package/lib/components/productCard/components/Time/components/SelectResource/index.d.ts +0 -18
  50. package/lib/components/productCard/components/Warning/index.d.ts +0 -7
  51. package/lib/components/productCard/index.d.ts +0 -7
  52. package/lib/components/productCard/utils.d.ts +0 -31
  53. package/lib/components/table/Gallery/components/GalleryItem/index.d.ts +0 -14
  54. package/lib/components/table/Gallery/index.d.ts +0 -5
  55. package/lib/components/table/Table/utils.d.ts +0 -173
  56. package/lib/components/table/hooks/useTableSetting.d.ts +0 -22
  57. package/lib/components/table/hooks/useTransDataSource.d.ts +0 -12
  58. package/lib/components/virtual-keyboard/Amount/index.d.ts +0 -5
  59. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -21
  60. package/lib/components/virtual-keyboard/Number/index.d.ts +0 -5
  61. package/lib/index.d.ts +0 -142
@@ -68,19 +68,6 @@ var Header = function Header(props) {
68
68
  var showDelete = useMemo(function () {
69
69
  return isShowDelete && !disabledEdit && !disabled;
70
70
  }, [isShowDelete, disabledEdit, disabled]);
71
-
72
- /**
73
- * @title: 商品数量角标
74
- * @returns {*}
75
- * @Author: Arthur
76
- * @Date: 2025-08-08 10:26
77
- */
78
-
79
- var renderNumTag = function renderNumTag() {
80
- return /*#__PURE__*/React.createElement("div", {
81
- className: classNames("num-tag")
82
- }, num < 100 ? num : '99+');
83
- };
84
71
  var renderImage = function renderImage() {
85
72
  if (!isShowImage) return null;
86
73
  if (image) {
@@ -100,7 +87,7 @@ var Header = function Header(props) {
100
87
  className: classNames("".concat(prefix, "product-header"), headerCenterStyle && "".concat(prefix, "product-options-header"))
101
88
  }, showDelete ? /*#__PURE__*/React.createElement(DeleteButton, {
102
89
  onDelete: onDelete
103
- }) : null, renderNumTag(), renderImage(), id ? /*#__PURE__*/React.createElement("div", {
90
+ }) : null, renderImage(), id ? /*#__PURE__*/React.createElement("div", {
104
91
  className: classNames("".concat(prefix, "product-right-wrap"), _defineProperty({}, "".concat(prefix, "product-right-wrap-stretch"), isShowEditProduct))
105
92
  }, /*#__PURE__*/React.createElement("div", {
106
93
  className: "".concat(prefix, "product-title")
@@ -6,26 +6,6 @@
6
6
  align-items: center;
7
7
  gap: 8px;
8
8
  padding-right: 0 !important;
9
-
10
- .num-tag {
11
- background-color: #7f56da;
12
- position: absolute;
13
- left: 0;
14
- top: 0;
15
- border-radius: 12px;
16
- min-width: 24px;
17
- height: 24px;
18
- display: flex;
19
- align-items: center;
20
- justify-content: center;
21
- z-index: 1;
22
-
23
- color: var(--Base-White, #fff);
24
- font-size: 16px;
25
- font-style: normal;
26
- font-weight: 600;
27
- line-height: 16px;
28
- }
29
9
  }
30
10
 
31
11
  &-product-options-header {
@@ -72,9 +72,6 @@ var Header = (props) => {
72
72
  const showDelete = (0, import_react.useMemo)(() => {
73
73
  return isShowDelete && !disabledEdit && !disabled;
74
74
  }, [isShowDelete, disabledEdit, disabled]);
75
- const renderNumTag = () => {
76
- return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`num-tag`) }, num < 100 ? num : "99+");
77
- };
78
75
  const renderImage = () => {
79
76
  if (!isShowImage) return null;
80
77
  if (image) {
@@ -98,7 +95,6 @@ var Header = (props) => {
98
95
  )
99
96
  },
100
97
  showDelete ? /* @__PURE__ */ import_react.default.createElement(import_DeleteButton.default, { onDelete }) : null,
101
- renderNumTag(),
102
98
  renderImage(),
103
99
  id ? /* @__PURE__ */ import_react.default.createElement(
104
100
  "div",
@@ -6,26 +6,6 @@
6
6
  align-items: center;
7
7
  gap: 8px;
8
8
  padding-right: 0 !important;
9
-
10
- .num-tag {
11
- background-color: #7f56da;
12
- position: absolute;
13
- left: 0;
14
- top: 0;
15
- border-radius: 12px;
16
- min-width: 24px;
17
- height: 24px;
18
- display: flex;
19
- align-items: center;
20
- justify-content: center;
21
- z-index: 1;
22
-
23
- color: var(--Base-White, #fff);
24
- font-size: 16px;
25
- font-style: normal;
26
- font-weight: 600;
27
- line-height: 16px;
28
- }
29
9
  }
30
10
 
31
11
  &-product-options-header {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.878",
3
+ "version": "1.0.879",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -74,8 +74,8 @@
74
74
  "swiper": "^8.4.7",
75
75
  "vod-js-sdk-v6": "^1.4.11",
76
76
  "@pisell/date-picker": "1.0.122",
77
- "@pisell/utils": "1.0.50",
78
- "@pisell/icon": "0.0.10"
77
+ "@pisell/icon": "0.0.10",
78
+ "@pisell/utils": "1.0.50"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "react": "^18.0.0",
@@ -1,56 +0,0 @@
1
- import React from 'react';
2
- import { FormInstance } from 'antd';
3
- import { ModeType } from './type';
4
- import './style.less';
5
- export interface WithModeProps {
6
- renderMode?: ModeType;
7
- value?: any;
8
- onChange?: (value: any) => void;
9
- [key: string]: any;
10
- }
11
- /**
12
- * @title: 增加renderMode属性
13
- * @description: 基于renderMode属性控制渲染模式
14
- * @return: *
15
- * @Author: shengjie.zuo
16
- * @Date: 2024-11-23 17:13:18
17
- */
18
- export declare const withMode: <P extends object>(FieldComponent: React.ComponentType<P>, ReadPrettyComponent?: React.ComponentType<P & {
19
- renderMode: ModeType;
20
- }> | undefined, transformProps?: ((props: P, renderMode: ModeType) => P) | undefined) => React.FC<P & WithModeProps>;
21
- export interface WithFormItemProps {
22
- name: string;
23
- label?: string;
24
- mode?: ModeType;
25
- [key: string]: any;
26
- }
27
- export declare const formItemNameReplace: (name: string) => string;
28
- export declare const formItemNameReverse: (name: string) => string;
29
- export declare const isValidDomain: (value: string) => boolean;
30
- /**
31
- * @title: 追加formItem层
32
- * @description:
33
- * @return: *
34
- * @Author: shengjie.zuo
35
- * @Date: 2024-11-23 17:14:25
36
- */
37
- export declare const withFormItem: <P extends object>(WrappedComponent: React.ComponentType<P>, overlayProps?: {
38
- otherFormItemProps?: Record<string, any> | ((props: Record<string, any>, others?: Record<string, any>) => Record<string, any>) | undefined;
39
- innerProps?: Record<string, any> | undefined;
40
- } | undefined) => React.FC<P & WithFormItemProps>;
41
- export declare const withDataSource: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
42
- dataSource?: any;
43
- }) => JSX.Element;
44
- export declare const withOptions: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
45
- options?: any;
46
- optionSourceType?: "default" | "custom" | "api" | undefined;
47
- labelField: string;
48
- valueField: string;
49
- extraParams?: Record<string, any> | undefined;
50
- }) => JSX.Element;
51
- export declare const getNestedValue: (obj: Record<string, any>, path: string) => Record<string, any>;
52
- export declare const renderValueWithMap: (value: any, valueMap?: Record<string, string>, renderMode?: ModeType) => JSX.Element | null;
53
- export declare function toArr(str: string | number | (string | number)[]): (string | number)[];
54
- export declare const filterSystemFields: (params: Record<string, any>) => Record<string, any>;
55
- export declare const transformFormObjToArrayWithUntouched: (obj: Record<string, any>) => any[];
56
- export declare const setFormFieldsUntouched: (form: FormInstance) => void;
@@ -1,98 +0,0 @@
1
- import React from 'react';
2
- import { DataSourceTableProps } from '../type';
3
- import { OperationItem } from '../type';
4
- interface UseTablePropsProps {
5
- data: any;
6
- originProps: DataSourceTableProps;
7
- openDrawer: (type: OperationItem) => void;
8
- closeDrawer: () => void;
9
- refreshData: () => void;
10
- handleFilterChange: (changedFields: any, allFields: any) => void;
11
- tableRef: any;
12
- }
13
- /**
14
- * 处理table的props
15
- * 转换title
16
- * @param props
17
- * @returns
18
- */
19
- declare const useTableProps: (props: UseTablePropsProps) => {
20
- title: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
21
- pagination: {
22
- total: number;
23
- current: number;
24
- pageSize: number;
25
- size: string;
26
- showSizeChanger: boolean;
27
- };
28
- columns: import("./useColumns").Column[];
29
- subTitle: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
30
- buttons: any[] | null;
31
- filter: JSX.Element | null;
32
- onRow: (record: any) => any;
33
- actionButtons: any[] | null;
34
- titleButtons?: {
35
- show: boolean;
36
- maxCount: number;
37
- items: OperationItem[];
38
- } | undefined;
39
- tableButtons?: {
40
- show: boolean;
41
- maxCount: number;
42
- items: OperationItem[];
43
- } | undefined;
44
- operation?: {
45
- show: boolean;
46
- title: string; /**
47
- * 处理table的props
48
- * 转换title
49
- * @param props
50
- * @returns
51
- */
52
- width: number;
53
- align: "center" | "left" | "right";
54
- fixed: false | "left" | "right";
55
- type: "button" | "link";
56
- items: OperationItem[];
57
- } | undefined;
58
- operationContent?: {
59
- [key: string]: React.ReactNode;
60
- } | undefined;
61
- dataSource: import("../../provider/dataSource/DataSourceContext").DataSourceType;
62
- search?: {
63
- show: boolean;
64
- placeholder: string;
65
- } | undefined;
66
- __designMode: string;
67
- componentId: string;
68
- clickToDetail?: {
69
- show: boolean;
70
- useCustomAction: boolean;
71
- actionType: string;
72
- openMode: "modal" | "drawer";
73
- openContentSize: "large" | "middle" | "small";
74
- openTitle: string;
75
- key: string;
76
- } | undefined;
77
- filterBy?: Record<string, any> | undefined;
78
- sortBy: string;
79
- tabs?: {
80
- show: boolean;
81
- type: string;
82
- items: {
83
- name: string;
84
- filterBy: Record<string, any>;
85
- sortBy: string;
86
- }[];
87
- } | undefined;
88
- onValuesChange?: ((changedValues: any, values: any) => void) | undefined;
89
- onDeleteFinish?: ((record: Record<string, any>) => void) | undefined;
90
- extraParams?: {
91
- list?: Record<string, any> | undefined;
92
- get?: Record<string, any> | undefined;
93
- update?: Record<string, any> | undefined;
94
- create?: Record<string, any> | undefined;
95
- destroy?: Record<string, any> | undefined;
96
- } | undefined;
97
- };
98
- export default useTableProps;
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import { InputProps } from 'antd';
3
- import { ModeType } from "../../dataSourceForm/type";
4
- declare type PhoneValue = string | {
5
- phone: string;
6
- countryCallingCode: string;
7
- };
8
- export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange'> {
9
- renderMode: ModeType;
10
- value?: PhoneValue;
11
- onChange?: (value: PhoneValue) => void;
12
- returnFormat?: 'string' | 'object';
13
- inputRef?: any;
14
- }
15
- declare const MobileNumberInputWithMode: React.FC<PhoneInputProps & import("../../dataSourceForm/utils").WithModeProps>;
16
- export default MobileNumberInputWithMode;
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import { InputProps } from 'antd';
3
- import { ModeType } from "../../dataSourceForm/type";
4
- declare type PhoneValue = string | {
5
- phone: string;
6
- countryCallingCode: string;
7
- };
8
- export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange'> {
9
- renderMode: ModeType;
10
- value?: PhoneValue;
11
- onChange?: (value: PhoneValue) => void;
12
- returnFormat?: 'string' | 'object';
13
- inputRef?: any;
14
- }
15
- declare const PhoneNumberInputWithMode: React.FC<PhoneInputProps & import("../../dataSourceForm/utils").WithModeProps>;
16
- export default PhoneNumberInputWithMode;
@@ -1,4 +0,0 @@
1
- import './index.less';
2
- import { PisellAdjustPriceProps } from './type';
3
- declare const PisellAdjustPrice: (props: PisellAdjustPriceProps) => JSX.Element;
4
- export default PisellAdjustPrice;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Footer: ({ item, hideDivider, type, isOnlyTotal }: any) => JSX.Element;
3
- export default Footer;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const MultiDay: ({ dataSource, hideDivider }: any) => JSX.Element;
3
- export default MultiDay;
@@ -1,14 +0,0 @@
1
- interface InputItem {
2
- start_date: string;
3
- end_date: string;
4
- total: number;
5
- num: number;
6
- }
7
- interface OutputItem {
8
- start_date: string;
9
- end_date: string;
10
- total: number;
11
- num: number;
12
- }
13
- export declare function formatDateRanges(list: InputItem[]): OutputItem[];
14
- export {};
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Resources: (props: any) => JSX.Element | null;
3
- export default Resources;
@@ -1,10 +0,0 @@
1
- import './index.less';
2
- import { ProductCardTypes } from '../types';
3
- interface ISKUCardProps extends ProductCardTypes {
4
- type: 'a2' | 'a5';
5
- rightActions: any[];
6
- escapeDom?: string;
7
- }
8
- export declare const PREFIX = "pisell-cart-sku-card";
9
- declare const CartSkuCard: (props: ISKUCardProps) => JSX.Element;
10
- export default CartSkuCard;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const SelectHolder: ({ lists, value, onChange, holderMode, isShowAddHolderButton, onAddHolder, addHolderButtonText, onClearHolder, isErrorHolder, allowClear, holderMaxCount, }: any) => JSX.Element;
3
- export default SelectHolder;
@@ -1,18 +0,0 @@
1
- import './index.less';
2
- interface ResourceItem {
3
- id: string | number;
4
- label: string;
5
- isError?: boolean;
6
- [key: string]: any;
7
- }
8
- interface SelectResourceProps {
9
- lists: ResourceItem[];
10
- value: any;
11
- onChange: (val: any) => void;
12
- resourceMode?: 'multiple' | 'tags' | undefined;
13
- maxLength?: number;
14
- isParallelResource?: boolean;
15
- [key: string]: any;
16
- }
17
- declare const SelectResource: ({ lists, value, onChange, resourceMode, allowClear, onClearResource, maxLength, isErrorResource, resourceErrorText, ...props }: SelectResourceProps) => JSX.Element;
18
- export default SelectResource;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import '../../index.less';
3
- declare const Warning: React.FC<{
4
- errorMessage: string | Array<string>;
5
- osWarnTips: Array<string>;
6
- }>;
7
- export default Warning;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { ProductCardTypes } from './types';
3
- import './index.less';
4
- declare const ProductCard: React.FC<ProductCardTypes> & {
5
- V2: any;
6
- };
7
- export default ProductCard;
@@ -1,31 +0,0 @@
1
- import 'dayjs/locale/zh-cn';
2
- import 'dayjs/locale/en';
3
- import 'dayjs/locale/zh-tw';
4
- /**
5
- * @title: 是否英文
6
- * @description:
7
- * @param {any} item
8
- * @return {*}
9
- * @Author: WangHan
10
- * @Date: 2024-12-28 22:49
11
- */
12
- export declare const isEn: (item: any) => boolean;
13
- /**
14
- * @title: 跨日预约时间
15
- * @description:
16
- * @param {any} item
17
- * @return {*}
18
- * @Author: WangHan
19
- * @Date: 2024-12-28 22:50
20
- */
21
- export declare const formatMultiDayDate: (item: any) => string;
22
- /**
23
- * @title: 格式化服务的 开始时间-结束时间-时长, 用于展示
24
- * @description:
25
- * @param {any} item
26
- * @param {any} currentDate
27
- * @return {*}
28
- * @Author: zhiwei.Wang
29
- * @Date: 2024-04-26 14:04
30
- */
31
- export declare const getServiceTime: (item: any, currentDate: any) => string;
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- import { GallerySettingType, GallerySettingValueType } from "../../../types";
3
- import "./index.less";
4
- declare type GalleryItemProps = {
5
- record: Record<string, any>;
6
- gallery: GallerySettingType;
7
- columnsMap: Map<string, Record<string, any>>;
8
- index: number;
9
- gallerySetting: GallerySettingValueType;
10
- columns: Record<string, any>[];
11
- onClick: React.MouseEventHandler<HTMLDivElement>;
12
- };
13
- declare const GalleryItem: (props: GalleryItemProps) => JSX.Element;
14
- export default GalleryItem;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { GalleryProps } from './types';
3
- import './index.less';
4
- declare const _default: React.MemoExoticComponent<(props: GalleryProps) => JSX.Element>;
5
- export default _default;
@@ -1,173 +0,0 @@
1
- import { GroupValue } from "../Actions/component/Group/PopoverContent";
2
- import { FilterItemProps, FilterType } from "../../filter/types";
3
- import { ColumnSettingType, DataSourceGroupType, GallerySettingValueType, ModeType, SortType } from "../types";
4
- export declare const getHash: (obj: any) => any;
5
- export declare const calcFilterSort: ({ dataSource, filter, sort, columns }: any) => any;
6
- /**
7
- * 合并列设置
8
- * @param defaultColumns 默认列设置
9
- * @param tableId 表ID
10
- * @returns 合并后的列设置
11
- */
12
- export declare const mergeColumnSetting: ({ columns, tableId, currentViewMode, }: {
13
- columns: Record<string, any>[];
14
- tableId?: string | undefined;
15
- currentViewMode: ModeType;
16
- }) => {
17
- isShow: boolean;
18
- }[] | ({
19
- width: any;
20
- isShow: any;
21
- sortIndex: number;
22
- } | {
23
- isShow: boolean;
24
- sortIndex: number;
25
- })[];
26
- /**
27
- * 对数据源进行排序
28
- * @param dataSource 数据源数组
29
- * @param sortObj 排序对象,包含排序的键、值和类型
30
- * @returns 排序后的数据源数组
31
- */
32
- export declare const sortDataSource: (dataSource: Record<string, any>[], sortObj: {
33
- sortKey: string;
34
- sortValue: "asc" | "desc";
35
- sortType: "date" | "string" | "number";
36
- }) => Record<string, any>[];
37
- /**
38
- * 根据行键获取 ID
39
- * @param item 记录对象
40
- * @param rowKey 行键,可以是字符串或函数
41
- * @returns 返回 ID
42
- */
43
- export declare const getIdByRowKey: (item: Record<string, any>, rowKey: string | ((params: any) => string)) => any;
44
- /**
45
- * 根据分组条件对数据源进行分组
46
- * @param dataSource 数据源
47
- * @param group 分组条件
48
- * @param rowKey 行键生成函数或字符串
49
- * @returns 返回分组后的数据源
50
- */
51
- export declare const groupDataSource: (dataSource: Record<string, any>[], group: GroupValue, rowKey: string | ((params: any) => string)) => Record<string, any>[];
52
- declare type ViewSetting = {
53
- order_by: string;
54
- group_by: GroupValue;
55
- column_setting: Record<string, any>[];
56
- gallery_setting: GallerySettingValueType;
57
- filters: any;
58
- filter_setting: {
59
- quickFilter: FilterItemProps[];
60
- otherFilter: FilterItemProps[];
61
- };
62
- };
63
- /**
64
- * 本地存储的表格设置对象
65
- */
66
- declare type TableSettingObjType = {
67
- view_mode: ModeType;
68
- currentSettingHash: string;
69
- } & {
70
- [K in ModeType]: ViewSetting;
71
- };
72
- /**
73
- * 将表格设置保存到本地存储
74
- * @param tableId 表格id
75
- * @param tableSettingObj 表格设置对象
76
- */
77
- export declare const setTableSettingToLocalStorage: ({ tableId, tableSettingObj, currentViewMode, currentSettingHash, }: {
78
- tableId: string;
79
- tableSettingObj: Partial<ViewSetting & {
80
- view_mode: ModeType;
81
- }>;
82
- currentViewMode: ModeType;
83
- currentSettingHash: string;
84
- }) => {
85
- key: string;
86
- value: Record<string, any>;
87
- } | undefined;
88
- export declare const clearTableSettingToLocalStorage: (tableId?: string) => void;
89
- /**
90
- * 从本地存储中获取表格设置, 全部配置
91
- * @param tableId 表格ID
92
- * @returns 表格设置对象
93
- */
94
- export declare const getTableSettingFromLocalStorage: (tableId?: string) => Partial<TableSettingObjType>;
95
- /**
96
- * 从LocalStorage读取表当前视图模式
97
- * @param tableId
98
- */
99
- export declare const getCurrentViewModeFromLocalStorage: (tableId?: string) => ModeType | undefined;
100
- /**
101
- * 根据视图模式获取配置
102
- * @param tableId
103
- * @param currentViewMode
104
- */
105
- export declare const getTableSettingByCurrentViewMode: (tableId: string, currentViewMode: ModeType) => ViewSetting | undefined;
106
- /**
107
- * 将表单值保存到本地存储中
108
- * @param tableId 表单ID
109
- * @param allValues 表单所有值
110
- * @param keys 存储的键名
111
- */
112
- export declare const setFormValuesToLocalStorage: ({ tableId, allValues, keys, currentViewMode, currentSettingHash, }: {
113
- tableId?: string | undefined;
114
- allValues?: Record<string, any> | undefined;
115
- keys?: string[] | undefined;
116
- currentViewMode: ModeType;
117
- currentSettingHash: string;
118
- }) => {
119
- key: string;
120
- value: Record<string, any>;
121
- } | undefined;
122
- /**
123
- * 获取表格键值
124
- * @param tableId 表格ID
125
- * @returns 返回格式化后的表格键值
126
- */
127
- export declare const getTableKey: (tableId: string) => string;
128
- /**
129
- * 合并筛选设置
130
- * @param list 列表数据
131
- * @param quickFilterMaxLength 快速筛选最大长度
132
- * @param tableId 表ID
133
- * @returns 返回合并后的筛选设置
134
- */
135
- export declare const mergeFilterSetting: ({ list, quickFilterMaxLength, tableId, sortButtonShow, currentViewMode, }: {
136
- list: FilterItemProps[];
137
- quickFilterMaxLength: number;
138
- tableId?: string | undefined;
139
- sortButtonShow: boolean;
140
- currentViewMode: ModeType;
141
- }) => {
142
- quickFilter: FilterItemProps[];
143
- otherFilter: FilterItemProps[];
144
- notSortFilter: FilterItemProps[];
145
- };
146
- /**
147
- * 过滤数据源
148
- * @param dataSource 数据源
149
- * @param filters 过滤条件
150
- * @param filterLocalArr 本地过滤项
151
- * @returns 过滤后的数据源
152
- */
153
- export declare const filterDataSource: (dataSource: Record<string, any>[], filters: Record<string, any>, filterLocalArr: FilterItemProps[]) => Record<string, any>[];
154
- /**
155
- * 根据模式获取设置键数组
156
- * @param filter 筛选器
157
- * @param columnSetting 列设置
158
- * @param dataSourceGroup 数据源分组
159
- * @param sort 排序
160
- * @param mode 模式,可选值为 "localStorage" 或 "remote"
161
- * @returns 返回设置键数组
162
- */
163
- export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourceGroup, sort, mode, currentViewMode, }: {
164
- filter?: FilterType | undefined;
165
- columnSetting?: ColumnSettingType | undefined;
166
- dataSourceGroup?: DataSourceGroupType | undefined;
167
- sort?: SortType | undefined;
168
- mode: "" | "localStorage" | "remote";
169
- currentViewMode: ModeType;
170
- }) => ("view_mode" | "filter_setting" | "group_by" | "order_by" | "column_setting" | "gallery_setting")[];
171
- export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
172
- export declare const stringify: (obj: Record<string, any>) => string;
173
- export {};
@@ -1,22 +0,0 @@
1
- import { FilterType } from "../../filter/types";
2
- import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, ModeType, SortType, ExportImportModeType } from "../types";
3
- declare type UseTableSettingProps = {
4
- tableId?: string;
5
- filter: FilterType;
6
- columns: Record<string, any>[];
7
- columnSetting?: ColumnSettingType;
8
- dataSourceGroup?: DataSourceGroupType;
9
- sort?: SortType;
10
- view: GridViewType;
11
- currentViewMode: ModeType;
12
- gallery?: GallerySettingType;
13
- currentSettingHash: string;
14
- exportImport?: ExportImportModeType;
15
- };
16
- declare const useTableSetting: (params: UseTableSettingProps) => {
17
- setTableSetting: (values: Record<string, any>) => void;
18
- tableSetting: {
19
- [x: string]: any;
20
- };
21
- };
22
- export default useTableSetting;
@@ -1,12 +0,0 @@
1
- import { FormInstance } from "antd/es/form";
2
- import { FilterType } from "../../filter/types";
3
- declare type UseTransDataSourceParams = {
4
- form: FormInstance;
5
- localPagination: boolean;
6
- dataSource: Record<string, any>[];
7
- rowKey: string | ((params: any) => string);
8
- filter: FilterType;
9
- currentView: 'gallery' | 'table';
10
- };
11
- declare const useTransDataSource: (params: UseTransDataSourceParams) => Record<string, any>[];
12
- export default useTransDataSource;