@tachybase/client 0.23.41 → 0.23.47
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/es/application/WebSocketClient.mjs +1 -1
- package/es/application/schema-settings/SchemaSettingsDefaults.mjs +10 -15
- package/es/block-provider/hooks/index.mjs +26 -7
- package/es/built-in/acl/Configuration/RolesResourcesActions.d.ts +1 -1
- package/es/built-in/acl/Configuration/StrategyActions.d.ts +1 -1
- package/es/data-source/collection-field/CollectionField.d.ts +1 -1
- package/es/data-source/data-source/DataSource.d.ts +3 -0
- package/es/modules/blocks/data-blocks/details-multi/__tests__/createDetailsBlockWithPagingUISchema.test.mjs +1 -1
- package/es/modules/blocks/data-blocks/details-single/__tests__/createDetailsBlockWithoutPagingUISchema.test.mjs +1 -1
- package/es/modules/blocks/data-blocks/form/__tests__/createCreateFormBlockUISchema.test.mjs +1 -1
- package/es/modules/blocks/data-blocks/form/__tests__/createEditFormBlockUISchema.test.mjs +1 -1
- package/es/modules/blocks/data-blocks/table/__tests__/createTableBLockSchema.test.mjs +1 -1
- package/es/modules/blocks/data-blocks/table-selector/__tests__/createTableSelectorSchema.test.mjs +1 -1
- package/es/modules/blocks/filter-blocks/collapse/__tests__/createCollapseBlockSchema.test.mjs +1 -1
- package/es/modules/blocks/filter-blocks/form/__tests__/createFilterFormBlockSchema.test.mjs +1 -1
- package/es/modules/fields/component/CustomTitle/customTitleComponentFieldSettings.d.ts +2 -0
- package/es/modules/fields/component/CustomTitle/customTitleComponentFieldSettings.mjs +65 -0
- package/es/modules/fields/component/Select/selectComponentFieldSettings.d.ts +30 -0
- package/es/modules/fields/component/Select/selectComponentFieldSettings.mjs +62 -6
- package/es/schema-component/antd/action/Action.Designer.mjs +5 -7
- package/es/schema-component/antd/association-cascader/AssociationCascader.d.ts +1 -1
- package/es/schema-component/antd/association-cascader/AssociationCascader.mjs +1 -1
- package/es/schema-component/antd/association-field/AssociationSelect.d.ts +1 -1
- package/es/schema-component/antd/association-field/Editable.mjs +1 -1
- package/es/schema-component/antd/association-field/FileManager.d.ts +1 -1
- package/es/schema-component/antd/association-field/InternalCascader.mjs +2 -2
- package/es/schema-component/antd/association-field/InternalViewer.mjs +59 -4
- package/es/schema-component/antd/association-field/ReadPretty.mjs +2 -1
- package/es/schema-component/antd/association-field/SubTabs/InternalCollapse.mjs +2 -2
- package/es/schema-component/antd/auto-complete/AutoComplete.d.ts +1 -1
- package/es/schema-component/antd/auto-complete/AutoComplete.mjs +1 -1
- package/es/schema-component/antd/cascader/Cascader.d.ts +1 -1
- package/es/schema-component/antd/checkbox/Checkbox.d.ts +1 -1
- package/es/schema-component/antd/collection-select/CollectionSelect.d.ts +5 -5
- package/es/schema-component/antd/color-picker/ColorPicker.d.ts +1 -1
- package/es/schema-component/antd/color-select/ColorSelect.d.ts +1 -1
- package/es/schema-component/antd/cron/CronSet.d.ts +1 -1
- package/es/schema-component/antd/custom-cascader/CustomCascader.d.ts +1 -1
- package/es/schema-component/antd/filter/FilterGroup.d.ts +1 -1
- package/es/schema-component/antd/form-item/FormItem.Settings.mjs +83 -2
- package/es/schema-component/antd/icon-picker/IconPicker.d.ts +1 -1
- package/es/schema-component/antd/nanoIDInput/NanoIDInput.d.ts +1 -1
- package/es/schema-component/antd/password/Password.d.ts +1 -1
- package/es/schema-component/antd/percent/Percent.d.ts +1 -1
- package/es/schema-component/antd/preview/Preview.d.ts +1 -1
- package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +4 -4
- package/es/schema-component/antd/remote-select/RemoteSelect.mjs +7 -5
- package/es/schema-component/antd/rich-text/RichText.d.ts +1 -1
- package/es/schema-component/antd/select/FormulaSelect.mjs +3 -3
- package/es/schema-component/antd/select/Select.mjs +3 -1
- package/es/schema-component/antd/unixTimestamp/UnixTimestamp.d.ts +1 -1
- package/es/schema-component/antd/variable/TextArea.mjs +3 -1
- package/es/schema-component/antd/variable/Variable.d.ts +5 -5
- package/es/schema-component/hooks/useFieldModeOptions.mjs +8 -0
- package/es/schema-settings/DateFormat/ExpiresRadio.d.ts +1 -1
- package/es/schema-settings/EditFormulaTitleField.mjs +7 -2
- package/es/schema-settings/SchemaSettingsPlugin.mjs +2 -0
- package/lib/application/WebSocketClient.js +1 -1
- package/lib/application/schema-settings/SchemaSettingsDefaults.js +10 -15
- package/lib/block-provider/hooks/index.js +26 -7
- package/lib/modules/blocks/data-blocks/details-multi/__tests__/createDetailsBlockWithPagingUISchema.test.js +1 -1
- package/lib/modules/blocks/data-blocks/details-single/__tests__/createDetailsBlockWithoutPagingUISchema.test.js +1 -1
- package/lib/modules/blocks/data-blocks/form/__tests__/createCreateFormBlockUISchema.test.js +1 -1
- package/lib/modules/blocks/data-blocks/form/__tests__/createEditFormBlockUISchema.test.js +1 -1
- package/lib/modules/blocks/data-blocks/table/__tests__/createTableBLockSchema.test.js +1 -1
- package/lib/modules/blocks/data-blocks/table-selector/__tests__/createTableSelectorSchema.test.js +1 -1
- package/lib/modules/blocks/filter-blocks/collapse/__tests__/createCollapseBlockSchema.test.js +1 -1
- package/lib/modules/blocks/filter-blocks/form/__tests__/createFilterFormBlockSchema.test.js +1 -1
- package/lib/modules/fields/component/CustomTitle/customTitleComponentFieldSettings.js +99 -0
- package/lib/modules/fields/component/Select/selectComponentFieldSettings.js +69 -6
- package/lib/schema-component/antd/action/Action.Designer.js +5 -7
- package/lib/schema-component/antd/association-cascader/AssociationCascader.js +1 -1
- package/lib/schema-component/antd/association-field/Editable.js +1 -1
- package/lib/schema-component/antd/association-field/InternalCascader.js +2 -2
- package/lib/schema-component/antd/association-field/InternalViewer.js +59 -4
- package/lib/schema-component/antd/association-field/ReadPretty.js +2 -1
- package/lib/schema-component/antd/association-field/SubTabs/InternalCollapse.js +2 -2
- package/lib/schema-component/antd/auto-complete/AutoComplete.js +1 -1
- package/lib/schema-component/antd/form-item/FormItem.Settings.js +83 -2
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +7 -5
- package/lib/schema-component/antd/select/FormulaSelect.js +3 -3
- package/lib/schema-component/antd/select/Select.js +3 -1
- package/lib/schema-component/antd/variable/TextArea.js +3 -1
- package/lib/schema-component/hooks/useFieldModeOptions.js +8 -0
- package/lib/schema-settings/EditFormulaTitleField.js +7 -2
- package/lib/schema-settings/SchemaSettingsPlugin.js +2 -0
- package/package.json +8 -8
|
@@ -16,7 +16,8 @@ const ReadPrettyAssociationField = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_sche
|
|
|
16
16
|
'Select',
|
|
17
17
|
'Picker',
|
|
18
18
|
'CascadeSelect',
|
|
19
|
-
'Cascader'
|
|
19
|
+
'Cascader',
|
|
20
|
+
'CustomTitle'
|
|
20
21
|
].includes(currentMode) && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__InternalViewer_mjs__.ReadPrettyInternalViewer, {
|
|
21
22
|
...props
|
|
22
23
|
}),
|
|
@@ -80,7 +80,7 @@ const InternalTabs = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)
|
|
|
80
80
|
if ((null == tabparams ? void 0 : tabparams.filter) && !fieldServiceFilter) return;
|
|
81
81
|
if ((quickAddField || 'none' !== quickAddField || !isQuickAdd) && fieldSchema.properties) {
|
|
82
82
|
const params = {
|
|
83
|
-
|
|
83
|
+
paginate: false,
|
|
84
84
|
filter: JSON.stringify(fieldServiceFilter)
|
|
85
85
|
};
|
|
86
86
|
if (quickAddParentField && (null == quickAddParentField ? void 0 : quickAddParentField.value) !== 'none') {
|
|
@@ -92,7 +92,7 @@ const InternalTabs = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)
|
|
|
92
92
|
const parentItem = await api.request({
|
|
93
93
|
url: collection.name + ':list',
|
|
94
94
|
params: {
|
|
95
|
-
|
|
95
|
+
paginate: false
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
itemParams['parentTitleField'] = collection.titleField;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const AutoComplete: React.ForwardRefExoticComponent<Omit<
|
|
2
|
+
export declare const AutoComplete: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -21,7 +21,7 @@ const AutoComplete = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.connect)(
|
|
|
21
21
|
const { data: { data: rawOptions } } = await api.request({
|
|
22
22
|
url: fieldSchema['collectionName'] + ':list',
|
|
23
23
|
params: {
|
|
24
|
-
|
|
24
|
+
paginate: false,
|
|
25
25
|
filter: fieldFilter ? {
|
|
26
26
|
...fieldFilter.filter
|
|
27
27
|
} : {}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const Cascader: React.ForwardRefExoticComponent<Omit<
|
|
2
|
+
export declare const Cascader: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
3
3
|
export default Cascader;
|
|
@@ -11,6 +11,6 @@ export declare const Checkbox: {
|
|
|
11
11
|
(props: any): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
ReadPretty: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
__ANT_CHECKBOX: boolean;
|
|
14
|
-
Group: React.ForwardRefExoticComponent<Omit<
|
|
14
|
+
Group: React.ForwardRefExoticComponent<Omit<CheckboxGroupProps<unknown> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
};
|
|
16
16
|
export default Checkbox;
|
|
@@ -4,14 +4,14 @@ export type CollectionSelectProps = SelectProps<any, any> & {
|
|
|
4
4
|
filter?: (item: any, index: number, array: any[]) => boolean;
|
|
5
5
|
isTableOid?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export declare const CollectionSelect: React.ForwardRefExoticComponent<
|
|
7
|
+
export declare const CollectionSelect: React.ForwardRefExoticComponent<SelectProps<any, any> & {
|
|
8
8
|
filter?: (item: any, index: number, array: any[]) => boolean;
|
|
9
9
|
isTableOid?: boolean;
|
|
10
|
-
}
|
|
10
|
+
} & React.RefAttributes<never>>;
|
|
11
11
|
export type DataSourceSelectProps = SelectProps<any, any> & {
|
|
12
12
|
filter?: (item: any, index: number, array: any[]) => boolean;
|
|
13
13
|
};
|
|
14
|
-
export declare const DataSourceSelect: React.ForwardRefExoticComponent<
|
|
14
|
+
export declare const DataSourceSelect: React.ForwardRefExoticComponent<SelectProps<any, any> & {
|
|
15
15
|
filter?: (item: any, index: number, array: any[]) => boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare const DataSourceCollectionCascader: React.ForwardRefExoticComponent<Omit<
|
|
16
|
+
} & React.RefAttributes<never>>;
|
|
17
|
+
export declare const DataSourceCollectionCascader: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const ColorPicker: React.ForwardRefExoticComponent<Omit<
|
|
2
|
+
export declare const ColorPicker: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
3
3
|
export default ColorPicker;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const ColorSelect: React.ForwardRefExoticComponent<Omit<
|
|
2
|
+
export declare const ColorSelect: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
3
3
|
export default ColorSelect;
|
|
@@ -3,5 +3,5 @@ import { SelectProps } from 'antd';
|
|
|
3
3
|
interface CronSetProps extends SelectProps {
|
|
4
4
|
onChange: (v: string) => void;
|
|
5
5
|
}
|
|
6
|
-
export declare const CronSet: React.ForwardRefExoticComponent<
|
|
6
|
+
export declare const CronSet: React.ForwardRefExoticComponent<CronSetProps & React.RefAttributes<never>>;
|
|
7
7
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const CustomCascader: React.ForwardRefExoticComponent<Omit<
|
|
2
|
+
export declare const CustomCascader: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
3
3
|
export default CustomCascader;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const FilterGroup: React.ForwardRefExoticComponent<Omit<
|
|
2
|
+
export declare const FilterGroup: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -11,6 +11,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__ from "../../../da
|
|
|
11
11
|
import * as __WEBPACK_EXTERNAL_MODULE__record_provider_index_mjs__ from "../../../record-provider/index.mjs";
|
|
12
12
|
import * as __WEBPACK_EXTERNAL_MODULE__table_v2_Table_Column_Decorator_mjs__ from "../table-v2/Table.Column.Decorator.mjs";
|
|
13
13
|
import * as __WEBPACK_EXTERNAL_MODULE__schema_items_GeneralSettings_mjs__ from "../../../schema-items/GeneralSettings.mjs";
|
|
14
|
+
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_index_mjs__ from "../../../schema-settings/index.mjs";
|
|
14
15
|
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_hooks_useIsAllowToSetDefaultValue_mjs__ from "../../../schema-settings/hooks/useIsAllowToSetDefaultValue.mjs";
|
|
15
16
|
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_hooks_useIsShowMultipleSwitch_mjs__ from "../../../schema-settings/hooks/useIsShowMultipleSwitch.mjs";
|
|
16
17
|
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_isPatternDisabled_mjs__ from "../../../schema-settings/isPatternDisabled.mjs";
|
|
@@ -568,6 +569,86 @@ const formItemSettings = new __WEBPACK_EXTERNAL_MODULE__application_schema_setti
|
|
|
568
569
|
},
|
|
569
570
|
useVisible: useShowFieldMode
|
|
570
571
|
},
|
|
572
|
+
{
|
|
573
|
+
name: 'customTitle',
|
|
574
|
+
type: 'modal',
|
|
575
|
+
useComponentProps () {
|
|
576
|
+
var _fieldSchema_xcomponentprops_fieldNames, _fieldSchema_xcomponentprops;
|
|
577
|
+
const schema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
578
|
+
const { fieldSchema: tableColumnSchema } = (0, __WEBPACK_EXTERNAL_MODULE__table_v2_Table_Column_Decorator_mjs__.useColumnSchema)();
|
|
579
|
+
const fieldSchema = tableColumnSchema || schema;
|
|
580
|
+
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
581
|
+
const { dn } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useDesignable)();
|
|
582
|
+
const options = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_index_mjs__.useFormulaTitleOptions)();
|
|
583
|
+
const def = null === (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops ? void 0 : null === (_fieldSchema_xcomponentprops_fieldNames = _fieldSchema_xcomponentprops.fieldNames) || void 0 === _fieldSchema_xcomponentprops_fieldNames ? void 0 : _fieldSchema_xcomponentprops_fieldNames.formula;
|
|
584
|
+
const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
585
|
+
return {
|
|
586
|
+
title: t('Custom option label'),
|
|
587
|
+
schema: {
|
|
588
|
+
type: 'object',
|
|
589
|
+
title: t('Custom option label'),
|
|
590
|
+
properties: {
|
|
591
|
+
formula: {
|
|
592
|
+
required: true,
|
|
593
|
+
'x-decorator': 'FormItem',
|
|
594
|
+
'x-component': 'Variable.TextArea',
|
|
595
|
+
'x-component-props': {
|
|
596
|
+
scope: options
|
|
597
|
+
},
|
|
598
|
+
default: def || ''
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
onSubmit: (param)=>{
|
|
603
|
+
let { formula } = param;
|
|
604
|
+
if (formula) {
|
|
605
|
+
var _fieldSchema_xcomponentprops, _field_componentProps;
|
|
606
|
+
const componentProps = {
|
|
607
|
+
...fieldSchema['x-component-props'],
|
|
608
|
+
fieldNames: {
|
|
609
|
+
...null === (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops ? void 0 : _fieldSchema_xcomponentprops['fieldNames'],
|
|
610
|
+
formula
|
|
611
|
+
},
|
|
612
|
+
appends: [
|
|
613
|
+
fieldSchema['name']
|
|
614
|
+
]
|
|
615
|
+
};
|
|
616
|
+
const regex = /{{(.*?)}}/g;
|
|
617
|
+
let match;
|
|
618
|
+
while(match = regex.exec(formula))if (match[1].includes('.')) {
|
|
619
|
+
const matchList = match[1].split('.');
|
|
620
|
+
let appendsValue = fieldSchema['name'];
|
|
621
|
+
matchList.forEach((item, index)=>{
|
|
622
|
+
if (index === matchList.length - 1) return;
|
|
623
|
+
appendsValue += '.' + item;
|
|
624
|
+
componentProps.appends.push(appendsValue);
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
field.componentProps = {
|
|
628
|
+
...field.componentProps,
|
|
629
|
+
fieldNames: {
|
|
630
|
+
...null === (_field_componentProps = field.componentProps) || void 0 === _field_componentProps ? void 0 : _field_componentProps.fieldNames,
|
|
631
|
+
formula
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
fieldSchema['x-component-props'] = componentProps;
|
|
635
|
+
dn.emit('patch', {
|
|
636
|
+
schema: {
|
|
637
|
+
'x-uid': fieldSchema['x-uid'],
|
|
638
|
+
'x-component-props': componentProps
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
dn.refresh();
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
},
|
|
646
|
+
useVisible: ()=>{
|
|
647
|
+
const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
648
|
+
const formula = 'CustomTitle' === fieldSchema['x-component-props'].mode;
|
|
649
|
+
return useShowFieldMode() && formula;
|
|
650
|
+
}
|
|
651
|
+
},
|
|
571
652
|
{
|
|
572
653
|
name: 'popupSize',
|
|
573
654
|
type: 'select',
|
|
@@ -934,7 +1015,7 @@ const formItemSettings = new __WEBPACK_EXTERNAL_MODULE__application_schema_setti
|
|
|
934
1015
|
const options = useTitleFieldOptions();
|
|
935
1016
|
const isAssociationField = useIsAssociationField();
|
|
936
1017
|
const fieldMode = useFieldMode();
|
|
937
|
-
return options.length > 0 && isAssociationField && 'SubTable' !== fieldMode;
|
|
1018
|
+
return options.length > 0 && isAssociationField && 'SubTable' !== fieldMode && 'CustomTitle' !== fieldMode;
|
|
938
1019
|
},
|
|
939
1020
|
useComponentProps () {
|
|
940
1021
|
var _field_componentProps_fieldNames, _field_componentProps;
|
|
@@ -1179,7 +1260,7 @@ function useFieldMode() {
|
|
|
1179
1260
|
function useIsSelectFieldMode() {
|
|
1180
1261
|
const fieldMode = useFieldMode();
|
|
1181
1262
|
const isAssociationField = useIsAssociationField();
|
|
1182
|
-
const isSelectFieldMode = isAssociationField && 'Select' === fieldMode;
|
|
1263
|
+
const isSelectFieldMode = isAssociationField && ('Select' === fieldMode || 'CustomTitle' === fieldMode);
|
|
1183
1264
|
return isSelectFieldMode;
|
|
1184
1265
|
}
|
|
1185
1266
|
function useValidateSchema() {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const IconPicker: React.ForwardRefExoticComponent<Omit<
|
|
2
|
+
export declare const IconPicker: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
3
3
|
export default IconPicker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const NanoIDInput: React.ForwardRefExoticComponent<Omit<
|
|
2
|
+
export declare const NanoIDInput: React.ForwardRefExoticComponent<Omit<import("antd").InputProps & React.RefAttributes<import("antd").InputRef>, "ref"> & React.RefAttributes<import("antd").InputRef>> & {
|
|
3
3
|
ReadPretty: (props: import("antd").InputProps & {
|
|
4
4
|
ellipsis?: any;
|
|
5
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,5 +3,5 @@ import { PasswordProps } from 'antd/es/input';
|
|
|
3
3
|
export interface IPasswordProps extends PasswordProps {
|
|
4
4
|
checkStrength: boolean;
|
|
5
5
|
}
|
|
6
|
-
export declare const Password: React.ForwardRefExoticComponent<
|
|
6
|
+
export declare const Password: React.ForwardRefExoticComponent<IPasswordProps & React.RefAttributes<never>>;
|
|
7
7
|
export default Password;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const Percent: React.ForwardRefExoticComponent<Omit<
|
|
2
|
+
export declare const Percent: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -8,6 +8,6 @@ type Props = UploadProps & {
|
|
|
8
8
|
onRemove?: (file: any) => void;
|
|
9
9
|
onSelect?: () => void;
|
|
10
10
|
};
|
|
11
|
-
export declare const Preview: React.ForwardRefExoticComponent<Omit<
|
|
11
|
+
export declare const Preview: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
12
12
|
export declare const FileSelector: (props: Props) => React.JSX.Element;
|
|
13
13
|
export default Preview;
|
|
@@ -5,7 +5,7 @@ import { ReadPretty } from './ReadPretty';
|
|
|
5
5
|
export type RemoteSelectProps<P = any> = SelectProps<P, any> & {
|
|
6
6
|
objectValue?: boolean;
|
|
7
7
|
onChange?: (v: any) => void;
|
|
8
|
-
target
|
|
8
|
+
target?: string;
|
|
9
9
|
wait?: number;
|
|
10
10
|
manual?: boolean;
|
|
11
11
|
mapOptions?: (data: any) => RemoteSelectProps['fieldNames'];
|
|
@@ -14,10 +14,10 @@ export type RemoteSelectProps<P = any> = SelectProps<P, any> & {
|
|
|
14
14
|
CustomDropdownRender?: (v: any) => any;
|
|
15
15
|
optionFilter?: (option: any) => boolean;
|
|
16
16
|
};
|
|
17
|
-
declare const InternalRemoteSelect: React.ForwardRefExoticComponent<
|
|
17
|
+
declare const InternalRemoteSelect: React.ForwardRefExoticComponent<SelectProps<any, any> & {
|
|
18
18
|
objectValue?: boolean;
|
|
19
19
|
onChange?: (v: any) => void;
|
|
20
|
-
target
|
|
20
|
+
target?: string;
|
|
21
21
|
wait?: number;
|
|
22
22
|
manual?: boolean;
|
|
23
23
|
mapOptions?: (data: any) => RemoteSelectProps["fieldNames"];
|
|
@@ -25,7 +25,7 @@ declare const InternalRemoteSelect: React.ForwardRefExoticComponent<Partial<Sele
|
|
|
25
25
|
service: ResourceActionOptions<any>;
|
|
26
26
|
CustomDropdownRender?: (v: any) => any;
|
|
27
27
|
optionFilter?: (option: any) => boolean;
|
|
28
|
-
}
|
|
28
|
+
} & React.RefAttributes<never>>;
|
|
29
29
|
export declare const RemoteSelect: typeof InternalRemoteSelect & {
|
|
30
30
|
ReadPretty: typeof ReadPretty;
|
|
31
31
|
};
|
|
@@ -91,15 +91,17 @@ const InternalRemoteSelect = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.c
|
|
|
91
91
|
null == targetField ? void 0 : targetField.uiSchema,
|
|
92
92
|
fieldNames
|
|
93
93
|
]);
|
|
94
|
+
const params = {
|
|
95
|
+
...null == service ? void 0 : service.params,
|
|
96
|
+
filter: null == service ? void 0 : null === (_service_params = service.params) || void 0 === _service_params ? void 0 : _service_params.filter
|
|
97
|
+
};
|
|
98
|
+
if (fieldNames['formula']) params['paginate'] = false;
|
|
99
|
+
else params['pageSize'] = 200;
|
|
94
100
|
const { data, run, loading } = (0, __WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__.useRequest)({
|
|
95
101
|
action: 'list',
|
|
96
102
|
...service,
|
|
97
103
|
headers,
|
|
98
|
-
params
|
|
99
|
-
pageSize: fieldNames['formula'] ? 9999 : 200,
|
|
100
|
-
...null == service ? void 0 : service.params,
|
|
101
|
-
filter: null == service ? void 0 : null === (_service_params = service.params) || void 0 === _service_params ? void 0 : _service_params.filter
|
|
102
|
-
}
|
|
104
|
+
params
|
|
103
105
|
}, {
|
|
104
106
|
manual,
|
|
105
107
|
debounceWait: wait
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const RichText: React.ForwardRefExoticComponent<Omit<
|
|
2
|
+
export declare const RichText: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -107,7 +107,7 @@ const useLabelOptions = (others)=>{
|
|
|
107
107
|
resource: (null == collectionField ? void 0 : collectionField.target) || fieldSchema['collectionName'],
|
|
108
108
|
action: 'list',
|
|
109
109
|
params: {
|
|
110
|
-
|
|
110
|
+
paginate: false
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
const regex = /{{(.*?)}}/g;
|
|
@@ -142,7 +142,7 @@ const useLabelOptions = (others)=>{
|
|
|
142
142
|
const opvalue = opValue[match[1].split('.')[0]];
|
|
143
143
|
const value = opvalue ? opValue[match[1].split('.')[0]][match[1].split('.')[1]] : '';
|
|
144
144
|
valueOject[match[1]] = null != value ? value : '';
|
|
145
|
-
} else valueOject[match[1]] =
|
|
145
|
+
} else valueOject[match[1]] = opValue[match[1]] || '';
|
|
146
146
|
outputStr = replacePlaceholders(formula, valueOject);
|
|
147
147
|
}
|
|
148
148
|
});
|
|
@@ -169,7 +169,7 @@ const FormulaSelect = (props)=>{
|
|
|
169
169
|
api.request({
|
|
170
170
|
url: others.collection + ':list',
|
|
171
171
|
params: {
|
|
172
|
-
|
|
172
|
+
paginate: false,
|
|
173
173
|
filter: filterField ? {
|
|
174
174
|
...filterField.filter
|
|
175
175
|
} : {}
|
|
@@ -83,7 +83,9 @@ const InternalSelect = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.connect
|
|
|
83
83
|
'multiple',
|
|
84
84
|
'tags'
|
|
85
85
|
].includes(mode)) mode = void 0;
|
|
86
|
-
if (
|
|
86
|
+
if ([
|
|
87
|
+
'CustomTitle'
|
|
88
|
+
].includes(props.mode) && ('formula' in others.fieldNames || 'collection' in props)) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__FormulaSelect_mjs__["default"], {
|
|
87
89
|
...props
|
|
88
90
|
});
|
|
89
91
|
if (objectValue) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(ObjectSelect, {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const UnixTimestamp: React.ForwardRefExoticComponent<Omit<
|
|
2
|
+
export declare const UnixTimestamp: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -140,7 +140,9 @@ function getCurrentRange(element) {
|
|
|
140
140
|
return result;
|
|
141
141
|
}
|
|
142
142
|
function TextArea(props) {
|
|
143
|
-
const { value
|
|
143
|
+
const { value: propsValue, scope, onChange, multiline = true, changeOnSelect } = props;
|
|
144
|
+
const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
145
|
+
const value = propsValue || fieldSchema.default || '';
|
|
144
146
|
const { styles } = (0, __WEBPACK_EXTERNAL_MODULE__style_mjs__.useStyles)({
|
|
145
147
|
multiline
|
|
146
148
|
});
|
|
@@ -6,10 +6,10 @@ export declare function VariableScopeProvider({ scope, children }: {
|
|
|
6
6
|
export declare function useVariableScope(): any[];
|
|
7
7
|
export declare function Variable(): any;
|
|
8
8
|
export declare namespace Variable {
|
|
9
|
-
var Input: React.ForwardRefExoticComponent<Omit<
|
|
10
|
-
var TextArea: React.ForwardRefExoticComponent<Omit<
|
|
11
|
-
var RawTextArea: React.ForwardRefExoticComponent<Omit<
|
|
12
|
-
var JSON: React.ForwardRefExoticComponent<Omit<
|
|
13
|
-
var CodeMirror: React.ForwardRefExoticComponent<Omit<
|
|
9
|
+
var Input: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
10
|
+
var TextArea: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
11
|
+
var RawTextArea: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
12
|
+
var JSON: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
13
|
+
var CodeMirror: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
14
14
|
}
|
|
15
15
|
export default Variable;
|
|
@@ -206,6 +206,10 @@ const useFieldModeOptions = (props)=>{
|
|
|
206
206
|
label: t('Tag'),
|
|
207
207
|
value: 'Tag'
|
|
208
208
|
},
|
|
209
|
+
{
|
|
210
|
+
label: t('Custom Title'),
|
|
211
|
+
value: 'CustomTitle'
|
|
212
|
+
},
|
|
209
213
|
!isTableField && {
|
|
210
214
|
label: t('Sub-details'),
|
|
211
215
|
value: 'Nester'
|
|
@@ -234,6 +238,10 @@ const useFieldModeOptions = (props)=>{
|
|
|
234
238
|
{
|
|
235
239
|
label: t('Cascader'),
|
|
236
240
|
value: 'Cascader'
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
label: t('Custom Title'),
|
|
244
|
+
value: 'CustomTitle'
|
|
237
245
|
}
|
|
238
246
|
];
|
|
239
247
|
default:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const DateFormatCom: (props?: any) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare const ExpiresRadio: React.ForwardRefExoticComponent<Omit<
|
|
3
|
+
declare const ExpiresRadio: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
4
4
|
export { ExpiresRadio };
|
|
@@ -9,7 +9,9 @@ function useFormulaTitleOptions() {
|
|
|
9
9
|
const compile = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useCompile)();
|
|
10
10
|
const { getCollectionJoinField, getCollectionFields } = (0, __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollectionManager_deprecated)();
|
|
11
11
|
const { getField } = (0, __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
|
|
12
|
-
const fieldSchema = (0,
|
|
12
|
+
const { fieldSchema: tableColumnSchema } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useColumnSchema)();
|
|
13
|
+
const schema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
14
|
+
const fieldSchema = tableColumnSchema || schema;
|
|
13
15
|
const collectionManage = (0, __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollectionManager_deprecated)();
|
|
14
16
|
const collectionManageField = collectionManage.collections.filter((value)=>value.name === fieldSchema['x-decorator-props'])[0];
|
|
15
17
|
const collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
|
@@ -18,7 +20,10 @@ function useFormulaTitleOptions() {
|
|
|
18
20
|
else if (collectionManageField) fields = collectionManageField['fields'];
|
|
19
21
|
const options = [];
|
|
20
22
|
null == fields || fields.forEach((field)=>{
|
|
21
|
-
if (
|
|
23
|
+
if (![
|
|
24
|
+
'm2m',
|
|
25
|
+
'o2m'
|
|
26
|
+
].includes(field.interface)) {
|
|
22
27
|
if (field.uiSchema) {
|
|
23
28
|
var _getCollectionFields;
|
|
24
29
|
var _getCollectionFields_filter_map;
|
|
@@ -36,6 +36,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__modules_blocks_other_blocks_markdown_mark
|
|
|
36
36
|
import * as __WEBPACK_EXTERNAL_MODULE__modules_fields_component_Cascader_cascaderComponentFieldSettings_mjs__ from "../modules/fields/component/Cascader/cascaderComponentFieldSettings.mjs";
|
|
37
37
|
import * as __WEBPACK_EXTERNAL_MODULE__modules_fields_component_CascadeSelect_cascadeSelectComponentFieldSettings_mjs__ from "../modules/fields/component/CascadeSelect/cascadeSelectComponentFieldSettings.mjs";
|
|
38
38
|
import * as __WEBPACK_EXTERNAL_MODULE__modules_fields_component_Checkbox_checkboxComponentFieldSettings_mjs__ from "../modules/fields/component/Checkbox/checkboxComponentFieldSettings.mjs";
|
|
39
|
+
import * as __WEBPACK_EXTERNAL_MODULE__modules_fields_component_CustomTitle_customTitleComponentFieldSettings_mjs__ from "../modules/fields/component/CustomTitle/customTitleComponentFieldSettings.mjs";
|
|
39
40
|
import * as __WEBPACK_EXTERNAL_MODULE__modules_fields_component_DatePicker_datePickerComponentFieldSettings_mjs__ from "../modules/fields/component/DatePicker/datePickerComponentFieldSettings.mjs";
|
|
40
41
|
import * as __WEBPACK_EXTERNAL_MODULE__modules_fields_component_DrawerSubTable_drawerSubTableComponentFieldSettings_mjs__ from "../modules/fields/component/DrawerSubTable/drawerSubTableComponentFieldSettings.mjs";
|
|
41
42
|
import * as __WEBPACK_EXTERNAL_MODULE__modules_fields_component_FileManager_fileManagerComponentFieldSettings_mjs__ from "../modules/fields/component/FileManager/fileManagerComponentFieldSettings.mjs";
|
|
@@ -100,6 +101,7 @@ class SchemaSettingsPlugin extends __WEBPACK_EXTERNAL_MODULE__application_Plugin
|
|
|
100
101
|
this.schemaSettingsManager.add(__WEBPACK_EXTERNAL_MODULE__modules_fields_component_InputNumber_inputNumberComponentFieldSettings_mjs__.inputNumberComponentFieldSettings);
|
|
101
102
|
this.schemaSettingsManager.add(__WEBPACK_EXTERNAL_MODULE__modules_fields_component_Checkbox_checkboxComponentFieldSettings_mjs__.checkboxComponentFieldSettings);
|
|
102
103
|
this.schemaSettingsManager.add(__WEBPACK_EXTERNAL_MODULE__modules_fields_component_Radio_radioComponentFieldSettings_mjs__.radioComponentFieldSettings);
|
|
104
|
+
this.schemaSettingsManager.add(__WEBPACK_EXTERNAL_MODULE__modules_fields_component_CustomTitle_customTitleComponentFieldSettings_mjs__.CustomTitleComponentFieldSettings);
|
|
103
105
|
this.schemaSettingsManager.add(__WEBPACK_EXTERNAL_MODULE__modules_fields_component_FileManager_fileManagerComponentFieldSettings_mjs__.fileManagerComponentFieldSettings);
|
|
104
106
|
this.schemaSettingsManager.add(__WEBPACK_EXTERNAL_MODULE__modules_fields_component_Tag_tagComponentFieldSettings_mjs__.tagComponentFieldSettings);
|
|
105
107
|
this.schemaSettingsManager.add(__WEBPACK_EXTERNAL_MODULE__modules_fields_component_CascadeSelect_cascadeSelectComponentFieldSettings_mjs__.cascadeSelectComponentFieldSettings);
|
|
@@ -48,7 +48,7 @@ class WebSocketClient {
|
|
|
48
48
|
const apiBaseURL = null == options ? void 0 : null === (_options_apiClient = options.apiClient) || void 0 === _options_apiClient ? void 0 : _options_apiClient['baseURL'];
|
|
49
49
|
if (!apiBaseURL) return;
|
|
50
50
|
const subApp = (0, sdk_namespaceObject.getSubAppName)(this.app.getPublicPath());
|
|
51
|
-
const queryString = subApp ? "?__appName=".concat(subApp) :
|
|
51
|
+
const queryString = subApp ? "?__appName=".concat(subApp) : "?__hostname=".concat(window.location.hostname);
|
|
52
52
|
const wsPath = this.options.basename || '/ws';
|
|
53
53
|
if (this.options.url) {
|
|
54
54
|
const url = new URL(this.options.url);
|
|
@@ -162,20 +162,17 @@ const defaultSettingItems = [
|
|
|
162
162
|
refresh,
|
|
163
163
|
fieldSchema
|
|
164
164
|
]);
|
|
165
|
-
const { data } = (0, index_js_namespaceObject.useRequest)(async ()=>{
|
|
166
|
-
const { data } = await api.request({
|
|
167
|
-
url: "/uiSchemas:getJsonSchema/".concat(fieldSchema['x-uid'], "?includeAsyncNode=true")
|
|
168
|
-
});
|
|
169
|
-
return data;
|
|
170
|
-
});
|
|
171
165
|
return {
|
|
172
166
|
width: '800px',
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
};
|
|
167
|
+
asyncGetInitialValues: async ()=>{
|
|
168
|
+
const { data } = await api.request({
|
|
169
|
+
url: "/uiSchemas:getJsonSchema/".concat(fieldSchema['x-uid'], "?includeAsyncNode=true")
|
|
170
|
+
});
|
|
178
171
|
return {
|
|
172
|
+
schema: JSON.stringify((null == data ? void 0 : data.data) || {}, null, 2)
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
schema: ()=>({
|
|
179
176
|
type: 'object',
|
|
180
177
|
title: t('Edit'),
|
|
181
178
|
properties: {
|
|
@@ -183,7 +180,6 @@ const defaultSettingItems = [
|
|
|
183
180
|
type: 'string',
|
|
184
181
|
title: '{{ t("Schema") }}',
|
|
185
182
|
required: true,
|
|
186
|
-
default: JSON.stringify((null == data ? void 0 : data.data) || {}, null, 2),
|
|
187
183
|
'x-decorator': 'FormItem',
|
|
188
184
|
'x-component': 'CodeMirror',
|
|
189
185
|
'x-component-props': {
|
|
@@ -192,9 +188,8 @@ const defaultSettingItems = [
|
|
|
192
188
|
}
|
|
193
189
|
}
|
|
194
190
|
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
title: data ? t('Edit') : t('Loading'),
|
|
191
|
+
}),
|
|
192
|
+
title: t('Edit'),
|
|
198
193
|
onSubmit: async (param)=>{
|
|
199
194
|
let { schema } = param;
|
|
200
195
|
dn.emit('patch', {
|