@steedos-widgets/amis-object 1.2.5 → 1.2.6-beta.9

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.
@@ -13494,6 +13494,58 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
13494
13494
  });
13495
13495
  }); };
13496
13496
 
13497
+ /*
13498
+ * @Author: baozhoutao@steedos.com
13499
+ * @Date: 2022-09-01 14:44:57
13500
+ * @LastEditors: baozhoutao@steedos.com
13501
+ * @LastEditTime: 2023-04-11 13:51:50
13502
+ * @Description:
13503
+ */
13504
+ var AmisGlobalFooter = function (props) { return __awaiter(void 0, void 0, void 0, function () {
13505
+ var _a, stacked, overflow, appId, data, _b, links, _c, showIcon, _d, indentSize, selectedId, isMobile, className, className1, schema;
13506
+ return __generator(this, function (_e) {
13507
+ _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.indentSize, indentSize = _d === void 0 ? 12 : _d, selectedId = props.selectedId;
13508
+ if (!appId) {
13509
+ appId = data.context.appId || 'admin';
13510
+ }
13511
+ isMobile = window.innerWidth <= 768;
13512
+ className = 'fixed bottom-0 z-20 flex justify-evenly w-full h-16 bg-gray-100 AmisGlobalFooter';
13513
+ className1 = 'fixed bottom-0 z-20 flex justify-center w-full h-16 bg-gray-100 AmisGlobalFooter';
13514
+ schema = {};
13515
+ if (links) {
13516
+ schema = {
13517
+ type: 'service',
13518
+ mobile: {
13519
+ body: [
13520
+ {
13521
+ "type": "nav",
13522
+ "className": links.length == 1 ? "".concat(className1) : "".concat(className),
13523
+ "stacked": stacked,
13524
+ "overflow": overflow,
13525
+ "indentSize": indentSize,
13526
+ "links": links
13527
+ }
13528
+ ]
13529
+ }
13530
+ };
13531
+ }
13532
+ else if (isMobile) {
13533
+ schema = {
13534
+ type: 'service',
13535
+ schemaApi: {
13536
+ "method": "get",
13537
+ "url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus?try=1111111"),
13538
+ "adaptor": "\n try {\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 _.each(payload.children, (tab)=>{\n data.nav.push({\n \"label\": {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[13px] font-medium rounded-md flex-col leading-3 nav-label'><svg class=\" flex-shrink-0 h-10 w-10\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`,\n className:'h-full flex items-center'\n },\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n });\n })\n\n payload.data = {\n \"type\": \"nav\",\n className: payload.children.length ==1 ? '").concat(className1, "' : '").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 return payload;\n "),
13539
+ "headers": {
13540
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
13541
+ }
13542
+ }
13543
+ };
13544
+ }
13545
+ return [2 /*return*/, schema];
13546
+ });
13547
+ }); };
13548
+
13497
13549
  /*
13498
13550
  * @Author: baozhoutao@steedos.com
13499
13551
  * @Date: 2022-09-01 14:44:57
@@ -13501,7 +13553,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
13501
13553
  * @LastEditTime: 2023-03-17 14:09:53
13502
13554
  * @Description:
13503
13555
  */
