@pisell/materials 1.0.1051 → 1.0.1053
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +13 -13
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +13 -13
- package/es/components/PisellCards/index.d.ts +6 -6
- package/es/components/appVersionControl/index.js +1 -1
- package/es/components/calendar/index.d.ts +2 -2
- package/es/components/checkbox/index.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.js +3 -3
- package/es/components/dataSourceComponents/dataSourceForm/formItem.js +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/index.js +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +2 -2
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +3 -3
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceSubForm/index.d.ts +16 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/index.js +329 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/index.less +19 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/schema-full-example.json +538 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/schema-simple-example.json +174 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/types.d.ts +121 -0
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.js +1 -1
- package/es/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +3 -3
- package/es/components/dataSourceComponents/fields/DateRangePicker/WithMode.js +1 -1
- package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.js +1 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +1 -1
- package/es/components/dataSourceComponents/fields/Radio/WithMode.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Radio/WithMode.js +1 -1
- package/es/components/dataSourceComponents/fields/RecordListWrapper/README.md +247 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/ReadPretty.js +39 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/WithMode.js +84 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +17 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/index.js +9 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/type.d.ts +91 -0
- package/es/components/dataSourceComponents/fields/Select/WithMode.js +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +3 -3
- package/es/components/dataSourceComponents/fields/Tabs/ReadPretty.js +16 -0
- package/es/components/dataSourceComponents/fields/Tabs/Tabs.js +75 -0
- package/es/components/dataSourceComponents/fields/Tabs/Tabs.less +55 -0
- package/es/components/dataSourceComponents/fields/Tabs/WithMode.js +13 -0
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +19 -0
- package/es/components/dataSourceComponents/fields/Tabs/index.js +10 -0
- package/es/components/dataSourceComponents/fields/Tabs/type.d.ts +36 -0
- package/es/components/dataSourceComponents/fields/index.js +5 -1
- package/es/components/dataSourceComponents/fields/utils.js +3 -0
- package/es/components/dataSourceComponents/hooks/useActions.js +1 -1
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +1 -1
- package/es/components/date-picker/index.d.ts +2 -2
- package/es/components/input/index.d.ts +2 -2
- package/es/components/pisell-config-provider/context.d.ts +2 -2
- package/es/components/pisellDataSourceContainer/type.d.ts +1 -1
- package/es/components/pisellDatePicker/index.d.ts +2 -2
- package/es/components/pisellInput/components/Copy/index.js +1 -1
- package/es/components/pisellModal/index.d.ts +6 -6
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.less +15 -7
- package/es/components/pisellQuickFilter/index.d.ts +2 -2
- package/es/components/pisellRecordBoard/PisellRecordBoard.js +10 -3
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +3 -1
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +4 -2
- package/es/components/pisellRecordBoard/types.d.ts +4 -0
- package/es/components/pisellSingleSelect/PisellSingleSelect.less +15 -0
- package/es/components/pisellWalletPassCard/index.js +1 -1
- package/es/components/radio/index.d.ts +2 -2
- package/es/components/section-footers/index.d.ts +2 -2
- package/es/components/select/index.less +18 -2
- package/es/components/skeleton/index.d.ts +2 -2
- package/es/components/table/Actions/component/ExportImport/index.js +1 -1
- package/es/components/table/Table/fields/select/Edit/index.js +1 -1
- package/es/components/table/Table/tableConfig/SortRow/index.js +1 -1
- package/es/components/table/Table/tableConfig/body/CellProvider/index.js +1 -1
- package/es/components/time-picker/index.d.ts +2 -2
- package/es/components/typography/index.d.ts +2 -2
- package/es/components/upload/index.d.ts +2 -2
- package/es/index.d.ts +5 -1
- package/es/index.js +8 -5
- package/lib/components/PisellCards/index.d.ts +6 -6
- package/lib/components/PisellFields/index.d.ts +12 -12
- package/lib/components/PisellLayouts/index.d.ts +9 -9
- package/lib/components/PisellMetrics/index.d.ts +4 -4
- package/lib/components/appVersionControl/index.js +4 -4
- package/lib/components/calendar/index.d.ts +2 -2
- package/lib/components/checkbox/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.js +3 -3
- package/lib/components/dataSourceComponents/dataSourceForm/formItem.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/index.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +2 -2
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +3 -3
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceSubForm/index.d.ts +16 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/index.js +332 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/index.less +19 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/schema-full-example.json +538 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/schema-simple-example.json +174 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/types.d.ts +121 -0
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.js +1 -1
- package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +3 -3
- package/lib/components/dataSourceComponents/fields/DateRangePicker/WithMode.js +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.js +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Password/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.TextArea/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Radio/WithMode.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Radio/WithMode.js +1 -1
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/README.md +247 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/ReadPretty.js +41 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/WithMode.js +86 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +17 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.js +9 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/type.d.ts +91 -0
- package/lib/components/dataSourceComponents/fields/Select/WithMode.js +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Tabs/ReadPretty.js +16 -0
- package/lib/components/dataSourceComponents/fields/Tabs/Tabs.js +78 -0
- package/lib/components/dataSourceComponents/fields/Tabs/Tabs.less +55 -0
- package/lib/components/dataSourceComponents/fields/Tabs/WithMode.js +13 -0
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +19 -0
- package/lib/components/dataSourceComponents/fields/Tabs/index.js +10 -0
- package/lib/components/dataSourceComponents/fields/Tabs/type.d.ts +35 -0
- package/lib/components/dataSourceComponents/fields/index.js +37 -33
- package/lib/components/dataSourceComponents/fields/utils.js +3 -0
- package/lib/components/dataSourceComponents/hooks/useActions.js +1 -1
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +1 -1
- package/lib/components/date-picker/index.d.ts +2 -2
- package/lib/components/input/index.d.ts +2 -2
- package/lib/components/pisell-config-provider/context.d.ts +2 -2
- package/lib/components/pisellDataSourceContainer/components/Pagination/index.d.ts +2 -2
- package/lib/components/pisellDataSourceContainer/components/Table/index.d.ts +2 -2
- package/lib/components/pisellDataSourceContainer/type.d.ts +1 -1
- package/lib/components/pisellDatePicker/index.d.ts +2 -2
- package/lib/components/pisellInput/components/Copy/index.js +1 -1
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.less +15 -7
- package/lib/components/pisellRecordBoard/PisellRecordBoard.js +10 -3
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +3 -1
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +4 -2
- package/lib/components/pisellRecordBoard/types.d.ts +4 -0
- package/lib/components/pisellSingleSelect/PisellSingleSelect.less +15 -0
- package/lib/components/pisellWalletPassCard/index.js +1 -1
- package/lib/components/radio/index.d.ts +2 -2
- package/lib/components/section-footers/index.d.ts +2 -2
- package/lib/components/select/index.less +18 -2
- package/lib/components/skeleton/index.d.ts +2 -2
- package/lib/components/table/Actions/component/ExportImport/index.js +1 -1
- package/lib/components/table/Table/fields/select/Edit/index.js +1 -1
- package/lib/components/table/Table/tableConfig/SortRow/index.js +1 -1
- package/lib/components/table/Table/tableConfig/body/CellProvider/index.js +1 -1
- package/lib/components/time-picker/index.d.ts +2 -2
- package/lib/components/upload/index.d.ts +2 -2
- package/lib/index.d.ts +5 -1
- package/lib/index.js +256 -250
- package/lowcode/data-source-form/constants.ts +3 -0
- package/lowcode/data-source-form/utils.ts +19 -5
- package/lowcode/data-source-sub-form/meta.ts +274 -0
- package/lowcode/data-source-sub-form/snippets.ts +135 -0
- package/lowcode/form-item-record-list-wrapper/meta.ts +246 -0
- package/lowcode/form-item-record-list-wrapper/snippets.ts +24 -0
- package/lowcode/form-item-tabs/meta.ts +172 -0
- package/package.json +1 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ModeType } from "../../dataSourceForm/type.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/dataSourceComponents/fields/RecordListWrapper/type.d.ts
|
|
5
|
+
interface RecordListWrapperOption {
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
value: string | number;
|
|
8
|
+
}
|
|
9
|
+
interface RecordListWrapperFieldSchema {
|
|
10
|
+
name: string;
|
|
11
|
+
label?: React.ReactNode;
|
|
12
|
+
component?: string;
|
|
13
|
+
componentName?: string;
|
|
14
|
+
type?: string;
|
|
15
|
+
/** 接口类型,用于映射到具体组件(如 Select、Input 等) */
|
|
16
|
+
interface?: string;
|
|
17
|
+
options?: RecordListWrapperOption[];
|
|
18
|
+
props?: Record<string, any>;
|
|
19
|
+
/** 子字段(用于嵌套结构,如 Input.JSON) */
|
|
20
|
+
children?: RecordListWrapperFieldSchema[];
|
|
21
|
+
_children?: RecordListWrapperFieldSchema[];
|
|
22
|
+
schema?: Record<string, any>;
|
|
23
|
+
uiSchema?: {
|
|
24
|
+
title?: React.ReactNode;
|
|
25
|
+
enum?: RecordListWrapperOption[];
|
|
26
|
+
'x-component'?: string;
|
|
27
|
+
'x-component-props'?: Record<string, any>;
|
|
28
|
+
'x-read-pretty'?: boolean;
|
|
29
|
+
'x-validator'?: string;
|
|
30
|
+
'x-display'?: 'visible' | 'hidden' | 'none';
|
|
31
|
+
'x-pattern'?: 'editable' | 'disabled' | 'readPretty';
|
|
32
|
+
'x-data-source'?: {
|
|
33
|
+
type?: string;
|
|
34
|
+
options?: Array<{
|
|
35
|
+
id?: string;
|
|
36
|
+
label: string | Record<string, any>;
|
|
37
|
+
value: string;
|
|
38
|
+
color?: string;
|
|
39
|
+
}>;
|
|
40
|
+
labelField?: string;
|
|
41
|
+
valueField?: string;
|
|
42
|
+
dataSource?: any;
|
|
43
|
+
extraParams?: Record<string, any>;
|
|
44
|
+
};
|
|
45
|
+
'x-record-schema'?: RecordListWrapperSchema | RecordListWrapperFieldSchema[] | string;
|
|
46
|
+
default?: any;
|
|
47
|
+
type?: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
interface RecordListWrapperSchema {
|
|
51
|
+
fields?: RecordListWrapperFieldSchema[];
|
|
52
|
+
properties?: Record<string, any>;
|
|
53
|
+
children?: RecordListWrapperFieldSchema[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @title RecordListWrapper 组件 Props
|
|
57
|
+
* @description
|
|
58
|
+
* 值结构为 Map:key 是 xDataSource option 的 value,value 是该 option 对应的表单字段值。
|
|
59
|
+
* 例如:{ "5": { "code": "xxx", "type": "yyy" }, "3": { "code": "aaa" } }
|
|
60
|
+
*/
|
|
61
|
+
interface RecordListWrapperProps {
|
|
62
|
+
renderMode: ModeType;
|
|
63
|
+
/**
|
|
64
|
+
* 值: Map 结构
|
|
65
|
+
* - key: xDataSource option 的 value
|
|
66
|
+
* - value: 该 option 对应的 xRecordSchema 字段值对象
|
|
67
|
+
*/
|
|
68
|
+
value?: Record<string, Record<string, any>>;
|
|
69
|
+
onChange?: (value: Record<string, Record<string, any>>) => void;
|
|
70
|
+
/** xDataSource 选项列表,驱动 tabs 导航和 records 结构 */
|
|
71
|
+
options?: RecordListWrapperOption[];
|
|
72
|
+
/**
|
|
73
|
+
* 上部插槽:用户可在低代码平台拖入自定义导航组件。
|
|
74
|
+
* RecordListWrapper 会通过 cloneElement 注入 options、value(activeKey)、onChange。
|
|
75
|
+
*/
|
|
76
|
+
topSlot?: React.ReactNode;
|
|
77
|
+
slot?: React.ReactNode;
|
|
78
|
+
/** xRecordSchema:定义每条记录的子字段结构 */
|
|
79
|
+
xRecordSchema?: string | RecordListWrapperSchema | RecordListWrapperFieldSchema[];
|
|
80
|
+
/** 容器 children:低代码引擎渲染的子组件节点 */
|
|
81
|
+
children?: React.ReactNode;
|
|
82
|
+
/** 低代码设计模式标识 */
|
|
83
|
+
__designMode?: string;
|
|
84
|
+
/**
|
|
85
|
+
* 默认激活的 Tab key,外部传入时优先于 options[0].value
|
|
86
|
+
*/
|
|
87
|
+
defaultValue?: string;
|
|
88
|
+
[key: string]: any;
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { RecordListWrapperProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import select_default from "../../../select/index.js";
|
|
2
1
|
import { withMode } from "../../dataSourceForm/utils.js";
|
|
2
|
+
import select_default from "../../../select/index.js";
|
|
3
3
|
import ReadPretty_default from "./ReadPretty.js";
|
|
4
4
|
|
|
5
5
|
//#region src/components/dataSourceComponents/fields/Select/WithMode.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as antd1 from "antd";
|
|
4
4
|
import * as antd_es_select0 from "antd/es/select";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Select/index.d.ts
|
|
7
|
-
declare const SelectWithDataSource: (props:
|
|
7
|
+
declare const SelectWithDataSource: (props: antd1.SelectProps<any, antd_es_select0.DefaultOptionType> & WithModeProps & WithFormItemProps & {
|
|
8
8
|
options?: any;
|
|
9
|
-
optionSourceType?: "
|
|
9
|
+
optionSourceType?: "custom" | "api" | "default" | undefined;
|
|
10
10
|
labelField: string;
|
|
11
11
|
valueField: string;
|
|
12
12
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { renderValueWithMap } from "../../dataSourceForm/utils.js";
|
|
2
|
+
import useValueMap_default from "../../hooks/useValueMap.js";
|
|
3
|
+
|
|
4
|
+
//#region src/components/dataSourceComponents/fields/Tabs/ReadPretty.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Tabs 只读展示组件
|
|
7
|
+
*
|
|
8
|
+
* @description 在 view / tableView 模式下展示选中的标签名称文本。
|
|
9
|
+
*/
|
|
10
|
+
const TabsReadPretty = ({ value, options, renderMode }) => {
|
|
11
|
+
return renderValueWithMap(value, useValueMap_default(options || []), renderMode);
|
|
12
|
+
};
|
|
13
|
+
var ReadPretty_default = TabsReadPretty;
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ReadPretty_default as default };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import "./Tabs.less";
|
|
4
|
+
|
|
5
|
+
//#region src/components/dataSourceComponents/fields/Tabs/Tabs.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Tabs 胶囊风格选项卡组件
|
|
8
|
+
*
|
|
9
|
+
* @description 提供类似 Segmented 控件的胶囊风格选项卡,支持受控与非受控模式。
|
|
10
|
+
* 用于表单中替代 Radio.Group,展示更为直观的标签页切换交互。
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Tabs
|
|
15
|
+
* value={current}
|
|
16
|
+
* options={[
|
|
17
|
+
* { label: '校区', value: 'campus' },
|
|
18
|
+
* { label: '场地', value: 'venue' },
|
|
19
|
+
* ]}
|
|
20
|
+
* onChange={(val) => setCurrent(val)}
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
const Tabs = ({ value, defaultValue, options = [], disabled = false, onChange, className, style }) => {
|
|
25
|
+
/** 内部选中值,支持受控与非受控 */
|
|
26
|
+
const [internalValue, setInternalValue] = React.useState(defaultValue);
|
|
27
|
+
/** 最终使用的选中值:受控优先 */
|
|
28
|
+
const selectedValue = value !== void 0 ? value : internalValue;
|
|
29
|
+
/**
|
|
30
|
+
* 处理选项点击
|
|
31
|
+
*/
|
|
32
|
+
const handleSelect = (option) => {
|
|
33
|
+
if (disabled || option.disabled) return;
|
|
34
|
+
const newValue = option.value;
|
|
35
|
+
if (value === void 0) setInternalValue(newValue);
|
|
36
|
+
onChange === null || onChange === void 0 || onChange(newValue);
|
|
37
|
+
};
|
|
38
|
+
const tabItems = useMemo(() => {
|
|
39
|
+
return options.map((option) => {
|
|
40
|
+
const isActive = selectedValue === option.value;
|
|
41
|
+
const isDisabled = disabled || option.disabled;
|
|
42
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
43
|
+
key: option.value,
|
|
44
|
+
className: classNames("pisell-form-tabs-item", {
|
|
45
|
+
"pisell-form-tabs-item--active": isActive,
|
|
46
|
+
"pisell-form-tabs-item--disabled": isDisabled
|
|
47
|
+
}),
|
|
48
|
+
onClick: () => handleSelect(option),
|
|
49
|
+
role: "tab",
|
|
50
|
+
"aria-selected": isActive,
|
|
51
|
+
"aria-disabled": isDisabled,
|
|
52
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
53
|
+
onKeyDown: (e) => {
|
|
54
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
handleSelect(option);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}, /* @__PURE__ */ React.createElement("span", { className: "pisell-form-tabs-item-label" }, option.label));
|
|
60
|
+
});
|
|
61
|
+
}, [
|
|
62
|
+
options,
|
|
63
|
+
selectedValue,
|
|
64
|
+
disabled
|
|
65
|
+
]);
|
|
66
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
67
|
+
className: classNames("pisell-form-tabs", className),
|
|
68
|
+
style,
|
|
69
|
+
role: "tablist"
|
|
70
|
+
}, tabItems);
|
|
71
|
+
};
|
|
72
|
+
var Tabs_default = Tabs;
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
export { Tabs_default as default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.pisell-form-tabs {
|
|
2
|
+
height: 40px;
|
|
3
|
+
width: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
background-color: #f5f5f5;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
padding: 2px;
|
|
9
|
+
gap: 2px;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
color: rgba(0, 0, 0, .65);
|
|
13
|
+
background-color: rgba(0, 0, 0, .04);
|
|
14
|
+
|
|
15
|
+
&-item {
|
|
16
|
+
min-height: 36px;
|
|
17
|
+
min-width: 90px;
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
padding: 0 12px;
|
|
22
|
+
border-radius: 6px;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
transition: background-color 0.2s ease, box-shadow 0.2s ease,
|
|
25
|
+
color 0.2s ease;
|
|
26
|
+
user-select: none;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
flex: 0 0 auto;
|
|
29
|
+
outline: none;
|
|
30
|
+
|
|
31
|
+
&-label {
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
color: rgba(0, 0, 0, 0.65);
|
|
34
|
+
font-weight: 400;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:hover:not(&--active):not(&--disabled) {
|
|
38
|
+
background-color: rgba(0, 0, 0, 0.06);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--active {
|
|
42
|
+
background-color: #ffffff;
|
|
43
|
+
|
|
44
|
+
.pisell-form-tabs-item-label {
|
|
45
|
+
color: #262626;
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&--disabled {
|
|
51
|
+
cursor: not-allowed;
|
|
52
|
+
opacity: 0.4;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { withMode } from "../../dataSourceForm/utils.js";
|
|
2
|
+
import Tabs_default from "./Tabs.js";
|
|
3
|
+
import ReadPretty_default from "./ReadPretty.js";
|
|
4
|
+
|
|
5
|
+
//#region src/components/dataSourceComponents/fields/Tabs/WithMode.tsx
|
|
6
|
+
/**
|
|
7
|
+
* TabsWithMode
|
|
8
|
+
*/
|
|
9
|
+
const TabsWithMode = withMode(Tabs_default, ReadPretty_default);
|
|
10
|
+
var WithMode_default = TabsWithMode;
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { WithMode_default as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
3
|
+
import { TabsProps } from "./type.js";
|
|
4
|
+
import * as react27 from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/dataSourceComponents/fields/Tabs/index.d.ts
|
|
7
|
+
/** 包装 DataSource 层(提供数据源上下文) */
|
|
8
|
+
declare const FormItemTabs: (props: TabsProps & WithModeProps & WithFormItemProps & {
|
|
9
|
+
options?: any;
|
|
10
|
+
optionSourceType?: "custom" | "api" | "default" | undefined;
|
|
11
|
+
labelField: string;
|
|
12
|
+
valueField: string;
|
|
13
|
+
extraParams?: Record<string, any> | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
dataSource?: any;
|
|
16
|
+
extraParams?: Record<string, any> | undefined;
|
|
17
|
+
}) => react27.JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { FormItemTabs };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { withDataSource, withFormItem, withOptions } from "../../dataSourceForm/utils.js";
|
|
2
|
+
import WithMode_default from "./WithMode.js";
|
|
3
|
+
|
|
4
|
+
//#region src/components/dataSourceComponents/fields/Tabs/index.tsx
|
|
5
|
+
/** 包装 DataSource 层(提供数据源上下文) */
|
|
6
|
+
const FormItemTabs = withDataSource(withOptions(withFormItem(WithMode_default)));
|
|
7
|
+
var Tabs_default = FormItemTabs;
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Tabs_default as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "../../dataSourceForm/type.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/dataSourceComponents/fields/Tabs/type.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Tabs 选项配置
|
|
7
|
+
*/
|
|
8
|
+
interface TabOption {
|
|
9
|
+
/** 选项显示文本 */
|
|
10
|
+
label: React.ReactNode;
|
|
11
|
+
/** 选项对应的值 */
|
|
12
|
+
value: string | number;
|
|
13
|
+
/** 是否禁用该选项 */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Tabs 基础 Props(编辑态组件使用,不含 renderMode)
|
|
18
|
+
*/
|
|
19
|
+
interface TabsProps {
|
|
20
|
+
/** 当前选中的值(受控) */
|
|
21
|
+
value?: string | number;
|
|
22
|
+
/** 默认选中的值(非受控) */
|
|
23
|
+
defaultValue?: string | number;
|
|
24
|
+
/** 选项列表 */
|
|
25
|
+
options?: TabOption[];
|
|
26
|
+
/** 是否禁用整个组件 */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** 选中值变化时的回调 */
|
|
29
|
+
onChange?: (value: string | number) => void;
|
|
30
|
+
/** 自定义类名 */
|
|
31
|
+
className?: string;
|
|
32
|
+
/** 自定义样式 */
|
|
33
|
+
style?: React.CSSProperties;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { TabsProps };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import RecordListWrapper_default from "./RecordListWrapper/index.js";
|
|
2
|
+
import Tabs_default from "./Tabs/index.js";
|
|
1
3
|
import Input_default from "./Input/index.js";
|
|
2
4
|
import Checkbox_default from "./Checkbox/index.js";
|
|
3
5
|
import ColorPicker_default from "./ColorPicker/index.js";
|
|
@@ -33,7 +35,9 @@ const formFieldMap = {
|
|
|
33
35
|
FormItemDateRangePicker: DateRangePicker_default,
|
|
34
36
|
FormItemUpload: Upload_default,
|
|
35
37
|
FormItemTranslation: Translation_default,
|
|
36
|
-
FormItemIconSelect: IconSelect_default
|
|
38
|
+
FormItemIconSelect: IconSelect_default,
|
|
39
|
+
FormItemRecordListWrapper: RecordListWrapper_default,
|
|
40
|
+
FormItemTabs: Tabs_default
|
|
37
41
|
};
|
|
38
42
|
const getFieldComponent = (fieldComponent) => {
|
|
39
43
|
return formFieldMap[fieldComponent];
|
|
@@ -2,12 +2,12 @@ import { getText } from "../../../locales/index.js";
|
|
|
2
2
|
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js";
|
|
3
3
|
import useEngineContext_default from "../../../hooks/useEngineContext.js";
|
|
4
4
|
import { _asyncToGenerator } from "../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/asyncToGenerator.js";
|
|
5
|
-
import useDataSource_default from "./useDataSource.js";
|
|
6
5
|
import pisellToast_default from "../../pisellToast/index.js";
|
|
7
6
|
import useFormat_default from "../dataSourceTable/hooks/useFormat.js";
|
|
8
7
|
import { createNocobaseData, customApi, deleteNocobaseData, getNocobaseData, getNocobaseDataList, updateNocobaseData } from "../dataSourceForm/serve.js";
|
|
9
8
|
import useVariables_default from "./useVariables.js";
|
|
10
9
|
import useParseActionsVariable_default from "./useParseActionsVariable.js";
|
|
10
|
+
import useDataSource_default from "./useDataSource.js";
|
|
11
11
|
import { useMemo } from "react";
|
|
12
12
|
import { useMemoizedFn } from "ahooks";
|
|
13
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js";
|
|
2
2
|
import DataSourceContext_default from "./DataSourceContext.js";
|
|
3
|
-
import useDataSource_default from "../../hooks/useDataSource.js";
|
|
4
3
|
import useVariables_default from "../../hooks/useVariables.js";
|
|
4
|
+
import useDataSource_default from "../../hooks/useDataSource.js";
|
|
5
5
|
import useActions_default from "../../hooks/useActions.js";
|
|
6
6
|
import useSetRequest_default from "../../../../hooks/useSetRequest.js";
|
|
7
7
|
import React, { useMemo } from "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react28 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/date-picker/index.d.ts
|
|
5
|
-
declare const DatePicker: (props: any) =>
|
|
5
|
+
declare const DatePicker: (props: any) => react28.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DatePicker };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react29 from "react";
|
|
3
3
|
import { InputProps, InputRef } from "antd";
|
|
4
4
|
import * as antd_es_input0 from "antd/es/input";
|
|
5
5
|
import * as antd_es_input_TextArea0 from "antd/es/input/TextArea";
|
|
6
6
|
|
|
7
7
|
//#region src/components/input/index.d.ts
|
|
8
|
-
declare const OriginalGroup:
|
|
8
|
+
declare const OriginalGroup: react29.FC<antd_es_input0.GroupProps>, OriginalTextArea: react29.ForwardRefExoticComponent<antd_es_input0.TextAreaProps & react29.RefAttributes<antd_es_input_TextArea0.TextAreaRef>>, OriginalPassword: react29.ForwardRefExoticComponent<antd_es_input0.PasswordProps & react29.RefAttributes<InputRef>>, OriginalSearch: react29.ForwardRefExoticComponent<antd_es_input0.SearchProps & react29.RefAttributes<InputRef>>;
|
|
9
9
|
type CompoundedComponent = React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>> & {
|
|
10
10
|
Group: typeof OriginalGroup;
|
|
11
11
|
Search: typeof OriginalSearch;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react47 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/pisell-config-provider/context.d.ts
|
|
5
5
|
interface PisellContextType {
|
|
@@ -11,7 +11,7 @@ interface PisellContextType {
|
|
|
11
11
|
/** 获取货币符号 */
|
|
12
12
|
getSymbolic?: () => string;
|
|
13
13
|
}
|
|
14
|
-
declare const PisellContext:
|
|
14
|
+
declare const PisellContext: react47.Context<PisellContextType>;
|
|
15
15
|
/**
|
|
16
16
|
* provider外获取当前全局配置
|
|
17
17
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { DataSourceContextProps, DataSourceContextType } from "../dataSourceComponents/provider/dataSource/DataSourceContext.js";
|
|
1
2
|
import { SortListProps } from "../sort/types.js";
|
|
2
3
|
import { FilterItemProps } from "../filter/types.js";
|
|
3
|
-
import { DataSourceContextProps, DataSourceContextType } from "../dataSourceComponents/provider/dataSource/DataSourceContext.js";
|
|
4
4
|
import { FilterListProps } from "../filter/components/FilterButton/types.js";
|
|
5
5
|
import { FormInstance, PaginationProps, TableProps, TabsProps } from "antd";
|
|
6
6
|
import { Result } from "ahooks/es/useRequest/src/types";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react44 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/pisellDatePicker/index.d.ts
|
|
5
|
-
declare const PisellDatePicker: (props: any) =>
|
|
5
|
+
declare const PisellDatePicker: (props: any) => react44.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { PisellDatePicker };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getText } from "../../../../locales/index.js";
|
|
2
2
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js";
|
|
3
3
|
import icon_default from "../../../icon/index.js";
|
|
4
|
-
import input_default from "../../../input/index.js";
|
|
5
4
|
import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/asyncToGenerator.js";
|
|
5
|
+
import input_default from "../../../input/index.js";
|
|
6
6
|
import React, { useRef } from "react";
|
|
7
7
|
import { copyToClipboard } from "@pisell/utils";
|
|
8
8
|
import { Button, Space, message } from "antd";
|
|
@@ -2,7 +2,7 @@ import { PisellContextType } from "../pisell-config-provider/context.js";
|
|
|
2
2
|
import { PisellModalFuncProps } from "./components/functions/index.js";
|
|
3
3
|
import { InformationProps } from "./components/Information/index.js";
|
|
4
4
|
import React from "react";
|
|
5
|
-
import * as
|
|
5
|
+
import * as antd2 from "antd";
|
|
6
6
|
import { ButtonProps, ModalProps } from "antd";
|
|
7
7
|
|
|
8
8
|
//#region src/components/pisellModal/index.d.ts
|
|
@@ -39,24 +39,24 @@ declare const PisellModal: {
|
|
|
39
39
|
(props: PisellModalProps): React.JSX.Element;
|
|
40
40
|
confirm: (props: PisellModalFuncProps) => {
|
|
41
41
|
destroy: () => void;
|
|
42
|
-
update: (configUpdate:
|
|
42
|
+
update: (configUpdate: antd2.ModalFuncProps | ((prevConfig: antd2.ModalFuncProps) => antd2.ModalFuncProps)) => void;
|
|
43
43
|
};
|
|
44
44
|
info: (props: PisellModalFuncProps) => {
|
|
45
45
|
destroy: () => void;
|
|
46
|
-
update: (configUpdate:
|
|
46
|
+
update: (configUpdate: antd2.ModalFuncProps | ((prevConfig: antd2.ModalFuncProps) => antd2.ModalFuncProps)) => void;
|
|
47
47
|
};
|
|
48
48
|
error: (props: PisellModalFuncProps) => {
|
|
49
49
|
destroy: () => void;
|
|
50
|
-
update: (configUpdate:
|
|
50
|
+
update: (configUpdate: antd2.ModalFuncProps | ((prevConfig: antd2.ModalFuncProps) => antd2.ModalFuncProps)) => void;
|
|
51
51
|
};
|
|
52
52
|
warn: (props: PisellModalFuncProps) => any;
|
|
53
53
|
warning: (props: PisellModalFuncProps) => {
|
|
54
54
|
destroy: () => void;
|
|
55
|
-
update: (configUpdate:
|
|
55
|
+
update: (configUpdate: antd2.ModalFuncProps | ((prevConfig: antd2.ModalFuncProps) => antd2.ModalFuncProps)) => void;
|
|
56
56
|
};
|
|
57
57
|
success: (props: PisellModalFuncProps) => {
|
|
58
58
|
destroy: () => void;
|
|
59
|
-
update: (configUpdate:
|
|
59
|
+
update: (configUpdate: antd2.ModalFuncProps | ((prevConfig: antd2.ModalFuncProps) => antd2.ModalFuncProps)) => void;
|
|
60
60
|
};
|
|
61
61
|
Information: (props: InformationProps) => React.JSX.Element;
|
|
62
62
|
};
|
|
@@ -7,6 +7,21 @@
|
|
|
7
7
|
height: 48px !important;
|
|
8
8
|
width: 100%;
|
|
9
9
|
|
|
10
|
+
.pisell-lowcode-select-clear {
|
|
11
|
+
color: #667085;
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
min-width: 44px;
|
|
16
|
+
min-height: 44px;
|
|
17
|
+
margin: -22px -8px;
|
|
18
|
+
padding: 10px 8px;
|
|
19
|
+
|
|
20
|
+
&:hover {
|
|
21
|
+
color: #344054;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
10
25
|
// Select 触发器(Figma 设计规范,与 SingleSelect / Input 体系一致)
|
|
11
26
|
.pisell-lowcode-select:not(.pisell-lowcode-select-disabled):not(.pisell-lowcode-select-customize-input) {
|
|
12
27
|
.pisell-lowcode-select-selector {
|
|
@@ -51,13 +66,6 @@
|
|
|
51
66
|
color: #667085;
|
|
52
67
|
}
|
|
53
68
|
|
|
54
|
-
.pisell-lowcode-select-clear {
|
|
55
|
-
color: #667085;
|
|
56
|
-
|
|
57
|
-
&:hover {
|
|
58
|
-
color: #344054;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
69
|
|
|
62
70
|
// 多选标签(选择后展示的 item)高度 36px
|
|
63
71
|
.pisell-lowcode-select-selection-item {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FilterItemProps } from "../filter/types.js";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as antd17 from "antd";
|
|
4
4
|
|
|
5
5
|
//#region src/components/pisellQuickFilter/index.d.ts
|
|
6
|
-
declare const pisellQuickFilter: React.ForwardRefExoticComponent<
|
|
6
|
+
declare const pisellQuickFilter: React.ForwardRefExoticComponent<antd17.FormInstance<any> & {
|
|
7
7
|
hasForm?: boolean | undefined;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
formFiltersPrefix: string;
|
|
@@ -50,7 +50,9 @@ function getDefaultRecordBoardContext(layoutType, selection, rowKey) {
|
|
|
50
50
|
rowKey,
|
|
51
51
|
childComponentProps: void 0,
|
|
52
52
|
scrollAreaHeight: null,
|
|
53
|
-
setScrollAreaHeight: void 0
|
|
53
|
+
setScrollAreaHeight: void 0,
|
|
54
|
+
filterResetKey: void 0,
|
|
55
|
+
setFilterResetKey: void 0
|
|
54
56
|
};
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
@@ -76,6 +78,8 @@ const PisellRecordBoard = (props) => {
|
|
|
76
78
|
const [internalSelectedKeys, setInternalSelectedKeys] = useState([]);
|
|
77
79
|
const [internalSelectedRows, setInternalSelectedRows] = useState([]);
|
|
78
80
|
const [scrollAreaHeight, setScrollAreaHeight] = useState(null);
|
|
81
|
+
/** 点击重置时递增,供 ToolBar 给 PisellFilter 设 key 以强制重挂载,清空弹窗内高级筛选表单 */
|
|
82
|
+
const [filterResetKey, setFilterResetKey] = useState(0);
|
|
79
83
|
const [internalColumnVisibility, setInternalColumnVisibility] = useState(() => {
|
|
80
84
|
var _props$grid$defaultHi, _props$grid, _props$grid$columns, _props$grid2;
|
|
81
85
|
const fromConfig = (_props$grid$defaultHi = (_props$grid = props.grid) === null || _props$grid === void 0 ? void 0 : _props$grid.defaultHiddenColumnKeys) !== null && _props$grid$defaultHi !== void 0 ? _props$grid$defaultHi : [];
|
|
@@ -168,7 +172,9 @@ const PisellRecordBoard = (props) => {
|
|
|
168
172
|
childComponentProps: mergedChildComponentProps !== null && mergedChildComponentProps !== void 0 ? mergedChildComponentProps : defaultCtx.childComponentProps,
|
|
169
173
|
fillHeight,
|
|
170
174
|
scrollAreaHeight,
|
|
171
|
-
setScrollAreaHeight
|
|
175
|
+
setScrollAreaHeight,
|
|
176
|
+
filterResetKey,
|
|
177
|
+
setFilterResetKey
|
|
172
178
|
});
|
|
173
179
|
}, [
|
|
174
180
|
layoutType,
|
|
@@ -190,7 +196,8 @@ const PisellRecordBoard = (props) => {
|
|
|
190
196
|
internalColumnOrder,
|
|
191
197
|
onColumnOrderChangeInternal,
|
|
192
198
|
fillHeight,
|
|
193
|
-
scrollAreaHeight
|
|
199
|
+
scrollAreaHeight,
|
|
200
|
+
filterResetKey
|
|
194
201
|
]);
|
|
195
202
|
const content = /* @__PURE__ */ React.createElement(RecordBoardProvider, { value: contextValue }, children);
|
|
196
203
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -41,7 +41,7 @@ function getDefaultFilterValue() {
|
|
|
41
41
|
* 可透传 topLeft、topRight、bottomLeft、bottomRight、tabs。
|
|
42
42
|
*/
|
|
43
43
|
const RecordBoardToolBar = (props) => {
|
|
44
|
-
var _ctx$childComponentPr, _ctx$childComponentPr2, _searchParams$DEFAULT, _ctx$childComponentPr3, _formFiltersPrefix, _size;
|
|
44
|
+
var _ctx$childComponentPr, _ctx$childComponentPr2, _searchParams$DEFAULT, _ctx$childComponentPr3, _formFiltersPrefix, _size, _filterResetKey;
|
|
45
45
|
const ctx = useRecordBoardContext({ displayName: "toolBar" });
|
|
46
46
|
const { searchParams, onSearch } = ctx;
|
|
47
47
|
const slots = (_ctx$childComponentPr = (_ctx$childComponentPr2 = ctx.childComponentProps) === null || _ctx$childComponentPr2 === void 0 ? void 0 : _ctx$childComponentPr2.toolBar) !== null && _ctx$childComponentPr !== void 0 ? _ctx$childComponentPr : {};
|
|
@@ -141,7 +141,9 @@ const RecordBoardToolBar = (props) => {
|
|
|
141
141
|
const nextFilter = _objectSpread2(_objectSpread2({}, value), {}, { values: _objectSpread2(_objectSpread2({}, currentValues), incomingValues) });
|
|
142
142
|
onSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, { [FILTER_PARAMS_FIELD]: nextFilter }));
|
|
143
143
|
}, [onSearch, searchParams]);
|
|
144
|
+
const filterResetKey = (_filterResetKey = ctx.filterResetKey) !== null && _filterResetKey !== void 0 ? _filterResetKey : 0;
|
|
144
145
|
const filterNode = hideFilter ? null : /* @__PURE__ */ React.createElement(pisellFilter_default, _objectSpread2({
|
|
146
|
+
key: `record-board-filter-${filterResetKey}`,
|
|
145
147
|
value: filterValueForPisellFilter,
|
|
146
148
|
onChange: handleFilterChange,
|
|
147
149
|
hasForm: true,
|
|
@@ -24,9 +24,10 @@ const SORT_PARAMS_FIELD = "sort";
|
|
|
24
24
|
*/
|
|
25
25
|
const ToolBarReset = ({ size = "large", type = "default", children }) => {
|
|
26
26
|
const defaultResetText = getResetButtonText();
|
|
27
|
-
const { searchParams, onSearch, onReset } = useRecordBoardContext();
|
|
27
|
+
const { searchParams, onSearch, onReset, setFilterResetKey } = useRecordBoardContext();
|
|
28
28
|
const handleReset = useCallback(() => {
|
|
29
29
|
var _currentFilter$otherF;
|
|
30
|
+
setFilterResetKey === null || setFilterResetKey === void 0 || setFilterResetKey((prev) => prev + 1);
|
|
30
31
|
const currentFilter = searchParams === null || searchParams === void 0 ? void 0 : searchParams[FILTER_PARAMS_FIELD];
|
|
31
32
|
onSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
|
|
32
33
|
[FILTER_PARAMS_FIELD]: _objectSpread2(_objectSpread2({}, currentFilter), {}, {
|
|
@@ -40,7 +41,8 @@ const ToolBarReset = ({ size = "large", type = "default", children }) => {
|
|
|
40
41
|
}, [
|
|
41
42
|
searchParams,
|
|
42
43
|
onSearch,
|
|
43
|
-
onReset
|
|
44
|
+
onReset,
|
|
45
|
+
setFilterResetKey
|
|
44
46
|
]);
|
|
45
47
|
return /* @__PURE__ */ React.createElement(Button, {
|
|
46
48
|
className: "record-board-toolbar-reset",
|