@steedos-widgets/amis-object 3.6.14 → 3.6.15

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.
@@ -4439,6 +4439,7 @@ var frontend_form_confirm$1 = "Confirm";
4439
4439
  var frontend_form_delete$1 = "Delete";
4440
4440
  var frontend_form_view$1 = "view";
4441
4441
  var frontend_form_details$1 = "details";
4442
+ var frontend_form_validation_failed_url$1 = "The URL format is incorrect";
4442
4443
  var frontend_delete_confirm_text$1 = "Are you sure you want to delete this item?";
4443
4444
  var frontend_delete_many_selected_required$1 = "Please select the item to be deleted";
4444
4445
  var frontend_delete_many_confirm_text$1 = "Are you sure you want to delete?";
@@ -4527,6 +4528,7 @@ var en_us = {
4527
4528
  frontend_form_delete: frontend_form_delete$1,
4528
4529
  frontend_form_view: frontend_form_view$1,
4529
4530
  frontend_form_details: frontend_form_details$1,
4531
+ frontend_form_validation_failed_url: frontend_form_validation_failed_url$1,
4530
4532
  frontend_delete_confirm_text: frontend_delete_confirm_text$1,
4531
4533
  frontend_delete_many_selected_required: frontend_delete_many_selected_required$1,
4532
4534
  frontend_delete_many_confirm_text: frontend_delete_many_confirm_text$1,
@@ -4616,6 +4618,7 @@ var frontend_form_confirm = "确认";
4616
4618
  var frontend_form_delete = "删除";
4617
4619
  var frontend_form_view = "查看";
4618
4620
  var frontend_form_details = "详情";
4621
+ var frontend_form_validation_failed_url = "URL 格式不正确";
4619
4622
  var frontend_delete_confirm_text = "确定要删除此项目?";
4620
4623
  var frontend_delete_many_selected_required = "请选择要删除的项";
4621
4624
  var frontend_delete_many_confirm_text = "确定要删除吗?";
@@ -4705,6 +4708,7 @@ var zh_cn = {
4705
4708
  frontend_form_delete: frontend_form_delete,
4706
4709
  frontend_form_view: frontend_form_view,
4707
4710
  frontend_form_details: frontend_form_details,
4711
+ frontend_form_validation_failed_url: frontend_form_validation_failed_url,
4708
4712
  frontend_delete_confirm_text: frontend_delete_confirm_text,
4709
4713
  frontend_delete_many_selected_required: frontend_delete_many_selected_required,
4710
4714
  frontend_delete_many_confirm_text: frontend_delete_many_confirm_text,
@@ -16042,6 +16046,21 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
16042
16046
  type: getAmisStaticFieldType$1('url', readonly, field),
16043
16047
  static: readonly ? true : false
16044
16048
  };
16049
+ if(!readonly){
16050
+ // amis input-url控件不支持相对路径,这里支持下
16051
+ // 如果要使用amis原生input-url控件的默认的isUrl验证效果或自定义字段validations效果,配置字段的amis.validations属性即可,配置为null或空字符串则使用amis默认的isUrl效果
16052
+ let fieldAmisValidations = field.amis?.validations;
16053
+ if(typeof fieldAmisValidations === "undefined"){
16054
+ Object.assign(convertData, {
16055
+ "validations": {
16056
+ "matchRegexp": "^((http:\\/\\/|https:\\/\\/|ftp:\\/\\/|sftp:\\/\\/)+([^\\s\\/\\.]+(\\.[^\\s\\/\\.]+)+))*(\\/[^\\s\\.\\/]+)*$"
16057
+ },
16058
+ "validationErrors": {
16059
+ "matchRegexp": instance.t('frontend_form_validation_failed_url')//"URL 格式不正确"
16060
+ }
16061
+ });
16062
+ }
16063
+ }
16045
16064
  if(readonly && field.show_as_qr){
16046
16065
  convertData = {
16047
16066
  type: "control",
@@ -22189,7 +22208,7 @@ var AmisProvider = function (props) { return __awaiter(void 0, void 0, void 0, f
22189
22208
  * @Author: baozhoutao@steedos.com
22190
22209
  * @Date: 2022-09-01 14:44:57
22191
22210
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
22192
- * @LastEditTime: 2024-05-14 13:30:24
22211
+ * @LastEditTime: 2024-05-14 15:12:49
22193
22212
  * @Description:
22194
22213
  */
22195
22214
  var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0, function () {
@@ -22203,7 +22222,7 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
22203
22222
  isMobile = formFactor === "SMALL" ? true : false;
22204
22223
  on_click_script = "\n var evalFunString = \"(function(){\" + event.data.on_click + \"})()\";\n try{\n eval(evalFunString);\n }\n catch(e){\n console.error(\"catch some error when eval the on_click script for app link:\");\n console.error(e.message + \"\\r\\n\" + e.stack);\n }\n ";
22205
22224
  mobile_blank_script = "\n if(event.data.path[0] == \"/\"){\n Steedos.openWindow(event.data.context.rootUrl + event.data.path)\n }else{\n Steedos.openWindow(event.data.path)\n }\n ";
22206
- convertAppVisibleOnScript = "\n var currentAmis = amisRequire('amis');\n app_items.forEach((item) => {\n let visible_on = item.visible_on && item.visible_on.trim();\n if(visible_on){\n // amis visibleOn\u5C5E\u6027\u4E2D\u7684\u8868\u8FBE\u5F0F\u6765\u81EA\u4F5C\u7528\u57DF\u4E2D\u53D8\u91CF\u65F6,amis\u4E0D\u8BA4,\u6240\u4EE5\u8FD9\u91CC\u628A\u516C\u5F0F\u8868\u8FBE\u5F0F\u63D0\u524D\u8FD0\u884C\u4E0B\n try{\n visible_on = currentAmis.evaluate(visible_on, BuilderAmisObject.AmisLib.createObject(context, item));\n item.visible_on = visible_on;\n }\n catch(ex){\n console.error(\"\u8FD0\u884C\u5E94\u7528\u201C\" + item.name + \"\u201D\u7684\u663E\u793A\u516C\u5F0F\u8868\u8FBE\u5F0F\u65F6\u51FA\u73B0\u9519\u8BEF:\",ex);\n item.visible_on = false;\n }\n }\n });\n ";
22225
+ convertAppVisibleOnScript = "\n var currentAmis = amisRequire('amis');\n app_items.forEach((item) => {\n let visible_on = item.visible_on && item.visible_on.trim();\n if(visible_on){\n // amis visibleOn\u5C5E\u6027\u4E2D\u7684\u8868\u8FBE\u5F0F\u6765\u81EA\u4F5C\u7528\u57DF\u4E2D\u53D8\u91CF\u65F6,amis\u4E0D\u8BA4,\u6240\u4EE5\u8FD9\u91CC\u628A\u516C\u5F0F\u8868\u8FBE\u5F0F\u63D0\u524D\u8FD0\u884C\u4E0B\n try{\n visible_on = currentAmis.evaluate(visible_on, BuilderAmisObject.AmisLib.createObject(context, item));\n item.visible_on = visible_on;\n }\n catch(ex){\n console.error(\"\u8FD0\u884C\u5E94\u7528\u201C\" + item.name + \"\u201D\u7684\u663E\u793A\u516C\u5F0F\u8868\u8FBE\u5F0F\u65F6\u51FA\u73B0\u9519\u8BEF:\",ex);\n item.visible_on = false;\n }\n }\n else{\n item.visible_on = true;\n }\n });\n ";
22207
22226
  pcInitApiAdaptorScript = "\n let app_items = payload;\n let object_items = [];\n let objects = [];\n app_items.forEach((item) => {\n item.children.forEach((i) => {\n if (objects.indexOf(i.id) < 0) {\n objects.push(i.id);\n if(i.type != 'url' && i.type != 'page'){object_items.push(i);}\n }\n })\n })\n ".concat(convertAppVisibleOnScript, "\n payload = {\n app_items,\n object_items\n }\n return payload;\n ");
22208
22227
  mobileInitApiAdaptorScript = "\n let app_items = payload;\n ".concat(convertAppVisibleOnScript, "\n payload = {\n app_items\n }\n return payload;\n ");
22209
22228
  dialogSchema = {};