@steedos-widgets/sortable 6.3.11-beta.9 → 6.3.12-beta.1

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.
@@ -53982,7 +53982,7 @@ const Router = {
53982
53982
  * @Author: baozhoutao@steedos.com
53983
53983
  * @Date: 2022-07-20 16:29:22
53984
53984
  * @LastEditors: baozhoutao@steedos.com
53985
- * @LastEditTime: 2024-10-14 13:33:27
53985
+ * @LastEditTime: 2024-11-17 13:05:44
53986
53986
  * @Description:
53987
53987
  */
53988
53988
 
@@ -54007,13 +54007,29 @@ if(typeof window != 'undefined'){
54007
54007
  window.getImageFieldUrl = getImageFieldUrl;
54008
54008
  }
54009
54009
 
54010
+
54011
+
54012
+ // js color
54013
+
54014
+ function toGrayscale(r, g, b){
54015
+ return (
54016
+ 0.2126 * r +
54017
+ 0.7152 * g +
54018
+ 0.0722 * b
54019
+ );
54020
+ }
54021
+
54022
+ function isLight(r, g, b){
54023
+ // 专业的亮度是 > 255 / 2. 此处的阈值调整为200
54024
+ return toGrayscale(r, g, b) > 200
54025
+ }
54026
+
54010
54027
  function getContrastColor(bgColor) {
54011
54028
  var backgroundColor = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor;
54012
54029
  var r = parseInt(backgroundColor.substr(0, 2), 16);
54013
54030
  var g = parseInt(backgroundColor.substr(2, 2), 16);
54014
54031
  var b = parseInt(backgroundColor.substr(4, 2), 16);
54015
- var brightness = (r * 299 + g * 587 + b * 114) / 1000;
54016
- return brightness < 128 ? "#ffffff" : "#000000";
54032
+ return isLight(r, g, b) ? "#000000" : "#ffffff";
54017
54033
  }
54018
54034
 
54019
54035
  function getLookupListView(refObjectConfig) {
@@ -54122,7 +54138,7 @@ function getSelectMap(selectOptions){
54122
54138
  if(optionColor && optionColor != "undefined"){
54123
54139
  const background = optionColor.charAt(0) === '#' ? optionColor : '#'+optionColor;
54124
54140
  const color = getContrastColor(background);
54125
- const optionColorStyle = 'background:'+background+';color:'+color+';line-height:1.5rem';
54141
+ const optionColorStyle = 'background:'+background+';color:'+color+';line-height:1.5rem;font-size:14px';
54126
54142
  map[optionValue] = `<span class="rounded-xl px-2 py-1" style='${optionColorStyle}'>${option.label}</span>`;
54127
54143
  }else {
54128
54144
  map[optionValue] = option.label;
@@ -54536,7 +54552,7 @@ async function getPage({type, pageId = '', appId, objectName = '', recordId = ''
54536
54552
  * @Author: baozhoutao@steedos.com
54537
54553
  * @Date: 2022-10-28 14:15:09
54538
54554
  * @LastEditors: baozhoutao@steedos.com
54539
- * @LastEditTime: 2024-10-14 14:01:15
54555
+ * @LastEditTime: 2024-11-14 10:50:01
54540
54556
  * @Description:
54541
54557
  */
54542
54558
 
@@ -54595,6 +54611,7 @@ async function getLookupLinkOnClick(field, options) {
54595
54611
  "title": "&nbsp;",
54596
54612
  "headerClassName": "hidden",
54597
54613
  "size": "lg",
54614
+ "width": "70%",
54598
54615
  "bodyClassName": "p-0 m-0 bg-gray-100",
54599
54616
  "closeOnEsc": true,
54600
54617
  "closeOnOutside": true,
@@ -55687,6 +55704,7 @@ async function getColumnItemOnClick(field, options){
55687
55704
  "title": "&nbsp;",
55688
55705
  "headerClassName": "hidden",
55689
55706
  "size": "lg",
55707
+ "width": "70%",
55690
55708
  "bodyClassName": "p-0 m-0 bg-gray-100",
55691
55709
  "closeOnEsc": true,
55692
55710
  "closeOnOutside": true,
@@ -60970,6 +60988,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
60970
60988
  type: "static-mapping",
60971
60989
  name: field.name,
60972
60990
  label: field.label,
60991
+ options: field.options,
60973
60992
  map: map
60974
60993
  };
60975
60994
  }else {