@pisell/materials 6.0.4 → 6.0.6

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 (30) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +7 -7
  5. package/build/lowcode/render/default/view.js +2 -2
  6. package/build/lowcode/view.js +2 -2
  7. package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +10 -16
  8. package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +6 -1
  9. package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +2 -2
  10. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +7 -0
  11. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +22 -1
  12. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +2 -2
  13. package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +6 -0
  14. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +11 -9
  15. package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +8 -7
  16. package/es/components/page/index.js +4 -2
  17. package/es/components/select/index.js +4 -3
  18. package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +4 -5
  19. package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +6 -1
  20. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +1 -1
  21. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +7 -0
  22. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +23 -1
  23. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +2 -2
  24. package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +6 -0
  25. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +8 -14
  26. package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +1 -6
  27. package/lib/components/page/index.js +2 -2
  28. package/lib/components/select/index.js +3 -2
  29. package/lowcode/data-source-table/meta.ts +281 -0
  30. package/package.json +2 -2
@@ -853,6 +853,287 @@ const dataSourceTable = {
853
853
  },
854
854
  ],
855
855
  },
856
+ {
857
+ title: "表格按钮",
858
+ display: 'entry',
859
+ type: 'group',
860
+ name: '_tableButtons',
861
+ items: [
862
+ {
863
+ name: 'tableButtons.show',
864
+ title: {
865
+ label: {
866
+ type: 'i18n',
867
+ 'en-US': 'Show Table Buttons',
868
+ 'zh-CN': '开启表格按钮组',
869
+ },
870
+ tip: {
871
+ type: 'i18n',
872
+ 'en-US': 'tableButtons.show | Whether to display the table button group',
873
+ 'zh-CN': 'tableButtons.show | 是否显示表格按钮组',
874
+ },
875
+ },
876
+ propType: 'bool',
877
+ setter: 'BoolSetter',
878
+ defaultValue: false,
879
+ },
880
+ {
881
+ name: 'tableButtons.items',
882
+ title: {
883
+ label: {
884
+ type: 'i18n',
885
+ 'en-US': 'Table Buttons',
886
+ 'zh-CN': '表格按钮组',
887
+ },
888
+ tip: {
889
+ type: 'i18n',
890
+ 'en-US': 'tableButtons.items | Table buttons on the right',
891
+ 'zh-CN': 'tableButtons.items | 表格右侧按钮项',
892
+ },
893
+ },
894
+ condition: {
895
+ type: 'JSFunction',
896
+ value:
897
+ 'target => !!target.getProps().getPropValue("tableButtons.show")',
898
+ },
899
+ setter: {
900
+ componentName: 'ArraySetter',
901
+ props: {
902
+ itemSetter: {
903
+ componentName: 'ObjectSetter',
904
+ props: {
905
+ config: {
906
+ items: [
907
+ {
908
+ name: 'label',
909
+ title: {
910
+ label: {
911
+ type: 'i18n',
912
+ 'en-US': 'Button Text',
913
+ 'zh-CN': '按钮文案',
914
+ },
915
+ tip: {
916
+ type: 'i18n',
917
+ 'en-US': 'buttonText | Button text',
918
+ 'zh-CN': 'buttonText | 按钮文案',
919
+ },
920
+ },
921
+ propType: 'string',
922
+ setter: 'PisellI18nSetter',
923
+ isRequired: true,
924
+ },
925
+ {
926
+ name: 'openMode',
927
+ condition: (target: any) => {
928
+ const actionType =
929
+ target.parent.getPropValue('actionType');
930
+ return actionType === 'add';
931
+ },
932
+ title: {
933
+ label: {
934
+ type: 'i18n',
935
+ 'en-US': 'Open Mode',
936
+ 'zh-CN': '打开方式',
937
+ },
938
+ tip: {
939
+ type: 'i18n',
940
+ 'en-US': 'openMode | Open mode',
941
+ 'zh-CN': 'openMode | 打开方式',
942
+ },
943
+ },
944
+ propType: {
945
+ type: 'oneOf',
946
+ value: ['modal', 'drawer'],
947
+ },
948
+ setter: {
949
+ componentName: 'RadioGroupSetter',
950
+ props: {
951
+ options: [
952
+ {
953
+ title: '对话框',
954
+ value: 'modal',
955
+ },
956
+ {
957
+ title: '抽屉',
958
+ value: 'drawer',
959
+ },
960
+ ],
961
+ },
962
+ },
963
+ defaultValue: 'drawer',
964
+ },
965
+ {
966
+ name: 'openContentSize',
967
+ condition: (target: any) => {
968
+ const actionType =
969
+ target.parent.getPropValue('actionType');
970
+ return actionType === 'add';
971
+ },
972
+ title: {
973
+ label: {
974
+ type: 'i18n',
975
+ 'en-US': 'Dialog Size',
976
+ 'zh-CN': '弹窗尺寸',
977
+ },
978
+ tip: {
979
+ type: 'i18n',
980
+ 'en-US': 'dialogSize | Dialog size',
981
+ 'zh-CN': 'dialogSize | 弹窗尺寸',
982
+ },
983
+ },
984
+ propType: {
985
+ type: 'oneOf',
986
+ value: ['small', 'middle', 'large'],
987
+ },
988
+ setter: {
989
+ componentName: 'RadioGroupSetter',
990
+ props: {
991
+ options: [
992
+ {
993
+ title: '较窄',
994
+ value: 'small',
995
+ },
996
+ {
997
+ title: '中等',
998
+ value: 'middle',
999
+ },
1000
+ {
1001
+ title: '较宽',
1002
+ value: 'large',
1003
+ },
1004
+ ],
1005
+ },
1006
+ },
1007
+ defaultValue: 'middle',
1008
+ },
1009
+ {
1010
+ name: 'openTitle',
1011
+ title: {
1012
+ label: {
1013
+ type: 'i18n',
1014
+ 'en-US': 'Dialog Title',
1015
+ 'zh-CN': '弹窗标题',
1016
+ },
1017
+ tip: {
1018
+ type: 'i18n',
1019
+ 'en-US': 'dialogTitle | Dialog title',
1020
+ 'zh-CN': 'dialogTitle | 弹窗标题',
1021
+ },
1022
+ },
1023
+ propType: 'string',
1024
+ setter: 'PisellI18nSetter',
1025
+ isRequired: true,
1026
+ condition: (target: any) => {
1027
+ const actionType =
1028
+ target.parent.getPropValue('actionType');
1029
+ return actionType === 'add';
1030
+ },
1031
+ },
1032
+ {
1033
+ name: 'actionType',
1034
+ title: {
1035
+ label: {
1036
+ type: 'i18n',
1037
+ 'en-US': 'Action Type',
1038
+ 'zh-CN': '操作类型',
1039
+ },
1040
+ tip: {
1041
+ type: 'i18n',
1042
+ 'en-US': 'actionType | Action type',
1043
+ 'zh-CN': 'actionType | 操作类型',
1044
+ },
1045
+ },
1046
+ propType: {
1047
+ type: 'oneOf',
1048
+ value: ['add', 'custom'],
1049
+ },
1050
+ extraProps: {
1051
+ setValue(target: any, value: any) {
1052
+ const key = target.parent.getPropValue('key');
1053
+ if (['add', 'custom'].includes(value)) {
1054
+ let content: any = getJsSlot();
1055
+ if (value !== 'custom') {
1056
+ content = getFormContent(target, value);
1057
+ }
1058
+ target.node.setPropValue('operationContent', {
1059
+ ...(target.node.getPropValue(
1060
+ 'operationContent'
1061
+ ) || {}),
1062
+ [key]: content,
1063
+ });
1064
+ }
1065
+
1066
+ return target.parent.setPropValue(
1067
+ 'actionType',
1068
+ value
1069
+ );
1070
+ },
1071
+ },
1072
+ setter: {
1073
+ componentName: 'RadioGroupSetter',
1074
+ props: {
1075
+ options: [
1076
+ {
1077
+ title: '添加',
1078
+ value: 'add',
1079
+ },
1080
+ {
1081
+ title: '自定义',
1082
+ value: 'custom',
1083
+ },
1084
+ ],
1085
+ },
1086
+ },
1087
+ },
1088
+ {
1089
+ name: 'buttonProps',
1090
+ title: {
1091
+ label: {
1092
+ type: 'i18n',
1093
+ 'en-US': 'Button Style',
1094
+ 'zh-CN': '按钮样式',
1095
+ },
1096
+ },
1097
+ propType: 'object',
1098
+ setter: 'JsonSetter',
1099
+ },
1100
+ ],
1101
+ },
1102
+ },
1103
+ initialValue: () => {
1104
+ return {
1105
+ key: uuid(),
1106
+ title: '操作',
1107
+ };
1108
+ },
1109
+ },
1110
+ },
1111
+ },
1112
+ },
1113
+ {
1114
+ name: 'tableButtons.maxCount',
1115
+ title: {
1116
+ label: {
1117
+ type: 'i18n',
1118
+ 'en-US': 'Max Count',
1119
+ 'zh-CN': '最大展示数量',
1120
+ },
1121
+ tip: {
1122
+ type: 'i18n',
1123
+ 'en-US': 'maxCount | Maximum display count',
1124
+ 'zh-CN': 'maxCount | 最大展示数量',
1125
+ },
1126
+ },
1127
+ propType: 'number',
1128
+ condition: {
1129
+ type: 'JSFunction',
1130
+ value:
1131
+ 'target => !!target.getProps().getPropValue("tableButtons.show")',
1132
+ },
1133
+ setter: 'NumberSetter',
1134
+ }
1135
+ ],
1136
+ },
856
1137
  {
857
1138
  title: "标签页",
858
1139
  display: 'entry',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "6.0.4",
3
+ "version": "6.0.6",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -65,8 +65,8 @@
65
65
  "react-virtualized-auto-sizer": "^1.0.20",
66
66
  "crypto-js": "^4.2.0",
67
67
  "@zxing/library": "0.21.2",
68
- "@pisell/icon": "0.0.11",
69
68
  "@pisell/utils": "1.0.42",
69
+ "@pisell/icon": "0.0.11",
70
70
  "@pisell/date-picker": "1.0.100"
71
71
  },
72
72
  "peerDependencies": {