@steedos-widgets/amis-object 1.1.8 → 1.1.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/amis/AmisAppMenu.d.ts +8 -7
- package/dist/amis-object.cjs.css +2 -2
- package/dist/amis-object.cjs.js +48 -24
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +2 -2
- package/dist/amis-object.esm.js +48 -24
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +2 -2
- package/dist/amis-object.umd.js +48 -24
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +11 -11
- package/package.json +3 -3
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import './AmisAppMenu.less';
|
|
2
2
|
export declare const AmisAppMenu: (props: any) => Promise<{
|
|
3
3
|
type: string;
|
|
4
|
-
|
|
5
|
-
stacked: any;
|
|
6
|
-
overflow: any;
|
|
7
|
-
indentSize: any;
|
|
8
|
-
links: any;
|
|
9
|
-
source: {
|
|
4
|
+
schemaApi: {
|
|
10
5
|
method: string;
|
|
11
6
|
url: string;
|
|
12
7
|
adaptor: string;
|
|
13
8
|
headers: {
|
|
14
9
|
Authorization: string;
|
|
15
10
|
};
|
|
16
|
-
sendOn: string;
|
|
17
11
|
};
|
|
12
|
+
} | {
|
|
13
|
+
type: string;
|
|
14
|
+
className: string;
|
|
15
|
+
stacked: any;
|
|
16
|
+
overflow: any;
|
|
17
|
+
indentSize: any;
|
|
18
|
+
links: any;
|
|
18
19
|
}>;
|
package/dist/amis-object.cjs.css
CHANGED
package/dist/amis-object.cjs.js
CHANGED
|
@@ -767,7 +767,7 @@ const Router$1 = {
|
|
|
767
767
|
* @Author: baozhoutao@steedos.com
|
|
768
768
|
* @Date: 2022-05-23 09:53:08
|
|
769
769
|
* @LastEditors: baozhoutao@steedos.com
|
|
770
|
-
* @LastEditTime: 2023-
|
|
770
|
+
* @LastEditTime: 2023-04-10 11:22:54
|
|
771
771
|
* @Description:
|
|
772
772
|
*/
|
|
773
773
|
|
|
@@ -962,6 +962,7 @@ async function getFieldTpl (field, options){
|
|
|
962
962
|
case 'number':
|
|
963
963
|
case 'currency':
|
|
964
964
|
return await getNumberTpl(field);
|
|
965
|
+
case 'percent':
|
|
965
966
|
case 'formula':
|
|
966
967
|
case 'summary':
|
|
967
968
|
return getUiFieldTpl(field)
|
|
@@ -994,7 +995,7 @@ async function getFieldsTemplate(fields, expand){
|
|
|
994
995
|
if(___default.includes(['time','date','datetime','boolean','number','currency'], field.type)){
|
|
995
996
|
fieldsName.push(`${field.name}`);
|
|
996
997
|
}
|
|
997
|
-
if(___default.includes(['time','filesize','date','datetime','boolean','number','currency', 'select', 'file', 'image', 'avatar', 'formula', 'summary', 'object', 'grid'], field.type)){
|
|
998
|
+
if(___default.includes(['percent','time','filesize','date','datetime','boolean','number','currency', 'select', 'file', 'image', 'avatar', 'formula', 'summary', 'object', 'grid'], field.type)){
|
|
998
999
|
displayFields.push(`${field.name}`);
|
|
999
1000
|
}
|
|
1000
1001
|
}
|
|
@@ -12249,7 +12250,7 @@ var AmisRecordDetailHeader = function (props) { return __awaiter(void 0, void 0,
|
|
|
12249
12250
|
return __generator(this, function (_d) {
|
|
12250
12251
|
switch (_d.label) {
|
|
12251
12252
|
case 0:
|
|
12252
|
-
_a = props.className, className = _a === void 0 ? 'sticky top-0 z-
|
|
12253
|
+
_a = props.className, className = _a === void 0 ? 'sticky top-0 z-10 bg-gray-100 border-b sm:shadow sm:rounded sm:border border-slate-300 p-4' : _a;
|
|
12253
12254
|
return [4 /*yield*/, getUISchema(props.objectApiName || "space_users", false)];
|
|
12254
12255
|
case 1:
|
|
12255
12256
|
objectUiSchema = _d.sent();
|
|
@@ -12557,8 +12558,6 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
12557
12558
|
"items": {
|
|
12558
12559
|
"type": "button",
|
|
12559
12560
|
"level": "link",
|
|
12560
|
-
"actionType": "link",
|
|
12561
|
-
"link": "${path}",
|
|
12562
12561
|
"body": [{
|
|
12563
12562
|
"type": "tpl",
|
|
12564
12563
|
"tpl": "<div class='slds-app-launcher__tile slds-text-link_reset'><div class='slds-app-launcher__tile-figure'><svg class='w-12 h-12 slds-icon slds-icon_container slds-icon-standard-${REPLACE(icon, '_', '-')}' aria-hidden='true'><use xlink:href='/assets/icons/standard-sprite/svg/symbols.svg#${icon}'></use></svg><span class='slds-assistive-text'>${name}</span></div><div class='slds-app-launcher__tile-body'><span class='slds-link text-blue-600 text-lg'><span title='${name}'>${name}</span></span><div style='display: -webkit-box; -webkit-line-clamp: 1;-webkit-box-orient: vertical;overflow: hidden;'><span title='${description}'>${description}</span></div></div></div>",
|
|
@@ -12585,6 +12584,21 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
12585
12584
|
"actions": [
|
|
12586
12585
|
{
|
|
12587
12586
|
"actionType": "closeDialog"
|
|
12587
|
+
},
|
|
12588
|
+
{
|
|
12589
|
+
"actionType": "link",
|
|
12590
|
+
"args": {
|
|
12591
|
+
"link": "${path}"
|
|
12592
|
+
},
|
|
12593
|
+
"expression": "${!blank}"
|
|
12594
|
+
},
|
|
12595
|
+
{
|
|
12596
|
+
"actionType": "url",
|
|
12597
|
+
"args": {
|
|
12598
|
+
"url": "${path}",
|
|
12599
|
+
"blank": true
|
|
12600
|
+
},
|
|
12601
|
+
"expression": "${blank}"
|
|
12588
12602
|
}
|
|
12589
12603
|
]
|
|
12590
12604
|
}
|
|
@@ -12745,31 +12759,37 @@ var AmisLogo = function (props) { return __awaiter(void 0, void 0, void 0, funct
|
|
|
12745
12759
|
}); };
|
|
12746
12760
|
|
|
12747
12761
|
var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12748
|
-
var _a, stacked, overflow, appId, data, _b, links, _c, showIcon, _d, className, _e, indentSize, selectedId;
|
|
12762
|
+
var _a, stacked, overflow, appId, data, _b, links, _c, showIcon, _d, className, _e, indentSize, selectedId, schema;
|
|
12749
12763
|
return __generator(this, function (_f) {
|
|
12750
12764
|
_a = props.stacked, stacked = _a === void 0 ? false : _a, overflow = props.overflow, appId = props.appId, data = props.data, _b = props.links, links = _b === void 0 ? null : _b, _c = props.showIcon, showIcon = _c === void 0 ? true : _c, _d = props.className, className = _d === void 0 ? '' : _d, _e = props.indentSize, indentSize = _e === void 0 ? 12 : _e, selectedId = props.selectedId;
|
|
12751
12765
|
if (!appId) {
|
|
12752
12766
|
appId = data.context.appId || 'admin';
|
|
12753
12767
|
}
|
|
12754
12768
|
// console.log(`AmisAppMenu appId`, appId)
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
},
|
|
12772
|
-
|
|
12769
|
+
console.log("AmisAppMenu", appId, props);
|
|
12770
|
+
if (links) {
|
|
12771
|
+
return [2 /*return*/, {
|
|
12772
|
+
"type": "nav",
|
|
12773
|
+
className: "".concat(className),
|
|
12774
|
+
"stacked": stacked,
|
|
12775
|
+
"overflow": overflow,
|
|
12776
|
+
"indentSize": indentSize,
|
|
12777
|
+
"links": links
|
|
12778
|
+
}];
|
|
12779
|
+
}
|
|
12780
|
+
schema = {
|
|
12781
|
+
type: 'service',
|
|
12782
|
+
schemaApi: {
|
|
12783
|
+
"method": "get",
|
|
12784
|
+
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus?try=1111111"),
|
|
12785
|
+
"adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": true,\n \"children\": _.map(tabs, (tab) => {\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n });\n })\n }\n payload.data = {\n \"type\": \"nav\",\n className: \"").concat(className, "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"links\": data.nav,\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
|
|
12786
|
+
"headers": {
|
|
12787
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
12788
|
+
}
|
|
12789
|
+
}
|
|
12790
|
+
};
|
|
12791
|
+
console.log("schema=====>", schema);
|
|
12792
|
+
return [2 /*return*/, schema];
|
|
12773
12793
|
});
|
|
12774
12794
|
}); };
|
|
12775
12795
|
|
|
@@ -13021,6 +13041,10 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
13021
13041
|
"color": "#FFFFFF"
|
|
13022
13042
|
},
|
|
13023
13043
|
size: 30
|
|
13044
|
+
},
|
|
13045
|
+
{
|
|
13046
|
+
"type": "tpl",
|
|
13047
|
+
"tpl": "<span class=\"hidden-xs user-name text-overflow\" style=\"height: 30px;line-height: 30px;font-size: 16px;font-weight: bold;margin-left: 10px;\">${global.user.name}<i class=\"fa fa-angle-down\" style=\"margin-left: 4px;\"></i></span>"
|
|
13024
13048
|
}
|
|
13025
13049
|
],
|
|
13026
13050
|
"overlay": [
|