@steedos-widgets/amis-object 3.6.6 → 3.6.7-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.
- package/dist/amis/AmisInputTable.d.ts +2 -0
- package/dist/amis-object.cjs.js +23 -8
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.js +23 -8
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.js +13 -13
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/package.json +3 -3
|
@@ -18,6 +18,7 @@ export declare const AmisInputTable: (props: any) => Promise<{
|
|
|
18
18
|
className: any;
|
|
19
19
|
pipeIn: (value: any, data: any) => any;
|
|
20
20
|
pipeOut: (value: any, data: any) => any;
|
|
21
|
+
required: any;
|
|
21
22
|
}[];
|
|
22
23
|
id: string;
|
|
23
24
|
className: string;
|
|
@@ -31,5 +32,6 @@ export declare const AmisInputTable: (props: any) => Promise<{
|
|
|
31
32
|
visible: any;
|
|
32
33
|
hiddenOn: any;
|
|
33
34
|
hidden: any;
|
|
35
|
+
required: any;
|
|
34
36
|
className: string;
|
|
35
37
|
}>;
|
package/dist/amis-object.cjs.js
CHANGED
|
@@ -3870,7 +3870,7 @@ function getSwitchTpl(field){
|
|
|
3870
3870
|
|
|
3871
3871
|
function getPasswordTpl(field){
|
|
3872
3872
|
return `<% if (data.${field.name}) { %>
|
|
3873
|
-
<span
|
|
3873
|
+
<span>******</span>
|
|
3874
3874
|
<% } %>`
|
|
3875
3875
|
}
|
|
3876
3876
|
|
|
@@ -14497,6 +14497,11 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
14497
14497
|
|
|
14498
14498
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
14499
14499
|
if(fieldFilters && fieldFilters.length){
|
|
14500
|
+
var filtersForString = JSON.stringify(fieldFilters);
|
|
14501
|
+
if(filtersForString.indexOf('$') > -1) {
|
|
14502
|
+
var currentAmis = amisRequire('amis');
|
|
14503
|
+
fieldFilters = JSON.parse(currentAmis.evaluate(filtersForString, api.data.$self.__super))
|
|
14504
|
+
}
|
|
14500
14505
|
filters.push(fieldFilters);
|
|
14501
14506
|
}
|
|
14502
14507
|
|
|
@@ -14897,6 +14902,11 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
14897
14902
|
|
|
14898
14903
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
14899
14904
|
if(fieldFilters && fieldFilters.length){
|
|
14905
|
+
var filtersForString = JSON.stringify(fieldFilters);
|
|
14906
|
+
if(filtersForString.indexOf('$') > -1) {
|
|
14907
|
+
var currentAmis = amisRequire('amis');
|
|
14908
|
+
fieldFilters = JSON.parse(currentAmis.evaluate(filtersForString, api.data.$))
|
|
14909
|
+
}
|
|
14900
14910
|
filters.push(fieldFilters);
|
|
14901
14911
|
}
|
|
14902
14912
|
|
|
@@ -18098,7 +18108,8 @@ const getAmisInputTableSchema = async (props) => {
|
|
|
18098
18108
|
}
|
|
18099
18109
|
}
|
|
18100
18110
|
return value;
|
|
18101
|
-
}
|
|
18111
|
+
},
|
|
18112
|
+
"required": props.required
|
|
18102
18113
|
};
|
|
18103
18114
|
if (buttonsForColumnOperations.length) {
|
|
18104
18115
|
inputTableSchema.columns.unshift({
|
|
@@ -18193,7 +18204,8 @@ const getAmisInputTableSchema = async (props) => {
|
|
|
18193
18204
|
"visible": props.$schema.visible,
|
|
18194
18205
|
"hiddenOn": props.$schema.hiddenOn,
|
|
18195
18206
|
"hidden": props.$schema.hidden,
|
|
18196
|
-
|
|
18207
|
+
"required": props.required,
|
|
18208
|
+
className,
|
|
18197
18209
|
};
|
|
18198
18210
|
// console.log("===schema===", schema);
|
|
18199
18211
|
return schema;
|
|
@@ -21167,6 +21179,9 @@ var AmisObjectButton = function (props) {
|
|
|
21167
21179
|
if (schema && schema.body.length > 0) {
|
|
21168
21180
|
delete schema.body[0]['visibleOn'];
|
|
21169
21181
|
}
|
|
21182
|
+
if (schema && schema.body.length > 0 && button.visibleOn) {
|
|
21183
|
+
schema.body[0]['visibleOn'] = button.visibleOn;
|
|
21184
|
+
}
|
|
21170
21185
|
if (schema && className) {
|
|
21171
21186
|
schema.className = schema.className + ' steedos-object-button ' + className;
|
|
21172
21187
|
}
|
|
@@ -22545,7 +22560,7 @@ var AmisGlobalFooter = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22545
22560
|
isMobile = window.innerWidth <= 768;
|
|
22546
22561
|
className = 'steedos-global-footer';
|
|
22547
22562
|
footerNavEach = "\n const classIcon = tab.icon.replace(/_/g,\"-\");\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 truncate text-gray-700 block -ml-px no-underline group flex items-center text-[11px] rounded-md flex-col leading-3 nav-label'><svg class=\"slds-icon slds-icon_container slds-icon-standard-`+classIcon+` flex-shrink-0 h-10 w-10\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg><span class=\"truncate\" style=\"max-width: 20vw\">${tab.name}</span></span>`,\n className:'h-full flex items-center'\n },\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"' && !isMenuNavVisible}\"\n });\n ";
|
|
22548
|
-
footerNavScript = "\n
|
|
22563
|
+
footerNavScript = "\n _.each(_.slice(payload.children, 0, 3), (tab,index)=>{\n ".concat(footerNavEach, "\n })\n data.nav.push({\n \"label\": {\n type: 'tpl',\n tpl: `<span class=' truncate text-gray-700 block -ml-px no-underline group flex items-center text-[11px] rounded-md flex-col leading-3 nav-label'><svg class=\"fill-slate-500 flex-shrink-0 !h-10 !w-10\" style=\"padding:7px\"><use xlink:href=\"/assets/icons/utility-sprite/svg/symbols.svg#rows\"></use></svg><span class=\"truncate\" style=\"max-width: 20vw\">").concat(instance.t('frontend_menu'), "</span></span>`,\n className:'h-full flex items-center'\n },\n \"id\": \"__menu__\",\n \"activeOn\": \"\\\\${isMenuNavVisible}\",\n \"isMenu\": true,\n \"menuReRengder\": \"${isMenuNavVisible}\"//\u4E3A\u4E86menu\u80FD\u6B63\u5E38\u663E\u793A\u9AD8\u4EAE\uFF0C\u89E6\u53D1\u91CD\u65B0\u6E32\u67D3\n });\n ");
|
|
22549
22564
|
menuNavScript = "\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, function(tab){\n const classIcon = tab.icon.replace(/_/g, \"-\");\n data.links.push({\n \"label\": {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-gray-700 block -ml-px no-underline group flex items-center text-lg font-medium rounded-md flex-row leading-3 nav-label'><svg class=\"mr-3 slds-icon slds-icon_container slds-icon-standard-` + classIcon + ` flex-shrink-0 h-10 w-10\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#` + tab.icon + `\"></use></svg><span>` + tab.name +`</span><i class=\"fa fa-angle-right\" aria-hidden=\"true\" style=\"position: absolute;right: 20px;color: #bababa;\"></i></span>`,\n className: 'h-full flex items-center'\n },\n \"to\": tab.path,\n \"target\": tab.target,\n \"id\": tab.id,\n \"activeOn\": \"false\",\n \"className\": \"border-b border-gray-200 py-2.5\"\n });\n })\n } else {\n var tabGroup = _.find(tab_groups, { \"group_name\": groupName });\n data.links.push({\n \"label\": groupName,\n \"unfolded\": tabGroup && tabGroup.default_open != false,\n \"isGroup\": true,\n \"mode\": \"group\",\n \"children\": _.sortBy(_.map(tabs, (tab) => {\n const classIcon = tab.icon.replace(/_/g, \"-\");\n return {\n \"label\": {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-gray-700 block -ml-px no-underline group flex items-center text-lg font-medium rounded-md flex-row leading-3 nav-label'><svg class=\"mr-3 slds-icon slds-icon_container slds-icon-standard-` + classIcon + ` flex-shrink-0 h-10 w-10\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#` + tab.icon + `\"></use></svg><span>` + tab.name +`</span><i class=\"fa fa-angle-right\" aria-hidden=\"true\" style=\"position: absolute;right: 20px;color: #bababa;\"></i></span>`,\n className: 'h-full flex items-center'\n },\n \"to\": tab.path,\n \"target\": tab.target,\n \"id\": tab.id,\n \"activeOn\": \"false\",\n \"className\": \"border-b border-gray-200 py-2.5\"\n }\n }), function (tab){ return tab.index })\n })\n }\n });\n data.links = _.sortBy(data.links, function (tab) {\n if (tab.isGroup) {\n return _.findIndex(payload.tab_groups, function (group) {\n return group.group_name === tab.label;\n });\n } else {\n // \u6CA1\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u6309index\u6392\u5217\u5728\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u524D\u65B9\n return (tab.index || 0) - 1000;\n }\n })\n ";
|
|
22550
22565
|
schema = {};
|
|
22551
22566
|
if (links) {
|
|
@@ -22571,7 +22586,7 @@ var AmisGlobalFooter = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22571
22586
|
schemaApi: {
|
|
22572
22587
|
"method": "get",
|
|
22573
22588
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus?mobile=true"),
|
|
22574
|
-
"adaptor": "\n try {\n if(payload.children && payload.children.length == 0){\n
|
|
22589
|
+
"adaptor": "\n try {\n // if(payload.children && payload.children.length == 0){\n // payload.data = {};\n // return payload\n // }\n const data = { nav: [],links: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n const tab_groups = payload.tab_groups;\n payload.children = _.sortBy(payload.children, function(tab){\n return tab.index;\n })\n ").concat(footerNavScript, "\n ").concat(menuNavScript, "\n payload.data = {\n \"type\": \"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav,\n \"isMenuNavVisible\": false\n },\n \"id\": \"steedosMobileFooterService\",\n \"body\": [\n {\n \"type\": \"nav\",\n className: \"").concat(className, "\",\n \"stacked\": ").concat(stacked, ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"steedosMobileFooterService\",\n \"args\": {\n \"value\": {\n \"isMenuNavVisible\": \"${event.data.item.isMenu}\",\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n }\n ]\n }\n }\n },\n {\n \"type\": \"page\",\n \"bodyClassName\": \"p-0\",\n \"title\": {\n \"type\": \"steedos-app-launcher\",\n \"showAppName\": true,\n \"appId\": \"").concat(appId, "\",\n },\n \"className\": \"steedos-global-footer-menu-page\",\n \"visibleOn\": \"${isMenuNavVisible}\",\n \"body\": [\n {\n \"type\": \"nav\",\n \"id\": \"u:58c2a9249e9d\",\n \"stacked\": true,\n \"links\": data.links,\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"steedosMobileFooterService\",\n \"args\": {\n \"value\": {\n \"isMenuNavVisible\": false,\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n }\n ]\n }\n }\n }\n ]\n }\n ]\n \n };\n } catch (error) {\n console.log(`error`, error)\n }\n return payload;\n "),
|
|
22575
22590
|
"headers": {
|
|
22576
22591
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
22577
22592
|
}
|
|
@@ -23264,7 +23279,7 @@ var AmisFormInputs = [
|
|
|
23264
23279
|
'datetime',
|
|
23265
23280
|
'time',
|
|
23266
23281
|
'number',
|
|
23267
|
-
'password',
|
|
23282
|
+
// 'password',
|
|
23268
23283
|
'url',
|
|
23269
23284
|
'email'
|
|
23270
23285
|
];
|
|
@@ -23299,7 +23314,7 @@ function getAmisStaticFieldType(type, data_type, options) {
|
|
|
23299
23314
|
}
|
|
23300
23315
|
return "static-image";
|
|
23301
23316
|
}
|
|
23302
|
-
else if (type === 'textarea') {
|
|
23317
|
+
else if (type === 'textarea' || type === 'password') {
|
|
23303
23318
|
return 'static';
|
|
23304
23319
|
}
|
|
23305
23320
|
else if (type === 'html') {
|
|
@@ -23649,7 +23664,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
23649
23664
|
case 11:
|
|
23650
23665
|
if (!(steedosField.type === "password")) return [3 /*break*/, 12];
|
|
23651
23666
|
Object.assign(schema, {
|
|
23652
|
-
"
|
|
23667
|
+
"tpl": "******"
|
|
23653
23668
|
});
|
|
23654
23669
|
return [3 /*break*/, 20];
|
|
23655
23670
|
case 12:
|