@pisell/materials 1.0.492 → 1.0.494

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 (111) 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/index.js +1 -1
  5. package/build/lowcode/meta.js +7 -7
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +14 -14
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +17 -17
  11. package/es/components/browserSelect/index.js +2 -2
  12. package/es/components/browserSelect/index.less +49 -47
  13. package/es/components/dataSourceComponents/dataSourceForm/index.js +4 -2
  14. package/es/components/dataSourceComponents/dataSourceForm/style.less +12 -3
  15. package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +1 -0
  16. package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +5 -2
  17. package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +1 -0
  18. package/es/components/dataSourceComponents/dataSourceForm/utils.js +12 -6
  19. package/es/components/dataSourceComponents/dataSourceTable/filter/utils.js +14 -13
  20. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
  21. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +4 -5
  22. package/es/components/dataSourceComponents/dataSourceTable/index.d.ts +1 -1
  23. package/es/components/dataSourceComponents/dataSourceTable/index.js +4 -2
  24. package/es/components/dataSourceComponents/dataSourceWrapper/index.js +4 -2
  25. package/es/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +5 -3
  26. package/es/components/dataSourceComponents/fields/ColorPicker/index.d.ts +1 -1
  27. package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +7 -2
  28. package/es/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +2 -1
  29. package/es/components/dataSourceComponents/fields/Upload/ReadPretty.js +10 -1
  30. package/es/components/dataSourceComponents/fields/Upload/ReadPretty.less +8 -0
  31. package/es/components/dataSourceComponents/fields/Upload/fallback.png +0 -0
  32. package/es/components/dataSourceComponents/fields/Upload/index.less +9 -0
  33. package/es/components/dataSourceComponents/fields/index.d.ts +2 -1
  34. package/es/components/dataSourceComponents/fields/index.js +1 -0
  35. package/es/components/dataSourceComponents/hooks/useActions.d.ts +2 -1
  36. package/es/components/dataSourceComponents/hooks/useActions.js +51 -22
  37. package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +2 -0
  38. package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +6 -3
  39. package/es/components/dataSourceComponents/utils/index.d.ts +0 -0
  40. package/es/components/dataSourceComponents/utils/index.js +0 -0
  41. package/es/components/pisellWalletPassCard/index.d.ts +1 -1
  42. package/es/components/select/index.js +5 -2
  43. package/es/components/select/index.less +11 -0
  44. package/es/components/table/Tabs/index.js +8 -2
  45. package/es/locales/en-US.d.ts +1 -0
  46. package/es/locales/en-US.js +2 -1
  47. package/es/locales/zh-CN.d.ts +1 -0
  48. package/es/locales/zh-CN.js +2 -1
  49. package/es/locales/zh-TW.d.ts +1 -0
  50. package/es/locales/zh-TW.js +2 -1
  51. package/lib/components/browserSelect/index.js +2 -2
  52. package/lib/components/browserSelect/index.less +49 -47
  53. package/lib/components/dataSourceComponents/dataSourceForm/index.js +10 -2
  54. package/lib/components/dataSourceComponents/dataSourceForm/style.less +12 -3
  55. package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +1 -0
  56. package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +5 -2
  57. package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +1 -0
  58. package/lib/components/dataSourceComponents/dataSourceForm/utils.js +2 -3
  59. package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.js +14 -13
  60. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
  61. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +3 -2
  62. package/lib/components/dataSourceComponents/dataSourceTable/index.d.ts +1 -1
  63. package/lib/components/dataSourceComponents/dataSourceTable/index.js +2 -2
  64. package/lib/components/dataSourceComponents/dataSourceWrapper/index.js +11 -2
  65. package/lib/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +11 -2
  66. package/lib/components/dataSourceComponents/fields/ColorPicker/index.d.ts +1 -1
  67. package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +2 -1
  68. package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +2 -1
  69. package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.js +15 -1
  70. package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.less +8 -0
  71. package/lib/components/dataSourceComponents/fields/Upload/fallback.png +0 -0
  72. package/lib/components/dataSourceComponents/fields/Upload/index.less +9 -0
  73. package/lib/components/dataSourceComponents/fields/index.d.ts +2 -1
  74. package/lib/components/dataSourceComponents/fields/index.js +1 -0
  75. package/lib/components/dataSourceComponents/hooks/useActions.d.ts +2 -1
  76. package/lib/components/dataSourceComponents/hooks/useActions.js +22 -3
  77. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +2 -0
  78. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +7 -3
  79. package/lib/components/dataSourceComponents/utils/index.d.ts +0 -0
  80. package/lib/components/dataSourceComponents/utils/index.js +0 -0
  81. package/lib/components/pisellWalletPassCard/index.d.ts +1 -1
  82. package/lib/components/select/index.js +5 -2
  83. package/lib/components/select/index.less +11 -0
  84. package/lib/components/table/Tabs/index.js +1 -0
  85. package/lib/locales/en-US.d.ts +1 -0
  86. package/lib/locales/en-US.js +2 -1
  87. package/lib/locales/zh-CN.d.ts +1 -0
  88. package/lib/locales/zh-CN.js +2 -1
  89. package/lib/locales/zh-TW.d.ts +1 -0
  90. package/lib/locales/zh-TW.js +2 -1
  91. package/lowcode/button/meta.ts +1 -1
  92. package/lowcode/data-source-form/utils.ts +21 -2
  93. package/lowcode/data-source-table/meta.ts +18 -1
  94. package/lowcode/data-source-table/utils.tsx +2 -2
  95. package/lowcode/form-item-select/meta.ts +12 -6
  96. package/lowcode/form-item-select/snippets.ts +2 -6
  97. package/lowcode/form-item-upload/__screenshots__/upload.png +0 -0
  98. package/lowcode/form-item-upload/meta.ts +2 -2
  99. package/lowcode/form-item-upload/snippets.ts +1 -0
  100. package/lowcode/select/snippets.ts +1 -0
  101. package/lowcode/submit-button/meta.ts +67 -16
  102. package/lowcode/submit-button/snippets.ts +6 -1
  103. package/package.json +3 -3
  104. package/dist/umd/materials.min.css +0 -1
  105. package/dist/umd/materials.min.js +0 -1
  106. package/dist/umd/static/DotsSix.57d66266.svg +0 -1
  107. package/dist/umd/static/arrow-left.e542294f.svg +0 -1
  108. package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
  109. package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
  110. package/dist/umd/static/help-circle.31c9be40.svg +0 -1
  111. package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
