@pisell/materials 1.0.1079 → 1.0.1080

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.
@@ -44,7 +44,7 @@ export declare const withDataSource: <P extends unknown>(WrappedComponent: React
44
44
  }) => React.JSX.Element;
45
45
  export declare const withOptions: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
46
46
  options?: any;
47
- optionSourceType?: "default" | "custom" | "api" | undefined;
47
+ optionSourceType?: "custom" | "default" | "api" | undefined;
48
48
  labelField: string;
49
49
  valueField: string;
50
50
  extraParams?: Record<string, any> | undefined;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { DataSourceSubFormProps } from './types';
3
+ /**
4
+ * @title DataSourceSubForm 子表单组件
5
+ * @description
6
+ * 独立的子表单组件,专注于渲染一组表单字段。支持两种使用方式:
7
+ * 1. 传入 children:使用低代码引擎渲染的子组件(优先)
8
+ * 2. 传入 xRecordSchema:通过配置自动生成表单字段(fallback)
9
+ *
10
+ * 值结构: { field1: v1, field2: v2 }
11
+ */
12
+ declare const DataSourceSubForm: React.FC<DataSourceSubFormProps>;
13
+ export default DataSourceSubForm;
@@ -0,0 +1,18 @@
1
+ import { DataSourceType } from '../provider/dataSource/DataSourceContext';
2
+ export interface UseActionsParams {
3
+ dataSource?: DataSourceType;
4
+ currentValue?: 'server' | 'local';
5
+ __designMode?: string;
6
+ extraParams?: Record<string, any>;
7
+ }
8
+ declare const useActions: ({ dataSource: propsDataSource, currentValue: propsCurrentValue, __designMode, extraParams: propsExtraParams, }?: UseActionsParams) => {
9
+ create: (this: unknown, values: Record<string, any>) => Promise<any>;
10
+ get: (this: unknown) => Promise<any>;
11
+ update: (this: unknown, values: Record<string, any>) => Promise<any>;
12
+ list: (this: unknown, params: {
13
+ page: number;
14
+ pageSize: number;
15
+ }) => Promise<any>;
16
+ destroy: (this: unknown, id: string) => Promise<any>;
17
+ };
18
+ export default useActions;
@@ -44,7 +44,7 @@ export declare const withDataSource: <P extends unknown>(WrappedComponent: React
44
44
  }) => React.JSX.Element;
45
45
  export declare const withOptions: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
46
46
  options?: any;
47
- optionSourceType?: "default" | "custom" | "api" | undefined;
47
+ optionSourceType?: "custom" | "default" | "api" | undefined;
48
48
  labelField: string;
49
49
  valueField: string;
50
50
  extraParams?: Record<string, any> | undefined;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { DataSourceSubFormProps } from './types';
3
+ /**
4
+ * @title DataSourceSubForm 子表单组件
5
+ * @description
6
+ * 独立的子表单组件,专注于渲染一组表单字段。支持两种使用方式:
7
+ * 1. 传入 children:使用低代码引擎渲染的子组件(优先)
8
+ * 2. 传入 xRecordSchema:通过配置自动生成表单字段(fallback)
9
+ *
10
+ * 值结构: { field1: v1, field2: v2 }
11
+ */
12
+ declare const DataSourceSubForm: React.FC<DataSourceSubFormProps>;
13
+ export default DataSourceSubForm;
@@ -0,0 +1,18 @@
1
+ import { DataSourceType } from '../provider/dataSource/DataSourceContext';
2
+ export interface UseActionsParams {
3
+ dataSource?: DataSourceType;
4
+ currentValue?: 'server' | 'local';
5
+ __designMode?: string;
6
+ extraParams?: Record<string, any>;
7
+ }
8
+ declare const useActions: ({ dataSource: propsDataSource, currentValue: propsCurrentValue, __designMode, extraParams: propsExtraParams, }?: UseActionsParams) => {
9
+ create: (this: unknown, values: Record<string, any>) => Promise<any>;
10
+ get: (this: unknown) => Promise<any>;
11
+ update: (this: unknown, values: Record<string, any>) => Promise<any>;
12
+ list: (this: unknown, params: {
13
+ page: number;
14
+ pageSize: number;
15
+ }) => Promise<any>;
16
+ destroy: (this: unknown, id: string) => Promise<any>;
17
+ };
18
+ export default useActions;
@@ -215,25 +215,21 @@ const dataSourceForm: MetaType = {
215
215
  'en-US': 'Scene',
216
216
  'zh-CN': '场景',
217
217
  },
218
+ tip: {
219
+ type: 'i18n',
220
+ 'en-US': 'Only support: template, profile, instance',
221
+ 'zh-CN': '仅支持: template, profile, instance',
222
+ }
218
223
  },
219
224
  defaultValue: {
220
225
  "type": "JSExpression",
221
226
  "value": "this.props?.scene",
222
- "mock": "template"
223
227
  },
224
228
  condition(target: any) {
225
229
  return !!target.getProps().getPropValue('dataSource')?.fromDeviceSettingMeta;
226
230
  },
227
- setter: {
228
- componentName: 'PisellSelectSetter',
229
- props: {
230
- options: [
231
- { label: 'Template', value: 'template' },
232
- { label: 'Profile', value: 'profile' },
233
- { label: 'Instance', value: 'instance' },
234
- ],
235
- },
236
- },
231
+ setter: 'StringSetter',
232
+ supportVariable: true,
237
233
  },
238
234
  {
239
235
  name: 'sceneRequestId',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.1079",
3
+ "version": "1.0.1080",
4
4
  "scripts": {
5
5
  "dev:tailwind-css": "tailwindcss -c ./tailwind.materials.config.cjs --postcss ./postcss.materials-tailwind.cjs -i ./src/tailwind-input.css -o ./src/pisell-materials.tw.css --watch",
6
6
  "dev": "concurrently -k -n tailwind,father -c cyan,magenta \"pnpm run dev:tailwind-css\" \"father dev\"",