13504
- var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void 0, function () {
13556
+ var AmisGlobalHeaderToolbar = function (props) { return __awaiter(void 0, void 0, void 0, function () {
13505
13557
  var _a, className, data, _b, logoutScript, _c, customButtons, avatarSrc;
13506
13558
  var _d, _e;
13507
13559
  return __generator(this, function (_f) {
@@ -13513,7 +13565,7 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
13513
13565
  return [2 /*return*/, {
13514
13566
  "type": "wrapper",
13515
13567
  "id": "u:9c3d279be31a",
13516
- "className": "steedos-global-header leading-3\t".concat(className),
13568
+ "className": "steedos-global-header-toolbar leading-3\t".concat(className),
13517
13569
  "size": "xs",
13518
13570
  "body": __spreadArray(__spreadArray([], __read(customButtons), false), [
13519
13571
  {
@@ -13811,25 +13863,25 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
13811
13863
  },
13812
13864
  "level": "link"
13813
13865
  },
13814
- // {
13815
- // "type": "button",
13816
- // "label": "关于",
13817
- // "className": "flex",
13818
- // "onEvent": {
13819
- // "click": {
13820
- // "actions": [
13821
- // {
13822
- // "args": {
13823
- // "url": "/app/admin/page/creator_about",
13824
- // "blank": false
13825
- // },
13826
- // "actionType": "link"
13827
- // }
13828
- // ]
13829
- // }
13830
- // },
13831
- // "level": "link"
13832
- // },
13866
+ {
13867
+ "type": "button",
13868
+ "label": "关于",
13869
+ "className": "flex",
13870
+ "onEvent": {
13871
+ "click": {
13872
+ "actions": [
13873
+ {
13874
+ "args": {
13875
+ "url": "/app/-/page/about",
13876
+ "blank": false
13877
+ },
13878
+ "actionType": "link"
13879
+ }
13880
+ ]
13881
+ }
13882
+ },
13883
+ "level": "link"
13884
+ },
13833
13885
  {
13834
13886
  "type": "button",
13835
13887
  "label": "注销",
@@ -13858,6 +13910,194 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
13858
13910
  });
13859
13911
  }); };
13860
13912
 
13913
+ /*
13914
+ * @Author: baozhoutao@steedos.com
13915
+ * @Date: 2022-09-01 14:44:57
13916
+ * @LastEditors: baozhoutao@steedos.com
13917
+ * @LastEditTime: 2023-04-11 13:51:50
13918
+ * @Description:
13919
+ */
13920
+ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void 0, function () {
13921
+ var logoSrc, isMobile, schema;
13922
+ return __generator(this, function (_a) {
13923
+ logoSrc = props.logoSrc;
13924
+ isMobile = window.innerWidth <= 768;
13925
+ schema = {
13926
+ "type": "wrapper",
13927
+ "className": 'p-0',
13928
+ body: [
13929
+ {
13930
+ "type": "wrapper",
13931
+ "className": "bg-white sticky p-0 top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-50 sm:shadow border-b-[3px] border-sky-500 border-solid steedos-header-container",
13932
+ body: [
13933
+ {
13934
+ "type": "wrapper",
13935
+ "className": 'flex w-full px-4 h-[50px] p-0 justify-between items-center steedos-header-container-line-one',
13936
+ "body": [
13937
+ {
13938
+ type: "wrapper",
13939
+ className: 'p-0 flex flex-1 items-center',
13940
+ body: [
13941
+ {
13942
+ "type": "button",
13943
+ "className": "toggle-sidebar flex items-center pr-4",
13944
+ "hiddenOn": "true",
13945
+ "onEvent": {
13946
+ "click": {
13947
+ "actions": [
13948
+ {
13949
+ "actionType": "custom",
13950
+ "script": "document.body.classList.toggle('sidebar-open')",
13951
+ }
13952
+ ]
13953
+ }
13954
+ },
13955
+ "body": [
13956
+ {
13957
+ "type": "steedos-icon",
13958
+ "category": "utility",
13959
+ "name": "rows",
13960
+ "colorVariant": "default",
13961
+ "id": "u:afc3a08e8cf3",
13962
+ "className": "slds-button_icon slds-global-header__icon"
13963
+ }
13964
+ ],
13965
+ },
13966
+ {
13967
+ "className": 'block h-10 w-auto mr-4',
13968
+ "type": "tpl",
13969
+ "tpl": "<a href='/app' class='flex items-center '><img class='block h-10 w-auto' src='".concat(logoSrc, "'></a>"),
13970
+ },
13971
+ ],
13972
+ },
13973
+ {
13974
+ "type": "steedos-global-header-toolbar",
13975
+ "label": "Global Header",
13976
+ className: 'flex flex-nowrap gap-x-3 items-center',
13977
+ logoutScript: "window.signOut();",
13978
+ customButtons: [
13979
+ {
13980
+ "type": "button",
13981
+ "className": "toggle-sidebar",
13982
+ "visibleOn": "${AND(app.showSidebar,!" + isMobile + ")}",
13983
+ "onEvent": {
13984
+ "click": {
13985
+ "actions": [
13986
+ {
13987
+ "actionType": "custom",
13988
+ "script": "document.body.classList.toggle('sidebar-open')",
13989
+ }
13990
+ ]
13991
+ }
13992
+ },
13993
+ "body": [
13994
+ {
13995
+ "type": "steedos-icon",
13996
+ "category": "utility",
13997
+ "name": "rows",
13998
+ "colorVariant": "default",
13999
+ "id": "u:afc3a08e8cf3",
14000
+ "className": "slds-button_icon slds-global-header__icon"
14001
+ }
14002
+ ],
14003
+ },
14004
+ {
14005
+ "type": "steedos-app-launcher",
14006
+ "showAppName": false,
14007
+ "appId": "${app.id}",
14008
+ "visibleOn": "${isMobile}"
14009
+ }
14010
+ ]
14011
+ }
14012
+ ],
14013
+ },
14014
+ {
14015
+ "type": "grid",
14016
+ "className": 'steedos-context-bar flex flex-nowrap h-10 leading-5 pl-4 mb-[-3px] steedos-header-container-line-two',
14017
+ "hiddenOn": "${" + isMobile + "}",
14018
+ "columns": [
14019
+ {
14020
+ "columnClassName": "items-center flex pb-0",
14021
+ "body": [
14022
+ {
14023
+ "type": "steedos-app-launcher",
14024
+ "showAppName": true,
14025
+ "appId": "${app.id}",
14026
+ }
14027
+ ],
14028
+ "md": "auto",
14029
+ "valign": "middle"
14030
+ },
14031
+ {
14032
+ "columnClassName": "flex overflow-hidden",
14033
+ "hiddenOn": "${app.showSidebar === true}",
14034
+ "body": [
14035
+ {
14036
+ "visibleOn": "${AND(!app.showSidebar,!" + isMobile + ")}",
14037
+ "type": "steedos-app-menu",
14038
+ "stacked": false,
14039
+ showIcon: false,
14040
+ "appId": "${app.id}",
14041
+ overflow: {
14042
+ enable: false,
14043
+ itemWidth: 80,
14044
+ },
14045
+ "id": "u:77851eb4aa89",
14046
+ }
14047
+ ],
14048
+ "id": "u:5367229505d8",
14049
+ "md": "",
14050
+ "valign": "middle",
14051
+ }
14052
+ ],
14053
+ },
14054
+ ],
14055
+ },
14056
+ {
14057
+ "type": "button",
14058
+ "className": 'p-0 absolute inset-0 mt-[50px] sm:mt-[90px]',
14059
+ hiddenOn: "${app.showSidebar != true}",
14060
+ body: [
14061
+ {
14062
+ type: "wrapper",
14063
+ className: 'sidebar-wrapper px-0 pt-4 pb-16 fixed z-20 h-full h-fill ease-in-out duration-300 flex flex-col border-r overflow-y-auto bg-white border-slate-200 block -translate-x-0 sm:w-[220px] w-64',
14064
+ body: [
14065
+ {
14066
+ "type": "steedos-app-launcher",
14067
+ "className": "px-4 pb-4",
14068
+ "visibleOn": "${isMobile}",
14069
+ "showAppName": true
14070
+ },
14071
+ {
14072
+ "type": "steedos-app-menu",
14073
+ "stacked": true,
14074
+ "appId": "${app.id}",
14075
+ },
14076
+ ]
14077
+ },
14078
+ {
14079
+ "type": "wrapper",
14080
+ "className": 'sidebar-overlay',
14081
+ "hiddenOn": "${!isMobile}",
14082
+ }
14083
+ ],
14084
+ "onEvent": {
14085
+ "click": {
14086
+ "actions": [
14087
+ {
14088
+ "actionType": "custom",
14089
+ "script": "console.log(event.target); if(window.innerWidth < 768){ document.body.classList.remove('sidebar-open'); }",
14090
+ }
14091
+ ]
14092
+ }
14093
+ },
14094
+ },
14095
+ ],
14096
+ };
14097
+ return [2 /*return*/, schema];
14098
+ });
14099
+ }); };
14100
+
13861
14101
  var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void 0, function () {
13862
14102
  var steedosField, field, _a, readonly, _b, ctx, config, $schema, schema, error_1;
13863
14103
  return __generator(this, function (_c) {
@@ -13906,39 +14146,42 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
13906
14146
  * @Author: baozhoutao@steedos.com
13907
14147
  * @Date: 2023-01-14 16:41:24
13908
14148
  * @LastEditors: baozhoutao@steedos.com
13909
- * @LastEditTime: 2023-03-23 18:00:25
14149
+ * @LastEditTime: 2023-04-21 11:50:26
13910
14150
  * @Description:
13911
14151
  */
13912
14152
  var getSelectFlowSchema = function (id, props) {
13913
14153
  var label = props.label, data = props.data, name = props.name, required = props.required, _a = props.action, action = _a === void 0 ? 'query' : _a, _b = props.distributeInstanceId, distributeInstanceId = _b === void 0 ? "" : _b, _c = props.distributeStepId, distributeStepId = _c === void 0 ? "" : _c, _d = props.mode, mode = _d === void 0 ? 'input-tree' : _d, className = props.className, onEvent = props.onEvent, _e = props.multiple, multiple = _e === void 0 ? false : _e, delimiter = props.delimiter, joinValues = props.joinValues, extractValue = props.extractValue, searchable = props.searchable, _f = props.showIcon, showIcon = _f === void 0 ? true : _f, _g = props.showRadio, showRadio = _g === void 0 ? false : _g, showOutline = props.showOutline, initiallyOpen = props.initiallyOpen, unfoldedLevel = props.unfoldedLevel, treeContainerClassName = props.treeContainerClassName, _h = props.amis, amis = _h === void 0 ? {} : _h;
13914
14154
  console.log("=====onEvent", onEvent);
13915
- return __assign$2({ "type": mode, "id": id, "label": label, "name": name, "options": [], "multiple": multiple, "delimiter": delimiter, "joinValues": joinValues, "extractValue": extractValue, "searchable": searchable, "showOutline": showOutline, "initiallyOpen": initiallyOpen, "unfoldedLevel": unfoldedLevel, "className": className, "required": required, "treeContainerClassName": treeContainerClassName, "menuTpl": {
13916
- // type: "button",
13917
- type: "tpl",
13918
- tpl: "<div class='flex justify-between'><span>${label}</span><span class='rounded p-1 text-xs text-center w-14 ${children != null ? \'hidden\' : \'\'}'><button><i class='fa-regular fa-star'></i></button></span></div>",
13919
- "onEvent": {
13920
- "click": {
13921
- "weight": 0,
13922
- "actions": [
13923
- {
13924
- actionType: 'custom',
13925
- script: "console.log('====event', event), event.preventDefault(); event.stopPropagation()"
13926
- },
13927
- {
13928
- "args": {
13929
- "api": {
13930
- "url": "/aaa",
13931
- "method": "get",
13932
- "messages": {}
13933
- }
13934
- },
13935
- "actionType": "download",
13936
- "stopPropagation": true
13937
- }
13938
- ]
13939
- }
13940
- }
13941
- }, "source": {
14155
+ return __assign$2({ "type": mode, "id": id, "label": label, "name": name, "options": [], "multiple": multiple, "delimiter": delimiter, "joinValues": joinValues, "extractValue": extractValue, "searchable": searchable, "showOutline": showOutline, "initiallyOpen": initiallyOpen, "unfoldedLevel": unfoldedLevel, "className": className, "required": required, "treeContainerClassName": treeContainerClassName,
14156
+ // "menuTpl": {
14157
+ // // type: "button",
14158
+ // type: "tpl",
14159
+ // tpl: "<div class='flex justify-between'><span>${label}</span><span class='rounded p-1 text-xs text-center w-14 ${children != null ? \'hidden\' : \'\'}'><button><i class='fa-regular fa-star'></i></button></span></div>",
14160
+ // "onEvent": {
14161
+ // "click": {
14162
+ // "weight": 0,
14163
+ // "actions": [
14164
+ // {
14165
+ // actionType: 'custom',
14166
+ // script: "console.log('====event', event), event.preventDefault(); event.stopPropagation()"
14167
+ // },
14168
+ // {
14169
+ // "args": {
14170
+ // "api": {
14171
+ // "url": "/aaa",
14172
+ // "method": "get",
14173
+ // "messages": {
14174
+ // }
14175
+ // }
14176
+ // },
14177
+ // "actionType": "download",
14178
+ // "stopPropagation": true
14179
+ // }
14180
+ // ]
14181
+ // }
14182
+ // }
14183
+ // },
14184
+ "source": {
13942
14185
  "method": "post",
13943
14186
  "url": "${context.rootUrl}/graphql?keywords=${keywords}",
13944
14187
  "requestAdaptor": "\n const keywords = api.body.keywords || '';\n const appId = '".concat(data.app_id || '', "';\n api.data = {\n query: `\n {\n options: flows__getList(action: \"").concat(action, "\", keywords: \"${keywords}\", appId: \"${appId}\", distributeInstanceId: \"").concat(distributeInstanceId, "\", distributeStepId: \"").concat(distributeStepId, "\"){\n value:_id\n label:name\n children: flows{\n value: _id,\n label: name\n }\n }\n }\n `\n }\n "),
@@ -14191,7 +14434,9 @@ var index_esm = /*#__PURE__*/Object.freeze({
14191
14434
 
14192
14435
  exports.AmisAppLauncher = AmisAppLauncher;
14193
14436
  exports.AmisAppMenu = AmisAppMenu;
14437
+ exports.AmisGlobalFooter = AmisGlobalFooter;
14194
14438
  exports.AmisGlobalHeader = AmisGlobalHeader;
14439
+ exports.AmisGlobalHeaderToolbar = AmisGlobalHeaderToolbar;
14195
14440
  exports.AmisInstanceDetail = AmisInstanceDetail;
14196
14441
  exports.AmisLib = index_esm$1;
14197
14442
  exports.AmisLogo = AmisLogo;