@@ -102,8 +102,9 @@ var useTableProps = (props) => {
102
102
  currentRecord: record
103
103
  });
104
104
  setTimeout(async () => {
105
- await (destroy == null ? void 0 : destroy.run(record.id));
106
- refreshData();
105
+ destroy == null ? void 0 : destroy.runAsync(record.id).then(() => {
106
+ refreshData();
107
+ });
107
108
  });
108
109
  } catch (error) {
109
110
  console.error(error);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import "./index.less";
2
+ import './index.less';
3
3
  import { DataSourceTableProps } from './type';
4
4
  declare const DataSourceTable: (props: DataSourceTableProps) => React.JSX.Element;
5
5
  export default DataSourceTable;
@@ -37,7 +37,7 @@ var import_BaseTable = __toESM(require("./BaseTable"));
37
37
  var import_DataSourceProvider = __toESM(require("../provider/dataSource/DataSourceProvider"));
38
38
  var import_index = require("./index.less");
39
39
  var DataSourceTable = (props) => {
40
- const { dataSource } = props;
41
- return /* @__PURE__ */ import_react.default.createElement(import_DataSourceProvider.default, { dataSource }, /* @__PURE__ */ import_react.default.createElement(import_BaseTable.default, { ...props }));
40
+ const { dataSource, __designMode } = props;
41
+ return /* @__PURE__ */ import_react.default.createElement(import_DataSourceProvider.default, { dataSource, __designMode }, /* @__PURE__ */ import_react.default.createElement(import_BaseTable.default, { ...props }));
42
42
  };
43
43
  var dataSourceTable_default = DataSourceTable;
@@ -36,7 +36,15 @@ var import_react = __toESM(require("react"));
36
36
  var import_DataSourceProvider = __toESM(require("../provider/dataSource/DataSourceProvider"));
37
37
  var import_BaseWrapper = __toESM(require("./BaseWrapper"));
38
38
  var DataSourceWrapper = (props) => {
39
- const { children, dataSource, overrideData, autoRun, actions, currentValue } = props;
39
+ const {
40
+ children,
41
+ dataSource,
42
+ overrideData,
43
+ autoRun,
44
+ actions,
45
+ currentValue,
46
+ __designMode
47
+ } = props;
40
48
  return /* @__PURE__ */ import_react.default.createElement(
41
49
  import_DataSourceProvider.default,
42
50
  {
@@ -44,7 +52,8 @@ var DataSourceWrapper = (props) => {
44
52
  overrideData,
45
53
  actions,
46
54
  autoRun,
47
- currentValue
55
+ currentValue,
56
+ __designMode
48
57
  },
49
58
  /* @__PURE__ */ import_react.default.createElement(import_BaseWrapper.default, { ...props }, children)
50
59
  );
@@ -33,13 +33,22 @@ __export(ReadPretty_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(ReadPretty_exports);
35
35
  var import_react = __toESM(require("react"));
36
- var import_icons = require("@ant-design/icons");
37
36
  var import_useValueMap = __toESM(require("../../hooks/useValueMap"));
38
37
  var import_utils = require("../../dataSourceForm/utils");
39
38
  var import_ReadPretty = require("./ReadPretty.less");
39
+ var import_iconfont = __toESM(require("../../../iconfont"));
40
40
  var CheckboxReadPretty = (props) => {
41
41
  const { value } = props;
42
- return value ? /* @__PURE__ */ import_react.default.createElement(import_icons.CheckOutlined, { style: { color: "rgb(82, 196, 26)" } }) : null;
42
+ return value ? /* @__PURE__ */ import_react.default.createElement(
43
+ import_iconfont.default,
44
+ {
45
+ type: "pisell2-check",
46
+ style: {
47
+ color: "var(--theme-color)",
48
+ fontSize: 20
49
+ }
50
+ }
51
+ ) : null;
43
52
  };
44
53
  var CheckboxGroupReadPretty = (props) => {
45
54
  const { value, options } = props;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const ColorPicker: React.FC<import("./type").ColorPickerProps & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps>;
2
+ declare const ColorPicker: React.FC<import("antd").ColorPickerProps & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps>;
3
3
  export default ColorPicker;
@@ -328,7 +328,8 @@ var BaseUpload = (props) => {
328
328
  };
329
329
  },
330
330
  headers: getHeaders == null ? void 0 : getHeaders(),
331
- beforeUpload
331
+ beforeUpload,
332
+ className: "pisell-data-source-upload"
332
333
  },
333
334
  fileList.length >= calcMaxCount ? null : uploadButton
334
335
  ), previewImage && /* @__PURE__ */ import_react.default.createElement(
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { UploadProps } from './type';
3
- declare const UploadReadPretty: (props: UploadProps) => React.JSX.Element;
3
+ import './ReadPretty.less';
4
+ declare const UploadReadPretty: (props: UploadProps) => React.JSX.Element | null;
4
5
  export default UploadReadPretty;
@@ -34,7 +34,21 @@ __export(ReadPretty_exports, {
34
34
  module.exports = __toCommonJS(ReadPretty_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
+ var import_fallback = __toESM(require("./fallback.png"));
38
+ var import_ReadPretty = require("./ReadPretty.less");
37
39
  var UploadReadPretty = (props) => {
38
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Image, { src: props.value });
40
+ if (!props.value) {
41
+ return null;
42
+ }
43
+ return /* @__PURE__ */ import_react.default.createElement(
44
+ import_antd.Image,
45
+ {
46
+ className: "pisell-upload-read-pretty",
47
+ src: props == null ? void 0 : props.value,
48
+ width: 100,
49
+ height: 100,
50
+ fallback: import_fallback.default
51
+ }
52
+ );
39
53
  };
40
54
  var ReadPretty_default = UploadReadPretty;
@@ -0,0 +1,8 @@
1
+ .pisell-upload-read-pretty {
2
+ display: flex;
3
+ width: 100px;
4
+ height: 100px;
5
+ padding: 10px;
6
+ border-radius: 10px;
7
+ border: 1px solid var(--Gray-300, #d0d5dd);
8
+ }
@@ -11,3 +11,12 @@
11
11
  // opacity: 0.4;
12
12
  // }
13
13
  }
14
+ .pisell-data-source-upload {
15
+ .pisell-lowcode-upload-list-item-container {
16
+ .pisell-lowcode-upload-list-item-action {
17
+ &:hover {
18
+ background: none;
19
+ }
20
+ }
21
+ }
22
+ }
@@ -32,6 +32,7 @@ declare const formFieldMap: {
32
32
  FormItemPercent: import("react").FC<any>;
33
33
  FormItemTimePicker: import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
34
34
  'FormItemInput.JSON': import("react").FC<any>;
35
+ 'FormItemInput.Email': import("react").FC<import("antd").InputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
35
36
  'FormItemInput.URL': import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
36
37
  'FormItemInput.Password': import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
37
38
  'FormItemRadio.Group': import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
@@ -43,7 +44,7 @@ declare const getFieldComponent: (fieldComponent: string) => import("react").FC<
43
44
  Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
44
45
  } & {
45
46
  Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
46
- }) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
47
+ }) | import("react").FC<import("./ColorPicker/type").ColorPickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<(import("antd").DatePickerProps & import("../dataSourceForm/utils").WithModeProps) & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<import("./Input/type").InputProps> & {
47
48
  JSON: import("react").FC<any>;
48
49
  Password: import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
49
50
  TextArea: import("react").FC<import("antd/es/input").TextAreaProps & import("react").RefAttributes<import("antd/es/input/TextArea").TextAreaRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
@@ -54,6 +54,7 @@ var formFieldMap = {
54
54
  FormItemPercent: import_InputNumber.default,
55
55
  FormItemTimePicker: import_TimePicker.default,
56
56
  "FormItemInput.JSON": import_Input.default.JSON,
57
+ "FormItemInput.Email": import_Input.default.Email,
57
58
  "FormItemInput.URL": import_Input.default.URL,
58
59
  "FormItemInput.Password": import_Input.default.Password,
59
60
  "FormItemRadio.Group": import_Radio.default.Group,
@@ -2,8 +2,9 @@ import { DataSourceType } from '../provider/dataSource/DataSourceContext';
2
2
  export interface UseActionsParams {
3
3
  dataSource?: DataSourceType;
4
4
  currentValue?: 'server' | 'local';
5
+ __designMode?: string;
5
6
  }
6
- declare const useActions: ({ dataSource: propsDataSource, currentValue: propsCurrentValue, }?: UseActionsParams) => {
7
+ declare const useActions: ({ dataSource: propsDataSource, currentValue: propsCurrentValue, __designMode, }?: UseActionsParams) => {
7
8
  create: (values: Record<string, any>) => Promise<any>;
8
9
  get: () => Promise<any>;
9
10
  update: (values: Record<string, any>) => Promise<any>;
@@ -42,13 +42,15 @@ var import_useDataSource = __toESM(require("./useDataSource"));
42
42
  var import_locales = require("../../../locales");
43
43
  var useActions = ({
44
44
  dataSource: propsDataSource,
45
- currentValue: propsCurrentValue
45
+ currentValue: propsCurrentValue,
46
+ __designMode
46
47
  } = {}) => {
47
- const { dataSource: ctxDataSource } = (0, import_useDataSource.default)();
48
+ const { dataSource: ctxDataSource, __designMode: ctxDesignMode } = (0, import_useDataSource.default)();
48
49
  const { parseVariable } = (0, import_useVariables.default)();
49
50
  const { parseActions } = (0, import_useParseActionsVariable.default)();
50
51
  const currentDataSource = propsDataSource || ctxDataSource;
51
52
  const currentValue = propsCurrentValue || "server";
53
+ const designMode = __designMode || ctxDesignMode;
52
54
  const {
53
55
  isCustomApi,
54
56
  actions: originalActions,
@@ -92,7 +94,16 @@ var useActions = ({
92
94
  const getHeaders = (0, import_ahooks.useMemoizedFn)(() => {
93
95
  return headerDataSource ? { "x-data-source": headerDataSource } : {};
94
96
  });
97
+ const designModeToast = (0, import_ahooks.useMemoizedFn)(() => {
98
+ return (0, import_pisellToast.default)({
99
+ content: (0, import_locales.getText)("pisell-design-mode-action-disabled")
100
+ });
101
+ });
95
102
  const create = (0, import_ahooks.useMemoizedFn)(async (values) => {
103
+ if (designMode === "design") {
104
+ designModeToast();
105
+ return Promise.reject();
106
+ }
96
107
  if (isCustomApi) {
97
108
  const actions = getParsedActions();
98
109
  const createApi = genCustomApi(actions == null ? void 0 : actions.create);
@@ -124,6 +135,10 @@ var useActions = ({
124
135
  return {};
125
136
  });
126
137
  const update = (0, import_ahooks.useMemoizedFn)(async (values) => {
138
+ if (designMode === "design") {
139
+ designModeToast();
140
+ return Promise.reject();
141
+ }
127
142
  if (isCustomApi) {
128
143
  const actions = getParsedActions();
129
144
  if (!actions.update) {
@@ -170,6 +185,10 @@ var useActions = ({
170
185
  }
171
186
  );
172
187
  const destroy = (0, import_ahooks.useMemoizedFn)(async (id) => {
188
+ if (designMode === "design") {
189
+ designModeToast();
190
+ return Promise.reject();
191
+ }
173
192
  if (isCustomApi) {
174
193
  const actions = getParsedActions();
175
194
  if (!actions.destroy) {
@@ -179,7 +198,7 @@ var useActions = ({
179
198
  return deleteApi({});
180
199
  }
181
200
  if (!name)
182
- return;
201
+ return Promise.reject();
183
202
  return (0, import_serve.deleteNocobaseData)(name, id, getHeaders());
184
203
  });
185
204
  return {
@@ -89,6 +89,7 @@ export declare type DataSourceContextProps = {
89
89
  get?: boolean;
90
90
  };
91
91
  __id?: string;
92
+ __designMode?: string;
92
93
  };
93
94
  export interface DataSourceContextType {
94
95
  dataSource?: DataSourceType;
@@ -97,6 +98,7 @@ export interface DataSourceContextType {
97
98
  get: Result<any, any>;
98
99
  update: Result<any, any>;
99
100
  create: Result<any, any>;
101
+ __designMode?: string;
100
102
  }
101
103
  export declare const DataSourceContext: import("react").Context<DataSourceContextType>;
102
104
  export default DataSourceContext;
@@ -46,14 +46,16 @@ var DataSourceProvider = (props) => {
46
46
  currentValue,
47
47
  actions: externalActions,
48
48
  overrideData,
49
- autoRun
49
+ autoRun,
50
+ __designMode
50
51
  } = props;
51
52
  (0, import_useSetRequest.default)();
52
53
  const { parseVariable } = (0, import_useVariables.default)();
53
54
  const dataSource = (0, import_utils.isString)(propsDataSource) ? parseVariable == null ? void 0 : parseVariable(propsDataSource) : propsDataSource;
54
55
  const standardActions = (0, import_useActions.default)({
55
56
  dataSource,
56
- currentValue
57
+ currentValue,
58
+ __designMode
57
59
  });
58
60
  const list = (externalActions == null ? void 0 : externalActions.list) || standardActions.list;
59
61
  const get = (externalActions == null ? void 0 : externalActions.get) || standardActions.get;
@@ -77,6 +79,7 @@ var DataSourceProvider = (props) => {
77
79
  });
78
80
  const value = (0, import_react.useMemo)(() => {
79
81
  return {
82
+ __designMode,
80
83
  dataSource,
81
84
  list: {
82
85
  ...listResult,
@@ -97,7 +100,8 @@ var DataSourceProvider = (props) => {
97
100
  getResult,
98
101
  updateResult,
99
102
  createResult,
100
- overrideData
103
+ overrideData,
104
+ __designMode
101
105
  ]);
102
106
  return /* @__PURE__ */ import_react.default.createElement(import_DataSourceContext.default.Provider, { value }, children);
103
107
  };
@@ -21,7 +21,7 @@ export interface PisellWalletPassCardProps {
21
21
  /** 禁用原因 */
22
22
  disabledReason?: string;
23
23
  /** 是否展示禁用原因 */
24
- showDisabledReason?: string;
24
+ showDisabledReason?: boolean;
25
25
  /** 封面图 */
26
26
  cover?: string;
27
27
  /** 余额标题文案 */
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(select_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
37
  var import_ahooks = require("ahooks");
38
+ var import_classnames = __toESM(require("classnames"));
38
39
  var import_iconfont = __toESM(require("../iconfont"));
39
40
  var import_locales = require("../../locales");
40
41
  var import_hoc = require("../../utils/hoc");
@@ -50,7 +51,8 @@ var SelectBase = (0, import_react.forwardRef)((props, ref) => {
50
51
  dropdownRender: propsDropdownRender,
51
52
  showSearch,
52
53
  styleType,
53
- optionFilterProp = "value"
54
+ optionFilterProp = "value",
55
+ popupClassName
54
56
  } = props;
55
57
  const [state, setState] = (0, import_ahooks.useControllableValue)(props);
56
58
  const [searchValue, setSearchValue] = (0, import_react.useState)("");
@@ -136,7 +138,8 @@ var SelectBase = (0, import_react.forwardRef)((props, ref) => {
136
138
  value: state,
137
139
  onChange: (value, option) => setState(value, option),
138
140
  dropdownRender,
139
- options: filteredOptions
141
+ options: filteredOptions,
142
+ popupClassName: (0, import_classnames.default)("pisell-base-select-dropdown", popupClassName)
140
143
  }
141
144
  );
142
145
  });
@@ -9,3 +9,14 @@
9
9
  padding: 0 5px 5px;
10
10
  }
11
11
  }
12
+
13
+ // 添加选项间距
14
+ .pisell-base-select-dropdown {
15
+ .pisell-lowcode-select-item {
16
+ margin-bottom: 4px;
17
+
18
+ &:last-child {
19
+ margin-bottom: 0;
20
+ }
21
+ }
22
+ }
@@ -42,6 +42,7 @@ var Tabs = ({
42
42
  }) => {
43
43
  const tabItems = (0, import_react.useMemo)(() => {
44
44
  return items.map((item, index) => ({
45
+ ...item,
45
46
  key: String(index),
46
47
  label: item.name
47
48
  }));
@@ -161,5 +161,6 @@ declare const _default: {
161
161
  'walletCard-discount': string;
162
162
  'pisellQrcode-done': string;
163
163
  'pisellQrcode-qrcode': string;
164
+ 'pisell-design-mode-action-disabled': string;
164
165
  };
165
166
  export default _default;
@@ -201,5 +201,6 @@ var en_US_default = {
201
201
  "walletCard-discount": "Discount",
202
202
  //PisellQrcode组件
203
203
  "pisellQrcode-done": "Done",
204
- "pisellQrcode-qrcode": "QR code"
204
+ "pisellQrcode-qrcode": "QR code",
205
+ "pisell-design-mode-action-disabled": "This action cannot be performed in edit mode"
205
206
  };
@@ -161,5 +161,6 @@ declare const _default: {
161
161
  'walletCard-discount': string;
162
162
  'pisellQrcode-done': string;
163
163
  'pisellQrcode-qrcode': string;
164
+ 'pisell-design-mode-action-disabled': string;
164
165
  };
165
166
  export default _default;
@@ -200,5 +200,6 @@ var zh_CN_default = {
200
200
  "walletCard-discount": "折扣卡",
201
201
  //PisellQrcode组件
202
202
  "pisellQrcode-done": "完成",
203
- "pisellQrcode-qrcode": "二维码"
203
+ "pisellQrcode-qrcode": "二维码",
204
+ "pisell-design-mode-action-disabled": "编辑模式下不可执行此操作"
204
205
  };
@@ -161,5 +161,6 @@ declare const _default: {
161
161
  'walletCard-discount': string;
162
162
  'pisellQrcode-done': string;
163
163
  'pisellQrcode-qrcode': string;
164
+ 'pisell-design-mode-action-disabled': string;
164
165
  };
165
166
  export default _default;
@@ -201,5 +201,6 @@ var zh_TW_default = {
201
201
  "walletCard-discount": "折扣卡",
202
202
  //PisellQrcode组件
203
203
  "pisellQrcode-done": "完成",
204
- "pisellQrcode-qrcode": "二維碼"
204
+ "pisellQrcode-qrcode": "二維碼",
205
+ "pisell-design-mode-action-disabled": "編輯模式下不可執行此操作"
205
206
  };
@@ -40,7 +40,7 @@ const ButtonMeta = {
40
40
  tip: "children",
41
41
  },
42
42
  propType: 'string',
43
- setter: 'StringSetter',
43
+ setter: 'PisellI18nSetter',
44
44
  },
45
45
  {
46
46
  name: "htmlType",
@@ -42,13 +42,23 @@ export const createSubmitButton = (props: any = {}) => {
42
42
  type: 'primary',
43
43
  size: 'large',
44
44
  status: 'normal',
45
- children: 'Submit',
45
+ childrenString: {
46
+ type: 'i18n',
47
+ en: 'Submit',
48
+ 'zh-CN': '提交',
49
+ 'zh-HK': '提交',
50
+ },
46
51
  confirmConfig: {
47
52
  enable: false,
48
53
  },
49
54
  toastConfig: {
50
55
  enable: true,
51
- title: 'Submitted successfully',
56
+ title: {
57
+ type: 'i18n',
58
+ en: 'Submitted successfully',
59
+ 'zh-CN': '提交成功',
60
+ 'zh-HK': '提交成功',
61
+ },
52
62
  },
53
63
  refreshData: true,
54
64
  afterSubmitType: 'none',
@@ -202,6 +212,13 @@ export const createFormItemSchema = (
202
212
  ) {
203
213
  if (['Radio.Group', 'Checkbox.Group'].includes(xComponent)) {
204
214
  props.direction = 'horizontal';
215
+ } else {
216
+ props.styleType = 'antd';
217
+ if (props.mode === "multiple") {
218
+ props.selectAll = true;
219
+ props.isShowDropdown = true;
220
+ props.showSearch = true;
221
+ }
205
222
  }
206
223
  props.optionSourceType = 'default';
207
224
  props.options = uiSchema.enum;
@@ -209,12 +226,14 @@ export const createFormItemSchema = (
209
226
 
210
227
  if (xComponent === 'TimePicker') {
211
228
  props.format = 'HH:mm';
229
+ props.placeholder = '';
212
230
  props.defaultValue = props.defaultValue || null;
213
231
  }
214
232
 
215
233
  if (xComponent === 'DatePicker') {
216
234
  props.format = props.dateFormat || 'YYYY-MM-DD';
217
235
  props.showTime = false;
236
+ props.placeholder = '';
218
237
  props.defaultValue = null;
219
238
  }
220
239
 
@@ -367,7 +367,6 @@ const dataSourceTable = {
367
367
  },
368
368
  propType: 'bool',
369
369
  setter: 'BoolSetter',
370
- isRequired: true,
371
370
  },
372
371
  ],
373
372
  },
@@ -996,6 +995,24 @@ const dataSourceTable = {
996
995
  propType: 'string',
997
996
  setter: 'StringSetter',
998
997
  },
998
+ {
999
+ name: 'disabled',
1000
+ title: {
1001
+ label: {
1002
+ type: 'i18n',
1003
+ 'en-US': 'Disabled',
1004
+ 'zh-CN': '是否禁用',
1005
+ },
1006
+ tip: {
1007
+ type: 'i18n',
1008
+ 'en-US': 'disabled | Whether the tab is disabled',
1009
+ 'zh-CN': 'disabled | 是否禁用标签页',
1010
+ },
1011
+ },
1012
+ propType: 'bool',
1013
+ defaultValue: false,
1014
+ setter: 'BoolSetter'
1015
+ }
999
1016
  ],
1000
1017
  },
1001
1018
  },
@@ -2,7 +2,7 @@ import {
2
2
  nocobaseCpt2PisellCptMap,
3
3
  systemFields,
4
4
  } from '../data-source-form/constants';
5
- import { clearVariables, createFormItemSchema } from '../data-source-form/utils';
5
+ import { clearVariables, createFormItemSchema, createFormGroup } from '../data-source-form/utils';
6
6
  import {
7
7
  getVariable,
8
8
  getAllVariables,
@@ -241,7 +241,7 @@ export const getFormContent = (target: any, mode: 'add' | 'edit' | 'view') => {
241
241
  ? genDataSourceValueKey(target, 'currentRecord')
242
242
  : undefined,
243
243
  },
244
- children: childrenSchemas,
244
+ children: createFormGroup(childrenSchemas),
245
245
  },
246
246
  ],
247
247
  };
@@ -70,16 +70,22 @@ export default {
70
70
  'en-US': 'Style',
71
71
  'zh-CN': '样式使用',
72
72
  },
73
+ condition(target: any) {
74
+ const mode = target.getProps().getPropValue('mode');
75
+ if (!mode) return false;
76
+ return ['multiple', 'tags'].includes(mode);
77
+ },
73
78
  setter: {
74
79
  componentName: 'SelectSetter',
75
80
  props: {
76
81
  options: [
77
82
  { title: '系统样式', value: 'system' },
78
- { title: 'Antd样式', value: 'antd' }
79
- ]
80
- }
81
- }
82
- }
83
+ { title: 'Antd样式', value: 'antd' },
84
+ ],
85
+ },
86
+ },
87
+ defaultValue: 'antd',
88
+ },
83
89
  ]),
84
90
  ],
85
91
  props: [
@@ -458,7 +464,7 @@ export default {
458
464
  propType: 'bool',
459
465
  },
460
466
  {
461
- name: 'FormItemSelectAll',
467
+ name: 'selectAll',
462
468
  title: { label: '全选', tip: 'FormItemSelectAll |全选' },
463
469
  propType: 'bool',
464
470
  condition: {
@@ -9,9 +9,7 @@ export default [
9
9
  allowClear: true,
10
10
  optionSourceType: 'default',
11
11
  optionFilterProp: 'label',
12
- style: {
13
- width: 200,
14
- },
12
+ styleType: "antd",
15
13
  options: [
16
14
  {
17
15
  label: 'A',
@@ -40,9 +38,7 @@ export default [
40
38
  mode: 'multiple',
41
39
  optionSourceType: 'default',
42
40
  optionFilterProp: 'label',
43
- style: {
44
- width: 200,
45
- },
41
+ styleType: "antd",
46
42
  options: [
47
43
  {
48
44
  label: 'A',
@@ -202,10 +202,10 @@ export default {
202
202
  return target.getProps().getPropValue('enableCustomType');
203
203
  },
204
204
  setter: {
205
- componentName: 'SelectSetter',
205
+ componentName: 'PisellSelectSetter',
206
206
  props: {
207
207
  options: [],
208
- mode: 'tag',
208
+ mode: 'tags',
209
209
  },
210
210
  },
211
211
  },
@@ -1,6 +1,7 @@
1
1
  export default [
2
2
  {
3
3
  title: '多媒体文件上传',
4
+ screenshot: require('./__screenshots__/upload.png'),
4
5
  schema: {
5
6
  componentName: 'FormItemUpload',
6
7
  title: '多媒体文件上传',