@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.
@@ -4467,6 +4467,7 @@ var frontend_form_confirm$1 = "Confirm";
4467
4467
  var frontend_form_delete$1 = "Delete";
4468
4468
  var frontend_form_view$1 = "view";
4469
4469
  var frontend_form_details$1 = "details";
4470
+ var frontend_form_validation_failed_url$1 = "The URL format is incorrect";
4470
4471
  var frontend_delete_confirm_text$1 = "Are you sure you want to delete this item?";
4471
4472
  var frontend_delete_many_selected_required$1 = "Please select the item to be deleted";
4472
4473
  var frontend_delete_many_confirm_text$1 = "Are you sure you want to delete?";
@@ -4555,6 +4556,7 @@ var en_us = {
4555
4556
  frontend_form_delete: frontend_form_delete$1,
4556
4557
  frontend_form_view: frontend_form_view$1,
4557
4558
  frontend_form_details: frontend_form_details$1,
4559
+ frontend_form_validation_failed_url: frontend_form_validation_failed_url$1,
4558
4560
  frontend_delete_confirm_text: frontend_delete_confirm_text$1,
4559
4561
  frontend_delete_many_selected_required: frontend_delete_many_selected_required$1,
4560
4562
  frontend_delete_many_confirm_text: frontend_delete_many_confirm_text$1,
@@ -4644,6 +4646,7 @@ var frontend_form_confirm = "确认";
4644
4646
  var frontend_form_delete = "删除";
4645
4647
  var frontend_form_view = "查看";
4646
4648
  var frontend_form_details = "详情";
4649
+ var frontend_form_validation_failed_url = "URL 格式不正确";
4647
4650
  var frontend_delete_confirm_text = "确定要删除此项目?";
4648
4651
  var frontend_delete_many_selected_required = "请选择要删除的项";
4649
4652
  var frontend_delete_many_confirm_text = "确定要删除吗?";
@@ -4733,6 +4736,7 @@ var zh_cn = {
4733
4736
  frontend_form_delete: frontend_form_delete,
4734
4737
  frontend_form_view: frontend_form_view,
4735
4738
  frontend_form_details: frontend_form_details,
4739
+ frontend_form_validation_failed_url: frontend_form_validation_failed_url,
4736
4740
  frontend_delete_confirm_text: frontend_delete_confirm_text,
4737
4741
  frontend_delete_many_selected_required: frontend_delete_many_selected_required,
4738
4742
  frontend_delete_many_confirm_text: frontend_delete_many_confirm_text,
@@ -16070,6 +16074,21 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
16070
16074
  type: getAmisStaticFieldType$1('url', readonly, field),
16071
16075
  static: readonly ? true : false
16072
16076
  };
16077
+ if(!readonly){
16078
+ // amis input-url控件不支持相对路径,这里支持下
16079
+ // 如果要使用amis原生input-url控件的默认的isUrl验证效果或自定义字段validations效果,配置字段的amis.validations属性即可,配置为null或空字符串则使用amis默认的isUrl效果
16080
+ let fieldAmisValidations = field.amis?.validations;
16081
+ if(typeof fieldAmisValidations === "undefined"){
16082
+ Object.assign(convertData, {
16083
+ "validations": {
16084
+ "matchRegexp": "^((http:\\/\\/|https:\\/\\/|ftp:\\/\\/|sftp:\\/\\/)+([^\\s\\/\\.]+(\\.[^\\s\\/\\.]+)+))*(\\/[^\\s\\.\\/]+)*$"
16085
+ },
16086
+ "validationErrors": {
16087
+ "matchRegexp": instance.t('frontend_form_validation_failed_url')//"URL 格式不正确"
16088
+ }
16089
+ });
16090
+ }
16091
+ }
16073
16092
  if(readonly && field.show_as_qr){
16074
16093
  convertData = {
16075
16094
  type: "control",
@@ -22217,7 +22236,7 @@ var AmisProvider = function (props) { return __awaiter(void 0, void 0, void 0, f
22217
22236
  * @Author: baozhoutao@steedos.com
22218
22237
  * @Date: 2022-09-01 14:44:57
22219
22238
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
22220
- * @LastEditTime: 2024-05-14 13:30:24
22239
+ * @LastEditTime: 2024-05-14 15:12:49
22221
22240
  * @Description:
22222
22241
  */
22223
22242
  var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0, function () {
@@ -22231,7 +22250,7 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
22231
22250
  isMobile = formFactor === "SMALL" ? true : false;
22232
22251
  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 ";
22233
22252
  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 ";
22234
- 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 ";
22253
+ 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 ";
22235
22254
  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 ");
22236
22255
  mobileInitApiAdaptorScript = "\n let app_items = payload;\n ".concat(convertAppVisibleOnScript, "\n payload = {\n app_items\n }\n return payload;\n ");
22237
22256
  dialogSchema = {};