@steedos-widgets/amis-object 1.3.2-beta.5 → 1.3.3

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.
@@ -689,6 +689,9 @@ fieldset.antd-Collapse > legend{
689
689
  .whitespace-nowrap {
690
690
  white-space: nowrap
691
691
  }
692
+ .break-all {
693
+ word-break: break-all
694
+ }
692
695
  .rounded {
693
696
  border-radius: 0.25rem
694
697
  }
@@ -1426,6 +1429,9 @@ fieldset.antd-Collapse > legend{
1426
1429
  .steedos-object-form .steedos-markdown .antd-Tabs-pane.is-active {
1427
1430
  display: block;
1428
1431
  }
1432
+ .antd-Select-popover .antd-Select-menu .antd-Select-option .antd-Checkbox--checkbox > span {
1433
+ vertical-align: text-top;
1434
+ }
1429
1435
  }
1430
1436
 
1431
1437
  @media (max-width: 767px) {
@@ -8488,12 +8488,22 @@ function getObjectFooterToolbar(mainObject, formFactor, options) {
8488
8488
  // return [
8489
8489
  // "load-more",
8490
8490
  // ]
8491
- return [
8492
- {
8493
- "type": "pagination",
8494
- "maxButtons": 5
8495
- }
8496
- ]
8491
+ if(options.displayAs === 'split'){
8492
+ return [
8493
+ "switch-per-page",
8494
+ {
8495
+ "type": "pagination",
8496
+ "maxButtons": 5
8497
+ }
8498
+ ]
8499
+ }else {
8500
+ return [
8501
+ {
8502
+ "type": "pagination",
8503
+ "maxButtons": 5
8504
+ }
8505
+ ]
8506
+ }
8497
8507
  }
8498
8508
  else {
8499
8509
  if(options && options.isRelated){
@@ -9119,8 +9129,13 @@ async function lookupToAmisPicker(field, readonly, ctx){
9119
9129
 
9120
9130
  let pickerSchema = null;
9121
9131
  {
9132
+ let labelFieldName = refObjectConfig.NAME_FIELD_KEY || 'name';
9133
+ // organizations 对象的历史遗留问题, fullname 被标记为了 名称字段. 在此处特殊处理.
9134
+ if(refObjectConfig.name === 'organizations'){
9135
+ labelFieldName = 'name';
9136
+ }
9122
9137
  pickerSchema = await getTableSchema$1(tableFields, {
9123
- labelFieldName: refObjectConfig.NAME_FIELD_KEY,
9138
+ labelFieldName,
9124
9139
  top: top,
9125
9140
  isLookup: true,
9126
9141
  ...ctx
@@ -9165,12 +9180,12 @@ async function lookupToAmisPicker(field, readonly, ctx){
9165
9180
 
9166
9181
  pickerSchema.onEvent[`@data.changed.${refObjectConfig.name}`] = {
9167
9182
  "actions": [
9168
- {
9169
- "actionType": "reload"
9170
- },
9171
- {
9172
- "actionType": "custom",
9173
- "script": `
9183
+ {
9184
+ "actionType": "reload"
9185
+ },
9186
+ {
9187
+ "actionType": "custom",
9188
+ "script": `
9174
9189
  const masterRecord = event.data._master && event.data._master.record;
9175
9190
  const fieldConfig = ${JSON.stringify(field)};
9176
9191
  let reference_to = fieldConfig.reference_to;
@@ -9219,9 +9234,9 @@ async function lookupToAmisPicker(field, readonly, ctx){
9219
9234
  }
9220
9235
  });
9221
9236
  `
9222
- }
9237
+ }
9223
9238
  ]
9224
- };
9239
+ };
9225
9240
  }
9226
9241
 
9227
9242
  if(field.pickerSchema){
@@ -9493,7 +9508,9 @@ async function lookupToAmis(field, readonly, ctx){
9493
9508
  }
9494
9509
 
9495
9510
  if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
9496
- ctx.onlyDisplayLookLabel = true;
9511
+ ctx = Object.assign({}, ctx, {
9512
+ onlyDisplayLookLabel: true
9513
+ });
9497
9514
  if(ctx.idsDependOn){
9498
9515
  // ids人员点选模式
9499
9516
  return await lookupToAmisIdsPicker(field, readonly, ctx);
@@ -11008,7 +11025,9 @@ async function getTableColumns$1(fields, options){
11008
11025
  const quickEditSchema = allowEdit ? await getQuickEditSchema(field, options) : allowEdit;
11009
11026
  let className = "";
11010
11027
  if(field.wrap != true){
11011
- className += " whitespace-nowrap";
11028
+ className += " whitespace-nowrap ";
11029
+ }else {
11030
+ className += " break-all ";
11012
11031
  }
11013
11032
  let columnItem;
11014
11033
  if((field.is_name || field.name === options.labelFieldName) && options.objectName === 'cms_files'){
@@ -11136,7 +11155,8 @@ async function getTableColumns$1(fields, options){
11136
11155
  }
11137
11156
  }
11138
11157
  // columns.push(getOperation(fields));
11139
- if(!_$1__namespace.some(columns, { name: options.labelFieldName })){
11158
+ if(!options.isLookup && !_$1__namespace.some(columns, { name: options.labelFieldName })){
11159
+ // 没有名称字段时显示序号字段为链接,lookup弹出的picker不需要此功能
11140
11160
  const href = Router$1.getObjectDetailPath({
11141
11161
  ...options, formFactor: options.formFactor, appId: "${appId}", objectName: options.objectName || "${objectName}", recordId: `\${${options.idFieldName}}`
11142
11162
  });
@@ -11235,7 +11255,9 @@ async function getMobileTableColumns(fields, options){
11235
11255
  let tpl = "";
11236
11256
  if(field.is_name || field.name === options.labelFieldName){
11237
11257
  nameField = field;
11238
- options.onlyDisplayLookLabel = true;
11258
+ options = Object.assign({}, options, {
11259
+ onlyDisplayLookLabel: true
11260
+ });
11239
11261
  tpl = await getFieldTpl(field, options);
11240
11262
  }
11241
11263
  else if(field.type === 'avatar' || field.type === 'image' || field.type === 'file'){
@@ -11244,7 +11266,9 @@ async function getMobileTableColumns(fields, options){
11244
11266
  }
11245
11267
  else {
11246
11268
  if(field.type === 'lookup' || field.type === 'master_detail'){
11247
- options.onlyDisplayLookLabel = true;
11269
+ options = Object.assign({}, options, {
11270
+ onlyDisplayLookLabel: true
11271
+ });
11248
11272
  }
11249
11273
  tpl = await getFieldTpl(field, options);
11250
11274
  }
@@ -12764,7 +12788,7 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
12764
12788
  * @Author: baozhoutao@steedos.com
12765
12789
  * @Date: 2022-05-26 16:02:08
12766
12790
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
12767
- * @LastEditTime: 2023-09-05 15:42:26
12791
+ * @LastEditTime: 2023-09-15 15:36:17
12768
12792
  * @Description:
12769
12793
  */
12770
12794
 
@@ -12854,6 +12878,25 @@ const getSection = async (formFields, permissionFields, fieldSchemaArray, sectio
12854
12878
  if (sectionFieldsVisibleOn.length > 0 && fieldSetBody.length === sectionFieldsVisibleOn.length) {
12855
12879
  section.visibleOn = `${sectionFieldsVisibleOn.join(" || ")}`;
12856
12880
  }
12881
+
12882
+ const fieldGroups = ctx.fieldGroups;
12883
+ const group = fieldGroups && fieldGroups.find(function(groupItem){
12884
+ return groupItem.group_name == sectionName;
12885
+ });
12886
+ let groupVisibleOn = group && group.visible_on;
12887
+ if (groupVisibleOn) {
12888
+ if (groupVisibleOn.startsWith("{{")) {
12889
+ groupVisibleOn = `${groupVisibleOn.substring(2, groupVisibleOn.length - 2).replace(/formData./g, 'data.')}`;
12890
+ } else {
12891
+ groupVisibleOn = `${groupVisibleOn.replace(/formData./g, 'data.')}`;
12892
+ }
12893
+ if (section.visibleOn) {
12894
+ section.visibleOn = `${section.visibleOn + " && " + groupVisibleOn}`;
12895
+ }
12896
+ else {
12897
+ section.visibleOn = groupVisibleOn;
12898
+ }
12899
+ }
12857
12900
  return section
12858
12901
  };
12859
12902
 
@@ -13246,7 +13289,7 @@ async function getObjectForm(objectSchema, ctx){
13246
13289
  submitText: "", // amis 表单不显示提交按钮, 表单提交由项目代码接管
13247
13290
  api: await getSaveApi(objectSchema, recordId, fields, ctx),
13248
13291
  initFetch: recordId != 'new',
13249
- body: await getFormBody(fields, formFields, ctx),
13292
+ body: await getFormBody(fields, formFields, Object.assign({}, ctx, {fieldGroups: objectSchema.field_groups})),
13250
13293
  panelClassName:'m-0 sm:rounded-lg shadow-none border-none',
13251
13294
  bodyClassName: 'p-0',
13252
13295
  className: 'steedos-amis-form',
@@ -13321,7 +13364,7 @@ async function getObjectDetail(objectSchema, recordId, ctx){
13321
13364
  "formData": "$$"
13322
13365
  },
13323
13366
  wrapWithPanel: false,
13324
- body: await getFormBody(_$1.map(fields, (field)=>{field.readonly = true; return field;}), _$1.map(formFields, (field)=>{field.readonly = true; return field;}), Object.assign({}, ctx, {showSystemFields: true})),
13367
+ body: await getFormBody(_$1.map(fields, (field)=>{field.readonly = true; return field;}), _$1.map(formFields, (field)=>{field.readonly = true; return field;}), Object.assign({}, ctx, {showSystemFields: true,fieldGroups: objectSchema.field_groups})),
13325
13368
  className: 'steedos-amis-form bg-white',
13326
13369
  actions: [], // 不显示表单默认的提交按钮
13327
13370
  onEvent: {
@@ -13807,7 +13850,7 @@ async function getRelatedListSchema(
13807
13850
  * @Author: baozhoutao@steedos.com
13808
13851
  * @Date: 2022-07-05 15:55:39
13809
13852
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
13810
- * @LastEditTime: 2023-09-14 11:34:23
13853
+ * @LastEditTime: 2023-09-14 13:57:32
13811
13854
  * @Description:
13812
13855
  */
13813
13856
 
@@ -14169,6 +14212,7 @@ async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
14169
14212
  else if(ctx.extra){
14170
14213
  // 配置列表视图extra_columns时允许字段是hidden的,hidden的字段在uiSchema.fields中不存在
14171
14214
  fields.push({
14215
+ extra: true,
14172
14216
  name: column
14173
14217
  });
14174
14218
  }
@@ -14200,6 +14244,13 @@ async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
14200
14244
  })
14201
14245
  );
14202
14246
  }
14247
+ else if(ctx.extra){
14248
+ // 配置列表视图extra_columns时允许字段是hidden的,hidden的字段在uiSchema.fields中不存在
14249
+ fields.push({
14250
+ extra: true,
14251
+ name: column.field
14252
+ });
14253
+ }
14203
14254
  }
14204
14255
  }
14205
14256
  }
@@ -18372,8 +18423,8 @@ var AmisProvider = function (props) { return __awaiter(void 0, void 0, void 0, f
18372
18423
  /*
18373
18424
  * @Author: baozhoutao@steedos.com
18374
18425
  * @Date: 2022-09-01 14:44:57
18375
- * @LastEditors: baozhoutao@steedos.com
18376
- * @LastEditTime: 2023-05-08 15:05:32
18426
+ * @LastEditors: liaodaxue
18427
+ * @LastEditTime: 2023-09-19 11:12:17
18377
18428
  * @Description:
18378
18429
  */
18379
18430
  var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0, function () {
@@ -18596,10 +18647,8 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
18596
18647
  "click": {
18597
18648
  "actions": [
18598
18649
  {
18599
- "actionType": "link",
18600
- "args": {
18601
- "link": "${path}"
18602
- }
18650
+ "actionType": "custom",
18651
+ "script": "\nconst path = context.props.data.path;\ndoAction({\n actionType: 'url',\n args: {\n \"url\": path,\n \"blank\": false\n }\n});"
18603
18652
  },
18604
18653
  {
18605
18654
  "actionType": "broadcast",
@@ -19822,7 +19871,7 @@ var PageRecordDetail = function (props) { return __awaiter(void 0, void 0, void
19822
19871
  Router$1.setTabDisplayAs(objectApiName, _display);
19823
19872
  }
19824
19873
  recordSchema = {};
19825
- return [4 /*yield*/, getPage({ type: 'record', appId: appId, objectName: objectApiName, formFactor: defaultFormFactor })];
19874
+ return [4 /*yield*/, getPage({ type: 'record', appId: appId, objectName: objectApiName, formFactor: defaultFormFactor || data.formFactor })];
19826
19875
  case 1:
19827
19876
  recordPage = _a.sent();
19828
19877
  recordSchema = recordPage ? recordPage.schema : {