@steedos-widgets/sortable 3.6.13 → 6.3.0-beta.10
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 +5 -5
- package/dist/sortable.cjs.js +81 -46
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +81 -46
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +81 -46
- package/package.json +3 -3
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@3.
|
|
7
|
-
"https://unpkg.com/@steedos-widgets/sortable@3.
|
|
6
|
+
"https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.10/dist/sortable.umd.js",
|
|
7
|
+
"https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.10/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@3.
|
|
18
|
+
"url": "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.10/dist/meta.js",
|
|
19
19
|
"urls": {
|
|
20
|
-
"default": "https://unpkg.com/@steedos-widgets/sortable@3.
|
|
21
|
-
"design": "https://unpkg.com/@steedos-widgets/sortable@3.
|
|
20
|
+
"default": "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.10/dist/meta.js",
|
|
21
|
+
"design": "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.10/dist/meta.js"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
]
|
package/dist/sortable.cjs.js
CHANGED
|
@@ -54145,10 +54145,23 @@ function getNameTpl(field, ctx){
|
|
|
54145
54145
|
if(ctx && ctx.isLookup){
|
|
54146
54146
|
linkTarget = "target='_blank'";
|
|
54147
54147
|
}
|
|
54148
|
+
let nameLabel = field.name;
|
|
54149
|
+
//若字段类型是lookup,则按照相关表tpl的label规则显示;若是其它类型,则显示_display或字段本身的值
|
|
54150
|
+
if (field.type == "lookup") {
|
|
54151
|
+
if(!field.reference_to && (field.optionsFunction || field._optionsFunction || field.options)){
|
|
54152
|
+
if(!field.isTableField){
|
|
54153
|
+
nameLabel = `\${${field.name}__label}`;
|
|
54154
|
+
}
|
|
54155
|
+
} else {
|
|
54156
|
+
nameLabel = `\${_display.${field.name}.label}`;
|
|
54157
|
+
}
|
|
54158
|
+
} else {
|
|
54159
|
+
nameLabel = `\${_display.${field.name} || ${field.name}}`;
|
|
54160
|
+
}
|
|
54148
54161
|
if(ctx.isRelated && window.innerWidth >= 768){
|
|
54149
|
-
return `<a href="${href}" ${linkTarget} onclick="return false;">\${${
|
|
54162
|
+
return `<a href="${href}" ${linkTarget} onclick="return false;">\${${nameLabel} | raw}</a>`
|
|
54150
54163
|
}else {
|
|
54151
|
-
return `<a href="${href}" ${linkTarget}>\${${
|
|
54164
|
+
return `<a href="${href}" ${linkTarget}>\${${nameLabel} | raw}</a>`
|
|
54152
54165
|
}
|
|
54153
54166
|
}
|
|
54154
54167
|
|
|
@@ -54273,7 +54286,7 @@ function getLocationTpl(field){
|
|
|
54273
54286
|
}
|
|
54274
54287
|
|
|
54275
54288
|
async function getFieldTpl (field, options){
|
|
54276
|
-
if((field.is_name || field.name === options.labelFieldName) && !options.onlyDisplayLookLabel){
|
|
54289
|
+
if((field.is_name || field.name === options.labelFieldName) && !options.onlyDisplayLookLabel && field.multiple !== true){
|
|
54277
54290
|
return getNameTpl(field, options)
|
|
54278
54291
|
}
|
|
54279
54292
|
switch (field.type) {
|
|
@@ -54415,7 +54428,7 @@ async function getFindQuery(object, recordId, fields, options){
|
|
|
54415
54428
|
function getApi$2 (isMobile){
|
|
54416
54429
|
if(isMobile);else {
|
|
54417
54430
|
// return __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + "/graphql"
|
|
54418
|
-
return `\${context.rootUrl}/graphql?reload=\${additionalFilters}`
|
|
54431
|
+
return `\${context.rootUrl}/graphql?reload=\${additionalFilters|join}`
|
|
54419
54432
|
}
|
|
54420
54433
|
}
|
|
54421
54434
|
|
|
@@ -55662,7 +55675,7 @@ async function getTableColumns(object, fields, options){
|
|
|
55662
55675
|
"title": " ",
|
|
55663
55676
|
"headerClassName": "hidden",
|
|
55664
55677
|
"size": "lg",
|
|
55665
|
-
"bodyClassName": "p-0 m-0",
|
|
55678
|
+
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
55666
55679
|
"closeOnEsc": true,
|
|
55667
55680
|
"closeOnOutside": true,
|
|
55668
55681
|
"resizable": true,
|
|
@@ -56524,7 +56537,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
56524
56537
|
type: 'button',
|
|
56525
56538
|
actionType: 'confirm',
|
|
56526
56539
|
label: instance.t('frontend_form_save'),
|
|
56527
|
-
primary: true
|
|
56540
|
+
primary: true,
|
|
56541
|
+
close: `object_actions_drawer_${uiSchema.name}`
|
|
56528
56542
|
},
|
|
56529
56543
|
]
|
|
56530
56544
|
}
|
|
@@ -58330,6 +58344,10 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
58330
58344
|
// const scope = event.context.scoped;
|
|
58331
58345
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
58332
58346
|
// 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
|
|
58347
|
+
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
58348
|
+
if(!filterForm){
|
|
58349
|
+
return;
|
|
58350
|
+
}
|
|
58333
58351
|
let isLookup = event.data.isLookup;
|
|
58334
58352
|
let __lookupField = event.data.__lookupField;
|
|
58335
58353
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
@@ -58340,9 +58358,8 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
58340
58358
|
}
|
|
58341
58359
|
__changedFilterFormValuesKey += lookupTag;
|
|
58342
58360
|
}
|
|
58343
|
-
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
58344
58361
|
setTimeout(function(){
|
|
58345
|
-
filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
58362
|
+
filterForm && filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
58346
58363
|
}, 500);
|
|
58347
58364
|
`;
|
|
58348
58365
|
|
|
@@ -58739,7 +58756,7 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58739
58756
|
* @Author: baozhoutao@steedos.com
|
|
58740
58757
|
* @Date: 2022-07-05 15:55:39
|
|
58741
58758
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
58742
|
-
* @LastEditTime: 2024-
|
|
58759
|
+
* @LastEditTime: 2024-04-26 16:46:44
|
|
58743
58760
|
* @Description:
|
|
58744
58761
|
*/
|
|
58745
58762
|
|
|
@@ -58972,37 +58989,44 @@ async function getListSchema(
|
|
|
58972
58989
|
* 本次存储代码段
|
|
58973
58990
|
*/
|
|
58974
58991
|
try {
|
|
58975
|
-
|
|
58976
|
-
|
|
58977
|
-
|
|
58978
|
-
|
|
58979
|
-
|
|
58980
|
-
|
|
58981
|
-
|
|
58982
|
-
|
|
58983
|
-
|
|
58984
|
-
|
|
58985
|
-
|
|
58986
|
-
|
|
58987
|
-
|
|
58988
|
-
|
|
58989
|
-
|
|
58990
|
-
|
|
58991
|
-
|
|
58992
|
-
|
|
58993
|
-
|
|
58994
|
-
|
|
58995
|
-
|
|
58996
|
-
|
|
58992
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
58993
|
+
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
58994
|
+
/**
|
|
58995
|
+
* localListViewProps规范来自crud请求api中api.data.$self参数值的。
|
|
58996
|
+
* 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
|
|
58997
|
+
* __searchable__...:顶部放大镜搜索条件
|
|
58998
|
+
* filter:右侧过滤器
|
|
58999
|
+
* perPage:每页条数
|
|
59000
|
+
* page:当前页码
|
|
59001
|
+
* orderBy:排序字段
|
|
59002
|
+
* orderDir:排序方向
|
|
59003
|
+
*/
|
|
59004
|
+
if (localListViewProps) {
|
|
59005
|
+
localListViewProps = JSON.parse(localListViewProps);
|
|
59006
|
+
// localListViewProps.perPage = 3;
|
|
59007
|
+
let listSchema = {};
|
|
59008
|
+
if (localListViewProps.orderBy) {
|
|
59009
|
+
listSchema.orderBy = localListViewProps.orderBy;
|
|
59010
|
+
}
|
|
59011
|
+
if (localListViewProps.orderDir) {
|
|
59012
|
+
listSchema.orderDir = localListViewProps.orderDir;
|
|
59013
|
+
}
|
|
58997
59014
|
|
|
58998
|
-
|
|
58999
|
-
|
|
59015
|
+
if (localListViewProps.perPage) {
|
|
59016
|
+
listSchema.perPage = localListViewProps.perPage;
|
|
59017
|
+
}
|
|
59018
|
+
defaults.listSchema = lodash.exports.defaultsDeep({}, listSchema, defaults.listSchema || {});
|
|
59000
59019
|
}
|
|
59001
|
-
defaults.listSchema = lodash.exports.defaultsDeep({}, listSchema, defaults.listSchema || {});
|
|
59002
|
-
}
|
|
59003
59020
|
}
|
|
59004
59021
|
catch (ex) {
|
|
59005
|
-
|
|
59022
|
+
console.error("本地存储中crud参数解析异常:", ex);
|
|
59023
|
+
}
|
|
59024
|
+
|
|
59025
|
+
if (window.innerWidth > 768) {
|
|
59026
|
+
// 列表视图组件PC端高度自动计算实现满屏效果,手机端不需要满屏效果,所以不用autofillheight,且允许重写微页面中重新组件autoFillHeight属性
|
|
59027
|
+
defaults.listSchema = lodash.exports.defaultsDeep({}, defaults.listSchema || {}, {
|
|
59028
|
+
autoFillHeight: true
|
|
59029
|
+
});
|
|
59006
59030
|
}
|
|
59007
59031
|
|
|
59008
59032
|
ctx.defaults = defaults;
|
|
@@ -59563,7 +59587,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59563
59587
|
});
|
|
59564
59588
|
|
|
59565
59589
|
// 把自动填充规则中依赖的字段也加到api请求中
|
|
59566
|
-
let autoFillMapping =
|
|
59590
|
+
let autoFillMapping = field.auto_fill_mapping;
|
|
59567
59591
|
if (autoFillMapping && autoFillMapping.length) {
|
|
59568
59592
|
autoFillMapping.forEach(function (item) {
|
|
59569
59593
|
if(!lodash.exports.find(tableFields, function(f){
|
|
@@ -59713,7 +59737,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59713
59737
|
// 如果当前元素不是数组,则处理该元素
|
|
59714
59738
|
// 下面正则用于匹配amis公式\${}
|
|
59715
59739
|
if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
|
|
59716
|
-
arr[i] = currentAmis.evaluate(arr[i], api.data.$);
|
|
59740
|
+
arr[i] = currentAmis.evaluate(arr[i], api.data.$self);
|
|
59717
59741
|
}
|
|
59718
59742
|
}
|
|
59719
59743
|
}
|
|
@@ -60035,7 +60059,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
60035
60059
|
];
|
|
60036
60060
|
|
|
60037
60061
|
// 把自动填充规则中依赖的字段也加到api请求中
|
|
60038
|
-
let autoFillMapping =
|
|
60062
|
+
let autoFillMapping = field.auto_fill_mapping;
|
|
60039
60063
|
if (autoFillMapping && autoFillMapping.length) {
|
|
60040
60064
|
autoFillMapping.forEach(function (item) {
|
|
60041
60065
|
queryFields.push(refObjectConfig.fields[item.from]);
|
|
@@ -60130,7 +60154,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
60130
60154
|
// 如果当前元素不是数组,则处理该元素
|
|
60131
60155
|
// 下面正则用于匹配amis公式\${}
|
|
60132
60156
|
if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
|
|
60133
|
-
arr[i] = currentAmis.evaluate(arr[i], api.data.$);
|
|
60157
|
+
arr[i] = currentAmis.evaluate(arr[i], api.data.$self);
|
|
60134
60158
|
}
|
|
60135
60159
|
}
|
|
60136
60160
|
}
|
|
@@ -60277,14 +60301,25 @@ async function getApi(object, recordId, fields, options){
|
|
|
60277
60301
|
}
|
|
60278
60302
|
|
|
60279
60303
|
async function getAutoFill(field, refObject) {
|
|
60280
|
-
let autoFillMapping =
|
|
60304
|
+
let autoFillMapping = field.auto_fill_mapping;
|
|
60281
60305
|
if (autoFillMapping && autoFillMapping.length) {
|
|
60282
60306
|
let fillMapping = {};
|
|
60307
|
+
if (field.multiple) {
|
|
60308
|
+
autoFillMapping.forEach(function (item) {
|
|
60309
|
+
//from的字段类型为lookup、master_detail、select时,需要保留数组格式;其他类型需要转变为字符串格式
|
|
60310
|
+
if (lodash.exports.includes(["lookup","master_detail","select"], refObject.fields[item.from].type)) {
|
|
60311
|
+
fillMapping[item.to] = `\${items | pick:${item.from}}`;
|
|
60312
|
+
} else {
|
|
60313
|
+
fillMapping[item.to] = `\${items | pick:${item.from} | join}`;
|
|
60314
|
+
}
|
|
60315
|
+
});
|
|
60316
|
+
}else {
|
|
60317
|
+
autoFillMapping.forEach(function (item) {
|
|
60318
|
+
fillMapping[item.to] = `\${${item.from}}`;
|
|
60319
|
+
});
|
|
60320
|
+
}
|
|
60283
60321
|
// let fieldsForApi = [];
|
|
60284
|
-
|
|
60285
|
-
fillMapping[item.to] = `\${${item.from}}`;
|
|
60286
|
-
// fieldsForApi.push(item.from);
|
|
60287
|
-
});
|
|
60322
|
+
// fieldsForApi.push(item.from);
|
|
60288
60323
|
// let api = {
|
|
60289
60324
|
// // "url": "/amis/api/mock2/form/autoUpdate?browser=${browser}&version=${version}",
|
|
60290
60325
|
// "url": `/api/v1/${refObject.name}/\${${field.name}}?fields=${JSON.stringify(fieldsForApi)}`,
|
|
@@ -60386,7 +60421,7 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
60386
60421
|
amisSchema = lodash.exports.defaultsDeep({}, pageAmisSchema, amisSchema);
|
|
60387
60422
|
}
|
|
60388
60423
|
}
|
|
60389
|
-
const autoFill = await getAutoFill(field);
|
|
60424
|
+
const autoFill = await getAutoFill(field, refObject);
|
|
60390
60425
|
if(autoFill){
|
|
60391
60426
|
amisSchema.autoFill = autoFill;
|
|
60392
60427
|
// 这里不配置initAutoFill值,按amis规则initAutoFill默认值为fillIfNotSet处理--需要amis sdk 版本 > 3.6.3-patch.6(不包括)版本
|