@steedos-widgets/sortable 6.3.10 → 6.3.11-beta.11

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/dist/assets.json CHANGED
@@ -3,8 +3,8 @@
3
3
  {
4
4
  "package": "@steedos-widgets/sortable",
5
5
  "urls": [
6
- "https://unpkg.com/@steedos-widgets/sortable@6.3.10/dist/sortable.umd.js",
7
- "https://unpkg.com/@steedos-widgets/sortable@6.3.10/dist/sortable.umd.css"
6
+ "https://unpkg.com/@steedos-widgets/sortable@6.3.11-beta.11/dist/sortable.umd.js",
7
+ "https://unpkg.com/@steedos-widgets/sortable@6.3.11-beta.11/dist/sortable.umd.css"
8
8
  ],
9
9
  "library": "BuilderSortable"
10
10
  }
@@ -15,10 +15,10 @@
15
15
  "npm": {
16
16
  "package": "@steedos-widgets/sortable"
17
17
  },
18
- "url": "https://unpkg.com/@steedos-widgets/sortable@6.3.10/dist/meta.js",
18
+ "url": "https://unpkg.com/@steedos-widgets/sortable@6.3.11-beta.11/dist/meta.js",
19
19
  "urls": {
20
- "default": "https://unpkg.com/@steedos-widgets/sortable@6.3.10/dist/meta.js",
21
- "design": "https://unpkg.com/@steedos-widgets/sortable@6.3.10/dist/meta.js"
20
+ "default": "https://unpkg.com/@steedos-widgets/sortable@6.3.11-beta.11/dist/meta.js",
21
+ "design": "https://unpkg.com/@steedos-widgets/sortable@6.3.11-beta.11/dist/meta.js"
22
22
  }
23
23
  }
24
24
  ]
@@ -53985,18 +53985,24 @@ const Router = {
53985
53985
  /*
53986
53986
  * @Author: baozhoutao@steedos.com
53987
53987
  * @Date: 2022-07-20 16:29:22
53988
- * @LastEditors: liaodaxue
53989
- * @LastEditTime: 2024-01-25 14:44:17
53988
+ * @LastEditors: baozhoutao@steedos.com
53989
+ * @LastEditTime: 2024-11-17 13:05:44
53990
53990
  * @Description:
53991
53991
  */
53992
53992
 
53993
- function getImageFieldUrl(url) {
53994
- if (window.Meteor && window.Meteor.isCordova != true) {
53995
- // '//'的位置
53996
- const doubleSlashIndex = url.indexOf('//');
53997
- const urlIndex = url.indexOf('/', doubleSlashIndex + 2);
53998
- const rootUrl = url.substring(urlIndex);
53999
- return rootUrl;
53993
+ function getImageFieldUrl(url, readonly) {
53994
+ if (window.Meteor) {
53995
+ if(window.Meteor.isCordova != true){
53996
+ // '//'的位置
53997
+ const doubleSlashIndex = url.indexOf('//');
53998
+ const urlIndex = url.indexOf('/', doubleSlashIndex + 2);
53999
+ const rootUrl = url.substring(urlIndex);
54000
+ return rootUrl;
54001
+ }else {
54002
+ if(readonly || url.startsWith('http')){
54003
+ return `${url}?token=${window.btoa(JSON.stringify({ authToken : Builder.settings.context.authToken }))}`
54004
+ }
54005
+ }
54000
54006
  }
54001
54007
  return url;
54002
54008
  }
@@ -54005,13 +54011,29 @@ if(typeof window != 'undefined'){
54005
54011
  window.getImageFieldUrl = getImageFieldUrl;
54006
54012
  }
54007
54013
 
54014
+
54015
+
54016
+ // js color
54017
+
54018
+ function toGrayscale(r, g, b){
54019
+ return (
54020
+ 0.2126 * r +
54021
+ 0.7152 * g +
54022
+ 0.0722 * b
54023
+ );
54024
+ }
54025
+
54026
+ function isLight(r, g, b){
54027
+ // 专业的亮度是 > 255 / 2. 此处的阈值调整为200
54028
+ return toGrayscale(r, g, b) > 200
54029
+ }
54030
+
54008
54031
  function getContrastColor(bgColor) {
54009
54032
  var backgroundColor = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor;
54010
54033
  var r = parseInt(backgroundColor.substr(0, 2), 16);
54011
54034
  var g = parseInt(backgroundColor.substr(2, 2), 16);
54012
54035
  var b = parseInt(backgroundColor.substr(4, 2), 16);
54013
- var brightness = (r * 299 + g * 587 + b * 114) / 1000;
54014
- return brightness < 128 ? "#ffffff" : "#000000";
54036
+ return isLight(r, g, b) ? "#000000" : "#ffffff";
54015
54037
  }
54016
54038
 
54017
54039
  function getLookupListView(refObjectConfig) {
@@ -54120,7 +54142,7 @@ function getSelectMap(selectOptions){
54120
54142
  if(optionColor && optionColor != "undefined"){
54121
54143
  const background = optionColor.charAt(0) === '#' ? optionColor : '#'+optionColor;
54122
54144
  const color = getContrastColor(background);
54123
- const optionColorStyle = 'background:'+background+';color:'+color+';line-height:1.5rem';
54145
+ const optionColorStyle = 'background:'+background+';color:'+color+';line-height:1.5rem;font-size:14px';
54124
54146
  map[optionValue] = `<span class="rounded-xl px-2 py-1" style='${optionColorStyle}'>${option.label}</span>`;
54125
54147
  }else {
54126
54148
  map[optionValue] = option.label;
@@ -54534,7 +54556,7 @@ async function getPage({type, pageId = '', appId, objectName = '', recordId = ''
54534
54556
  * @Author: baozhoutao@steedos.com
54535
54557
  * @Date: 2022-10-28 14:15:09
54536
54558
  * @LastEditors: baozhoutao@steedos.com
54537
- * @LastEditTime: 2024-08-19 16:26:58
54559
+ * @LastEditTime: 2024-11-14 10:50:01
54538
54560
  * @Description:
54539
54561
  */
54540
54562
 
@@ -54593,6 +54615,7 @@ async function getLookupLinkOnClick(field, options) {
54593
54615
  "title": "&nbsp;",
54594
54616
  "headerClassName": "hidden",
54595
54617
  "size": "lg",
54618
+ "width": "70%",
54596
54619
  "bodyClassName": "p-0 m-0 bg-gray-100",
54597
54620
  "closeOnEsc": true,
54598
54621
  "closeOnOutside": true,
@@ -54632,13 +54655,13 @@ const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
54632
54655
  if(type === 'file'){
54633
54656
  return window.Meteor?.isCordova ? {
54634
54657
  "type": "control",
54635
- "body": {
54658
+ "body": steedosField.multiple ? {
54636
54659
  "type": "each",
54637
54660
  "name": "_display." + steedosField.name,
54638
54661
  "items": {
54639
54662
  "type": "tpl",
54640
54663
  "tpl": "${name}",
54641
- "className": "antd-Button--link inline-block",
54664
+ "className": "antd-Button--link inline-block mr-2",
54642
54665
  "onEvent": {
54643
54666
  "click": {
54644
54667
  "actions": [
@@ -54653,6 +54676,24 @@ const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
54653
54676
  }
54654
54677
  }
54655
54678
  }
54679
+ } : {
54680
+ "type": "tpl",
54681
+ "tpl": "${_display." + steedosField.name + ".name}",
54682
+ "className": "antd-Button--link inline-block",
54683
+ "onEvent": {
54684
+ "click": {
54685
+ "actions": [
54686
+ {
54687
+ "script": `
54688
+ const data = event.data._display.${steedosField.name};
54689
+ Steedos.cordovaDownload(encodeURI(data.url), data.name);
54690
+ `,
54691
+ "actionType": "custom"
54692
+ }
54693
+ ],
54694
+ "weight": 0
54695
+ }
54696
+ }
54656
54697
  }
54657
54698
  } : {
54658
54699
  // type: amisFieldType,
@@ -55667,6 +55708,7 @@ async function getColumnItemOnClick(field, options){
55667
55708
  "title": "&nbsp;",
55668
55709
  "headerClassName": "hidden",
55669
55710
  "size": "lg",
55711
+ "width": "70%",
55670
55712
  "bodyClassName": "p-0 m-0 bg-gray-100",
55671
55713
  "closeOnEsc": true,
55672
55714
  "closeOnOutside": true,
@@ -56320,7 +56362,7 @@ async function getTableSchema$1(object, fields, options){
56320
56362
  /*
56321
56363
  img/avatar字段值添加URL前缀使其在amis中正常显示图片。
56322
56364
  */
56323
- function getScriptForAddUrlPrefixForImgFields(fields){
56365
+ function getScriptForAddUrlPrefixForImgFields(fields, readonly){
56324
56366
  let imgFieldsKeys = [];
56325
56367
  let imgFields = {};
56326
56368
  fields.forEach((item)=>{
@@ -56348,12 +56390,12 @@ function getScriptForAddUrlPrefixForImgFields(fields){
56348
56390
  if(fieldProps.multiple){
56349
56391
  if(imgFieldDisplayValue instanceof Array){
56350
56392
  data[item] = imgFieldDisplayValue.map((i)=>{
56351
- const url = window.getImageFieldUrl(i.url);
56393
+ const url = window.getImageFieldUrl(i.url, ${readonly});
56352
56394
  return url;
56353
56395
  });
56354
56396
  }
56355
56397
  }else{
56356
- const url = imgFieldDisplayValue && window.getImageFieldUrl(imgFieldDisplayValue.url);
56398
+ const url = imgFieldDisplayValue && window.getImageFieldUrl(imgFieldDisplayValue.url, ${readonly});
56357
56399
  data[item] = url;
56358
56400
  }
56359
56401
  }
@@ -61073,7 +61115,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
61073
61115
  // }
61074
61116
  // 日期时间字段,按日期方式展现显示控件,用户不用关心小时分钟
61075
61117
  convertData = {
61076
- type: "input-date-range",
61118
+ type: "input-datetime-range",
61077
61119
  inputFormat: "YYYY-MM-DD HH:mm",
61078
61120
  format:'YYYY-MM-DDTHH:mm:ss.SSSZ',
61079
61121
  tpl: readonly ? getDateTimeTpl(field) : null,